From: support Date: Mon, 4 Jul 2022 10:43:27 +0000 (+0000) Subject: Built motion from commit ed019234.|2.6.12 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=183f5c7682288b838e6ade5bd47e73b92e9f7089;p=motion2.git Built motion from commit ed019234.|2.6.12 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3b0bd97..42d60f7 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-07-04T10:10:28.528Z", + "time": "2022-07-04T10:35:45.299Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 6c25c6b..a6a028c 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-07-04T10:10:28.528Z", + "time": "2022-07-04T10:35:45.299Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index a8084fa..09d96ff 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 _0xa123=['exports','getDataValue','STRING','contactManager','integration','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x454b56,_0x17c376){var _0x43c89a=function(_0x271fc4){while(--_0x271fc4){_0x454b56['push'](_0x454b56['shift']());}};_0x43c89a(++_0x17c376);}(_0xa123,0x1c2));var _0x3a12=function(_0x1f125d,_0x1b9a0e){_0x1f125d=_0x1f125d-0x0;var _0x1ed1c6=_0xa123[_0x1f125d];return _0x1ed1c6;};'use strict';var Sequelize=require('sequelize');module[_0x3a12('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x165f48){return this[_0x3a12('0x1')]('action');}},'action':{'type':Sequelize[_0x3a12('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3a12('0x3'),_0x3a12('0x4'),'motionbar',_0x3a12('0x5'),_0x3a12('0x6'),'browser',_0x3a12('0x7'),_0x3a12('0x8')]],'msg':_0x3a12('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x3a12('0x2')](0x1000),'comment':_0x3a12('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'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[_0x3a12('0x2')](0x1000),'comments':_0x3a12('0xb')},'data5':{'type':Sequelize[_0x3a12('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3a12('0x2')],'comments':_0x3a12('0xc')},'data7':{'type':Sequelize[_0x3a12('0xd')],'comments':_0x3a12('0xe')}}; \ No newline at end of file +var _0x4621=['motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','action','contactManager','integration'];(function(_0x5c4178,_0x11471c){var _0x384e71=function(_0x4ff0db){while(--_0x4ff0db){_0x5c4178['push'](_0x5c4178['shift']());}};_0x384e71(++_0x11471c);}(_0x4621,0x16d));var _0x1462=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4621[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x508e57){return this['getDataValue'](_0x1462('0x0'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x1462('0x1'),_0x1462('0x2'),_0x1462('0x3'),_0x1462('0x4'),'urlForward',_0x1462('0x5'),_0x1462('0x6'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1462('0x7')},'data1':{'type':Sequelize[_0x1462('0x8')](0x1000),'comment':_0x1462('0x9')},'data2':{'type':Sequelize[_0x1462('0x8')](0x1000),'comment':_0x1462('0xa')},'data3':{'type':Sequelize[_0x1462('0x8')](0x1000),'comment':_0x1462('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x1462('0xc')},'data5':{'type':Sequelize[_0x1462('0x8')](0x1000),'comments':_0x1462('0xd')},'data6':{'type':Sequelize[_0x1462('0x8')],'comments':_0x1462('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x1462('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1000eb5..87f26f0 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 _0xd147=['end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3d7f24,_0x173ddc){var _0x5ac39f=function(_0x10c014){while(--_0x10c014){_0x3d7f24['push'](_0x3d7f24['shift']());}};_0x5ac39f(++_0x173ddc);}(_0xd147,0x17b));var _0x7d14=function(_0x420c79,_0x4a42ea){_0x420c79=_0x420c79-0x0;var _0x3cd397=_0xd147[_0x420c79];return _0x3cd397;};'use strict';var emlformat=require(_0x7d14('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d14('0x1'));var jsonpatch=require(_0x7d14('0x2'));var rp=require('request-promise');var moment=require(_0x7d14('0x3'));var BPromise=require(_0x7d14('0x4'));var Mustache=require(_0x7d14('0x5'));var util=require('util');var path=require(_0x7d14('0x6'));var sox=require(_0x7d14('0x7'));var csv=require(_0x7d14('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d14('0x9'));var _=require(_0x7d14('0xa'));var squel=require(_0x7d14('0xb'));var crypto=require(_0x7d14('0xc'));var jsforce=require(_0x7d14('0xd'));var deskjs=require(_0x7d14('0xe'));var toCsv=require(_0x7d14('0x8'));var querystring=require(_0x7d14('0xf'));var Papa=require(_0x7d14('0x10'));var Redis=require(_0x7d14('0x11'));var authService=require(_0x7d14('0x12'));var qs=require(_0x7d14('0x13'));var as=require(_0x7d14('0x14'));var hardwareService=require(_0x7d14('0x15'));var logger=require(_0x7d14('0x16'))(_0x7d14('0x17'));var utils=require(_0x7d14('0x18'));var config=require(_0x7d14('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d14('0x1a'))['db'];function respondWithStatusCode(_0x295263,_0x51719d){_0x51719d=_0x51719d||0xcc;return function(_0x54a961){if(_0x54a961){return _0x295263[_0x7d14('0x1b')](_0x51719d);}return _0x295263[_0x7d14('0x1c')](_0x51719d)[_0x7d14('0x1d')]();};}function respondWithResult(_0x49dd85,_0x409b87){_0x409b87=_0x409b87||0xc8;return function(_0x1d846a){if(_0x1d846a){return _0x49dd85[_0x7d14('0x1c')](_0x409b87)[_0x7d14('0x1e')](_0x1d846a);}};}function respondWithFilteredResult(_0x3ff9a3,_0x441259){return function(_0x59442f){if(_0x59442f){var _0x2c4a9e=typeof _0x441259['offset']===_0x7d14('0x1f')&&typeof _0x441259['limit']===_0x7d14('0x1f');var _0x151e55=_0x59442f['count'];var _0x43525b=_0x2c4a9e?0x0:_0x441259[_0x7d14('0x20')];var _0x49df77=_0x2c4a9e?_0x59442f[_0x7d14('0x21')]:_0x441259[_0x7d14('0x20')]+_0x441259[_0x7d14('0x22')];var _0xa2f0b8;if(_0x49df77>=_0x151e55){_0x49df77=_0x151e55;_0xa2f0b8=0xc8;}else{_0xa2f0b8=0xce;}_0x3ff9a3[_0x7d14('0x1c')](_0xa2f0b8);return _0x3ff9a3['set'](_0x7d14('0x23'),_0x43525b+'-'+_0x49df77+'/'+_0x151e55)['json'](_0x59442f);}return null;};}function patchUpdates(_0x1dff09){return function(_0x389834){try{jsonpatch[_0x7d14('0x24')](_0x389834,_0x1dff09,!![]);}catch(_0x541fb1){return BPromise[_0x7d14('0x25')](_0x541fb1);}return _0x389834[_0x7d14('0x26')]();};}function saveUpdates(_0x2de0e9,_0x47c0d8){return function(_0x56f97b){if(_0x56f97b){return _0x56f97b[_0x7d14('0x27')](_0x2de0e9)[_0x7d14('0x28')](function(_0x308b89){return _0x308b89;});}return null;};}function removeEntity(_0x526bec,_0x19991d){return function(_0x127c13){if(_0x127c13){return _0x127c13[_0x7d14('0x29')]()[_0x7d14('0x28')](function(){_0x526bec[_0x7d14('0x1c')](0xcc)[_0x7d14('0x1d')]();});}};}function handleEntityNotFound(_0x54aa9e,_0xf3769){return function(_0x2661e0){if(!_0x2661e0){_0x54aa9e['sendStatus'](0x194);}return _0x2661e0;};}function handleError(_0x4a531b,_0x36ba7){_0x36ba7=_0x36ba7||0x1f4;return function(_0x3e71f0){logger[_0x7d14('0x2a')](_0x3e71f0[_0x7d14('0x2b')]);if(_0x3e71f0[_0x7d14('0x2c')]){delete _0x3e71f0[_0x7d14('0x2c')];}_0x4a531b[_0x7d14('0x1c')](_0x36ba7)[_0x7d14('0x2d')](_0x3e71f0);};}exports[_0x7d14('0x27')]=function(_0x5dc48e,_0x163c2f){if(_0x5dc48e[_0x7d14('0x2e')]['id']){delete _0x5dc48e[_0x7d14('0x2e')]['id'];}return db[_0x7d14('0x2f')][_0x7d14('0x30')]({'where':{'id':_0x5dc48e[_0x7d14('0x31')]['id']}})[_0x7d14('0x28')](handleEntityNotFound(_0x163c2f,null))['then'](saveUpdates(_0x5dc48e[_0x7d14('0x2e')],null))[_0x7d14('0x28')](respondWithResult(_0x163c2f,null))['catch'](handleError(_0x163c2f,null));};exports['destroy']=function(_0x1cec67,_0x2b6c8c){return db[_0x7d14('0x2f')][_0x7d14('0x30')]({'where':{'id':_0x1cec67['params']['id']}})[_0x7d14('0x28')](handleEntityNotFound(_0x2b6c8c,null))[_0x7d14('0x28')](removeEntity(_0x2b6c8c,null))[_0x7d14('0x32')](handleError(_0x2b6c8c,null));}; \ No newline at end of file +var _0x505d=['reject','save','then','end','error','name','send','body','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x19996d,_0x28545c){var _0x4c38bc=function(_0x3abcc8){while(--_0x3abcc8){_0x19996d['push'](_0x19996d['shift']());}};_0x4c38bc(++_0x28545c);}(_0x505d,0xcf));var _0xd505=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x505d[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require(_0xd505('0x0'));var rimraf=require(_0xd505('0x1'));var zipdir=require(_0xd505('0x2'));var jsonpatch=require(_0xd505('0x3'));var rp=require(_0xd505('0x4'));var moment=require(_0xd505('0x5'));var BPromise=require(_0xd505('0x6'));var Mustache=require(_0xd505('0x7'));var util=require(_0xd505('0x8'));var path=require(_0xd505('0x9'));var sox=require(_0xd505('0xa'));var csv=require(_0xd505('0xb'));var ejs=require(_0xd505('0xc'));var fs=require('fs');var fs_extra=require(_0xd505('0xd'));var _=require('lodash');var squel=require(_0xd505('0xe'));var crypto=require(_0xd505('0xf'));var jsforce=require(_0xd505('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd505('0xb'));var querystring=require(_0xd505('0x11'));var Papa=require('papaparse');var Redis=require(_0xd505('0x12'));var authService=require(_0xd505('0x13'));var qs=require(_0xd505('0x14'));var as=require(_0xd505('0x15'));var hardwareService=require(_0xd505('0x16'));var logger=require(_0xd505('0x17'))(_0xd505('0x18'));var utils=require(_0xd505('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd505('0x1a'));var db=require(_0xd505('0x1b'))['db'];function respondWithStatusCode(_0x317365,_0x100e6a){_0x100e6a=_0x100e6a||0xcc;return function(_0x23df6a){if(_0x23df6a){return _0x317365[_0xd505('0x1c')](_0x100e6a);}return _0x317365['status'](_0x100e6a)['end']();};}function respondWithResult(_0x363f23,_0x133c3b){_0x133c3b=_0x133c3b||0xc8;return function(_0xfba51f){if(_0xfba51f){return _0x363f23[_0xd505('0x1d')](_0x133c3b)[_0xd505('0x1e')](_0xfba51f);}};}function respondWithFilteredResult(_0x4b0a22,_0x58e470){return function(_0xf0a8c){if(_0xf0a8c){var _0x40a636=typeof _0x58e470[_0xd505('0x1f')]==='undefined'&&typeof _0x58e470['limit']===_0xd505('0x20');var _0x895405=_0xf0a8c['count'];var _0x2bfe26=_0x40a636?0x0:_0x58e470[_0xd505('0x1f')];var _0x2f5c2a=_0x40a636?_0xf0a8c[_0xd505('0x21')]:_0x58e470[_0xd505('0x1f')]+_0x58e470[_0xd505('0x22')];var _0x1399a0;if(_0x2f5c2a>=_0x895405){_0x2f5c2a=_0x895405;_0x1399a0=0xc8;}else{_0x1399a0=0xce;}_0x4b0a22[_0xd505('0x1d')](_0x1399a0);return _0x4b0a22[_0xd505('0x23')](_0xd505('0x24'),_0x2bfe26+'-'+_0x2f5c2a+'/'+_0x895405)[_0xd505('0x1e')](_0xf0a8c);}return null;};}function patchUpdates(_0x5ccc7b){return function(_0x161c85){try{jsonpatch[_0xd505('0x25')](_0x161c85,_0x5ccc7b,!![]);}catch(_0x56b78f){return BPromise[_0xd505('0x26')](_0x56b78f);}return _0x161c85[_0xd505('0x27')]();};}function saveUpdates(_0x360e08,_0x86055c){return function(_0x172da6){if(_0x172da6){return _0x172da6['update'](_0x360e08)[_0xd505('0x28')](function(_0x3ec700){return _0x3ec700;});}return null;};}function removeEntity(_0x15761a,_0xe9d707){return function(_0x50c180){if(_0x50c180){return _0x50c180['destroy']()[_0xd505('0x28')](function(){_0x15761a[_0xd505('0x1d')](0xcc)[_0xd505('0x29')]();});}};}function handleEntityNotFound(_0x16f990,_0x495281){return function(_0x4e61cd){if(!_0x4e61cd){_0x16f990[_0xd505('0x1c')](0x194);}return _0x4e61cd;};}function handleError(_0x5ab1ee,_0x1040a5){_0x1040a5=_0x1040a5||0x1f4;return function(_0x4d7335){logger[_0xd505('0x2a')](_0x4d7335['stack']);if(_0x4d7335[_0xd505('0x2b')]){delete _0x4d7335['name'];}_0x5ab1ee['status'](_0x1040a5)[_0xd505('0x2c')](_0x4d7335);};}exports['update']=function(_0x52381f,_0xa82ffd){if(_0x52381f[_0xd505('0x2d')]['id']){delete _0x52381f[_0xd505('0x2d')]['id'];}return db['Action'][_0xd505('0x2e')]({'where':{'id':_0x52381f[_0xd505('0x2f')]['id']}})[_0xd505('0x28')](handleEntityNotFound(_0xa82ffd,null))[_0xd505('0x28')](saveUpdates(_0x52381f[_0xd505('0x2d')],null))[_0xd505('0x28')](respondWithResult(_0xa82ffd,null))[_0xd505('0x30')](handleError(_0xa82ffd,null));};exports['destroy']=function(_0x30f057,_0x257c93){return db['Action']['find']({'where':{'id':_0x30f057['params']['id']}})[_0xd505('0x28')](handleEntityNotFound(_0x257c93,null))[_0xd505('0x28')](removeEntity(_0x257c93,null))['catch'](handleError(_0x257c93,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 0117d04..b4e1ca3 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 _0x45b1=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x3566de,_0x1bec4d){var _0x256439=function(_0xffc93d){while(--_0xffc93d){_0x3566de['push'](_0x3566de['shift']());}};_0x256439(++_0x1bec4d);}(_0x45b1,0x1c8));var _0x145b=function(_0x57a4ed,_0x5772d3){_0x57a4ed=_0x57a4ed-0x0;var _0x51e48f=_0x45b1[_0x57a4ed];return _0x51e48f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x145b('0x0'))(_0x145b('0x1'));var moment=require(_0x145b('0x2'));var BPromise=require(_0x145b('0x3'));var rp=require(_0x145b('0x4'));var fs=require('fs');var path=require(_0x145b('0x5'));var rimraf=require('rimraf');var config=require(_0x145b('0x6'));var attributes=require(_0x145b('0x7'));module[_0x145b('0x8')]=function(_0x3e7b2f,_0x5159bb){return _0x3e7b2f[_0x145b('0x9')](_0x145b('0xa'),attributes,{'tableName':_0x145b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf62d=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf62d,0x13e));var _0xdf62=function(_0x46a748,_0x435b16){_0x46a748=_0x46a748-0x0;var _0xbace90=_0xf62d[_0x46a748];return _0xbace90;};'use strict';var _=require(_0xdf62('0x0'));var util=require(_0xdf62('0x1'));var logger=require(_0xdf62('0x2'))('api');var moment=require(_0xdf62('0x3'));var BPromise=require(_0xdf62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf62('0x5'));var rimraf=require(_0xdf62('0x6'));var config=require(_0xdf62('0x7'));var attributes=require(_0xdf62('0x8'));module[_0xdf62('0x9')]=function(_0x4b90d5,_0x2a3d8f){return _0x4b90d5[_0xdf62('0xa')](_0xdf62('0xb'),attributes,{'tableName':_0xdf62('0xc'),'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 b08279e..116017c 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x405b0b,_0x190562){var _0x35fa72=function(_0x48fe23){while(--_0x48fe23){_0x405b0b['push'](_0x405b0b['shift']());}};_0x35fa72(++_0x190562);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x5fc3[_0x4fd109];return _0x30f0a6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x10b477,_0x3f5cbf){var _0x311ed4=function(_0x4a12dd){while(--_0x4a12dd){_0x10b477['push'](_0x10b477['shift']());}};_0x311ed4(++_0x3f5cbf);}(_0x5fab,0x177));var _0xb5fa=function(_0x358f87,_0x5a4d20){_0x358f87=_0x358f87-0x0;var _0x4b2fdb=_0x5fab[_0x358f87];return _0x4b2fdb;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 5f2a34d..bb464fc 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 _0x9f48=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x66a30a,_0xda9ffc){var _0x2cc7b6=function(_0x34094d){while(--_0x34094d){_0x66a30a['push'](_0x66a30a['shift']());}};_0x2cc7b6(++_0xda9ffc);}(_0x9f48,0x199));var _0x89f4=function(_0xce3b8a,_0x4e3028){_0xce3b8a=_0xce3b8a-0x0;var _0x10f6cb=_0x9f48[_0xce3b8a];return _0x10f6cb;};'use strict';var multer=require(_0x89f4('0x0'));var util=require(_0x89f4('0x1'));var path=require(_0x89f4('0x2'));var timeout=require(_0x89f4('0x3'));var express=require(_0x89f4('0x4'));var router=express[_0x89f4('0x5')]();var fs_extra=require(_0x89f4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x89f4('0x7'));var config=require(_0x89f4('0x8'));var controller=require(_0x89f4('0x9'));router[_0x89f4('0xa')](_0x89f4('0xb'),auth[_0x89f4('0xc')](),controller['update']);router[_0x89f4('0xd')](_0x89f4('0xb'),auth['isAuthenticated'](),controller[_0x89f4('0xe')]);module[_0x89f4('0xf')]=router; \ No newline at end of file +var _0xede7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','util','path'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0xede7,0x1a2));var _0x7ede=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0xede7[_0x2f1172];return _0x58e374;};'use strict';var multer=require('multer');var util=require(_0x7ede('0x0'));var path=require(_0x7ede('0x1'));var timeout=require(_0x7ede('0x2'));var express=require(_0x7ede('0x3'));var router=express[_0x7ede('0x4')]();var fs_extra=require(_0x7ede('0x5'));var auth=require(_0x7ede('0x6'));var interaction=require(_0x7ede('0x7'));var config=require('../../config/environment');var controller=require(_0x7ede('0x8'));router[_0x7ede('0x9')](_0x7ede('0xa'),auth[_0x7ede('0xb')](),controller[_0x7ede('0xc')]);router['delete']('/:id',auth[_0x7ede('0xb')](),controller[_0x7ede('0xd')]);module[_0x7ede('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 1ec6e02..379b5ea 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x300cd6,_0x1a89ef){var _0x99c2b8=function(_0x597f33){while(--_0x597f33){_0x300cd6['push'](_0x300cd6['shift']());}};_0x99c2b8(++_0x1a89ef);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x43a602,_0x4fe4ef){var _0x5b085c=function(_0xf6f6c4){while(--_0xf6f6c4){_0x43a602['push'](_0x43a602['shift']());}};_0x5b085c(++_0x4fe4ef);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x16bd44,_0x3c91ba){_0x16bd44=_0x16bd44-0x0;var _0x368a61=_0xf2ca[_0x16bd44];return _0x368a61;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 30cd170..dd60e9c 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 _0xb77a=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','params','find','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%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\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','IS\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','parse','parentKey','foreignKey','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','output','../../files/reports','countTable','COUNT(*)','run','getFields','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','error','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0xb77a,0x11b));var _0xab77=function(_0x2ea1f7,_0x4cb06c){_0x2ea1f7=_0x2ea1f7-0x0;var _0x1474e0=_0xb77a[_0x2ea1f7];return _0x1474e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab77('0x0'));var jsonpatch=require(_0xab77('0x1'));var rp=require(_0xab77('0x2'));var moment=require(_0xab77('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xab77('0x4'));var util=require(_0xab77('0x5'));var path=require(_0xab77('0x6'));var sox=require(_0xab77('0x7'));var csv=require('to-csv');var ejs=require(_0xab77('0x8'));var fs=require('fs');var fs_extra=require(_0xab77('0x9'));var _=require('lodash');var squel=require(_0xab77('0xa'));var crypto=require(_0xab77('0xb'));var jsforce=require(_0xab77('0xc'));var deskjs=require(_0xab77('0xd'));var toCsv=require(_0xab77('0xe'));var querystring=require(_0xab77('0xf'));var Papa=require(_0xab77('0x10'));var Redis=require(_0xab77('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xab77('0x12'));var as=require(_0xab77('0x13'));var hardwareService=require(_0xab77('0x14'));var logger=require(_0xab77('0x15'))(_0xab77('0x16'));var utils=require('../../config/utils');var config=require(_0xab77('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xab77('0x18'))['db'];var dbH=require(_0xab77('0x18'))[_0xab77('0x19')];function respondWithStatusCode(_0x32e2a6,_0x304987){_0x304987=_0x304987||0xcc;return function(_0x381b92){if(_0x381b92){return _0x32e2a6[_0xab77('0x1a')](_0x304987);}return _0x32e2a6[_0xab77('0x1b')](_0x304987)['end']();};}function respondWithResult(_0x5be078,_0x244f03){_0x244f03=_0x244f03||0xc8;return function(_0x543b56){if(_0x543b56){return _0x5be078[_0xab77('0x1b')](_0x244f03)[_0xab77('0x1c')](_0x543b56);}};}function respondWithFilteredResult(_0x47b834,_0x1f5d13){return function(_0x3fc2b1){if(_0x3fc2b1){var _0x2e0706=typeof _0x1f5d13['offset']===_0xab77('0x1d')&&typeof _0x1f5d13[_0xab77('0x1e')]===_0xab77('0x1d');var _0x530bc9=_0x3fc2b1[_0xab77('0x1f')];var _0xaea9ed=_0x2e0706?0x0:_0x1f5d13['offset'];var _0x1a5ca9=_0x2e0706?_0x3fc2b1[_0xab77('0x1f')]:_0x1f5d13[_0xab77('0x20')]+_0x1f5d13[_0xab77('0x1e')];var _0x3c0786;if(_0x1a5ca9>=_0x530bc9){_0x1a5ca9=_0x530bc9;_0x3c0786=0xc8;}else{_0x3c0786=0xce;}_0x47b834[_0xab77('0x1b')](_0x3c0786);return _0x47b834[_0xab77('0x21')]('Content-Range',_0xaea9ed+'-'+_0x1a5ca9+'/'+_0x530bc9)[_0xab77('0x1c')](_0x3fc2b1);}return null;};}function patchUpdates(_0x2f2776){return function(_0x32b737){try{jsonpatch[_0xab77('0x22')](_0x32b737,_0x2f2776,!![]);}catch(_0xdb9708){return BPromise[_0xab77('0x23')](_0xdb9708);}return _0x32b737['save']();};}function saveUpdates(_0x16eaf5,_0x1cb041){return function(_0x17da48){if(_0x17da48){return _0x17da48[_0xab77('0x24')](_0x16eaf5)[_0xab77('0x25')](function(_0x116ca8){return _0x116ca8;});}return null;};}function removeEntity(_0x37228d,_0x4360d){return function(_0x4d0abc){if(_0x4d0abc){return _0x4d0abc[_0xab77('0x26')]()[_0xab77('0x25')](function(){var _0x5ca40b=_0x4d0abc[_0xab77('0x27')]({'plain':!![]});var _0x3cddcb=_0xab77('0x28');return db[_0xab77('0x29')][_0xab77('0x26')]({'where':{'type':_0x3cddcb,'resourceId':_0x5ca40b['id']}})[_0xab77('0x25')](function(){return _0x4d0abc;});})[_0xab77('0x25')](function(){_0x37228d['status'](0xcc)[_0xab77('0x2a')]();});}};}function handleEntityNotFound(_0x4331b0,_0x575b51){return function(_0x138c5a){if(!_0x138c5a){_0x4331b0['sendStatus'](0x194);}return _0x138c5a;};}function handleError(_0x20c675,_0x84a916){_0x84a916=_0x84a916||0x1f4;return function(_0x131d46){logger[_0xab77('0x2b')](_0x131d46['stack']);if(_0x131d46['name']){delete _0x131d46['name'];}_0x20c675[_0xab77('0x1b')](_0x84a916)[_0xab77('0x2c')](_0x131d46);};}exports[_0xab77('0x2d')]=function(_0x4d70fa,_0x2d4470){var _0x34e7b3={},_0x440f6c={},_0x267e73={'count':0x0,'rows':[]};var _0x435dba=_[_0xab77('0x2e')](db[_0xab77('0x2f')][_0xab77('0x30')],function(_0x21f6ee){return{'name':_0x21f6ee[_0xab77('0x31')],'type':_0x21f6ee[_0xab77('0x32')][_0xab77('0x33')]};});_0x440f6c[_0xab77('0x34')]=_['map'](_0x435dba,_0xab77('0x35'));_0x440f6c[_0xab77('0x36')]=_[_0xab77('0x37')](_0x4d70fa[_0xab77('0x36')]);_0x440f6c[_0xab77('0x38')]=_[_0xab77('0x39')](_0x440f6c[_0xab77('0x34')],_0x440f6c['query']);_0x34e7b3[_0xab77('0x3a')]=_['intersection'](_0x440f6c[_0xab77('0x34')],qs['fields'](_0x4d70fa[_0xab77('0x36')][_0xab77('0x3b')]));_0x34e7b3[_0xab77('0x3a')]=_0x34e7b3['attributes'][_0xab77('0x3c')]?_0x34e7b3[_0xab77('0x3a')]:_0x440f6c[_0xab77('0x34')];if(!_0x4d70fa[_0xab77('0x36')][_0xab77('0x3d')](_0xab77('0x3e'))){_0x34e7b3[_0xab77('0x1e')]=qs[_0xab77('0x1e')](_0x4d70fa[_0xab77('0x36')][_0xab77('0x1e')]);_0x34e7b3[_0xab77('0x20')]=qs['offset'](_0x4d70fa[_0xab77('0x36')]['offset']);}_0x34e7b3[_0xab77('0x3f')]=qs['sort'](_0x4d70fa[_0xab77('0x36')][_0xab77('0x40')]);_0x34e7b3[_0xab77('0x41')]=qs['filters'](_[_0xab77('0x42')](_0x4d70fa[_0xab77('0x36')],_0x440f6c[_0xab77('0x38')]),_0x435dba);if(_0x4d70fa[_0xab77('0x36')][_0xab77('0x43')]){_0x34e7b3[_0xab77('0x41')]=_['merge'](_0x34e7b3['where'],{'$or':_['map'](_0x435dba,function(_0x27ee59){if(_0x27ee59[_0xab77('0x32')]!==_0xab77('0x44')){var _0x3bc567={};_0x3bc567[_0x27ee59[_0xab77('0x35')]]={'$like':'%'+_0x4d70fa[_0xab77('0x36')][_0xab77('0x43')]+'%'};return _0x3bc567;}})});}_0x34e7b3=_[_0xab77('0x45')]({},_0x34e7b3,_0x4d70fa['options']);var _0x1ed2a2={'where':_0x34e7b3[_0xab77('0x41')]};return db[_0xab77('0x2f')][_0xab77('0x1f')](_0x1ed2a2)[_0xab77('0x25')](function(_0x163643){_0x267e73[_0xab77('0x1f')]=_0x163643;if(_0x4d70fa[_0xab77('0x36')]['includeAll']){_0x34e7b3[_0xab77('0x46')]=[{'all':!![]}];}return db[_0xab77('0x2f')][_0xab77('0x47')](_0x34e7b3);})['then'](function(_0x3d3a31){_0x267e73[_0xab77('0x48')]=_0x3d3a31;return _0x267e73;})['then'](respondWithFilteredResult(_0x2d4470,_0x34e7b3))['catch'](handleError(_0x2d4470,null));};exports[_0xab77('0x49')]=function(_0x2a2c96,_0x1dbf76){var _0x2f38d8={'raw':![],'where':{'id':_0x2a2c96['params']['id']}},_0x2aadda={};_0x2aadda[_0xab77('0x34')]=_['keys'](db[_0xab77('0x2f')][_0xab77('0x30')]);_0x2aadda[_0xab77('0x36')]=_[_0xab77('0x37')](_0x2a2c96[_0xab77('0x36')]);_0x2aadda[_0xab77('0x38')]=_[_0xab77('0x39')](_0x2aadda[_0xab77('0x34')],_0x2aadda[_0xab77('0x36')]);_0x2f38d8['attributes']=_[_0xab77('0x39')](_0x2aadda['model'],qs[_0xab77('0x3b')](_0x2a2c96[_0xab77('0x36')][_0xab77('0x3b')]));_0x2f38d8['attributes']=_0x2f38d8['attributes'][_0xab77('0x3c')]?_0x2f38d8[_0xab77('0x3a')]:_0x2aadda['model'];if(_0x2a2c96[_0xab77('0x36')][_0xab77('0x4a')]){_0x2f38d8[_0xab77('0x46')]=[{'all':!![]}];}_0x2f38d8=_['merge']({},_0x2f38d8,_0x2a2c96[_0xab77('0x4b')]);return db['AnalyticCustomReport']['find'](_0x2f38d8)[_0xab77('0x25')](handleEntityNotFound(_0x1dbf76,null))['then'](respondWithResult(_0x1dbf76,null))['catch'](handleError(_0x1dbf76,null));};exports[_0xab77('0x4c')]=function(_0x3cc81d,_0x2f2341){return db['AnalyticCustomReport'][_0xab77('0x4c')](_0x3cc81d[_0xab77('0x4d')],{})[_0xab77('0x25')](function(_0x317bd9){var _0x317420=_0x3cc81d[_0xab77('0x4e')][_0xab77('0x27')]({'plain':!![]});if(!_0x317420)throw new Error(_0xab77('0x4f'));if(_0x317420[_0xab77('0x50')]===_0xab77('0x4e')){var _0x14b413=_0x317bd9[_0xab77('0x27')]({'plain':!![]});var _0xcdb120=_0xab77('0x51');return db[_0xab77('0x52')]['find']({'where':{'name':_0xcdb120,'userProfileId':_0x317420[_0xab77('0x53')]},'raw':!![]})[_0xab77('0x25')](function(_0x118d8d){if(_0x118d8d&&_0x118d8d[_0xab77('0x54')]===0x0){return db[_0xab77('0x29')]['create']({'name':_0x14b413[_0xab77('0x35')],'resourceId':_0x14b413['id'],'type':_0xab77('0x28'),'sectionId':_0x118d8d['id']},{})[_0xab77('0x25')](function(){return _0x317bd9;});}else{return _0x317bd9;}})['catch'](function(_0x5021ee){logger[_0xab77('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5021ee);throw _0x5021ee;});}return _0x317bd9;})[_0xab77('0x25')](respondWithResult(_0x2f2341,0xc9))[_0xab77('0x55')](handleError(_0x2f2341,null));};exports[_0xab77('0x24')]=function(_0x16ab22,_0x3b81d8){if(_0x16ab22['body']['id']){delete _0x16ab22['body']['id'];}return db[_0xab77('0x2f')]['find']({'where':{'id':_0x16ab22[_0xab77('0x56')]['id']}})[_0xab77('0x25')](handleEntityNotFound(_0x3b81d8,null))['then'](saveUpdates(_0x16ab22['body'],null))[_0xab77('0x25')](respondWithResult(_0x3b81d8,null))['catch'](handleError(_0x3b81d8,null));};exports['destroy']=function(_0x2ca6f0,_0x422c33){return db['AnalyticCustomReport'][_0xab77('0x57')]({'where':{'id':_0x2ca6f0[_0xab77('0x56')]['id']}})[_0xab77('0x25')](handleEntityNotFound(_0x422c33,null))[_0xab77('0x25')](removeEntity(_0x422c33,null))[_0xab77('0x55')](handleError(_0x422c33,null));};exports[_0xab77('0x58')]=function(_0x28be5b,_0x371b14){var _0x1a69ac=0xa;var _0x20b07e=[_0xab77('0x59'),_0xab77('0x5a'),_0xab77('0x5b'),_0xab77('0x5c')];var _0x249514={'SUM':_0xab77('0x5d'),'COUNT':_0xab77('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xab77('0x5f'),'MIN':_0xab77('0x60'),'AVG':_0xab77('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xab77('0x62'),'GROUP_CONCAT DESC':_0xab77('0x63')};var _0x2fb432={'SEC_TO_TIME':_0xab77('0x64'),'DATE':_0xab77('0x65'),'HOUR':_0xab77('0x66'),'ROUND':_0xab77('0x67'),'UNIX_TIMESTAMP':_0xab77('0x68')};var _0xaa866f=function(_0x3f60f0){return!_[_0xab77('0x69')](['IS\x20NULL',_0xab77('0x6a'),_0xab77('0x6b'),_0xab77('0x6c')],_0x3f60f0);};var _0x37312f=function(_0x5e694c){if(!_0x5e694c||!_0x5e694c['rules']['length']){return'';}for(var _0x53fd7e='(',_0xa57fc3=0x0;_0xa57fc3<_0x5e694c['rules'][_0xab77('0x3c')];_0xa57fc3+=0x1){_0xa57fc3>0x0&&(_0x53fd7e+='\x20'+_0x5e694c['operator']+'\x20');_0x53fd7e+=_0x5e694c[_0xab77('0x6d')][_0xa57fc3][_0xab77('0x6e')]?_0x37312f(_0x5e694c[_0xab77('0x6d')][_0xa57fc3][_0xab77('0x6e')]):_0x5e694c[_0xab77('0x6d')][_0xa57fc3][_0xab77('0x6f')]+'\x20'+_0x5e694c[_0xab77('0x6d')][_0xa57fc3][_0xab77('0x70')]+(_0xaa866f(_0x5e694c[_0xab77('0x6d')][_0xa57fc3][_0xab77('0x70')])?'\x20'+_0x5e694c[_0xab77('0x6d')][_0xa57fc3][_0xab77('0x71')]:'');}return _0x53fd7e+')';};var _0x1a8d20={'where':{'id':_0x28be5b[_0xab77('0x56')]['id']}},_0x3e9b2f,_0x2683df,_0x5afa00,_0x3ef88c,_0x3444fe;_0x1a8d20=_[_0xab77('0x45')]({},_0x1a8d20,_0x28be5b['options']);return db[_0xab77('0x2f')][_0xab77('0x57')](_0x1a8d20)[_0xab77('0x25')](function(_0x3e05e){if(_0x3e05e){_0x3e9b2f=_0x3e05e;return _0x3e05e['getFields']();}return null;})[_0xab77('0x25')](function(_0x51b8a5){if(_0x51b8a5){if(!_0x51b8a5['length']){throw new db[(_0xab77('0x72'))][(_0xab77('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2683df=_0x51b8a5;return db[_0xab77('0x74')]['findAll']({'raw':!![]});}return null;})[_0xab77('0x25')](function(_0x58df3b){if(_0x58df3b){_0x5afa00=_['keyBy'](_0x58df3b,'id');var _0x539a43;var _0x2b13a1=squel[_0xab77('0x75')]();_0x2b13a1[_0xab77('0x76')](_0x3e9b2f[_0xab77('0x77')]);for(var _0x1b4dd0=0x0;_0x1b4dd0<_0x2683df[_0xab77('0x3c')];_0x1b4dd0+=0x1){_0x539a43=_0x2683df[_0x1b4dd0][_0xab77('0x78')]?_0x5afa00[_0x2683df[_0x1b4dd0][_0xab77('0x78')]][_0xab77('0x79')]:_0x2683df[_0x1b4dd0][_0xab77('0x6f')];_0x539a43=_0x2683df[_0x1b4dd0][_0xab77('0x7a')]?_['replace'](_0x249514[_0x2683df[_0x1b4dd0]['function']],'%s',_0x539a43):_0x539a43;_0x539a43=_0x2683df[_0x1b4dd0][_0xab77('0x7b')]?_[_0xab77('0x7c')](_0x2fb432[_0x2683df[_0x1b4dd0][_0xab77('0x7b')]],'%s',_0x539a43):_0x539a43;if(_0x2683df[_0x1b4dd0][_0xab77('0x7d')]){_0x2b13a1[_0xab77('0x6e')](_0x539a43);}_0x2683df[_0x1b4dd0][_0xab77('0x7e')]&&_0x2b13a1['order'](_0x539a43,_0x2683df[_0x1b4dd0][_0xab77('0x7e')]===_0xab77('0x7f')?![]:!![]);_0x2b13a1['field'](_0x539a43,_0x2683df[_0x1b4dd0][_0xab77('0x80')]||_0x539a43);}if(_0x3e9b2f[_0xab77('0x81')]){_0x3e9b2f[_0xab77('0x81')]=JSON['parse'](_0x3e9b2f[_0xab77('0x81')]);for(var _0x5994b1=0x0;_0x5994b1<_0x3e9b2f[_0xab77('0x81')]['length'];_0x5994b1+=0x1){if(_0x3e9b2f[_0xab77('0x81')][_0x5994b1][_0xab77('0x32')]&&_[_0xab77('0x69')](_0x20b07e,_0x3e9b2f[_0xab77('0x81')][_0x5994b1][_0xab77('0x32')])&&_0x3e9b2f[_0xab77('0x81')][_0x5994b1]['parentKey']&&_0x3e9b2f['joins'][_0x5994b1][_0xab77('0x82')]&&_0x3e9b2f[_0xab77('0x81')][_0x5994b1]['foreignKey']){_0x2b13a1[_0x3e9b2f['joins'][_0x5994b1][_0xab77('0x32')]](_0x3e9b2f[_0xab77('0x81')][_0x5994b1][_0xab77('0x82')],null,util[_0xab77('0x7b')](_0xab77('0x83'),_0x3e9b2f['table'],_0x3e9b2f[_0xab77('0x81')][_0x5994b1]['parentKey'],_0x3e9b2f[_0xab77('0x81')][_0x5994b1][_0xab77('0x82')],_0x3e9b2f[_0xab77('0x81')][_0x5994b1]['foreignKey']));}}}if(_0x3e9b2f['conditions']){_0x3e9b2f['conditions']=JSON['parse'](_0x3e9b2f[_0xab77('0x84')]);_0x2b13a1[_0xab77('0x41')](_0x37312f(_0x3e9b2f[_0xab77('0x84')][_0xab77('0x6e')]));}_0x3444fe=_0x2b13a1[_0xab77('0x85')]();_0x2b13a1['limit'](_0x1a69ac);_0x2b13a1[_0xab77('0x20')](0x0);logger[_0xab77('0x86')](_0xab77('0x87'),_0x2b13a1[_0xab77('0x88')]());return dbH[_0xab77('0x89')][_0xab77('0x36')](_0x2b13a1[_0xab77('0x88')](),{'type':dbH['sequelize'][_0xab77('0x8a')][_0xab77('0x8b')]});}})['then'](respondWithResult(_0x371b14,null))[_0xab77('0x55')](handleError(_0x371b14,null));};function runReport(_0x1096cc,_0x727d7c,_0x4b6db6){var _0x23cb58=_0x727d7c['name'];var _0x36975e=0xa;var _0x4f53b3=['join','left_join',_0xab77('0x5b'),_0xab77('0x5c')];var _0x44f2e3={'SUM':_0xab77('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xab77('0x8c'),'MAX':_0xab77('0x5f'),'MIN':_0xab77('0x60'),'AVG':_0xab77('0x61'),'GROUP_CONCAT':_0xab77('0x8d'),'GROUP_CONCAT ASC':_0xab77('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x147241={'SEC_TO_TIME':_0xab77('0x64'),'DATE':_0xab77('0x65'),'HOUR':_0xab77('0x66'),'ROUND':_0xab77('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x50dda8=function(_0x3cd828){return!_[_0xab77('0x69')]([_0xab77('0x8e'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xab77('0x6c')],_0x3cd828);};var _0x446b12=function(_0x30cbb0){if(!_0x30cbb0||!_0x30cbb0[_0xab77('0x6d')][_0xab77('0x3c')]){return'';}for(var _0x541cb0='(',_0x5ae4dc=0x0;_0x5ae4dc<_0x30cbb0[_0xab77('0x6d')][_0xab77('0x3c')];_0x5ae4dc+=0x1){_0x5ae4dc>0x0&&(_0x541cb0+='\x20'+_0x30cbb0[_0xab77('0x8f')]+'\x20');_0x541cb0+=_0x30cbb0[_0xab77('0x6d')][_0x5ae4dc][_0xab77('0x6e')]?_0x446b12(_0x30cbb0[_0xab77('0x6d')][_0x5ae4dc][_0xab77('0x6e')]):_0x30cbb0[_0xab77('0x6d')][_0x5ae4dc]['field']+'\x20'+_0x30cbb0[_0xab77('0x6d')][_0x5ae4dc][_0xab77('0x70')]+(_0x50dda8(_0x30cbb0[_0xab77('0x6d')][_0x5ae4dc]['condition'])?'\x20'+_0x30cbb0[_0xab77('0x6d')][_0x5ae4dc][_0xab77('0x71')]:'');}return _0x541cb0+')';};var _0x1b602a={'where':{'id':_0x1096cc['id']}},_0x2e0200,_0x384b63,_0x3ec071,_0xf47b42,_0x30e0f1;_0x1b602a=_[_0xab77('0x45')]({},_0x1b602a,_0x4b6db6);return db[_0xab77('0x2f')]['find'](_0x1b602a)['then'](function(_0x458a5a){if(_0x458a5a){_0x2e0200=_0x458a5a;return _0x458a5a['getFields']();}return null;})['then'](function(_0x1ac736){if(_0x1ac736){if(!_0x1ac736[_0xab77('0x3c')]){throw new db[(_0xab77('0x72'))][(_0xab77('0x73'))](_0xab77('0x90'),0x193);}_0x384b63=_0x1ac736;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xab77('0x25')](function(_0x5ee152){if(_0x5ee152){_0x3ec071=_[_0xab77('0x91')](_0x5ee152,'id');var _0x38b466;var _0x29bad6=squel[_0xab77('0x75')]();_0x29bad6[_0xab77('0x76')](_0x2e0200['table']);for(var _0x2de759=0x0;_0x2de759<_0x384b63['length'];_0x2de759+=0x1){_0x38b466=_0x384b63[_0x2de759][_0xab77('0x78')]?_0x3ec071[_0x384b63[_0x2de759][_0xab77('0x78')]][_0xab77('0x79')]:_0x384b63[_0x2de759][_0xab77('0x6f')];_0x38b466=_0x384b63[_0x2de759]['function']?_['replace'](_0x44f2e3[_0x384b63[_0x2de759][_0xab77('0x7a')]],'%s',_0x38b466):_0x38b466;_0x38b466=_0x384b63[_0x2de759][_0xab77('0x7b')]?_[_0xab77('0x7c')](_0x147241[_0x384b63[_0x2de759][_0xab77('0x7b')]],'%s',_0x38b466):_0x38b466;if(_0x384b63[_0x2de759][_0xab77('0x7d')]){_0x29bad6['group'](_0x38b466);}_0x384b63[_0x2de759][_0xab77('0x7e')]&&_0x29bad6[_0xab77('0x3f')](_0x38b466,_0x384b63[_0x2de759][_0xab77('0x7e')]===_0xab77('0x7f')?![]:!![]);_0x29bad6[_0xab77('0x6f')](_0x38b466,_0x384b63[_0x2de759]['alias']||_0x38b466);}if(_0x2e0200[_0xab77('0x81')]){_0x2e0200[_0xab77('0x81')]=JSON[_0xab77('0x92')](_0x2e0200[_0xab77('0x81')]);for(var _0x227bd0=0x0;_0x227bd0<_0x2e0200[_0xab77('0x81')][_0xab77('0x3c')];_0x227bd0+=0x1){if(_0x2e0200[_0xab77('0x81')][_0x227bd0][_0xab77('0x32')]&&_['includes'](_0x4f53b3,_0x2e0200['joins'][_0x227bd0]['type'])&&_0x2e0200[_0xab77('0x81')][_0x227bd0][_0xab77('0x93')]&&_0x2e0200['joins'][_0x227bd0][_0xab77('0x82')]&&_0x2e0200[_0xab77('0x81')][_0x227bd0]['foreignKey']){_0x29bad6[_0x2e0200[_0xab77('0x81')][_0x227bd0]['type']](_0x2e0200['joins'][_0x227bd0][_0xab77('0x82')],null,util[_0xab77('0x7b')]('%s.%s\x20=\x20%s.%s',_0x2e0200[_0xab77('0x77')],_0x2e0200['joins'][_0x227bd0]['parentKey'],_0x2e0200[_0xab77('0x81')][_0x227bd0][_0xab77('0x82')],_0x2e0200[_0xab77('0x81')][_0x227bd0][_0xab77('0x94')]));}}}if(_0x2e0200['conditions']){_0x2e0200['conditions']=JSON[_0xab77('0x92')](_0x2e0200[_0xab77('0x84')]);_0x29bad6[_0xab77('0x41')](_0x446b12(_0x2e0200[_0xab77('0x84')][_0xab77('0x6e')]));}_0x30e0f1=_0x29bad6[_0xab77('0x85')]();_0x29bad6['limit'](_0x36975e);_0x29bad6[_0xab77('0x20')](0x0);return;}})[_0xab77('0x25')](function(){if(_0x727d7c['output']===_0xab77('0x95')){return null;}var _0x523d11=_['merge'](_0x727d7c,{'name':_0x727d7c[_0xab77('0x96')]||_0x727d7c['name']||_0x2e0200['name'],'basename':_0x23cb58,'savename':util[_0xab77('0x7b')]('%s-%s.%s',_0x727d7c[_0xab77('0x35')]||_0x2e0200[_0xab77('0x35')],require(_0xab77('0x97'))['generate'](0x4),_0x727d7c['output']||_0xab77('0x98')),'reportId':_0x2e0200['id'],'reportType':_0xab77('0x99')});return db[_0xab77('0x9a')][_0xab77('0x4c')](_0x523d11,{'raw':!![]});})[_0xab77('0x25')](function(_0x5decf7){if(_0x2e0200[_0xab77('0x77')]===_0xab77('0x9b')){_0x30e0f1[_0xab77('0x41')](_0x2e0200[_0xab77('0x77')]+_0xab77('0x9c'),_0x727d7c['startDate'],_0x727d7c[_0xab77('0x9d')]);}else{_0x30e0f1[_0xab77('0x41')](_0x2e0200[_0xab77('0x77')]+_0xab77('0x9e'),_0x727d7c[_0xab77('0x9f')],_0x727d7c[_0xab77('0x9d')]);}if(_0x5decf7){logger[_0xab77('0xa0')]('Run\x20Query:',_0x30e0f1['toString']());require(_0xab77('0xa1'))[_0xab77('0xa2')](path['join'](__dirname,_0xab77('0xa3'),_0x5decf7[_0xab77('0xa4')]),[_0x5decf7['id'],_0x30e0f1[_0xab77('0x88')](),path[_0xab77('0x59')](__dirname,_0xab77('0xa5'),_0x5decf7['savename']),_0x23cb58]);return _0x5decf7;}else{var _0x4195b2=squel[_0xab77('0x75')]();_0x4195b2[_0xab77('0x76')]('('+_0x30e0f1['toString']()+')',_0xab77('0xa6'));_0x4195b2['field'](_0xab77('0xa7'),_0xab77('0x1f'));_0x30e0f1[_0xab77('0x1e')](_0x727d7c[_0xab77('0x1e')]||_0x36975e);_0x30e0f1[_0xab77('0x20')](_0x727d7c[_0xab77('0x20')]||0x0);return dbH[_0xab77('0x89')][_0xab77('0x36')](_0x4195b2[_0xab77('0x88')](),{'type':dbH[_0xab77('0x89')][_0xab77('0x8a')][_0xab77('0x8b')]})['then'](function(_0x1dde34){if(!_0x1dde34[_0xab77('0x3c')]){_0xf47b42=0x0;}else{_0xf47b42=_0x1dde34[0x0][_0xab77('0x1f')]||0x0;}return dbH[_0xab77('0x89')][_0xab77('0x36')](_0x30e0f1[_0xab77('0x88')](),{'type':dbH[_0xab77('0x89')][_0xab77('0x8a')][_0xab77('0x8b')]});})[_0xab77('0x25')](function(_0x4c0a92){return{'rows':_0x4c0a92||[],'count':_0xf47b42};});}});}exports[_0xab77('0xa8')]=function(_0x1a0dd4,_0x165de0){return runReport(_0x1a0dd4[_0xab77('0x56')],_0x1a0dd4[_0xab77('0x36')],_0x1a0dd4[_0xab77('0x4b')])[_0xab77('0x25')](respondWithResult(_0x165de0,null))[_0xab77('0x55')](handleError(_0x165de0,null));};exports['runReport']=runReport;exports[_0xab77('0x36')]=function(_0x364e87,_0x504e46){var _0x23af5b=0xa;var _0x3b32f2=[_0xab77('0x59'),_0xab77('0x5a'),'right_join',_0xab77('0x5c')];var _0xb1cd34={'SUM':_0xab77('0x5d'),'COUNT':_0xab77('0x5e'),'COUNT DISTINCT':_0xab77('0x8c'),'MAX':_0xab77('0x5f'),'MIN':_0xab77('0x60'),'AVG':_0xab77('0x61'),'GROUP_CONCAT':_0xab77('0x8d'),'GROUP_CONCAT ASC':_0xab77('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x239c68={'SEC_TO_TIME':_0xab77('0x64'),'DATE':_0xab77('0x65'),'HOUR':_0xab77('0x66'),'ROUND':_0xab77('0x67'),'UNIX_TIMESTAMP':_0xab77('0x68')};var _0x447620=function(_0x44909c){return!_[_0xab77('0x69')]([_0xab77('0x8e'),'IS\x20NOT\x20NULL',_0xab77('0x6b'),_0xab77('0x6c')],_0x44909c);};var _0x39e833=function(_0x4d4041){if(!_0x4d4041||!_0x4d4041[_0xab77('0x6d')]['length']){return'';}for(var _0x46232e='(',_0x4f483c=0x0;_0x4f483c<_0x4d4041[_0xab77('0x6d')]['length'];_0x4f483c+=0x1){_0x4f483c>0x0&&(_0x46232e+='\x20'+_0x4d4041[_0xab77('0x8f')]+'\x20');_0x46232e+=_0x4d4041[_0xab77('0x6d')][_0x4f483c][_0xab77('0x6e')]?_0x39e833(_0x4d4041['rules'][_0x4f483c][_0xab77('0x6e')]):_0x4d4041[_0xab77('0x6d')][_0x4f483c][_0xab77('0x6f')]+'\x20'+_0x4d4041[_0xab77('0x6d')][_0x4f483c][_0xab77('0x70')]+(_0x447620(_0x4d4041[_0xab77('0x6d')][_0x4f483c][_0xab77('0x70')])?'\x20'+_0x4d4041['rules'][_0x4f483c][_0xab77('0x71')]:'');}return _0x46232e+')';};var _0x128849={'where':{'id':_0x364e87[_0xab77('0x56')]['id']}},_0x3d00c9,_0x1e36ac,_0x5b0ecd,_0xda12fb,_0x1bf034;_0x128849=_[_0xab77('0x45')]({},_0x128849,_0x364e87[_0xab77('0x4b')]);return db[_0xab77('0x2f')]['find'](_0x128849)['then'](function(_0x1c2467){if(_0x1c2467){_0x3d00c9=_0x1c2467;return _0x1c2467[_0xab77('0xa9')]();}return null;})[_0xab77('0x25')](function(_0x15f326){if(_0x15f326){if(!_0x15f326['length']){throw new db['Sequelize'][(_0xab77('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1e36ac=_0x15f326;return db[_0xab77('0x74')][_0xab77('0x47')]({'raw':!![]});}return null;})[_0xab77('0x25')](function(_0x2a1caf){if(_0x2a1caf){_0x5b0ecd=_['keyBy'](_0x2a1caf,'id');var _0x369a2a;var _0x145856=squel['select']();_0x145856['from'](_0x3d00c9[_0xab77('0x77')]);for(var _0x1cb23f=0x0;_0x1cb23f<_0x1e36ac['length'];_0x1cb23f+=0x1){_0x369a2a=_0x1e36ac[_0x1cb23f][_0xab77('0x78')]?_0x5b0ecd[_0x1e36ac[_0x1cb23f][_0xab77('0x78')]][_0xab77('0x79')]:_0x1e36ac[_0x1cb23f][_0xab77('0x6f')];_0x369a2a=_0x1e36ac[_0x1cb23f]['function']?_['replace'](_0xb1cd34[_0x1e36ac[_0x1cb23f][_0xab77('0x7a')]],'%s',_0x369a2a):_0x369a2a;_0x369a2a=_0x1e36ac[_0x1cb23f][_0xab77('0x7b')]?_['replace'](_0x239c68[_0x1e36ac[_0x1cb23f]['format']],'%s',_0x369a2a):_0x369a2a;if(_0x1e36ac[_0x1cb23f][_0xab77('0x7d')]){_0x145856[_0xab77('0x6e')](_0x369a2a);}_0x1e36ac[_0x1cb23f][_0xab77('0x7e')]&&_0x145856[_0xab77('0x3f')](_0x369a2a,_0x1e36ac[_0x1cb23f][_0xab77('0x7e')]===_0xab77('0x7f')?![]:!![]);_0x145856[_0xab77('0x6f')](_0x369a2a,_0x1e36ac[_0x1cb23f][_0xab77('0x80')]||_0x369a2a);}if(_0x3d00c9[_0xab77('0x81')]){_0x3d00c9[_0xab77('0x81')]=JSON[_0xab77('0x92')](_0x3d00c9[_0xab77('0x81')]);for(var _0x28f553=0x0;_0x28f553<_0x3d00c9['joins'][_0xab77('0x3c')];_0x28f553+=0x1){if(_0x3d00c9['joins'][_0x28f553]['type']&&_[_0xab77('0x69')](_0x3b32f2,_0x3d00c9[_0xab77('0x81')][_0x28f553][_0xab77('0x32')])&&_0x3d00c9[_0xab77('0x81')][_0x28f553][_0xab77('0x93')]&&_0x3d00c9['joins'][_0x28f553]['foreignTable']&&_0x3d00c9[_0xab77('0x81')][_0x28f553][_0xab77('0x94')]){_0x145856[_0x3d00c9[_0xab77('0x81')][_0x28f553]['type']](_0x3d00c9['joins'][_0x28f553][_0xab77('0x82')],null,util[_0xab77('0x7b')]('%s.%s\x20=\x20%s.%s',_0x3d00c9[_0xab77('0x77')],_0x3d00c9[_0xab77('0x81')][_0x28f553]['parentKey'],_0x3d00c9[_0xab77('0x81')][_0x28f553][_0xab77('0x82')],_0x3d00c9[_0xab77('0x81')][_0x28f553][_0xab77('0x94')]));}}}if(_0x3d00c9[_0xab77('0x84')]){_0x3d00c9['conditions']=JSON[_0xab77('0x92')](_0x3d00c9[_0xab77('0x84')]);_0x145856[_0xab77('0x41')](_0x39e833(_0x3d00c9[_0xab77('0x84')][_0xab77('0x6e')]));}_0x1bf034=_0x145856[_0xab77('0x85')]();_0x145856[_0xab77('0x1e')](_0x23af5b);_0x145856[_0xab77('0x20')](0x0);logger['debug'](_0xab77('0x87'),_0x145856[_0xab77('0x88')]());return dbH[_0xab77('0x89')][_0xab77('0x36')](_0x145856[_0xab77('0x88')](),{'type':dbH[_0xab77('0x89')][_0xab77('0x8a')]['SELECT']});}})[_0xab77('0x25')](function(){return{'sql':_0x1bf034[_0xab77('0x88')]()};})[_0xab77('0x25')](respondWithResult(_0x504e46,null))[_0xab77('0x55')](handleError(_0x504e46,null));}; \ No newline at end of file +var _0x7cee=['map','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','pick','filter','merge','VIRTUAL','options','where','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','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','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','type','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','Sequelize','ValidationErrorItem','AnalyticMetric','from','metric','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','error','stack','name','index'];(function(_0x32625b,_0x4f81ec){var _0x56bc3d=function(_0x4569b5){while(--_0x4569b5){_0x32625b['push'](_0x32625b['shift']());}};_0x56bc3d(++_0x4f81ec);}(_0x7cee,0x1c5));var _0xe7ce=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0x7cee[_0x47604d];return _0x388e4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7ce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7ce('0x1'));var rp=require(_0xe7ce('0x2'));var moment=require(_0xe7ce('0x3'));var BPromise=require(_0xe7ce('0x4'));var Mustache=require(_0xe7ce('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7ce('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe7ce('0x7'));var jsforce=require(_0xe7ce('0x8'));var deskjs=require(_0xe7ce('0x9'));var toCsv=require(_0xe7ce('0xa'));var querystring=require(_0xe7ce('0xb'));var Papa=require(_0xe7ce('0xc'));var Redis=require('ioredis');var authService=require(_0xe7ce('0xd'));var qs=require(_0xe7ce('0xe'));var as=require(_0xe7ce('0xf'));var hardwareService=require(_0xe7ce('0x10'));var logger=require('../../config/logger')(_0xe7ce('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe7ce('0x12'));var db=require(_0xe7ce('0x13'))['db'];var dbH=require(_0xe7ce('0x13'))['dbH'];function respondWithStatusCode(_0x20d36b,_0x37aa04){_0x37aa04=_0x37aa04||0xcc;return function(_0xbaf81e){if(_0xbaf81e){return _0x20d36b[_0xe7ce('0x14')](_0x37aa04);}return _0x20d36b[_0xe7ce('0x15')](_0x37aa04)[_0xe7ce('0x16')]();};}function respondWithResult(_0x2569c8,_0x531430){_0x531430=_0x531430||0xc8;return function(_0x4dc28c){if(_0x4dc28c){return _0x2569c8[_0xe7ce('0x15')](_0x531430)[_0xe7ce('0x17')](_0x4dc28c);}};}function respondWithFilteredResult(_0x3a1593,_0x151978){return function(_0x4f4bec){if(_0x4f4bec){var _0x34f2be=typeof _0x151978[_0xe7ce('0x18')]===_0xe7ce('0x19')&&typeof _0x151978['limit']===_0xe7ce('0x19');var _0x56de47=_0x4f4bec[_0xe7ce('0x1a')];var _0x2244fe=_0x34f2be?0x0:_0x151978['offset'];var _0x22c8e0=_0x34f2be?_0x4f4bec[_0xe7ce('0x1a')]:_0x151978[_0xe7ce('0x18')]+_0x151978['limit'];var _0x5b1e6f;if(_0x22c8e0>=_0x56de47){_0x22c8e0=_0x56de47;_0x5b1e6f=0xc8;}else{_0x5b1e6f=0xce;}_0x3a1593['status'](_0x5b1e6f);return _0x3a1593[_0xe7ce('0x1b')](_0xe7ce('0x1c'),_0x2244fe+'-'+_0x22c8e0+'/'+_0x56de47)[_0xe7ce('0x17')](_0x4f4bec);}return null;};}function patchUpdates(_0x510c38){return function(_0x5ba8a8){try{jsonpatch[_0xe7ce('0x1d')](_0x5ba8a8,_0x510c38,!![]);}catch(_0x574cdf){return BPromise[_0xe7ce('0x1e')](_0x574cdf);}return _0x5ba8a8[_0xe7ce('0x1f')]();};}function saveUpdates(_0x2dc0d6,_0x547bbf){return function(_0x516a91){if(_0x516a91){return _0x516a91['update'](_0x2dc0d6)[_0xe7ce('0x20')](function(_0xa2c703){return _0xa2c703;});}return null;};}function removeEntity(_0x104c91,_0x58da7a){return function(_0x485866){if(_0x485866){return _0x485866['destroy']()[_0xe7ce('0x20')](function(){var _0x55bb78=_0x485866['get']({'plain':!![]});var _0x48f321='CustomReports';return db[_0xe7ce('0x21')][_0xe7ce('0x22')]({'where':{'type':_0x48f321,'resourceId':_0x55bb78['id']}})[_0xe7ce('0x20')](function(){return _0x485866;});})['then'](function(){_0x104c91[_0xe7ce('0x15')](0xcc)[_0xe7ce('0x16')]();});}};}function handleEntityNotFound(_0xddfde0,_0x570af6){return function(_0x2cca33){if(!_0x2cca33){_0xddfde0['sendStatus'](0x194);}return _0x2cca33;};}function handleError(_0x168307,_0x45b200){_0x45b200=_0x45b200||0x1f4;return function(_0x2b38b1){logger[_0xe7ce('0x23')](_0x2b38b1[_0xe7ce('0x24')]);if(_0x2b38b1['name']){delete _0x2b38b1[_0xe7ce('0x25')];}_0x168307[_0xe7ce('0x15')](_0x45b200)['send'](_0x2b38b1);};}exports[_0xe7ce('0x26')]=function(_0x263f35,_0x4435ed){var _0x21b979={},_0x21557a={},_0x2f8cf0={'count':0x0,'rows':[]};var _0xbb8dd9=_[_0xe7ce('0x27')](db['AnalyticCustomReport']['rawAttributes'],function(_0x39e1ae){return{'name':_0x39e1ae['fieldName'],'type':_0x39e1ae['type'][_0xe7ce('0x28')]};});_0x21557a[_0xe7ce('0x29')]=_['map'](_0xbb8dd9,_0xe7ce('0x25'));_0x21557a[_0xe7ce('0x2a')]=_[_0xe7ce('0x2b')](_0x263f35['query']);_0x21557a[_0xe7ce('0x2c')]=_[_0xe7ce('0x2d')](_0x21557a[_0xe7ce('0x29')],_0x21557a[_0xe7ce('0x2a')]);_0x21b979[_0xe7ce('0x2e')]=_['intersection'](_0x21557a[_0xe7ce('0x29')],qs[_0xe7ce('0x2f')](_0x263f35['query'][_0xe7ce('0x2f')]));_0x21b979[_0xe7ce('0x2e')]=_0x21b979[_0xe7ce('0x2e')]['length']?_0x21b979[_0xe7ce('0x2e')]:_0x21557a[_0xe7ce('0x29')];if(!_0x263f35[_0xe7ce('0x2a')][_0xe7ce('0x30')]('nolimit')){_0x21b979[_0xe7ce('0x31')]=qs[_0xe7ce('0x31')](_0x263f35[_0xe7ce('0x2a')][_0xe7ce('0x31')]);_0x21b979['offset']=qs[_0xe7ce('0x18')](_0x263f35[_0xe7ce('0x2a')][_0xe7ce('0x18')]);}_0x21b979['order']=qs[_0xe7ce('0x32')](_0x263f35['query']['sort']);_0x21b979['where']=qs[_0xe7ce('0x2c')](_[_0xe7ce('0x33')](_0x263f35[_0xe7ce('0x2a')],_0x21557a[_0xe7ce('0x2c')]),_0xbb8dd9);if(_0x263f35[_0xe7ce('0x2a')][_0xe7ce('0x34')]){_0x21b979['where']=_[_0xe7ce('0x35')](_0x21b979['where'],{'$or':_[_0xe7ce('0x27')](_0xbb8dd9,function(_0x566b36){if(_0x566b36['type']!==_0xe7ce('0x36')){var _0x35bd78={};_0x35bd78[_0x566b36[_0xe7ce('0x25')]]={'$like':'%'+_0x263f35[_0xe7ce('0x2a')][_0xe7ce('0x34')]+'%'};return _0x35bd78;}})});}_0x21b979=_[_0xe7ce('0x35')]({},_0x21b979,_0x263f35[_0xe7ce('0x37')]);var _0x21cea6={'where':_0x21b979[_0xe7ce('0x38')]};return db[_0xe7ce('0x39')][_0xe7ce('0x1a')](_0x21cea6)[_0xe7ce('0x20')](function(_0x2aae68){_0x2f8cf0['count']=_0x2aae68;if(_0x263f35[_0xe7ce('0x2a')][_0xe7ce('0x3a')]){_0x21b979[_0xe7ce('0x3b')]=[{'all':!![]}];}return db[_0xe7ce('0x39')][_0xe7ce('0x3c')](_0x21b979);})['then'](function(_0x2a2aa3){_0x2f8cf0[_0xe7ce('0x3d')]=_0x2a2aa3;return _0x2f8cf0;})[_0xe7ce('0x20')](respondWithFilteredResult(_0x4435ed,_0x21b979))[_0xe7ce('0x3e')](handleError(_0x4435ed,null));};exports[_0xe7ce('0x3f')]=function(_0x39f67d,_0x43fa8e){var _0x1a7ccb={'raw':![],'where':{'id':_0x39f67d['params']['id']}},_0x569909={};_0x569909['model']=_[_0xe7ce('0x2b')](db['AnalyticCustomReport'][_0xe7ce('0x40')]);_0x569909[_0xe7ce('0x2a')]=_['keys'](_0x39f67d[_0xe7ce('0x2a')]);_0x569909['filters']=_[_0xe7ce('0x2d')](_0x569909[_0xe7ce('0x29')],_0x569909[_0xe7ce('0x2a')]);_0x1a7ccb[_0xe7ce('0x2e')]=_[_0xe7ce('0x2d')](_0x569909[_0xe7ce('0x29')],qs[_0xe7ce('0x2f')](_0x39f67d[_0xe7ce('0x2a')][_0xe7ce('0x2f')]));_0x1a7ccb[_0xe7ce('0x2e')]=_0x1a7ccb[_0xe7ce('0x2e')][_0xe7ce('0x41')]?_0x1a7ccb[_0xe7ce('0x2e')]:_0x569909[_0xe7ce('0x29')];if(_0x39f67d[_0xe7ce('0x2a')][_0xe7ce('0x3a')]){_0x1a7ccb[_0xe7ce('0x3b')]=[{'all':!![]}];}_0x1a7ccb=_['merge']({},_0x1a7ccb,_0x39f67d[_0xe7ce('0x37')]);return db[_0xe7ce('0x39')]['find'](_0x1a7ccb)[_0xe7ce('0x20')](handleEntityNotFound(_0x43fa8e,null))['then'](respondWithResult(_0x43fa8e,null))[_0xe7ce('0x3e')](handleError(_0x43fa8e,null));};exports[_0xe7ce('0x42')]=function(_0x470365,_0x1bdfb8){return db[_0xe7ce('0x39')][_0xe7ce('0x42')](_0x470365[_0xe7ce('0x43')],{})[_0xe7ce('0x20')](function(_0x52318d){var _0x3cc801=_0x470365[_0xe7ce('0x44')][_0xe7ce('0x45')]({'plain':!![]});if(!_0x3cc801)throw new Error(_0xe7ce('0x46'));if(_0x3cc801[_0xe7ce('0x47')]==='user'){var _0x1fb174=_0x52318d[_0xe7ce('0x45')]({'plain':!![]});var _0x56a0d0=_0xe7ce('0x48');return db['UserProfileSection'][_0xe7ce('0x49')]({'where':{'name':_0x56a0d0,'userProfileId':_0x3cc801[_0xe7ce('0x4a')]},'raw':!![]})['then'](function(_0x2cdacb){if(_0x2cdacb&&_0x2cdacb[_0xe7ce('0x4b')]===0x0){return db['UserProfileResource'][_0xe7ce('0x42')]({'name':_0x1fb174['name'],'resourceId':_0x1fb174['id'],'type':_0xe7ce('0x4c'),'sectionId':_0x2cdacb['id']},{})['then'](function(){return _0x52318d;});}else{return _0x52318d;}})['catch'](function(_0x342dc6){logger[_0xe7ce('0x23')](_0xe7ce('0x4d'),_0x342dc6);throw _0x342dc6;});}return _0x52318d;})[_0xe7ce('0x20')](respondWithResult(_0x1bdfb8,0xc9))['catch'](handleError(_0x1bdfb8,null));};exports[_0xe7ce('0x4e')]=function(_0x5b0e33,_0x1328df){if(_0x5b0e33[_0xe7ce('0x43')]['id']){delete _0x5b0e33[_0xe7ce('0x43')]['id'];}return db[_0xe7ce('0x39')]['find']({'where':{'id':_0x5b0e33[_0xe7ce('0x4f')]['id']}})[_0xe7ce('0x20')](handleEntityNotFound(_0x1328df,null))[_0xe7ce('0x20')](saveUpdates(_0x5b0e33[_0xe7ce('0x43')],null))['then'](respondWithResult(_0x1328df,null))['catch'](handleError(_0x1328df,null));};exports['destroy']=function(_0x1f1054,_0x2ed567){return db['AnalyticCustomReport'][_0xe7ce('0x49')]({'where':{'id':_0x1f1054[_0xe7ce('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2ed567,null))[_0xe7ce('0x20')](removeEntity(_0x2ed567,null))['catch'](handleError(_0x2ed567,null));};exports[_0xe7ce('0x50')]=function(_0x44673c,_0x1ed4a2){var _0x5073d1=0xa;var _0x225dc7=[_0xe7ce('0x51'),_0xe7ce('0x52'),_0xe7ce('0x53'),_0xe7ce('0x54')];var _0x26f474={'SUM':_0xe7ce('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe7ce('0x56'),'MAX':_0xe7ce('0x57'),'MIN':_0xe7ce('0x58'),'AVG':_0xe7ce('0x59'),'GROUP_CONCAT':_0xe7ce('0x5a'),'GROUP_CONCAT ASC':_0xe7ce('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3cc528={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xe7ce('0x5c'),'ROUND':_0xe7ce('0x5d'),'UNIX_TIMESTAMP':_0xe7ce('0x5e')};var _0x18e45f=function(_0x4f8562){return!_[_0xe7ce('0x5f')]([_0xe7ce('0x60'),_0xe7ce('0x61'),_0xe7ce('0x62'),_0xe7ce('0x63')],_0x4f8562);};var _0x851b60=function(_0x1e65bd){if(!_0x1e65bd||!_0x1e65bd[_0xe7ce('0x64')][_0xe7ce('0x41')]){return'';}for(var _0x23ee44='(',_0x1a1294=0x0;_0x1a1294<_0x1e65bd[_0xe7ce('0x64')][_0xe7ce('0x41')];_0x1a1294+=0x1){_0x1a1294>0x0&&(_0x23ee44+='\x20'+_0x1e65bd[_0xe7ce('0x65')]+'\x20');_0x23ee44+=_0x1e65bd[_0xe7ce('0x64')][_0x1a1294][_0xe7ce('0x66')]?_0x851b60(_0x1e65bd['rules'][_0x1a1294][_0xe7ce('0x66')]):_0x1e65bd[_0xe7ce('0x64')][_0x1a1294][_0xe7ce('0x67')]+'\x20'+_0x1e65bd[_0xe7ce('0x64')][_0x1a1294][_0xe7ce('0x68')]+(_0x18e45f(_0x1e65bd['rules'][_0x1a1294]['condition'])?'\x20'+_0x1e65bd['rules'][_0x1a1294][_0xe7ce('0x69')]:'');}return _0x23ee44+')';};var _0x22def8={'where':{'id':_0x44673c[_0xe7ce('0x4f')]['id']}},_0x2d7806,_0x50c3ab,_0x35587b,_0x48a7a9,_0x58ab4c;_0x22def8=_[_0xe7ce('0x35')]({},_0x22def8,_0x44673c[_0xe7ce('0x37')]);return db[_0xe7ce('0x39')]['find'](_0x22def8)[_0xe7ce('0x20')](function(_0x5c9ac1){if(_0x5c9ac1){_0x2d7806=_0x5c9ac1;return _0x5c9ac1[_0xe7ce('0x6a')]();}return null;})['then'](function(_0x4e445f){if(_0x4e445f){if(!_0x4e445f[_0xe7ce('0x41')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe7ce('0x6b'),0x193);}_0x50c3ab=_0x4e445f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe7ce('0x20')](function(_0x17efcc){if(_0x17efcc){_0x35587b=_[_0xe7ce('0x6c')](_0x17efcc,'id');var _0x9c3502;var _0x2f5617=squel[_0xe7ce('0x6d')]();_0x2f5617['from'](_0x2d7806[_0xe7ce('0x6e')]);for(var _0x4f7808=0x0;_0x4f7808<_0x50c3ab[_0xe7ce('0x41')];_0x4f7808+=0x1){_0x9c3502=_0x50c3ab[_0x4f7808][_0xe7ce('0x6f')]?_0x35587b[_0x50c3ab[_0x4f7808]['MetricId']]['metric']:_0x50c3ab[_0x4f7808][_0xe7ce('0x67')];_0x9c3502=_0x50c3ab[_0x4f7808][_0xe7ce('0x70')]?_[_0xe7ce('0x71')](_0x26f474[_0x50c3ab[_0x4f7808][_0xe7ce('0x70')]],'%s',_0x9c3502):_0x9c3502;_0x9c3502=_0x50c3ab[_0x4f7808][_0xe7ce('0x72')]?_[_0xe7ce('0x71')](_0x3cc528[_0x50c3ab[_0x4f7808][_0xe7ce('0x72')]],'%s',_0x9c3502):_0x9c3502;if(_0x50c3ab[_0x4f7808][_0xe7ce('0x73')]){_0x2f5617[_0xe7ce('0x66')](_0x9c3502);}_0x50c3ab[_0x4f7808][_0xe7ce('0x74')]&&_0x2f5617[_0xe7ce('0x75')](_0x9c3502,_0x50c3ab[_0x4f7808][_0xe7ce('0x74')]===_0xe7ce('0x76')?![]:!![]);_0x2f5617[_0xe7ce('0x67')](_0x9c3502,_0x50c3ab[_0x4f7808][_0xe7ce('0x77')]||_0x9c3502);}if(_0x2d7806[_0xe7ce('0x78')]){_0x2d7806[_0xe7ce('0x78')]=JSON[_0xe7ce('0x79')](_0x2d7806[_0xe7ce('0x78')]);for(var _0x269de8=0x0;_0x269de8<_0x2d7806['joins'][_0xe7ce('0x41')];_0x269de8+=0x1){if(_0x2d7806[_0xe7ce('0x78')][_0x269de8][_0xe7ce('0x7a')]&&_[_0xe7ce('0x5f')](_0x225dc7,_0x2d7806[_0xe7ce('0x78')][_0x269de8]['type'])&&_0x2d7806[_0xe7ce('0x78')][_0x269de8][_0xe7ce('0x7b')]&&_0x2d7806['joins'][_0x269de8]['foreignTable']&&_0x2d7806[_0xe7ce('0x78')][_0x269de8][_0xe7ce('0x7c')]){_0x2f5617[_0x2d7806[_0xe7ce('0x78')][_0x269de8]['type']](_0x2d7806[_0xe7ce('0x78')][_0x269de8][_0xe7ce('0x7d')],null,util[_0xe7ce('0x72')](_0xe7ce('0x7e'),_0x2d7806[_0xe7ce('0x6e')],_0x2d7806[_0xe7ce('0x78')][_0x269de8]['parentKey'],_0x2d7806['joins'][_0x269de8][_0xe7ce('0x7d')],_0x2d7806[_0xe7ce('0x78')][_0x269de8][_0xe7ce('0x7c')]));}}}if(_0x2d7806['conditions']){_0x2d7806['conditions']=JSON[_0xe7ce('0x79')](_0x2d7806[_0xe7ce('0x7f')]);_0x2f5617['where'](_0x851b60(_0x2d7806['conditions']['group']));}_0x58ab4c=_0x2f5617[_0xe7ce('0x80')]();_0x2f5617[_0xe7ce('0x31')](_0x5073d1);_0x2f5617['offset'](0x0);logger[_0xe7ce('0x81')](_0xe7ce('0x82'),_0x2f5617[_0xe7ce('0x83')]());return dbH['sequelize']['query'](_0x2f5617['toString'](),{'type':dbH[_0xe7ce('0x84')][_0xe7ce('0x85')][_0xe7ce('0x86')]});}})[_0xe7ce('0x20')](respondWithResult(_0x1ed4a2,null))[_0xe7ce('0x3e')](handleError(_0x1ed4a2,null));};function runReport(_0x351f58,_0x6aaf1f,_0xb847a1){var _0x33d7ec=_0x6aaf1f['name'];var _0x5691cb=0xa;var _0x142981=['join',_0xe7ce('0x52'),'right_join',_0xe7ce('0x54')];var _0x5b3b18={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe7ce('0x56'),'MAX':_0xe7ce('0x57'),'MIN':_0xe7ce('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe7ce('0x5a'),'GROUP_CONCAT ASC':_0xe7ce('0x5b'),'GROUP_CONCAT DESC':_0xe7ce('0x87')};var _0x48b9ec={'SEC_TO_TIME':_0xe7ce('0x88'),'DATE':'DATE(%s)','HOUR':_0xe7ce('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe7ce('0x5e')};var _0x558e11=function(_0x557805){return!_['includes']([_0xe7ce('0x60'),_0xe7ce('0x61'),_0xe7ce('0x62'),_0xe7ce('0x63')],_0x557805);};var _0x49ebf4=function(_0x32d059){if(!_0x32d059||!_0x32d059[_0xe7ce('0x64')]['length']){return'';}for(var _0xb1a28a='(',_0x4c482d=0x0;_0x4c482d<_0x32d059[_0xe7ce('0x64')]['length'];_0x4c482d+=0x1){_0x4c482d>0x0&&(_0xb1a28a+='\x20'+_0x32d059['operator']+'\x20');_0xb1a28a+=_0x32d059['rules'][_0x4c482d]['group']?_0x49ebf4(_0x32d059[_0xe7ce('0x64')][_0x4c482d][_0xe7ce('0x66')]):_0x32d059['rules'][_0x4c482d]['field']+'\x20'+_0x32d059['rules'][_0x4c482d][_0xe7ce('0x68')]+(_0x558e11(_0x32d059[_0xe7ce('0x64')][_0x4c482d][_0xe7ce('0x68')])?'\x20'+_0x32d059[_0xe7ce('0x64')][_0x4c482d][_0xe7ce('0x69')]:'');}return _0xb1a28a+')';};var _0x4d2175={'where':{'id':_0x351f58['id']}},_0x2f5947,_0x4bca1f,_0x14738f,_0x47ebec,_0x48df70;_0x4d2175=_['merge']({},_0x4d2175,_0xb847a1);return db[_0xe7ce('0x39')][_0xe7ce('0x49')](_0x4d2175)[_0xe7ce('0x20')](function(_0x2dacb4){if(_0x2dacb4){_0x2f5947=_0x2dacb4;return _0x2dacb4[_0xe7ce('0x6a')]();}return null;})[_0xe7ce('0x20')](function(_0x18c398){if(_0x18c398){if(!_0x18c398[_0xe7ce('0x41')]){throw new db[(_0xe7ce('0x89'))][(_0xe7ce('0x8a'))](_0xe7ce('0x6b'),0x193);}_0x4bca1f=_0x18c398;return db[_0xe7ce('0x8b')][_0xe7ce('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x5ab307){if(_0x5ab307){_0x14738f=_[_0xe7ce('0x6c')](_0x5ab307,'id');var _0x1588de;var _0x151336=squel[_0xe7ce('0x6d')]();_0x151336[_0xe7ce('0x8c')](_0x2f5947[_0xe7ce('0x6e')]);for(var _0x12c391=0x0;_0x12c391<_0x4bca1f[_0xe7ce('0x41')];_0x12c391+=0x1){_0x1588de=_0x4bca1f[_0x12c391][_0xe7ce('0x6f')]?_0x14738f[_0x4bca1f[_0x12c391][_0xe7ce('0x6f')]][_0xe7ce('0x8d')]:_0x4bca1f[_0x12c391][_0xe7ce('0x67')];_0x1588de=_0x4bca1f[_0x12c391][_0xe7ce('0x70')]?_[_0xe7ce('0x71')](_0x5b3b18[_0x4bca1f[_0x12c391][_0xe7ce('0x70')]],'%s',_0x1588de):_0x1588de;_0x1588de=_0x4bca1f[_0x12c391][_0xe7ce('0x72')]?_['replace'](_0x48b9ec[_0x4bca1f[_0x12c391][_0xe7ce('0x72')]],'%s',_0x1588de):_0x1588de;if(_0x4bca1f[_0x12c391][_0xe7ce('0x73')]){_0x151336['group'](_0x1588de);}_0x4bca1f[_0x12c391][_0xe7ce('0x74')]&&_0x151336[_0xe7ce('0x75')](_0x1588de,_0x4bca1f[_0x12c391][_0xe7ce('0x74')]===_0xe7ce('0x76')?![]:!![]);_0x151336[_0xe7ce('0x67')](_0x1588de,_0x4bca1f[_0x12c391][_0xe7ce('0x77')]||_0x1588de);}if(_0x2f5947[_0xe7ce('0x78')]){_0x2f5947['joins']=JSON[_0xe7ce('0x79')](_0x2f5947[_0xe7ce('0x78')]);for(var _0xff5220=0x0;_0xff5220<_0x2f5947[_0xe7ce('0x78')][_0xe7ce('0x41')];_0xff5220+=0x1){if(_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7a')]&&_[_0xe7ce('0x5f')](_0x142981,_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7a')])&&_0x2f5947[_0xe7ce('0x78')][_0xff5220]['parentKey']&&_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7d')]&&_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7c')]){_0x151336[_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7a')]](_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7d')],null,util['format'](_0xe7ce('0x7e'),_0x2f5947[_0xe7ce('0x6e')],_0x2f5947[_0xe7ce('0x78')][_0xff5220]['parentKey'],_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7d')],_0x2f5947[_0xe7ce('0x78')][_0xff5220][_0xe7ce('0x7c')]));}}}if(_0x2f5947['conditions']){_0x2f5947[_0xe7ce('0x7f')]=JSON[_0xe7ce('0x79')](_0x2f5947['conditions']);_0x151336[_0xe7ce('0x38')](_0x49ebf4(_0x2f5947[_0xe7ce('0x7f')][_0xe7ce('0x66')]));}_0x48df70=_0x151336['clone']();_0x151336['limit'](_0x5691cb);_0x151336['offset'](0x0);return;}})['then'](function(){if(_0x6aaf1f[_0xe7ce('0x8e')]===_0xe7ce('0x8f')){return null;}var _0xc9fcd5=_[_0xe7ce('0x35')](_0x6aaf1f,{'name':_0x6aaf1f[_0xe7ce('0x90')]||_0x6aaf1f['name']||_0x2f5947[_0xe7ce('0x25')],'basename':_0x33d7ec,'savename':util[_0xe7ce('0x72')]('%s-%s.%s',_0x6aaf1f[_0xe7ce('0x25')]||_0x2f5947[_0xe7ce('0x25')],require(_0xe7ce('0x91'))[_0xe7ce('0x92')](0x4),_0x6aaf1f['output']||_0xe7ce('0x93')),'reportId':_0x2f5947['id'],'reportType':_0xe7ce('0x94')});return db[_0xe7ce('0x95')][_0xe7ce('0x42')](_0xc9fcd5,{'raw':!![]});})['then'](function(_0x31960f){if(_0x2f5947['table']===_0xe7ce('0x96')){_0x48df70[_0xe7ce('0x38')](_0x2f5947['table']+_0xe7ce('0x97'),_0x6aaf1f[_0xe7ce('0x98')],_0x6aaf1f[_0xe7ce('0x99')]);}else{_0x48df70[_0xe7ce('0x38')](_0x2f5947['table']+_0xe7ce('0x9a'),_0x6aaf1f[_0xe7ce('0x98')],_0x6aaf1f[_0xe7ce('0x99')]);}if(_0x31960f){logger['info'](_0xe7ce('0x9b'),_0x48df70[_0xe7ce('0x83')]());require(_0xe7ce('0x9c'))['fork'](path[_0xe7ce('0x51')](__dirname,_0xe7ce('0x9d'),_0x31960f['output']),[_0x31960f['id'],_0x48df70[_0xe7ce('0x83')](),path[_0xe7ce('0x51')](__dirname,_0xe7ce('0x9e'),_0x31960f[_0xe7ce('0x9f')]),_0x33d7ec]);return _0x31960f;}else{var _0x39ca4e=squel['select']();_0x39ca4e[_0xe7ce('0x8c')]('('+_0x48df70[_0xe7ce('0x83')]()+')',_0xe7ce('0xa0'));_0x39ca4e['field'](_0xe7ce('0xa1'),'count');_0x48df70[_0xe7ce('0x31')](_0x6aaf1f[_0xe7ce('0x31')]||_0x5691cb);_0x48df70[_0xe7ce('0x18')](_0x6aaf1f[_0xe7ce('0x18')]||0x0);return dbH[_0xe7ce('0x84')][_0xe7ce('0x2a')](_0x39ca4e['toString'](),{'type':dbH[_0xe7ce('0x84')]['QueryTypes'][_0xe7ce('0x86')]})[_0xe7ce('0x20')](function(_0x8dff51){if(!_0x8dff51[_0xe7ce('0x41')]){_0x47ebec=0x0;}else{_0x47ebec=_0x8dff51[0x0][_0xe7ce('0x1a')]||0x0;}return dbH[_0xe7ce('0x84')][_0xe7ce('0x2a')](_0x48df70[_0xe7ce('0x83')](),{'type':dbH[_0xe7ce('0x84')][_0xe7ce('0x85')][_0xe7ce('0x86')]});})[_0xe7ce('0x20')](function(_0x3ceafd){return{'rows':_0x3ceafd||[],'count':_0x47ebec};});}});}exports['run']=function(_0x3f0720,_0x2cea3c){return runReport(_0x3f0720[_0xe7ce('0x4f')],_0x3f0720[_0xe7ce('0x2a')],_0x3f0720[_0xe7ce('0x37')])[_0xe7ce('0x20')](respondWithResult(_0x2cea3c,null))[_0xe7ce('0x3e')](handleError(_0x2cea3c,null));};exports[_0xe7ce('0xa2')]=runReport;exports[_0xe7ce('0x2a')]=function(_0x5eb831,_0x5029d4){var _0x466aa1=0xa;var _0x459f42=['join',_0xe7ce('0x52'),_0xe7ce('0x53'),_0xe7ce('0x54')];var _0x2d83ce={'SUM':'SUM(%s)','COUNT':_0xe7ce('0xa3'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe7ce('0x58'),'AVG':_0xe7ce('0x59'),'GROUP_CONCAT':_0xe7ce('0x5a'),'GROUP_CONCAT ASC':_0xe7ce('0x5b'),'GROUP_CONCAT DESC':_0xe7ce('0x87')};var _0x517e34={'SEC_TO_TIME':_0xe7ce('0x88'),'DATE':'DATE(%s)','HOUR':_0xe7ce('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2db6dc=function(_0x3cf4b9){return!_[_0xe7ce('0x5f')]([_0xe7ce('0x60'),_0xe7ce('0x61'),_0xe7ce('0x62'),_0xe7ce('0x63')],_0x3cf4b9);};var _0x28aad5=function(_0x4be42e){if(!_0x4be42e||!_0x4be42e[_0xe7ce('0x64')][_0xe7ce('0x41')]){return'';}for(var _0x316051='(',_0xb8bde2=0x0;_0xb8bde2<_0x4be42e['rules'][_0xe7ce('0x41')];_0xb8bde2+=0x1){_0xb8bde2>0x0&&(_0x316051+='\x20'+_0x4be42e[_0xe7ce('0x65')]+'\x20');_0x316051+=_0x4be42e[_0xe7ce('0x64')][_0xb8bde2][_0xe7ce('0x66')]?_0x28aad5(_0x4be42e[_0xe7ce('0x64')][_0xb8bde2][_0xe7ce('0x66')]):_0x4be42e['rules'][_0xb8bde2][_0xe7ce('0x67')]+'\x20'+_0x4be42e[_0xe7ce('0x64')][_0xb8bde2][_0xe7ce('0x68')]+(_0x2db6dc(_0x4be42e[_0xe7ce('0x64')][_0xb8bde2][_0xe7ce('0x68')])?'\x20'+_0x4be42e[_0xe7ce('0x64')][_0xb8bde2]['value']:'');}return _0x316051+')';};var _0x2eb45d={'where':{'id':_0x5eb831[_0xe7ce('0x4f')]['id']}},_0x5ba37d,_0x464a47,_0x16535a,_0xfa40d7,_0x59abd7;_0x2eb45d=_['merge']({},_0x2eb45d,_0x5eb831[_0xe7ce('0x37')]);return db[_0xe7ce('0x39')][_0xe7ce('0x49')](_0x2eb45d)[_0xe7ce('0x20')](function(_0x2ff100){if(_0x2ff100){_0x5ba37d=_0x2ff100;return _0x2ff100[_0xe7ce('0x6a')]();}return null;})[_0xe7ce('0x20')](function(_0x54d3e4){if(_0x54d3e4){if(!_0x54d3e4[_0xe7ce('0x41')]){throw new db[(_0xe7ce('0x89'))][(_0xe7ce('0x8a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x464a47=_0x54d3e4;return db[_0xe7ce('0x8b')][_0xe7ce('0x3c')]({'raw':!![]});}return null;})[_0xe7ce('0x20')](function(_0x2ef963){if(_0x2ef963){_0x16535a=_[_0xe7ce('0x6c')](_0x2ef963,'id');var _0x5d66f4;var _0x8138bd=squel['select']();_0x8138bd['from'](_0x5ba37d[_0xe7ce('0x6e')]);for(var _0x445d7c=0x0;_0x445d7c<_0x464a47[_0xe7ce('0x41')];_0x445d7c+=0x1){_0x5d66f4=_0x464a47[_0x445d7c][_0xe7ce('0x6f')]?_0x16535a[_0x464a47[_0x445d7c]['MetricId']][_0xe7ce('0x8d')]:_0x464a47[_0x445d7c][_0xe7ce('0x67')];_0x5d66f4=_0x464a47[_0x445d7c]['function']?_[_0xe7ce('0x71')](_0x2d83ce[_0x464a47[_0x445d7c]['function']],'%s',_0x5d66f4):_0x5d66f4;_0x5d66f4=_0x464a47[_0x445d7c][_0xe7ce('0x72')]?_[_0xe7ce('0x71')](_0x517e34[_0x464a47[_0x445d7c]['format']],'%s',_0x5d66f4):_0x5d66f4;if(_0x464a47[_0x445d7c]['groupBy']){_0x8138bd[_0xe7ce('0x66')](_0x5d66f4);}_0x464a47[_0x445d7c]['orderBy']&&_0x8138bd[_0xe7ce('0x75')](_0x5d66f4,_0x464a47[_0x445d7c][_0xe7ce('0x74')]===_0xe7ce('0x76')?![]:!![]);_0x8138bd['field'](_0x5d66f4,_0x464a47[_0x445d7c][_0xe7ce('0x77')]||_0x5d66f4);}if(_0x5ba37d[_0xe7ce('0x78')]){_0x5ba37d[_0xe7ce('0x78')]=JSON[_0xe7ce('0x79')](_0x5ba37d['joins']);for(var _0x558593=0x0;_0x558593<_0x5ba37d[_0xe7ce('0x78')][_0xe7ce('0x41')];_0x558593+=0x1){if(_0x5ba37d[_0xe7ce('0x78')][_0x558593][_0xe7ce('0x7a')]&&_[_0xe7ce('0x5f')](_0x459f42,_0x5ba37d['joins'][_0x558593][_0xe7ce('0x7a')])&&_0x5ba37d[_0xe7ce('0x78')][_0x558593][_0xe7ce('0x7b')]&&_0x5ba37d['joins'][_0x558593][_0xe7ce('0x7d')]&&_0x5ba37d[_0xe7ce('0x78')][_0x558593][_0xe7ce('0x7c')]){_0x8138bd[_0x5ba37d[_0xe7ce('0x78')][_0x558593][_0xe7ce('0x7a')]](_0x5ba37d['joins'][_0x558593][_0xe7ce('0x7d')],null,util[_0xe7ce('0x72')]('%s.%s\x20=\x20%s.%s',_0x5ba37d['table'],_0x5ba37d[_0xe7ce('0x78')][_0x558593][_0xe7ce('0x7b')],_0x5ba37d['joins'][_0x558593][_0xe7ce('0x7d')],_0x5ba37d[_0xe7ce('0x78')][_0x558593][_0xe7ce('0x7c')]));}}}if(_0x5ba37d[_0xe7ce('0x7f')]){_0x5ba37d[_0xe7ce('0x7f')]=JSON[_0xe7ce('0x79')](_0x5ba37d[_0xe7ce('0x7f')]);_0x8138bd[_0xe7ce('0x38')](_0x28aad5(_0x5ba37d[_0xe7ce('0x7f')][_0xe7ce('0x66')]));}_0x59abd7=_0x8138bd[_0xe7ce('0x80')]();_0x8138bd['limit'](_0x466aa1);_0x8138bd[_0xe7ce('0x18')](0x0);logger[_0xe7ce('0x81')](_0xe7ce('0x82'),_0x8138bd[_0xe7ce('0x83')]());return dbH['sequelize'][_0xe7ce('0x2a')](_0x8138bd['toString'](),{'type':dbH[_0xe7ce('0x84')][_0xe7ce('0x85')][_0xe7ce('0x86')]});}})['then'](function(){return{'sql':_0x59abd7[_0xe7ce('0x83')]()};})[_0xe7ce('0x20')](respondWithResult(_0x5029d4,null))[_0xe7ce('0x3e')](handleError(_0x5029d4,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 0e05952..d362d5c 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 _0x079a=['../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x079a,0x10d));var _0xa079=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x079a[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xa079('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa079('0x1'));var moment=require('moment');var BPromise=require(_0xa079('0x2'));var rp=require(_0xa079('0x3'));var fs=require('fs');var path=require(_0xa079('0x4'));var rimraf=require(_0xa079('0x5'));var config=require(_0xa079('0x6'));var attributes=require(_0xa079('0x7'));module[_0xa079('0x8')]=function(_0x3b6c7e,_0x511738){return _0x3b6c7e[_0xa079('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xa079('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9900=['moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9900,0x6c));var _0x0990=function(_0x28af96,_0x3049fb){_0x28af96=_0x28af96-0x0;var _0x27c8a1=_0x9900[_0x28af96];return _0x27c8a1;};'use strict';var _=require(_0x0990('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0990('0x1'));var moment=require(_0x0990('0x2'));var BPromise=require(_0x0990('0x3'));var rp=require(_0x0990('0x4'));var fs=require('fs');var path=require(_0x0990('0x5'));var rimraf=require(_0x0990('0x6'));var config=require('../../config/environment');var attributes=require(_0x0990('0x7'));module[_0x0990('0x8')]=function(_0x360261,_0x167c01){return _0x360261['define'](_0x0990('0x9'),attributes,{'tableName':_0x0990('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 5d51685..0a344ca 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 _0xaace=['../../config/logger','rpc','../../config/environment','jayson/promise','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xaace,0x144));var _0xeaac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaace[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeaac('0x0'));var util=require(_0xeaac('0x1'));var moment=require(_0xeaac('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaac('0x3'));var db=require(_0xeaac('0x4'))['db'];var utils=require(_0xeaac('0x5'));var logger=require(_0xeaac('0x6'))(_0xeaac('0x7'));var config=require(_0xeaac('0x8'));var jayson=require(_0xeaac('0x9'));var client=jayson['client'][_0xeaac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fa701,_0xbf2b95,_0x2a6811){return new BPromise(function(_0x5c31c4,_0xb68734){return client['request'](_0x4fa701,_0x2a6811)['then'](function(_0x4287a9){logger['info'](_0xeaac('0xb'),_0xbf2b95,_0xeaac('0xc'));logger[_0xeaac('0xd')](_0xeaac('0xe'),_0xbf2b95,_0xeaac('0xc'),JSON[_0xeaac('0xf')](_0x4287a9));if(_0x4287a9[_0xeaac('0x10')]){if(_0x4287a9['error'][_0xeaac('0x11')]===0x1f4){logger[_0xeaac('0x10')](_0xeaac('0xb'),_0xbf2b95,_0x4287a9[_0xeaac('0x10')][_0xeaac('0x12')]);return _0xb68734(_0x4287a9[_0xeaac('0x10')][_0xeaac('0x12')]);}logger[_0xeaac('0x10')](_0xeaac('0xb'),_0xbf2b95,_0x4287a9['error'][_0xeaac('0x12')]);return _0x5c31c4(_0x4287a9[_0xeaac('0x10')][_0xeaac('0x12')]);}else{logger[_0xeaac('0x13')](_0xeaac('0xb'),_0xbf2b95,_0xeaac('0xc'));_0x5c31c4(_0x4287a9[_0xeaac('0x14')][_0xeaac('0x12')]);}})[_0xeaac('0x15')](function(_0x10c43d){logger[_0xeaac('0x10')](_0xeaac('0xb'),_0xbf2b95,_0x10c43d);_0xb68734(_0x10c43d);});});} \ No newline at end of file +var _0x2ac3=['then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2d23d2,_0x494788){var _0xcc59f1=function(_0x28aaab){while(--_0x28aaab){_0x2d23d2['push'](_0x2d23d2['shift']());}};_0xcc59f1(++_0x494788);}(_0x2ac3,0x1ad));var _0x32ac=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x2ac3[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x32ac('0x0'));var util=require('util');var moment=require(_0x32ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x32ac('0x2'));var fs=require('fs');var Redis=require(_0x32ac('0x3'));var db=require(_0x32ac('0x4'))['db'];var utils=require(_0x32ac('0x5'));var logger=require('../../config/logger')(_0x32ac('0x6'));var config=require(_0x32ac('0x7'));var jayson=require(_0x32ac('0x8'));var client=jayson[_0x32ac('0x9')][_0x32ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c7ee9,_0x236f74,_0x50b2b5){return new BPromise(function(_0x1d6b5b,_0x1fd352){return client['request'](_0x2c7ee9,_0x50b2b5)[_0x32ac('0xb')](function(_0xb2991e){logger['info'](_0x32ac('0xc'),_0x236f74,_0x32ac('0xd'));logger[_0x32ac('0xe')](_0x32ac('0xf'),_0x236f74,'request\x20sent',JSON['stringify'](_0xb2991e));if(_0xb2991e[_0x32ac('0x10')]){if(_0xb2991e[_0x32ac('0x10')][_0x32ac('0x11')]===0x1f4){logger['error'](_0x32ac('0xc'),_0x236f74,_0xb2991e['error'][_0x32ac('0x12')]);return _0x1fd352(_0xb2991e['error'][_0x32ac('0x12')]);}logger[_0x32ac('0x10')](_0x32ac('0xc'),_0x236f74,_0xb2991e[_0x32ac('0x10')][_0x32ac('0x12')]);return _0x1d6b5b(_0xb2991e['error'][_0x32ac('0x12')]);}else{logger[_0x32ac('0x13')](_0x32ac('0xc'),_0x236f74,_0x32ac('0xd'));_0x1d6b5b(_0xb2991e['result'][_0x32ac('0x12')]);}})['catch'](function(_0x55dab9){logger[_0x32ac('0x10')](_0x32ac('0xc'),_0x236f74,_0x55dab9);_0x1fd352(_0x55dab9);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e47cf9f..cb3fcc8 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 _0xb653=['run','query','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xb653,0x98));var _0x3b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb653[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x3b65('0x0'));var path=require(_0x3b65('0x1'));var timeout=require(_0x3b65('0x2'));var express=require(_0x3b65('0x3'));var router=express[_0x3b65('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b65('0x5'));var interaction=require(_0x3b65('0x6'));var config=require(_0x3b65('0x7'));var controller=require(_0x3b65('0x8'));router[_0x3b65('0x9')]('/',auth[_0x3b65('0xa')](),controller[_0x3b65('0xb')]);router[_0x3b65('0x9')](_0x3b65('0xc'),auth[_0x3b65('0xa')](),controller[_0x3b65('0xd')]);router[_0x3b65('0x9')]('/:id/preview',auth[_0x3b65('0xa')](),controller[_0x3b65('0xe')]);router[_0x3b65('0x9')](_0x3b65('0xf'),auth[_0x3b65('0xa')](),controller[_0x3b65('0x10')]);router['get']('/:id/query',auth[_0x3b65('0xa')](),controller[_0x3b65('0x11')]);router[_0x3b65('0x12')]('/',auth[_0x3b65('0xa')](),controller[_0x3b65('0x13')]);router[_0x3b65('0x14')]('/:id',auth[_0x3b65('0xa')](),controller[_0x3b65('0x15')]);router['delete']('/:id',auth[_0x3b65('0xa')](),controller[_0x3b65('0x16')]);module[_0x3b65('0x17')]=router; \ No newline at end of file +var _0xedd7=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/run','/:id/query','query','post'];(function(_0x522973,_0x2b18bf){var _0x654b1=function(_0x37e3cc){while(--_0x37e3cc){_0x522973['push'](_0x522973['shift']());}};_0x654b1(++_0x2b18bf);}(_0xedd7,0x18d));var _0x7edd=function(_0x419b7a,_0x299ca7){_0x419b7a=_0x419b7a-0x0;var _0x4e284d=_0xedd7[_0x419b7a];return _0x4e284d;};'use strict';var multer=require(_0x7edd('0x0'));var util=require('util');var path=require(_0x7edd('0x1'));var timeout=require(_0x7edd('0x2'));var express=require('express');var router=express[_0x7edd('0x3')]();var fs_extra=require(_0x7edd('0x4'));var auth=require(_0x7edd('0x5'));var interaction=require(_0x7edd('0x6'));var config=require(_0x7edd('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x7edd('0x8')]('/',auth[_0x7edd('0x9')](),controller[_0x7edd('0xa')]);router['get'](_0x7edd('0xb'),auth[_0x7edd('0x9')](),controller[_0x7edd('0xc')]);router[_0x7edd('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x7edd('0x8')](_0x7edd('0xd'),auth[_0x7edd('0x9')](),controller['run']);router[_0x7edd('0x8')](_0x7edd('0xe'),auth[_0x7edd('0x9')](),controller[_0x7edd('0xf')]);router[_0x7edd('0x10')]('/',auth['isAuthenticated'](),controller[_0x7edd('0x11')]);router[_0x7edd('0x12')]('/:id',auth[_0x7edd('0x9')](),controller[_0x7edd('0x13')]);router[_0x7edd('0x14')]('/:id',auth[_0x7edd('0x9')](),controller[_0x7edd('0x15')]);module[_0x7edd('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1d5f11c..b01e67a 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x46ed,0x168));var _0xd46e=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x46ed[_0xa148b7];return _0x51efd3;};'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 +var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0xd7b26a,_0x1fc4a5){var _0x2a3ba5=function(_0x4230d9){while(--_0x4230d9){_0xd7b26a['push'](_0xd7b26a['shift']());}};_0x2a3ba5(++_0x1fc4a5);}(_0x98a8,0x12c));var _0x898a=function(_0x52c6e4,_0x2e9fcd){_0x52c6e4=_0x52c6e4-0x0;var _0x45fb80=_0x98a8[_0x52c6e4];return _0x45fb80;};'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/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 425c320..484fdcf 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x25e2d8,_0x5844af){var _0x2adb90=function(_0x555dff){while(--_0x555dff){_0x25e2d8['push'](_0x25e2d8['shift']());}};_0x2adb90(++_0x5844af);}(_0x1967,0x173));var _0x7196=function(_0x1f7312,_0x37c14b){_0x1f7312=_0x1f7312-0x0;var _0x5caf01=_0x1967[_0x1f7312];return _0x5caf01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file +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(_0x2fe787,_0x3b7876){var _0x51e71e=function(_0x371015){while(--_0x371015){_0x2fe787['push'](_0x2fe787['shift']());}};_0x51e71e(++_0x3b7876);}(_0x5fab,0x177));var _0xb5fa=function(_0x5923be,_0x3023ae){_0x5923be=_0x5923be-0x0;var _0x303700=_0x5fab[_0x5923be];return _0x303700;};'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 987c052..74ecd5f 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 _0x67ce=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x67ce,0x118));var _0xe67c=function(_0x43f2e7,_0xeeb10){_0x43f2e7=_0x43f2e7-0x0;var _0x54447f=_0x67ce[_0x43f2e7];return _0x54447f;};'use strict';var _=require(_0xe67c('0x0'));var util=require(_0xe67c('0x1'));var logger=require(_0xe67c('0x2'))(_0xe67c('0x3'));var moment=require(_0xe67c('0x4'));var BPromise=require(_0xe67c('0x5'));var rp=require(_0xe67c('0x6'));var fs=require('fs');var path=require(_0xe67c('0x7'));var rimraf=require(_0xe67c('0x8'));var config=require(_0xe67c('0x9'));var attributes=require(_0xe67c('0xa'));module[_0xe67c('0xb')]=function(_0x21d446,_0x18fe35){return _0x21d446[_0xe67c('0xc')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5aa5=['../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2feaad,_0x1aa6fc){var _0x5514bd=function(_0x4f3a47){while(--_0x4f3a47){_0x2feaad['push'](_0x2feaad['shift']());}};_0x5514bd(++_0x1aa6fc);}(_0x5aa5,0xef));var _0x55aa=function(_0x4c400b,_0x5c2340){_0x4c400b=_0x4c400b-0x0;var _0x41859c=_0x5aa5[_0x4c400b];return _0x41859c;};'use strict';var _=require(_0x55aa('0x0'));var util=require(_0x55aa('0x1'));var logger=require(_0x55aa('0x2'))(_0x55aa('0x3'));var moment=require(_0x55aa('0x4'));var BPromise=require(_0x55aa('0x5'));var rp=require(_0x55aa('0x6'));var fs=require('fs');var path=require(_0x55aa('0x7'));var rimraf=require('rimraf');var config=require(_0x55aa('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x55aa('0x9')]=function(_0x5afc88,_0x568d1b){return _0x5afc88[_0x55aa('0xa')](_0x55aa('0xb'),attributes,{'tableName':_0x55aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index eb0404b..1eaff99 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 _0xe002=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c14df,_0x480b74){var _0x17afa1=function(_0x4c36e6){while(--_0x4c36e6){_0x1c14df['push'](_0x1c14df['shift']());}};_0x17afa1(++_0x480b74);}(_0xe002,0x123));var _0x2e00=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0xe002[_0x2af053];return _0x4b4001;};'use strict';var _=require('lodash');var util=require(_0x2e00('0x0'));var moment=require(_0x2e00('0x1'));var BPromise=require(_0x2e00('0x2'));var rs=require(_0x2e00('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e00('0x4'))['db'];var utils=require(_0x2e00('0x5'));var logger=require(_0x2e00('0x6'))('rpc');var config=require(_0x2e00('0x7'));var jayson=require(_0x2e00('0x8'));var client=jayson[_0x2e00('0x9')][_0x2e00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ad09f,_0x4a4432,_0x4747c3){return new BPromise(function(_0x621865,_0x1a0abb){return client['request'](_0x5ad09f,_0x4747c3)[_0x2e00('0xb')](function(_0xa27c31){logger[_0x2e00('0xc')](_0x2e00('0xd'),_0x4a4432,_0x2e00('0xe'));logger[_0x2e00('0xf')](_0x2e00('0x10'),_0x4a4432,_0x2e00('0xe'),JSON[_0x2e00('0x11')](_0xa27c31));if(_0xa27c31[_0x2e00('0x12')]){if(_0xa27c31['error']['code']===0x1f4){logger[_0x2e00('0x12')](_0x2e00('0xd'),_0x4a4432,_0xa27c31['error'][_0x2e00('0x13')]);return _0x1a0abb(_0xa27c31['error'][_0x2e00('0x13')]);}logger[_0x2e00('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a4432,_0xa27c31['error'][_0x2e00('0x13')]);return _0x621865(_0xa27c31['error'][_0x2e00('0x13')]);}else{logger[_0x2e00('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a4432,_0x2e00('0xe'));_0x621865(_0xa27c31[_0x2e00('0x14')]['message']);}})[_0x2e00('0x15')](function(_0x2b53ab){logger[_0x2e00('0x12')](_0x2e00('0xd'),_0x4a4432,_0x2b53ab);_0x1a0abb(_0x2b53ab);});});} \ No newline at end of file +var _0x9648=['request\x20sent','stringify','code','error','AnalyticDefaultReport,\x20%s,\x20%s','message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x43fa9c,_0x3f1469){var _0x596325=function(_0x5e2595){while(--_0x5e2595){_0x43fa9c['push'](_0x43fa9c['shift']());}};_0x596325(++_0x3f1469);}(_0x9648,0x196));var _0x8964=function(_0x2d665b,_0x522197){_0x2d665b=_0x2d665b-0x0;var _0x1d54c4=_0x9648[_0x2d665b];return _0x1d54c4;};'use strict';var _=require(_0x8964('0x0'));var util=require(_0x8964('0x1'));var moment=require(_0x8964('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8964('0x3'));var db=require(_0x8964('0x4'))['db'];var utils=require(_0x8964('0x5'));var logger=require('../../config/logger')(_0x8964('0x6'));var config=require(_0x8964('0x7'));var jayson=require(_0x8964('0x8'));var client=jayson[_0x8964('0x9')][_0x8964('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57b62d,_0x2d9575,_0x2656c2){return new BPromise(function(_0x1bc0e5,_0xaafa59){return client[_0x8964('0xb')](_0x57b62d,_0x2656c2)['then'](function(_0x51b9fa){logger[_0x8964('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d9575,'request\x20sent');logger[_0x8964('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2d9575,_0x8964('0xe'),JSON[_0x8964('0xf')](_0x51b9fa));if(_0x51b9fa['error']){if(_0x51b9fa['error'][_0x8964('0x10')]===0x1f4){logger[_0x8964('0x11')](_0x8964('0x12'),_0x2d9575,_0x51b9fa[_0x8964('0x11')][_0x8964('0x13')]);return _0xaafa59(_0x51b9fa[_0x8964('0x11')][_0x8964('0x13')]);}logger['error'](_0x8964('0x12'),_0x2d9575,_0x51b9fa[_0x8964('0x11')][_0x8964('0x13')]);return _0x1bc0e5(_0x51b9fa[_0x8964('0x11')][_0x8964('0x13')]);}else{logger[_0x8964('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d9575,_0x8964('0xe'));_0x1bc0e5(_0x51b9fa['result'][_0x8964('0x13')]);}})['catch'](function(_0x356645){logger[_0x8964('0x11')](_0x8964('0x12'),_0x2d9575,_0x356645);_0xaafa59(_0x356645);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 61c0355..7950ea8 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 _0xdce9=['delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','run','/:id/query','query','post','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xdce9,0x1e5));var _0x9dce=function(_0x170d7e,_0x3de8ab){_0x170d7e=_0x170d7e-0x0;var _0xae4503=_0xdce9[_0x170d7e];return _0xae4503;};'use strict';var multer=require(_0x9dce('0x0'));var util=require(_0x9dce('0x1'));var path=require(_0x9dce('0x2'));var timeout=require('connect-timeout');var express=require(_0x9dce('0x3'));var router=express[_0x9dce('0x4')]();var fs_extra=require(_0x9dce('0x5'));var auth=require(_0x9dce('0x6'));var interaction=require(_0x9dce('0x7'));var config=require(_0x9dce('0x8'));var controller=require(_0x9dce('0x9'));router['get']('/',auth[_0x9dce('0xa')](),controller['index']);router[_0x9dce('0xb')](_0x9dce('0xc'),auth[_0x9dce('0xa')](),controller[_0x9dce('0xd')]);router[_0x9dce('0xb')](_0x9dce('0xe'),auth['isAuthenticated'](),controller[_0x9dce('0xf')]);router[_0x9dce('0xb')]('/:id/run',auth[_0x9dce('0xa')](),controller[_0x9dce('0x10')]);router[_0x9dce('0xb')](_0x9dce('0x11'),auth['isAuthenticated'](),controller[_0x9dce('0x12')]);router[_0x9dce('0x13')]('/',auth[_0x9dce('0xa')](),controller['create']);router['put'](_0x9dce('0xc'),auth[_0x9dce('0xa')](),controller[_0x9dce('0x14')]);router[_0x9dce('0x15')](_0x9dce('0xc'),auth[_0x9dce('0xa')](),controller['destroy']);module[_0x9dce('0x16')]=router; \ No newline at end of file +var _0x2010=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4286b7,_0x2fdb8e){var _0x597fd1=function(_0x220ea3){while(--_0x220ea3){_0x4286b7['push'](_0x4286b7['shift']());}};_0x597fd1(++_0x2fdb8e);}(_0x2010,0x124));var _0x0201=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2010[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0201('0x0'));var util=require(_0x0201('0x1'));var path=require('path');var timeout=require(_0x0201('0x2'));var express=require(_0x0201('0x3'));var router=express[_0x0201('0x4')]();var fs_extra=require(_0x0201('0x5'));var auth=require(_0x0201('0x6'));var interaction=require(_0x0201('0x7'));var config=require('../../config/environment');var controller=require(_0x0201('0x8'));router[_0x0201('0x9')]('/',auth[_0x0201('0xa')](),controller[_0x0201('0xb')]);router[_0x0201('0x9')](_0x0201('0xc'),auth[_0x0201('0xa')](),controller[_0x0201('0xd')]);router[_0x0201('0x9')](_0x0201('0xe'),auth['isAuthenticated'](),controller[_0x0201('0xf')]);router[_0x0201('0x9')](_0x0201('0x10'),auth[_0x0201('0xa')](),controller[_0x0201('0x11')]);router[_0x0201('0x9')](_0x0201('0x12'),auth[_0x0201('0xa')](),controller[_0x0201('0x13')]);router[_0x0201('0x14')]('/',auth[_0x0201('0xa')](),controller[_0x0201('0x15')]);router[_0x0201('0x16')](_0x0201('0xc'),auth[_0x0201('0xa')](),controller[_0x0201('0x17')]);router[_0x0201('0x18')](_0x0201('0xc'),auth[_0x0201('0xa')](),controller[_0x0201('0x19')]);module[_0x0201('0x1a')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 61991f4..f798cce 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 _0x2291=['xlsx','DATE','manual','UNSIGNED','sequelize','moment','STRING','ENUM','csv'];(function(_0x42ad24,_0x135086){var _0x173292=function(_0x48de27){while(--_0x48de27){_0x42ad24['push'](_0x42ad24['shift']());}};_0x173292(++_0x135086);}(_0x2291,0x199));var _0x1229=function(_0x11b240,_0x22e83d){_0x11b240=_0x11b240-0x0;var _0x25b4da=_0x2291[_0x11b240];return _0x25b4da;};'use strict';var Sequelize=require(_0x1229('0x0'));var moment=require(_0x1229('0x1'));module['exports']={'name':{'type':Sequelize[_0x1229('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1229('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1229('0x3')](_0x1229('0x4'),'pdf',_0x1229('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x1229('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1229('0x6')]},'endDate':{'type':Sequelize[_0x1229('0x6')]},'status':{'type':Sequelize[_0x1229('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x1229('0x3')](_0x1229('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x1229('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x1229('0x8')]},'reportType':{'type':Sequelize[_0x1229('0x2')]}}; \ No newline at end of file +var _0x6242=['scheduled','manual','UNSIGNED','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x6242,0x11b));var _0x2624=function(_0x530fbf,_0x5d0b13){_0x530fbf=_0x530fbf-0x0;var _0x32dcaf=_0x6242[_0x530fbf];return _0x32dcaf;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x2624('0x0')],'allowNull':![]},'basename':{'type':Sequelize[_0x2624('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0x2624('0x1')](_0x2624('0x2'),_0x2624('0x3'),_0x2624('0x4')),'allowNull':![],'defaultValue':_0x2624('0x2')},'savename':{'type':Sequelize[_0x2624('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2624('0x5')]},'endDate':{'type':Sequelize[_0x2624('0x5')]},'status':{'type':Sequelize[_0x2624('0x0')],'defaultValue':_0x2624('0x6')},'type':{'type':Sequelize['ENUM']('manual',_0x2624('0x7')),'allowNull':![],'defaultValue':_0x2624('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2624('0x9')]},'reportType':{'type':Sequelize[_0x2624('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 535bab1..acf9484 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 _0x035d=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','exists','server/files/reports','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','ExtractedReports','UserProfileResource','error','name','index','map','AnalyticExtractedReport','rawAttributes','type','key','keys','query'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x035d,0x14a));var _0xd035=function(_0x120ee3,_0x4d0465){_0x120ee3=_0x120ee3-0x0;var _0x165221=_0x035d[_0x120ee3];return _0x165221;};'use strict';var emlformat=require(_0xd035('0x0'));var rimraf=require(_0xd035('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd035('0x2'));var rp=require(_0xd035('0x3'));var moment=require('moment');var BPromise=require(_0xd035('0x4'));var Mustache=require('mustache');var util=require(_0xd035('0x5'));var path=require(_0xd035('0x6'));var sox=require('sox');var csv=require(_0xd035('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd035('0x8'));var _=require(_0xd035('0x9'));var squel=require(_0xd035('0xa'));var crypto=require(_0xd035('0xb'));var jsforce=require(_0xd035('0xc'));var deskjs=require(_0xd035('0xd'));var toCsv=require(_0xd035('0x7'));var querystring=require(_0xd035('0xe'));var Papa=require(_0xd035('0xf'));var Redis=require('ioredis');var authService=require(_0xd035('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd035('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd035('0x12'));var utils=require(_0xd035('0x13'));var config=require(_0xd035('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd035('0x15'))['db'];function respondWithStatusCode(_0xf2272d,_0x3e736c){_0x3e736c=_0x3e736c||0xcc;return function(_0x2d92d4){if(_0x2d92d4){return _0xf2272d[_0xd035('0x16')](_0x3e736c);}return _0xf2272d[_0xd035('0x17')](_0x3e736c)[_0xd035('0x18')]();};}function respondWithResult(_0x552967,_0x20384c){_0x20384c=_0x20384c||0xc8;return function(_0x588734){if(_0x588734){return _0x552967['status'](_0x20384c)['json'](_0x588734);}};}function respondWithFilteredResult(_0x1d12e9,_0x5535d7){return function(_0x5d2ec4){if(_0x5d2ec4){var _0x32f932=typeof _0x5535d7[_0xd035('0x19')]===_0xd035('0x1a')&&typeof _0x5535d7['limit']===_0xd035('0x1a');var _0x51151f=_0x5d2ec4[_0xd035('0x1b')];var _0x2ca121=_0x32f932?0x0:_0x5535d7[_0xd035('0x19')];var _0x3105d7=_0x32f932?_0x5d2ec4[_0xd035('0x1b')]:_0x5535d7[_0xd035('0x19')]+_0x5535d7[_0xd035('0x1c')];var _0x20c282;if(_0x3105d7>=_0x51151f){_0x3105d7=_0x51151f;_0x20c282=0xc8;}else{_0x20c282=0xce;}_0x1d12e9[_0xd035('0x17')](_0x20c282);return _0x1d12e9[_0xd035('0x1d')](_0xd035('0x1e'),_0x2ca121+'-'+_0x3105d7+'/'+_0x51151f)[_0xd035('0x1f')](_0x5d2ec4);}return null;};}function patchUpdates(_0x5ab8dd){return function(_0x586035){try{jsonpatch[_0xd035('0x20')](_0x586035,_0x5ab8dd,!![]);}catch(_0xc041f){return BPromise[_0xd035('0x21')](_0xc041f);}return _0x586035[_0xd035('0x22')]();};}function saveUpdates(_0x583bb0,_0x2d33e3){return function(_0x4b0c71){if(_0x4b0c71){return _0x4b0c71[_0xd035('0x23')](_0x583bb0)['then'](function(_0x69ce72){return _0x69ce72;});}return null;};}function removeEntity(_0x4d20a0,_0x5b0832){return function(_0x932bed){if(_0x932bed){return _0x932bed[_0xd035('0x24')]()[_0xd035('0x25')](function(){var _0x31836f=_0x932bed['get']({'plain':!![]});var _0x5b19d4=_0xd035('0x26');return db[_0xd035('0x27')]['destroy']({'where':{'type':_0x5b19d4,'resourceId':_0x31836f['id']}})[_0xd035('0x25')](function(){return _0x932bed;});})['then'](function(){_0x4d20a0[_0xd035('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13e240,_0x3620eb){return function(_0x3e33ed){if(!_0x3e33ed){_0x13e240[_0xd035('0x16')](0x194);}return _0x3e33ed;};}function handleError(_0xd19e7b,_0x1c8a6f){_0x1c8a6f=_0x1c8a6f||0x1f4;return function(_0x29df99){logger[_0xd035('0x28')](_0x29df99['stack']);if(_0x29df99[_0xd035('0x29')]){delete _0x29df99[_0xd035('0x29')];}_0xd19e7b[_0xd035('0x17')](_0x1c8a6f)['send'](_0x29df99);};}exports[_0xd035('0x2a')]=function(_0x24aa20,_0x1adca2){var _0x3807d4={},_0x499580={},_0x18803d={'count':0x0,'rows':[]};var _0x1c5078=_[_0xd035('0x2b')](db[_0xd035('0x2c')][_0xd035('0x2d')],function(_0x571a2c){return{'name':_0x571a2c['fieldName'],'type':_0x571a2c[_0xd035('0x2e')][_0xd035('0x2f')]};});_0x499580['model']=_[_0xd035('0x2b')](_0x1c5078,_0xd035('0x29'));_0x499580['query']=_[_0xd035('0x30')](_0x24aa20[_0xd035('0x31')]);_0x499580[_0xd035('0x32')]=_[_0xd035('0x33')](_0x499580[_0xd035('0x34')],_0x499580[_0xd035('0x31')]);_0x3807d4[_0xd035('0x35')]=_[_0xd035('0x33')](_0x499580[_0xd035('0x34')],qs['fields'](_0x24aa20[_0xd035('0x31')][_0xd035('0x36')]));_0x3807d4[_0xd035('0x35')]=_0x3807d4[_0xd035('0x35')][_0xd035('0x37')]?_0x3807d4[_0xd035('0x35')]:_0x499580['model'];if(!_0x24aa20['query'][_0xd035('0x38')](_0xd035('0x39'))){_0x3807d4[_0xd035('0x1c')]=qs['limit'](_0x24aa20['query'][_0xd035('0x1c')]);_0x3807d4[_0xd035('0x19')]=qs[_0xd035('0x19')](_0x24aa20[_0xd035('0x31')]['offset']);}_0x3807d4[_0xd035('0x3a')]=qs['sort'](_0x24aa20[_0xd035('0x31')][_0xd035('0x3b')]);_0x3807d4[_0xd035('0x3c')]=qs['filters'](_[_0xd035('0x3d')](_0x24aa20[_0xd035('0x31')],_0x499580[_0xd035('0x32')]),_0x1c5078);if(_0x24aa20[_0xd035('0x31')][_0xd035('0x3e')]){_0x3807d4[_0xd035('0x3c')]=_[_0xd035('0x3f')](_0x3807d4[_0xd035('0x3c')],{'$or':_['map'](_0x1c5078,function(_0x259c1c){if(_0x259c1c[_0xd035('0x2e')]!==_0xd035('0x40')){var _0x4f6ed5={};_0x4f6ed5[_0x259c1c['name']]={'$like':'%'+_0x24aa20['query']['filter']+'%'};return _0x4f6ed5;}})});}_0x3807d4=_[_0xd035('0x3f')]({},_0x3807d4,_0x24aa20[_0xd035('0x41')]);var _0x153958={'where':_0x3807d4[_0xd035('0x3c')]};return db[_0xd035('0x2c')][_0xd035('0x1b')](_0x153958)[_0xd035('0x25')](function(_0x13462f){_0x18803d[_0xd035('0x1b')]=_0x13462f;if(_0x24aa20[_0xd035('0x31')][_0xd035('0x42')]){_0x3807d4[_0xd035('0x43')]=[{'all':!![]}];}return db[_0xd035('0x2c')][_0xd035('0x44')](_0x3807d4);})['then'](function(_0x2b2192){_0x18803d[_0xd035('0x45')]=_0x2b2192;return _0x18803d;})['then'](respondWithFilteredResult(_0x1adca2,_0x3807d4))[_0xd035('0x46')](handleError(_0x1adca2,null));};exports[_0xd035('0x47')]=function(_0x508170,_0x2b88b0){var _0x1fcebe={'raw':!![],'where':{'id':_0x508170['params']['id']}},_0x301d1b={};_0x301d1b[_0xd035('0x34')]=_[_0xd035('0x30')](db['AnalyticExtractedReport'][_0xd035('0x2d')]);_0x301d1b[_0xd035('0x31')]=_[_0xd035('0x30')](_0x508170[_0xd035('0x31')]);_0x301d1b[_0xd035('0x32')]=_[_0xd035('0x33')](_0x301d1b[_0xd035('0x34')],_0x301d1b['query']);_0x1fcebe[_0xd035('0x35')]=_[_0xd035('0x33')](_0x301d1b[_0xd035('0x34')],qs[_0xd035('0x36')](_0x508170[_0xd035('0x31')][_0xd035('0x36')]));_0x1fcebe[_0xd035('0x35')]=_0x1fcebe[_0xd035('0x35')][_0xd035('0x37')]?_0x1fcebe[_0xd035('0x35')]:_0x301d1b[_0xd035('0x34')];if(_0x508170[_0xd035('0x31')][_0xd035('0x42')]){_0x1fcebe[_0xd035('0x43')]=[{'all':!![]}];}_0x1fcebe=_[_0xd035('0x3f')]({},_0x1fcebe,_0x508170[_0xd035('0x41')]);return db[_0xd035('0x2c')][_0xd035('0x48')](_0x1fcebe)['then'](handleEntityNotFound(_0x2b88b0,null))['then'](respondWithResult(_0x2b88b0,null))['catch'](handleError(_0x2b88b0,null));};exports[_0xd035('0x49')]=function(_0x1c00e4,_0x49615b){return db[_0xd035('0x2c')]['create'](_0x1c00e4[_0xd035('0x4a')],{})['then'](function(_0x4b7ec5){var _0x1849e6=_0x1c00e4[_0xd035('0x4b')][_0xd035('0x4c')]({'plain':!![]});if(!_0x1849e6)throw new Error(_0xd035('0x4d'));if(_0x1849e6[_0xd035('0x4e')]===_0xd035('0x4b')){var _0x1c7be0=_0x4b7ec5['get']({'plain':!![]});var _0x14ba1b='ExtractedReports';return db['UserProfileSection'][_0xd035('0x48')]({'where':{'name':_0x14ba1b,'userProfileId':_0x1849e6[_0xd035('0x4f')]},'raw':!![]})[_0xd035('0x25')](function(_0x40d68b){if(_0x40d68b&&_0x40d68b[_0xd035('0x50')]===0x0){return db[_0xd035('0x27')][_0xd035('0x49')]({'name':_0x1c7be0['name'],'resourceId':_0x1c7be0['id'],'type':_0x40d68b[_0xd035('0x29')],'sectionId':_0x40d68b['id']},{})[_0xd035('0x25')](function(){return _0x4b7ec5;});}else{return _0x4b7ec5;}})['catch'](function(_0x6210dc){logger[_0xd035('0x28')](_0xd035('0x51'),_0x6210dc);throw _0x6210dc;});}return _0x4b7ec5;})['then'](respondWithResult(_0x49615b,0xc9))[_0xd035('0x46')](handleError(_0x49615b,null));};exports[_0xd035('0x23')]=function(_0x3d831f,_0x33b9de){if(_0x3d831f[_0xd035('0x4a')]['id']){delete _0x3d831f[_0xd035('0x4a')]['id'];}return db[_0xd035('0x2c')][_0xd035('0x48')]({'where':{'id':_0x3d831f['params']['id']}})[_0xd035('0x25')](handleEntityNotFound(_0x33b9de,null))[_0xd035('0x25')](saveUpdates(_0x3d831f['body'],null))[_0xd035('0x25')](respondWithResult(_0x33b9de,null))[_0xd035('0x46')](handleError(_0x33b9de,null));};exports[_0xd035('0x24')]=function(_0x3cd5c5,_0x5c4e30){return db[_0xd035('0x2c')][_0xd035('0x48')]({'where':{'id':_0x3cd5c5[_0xd035('0x52')]['id']}})['then'](handleEntityNotFound(_0x5c4e30,null))[_0xd035('0x25')](removeEntity(_0x5c4e30,null))['catch'](handleError(_0x5c4e30,null));};exports[_0xd035('0x53')]=function(_0x5b7839,_0x536423,_0x37c105){return db[_0xd035('0x2c')][_0xd035('0x48')]({'where':{'id':_0x5b7839['params']['id']},'attributes':[_0xd035('0x29'),_0xd035('0x54'),_0xd035('0x55'),_0xd035('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x536423,null))[_0xd035('0x25')](function(_0x49c233){if(_0x49c233){if(!fs[_0xd035('0x57')](path[_0xd035('0x58')](config[_0xd035('0x59')],'server/files/reports',_0x49c233[_0xd035('0x55')]))){throw new db[(_0xd035('0x5a'))][(_0xd035('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5b7839['query'][_0xd035('0x5c')]){return _0x536423[_0xd035('0x16')](0xc8);}return _0x536423[_0xd035('0x53')](path[_0xd035('0x58')](config[_0xd035('0x59')],_0xd035('0x5d'),_0x49c233[_0xd035('0x55')]),util[_0xd035('0x5e')]('%s.%s',_0x49c233[_0xd035('0x54')]||_0x49c233[_0xd035('0x29')],_0x49c233[_0xd035('0x56')]['toLowerCase']()));}})['catch'](handleError(_0x536423,null));}; \ No newline at end of file +var _0x3d66=['offset','Content-Range','json','apply','save','update','get','ExtractedReports','UserProfileResource','destroy','then','stack','name','send','AnalyticExtractedReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','savename','output','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','server/files/reports','%s.%s','basename','toLowerCase','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','limit','undefined','count'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0x3d66,0x153));var _0x63d6=function(_0x4f0c25,_0x4e3d94){_0x4f0c25=_0x4f0c25-0x0;var _0xca181c=_0x3d66[_0x4f0c25];return _0xca181c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x63d6('0x0'));var jsonpatch=require(_0x63d6('0x1'));var rp=require(_0x63d6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x63d6('0x3'));var util=require(_0x63d6('0x4'));var path=require(_0x63d6('0x5'));var sox=require('sox');var csv=require(_0x63d6('0x6'));var ejs=require(_0x63d6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63d6('0x8'));var squel=require(_0x63d6('0x9'));var crypto=require('crypto');var jsforce=require(_0x63d6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x63d6('0x6'));var querystring=require('querystring');var Papa=require(_0x63d6('0xb'));var Redis=require(_0x63d6('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x63d6('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63d6('0xe'));var logger=require(_0x63d6('0xf'))(_0x63d6('0x10'));var utils=require(_0x63d6('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x63d6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f5c6,_0x24c8a9){_0x24c8a9=_0x24c8a9||0xcc;return function(_0x30d14c){if(_0x30d14c){return _0x13f5c6[_0x63d6('0x13')](_0x24c8a9);}return _0x13f5c6['status'](_0x24c8a9)[_0x63d6('0x14')]();};}function respondWithResult(_0x56c8cc,_0x352c3b){_0x352c3b=_0x352c3b||0xc8;return function(_0x375bc9){if(_0x375bc9){return _0x56c8cc[_0x63d6('0x15')](_0x352c3b)['json'](_0x375bc9);}};}function respondWithFilteredResult(_0x4be1a2,_0x494e61){return function(_0x8d52e6){if(_0x8d52e6){var _0x38ed9d=typeof _0x494e61['offset']==='undefined'&&typeof _0x494e61[_0x63d6('0x16')]===_0x63d6('0x17');var _0x4df6fc=_0x8d52e6[_0x63d6('0x18')];var _0xfd5d66=_0x38ed9d?0x0:_0x494e61[_0x63d6('0x19')];var _0x4a1672=_0x38ed9d?_0x8d52e6['count']:_0x494e61[_0x63d6('0x19')]+_0x494e61[_0x63d6('0x16')];var _0x45aa55;if(_0x4a1672>=_0x4df6fc){_0x4a1672=_0x4df6fc;_0x45aa55=0xc8;}else{_0x45aa55=0xce;}_0x4be1a2[_0x63d6('0x15')](_0x45aa55);return _0x4be1a2['set'](_0x63d6('0x1a'),_0xfd5d66+'-'+_0x4a1672+'/'+_0x4df6fc)[_0x63d6('0x1b')](_0x8d52e6);}return null;};}function patchUpdates(_0x40c376){return function(_0x39595f){try{jsonpatch[_0x63d6('0x1c')](_0x39595f,_0x40c376,!![]);}catch(_0x2eb78d){return BPromise['reject'](_0x2eb78d);}return _0x39595f[_0x63d6('0x1d')]();};}function saveUpdates(_0x1730e2,_0x34a60b){return function(_0x12585d){if(_0x12585d){return _0x12585d[_0x63d6('0x1e')](_0x1730e2)['then'](function(_0x151e17){return _0x151e17;});}return null;};}function removeEntity(_0x5b5fb4,_0x13a415){return function(_0x5c598a){if(_0x5c598a){return _0x5c598a['destroy']()['then'](function(){var _0x549f29=_0x5c598a[_0x63d6('0x1f')]({'plain':!![]});var _0xcb5c0e=_0x63d6('0x20');return db[_0x63d6('0x21')][_0x63d6('0x22')]({'where':{'type':_0xcb5c0e,'resourceId':_0x549f29['id']}})[_0x63d6('0x23')](function(){return _0x5c598a;});})['then'](function(){_0x5b5fb4[_0x63d6('0x15')](0xcc)[_0x63d6('0x14')]();});}};}function handleEntityNotFound(_0x86e189,_0x1ebddf){return function(_0x489a80){if(!_0x489a80){_0x86e189[_0x63d6('0x13')](0x194);}return _0x489a80;};}function handleError(_0x3ce2b0,_0x3002be){_0x3002be=_0x3002be||0x1f4;return function(_0x40aced){logger['error'](_0x40aced[_0x63d6('0x24')]);if(_0x40aced[_0x63d6('0x25')]){delete _0x40aced[_0x63d6('0x25')];}_0x3ce2b0[_0x63d6('0x15')](_0x3002be)[_0x63d6('0x26')](_0x40aced);};}exports['index']=function(_0x52a380,_0x116128){var _0x186e5c={},_0x18e10c={},_0x7aca2d={'count':0x0,'rows':[]};var _0x4414c8=_['map'](db[_0x63d6('0x27')][_0x63d6('0x28')],function(_0x3942a2){return{'name':_0x3942a2['fieldName'],'type':_0x3942a2[_0x63d6('0x29')][_0x63d6('0x2a')]};});_0x18e10c[_0x63d6('0x2b')]=_[_0x63d6('0x2c')](_0x4414c8,'name');_0x18e10c[_0x63d6('0x2d')]=_['keys'](_0x52a380[_0x63d6('0x2d')]);_0x18e10c[_0x63d6('0x2e')]=_[_0x63d6('0x2f')](_0x18e10c[_0x63d6('0x2b')],_0x18e10c[_0x63d6('0x2d')]);_0x186e5c[_0x63d6('0x30')]=_[_0x63d6('0x2f')](_0x18e10c[_0x63d6('0x2b')],qs[_0x63d6('0x31')](_0x52a380[_0x63d6('0x2d')][_0x63d6('0x31')]));_0x186e5c[_0x63d6('0x30')]=_0x186e5c['attributes'][_0x63d6('0x32')]?_0x186e5c[_0x63d6('0x30')]:_0x18e10c[_0x63d6('0x2b')];if(!_0x52a380[_0x63d6('0x2d')][_0x63d6('0x33')](_0x63d6('0x34'))){_0x186e5c[_0x63d6('0x16')]=qs[_0x63d6('0x16')](_0x52a380[_0x63d6('0x2d')]['limit']);_0x186e5c[_0x63d6('0x19')]=qs[_0x63d6('0x19')](_0x52a380[_0x63d6('0x2d')][_0x63d6('0x19')]);}_0x186e5c[_0x63d6('0x35')]=qs['sort'](_0x52a380[_0x63d6('0x2d')][_0x63d6('0x36')]);_0x186e5c[_0x63d6('0x37')]=qs[_0x63d6('0x2e')](_[_0x63d6('0x38')](_0x52a380[_0x63d6('0x2d')],_0x18e10c['filters']),_0x4414c8);if(_0x52a380['query'][_0x63d6('0x39')]){_0x186e5c['where']=_[_0x63d6('0x3a')](_0x186e5c[_0x63d6('0x37')],{'$or':_['map'](_0x4414c8,function(_0x30cc20){if(_0x30cc20[_0x63d6('0x29')]!==_0x63d6('0x3b')){var _0x3329f8={};_0x3329f8[_0x30cc20[_0x63d6('0x25')]]={'$like':'%'+_0x52a380[_0x63d6('0x2d')][_0x63d6('0x39')]+'%'};return _0x3329f8;}})});}_0x186e5c=_[_0x63d6('0x3a')]({},_0x186e5c,_0x52a380[_0x63d6('0x3c')]);var _0x304d60={'where':_0x186e5c[_0x63d6('0x37')]};return db[_0x63d6('0x27')][_0x63d6('0x18')](_0x304d60)['then'](function(_0x3a95cc){_0x7aca2d[_0x63d6('0x18')]=_0x3a95cc;if(_0x52a380[_0x63d6('0x2d')]['includeAll']){_0x186e5c[_0x63d6('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x63d6('0x3e')](_0x186e5c);})['then'](function(_0x2cb60b){_0x7aca2d[_0x63d6('0x3f')]=_0x2cb60b;return _0x7aca2d;})[_0x63d6('0x23')](respondWithFilteredResult(_0x116128,_0x186e5c))[_0x63d6('0x40')](handleError(_0x116128,null));};exports[_0x63d6('0x41')]=function(_0x8ace88,_0x599c0f){var _0x256e60={'raw':!![],'where':{'id':_0x8ace88[_0x63d6('0x42')]['id']}},_0x16e453={};_0x16e453[_0x63d6('0x2b')]=_[_0x63d6('0x43')](db['AnalyticExtractedReport']['rawAttributes']);_0x16e453['query']=_[_0x63d6('0x43')](_0x8ace88['query']);_0x16e453[_0x63d6('0x2e')]=_['intersection'](_0x16e453[_0x63d6('0x2b')],_0x16e453[_0x63d6('0x2d')]);_0x256e60['attributes']=_[_0x63d6('0x2f')](_0x16e453['model'],qs[_0x63d6('0x31')](_0x8ace88[_0x63d6('0x2d')][_0x63d6('0x31')]));_0x256e60[_0x63d6('0x30')]=_0x256e60[_0x63d6('0x30')][_0x63d6('0x32')]?_0x256e60[_0x63d6('0x30')]:_0x16e453[_0x63d6('0x2b')];if(_0x8ace88[_0x63d6('0x2d')][_0x63d6('0x44')]){_0x256e60[_0x63d6('0x3d')]=[{'all':!![]}];}_0x256e60=_[_0x63d6('0x3a')]({},_0x256e60,_0x8ace88[_0x63d6('0x3c')]);return db['AnalyticExtractedReport'][_0x63d6('0x45')](_0x256e60)['then'](handleEntityNotFound(_0x599c0f,null))[_0x63d6('0x23')](respondWithResult(_0x599c0f,null))[_0x63d6('0x40')](handleError(_0x599c0f,null));};exports[_0x63d6('0x46')]=function(_0x295134,_0x196354){return db[_0x63d6('0x27')][_0x63d6('0x46')](_0x295134[_0x63d6('0x47')],{})[_0x63d6('0x23')](function(_0x269fe2){var _0x2c421e=_0x295134['user'][_0x63d6('0x1f')]({'plain':!![]});if(!_0x2c421e)throw new Error(_0x63d6('0x48'));if(_0x2c421e[_0x63d6('0x49')]===_0x63d6('0x4a')){var _0x1f1801=_0x269fe2[_0x63d6('0x1f')]({'plain':!![]});var _0x285df6=_0x63d6('0x20');return db['UserProfileSection'][_0x63d6('0x45')]({'where':{'name':_0x285df6,'userProfileId':_0x2c421e[_0x63d6('0x4b')]},'raw':!![]})[_0x63d6('0x23')](function(_0x3a144f){if(_0x3a144f&&_0x3a144f[_0x63d6('0x4c')]===0x0){return db[_0x63d6('0x21')]['create']({'name':_0x1f1801['name'],'resourceId':_0x1f1801['id'],'type':_0x3a144f[_0x63d6('0x25')],'sectionId':_0x3a144f['id']},{})['then'](function(){return _0x269fe2;});}else{return _0x269fe2;}})['catch'](function(_0x273c35){logger[_0x63d6('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x273c35);throw _0x273c35;});}return _0x269fe2;})[_0x63d6('0x23')](respondWithResult(_0x196354,0xc9))[_0x63d6('0x40')](handleError(_0x196354,null));};exports[_0x63d6('0x1e')]=function(_0x39dc3c,_0xb2560){if(_0x39dc3c[_0x63d6('0x47')]['id']){delete _0x39dc3c['body']['id'];}return db[_0x63d6('0x27')]['find']({'where':{'id':_0x39dc3c['params']['id']}})[_0x63d6('0x23')](handleEntityNotFound(_0xb2560,null))['then'](saveUpdates(_0x39dc3c[_0x63d6('0x47')],null))['then'](respondWithResult(_0xb2560,null))[_0x63d6('0x40')](handleError(_0xb2560,null));};exports['destroy']=function(_0x33d053,_0x47d727){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x33d053[_0x63d6('0x42')]['id']}})['then'](handleEntityNotFound(_0x47d727,null))['then'](removeEntity(_0x47d727,null))[_0x63d6('0x40')](handleError(_0x47d727,null));};exports['download']=function(_0x5a150d,_0x33c0d4,_0x5c8550){return db[_0x63d6('0x27')][_0x63d6('0x45')]({'where':{'id':_0x5a150d[_0x63d6('0x42')]['id']},'attributes':[_0x63d6('0x25'),'basename',_0x63d6('0x4e'),_0x63d6('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x33c0d4,null))[_0x63d6('0x23')](function(_0x17077c){if(_0x17077c){if(!fs[_0x63d6('0x50')](path[_0x63d6('0x51')](config[_0x63d6('0x52')],'server/files/reports',_0x17077c[_0x63d6('0x4e')]))){throw new db[(_0x63d6('0x53'))]['ValidationError'](_0x63d6('0x54'));}if(_0x5a150d[_0x63d6('0x2d')][_0x63d6('0x55')]){return _0x33c0d4[_0x63d6('0x13')](0xc8);}return _0x33c0d4[_0x63d6('0x56')](path[_0x63d6('0x51')](config[_0x63d6('0x52')],_0x63d6('0x57'),_0x17077c['savename']),util['format'](_0x63d6('0x58'),_0x17077c[_0x63d6('0x59')]||_0x17077c['name'],_0x17077c['output'][_0x63d6('0x5a')]()));}})[_0x63d6('0x40')](handleError(_0x33c0d4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6548da7..73189e0 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 _0x7eb9=['request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','util','moment'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x7eb9,0xd6));var _0x97eb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7eb9[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x97eb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x97eb('0x1'));var BPromise=require('bluebird');var rp=require(_0x97eb('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97eb('0x3'));var config=require(_0x97eb('0x4'));var attributes=require(_0x97eb('0x5'));module[_0x97eb('0x6')]=function(_0x4a7061,_0x27214a){return _0x4a7061['define'](_0x97eb('0x7'),attributes,{'tableName':_0x97eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4002=['bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x45160b,_0x3fa32d){var _0xaccdde=function(_0x508099){while(--_0x508099){_0x45160b['push'](_0x45160b['shift']());}};_0xaccdde(++_0x3fa32d);}(_0x4002,0xa3));var _0x2400=function(_0x37a75f,_0x213cbd){_0x37a75f=_0x37a75f-0x0;var _0x15b33b=_0x4002[_0x37a75f];return _0x15b33b;};'use strict';var _=require(_0x2400('0x0'));var util=require('util');var logger=require(_0x2400('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2400('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2400('0x3'));var rimraf=require(_0x2400('0x4'));var config=require(_0x2400('0x5'));var attributes=require(_0x2400('0x6'));module[_0x2400('0x7')]=function(_0x44c3af,_0x5377bd){return _0x44c3af[_0x2400('0x8')](_0x2400('0x9'),attributes,{'tableName':_0x2400('0xa'),'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 6eedded..dd052f7 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 _0x303e=['then','info','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x303e,0xf1));var _0xe303=function(_0x2be6ce,_0x12bb93){_0x2be6ce=_0x2be6ce-0x0;var _0x38e2a3=_0x303e[_0x2be6ce];return _0x38e2a3;};'use strict';var _=require(_0xe303('0x0'));var util=require('util');var moment=require(_0xe303('0x1'));var BPromise=require(_0xe303('0x2'));var rs=require(_0xe303('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe303('0x4'))['db'];var utils=require(_0xe303('0x5'));var logger=require(_0xe303('0x6'))(_0xe303('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe303('0x8')][_0xe303('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ff51,_0x5a7c5f,_0x38eb00){return new BPromise(function(_0x187fe5,_0x14e1af){return client[_0xe303('0xa')](_0x17ff51,_0x38eb00)[_0xe303('0xb')](function(_0x2a1d0b){logger[_0xe303('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5a7c5f,_0xe303('0xd'));logger[_0xe303('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5a7c5f,_0xe303('0xd'),JSON[_0xe303('0xf')](_0x2a1d0b));if(_0x2a1d0b[_0xe303('0x10')]){if(_0x2a1d0b[_0xe303('0x10')][_0xe303('0x11')]===0x1f4){logger[_0xe303('0x10')](_0xe303('0x12'),_0x5a7c5f,_0x2a1d0b['error'][_0xe303('0x13')]);return _0x14e1af(_0x2a1d0b[_0xe303('0x10')]['message']);}logger[_0xe303('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5a7c5f,_0x2a1d0b[_0xe303('0x10')][_0xe303('0x13')]);return _0x187fe5(_0x2a1d0b['error']['message']);}else{logger['info'](_0xe303('0x12'),_0x5a7c5f,'request\x20sent');_0x187fe5(_0x2a1d0b[_0xe303('0x14')][_0xe303('0x13')]);}})['catch'](function(_0x4b752b){logger[_0xe303('0x10')](_0xe303('0x12'),_0x5a7c5f,_0x4b752b);_0x14e1af(_0x4b752b);});});} \ No newline at end of file +var _0x7b1f=['request\x20sent','debug','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x540df2,_0x51bad5){var _0xf91f38=function(_0xe18d2){while(--_0xe18d2){_0x540df2['push'](_0x540df2['shift']());}};_0xf91f38(++_0x51bad5);}(_0x7b1f,0x13b));var _0xf7b1=function(_0x51a153,_0x21a8e5){_0x51a153=_0x51a153-0x0;var _0x1c501c=_0x7b1f[_0x51a153];return _0x1c501c;};'use strict';var _=require(_0xf7b1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf7b1('0x1'));var rs=require(_0xf7b1('0x2'));var fs=require('fs');var Redis=require(_0xf7b1('0x3'));var db=require(_0xf7b1('0x4'))['db'];var utils=require(_0xf7b1('0x5'));var logger=require(_0xf7b1('0x6'))(_0xf7b1('0x7'));var config=require(_0xf7b1('0x8'));var jayson=require(_0xf7b1('0x9'));var client=jayson[_0xf7b1('0xa')][_0xf7b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x470f53,_0x1e416e,_0x4a11b1){return new BPromise(function(_0x25ce80,_0x6ca5f7){return client['request'](_0x470f53,_0x4a11b1)[_0xf7b1('0xc')](function(_0x44bedb){logger[_0xf7b1('0xd')](_0xf7b1('0xe'),_0x1e416e,_0xf7b1('0xf'));logger[_0xf7b1('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1e416e,_0xf7b1('0xf'),JSON[_0xf7b1('0x11')](_0x44bedb));if(_0x44bedb[_0xf7b1('0x12')]){if(_0x44bedb[_0xf7b1('0x12')][_0xf7b1('0x13')]===0x1f4){logger[_0xf7b1('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e416e,_0x44bedb[_0xf7b1('0x12')][_0xf7b1('0x14')]);return _0x6ca5f7(_0x44bedb[_0xf7b1('0x12')][_0xf7b1('0x14')]);}logger[_0xf7b1('0x12')](_0xf7b1('0xe'),_0x1e416e,_0x44bedb[_0xf7b1('0x12')]['message']);return _0x25ce80(_0x44bedb[_0xf7b1('0x12')][_0xf7b1('0x14')]);}else{logger[_0xf7b1('0xd')](_0xf7b1('0xe'),_0x1e416e,_0xf7b1('0xf'));_0x25ce80(_0x44bedb[_0xf7b1('0x15')][_0xf7b1('0x14')]);}})['catch'](function(_0x3d82aa){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e416e,_0x3d82aa);_0x6ca5f7(_0x3d82aa);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6b86c26..b35d0b6 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 _0xc784=['get','isAuthenticated','index','/:id','show','download','create','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x755f84,_0x49ff2c){var _0x5ea6da=function(_0xfca07d){while(--_0xfca07d){_0x755f84['push'](_0x755f84['shift']());}};_0x5ea6da(++_0x49ff2c);}(_0xc784,0x91));var _0x4c78=function(_0x5c2abd,_0x410dad){_0x5c2abd=_0x5c2abd-0x0;var _0x6f8a96=_0xc784[_0x5c2abd];return _0x6f8a96;};'use strict';var multer=require(_0x4c78('0x0'));var util=require(_0x4c78('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c78('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4c78('0x3'));var interaction=require(_0x4c78('0x4'));var config=require(_0x4c78('0x5'));var controller=require(_0x4c78('0x6'));router[_0x4c78('0x7')]('/',auth[_0x4c78('0x8')](),controller[_0x4c78('0x9')]);router[_0x4c78('0x7')](_0x4c78('0xa'),auth[_0x4c78('0x8')](),controller[_0x4c78('0xb')]);router[_0x4c78('0x7')]('/:id/download',auth[_0x4c78('0x8')](),controller[_0x4c78('0xc')]);router['post']('/',auth[_0x4c78('0x8')](),controller[_0x4c78('0xd')]);router[_0x4c78('0xe')](_0x4c78('0xa'),auth['isAuthenticated'](),controller[_0x4c78('0xf')]);router[_0x4c78('0x10')]('/:id',auth[_0x4c78('0x8')](),controller[_0x4c78('0x11')]);module[_0x4c78('0x12')]=router; \ No newline at end of file +var _0x5701=['/:id','show','/:id/download','download','post','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x4fae39,_0x20183b){var _0x3b86d0=function(_0x436a03){while(--_0x436a03){_0x4fae39['push'](_0x4fae39['shift']());}};_0x3b86d0(++_0x20183b);}(_0x5701,0xef));var _0x1570=function(_0x232945,_0x2e979c){_0x232945=_0x232945-0x0;var _0x119e4b=_0x5701[_0x232945];return _0x119e4b;};'use strict';var multer=require('multer');var util=require(_0x1570('0x0'));var path=require(_0x1570('0x1'));var timeout=require(_0x1570('0x2'));var express=require(_0x1570('0x3'));var router=express[_0x1570('0x4')]();var fs_extra=require(_0x1570('0x5'));var auth=require(_0x1570('0x6'));var interaction=require(_0x1570('0x7'));var config=require(_0x1570('0x8'));var controller=require(_0x1570('0x9'));router[_0x1570('0xa')]('/',auth[_0x1570('0xb')](),controller[_0x1570('0xc')]);router[_0x1570('0xa')](_0x1570('0xd'),auth[_0x1570('0xb')](),controller[_0x1570('0xe')]);router[_0x1570('0xa')](_0x1570('0xf'),auth[_0x1570('0xb')](),controller[_0x1570('0x10')]);router[_0x1570('0x11')]('/',auth[_0x1570('0xb')](),controller['create']);router['put'](_0x1570('0xd'),auth[_0x1570('0xb')](),controller[_0x1570('0x12')]);router[_0x1570('0x13')](_0x1570('0xd'),auth['isAuthenticated'](),controller[_0x1570('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0f0d1f6..c81e314 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 _0x71e0=['exports','STRING','BOOLEAN'];(function(_0x279471,_0x23c0c6){var _0x8a2cd1=function(_0x9233d){while(--_0x9233d){_0x279471['push'](_0x279471['shift']());}};_0x8a2cd1(++_0x23c0c6);}(_0x71e0,0x1b9));var _0x071e=function(_0x4b7392,_0x26e8f1){_0x4b7392=_0x4b7392-0x0;var _0x224732=_0x71e0[_0x4b7392];return _0x224732;};'use strict';var Sequelize=require('sequelize');module[_0x071e('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x071e('0x1')]},'function':{'type':Sequelize[_0x071e('0x1')]},'format':{'type':Sequelize[_0x071e('0x1')]},'groupBy':{'type':Sequelize[_0x071e('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x071e('0x1')]},'custom':{'type':Sequelize[_0x071e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb885=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x37e851,_0x54e8cf){var _0x3ea786=function(_0x4a2294){while(--_0x4a2294){_0x37e851['push'](_0x37e851['shift']());}};_0x3ea786(++_0x54e8cf);}(_0xb885,0x1eb));var _0x5b88=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0xb885[_0x1a89a1];return _0x3d5b46;};'use strict';var Sequelize=require(_0x5b88('0x0'));module[_0x5b88('0x1')]={'field':{'type':Sequelize[_0x5b88('0x2')]},'alias':{'type':Sequelize[_0x5b88('0x3')]},'function':{'type':Sequelize[_0x5b88('0x3')]},'format':{'type':Sequelize[_0x5b88('0x3')]},'groupBy':{'type':Sequelize[_0x5b88('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5b88('0x3')]},'custom':{'type':Sequelize[_0x5b88('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 24ddc59..a0b7e18 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 _0x597a=['end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','error','name','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2497a2,_0x239c57){var _0x22c735=function(_0x2bd594){while(--_0x2bd594){_0x2497a2['push'](_0x2497a2['shift']());}};_0x22c735(++_0x239c57);}(_0x597a,0x180));var _0xa597=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x597a[_0x3e3bee];return _0x3ae14c;};'use strict';var emlformat=require(_0xa597('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa597('0x1'));var rp=require('request-promise');var moment=require(_0xa597('0x2'));var BPromise=require(_0xa597('0x3'));var Mustache=require(_0xa597('0x4'));var util=require(_0xa597('0x5'));var path=require(_0xa597('0x6'));var sox=require('sox');var csv=require(_0xa597('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa597('0x8'));var _=require(_0xa597('0x9'));var squel=require(_0xa597('0xa'));var crypto=require(_0xa597('0xb'));var jsforce=require(_0xa597('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa597('0x7'));var querystring=require(_0xa597('0xd'));var Papa=require(_0xa597('0xe'));var Redis=require('ioredis');var authService=require(_0xa597('0xf'));var qs=require(_0xa597('0x10'));var as=require(_0xa597('0x11'));var hardwareService=require(_0xa597('0x12'));var logger=require(_0xa597('0x13'))(_0xa597('0x14'));var utils=require(_0xa597('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa597('0x16'));var db=require(_0xa597('0x17'))['db'];function respondWithStatusCode(_0x4679ad,_0x1829ce){_0x1829ce=_0x1829ce||0xcc;return function(_0x3b0923){if(_0x3b0923){return _0x4679ad[_0xa597('0x18')](_0x1829ce);}return _0x4679ad[_0xa597('0x19')](_0x1829ce)[_0xa597('0x1a')]();};}function respondWithResult(_0x35c8f0,_0x59a7b9){_0x59a7b9=_0x59a7b9||0xc8;return function(_0x30da4b){if(_0x30da4b){return _0x35c8f0[_0xa597('0x19')](_0x59a7b9)['json'](_0x30da4b);}};}function respondWithFilteredResult(_0x265363,_0x11c212){return function(_0x124c6f){if(_0x124c6f){var _0x2de3dd=typeof _0x11c212['offset']==='undefined'&&typeof _0x11c212[_0xa597('0x1b')]===_0xa597('0x1c');var _0x5a9760=_0x124c6f[_0xa597('0x1d')];var _0x190b2e=_0x2de3dd?0x0:_0x11c212['offset'];var _0x3c808b=_0x2de3dd?_0x124c6f[_0xa597('0x1d')]:_0x11c212[_0xa597('0x1e')]+_0x11c212[_0xa597('0x1b')];var _0x16131f;if(_0x3c808b>=_0x5a9760){_0x3c808b=_0x5a9760;_0x16131f=0xc8;}else{_0x16131f=0xce;}_0x265363[_0xa597('0x19')](_0x16131f);return _0x265363[_0xa597('0x1f')](_0xa597('0x20'),_0x190b2e+'-'+_0x3c808b+'/'+_0x5a9760)[_0xa597('0x21')](_0x124c6f);}return null;};}function patchUpdates(_0x150e9d){return function(_0x31d76a){try{jsonpatch[_0xa597('0x22')](_0x31d76a,_0x150e9d,!![]);}catch(_0x42d66f){return BPromise[_0xa597('0x23')](_0x42d66f);}return _0x31d76a[_0xa597('0x24')]();};}function saveUpdates(_0x19d375,_0x2ce05b){return function(_0x44626a){if(_0x44626a){return _0x44626a[_0xa597('0x25')](_0x19d375)['then'](function(_0x107e50){return _0x107e50;});}return null;};}function removeEntity(_0x5a47bf,_0x320f5e){return function(_0x30c61f){if(_0x30c61f){return _0x30c61f['destroy']()['then'](function(){_0x5a47bf[_0xa597('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f20ba,_0x49b3e7){return function(_0x1fa773){if(!_0x1fa773){_0x3f20ba['sendStatus'](0x194);}return _0x1fa773;};}function handleError(_0x13754c,_0x45a752){_0x45a752=_0x45a752||0x1f4;return function(_0x11c745){logger[_0xa597('0x26')](_0x11c745['stack']);if(_0x11c745[_0xa597('0x27')]){delete _0x11c745[_0xa597('0x27')];}_0x13754c[_0xa597('0x19')](_0x45a752)['send'](_0x11c745);};}exports[_0xa597('0x28')]=function(_0x16c021,_0x569847){var _0x1bf4d9={},_0x12f624={},_0x4c690c={'count':0x0,'rows':[]};var _0x34aff7=_[_0xa597('0x29')](db[_0xa597('0x2a')][_0xa597('0x2b')],function(_0x1c0f0f){return{'name':_0x1c0f0f['fieldName'],'type':_0x1c0f0f[_0xa597('0x2c')][_0xa597('0x2d')]};});_0x12f624[_0xa597('0x2e')]=_[_0xa597('0x29')](_0x34aff7,_0xa597('0x27'));_0x12f624[_0xa597('0x2f')]=_[_0xa597('0x30')](_0x16c021['query']);_0x12f624[_0xa597('0x31')]=_[_0xa597('0x32')](_0x12f624[_0xa597('0x2e')],_0x12f624[_0xa597('0x2f')]);_0x1bf4d9['attributes']=_[_0xa597('0x32')](_0x12f624[_0xa597('0x2e')],qs[_0xa597('0x33')](_0x16c021[_0xa597('0x2f')][_0xa597('0x33')]));_0x1bf4d9[_0xa597('0x34')]=_0x1bf4d9[_0xa597('0x34')][_0xa597('0x35')]?_0x1bf4d9[_0xa597('0x34')]:_0x12f624[_0xa597('0x2e')];if(!_0x16c021['query'][_0xa597('0x36')]('nolimit')){_0x1bf4d9[_0xa597('0x1b')]=qs[_0xa597('0x1b')](_0x16c021['query'][_0xa597('0x1b')]);_0x1bf4d9[_0xa597('0x1e')]=qs[_0xa597('0x1e')](_0x16c021[_0xa597('0x2f')][_0xa597('0x1e')]);}_0x1bf4d9['order']=qs[_0xa597('0x37')](_0x16c021['query'][_0xa597('0x37')]);_0x1bf4d9[_0xa597('0x38')]=qs['filters'](_[_0xa597('0x39')](_0x16c021['query'],_0x12f624[_0xa597('0x31')]),_0x34aff7);if(_0x16c021[_0xa597('0x2f')][_0xa597('0x3a')]){_0x1bf4d9[_0xa597('0x38')]=_['merge'](_0x1bf4d9[_0xa597('0x38')],{'$or':_[_0xa597('0x29')](_0x34aff7,function(_0x1fd630){if(_0x1fd630[_0xa597('0x2c')]!==_0xa597('0x3b')){var _0x14a32e={};_0x14a32e[_0x1fd630[_0xa597('0x27')]]={'$like':'%'+_0x16c021['query'][_0xa597('0x3a')]+'%'};return _0x14a32e;}})});}_0x1bf4d9=_[_0xa597('0x3c')]({},_0x1bf4d9,_0x16c021[_0xa597('0x3d')]);var _0x7612d6={'where':_0x1bf4d9[_0xa597('0x38')]};return db['AnalyticFieldReport'][_0xa597('0x1d')](_0x7612d6)[_0xa597('0x3e')](function(_0x39a9cd){_0x4c690c[_0xa597('0x1d')]=_0x39a9cd;if(_0x16c021[_0xa597('0x2f')][_0xa597('0x3f')]){_0x1bf4d9[_0xa597('0x40')]=[{'all':!![]}];}return db[_0xa597('0x2a')][_0xa597('0x41')](_0x1bf4d9);})['then'](function(_0x12a494){_0x4c690c[_0xa597('0x42')]=_0x12a494;return _0x4c690c;})[_0xa597('0x3e')](respondWithFilteredResult(_0x569847,_0x1bf4d9))[_0xa597('0x43')](handleError(_0x569847,null));};exports[_0xa597('0x44')]=function(_0x257a9a,_0x181134){var _0x52a5aa={'raw':![],'where':{'id':_0x257a9a[_0xa597('0x45')]['id']}},_0x4aeed0={};_0x4aeed0[_0xa597('0x2e')]=_[_0xa597('0x30')](db[_0xa597('0x2a')][_0xa597('0x2b')]);_0x4aeed0[_0xa597('0x2f')]=_['keys'](_0x257a9a[_0xa597('0x2f')]);_0x4aeed0[_0xa597('0x31')]=_[_0xa597('0x32')](_0x4aeed0['model'],_0x4aeed0[_0xa597('0x2f')]);_0x52a5aa[_0xa597('0x34')]=_[_0xa597('0x32')](_0x4aeed0[_0xa597('0x2e')],qs[_0xa597('0x33')](_0x257a9a[_0xa597('0x2f')][_0xa597('0x33')]));_0x52a5aa['attributes']=_0x52a5aa[_0xa597('0x34')][_0xa597('0x35')]?_0x52a5aa[_0xa597('0x34')]:_0x4aeed0['model'];if(_0x257a9a[_0xa597('0x2f')][_0xa597('0x3f')]){_0x52a5aa[_0xa597('0x40')]=[{'all':!![]}];}_0x52a5aa=_[_0xa597('0x3c')]({},_0x52a5aa,_0x257a9a[_0xa597('0x3d')]);return db[_0xa597('0x2a')][_0xa597('0x46')](_0x52a5aa)[_0xa597('0x3e')](handleEntityNotFound(_0x181134,null))[_0xa597('0x3e')](respondWithResult(_0x181134,null))[_0xa597('0x43')](handleError(_0x181134,null));};exports['create']=function(_0x5078db,_0x243c3b){return db[_0xa597('0x2a')][_0xa597('0x47')](_0x5078db[_0xa597('0x48')],{})[_0xa597('0x3e')](respondWithResult(_0x243c3b,0xc9))[_0xa597('0x43')](handleError(_0x243c3b,null));};exports[_0xa597('0x49')]=function(_0x32eef7,_0x4eba5d){return db[_0xa597('0x2a')][_0xa597('0x49')](_0x32eef7[_0xa597('0x48')],{'raw':![],'individualHooks':!![]})[_0xa597('0x3e')](respondWithResult(_0x4eba5d,0xc9))['catch'](handleError(_0x4eba5d,null));};exports['update']=function(_0x234b28,_0x460f50){if(_0x234b28[_0xa597('0x48')]['id']){delete _0x234b28[_0xa597('0x48')]['id'];}return db[_0xa597('0x2a')][_0xa597('0x46')]({'where':{'id':_0x234b28['params']['id']}})[_0xa597('0x3e')](handleEntityNotFound(_0x460f50,null))[_0xa597('0x3e')](saveUpdates(_0x234b28[_0xa597('0x48')],null))[_0xa597('0x3e')](respondWithResult(_0x460f50,null))[_0xa597('0x43')](handleError(_0x460f50,null));};exports[_0xa597('0x4a')]=function(_0x5d508e,_0x3c74b7){return db[_0xa597('0x2a')][_0xa597('0x46')]({'where':{'id':_0x5d508e[_0xa597('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c74b7,null))[_0xa597('0x3e')](removeEntity(_0x3c74b7,null))[_0xa597('0x43')](handleError(_0x3c74b7,null));};exports[_0xa597('0x4b')]=function(_0x386023,_0x1cda45){return db['AnalyticFieldReport'][_0xa597('0x4a')]({'where':{'id':_0x386023[_0xa597('0x2f')][_0xa597('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xa597('0x3e')](respondWithResult(_0x1cda45,0xcc))[_0xa597('0x43')](handleError(_0x1cda45,null));};exports[_0xa597('0x4d')]=function(_0x5dd93a,_0x2c545a,_0x9e7667){return db[_0xa597('0x4e')][_0xa597('0x4f')]({'where':{'id':_0x5dd93a['params']['id']}})[_0xa597('0x3e')](handleEntityNotFound(_0x2c545a,null))[_0xa597('0x3e')](function(_0x1d8164){if(_0x1d8164){return db['sequelize'][_0xa597('0x50')](function(_0x2e81fb){return db[_0xa597('0x2a')][_0xa597('0x4a')]({'where':{'CustomReportId':_0x5dd93a[_0xa597('0x45')]['id']},'transaction':_0x2e81fb})[_0xa597('0x3e')](function(_0x1755f2){var _0x3f4180=_['map'](_0x5dd93a[_0xa597('0x48')],function(_0x17c3e8){delete _0x17c3e8['id'];_0x17c3e8[_0xa597('0x51')]=_0x5dd93a[_0xa597('0x45')]['id'];return _0x17c3e8;});return db[_0xa597('0x2a')]['bulkCreate'](_0x3f4180,{'transaction':_0x2e81fb});});})[_0xa597('0x3e')](function(){return db[_0xa597('0x2a')][_0xa597('0x41')]({'where':{'CustomReportId':_0x5dd93a[_0xa597('0x45')]['id']}});});}})[_0xa597('0x3e')](respondWithResult(_0x2c545a,null))['catch'](handleError(_0x2c545a,null));}; \ No newline at end of file +var _0x414d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0x414d,0x8c));var _0xd414=function(_0xc0213d,_0x4a3b1d){_0xc0213d=_0xc0213d-0x0;var _0x1a93c4=_0x414d[_0xc0213d];return _0x1a93c4;};'use strict';var emlformat=require(_0xd414('0x0'));var rimraf=require(_0xd414('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd414('0x2'));var rp=require(_0xd414('0x3'));var moment=require('moment');var BPromise=require(_0xd414('0x4'));var Mustache=require(_0xd414('0x5'));var util=require(_0xd414('0x6'));var path=require(_0xd414('0x7'));var sox=require('sox');var csv=require(_0xd414('0x8'));var ejs=require(_0xd414('0x9'));var fs=require('fs');var fs_extra=require(_0xd414('0xa'));var _=require(_0xd414('0xb'));var squel=require(_0xd414('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd414('0xd'));var toCsv=require(_0xd414('0x8'));var querystring=require(_0xd414('0xe'));var Papa=require('papaparse');var Redis=require(_0xd414('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd414('0x10'));var as=require(_0xd414('0x11'));var hardwareService=require(_0xd414('0x12'));var logger=require(_0xd414('0x13'))(_0xd414('0x14'));var utils=require(_0xd414('0x15'));var config=require(_0xd414('0x16'));var licenseUtil=require(_0xd414('0x17'));var db=require(_0xd414('0x18'))['db'];function respondWithStatusCode(_0x2b96d0,_0x585370){_0x585370=_0x585370||0xcc;return function(_0x2e8e4d){if(_0x2e8e4d){return _0x2b96d0['sendStatus'](_0x585370);}return _0x2b96d0['status'](_0x585370)[_0xd414('0x19')]();};}function respondWithResult(_0x480fa4,_0x283a8a){_0x283a8a=_0x283a8a||0xc8;return function(_0x3b63f5){if(_0x3b63f5){return _0x480fa4[_0xd414('0x1a')](_0x283a8a)['json'](_0x3b63f5);}};}function respondWithFilteredResult(_0x273f84,_0x4bdfdf){return function(_0x329d40){if(_0x329d40){var _0xcc7876=typeof _0x4bdfdf[_0xd414('0x1b')]===_0xd414('0x1c')&&typeof _0x4bdfdf[_0xd414('0x1d')]==='undefined';var _0x55ca21=_0x329d40['count'];var _0x4d2362=_0xcc7876?0x0:_0x4bdfdf[_0xd414('0x1b')];var _0x3899cb=_0xcc7876?_0x329d40[_0xd414('0x1e')]:_0x4bdfdf['offset']+_0x4bdfdf[_0xd414('0x1d')];var _0xd45505;if(_0x3899cb>=_0x55ca21){_0x3899cb=_0x55ca21;_0xd45505=0xc8;}else{_0xd45505=0xce;}_0x273f84[_0xd414('0x1a')](_0xd45505);return _0x273f84[_0xd414('0x1f')]('Content-Range',_0x4d2362+'-'+_0x3899cb+'/'+_0x55ca21)['json'](_0x329d40);}return null;};}function patchUpdates(_0x9c05a2){return function(_0x3aa2d4){try{jsonpatch['apply'](_0x3aa2d4,_0x9c05a2,!![]);}catch(_0x3a3cad){return BPromise[_0xd414('0x20')](_0x3a3cad);}return _0x3aa2d4[_0xd414('0x21')]();};}function saveUpdates(_0x3deb38,_0x28c241){return function(_0xa6a7d){if(_0xa6a7d){return _0xa6a7d[_0xd414('0x22')](_0x3deb38)[_0xd414('0x23')](function(_0x38afdc){return _0x38afdc;});}return null;};}function removeEntity(_0xaefab8,_0x43eadc){return function(_0xe9ef){if(_0xe9ef){return _0xe9ef[_0xd414('0x24')]()[_0xd414('0x23')](function(){_0xaefab8[_0xd414('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4936f8,_0x25b32a){return function(_0x2f144d){if(!_0x2f144d){_0x4936f8[_0xd414('0x25')](0x194);}return _0x2f144d;};}function handleError(_0x555e91,_0x1cb347){_0x1cb347=_0x1cb347||0x1f4;return function(_0x396db0){logger[_0xd414('0x26')](_0x396db0['stack']);if(_0x396db0[_0xd414('0x27')]){delete _0x396db0['name'];}_0x555e91[_0xd414('0x1a')](_0x1cb347)[_0xd414('0x28')](_0x396db0);};}exports[_0xd414('0x29')]=function(_0x576e65,_0x2f394e){var _0x1a2ada={},_0x598f81={},_0x2f526e={'count':0x0,'rows':[]};var _0xe89a31=_[_0xd414('0x2a')](db[_0xd414('0x2b')][_0xd414('0x2c')],function(_0x83f8fe){return{'name':_0x83f8fe[_0xd414('0x2d')],'type':_0x83f8fe[_0xd414('0x2e')]['key']};});_0x598f81[_0xd414('0x2f')]=_[_0xd414('0x2a')](_0xe89a31,_0xd414('0x27'));_0x598f81[_0xd414('0x30')]=_[_0xd414('0x31')](_0x576e65[_0xd414('0x30')]);_0x598f81['filters']=_[_0xd414('0x32')](_0x598f81['model'],_0x598f81[_0xd414('0x30')]);_0x1a2ada[_0xd414('0x33')]=_[_0xd414('0x32')](_0x598f81[_0xd414('0x2f')],qs[_0xd414('0x34')](_0x576e65['query']['fields']));_0x1a2ada['attributes']=_0x1a2ada[_0xd414('0x33')][_0xd414('0x35')]?_0x1a2ada[_0xd414('0x33')]:_0x598f81[_0xd414('0x2f')];if(!_0x576e65['query']['hasOwnProperty'](_0xd414('0x36'))){_0x1a2ada[_0xd414('0x1d')]=qs['limit'](_0x576e65['query']['limit']);_0x1a2ada['offset']=qs['offset'](_0x576e65[_0xd414('0x30')][_0xd414('0x1b')]);}_0x1a2ada[_0xd414('0x37')]=qs['sort'](_0x576e65['query']['sort']);_0x1a2ada[_0xd414('0x38')]=qs[_0xd414('0x39')](_[_0xd414('0x3a')](_0x576e65[_0xd414('0x30')],_0x598f81['filters']),_0xe89a31);if(_0x576e65[_0xd414('0x30')][_0xd414('0x3b')]){_0x1a2ada[_0xd414('0x38')]=_['merge'](_0x1a2ada[_0xd414('0x38')],{'$or':_[_0xd414('0x2a')](_0xe89a31,function(_0x16bc53){if(_0x16bc53[_0xd414('0x2e')]!==_0xd414('0x3c')){var _0x30d966={};_0x30d966[_0x16bc53[_0xd414('0x27')]]={'$like':'%'+_0x576e65['query'][_0xd414('0x3b')]+'%'};return _0x30d966;}})});}_0x1a2ada=_[_0xd414('0x3d')]({},_0x1a2ada,_0x576e65['options']);var _0x3f4b84={'where':_0x1a2ada[_0xd414('0x38')]};return db[_0xd414('0x2b')][_0xd414('0x1e')](_0x3f4b84)['then'](function(_0x36f998){_0x2f526e['count']=_0x36f998;if(_0x576e65[_0xd414('0x30')][_0xd414('0x3e')]){_0x1a2ada[_0xd414('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x1a2ada);})[_0xd414('0x23')](function(_0x368c57){_0x2f526e[_0xd414('0x40')]=_0x368c57;return _0x2f526e;})[_0xd414('0x23')](respondWithFilteredResult(_0x2f394e,_0x1a2ada))[_0xd414('0x41')](handleError(_0x2f394e,null));};exports[_0xd414('0x42')]=function(_0x5db4d0,_0x444099){var _0x534bae={'raw':![],'where':{'id':_0x5db4d0[_0xd414('0x43')]['id']}},_0x4cd2d6={};_0x4cd2d6[_0xd414('0x2f')]=_['keys'](db[_0xd414('0x2b')][_0xd414('0x2c')]);_0x4cd2d6[_0xd414('0x30')]=_[_0xd414('0x31')](_0x5db4d0[_0xd414('0x30')]);_0x4cd2d6[_0xd414('0x39')]=_[_0xd414('0x32')](_0x4cd2d6[_0xd414('0x2f')],_0x4cd2d6[_0xd414('0x30')]);_0x534bae[_0xd414('0x33')]=_[_0xd414('0x32')](_0x4cd2d6['model'],qs[_0xd414('0x34')](_0x5db4d0[_0xd414('0x30')]['fields']));_0x534bae[_0xd414('0x33')]=_0x534bae[_0xd414('0x33')][_0xd414('0x35')]?_0x534bae['attributes']:_0x4cd2d6[_0xd414('0x2f')];if(_0x5db4d0[_0xd414('0x30')]['includeAll']){_0x534bae[_0xd414('0x3f')]=[{'all':!![]}];}_0x534bae=_[_0xd414('0x3d')]({},_0x534bae,_0x5db4d0['options']);return db[_0xd414('0x2b')][_0xd414('0x44')](_0x534bae)[_0xd414('0x23')](handleEntityNotFound(_0x444099,null))[_0xd414('0x23')](respondWithResult(_0x444099,null))[_0xd414('0x41')](handleError(_0x444099,null));};exports[_0xd414('0x45')]=function(_0x396ce8,_0x17daf4){return db[_0xd414('0x2b')]['create'](_0x396ce8[_0xd414('0x46')],{})[_0xd414('0x23')](respondWithResult(_0x17daf4,0xc9))['catch'](handleError(_0x17daf4,null));};exports['bulkCreate']=function(_0x104ed1,_0x13b4c3){return db['AnalyticFieldReport'][_0xd414('0x47')](_0x104ed1['body'],{'raw':![],'individualHooks':!![]})[_0xd414('0x23')](respondWithResult(_0x13b4c3,0xc9))[_0xd414('0x41')](handleError(_0x13b4c3,null));};exports['update']=function(_0x3aec6c,_0x21931c){if(_0x3aec6c[_0xd414('0x46')]['id']){delete _0x3aec6c['body']['id'];}return db[_0xd414('0x2b')]['find']({'where':{'id':_0x3aec6c[_0xd414('0x43')]['id']}})[_0xd414('0x23')](handleEntityNotFound(_0x21931c,null))[_0xd414('0x23')](saveUpdates(_0x3aec6c[_0xd414('0x46')],null))['then'](respondWithResult(_0x21931c,null))[_0xd414('0x41')](handleError(_0x21931c,null));};exports[_0xd414('0x24')]=function(_0x59c622,_0x30a97f){return db[_0xd414('0x2b')][_0xd414('0x44')]({'where':{'id':_0x59c622[_0xd414('0x43')]['id']}})['then'](handleEntityNotFound(_0x30a97f,null))[_0xd414('0x23')](removeEntity(_0x30a97f,null))[_0xd414('0x41')](handleError(_0x30a97f,null));};exports[_0xd414('0x48')]=function(_0x54b9b5,_0x4829f7){return db[_0xd414('0x2b')]['destroy']({'where':{'id':_0x54b9b5['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xd414('0x23')](respondWithResult(_0x4829f7,0xcc))[_0xd414('0x41')](handleError(_0x4829f7,null));};exports[_0xd414('0x49')]=function(_0x5d6738,_0x1e640c,_0x3e9991){return db[_0xd414('0x4a')][_0xd414('0x4b')]({'where':{'id':_0x5d6738[_0xd414('0x43')]['id']}})[_0xd414('0x23')](handleEntityNotFound(_0x1e640c,null))['then'](function(_0x4da4ec){if(_0x4da4ec){return db[_0xd414('0x4c')][_0xd414('0x4d')](function(_0x5a431b){return db['AnalyticFieldReport'][_0xd414('0x24')]({'where':{'CustomReportId':_0x5d6738[_0xd414('0x43')]['id']},'transaction':_0x5a431b})[_0xd414('0x23')](function(_0x393ddf){var _0xebdce2=_[_0xd414('0x2a')](_0x5d6738['body'],function(_0x32adf3){delete _0x32adf3['id'];_0x32adf3[_0xd414('0x4e')]=_0x5d6738[_0xd414('0x43')]['id'];return _0x32adf3;});return db['AnalyticFieldReport'][_0xd414('0x47')](_0xebdce2,{'transaction':_0x5a431b});});})[_0xd414('0x23')](function(){return db[_0xd414('0x2b')]['findAll']({'where':{'CustomReportId':_0x5d6738[_0xd414('0x43')]['id']}});});}})[_0xd414('0x23')](respondWithResult(_0x1e640c,null))[_0xd414('0x41')](handleError(_0x1e640c,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 5c45c5a..7f37dfc 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 _0x5892=['request-promise','path','rimraf','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f167e,_0x38473d){var _0x30ba5f=function(_0x348744){while(--_0x348744){_0x2f167e['push'](_0x2f167e['shift']());}};_0x30ba5f(++_0x38473d);}(_0x5892,0x102));var _0x2589=function(_0x33fda1,_0x3acc1d){_0x33fda1=_0x33fda1-0x0;var _0x5a0017=_0x5892[_0x33fda1];return _0x5a0017;};'use strict';var _=require(_0x2589('0x0'));var util=require(_0x2589('0x1'));var logger=require(_0x2589('0x2'))(_0x2589('0x3'));var moment=require(_0x2589('0x4'));var BPromise=require(_0x2589('0x5'));var rp=require(_0x2589('0x6'));var fs=require('fs');var path=require(_0x2589('0x7'));var rimraf=require(_0x2589('0x8'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x2589('0x9')]=function(_0x3954d6,_0x23abd5){return _0x3954d6[_0x2589('0xa')](_0x2589('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45e8=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x45e8,0x1ef));var _0x845e=function(_0x5b5c66,_0x232916){_0x5b5c66=_0x5b5c66-0x0;var _0x19c519=_0x45e8[_0x5b5c66];return _0x19c519;};'use strict';var _=require(_0x845e('0x0'));var util=require(_0x845e('0x1'));var logger=require('../../config/logger')(_0x845e('0x2'));var moment=require(_0x845e('0x3'));var BPromise=require(_0x845e('0x4'));var rp=require(_0x845e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x845e('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x845e('0x7')]=function(_0x14f7c0,_0x5b8f99){return _0x14f7c0[_0x845e('0x8')](_0x845e('0x9'),attributes,{'tableName':_0x845e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 4e77fb2..aadb0d5 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 _0x864d=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x864d,0x13d));var _0xd864=function(_0x3961ee,_0x4f7e4f){_0x3961ee=_0x3961ee-0x0;var _0x22adcb=_0x864d[_0x3961ee];return _0x22adcb;};'use strict';var _=require(_0xd864('0x0'));var util=require(_0xd864('0x1'));var moment=require(_0xd864('0x2'));var BPromise=require('bluebird');var rs=require(_0xd864('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd864('0x4'))['db'];var utils=require(_0xd864('0x5'));var logger=require('../../config/logger')(_0xd864('0x6'));var config=require('../../config/environment');var jayson=require(_0xd864('0x7'));var client=jayson[_0xd864('0x8')][_0xd864('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d84d8,_0x446c95,_0x269273){return new BPromise(function(_0x39b3c1,_0x21326d){return client[_0xd864('0xa')](_0x4d84d8,_0x269273)['then'](function(_0xab7f8b){logger[_0xd864('0xb')](_0xd864('0xc'),_0x446c95,_0xd864('0xd'));logger['debug'](_0xd864('0xe'),_0x446c95,_0xd864('0xd'),JSON[_0xd864('0xf')](_0xab7f8b));if(_0xab7f8b[_0xd864('0x10')]){if(_0xab7f8b['error'][_0xd864('0x11')]===0x1f4){logger['error'](_0xd864('0xc'),_0x446c95,_0xab7f8b[_0xd864('0x10')][_0xd864('0x12')]);return _0x21326d(_0xab7f8b[_0xd864('0x10')][_0xd864('0x12')]);}logger[_0xd864('0x10')](_0xd864('0xc'),_0x446c95,_0xab7f8b[_0xd864('0x10')]['message']);return _0x39b3c1(_0xab7f8b[_0xd864('0x10')][_0xd864('0x12')]);}else{logger[_0xd864('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x446c95,_0xd864('0xd'));_0x39b3c1(_0xab7f8b[_0xd864('0x13')][_0xd864('0x12')]);}})[_0xd864('0x14')](function(_0x4df627){logger[_0xd864('0x10')](_0xd864('0xc'),_0x446c95,_0x4df627);_0x21326d(_0x4df627);});});} \ No newline at end of file +var _0x1339=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x1019b8,_0x10dce5){var _0x2a2dd9=function(_0x224d44){while(--_0x224d44){_0x1019b8['push'](_0x1019b8['shift']());}};_0x2a2dd9(++_0x10dce5);}(_0x1339,0x145));var _0x9133=function(_0x2048f7,_0x2c6015){_0x2048f7=_0x2048f7-0x0;var _0x1f36dd=_0x1339[_0x2048f7];return _0x1f36dd;};'use strict';var _=require(_0x9133('0x0'));var util=require(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9133('0x4'));var logger=require(_0x9133('0x5'))(_0x9133('0x6'));var config=require(_0x9133('0x7'));var jayson=require(_0x9133('0x8'));var client=jayson['client'][_0x9133('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32f4f8,_0x4363be,_0x59f9a8){return new BPromise(function(_0x4f7bf8,_0x888418){return client['request'](_0x32f4f8,_0x59f9a8)['then'](function(_0x1f6727){logger[_0x9133('0xa')](_0x9133('0xb'),_0x4363be,_0x9133('0xc'));logger[_0x9133('0xd')](_0x9133('0xe'),_0x4363be,'request\x20sent',JSON[_0x9133('0xf')](_0x1f6727));if(_0x1f6727[_0x9133('0x10')]){if(_0x1f6727[_0x9133('0x10')][_0x9133('0x11')]===0x1f4){logger[_0x9133('0x10')](_0x9133('0xb'),_0x4363be,_0x1f6727['error'][_0x9133('0x12')]);return _0x888418(_0x1f6727[_0x9133('0x10')][_0x9133('0x12')]);}logger[_0x9133('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4363be,_0x1f6727[_0x9133('0x10')]['message']);return _0x4f7bf8(_0x1f6727[_0x9133('0x10')][_0x9133('0x12')]);}else{logger[_0x9133('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4363be,'request\x20sent');_0x4f7bf8(_0x1f6727[_0x9133('0x13')][_0x9133('0x12')]);}})['catch'](function(_0x2a0afa){logger['error'](_0x9133('0xb'),_0x4363be,_0x2a0afa);_0x888418(_0x2a0afa);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 2a9f6b1..2d2454a 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(_0x192ca0,_0x37c7d2){var _0x232bbb=function(_0x2e1d78){while(--_0x2e1d78){_0x192ca0['push'](_0x192ca0['shift']());}};_0x232bbb(++_0x37c7d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x1d8024,_0x572013){var _0x564562=function(_0x106eda){while(--_0x106eda){_0x1d8024['push'](_0x1d8024['shift']());}};_0x564562(++_0x572013);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 cdd21e2..d30aa62 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 _0xb16f=['STRING','TEXT','sequelize','exports'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xb16f,0xf6));var _0xfb16=function(_0x218756,_0x419c39){_0x218756=_0x218756-0x0;var _0x1b90ec=_0xb16f[_0x218756];return _0x1b90ec;};'use strict';var Sequelize=require(_0xfb16('0x0'));module[_0xfb16('0x1')]={'name':{'type':Sequelize[_0xfb16('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xfb16('0x2')]},'metric':{'type':Sequelize[_0xfb16('0x3')]},'description':{'type':Sequelize[_0xfb16('0x2')]}}; \ No newline at end of file +var _0x9649=['sequelize','exports','name','STRING','TEXT'];(function(_0x355dcb,_0x5756db){var _0x12f4cb=function(_0x5bbc7f){while(--_0x5bbc7f){_0x355dcb['push'](_0x355dcb['shift']());}};_0x12f4cb(++_0x5756db);}(_0x9649,0x118));var _0x9964=function(_0x5312f2,_0x3e2ae0){_0x5312f2=_0x5312f2-0x0;var _0x491ace=_0x9649[_0x5312f2];return _0x491ace;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9964('0x2')},'table':{'type':Sequelize[_0x9964('0x3')]},'metric':{'type':Sequelize[_0x9964('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 638027c..60f33e2 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 _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file +var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1255cd,_0x22b9b7){var _0x292878=function(_0x39a79a){while(--_0x39a79a){_0x1255cd['push'](_0x1255cd['shift']());}};_0x292878(++_0x22b9b7);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x375ceb,_0x44615b){_0x375ceb=_0x375ceb-0x0;var _0x454640=_0xdbf5[_0x375ceb];return _0x454640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 45af671..decfd4e 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 _0x5d59=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x53dd36,_0x1fd095){var _0x46ef3d=function(_0x326a77){while(--_0x326a77){_0x53dd36['push'](_0x53dd36['shift']());}};_0x46ef3d(++_0x1fd095);}(_0x5d59,0x15f));var _0x95d5=function(_0x5b05de,_0x441400){_0x5b05de=_0x5b05de-0x0;var _0x1dbd07=_0x5d59[_0x5b05de];return _0x1dbd07;};'use strict';var _=require('lodash');var util=require(_0x95d5('0x0'));var logger=require(_0x95d5('0x1'))(_0x95d5('0x2'));var moment=require(_0x95d5('0x3'));var BPromise=require(_0x95d5('0x4'));var rp=require(_0x95d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95d5('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x95d5('0x7')]=function(_0x4a733e,_0x4b4e5f){return _0x4a733e[_0x95d5('0x8')](_0x95d5('0x9'),attributes,{'tableName':_0x95d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe451=['../../config/environment','exports','AnalyticMetric','analytics_metrics','../../config/logger','request-promise','path','rimraf'];(function(_0x2f1214,_0x45afd5){var _0x2d7c0c=function(_0x1fb813){while(--_0x1fb813){_0x2f1214['push'](_0x2f1214['shift']());}};_0x2d7c0c(++_0x45afd5);}(_0xe451,0xec));var _0x1e45=function(_0x16a6ce,_0x5750fd){_0x16a6ce=_0x16a6ce-0x0;var _0x4e3af7=_0xe451[_0x16a6ce];return _0x4e3af7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e45('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e45('0x1'));var fs=require('fs');var path=require(_0x1e45('0x2'));var rimraf=require(_0x1e45('0x3'));var config=require(_0x1e45('0x4'));var attributes=require('./analyticMetric.attributes');module[_0x1e45('0x5')]=function(_0x1a163c,_0x115f88){return _0x1a163c['define'](_0x1e45('0x6'),attributes,{'tableName':_0x1e45('0x7'),'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 63bb4ba..bbaaca7 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 _0x3768=['jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x790426,_0x362d54){var _0x5c3336=function(_0x8bb994){while(--_0x8bb994){_0x790426['push'](_0x790426['shift']());}};_0x5c3336(++_0x362d54);}(_0x3768,0xdd));var _0x8376=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x3768[_0x4f34d8];return _0xc97536;};'use strict';var _=require(_0x8376('0x0'));var util=require(_0x8376('0x1'));var moment=require(_0x8376('0x2'));var BPromise=require('bluebird');var rs=require(_0x8376('0x3'));var fs=require('fs');var Redis=require(_0x8376('0x4'));var db=require(_0x8376('0x5'))['db'];var utils=require(_0x8376('0x6'));var logger=require(_0x8376('0x7'))(_0x8376('0x8'));var config=require('../../config/environment');var jayson=require(_0x8376('0x9'));var client=jayson[_0x8376('0xa')][_0x8376('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e3e2d,_0x2f21df,_0x20e136){return new BPromise(function(_0x24e845,_0x1d9ea2){return client['request'](_0x4e3e2d,_0x20e136)['then'](function(_0x542472){logger[_0x8376('0xc')](_0x8376('0xd'),_0x2f21df,'request\x20sent');logger[_0x8376('0xe')](_0x8376('0xf'),_0x2f21df,_0x8376('0x10'),JSON[_0x8376('0x11')](_0x542472));if(_0x542472[_0x8376('0x12')]){if(_0x542472[_0x8376('0x12')][_0x8376('0x13')]===0x1f4){logger['error'](_0x8376('0xd'),_0x2f21df,_0x542472[_0x8376('0x12')]['message']);return _0x1d9ea2(_0x542472[_0x8376('0x12')]['message']);}logger[_0x8376('0x12')](_0x8376('0xd'),_0x2f21df,_0x542472[_0x8376('0x12')][_0x8376('0x14')]);return _0x24e845(_0x542472[_0x8376('0x12')][_0x8376('0x14')]);}else{logger['info'](_0x8376('0xd'),_0x2f21df,_0x8376('0x10'));_0x24e845(_0x542472[_0x8376('0x15')][_0x8376('0x14')]);}})[_0x8376('0x16')](function(_0x1c572e){logger['error'](_0x8376('0xd'),_0x2f21df,_0x1c572e);_0x1d9ea2(_0x1c572e);});});} \ No newline at end of file +var _0x77b0=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77b0,0x9c));var _0x077b=function(_0x5915dd,_0x207d7b){_0x5915dd=_0x5915dd-0x0;var _0x4ea472=_0x77b0[_0x5915dd];return _0x4ea472;};'use strict';var _=require('lodash');var util=require(_0x077b('0x0'));var moment=require(_0x077b('0x1'));var BPromise=require(_0x077b('0x2'));var rs=require(_0x077b('0x3'));var fs=require('fs');var Redis=require(_0x077b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x077b('0x5'));var logger=require(_0x077b('0x6'))(_0x077b('0x7'));var config=require(_0x077b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x077b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47fc28,_0x1a1d88,_0x3402bb){return new BPromise(function(_0x4c4a1d,_0x1e9193){return client[_0x077b('0xa')](_0x47fc28,_0x3402bb)['then'](function(_0x2f6c06){logger['info'](_0x077b('0xb'),_0x1a1d88,_0x077b('0xc'));logger[_0x077b('0xd')](_0x077b('0xe'),_0x1a1d88,_0x077b('0xc'),JSON[_0x077b('0xf')](_0x2f6c06));if(_0x2f6c06[_0x077b('0x10')]){if(_0x2f6c06['error'][_0x077b('0x11')]===0x1f4){logger[_0x077b('0x10')](_0x077b('0xb'),_0x1a1d88,_0x2f6c06[_0x077b('0x10')][_0x077b('0x12')]);return _0x1e9193(_0x2f6c06[_0x077b('0x10')][_0x077b('0x12')]);}logger['error'](_0x077b('0xb'),_0x1a1d88,_0x2f6c06[_0x077b('0x10')][_0x077b('0x12')]);return _0x4c4a1d(_0x2f6c06[_0x077b('0x10')][_0x077b('0x12')]);}else{logger[_0x077b('0x13')](_0x077b('0xb'),_0x1a1d88,_0x077b('0xc'));_0x4c4a1d(_0x2f6c06[_0x077b('0x14')][_0x077b('0x12')]);}})[_0x077b('0x15')](function(_0x42efc2){logger[_0x077b('0x10')](_0x077b('0xb'),_0x1a1d88,_0x42efc2);_0x1e9193(_0x42efc2);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index ecd5fb2..a9f5949 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 _0x2e65=['put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x9de3e0,_0x186627){var _0x4ad4bc=function(_0x1634a5){while(--_0x1634a5){_0x9de3e0['push'](_0x9de3e0['shift']());}};_0x4ad4bc(++_0x186627);}(_0x2e65,0x193));var _0x52e6=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x2e65[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var path=require(_0x52e6('0x2'));var timeout=require(_0x52e6('0x3'));var express=require(_0x52e6('0x4'));var router=express[_0x52e6('0x5')]();var fs_extra=require(_0x52e6('0x6'));var auth=require(_0x52e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x52e6('0x8'));var controller=require(_0x52e6('0x9'));router[_0x52e6('0xa')]('/',auth[_0x52e6('0xb')](),controller[_0x52e6('0xc')]);router[_0x52e6('0xa')](_0x52e6('0xd'),auth[_0x52e6('0xb')](),controller[_0x52e6('0xe')]);router[_0x52e6('0xf')]('/',auth['isAuthenticated'](),controller[_0x52e6('0x10')]);router[_0x52e6('0x11')]('/:id',auth[_0x52e6('0xb')](),controller['update']);router['delete'](_0x52e6('0xd'),auth[_0x52e6('0xb')](),controller[_0x52e6('0x12')]);module[_0x52e6('0x13')]=router; \ No newline at end of file +var _0xfb82=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x50327e,_0x2f02e5){var _0x1712a2=function(_0x17478b){while(--_0x17478b){_0x50327e['push'](_0x50327e['shift']());}};_0x1712a2(++_0x2f02e5);}(_0xfb82,0x17f));var _0x2fb8=function(_0x4c6f9c,_0x2b791c){_0x4c6f9c=_0x4c6f9c-0x0;var _0x5e028e=_0xfb82[_0x4c6f9c];return _0x5e028e;};'use strict';var multer=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var path=require(_0x2fb8('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb8('0x3'));var router=express[_0x2fb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fb8('0x5'));var interaction=require(_0x2fb8('0x6'));var config=require(_0x2fb8('0x7'));var controller=require(_0x2fb8('0x8'));router[_0x2fb8('0x9')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xb')]);router[_0x2fb8('0x9')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller['show']);router[_0x2fb8('0xd')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xe')]);router[_0x2fb8('0xf')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x10')]);router[_0x2fb8('0x11')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 7156fd6..3091e78 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 _0x20d2=['sequelize','exports','TEXT'];(function(_0x358580,_0x5960b1){var _0x3cdda1=function(_0x5c8bf5){while(--_0x5c8bf5){_0x358580['push'](_0x358580['shift']());}};_0x3cdda1(++_0x5960b1);}(_0x20d2,0x186));var _0x220d=function(_0x218a50,_0x4273d9){_0x218a50=_0x218a50-0x0;var _0x10b497=_0x20d2[_0x218a50];return _0x10b497;};'use strict';var Sequelize=require(_0x220d('0x0'));module[_0x220d('0x1')]={'tree':{'type':Sequelize[_0x220d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc8e7=['sequelize','exports','TEXT'];(function(_0x520a1c,_0x45b58b){var _0x3af0fa=function(_0x33e20e){while(--_0x33e20e){_0x520a1c['push'](_0x520a1c['shift']());}};_0x3af0fa(++_0x45b58b);}(_0xc8e7,0x1e6));var _0x7c8e=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xc8e7[_0x1daaa9];return _0x1dd221;};'use strict';var Sequelize=require(_0x7c8e('0x0'));module[_0x7c8e('0x1')]={'tree':{'type':Sequelize[_0x7c8e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 545a2b9..efe86ac 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 _0x0253=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','save','update','then','destroy','end','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','nolimit','order','sort','pick'];(function(_0x740bb1,_0x3e006c){var _0x365636=function(_0xc5ca56){while(--_0xc5ca56){_0x740bb1['push'](_0x740bb1['shift']());}};_0x365636(++_0x3e006c);}(_0x0253,0x1d1));var _0x3025=function(_0x1486a4,_0x418cc5){_0x1486a4=_0x1486a4-0x0;var _0x3af248=_0x0253[_0x1486a4];return _0x3af248;};'use strict';var emlformat=require(_0x3025('0x0'));var rimraf=require(_0x3025('0x1'));var zipdir=require(_0x3025('0x2'));var jsonpatch=require(_0x3025('0x3'));var rp=require(_0x3025('0x4'));var moment=require('moment');var BPromise=require(_0x3025('0x5'));var Mustache=require(_0x3025('0x6'));var util=require(_0x3025('0x7'));var path=require(_0x3025('0x8'));var sox=require(_0x3025('0x9'));var csv=require(_0x3025('0xa'));var ejs=require(_0x3025('0xb'));var fs=require('fs');var fs_extra=require(_0x3025('0xc'));var _=require('lodash');var squel=require(_0x3025('0xd'));var crypto=require('crypto');var jsforce=require(_0x3025('0xe'));var deskjs=require(_0x3025('0xf'));var toCsv=require(_0x3025('0xa'));var querystring=require(_0x3025('0x10'));var Papa=require(_0x3025('0x11'));var Redis=require(_0x3025('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3025('0x13'));var as=require(_0x3025('0x14'));var hardwareService=require(_0x3025('0x15'));var logger=require(_0x3025('0x16'))(_0x3025('0x17'));var utils=require(_0x3025('0x18'));var config=require(_0x3025('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3025('0x1a'))['db'];function respondWithStatusCode(_0x4c1213,_0x3af579){_0x3af579=_0x3af579||0xcc;return function(_0x5b8d5c){if(_0x5b8d5c){return _0x4c1213[_0x3025('0x1b')](_0x3af579);}return _0x4c1213[_0x3025('0x1c')](_0x3af579)['end']();};}function respondWithResult(_0x14d322,_0x2f1497){_0x2f1497=_0x2f1497||0xc8;return function(_0x978e35){if(_0x978e35){return _0x14d322[_0x3025('0x1c')](_0x2f1497)[_0x3025('0x1d')](_0x978e35);}};}function respondWithFilteredResult(_0x1eaf8d,_0x107631){return function(_0x3a95d6){if(_0x3a95d6){var _0x49b3ea=typeof _0x107631['offset']===_0x3025('0x1e')&&typeof _0x107631[_0x3025('0x1f')]===_0x3025('0x1e');var _0x2daff1=_0x3a95d6[_0x3025('0x20')];var _0x19e970=_0x49b3ea?0x0:_0x107631['offset'];var _0x679d3a=_0x49b3ea?_0x3a95d6['count']:_0x107631[_0x3025('0x21')]+_0x107631['limit'];var _0x2e89f8;if(_0x679d3a>=_0x2daff1){_0x679d3a=_0x2daff1;_0x2e89f8=0xc8;}else{_0x2e89f8=0xce;}_0x1eaf8d[_0x3025('0x1c')](_0x2e89f8);return _0x1eaf8d['set']('Content-Range',_0x19e970+'-'+_0x679d3a+'/'+_0x2daff1)[_0x3025('0x1d')](_0x3a95d6);}return null;};}function patchUpdates(_0x3437f5){return function(_0x5081d1){try{jsonpatch[_0x3025('0x22')](_0x5081d1,_0x3437f5,!![]);}catch(_0x17627d){return BPromise['reject'](_0x17627d);}return _0x5081d1[_0x3025('0x23')]();};}function saveUpdates(_0x575e24,_0x40065c){return function(_0x15be98){if(_0x15be98){return _0x15be98[_0x3025('0x24')](_0x575e24)[_0x3025('0x25')](function(_0x8c4512){return _0x8c4512;});}return null;};}function removeEntity(_0x13db3f,_0x27d0ef){return function(_0x44eb7f){if(_0x44eb7f){return _0x44eb7f[_0x3025('0x26')]()[_0x3025('0x25')](function(){_0x13db3f['status'](0xcc)[_0x3025('0x27')]();});}};}function handleEntityNotFound(_0x4392a3,_0x162c30){return function(_0xdc3d9c){if(!_0xdc3d9c){_0x4392a3[_0x3025('0x1b')](0x194);}return _0xdc3d9c;};}function handleError(_0x473083,_0x34934d){_0x34934d=_0x34934d||0x1f4;return function(_0x3a8efa){logger[_0x3025('0x28')](_0x3a8efa['stack']);if(_0x3a8efa['name']){delete _0x3a8efa[_0x3025('0x29')];}_0x473083[_0x3025('0x1c')](_0x34934d)[_0x3025('0x2a')](_0x3a8efa);};}exports['index']=function(_0x15d462,_0x46b50c){var _0x4ede20={},_0xcc1605={},_0x5f8baa={'count':0x0,'rows':[]};var _0x289123=_[_0x3025('0x2b')](db[_0x3025('0x2c')][_0x3025('0x2d')],function(_0x4dc9bf){return{'name':_0x4dc9bf[_0x3025('0x2e')],'type':_0x4dc9bf[_0x3025('0x2f')][_0x3025('0x30')]};});_0xcc1605['model']=_[_0x3025('0x2b')](_0x289123,_0x3025('0x29'));_0xcc1605[_0x3025('0x31')]=_[_0x3025('0x32')](_0x15d462[_0x3025('0x31')]);_0xcc1605[_0x3025('0x33')]=_['intersection'](_0xcc1605[_0x3025('0x34')],_0xcc1605['query']);_0x4ede20['attributes']=_[_0x3025('0x35')](_0xcc1605[_0x3025('0x34')],qs['fields'](_0x15d462[_0x3025('0x31')][_0x3025('0x36')]));_0x4ede20[_0x3025('0x37')]=_0x4ede20[_0x3025('0x37')]['length']?_0x4ede20[_0x3025('0x37')]:_0xcc1605['model'];if(!_0x15d462[_0x3025('0x31')]['hasOwnProperty'](_0x3025('0x38'))){_0x4ede20['limit']=qs[_0x3025('0x1f')](_0x15d462[_0x3025('0x31')][_0x3025('0x1f')]);_0x4ede20[_0x3025('0x21')]=qs['offset'](_0x15d462[_0x3025('0x31')]['offset']);}_0x4ede20[_0x3025('0x39')]=qs['sort'](_0x15d462[_0x3025('0x31')][_0x3025('0x3a')]);_0x4ede20['where']=qs[_0x3025('0x33')](_[_0x3025('0x3b')](_0x15d462[_0x3025('0x31')],_0xcc1605[_0x3025('0x33')]),_0x289123);if(_0x15d462[_0x3025('0x31')]['filter']){_0x4ede20[_0x3025('0x3c')]=_[_0x3025('0x3d')](_0x4ede20[_0x3025('0x3c')],{'$or':_[_0x3025('0x2b')](_0x289123,function(_0x3d900b){if(_0x3d900b[_0x3025('0x2f')]!==_0x3025('0x3e')){var _0x520ab8={};_0x520ab8[_0x3d900b['name']]={'$like':'%'+_0x15d462[_0x3025('0x31')][_0x3025('0x3f')]+'%'};return _0x520ab8;}})});}_0x4ede20=_['merge']({},_0x4ede20,_0x15d462[_0x3025('0x40')]);var _0x88367b={'where':_0x4ede20[_0x3025('0x3c')]};return db[_0x3025('0x2c')][_0x3025('0x20')](_0x88367b)['then'](function(_0x24da8d){_0x5f8baa[_0x3025('0x20')]=_0x24da8d;if(_0x15d462[_0x3025('0x31')][_0x3025('0x41')]){_0x4ede20[_0x3025('0x42')]=[{'all':!![]}];}return db[_0x3025('0x2c')][_0x3025('0x43')](_0x4ede20);})['then'](function(_0x45ea0c){_0x5f8baa[_0x3025('0x44')]=_0x45ea0c;return _0x5f8baa;})[_0x3025('0x25')](respondWithFilteredResult(_0x46b50c,_0x4ede20))['catch'](handleError(_0x46b50c,null));};exports['show']=function(_0x26229c,_0x1f41f2){var _0x16efcb={'raw':!![],'where':{'id':_0x26229c[_0x3025('0x45')]['id']}},_0x2d0f7c={};_0x2d0f7c['model']=_['keys'](db[_0x3025('0x2c')][_0x3025('0x2d')]);_0x2d0f7c['query']=_['keys'](_0x26229c[_0x3025('0x31')]);_0x2d0f7c[_0x3025('0x33')]=_[_0x3025('0x35')](_0x2d0f7c[_0x3025('0x34')],_0x2d0f7c[_0x3025('0x31')]);_0x16efcb[_0x3025('0x37')]=_[_0x3025('0x35')](_0x2d0f7c[_0x3025('0x34')],qs[_0x3025('0x36')](_0x26229c['query'][_0x3025('0x36')]));_0x16efcb[_0x3025('0x37')]=_0x16efcb[_0x3025('0x37')][_0x3025('0x46')]?_0x16efcb[_0x3025('0x37')]:_0x2d0f7c[_0x3025('0x34')];if(_0x26229c['query']['includeAll']){_0x16efcb[_0x3025('0x42')]=[{'all':!![]}];}_0x16efcb=_[_0x3025('0x3d')]({},_0x16efcb,_0x26229c[_0x3025('0x40')]);return db['AnalyticTreeReport'][_0x3025('0x47')](_0x16efcb)[_0x3025('0x25')](handleEntityNotFound(_0x1f41f2,null))['then'](respondWithResult(_0x1f41f2,null))[_0x3025('0x48')](handleError(_0x1f41f2,null));};exports[_0x3025('0x49')]=function(_0x30677f,_0x1e2155){return db[_0x3025('0x2c')][_0x3025('0x49')](_0x30677f[_0x3025('0x4a')],{})[_0x3025('0x25')](respondWithResult(_0x1e2155,0xc9))[_0x3025('0x48')](handleError(_0x1e2155,null));};exports[_0x3025('0x24')]=function(_0xf4933f,_0x2eef7c){if(_0xf4933f[_0x3025('0x4a')]['id']){delete _0xf4933f[_0x3025('0x4a')]['id'];}return db[_0x3025('0x2c')][_0x3025('0x47')]({'where':{'id':_0xf4933f[_0x3025('0x45')]['id']}})[_0x3025('0x25')](handleEntityNotFound(_0x2eef7c,null))['then'](saveUpdates(_0xf4933f[_0x3025('0x4a')],null))[_0x3025('0x25')](respondWithResult(_0x2eef7c,null))[_0x3025('0x48')](handleError(_0x2eef7c,null));};exports[_0x3025('0x26')]=function(_0x24216a,_0x1c2cf9){return db[_0x3025('0x2c')]['find']({'where':{'id':_0x24216a[_0x3025('0x45')]['id']}})[_0x3025('0x25')](handleEntityNotFound(_0x1c2cf9,null))[_0x3025('0x25')](removeEntity(_0x1c2cf9,null))[_0x3025('0x48')](handleError(_0x1c2cf9,null));}; \ No newline at end of file +var _0x6949=['AnalyticTreeReport','count','includeAll','include','findAll','rows','catch','show','params','merge','find','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6949,0xa2));var _0x9694=function(_0x4a0f16,_0x21ba18){_0x4a0f16=_0x4a0f16-0x0;var _0x45d653=_0x6949[_0x4a0f16];return _0x45d653;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9694('0x0'));var zipdir=require(_0x9694('0x1'));var jsonpatch=require(_0x9694('0x2'));var rp=require('request-promise');var moment=require(_0x9694('0x3'));var BPromise=require(_0x9694('0x4'));var Mustache=require(_0x9694('0x5'));var util=require(_0x9694('0x6'));var path=require(_0x9694('0x7'));var sox=require(_0x9694('0x8'));var csv=require(_0x9694('0x9'));var ejs=require(_0x9694('0xa'));var fs=require('fs');var fs_extra=require(_0x9694('0xb'));var _=require(_0x9694('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9694('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9694('0x9'));var querystring=require(_0x9694('0xe'));var Papa=require(_0x9694('0xf'));var Redis=require(_0x9694('0x10'));var authService=require(_0x9694('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9694('0x12'));var hardwareService=require(_0x9694('0x13'));var logger=require(_0x9694('0x14'))(_0x9694('0x15'));var utils=require(_0x9694('0x16'));var config=require(_0x9694('0x17'));var licenseUtil=require(_0x9694('0x18'));var db=require(_0x9694('0x19'))['db'];function respondWithStatusCode(_0x35af6b,_0x50fa3c){_0x50fa3c=_0x50fa3c||0xcc;return function(_0x2cee54){if(_0x2cee54){return _0x35af6b[_0x9694('0x1a')](_0x50fa3c);}return _0x35af6b[_0x9694('0x1b')](_0x50fa3c)[_0x9694('0x1c')]();};}function respondWithResult(_0x4ef570,_0x394493){_0x394493=_0x394493||0xc8;return function(_0x3492de){if(_0x3492de){return _0x4ef570[_0x9694('0x1b')](_0x394493)[_0x9694('0x1d')](_0x3492de);}};}function respondWithFilteredResult(_0x356c2b,_0xfb4902){return function(_0x42a395){if(_0x42a395){var _0xaaeef6=typeof _0xfb4902[_0x9694('0x1e')]===_0x9694('0x1f')&&typeof _0xfb4902[_0x9694('0x20')]===_0x9694('0x1f');var _0x7fb792=_0x42a395['count'];var _0x32004b=_0xaaeef6?0x0:_0xfb4902[_0x9694('0x1e')];var _0x417502=_0xaaeef6?_0x42a395['count']:_0xfb4902[_0x9694('0x1e')]+_0xfb4902[_0x9694('0x20')];var _0x279752;if(_0x417502>=_0x7fb792){_0x417502=_0x7fb792;_0x279752=0xc8;}else{_0x279752=0xce;}_0x356c2b[_0x9694('0x1b')](_0x279752);return _0x356c2b[_0x9694('0x21')]('Content-Range',_0x32004b+'-'+_0x417502+'/'+_0x7fb792)[_0x9694('0x1d')](_0x42a395);}return null;};}function patchUpdates(_0x3814e0){return function(_0x56b457){try{jsonpatch[_0x9694('0x22')](_0x56b457,_0x3814e0,!![]);}catch(_0xebc752){return BPromise[_0x9694('0x23')](_0xebc752);}return _0x56b457[_0x9694('0x24')]();};}function saveUpdates(_0x2b7a85,_0x21104b){return function(_0x3f5a31){if(_0x3f5a31){return _0x3f5a31[_0x9694('0x25')](_0x2b7a85)['then'](function(_0x94cf43){return _0x94cf43;});}return null;};}function removeEntity(_0x57fbc8,_0x23498f){return function(_0x3c3e4b){if(_0x3c3e4b){return _0x3c3e4b[_0x9694('0x26')]()[_0x9694('0x27')](function(){_0x57fbc8[_0x9694('0x1b')](0xcc)[_0x9694('0x1c')]();});}};}function handleEntityNotFound(_0x21d335,_0x1b8a88){return function(_0x3f8dc4){if(!_0x3f8dc4){_0x21d335[_0x9694('0x1a')](0x194);}return _0x3f8dc4;};}function handleError(_0x2b32ff,_0x53f34d){_0x53f34d=_0x53f34d||0x1f4;return function(_0x1a39b2){logger[_0x9694('0x28')](_0x1a39b2[_0x9694('0x29')]);if(_0x1a39b2[_0x9694('0x2a')]){delete _0x1a39b2[_0x9694('0x2a')];}_0x2b32ff[_0x9694('0x1b')](_0x53f34d)['send'](_0x1a39b2);};}exports[_0x9694('0x2b')]=function(_0x2a8afc,_0x2baad){var _0x181ac2={},_0x211347={},_0x1a5850={'count':0x0,'rows':[]};var _0x302f58=_[_0x9694('0x2c')](db['AnalyticTreeReport'][_0x9694('0x2d')],function(_0x5e54b5){return{'name':_0x5e54b5['fieldName'],'type':_0x5e54b5[_0x9694('0x2e')]['key']};});_0x211347[_0x9694('0x2f')]=_['map'](_0x302f58,'name');_0x211347[_0x9694('0x30')]=_[_0x9694('0x31')](_0x2a8afc[_0x9694('0x30')]);_0x211347[_0x9694('0x32')]=_[_0x9694('0x33')](_0x211347[_0x9694('0x2f')],_0x211347[_0x9694('0x30')]);_0x181ac2[_0x9694('0x34')]=_[_0x9694('0x33')](_0x211347[_0x9694('0x2f')],qs[_0x9694('0x35')](_0x2a8afc[_0x9694('0x30')][_0x9694('0x35')]));_0x181ac2[_0x9694('0x34')]=_0x181ac2[_0x9694('0x34')][_0x9694('0x36')]?_0x181ac2[_0x9694('0x34')]:_0x211347['model'];if(!_0x2a8afc[_0x9694('0x30')][_0x9694('0x37')](_0x9694('0x38'))){_0x181ac2[_0x9694('0x20')]=qs['limit'](_0x2a8afc[_0x9694('0x30')][_0x9694('0x20')]);_0x181ac2[_0x9694('0x1e')]=qs['offset'](_0x2a8afc['query'][_0x9694('0x1e')]);}_0x181ac2['order']=qs[_0x9694('0x39')](_0x2a8afc[_0x9694('0x30')][_0x9694('0x39')]);_0x181ac2[_0x9694('0x3a')]=qs[_0x9694('0x32')](_[_0x9694('0x3b')](_0x2a8afc['query'],_0x211347['filters']),_0x302f58);if(_0x2a8afc[_0x9694('0x30')]['filter']){_0x181ac2[_0x9694('0x3a')]=_['merge'](_0x181ac2['where'],{'$or':_[_0x9694('0x2c')](_0x302f58,function(_0x416d5f){if(_0x416d5f['type']!==_0x9694('0x3c')){var _0x365bfb={};_0x365bfb[_0x416d5f['name']]={'$like':'%'+_0x2a8afc[_0x9694('0x30')][_0x9694('0x3d')]+'%'};return _0x365bfb;}})});}_0x181ac2=_['merge']({},_0x181ac2,_0x2a8afc[_0x9694('0x3e')]);var _0x38e812={'where':_0x181ac2[_0x9694('0x3a')]};return db[_0x9694('0x3f')][_0x9694('0x40')](_0x38e812)[_0x9694('0x27')](function(_0x3a0d23){_0x1a5850[_0x9694('0x40')]=_0x3a0d23;if(_0x2a8afc[_0x9694('0x30')][_0x9694('0x41')]){_0x181ac2[_0x9694('0x42')]=[{'all':!![]}];}return db[_0x9694('0x3f')][_0x9694('0x43')](_0x181ac2);})[_0x9694('0x27')](function(_0x3430a8){_0x1a5850[_0x9694('0x44')]=_0x3430a8;return _0x1a5850;})[_0x9694('0x27')](respondWithFilteredResult(_0x2baad,_0x181ac2))[_0x9694('0x45')](handleError(_0x2baad,null));};exports[_0x9694('0x46')]=function(_0x567cbd,_0x3515c7){var _0x4f5d03={'raw':!![],'where':{'id':_0x567cbd[_0x9694('0x47')]['id']}},_0x48f6b3={};_0x48f6b3['model']=_[_0x9694('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x48f6b3['query']=_[_0x9694('0x31')](_0x567cbd[_0x9694('0x30')]);_0x48f6b3[_0x9694('0x32')]=_[_0x9694('0x33')](_0x48f6b3[_0x9694('0x2f')],_0x48f6b3[_0x9694('0x30')]);_0x4f5d03['attributes']=_[_0x9694('0x33')](_0x48f6b3[_0x9694('0x2f')],qs[_0x9694('0x35')](_0x567cbd[_0x9694('0x30')][_0x9694('0x35')]));_0x4f5d03['attributes']=_0x4f5d03[_0x9694('0x34')][_0x9694('0x36')]?_0x4f5d03[_0x9694('0x34')]:_0x48f6b3[_0x9694('0x2f')];if(_0x567cbd[_0x9694('0x30')][_0x9694('0x41')]){_0x4f5d03['include']=[{'all':!![]}];}_0x4f5d03=_[_0x9694('0x48')]({},_0x4f5d03,_0x567cbd[_0x9694('0x3e')]);return db['AnalyticTreeReport'][_0x9694('0x49')](_0x4f5d03)['then'](handleEntityNotFound(_0x3515c7,null))[_0x9694('0x27')](respondWithResult(_0x3515c7,null))['catch'](handleError(_0x3515c7,null));};exports['create']=function(_0x699260,_0x3a4c1c){return db[_0x9694('0x3f')]['create'](_0x699260[_0x9694('0x4a')],{})[_0x9694('0x27')](respondWithResult(_0x3a4c1c,0xc9))[_0x9694('0x45')](handleError(_0x3a4c1c,null));};exports[_0x9694('0x25')]=function(_0x28284f,_0x216dc2){if(_0x28284f[_0x9694('0x4a')]['id']){delete _0x28284f[_0x9694('0x4a')]['id'];}return db[_0x9694('0x3f')][_0x9694('0x49')]({'where':{'id':_0x28284f[_0x9694('0x47')]['id']}})['then'](handleEntityNotFound(_0x216dc2,null))[_0x9694('0x27')](saveUpdates(_0x28284f['body'],null))[_0x9694('0x27')](respondWithResult(_0x216dc2,null))[_0x9694('0x45')](handleError(_0x216dc2,null));};exports['destroy']=function(_0x39fbce,_0x1c6087){return db[_0x9694('0x3f')][_0x9694('0x49')]({'where':{'id':_0x39fbce[_0x9694('0x47')]['id']}})[_0x9694('0x27')](handleEntityNotFound(_0x1c6087,null))[_0x9694('0x27')](removeEntity(_0x1c6087,null))[_0x9694('0x45')](handleError(_0x1c6087,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index e3a3ec6..04ca673 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 _0x348a=['bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','lodash','api','moment'];(function(_0x3516bf,_0x1368be){var _0x2990a9=function(_0x38eac2){while(--_0x38eac2){_0x3516bf['push'](_0x3516bf['shift']());}};_0x2990a9(++_0x1368be);}(_0x348a,0x175));var _0xa348=function(_0x491188,_0x473223){_0x491188=_0x491188-0x0;var _0x30310a=_0x348a[_0x491188];return _0x30310a;};'use strict';var _=require(_0xa348('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa348('0x1'));var moment=require(_0xa348('0x2'));var BPromise=require(_0xa348('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa348('0x4'));var rimraf=require(_0xa348('0x5'));var config=require(_0xa348('0x6'));var attributes=require(_0xa348('0x7'));module['exports']=function(_0x29cf0f,_0x3b1cc3){return _0x29cf0f['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','util','../../config/logger','api'];(function(_0x222342,_0x29c2a8){var _0x517efb=function(_0x4bccfb){while(--_0x4bccfb){_0x222342['push'](_0x222342['shift']());}};_0x517efb(++_0x29c2a8);}(_0xed8a,0x1c5));var _0xaed8=function(_0x105426,_0x1f5361){_0x105426=_0x105426-0x0;var _0x2a37d1=_0xed8a[_0x105426];return _0x2a37d1;};'use strict';var _=require('lodash');var util=require(_0xaed8('0x0'));var logger=require(_0xaed8('0x1'))(_0xaed8('0x2'));var moment=require(_0xaed8('0x3'));var BPromise=require(_0xaed8('0x4'));var rp=require(_0xaed8('0x5'));var fs=require('fs');var path=require(_0xaed8('0x6'));var rimraf=require(_0xaed8('0x7'));var config=require(_0xaed8('0x8'));var attributes=require(_0xaed8('0x9'));module[_0xaed8('0xa')]=function(_0xf24325,_0x8d3efb){return _0xf24325['define'](_0xaed8('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d6e05b7..f3be3db 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x47ec04,_0x19a2c8){var _0x4904e8=function(_0x734e4c){while(--_0x734e4c){_0x47ec04['push'](_0x47ec04['shift']());}};_0x4904e8(++_0x19a2c8);}(_0xdb28,0x106));var _0x8db2=function(_0x4ffb11,_0x2c222b){_0x4ffb11=_0x4ffb11-0x0;var _0xe6458f=_0xdb28[_0x4ffb11];return _0xe6458f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x380b08,_0x1df63a){var _0x22f65d=function(_0x507f73){while(--_0x507f73){_0x380b08['push'](_0x380b08['shift']());}};_0x22f65d(++_0x1df63a);}(_0xadb5,0xad));var _0x5adb=function(_0x3f508f,_0x36cd15){_0x3f508f=_0x3f508f-0x0;var _0x5be915=_0xadb5[_0x3f508f];return _0x5be915;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d09fb9d..b234e33 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 _0xdac9=['show','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x20abbb,_0x488db0){var _0x425bb7=function(_0x1f1536){while(--_0x1f1536){_0x20abbb['push'](_0x20abbb['shift']());}};_0x425bb7(++_0x488db0);}(_0xdac9,0xaf));var _0x9dac=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xdac9[_0x16771d];return _0x386f11;};'use strict';var multer=require(_0x9dac('0x0'));var util=require(_0x9dac('0x1'));var path=require(_0x9dac('0x2'));var timeout=require(_0x9dac('0x3'));var express=require(_0x9dac('0x4'));var router=express[_0x9dac('0x5')]();var fs_extra=require(_0x9dac('0x6'));var auth=require(_0x9dac('0x7'));var interaction=require(_0x9dac('0x8'));var config=require(_0x9dac('0x9'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9dac('0xa')]('/:id',auth[_0x9dac('0xb')](),controller[_0x9dac('0xc')]);router['post']('/',auth[_0x9dac('0xb')](),controller['create']);router[_0x9dac('0xd')](_0x9dac('0xe'),auth[_0x9dac('0xb')](),controller[_0x9dac('0xf')]);router['delete'](_0x9dac('0xe'),auth[_0x9dac('0xb')](),controller['destroy']);module[_0x9dac('0x10')]=router; \ No newline at end of file +var _0x3ab7=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy'];(function(_0x5791f3,_0x5d5453){var _0x1564a2=function(_0x2f3037){while(--_0x2f3037){_0x5791f3['push'](_0x5791f3['shift']());}};_0x1564a2(++_0x5d5453);}(_0x3ab7,0x1b6));var _0x73ab=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x3ab7[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x73ab('0x0'));var util=require('util');var path=require(_0x73ab('0x1'));var timeout=require(_0x73ab('0x2'));var express=require(_0x73ab('0x3'));var router=express[_0x73ab('0x4')]();var fs_extra=require(_0x73ab('0x5'));var auth=require(_0x73ab('0x6'));var interaction=require(_0x73ab('0x7'));var config=require('../../config/environment');var controller=require(_0x73ab('0x8'));router['get']('/',auth[_0x73ab('0x9')](),controller['index']);router[_0x73ab('0xa')](_0x73ab('0xb'),auth[_0x73ab('0x9')](),controller[_0x73ab('0xc')]);router[_0x73ab('0xd')]('/',auth[_0x73ab('0x9')](),controller[_0x73ab('0xe')]);router[_0x73ab('0xf')](_0x73ab('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x73ab('0x10')](_0x73ab('0xb'),auth[_0x73ab('0x9')](),controller[_0x73ab('0x11')]);module[_0x73ab('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 43d5418..8873101 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 _0xa22a=['sequelize','exports','STRING'];(function(_0x555605,_0x217649){var _0x7e063b=function(_0x3e8461){while(--_0x3e8461){_0x555605['push'](_0x555605['shift']());}};_0x7e063b(++_0x217649);}(_0xa22a,0x153));var _0xaa22=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa22a[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xaa22('0x0'));module[_0xaa22('0x1')]={'name':{'type':Sequelize[_0xaa22('0x2')]},'basename':{'type':Sequelize[_0xaa22('0x2')]},'type':{'type':Sequelize[_0xaa22('0x2')]}}; \ No newline at end of file +var _0xcdd0=['STRING','sequelize','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xcdd0[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require(_0x0cdd('0x0'));module[_0x0cdd('0x1')]={'name':{'type':Sequelize[_0x0cdd('0x2')]},'basename':{'type':Sequelize[_0x0cdd('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index cdb3567..032d903 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 _0x38c7=['body','create','file','originalname','basename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','Attachment','keys','find','clone','createdAt','updatedAt'];(function(_0x3034ce,_0x1421b6){var _0x4bc0e3=function(_0x49a5ca){while(--_0x49a5ca){_0x3034ce['push'](_0x3034ce['shift']());}};_0x4bc0e3(++_0x1421b6);}(_0x38c7,0xc2));var _0x738c=function(_0x4dca67,_0x3d8b0d){_0x4dca67=_0x4dca67-0x0;var _0x3846f8=_0x38c7[_0x4dca67];return _0x3846f8;};'use strict';var emlformat=require(_0x738c('0x0'));var rimraf=require(_0x738c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x738c('0x2'));var rp=require(_0x738c('0x3'));var moment=require('moment');var BPromise=require(_0x738c('0x4'));var Mustache=require(_0x738c('0x5'));var util=require(_0x738c('0x6'));var path=require(_0x738c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x738c('0x8'));var fs=require('fs');var fs_extra=require(_0x738c('0x9'));var _=require(_0x738c('0xa'));var squel=require(_0x738c('0xb'));var crypto=require(_0x738c('0xc'));var jsforce=require(_0x738c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x738c('0xe'));var Papa=require(_0x738c('0xf'));var Redis=require('ioredis');var authService=require(_0x738c('0x10'));var qs=require(_0x738c('0x11'));var as=require(_0x738c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x738c('0x13'))(_0x738c('0x14'));var utils=require(_0x738c('0x15'));var config=require(_0x738c('0x16'));var licenseUtil=require(_0x738c('0x17'));var db=require(_0x738c('0x18'))['db'];function respondWithStatusCode(_0x3303d7,_0x31a575){_0x31a575=_0x31a575||0xcc;return function(_0x3313aa){if(_0x3313aa){return _0x3303d7[_0x738c('0x19')](_0x31a575);}return _0x3303d7[_0x738c('0x1a')](_0x31a575)['end']();};}function respondWithResult(_0x451ab6,_0x117d67){_0x117d67=_0x117d67||0xc8;return function(_0x24a340){if(_0x24a340){return _0x451ab6[_0x738c('0x1a')](_0x117d67)['json'](_0x24a340);}};}function respondWithFilteredResult(_0x38fe58,_0x3beecb){return function(_0x10a1bd){if(_0x10a1bd){var _0x1bdceb=typeof _0x3beecb['offset']===_0x738c('0x1b')&&typeof _0x3beecb[_0x738c('0x1c')]===_0x738c('0x1b');var _0x49aad7=_0x10a1bd[_0x738c('0x1d')];var _0x4016a5=_0x1bdceb?0x0:_0x3beecb[_0x738c('0x1e')];var _0x3c4b7d=_0x1bdceb?_0x10a1bd[_0x738c('0x1d')]:_0x3beecb[_0x738c('0x1e')]+_0x3beecb['limit'];var _0x3e61e4;if(_0x3c4b7d>=_0x49aad7){_0x3c4b7d=_0x49aad7;_0x3e61e4=0xc8;}else{_0x3e61e4=0xce;}_0x38fe58[_0x738c('0x1a')](_0x3e61e4);return _0x38fe58['set'](_0x738c('0x1f'),_0x4016a5+'-'+_0x3c4b7d+'/'+_0x49aad7)[_0x738c('0x20')](_0x10a1bd);}return null;};}function patchUpdates(_0x2f2f67){return function(_0x288716){try{jsonpatch[_0x738c('0x21')](_0x288716,_0x2f2f67,!![]);}catch(_0x4d56e8){return BPromise[_0x738c('0x22')](_0x4d56e8);}return _0x288716[_0x738c('0x23')]();};}function saveUpdates(_0x259e01,_0x24b857){return function(_0x30ebe0){if(_0x30ebe0){return _0x30ebe0[_0x738c('0x24')](_0x259e01)[_0x738c('0x25')](function(_0x4a0a2f){return _0x4a0a2f;});}return null;};}function removeEntity(_0x4a9eb6,_0x22f034){return function(_0x1c4342){if(_0x1c4342){return _0x1c4342[_0x738c('0x26')]()['then'](function(){_0x4a9eb6[_0x738c('0x1a')](0xcc)[_0x738c('0x27')]();});}};}function handleEntityNotFound(_0x3d84ff,_0x32066d){return function(_0x72f1ce){if(!_0x72f1ce){_0x3d84ff['sendStatus'](0x194);}return _0x72f1ce;};}function handleError(_0xcd594a,_0xc70755){_0xc70755=_0xc70755||0x1f4;return function(_0x25a619){logger[_0x738c('0x28')](_0x25a619[_0x738c('0x29')]);if(_0x25a619['name']){delete _0x25a619[_0x738c('0x2a')];}_0xcd594a[_0x738c('0x1a')](_0xc70755)[_0x738c('0x2b')](_0x25a619);};}exports['index']=function(_0x3e0a65,_0x360b57){var _0x2bb69a={},_0xbcc0e3={},_0x197ce9={'count':0x0,'rows':[]};var _0x1ac685=_['map'](db['Attachment'][_0x738c('0x2c')],function(_0x1d010a){return{'name':_0x1d010a[_0x738c('0x2d')],'type':_0x1d010a[_0x738c('0x2e')][_0x738c('0x2f')]};});_0xbcc0e3[_0x738c('0x30')]=_[_0x738c('0x31')](_0x1ac685,_0x738c('0x2a'));_0xbcc0e3[_0x738c('0x32')]=_['keys'](_0x3e0a65['query']);_0xbcc0e3[_0x738c('0x33')]=_[_0x738c('0x34')](_0xbcc0e3['model'],_0xbcc0e3[_0x738c('0x32')]);_0x2bb69a[_0x738c('0x35')]=_[_0x738c('0x34')](_0xbcc0e3['model'],qs[_0x738c('0x36')](_0x3e0a65[_0x738c('0x32')][_0x738c('0x36')]));_0x2bb69a[_0x738c('0x35')]=_0x2bb69a[_0x738c('0x35')][_0x738c('0x37')]?_0x2bb69a[_0x738c('0x35')]:_0xbcc0e3[_0x738c('0x30')];if(!_0x3e0a65['query'][_0x738c('0x38')](_0x738c('0x39'))){_0x2bb69a['limit']=qs[_0x738c('0x1c')](_0x3e0a65[_0x738c('0x32')]['limit']);_0x2bb69a[_0x738c('0x1e')]=qs[_0x738c('0x1e')](_0x3e0a65[_0x738c('0x32')][_0x738c('0x1e')]);}_0x2bb69a[_0x738c('0x3a')]=qs[_0x738c('0x3b')](_0x3e0a65[_0x738c('0x32')][_0x738c('0x3b')]);_0x2bb69a[_0x738c('0x3c')]=qs[_0x738c('0x33')](_[_0x738c('0x3d')](_0x3e0a65[_0x738c('0x32')],_0xbcc0e3[_0x738c('0x33')]),_0x1ac685);if(_0x3e0a65[_0x738c('0x32')]['filter']){_0x2bb69a[_0x738c('0x3c')]=_[_0x738c('0x3e')](_0x2bb69a[_0x738c('0x3c')],{'$or':_['map'](_0x1ac685,function(_0x4cabf3){if(_0x4cabf3[_0x738c('0x2e')]!==_0x738c('0x3f')){var _0x2a4026={};_0x2a4026[_0x4cabf3[_0x738c('0x2a')]]={'$like':'%'+_0x3e0a65[_0x738c('0x32')][_0x738c('0x40')]+'%'};return _0x2a4026;}})});}_0x2bb69a=_[_0x738c('0x3e')]({},_0x2bb69a,_0x3e0a65[_0x738c('0x41')]);var _0x51ae5d={'where':_0x2bb69a['where']};return db['Attachment']['count'](_0x51ae5d)[_0x738c('0x25')](function(_0x2a41c5){_0x197ce9[_0x738c('0x1d')]=_0x2a41c5;if(_0x3e0a65[_0x738c('0x32')][_0x738c('0x42')]){_0x2bb69a[_0x738c('0x43')]=[{'all':!![]}];}return db['Attachment'][_0x738c('0x44')](_0x2bb69a);})[_0x738c('0x25')](function(_0x5302e3){_0x197ce9[_0x738c('0x45')]=_0x5302e3;return _0x197ce9;})[_0x738c('0x25')](respondWithFilteredResult(_0x360b57,_0x2bb69a))[_0x738c('0x46')](handleError(_0x360b57,null));};exports[_0x738c('0x47')]=function(_0x55368a,_0x139f3b){var _0x1f05e4={'raw':!![],'where':{'id':_0x55368a[_0x738c('0x48')]['id']}},_0x1ff68a={};_0x1ff68a[_0x738c('0x30')]=_['keys'](db[_0x738c('0x49')]['rawAttributes']);_0x1ff68a[_0x738c('0x32')]=_[_0x738c('0x4a')](_0x55368a[_0x738c('0x32')]);_0x1ff68a[_0x738c('0x33')]=_[_0x738c('0x34')](_0x1ff68a[_0x738c('0x30')],_0x1ff68a['query']);_0x1f05e4[_0x738c('0x35')]=_['intersection'](_0x1ff68a[_0x738c('0x30')],qs[_0x738c('0x36')](_0x55368a[_0x738c('0x32')][_0x738c('0x36')]));_0x1f05e4[_0x738c('0x35')]=_0x1f05e4[_0x738c('0x35')][_0x738c('0x37')]?_0x1f05e4['attributes']:_0x1ff68a[_0x738c('0x30')];if(_0x55368a[_0x738c('0x32')][_0x738c('0x42')]){_0x1f05e4['include']=[{'all':!![]}];}_0x1f05e4=_['merge']({},_0x1f05e4,_0x55368a[_0x738c('0x41')]);return db['Attachment'][_0x738c('0x4b')](_0x1f05e4)[_0x738c('0x25')](handleEntityNotFound(_0x139f3b,null))[_0x738c('0x25')](respondWithResult(_0x139f3b,null))[_0x738c('0x46')](handleError(_0x139f3b,null));};exports[_0x738c('0x4c')]=function(_0x1d990a,_0x4881dc){var _0x36a9a0={'where':{'id':_0x1d990a['params']['id']}},_0x4a5edc={};_0x4a5edc[_0x738c('0x30')]=_[_0x738c('0x4a')](db['Attachment']['rawAttributes']);_0x36a9a0[_0x738c('0x35')]=_[_0x738c('0x34')](_0x4a5edc['model'],qs[_0x738c('0x36')](_0x1d990a[_0x738c('0x32')][_0x738c('0x36')]));_0x36a9a0[_0x738c('0x35')]=_0x36a9a0[_0x738c('0x35')][_0x738c('0x37')]?_0x36a9a0[_0x738c('0x35')]:_0x4a5edc[_0x738c('0x30')];if(_0x1d990a['query'][_0x738c('0x42')]){_0x36a9a0[_0x738c('0x43')]=[{'all':!![]}];}_0x36a9a0=_[_0x738c('0x3e')]({},_0x36a9a0,_0x1d990a[_0x738c('0x41')]);return db[_0x738c('0x49')][_0x738c('0x4b')](_0x36a9a0)[_0x738c('0x25')](handleEntityNotFound(_0x4881dc,null))[_0x738c('0x25')](function(_0x5c6cf1){if(_0x5c6cf1){var _0x185e40=_0x5c6cf1['get']({'plain':!![]});_0x185e40=qs['omit'](_0x185e40,['id',_0x738c('0x4d'),_0x738c('0x4e')]);_0x1d990a[_0x738c('0x4f')]=_['omit'](_0x1d990a[_0x738c('0x4f')],['id',_0x738c('0x4d'),_0x738c('0x4e')]);return db['Attachment']['create'](_[_0x738c('0x3e')](_0x185e40,_0x1d990a[_0x738c('0x4f')]),{'include':_0x1d990a[_0x738c('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x738c('0x25')](respondWithResult(_0x4881dc,0xc9))[_0x738c('0x46')](handleError(_0x4881dc,null));};exports[_0x738c('0x24')]=function(_0x43baa6,_0x2dcc18){if(_0x43baa6[_0x738c('0x4f')]['id']){delete _0x43baa6['body']['id'];}return db['Attachment'][_0x738c('0x4b')]({'where':{'id':_0x43baa6[_0x738c('0x48')]['id']}})[_0x738c('0x25')](handleEntityNotFound(_0x2dcc18,null))['then'](saveUpdates(_0x43baa6[_0x738c('0x4f')],null))[_0x738c('0x25')](respondWithResult(_0x2dcc18,null))['catch'](handleError(_0x2dcc18,null));};exports['destroy']=function(_0x121417,_0x39f8bc){return db[_0x738c('0x49')][_0x738c('0x4b')]({'where':{'id':_0x121417[_0x738c('0x48')]['id']}})[_0x738c('0x25')](handleEntityNotFound(_0x39f8bc,null))[_0x738c('0x25')](removeEntity(_0x39f8bc,null))[_0x738c('0x46')](handleError(_0x39f8bc,null));};exports[_0x738c('0x50')]=function(_0x163e7a,_0xf034cc,_0x261279){_0x163e7a[_0x738c('0x4f')][_0x738c('0x2a')]=_0x163e7a[_0x738c('0x51')][_0x738c('0x52')];_0x163e7a['body'][_0x738c('0x53')]=_0x163e7a[_0x738c('0x51')]['filename'];_0x163e7a[_0x738c('0x4f')]['type']=_0x163e7a['file'][_0x738c('0x54')];return db['Attachment']['create'](_0x163e7a[_0x738c('0x4f')])['then'](respondWithResult(_0xf034cc,0xc9))[_0x738c('0x46')](handleError(_0xf034cc,null));};exports[_0x738c('0x55')]=function(_0x115bf8,_0x2aba41,_0x133f84){return db[_0x738c('0x49')]['findOne']({'where':{'id':_0x115bf8[_0x738c('0x48')]['id']},'raw':!![]})[_0x738c('0x25')](handleEntityNotFound(_0x2aba41,null))['then'](function(_0x43da87){if(_0x43da87){var _0x4abeca=_0x43da87[_0x738c('0x56')]!==null;var _0x45d32f=path[_0x738c('0x57')](config[_0x738c('0x58')],_0x738c('0x59'));if(_0x4abeca){_0x45d32f=path['join'](_0x45d32f,_0x738c('0x5a'));}var _0x380a14=path[_0x738c('0x57')](_0x45d32f,_0x43da87[_0x738c('0x53')]);return _0x2aba41['download'](_0x380a14);}})[_0x738c('0x46')](handleError(_0x2aba41,null));}; \ No newline at end of file +var _0x4a77=['save','update','destroy','then','sendStatus','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','mimetype','download','findOne','server/files/attachments/','join','offline-chat/','basename','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','limit','count','set','Content-Range','apply','reject'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4a77,0x1a0));var _0x74a7=function(_0xb3032,_0x4ce390){_0xb3032=_0xb3032-0x0;var _0x527ca8=_0x4a77[_0xb3032];return _0x527ca8;};'use strict';var emlformat=require(_0x74a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74a7('0x2'));var moment=require(_0x74a7('0x3'));var BPromise=require(_0x74a7('0x4'));var Mustache=require(_0x74a7('0x5'));var util=require(_0x74a7('0x6'));var path=require(_0x74a7('0x7'));var sox=require(_0x74a7('0x8'));var csv=require(_0x74a7('0x9'));var ejs=require(_0x74a7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74a7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74a7('0xc'));var deskjs=require(_0x74a7('0xd'));var toCsv=require(_0x74a7('0x9'));var querystring=require(_0x74a7('0xe'));var Papa=require(_0x74a7('0xf'));var Redis=require(_0x74a7('0x10'));var authService=require(_0x74a7('0x11'));var qs=require(_0x74a7('0x12'));var as=require(_0x74a7('0x13'));var hardwareService=require(_0x74a7('0x14'));var logger=require(_0x74a7('0x15'))(_0x74a7('0x16'));var utils=require(_0x74a7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53549a,_0x380540){_0x380540=_0x380540||0xcc;return function(_0x159740){if(_0x159740){return _0x53549a['sendStatus'](_0x380540);}return _0x53549a[_0x74a7('0x18')](_0x380540)[_0x74a7('0x19')]();};}function respondWithResult(_0xe1025f,_0x1e3fa1){_0x1e3fa1=_0x1e3fa1||0xc8;return function(_0x43dcc2){if(_0x43dcc2){return _0xe1025f['status'](_0x1e3fa1)[_0x74a7('0x1a')](_0x43dcc2);}};}function respondWithFilteredResult(_0x8f4754,_0x2957ff){return function(_0x35b198){if(_0x35b198){var _0x29bc42=typeof _0x2957ff[_0x74a7('0x1b')]==='undefined'&&typeof _0x2957ff[_0x74a7('0x1c')]==='undefined';var _0x37a8f5=_0x35b198[_0x74a7('0x1d')];var _0x15c15f=_0x29bc42?0x0:_0x2957ff['offset'];var _0x32d50c=_0x29bc42?_0x35b198[_0x74a7('0x1d')]:_0x2957ff[_0x74a7('0x1b')]+_0x2957ff['limit'];var _0x523c95;if(_0x32d50c>=_0x37a8f5){_0x32d50c=_0x37a8f5;_0x523c95=0xc8;}else{_0x523c95=0xce;}_0x8f4754[_0x74a7('0x18')](_0x523c95);return _0x8f4754[_0x74a7('0x1e')](_0x74a7('0x1f'),_0x15c15f+'-'+_0x32d50c+'/'+_0x37a8f5)[_0x74a7('0x1a')](_0x35b198);}return null;};}function patchUpdates(_0x2ab0bd){return function(_0x17331a){try{jsonpatch[_0x74a7('0x20')](_0x17331a,_0x2ab0bd,!![]);}catch(_0x36b416){return BPromise[_0x74a7('0x21')](_0x36b416);}return _0x17331a[_0x74a7('0x22')]();};}function saveUpdates(_0x3447de,_0x47f166){return function(_0x25da4d){if(_0x25da4d){return _0x25da4d[_0x74a7('0x23')](_0x3447de)['then'](function(_0x2a09bf){return _0x2a09bf;});}return null;};}function removeEntity(_0x515379,_0x2561af){return function(_0x485e85){if(_0x485e85){return _0x485e85[_0x74a7('0x24')]()[_0x74a7('0x25')](function(){_0x515379[_0x74a7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa47a90,_0x227e8c){return function(_0x58c2db){if(!_0x58c2db){_0xa47a90[_0x74a7('0x26')](0x194);}return _0x58c2db;};}function handleError(_0x57aa92,_0x25628a){_0x25628a=_0x25628a||0x1f4;return function(_0x4eaeb5){logger[_0x74a7('0x27')](_0x4eaeb5['stack']);if(_0x4eaeb5[_0x74a7('0x28')]){delete _0x4eaeb5[_0x74a7('0x28')];}_0x57aa92[_0x74a7('0x18')](_0x25628a)[_0x74a7('0x29')](_0x4eaeb5);};}exports[_0x74a7('0x2a')]=function(_0x25fc1d,_0x4d510b){var _0x168d20={},_0x4fc65b={},_0xb0183b={'count':0x0,'rows':[]};var _0x343280=_[_0x74a7('0x2b')](db[_0x74a7('0x2c')][_0x74a7('0x2d')],function(_0x450863){return{'name':_0x450863[_0x74a7('0x2e')],'type':_0x450863[_0x74a7('0x2f')][_0x74a7('0x30')]};});_0x4fc65b[_0x74a7('0x31')]=_[_0x74a7('0x2b')](_0x343280,_0x74a7('0x28'));_0x4fc65b[_0x74a7('0x32')]=_[_0x74a7('0x33')](_0x25fc1d[_0x74a7('0x32')]);_0x4fc65b[_0x74a7('0x34')]=_[_0x74a7('0x35')](_0x4fc65b['model'],_0x4fc65b[_0x74a7('0x32')]);_0x168d20[_0x74a7('0x36')]=_[_0x74a7('0x35')](_0x4fc65b[_0x74a7('0x31')],qs[_0x74a7('0x37')](_0x25fc1d['query']['fields']));_0x168d20['attributes']=_0x168d20[_0x74a7('0x36')]['length']?_0x168d20[_0x74a7('0x36')]:_0x4fc65b[_0x74a7('0x31')];if(!_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x38')]('nolimit')){_0x168d20[_0x74a7('0x1c')]=qs[_0x74a7('0x1c')](_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x1c')]);_0x168d20['offset']=qs['offset'](_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x1b')]);}_0x168d20[_0x74a7('0x39')]=qs['sort'](_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x3a')]);_0x168d20[_0x74a7('0x3b')]=qs[_0x74a7('0x34')](_[_0x74a7('0x3c')](_0x25fc1d[_0x74a7('0x32')],_0x4fc65b['filters']),_0x343280);if(_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x3d')]){_0x168d20[_0x74a7('0x3b')]=_[_0x74a7('0x3e')](_0x168d20[_0x74a7('0x3b')],{'$or':_['map'](_0x343280,function(_0x3ec2d3){if(_0x3ec2d3[_0x74a7('0x2f')]!==_0x74a7('0x3f')){var _0xef1406={};_0xef1406[_0x3ec2d3[_0x74a7('0x28')]]={'$like':'%'+_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x3d')]+'%'};return _0xef1406;}})});}_0x168d20=_['merge']({},_0x168d20,_0x25fc1d[_0x74a7('0x40')]);var _0xd7d73d={'where':_0x168d20[_0x74a7('0x3b')]};return db[_0x74a7('0x2c')][_0x74a7('0x1d')](_0xd7d73d)[_0x74a7('0x25')](function(_0x473726){_0xb0183b[_0x74a7('0x1d')]=_0x473726;if(_0x25fc1d[_0x74a7('0x32')][_0x74a7('0x41')]){_0x168d20[_0x74a7('0x42')]=[{'all':!![]}];}return db[_0x74a7('0x2c')][_0x74a7('0x43')](_0x168d20);})[_0x74a7('0x25')](function(_0x45b5b1){_0xb0183b[_0x74a7('0x44')]=_0x45b5b1;return _0xb0183b;})[_0x74a7('0x25')](respondWithFilteredResult(_0x4d510b,_0x168d20))[_0x74a7('0x45')](handleError(_0x4d510b,null));};exports[_0x74a7('0x46')]=function(_0x4e7640,_0x18b66f){var _0x434c83={'raw':!![],'where':{'id':_0x4e7640[_0x74a7('0x47')]['id']}},_0x5e35a8={};_0x5e35a8[_0x74a7('0x31')]=_[_0x74a7('0x33')](db[_0x74a7('0x2c')][_0x74a7('0x2d')]);_0x5e35a8[_0x74a7('0x32')]=_[_0x74a7('0x33')](_0x4e7640['query']);_0x5e35a8[_0x74a7('0x34')]=_[_0x74a7('0x35')](_0x5e35a8[_0x74a7('0x31')],_0x5e35a8[_0x74a7('0x32')]);_0x434c83[_0x74a7('0x36')]=_[_0x74a7('0x35')](_0x5e35a8[_0x74a7('0x31')],qs[_0x74a7('0x37')](_0x4e7640['query']['fields']));_0x434c83[_0x74a7('0x36')]=_0x434c83['attributes'][_0x74a7('0x48')]?_0x434c83[_0x74a7('0x36')]:_0x5e35a8[_0x74a7('0x31')];if(_0x4e7640['query']['includeAll']){_0x434c83[_0x74a7('0x42')]=[{'all':!![]}];}_0x434c83=_[_0x74a7('0x3e')]({},_0x434c83,_0x4e7640['options']);return db[_0x74a7('0x2c')][_0x74a7('0x49')](_0x434c83)[_0x74a7('0x25')](handleEntityNotFound(_0x18b66f,null))[_0x74a7('0x25')](respondWithResult(_0x18b66f,null))[_0x74a7('0x45')](handleError(_0x18b66f,null));};exports[_0x74a7('0x4a')]=function(_0x349cb8,_0x177de8){var _0x6321ad={'where':{'id':_0x349cb8[_0x74a7('0x47')]['id']}},_0x5c3fe6={};_0x5c3fe6['model']=_[_0x74a7('0x33')](db[_0x74a7('0x2c')]['rawAttributes']);_0x6321ad[_0x74a7('0x36')]=_['intersection'](_0x5c3fe6[_0x74a7('0x31')],qs[_0x74a7('0x37')](_0x349cb8['query'][_0x74a7('0x37')]));_0x6321ad['attributes']=_0x6321ad[_0x74a7('0x36')][_0x74a7('0x48')]?_0x6321ad[_0x74a7('0x36')]:_0x5c3fe6[_0x74a7('0x31')];if(_0x349cb8[_0x74a7('0x32')][_0x74a7('0x41')]){_0x6321ad['include']=[{'all':!![]}];}_0x6321ad=_[_0x74a7('0x3e')]({},_0x6321ad,_0x349cb8[_0x74a7('0x40')]);return db[_0x74a7('0x2c')][_0x74a7('0x49')](_0x6321ad)[_0x74a7('0x25')](handleEntityNotFound(_0x177de8,null))[_0x74a7('0x25')](function(_0x390fd8){if(_0x390fd8){var _0x5f04c0=_0x390fd8[_0x74a7('0x4b')]({'plain':!![]});_0x5f04c0=qs[_0x74a7('0x4c')](_0x5f04c0,['id',_0x74a7('0x4d'),_0x74a7('0x4e')]);_0x349cb8[_0x74a7('0x4f')]=_[_0x74a7('0x4c')](_0x349cb8[_0x74a7('0x4f')],['id',_0x74a7('0x4d'),_0x74a7('0x4e')]);return db['Attachment'][_0x74a7('0x50')](_['merge'](_0x5f04c0,_0x349cb8[_0x74a7('0x4f')]),{'include':_0x349cb8['query'][_0x74a7('0x41')]?[{'all':!![]}]:undefined});}})[_0x74a7('0x25')](respondWithResult(_0x177de8,0xc9))[_0x74a7('0x45')](handleError(_0x177de8,null));};exports['update']=function(_0x48ae00,_0x17bed7){if(_0x48ae00['body']['id']){delete _0x48ae00[_0x74a7('0x4f')]['id'];}return db[_0x74a7('0x2c')][_0x74a7('0x49')]({'where':{'id':_0x48ae00['params']['id']}})['then'](handleEntityNotFound(_0x17bed7,null))[_0x74a7('0x25')](saveUpdates(_0x48ae00[_0x74a7('0x4f')],null))[_0x74a7('0x25')](respondWithResult(_0x17bed7,null))['catch'](handleError(_0x17bed7,null));};exports['destroy']=function(_0x3baaea,_0x2478d9){return db[_0x74a7('0x2c')][_0x74a7('0x49')]({'where':{'id':_0x3baaea[_0x74a7('0x47')]['id']}})[_0x74a7('0x25')](handleEntityNotFound(_0x2478d9,null))[_0x74a7('0x25')](removeEntity(_0x2478d9,null))[_0x74a7('0x45')](handleError(_0x2478d9,null));};exports['create']=function(_0x338fee,_0x5b5d2e,_0xeb6969){_0x338fee[_0x74a7('0x4f')]['name']=_0x338fee[_0x74a7('0x51')][_0x74a7('0x52')];_0x338fee['body']['basename']=_0x338fee[_0x74a7('0x51')]['filename'];_0x338fee[_0x74a7('0x4f')]['type']=_0x338fee[_0x74a7('0x51')][_0x74a7('0x53')];return db[_0x74a7('0x2c')][_0x74a7('0x50')](_0x338fee[_0x74a7('0x4f')])[_0x74a7('0x25')](respondWithResult(_0x5b5d2e,0xc9))[_0x74a7('0x45')](handleError(_0x5b5d2e,null));};exports[_0x74a7('0x54')]=function(_0x2901ca,_0x2dc12c,_0x301d25){return db[_0x74a7('0x2c')][_0x74a7('0x55')]({'where':{'id':_0x2901ca[_0x74a7('0x47')]['id']},'raw':!![]})[_0x74a7('0x25')](handleEntityNotFound(_0x2dc12c,null))[_0x74a7('0x25')](function(_0x4e261f){if(_0x4e261f){var _0x33b67d=_0x4e261f['ChatOfflineMessageId']!==null;var _0x7770de=path['join'](config['root'],_0x74a7('0x56'));if(_0x33b67d){_0x7770de=path[_0x74a7('0x57')](_0x7770de,_0x74a7('0x58'));}var _0x76a634=path['join'](_0x7770de,_0x4e261f[_0x74a7('0x59')]);return _0x2dc12c['download'](_0x76a634);}})[_0x74a7('0x45')](handleError(_0x2dc12c,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index c9e6788..74fec92 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 _0xcfd2=['../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x653b0c,_0x216511){var _0x4867a9=function(_0x505469){while(--_0x505469){_0x653b0c['push'](_0x653b0c['shift']());}};_0x4867a9(++_0x216511);}(_0xcfd2,0x149));var _0x2cfd=function(_0x367861,_0x4622ea){_0x367861=_0x367861-0x0;var _0x5e7614=_0xcfd2[_0x367861];return _0x5e7614;};'use strict';var _=require(_0x2cfd('0x0'));var util=require('util');var logger=require(_0x2cfd('0x1'))(_0x2cfd('0x2'));var moment=require(_0x2cfd('0x3'));var BPromise=require(_0x2cfd('0x4'));var rp=require(_0x2cfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cfd('0x6'));var config=require(_0x2cfd('0x7'));var attributes=require(_0x2cfd('0x8'));module[_0x2cfd('0x9')]=function(_0x373b2e,_0x72f04c){return _0x373b2e['define'](_0x2cfd('0xa'),attributes,{'tableName':_0x2cfd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa75b=['rimraf','../../config/environment','./attachment.attributes','exports','Attachment','util','../../config/logger','api','moment','bluebird','path'];(function(_0xbb4f8a,_0x14e64c){var _0x2585af=function(_0x396911){while(--_0x396911){_0xbb4f8a['push'](_0xbb4f8a['shift']());}};_0x2585af(++_0x14e64c);}(_0xa75b,0x1f4));var _0xba75=function(_0x57d8e7,_0x2ba050){_0x57d8e7=_0x57d8e7-0x0;var _0x2b0143=_0xa75b[_0x57d8e7];return _0x2b0143;};'use strict';var _=require('lodash');var util=require(_0xba75('0x0'));var logger=require(_0xba75('0x1'))(_0xba75('0x2'));var moment=require(_0xba75('0x3'));var BPromise=require(_0xba75('0x4'));var rp=require('request-promise');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(_0xc4d78a,_0x3931b4){return _0xc4d78a['define'](_0xba75('0xa'),attributes,{'tableName':'attachments','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 f462639..dbfb941 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 _0x81d5=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x484473,_0x5768b1){var _0x67551f=function(_0x5cae9c){while(--_0x5cae9c){_0x484473['push'](_0x484473['shift']());}};_0x67551f(++_0x5768b1);}(_0x81d5,0x1ab));var _0x581d=function(_0x5a834b,_0x1650f4){_0x5a834b=_0x5a834b-0x0;var _0xc863ef=_0x81d5[_0x5a834b];return _0xc863ef;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});}; \ No newline at end of file +var _0xd2ea=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x45a783,_0x573bb5){var _0x33f2f0=function(_0x1c5d47){while(--_0x1c5d47){_0x45a783['push'](_0x45a783['shift']());}};_0x33f2f0(++_0x573bb5);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4b1df0,_0x5de6ef){_0x4b1df0=_0x4b1df0-0x0;var _0xf89763=_0xd2ea[_0x4b1df0];return _0xf89763;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});}exports[_0xad2e('0x18')]=function(_0x34f946){var _0x1b4889=this;return new Promise(function(_0x163e83,_0x4ef16f){return db[_0xad2e('0x19')][_0xad2e('0x1a')](_0x34f946['body'],{'raw':_0x34f946['options']?_0x34f946['options']['raw']===undefined?!![]:![]:!![]})[_0xad2e('0x1b')](function(_0x293adc){logger[_0xad2e('0x15')](_0xad2e('0x18'),_0x34f946);logger[_0xad2e('0xf')](_0xad2e('0x18'),_0x34f946,JSON[_0xad2e('0x11')](_0x293adc));_0x163e83(_0x293adc);})[_0xad2e('0x17')](function(_0x102169){logger[_0xad2e('0x12')](_0xad2e('0x18'),_0x102169[_0xad2e('0x14')],_0x34f946);_0x4ef16f(_0x1b4889[_0xad2e('0x12')](0x1f4,_0x102169[_0xad2e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index e94cc32..b1f0d6e 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 _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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44e4e1,_0x5637b2){_0x44e4e1=_0x44e4e1-0x0;var _0x300cd2=_0x0b0e[_0x44e4e1];return _0x300cd2;};'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 +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5f3ee8,_0x169605){var _0x1d6088=function(_0x2bc78c){while(--_0x2bc78c){_0x5f3ee8['push'](_0x5f3ee8['shift']());}};_0x1d6088(++_0x169605);}(_0xb10b,0x12a));var _0xbb10=function(_0x4969d0,_0x4a5788){_0x4969d0=_0x4969d0-0x0;var _0x754944=_0xb10b[_0x4969d0];return _0x754944;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index dffe1d7..3100e54 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 _0x8fbe=['user','agent','domain','disabled','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','online','admin'];(function(_0x13607c,_0x4f87c0){var _0x388a30=function(_0x12a294){while(--_0x12a294){_0x13607c['push'](_0x13607c['shift']());}};_0x388a30(++_0x4f87c0);}(_0x8fbe,0xd7));var _0xe8fb=function(_0xe1f125,_0x1d8c4e){_0xe1f125=_0xe1f125-0x0;var _0x15e74f=_0x8fbe[_0xe1f125];return _0x15e74f;};'use strict';var passport=require(_0xe8fb('0x0'));var LocalStrategy=require(_0xe8fb('0x1'))[_0xe8fb('0x2')];var moment=require(_0xe8fb('0x3'));var ActiveDirectory=require(_0xe8fb('0x4'));var BPromise=require(_0xe8fb('0x5'));var util=require(_0xe8fb('0x6'));var db=require(_0xe8fb('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe8fb('0x8'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x217923){var _0x238d91=![];if(typeof _0x217923[_0xe8fb('0x9')]!=='undefined'){_0x238d91=_0x217923[_0xe8fb('0x9')][_0xe8fb('0xa')]&&_0x217923['activedirectory'][_0xe8fb('0xb')]&&_0x217923[_0xe8fb('0x9')]['domain'];}return _0x238d91;}function adAuthenticate(_0x31a64c,_0x1ef867,_0x2f8d07){return new BPromise(function(_0x243662,_0x573160){try{var _0x375f3d=new ActiveDirectory(_0x31a64c);_0x375f3d[_0xe8fb('0xc')](_0x1ef867,_0x2f8d07,function(_0x57210c,_0x3db029){if(_0x57210c){logger[_0xe8fb('0xd')](_0xe8fb('0xe'),_0x1ef867,util[_0xe8fb('0xf')](_0x57210c,{'showHidden':![],'depth':null}));_0x573160(_0xe8fb('0x10'));}else if(!_0x3db029){logger[_0xe8fb('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x1ef867);_0x573160('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x243662(_0x3db029);}});}catch(_0x36bdd0){_0x573160(_0x36bdd0);}});}function ActiveDirectoryAuthenticate(_0x2946b0,_0x1ecc50,_0x3341c2,_0x59d0be){var _0x1d266d,_0x5079b1;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe8fb('0x11'),_0x1ecc50);return _0x59d0be(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe8fb('0x12')][_0xe8fb('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xe8fb('0x14')],'raw':!![]})[_0xe8fb('0x15')](function(_0x5cfd1d){_0x1d266d=_0x5cfd1d;if(!_0x1d266d[_0xe8fb('0x16')]){logger[_0xe8fb('0xd')](_0xe8fb('0x17'),_0x1ecc50);throw new Error(_0xe8fb('0x10'));}return _0x2946b0[_0xe8fb('0x13')]({'attributes':['id',_0xe8fb('0x18'),_0xe8fb('0x19'),_0xe8fb('0x1a'),_0xe8fb('0x1b'),'disabled','blocked','blockedAt',_0xe8fb('0x1c')],'where':{'name':_0x1ecc50,'role':{'$or':[_0xe8fb('0x1d'),_0xe8fb('0x1e'),_0xe8fb('0x1f')]},'adSsoEnabled':!![]}});})[_0xe8fb('0x15')](function(_0x19fba5){if(!_0x19fba5||_0x19fba5&&_0x19fba5[_0xe8fb('0x18')]!==_0x1ecc50){throw new Error(_0xe8fb('0x10'));}_0x5079b1=_0x19fba5;var _0x17f32f=_0x5079b1['name']+'@'+config[_0xe8fb('0x9')][_0xe8fb('0x20')];return adAuthenticate(config[_0xe8fb('0x9')],_0x17f32f,_0x3341c2);})[_0xe8fb('0x15')](function(_0x48385b){if(_0x5079b1[_0xe8fb('0x21')]){throw new Error(_0xe8fb('0x10'));}if(_0x1d266d[_0xe8fb('0x14')]>0x0){if(_0x5079b1[_0xe8fb('0x22')]){if(moment(_0x5079b1[_0xe8fb('0x23')])[_0xe8fb('0x24')](_0x1d266d[_0xe8fb('0x14')],_0xe8fb('0x25'))>moment()){throw new Error(_0xe8fb('0x10'));}return utils[_0xe8fb('0x26')](_0x5079b1,0x0,![],null)[_0xe8fb('0x15')](function(){return utils[_0xe8fb('0x27')](_0x5079b1);})[_0xe8fb('0x15')](function(){return _0x59d0be(null,_0x5079b1);});}else{return utils[_0xe8fb('0x27')](_0x5079b1)[_0xe8fb('0x15')](function(){return _0x59d0be(null,_0x5079b1);});}}else{return utils['getLicense'](_0x5079b1)[_0xe8fb('0x15')](function(){return _0x59d0be(null,_0x5079b1);});}})[_0xe8fb('0x28')](function(_0xdfefd2){return _0x59d0be(null,![],_0xdfefd2);});}function handleError(_0x45df94,_0x49c7a5,_0x15f51f){return _0x45df94[_0xe8fb('0x29')](_0x49c7a5||0x1f4)['send']({'message':_0x15f51f?_0x15f51f[_0xe8fb('0x2a')]||_0x15f51f:''});}exports[_0xe8fb('0x2b')]=function(_0x3a88dd,_0x3305c1,_0x5238f3){passport[_0xe8fb('0xc')](_0xe8fb('0x2c'),function(_0x5a4069,_0x73e836,_0x1752cd){var _0x20ebcc=_0x5a4069||_0x1752cd;if(_0x20ebcc){return handleError(_0x3305c1,0x191,_0x20ebcc);}if(!_0x73e836){return handleError(_0x3305c1,0x194,{'message':_0xe8fb('0x2d')});}else{var _0x2a24c7={'payload':{'id':_0x73e836['id'],'role':_0x73e836[_0xe8fb('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2a24c7)['then'](function(_0x11749c){_0x3305c1[_0xe8fb('0x2e')]({'id':_0x73e836['id'],'token':_0x11749c,'statusCall':'','isAlreadyLogged':_0x73e836[_0xe8fb('0x1c')]});});}})(_0x3a88dd,_0x3305c1,_0x5238f3);};passport[_0xe8fb('0x2f')](_0xe8fb('0x2c'),new LocalStrategy({'usernameField':_0xe8fb('0x18'),'passwordField':_0xe8fb('0x19')},function(_0x35192a,_0x23f1b6,_0x3b441e){return ActiveDirectoryAuthenticate(db[_0xe8fb('0x30')],_0x35192a,_0x23f1b6,_0x3b441e);})); \ No newline at end of file +var _0x975b=['api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','findOne','password','role','disabled','blocked','blockedAt','online','admin','user','agent','name','blockDuration','add','minutes','getLicense','then','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','activedirectory2','bluebird','../../mysqldb','../../components/auth/service'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x975b,0x12e));var _0xb975=function(_0x5344a9,_0x2d7719){_0x5344a9=_0x5344a9-0x0;var _0x131dd5=_0x975b[_0x5344a9];return _0x131dd5;};'use strict';var passport=require(_0xb975('0x0'));var LocalStrategy=require(_0xb975('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xb975('0x2'));var BPromise=require(_0xb975('0x3'));var util=require('util');var db=require(_0xb975('0x4'))['db'];var authService=require(_0xb975('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0xb975('0x6'));function isActiveDirectoryConfigured(_0x273395){var _0x311f05=![];if(typeof _0x273395[_0xb975('0x7')]!==_0xb975('0x8')){_0x311f05=_0x273395[_0xb975('0x7')][_0xb975('0x9')]&&_0x273395['activedirectory'][_0xb975('0xa')]&&_0x273395['activedirectory']['domain'];}return _0x311f05;}function adAuthenticate(_0x2eba2b,_0x5e4aeb,_0x118aed){return new BPromise(function(_0x19a888,_0x109dd3){try{var _0x29fdd6=new ActiveDirectory(_0x2eba2b);_0x29fdd6[_0xb975('0xb')](_0x5e4aeb,_0x118aed,function(_0x39866c,_0x451697){if(_0x39866c){logger[_0xb975('0xc')](_0xb975('0xd'),_0x5e4aeb,util['inspect'](_0x39866c,{'showHidden':![],'depth':null}));_0x109dd3(_0xb975('0xe'));}else if(!_0x451697){logger[_0xb975('0xc')](_0xb975('0xf'),_0x5e4aeb);_0x109dd3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x19a888(_0x451697);}});}catch(_0x2316a3){_0x109dd3(_0x2316a3);}});}function ActiveDirectoryAuthenticate(_0x33eb87,_0x21cf05,_0x300a7f,_0x1dc991){var _0x97f591,_0x3076fc;if(!isActiveDirectoryConfigured(config)){logger[_0xb975('0xc')](_0xb975('0x10'),_0x21cf05);return _0x1dc991(null,![],{'message':_0xb975('0xe')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xb975('0x11'),'blockDuration'],'raw':!![]})['then'](function(_0x4280ee){_0x97f591=_0x4280ee;if(!_0x97f591[_0xb975('0x11')]){logger[_0xb975('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x21cf05);throw new Error(_0xb975('0xe'));}return _0x33eb87[_0xb975('0x12')]({'attributes':['id','name',_0xb975('0x13'),'salt',_0xb975('0x14'),_0xb975('0x15'),_0xb975('0x16'),_0xb975('0x17'),_0xb975('0x18')],'where':{'name':_0x21cf05,'role':{'$or':[_0xb975('0x19'),_0xb975('0x1a'),_0xb975('0x1b')]},'adSsoEnabled':!![]}});})['then'](function(_0x38c530){if(!_0x38c530||_0x38c530&&_0x38c530[_0xb975('0x1c')]!==_0x21cf05){throw new Error(_0xb975('0xe'));}_0x3076fc=_0x38c530;var _0x31835f=_0x3076fc[_0xb975('0x1c')]+'@'+config[_0xb975('0x7')]['domain'];return adAuthenticate(config[_0xb975('0x7')],_0x31835f,_0x300a7f);})['then'](function(_0x66b7ea){if(_0x3076fc[_0xb975('0x15')]){throw new Error(_0xb975('0xe'));}if(_0x97f591[_0xb975('0x1d')]>0x0){if(_0x3076fc[_0xb975('0x16')]){if(moment(_0x3076fc[_0xb975('0x17')])[_0xb975('0x1e')](_0x97f591[_0xb975('0x1d')],_0xb975('0x1f'))>moment()){throw new Error(_0xb975('0xe'));}return utils['clearBlockUser'](_0x3076fc,0x0,![],null)['then'](function(){return utils['getLicense'](_0x3076fc);})['then'](function(){return _0x1dc991(null,_0x3076fc);});}else{return utils[_0xb975('0x20')](_0x3076fc)[_0xb975('0x21')](function(){return _0x1dc991(null,_0x3076fc);});}}else{return utils[_0xb975('0x20')](_0x3076fc)[_0xb975('0x21')](function(){return _0x1dc991(null,_0x3076fc);});}})[_0xb975('0x22')](function(_0x595fcb){return _0x1dc991(null,![],_0x595fcb);});}function handleError(_0x428527,_0x17c401,_0x16f297){return _0x428527[_0xb975('0x23')](_0x17c401||0x1f4)['send']({'message':_0x16f297?_0x16f297[_0xb975('0x24')]||_0x16f297:''});}exports[_0xb975('0x25')]=function(_0x1f4814,_0x318141,_0x34ae65){passport[_0xb975('0xb')](_0xb975('0x26'),function(_0x413cec,_0x18ba84,_0x274ed6){var _0xc78d56=_0x413cec||_0x274ed6;if(_0xc78d56){return handleError(_0x318141,0x191,_0xc78d56);}if(!_0x18ba84){return handleError(_0x318141,0x194,{'message':_0xb975('0x27')});}else{var _0x3b792e={'payload':{'id':_0x18ba84['id'],'role':_0x18ba84[_0xb975('0x14')]},'options':{'expiresIn':0x15180}};return authService[_0xb975('0x28')](_0x3b792e)[_0xb975('0x21')](function(_0x379aa1){_0x318141[_0xb975('0x29')]({'id':_0x18ba84['id'],'token':_0x379aa1,'statusCall':'','isAlreadyLogged':_0x18ba84[_0xb975('0x18')]});});}})(_0x1f4814,_0x318141,_0x34ae65);};passport[_0xb975('0x2a')](_0xb975('0x26'),new LocalStrategy({'usernameField':_0xb975('0x1c'),'passwordField':_0xb975('0x13')},function(_0x4b937d,_0x5020d6,_0x59b133){return ActiveDirectoryAuthenticate(db[_0xb975('0x2b')],_0x4b937d,_0x5020d6,_0x59b133);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 301f1cc..1355e33 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 _0x28c4=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x28c4,0xc9));var _0x428c=function(_0x3b247d,_0xbe4218){_0x3b247d=_0x3b247d-0x0;var _0x131bcf=_0x28c4[_0x3b247d];return _0x131bcf;};'use strict';var express=require(_0x428c('0x0'));var router=express[_0x428c('0x1')]();var controller=require(_0x428c('0x2'));router[_0x428c('0x3')]('/',controller[_0x428c('0x4')]);module[_0x428c('0x5')]=router; \ No newline at end of file +var _0xb8c8=['./authActiveDirectory.controller','post','exports','express','Router'];(function(_0x205a6b,_0x27e255){var _0x44fd46=function(_0x410d18){while(--_0x410d18){_0x205a6b['push'](_0x205a6b['shift']());}};_0x44fd46(++_0x27e255);}(_0xb8c8,0xa3));var _0x8b8c=function(_0x4e0d7f,_0xa13b87){_0x4e0d7f=_0x4e0d7f-0x0;var _0x16dc4d=_0xb8c8[_0x4e0d7f];return _0x16dc4d;};'use strict';var express=require(_0x8b8c('0x0'));var router=express[_0x8b8c('0x1')]();var controller=require(_0x8b8c('0x2'));router[_0x8b8c('0x3')]('/',controller['login']);module[_0x8b8c('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 3b5dbaf..e381aee 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4aa25e,_0x58c68b){var _0x36dea5=function(_0xcb3ffe){while(--_0xcb3ffe){_0x4aa25e['push'](_0x4aa25e['shift']());}};_0x36dea5(++_0x58c68b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x2bc166,_0x5a2bcc){_0x2bc166=_0x2bc166-0x0;var _0x36ab1c=_0x7a54[_0x2bc166];return _0x36ab1c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 64098d5..a6adabb 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 _0xc59c=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback'];(function(_0x3f88f7,_0x28a354){var _0x517762=function(_0x1945cc){while(--_0x1945cc){_0x3f88f7['push'](_0x3f88f7['shift']());}};_0x517762(++_0x28a354);}(_0xc59c,0x72));var _0xcc59=function(_0x1d66e2,_0x195dc7){_0x1d66e2=_0x1d66e2-0x0;var _0x3765d0=_0xc59c[_0x1d66e2];return _0x3765d0;};'use strict';var express=require(_0xcc59('0x0'));var passport=require(_0xcc59('0x1'));var router=express[_0xcc59('0x2')]();var controller=require(_0xcc59('0x3'));var userController=require(_0xcc59('0x4'));var authService=require('../../components/auth/service');router[_0xcc59('0x5')]('/',controller['login']);router[_0xcc59('0x5')](_0xcc59('0x6'),controller[_0xcc59('0x7')],authService[_0xcc59('0x8')],userController['login'],authService[_0xcc59('0x9')]);module[_0xcc59('0xa')]=router; \ No newline at end of file +var _0xc2c8=['login','/callback','isMiddleware','setTokenCookie','express','passport','Router','../user/user.controller.js','../../components/auth/service','get'];(function(_0x184308,_0x26b4d8){var _0x4fb503=function(_0x487772){while(--_0x487772){_0x184308['push'](_0x184308['shift']());}};_0x4fb503(++_0x26b4d8);}(_0xc2c8,0x1e4));var _0x8c2c=function(_0x12249a,_0x395f7a){_0x12249a=_0x12249a-0x0;var _0x55321d=_0xc2c8[_0x12249a];return _0x55321d;};'use strict';var express=require(_0x8c2c('0x0'));var passport=require(_0x8c2c('0x1'));var router=express[_0x8c2c('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x8c2c('0x3'));var authService=require(_0x8c2c('0x4'));router[_0x8c2c('0x5')]('/',controller[_0x8c2c('0x6')]);router['get'](_0x8c2c('0x7'),controller['callback'],authService[_0x8c2c('0x8')],userController[_0x8c2c('0x6')],authService[_0x8c2c('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d0fd420..dfafa13 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 _0x0789=['body','Email\x20parameter\x20is\x20missing','generate','trim','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','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','password','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','Smtp','format','error','message','stringify','send','login','local-login','signToken','json','forgot'];(function(_0x114ae0,_0x4360e4){var _0x56c6cf=function(_0x4ae643){while(--_0x4ae643){_0x114ae0['push'](_0x114ae0['shift']());}};_0x56c6cf(++_0x4360e4);}(_0x0789,0x16d));var _0x9078=function(_0x5a0cba,_0x1f3f93){_0x5a0cba=_0x5a0cba-0x0;var _0x20cc1c=_0x0789[_0x5a0cba];return _0x20cc1c;};'use strict';var util=require(_0x9078('0x0'));var passport=require(_0x9078('0x1'));var LocalStrategy=require(_0x9078('0x2'))[_0x9078('0x3')];var jayson=require('jayson/promise');var _=require(_0x9078('0x4'));var rs=require(_0x9078('0x5'));var moment=require(_0x9078('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x9078('0x7'));var utils=require(_0x9078('0x8'));var client=jayson[_0x9078('0x9')][_0x9078('0xa')]({'port':0x232b});function localAuthenticate(_0x56b1b9,_0x447474,_0x236cd9,_0x51336d){var _0x2af3b0,_0x2fb39c;return db[_0x9078('0xb')][_0x9078('0xc')]({'where':{'id':0x1},'attributes':[_0x9078('0xd'),_0x9078('0xe')],'raw':!![]})[_0x9078('0xf')](function(_0x43273d){_0x2af3b0=_0x43273d;return _0x56b1b9[_0x9078('0xc')]({'attributes':['id',_0x9078('0x10'),'password',_0x9078('0x11'),'role',_0x9078('0x12'),_0x9078('0x13'),_0x9078('0x14'),_0x9078('0x15')],'where':{'name':_0x447474,'role':{'$or':[_0x9078('0x16'),_0x9078('0x17'),_0x9078('0x18')]}}});})[_0x9078('0xf')](function(_0x295af8){if(!_0x295af8||_0x295af8&&_0x295af8[_0x9078('0x10')]!==_0x447474){throw new Error(_0x9078('0x19'));}else{_0x2fb39c=_0x295af8;return _0x2fb39c;}})[_0x9078('0xf')](function(){_0x2fb39c[_0x9078('0x1a')](_0x236cd9,function(_0x749159,_0x43581d){var _0x10073c=_0x2fb39c[_0x9078('0x15')]+0x1;if(_0x749159){return _0x51336d(_0x749159);}else if(!_0x43581d){if(_0x2fb39c[_0x9078('0x12')]){return _0x51336d(null,![],{'message':_0x9078('0x19')});}else if(_0x2af3b0[_0x9078('0xd')]>0x0){if(_0x2fb39c[_0x9078('0x13')]){if(_0x2af3b0[_0x9078('0xe')]>0x0){if(moment(_0x2fb39c[_0x9078('0x14')])[_0x9078('0x1b')](_0x2af3b0[_0x9078('0xe')],_0x9078('0x1c'))>moment()){return _0x51336d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9078('0x1d')](_0x2fb39c,_0x10073c,![],null)[_0x9078('0xf')](function(){return _0x51336d(null,![],{'message':_0x9078('0x19')});});}}else{return _0x51336d(null,![],{'message':_0x9078('0x19')});}}else{if(_0x10073c>=_0x2af3b0[_0x9078('0xd')]){return utils[_0x9078('0x1d')](_0x2fb39c,0x0,!![],moment())[_0x9078('0xf')](function(){return _0x51336d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9078('0x1d')](_0x2fb39c,_0x10073c,![],null)[_0x9078('0xf')](function(){return _0x51336d(null,![],{'message':_0x9078('0x19')});});}}}else{return _0x51336d(null,![],{'message':_0x9078('0x19')});}}else{if(_0x2fb39c[_0x9078('0x12')]){return _0x51336d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2af3b0[_0x9078('0xd')]>0x0){if(_0x2fb39c[_0x9078('0x13')]){if(_0x2af3b0[_0x9078('0xe')]>0x0){if(moment(_0x2fb39c[_0x9078('0x14')])['add'](_0x2af3b0[_0x9078('0xe')],_0x9078('0x1c'))>moment()){return _0x51336d(null,![],{'message':_0x9078('0x19')});}else{return utils[_0x9078('0x1d')](_0x2fb39c,0x0,![],null)['then'](function(){return utils[_0x9078('0x1e')](_0x2fb39c);})[_0x9078('0xf')](function(){return _0x51336d(null,_0x2fb39c);});}}else{return _0x51336d(null,![],{'message':_0x9078('0x19')});}}else{return utils['clearBlockUser'](_0x2fb39c,0x0,![],null)['then'](function(){return utils[_0x9078('0x1e')](_0x2fb39c);})[_0x9078('0xf')](function(){return _0x51336d(null,_0x2fb39c);})[_0x9078('0x1f')](function(_0x15074e){return _0x51336d(null,![],_0x15074e);});}}else{if(_0x2fb39c[_0x9078('0x13')]){return _0x51336d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x2fb39c)[_0x9078('0xf')](function(){return _0x51336d(null,_0x2fb39c);});}}}});})[_0x9078('0x1f')](function(_0x4c0bae){return _0x51336d(null,![],_0x4c0bae);});}function sendServiceMail(_0x38daea){return db['MailAccount'][_0x9078('0x20')]({'where':{'service':!![]},'attributes':['id',_0x9078('0x10'),_0x9078('0x21')],'include':[{'model':db[_0x9078('0x22')],'as':'Smtp','include':[{'model':db[_0x9078('0x23')],'as':_0x9078('0x23')}]}]})['then'](function(_0x1c88d7){if(!_0x1c88d7){throw new Error(_0x9078('0x24'));}var _0x280bcb=_0x1c88d7[_0x9078('0x25')]();var _0x5b14b9={'account':_0x280bcb,'message':_['merge']({'from':util['format'](_0x9078('0x26'),_0x1c88d7[_0x9078('0x10')],_0x1c88d7[_0x9078('0x21')]||_0x1c88d7[_0x9078('0x27')][_0x9078('0x17')])},_0x38daea)};return client['request']('SendMail',_0x5b14b9);})[_0x9078('0xf')](function(_0x507d7e){if(_0x507d7e['error']){throw new Error(util[_0x9078('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x507d7e[_0x9078('0x29')][_0x9078('0x2a')]||JSON[_0x9078('0x2b')](_0x507d7e['error'])));}return!![];});}function handleError(_0x57e6e5,_0xba6c56,_0x3e7974){return _0x57e6e5['status'](_0xba6c56||0x1f4)[_0x9078('0x2c')]({'message':_0x3e7974?_0x3e7974[_0x9078('0x2a')]||_0x3e7974:''});}exports[_0x9078('0x2d')]=function(_0x420d62,_0x15ea87,_0x5ba458){passport[_0x9078('0x1a')](_0x9078('0x2e'),function(_0x2a96a0,_0x4bd363,_0x294c1f){var _0x40c6b8=_0x2a96a0||_0x294c1f;if(_0x40c6b8){return handleError(_0x15ea87,0x191,_0x40c6b8);}if(!_0x4bd363){return handleError(_0x15ea87,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x50fe75={'payload':{'id':_0x4bd363['id'],'role':_0x4bd363['role']},'options':{'expiresIn':0x15180}};return authService[_0x9078('0x2f')](_0x50fe75)[_0x9078('0xf')](function(_0x4c855c){_0x15ea87[_0x9078('0x30')]({'id':_0x4bd363['id'],'token':_0x4c855c,'statusCall':'','isAlreadyLogged':_0x4bd363['online']});});}})(_0x420d62,_0x15ea87,_0x5ba458);};exports[_0x9078('0x31')]=function(_0x2b4025,_0x51a83d){if(!_0x2b4025[_0x9078('0x32')][_0x9078('0x21')]){return handleError(_0x51a83d,0x1f4,{'message':_0x9078('0x33')});}var _0x2dae95=rs[_0x9078('0x34')]();_0x2b4025[_0x9078('0x32')][_0x9078('0x21')]=_0x2b4025[_0x9078('0x32')][_0x9078('0x21')][_0x9078('0x35')]()['toLowerCase']();var _0x4610c8;return db[_0x9078('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9078('0xe')],'raw':!![]})[_0x9078('0xf')](function(_0x3f598f){_0x4610c8=_0x3f598f;return db['User'][_0x9078('0x20')]({'where':{'email':_0x2b4025[_0x9078('0x32')][_0x9078('0x21')]}});})[_0x9078('0xf')](function(_0x5b9a7e){if(!_0x5b9a7e){throw new Error(_0x9078('0x36'));}if(_0x5b9a7e[_0x9078('0x12')]){throw new Error(_0x9078('0x37'));}if(_0x5b9a7e[_0x9078('0x13')]){if(moment(_0x5b9a7e[_0x9078('0x14')])[_0x9078('0x1b')](_0x4610c8[_0x9078('0xe')],_0x9078('0x1c'))>moment()){throw new Error(_0x9078('0x38'));}else{_0x5b9a7e[_0x9078('0x13')]=![];_0x5b9a7e[_0x9078('0x14')]=null;}}_0x5b9a7e[_0x9078('0x39')]=_0x2dae95;_0x5b9a7e[_0x9078('0x3a')]=Date[_0x9078('0x3b')]()+0x36ee80;return _0x5b9a7e[_0x9078('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x2b4025[_0x9078('0x32')][_0x9078('0x21')],'subject':_0x9078('0x3d'),'text':_0x9078('0x3e')+_0x9078('0x3f')+_0x9078('0x40')+_0x2b4025[_0x9078('0x41')][_0x9078('0x42')]+_0x9078('0x43')+_0x2dae95+'\x0a\x0a'+_0x9078('0x44')});})[_0x9078('0xf')](function(){_0x51a83d[_0x9078('0x45')](0xc8)[_0x9078('0x2c')]({'message':_0x9078('0x46')});})[_0x9078('0x1f')](function(_0x123795){return handleError(_0x51a83d,0x1f4,_0x123795);});};exports[_0x9078('0x47')]=function(_0x57efb5,_0x1b5993){return db[_0x9078('0x48')][_0x9078('0x20')]({'where':{'resetPasswordToken':_0x57efb5['params'][_0x9078('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0xc8f50f){if(!_0xc8f50f){throw new Error(_0x9078('0x4a'));}return db[_0x9078('0xb')][_0x9078('0xc')]({'attributes':['id',_0x9078('0x4b'),'enforcePasswordHistory',_0x9078('0x4c')]})[_0x9078('0xf')](function(_0x541412){if(_0x541412[_0x9078('0x4b')])authService[_0x9078('0x4d')](_0x57efb5[_0x9078('0x32')]['password']);if(!_0x541412[_0x9078('0x4e')]||!_0xc8f50f['previousPasswords'])return _0xc8f50f;authService[_0x9078('0x4f')](_0x57efb5[_0x9078('0x32')][_0x9078('0x50')],_0xc8f50f['previousPasswords'],_0x541412[_0x9078('0x4c')]);return _0xc8f50f;})[_0x9078('0xf')](function(){_0xc8f50f[_0x9078('0x50')]=_0x57efb5['body'][_0x9078('0x50')];_0xc8f50f[_0x9078('0x39')]=null;_0xc8f50f['resetPasswordExpires']=null;return _0xc8f50f[_0x9078('0x3c')]();});})[_0x9078('0xf')](function(){_0x1b5993['status'](0xc8)[_0x9078('0x2c')]({'message':_0x9078('0x51')});})['catch'](function(_0x59f63c){return handleError(_0x1b5993,0x1f4,_0x59f63c);});};passport[_0x9078('0x52')](_0x9078('0x2e'),new LocalStrategy({'usernameField':_0x9078('0x10'),'passwordField':'password'},function(_0x23eb1f,_0x40774d,_0x1abf1e){return localAuthenticate(db[_0x9078('0x48')],_0x23eb1f,_0x40774d,_0x1abf1e);})); \ No newline at end of file +var _0x45dc=['agent','authenticate','loginAttempts','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','disabled','getLicense','catch','MailAccount','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','User','util','passport','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','admin','user'];(function(_0x2bfb87,_0x3fc43a){var _0x31b9e8=function(_0x4d83a5){while(--_0x4d83a5){_0x2bfb87['push'](_0x2bfb87['shift']());}};_0x31b9e8(++_0x3fc43a);}(_0x45dc,0x149));var _0xc45d=function(_0x15a4dd,_0x187829){_0x15a4dd=_0x15a4dd-0x0;var _0x485988=_0x45dc[_0x15a4dd];return _0x485988;};'use strict';var util=require(_0xc45d('0x0'));var passport=require(_0xc45d('0x1'));var LocalStrategy=require(_0xc45d('0x2'))[_0xc45d('0x3')];var jayson=require(_0xc45d('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xc45d('0x5'));var db=require(_0xc45d('0x6'))['db'];var authService=require(_0xc45d('0x7'));var utils=require(_0xc45d('0x8'));var client=jayson[_0xc45d('0x9')][_0xc45d('0xa')]({'port':0x232b});function localAuthenticate(_0x559c26,_0x5c8ec3,_0x37f0bf,_0x38731b){var _0x51b2b3,_0x10ddf9;return db['Setting'][_0xc45d('0xb')]({'where':{'id':0x1},'attributes':[_0xc45d('0xc'),_0xc45d('0xd')],'raw':!![]})[_0xc45d('0xe')](function(_0x3e3fba){_0x51b2b3=_0x3e3fba;return _0x559c26[_0xc45d('0xb')]({'attributes':['id',_0xc45d('0xf'),_0xc45d('0x10'),_0xc45d('0x11'),_0xc45d('0x12'),'disabled',_0xc45d('0x13'),_0xc45d('0x14'),'loginAttempts'],'where':{'name':_0x5c8ec3,'role':{'$or':[_0xc45d('0x15'),_0xc45d('0x16'),_0xc45d('0x17')]}}});})[_0xc45d('0xe')](function(_0x3b3764){if(!_0x3b3764||_0x3b3764&&_0x3b3764['name']!==_0x5c8ec3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x10ddf9=_0x3b3764;return _0x10ddf9;}})['then'](function(){_0x10ddf9[_0xc45d('0x18')](_0x37f0bf,function(_0x149cbb,_0x193dfc){var _0x3f4c6a=_0x10ddf9[_0xc45d('0x19')]+0x1;if(_0x149cbb){return _0x38731b(_0x149cbb);}else if(!_0x193dfc){if(_0x10ddf9['disabled']){return _0x38731b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51b2b3[_0xc45d('0xc')]>0x0){if(_0x10ddf9['blocked']){if(_0x51b2b3[_0xc45d('0xd')]>0x0){if(moment(_0x10ddf9['blockedAt'])[_0xc45d('0x1a')](_0x51b2b3[_0xc45d('0xd')],_0xc45d('0x1b'))>moment()){return _0x38731b(null,![],{'message':_0xc45d('0x1c')});}else{return utils[_0xc45d('0x1d')](_0x10ddf9,_0x3f4c6a,![],null)[_0xc45d('0xe')](function(){return _0x38731b(null,![],{'message':_0xc45d('0x1c')});});}}else{return _0x38731b(null,![],{'message':_0xc45d('0x1c')});}}else{if(_0x3f4c6a>=_0x51b2b3[_0xc45d('0xc')]){return utils[_0xc45d('0x1d')](_0x10ddf9,0x0,!![],moment())[_0xc45d('0xe')](function(){return _0x38731b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc45d('0x1d')](_0x10ddf9,_0x3f4c6a,![],null)['then'](function(){return _0x38731b(null,![],{'message':_0xc45d('0x1c')});});}}}else{return _0x38731b(null,![],{'message':_0xc45d('0x1c')});}}else{if(_0x10ddf9[_0xc45d('0x1e')]){return _0x38731b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51b2b3['allowedLoginAttempts']>0x0){if(_0x10ddf9[_0xc45d('0x13')]){if(_0x51b2b3[_0xc45d('0xd')]>0x0){if(moment(_0x10ddf9[_0xc45d('0x14')])[_0xc45d('0x1a')](_0x51b2b3[_0xc45d('0xd')],'minutes')>moment()){return _0x38731b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc45d('0x1d')](_0x10ddf9,0x0,![],null)[_0xc45d('0xe')](function(){return utils[_0xc45d('0x1f')](_0x10ddf9);})[_0xc45d('0xe')](function(){return _0x38731b(null,_0x10ddf9);});}}else{return _0x38731b(null,![],{'message':_0xc45d('0x1c')});}}else{return utils[_0xc45d('0x1d')](_0x10ddf9,0x0,![],null)['then'](function(){return utils[_0xc45d('0x1f')](_0x10ddf9);})[_0xc45d('0xe')](function(){return _0x38731b(null,_0x10ddf9);})[_0xc45d('0x20')](function(_0x20b80b){return _0x38731b(null,![],_0x20b80b);});}}else{if(_0x10ddf9[_0xc45d('0x13')]){return _0x38731b(null,![],{'message':_0xc45d('0x1c')});}else{return utils[_0xc45d('0x1f')](_0x10ddf9)['then'](function(){return _0x38731b(null,_0x10ddf9);});}}}});})['catch'](function(_0x550bb5){return _0x38731b(null,![],_0x550bb5);});}function sendServiceMail(_0xc997e9){return db[_0xc45d('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xc45d('0xf'),'email'],'include':[{'model':db[_0xc45d('0x22')],'as':'Smtp','include':[{'model':db[_0xc45d('0x23')],'as':_0xc45d('0x23')}]}]})[_0xc45d('0xe')](function(_0x345ab4){if(!_0x345ab4){throw new Error(_0xc45d('0x24'));}var _0x134477=_0x345ab4[_0xc45d('0x25')]();var _0x358a30={'account':_0x134477,'message':_['merge']({'from':util[_0xc45d('0x26')](_0xc45d('0x27'),_0x345ab4[_0xc45d('0xf')],_0x345ab4[_0xc45d('0x28')]||_0x345ab4[_0xc45d('0x29')]['user'])},_0xc997e9)};return client[_0xc45d('0x2a')](_0xc45d('0x2b'),_0x358a30);})[_0xc45d('0xe')](function(_0x120172){if(_0x120172[_0xc45d('0x2c')]){throw new Error(util[_0xc45d('0x26')](_0xc45d('0x2d'),_0x120172['error'][_0xc45d('0x2e')]||JSON[_0xc45d('0x2f')](_0x120172[_0xc45d('0x2c')])));}return!![];});}function handleError(_0x4602a9,_0x5c8e66,_0x500af3){return _0x4602a9[_0xc45d('0x30')](_0x5c8e66||0x1f4)[_0xc45d('0x31')]({'message':_0x500af3?_0x500af3[_0xc45d('0x2e')]||_0x500af3:''});}exports[_0xc45d('0x32')]=function(_0x3aa515,_0x31c5ad,_0x1da9c3){passport['authenticate'](_0xc45d('0x33'),function(_0x67bb2,_0x482274,_0x1208ba){var _0x2681b2=_0x67bb2||_0x1208ba;if(_0x2681b2){return handleError(_0x31c5ad,0x191,_0x2681b2);}if(!_0x482274){return handleError(_0x31c5ad,0x194,{'message':_0xc45d('0x34')});}else{var _0x387291={'payload':{'id':_0x482274['id'],'role':_0x482274[_0xc45d('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xc45d('0x35')](_0x387291)[_0xc45d('0xe')](function(_0x5a84f5){_0x31c5ad[_0xc45d('0x36')]({'id':_0x482274['id'],'token':_0x5a84f5,'statusCall':'','isAlreadyLogged':_0x482274[_0xc45d('0x37')]});});}})(_0x3aa515,_0x31c5ad,_0x1da9c3);};exports[_0xc45d('0x38')]=function(_0x2c41e0,_0x22c88a){if(!_0x2c41e0['body'][_0xc45d('0x28')]){return handleError(_0x22c88a,0x1f4,{'message':_0xc45d('0x39')});}var _0x3ffe60=rs[_0xc45d('0x3a')]();_0x2c41e0[_0xc45d('0x3b')]['email']=_0x2c41e0['body'][_0xc45d('0x28')][_0xc45d('0x3c')]()[_0xc45d('0x3d')]();var _0xa5a7f4;return db[_0xc45d('0x3e')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc45d('0xd')],'raw':!![]})['then'](function(_0x3090cf){_0xa5a7f4=_0x3090cf;return db['User']['find']({'where':{'email':_0x2c41e0[_0xc45d('0x3b')][_0xc45d('0x28')]}});})[_0xc45d('0xe')](function(_0x3e16a4){if(!_0x3e16a4){throw new Error(_0xc45d('0x3f'));}if(_0x3e16a4[_0xc45d('0x1e')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3e16a4[_0xc45d('0x13')]){if(moment(_0x3e16a4[_0xc45d('0x14')])[_0xc45d('0x1a')](_0xa5a7f4[_0xc45d('0xd')],_0xc45d('0x1b'))>moment()){throw new Error(_0xc45d('0x40'));}else{_0x3e16a4['blocked']=![];_0x3e16a4[_0xc45d('0x14')]=null;}}_0x3e16a4[_0xc45d('0x41')]=_0x3ffe60;_0x3e16a4[_0xc45d('0x42')]=Date[_0xc45d('0x43')]()+0x36ee80;return _0x3e16a4[_0xc45d('0x44')]();})[_0xc45d('0xe')](function(){return sendServiceMail({'to':_0x2c41e0[_0xc45d('0x3b')][_0xc45d('0x28')],'subject':_0xc45d('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc45d('0x46')+_0xc45d('0x47')+_0x2c41e0[_0xc45d('0x48')][_0xc45d('0x49')]+'/reset/'+_0x3ffe60+'\x0a\x0a'+_0xc45d('0x4a')});})['then'](function(){_0x22c88a[_0xc45d('0x30')](0xc8)[_0xc45d('0x31')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x4bc58a){return handleError(_0x22c88a,0x1f4,_0x4bc58a);});};exports[_0xc45d('0x4b')]=function(_0x2701b0,_0x7df4c0){return db['User']['find']({'where':{'resetPasswordToken':_0x2701b0[_0xc45d('0x4c')][_0xc45d('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xc45d('0xe')](function(_0x1ba0e1){if(!_0x1ba0e1){throw new Error(_0xc45d('0x4e'));}return db[_0xc45d('0x3e')][_0xc45d('0xb')]({'attributes':['id','securePassword',_0xc45d('0x4f'),_0xc45d('0x50')]})[_0xc45d('0xe')](function(_0x3fc3da){if(_0x3fc3da[_0xc45d('0x51')])authService[_0xc45d('0x52')](_0x2701b0[_0xc45d('0x3b')][_0xc45d('0x10')]);if(!_0x3fc3da[_0xc45d('0x4f')]||!_0x1ba0e1[_0xc45d('0x53')])return _0x1ba0e1;authService[_0xc45d('0x54')](_0x2701b0[_0xc45d('0x3b')][_0xc45d('0x10')],_0x1ba0e1['previousPasswords'],_0x3fc3da[_0xc45d('0x50')]);return _0x1ba0e1;})[_0xc45d('0xe')](function(){_0x1ba0e1[_0xc45d('0x10')]=_0x2701b0[_0xc45d('0x3b')][_0xc45d('0x10')];_0x1ba0e1['resetPasswordToken']=null;_0x1ba0e1[_0xc45d('0x42')]=null;return _0x1ba0e1['save']();});})[_0xc45d('0xe')](function(){_0x7df4c0[_0xc45d('0x30')](0xc8)['send']({'message':_0xc45d('0x55')});})['catch'](function(_0x11a583){return handleError(_0x7df4c0,0x1f4,_0x11a583);});};passport[_0xc45d('0x56')]('local-login',new LocalStrategy({'usernameField':_0xc45d('0xf'),'passwordField':_0xc45d('0x10')},function(_0x2b5e04,_0x45d0a7,_0x3af901){return localAuthenticate(db[_0xc45d('0x57')],_0x2b5e04,_0x45d0a7,_0x3af901);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 18aba39..9c4a921 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 _0x2b8b=['forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x43eaad,_0x356190){var _0x4a4841=function(_0x36ed1d){while(--_0x36ed1d){_0x43eaad['push'](_0x43eaad['shift']());}};_0x4a4841(++_0x356190);}(_0x2b8b,0x1d4));var _0xb2b8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2b8b[_0x8c43de];return _0xa6591b;};'use strict';var express=require('express');var router=express[_0xb2b8('0x0')]();var controller=require(_0xb2b8('0x1'));router[_0xb2b8('0x2')]('/',controller[_0xb2b8('0x3')]);router[_0xb2b8('0x2')]('/forgot',controller[_0xb2b8('0x4')]);router[_0xb2b8('0x2')](_0xb2b8('0x5'),controller[_0xb2b8('0x6')]);module[_0xb2b8('0x7')]=router; \ No newline at end of file +var _0x8c1b=['express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x3feb73,_0x1f03fe){var _0x25adeb=function(_0x38cad1){while(--_0x38cad1){_0x3feb73['push'](_0x3feb73['shift']());}};_0x25adeb(++_0x1f03fe);}(_0x8c1b,0xd2));var _0xb8c1=function(_0x771528,_0x16ed97){_0x771528=_0x771528-0x0;var _0x53b250=_0x8c1b[_0x771528];return _0x53b250;};'use strict';var express=require(_0xb8c1('0x0'));var router=express[_0xb8c1('0x1')]();var controller=require(_0xb8c1('0x2'));router[_0xb8c1('0x3')]('/',controller['login']);router[_0xb8c1('0x3')](_0xb8c1('0x4'),controller[_0xb8c1('0x5')]);router[_0xb8c1('0x3')](_0xb8c1('0x6'),controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 6a316ca..d96e112 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 _0xf2ba=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x4bad94,_0x5be9f9){var _0x359b72=function(_0x39240c){while(--_0x39240c){_0x4bad94['push'](_0x4bad94['shift']());}};_0x359b72(++_0x5be9f9);}(_0xf2ba,0x188));var _0xaf2b=function(_0x34f9a6,_0x4bf60b){_0x34f9a6=_0x34f9a6-0x0;var _0x5a94a2=_0xf2ba[_0x34f9a6];return _0x5a94a2;};'use strict';var Sequelize=require(_0xaf2b('0x0'));module[_0xaf2b('0x1')]={'name':{'type':Sequelize[_0xaf2b('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaf2b('0x2')]},'status':{'type':Sequelize[_0xaf2b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xaf2b('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x5d92=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x5d92,0x1b7));var _0x25d9=function(_0x385371,_0x4f1061){_0x385371=_0x385371-0x0;var _0xe1f77a=_0x5d92[_0x385371];return _0xe1f77a;};'use strict';var Sequelize=require(_0x25d9('0x0'));module[_0x25d9('0x1')]={'name':{'type':Sequelize[_0x25d9('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x25d9('0x2')]},'description':{'type':Sequelize[_0x25d9('0x2')]},'status':{'type':Sequelize[_0x25d9('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x25d9('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 424a95f..376822e 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 _0xc0df=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','map','Automation','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','find','create','body','params','Condition','ids','getConditions','length','addActions','omit','getActions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4d3e97,_0x749913){var _0x3147d7=function(_0x250599){while(--_0x250599){_0x4d3e97['push'](_0x4d3e97['shift']());}};_0x3147d7(++_0x749913);}(_0xc0df,0x8b));var _0xfc0d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc0df[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xfc0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc0d('0x1'));var jsonpatch=require(_0xfc0d('0x2'));var rp=require(_0xfc0d('0x3'));var moment=require(_0xfc0d('0x4'));var BPromise=require(_0xfc0d('0x5'));var Mustache=require(_0xfc0d('0x6'));var util=require('util');var path=require(_0xfc0d('0x7'));var sox=require(_0xfc0d('0x8'));var csv=require(_0xfc0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc0d('0xa'));var _=require(_0xfc0d('0xb'));var squel=require('squel');var crypto=require(_0xfc0d('0xc'));var jsforce=require(_0xfc0d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfc0d('0x9'));var querystring=require(_0xfc0d('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc0d('0xf'));var authService=require(_0xfc0d('0x10'));var qs=require(_0xfc0d('0x11'));var as=require(_0xfc0d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc0d('0x13'))(_0xfc0d('0x14'));var utils=require(_0xfc0d('0x15'));var config=require(_0xfc0d('0x16'));var licenseUtil=require(_0xfc0d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaa87ed,_0x19cda4){_0x19cda4=_0x19cda4||0xcc;return function(_0x390b84){if(_0x390b84){return _0xaa87ed[_0xfc0d('0x18')](_0x19cda4);}return _0xaa87ed[_0xfc0d('0x19')](_0x19cda4)[_0xfc0d('0x1a')]();};}function respondWithResult(_0x2b10fc,_0x2b907d){_0x2b907d=_0x2b907d||0xc8;return function(_0x20fdf9){if(_0x20fdf9){return _0x2b10fc[_0xfc0d('0x19')](_0x2b907d)[_0xfc0d('0x1b')](_0x20fdf9);}};}function respondWithFilteredResult(_0x3bfa1d,_0x2582ce){return function(_0x2eb8b6){if(_0x2eb8b6){var _0x532519=typeof _0x2582ce[_0xfc0d('0x1c')]===_0xfc0d('0x1d')&&typeof _0x2582ce[_0xfc0d('0x1e')]==='undefined';var _0x53927b=_0x2eb8b6['count'];var _0x4e6db1=_0x532519?0x0:_0x2582ce[_0xfc0d('0x1c')];var _0x29a746=_0x532519?_0x2eb8b6[_0xfc0d('0x1f')]:_0x2582ce[_0xfc0d('0x1c')]+_0x2582ce[_0xfc0d('0x1e')];var _0x4a37ae;if(_0x29a746>=_0x53927b){_0x29a746=_0x53927b;_0x4a37ae=0xc8;}else{_0x4a37ae=0xce;}_0x3bfa1d[_0xfc0d('0x19')](_0x4a37ae);return _0x3bfa1d[_0xfc0d('0x20')]('Content-Range',_0x4e6db1+'-'+_0x29a746+'/'+_0x53927b)[_0xfc0d('0x1b')](_0x2eb8b6);}return null;};}function patchUpdates(_0x2f082a){return function(_0x89eecb){try{jsonpatch['apply'](_0x89eecb,_0x2f082a,!![]);}catch(_0x4285ff){return BPromise[_0xfc0d('0x21')](_0x4285ff);}return _0x89eecb[_0xfc0d('0x22')]();};}function saveUpdates(_0x4ca28e,_0x558084){return function(_0x1b378e){if(_0x1b378e){return _0x1b378e[_0xfc0d('0x23')](_0x4ca28e)[_0xfc0d('0x24')](function(_0x198f48){return _0x198f48;});}return null;};}function removeEntity(_0x421711,_0x1c9b84){return function(_0x593499){if(_0x593499){return _0x593499[_0xfc0d('0x25')]()['then'](function(){_0x421711[_0xfc0d('0x19')](0xcc)[_0xfc0d('0x1a')]();});}};}function handleEntityNotFound(_0x1916d1,_0x175e1f){return function(_0x29f033){if(!_0x29f033){_0x1916d1[_0xfc0d('0x18')](0x194);}return _0x29f033;};}function handleError(_0x5e25eb,_0x161a57){_0x161a57=_0x161a57||0x1f4;return function(_0x24520b){logger[_0xfc0d('0x26')](_0x24520b['stack']);if(_0x24520b[_0xfc0d('0x27')]){delete _0x24520b[_0xfc0d('0x27')];}_0x5e25eb['status'](_0x161a57)['send'](_0x24520b);};}exports['index']=function(_0x944ee6,_0x26f615){var _0x3516da={},_0x38e683={},_0x4937b4={'count':0x0,'rows':[]};var _0x39fd38=_[_0xfc0d('0x28')](db[_0xfc0d('0x29')][_0xfc0d('0x2a')],function(_0x2ad213){return{'name':_0x2ad213[_0xfc0d('0x2b')],'type':_0x2ad213[_0xfc0d('0x2c')]['key']};});_0x38e683[_0xfc0d('0x2d')]=_['map'](_0x39fd38,_0xfc0d('0x27'));_0x38e683[_0xfc0d('0x2e')]=_[_0xfc0d('0x2f')](_0x944ee6[_0xfc0d('0x2e')]);_0x38e683[_0xfc0d('0x30')]=_[_0xfc0d('0x31')](_0x38e683[_0xfc0d('0x2d')],_0x38e683['query']);_0x3516da[_0xfc0d('0x32')]=_[_0xfc0d('0x31')](_0x38e683[_0xfc0d('0x2d')],qs[_0xfc0d('0x33')](_0x944ee6[_0xfc0d('0x2e')][_0xfc0d('0x33')]));_0x3516da[_0xfc0d('0x32')]=_0x3516da[_0xfc0d('0x32')]['length']?_0x3516da[_0xfc0d('0x32')]:_0x38e683['model'];if(!_0x944ee6[_0xfc0d('0x2e')][_0xfc0d('0x34')](_0xfc0d('0x35'))){_0x3516da[_0xfc0d('0x1e')]=qs[_0xfc0d('0x1e')](_0x944ee6[_0xfc0d('0x2e')]['limit']);_0x3516da['offset']=qs[_0xfc0d('0x1c')](_0x944ee6[_0xfc0d('0x2e')][_0xfc0d('0x1c')]);}_0x3516da[_0xfc0d('0x36')]=qs[_0xfc0d('0x37')](_0x944ee6[_0xfc0d('0x2e')]['sort']);_0x3516da[_0xfc0d('0x38')]=qs[_0xfc0d('0x30')](_[_0xfc0d('0x39')](_0x944ee6[_0xfc0d('0x2e')],_0x38e683['filters']),_0x39fd38);if(_0x944ee6['query'][_0xfc0d('0x3a')]){_0x3516da['where']=_[_0xfc0d('0x3b')](_0x3516da[_0xfc0d('0x38')],{'$or':_[_0xfc0d('0x28')](_0x39fd38,function(_0x1f8d20){if(_0x1f8d20['type']!==_0xfc0d('0x3c')){var _0x4b5cc1={};_0x4b5cc1[_0x1f8d20[_0xfc0d('0x27')]]={'$like':'%'+_0x944ee6[_0xfc0d('0x2e')][_0xfc0d('0x3a')]+'%'};return _0x4b5cc1;}})});}_0x3516da=_[_0xfc0d('0x3b')]({},_0x3516da,_0x944ee6[_0xfc0d('0x3d')]);var _0x2fb447={'where':_0x3516da['where']};return db[_0xfc0d('0x29')][_0xfc0d('0x1f')](_0x2fb447)[_0xfc0d('0x24')](function(_0x436e70){_0x4937b4['count']=_0x436e70;if(_0x944ee6['query']['includeAll']){_0x3516da['include']=[{'all':!![]}];}return db[_0xfc0d('0x29')][_0xfc0d('0x3e')](_0x3516da);})[_0xfc0d('0x24')](function(_0x5f0cae){_0x4937b4[_0xfc0d('0x3f')]=_0x5f0cae;return _0x4937b4;})['then'](respondWithFilteredResult(_0x26f615,_0x3516da))[_0xfc0d('0x40')](handleError(_0x26f615,null));};exports[_0xfc0d('0x41')]=function(_0x19f513,_0x446daf){var _0xfecef7={'raw':![],'where':{'id':_0x19f513['params']['id']}},_0x50472e={};_0x50472e['model']=_[_0xfc0d('0x2f')](db[_0xfc0d('0x29')][_0xfc0d('0x2a')]);_0x50472e[_0xfc0d('0x2e')]=_[_0xfc0d('0x2f')](_0x19f513['query']);_0x50472e[_0xfc0d('0x30')]=_[_0xfc0d('0x31')](_0x50472e['model'],_0x50472e[_0xfc0d('0x2e')]);_0xfecef7[_0xfc0d('0x32')]=_[_0xfc0d('0x31')](_0x50472e[_0xfc0d('0x2d')],qs[_0xfc0d('0x33')](_0x19f513[_0xfc0d('0x2e')][_0xfc0d('0x33')]));_0xfecef7[_0xfc0d('0x32')]=_0xfecef7[_0xfc0d('0x32')]['length']?_0xfecef7[_0xfc0d('0x32')]:_0x50472e[_0xfc0d('0x2d')];if(_0x19f513['query'][_0xfc0d('0x42')]){_0xfecef7['include']=[{'all':!![]}];}_0xfecef7=_['merge']({},_0xfecef7,_0x19f513[_0xfc0d('0x3d')]);return db[_0xfc0d('0x29')][_0xfc0d('0x43')](_0xfecef7)[_0xfc0d('0x24')](handleEntityNotFound(_0x446daf,null))[_0xfc0d('0x24')](respondWithResult(_0x446daf,null))[_0xfc0d('0x40')](handleError(_0x446daf,null));};exports[_0xfc0d('0x44')]=function(_0x2b156c,_0x24d93b){return db['Automation'][_0xfc0d('0x44')](_0x2b156c[_0xfc0d('0x45')],{})['then'](respondWithResult(_0x24d93b,0xc9))['catch'](handleError(_0x24d93b,null));};exports[_0xfc0d('0x23')]=function(_0x844175,_0x21ee7b){if(_0x844175[_0xfc0d('0x45')]['id']){delete _0x844175[_0xfc0d('0x45')]['id'];}return db[_0xfc0d('0x29')][_0xfc0d('0x43')]({'where':{'id':_0x844175[_0xfc0d('0x46')]['id']}})['then'](handleEntityNotFound(_0x21ee7b,null))[_0xfc0d('0x24')](saveUpdates(_0x844175[_0xfc0d('0x45')],null))[_0xfc0d('0x24')](respondWithResult(_0x21ee7b,null))[_0xfc0d('0x40')](handleError(_0x21ee7b,null));};exports[_0xfc0d('0x25')]=function(_0x18f9a5,_0x4aea1c){return db['Automation']['find']({'where':{'id':_0x18f9a5[_0xfc0d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4aea1c,null))['then'](removeEntity(_0x4aea1c,null))[_0xfc0d('0x40')](handleError(_0x4aea1c,null));};exports['addConditions']=function(_0x6caa2d,_0x43e71b,_0x5c639a){return db[_0xfc0d('0x47')][_0xfc0d('0x43')]({'where':{'id':_0x6caa2d['params']['id']}})['then'](handleEntityNotFound(_0x43e71b,null))['then'](function(_0x3c4ade){if(_0x3c4ade){return _0x3c4ade['addConditions'](_0x6caa2d[_0xfc0d('0x45')]['ids'],_['omit'](_0x6caa2d[_0xfc0d('0x45')],[_0xfc0d('0x48'),'id'])||{});}})[_0xfc0d('0x24')](respondWithResult(_0x43e71b,null))[_0xfc0d('0x40')](handleError(_0x43e71b,null));};exports[_0xfc0d('0x49')]=function(_0x5f5c2c,_0x15397c,_0x4cd8eb){var _0xa1c33e={};var _0x3226fe={};var _0x14b5e7;var _0x2942e4;return db[_0xfc0d('0x29')]['findOne']({'where':{'id':_0x5f5c2c[_0xfc0d('0x46')]['id']}})['then'](handleEntityNotFound(_0x15397c,null))[_0xfc0d('0x24')](function(_0x2eae8a){if(_0x2eae8a){_0x14b5e7=_0x2eae8a;_0x3226fe[_0xfc0d('0x2d')]=_['keys'](db[_0xfc0d('0x47')][_0xfc0d('0x2a')]);_0x3226fe['query']=_[_0xfc0d('0x2f')](_0x5f5c2c['query']);_0x3226fe[_0xfc0d('0x30')]=_['intersection'](_0x3226fe[_0xfc0d('0x2d')],_0x3226fe['query']);_0xa1c33e[_0xfc0d('0x32')]=_[_0xfc0d('0x31')](_0x3226fe['model'],qs[_0xfc0d('0x33')](_0x5f5c2c[_0xfc0d('0x2e')][_0xfc0d('0x33')]));_0xa1c33e[_0xfc0d('0x32')]=_0xa1c33e[_0xfc0d('0x32')][_0xfc0d('0x4a')]?_0xa1c33e[_0xfc0d('0x32')]:_0x3226fe[_0xfc0d('0x2d')];_0xa1c33e[_0xfc0d('0x36')]=qs[_0xfc0d('0x37')](_0x5f5c2c[_0xfc0d('0x2e')][_0xfc0d('0x37')]);_0xa1c33e[_0xfc0d('0x38')]=qs[_0xfc0d('0x30')](_[_0xfc0d('0x39')](_0x5f5c2c['query'],_0x3226fe[_0xfc0d('0x30')]));if(_0x5f5c2c['query'][_0xfc0d('0x3a')]){_0xa1c33e[_0xfc0d('0x38')]=_['merge'](_0xa1c33e[_0xfc0d('0x38')],{'$or':_['map'](_0xa1c33e[_0xfc0d('0x32')],function(_0x528a0b){var _0x42ab1a={};_0x42ab1a[_0x528a0b]={'$like':'%'+_0x5f5c2c[_0xfc0d('0x2e')]['filter']+'%'};return _0x42ab1a;})});}_0xa1c33e=_[_0xfc0d('0x3b')]({},_0xa1c33e,_0x5f5c2c[_0xfc0d('0x3d')]);return _0x14b5e7[_0xfc0d('0x49')](_0xa1c33e);}})[_0xfc0d('0x24')](function(_0x284711){if(_0x284711){_0x2942e4=_0x284711['length'];if(!_0x5f5c2c['query'][_0xfc0d('0x34')](_0xfc0d('0x35'))){_0xa1c33e[_0xfc0d('0x1e')]=qs[_0xfc0d('0x1e')](_0x5f5c2c[_0xfc0d('0x2e')][_0xfc0d('0x1e')]);_0xa1c33e[_0xfc0d('0x1c')]=qs['offset'](_0x5f5c2c['query'][_0xfc0d('0x1c')]);}return _0x14b5e7[_0xfc0d('0x49')](_0xa1c33e);}})[_0xfc0d('0x24')](function(_0x4a2fdc){if(_0x4a2fdc){return _0x4a2fdc?{'count':_0x2942e4,'rows':_0x4a2fdc}:null;}})[_0xfc0d('0x24')](respondWithResult(_0x15397c,null))[_0xfc0d('0x40')](handleError(_0x15397c,null));};exports['addActions']=function(_0x122de9,_0x533320,_0x3a5860){return db['Action'][_0xfc0d('0x43')]({'where':{'id':_0x122de9['params']['id']}})[_0xfc0d('0x24')](handleEntityNotFound(_0x533320,null))['then'](function(_0x6c9076){if(_0x6c9076){return _0x6c9076[_0xfc0d('0x4b')](_0x122de9['body']['ids'],_[_0xfc0d('0x4c')](_0x122de9['body'],[_0xfc0d('0x48'),'id'])||{});}})[_0xfc0d('0x24')](respondWithResult(_0x533320,null))[_0xfc0d('0x40')](handleError(_0x533320,null));};exports[_0xfc0d('0x4d')]=function(_0x737a43,_0x1d3365,_0x1574b7){var _0x53cafe={};var _0x1257de={};var _0x59588d;var _0x1bcb25;return db[_0xfc0d('0x29')][_0xfc0d('0x4e')]({'where':{'id':_0x737a43[_0xfc0d('0x46')]['id']}})[_0xfc0d('0x24')](handleEntityNotFound(_0x1d3365,null))[_0xfc0d('0x24')](function(_0x214fff){if(_0x214fff){_0x59588d=_0x214fff;_0x1257de[_0xfc0d('0x2d')]=_[_0xfc0d('0x2f')](db['Action']['rawAttributes']);_0x1257de[_0xfc0d('0x2e')]=_['keys'](_0x737a43['query']);_0x1257de[_0xfc0d('0x30')]=_[_0xfc0d('0x31')](_0x1257de['model'],_0x1257de[_0xfc0d('0x2e')]);_0x53cafe[_0xfc0d('0x32')]=_[_0xfc0d('0x31')](_0x1257de['model'],qs[_0xfc0d('0x33')](_0x737a43['query'][_0xfc0d('0x33')]));_0x53cafe['attributes']=_0x53cafe['attributes'][_0xfc0d('0x4a')]?_0x53cafe[_0xfc0d('0x32')]:_0x1257de[_0xfc0d('0x2d')];_0x53cafe[_0xfc0d('0x36')]=qs['sort'](_0x737a43[_0xfc0d('0x2e')][_0xfc0d('0x37')]);_0x53cafe[_0xfc0d('0x38')]=qs[_0xfc0d('0x30')](_[_0xfc0d('0x39')](_0x737a43['query'],_0x1257de[_0xfc0d('0x30')]));if(_0x737a43[_0xfc0d('0x2e')][_0xfc0d('0x3a')]){_0x53cafe['where']=_['merge'](_0x53cafe[_0xfc0d('0x38')],{'$or':_[_0xfc0d('0x28')](_0x53cafe[_0xfc0d('0x32')],function(_0x50b2e5){var _0x115702={};_0x115702[_0x50b2e5]={'$like':'%'+_0x737a43['query'][_0xfc0d('0x3a')]+'%'};return _0x115702;})});}_0x53cafe=_[_0xfc0d('0x3b')]({},_0x53cafe,_0x737a43[_0xfc0d('0x3d')]);return _0x59588d[_0xfc0d('0x4d')](_0x53cafe);}})['then'](function(_0x1d7609){if(_0x1d7609){_0x1bcb25=_0x1d7609[_0xfc0d('0x4a')];if(!_0x737a43[_0xfc0d('0x2e')][_0xfc0d('0x34')](_0xfc0d('0x35'))){_0x53cafe['limit']=qs[_0xfc0d('0x1e')](_0x737a43[_0xfc0d('0x2e')][_0xfc0d('0x1e')]);_0x53cafe[_0xfc0d('0x1c')]=qs[_0xfc0d('0x1c')](_0x737a43[_0xfc0d('0x2e')][_0xfc0d('0x1c')]);}return _0x59588d[_0xfc0d('0x4d')](_0x53cafe);}})[_0xfc0d('0x24')](function(_0xd7238b){if(_0xd7238b){return _0xd7238b?{'count':_0x1bcb25,'rows':_0xd7238b}:null;}})[_0xfc0d('0x24')](respondWithResult(_0x1d3365,null))[_0xfc0d('0x40')](handleError(_0x1d3365,null));}; \ No newline at end of file +var _0xd53d=['limit','count','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','index','map','Automation','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','include','find','create','body','catch','Condition','addConditions','ids','omit','getConditions','findOne','Action','addActions','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xd53d,0x1ca));var _0xdd53=function(_0x5e47ef,_0x5805e4){_0x5e47ef=_0x5e47ef-0x0;var _0x1329d8=_0xd53d[_0x5e47ef];return _0x1329d8;};'use strict';var emlformat=require(_0xdd53('0x0'));var rimraf=require(_0xdd53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd53('0x2'));var rp=require(_0xdd53('0x3'));var moment=require(_0xdd53('0x4'));var BPromise=require(_0xdd53('0x5'));var Mustache=require(_0xdd53('0x6'));var util=require(_0xdd53('0x7'));var path=require('path');var sox=require(_0xdd53('0x8'));var csv=require(_0xdd53('0x9'));var ejs=require(_0xdd53('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd53('0xb'));var squel=require(_0xdd53('0xc'));var crypto=require(_0xdd53('0xd'));var jsforce=require(_0xdd53('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdd53('0x9'));var querystring=require(_0xdd53('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd53('0x10'));var as=require(_0xdd53('0x11'));var hardwareService=require(_0xdd53('0x12'));var logger=require('../../config/logger')(_0xdd53('0x13'));var utils=require('../../config/utils');var config=require(_0xdd53('0x14'));var licenseUtil=require(_0xdd53('0x15'));var db=require(_0xdd53('0x16'))['db'];function respondWithStatusCode(_0x93a4aa,_0x1d5a66){_0x1d5a66=_0x1d5a66||0xcc;return function(_0x522dc6){if(_0x522dc6){return _0x93a4aa[_0xdd53('0x17')](_0x1d5a66);}return _0x93a4aa['status'](_0x1d5a66)['end']();};}function respondWithResult(_0xe29e05,_0x46fc13){_0x46fc13=_0x46fc13||0xc8;return function(_0x439ce5){if(_0x439ce5){return _0xe29e05[_0xdd53('0x18')](_0x46fc13)[_0xdd53('0x19')](_0x439ce5);}};}function respondWithFilteredResult(_0x4d423d,_0x19b8a5){return function(_0x3a6d8b){if(_0x3a6d8b){var _0x3eef90=typeof _0x19b8a5[_0xdd53('0x1a')]===_0xdd53('0x1b')&&typeof _0x19b8a5[_0xdd53('0x1c')]===_0xdd53('0x1b');var _0x4809f9=_0x3a6d8b['count'];var _0x15ce13=_0x3eef90?0x0:_0x19b8a5[_0xdd53('0x1a')];var _0x213284=_0x3eef90?_0x3a6d8b[_0xdd53('0x1d')]:_0x19b8a5[_0xdd53('0x1a')]+_0x19b8a5['limit'];var _0x172ca4;if(_0x213284>=_0x4809f9){_0x213284=_0x4809f9;_0x172ca4=0xc8;}else{_0x172ca4=0xce;}_0x4d423d[_0xdd53('0x18')](_0x172ca4);return _0x4d423d['set'](_0xdd53('0x1e'),_0x15ce13+'-'+_0x213284+'/'+_0x4809f9)[_0xdd53('0x19')](_0x3a6d8b);}return null;};}function patchUpdates(_0x405a7c){return function(_0x1ccb06){try{jsonpatch[_0xdd53('0x1f')](_0x1ccb06,_0x405a7c,!![]);}catch(_0x46cb37){return BPromise[_0xdd53('0x20')](_0x46cb37);}return _0x1ccb06['save']();};}function saveUpdates(_0x9f3843,_0x4684b7){return function(_0x4fad96){if(_0x4fad96){return _0x4fad96[_0xdd53('0x21')](_0x9f3843)['then'](function(_0x3c0c07){return _0x3c0c07;});}return null;};}function removeEntity(_0x18c79b,_0x28edb6){return function(_0x1babbe){if(_0x1babbe){return _0x1babbe[_0xdd53('0x22')]()[_0xdd53('0x23')](function(){_0x18c79b[_0xdd53('0x18')](0xcc)[_0xdd53('0x24')]();});}};}function handleEntityNotFound(_0xdb7a7,_0x4e3936){return function(_0x861af9){if(!_0x861af9){_0xdb7a7[_0xdd53('0x17')](0x194);}return _0x861af9;};}function handleError(_0x3e5a64,_0x2de6ea){_0x2de6ea=_0x2de6ea||0x1f4;return function(_0x16dcc3){logger[_0xdd53('0x25')](_0x16dcc3[_0xdd53('0x26')]);if(_0x16dcc3['name']){delete _0x16dcc3[_0xdd53('0x27')];}_0x3e5a64['status'](_0x2de6ea)['send'](_0x16dcc3);};}exports[_0xdd53('0x28')]=function(_0x5b51de,_0xa8f1a4){var _0x5ac169={},_0x38a2c7={},_0xe5b07={'count':0x0,'rows':[]};var _0x43da98=_[_0xdd53('0x29')](db[_0xdd53('0x2a')][_0xdd53('0x2b')],function(_0x7e1da0){return{'name':_0x7e1da0['fieldName'],'type':_0x7e1da0[_0xdd53('0x2c')][_0xdd53('0x2d')]};});_0x38a2c7[_0xdd53('0x2e')]=_[_0xdd53('0x29')](_0x43da98,_0xdd53('0x27'));_0x38a2c7[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x5b51de[_0xdd53('0x2f')]);_0x38a2c7['filters']=_[_0xdd53('0x31')](_0x38a2c7['model'],_0x38a2c7[_0xdd53('0x2f')]);_0x5ac169['attributes']=_[_0xdd53('0x31')](_0x38a2c7[_0xdd53('0x2e')],qs['fields'](_0x5b51de[_0xdd53('0x2f')][_0xdd53('0x32')]));_0x5ac169[_0xdd53('0x33')]=_0x5ac169[_0xdd53('0x33')][_0xdd53('0x34')]?_0x5ac169[_0xdd53('0x33')]:_0x38a2c7['model'];if(!_0x5b51de['query'][_0xdd53('0x35')](_0xdd53('0x36'))){_0x5ac169[_0xdd53('0x1c')]=qs[_0xdd53('0x1c')](_0x5b51de[_0xdd53('0x2f')][_0xdd53('0x1c')]);_0x5ac169[_0xdd53('0x1a')]=qs[_0xdd53('0x1a')](_0x5b51de[_0xdd53('0x2f')][_0xdd53('0x1a')]);}_0x5ac169[_0xdd53('0x37')]=qs[_0xdd53('0x38')](_0x5b51de[_0xdd53('0x2f')][_0xdd53('0x38')]);_0x5ac169[_0xdd53('0x39')]=qs[_0xdd53('0x3a')](_[_0xdd53('0x3b')](_0x5b51de[_0xdd53('0x2f')],_0x38a2c7[_0xdd53('0x3a')]),_0x43da98);if(_0x5b51de[_0xdd53('0x2f')][_0xdd53('0x3c')]){_0x5ac169['where']=_[_0xdd53('0x3d')](_0x5ac169[_0xdd53('0x39')],{'$or':_[_0xdd53('0x29')](_0x43da98,function(_0x3626c5){if(_0x3626c5[_0xdd53('0x2c')]!==_0xdd53('0x3e')){var _0x53266e={};_0x53266e[_0x3626c5[_0xdd53('0x27')]]={'$like':'%'+_0x5b51de['query']['filter']+'%'};return _0x53266e;}})});}_0x5ac169=_[_0xdd53('0x3d')]({},_0x5ac169,_0x5b51de[_0xdd53('0x3f')]);var _0x59ba5d={'where':_0x5ac169['where']};return db[_0xdd53('0x2a')][_0xdd53('0x1d')](_0x59ba5d)[_0xdd53('0x23')](function(_0x19b6a8){_0xe5b07['count']=_0x19b6a8;if(_0x5b51de[_0xdd53('0x2f')][_0xdd53('0x40')]){_0x5ac169['include']=[{'all':!![]}];}return db[_0xdd53('0x2a')]['findAll'](_0x5ac169);})[_0xdd53('0x23')](function(_0x18674b){_0xe5b07[_0xdd53('0x41')]=_0x18674b;return _0xe5b07;})[_0xdd53('0x23')](respondWithFilteredResult(_0xa8f1a4,_0x5ac169))['catch'](handleError(_0xa8f1a4,null));};exports['show']=function(_0x40b79e,_0xf280d3){var _0x1fcb5c={'raw':![],'where':{'id':_0x40b79e[_0xdd53('0x42')]['id']}},_0x41ee12={};_0x41ee12[_0xdd53('0x2e')]=_['keys'](db[_0xdd53('0x2a')][_0xdd53('0x2b')]);_0x41ee12[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x40b79e['query']);_0x41ee12[_0xdd53('0x3a')]=_['intersection'](_0x41ee12[_0xdd53('0x2e')],_0x41ee12[_0xdd53('0x2f')]);_0x1fcb5c[_0xdd53('0x33')]=_[_0xdd53('0x31')](_0x41ee12[_0xdd53('0x2e')],qs[_0xdd53('0x32')](_0x40b79e[_0xdd53('0x2f')][_0xdd53('0x32')]));_0x1fcb5c[_0xdd53('0x33')]=_0x1fcb5c['attributes'][_0xdd53('0x34')]?_0x1fcb5c[_0xdd53('0x33')]:_0x41ee12[_0xdd53('0x2e')];if(_0x40b79e['query'][_0xdd53('0x40')]){_0x1fcb5c[_0xdd53('0x43')]=[{'all':!![]}];}_0x1fcb5c=_[_0xdd53('0x3d')]({},_0x1fcb5c,_0x40b79e[_0xdd53('0x3f')]);return db[_0xdd53('0x2a')][_0xdd53('0x44')](_0x1fcb5c)[_0xdd53('0x23')](handleEntityNotFound(_0xf280d3,null))[_0xdd53('0x23')](respondWithResult(_0xf280d3,null))['catch'](handleError(_0xf280d3,null));};exports[_0xdd53('0x45')]=function(_0x1ea85e,_0x442512){return db['Automation']['create'](_0x1ea85e[_0xdd53('0x46')],{})[_0xdd53('0x23')](respondWithResult(_0x442512,0xc9))[_0xdd53('0x47')](handleError(_0x442512,null));};exports[_0xdd53('0x21')]=function(_0x5701c5,_0x289906){if(_0x5701c5[_0xdd53('0x46')]['id']){delete _0x5701c5[_0xdd53('0x46')]['id'];}return db[_0xdd53('0x2a')][_0xdd53('0x44')]({'where':{'id':_0x5701c5[_0xdd53('0x42')]['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x289906,null))[_0xdd53('0x23')](saveUpdates(_0x5701c5['body'],null))[_0xdd53('0x23')](respondWithResult(_0x289906,null))['catch'](handleError(_0x289906,null));};exports['destroy']=function(_0x1f0b80,_0x3f0bf3){return db[_0xdd53('0x2a')][_0xdd53('0x44')]({'where':{'id':_0x1f0b80[_0xdd53('0x42')]['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x3f0bf3,null))[_0xdd53('0x23')](removeEntity(_0x3f0bf3,null))[_0xdd53('0x47')](handleError(_0x3f0bf3,null));};exports['addConditions']=function(_0x1c06dc,_0x3f92ce,_0x11cd6f){return db[_0xdd53('0x48')]['find']({'where':{'id':_0x1c06dc[_0xdd53('0x42')]['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x3f92ce,null))['then'](function(_0x52339e){if(_0x52339e){return _0x52339e[_0xdd53('0x49')](_0x1c06dc[_0xdd53('0x46')][_0xdd53('0x4a')],_[_0xdd53('0x4b')](_0x1c06dc[_0xdd53('0x46')],[_0xdd53('0x4a'),'id'])||{});}})[_0xdd53('0x23')](respondWithResult(_0x3f92ce,null))[_0xdd53('0x47')](handleError(_0x3f92ce,null));};exports[_0xdd53('0x4c')]=function(_0x224730,_0x1fc7fe,_0x4816bc){var _0x3237c6={};var _0x11f3a3={};var _0x5350fc;var _0x271a0f;return db[_0xdd53('0x2a')][_0xdd53('0x4d')]({'where':{'id':_0x224730[_0xdd53('0x42')]['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x1fc7fe,null))[_0xdd53('0x23')](function(_0x3765d3){if(_0x3765d3){_0x5350fc=_0x3765d3;_0x11f3a3[_0xdd53('0x2e')]=_[_0xdd53('0x30')](db[_0xdd53('0x48')][_0xdd53('0x2b')]);_0x11f3a3[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x224730[_0xdd53('0x2f')]);_0x11f3a3[_0xdd53('0x3a')]=_[_0xdd53('0x31')](_0x11f3a3[_0xdd53('0x2e')],_0x11f3a3[_0xdd53('0x2f')]);_0x3237c6['attributes']=_[_0xdd53('0x31')](_0x11f3a3[_0xdd53('0x2e')],qs[_0xdd53('0x32')](_0x224730[_0xdd53('0x2f')][_0xdd53('0x32')]));_0x3237c6[_0xdd53('0x33')]=_0x3237c6[_0xdd53('0x33')][_0xdd53('0x34')]?_0x3237c6[_0xdd53('0x33')]:_0x11f3a3[_0xdd53('0x2e')];_0x3237c6[_0xdd53('0x37')]=qs['sort'](_0x224730[_0xdd53('0x2f')]['sort']);_0x3237c6[_0xdd53('0x39')]=qs[_0xdd53('0x3a')](_[_0xdd53('0x3b')](_0x224730['query'],_0x11f3a3[_0xdd53('0x3a')]));if(_0x224730['query']['filter']){_0x3237c6['where']=_['merge'](_0x3237c6[_0xdd53('0x39')],{'$or':_['map'](_0x3237c6[_0xdd53('0x33')],function(_0x15cb5d){var _0x1dfc81={};_0x1dfc81[_0x15cb5d]={'$like':'%'+_0x224730['query'][_0xdd53('0x3c')]+'%'};return _0x1dfc81;})});}_0x3237c6=_[_0xdd53('0x3d')]({},_0x3237c6,_0x224730['options']);return _0x5350fc[_0xdd53('0x4c')](_0x3237c6);}})['then'](function(_0xdcd90){if(_0xdcd90){_0x271a0f=_0xdcd90[_0xdd53('0x34')];if(!_0x224730[_0xdd53('0x2f')][_0xdd53('0x35')](_0xdd53('0x36'))){_0x3237c6['limit']=qs['limit'](_0x224730[_0xdd53('0x2f')][_0xdd53('0x1c')]);_0x3237c6[_0xdd53('0x1a')]=qs[_0xdd53('0x1a')](_0x224730[_0xdd53('0x2f')][_0xdd53('0x1a')]);}return _0x5350fc[_0xdd53('0x4c')](_0x3237c6);}})[_0xdd53('0x23')](function(_0x1a2cdb){if(_0x1a2cdb){return _0x1a2cdb?{'count':_0x271a0f,'rows':_0x1a2cdb}:null;}})['then'](respondWithResult(_0x1fc7fe,null))[_0xdd53('0x47')](handleError(_0x1fc7fe,null));};exports['addActions']=function(_0x367f8e,_0x1eec63,_0x489989){return db[_0xdd53('0x4e')][_0xdd53('0x44')]({'where':{'id':_0x367f8e['params']['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x1eec63,null))[_0xdd53('0x23')](function(_0x17eed8){if(_0x17eed8){return _0x17eed8[_0xdd53('0x4f')](_0x367f8e[_0xdd53('0x46')]['ids'],_['omit'](_0x367f8e[_0xdd53('0x46')],[_0xdd53('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x1eec63,null))['catch'](handleError(_0x1eec63,null));};exports['getActions']=function(_0x4423ea,_0x200e5a,_0x380a39){var _0x49a503={};var _0x3b5356={};var _0x226260;var _0x155300;return db['Automation']['findOne']({'where':{'id':_0x4423ea['params']['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x200e5a,null))[_0xdd53('0x23')](function(_0x5ae93c){if(_0x5ae93c){_0x226260=_0x5ae93c;_0x3b5356[_0xdd53('0x2e')]=_[_0xdd53('0x30')](db[_0xdd53('0x4e')][_0xdd53('0x2b')]);_0x3b5356[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x4423ea[_0xdd53('0x2f')]);_0x3b5356[_0xdd53('0x3a')]=_[_0xdd53('0x31')](_0x3b5356['model'],_0x3b5356['query']);_0x49a503[_0xdd53('0x33')]=_['intersection'](_0x3b5356['model'],qs[_0xdd53('0x32')](_0x4423ea[_0xdd53('0x2f')]['fields']));_0x49a503[_0xdd53('0x33')]=_0x49a503[_0xdd53('0x33')][_0xdd53('0x34')]?_0x49a503['attributes']:_0x3b5356[_0xdd53('0x2e')];_0x49a503[_0xdd53('0x37')]=qs[_0xdd53('0x38')](_0x4423ea[_0xdd53('0x2f')][_0xdd53('0x38')]);_0x49a503[_0xdd53('0x39')]=qs[_0xdd53('0x3a')](_[_0xdd53('0x3b')](_0x4423ea['query'],_0x3b5356[_0xdd53('0x3a')]));if(_0x4423ea['query'][_0xdd53('0x3c')]){_0x49a503['where']=_['merge'](_0x49a503['where'],{'$or':_[_0xdd53('0x29')](_0x49a503[_0xdd53('0x33')],function(_0x5e9dd0){var _0x3773ac={};_0x3773ac[_0x5e9dd0]={'$like':'%'+_0x4423ea[_0xdd53('0x2f')]['filter']+'%'};return _0x3773ac;})});}_0x49a503=_[_0xdd53('0x3d')]({},_0x49a503,_0x4423ea[_0xdd53('0x3f')]);return _0x226260['getActions'](_0x49a503);}})[_0xdd53('0x23')](function(_0x35c222){if(_0x35c222){_0x155300=_0x35c222['length'];if(!_0x4423ea[_0xdd53('0x2f')][_0xdd53('0x35')](_0xdd53('0x36'))){_0x49a503[_0xdd53('0x1c')]=qs['limit'](_0x4423ea['query']['limit']);_0x49a503['offset']=qs['offset'](_0x4423ea['query'][_0xdd53('0x1a')]);}return _0x226260[_0xdd53('0x50')](_0x49a503);}})[_0xdd53('0x23')](function(_0x57a74c){if(_0x57a74c){return _0x57a74c?{'count':_0x155300,'rows':_0x57a74c}:null;}})[_0xdd53('0x23')](respondWithResult(_0x200e5a,null))[_0xdd53('0x47')](handleError(_0x200e5a,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e12a67f..2f4b081 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 _0x1dc9=['moment','bluebird','request-promise','path','rimraf','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x4297c6,_0x3a6d62){var _0x46b0ac=function(_0xab722a){while(--_0xab722a){_0x4297c6['push'](_0x4297c6['shift']());}};_0x46b0ac(++_0x3a6d62);}(_0x1dc9,0xa4));var _0x91dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1dc9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x91dc('0x0'));var util=require(_0x91dc('0x1'));var logger=require(_0x91dc('0x2'))(_0x91dc('0x3'));var moment=require(_0x91dc('0x4'));var BPromise=require(_0x91dc('0x5'));var rp=require(_0x91dc('0x6'));var fs=require('fs');var path=require(_0x91dc('0x7'));var rimraf=require(_0x91dc('0x8'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x91dc('0x9')]=function(_0x5d3783,_0x535c15){return _0x5d3783[_0x91dc('0xa')]('Automation',attributes,{'tableName':_0x91dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5978=['rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5978,0x1a5));var _0x8597=function(_0x460ddf,_0x3adfc9){_0x460ddf=_0x460ddf-0x0;var _0x52e8fb=_0x5978[_0x460ddf];return _0x52e8fb;};'use strict';var _=require(_0x8597('0x0'));var util=require(_0x8597('0x1'));var logger=require(_0x8597('0x2'))(_0x8597('0x3'));var moment=require(_0x8597('0x4'));var BPromise=require(_0x8597('0x5'));var rp=require(_0x8597('0x6'));var fs=require('fs');var path=require(_0x8597('0x7'));var rimraf=require(_0x8597('0x8'));var config=require(_0x8597('0x9'));var attributes=require(_0x8597('0xa'));module['exports']=function(_0x40d856,_0x7341e4){return _0x40d856[_0x8597('0xb')]('Automation',attributes,{'tableName':_0x8597('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 244f346..c08b089 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x484515,_0x173830){var _0x163e9e=function(_0x295a9f){while(--_0x295a9f){_0x484515['push'](_0x484515['shift']());}};_0x163e9e(++_0x173830);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x32af03,_0x4c58bd){_0x32af03=_0x32af03-0x0;var _0x22295=_0xfbbb[_0x32af03];return _0x22295;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var moment=require(_0xbfbb('0x2'));var BPromise=require(_0xbfbb('0x3'));var rs=require(_0xbfbb('0x4'));var fs=require('fs');var Redis=require(_0xbfbb('0x5'));var db=require(_0xbfbb('0x6'))['db'];var utils=require(_0xbfbb('0x7'));var logger=require(_0xbfbb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfbb('0x9'));var client=jayson['client'][_0xbfbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c6cc,_0x16a41c,_0x5a69b3){return new BPromise(function(_0x1f2c31,_0x3260a7){return client[_0xbfbb('0xb')](_0x16c6cc,_0x5a69b3)[_0xbfbb('0xc')](function(_0x1baefa){logger[_0xbfbb('0xd')]('Automation,\x20%s,\x20%s',_0x16a41c,_0xbfbb('0xe'));logger[_0xbfbb('0xf')](_0xbfbb('0x10'),_0x16a41c,_0xbfbb('0xe'),JSON['stringify'](_0x1baefa));if(_0x1baefa[_0xbfbb('0x11')]){if(_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x12')]===0x1f4){logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x3260a7(_0x1baefa[_0xbfbb('0x11')]['message']);}logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x1f2c31(_0x1baefa[_0xbfbb('0x11')]['message']);}else{logger[_0xbfbb('0xd')](_0xbfbb('0x13'),_0x16a41c,_0xbfbb('0xe'));_0x1f2c31(_0x1baefa[_0xbfbb('0x15')][_0xbfbb('0x14')]);}})[_0xbfbb('0x16')](function(_0x2f49e5){logger['error']('Automation,\x20%s,\x20%s',_0x16a41c,_0x2f49e5);_0x3260a7(_0x2f49e5);});});} \ No newline at end of file +var _0x4b0f=['request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\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'];(function(_0x2a960f,_0x5aab73){var _0x5027df=function(_0x13bf75){while(--_0x13bf75){_0x2a960f['push'](_0x2a960f['shift']());}};_0x5027df(++_0x5aab73);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0x4b0f[_0x32bb6b];return _0x58dcb4;};'use strict';var _=require('lodash');var util=require(_0xf4b0('0x0'));var moment=require(_0xf4b0('0x1'));var BPromise=require(_0xf4b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4b0('0x3'));var db=require(_0xf4b0('0x4'))['db'];var utils=require(_0xf4b0('0x5'));var logger=require(_0xf4b0('0x6'))(_0xf4b0('0x7'));var config=require(_0xf4b0('0x8'));var jayson=require(_0xf4b0('0x9'));var client=jayson[_0xf4b0('0xa')][_0xf4b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373042,_0x300b64,_0x35160f){return new BPromise(function(_0x3a2236,_0xd132d8){return client[_0xf4b0('0xc')](_0x373042,_0x35160f)[_0xf4b0('0xd')](function(_0x4906e9){logger[_0xf4b0('0xe')](_0xf4b0('0xf'),_0x300b64,_0xf4b0('0x10'));logger[_0xf4b0('0x11')](_0xf4b0('0x12'),_0x300b64,_0xf4b0('0x10'),JSON[_0xf4b0('0x13')](_0x4906e9));if(_0x4906e9[_0xf4b0('0x14')]){if(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x15')]===0x1f4){logger[_0xf4b0('0x14')](_0xf4b0('0xf'),_0x300b64,_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);return _0xd132d8(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);}logger[_0xf4b0('0x14')](_0xf4b0('0xf'),_0x300b64,_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);return _0x3a2236(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);}else{logger['info'](_0xf4b0('0xf'),_0x300b64,_0xf4b0('0x10'));_0x3a2236(_0x4906e9[_0xf4b0('0x17')]['message']);}})[_0xf4b0('0x18')](function(_0x1f2d74){logger[_0xf4b0('0x14')]('Automation,\x20%s,\x20%s',_0x300b64,_0x1f2d74);_0xd132d8(_0x1f2d74);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 699fb9e..768cba1 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 _0x7b6f=['../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xb1b896,_0x289218){var _0x5bdcaa=function(_0x120bd2){while(--_0x120bd2){_0xb1b896['push'](_0xb1b896['shift']());}};_0x5bdcaa(++_0x289218);}(_0x7b6f,0x6c));var _0xf7b6=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x7b6f[_0x412e27];return _0x53da42;};'use strict';var multer=require(_0xf7b6('0x0'));var util=require('util');var path=require(_0xf7b6('0x1'));var timeout=require(_0xf7b6('0x2'));var express=require(_0xf7b6('0x3'));var router=express[_0xf7b6('0x4')]();var fs_extra=require(_0xf7b6('0x5'));var auth=require(_0xf7b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b6('0x7'));var controller=require(_0xf7b6('0x8'));router[_0xf7b6('0x9')]('/',auth[_0xf7b6('0xa')](),controller[_0xf7b6('0xb')]);router[_0xf7b6('0x9')](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0xd')]);router[_0xf7b6('0x9')](_0xf7b6('0xe'),auth['isAuthenticated'](),controller[_0xf7b6('0xf')]);router[_0xf7b6('0x9')](_0xf7b6('0x10'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf7b6('0x12')](_0xf7b6('0xe'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x13')]);router[_0xf7b6('0x12')](_0xf7b6('0x10'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x14')]);router['put'](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x15')]);router[_0xf7b6('0x16')](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xeec3=['destroy','multer','util','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','post','create','addActions','put','update'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xeec3,0x1c3));var _0x3eec=function(_0x3e4019,_0x5e2bf9){_0x3e4019=_0x3e4019-0x0;var _0x53da3c=_0xeec3[_0x3e4019];return _0x53da3c;};'use strict';var multer=require(_0x3eec('0x0'));var util=require(_0x3eec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3eec('0x2'));var interaction=require(_0x3eec('0x3'));var config=require('../../config/environment');var controller=require(_0x3eec('0x4'));router['get']('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0x6')]);router['get'](_0x3eec('0x7'),auth[_0x3eec('0x5')](),controller[_0x3eec('0x8')]);router[_0x3eec('0x9')](_0x3eec('0xa'),auth[_0x3eec('0x5')](),controller[_0x3eec('0xb')]);router[_0x3eec('0x9')]('/:id/actions',auth[_0x3eec('0x5')](),controller['getActions']);router[_0x3eec('0xc')]('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0xd')]);router[_0x3eec('0xc')]('/:id/conditions',auth[_0x3eec('0x5')](),controller['addConditions']);router['post']('/:id/actions',auth[_0x3eec('0x5')](),controller[_0x3eec('0xe')]);router[_0x3eec('0xf')](_0x3eec('0x7'),auth['isAuthenticated'](),controller[_0x3eec('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3eec('0x11')]);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 85ce71f..70b4128 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 _0xaf67=['always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen'];(function(_0xcc952b,_0x8fb6c8){var _0x1d3705=function(_0x2d59ff){while(--_0x2d59ff){_0xcc952b['push'](_0xcc952b['shift']());}};_0x1d3705(++_0x8fb6c8);}(_0xaf67,0x1f2));var _0x7af6=function(_0x3b6cc2,_0x32251){_0x3b6cc2=_0x3b6cc2-0x0;var _0x5ed423=_0xaf67[_0x3b6cc2];return _0x5ed423;};'use strict';var Sequelize=require(_0x7af6('0x0'));module[_0x7af6('0x1')]={'name':{'type':Sequelize[_0x7af6('0x2')],'unique':_0x7af6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7af6('0x4')](_0x7af6('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7af6('0x2')]},'active':{'type':Sequelize[_0x7af6('0x6')],'defaultValue':0x0,'comment':_0x7af6('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7af6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7af6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7af6('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7af6('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7af6('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7af6('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7af6('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)[_0x7af6('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7af6('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7af6('0x9')](0x5)[_0x7af6('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7af6('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7af6('0x9')](0x5)[_0x7af6('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)[_0x7af6('0xb')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7af6('0x12')},'dialTimezone':{'type':Sequelize[_0x7af6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7af6('0x2')],'defaultValue':_0x7af6('0x13')},'dialCheckDuplicateType':{'type':Sequelize[_0x7af6('0x4')]('always',_0x7af6('0x14'),_0x7af6('0x15')),'defaultValue':_0x7af6('0x16')},'dialAMDActive':{'type':Sequelize[_0x7af6('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7af6('0x9')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7af6('0x17')},'dialAMDGreeting':{'type':Sequelize[_0x7af6('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7af6('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7af6('0x9')](0x9)[_0x7af6('0xb')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7af6('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7af6('0x9')](0x9)[_0x7af6('0xb')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7af6('0x9')](0x9)[_0x7af6('0xb')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7af6('0x9')](0x9)[_0x7af6('0xb')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7af6('0x9')](0x9)[_0x7af6('0xb')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7af6('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7af6('0x9')](0x5)[_0x7af6('0xb')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7af6('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7af6('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7af6('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7af6('0x4')](_0x7af6('0x1d'),_0x7af6('0x1e')),'defaultValue':_0x7af6('0x1d')},'dialPrefix':{'type':Sequelize[_0x7af6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7af6('0x9')](0x3)[_0x7af6('0xb')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7af6('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7af6('0xb')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7af6('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)[_0x7af6('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)[_0x7af6('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7af6('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)[_0x7af6('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7af6('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7af6('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7af6('0x9')](0x5)[_0x7af6('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7af6('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7af6('0x27')}}; \ No newline at end of file +var _0x9353=['#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x428ccd,_0x259055){var _0x57d4b6=function(_0x1ec989){while(--_0x1ec989){_0x428ccd['push'](_0x428ccd['shift']());}};_0x57d4b6(++_0x259055);}(_0x9353,0xcb));var _0x3935=function(_0x5a9636,_0x4cdf6a){_0x5a9636=_0x5a9636-0x0;var _0x559ce4=_0x9353[_0x5a9636];return _0x559ce4;};'use strict';var Sequelize=require(_0x3935('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3935('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3935('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x3935('0x3')},'description':{'type':Sequelize[_0x3935('0x4')]},'active':{'type':Sequelize[_0x3935('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x3935('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3935('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3935('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3935('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3935('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3935('0x8')],'defaultValue':0x3,'comment':_0x3935('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)[_0x3935('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3935('0x10')},'dialTimezone':{'type':Sequelize[_0x3935('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3935('0x4')],'defaultValue':_0x3935('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x3935('0x2')](_0x3935('0x12'),_0x3935('0x13'),_0x3935('0x14')),'defaultValue':_0x3935('0x12')},'dialAMDActive':{'type':Sequelize[_0x3935('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3935('0x6')](0x9)[_0x3935('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3935('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x3935('0x6')](0x9)[_0x3935('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3935('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3935('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3935('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x3935('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x3935('0x6')](0x9)[_0x3935('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3935('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3935('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3935('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3935('0x6')](0x9)[_0x3935('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3935('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3935('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3935('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3935('0x6')](0x9)[_0x3935('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3935('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x3935('0x1d')),'defaultValue':_0x3935('0x1e')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3935('0x1f')},'dialCutDigit':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3935('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)[_0x3935('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0x22')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)[_0x3935('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0x27')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3935('0x6')](0x3)[_0x3935('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3935('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3935('0x6')](0x5)[_0x3935('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3935('0x2a')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9208492..ba5eb83 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 _0x1db3=['getLists','CmList','format','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','NOW()','cm_contacts','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','IvrCampaigns','end','error','name','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','params','intersection','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','updatedAt','createdAt','destroy','getHoppers','findOne','CmHopper','nolimit','sort','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack'];(function(_0x347198,_0x20bb04){var _0x3319db=function(_0x1ab6c1){while(--_0x1ab6c1){_0x347198['push'](_0x347198['shift']());}};_0x3319db(++_0x20bb04);}(_0x1db3,0x1e5));var _0x31db=function(_0x2c5208,_0x22bb77){_0x2c5208=_0x2c5208-0x0;var _0x3c981c=_0x1db3[_0x2c5208];return _0x3c981c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31db('0x0'));var zipdir=require(_0x31db('0x1'));var jsonpatch=require(_0x31db('0x2'));var rp=require(_0x31db('0x3'));var moment=require(_0x31db('0x4'));var BPromise=require(_0x31db('0x5'));var Mustache=require(_0x31db('0x6'));var util=require(_0x31db('0x7'));var path=require(_0x31db('0x8'));var sox=require(_0x31db('0x9'));var csv=require(_0x31db('0xa'));var ejs=require(_0x31db('0xb'));var fs=require('fs');var fs_extra=require(_0x31db('0xc'));var _=require(_0x31db('0xd'));var squel=require(_0x31db('0xe'));var crypto=require(_0x31db('0xf'));var jsforce=require(_0x31db('0x10'));var deskjs=require(_0x31db('0x11'));var toCsv=require(_0x31db('0xa'));var querystring=require('querystring');var Papa=require(_0x31db('0x12'));var Redis=require(_0x31db('0x13'));var authService=require(_0x31db('0x14'));var qs=require(_0x31db('0x15'));var as=require(_0x31db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31db('0x17'))(_0x31db('0x18'));var utils=require(_0x31db('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31db('0x1a'));var db=require(_0x31db('0x1b'))['db'];function respondWithStatusCode(_0x1fad0a,_0x1ca88f){_0x1ca88f=_0x1ca88f||0xcc;return function(_0x298707){if(_0x298707){return _0x1fad0a[_0x31db('0x1c')](_0x1ca88f);}return _0x1fad0a['status'](_0x1ca88f)['end']();};}function respondWithResult(_0xc899ba,_0x5706dc){_0x5706dc=_0x5706dc||0xc8;return function(_0x1ccc17){if(_0x1ccc17){return _0xc899ba[_0x31db('0x1d')](_0x5706dc)[_0x31db('0x1e')](_0x1ccc17);}};}function respondWithFilteredResult(_0x2009c7,_0x29f691){return function(_0x4ccb3d){if(_0x4ccb3d){var _0x557907=typeof _0x29f691['offset']===_0x31db('0x1f')&&typeof _0x29f691[_0x31db('0x20')]===_0x31db('0x1f');var _0x4dbc05=_0x4ccb3d[_0x31db('0x21')];var _0x1d3218=_0x557907?0x0:_0x29f691[_0x31db('0x22')];var _0x3df86e=_0x557907?_0x4ccb3d[_0x31db('0x21')]:_0x29f691[_0x31db('0x22')]+_0x29f691[_0x31db('0x20')];var _0x53ca16;if(_0x3df86e>=_0x4dbc05){_0x3df86e=_0x4dbc05;_0x53ca16=0xc8;}else{_0x53ca16=0xce;}_0x2009c7[_0x31db('0x1d')](_0x53ca16);return _0x2009c7['set']('Content-Range',_0x1d3218+'-'+_0x3df86e+'/'+_0x4dbc05)[_0x31db('0x1e')](_0x4ccb3d);}return null;};}function patchUpdates(_0x1915ec){return function(_0x168002){try{jsonpatch[_0x31db('0x23')](_0x168002,_0x1915ec,!![]);}catch(_0x211e59){return BPromise[_0x31db('0x24')](_0x211e59);}return _0x168002[_0x31db('0x25')]();};}function saveUpdates(_0x98ce70,_0x204781){return function(_0x1f00f7){if(_0x1f00f7){return _0x1f00f7[_0x31db('0x26')](_0x98ce70)[_0x31db('0x27')](function(_0x5574e5){return _0x5574e5;});}return null;};}function removeEntity(_0x358d1d,_0x335cc9){return function(_0x303cf4){if(_0x303cf4){return _0x303cf4['destroy']()[_0x31db('0x27')](function(){var _0x54d623=_0x303cf4['get']({'plain':!![]});var _0x2ea3a6=_0x31db('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2ea3a6,'resourceId':_0x54d623['id']}})['then'](function(){return _0x303cf4;});})[_0x31db('0x27')](function(){_0x358d1d['status'](0xcc)[_0x31db('0x29')]();});}};}function handleEntityNotFound(_0xe10c6a,_0x1f3355){return function(_0x3effc4){if(!_0x3effc4){_0xe10c6a[_0x31db('0x1c')](0x194);}return _0x3effc4;};}function handleError(_0xb969fe,_0x2e1c2d){_0x2e1c2d=_0x2e1c2d||0x1f4;return function(_0x19d079){logger[_0x31db('0x2a')](_0x19d079['stack']);if(_0x19d079[_0x31db('0x2b')]){delete _0x19d079[_0x31db('0x2b')];}_0xb969fe['status'](_0x2e1c2d)['send'](_0x19d079);};}exports[_0x31db('0x2c')]=function(_0x5f256c,_0x5e29e4){var _0x5a6368={},_0x260d00={},_0x2d5e49={'count':0x0,'rows':[]};var _0x5e3867=_[_0x31db('0x2d')](db['Campaign']['rawAttributes'],function(_0x2a41c9){return{'name':_0x2a41c9[_0x31db('0x2e')],'type':_0x2a41c9[_0x31db('0x2f')]['key']};});_0x260d00['model']=_[_0x31db('0x2d')](_0x5e3867,_0x31db('0x2b'));_0x260d00[_0x31db('0x30')]=_[_0x31db('0x31')](_0x5f256c[_0x31db('0x30')]);_0x260d00['filters']=_['intersection'](_0x260d00[_0x31db('0x32')],_0x260d00['query']);_0x5a6368[_0x31db('0x33')]=_['intersection'](_0x260d00[_0x31db('0x32')],qs[_0x31db('0x34')](_0x5f256c[_0x31db('0x30')][_0x31db('0x34')]));_0x5a6368['attributes']=_0x5a6368[_0x31db('0x33')][_0x31db('0x35')]?_0x5a6368['attributes']:_0x260d00['model'];if(!_0x5f256c[_0x31db('0x30')][_0x31db('0x36')]('nolimit')){_0x5a6368['limit']=qs[_0x31db('0x20')](_0x5f256c[_0x31db('0x30')][_0x31db('0x20')]);_0x5a6368[_0x31db('0x22')]=qs['offset'](_0x5f256c[_0x31db('0x30')][_0x31db('0x22')]);}_0x5a6368[_0x31db('0x37')]=qs['sort'](_0x5f256c[_0x31db('0x30')]['sort']);_0x5a6368[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x5f256c[_0x31db('0x30')],_0x260d00['filters']),_0x5e3867);if(_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]){_0x5a6368[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5a6368['where'],{'$or':_[_0x31db('0x2d')](_0x5e3867,function(_0x26f071){if(_0x26f071[_0x31db('0x2f')]!==_0x31db('0x3d')){var _0x55714d={};_0x55714d[_0x26f071[_0x31db('0x2b')]]={'$like':'%'+_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x55714d;}})});}_0x5a6368=_[_0x31db('0x3c')]({},_0x5a6368,_0x5f256c[_0x31db('0x3e')]);var _0x97e7f7={'where':_0x5a6368[_0x31db('0x38')]};return db[_0x31db('0x3f')][_0x31db('0x21')](_0x97e7f7)[_0x31db('0x27')](function(_0x21e693){_0x2d5e49['count']=_0x21e693;if(_0x5f256c[_0x31db('0x30')][_0x31db('0x40')]){_0x5a6368[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x3f')][_0x31db('0x42')](_0x5a6368);})[_0x31db('0x27')](function(_0x17d9b8){_0x2d5e49['rows']=_0x17d9b8;return _0x2d5e49;})[_0x31db('0x27')](respondWithFilteredResult(_0x5e29e4,_0x5a6368))[_0x31db('0x43')](handleError(_0x5e29e4,null));};exports['show']=function(_0xe9d1fa,_0x5aa2b2){var _0x15a21c={'raw':![],'where':{'id':_0xe9d1fa[_0x31db('0x44')]['id']}},_0x242304={};_0x242304['model']=_[_0x31db('0x31')](db[_0x31db('0x3f')]['rawAttributes']);_0x242304[_0x31db('0x30')]=_[_0x31db('0x31')](_0xe9d1fa[_0x31db('0x30')]);_0x242304[_0x31db('0x39')]=_[_0x31db('0x45')](_0x242304[_0x31db('0x32')],_0x242304[_0x31db('0x30')]);_0x15a21c[_0x31db('0x33')]=_['intersection'](_0x242304[_0x31db('0x32')],qs[_0x31db('0x34')](_0xe9d1fa[_0x31db('0x30')][_0x31db('0x34')]));_0x15a21c[_0x31db('0x33')]=_0x15a21c['attributes']['length']?_0x15a21c[_0x31db('0x33')]:_0x242304[_0x31db('0x32')];if(_0xe9d1fa[_0x31db('0x30')][_0x31db('0x40')]){_0x15a21c[_0x31db('0x41')]=[{'all':!![]}];}_0x15a21c=_[_0x31db('0x3c')]({},_0x15a21c,_0xe9d1fa[_0x31db('0x3e')]);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x15a21c)[_0x31db('0x27')](handleEntityNotFound(_0x5aa2b2,null))['then'](respondWithResult(_0x5aa2b2,null))[_0x31db('0x43')](handleError(_0x5aa2b2,null));};exports[_0x31db('0x47')]=function(_0xd9b947,_0x180021){return db[_0x31db('0x3f')][_0x31db('0x47')](_0xd9b947[_0x31db('0x48')],{})[_0x31db('0x27')](function(_0x496d40){var _0x21998d=_0xd9b947['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x21998d)throw new Error(_0x31db('0x4a'));if(_0x21998d[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x4f861b=_0x496d40['get']({'plain':!![]});var _0x55db42=_0x31db('0x28');return db[_0x31db('0x4d')][_0x31db('0x46')]({'where':{'name':_0x55db42,'userProfileId':_0x21998d[_0x31db('0x4e')]},'raw':!![]})['then'](function(_0x31b324){if(_0x31b324&&_0x31b324[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x4f861b[_0x31db('0x2b')],'resourceId':_0x4f861b['id'],'type':_0x31b324['name'],'sectionId':_0x31b324['id']},{})[_0x31db('0x27')](function(){return _0x496d40;});}else{return _0x496d40;}})[_0x31db('0x43')](function(_0x51fe21){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x51fe21);throw _0x51fe21;});}return _0x496d40;})['then'](respondWithResult(_0x180021,0xc9))[_0x31db('0x43')](handleError(_0x180021,null));};exports['clone']=function(_0x919425,_0x31a1a8){var _0x5d0ff1={'where':{'id':_0x919425['params']['id']}},_0x3e6733={};_0x3e6733[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x3f')][_0x31db('0x52')]);_0x5d0ff1[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3e6733[_0x31db('0x32')],qs[_0x31db('0x34')](_0x919425['query'][_0x31db('0x34')]));_0x5d0ff1[_0x31db('0x33')]=_0x5d0ff1[_0x31db('0x33')][_0x31db('0x35')]?_0x5d0ff1[_0x31db('0x33')]:_0x3e6733[_0x31db('0x32')];if(_0x919425[_0x31db('0x30')][_0x31db('0x40')]){_0x5d0ff1['include']=[{'all':!![]}];}_0x5d0ff1=_[_0x31db('0x3c')]({},_0x5d0ff1,_0x919425['options']);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x5d0ff1)[_0x31db('0x27')](handleEntityNotFound(_0x31a1a8,null))[_0x31db('0x27')](function(_0x23e416){if(_0x23e416){var _0x3479b6=_0x23e416[_0x31db('0x49')]({'plain':!![]});_0x3479b6=qs[_0x31db('0x53')](_0x3479b6,['id','createdAt',_0x31db('0x54')]);_0x919425['body']=_[_0x31db('0x53')](_0x919425[_0x31db('0x48')],['id',_0x31db('0x55'),_0x31db('0x54')]);return db[_0x31db('0x3f')][_0x31db('0x47')](_[_0x31db('0x3c')](_0x3479b6,_0x919425[_0x31db('0x48')]),{'include':_0x919425[_0x31db('0x30')][_0x31db('0x40')]?[{'all':!![]}]:undefined})[_0x31db('0x27')](function(_0x4ced2f){var _0x1e8777=_0x919425['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x1e8777)throw new Error(_0x31db('0x4a'));if(_0x1e8777[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x10045a=_0x4ced2f[_0x31db('0x49')]({'plain':!![]});var _0x25f94c=_0x31db('0x28');return db['UserProfileSection'][_0x31db('0x46')]({'where':{'name':_0x25f94c,'userProfileId':_0x1e8777['userProfileId']},'raw':!![]})[_0x31db('0x27')](function(_0x5d448b){if(_0x5d448b&&_0x5d448b[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x10045a[_0x31db('0x2b')],'resourceId':_0x10045a['id'],'type':_0x5d448b[_0x31db('0x2b')],'sectionId':_0x5d448b['id']},{})[_0x31db('0x27')](function(){return _0x4ced2f;});}else{return _0x4ced2f;}})[_0x31db('0x43')](function(_0x166d49){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x166d49);throw _0x166d49;});}return _0x4ced2f;});}})[_0x31db('0x27')](respondWithResult(_0x31a1a8,0xc9))[_0x31db('0x43')](handleError(_0x31a1a8,null));};exports[_0x31db('0x26')]=function(_0x1526af,_0x54d3a0){if(_0x1526af[_0x31db('0x48')]['id']){delete _0x1526af[_0x31db('0x48')]['id'];}return db['Campaign'][_0x31db('0x46')]({'where':{'id':_0x1526af[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d3a0,null))[_0x31db('0x27')](saveUpdates(_0x1526af['body'],null))[_0x31db('0x27')](respondWithResult(_0x54d3a0,null))[_0x31db('0x43')](handleError(_0x54d3a0,null));};exports[_0x31db('0x56')]=function(_0x41179a,_0x2aafcd){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x41179a['params']['id']}})['then'](handleEntityNotFound(_0x2aafcd,null))['then'](removeEntity(_0x2aafcd,null))['catch'](handleError(_0x2aafcd,null));};exports[_0x31db('0x57')]=function(_0x225144,_0x1ab4c0,_0x374bd4){var _0x46c678={'raw':!![],'where':{}};var _0x21e3cf={};var _0x38cc83={'count':0x0,'rows':[]};return db['Campaign'][_0x31db('0x58')]({'where':{'id':_0x225144[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1ab4c0,null))[_0x31db('0x27')](function(_0x3ccf4c){if(_0x3ccf4c){_0x21e3cf['model']=_['keys'](db[_0x31db('0x59')][_0x31db('0x52')]);_0x21e3cf[_0x31db('0x30')]=_[_0x31db('0x31')](_0x225144[_0x31db('0x30')]);_0x21e3cf[_0x31db('0x39')]=_['intersection'](_0x21e3cf['model'],_0x21e3cf[_0x31db('0x30')]);_0x46c678[_0x31db('0x33')]=_[_0x31db('0x45')](_0x21e3cf['model'],qs[_0x31db('0x34')](_0x225144[_0x31db('0x30')][_0x31db('0x34')]));_0x46c678[_0x31db('0x33')]=_0x46c678[_0x31db('0x33')][_0x31db('0x35')]?_0x46c678['attributes']:_0x21e3cf['model'];if(!_0x225144[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x46c678['limit']=qs[_0x31db('0x20')](_0x225144[_0x31db('0x30')][_0x31db('0x20')]);_0x46c678[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x225144[_0x31db('0x30')]['offset']);}_0x46c678[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x225144[_0x31db('0x30')][_0x31db('0x5b')]);_0x46c678[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x225144[_0x31db('0x30')],_0x21e3cf[_0x31db('0x39')]));_0x46c678[_0x31db('0x38')]['CampaignId']=_0x3ccf4c['id'];if(_0x225144[_0x31db('0x30')][_0x31db('0x3b')]){_0x46c678['where']=_[_0x31db('0x3c')](_0x46c678[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x46c678[_0x31db('0x33')],function(_0x4aaa1f){var _0x189595={};_0x189595[_0x4aaa1f]={'$like':'%'+_0x225144['query'][_0x31db('0x3b')]+'%'};return _0x189595;})});}_0x46c678=_['merge']({},_0x46c678,_0x225144['options']);return db[_0x31db('0x59')][_0x31db('0x21')]({'where':_0x46c678['where']})[_0x31db('0x27')](function(_0x409b2d){_0x38cc83[_0x31db('0x21')]=_0x409b2d;if(_0x225144[_0x31db('0x30')][_0x31db('0x40')]){_0x46c678[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x59')][_0x31db('0x42')](_0x46c678);})[_0x31db('0x27')](function(_0x1e756d){_0x38cc83[_0x31db('0x5c')]=_0x1e756d;return _0x38cc83;});}})['then'](respondWithFilteredResult(_0x1ab4c0,_0x46c678))[_0x31db('0x43')](handleError(_0x1ab4c0,null));};exports[_0x31db('0x5d')]=function(_0x14a76c,_0x19b391,_0x6a0b03){var _0x1a443a={'raw':!![],'where':{}};var _0x58e645={};var _0x392886={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x14a76c[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x19b391,null))[_0x31db('0x27')](function(_0xa86607){if(_0xa86607){_0x58e645[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5e')][_0x31db('0x52')]);_0x58e645[_0x31db('0x30')]=_[_0x31db('0x31')](_0x14a76c[_0x31db('0x30')]);_0x58e645[_0x31db('0x39')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],_0x58e645[_0x31db('0x30')]);_0x1a443a[_0x31db('0x33')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],qs[_0x31db('0x34')](_0x14a76c[_0x31db('0x30')][_0x31db('0x34')]));_0x1a443a[_0x31db('0x33')]=_0x1a443a[_0x31db('0x33')]['length']?_0x1a443a[_0x31db('0x33')]:_0x58e645['model'];if(!_0x14a76c['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x1a443a[_0x31db('0x20')]=qs['limit'](_0x14a76c[_0x31db('0x30')][_0x31db('0x20')]);_0x1a443a['offset']=qs['offset'](_0x14a76c['query'][_0x31db('0x22')]);}_0x1a443a[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x14a76c[_0x31db('0x30')][_0x31db('0x5b')]);_0x1a443a[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x14a76c['query'],_0x58e645['filters']));_0x1a443a['where']['CampaignId']=_0xa86607['id'];if(_0x14a76c[_0x31db('0x30')]['filter']){_0x1a443a[_0x31db('0x38')]=_['merge'](_0x1a443a['where'],{'$or':_[_0x31db('0x2d')](_0x1a443a['attributes'],function(_0x2b69eb){var _0xe520e8={};_0xe520e8[_0x2b69eb]={'$like':'%'+_0x14a76c[_0x31db('0x30')]['filter']+'%'};return _0xe520e8;})});}_0x1a443a=_['merge']({},_0x1a443a,_0x14a76c['options']);return db[_0x31db('0x5e')][_0x31db('0x21')]({'where':_0x1a443a[_0x31db('0x38')]})[_0x31db('0x27')](function(_0xe9f99d){_0x392886['count']=_0xe9f99d;if(_0x14a76c[_0x31db('0x30')][_0x31db('0x40')]){_0x1a443a[_0x31db('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x31db('0x42')](_0x1a443a);})[_0x31db('0x27')](function(_0xb1be21){_0x392886[_0x31db('0x5c')]=_0xb1be21;return _0x392886;});}})[_0x31db('0x27')](respondWithFilteredResult(_0x19b391,_0x1a443a))[_0x31db('0x43')](handleError(_0x19b391,null));};exports['getHopperFinals']=function(_0x148410,_0x3a6dd2,_0x4d8f7e){var _0x5e12a7={'raw':!![],'where':{}};var _0x5364c3={};var _0x4f05b0={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x148410[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x3a6dd2,null))[_0x31db('0x27')](function(_0x2fc070){if(_0x2fc070){_0x5364c3[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5f')][_0x31db('0x52')]);_0x5364c3[_0x31db('0x30')]=_[_0x31db('0x31')](_0x148410[_0x31db('0x30')]);_0x5364c3[_0x31db('0x39')]=_[_0x31db('0x45')](_0x5364c3['model'],_0x5364c3[_0x31db('0x30')]);_0x5e12a7[_0x31db('0x33')]=_['intersection'](_0x5364c3[_0x31db('0x32')],qs[_0x31db('0x34')](_0x148410[_0x31db('0x30')][_0x31db('0x34')]));_0x5e12a7[_0x31db('0x33')]=_0x5e12a7[_0x31db('0x33')]['length']?_0x5e12a7[_0x31db('0x33')]:_0x5364c3[_0x31db('0x32')];if(!_0x148410['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x5e12a7[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x148410['query'][_0x31db('0x20')]);_0x5e12a7['offset']=qs['offset'](_0x148410[_0x31db('0x30')]['offset']);}_0x5e12a7[_0x31db('0x37')]=qs['sort'](_0x148410[_0x31db('0x30')][_0x31db('0x5b')]);_0x5e12a7[_0x31db('0x38')]=qs['filters'](_[_0x31db('0x3a')](_0x148410[_0x31db('0x30')],_0x5364c3[_0x31db('0x39')]));_0x5e12a7[_0x31db('0x38')][_0x31db('0x60')]=_0x2fc070['id'];if(_0x148410[_0x31db('0x30')][_0x31db('0x3b')]){_0x5e12a7[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5e12a7[_0x31db('0x38')],{'$or':_['map'](_0x5e12a7[_0x31db('0x33')],function(_0x22c5ec){var _0x4262e2={};_0x4262e2[_0x22c5ec]={'$like':'%'+_0x148410[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x4262e2;})});}_0x5e12a7=_[_0x31db('0x3c')]({},_0x5e12a7,_0x148410['options']);return db[_0x31db('0x5f')][_0x31db('0x21')]({'where':_0x5e12a7['where']})[_0x31db('0x27')](function(_0x25fce6){_0x4f05b0[_0x31db('0x21')]=_0x25fce6;if(_0x148410[_0x31db('0x30')]['includeAll']){_0x5e12a7[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x5f')]['findAll'](_0x5e12a7);})['then'](function(_0x355654){_0x4f05b0[_0x31db('0x5c')]=_0x355654;return _0x4f05b0;});}})['then'](respondWithFilteredResult(_0x3a6dd2,_0x5e12a7))[_0x31db('0x43')](handleError(_0x3a6dd2,null));};exports[_0x31db('0x61')]=function(_0x45adac,_0x423767,_0xeb01e3){var _0x269328={'raw':!![],'where':{}};var _0x347532={};var _0x180c15={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x45adac[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x423767,null))[_0x31db('0x27')](function(_0x481a5c){if(_0x481a5c){_0x347532['model']=_[_0x31db('0x31')](db[_0x31db('0x62')][_0x31db('0x52')]);_0x347532[_0x31db('0x30')]=_[_0x31db('0x31')](_0x45adac['query']);_0x347532[_0x31db('0x39')]=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],_0x347532[_0x31db('0x30')]);_0x269328['attributes']=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],qs[_0x31db('0x34')](_0x45adac['query'][_0x31db('0x34')]));_0x269328[_0x31db('0x33')]=_0x269328[_0x31db('0x33')][_0x31db('0x35')]?_0x269328[_0x31db('0x33')]:_0x347532['model'];if(!_0x45adac[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x269328[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x45adac[_0x31db('0x30')][_0x31db('0x20')]);_0x269328[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x45adac[_0x31db('0x30')][_0x31db('0x22')]);}_0x269328['order']=qs[_0x31db('0x5b')](_0x45adac['query'][_0x31db('0x5b')]);_0x269328[_0x31db('0x38')]=qs['filters'](_['pick'](_0x45adac[_0x31db('0x30')],_0x347532[_0x31db('0x39')]));_0x269328[_0x31db('0x38')]['CampaignId']=_0x481a5c['id'];if(_0x45adac[_0x31db('0x30')][_0x31db('0x3b')]){_0x269328[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x269328['where'],{'$or':_[_0x31db('0x2d')](_0x269328[_0x31db('0x33')],function(_0xaf54dc){var _0x114943={};_0x114943[_0xaf54dc]={'$like':'%'+_0x45adac[_0x31db('0x30')]['filter']+'%'};return _0x114943;})});}_0x269328=_[_0x31db('0x3c')]({},_0x269328,_0x45adac[_0x31db('0x3e')]);return db[_0x31db('0x62')][_0x31db('0x21')]({'where':_0x269328['where']})[_0x31db('0x27')](function(_0x1f7b90){_0x180c15[_0x31db('0x21')]=_0x1f7b90;if(_0x45adac[_0x31db('0x30')][_0x31db('0x40')]){_0x269328[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x62')][_0x31db('0x42')](_0x269328);})[_0x31db('0x27')](function(_0x3cfe19){_0x180c15[_0x31db('0x5c')]=_0x3cfe19;return _0x180c15;});}})['then'](respondWithFilteredResult(_0x423767,_0x269328))[_0x31db('0x43')](handleError(_0x423767,null));};exports[_0x31db('0x63')]=function(_0xcee621,_0x4430e9,_0x3f15e6){var _0x2bb353={};var _0x4ebd4f={};var _0x1324ee;var _0x5ef744;return db[_0x31db('0x3f')]['findOne']({'where':{'id':_0xcee621[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x4430e9,null))[_0x31db('0x27')](function(_0x1de2d0){if(_0x1de2d0){_0x1324ee=_0x1de2d0;_0x4ebd4f['model']=_[_0x31db('0x31')](db[_0x31db('0x64')][_0x31db('0x52')]);_0x4ebd4f[_0x31db('0x30')]=_[_0x31db('0x31')](_0xcee621[_0x31db('0x30')]);_0x4ebd4f[_0x31db('0x39')]=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],_0x4ebd4f[_0x31db('0x30')]);_0x2bb353['attributes']=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],qs[_0x31db('0x34')](_0xcee621[_0x31db('0x30')][_0x31db('0x34')]));_0x2bb353[_0x31db('0x33')]=_0x2bb353[_0x31db('0x33')][_0x31db('0x35')]?_0x2bb353[_0x31db('0x33')]:_0x4ebd4f['model'];_0x2bb353[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0xcee621[_0x31db('0x30')][_0x31db('0x5b')]);_0x2bb353[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0xcee621[_0x31db('0x30')],_0x4ebd4f[_0x31db('0x39')]));if(_0xcee621[_0x31db('0x30')]['filter']){_0x2bb353[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x2bb353['where'],{'$or':_['map'](_0x2bb353[_0x31db('0x33')],function(_0x1043d5){var _0x15cde6={};_0x15cde6[_0x1043d5]={'$like':'%'+_0xcee621[_0x31db('0x30')]['filter']+'%'};return _0x15cde6;})});}_0x2bb353=_['merge']({},_0x2bb353,_0xcee621['options']);return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x377ac1){if(_0x377ac1){_0x5ef744=_0x377ac1[_0x31db('0x35')];if(!_0xcee621[_0x31db('0x30')]['hasOwnProperty'](_0x31db('0x5a'))){_0x2bb353[_0x31db('0x20')]=qs[_0x31db('0x20')](_0xcee621[_0x31db('0x30')][_0x31db('0x20')]);_0x2bb353[_0x31db('0x22')]=qs['offset'](_0xcee621[_0x31db('0x30')][_0x31db('0x22')]);}return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x160775){if(_0x160775){return _0x160775?{'count':_0x5ef744,'rows':_0x160775}:null;}})[_0x31db('0x27')](respondWithResult(_0x4430e9,null))[_0x31db('0x43')](handleError(_0x4430e9,null));};exports['addLists']=function(_0x21dfa2,_0x55354e,_0x2f7746){var _0x27ab95,_0xd418fe;var _0x1376dd=[];var _0x1fdb48=moment()[_0x31db('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')]['find']({'where':{'id':_0x21dfa2['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x55354e,null))[_0x31db('0x27')](function(_0x17def){if(_0x17def){_0xd418fe=_0x17def;return _0x17def[_0x31db('0x66')](_0x21dfa2['body'][_0x31db('0x67')],_[_0x31db('0x53')](_0x21dfa2['body'],[_0x31db('0x67'),'id'])||{});}return null;})['spread'](function(_0x186f56){var _0x24dc7f;var _0x30ad4c;_0x27ab95=_0x186f56||[];var _0x3ebfe3=[];if(_0x186f56){for(var _0x41849c=0x0;_0x41849c<_0x186f56[_0x31db('0x35')];_0x41849c+=0x1){var _0x3d90db=_0x186f56[_0x41849c]['get']({'plain':!![]});_0xd418fe[_0x31db('0x68')]=_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]?_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]:_0xd418fe[_0x31db('0x68')];switch(_0xd418fe['dialCheckDuplicateType']){case'always':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery']([_0x31db('0x6c'),_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt','updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))['from']('cm_contacts')[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x31db('0x77')](_0x31db('0x78'))[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]()))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;case'onlyIfOpen':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery'](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')](_0x31db('0x7b'),'scheduledAt')[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))['field'](_0x21dfa2[_0x31db('0x44')]['id']['toString'](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')]['toString']())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')['where'](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;default:_0x24dc7f=squel['insert']()[_0x31db('0x6a')]('cm_hopper')[_0x31db('0x7d')](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db['CmListId'][_0x31db('0x73')](),'ListId')['field'](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))['where'](_0x31db('0x7e'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();}_0x30ad4c=squel['insert']()[_0x31db('0x6a')](_0x31db('0x7f'))[_0x31db('0x7d')](['cmHopperId',_0x31db('0x6d'),_0x31db('0x6c'),'OrderBy','createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x80'),'id')[_0x31db('0x71')]('NOW()','scheduledAt')[_0x31db('0x71')](_0x31db('0x81'),_0x31db('0x6c'))[_0x31db('0x71')]('ci.OrderBY',_0x31db('0x82'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x83'),'ci')[_0x31db('0x84')](_0x31db('0x6b'),'h',_0x31db('0x85'))[_0x31db('0x38')](_0x31db('0x86'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x87'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x88'),_0x1fdb48))[_0x31db('0x73')]();_0x3ebfe3[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x24dc7f));_0x1376dd[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x30ad4c));}return BPromise[_0x31db('0x8b')](_0x3ebfe3);}})[_0x31db('0x27')](function(){return BPromise[_0x31db('0x8b')](_0x1376dd);})[_0x31db('0x27')](function(){return _0x27ab95;})[_0x31db('0x27')](respondWithResult(_0x55354e,null))['catch'](handleError(_0x55354e,null));};exports[_0x31db('0x8c')]=function(_0x5965e1,_0x5ba364,_0x1222b8){return db[_0x31db('0x3f')]['find']({'where':{'id':_0x5965e1['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x5ba364,null))[_0x31db('0x27')](function(_0x4e534e){if(_0x4e534e){return _0x4e534e[_0x31db('0x8c')](_0x5965e1['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x901a92){if(_0x901a92){return db['CmHopper'][_0x31db('0x56')]({'where':{'ListId':_0x5965e1[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x5965e1[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x901a92;});}})[_0x31db('0x27')](respondWithStatusCode(_0x5ba364,null))['catch'](handleError(_0x5ba364,null));};exports['getBlackLists']=function(_0x289317,_0x1311cb,_0x45f527){var _0x13c2c0={};var _0x3481b1={};var _0x8df891;var _0x1e7170;return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x289317[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1311cb,null))[_0x31db('0x27')](function(_0x58a966){if(_0x58a966){_0x8df891=_0x58a966;_0x3481b1[_0x31db('0x32')]=_[_0x31db('0x31')](db['CmList'][_0x31db('0x52')]);_0x3481b1[_0x31db('0x30')]=_[_0x31db('0x31')](_0x289317['query']);_0x3481b1[_0x31db('0x39')]=_[_0x31db('0x45')](_0x3481b1['model'],_0x3481b1[_0x31db('0x30')]);_0x13c2c0[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3481b1['model'],qs[_0x31db('0x34')](_0x289317[_0x31db('0x30')][_0x31db('0x34')]));_0x13c2c0['attributes']=_0x13c2c0[_0x31db('0x33')]['length']?_0x13c2c0[_0x31db('0x33')]:_0x3481b1['model'];_0x13c2c0[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x289317[_0x31db('0x30')]['sort']);_0x13c2c0['where']=qs[_0x31db('0x39')](_['pick'](_0x289317[_0x31db('0x30')],_0x3481b1[_0x31db('0x39')]));if(_0x289317[_0x31db('0x30')]['filter']){_0x13c2c0[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x13c2c0[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x13c2c0[_0x31db('0x33')],function(_0x1db46f){var _0x54786f={};_0x54786f[_0x1db46f]={'$like':'%'+_0x289317['query']['filter']+'%'};return _0x54786f;})});}_0x13c2c0=_['merge']({},_0x13c2c0,_0x289317[_0x31db('0x3e')]);return _0x8df891[_0x31db('0x8d')](_0x13c2c0);}})[_0x31db('0x27')](function(_0x1fab25){if(_0x1fab25){_0x1e7170=_0x1fab25[_0x31db('0x35')];if(!_0x289317['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x13c2c0[_0x31db('0x20')]=qs['limit'](_0x289317['query'][_0x31db('0x20')]);_0x13c2c0[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x289317[_0x31db('0x30')][_0x31db('0x22')]);}return _0x8df891['getBlackLists'](_0x13c2c0);}})[_0x31db('0x27')](function(_0x35e245){if(_0x35e245){return _0x35e245?{'count':_0x1e7170,'rows':_0x35e245}:null;}})[_0x31db('0x27')](respondWithResult(_0x1311cb,null))[_0x31db('0x43')](handleError(_0x1311cb,null));};exports[_0x31db('0x8e')]=function(_0x4962ea,_0x372e0c,_0x4ddd13){var _0x3e3cf2,_0xcf6abf;var _0x3299c3=[];var _0xcd46dd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x4962ea[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x372e0c,null))[_0x31db('0x27')](function(_0x771fd7){if(_0x771fd7){_0xcf6abf=_0x771fd7;return _0x771fd7[_0x31db('0x8e')](_0x4962ea[_0x31db('0x48')][_0x31db('0x67')],_[_0x31db('0x53')](_0x4962ea[_0x31db('0x48')],[_0x31db('0x67'),'id'])||{});}return null;})[_0x31db('0x8f')](function(_0x2f19bd){var _0x44f158;var _0x400a14;_0x3e3cf2=_0x2f19bd||[];var _0x317990=[];if(_0x2f19bd){for(var _0x33c0b6=0x0;_0x33c0b6<_0x2f19bd[_0x31db('0x35')];_0x33c0b6+=0x1){var _0x131942=_0x2f19bd[_0x33c0b6][_0x31db('0x49')]({'plain':!![]});_0x44f158=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x90'))[_0x31db('0x7d')]([_0x31db('0x6c'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),'updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x131942['CmListId'][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x4962ea['params']['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')](_0x31db('0x7b'),'createdAt')[_0x31db('0x71')](_0x31db('0x7b'),'updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')](_0x31db('0x7e'),_0x131942[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();_0x317990[_0x31db('0x89')](db['sequelize'][_0x31db('0x30')](_0x44f158));}return BPromise[_0x31db('0x8b')](_0x317990);}})[_0x31db('0x27')](function(){return _0x3e3cf2;})[_0x31db('0x27')](respondWithResult(_0x372e0c,null))[_0x31db('0x43')](handleError(_0x372e0c,null));};exports[_0x31db('0x91')]=function(_0x3839be,_0xb2967d,_0x378b96){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x3839be[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0xb2967d,null))[_0x31db('0x27')](function(_0x459193){if(_0x459193){return _0x459193['removeBlackLists'](_0x3839be['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x26c21d){if(_0x26c21d){return db[_0x31db('0x62')][_0x31db('0x56')]({'where':{'ListId':_0x3839be[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x3839be[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x26c21d;});}})[_0x31db('0x27')](respondWithStatusCode(_0xb2967d,null))['catch'](handleError(_0xb2967d,null));}; \ No newline at end of file +var _0xbc87=['fromQuery','ContactId','NOW()','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','autoAssociation','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ListId','select','field','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen'];(function(_0x4736e6,_0x50483b){var _0x3e3e28=function(_0x1be431){while(--_0x1be431){_0x4736e6['push'](_0x4736e6['shift']());}};_0x3e3e28(++_0x50483b);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x1456b0,_0x5eb20a){_0x1456b0=_0x1456b0-0x0;var _0x50dca0=_0xbc87[_0x1456b0];return _0x50dca0;};'use strict';var emlformat=require(_0x7bc8('0x0'));var rimraf=require(_0x7bc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bc8('0x2'));var rp=require(_0x7bc8('0x3'));var moment=require(_0x7bc8('0x4'));var BPromise=require(_0x7bc8('0x5'));var Mustache=require('mustache');var util=require(_0x7bc8('0x6'));var path=require(_0x7bc8('0x7'));var sox=require(_0x7bc8('0x8'));var csv=require(_0x7bc8('0x9'));var ejs=require(_0x7bc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bc8('0xb'));var crypto=require(_0x7bc8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7bc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7bc8('0xe'));var Papa=require(_0x7bc8('0xf'));var Redis=require('ioredis');var authService=require(_0x7bc8('0x10'));var qs=require(_0x7bc8('0x11'));var as=require(_0x7bc8('0x12'));var hardwareService=require(_0x7bc8('0x13'));var logger=require(_0x7bc8('0x14'))('api');var utils=require(_0x7bc8('0x15'));var config=require(_0x7bc8('0x16'));var licenseUtil=require(_0x7bc8('0x17'));var db=require(_0x7bc8('0x18'))['db'];function respondWithStatusCode(_0x3c15da,_0x474652){_0x474652=_0x474652||0xcc;return function(_0x1a1d46){if(_0x1a1d46){return _0x3c15da[_0x7bc8('0x19')](_0x474652);}return _0x3c15da[_0x7bc8('0x1a')](_0x474652)[_0x7bc8('0x1b')]();};}function respondWithResult(_0x7a74b4,_0x5a3bcc){_0x5a3bcc=_0x5a3bcc||0xc8;return function(_0xaffc57){if(_0xaffc57){return _0x7a74b4[_0x7bc8('0x1a')](_0x5a3bcc)[_0x7bc8('0x1c')](_0xaffc57);}};}function respondWithFilteredResult(_0x119c45,_0x5bebbd){return function(_0x3db956){if(_0x3db956){var _0x53be05=typeof _0x5bebbd[_0x7bc8('0x1d')]===_0x7bc8('0x1e')&&typeof _0x5bebbd[_0x7bc8('0x1f')]===_0x7bc8('0x1e');var _0x2afec4=_0x3db956['count'];var _0xcfb543=_0x53be05?0x0:_0x5bebbd[_0x7bc8('0x1d')];var _0x3f51ec=_0x53be05?_0x3db956[_0x7bc8('0x20')]:_0x5bebbd[_0x7bc8('0x1d')]+_0x5bebbd[_0x7bc8('0x1f')];var _0x7c2bdb;if(_0x3f51ec>=_0x2afec4){_0x3f51ec=_0x2afec4;_0x7c2bdb=0xc8;}else{_0x7c2bdb=0xce;}_0x119c45[_0x7bc8('0x1a')](_0x7c2bdb);return _0x119c45['set'](_0x7bc8('0x21'),_0xcfb543+'-'+_0x3f51ec+'/'+_0x2afec4)['json'](_0x3db956);}return null;};}function patchUpdates(_0x3a3e51){return function(_0x3eda19){try{jsonpatch[_0x7bc8('0x22')](_0x3eda19,_0x3a3e51,!![]);}catch(_0x42a251){return BPromise[_0x7bc8('0x23')](_0x42a251);}return _0x3eda19[_0x7bc8('0x24')]();};}function saveUpdates(_0x5b26fe,_0x83c345){return function(_0x60cbb9){if(_0x60cbb9){return _0x60cbb9[_0x7bc8('0x25')](_0x5b26fe)[_0x7bc8('0x26')](function(_0x2fd38b){return _0x2fd38b;});}return null;};}function removeEntity(_0xc68f2c,_0x30c529){return function(_0x305e52){if(_0x305e52){return _0x305e52[_0x7bc8('0x27')]()[_0x7bc8('0x26')](function(){var _0x1a2835=_0x305e52['get']({'plain':!![]});var _0x3ef138=_0x7bc8('0x28');return db[_0x7bc8('0x29')][_0x7bc8('0x27')]({'where':{'type':_0x3ef138,'resourceId':_0x1a2835['id']}})['then'](function(){return _0x305e52;});})['then'](function(){_0xc68f2c['status'](0xcc)[_0x7bc8('0x1b')]();});}};}function handleEntityNotFound(_0x402f17,_0x157b66){return function(_0x2f519c){if(!_0x2f519c){_0x402f17['sendStatus'](0x194);}return _0x2f519c;};}function handleError(_0x3e4f4c,_0x344fa0){_0x344fa0=_0x344fa0||0x1f4;return function(_0x212515){logger['error'](_0x212515[_0x7bc8('0x2a')]);if(_0x212515['name']){delete _0x212515[_0x7bc8('0x2b')];}_0x3e4f4c[_0x7bc8('0x1a')](_0x344fa0)[_0x7bc8('0x2c')](_0x212515);};}exports[_0x7bc8('0x2d')]=function(_0xe8418c,_0x235ab8){var _0x1540b5={},_0xbe46e2={},_0xd7d333={'count':0x0,'rows':[]};var _0x44afe0=_[_0x7bc8('0x2e')](db[_0x7bc8('0x2f')][_0x7bc8('0x30')],function(_0x43d13d){return{'name':_0x43d13d['fieldName'],'type':_0x43d13d[_0x7bc8('0x31')][_0x7bc8('0x32')]};});_0xbe46e2[_0x7bc8('0x33')]=_['map'](_0x44afe0,_0x7bc8('0x2b'));_0xbe46e2['query']=_[_0x7bc8('0x34')](_0xe8418c['query']);_0xbe46e2[_0x7bc8('0x35')]=_[_0x7bc8('0x36')](_0xbe46e2[_0x7bc8('0x33')],_0xbe46e2[_0x7bc8('0x37')]);_0x1540b5[_0x7bc8('0x38')]=_['intersection'](_0xbe46e2[_0x7bc8('0x33')],qs[_0x7bc8('0x39')](_0xe8418c[_0x7bc8('0x37')][_0x7bc8('0x39')]));_0x1540b5[_0x7bc8('0x38')]=_0x1540b5[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x1540b5[_0x7bc8('0x38')]:_0xbe46e2[_0x7bc8('0x33')];if(!_0xe8418c[_0x7bc8('0x37')][_0x7bc8('0x3b')](_0x7bc8('0x3c'))){_0x1540b5[_0x7bc8('0x1f')]=qs[_0x7bc8('0x1f')](_0xe8418c['query'][_0x7bc8('0x1f')]);_0x1540b5[_0x7bc8('0x1d')]=qs[_0x7bc8('0x1d')](_0xe8418c[_0x7bc8('0x37')][_0x7bc8('0x1d')]);}_0x1540b5[_0x7bc8('0x3d')]=qs[_0x7bc8('0x3e')](_0xe8418c[_0x7bc8('0x37')][_0x7bc8('0x3e')]);_0x1540b5[_0x7bc8('0x3f')]=qs[_0x7bc8('0x35')](_[_0x7bc8('0x40')](_0xe8418c[_0x7bc8('0x37')],_0xbe46e2[_0x7bc8('0x35')]),_0x44afe0);if(_0xe8418c[_0x7bc8('0x37')][_0x7bc8('0x41')]){_0x1540b5['where']=_['merge'](_0x1540b5[_0x7bc8('0x3f')],{'$or':_[_0x7bc8('0x2e')](_0x44afe0,function(_0x2a3097){if(_0x2a3097[_0x7bc8('0x31')]!==_0x7bc8('0x42')){var _0x5185c5={};_0x5185c5[_0x2a3097[_0x7bc8('0x2b')]]={'$like':'%'+_0xe8418c[_0x7bc8('0x37')][_0x7bc8('0x41')]+'%'};return _0x5185c5;}})});}_0x1540b5=_[_0x7bc8('0x43')]({},_0x1540b5,_0xe8418c[_0x7bc8('0x44')]);var _0x21172d={'where':_0x1540b5[_0x7bc8('0x3f')]};return db['Campaign']['count'](_0x21172d)[_0x7bc8('0x26')](function(_0xbabf7b){_0xd7d333[_0x7bc8('0x20')]=_0xbabf7b;if(_0xe8418c['query'][_0x7bc8('0x45')]){_0x1540b5[_0x7bc8('0x46')]=[{'all':!![]}];}return db['Campaign'][_0x7bc8('0x47')](_0x1540b5);})[_0x7bc8('0x26')](function(_0x22f361){_0xd7d333[_0x7bc8('0x48')]=_0x22f361;return _0xd7d333;})[_0x7bc8('0x26')](respondWithFilteredResult(_0x235ab8,_0x1540b5))[_0x7bc8('0x49')](handleError(_0x235ab8,null));};exports[_0x7bc8('0x4a')]=function(_0x4c79e3,_0x397966){var _0x159350={'raw':![],'where':{'id':_0x4c79e3[_0x7bc8('0x4b')]['id']}},_0x282fd1={};_0x282fd1[_0x7bc8('0x33')]=_[_0x7bc8('0x34')](db[_0x7bc8('0x2f')][_0x7bc8('0x30')]);_0x282fd1[_0x7bc8('0x37')]=_[_0x7bc8('0x34')](_0x4c79e3[_0x7bc8('0x37')]);_0x282fd1[_0x7bc8('0x35')]=_['intersection'](_0x282fd1[_0x7bc8('0x33')],_0x282fd1[_0x7bc8('0x37')]);_0x159350['attributes']=_['intersection'](_0x282fd1[_0x7bc8('0x33')],qs[_0x7bc8('0x39')](_0x4c79e3[_0x7bc8('0x37')][_0x7bc8('0x39')]));_0x159350[_0x7bc8('0x38')]=_0x159350[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x159350[_0x7bc8('0x38')]:_0x282fd1[_0x7bc8('0x33')];if(_0x4c79e3[_0x7bc8('0x37')]['includeAll']){_0x159350[_0x7bc8('0x46')]=[{'all':!![]}];}_0x159350=_[_0x7bc8('0x43')]({},_0x159350,_0x4c79e3['options']);return db[_0x7bc8('0x2f')][_0x7bc8('0x4c')](_0x159350)[_0x7bc8('0x26')](handleEntityNotFound(_0x397966,null))['then'](respondWithResult(_0x397966,null))[_0x7bc8('0x49')](handleError(_0x397966,null));};exports[_0x7bc8('0x4d')]=function(_0x32166f,_0x3bc9b8){return db[_0x7bc8('0x2f')]['create'](_0x32166f[_0x7bc8('0x4e')],{})[_0x7bc8('0x26')](function(_0x1a150d){var _0x4d0d49=_0x32166f['user'][_0x7bc8('0x4f')]({'plain':!![]});if(!_0x4d0d49)throw new Error(_0x7bc8('0x50'));if(_0x4d0d49[_0x7bc8('0x51')]===_0x7bc8('0x52')){var _0x456393=_0x1a150d['get']({'plain':!![]});var _0x1794bc=_0x7bc8('0x28');return db[_0x7bc8('0x53')][_0x7bc8('0x4c')]({'where':{'name':_0x1794bc,'userProfileId':_0x4d0d49[_0x7bc8('0x54')]},'raw':!![]})[_0x7bc8('0x26')](function(_0x4b4577){if(_0x4b4577&&_0x4b4577['autoAssociation']===0x0){return db['UserProfileResource'][_0x7bc8('0x4d')]({'name':_0x456393[_0x7bc8('0x2b')],'resourceId':_0x456393['id'],'type':_0x4b4577[_0x7bc8('0x2b')],'sectionId':_0x4b4577['id']},{})[_0x7bc8('0x26')](function(){return _0x1a150d;});}else{return _0x1a150d;}})['catch'](function(_0x161fc5){logger[_0x7bc8('0x55')](_0x7bc8('0x56'),_0x161fc5);throw _0x161fc5;});}return _0x1a150d;})[_0x7bc8('0x26')](respondWithResult(_0x3bc9b8,0xc9))[_0x7bc8('0x49')](handleError(_0x3bc9b8,null));};exports[_0x7bc8('0x57')]=function(_0x24a8e1,_0x1840d1){var _0x964898={'where':{'id':_0x24a8e1[_0x7bc8('0x4b')]['id']}},_0x252026={};_0x252026[_0x7bc8('0x33')]=_['keys'](db[_0x7bc8('0x2f')][_0x7bc8('0x30')]);_0x964898['attributes']=_['intersection'](_0x252026['model'],qs[_0x7bc8('0x39')](_0x24a8e1[_0x7bc8('0x37')][_0x7bc8('0x39')]));_0x964898[_0x7bc8('0x38')]=_0x964898[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x964898[_0x7bc8('0x38')]:_0x252026[_0x7bc8('0x33')];if(_0x24a8e1[_0x7bc8('0x37')][_0x7bc8('0x45')]){_0x964898[_0x7bc8('0x46')]=[{'all':!![]}];}_0x964898=_['merge']({},_0x964898,_0x24a8e1[_0x7bc8('0x44')]);return db[_0x7bc8('0x2f')]['find'](_0x964898)[_0x7bc8('0x26')](handleEntityNotFound(_0x1840d1,null))['then'](function(_0x41c85c){if(_0x41c85c){var _0x42ae87=_0x41c85c[_0x7bc8('0x4f')]({'plain':!![]});_0x42ae87=qs['omit'](_0x42ae87,['id',_0x7bc8('0x58'),_0x7bc8('0x59')]);_0x24a8e1[_0x7bc8('0x4e')]=_[_0x7bc8('0x5a')](_0x24a8e1[_0x7bc8('0x4e')],['id','createdAt',_0x7bc8('0x59')]);return db[_0x7bc8('0x2f')]['create'](_[_0x7bc8('0x43')](_0x42ae87,_0x24a8e1[_0x7bc8('0x4e')]),{'include':_0x24a8e1[_0x7bc8('0x37')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2734ea){var _0xf43fb2=_0x24a8e1[_0x7bc8('0x52')][_0x7bc8('0x4f')]({'plain':!![]});if(!_0xf43fb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf43fb2[_0x7bc8('0x51')]===_0x7bc8('0x52')){var _0x3af495=_0x2734ea[_0x7bc8('0x4f')]({'plain':!![]});var _0x43f572='IvrCampaigns';return db[_0x7bc8('0x53')][_0x7bc8('0x4c')]({'where':{'name':_0x43f572,'userProfileId':_0xf43fb2[_0x7bc8('0x54')]},'raw':!![]})['then'](function(_0x186481){if(_0x186481&&_0x186481[_0x7bc8('0x5b')]===0x0){return db['UserProfileResource'][_0x7bc8('0x4d')]({'name':_0x3af495[_0x7bc8('0x2b')],'resourceId':_0x3af495['id'],'type':_0x186481['name'],'sectionId':_0x186481['id']},{})['then'](function(){return _0x2734ea;});}else{return _0x2734ea;}})[_0x7bc8('0x49')](function(_0x540f5c){logger['error'](_0x7bc8('0x56'),_0x540f5c);throw _0x540f5c;});}return _0x2734ea;});}})[_0x7bc8('0x26')](respondWithResult(_0x1840d1,0xc9))[_0x7bc8('0x49')](handleError(_0x1840d1,null));};exports[_0x7bc8('0x25')]=function(_0x4b4bf9,_0x43f7a5){if(_0x4b4bf9[_0x7bc8('0x4e')]['id']){delete _0x4b4bf9['body']['id'];}return db[_0x7bc8('0x2f')][_0x7bc8('0x4c')]({'where':{'id':_0x4b4bf9['params']['id']}})['then'](handleEntityNotFound(_0x43f7a5,null))[_0x7bc8('0x26')](saveUpdates(_0x4b4bf9[_0x7bc8('0x4e')],null))['then'](respondWithResult(_0x43f7a5,null))[_0x7bc8('0x49')](handleError(_0x43f7a5,null));};exports[_0x7bc8('0x27')]=function(_0x54184f,_0x55bfa2){return db[_0x7bc8('0x2f')][_0x7bc8('0x4c')]({'where':{'id':_0x54184f[_0x7bc8('0x4b')]['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0x55bfa2,null))[_0x7bc8('0x26')](removeEntity(_0x55bfa2,null))[_0x7bc8('0x49')](handleError(_0x55bfa2,null));};exports['getHoppers']=function(_0x230d47,_0x253c38,_0x583ac8){var _0x5b0acb={'raw':!![],'where':{}};var _0x41d6d0={};var _0x46c8f3={'count':0x0,'rows':[]};return db[_0x7bc8('0x2f')][_0x7bc8('0x5c')]({'where':{'id':_0x230d47['params']['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0x253c38,null))[_0x7bc8('0x26')](function(_0x30ac02){if(_0x30ac02){_0x41d6d0['model']=_[_0x7bc8('0x34')](db[_0x7bc8('0x5d')]['rawAttributes']);_0x41d6d0['query']=_['keys'](_0x230d47[_0x7bc8('0x37')]);_0x41d6d0['filters']=_[_0x7bc8('0x36')](_0x41d6d0['model'],_0x41d6d0[_0x7bc8('0x37')]);_0x5b0acb[_0x7bc8('0x38')]=_[_0x7bc8('0x36')](_0x41d6d0[_0x7bc8('0x33')],qs[_0x7bc8('0x39')](_0x230d47[_0x7bc8('0x37')]['fields']));_0x5b0acb[_0x7bc8('0x38')]=_0x5b0acb[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x5b0acb['attributes']:_0x41d6d0[_0x7bc8('0x33')];if(!_0x230d47[_0x7bc8('0x37')][_0x7bc8('0x3b')](_0x7bc8('0x3c'))){_0x5b0acb[_0x7bc8('0x1f')]=qs[_0x7bc8('0x1f')](_0x230d47[_0x7bc8('0x37')][_0x7bc8('0x1f')]);_0x5b0acb[_0x7bc8('0x1d')]=qs['offset'](_0x230d47['query'][_0x7bc8('0x1d')]);}_0x5b0acb['order']=qs[_0x7bc8('0x3e')](_0x230d47[_0x7bc8('0x37')][_0x7bc8('0x3e')]);_0x5b0acb[_0x7bc8('0x3f')]=qs[_0x7bc8('0x35')](_[_0x7bc8('0x40')](_0x230d47[_0x7bc8('0x37')],_0x41d6d0['filters']));_0x5b0acb[_0x7bc8('0x3f')][_0x7bc8('0x5e')]=_0x30ac02['id'];if(_0x230d47[_0x7bc8('0x37')][_0x7bc8('0x41')]){_0x5b0acb[_0x7bc8('0x3f')]=_[_0x7bc8('0x43')](_0x5b0acb['where'],{'$or':_[_0x7bc8('0x2e')](_0x5b0acb[_0x7bc8('0x38')],function(_0x406c35){var _0x486021={};_0x486021[_0x406c35]={'$like':'%'+_0x230d47[_0x7bc8('0x37')][_0x7bc8('0x41')]+'%'};return _0x486021;})});}_0x5b0acb=_[_0x7bc8('0x43')]({},_0x5b0acb,_0x230d47[_0x7bc8('0x44')]);return db[_0x7bc8('0x5d')][_0x7bc8('0x20')]({'where':_0x5b0acb['where']})[_0x7bc8('0x26')](function(_0x266ff6){_0x46c8f3[_0x7bc8('0x20')]=_0x266ff6;if(_0x230d47[_0x7bc8('0x37')][_0x7bc8('0x45')]){_0x5b0acb['include']=[{'all':!![]}];}return db[_0x7bc8('0x5d')][_0x7bc8('0x47')](_0x5b0acb);})[_0x7bc8('0x26')](function(_0x548e03){_0x46c8f3[_0x7bc8('0x48')]=_0x548e03;return _0x46c8f3;});}})[_0x7bc8('0x26')](respondWithFilteredResult(_0x253c38,_0x5b0acb))[_0x7bc8('0x49')](handleError(_0x253c38,null));};exports[_0x7bc8('0x5f')]=function(_0x523944,_0x5ac909,_0x1821cd){var _0x3b9408={'raw':!![],'where':{}};var _0xce00bc={};var _0x22e3ec={'count':0x0,'rows':[]};return db['Campaign'][_0x7bc8('0x5c')]({'where':{'id':_0x523944[_0x7bc8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ac909,null))[_0x7bc8('0x26')](function(_0x250a6e){if(_0x250a6e){_0xce00bc[_0x7bc8('0x33')]=_[_0x7bc8('0x34')](db[_0x7bc8('0x60')]['rawAttributes']);_0xce00bc[_0x7bc8('0x37')]=_[_0x7bc8('0x34')](_0x523944[_0x7bc8('0x37')]);_0xce00bc[_0x7bc8('0x35')]=_[_0x7bc8('0x36')](_0xce00bc['model'],_0xce00bc[_0x7bc8('0x37')]);_0x3b9408[_0x7bc8('0x38')]=_[_0x7bc8('0x36')](_0xce00bc[_0x7bc8('0x33')],qs[_0x7bc8('0x39')](_0x523944[_0x7bc8('0x37')][_0x7bc8('0x39')]));_0x3b9408['attributes']=_0x3b9408[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x3b9408['attributes']:_0xce00bc[_0x7bc8('0x33')];if(!_0x523944[_0x7bc8('0x37')][_0x7bc8('0x3b')](_0x7bc8('0x3c'))){_0x3b9408[_0x7bc8('0x1f')]=qs[_0x7bc8('0x1f')](_0x523944['query'][_0x7bc8('0x1f')]);_0x3b9408['offset']=qs['offset'](_0x523944['query'][_0x7bc8('0x1d')]);}_0x3b9408['order']=qs[_0x7bc8('0x3e')](_0x523944['query'][_0x7bc8('0x3e')]);_0x3b9408[_0x7bc8('0x3f')]=qs[_0x7bc8('0x35')](_[_0x7bc8('0x40')](_0x523944[_0x7bc8('0x37')],_0xce00bc['filters']));_0x3b9408[_0x7bc8('0x3f')]['CampaignId']=_0x250a6e['id'];if(_0x523944[_0x7bc8('0x37')][_0x7bc8('0x41')]){_0x3b9408[_0x7bc8('0x3f')]=_[_0x7bc8('0x43')](_0x3b9408[_0x7bc8('0x3f')],{'$or':_[_0x7bc8('0x2e')](_0x3b9408[_0x7bc8('0x38')],function(_0x6a2bc9){var _0x3c0ad3={};_0x3c0ad3[_0x6a2bc9]={'$like':'%'+_0x523944[_0x7bc8('0x37')][_0x7bc8('0x41')]+'%'};return _0x3c0ad3;})});}_0x3b9408=_[_0x7bc8('0x43')]({},_0x3b9408,_0x523944[_0x7bc8('0x44')]);return db[_0x7bc8('0x60')][_0x7bc8('0x20')]({'where':_0x3b9408[_0x7bc8('0x3f')]})[_0x7bc8('0x26')](function(_0x42f254){_0x22e3ec[_0x7bc8('0x20')]=_0x42f254;if(_0x523944[_0x7bc8('0x37')]['includeAll']){_0x3b9408[_0x7bc8('0x46')]=[{'all':!![]}];}return db[_0x7bc8('0x60')][_0x7bc8('0x47')](_0x3b9408);})[_0x7bc8('0x26')](function(_0xfa9422){_0x22e3ec[_0x7bc8('0x48')]=_0xfa9422;return _0x22e3ec;});}})[_0x7bc8('0x26')](respondWithFilteredResult(_0x5ac909,_0x3b9408))[_0x7bc8('0x49')](handleError(_0x5ac909,null));};exports['getHopperFinals']=function(_0x44437c,_0x3dee36,_0x42eaa7){var _0x4a9b8e={'raw':!![],'where':{}};var _0x16b1f8={};var _0x57866d={'count':0x0,'rows':[]};return db[_0x7bc8('0x2f')][_0x7bc8('0x5c')]({'where':{'id':_0x44437c['params']['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0x3dee36,null))[_0x7bc8('0x26')](function(_0x23ce88){if(_0x23ce88){_0x16b1f8[_0x7bc8('0x33')]=_[_0x7bc8('0x34')](db['CmHopperFinal']['rawAttributes']);_0x16b1f8['query']=_[_0x7bc8('0x34')](_0x44437c[_0x7bc8('0x37')]);_0x16b1f8[_0x7bc8('0x35')]=_[_0x7bc8('0x36')](_0x16b1f8[_0x7bc8('0x33')],_0x16b1f8[_0x7bc8('0x37')]);_0x4a9b8e['attributes']=_[_0x7bc8('0x36')](_0x16b1f8[_0x7bc8('0x33')],qs[_0x7bc8('0x39')](_0x44437c[_0x7bc8('0x37')][_0x7bc8('0x39')]));_0x4a9b8e[_0x7bc8('0x38')]=_0x4a9b8e[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x4a9b8e[_0x7bc8('0x38')]:_0x16b1f8[_0x7bc8('0x33')];if(!_0x44437c[_0x7bc8('0x37')]['hasOwnProperty'](_0x7bc8('0x3c'))){_0x4a9b8e[_0x7bc8('0x1f')]=qs[_0x7bc8('0x1f')](_0x44437c[_0x7bc8('0x37')][_0x7bc8('0x1f')]);_0x4a9b8e[_0x7bc8('0x1d')]=qs[_0x7bc8('0x1d')](_0x44437c['query'][_0x7bc8('0x1d')]);}_0x4a9b8e['order']=qs['sort'](_0x44437c[_0x7bc8('0x37')]['sort']);_0x4a9b8e[_0x7bc8('0x3f')]=qs[_0x7bc8('0x35')](_[_0x7bc8('0x40')](_0x44437c[_0x7bc8('0x37')],_0x16b1f8[_0x7bc8('0x35')]));_0x4a9b8e[_0x7bc8('0x3f')][_0x7bc8('0x5e')]=_0x23ce88['id'];if(_0x44437c[_0x7bc8('0x37')][_0x7bc8('0x41')]){_0x4a9b8e[_0x7bc8('0x3f')]=_[_0x7bc8('0x43')](_0x4a9b8e[_0x7bc8('0x3f')],{'$or':_[_0x7bc8('0x2e')](_0x4a9b8e[_0x7bc8('0x38')],function(_0x458b97){var _0x532fbc={};_0x532fbc[_0x458b97]={'$like':'%'+_0x44437c[_0x7bc8('0x37')][_0x7bc8('0x41')]+'%'};return _0x532fbc;})});}_0x4a9b8e=_[_0x7bc8('0x43')]({},_0x4a9b8e,_0x44437c[_0x7bc8('0x44')]);return db[_0x7bc8('0x61')][_0x7bc8('0x20')]({'where':_0x4a9b8e[_0x7bc8('0x3f')]})[_0x7bc8('0x26')](function(_0x37d0c2){_0x57866d[_0x7bc8('0x20')]=_0x37d0c2;if(_0x44437c[_0x7bc8('0x37')][_0x7bc8('0x45')]){_0x4a9b8e[_0x7bc8('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7bc8('0x47')](_0x4a9b8e);})[_0x7bc8('0x26')](function(_0x32f15b){_0x57866d['rows']=_0x32f15b;return _0x57866d;});}})[_0x7bc8('0x26')](respondWithFilteredResult(_0x3dee36,_0x4a9b8e))[_0x7bc8('0x49')](handleError(_0x3dee36,null));};exports[_0x7bc8('0x62')]=function(_0x42bbcb,_0xdaf6f6,_0x6673b5){var _0x529308={'raw':!![],'where':{}};var _0x4b172f={};var _0x54a74d={'count':0x0,'rows':[]};return db['Campaign'][_0x7bc8('0x5c')]({'where':{'id':_0x42bbcb['params']['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0xdaf6f6,null))[_0x7bc8('0x26')](function(_0x2b11bc){if(_0x2b11bc){_0x4b172f['model']=_[_0x7bc8('0x34')](db[_0x7bc8('0x63')][_0x7bc8('0x30')]);_0x4b172f[_0x7bc8('0x37')]=_[_0x7bc8('0x34')](_0x42bbcb['query']);_0x4b172f[_0x7bc8('0x35')]=_[_0x7bc8('0x36')](_0x4b172f['model'],_0x4b172f[_0x7bc8('0x37')]);_0x529308[_0x7bc8('0x38')]=_[_0x7bc8('0x36')](_0x4b172f[_0x7bc8('0x33')],qs['fields'](_0x42bbcb[_0x7bc8('0x37')]['fields']));_0x529308[_0x7bc8('0x38')]=_0x529308[_0x7bc8('0x38')]['length']?_0x529308[_0x7bc8('0x38')]:_0x4b172f['model'];if(!_0x42bbcb[_0x7bc8('0x37')][_0x7bc8('0x3b')](_0x7bc8('0x3c'))){_0x529308[_0x7bc8('0x1f')]=qs[_0x7bc8('0x1f')](_0x42bbcb[_0x7bc8('0x37')][_0x7bc8('0x1f')]);_0x529308[_0x7bc8('0x1d')]=qs['offset'](_0x42bbcb['query'][_0x7bc8('0x1d')]);}_0x529308[_0x7bc8('0x3d')]=qs[_0x7bc8('0x3e')](_0x42bbcb[_0x7bc8('0x37')][_0x7bc8('0x3e')]);_0x529308[_0x7bc8('0x3f')]=qs['filters'](_['pick'](_0x42bbcb[_0x7bc8('0x37')],_0x4b172f['filters']));_0x529308[_0x7bc8('0x3f')]['CampaignId']=_0x2b11bc['id'];if(_0x42bbcb['query'][_0x7bc8('0x41')]){_0x529308[_0x7bc8('0x3f')]=_[_0x7bc8('0x43')](_0x529308['where'],{'$or':_[_0x7bc8('0x2e')](_0x529308[_0x7bc8('0x38')],function(_0x56aa09){var _0x2ce097={};_0x2ce097[_0x56aa09]={'$like':'%'+_0x42bbcb[_0x7bc8('0x37')][_0x7bc8('0x41')]+'%'};return _0x2ce097;})});}_0x529308=_[_0x7bc8('0x43')]({},_0x529308,_0x42bbcb[_0x7bc8('0x44')]);return db['CmHopperBlack']['count']({'where':_0x529308[_0x7bc8('0x3f')]})[_0x7bc8('0x26')](function(_0xdba37f){_0x54a74d[_0x7bc8('0x20')]=_0xdba37f;if(_0x42bbcb[_0x7bc8('0x37')][_0x7bc8('0x45')]){_0x529308[_0x7bc8('0x46')]=[{'all':!![]}];}return db[_0x7bc8('0x63')][_0x7bc8('0x47')](_0x529308);})[_0x7bc8('0x26')](function(_0x18221f){_0x54a74d[_0x7bc8('0x48')]=_0x18221f;return _0x54a74d;});}})[_0x7bc8('0x26')](respondWithFilteredResult(_0xdaf6f6,_0x529308))['catch'](handleError(_0xdaf6f6,null));};exports[_0x7bc8('0x64')]=function(_0x29199f,_0x454071,_0x2053b8){var _0x2d92a5={};var _0x3fd971={};var _0x48c0e8;var _0x12acf4;return db['Campaign'][_0x7bc8('0x5c')]({'where':{'id':_0x29199f['params']['id']}})['then'](handleEntityNotFound(_0x454071,null))[_0x7bc8('0x26')](function(_0x123bcd){if(_0x123bcd){_0x48c0e8=_0x123bcd;_0x3fd971[_0x7bc8('0x33')]=_[_0x7bc8('0x34')](db[_0x7bc8('0x65')]['rawAttributes']);_0x3fd971[_0x7bc8('0x37')]=_[_0x7bc8('0x34')](_0x29199f[_0x7bc8('0x37')]);_0x3fd971[_0x7bc8('0x35')]=_[_0x7bc8('0x36')](_0x3fd971[_0x7bc8('0x33')],_0x3fd971['query']);_0x2d92a5['attributes']=_[_0x7bc8('0x36')](_0x3fd971[_0x7bc8('0x33')],qs[_0x7bc8('0x39')](_0x29199f['query'][_0x7bc8('0x39')]));_0x2d92a5[_0x7bc8('0x38')]=_0x2d92a5[_0x7bc8('0x38')]['length']?_0x2d92a5[_0x7bc8('0x38')]:_0x3fd971[_0x7bc8('0x33')];_0x2d92a5[_0x7bc8('0x3d')]=qs[_0x7bc8('0x3e')](_0x29199f[_0x7bc8('0x37')]['sort']);_0x2d92a5['where']=qs[_0x7bc8('0x35')](_[_0x7bc8('0x40')](_0x29199f['query'],_0x3fd971[_0x7bc8('0x35')]));if(_0x29199f[_0x7bc8('0x37')][_0x7bc8('0x41')]){_0x2d92a5['where']=_['merge'](_0x2d92a5[_0x7bc8('0x3f')],{'$or':_[_0x7bc8('0x2e')](_0x2d92a5[_0x7bc8('0x38')],function(_0x26e864){var _0x177dc4={};_0x177dc4[_0x26e864]={'$like':'%'+_0x29199f['query'][_0x7bc8('0x41')]+'%'};return _0x177dc4;})});}_0x2d92a5=_[_0x7bc8('0x43')]({},_0x2d92a5,_0x29199f['options']);return _0x48c0e8[_0x7bc8('0x64')](_0x2d92a5);}})[_0x7bc8('0x26')](function(_0x5b7d92){if(_0x5b7d92){_0x12acf4=_0x5b7d92[_0x7bc8('0x3a')];if(!_0x29199f[_0x7bc8('0x37')]['hasOwnProperty'](_0x7bc8('0x3c'))){_0x2d92a5[_0x7bc8('0x1f')]=qs[_0x7bc8('0x1f')](_0x29199f[_0x7bc8('0x37')][_0x7bc8('0x1f')]);_0x2d92a5[_0x7bc8('0x1d')]=qs[_0x7bc8('0x1d')](_0x29199f[_0x7bc8('0x37')][_0x7bc8('0x1d')]);}return _0x48c0e8[_0x7bc8('0x64')](_0x2d92a5);}})[_0x7bc8('0x26')](function(_0x235910){if(_0x235910){return _0x235910?{'count':_0x12acf4,'rows':_0x235910}:null;}})['then'](respondWithResult(_0x454071,null))[_0x7bc8('0x49')](handleError(_0x454071,null));};exports['addLists']=function(_0x6dbbe3,_0x5723fa,_0x384c6c){var _0x32f09f,_0x7cf132;var _0x292764=[];var _0x21e3bb=moment()[_0x7bc8('0x66')](_0x7bc8('0x67'));return db[_0x7bc8('0x2f')][_0x7bc8('0x4c')]({'where':{'id':_0x6dbbe3[_0x7bc8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5723fa,null))[_0x7bc8('0x26')](function(_0x4c890c){if(_0x4c890c){_0x7cf132=_0x4c890c;return _0x4c890c[_0x7bc8('0x68')](_0x6dbbe3[_0x7bc8('0x4e')][_0x7bc8('0x69')],_['omit'](_0x6dbbe3[_0x7bc8('0x4e')],[_0x7bc8('0x69'),'id'])||{});}return null;})[_0x7bc8('0x6a')](function(_0x571e47){var _0x5f2e6a;var _0x12328c;_0x32f09f=_0x571e47||[];var _0x35108f=[];if(_0x571e47){for(var _0x10a8ef=0x0;_0x10a8ef<_0x571e47[_0x7bc8('0x3a')];_0x10a8ef+=0x1){var _0x3dd8e7=_0x571e47[_0x10a8ef][_0x7bc8('0x4f')]({'plain':!![]});_0x7cf132[_0x7bc8('0x6b')]=_0x6dbbe3['body'][_0x7bc8('0x6b')]?_0x6dbbe3['body']['dialCheckDuplicateType']:_0x7cf132[_0x7bc8('0x6b')];switch(_0x7cf132[_0x7bc8('0x6b')]){case'always':_0x5f2e6a=squel[_0x7bc8('0x6c')]()[_0x7bc8('0x6d')](_0x7bc8('0x6e'))['fromQuery']([_0x7bc8('0x6f'),_0x7bc8('0x70'),'ContactId',_0x7bc8('0x71'),_0x7bc8('0x5e'),'createdAt',_0x7bc8('0x59')],squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')](_0x7bc8('0x6f'),_0x7bc8('0x6f'))[_0x7bc8('0x73')]('NOW()',_0x7bc8('0x70'))['field']('id','ContactId')[_0x7bc8('0x73')](_0x3dd8e7['CmListId'][_0x7bc8('0x74')](),_0x7bc8('0x71'))[_0x7bc8('0x73')](_0x6dbbe3[_0x7bc8('0x4b')]['id']['toString'](),_0x7bc8('0x5e'))['field']('\x27'+_0x21e3bb+'\x27',_0x7bc8('0x58'))[_0x7bc8('0x73')]('\x27'+_0x21e3bb+'\x27','updatedAt')[_0x7bc8('0x75')](_0x7bc8('0x76'))[_0x7bc8('0x3f')]('deletedAt\x20IS\x20NULL')[_0x7bc8('0x3f')](_0x7bc8('0x77'),_0x3dd8e7[_0x7bc8('0x78')][_0x7bc8('0x74')]())[_0x7bc8('0x3f')](_0x7bc8('0x79'))[_0x7bc8('0x3f')](_0x7bc8('0x7a'),squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x7bc8('0x75')](_0x7bc8('0x7b'))[_0x7bc8('0x3f')](_0x7bc8('0x7c'),_0x6dbbe3['params']['id'][_0x7bc8('0x74')]()))[_0x7bc8('0x3f')](_0x7bc8('0x7a'),squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')](_0x7bc8('0x7d'))['from'](_0x7bc8('0x6e'))[_0x7bc8('0x3f')](_0x7bc8('0x7c'),_0x6dbbe3[_0x7bc8('0x4b')]['id']['toString']())))[_0x7bc8('0x74')]();break;case _0x7bc8('0x7e'):_0x5f2e6a=squel[_0x7bc8('0x6c')]()[_0x7bc8('0x6d')]('cm_hopper')[_0x7bc8('0x7f')](['phone',_0x7bc8('0x70'),_0x7bc8('0x80'),'ListId',_0x7bc8('0x5e'),_0x7bc8('0x58'),'updatedAt'],squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')](_0x7bc8('0x6f'),_0x7bc8('0x6f'))['field'](_0x7bc8('0x81'),_0x7bc8('0x70'))[_0x7bc8('0x73')]('id',_0x7bc8('0x80'))['field'](_0x3dd8e7[_0x7bc8('0x78')][_0x7bc8('0x74')](),'ListId')[_0x7bc8('0x73')](_0x6dbbe3['params']['id'][_0x7bc8('0x74')](),'CampaignId')[_0x7bc8('0x73')]('\x27'+_0x21e3bb+'\x27',_0x7bc8('0x58'))[_0x7bc8('0x73')]('\x27'+_0x21e3bb+'\x27',_0x7bc8('0x59'))[_0x7bc8('0x75')](_0x7bc8('0x76'))[_0x7bc8('0x3f')](_0x7bc8('0x82'))['where'](_0x7bc8('0x77'),_0x3dd8e7['CmListId'][_0x7bc8('0x74')]())['where'](_0x7bc8('0x79'))[_0x7bc8('0x3f')](_0x7bc8('0x7a'),squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')](_0x7bc8('0x7d'))['from'](_0x7bc8('0x6e'))[_0x7bc8('0x3f')](_0x7bc8('0x7c'),_0x6dbbe3['params']['id'][_0x7bc8('0x74')]())))[_0x7bc8('0x74')]();break;default:_0x5f2e6a=squel[_0x7bc8('0x6c')]()[_0x7bc8('0x6d')]('cm_hopper')[_0x7bc8('0x7f')]([_0x7bc8('0x6f'),_0x7bc8('0x70'),_0x7bc8('0x80'),_0x7bc8('0x71'),_0x7bc8('0x5e'),_0x7bc8('0x58'),_0x7bc8('0x59')],squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')]('phone',_0x7bc8('0x6f'))[_0x7bc8('0x73')]('NOW()',_0x7bc8('0x70'))[_0x7bc8('0x73')]('id',_0x7bc8('0x80'))[_0x7bc8('0x73')](_0x3dd8e7[_0x7bc8('0x78')][_0x7bc8('0x74')](),_0x7bc8('0x71'))[_0x7bc8('0x73')](_0x6dbbe3[_0x7bc8('0x4b')]['id']['toString'](),_0x7bc8('0x5e'))[_0x7bc8('0x73')]('\x27'+_0x21e3bb+'\x27','createdAt')['field']('\x27'+_0x21e3bb+'\x27',_0x7bc8('0x59'))[_0x7bc8('0x75')](_0x7bc8('0x76'))['where'](_0x7bc8('0x82'))[_0x7bc8('0x3f')](_0x7bc8('0x77'),_0x3dd8e7[_0x7bc8('0x78')][_0x7bc8('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x7bc8('0x74')]();}_0x12328c=squel[_0x7bc8('0x6c')]()[_0x7bc8('0x6d')](_0x7bc8('0x83'))[_0x7bc8('0x7f')]([_0x7bc8('0x84'),_0x7bc8('0x70'),_0x7bc8('0x6f'),_0x7bc8('0x85'),'createdAt',_0x7bc8('0x59')],squel[_0x7bc8('0x72')]()[_0x7bc8('0x73')](_0x7bc8('0x86'),'id')['field'](_0x7bc8('0x81'),_0x7bc8('0x70'))['field']('ci.item',_0x7bc8('0x6f'))[_0x7bc8('0x73')](_0x7bc8('0x87'),'OrderBy')[_0x7bc8('0x73')]('\x27'+_0x21e3bb+'\x27',_0x7bc8('0x58'))[_0x7bc8('0x73')]('\x27'+_0x21e3bb+'\x27',_0x7bc8('0x59'))[_0x7bc8('0x75')]('cm_contact_has_items','ci')[_0x7bc8('0x88')]('cm_hopper','h',_0x7bc8('0x89'))[_0x7bc8('0x3f')]('h.ListId\x20=\x20?',_0x3dd8e7[_0x7bc8('0x78')][_0x7bc8('0x74')]())['where'](_0x7bc8('0x8a'),_0x6dbbe3['params']['id'][_0x7bc8('0x74')]())[_0x7bc8('0x3f')](_0x7bc8('0x8b'),_0x21e3bb))[_0x7bc8('0x74')]();_0x35108f['push'](db[_0x7bc8('0x8c')][_0x7bc8('0x37')](_0x5f2e6a));_0x292764['push'](db['sequelize']['query'](_0x12328c));}return BPromise[_0x7bc8('0x8d')](_0x35108f);}})[_0x7bc8('0x26')](function(){return BPromise['all'](_0x292764);})[_0x7bc8('0x26')](function(){return _0x32f09f;})[_0x7bc8('0x26')](respondWithResult(_0x5723fa,null))[_0x7bc8('0x49')](handleError(_0x5723fa,null));};exports[_0x7bc8('0x8e')]=function(_0x2825c8,_0x37bb16,_0xb13689){return db[_0x7bc8('0x2f')][_0x7bc8('0x4c')]({'where':{'id':_0x2825c8['params']['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0x37bb16,null))[_0x7bc8('0x26')](function(_0x79a0c8){if(_0x79a0c8){return _0x79a0c8[_0x7bc8('0x8e')](_0x2825c8[_0x7bc8('0x37')][_0x7bc8('0x69')]);}})[_0x7bc8('0x26')](function(_0x1acb96){if(_0x1acb96){return db[_0x7bc8('0x5d')]['destroy']({'where':{'ListId':_0x2825c8[_0x7bc8('0x37')][_0x7bc8('0x69')],'CampaignId':_0x2825c8[_0x7bc8('0x4b')]['id']}})[_0x7bc8('0x26')](function(){return _0x1acb96;});}})[_0x7bc8('0x26')](respondWithStatusCode(_0x37bb16,null))[_0x7bc8('0x49')](handleError(_0x37bb16,null));};exports[_0x7bc8('0x8f')]=function(_0x30dd57,_0xa3143f,_0x3b9628){var _0x3bb720={};var _0x277a4a={};var _0x169011;var _0x676223;return db[_0x7bc8('0x2f')][_0x7bc8('0x5c')]({'where':{'id':_0x30dd57[_0x7bc8('0x4b')]['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0xa3143f,null))[_0x7bc8('0x26')](function(_0x52ce57){if(_0x52ce57){_0x169011=_0x52ce57;_0x277a4a[_0x7bc8('0x33')]=_[_0x7bc8('0x34')](db[_0x7bc8('0x65')][_0x7bc8('0x30')]);_0x277a4a[_0x7bc8('0x37')]=_['keys'](_0x30dd57['query']);_0x277a4a[_0x7bc8('0x35')]=_[_0x7bc8('0x36')](_0x277a4a[_0x7bc8('0x33')],_0x277a4a[_0x7bc8('0x37')]);_0x3bb720[_0x7bc8('0x38')]=_[_0x7bc8('0x36')](_0x277a4a[_0x7bc8('0x33')],qs['fields'](_0x30dd57[_0x7bc8('0x37')][_0x7bc8('0x39')]));_0x3bb720[_0x7bc8('0x38')]=_0x3bb720[_0x7bc8('0x38')][_0x7bc8('0x3a')]?_0x3bb720[_0x7bc8('0x38')]:_0x277a4a[_0x7bc8('0x33')];_0x3bb720[_0x7bc8('0x3d')]=qs[_0x7bc8('0x3e')](_0x30dd57[_0x7bc8('0x37')][_0x7bc8('0x3e')]);_0x3bb720['where']=qs[_0x7bc8('0x35')](_[_0x7bc8('0x40')](_0x30dd57[_0x7bc8('0x37')],_0x277a4a['filters']));if(_0x30dd57['query'][_0x7bc8('0x41')]){_0x3bb720['where']=_['merge'](_0x3bb720[_0x7bc8('0x3f')],{'$or':_['map'](_0x3bb720['attributes'],function(_0x59cf30){var _0x41dc43={};_0x41dc43[_0x59cf30]={'$like':'%'+_0x30dd57[_0x7bc8('0x37')]['filter']+'%'};return _0x41dc43;})});}_0x3bb720=_[_0x7bc8('0x43')]({},_0x3bb720,_0x30dd57[_0x7bc8('0x44')]);return _0x169011[_0x7bc8('0x8f')](_0x3bb720);}})[_0x7bc8('0x26')](function(_0x2a72fd){if(_0x2a72fd){_0x676223=_0x2a72fd[_0x7bc8('0x3a')];if(!_0x30dd57[_0x7bc8('0x37')]['hasOwnProperty']('nolimit')){_0x3bb720['limit']=qs[_0x7bc8('0x1f')](_0x30dd57[_0x7bc8('0x37')][_0x7bc8('0x1f')]);_0x3bb720[_0x7bc8('0x1d')]=qs[_0x7bc8('0x1d')](_0x30dd57[_0x7bc8('0x37')]['offset']);}return _0x169011[_0x7bc8('0x8f')](_0x3bb720);}})['then'](function(_0x15d4f5){if(_0x15d4f5){return _0x15d4f5?{'count':_0x676223,'rows':_0x15d4f5}:null;}})[_0x7bc8('0x26')](respondWithResult(_0xa3143f,null))[_0x7bc8('0x49')](handleError(_0xa3143f,null));};exports[_0x7bc8('0x90')]=function(_0x4ea066,_0x122cc8,_0x325553){var _0x57bbb3,_0x551af2;var _0x4254f7=[];var _0x50c6d6=moment()[_0x7bc8('0x66')](_0x7bc8('0x67'));return db[_0x7bc8('0x2f')][_0x7bc8('0x4c')]({'where':{'id':_0x4ea066['params']['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0x122cc8,null))[_0x7bc8('0x26')](function(_0x4c3c24){if(_0x4c3c24){_0x551af2=_0x4c3c24;return _0x4c3c24[_0x7bc8('0x90')](_0x4ea066[_0x7bc8('0x4e')][_0x7bc8('0x69')],_[_0x7bc8('0x5a')](_0x4ea066['body'],[_0x7bc8('0x69'),'id'])||{});}return null;})[_0x7bc8('0x6a')](function(_0xa7f1f9){var _0x1c35eb;var _0x25ef72;_0x57bbb3=_0xa7f1f9||[];var _0x114809=[];if(_0xa7f1f9){for(var _0x3fbae2=0x0;_0x3fbae2<_0xa7f1f9[_0x7bc8('0x3a')];_0x3fbae2+=0x1){var _0x6dd331=_0xa7f1f9[_0x3fbae2][_0x7bc8('0x4f')]({'plain':!![]});_0x1c35eb=squel[_0x7bc8('0x6c')]()[_0x7bc8('0x6d')](_0x7bc8('0x91'))[_0x7bc8('0x7f')]([_0x7bc8('0x6f'),_0x7bc8('0x80'),_0x7bc8('0x71'),_0x7bc8('0x5e'),_0x7bc8('0x58'),_0x7bc8('0x59')],squel['select']()['field'](_0x7bc8('0x6f'),_0x7bc8('0x6f'))[_0x7bc8('0x73')]('id',_0x7bc8('0x80'))[_0x7bc8('0x73')](_0x6dd331[_0x7bc8('0x78')][_0x7bc8('0x74')](),_0x7bc8('0x71'))[_0x7bc8('0x73')](_0x4ea066['params']['id'][_0x7bc8('0x74')](),_0x7bc8('0x5e'))[_0x7bc8('0x73')](_0x7bc8('0x81'),_0x7bc8('0x58'))[_0x7bc8('0x73')]('NOW()',_0x7bc8('0x59'))[_0x7bc8('0x75')]('cm_contacts')[_0x7bc8('0x3f')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x6dd331['CmListId'][_0x7bc8('0x74')]())[_0x7bc8('0x3f')](_0x7bc8('0x79')))[_0x7bc8('0x74')]();_0x114809['push'](db['sequelize'][_0x7bc8('0x37')](_0x1c35eb));}return BPromise[_0x7bc8('0x8d')](_0x114809);}})[_0x7bc8('0x26')](function(){return _0x57bbb3;})[_0x7bc8('0x26')](respondWithResult(_0x122cc8,null))[_0x7bc8('0x49')](handleError(_0x122cc8,null));};exports[_0x7bc8('0x92')]=function(_0x401fd5,_0x4aa6d0,_0x555427){return db['Campaign']['find']({'where':{'id':_0x401fd5[_0x7bc8('0x4b')]['id']}})[_0x7bc8('0x26')](handleEntityNotFound(_0x4aa6d0,null))[_0x7bc8('0x26')](function(_0x49dd05){if(_0x49dd05){return _0x49dd05['removeBlackLists'](_0x401fd5[_0x7bc8('0x37')]['ids']);}})['then'](function(_0x42395e){if(_0x42395e){return db[_0x7bc8('0x63')][_0x7bc8('0x27')]({'where':{'ListId':_0x401fd5[_0x7bc8('0x37')][_0x7bc8('0x69')],'CampaignId':_0x401fd5[_0x7bc8('0x4b')]['id']}})[_0x7bc8('0x26')](function(){return _0x42395e;});}})[_0x7bc8('0x26')](respondWithStatusCode(_0x4aa6d0,null))[_0x7bc8('0x49')](handleError(_0x4aa6d0,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 8a10915..09b0533 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(_0x13f38e,_0x10ecce){var _0x2a4b96=function(_0x5bf1e5){while(--_0x5bf1e5){_0x13f38e['push'](_0x13f38e['shift']());}};_0x2a4b96(++_0x10ecce);}(_0x7a54,0x106));var _0x47a5=function(_0x3c6eb0,_0x1a52f8){_0x3c6eb0=_0x3c6eb0-0x0;var _0x2de222=_0x7a54[_0x3c6eb0];return _0x2de222;};'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(_0x23bf67,_0x564d3d){var _0x8f2df5=function(_0x5e31b1){while(--_0x5e31b1){_0x23bf67['push'](_0x23bf67['shift']());}};_0x8f2df5(++_0x564d3d);}(_0x7a54,0x106));var _0x47a5=function(_0x511858,_0x539650){_0x511858=_0x511858-0x0;var _0x1c34a5=_0x7a54[_0x511858];return _0x1c34a5;};'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 6059441..72a88c2 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 _0x9aea=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','Campaign','findAll','options','where','attributes','limit','include','map','model','GetCampaign','stringify','catch','lodash','moment','randomstring'];(function(_0x277b7b,_0x251ee0){var _0x5c32dc=function(_0x625b91){while(--_0x625b91){_0x277b7b['push'](_0x277b7b['shift']());}};_0x5c32dc(++_0x251ee0);}(_0x9aea,0xdd));var _0xa9ae=function(_0x399b8d,_0x1777ab){_0x399b8d=_0x399b8d-0x0;var _0x39f42a=_0x9aea[_0x399b8d];return _0x39f42a;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});}exports['GetCampaign']=function(_0x4dbb30){var _0xb078d2=this;return new Promise(function(_0x581345,_0x59e7dd){return db[_0xa9ae('0x14')][_0xa9ae('0x15')]({'raw':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30[_0xa9ae('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30[_0xa9ae('0x16')][_0xa9ae('0x17')]||null:null,'attributes':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30[_0xa9ae('0x16')][_0xa9ae('0x18')]||null:null,'limit':_0x4dbb30[_0xa9ae('0x16')]?_0x4dbb30['options'][_0xa9ae('0x19')]||null:null,'include':_0x4dbb30['options']?_0x4dbb30['options']['include']?_['map'](_0x4dbb30[_0xa9ae('0x16')]['include'],function(_0x13fb05){return{'model':db[_0x13fb05['model']],'as':_0x13fb05['as'],'attributes':_0x13fb05[_0xa9ae('0x18')],'include':_0x13fb05[_0xa9ae('0x1a')]?_[_0xa9ae('0x1b')](_0x13fb05[_0xa9ae('0x1a')],function(_0x12b061){return{'model':db[_0x12b061[_0xa9ae('0x1c')]],'as':_0x12b061['as'],'attributes':_0x12b061[_0xa9ae('0x18')],'include':_0x12b061['include']?_[_0xa9ae('0x1b')](_0x12b061[_0xa9ae('0x1a')],function(_0x2aac9e){return{'model':db[_0x2aac9e[_0xa9ae('0x1c')]],'as':_0x2aac9e['as'],'attributes':_0x2aac9e[_0xa9ae('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa9ae('0xb')](function(_0xb12fa8){logger['info']('GetCampaign',_0x4dbb30);logger[_0xa9ae('0xf')](_0xa9ae('0x1d'),_0x4dbb30,JSON[_0xa9ae('0x1e')](_0xb12fa8));_0x581345(_0xb12fa8);})[_0xa9ae('0x1f')](function(_0x74cd94){logger['error']('GetCampaign',_0x74cd94[_0xa9ae('0x12')],_0x4dbb30);_0x59e7dd(_0xb078d2[_0xa9ae('0x10')](0x1f4,_0x74cd94[_0xa9ae('0x12')]));});});}; \ No newline at end of file +var _0xcea2=['rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Campaign','findAll','options','where','attributes','limit','map','include','model','then','GetCampaign','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3bee07,_0x416454){var _0x104f1d=function(_0x32c555){while(--_0x32c555){_0x3bee07['push'](_0x3bee07['shift']());}};_0x104f1d(++_0x416454);}(_0xcea2,0x15a));var _0x2cea=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcea2[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var moment=require(_0x2cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require(_0x2cea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ff,_0xc04963,_0x805a1b){return new BPromise(function(_0x160cca,_0x11c5c0){return client[_0x2cea('0x9')](_0x2d69ff,_0x805a1b)['then'](function(_0x1f4d90){logger[_0x2cea('0xa')](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));logger[_0x2cea('0xd')](_0x2cea('0xe'),_0xc04963,_0x2cea('0xc'),JSON[_0x2cea('0xf')](_0x1f4d90));if(_0x1f4d90['error']){if(_0x1f4d90['error'][_0x2cea('0x10')]===0x1f4){logger[_0x2cea('0x11')]('Campaign,\x20%s,\x20%s',_0xc04963,_0x1f4d90['error'][_0x2cea('0x12')]);return _0x11c5c0(_0x1f4d90['error'][_0x2cea('0x12')]);}logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1f4d90['error']['message']);return _0x160cca(_0x1f4d90['error'][_0x2cea('0x12')]);}else{logger['info'](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));_0x160cca(_0x1f4d90[_0x2cea('0x13')][_0x2cea('0x12')]);}})[_0x2cea('0x14')](function(_0x1bbfdb){logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1bbfdb);_0x11c5c0(_0x1bbfdb);});});}exports['GetCampaign']=function(_0x19927a){var _0x464f7d=this;return new Promise(function(_0x20c46c,_0x43ae15){return db[_0x2cea('0x15')][_0x2cea('0x16')]({'raw':_0x19927a['options']?_0x19927a[_0x2cea('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')][_0x2cea('0x18')]||null:null,'attributes':_0x19927a['options']?_0x19927a[_0x2cea('0x17')][_0x2cea('0x19')]||null:null,'limit':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')][_0x2cea('0x1a')]||null:null,'include':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')]['include']?_[_0x2cea('0x1b')](_0x19927a['options'][_0x2cea('0x1c')],function(_0x4926ff){return{'model':db[_0x4926ff[_0x2cea('0x1d')]],'as':_0x4926ff['as'],'attributes':_0x4926ff[_0x2cea('0x19')],'include':_0x4926ff['include']?_[_0x2cea('0x1b')](_0x4926ff[_0x2cea('0x1c')],function(_0x101314){return{'model':db[_0x101314[_0x2cea('0x1d')]],'as':_0x101314['as'],'attributes':_0x101314[_0x2cea('0x19')],'include':_0x101314[_0x2cea('0x1c')]?_['map'](_0x101314[_0x2cea('0x1c')],function(_0x32b6a3){return{'model':db[_0x32b6a3[_0x2cea('0x1d')]],'as':_0x32b6a3['as'],'attributes':_0x32b6a3[_0x2cea('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2cea('0x1e')](function(_0x3ea40c){logger[_0x2cea('0xa')](_0x2cea('0x1f'),_0x19927a);logger['debug'](_0x2cea('0x1f'),_0x19927a,JSON[_0x2cea('0xf')](_0x3ea40c));_0x20c46c(_0x3ea40c);})['catch'](function(_0xfeb8bd){logger[_0x2cea('0x11')](_0x2cea('0x1f'),_0xfeb8bd[_0x2cea('0x12')],_0x19927a);_0x43ae15(_0x464f7d['error'](0x1f4,_0xfeb8bd[_0x2cea('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 440be95..9022731 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 _0x83f1=['./campaign.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a3d4e,_0x2e6695){var _0x4bae5f=function(_0xefc05d){while(--_0xefc05d){_0x1a3d4e['push'](_0x1a3d4e['shift']());}};_0x4bae5f(++_0x2e6695);}(_0x83f1,0x1cc));var _0x183f=function(_0x1a8897,_0x47d1ef){_0x1a8897=_0x1a8897-0x0;var _0x85d09b=_0x83f1[_0x1a8897];return _0x85d09b;};'use strict';var multer=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var path=require(_0x183f('0x2'));var timeout=require(_0x183f('0x3'));var express=require(_0x183f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x183f('0x5'));var interaction=require(_0x183f('0x6'));var config=require(_0x183f('0x7'));var controller=require(_0x183f('0x8'));router[_0x183f('0x9')]('/',auth['isAuthenticated'](),controller[_0x183f('0xa')]);router[_0x183f('0x9')](_0x183f('0xb'),auth['isAuthenticated'](),controller[_0x183f('0xc')]);router['get'](_0x183f('0xd'),auth[_0x183f('0xe')](),controller[_0x183f('0xf')]);router[_0x183f('0x9')](_0x183f('0x10'),auth[_0x183f('0xe')](),controller[_0x183f('0x11')]);router['get'](_0x183f('0x12'),auth[_0x183f('0xe')](),controller[_0x183f('0x13')]);router[_0x183f('0x9')](_0x183f('0x14'),auth[_0x183f('0xe')](),controller[_0x183f('0x15')]);router['get'](_0x183f('0x16'),auth['isAuthenticated'](),controller['getLists']);router[_0x183f('0x9')](_0x183f('0x17'),auth[_0x183f('0xe')](),controller[_0x183f('0x18')]);router[_0x183f('0x19')]('/',auth['isAuthenticated'](),controller[_0x183f('0x1a')]);router['post'](_0x183f('0x1b'),auth[_0x183f('0xe')](),controller[_0x183f('0x1c')]);router['post'](_0x183f('0x16'),auth[_0x183f('0xe')](),controller[_0x183f('0x1d')]);router['post'](_0x183f('0x17'),auth[_0x183f('0xe')](),controller[_0x183f('0x1e')]);router[_0x183f('0x1f')](_0x183f('0xb'),auth[_0x183f('0xe')](),controller['update']);router[_0x183f('0x20')](_0x183f('0xb'),auth[_0x183f('0xe')](),controller['destroy']);router[_0x183f('0x20')]('/:id/lists',auth[_0x183f('0xe')](),controller[_0x183f('0x21')]);router[_0x183f('0x20')](_0x183f('0x17'),auth['isAuthenticated'](),controller[_0x183f('0x22')]);module[_0x183f('0x23')]=router; \ No newline at end of file +var _0xc1e8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','express'];(function(_0x1c8e66,_0x1c4814){var _0x58d61d=function(_0x268e97){while(--_0x268e97){_0x1c8e66['push'](_0x1c8e66['shift']());}};_0x58d61d(++_0x1c4814);}(_0xc1e8,0x87));var _0x8c1e=function(_0x79ebc5,_0x2df5d1){_0x79ebc5=_0x79ebc5-0x0;var _0x3813b6=_0xc1e8[_0x79ebc5];return _0x3813b6;};'use strict';var multer=require(_0x8c1e('0x0'));var util=require(_0x8c1e('0x1'));var path=require(_0x8c1e('0x2'));var timeout=require(_0x8c1e('0x3'));var express=require(_0x8c1e('0x4'));var router=express[_0x8c1e('0x5')]();var fs_extra=require(_0x8c1e('0x6'));var auth=require(_0x8c1e('0x7'));var interaction=require(_0x8c1e('0x8'));var config=require(_0x8c1e('0x9'));var controller=require(_0x8c1e('0xa'));router[_0x8c1e('0xb')]('/',auth['isAuthenticated'](),controller[_0x8c1e('0xc')]);router[_0x8c1e('0xb')](_0x8c1e('0xd'),auth['isAuthenticated'](),controller[_0x8c1e('0xe')]);router[_0x8c1e('0xb')](_0x8c1e('0xf'),auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x11')]);router['get'](_0x8c1e('0x12'),auth[_0x8c1e('0x10')](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth[_0x8c1e('0x10')](),controller['getHopperFinals']);router[_0x8c1e('0xb')](_0x8c1e('0x13'),auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x14')]);router[_0x8c1e('0xb')]('/:id/lists',auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x15')]);router[_0x8c1e('0xb')](_0x8c1e('0x16'),auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x17')]);router[_0x8c1e('0x18')]('/',auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x19')]);router[_0x8c1e('0x18')](_0x8c1e('0x1a'),auth[_0x8c1e('0x10')](),controller['clone']);router[_0x8c1e('0x18')](_0x8c1e('0x1b'),auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x1c')]);router['post']('/:id/blacklists',auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x1d')]);router[_0x8c1e('0x1e')]('/:id',auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x1f')]);router[_0x8c1e('0x20')](_0x8c1e('0xd'),auth[_0x8c1e('0x10')](),controller['destroy']);router[_0x8c1e('0x20')](_0x8c1e('0x1b'),auth[_0x8c1e('0x10')](),controller[_0x8c1e('0x21')]);router[_0x8c1e('0x20')](_0x8c1e('0x16'),auth['isAuthenticated'](),controller[_0x8c1e('0x22')]);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 98429a9..ba8ffa4 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 _0xa105=['VIRTUAL','getDataValue','key','exports','STRING','TEXT'];(function(_0x1f9069,_0x2fb32a){var _0x44650d=function(_0x1db730){while(--_0x1db730){_0x1f9069['push'](_0x1f9069['shift']());}};_0x44650d(++_0x2fb32a);}(_0xa105,0x1b3));var _0x5a10=function(_0x4b19b2,_0x24fd9d){_0x4b19b2=_0x4b19b2-0x0;var _0x42521b=_0xa105[_0x4b19b2];return _0x42521b;};'use strict';var Sequelize=require('sequelize');module[_0x5a10('0x0')]={'key':{'type':Sequelize[_0x5a10('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x5a10('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x5a10('0x3')],'get':function(){return this[_0x5a10('0x4')](_0x5a10('0x5'));}}}; \ No newline at end of file +var _0x3886=['TEXT','STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x4b05e0,_0x311076){var _0x1fbea2=function(_0x573fda){while(--_0x573fda){_0x4b05e0['push'](_0x4b05e0['shift']());}};_0x1fbea2(++_0x311076);}(_0x3886,0x1a9));var _0x6388=function(_0x10fefb,_0xaef80b){_0x10fefb=_0x10fefb-0x0;var _0x41c4ba=_0x3886[_0x10fefb];return _0x41c4ba;};'use strict';var Sequelize=require(_0x6388('0x0'));module[_0x6388('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6388('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6388('0x3')]},'name':{'type':Sequelize[_0x6388('0x4')],'get':function(){return this[_0x6388('0x5')](_0x6388('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b177b1d..f2693d5 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 _0x1cf9=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','update','then','CannedAnswers','destroy','end','stack','name','CannedAnswer','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','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','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4725d9,_0x51bc47){var _0x26f2b7=function(_0x144c00){while(--_0x144c00){_0x4725d9['push'](_0x4725d9['shift']());}};_0x26f2b7(++_0x51bc47);}(_0x1cf9,0xf3));var _0x91cf=function(_0x38c0d6,_0x580c86){_0x38c0d6=_0x38c0d6-0x0;var _0x1f27eb=_0x1cf9[_0x38c0d6];return _0x1f27eb;};'use strict';var emlformat=require(_0x91cf('0x0'));var rimraf=require(_0x91cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91cf('0x2'));var rp=require(_0x91cf('0x3'));var moment=require('moment');var BPromise=require(_0x91cf('0x4'));var Mustache=require(_0x91cf('0x5'));var util=require(_0x91cf('0x6'));var path=require(_0x91cf('0x7'));var sox=require('sox');var csv=require(_0x91cf('0x8'));var ejs=require(_0x91cf('0x9'));var fs=require('fs');var fs_extra=require(_0x91cf('0xa'));var _=require(_0x91cf('0xb'));var squel=require(_0x91cf('0xc'));var crypto=require(_0x91cf('0xd'));var jsforce=require(_0x91cf('0xe'));var deskjs=require(_0x91cf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x91cf('0x10'));var Papa=require(_0x91cf('0x11'));var Redis=require(_0x91cf('0x12'));var authService=require(_0x91cf('0x13'));var qs=require(_0x91cf('0x14'));var as=require(_0x91cf('0x15'));var hardwareService=require(_0x91cf('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x91cf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x91cf('0x18'));var db=require(_0x91cf('0x19'))['db'];function respondWithStatusCode(_0x3297ed,_0x13ee4a){_0x13ee4a=_0x13ee4a||0xcc;return function(_0x3f1535){if(_0x3f1535){return _0x3297ed[_0x91cf('0x1a')](_0x13ee4a);}return _0x3297ed['status'](_0x13ee4a)['end']();};}function respondWithResult(_0x417531,_0xad50b){_0xad50b=_0xad50b||0xc8;return function(_0x1af5f2){if(_0x1af5f2){return _0x417531[_0x91cf('0x1b')](_0xad50b)[_0x91cf('0x1c')](_0x1af5f2);}};}function respondWithFilteredResult(_0x1c9a6d,_0x374e43){return function(_0x3a82f1){if(_0x3a82f1){var _0x4753eb=typeof _0x374e43[_0x91cf('0x1d')]===_0x91cf('0x1e')&&typeof _0x374e43[_0x91cf('0x1f')]===_0x91cf('0x1e');var _0x43a195=_0x3a82f1[_0x91cf('0x20')];var _0x49a10c=_0x4753eb?0x0:_0x374e43[_0x91cf('0x1d')];var _0x68c082=_0x4753eb?_0x3a82f1[_0x91cf('0x20')]:_0x374e43['offset']+_0x374e43[_0x91cf('0x1f')];var _0xb05a41;if(_0x68c082>=_0x43a195){_0x68c082=_0x43a195;_0xb05a41=0xc8;}else{_0xb05a41=0xce;}_0x1c9a6d[_0x91cf('0x1b')](_0xb05a41);return _0x1c9a6d[_0x91cf('0x21')]('Content-Range',_0x49a10c+'-'+_0x68c082+'/'+_0x43a195)[_0x91cf('0x1c')](_0x3a82f1);}return null;};}function patchUpdates(_0x19ab0c){return function(_0x35cd34){try{jsonpatch['apply'](_0x35cd34,_0x19ab0c,!![]);}catch(_0x61ef7){return BPromise['reject'](_0x61ef7);}return _0x35cd34[_0x91cf('0x22')]();};}function saveUpdates(_0x2d547a,_0x14f365){return function(_0x4c7454){if(_0x4c7454){return _0x4c7454[_0x91cf('0x23')](_0x2d547a)[_0x91cf('0x24')](function(_0x3c344b){return _0x3c344b;});}return null;};}function removeEntity(_0x3ab8ff,_0x13dd4b){return function(_0x395edb){if(_0x395edb){return _0x395edb['destroy']()[_0x91cf('0x24')](function(){var _0x1ec616=_0x395edb['get']({'plain':!![]});var _0xfca747=_0x91cf('0x25');return db['UserProfileResource'][_0x91cf('0x26')]({'where':{'type':_0xfca747,'resourceId':_0x1ec616['id']}})[_0x91cf('0x24')](function(){return _0x395edb;});})[_0x91cf('0x24')](function(){_0x3ab8ff[_0x91cf('0x1b')](0xcc)[_0x91cf('0x27')]();});}};}function handleEntityNotFound(_0x957841,_0x2ae1ff){return function(_0x2cc3f3){if(!_0x2cc3f3){_0x957841['sendStatus'](0x194);}return _0x2cc3f3;};}function handleError(_0x7c4bd,_0xfbf23c){_0xfbf23c=_0xfbf23c||0x1f4;return function(_0xcc4012){logger['error'](_0xcc4012[_0x91cf('0x28')]);if(_0xcc4012[_0x91cf('0x29')]){delete _0xcc4012['name'];}_0x7c4bd[_0x91cf('0x1b')](_0xfbf23c)['send'](_0xcc4012);};}exports['index']=function(_0x55286c,_0x155787){var _0x2b6bd5={},_0x1d69a7={},_0x467c78={'count':0x0,'rows':[]};var _0x139f44=_['map'](db[_0x91cf('0x2a')][_0x91cf('0x2b')],function(_0x11cadf){return{'name':_0x11cadf[_0x91cf('0x2c')],'type':_0x11cadf[_0x91cf('0x2d')][_0x91cf('0x2e')]};});_0x1d69a7[_0x91cf('0x2f')]=_[_0x91cf('0x30')](_0x139f44,_0x91cf('0x29'));_0x1d69a7['query']=_[_0x91cf('0x31')](_0x55286c[_0x91cf('0x32')]);_0x1d69a7[_0x91cf('0x33')]=_[_0x91cf('0x34')](_0x1d69a7['model'],_0x1d69a7['query']);_0x2b6bd5[_0x91cf('0x35')]=_[_0x91cf('0x34')](_0x1d69a7[_0x91cf('0x2f')],qs[_0x91cf('0x36')](_0x55286c[_0x91cf('0x32')][_0x91cf('0x36')]));_0x2b6bd5[_0x91cf('0x35')]=_0x2b6bd5[_0x91cf('0x35')][_0x91cf('0x37')]?_0x2b6bd5[_0x91cf('0x35')]:_0x1d69a7[_0x91cf('0x2f')];if(!_0x55286c['query'][_0x91cf('0x38')](_0x91cf('0x39'))){_0x2b6bd5[_0x91cf('0x1f')]=qs[_0x91cf('0x1f')](_0x55286c[_0x91cf('0x32')]['limit']);_0x2b6bd5[_0x91cf('0x1d')]=qs[_0x91cf('0x1d')](_0x55286c[_0x91cf('0x32')][_0x91cf('0x1d')]);}_0x2b6bd5['order']=qs[_0x91cf('0x3a')](_0x55286c['query'][_0x91cf('0x3a')]);_0x2b6bd5['where']=qs[_0x91cf('0x33')](_['pick'](_0x55286c[_0x91cf('0x32')],_0x1d69a7[_0x91cf('0x33')]),_0x139f44);if(_0x55286c[_0x91cf('0x32')]['filter']){_0x2b6bd5['where']=_['merge'](_0x2b6bd5[_0x91cf('0x3b')],{'$or':[{'key':{'$like':'%'+_0x55286c[_0x91cf('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x55286c[_0x91cf('0x32')][_0x91cf('0x3c')]+'%'}}]});}_0x2b6bd5=_[_0x91cf('0x3d')]({},_0x2b6bd5,_0x55286c[_0x91cf('0x3e')]);var _0x4b9666={'where':_0x2b6bd5['where']};return db[_0x91cf('0x2a')][_0x91cf('0x20')](_0x4b9666)[_0x91cf('0x24')](function(_0x15faf1){_0x467c78[_0x91cf('0x20')]=_0x15faf1;if(_0x55286c[_0x91cf('0x32')][_0x91cf('0x3f')]){_0x2b6bd5[_0x91cf('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0x91cf('0x41')](_0x2b6bd5);})[_0x91cf('0x24')](function(_0x4722f4){_0x467c78[_0x91cf('0x42')]=_0x4722f4;return _0x467c78;})['then'](respondWithFilteredResult(_0x155787,_0x2b6bd5))[_0x91cf('0x43')](handleError(_0x155787,null));};exports['show']=function(_0x3838c0,_0x31ed03){var _0x5a562b={'raw':!![],'where':{'id':_0x3838c0['params']['id']}},_0x57543a={};_0x57543a['model']=_[_0x91cf('0x31')](db[_0x91cf('0x2a')][_0x91cf('0x2b')]);_0x57543a[_0x91cf('0x32')]=_[_0x91cf('0x31')](_0x3838c0['query']);_0x57543a[_0x91cf('0x33')]=_[_0x91cf('0x34')](_0x57543a[_0x91cf('0x2f')],_0x57543a[_0x91cf('0x32')]);_0x5a562b['attributes']=_['intersection'](_0x57543a['model'],qs[_0x91cf('0x36')](_0x3838c0['query'][_0x91cf('0x36')]));_0x5a562b['attributes']=_0x5a562b['attributes'][_0x91cf('0x37')]?_0x5a562b[_0x91cf('0x35')]:_0x57543a['model'];if(_0x3838c0['query'][_0x91cf('0x3f')]){_0x5a562b['include']=[{'all':!![]}];}_0x5a562b=_[_0x91cf('0x3d')]({},_0x5a562b,_0x3838c0[_0x91cf('0x3e')]);return db['CannedAnswer'][_0x91cf('0x44')](_0x5a562b)['then'](handleEntityNotFound(_0x31ed03,null))[_0x91cf('0x24')](respondWithResult(_0x31ed03,null))[_0x91cf('0x43')](handleError(_0x31ed03,null));};exports[_0x91cf('0x23')]=function(_0x409299,_0x2df38c){if(_0x409299[_0x91cf('0x45')]['id']){delete _0x409299[_0x91cf('0x45')]['id'];}return db[_0x91cf('0x2a')]['find']({'where':{'id':_0x409299[_0x91cf('0x46')]['id']}})[_0x91cf('0x24')](handleEntityNotFound(_0x2df38c,null))[_0x91cf('0x24')](saveUpdates(_0x409299[_0x91cf('0x45')],null))[_0x91cf('0x24')](respondWithResult(_0x2df38c,null))[_0x91cf('0x43')](handleError(_0x2df38c,null));};exports['destroy']=function(_0x2480dc,_0xb9e562){return db[_0x91cf('0x2a')][_0x91cf('0x44')]({'where':{'id':_0x2480dc['params']['id']}})['then'](handleEntityNotFound(_0xb9e562,null))[_0x91cf('0x24')](removeEntity(_0xb9e562,null))[_0x91cf('0x43')](handleError(_0xb9e562,null));};exports[_0x91cf('0x47')]=function(_0x177ce3,_0x569710){var _0x4e5055={'key':_0x177ce3[_0x91cf('0x45')][_0x91cf('0x2e')]};if(_0x177ce3[_0x91cf('0x45')][_0x91cf('0x48')]){_0x4e5055[_0x91cf('0x48')]=_0x177ce3['body'][_0x91cf('0x48')];}else if(_0x177ce3['body'][_0x91cf('0x49')]){_0x4e5055[_0x91cf('0x49')]=_0x177ce3['body']['SmsAccountId'];}else if(_0x177ce3[_0x91cf('0x45')][_0x91cf('0x4a')]){_0x4e5055['OpenchannelAccountId']=_0x177ce3[_0x91cf('0x45')]['OpenchannelAccountId'];}else if(_0x177ce3[_0x91cf('0x45')]['ChatWebsiteId']){_0x4e5055['ChatWebsiteId']=_0x177ce3['body'][_0x91cf('0x4b')];}return db['CannedAnswer']['find']({'where':_0x4e5055})[_0x91cf('0x24')](function(_0x2b9c12){if(_0x2b9c12){throw new db[(_0x91cf('0x4c'))][(_0x91cf('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x91cf('0x47')](_0x177ce3[_0x91cf('0x45')]);})[_0x91cf('0x24')](function(_0x82212){var _0x159245=_0x177ce3[_0x91cf('0x4e')][_0x91cf('0x4f')]({'plain':!![]});if(!_0x159245)throw new Error(_0x91cf('0x50'));if(_0x159245[_0x91cf('0x51')]==='user'){var _0x233515=_0x82212[_0x91cf('0x4f')]({'plain':!![]});return db[_0x91cf('0x52')][_0x91cf('0x44')]({'where':{'name':_0x91cf('0x25'),'userProfileId':_0x159245[_0x91cf('0x53')]},'raw':!![]})[_0x91cf('0x24')](function(_0x20834c){if(_0x20834c&&_0x20834c[_0x91cf('0x54')]===0x0){return db[_0x91cf('0x55')][_0x91cf('0x47')]({'name':_0x233515[_0x91cf('0x29')],'resourceId':_0x233515['id'],'type':_0x20834c['name'],'sectionId':_0x20834c['id']},{})[_0x91cf('0x24')](function(){return _0x82212;});}else{return _0x82212;}})[_0x91cf('0x43')](function(_0x29b9e2){logger[_0x91cf('0x56')](_0x91cf('0x57'),_0x29b9e2);throw _0x29b9e2;});}return _0x82212;})['then'](respondWithResult(_0x569710,0xc9))[_0x91cf('0x43')](handleError(_0x569710,null));}; \ No newline at end of file +var _0x9610=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x9b0d12,_0x17e7b6){var _0x55abdb=function(_0x33d49b){while(--_0x33d49b){_0x9b0d12['push'](_0x9b0d12['shift']());}};_0x55abdb(++_0x17e7b6);}(_0x9610,0x164));var _0x0961=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9610[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0961('0x0'));var zipdir=require(_0x0961('0x1'));var jsonpatch=require(_0x0961('0x2'));var rp=require(_0x0961('0x3'));var moment=require(_0x0961('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0961('0x5'));var util=require(_0x0961('0x6'));var path=require(_0x0961('0x7'));var sox=require(_0x0961('0x8'));var csv=require(_0x0961('0x9'));var ejs=require(_0x0961('0xa'));var fs=require('fs');var fs_extra=require(_0x0961('0xb'));var _=require(_0x0961('0xc'));var squel=require(_0x0961('0xd'));var crypto=require(_0x0961('0xe'));var jsforce=require(_0x0961('0xf'));var deskjs=require(_0x0961('0x10'));var toCsv=require(_0x0961('0x9'));var querystring=require(_0x0961('0x11'));var Papa=require(_0x0961('0x12'));var Redis=require(_0x0961('0x13'));var authService=require(_0x0961('0x14'));var qs=require(_0x0961('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0961('0x16'));var logger=require(_0x0961('0x17'))(_0x0961('0x18'));var utils=require('../../config/utils');var config=require(_0x0961('0x19'));var licenseUtil=require(_0x0961('0x1a'));var db=require(_0x0961('0x1b'))['db'];function respondWithStatusCode(_0x4e674f,_0x1eb4eb){_0x1eb4eb=_0x1eb4eb||0xcc;return function(_0x23abf9){if(_0x23abf9){return _0x4e674f[_0x0961('0x1c')](_0x1eb4eb);}return _0x4e674f[_0x0961('0x1d')](_0x1eb4eb)[_0x0961('0x1e')]();};}function respondWithResult(_0x10bfbf,_0x512557){_0x512557=_0x512557||0xc8;return function(_0x326dfc){if(_0x326dfc){return _0x10bfbf[_0x0961('0x1d')](_0x512557)[_0x0961('0x1f')](_0x326dfc);}};}function respondWithFilteredResult(_0x4f58d2,_0x174ba9){return function(_0x4e2445){if(_0x4e2445){var _0x2cd2c3=typeof _0x174ba9[_0x0961('0x20')]===_0x0961('0x21')&&typeof _0x174ba9[_0x0961('0x22')]==='undefined';var _0x132ce0=_0x4e2445[_0x0961('0x23')];var _0x37441a=_0x2cd2c3?0x0:_0x174ba9[_0x0961('0x20')];var _0x103acd=_0x2cd2c3?_0x4e2445[_0x0961('0x23')]:_0x174ba9[_0x0961('0x20')]+_0x174ba9['limit'];var _0x5088a9;if(_0x103acd>=_0x132ce0){_0x103acd=_0x132ce0;_0x5088a9=0xc8;}else{_0x5088a9=0xce;}_0x4f58d2[_0x0961('0x1d')](_0x5088a9);return _0x4f58d2['set'](_0x0961('0x24'),_0x37441a+'-'+_0x103acd+'/'+_0x132ce0)['json'](_0x4e2445);}return null;};}function patchUpdates(_0x37578a){return function(_0x667407){try{jsonpatch[_0x0961('0x25')](_0x667407,_0x37578a,!![]);}catch(_0x5b762f){return BPromise[_0x0961('0x26')](_0x5b762f);}return _0x667407[_0x0961('0x27')]();};}function saveUpdates(_0x1accc1,_0x1d785b){return function(_0x33aa2e){if(_0x33aa2e){return _0x33aa2e[_0x0961('0x28')](_0x1accc1)[_0x0961('0x29')](function(_0x54b21a){return _0x54b21a;});}return null;};}function removeEntity(_0x5c0025,_0x3a102c){return function(_0xa67935){if(_0xa67935){return _0xa67935[_0x0961('0x2a')]()[_0x0961('0x29')](function(){var _0x3ef293=_0xa67935[_0x0961('0x2b')]({'plain':!![]});var _0x1973f8='CannedAnswers';return db[_0x0961('0x2c')][_0x0961('0x2a')]({'where':{'type':_0x1973f8,'resourceId':_0x3ef293['id']}})[_0x0961('0x29')](function(){return _0xa67935;});})[_0x0961('0x29')](function(){_0x5c0025[_0x0961('0x1d')](0xcc)[_0x0961('0x1e')]();});}};}function handleEntityNotFound(_0x45f25e,_0x580922){return function(_0x4c620f){if(!_0x4c620f){_0x45f25e[_0x0961('0x1c')](0x194);}return _0x4c620f;};}function handleError(_0x7f7275,_0x481d7b){_0x481d7b=_0x481d7b||0x1f4;return function(_0x416f2e){logger[_0x0961('0x2d')](_0x416f2e['stack']);if(_0x416f2e['name']){delete _0x416f2e[_0x0961('0x2e')];}_0x7f7275['status'](_0x481d7b)['send'](_0x416f2e);};}exports[_0x0961('0x2f')]=function(_0x4d0c3d,_0x10c85d){var _0x4fd142={},_0x577b1e={},_0x5ab522={'count':0x0,'rows':[]};var _0x42fda8=_[_0x0961('0x30')](db['CannedAnswer'][_0x0961('0x31')],function(_0x63d5b0){return{'name':_0x63d5b0['fieldName'],'type':_0x63d5b0[_0x0961('0x32')][_0x0961('0x33')]};});_0x577b1e[_0x0961('0x34')]=_[_0x0961('0x30')](_0x42fda8,_0x0961('0x2e'));_0x577b1e[_0x0961('0x35')]=_[_0x0961('0x36')](_0x4d0c3d[_0x0961('0x35')]);_0x577b1e[_0x0961('0x37')]=_['intersection'](_0x577b1e[_0x0961('0x34')],_0x577b1e['query']);_0x4fd142[_0x0961('0x38')]=_[_0x0961('0x39')](_0x577b1e['model'],qs[_0x0961('0x3a')](_0x4d0c3d[_0x0961('0x35')][_0x0961('0x3a')]));_0x4fd142['attributes']=_0x4fd142['attributes'][_0x0961('0x3b')]?_0x4fd142['attributes']:_0x577b1e[_0x0961('0x34')];if(!_0x4d0c3d[_0x0961('0x35')][_0x0961('0x3c')](_0x0961('0x3d'))){_0x4fd142['limit']=qs[_0x0961('0x22')](_0x4d0c3d[_0x0961('0x35')][_0x0961('0x22')]);_0x4fd142[_0x0961('0x20')]=qs[_0x0961('0x20')](_0x4d0c3d[_0x0961('0x35')][_0x0961('0x20')]);}_0x4fd142[_0x0961('0x3e')]=qs['sort'](_0x4d0c3d[_0x0961('0x35')][_0x0961('0x3f')]);_0x4fd142[_0x0961('0x40')]=qs['filters'](_[_0x0961('0x41')](_0x4d0c3d[_0x0961('0x35')],_0x577b1e[_0x0961('0x37')]),_0x42fda8);if(_0x4d0c3d['query'][_0x0961('0x42')]){_0x4fd142[_0x0961('0x40')]=_['merge'](_0x4fd142[_0x0961('0x40')],{'$or':[{'key':{'$like':'%'+_0x4d0c3d[_0x0961('0x35')][_0x0961('0x42')]+'%'}},{'value':{'$like':'%'+_0x4d0c3d[_0x0961('0x35')][_0x0961('0x42')]+'%'}}]});}_0x4fd142=_[_0x0961('0x43')]({},_0x4fd142,_0x4d0c3d[_0x0961('0x44')]);var _0x592af9={'where':_0x4fd142['where']};return db[_0x0961('0x45')][_0x0961('0x23')](_0x592af9)['then'](function(_0x1639b4){_0x5ab522[_0x0961('0x23')]=_0x1639b4;if(_0x4d0c3d[_0x0961('0x35')][_0x0961('0x46')]){_0x4fd142['include']=[{'all':!![]}];}return db[_0x0961('0x45')][_0x0961('0x47')](_0x4fd142);})['then'](function(_0x19d5b4){_0x5ab522[_0x0961('0x48')]=_0x19d5b4;return _0x5ab522;})[_0x0961('0x29')](respondWithFilteredResult(_0x10c85d,_0x4fd142))[_0x0961('0x49')](handleError(_0x10c85d,null));};exports[_0x0961('0x4a')]=function(_0x556021,_0x580ab2){var _0x3d887f={'raw':!![],'where':{'id':_0x556021[_0x0961('0x4b')]['id']}},_0x20b7ad={};_0x20b7ad['model']=_[_0x0961('0x36')](db['CannedAnswer'][_0x0961('0x31')]);_0x20b7ad[_0x0961('0x35')]=_[_0x0961('0x36')](_0x556021[_0x0961('0x35')]);_0x20b7ad[_0x0961('0x37')]=_[_0x0961('0x39')](_0x20b7ad[_0x0961('0x34')],_0x20b7ad[_0x0961('0x35')]);_0x3d887f[_0x0961('0x38')]=_[_0x0961('0x39')](_0x20b7ad[_0x0961('0x34')],qs[_0x0961('0x3a')](_0x556021[_0x0961('0x35')][_0x0961('0x3a')]));_0x3d887f['attributes']=_0x3d887f[_0x0961('0x38')][_0x0961('0x3b')]?_0x3d887f[_0x0961('0x38')]:_0x20b7ad['model'];if(_0x556021[_0x0961('0x35')][_0x0961('0x46')]){_0x3d887f['include']=[{'all':!![]}];}_0x3d887f=_['merge']({},_0x3d887f,_0x556021[_0x0961('0x44')]);return db[_0x0961('0x45')][_0x0961('0x4c')](_0x3d887f)[_0x0961('0x29')](handleEntityNotFound(_0x580ab2,null))[_0x0961('0x29')](respondWithResult(_0x580ab2,null))[_0x0961('0x49')](handleError(_0x580ab2,null));};exports[_0x0961('0x28')]=function(_0x4ef4dd,_0xeb88e1){if(_0x4ef4dd[_0x0961('0x4d')]['id']){delete _0x4ef4dd[_0x0961('0x4d')]['id'];}return db['CannedAnswer'][_0x0961('0x4c')]({'where':{'id':_0x4ef4dd['params']['id']}})[_0x0961('0x29')](handleEntityNotFound(_0xeb88e1,null))[_0x0961('0x29')](saveUpdates(_0x4ef4dd[_0x0961('0x4d')],null))[_0x0961('0x29')](respondWithResult(_0xeb88e1,null))[_0x0961('0x49')](handleError(_0xeb88e1,null));};exports[_0x0961('0x2a')]=function(_0x1b5191,_0x2b8584){return db[_0x0961('0x45')][_0x0961('0x4c')]({'where':{'id':_0x1b5191[_0x0961('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2b8584,null))[_0x0961('0x29')](removeEntity(_0x2b8584,null))['catch'](handleError(_0x2b8584,null));};exports[_0x0961('0x4e')]=function(_0x3b9391,_0x32c31c){var _0x9ae33c={'key':_0x3b9391[_0x0961('0x4d')][_0x0961('0x33')]};if(_0x3b9391[_0x0961('0x4d')]['MailAccountId']){_0x9ae33c[_0x0961('0x4f')]=_0x3b9391[_0x0961('0x4d')][_0x0961('0x4f')];}else if(_0x3b9391[_0x0961('0x4d')]['SmsAccountId']){_0x9ae33c[_0x0961('0x50')]=_0x3b9391[_0x0961('0x4d')][_0x0961('0x50')];}else if(_0x3b9391[_0x0961('0x4d')][_0x0961('0x51')]){_0x9ae33c[_0x0961('0x51')]=_0x3b9391['body'][_0x0961('0x51')];}else if(_0x3b9391[_0x0961('0x4d')][_0x0961('0x52')]){_0x9ae33c[_0x0961('0x52')]=_0x3b9391[_0x0961('0x4d')][_0x0961('0x52')];}return db['CannedAnswer'][_0x0961('0x4c')]({'where':_0x9ae33c})['then'](function(_0xf37de3){if(_0xf37de3){throw new db[(_0x0961('0x53'))][(_0x0961('0x54'))](_0x0961('0x55'));}return db[_0x0961('0x45')][_0x0961('0x4e')](_0x3b9391[_0x0961('0x4d')]);})[_0x0961('0x29')](function(_0x546aa8){var _0x2e857c=_0x3b9391[_0x0961('0x56')][_0x0961('0x2b')]({'plain':!![]});if(!_0x2e857c)throw new Error(_0x0961('0x57'));if(_0x2e857c[_0x0961('0x58')]==='user'){var _0x8daca5=_0x546aa8[_0x0961('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0x0961('0x4c')]({'where':{'name':'CannedAnswers','userProfileId':_0x2e857c[_0x0961('0x59')]},'raw':!![]})[_0x0961('0x29')](function(_0xc94834){if(_0xc94834&&_0xc94834[_0x0961('0x5a')]===0x0){return db[_0x0961('0x2c')][_0x0961('0x4e')]({'name':_0x8daca5['name'],'resourceId':_0x8daca5['id'],'type':_0xc94834[_0x0961('0x2e')],'sectionId':_0xc94834['id']},{})[_0x0961('0x29')](function(){return _0x546aa8;});}else{return _0x546aa8;}})['catch'](function(_0x4a8f46){logger[_0x0961('0x2d')](_0x0961('0x5b'),_0x4a8f46);throw _0x4a8f46;});}return _0x546aa8;})[_0x0961('0x29')](respondWithResult(_0x32c31c,0xc9))[_0x0961('0x49')](handleError(_0x32c31c,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 397e43c..4c2db4d 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 _0x6820=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','lodash'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x6820,0x16b));var _0x0682=function(_0x4f24fa,_0x30c708){_0x4f24fa=_0x4f24fa-0x0;var _0x33b49b=_0x6820[_0x4f24fa];return _0x33b49b;};'use strict';var _=require(_0x0682('0x0'));var util=require(_0x0682('0x1'));var logger=require(_0x0682('0x2'))(_0x0682('0x3'));var moment=require(_0x0682('0x4'));var BPromise=require(_0x0682('0x5'));var rp=require(_0x0682('0x6'));var fs=require('fs');var path=require(_0x0682('0x7'));var rimraf=require(_0x0682('0x8'));var config=require(_0x0682('0x9'));var attributes=require(_0x0682('0xa'));module['exports']=function(_0x19821a,_0x496c98){return _0x19821a['define'](_0x0682('0xb'),attributes,{'tableName':_0x0682('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0682('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9106=['lodash','util','../../config/logger','api','bluebird','request-promise','path','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x9c1313,_0x5b7140){var _0x444261=function(_0x3ab2d3){while(--_0x3ab2d3){_0x9c1313['push'](_0x9c1313['shift']());}};_0x444261(++_0x5b7140);}(_0x9106,0x6e));var _0x6910=function(_0x2e1aa2,_0x72bfb2){_0x2e1aa2=_0x2e1aa2-0x0;var _0x13188a=_0x9106[_0x2e1aa2];return _0x13188a;};'use strict';var _=require(_0x6910('0x0'));var util=require(_0x6910('0x1'));var logger=require(_0x6910('0x2'))(_0x6910('0x3'));var moment=require('moment');var BPromise=require(_0x6910('0x4'));var rp=require(_0x6910('0x5'));var fs=require('fs');var path=require(_0x6910('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x28b7a9,_0x582073){return _0x28b7a9[_0x6910('0x7')]('CannedAnswer',attributes,{'tableName':_0x6910('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6910('0x9'),'collate':_0x6910('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index cd83155..9c97841 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(_0x12e5e3,_0x586370){var _0x46b310=function(_0x2f7508){while(--_0x2f7508){_0x12e5e3['push'](_0x12e5e3['shift']());}};_0x46b310(++_0x586370);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x318052,_0x53e2af){var _0x132c05=function(_0x5851aa){while(--_0x5851aa){_0x318052['push'](_0x318052['shift']());}};_0x132c05(++_0x53e2af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 4b886a9..6c89c96 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 _0xef25=['exports','multer','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','put','/:id','destroy'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xef25,0x194));var _0x5ef2=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xef25[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x5ef2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ef2('0x1'));var router=express['Router']();var fs_extra=require(_0x5ef2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5ef2('0x3'));var config=require(_0x5ef2('0x4'));var controller=require('./cannedAnswer.controller');router[_0x5ef2('0x5')]('/',auth['isAuthenticated'](),controller[_0x5ef2('0x6')]);router[_0x5ef2('0x5')]('/:id',auth[_0x5ef2('0x7')](),controller[_0x5ef2('0x8')]);router['post']('/',auth[_0x5ef2('0x7')](),controller['create']);router[_0x5ef2('0x9')](_0x5ef2('0xa'),auth[_0x5ef2('0x7')](),controller['update']);router['delete']('/:id',auth[_0x5ef2('0x7')](),controller[_0x5ef2('0xb')]);module[_0x5ef2('0xc')]=router; \ No newline at end of file +var _0x025c=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','path'];(function(_0x39ac27,_0x7b441){var _0x24c00a=function(_0x3a83d1){while(--_0x3a83d1){_0x39ac27['push'](_0x39ac27['shift']());}};_0x24c00a(++_0x7b441);}(_0x025c,0x1e4));var _0xc025=function(_0x19a5d9,_0x3bf6ac){_0x19a5d9=_0x19a5d9-0x0;var _0x3a27a6=_0x025c[_0x19a5d9];return _0x3a27a6;};'use strict';var multer=require(_0xc025('0x0'));var util=require('util');var path=require(_0xc025('0x1'));var timeout=require(_0xc025('0x2'));var express=require(_0xc025('0x3'));var router=express['Router']();var fs_extra=require(_0xc025('0x4'));var auth=require(_0xc025('0x5'));var interaction=require(_0xc025('0x6'));var config=require('../../config/environment');var controller=require(_0xc025('0x7'));router[_0xc025('0x8')]('/',auth[_0xc025('0x9')](),controller['index']);router[_0xc025('0x8')](_0xc025('0xa'),auth[_0xc025('0x9')](),controller[_0xc025('0xb')]);router[_0xc025('0xc')]('/',auth[_0xc025('0x9')](),controller[_0xc025('0xd')]);router[_0xc025('0xe')](_0xc025('0xa'),auth['isAuthenticated'](),controller[_0xc025('0xf')]);router[_0xc025('0x10')](_0xc025('0xa'),auth[_0xc025('0x9')](),controller[_0xc025('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 3e3dca7..2d44196 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 _0x9780=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x420815,_0x3b8b45){var _0x279900=function(_0x3a57f3){while(--_0x3a57f3){_0x420815['push'](_0x420815['shift']());}};_0x279900(++_0x3b8b45);}(_0x9780,0x1d4));var _0x0978=function(_0x24507a,_0x58e59b){_0x24507a=_0x24507a-0x0;var _0x20ed6a=_0x9780[_0x24507a];return _0x20ed6a;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0978('0x0')],'allowNull':![],'defaultValue':_0x0978('0x1')},'clid':{'type':Sequelize[_0x0978('0x2')]},'src':{'type':Sequelize[_0x0978('0x2')]},'dst':{'type':Sequelize[_0x0978('0x2')]},'dcontext':{'type':Sequelize[_0x0978('0x2')]},'channel':{'type':Sequelize[_0x0978('0x2')]},'dstchannel':{'type':Sequelize[_0x0978('0x2')]},'lastapp':{'type':Sequelize[_0x0978('0x2')]},'lastdata':{'type':Sequelize[_0x0978('0x2')]},'duration':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0978('0x2')]},'amaflags':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0978('0x2')]},'userfield':{'type':Sequelize[_0x0978('0x2')]},'uniqueid':{'type':Sequelize[_0x0978('0x2')]},'linkedid':{'type':Sequelize[_0x0978('0x2')]},'sequence':{'type':Sequelize[_0x0978('0x2')]},'peeraccount':{'type':Sequelize[_0x0978('0x2')]},'type':{'type':Sequelize[_0x0978('0x2')]},'tag':{'type':Sequelize[_0x0978('0x2')]}}; \ No newline at end of file +var _0xb63f=['1970-01-01\x2000:00:01','STRING','INTEGER','DATE'];(function(_0x3f4bb2,_0x1fe283){var _0x113328=function(_0xdb325f){while(--_0xdb325f){_0x3f4bb2['push'](_0x3f4bb2['shift']());}};_0x113328(++_0x1fe283);}(_0xb63f,0xa3));var _0xfb63=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0xb63f[_0x50f6e5];return _0x5988c5;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xfb63('0x0')],'allowNull':![],'defaultValue':_0xfb63('0x1')},'clid':{'type':Sequelize[_0xfb63('0x2')]},'src':{'type':Sequelize[_0xfb63('0x2')]},'dst':{'type':Sequelize[_0xfb63('0x2')]},'dcontext':{'type':Sequelize[_0xfb63('0x2')]},'channel':{'type':Sequelize[_0xfb63('0x2')]},'dstchannel':{'type':Sequelize[_0xfb63('0x2')]},'lastapp':{'type':Sequelize[_0xfb63('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xfb63('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfb63('0x2')]},'amaflags':{'type':Sequelize[_0xfb63('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xfb63('0x2')]},'sequence':{'type':Sequelize[_0xfb63('0x2')]},'peeraccount':{'type':Sequelize[_0xfb63('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfb63('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index a44908f..892041d 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 _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','Cdr','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(_0x56ce15,_0x1c142d){var _0x5df4c6=function(_0xd2741e){while(--_0xd2741e){_0x56ce15['push'](_0x56ce15['shift']());}};_0x5df4c6(++_0x1c142d);}(_0x3e74,0x175));var _0x43e7=function(_0x15563f,_0x8cce3d){_0x15563f=_0x15563f-0x0;var _0x3923fd=_0x3e74[_0x15563f];return _0x3923fd;};'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['Cdr']['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['Cdr']['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['Cdr']['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['Cdr']['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 _0x5577=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4faa5c,_0x596c36){var _0x58c0fa=function(_0x4b07c8){while(--_0x4b07c8){_0x4faa5c['push'](_0x4faa5c['shift']());}};_0x58c0fa(++_0x596c36);}(_0x5577,0x1b4));var _0x7557=function(_0x55d2bc,_0x2f3f1b){_0x55d2bc=_0x55d2bc-0x0;var _0x30e63b=_0x5577[_0x55d2bc];return _0x30e63b;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['index']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={},_0x1c4649={},_0x19095d={'count':0x0,'rows':[]};var _0x414eec=_['map'](db[_0x7557('0x2c')][_0x7557('0x2d')],function(_0x9080c6){return{'name':_0x9080c6[_0x7557('0x2e')],'type':_0x9080c6['type'][_0x7557('0x2f')]};});_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x414eec,_0x7557('0x2a'));_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x3b36eb[_0x7557('0x32')]);_0x1c4649[_0x7557('0x34')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],_0x1c4649[_0x7557('0x32')]);_0x1c6df9[_0x7557('0x36')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],qs[_0x7557('0x37')](_0x3b36eb[_0x7557('0x32')][_0x7557('0x37')]));_0x1c6df9[_0x7557('0x36')]=_0x1c6df9[_0x7557('0x36')][_0x7557('0x38')]?_0x1c6df9[_0x7557('0x36')]:_0x1c4649[_0x7557('0x30')];if(!_0x3b36eb['query'][_0x7557('0x39')]('nolimit')){_0x1c6df9['limit']=qs[_0x7557('0x20')](_0x3b36eb['query'][_0x7557('0x20')]);_0x1c6df9['offset']=qs['offset'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x22')]);}_0x1c6df9[_0x7557('0x3a')]=qs['sort'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x3b')]);_0x1c6df9[_0x7557('0x3c')]=qs[_0x7557('0x34')](_[_0x7557('0x3d')](_0x3b36eb[_0x7557('0x32')],_0x1c4649[_0x7557('0x34')]),_0x414eec);if(_0x3b36eb[_0x7557('0x32')]['filter']){_0x1c6df9['where']=_['merge'](_0x1c6df9['where'],{'$or':_['map'](_0x414eec,function(_0x4f3c68){if(_0x4f3c68[_0x7557('0x3e')]!==_0x7557('0x3f')){var _0x3a7c60={};_0x3a7c60[_0x4f3c68[_0x7557('0x2a')]]={'$like':'%'+_0x3b36eb['query']['filter']+'%'};return _0x3a7c60;}})});}_0x1c6df9=_[_0x7557('0x40')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x41')]);var _0x962488={'where':_0x1c6df9[_0x7557('0x3c')]};return db[_0x7557('0x2c')]['count'](_0x962488)[_0x7557('0x27')](function(_0x5149c9){_0x19095d[_0x7557('0x21')]=_0x5149c9;if(_0x3b36eb[_0x7557('0x32')][_0x7557('0x42')]){_0x1c6df9[_0x7557('0x43')]=[{'all':!![]}];}return db[_0x7557('0x2c')]['findAll'](_0x1c6df9);})[_0x7557('0x27')](function(_0x3023e5){_0x19095d[_0x7557('0x44')]=_0x3023e5;return _0x19095d;})[_0x7557('0x27')](respondWithFilteredResult(_0x2b4ca8,_0x1c6df9))['catch'](handleError(_0x2b4ca8,null));};exports[_0x7557('0x45')]=function(_0x59a75a,_0x156f3b){var _0x576461={'raw':!![],'where':{'id':_0x59a75a['params']['id']}},_0x16e40f={};_0x16e40f[_0x7557('0x30')]=_['keys'](db[_0x7557('0x2c')]['rawAttributes']);_0x16e40f[_0x7557('0x32')]=_[_0x7557('0x33')](_0x59a75a[_0x7557('0x32')]);_0x16e40f[_0x7557('0x34')]=_[_0x7557('0x35')](_0x16e40f[_0x7557('0x30')],_0x16e40f['query']);_0x576461['attributes']=_['intersection'](_0x16e40f[_0x7557('0x30')],qs[_0x7557('0x37')](_0x59a75a[_0x7557('0x32')][_0x7557('0x37')]));_0x576461[_0x7557('0x36')]=_0x576461['attributes'][_0x7557('0x38')]?_0x576461['attributes']:_0x16e40f[_0x7557('0x30')];if(_0x59a75a[_0x7557('0x32')][_0x7557('0x42')]){_0x576461[_0x7557('0x43')]=[{'all':!![]}];}_0x576461=_[_0x7557('0x40')]({},_0x576461,_0x59a75a[_0x7557('0x41')]);return db[_0x7557('0x2c')][_0x7557('0x46')](_0x576461)['then'](handleEntityNotFound(_0x156f3b,null))[_0x7557('0x27')](respondWithResult(_0x156f3b,null))[_0x7557('0x47')](handleError(_0x156f3b,null));};exports[_0x7557('0x48')]=function(_0x59904c,_0xb25031){return db['Cdr']['create'](_0x59904c[_0x7557('0x49')],{})[_0x7557('0x27')](respondWithResult(_0xb25031,0xc9))[_0x7557('0x47')](handleError(_0xb25031,null));};exports[_0x7557('0x4a')]=function(_0x3683c9,_0x4d9b43){if(_0x3683c9[_0x7557('0x49')]['id']){delete _0x3683c9[_0x7557('0x49')]['id'];}return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x3683c9[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4d9b43,null))[_0x7557('0x27')](saveUpdates(_0x3683c9['body'],null))['then'](respondWithResult(_0x4d9b43,null))['catch'](handleError(_0x4d9b43,null));};exports['destroy']=function(_0x2b85c5,_0x36a2a1){return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x2b85c5[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x36a2a1,null))[_0x7557('0x27')](removeEntity(_0x36a2a1,null))[_0x7557('0x47')](handleError(_0x36a2a1,null));};exports['describe']=function(_0x46b871,_0x445e17){return db['Cdr'][_0x7557('0x4c')]()['then'](respondWithResult(_0x445e17,null))[_0x7557('0x47')](handleError(_0x445e17,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2b05430..6b0d01f 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(_0x40bc1a,_0x83860){var _0x10cff3=function(_0x29e99b){while(--_0x29e99b){_0x40bc1a['push'](_0x40bc1a['shift']());}};_0x10cff3(++_0x83860);}(_0x7a54,0x106));var _0x47a5=function(_0x36ad6e,_0x5af573){_0x36ad6e=_0x36ad6e-0x0;var _0x444040=_0x7a54[_0x36ad6e];return _0x444040;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x12c926,_0x158d01){var _0x14ba0f=function(_0x39fb1f){while(--_0x39fb1f){_0x12c926['push'](_0x12c926['shift']());}};_0x14ba0f(++_0x158d01);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 3fd503e..e6196be 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 _0x2a26=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1e0ca5,_0x57fd4f){var _0x410923=function(_0x5bd94d){while(--_0x5bd94d){_0x1e0ca5['push'](_0x1e0ca5['shift']());}};_0x410923(++_0x57fd4f);}(_0x2a26,0x115));var _0x62a2=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0x2a26[_0x3f993e];return _0x39c135;};'use strict';var _=require('lodash');var util=require(_0x62a2('0x0'));var moment=require(_0x62a2('0x1'));var BPromise=require(_0x62a2('0x2'));var rs=require(_0x62a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62a2('0x4'))['db'];var utils=require(_0x62a2('0x5'));var logger=require(_0x62a2('0x6'))('rpc');var config=require(_0x62a2('0x7'));var jayson=require(_0x62a2('0x8'));var client=jayson[_0x62a2('0x9')][_0x62a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c58e0,_0x5236e2,_0x376906){return new BPromise(function(_0x1d2c86,_0x20ec15){return client[_0x62a2('0xb')](_0x5c58e0,_0x376906)[_0x62a2('0xc')](function(_0x4ecafd){logger[_0x62a2('0xd')](_0x62a2('0xe'),_0x5236e2,_0x62a2('0xf'));logger[_0x62a2('0x10')](_0x62a2('0x11'),_0x5236e2,_0x62a2('0xf'),JSON['stringify'](_0x4ecafd));if(_0x4ecafd[_0x62a2('0x12')]){if(_0x4ecafd[_0x62a2('0x12')][_0x62a2('0x13')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x5236e2,_0x4ecafd[_0x62a2('0x12')]['message']);return _0x20ec15(_0x4ecafd[_0x62a2('0x12')][_0x62a2('0x14')]);}logger[_0x62a2('0x12')](_0x62a2('0xe'),_0x5236e2,_0x4ecafd['error'][_0x62a2('0x14')]);return _0x1d2c86(_0x4ecafd[_0x62a2('0x12')][_0x62a2('0x14')]);}else{logger[_0x62a2('0xd')](_0x62a2('0xe'),_0x5236e2,_0x62a2('0xf'));_0x1d2c86(_0x4ecafd['result'][_0x62a2('0x14')]);}})[_0x62a2('0x15')](function(_0xa7bb21){logger['error']('Cdr,\x20%s,\x20%s',_0x5236e2,_0xa7bb21);_0x20ec15(_0xa7bb21);});});} \ No newline at end of file +var _0x9f73=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0xc0160b,_0xa0101){var _0x14b443=function(_0x6dcdcd){while(--_0x6dcdcd){_0xc0160b['push'](_0xc0160b['shift']());}};_0x14b443(++_0xa0101);}(_0x9f73,0x133));var _0x39f7=function(_0x26dcb7,_0x3146ec){_0x26dcb7=_0x26dcb7-0x0;var _0x142d93=_0x9f73[_0x26dcb7];return _0x142d93;};'use strict';var _=require(_0x39f7('0x0'));var util=require(_0x39f7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x39f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39f7('0x3'))['db'];var utils=require(_0x39f7('0x4'));var logger=require(_0x39f7('0x5'))(_0x39f7('0x6'));var config=require(_0x39f7('0x7'));var jayson=require(_0x39f7('0x8'));var client=jayson['client'][_0x39f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13fceb,_0x246857,_0x27e649){return new BPromise(function(_0x22178c,_0x5950b1){return client[_0x39f7('0xa')](_0x13fceb,_0x27e649)[_0x39f7('0xb')](function(_0x5e0a80){logger[_0x39f7('0xc')]('Cdr,\x20%s,\x20%s',_0x246857,_0x39f7('0xd'));logger[_0x39f7('0xe')](_0x39f7('0xf'),_0x246857,_0x39f7('0xd'),JSON[_0x39f7('0x10')](_0x5e0a80));if(_0x5e0a80[_0x39f7('0x11')]){if(_0x5e0a80[_0x39f7('0x11')][_0x39f7('0x12')]===0x1f4){logger[_0x39f7('0x11')]('Cdr,\x20%s,\x20%s',_0x246857,_0x5e0a80[_0x39f7('0x11')][_0x39f7('0x13')]);return _0x5950b1(_0x5e0a80[_0x39f7('0x11')][_0x39f7('0x13')]);}logger[_0x39f7('0x11')](_0x39f7('0x14'),_0x246857,_0x5e0a80[_0x39f7('0x11')]['message']);return _0x22178c(_0x5e0a80[_0x39f7('0x11')]['message']);}else{logger['info'](_0x39f7('0x14'),_0x246857,'request\x20sent');_0x22178c(_0x5e0a80[_0x39f7('0x15')][_0x39f7('0x13')]);}})[_0x39f7('0x16')](function(_0x2dd987){logger[_0x39f7('0x11')](_0x39f7('0x14'),_0x246857,_0x2dd987);_0x5950b1(_0x2dd987);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3d2c238..26a1d61 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1938f4,_0x5c0c98){var _0x37f4db=function(_0x5bec0c){while(--_0x5bec0c){_0x1938f4['push'](_0x1938f4['shift']());}};_0x37f4db(++_0x5c0c98);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 8b957de..c7e1d53 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 _0xc0e8=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x261572,_0xc4147e){var _0x2e8a9d=function(_0x4c8757){while(--_0x4c8757){_0x261572['push'](_0x261572['shift']());}};_0x2e8a9d(++_0xc4147e);}(_0xc0e8,0x175));var _0x8c0e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc0e8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8c0e('0x0'));module[_0x8c0e('0x1')]={'priority':{'type':Sequelize[_0x8c0e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8c0e('0x3')],'allowNull':![],'defaultValue':_0x8c0e('0x4')},'appdata':{'type':Sequelize[_0x8c0e('0x5')]()},'description':{'type':Sequelize[_0x8c0e('0x3')]},'interval':{'type':Sequelize[_0x8c0e('0x3')],'defaultValue':_0x8c0e('0x6')}}; \ No newline at end of file +var _0x1038=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x51c1c0,_0x1ec641){var _0x3c183f=function(_0x43b0f8){while(--_0x43b0f8){_0x51c1c0['push'](_0x51c1c0['shift']());}};_0x3c183f(++_0x1ec641);}(_0x1038,0x1b3));var _0x8103=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0x1038[_0x358806];return _0x19fdcb;};'use strict';var Sequelize=require(_0x8103('0x0'));module[_0x8103('0x1')]={'priority':{'type':Sequelize[_0x8103('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8103('0x3')],'allowNull':![],'defaultValue':_0x8103('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8103('0x3')],'defaultValue':_0x8103('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 93a577d..3332f3d 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 _0xa047=['merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','params','model','ChatApplication','query','keys','filters','intersection','attributes','fields','includeAll','include'];(function(_0x71c2ac,_0x32eb1f){var _0x47582e=function(_0x2365f8){while(--_0x2365f8){_0x71c2ac['push'](_0x71c2ac['shift']());}};_0x47582e(++_0x32eb1f);}(_0xa047,0x1c5));var _0x7a04=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xa047[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0x7a04('0x0'));var rimraf=require(_0x7a04('0x1'));var zipdir=require(_0x7a04('0x2'));var jsonpatch=require(_0x7a04('0x3'));var rp=require('request-promise');var moment=require(_0x7a04('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a04('0x5'));var util=require(_0x7a04('0x6'));var path=require(_0x7a04('0x7'));var sox=require(_0x7a04('0x8'));var csv=require(_0x7a04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a04('0xa'));var _=require(_0x7a04('0xb'));var squel=require(_0x7a04('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a04('0xd'));var deskjs=require(_0x7a04('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7a04('0xf'));var Papa=require(_0x7a04('0x10'));var Redis=require('ioredis');var authService=require(_0x7a04('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a04('0x12'));var logger=require(_0x7a04('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a04('0x14'));var db=require(_0x7a04('0x15'))['db'];function respondWithStatusCode(_0x3e8692,_0x15a002){_0x15a002=_0x15a002||0xcc;return function(_0x10931c){if(_0x10931c){return _0x3e8692[_0x7a04('0x16')](_0x15a002);}return _0x3e8692[_0x7a04('0x17')](_0x15a002)[_0x7a04('0x18')]();};}function respondWithResult(_0x3630a2,_0x5ae457){_0x5ae457=_0x5ae457||0xc8;return function(_0x3b601d){if(_0x3b601d){return _0x3630a2[_0x7a04('0x17')](_0x5ae457)[_0x7a04('0x19')](_0x3b601d);}};}function respondWithFilteredResult(_0x377fa1,_0x2bb838){return function(_0x328973){if(_0x328973){var _0x4f434f=typeof _0x2bb838[_0x7a04('0x1a')]===_0x7a04('0x1b')&&typeof _0x2bb838[_0x7a04('0x1c')]==='undefined';var _0x5cf6ba=_0x328973[_0x7a04('0x1d')];var _0x4310a2=_0x4f434f?0x0:_0x2bb838[_0x7a04('0x1a')];var _0x5716f5=_0x4f434f?_0x328973[_0x7a04('0x1d')]:_0x2bb838[_0x7a04('0x1a')]+_0x2bb838['limit'];var _0x1ba187;if(_0x5716f5>=_0x5cf6ba){_0x5716f5=_0x5cf6ba;_0x1ba187=0xc8;}else{_0x1ba187=0xce;}_0x377fa1['status'](_0x1ba187);return _0x377fa1[_0x7a04('0x1e')]('Content-Range',_0x4310a2+'-'+_0x5716f5+'/'+_0x5cf6ba)[_0x7a04('0x19')](_0x328973);}return null;};}function patchUpdates(_0x10c327){return function(_0x51b13b){try{jsonpatch[_0x7a04('0x1f')](_0x51b13b,_0x10c327,!![]);}catch(_0x298006){return BPromise['reject'](_0x298006);}return _0x51b13b[_0x7a04('0x20')]();};}function saveUpdates(_0x258346,_0x57eaa5){return function(_0x281562){if(_0x281562){return _0x281562[_0x7a04('0x21')](_0x258346)[_0x7a04('0x22')](function(_0x212d52){return _0x212d52;});}return null;};}function removeEntity(_0x2f8ff6,_0x21b668){return function(_0x1deb47){if(_0x1deb47){return _0x1deb47[_0x7a04('0x23')]()['then'](function(){_0x2f8ff6[_0x7a04('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x303004,_0x415d54){return function(_0x2da06b){if(!_0x2da06b){_0x303004[_0x7a04('0x16')](0x194);}return _0x2da06b;};}function handleError(_0x1162ac,_0x1ff41b){_0x1ff41b=_0x1ff41b||0x1f4;return function(_0x3743b3){logger[_0x7a04('0x24')](_0x3743b3[_0x7a04('0x25')]);if(_0x3743b3[_0x7a04('0x26')]){delete _0x3743b3[_0x7a04('0x26')];}_0x1162ac['status'](_0x1ff41b)[_0x7a04('0x27')](_0x3743b3);};}exports['show']=function(_0x2cfd76,_0x246310){var _0x1b6eba={'raw':!![],'where':{'id':_0x2cfd76[_0x7a04('0x28')]['id']}},_0x3a9d10={};_0x3a9d10[_0x7a04('0x29')]=_['keys'](db[_0x7a04('0x2a')]['rawAttributes']);_0x3a9d10[_0x7a04('0x2b')]=_[_0x7a04('0x2c')](_0x2cfd76['query']);_0x3a9d10[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x3a9d10['model'],_0x3a9d10['query']);_0x1b6eba[_0x7a04('0x2f')]=_[_0x7a04('0x2e')](_0x3a9d10[_0x7a04('0x29')],qs[_0x7a04('0x30')](_0x2cfd76[_0x7a04('0x2b')][_0x7a04('0x30')]));_0x1b6eba[_0x7a04('0x2f')]=_0x1b6eba[_0x7a04('0x2f')]['length']?_0x1b6eba[_0x7a04('0x2f')]:_0x3a9d10[_0x7a04('0x29')];if(_0x2cfd76['query'][_0x7a04('0x31')]){_0x1b6eba[_0x7a04('0x32')]=[{'all':!![]}];}_0x1b6eba=_[_0x7a04('0x33')]({},_0x1b6eba,_0x2cfd76[_0x7a04('0x34')]);return db[_0x7a04('0x2a')][_0x7a04('0x35')](_0x1b6eba)[_0x7a04('0x22')](handleEntityNotFound(_0x246310,null))['then'](respondWithResult(_0x246310,null))[_0x7a04('0x36')](handleError(_0x246310,null));};exports[_0x7a04('0x21')]=function(_0x5b9339,_0x4ac74f){if(_0x5b9339[_0x7a04('0x37')]['id']){delete _0x5b9339['body']['id'];}return db[_0x7a04('0x2a')]['find']({'where':{'id':_0x5b9339[_0x7a04('0x28')]['id']}})[_0x7a04('0x22')](handleEntityNotFound(_0x4ac74f,null))[_0x7a04('0x22')](saveUpdates(_0x5b9339[_0x7a04('0x37')],null))[_0x7a04('0x22')](respondWithResult(_0x4ac74f,null))[_0x7a04('0x36')](handleError(_0x4ac74f,null));};exports[_0x7a04('0x23')]=function(_0x39ede8,_0x4151e3){return db['ChatApplication']['find']({'where':{'id':_0x39ede8['params']['id']}})['then'](handleEntityNotFound(_0x4151e3,null))[_0x7a04('0x22')](removeEntity(_0x4151e3,null))['catch'](handleError(_0x4151e3,null));}; \ No newline at end of file +var _0xd624=['rawAttributes','keys','query','filters','intersection','attributes','fields','ChatApplication','find','catch','body','params','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','show','model'];(function(_0x2173da,_0x51ab69){var _0x5e808c=function(_0x5a2a3e){while(--_0x5a2a3e){_0x2173da['push'](_0x2173da['shift']());}};_0x5e808c(++_0x51ab69);}(_0xd624,0x124));var _0x4d62=function(_0x40823e,_0x3d7ee6){_0x40823e=_0x40823e-0x0;var _0x4ab878=_0xd624[_0x40823e];return _0x4ab878;};'use strict';var emlformat=require(_0x4d62('0x0'));var rimraf=require(_0x4d62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d62('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d62('0x3'));var util=require(_0x4d62('0x4'));var path=require(_0x4d62('0x5'));var sox=require(_0x4d62('0x6'));var csv=require(_0x4d62('0x7'));var ejs=require(_0x4d62('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d62('0x9'));var crypto=require(_0x4d62('0xa'));var jsforce=require(_0x4d62('0xb'));var deskjs=require(_0x4d62('0xc'));var toCsv=require(_0x4d62('0x7'));var querystring=require('querystring');var Papa=require(_0x4d62('0xd'));var Redis=require(_0x4d62('0xe'));var authService=require(_0x4d62('0xf'));var qs=require(_0x4d62('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d62('0x11'));var logger=require(_0x4d62('0x12'))(_0x4d62('0x13'));var utils=require(_0x4d62('0x14'));var config=require(_0x4d62('0x15'));var licenseUtil=require(_0x4d62('0x16'));var db=require(_0x4d62('0x17'))['db'];function respondWithStatusCode(_0xc94193,_0x3d30a7){_0x3d30a7=_0x3d30a7||0xcc;return function(_0x282d79){if(_0x282d79){return _0xc94193[_0x4d62('0x18')](_0x3d30a7);}return _0xc94193[_0x4d62('0x19')](_0x3d30a7)['end']();};}function respondWithResult(_0x117c68,_0x409910){_0x409910=_0x409910||0xc8;return function(_0x1c6768){if(_0x1c6768){return _0x117c68['status'](_0x409910)[_0x4d62('0x1a')](_0x1c6768);}};}function respondWithFilteredResult(_0x1f3b54,_0x142396){return function(_0x5e2cee){if(_0x5e2cee){var _0x4974f4=typeof _0x142396[_0x4d62('0x1b')]===_0x4d62('0x1c')&&typeof _0x142396['limit']==='undefined';var _0x2e8602=_0x5e2cee[_0x4d62('0x1d')];var _0x54920b=_0x4974f4?0x0:_0x142396[_0x4d62('0x1b')];var _0x27ca77=_0x4974f4?_0x5e2cee[_0x4d62('0x1d')]:_0x142396[_0x4d62('0x1b')]+_0x142396[_0x4d62('0x1e')];var _0x45f78f;if(_0x27ca77>=_0x2e8602){_0x27ca77=_0x2e8602;_0x45f78f=0xc8;}else{_0x45f78f=0xce;}_0x1f3b54[_0x4d62('0x19')](_0x45f78f);return _0x1f3b54[_0x4d62('0x1f')](_0x4d62('0x20'),_0x54920b+'-'+_0x27ca77+'/'+_0x2e8602)[_0x4d62('0x1a')](_0x5e2cee);}return null;};}function patchUpdates(_0x494a8f){return function(_0x5d9e64){try{jsonpatch['apply'](_0x5d9e64,_0x494a8f,!![]);}catch(_0x435035){return BPromise[_0x4d62('0x21')](_0x435035);}return _0x5d9e64[_0x4d62('0x22')]();};}function saveUpdates(_0x5a0796,_0x3a5e4f){return function(_0x16fa3a){if(_0x16fa3a){return _0x16fa3a[_0x4d62('0x23')](_0x5a0796)['then'](function(_0x26c5e3){return _0x26c5e3;});}return null;};}function removeEntity(_0x30c443,_0x1a7ee9){return function(_0x57987b){if(_0x57987b){return _0x57987b[_0x4d62('0x24')]()[_0x4d62('0x25')](function(){_0x30c443['status'](0xcc)[_0x4d62('0x26')]();});}};}function handleEntityNotFound(_0x3b4eee,_0x2a09f9){return function(_0x414a9e){if(!_0x414a9e){_0x3b4eee[_0x4d62('0x18')](0x194);}return _0x414a9e;};}function handleError(_0x4e88cc,_0x5635a9){_0x5635a9=_0x5635a9||0x1f4;return function(_0x40c9c8){logger[_0x4d62('0x27')](_0x40c9c8[_0x4d62('0x28')]);if(_0x40c9c8[_0x4d62('0x29')]){delete _0x40c9c8['name'];}_0x4e88cc['status'](_0x5635a9)['send'](_0x40c9c8);};}exports[_0x4d62('0x2a')]=function(_0x566cce,_0x1b1f0c){var _0x2b76af={'raw':!![],'where':{'id':_0x566cce['params']['id']}},_0x132181={};_0x132181[_0x4d62('0x2b')]=_['keys'](db['ChatApplication'][_0x4d62('0x2c')]);_0x132181['query']=_[_0x4d62('0x2d')](_0x566cce[_0x4d62('0x2e')]);_0x132181[_0x4d62('0x2f')]=_[_0x4d62('0x30')](_0x132181[_0x4d62('0x2b')],_0x132181[_0x4d62('0x2e')]);_0x2b76af[_0x4d62('0x31')]=_[_0x4d62('0x30')](_0x132181['model'],qs[_0x4d62('0x32')](_0x566cce[_0x4d62('0x2e')][_0x4d62('0x32')]));_0x2b76af['attributes']=_0x2b76af[_0x4d62('0x31')]['length']?_0x2b76af['attributes']:_0x132181['model'];if(_0x566cce[_0x4d62('0x2e')]['includeAll']){_0x2b76af['include']=[{'all':!![]}];}_0x2b76af=_['merge']({},_0x2b76af,_0x566cce['options']);return db[_0x4d62('0x33')][_0x4d62('0x34')](_0x2b76af)[_0x4d62('0x25')](handleEntityNotFound(_0x1b1f0c,null))[_0x4d62('0x25')](respondWithResult(_0x1b1f0c,null))[_0x4d62('0x35')](handleError(_0x1b1f0c,null));};exports[_0x4d62('0x23')]=function(_0x4643bc,_0x2855ca){if(_0x4643bc[_0x4d62('0x36')]['id']){delete _0x4643bc['body']['id'];}return db[_0x4d62('0x33')]['find']({'where':{'id':_0x4643bc['params']['id']}})['then'](handleEntityNotFound(_0x2855ca,null))[_0x4d62('0x25')](saveUpdates(_0x4643bc[_0x4d62('0x36')],null))[_0x4d62('0x25')](respondWithResult(_0x2855ca,null))[_0x4d62('0x35')](handleError(_0x2855ca,null));};exports[_0x4d62('0x24')]=function(_0x2cc381,_0x522d9b){return db[_0x4d62('0x33')]['find']({'where':{'id':_0x2cc381[_0x4d62('0x37')]['id']}})[_0x4d62('0x25')](handleEntityNotFound(_0x522d9b,null))[_0x4d62('0x25')](removeEntity(_0x522d9b,null))[_0x4d62('0x35')](handleError(_0x522d9b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index dae77cd..eed0d6a 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 _0x553b=['util','api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','lodash'];(function(_0x478101,_0xd960c9){var _0x35abd6=function(_0x612e5e){while(--_0x612e5e){_0x478101['push'](_0x478101['shift']());}};_0x35abd6(++_0xd960c9);}(_0x553b,0xfb));var _0xb553=function(_0x3c694d,_0x5b2bb6){_0x3c694d=_0x3c694d-0x0;var _0x3bb979=_0x553b[_0x3c694d];return _0x3bb979;};'use strict';var _=require(_0xb553('0x0'));var util=require(_0xb553('0x1'));var logger=require('../../config/logger')(_0xb553('0x2'));var moment=require('moment');var BPromise=require(_0xb553('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb553('0x4'));var rimraf=require(_0xb553('0x5'));var config=require(_0xb553('0x6'));var attributes=require(_0xb553('0x7'));module[_0xb553('0x8')]=function(_0x2e5dde,_0x3bd77c){return _0x2e5dde[_0xb553('0x9')](_0xb553('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb553('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x20e7=['util','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x20e7,0x178));var _0x720e=function(_0x3ce44a,_0x216712){_0x3ce44a=_0x3ce44a-0x0;var _0x1906ff=_0x20e7[_0x3ce44a];return _0x1906ff;};'use strict';var _=require(_0x720e('0x0'));var util=require(_0x720e('0x1'));var logger=require('../../config/logger')(_0x720e('0x2'));var moment=require(_0x720e('0x3'));var BPromise=require('bluebird');var rp=require(_0x720e('0x4'));var fs=require('fs');var path=require(_0x720e('0x5'));var rimraf=require(_0x720e('0x6'));var config=require(_0x720e('0x7'));var attributes=require(_0x720e('0x8'));module['exports']=function(_0x14ff38,_0x2b2c47){return _0x14ff38[_0x720e('0x9')](_0x720e('0xa'),attributes,{'tableName':_0x720e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x720e('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 233a80d..607b12b 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 _0xa3d1=['request\x20sent','stringify','error','message','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5434b9,_0xade01c){var _0x4adbce=function(_0xe0b012){while(--_0xe0b012){_0x5434b9['push'](_0x5434b9['shift']());}};_0x4adbce(++_0xade01c);}(_0xa3d1,0x1cf));var _0x1a3d=function(_0x5d153d,_0x540bc9){_0x5d153d=_0x5d153d-0x0;var _0xa61f9=_0xa3d1[_0x5d153d];return _0xa61f9;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var moment=require(_0x1a3d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a3d('0x3'));var fs=require('fs');var Redis=require(_0x1a3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a3d('0x5'));var logger=require(_0x1a3d('0x6'))(_0x1a3d('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a3d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3747b4,_0x23d426,_0x558ebb){return new BPromise(function(_0x2ddc60,_0x104a21){return client[_0x1a3d('0x9')](_0x3747b4,_0x558ebb)[_0x1a3d('0xa')](function(_0x3adb0d){logger['info'](_0x1a3d('0xb'),_0x23d426,'request\x20sent');logger['debug'](_0x1a3d('0xc'),_0x23d426,_0x1a3d('0xd'),JSON[_0x1a3d('0xe')](_0x3adb0d));if(_0x3adb0d[_0x1a3d('0xf')]){if(_0x3adb0d['error']['code']===0x1f4){logger[_0x1a3d('0xf')]('ChatApplication,\x20%s,\x20%s',_0x23d426,_0x3adb0d[_0x1a3d('0xf')][_0x1a3d('0x10')]);return _0x104a21(_0x3adb0d[_0x1a3d('0xf')][_0x1a3d('0x10')]);}logger[_0x1a3d('0xf')](_0x1a3d('0xb'),_0x23d426,_0x3adb0d[_0x1a3d('0xf')][_0x1a3d('0x10')]);return _0x2ddc60(_0x3adb0d[_0x1a3d('0xf')]['message']);}else{logger['info'](_0x1a3d('0xb'),_0x23d426,_0x1a3d('0xd'));_0x2ddc60(_0x3adb0d['result'][_0x1a3d('0x10')]);}})['catch'](function(_0x4f3fc1){logger[_0x1a3d('0xf')](_0x1a3d('0xb'),_0x23d426,_0x4f3fc1);_0x104a21(_0x4f3fc1);});});} \ No newline at end of file +var _0x8359=['rpc','../../config/environment','jayson/promise','client','http','request','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c30bf,_0x247c31){var _0x255b5e=function(_0x70c22b){while(--_0x70c22b){_0x1c30bf['push'](_0x1c30bf['shift']());}};_0x255b5e(++_0x247c31);}(_0x8359,0x19f));var _0x9835=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x8359[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x9835('0x0'));var util=require('util');var moment=require(_0x9835('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9835('0x2'));var db=require(_0x9835('0x3'))['db'];var utils=require(_0x9835('0x4'));var logger=require('../../config/logger')(_0x9835('0x5'));var config=require(_0x9835('0x6'));var jayson=require(_0x9835('0x7'));var client=jayson[_0x9835('0x8')][_0x9835('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x211029,_0x5cdb7e,_0x1bad9f){return new BPromise(function(_0x5ba23c,_0x1fc42a){return client[_0x9835('0xa')](_0x211029,_0x1bad9f)['then'](function(_0xe4576d){logger['info'](_0x9835('0xb'),_0x5cdb7e,'request\x20sent');logger[_0x9835('0xc')](_0x9835('0xd'),_0x5cdb7e,_0x9835('0xe'),JSON[_0x9835('0xf')](_0xe4576d));if(_0xe4576d[_0x9835('0x10')]){if(_0xe4576d[_0x9835('0x10')]['code']===0x1f4){logger[_0x9835('0x10')](_0x9835('0xb'),_0x5cdb7e,_0xe4576d[_0x9835('0x10')][_0x9835('0x11')]);return _0x1fc42a(_0xe4576d[_0x9835('0x10')][_0x9835('0x11')]);}logger[_0x9835('0x10')](_0x9835('0xb'),_0x5cdb7e,_0xe4576d[_0x9835('0x10')]['message']);return _0x5ba23c(_0xe4576d['error'][_0x9835('0x11')]);}else{logger['info'](_0x9835('0xb'),_0x5cdb7e,_0x9835('0xe'));_0x5ba23c(_0xe4576d[_0x9835('0x12')][_0x9835('0x11')]);}})[_0x9835('0x13')](function(_0x2c0da5){logger[_0x9835('0x10')](_0x9835('0xb'),_0x5cdb7e,_0x2c0da5);_0x1fc42a(_0x2c0da5);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 180d69a..d61c57c 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 _0x32d6=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xf4bc,_0x528516){var _0x2bcce6=function(_0x5d28b0){while(--_0x5d28b0){_0xf4bc['push'](_0xf4bc['shift']());}};_0x2bcce6(++_0x528516);}(_0x32d6,0x10c));var _0x632d=function(_0x3f2ab3,_0x491146){_0x3f2ab3=_0x3f2ab3-0x0;var _0x4c0695=_0x32d6[_0x3f2ab3];return _0x4c0695;};'use strict';var multer=require(_0x632d('0x0'));var util=require(_0x632d('0x1'));var path=require(_0x632d('0x2'));var timeout=require(_0x632d('0x3'));var express=require(_0x632d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x632d('0x5'));var interaction=require(_0x632d('0x6'));var config=require(_0x632d('0x7'));var controller=require(_0x632d('0x8'));router['get'](_0x632d('0x9'),auth[_0x632d('0xa')](),controller[_0x632d('0xb')]);router[_0x632d('0xc')](_0x632d('0x9'),auth[_0x632d('0xa')](),controller[_0x632d('0xd')]);router[_0x632d('0xe')](_0x632d('0x9'),auth[_0x632d('0xa')](),controller['destroy']);module[_0x632d('0xf')]=router; \ No newline at end of file +var _0x1194=['show','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x2b24e2,_0x51d6d0){var _0xe60178=function(_0x42a121){while(--_0x42a121){_0x2b24e2['push'](_0x2b24e2['shift']());}};_0xe60178(++_0x51d6d0);}(_0x1194,0x15d));var _0x4119=function(_0x53c33c,_0x27223d){_0x53c33c=_0x53c33c-0x0;var _0x277750=_0x1194[_0x53c33c];return _0x277750;};'use strict';var multer=require(_0x4119('0x0'));var util=require('util');var path=require(_0x4119('0x1'));var timeout=require('connect-timeout');var express=require(_0x4119('0x2'));var router=express[_0x4119('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4119('0x4'));var interaction=require(_0x4119('0x5'));var config=require(_0x4119('0x6'));var controller=require(_0x4119('0x7'));router[_0x4119('0x8')](_0x4119('0x9'),auth[_0x4119('0xa')](),controller[_0x4119('0xb')]);router['put'](_0x4119('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4119('0xc')]('/:id',auth[_0x4119('0xa')](),controller[_0x4119('0xd')]);module[_0x4119('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b05d63a..cb3f5f0 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 _0xe148=['STRING','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe148,0x16b));var _0x8e14=function(_0xde9059,_0x750aab){_0xde9059=_0xde9059-0x0;var _0x23197d=_0xe148[_0xde9059];return _0x23197d;};'use strict';var Sequelize=require('sequelize');module[_0x8e14('0x0')]={'name':{'type':Sequelize[_0x8e14('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8e14('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xad68=['STRING'];(function(_0x5eeed2,_0x44fb82){var _0x1b958b=function(_0x4d9221){while(--_0x4d9221){_0x5eeed2['push'](_0x5eeed2['shift']());}};_0x1b958b(++_0x44fb82);}(_0xad68,0x100));var _0x8ad6=function(_0x5c12ae,_0x29ab56){_0x5c12ae=_0x5c12ae-0x0;var _0x6b60d1=_0xad68[_0x5c12ae];return _0x6b60d1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8ad6('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8ad6('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index b6ee1d0..1d0c169 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 _0x6922=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','length','options','find','create','body','params','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','desk.js'];(function(_0x1833ea,_0x2166d8){var _0x205807=function(_0x4fd4cf){while(--_0x4fd4cf){_0x1833ea['push'](_0x1833ea['shift']());}};_0x205807(++_0x2166d8);}(_0x6922,0xb3));var _0x2692=function(_0x5cde40,_0x29ac0d){_0x5cde40=_0x5cde40-0x0;var _0x588acc=_0x6922[_0x5cde40];return _0x588acc;};'use strict';var emlformat=require(_0x2692('0x0'));var rimraf=require(_0x2692('0x1'));var zipdir=require(_0x2692('0x2'));var jsonpatch=require(_0x2692('0x3'));var rp=require(_0x2692('0x4'));var moment=require('moment');var BPromise=require(_0x2692('0x5'));var Mustache=require(_0x2692('0x6'));var util=require(_0x2692('0x7'));var path=require('path');var sox=require(_0x2692('0x8'));var csv=require(_0x2692('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2692('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2692('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2692('0xc'));var toCsv=require(_0x2692('0x9'));var querystring=require(_0x2692('0xd'));var Papa=require(_0x2692('0xe'));var Redis=require('ioredis');var authService=require(_0x2692('0xf'));var qs=require(_0x2692('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2692('0x11'));var utils=require(_0x2692('0x12'));var config=require(_0x2692('0x13'));var licenseUtil=require(_0x2692('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2692('0x15')],{'host':_0x2692('0x16'),'port':0x18eb});var socket=require(_0x2692('0x17'))(new Redis(config[_0x2692('0x15')]));require(_0x2692('0x18'))[_0x2692('0x19')](socket);function respondWithStatusCode(_0x3efd39,_0x1cf0d7){_0x1cf0d7=_0x1cf0d7||0xcc;return function(_0x2244cc){if(_0x2244cc){return _0x3efd39[_0x2692('0x1a')](_0x1cf0d7);}return _0x3efd39[_0x2692('0x1b')](_0x1cf0d7)[_0x2692('0x1c')]();};}function respondWithResult(_0x87f6e2,_0x1fbb5d){_0x1fbb5d=_0x1fbb5d||0xc8;return function(_0x1a5132){if(_0x1a5132){return _0x87f6e2[_0x2692('0x1b')](_0x1fbb5d)[_0x2692('0x1d')](_0x1a5132);}};}function respondWithFilteredResult(_0x2653d4,_0x3220bb){return function(_0x424bcc){if(_0x424bcc){var _0x255499=typeof _0x3220bb[_0x2692('0x1e')]===_0x2692('0x1f')&&typeof _0x3220bb['limit']===_0x2692('0x1f');var _0xbc9d53=_0x424bcc[_0x2692('0x20')];var _0x4d02d4=_0x255499?0x0:_0x3220bb['offset'];var _0x4e7e48=_0x255499?_0x424bcc[_0x2692('0x20')]:_0x3220bb['offset']+_0x3220bb[_0x2692('0x21')];var _0x1306ca;if(_0x4e7e48>=_0xbc9d53){_0x4e7e48=_0xbc9d53;_0x1306ca=0xc8;}else{_0x1306ca=0xce;}_0x2653d4[_0x2692('0x1b')](_0x1306ca);return _0x2653d4[_0x2692('0x22')](_0x2692('0x23'),_0x4d02d4+'-'+_0x4e7e48+'/'+_0xbc9d53)['json'](_0x424bcc);}return null;};}function patchUpdates(_0x58d5ba){return function(_0x529945){try{jsonpatch[_0x2692('0x24')](_0x529945,_0x58d5ba,!![]);}catch(_0x2f7e2d){return BPromise[_0x2692('0x25')](_0x2f7e2d);}return _0x529945[_0x2692('0x26')]();};}function saveUpdates(_0x26aca8,_0x2f0ea3){return function(_0x4a360f){if(_0x4a360f){return _0x4a360f[_0x2692('0x27')](_0x26aca8)[_0x2692('0x28')](function(_0x247ff2){return _0x247ff2;});}return null;};}function removeEntity(_0xead6c6,_0xa75a22){return function(_0xe684da){if(_0xe684da){return _0xe684da[_0x2692('0x29')]()['then'](function(){_0xead6c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5baeb7,_0x5ca214){return function(_0x3a76e5){if(!_0x3a76e5){_0x5baeb7[_0x2692('0x1a')](0x194);}return _0x3a76e5;};}function handleError(_0x2093f0,_0xa85797){_0xa85797=_0xa85797||0x1f4;return function(_0x306395){logger[_0x2692('0x2a')](_0x306395[_0x2692('0x2b')]);if(_0x306395[_0x2692('0x2c')]){delete _0x306395[_0x2692('0x2c')];}_0x2093f0['status'](_0xa85797)['send'](_0x306395);};}exports['index']=function(_0x398216,_0x5ad538){var _0x3f38df={},_0x694b8f={},_0x4109f2={'count':0x0,'rows':[]};var _0x419a1a=_[_0x2692('0x2d')](db[_0x2692('0x2e')][_0x2692('0x2f')],function(_0x2761c2){return{'name':_0x2761c2[_0x2692('0x30')],'type':_0x2761c2[_0x2692('0x31')][_0x2692('0x32')]};});_0x694b8f['model']=_[_0x2692('0x2d')](_0x419a1a,_0x2692('0x2c'));_0x694b8f[_0x2692('0x33')]=_['keys'](_0x398216[_0x2692('0x33')]);_0x694b8f[_0x2692('0x34')]=_[_0x2692('0x35')](_0x694b8f[_0x2692('0x36')],_0x694b8f[_0x2692('0x33')]);_0x3f38df[_0x2692('0x37')]=_[_0x2692('0x35')](_0x694b8f[_0x2692('0x36')],qs[_0x2692('0x38')](_0x398216['query'][_0x2692('0x38')]));_0x3f38df[_0x2692('0x37')]=_0x3f38df[_0x2692('0x37')]['length']?_0x3f38df[_0x2692('0x37')]:_0x694b8f['model'];if(!_0x398216[_0x2692('0x33')][_0x2692('0x39')](_0x2692('0x3a'))){_0x3f38df[_0x2692('0x21')]=qs[_0x2692('0x21')](_0x398216[_0x2692('0x33')][_0x2692('0x21')]);_0x3f38df['offset']=qs['offset'](_0x398216[_0x2692('0x33')]['offset']);}_0x3f38df[_0x2692('0x3b')]=qs[_0x2692('0x3c')](_0x398216[_0x2692('0x33')]['sort']);_0x3f38df[_0x2692('0x3d')]=qs[_0x2692('0x34')](_[_0x2692('0x3e')](_0x398216[_0x2692('0x33')],_0x694b8f[_0x2692('0x34')]),_0x419a1a);if(_0x398216[_0x2692('0x33')][_0x2692('0x3f')]){_0x3f38df['where']=_[_0x2692('0x40')](_0x3f38df[_0x2692('0x3d')],{'$or':_[_0x2692('0x2d')](_0x419a1a,function(_0x585e26){if(_0x585e26[_0x2692('0x31')]!==_0x2692('0x41')){var _0x242263={};_0x242263[_0x585e26[_0x2692('0x2c')]]={'$like':'%'+_0x398216[_0x2692('0x33')][_0x2692('0x3f')]+'%'};return _0x242263;}})});}_0x3f38df=_[_0x2692('0x40')]({},_0x3f38df,_0x398216['options']);var _0x5c494d={'where':_0x3f38df[_0x2692('0x3d')]};return db['ChatGroup']['count'](_0x5c494d)[_0x2692('0x28')](function(_0x30551d){_0x4109f2[_0x2692('0x20')]=_0x30551d;if(_0x398216[_0x2692('0x33')][_0x2692('0x42')]){_0x3f38df[_0x2692('0x43')]=[{'all':!![]}];}return db[_0x2692('0x2e')][_0x2692('0x44')](_0x3f38df);})[_0x2692('0x28')](function(_0x5d8797){_0x4109f2[_0x2692('0x45')]=_0x5d8797;return _0x4109f2;})['then'](respondWithFilteredResult(_0x5ad538,_0x3f38df))[_0x2692('0x46')](handleError(_0x5ad538,null));};exports[_0x2692('0x47')]=function(_0x58dab4,_0x251aa5){var _0x5bd508={'raw':!![],'where':{'id':_0x58dab4['params']['id']}},_0xe98400={};_0xe98400['model']=_[_0x2692('0x48')](db[_0x2692('0x2e')][_0x2692('0x2f')]);_0xe98400['query']=_[_0x2692('0x48')](_0x58dab4[_0x2692('0x33')]);_0xe98400[_0x2692('0x34')]=_[_0x2692('0x35')](_0xe98400[_0x2692('0x36')],_0xe98400[_0x2692('0x33')]);_0x5bd508['attributes']=_[_0x2692('0x35')](_0xe98400[_0x2692('0x36')],qs[_0x2692('0x38')](_0x58dab4[_0x2692('0x33')]['fields']));_0x5bd508[_0x2692('0x37')]=_0x5bd508['attributes'][_0x2692('0x49')]?_0x5bd508[_0x2692('0x37')]:_0xe98400[_0x2692('0x36')];if(_0x58dab4['query'][_0x2692('0x42')]){_0x5bd508['include']=[{'all':!![]}];}_0x5bd508=_[_0x2692('0x40')]({},_0x5bd508,_0x58dab4[_0x2692('0x4a')]);return db[_0x2692('0x2e')][_0x2692('0x4b')](_0x5bd508)[_0x2692('0x28')](handleEntityNotFound(_0x251aa5,null))[_0x2692('0x28')](respondWithResult(_0x251aa5,null))[_0x2692('0x46')](handleError(_0x251aa5,null));};exports[_0x2692('0x4c')]=function(_0x458382,_0x4eabc4){return db[_0x2692('0x2e')]['create'](_0x458382[_0x2692('0x4d')],{})[_0x2692('0x28')](respondWithResult(_0x4eabc4,0xc9))[_0x2692('0x46')](handleError(_0x4eabc4,null));};exports[_0x2692('0x27')]=function(_0x48dac0,_0x14de90){if(_0x48dac0['body']['id']){delete _0x48dac0[_0x2692('0x4d')]['id'];}return db[_0x2692('0x2e')][_0x2692('0x4b')]({'where':{'id':_0x48dac0[_0x2692('0x4e')]['id']}})[_0x2692('0x28')](handleEntityNotFound(_0x14de90,null))[_0x2692('0x28')](saveUpdates(_0x48dac0['body'],null))[_0x2692('0x28')](respondWithResult(_0x14de90,null))['catch'](handleError(_0x14de90,null));};exports[_0x2692('0x29')]=function(_0x1bc350,_0x4fd6f9){return db[_0x2692('0x2e')][_0x2692('0x4b')]({'where':{'id':_0x1bc350[_0x2692('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4fd6f9,null))[_0x2692('0x28')](removeEntity(_0x4fd6f9,null))[_0x2692('0x46')](handleError(_0x4fd6f9,null));};exports[_0x2692('0x4f')]=function(_0x3c727a,_0x4aff70){return db[_0x2692('0x2e')]['describe']()[_0x2692('0x28')](respondWithResult(_0x4aff70,null))['catch'](handleError(_0x4aff70,null));};exports['getUnread']=function(_0x310154,_0x2e17f0,_0xfe5098){return db[_0x2692('0x50')][_0x2692('0x20')]({'where':{'ChatGroupId':_0x310154[_0x2692('0x4e')]['id'],'ToId':_0x310154[_0x2692('0x51')]['id'],'read':![]}})[_0x2692('0x28')](function(_0x4071d0){return{'id':_['toInteger'](_0x310154[_0x2692('0x4e')]['id']),'count':_0x4071d0};})[_0x2692('0x28')](respondWithResult(_0x2e17f0,null))[_0x2692('0x46')](handleError(_0x2e17f0,null));};exports[_0x2692('0x52')]=function(_0x136cce,_0x28b5cc,_0xfb0b46){return db[_0x2692('0x2e')][_0x2692('0x4b')]({'where':{'id':_0x136cce['params']['id']}})[_0x2692('0x28')](handleEntityNotFound(_0x28b5cc,null))['then'](function(_0x1455f2){if(_0x1455f2){return _0x1455f2[_0x2692('0x52')](_0x136cce['body'][_0x2692('0x53')],_[_0x2692('0x54')](_0x136cce[_0x2692('0x4d')],[_0x2692('0x53'),'id'])||{});}})[_0x2692('0x28')](respondWithResult(_0x28b5cc,null))[_0x2692('0x46')](handleError(_0x28b5cc,null));};exports[_0x2692('0x55')]=function(_0xc3c4d,_0xcb92f8,_0x5557f6){var _0x32835c={};var _0x4c004d={};var _0x337ef8;var _0x494cd2;return db[_0x2692('0x2e')][_0x2692('0x56')]({'where':{'id':_0xc3c4d[_0x2692('0x4e')]['id']}})['then'](handleEntityNotFound(_0xcb92f8,null))[_0x2692('0x28')](function(_0x4191f6){if(_0x4191f6){_0x337ef8=_0x4191f6;_0x4c004d['model']=_[_0x2692('0x48')](db[_0x2692('0x57')][_0x2692('0x2f')]);_0x4c004d[_0x2692('0x33')]=_[_0x2692('0x48')](_0xc3c4d[_0x2692('0x33')]);_0x4c004d['filters']=_[_0x2692('0x35')](_0x4c004d[_0x2692('0x36')],_0x4c004d[_0x2692('0x33')]);_0x32835c[_0x2692('0x37')]=_[_0x2692('0x35')](_0x4c004d[_0x2692('0x36')],qs[_0x2692('0x38')](_0xc3c4d[_0x2692('0x33')]['fields']));_0x32835c[_0x2692('0x37')]=_0x32835c[_0x2692('0x37')][_0x2692('0x49')]?_0x32835c['attributes']:_0x4c004d[_0x2692('0x36')];_0x32835c[_0x2692('0x3b')]=qs['sort'](_0xc3c4d[_0x2692('0x33')]['sort']);_0x32835c[_0x2692('0x3d')]=qs[_0x2692('0x34')](_[_0x2692('0x3e')](_0xc3c4d[_0x2692('0x33')],_0x4c004d['filters']));if(_0xc3c4d[_0x2692('0x33')][_0x2692('0x3f')]){_0x32835c[_0x2692('0x3d')]=_[_0x2692('0x40')](_0x32835c[_0x2692('0x3d')],{'$or':_[_0x2692('0x2d')](_0x32835c['attributes'],function(_0x5eb8d3){var _0x48b2ab={};_0x48b2ab[_0x5eb8d3]={'$like':'%'+_0xc3c4d[_0x2692('0x33')][_0x2692('0x3f')]+'%'};return _0x48b2ab;})});}_0x32835c=_[_0x2692('0x40')]({},_0x32835c,_0xc3c4d['options']);return _0x337ef8[_0x2692('0x55')](_0x32835c);}})[_0x2692('0x28')](function(_0x133872){if(_0x133872){_0x494cd2=_0x133872[_0x2692('0x49')];if(!_0xc3c4d[_0x2692('0x33')][_0x2692('0x39')](_0x2692('0x3a'))){_0x32835c[_0x2692('0x21')]=qs['limit'](_0xc3c4d[_0x2692('0x33')][_0x2692('0x21')]);_0x32835c[_0x2692('0x1e')]=qs[_0x2692('0x1e')](_0xc3c4d['query'][_0x2692('0x1e')]);}return _0x337ef8[_0x2692('0x55')](_0x32835c);}})[_0x2692('0x28')](function(_0xd5439d){if(_0xd5439d){return _0xd5439d?{'count':_0x494cd2,'rows':_0xd5439d}:null;}})[_0x2692('0x28')](respondWithResult(_0xcb92f8,null))[_0x2692('0x46')](handleError(_0xcb92f8,null));};exports[_0x2692('0x58')]=function(_0x2ab407,_0x512699,_0x355f52){return db[_0x2692('0x2e')][_0x2692('0x4b')]({'where':{'id':_0x2ab407['params']['id']}})[_0x2692('0x28')](handleEntityNotFound(_0x512699,null))['then'](function(_0x11b5b7){if(_0x11b5b7){return _0x11b5b7['removeMembers'](_0x2ab407[_0x2692('0x33')][_0x2692('0x53')]);}})[_0x2692('0x28')](respondWithStatusCode(_0x512699,null))[_0x2692('0x46')](handleError(_0x512699,null));};exports[_0x2692('0x59')]=function(_0x18d8ac,_0xa03303,_0x58d1c8){if(_0x18d8ac[_0x2692('0x4d')]['id']){delete _0x18d8ac[_0x2692('0x4d')]['id'];}return db[_0x2692('0x2e')][_0x2692('0x4b')]({'where':{'id':_0x18d8ac[_0x2692('0x4e')]['id']}})[_0x2692('0x28')](handleEntityNotFound(_0xa03303,null))[_0x2692('0x28')](function(_0x34f7c9){if(_0x34f7c9){_0x18d8ac[_0x2692('0x4d')][_0x2692('0x5a')]=_0x34f7c9['id'];return db[_0x2692('0x50')][_0x2692('0x4c')](_0x18d8ac[_0x2692('0x4d')]);}})[_0x2692('0x28')](respondWithResult(_0xa03303,null))[_0x2692('0x46')](handleError(_0xa03303,null));};exports[_0x2692('0x5b')]=function(_0x5d54b0,_0x3d6f8a,_0x4093c3){var _0x45f70b={};var _0x57da42={};var _0x3b1393;var _0x46194b;return db[_0x2692('0x2e')][_0x2692('0x56')]({'where':{'id':_0x5d54b0[_0x2692('0x4e')]['id']}})[_0x2692('0x28')](handleEntityNotFound(_0x3d6f8a,null))[_0x2692('0x28')](function(_0x53bdfd){if(_0x53bdfd){_0x3b1393=_0x53bdfd;_0x57da42[_0x2692('0x36')]=_[_0x2692('0x48')](db['ChatInternalMessage'][_0x2692('0x2f')]);_0x57da42[_0x2692('0x33')]=_[_0x2692('0x48')](_0x5d54b0[_0x2692('0x33')]);_0x57da42[_0x2692('0x34')]=_['intersection'](_0x57da42[_0x2692('0x36')],_0x57da42['query']);_0x45f70b[_0x2692('0x37')]=_['intersection'](_0x57da42[_0x2692('0x36')],qs[_0x2692('0x38')](_0x5d54b0[_0x2692('0x33')]['fields']));_0x45f70b['attributes']=_0x45f70b['attributes'][_0x2692('0x49')]?_0x45f70b[_0x2692('0x37')]:_0x57da42[_0x2692('0x36')];_0x45f70b[_0x2692('0x3b')]=qs[_0x2692('0x3c')](_0x5d54b0[_0x2692('0x33')][_0x2692('0x3c')]);_0x45f70b['where']=qs['filters'](_[_0x2692('0x3e')](_0x5d54b0[_0x2692('0x33')],_0x57da42[_0x2692('0x34')]));if(_0x5d54b0['query'][_0x2692('0x3f')]){_0x45f70b[_0x2692('0x3d')]=_[_0x2692('0x40')](_0x45f70b[_0x2692('0x3d')],{'$or':_[_0x2692('0x2d')](_0x45f70b[_0x2692('0x37')],function(_0x3218c4){var _0x62998b={};_0x62998b[_0x3218c4]={'$like':'%'+_0x5d54b0['query'][_0x2692('0x3f')]+'%'};return _0x62998b;})});}if(_0x5d54b0[_0x2692('0x33')][_0x2692('0x5c')]){var _0x2c1253=_0x5d54b0['query']['$gte'][_0x2692('0x5d')](',');var _0x7c1870={};_0x7c1870[_0x2c1253[0x0]]={'$gte':moment(_0x2c1253[0x1])[_0x2692('0x5e')](_0x2692('0x5f'))};_0x45f70b[_0x2692('0x3d')]=_[_0x2692('0x40')](_0x45f70b[_0x2692('0x3d')],_0x7c1870);}_0x45f70b=_[_0x2692('0x40')]({},_0x45f70b,_0x5d54b0[_0x2692('0x4a')]);return _0x3b1393[_0x2692('0x5b')](_0x45f70b);}})[_0x2692('0x28')](function(_0x8f04c){if(_0x8f04c){_0x46194b=_0x8f04c['length'];if(!_0x5d54b0[_0x2692('0x33')][_0x2692('0x39')](_0x2692('0x3a'))){_0x45f70b[_0x2692('0x21')]=qs[_0x2692('0x21')](_0x5d54b0['query'][_0x2692('0x21')]);_0x45f70b[_0x2692('0x1e')]=qs[_0x2692('0x1e')](_0x5d54b0[_0x2692('0x33')][_0x2692('0x1e')]);}return _0x3b1393[_0x2692('0x5b')](_0x45f70b);}})[_0x2692('0x28')](function(_0x1845be){if(_0x1845be){return _0x1845be?{'count':_0x46194b,'rows':_0x1845be}:null;}})[_0x2692('0x28')](respondWithResult(_0x3d6f8a,null))[_0x2692('0x46')](handleError(_0x3d6f8a,null));}; \ No newline at end of file +var _0x15da=['model','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','getUnread','toInteger','ids','omit','getMembers','findOne','User','pick','removeMembers','ChatGroupId','getMessages','ChatInternalMessage','$gte','format','hasOwnProperty','eml-format','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','api','../../config/license/util','redis','localhost','./chatGroup.socket','register','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatGroup','fieldName','type','key','map','query','keys','filters','intersection','attributes'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x15da,0x188));var _0xa15d=function(_0x12f9e3,_0x3fadc1){_0x12f9e3=_0x12f9e3-0x0;var _0x2de0c8=_0x15da[_0x12f9e3];return _0x2de0c8;};'use strict';var emlformat=require(_0xa15d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa15d('0x1'));var moment=require(_0xa15d('0x2'));var BPromise=require(_0xa15d('0x3'));var Mustache=require(_0xa15d('0x4'));var util=require(_0xa15d('0x5'));var path=require(_0xa15d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa15d('0x7'));var _=require('lodash');var squel=require(_0xa15d('0x8'));var crypto=require(_0xa15d('0x9'));var jsforce=require(_0xa15d('0xa'));var deskjs=require(_0xa15d('0xb'));var toCsv=require(_0xa15d('0xc'));var querystring=require(_0xa15d('0xd'));var Papa=require('papaparse');var Redis=require(_0xa15d('0xe'));var authService=require(_0xa15d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa15d('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa15d('0x11'));var db=require('../../mysqldb')['db'];config[_0xa15d('0x12')]=_['defaults'](config['redis'],{'host':_0xa15d('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa15d('0x12')]));require(_0xa15d('0x14'))[_0xa15d('0x15')](socket);function respondWithStatusCode(_0x17f2b5,_0x1c7441){_0x1c7441=_0x1c7441||0xcc;return function(_0x4f6b8b){if(_0x4f6b8b){return _0x17f2b5[_0xa15d('0x16')](_0x1c7441);}return _0x17f2b5['status'](_0x1c7441)[_0xa15d('0x17')]();};}function respondWithResult(_0x226305,_0x141683){_0x141683=_0x141683||0xc8;return function(_0x6a4655){if(_0x6a4655){return _0x226305[_0xa15d('0x18')](_0x141683)['json'](_0x6a4655);}};}function respondWithFilteredResult(_0x22e36a,_0x40b216){return function(_0x566766){if(_0x566766){var _0x5296bd=typeof _0x40b216['offset']===_0xa15d('0x19')&&typeof _0x40b216['limit']===_0xa15d('0x19');var _0x531f48=_0x566766[_0xa15d('0x1a')];var _0xa0f17d=_0x5296bd?0x0:_0x40b216['offset'];var _0x1c0db9=_0x5296bd?_0x566766['count']:_0x40b216[_0xa15d('0x1b')]+_0x40b216[_0xa15d('0x1c')];var _0x46a368;if(_0x1c0db9>=_0x531f48){_0x1c0db9=_0x531f48;_0x46a368=0xc8;}else{_0x46a368=0xce;}_0x22e36a[_0xa15d('0x18')](_0x46a368);return _0x22e36a[_0xa15d('0x1d')](_0xa15d('0x1e'),_0xa0f17d+'-'+_0x1c0db9+'/'+_0x531f48)[_0xa15d('0x1f')](_0x566766);}return null;};}function patchUpdates(_0xbd7783){return function(_0x36c72d){try{jsonpatch[_0xa15d('0x20')](_0x36c72d,_0xbd7783,!![]);}catch(_0x28fc0f){return BPromise[_0xa15d('0x21')](_0x28fc0f);}return _0x36c72d[_0xa15d('0x22')]();};}function saveUpdates(_0x2a521a,_0xcc7310){return function(_0x83d94e){if(_0x83d94e){return _0x83d94e[_0xa15d('0x23')](_0x2a521a)[_0xa15d('0x24')](function(_0x1fbbe8){return _0x1fbbe8;});}return null;};}function removeEntity(_0x4a2131,_0x4dff68){return function(_0x2b604e){if(_0x2b604e){return _0x2b604e[_0xa15d('0x25')]()[_0xa15d('0x24')](function(){_0x4a2131[_0xa15d('0x18')](0xcc)[_0xa15d('0x17')]();});}};}function handleEntityNotFound(_0x536d9a,_0x5da9ae){return function(_0x453be7){if(!_0x453be7){_0x536d9a[_0xa15d('0x16')](0x194);}return _0x453be7;};}function handleError(_0x119b51,_0x38b532){_0x38b532=_0x38b532||0x1f4;return function(_0x20edc6){logger[_0xa15d('0x26')](_0x20edc6[_0xa15d('0x27')]);if(_0x20edc6[_0xa15d('0x28')]){delete _0x20edc6[_0xa15d('0x28')];}_0x119b51['status'](_0x38b532)[_0xa15d('0x29')](_0x20edc6);};}exports[_0xa15d('0x2a')]=function(_0x8da602,_0x30a2d9){var _0x20d499={},_0x555f92={},_0x1049e4={'count':0x0,'rows':[]};var _0x38ed60=_['map'](db[_0xa15d('0x2b')]['rawAttributes'],function(_0x56b529){return{'name':_0x56b529[_0xa15d('0x2c')],'type':_0x56b529[_0xa15d('0x2d')][_0xa15d('0x2e')]};});_0x555f92['model']=_[_0xa15d('0x2f')](_0x38ed60,_0xa15d('0x28'));_0x555f92[_0xa15d('0x30')]=_[_0xa15d('0x31')](_0x8da602[_0xa15d('0x30')]);_0x555f92[_0xa15d('0x32')]=_[_0xa15d('0x33')](_0x555f92['model'],_0x555f92['query']);_0x20d499[_0xa15d('0x34')]=_[_0xa15d('0x33')](_0x555f92[_0xa15d('0x35')],qs[_0xa15d('0x36')](_0x8da602['query']['fields']));_0x20d499['attributes']=_0x20d499[_0xa15d('0x34')]['length']?_0x20d499[_0xa15d('0x34')]:_0x555f92[_0xa15d('0x35')];if(!_0x8da602[_0xa15d('0x30')]['hasOwnProperty'](_0xa15d('0x37'))){_0x20d499[_0xa15d('0x1c')]=qs[_0xa15d('0x1c')](_0x8da602[_0xa15d('0x30')][_0xa15d('0x1c')]);_0x20d499[_0xa15d('0x1b')]=qs[_0xa15d('0x1b')](_0x8da602['query'][_0xa15d('0x1b')]);}_0x20d499[_0xa15d('0x38')]=qs[_0xa15d('0x39')](_0x8da602[_0xa15d('0x30')]['sort']);_0x20d499[_0xa15d('0x3a')]=qs[_0xa15d('0x32')](_['pick'](_0x8da602[_0xa15d('0x30')],_0x555f92[_0xa15d('0x32')]),_0x38ed60);if(_0x8da602[_0xa15d('0x30')][_0xa15d('0x3b')]){_0x20d499[_0xa15d('0x3a')]=_[_0xa15d('0x3c')](_0x20d499[_0xa15d('0x3a')],{'$or':_[_0xa15d('0x2f')](_0x38ed60,function(_0x5c3686){if(_0x5c3686[_0xa15d('0x2d')]!==_0xa15d('0x3d')){var _0x5a6671={};_0x5a6671[_0x5c3686[_0xa15d('0x28')]]={'$like':'%'+_0x8da602[_0xa15d('0x30')][_0xa15d('0x3b')]+'%'};return _0x5a6671;}})});}_0x20d499=_['merge']({},_0x20d499,_0x8da602[_0xa15d('0x3e')]);var _0x4bd56c={'where':_0x20d499[_0xa15d('0x3a')]};return db[_0xa15d('0x2b')][_0xa15d('0x1a')](_0x4bd56c)[_0xa15d('0x24')](function(_0x4b3956){_0x1049e4[_0xa15d('0x1a')]=_0x4b3956;if(_0x8da602[_0xa15d('0x30')]['includeAll']){_0x20d499[_0xa15d('0x3f')]=[{'all':!![]}];}return db[_0xa15d('0x2b')]['findAll'](_0x20d499);})[_0xa15d('0x24')](function(_0x9cf75){_0x1049e4['rows']=_0x9cf75;return _0x1049e4;})[_0xa15d('0x24')](respondWithFilteredResult(_0x30a2d9,_0x20d499))[_0xa15d('0x40')](handleError(_0x30a2d9,null));};exports[_0xa15d('0x41')]=function(_0x3e3575,_0x116586){var _0x41b4d1={'raw':!![],'where':{'id':_0x3e3575[_0xa15d('0x42')]['id']}},_0x7ab180={};_0x7ab180[_0xa15d('0x35')]=_[_0xa15d('0x31')](db[_0xa15d('0x2b')][_0xa15d('0x43')]);_0x7ab180[_0xa15d('0x30')]=_['keys'](_0x3e3575['query']);_0x7ab180[_0xa15d('0x32')]=_[_0xa15d('0x33')](_0x7ab180[_0xa15d('0x35')],_0x7ab180[_0xa15d('0x30')]);_0x41b4d1[_0xa15d('0x34')]=_[_0xa15d('0x33')](_0x7ab180[_0xa15d('0x35')],qs['fields'](_0x3e3575[_0xa15d('0x30')][_0xa15d('0x36')]));_0x41b4d1[_0xa15d('0x34')]=_0x41b4d1[_0xa15d('0x34')][_0xa15d('0x44')]?_0x41b4d1[_0xa15d('0x34')]:_0x7ab180[_0xa15d('0x35')];if(_0x3e3575[_0xa15d('0x30')][_0xa15d('0x45')]){_0x41b4d1[_0xa15d('0x3f')]=[{'all':!![]}];}_0x41b4d1=_[_0xa15d('0x3c')]({},_0x41b4d1,_0x3e3575[_0xa15d('0x3e')]);return db[_0xa15d('0x2b')][_0xa15d('0x46')](_0x41b4d1)[_0xa15d('0x24')](handleEntityNotFound(_0x116586,null))[_0xa15d('0x24')](respondWithResult(_0x116586,null))[_0xa15d('0x40')](handleError(_0x116586,null));};exports[_0xa15d('0x47')]=function(_0x4d27e7,_0x2f2ddc){return db['ChatGroup'][_0xa15d('0x47')](_0x4d27e7['body'],{})[_0xa15d('0x24')](respondWithResult(_0x2f2ddc,0xc9))[_0xa15d('0x40')](handleError(_0x2f2ddc,null));};exports[_0xa15d('0x23')]=function(_0x5db0cd,_0xc3942){if(_0x5db0cd[_0xa15d('0x48')]['id']){delete _0x5db0cd[_0xa15d('0x48')]['id'];}return db[_0xa15d('0x2b')][_0xa15d('0x46')]({'where':{'id':_0x5db0cd[_0xa15d('0x42')]['id']}})[_0xa15d('0x24')](handleEntityNotFound(_0xc3942,null))[_0xa15d('0x24')](saveUpdates(_0x5db0cd[_0xa15d('0x48')],null))[_0xa15d('0x24')](respondWithResult(_0xc3942,null))[_0xa15d('0x40')](handleError(_0xc3942,null));};exports[_0xa15d('0x25')]=function(_0x1221d5,_0x5855a1){return db[_0xa15d('0x2b')][_0xa15d('0x46')]({'where':{'id':_0x1221d5['params']['id']}})['then'](handleEntityNotFound(_0x5855a1,null))['then'](removeEntity(_0x5855a1,null))[_0xa15d('0x40')](handleError(_0x5855a1,null));};exports[_0xa15d('0x49')]=function(_0x2a171c,_0x3559fa){return db[_0xa15d('0x2b')][_0xa15d('0x49')]()['then'](respondWithResult(_0x3559fa,null))[_0xa15d('0x40')](handleError(_0x3559fa,null));};exports[_0xa15d('0x4a')]=function(_0x31601f,_0x2c3d04,_0x2e08ef){return db['ChatInternalMessage'][_0xa15d('0x1a')]({'where':{'ChatGroupId':_0x31601f[_0xa15d('0x42')]['id'],'ToId':_0x31601f['user']['id'],'read':![]}})['then'](function(_0x239a92){return{'id':_[_0xa15d('0x4b')](_0x31601f['params']['id']),'count':_0x239a92};})[_0xa15d('0x24')](respondWithResult(_0x2c3d04,null))[_0xa15d('0x40')](handleError(_0x2c3d04,null));};exports['addMembers']=function(_0x4241fa,_0x5cf562,_0x445115){return db[_0xa15d('0x2b')]['find']({'where':{'id':_0x4241fa[_0xa15d('0x42')]['id']}})[_0xa15d('0x24')](handleEntityNotFound(_0x5cf562,null))[_0xa15d('0x24')](function(_0xfb39bc){if(_0xfb39bc){return _0xfb39bc['addMembers'](_0x4241fa[_0xa15d('0x48')][_0xa15d('0x4c')],_[_0xa15d('0x4d')](_0x4241fa[_0xa15d('0x48')],[_0xa15d('0x4c'),'id'])||{});}})[_0xa15d('0x24')](respondWithResult(_0x5cf562,null))[_0xa15d('0x40')](handleError(_0x5cf562,null));};exports[_0xa15d('0x4e')]=function(_0x25c2be,_0x5e7c0b,_0x18cb5c){var _0x43a1a3={};var _0x1f341e={};var _0x270539;var _0x179c35;return db[_0xa15d('0x2b')][_0xa15d('0x4f')]({'where':{'id':_0x25c2be[_0xa15d('0x42')]['id']}})[_0xa15d('0x24')](handleEntityNotFound(_0x5e7c0b,null))[_0xa15d('0x24')](function(_0x4bf4cc){if(_0x4bf4cc){_0x270539=_0x4bf4cc;_0x1f341e[_0xa15d('0x35')]=_['keys'](db[_0xa15d('0x50')][_0xa15d('0x43')]);_0x1f341e[_0xa15d('0x30')]=_[_0xa15d('0x31')](_0x25c2be[_0xa15d('0x30')]);_0x1f341e['filters']=_['intersection'](_0x1f341e[_0xa15d('0x35')],_0x1f341e[_0xa15d('0x30')]);_0x43a1a3[_0xa15d('0x34')]=_[_0xa15d('0x33')](_0x1f341e['model'],qs[_0xa15d('0x36')](_0x25c2be[_0xa15d('0x30')]['fields']));_0x43a1a3['attributes']=_0x43a1a3[_0xa15d('0x34')][_0xa15d('0x44')]?_0x43a1a3[_0xa15d('0x34')]:_0x1f341e[_0xa15d('0x35')];_0x43a1a3[_0xa15d('0x38')]=qs[_0xa15d('0x39')](_0x25c2be[_0xa15d('0x30')]['sort']);_0x43a1a3['where']=qs[_0xa15d('0x32')](_[_0xa15d('0x51')](_0x25c2be[_0xa15d('0x30')],_0x1f341e[_0xa15d('0x32')]));if(_0x25c2be['query']['filter']){_0x43a1a3[_0xa15d('0x3a')]=_[_0xa15d('0x3c')](_0x43a1a3['where'],{'$or':_['map'](_0x43a1a3['attributes'],function(_0x5cd0c9){var _0x3b8dbe={};_0x3b8dbe[_0x5cd0c9]={'$like':'%'+_0x25c2be[_0xa15d('0x30')][_0xa15d('0x3b')]+'%'};return _0x3b8dbe;})});}_0x43a1a3=_[_0xa15d('0x3c')]({},_0x43a1a3,_0x25c2be[_0xa15d('0x3e')]);return _0x270539[_0xa15d('0x4e')](_0x43a1a3);}})['then'](function(_0x260491){if(_0x260491){_0x179c35=_0x260491[_0xa15d('0x44')];if(!_0x25c2be[_0xa15d('0x30')]['hasOwnProperty'](_0xa15d('0x37'))){_0x43a1a3['limit']=qs[_0xa15d('0x1c')](_0x25c2be[_0xa15d('0x30')][_0xa15d('0x1c')]);_0x43a1a3[_0xa15d('0x1b')]=qs[_0xa15d('0x1b')](_0x25c2be['query']['offset']);}return _0x270539[_0xa15d('0x4e')](_0x43a1a3);}})[_0xa15d('0x24')](function(_0x2b997d){if(_0x2b997d){return _0x2b997d?{'count':_0x179c35,'rows':_0x2b997d}:null;}})[_0xa15d('0x24')](respondWithResult(_0x5e7c0b,null))['catch'](handleError(_0x5e7c0b,null));};exports[_0xa15d('0x52')]=function(_0x4f46ae,_0x2d7e9c,_0x28a033){return db['ChatGroup']['find']({'where':{'id':_0x4f46ae[_0xa15d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d7e9c,null))[_0xa15d('0x24')](function(_0x2e16f9){if(_0x2e16f9){return _0x2e16f9['removeMembers'](_0x4f46ae['query'][_0xa15d('0x4c')]);}})['then'](respondWithStatusCode(_0x2d7e9c,null))[_0xa15d('0x40')](handleError(_0x2d7e9c,null));};exports['addMessage']=function(_0x2cef8c,_0x11f11a,_0x230e6f){if(_0x2cef8c['body']['id']){delete _0x2cef8c[_0xa15d('0x48')]['id'];}return db[_0xa15d('0x2b')][_0xa15d('0x46')]({'where':{'id':_0x2cef8c[_0xa15d('0x42')]['id']}})[_0xa15d('0x24')](handleEntityNotFound(_0x11f11a,null))['then'](function(_0x2cc569){if(_0x2cc569){_0x2cef8c['body'][_0xa15d('0x53')]=_0x2cc569['id'];return db['ChatInternalMessage'][_0xa15d('0x47')](_0x2cef8c['body']);}})[_0xa15d('0x24')](respondWithResult(_0x11f11a,null))[_0xa15d('0x40')](handleError(_0x11f11a,null));};exports[_0xa15d('0x54')]=function(_0x5e505d,_0x900ed,_0x5e4703){var _0x5c793a={};var _0x3eae44={};var _0xafd9f;var _0x3ef9c4;return db[_0xa15d('0x2b')]['findOne']({'where':{'id':_0x5e505d[_0xa15d('0x42')]['id']}})[_0xa15d('0x24')](handleEntityNotFound(_0x900ed,null))[_0xa15d('0x24')](function(_0x2c75fa){if(_0x2c75fa){_0xafd9f=_0x2c75fa;_0x3eae44[_0xa15d('0x35')]=_[_0xa15d('0x31')](db[_0xa15d('0x55')]['rawAttributes']);_0x3eae44[_0xa15d('0x30')]=_['keys'](_0x5e505d['query']);_0x3eae44[_0xa15d('0x32')]=_[_0xa15d('0x33')](_0x3eae44[_0xa15d('0x35')],_0x3eae44['query']);_0x5c793a[_0xa15d('0x34')]=_[_0xa15d('0x33')](_0x3eae44[_0xa15d('0x35')],qs[_0xa15d('0x36')](_0x5e505d[_0xa15d('0x30')]['fields']));_0x5c793a[_0xa15d('0x34')]=_0x5c793a['attributes'][_0xa15d('0x44')]?_0x5c793a[_0xa15d('0x34')]:_0x3eae44[_0xa15d('0x35')];_0x5c793a['order']=qs['sort'](_0x5e505d['query'][_0xa15d('0x39')]);_0x5c793a[_0xa15d('0x3a')]=qs[_0xa15d('0x32')](_['pick'](_0x5e505d[_0xa15d('0x30')],_0x3eae44['filters']));if(_0x5e505d[_0xa15d('0x30')][_0xa15d('0x3b')]){_0x5c793a[_0xa15d('0x3a')]=_[_0xa15d('0x3c')](_0x5c793a[_0xa15d('0x3a')],{'$or':_['map'](_0x5c793a['attributes'],function(_0xe3ea8b){var _0x37e599={};_0x37e599[_0xe3ea8b]={'$like':'%'+_0x5e505d[_0xa15d('0x30')]['filter']+'%'};return _0x37e599;})});}if(_0x5e505d[_0xa15d('0x30')][_0xa15d('0x56')]){var _0x50ad33=_0x5e505d[_0xa15d('0x30')][_0xa15d('0x56')]['split'](',');var _0x279bc0={};_0x279bc0[_0x50ad33[0x0]]={'$gte':moment(_0x50ad33[0x1])[_0xa15d('0x57')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5c793a[_0xa15d('0x3a')]=_['merge'](_0x5c793a[_0xa15d('0x3a')],_0x279bc0);}_0x5c793a=_[_0xa15d('0x3c')]({},_0x5c793a,_0x5e505d[_0xa15d('0x3e')]);return _0xafd9f[_0xa15d('0x54')](_0x5c793a);}})[_0xa15d('0x24')](function(_0x407090){if(_0x407090){_0x3ef9c4=_0x407090['length'];if(!_0x5e505d['query'][_0xa15d('0x58')](_0xa15d('0x37'))){_0x5c793a[_0xa15d('0x1c')]=qs[_0xa15d('0x1c')](_0x5e505d[_0xa15d('0x30')][_0xa15d('0x1c')]);_0x5c793a[_0xa15d('0x1b')]=qs['offset'](_0x5e505d[_0xa15d('0x30')][_0xa15d('0x1b')]);}return _0xafd9f['getMessages'](_0x5c793a);}})[_0xa15d('0x24')](function(_0x38e4ae){if(_0x38e4ae){return _0x38e4ae?{'count':_0x3ef9c4,'rows':_0x38e4ae}:null;}})['then'](respondWithResult(_0x900ed,null))[_0xa15d('0x40')](handleError(_0x900ed,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 536d71f..b7629bf 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 _0x5df5=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x13ed10,_0x13479a){var _0x3e48e1=function(_0x295a51){while(--_0x295a51){_0x13ed10['push'](_0x13ed10['shift']());}};_0x3e48e1(++_0x13479a);}(_0x5df5,0x70));var _0x55df=function(_0x218cd3,_0x3e063d){_0x218cd3=_0x218cd3-0x0;var _0x25b2e1=_0x5df5[_0x218cd3];return _0x25b2e1;};'use strict';var EventEmitter=require(_0x55df('0x0'));var ChatGroup=require(_0x55df('0x1'))['db'][_0x55df('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x55df('0x3')](0x0);var events={'afterCreate':_0x55df('0x4'),'afterUpdate':_0x55df('0x5'),'afterDestroy':_0x55df('0x6')};function emitEvent(_0x2cd710){return function(_0x46c8eb,_0xd368b0,_0x21464e){ChatGroupEvents[_0x55df('0x7')](_0x2cd710+':'+_0x46c8eb['id'],_0x46c8eb);ChatGroupEvents[_0x55df('0x7')](_0x2cd710,_0x46c8eb);_0x21464e(null);};}for(var e in events){if(events[_0x55df('0x8')](e)){var event=events[e];ChatGroup[_0x55df('0x9')](e,emitEvent(event));}}module[_0x55df('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0x36e0=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x54569d,_0xc709cb){var _0x9c892=function(_0x320d25){while(--_0x320d25){_0x54569d['push'](_0x54569d['shift']());}};_0x9c892(++_0xc709cb);}(_0x36e0,0x15c));var _0x036e=function(_0x27f790,_0xe1a3f5){_0x27f790=_0x27f790-0x0;var _0x3e7235=_0x36e0[_0x27f790];return _0x3e7235;};'use strict';var EventEmitter=require(_0x036e('0x0'));var ChatGroup=require(_0x036e('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x036e('0x2')](0x0);var events={'afterCreate':_0x036e('0x3'),'afterUpdate':_0x036e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ef73c){return function(_0x400837,_0x4f9d06,_0xac7036){ChatGroupEvents[_0x036e('0x5')](_0x2ef73c+':'+_0x400837['id'],_0x400837);ChatGroupEvents[_0x036e('0x5')](_0x2ef73c,_0x400837);_0xac7036(null);};}for(var e in events){if(events[_0x036e('0x6')](e)){var event=events[e];ChatGroup[_0x036e('0x7')](e,emitEvent(event));}}module[_0x036e('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 08de110..c407629 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 _0x9b22=['request-promise','path','rimraf','exports','define','ChatGroup','lodash','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b22,0x182));var _0x29b2=function(_0x201e97,_0x1d8738){_0x201e97=_0x201e97-0x0;var _0x1eaf6e=_0x9b22[_0x201e97];return _0x1eaf6e;};'use strict';var _=require(_0x29b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29b2('0x1'));var moment=require(_0x29b2('0x2'));var BPromise=require(_0x29b2('0x3'));var rp=require(_0x29b2('0x4'));var fs=require('fs');var path=require(_0x29b2('0x5'));var rimraf=require(_0x29b2('0x6'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x29b2('0x7')]=function(_0xef94bc,_0x36c39c){return _0xef94bc[_0x29b2('0x8')](_0x29b2('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c90=['define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes'];(function(_0x47fd21,_0x15f0d1){var _0x4f29fc=function(_0x109eb4){while(--_0x109eb4){_0x47fd21['push'](_0x47fd21['shift']());}};_0x4f29fc(++_0x15f0d1);}(_0x4c90,0x12f));var _0x04c9=function(_0x46ed96,_0x5aa51a){_0x46ed96=_0x46ed96-0x0;var _0x295099=_0x4c90[_0x46ed96];return _0x295099;};'use strict';var _=require('lodash');var util=require(_0x04c9('0x0'));var logger=require(_0x04c9('0x1'))(_0x04c9('0x2'));var moment=require(_0x04c9('0x3'));var BPromise=require(_0x04c9('0x4'));var rp=require(_0x04c9('0x5'));var fs=require('fs');var path=require(_0x04c9('0x6'));var rimraf=require('rimraf');var config=require(_0x04c9('0x7'));var attributes=require(_0x04c9('0x8'));module['exports']=function(_0x49d81e,_0x37b661){return _0x49d81e[_0x04c9('0x9')](_0x04c9('0xa'),attributes,{'tableName':_0x04c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index d200352..a4b1c13 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 _0x4b68=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b68,0x129));var _0x84b6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4b68[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var moment=require(_0x84b6('0x2'));var BPromise=require(_0x84b6('0x3'));var rs=require(_0x84b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84b6('0x5'))['db'];var utils=require(_0x84b6('0x6'));var logger=require(_0x84b6('0x7'))(_0x84b6('0x8'));var config=require('../../config/environment');var jayson=require(_0x84b6('0x9'));var client=jayson[_0x84b6('0xa')]['http']({'port':0x232a});config[_0x84b6('0xb')]=_['defaults'](config[_0x84b6('0xb')],{'host':_0x84b6('0xc'),'port':0x18eb});var socket=require(_0x84b6('0xd'))(new Redis(config[_0x84b6('0xb')]));require(_0x84b6('0xe'))[_0x84b6('0xf')](socket);function respondWithRpcPromise(_0x5e93e9,_0x14591b,_0x446432){return new BPromise(function(_0x401671,_0x29066f){return client[_0x84b6('0x10')](_0x5e93e9,_0x446432)['then'](function(_0x2c26ee){logger[_0x84b6('0x11')](_0x84b6('0x12'),_0x14591b,'request\x20sent');logger[_0x84b6('0x13')](_0x84b6('0x14'),_0x14591b,_0x84b6('0x15'),JSON[_0x84b6('0x16')](_0x2c26ee));if(_0x2c26ee[_0x84b6('0x17')]){if(_0x2c26ee[_0x84b6('0x17')]['code']===0x1f4){logger[_0x84b6('0x17')](_0x84b6('0x12'),_0x14591b,_0x2c26ee['error']['message']);return _0x29066f(_0x2c26ee[_0x84b6('0x17')][_0x84b6('0x18')]);}logger[_0x84b6('0x17')]('ChatGroup,\x20%s,\x20%s',_0x14591b,_0x2c26ee['error'][_0x84b6('0x18')]);return _0x401671(_0x2c26ee[_0x84b6('0x17')][_0x84b6('0x18')]);}else{logger[_0x84b6('0x11')]('ChatGroup,\x20%s,\x20%s',_0x14591b,'request\x20sent');_0x401671(_0x2c26ee[_0x84b6('0x19')][_0x84b6('0x18')]);}})[_0x84b6('0x1a')](function(_0x37a6d9){logger['error'](_0x84b6('0x12'),_0x14591b,_0x37a6d9);_0x29066f(_0x37a6d9);});});} \ No newline at end of file +var _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x3ee3c4,_0x4e05ef){var _0x4cb093=function(_0x1dd335){while(--_0x1dd335){_0x3ee3c4['push'](_0x3ee3c4['shift']());}};_0x4cb093(++_0x4e05ef);}(_0x851c,0x19d));var _0xc851=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x851c[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1b9615f..6627bbd 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 _0x1207=['chatGroup:','save','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1207,0x73));var _0x7120=function(_0x162cb8,_0x39fa6d){_0x162cb8=_0x162cb8-0x0;var _0x205644=_0x1207[_0x162cb8];return _0x205644;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x7120('0x0'),'remove',_0x7120('0x1')];function createListener(_0x10c0d4,_0x2ca7b3){return function(_0x92ce94){_0x2ca7b3[_0x7120('0x2')](_0x10c0d4,_0x92ce94);};}function removeListener(_0x5094eb,_0x33f604){return function(){ChatGroupEvents[_0x7120('0x3')](_0x5094eb,_0x33f604);};}exports[_0x7120('0x4')]=function(_0x2d5a7e){for(var _0xa1f1ba=0x0,_0x1faa2f=events['length'];_0xa1f1ba<_0x1faa2f;_0xa1f1ba++){var _0x2469fc=events[_0xa1f1ba];var _0x54177f=createListener(_0x7120('0x5')+_0x2469fc,_0x2d5a7e);ChatGroupEvents['on'](_0x2469fc,_0x54177f);}}; \ No newline at end of file +var _0x0584=['chatGroup:','remove','update','emit','removeListener','register'];(function(_0x5b18a0,_0x42f1ba){var _0x2297e1=function(_0x5d402d){while(--_0x5d402d){_0x5b18a0['push'](_0x5b18a0['shift']());}};_0x2297e1(++_0x42f1ba);}(_0x0584,0xd3));var _0x4058=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0584[_0x19e35c];return _0x3e1fe8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x4058('0x0'),_0x4058('0x1')];function createListener(_0x2dcf70,_0x596b87){return function(_0x3cb33d){_0x596b87[_0x4058('0x2')](_0x2dcf70,_0x3cb33d);};}function removeListener(_0x2d075a,_0x3e6b6c){return function(){ChatGroupEvents[_0x4058('0x3')](_0x2d075a,_0x3e6b6c);};}exports[_0x4058('0x4')]=function(_0x247374){for(var _0x41c11e=0x0,_0xfb710d=events['length'];_0x41c11e<_0xfb710d;_0x41c11e++){var _0x230938=events[_0x41c11e];var _0x3819c6=createListener(_0x4058('0x5')+_0x230938,_0x247374);ChatGroupEvents['on'](_0x230938,_0x3819c6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 59b2673..abca55f 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 _0x46ce=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','put','delete','destroy','removeMembers','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x352c13,_0x1a91cb){var _0x5b48e8=function(_0x1afcc2){while(--_0x1afcc2){_0x352c13['push'](_0x352c13['shift']());}};_0x5b48e8(++_0x1a91cb);}(_0x46ce,0x121));var _0xe46c=function(_0x2096e1,_0x58c7aa){_0x2096e1=_0x2096e1-0x0;var _0x40e7c1=_0x46ce[_0x2096e1];return _0x40e7c1;};'use strict';var multer=require(_0xe46c('0x0'));var util=require('util');var path=require(_0xe46c('0x1'));var timeout=require(_0xe46c('0x2'));var express=require(_0xe46c('0x3'));var router=express[_0xe46c('0x4')]();var fs_extra=require(_0xe46c('0x5'));var auth=require(_0xe46c('0x6'));var interaction=require(_0xe46c('0x7'));var config=require(_0xe46c('0x8'));var controller=require('./chatGroup.controller');router[_0xe46c('0x9')]('/',auth[_0xe46c('0xa')](),controller[_0xe46c('0xb')]);router[_0xe46c('0x9')](_0xe46c('0xc'),auth[_0xe46c('0xa')](),controller['describe']);router[_0xe46c('0x9')](_0xe46c('0xd'),auth[_0xe46c('0xa')](),controller[_0xe46c('0xe')]);router['get']('/:id/unread',auth[_0xe46c('0xa')](),controller[_0xe46c('0xf')]);router[_0xe46c('0x9')]('/:id/members',auth[_0xe46c('0xa')](),controller[_0xe46c('0x10')]);router[_0xe46c('0x9')]('/:id/messages',auth[_0xe46c('0xa')](),controller[_0xe46c('0x11')]);router[_0xe46c('0x12')]('/',auth[_0xe46c('0xa')](),controller[_0xe46c('0x13')]);router[_0xe46c('0x12')](_0xe46c('0x14'),auth[_0xe46c('0xa')](),controller[_0xe46c('0x15')]);router['post'](_0xe46c('0x16'),auth['isAuthenticated'](),controller['addMessage']);router[_0xe46c('0x17')](_0xe46c('0xd'),auth[_0xe46c('0xa')](),controller['update']);router[_0xe46c('0x18')]('/:id',auth[_0xe46c('0xa')](),controller[_0xe46c('0x19')]);router['delete']('/:id/members',auth[_0xe46c('0xa')](),controller[_0xe46c('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x3fc6=['/describe','describe','/:id','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x3a7368,_0x185789){var _0x1aa883=function(_0x41b7b6){while(--_0x41b7b6){_0x3a7368['push'](_0x3a7368['shift']());}};_0x1aa883(++_0x185789);}(_0x3fc6,0x195));var _0x63fc=function(_0x125469,_0x45fdd5){_0x125469=_0x125469-0x0;var _0x30732a=_0x3fc6[_0x125469];return _0x30732a;};'use strict';var multer=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var path=require(_0x63fc('0x2'));var timeout=require(_0x63fc('0x3'));var express=require(_0x63fc('0x4'));var router=express[_0x63fc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x63fc('0x6'));var interaction=require(_0x63fc('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x63fc('0x8')](),controller[_0x63fc('0x9')]);router[_0x63fc('0xa')](_0x63fc('0xb'),auth[_0x63fc('0x8')](),controller[_0x63fc('0xc')]);router[_0x63fc('0xa')](_0x63fc('0xd'),auth[_0x63fc('0x8')](),controller['show']);router[_0x63fc('0xa')]('/:id/unread',auth[_0x63fc('0x8')](),controller[_0x63fc('0xe')]);router['get'](_0x63fc('0xf'),auth['isAuthenticated'](),controller[_0x63fc('0x10')]);router[_0x63fc('0xa')](_0x63fc('0x11'),auth[_0x63fc('0x8')](),controller['getMessages']);router[_0x63fc('0x12')]('/',auth[_0x63fc('0x8')](),controller[_0x63fc('0x13')]);router['post'](_0x63fc('0xf'),auth[_0x63fc('0x8')](),controller[_0x63fc('0x14')]);router[_0x63fc('0x12')](_0x63fc('0x11'),auth['isAuthenticated'](),controller[_0x63fc('0x15')]);router[_0x63fc('0x16')](_0x63fc('0xd'),auth[_0x63fc('0x8')](),controller['update']);router[_0x63fc('0x17')](_0x63fc('0xd'),auth[_0x63fc('0x8')](),controller[_0x63fc('0x18')]);router[_0x63fc('0x17')](_0x63fc('0xf'),auth[_0x63fc('0x8')](),controller[_0x63fc('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index de9cccc..586d4cd 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 _0x9703=['STRING','DATE','out','BOOLEAN','INTEGER','ENUM','thumb','TEXT'];(function(_0x379e0c,_0x51b0ca){var _0x26f81d=function(_0x151bf9){while(--_0x151bf9){_0x379e0c['push'](_0x379e0c['shift']());}};_0x26f81d(++_0x51b0ca);}(_0x9703,0xdb));var _0x3970=function(_0x4d1d3b,_0x358031){_0x4d1d3b=_0x4d1d3b-0x0;var _0x473905=_0x9703[_0x4d1d3b];return _0x473905;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3970('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3970('0x1')]},'ratingType':{'type':Sequelize[_0x3970('0x2')]('star',_0x3970('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x3970('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3970('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3970('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3970('0x5')]},'note':{'type':Sequelize[_0x3970('0x5')]},'browserName':{'type':Sequelize[_0x3970('0x5')]},'browserVersion':{'type':Sequelize[_0x3970('0x5')]},'osName':{'type':Sequelize[_0x3970('0x5')]},'osVersion':{'type':Sequelize[_0x3970('0x5')]},'deviceModel':{'type':Sequelize[_0x3970('0x5')]},'deviceVendor':{'type':Sequelize[_0x3970('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3970('0x4')]},'customerIp':{'type':Sequelize[_0x3970('0x5')]},'formData':{'type':Sequelize[_0x3970('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x3970('0x6')]},'lastMsgAt':{'type':Sequelize[_0x3970('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3970('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3970('0x5')]},'customerPort':{'type':Sequelize[_0x3970('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x3970('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0102=['TEXT','long','out','exports','BOOLEAN','INTEGER','ENUM','STRING','DATE'];(function(_0x261cda,_0x450fc4){var _0x41da28=function(_0x1c4482){while(--_0x1c4482){_0x261cda['push'](_0x261cda['shift']());}};_0x41da28(++_0x450fc4);}(_0x0102,0x186));var _0x2010=function(_0x5a5400,_0x46b277){_0x5a5400=_0x5a5400-0x0;var _0x41c94e=_0x0102[_0x5a5400];return _0x41c94e;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'closed':{'type':Sequelize[_0x2010('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2010('0x2')]},'ratingType':{'type':Sequelize[_0x2010('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2010('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2010('0x5')]},'disposition':{'type':Sequelize[_0x2010('0x4')]},'secondDisposition':{'type':Sequelize[_0x2010('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2010('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2010('0x4')]},'osName':{'type':Sequelize[_0x2010('0x4')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x2010('0x4')]},'deviceVendor':{'type':Sequelize[_0x2010('0x4')]},'deviceType':{'type':Sequelize[_0x2010('0x4')]},'referer':{'type':Sequelize[_0x2010('0x6')]},'customerIp':{'type':Sequelize[_0x2010('0x4')]},'formData':{'type':Sequelize[_0x2010('0x6')](_0x2010('0x7'))},'read1stAt':{'type':Sequelize[_0x2010('0x5')]},'lastMsgAt':{'type':Sequelize[_0x2010('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2010('0x3')]('in',_0x2010('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2010('0x4')]},'customerPort':{'type':Sequelize[_0x2010('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x2010('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x2010('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 35e3ad2..6a4d15a 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 _0x1004=['existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','offset','undefined','limit','count','Content-Range','json','destroy','stack','name','send','merge','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','findAll','query','user','show','params','model','ChatInteraction','filters','intersection','fields','attributes','length','includeAll','include','find','create','update','body','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','isNull','parse','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ValidationError','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','keys','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','nolimit','includeAgent','push','alias','addTags','setTags','Tag','color','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','read','Owner','get','mkdirSync','referer','customerIp','customerPort','N.A.','tail'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x1004,0x1a4));var _0x4100=function(_0xd52024,_0x1117ad){_0xd52024=_0xd52024-0x0;var _0x1ec574=_0x1004[_0xd52024];return _0x1ec574;};'use strict';var rimraf=require(_0x4100('0x0'));var zipdir=require(_0x4100('0x1'));var rp=require(_0x4100('0x2'));var moment=require(_0x4100('0x3'));var BPromise=require(_0x4100('0x4'));var Mustache=require(_0x4100('0x5'));var util=require(_0x4100('0x6'));var path=require('path');var ejs=require(_0x4100('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4100('0x8'));var interaction=require(_0x4100('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4100('0xa'));var logger=require(_0x4100('0xb'))(_0x4100('0xc'));var config=require(_0x4100('0xd'));var db=require(_0x4100('0xe'))['db'];config[_0x4100('0xf')]=_[_0x4100('0x10')](config['redis'],{'host':_0x4100('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4100('0xf')]));require(_0x4100('0x12'))['register'](socket);var jayson=require(_0x4100('0x13'));var client=jayson[_0x4100('0x14')][_0x4100('0x15')]({'port':0x232b});var client9004=jayson[_0x4100('0x14')][_0x4100('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4df56b,_0x352b1d,_0x196268,_0x7bfe0a){return new BPromise(function(_0xb31515,_0x3c6e35){var _0x55d472=_0x7bfe0a||client;return _0x55d472['request'](_0x4df56b,_0x196268)[_0x4100('0x16')](function(_0x540fc3){logger[_0x4100('0x17')](_0x4100('0x18'),_0x352b1d,_0x4100('0x19'));logger['debug'](_0x4100('0x1a'),_0x352b1d,_0x4100('0x19'),JSON['stringify'](_0x540fc3));if(_0x540fc3['error']){if(_0x540fc3[_0x4100('0x1b')][_0x4100('0x1c')]===0x1f4){logger[_0x4100('0x1b')](_0x4100('0x18'),_0x352b1d,_0x540fc3[_0x4100('0x1b')][_0x4100('0x1d')]);return _0x3c6e35(_0x540fc3[_0x4100('0x1b')][_0x4100('0x1d')]);}logger[_0x4100('0x1b')](_0x4100('0x18'),_0x352b1d,_0x540fc3[_0x4100('0x1b')][_0x4100('0x1d')]);return _0xb31515(_0x540fc3[_0x4100('0x1b')][_0x4100('0x1d')]);}else{logger[_0x4100('0x17')](_0x4100('0x18'),_0x352b1d,_0x4100('0x19'));_0xb31515(_0x540fc3[_0x4100('0x1e')][_0x4100('0x1d')]);}})[_0x4100('0x1f')](function(_0x9dfa2){logger[_0x4100('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x352b1d,_0x9dfa2);_0x3c6e35(_0x9dfa2);});});}function respondWithStatusCode(_0xca8b21,_0x332cc6){_0x332cc6=_0x332cc6||0xcc;return function(_0x49c7ef){if(_0x49c7ef){return _0xca8b21['sendStatus'](_0x332cc6);}return _0xca8b21['status'](_0x332cc6)[_0x4100('0x20')]();};}function respondWithResult(_0x53e832,_0xab0f2b){_0xab0f2b=_0xab0f2b||0xc8;return function(_0x5ef223){if(_0x5ef223){return _0x53e832[_0x4100('0x21')](_0xab0f2b)['json'](_0x5ef223);}};}function respondWithFilteredResult(_0x542b04,_0x3bd552){return function(_0x4d4bbd){if(_0x4d4bbd){var _0x1ef4c3=typeof _0x3bd552[_0x4100('0x22')]===_0x4100('0x23')&&typeof _0x3bd552[_0x4100('0x24')]==='undefined';var _0x27e3e5=_0x4d4bbd[_0x4100('0x25')];var _0x478a6f=_0x1ef4c3?0x0:_0x3bd552[_0x4100('0x22')];var _0x16108f=_0x1ef4c3?_0x4d4bbd[_0x4100('0x25')]:_0x3bd552['offset']+_0x3bd552[_0x4100('0x24')];var _0xa26c9;if(_0x16108f>=_0x27e3e5){_0x16108f=_0x27e3e5;_0xa26c9=0xc8;}else{_0xa26c9=0xce;}_0x542b04[_0x4100('0x21')](_0xa26c9);return _0x542b04['set'](_0x4100('0x26'),_0x478a6f+'-'+_0x16108f+'/'+_0x27e3e5)[_0x4100('0x27')](_0x4d4bbd);}return null;};}function saveUpdates(_0x1be636){return function(_0x53ae81){if(_0x53ae81){return _0x53ae81['update'](_0x1be636)[_0x4100('0x16')](function(_0x1782c8){return _0x1782c8;});}return null;};}function removeEntity(_0x1d7509){return function(_0x463c2d){if(_0x463c2d){return _0x463c2d[_0x4100('0x28')]()[_0x4100('0x16')](function(){_0x1d7509[_0x4100('0x21')](0xcc)[_0x4100('0x20')]();});}};}function handleEntityNotFound(_0x147c29){return function(_0x2d9196){if(!_0x2d9196){_0x147c29['sendStatus'](0x194);}return _0x2d9196;};}function handleError(_0x303d95,_0x2b5a87){_0x2b5a87=_0x2b5a87||0x1f4;return function(_0x5a4a11){logger[_0x4100('0x1b')](_0x5a4a11[_0x4100('0x29')]);if(_0x5a4a11[_0x4100('0x2a')]){delete _0x5a4a11[_0x4100('0x2a')];}_0x303d95[_0x4100('0x21')](_0x2b5a87)[_0x4100('0x2b')](_0x5a4a11);};}function getMustacheRender(_0x4f4048,_0x5de169){return Mustache['render'](_0x4f4048,_[_0x4100('0x2c')](_0x5de169['body'],{'contact':_0x5de169[_0x4100('0x2d')],'message':_0x5de169[_0x4100('0x1d')],'agent':_0x5de169[_0x4100('0x2e')],'interaction':_0x5de169[_0x4100('0x2f')],'account':_0x5de169[_0x4100('0x30')]}))||'';}exports[_0x4100('0x31')]=function(_0xeabcb1,_0x4379b1){var _0x369470={};var _0x4e1980=_[_0x4100('0x32')](db['ChatInteraction'][_0x4100('0x33')],function(_0x3609b9){return{'name':_0x3609b9[_0x4100('0x34')],'type':_0x3609b9[_0x4100('0x35')]['key']};});_0x369470=qs['getOptions'](_0x4e1980,_0xeabcb1);return interaction[_0x4100('0x36')]('chat',_0xeabcb1[_0x4100('0x37')],_0xeabcb1[_0x4100('0x38')],_0x369470,_0x4e1980)[_0x4100('0x16')](respondWithFilteredResult(_0x4379b1,_0x369470))['catch'](handleError(_0x4379b1,null));};exports[_0x4100('0x39')]=function(_0x214276,_0x28f56a){var _0x9ef476={'raw':![],'where':{'id':_0x214276[_0x4100('0x3a')]['id']}},_0x84a00e={};_0x84a00e[_0x4100('0x3b')]=_['keys'](db[_0x4100('0x3c')][_0x4100('0x33')]);_0x84a00e[_0x4100('0x37')]=_['keys'](_0x214276[_0x4100('0x37')]);_0x84a00e[_0x4100('0x3d')]=_[_0x4100('0x3e')](_0x84a00e[_0x4100('0x3b')],_0x84a00e['query']);_0x9ef476['attributes']=_[_0x4100('0x3e')](_0x84a00e[_0x4100('0x3b')],qs[_0x4100('0x3f')](_0x214276['query'][_0x4100('0x3f')]));_0x9ef476[_0x4100('0x40')]=_0x9ef476[_0x4100('0x40')][_0x4100('0x41')]?_0x9ef476[_0x4100('0x40')]:_0x84a00e[_0x4100('0x3b')];if(_0x214276[_0x4100('0x37')][_0x4100('0x42')]){_0x9ef476[_0x4100('0x43')]=[{'all':!![]}];}_0x9ef476=_['merge']({},_0x9ef476,_0x214276['options']);return db[_0x4100('0x3c')][_0x4100('0x44')](_0x9ef476)[_0x4100('0x16')](handleEntityNotFound(_0x28f56a,null))['then'](respondWithResult(_0x28f56a,null))[_0x4100('0x1f')](handleError(_0x28f56a,null));};exports[_0x4100('0x45')]=function(_0x3e37d4,_0x59d4d6){return db[_0x4100('0x3c')][_0x4100('0x45')](_0x3e37d4['body'],{})[_0x4100('0x16')](respondWithResult(_0x59d4d6,0xc9))['catch'](handleError(_0x59d4d6,null));};exports[_0x4100('0x46')]=function(_0x13ffce,_0xdcb852){if(_0x13ffce['body']['id']){delete _0x13ffce[_0x4100('0x47')]['id'];}return db[_0x4100('0x3c')]['find']({'where':{'id':_0x13ffce[_0x4100('0x3a')]['id']}})['then'](handleEntityNotFound(_0xdcb852,null))['then'](saveUpdates(_0x13ffce[_0x4100('0x47')],null))[_0x4100('0x16')](respondWithResult(_0xdcb852,null))[_0x4100('0x1f')](handleError(_0xdcb852,null));};exports['destroy']=function(_0x3f642c,_0x4790ec){return db[_0x4100('0x3c')][_0x4100('0x44')]({'where':{'id':_0x3f642c[_0x4100('0x3a')]['id']}})[_0x4100('0x16')](handleEntityNotFound(_0x4790ec,null))[_0x4100('0x16')](removeEntity(_0x4790ec,null))['catch'](handleError(_0x4790ec,null));};exports['describe']=function(_0xd16e84,_0x2c4633){return db[_0x4100('0x3c')][_0x4100('0x48')]()[_0x4100('0x16')](respondWithResult(_0x2c4633,null))[_0x4100('0x1f')](handleError(_0x2c4633,null));};exports['createVidaooSession']=function(_0x2e6d18,_0xb77a29){var _0x147226=_0x2e6d18[_0x4100('0x3a')]['id'];var _0x1997e3;var _0x249913;var _0x1fcd62;return db[_0x4100('0x3c')][_0x4100('0x49')]({'where':{'id':_0x147226}})[_0x4100('0x16')](function(_0x256451){_0x1997e3=_0x256451;return db[_0x4100('0x4a')][_0x4100('0x49')]({'where':{'id':_0x256451[_0x4100('0x4b')]},'attributes':['id',_0x4100('0x4c'),_0x4100('0x4d'),'vidaooTopic',_0x4100('0x4e'),_0x4100('0x4f')],'raw':!![]});})[_0x4100('0x16')](function(_0x251f4c){if(_0x251f4c&&_0x251f4c[_0x4100('0x4c')]&&_0x251f4c[_0x4100('0x4d')]){_0x249913=_0x251f4c;var _0xe8de4f={'interaction':{'id':_0x147226},'agent':{'id':_0x2e6d18['user']['id'],'name':_0x2e6d18[_0x4100('0x38')]['name'],'fullname':_0x2e6d18['user'][_0x4100('0x50')],'email':_0x2e6d18[_0x4100('0x38')][_0x4100('0x51')]},'contact':_0x2e6d18[_0x4100('0x47')][_0x4100('0x2d')],'account':_0x2e6d18[_0x4100('0x47')][_0x4100('0x30')]};var _0x23709f={'rejectUnauthorized':![],'method':_0x4100('0x52'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x251f4c[_0x4100('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2e6d18[_0x4100('0x38')]['email']],'buttons':null,'topic':_0x249913['vidaooTopic'],'note':_['isNull'](_0x249913[_0x4100('0x4e')])?null:getMustacheRender(_0x249913['vidaooNote'],_0xe8de4f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4100('0x53')](_0x249913[_0x4100('0x4f')])){var _0x202728=getMustacheRender(_0x249913[_0x4100('0x4f')],_0xe8de4f);var _0x181401=JSON[_0x4100('0x54')](_0x202728);_0x23709f['body']['metadata']=_0x181401;}}catch(_0xe9d5a2){throw new db[(_0x4100('0x55'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x23709f);}else{throw new db[(_0x4100('0x55'))]['ValidationError'](_0x4100('0x56'));}})[_0x4100('0x16')](function(_0x15cd12){_0x1fcd62=_0x15cd12;if(_0x1fcd62['id']){var _0x550879={'body':_0x1fcd62[_0x4100('0x57')],'ChatWebsiteId':_0x249913['id'],'ChatInteractionId':_0x1997e3['id'],'direction':_0x4100('0x58'),'UserId':_0x2e6d18[_0x4100('0x38')]['id']};return db['ChatMessage'][_0x4100('0x45')](_0x550879,{});}else{throw new db['Sequelize'][(_0x4100('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x4100('0x16')](function(){return _0x1997e3[_0x4100('0x5a')]({'vidaooSessionId':_0x1fcd62['id']});})[_0x4100('0x16')](respondWithResult(_0xb77a29,null))[_0x4100('0x1f')](handleError(_0xb77a29,null));};exports['customUpdate']=function(_0x329a94,_0x1f6664){if(_0x329a94[_0x4100('0x47')]['id']){delete _0x329a94[_0x4100('0x47')]['id'];}return db[_0x4100('0x3c')][_0x4100('0x44')]({'where':{'id':_0x329a94[_0x4100('0x3a')]['id']},'include':[{'model':db[_0x4100('0x5b')],'as':_0x4100('0x5c')}]})[_0x4100('0x16')](handleEntityNotFound(_0x1f6664,null))['then'](saveUpdates(_0x329a94[_0x4100('0x47')],null))[_0x4100('0x16')](respondWithResult(_0x1f6664,null))['catch'](handleError(_0x1f6664,null));};exports['abandon']=function(_0x41da87,_0x45ae6d){if(_0x41da87[_0x4100('0x47')]['id']){delete _0x41da87[_0x4100('0x47')]['id'];}return db['ChatInteraction'][_0x4100('0x44')]({'where':{'id':_0x41da87[_0x4100('0x3a')]['id']}})['then'](function(_0x244a8a){if(!_0x244a8a){logger[_0x4100('0x1b')](_0x4100('0x5d'),'abandon',0x194,_0x4100('0x5e'));_0x45ae6d[_0x4100('0x5f')](0x194);}else{if(_0x244a8a[_0x4100('0x60')]){throw new db[(_0x4100('0x55'))][(_0x4100('0x59'))](_0x4100('0x61'));}}return _0x244a8a;})[_0x4100('0x16')](function(_0x40e24f){if(_0x40e24f){return _0x40e24f[_0x4100('0x46')]({'closed':_0x41da87['body']['closed'],'disposition':_0x41da87['body'][_0x4100('0x62')]})['then'](function(_0x27a9f0){return _0x27a9f0;});}})[_0x4100('0x16')](function(){return respondWithRpcPromise(_0x4100('0x63'),_0x4100('0x64'),_0x41da87['body'],client9004);})[_0x4100('0x16')](respondWithResult(_0x45ae6d,null))[_0x4100('0x1f')](handleError(_0x45ae6d,null));};exports[_0x4100('0x65')]=function(_0x334680,_0x745c12){_0x334680[_0x4100('0x47')]['name']=_0x334680['file'][_0x4100('0x66')];_0x334680[_0x4100('0x47')][_0x4100('0x67')]=_0x334680[_0x4100('0x68')][_0x4100('0x69')];_0x334680['body']['type']=_0x334680[_0x4100('0x68')][_0x4100('0x6a')];return db['Attachment'][_0x4100('0x45')](_0x334680['body'])[_0x4100('0x16')](respondWithResult(_0x745c12,0xc9))[_0x4100('0x1f')](handleError(_0x745c12,null));};exports[_0x4100('0x6b')]=function(_0x3a1516,_0x19ac24){return db[_0x4100('0x3c')]['findOne']({'where':{'id':_0x3a1516[_0x4100('0x3a')]['id']},'raw':!![]})[_0x4100('0x16')](handleEntityNotFound(_0x19ac24,null))['then'](function(_0x40fb39){if(_0x40fb39){if(_0x40fb39[_0x4100('0x6c')]){return _0x19ac24[_0x4100('0x21')](0x193)['json']({'status':0x193,'message':_0x4100('0x6d')});}return db[_0x4100('0x6e')][_0x4100('0x49')]({'where':{'id':_0x3a1516[_0x4100('0x37')][_0x4100('0x6f')]},'raw':!![]})[_0x4100('0x16')](handleEntityNotFound(_0x19ac24,null));}})[_0x4100('0x16')](function(_0x28dadf){if(_0x28dadf){var _0x5c43f9=_0x28dadf[_0x4100('0x70')]!==null;var _0x46a8e4=path[_0x4100('0x71')](config[_0x4100('0x72')],'server/files/attachments/');if(_0x5c43f9){_0x46a8e4=path[_0x4100('0x71')](_0x46a8e4,_0x4100('0x73'));}var _0x4ffe9f=path[_0x4100('0x71')](_0x46a8e4,_0x28dadf[_0x4100('0x67')]);return _0x19ac24[_0x4100('0x74')](_0x4ffe9f);}})['catch'](handleError(_0x19ac24,null));};exports[_0x4100('0x75')]=function(_0x1af220,_0x7569c5){var _0x581198=null;var _0xa97269=null;var _0x194186=null;if(_0x1af220[_0x4100('0x47')]['id']){delete _0x1af220[_0x4100('0x47')]['id'];}if(_0x1af220[_0x4100('0x47')]['mailTranscript']){_0x194186=path[_0x4100('0x71')](config['root'],'server/files/chat/upload/',util[_0x4100('0x76')](_0x4100('0x77'),Date[_0x4100('0x78')]()));_0x1af220[_0x4100('0x47')][_0x4100('0x79')]=_0x194186;}return db[_0x4100('0x3c')]['find']({'where':{'id':_0x1af220['params']['id']},'include':[{'model':db[_0x4100('0x7a')],'as':_0x4100('0x7b'),'include':[{'model':db[_0x4100('0x7c')],'as':_0x4100('0x7c')}]}]})['then'](handleEntityNotFound(_0x7569c5,null))[_0x4100('0x16')](saveUpdates(_0x1af220['body'],null))[_0x4100('0x16')](function(_0x390daa){if(_0x390daa){_0x581198=_0x390daa;return db[_0x4100('0x4a')][_0x4100('0x44')]({'where':{'id':_0x581198['ChatWebsiteId']}});}})['then'](function(_0x390dca){if(_0x390dca){_0xa97269=_0x390dca;return db['CmContact'][_0x4100('0x44')]({'where':{'id':_0x581198[_0x4100('0x7d')]}});}})['then'](function(_0x388217){if(_0x388217){if(_0x194186){var _0x346954=null;for(var _0xd8142=0x1;_0xd8142<_0x581198[_0x4100('0x7b')][_0x4100('0x41')];++_0xd8142){_0x346954=_0x581198[_0x4100('0x7b')][_0xd8142];var _0x27b737=_0x346954[_0x4100('0x60')]?util[_0x4100('0x76')](_0x4100('0x7e'),_0xa97269[_0x4100('0x7f')],_0x346954['UserId']):_0x4100('0x80');var _0x51fff9=_0x1af220[_0x4100('0x47')][_0x4100('0x81')]||util[_0x4100('0x76')](_0x4100('0x7e'),_0x4100('0x82'),_0x346954[_0x4100('0x7d')]);switch(_0xa97269[_0x4100('0x83')]){case _0x4100('0x84'):_0x27b737=_0x346954[_0x4100('0x60')]?util[_0x4100('0x76')](_0x4100('0x7e'),_0xa97269[_0x4100('0x7f')],_0x346954[_0x4100('0x60')]):'System';break;case _0x4100('0x85'):_0x27b737=_0x346954[_0x4100('0x60')]?_0x346954[_0x4100('0x7c')]['alias']||_0x346954['User']['fullname']:'System';break;case _0x4100('0x86'):_0x27b737=_0x346954[_0x4100('0x60')]?_0x346954[_0x4100('0x7c')][_0x4100('0x50')]:_0x4100('0x80');break;default:_0x27b737=_0x346954['UserId']?util['format'](_0x4100('0x7e'),_0xa97269[_0x4100('0x7f')],_0x346954[_0x4100('0x60')]):_0x4100('0x80');}var _0x1ffbe8=util['format'](_0x4100('0x87'),moment(_0x346954['createdAt'])[_0x4100('0x76')](_0x4100('0x88')),_0x346954[_0x4100('0x89')]==='in'?_0x51fff9:_0x27b737,_0x346954[_0x4100('0x47')]);if(!_0x346954[_0x4100('0x8a')]){fs[_0x4100('0x8b')](_0x194186,_0x1ffbe8);}}return db[_0x4100('0x8c')][_0x4100('0x49')]({'where':{'service':!![]},'include':[{'model':db[_0x4100('0x8d')],'as':_0x4100('0x8e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x4100('0x8f'),'raw':!![]}]}]});}}})[_0x4100('0x16')](function(_0x31a219){if(!_0x31a219||!_0x31a219[_0x4100('0x8e')]||!_0x1af220[_0x4100('0x47')])return _0x581198;var _0x3d77cb=_0x31a219[_0x4100('0x90')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3d77cb,'message':{'from':util[_0x4100('0x76')]('\x22%s\x22\x20<%s>',_0x31a219[_0x4100('0x2a')],_0x31a219[_0x4100('0x51')]||_0x31a219[_0x4100('0x8e')][_0x4100('0x38')]),'to':_0x1af220[_0x4100('0x47')][_0x4100('0x91')],'subject':_0x4100('0x92'),'text':util[_0x4100('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1af220[_0x4100('0x47')][_0x4100('0x91')]),'attachments':[{'path':_0x194186}]}})[_0x4100('0x16')](function(){return _0x581198;})[_0x4100('0x1f')](function(_0x582081){logger[_0x4100('0x1b')](_0x582081);});})['then'](respondWithStatusCode(_0x7569c5,0xc8))[_0x4100('0x1f')](handleError(_0x7569c5,null));};exports[_0x4100('0x93')]=function(_0x535d48,_0x434600){return db[_0x4100('0x7a')][_0x4100('0x44')]({'where':{'id':_0x535d48['params']['id']}})[_0x4100('0x16')](handleEntityNotFound(_0x434600,null))[_0x4100('0x16')](function(_0x13981c){if(_0x13981c){return _0x13981c[_0x4100('0x93')](_0x535d48[_0x4100('0x47')][_0x4100('0x94')],_[_0x4100('0x95')](_0x535d48[_0x4100('0x47')],[_0x4100('0x94'),'id'])||{});}})[_0x4100('0x16')](respondWithResult(_0x434600,null))[_0x4100('0x1f')](handleError(_0x434600,null));};exports[_0x4100('0x96')]=function(_0x4d8207,_0xe1fcc3){var _0x5955eb={'raw':![],'where':{}};var _0x17dd5f={};var _0x2c4ef8={'count':0x0,'rows':[]};return db[_0x4100('0x3c')][_0x4100('0x49')]({'where':{'id':_0x4d8207[_0x4100('0x3a')]['id']}})[_0x4100('0x16')](handleEntityNotFound(_0xe1fcc3,null))['then'](function(_0x207703){if(_0x207703){_0x17dd5f[_0x4100('0x3b')]=_[_0x4100('0x97')](db[_0x4100('0x7a')][_0x4100('0x33')]);_0x17dd5f[_0x4100('0x37')]=_['keys'](_0x4d8207['query']);_0x17dd5f[_0x4100('0x3d')]=_[_0x4100('0x3e')](_0x17dd5f['model'],_0x17dd5f['query']);_0x5955eb[_0x4100('0x40')]=_['intersection'](_0x17dd5f['model'],qs[_0x4100('0x3f')](_0x4d8207[_0x4100('0x37')][_0x4100('0x3f')]));_0x5955eb[_0x4100('0x40')]=_0x5955eb[_0x4100('0x40')][_0x4100('0x41')]?_0x5955eb[_0x4100('0x40')]:_0x17dd5f[_0x4100('0x3b')];if(!_0x4d8207[_0x4100('0x37')][_0x4100('0x98')]('nolimit')){_0x5955eb['limit']=qs[_0x4100('0x24')](_0x4d8207[_0x4100('0x37')][_0x4100('0x24')]);_0x5955eb[_0x4100('0x22')]=qs[_0x4100('0x22')](_0x4d8207['query'][_0x4100('0x22')]);}_0x5955eb[_0x4100('0x99')]=qs[_0x4100('0x9a')](_0x4d8207[_0x4100('0x37')]['sort']);_0x5955eb[_0x4100('0x9b')]=qs[_0x4100('0x3d')](_[_0x4100('0x9c')](_0x4d8207[_0x4100('0x37')],_0x17dd5f[_0x4100('0x3d')]));_0x5955eb[_0x4100('0x9b')][_0x4100('0x9d')]=_0x207703['id'];if(_0x4d8207[_0x4100('0x37')][_0x4100('0x9e')]){_0x5955eb[_0x4100('0x9b')]=_[_0x4100('0x2c')](_0x5955eb['where'],{'$or':_[_0x4100('0x32')](_0x5955eb[_0x4100('0x40')],function(_0xbf2801){var _0x5ab591={};_0x5ab591[_0xbf2801]={'$like':'%'+_0x4d8207[_0x4100('0x37')][_0x4100('0x9e')]+'%'};return _0x5ab591;})});}if(_0x4d8207[_0x4100('0x37')][_0x4100('0x9f')]){var _0x51d30b=_0x4d8207[_0x4100('0x37')]['$gte'][_0x4100('0xa0')](',');var _0x20777a={};_0x20777a[_0x51d30b[0x0]]={'$gte':moment(_0x51d30b[0x1])[_0x4100('0x76')](_0x4100('0xa1'))};_0x5955eb[_0x4100('0x9b')]=_[_0x4100('0x2c')](_0x5955eb[_0x4100('0x9b')],_0x20777a);}_0x5955eb=_[_0x4100('0x2c')]({},_0x5955eb,_0x4d8207[_0x4100('0xa2')]);return db[_0x4100('0x7a')][_0x4100('0x25')]({'where':_0x5955eb['where']})['then'](function(_0x21acb8){_0x2c4ef8[_0x4100('0x25')]=_0x21acb8;if(_0x4d8207['query']['includeAll']){_0x5955eb[_0x4100('0x43')]=[{'all':!![]}];}return db[_0x4100('0x7a')][_0x4100('0x36')](_0x5955eb);})[_0x4100('0x16')](function(_0x13deff){_0x2c4ef8[_0x4100('0xa3')]=_0x13deff;return _0x2c4ef8;});}})['then'](respondWithFilteredResult(_0xe1fcc3,_0x5955eb))[_0x4100('0x1f')](handleError(_0xe1fcc3,null));};exports['getMyMessages']=function(_0x414969,_0x1a67a8){var _0x2aae91={'where':{}},_0x29e7a5={},_0x55cf64={'count':0x0,'rows':[]};return db[_0x4100('0x3c')]['findOne']({'where':{'id':_0x414969[_0x4100('0x3a')]['id']}})[_0x4100('0x16')](handleEntityNotFound(_0x1a67a8,null))[_0x4100('0x16')](function(_0x167b6b){if(_0x167b6b){_0x29e7a5[_0x4100('0x3b')]=_[_0x4100('0x97')](db[_0x4100('0x7a')][_0x4100('0x33')]);_0x29e7a5[_0x4100('0x37')]=_[_0x4100('0x97')](_0x414969[_0x4100('0x37')]);_0x29e7a5[_0x4100('0x3d')]=_['intersection'](_0x29e7a5['model'],_0x29e7a5[_0x4100('0x37')]);_0x2aae91['attributes']=_[_0x4100('0x3e')](_0x29e7a5[_0x4100('0x3b')],qs['fields'](_0x414969['query'][_0x4100('0x3f')]));_0x2aae91[_0x4100('0x40')]=_0x2aae91['attributes']['length']?_0x2aae91[_0x4100('0x40')]:_0x29e7a5[_0x4100('0x3b')];if(!_0x414969[_0x4100('0x37')][_0x4100('0x98')](_0x4100('0xa4'))){_0x2aae91[_0x4100('0x24')]=qs['limit'](_0x414969['query'][_0x4100('0x24')]);_0x2aae91[_0x4100('0x22')]=qs[_0x4100('0x22')](_0x414969[_0x4100('0x37')][_0x4100('0x22')]);}_0x2aae91[_0x4100('0x99')]=qs['sort'](_0x414969[_0x4100('0x37')][_0x4100('0x9a')]);_0x2aae91[_0x4100('0x9b')]=qs[_0x4100('0x3d')](_[_0x4100('0x9c')](_0x414969['query'],_0x29e7a5[_0x4100('0x3d')]));_0x2aae91[_0x4100('0x9b')][_0x4100('0x9d')]=_0x167b6b['id'];if(_0x414969[_0x4100('0x37')][_0x4100('0x9e')]){_0x2aae91['where']=_[_0x4100('0x2c')](_0x2aae91[_0x4100('0x9b')],{'$or':_[_0x4100('0x32')](_0x2aae91['attributes'],function(_0x3b1fa8){var _0x1daf52={};_0x1daf52[_0x3b1fa8]={'$like':'%'+_0x414969['query'][_0x4100('0x9e')]+'%'};return _0x1daf52;})});}_0x2aae91[_0x4100('0x9b')][_0x4100('0x8a')]=![];if(_0x414969[_0x4100('0x37')]['id']){_0x2aae91[_0x4100('0x9b')]['id']={'$gt':_0x414969[_0x4100('0x37')]['id']};}_0x2aae91=_[_0x4100('0x2c')]({},_0x2aae91,_0x414969[_0x4100('0xa2')]);return db[_0x4100('0x7a')][_0x4100('0x25')]({'where':_0x2aae91[_0x4100('0x9b')]})['then'](function(_0x59789c){_0x55cf64['count']=_0x59789c;_0x2aae91[_0x4100('0x43')]=[];if(_0x414969[_0x4100('0x37')][_0x4100('0xa5')]){_0x2aae91[_0x4100('0x43')][_0x4100('0xa6')]({'model':db[_0x4100('0x7c')],'as':'User','attributes':['id','fullname',_0x4100('0xa7')]});}if(_0x414969['query'][_0x4100('0x42')]){_0x2aae91[_0x4100('0x43')]=[{'all':!![]}];}return db[_0x4100('0x7a')]['findAll'](_0x2aae91);})['then'](function(_0x2f041a){_0x55cf64[_0x4100('0xa3')]=_0x2f041a;return _0x55cf64;});}})[_0x4100('0x16')](respondWithFilteredResult(_0x1a67a8,_0x2aae91))[_0x4100('0x1f')](handleError(_0x1a67a8,null));};exports[_0x4100('0xa8')]=function(_0x1d60a5,_0x5e4e85){return db[_0x4100('0x3c')]['find']({'where':{'id':_0x1d60a5[_0x4100('0x3a')]['id']}})[_0x4100('0x16')](handleEntityNotFound(_0x5e4e85,null))[_0x4100('0x16')](function(_0x2e6816){if(_0x2e6816){return _0x2e6816[_0x4100('0xa9')](_0x1d60a5[_0x4100('0x47')][_0x4100('0x94')],_[_0x4100('0x95')](_0x1d60a5['body'],[_0x4100('0x94'),'id'])||{})['spread'](function(){return db[_0x4100('0xaa')]['findAll']({'attributes':['id',_0x4100('0x2a'),_0x4100('0xab')],'where':{'id':_0x1d60a5[_0x4100('0x47')][_0x4100('0x94')]}});})[_0x4100('0x16')](function(_0x1e7a93){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1d60a5['params']['id']),'tags':_0x1e7a93||[]});return{'id':Number(_0x1d60a5[_0x4100('0x3a')]['id']),'tags':_0x1e7a93||[]};});}})[_0x4100('0x16')](respondWithResult(_0x5e4e85,null))[_0x4100('0x1f')](handleError(_0x5e4e85,null));};exports[_0x4100('0xac')]=function(_0x545fd2,_0xde712f){return db['ChatInteraction']['find']({'where':{'id':_0x545fd2[_0x4100('0x3a')]['id']}})[_0x4100('0x16')](handleEntityNotFound(_0xde712f,null))[_0x4100('0x16')](function(_0x47d10c){if(_0x47d10c){return _0x47d10c['removeTags'](_0x545fd2[_0x4100('0x37')][_0x4100('0x94')]);}})['then'](respondWithStatusCode(_0xde712f,null))[_0x4100('0x1f')](handleError(_0xde712f,null));};exports[_0x4100('0x74')]=function(_0x423823,_0x2ce386){var _0x33fabb=moment()[_0x4100('0xad')]()[_0x4100('0xae')]();var _0x39a279=path['join'](config[_0x4100('0x72')],_0x4100('0xaf'),_0x4100('0xb0'),_0x4100('0xb1'));var _0xcab302=path[_0x4100('0x71')](config[_0x4100('0x72')],_0x4100('0xaf'),_0x4100('0xb0'),_0x4100('0xb2'));var _0x324094=path[_0x4100('0x71')](_0x39a279,_0x33fabb);var _0x5af123=util[_0x4100('0x76')](_0x4100('0xb3'),_0x423823['params']['id'],_0x33fabb);var _0x326891=path['join'](_0x39a279,_0x5af123);var _0xe50829=[];_0xe50829['push']({'model':db[_0x4100('0x7c')],'as':_0x4100('0x7c'),'attributes':['id','fullname'],'raw':!![]});_0xe50829[_0x4100('0xa6')]({'model':db[_0x4100('0x5b')],'as':_0x4100('0x5c'),'attributes':['id',_0x4100('0xb4'),_0x4100('0xb5')],'raw':!![]});if(_0x423823[_0x4100('0x37')]['attachments']){_0xe50829[_0x4100('0xa6')]({'model':db['Attachment'],'as':_0x4100('0x6e'),'raw':!![]});}var _0x449ed7=[{'model':db['ChatMessage'],'as':_0x4100('0x7b'),'attributes':['id',_0x4100('0x47'),_0x4100('0xb6'),_0x4100('0x89'),_0x4100('0x8a'),_0x4100('0xb7')],'include':_0xe50829}];_0x449ed7[_0x4100('0xa6')]({'model':db[_0x4100('0x4a')],'as':'Account','attributes':['id',_0x4100('0x2a')]});_0x449ed7[_0x4100('0xa6')]({'model':db[_0x4100('0x7c')],'as':_0x4100('0xb8'),'attributes':['id',_0x4100('0x50')]});return db[_0x4100('0x3c')][_0x4100('0x44')]({'where':{'id':_0x423823[_0x4100('0x3a')]['id']},'include':_0x449ed7})[_0x4100('0x16')](handleEntityNotFound(_0x2ce386,null))[_0x4100('0x16')](function(_0x2388e2){if(_0x2388e2){var _0x15fe62=_0x2388e2[_0x4100('0xb9')]({'plain':!![]});fs[_0x4100('0xba')](_0x324094);var _0x2d8b3f={'channel':'Chat','account':_0x15fe62['Account'][_0x4100('0x2a')],'agent':_0x15fe62[_0x4100('0xb8')]?_0x15fe62[_0x4100('0xb8')]['fullname']:'N.A.','createdAt':moment(_0x15fe62[_0x4100('0xb6')])[_0x4100('0x76')](_0x4100('0xa1'))['toString'](),'closedAt':_0x15fe62['closed']?moment(_0x15fe62['closedAt'])[_0x4100('0x76')](_0x4100('0xa1'))[_0x4100('0xae')]():'','disposition':_0x15fe62[_0x4100('0x62')],'chatInfo':{'browser':_0x15fe62['browserName'],'os':_0x15fe62['osName'],'referer':_0x15fe62[_0x4100('0xbb')],'customerIp':_0x15fe62[_0x4100('0xbc')],'customerPort':_0x15fe62['customerPort']?_0x15fe62[_0x4100('0xbd')]:_0x4100('0xbe')},'messages':_(_0x15fe62[_0x4100('0x7b')])[_0x4100('0xbf')]()['filter']({'secret':![]})[_0x4100('0x32')](function(_0x9594d1){if(_0x9594d1['Attachment']){var _0x4f6a64=path[_0x4100('0x71')](_0xcab302,_0x9594d1[_0x4100('0x6e')][_0x4100('0x67')]);if(fs[_0x4100('0xc0')](_0x4f6a64)){fs[_0x4100('0xc1')](_0x4f6a64)[_0x4100('0xc2')](fs[_0x4100('0xc3')](path['join'](_0x324094,_0x9594d1[_0x4100('0x6e')]['basename'])));}}return{'date':moment(_0x9594d1[_0x4100('0xb6')])[_0x4100('0x76')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4100('0xae')](),'sender':_0x9594d1[_0x4100('0x89')]===_0x4100('0x58')?_0x9594d1[_0x4100('0x7c')]?_0x9594d1[_0x4100('0x7c')][_0x4100('0x50')]:_0x4100('0x80'):_0x9594d1[_0x4100('0x5c')][_0x4100('0xb4')]+(_0x9594d1[_0x4100('0x5c')][_0x4100('0xb5')]?'\x20'+_0x9594d1[_0x4100('0x5c')][_0x4100('0xb5')]:''),'body':_0x9594d1[_0x4100('0x6e')]?_0x9594d1[_0x4100('0x6e')][_0x4100('0x67')]:_0x9594d1[_0x4100('0x47')],'direction':_0x9594d1[_0x4100('0x89')]===_0x4100('0x58')?'A':'C','secret':_0x9594d1[_0x4100('0x8a')],'read':_0x9594d1[_0x4100('0xb7')],'attachment':_0x9594d1[_0x4100('0x6e')]};})[_0x4100('0xc4')]()};return ejs[_0x4100('0xc5')](path[_0x4100('0x71')](config[_0x4100('0x72')],'server',_0x4100('0xc6'),_0x4100('0xc7')),{'interaction':_0x2d8b3f})[_0x4100('0x16')](function(_0x181f71){var _0x46d5d9=path[_0x4100('0x71')](_0x324094,_0x4100('0xc8')+_0x15fe62['id']+'-'+_0x33fabb+'.pdf');var _0xb860c8={'path':_0x46d5d9,'channel':'Chat','interactionId':_0x15fe62['id']};return pdf[_0x4100('0xc9')](_0x181f71,_0xb860c8);})['then'](function(){return new Promise(function(_0x4ca2b3,_0x57789c){zipdir(_0x324094,{'saveTo':_0x326891},function(_0x5c495a,_0x4f47f6){if(_0x5c495a)return _0x57789c(_0x5c495a);return _0x4ca2b3(_0x4f47f6);});})[_0x4100('0x16')](function(){return new BPromise(function(_0x472840,_0x34bd27){rimraf(_0x324094,function(_0xb58b49){if(_0xb58b49)_0x34bd27(_0xb58b49);return _0x472840();});});})[_0x4100('0x16')](function(){return _0x2ce386[_0x4100('0x74')](_0x326891,_0x5af123,function(_0x36dc00){if(_0x36dc00){logger['error'](_0x4100('0xca'),_0x36dc00);}else{fs[_0x4100('0xcb')](_0x326891);}});});});}else{return _0x2ce386[_0x4100('0x5f')](0xc8);}})['catch'](handleError(_0x2ce386,null));}; \ No newline at end of file +var _0x6542=['interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','show','model','keys','intersection','fields','attributes','length','includeAll','include','create','find','params','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','user','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','closed','attachmentUpload','originalname','basename','filename','file','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','User','format','%s%d','System','customer','Visitor','ContactId','agentIdentifier','website_alias','UserId','agentAlias','agent_alias','alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','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','filters','hasOwnProperty','nolimit','limit','sort','where','pick','ChatInteractionId','filter','$gte','split','rows','getMyMessages','secret','options','includeAgent','addTags','setTags','color','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','Messages','createdAt','read','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','tail','existsSync','createReadStream','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','undefined','count','set','Content-Range','json','update','destroy','stack','name','send','render','merge','body','contact','agent'];(function(_0x222d09,_0x2f2eef){var _0x128368=function(_0x36374a){while(--_0x36374a){_0x222d09['push'](_0x222d09['shift']());}};_0x128368(++_0x2f2eef);}(_0x6542,0xa2));var _0x2654=function(_0x182a5f,_0x37d4a4){_0x182a5f=_0x182a5f-0x0;var _0x1d2d5e=_0x6542[_0x182a5f];return _0x1d2d5e;};'use strict';var rimraf=require(_0x2654('0x0'));var zipdir=require('zip-dir');var rp=require(_0x2654('0x1'));var moment=require(_0x2654('0x2'));var BPromise=require(_0x2654('0x3'));var Mustache=require('mustache');var util=require(_0x2654('0x4'));var path=require(_0x2654('0x5'));var ejs=require(_0x2654('0x6'));var fs=require('fs');var _=require(_0x2654('0x7'));var Redis=require(_0x2654('0x8'));var interaction=require(_0x2654('0x9'));var qs=require(_0x2654('0xa'));var pdf=require(_0x2654('0xb'));var logger=require(_0x2654('0xc'))(_0x2654('0xd'));var config=require('../../config/environment');var db=require(_0x2654('0xe'))['db'];config[_0x2654('0xf')]=_[_0x2654('0x10')](config[_0x2654('0xf')],{'host':_0x2654('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2654('0xf')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2654('0x12')][_0x2654('0x13')]({'port':0x232b});var client9004=jayson[_0x2654('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4fff13,_0xcfa822,_0x11e118,_0x2754da){return new BPromise(function(_0x2a7bdf,_0x3d539b){var _0x4daf87=_0x2754da||client;return _0x4daf87[_0x2654('0x14')](_0x4fff13,_0x11e118)[_0x2654('0x15')](function(_0x7d5f32){logger[_0x2654('0x16')](_0x2654('0x17'),_0xcfa822,_0x2654('0x18'));logger[_0x2654('0x19')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xcfa822,_0x2654('0x18'),JSON[_0x2654('0x1a')](_0x7d5f32));if(_0x7d5f32['error']){if(_0x7d5f32[_0x2654('0x1b')][_0x2654('0x1c')]===0x1f4){logger[_0x2654('0x1b')](_0x2654('0x17'),_0xcfa822,_0x7d5f32[_0x2654('0x1b')][_0x2654('0x1d')]);return _0x3d539b(_0x7d5f32['error'][_0x2654('0x1d')]);}logger[_0x2654('0x1b')](_0x2654('0x17'),_0xcfa822,_0x7d5f32[_0x2654('0x1b')]['message']);return _0x2a7bdf(_0x7d5f32['error'][_0x2654('0x1d')]);}else{logger[_0x2654('0x16')](_0x2654('0x17'),_0xcfa822,_0x2654('0x18'));_0x2a7bdf(_0x7d5f32[_0x2654('0x1e')][_0x2654('0x1d')]);}})[_0x2654('0x1f')](function(_0x16ef6d){logger[_0x2654('0x1b')](_0x2654('0x17'),_0xcfa822,_0x16ef6d);_0x3d539b(_0x16ef6d);});});}function respondWithStatusCode(_0x2b706e,_0x32c42c){_0x32c42c=_0x32c42c||0xcc;return function(_0x2546e3){if(_0x2546e3){return _0x2b706e['sendStatus'](_0x32c42c);}return _0x2b706e[_0x2654('0x20')](_0x32c42c)[_0x2654('0x21')]();};}function respondWithResult(_0x31d6a8,_0x16ee72){_0x16ee72=_0x16ee72||0xc8;return function(_0x4157b2){if(_0x4157b2){return _0x31d6a8['status'](_0x16ee72)['json'](_0x4157b2);}};}function respondWithFilteredResult(_0x5756f1,_0xc1dc5a){return function(_0x5d3b28){if(_0x5d3b28){var _0x58a998=typeof _0xc1dc5a[_0x2654('0x22')]===_0x2654('0x23')&&typeof _0xc1dc5a['limit']==='undefined';var _0x997488=_0x5d3b28[_0x2654('0x24')];var _0x555438=_0x58a998?0x0:_0xc1dc5a[_0x2654('0x22')];var _0x6b17f3=_0x58a998?_0x5d3b28[_0x2654('0x24')]:_0xc1dc5a['offset']+_0xc1dc5a['limit'];var _0x3ac481;if(_0x6b17f3>=_0x997488){_0x6b17f3=_0x997488;_0x3ac481=0xc8;}else{_0x3ac481=0xce;}_0x5756f1[_0x2654('0x20')](_0x3ac481);return _0x5756f1[_0x2654('0x25')](_0x2654('0x26'),_0x555438+'-'+_0x6b17f3+'/'+_0x997488)[_0x2654('0x27')](_0x5d3b28);}return null;};}function saveUpdates(_0x1d6ebb){return function(_0x30afe5){if(_0x30afe5){return _0x30afe5[_0x2654('0x28')](_0x1d6ebb)[_0x2654('0x15')](function(_0x2b4324){return _0x2b4324;});}return null;};}function removeEntity(_0x326b36){return function(_0x2c37fc){if(_0x2c37fc){return _0x2c37fc[_0x2654('0x29')]()['then'](function(){_0x326b36[_0x2654('0x20')](0xcc)[_0x2654('0x21')]();});}};}function handleEntityNotFound(_0x2928ab){return function(_0x760d8){if(!_0x760d8){_0x2928ab['sendStatus'](0x194);}return _0x760d8;};}function handleError(_0xab2d94,_0x2df6bb){_0x2df6bb=_0x2df6bb||0x1f4;return function(_0x31c067){logger[_0x2654('0x1b')](_0x31c067[_0x2654('0x2a')]);if(_0x31c067[_0x2654('0x2b')]){delete _0x31c067[_0x2654('0x2b')];}_0xab2d94[_0x2654('0x20')](_0x2df6bb)[_0x2654('0x2c')](_0x31c067);};}function getMustacheRender(_0x479261,_0xe70954){return Mustache[_0x2654('0x2d')](_0x479261,_[_0x2654('0x2e')](_0xe70954[_0x2654('0x2f')],{'contact':_0xe70954[_0x2654('0x30')],'message':_0xe70954[_0x2654('0x1d')],'agent':_0xe70954[_0x2654('0x31')],'interaction':_0xe70954[_0x2654('0x32')],'account':_0xe70954[_0x2654('0x33')]}))||'';}exports[_0x2654('0x34')]=function(_0x3ef121,_0x3f47b6){var _0xdd7639={};var _0x25dfda=_[_0x2654('0x35')](db[_0x2654('0x36')][_0x2654('0x37')],function(_0x241d20){return{'name':_0x241d20[_0x2654('0x38')],'type':_0x241d20[_0x2654('0x39')][_0x2654('0x3a')]};});_0xdd7639=qs[_0x2654('0x3b')](_0x25dfda,_0x3ef121);return interaction[_0x2654('0x3c')]('chat',_0x3ef121[_0x2654('0x3d')],_0x3ef121['user'],_0xdd7639,_0x25dfda)['then'](respondWithFilteredResult(_0x3f47b6,_0xdd7639))[_0x2654('0x1f')](handleError(_0x3f47b6,null));};exports[_0x2654('0x3e')]=function(_0x38865d,_0x39484e){var _0x42f7e1={'raw':![],'where':{'id':_0x38865d['params']['id']}},_0x49eef7={};_0x49eef7[_0x2654('0x3f')]=_[_0x2654('0x40')](db[_0x2654('0x36')][_0x2654('0x37')]);_0x49eef7[_0x2654('0x3d')]=_['keys'](_0x38865d[_0x2654('0x3d')]);_0x49eef7['filters']=_['intersection'](_0x49eef7[_0x2654('0x3f')],_0x49eef7[_0x2654('0x3d')]);_0x42f7e1['attributes']=_[_0x2654('0x41')](_0x49eef7[_0x2654('0x3f')],qs[_0x2654('0x42')](_0x38865d[_0x2654('0x3d')][_0x2654('0x42')]));_0x42f7e1[_0x2654('0x43')]=_0x42f7e1[_0x2654('0x43')][_0x2654('0x44')]?_0x42f7e1[_0x2654('0x43')]:_0x49eef7['model'];if(_0x38865d[_0x2654('0x3d')][_0x2654('0x45')]){_0x42f7e1[_0x2654('0x46')]=[{'all':!![]}];}_0x42f7e1=_[_0x2654('0x2e')]({},_0x42f7e1,_0x38865d['options']);return db['ChatInteraction']['find'](_0x42f7e1)[_0x2654('0x15')](handleEntityNotFound(_0x39484e,null))[_0x2654('0x15')](respondWithResult(_0x39484e,null))[_0x2654('0x1f')](handleError(_0x39484e,null));};exports[_0x2654('0x47')]=function(_0x36f662,_0x4fe9ca){return db['ChatInteraction'][_0x2654('0x47')](_0x36f662[_0x2654('0x2f')],{})[_0x2654('0x15')](respondWithResult(_0x4fe9ca,0xc9))[_0x2654('0x1f')](handleError(_0x4fe9ca,null));};exports['update']=function(_0x2cedab,_0x5e762e){if(_0x2cedab[_0x2654('0x2f')]['id']){delete _0x2cedab[_0x2654('0x2f')]['id'];}return db['ChatInteraction'][_0x2654('0x48')]({'where':{'id':_0x2cedab[_0x2654('0x49')]['id']}})[_0x2654('0x15')](handleEntityNotFound(_0x5e762e,null))[_0x2654('0x15')](saveUpdates(_0x2cedab['body'],null))[_0x2654('0x15')](respondWithResult(_0x5e762e,null))[_0x2654('0x1f')](handleError(_0x5e762e,null));};exports[_0x2654('0x29')]=function(_0x43d9eb,_0x51b504){return db['ChatInteraction'][_0x2654('0x48')]({'where':{'id':_0x43d9eb[_0x2654('0x49')]['id']}})[_0x2654('0x15')](handleEntityNotFound(_0x51b504,null))[_0x2654('0x15')](removeEntity(_0x51b504,null))[_0x2654('0x1f')](handleError(_0x51b504,null));};exports[_0x2654('0x4a')]=function(_0x4084e4,_0x2ee6cc){return db[_0x2654('0x36')][_0x2654('0x4a')]()[_0x2654('0x15')](respondWithResult(_0x2ee6cc,null))[_0x2654('0x1f')](handleError(_0x2ee6cc,null));};exports['createVidaooSession']=function(_0x1855b7,_0x4442ae){var _0xe493bb=_0x1855b7[_0x2654('0x49')]['id'];var _0x19299e;var _0x512642;var _0xa23968;return db[_0x2654('0x36')][_0x2654('0x4b')]({'where':{'id':_0xe493bb}})['then'](function(_0x517b4b){_0x19299e=_0x517b4b;return db[_0x2654('0x4c')][_0x2654('0x4b')]({'where':{'id':_0x517b4b[_0x2654('0x4d')]},'attributes':['id',_0x2654('0x4e'),_0x2654('0x4f'),_0x2654('0x50'),_0x2654('0x51'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0xd330e3){if(_0xd330e3&&_0xd330e3[_0x2654('0x4e')]&&_0xd330e3[_0x2654('0x4f')]){_0x512642=_0xd330e3;var _0x4e2707={'interaction':{'id':_0xe493bb},'agent':{'id':_0x1855b7[_0x2654('0x52')]['id'],'name':_0x1855b7[_0x2654('0x52')][_0x2654('0x2b')],'fullname':_0x1855b7['user']['fullname'],'email':_0x1855b7[_0x2654('0x52')][_0x2654('0x53')]},'contact':_0x1855b7[_0x2654('0x2f')][_0x2654('0x30')],'account':_0x1855b7[_0x2654('0x2f')]['account']};var _0x3468cb={'rejectUnauthorized':![],'method':_0x2654('0x54'),'url':_0x2654('0x55'),'headers':{'X-APIKEY':_0xd330e3[_0x2654('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1855b7[_0x2654('0x52')][_0x2654('0x53')]],'buttons':null,'topic':_0x512642['vidaooTopic'],'note':_[_0x2654('0x56')](_0x512642[_0x2654('0x51')])?null:getMustacheRender(_0x512642[_0x2654('0x51')],_0x4e2707),'metadata':null},'redirect':_0x2654('0x57'),'json':!![]};try{if(!_['isNull'](_0x512642[_0x2654('0x58')])){var _0x1006c7=getMustacheRender(_0x512642[_0x2654('0x58')],_0x4e2707);var _0x6fee68=JSON[_0x2654('0x59')](_0x1006c7);_0x3468cb[_0x2654('0x2f')][_0x2654('0x5a')]=_0x6fee68;}}catch(_0xfad13a){throw new db[(_0x2654('0x5b'))][(_0x2654('0x5c'))](_0x2654('0x5d'));}return rp(_0x3468cb);}else{throw new db[(_0x2654('0x5b'))]['ValidationError'](_0x2654('0x5e'));}})[_0x2654('0x15')](function(_0x145064){_0xa23968=_0x145064;if(_0xa23968['id']){var _0x234abc={'body':_0xa23968[_0x2654('0x5f')],'ChatWebsiteId':_0x512642['id'],'ChatInteractionId':_0x19299e['id'],'direction':_0x2654('0x60'),'UserId':_0x1855b7[_0x2654('0x52')]['id']};return db[_0x2654('0x61')][_0x2654('0x47')](_0x234abc,{});}else{throw new db[(_0x2654('0x5b'))]['ValidationError'](_0x2654('0x62'));}})[_0x2654('0x15')](function(){return _0x19299e[_0x2654('0x63')]({'vidaooSessionId':_0xa23968['id']});})[_0x2654('0x15')](respondWithResult(_0x4442ae,null))['catch'](handleError(_0x4442ae,null));};exports[_0x2654('0x64')]=function(_0xa01b80,_0x457983){if(_0xa01b80['body']['id']){delete _0xa01b80[_0x2654('0x2f')]['id'];}return db[_0x2654('0x36')][_0x2654('0x48')]({'where':{'id':_0xa01b80['params']['id']},'include':[{'model':db[_0x2654('0x65')],'as':_0x2654('0x66')}]})[_0x2654('0x15')](handleEntityNotFound(_0x457983,null))[_0x2654('0x15')](saveUpdates(_0xa01b80['body'],null))[_0x2654('0x15')](respondWithResult(_0x457983,null))[_0x2654('0x1f')](handleError(_0x457983,null));};exports[_0x2654('0x67')]=function(_0x3e02eb,_0x403740){if(_0x3e02eb[_0x2654('0x2f')]['id']){delete _0x3e02eb[_0x2654('0x2f')]['id'];}return db[_0x2654('0x36')][_0x2654('0x48')]({'where':{'id':_0x3e02eb[_0x2654('0x49')]['id']}})[_0x2654('0x15')](function(_0x4570fe){if(!_0x4570fe){logger[_0x2654('0x1b')](_0x2654('0x68'),_0x2654('0x67'),0x194,_0x2654('0x69'));_0x403740[_0x2654('0x6a')](0x194);}else{if(_0x4570fe['UserId']){throw new db[(_0x2654('0x5b'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x4570fe;})['then'](function(_0x5cad4b){if(_0x5cad4b){return _0x5cad4b[_0x2654('0x28')]({'closed':_0x3e02eb['body'][_0x2654('0x6b')],'disposition':_0x3e02eb[_0x2654('0x2f')]['disposition']})[_0x2654('0x15')](function(_0x268bcf){return _0x268bcf;});}})[_0x2654('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0x2654('0x67'),_0x3e02eb['body'],client9004);})['then'](respondWithResult(_0x403740,null))[_0x2654('0x1f')](handleError(_0x403740,null));};exports[_0x2654('0x6c')]=function(_0x577d0f,_0x20eb8d){_0x577d0f[_0x2654('0x2f')]['name']=_0x577d0f['file'][_0x2654('0x6d')];_0x577d0f[_0x2654('0x2f')][_0x2654('0x6e')]=_0x577d0f['file'][_0x2654('0x6f')];_0x577d0f[_0x2654('0x2f')]['type']=_0x577d0f[_0x2654('0x70')][_0x2654('0x71')];return db['Attachment'][_0x2654('0x47')](_0x577d0f[_0x2654('0x2f')])[_0x2654('0x15')](respondWithResult(_0x20eb8d,0xc9))['catch'](handleError(_0x20eb8d,null));};exports[_0x2654('0x72')]=function(_0x585304,_0x137389){return db[_0x2654('0x36')][_0x2654('0x4b')]({'where':{'id':_0x585304[_0x2654('0x49')]['id']},'raw':!![]})[_0x2654('0x15')](handleEntityNotFound(_0x137389,null))[_0x2654('0x15')](function(_0x35bcbc){if(_0x35bcbc){if(_0x35bcbc[_0x2654('0x6b')]){return _0x137389['status'](0x193)[_0x2654('0x27')]({'status':0x193,'message':_0x2654('0x73')});}return db[_0x2654('0x74')][_0x2654('0x4b')]({'where':{'id':_0x585304[_0x2654('0x3d')][_0x2654('0x75')]},'raw':!![]})[_0x2654('0x15')](handleEntityNotFound(_0x137389,null));}})[_0x2654('0x15')](function(_0x17178e){if(_0x17178e){var _0x51862b=_0x17178e[_0x2654('0x76')]!==null;var _0x44207a=path[_0x2654('0x77')](config['root'],_0x2654('0x78'));if(_0x51862b){_0x44207a=path['join'](_0x44207a,'offline-chat/');}var _0x398dee=path[_0x2654('0x77')](_0x44207a,_0x17178e[_0x2654('0x6e')]);return _0x137389[_0x2654('0x79')](_0x398dee);}})['catch'](handleError(_0x137389,null));};exports[_0x2654('0x7a')]=function(_0x3b5559,_0x3a3569){var _0x1f0c21=null;var _0x1c96d2=null;var _0x17ac89=null;if(_0x3b5559[_0x2654('0x2f')]['id']){delete _0x3b5559[_0x2654('0x2f')]['id'];}if(_0x3b5559[_0x2654('0x2f')][_0x2654('0x7b')]){_0x17ac89=path[_0x2654('0x77')](config[_0x2654('0x7c')],_0x2654('0x7d'),util['format'](_0x2654('0x7e'),Date[_0x2654('0x7f')]()));_0x3b5559[_0x2654('0x2f')][_0x2654('0x80')]=_0x17ac89;}return db[_0x2654('0x36')]['find']({'where':{'id':_0x3b5559[_0x2654('0x49')]['id']},'include':[{'model':db[_0x2654('0x61')],'as':'Messages','include':[{'model':db[_0x2654('0x81')],'as':'User'}]}]})[_0x2654('0x15')](handleEntityNotFound(_0x3a3569,null))[_0x2654('0x15')](saveUpdates(_0x3b5559[_0x2654('0x2f')],null))[_0x2654('0x15')](function(_0x45c1b4){if(_0x45c1b4){_0x1f0c21=_0x45c1b4;return db[_0x2654('0x4c')][_0x2654('0x48')]({'where':{'id':_0x1f0c21['ChatWebsiteId']}});}})[_0x2654('0x15')](function(_0xde9588){if(_0xde9588){_0x1c96d2=_0xde9588;return db[_0x2654('0x65')][_0x2654('0x48')]({'where':{'id':_0x1f0c21['ContactId']}});}})['then'](function(_0x1d11e0){if(_0x1d11e0){if(_0x17ac89){var _0x22cbbc=null;for(var _0x63313f=0x1;_0x63313f<_0x1f0c21['Messages']['length'];++_0x63313f){_0x22cbbc=_0x1f0c21['Messages'][_0x63313f];var _0x4ac1cf=_0x22cbbc['UserId']?util[_0x2654('0x82')](_0x2654('0x83'),_0x1c96d2['agentAlias'],_0x22cbbc['UserId']):_0x2654('0x84');var _0x14ee15=_0x3b5559[_0x2654('0x2f')][_0x2654('0x85')]||util[_0x2654('0x82')](_0x2654('0x83'),_0x2654('0x86'),_0x22cbbc[_0x2654('0x87')]);switch(_0x1c96d2[_0x2654('0x88')]){case _0x2654('0x89'):_0x4ac1cf=_0x22cbbc[_0x2654('0x8a')]?util['format'](_0x2654('0x83'),_0x1c96d2[_0x2654('0x8b')],_0x22cbbc[_0x2654('0x8a')]):'System';break;case _0x2654('0x8c'):_0x4ac1cf=_0x22cbbc[_0x2654('0x8a')]?_0x22cbbc[_0x2654('0x81')][_0x2654('0x8d')]||_0x22cbbc[_0x2654('0x81')][_0x2654('0x8e')]:_0x2654('0x84');break;case _0x2654('0x8f'):_0x4ac1cf=_0x22cbbc[_0x2654('0x8a')]?_0x22cbbc[_0x2654('0x81')][_0x2654('0x8e')]:'System';break;default:_0x4ac1cf=_0x22cbbc[_0x2654('0x8a')]?util[_0x2654('0x82')](_0x2654('0x83'),_0x1c96d2[_0x2654('0x8b')],_0x22cbbc[_0x2654('0x8a')]):_0x2654('0x84');}var _0x8424c7=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x22cbbc['createdAt'])['format'](_0x2654('0x90')),_0x22cbbc['direction']==='in'?_0x14ee15:_0x4ac1cf,_0x22cbbc[_0x2654('0x2f')]);if(!_0x22cbbc['secret']){fs[_0x2654('0x91')](_0x17ac89,_0x8424c7);}}return db[_0x2654('0x92')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2654('0x93')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x4767d6){if(!_0x4767d6||!_0x4767d6[_0x2654('0x94')]||!_0x3b5559[_0x2654('0x2f')])return _0x1f0c21;var _0x199d4d=_0x4767d6[_0x2654('0x95')]();return respondWithRpcPromise(_0x2654('0x96'),_0x2654('0x97'),{'account':_0x199d4d,'message':{'from':util['format'](_0x2654('0x98'),_0x4767d6[_0x2654('0x2b')],_0x4767d6[_0x2654('0x53')]||_0x4767d6[_0x2654('0x94')][_0x2654('0x52')]),'to':_0x3b5559[_0x2654('0x2f')][_0x2654('0x7b')],'subject':'Mail\x20Transcript','text':util[_0x2654('0x82')](_0x2654('0x99'),_0x3b5559[_0x2654('0x2f')][_0x2654('0x7b')]),'attachments':[{'path':_0x17ac89}]}})[_0x2654('0x15')](function(){return _0x1f0c21;})[_0x2654('0x1f')](function(_0x2ad9c3){logger[_0x2654('0x1b')](_0x2ad9c3);});})[_0x2654('0x15')](respondWithStatusCode(_0x3a3569,0xc8))[_0x2654('0x1f')](handleError(_0x3a3569,null));};exports[_0x2654('0x9a')]=function(_0x1839a4,_0x391154){return db[_0x2654('0x61')]['find']({'where':{'id':_0x1839a4[_0x2654('0x49')]['id']}})['then'](handleEntityNotFound(_0x391154,null))[_0x2654('0x15')](function(_0x1c6d56){if(_0x1c6d56){return _0x1c6d56['addMessage'](_0x1839a4[_0x2654('0x2f')][_0x2654('0x9b')],_[_0x2654('0x9c')](_0x1839a4[_0x2654('0x2f')],[_0x2654('0x9b'),'id'])||{});}})[_0x2654('0x15')](respondWithResult(_0x391154,null))[_0x2654('0x1f')](handleError(_0x391154,null));};exports['getMessages']=function(_0x190e73,_0x259647){var _0x51bc9c={'raw':![],'where':{}};var _0x184bbe={};var _0x2f2a74={'count':0x0,'rows':[]};return db[_0x2654('0x36')][_0x2654('0x4b')]({'where':{'id':_0x190e73['params']['id']}})[_0x2654('0x15')](handleEntityNotFound(_0x259647,null))[_0x2654('0x15')](function(_0x156842){if(_0x156842){_0x184bbe['model']=_[_0x2654('0x40')](db[_0x2654('0x61')][_0x2654('0x37')]);_0x184bbe[_0x2654('0x3d')]=_['keys'](_0x190e73['query']);_0x184bbe[_0x2654('0x9d')]=_[_0x2654('0x41')](_0x184bbe[_0x2654('0x3f')],_0x184bbe[_0x2654('0x3d')]);_0x51bc9c[_0x2654('0x43')]=_[_0x2654('0x41')](_0x184bbe[_0x2654('0x3f')],qs[_0x2654('0x42')](_0x190e73[_0x2654('0x3d')]['fields']));_0x51bc9c['attributes']=_0x51bc9c[_0x2654('0x43')][_0x2654('0x44')]?_0x51bc9c[_0x2654('0x43')]:_0x184bbe[_0x2654('0x3f')];if(!_0x190e73[_0x2654('0x3d')][_0x2654('0x9e')](_0x2654('0x9f'))){_0x51bc9c['limit']=qs[_0x2654('0xa0')](_0x190e73[_0x2654('0x3d')][_0x2654('0xa0')]);_0x51bc9c['offset']=qs[_0x2654('0x22')](_0x190e73[_0x2654('0x3d')][_0x2654('0x22')]);}_0x51bc9c['order']=qs['sort'](_0x190e73[_0x2654('0x3d')][_0x2654('0xa1')]);_0x51bc9c[_0x2654('0xa2')]=qs[_0x2654('0x9d')](_[_0x2654('0xa3')](_0x190e73[_0x2654('0x3d')],_0x184bbe[_0x2654('0x9d')]));_0x51bc9c[_0x2654('0xa2')][_0x2654('0xa4')]=_0x156842['id'];if(_0x190e73[_0x2654('0x3d')]['filter']){_0x51bc9c[_0x2654('0xa2')]=_[_0x2654('0x2e')](_0x51bc9c[_0x2654('0xa2')],{'$or':_[_0x2654('0x35')](_0x51bc9c[_0x2654('0x43')],function(_0x5f03ab){var _0x53dcaa={};_0x53dcaa[_0x5f03ab]={'$like':'%'+_0x190e73[_0x2654('0x3d')][_0x2654('0xa5')]+'%'};return _0x53dcaa;})});}if(_0x190e73[_0x2654('0x3d')][_0x2654('0xa6')]){var _0x47c9a9=_0x190e73['query'][_0x2654('0xa6')][_0x2654('0xa7')](',');var _0x4d1f2c={};_0x4d1f2c[_0x47c9a9[0x0]]={'$gte':moment(_0x47c9a9[0x1])[_0x2654('0x82')]('YYYY-MM-DD\x20HH:mm:ss')};_0x51bc9c[_0x2654('0xa2')]=_['merge'](_0x51bc9c[_0x2654('0xa2')],_0x4d1f2c);}_0x51bc9c=_[_0x2654('0x2e')]({},_0x51bc9c,_0x190e73['options']);return db[_0x2654('0x61')][_0x2654('0x24')]({'where':_0x51bc9c['where']})[_0x2654('0x15')](function(_0x6e45a8){_0x2f2a74['count']=_0x6e45a8;if(_0x190e73[_0x2654('0x3d')]['includeAll']){_0x51bc9c[_0x2654('0x46')]=[{'all':!![]}];}return db[_0x2654('0x61')]['findAll'](_0x51bc9c);})[_0x2654('0x15')](function(_0x551fc9){_0x2f2a74[_0x2654('0xa8')]=_0x551fc9;return _0x2f2a74;});}})[_0x2654('0x15')](respondWithFilteredResult(_0x259647,_0x51bc9c))['catch'](handleError(_0x259647,null));};exports[_0x2654('0xa9')]=function(_0x4a33cb,_0x370962){var _0x475d10={'where':{}},_0x15a761={},_0x264dde={'count':0x0,'rows':[]};return db[_0x2654('0x36')]['findOne']({'where':{'id':_0x4a33cb['params']['id']}})[_0x2654('0x15')](handleEntityNotFound(_0x370962,null))[_0x2654('0x15')](function(_0x5d6faa){if(_0x5d6faa){_0x15a761[_0x2654('0x3f')]=_[_0x2654('0x40')](db[_0x2654('0x61')][_0x2654('0x37')]);_0x15a761[_0x2654('0x3d')]=_['keys'](_0x4a33cb[_0x2654('0x3d')]);_0x15a761[_0x2654('0x9d')]=_[_0x2654('0x41')](_0x15a761['model'],_0x15a761[_0x2654('0x3d')]);_0x475d10[_0x2654('0x43')]=_[_0x2654('0x41')](_0x15a761[_0x2654('0x3f')],qs[_0x2654('0x42')](_0x4a33cb[_0x2654('0x3d')][_0x2654('0x42')]));_0x475d10[_0x2654('0x43')]=_0x475d10['attributes'][_0x2654('0x44')]?_0x475d10[_0x2654('0x43')]:_0x15a761[_0x2654('0x3f')];if(!_0x4a33cb['query'][_0x2654('0x9e')]('nolimit')){_0x475d10['limit']=qs[_0x2654('0xa0')](_0x4a33cb[_0x2654('0x3d')]['limit']);_0x475d10['offset']=qs['offset'](_0x4a33cb[_0x2654('0x3d')]['offset']);}_0x475d10['order']=qs[_0x2654('0xa1')](_0x4a33cb[_0x2654('0x3d')]['sort']);_0x475d10[_0x2654('0xa2')]=qs[_0x2654('0x9d')](_[_0x2654('0xa3')](_0x4a33cb[_0x2654('0x3d')],_0x15a761[_0x2654('0x9d')]));_0x475d10[_0x2654('0xa2')][_0x2654('0xa4')]=_0x5d6faa['id'];if(_0x4a33cb[_0x2654('0x3d')]['filter']){_0x475d10[_0x2654('0xa2')]=_[_0x2654('0x2e')](_0x475d10[_0x2654('0xa2')],{'$or':_[_0x2654('0x35')](_0x475d10[_0x2654('0x43')],function(_0xcf85d2){var _0x20c2c0={};_0x20c2c0[_0xcf85d2]={'$like':'%'+_0x4a33cb[_0x2654('0x3d')]['filter']+'%'};return _0x20c2c0;})});}_0x475d10['where'][_0x2654('0xaa')]=![];if(_0x4a33cb[_0x2654('0x3d')]['id']){_0x475d10[_0x2654('0xa2')]['id']={'$gt':_0x4a33cb[_0x2654('0x3d')]['id']};}_0x475d10=_[_0x2654('0x2e')]({},_0x475d10,_0x4a33cb[_0x2654('0xab')]);return db[_0x2654('0x61')][_0x2654('0x24')]({'where':_0x475d10[_0x2654('0xa2')]})['then'](function(_0x5ba1bb){_0x264dde[_0x2654('0x24')]=_0x5ba1bb;_0x475d10[_0x2654('0x46')]=[];if(_0x4a33cb['query'][_0x2654('0xac')]){_0x475d10[_0x2654('0x46')]['push']({'model':db[_0x2654('0x81')],'as':_0x2654('0x81'),'attributes':['id',_0x2654('0x8e'),_0x2654('0x8d')]});}if(_0x4a33cb[_0x2654('0x3d')]['includeAll']){_0x475d10[_0x2654('0x46')]=[{'all':!![]}];}return db[_0x2654('0x61')][_0x2654('0x3c')](_0x475d10);})['then'](function(_0x2223ab){_0x264dde[_0x2654('0xa8')]=_0x2223ab;return _0x264dde;});}})[_0x2654('0x15')](respondWithFilteredResult(_0x370962,_0x475d10))[_0x2654('0x1f')](handleError(_0x370962,null));};exports[_0x2654('0xad')]=function(_0x2f349e,_0x4a2539){return db['ChatInteraction'][_0x2654('0x48')]({'where':{'id':_0x2f349e[_0x2654('0x49')]['id']}})[_0x2654('0x15')](handleEntityNotFound(_0x4a2539,null))[_0x2654('0x15')](function(_0x567b61){if(_0x567b61){return _0x567b61[_0x2654('0xae')](_0x2f349e[_0x2654('0x2f')][_0x2654('0x9b')],_[_0x2654('0x9c')](_0x2f349e[_0x2654('0x2f')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x2654('0x3c')]({'attributes':['id','name',_0x2654('0xaf')],'where':{'id':_0x2f349e['body'][_0x2654('0x9b')]}});})[_0x2654('0x15')](function(_0x4a796f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x2f349e[_0x2654('0x49')]['id']),'tags':_0x4a796f||[]});return{'id':Number(_0x2f349e[_0x2654('0x49')]['id']),'tags':_0x4a796f||[]};});}})[_0x2654('0x15')](respondWithResult(_0x4a2539,null))[_0x2654('0x1f')](handleError(_0x4a2539,null));};exports[_0x2654('0xb0')]=function(_0xce4f0d,_0x148c18){return db[_0x2654('0x36')][_0x2654('0x48')]({'where':{'id':_0xce4f0d[_0x2654('0x49')]['id']}})[_0x2654('0x15')](handleEntityNotFound(_0x148c18,null))[_0x2654('0x15')](function(_0x882d20){if(_0x882d20){return _0x882d20[_0x2654('0xb0')](_0xce4f0d[_0x2654('0x3d')][_0x2654('0x9b')]);}})[_0x2654('0x15')](respondWithStatusCode(_0x148c18,null))[_0x2654('0x1f')](handleError(_0x148c18,null));};exports[_0x2654('0x79')]=function(_0x2a592e,_0x20ee3e){var _0x24c21f=moment()[_0x2654('0xb1')]()[_0x2654('0xb2')]();var _0x38e4ad=path['join'](config[_0x2654('0x7c')],_0x2654('0xb3'),_0x2654('0xb4'),_0x2654('0xb5'));var _0x472a42=path[_0x2654('0x77')](config[_0x2654('0x7c')],'server',_0x2654('0xb4'),_0x2654('0xb6'));var _0x301215=path[_0x2654('0x77')](_0x38e4ad,_0x24c21f);var _0x129851=util[_0x2654('0x82')](_0x2654('0xb7'),_0x2a592e[_0x2654('0x49')]['id'],_0x24c21f);var _0x3e42fb=path['join'](_0x38e4ad,_0x129851);var _0x44abce=[];_0x44abce[_0x2654('0xb8')]({'model':db[_0x2654('0x81')],'as':_0x2654('0x81'),'attributes':['id',_0x2654('0x8e')],'raw':!![]});_0x44abce[_0x2654('0xb8')]({'model':db[_0x2654('0x65')],'as':_0x2654('0x66'),'attributes':['id',_0x2654('0xb9'),_0x2654('0xba')],'raw':!![]});if(_0x2a592e[_0x2654('0x3d')][_0x2654('0xb6')]){_0x44abce['push']({'model':db[_0x2654('0x74')],'as':_0x2654('0x74'),'raw':!![]});}var _0x3953fd=[{'model':db[_0x2654('0x61')],'as':_0x2654('0xbb'),'attributes':['id','body',_0x2654('0xbc'),'direction','secret',_0x2654('0xbd')],'include':_0x44abce}];_0x3953fd[_0x2654('0xb8')]({'model':db[_0x2654('0x4c')],'as':'Account','attributes':['id',_0x2654('0x2b')]});_0x3953fd[_0x2654('0xb8')]({'model':db[_0x2654('0x81')],'as':'Owner','attributes':['id',_0x2654('0x8e')]});return db[_0x2654('0x36')]['find']({'where':{'id':_0x2a592e['params']['id']},'include':_0x3953fd})[_0x2654('0x15')](handleEntityNotFound(_0x20ee3e,null))['then'](function(_0xdf91d9){if(_0xdf91d9){var _0xf118c5=_0xdf91d9[_0x2654('0xbe')]({'plain':!![]});fs[_0x2654('0xbf')](_0x301215);var _0x38791f={'channel':_0x2654('0xc0'),'account':_0xf118c5['Account']['name'],'agent':_0xf118c5[_0x2654('0xc1')]?_0xf118c5[_0x2654('0xc1')]['fullname']:_0x2654('0xc2'),'createdAt':moment(_0xf118c5[_0x2654('0xbc')])['format'](_0x2654('0xc3'))[_0x2654('0xb2')](),'closedAt':_0xf118c5[_0x2654('0x6b')]?moment(_0xf118c5['closedAt'])[_0x2654('0x82')](_0x2654('0xc3'))[_0x2654('0xb2')]():'','disposition':_0xf118c5[_0x2654('0xc4')],'chatInfo':{'browser':_0xf118c5[_0x2654('0xc5')],'os':_0xf118c5[_0x2654('0xc6')],'referer':_0xf118c5[_0x2654('0xc7')],'customerIp':_0xf118c5['customerIp'],'customerPort':_0xf118c5['customerPort']?_0xf118c5['customerPort']:_0x2654('0xc2')},'messages':_(_0xf118c5[_0x2654('0xbb')])[_0x2654('0xc8')]()[_0x2654('0xa5')]({'secret':![]})[_0x2654('0x35')](function(_0x3e5828){if(_0x3e5828[_0x2654('0x74')]){var _0x51ef61=path[_0x2654('0x77')](_0x472a42,_0x3e5828[_0x2654('0x74')][_0x2654('0x6e')]);if(fs[_0x2654('0xc9')](_0x51ef61)){fs[_0x2654('0xca')](_0x51ef61)['pipe'](fs[_0x2654('0xcb')](path['join'](_0x301215,_0x3e5828[_0x2654('0x74')][_0x2654('0x6e')])));}}return{'date':moment(_0x3e5828[_0x2654('0xbc')])[_0x2654('0x82')](_0x2654('0xc3'))['toString'](),'sender':_0x3e5828['direction']===_0x2654('0x60')?_0x3e5828['User']?_0x3e5828['User'][_0x2654('0x8e')]:'System':_0x3e5828['Contact'][_0x2654('0xb9')]+(_0x3e5828[_0x2654('0x66')][_0x2654('0xba')]?'\x20'+_0x3e5828[_0x2654('0x66')][_0x2654('0xba')]:''),'body':_0x3e5828[_0x2654('0x74')]?_0x3e5828[_0x2654('0x74')]['basename']:_0x3e5828[_0x2654('0x2f')],'direction':_0x3e5828['direction']===_0x2654('0x60')?'A':'C','secret':_0x3e5828['secret'],'read':_0x3e5828[_0x2654('0xbd')],'attachment':_0x3e5828[_0x2654('0x74')]};})[_0x2654('0xcc')]()};return ejs[_0x2654('0xcd')](path['join'](config[_0x2654('0x7c')],'server',_0x2654('0xce'),_0x2654('0xcf')),{'interaction':_0x38791f})[_0x2654('0x15')](function(_0x387d17){var _0x9c006c=path[_0x2654('0x77')](_0x301215,_0x2654('0xd0')+_0xf118c5['id']+'-'+_0x24c21f+_0x2654('0xd1'));var _0x5d97eb={'path':_0x9c006c,'channel':_0x2654('0xc0'),'interactionId':_0xf118c5['id']};return pdf['createPdfFromHTML'](_0x387d17,_0x5d97eb);})[_0x2654('0x15')](function(){return new Promise(function(_0x373bc4,_0x5e348a){zipdir(_0x301215,{'saveTo':_0x3e42fb},function(_0x9f84b4,_0x4ab1d5){if(_0x9f84b4)return _0x5e348a(_0x9f84b4);return _0x373bc4(_0x4ab1d5);});})[_0x2654('0x15')](function(){return new BPromise(function(_0x4c25a1,_0x87db7c){rimraf(_0x301215,function(_0x51d7b9){if(_0x51d7b9)_0x87db7c(_0x51d7b9);return _0x4c25a1();});});})[_0x2654('0x15')](function(){return _0x20ee3e[_0x2654('0x79')](_0x3e42fb,_0x129851,function(_0x1dc0df){if(_0x1dc0df){logger[_0x2654('0x1b')](_0x2654('0xd2'),_0x1dc0df);}else{fs[_0x2654('0xd3')](_0x3e42fb);}});});});}else{return _0x20ee3e[_0x2654('0x6a')](0xc8);}})[_0x2654('0x1f')](handleError(_0x20ee3e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index fca78ad..5e5b4eb 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 _0x5b17=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','setMaxListeners','save','remove','getUsers'];(function(_0x16b8f8,_0x2291d4){var _0x4ac6a2=function(_0x25c643){while(--_0x25c643){_0x16b8f8['push'](_0x16b8f8['shift']());}};_0x4ac6a2(++_0x2291d4);}(_0x5b17,0xae));var _0x75b1=function(_0x60123a,_0x3d687b){_0x60123a=_0x60123a-0x0;var _0x189936=_0x5b17[_0x60123a];return _0x189936;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x75b1('0x0'))['db'][_0x75b1('0x1')];var ChatMessage=require(_0x75b1('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x75b1('0x2')](0x0);var events={'afterCreate':_0x75b1('0x3'),'afterUpdate':'update','afterDestroy':_0x75b1('0x4')};function emitEvent(_0x124adc){return function(_0x5a8e0d,_0x5a8ab8,_0xcbab49){_0x5a8e0d[_0x75b1('0x5')]({'attributes':['id'],'raw':!![]})[_0x75b1('0x6')](function(_0x148c2f){_0x5a8e0d['setDataValue'](_0x75b1('0x7'),_0x148c2f[_0x75b1('0x8')](function(_0x469864){return{'id':_0x469864['id']};}));return ChatMessage[_0x75b1('0x9')]({'where':{'ChatInteractionId':_0x5a8e0d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x75b1('0x6')](function(_0x4d892a){_0x5a8e0d[_0x75b1('0xa')](_0x75b1('0xb'),_0x4d892a[_0x75b1('0xc')]);ChatInteractionEvents[_0x75b1('0xd')](_0x124adc+':'+_0x5a8e0d['id'],_0x5a8e0d);ChatInteractionEvents[_0x75b1('0xd')](_0x124adc,_0x5a8e0d);_0xcbab49(null);})[_0x75b1('0xe')](_0xcbab49(null));};}for(var e in events){if(events[_0x75b1('0xf')](e)){var event=events[e];ChatInteraction[_0x75b1('0x10')](e,emitEvent(event));}}module[_0x75b1('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x6c6b=['update','remove','then','map','findAll','setDataValue','unreadMessages','emit','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x6c6b,0x1db));var _0xb6c6=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x6c6b[_0xfa634c];return _0x73e478;};'use strict';var EventEmitter=require(_0xb6c6('0x0'));var ChatInteraction=require(_0xb6c6('0x1'))['db'][_0xb6c6('0x2')];var ChatMessage=require(_0xb6c6('0x1'))['db'][_0xb6c6('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb6c6('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6c6('0x5'),'afterDestroy':_0xb6c6('0x6')};function emitEvent(_0x42d5e2){return function(_0xd9346,_0x31f5df,_0x8530fd){_0xd9346['getUsers']({'attributes':['id'],'raw':!![]})[_0xb6c6('0x7')](function(_0x3b14fe){_0xd9346['setDataValue']('Users',_0x3b14fe[_0xb6c6('0x8')](function(_0x6b033e){return{'id':_0x6b033e['id']};}));return ChatMessage[_0xb6c6('0x9')]({'where':{'ChatInteractionId':_0xd9346['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb6c6('0x7')](function(_0x13846f){_0xd9346[_0xb6c6('0xa')](_0xb6c6('0xb'),_0x13846f['length']);ChatInteractionEvents[_0xb6c6('0xc')](_0x42d5e2+':'+_0xd9346['id'],_0xd9346);ChatInteractionEvents[_0xb6c6('0xc')](_0x42d5e2,_0xd9346);_0x8530fd(null);})['catch'](_0x8530fd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xb6c6('0xd')](e,emitEvent(event));}}module[_0xb6c6('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index b5d99d9..9f2e1c4 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 _0x8fbd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','exports','ChatInteraction','changed','closed','closedAt','format'];(function(_0x3808c2,_0x822227){var _0x240a89=function(_0x29e914){while(--_0x29e914){_0x3808c2['push'](_0x3808c2['shift']());}};_0x240a89(++_0x822227);}(_0x8fbd,0x152));var _0xd8fb=function(_0x239a1a,_0x147a5e){_0x239a1a=_0x239a1a-0x0;var _0xe365fe=_0x8fbd[_0x239a1a];return _0xe365fe;};'use strict';var _=require(_0xd8fb('0x0'));var util=require(_0xd8fb('0x1'));var logger=require(_0xd8fb('0x2'))(_0xd8fb('0x3'));var moment=require('moment');var BPromise=require(_0xd8fb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8fb('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xd8fb('0x6')]=function(_0x4f9a2e,_0x1474ff){return _0x4f9a2e['define'](_0xd8fb('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f7683,_0x1fea95,_0x2cdbd5){if(_0x1f7683[_0xd8fb('0x8')](_0xd8fb('0x9'))){_0x1f7683[_0xd8fb('0xa')]=moment()[_0xd8fb('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2cdbd5(null,_0x1f7683);}},'charset':_0xd8fb('0xc'),'collate':_0xd8fb('0xd')});}; \ No newline at end of file +var _0x832b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x832b,0x152));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb832('0x0'));var util=require(_0xb832('0x1'));var logger=require(_0xb832('0x2'))(_0xb832('0x3'));var moment=require(_0xb832('0x4'));var BPromise=require(_0xb832('0x5'));var rp=require(_0xb832('0x6'));var fs=require('fs');var path=require(_0xb832('0x7'));var rimraf=require(_0xb832('0x8'));var config=require(_0xb832('0x9'));var attributes=require(_0xb832('0xa'));module[_0xb832('0xb')]=function(_0x55d2b2,_0x258964){return _0x55d2b2[_0xb832('0xc')](_0xb832('0xd'),attributes,{'tableName':_0xb832('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52428d,_0x398005,_0x50ff2a){if(_0x52428d[_0xb832('0xf')]('closed')){_0x52428d['closedAt']=moment()[_0xb832('0x10')](_0xb832('0x11'));}_0x50ff2a(null,_0x52428d);}},'charset':_0xb832('0x12'),'collate':_0xb832('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a7b6295..b15de3b 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 _0xeb0c=['omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update','body','options','where','attributes','UpdateChatInteraction','catch','AddTagsToChatInteraction','find'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0xeb0c,0x7f));var _0xceb0=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0xeb0c[_0x445c98];return _0x2fe913;};'use strict';var _=require(_0xceb0('0x0'));var util=require(_0xceb0('0x1'));var moment=require('moment');var BPromise=require(_0xceb0('0x2'));var rs=require(_0xceb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xceb0('0x4'))['db'];var utils=require(_0xceb0('0x5'));var logger=require('../../config/logger')(_0xceb0('0x6'));var config=require('../../config/environment');var jayson=require(_0xceb0('0x7'));var client=jayson['client'][_0xceb0('0x8')]({'port':0x232a});config['redis']=_[_0xceb0('0x9')](config[_0xceb0('0xa')],{'host':_0xceb0('0xb'),'port':0x18eb});var socket=require(_0xceb0('0xc'))(new Redis(config[_0xceb0('0xa')]));require(_0xceb0('0xd'))[_0xceb0('0xe')](socket);function respondWithRpcPromise(_0x1aca97,_0x51dd34,_0x3261ff){return new BPromise(function(_0x927b40,_0x225e93){return client[_0xceb0('0xf')](_0x1aca97,_0x3261ff)[_0xceb0('0x10')](function(_0x5158c9){logger[_0xceb0('0x11')](_0xceb0('0x12'),_0x51dd34,_0xceb0('0x13'));logger[_0xceb0('0x14')](_0xceb0('0x15'),_0x51dd34,_0xceb0('0x13'),JSON[_0xceb0('0x16')](_0x5158c9));if(_0x5158c9[_0xceb0('0x17')]){if(_0x5158c9[_0xceb0('0x17')][_0xceb0('0x18')]===0x1f4){logger['error'](_0xceb0('0x12'),_0x51dd34,_0x5158c9[_0xceb0('0x17')]['message']);return _0x225e93(_0x5158c9[_0xceb0('0x17')][_0xceb0('0x19')]);}logger['error'](_0xceb0('0x12'),_0x51dd34,_0x5158c9[_0xceb0('0x17')][_0xceb0('0x19')]);return _0x927b40(_0x5158c9['error'][_0xceb0('0x19')]);}else{logger[_0xceb0('0x11')](_0xceb0('0x12'),_0x51dd34,'request\x20sent');_0x927b40(_0x5158c9[_0xceb0('0x1a')][_0xceb0('0x19')]);}})['catch'](function(_0x214f87){logger[_0xceb0('0x17')](_0xceb0('0x12'),_0x51dd34,_0x214f87);_0x225e93(_0x214f87);});});}exports['UpdateChatInteraction']=function(_0x29f0fd){var _0x362808=this;return new Promise(function(_0x14ee24,_0x593a85){return db[_0xceb0('0x1b')][_0xceb0('0x1c')](_0x29f0fd[_0xceb0('0x1d')],{'raw':_0x29f0fd[_0xceb0('0x1e')]?_0x29f0fd[_0xceb0('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29f0fd[_0xceb0('0x1e')]?_0x29f0fd[_0xceb0('0x1e')][_0xceb0('0x1f')]||null:null,'attributes':_0x29f0fd['options']?_0x29f0fd[_0xceb0('0x1e')][_0xceb0('0x20')]||null:null,'limit':_0x29f0fd[_0xceb0('0x1e')]?_0x29f0fd[_0xceb0('0x1e')]['limit']||null:null})['then'](function(_0x49dcbe){logger[_0xceb0('0x11')]('UpdateChatInteraction',_0x29f0fd);logger[_0xceb0('0x14')](_0xceb0('0x21'),_0x29f0fd,JSON[_0xceb0('0x16')](_0x49dcbe));_0x14ee24(_0x49dcbe);})[_0xceb0('0x22')](function(_0x142298){logger['error'](_0xceb0('0x21'),_0x142298['message'],_0x29f0fd);_0x593a85(_0x362808[_0xceb0('0x17')](0x1f4,_0x142298[_0xceb0('0x19')]));});});};exports[_0xceb0('0x23')]=function(_0x5121ce){return new Promise(function(_0x2b5e0c,_0x5ae582){return db[_0xceb0('0x1b')][_0xceb0('0x24')]({'where':_0x5121ce['options']?_0x5121ce[_0xceb0('0x1e')][_0xceb0('0x1f')]||null:null})['then'](function(_0x294ace){if(_0x294ace){return _0x294ace['addTags'](_0x5121ce[_0xceb0('0x1d')]['ids'],_[_0xceb0('0x25')](_0x5121ce[_0xceb0('0x1d')],[_0xceb0('0x26'),'id'])||{});}})[_0xceb0('0x27')](function(_0x21c7cf){logger[_0xceb0('0x11')]('AddTags',_0x5121ce);logger['debug'](_0xceb0('0x28'),_0x5121ce,JSON[_0xceb0('0x16')](_0x21c7cf));_0x2b5e0c(_0x21c7cf);})[_0xceb0('0x22')](function(_0x2f54d4){logger[_0xceb0('0x17')](_0xceb0('0x28'),_0x2f54d4['message'],_0x5121ce);_0x5ae582(_this[_0xceb0('0x17')](0x1f4,_0x2f54d4['message']));});});}; \ No newline at end of file +var _0x2c31=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','catch','find','where','addTags','ids','omit','spread','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x2c31,0xc6));var _0x12c3=function(_0x1e4f5e,_0x649ccc){_0x1e4f5e=_0x1e4f5e-0x0;var _0x2c5bb8=_0x2c31[_0x1e4f5e];return _0x2c5bb8;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var moment=require('moment');var BPromise=require(_0x12c3('0x2'));var rs=require(_0x12c3('0x3'));var fs=require('fs');var Redis=require(_0x12c3('0x4'));var db=require(_0x12c3('0x5'))['db'];var utils=require(_0x12c3('0x6'));var logger=require('../../config/logger')(_0x12c3('0x7'));var config=require(_0x12c3('0x8'));var jayson=require(_0x12c3('0x9'));var client=jayson[_0x12c3('0xa')]['http']({'port':0x232a});config[_0x12c3('0xb')]=_[_0x12c3('0xc')](config[_0x12c3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x12c3('0xd'))(new Redis(config[_0x12c3('0xb')]));require(_0x12c3('0xe'))[_0x12c3('0xf')](socket);function respondWithRpcPromise(_0x2da221,_0x420584,_0x403ef6){return new BPromise(function(_0x10f0af,_0x3def7b){return client[_0x12c3('0x10')](_0x2da221,_0x403ef6)[_0x12c3('0x11')](function(_0x34283b){logger[_0x12c3('0x12')](_0x12c3('0x13'),_0x420584,_0x12c3('0x14'));logger[_0x12c3('0x15')](_0x12c3('0x16'),_0x420584,_0x12c3('0x14'),JSON['stringify'](_0x34283b));if(_0x34283b[_0x12c3('0x17')]){if(_0x34283b[_0x12c3('0x17')][_0x12c3('0x18')]===0x1f4){logger[_0x12c3('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x420584,_0x34283b[_0x12c3('0x17')][_0x12c3('0x19')]);return _0x3def7b(_0x34283b[_0x12c3('0x17')][_0x12c3('0x19')]);}logger[_0x12c3('0x17')](_0x12c3('0x13'),_0x420584,_0x34283b['error']['message']);return _0x10f0af(_0x34283b[_0x12c3('0x17')][_0x12c3('0x19')]);}else{logger[_0x12c3('0x12')](_0x12c3('0x13'),_0x420584,'request\x20sent');_0x10f0af(_0x34283b[_0x12c3('0x1a')][_0x12c3('0x19')]);}})['catch'](function(_0x4c248c){logger[_0x12c3('0x17')](_0x12c3('0x13'),_0x420584,_0x4c248c);_0x3def7b(_0x4c248c);});});}exports[_0x12c3('0x1b')]=function(_0x1b954f){var _0x2e7855=this;return new Promise(function(_0x139e27,_0x4aa5b6){return db[_0x12c3('0x1c')][_0x12c3('0x1d')](_0x1b954f[_0x12c3('0x1e')],{'raw':_0x1b954f[_0x12c3('0x1f')]?_0x1b954f[_0x12c3('0x1f')][_0x12c3('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b954f[_0x12c3('0x1f')]?_0x1b954f[_0x12c3('0x1f')]['where']||null:null,'attributes':_0x1b954f['options']?_0x1b954f[_0x12c3('0x1f')][_0x12c3('0x21')]||null:null,'limit':_0x1b954f[_0x12c3('0x1f')]?_0x1b954f[_0x12c3('0x1f')]['limit']||null:null})[_0x12c3('0x11')](function(_0x2a2ab3){logger[_0x12c3('0x12')](_0x12c3('0x1b'),_0x1b954f);logger['debug'](_0x12c3('0x1b'),_0x1b954f,JSON['stringify'](_0x2a2ab3));_0x139e27(_0x2a2ab3);})[_0x12c3('0x22')](function(_0x320110){logger['error'](_0x12c3('0x1b'),_0x320110['message'],_0x1b954f);_0x4aa5b6(_0x2e7855[_0x12c3('0x17')](0x1f4,_0x320110[_0x12c3('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x599bc0){return new Promise(function(_0x4dbc3f,_0x10a3f7){return db[_0x12c3('0x1c')][_0x12c3('0x23')]({'where':_0x599bc0[_0x12c3('0x1f')]?_0x599bc0[_0x12c3('0x1f')][_0x12c3('0x24')]||null:null})[_0x12c3('0x11')](function(_0x91bc25){if(_0x91bc25){return _0x91bc25[_0x12c3('0x25')](_0x599bc0[_0x12c3('0x1e')][_0x12c3('0x26')],_[_0x12c3('0x27')](_0x599bc0[_0x12c3('0x1e')],[_0x12c3('0x26'),'id'])||{});}})[_0x12c3('0x28')](function(_0x4b1d43){logger[_0x12c3('0x12')](_0x12c3('0x29'),_0x599bc0);logger['debug'](_0x12c3('0x29'),_0x599bc0,JSON[_0x12c3('0x2a')](_0x4b1d43));_0x4dbc3f(_0x4b1d43);})[_0x12c3('0x22')](function(_0x184490){logger['error'](_0x12c3('0x29'),_0x184490[_0x12c3('0x19')],_0x599bc0);_0x10a3f7(_this[_0x12c3('0x17')](0x1f4,_0x184490[_0x12c3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 1e02917..0b1b1fc 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 _0x8733=['update','emit','register','length','chatInteraction:','remove'];(function(_0x398d63,_0x3ae789){var _0x1077af=function(_0x145d74){while(--_0x145d74){_0x398d63['push'](_0x398d63['shift']());}};_0x1077af(++_0x3ae789);}(_0x8733,0xd7));var _0x3873=function(_0x5cb6f3,_0x4085bc){_0x5cb6f3=_0x5cb6f3-0x0;var _0x225ffe=_0x8733[_0x5cb6f3];return _0x225ffe;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x3873('0x0'),_0x3873('0x1')];function createListener(_0x20ab5f,_0xa534b1){return function(_0x423300){_0xa534b1[_0x3873('0x2')](_0x20ab5f,_0x423300);};}function removeListener(_0x24e484,_0x3df6c7){return function(){ChatInteractionEvents['removeListener'](_0x24e484,_0x3df6c7);};}exports[_0x3873('0x3')]=function(_0x3a53b1){for(var _0x380983=0x0,_0x4c37e1=events[_0x3873('0x4')];_0x380983<_0x4c37e1;_0x380983++){var _0x2fa708=events[_0x380983];var _0x37af67=createListener(_0x3873('0x5')+_0x2fa708,_0x3a53b1);ChatInteractionEvents['on'](_0x2fa708,_0x37af67);}}; \ No newline at end of file +var _0xb96c=['update','emit','removeListener','register','length','chatInteraction:'];(function(_0x1ea85b,_0x1fbaf0){var _0x38665a=function(_0x1e3695){while(--_0x1e3695){_0x1ea85b['push'](_0x1ea85b['shift']());}};_0x38665a(++_0x1fbaf0);}(_0xb96c,0xd2));var _0xcb96=function(_0x43e54d,_0xc34f31){_0x43e54d=_0x43e54d-0x0;var _0x2fc9e7=_0xb96c[_0x43e54d];return _0x2fc9e7;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xcb96('0x0')];function createListener(_0x55b95a,_0x5b2b21){return function(_0x7098c9){_0x5b2b21[_0xcb96('0x1')](_0x55b95a,_0x7098c9);};}function removeListener(_0x4216a0,_0x226a91){return function(){ChatInteractionEvents[_0xcb96('0x2')](_0x4216a0,_0x226a91);};}exports[_0xcb96('0x3')]=function(_0x48dbfd){for(var _0x4345df=0x0,_0x334821=events[_0xcb96('0x4')];_0x4345df<_0x334821;_0x4345df++){var _0x2e5b5e=events[_0x4345df];var _0x573e15=createListener(_0xcb96('0x5')+_0x2e5b5e,_0x48dbfd);ChatInteractionEvents['on'](_0x2e5b5e,_0x573e15);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c153973..3ece281 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 _0xda5a=['chat','chatinteraction:addtags','put','/:id','chatinteraction:update','update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked'];(function(_0x296a6e,_0x3f792e){var _0x21cb75=function(_0x3cc84d){while(--_0x3cc84d){_0x296a6e['push'](_0x296a6e['shift']());}};_0x21cb75(++_0x3f792e);}(_0xda5a,0x144));var _0xada5=function(_0x11bef7,_0x35cfa2){_0x11bef7=_0x11bef7-0x0;var _0x516854=_0xda5a[_0x11bef7];return _0x516854;};'use strict';var multer=require(_0xada5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xada5('0x1'));var express=require(_0xada5('0x2'));var router=express[_0xada5('0x3')]();var fs_extra=require(_0xada5('0x4'));var auth=require(_0xada5('0x5'));var interaction=require(_0xada5('0x6'));var config=require(_0xada5('0x7'));var controller=require(_0xada5('0x8'));router[_0xada5('0x9')]('/',auth[_0xada5('0xa')](),controller[_0xada5('0xb')]);router[_0xada5('0x9')](_0xada5('0xc'),auth['isAuthenticated'](),controller[_0xada5('0xd')]);router[_0xada5('0x9')]('/:id',auth[_0xada5('0xe')](),controller[_0xada5('0xf')]);router[_0xada5('0x9')]('/:id/attachment_download',auth[_0xada5('0xe')](),controller[_0xada5('0x10')]);router[_0xada5('0x9')](_0xada5('0x11'),auth[_0xada5('0xa')](),controller[_0xada5('0x12')]);router[_0xada5('0x9')](_0xada5('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xada5('0x14')]);router[_0xada5('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xada5('0x15')]);router[_0xada5('0x16')]('/',auth[_0xada5('0xa')](),controller[_0xada5('0x17')]);router[_0xada5('0x16')](_0xada5('0x18'),auth[_0xada5('0xa')](),controller[_0xada5('0x19')]);var upload=multer({'storage':multer[_0xada5('0x1a')]({'destination':function(_0x34b88a,_0x22c8da,_0x522624){_0x522624(null,path[_0xada5('0x1b')](config[_0xada5('0x1c')],'server/files/attachments/'));},'filename':function(_0x2d28b4,_0x1a3b7d,_0x6e9c1){_0x6e9c1(null,util[_0xada5('0x1d')](_0xada5('0x1e'),Date[_0xada5('0x1f')](),_0x1a3b7d['originalname'][_0xada5('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xada5('0x21'),upload[_0xada5('0x22')](_0xada5('0x23')),controller[_0xada5('0x24')]);router[_0xada5('0x16')](_0xada5('0x11'),auth[_0xada5('0xe')](),controller[_0xada5('0x25')]);router[_0xada5('0x16')](_0xada5('0x26'),auth[_0xada5('0xa')](),interaction[_0xada5('0x27')](_0xada5('0x28'),_0xada5('0x29')),controller['addTags']);router[_0xada5('0x2a')](_0xada5('0x2b'),auth[_0xada5('0xa')](),interaction['tracked'](_0xada5('0x28'),_0xada5('0x2c')),controller[_0xada5('0x2d')]);router[_0xada5('0x2a')]('/:id/custom_update',controller['customUpdate']);router[_0xada5('0x2a')](_0xada5('0x2e'),auth['isChatInteractionAuthorized'](),controller['abandon']);router['put'](_0xada5('0x2f'),controller[_0xada5('0x30')]);router[_0xada5('0x31')](_0xada5('0x2b'),auth[_0xada5('0xa')](),interaction['tracked'](_0xada5('0x28'),_0xada5('0x32')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xada5('0x33')]=router; \ No newline at end of file +var _0x1fd9=['/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','abandon','/:id/close','close','delete','destroy','removeTags','multer','path','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1fd9,0x7f));var _0x91fd=function(_0x1a9894,_0x491603){_0x1a9894=_0x1a9894-0x0;var _0x9e9b9d=_0x1fd9[_0x1a9894];return _0x9e9b9d;};'use strict';var multer=require(_0x91fd('0x0'));var util=require('util');var path=require(_0x91fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x91fd('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x91fd('0x3'));var config=require(_0x91fd('0x4'));var controller=require(_0x91fd('0x5'));router[_0x91fd('0x6')]('/',auth['isAuthenticated'](),controller[_0x91fd('0x7')]);router[_0x91fd('0x6')](_0x91fd('0x8'),auth[_0x91fd('0x9')](),controller[_0x91fd('0xa')]);router[_0x91fd('0x6')](_0x91fd('0xb'),auth[_0x91fd('0xc')](),controller[_0x91fd('0xd')]);router[_0x91fd('0x6')](_0x91fd('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x91fd('0xf')]);router[_0x91fd('0x6')](_0x91fd('0x10'),auth[_0x91fd('0x9')](),controller['getMessages']);router[_0x91fd('0x6')](_0x91fd('0x11'),auth[_0x91fd('0xc')](),controller['getMyMessages']);router[_0x91fd('0x6')](_0x91fd('0x12'),auth['isAuthenticated'](),controller[_0x91fd('0x13')]);router[_0x91fd('0x14')]('/',auth[_0x91fd('0x9')](),controller['create']);router[_0x91fd('0x14')](_0x91fd('0x15'),auth[_0x91fd('0x9')](),controller[_0x91fd('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c58e6,_0x3415fb,_0x3cec6c){_0x3cec6c(null,path[_0x91fd('0x17')](config[_0x91fd('0x18')],_0x91fd('0x19')));},'filename':function(_0x5117fc,_0x32f6c7,_0x436863){_0x436863(null,util[_0x91fd('0x1a')](_0x91fd('0x1b'),Date[_0x91fd('0x1c')](),_0x32f6c7[_0x91fd('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x91fd('0x1e')](_0x91fd('0x1f')),controller[_0x91fd('0x20')]);router[_0x91fd('0x14')]('/:id/messages',auth[_0x91fd('0xc')](),controller[_0x91fd('0x21')]);router[_0x91fd('0x14')](_0x91fd('0x22'),auth['isAuthenticated'](),interaction[_0x91fd('0x23')](_0x91fd('0x24'),'chatinteraction:addtags'),controller[_0x91fd('0x25')]);router[_0x91fd('0x26')](_0x91fd('0xb'),auth[_0x91fd('0x9')](),interaction['tracked']('chat',_0x91fd('0x27')),controller[_0x91fd('0x28')]);router[_0x91fd('0x26')]('/:id/custom_update',controller['customUpdate']);router[_0x91fd('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x91fd('0x29')]);router[_0x91fd('0x26')](_0x91fd('0x2a'),controller[_0x91fd('0x2b')]);router[_0x91fd('0x2c')](_0x91fd('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x91fd('0x24'),'chatinteraction:destroy'),controller[_0x91fd('0x2d')]);router['delete'](_0x91fd('0x22'),auth[_0x91fd('0x9')](),controller[_0x91fd('0x2e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 39c3891..4259ffc 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 _0x43db=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x24d29f,_0x3b3a10){var _0x53a5e0=function(_0x144596){while(--_0x144596){_0x24d29f['push'](_0x24d29f['shift']());}};_0x53a5e0(++_0x3b3a10);}(_0x43db,0x159));var _0xb43d=function(_0x4432f2,_0x22697a){_0x4432f2=_0x4432f2-0x0;var _0x1c97d6=_0x43db[_0x4432f2];return _0x1c97d6;};'use strict';var Sequelize=require(_0xb43d('0x0'));module[_0xb43d('0x1')]={'body':{'type':Sequelize[_0xb43d('0x2')](_0xb43d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb43d('0x4')]}}; \ No newline at end of file +var _0x2c99=['BOOLEAN','INTEGER','medium'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c99,0x1cd));var _0x92c9=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x2c99[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x92c9('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x92c9('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x92c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 1c6c1af..9fee2c8 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 _0x0702=['create','body','find','params','get','messages','lastMessageAt','createdAt','lastMessage','format','User','admin','user','role','userpic','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','findAll','catch','show','include'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x0702,0xee));var _0x2070=function(_0x44f194,_0x4635e1){_0x44f194=_0x44f194-0x0;var _0x10bf0c=_0x0702[_0x44f194];return _0x10bf0c;};'use strict';var emlformat=require(_0x2070('0x0'));var rimraf=require(_0x2070('0x1'));var zipdir=require(_0x2070('0x2'));var jsonpatch=require(_0x2070('0x3'));var rp=require(_0x2070('0x4'));var moment=require(_0x2070('0x5'));var BPromise=require(_0x2070('0x6'));var Mustache=require(_0x2070('0x7'));var util=require(_0x2070('0x8'));var path=require(_0x2070('0x9'));var sox=require('sox');var csv=require(_0x2070('0xa'));var ejs=require(_0x2070('0xb'));var fs=require('fs');var fs_extra=require(_0x2070('0xc'));var _=require('lodash');var squel=require(_0x2070('0xd'));var crypto=require('crypto');var jsforce=require(_0x2070('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2070('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2070('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2070('0x11'));var logger=require(_0x2070('0x12'))(_0x2070('0x13'));var utils=require(_0x2070('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2070('0x15'));var db=require(_0x2070('0x16'))['db'];config[_0x2070('0x17')]=_[_0x2070('0x18')](config[_0x2070('0x17')],{'host':_0x2070('0x19'),'port':0x18eb});var socket=require(_0x2070('0x1a'))(new Redis(config[_0x2070('0x17')]));require('./chatInternalMessage.socket')[_0x2070('0x1b')](socket);function respondWithStatusCode(_0x4d199e,_0x3b0b7e){_0x3b0b7e=_0x3b0b7e||0xcc;return function(_0x8c6984){if(_0x8c6984){return _0x4d199e[_0x2070('0x1c')](_0x3b0b7e);}return _0x4d199e[_0x2070('0x1d')](_0x3b0b7e)[_0x2070('0x1e')]();};}function respondWithResult(_0x563b74,_0x201a98){_0x201a98=_0x201a98||0xc8;return function(_0xce6c1f){if(_0xce6c1f){return _0x563b74[_0x2070('0x1d')](_0x201a98)[_0x2070('0x1f')](_0xce6c1f);}};}function respondWithFilteredResult(_0x4da70b,_0x5a9302){return function(_0xe32f51){if(_0xe32f51){var _0x5a32ef=typeof _0x5a9302[_0x2070('0x20')]===_0x2070('0x21')&&typeof _0x5a9302[_0x2070('0x22')]===_0x2070('0x21');var _0x3439e8=_0xe32f51[_0x2070('0x23')];var _0x5cadf1=_0x5a32ef?0x0:_0x5a9302[_0x2070('0x20')];var _0x4d6684=_0x5a32ef?_0xe32f51['count']:_0x5a9302[_0x2070('0x20')]+_0x5a9302['limit'];var _0x3dad22;if(_0x4d6684>=_0x3439e8){_0x4d6684=_0x3439e8;_0x3dad22=0xc8;}else{_0x3dad22=0xce;}_0x4da70b['status'](_0x3dad22);return _0x4da70b[_0x2070('0x24')]('Content-Range',_0x5cadf1+'-'+_0x4d6684+'/'+_0x3439e8)[_0x2070('0x1f')](_0xe32f51);}return null;};}function patchUpdates(_0xc4e3e6){return function(_0x497d27){try{jsonpatch[_0x2070('0x25')](_0x497d27,_0xc4e3e6,!![]);}catch(_0x2ea8d2){return BPromise[_0x2070('0x26')](_0x2ea8d2);}return _0x497d27[_0x2070('0x27')]();};}function saveUpdates(_0x473d4b,_0x5ea658){return function(_0x1965ba){if(_0x1965ba){return _0x1965ba['update'](_0x473d4b)[_0x2070('0x28')](function(_0x752c48){return _0x752c48;});}return null;};}function removeEntity(_0x4492d5,_0x301753){return function(_0x3b123e){if(_0x3b123e){return _0x3b123e[_0x2070('0x29')]()[_0x2070('0x28')](function(){_0x4492d5['status'](0xcc)[_0x2070('0x1e')]();});}};}function handleEntityNotFound(_0x6ee164,_0x5715c9){return function(_0x58274f){if(!_0x58274f){_0x6ee164['sendStatus'](0x194);}return _0x58274f;};}function handleError(_0x580beb,_0x495646){_0x495646=_0x495646||0x1f4;return function(_0x2e9a22){logger[_0x2070('0x2a')](_0x2e9a22[_0x2070('0x2b')]);if(_0x2e9a22[_0x2070('0x2c')]){delete _0x2e9a22['name'];}_0x580beb[_0x2070('0x1d')](_0x495646)[_0x2070('0x2d')](_0x2e9a22);};}exports[_0x2070('0x2e')]=function(_0x25cb9d,_0x173369){var _0x3dd044={},_0x5d2a55={},_0x3c7cbc={'count':0x0,'rows':[]};var _0x4ff002=_[_0x2070('0x2f')](db[_0x2070('0x30')][_0x2070('0x31')],function(_0x5b6e5c){return{'name':_0x5b6e5c[_0x2070('0x32')],'type':_0x5b6e5c['type'][_0x2070('0x33')]};});_0x5d2a55[_0x2070('0x34')]=_[_0x2070('0x2f')](_0x4ff002,_0x2070('0x2c'));_0x5d2a55['query']=_[_0x2070('0x35')](_0x25cb9d[_0x2070('0x36')]);_0x5d2a55[_0x2070('0x37')]=_['intersection'](_0x5d2a55[_0x2070('0x34')],_0x5d2a55[_0x2070('0x36')]);_0x3dd044[_0x2070('0x38')]=_[_0x2070('0x39')](_0x5d2a55['model'],qs[_0x2070('0x3a')](_0x25cb9d[_0x2070('0x36')][_0x2070('0x3a')]));_0x3dd044[_0x2070('0x38')]=_0x3dd044[_0x2070('0x38')][_0x2070('0x3b')]?_0x3dd044[_0x2070('0x38')]:_0x5d2a55[_0x2070('0x34')];if(!_0x25cb9d['query'][_0x2070('0x3c')]('nolimit')){_0x3dd044[_0x2070('0x22')]=qs[_0x2070('0x22')](_0x25cb9d[_0x2070('0x36')][_0x2070('0x22')]);_0x3dd044[_0x2070('0x20')]=qs[_0x2070('0x20')](_0x25cb9d['query'][_0x2070('0x20')]);}_0x3dd044[_0x2070('0x3d')]=qs[_0x2070('0x3e')](_0x25cb9d['query'][_0x2070('0x3e')]);_0x3dd044[_0x2070('0x3f')]=qs['filters'](_[_0x2070('0x40')](_0x25cb9d[_0x2070('0x36')],_0x5d2a55[_0x2070('0x37')]),_0x4ff002);if(_0x25cb9d[_0x2070('0x36')][_0x2070('0x41')]){_0x3dd044[_0x2070('0x3f')]=_[_0x2070('0x42')](_0x3dd044[_0x2070('0x3f')],{'$or':_[_0x2070('0x2f')](_0x4ff002,function(_0x51bbef){if(_0x51bbef['type']!=='VIRTUAL'){var _0x112755={};_0x112755[_0x51bbef['name']]={'$like':'%'+_0x25cb9d[_0x2070('0x36')][_0x2070('0x41')]+'%'};return _0x112755;}})});}_0x3dd044=_[_0x2070('0x42')]({},_0x3dd044,_0x25cb9d['options']);var _0x118fd2={'where':_0x3dd044[_0x2070('0x3f')]};return db[_0x2070('0x30')][_0x2070('0x23')](_0x118fd2)[_0x2070('0x28')](function(_0x53ce7b){_0x3c7cbc[_0x2070('0x23')]=_0x53ce7b;if(_0x25cb9d['query']['includeAll']){_0x3dd044['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2070('0x43')](_0x3dd044);})[_0x2070('0x28')](function(_0x5b5fbb){_0x3c7cbc['rows']=_0x5b5fbb;return _0x3c7cbc;})[_0x2070('0x28')](respondWithFilteredResult(_0x173369,_0x3dd044))[_0x2070('0x44')](handleError(_0x173369,null));};exports[_0x2070('0x45')]=function(_0x4d4ac5,_0x56a936){var _0x5f3462={'raw':!![],'where':{'id':_0x4d4ac5['params']['id']}},_0x19d409={};_0x19d409[_0x2070('0x34')]=_['keys'](db[_0x2070('0x30')]['rawAttributes']);_0x19d409['query']=_['keys'](_0x4d4ac5[_0x2070('0x36')]);_0x19d409[_0x2070('0x37')]=_[_0x2070('0x39')](_0x19d409[_0x2070('0x34')],_0x19d409[_0x2070('0x36')]);_0x5f3462[_0x2070('0x38')]=_[_0x2070('0x39')](_0x19d409[_0x2070('0x34')],qs['fields'](_0x4d4ac5[_0x2070('0x36')][_0x2070('0x3a')]));_0x5f3462[_0x2070('0x38')]=_0x5f3462[_0x2070('0x38')]['length']?_0x5f3462[_0x2070('0x38')]:_0x19d409[_0x2070('0x34')];if(_0x4d4ac5[_0x2070('0x36')]['includeAll']){_0x5f3462[_0x2070('0x46')]=[{'all':!![]}];}_0x5f3462=_['merge']({},_0x5f3462,_0x4d4ac5['options']);return db[_0x2070('0x30')]['find'](_0x5f3462)['then'](handleEntityNotFound(_0x56a936,null))[_0x2070('0x28')](respondWithResult(_0x56a936,null))[_0x2070('0x44')](handleError(_0x56a936,null));};exports[_0x2070('0x47')]=function(_0x305591,_0x488393){return db['ChatInternalMessage'][_0x2070('0x47')](_0x305591[_0x2070('0x48')],{})[_0x2070('0x28')](respondWithResult(_0x488393,0xc9))[_0x2070('0x44')](handleError(_0x488393,null));};exports['update']=function(_0x3c8c5c,_0x40f958){if(_0x3c8c5c[_0x2070('0x48')]['id']){delete _0x3c8c5c[_0x2070('0x48')]['id'];}return db[_0x2070('0x30')][_0x2070('0x49')]({'where':{'id':_0x3c8c5c[_0x2070('0x4a')]['id']}})[_0x2070('0x28')](handleEntityNotFound(_0x40f958,null))['then'](saveUpdates(_0x3c8c5c[_0x2070('0x48')],null))[_0x2070('0x28')](respondWithResult(_0x40f958,null))[_0x2070('0x44')](handleError(_0x40f958,null));};exports[_0x2070('0x29')]=function(_0x556b31,_0xb2b951){return db[_0x2070('0x30')][_0x2070('0x49')]({'where':{'id':_0x556b31[_0x2070('0x4a')]['id']}})[_0x2070('0x28')](handleEntityNotFound(_0xb2b951,null))[_0x2070('0x28')](removeEntity(_0xb2b951,null))['catch'](handleError(_0xb2b951,null));};exports['describe']=function(_0x3a25bc,_0x7e785d){return db[_0x2070('0x30')]['describe']()[_0x2070('0x28')](respondWithResult(_0x7e785d,null))['catch'](handleError(_0x7e785d,null));};function wrapUser(_0x18a42e){return function(_0x303a37){var _0x5d584d=_0x18a42e[_0x2070('0x4b')]({'plain':!![]});_0x5d584d[_0x2070('0x4c')]=[];if(_0x303a37){_0x5d584d[_0x2070('0x4d')]=_0x303a37[_0x2070('0x4e')];_0x5d584d[_0x2070('0x4f')]=_0x303a37;}else{_0x5d584d[_0x2070('0x4d')]=moment(0x0)[_0x2070('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d584d['lastMessage']={};}return _0x5d584d;};}exports['getUsers']=function(_0x5e363d,_0x180323,_0x4dce00){var _0x252f08=[];return db[_0x2070('0x51')][_0x2070('0x43')]({'where':{'role':['agent',_0x2070('0x52'),_0x2070('0x53')]},'attributes':['id','fullname',_0x2070('0x2c'),_0x2070('0x54'),_0x2070('0x55'),'internal','online',_0x2070('0x56'),_0x2070('0x57'),_0x2070('0x58')],'order':qs['sort']('-online'),'include':[{'model':db[_0x2070('0x59')],'as':'VoiceQueues','attributes':['id',_0x2070('0x2c'),'type'],'through':{'attributes':[]}}]})[_0x2070('0x28')](function(_0x47a8e7){if(_0x47a8e7){var _0x50c445=_0x5e363d[_0x2070('0x53')][_0x2070('0x4b')]({'plain':!![]});if(!_0x50c445)throw new Error(_0x2070('0x5a'));if(_0x50c445['role']===_0x2070('0x53')){return db[_0x2070('0x5b')][_0x2070('0x49')]({'where':{'name':_0x2070('0x5c'),'userProfileId':_0x50c445['userProfileId']},'raw':!![]})[_0x2070('0x28')](function(_0x1fc242){if(_0x1fc242){if(_0x1fc242[_0x2070('0x5d')]===0x0){return db[_0x2070('0x5e')]['findAll']({'where':{'sectionId':_0x1fc242['id']},'raw':!![]})[_0x2070('0x28')](function(_0x27b732){var _0x2bcf86=[];if(_[_0x2070('0x5f')](_0x27b732)){_0x2bcf86=_[_0x2070('0x41')](_0x47a8e7,function(_0x3423ae){if(_0x3423ae[_0x2070('0x54')]!==_0x2070('0x60')){return _0x3423ae;}});return _0x2bcf86;}else{for(var _0x36169a=0x0;_0x36169a<_0x47a8e7[_0x2070('0x3b')];_0x36169a++){var _0x535e85=_0x47a8e7[_0x36169a];if(_0x535e85[_0x2070('0x54')]===_0x2070('0x60')){var _0x327327=_[_0x2070('0x49')](_0x27b732,function(_0x2e9387){return _0x2e9387[_0x2070('0x61')]===_0x535e85['id'];});if(_0x327327)_0x2bcf86[_0x2070('0x62')](_0x535e85);}else{_0x2bcf86[_0x2070('0x62')](_0x535e85);}}return _0x2bcf86;}});}else{return _0x47a8e7;}}else{var _0x57e5b7=_['filter'](_0x47a8e7,function(_0x3ac9cb){if(_0x3ac9cb[_0x2070('0x54')]!=='agent'){return _0x3ac9cb;}});return _0x57e5b7;}});}else{return _0x47a8e7;}}})[_0x2070('0x28')](function(_0x103172){var _0x5bdabe=[];if(_0x103172){_0x252f08=_0x103172;for(var _0x4f3325=0x0;_0x4f3325<_0x103172[_0x2070('0x3b')];_0x4f3325+=0x1){_0x252f08[_0x4f3325]['messages']=[];_0x5bdabe[_0x2070('0x62')](db['ChatInternalMessage'][_0x2070('0x49')]({'where':{'FromId':[_0x5e363d['user']['id'],_0x103172[_0x4f3325]['id']],'ToId':[_0x5e363d[_0x2070('0x53')]['id'],_0x103172[_0x4f3325]['id']],'ChatGroupId':null},'attributes':['id',_0x2070('0x4e'),_0x2070('0x63'),_0x2070('0x64'),_0x2070('0x65'),_0x2070('0x48')],'order':qs[_0x2070('0x3e')](_0x2070('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2070('0x28')](wrapUser(_0x103172[_0x4f3325])));}return BPromise['all'](_0x5bdabe);}return[];})['then'](function(_0x37bfe3){return{'rows':_0x37bfe3,'count':_0x37bfe3[_0x2070('0x3b')]};})[_0x2070('0x28')](respondWithResult(_0x180323,null))['catch'](handleError(_0x180323,null));}; \ No newline at end of file +var _0x5ca6=['Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','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','defaults','redis','localhost','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','ChatInternalMessage','fieldName','type','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','options','includeAll','include','show','params','keys','find','create','body','catch','describe','get','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','online','-online','VoiceQueue','VoiceQueues','role','UserProfileSection'];(function(_0x277d51,_0x31c8ed){var _0xc569fe=function(_0x257c5b){while(--_0x257c5b){_0x277d51['push'](_0x277d51['shift']());}};_0xc569fe(++_0x31c8ed);}(_0x5ca6,0x1ae));var _0x65ca=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x5ca6[_0xc87d08];return _0x30a714;};'use strict';var emlformat=require(_0x65ca('0x0'));var rimraf=require(_0x65ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65ca('0x2'));var moment=require('moment');var BPromise=require(_0x65ca('0x3'));var Mustache=require(_0x65ca('0x4'));var util=require(_0x65ca('0x5'));var path=require('path');var sox=require(_0x65ca('0x6'));var csv=require(_0x65ca('0x7'));var ejs=require(_0x65ca('0x8'));var fs=require('fs');var fs_extra=require(_0x65ca('0x9'));var _=require('lodash');var squel=require(_0x65ca('0xa'));var crypto=require('crypto');var jsforce=require(_0x65ca('0xb'));var deskjs=require(_0x65ca('0xc'));var toCsv=require(_0x65ca('0x7'));var querystring=require(_0x65ca('0xd'));var Papa=require(_0x65ca('0xe'));var Redis=require(_0x65ca('0xf'));var authService=require(_0x65ca('0x10'));var qs=require(_0x65ca('0x11'));var as=require(_0x65ca('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65ca('0x13'))(_0x65ca('0x14'));var utils=require(_0x65ca('0x15'));var config=require(_0x65ca('0x16'));var licenseUtil=require(_0x65ca('0x17'));var db=require(_0x65ca('0x18'))['db'];config['redis']=_[_0x65ca('0x19')](config[_0x65ca('0x1a')],{'host':_0x65ca('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65ca('0x1a')]));require(_0x65ca('0x1c'))['register'](socket);function respondWithStatusCode(_0x19f6e4,_0x1d67e5){_0x1d67e5=_0x1d67e5||0xcc;return function(_0x1b27f1){if(_0x1b27f1){return _0x19f6e4['sendStatus'](_0x1d67e5);}return _0x19f6e4[_0x65ca('0x1d')](_0x1d67e5)[_0x65ca('0x1e')]();};}function respondWithResult(_0x394eee,_0x4fe99a){_0x4fe99a=_0x4fe99a||0xc8;return function(_0x57b949){if(_0x57b949){return _0x394eee[_0x65ca('0x1d')](_0x4fe99a)[_0x65ca('0x1f')](_0x57b949);}};}function respondWithFilteredResult(_0x32f7cf,_0x54758e){return function(_0x36bcfe){if(_0x36bcfe){var _0x24c366=typeof _0x54758e[_0x65ca('0x20')]===_0x65ca('0x21')&&typeof _0x54758e[_0x65ca('0x22')]===_0x65ca('0x21');var _0xd6d101=_0x36bcfe[_0x65ca('0x23')];var _0x33f52e=_0x24c366?0x0:_0x54758e[_0x65ca('0x20')];var _0x3509cb=_0x24c366?_0x36bcfe['count']:_0x54758e[_0x65ca('0x20')]+_0x54758e[_0x65ca('0x22')];var _0x2c3bb7;if(_0x3509cb>=_0xd6d101){_0x3509cb=_0xd6d101;_0x2c3bb7=0xc8;}else{_0x2c3bb7=0xce;}_0x32f7cf[_0x65ca('0x1d')](_0x2c3bb7);return _0x32f7cf[_0x65ca('0x24')](_0x65ca('0x25'),_0x33f52e+'-'+_0x3509cb+'/'+_0xd6d101)[_0x65ca('0x1f')](_0x36bcfe);}return null;};}function patchUpdates(_0x930c57){return function(_0x59db96){try{jsonpatch[_0x65ca('0x26')](_0x59db96,_0x930c57,!![]);}catch(_0x11a40e){return BPromise[_0x65ca('0x27')](_0x11a40e);}return _0x59db96[_0x65ca('0x28')]();};}function saveUpdates(_0x56e6bd,_0xfdc2d4){return function(_0x2d3dfa){if(_0x2d3dfa){return _0x2d3dfa[_0x65ca('0x29')](_0x56e6bd)[_0x65ca('0x2a')](function(_0x52c2ab){return _0x52c2ab;});}return null;};}function removeEntity(_0x2f34ba,_0x56a547){return function(_0x52f8ff){if(_0x52f8ff){return _0x52f8ff[_0x65ca('0x2b')]()['then'](function(){_0x2f34ba[_0x65ca('0x1d')](0xcc)[_0x65ca('0x1e')]();});}};}function handleEntityNotFound(_0xf5569a,_0x223fbe){return function(_0x18bebd){if(!_0x18bebd){_0xf5569a['sendStatus'](0x194);}return _0x18bebd;};}function handleError(_0x41c373,_0x32d30d){_0x32d30d=_0x32d30d||0x1f4;return function(_0x399e0f){logger[_0x65ca('0x2c')](_0x399e0f['stack']);if(_0x399e0f[_0x65ca('0x2d')]){delete _0x399e0f['name'];}_0x41c373[_0x65ca('0x1d')](_0x32d30d)[_0x65ca('0x2e')](_0x399e0f);};}exports['index']=function(_0x431357,_0x2b95bc){var _0x22257c={},_0x258e9f={},_0x2123e2={'count':0x0,'rows':[]};var _0x75b3f7=_['map'](db[_0x65ca('0x2f')]['rawAttributes'],function(_0x3c56b8){return{'name':_0x3c56b8[_0x65ca('0x30')],'type':_0x3c56b8[_0x65ca('0x31')]['key']};});_0x258e9f['model']=_['map'](_0x75b3f7,_0x65ca('0x2d'));_0x258e9f[_0x65ca('0x32')]=_['keys'](_0x431357[_0x65ca('0x32')]);_0x258e9f['filters']=_[_0x65ca('0x33')](_0x258e9f['model'],_0x258e9f[_0x65ca('0x32')]);_0x22257c[_0x65ca('0x34')]=_[_0x65ca('0x33')](_0x258e9f[_0x65ca('0x35')],qs[_0x65ca('0x36')](_0x431357[_0x65ca('0x32')][_0x65ca('0x36')]));_0x22257c['attributes']=_0x22257c['attributes'][_0x65ca('0x37')]?_0x22257c['attributes']:_0x258e9f['model'];if(!_0x431357[_0x65ca('0x32')][_0x65ca('0x38')](_0x65ca('0x39'))){_0x22257c[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x431357[_0x65ca('0x32')][_0x65ca('0x22')]);_0x22257c[_0x65ca('0x20')]=qs['offset'](_0x431357['query'][_0x65ca('0x20')]);}_0x22257c['order']=qs[_0x65ca('0x3a')](_0x431357[_0x65ca('0x32')][_0x65ca('0x3a')]);_0x22257c[_0x65ca('0x3b')]=qs[_0x65ca('0x3c')](_[_0x65ca('0x3d')](_0x431357[_0x65ca('0x32')],_0x258e9f[_0x65ca('0x3c')]),_0x75b3f7);if(_0x431357[_0x65ca('0x32')][_0x65ca('0x3e')]){_0x22257c['where']=_['merge'](_0x22257c[_0x65ca('0x3b')],{'$or':_[_0x65ca('0x3f')](_0x75b3f7,function(_0x2ead77){if(_0x2ead77['type']!=='VIRTUAL'){var _0x2e3358={};_0x2e3358[_0x2ead77[_0x65ca('0x2d')]]={'$like':'%'+_0x431357[_0x65ca('0x32')][_0x65ca('0x3e')]+'%'};return _0x2e3358;}})});}_0x22257c=_[_0x65ca('0x40')]({},_0x22257c,_0x431357[_0x65ca('0x41')]);var _0x23d8ea={'where':_0x22257c['where']};return db[_0x65ca('0x2f')]['count'](_0x23d8ea)[_0x65ca('0x2a')](function(_0x351999){_0x2123e2[_0x65ca('0x23')]=_0x351999;if(_0x431357[_0x65ca('0x32')][_0x65ca('0x42')]){_0x22257c[_0x65ca('0x43')]=[{'all':!![]}];}return db[_0x65ca('0x2f')]['findAll'](_0x22257c);})[_0x65ca('0x2a')](function(_0x2e4275){_0x2123e2['rows']=_0x2e4275;return _0x2123e2;})[_0x65ca('0x2a')](respondWithFilteredResult(_0x2b95bc,_0x22257c))['catch'](handleError(_0x2b95bc,null));};exports[_0x65ca('0x44')]=function(_0x283ec6,_0x5e056c){var _0x1fe50c={'raw':!![],'where':{'id':_0x283ec6[_0x65ca('0x45')]['id']}},_0x9a6f57={};_0x9a6f57[_0x65ca('0x35')]=_[_0x65ca('0x46')](db[_0x65ca('0x2f')]['rawAttributes']);_0x9a6f57[_0x65ca('0x32')]=_[_0x65ca('0x46')](_0x283ec6[_0x65ca('0x32')]);_0x9a6f57[_0x65ca('0x3c')]=_[_0x65ca('0x33')](_0x9a6f57[_0x65ca('0x35')],_0x9a6f57[_0x65ca('0x32')]);_0x1fe50c['attributes']=_['intersection'](_0x9a6f57[_0x65ca('0x35')],qs[_0x65ca('0x36')](_0x283ec6[_0x65ca('0x32')][_0x65ca('0x36')]));_0x1fe50c[_0x65ca('0x34')]=_0x1fe50c['attributes'][_0x65ca('0x37')]?_0x1fe50c[_0x65ca('0x34')]:_0x9a6f57[_0x65ca('0x35')];if(_0x283ec6[_0x65ca('0x32')][_0x65ca('0x42')]){_0x1fe50c[_0x65ca('0x43')]=[{'all':!![]}];}_0x1fe50c=_['merge']({},_0x1fe50c,_0x283ec6[_0x65ca('0x41')]);return db['ChatInternalMessage'][_0x65ca('0x47')](_0x1fe50c)[_0x65ca('0x2a')](handleEntityNotFound(_0x5e056c,null))[_0x65ca('0x2a')](respondWithResult(_0x5e056c,null))['catch'](handleError(_0x5e056c,null));};exports['create']=function(_0xbc8323,_0x2f1203){return db[_0x65ca('0x2f')][_0x65ca('0x48')](_0xbc8323[_0x65ca('0x49')],{})[_0x65ca('0x2a')](respondWithResult(_0x2f1203,0xc9))[_0x65ca('0x4a')](handleError(_0x2f1203,null));};exports[_0x65ca('0x29')]=function(_0x148c0a,_0x11922d){if(_0x148c0a['body']['id']){delete _0x148c0a[_0x65ca('0x49')]['id'];}return db[_0x65ca('0x2f')]['find']({'where':{'id':_0x148c0a[_0x65ca('0x45')]['id']}})[_0x65ca('0x2a')](handleEntityNotFound(_0x11922d,null))[_0x65ca('0x2a')](saveUpdates(_0x148c0a[_0x65ca('0x49')],null))[_0x65ca('0x2a')](respondWithResult(_0x11922d,null))[_0x65ca('0x4a')](handleError(_0x11922d,null));};exports[_0x65ca('0x2b')]=function(_0x1b401c,_0x265ff9){return db[_0x65ca('0x2f')][_0x65ca('0x47')]({'where':{'id':_0x1b401c[_0x65ca('0x45')]['id']}})[_0x65ca('0x2a')](handleEntityNotFound(_0x265ff9,null))[_0x65ca('0x2a')](removeEntity(_0x265ff9,null))['catch'](handleError(_0x265ff9,null));};exports[_0x65ca('0x4b')]=function(_0x294fbf,_0x5e7fb2){return db[_0x65ca('0x2f')]['describe']()[_0x65ca('0x2a')](respondWithResult(_0x5e7fb2,null))[_0x65ca('0x4a')](handleError(_0x5e7fb2,null));};function wrapUser(_0x42fcbe){return function(_0x2724b8){var _0x51b1b8=_0x42fcbe[_0x65ca('0x4c')]({'plain':!![]});_0x51b1b8[_0x65ca('0x4d')]=[];if(_0x2724b8){_0x51b1b8['lastMessageAt']=_0x2724b8[_0x65ca('0x4e')];_0x51b1b8['lastMessage']=_0x2724b8;}else{_0x51b1b8[_0x65ca('0x4f')]=moment(0x0)[_0x65ca('0x50')](_0x65ca('0x51'));_0x51b1b8[_0x65ca('0x52')]={};}return _0x51b1b8;};}exports[_0x65ca('0x53')]=function(_0x37627c,_0x54d413,_0x39565d){var _0x2d9d41=[];return db[_0x65ca('0x54')][_0x65ca('0x55')]({'where':{'role':[_0x65ca('0x56'),_0x65ca('0x57'),_0x65ca('0x58')]},'attributes':['id','fullname',_0x65ca('0x2d'),'role','userpic','internal',_0x65ca('0x59'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs['sort'](_0x65ca('0x5a')),'include':[{'model':db[_0x65ca('0x5b')],'as':_0x65ca('0x5c'),'attributes':['id',_0x65ca('0x2d'),_0x65ca('0x31')],'through':{'attributes':[]}}]})[_0x65ca('0x2a')](function(_0x1536b3){if(_0x1536b3){var _0x5cd53a=_0x37627c['user']['get']({'plain':!![]});if(!_0x5cd53a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cd53a[_0x65ca('0x5d')]==='user'){return db[_0x65ca('0x5e')][_0x65ca('0x47')]({'where':{'name':_0x65ca('0x5f'),'userProfileId':_0x5cd53a[_0x65ca('0x60')]},'raw':!![]})[_0x65ca('0x2a')](function(_0x2d4fb7){if(_0x2d4fb7){if(_0x2d4fb7[_0x65ca('0x61')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2d4fb7['id']},'raw':!![]})[_0x65ca('0x2a')](function(_0x10c6f1){var _0x59113b=[];if(_[_0x65ca('0x62')](_0x10c6f1)){_0x59113b=_['filter'](_0x1536b3,function(_0x1575f3){if(_0x1575f3[_0x65ca('0x5d')]!=='agent'){return _0x1575f3;}});return _0x59113b;}else{for(var _0x3793a8=0x0;_0x3793a8<_0x1536b3['length'];_0x3793a8++){var _0x3edc82=_0x1536b3[_0x3793a8];if(_0x3edc82[_0x65ca('0x5d')]===_0x65ca('0x56')){var _0x319b62=_[_0x65ca('0x47')](_0x10c6f1,function(_0x3585e5){return _0x3585e5[_0x65ca('0x63')]===_0x3edc82['id'];});if(_0x319b62)_0x59113b[_0x65ca('0x64')](_0x3edc82);}else{_0x59113b[_0x65ca('0x64')](_0x3edc82);}}return _0x59113b;}});}else{return _0x1536b3;}}else{var _0x173ff6=_[_0x65ca('0x3e')](_0x1536b3,function(_0xd58d18){if(_0xd58d18[_0x65ca('0x5d')]!==_0x65ca('0x56')){return _0xd58d18;}});return _0x173ff6;}});}else{return _0x1536b3;}}})[_0x65ca('0x2a')](function(_0x6e2e24){var _0x52766f=[];if(_0x6e2e24){_0x2d9d41=_0x6e2e24;for(var _0x58b224=0x0;_0x58b224<_0x6e2e24['length'];_0x58b224+=0x1){_0x2d9d41[_0x58b224]['messages']=[];_0x52766f['push'](db[_0x65ca('0x2f')]['find']({'where':{'FromId':[_0x37627c[_0x65ca('0x58')]['id'],_0x6e2e24[_0x58b224]['id']],'ToId':[_0x37627c[_0x65ca('0x58')]['id'],_0x6e2e24[_0x58b224]['id']],'ChatGroupId':null},'attributes':['id',_0x65ca('0x4e'),_0x65ca('0x65'),_0x65ca('0x66'),'read',_0x65ca('0x49')],'order':qs[_0x65ca('0x3a')](_0x65ca('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x65ca('0x2a')](wrapUser(_0x6e2e24[_0x58b224])));}return BPromise[_0x65ca('0x68')](_0x52766f);}return[];})[_0x65ca('0x2a')](function(_0x50121b){return{'rows':_0x50121b,'count':_0x50121b['length']};})[_0x65ca('0x2a')](respondWithResult(_0x54d413,null))[_0x65ca('0x4a')](handleError(_0x54d413,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 37840e3..db7dde5 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 _0xa132=['emit','hasOwnProperty','events','ChatInternalMessage','update','remove'];(function(_0x15e984,_0x96bb9){var _0x2b24d0=function(_0xf5e20a){while(--_0xf5e20a){_0x15e984['push'](_0x15e984['shift']());}};_0x2b24d0(++_0x96bb9);}(_0xa132,0x14c));var _0x2a13=function(_0x33d714,_0x57642e){_0x33d714=_0x33d714-0x0;var _0x71c1ad=_0xa132[_0x33d714];return _0x71c1ad;};'use strict';var EventEmitter=require(_0x2a13('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x2a13('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2a13('0x2'),'afterDestroy':_0x2a13('0x3')};function emitEvent(_0x1ec7f2){return function(_0x1a98bc,_0x1b331a,_0x3a9023){ChatInternalMessageEvents['emit'](_0x1ec7f2+':'+_0x1a98bc['id'],_0x1a98bc);ChatInternalMessageEvents[_0x2a13('0x4')](_0x1ec7f2,_0x1a98bc);_0x3a9023(null);};}for(var e in events){if(events[_0x2a13('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x9a4d=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9a4d,0xb7));var _0xd9a4=function(_0x563129,_0x26d5f9){_0x563129=_0x563129-0x0;var _0x28d1a3=_0x9a4d[_0x563129];return _0x28d1a3;};'use strict';var EventEmitter=require(_0xd9a4('0x0'));var ChatInternalMessage=require(_0xd9a4('0x1'))['db'][_0xd9a4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd9a4('0x3')](0x0);var events={'afterCreate':_0xd9a4('0x4'),'afterUpdate':'update','afterDestroy':_0xd9a4('0x5')};function emitEvent(_0x386d89){return function(_0x411faf,_0x124aa3,_0xeae116){ChatInternalMessageEvents[_0xd9a4('0x6')](_0x386d89+':'+_0x411faf['id'],_0x411faf);ChatInternalMessageEvents[_0xd9a4('0x6')](_0x386d89,_0x411faf);_0xeae116(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xd9a4('0x7')](e,emitEvent(event));}}module[_0xd9a4('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 d696321..bf2134a 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 _0x0f3a=['path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','lodash','util','../../config/logger','api','request-promise'];(function(_0x2b632b,_0x125f43){var _0x23253a=function(_0x569760){while(--_0x569760){_0x2b632b['push'](_0x2b632b['shift']());}};_0x23253a(++_0x125f43);}(_0x0f3a,0xbb));var _0xa0f3=function(_0x18e8f5,_0x230fbf){_0x18e8f5=_0x18e8f5-0x0;var _0x44a277=_0x0f3a[_0x18e8f5];return _0x44a277;};'use strict';var _=require(_0xa0f3('0x0'));var util=require(_0xa0f3('0x1'));var logger=require(_0xa0f3('0x2'))(_0xa0f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa0f3('0x4'));var fs=require('fs');var path=require(_0xa0f3('0x5'));var rimraf=require(_0xa0f3('0x6'));var config=require('../../config/environment');var attributes=require(_0xa0f3('0x7'));module[_0xa0f3('0x8')]=function(_0x457879,_0x250f0a){return _0x457879[_0xa0f3('0x9')](_0xa0f3('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa0f3('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa22d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa22d,0x13b));var _0xda22=function(_0xc5c526,_0x5e3b32){_0xc5c526=_0xc5c526-0x0;var _0x32bc6e=_0xa22d[_0xc5c526];return _0x32bc6e;};'use strict';var _=require(_0xda22('0x0'));var util=require(_0xda22('0x1'));var logger=require(_0xda22('0x2'))('api');var moment=require(_0xda22('0x3'));var BPromise=require(_0xda22('0x4'));var rp=require(_0xda22('0x5'));var fs=require('fs');var path=require(_0xda22('0x6'));var rimraf=require(_0xda22('0x7'));var config=require(_0xda22('0x8'));var attributes=require(_0xda22('0x9'));module[_0xda22('0xa')]=function(_0x39ed3c,_0x556ed5){return _0x39ed3c[_0xda22('0xb')](_0xda22('0xc'),attributes,{'tableName':_0xda22('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda22('0xe'),'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 ce45968..f6d6e4c 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 _0x2aef=['../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3937c7,_0x3499a4){var _0x432562=function(_0x2de914){while(--_0x2de914){_0x3937c7['push'](_0x3937c7['shift']());}};_0x432562(++_0x3499a4);}(_0x2aef,0x122));var _0xf2ae=function(_0x243716,_0x1d896c){_0x243716=_0x243716-0x0;var _0xf547f1=_0x2aef[_0x243716];return _0xf547f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf2ae('0x0'));var rs=require(_0xf2ae('0x1'));var fs=require('fs');var Redis=require(_0xf2ae('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2ae('0x3'));var logger=require(_0xf2ae('0x4'))('rpc');var config=require(_0xf2ae('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf2ae('0x6')][_0xf2ae('0x7')]({'port':0x232a});config['redis']=_[_0xf2ae('0x8')](config[_0xf2ae('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2ae('0xa'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x257c86,_0x143a8c,_0x401f26){return new BPromise(function(_0x50f544,_0xdcaf7a){return client['request'](_0x257c86,_0x401f26)['then'](function(_0x79e05e){logger[_0xf2ae('0xb')]('ChatInternalMessage,\x20%s,\x20%s',_0x143a8c,_0xf2ae('0xc'));logger[_0xf2ae('0xd')](_0xf2ae('0xe'),_0x143a8c,_0xf2ae('0xc'),JSON[_0xf2ae('0xf')](_0x79e05e));if(_0x79e05e['error']){if(_0x79e05e['error']['code']===0x1f4){logger[_0xf2ae('0x10')](_0xf2ae('0x11'),_0x143a8c,_0x79e05e[_0xf2ae('0x10')][_0xf2ae('0x12')]);return _0xdcaf7a(_0x79e05e[_0xf2ae('0x10')][_0xf2ae('0x12')]);}logger[_0xf2ae('0x10')](_0xf2ae('0x11'),_0x143a8c,_0x79e05e['error'][_0xf2ae('0x12')]);return _0x50f544(_0x79e05e[_0xf2ae('0x10')][_0xf2ae('0x12')]);}else{logger['info'](_0xf2ae('0x11'),_0x143a8c,'request\x20sent');_0x50f544(_0x79e05e[_0xf2ae('0x13')]['message']);}})[_0xf2ae('0x14')](function(_0x39d561){logger[_0xf2ae('0x10')](_0xf2ae('0x11'),_0x143a8c,_0x39d561);_0xdcaf7a(_0x39d561);});});} \ No newline at end of file +var _0xebe7=['randomstring','ioredis','../../config/logger','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3c2781,_0x50e44b){var _0xafd317=function(_0x183da4){while(--_0x183da4){_0x3c2781['push'](_0x3c2781['shift']());}};_0xafd317(++_0x50e44b);}(_0xebe7,0x165));var _0x7ebe=function(_0x65ce4e,_0x208069){_0x65ce4e=_0x65ce4e-0x0;var _0x1f68a2=_0xebe7[_0x65ce4e];return _0x1f68a2;};'use strict';var _=require(_0x7ebe('0x0'));var util=require(_0x7ebe('0x1'));var moment=require(_0x7ebe('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ebe('0x3'));var fs=require('fs');var Redis=require(_0x7ebe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ebe('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7ebe('0x6'));var client=jayson['client'][_0x7ebe('0x7')]({'port':0x232a});config[_0x7ebe('0x8')]=_['defaults'](config[_0x7ebe('0x8')],{'host':_0x7ebe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ebe('0x8')]));require(_0x7ebe('0xa'))[_0x7ebe('0xb')](socket);function respondWithRpcPromise(_0x57cd3a,_0x46e234,_0x497142){return new BPromise(function(_0x502dcc,_0x12b07f){return client[_0x7ebe('0xc')](_0x57cd3a,_0x497142)['then'](function(_0xf4e5b9){logger[_0x7ebe('0xd')](_0x7ebe('0xe'),_0x46e234,_0x7ebe('0xf'));logger[_0x7ebe('0x10')](_0x7ebe('0x11'),_0x46e234,_0x7ebe('0xf'),JSON[_0x7ebe('0x12')](_0xf4e5b9));if(_0xf4e5b9[_0x7ebe('0x13')]){if(_0xf4e5b9[_0x7ebe('0x13')][_0x7ebe('0x14')]===0x1f4){logger['error'](_0x7ebe('0xe'),_0x46e234,_0xf4e5b9[_0x7ebe('0x13')][_0x7ebe('0x15')]);return _0x12b07f(_0xf4e5b9[_0x7ebe('0x13')][_0x7ebe('0x15')]);}logger[_0x7ebe('0x13')](_0x7ebe('0xe'),_0x46e234,_0xf4e5b9[_0x7ebe('0x13')][_0x7ebe('0x15')]);return _0x502dcc(_0xf4e5b9[_0x7ebe('0x13')][_0x7ebe('0x15')]);}else{logger[_0x7ebe('0xd')](_0x7ebe('0xe'),_0x46e234,_0x7ebe('0xf'));_0x502dcc(_0xf4e5b9[_0x7ebe('0x16')][_0x7ebe('0x15')]);}})[_0x7ebe('0x17')](function(_0x4de664){logger['error'](_0x7ebe('0xe'),_0x46e234,_0x4de664);_0x12b07f(_0x4de664);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3249f00..541c570 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 _0xb179=['length','chatInternalMessage:','update','emit','removeListener','register'];(function(_0x92af3b,_0x3b87e8){var _0x41e8ba=function(_0xf5cc5e){while(--_0xf5cc5e){_0x92af3b['push'](_0x92af3b['shift']());}};_0x41e8ba(++_0x3b87e8);}(_0xb179,0x188));var _0x9b17=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb179[_0x126558];return _0x1f6d14;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x9b17('0x0')];function createListener(_0x10bd39,_0x412ee9){return function(_0x48a998){_0x412ee9[_0x9b17('0x1')](_0x10bd39,_0x48a998);};}function removeListener(_0x505898,_0xb1fec0){return function(){ChatInternalMessageEvents[_0x9b17('0x2')](_0x505898,_0xb1fec0);};}exports[_0x9b17('0x3')]=function(_0x4c16b4){for(var _0x54d5dc=0x0,_0x3f5c92=events[_0x9b17('0x4')];_0x54d5dc<_0x3f5c92;_0x54d5dc++){var _0x396d0d=events[_0x54d5dc];var _0x324f60=createListener(_0x9b17('0x5')+_0x396d0d,_0x4c16b4);ChatInternalMessageEvents['on'](_0x396d0d,_0x324f60);}}; \ No newline at end of file +var _0xafd1=['removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x4e175a,_0x2bae34){var _0x2ff2c4=function(_0x2849eb){while(--_0x2849eb){_0x4e175a['push'](_0x4e175a['shift']());}};_0x2ff2c4(++_0x2bae34);}(_0xafd1,0x1e3));var _0x1afd=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0xafd1[_0x81f000];return _0x337aa2;};'use strict';var ChatInternalMessageEvents=require(_0x1afd('0x0'));var events=[_0x1afd('0x1'),_0x1afd('0x2'),_0x1afd('0x3')];function createListener(_0x254b2f,_0x3867f2){return function(_0x3da381){_0x3867f2[_0x1afd('0x4')](_0x254b2f,_0x3da381);};}function removeListener(_0x4ea749,_0x345893){return function(){ChatInternalMessageEvents[_0x1afd('0x5')](_0x4ea749,_0x345893);};}exports[_0x1afd('0x6')]=function(_0x409b28){for(var _0xda917f=0x0,_0x7765a0=events['length'];_0xda917f<_0x7765a0;_0xda917f++){var _0x8cfa7=events[_0xda917f];var _0x421e0a=createListener(_0x1afd('0x7')+_0x8cfa7,_0x409b28);ChatInternalMessageEvents['on'](_0x8cfa7,_0x421e0a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c36ece3..a6f5ec0 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 _0x1f16=['express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x471298,_0x391e0b){var _0x3d4b32=function(_0x99ca06){while(--_0x99ca06){_0x471298['push'](_0x471298['shift']());}};_0x3d4b32(++_0x391e0b);}(_0x1f16,0x100));var _0x61f1=function(_0x5914d1,_0x3a2175){_0x5914d1=_0x5914d1-0x0;var _0x6b109c=_0x1f16[_0x5914d1];return _0x6b109c;};'use strict';var multer=require(_0x61f1('0x0'));var util=require(_0x61f1('0x1'));var path=require(_0x61f1('0x2'));var timeout=require(_0x61f1('0x3'));var express=require(_0x61f1('0x4'));var router=express[_0x61f1('0x5')]();var fs_extra=require(_0x61f1('0x6'));var auth=require(_0x61f1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x61f1('0x8'));router[_0x61f1('0x9')]('/',auth[_0x61f1('0xa')](),controller['index']);router[_0x61f1('0x9')](_0x61f1('0xb'),auth[_0x61f1('0xa')](),controller[_0x61f1('0xc')]);router['get'](_0x61f1('0xd'),auth[_0x61f1('0xa')](),controller['getUsers']);router[_0x61f1('0x9')](_0x61f1('0xe'),auth[_0x61f1('0xa')](),controller[_0x61f1('0xf')]);router['post']('/',auth[_0x61f1('0xa')](),controller[_0x61f1('0x10')]);router[_0x61f1('0x11')]('/:id',controller['update']);router[_0x61f1('0x12')](_0x61f1('0xe'),auth[_0x61f1('0xa')](),controller['destroy']);module[_0x61f1('0x13')]=router; \ No newline at end of file +var _0xdfbd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/users','getUsers','/:id','show','post','put','update','delete','destroy','multer','util'];(function(_0x308950,_0x1e3dba){var _0x147cb6=function(_0x5d5bc2){while(--_0x5d5bc2){_0x308950['push'](_0x308950['shift']());}};_0x147cb6(++_0x1e3dba);}(_0xdfbd,0x178));var _0xddfb=function(_0x4cd8d0,_0x5f082d){_0x4cd8d0=_0x4cd8d0-0x0;var _0x42eec2=_0xdfbd[_0x4cd8d0];return _0x42eec2;};'use strict';var multer=require(_0xddfb('0x0'));var util=require(_0xddfb('0x1'));var path=require(_0xddfb('0x2'));var timeout=require(_0xddfb('0x3'));var express=require(_0xddfb('0x4'));var router=express[_0xddfb('0x5')]();var fs_extra=require(_0xddfb('0x6'));var auth=require(_0xddfb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xddfb('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xddfb('0x9')]('/',auth[_0xddfb('0xa')](),controller[_0xddfb('0xb')]);router[_0xddfb('0x9')]('/describe',auth[_0xddfb('0xa')](),controller['describe']);router[_0xddfb('0x9')](_0xddfb('0xc'),auth['isAuthenticated'](),controller[_0xddfb('0xd')]);router[_0xddfb('0x9')](_0xddfb('0xe'),auth['isAuthenticated'](),controller[_0xddfb('0xf')]);router[_0xddfb('0x10')]('/',auth[_0xddfb('0xa')](),controller['create']);router[_0xddfb('0x11')]('/:id',controller[_0xddfb('0x12')]);router[_0xddfb('0x13')]('/:id',auth[_0xddfb('0xa')](),controller[_0xddfb('0x14')]);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 7fb1029..429b06e 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 _0xb688=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','exports'];(function(_0x3a93b7,_0x658183){var _0x2ed891=function(_0x1a60de){while(--_0x1a60de){_0x3a93b7['push'](_0x3a93b7['shift']());}};_0x2ed891(++_0x658183);}(_0xb688,0xcf));var _0x8b68=function(_0x2395b9,_0x36f994){_0x2395b9=_0x2395b9-0x0;var _0x5a3892=_0xb688[_0x2395b9];return _0x5a3892;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'body':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b68('0x4')]('in','out'),'defaultValue':_0x8b68('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8b68('0x6')]},'providerName':{'type':Sequelize[_0x8b68('0x7')]},'providerResponse':{'type':Sequelize[_0x8b68('0x1')]}}; \ No newline at end of file +var _0x7033=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x129046,_0x519448){var _0x4d06d9=function(_0x425c26){while(--_0x425c26){_0x129046['push'](_0x129046['shift']());}};_0x4d06d9(++_0x519448);}(_0x7033,0x19e));var _0x3703=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7033[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'body':{'type':Sequelize[_0x3703('0x2')](_0x3703('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3703('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3703('0x5')]('in',_0x3703('0x6')),'defaultValue':_0x3703('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3703('0x7')]},'providerName':{'type':Sequelize[_0x3703('0x8')]},'providerResponse':{'type':Sequelize[_0x3703('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0f74a28..d4a73a3 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 _0xeafb=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','event','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0xeafb,0x1d1));var _0xbeaf=function(_0x2a1dd1,_0x3794df){_0x2a1dd1=_0x2a1dd1-0x0;var _0x132c45=_0xeafb[_0x2a1dd1];return _0x132c45;};'use strict';var emlformat=require(_0xbeaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbeaf('0x1'));var jsonpatch=require(_0xbeaf('0x2'));var rp=require(_0xbeaf('0x3'));var moment=require(_0xbeaf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbeaf('0x5'));var util=require(_0xbeaf('0x6'));var path=require(_0xbeaf('0x7'));var sox=require(_0xbeaf('0x8'));var csv=require(_0xbeaf('0x9'));var ejs=require(_0xbeaf('0xa'));var fs=require('fs');var fs_extra=require(_0xbeaf('0xb'));var _=require('lodash');var squel=require(_0xbeaf('0xc'));var crypto=require(_0xbeaf('0xd'));var jsforce=require(_0xbeaf('0xe'));var deskjs=require(_0xbeaf('0xf'));var toCsv=require(_0xbeaf('0x9'));var querystring=require('querystring');var Papa=require(_0xbeaf('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeaf('0x11'));var logger=require(_0xbeaf('0x12'))('api');var utils=require(_0xbeaf('0x13'));var config=require(_0xbeaf('0x14'));var licenseUtil=require(_0xbeaf('0x15'));var db=require(_0xbeaf('0x16'))['db'];config[_0xbeaf('0x17')]=_[_0xbeaf('0x18')](config[_0xbeaf('0x17')],{'host':_0xbeaf('0x19'),'port':0x18eb});var socket=require(_0xbeaf('0x1a'))(new Redis(config[_0xbeaf('0x17')]));require(_0xbeaf('0x1b'))[_0xbeaf('0x1c')](socket);var jayson=require(_0xbeaf('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xbeaf('0x1e')][_0xbeaf('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x592465,_0x2e3005,_0x1e413f,_0x1365ef){return new BPromise(function(_0x93b514,_0x45b537){var _0x192f15=_0x1365ef||client;return _0x192f15[_0xbeaf('0x20')](_0x592465,_0x1e413f)[_0xbeaf('0x21')](function(_0x47d38a){logger[_0xbeaf('0x22')](_0xbeaf('0x23'),_0x2e3005,_0xbeaf('0x24'));logger[_0xbeaf('0x25')](_0xbeaf('0x26'),_0x2e3005,_0xbeaf('0x24'),JSON[_0xbeaf('0x27')](_0x47d38a));if(_0x47d38a['error']){if(_0x47d38a['error'][_0xbeaf('0x28')]===0x1f4){logger[_0xbeaf('0x29')]('ChatMessage,\x20%s,\x20%s',_0x2e3005,_0x47d38a[_0xbeaf('0x29')]['message']);return _0x45b537(_0x47d38a[_0xbeaf('0x29')][_0xbeaf('0x2a')]);}logger[_0xbeaf('0x29')](_0xbeaf('0x23'),_0x2e3005,_0x47d38a[_0xbeaf('0x29')][_0xbeaf('0x2a')]);return _0x93b514(_0x47d38a['error'][_0xbeaf('0x2a')]);}else{logger[_0xbeaf('0x22')](_0xbeaf('0x23'),_0x2e3005,_0xbeaf('0x24'));_0x93b514(_0x47d38a['result'][_0xbeaf('0x2a')]);}})[_0xbeaf('0x2b')](function(_0x42eb37){logger[_0xbeaf('0x29')](_0xbeaf('0x23'),_0x2e3005,_0x42eb37);_0x45b537(_0x42eb37);});});}function respondWithStatusCode(_0x21a486,_0x568351){_0x568351=_0x568351||0xcc;return function(_0x38c37e){if(_0x38c37e){return _0x21a486['sendStatus'](_0x568351);}return _0x21a486[_0xbeaf('0x2c')](_0x568351)[_0xbeaf('0x2d')]();};}function respondWithResult(_0x13c114,_0x36bb91){_0x36bb91=_0x36bb91||0xc8;return function(_0x2d018a){if(_0x2d018a){return _0x13c114[_0xbeaf('0x2c')](_0x36bb91)[_0xbeaf('0x2e')](_0x2d018a);}};}function respondWithFilteredResult(_0x114ad,_0x4d24d6){return function(_0x2f0920){if(_0x2f0920){var _0x250708=typeof _0x4d24d6[_0xbeaf('0x2f')]===_0xbeaf('0x30')&&typeof _0x4d24d6[_0xbeaf('0x31')]==='undefined';var _0x48b79c=_0x2f0920[_0xbeaf('0x32')];var _0x5909d1=_0x250708?0x0:_0x4d24d6['offset'];var _0x9b0447=_0x250708?_0x2f0920[_0xbeaf('0x32')]:_0x4d24d6[_0xbeaf('0x2f')]+_0x4d24d6[_0xbeaf('0x31')];var _0xa9cf46;if(_0x9b0447>=_0x48b79c){_0x9b0447=_0x48b79c;_0xa9cf46=0xc8;}else{_0xa9cf46=0xce;}_0x114ad['status'](_0xa9cf46);return _0x114ad[_0xbeaf('0x33')]('Content-Range',_0x5909d1+'-'+_0x9b0447+'/'+_0x48b79c)[_0xbeaf('0x2e')](_0x2f0920);}return null;};}function patchUpdates(_0x3751f6){return function(_0x527f4a){try{jsonpatch[_0xbeaf('0x34')](_0x527f4a,_0x3751f6,!![]);}catch(_0x297a62){return BPromise[_0xbeaf('0x35')](_0x297a62);}return _0x527f4a['save']();};}function saveUpdates(_0x3581c0,_0x482094){return function(_0x6a7488){if(_0x6a7488){return _0x6a7488[_0xbeaf('0x36')](_0x3581c0)[_0xbeaf('0x21')](function(_0x50b585){return _0x50b585;});}return null;};}function removeEntity(_0x402501,_0x424e87){return function(_0x2f1994){if(_0x2f1994){return _0x2f1994[_0xbeaf('0x37')]()['then'](function(){_0x402501['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c192,_0x1dc28c){return function(_0x4d9584){if(!_0x4d9584){_0x45c192['sendStatus'](0x194);}return _0x4d9584;};}function handleError(_0x3aac8f,_0x5ce463){_0x5ce463=_0x5ce463||0x1f4;return function(_0x2cb5b6){logger[_0xbeaf('0x29')](_0x2cb5b6['stack']);if(_0x2cb5b6[_0xbeaf('0x38')]){delete _0x2cb5b6['name'];}_0x3aac8f[_0xbeaf('0x2c')](_0x5ce463)[_0xbeaf('0x39')](_0x2cb5b6);};}exports[_0xbeaf('0x3a')]=function(_0x1ddfe2,_0x47ec38){var _0x589053={},_0x566251={},_0x1ef2b6={'count':0x0,'rows':[]};var _0x5ea900=_[_0xbeaf('0x3b')](db[_0xbeaf('0x3c')]['rawAttributes'],function(_0x1e15d9){return{'name':_0x1e15d9[_0xbeaf('0x3d')],'type':_0x1e15d9[_0xbeaf('0x3e')][_0xbeaf('0x3f')]};});_0x566251[_0xbeaf('0x40')]=_[_0xbeaf('0x3b')](_0x5ea900,'name');_0x566251[_0xbeaf('0x41')]=_[_0xbeaf('0x42')](_0x1ddfe2[_0xbeaf('0x41')]);_0x566251[_0xbeaf('0x43')]=_['intersection'](_0x566251[_0xbeaf('0x40')],_0x566251[_0xbeaf('0x41')]);_0x589053[_0xbeaf('0x44')]=_[_0xbeaf('0x45')](_0x566251[_0xbeaf('0x40')],qs['fields'](_0x1ddfe2['query']['fields']));_0x589053[_0xbeaf('0x44')]=_0x589053[_0xbeaf('0x44')]['length']?_0x589053[_0xbeaf('0x44')]:_0x566251[_0xbeaf('0x40')];if(!_0x1ddfe2[_0xbeaf('0x41')][_0xbeaf('0x46')]('nolimit')){_0x589053[_0xbeaf('0x31')]=qs[_0xbeaf('0x31')](_0x1ddfe2[_0xbeaf('0x41')][_0xbeaf('0x31')]);_0x589053[_0xbeaf('0x2f')]=qs[_0xbeaf('0x2f')](_0x1ddfe2[_0xbeaf('0x41')][_0xbeaf('0x2f')]);}_0x589053[_0xbeaf('0x47')]=qs[_0xbeaf('0x48')](_0x1ddfe2[_0xbeaf('0x41')][_0xbeaf('0x48')]);_0x589053[_0xbeaf('0x49')]=qs['filters'](_[_0xbeaf('0x4a')](_0x1ddfe2[_0xbeaf('0x41')],_0x566251[_0xbeaf('0x43')]),_0x5ea900);if(_0x1ddfe2['query'][_0xbeaf('0x4b')]){_0x589053['where']=_['merge'](_0x589053['where'],{'$or':_[_0xbeaf('0x3b')](_0x5ea900,function(_0x835b60){if(_0x835b60[_0xbeaf('0x3e')]!==_0xbeaf('0x4c')){var _0xb9c626={};_0xb9c626[_0x835b60[_0xbeaf('0x38')]]={'$like':'%'+_0x1ddfe2[_0xbeaf('0x41')][_0xbeaf('0x4b')]+'%'};return _0xb9c626;}})});}_0x589053=_[_0xbeaf('0x4d')]({},_0x589053,_0x1ddfe2[_0xbeaf('0x4e')]);var _0x474ee8={'where':_0x589053[_0xbeaf('0x49')]};return db[_0xbeaf('0x3c')][_0xbeaf('0x32')](_0x474ee8)[_0xbeaf('0x21')](function(_0x192146){_0x1ef2b6['count']=_0x192146;if(_0x1ddfe2[_0xbeaf('0x41')][_0xbeaf('0x4f')]){_0x589053[_0xbeaf('0x50')]=[{'all':!![]}];}return db[_0xbeaf('0x3c')][_0xbeaf('0x51')](_0x589053);})['then'](function(_0x6a01d6){_0x1ef2b6[_0xbeaf('0x52')]=_0x6a01d6;return _0x1ef2b6;})[_0xbeaf('0x21')](respondWithFilteredResult(_0x47ec38,_0x589053))[_0xbeaf('0x2b')](handleError(_0x47ec38,null));};exports[_0xbeaf('0x53')]=function(_0x5501e5,_0x2b7d73){var _0x3093b5={'raw':!![],'where':{'id':_0x5501e5[_0xbeaf('0x54')]['id']}},_0x17c689={};_0x17c689['model']=_[_0xbeaf('0x42')](db[_0xbeaf('0x3c')][_0xbeaf('0x55')]);_0x17c689[_0xbeaf('0x41')]=_[_0xbeaf('0x42')](_0x5501e5[_0xbeaf('0x41')]);_0x17c689[_0xbeaf('0x43')]=_['intersection'](_0x17c689[_0xbeaf('0x40')],_0x17c689[_0xbeaf('0x41')]);_0x3093b5[_0xbeaf('0x44')]=_[_0xbeaf('0x45')](_0x17c689[_0xbeaf('0x40')],qs[_0xbeaf('0x56')](_0x5501e5['query']['fields']));_0x3093b5['attributes']=_0x3093b5[_0xbeaf('0x44')]['length']?_0x3093b5['attributes']:_0x17c689['model'];if(_0x5501e5[_0xbeaf('0x41')]['includeAll']){_0x3093b5[_0xbeaf('0x50')]=[{'all':!![]}];}_0x3093b5=_[_0xbeaf('0x4d')]({},_0x3093b5,_0x5501e5[_0xbeaf('0x4e')]);return db[_0xbeaf('0x3c')][_0xbeaf('0x57')](_0x3093b5)[_0xbeaf('0x21')](handleEntityNotFound(_0x2b7d73,null))[_0xbeaf('0x21')](respondWithResult(_0x2b7d73,null))[_0xbeaf('0x2b')](handleError(_0x2b7d73,null));};exports[_0xbeaf('0x58')]=function(_0x1b5827,_0x254f45){return db[_0xbeaf('0x3c')][_0xbeaf('0x58')](_0x1b5827['body'],{})['then'](respondWithResult(_0x254f45,0xc9))[_0xbeaf('0x2b')](handleError(_0x254f45,null));};exports['update']=function(_0xcb2f94,_0x1ea8fd){if(_0xcb2f94['body']['id']){delete _0xcb2f94[_0xbeaf('0x59')]['id'];}return db['ChatMessage'][_0xbeaf('0x57')]({'where':{'id':_0xcb2f94[_0xbeaf('0x54')]['id']}})[_0xbeaf('0x21')](handleEntityNotFound(_0x1ea8fd,null))['then'](saveUpdates(_0xcb2f94[_0xbeaf('0x59')],null))['then'](respondWithResult(_0x1ea8fd,null))[_0xbeaf('0x2b')](handleError(_0x1ea8fd,null));};exports[_0xbeaf('0x37')]=function(_0x3ec80b,_0x4fc790){return db['ChatMessage'][_0xbeaf('0x57')]({'where':{'id':_0x3ec80b[_0xbeaf('0x54')]['id']}})[_0xbeaf('0x21')](handleEntityNotFound(_0x4fc790,null))[_0xbeaf('0x21')](removeEntity(_0x4fc790,null))[_0xbeaf('0x2b')](handleError(_0x4fc790,null));};exports[_0xbeaf('0x5a')]=function(_0x47d5d2,_0xa34de4){return db[_0xbeaf('0x3c')]['describe']()[_0xbeaf('0x21')](respondWithResult(_0xa34de4,null))[_0xbeaf('0x2b')](handleError(_0xa34de4,null));};var interaction_log=require('../../config/logger')(_0xbeaf('0x5b'));exports['accept']=function(_0x324a75,_0x48a60a,_0x310fc6){var _0x3d8255={'agent':{},'channel':_0xbeaf('0x5c')};if(_0x324a75['body']['id']){delete _0x324a75[_0xbeaf('0x59')]['id'];}_0x324a75[_0xbeaf('0x59')][_0xbeaf('0x5d')]=!![];_0x324a75[_0xbeaf('0x59')][_0xbeaf('0x5e')]=moment()[_0xbeaf('0x5f')](_0xbeaf('0x60'));_0x324a75[_0xbeaf('0x59')][_0xbeaf('0x61')]=_0x324a75['body'][_0xbeaf('0x61')]||_0x324a75[_0xbeaf('0x62')]['id'];_0x3d8255[_0xbeaf('0x63')]['id']=_0x324a75[_0xbeaf('0x59')][_0xbeaf('0x61')];return db['ChatMessage'][_0xbeaf('0x57')]({'where':{'id':_0x324a75[_0xbeaf('0x54')]['id'],'UserId':null}})[_0xbeaf('0x21')](handleEntityNotFound(_0x48a60a,null))[_0xbeaf('0x21')](saveUpdates(_0x324a75[_0xbeaf('0x59')],null))['then'](function(_0x3f6bfd){if(_0x3f6bfd){_0x3d8255['message']=_0x3f6bfd[_0xbeaf('0x64')]({'plain':!![]});return db[_0xbeaf('0x65')][_0xbeaf('0x57')]({'where':{'id':_0x3f6bfd[_0xbeaf('0x66')]}});}return null;})[_0xbeaf('0x21')](handleEntityNotFound(_0x48a60a,null))[_0xbeaf('0x21')](function(_0x2c7ef3){if(_0x2c7ef3){return _0x2c7ef3[_0xbeaf('0x36')]({'UserId':_0x324a75[_0xbeaf('0x59')][_0xbeaf('0x61')],'read1stAt':_[_0xbeaf('0x67')](_0x2c7ef3[_0xbeaf('0x68')])?moment()[_0xbeaf('0x5f')](_0xbeaf('0x60')):undefined});}return null;})['then'](function(_0x287cc2){if(_0x287cc2){_0x3d8255[_0xbeaf('0x69')]=_0x287cc2[_0xbeaf('0x64')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x324a75[_0xbeaf('0x62')]['id'],_0x324a75['user'][_0xbeaf('0x38')],_0x324a75['user'][_0xbeaf('0x6a')],_0x3d8255['interaction']['id'],_0x324a75[_0xbeaf('0x59')]?JSON[_0xbeaf('0x27')](_0x324a75[_0xbeaf('0x59')]):_0xbeaf('0x6b'));return respondWithRpcPromise(_0xbeaf('0x6c'),_0xbeaf('0x6d'),_0x3d8255);}return null;})['then'](function(_0x41893e){var _0x22af18='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x41893e[_0xbeaf('0x2a')][_0xbeaf('0x6e')];return db[_0xbeaf('0x6f')]['query'](_0x22af18,{'type':db[_0xbeaf('0x70')][_0xbeaf('0x71')][_0xbeaf('0x72')],'raw':!![]})[_0xbeaf('0x21')](function(_0x490a25){return _0x490a25;});})[_0xbeaf('0x21')](function(_0x1d2600){if(_0x1d2600){_0x3d8255[_0xbeaf('0x2a')][_0xbeaf('0x73')]=_0x1d2600[0x0];if(!_0x324a75['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x324a75['body']['UserId'],'role':'agent'},'attributes':['id',_0xbeaf('0x38'),'fullname',_0xbeaf('0x74'),_0xbeaf('0x75')],'raw':!![]});}return null;})['then'](function(_0x45a4e4){if(!_0x45a4e4)return null;_0x3d8255['message'][_0xbeaf('0x63')]=_0x45a4e4;return _0x3d8255;})[_0xbeaf('0x21')](function(_0x494751){if(_0x494751){if(_0x324a75['body'][_0xbeaf('0x76')]){_0x3d8255[_0xbeaf('0x2a')][_0xbeaf('0x77')]=util[_0xbeaf('0x5f')](_0xbeaf('0x78'),_0x324a75[_0xbeaf('0x62')][_0xbeaf('0x38')]);_0x3d8255[_0xbeaf('0x2a')][_0xbeaf('0x79')]=_0x3d8255[_0xbeaf('0x79')];_0x3d8255[_0xbeaf('0x2a')][_0xbeaf('0x7a')]=_0x3d8255[_0xbeaf('0x79')];_0x3d8255['message']['event']='accept';return respondWithRpcPromise(_0xbeaf('0x7b'),'EventManager',{'event':_0xbeaf('0x7c'),'message':_['merge'](_0x3d8255['message'],JSON[_0xbeaf('0x7d')](_0x3d8255['interaction'][_0xbeaf('0x7e')]))},client9002)[_0xbeaf('0x21')](function(){return _0x3d8255;});}return _0x3d8255;}return null;})['then'](respondWithResult(_0x48a60a,null))[_0xbeaf('0x2b')](handleError(_0x48a60a,null));};var interaction_log=require('../../config/logger')(_0xbeaf('0x5b'));exports[_0xbeaf('0x35')]=function(_0x4c0387,_0x47387d,_0x376806){var _0x2feee7={'agent':{},'channel':_0xbeaf('0x5c')};if(_0x4c0387[_0xbeaf('0x59')]['id']){delete _0x4c0387[_0xbeaf('0x59')]['id'];}_0x4c0387[_0xbeaf('0x59')][_0xbeaf('0x61')]=_0x4c0387[_0xbeaf('0x59')][_0xbeaf('0x61')]||_0x4c0387['user']['id'];_0x2feee7[_0xbeaf('0x63')]['id']=_0x4c0387[_0xbeaf('0x59')][_0xbeaf('0x61')];return db[_0xbeaf('0x3c')][_0xbeaf('0x57')]({'where':{'id':_0x4c0387[_0xbeaf('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x47387d,null))[_0xbeaf('0x21')](function(_0x1228e0){if(_0x1228e0){_0x2feee7[_0xbeaf('0x2a')]=_0x1228e0['get']({'plain':!![]});return db[_0xbeaf('0x65')][_0xbeaf('0x57')]({'where':{'id':_0x1228e0['ChatInteractionId']}});}return null;})[_0xbeaf('0x21')](handleEntityNotFound(_0x47387d,null))['then'](function(_0x52e213){if(_0x52e213){_0x2feee7[_0xbeaf('0x69')]=_0x52e213[_0xbeaf('0x64')]({'plain':!![]});interaction_log[_0xbeaf('0x22')](_0xbeaf('0x7f'),_0x4c0387[_0xbeaf('0x62')]['id'],_0x4c0387[_0xbeaf('0x62')][_0xbeaf('0x38')],_0x4c0387[_0xbeaf('0x62')]['role'],_0x2feee7[_0xbeaf('0x69')]['id'],_0x4c0387['body']?JSON[_0xbeaf('0x27')](_0x4c0387[_0xbeaf('0x59')]):_0xbeaf('0x6b'));return respondWithRpcPromise('RejectMessage',_0xbeaf('0x80'),_0x2feee7);}return null;})[_0xbeaf('0x21')](function(_0x5db812){var _0x5c667b=_0xbeaf('0x81')+_0x5db812[_0xbeaf('0x2a')][_0xbeaf('0x6e')];return db['sequelize']['query'](_0x5c667b,{'type':db['Sequelize'][_0xbeaf('0x71')][_0xbeaf('0x72')],'raw':!![]})[_0xbeaf('0x21')](function(_0xa15df8){return _0xa15df8;});})[_0xbeaf('0x21')](function(_0x2c6df2){if(_0x2c6df2){_0x2feee7[_0xbeaf('0x2a')][_0xbeaf('0x73')]=_0x2c6df2[0x0];if(!_0x4c0387[_0xbeaf('0x59')][_0xbeaf('0x61')])return;return db[_0xbeaf('0x82')][_0xbeaf('0x57')]({'where':{'id':_0x4c0387[_0xbeaf('0x59')]['UserId'],'role':_0xbeaf('0x63')},'attributes':['id','name',_0xbeaf('0x83'),_0xbeaf('0x74'),_0xbeaf('0x75')],'raw':!![]});}return null;})[_0xbeaf('0x21')](function(_0x4af906){if(!_0x4af906)return null;_0x2feee7[_0xbeaf('0x2a')]['agent']=_0x4af906;return _0x2feee7;})[_0xbeaf('0x21')](function(_0x9024f8){if(_0x9024f8){_0x9024f8[_0xbeaf('0x2a')]['interface']=util[_0xbeaf('0x5f')]('SIP/%s',_0x4c0387[_0xbeaf('0x62')][_0xbeaf('0x38')]);_0x9024f8[_0xbeaf('0x2a')]['channel']=_0x2feee7['channel'];_0x9024f8[_0xbeaf('0x2a')][_0xbeaf('0x7a')]=_0x2feee7[_0xbeaf('0x79')];_0x9024f8[_0xbeaf('0x2a')][_0xbeaf('0x84')]=_0xbeaf('0x35');respondWithRpcPromise(_0xbeaf('0x7b'),_0xbeaf('0x7b'),{'event':_0xbeaf('0x85'),'message':_[_0xbeaf('0x4d')](_0x2feee7[_0xbeaf('0x2a')],JSON[_0xbeaf('0x7d')](_0x2feee7[_0xbeaf('0x69')][_0xbeaf('0x7e')]))},client9002);return _0x2feee7;}return null;})[_0xbeaf('0x21')](respondWithResult(_0x47387d,null))[_0xbeaf('0x2b')](handleError(_0x47387d,null));}; \ No newline at end of file +var _0x4eab=['VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','User','manual','SIP/%s','motionChannel','channel','event','EventManager','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','contact','internal','interface','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4eab,0x1d1));var _0xb4ea=function(_0x44f827,_0x305e00){_0x44f827=_0x44f827-0x0;var _0x2cc524=_0x4eab[_0x44f827];return _0x2cc524;};'use strict';var emlformat=require(_0xb4ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4ea('0x1'));var jsonpatch=require(_0xb4ea('0x2'));var rp=require(_0xb4ea('0x3'));var moment=require(_0xb4ea('0x4'));var BPromise=require(_0xb4ea('0x5'));var Mustache=require('mustache');var util=require(_0xb4ea('0x6'));var path=require(_0xb4ea('0x7'));var sox=require(_0xb4ea('0x8'));var csv=require('to-csv');var ejs=require(_0xb4ea('0x9'));var fs=require('fs');var fs_extra=require(_0xb4ea('0xa'));var _=require(_0xb4ea('0xb'));var squel=require('squel');var crypto=require(_0xb4ea('0xc'));var jsforce=require(_0xb4ea('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4ea('0xe'));var querystring=require(_0xb4ea('0xf'));var Papa=require(_0xb4ea('0x10'));var Redis=require(_0xb4ea('0x11'));var authService=require(_0xb4ea('0x12'));var qs=require(_0xb4ea('0x13'));var as=require(_0xb4ea('0x14'));var hardwareService=require(_0xb4ea('0x15'));var logger=require(_0xb4ea('0x16'))(_0xb4ea('0x17'));var utils=require(_0xb4ea('0x18'));var config=require(_0xb4ea('0x19'));var licenseUtil=require(_0xb4ea('0x1a'));var db=require('../../mysqldb')['db'];config[_0xb4ea('0x1b')]=_[_0xb4ea('0x1c')](config['redis'],{'host':_0xb4ea('0x1d'),'port':0x18eb});var socket=require(_0xb4ea('0x1e'))(new Redis(config['redis']));require(_0xb4ea('0x1f'))[_0xb4ea('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb4ea('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xb4ea('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4b59,_0x3b347c,_0x75772b,_0x5e850c){return new BPromise(function(_0x94fe4c,_0x16f297){var _0x442891=_0x5e850c||client;return _0x442891[_0xb4ea('0x22')](_0x1d4b59,_0x75772b)[_0xb4ea('0x23')](function(_0x16da58){logger['info'](_0xb4ea('0x24'),_0x3b347c,'request\x20sent');logger[_0xb4ea('0x25')](_0xb4ea('0x26'),_0x3b347c,_0xb4ea('0x27'),JSON['stringify'](_0x16da58));if(_0x16da58[_0xb4ea('0x28')]){if(_0x16da58[_0xb4ea('0x28')][_0xb4ea('0x29')]===0x1f4){logger[_0xb4ea('0x28')]('ChatMessage,\x20%s,\x20%s',_0x3b347c,_0x16da58[_0xb4ea('0x28')]['message']);return _0x16f297(_0x16da58[_0xb4ea('0x28')][_0xb4ea('0x2a')]);}logger['error'](_0xb4ea('0x24'),_0x3b347c,_0x16da58[_0xb4ea('0x28')][_0xb4ea('0x2a')]);return _0x94fe4c(_0x16da58['error'][_0xb4ea('0x2a')]);}else{logger[_0xb4ea('0x2b')](_0xb4ea('0x24'),_0x3b347c,_0xb4ea('0x27'));_0x94fe4c(_0x16da58[_0xb4ea('0x2c')]['message']);}})['catch'](function(_0xb99bbb){logger[_0xb4ea('0x28')]('ChatMessage,\x20%s,\x20%s',_0x3b347c,_0xb99bbb);_0x16f297(_0xb99bbb);});});}function respondWithStatusCode(_0x238bc5,_0x3aaf48){_0x3aaf48=_0x3aaf48||0xcc;return function(_0x414a84){if(_0x414a84){return _0x238bc5[_0xb4ea('0x2d')](_0x3aaf48);}return _0x238bc5[_0xb4ea('0x2e')](_0x3aaf48)['end']();};}function respondWithResult(_0x53276a,_0x138fa5){_0x138fa5=_0x138fa5||0xc8;return function(_0x4c900f){if(_0x4c900f){return _0x53276a[_0xb4ea('0x2e')](_0x138fa5)[_0xb4ea('0x2f')](_0x4c900f);}};}function respondWithFilteredResult(_0x392299,_0x5244b6){return function(_0x1159e7){if(_0x1159e7){var _0x29bbbd=typeof _0x5244b6[_0xb4ea('0x30')]===_0xb4ea('0x31')&&typeof _0x5244b6['limit']===_0xb4ea('0x31');var _0x3b2419=_0x1159e7[_0xb4ea('0x32')];var _0x3f8c67=_0x29bbbd?0x0:_0x5244b6[_0xb4ea('0x30')];var _0x2f9922=_0x29bbbd?_0x1159e7[_0xb4ea('0x32')]:_0x5244b6['offset']+_0x5244b6[_0xb4ea('0x33')];var _0x5ab63b;if(_0x2f9922>=_0x3b2419){_0x2f9922=_0x3b2419;_0x5ab63b=0xc8;}else{_0x5ab63b=0xce;}_0x392299[_0xb4ea('0x2e')](_0x5ab63b);return _0x392299[_0xb4ea('0x34')](_0xb4ea('0x35'),_0x3f8c67+'-'+_0x2f9922+'/'+_0x3b2419)[_0xb4ea('0x2f')](_0x1159e7);}return null;};}function patchUpdates(_0x4a96e7){return function(_0x506d6c){try{jsonpatch[_0xb4ea('0x36')](_0x506d6c,_0x4a96e7,!![]);}catch(_0x10dcf5){return BPromise[_0xb4ea('0x37')](_0x10dcf5);}return _0x506d6c[_0xb4ea('0x38')]();};}function saveUpdates(_0x3fd82c,_0x421bc4){return function(_0x324c5b){if(_0x324c5b){return _0x324c5b[_0xb4ea('0x39')](_0x3fd82c)[_0xb4ea('0x23')](function(_0x2fa2dc){return _0x2fa2dc;});}return null;};}function removeEntity(_0x15ad74,_0x164a13){return function(_0x1cd4f7){if(_0x1cd4f7){return _0x1cd4f7[_0xb4ea('0x3a')]()[_0xb4ea('0x23')](function(){_0x15ad74[_0xb4ea('0x2e')](0xcc)[_0xb4ea('0x3b')]();});}};}function handleEntityNotFound(_0x395f16,_0x472e4b){return function(_0x525ccc){if(!_0x525ccc){_0x395f16[_0xb4ea('0x2d')](0x194);}return _0x525ccc;};}function handleError(_0x43c451,_0x216aae){_0x216aae=_0x216aae||0x1f4;return function(_0x507f5a){logger['error'](_0x507f5a[_0xb4ea('0x3c')]);if(_0x507f5a['name']){delete _0x507f5a['name'];}_0x43c451['status'](_0x216aae)[_0xb4ea('0x3d')](_0x507f5a);};}exports[_0xb4ea('0x3e')]=function(_0x968682,_0x251ec4){var _0x4bde14={},_0x53294c={},_0x2b275f={'count':0x0,'rows':[]};var _0x1f389d=_[_0xb4ea('0x3f')](db[_0xb4ea('0x40')]['rawAttributes'],function(_0x56d2e7){return{'name':_0x56d2e7[_0xb4ea('0x41')],'type':_0x56d2e7[_0xb4ea('0x42')][_0xb4ea('0x43')]};});_0x53294c[_0xb4ea('0x44')]=_['map'](_0x1f389d,'name');_0x53294c[_0xb4ea('0x45')]=_[_0xb4ea('0x46')](_0x968682[_0xb4ea('0x45')]);_0x53294c[_0xb4ea('0x47')]=_[_0xb4ea('0x48')](_0x53294c[_0xb4ea('0x44')],_0x53294c[_0xb4ea('0x45')]);_0x4bde14[_0xb4ea('0x49')]=_[_0xb4ea('0x48')](_0x53294c[_0xb4ea('0x44')],qs['fields'](_0x968682['query']['fields']));_0x4bde14[_0xb4ea('0x49')]=_0x4bde14['attributes'][_0xb4ea('0x4a')]?_0x4bde14[_0xb4ea('0x49')]:_0x53294c[_0xb4ea('0x44')];if(!_0x968682[_0xb4ea('0x45')][_0xb4ea('0x4b')](_0xb4ea('0x4c'))){_0x4bde14[_0xb4ea('0x33')]=qs['limit'](_0x968682[_0xb4ea('0x45')][_0xb4ea('0x33')]);_0x4bde14[_0xb4ea('0x30')]=qs[_0xb4ea('0x30')](_0x968682[_0xb4ea('0x45')][_0xb4ea('0x30')]);}_0x4bde14[_0xb4ea('0x4d')]=qs['sort'](_0x968682[_0xb4ea('0x45')][_0xb4ea('0x4e')]);_0x4bde14[_0xb4ea('0x4f')]=qs[_0xb4ea('0x47')](_[_0xb4ea('0x50')](_0x968682[_0xb4ea('0x45')],_0x53294c[_0xb4ea('0x47')]),_0x1f389d);if(_0x968682[_0xb4ea('0x45')][_0xb4ea('0x51')]){_0x4bde14[_0xb4ea('0x4f')]=_[_0xb4ea('0x52')](_0x4bde14[_0xb4ea('0x4f')],{'$or':_[_0xb4ea('0x3f')](_0x1f389d,function(_0x1ff4ae){if(_0x1ff4ae[_0xb4ea('0x42')]!==_0xb4ea('0x53')){var _0x562195={};_0x562195[_0x1ff4ae['name']]={'$like':'%'+_0x968682['query'][_0xb4ea('0x51')]+'%'};return _0x562195;}})});}_0x4bde14=_[_0xb4ea('0x52')]({},_0x4bde14,_0x968682[_0xb4ea('0x54')]);var _0x2643a2={'where':_0x4bde14[_0xb4ea('0x4f')]};return db['ChatMessage'][_0xb4ea('0x32')](_0x2643a2)['then'](function(_0x4a0cd9){_0x2b275f[_0xb4ea('0x32')]=_0x4a0cd9;if(_0x968682[_0xb4ea('0x45')][_0xb4ea('0x55')]){_0x4bde14[_0xb4ea('0x56')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4bde14);})[_0xb4ea('0x23')](function(_0x46ef16){_0x2b275f[_0xb4ea('0x57')]=_0x46ef16;return _0x2b275f;})[_0xb4ea('0x23')](respondWithFilteredResult(_0x251ec4,_0x4bde14))[_0xb4ea('0x58')](handleError(_0x251ec4,null));};exports['show']=function(_0x30b652,_0x1e6b40){var _0x1f33e5={'raw':!![],'where':{'id':_0x30b652[_0xb4ea('0x59')]['id']}},_0x1bad2f={};_0x1bad2f[_0xb4ea('0x44')]=_[_0xb4ea('0x46')](db[_0xb4ea('0x40')]['rawAttributes']);_0x1bad2f[_0xb4ea('0x45')]=_[_0xb4ea('0x46')](_0x30b652[_0xb4ea('0x45')]);_0x1bad2f[_0xb4ea('0x47')]=_[_0xb4ea('0x48')](_0x1bad2f['model'],_0x1bad2f[_0xb4ea('0x45')]);_0x1f33e5[_0xb4ea('0x49')]=_[_0xb4ea('0x48')](_0x1bad2f[_0xb4ea('0x44')],qs['fields'](_0x30b652['query']['fields']));_0x1f33e5[_0xb4ea('0x49')]=_0x1f33e5[_0xb4ea('0x49')][_0xb4ea('0x4a')]?_0x1f33e5[_0xb4ea('0x49')]:_0x1bad2f[_0xb4ea('0x44')];if(_0x30b652[_0xb4ea('0x45')]['includeAll']){_0x1f33e5[_0xb4ea('0x56')]=[{'all':!![]}];}_0x1f33e5=_[_0xb4ea('0x52')]({},_0x1f33e5,_0x30b652[_0xb4ea('0x54')]);return db[_0xb4ea('0x40')]['find'](_0x1f33e5)[_0xb4ea('0x23')](handleEntityNotFound(_0x1e6b40,null))[_0xb4ea('0x23')](respondWithResult(_0x1e6b40,null))[_0xb4ea('0x58')](handleError(_0x1e6b40,null));};exports[_0xb4ea('0x5a')]=function(_0x4ce61b,_0x135439){return db[_0xb4ea('0x40')]['create'](_0x4ce61b[_0xb4ea('0x5b')],{})[_0xb4ea('0x23')](respondWithResult(_0x135439,0xc9))[_0xb4ea('0x58')](handleError(_0x135439,null));};exports['update']=function(_0x153f56,_0x2cfdd0){if(_0x153f56[_0xb4ea('0x5b')]['id']){delete _0x153f56[_0xb4ea('0x5b')]['id'];}return db[_0xb4ea('0x40')][_0xb4ea('0x5c')]({'where':{'id':_0x153f56[_0xb4ea('0x59')]['id']}})[_0xb4ea('0x23')](handleEntityNotFound(_0x2cfdd0,null))[_0xb4ea('0x23')](saveUpdates(_0x153f56[_0xb4ea('0x5b')],null))[_0xb4ea('0x23')](respondWithResult(_0x2cfdd0,null))['catch'](handleError(_0x2cfdd0,null));};exports[_0xb4ea('0x3a')]=function(_0x2d4509,_0x3b4556){return db[_0xb4ea('0x40')][_0xb4ea('0x5c')]({'where':{'id':_0x2d4509['params']['id']}})['then'](handleEntityNotFound(_0x3b4556,null))['then'](removeEntity(_0x3b4556,null))[_0xb4ea('0x58')](handleError(_0x3b4556,null));};exports[_0xb4ea('0x5d')]=function(_0x29325e,_0x3535bc){return db[_0xb4ea('0x40')][_0xb4ea('0x5d')]()[_0xb4ea('0x23')](respondWithResult(_0x3535bc,null))[_0xb4ea('0x58')](handleError(_0x3535bc,null));};var interaction_log=require(_0xb4ea('0x16'))(_0xb4ea('0x5e'));exports[_0xb4ea('0x5f')]=function(_0x538a52,_0x42f2c9,_0x4987f9){var _0x33875e={'agent':{},'channel':_0xb4ea('0x60')};if(_0x538a52[_0xb4ea('0x5b')]['id']){delete _0x538a52[_0xb4ea('0x5b')]['id'];}_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x61')]=!![];_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x62')]=moment()[_0xb4ea('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x538a52['body'][_0xb4ea('0x64')]=_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x64')]||_0x538a52[_0xb4ea('0x65')]['id'];_0x33875e[_0xb4ea('0x66')]['id']=_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x64')];return db[_0xb4ea('0x40')][_0xb4ea('0x5c')]({'where':{'id':_0x538a52[_0xb4ea('0x59')]['id'],'UserId':null}})[_0xb4ea('0x23')](handleEntityNotFound(_0x42f2c9,null))[_0xb4ea('0x23')](saveUpdates(_0x538a52[_0xb4ea('0x5b')],null))['then'](function(_0x3e4edf){if(_0x3e4edf){_0x33875e[_0xb4ea('0x2a')]=_0x3e4edf['get']({'plain':!![]});return db['ChatInteraction'][_0xb4ea('0x5c')]({'where':{'id':_0x3e4edf[_0xb4ea('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x42f2c9,null))[_0xb4ea('0x23')](function(_0x5af4fe){if(_0x5af4fe){return _0x5af4fe[_0xb4ea('0x39')]({'UserId':_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x64')],'read1stAt':_[_0xb4ea('0x68')](_0x5af4fe[_0xb4ea('0x69')])?moment()[_0xb4ea('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x583eca){if(_0x583eca){_0x33875e[_0xb4ea('0x6a')]=_0x583eca[_0xb4ea('0x6b')]({'plain':!![]});interaction_log[_0xb4ea('0x2b')](_0xb4ea('0x6c'),_0x538a52['user']['id'],_0x538a52['user'][_0xb4ea('0x6d')],_0x538a52['user'][_0xb4ea('0x6e')],_0x33875e[_0xb4ea('0x6a')]['id'],_0x538a52[_0xb4ea('0x5b')]?JSON[_0xb4ea('0x6f')](_0x538a52[_0xb4ea('0x5b')]):_0xb4ea('0x70'));return respondWithRpcPromise(_0xb4ea('0x71'),_0xb4ea('0x72'),_0x33875e);}return null;})[_0xb4ea('0x23')](function(_0x33cf8b){var _0x494fd5=_0xb4ea('0x73')+_0x33cf8b['message'][_0xb4ea('0x74')];return db['sequelize'][_0xb4ea('0x45')](_0x494fd5,{'type':db['Sequelize'][_0xb4ea('0x75')]['SELECT'],'raw':!![]})[_0xb4ea('0x23')](function(_0x530452){return _0x530452;});})[_0xb4ea('0x23')](function(_0x5c57b7){if(_0x5c57b7){_0x33875e[_0xb4ea('0x2a')]['contact']=_0x5c57b7[0x0];if(!_0x538a52[_0xb4ea('0x5b')]['UserId'])return;return db[_0xb4ea('0x76')][_0xb4ea('0x5c')]({'where':{'id':_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x64')],'role':_0xb4ea('0x66')},'attributes':['id',_0xb4ea('0x6d'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xb4ea('0x23')](function(_0x5a55d3){if(!_0x5a55d3)return null;_0x33875e['message'][_0xb4ea('0x66')]=_0x5a55d3;return _0x33875e;})[_0xb4ea('0x23')](function(_0x5e991e){if(_0x5e991e){if(_0x538a52[_0xb4ea('0x5b')][_0xb4ea('0x77')]){_0x33875e[_0xb4ea('0x2a')]['interface']=util[_0xb4ea('0x63')](_0xb4ea('0x78'),_0x538a52[_0xb4ea('0x65')][_0xb4ea('0x6d')]);_0x33875e[_0xb4ea('0x2a')]['channel']=_0x33875e['channel'];_0x33875e[_0xb4ea('0x2a')][_0xb4ea('0x79')]=_0x33875e[_0xb4ea('0x7a')];_0x33875e[_0xb4ea('0x2a')][_0xb4ea('0x7b')]=_0xb4ea('0x5f');return respondWithRpcPromise(_0xb4ea('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0xb4ea('0x52')](_0x33875e['message'],JSON[_0xb4ea('0x7d')](_0x33875e[_0xb4ea('0x6a')][_0xb4ea('0x7e')]))},client9002)['then'](function(){return _0x33875e;});}return _0x33875e;}return null;})[_0xb4ea('0x23')](respondWithResult(_0x42f2c9,null))['catch'](handleError(_0x42f2c9,null));};var interaction_log=require(_0xb4ea('0x16'))('chat-interactions');exports[_0xb4ea('0x37')]=function(_0x28c730,_0x3c8f11,_0x5d4d6e){var _0x1be648={'agent':{},'channel':'chat'};if(_0x28c730[_0xb4ea('0x5b')]['id']){delete _0x28c730[_0xb4ea('0x5b')]['id'];}_0x28c730[_0xb4ea('0x5b')][_0xb4ea('0x64')]=_0x28c730['body'][_0xb4ea('0x64')]||_0x28c730[_0xb4ea('0x65')]['id'];_0x1be648['agent']['id']=_0x28c730[_0xb4ea('0x5b')]['UserId'];return db[_0xb4ea('0x40')][_0xb4ea('0x5c')]({'where':{'id':_0x28c730[_0xb4ea('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c8f11,null))[_0xb4ea('0x23')](function(_0x36e680){if(_0x36e680){_0x1be648[_0xb4ea('0x2a')]=_0x36e680[_0xb4ea('0x6b')]({'plain':!![]});return db[_0xb4ea('0x7f')][_0xb4ea('0x5c')]({'where':{'id':_0x36e680[_0xb4ea('0x67')]}});}return null;})[_0xb4ea('0x23')](handleEntityNotFound(_0x3c8f11,null))['then'](function(_0x28c21c){if(_0x28c21c){_0x1be648[_0xb4ea('0x6a')]=_0x28c21c[_0xb4ea('0x6b')]({'plain':!![]});interaction_log[_0xb4ea('0x2b')](_0xb4ea('0x80'),_0x28c730['user']['id'],_0x28c730['user'][_0xb4ea('0x6d')],_0x28c730[_0xb4ea('0x65')]['role'],_0x1be648['interaction']['id'],_0x28c730['body']?JSON[_0xb4ea('0x6f')](_0x28c730[_0xb4ea('0x5b')]):'null');return respondWithRpcPromise(_0xb4ea('0x81'),_0xb4ea('0x82'),_0x1be648);}return null;})['then'](function(_0x2971da){var _0x2be34b=_0xb4ea('0x73')+_0x2971da['message'][_0xb4ea('0x74')];return db[_0xb4ea('0x83')][_0xb4ea('0x45')](_0x2be34b,{'type':db[_0xb4ea('0x84')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x3bb1a9){return _0x3bb1a9;});})['then'](function(_0x1a526d){if(_0x1a526d){_0x1be648[_0xb4ea('0x2a')][_0xb4ea('0x85')]=_0x1a526d[0x0];if(!_0x28c730[_0xb4ea('0x5b')][_0xb4ea('0x64')])return;return db['User'][_0xb4ea('0x5c')]({'where':{'id':_0x28c730[_0xb4ea('0x5b')][_0xb4ea('0x64')],'role':_0xb4ea('0x66')},'attributes':['id','name','fullname','email',_0xb4ea('0x86')],'raw':!![]});}return null;})[_0xb4ea('0x23')](function(_0x173038){if(!_0x173038)return null;_0x1be648['message'][_0xb4ea('0x66')]=_0x173038;return _0x1be648;})['then'](function(_0xa1c05a){if(_0xa1c05a){_0xa1c05a[_0xb4ea('0x2a')][_0xb4ea('0x87')]=util[_0xb4ea('0x63')]('SIP/%s',_0x28c730[_0xb4ea('0x65')][_0xb4ea('0x6d')]);_0xa1c05a[_0xb4ea('0x2a')]['channel']=_0x1be648[_0xb4ea('0x7a')];_0xa1c05a[_0xb4ea('0x2a')]['motionChannel']=_0x1be648[_0xb4ea('0x7a')];_0xa1c05a['message'][_0xb4ea('0x7b')]=_0xb4ea('0x37');respondWithRpcPromise(_0xb4ea('0x7c'),_0xb4ea('0x7c'),{'event':_0xb4ea('0x88'),'message':_[_0xb4ea('0x52')](_0x1be648[_0xb4ea('0x2a')],JSON['parse'](_0x1be648[_0xb4ea('0x6a')][_0xb4ea('0x7e')]))},client9002);return _0x1be648;}return null;})['then'](respondWithResult(_0x3c8f11,null))[_0xb4ea('0x58')](handleError(_0x3c8f11,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 9b13aee..e1c7888 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 _0xb20c=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb20c,0x187));var _0xcb20=function(_0x10dc4b,_0x1feb61){_0x10dc4b=_0x10dc4b-0x0;var _0x2b1814=_0xb20c[_0x10dc4b];return _0x2b1814;};'use strict';var EventEmitter=require(_0xcb20('0x0'));var ChatMessage=require(_0xcb20('0x1'))['db'][_0xcb20('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xcb20('0x3')](0x0);var events={'afterCreate':_0xcb20('0x4'),'afterUpdate':_0xcb20('0x5'),'afterDestroy':_0xcb20('0x6')};function emitEvent(_0x46243b){return function(_0x5e46ab,_0x13d803,_0x49e442){ChatMessageEvents[_0xcb20('0x7')](_0x46243b+':'+_0x5e46ab['id'],_0x5e46ab);ChatMessageEvents['emit'](_0x46243b,_0x5e46ab);_0x49e442(null);};}for(var e in events){if(events[_0xcb20('0x8')](e)){var event=events[e];ChatMessage[_0xcb20('0x9')](e,emitEvent(event));}}module[_0xcb20('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x9474=['ChatMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x41615f,_0x11c4fe){var _0x3987c4=function(_0x290c10){while(--_0x290c10){_0x41615f['push'](_0x41615f['shift']());}};_0x3987c4(++_0x11c4fe);}(_0x9474,0x1ca));var _0x4947=function(_0x227c55,_0x49db56){_0x227c55=_0x227c55-0x0;var _0x49e02b=_0x9474[_0x227c55];return _0x49e02b;};'use strict';var EventEmitter=require(_0x4947('0x0'));var ChatMessage=require(_0x4947('0x1'))['db'][_0x4947('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4947('0x3'),'afterUpdate':_0x4947('0x4'),'afterDestroy':_0x4947('0x5')};function emitEvent(_0x80b18){return function(_0x2cc163,_0x50e501,_0x49a461){ChatMessageEvents[_0x4947('0x6')](_0x80b18+':'+_0x2cc163['id'],_0x2cc163);ChatMessageEvents[_0x4947('0x6')](_0x80b18,_0x2cc163);_0x49a461(null);};}for(var e in events){if(events[_0x4947('0x7')](e)){var event=events[e];ChatMessage[_0x4947('0x8')](e,emitEvent(event));}}module[_0x4947('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 e0ed6f0..bb63fbf 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 _0xc4dd=['FULLTEXT','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body'];(function(_0x56cc28,_0x4a921e){var _0x1f5798=function(_0x45f7a5){while(--_0x45f7a5){_0x56cc28['push'](_0x56cc28['shift']());}};_0x1f5798(++_0x4a921e);}(_0xc4dd,0x198));var _0xdc4d=function(_0x428dd4,_0x191853){_0x428dd4=_0x428dd4-0x0;var _0x258311=_0xc4dd[_0x428dd4];return _0x258311;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdc4d('0x0'))(_0xdc4d('0x1'));var moment=require(_0xdc4d('0x2'));var BPromise=require(_0xdc4d('0x3'));var rp=require(_0xdc4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc4d('0x5'));var config=require('../../config/environment');var attributes=require(_0xdc4d('0x6'));module[_0xdc4d('0x7')]=function(_0x33f886,_0x31b691){return _0x33f886['define'](_0xdc4d('0x8'),attributes,{'tableName':_0xdc4d('0x9'),'paranoid':![],'indexes':[{'name':_0xdc4d('0xa'),'fields':[_0xdc4d('0xb')],'type':_0xdc4d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ed4a0,_0x55ce88,_0x1fce6e){var _0x696e82=_0x33f886['models'];var _0x4c0d48=_0x3ed4a0[_0xdc4d('0xd')]({'plain':!![]});if(_0x4c0d48[_0xdc4d('0xe')][_0xdc4d('0xf')]()==='in'||_0x4c0d48[_0xdc4d('0xe')][_0xdc4d('0xf')]()===_0xdc4d('0x10')&&!_0x4c0d48[_0xdc4d('0x11')]&&!_['isNil'](_0x4c0d48[_0xdc4d('0x12')])){_0x696e82[_0xdc4d('0x13')][_0xdc4d('0x14')]({'where':{'id':_0x4c0d48[_0xdc4d('0x15')]}})[_0xdc4d('0x16')](function(_0x256f12){if(_0x256f12){_0x256f12[_0xdc4d('0x17')]({'lastMsgAt':_0x4c0d48['createdAt'],'lastMsgDirection':_0x4c0d48[_0xdc4d('0xe')][_0xdc4d('0xf')]()});}})[_0xdc4d('0x18')](function(_0x22e6b3){console[_0xdc4d('0x19')](_0x22e6b3);});}_0x1fce6e();}},'charset':_0xdc4d('0x1a'),'collate':_0xdc4d('0x1b')});}; \ No newline at end of file +var _0xdbd2=['UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbd2,0x90));var _0x2dbd=function(_0x3ed57e,_0x11c7f2){_0x3ed57e=_0x3ed57e-0x0;var _0x292b4f=_0xdbd2[_0x3ed57e];return _0x292b4f;};'use strict';var _=require(_0x2dbd('0x0'));var util=require(_0x2dbd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2dbd('0x2'));var BPromise=require('bluebird');var rp=require(_0x2dbd('0x3'));var fs=require('fs');var path=require(_0x2dbd('0x4'));var rimraf=require(_0x2dbd('0x5'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x2dbd('0x6')]=function(_0x5e2b89,_0xbbd33f){return _0x5e2b89[_0x2dbd('0x7')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x2dbd('0x8'),'fields':[_0x2dbd('0x9')],'type':_0x2dbd('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x162e5c,_0x3a1f9d,_0x3c500b){var _0x18b500=_0x5e2b89[_0x2dbd('0xb')];var _0x26fea8=_0x162e5c[_0x2dbd('0xc')]({'plain':!![]});if(_0x26fea8[_0x2dbd('0xd')]['toLowerCase']()==='in'||_0x26fea8[_0x2dbd('0xd')][_0x2dbd('0xe')]()===_0x2dbd('0xf')&&!_0x26fea8[_0x2dbd('0x10')]&&!_[_0x2dbd('0x11')](_0x26fea8[_0x2dbd('0x12')])){_0x18b500['ChatInteraction'][_0x2dbd('0x13')]({'where':{'id':_0x26fea8[_0x2dbd('0x14')]}})[_0x2dbd('0x15')](function(_0x405a31){if(_0x405a31){_0x405a31[_0x2dbd('0x16')]({'lastMsgAt':_0x26fea8[_0x2dbd('0x17')],'lastMsgDirection':_0x26fea8[_0x2dbd('0xd')][_0x2dbd('0xe')]()});}})[_0x2dbd('0x18')](function(_0x1012c5){console[_0x2dbd('0x19')](_0x1012c5);});}_0x3c500b();}},'charset':'utf8mb4','collate':_0x2dbd('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e17fff4..df6590d 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 _0xda52=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','body','options','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then'];(function(_0x52da76,_0x3cb1f2){var _0x2d1c03=function(_0x3ec6ac){while(--_0x3ec6ac){_0x52da76['push'](_0x52da76['shift']());}};_0x2d1c03(++_0x3cb1f2);}(_0xda52,0x124));var _0x2da5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2da5('0x0'));var moment=require(_0x2da5('0x1'));var BPromise=require('bluebird');var rs=require(_0x2da5('0x2'));var fs=require('fs');var Redis=require(_0x2da5('0x3'));var db=require(_0x2da5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2da5('0x5'))(_0x2da5('0x6'));var config=require(_0x2da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2da5('0x8')][_0x2da5('0x9')]({'port':0x232a});config[_0x2da5('0xa')]=_[_0x2da5('0xb')](config['redis'],{'host':_0x2da5('0xc'),'port':0x18eb});var socket=require(_0x2da5('0xd'))(new Redis(config[_0x2da5('0xa')]));require(_0x2da5('0xe'))[_0x2da5('0xf')](socket);function respondWithRpcPromise(_0x190122,_0x356671,_0x1b0016){return new BPromise(function(_0x6e930e,_0x392898){return client[_0x2da5('0x10')](_0x190122,_0x1b0016)[_0x2da5('0x11')](function(_0x5a0c3b){logger[_0x2da5('0x12')](_0x2da5('0x13'),_0x356671,_0x2da5('0x14'));logger[_0x2da5('0x15')](_0x2da5('0x16'),_0x356671,_0x2da5('0x14'),JSON['stringify'](_0x5a0c3b));if(_0x5a0c3b[_0x2da5('0x17')]){if(_0x5a0c3b['error'][_0x2da5('0x18')]===0x1f4){logger[_0x2da5('0x17')](_0x2da5('0x13'),_0x356671,_0x5a0c3b[_0x2da5('0x17')][_0x2da5('0x19')]);return _0x392898(_0x5a0c3b[_0x2da5('0x17')][_0x2da5('0x19')]);}logger[_0x2da5('0x17')](_0x2da5('0x13'),_0x356671,_0x5a0c3b[_0x2da5('0x17')][_0x2da5('0x19')]);return _0x6e930e(_0x5a0c3b[_0x2da5('0x17')][_0x2da5('0x19')]);}else{logger[_0x2da5('0x12')](_0x2da5('0x13'),_0x356671,_0x2da5('0x14'));_0x6e930e(_0x5a0c3b[_0x2da5('0x1a')][_0x2da5('0x19')]);}})[_0x2da5('0x1b')](function(_0xe4f4e1){logger['error'](_0x2da5('0x13'),_0x356671,_0xe4f4e1);_0x392898(_0xe4f4e1);});});}exports[_0x2da5('0x1c')]=function(_0x38bf63){var _0x590719=this;return new Promise(function(_0x63c34,_0x1a180a){return db['ChatMessage']['create'](_0x38bf63[_0x2da5('0x1d')],{'raw':_0x38bf63['options']?_0x38bf63[_0x2da5('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x2da5('0x11')](function(_0xc5990e){logger[_0x2da5('0x12')]('CreateChatMessage',_0x38bf63);logger['debug'](_0x2da5('0x1c'),_0x38bf63,JSON['stringify'](_0xc5990e));_0x63c34(_0xc5990e);})[_0x2da5('0x1b')](function(_0x126449){logger['error'](_0x2da5('0x1c'),_0x126449[_0x2da5('0x19')],_0x38bf63);_0x1a180a(_0x590719['error'](0x1f4,_0x126449[_0x2da5('0x19')]));});});}; \ No newline at end of file +var _0xd677=['stringify','error','message','result','create','options','CreateChatMessage','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x114964,_0xb8323b){var _0x1006cd=function(_0x59c7d4){while(--_0x59c7d4){_0x114964['push'](_0x114964['shift']());}};_0x1006cd(++_0xb8323b);}(_0xd677,0x88));var _0x7d67=function(_0x578ee9,_0x4f8c8c){_0x578ee9=_0x578ee9-0x0;var _0x2d303f=_0xd677[_0x578ee9];return _0x2d303f;};'use strict';var _=require(_0x7d67('0x0'));var util=require('util');var moment=require(_0x7d67('0x1'));var BPromise=require(_0x7d67('0x2'));var rs=require(_0x7d67('0x3'));var fs=require('fs');var Redis=require(_0x7d67('0x4'));var db=require(_0x7d67('0x5'))['db'];var utils=require(_0x7d67('0x6'));var logger=require('../../config/logger')(_0x7d67('0x7'));var config=require(_0x7d67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d67('0x9')][_0x7d67('0xa')]({'port':0x232a});config[_0x7d67('0xb')]=_[_0x7d67('0xc')](config[_0x7d67('0xb')],{'host':_0x7d67('0xd'),'port':0x18eb});var socket=require(_0x7d67('0xe'))(new Redis(config[_0x7d67('0xb')]));require(_0x7d67('0xf'))[_0x7d67('0x10')](socket);function respondWithRpcPromise(_0x4ff632,_0x3e794a,_0xb41b68){return new BPromise(function(_0x3321b9,_0x4643f8){return client[_0x7d67('0x11')](_0x4ff632,_0xb41b68)[_0x7d67('0x12')](function(_0x41f0bb){logger[_0x7d67('0x13')](_0x7d67('0x14'),_0x3e794a,_0x7d67('0x15'));logger[_0x7d67('0x16')](_0x7d67('0x17'),_0x3e794a,_0x7d67('0x15'),JSON[_0x7d67('0x18')](_0x41f0bb));if(_0x41f0bb[_0x7d67('0x19')]){if(_0x41f0bb[_0x7d67('0x19')]['code']===0x1f4){logger[_0x7d67('0x19')](_0x7d67('0x14'),_0x3e794a,_0x41f0bb[_0x7d67('0x19')][_0x7d67('0x1a')]);return _0x4643f8(_0x41f0bb['error'][_0x7d67('0x1a')]);}logger['error'](_0x7d67('0x14'),_0x3e794a,_0x41f0bb[_0x7d67('0x19')][_0x7d67('0x1a')]);return _0x3321b9(_0x41f0bb[_0x7d67('0x19')]['message']);}else{logger[_0x7d67('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3e794a,_0x7d67('0x15'));_0x3321b9(_0x41f0bb[_0x7d67('0x1b')][_0x7d67('0x1a')]);}})['catch'](function(_0x57bb8c){logger[_0x7d67('0x19')](_0x7d67('0x14'),_0x3e794a,_0x57bb8c);_0x4643f8(_0x57bb8c);});});}exports['CreateChatMessage']=function(_0x15f413){var _0x4cb85f=this;return new Promise(function(_0x5d3722,_0x1e8b93){return db['ChatMessage'][_0x7d67('0x1c')](_0x15f413['body'],{'raw':_0x15f413[_0x7d67('0x1d')]?_0x15f413[_0x7d67('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x7d67('0x12')](function(_0x20500d){logger['info'](_0x7d67('0x1e'),_0x15f413);logger[_0x7d67('0x16')](_0x7d67('0x1e'),_0x15f413,JSON['stringify'](_0x20500d));_0x5d3722(_0x20500d);})[_0x7d67('0x1f')](function(_0x1689c0){logger['error'](_0x7d67('0x1e'),_0x1689c0[_0x7d67('0x1a')],_0x15f413);_0x1e8b93(_0x4cb85f[_0x7d67('0x19')](0x1f4,_0x1689c0[_0x7d67('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 75b6823..52a07a3 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 _0x5162=['chatMessage:','./chatMessage.events','emit','removeListener','register','length'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x5162,0x103));var _0x2516=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x5162[_0x69a451];return _0x3d6ef5;};'use strict';var ChatMessageEvents=require(_0x2516('0x0'));var events=['save','remove','update'];function createListener(_0x4db25c,_0x41fd28){return function(_0x2aaef5){_0x41fd28[_0x2516('0x1')](_0x4db25c,_0x2aaef5);};}function removeListener(_0x2d0b53,_0x2e48b6){return function(){ChatMessageEvents[_0x2516('0x2')](_0x2d0b53,_0x2e48b6);};}exports[_0x2516('0x3')]=function(_0x5b71b5){for(var _0x48f411=0x0,_0x5beeb3=events[_0x2516('0x4')];_0x48f411<_0x5beeb3;_0x48f411++){var _0xba4b36=events[_0x48f411];var _0xa1557=createListener(_0x2516('0x5')+_0xba4b36,_0x5b71b5);ChatMessageEvents['on'](_0xba4b36,_0xa1557);}}; \ No newline at end of file +var _0xeb5d=['register','length','chatMessage:','save','remove','update','emit','removeListener'];(function(_0x4b52eb,_0x52ba52){var _0x4722c9=function(_0x27214c){while(--_0x27214c){_0x4b52eb['push'](_0x4b52eb['shift']());}};_0x4722c9(++_0x52ba52);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xeb5d[_0x57b54c];return _0x59cc19;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xdeb5('0x0'),_0xdeb5('0x1'),_0xdeb5('0x2')];function createListener(_0x2b0a09,_0x55bbde){return function(_0x5acd11){_0x55bbde[_0xdeb5('0x3')](_0x2b0a09,_0x5acd11);};}function removeListener(_0x16c31b,_0x546313){return function(){ChatMessageEvents[_0xdeb5('0x4')](_0x16c31b,_0x546313);};}exports[_0xdeb5('0x5')]=function(_0x164ecb){for(var _0x33af72=0x0,_0x120329=events[_0xdeb5('0x6')];_0x33af72<_0x120329;_0x33af72++){var _0x328d6b=events[_0x33af72];var _0x35c086=createListener(_0xdeb5('0x7')+_0x328d6b,_0x164ecb);ChatMessageEvents['on'](_0x328d6b,_0x35c086);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b1f7906..3d70247 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 _0xfa32=['express','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','chat','chatmessage:create','create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xfa32,0x15c));var _0x2fa3=function(_0x900549,_0x27eb1d){_0x900549=_0x900549-0x0;var _0x98dccb=_0xfa32[_0x900549];return _0x98dccb;};'use strict';var multer=require(_0x2fa3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2fa3('0x1'));var express=require(_0x2fa3('0x2'));var router=express['Router']();var fs_extra=require(_0x2fa3('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fa3('0x4'));var controller=require(_0x2fa3('0x5'));router[_0x2fa3('0x6')]('/',auth[_0x2fa3('0x7')](),controller[_0x2fa3('0x8')]);router[_0x2fa3('0x6')](_0x2fa3('0x9'),auth[_0x2fa3('0x7')](),controller[_0x2fa3('0xa')]);router[_0x2fa3('0x6')]('/:id',auth[_0x2fa3('0x7')](),controller[_0x2fa3('0xb')]);router[_0x2fa3('0xc')]('/',auth[_0x2fa3('0x7')](),interaction['tracked'](_0x2fa3('0xd'),_0x2fa3('0xe')),controller[_0x2fa3('0xf')]);router['put'](_0x2fa3('0x10'),controller['update']);router[_0x2fa3('0x11')](_0x2fa3('0x12'),auth[_0x2fa3('0x7')](),controller[_0x2fa3('0x13')]);router[_0x2fa3('0x11')](_0x2fa3('0x14'),auth['isAuthenticated'](),controller[_0x2fa3('0x15')]);router[_0x2fa3('0x16')](_0x2fa3('0x10'),auth['isAuthenticated'](),controller[_0x2fa3('0x17')]);module[_0x2fa3('0x18')]=router; \ No newline at end of file +var _0x90c6=['/:id/accept','reject','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','show','post','chat','create','put','update'];(function(_0x216a0b,_0x3c1fc4){var _0x361a85=function(_0x580231){while(--_0x580231){_0x216a0b['push'](_0x216a0b['shift']());}};_0x361a85(++_0x3c1fc4);}(_0x90c6,0xca));var _0x690c=function(_0x252e13,_0x1245f3){_0x252e13=_0x252e13-0x0;var _0x14d0a0=_0x90c6[_0x252e13];return _0x14d0a0;};'use strict';var multer=require(_0x690c('0x0'));var util=require(_0x690c('0x1'));var path=require('path');var timeout=require(_0x690c('0x2'));var express=require(_0x690c('0x3'));var router=express['Router']();var fs_extra=require(_0x690c('0x4'));var auth=require(_0x690c('0x5'));var interaction=require(_0x690c('0x6'));var config=require(_0x690c('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x690c('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x690c('0x9')]);router[_0x690c('0xa')](_0x690c('0xb'),auth[_0x690c('0x8')](),controller[_0x690c('0xc')]);router[_0x690c('0xd')]('/',auth[_0x690c('0x8')](),interaction['tracked'](_0x690c('0xe'),'chatmessage:create'),controller[_0x690c('0xf')]);router[_0x690c('0x10')](_0x690c('0xb'),controller[_0x690c('0x11')]);router[_0x690c('0x10')](_0x690c('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0x690c('0x10')]('/:id/reject',auth[_0x690c('0x8')](),controller[_0x690c('0x13')]);router[_0x690c('0x14')](_0x690c('0xb'),auth[_0x690c('0x8')](),controller[_0x690c('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index c82213b..7df0f85 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 _0xadb5=['medium','TEXT','exports'];(function(_0x52b725,_0x472562){var _0x42c075=function(_0x3b959b){while(--_0x3b959b){_0x52b725['push'](_0x52b725['shift']());}};_0x42c075(++_0x472562);}(_0xadb5,0xad));var _0x5adb=function(_0x4609e0,_0x54f20a){_0x4609e0=_0x4609e0-0x0;var _0x5e7ca2=_0xadb5[_0x4609e0];return _0x5e7ca2;};'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 +var _0xadb5=['medium','TEXT','exports'];(function(_0x2ad885,_0x35fdd5){var _0x3a2275=function(_0x320430){while(--_0x320430){_0x2ad885['push'](_0x2ad885['shift']());}};_0x3a2275(++_0x35fdd5);}(_0xadb5,0xad));var _0x5adb=function(_0x5bcf24,_0x447b79){_0x5bcf24=_0x5bcf24-0x0;var _0x301f12=_0xadb5[_0x5bcf24];return _0x301f12;};'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 684a930..d5d7889 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x530b45,_0x2ebf6d){var _0x446649=function(_0x2c18ea){while(--_0x2c18ea){_0x530b45['push'](_0x530b45['shift']());}};_0x446649(++_0x2ebf6d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _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(_0x12616a,_0x425ad8){var _0x4db9e3=function(_0x5bae10){while(--_0x5bae10){_0x12616a['push'](_0x12616a['shift']());}};_0x4db9e3(++_0x425ad8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 190f71a..72ac70e 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 _0xbeea=['remove','emit','hasOwnProperty','exports','events','update'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0xbeea,0xfa));var _0xabee=function(_0x196695,_0x516d8b){_0x196695=_0x196695-0x0;var _0x4345e6=_0xbeea[_0x196695];return _0x4345e6;};'use strict';var EventEmitter=require(_0xabee('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xabee('0x1'),'afterDestroy':_0xabee('0x2')};function emitEvent(_0x21c081){return function(_0x274882,_0x2ea93c,_0x222b23){ChatOfflineMessageEvents[_0xabee('0x3')](_0x21c081+':'+_0x274882['id'],_0x274882);ChatOfflineMessageEvents[_0xabee('0x3')](_0x21c081,_0x274882);_0x222b23(null);};}for(var e in events){if(events[_0xabee('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xabee('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x42d4=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x22614e,_0x27fbde){var _0x15e25c=function(_0x2b6141){while(--_0x2b6141){_0x22614e['push'](_0x22614e['shift']());}};_0x15e25c(++_0x27fbde);}(_0x42d4,0x8f));var _0x442d=function(_0x3e7e74,_0xed4d87){_0x3e7e74=_0x3e7e74-0x0;var _0x251ff0=_0x42d4[_0x3e7e74];return _0x251ff0;};'use strict';var EventEmitter=require(_0x442d('0x0'));var ChatOfflineMessage=require(_0x442d('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x442d('0x2'),'afterUpdate':_0x442d('0x3'),'afterDestroy':_0x442d('0x4')};function emitEvent(_0x4c3154){return function(_0x116d6e,_0x519dc2,_0x5e1a38){ChatOfflineMessageEvents[_0x442d('0x5')](_0x4c3154+':'+_0x116d6e['id'],_0x116d6e);ChatOfflineMessageEvents['emit'](_0x4c3154,_0x116d6e);_0x5e1a38(null);};}for(var e in events){if(events[_0x442d('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x442d('0x7')](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 f3b61af..b48ad8e 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 _0xc0e8=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x22d677,_0x3759a1){var _0x5bc5e1=function(_0x18be62){while(--_0x18be62){_0x22d677['push'](_0x22d677['shift']());}};_0x5bc5e1(++_0x3759a1);}(_0xc0e8,0x86));var _0x8c0e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0e8[_0xa464c9];return _0x3d73c4;};'use strict';var attributes=require(_0x8c0e('0x0'));module['exports']=function(_0x44d149){return _0x44d149[_0x8c0e('0x1')](_0x8c0e('0x2'),attributes,{'tableName':_0x8c0e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c0e('0x4'),'collate':_0x8c0e('0x5')});}; \ No newline at end of file +var _0xe31c=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe31c,0xc7));var _0xce31=function(_0x137428,_0x1d6199){_0x137428=_0x137428-0x0;var _0x9c6e15=_0xe31c[_0x137428];return _0x9c6e15;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xce31('0x0')]=function(_0x3766e9){return _0x3766e9[_0xce31('0x1')](_0xce31('0x2'),attributes,{'tableName':_0xce31('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xce31('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 2cecbee..f94953d 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 _0xcc36=['code','message','ChatOfflineMessage,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x143a6a,_0x560e0f){var _0x4bbe68=function(_0x200889){while(--_0x200889){_0x143a6a['push'](_0x143a6a['shift']());}};_0x4bbe68(++_0x560e0f);}(_0xcc36,0x1a6));var _0x6cc3=function(_0x3f4b5c,_0x6f4e03){_0x3f4b5c=_0x3f4b5c-0x0;var _0x15940f=_0xcc36[_0x3f4b5c];return _0x15940f;};'use strict';var _=require(_0x6cc3('0x0'));var util=require(_0x6cc3('0x1'));var moment=require(_0x6cc3('0x2'));var BPromise=require(_0x6cc3('0x3'));var rs=require(_0x6cc3('0x4'));var fs=require('fs');var Redis=require(_0x6cc3('0x5'));var db=require(_0x6cc3('0x6'))['db'];var utils=require(_0x6cc3('0x7'));var logger=require(_0x6cc3('0x8'))(_0x6cc3('0x9'));var config=require('../../config/environment');var jayson=require(_0x6cc3('0xa'));var client=jayson[_0x6cc3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38e122,_0x2dfd33,_0x49385e){return new BPromise(function(_0x1e9dda,_0x39abe2){return client[_0x6cc3('0xc')](_0x38e122,_0x49385e)['then'](function(_0x4344c2){logger[_0x6cc3('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2dfd33,'request\x20sent');logger[_0x6cc3('0xe')](_0x6cc3('0xf'),_0x2dfd33,'request\x20sent',JSON[_0x6cc3('0x10')](_0x4344c2));if(_0x4344c2['error']){if(_0x4344c2[_0x6cc3('0x11')][_0x6cc3('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2dfd33,_0x4344c2[_0x6cc3('0x11')][_0x6cc3('0x13')]);return _0x39abe2(_0x4344c2['error']['message']);}logger[_0x6cc3('0x11')](_0x6cc3('0x14'),_0x2dfd33,_0x4344c2[_0x6cc3('0x11')][_0x6cc3('0x13')]);return _0x1e9dda(_0x4344c2['error'][_0x6cc3('0x13')]);}else{logger[_0x6cc3('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2dfd33,'request\x20sent');_0x1e9dda(_0x4344c2[_0x6cc3('0x15')]['message']);}})['catch'](function(_0x4f4f5b){logger[_0x6cc3('0x11')](_0x6cc3('0x14'),_0x2dfd33,_0x4f4f5b);_0x39abe2(_0x4f4f5b);});});} \ No newline at end of file +var _0xb3db=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1b3e45,_0x34c2ea){var _0x9a784c=function(_0x353a86){while(--_0x353a86){_0x1b3e45['push'](_0x1b3e45['shift']());}};_0x9a784c(++_0x34c2ea);}(_0xb3db,0x159));var _0xbb3d=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xb3db[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require('lodash');var util=require(_0xbb3d('0x0'));var moment=require(_0xbb3d('0x1'));var BPromise=require(_0xbb3d('0x2'));var rs=require(_0xbb3d('0x3'));var fs=require('fs');var Redis=require(_0xbb3d('0x4'));var db=require(_0xbb3d('0x5'))['db'];var utils=require(_0xbb3d('0x6'));var logger=require('../../config/logger')(_0xbb3d('0x7'));var config=require(_0xbb3d('0x8'));var jayson=require(_0xbb3d('0x9'));var client=jayson[_0xbb3d('0xa')][_0xbb3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f4758,_0x23a9ee,_0x42ee65){return new BPromise(function(_0x13e399,_0x1211ce){return client[_0xbb3d('0xc')](_0x3f4758,_0x42ee65)[_0xbb3d('0xd')](function(_0x54221b){logger[_0xbb3d('0xe')](_0xbb3d('0xf'),_0x23a9ee,'request\x20sent');logger['debug'](_0xbb3d('0x10'),_0x23a9ee,'request\x20sent',JSON[_0xbb3d('0x11')](_0x54221b));if(_0x54221b[_0xbb3d('0x12')]){if(_0x54221b['error']['code']===0x1f4){logger[_0xbb3d('0x12')](_0xbb3d('0xf'),_0x23a9ee,_0x54221b[_0xbb3d('0x12')][_0xbb3d('0x13')]);return _0x1211ce(_0x54221b[_0xbb3d('0x12')][_0xbb3d('0x13')]);}logger[_0xbb3d('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x23a9ee,_0x54221b[_0xbb3d('0x12')][_0xbb3d('0x13')]);return _0x13e399(_0x54221b['error']['message']);}else{logger[_0xbb3d('0xe')](_0xbb3d('0xf'),_0x23a9ee,_0xbb3d('0x14'));_0x13e399(_0x54221b[_0xbb3d('0x15')][_0xbb3d('0x13')]);}})['catch'](function(_0x346908){logger[_0xbb3d('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x23a9ee,_0x346908);_0x1211ce(_0x346908);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 4fc0cb7..bf867a5 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 _0x165c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','multer','path','Router','fs-extra'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x165c,0x12c));var _0xc165=function(_0x3c8d43,_0x376f8e){_0x3c8d43=_0x3c8d43-0x0;var _0x1ba038=_0x165c[_0x3c8d43];return _0x1ba038;};'use strict';var multer=require(_0xc165('0x0'));var util=require('util');var path=require(_0xc165('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc165('0x2')]();var fs_extra=require(_0xc165('0x3'));var auth=require(_0xc165('0x4'));var interaction=require(_0xc165('0x5'));var config=require(_0xc165('0x6'));var controller=require(_0xc165('0x7'));router[_0xc165('0x8')]('/',auth['isAuthenticated'](),controller[_0xc165('0x9')]);router[_0xc165('0x8')]('/describe',auth[_0xc165('0xa')](),controller[_0xc165('0xb')]);router[_0xc165('0x8')](_0xc165('0xc'),auth[_0xc165('0xa')](),controller[_0xc165('0xd')]);router['post']('/',auth[_0xc165('0xa')](),controller[_0xc165('0xe')]);router[_0xc165('0xf')]('/:id',auth[_0xc165('0xa')](),controller[_0xc165('0x10')]);router['delete'](_0xc165('0xc'),auth[_0xc165('0xa')](),controller[_0xc165('0x11')]);module[_0xc165('0x12')]=router; \ No newline at end of file +var _0x795d=['../../components/interaction/service','../../config/environment','get','describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x1d6282,_0x1729e2){var _0x5896ba=function(_0x427429){while(--_0x427429){_0x1d6282['push'](_0x1d6282['shift']());}};_0x5896ba(++_0x1729e2);}(_0x795d,0x109));var _0xd795=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0x795d[_0xd3e0b9];return _0x470133;};'use strict';var multer=require('multer');var util=require(_0xd795('0x0'));var path=require(_0xd795('0x1'));var timeout=require(_0xd795('0x2'));var express=require(_0xd795('0x3'));var router=express['Router']();var fs_extra=require(_0xd795('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd795('0x5'));var config=require(_0xd795('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd795('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd795('0x8')]);router[_0xd795('0x7')](_0xd795('0x9'),auth[_0xd795('0xa')](),controller[_0xd795('0xb')]);router[_0xd795('0xc')]('/',auth[_0xd795('0xa')](),controller[_0xd795('0xd')]);router['put'](_0xd795('0x9'),auth[_0xd795('0xa')](),controller[_0xd795('0xe')]);router[_0xd795('0xf')](_0xd795('0x9'),auth[_0xd795('0xa')](),controller[_0xd795('0x10')]);module[_0xd795('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 6ee7a06..f339037 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 _0xde51=['STRING','ENUM','timeout','mouseOver','sequelize','exports'];(function(_0x3653da,_0x406f3){var _0x284632=function(_0xcab033){while(--_0xcab033){_0x3653da['push'](_0x3653da['shift']());}};_0x284632(++_0x406f3);}(_0xde51,0x178));var _0x1de5=function(_0x191c44,_0x20a896){_0x191c44=_0x191c44-0x0;var _0x1086cd=_0xde51[_0x191c44];return _0x1086cd;};'use strict';var Sequelize=require(_0x1de5('0x0'));module[_0x1de5('0x1')]={'name':{'type':Sequelize[_0x1de5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1de5('0x3')]('mouseOver',_0x1de5('0x4')),'defaultValue':_0x1de5('0x5')},'selector':{'type':Sequelize[_0x1de5('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6063=['INTEGER','sequelize','ENUM','mouseOver','timeout'];(function(_0x2cada4,_0x5007f8){var _0x9b6d2e=function(_0x1ade35){while(--_0x1ade35){_0x2cada4['push'](_0x2cada4['shift']());}};_0x9b6d2e(++_0x5007f8);}(_0x6063,0x79));var _0x3606=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6063[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x3606('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3606('0x1')](_0x3606('0x2'),_0x3606('0x3')),'defaultValue':_0x3606('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3606('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d9028c3..5387d79 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 _0x4e00=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','catch','params','destroy','rimraf','fast-json-patch','request-promise','mustache','path'];(function(_0x2b8764,_0x43d49f){var _0x11af3d=function(_0x492798){while(--_0x492798){_0x2b8764['push'](_0x2b8764['shift']());}};_0x11af3d(++_0x43d49f);}(_0x4e00,0xa0));var _0x04e0=function(_0x423a67,_0xe72f9d){_0x423a67=_0x423a67-0x0;var _0x575d9a=_0x4e00[_0x423a67];return _0x575d9a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04e0('0x1'));var rp=require(_0x04e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04e0('0x3'));var util=require('util');var path=require(_0x04e0('0x4'));var sox=require(_0x04e0('0x5'));var csv=require(_0x04e0('0x6'));var ejs=require(_0x04e0('0x7'));var fs=require('fs');var fs_extra=require(_0x04e0('0x8'));var _=require(_0x04e0('0x9'));var squel=require(_0x04e0('0xa'));var crypto=require('crypto');var jsforce=require(_0x04e0('0xb'));var deskjs=require(_0x04e0('0xc'));var toCsv=require(_0x04e0('0x6'));var querystring=require(_0x04e0('0xd'));var Papa=require('papaparse');var Redis=require(_0x04e0('0xe'));var authService=require(_0x04e0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04e0('0x10'));var logger=require('../../config/logger')(_0x04e0('0x11'));var utils=require(_0x04e0('0x12'));var config=require(_0x04e0('0x13'));var licenseUtil=require(_0x04e0('0x14'));var db=require(_0x04e0('0x15'))['db'];function respondWithStatusCode(_0xc0ae61,_0x2a620a){_0x2a620a=_0x2a620a||0xcc;return function(_0x323881){if(_0x323881){return _0xc0ae61['sendStatus'](_0x2a620a);}return _0xc0ae61[_0x04e0('0x16')](_0x2a620a)['end']();};}function respondWithResult(_0x1963cf,_0x29f682){_0x29f682=_0x29f682||0xc8;return function(_0xdf6702){if(_0xdf6702){return _0x1963cf['status'](_0x29f682)[_0x04e0('0x17')](_0xdf6702);}};}function respondWithFilteredResult(_0x3823f6,_0x2e28a5){return function(_0x221c66){if(_0x221c66){var _0x462cf7=typeof _0x2e28a5[_0x04e0('0x18')]===_0x04e0('0x19')&&typeof _0x2e28a5[_0x04e0('0x1a')]===_0x04e0('0x19');var _0xf7b102=_0x221c66[_0x04e0('0x1b')];var _0x1b6f4a=_0x462cf7?0x0:_0x2e28a5[_0x04e0('0x18')];var _0x5bdd6c=_0x462cf7?_0x221c66['count']:_0x2e28a5['offset']+_0x2e28a5[_0x04e0('0x1a')];var _0x3e940e;if(_0x5bdd6c>=_0xf7b102){_0x5bdd6c=_0xf7b102;_0x3e940e=0xc8;}else{_0x3e940e=0xce;}_0x3823f6[_0x04e0('0x16')](_0x3e940e);return _0x3823f6['set'](_0x04e0('0x1c'),_0x1b6f4a+'-'+_0x5bdd6c+'/'+_0xf7b102)[_0x04e0('0x17')](_0x221c66);}return null;};}function patchUpdates(_0x27e761){return function(_0x7bc646){try{jsonpatch['apply'](_0x7bc646,_0x27e761,!![]);}catch(_0x4fdbc4){return BPromise[_0x04e0('0x1d')](_0x4fdbc4);}return _0x7bc646[_0x04e0('0x1e')]();};}function saveUpdates(_0x34e44c,_0x310473){return function(_0x9e9020){if(_0x9e9020){return _0x9e9020[_0x04e0('0x1f')](_0x34e44c)[_0x04e0('0x20')](function(_0x3c3f69){return _0x3c3f69;});}return null;};}function removeEntity(_0x4566e2,_0x133b27){return function(_0x30decd){if(_0x30decd){return _0x30decd['destroy']()[_0x04e0('0x20')](function(){_0x4566e2[_0x04e0('0x16')](0xcc)[_0x04e0('0x21')]();});}};}function handleEntityNotFound(_0x2f47e1,_0x207c4c){return function(_0x50416c){if(!_0x50416c){_0x2f47e1['sendStatus'](0x194);}return _0x50416c;};}function handleError(_0x1ec359,_0x47e3be){_0x47e3be=_0x47e3be||0x1f4;return function(_0x11e64c){logger['error'](_0x11e64c['stack']);if(_0x11e64c[_0x04e0('0x22')]){delete _0x11e64c[_0x04e0('0x22')];}_0x1ec359[_0x04e0('0x16')](_0x47e3be)[_0x04e0('0x23')](_0x11e64c);};}exports[_0x04e0('0x24')]=function(_0x748569,_0xafde85){var _0x383a94={'raw':!![],'where':{'id':_0x748569['params']['id']}},_0xce81d5={};_0xce81d5[_0x04e0('0x25')]=_[_0x04e0('0x26')](db[_0x04e0('0x27')][_0x04e0('0x28')]);_0xce81d5[_0x04e0('0x29')]=_[_0x04e0('0x26')](_0x748569[_0x04e0('0x29')]);_0xce81d5['filters']=_[_0x04e0('0x2a')](_0xce81d5[_0x04e0('0x25')],_0xce81d5['query']);_0x383a94[_0x04e0('0x2b')]=_[_0x04e0('0x2a')](_0xce81d5[_0x04e0('0x25')],qs[_0x04e0('0x2c')](_0x748569[_0x04e0('0x29')]['fields']));_0x383a94['attributes']=_0x383a94[_0x04e0('0x2b')][_0x04e0('0x2d')]?_0x383a94[_0x04e0('0x2b')]:_0xce81d5[_0x04e0('0x25')];if(_0x748569[_0x04e0('0x29')][_0x04e0('0x2e')]){_0x383a94['include']=[{'all':!![]}];}_0x383a94=_[_0x04e0('0x2f')]({},_0x383a94,_0x748569[_0x04e0('0x30')]);return db['ChatProactiveAction'][_0x04e0('0x31')](_0x383a94)[_0x04e0('0x20')](handleEntityNotFound(_0xafde85,null))['then'](respondWithResult(_0xafde85,null))['catch'](handleError(_0xafde85,null));};exports[_0x04e0('0x32')]=function(_0xba549a,_0x3f29de){return db[_0x04e0('0x27')][_0x04e0('0x32')](_0xba549a[_0x04e0('0x33')],{})['then'](respondWithResult(_0x3f29de,0xc9))[_0x04e0('0x34')](handleError(_0x3f29de,null));};exports[_0x04e0('0x1f')]=function(_0xe3af2a,_0x4956b5){if(_0xe3af2a[_0x04e0('0x33')]['id']){delete _0xe3af2a[_0x04e0('0x33')]['id'];}return db[_0x04e0('0x27')][_0x04e0('0x31')]({'where':{'id':_0xe3af2a[_0x04e0('0x35')]['id']}})[_0x04e0('0x20')](handleEntityNotFound(_0x4956b5,null))[_0x04e0('0x20')](saveUpdates(_0xe3af2a[_0x04e0('0x33')],null))['then'](respondWithResult(_0x4956b5,null))['catch'](handleError(_0x4956b5,null));};exports[_0x04e0('0x36')]=function(_0x573755,_0x2a4595){return db[_0x04e0('0x27')][_0x04e0('0x31')]({'where':{'id':_0x573755['params']['id']}})['then'](handleEntityNotFound(_0x2a4595,null))[_0x04e0('0x20')](removeEntity(_0x2a4595,null))['catch'](handleError(_0x2a4595,null));}; \ No newline at end of file +var _0x24ce=['query','keys','filters','attributes','fields','includeAll','merge','options','ChatProactiveAction','find','create','body','update','catch','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','destroy','then','end','error','stack','name','send','show','params','model','rawAttributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x24ce,0x1de));var _0xe24c=function(_0x4a6f37,_0x39f336){_0x4a6f37=_0x4a6f37-0x0;var _0x5daac6=_0x24ce[_0x4a6f37];return _0x5daac6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe24c('0x0'));var zipdir=require(_0xe24c('0x1'));var jsonpatch=require(_0xe24c('0x2'));var rp=require(_0xe24c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe24c('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe24c('0x5'));var csv=require(_0xe24c('0x6'));var ejs=require(_0xe24c('0x7'));var fs=require('fs');var fs_extra=require(_0xe24c('0x8'));var _=require(_0xe24c('0x9'));var squel=require('squel');var crypto=require(_0xe24c('0xa'));var jsforce=require(_0xe24c('0xb'));var deskjs=require(_0xe24c('0xc'));var toCsv=require(_0xe24c('0x6'));var querystring=require(_0xe24c('0xd'));var Papa=require(_0xe24c('0xe'));var Redis=require(_0xe24c('0xf'));var authService=require(_0xe24c('0x10'));var qs=require(_0xe24c('0x11'));var as=require(_0xe24c('0x12'));var hardwareService=require(_0xe24c('0x13'));var logger=require(_0xe24c('0x14'))(_0xe24c('0x15'));var utils=require('../../config/utils');var config=require(_0xe24c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe24c('0x17'))['db'];function respondWithStatusCode(_0x59a9b5,_0x1030bb){_0x1030bb=_0x1030bb||0xcc;return function(_0x1492c6){if(_0x1492c6){return _0x59a9b5['sendStatus'](_0x1030bb);}return _0x59a9b5['status'](_0x1030bb)['end']();};}function respondWithResult(_0x3f0955,_0x59b4d1){_0x59b4d1=_0x59b4d1||0xc8;return function(_0x1cb6c0){if(_0x1cb6c0){return _0x3f0955[_0xe24c('0x18')](_0x59b4d1)[_0xe24c('0x19')](_0x1cb6c0);}};}function respondWithFilteredResult(_0x33979b,_0x48a435){return function(_0x21c00d){if(_0x21c00d){var _0x36b1e6=typeof _0x48a435[_0xe24c('0x1a')]===_0xe24c('0x1b')&&typeof _0x48a435[_0xe24c('0x1c')]===_0xe24c('0x1b');var _0xbd9e1d=_0x21c00d[_0xe24c('0x1d')];var _0x384bd2=_0x36b1e6?0x0:_0x48a435[_0xe24c('0x1a')];var _0xed9c0b=_0x36b1e6?_0x21c00d[_0xe24c('0x1d')]:_0x48a435[_0xe24c('0x1a')]+_0x48a435['limit'];var _0x3db589;if(_0xed9c0b>=_0xbd9e1d){_0xed9c0b=_0xbd9e1d;_0x3db589=0xc8;}else{_0x3db589=0xce;}_0x33979b[_0xe24c('0x18')](_0x3db589);return _0x33979b[_0xe24c('0x1e')]('Content-Range',_0x384bd2+'-'+_0xed9c0b+'/'+_0xbd9e1d)[_0xe24c('0x19')](_0x21c00d);}return null;};}function patchUpdates(_0x258d10){return function(_0x2462f2){try{jsonpatch[_0xe24c('0x1f')](_0x2462f2,_0x258d10,!![]);}catch(_0x3e9d00){return BPromise[_0xe24c('0x20')](_0x3e9d00);}return _0x2462f2['save']();};}function saveUpdates(_0x4def0b,_0x5a2315){return function(_0x354430){if(_0x354430){return _0x354430['update'](_0x4def0b)['then'](function(_0x7e7bda){return _0x7e7bda;});}return null;};}function removeEntity(_0x2edb8f,_0x267de3){return function(_0x4525e3){if(_0x4525e3){return _0x4525e3[_0xe24c('0x21')]()[_0xe24c('0x22')](function(){_0x2edb8f[_0xe24c('0x18')](0xcc)[_0xe24c('0x23')]();});}};}function handleEntityNotFound(_0x2b6bcf,_0x291018){return function(_0x25aeb2){if(!_0x25aeb2){_0x2b6bcf['sendStatus'](0x194);}return _0x25aeb2;};}function handleError(_0x431cde,_0x1dcd46){_0x1dcd46=_0x1dcd46||0x1f4;return function(_0x12b536){logger[_0xe24c('0x24')](_0x12b536[_0xe24c('0x25')]);if(_0x12b536[_0xe24c('0x26')]){delete _0x12b536[_0xe24c('0x26')];}_0x431cde[_0xe24c('0x18')](_0x1dcd46)[_0xe24c('0x27')](_0x12b536);};}exports[_0xe24c('0x28')]=function(_0x5c668e,_0x190cc3){var _0x375aab={'raw':!![],'where':{'id':_0x5c668e[_0xe24c('0x29')]['id']}},_0x51d81e={};_0x51d81e[_0xe24c('0x2a')]=_['keys'](db['ChatProactiveAction'][_0xe24c('0x2b')]);_0x51d81e[_0xe24c('0x2c')]=_[_0xe24c('0x2d')](_0x5c668e['query']);_0x51d81e[_0xe24c('0x2e')]=_['intersection'](_0x51d81e['model'],_0x51d81e[_0xe24c('0x2c')]);_0x375aab[_0xe24c('0x2f')]=_['intersection'](_0x51d81e['model'],qs[_0xe24c('0x30')](_0x5c668e[_0xe24c('0x2c')][_0xe24c('0x30')]));_0x375aab[_0xe24c('0x2f')]=_0x375aab['attributes']['length']?_0x375aab['attributes']:_0x51d81e[_0xe24c('0x2a')];if(_0x5c668e[_0xe24c('0x2c')][_0xe24c('0x31')]){_0x375aab['include']=[{'all':!![]}];}_0x375aab=_[_0xe24c('0x32')]({},_0x375aab,_0x5c668e[_0xe24c('0x33')]);return db[_0xe24c('0x34')][_0xe24c('0x35')](_0x375aab)[_0xe24c('0x22')](handleEntityNotFound(_0x190cc3,null))['then'](respondWithResult(_0x190cc3,null))['catch'](handleError(_0x190cc3,null));};exports[_0xe24c('0x36')]=function(_0x77f337,_0x530f2e){return db['ChatProactiveAction'][_0xe24c('0x36')](_0x77f337[_0xe24c('0x37')],{})[_0xe24c('0x22')](respondWithResult(_0x530f2e,0xc9))['catch'](handleError(_0x530f2e,null));};exports[_0xe24c('0x38')]=function(_0x725784,_0x614472){if(_0x725784[_0xe24c('0x37')]['id']){delete _0x725784[_0xe24c('0x37')]['id'];}return db['ChatProactiveAction'][_0xe24c('0x35')]({'where':{'id':_0x725784[_0xe24c('0x29')]['id']}})[_0xe24c('0x22')](handleEntityNotFound(_0x614472,null))['then'](saveUpdates(_0x725784[_0xe24c('0x37')],null))[_0xe24c('0x22')](respondWithResult(_0x614472,null))['catch'](handleError(_0x614472,null));};exports[_0xe24c('0x21')]=function(_0x327a24,_0x1338b9){return db[_0xe24c('0x34')][_0xe24c('0x35')]({'where':{'id':_0x327a24[_0xe24c('0x29')]['id']}})[_0xe24c('0x22')](handleEntityNotFound(_0x1338b9,null))[_0xe24c('0x22')](removeEntity(_0x1338b9,null))[_0xe24c('0x39')](handleError(_0x1338b9,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 292eb77..01a8db5 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 _0x4735=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x41b986,_0x5a1dc2){var _0x5ede09=function(_0x2b91ff){while(--_0x2b91ff){_0x41b986['push'](_0x41b986['shift']());}};_0x5ede09(++_0x5a1dc2);}(_0x4735,0x128));var _0x5473=function(_0xc5bb7f,_0x336c16){_0xc5bb7f=_0xc5bb7f-0x0;var _0x5ed8f7=_0x4735[_0xc5bb7f];return _0x5ed8f7;};'use strict';var _=require(_0x5473('0x0'));var util=require(_0x5473('0x1'));var logger=require(_0x5473('0x2'))(_0x5473('0x3'));var moment=require(_0x5473('0x4'));var BPromise=require(_0x5473('0x5'));var rp=require(_0x5473('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5473('0x7'));var config=require(_0x5473('0x8'));var attributes=require(_0x5473('0x9'));module[_0x5473('0xa')]=function(_0x302f5e,_0xf804bd){return _0x302f5e['define'](_0x5473('0xb'),attributes,{'tableName':_0x5473('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a17=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','bluebird'];(function(_0x453810,_0x4de33e){var _0x37f3cb=function(_0x297e0a){while(--_0x297e0a){_0x453810['push'](_0x453810['shift']());}};_0x37f3cb(++_0x4de33e);}(_0x6a17,0x15d));var _0x76a1=function(_0x3b506a,_0x5960f5){_0x3b506a=_0x3b506a-0x0;var _0x4e12a2=_0x6a17[_0x3b506a];return _0x4e12a2;};'use strict';var _=require('lodash');var util=require(_0x76a1('0x0'));var logger=require('../../config/logger')(_0x76a1('0x1'));var moment=require('moment');var BPromise=require(_0x76a1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76a1('0x3'));var rimraf=require(_0x76a1('0x4'));var config=require(_0x76a1('0x5'));var attributes=require(_0x76a1('0x6'));module[_0x76a1('0x7')]=function(_0x3c9c0f,_0x2c61e1){return _0x3c9c0f[_0x76a1('0x8')](_0x76a1('0x9'),attributes,{'tableName':_0x76a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 87eb71d..3243420 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 _0xbd8f=['ioredis','jayson/promise','http','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring'];(function(_0x336de5,_0x1da2f3){var _0x47974b=function(_0x5ed220){while(--_0x5ed220){_0x336de5['push'](_0x336de5['shift']());}};_0x47974b(++_0x1da2f3);}(_0xbd8f,0x8d));var _0xfbd8=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0xbd8f[_0x1c2aeb];return _0x783379;};'use strict';var _=require('lodash');var util=require(_0xfbd8('0x0'));var moment=require('moment');var BPromise=require(_0xfbd8('0x1'));var rs=require(_0xfbd8('0x2'));var fs=require('fs');var Redis=require(_0xfbd8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfbd8('0x4'));var client=jayson['client'][_0xfbd8('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x53627c,_0x3cfda0,_0x56ca00){return new BPromise(function(_0xf84ff1,_0x240c37){return client['request'](_0x53627c,_0x56ca00)[_0xfbd8('0x6')](function(_0x876da){logger[_0xfbd8('0x7')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cfda0,'request\x20sent');logger[_0xfbd8('0x8')](_0xfbd8('0x9'),_0x3cfda0,_0xfbd8('0xa'),JSON[_0xfbd8('0xb')](_0x876da));if(_0x876da[_0xfbd8('0xc')]){if(_0x876da[_0xfbd8('0xc')][_0xfbd8('0xd')]===0x1f4){logger['error'](_0xfbd8('0xe'),_0x3cfda0,_0x876da[_0xfbd8('0xc')][_0xfbd8('0xf')]);return _0x240c37(_0x876da[_0xfbd8('0xc')]['message']);}logger[_0xfbd8('0xc')](_0xfbd8('0xe'),_0x3cfda0,_0x876da[_0xfbd8('0xc')][_0xfbd8('0xf')]);return _0xf84ff1(_0x876da[_0xfbd8('0xc')][_0xfbd8('0xf')]);}else{logger['info'](_0xfbd8('0xe'),_0x3cfda0,'request\x20sent');_0xf84ff1(_0x876da[_0xfbd8('0x10')][_0xfbd8('0xf')]);}})[_0xfbd8('0x11')](function(_0x4da4d1){logger[_0xfbd8('0xc')](_0xfbd8('0xe'),_0x3cfda0,_0x4da4d1);_0x240c37(_0x4da4d1);});});} \ No newline at end of file +var _0x20b3=['ChatProactiveAction,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code'];(function(_0x447955,_0x95e57e){var _0x445e19=function(_0x580775){while(--_0x580775){_0x447955['push'](_0x447955['shift']());}};_0x445e19(++_0x95e57e);}(_0x20b3,0xd6));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x320b('0x0'));var util=require(_0x320b('0x1'));var moment=require('moment');var BPromise=require(_0x320b('0x2'));var rs=require(_0x320b('0x3'));var fs=require('fs');var Redis=require(_0x320b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x320b('0x5'));var logger=require('../../config/logger')(_0x320b('0x6'));var config=require(_0x320b('0x7'));var jayson=require(_0x320b('0x8'));var client=jayson[_0x320b('0x9')][_0x320b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316b1a,_0x294eef,_0x4e740f){return new BPromise(function(_0x1a536e,_0x37b0c6){return client[_0x320b('0xb')](_0x316b1a,_0x4e740f)['then'](function(_0x45e431){logger[_0x320b('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x294eef,'request\x20sent');logger[_0x320b('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x294eef,'request\x20sent',JSON[_0x320b('0xe')](_0x45e431));if(_0x45e431[_0x320b('0xf')]){if(_0x45e431['error'][_0x320b('0x10')]===0x1f4){logger[_0x320b('0xf')](_0x320b('0x11'),_0x294eef,_0x45e431[_0x320b('0xf')][_0x320b('0x12')]);return _0x37b0c6(_0x45e431[_0x320b('0xf')][_0x320b('0x12')]);}logger[_0x320b('0xf')](_0x320b('0x11'),_0x294eef,_0x45e431[_0x320b('0xf')]['message']);return _0x1a536e(_0x45e431[_0x320b('0xf')][_0x320b('0x12')]);}else{logger[_0x320b('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x294eef,_0x320b('0x13'));_0x1a536e(_0x45e431[_0x320b('0x14')][_0x320b('0x12')]);}})['catch'](function(_0x443a3d){logger[_0x320b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x294eef,_0x443a3d);_0x37b0c6(_0x443a3d);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 2c95231..d44dad6 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 _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x83a130,_0x38aece){var _0xa3018b=function(_0x12ce27){while(--_0x12ce27){_0x83a130['push'](_0x83a130['shift']());}};_0xa3018b(++_0x38aece);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router; \ No newline at end of file +var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x425d,0x1e0));var _0xd425=function(_0x3a698f,_0x4a82fc){_0x3a698f=_0x3a698f-0x0;var _0x1b7cf3=_0x425d[_0x3a698f];return _0x1b7cf3;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index c1bd222..c99d5ac 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 _0x4776=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4776,0xe1));var _0x6477=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x4776[_0x4c445a];return _0x2f611c;};'use strict';var Sequelize=require(_0x6477('0x0'));module[_0x6477('0x1')]={'name':{'type':Sequelize[_0x6477('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6477('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6477('0x4')](_0x6477('0x5'),'beepall',_0x6477('0x6'))}}; \ No newline at end of file +var _0xd8a4=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x3cad88,_0x557b98){var _0x229909=function(_0x2fbadb){while(--_0x2fbadb){_0x3cad88['push'](_0x3cad88['shift']());}};_0x229909(++_0x557b98);}(_0xd8a4,0x1c5));var _0x4d8a=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xd8a4[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x4d8a('0x0'));module[_0x4d8a('0x1')]={'name':{'type':Sequelize[_0x4d8a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4d8a('0x2')]},'timeout':{'type':Sequelize[_0x4d8a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4d8a('0x4'),'beepall',_0x4d8a('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index a5104c7..60a5f2c 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 _0x38d1=['crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ChatQueue','include','findAll','rows','show','params','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','describe','findOne','UserChatQueue','nolimit','ChatQueueId','User','UserId','agent','chatPause','updatedAt','format','SIP','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x38d1,0x11b));var _0x138d=function(_0x2ca857,_0x151170){_0x2ca857=_0x2ca857-0x0;var _0x4eac9a=_0x38d1[_0x2ca857];return _0x4eac9a;};'use strict';var emlformat=require(_0x138d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x138d('0x1'));var jsonpatch=require(_0x138d('0x2'));var rp=require(_0x138d('0x3'));var moment=require(_0x138d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x138d('0x5'));var util=require(_0x138d('0x6'));var path=require('path');var sox=require(_0x138d('0x7'));var csv=require(_0x138d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x138d('0x9'));var _=require(_0x138d('0xa'));var squel=require('squel');var crypto=require(_0x138d('0xb'));var jsforce=require(_0x138d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x138d('0x8'));var querystring=require('querystring');var Papa=require(_0x138d('0xd'));var Redis=require('ioredis');var authService=require(_0x138d('0xe'));var qs=require(_0x138d('0xf'));var as=require(_0x138d('0x10'));var hardwareService=require(_0x138d('0x11'));var logger=require(_0x138d('0x12'))('api');var utils=require(_0x138d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x138d('0x14'));var db=require(_0x138d('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x138d('0x16'),'port':0x18eb});var socket=require(_0x138d('0x17'))(new Redis(config[_0x138d('0x18')]));require('./chatQueue.socket')[_0x138d('0x19')](socket);var jayson=require(_0x138d('0x1a'));var client=jayson[_0x138d('0x1b')][_0x138d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x26762a,_0x377d9d,_0xe83306,_0x26aff9){return new BPromise(function(_0x5caa5b,_0x56d67a){var _0x4a7cdb=_0x26aff9||client;return _0x4a7cdb['request'](_0x26762a,_0xe83306)[_0x138d('0x1d')](function(_0xd71657){logger[_0x138d('0x1e')](_0x138d('0x1f'),_0x377d9d,_0x138d('0x20'));logger[_0x138d('0x21')](_0x138d('0x22'),_0x377d9d,_0x138d('0x20'),JSON[_0x138d('0x23')](_0xd71657));if(_0xd71657[_0x138d('0x24')]){if(_0xd71657[_0x138d('0x24')][_0x138d('0x25')]===0x1f4){logger[_0x138d('0x24')](_0x138d('0x1f'),_0x377d9d,_0xd71657[_0x138d('0x24')]['message']);return _0x56d67a(_0xd71657[_0x138d('0x24')][_0x138d('0x26')]);}logger[_0x138d('0x24')](_0x138d('0x1f'),_0x377d9d,_0xd71657['error']['message']);return _0x5caa5b(_0xd71657[_0x138d('0x24')][_0x138d('0x26')]);}else{logger[_0x138d('0x1e')](_0x138d('0x1f'),_0x377d9d,_0x138d('0x20'));_0x5caa5b(_0xd71657[_0x138d('0x27')][_0x138d('0x26')]);}})[_0x138d('0x28')](function(_0x28f37a){logger['error'](_0x138d('0x1f'),_0x377d9d,_0x28f37a);_0x56d67a(_0x28f37a);});});}function respondWithStatusCode(_0x52ccce,_0x5179c6){_0x5179c6=_0x5179c6||0xcc;return function(_0x329128){if(_0x329128){return _0x52ccce[_0x138d('0x29')](_0x5179c6);}return _0x52ccce[_0x138d('0x2a')](_0x5179c6)[_0x138d('0x2b')]();};}function respondWithResult(_0x2e984e,_0x35a237){_0x35a237=_0x35a237||0xc8;return function(_0x3e958e){if(_0x3e958e){return _0x2e984e[_0x138d('0x2a')](_0x35a237)[_0x138d('0x2c')](_0x3e958e);}};}function respondWithFilteredResult(_0x34e7f4,_0x190ec7){return function(_0x3b0884){if(_0x3b0884){var _0x2b6833=typeof _0x190ec7[_0x138d('0x2d')]==='undefined'&&typeof _0x190ec7['limit']===_0x138d('0x2e');var _0x40aeb=_0x3b0884[_0x138d('0x2f')];var _0x156a7f=_0x2b6833?0x0:_0x190ec7[_0x138d('0x2d')];var _0x32ee92=_0x2b6833?_0x3b0884[_0x138d('0x2f')]:_0x190ec7[_0x138d('0x2d')]+_0x190ec7[_0x138d('0x30')];var _0x12757f;if(_0x32ee92>=_0x40aeb){_0x32ee92=_0x40aeb;_0x12757f=0xc8;}else{_0x12757f=0xce;}_0x34e7f4['status'](_0x12757f);return _0x34e7f4[_0x138d('0x31')](_0x138d('0x32'),_0x156a7f+'-'+_0x32ee92+'/'+_0x40aeb)[_0x138d('0x2c')](_0x3b0884);}return null;};}function patchUpdates(_0x4a8deb){return function(_0x635429){try{jsonpatch['apply'](_0x635429,_0x4a8deb,!![]);}catch(_0x2fd812){return BPromise[_0x138d('0x33')](_0x2fd812);}return _0x635429['save']();};}function saveUpdates(_0x46519e,_0x45b1a2){return function(_0x156045){if(_0x156045){return _0x156045[_0x138d('0x34')](_0x46519e)[_0x138d('0x1d')](function(_0x51c7fe){return _0x51c7fe;});}return null;};}function removeEntity(_0x1e3cdc,_0x2af981){return function(_0x254330){if(_0x254330){return _0x254330[_0x138d('0x35')]()[_0x138d('0x1d')](function(){var _0x510a11=_0x254330['get']({'plain':!![]});var _0x1a465d=_0x138d('0x36');return db[_0x138d('0x37')][_0x138d('0x35')]({'where':{'type':_0x1a465d,'resourceId':_0x510a11['id']}})['then'](function(){return _0x254330;});})['then'](function(){_0x1e3cdc[_0x138d('0x2a')](0xcc)[_0x138d('0x2b')]();});}};}function handleEntityNotFound(_0xaabd1f,_0x1f98b6){return function(_0x4ebd31){if(!_0x4ebd31){_0xaabd1f[_0x138d('0x29')](0x194);}return _0x4ebd31;};}function handleError(_0x3823ec,_0x18ef51){_0x18ef51=_0x18ef51||0x1f4;return function(_0x1c71ae){logger[_0x138d('0x24')](_0x1c71ae[_0x138d('0x38')]);if(_0x1c71ae['name']){delete _0x1c71ae[_0x138d('0x39')];}_0x3823ec[_0x138d('0x2a')](_0x18ef51)[_0x138d('0x3a')](_0x1c71ae);};}exports[_0x138d('0x3b')]=function(_0x51c5ea,_0x24e306){var _0x5d74b3={},_0x4fd72f={},_0x4fe218={'count':0x0,'rows':[]};var _0xf8e90b=_[_0x138d('0x3c')](db['ChatQueue'][_0x138d('0x3d')],function(_0x209f14){return{'name':_0x209f14[_0x138d('0x3e')],'type':_0x209f14[_0x138d('0x3f')][_0x138d('0x40')]};});_0x4fd72f['model']=_[_0x138d('0x3c')](_0xf8e90b,_0x138d('0x39'));_0x4fd72f[_0x138d('0x41')]=_[_0x138d('0x42')](_0x51c5ea[_0x138d('0x41')]);_0x4fd72f[_0x138d('0x43')]=_[_0x138d('0x44')](_0x4fd72f[_0x138d('0x45')],_0x4fd72f['query']);_0x5d74b3[_0x138d('0x46')]=_[_0x138d('0x44')](_0x4fd72f[_0x138d('0x45')],qs[_0x138d('0x47')](_0x51c5ea[_0x138d('0x41')][_0x138d('0x47')]));_0x5d74b3[_0x138d('0x46')]=_0x5d74b3['attributes'][_0x138d('0x48')]?_0x5d74b3['attributes']:_0x4fd72f[_0x138d('0x45')];if(!_0x51c5ea[_0x138d('0x41')][_0x138d('0x49')]('nolimit')){_0x5d74b3[_0x138d('0x30')]=qs[_0x138d('0x30')](_0x51c5ea['query'][_0x138d('0x30')]);_0x5d74b3['offset']=qs[_0x138d('0x2d')](_0x51c5ea[_0x138d('0x41')]['offset']);}_0x5d74b3[_0x138d('0x4a')]=qs[_0x138d('0x4b')](_0x51c5ea[_0x138d('0x41')][_0x138d('0x4b')]);_0x5d74b3[_0x138d('0x4c')]=qs['filters'](_[_0x138d('0x4d')](_0x51c5ea[_0x138d('0x41')],_0x4fd72f['filters']),_0xf8e90b);if(_0x51c5ea[_0x138d('0x41')][_0x138d('0x4e')]){_0x5d74b3[_0x138d('0x4c')]=_[_0x138d('0x4f')](_0x5d74b3[_0x138d('0x4c')],{'$or':_['map'](_0xf8e90b,function(_0x4538db){if(_0x4538db[_0x138d('0x3f')]!=='VIRTUAL'){var _0x4d5443={};_0x4d5443[_0x4538db[_0x138d('0x39')]]={'$like':'%'+_0x51c5ea[_0x138d('0x41')][_0x138d('0x4e')]+'%'};return _0x4d5443;}})});}_0x5d74b3=_[_0x138d('0x4f')]({},_0x5d74b3,_0x51c5ea[_0x138d('0x50')]);var _0x11e4d4={'where':_0x5d74b3[_0x138d('0x4c')]};return db[_0x138d('0x51')][_0x138d('0x2f')](_0x11e4d4)[_0x138d('0x1d')](function(_0x311c74){_0x4fe218[_0x138d('0x2f')]=_0x311c74;if(_0x51c5ea[_0x138d('0x41')]['includeAll']){_0x5d74b3[_0x138d('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0x138d('0x53')](_0x5d74b3);})[_0x138d('0x1d')](function(_0x580ace){_0x4fe218[_0x138d('0x54')]=_0x580ace;return _0x4fe218;})[_0x138d('0x1d')](respondWithFilteredResult(_0x24e306,_0x5d74b3))[_0x138d('0x28')](handleError(_0x24e306,null));};exports[_0x138d('0x55')]=function(_0x4132e5,_0x1f3a69){var _0x567163={'raw':!![],'where':{'id':_0x4132e5[_0x138d('0x56')]['id']}},_0x3ec289={};_0x3ec289[_0x138d('0x45')]=_[_0x138d('0x42')](db[_0x138d('0x51')][_0x138d('0x3d')]);_0x3ec289[_0x138d('0x41')]=_[_0x138d('0x42')](_0x4132e5[_0x138d('0x41')]);_0x3ec289[_0x138d('0x43')]=_[_0x138d('0x44')](_0x3ec289['model'],_0x3ec289[_0x138d('0x41')]);_0x567163[_0x138d('0x46')]=_[_0x138d('0x44')](_0x3ec289[_0x138d('0x45')],qs['fields'](_0x4132e5['query'][_0x138d('0x47')]));_0x567163[_0x138d('0x46')]=_0x567163[_0x138d('0x46')]['length']?_0x567163[_0x138d('0x46')]:_0x3ec289[_0x138d('0x45')];if(_0x4132e5[_0x138d('0x41')][_0x138d('0x57')]){_0x567163[_0x138d('0x52')]=[{'all':!![]}];}_0x567163=_[_0x138d('0x4f')]({},_0x567163,_0x4132e5[_0x138d('0x50')]);return db[_0x138d('0x51')][_0x138d('0x58')](_0x567163)[_0x138d('0x1d')](handleEntityNotFound(_0x1f3a69,null))[_0x138d('0x1d')](respondWithResult(_0x1f3a69,null))[_0x138d('0x28')](handleError(_0x1f3a69,null));};exports[_0x138d('0x59')]=function(_0x3db72b,_0x4b972b){return db[_0x138d('0x51')][_0x138d('0x59')](_0x3db72b[_0x138d('0x5a')],{})[_0x138d('0x1d')](function(_0x4a335f){var _0x10201b=_0x3db72b['user'][_0x138d('0x5b')]({'plain':!![]});if(!_0x10201b)throw new Error(_0x138d('0x5c'));if(_0x10201b['role']===_0x138d('0x5d')){var _0x4a8fd7=_0x4a335f[_0x138d('0x5b')]({'plain':!![]});var _0x176f3c=_0x138d('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x176f3c,'userProfileId':_0x10201b['userProfileId']},'raw':!![]})[_0x138d('0x1d')](function(_0xbedcb2){if(_0xbedcb2&&_0xbedcb2[_0x138d('0x5e')]===0x0){return db[_0x138d('0x37')][_0x138d('0x59')]({'name':_0x4a8fd7['name'],'resourceId':_0x4a8fd7['id'],'type':_0xbedcb2[_0x138d('0x39')],'sectionId':_0xbedcb2['id']},{})[_0x138d('0x1d')](function(){return _0x4a335f;});}else{return _0x4a335f;}})[_0x138d('0x28')](function(_0x4e4c2a){logger[_0x138d('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e4c2a);throw _0x4e4c2a;});}return _0x4a335f;})[_0x138d('0x1d')](respondWithResult(_0x4b972b,0xc9))['catch'](handleError(_0x4b972b,null));};exports[_0x138d('0x34')]=function(_0x431f27,_0x62c2fd){if(_0x431f27['body']['id']){delete _0x431f27[_0x138d('0x5a')]['id'];}return db[_0x138d('0x51')][_0x138d('0x58')]({'where':{'id':_0x431f27[_0x138d('0x56')]['id']}})[_0x138d('0x1d')](handleEntityNotFound(_0x62c2fd,null))[_0x138d('0x1d')](saveUpdates(_0x431f27['body'],null))[_0x138d('0x1d')](respondWithResult(_0x62c2fd,null))['catch'](handleError(_0x62c2fd,null));};exports[_0x138d('0x35')]=function(_0x12659c,_0x2e4963){return db[_0x138d('0x51')][_0x138d('0x58')]({'where':{'id':_0x12659c[_0x138d('0x56')]['id']}})[_0x138d('0x1d')](handleEntityNotFound(_0x2e4963,null))[_0x138d('0x1d')](removeEntity(_0x2e4963,null))[_0x138d('0x28')](handleError(_0x2e4963,null));};exports['describe']=function(_0xa2158b,_0x23aeb0){return db['ChatQueue'][_0x138d('0x5f')]()[_0x138d('0x1d')](respondWithResult(_0x23aeb0,null))[_0x138d('0x28')](handleError(_0x23aeb0,null));};exports['getMembers']=function(_0x1002ee,_0x4db976,_0x40c38b){var _0x2ff4db={'raw':!![],'where':{}},_0x436fea={},_0x59257b;return db[_0x138d('0x51')][_0x138d('0x60')]({'where':{'id':_0x1002ee[_0x138d('0x56')]['id']}})[_0x138d('0x1d')](handleEntityNotFound(_0x4db976,null))[_0x138d('0x1d')](function(_0x5fcdd4){if(_0x5fcdd4){_0x59257b=_0x5fcdd4[_0x138d('0x5b')]({'plain':!![]});_0x436fea['model']=_[_0x138d('0x42')](db[_0x138d('0x61')][_0x138d('0x3d')]);_0x436fea['query']=_[_0x138d('0x42')](_0x1002ee[_0x138d('0x41')]);_0x436fea[_0x138d('0x43')]=_[_0x138d('0x44')](_0x436fea['model'],_0x436fea[_0x138d('0x41')]);_0x2ff4db[_0x138d('0x46')]=_[_0x138d('0x44')](_0x436fea[_0x138d('0x45')],qs[_0x138d('0x47')](_0x1002ee[_0x138d('0x41')][_0x138d('0x47')]));_0x2ff4db[_0x138d('0x46')]=_0x2ff4db[_0x138d('0x46')][_0x138d('0x48')]?_0x2ff4db['attributes']:_0x436fea['model'];if(!_0x1002ee[_0x138d('0x41')]['hasOwnProperty'](_0x138d('0x62'))){_0x2ff4db[_0x138d('0x30')]=qs[_0x138d('0x30')](_0x1002ee[_0x138d('0x41')][_0x138d('0x30')]);_0x2ff4db[_0x138d('0x2d')]=qs['offset'](_0x1002ee[_0x138d('0x41')][_0x138d('0x2d')]);}_0x2ff4db[_0x138d('0x4a')]=qs[_0x138d('0x4b')](_0x1002ee[_0x138d('0x41')]['sort']);_0x2ff4db[_0x138d('0x4c')]=qs[_0x138d('0x43')](_['pick'](_0x1002ee[_0x138d('0x41')],_0x436fea[_0x138d('0x43')]));_0x2ff4db[_0x138d('0x4c')][_0x138d('0x63')]=_0x5fcdd4['id'];if(_0x1002ee[_0x138d('0x41')][_0x138d('0x4e')]){_0x2ff4db[_0x138d('0x4c')]=_[_0x138d('0x4f')](_0x2ff4db[_0x138d('0x4c')],{'$or':_[_0x138d('0x3c')](_0x2ff4db['attributes'],function(_0x534001){var _0x1cc4ed={};_0x1cc4ed[_0x534001]={'$like':'%'+_0x1002ee[_0x138d('0x41')][_0x138d('0x4e')]+'%'};return _0x1cc4ed;})});}_0x2ff4db=_[_0x138d('0x4f')]({},_0x2ff4db,_0x1002ee[_0x138d('0x50')]);return db[_0x138d('0x61')]['findAll'](_0x2ff4db);}})[_0x138d('0x1d')](function(_0x2eedf9){if(_0x2eedf9){return db[_0x138d('0x64')]['findAndCountAll']({'where':{'id':_['map'](_0x2eedf9,_0x138d('0x65')),'role':_0x138d('0x66')},'attributes':['id',_0x138d('0x39'),_0x138d('0x67'),_0x138d('0x68'),'createdAt']});}})[_0x138d('0x1d')](function(_0x29b793){if(_0x29b793){return{'count':_0x29b793[_0x138d('0x2f')],'rows':_[_0x138d('0x3c')](_0x29b793[_0x138d('0x54')],function(_0x665f6e){return{'membername':_0x665f6e[_0x138d('0x39')],'UserId':_0x665f6e['id'],'queue_name':_0x59257b[_0x138d('0x39')],'ChatQueueId':_0x59257b['id'],'interface':util[_0x138d('0x69')]('%s/%s',_0x138d('0x6a'),_0x665f6e[_0x138d('0x39')]),'penalty':0x0,'paused':_0x665f6e['chatPause'],'createdAt':_0x665f6e['createdAt'],'updatedAt':_0x665f6e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x138d('0x1d')](respondWithFilteredResult(_0x4db976,_0x2ff4db))['catch'](handleError(_0x4db976,null));};exports['getTeams']=function(_0x58947e,_0x5cdd77,_0x25c306){var _0x2cf80d={};var _0x2d24bb={};var _0x5f28dc;var _0x52ce24;return db[_0x138d('0x51')][_0x138d('0x60')]({'where':{'id':_0x58947e[_0x138d('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cdd77,null))['then'](function(_0x4e90c7){if(_0x4e90c7){_0x5f28dc=_0x4e90c7;_0x2d24bb[_0x138d('0x45')]=_['keys'](db[_0x138d('0x6b')][_0x138d('0x3d')]);_0x2d24bb[_0x138d('0x41')]=_[_0x138d('0x42')](_0x58947e[_0x138d('0x41')]);_0x2d24bb[_0x138d('0x43')]=_[_0x138d('0x44')](_0x2d24bb[_0x138d('0x45')],_0x2d24bb[_0x138d('0x41')]);_0x2cf80d['attributes']=_[_0x138d('0x44')](_0x2d24bb[_0x138d('0x45')],qs['fields'](_0x58947e[_0x138d('0x41')][_0x138d('0x47')]));_0x2cf80d[_0x138d('0x46')]=_0x2cf80d['attributes'][_0x138d('0x48')]?_0x2cf80d['attributes']:_0x2d24bb[_0x138d('0x45')];_0x2cf80d[_0x138d('0x4a')]=qs[_0x138d('0x4b')](_0x58947e[_0x138d('0x41')]['sort']);_0x2cf80d['where']=qs[_0x138d('0x43')](_[_0x138d('0x4d')](_0x58947e[_0x138d('0x41')],_0x2d24bb[_0x138d('0x43')]));if(_0x58947e['query']['filter']){_0x2cf80d['where']=_[_0x138d('0x4f')](_0x2cf80d[_0x138d('0x4c')],{'$or':_['map'](_0x2cf80d[_0x138d('0x46')],function(_0x52010c){var _0x1c83e2={};_0x1c83e2[_0x52010c]={'$like':'%'+_0x58947e[_0x138d('0x41')][_0x138d('0x4e')]+'%'};return _0x1c83e2;})});}_0x2cf80d=_[_0x138d('0x4f')]({},_0x2cf80d,_0x58947e[_0x138d('0x50')]);return _0x5f28dc[_0x138d('0x6c')](_0x2cf80d);}})['then'](function(_0x53303c){if(_0x53303c){_0x52ce24=_0x53303c[_0x138d('0x48')];if(!_0x58947e[_0x138d('0x41')][_0x138d('0x49')](_0x138d('0x62'))){_0x2cf80d[_0x138d('0x30')]=qs[_0x138d('0x30')](_0x58947e['query'][_0x138d('0x30')]);_0x2cf80d['offset']=qs[_0x138d('0x2d')](_0x58947e[_0x138d('0x41')][_0x138d('0x2d')]);}return _0x5f28dc[_0x138d('0x6c')](_0x2cf80d);}})[_0x138d('0x1d')](function(_0x28a340){if(_0x28a340){return _0x28a340?{'count':_0x52ce24,'rows':_0x28a340}:null;}})['then'](respondWithResult(_0x5cdd77,null))['catch'](handleError(_0x5cdd77,null));};exports[_0x138d('0x6d')]=function(_0x35df7d,_0x34022f,_0x257b11){var _0xf66ff=_0x35df7d[_0x138d('0x5a')][_0x138d('0x6e')];return db[_0x138d('0x6b')][_0x138d('0x53')]({'where':{'id':_0xf66ff},'attributes':['id'],'include':[{'model':db[_0x138d('0x64')],'as':_0x138d('0x6f'),'attributes':['id',_0x138d('0x39'),'online',_0x138d('0x70'),_0x138d('0x71')],'raw':!![]}]})[_0x138d('0x1d')](function(_0x2d894c){if(_0x2d894c){var _0x13a2e7=_['flatMap'](_0x2d894c,function(_0x249272){var _0x2570ec=_0x249272[_0x138d('0x5b')]({'plain':!![]});return _0x2570ec['Agents'];});return db[_0x138d('0x51')][_0x138d('0x58')]({'where':{'id':_0x35df7d['params']['id']}})[_0x138d('0x1d')](function(_0x59332a){return db[_0x138d('0x72')]['transaction'](function(_0x2be139){return _0x59332a[_0x138d('0x6d')](_0xf66ff,{'transaction':_0x2be139})[_0x138d('0x1d')](function(){return BPromise['each'](_0x13a2e7,function(_0x1aa6fc){return db[_0x138d('0x61')][_0x138d('0x73')]({'where':{'UserId':_0x1aa6fc['id'],'ChatQueueId':_0x35df7d[_0x138d('0x56')]['id']},'transaction':_0x2be139});});})[_0x138d('0x1d')](function(){_0x13a2e7[_0x138d('0x74')](function(_0x190526){socket[_0x138d('0x75')]('userChatQueue:save',{'UserId':_0x190526['id'],'ChatQueueId':_0x59332a['id']});});});});});}})[_0x138d('0x1d')](respondWithStatusCode(_0x34022f,null))['catch'](handleError(_0x34022f,null));};exports[_0x138d('0x76')]=function(_0x3ca329,_0xcd86ec,_0x4d30f9){return db[_0x138d('0x6b')][_0x138d('0x53')]({'where':{'id':_0x3ca329[_0x138d('0x41')][_0x138d('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x138d('0x1d')](handleEntityNotFound(_0xcd86ec,null))[_0x138d('0x1d')](function(_0x39a28e){var _0x429ca8=_[_0x138d('0x3c')](_0x39a28e,'id');var _0x28d99e=[];var _0x925a24=[];var _0x424ae4=squel[_0x138d('0x77')]();_0x424ae4[_0x138d('0x78')](_0x138d('0x79'))[_0x138d('0x7a')]('team_has_chat_queues','tq')[_0x138d('0x7b')]('user_has_teams','ut',_0x138d('0x7c'))[_0x138d('0x4c')](_0x138d('0x7d'),_0x3ca329[_0x138d('0x56')]['id']);for(var _0x558067=0x0;_0x558067<_0x39a28e[_0x138d('0x48')];_0x558067+=0x1){let _0x59e6e0=_0x39a28e[_0x558067];for(var _0x5ae676=0x0;_0x5ae676<_0x59e6e0[_0x138d('0x6f')][_0x138d('0x48')];_0x5ae676+=0x1){let _0x2dad61=_0x59e6e0['Agents'][_0x5ae676];var _0x25e840=_0x424ae4[_0x138d('0x7e')]();_0x25e840[_0x138d('0x4c')]('ut.UserId\x20=\x20?',_0x2dad61['id']);_0x925a24[_0x138d('0x7f')](db[_0x138d('0x72')][_0x138d('0x41')](_0x25e840[_0x138d('0x80')](),{'type':db['sequelize'][_0x138d('0x81')][_0x138d('0x82')]})[_0x138d('0x1d')](function(_0x2a2496){if(_0x2a2496[_0x138d('0x48')]===0x1){return _0x2dad61['id'];}else{var _0x5c5cab=_[_0x138d('0x83')](_['map'](_0x2a2496,_0x138d('0x84')),function(_0x573f82){return _[_0x138d('0x85')](_0x429ca8,_0x573f82);});if(_0x5c5cab){return _0x2dad61['id'];}}}));}}return BPromise[_0x138d('0x86')](_0x925a24)[_0x138d('0x1d')](function(_0x209de0){_0x28d99e=_(_0x28d99e)[_0x138d('0x87')](_0x209de0)['compact']()[_0x138d('0x88')]();return db['ChatQueue']['find']({'where':{'id':_0x3ca329['params']['id']}})[_0x138d('0x1d')](function(_0x588304){return db[_0x138d('0x72')][_0x138d('0x89')](function(_0x5db54b){return _0x588304['removeTeams'](_0x3ca329[_0x138d('0x41')][_0x138d('0x6e')],{'transaction':_0x5db54b})[_0x138d('0x1d')](function(){if(!_[_0x138d('0x8a')](_0x28d99e)){return _0x588304['removeAgents'](_0x28d99e,{'transaction':_0x5db54b});}})['then'](function(){_0x28d99e[_0x138d('0x74')](function(_0x4a2918){socket[_0x138d('0x75')](_0x138d('0x8b'),{'UserId':_0x4a2918,'ChatQueueId':_0x588304['id']});});});});});});})[_0x138d('0x1d')](respondWithStatusCode(_0xcd86ec,null))[_0x138d('0x28')](handleError(_0xcd86ec,null));};exports['addAgents']=function(_0x55295c,_0x489471,_0x89eb21){return db[_0x138d('0x51')][_0x138d('0x58')]({'where':{'id':_0x55295c[_0x138d('0x56')]['id']}})[_0x138d('0x1d')](handleEntityNotFound(_0x489471,null))[_0x138d('0x1d')](function(_0x2f35fb){if(_0x2f35fb){return _0x2f35fb[_0x138d('0x8c')](_0x55295c[_0x138d('0x5a')][_0x138d('0x6e')],_[_0x138d('0x8d')](_0x55295c[_0x138d('0x5a')],['ids','id'])||{})[_0x138d('0x8e')](function(_0x39ba2e){for(var _0x5945e2=0x0;_0x5945e2<_0x55295c['body']['ids']['length'];_0x5945e2+=0x1){socket[_0x138d('0x75')](_0x138d('0x8f'),{'UserId':Number(_0x55295c[_0x138d('0x5a')][_0x138d('0x6e')][_0x5945e2]),'ChatQueueId':Number(_0x55295c[_0x138d('0x56')]['id'])});}return _0x39ba2e;});}})['then'](respondWithResult(_0x489471,null))[_0x138d('0x28')](handleError(_0x489471,null));};exports[_0x138d('0x90')]=function(_0x485362,_0x1da1fb,_0x38052d){return db['ChatQueue']['find']({'where':{'id':_0x485362[_0x138d('0x56')]['id']}})[_0x138d('0x1d')](handleEntityNotFound(_0x1da1fb,null))[_0x138d('0x1d')](function(_0x31888d){if(_0x31888d){return _0x31888d[_0x138d('0x90')](_0x485362[_0x138d('0x41')]['ids'])[_0x138d('0x1d')](function(){if(_[_0x138d('0x91')](_0x485362['query'][_0x138d('0x6e')])){for(var _0x18c0fb=0x0;_0x18c0fb<_0x485362['query']['ids'][_0x138d('0x48')];_0x18c0fb+=0x1){socket[_0x138d('0x75')](_0x138d('0x8b'),{'UserId':Number(_0x485362[_0x138d('0x41')][_0x138d('0x6e')][_0x18c0fb]),'ChatQueueId':Number(_0x485362['params']['id'])});}}else{socket[_0x138d('0x75')]('userChatQueue:remove',{'UserId':Number(_0x485362[_0x138d('0x41')][_0x138d('0x6e')]),'ChatQueueId':Number(_0x485362[_0x138d('0x56')]['id'])});}});}})[_0x138d('0x1d')](respondWithStatusCode(_0x1da1fb,null))[_0x138d('0x28')](handleError(_0x1da1fb,null));};exports[_0x138d('0x92')]=function(_0x166513,_0x331e24,_0x3b0a4a){var _0x4007b5={};var _0x4b2cf5={};var _0x260f41;var _0x5dc143;return db['ChatQueue'][_0x138d('0x60')]({'where':{'id':_0x166513[_0x138d('0x56')]['id']}})[_0x138d('0x1d')](handleEntityNotFound(_0x331e24,null))[_0x138d('0x1d')](function(_0x5281fa){if(_0x5281fa){_0x260f41=_0x5281fa;_0x4b2cf5['model']=_[_0x138d('0x42')](db[_0x138d('0x64')][_0x138d('0x3d')]);_0x4b2cf5['query']=_[_0x138d('0x42')](_0x166513['query']);_0x4b2cf5['filters']=_[_0x138d('0x44')](_0x4b2cf5['model'],_0x4b2cf5[_0x138d('0x41')]);_0x4007b5[_0x138d('0x46')]=_[_0x138d('0x44')](_0x4b2cf5[_0x138d('0x45')],qs[_0x138d('0x47')](_0x166513[_0x138d('0x41')]['fields']));_0x4007b5['attributes']=_0x4007b5[_0x138d('0x46')]['length']?_0x4007b5['attributes']:_0x4b2cf5[_0x138d('0x45')];_0x4007b5[_0x138d('0x4a')]=qs[_0x138d('0x4b')](_0x166513['query'][_0x138d('0x4b')]);_0x4007b5[_0x138d('0x4c')]=qs[_0x138d('0x43')](_['pick'](_0x166513['query'],_0x4b2cf5['filters']));if(_0x166513[_0x138d('0x41')][_0x138d('0x4e')]){_0x4007b5[_0x138d('0x4c')]=_[_0x138d('0x4f')](_0x4007b5[_0x138d('0x4c')],{'$or':_['map'](_0x4007b5[_0x138d('0x46')],function(_0x14e27e){var _0x51f8c9={};_0x51f8c9[_0x14e27e]={'$like':'%'+_0x166513[_0x138d('0x41')][_0x138d('0x4e')]+'%'};return _0x51f8c9;})});}_0x4007b5=_['merge']({},_0x4007b5,_0x166513[_0x138d('0x50')]);return _0x260f41['getAgents'](_0x4007b5);}})[_0x138d('0x1d')](function(_0x3e6b7d){if(_0x3e6b7d){_0x5dc143=_0x3e6b7d['length'];if(!_0x166513['query'][_0x138d('0x49')](_0x138d('0x62'))){_0x4007b5[_0x138d('0x30')]=qs[_0x138d('0x30')](_0x166513[_0x138d('0x41')][_0x138d('0x30')]);_0x4007b5['offset']=qs['offset'](_0x166513[_0x138d('0x41')][_0x138d('0x2d')]);}return _0x260f41[_0x138d('0x92')](_0x4007b5);}})[_0x138d('0x1d')](function(_0x54e239){if(_0x54e239){return _0x54e239?{'count':_0x5dc143,'rows':_0x54e239}:null;}})[_0x138d('0x1d')](respondWithResult(_0x331e24,null))[_0x138d('0x28')](handleError(_0x331e24,null));}; \ No newline at end of file +var _0x5520=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','ChatQueues','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','filter','options','ChatQueue','includeAll','findAll','rows','show','params','keys','include','find','create'];(function(_0x43e19d,_0x4a7442){var _0x435abe=function(_0x2bc566){while(--_0x2bc566){_0x43e19d['push'](_0x43e19d['shift']());}};_0x435abe(++_0x4a7442);}(_0x5520,0xde));var _0x0552=function(_0x4d4b18,_0x3d3871){_0x4d4b18=_0x4d4b18-0x0;var _0x331ea4=_0x5520[_0x4d4b18];return _0x331ea4;};'use strict';var emlformat=require(_0x0552('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0552('0x1'));var jsonpatch=require(_0x0552('0x2'));var rp=require(_0x0552('0x3'));var moment=require('moment');var BPromise=require(_0x0552('0x4'));var Mustache=require(_0x0552('0x5'));var util=require('util');var path=require(_0x0552('0x6'));var sox=require(_0x0552('0x7'));var csv=require('to-csv');var ejs=require(_0x0552('0x8'));var fs=require('fs');var fs_extra=require(_0x0552('0x9'));var _=require(_0x0552('0xa'));var squel=require('squel');var crypto=require(_0x0552('0xb'));var jsforce=require(_0x0552('0xc'));var deskjs=require(_0x0552('0xd'));var toCsv=require(_0x0552('0xe'));var querystring=require(_0x0552('0xf'));var Papa=require(_0x0552('0x10'));var Redis=require(_0x0552('0x11'));var authService=require(_0x0552('0x12'));var qs=require(_0x0552('0x13'));var as=require(_0x0552('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0552('0x15'))(_0x0552('0x16'));var utils=require('../../config/utils');var config=require(_0x0552('0x17'));var licenseUtil=require(_0x0552('0x18'));var db=require(_0x0552('0x19'))['db'];config[_0x0552('0x1a')]=_[_0x0552('0x1b')](config[_0x0552('0x1a')],{'host':_0x0552('0x1c'),'port':0x18eb});var socket=require(_0x0552('0x1d'))(new Redis(config[_0x0552('0x1a')]));require('./chatQueue.socket')[_0x0552('0x1e')](socket);var jayson=require(_0x0552('0x1f'));var client=jayson[_0x0552('0x20')][_0x0552('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56dd44,_0x13a2b9,_0x163174,_0x287214){return new BPromise(function(_0x25f9a5,_0x2ec0f3){var _0x425934=_0x287214||client;return _0x425934[_0x0552('0x22')](_0x56dd44,_0x163174)['then'](function(_0x1bc3e0){logger['info']('ChatQueue,\x20%s,\x20%s',_0x13a2b9,_0x0552('0x23'));logger[_0x0552('0x24')](_0x0552('0x25'),_0x13a2b9,_0x0552('0x23'),JSON[_0x0552('0x26')](_0x1bc3e0));if(_0x1bc3e0[_0x0552('0x27')]){if(_0x1bc3e0[_0x0552('0x27')][_0x0552('0x28')]===0x1f4){logger[_0x0552('0x27')](_0x0552('0x29'),_0x13a2b9,_0x1bc3e0[_0x0552('0x27')][_0x0552('0x2a')]);return _0x2ec0f3(_0x1bc3e0[_0x0552('0x27')][_0x0552('0x2a')]);}logger[_0x0552('0x27')](_0x0552('0x29'),_0x13a2b9,_0x1bc3e0[_0x0552('0x27')][_0x0552('0x2a')]);return _0x25f9a5(_0x1bc3e0['error'][_0x0552('0x2a')]);}else{logger[_0x0552('0x2b')](_0x0552('0x29'),_0x13a2b9,_0x0552('0x23'));_0x25f9a5(_0x1bc3e0[_0x0552('0x2c')][_0x0552('0x2a')]);}})[_0x0552('0x2d')](function(_0x30a7b6){logger[_0x0552('0x27')](_0x0552('0x29'),_0x13a2b9,_0x30a7b6);_0x2ec0f3(_0x30a7b6);});});}function respondWithStatusCode(_0xbf56e4,_0x51c3ad){_0x51c3ad=_0x51c3ad||0xcc;return function(_0x468e4e){if(_0x468e4e){return _0xbf56e4[_0x0552('0x2e')](_0x51c3ad);}return _0xbf56e4[_0x0552('0x2f')](_0x51c3ad)[_0x0552('0x30')]();};}function respondWithResult(_0x11ba68,_0x2bbf31){_0x2bbf31=_0x2bbf31||0xc8;return function(_0x11a428){if(_0x11a428){return _0x11ba68['status'](_0x2bbf31)[_0x0552('0x31')](_0x11a428);}};}function respondWithFilteredResult(_0x5d11f7,_0x339b68){return function(_0x271085){if(_0x271085){var _0x330207=typeof _0x339b68[_0x0552('0x32')]===_0x0552('0x33')&&typeof _0x339b68['limit']===_0x0552('0x33');var _0x1c7a0a=_0x271085[_0x0552('0x34')];var _0x3e273f=_0x330207?0x0:_0x339b68[_0x0552('0x32')];var _0xacae3b=_0x330207?_0x271085[_0x0552('0x34')]:_0x339b68[_0x0552('0x32')]+_0x339b68['limit'];var _0x522f6e;if(_0xacae3b>=_0x1c7a0a){_0xacae3b=_0x1c7a0a;_0x522f6e=0xc8;}else{_0x522f6e=0xce;}_0x5d11f7[_0x0552('0x2f')](_0x522f6e);return _0x5d11f7['set'](_0x0552('0x35'),_0x3e273f+'-'+_0xacae3b+'/'+_0x1c7a0a)[_0x0552('0x31')](_0x271085);}return null;};}function patchUpdates(_0x5a3545){return function(_0x55c26f){try{jsonpatch[_0x0552('0x36')](_0x55c26f,_0x5a3545,!![]);}catch(_0xbc63b0){return BPromise[_0x0552('0x37')](_0xbc63b0);}return _0x55c26f[_0x0552('0x38')]();};}function saveUpdates(_0x135cb4,_0x33ca44){return function(_0x2ccb15){if(_0x2ccb15){return _0x2ccb15[_0x0552('0x39')](_0x135cb4)[_0x0552('0x3a')](function(_0x22cada){return _0x22cada;});}return null;};}function removeEntity(_0x134582,_0x59fdd3){return function(_0x2ede15){if(_0x2ede15){return _0x2ede15['destroy']()[_0x0552('0x3a')](function(){var _0x468ad1=_0x2ede15['get']({'plain':!![]});var _0x38602c=_0x0552('0x3b');return db['UserProfileResource'][_0x0552('0x3c')]({'where':{'type':_0x38602c,'resourceId':_0x468ad1['id']}})['then'](function(){return _0x2ede15;});})[_0x0552('0x3a')](function(){_0x134582[_0x0552('0x2f')](0xcc)[_0x0552('0x30')]();});}};}function handleEntityNotFound(_0x3de398,_0x167732){return function(_0x509233){if(!_0x509233){_0x3de398[_0x0552('0x2e')](0x194);}return _0x509233;};}function handleError(_0x53a365,_0x324aa7){_0x324aa7=_0x324aa7||0x1f4;return function(_0x4aeb14){logger[_0x0552('0x27')](_0x4aeb14[_0x0552('0x3d')]);if(_0x4aeb14[_0x0552('0x3e')]){delete _0x4aeb14['name'];}_0x53a365[_0x0552('0x2f')](_0x324aa7)[_0x0552('0x3f')](_0x4aeb14);};}exports[_0x0552('0x40')]=function(_0x12f9b4,_0xd1a87d){var _0x24e778={},_0x22e360={},_0x39c758={'count':0x0,'rows':[]};var _0x5e68ec=_[_0x0552('0x41')](db['ChatQueue'][_0x0552('0x42')],function(_0x59a6d7){return{'name':_0x59a6d7[_0x0552('0x43')],'type':_0x59a6d7[_0x0552('0x44')][_0x0552('0x45')]};});_0x22e360[_0x0552('0x46')]=_[_0x0552('0x41')](_0x5e68ec,'name');_0x22e360[_0x0552('0x47')]=_['keys'](_0x12f9b4[_0x0552('0x47')]);_0x22e360[_0x0552('0x48')]=_[_0x0552('0x49')](_0x22e360['model'],_0x22e360[_0x0552('0x47')]);_0x24e778['attributes']=_[_0x0552('0x49')](_0x22e360[_0x0552('0x46')],qs[_0x0552('0x4a')](_0x12f9b4[_0x0552('0x47')][_0x0552('0x4a')]));_0x24e778[_0x0552('0x4b')]=_0x24e778[_0x0552('0x4b')][_0x0552('0x4c')]?_0x24e778[_0x0552('0x4b')]:_0x22e360[_0x0552('0x46')];if(!_0x12f9b4[_0x0552('0x47')][_0x0552('0x4d')](_0x0552('0x4e'))){_0x24e778[_0x0552('0x4f')]=qs[_0x0552('0x4f')](_0x12f9b4[_0x0552('0x47')][_0x0552('0x4f')]);_0x24e778['offset']=qs[_0x0552('0x32')](_0x12f9b4[_0x0552('0x47')][_0x0552('0x32')]);}_0x24e778[_0x0552('0x50')]=qs[_0x0552('0x51')](_0x12f9b4[_0x0552('0x47')]['sort']);_0x24e778['where']=qs[_0x0552('0x48')](_[_0x0552('0x52')](_0x12f9b4[_0x0552('0x47')],_0x22e360[_0x0552('0x48')]),_0x5e68ec);if(_0x12f9b4[_0x0552('0x47')]['filter']){_0x24e778['where']=_[_0x0552('0x53')](_0x24e778[_0x0552('0x54')],{'$or':_['map'](_0x5e68ec,function(_0x121781){if(_0x121781[_0x0552('0x44')]!==_0x0552('0x55')){var _0x58e5d6={};_0x58e5d6[_0x121781[_0x0552('0x3e')]]={'$like':'%'+_0x12f9b4[_0x0552('0x47')][_0x0552('0x56')]+'%'};return _0x58e5d6;}})});}_0x24e778=_[_0x0552('0x53')]({},_0x24e778,_0x12f9b4[_0x0552('0x57')]);var _0xcea619={'where':_0x24e778[_0x0552('0x54')]};return db[_0x0552('0x58')][_0x0552('0x34')](_0xcea619)['then'](function(_0x2d3cdc){_0x39c758['count']=_0x2d3cdc;if(_0x12f9b4[_0x0552('0x47')][_0x0552('0x59')]){_0x24e778['include']=[{'all':!![]}];}return db[_0x0552('0x58')][_0x0552('0x5a')](_0x24e778);})[_0x0552('0x3a')](function(_0x40d1d6){_0x39c758[_0x0552('0x5b')]=_0x40d1d6;return _0x39c758;})['then'](respondWithFilteredResult(_0xd1a87d,_0x24e778))[_0x0552('0x2d')](handleError(_0xd1a87d,null));};exports[_0x0552('0x5c')]=function(_0x39edac,_0x4f17c5){var _0x2ba356={'raw':!![],'where':{'id':_0x39edac[_0x0552('0x5d')]['id']}},_0x4505db={};_0x4505db[_0x0552('0x46')]=_[_0x0552('0x5e')](db[_0x0552('0x58')][_0x0552('0x42')]);_0x4505db[_0x0552('0x47')]=_[_0x0552('0x5e')](_0x39edac[_0x0552('0x47')]);_0x4505db[_0x0552('0x48')]=_[_0x0552('0x49')](_0x4505db[_0x0552('0x46')],_0x4505db['query']);_0x2ba356[_0x0552('0x4b')]=_[_0x0552('0x49')](_0x4505db['model'],qs[_0x0552('0x4a')](_0x39edac[_0x0552('0x47')]['fields']));_0x2ba356[_0x0552('0x4b')]=_0x2ba356[_0x0552('0x4b')][_0x0552('0x4c')]?_0x2ba356[_0x0552('0x4b')]:_0x4505db['model'];if(_0x39edac[_0x0552('0x47')][_0x0552('0x59')]){_0x2ba356[_0x0552('0x5f')]=[{'all':!![]}];}_0x2ba356=_[_0x0552('0x53')]({},_0x2ba356,_0x39edac['options']);return db['ChatQueue'][_0x0552('0x60')](_0x2ba356)['then'](handleEntityNotFound(_0x4f17c5,null))[_0x0552('0x3a')](respondWithResult(_0x4f17c5,null))[_0x0552('0x2d')](handleError(_0x4f17c5,null));};exports[_0x0552('0x61')]=function(_0xb04722,_0x3717d1){return db['ChatQueue'][_0x0552('0x61')](_0xb04722[_0x0552('0x62')],{})[_0x0552('0x3a')](function(_0x5cba42){var _0x40ac46=_0xb04722[_0x0552('0x63')][_0x0552('0x64')]({'plain':!![]});if(!_0x40ac46)throw new Error(_0x0552('0x65'));if(_0x40ac46['role']==='user'){var _0x320340=_0x5cba42[_0x0552('0x64')]({'plain':!![]});var _0x23142b=_0x0552('0x3b');return db[_0x0552('0x66')][_0x0552('0x60')]({'where':{'name':_0x23142b,'userProfileId':_0x40ac46[_0x0552('0x67')]},'raw':!![]})['then'](function(_0x209130){if(_0x209130&&_0x209130['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x320340['name'],'resourceId':_0x320340['id'],'type':_0x209130[_0x0552('0x3e')],'sectionId':_0x209130['id']},{})['then'](function(){return _0x5cba42;});}else{return _0x5cba42;}})[_0x0552('0x2d')](function(_0x547fdf){logger[_0x0552('0x27')](_0x0552('0x68'),_0x547fdf);throw _0x547fdf;});}return _0x5cba42;})['then'](respondWithResult(_0x3717d1,0xc9))[_0x0552('0x2d')](handleError(_0x3717d1,null));};exports['update']=function(_0x486ff1,_0x2c94d9){if(_0x486ff1['body']['id']){delete _0x486ff1['body']['id'];}return db[_0x0552('0x58')][_0x0552('0x60')]({'where':{'id':_0x486ff1[_0x0552('0x5d')]['id']}})[_0x0552('0x3a')](handleEntityNotFound(_0x2c94d9,null))[_0x0552('0x3a')](saveUpdates(_0x486ff1['body'],null))[_0x0552('0x3a')](respondWithResult(_0x2c94d9,null))[_0x0552('0x2d')](handleError(_0x2c94d9,null));};exports[_0x0552('0x3c')]=function(_0x28fd71,_0x10a05c){return db['ChatQueue'][_0x0552('0x60')]({'where':{'id':_0x28fd71[_0x0552('0x5d')]['id']}})['then'](handleEntityNotFound(_0x10a05c,null))[_0x0552('0x3a')](removeEntity(_0x10a05c,null))['catch'](handleError(_0x10a05c,null));};exports[_0x0552('0x69')]=function(_0x4b67d5,_0x24dc7c){return db[_0x0552('0x58')]['describe']()[_0x0552('0x3a')](respondWithResult(_0x24dc7c,null))['catch'](handleError(_0x24dc7c,null));};exports[_0x0552('0x6a')]=function(_0x441be6,_0x4d86b7,_0x53a39f){var _0x2ee057={'raw':!![],'where':{}},_0x1ad5f7={},_0x3da253;return db['ChatQueue']['findOne']({'where':{'id':_0x441be6['params']['id']}})[_0x0552('0x3a')](handleEntityNotFound(_0x4d86b7,null))[_0x0552('0x3a')](function(_0x1e7440){if(_0x1e7440){_0x3da253=_0x1e7440[_0x0552('0x64')]({'plain':!![]});_0x1ad5f7[_0x0552('0x46')]=_[_0x0552('0x5e')](db['UserChatQueue'][_0x0552('0x42')]);_0x1ad5f7[_0x0552('0x47')]=_['keys'](_0x441be6[_0x0552('0x47')]);_0x1ad5f7[_0x0552('0x48')]=_[_0x0552('0x49')](_0x1ad5f7[_0x0552('0x46')],_0x1ad5f7[_0x0552('0x47')]);_0x2ee057['attributes']=_[_0x0552('0x49')](_0x1ad5f7['model'],qs[_0x0552('0x4a')](_0x441be6[_0x0552('0x47')][_0x0552('0x4a')]));_0x2ee057[_0x0552('0x4b')]=_0x2ee057['attributes'][_0x0552('0x4c')]?_0x2ee057[_0x0552('0x4b')]:_0x1ad5f7['model'];if(!_0x441be6[_0x0552('0x47')][_0x0552('0x4d')](_0x0552('0x4e'))){_0x2ee057[_0x0552('0x4f')]=qs['limit'](_0x441be6[_0x0552('0x47')][_0x0552('0x4f')]);_0x2ee057[_0x0552('0x32')]=qs['offset'](_0x441be6[_0x0552('0x47')][_0x0552('0x32')]);}_0x2ee057[_0x0552('0x50')]=qs[_0x0552('0x51')](_0x441be6[_0x0552('0x47')][_0x0552('0x51')]);_0x2ee057[_0x0552('0x54')]=qs['filters'](_[_0x0552('0x52')](_0x441be6[_0x0552('0x47')],_0x1ad5f7[_0x0552('0x48')]));_0x2ee057[_0x0552('0x54')][_0x0552('0x6b')]=_0x1e7440['id'];if(_0x441be6[_0x0552('0x47')][_0x0552('0x56')]){_0x2ee057[_0x0552('0x54')]=_[_0x0552('0x53')](_0x2ee057[_0x0552('0x54')],{'$or':_[_0x0552('0x41')](_0x2ee057['attributes'],function(_0x1fbec5){var _0x590b45={};_0x590b45[_0x1fbec5]={'$like':'%'+_0x441be6[_0x0552('0x47')][_0x0552('0x56')]+'%'};return _0x590b45;})});}_0x2ee057=_['merge']({},_0x2ee057,_0x441be6[_0x0552('0x57')]);return db[_0x0552('0x6c')][_0x0552('0x5a')](_0x2ee057);}})[_0x0552('0x3a')](function(_0x27e359){if(_0x27e359){return db[_0x0552('0x6d')]['findAndCountAll']({'where':{'id':_[_0x0552('0x41')](_0x27e359,_0x0552('0x6e')),'role':_0x0552('0x6f')},'attributes':['id',_0x0552('0x3e'),_0x0552('0x70'),_0x0552('0x71'),_0x0552('0x72')]});}})[_0x0552('0x3a')](function(_0x457e40){if(_0x457e40){return{'count':_0x457e40['count'],'rows':_[_0x0552('0x41')](_0x457e40['rows'],function(_0x83d749){return{'membername':_0x83d749['name'],'UserId':_0x83d749['id'],'queue_name':_0x3da253['name'],'ChatQueueId':_0x3da253['id'],'interface':util[_0x0552('0x73')](_0x0552('0x74'),_0x0552('0x75'),_0x83d749[_0x0552('0x3e')]),'penalty':0x0,'paused':_0x83d749['chatPause'],'createdAt':_0x83d749[_0x0552('0x72')],'updatedAt':_0x83d749[_0x0552('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4d86b7,_0x2ee057))['catch'](handleError(_0x4d86b7,null));};exports[_0x0552('0x76')]=function(_0x696632,_0x147aaf,_0x20e3b7){var _0x43337b={};var _0x2a4b54={};var _0x155409;var _0x335cd5;return db[_0x0552('0x58')][_0x0552('0x77')]({'where':{'id':_0x696632['params']['id']}})[_0x0552('0x3a')](handleEntityNotFound(_0x147aaf,null))[_0x0552('0x3a')](function(_0x415139){if(_0x415139){_0x155409=_0x415139;_0x2a4b54[_0x0552('0x46')]=_[_0x0552('0x5e')](db[_0x0552('0x78')][_0x0552('0x42')]);_0x2a4b54[_0x0552('0x47')]=_['keys'](_0x696632[_0x0552('0x47')]);_0x2a4b54[_0x0552('0x48')]=_['intersection'](_0x2a4b54[_0x0552('0x46')],_0x2a4b54[_0x0552('0x47')]);_0x43337b[_0x0552('0x4b')]=_[_0x0552('0x49')](_0x2a4b54[_0x0552('0x46')],qs[_0x0552('0x4a')](_0x696632[_0x0552('0x47')][_0x0552('0x4a')]));_0x43337b[_0x0552('0x4b')]=_0x43337b['attributes'][_0x0552('0x4c')]?_0x43337b[_0x0552('0x4b')]:_0x2a4b54[_0x0552('0x46')];_0x43337b[_0x0552('0x50')]=qs['sort'](_0x696632[_0x0552('0x47')][_0x0552('0x51')]);_0x43337b['where']=qs[_0x0552('0x48')](_[_0x0552('0x52')](_0x696632[_0x0552('0x47')],_0x2a4b54[_0x0552('0x48')]));if(_0x696632['query'][_0x0552('0x56')]){_0x43337b[_0x0552('0x54')]=_[_0x0552('0x53')](_0x43337b[_0x0552('0x54')],{'$or':_['map'](_0x43337b[_0x0552('0x4b')],function(_0x4a4423){var _0x3bc488={};_0x3bc488[_0x4a4423]={'$like':'%'+_0x696632[_0x0552('0x47')]['filter']+'%'};return _0x3bc488;})});}_0x43337b=_[_0x0552('0x53')]({},_0x43337b,_0x696632[_0x0552('0x57')]);return _0x155409[_0x0552('0x76')](_0x43337b);}})[_0x0552('0x3a')](function(_0x4c4d52){if(_0x4c4d52){_0x335cd5=_0x4c4d52[_0x0552('0x4c')];if(!_0x696632['query']['hasOwnProperty']('nolimit')){_0x43337b[_0x0552('0x4f')]=qs[_0x0552('0x4f')](_0x696632[_0x0552('0x47')]['limit']);_0x43337b['offset']=qs[_0x0552('0x32')](_0x696632[_0x0552('0x47')]['offset']);}return _0x155409[_0x0552('0x76')](_0x43337b);}})[_0x0552('0x3a')](function(_0x440ef7){if(_0x440ef7){return _0x440ef7?{'count':_0x335cd5,'rows':_0x440ef7}:null;}})[_0x0552('0x3a')](respondWithResult(_0x147aaf,null))[_0x0552('0x2d')](handleError(_0x147aaf,null));};exports['addTeams']=function(_0x28c49b,_0x5e1840,_0x57ba3f){var _0x13cd50=_0x28c49b[_0x0552('0x62')][_0x0552('0x79')];return db['Team'][_0x0552('0x5a')]({'where':{'id':_0x13cd50},'attributes':['id'],'include':[{'model':db[_0x0552('0x6d')],'as':_0x0552('0x7a'),'attributes':['id',_0x0552('0x3e'),_0x0552('0x7b'),_0x0552('0x7c'),_0x0552('0x7d')],'raw':!![]}]})[_0x0552('0x3a')](function(_0x1b703c){if(_0x1b703c){var _0x386c24=_[_0x0552('0x7e')](_0x1b703c,function(_0x115a73){var _0x35a493=_0x115a73[_0x0552('0x64')]({'plain':!![]});return _0x35a493['Agents'];});return db[_0x0552('0x58')][_0x0552('0x60')]({'where':{'id':_0x28c49b[_0x0552('0x5d')]['id']}})[_0x0552('0x3a')](function(_0x47c7b6){return db[_0x0552('0x7f')]['transaction'](function(_0x44178f){return _0x47c7b6[_0x0552('0x80')](_0x13cd50,{'transaction':_0x44178f})[_0x0552('0x3a')](function(){return BPromise['each'](_0x386c24,function(_0x3e9457){return db['UserChatQueue'][_0x0552('0x81')]({'where':{'UserId':_0x3e9457['id'],'ChatQueueId':_0x28c49b[_0x0552('0x5d')]['id']},'transaction':_0x44178f});});})[_0x0552('0x3a')](function(){_0x386c24[_0x0552('0x82')](function(_0x1570b5){socket[_0x0552('0x83')](_0x0552('0x84'),{'UserId':_0x1570b5['id'],'ChatQueueId':_0x47c7b6['id']});});});});});}})['then'](respondWithStatusCode(_0x5e1840,null))['catch'](handleError(_0x5e1840,null));};exports[_0x0552('0x85')]=function(_0x30e228,_0x1d23d7,_0x53c489){return db[_0x0552('0x78')]['findAll']({'where':{'id':_0x30e228[_0x0552('0x47')][_0x0552('0x79')]},'attributes':['id'],'include':[{'model':db[_0x0552('0x6d')],'as':_0x0552('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x0552('0x3a')](handleEntityNotFound(_0x1d23d7,null))[_0x0552('0x3a')](function(_0x1f2ff1){var _0x1778a8=_[_0x0552('0x41')](_0x1f2ff1,'id');var _0x23a314=[];var _0x37132c=[];var _0x19dc5a=squel[_0x0552('0x86')]();_0x19dc5a[_0x0552('0x87')](_0x0552('0x88'))[_0x0552('0x89')](_0x0552('0x8a'),'tq')[_0x0552('0x8b')](_0x0552('0x8c'),'ut',_0x0552('0x8d'))[_0x0552('0x54')]('ChatQueueId\x20=\x20?',_0x30e228[_0x0552('0x5d')]['id']);for(var _0x45366f=0x0;_0x45366f<_0x1f2ff1['length'];_0x45366f+=0x1){let _0xd513ef=_0x1f2ff1[_0x45366f];for(var _0x2a16f7=0x0;_0x2a16f7<_0xd513ef[_0x0552('0x7a')][_0x0552('0x4c')];_0x2a16f7+=0x1){let _0x1fc83d=_0xd513ef[_0x0552('0x7a')][_0x2a16f7];var _0x2de273=_0x19dc5a['clone']();_0x2de273[_0x0552('0x54')]('ut.UserId\x20=\x20?',_0x1fc83d['id']);_0x37132c[_0x0552('0x8e')](db[_0x0552('0x7f')]['query'](_0x2de273[_0x0552('0x8f')](),{'type':db[_0x0552('0x7f')]['QueryTypes'][_0x0552('0x90')]})[_0x0552('0x3a')](function(_0x29344f){if(_0x29344f[_0x0552('0x4c')]===0x1){return _0x1fc83d['id'];}else{var _0x55d3e1=_[_0x0552('0x91')](_[_0x0552('0x41')](_0x29344f,_0x0552('0x92')),function(_0x46559c){return _[_0x0552('0x93')](_0x1778a8,_0x46559c);});if(_0x55d3e1){return _0x1fc83d['id'];}}}));}}return BPromise[_0x0552('0x94')](_0x37132c)['then'](function(_0x3b4f3e){_0x23a314=_(_0x23a314)['union'](_0x3b4f3e)[_0x0552('0x95')]()[_0x0552('0x96')]();return db[_0x0552('0x58')][_0x0552('0x60')]({'where':{'id':_0x30e228['params']['id']}})[_0x0552('0x3a')](function(_0x4e717d){return db[_0x0552('0x7f')][_0x0552('0x97')](function(_0x41939d){return _0x4e717d[_0x0552('0x85')](_0x30e228[_0x0552('0x47')][_0x0552('0x79')],{'transaction':_0x41939d})['then'](function(){if(!_[_0x0552('0x98')](_0x23a314)){return _0x4e717d['removeAgents'](_0x23a314,{'transaction':_0x41939d});}})['then'](function(){_0x23a314[_0x0552('0x82')](function(_0x26331a){socket['emit'](_0x0552('0x99'),{'UserId':_0x26331a,'ChatQueueId':_0x4e717d['id']});});});});});});})[_0x0552('0x3a')](respondWithStatusCode(_0x1d23d7,null))[_0x0552('0x2d')](handleError(_0x1d23d7,null));};exports[_0x0552('0x9a')]=function(_0x2653d2,_0x5a0c81,_0xa0828c){return db[_0x0552('0x58')][_0x0552('0x60')]({'where':{'id':_0x2653d2[_0x0552('0x5d')]['id']}})[_0x0552('0x3a')](handleEntityNotFound(_0x5a0c81,null))[_0x0552('0x3a')](function(_0xd84c58){if(_0xd84c58){return _0xd84c58[_0x0552('0x9a')](_0x2653d2['body'][_0x0552('0x79')],_[_0x0552('0x9b')](_0x2653d2[_0x0552('0x62')],[_0x0552('0x79'),'id'])||{})[_0x0552('0x9c')](function(_0x1cfb91){for(var _0x423713=0x0;_0x423713<_0x2653d2['body'][_0x0552('0x79')]['length'];_0x423713+=0x1){socket['emit'](_0x0552('0x84'),{'UserId':Number(_0x2653d2[_0x0552('0x62')][_0x0552('0x79')][_0x423713]),'ChatQueueId':Number(_0x2653d2[_0x0552('0x5d')]['id'])});}return _0x1cfb91;});}})[_0x0552('0x3a')](respondWithResult(_0x5a0c81,null))['catch'](handleError(_0x5a0c81,null));};exports[_0x0552('0x9d')]=function(_0x39c045,_0x111338,_0x532f77){return db['ChatQueue'][_0x0552('0x60')]({'where':{'id':_0x39c045[_0x0552('0x5d')]['id']}})[_0x0552('0x3a')](handleEntityNotFound(_0x111338,null))[_0x0552('0x3a')](function(_0x487020){if(_0x487020){return _0x487020[_0x0552('0x9d')](_0x39c045['query']['ids'])['then'](function(){if(_[_0x0552('0x9e')](_0x39c045['query'][_0x0552('0x79')])){for(var _0x24dde4=0x0;_0x24dde4<_0x39c045['query']['ids'][_0x0552('0x4c')];_0x24dde4+=0x1){socket[_0x0552('0x83')](_0x0552('0x99'),{'UserId':Number(_0x39c045['query']['ids'][_0x24dde4]),'ChatQueueId':Number(_0x39c045[_0x0552('0x5d')]['id'])});}}else{socket[_0x0552('0x83')](_0x0552('0x99'),{'UserId':Number(_0x39c045[_0x0552('0x47')][_0x0552('0x79')]),'ChatQueueId':Number(_0x39c045[_0x0552('0x5d')]['id'])});}});}})[_0x0552('0x3a')](respondWithStatusCode(_0x111338,null))[_0x0552('0x2d')](handleError(_0x111338,null));};exports[_0x0552('0x9f')]=function(_0x23a7aa,_0x2e8b0b,_0x531427){var _0x25d868={};var _0x245aa0={};var _0x2a2f85;var _0x37e1f1;return db[_0x0552('0x58')]['findOne']({'where':{'id':_0x23a7aa[_0x0552('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2e8b0b,null))[_0x0552('0x3a')](function(_0x5a5df0){if(_0x5a5df0){_0x2a2f85=_0x5a5df0;_0x245aa0[_0x0552('0x46')]=_[_0x0552('0x5e')](db[_0x0552('0x6d')][_0x0552('0x42')]);_0x245aa0['query']=_[_0x0552('0x5e')](_0x23a7aa[_0x0552('0x47')]);_0x245aa0[_0x0552('0x48')]=_[_0x0552('0x49')](_0x245aa0[_0x0552('0x46')],_0x245aa0[_0x0552('0x47')]);_0x25d868[_0x0552('0x4b')]=_['intersection'](_0x245aa0[_0x0552('0x46')],qs[_0x0552('0x4a')](_0x23a7aa[_0x0552('0x47')][_0x0552('0x4a')]));_0x25d868['attributes']=_0x25d868['attributes']['length']?_0x25d868['attributes']:_0x245aa0[_0x0552('0x46')];_0x25d868[_0x0552('0x50')]=qs[_0x0552('0x51')](_0x23a7aa[_0x0552('0x47')][_0x0552('0x51')]);_0x25d868[_0x0552('0x54')]=qs[_0x0552('0x48')](_[_0x0552('0x52')](_0x23a7aa[_0x0552('0x47')],_0x245aa0[_0x0552('0x48')]));if(_0x23a7aa[_0x0552('0x47')]['filter']){_0x25d868[_0x0552('0x54')]=_['merge'](_0x25d868['where'],{'$or':_[_0x0552('0x41')](_0x25d868[_0x0552('0x4b')],function(_0x29db88){var _0x4ed6b4={};_0x4ed6b4[_0x29db88]={'$like':'%'+_0x23a7aa['query'][_0x0552('0x56')]+'%'};return _0x4ed6b4;})});}_0x25d868=_[_0x0552('0x53')]({},_0x25d868,_0x23a7aa[_0x0552('0x57')]);return _0x2a2f85[_0x0552('0x9f')](_0x25d868);}})[_0x0552('0x3a')](function(_0x52faa2){if(_0x52faa2){_0x37e1f1=_0x52faa2[_0x0552('0x4c')];if(!_0x23a7aa[_0x0552('0x47')]['hasOwnProperty'](_0x0552('0x4e'))){_0x25d868[_0x0552('0x4f')]=qs[_0x0552('0x4f')](_0x23a7aa[_0x0552('0x47')][_0x0552('0x4f')]);_0x25d868[_0x0552('0x32')]=qs[_0x0552('0x32')](_0x23a7aa[_0x0552('0x47')]['offset']);}return _0x2a2f85[_0x0552('0x9f')](_0x25d868);}})[_0x0552('0x3a')](function(_0x3ef4fd){if(_0x3ef4fd){return _0x3ef4fd?{'count':_0x37e1f1,'rows':_0x3ef4fd}:null;}})[_0x0552('0x3a')](respondWithResult(_0x2e8b0b,null))[_0x0552('0x2d')](handleError(_0x2e8b0b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 833c8e8..61c4326 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 _0xe751=['update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xe751,0xf7));var _0x1e75=function(_0x310357,_0x126dc6){_0x310357=_0x310357-0x0;var _0x5d40e9=_0xe751[_0x310357];return _0x5d40e9;};'use strict';var EventEmitter=require(_0x1e75('0x0'));var ChatQueue=require(_0x1e75('0x1'))['db'][_0x1e75('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1e75('0x3')](0x0);var events={'afterCreate':_0x1e75('0x4'),'afterUpdate':_0x1e75('0x5'),'afterDestroy':'remove'};function emitEvent(_0x519992){return function(_0xb3cea2,_0x5d25a7,_0x1e3fb8){ChatQueueEvents[_0x1e75('0x6')](_0x519992+':'+_0xb3cea2['id'],_0xb3cea2);ChatQueueEvents[_0x1e75('0x6')](_0x519992,_0xb3cea2);_0x1e3fb8(null);};}for(var e in events){if(events[_0x1e75('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x1e75('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xae7c=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x373afe,_0x4841f3){var _0x4decea=function(_0x441ed5){while(--_0x441ed5){_0x373afe['push'](_0x373afe['shift']());}};_0x4decea(++_0x4841f3);}(_0xae7c,0x104));var _0xcae7=function(_0x6b5e76,_0x25a104){_0x6b5e76=_0x6b5e76-0x0;var _0x1f8e50=_0xae7c[_0x6b5e76];return _0x1f8e50;};'use strict';var EventEmitter=require(_0xcae7('0x0'));var ChatQueue=require(_0xcae7('0x1'))['db'][_0xcae7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcae7('0x3')](0x0);var events={'afterCreate':_0xcae7('0x4'),'afterUpdate':_0xcae7('0x5'),'afterDestroy':_0xcae7('0x6')};function emitEvent(_0x2f15c1){return function(_0x515a0d,_0x180939,_0x3e1946){ChatQueueEvents[_0xcae7('0x7')](_0x2f15c1+':'+_0x515a0d['id'],_0x515a0d);ChatQueueEvents['emit'](_0x2f15c1,_0x515a0d);_0x3e1946(null);};}for(var e in events){if(events[_0xcae7('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xcae7('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 6515cf3..364c450 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 _0xeeb4=['ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports'];(function(_0xd29892,_0x2b67b9){var _0x293dfd=function(_0x22f177){while(--_0x22f177){_0xd29892['push'](_0xd29892['shift']());}};_0x293dfd(++_0x2b67b9);}(_0xeeb4,0xc2));var _0x4eeb=function(_0x2913f6,_0x2293f1){_0x2913f6=_0x2913f6-0x0;var _0x252597=_0xeeb4[_0x2913f6];return _0x252597;};'use strict';var _=require(_0x4eeb('0x0'));var util=require(_0x4eeb('0x1'));var logger=require('../../config/logger')(_0x4eeb('0x2'));var moment=require(_0x4eeb('0x3'));var BPromise=require(_0x4eeb('0x4'));var rp=require(_0x4eeb('0x5'));var fs=require('fs');var path=require(_0x4eeb('0x6'));var rimraf=require(_0x4eeb('0x7'));var config=require('../../config/environment');var attributes=require(_0x4eeb('0x8'));module[_0x4eeb('0x9')]=function(_0x27b589,_0x46b43b){return _0x27b589['define'](_0x4eeb('0xa'),attributes,{'tableName':_0x4eeb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x579d=['chat_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x579d,0x1a3));var _0xd579=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x579d[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd579('0x0'))(_0xd579('0x1'));var moment=require(_0xd579('0x2'));var BPromise=require(_0xd579('0x3'));var rp=require(_0xd579('0x4'));var fs=require('fs');var path=require(_0xd579('0x5'));var rimraf=require(_0xd579('0x6'));var config=require(_0xd579('0x7'));var attributes=require(_0xd579('0x8'));module['exports']=function(_0x24f5f1,_0x5a7bb7){return _0x24f5f1[_0xd579('0x9')]('ChatQueue',attributes,{'tableName':_0xd579('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 25af221..7634c40 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 _0x936d=['defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','options','raw','attributes','limit','include','model','map','ShowChatQueue','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x8ca48c,_0x4dde2d){var _0x5aebf9=function(_0x4506eb){while(--_0x4506eb){_0x8ca48c['push'](_0x8ca48c['shift']());}};_0x5aebf9(++_0x4dde2d);}(_0x936d,0x183));var _0xd936=function(_0xf70fc8,_0x2d10a1){_0xf70fc8=_0xf70fc8-0x0;var _0x5bf99a=_0x936d[_0xf70fc8];return _0x5bf99a;};'use strict';var _=require(_0xd936('0x0'));var util=require(_0xd936('0x1'));var moment=require(_0xd936('0x2'));var BPromise=require(_0xd936('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd936('0x4'));var db=require(_0xd936('0x5'))['db'];var utils=require(_0xd936('0x6'));var logger=require(_0xd936('0x7'))(_0xd936('0x8'));var config=require(_0xd936('0x9'));var jayson=require(_0xd936('0xa'));var client=jayson['client'][_0xd936('0xb')]({'port':0x232a});config[_0xd936('0xc')]=_[_0xd936('0xd')](config[_0xd936('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd936('0xe'))(new Redis(config[_0xd936('0xc')]));require('./chatQueue.socket')[_0xd936('0xf')](socket);function respondWithRpcPromise(_0x3ea47,_0x5b86d1,_0x3900ef){return new BPromise(function(_0x5408e9,_0x43b472){return client[_0xd936('0x10')](_0x3ea47,_0x3900ef)[_0xd936('0x11')](function(_0x41fb6e){logger[_0xd936('0x12')](_0xd936('0x13'),_0x5b86d1,_0xd936('0x14'));logger[_0xd936('0x15')](_0xd936('0x16'),_0x5b86d1,_0xd936('0x14'),JSON[_0xd936('0x17')](_0x41fb6e));if(_0x41fb6e[_0xd936('0x18')]){if(_0x41fb6e['error'][_0xd936('0x19')]===0x1f4){logger[_0xd936('0x18')](_0xd936('0x13'),_0x5b86d1,_0x41fb6e['error']['message']);return _0x43b472(_0x41fb6e['error'][_0xd936('0x1a')]);}logger[_0xd936('0x18')](_0xd936('0x13'),_0x5b86d1,_0x41fb6e[_0xd936('0x18')][_0xd936('0x1a')]);return _0x5408e9(_0x41fb6e[_0xd936('0x18')][_0xd936('0x1a')]);}else{logger[_0xd936('0x12')](_0xd936('0x13'),_0x5b86d1,_0xd936('0x14'));_0x5408e9(_0x41fb6e['result'][_0xd936('0x1a')]);}})[_0xd936('0x1b')](function(_0x501c33){logger[_0xd936('0x18')]('ChatQueue,\x20%s,\x20%s',_0x5b86d1,_0x501c33);_0x43b472(_0x501c33);});});}exports[_0xd936('0x1c')]=function(_0x50b6ce){var _0x847544=this;return new Promise(function(_0x5355dc,_0x10c05d){return db[_0xd936('0x1d')]['findAll']({'raw':_0x50b6ce[_0xd936('0x1e')]?_0x50b6ce[_0xd936('0x1e')][_0xd936('0x1f')]===undefined?!![]:![]:!![],'where':_0x50b6ce[_0xd936('0x1e')]?_0x50b6ce[_0xd936('0x1e')]['where']||null:null,'attributes':_0x50b6ce[_0xd936('0x1e')]?_0x50b6ce[_0xd936('0x1e')][_0xd936('0x20')]||null:null,'limit':_0x50b6ce[_0xd936('0x1e')]?_0x50b6ce[_0xd936('0x1e')][_0xd936('0x21')]||null:null,'include':_0x50b6ce['options']?_0x50b6ce[_0xd936('0x1e')][_0xd936('0x22')]?_['map'](_0x50b6ce[_0xd936('0x1e')][_0xd936('0x22')],function(_0xece3b9){return{'model':db[_0xece3b9[_0xd936('0x23')]],'as':_0xece3b9['as'],'attributes':_0xece3b9['attributes'],'include':_0xece3b9[_0xd936('0x22')]?_['map'](_0xece3b9['include'],function(_0x2de3fa){return{'model':db[_0x2de3fa[_0xd936('0x23')]],'as':_0x2de3fa['as'],'attributes':_0x2de3fa[_0xd936('0x20')],'include':_0x2de3fa[_0xd936('0x22')]?_[_0xd936('0x24')](_0x2de3fa[_0xd936('0x22')],function(_0x3c8d92){return{'model':db[_0x3c8d92[_0xd936('0x23')]],'as':_0x3c8d92['as'],'attributes':_0x3c8d92[_0xd936('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34bc91){logger[_0xd936('0x12')](_0xd936('0x1c'),_0x50b6ce);logger[_0xd936('0x15')]('GetChatQueue',_0x50b6ce,JSON[_0xd936('0x17')](_0x34bc91));_0x5355dc(_0x34bc91);})[_0xd936('0x1b')](function(_0x4872ca){logger[_0xd936('0x18')](_0xd936('0x1c'),_0x4872ca['message'],_0x50b6ce);_0x10c05d(_0x847544[_0xd936('0x18')](0x1f4,_0x4872ca['message']));});});};exports[_0xd936('0x25')]=function(_0x2bd555){var _0x2d6c72=this;return new Promise(function(_0x8757af,_0x4b25d2){return db['ChatQueue'][_0xd936('0x26')]({'raw':_0x2bd555[_0xd936('0x1e')]?_0x2bd555[_0xd936('0x1e')][_0xd936('0x1f')]===undefined?!![]:![]:!![],'where':_0x2bd555[_0xd936('0x1e')]?_0x2bd555[_0xd936('0x1e')][_0xd936('0x27')]||null:null,'attributes':_0x2bd555[_0xd936('0x1e')]?_0x2bd555[_0xd936('0x1e')][_0xd936('0x20')]||null:null,'include':_0x2bd555[_0xd936('0x1e')]?_0x2bd555['options']['include']?_[_0xd936('0x24')](_0x2bd555['options'][_0xd936('0x22')],function(_0x56bea5){return{'model':db[_0x56bea5[_0xd936('0x23')]],'as':_0x56bea5['as'],'attributes':_0x56bea5[_0xd936('0x20')],'include':_0x56bea5[_0xd936('0x22')]?_[_0xd936('0x24')](_0x56bea5[_0xd936('0x22')],function(_0x3052a3){return{'model':db[_0x3052a3[_0xd936('0x23')]],'as':_0x3052a3['as'],'attributes':_0x3052a3[_0xd936('0x20')],'include':_0x3052a3[_0xd936('0x22')]?_['map'](_0x3052a3[_0xd936('0x22')],function(_0x531f9d){return{'model':db[_0x531f9d['model']],'as':_0x531f9d['as'],'attributes':_0x531f9d[_0xd936('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c2ab0){logger[_0xd936('0x12')](_0xd936('0x25'),_0x2bd555);logger[_0xd936('0x15')](_0xd936('0x25'),_0x2bd555,JSON[_0xd936('0x17')](_0x5c2ab0));_0x8757af(_0x5c2ab0);})[_0xd936('0x1b')](function(_0x5d77cf){logger[_0xd936('0x18')](_0xd936('0x25'),_0x5d77cf[_0xd936('0x1a')],_0x2bd555);_0x4b25d2(_0x2d6c72[_0xd936('0x18')](0x1f4,_0x5d77cf[_0xd936('0x1a')]));});});}; \ No newline at end of file +var _0x8188=['ShowChatQueue','lodash','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','catch','find','raw','then'];(function(_0x34c646,_0xa5519c){var _0x351d34=function(_0x4bb9d3){while(--_0x4bb9d3){_0x34c646['push'](_0x34c646['shift']());}};_0x351d34(++_0xa5519c);}(_0x8188,0x76));var _0x8818=function(_0x21f649,_0x550328){_0x21f649=_0x21f649-0x0;var _0x87e52e=_0x8188[_0x21f649];return _0x87e52e;};'use strict';var _=require(_0x8818('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8818('0x1'));var fs=require('fs');var Redis=require(_0x8818('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8818('0x3'))(_0x8818('0x4'));var config=require(_0x8818('0x5'));var jayson=require(_0x8818('0x6'));var client=jayson[_0x8818('0x7')][_0x8818('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8818('0x9')],{'host':_0x8818('0xa'),'port':0x18eb});var socket=require(_0x8818('0xb'))(new Redis(config[_0x8818('0x9')]));require(_0x8818('0xc'))['register'](socket);function respondWithRpcPromise(_0x246ca8,_0x3f6c0d,_0x47136e){return new BPromise(function(_0x2b5d0b,_0x553716){return client[_0x8818('0xd')](_0x246ca8,_0x47136e)['then'](function(_0x3276d0){logger[_0x8818('0xe')]('ChatQueue,\x20%s,\x20%s',_0x3f6c0d,'request\x20sent');logger[_0x8818('0xf')](_0x8818('0x10'),_0x3f6c0d,_0x8818('0x11'),JSON[_0x8818('0x12')](_0x3276d0));if(_0x3276d0[_0x8818('0x13')]){if(_0x3276d0[_0x8818('0x13')][_0x8818('0x14')]===0x1f4){logger['error'](_0x8818('0x15'),_0x3f6c0d,_0x3276d0[_0x8818('0x13')][_0x8818('0x16')]);return _0x553716(_0x3276d0[_0x8818('0x13')][_0x8818('0x16')]);}logger[_0x8818('0x13')]('ChatQueue,\x20%s,\x20%s',_0x3f6c0d,_0x3276d0[_0x8818('0x13')]['message']);return _0x2b5d0b(_0x3276d0[_0x8818('0x13')][_0x8818('0x16')]);}else{logger[_0x8818('0xe')]('ChatQueue,\x20%s,\x20%s',_0x3f6c0d,_0x8818('0x11'));_0x2b5d0b(_0x3276d0[_0x8818('0x17')]['message']);}})['catch'](function(_0x22eda6){logger[_0x8818('0x13')](_0x8818('0x15'),_0x3f6c0d,_0x22eda6);_0x553716(_0x22eda6);});});}exports[_0x8818('0x18')]=function(_0x6e880d){var _0x5402c1=this;return new Promise(function(_0xd054b5,_0x397d28){return db[_0x8818('0x19')][_0x8818('0x1a')]({'raw':_0x6e880d[_0x8818('0x1b')]?_0x6e880d['options']['raw']===undefined?!![]:![]:!![],'where':_0x6e880d['options']?_0x6e880d[_0x8818('0x1b')][_0x8818('0x1c')]||null:null,'attributes':_0x6e880d[_0x8818('0x1b')]?_0x6e880d[_0x8818('0x1b')][_0x8818('0x1d')]||null:null,'limit':_0x6e880d[_0x8818('0x1b')]?_0x6e880d['options'][_0x8818('0x1e')]||null:null,'include':_0x6e880d[_0x8818('0x1b')]?_0x6e880d['options'][_0x8818('0x1f')]?_[_0x8818('0x20')](_0x6e880d[_0x8818('0x1b')][_0x8818('0x1f')],function(_0x46747f){return{'model':db[_0x46747f[_0x8818('0x21')]],'as':_0x46747f['as'],'attributes':_0x46747f['attributes'],'include':_0x46747f[_0x8818('0x1f')]?_[_0x8818('0x20')](_0x46747f[_0x8818('0x1f')],function(_0x225b9b){return{'model':db[_0x225b9b[_0x8818('0x21')]],'as':_0x225b9b['as'],'attributes':_0x225b9b[_0x8818('0x1d')],'include':_0x225b9b[_0x8818('0x1f')]?_['map'](_0x225b9b[_0x8818('0x1f')],function(_0x4aa3dd){return{'model':db[_0x4aa3dd[_0x8818('0x21')]],'as':_0x4aa3dd['as'],'attributes':_0x4aa3dd[_0x8818('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15ab06){logger[_0x8818('0xe')](_0x8818('0x18'),_0x6e880d);logger[_0x8818('0xf')](_0x8818('0x18'),_0x6e880d,JSON[_0x8818('0x12')](_0x15ab06));_0xd054b5(_0x15ab06);})[_0x8818('0x22')](function(_0x3792c7){logger[_0x8818('0x13')](_0x8818('0x18'),_0x3792c7[_0x8818('0x16')],_0x6e880d);_0x397d28(_0x5402c1[_0x8818('0x13')](0x1f4,_0x3792c7['message']));});});};exports['ShowChatQueue']=function(_0x2b2eba){var _0x2094cc=this;return new Promise(function(_0x3c3ef9,_0x2d91ac){return db[_0x8818('0x19')][_0x8818('0x23')]({'raw':_0x2b2eba[_0x8818('0x1b')]?_0x2b2eba['options'][_0x8818('0x24')]===undefined?!![]:![]:!![],'where':_0x2b2eba[_0x8818('0x1b')]?_0x2b2eba[_0x8818('0x1b')][_0x8818('0x1c')]||null:null,'attributes':_0x2b2eba[_0x8818('0x1b')]?_0x2b2eba[_0x8818('0x1b')]['attributes']||null:null,'include':_0x2b2eba[_0x8818('0x1b')]?_0x2b2eba[_0x8818('0x1b')]['include']?_[_0x8818('0x20')](_0x2b2eba['options'][_0x8818('0x1f')],function(_0x1a1d80){return{'model':db[_0x1a1d80[_0x8818('0x21')]],'as':_0x1a1d80['as'],'attributes':_0x1a1d80['attributes'],'include':_0x1a1d80[_0x8818('0x1f')]?_['map'](_0x1a1d80['include'],function(_0x4e0dca){return{'model':db[_0x4e0dca['model']],'as':_0x4e0dca['as'],'attributes':_0x4e0dca['attributes'],'include':_0x4e0dca['include']?_[_0x8818('0x20')](_0x4e0dca[_0x8818('0x1f')],function(_0x328f5f){return{'model':db[_0x328f5f[_0x8818('0x21')]],'as':_0x328f5f['as'],'attributes':_0x328f5f[_0x8818('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8818('0x25')](function(_0x54f82e){logger[_0x8818('0xe')]('ShowChatQueue',_0x2b2eba);logger[_0x8818('0xf')](_0x8818('0x26'),_0x2b2eba,JSON[_0x8818('0x12')](_0x54f82e));_0x3c3ef9(_0x54f82e);})[_0x8818('0x22')](function(_0x2bb206){logger[_0x8818('0x13')](_0x8818('0x26'),_0x2bb206['message'],_0x2b2eba);_0x2d91ac(_0x2094cc[_0x8818('0x13')](0x1f4,_0x2bb206[_0x8818('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index bb0f331..e419b33 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 _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x1279bb,_0x49c5cf){var _0xb2325a=function(_0x326528){while(--_0x326528){_0x1279bb['push'](_0x1279bb['shift']());}};_0xb2325a(++_0x49c5cf);}(_0xec56,0x1bd));var _0x6ec5=function(_0x45358d,_0x5aafc7){_0x45358d=_0x45358d-0x0;var _0x1ef94e=_0xec56[_0x45358d];return _0x1ef94e;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file +var _0x5178=['remove','update','register','length','save'];(function(_0x36403e,_0x440182){var _0x334dee=function(_0x4b3d6e){while(--_0x4b3d6e){_0x36403e['push'](_0x36403e['shift']());}};_0x334dee(++_0x440182);}(_0x5178,0x171));var _0x8517=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5178[_0x618414];return _0x21c19a;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index e95d7a7..25d7f36 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x442c23,_0x2d8c52){var _0x165b59=function(_0x4608b4){while(--_0x4608b4){_0x442c23['push'](_0x442c23['shift']());}};_0x165b59(++_0x2d8c52);}(_0x814b,0x1a2));var _0xb814=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x814b[_0x4ab3fb];return _0x34fe1e;};'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('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x42e961,_0x12b8d5){var _0x30d9f3=function(_0x30f3c1){while(--_0x30f3c1){_0x42e961['push'](_0x42e961['shift']());}};_0x30d9f3(++_0x12b8d5);}(_0xe14b,0x93));var _0xbe14=function(_0x26b9d0,_0x5c1549){_0x26b9d0=_0x26b9d0-0x0;var _0x495a45=_0xe14b[_0x26b9d0];return _0x495a45;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('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 4c71295..2907aec 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 _0xe68d=['DATE','moment','exports','STRING'];(function(_0x485fb6,_0x3da5cc){var _0x1e6db4=function(_0x3451e4){while(--_0x3451e4){_0x485fb6['push'](_0x485fb6['shift']());}};_0x1e6db4(++_0x3da5cc);}(_0xe68d,0xcd));var _0xde68=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0xe68d[_0x3c5f8d];return _0x3b7beb;};'use strict';var moment=require(_0xde68('0x0'));var Sequelize=require('sequelize');module[_0xde68('0x1')]={'uniqueid':{'type':Sequelize[_0xde68('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xde68('0x3')]},'leaveAt':{'type':Sequelize[_0xde68('0x3')]},'acceptAt':{'type':Sequelize[_0xde68('0x3')]},'exitAt':{'type':Sequelize[_0xde68('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1668=['DATE','sequelize','exports','STRING'];(function(_0x36db62,_0x97922d){var _0x2b29fd=function(_0x1c6629){while(--_0x1c6629){_0x36db62['push'](_0x36db62['shift']());}};_0x2b29fd(++_0x97922d);}(_0x1668,0x65));var _0x8166=function(_0xc87c9d,_0x4b5c5a){_0xc87c9d=_0xc87c9d-0x0;var _0x42a431=_0x1668[_0xc87c9d];return _0x42a431;};'use strict';var moment=require('moment');var Sequelize=require(_0x8166('0x0'));module[_0x8166('0x1')]={'uniqueid':{'type':Sequelize[_0x8166('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8166('0x3')]},'leaveAt':{'type':Sequelize[_0x8166('0x3')]},'acceptAt':{'type':Sequelize[_0x8166('0x3')]},'exitAt':{'type':Sequelize[_0x8166('0x3')]},'reason':{'type':Sequelize[_0x8166('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index dece8d8..5853a8f 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 _0x3837=['find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length'];(function(_0x1a74c0,_0x3147d2){var _0x5ebc15=function(_0x12c6a3){while(--_0x12c6a3){_0x1a74c0['push'](_0x1a74c0['shift']());}};_0x5ebc15(++_0x3147d2);}(_0x3837,0x1d1));var _0x7383=function(_0x51630f,_0x54b703){_0x51630f=_0x51630f-0x0;var _0x2de9ef=_0x3837[_0x51630f];return _0x2de9ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];function respondWithStatusCode(_0x35e5f4,_0xe359e8){_0xe359e8=_0xe359e8||0xcc;return function(_0x70b32){if(_0x70b32){return _0x35e5f4[_0x7383('0x1a')](_0xe359e8);}return _0x35e5f4[_0x7383('0x1b')](_0xe359e8)[_0x7383('0x1c')]();};}function respondWithResult(_0x5b018f,_0x43c1d6){_0x43c1d6=_0x43c1d6||0xc8;return function(_0x3a2c78){if(_0x3a2c78){return _0x5b018f[_0x7383('0x1b')](_0x43c1d6)[_0x7383('0x1d')](_0x3a2c78);}};}function respondWithFilteredResult(_0x4aa59d,_0x566949){return function(_0x47b4c4){if(_0x47b4c4){var _0x5cf093=typeof _0x566949[_0x7383('0x1e')]===_0x7383('0x1f')&&typeof _0x566949[_0x7383('0x20')]===_0x7383('0x1f');var _0x1f733d=_0x47b4c4['count'];var _0x1cf7bb=_0x5cf093?0x0:_0x566949[_0x7383('0x1e')];var _0x1c7645=_0x5cf093?_0x47b4c4[_0x7383('0x21')]:_0x566949[_0x7383('0x1e')]+_0x566949[_0x7383('0x20')];var _0x115ff6;if(_0x1c7645>=_0x1f733d){_0x1c7645=_0x1f733d;_0x115ff6=0xc8;}else{_0x115ff6=0xce;}_0x4aa59d[_0x7383('0x1b')](_0x115ff6);return _0x4aa59d[_0x7383('0x22')](_0x7383('0x23'),_0x1cf7bb+'-'+_0x1c7645+'/'+_0x1f733d)['json'](_0x47b4c4);}return null;};}function patchUpdates(_0x42d970){return function(_0x2aebe0){try{jsonpatch[_0x7383('0x24')](_0x2aebe0,_0x42d970,!![]);}catch(_0x4a65e9){return BPromise[_0x7383('0x25')](_0x4a65e9);}return _0x2aebe0[_0x7383('0x26')]();};}function saveUpdates(_0x47e145,_0x316204){return function(_0x57420d){if(_0x57420d){return _0x57420d[_0x7383('0x27')](_0x47e145)[_0x7383('0x28')](function(_0x5c617a){return _0x5c617a;});}return null;};}function removeEntity(_0x1afeab,_0x3c5467){return function(_0x1edf1d){if(_0x1edf1d){return _0x1edf1d[_0x7383('0x29')]()[_0x7383('0x28')](function(){_0x1afeab['status'](0xcc)[_0x7383('0x1c')]();});}};}function handleEntityNotFound(_0x5eaf6a,_0x4c3e40){return function(_0x388964){if(!_0x388964){_0x5eaf6a[_0x7383('0x1a')](0x194);}return _0x388964;};}function handleError(_0x82bd92,_0x208ef9){_0x208ef9=_0x208ef9||0x1f4;return function(_0x4a1840){logger[_0x7383('0x2a')](_0x4a1840['stack']);if(_0x4a1840[_0x7383('0x2b')]){delete _0x4a1840[_0x7383('0x2b')];}_0x82bd92[_0x7383('0x1b')](_0x208ef9)[_0x7383('0x2c')](_0x4a1840);};}exports[_0x7383('0x2d')]=function(_0x439d09,_0x272d78){var _0x43f7a5={},_0x2b550d={},_0x15b14c={'count':0x0,'rows':[]};var _0x512a98=_[_0x7383('0x2e')](db[_0x7383('0x2f')]['rawAttributes'],function(_0x5e52ce){return{'name':_0x5e52ce['fieldName'],'type':_0x5e52ce[_0x7383('0x30')][_0x7383('0x31')]};});_0x2b550d[_0x7383('0x32')]=_[_0x7383('0x2e')](_0x512a98,_0x7383('0x2b'));_0x2b550d[_0x7383('0x33')]=_[_0x7383('0x34')](_0x439d09[_0x7383('0x33')]);_0x2b550d[_0x7383('0x35')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],_0x2b550d[_0x7383('0x33')]);_0x43f7a5[_0x7383('0x37')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],qs[_0x7383('0x38')](_0x439d09[_0x7383('0x33')][_0x7383('0x38')]));_0x43f7a5[_0x7383('0x37')]=_0x43f7a5[_0x7383('0x37')]['length']?_0x43f7a5[_0x7383('0x37')]:_0x2b550d[_0x7383('0x32')];if(!_0x439d09['query'][_0x7383('0x39')](_0x7383('0x3a'))){_0x43f7a5[_0x7383('0x20')]=qs[_0x7383('0x20')](_0x439d09[_0x7383('0x33')]['limit']);_0x43f7a5[_0x7383('0x1e')]=qs[_0x7383('0x1e')](_0x439d09[_0x7383('0x33')][_0x7383('0x1e')]);}_0x43f7a5[_0x7383('0x3b')]=qs[_0x7383('0x3c')](_0x439d09[_0x7383('0x33')]['sort']);_0x43f7a5['where']=qs['filters'](_[_0x7383('0x3d')](_0x439d09[_0x7383('0x33')],_0x2b550d[_0x7383('0x35')]),_0x512a98);if(_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]){_0x43f7a5[_0x7383('0x3f')]=_[_0x7383('0x40')](_0x43f7a5[_0x7383('0x3f')],{'$or':_[_0x7383('0x2e')](_0x512a98,function(_0x4f307a){if(_0x4f307a[_0x7383('0x30')]!==_0x7383('0x41')){var _0x3c2795={};_0x3c2795[_0x4f307a[_0x7383('0x2b')]]={'$like':'%'+_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]+'%'};return _0x3c2795;}})});}_0x43f7a5=_['merge']({},_0x43f7a5,_0x439d09[_0x7383('0x42')]);var _0x5329a6={'where':_0x43f7a5['where']};return db[_0x7383('0x2f')][_0x7383('0x21')](_0x5329a6)[_0x7383('0x28')](function(_0x3f14a6){_0x15b14c[_0x7383('0x21')]=_0x3f14a6;if(_0x439d09['query']['includeAll']){_0x43f7a5[_0x7383('0x43')]=[{'all':!![]}];}return db[_0x7383('0x2f')]['findAll'](_0x43f7a5);})['then'](function(_0x271cd5){_0x15b14c[_0x7383('0x44')]=_0x271cd5;return _0x15b14c;})[_0x7383('0x28')](respondWithFilteredResult(_0x272d78,_0x43f7a5))[_0x7383('0x45')](handleError(_0x272d78,null));};exports[_0x7383('0x46')]=function(_0x53c999,_0x141728){var _0x5d9085={'raw':!![],'where':{'id':_0x53c999[_0x7383('0x47')]['id']}},_0x3951d1={};_0x3951d1[_0x7383('0x32')]=_[_0x7383('0x34')](db['ChatQueueReport'][_0x7383('0x48')]);_0x3951d1[_0x7383('0x33')]=_[_0x7383('0x34')](_0x53c999[_0x7383('0x33')]);_0x3951d1['filters']=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],_0x3951d1[_0x7383('0x33')]);_0x5d9085[_0x7383('0x37')]=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],qs[_0x7383('0x38')](_0x53c999[_0x7383('0x33')][_0x7383('0x38')]));_0x5d9085[_0x7383('0x37')]=_0x5d9085[_0x7383('0x37')][_0x7383('0x49')]?_0x5d9085[_0x7383('0x37')]:_0x3951d1['model'];if(_0x53c999[_0x7383('0x33')]['includeAll']){_0x5d9085[_0x7383('0x43')]=[{'all':!![]}];}_0x5d9085=_[_0x7383('0x40')]({},_0x5d9085,_0x53c999[_0x7383('0x42')]);return db['ChatQueueReport'][_0x7383('0x4a')](_0x5d9085)[_0x7383('0x28')](handleEntityNotFound(_0x141728,null))['then'](respondWithResult(_0x141728,null))[_0x7383('0x45')](handleError(_0x141728,null));};exports['create']=function(_0x10ac80,_0x49e4f1){return db[_0x7383('0x2f')]['create'](_0x10ac80[_0x7383('0x4b')],{})[_0x7383('0x28')](respondWithResult(_0x49e4f1,0xc9))[_0x7383('0x45')](handleError(_0x49e4f1,null));};exports['update']=function(_0xd6ea61,_0x15ed37){if(_0xd6ea61[_0x7383('0x4b')]['id']){delete _0xd6ea61['body']['id'];}return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0xd6ea61[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x15ed37,null))[_0x7383('0x28')](saveUpdates(_0xd6ea61[_0x7383('0x4b')],null))[_0x7383('0x28')](respondWithResult(_0x15ed37,null))[_0x7383('0x45')](handleError(_0x15ed37,null));};exports[_0x7383('0x29')]=function(_0x380316,_0x65a7d2){return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0x380316[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x65a7d2,null))[_0x7383('0x28')](removeEntity(_0x65a7d2,null))[_0x7383('0x45')](handleError(_0x65a7d2,null));};exports['describe']=function(_0x210351,_0xa7233a){return db['ChatQueueReport'][_0x7383('0x4c')]()[_0x7383('0x28')](respondWithResult(_0xa7233a,null))[_0x7383('0x45')](handleError(_0xa7233a,null));}; \ No newline at end of file +var _0x16a6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x43000,_0x469121){var _0x26c0f0=function(_0x26dbc1){while(--_0x26dbc1){_0x43000['push'](_0x43000['shift']());}};_0x26c0f0(++_0x469121);}(_0x16a6,0x15c));var _0x616a=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x16a6[_0x588011];return _0x3b3773;};'use strict';var emlformat=require(_0x616a('0x0'));var rimraf=require(_0x616a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x616a('0x2'));var rp=require(_0x616a('0x3'));var moment=require(_0x616a('0x4'));var BPromise=require(_0x616a('0x5'));var Mustache=require(_0x616a('0x6'));var util=require(_0x616a('0x7'));var path=require('path');var sox=require(_0x616a('0x8'));var csv=require(_0x616a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x616a('0xa'));var squel=require(_0x616a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x616a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x616a('0xd'));var Papa=require('papaparse');var Redis=require(_0x616a('0xe'));var authService=require(_0x616a('0xf'));var qs=require(_0x616a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616a('0x11'));var logger=require(_0x616a('0x12'))(_0x616a('0x13'));var utils=require(_0x616a('0x14'));var config=require(_0x616a('0x15'));var licenseUtil=require(_0x616a('0x16'));var db=require(_0x616a('0x17'))['db'];function respondWithStatusCode(_0x4122b7,_0x5755c7){_0x5755c7=_0x5755c7||0xcc;return function(_0x318dfe){if(_0x318dfe){return _0x4122b7[_0x616a('0x18')](_0x5755c7);}return _0x4122b7[_0x616a('0x19')](_0x5755c7)[_0x616a('0x1a')]();};}function respondWithResult(_0x295fc2,_0x4a33d5){_0x4a33d5=_0x4a33d5||0xc8;return function(_0x1399c1){if(_0x1399c1){return _0x295fc2[_0x616a('0x19')](_0x4a33d5)[_0x616a('0x1b')](_0x1399c1);}};}function respondWithFilteredResult(_0x18b6dc,_0x3bcf20){return function(_0x53f228){if(_0x53f228){var _0x204e68=typeof _0x3bcf20[_0x616a('0x1c')]==='undefined'&&typeof _0x3bcf20['limit']===_0x616a('0x1d');var _0x4768b2=_0x53f228[_0x616a('0x1e')];var _0x4d59e7=_0x204e68?0x0:_0x3bcf20[_0x616a('0x1c')];var _0x1f3241=_0x204e68?_0x53f228['count']:_0x3bcf20['offset']+_0x3bcf20[_0x616a('0x1f')];var _0x27e95c;if(_0x1f3241>=_0x4768b2){_0x1f3241=_0x4768b2;_0x27e95c=0xc8;}else{_0x27e95c=0xce;}_0x18b6dc[_0x616a('0x19')](_0x27e95c);return _0x18b6dc[_0x616a('0x20')]('Content-Range',_0x4d59e7+'-'+_0x1f3241+'/'+_0x4768b2)['json'](_0x53f228);}return null;};}function patchUpdates(_0x5568fd){return function(_0x5f2e80){try{jsonpatch['apply'](_0x5f2e80,_0x5568fd,!![]);}catch(_0x5ee3f2){return BPromise[_0x616a('0x21')](_0x5ee3f2);}return _0x5f2e80['save']();};}function saveUpdates(_0xb8ceeb,_0x137974){return function(_0x4f5594){if(_0x4f5594){return _0x4f5594[_0x616a('0x22')](_0xb8ceeb)[_0x616a('0x23')](function(_0x3d484b){return _0x3d484b;});}return null;};}function removeEntity(_0x100c98,_0x500c22){return function(_0x2db2bb){if(_0x2db2bb){return _0x2db2bb[_0x616a('0x24')]()[_0x616a('0x23')](function(){_0x100c98[_0x616a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e11f2,_0x4be8a8){return function(_0x30c1a){if(!_0x30c1a){_0x3e11f2[_0x616a('0x18')](0x194);}return _0x30c1a;};}function handleError(_0x5f1e6a,_0x55abc8){_0x55abc8=_0x55abc8||0x1f4;return function(_0x50c6b8){logger[_0x616a('0x25')](_0x50c6b8[_0x616a('0x26')]);if(_0x50c6b8[_0x616a('0x27')]){delete _0x50c6b8[_0x616a('0x27')];}_0x5f1e6a['status'](_0x55abc8)[_0x616a('0x28')](_0x50c6b8);};}exports[_0x616a('0x29')]=function(_0x195b73,_0x163fd0){var _0x28ca50={},_0x87db00={},_0x41a22d={'count':0x0,'rows':[]};var _0x5f3a59=_[_0x616a('0x2a')](db[_0x616a('0x2b')]['rawAttributes'],function(_0x41f722){return{'name':_0x41f722['fieldName'],'type':_0x41f722['type'][_0x616a('0x2c')]};});_0x87db00[_0x616a('0x2d')]=_[_0x616a('0x2a')](_0x5f3a59,'name');_0x87db00[_0x616a('0x2e')]=_[_0x616a('0x2f')](_0x195b73[_0x616a('0x2e')]);_0x87db00[_0x616a('0x30')]=_[_0x616a('0x31')](_0x87db00[_0x616a('0x2d')],_0x87db00['query']);_0x28ca50[_0x616a('0x32')]=_['intersection'](_0x87db00[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x195b73[_0x616a('0x2e')]['fields']));_0x28ca50[_0x616a('0x32')]=_0x28ca50[_0x616a('0x32')]['length']?_0x28ca50['attributes']:_0x87db00[_0x616a('0x2d')];if(!_0x195b73[_0x616a('0x2e')][_0x616a('0x34')](_0x616a('0x35'))){_0x28ca50['limit']=qs['limit'](_0x195b73['query'][_0x616a('0x1f')]);_0x28ca50[_0x616a('0x1c')]=qs[_0x616a('0x1c')](_0x195b73[_0x616a('0x2e')][_0x616a('0x1c')]);}_0x28ca50[_0x616a('0x36')]=qs[_0x616a('0x37')](_0x195b73[_0x616a('0x2e')][_0x616a('0x37')]);_0x28ca50[_0x616a('0x38')]=qs['filters'](_[_0x616a('0x39')](_0x195b73['query'],_0x87db00[_0x616a('0x30')]),_0x5f3a59);if(_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]){_0x28ca50[_0x616a('0x38')]=_[_0x616a('0x3b')](_0x28ca50[_0x616a('0x38')],{'$or':_[_0x616a('0x2a')](_0x5f3a59,function(_0x220c32){if(_0x220c32[_0x616a('0x3c')]!=='VIRTUAL'){var _0x304e27={};_0x304e27[_0x220c32[_0x616a('0x27')]]={'$like':'%'+_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]+'%'};return _0x304e27;}})});}_0x28ca50=_['merge']({},_0x28ca50,_0x195b73[_0x616a('0x3d')]);var _0x4c6a76={'where':_0x28ca50[_0x616a('0x38')]};return db['ChatQueueReport'][_0x616a('0x1e')](_0x4c6a76)[_0x616a('0x23')](function(_0x598085){_0x41a22d[_0x616a('0x1e')]=_0x598085;if(_0x195b73['query'][_0x616a('0x3e')]){_0x28ca50[_0x616a('0x3f')]=[{'all':!![]}];}return db[_0x616a('0x2b')][_0x616a('0x40')](_0x28ca50);})[_0x616a('0x23')](function(_0x21fd2b){_0x41a22d[_0x616a('0x41')]=_0x21fd2b;return _0x41a22d;})['then'](respondWithFilteredResult(_0x163fd0,_0x28ca50))[_0x616a('0x42')](handleError(_0x163fd0,null));};exports['show']=function(_0x409689,_0x35e3e3){var _0x199140={'raw':!![],'where':{'id':_0x409689[_0x616a('0x43')]['id']}},_0x4dbb8b={};_0x4dbb8b[_0x616a('0x2d')]=_[_0x616a('0x2f')](db[_0x616a('0x2b')][_0x616a('0x44')]);_0x4dbb8b['query']=_[_0x616a('0x2f')](_0x409689[_0x616a('0x2e')]);_0x4dbb8b[_0x616a('0x30')]=_['intersection'](_0x4dbb8b[_0x616a('0x2d')],_0x4dbb8b[_0x616a('0x2e')]);_0x199140[_0x616a('0x32')]=_[_0x616a('0x31')](_0x4dbb8b[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x409689[_0x616a('0x2e')]['fields']));_0x199140[_0x616a('0x32')]=_0x199140[_0x616a('0x32')]['length']?_0x199140['attributes']:_0x4dbb8b[_0x616a('0x2d')];if(_0x409689[_0x616a('0x2e')][_0x616a('0x3e')]){_0x199140[_0x616a('0x3f')]=[{'all':!![]}];}_0x199140=_[_0x616a('0x3b')]({},_0x199140,_0x409689[_0x616a('0x3d')]);return db['ChatQueueReport'][_0x616a('0x45')](_0x199140)[_0x616a('0x23')](handleEntityNotFound(_0x35e3e3,null))[_0x616a('0x23')](respondWithResult(_0x35e3e3,null))['catch'](handleError(_0x35e3e3,null));};exports[_0x616a('0x46')]=function(_0x507efa,_0x52d38){return db[_0x616a('0x2b')][_0x616a('0x46')](_0x507efa[_0x616a('0x47')],{})['then'](respondWithResult(_0x52d38,0xc9))[_0x616a('0x42')](handleError(_0x52d38,null));};exports[_0x616a('0x22')]=function(_0x3bea90,_0x3d42fc){if(_0x3bea90[_0x616a('0x47')]['id']){delete _0x3bea90['body']['id'];}return db[_0x616a('0x2b')][_0x616a('0x45')]({'where':{'id':_0x3bea90[_0x616a('0x43')]['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x3d42fc,null))[_0x616a('0x23')](saveUpdates(_0x3bea90[_0x616a('0x47')],null))['then'](respondWithResult(_0x3d42fc,null))[_0x616a('0x42')](handleError(_0x3d42fc,null));};exports[_0x616a('0x24')]=function(_0x349cd0,_0x16e6c2){return db['ChatQueueReport'][_0x616a('0x45')]({'where':{'id':_0x349cd0['params']['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x16e6c2,null))[_0x616a('0x23')](removeEntity(_0x16e6c2,null))['catch'](handleError(_0x16e6c2,null));};exports[_0x616a('0x48')]=function(_0x1ea086,_0x30a48e){return db['ChatQueueReport'][_0x616a('0x48')]()[_0x616a('0x23')](respondWithResult(_0x30a48e,null))[_0x616a('0x42')](handleError(_0x30a48e,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e71ab6f..2e51abe 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x16fd68,_0x3d394d){var _0x12cf8e=function(_0x4728c1){while(--_0x4728c1){_0x16fd68['push'](_0x16fd68['shift']());}};_0x12cf8e(++_0x3d394d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1dad4f,_0x13b837){_0x1dad4f=_0x1dad4f-0x0;var _0x22468b=_0xb10b[_0x1dad4f];return _0x22468b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 041b5e7..542d16f 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 _0x691a=['debug','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x691a,0xfb));var _0xa691=function(_0x18edc4,_0x407480){_0x18edc4=_0x18edc4-0x0;var _0x4bdc1f=_0x691a[_0x18edc4];return _0x4bdc1f;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var moment=require(_0xa691('0x2'));var BPromise=require(_0xa691('0x3'));var rs=require(_0xa691('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa691('0x5'))['db'];var utils=require(_0xa691('0x6'));var logger=require('../../config/logger')(_0xa691('0x7'));var config=require('../../config/environment');var jayson=require(_0xa691('0x8'));var client=jayson[_0xa691('0x9')][_0xa691('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x546009,_0x3c4b55,_0x10046a){return new BPromise(function(_0x14218b,_0x1d093c){return client[_0xa691('0xb')](_0x546009,_0x10046a)[_0xa691('0xc')](function(_0x41a061){logger[_0xa691('0xd')](_0xa691('0xe'),_0x3c4b55,'request\x20sent');logger['debug'](_0xa691('0xf'),_0x3c4b55,_0xa691('0x10'),JSON[_0xa691('0x11')](_0x41a061));if(_0x41a061[_0xa691('0x12')]){if(_0x41a061['error'][_0xa691('0x13')]===0x1f4){logger[_0xa691('0x12')](_0xa691('0xe'),_0x3c4b55,_0x41a061[_0xa691('0x12')][_0xa691('0x14')]);return _0x1d093c(_0x41a061[_0xa691('0x12')][_0xa691('0x14')]);}logger[_0xa691('0x12')](_0xa691('0xe'),_0x3c4b55,_0x41a061[_0xa691('0x12')][_0xa691('0x14')]);return _0x14218b(_0x41a061[_0xa691('0x12')][_0xa691('0x14')]);}else{logger[_0xa691('0xd')](_0xa691('0xe'),_0x3c4b55,_0xa691('0x10'));_0x14218b(_0x41a061[_0xa691('0x15')][_0xa691('0x14')]);}})[_0xa691('0x16')](function(_0x9dcea){logger['error'](_0xa691('0xe'),_0x3c4b55,_0x9dcea);_0x1d093c(_0x9dcea);});});}exports[_0xa691('0x17')]=function(_0x586119){var _0x342a24=this;return new Promise(function(_0x142b02,_0x57e103){return db[_0xa691('0x18')][_0xa691('0x19')](_0x586119[_0xa691('0x1a')],{'raw':_0x586119[_0xa691('0x1b')]?_0x586119[_0xa691('0x1b')][_0xa691('0x1c')]===undefined?!![]:![]:!![]})[_0xa691('0xc')](function(_0x263802){logger[_0xa691('0xd')]('CreateChatQueueReport',_0x586119);logger[_0xa691('0x1d')](_0xa691('0x17'),_0x586119,JSON[_0xa691('0x11')](_0x263802));_0x142b02(_0x263802);})['catch'](function(_0x544018){logger[_0xa691('0x12')](_0xa691('0x17'),_0x544018[_0xa691('0x14')],_0x586119);_0x57e103(_0x342a24[_0xa691('0x12')](0x1f4,_0x544018[_0xa691('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x29a94e){var _0x39d4ea=this;return new Promise(function(_0x54d587,_0x309c89){return db['ChatQueueReport'][_0xa691('0x1e')](_0x29a94e[_0xa691('0x1a')],{'raw':_0x29a94e['options']?_0x29a94e[_0xa691('0x1b')][_0xa691('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a94e[_0xa691('0x1b')]?_0x29a94e[_0xa691('0x1b')][_0xa691('0x1f')]||null:null,'attributes':_0x29a94e[_0xa691('0x1b')]?_0x29a94e[_0xa691('0x1b')][_0xa691('0x20')]||null:null,'limit':_0x29a94e[_0xa691('0x1b')]?_0x29a94e[_0xa691('0x1b')][_0xa691('0x21')]||null:null})[_0xa691('0xc')](function(_0xced4e9){logger[_0xa691('0xd')](_0xa691('0x22'),_0x29a94e);logger[_0xa691('0x1d')](_0xa691('0x22'),_0x29a94e,JSON[_0xa691('0x11')](_0xced4e9));_0x54d587(_0xced4e9);})['catch'](function(_0x689c7f){logger['error'](_0xa691('0x22'),_0x689c7f[_0xa691('0x14')],_0x29a94e);_0x309c89(_0x39d4ea[_0xa691('0x12')](0x1f4,_0x689c7f[_0xa691('0x14')]));});});}; \ No newline at end of file +var _0x32ac=['message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa9f0d7,_0x27c50f){var _0x51ae50=function(_0x22bebb){while(--_0x22bebb){_0xa9f0d7['push'](_0xa9f0d7['shift']());}};_0x51ae50(++_0x27c50f);}(_0x32ac,0x16e));var _0xc32a=function(_0x1b0a7b,_0x80aba){_0x1b0a7b=_0x1b0a7b-0x0;var _0x5be56b=_0x32ac[_0x1b0a7b];return _0x5be56b;};'use strict';var _=require(_0xc32a('0x0'));var util=require(_0xc32a('0x1'));var moment=require(_0xc32a('0x2'));var BPromise=require(_0xc32a('0x3'));var rs=require(_0xc32a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc32a('0x5'));var logger=require(_0xc32a('0x6'))('rpc');var config=require(_0xc32a('0x7'));var jayson=require(_0xc32a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ddf6d,_0x1737e0,_0x33aa84){return new BPromise(function(_0x3c7d8b,_0x268aa3){return client[_0xc32a('0x9')](_0x4ddf6d,_0x33aa84)[_0xc32a('0xa')](function(_0x25ea75){logger['info'](_0xc32a('0xb'),_0x1737e0,_0xc32a('0xc'));logger[_0xc32a('0xd')](_0xc32a('0xe'),_0x1737e0,'request\x20sent',JSON[_0xc32a('0xf')](_0x25ea75));if(_0x25ea75[_0xc32a('0x10')]){if(_0x25ea75[_0xc32a('0x10')][_0xc32a('0x11')]===0x1f4){logger[_0xc32a('0x10')](_0xc32a('0xb'),_0x1737e0,_0x25ea75[_0xc32a('0x10')][_0xc32a('0x12')]);return _0x268aa3(_0x25ea75[_0xc32a('0x10')][_0xc32a('0x12')]);}logger[_0xc32a('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x1737e0,_0x25ea75[_0xc32a('0x10')][_0xc32a('0x12')]);return _0x3c7d8b(_0x25ea75[_0xc32a('0x10')][_0xc32a('0x12')]);}else{logger[_0xc32a('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1737e0,'request\x20sent');_0x3c7d8b(_0x25ea75[_0xc32a('0x14')][_0xc32a('0x12')]);}})[_0xc32a('0x15')](function(_0x510d7b){logger['error'](_0xc32a('0xb'),_0x1737e0,_0x510d7b);_0x268aa3(_0x510d7b);});});}exports[_0xc32a('0x16')]=function(_0x59e72b){var _0x3912c3=this;return new Promise(function(_0x25becf,_0x527b28){return db[_0xc32a('0x17')][_0xc32a('0x18')](_0x59e72b['body'],{'raw':_0x59e72b[_0xc32a('0x19')]?_0x59e72b[_0xc32a('0x19')][_0xc32a('0x1a')]===undefined?!![]:![]:!![]})[_0xc32a('0xa')](function(_0x5d2d0e){logger[_0xc32a('0x13')]('CreateChatQueueReport',_0x59e72b);logger[_0xc32a('0xd')](_0xc32a('0x16'),_0x59e72b,JSON[_0xc32a('0xf')](_0x5d2d0e));_0x25becf(_0x5d2d0e);})[_0xc32a('0x15')](function(_0x243ed9){logger[_0xc32a('0x10')](_0xc32a('0x16'),_0x243ed9['message'],_0x59e72b);_0x527b28(_0x3912c3['error'](0x1f4,_0x243ed9[_0xc32a('0x12')]));});});};exports[_0xc32a('0x1b')]=function(_0x10d1aa){var _0x5de435=this;return new Promise(function(_0xe965c9,_0x5ecfca){return db[_0xc32a('0x17')]['update'](_0x10d1aa[_0xc32a('0x1c')],{'raw':_0x10d1aa[_0xc32a('0x19')]?_0x10d1aa[_0xc32a('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d1aa[_0xc32a('0x19')]?_0x10d1aa['options'][_0xc32a('0x1d')]||null:null,'attributes':_0x10d1aa[_0xc32a('0x19')]?_0x10d1aa[_0xc32a('0x19')][_0xc32a('0x1e')]||null:null,'limit':_0x10d1aa[_0xc32a('0x19')]?_0x10d1aa['options'][_0xc32a('0x1f')]||null:null})['then'](function(_0x1703ca){logger[_0xc32a('0x13')](_0xc32a('0x1b'),_0x10d1aa);logger[_0xc32a('0xd')]('UpdateChatQueueReport',_0x10d1aa,JSON[_0xc32a('0xf')](_0x1703ca));_0xe965c9(_0x1703ca);})[_0xc32a('0x15')](function(_0x2d1f87){logger[_0xc32a('0x10')](_0xc32a('0x1b'),_0x2d1f87['message'],_0x10d1aa);_0x5ecfca(_0x5de435[_0xc32a('0x10')](0x1f4,_0x2d1f87[_0xc32a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index d48b4a6..4490b49 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 _0x7697=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','describe','show','post','put','isAuthenticated','update','delete','/:id','destroy'];(function(_0x353256,_0x58c863){var _0x371cf6=function(_0x246132){while(--_0x246132){_0x353256['push'](_0x353256['shift']());}};_0x371cf6(++_0x58c863);}(_0x7697,0x1f4));var _0x7769=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x7697[_0x30c649];return _0x3edfb9;};'use strict';var multer=require(_0x7769('0x0'));var util=require(_0x7769('0x1'));var path=require(_0x7769('0x2'));var timeout=require(_0x7769('0x3'));var express=require(_0x7769('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7769('0x5'));var interaction=require(_0x7769('0x6'));var config=require('../../config/environment');var controller=require(_0x7769('0x7'));router[_0x7769('0x8')]('/',auth['isAuthenticated'](),controller[_0x7769('0x9')]);router['get'](_0x7769('0xa'),auth['isAuthenticated'](),controller[_0x7769('0xb')]);router[_0x7769('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7769('0xc')]);router[_0x7769('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7769('0xe')]('/:id',auth[_0x7769('0xf')](),controller[_0x7769('0x10')]);router[_0x7769('0x11')](_0x7769('0x12'),auth['isAuthenticated'](),controller[_0x7769('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd3fa=['/:id','show','put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','index','describe','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3fa,0x1e6));var _0xad3f=function(_0x4e704f,_0x150701){_0x4e704f=_0x4e704f-0x0;var _0x4a77fd=_0xd3fa[_0x4e704f];return _0x4a77fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xad3f('0x0'));var timeout=require(_0xad3f('0x1'));var express=require('express');var router=express[_0xad3f('0x2')]();var fs_extra=require(_0xad3f('0x3'));var auth=require(_0xad3f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xad3f('0x5')](),controller[_0xad3f('0x6')]);router['get']('/describe',auth[_0xad3f('0x5')](),controller[_0xad3f('0x7')]);router[_0xad3f('0x8')](_0xad3f('0x9'),auth[_0xad3f('0x5')](),controller[_0xad3f('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xad3f('0xb')](_0xad3f('0x9'),auth[_0xad3f('0x5')](),controller[_0xad3f('0xc')]);router[_0xad3f('0xd')](_0xad3f('0x9'),auth[_0xad3f('0x5')](),controller[_0xad3f('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e999127..4e976c3 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26389f,_0x4224a2){var _0x7f0ea4=function(_0x231f08){while(--_0x231f08){_0x26389f['push'](_0x26389f['shift']());}};_0x7f0ea4(++_0x4224a2);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c9939,_0x415865){_0x4c9939=_0x4c9939-0x0;var _0x593e75=_0xedd9[_0x4c9939];return _0x593e75;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5222d8,_0x5ce15e){var _0x396790=function(_0x261a29){while(--_0x261a29){_0x5222d8['push'](_0x5222d8['shift']());}};_0x396790(++_0x5ce15e);}(_0x70e0,0x17b));var _0x070e=function(_0x11449d,_0x324476){_0x11449d=_0x11449d-0x0;var _0x391300=_0x70e0[_0x11449d];return _0x391300;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c0c1398..2118fcd 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 _0xb927=['length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xb927,0xa3));var _0x7b92=function(_0x245067,_0x41b1cf){_0x245067=_0x245067-0x0;var _0x2e2585=_0xb927[_0x245067];return _0x2e2585;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b92('0x0'));var zipdir=require(_0x7b92('0x1'));var jsonpatch=require(_0x7b92('0x2'));var rp=require(_0x7b92('0x3'));var moment=require('moment');var BPromise=require(_0x7b92('0x4'));var Mustache=require('mustache');var util=require(_0x7b92('0x5'));var path=require(_0x7b92('0x6'));var sox=require(_0x7b92('0x7'));var csv=require(_0x7b92('0x8'));var ejs=require(_0x7b92('0x9'));var fs=require('fs');var fs_extra=require(_0x7b92('0xa'));var _=require(_0x7b92('0xb'));var squel=require(_0x7b92('0xc'));var crypto=require(_0x7b92('0xd'));var jsforce=require(_0x7b92('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b92('0x8'));var querystring=require('querystring');var Papa=require(_0x7b92('0xf'));var Redis=require('ioredis');var authService=require(_0x7b92('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b92('0x11'));var hardwareService=require(_0x7b92('0x12'));var logger=require(_0x7b92('0x13'))(_0x7b92('0x14'));var utils=require(_0x7b92('0x15'));var config=require(_0x7b92('0x16'));var licenseUtil=require(_0x7b92('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32f71d,_0x2b51b8){_0x2b51b8=_0x2b51b8||0xcc;return function(_0x280f96){if(_0x280f96){return _0x32f71d[_0x7b92('0x18')](_0x2b51b8);}return _0x32f71d[_0x7b92('0x19')](_0x2b51b8)[_0x7b92('0x1a')]();};}function respondWithResult(_0x176342,_0x4124a7){_0x4124a7=_0x4124a7||0xc8;return function(_0x84e278){if(_0x84e278){return _0x176342[_0x7b92('0x19')](_0x4124a7)['json'](_0x84e278);}};}function respondWithFilteredResult(_0x2681d4,_0x3be238){return function(_0x361689){if(_0x361689){var _0x132ade=typeof _0x3be238[_0x7b92('0x1b')]===_0x7b92('0x1c')&&typeof _0x3be238[_0x7b92('0x1d')]===_0x7b92('0x1c');var _0x1c0c57=_0x361689[_0x7b92('0x1e')];var _0x197238=_0x132ade?0x0:_0x3be238['offset'];var _0x3a76e4=_0x132ade?_0x361689['count']:_0x3be238[_0x7b92('0x1b')]+_0x3be238['limit'];var _0xfd8619;if(_0x3a76e4>=_0x1c0c57){_0x3a76e4=_0x1c0c57;_0xfd8619=0xc8;}else{_0xfd8619=0xce;}_0x2681d4[_0x7b92('0x19')](_0xfd8619);return _0x2681d4[_0x7b92('0x1f')](_0x7b92('0x20'),_0x197238+'-'+_0x3a76e4+'/'+_0x1c0c57)[_0x7b92('0x21')](_0x361689);}return null;};}function patchUpdates(_0x2659e1){return function(_0x7512ec){try{jsonpatch[_0x7b92('0x22')](_0x7512ec,_0x2659e1,!![]);}catch(_0x370137){return BPromise[_0x7b92('0x23')](_0x370137);}return _0x7512ec[_0x7b92('0x24')]();};}function saveUpdates(_0x3e2b01,_0x4485d5){return function(_0xa07535){if(_0xa07535){return _0xa07535[_0x7b92('0x25')](_0x3e2b01)[_0x7b92('0x26')](function(_0x31f6ac){return _0x31f6ac;});}return null;};}function removeEntity(_0x3598cd,_0x226b2c){return function(_0x5cf496){if(_0x5cf496){return _0x5cf496[_0x7b92('0x27')]()[_0x7b92('0x26')](function(){_0x3598cd[_0x7b92('0x19')](0xcc)[_0x7b92('0x1a')]();});}};}function handleEntityNotFound(_0x7d2d83,_0x393fed){return function(_0x3682b2){if(!_0x3682b2){_0x7d2d83[_0x7b92('0x18')](0x194);}return _0x3682b2;};}function handleError(_0x348924,_0x41cfda){_0x41cfda=_0x41cfda||0x1f4;return function(_0x555949){logger['error'](_0x555949['stack']);if(_0x555949[_0x7b92('0x28')]){delete _0x555949[_0x7b92('0x28')];}_0x348924[_0x7b92('0x19')](_0x41cfda)['send'](_0x555949);};}exports['index']=function(_0x54762e,_0x5237b0){var _0x380b89={},_0x427a62={},_0x30913b={'count':0x0,'rows':[]};var _0x432c7e=_[_0x7b92('0x29')](db[_0x7b92('0x2a')][_0x7b92('0x2b')],function(_0x5f0f58){return{'name':_0x5f0f58[_0x7b92('0x2c')],'type':_0x5f0f58[_0x7b92('0x2d')]['key']};});_0x427a62[_0x7b92('0x2e')]=_[_0x7b92('0x29')](_0x432c7e,'name');_0x427a62[_0x7b92('0x2f')]=_[_0x7b92('0x30')](_0x54762e['query']);_0x427a62[_0x7b92('0x31')]=_[_0x7b92('0x32')](_0x427a62[_0x7b92('0x2e')],_0x427a62[_0x7b92('0x2f')]);_0x380b89[_0x7b92('0x33')]=_[_0x7b92('0x32')](_0x427a62[_0x7b92('0x2e')],qs['fields'](_0x54762e[_0x7b92('0x2f')][_0x7b92('0x34')]));_0x380b89[_0x7b92('0x33')]=_0x380b89[_0x7b92('0x33')][_0x7b92('0x35')]?_0x380b89[_0x7b92('0x33')]:_0x427a62[_0x7b92('0x2e')];if(!_0x54762e['query'][_0x7b92('0x36')]('nolimit')){_0x380b89['limit']=qs['limit'](_0x54762e[_0x7b92('0x2f')][_0x7b92('0x1d')]);_0x380b89['offset']=qs['offset'](_0x54762e[_0x7b92('0x2f')][_0x7b92('0x1b')]);}_0x380b89['order']=qs[_0x7b92('0x37')](_0x54762e[_0x7b92('0x2f')][_0x7b92('0x37')]);_0x380b89[_0x7b92('0x38')]=qs[_0x7b92('0x31')](_[_0x7b92('0x39')](_0x54762e['query'],_0x427a62[_0x7b92('0x31')]),_0x432c7e);if(_0x54762e[_0x7b92('0x2f')][_0x7b92('0x3a')]){_0x380b89[_0x7b92('0x38')]=_[_0x7b92('0x3b')](_0x380b89[_0x7b92('0x38')],{'$or':_[_0x7b92('0x29')](_0x432c7e,function(_0x544a99){if(_0x544a99[_0x7b92('0x2d')]!=='VIRTUAL'){var _0x35d11e={};_0x35d11e[_0x544a99[_0x7b92('0x28')]]={'$like':'%'+_0x54762e[_0x7b92('0x2f')][_0x7b92('0x3a')]+'%'};return _0x35d11e;}})});}_0x380b89=_['merge']({},_0x380b89,_0x54762e['options']);var _0x586285={'where':_0x380b89[_0x7b92('0x38')]};return db[_0x7b92('0x2a')][_0x7b92('0x1e')](_0x586285)[_0x7b92('0x26')](function(_0x40cd0a){_0x30913b[_0x7b92('0x1e')]=_0x40cd0a;if(_0x54762e[_0x7b92('0x2f')][_0x7b92('0x3c')]){_0x380b89[_0x7b92('0x3d')]=[{'all':!![]}];}return db[_0x7b92('0x2a')][_0x7b92('0x3e')](_0x380b89);})[_0x7b92('0x26')](function(_0x243522){_0x30913b[_0x7b92('0x3f')]=_0x243522;return _0x30913b;})['then'](respondWithFilteredResult(_0x5237b0,_0x380b89))[_0x7b92('0x40')](handleError(_0x5237b0,null));};exports[_0x7b92('0x41')]=function(_0xb9c014,_0xd5db58){var _0x3ba182={'raw':!![],'where':{'id':_0xb9c014['params']['id']}},_0x556b2e={};_0x556b2e[_0x7b92('0x2e')]=_[_0x7b92('0x30')](db[_0x7b92('0x2a')]['rawAttributes']);_0x556b2e['query']=_['keys'](_0xb9c014['query']);_0x556b2e['filters']=_[_0x7b92('0x32')](_0x556b2e[_0x7b92('0x2e')],_0x556b2e[_0x7b92('0x2f')]);_0x3ba182[_0x7b92('0x33')]=_[_0x7b92('0x32')](_0x556b2e[_0x7b92('0x2e')],qs[_0x7b92('0x34')](_0xb9c014[_0x7b92('0x2f')][_0x7b92('0x34')]));_0x3ba182[_0x7b92('0x33')]=_0x3ba182[_0x7b92('0x33')][_0x7b92('0x35')]?_0x3ba182[_0x7b92('0x33')]:_0x556b2e[_0x7b92('0x2e')];if(_0xb9c014[_0x7b92('0x2f')][_0x7b92('0x3c')]){_0x3ba182[_0x7b92('0x3d')]=[{'all':!![]}];}_0x3ba182=_[_0x7b92('0x3b')]({},_0x3ba182,_0xb9c014[_0x7b92('0x42')]);return db[_0x7b92('0x2a')][_0x7b92('0x43')](_0x3ba182)[_0x7b92('0x26')](handleEntityNotFound(_0xd5db58,null))[_0x7b92('0x26')](respondWithResult(_0xd5db58,null))[_0x7b92('0x40')](handleError(_0xd5db58,null));};exports[_0x7b92('0x44')]=function(_0x10a9ec,_0x1079a6){return db[_0x7b92('0x2a')][_0x7b92('0x44')](_0x10a9ec[_0x7b92('0x45')],{})[_0x7b92('0x26')](respondWithResult(_0x1079a6,0xc9))[_0x7b92('0x40')](handleError(_0x1079a6,null));};exports['update']=function(_0x1071d0,_0x5e34e0){if(_0x1071d0['body']['id']){delete _0x1071d0['body']['id'];}return db[_0x7b92('0x2a')][_0x7b92('0x43')]({'where':{'id':_0x1071d0[_0x7b92('0x46')]['id']}})[_0x7b92('0x26')](handleEntityNotFound(_0x5e34e0,null))['then'](saveUpdates(_0x1071d0[_0x7b92('0x45')],null))[_0x7b92('0x26')](respondWithResult(_0x5e34e0,null))[_0x7b92('0x40')](handleError(_0x5e34e0,null));};exports[_0x7b92('0x27')]=function(_0x3f9a9a,_0x21a009){return db[_0x7b92('0x2a')]['find']({'where':{'id':_0x3f9a9a[_0x7b92('0x46')]['id']}})[_0x7b92('0x26')](handleEntityNotFound(_0x21a009,null))[_0x7b92('0x26')](removeEntity(_0x21a009,null))[_0x7b92('0x40')](handleError(_0x21a009,null));};exports[_0x7b92('0x47')]=function(_0x35265f,_0x1c51b7){return db[_0x7b92('0x2a')]['describe']()['then'](respondWithResult(_0x1c51b7,null))[_0x7b92('0x40')](handleError(_0x1c51b7,null));}; \ No newline at end of file +var _0x9c1b=['name','map','rawAttributes','type','key','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatTransferReport','include','findAll','rows','catch','show','model','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack'];(function(_0x2f23c6,_0x8eacbc){var _0x12e26a=function(_0x2b2b4b){while(--_0x2b2b4b){_0x2f23c6['push'](_0x2f23c6['shift']());}};_0x12e26a(++_0x8eacbc);}(_0x9c1b,0x68));var _0xb9c1=function(_0x20b8b6,_0x29a14c){_0x20b8b6=_0x20b8b6-0x0;var _0x22c341=_0x9c1b[_0x20b8b6];return _0x22c341;};'use strict';var emlformat=require(_0xb9c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9c1('0x1'));var jsonpatch=require(_0xb9c1('0x2'));var rp=require('request-promise');var moment=require(_0xb9c1('0x3'));var BPromise=require(_0xb9c1('0x4'));var Mustache=require('mustache');var util=require(_0xb9c1('0x5'));var path=require(_0xb9c1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb9c1('0x7'));var fs=require('fs');var fs_extra=require(_0xb9c1('0x8'));var _=require('lodash');var squel=require(_0xb9c1('0x9'));var crypto=require(_0xb9c1('0xa'));var jsforce=require(_0xb9c1('0xb'));var deskjs=require(_0xb9c1('0xc'));var toCsv=require(_0xb9c1('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb9c1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb9c1('0xf'));var as=require(_0xb9c1('0x10'));var hardwareService=require(_0xb9c1('0x11'));var logger=require(_0xb9c1('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb9c1('0x13'));var db=require(_0xb9c1('0x14'))['db'];function respondWithStatusCode(_0x3593bb,_0x53a29a){_0x53a29a=_0x53a29a||0xcc;return function(_0x4cc3ef){if(_0x4cc3ef){return _0x3593bb[_0xb9c1('0x15')](_0x53a29a);}return _0x3593bb['status'](_0x53a29a)['end']();};}function respondWithResult(_0x32f584,_0x29e868){_0x29e868=_0x29e868||0xc8;return function(_0x1e1c59){if(_0x1e1c59){return _0x32f584[_0xb9c1('0x16')](_0x29e868)['json'](_0x1e1c59);}};}function respondWithFilteredResult(_0x541e04,_0x508a66){return function(_0x383d0f){if(_0x383d0f){var _0x42a6e3=typeof _0x508a66['offset']==='undefined'&&typeof _0x508a66[_0xb9c1('0x17')]==='undefined';var _0x34a008=_0x383d0f[_0xb9c1('0x18')];var _0x4ec4cf=_0x42a6e3?0x0:_0x508a66['offset'];var _0x68e768=_0x42a6e3?_0x383d0f[_0xb9c1('0x18')]:_0x508a66[_0xb9c1('0x19')]+_0x508a66[_0xb9c1('0x17')];var _0x4953d3;if(_0x68e768>=_0x34a008){_0x68e768=_0x34a008;_0x4953d3=0xc8;}else{_0x4953d3=0xce;}_0x541e04[_0xb9c1('0x16')](_0x4953d3);return _0x541e04[_0xb9c1('0x1a')](_0xb9c1('0x1b'),_0x4ec4cf+'-'+_0x68e768+'/'+_0x34a008)[_0xb9c1('0x1c')](_0x383d0f);}return null;};}function patchUpdates(_0x1a6ccd){return function(_0x10b172){try{jsonpatch[_0xb9c1('0x1d')](_0x10b172,_0x1a6ccd,!![]);}catch(_0x1e6655){return BPromise[_0xb9c1('0x1e')](_0x1e6655);}return _0x10b172[_0xb9c1('0x1f')]();};}function saveUpdates(_0xcef375,_0x13f2ef){return function(_0x58918c){if(_0x58918c){return _0x58918c[_0xb9c1('0x20')](_0xcef375)[_0xb9c1('0x21')](function(_0x396c8e){return _0x396c8e;});}return null;};}function removeEntity(_0x2b9064,_0x3d5548){return function(_0x2efb25){if(_0x2efb25){return _0x2efb25[_0xb9c1('0x22')]()[_0xb9c1('0x21')](function(){_0x2b9064[_0xb9c1('0x16')](0xcc)[_0xb9c1('0x23')]();});}};}function handleEntityNotFound(_0x6dcc0a,_0x4231dd){return function(_0x3bdc8c){if(!_0x3bdc8c){_0x6dcc0a[_0xb9c1('0x15')](0x194);}return _0x3bdc8c;};}function handleError(_0x479e7c,_0x4cd8d5){_0x4cd8d5=_0x4cd8d5||0x1f4;return function(_0xbd56d6){logger[_0xb9c1('0x24')](_0xbd56d6[_0xb9c1('0x25')]);if(_0xbd56d6[_0xb9c1('0x26')]){delete _0xbd56d6[_0xb9c1('0x26')];}_0x479e7c['status'](_0x4cd8d5)['send'](_0xbd56d6);};}exports['index']=function(_0x2f5fed,_0x1b06c4){var _0x4dfcf1={},_0x12baed={},_0x3eea8f={'count':0x0,'rows':[]};var _0x445d07=_[_0xb9c1('0x27')](db['ChatTransferReport'][_0xb9c1('0x28')],function(_0x3cdf53){return{'name':_0x3cdf53['fieldName'],'type':_0x3cdf53[_0xb9c1('0x29')][_0xb9c1('0x2a')]};});_0x12baed['model']=_[_0xb9c1('0x27')](_0x445d07,'name');_0x12baed[_0xb9c1('0x2b')]=_[_0xb9c1('0x2c')](_0x2f5fed[_0xb9c1('0x2b')]);_0x12baed[_0xb9c1('0x2d')]=_['intersection'](_0x12baed['model'],_0x12baed[_0xb9c1('0x2b')]);_0x4dfcf1[_0xb9c1('0x2e')]=_[_0xb9c1('0x2f')](_0x12baed['model'],qs[_0xb9c1('0x30')](_0x2f5fed[_0xb9c1('0x2b')]['fields']));_0x4dfcf1[_0xb9c1('0x2e')]=_0x4dfcf1[_0xb9c1('0x2e')]['length']?_0x4dfcf1[_0xb9c1('0x2e')]:_0x12baed['model'];if(!_0x2f5fed[_0xb9c1('0x2b')][_0xb9c1('0x31')](_0xb9c1('0x32'))){_0x4dfcf1[_0xb9c1('0x17')]=qs[_0xb9c1('0x17')](_0x2f5fed[_0xb9c1('0x2b')][_0xb9c1('0x17')]);_0x4dfcf1[_0xb9c1('0x19')]=qs[_0xb9c1('0x19')](_0x2f5fed['query'][_0xb9c1('0x19')]);}_0x4dfcf1[_0xb9c1('0x33')]=qs[_0xb9c1('0x34')](_0x2f5fed[_0xb9c1('0x2b')]['sort']);_0x4dfcf1[_0xb9c1('0x35')]=qs[_0xb9c1('0x2d')](_['pick'](_0x2f5fed[_0xb9c1('0x2b')],_0x12baed[_0xb9c1('0x2d')]),_0x445d07);if(_0x2f5fed[_0xb9c1('0x2b')][_0xb9c1('0x36')]){_0x4dfcf1[_0xb9c1('0x35')]=_[_0xb9c1('0x37')](_0x4dfcf1[_0xb9c1('0x35')],{'$or':_[_0xb9c1('0x27')](_0x445d07,function(_0x3592af){if(_0x3592af['type']!==_0xb9c1('0x38')){var _0x544487={};_0x544487[_0x3592af[_0xb9c1('0x26')]]={'$like':'%'+_0x2f5fed[_0xb9c1('0x2b')][_0xb9c1('0x36')]+'%'};return _0x544487;}})});}_0x4dfcf1=_[_0xb9c1('0x37')]({},_0x4dfcf1,_0x2f5fed[_0xb9c1('0x39')]);var _0x5c157a={'where':_0x4dfcf1[_0xb9c1('0x35')]};return db[_0xb9c1('0x3a')][_0xb9c1('0x18')](_0x5c157a)['then'](function(_0x832dc0){_0x3eea8f['count']=_0x832dc0;if(_0x2f5fed['query']['includeAll']){_0x4dfcf1[_0xb9c1('0x3b')]=[{'all':!![]}];}return db[_0xb9c1('0x3a')][_0xb9c1('0x3c')](_0x4dfcf1);})[_0xb9c1('0x21')](function(_0x246f80){_0x3eea8f[_0xb9c1('0x3d')]=_0x246f80;return _0x3eea8f;})[_0xb9c1('0x21')](respondWithFilteredResult(_0x1b06c4,_0x4dfcf1))[_0xb9c1('0x3e')](handleError(_0x1b06c4,null));};exports[_0xb9c1('0x3f')]=function(_0x56ab15,_0x16fc10){var _0x362692={'raw':!![],'where':{'id':_0x56ab15['params']['id']}},_0x1565d9={};_0x1565d9[_0xb9c1('0x40')]=_[_0xb9c1('0x2c')](db[_0xb9c1('0x3a')]['rawAttributes']);_0x1565d9[_0xb9c1('0x2b')]=_[_0xb9c1('0x2c')](_0x56ab15['query']);_0x1565d9[_0xb9c1('0x2d')]=_[_0xb9c1('0x2f')](_0x1565d9[_0xb9c1('0x40')],_0x1565d9[_0xb9c1('0x2b')]);_0x362692[_0xb9c1('0x2e')]=_[_0xb9c1('0x2f')](_0x1565d9[_0xb9c1('0x40')],qs[_0xb9c1('0x30')](_0x56ab15['query'][_0xb9c1('0x30')]));_0x362692[_0xb9c1('0x2e')]=_0x362692['attributes'][_0xb9c1('0x41')]?_0x362692[_0xb9c1('0x2e')]:_0x1565d9[_0xb9c1('0x40')];if(_0x56ab15[_0xb9c1('0x2b')]['includeAll']){_0x362692[_0xb9c1('0x3b')]=[{'all':!![]}];}_0x362692=_[_0xb9c1('0x37')]({},_0x362692,_0x56ab15['options']);return db['ChatTransferReport'][_0xb9c1('0x42')](_0x362692)[_0xb9c1('0x21')](handleEntityNotFound(_0x16fc10,null))[_0xb9c1('0x21')](respondWithResult(_0x16fc10,null))[_0xb9c1('0x3e')](handleError(_0x16fc10,null));};exports[_0xb9c1('0x43')]=function(_0x2aa4b9,_0x2ac9a8){return db[_0xb9c1('0x3a')][_0xb9c1('0x43')](_0x2aa4b9[_0xb9c1('0x44')],{})['then'](respondWithResult(_0x2ac9a8,0xc9))[_0xb9c1('0x3e')](handleError(_0x2ac9a8,null));};exports[_0xb9c1('0x20')]=function(_0x381ea1,_0x1cb057){if(_0x381ea1[_0xb9c1('0x44')]['id']){delete _0x381ea1[_0xb9c1('0x44')]['id'];}return db[_0xb9c1('0x3a')][_0xb9c1('0x42')]({'where':{'id':_0x381ea1['params']['id']}})[_0xb9c1('0x21')](handleEntityNotFound(_0x1cb057,null))[_0xb9c1('0x21')](saveUpdates(_0x381ea1[_0xb9c1('0x44')],null))['then'](respondWithResult(_0x1cb057,null))['catch'](handleError(_0x1cb057,null));};exports[_0xb9c1('0x22')]=function(_0x10511f,_0x5c4918){return db[_0xb9c1('0x3a')][_0xb9c1('0x42')]({'where':{'id':_0x10511f[_0xb9c1('0x45')]['id']}})[_0xb9c1('0x21')](handleEntityNotFound(_0x5c4918,null))[_0xb9c1('0x21')](removeEntity(_0x5c4918,null))[_0xb9c1('0x3e')](handleError(_0x5c4918,null));};exports[_0xb9c1('0x46')]=function(_0x2f98ff,_0x449edc){return db[_0xb9c1('0x3a')][_0xb9c1('0x46')]()[_0xb9c1('0x21')](respondWithResult(_0x449edc,null))['catch'](handleError(_0x449edc,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 727bbb6..250daf5 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 _0x0f39=['../../config/environment','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4d6991,_0x522735){var _0x3d3512=function(_0x80a813){while(--_0x80a813){_0x4d6991['push'](_0x4d6991['shift']());}};_0x3d3512(++_0x522735);}(_0x0f39,0x149));var _0x90f3=function(_0x592dfc,_0x1a4ff2){_0x592dfc=_0x592dfc-0x0;var _0xc5ae99=_0x0f39[_0x592dfc];return _0xc5ae99;};'use strict';var _=require(_0x90f3('0x0'));var util=require(_0x90f3('0x1'));var logger=require(_0x90f3('0x2'))(_0x90f3('0x3'));var moment=require(_0x90f3('0x4'));var BPromise=require(_0x90f3('0x5'));var rp=require(_0x90f3('0x6'));var fs=require('fs');var path=require(_0x90f3('0x7'));var rimraf=require(_0x90f3('0x8'));var config=require(_0x90f3('0x9'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x4967e7,_0x19991c){return _0x4967e7[_0x90f3('0xa')]('ChatTransferReport',attributes,{'tableName':_0x90f3('0xb'),'paranoid':![],'indexes':[{'name':_0x90f3('0xc'),'fields':[_0x90f3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x75b8=['api','moment','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x399647,_0x154a5e){var _0x3f66a8=function(_0x4cd16b){while(--_0x4cd16b){_0x399647['push'](_0x399647['shift']());}};_0x3f66a8(++_0x154a5e);}(_0x75b8,0x8d));var _0x875b=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0x75b8[_0x152449];return _0x5b58b2;};'use strict';var _=require(_0x875b('0x0'));var util=require(_0x875b('0x1'));var logger=require('../../config/logger')(_0x875b('0x2'));var moment=require(_0x875b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x875b('0x4'));var rimraf=require('rimraf');var config=require(_0x875b('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x875b('0x6')]=function(_0x160da6,_0x728b0b){return _0x160da6[_0x875b('0x7')](_0x875b('0x8'),attributes,{'tableName':_0x875b('0x9'),'paranoid':![],'indexes':[{'name':_0x875b('0xa'),'fields':[_0x875b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ceec6f2..d7cfbd4 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 _0x22ee=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2a0859,_0x5097c5){var _0x296478=function(_0x21010a){while(--_0x21010a){_0x2a0859['push'](_0x2a0859['shift']());}};_0x296478(++_0x5097c5);}(_0x22ee,0x127));var _0xe22e=function(_0x45f453,_0x5e1232){_0x45f453=_0x45f453-0x0;var _0x728b61=_0x22ee[_0x45f453];return _0x728b61;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe22e('0x0'));var rs=require(_0xe22e('0x1'));var fs=require('fs');var Redis=require(_0xe22e('0x2'));var db=require(_0xe22e('0x3'))['db'];var utils=require(_0xe22e('0x4'));var logger=require(_0xe22e('0x5'))(_0xe22e('0x6'));var config=require(_0xe22e('0x7'));var jayson=require(_0xe22e('0x8'));var client=jayson['client'][_0xe22e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b77d7,_0x438638,_0x424118){return new BPromise(function(_0x5c455f,_0x28468c){return client[_0xe22e('0xa')](_0x9b77d7,_0x424118)[_0xe22e('0xb')](function(_0x1daaee){logger[_0xe22e('0xc')](_0xe22e('0xd'),_0x438638,_0xe22e('0xe'));logger[_0xe22e('0xf')](_0xe22e('0x10'),_0x438638,_0xe22e('0xe'),JSON['stringify'](_0x1daaee));if(_0x1daaee[_0xe22e('0x11')]){if(_0x1daaee[_0xe22e('0x11')][_0xe22e('0x12')]===0x1f4){logger[_0xe22e('0x11')](_0xe22e('0xd'),_0x438638,_0x1daaee['error'][_0xe22e('0x13')]);return _0x28468c(_0x1daaee['error'][_0xe22e('0x13')]);}logger[_0xe22e('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x438638,_0x1daaee['error'][_0xe22e('0x13')]);return _0x5c455f(_0x1daaee[_0xe22e('0x11')][_0xe22e('0x13')]);}else{logger['info'](_0xe22e('0xd'),_0x438638,_0xe22e('0xe'));_0x5c455f(_0x1daaee[_0xe22e('0x14')][_0xe22e('0x13')]);}})[_0xe22e('0x15')](function(_0x1947d2){logger[_0xe22e('0x11')](_0xe22e('0xd'),_0x438638,_0x1947d2);_0x28468c(_0x1947d2);});});} \ No newline at end of file +var _0x5366=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird'];(function(_0x48d191,_0x3cb2a0){var _0x5a9cfa=function(_0x5519be){while(--_0x5519be){_0x48d191['push'](_0x48d191['shift']());}};_0x5a9cfa(++_0x3cb2a0);}(_0x5366,0x18d));var _0x6536=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x5366[_0x6a0266];return _0x309e00;};'use strict';var _=require(_0x6536('0x0'));var util=require(_0x6536('0x1'));var moment=require('moment');var BPromise=require(_0x6536('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6536('0x3'));var db=require(_0x6536('0x4'))['db'];var utils=require(_0x6536('0x5'));var logger=require(_0x6536('0x6'))(_0x6536('0x7'));var config=require(_0x6536('0x8'));var jayson=require(_0x6536('0x9'));var client=jayson['client'][_0x6536('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a56d0,_0x557ee7,_0x29346f){return new BPromise(function(_0x5b3647,_0x2ea2cf){return client['request'](_0x4a56d0,_0x29346f)[_0x6536('0xb')](function(_0x5b750f){logger[_0x6536('0xc')](_0x6536('0xd'),_0x557ee7,_0x6536('0xe'));logger['debug'](_0x6536('0xf'),_0x557ee7,_0x6536('0xe'),JSON[_0x6536('0x10')](_0x5b750f));if(_0x5b750f['error']){if(_0x5b750f[_0x6536('0x11')][_0x6536('0x12')]===0x1f4){logger[_0x6536('0x11')](_0x6536('0xd'),_0x557ee7,_0x5b750f[_0x6536('0x11')][_0x6536('0x13')]);return _0x2ea2cf(_0x5b750f['error']['message']);}logger[_0x6536('0x11')](_0x6536('0xd'),_0x557ee7,_0x5b750f[_0x6536('0x11')][_0x6536('0x13')]);return _0x5b3647(_0x5b750f[_0x6536('0x11')]['message']);}else{logger[_0x6536('0xc')](_0x6536('0xd'),_0x557ee7,'request\x20sent');_0x5b3647(_0x5b750f['result']['message']);}})['catch'](function(_0xf2f4f7){logger['error'](_0x6536('0xd'),_0x557ee7,_0xf2f4f7);_0x2ea2cf(_0xf2f4f7);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 1af3c9a..8419120 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 _0xbb42=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xbb42,0x80));var _0x2bb4=function(_0xecde07,_0x14c513){_0xecde07=_0xecde07-0x0;var _0x5b6b92=_0xbb42[_0xecde07];return _0x5b6b92;};'use strict';var multer=require(_0x2bb4('0x0'));var util=require(_0x2bb4('0x1'));var path=require(_0x2bb4('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bb4('0x3'));var router=express[_0x2bb4('0x4')]();var fs_extra=require(_0x2bb4('0x5'));var auth=require(_0x2bb4('0x6'));var interaction=require(_0x2bb4('0x7'));var config=require(_0x2bb4('0x8'));var controller=require(_0x2bb4('0x9'));router[_0x2bb4('0xa')]('/',auth[_0x2bb4('0xb')](),controller[_0x2bb4('0xc')]);router[_0x2bb4('0xa')](_0x2bb4('0xd'),auth[_0x2bb4('0xb')](),controller[_0x2bb4('0xe')]);router[_0x2bb4('0xa')](_0x2bb4('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2bb4('0x10')]('/',auth['isAuthenticated'](),controller[_0x2bb4('0x11')]);router[_0x2bb4('0x12')](_0x2bb4('0xf'),auth[_0x2bb4('0xb')](),controller['update']);router[_0x2bb4('0x13')](_0x2bb4('0xf'),auth[_0x2bb4('0xb')](),controller[_0x2bb4('0x14')]);module['exports']=router; \ No newline at end of file +var _0x262e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','multer','path'];(function(_0x37c525,_0x18aeb1){var _0xc52249=function(_0x17196e){while(--_0x17196e){_0x37c525['push'](_0x37c525['shift']());}};_0xc52249(++_0x18aeb1);}(_0x262e,0x1f2));var _0xe262=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x262e[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xe262('0x0'));var util=require('util');var path=require(_0xe262('0x1'));var timeout=require(_0xe262('0x2'));var express=require(_0xe262('0x3'));var router=express[_0xe262('0x4')]();var fs_extra=require(_0xe262('0x5'));var auth=require(_0xe262('0x6'));var interaction=require(_0xe262('0x7'));var config=require(_0xe262('0x8'));var controller=require('./chatTransferReport.controller');router[_0xe262('0x9')]('/',auth[_0xe262('0xa')](),controller['index']);router[_0xe262('0x9')](_0xe262('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe262('0x9')](_0xe262('0xc'),auth[_0xe262('0xa')](),controller[_0xe262('0xd')]);router[_0xe262('0xe')]('/',auth[_0xe262('0xa')](),controller[_0xe262('0xf')]);router[_0xe262('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe262('0x11')]);router[_0xe262('0x12')](_0xe262('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe262('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index c502304..7d88c75 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 _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(_0x584f56,_0x55614c){var _0x16d1f5=function(_0x4b7b04){while(--_0x4b7b04){_0x584f56['push'](_0x584f56['shift']());}};_0x16d1f5(++_0x55614c);}(_0x41bb,0xc5));var _0xb41b=function(_0x4dca8e,_0x3daae9){_0x4dca8e=_0x4dca8e-0x0;var _0x111112=_0x41bb[_0x4dca8e];return _0x111112;};'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 +var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x56568a,_0x25efcb){var _0x3eeb13=function(_0x2b6123){while(--_0x2b6123){_0x56568a['push'](_0x56568a['shift']());}};_0x3eeb13(++_0x25efcb);}(_0x55e0,0xdc));var _0x055e=function(_0x3eaae1,_0x1d200e){_0x3eaae1=_0x3eaae1-0x0;var _0x46bf2a=_0x55e0[_0x3eaae1];return _0x46bf2a;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index cb26123..6b3b196 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 _0x0294=['User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','Intervals','all','utf8','URL','address','origin','3.1.0','remote','connection','remoteAddress','virtual','replace','alignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/environment','url','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','include','rows','catch','params','Pause','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','getDispositions','Disposition','hasOwnProperty','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','UserId'];(function(_0x676435,_0x5605cd){var _0x36f23c=function(_0x172759){while(--_0x172759){_0x676435['push'](_0x676435['shift']());}};_0x36f23c(++_0x5605cd);}(_0x0294,0x19b));var _0x4029=function(_0x5bdf55,_0x39ff3e){_0x5bdf55=_0x5bdf55-0x0;var _0x4c15c7=_0x0294[_0x5bdf55];return _0x4c15c7;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x4029('0x0'));var util=require(_0x4029('0x1'));var path=require(_0x4029('0x2'));var ejs=require(_0x4029('0x3'));var fs=require('fs');var fs_extra=require(_0x4029('0x4'));var _=require(_0x4029('0x5'));var querystring=require('querystring');var Redis=require(_0x4029('0x6'));var qs=require(_0x4029('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x4029('0x8'));var url=require(_0x4029('0x9'));var db=require('../../mysqldb')['db'];config[_0x4029('0xa')]=_['defaults'](config[_0x4029('0xa')],{'host':_0x4029('0xb'),'port':0x18eb});var socket=require(_0x4029('0xc'))(new Redis(config[_0x4029('0xa')]));require(_0x4029('0xd'))[_0x4029('0xe')](socket);var htmlToText=require(_0x4029('0xf'));var jayson=require(_0x4029('0x10'));var client=jayson[_0x4029('0x11')][_0x4029('0x12')]({'port':0x232c});var client9002=jayson[_0x4029('0x11')][_0x4029('0x12')]({'port':0x232a});var client9003=jayson[_0x4029('0x11')][_0x4029('0x12')]({'port':0x232b});var client9001=jayson[_0x4029('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1eb4a1,_0x151751,_0x1a0bc2,_0xc1cf41){return new BPromise(function(_0x11333b,_0x13b3a0){var _0x348c92=_0xc1cf41||client;return _0x348c92[_0x4029('0x13')](_0x1eb4a1,_0x1a0bc2)[_0x4029('0x14')](function(_0x301de0){logger[_0x4029('0x15')](_0x4029('0x16'),_0x151751,_0x4029('0x17'));logger[_0x4029('0x18')](_0x4029('0x19'),_0x151751,_0x4029('0x17'),JSON['stringify'](_0x301de0));if(_0x301de0[_0x4029('0x1a')]){if(_0x301de0[_0x4029('0x1a')][_0x4029('0x1b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x151751,_0x301de0[_0x4029('0x1a')]['message']);return _0x13b3a0(_0x301de0[_0x4029('0x1a')][_0x4029('0x1c')]);}logger[_0x4029('0x1a')](_0x4029('0x16'),_0x151751,_0x301de0[_0x4029('0x1a')][_0x4029('0x1c')]);return _0x11333b(_0x301de0[_0x4029('0x1a')][_0x4029('0x1c')]);}else{logger[_0x4029('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x151751,_0x4029('0x17'));_0x11333b(_0x301de0[_0x4029('0x1d')]['message']);}})['catch'](function(_0x6df63b){logger[_0x4029('0x1a')](_0x4029('0x16'),_0x151751,_0x6df63b);_0x13b3a0(_0x6df63b);});});}function respondWithStatusCode(_0x30fc81,_0x38c83c){_0x38c83c=_0x38c83c||0xcc;return function(_0x51e42){if(_0x51e42){return _0x30fc81[_0x4029('0x1e')](_0x38c83c);}return _0x30fc81[_0x4029('0x1f')](_0x38c83c)['end']();};}function respondWithResult(_0x50def5,_0x4ed382){_0x4ed382=_0x4ed382||0xc8;return function(_0x15e737){if(_0x15e737){return _0x50def5[_0x4029('0x1f')](_0x4ed382)[_0x4029('0x20')](_0x15e737);}};}function respondWithFilteredResult(_0x4e7e6f,_0x1b0829){return function(_0x37dea8){if(_0x37dea8){var _0x22a3be=typeof _0x1b0829[_0x4029('0x21')]===_0x4029('0x22')&&typeof _0x1b0829[_0x4029('0x23')]==='undefined';var _0x5b63ca=_0x37dea8[_0x4029('0x24')];var _0x1c7d75=_0x22a3be?0x0:_0x1b0829[_0x4029('0x21')];var _0x39e649=_0x22a3be?_0x37dea8[_0x4029('0x24')]:_0x1b0829['offset']+_0x1b0829[_0x4029('0x23')];var _0x429afd;if(_0x39e649>=_0x5b63ca){_0x39e649=_0x5b63ca;_0x429afd=0xc8;}else{_0x429afd=0xce;}_0x4e7e6f[_0x4029('0x1f')](_0x429afd);return _0x4e7e6f['set'](_0x4029('0x25'),_0x1c7d75+'-'+_0x39e649+'/'+_0x5b63ca)[_0x4029('0x20')](_0x37dea8);}return null;};}function saveUpdates(_0x2dc921){return function(_0x5152df){if(_0x5152df){return _0x5152df[_0x4029('0x26')](_0x2dc921)[_0x4029('0x14')](function(_0x45c5c0){return _0x45c5c0;});}return null;};}function removeEntity(_0x53187e){return function(_0x176274){if(_0x176274){return _0x176274[_0x4029('0x27')]()[_0x4029('0x14')](function(){var _0x3e8f82=_0x176274[_0x4029('0x28')]({'plain':!![]});var _0xd19d2b=_0x4029('0x29');return db[_0x4029('0x2a')][_0x4029('0x27')]({'where':{'type':_0xd19d2b,'resourceId':_0x3e8f82['id']}})['then'](function(){return _0x176274;});})['then'](function(){_0x53187e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc5cb){return function(_0x3ea492){if(!_0x3ea492){_0x2bc5cb[_0x4029('0x1e')](0x194);}return _0x3ea492;};}function handleError(_0x271291,_0x382e0a){_0x382e0a=_0x382e0a||0x1f4;return function(_0x410589){logger['error'](_0x410589[_0x4029('0x2b')]);if(_0x410589[_0x4029('0x2c')]){delete _0x410589[_0x4029('0x2c')];}_0x271291['status'](_0x382e0a)[_0x4029('0x2d')](_0x410589);};}exports['index']=function(_0x451bc7,_0x2837a7){var _0x33545a={'include':[{'model':db['Pause'],'as':_0x4029('0x2e')}]},_0x44ac63={},_0xeb32b={'count':0x0,'rows':[]};var _0x323545=_['map'](db[_0x4029('0x2f')][_0x4029('0x30')],function(_0x1f7f99){return{'name':_0x1f7f99['fieldName'],'type':_0x1f7f99[_0x4029('0x31')][_0x4029('0x32')]};});_0x44ac63[_0x4029('0x33')]=_['map'](_0x323545,_0x4029('0x2c'));_0x44ac63[_0x4029('0x34')]=_['keys'](_0x451bc7[_0x4029('0x34')]);_0x44ac63[_0x4029('0x35')]=_[_0x4029('0x36')](_0x44ac63[_0x4029('0x33')],_0x44ac63[_0x4029('0x34')]);_0x33545a[_0x4029('0x37')]=_[_0x4029('0x36')](_0x44ac63[_0x4029('0x33')],qs['fields'](_0x451bc7[_0x4029('0x34')][_0x4029('0x38')]));_0x33545a['attributes']=_0x33545a['attributes'][_0x4029('0x39')]?_0x33545a[_0x4029('0x37')]:_0x44ac63[_0x4029('0x33')];if(!_0x451bc7[_0x4029('0x34')]['hasOwnProperty'](_0x4029('0x3a'))){_0x33545a['limit']=qs[_0x4029('0x23')](_0x451bc7['query']['limit']);_0x33545a[_0x4029('0x21')]=qs[_0x4029('0x21')](_0x451bc7['query'][_0x4029('0x21')]);}_0x33545a[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x451bc7['query'][_0x4029('0x3c')]);_0x33545a['where']=qs[_0x4029('0x35')](_[_0x4029('0x3d')](_0x451bc7[_0x4029('0x34')],_0x44ac63[_0x4029('0x35')]),_0x323545);if(_0x451bc7[_0x4029('0x34')][_0x4029('0x3e')]){_0x33545a[_0x4029('0x3f')]=_[_0x4029('0x40')](_0x33545a['where'],{'$or':_[_0x4029('0x41')](_0x323545,function(_0x2b54b8){if(_0x2b54b8['type']!==_0x4029('0x42')){var _0x419d9c={};_0x419d9c[_0x2b54b8[_0x4029('0x2c')]]={'$like':'%'+_0x451bc7[_0x4029('0x34')]['filter']+'%'};return _0x419d9c;}})});}_0x33545a=_['merge']({},_0x33545a,_0x451bc7[_0x4029('0x43')]);var _0xe515e2={'where':_0x33545a['where']};return db[_0x4029('0x2f')][_0x4029('0x24')](_0xe515e2)[_0x4029('0x14')](function(_0x58a4f4){_0xeb32b[_0x4029('0x24')]=_0x58a4f4;if(_0x451bc7['query']['includeAll']){_0x33545a[_0x4029('0x44')]=[{'all':!![]}];}return db[_0x4029('0x2f')]['findAll'](_0x33545a);})[_0x4029('0x14')](function(_0x2ea869){_0xeb32b[_0x4029('0x45')]=_0x2ea869;return _0xeb32b;})[_0x4029('0x14')](respondWithFilteredResult(_0x2837a7,_0x33545a))[_0x4029('0x46')](handleError(_0x2837a7,null));};exports['show']=function(_0x5b777e,_0x9e5fd0){var _0x4e148e={'raw':![],'where':{'id':_0x5b777e[_0x4029('0x47')]['id']},'include':[{'model':db[_0x4029('0x48')],'as':_0x4029('0x2e')}]},_0x12af90={};_0x12af90[_0x4029('0x33')]=_[_0x4029('0x49')](db[_0x4029('0x2f')][_0x4029('0x30')]);_0x12af90[_0x4029('0x34')]=_['keys'](_0x5b777e['query']);_0x12af90['filters']=_[_0x4029('0x36')](_0x12af90[_0x4029('0x33')],_0x12af90[_0x4029('0x34')]);_0x4e148e[_0x4029('0x37')]=_[_0x4029('0x36')](_0x12af90[_0x4029('0x33')],qs['fields'](_0x5b777e[_0x4029('0x34')][_0x4029('0x38')]));_0x4e148e[_0x4029('0x37')]=_0x4e148e['attributes'][_0x4029('0x39')]?_0x4e148e[_0x4029('0x37')]:_0x12af90['model'];if(_0x5b777e['query']['includeAll']){_0x4e148e['include']=[{'all':!![]}];}_0x4e148e=_[_0x4029('0x40')]({},_0x4e148e,_0x5b777e[_0x4029('0x43')]);return db[_0x4029('0x2f')][_0x4029('0x4a')](_0x4e148e)[_0x4029('0x14')](handleEntityNotFound(_0x9e5fd0,null))['then'](respondWithResult(_0x9e5fd0,null))[_0x4029('0x46')](handleError(_0x9e5fd0,null));};exports[_0x4029('0x4b')]=function(_0x5d2c25,_0x1d3e10){return db['ChatWebsite'][_0x4029('0x4b')](_0x5d2c25['body'],{})[_0x4029('0x14')](function(_0x29c2c4){var _0x972032=_0x5d2c25['user'][_0x4029('0x28')]({'plain':!![]});if(!_0x972032)throw new Error(_0x4029('0x4c'));if(_0x972032['role']==='user'){var _0x920191=_0x29c2c4[_0x4029('0x28')]({'plain':!![]});var _0x4d47f5='ChatWebsites';return db['UserProfileSection'][_0x4029('0x4a')]({'where':{'name':_0x4d47f5,'userProfileId':_0x972032[_0x4029('0x4d')]},'raw':!![]})[_0x4029('0x14')](function(_0x31cff7){if(_0x31cff7&&_0x31cff7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x920191[_0x4029('0x2c')],'resourceId':_0x920191['id'],'type':_0x31cff7[_0x4029('0x2c')],'sectionId':_0x31cff7['id']},{})[_0x4029('0x14')](function(){return _0x29c2c4;});}else{return _0x29c2c4;}})[_0x4029('0x46')](function(_0x31e4d6){logger[_0x4029('0x1a')](_0x4029('0x4e'),_0x31e4d6);throw _0x31e4d6;});}return _0x29c2c4;})[_0x4029('0x14')](respondWithResult(_0x1d3e10,0xc9))[_0x4029('0x46')](handleError(_0x1d3e10,null));};exports[_0x4029('0x26')]=function(_0x464cd6,_0x2e7865){if(_0x464cd6[_0x4029('0x4f')]['id']){delete _0x464cd6[_0x4029('0x4f')]['id'];}return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x464cd6[_0x4029('0x47')]['id']},'include':[{'model':db[_0x4029('0x48')],'as':'mandatoryDispositionPause'}]})[_0x4029('0x14')](handleEntityNotFound(_0x2e7865,null))[_0x4029('0x14')](saveUpdates(_0x464cd6[_0x4029('0x4f')],null))[_0x4029('0x14')](respondWithResult(_0x2e7865,null))[_0x4029('0x46')](handleError(_0x2e7865,null));};exports[_0x4029('0x27')]=function(_0x5ad754,_0x498040){return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x5ad754[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x498040,null))[_0x4029('0x14')](removeEntity(_0x498040,null))[_0x4029('0x46')](handleError(_0x498040,null));};exports[_0x4029('0x50')]=function(_0x286b86,_0x1230f4){return db[_0x4029('0x2f')][_0x4029('0x50')]()['then'](respondWithResult(_0x1230f4,null))[_0x4029('0x46')](handleError(_0x1230f4,null));};exports['addDisposition']=function(_0x2a23ab,_0x50903c){if(_0x2a23ab['body']['id']){delete _0x2a23ab['body']['id'];}return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x2a23ab[_0x4029('0x47')]['id']}})['then'](handleEntityNotFound(_0x50903c,null))[_0x4029('0x14')](function(_0x529aab){if(_0x529aab){_0x2a23ab[_0x4029('0x4f')][_0x4029('0x51')]=_0x529aab['id'];return db['Disposition'][_0x4029('0x4b')](_0x2a23ab['body']);}})['then'](respondWithResult(_0x50903c,null))[_0x4029('0x46')](handleError(_0x50903c,null));};exports[_0x4029('0x52')]=function(_0x10d97d,_0x1a5fa5){var _0x3ce921={'raw':![],'where':{}};var _0xe5bddd={};var _0x5e3f7d={'count':0x0,'rows':[]};return db[_0x4029('0x2f')]['findOne']({'where':{'id':_0x10d97d['params']['id']}})['then'](handleEntityNotFound(_0x1a5fa5,null))[_0x4029('0x14')](function(_0x187a5b){if(_0x187a5b){_0xe5bddd[_0x4029('0x33')]=_[_0x4029('0x49')](db[_0x4029('0x53')][_0x4029('0x30')]);_0xe5bddd[_0x4029('0x34')]=_[_0x4029('0x49')](_0x10d97d[_0x4029('0x34')]);_0xe5bddd['filters']=_[_0x4029('0x36')](_0xe5bddd[_0x4029('0x33')],_0xe5bddd[_0x4029('0x34')]);_0x3ce921[_0x4029('0x37')]=_[_0x4029('0x36')](_0xe5bddd[_0x4029('0x33')],qs[_0x4029('0x38')](_0x10d97d[_0x4029('0x34')][_0x4029('0x38')]));_0x3ce921[_0x4029('0x37')]=_0x3ce921['attributes'][_0x4029('0x39')]?_0x3ce921[_0x4029('0x37')]:_0xe5bddd[_0x4029('0x33')];if(!_0x10d97d[_0x4029('0x34')][_0x4029('0x54')](_0x4029('0x3a'))){_0x3ce921[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x10d97d[_0x4029('0x34')][_0x4029('0x23')]);_0x3ce921[_0x4029('0x21')]=qs[_0x4029('0x21')](_0x10d97d[_0x4029('0x34')][_0x4029('0x21')]);}_0x3ce921[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x10d97d[_0x4029('0x34')][_0x4029('0x3c')]);_0x3ce921[_0x4029('0x3f')]=qs[_0x4029('0x35')](_[_0x4029('0x3d')](_0x10d97d['query'],_0xe5bddd['filters']));_0x3ce921[_0x4029('0x3f')][_0x4029('0x51')]=_0x187a5b['id'];if(_0x10d97d[_0x4029('0x34')][_0x4029('0x3e')]){_0x3ce921[_0x4029('0x3f')]=_[_0x4029('0x40')](_0x3ce921[_0x4029('0x3f')],{'$or':_[_0x4029('0x41')](_0x3ce921[_0x4029('0x37')],function(_0x4d69f3){var _0x485e5f={};_0x485e5f[_0x4d69f3]={'$like':'%'+_0x10d97d[_0x4029('0x34')][_0x4029('0x3e')]+'%'};return _0x485e5f;})});}_0x3ce921=_[_0x4029('0x40')]({},_0x3ce921,_0x10d97d['options']);return db[_0x4029('0x53')][_0x4029('0x24')]({'where':_0x3ce921[_0x4029('0x3f')]})['then'](function(_0x4f8d1c){_0x5e3f7d[_0x4029('0x24')]=_0x4f8d1c;if(_0x10d97d[_0x4029('0x34')][_0x4029('0x55')]){_0x3ce921['include']=[{'all':!![]}];}return db[_0x4029('0x53')]['findAll'](_0x3ce921);})[_0x4029('0x14')](function(_0x1d070d){_0x5e3f7d[_0x4029('0x45')]=_0x1d070d;return _0x5e3f7d;});}})[_0x4029('0x14')](respondWithFilteredResult(_0x1a5fa5,_0x3ce921))[_0x4029('0x46')](handleError(_0x1a5fa5,null));};exports['removeDispositions']=function(_0x15e700,_0x84fd4c){return db[_0x4029('0x2f')]['find']({'where':{'id':_0x15e700[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x84fd4c,null))[_0x4029('0x14')](function(_0x1c9a63){if(_0x1c9a63){return _0x1c9a63[_0x4029('0x56')](_0x15e700['query']['ids']);}})[_0x4029('0x14')](respondWithStatusCode(_0x84fd4c,null))[_0x4029('0x46')](handleError(_0x84fd4c,null));};exports[_0x4029('0x57')]=function(_0x7f87a,_0x43b2ec){if(_0x7f87a['body']['id']){delete _0x7f87a[_0x4029('0x4f')]['id'];}return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x7f87a[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x43b2ec,null))['then'](function(_0x3c5225){if(_0x3c5225){_0x7f87a['body'][_0x4029('0x51')]=_0x3c5225['id'];return db[_0x4029('0x58')][_0x4029('0x4b')](_0x7f87a['body']);}})[_0x4029('0x14')](respondWithResult(_0x43b2ec,null))[_0x4029('0x46')](handleError(_0x43b2ec,null));};exports[_0x4029('0x59')]=function(_0x4fdf08,_0x2e0d13){var _0x4ce55a={'raw':![],'where':{}};var _0x1252ef={};var _0xecc16a={'count':0x0,'rows':[]};return db[_0x4029('0x2f')][_0x4029('0x5a')]({'where':{'id':_0x4fdf08[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x2e0d13,null))[_0x4029('0x14')](function(_0x50f6f5){if(_0x50f6f5){_0x1252ef[_0x4029('0x33')]=_[_0x4029('0x49')](db['CannedAnswer'][_0x4029('0x30')]);_0x1252ef['query']=_['keys'](_0x4fdf08[_0x4029('0x34')]);_0x1252ef['filters']=_[_0x4029('0x36')](_0x1252ef['model'],_0x1252ef['query']);_0x4ce55a['attributes']=_[_0x4029('0x36')](_0x1252ef[_0x4029('0x33')],qs['fields'](_0x4fdf08[_0x4029('0x34')][_0x4029('0x38')]));_0x4ce55a[_0x4029('0x37')]=_0x4ce55a[_0x4029('0x37')]['length']?_0x4ce55a[_0x4029('0x37')]:_0x1252ef[_0x4029('0x33')];if(!_0x4fdf08[_0x4029('0x34')][_0x4029('0x54')]('nolimit')){_0x4ce55a[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x4fdf08[_0x4029('0x34')][_0x4029('0x23')]);_0x4ce55a[_0x4029('0x21')]=qs[_0x4029('0x21')](_0x4fdf08[_0x4029('0x34')]['offset']);}_0x4ce55a[_0x4029('0x3b')]=qs['sort'](_0x4fdf08[_0x4029('0x34')]['sort']);_0x4ce55a[_0x4029('0x3f')]=qs[_0x4029('0x35')](_[_0x4029('0x3d')](_0x4fdf08[_0x4029('0x34')],_0x1252ef['filters']));_0x4ce55a[_0x4029('0x3f')][_0x4029('0x51')]=_0x50f6f5['id'];if(_0x4fdf08['query'][_0x4029('0x3e')]){_0x4ce55a[_0x4029('0x3f')]=_[_0x4029('0x40')](_0x4ce55a[_0x4029('0x3f')],{'$or':_['map'](_0x4ce55a[_0x4029('0x37')],function(_0x131fa1){var _0x19a787={};_0x19a787[_0x131fa1]={'$like':'%'+_0x4fdf08[_0x4029('0x34')]['filter']+'%'};return _0x19a787;})});}_0x4ce55a=_[_0x4029('0x40')]({},_0x4ce55a,_0x4fdf08[_0x4029('0x43')]);return db[_0x4029('0x58')][_0x4029('0x24')]({'where':_0x4ce55a['where']})['then'](function(_0x2cda3a){_0xecc16a[_0x4029('0x24')]=_0x2cda3a;if(_0x4fdf08[_0x4029('0x34')][_0x4029('0x55')]){_0x4ce55a['include']=[{'all':!![]}];}return db[_0x4029('0x58')][_0x4029('0x5b')](_0x4ce55a);})[_0x4029('0x14')](function(_0x276008){_0xecc16a[_0x4029('0x45')]=_0x276008;return _0xecc16a;});}})['then'](respondWithFilteredResult(_0x2e0d13,_0x4ce55a))[_0x4029('0x46')](handleError(_0x2e0d13,null));};exports[_0x4029('0x5c')]=function(_0x15b992,_0xac16dc){return db[_0x4029('0x2f')]['find']({'where':{'id':_0x15b992[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0xac16dc,null))[_0x4029('0x14')](function(_0x58b941){if(_0x58b941){return _0x58b941[_0x4029('0x5c')](_0x15b992['query'][_0x4029('0x5d')]);}})[_0x4029('0x14')](respondWithStatusCode(_0xac16dc,null))['catch'](handleError(_0xac16dc,null));};exports[_0x4029('0x5e')]=function(_0x7dda06,_0x464ccc){_0x7dda06[_0x4029('0x4f')]['sitepic']=_0x7dda06[_0x4029('0x5f')][_0x4029('0x60')];return db['ChatWebsite'][_0x4029('0x4a')]({'where':{'id':_0x7dda06[_0x4029('0x47')]['id']}})['then'](handleEntityNotFound(_0x464ccc,null))[_0x4029('0x14')](saveUpdates(_0x7dda06[_0x4029('0x4f')],null))[_0x4029('0x14')](respondWithResult(_0x464ccc,null))[_0x4029('0x46')](handleError(_0x464ccc,null));};exports[_0x4029('0x61')]=function(_0x40e293,_0x393558){_0x40e293['body'][_0x4029('0x62')]=_0x40e293[_0x4029('0x5f')][_0x4029('0x60')];return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x40e293[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x393558,null))[_0x4029('0x14')](saveUpdates(_0x40e293[_0x4029('0x4f')],null))[_0x4029('0x14')](respondWithResult(_0x393558,null))[_0x4029('0x46')](handleError(_0x393558,null));};exports[_0x4029('0x63')]=function(_0xed838e,_0x242d1e){_0xed838e[_0x4029('0x4f')]['customerAvatar']=_0xed838e[_0x4029('0x5f')][_0x4029('0x60')];return db[_0x4029('0x2f')]['find']({'where':{'id':_0xed838e[_0x4029('0x47')]['id']}})['then'](handleEntityNotFound(_0x242d1e,null))[_0x4029('0x14')](saveUpdates(_0xed838e[_0x4029('0x4f')],null))[_0x4029('0x14')](respondWithResult(_0x242d1e,null))[_0x4029('0x46')](handleError(_0x242d1e,null));};exports[_0x4029('0x64')]=function(_0x57ff3,_0x26881a){_0x57ff3['body'][_0x4029('0x65')]=_0x57ff3['file'][_0x4029('0x60')];return db[_0x4029('0x2f')]['find']({'where':{'id':_0x57ff3[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x26881a,null))[_0x4029('0x14')](saveUpdates(_0x57ff3['body'],null))['then'](respondWithResult(_0x26881a,null))[_0x4029('0x46')](handleError(_0x26881a,null));};exports[_0x4029('0x66')]=function(_0x317e66,_0xb4fcd2){var _0x2c2b6d=path['join'](config[_0x4029('0x67')],_0x4029('0x68'));var _0x1850f8={'where':{'id':_0x317e66[_0x4029('0x47')]['id']},'attributes':['id',_0x4029('0x69')],'raw':!![]};var _0x46f7f4=![];return require(_0x4029('0x6a'))['getLicense']()['then'](function(_0x25618c){if(_0x25618c){_0x46f7f4=_0x25618c[_0x4029('0x6b')];}})[_0x4029('0x14')](function(){return db[_0x4029('0x2f')][_0x4029('0x4a')](_0x1850f8);})[_0x4029('0x14')](handleEntityNotFound(_0xb4fcd2,null))[_0x4029('0x14')](function(_0x45bb09){if(_0x45bb09){if(!_[_0x4029('0x6c')](_0x45bb09[_0x4029('0x69')])){if(fs[_0x4029('0x6d')](path[_0x4029('0x6e')](config[_0x4029('0x67')],_0x4029('0x6f'),_0x45bb09[_0x4029('0x69')]))&&_0x46f7f4){_0x2c2b6d=path['join'](config['root'],_0x4029('0x6f'),_0x45bb09[_0x4029('0x69')]);}}return _0xb4fcd2[_0x4029('0x70')](_0x2c2b6d);}})['catch'](handleError(_0xb4fcd2,null));};exports[_0x4029('0x71')]=function(_0x5975cc,_0xa0fe6b){var _0x25a7e8=path[_0x4029('0x6e')](config[_0x4029('0x67')],_0x4029('0x72'));var _0x566fc6={'where':{'id':_0x5975cc['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x4029('0x2f')][_0x4029('0x4a')](_0x566fc6)[_0x4029('0x14')](handleEntityNotFound(_0xa0fe6b,null))[_0x4029('0x14')](function(_0x18f36f){if(_0x18f36f){if(!_[_0x4029('0x6c')](_0x18f36f[_0x4029('0x62')])){if(fs['existsSync'](path['join'](config[_0x4029('0x67')],_0x4029('0x73'),_0x18f36f[_0x4029('0x62')]))){_0x25a7e8=path[_0x4029('0x6e')](config['root'],_0x4029('0x73'),_0x18f36f[_0x4029('0x62')]);}}return _0xa0fe6b[_0x4029('0x70')](_0x25a7e8);}})['catch'](handleError(_0xa0fe6b,null));};exports[_0x4029('0x74')]=function(_0x3fd8a2,_0x48758f){var _0xc3cb23=path[_0x4029('0x6e')](config['root'],_0x4029('0x75'));var _0x4cf510={'where':{'id':_0x3fd8a2['params']['id']},'attributes':['id',_0x4029('0x76'),'showCustomerAvatar'],'raw':!![]};return db[_0x4029('0x2f')][_0x4029('0x4a')](_0x4cf510)['then'](handleEntityNotFound(_0x48758f,null))[_0x4029('0x14')](function(_0x139f4b){if(_0x139f4b){if(!_[_0x4029('0x6c')](_0x139f4b[_0x4029('0x76')])){if(fs[_0x4029('0x6d')](path['join'](config['root'],_0x4029('0x73'),_0x139f4b[_0x4029('0x76')]))&&_0x139f4b['showCustomerAvatar']){_0xc3cb23=path['join'](config['root'],'server/files/images/avatars/',_0x139f4b['customerAvatar']);}}return _0x48758f[_0x4029('0x70')](_0xc3cb23);}})[_0x4029('0x46')](handleError(_0x48758f,null));};exports['getSystemAvatar']=function(_0x444bce,_0x2124b1){var _0x27b2ef=path[_0x4029('0x6e')](config[_0x4029('0x67')],_0x4029('0x77'));var _0x2894ff={'where':{'id':_0x444bce[_0x4029('0x47')]['id']},'attributes':['id',_0x4029('0x65')],'raw':!![]};return db['ChatWebsite']['find'](_0x2894ff)['then'](handleEntityNotFound(_0x2124b1,null))['then'](function(_0x2740ca){if(_0x2740ca){if(!_['isNil'](_0x2740ca[_0x4029('0x65')])){if(fs['existsSync'](path['join'](config[_0x4029('0x67')],_0x4029('0x73'),_0x2740ca[_0x4029('0x65')]))){_0x27b2ef=path['join'](config['root'],'server/files/images/avatars/',_0x2740ca[_0x4029('0x65')]);}}return _0x2124b1['download'](_0x27b2ef);}})['catch'](handleError(_0x2124b1,null));};exports[_0x4029('0x78')]=function(_0x74cbe2,_0x27e5f6){var _0x47e786=require('user-agent-parser');var _0x99b3b8=new _0x47e786();var _0x3f6b31=_0x99b3b8[_0x4029('0x79')](_0x74cbe2[_0x4029('0x7a')][_0x4029('0x7b')])['getResult']();var _0x216153={'body':_0x74cbe2[_0x4029('0x4f')],'channel':'chat'};var _0x5f3369=[];var _0x2c76eb=[];var _0x8a71fa={};var _0x4a2b3e=![];return db[_0x4029('0x7c')][_0x4029('0x50')]()[_0x4029('0x14')](function(_0x5968fd){if(!_0x5968fd){throw new db[(_0x4029('0x7d'))][(_0x4029('0x7e'))](_0x4029('0x7f'));}_0x5f3369=_[_0x4029('0x80')](_[_0x4029('0x49')](_0x5968fd),[_0x4029('0x81'),_0x4029('0x82')]);_0x2c76eb=_[_0x4029('0x80')](_[_0x4029('0x49')](_0x5968fd),[_0x4029('0x81'),_0x4029('0x82'),_0x4029('0x83'),_0x4029('0x84')]);if(_0x74cbe2[_0x4029('0x4f')]['id']){delete _0x74cbe2[_0x4029('0x4f')]['id'];}if(_[_0x4029('0x6c')](_0x74cbe2['body'][_0x4029('0x85')])){throw new db[(_0x4029('0x7d'))][(_0x4029('0x7e'))](_0x4029('0x86'));}if(_[_0x4029('0x6c')](_0x74cbe2['body'][_0x4029('0x4f')])||_0x74cbe2[_0x4029('0x4f')][_0x4029('0x4f')]===''){throw new db[(_0x4029('0x7d'))]['ValidationError'](_0x4029('0x87'));}if(_[_0x4029('0x6c')](_0x74cbe2[_0x4029('0x4f')][_0x4029('0x88')])){throw new db[(_0x4029('0x7d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c76eb);}if(!_[_0x4029('0x89')](_0x2c76eb,_0x74cbe2[_0x4029('0x4f')][_0x4029('0x88')])){throw new db[(_0x4029('0x7d'))]['ValidationError'](_0x4029('0x8a')+_0x2c76eb);}_0x8a71fa[_0x74cbe2[_0x4029('0x4f')][_0x4029('0x88')]]=_0x74cbe2['body'][_0x4029('0x85')];})[_0x4029('0x14')](function(){return db[_0x4029('0x2f')]['find']({'where':{'id':_0x74cbe2[_0x4029('0x47')]['id']},'include':[{'model':db[_0x4029('0x8b')],'as':_0x4029('0x8c'),'include':[{'model':db[_0x4029('0x7c')],'as':_0x4029('0x8d'),'where':_0x8a71fa,'limit':0x1,'order':[['updatedAt',_0x4029('0x8e')]]}]},{'model':db[_0x4029('0x8f')],'as':'Applications'}]});})[_0x4029('0x14')](handleEntityNotFound(_0x27e5f6,null))[_0x4029('0x14')](function(_0x4b081b){if(_0x4b081b&&_0x4b081b['List']){_0x216153[_0x4029('0x90')]=_0x4b081b;_0x216153[_0x4029('0x91')]=_0x4b081b[_0x4029('0x92')];_0x216153[_0x4029('0x93')]=_0x4b081b[_0x4029('0x8c')];_0x216153['applications']=_[_0x4029('0x94')](_0x216153[_0x4029('0x91')],[_0x4029('0x95')],[_0x4029('0x96')]);if(_0x216153[_0x4029('0x90')]['Applications']){delete _0x216153[_0x4029('0x90')][_0x4029('0x92')];}if(_0x216153[_0x4029('0x90')][_0x4029('0x8c')]&&_0x216153[_0x4029('0x90')]['List'][_0x4029('0x8d')][_0x4029('0x39')]){return _0x216153[_0x4029('0x90')][_0x4029('0x8c')][_0x4029('0x8d')][0x0];}var _0x541f5c=_['defaults'](_0x74cbe2['body'],{'firstName':_0x74cbe2['body']['from'],'ListId':_0x4b081b[_0x4029('0x84')]});_0x541f5c[_0x74cbe2[_0x4029('0x4f')][_0x4029('0x88')]]=_0x74cbe2['body']['from'];return db[_0x4029('0x7c')][_0x4029('0x4b')](_0x541f5c,{'fields':_0x5f3369,'raw':!![]});}})[_0x4029('0x14')](handleEntityNotFound(_0x27e5f6,null))['then'](function(_0x124661){_0x216153[_0x4029('0x97')]=_0x124661;var _0x42f6ff=_0x74cbe2[_0x4029('0x4f')][_0x4029('0x98')];if(_0x74cbe2[_0x4029('0x7a')][_0x4029('0x99')]){_0x42f6ff=_0x74cbe2[_0x4029('0x7a')][_0x4029('0x99')];}else if(_0x74cbe2['headers'][_0x4029('0x9a')]){_0x42f6ff=_[_0x4029('0x9b')](_0x74cbe2['headers'][_0x4029('0x9a')]['split'](','));}if(_0x124661){var _0x47bf70={'ContactId':_0x124661['id'],'ChatWebsiteId':_0x74cbe2[_0x4029('0x47')]['id'],'from':(_0x124661[_0x4029('0x9c')]||'')+'\x20'+(_0x124661['lastName']||''),'customerIp':_0x42f6ff,'customerPort':_0x74cbe2[_0x4029('0x7a')][_0x4029('0x9d')]?_0x74cbe2['headers'][_0x4029('0x9d')]:null,'referer':_0x74cbe2['body'][_0x4029('0x9e')],'browserName':_0x3f6b31[_0x4029('0x9f')]['name']&&_0x3f6b31[_0x4029('0x9f')][_0x4029('0xa0')]?util[_0x4029('0xa1')](_0x4029('0xa2'),_0x3f6b31[_0x4029('0x9f')][_0x4029('0x2c')],_0x3f6b31[_0x4029('0x9f')][_0x4029('0xa0')]):_0x4029('0xa3'),'browserVersion':_0x3f6b31[_0x4029('0x9f')][_0x4029('0xa0')]||'unknown','osName':util[_0x4029('0xa1')](_0x4029('0xa2'),_0x3f6b31['os']['name'],_0x3f6b31['os'][_0x4029('0xa0')]),'osVersion':_0x3f6b31['os']['version'],'deviceModel':_0x3f6b31['device'][_0x4029('0x33')]&&_0x3f6b31['device'][_0x4029('0xa4')]?util[_0x4029('0xa1')](_0x4029('0xa5'),_0x3f6b31[_0x4029('0xa6')]['model'],_0x3f6b31[_0x4029('0xa6')][_0x4029('0xa4')],_0x3f6b31[_0x4029('0xa6')]['type']):null,'deviceVendor':_0x3f6b31[_0x4029('0xa6')]['vendor'],'deviceType':_0x3f6b31['device'][_0x4029('0x31')],'formData':JSON[_0x4029('0xa7')](_0x74cbe2['body'])};var _0x5d199a={'ChatWebsiteId':_0x74cbe2[_0x4029('0x47')]['id'],'closed':![]};if(_0x74cbe2[_0x4029('0x4f')]['threadId']){_0x5d199a[_0x4029('0xa8')]=_0x74cbe2[_0x4029('0x4f')]['threadId'];return db[_0x4029('0xa9')][_0x4029('0x4a')]({'where':_0x5d199a})[_0x4029('0x14')](function(_0x1a9c4f){if(_0x1a9c4f){return[_0x1a9c4f,![]];}_0x47bf70[_0x4029('0xa8')]=_0x74cbe2['body'][_0x4029('0xa8')];_0x47bf70[_0x4029('0xaa')]=_0x74cbe2[_0x4029('0x4f')][_0x4029('0xaa')];return db[_0x4029('0xa9')][_0x4029('0x4b')](_0x47bf70)[_0x4029('0x14')](function(_0x204cdf){return[_0x204cdf,!![]];});});}_0x5d199a[_0x4029('0xab')]=_0x124661['id'];if(_0x74cbe2[_0x4029('0x4f')]['interaction']&&_0x74cbe2[_0x4029('0x4f')][_0x4029('0xac')]['id']){_0x5d199a['id']=_0x74cbe2[_0x4029('0x4f')]['interaction']['id'];return db[_0x4029('0xa9')][_0x4029('0x4a')]({'where':_0x5d199a})[_0x4029('0x14')](function(_0x5bcd62){if(_0x5bcd62){return[_0x5bcd62,![]];}return db[_0x4029('0xa9')][_0x4029('0x4b')](_0x47bf70)[_0x4029('0x14')](function(_0x138dc7){return[_0x138dc7,!![]];});});}return db['ChatInteraction'][_0x4029('0x4b')](_0x47bf70)['then'](function(_0x2ded66){return[_0x2ded66,!![]];});}})[_0x4029('0xad')](function(_0x59f3e9,_0x3b3d56){if(_0x59f3e9){_0x4a2b3e=_0x3b3d56;if(!_0x3b3d56){var _0x525082={'from':(_0x216153[_0x4029('0x97')][_0x4029('0x9c')]||'')+'\x20'+(_0x216153[_0x4029('0x97')][_0x4029('0xae')]||'')};if(_0x74cbe2[_0x4029('0x4f')]['threadId']&&_0x74cbe2[_0x4029('0x4f')][_0x4029('0xaf')]&&_0x74cbe2[_0x4029('0x4f')][_0x4029('0xa8')]!=_0x74cbe2[_0x4029('0x4f')][_0x4029('0xaf')]){_0x525082[_0x4029('0xa8')]=_0x74cbe2[_0x4029('0x4f')][_0x4029('0xaf')];}return _0x59f3e9[_0x4029('0x26')](_0x525082);}else{return _0x59f3e9;}}})[_0x4029('0x14')](function(_0x31dab9){_0x216153[_0x4029('0xac')]=_0x31dab9['get']({'plain':!![]});_0x216153[_0x4029('0xac')][_0x4029('0xb0')]=_0x4a2b3e;if(_0x216153['interaction'][_0x4029('0xb0')]){if(_0x216153[_0x4029('0x90')][_0x4029('0xb1')]){_0x216153[_0x4029('0x91')][_0x4029('0xb2')]({'id':0x0,'priority':_0x216153['applications']['length']+0x1,'app':'close','appdata':_0x4029('0xb3'),'interval':'*,*,*,*'});}}return db[_0x4029('0xb4')][_0x4029('0x4b')]({'body':_0x74cbe2[_0x4029('0x4f')][_0x4029('0x4f')],'ChatWebsiteId':_0x74cbe2[_0x4029('0x47')]['id'],'ChatInteractionId':_0x31dab9['id'],'direction':'in','ContactId':_0x216153['contact']['id'],'AttachmentId':_0x74cbe2[_0x4029('0x4f')][_0x4029('0xb5')]});})[_0x4029('0x14')](function(_0x1d66ef){_0x216153[_0x4029('0x1c')]=_0x1d66ef;if(_0x216153[_0x4029('0xac')][_0x4029('0xb6')]){return db[_0x4029('0xb7')][_0x4029('0x4a')]({'attributes':['id',_0x4029('0x2c')],'where':{'id':_0x216153['interaction']['UserId']}})['then'](function(_0x3780eb){if(_0x3780eb){_0x216153[_0x4029('0x91')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4029('0xb8'),'appdata':_0x3780eb['name']+','+(_0x216153[_0x4029('0x90')][_0x4029('0xb9')]||0xa),'interval':_0x4029('0xba')});_0x216153[_0x4029('0xbb')]=!![];}return respondWithRpcPromise(_0x4029('0xbc'),_0x4029('0xbd'),_0x216153);});}return respondWithRpcPromise(_0x4029('0xbc'),_0x4029('0xbd'),_0x216153);})['then'](function(_0x50c32d){respondWithRpcPromise(_0x4029('0xbe'),_0x4029('0xbe'),{'event':_0x4029('0x78'),'message':_0x50c32d},client9002);return _0x50c32d;})[_0x4029('0x14')](respondWithResult(_0x27e5f6,null))[_0x4029('0x46')](handleError(_0x27e5f6,null));};exports[_0x4029('0xbf')]=function(_0x11ba06,_0x499436){var _0x417d8b,_0x4a1d0c,_0x553d43;var _0x35ab93=[];var _0x22ca51={};var _0x496a59=_0x11ba06['files']||[];var _0x41a2c8=[];var _0x49f0be;return db[_0x4029('0x7c')]['describe']()[_0x4029('0x14')](function(_0x5b2e7a){if(!_0x5b2e7a){throw new db[(_0x4029('0x7d'))][(_0x4029('0x7e'))](_0x4029('0x7f'));}_0x35ab93=_[_0x4029('0x80')](_[_0x4029('0x49')](_0x5b2e7a),[_0x4029('0x81'),_0x4029('0x82'),_0x4029('0x83'),_0x4029('0x84')]);if(_0x11ba06[_0x4029('0x4f')]['id']){delete _0x11ba06[_0x4029('0x4f')]['id'];}if(_[_0x4029('0x6c')](_0x11ba06[_0x4029('0x4f')]['from'])){throw _0x499436[_0x4029('0x1f')](0x1f4)['send'](new db[(_0x4029('0x7d'))][(_0x4029('0x7e'))](_0x4029('0x86')));}if(_[_0x4029('0x6c')](_0x11ba06[_0x4029('0x4f')][_0x4029('0x4f')])||_0x11ba06[_0x4029('0x4f')][_0x4029('0x4f')]===''){throw _0x499436[_0x4029('0x1f')](0x1f4)[_0x4029('0x2d')](new db[(_0x4029('0x7d'))][(_0x4029('0x7e'))](_0x4029('0x87')));}if(_['isNil'](_0x11ba06['body'][_0x4029('0xc0')])){throw _0x499436['status'](0x1f4)[_0x4029('0x2d')](new db['Sequelize'][(_0x4029('0x7e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35ab93));}if(!_['includes'](_0x35ab93,_0x11ba06[_0x4029('0x4f')][_0x4029('0xc0')])){throw _0x499436[_0x4029('0x1f')](0x1f4)['send'](new db[(_0x4029('0x7d'))][(_0x4029('0x7e'))](_0x4029('0xc1')+_0x35ab93));}_0x22ca51[_0x11ba06[_0x4029('0x4f')][_0x4029('0xc0')]]=_0x11ba06[_0x4029('0x4f')][_0x4029('0x85')];})['then'](function(){return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x11ba06['params']['id']},'include':[{'model':db[_0x4029('0x8b')],'as':_0x4029('0x8c')},{'model':db['MailAccount'],'as':_0x4029('0xc2')}]});})[_0x4029('0x14')](handleEntityNotFound(_0x499436,null))[_0x4029('0x14')](function(_0x494f73){if(_0x494f73&&_0x494f73[_0x4029('0x8c')]){_0x4a1d0c=_0x494f73;var _0x427335=_[_0x4029('0xc3')](_0x11ba06[_0x4029('0x4f')],{'firstName':_0x11ba06[_0x4029('0x4f')][_0x4029('0x85')],'phone':_0x11ba06['body']['from'],'ListId':_0x494f73[_0x4029('0x84')]});_0x427335[_0x11ba06[_0x4029('0x4f')][_0x4029('0xc0')]]=_0x11ba06['body'][_0x4029('0x85')];return db[_0x4029('0x7c')][_0x4029('0xc4')]({'where':_0x22ca51,'defaults':_0x427335});}})[_0x4029('0xad')](function(_0x7b536f){if(_0x7b536f){_0x553d43=_0x7b536f;var _0x15f2f8=fs[_0x4029('0xc5')](path[_0x4029('0x6e')](config[_0x4029('0x67')],_0x4029('0xc6')),'utf8');var _0x129940=ejs[_0x4029('0xc7')](_0x15f2f8,{'body':_['toPairs'](_0x11ba06[_0x4029('0x4f')][_0x4029('0x4f')]),'bodyTitle':_0x4a1d0c['offlineMessageBody']});return db[_0x4029('0xc8')][_0x4029('0x4b')]({'body':_0x129940,'plainBody':htmlToText['fromString'](_0x129940),'ContactId':_0x7b536f['id'],'ChatWebsiteId':_0x4a1d0c['id']});}})[_0x4029('0x14')](function(_0x4bc1b5){_0x49f0be=_0x4bc1b5;if(_0x496a59[_0x4029('0x39')]){var _0x19920f=_0x496a59[_0x4029('0x41')](function(_0x36baee){return{'name':_0x36baee[_0x4029('0xc9')],'basename':_0x36baee['filename'],'type':_0x36baee[_0x4029('0xca')],'ChatOfflineMessageId':_0x4bc1b5['id']};});_0x41a2c8=_0x19920f[_0x4029('0x41')](_0x3b7d72=>{var _0x106582={'filename':_0x3b7d72['name'],'path':path[_0x4029('0x6e')](config[_0x4029('0x67')],_0x4029('0xcb'),_0x4029('0xcc'),_0x4029('0xcd'),_0x4029('0xce'),_0x3b7d72['basename'])};return _0x106582;});if(!_0x4a1d0c[_0x4029('0xcf')]){return db[_0x4029('0xd0')][_0x4029('0xd1')](function(_0xd947b){return db[_0x4029('0xd2')]['bulkCreate'](_0x19920f,{'transaction':_0xd947b});});}}})[_0x4029('0x14')](function(){if(_0x49f0be){_0x417d8b=_0x49f0be;return db[_0x4029('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4029('0xd3')],'as':_0x4029('0xd4'),'raw':!![],'include':[{'model':db[_0x4029('0xd5')],'as':_0x4029('0xd5'),'raw':!![]}]}]});}})[_0x4029('0x14')](function(_0x51844e){if(_0x51844e&&_0x51844e['Smtp']&&_0x4a1d0c[_0x4029('0xd6')]&&_0x4a1d0c[_0x4029('0xd7')]){var _0x11afed=_0x51844e[_0x4029('0xd8')]();return respondWithRpcPromise(_0x4029('0xd9'),_0x4029('0xda'),{'account':_0x11afed,'message':{'from':util[_0x4029('0xa1')](_0x4029('0xdb'),_0x51844e[_0x4029('0x2c')],_0x51844e['email']||_0x51844e['Smtp']['user']),'to':_0x4a1d0c[_0x4029('0xd7')],'subject':_0x4a1d0c[_0x4029('0xdc')],'html':_0x417d8b[_0x4029('0x4f')],'attachments':_0x41a2c8}},client9003)[_0x4029('0x14')](function(){return _0x417d8b;})['catch'](function(_0x41162b){logger['error'](_0x41162b);});}})[_0x4029('0x14')](function(){if(_0x4a1d0c&&_0x4a1d0c[_0x4029('0xcf')]&&_0x4a1d0c['MailAccountId']){var _0x48d79d=[];if(_0x496a59[_0x4029('0x39')]){_0x48d79d=_0x496a59[_0x4029('0x41')](function(_0x1d2cfb){return{'name':_0x1d2cfb[_0x4029('0xc9')],'basename':_0x1d2cfb['filename'],'type':_0x1d2cfb[_0x4029('0xca')],'ChatOfflineMessageId':_0x49f0be['id']};});}var _0x452fdd;if(!_['isNil'](_0x4a1d0c[_0x4029('0xdd')])){var _0x58ac76=_[_0x4029('0x41')](_0x11ba06['body'],function(_0x31d1e8){return _0x31d1e8;});var _0x1f8bcc=_[_0x4029('0xde')](_0x58ac76)[0x0];var _0x3a0104=_[_0x4029('0xdf')](_0x1f8bcc,function(_0xc63dfb){return _0xc63dfb;});_0x452fdd=_0x3a0104[0x1][_0x4a1d0c[_0x4029('0xdd')]];}var _0x52be35={'from':_0x553d43[_0x4029('0xe0')],'firstName':_0x553d43[_0x4029('0x9c')],'lastName':_0x553d43[_0x4029('0xae')],'mapKey':_0x4029('0xe0'),'message':{'from':_0x553d43[_0x4029('0xe0')],'to':_0x4a1d0c['MailAccount']['email'],'cc':'','subject':_[_0x4029('0x6c')](_0x452fdd)?_0x4a1d0c['offlineMessageSubject']:_0x452fdd,'messageId':'','sentAt':new Date(),'attach':_0x48d79d[_0x4029('0x39')],'attachments':_0x48d79d,'originChannel':_0x4029('0xe1'),'ChatWebsiteId':_0x4a1d0c['id'],'ChatOfflineMessageId':_0x417d8b['id'],'originTo':_0x4a1d0c['MailAccount'][_0x4029('0xe0')]},'body':_0x417d8b[_0x4029('0x4f')]};var _0x324d5b={'account':{'id':_0x4a1d0c[_0x4029('0xe2')]},'body':_0x52be35,'log':_0x4029('0xe3')};return respondWithRpcPromise(_0x4029('0xe3'),'notifyMail',_0x324d5b,client9001)[_0x4029('0x14')](function(){return _0x417d8b;})['catch'](function(_0x1f660f){logger[_0x4029('0x1a')](_0x1f660f);});}return;})[_0x4029('0x14')](function(){if(_0x417d8b){return _0x417d8b;}})[_0x4029('0x14')](respondWithResult(_0x499436,null))[_0x4029('0x46')](function(_0x17a155){logger[_0x4029('0x1a')]('catch',_0x17a155);for(var _0x354ec9 of _0x496a59){var _0x3a10a9=path['join'](config[_0x4029('0x67')],_0x4029('0xcb'),_0x4029('0xcc'),'attachments',_0x4029('0xce'),_0x354ec9[_0x4029('0x60')]);fs_extra[_0x4029('0xe4')](_0x3a10a9)['catch'](function(_0x4cb324){logger[_0x4029('0x1a')](_0x4029('0xe5'),_0x3a10a9,_0x4cb324);});}});};exports[_0x4029('0xe6')]=function(_0x58667f,_0x5504e7){return db[_0x4029('0xa9')][_0x4029('0x4a')]({'where':{'id':_0x58667f[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x5504e7,null))[_0x4029('0x14')](function(_0x3fcadf){if(_0x3fcadf){return _0x3fcadf[_0x4029('0xe6')](_0x58667f[_0x4029('0x4f')][_0x4029('0x5d')],_[_0x4029('0xe7')](_0x58667f[_0x4029('0x4f')],[_0x4029('0x5d'),'id'])||{});}})[_0x4029('0x14')](respondWithResult(_0x5504e7,null))[_0x4029('0x46')](handleError(_0x5504e7,null));};exports[_0x4029('0xe8')]=function(_0x5a304a,_0x43789e){var _0x3460b3={'raw':![],'where':{}};var _0x190cf5={};var _0x34e663={'count':0x0,'rows':[]};return db[_0x4029('0x2f')][_0x4029('0x5a')]({'where':{'id':_0x5a304a[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x43789e,null))['then'](function(_0x2b5449){if(_0x2b5449){_0x190cf5[_0x4029('0x33')]=_[_0x4029('0x49')](db[_0x4029('0xa9')][_0x4029('0x30')]);_0x190cf5[_0x4029('0x34')]=_['keys'](_0x5a304a[_0x4029('0x34')]);_0x190cf5[_0x4029('0x35')]=_[_0x4029('0x36')](_0x190cf5[_0x4029('0x33')],_0x190cf5[_0x4029('0x34')]);_0x3460b3[_0x4029('0x37')]=_['intersection'](_0x190cf5[_0x4029('0x33')],qs['fields'](_0x5a304a[_0x4029('0x34')][_0x4029('0x38')]));_0x3460b3[_0x4029('0x37')]=_0x3460b3[_0x4029('0x37')][_0x4029('0x39')]?_0x3460b3[_0x4029('0x37')]:_0x190cf5[_0x4029('0x33')];if(!_0x5a304a[_0x4029('0x34')][_0x4029('0x54')]('nolimit')){_0x3460b3[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x5a304a[_0x4029('0x34')][_0x4029('0x23')]);_0x3460b3['offset']=qs[_0x4029('0x21')](_0x5a304a[_0x4029('0x34')][_0x4029('0x21')]);}_0x3460b3[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x5a304a[_0x4029('0x34')][_0x4029('0x3c')]);_0x3460b3[_0x4029('0x3f')]=qs['filters'](_[_0x4029('0x3d')](_0x5a304a['query'],_0x190cf5[_0x4029('0x35')]));_0x3460b3['where'][_0x4029('0x51')]=_0x2b5449['id'];if(_0x5a304a[_0x4029('0x34')][_0x4029('0x3e')]){_0x3460b3['where']=_[_0x4029('0x40')](_0x3460b3[_0x4029('0x3f')],{'$or':_[_0x4029('0x41')](_0x3460b3[_0x4029('0x37')],function(_0x1cb9d4){var _0x2064f2={};_0x2064f2[_0x1cb9d4]={'$like':'%'+_0x5a304a[_0x4029('0x34')][_0x4029('0x3e')]+'%'};return _0x2064f2;})});}_0x3460b3=_['merge']({},_0x3460b3,_0x5a304a['options']);return db[_0x4029('0xa9')][_0x4029('0x24')]({'where':_0x3460b3['where']})['then'](function(_0x3ddc3f){_0x34e663[_0x4029('0x24')]=_0x3ddc3f;if(_0x5a304a[_0x4029('0x34')][_0x4029('0x55')]){_0x3460b3[_0x4029('0x44')]=[{'model':db[_0x4029('0x7c')],'as':_0x4029('0xe9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name','fullname',_0x4029('0xea')],'required':![]},{'model':db[_0x4029('0xeb')],'as':_0x4029('0xec'),'attributes':['id',_0x4029('0x2c'),_0x4029('0xed')],'where':_0x5a304a['query'][_0x4029('0xee')]?{'id':_0x5a304a[_0x4029('0x34')]['tag']}:undefined,'required':_0x5a304a[_0x4029('0x34')][_0x4029('0xee')]?!![]:![]}];}return db[_0x4029('0xa9')]['findAll'](_0x3460b3);})[_0x4029('0x14')](function(_0x14f85c){_0x34e663[_0x4029('0x45')]=_0x14f85c;return _0x34e663;});}})[_0x4029('0x14')](respondWithFilteredResult(_0x43789e,_0x3460b3))[_0x4029('0x46')](handleError(_0x43789e,null));};function iftimePromise(_0x585862,_0x51a739){return respondWithRpcPromise(_0x4029('0xef'),_0x4029('0xf0'),{'command':_0x51a739[_0x4029('0xf1')]?util['format']('iftime\x20%s,%s',_0x585862[_0x4029('0xf2')],_0x51a739[_0x4029('0xf1')]):util['format'](_0x4029('0xf3'),_0x585862[_0x4029('0xf2')])},client9002)[_0x4029('0x14')](function(_0x52cf8f){var _0xeadc73=_0x52cf8f&&_0x52cf8f[_0x4029('0xf4')](_0x4029('0xf5'))>=0x0?!![]:![];logger[_0x4029('0x15')](_0x4029('0xf6'),_0x51a739['id'],_0x585862['id'],_0x585862['interval'],_0xeadc73?_0x4029('0xf7'):_0x4029('0xf8'),_0x51a739[_0x4029('0xf1')]?_0x51a739[_0x4029('0xf1')]:_0x4029('0xf9'));return _0xeadc73;})['catch'](function(_0x187140){logger[_0x4029('0x1a')](_0x4029('0xf6'),_0x51a739['id'],_0x585862['id'],_0x585862[_0x4029('0xf2')],util[_0x4029('0xfa')](_0x187140,{'showHidden':![],'depth':null}),_0x51a739['timezone']?_0x51a739[_0x4029('0xf1')]:_0x4029('0xf9'));return![];});}exports[_0x4029('0xf0')]=function(_0x467ed0,_0x160bbd){var _0x45cc2a=0x0;var _0xb40e6=0x0;var _0x3570cd=![];var _0x5a9672;var _0x21b61c;return db[_0x4029('0x2f')][_0x4029('0x4a')]({'where':{'id':_0x467ed0[_0x4029('0x47')]['id']},'include':[{'model':db[_0x4029('0xfb')],'as':_0x4029('0xfb'),'include':[{'model':db[_0x4029('0xfb')],'as':'Intervals','attributes':['id',_0x4029('0xf2')],'raw':!![]}]}]})[_0x4029('0x14')](handleEntityNotFound(_0x160bbd,null))['then'](function(_0x2eb4e4){if(_0x2eb4e4){_0x5a9672=_0x2eb4e4;return _0x2eb4e4[_0x4029('0xfc')]({'raw':!![]});}})[_0x4029('0x14')](function(_0x1eb1f5){if(_0x5a9672){if(_0x1eb1f5){_0x21b61c=_0x1eb1f5;}}return require(_0x4029('0x6a'))[_0x4029('0xfd')]();})['then'](function(_0x3a83b2){if(_0x3a83b2){_0xb40e6=_0x3a83b2['virtual'];_0x3570cd=_0x3a83b2[_0x4029('0x6b')];}})['then'](function(){return db[_0x4029('0xa9')][_0x4029('0x24')]({'where':{'closed':![]}});})[_0x4029('0x14')](function(_0x4de9c8){_0x45cc2a=_0x4de9c8;if(_0xb40e6&&_0x4de9c8>_0xb40e6){return db[_0x4029('0xfe')]['findOne']({'where':{'id':0x1}})[_0x4029('0x14')](function(_0x42f11b){if(_0x42f11b){_0x42f11b[_0x4029('0xff')](_0x4029('0x100'));}});}})[_0x4029('0x14')](function(){if(_0x5a9672[_0x4029('0xfb')]&&_0x5a9672[_0x4029('0xfb')][_0x4029('0x101')]){var _0x58862d=[];for(var _0x3be033=0x0;_0x3be033<_0x5a9672['Interval'][_0x4029('0x101')]['length'];_0x3be033++){var _0x4aa7eb=_0x5a9672['Interval'][_0x4029('0x101')][_0x3be033]['get']({'plain':!![]});_0x58862d[_0x4029('0xb2')](iftimePromise(_0x4aa7eb,_0x5a9672));}return BPromise[_0x4029('0x102')](_0x58862d)[_0x4029('0x14')](function(_0x44688f){return _['some'](_0x44688f);});}else{return!![];}})['then'](function(_0x269cce){var _0x3d7130=fs[_0x4029('0xc5')](path[_0x4029('0x6e')](config[_0x4029('0x67')],'server/files/chat/iframe.ejs'),_0x4029('0x103'));var _0x39d288=new url[(_0x4029('0x104'))](_0x5a9672[_0x4029('0x105')])[_0x4029('0x106')];var _0x599867=_0x4029('0x107');var _0x10ca42=![];var _0x4f81b3={'chatVersion':_0x599867,'chatWebsiteAddressOrigin':_0x39d288,'remote':_0x5a9672[_0x4029('0x108')],'query':querystring['stringify'](_[_0x4029('0x40')](_0x5a9672[_0x4029('0x28')]({'plain':!![]}),{'customerIp':_0x467ed0[_0x4029('0x7a')]['x-forwarded-for']||_0x467ed0['headers']['x-real-ip']||_0x467ed0[_0x4029('0x109')][_0x4029('0x10a')]||_0x467ed0['ip'],'referer':_0x467ed0[_0x4029('0x7a')][_0x4029('0x9e')],'openedInteractions':_0x45cc2a,'maxInteractions':_0xb40e6,'virtual':_0x3570cd[_0x4029('0x10b')],'online':_0x269cce,'custom':_0x3570cd}))[_0x4029('0x10c')](/'/g,'\x5c\x27')};_0x160bbd[_0x4029('0x2d')](ejs[_0x4029('0xc7')](Mustache['render'](_0x3d7130,_0x4f81b3),{'proactiveActions':_0x21b61c,'alignment':_0x5a9672[_0x4029('0x10d')],'verticalAlignment':_0x5a9672['verticalAlignment'],'div_color':_0x5a9672[_0x4029('0xed')],'labelText':_0x5a9672[_0x4029('0x10e')],'text_color':_0x5a9672['textColor'],'text_button_color':_0x5a9672[_0x4029('0x10f')],'button_color':_0x5a9672[_0x4029('0x110')],'background_color':_0x5a9672[_0x4029('0x111')],'hideWhenOffline':_0x5a9672[_0x4029('0x112')],'intervalId':_0x5a9672[_0x4029('0x113')],'isDevelopment':_0x10ca42,'chatVersion':_0x599867}));})[_0x4029('0x46')](handleError(_0x160bbd,null));};exports[_0x4029('0x114')]=function(_0x48f642,_0xb50ce4){var _0x35cda6=_0x48f642[_0x4029('0x47')]['id'];var _0x54b890=_0x48f642[_0x4029('0x4f')];var _0x22e71e=0xc8;var _0x468272=null;return db[_0x4029('0xd0')]['transaction']({'isolationLevel':db[_0x4029('0xd0')][_0x4029('0x115')][_0x4029('0x116')][_0x4029('0x117')]},function(_0x4cf0fe){return db[_0x4029('0x2f')][_0x4029('0x5a')]({'where':{'id':_0x35cda6},'transaction':_0x4cf0fe})[_0x4029('0x14')](function(_0x2a1fd2){if(_0x2a1fd2){return db[_0x4029('0x8f')]['destroy']({'where':{'ChatWebsiteId':_0x35cda6},'transaction':_0x4cf0fe})[_0x4029('0x14')](function(){var _0x24dcb3=_['map'](_0x54b890,function(_0x533e5b){_0x533e5b[_0x4029('0x51')]=_0x35cda6;return _0x533e5b;});return db[_0x4029('0x8f')]['bulkCreate'](_0x24dcb3,{'transaction':_0x4cf0fe});});}else{_0x22e71e=0x194;_0x468272=[];}});})[_0x4029('0x14')](function(){if(_0x22e71e!==0x194){return db[_0x4029('0x8f')][_0x4029('0x118')]({'where':{'ChatWebsiteId':_0x35cda6},'order':_0x4029('0x95')})[_0x4029('0x14')](function(_0x4d16d2){_0x468272=_0x4d16d2;});}})['catch'](function(_0x29bb9d){_0x22e71e=0x1f4;logger[_0x4029('0x1a')](_0x29bb9d[_0x4029('0x2b')]);if(_0x29bb9d[_0x4029('0x2c')]){delete _0x29bb9d[_0x4029('0x2c')];}_0x468272=_0x29bb9d;})[_0x4029('0x119')](function(){if(_0x468272===null){_0xb50ce4[_0x4029('0x1e')](_0x22e71e);}else{if(_0x22e71e===0x1f4){_0xb50ce4['status'](_0x22e71e)[_0x4029('0x2d')](_0x468272);}else{_0xb50ce4['status'](_0x22e71e)[_0x4029('0x20')](_0x468272);}}});};exports[_0x4029('0x11a')]=function(_0x320ef8,_0x56ff35){var _0x336ebb={};var _0x1a6258={};var _0x2a19be;var _0x538f23;return db[_0x4029('0x2f')]['findOne']({'where':{'id':_0x320ef8[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x56ff35,null))[_0x4029('0x14')](function(_0x283b6d){if(_0x283b6d){_0x2a19be=_0x283b6d;_0x1a6258['model']=_['keys'](db['ChatApplication']['rawAttributes']);_0x1a6258['query']=_[_0x4029('0x49')](_0x320ef8[_0x4029('0x34')]);_0x1a6258['filters']=_[_0x4029('0x36')](_0x1a6258[_0x4029('0x33')],_0x1a6258[_0x4029('0x34')]);_0x336ebb[_0x4029('0x37')]=_['intersection'](_0x1a6258[_0x4029('0x33')],qs['fields'](_0x320ef8['query'][_0x4029('0x38')]));_0x336ebb[_0x4029('0x37')]=_0x336ebb[_0x4029('0x37')]['length']?_0x336ebb[_0x4029('0x37')]:_0x1a6258[_0x4029('0x33')];_0x336ebb[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x320ef8[_0x4029('0x34')][_0x4029('0x3c')]);_0x336ebb[_0x4029('0x3f')]=qs[_0x4029('0x35')](_[_0x4029('0x3d')](_0x320ef8[_0x4029('0x34')],_0x1a6258['filters']));if(_0x320ef8[_0x4029('0x34')]['filter']){_0x336ebb[_0x4029('0x3f')]=_[_0x4029('0x40')](_0x336ebb['where'],{'$or':_[_0x4029('0x41')](_0x336ebb['attributes'],function(_0x363538){var _0x136cf8={};_0x136cf8[_0x363538]={'$like':'%'+_0x320ef8[_0x4029('0x34')][_0x4029('0x3e')]+'%'};return _0x136cf8;})});}_0x336ebb=_[_0x4029('0x40')]({},_0x336ebb,_0x320ef8[_0x4029('0x43')]);return _0x2a19be[_0x4029('0x11a')](_0x336ebb);}})[_0x4029('0x14')](function(_0x2c8765){if(_0x2c8765){_0x538f23=_0x2c8765['length'];if(!_0x320ef8[_0x4029('0x34')][_0x4029('0x54')](_0x4029('0x3a'))){_0x336ebb[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x320ef8[_0x4029('0x34')][_0x4029('0x23')]);_0x336ebb[_0x4029('0x21')]=qs[_0x4029('0x21')](_0x320ef8[_0x4029('0x34')][_0x4029('0x21')]);}return _0x2a19be[_0x4029('0x11a')](_0x336ebb);}})[_0x4029('0x14')](function(_0x45f5d8){if(_0x45f5d8){return _0x45f5d8?{'count':_0x538f23,'rows':_0x45f5d8}:null;}})[_0x4029('0x14')](respondWithResult(_0x56ff35,null))[_0x4029('0x46')](handleError(_0x56ff35,null));};exports[_0x4029('0x11b')]=function(_0x116a02,_0x5f3829){return db[_0x4029('0x11c')][_0x4029('0x4a')]({'where':{'id':_0x116a02[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x5f3829,null))[_0x4029('0x14')](function(_0x503959){if(_0x503959){return _0x503959[_0x4029('0x11b')](_0x116a02[_0x4029('0x4f')][_0x4029('0x5d')],_['omit'](_0x116a02[_0x4029('0x4f')],[_0x4029('0x5d'),'id'])||{});}})[_0x4029('0x14')](respondWithResult(_0x5f3829,null))['catch'](handleError(_0x5f3829,null));};exports['getProactiveActions']=function(_0x5452c1,_0x590f93){var _0x46314f={};var _0x224cda={};var _0x3fa06f;var _0x635eac;return db[_0x4029('0x2f')][_0x4029('0x5a')]({'where':{'id':_0x5452c1[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x590f93,null))['then'](function(_0x48e44d){if(_0x48e44d){_0x3fa06f=_0x48e44d;_0x224cda['model']=_['keys'](db[_0x4029('0x11d')]['rawAttributes']);_0x224cda[_0x4029('0x34')]=_[_0x4029('0x49')](_0x5452c1['query']);_0x224cda[_0x4029('0x35')]=_['intersection'](_0x224cda[_0x4029('0x33')],_0x224cda[_0x4029('0x34')]);_0x46314f[_0x4029('0x37')]=_['intersection'](_0x224cda[_0x4029('0x33')],qs['fields'](_0x5452c1[_0x4029('0x34')]['fields']));_0x46314f[_0x4029('0x37')]=_0x46314f[_0x4029('0x37')][_0x4029('0x39')]?_0x46314f[_0x4029('0x37')]:_0x224cda['model'];_0x46314f[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x5452c1['query']['sort']);_0x46314f[_0x4029('0x3f')]=qs[_0x4029('0x35')](_['pick'](_0x5452c1[_0x4029('0x34')],_0x224cda[_0x4029('0x35')]));if(_0x5452c1[_0x4029('0x34')][_0x4029('0x3e')]){_0x46314f[_0x4029('0x3f')]=_[_0x4029('0x40')](_0x46314f[_0x4029('0x3f')],{'$or':_['map'](_0x46314f[_0x4029('0x37')],function(_0x2895ed){var _0x9862d2={};_0x9862d2[_0x2895ed]={'$like':'%'+_0x5452c1[_0x4029('0x34')][_0x4029('0x3e')]+'%'};return _0x9862d2;})});}_0x46314f=_[_0x4029('0x40')]({},_0x46314f,_0x5452c1[_0x4029('0x43')]);return _0x3fa06f[_0x4029('0xfc')](_0x46314f);}})['then'](function(_0x18dcf7){if(_0x18dcf7){_0x635eac=_0x18dcf7[_0x4029('0x39')];if(!_0x5452c1['query'][_0x4029('0x54')](_0x4029('0x3a'))){_0x46314f[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x5452c1[_0x4029('0x34')][_0x4029('0x23')]);_0x46314f['offset']=qs[_0x4029('0x21')](_0x5452c1[_0x4029('0x34')][_0x4029('0x21')]);}return _0x3fa06f['getProactiveActions'](_0x46314f);}})[_0x4029('0x14')](function(_0x36210d){if(_0x36210d){return _0x36210d?{'count':_0x635eac,'rows':_0x36210d}:null;}})[_0x4029('0x14')](respondWithResult(_0x590f93,null))[_0x4029('0x46')](handleError(_0x590f93,null));};exports[_0x4029('0x11e')]=function(_0x3fd548,_0x511723){var _0x485994=_0x3fd548[_0x4029('0x34')][_0x4029('0x11f')]==='false'?'offlineForm':_0x4029('0x120');return db[_0x4029('0x2f')][_0x4029('0x4a')]({'attributes':['id',_0x485994],'where':{'id':_0x3fd548[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x511723,null))[_0x4029('0x14')](function(_0x5204c1){if(_0x5204c1){var _0x271f97=_0x5204c1[_0x485994];var _0x367c31=_0x271f97&&_0x271f97['items']?_0x271f97[_0x4029('0x121')]:[];_0x511723[_0x4029('0x2d')]({'fromKey':_[_0x4029('0x6c')](_0x271f97['fromKey'])?undefined:_0x271f97[_0x4029('0x122')],'count':_0x367c31['length'],'rows':_0x367c31});}})['catch'](handleError(_0x511723,null));};exports[_0x4029('0x123')]=function(_0x4dba69,_0x2a3bf7){var _0x5dccb5={'raw':![],'where':{}};var _0x27c037={};var _0x31128c={'count':0x0,'rows':[]};return db[_0x4029('0x2f')]['findOne']({'where':{'id':_0x4dba69[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x2a3bf7,null))[_0x4029('0x14')](function(_0x55bad2){if(_0x55bad2){_0x27c037['model']=_['keys'](db[_0x4029('0xc8')][_0x4029('0x30')]);_0x27c037[_0x4029('0x34')]=_[_0x4029('0x49')](_0x4dba69[_0x4029('0x34')]);_0x27c037[_0x4029('0x35')]=_['intersection'](_0x27c037['model'],_0x27c037['query']);_0x5dccb5[_0x4029('0x37')]=_[_0x4029('0x36')](_0x27c037[_0x4029('0x33')],qs[_0x4029('0x38')](_0x4dba69[_0x4029('0x34')][_0x4029('0x38')]));_0x5dccb5['attributes']=_0x5dccb5[_0x4029('0x37')][_0x4029('0x39')]?_0x5dccb5['attributes']:_0x27c037['model'];if(!_0x4dba69[_0x4029('0x34')][_0x4029('0x54')](_0x4029('0x3a'))){_0x5dccb5[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x4dba69['query']['limit']);_0x5dccb5['offset']=qs[_0x4029('0x21')](_0x4dba69[_0x4029('0x34')][_0x4029('0x21')]);}_0x5dccb5[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x4dba69[_0x4029('0x34')][_0x4029('0x3c')]);_0x5dccb5[_0x4029('0x3f')]=qs[_0x4029('0x35')](_['pick'](_0x4dba69[_0x4029('0x34')],_0x27c037[_0x4029('0x35')]));_0x5dccb5[_0x4029('0x3f')]['ChatWebsiteId']=_0x55bad2['id'];if(_0x4dba69[_0x4029('0x34')][_0x4029('0x3e')]){_0x5dccb5['where']=_['merge'](_0x5dccb5['where'],{'$or':_[_0x4029('0x41')](_0x5dccb5[_0x4029('0x37')],function(_0x4c1ce2){var _0x13a133={};_0x13a133[_0x4c1ce2]={'$like':'%'+_0x4dba69['query'][_0x4029('0x3e')]+'%'};return _0x13a133;})});}_0x5dccb5=_[_0x4029('0x40')]({},_0x5dccb5,_0x4dba69[_0x4029('0x43')]);return db[_0x4029('0xc8')][_0x4029('0x24')]({'where':_0x5dccb5[_0x4029('0x3f')]})[_0x4029('0x14')](function(_0x557c12){_0x31128c['count']=_0x557c12;if(_0x4dba69[_0x4029('0x34')]['includeAll']){_0x5dccb5['include']=[{'all':!![]}];}else{_0x5dccb5[_0x4029('0x44')]=[{'model':db[_0x4029('0x7c')],'as':_0x4029('0xe9'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x4029('0xc8')]['findAll'](_0x5dccb5);})['then'](function(_0x3d4e47){_0x31128c[_0x4029('0x45')]=_0x3d4e47;return _0x31128c;});}})['then'](respondWithFilteredResult(_0x2a3bf7,_0x5dccb5))['catch'](handleError(_0x2a3bf7,null));};exports[_0x4029('0x124')]=function(_0x239f11,_0x2c43e2){return db['ChatWebsite']['find']({'where':{'id':_0x239f11[_0x4029('0x47')]['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x2c43e2,null))['then'](function(_0x4ba75e){if(_0x4ba75e){return _0x4ba75e['addAgents'](_0x239f11['body'][_0x4029('0x5d')],_[_0x4029('0xe7')](_0x239f11[_0x4029('0x4f')],['ids','id'])||{})[_0x4029('0xad')](function(_0x2336ac){for(var _0xd92480=0x0;_0xd92480<_0x239f11[_0x4029('0x4f')]['ids'][_0x4029('0x39')];_0xd92480+=0x1){socket[_0x4029('0x125')]('userChatWebsite:save',{'UserId':Number(_0x239f11[_0x4029('0x4f')][_0x4029('0x5d')][_0xd92480]),'ChatWebsiteId':Number(_0x239f11['params']['id'])});}return _0x2336ac;});}})[_0x4029('0x14')](respondWithResult(_0x2c43e2,null))[_0x4029('0x46')](handleError(_0x2c43e2,null));};exports[_0x4029('0x126')]=function(_0x3e47d5,_0x5de2f3){return db[_0x4029('0x2f')]['find']({'where':{'id':_0x3e47d5[_0x4029('0x47')]['id']}})['then'](handleEntityNotFound(_0x5de2f3,null))[_0x4029('0x14')](function(_0x546e17){if(_0x546e17){return _0x546e17['removeAgents'](_0x3e47d5[_0x4029('0x34')]['ids'])['then'](function(){if(_['isArray'](_0x3e47d5[_0x4029('0x34')]['ids'])){for(var _0x17b3f9=0x0;_0x17b3f9<_0x3e47d5['query'][_0x4029('0x5d')][_0x4029('0x39')];_0x17b3f9+=0x1){socket[_0x4029('0x125')](_0x4029('0x127'),{'UserId':Number(_0x3e47d5[_0x4029('0x34')][_0x4029('0x5d')][_0x17b3f9]),'ChatWebsiteId':Number(_0x3e47d5[_0x4029('0x47')]['id'])});}}else{socket[_0x4029('0x125')](_0x4029('0x127'),{'UserId':Number(_0x3e47d5[_0x4029('0x34')][_0x4029('0x5d')]),'ChatWebsiteId':Number(_0x3e47d5['params']['id'])});}});}})[_0x4029('0x14')](respondWithStatusCode(_0x5de2f3,null))['catch'](handleError(_0x5de2f3,null));};exports[_0x4029('0x128')]=function(_0x24e5f3,_0x1b12e6){var _0x296ca1={};var _0xd38b02={};var _0x465fe7;var _0x5839da;return db[_0x4029('0x2f')][_0x4029('0x5a')]({'where':{'id':_0x24e5f3['params']['id']}})[_0x4029('0x14')](handleEntityNotFound(_0x1b12e6,null))['then'](function(_0xbd5bb1){if(_0xbd5bb1){_0x465fe7=_0xbd5bb1;_0xd38b02[_0x4029('0x33')]=_[_0x4029('0x49')](db[_0x4029('0xb7')]['rawAttributes']);_0xd38b02[_0x4029('0x34')]=_['keys'](_0x24e5f3['query']);_0xd38b02[_0x4029('0x35')]=_[_0x4029('0x36')](_0xd38b02['model'],_0xd38b02[_0x4029('0x34')]);_0x296ca1[_0x4029('0x37')]=_[_0x4029('0x36')](_0xd38b02[_0x4029('0x33')],qs[_0x4029('0x38')](_0x24e5f3[_0x4029('0x34')]['fields']));_0x296ca1['attributes']=_0x296ca1[_0x4029('0x37')]['length']?_0x296ca1[_0x4029('0x37')]:_0xd38b02[_0x4029('0x33')];_0x296ca1[_0x4029('0x3b')]=qs[_0x4029('0x3c')](_0x24e5f3[_0x4029('0x34')][_0x4029('0x3c')]);_0x296ca1[_0x4029('0x3f')]=qs['filters'](_[_0x4029('0x3d')](_0x24e5f3[_0x4029('0x34')],_0xd38b02[_0x4029('0x35')]));if(_0x24e5f3[_0x4029('0x34')][_0x4029('0x3e')]){_0x296ca1[_0x4029('0x3f')]=_[_0x4029('0x40')](_0x296ca1[_0x4029('0x3f')],{'$or':_[_0x4029('0x41')](_0x296ca1['attributes'],function(_0x1a0248){var _0x351e04={};_0x351e04[_0x1a0248]={'$like':'%'+_0x24e5f3[_0x4029('0x34')][_0x4029('0x3e')]+'%'};return _0x351e04;})});}_0x296ca1=_[_0x4029('0x40')]({},_0x296ca1,_0x24e5f3['options']);return _0x465fe7[_0x4029('0x128')](_0x296ca1);}})[_0x4029('0x14')](function(_0x23a3cd){if(_0x23a3cd){_0x5839da=_0x23a3cd[_0x4029('0x39')];if(!_0x24e5f3[_0x4029('0x34')][_0x4029('0x54')](_0x4029('0x3a'))){_0x296ca1[_0x4029('0x23')]=qs[_0x4029('0x23')](_0x24e5f3[_0x4029('0x34')][_0x4029('0x23')]);_0x296ca1[_0x4029('0x21')]=qs[_0x4029('0x21')](_0x24e5f3[_0x4029('0x34')][_0x4029('0x21')]);}return _0x465fe7[_0x4029('0x128')](_0x296ca1);}})[_0x4029('0x14')](function(_0x3c0f11){if(_0x3c0f11){return _0x3c0f11?{'count':_0x5839da,'rows':_0x3c0f11}:null;}})[_0x4029('0x14')](respondWithResult(_0x1b12e6,null))['catch'](handleError(_0x1b12e6,null));}; \ No newline at end of file +var _0x122e=['CompanyId','ListId','from','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','List','DESC','account','Applications','list','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','applications','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','files','offline-chat','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Owner','fullname','internal','Tag','Tags','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','referer','virtual','replace','alignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','stack','finally','getApplications','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','sendStatus','offset','limit','undefined','count','status','set','Content-Range','json','update','destroy','get','UserProfileResource','end','name','send','Pause','ChatWebsite','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','options','includeAll','include','catch','params','mandatoryDispositionPause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','filter','findAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','sitepic','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','getAvatar','isNil','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','server/files/images/avatars/system_avatar.png','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt'];(function(_0x631032,_0x5858ef){var _0x18cfc9=function(_0x340680){while(--_0x340680){_0x631032['push'](_0x631032['shift']());}};_0x18cfc9(++_0x5858ef);}(_0x122e,0xa6));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xe122('0x0'));var Mustache=require(_0xe122('0x1'));var util=require('util');var path=require(_0xe122('0x2'));var ejs=require(_0xe122('0x3'));var fs=require('fs');var fs_extra=require(_0xe122('0x4'));var _=require(_0xe122('0x5'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xe122('0x6'));var logger=require(_0xe122('0x7'))(_0xe122('0x8'));var config=require(_0xe122('0x9'));var url=require(_0xe122('0xa'));var db=require(_0xe122('0xb'))['db'];config[_0xe122('0xc')]=_[_0xe122('0xd')](config[_0xe122('0xc')],{'host':_0xe122('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe122('0xc')]));require(_0xe122('0xf'))[_0xe122('0x10')](socket);var htmlToText=require(_0xe122('0x11'));var jayson=require(_0xe122('0x12'));var client=jayson[_0xe122('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xe122('0x13')][_0xe122('0x14')]({'port':0x232a});var client9003=jayson['client'][_0xe122('0x14')]({'port':0x232b});var client9001=jayson[_0xe122('0x13')][_0xe122('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x54dd0a,_0x107275,_0x13b132,_0x342e1a){return new BPromise(function(_0x53ac86,_0x5b6eca){var _0x2f27d8=_0x342e1a||client;return _0x2f27d8['request'](_0x54dd0a,_0x13b132)[_0xe122('0x15')](function(_0x2e108c){logger[_0xe122('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x107275,_0xe122('0x17'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x107275,_0xe122('0x17'),JSON[_0xe122('0x18')](_0x2e108c));if(_0x2e108c[_0xe122('0x19')]){if(_0x2e108c['error'][_0xe122('0x1a')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x107275,_0x2e108c[_0xe122('0x19')][_0xe122('0x1b')]);return _0x5b6eca(_0x2e108c[_0xe122('0x19')][_0xe122('0x1b')]);}logger[_0xe122('0x19')](_0xe122('0x1c'),_0x107275,_0x2e108c[_0xe122('0x19')][_0xe122('0x1b')]);return _0x53ac86(_0x2e108c[_0xe122('0x19')][_0xe122('0x1b')]);}else{logger[_0xe122('0x16')](_0xe122('0x1c'),_0x107275,_0xe122('0x17'));_0x53ac86(_0x2e108c[_0xe122('0x1d')]['message']);}})['catch'](function(_0x3b1b94){logger[_0xe122('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x107275,_0x3b1b94);_0x5b6eca(_0x3b1b94);});});}function respondWithStatusCode(_0x1ce5b2,_0x50442b){_0x50442b=_0x50442b||0xcc;return function(_0x52fb3c){if(_0x52fb3c){return _0x1ce5b2[_0xe122('0x1e')](_0x50442b);}return _0x1ce5b2['status'](_0x50442b)['end']();};}function respondWithResult(_0x528286,_0x1a5dcd){_0x1a5dcd=_0x1a5dcd||0xc8;return function(_0x15b976){if(_0x15b976){return _0x528286['status'](_0x1a5dcd)['json'](_0x15b976);}};}function respondWithFilteredResult(_0x395e53,_0x3e8dd5){return function(_0x15b191){if(_0x15b191){var _0x17b034=typeof _0x3e8dd5[_0xe122('0x1f')]==='undefined'&&typeof _0x3e8dd5[_0xe122('0x20')]===_0xe122('0x21');var _0x32af81=_0x15b191[_0xe122('0x22')];var _0x3476a4=_0x17b034?0x0:_0x3e8dd5[_0xe122('0x1f')];var _0x305595=_0x17b034?_0x15b191['count']:_0x3e8dd5[_0xe122('0x1f')]+_0x3e8dd5[_0xe122('0x20')];var _0x5efbe0;if(_0x305595>=_0x32af81){_0x305595=_0x32af81;_0x5efbe0=0xc8;}else{_0x5efbe0=0xce;}_0x395e53[_0xe122('0x23')](_0x5efbe0);return _0x395e53[_0xe122('0x24')](_0xe122('0x25'),_0x3476a4+'-'+_0x305595+'/'+_0x32af81)[_0xe122('0x26')](_0x15b191);}return null;};}function saveUpdates(_0x1aa637){return function(_0x58864d){if(_0x58864d){return _0x58864d[_0xe122('0x27')](_0x1aa637)['then'](function(_0x49a215){return _0x49a215;});}return null;};}function removeEntity(_0x5d4bde){return function(_0x5c2ffd){if(_0x5c2ffd){return _0x5c2ffd[_0xe122('0x28')]()['then'](function(){var _0x3a0b6b=_0x5c2ffd[_0xe122('0x29')]({'plain':!![]});var _0x1a6107='ChatWebsites';return db[_0xe122('0x2a')][_0xe122('0x28')]({'where':{'type':_0x1a6107,'resourceId':_0x3a0b6b['id']}})[_0xe122('0x15')](function(){return _0x5c2ffd;});})[_0xe122('0x15')](function(){_0x5d4bde[_0xe122('0x23')](0xcc)[_0xe122('0x2b')]();});}};}function handleEntityNotFound(_0x28b3cf){return function(_0x56f28a){if(!_0x56f28a){_0x28b3cf[_0xe122('0x1e')](0x194);}return _0x56f28a;};}function handleError(_0x8b716c,_0x49d77c){_0x49d77c=_0x49d77c||0x1f4;return function(_0x241a48){logger[_0xe122('0x19')](_0x241a48['stack']);if(_0x241a48['name']){delete _0x241a48[_0xe122('0x2c')];}_0x8b716c['status'](_0x49d77c)[_0xe122('0x2d')](_0x241a48);};}exports['index']=function(_0x16bfca,_0x3fac5c){var _0x4600c2={'include':[{'model':db[_0xe122('0x2e')],'as':'mandatoryDispositionPause'}]},_0x66263={},_0x49a630={'count':0x0,'rows':[]};var _0x20393a=_['map'](db[_0xe122('0x2f')]['rawAttributes'],function(_0x495cc5){return{'name':_0x495cc5[_0xe122('0x30')],'type':_0x495cc5[_0xe122('0x31')][_0xe122('0x32')]};});_0x66263[_0xe122('0x33')]=_[_0xe122('0x34')](_0x20393a,_0xe122('0x2c'));_0x66263[_0xe122('0x35')]=_[_0xe122('0x36')](_0x16bfca[_0xe122('0x35')]);_0x66263['filters']=_[_0xe122('0x37')](_0x66263['model'],_0x66263[_0xe122('0x35')]);_0x4600c2[_0xe122('0x38')]=_[_0xe122('0x37')](_0x66263['model'],qs[_0xe122('0x39')](_0x16bfca[_0xe122('0x35')]['fields']));_0x4600c2[_0xe122('0x38')]=_0x4600c2[_0xe122('0x38')][_0xe122('0x3a')]?_0x4600c2['attributes']:_0x66263[_0xe122('0x33')];if(!_0x16bfca[_0xe122('0x35')]['hasOwnProperty'](_0xe122('0x3b'))){_0x4600c2[_0xe122('0x20')]=qs[_0xe122('0x20')](_0x16bfca[_0xe122('0x35')][_0xe122('0x20')]);_0x4600c2[_0xe122('0x1f')]=qs[_0xe122('0x1f')](_0x16bfca[_0xe122('0x35')][_0xe122('0x1f')]);}_0x4600c2[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x16bfca[_0xe122('0x35')][_0xe122('0x3d')]);_0x4600c2['where']=qs[_0xe122('0x3e')](_[_0xe122('0x3f')](_0x16bfca[_0xe122('0x35')],_0x66263[_0xe122('0x3e')]),_0x20393a);if(_0x16bfca[_0xe122('0x35')]['filter']){_0x4600c2['where']=_[_0xe122('0x40')](_0x4600c2[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x20393a,function(_0x499ab0){if(_0x499ab0['type']!==_0xe122('0x42')){var _0x89f193={};_0x89f193[_0x499ab0[_0xe122('0x2c')]]={'$like':'%'+_0x16bfca['query']['filter']+'%'};return _0x89f193;}})});}_0x4600c2=_['merge']({},_0x4600c2,_0x16bfca[_0xe122('0x43')]);var _0x4397a3={'where':_0x4600c2[_0xe122('0x41')]};return db[_0xe122('0x2f')][_0xe122('0x22')](_0x4397a3)['then'](function(_0x370e7a){_0x49a630[_0xe122('0x22')]=_0x370e7a;if(_0x16bfca[_0xe122('0x35')][_0xe122('0x44')]){_0x4600c2[_0xe122('0x45')]=[{'all':!![]}];}return db[_0xe122('0x2f')]['findAll'](_0x4600c2);})[_0xe122('0x15')](function(_0x1d4d02){_0x49a630['rows']=_0x1d4d02;return _0x49a630;})['then'](respondWithFilteredResult(_0x3fac5c,_0x4600c2))[_0xe122('0x46')](handleError(_0x3fac5c,null));};exports['show']=function(_0x7fcf8f,_0x933220){var _0x379c07={'raw':![],'where':{'id':_0x7fcf8f[_0xe122('0x47')]['id']},'include':[{'model':db[_0xe122('0x2e')],'as':_0xe122('0x48')}]},_0x25d977={};_0x25d977[_0xe122('0x33')]=_[_0xe122('0x36')](db[_0xe122('0x2f')]['rawAttributes']);_0x25d977['query']=_[_0xe122('0x36')](_0x7fcf8f['query']);_0x25d977[_0xe122('0x3e')]=_[_0xe122('0x37')](_0x25d977['model'],_0x25d977['query']);_0x379c07[_0xe122('0x38')]=_['intersection'](_0x25d977[_0xe122('0x33')],qs['fields'](_0x7fcf8f[_0xe122('0x35')][_0xe122('0x39')]));_0x379c07['attributes']=_0x379c07[_0xe122('0x38')]['length']?_0x379c07[_0xe122('0x38')]:_0x25d977[_0xe122('0x33')];if(_0x7fcf8f[_0xe122('0x35')]['includeAll']){_0x379c07[_0xe122('0x45')]=[{'all':!![]}];}_0x379c07=_['merge']({},_0x379c07,_0x7fcf8f[_0xe122('0x43')]);return db[_0xe122('0x2f')]['find'](_0x379c07)['then'](handleEntityNotFound(_0x933220,null))[_0xe122('0x15')](respondWithResult(_0x933220,null))[_0xe122('0x46')](handleError(_0x933220,null));};exports['create']=function(_0x11f13c,_0x30922d){return db[_0xe122('0x2f')][_0xe122('0x49')](_0x11f13c[_0xe122('0x4a')],{})['then'](function(_0x301669){var _0x1f8651=_0x11f13c[_0xe122('0x4b')][_0xe122('0x29')]({'plain':!![]});if(!_0x1f8651)throw new Error(_0xe122('0x4c'));if(_0x1f8651[_0xe122('0x4d')]===_0xe122('0x4b')){var _0x423b81=_0x301669['get']({'plain':!![]});var _0x2c7f9c=_0xe122('0x4e');return db[_0xe122('0x4f')][_0xe122('0x50')]({'where':{'name':_0x2c7f9c,'userProfileId':_0x1f8651[_0xe122('0x51')]},'raw':!![]})[_0xe122('0x15')](function(_0x821967){if(_0x821967&&_0x821967['autoAssociation']===0x0){return db[_0xe122('0x2a')][_0xe122('0x49')]({'name':_0x423b81[_0xe122('0x2c')],'resourceId':_0x423b81['id'],'type':_0x821967[_0xe122('0x2c')],'sectionId':_0x821967['id']},{})['then'](function(){return _0x301669;});}else{return _0x301669;}})['catch'](function(_0x3edb38){logger['error'](_0xe122('0x52'),_0x3edb38);throw _0x3edb38;});}return _0x301669;})['then'](respondWithResult(_0x30922d,0xc9))[_0xe122('0x46')](handleError(_0x30922d,null));};exports[_0xe122('0x27')]=function(_0x29a9d5,_0x31439a){if(_0x29a9d5[_0xe122('0x4a')]['id']){delete _0x29a9d5[_0xe122('0x4a')]['id'];}return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x29a9d5[_0xe122('0x47')]['id']},'include':[{'model':db[_0xe122('0x2e')],'as':_0xe122('0x48')}]})[_0xe122('0x15')](handleEntityNotFound(_0x31439a,null))[_0xe122('0x15')](saveUpdates(_0x29a9d5[_0xe122('0x4a')],null))['then'](respondWithResult(_0x31439a,null))[_0xe122('0x46')](handleError(_0x31439a,null));};exports[_0xe122('0x28')]=function(_0x3ade12,_0x359741){return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x3ade12[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x359741,null))['then'](removeEntity(_0x359741,null))[_0xe122('0x46')](handleError(_0x359741,null));};exports[_0xe122('0x53')]=function(_0x4c2ed7,_0x14418a){return db[_0xe122('0x2f')][_0xe122('0x53')]()['then'](respondWithResult(_0x14418a,null))[_0xe122('0x46')](handleError(_0x14418a,null));};exports[_0xe122('0x54')]=function(_0x179024,_0x3ee762){if(_0x179024['body']['id']){delete _0x179024[_0xe122('0x4a')]['id'];}return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x179024[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x3ee762,null))[_0xe122('0x15')](function(_0x551bd8){if(_0x551bd8){_0x179024['body']['ChatWebsiteId']=_0x551bd8['id'];return db[_0xe122('0x55')][_0xe122('0x49')](_0x179024[_0xe122('0x4a')]);}})[_0xe122('0x15')](respondWithResult(_0x3ee762,null))[_0xe122('0x46')](handleError(_0x3ee762,null));};exports[_0xe122('0x56')]=function(_0x3be372,_0x6661aa){var _0x558b1={'raw':![],'where':{}};var _0x4b811a={};var _0x18d28f={'count':0x0,'rows':[]};return db[_0xe122('0x2f')][_0xe122('0x57')]({'where':{'id':_0x3be372[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x6661aa,null))['then'](function(_0x563abf){if(_0x563abf){_0x4b811a[_0xe122('0x33')]=_['keys'](db[_0xe122('0x55')][_0xe122('0x58')]);_0x4b811a[_0xe122('0x35')]=_[_0xe122('0x36')](_0x3be372['query']);_0x4b811a[_0xe122('0x3e')]=_[_0xe122('0x37')](_0x4b811a[_0xe122('0x33')],_0x4b811a[_0xe122('0x35')]);_0x558b1[_0xe122('0x38')]=_[_0xe122('0x37')](_0x4b811a['model'],qs['fields'](_0x3be372[_0xe122('0x35')][_0xe122('0x39')]));_0x558b1[_0xe122('0x38')]=_0x558b1[_0xe122('0x38')][_0xe122('0x3a')]?_0x558b1['attributes']:_0x4b811a[_0xe122('0x33')];if(!_0x3be372[_0xe122('0x35')][_0xe122('0x59')](_0xe122('0x3b'))){_0x558b1[_0xe122('0x20')]=qs['limit'](_0x3be372[_0xe122('0x35')][_0xe122('0x20')]);_0x558b1[_0xe122('0x1f')]=qs['offset'](_0x3be372['query'][_0xe122('0x1f')]);}_0x558b1[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x3be372[_0xe122('0x35')][_0xe122('0x3d')]);_0x558b1['where']=qs[_0xe122('0x3e')](_[_0xe122('0x3f')](_0x3be372[_0xe122('0x35')],_0x4b811a[_0xe122('0x3e')]));_0x558b1['where']['ChatWebsiteId']=_0x563abf['id'];if(_0x3be372[_0xe122('0x35')][_0xe122('0x5a')]){_0x558b1[_0xe122('0x41')]=_['merge'](_0x558b1[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x558b1[_0xe122('0x38')],function(_0x2ad34e){var _0x202b50={};_0x202b50[_0x2ad34e]={'$like':'%'+_0x3be372['query'][_0xe122('0x5a')]+'%'};return _0x202b50;})});}_0x558b1=_[_0xe122('0x40')]({},_0x558b1,_0x3be372[_0xe122('0x43')]);return db['Disposition'][_0xe122('0x22')]({'where':_0x558b1[_0xe122('0x41')]})[_0xe122('0x15')](function(_0x5e25dc){_0x18d28f[_0xe122('0x22')]=_0x5e25dc;if(_0x3be372[_0xe122('0x35')]['includeAll']){_0x558b1[_0xe122('0x45')]=[{'all':!![]}];}return db['Disposition'][_0xe122('0x5b')](_0x558b1);})['then'](function(_0x3176e6){_0x18d28f['rows']=_0x3176e6;return _0x18d28f;});}})[_0xe122('0x15')](respondWithFilteredResult(_0x6661aa,_0x558b1))[_0xe122('0x46')](handleError(_0x6661aa,null));};exports[_0xe122('0x5c')]=function(_0x1a89f8,_0x36e959){return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x1a89f8[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x36e959,null))[_0xe122('0x15')](function(_0x5c068a){if(_0x5c068a){return _0x5c068a[_0xe122('0x5c')](_0x1a89f8[_0xe122('0x35')][_0xe122('0x5d')]);}})[_0xe122('0x15')](respondWithStatusCode(_0x36e959,null))[_0xe122('0x46')](handleError(_0x36e959,null));};exports[_0xe122('0x5e')]=function(_0x59dc95,_0x733959){if(_0x59dc95[_0xe122('0x4a')]['id']){delete _0x59dc95[_0xe122('0x4a')]['id'];}return db[_0xe122('0x2f')]['find']({'where':{'id':_0x59dc95[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x733959,null))[_0xe122('0x15')](function(_0x48e243){if(_0x48e243){_0x59dc95[_0xe122('0x4a')][_0xe122('0x5f')]=_0x48e243['id'];return db[_0xe122('0x60')][_0xe122('0x49')](_0x59dc95[_0xe122('0x4a')]);}})[_0xe122('0x15')](respondWithResult(_0x733959,null))[_0xe122('0x46')](handleError(_0x733959,null));};exports[_0xe122('0x61')]=function(_0x45994b,_0x1a6420){var _0x46590f={'raw':![],'where':{}};var _0x142a15={};var _0x5a4286={'count':0x0,'rows':[]};return db[_0xe122('0x2f')][_0xe122('0x57')]({'where':{'id':_0x45994b['params']['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x1a6420,null))[_0xe122('0x15')](function(_0x40ecb8){if(_0x40ecb8){_0x142a15[_0xe122('0x33')]=_[_0xe122('0x36')](db['CannedAnswer'][_0xe122('0x58')]);_0x142a15[_0xe122('0x35')]=_[_0xe122('0x36')](_0x45994b[_0xe122('0x35')]);_0x142a15[_0xe122('0x3e')]=_[_0xe122('0x37')](_0x142a15[_0xe122('0x33')],_0x142a15[_0xe122('0x35')]);_0x46590f[_0xe122('0x38')]=_[_0xe122('0x37')](_0x142a15['model'],qs['fields'](_0x45994b[_0xe122('0x35')]['fields']));_0x46590f[_0xe122('0x38')]=_0x46590f[_0xe122('0x38')][_0xe122('0x3a')]?_0x46590f[_0xe122('0x38')]:_0x142a15[_0xe122('0x33')];if(!_0x45994b[_0xe122('0x35')][_0xe122('0x59')](_0xe122('0x3b'))){_0x46590f['limit']=qs[_0xe122('0x20')](_0x45994b[_0xe122('0x35')][_0xe122('0x20')]);_0x46590f['offset']=qs['offset'](_0x45994b[_0xe122('0x35')][_0xe122('0x1f')]);}_0x46590f[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x45994b[_0xe122('0x35')]['sort']);_0x46590f[_0xe122('0x41')]=qs['filters'](_[_0xe122('0x3f')](_0x45994b[_0xe122('0x35')],_0x142a15[_0xe122('0x3e')]));_0x46590f[_0xe122('0x41')][_0xe122('0x5f')]=_0x40ecb8['id'];if(_0x45994b[_0xe122('0x35')][_0xe122('0x5a')]){_0x46590f[_0xe122('0x41')]=_[_0xe122('0x40')](_0x46590f[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x46590f[_0xe122('0x38')],function(_0x5c1aac){var _0x324c9f={};_0x324c9f[_0x5c1aac]={'$like':'%'+_0x45994b[_0xe122('0x35')]['filter']+'%'};return _0x324c9f;})});}_0x46590f=_['merge']({},_0x46590f,_0x45994b[_0xe122('0x43')]);return db[_0xe122('0x60')][_0xe122('0x22')]({'where':_0x46590f[_0xe122('0x41')]})[_0xe122('0x15')](function(_0x496ba3){_0x5a4286[_0xe122('0x22')]=_0x496ba3;if(_0x45994b[_0xe122('0x35')][_0xe122('0x44')]){_0x46590f[_0xe122('0x45')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x46590f);})[_0xe122('0x15')](function(_0xbcd2a0){_0x5a4286[_0xe122('0x62')]=_0xbcd2a0;return _0x5a4286;});}})[_0xe122('0x15')](respondWithFilteredResult(_0x1a6420,_0x46590f))[_0xe122('0x46')](handleError(_0x1a6420,null));};exports[_0xe122('0x63')]=function(_0x787fee,_0x4060ee){return db['ChatWebsite'][_0xe122('0x50')]({'where':{'id':_0x787fee[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x4060ee,null))[_0xe122('0x15')](function(_0x1014b1){if(_0x1014b1){return _0x1014b1[_0xe122('0x63')](_0x787fee[_0xe122('0x35')][_0xe122('0x5d')]);}})['then'](respondWithStatusCode(_0x4060ee,null))[_0xe122('0x46')](handleError(_0x4060ee,null));};exports[_0xe122('0x64')]=function(_0x44f978,_0x395a67){_0x44f978[_0xe122('0x4a')]['sitepic']=_0x44f978[_0xe122('0x65')][_0xe122('0x66')];return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x44f978[_0xe122('0x47')]['id']}})['then'](handleEntityNotFound(_0x395a67,null))['then'](saveUpdates(_0x44f978[_0xe122('0x4a')],null))[_0xe122('0x15')](respondWithResult(_0x395a67,null))[_0xe122('0x46')](handleError(_0x395a67,null));};exports[_0xe122('0x67')]=function(_0x46f2a5,_0x6cc977){_0x46f2a5[_0xe122('0x4a')]['agentAvatar']=_0x46f2a5[_0xe122('0x65')][_0xe122('0x66')];return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x46f2a5[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x6cc977,null))['then'](saveUpdates(_0x46f2a5['body'],null))[_0xe122('0x15')](respondWithResult(_0x6cc977,null))[_0xe122('0x46')](handleError(_0x6cc977,null));};exports[_0xe122('0x68')]=function(_0x5ac376,_0x3615f2){_0x5ac376[_0xe122('0x4a')][_0xe122('0x69')]=_0x5ac376['file'][_0xe122('0x66')];return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x5ac376[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x3615f2,null))['then'](saveUpdates(_0x5ac376['body'],null))[_0xe122('0x15')](respondWithResult(_0x3615f2,null))['catch'](handleError(_0x3615f2,null));};exports[_0xe122('0x6a')]=function(_0x5dfc4d,_0x3384a5){_0x5dfc4d['body'][_0xe122('0x6b')]=_0x5dfc4d[_0xe122('0x65')]['filename'];return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x5dfc4d[_0xe122('0x47')]['id']}})['then'](handleEntityNotFound(_0x3384a5,null))[_0xe122('0x15')](saveUpdates(_0x5dfc4d['body'],null))[_0xe122('0x15')](respondWithResult(_0x3384a5,null))[_0xe122('0x46')](handleError(_0x3384a5,null));};exports['getLogo']=function(_0x577ebc,_0x27f132){var _0x1e8a0a=path[_0xe122('0x6c')](config[_0xe122('0x6d')],'server/files/images/logos/default_logo.svg');var _0x30c877={'where':{'id':_0x577ebc[_0xe122('0x47')]['id']},'attributes':['id',_0xe122('0x6e')],'raw':!![]};var _0x98f920=![];return require(_0xe122('0x6f'))[_0xe122('0x70')]()[_0xe122('0x15')](function(_0x28ae7c){if(_0x28ae7c){_0x98f920=_0x28ae7c[_0xe122('0x71')];}})['then'](function(){return db['ChatWebsite']['find'](_0x30c877);})[_0xe122('0x15')](handleEntityNotFound(_0x27f132,null))['then'](function(_0x30a945){if(_0x30a945){if(!_['isNil'](_0x30a945['sitepic'])){if(fs[_0xe122('0x72')](path[_0xe122('0x6c')](config[_0xe122('0x6d')],_0xe122('0x73'),_0x30a945[_0xe122('0x6e')]))&&_0x98f920){_0x1e8a0a=path[_0xe122('0x6c')](config['root'],_0xe122('0x73'),_0x30a945['sitepic']);}}return _0x27f132['download'](_0x1e8a0a);}})[_0xe122('0x46')](handleError(_0x27f132,null));};exports[_0xe122('0x74')]=function(_0x1a2edc,_0x24b2be){var _0x312108=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x414a6f={'where':{'id':_0x1a2edc[_0xe122('0x47')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe122('0x2f')]['find'](_0x414a6f)[_0xe122('0x15')](handleEntityNotFound(_0x24b2be,null))[_0xe122('0x15')](function(_0x59b636){if(_0x59b636){if(!_[_0xe122('0x75')](_0x59b636[_0xe122('0x76')])){if(fs[_0xe122('0x72')](path[_0xe122('0x6c')](config[_0xe122('0x6d')],'server/files/images/avatars/',_0x59b636[_0xe122('0x76')]))){_0x312108=path['join'](config[_0xe122('0x6d')],_0xe122('0x77'),_0x59b636[_0xe122('0x76')]);}}return _0x24b2be['download'](_0x312108);}})[_0xe122('0x46')](handleError(_0x24b2be,null));};exports[_0xe122('0x78')]=function(_0x4b821a,_0x4d068b){var _0x4a9cb7=path[_0xe122('0x6c')](config[_0xe122('0x6d')],_0xe122('0x79'));var _0x300e81={'where':{'id':_0x4b821a['params']['id']},'attributes':['id',_0xe122('0x69'),_0xe122('0x7a')],'raw':!![]};return db['ChatWebsite']['find'](_0x300e81)['then'](handleEntityNotFound(_0x4d068b,null))[_0xe122('0x15')](function(_0x21ead6){if(_0x21ead6){if(!_[_0xe122('0x75')](_0x21ead6[_0xe122('0x69')])){if(fs[_0xe122('0x72')](path[_0xe122('0x6c')](config[_0xe122('0x6d')],'server/files/images/avatars/',_0x21ead6['customerAvatar']))&&_0x21ead6['showCustomerAvatar']){_0x4a9cb7=path[_0xe122('0x6c')](config['root'],_0xe122('0x77'),_0x21ead6['customerAvatar']);}}return _0x4d068b[_0xe122('0x7b')](_0x4a9cb7);}})['catch'](handleError(_0x4d068b,null));};exports['getSystemAvatar']=function(_0x261afe,_0x503670){var _0x2076e2=path[_0xe122('0x6c')](config[_0xe122('0x6d')],_0xe122('0x7c'));var _0x53e60c={'where':{'id':_0x261afe['params']['id']},'attributes':['id',_0xe122('0x6b')],'raw':!![]};return db['ChatWebsite'][_0xe122('0x50')](_0x53e60c)['then'](handleEntityNotFound(_0x503670,null))[_0xe122('0x15')](function(_0x5a7b0c){if(_0x5a7b0c){if(!_[_0xe122('0x75')](_0x5a7b0c[_0xe122('0x6b')])){if(fs[_0xe122('0x72')](path[_0xe122('0x6c')](config['root'],'server/files/images/avatars/',_0x5a7b0c[_0xe122('0x6b')]))){_0x2076e2=path['join'](config[_0xe122('0x6d')],'server/files/images/avatars/',_0x5a7b0c[_0xe122('0x6b')]);}}return _0x503670[_0xe122('0x7b')](_0x2076e2);}})[_0xe122('0x46')](handleError(_0x503670,null));};exports['notify']=function(_0x41148a,_0x4fc61c){var _0x1f99a7=require(_0xe122('0x7d'));var _0x37fdcc=new _0x1f99a7();var _0x4d47a6=_0x37fdcc['setUA'](_0x41148a[_0xe122('0x7e')][_0xe122('0x7f')])[_0xe122('0x80')]();var _0x16c643={'body':_0x41148a['body'],'channel':_0xe122('0x81')};var _0x748177=[];var _0x31d2e6=[];var _0x1437e2={};var _0x574fb5=![];return db[_0xe122('0x82')][_0xe122('0x53')]()[_0xe122('0x15')](function(_0x355d2b){if(!_0x355d2b){throw new db[(_0xe122('0x83'))][(_0xe122('0x84'))](_0xe122('0x85'));}_0x748177=_[_0xe122('0x86')](_[_0xe122('0x36')](_0x355d2b),[_0xe122('0x87'),'updatedAt']);_0x31d2e6=_[_0xe122('0x86')](_[_0xe122('0x36')](_0x355d2b),[_0xe122('0x87'),_0xe122('0x88'),_0xe122('0x89'),_0xe122('0x8a')]);if(_0x41148a[_0xe122('0x4a')]['id']){delete _0x41148a[_0xe122('0x4a')]['id'];}if(_[_0xe122('0x75')](_0x41148a[_0xe122('0x4a')][_0xe122('0x8b')])){throw new db['Sequelize'][(_0xe122('0x84'))]('from\x20is\x20mandatory');}if(_[_0xe122('0x75')](_0x41148a[_0xe122('0x4a')][_0xe122('0x4a')])||_0x41148a[_0xe122('0x4a')][_0xe122('0x4a')]===''){throw new db[(_0xe122('0x83'))][(_0xe122('0x84'))](_0xe122('0x8c'));}if(_[_0xe122('0x75')](_0x41148a['body']['mapKey'])){throw new db['Sequelize'][(_0xe122('0x84'))](_0xe122('0x8d')+_0x31d2e6);}if(!_[_0xe122('0x8e')](_0x31d2e6,_0x41148a[_0xe122('0x4a')][_0xe122('0x8f')])){throw new db[(_0xe122('0x83'))][(_0xe122('0x84'))](_0xe122('0x90')+_0x31d2e6);}_0x1437e2[_0x41148a[_0xe122('0x4a')][_0xe122('0x8f')]]=_0x41148a[_0xe122('0x4a')][_0xe122('0x8b')];})['then'](function(){return db[_0xe122('0x2f')]['find']({'where':{'id':_0x41148a[_0xe122('0x47')]['id']},'include':[{'model':db[_0xe122('0x91')],'as':_0xe122('0x92'),'include':[{'model':db[_0xe122('0x82')],'as':'Contacts','where':_0x1437e2,'limit':0x1,'order':[[_0xe122('0x88'),_0xe122('0x93')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0xe122('0x15')](handleEntityNotFound(_0x4fc61c,null))['then'](function(_0x1d47d0){if(_0x1d47d0&&_0x1d47d0[_0xe122('0x92')]){_0x16c643[_0xe122('0x94')]=_0x1d47d0;_0x16c643['applications']=_0x1d47d0[_0xe122('0x95')];_0x16c643[_0xe122('0x96')]=_0x1d47d0[_0xe122('0x92')];_0x16c643['applications']=_['orderBy'](_0x16c643['applications'],[_0xe122('0x97')],[_0xe122('0x98')]);if(_0x16c643[_0xe122('0x94')][_0xe122('0x95')]){delete _0x16c643[_0xe122('0x94')][_0xe122('0x95')];}if(_0x16c643['account'][_0xe122('0x92')]&&_0x16c643[_0xe122('0x94')]['List']['Contacts'][_0xe122('0x3a')]){return _0x16c643[_0xe122('0x94')]['List']['Contacts'][0x0];}var _0x5ac305=_[_0xe122('0xd')](_0x41148a[_0xe122('0x4a')],{'firstName':_0x41148a['body'][_0xe122('0x8b')],'ListId':_0x1d47d0[_0xe122('0x8a')]});_0x5ac305[_0x41148a[_0xe122('0x4a')][_0xe122('0x8f')]]=_0x41148a[_0xe122('0x4a')]['from'];return db[_0xe122('0x82')][_0xe122('0x49')](_0x5ac305,{'fields':_0x748177,'raw':!![]});}})[_0xe122('0x15')](handleEntityNotFound(_0x4fc61c,null))['then'](function(_0x8e2bc){_0x16c643[_0xe122('0x99')]=_0x8e2bc;var _0x39025e=_0x41148a[_0xe122('0x4a')]['customerIp'];if(_0x41148a[_0xe122('0x7e')]['cf-connecting-ip']){_0x39025e=_0x41148a[_0xe122('0x7e')][_0xe122('0x9a')];}else if(_0x41148a['headers'][_0xe122('0x9b')]){_0x39025e=_[_0xe122('0x9c')](_0x41148a[_0xe122('0x7e')][_0xe122('0x9b')]['split'](','));}if(_0x8e2bc){var _0x20a622={'ContactId':_0x8e2bc['id'],'ChatWebsiteId':_0x41148a[_0xe122('0x47')]['id'],'from':(_0x8e2bc[_0xe122('0x9d')]||'')+'\x20'+(_0x8e2bc[_0xe122('0x9e')]||''),'customerIp':_0x39025e,'customerPort':_0x41148a['headers'][_0xe122('0x9f')]?_0x41148a['headers'][_0xe122('0x9f')]:null,'referer':_0x41148a[_0xe122('0x4a')]['referer'],'browserName':_0x4d47a6[_0xe122('0xa0')]['name']&&_0x4d47a6['browser'][_0xe122('0xa1')]?util[_0xe122('0xa2')](_0xe122('0xa3'),_0x4d47a6['browser']['name'],_0x4d47a6['browser'][_0xe122('0xa1')]):'unknown','browserVersion':_0x4d47a6[_0xe122('0xa0')][_0xe122('0xa1')]||_0xe122('0xa4'),'osName':util[_0xe122('0xa2')](_0xe122('0xa3'),_0x4d47a6['os'][_0xe122('0x2c')],_0x4d47a6['os'][_0xe122('0xa1')]),'osVersion':_0x4d47a6['os'][_0xe122('0xa1')],'deviceModel':_0x4d47a6[_0xe122('0xa5')][_0xe122('0x33')]&&_0x4d47a6['device'][_0xe122('0xa6')]?util[_0xe122('0xa2')](_0xe122('0xa7'),_0x4d47a6[_0xe122('0xa5')][_0xe122('0x33')],_0x4d47a6[_0xe122('0xa5')]['vendor'],_0x4d47a6[_0xe122('0xa5')][_0xe122('0x31')]):null,'deviceVendor':_0x4d47a6[_0xe122('0xa5')][_0xe122('0xa6')],'deviceType':_0x4d47a6[_0xe122('0xa5')][_0xe122('0x31')],'formData':JSON[_0xe122('0x18')](_0x41148a[_0xe122('0x4a')])};var _0x2483da={'ChatWebsiteId':_0x41148a[_0xe122('0x47')]['id'],'closed':![]};if(_0x41148a['body']['threadId']){_0x2483da['threadId']=_0x41148a['body'][_0xe122('0xa8')];return db[_0xe122('0xa9')]['find']({'where':_0x2483da})[_0xe122('0x15')](function(_0x21e9e6){if(_0x21e9e6){return[_0x21e9e6,![]];}_0x20a622['threadId']=_0x41148a[_0xe122('0x4a')][_0xe122('0xa8')];_0x20a622[_0xe122('0xaa')]=_0x41148a['body'][_0xe122('0xaa')];return db[_0xe122('0xa9')][_0xe122('0x49')](_0x20a622)[_0xe122('0x15')](function(_0x54f8d0){return[_0x54f8d0,!![]];});});}_0x2483da[_0xe122('0xab')]=_0x8e2bc['id'];if(_0x41148a[_0xe122('0x4a')][_0xe122('0xac')]&&_0x41148a[_0xe122('0x4a')][_0xe122('0xac')]['id']){_0x2483da['id']=_0x41148a['body'][_0xe122('0xac')]['id'];return db[_0xe122('0xa9')]['find']({'where':_0x2483da})[_0xe122('0x15')](function(_0x1251e5){if(_0x1251e5){return[_0x1251e5,![]];}return db[_0xe122('0xa9')]['create'](_0x20a622)['then'](function(_0x3db911){return[_0x3db911,!![]];});});}return db[_0xe122('0xa9')][_0xe122('0x49')](_0x20a622)[_0xe122('0x15')](function(_0x563c1a){return[_0x563c1a,!![]];});}})['spread'](function(_0x23dd7f,_0x47f8b4){if(_0x23dd7f){_0x574fb5=_0x47f8b4;if(!_0x47f8b4){var _0x36b89e={'from':(_0x16c643[_0xe122('0x99')][_0xe122('0x9d')]||'')+'\x20'+(_0x16c643[_0xe122('0x99')]['lastName']||'')};if(_0x41148a[_0xe122('0x4a')][_0xe122('0xa8')]&&_0x41148a['body'][_0xe122('0xad')]&&_0x41148a[_0xe122('0x4a')][_0xe122('0xa8')]!=_0x41148a[_0xe122('0x4a')][_0xe122('0xad')]){_0x36b89e[_0xe122('0xa8')]=_0x41148a['body']['messageId'];}return _0x23dd7f[_0xe122('0x27')](_0x36b89e);}else{return _0x23dd7f;}}})[_0xe122('0x15')](function(_0x34202e){_0x16c643[_0xe122('0xac')]=_0x34202e[_0xe122('0x29')]({'plain':!![]});_0x16c643[_0xe122('0xac')][_0xe122('0xae')]=_0x574fb5;if(_0x16c643[_0xe122('0xac')][_0xe122('0xae')]){if(_0x16c643[_0xe122('0x94')]['autoclose']){_0x16c643['applications'][_0xe122('0xaf')]({'id':0x0,'priority':_0x16c643[_0xe122('0xb0')][_0xe122('0x3a')]+0x1,'app':_0xe122('0xb1'),'appdata':_0xe122('0xb2'),'interval':_0xe122('0xb3')});}}return db[_0xe122('0xb4')][_0xe122('0x49')]({'body':_0x41148a['body']['body'],'ChatWebsiteId':_0x41148a['params']['id'],'ChatInteractionId':_0x34202e['id'],'direction':'in','ContactId':_0x16c643['contact']['id'],'AttachmentId':_0x41148a['body'][_0xe122('0xb5')]});})[_0xe122('0x15')](function(_0x34131f){_0x16c643[_0xe122('0x1b')]=_0x34131f;if(_0x16c643[_0xe122('0xac')][_0xe122('0xb6')]){return db[_0xe122('0xb7')][_0xe122('0x50')]({'attributes':['id',_0xe122('0x2c')],'where':{'id':_0x16c643['interaction'][_0xe122('0xb6')]}})['then'](function(_0x96e7b5){if(_0x96e7b5){_0x16c643[_0xe122('0xb0')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe122('0xb8'),'appdata':_0x96e7b5[_0xe122('0x2c')]+','+(_0x16c643[_0xe122('0x94')][_0xe122('0xb9')]||0xa),'interval':_0xe122('0xb3')});_0x16c643[_0xe122('0xba')]=!![];}return respondWithRpcPromise(_0xe122('0xbb'),_0xe122('0xbc'),_0x16c643);});}return respondWithRpcPromise(_0xe122('0xbb'),_0xe122('0xbc'),_0x16c643);})[_0xe122('0x15')](function(_0x254341){respondWithRpcPromise(_0xe122('0xbd'),'EventManager',{'event':_0xe122('0xbe'),'message':_0x254341},client9002);return _0x254341;})[_0xe122('0x15')](respondWithResult(_0x4fc61c,null))[_0xe122('0x46')](handleError(_0x4fc61c,null));};exports['offline']=function(_0x50c304,_0x3e63c4){var _0x3e4880,_0x5ddf33,_0x1353b3;var _0x444fc3=[];var _0x379553={};var _0x242477=_0x50c304['files']||[];var _0x18d8d2=[];var _0x31ddfe;return db[_0xe122('0x82')][_0xe122('0x53')]()[_0xe122('0x15')](function(_0x9e219b){if(!_0x9e219b){throw new db[(_0xe122('0x83'))]['ValidationError'](_0xe122('0x85'));}_0x444fc3=_[_0xe122('0x86')](_['keys'](_0x9e219b),[_0xe122('0x87'),'updatedAt',_0xe122('0x89'),_0xe122('0x8a')]);if(_0x50c304[_0xe122('0x4a')]['id']){delete _0x50c304[_0xe122('0x4a')]['id'];}if(_[_0xe122('0x75')](_0x50c304['body'][_0xe122('0x8b')])){throw _0x3e63c4['status'](0x1f4)[_0xe122('0x2d')](new db[(_0xe122('0x83'))][(_0xe122('0x84'))](_0xe122('0xbf')));}if(_[_0xe122('0x75')](_0x50c304[_0xe122('0x4a')]['body'])||_0x50c304[_0xe122('0x4a')]['body']===''){throw _0x3e63c4[_0xe122('0x23')](0x1f4)[_0xe122('0x2d')](new db[(_0xe122('0x83'))][(_0xe122('0x84'))](_0xe122('0x8c')));}if(_[_0xe122('0x75')](_0x50c304['body']['mapKeyOffline'])){throw _0x3e63c4['status'](0x1f4)[_0xe122('0x2d')](new db[(_0xe122('0x83'))][(_0xe122('0x84'))](_0xe122('0xc0')+_0x444fc3));}if(!_['includes'](_0x444fc3,_0x50c304['body'][_0xe122('0xc1')])){throw _0x3e63c4[_0xe122('0x23')](0x1f4)[_0xe122('0x2d')](new db['Sequelize']['ValidationError'](_0xe122('0xc2')+_0x444fc3));}_0x379553[_0x50c304['body'][_0xe122('0xc1')]]=_0x50c304[_0xe122('0x4a')][_0xe122('0x8b')];})['then'](function(){return db[_0xe122('0x2f')]['find']({'where':{'id':_0x50c304[_0xe122('0x47')]['id']},'include':[{'model':db[_0xe122('0x91')],'as':_0xe122('0x92')},{'model':db[_0xe122('0xc3')],'as':_0xe122('0xc3')}]});})[_0xe122('0x15')](handleEntityNotFound(_0x3e63c4,null))[_0xe122('0x15')](function(_0x53865b){if(_0x53865b&&_0x53865b['List']){_0x5ddf33=_0x53865b;var _0x11ac63=_['defaults'](_0x50c304[_0xe122('0x4a')],{'firstName':_0x50c304[_0xe122('0x4a')]['from'],'phone':_0x50c304[_0xe122('0x4a')][_0xe122('0x8b')],'ListId':_0x53865b['ListId']});_0x11ac63[_0x50c304['body'][_0xe122('0xc1')]]=_0x50c304[_0xe122('0x4a')]['from'];return db[_0xe122('0x82')][_0xe122('0xc4')]({'where':_0x379553,'defaults':_0x11ac63});}})['spread'](function(_0x57b8fc){if(_0x57b8fc){_0x1353b3=_0x57b8fc;var _0x251989=fs[_0xe122('0xc5')](path[_0xe122('0x6c')](config['root'],_0xe122('0xc6')),_0xe122('0xc7'));var _0x504651=ejs[_0xe122('0xc8')](_0x251989,{'body':_[_0xe122('0xc9')](_0x50c304['body'][_0xe122('0x4a')]),'bodyTitle':_0x5ddf33['offlineMessageBody']});return db[_0xe122('0xca')][_0xe122('0x49')]({'body':_0x504651,'plainBody':htmlToText[_0xe122('0xcb')](_0x504651),'ContactId':_0x57b8fc['id'],'ChatWebsiteId':_0x5ddf33['id']});}})['then'](function(_0x56c9d3){_0x31ddfe=_0x56c9d3;if(_0x242477['length']){var _0x3b3f49=_0x242477['map'](function(_0x4b8af0){return{'name':_0x4b8af0[_0xe122('0xcc')],'basename':_0x4b8af0[_0xe122('0x66')],'type':_0x4b8af0[_0xe122('0xcd')],'ChatOfflineMessageId':_0x56c9d3['id']};});_0x18d8d2=_0x3b3f49[_0xe122('0x34')](_0x38c6fd=>{var _0x59e403={'filename':_0x38c6fd[_0xe122('0x2c')],'path':path[_0xe122('0x6c')](config[_0xe122('0x6d')],_0xe122('0xce'),_0xe122('0xcf'),'attachments',_0xe122('0xd0'),_0x38c6fd['basename'])};return _0x59e403;});if(!_0x5ddf33[_0xe122('0xd1')]){return db[_0xe122('0xd2')]['transaction'](function(_0x5aa508){return db['Attachment'][_0xe122('0xd3')](_0x3b3f49,{'transaction':_0x5aa508});});}}})[_0xe122('0x15')](function(){if(_0x31ddfe){_0x3e4880=_0x31ddfe;return db[_0xe122('0xc3')][_0xe122('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0xe122('0xd4')],'as':_0xe122('0xd5'),'raw':!![],'include':[{'model':db[_0xe122('0xd6')],'as':_0xe122('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x176641){if(_0x176641&&_0x176641[_0xe122('0xd5')]&&_0x5ddf33[_0xe122('0xd7')]&&_0x5ddf33[_0xe122('0xd8')]){var _0x20e0d9=_0x176641[_0xe122('0xd9')]();return respondWithRpcPromise('SendMail',_0xe122('0xda'),{'account':_0x20e0d9,'message':{'from':util[_0xe122('0xa2')](_0xe122('0xdb'),_0x176641[_0xe122('0x2c')],_0x176641[_0xe122('0xdc')]||_0x176641[_0xe122('0xd5')][_0xe122('0x4b')]),'to':_0x5ddf33[_0xe122('0xd8')],'subject':_0x5ddf33[_0xe122('0xdd')],'html':_0x3e4880[_0xe122('0x4a')],'attachments':_0x18d8d2}},client9003)[_0xe122('0x15')](function(){return _0x3e4880;})[_0xe122('0x46')](function(_0x529bb6){logger[_0xe122('0x19')](_0x529bb6);});}})[_0xe122('0x15')](function(){if(_0x5ddf33&&_0x5ddf33['openNewInteraction']&&_0x5ddf33['MailAccountId']){var _0x99dfba=[];if(_0x242477[_0xe122('0x3a')]){_0x99dfba=_0x242477[_0xe122('0x34')](function(_0x5b2c14){return{'name':_0x5b2c14[_0xe122('0xcc')],'basename':_0x5b2c14[_0xe122('0x66')],'type':_0x5b2c14['mimetype'],'ChatOfflineMessageId':_0x31ddfe['id']};});}var _0x3a49a5;if(!_[_0xe122('0x75')](_0x5ddf33[_0xe122('0xde')])){var _0x3dff60=_[_0xe122('0x34')](_0x50c304[_0xe122('0x4a')],function(_0x582847){return _0x582847;});var _0x10432e=_[_0xe122('0xdf')](_0x3dff60)[0x0];var _0x42bdc8=_['mapValues'](_0x10432e,function(_0xed96d1){return _0xed96d1;});_0x3a49a5=_0x42bdc8[0x1][_0x5ddf33[_0xe122('0xde')]];}var _0x43fa26={'from':_0x1353b3[_0xe122('0xdc')],'firstName':_0x1353b3[_0xe122('0x9d')],'lastName':_0x1353b3[_0xe122('0x9e')],'mapKey':_0xe122('0xdc'),'message':{'from':_0x1353b3['email'],'to':_0x5ddf33[_0xe122('0xc3')][_0xe122('0xdc')],'cc':'','subject':_[_0xe122('0x75')](_0x3a49a5)?_0x5ddf33['offlineMessageSubject']:_0x3a49a5,'messageId':'','sentAt':new Date(),'attach':_0x99dfba[_0xe122('0x3a')],'attachments':_0x99dfba,'originChannel':_0xe122('0xe0'),'ChatWebsiteId':_0x5ddf33['id'],'ChatOfflineMessageId':_0x3e4880['id'],'originTo':_0x5ddf33[_0xe122('0xc3')][_0xe122('0xdc')]},'body':_0x3e4880['body']};var _0x72974f={'account':{'id':_0x5ddf33[_0xe122('0xe1')]},'body':_0x43fa26,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xe122('0xe2'),_0xe122('0xe3'),_0x72974f,client9001)[_0xe122('0x15')](function(){return _0x3e4880;})[_0xe122('0x46')](function(_0x6673ff){logger[_0xe122('0x19')](_0x6673ff);});}return;})[_0xe122('0x15')](function(){if(_0x3e4880){return _0x3e4880;}})[_0xe122('0x15')](respondWithResult(_0x3e63c4,null))[_0xe122('0x46')](function(_0xe3fb9b){logger[_0xe122('0x19')](_0xe122('0x46'),_0xe3fb9b);for(var _0x464850 of _0x242477){var _0x46526c=path[_0xe122('0x6c')](config[_0xe122('0x6d')],_0xe122('0xce'),'files',_0xe122('0xe4'),_0xe122('0xd0'),_0x464850[_0xe122('0x66')]);fs_extra['remove'](_0x46526c)[_0xe122('0x46')](function(_0x1d468a){logger[_0xe122('0x19')](_0xe122('0xe5'),_0x46526c,_0x1d468a);});}});};exports[_0xe122('0xe6')]=function(_0x2ff7d9,_0x274c9d){return db[_0xe122('0xa9')][_0xe122('0x50')]({'where':{'id':_0x2ff7d9[_0xe122('0x47')]['id']}})['then'](handleEntityNotFound(_0x274c9d,null))[_0xe122('0x15')](function(_0x505d27){if(_0x505d27){return _0x505d27[_0xe122('0xe6')](_0x2ff7d9['body']['ids'],_['omit'](_0x2ff7d9[_0xe122('0x4a')],[_0xe122('0x5d'),'id'])||{});}})[_0xe122('0x15')](respondWithResult(_0x274c9d,null))[_0xe122('0x46')](handleError(_0x274c9d,null));};exports[_0xe122('0xe7')]=function(_0x133048,_0x1132e8){var _0x257293={'raw':![],'where':{}};var _0x3d920c={};var _0x5d4ca9={'count':0x0,'rows':[]};return db[_0xe122('0x2f')]['findOne']({'where':{'id':_0x133048['params']['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x1132e8,null))[_0xe122('0x15')](function(_0x3c65d2){if(_0x3c65d2){_0x3d920c['model']=_['keys'](db[_0xe122('0xa9')][_0xe122('0x58')]);_0x3d920c['query']=_[_0xe122('0x36')](_0x133048[_0xe122('0x35')]);_0x3d920c['filters']=_[_0xe122('0x37')](_0x3d920c[_0xe122('0x33')],_0x3d920c['query']);_0x257293[_0xe122('0x38')]=_[_0xe122('0x37')](_0x3d920c[_0xe122('0x33')],qs['fields'](_0x133048[_0xe122('0x35')][_0xe122('0x39')]));_0x257293[_0xe122('0x38')]=_0x257293[_0xe122('0x38')][_0xe122('0x3a')]?_0x257293[_0xe122('0x38')]:_0x3d920c['model'];if(!_0x133048['query'][_0xe122('0x59')](_0xe122('0x3b'))){_0x257293[_0xe122('0x20')]=qs['limit'](_0x133048[_0xe122('0x35')][_0xe122('0x20')]);_0x257293['offset']=qs['offset'](_0x133048[_0xe122('0x35')]['offset']);}_0x257293[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x133048[_0xe122('0x35')]['sort']);_0x257293['where']=qs['filters'](_['pick'](_0x133048[_0xe122('0x35')],_0x3d920c[_0xe122('0x3e')]));_0x257293[_0xe122('0x41')][_0xe122('0x5f')]=_0x3c65d2['id'];if(_0x133048['query'][_0xe122('0x5a')]){_0x257293[_0xe122('0x41')]=_[_0xe122('0x40')](_0x257293[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x257293[_0xe122('0x38')],function(_0x329f09){var _0x2107fc={};_0x2107fc[_0x329f09]={'$like':'%'+_0x133048[_0xe122('0x35')][_0xe122('0x5a')]+'%'};return _0x2107fc;})});}_0x257293=_[_0xe122('0x40')]({},_0x257293,_0x133048['options']);return db[_0xe122('0xa9')][_0xe122('0x22')]({'where':_0x257293['where']})['then'](function(_0x59850f){_0x5d4ca9['count']=_0x59850f;if(_0x133048[_0xe122('0x35')]['includeAll']){_0x257293['include']=[{'model':db[_0xe122('0x82')],'as':'Contact','required':![]},{'model':db[_0xe122('0xb7')],'as':_0xe122('0xe8'),'attributes':[_0xe122('0x2c'),_0xe122('0xe9'),_0xe122('0xea')],'required':![]},{'model':db[_0xe122('0xeb')],'as':_0xe122('0xec'),'attributes':['id',_0xe122('0x2c'),'color'],'where':_0x133048['query']['tag']?{'id':_0x133048[_0xe122('0x35')][_0xe122('0xed')]}:undefined,'required':_0x133048[_0xe122('0x35')][_0xe122('0xed')]?!![]:![]}];}return db[_0xe122('0xa9')]['findAll'](_0x257293);})[_0xe122('0x15')](function(_0x4d14bb){_0x5d4ca9['rows']=_0x4d14bb;return _0x5d4ca9;});}})['then'](respondWithFilteredResult(_0x1132e8,_0x257293))['catch'](handleError(_0x1132e8,null));};function iftimePromise(_0x4c7799,_0x137e2f){return respondWithRpcPromise(_0xe122('0xee'),'getSnippet',{'command':_0x137e2f[_0xe122('0xef')]?util[_0xe122('0xa2')](_0xe122('0xf0'),_0x4c7799['interval'],_0x137e2f['timezone']):util['format']('iftime\x20%s',_0x4c7799[_0xe122('0xf1')])},client9002)[_0xe122('0x15')](function(_0x397a6c){var _0x4ffce8=_0x397a6c&&_0x397a6c[_0xe122('0xf2')](_0xe122('0xf3'))>=0x0?!![]:![];logger[_0xe122('0x16')](_0xe122('0xf4'),_0x137e2f['id'],_0x4c7799['id'],_0x4c7799[_0xe122('0xf1')],_0x4ffce8?_0xe122('0xf5'):'OFFLINE',_0x137e2f[_0xe122('0xef')]?_0x137e2f['timezone']:_0xe122('0xf6'));return _0x4ffce8;})[_0xe122('0x46')](function(_0x35d7c4){logger[_0xe122('0x19')](_0xe122('0xf4'),_0x137e2f['id'],_0x4c7799['id'],_0x4c7799[_0xe122('0xf1')],util[_0xe122('0xf7')](_0x35d7c4,{'showHidden':![],'depth':null}),_0x137e2f[_0xe122('0xef')]?_0x137e2f[_0xe122('0xef')]:_0xe122('0xf6'));return![];});}exports[_0xe122('0xf8')]=function(_0x400cd1,_0x5530a9){var _0x51cd46=0x0;var _0x28fb5a=0x0;var _0x2e69d9=![];var _0x9eb196;var _0x2fe2f9;return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x400cd1[_0xe122('0x47')]['id']},'include':[{'model':db[_0xe122('0xf9')],'as':_0xe122('0xf9'),'include':[{'model':db[_0xe122('0xf9')],'as':_0xe122('0xfa'),'attributes':['id',_0xe122('0xf1')],'raw':!![]}]}]})[_0xe122('0x15')](handleEntityNotFound(_0x5530a9,null))['then'](function(_0x49c86b){if(_0x49c86b){_0x9eb196=_0x49c86b;return _0x49c86b['getProactiveActions']({'raw':!![]});}})['then'](function(_0x444770){if(_0x9eb196){if(_0x444770){_0x2fe2f9=_0x444770;}}return require(_0xe122('0x6f'))[_0xe122('0x70')]();})[_0xe122('0x15')](function(_0x473bef){if(_0x473bef){_0x28fb5a=_0x473bef['virtual'];_0x2e69d9=_0x473bef['custom'];}})['then'](function(){return db[_0xe122('0xa9')]['count']({'where':{'closed':![]}});})[_0xe122('0x15')](function(_0x2d1842){_0x51cd46=_0x2d1842;if(_0x28fb5a&&_0x2d1842>_0x28fb5a){return db[_0xe122('0xfb')]['findOne']({'where':{'id':0x1}})[_0xe122('0x15')](function(_0x38bb69){if(_0x38bb69){_0x38bb69[_0xe122('0xfc')](_0xe122('0xfd'));}});}})[_0xe122('0x15')](function(){if(_0x9eb196[_0xe122('0xf9')]&&_0x9eb196['Interval']['Intervals']){var _0x17dd97=[];for(var _0x81375e=0x0;_0x81375e<_0x9eb196[_0xe122('0xf9')][_0xe122('0xfa')][_0xe122('0x3a')];_0x81375e++){var _0x29edc8=_0x9eb196[_0xe122('0xf9')][_0xe122('0xfa')][_0x81375e][_0xe122('0x29')]({'plain':!![]});_0x17dd97[_0xe122('0xaf')](iftimePromise(_0x29edc8,_0x9eb196));}return BPromise[_0xe122('0xfe')](_0x17dd97)['then'](function(_0x3f1ad4){return _[_0xe122('0xff')](_0x3f1ad4);});}else{return!![];}})['then'](function(_0x2e12d7){var _0xe1f4c8=fs[_0xe122('0xc5')](path[_0xe122('0x6c')](config['root'],_0xe122('0x100')),'utf8');var _0x12df2c=new url[(_0xe122('0x101'))](_0x9eb196[_0xe122('0x102')])[_0xe122('0x103')];var _0x25596c=_0xe122('0x104');var _0x41cbd8=![];var _0x10cb0d={'chatVersion':_0x25596c,'chatWebsiteAddressOrigin':_0x12df2c,'remote':_0x9eb196[_0xe122('0x105')],'query':querystring[_0xe122('0x18')](_[_0xe122('0x40')](_0x9eb196[_0xe122('0x29')]({'plain':!![]}),{'customerIp':_0x400cd1[_0xe122('0x7e')][_0xe122('0x9b')]||_0x400cd1[_0xe122('0x7e')][_0xe122('0x106')]||_0x400cd1[_0xe122('0x107')][_0xe122('0x108')]||_0x400cd1['ip'],'referer':_0x400cd1[_0xe122('0x7e')][_0xe122('0x109')],'openedInteractions':_0x51cd46,'maxInteractions':_0x28fb5a,'virtual':_0x2e69d9[_0xe122('0x10a')],'online':_0x2e12d7,'custom':_0x2e69d9}))[_0xe122('0x10b')](/'/g,'\x5c\x27')};_0x5530a9[_0xe122('0x2d')](ejs[_0xe122('0xc8')](Mustache[_0xe122('0xc8')](_0xe1f4c8,_0x10cb0d),{'proactiveActions':_0x2fe2f9,'alignment':_0x9eb196[_0xe122('0x10c')],'verticalAlignment':_0x9eb196['verticalAlignment'],'div_color':_0x9eb196['color'],'labelText':_0x9eb196['labelText'],'text_color':_0x9eb196[_0xe122('0x10d')],'text_button_color':_0x9eb196[_0xe122('0x10e')],'button_color':_0x9eb196[_0xe122('0x10f')],'background_color':_0x9eb196[_0xe122('0x110')],'hideWhenOffline':_0x9eb196[_0xe122('0x111')],'intervalId':_0x9eb196[_0xe122('0x112')],'isDevelopment':_0x41cbd8,'chatVersion':_0x25596c}));})[_0xe122('0x46')](handleError(_0x5530a9,null));};exports[_0xe122('0x113')]=function(_0x5f3afe,_0x1e9c35){var _0x3892b2=_0x5f3afe[_0xe122('0x47')]['id'];var _0x53555e=_0x5f3afe[_0xe122('0x4a')];var _0x2963df=0xc8;var _0x45f76a=null;return db[_0xe122('0xd2')][_0xe122('0x114')]({'isolationLevel':db[_0xe122('0xd2')]['Transaction'][_0xe122('0x115')][_0xe122('0x116')]},function(_0x32d54c){return db['ChatWebsite']['findOne']({'where':{'id':_0x3892b2},'transaction':_0x32d54c})['then'](function(_0x2fa4ad){if(_0x2fa4ad){return db[_0xe122('0x117')][_0xe122('0x28')]({'where':{'ChatWebsiteId':_0x3892b2},'transaction':_0x32d54c})[_0xe122('0x15')](function(){var _0x4b8e94=_[_0xe122('0x34')](_0x53555e,function(_0x4f2ec0){_0x4f2ec0[_0xe122('0x5f')]=_0x3892b2;return _0x4f2ec0;});return db['ChatApplication'][_0xe122('0xd3')](_0x4b8e94,{'transaction':_0x32d54c});});}else{_0x2963df=0x194;_0x45f76a=[];}});})['then'](function(){if(_0x2963df!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x3892b2},'order':_0xe122('0x97')})[_0xe122('0x15')](function(_0x1c3790){_0x45f76a=_0x1c3790;});}})['catch'](function(_0x356218){_0x2963df=0x1f4;logger[_0xe122('0x19')](_0x356218[_0xe122('0x118')]);if(_0x356218[_0xe122('0x2c')]){delete _0x356218['name'];}_0x45f76a=_0x356218;})[_0xe122('0x119')](function(){if(_0x45f76a===null){_0x1e9c35[_0xe122('0x1e')](_0x2963df);}else{if(_0x2963df===0x1f4){_0x1e9c35['status'](_0x2963df)[_0xe122('0x2d')](_0x45f76a);}else{_0x1e9c35[_0xe122('0x23')](_0x2963df)['json'](_0x45f76a);}}});};exports[_0xe122('0x11a')]=function(_0x28e161,_0x25ea84){var _0x26980f={};var _0x1fd520={};var _0x9e253e;var _0x3cc701;return db['ChatWebsite'][_0xe122('0x57')]({'where':{'id':_0x28e161[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x25ea84,null))[_0xe122('0x15')](function(_0x1d8b4f){if(_0x1d8b4f){_0x9e253e=_0x1d8b4f;_0x1fd520[_0xe122('0x33')]=_[_0xe122('0x36')](db[_0xe122('0x117')][_0xe122('0x58')]);_0x1fd520[_0xe122('0x35')]=_[_0xe122('0x36')](_0x28e161[_0xe122('0x35')]);_0x1fd520[_0xe122('0x3e')]=_[_0xe122('0x37')](_0x1fd520[_0xe122('0x33')],_0x1fd520[_0xe122('0x35')]);_0x26980f[_0xe122('0x38')]=_['intersection'](_0x1fd520['model'],qs[_0xe122('0x39')](_0x28e161['query'][_0xe122('0x39')]));_0x26980f[_0xe122('0x38')]=_0x26980f['attributes'][_0xe122('0x3a')]?_0x26980f[_0xe122('0x38')]:_0x1fd520[_0xe122('0x33')];_0x26980f['order']=qs['sort'](_0x28e161['query'][_0xe122('0x3d')]);_0x26980f['where']=qs[_0xe122('0x3e')](_[_0xe122('0x3f')](_0x28e161[_0xe122('0x35')],_0x1fd520[_0xe122('0x3e')]));if(_0x28e161[_0xe122('0x35')][_0xe122('0x5a')]){_0x26980f[_0xe122('0x41')]=_[_0xe122('0x40')](_0x26980f[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x26980f['attributes'],function(_0x16dc16){var _0x29c57={};_0x29c57[_0x16dc16]={'$like':'%'+_0x28e161[_0xe122('0x35')]['filter']+'%'};return _0x29c57;})});}_0x26980f=_[_0xe122('0x40')]({},_0x26980f,_0x28e161[_0xe122('0x43')]);return _0x9e253e[_0xe122('0x11a')](_0x26980f);}})[_0xe122('0x15')](function(_0x3ee117){if(_0x3ee117){_0x3cc701=_0x3ee117[_0xe122('0x3a')];if(!_0x28e161[_0xe122('0x35')]['hasOwnProperty'](_0xe122('0x3b'))){_0x26980f[_0xe122('0x20')]=qs[_0xe122('0x20')](_0x28e161['query'][_0xe122('0x20')]);_0x26980f[_0xe122('0x1f')]=qs[_0xe122('0x1f')](_0x28e161[_0xe122('0x35')][_0xe122('0x1f')]);}return _0x9e253e[_0xe122('0x11a')](_0x26980f);}})[_0xe122('0x15')](function(_0x471fc9){if(_0x471fc9){return _0x471fc9?{'count':_0x3cc701,'rows':_0x471fc9}:null;}})[_0xe122('0x15')](respondWithResult(_0x25ea84,null))['catch'](handleError(_0x25ea84,null));};exports['addProactiveActions']=function(_0x4fc99a,_0x3d863e){return db[_0xe122('0x11b')][_0xe122('0x50')]({'where':{'id':_0x4fc99a[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x3d863e,null))[_0xe122('0x15')](function(_0x35cc0e){if(_0x35cc0e){return _0x35cc0e['addProactiveActions'](_0x4fc99a[_0xe122('0x4a')]['ids'],_[_0xe122('0x11c')](_0x4fc99a['body'],[_0xe122('0x5d'),'id'])||{});}})[_0xe122('0x15')](respondWithResult(_0x3d863e,null))['catch'](handleError(_0x3d863e,null));};exports[_0xe122('0x11d')]=function(_0x5236d6,_0x578e52){var _0x152d08={};var _0x4c9b41={};var _0x533a4a;var _0x7b623a;return db[_0xe122('0x2f')][_0xe122('0x57')]({'where':{'id':_0x5236d6[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x578e52,null))[_0xe122('0x15')](function(_0x5716b4){if(_0x5716b4){_0x533a4a=_0x5716b4;_0x4c9b41['model']=_[_0xe122('0x36')](db[_0xe122('0x11e')][_0xe122('0x58')]);_0x4c9b41['query']=_[_0xe122('0x36')](_0x5236d6[_0xe122('0x35')]);_0x4c9b41[_0xe122('0x3e')]=_[_0xe122('0x37')](_0x4c9b41[_0xe122('0x33')],_0x4c9b41[_0xe122('0x35')]);_0x152d08[_0xe122('0x38')]=_[_0xe122('0x37')](_0x4c9b41[_0xe122('0x33')],qs[_0xe122('0x39')](_0x5236d6[_0xe122('0x35')][_0xe122('0x39')]));_0x152d08[_0xe122('0x38')]=_0x152d08['attributes'][_0xe122('0x3a')]?_0x152d08[_0xe122('0x38')]:_0x4c9b41[_0xe122('0x33')];_0x152d08[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x5236d6[_0xe122('0x35')][_0xe122('0x3d')]);_0x152d08[_0xe122('0x41')]=qs[_0xe122('0x3e')](_['pick'](_0x5236d6['query'],_0x4c9b41[_0xe122('0x3e')]));if(_0x5236d6[_0xe122('0x35')]['filter']){_0x152d08[_0xe122('0x41')]=_['merge'](_0x152d08[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x152d08[_0xe122('0x38')],function(_0x2a7df5){var _0x1063f2={};_0x1063f2[_0x2a7df5]={'$like':'%'+_0x5236d6[_0xe122('0x35')]['filter']+'%'};return _0x1063f2;})});}_0x152d08=_[_0xe122('0x40')]({},_0x152d08,_0x5236d6[_0xe122('0x43')]);return _0x533a4a[_0xe122('0x11d')](_0x152d08);}})['then'](function(_0xe37058){if(_0xe37058){_0x7b623a=_0xe37058[_0xe122('0x3a')];if(!_0x5236d6[_0xe122('0x35')][_0xe122('0x59')]('nolimit')){_0x152d08[_0xe122('0x20')]=qs['limit'](_0x5236d6['query'][_0xe122('0x20')]);_0x152d08[_0xe122('0x1f')]=qs['offset'](_0x5236d6['query'][_0xe122('0x1f')]);}return _0x533a4a[_0xe122('0x11d')](_0x152d08);}})[_0xe122('0x15')](function(_0x122097){if(_0x122097){return _0x122097?{'count':_0x7b623a,'rows':_0x122097}:null;}})['then'](respondWithResult(_0x578e52,null))[_0xe122('0x46')](handleError(_0x578e52,null));};exports[_0xe122('0x11f')]=function(_0xfeccfc,_0x2655ef){var _0x5de392=_0xfeccfc[_0xe122('0x35')][_0xe122('0x120')]==='false'?_0xe122('0x121'):_0xe122('0x122');return db[_0xe122('0x2f')][_0xe122('0x50')]({'attributes':['id',_0x5de392],'where':{'id':_0xfeccfc[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x2655ef,null))['then'](function(_0x2b10dc){if(_0x2b10dc){var _0x4faffd=_0x2b10dc[_0x5de392];var _0x467e77=_0x4faffd&&_0x4faffd[_0xe122('0x123')]?_0x4faffd[_0xe122('0x123')]:[];_0x2655ef['send']({'fromKey':_[_0xe122('0x75')](_0x4faffd[_0xe122('0x124')])?undefined:_0x4faffd[_0xe122('0x124')],'count':_0x467e77[_0xe122('0x3a')],'rows':_0x467e77});}})[_0xe122('0x46')](handleError(_0x2655ef,null));};exports[_0xe122('0x125')]=function(_0x417aa7,_0x1c59c9){var _0x51f281={'raw':![],'where':{}};var _0x3cb42f={};var _0x20935d={'count':0x0,'rows':[]};return db[_0xe122('0x2f')]['findOne']({'where':{'id':_0x417aa7[_0xe122('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c59c9,null))[_0xe122('0x15')](function(_0x19af0f){if(_0x19af0f){_0x3cb42f[_0xe122('0x33')]=_['keys'](db[_0xe122('0xca')][_0xe122('0x58')]);_0x3cb42f[_0xe122('0x35')]=_[_0xe122('0x36')](_0x417aa7['query']);_0x3cb42f['filters']=_[_0xe122('0x37')](_0x3cb42f[_0xe122('0x33')],_0x3cb42f[_0xe122('0x35')]);_0x51f281['attributes']=_[_0xe122('0x37')](_0x3cb42f['model'],qs[_0xe122('0x39')](_0x417aa7[_0xe122('0x35')][_0xe122('0x39')]));_0x51f281[_0xe122('0x38')]=_0x51f281[_0xe122('0x38')][_0xe122('0x3a')]?_0x51f281['attributes']:_0x3cb42f['model'];if(!_0x417aa7[_0xe122('0x35')][_0xe122('0x59')](_0xe122('0x3b'))){_0x51f281[_0xe122('0x20')]=qs[_0xe122('0x20')](_0x417aa7['query']['limit']);_0x51f281[_0xe122('0x1f')]=qs['offset'](_0x417aa7['query'][_0xe122('0x1f')]);}_0x51f281[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x417aa7[_0xe122('0x35')]['sort']);_0x51f281[_0xe122('0x41')]=qs[_0xe122('0x3e')](_[_0xe122('0x3f')](_0x417aa7[_0xe122('0x35')],_0x3cb42f[_0xe122('0x3e')]));_0x51f281[_0xe122('0x41')][_0xe122('0x5f')]=_0x19af0f['id'];if(_0x417aa7[_0xe122('0x35')][_0xe122('0x5a')]){_0x51f281[_0xe122('0x41')]=_[_0xe122('0x40')](_0x51f281[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x51f281[_0xe122('0x38')],function(_0x3ad218){var _0x3f5667={};_0x3f5667[_0x3ad218]={'$like':'%'+_0x417aa7[_0xe122('0x35')][_0xe122('0x5a')]+'%'};return _0x3f5667;})});}_0x51f281=_['merge']({},_0x51f281,_0x417aa7[_0xe122('0x43')]);return db[_0xe122('0xca')]['count']({'where':_0x51f281['where']})[_0xe122('0x15')](function(_0x59ee9a){_0x20935d[_0xe122('0x22')]=_0x59ee9a;if(_0x417aa7[_0xe122('0x35')]['includeAll']){_0x51f281[_0xe122('0x45')]=[{'all':!![]}];}else{_0x51f281[_0xe122('0x45')]=[{'model':db[_0xe122('0x82')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0xe122('0x126'),'required':![]}];}return db['ChatOfflineMessage'][_0xe122('0x5b')](_0x51f281);})[_0xe122('0x15')](function(_0x5d6743){_0x20935d['rows']=_0x5d6743;return _0x20935d;});}})['then'](respondWithFilteredResult(_0x1c59c9,_0x51f281))[_0xe122('0x46')](handleError(_0x1c59c9,null));};exports[_0xe122('0x127')]=function(_0x5e1428,_0x3074fd){return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x5e1428[_0xe122('0x47')]['id']}})['then'](handleEntityNotFound(_0x3074fd,null))['then'](function(_0x1c5e51){if(_0x1c5e51){return _0x1c5e51[_0xe122('0x127')](_0x5e1428['body'][_0xe122('0x5d')],_[_0xe122('0x11c')](_0x5e1428[_0xe122('0x4a')],[_0xe122('0x5d'),'id'])||{})[_0xe122('0x128')](function(_0xa60928){for(var _0x1a5d82=0x0;_0x1a5d82<_0x5e1428[_0xe122('0x4a')][_0xe122('0x5d')][_0xe122('0x3a')];_0x1a5d82+=0x1){socket[_0xe122('0x129')](_0xe122('0x12a'),{'UserId':Number(_0x5e1428[_0xe122('0x4a')][_0xe122('0x5d')][_0x1a5d82]),'ChatWebsiteId':Number(_0x5e1428['params']['id'])});}return _0xa60928;});}})[_0xe122('0x15')](respondWithResult(_0x3074fd,null))[_0xe122('0x46')](handleError(_0x3074fd,null));};exports[_0xe122('0x12b')]=function(_0x356b21,_0x5e3aff){return db[_0xe122('0x2f')][_0xe122('0x50')]({'where':{'id':_0x356b21['params']['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x5e3aff,null))['then'](function(_0x1b4059){if(_0x1b4059){return _0x1b4059[_0xe122('0x12b')](_0x356b21[_0xe122('0x35')]['ids'])[_0xe122('0x15')](function(){if(_[_0xe122('0x12c')](_0x356b21[_0xe122('0x35')][_0xe122('0x5d')])){for(var _0xc955d=0x0;_0xc955d<_0x356b21[_0xe122('0x35')][_0xe122('0x5d')][_0xe122('0x3a')];_0xc955d+=0x1){socket[_0xe122('0x129')](_0xe122('0x12d'),{'UserId':Number(_0x356b21[_0xe122('0x35')]['ids'][_0xc955d]),'ChatWebsiteId':Number(_0x356b21['params']['id'])});}}else{socket[_0xe122('0x129')](_0xe122('0x12d'),{'UserId':Number(_0x356b21['query'][_0xe122('0x5d')]),'ChatWebsiteId':Number(_0x356b21[_0xe122('0x47')]['id'])});}});}})[_0xe122('0x15')](respondWithStatusCode(_0x5e3aff,null))[_0xe122('0x46')](handleError(_0x5e3aff,null));};exports['getAgents']=function(_0x4b971c,_0x29c210){var _0x3e8331={};var _0x1e6406={};var _0x3a4738;var _0x377811;return db[_0xe122('0x2f')][_0xe122('0x57')]({'where':{'id':_0x4b971c[_0xe122('0x47')]['id']}})[_0xe122('0x15')](handleEntityNotFound(_0x29c210,null))[_0xe122('0x15')](function(_0x5ec69e){if(_0x5ec69e){_0x3a4738=_0x5ec69e;_0x1e6406[_0xe122('0x33')]=_[_0xe122('0x36')](db[_0xe122('0xb7')]['rawAttributes']);_0x1e6406['query']=_[_0xe122('0x36')](_0x4b971c[_0xe122('0x35')]);_0x1e6406['filters']=_[_0xe122('0x37')](_0x1e6406[_0xe122('0x33')],_0x1e6406[_0xe122('0x35')]);_0x3e8331[_0xe122('0x38')]=_[_0xe122('0x37')](_0x1e6406[_0xe122('0x33')],qs[_0xe122('0x39')](_0x4b971c[_0xe122('0x35')]['fields']));_0x3e8331[_0xe122('0x38')]=_0x3e8331[_0xe122('0x38')][_0xe122('0x3a')]?_0x3e8331[_0xe122('0x38')]:_0x1e6406[_0xe122('0x33')];_0x3e8331[_0xe122('0x3c')]=qs[_0xe122('0x3d')](_0x4b971c[_0xe122('0x35')]['sort']);_0x3e8331[_0xe122('0x41')]=qs[_0xe122('0x3e')](_[_0xe122('0x3f')](_0x4b971c[_0xe122('0x35')],_0x1e6406[_0xe122('0x3e')]));if(_0x4b971c[_0xe122('0x35')][_0xe122('0x5a')]){_0x3e8331[_0xe122('0x41')]=_[_0xe122('0x40')](_0x3e8331[_0xe122('0x41')],{'$or':_[_0xe122('0x34')](_0x3e8331[_0xe122('0x38')],function(_0x2b6a63){var _0x6c4a13={};_0x6c4a13[_0x2b6a63]={'$like':'%'+_0x4b971c[_0xe122('0x35')][_0xe122('0x5a')]+'%'};return _0x6c4a13;})});}_0x3e8331=_[_0xe122('0x40')]({},_0x3e8331,_0x4b971c[_0xe122('0x43')]);return _0x3a4738[_0xe122('0x12e')](_0x3e8331);}})['then'](function(_0x24e029){if(_0x24e029){_0x377811=_0x24e029['length'];if(!_0x4b971c[_0xe122('0x35')][_0xe122('0x59')](_0xe122('0x3b'))){_0x3e8331[_0xe122('0x20')]=qs[_0xe122('0x20')](_0x4b971c[_0xe122('0x35')][_0xe122('0x20')]);_0x3e8331[_0xe122('0x1f')]=qs['offset'](_0x4b971c['query'][_0xe122('0x1f')]);}return _0x3a4738[_0xe122('0x12e')](_0x3e8331);}})[_0xe122('0x15')](function(_0x3b7e6f){if(_0x3b7e6f){return _0x3b7e6f?{'count':_0x377811,'rows':_0x3b7e6f}:null;}})[_0xe122('0x15')](respondWithResult(_0x29c210,null))[_0xe122('0x46')](handleError(_0x29c210,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5904492..8741373 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 _0x1af3=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x26266e,_0x1f5d0c){var _0xe064c8=function(_0x2f387f){while(--_0x2f387f){_0x26266e['push'](_0x26266e['shift']());}};_0xe064c8(++_0x1f5d0c);}(_0x1af3,0x1ca));var _0x31af=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x1af3[_0x175a55];return _0x167adf;};'use strict';var EventEmitter=require(_0x31af('0x0'));var ChatWebsite=require(_0x31af('0x1'))['db'][_0x31af('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31af('0x3')](0x0);var events={'afterCreate':_0x31af('0x4'),'afterUpdate':_0x31af('0x5'),'afterDestroy':_0x31af('0x6')};function emitEvent(_0x1a6ea6){return function(_0x3d64ae,_0xc098ee,_0x4f989c){ChatWebsiteEvents[_0x31af('0x7')](_0x1a6ea6+':'+_0x3d64ae['id'],_0x3d64ae);ChatWebsiteEvents[_0x31af('0x7')](_0x1a6ea6,_0x3d64ae);_0x4f989c(null);};}for(var e in events){if(events[_0x31af('0x8')](e)){var event=events[e];ChatWebsite[_0x31af('0x9')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xf5a7=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xf5a7,0x133));var _0x7f5a=function(_0x1f37df,_0x19f6cd){_0x1f37df=_0x1f37df-0x0;var _0x356c54=_0xf5a7[_0x1f37df];return _0x356c54;};'use strict';var EventEmitter=require(_0x7f5a('0x0'));var ChatWebsite=require(_0x7f5a('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7f5a('0x2')](0x0);var events={'afterCreate':_0x7f5a('0x3'),'afterUpdate':_0x7f5a('0x4'),'afterDestroy':_0x7f5a('0x5')};function emitEvent(_0x108c34){return function(_0x342fa0,_0x6da3f3,_0x8a76a){ChatWebsiteEvents[_0x7f5a('0x6')](_0x108c34+':'+_0x342fa0['id'],_0x342fa0);ChatWebsiteEvents['emit'](_0x108c34,_0x342fa0);_0x8a76a(null);};}for(var e in events){if(events[_0x7f5a('0x7')](e)){var event=events[e];ChatWebsite[_0x7f5a('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b8b5bdf..425c594 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 _0x3804=['chat_websites','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x6591b6,_0x50042a){var _0x34bb8f=function(_0x5dcbee){while(--_0x5dcbee){_0x6591b6['push'](_0x6591b6['shift']());}};_0x34bb8f(++_0x50042a);}(_0x3804,0x79));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4380('0x0'));var logger=require(_0x4380('0x1'))(_0x4380('0x2'));var moment=require(_0x4380('0x3'));var BPromise=require('bluebird');var rp=require(_0x4380('0x4'));var fs=require('fs');var path=require(_0x4380('0x5'));var rimraf=require(_0x4380('0x6'));var config=require(_0x4380('0x7'));var attributes=require(_0x4380('0x8'));module[_0x4380('0x9')]=function(_0x2595e8,_0xaa134a){return _0x2595e8['define'](_0x4380('0xa'),attributes,{'tableName':_0x4380('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x537d=['exports','ChatWebsite','chat_websites','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x1d8145,_0x17ed90){var _0x16f934=function(_0x3a9806){while(--_0x3a9806){_0x1d8145['push'](_0x1d8145['shift']());}};_0x16f934(++_0x17ed90);}(_0x537d,0x158));var _0xd537=function(_0x19dcc3,_0x58651a){_0x19dcc3=_0x19dcc3-0x0;var _0x24d519=_0x537d[_0x19dcc3];return _0x24d519;};'use strict';var _=require(_0xd537('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd537('0x1'));var moment=require(_0xd537('0x2'));var BPromise=require(_0xd537('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd537('0x4'));var rimraf=require(_0xd537('0x5'));var config=require(_0xd537('0x6'));var attributes=require(_0xd537('0x7'));module[_0xd537('0x8')]=function(_0x76804f,_0x43a58b){return _0x76804f['define'](_0xd537('0x9'),attributes,{'tableName':_0xd537('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index e8d330e..6402bbc 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 _0xe347=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4fe188,_0xb40f88){var _0x4f6041=function(_0x3f1945){while(--_0x3f1945){_0x4fe188['push'](_0x4fe188['shift']());}};_0x4f6041(++_0xb40f88);}(_0xe347,0xa8));var _0x7e34=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xe347[_0x230e39];return _0xa804e;};'use strict';var _=require(_0x7e34('0x0'));var util=require(_0x7e34('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7e34('0x2'));var fs=require('fs');var Redis=require(_0x7e34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e34('0x4'));var logger=require(_0x7e34('0x5'))('rpc');var config=require(_0x7e34('0x6'));var jayson=require(_0x7e34('0x7'));var client=jayson[_0x7e34('0x8')]['http']({'port':0x232a});config[_0x7e34('0x9')]=_[_0x7e34('0xa')](config[_0x7e34('0x9')],{'host':_0x7e34('0xb'),'port':0x18eb});var socket=require(_0x7e34('0xc'))(new Redis(config[_0x7e34('0x9')]));require(_0x7e34('0xd'))[_0x7e34('0xe')](socket);function respondWithRpcPromise(_0x188a5a,_0x2685a3,_0x5ac238){return new BPromise(function(_0x1fafa0,_0x500dcb){return client[_0x7e34('0xf')](_0x188a5a,_0x5ac238)['then'](function(_0x464fbf){logger[_0x7e34('0x10')](_0x7e34('0x11'),_0x2685a3,_0x7e34('0x12'));logger['debug'](_0x7e34('0x13'),_0x2685a3,_0x7e34('0x12'),JSON[_0x7e34('0x14')](_0x464fbf));if(_0x464fbf['error']){if(_0x464fbf[_0x7e34('0x15')][_0x7e34('0x16')]===0x1f4){logger['error'](_0x7e34('0x11'),_0x2685a3,_0x464fbf[_0x7e34('0x15')][_0x7e34('0x17')]);return _0x500dcb(_0x464fbf[_0x7e34('0x15')][_0x7e34('0x17')]);}logger[_0x7e34('0x15')](_0x7e34('0x11'),_0x2685a3,_0x464fbf[_0x7e34('0x15')][_0x7e34('0x17')]);return _0x1fafa0(_0x464fbf[_0x7e34('0x15')][_0x7e34('0x17')]);}else{logger[_0x7e34('0x10')](_0x7e34('0x11'),_0x2685a3,_0x7e34('0x12'));_0x1fafa0(_0x464fbf['result']['message']);}})[_0x7e34('0x18')](function(_0x4d6bf1){logger['error'](_0x7e34('0x11'),_0x2685a3,_0x4d6bf1);_0x500dcb(_0x4d6bf1);});});} \ No newline at end of file +var _0x9e49=['redis','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x19b824,_0x7c53f3){var _0x4d64c9=function(_0x6e130e){while(--_0x6e130e){_0x19b824['push'](_0x19b824['shift']());}};_0x4d64c9(++_0x7c53f3);}(_0x9e49,0x1e3));var _0x99e4=function(_0x1404c3,_0x588b81){_0x1404c3=_0x1404c3-0x0;var _0x5740a9=_0x9e49[_0x1404c3];return _0x5740a9;};'use strict';var _=require(_0x99e4('0x0'));var util=require(_0x99e4('0x1'));var moment=require('moment');var BPromise=require(_0x99e4('0x2'));var rs=require(_0x99e4('0x3'));var fs=require('fs');var Redis=require(_0x99e4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99e4('0x5'));var logger=require(_0x99e4('0x6'))(_0x99e4('0x7'));var config=require('../../config/environment');var jayson=require(_0x99e4('0x8'));var client=jayson[_0x99e4('0x9')][_0x99e4('0xa')]({'port':0x232a});config[_0x99e4('0xb')]=_['defaults'](config['redis'],{'host':_0x99e4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99e4('0xb')]));require(_0x99e4('0xd'))[_0x99e4('0xe')](socket);function respondWithRpcPromise(_0x39ea3c,_0x34a031,_0x57416e){return new BPromise(function(_0x39e157,_0x58c637){return client[_0x99e4('0xf')](_0x39ea3c,_0x57416e)[_0x99e4('0x10')](function(_0x509ad2){logger['info'](_0x99e4('0x11'),_0x34a031,'request\x20sent');logger[_0x99e4('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x34a031,_0x99e4('0x13'),JSON['stringify'](_0x509ad2));if(_0x509ad2['error']){if(_0x509ad2['error'][_0x99e4('0x14')]===0x1f4){logger['error'](_0x99e4('0x11'),_0x34a031,_0x509ad2[_0x99e4('0x15')][_0x99e4('0x16')]);return _0x58c637(_0x509ad2[_0x99e4('0x15')][_0x99e4('0x16')]);}logger[_0x99e4('0x15')](_0x99e4('0x11'),_0x34a031,_0x509ad2[_0x99e4('0x15')]['message']);return _0x39e157(_0x509ad2[_0x99e4('0x15')][_0x99e4('0x16')]);}else{logger[_0x99e4('0x17')](_0x99e4('0x11'),_0x34a031,_0x99e4('0x13'));_0x39e157(_0x509ad2[_0x99e4('0x18')][_0x99e4('0x16')]);}})[_0x99e4('0x19')](function(_0xb3430c){logger[_0x99e4('0x15')](_0x99e4('0x11'),_0x34a031,_0xb3430c);_0x58c637(_0xb3430c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 17631f4..b64ade8 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 _0xf71e=['removeListener','register','length','./chatWebsite.events','save','update','emit'];(function(_0x347f6e,_0x8f83ae){var _0x177aa7=function(_0x3895a2){while(--_0x3895a2){_0x347f6e['push'](_0x347f6e['shift']());}};_0x177aa7(++_0x8f83ae);}(_0xf71e,0x114));var _0xef71=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xf71e[_0x565c49];return _0x20ca34;};'use strict';var ChatWebsiteEvents=require(_0xef71('0x0'));var events=[_0xef71('0x1'),'remove',_0xef71('0x2')];function createListener(_0x3ab30c,_0x5b790a){return function(_0x4f940a){_0x5b790a[_0xef71('0x3')](_0x3ab30c,_0x4f940a);};}function removeListener(_0x2c08b5,_0x1b7adb){return function(){ChatWebsiteEvents[_0xef71('0x4')](_0x2c08b5,_0x1b7adb);};}exports[_0xef71('0x5')]=function(_0x39e133){for(var _0x4c4c51=0x0,_0x431196=events[_0xef71('0x6')];_0x4c4c51<_0x431196;_0x4c4c51++){var _0x1e84a0=events[_0x4c4c51];var _0x248457=createListener('chatWebsite:'+_0x1e84a0,_0x39e133);ChatWebsiteEvents['on'](_0x1e84a0,_0x248457);}}; \ No newline at end of file +var _0xa363=['./chatWebsite.events','remove','emit','register','length','chatWebsite:'];(function(_0x319d4d,_0x326f1f){var _0x4e4bdc=function(_0x2cae0d){while(--_0x2cae0d){_0x319d4d['push'](_0x319d4d['shift']());}};_0x4e4bdc(++_0x326f1f);}(_0xa363,0x1a4));var _0x3a36=function(_0x42946c,_0x577d97){_0x42946c=_0x42946c-0x0;var _0x5d7687=_0xa363[_0x42946c];return _0x5d7687;};'use strict';var ChatWebsiteEvents=require(_0x3a36('0x0'));var events=['save',_0x3a36('0x1'),'update'];function createListener(_0x313b9e,_0xaba874){return function(_0x2769e2){_0xaba874[_0x3a36('0x2')](_0x313b9e,_0x2769e2);};}function removeListener(_0x36c53b,_0x12d8d3){return function(){ChatWebsiteEvents['removeListener'](_0x36c53b,_0x12d8d3);};}exports[_0x3a36('0x3')]=function(_0x5a7761){for(var _0x4edefa=0x0,_0x5ac9e9=events[_0x3a36('0x4')];_0x4edefa<_0x5ac9e9;_0x4edefa++){var _0x2e136b=events[_0x4edefa];var _0x3b052e=createListener(_0x3a36('0x5')+_0x2e136b,_0x5a7761);ChatWebsiteEvents['on'](_0x2e136b,_0x3b052e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ae5d051..e53069d 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 _0x31f7=['/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','single','file','addLogo','diskStorage','%s-%s','originalname','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','any','offline','addApplications','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0x7f29d3,_0xc5df77){var _0x2fe14f=function(_0x30ebad){while(--_0x30ebad){_0x7f29d3['push'](_0x7f29d3['shift']());}};_0x2fe14f(++_0xc5df77);}(_0x31f7,0x19e));var _0x731f=function(_0x1e23f5,_0x5d4743){_0x1e23f5=_0x1e23f5-0x0;var _0xb815c5=_0x31f7[_0x1e23f5];return _0xb815c5;};'use strict';var multer=require('multer');var util=require(_0x731f('0x0'));var path=require(_0x731f('0x1'));var timeout=require(_0x731f('0x2'));var express=require(_0x731f('0x3'));var router=express[_0x731f('0x4')]();var fs_extra=require(_0x731f('0x5'));var auth=require(_0x731f('0x6'));var interaction=require(_0x731f('0x7'));var config=require('../../config/environment');var controller=require(_0x731f('0x8'));router[_0x731f('0x9')]('/',auth[_0x731f('0xa')](),controller['index']);router[_0x731f('0x9')](_0x731f('0xb'),auth[_0x731f('0xa')](),controller[_0x731f('0xc')]);router[_0x731f('0x9')](_0x731f('0xd'),auth[_0x731f('0xa')](),controller[_0x731f('0xe')]);router[_0x731f('0x9')](_0x731f('0xf'),auth[_0x731f('0xa')](),controller['getDispositions']);router[_0x731f('0x9')](_0x731f('0x10'),auth['isAuthenticated'](),controller[_0x731f('0x11')]);router[_0x731f('0x9')](_0x731f('0x12'),controller[_0x731f('0x13')]);router[_0x731f('0x9')](_0x731f('0x14'),controller['getAvatar']);router[_0x731f('0x9')](_0x731f('0x15'),controller[_0x731f('0x16')]);router[_0x731f('0x9')](_0x731f('0x17'),controller[_0x731f('0x18')]);router[_0x731f('0x9')](_0x731f('0x19'),auth[_0x731f('0xa')](),controller[_0x731f('0x1a')]);router[_0x731f('0x9')]('/:id/snippet',controller[_0x731f('0x1b')]);router[_0x731f('0x9')](_0x731f('0x1c'),auth[_0x731f('0xa')](),controller['getApplications']);router['get'](_0x731f('0x1d'),auth[_0x731f('0xa')](),controller[_0x731f('0x1e')]);router[_0x731f('0x9')](_0x731f('0x1f'),controller[_0x731f('0x20')]);router[_0x731f('0x9')](_0x731f('0x21'),auth[_0x731f('0xa')](),controller[_0x731f('0x22')]);router['get'](_0x731f('0x23'),auth[_0x731f('0xa')](),controller[_0x731f('0x24')]);router[_0x731f('0x25')]('/',auth['isAuthenticated'](),controller['create']);router[_0x731f('0x25')](_0x731f('0xf'),auth['isAuthenticated'](),controller[_0x731f('0x26')]);router[_0x731f('0x25')](_0x731f('0x10'),auth[_0x731f('0xa')](),controller[_0x731f('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x231957,_0x5eedd3,_0x138caf){_0x138caf(null,path[_0x731f('0x28')](config[_0x731f('0x29')],_0x731f('0x2a')));},'filename':function(_0x51c5c2,_0x4cca6c,_0x549842){_0x549842(null,util[_0x731f('0x2b')]('%s-%s',Date[_0x731f('0x2c')](),_0x4cca6c['originalname']));}})});router['post'](_0x731f('0x12'),upload[_0x731f('0x2d')](_0x731f('0x2e')),controller[_0x731f('0x2f')]);var upload=multer({'storage':multer[_0x731f('0x30')]({'destination':function(_0x1749cc,_0x168a93,_0x2a08b9){_0x2a08b9(null,path['join'](config[_0x731f('0x29')],'server/files/images/avatars/'));},'filename':function(_0x9f1445,_0x112ab3,_0x47e3da){_0x47e3da(null,util[_0x731f('0x2b')](_0x731f('0x31'),Date['now'](),_0x112ab3[_0x731f('0x32')]));}})});router[_0x731f('0x25')](_0x731f('0x14'),upload[_0x731f('0x2d')](_0x731f('0x2e')),controller[_0x731f('0x33')]);var upload=multer({'storage':multer[_0x731f('0x30')]({'destination':function(_0x37510b,_0x1d5d55,_0x367b54){_0x367b54(null,path[_0x731f('0x28')](config[_0x731f('0x29')],'server/files/images/avatars/'));},'filename':function(_0x9c1303,_0x1b93fd,_0x1c6030){_0x1c6030(null,util['format']('%s-%s',Date['now'](),_0x1b93fd[_0x731f('0x32')]));}})});router[_0x731f('0x25')](_0x731f('0x15'),upload[_0x731f('0x2d')](_0x731f('0x2e')),controller[_0x731f('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ed5d8,_0x3a4512,_0x757c75){_0x757c75(null,path['join'](config[_0x731f('0x29')],_0x731f('0x35')));},'filename':function(_0x30f683,_0x394909,_0x1b5e27){_0x1b5e27(null,util[_0x731f('0x2b')](_0x731f('0x31'),Date[_0x731f('0x2c')](),_0x394909['originalname']));}})});router[_0x731f('0x25')](_0x731f('0x17'),upload[_0x731f('0x2d')](_0x731f('0x2e')),controller[_0x731f('0x36')]);router[_0x731f('0x25')](_0x731f('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x51e261,_0x49c547,_0x265fcd){const _0x35766d=path[_0x731f('0x28')](config['root'],_0x731f('0x38'),_0x731f('0x39'),_0x731f('0x3a'));fs_extra[_0x731f('0x3b')](_0x35766d,function(){_0x265fcd(null,_0x35766d);});},'filename':function(_0x2f77e0,_0x3f965a,_0x1d5af5){const _0x692ee9=_0x3f965a[_0x731f('0x32')][_0x731f('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x453d5e=path['extname'](_0x692ee9);const _0x305bac=Date[_0x731f('0x2c')]()+'-'+_0x692ee9[_0x731f('0x3c')](_0x453d5e,'')+_0x453d5e;_0x1d5af5(null,_0x305bac);}})});router[_0x731f('0x25')]('/:id/offline',offlineUploadMulter[_0x731f('0x3d')](),controller[_0x731f('0x3e')]);router[_0x731f('0x25')]('/:id/interactions',auth[_0x731f('0xa')](),controller['addInteraction']);router[_0x731f('0x25')](_0x731f('0x1c'),auth['isAuthenticated'](),controller[_0x731f('0x3f')]);router[_0x731f('0x25')](_0x731f('0x1d'),auth[_0x731f('0xa')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x731f('0xa')](),controller[_0x731f('0x40')]);router['put'](_0x731f('0xd'),auth[_0x731f('0xa')](),controller[_0x731f('0x41')]);router[_0x731f('0x42')](_0x731f('0xd'),auth['isAuthenticated'](),controller[_0x731f('0x43')]);router[_0x731f('0x42')](_0x731f('0xf'),auth[_0x731f('0xa')](),controller[_0x731f('0x44')]);router[_0x731f('0x42')](_0x731f('0x10'),auth[_0x731f('0xa')](),controller[_0x731f('0x45')]);router[_0x731f('0x42')]('/:id/users',auth[_0x731f('0xa')](),controller[_0x731f('0x46')]);module[_0x731f('0x47')]=router; \ No newline at end of file +var _0xeb65=['/:id/offline','any','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','describe','/:id','show','isAuthenticated','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','file','addLogo','join','server/files/images/avatars/','originalname','single','addAvatar','addCustomerAvatar','format','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','replace'];(function(_0x3f89e5,_0x2d9fe9){var _0x187d83=function(_0x50ef05){while(--_0x50ef05){_0x3f89e5['push'](_0x3f89e5['shift']());}};_0x187d83(++_0x2d9fe9);}(_0xeb65,0x9e));var _0x5eb6=function(_0x194a08,_0x3cc12d){_0x194a08=_0x194a08-0x0;var _0x5f490c=_0xeb65[_0x194a08];return _0x5f490c;};'use strict';var multer=require('multer');var util=require(_0x5eb6('0x0'));var path=require('path');var timeout=require(_0x5eb6('0x1'));var express=require(_0x5eb6('0x2'));var router=express[_0x5eb6('0x3')]();var fs_extra=require(_0x5eb6('0x4'));var auth=require(_0x5eb6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5eb6('0x6'));var controller=require(_0x5eb6('0x7'));router[_0x5eb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5eb6('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5eb6('0x9')]);router[_0x5eb6('0x8')](_0x5eb6('0xa'),auth['isAuthenticated'](),controller[_0x5eb6('0xb')]);router[_0x5eb6('0x8')]('/:id/dispositions',auth[_0x5eb6('0xc')](),controller[_0x5eb6('0xd')]);router[_0x5eb6('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x5eb6('0xe'),controller[_0x5eb6('0xf')]);router['get'](_0x5eb6('0x10'),controller[_0x5eb6('0x11')]);router[_0x5eb6('0x8')](_0x5eb6('0x12'),controller[_0x5eb6('0x13')]);router[_0x5eb6('0x8')](_0x5eb6('0x14'),controller[_0x5eb6('0x15')]);router[_0x5eb6('0x8')]('/:id/interactions',auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x16')]);router['get'](_0x5eb6('0x17'),controller[_0x5eb6('0x18')]);router['get'](_0x5eb6('0x19'),auth[_0x5eb6('0xc')](),controller['getApplications']);router['get'](_0x5eb6('0x1a'),auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x1b')]);router[_0x5eb6('0x8')](_0x5eb6('0x1c'),controller[_0x5eb6('0x1d')]);router[_0x5eb6('0x8')]('/:id/offline_messages',auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x1e')]);router[_0x5eb6('0x8')](_0x5eb6('0x1f'),auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x20')]);router[_0x5eb6('0x21')]('/',auth['isAuthenticated'](),controller[_0x5eb6('0x22')]);router[_0x5eb6('0x21')](_0x5eb6('0x23'),auth[_0x5eb6('0xc')](),controller['addDisposition']);router['post'](_0x5eb6('0x24'),auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x25')]);var upload=multer({'storage':multer[_0x5eb6('0x26')]({'destination':function(_0x38ef91,_0x3ae9d2,_0x1e99be){_0x1e99be(null,path['join'](config[_0x5eb6('0x27')],_0x5eb6('0x28')));},'filename':function(_0x1ba819,_0x122c31,_0x25ae40){_0x25ae40(null,util['format'](_0x5eb6('0x29'),Date[_0x5eb6('0x2a')](),_0x122c31['originalname']));}})});router['post'](_0x5eb6('0xe'),upload['single'](_0x5eb6('0x2b')),controller[_0x5eb6('0x2c')]);var upload=multer({'storage':multer[_0x5eb6('0x26')]({'destination':function(_0x47abaf,_0x41ce3f,_0x295100){_0x295100(null,path[_0x5eb6('0x2d')](config[_0x5eb6('0x27')],_0x5eb6('0x2e')));},'filename':function(_0x521cae,_0x1eb3f1,_0x2a74c1){_0x2a74c1(null,util['format']('%s-%s',Date['now'](),_0x1eb3f1[_0x5eb6('0x2f')]));}})});router[_0x5eb6('0x21')](_0x5eb6('0x10'),upload[_0x5eb6('0x30')]('file'),controller[_0x5eb6('0x31')]);var upload=multer({'storage':multer[_0x5eb6('0x26')]({'destination':function(_0x3a8b5a,_0xb0eb0a,_0x8e9139){_0x8e9139(null,path['join'](config[_0x5eb6('0x27')],_0x5eb6('0x2e')));},'filename':function(_0x49c0ef,_0x408daa,_0x112db6){_0x112db6(null,util['format']('%s-%s',Date[_0x5eb6('0x2a')](),_0x408daa[_0x5eb6('0x2f')]));}})});router[_0x5eb6('0x21')](_0x5eb6('0x12'),upload[_0x5eb6('0x30')](_0x5eb6('0x2b')),controller[_0x5eb6('0x32')]);var upload=multer({'storage':multer[_0x5eb6('0x26')]({'destination':function(_0xdcebd8,_0x13f477,_0x498bbc){_0x498bbc(null,path[_0x5eb6('0x2d')](config[_0x5eb6('0x27')],_0x5eb6('0x2e')));},'filename':function(_0x1ce27e,_0x11c1d1,_0x36087e){_0x36087e(null,util[_0x5eb6('0x33')](_0x5eb6('0x29'),Date[_0x5eb6('0x2a')](),_0x11c1d1['originalname']));}})});router[_0x5eb6('0x21')](_0x5eb6('0x14'),upload[_0x5eb6('0x30')](_0x5eb6('0x2b')),controller[_0x5eb6('0x34')]);router['post'](_0x5eb6('0x35'),controller[_0x5eb6('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2c523f,_0x1ac438,_0x4a3ac3){const _0x44f83f=path[_0x5eb6('0x2d')](config['root'],'server/files',_0x5eb6('0x37'),'offline-chat');fs_extra[_0x5eb6('0x38')](_0x44f83f,function(){_0x4a3ac3(null,_0x44f83f);});},'filename':function(_0x181253,_0x38e7f5,_0x4e253f){const _0x1726dc=_0x38e7f5[_0x5eb6('0x2f')][_0x5eb6('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3b38a1=path['extname'](_0x1726dc);const _0x19a563=Date[_0x5eb6('0x2a')]()+'-'+_0x1726dc[_0x5eb6('0x39')](_0x3b38a1,'')+_0x3b38a1;_0x4e253f(null,_0x19a563);}})});router['post'](_0x5eb6('0x3a'),offlineUploadMulter[_0x5eb6('0x3b')](),controller[_0x5eb6('0x3c')]);router['post'](_0x5eb6('0x3d'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x5eb6('0x21')](_0x5eb6('0x19'),auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x3e')]);router[_0x5eb6('0x21')]('/:id/proactive_actions',auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x3f')]);router[_0x5eb6('0x21')](_0x5eb6('0x1f'),auth['isAuthenticated'](),controller[_0x5eb6('0x40')]);router[_0x5eb6('0x41')](_0x5eb6('0xa'),auth[_0x5eb6('0xc')](),controller['update']);router[_0x5eb6('0x42')]('/:id',auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x43')]);router[_0x5eb6('0x42')](_0x5eb6('0x23'),auth['isAuthenticated'](),controller[_0x5eb6('0x44')]);router[_0x5eb6('0x42')](_0x5eb6('0x24'),auth[_0x5eb6('0xc')](),controller[_0x5eb6('0x45')]);router[_0x5eb6('0x42')](_0x5eb6('0x1f'),auth['isAuthenticated'](),controller[_0x5eb6('0x46')]);module[_0x5eb6('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index b1413eb..59c7b15 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 _0x3c11=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','express','../components/auth/service','../config/environment','Router','env','app'];(function(_0x3fd4cb,_0x38f5b5){var _0x431bbb=function(_0x5081df){while(--_0x5081df){_0x3fd4cb['push'](_0x3fd4cb['shift']());}};_0x431bbb(++_0x38f5b5);}(_0x3c11,0x144));var _0x13c1=function(_0x24160c,_0x3c554b){_0x24160c=_0x24160c-0x0;var _0x2ce258=_0x3c11[_0x24160c];return _0x2ce258;};var beaverLogger=require('beaver-logger/server');var express=require(_0x13c1('0x0'));var auth=require(_0x13c1('0x1'));var config=require(_0x13c1('0x2'));var router=express[_0x13c1('0x3')]();var isProduction=config[_0x13c1('0x4')]==='production'||![];function clientSideLogs(_0x332cba,_0x567260,_0x196b65){var _0x44dd84=_0x332cba[_0x13c1('0x5')][_0x13c1('0x6')](_0x13c1('0x7'));if(!_0x44dd84){throw new Error(_0x13c1('0x8'));}return beaverLogger[_0x13c1('0x9')]({'uri':'/client-logs','logger':_0x44dd84,'enableCors':!isProduction})(_0x332cba,_0x567260,_0x196b65);}router['use'](auth[_0x13c1('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x39d2=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','production','app'];(function(_0x4073a2,_0x35b64b){var _0x1794c1=function(_0xd7af05){while(--_0xd7af05){_0x4073a2['push'](_0x4073a2['shift']());}};_0x1794c1(++_0x35b64b);}(_0x39d2,0x14c));var _0x239d=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0x39d2[_0x568496];return _0x26c5c1;};var beaverLogger=require(_0x239d('0x0'));var express=require(_0x239d('0x1'));var auth=require(_0x239d('0x2'));var config=require('../config/environment');var router=express[_0x239d('0x3')]();var isProduction=config['env']===_0x239d('0x4')||![];function clientSideLogs(_0x5002e3,_0x183f96,_0x17ff4a){var _0x11f762=_0x5002e3[_0x239d('0x5')][_0x239d('0x6')]('client-side-logger');if(!_0x11f762){throw new Error(_0x239d('0x7'));}return beaverLogger[_0x239d('0x8')]({'uri':_0x239d('0x9'),'logger':_0x11f762,'enableCors':!isProduction})(_0x5002e3,_0x183f96,_0x17ff4a);}router[_0x239d('0xa')](auth[_0x239d('0xb')](),clientSideLogs);module[_0x239d('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 eb8f710..4f21eca 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 _0x4262=['STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x3bb4df,_0x4884e8){var _0x3a55b7=function(_0x117a2c){while(--_0x117a2c){_0x3bb4df['push'](_0x3bb4df['shift']());}};_0x3a55b7(++_0x4884e8);}(_0x4262,0x11e));var _0x2426=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4262[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x2426('0x0'));module[_0x2426('0x1')]={'name':{'type':Sequelize[_0x2426('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2426('0x3')](_0x2426('0x4'),'Google',_0x2426('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2426('0x3')](_0x2426('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x2426('0x2')],'comment':_0x2426('0x7')},'data2':{'type':Sequelize[_0x2426('0x2')],'comment':_0x2426('0x8')},'data3':{'type':Sequelize[_0x2426('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x2426('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x2426('0x9')],'comment':_0x2426('0xa')},'data6':{'type':Sequelize[_0x2426('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x2426('0xb')}}; \ No newline at end of file +var _0xd3bc=['MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','Google'];(function(_0x4baadb,_0x236e1b){var _0xd6d791=function(_0x218e41){while(--_0x218e41){_0x4baadb['push'](_0x4baadb['shift']());}};_0xd6d791(++_0x236e1b);}(_0xd3bc,0xc7));var _0xcd3b=function(_0x2114a7,_0x31f2a5){_0x2114a7=_0x2114a7-0x0;var _0x2211c4=_0xd3bc[_0x2114a7];return _0x2211c4;};'use strict';var Sequelize=require(_0xcd3b('0x0'));module[_0xcd3b('0x1')]={'name':{'type':Sequelize[_0xcd3b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xcd3b('0x3')]('AmazonAWS',_0xcd3b('0x4'),_0xcd3b('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xcd3b('0x6'))},'data1':{'type':Sequelize[_0xcd3b('0x2')],'comment':_0xcd3b('0x7')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xcd3b('0x8')},'data4':{'type':Sequelize[_0xcd3b('0x2')],'comment':_0xcd3b('0x9')},'data5':{'type':Sequelize[_0xcd3b('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xcd3b('0xa')],'comment':_0xcd3b('0xb')},'data7':{'type':Sequelize[_0xcd3b('0xa')],'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 26bf8ae..58d33c3 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 _0x4558=['VIRTUAL','options','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','rawAttributes','length','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','from','ascii','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','localhost','sendStatus','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','status','stack','padEnd','slice','index','CloudProvider','fieldName','key','model','map','name','query','keys','filters','intersection','fields','attributes','order','sort','where','filter','merge','type'];(function(_0xeb9f61,_0x4579b1){var _0x3988c9=function(_0x1bfc04){while(--_0x1bfc04){_0xeb9f61['push'](_0xeb9f61['shift']());}};_0x3988c9(++_0x4579b1);}(_0x4558,0x91));var _0x8455=function(_0x5e8359,_0x6b4b5b){_0x5e8359=_0x5e8359-0x0;var _0x5757be=_0x4558[_0x5e8359];return _0x5757be;};'use strict';var _=require(_0x8455('0x0'));var Redis=require(_0x8455('0x1'));var qs=require(_0x8455('0x2'));var encryptor=require(_0x8455('0x3'));var config=require(_0x8455('0x4'));var logger=require(_0x8455('0x5'))(_0x8455('0x6'));var db=require(_0x8455('0x7'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x8455('0x8')](config[_0x8455('0x9')],{'host':_0x8455('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8455('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2f8528,_0x5a6054){_0x5a6054=_0x5a6054||0xcc;return function(_0x9a6d08){if(_0x9a6d08){return _0x2f8528[_0x8455('0xb')](_0x5a6054);}return _0x2f8528['status'](_0x5a6054)[_0x8455('0xc')]();};}function respondWithResult(_0x481608,_0x39ed43){_0x39ed43=_0x39ed43||0xc8;return function(_0x2c7a9e){if(_0x2c7a9e){return _0x481608['status'](_0x39ed43)[_0x8455('0xd')](_0x2c7a9e);}};}function respondWithFilteredResult(_0x2710ef,_0x586791){return function(_0x5ba0c5){if(_0x5ba0c5){var _0x48c27a=typeof _0x586791[_0x8455('0xe')]===_0x8455('0xf')&&typeof _0x586791[_0x8455('0x10')]===_0x8455('0xf');var _0xade446=_0x5ba0c5['count'];var _0x5d085b=_0x48c27a?0x0:_0x586791[_0x8455('0xe')];var _0x129cba=_0x48c27a?_0x5ba0c5['count']:_0x586791[_0x8455('0xe')]+_0x586791[_0x8455('0x10')];var _0x32ef2e;if(_0x129cba>=_0xade446){_0x129cba=_0xade446;_0x32ef2e=0xc8;}else{_0x32ef2e=0xce;}_0x2710ef['status'](_0x32ef2e);return _0x2710ef[_0x8455('0x11')](_0x8455('0x12'),_0x5d085b+'-'+_0x129cba+'/'+_0xade446)['json'](_0x5ba0c5);}return null;};}function saveUpdates(_0x49513a){return function(_0x59d14f){if(_0x59d14f){return _0x59d14f[_0x8455('0x13')](_0x49513a)[_0x8455('0x14')](function(_0x103917){return _0x103917;});}return null;};}function removeEntity(_0x20f7f6){return function(_0x3d9f1b){if(_0x3d9f1b){return _0x3d9f1b[_0x8455('0x15')]()['then'](function(){_0x20f7f6[_0x8455('0x16')](0xcc)[_0x8455('0xc')]();});}};}function handleEntityNotFound(_0x3b0b82){return function(_0xb5cdf7){if(!_0xb5cdf7){_0x3b0b82[_0x8455('0xb')](0x194);}return _0xb5cdf7;};}function handleError(_0x5cabe0,_0xf0427e){_0xf0427e=_0xf0427e||0x1f4;return function(_0x5887a7){logger['error'](_0x5887a7[_0x8455('0x17')]);if(_0x5887a7['name']){delete _0x5887a7['name'];}_0x5cabe0[_0x8455('0x16')](_0xf0427e)['send'](_0x5887a7);};}function maskClientSecret(_0x3aeaa2){return _[_0x8455('0x18')](_0x3aeaa2[_0x8455('0x19')](0x0,0x3),0x14,'*');}exports[_0x8455('0x1a')]=function(_0x104358,_0x45c7f7){var _0xc75279={},_0x55b8d2={},_0x5e960d={'count':0x0,'rows':[]};var _0x30716f=_['map'](db[_0x8455('0x1b')]['rawAttributes'],function(_0x3b989a){return{'name':_0x3b989a[_0x8455('0x1c')],'type':_0x3b989a['type'][_0x8455('0x1d')]};});_0x55b8d2[_0x8455('0x1e')]=_[_0x8455('0x1f')](_0x30716f,_0x8455('0x20'));_0x55b8d2[_0x8455('0x21')]=_[_0x8455('0x22')](_0x104358['query']);_0x55b8d2[_0x8455('0x23')]=_['intersection'](_0x55b8d2['model'],_0x55b8d2[_0x8455('0x21')]);_0xc75279['attributes']=_[_0x8455('0x24')](_0x55b8d2['model'],qs['fields'](_0x104358[_0x8455('0x21')][_0x8455('0x25')]));_0xc75279['attributes']=_0xc75279[_0x8455('0x26')]['length']?_0xc75279[_0x8455('0x26')]:_0x55b8d2['model'];if(!_0x104358[_0x8455('0x21')]['hasOwnProperty']('nolimit')){_0xc75279[_0x8455('0x10')]=qs[_0x8455('0x10')](_0x104358[_0x8455('0x21')][_0x8455('0x10')]);_0xc75279[_0x8455('0xe')]=qs['offset'](_0x104358['query'][_0x8455('0xe')]);}_0xc75279[_0x8455('0x27')]=qs[_0x8455('0x28')](_0x104358['query']['sort']);_0xc75279[_0x8455('0x29')]=qs['filters'](_['pick'](_0x104358[_0x8455('0x21')],_0x55b8d2[_0x8455('0x23')]),_0x30716f);if(_0x104358[_0x8455('0x21')][_0x8455('0x2a')]){_0xc75279['where']=_[_0x8455('0x2b')](_0xc75279[_0x8455('0x29')],{'$or':_[_0x8455('0x1f')](_0x30716f,function(_0x19f7a8){if(_0x19f7a8[_0x8455('0x2c')]!==_0x8455('0x2d')){var _0x3e687e={};_0x3e687e[_0x19f7a8[_0x8455('0x20')]]={'$like':'%'+_0x104358[_0x8455('0x21')][_0x8455('0x2a')]+'%'};return _0x3e687e;}})});}_0xc75279=_[_0x8455('0x2b')]({},_0xc75279,_0x104358[_0x8455('0x2e')]);var _0x27ad1c={'where':_0xc75279['where']};return db[_0x8455('0x1b')][_0x8455('0x2f')](_0x27ad1c)['then'](function(_0x532d12){_0x5e960d[_0x8455('0x2f')]=_0x532d12;if(_0x104358[_0x8455('0x21')][_0x8455('0x30')]){_0xc75279[_0x8455('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x8455('0x32')](_0xc75279);})[_0x8455('0x14')](function(_0x32acfe){_0x5e960d[_0x8455('0x33')]=_[_0x8455('0x1f')](_0x32acfe,function(_0x2d537b){if(_0x2d537b[_0x8455('0x34')]===_0x8455('0x35')){var _0x4445a2=encryptor[_0x8455('0x36')](_0x2d537b[_0x8455('0x37')]);_0x2d537b[_0x8455('0x37')]=maskClientSecret(_0x4445a2);}return _0x2d537b;});return _0x5e960d;})['then'](respondWithFilteredResult(_0x45c7f7,_0xc75279))[_0x8455('0x38')](handleError(_0x45c7f7,null));};exports['show']=function(_0x17971f,_0x5da46d){var _0x28b63c={'raw':!![],'where':{'id':_0x17971f[_0x8455('0x39')]['id']}},_0x18765c={};_0x18765c[_0x8455('0x1e')]=_[_0x8455('0x22')](db[_0x8455('0x1b')][_0x8455('0x3a')]);_0x18765c[_0x8455('0x21')]=_[_0x8455('0x22')](_0x17971f['query']);_0x18765c[_0x8455('0x23')]=_[_0x8455('0x24')](_0x18765c[_0x8455('0x1e')],_0x18765c[_0x8455('0x21')]);_0x28b63c['attributes']=_[_0x8455('0x24')](_0x18765c[_0x8455('0x1e')],qs[_0x8455('0x25')](_0x17971f[_0x8455('0x21')][_0x8455('0x25')]));_0x28b63c['attributes']=_0x28b63c[_0x8455('0x26')][_0x8455('0x3b')]?_0x28b63c[_0x8455('0x26')]:_0x18765c[_0x8455('0x1e')];if(_0x17971f[_0x8455('0x21')][_0x8455('0x30')]){_0x28b63c[_0x8455('0x31')]=[{'all':!![]}];}_0x28b63c=_[_0x8455('0x2b')]({},_0x28b63c,_0x17971f[_0x8455('0x2e')]);return db[_0x8455('0x1b')][_0x8455('0x3c')](_0x28b63c)['then'](handleEntityNotFound(_0x5da46d,null))[_0x8455('0x14')](function(_0x1bac1e){if(_0x1bac1e[_0x8455('0x34')]===_0x8455('0x35')){var _0x657105=encryptor['decryptString'](_0x1bac1e[_0x8455('0x37')]);_0x1bac1e[_0x8455('0x37')]=maskClientSecret(_0x657105);}return _0x1bac1e;})[_0x8455('0x14')](respondWithResult(_0x5da46d,null))[_0x8455('0x38')](handleError(_0x5da46d,null));};exports['create']=function(_0x2f0be3,_0x100a97){if(!_0x2f0be3[_0x8455('0x3d')][_0x8455('0x20')])throw new Error(_0x8455('0x3e'));if(!_0x2f0be3[_0x8455('0x3d')]['service'])throw new Error(_0x8455('0x3f'));var _0x368d04=db['CloudProvider']['rawAttributes'][_0x8455('0x34')][_0x8455('0x40')];if(!_0x368d04[_0x8455('0x41')](_0x2f0be3[_0x8455('0x3d')][_0x8455('0x34')]))throw new Error(_0x8455('0x42')+_0x368d04[_0x8455('0x43')](',\x20'));if(_0x2f0be3[_0x8455('0x3d')]['service']===_0x8455('0x35')&&_0x2f0be3[_0x8455('0x3d')][_0x8455('0x37')]){_0x2f0be3[_0x8455('0x3d')][_0x8455('0x37')]=encryptor[_0x8455('0x44')](_0x2f0be3[_0x8455('0x3d')][_0x8455('0x37')]);}return db[_0x8455('0x1b')][_0x8455('0x45')](_0x2f0be3[_0x8455('0x3d')],{})[_0x8455('0x14')](respondWithResult(_0x100a97,0xc9))[_0x8455('0x38')](handleError(_0x100a97,null));};exports[_0x8455('0x13')]=function(_0xed3b63,_0x54eef6){if(_0xed3b63[_0x8455('0x3d')]['id']){delete _0xed3b63[_0x8455('0x3d')]['id'];}return db[_0x8455('0x1b')][_0x8455('0x3c')]({'where':{'id':_0xed3b63[_0x8455('0x39')]['id']}})[_0x8455('0x14')](handleEntityNotFound(_0x54eef6,null))[_0x8455('0x14')](function(_0x5d7a9b){if(_0x5d7a9b[_0x8455('0x34')]===_0x8455('0x35')&&_0xed3b63['body']['data3']){_0xed3b63['body'][_0x8455('0x37')]=encryptor['encryptString'](_0xed3b63['body']['data3']);}return _0x5d7a9b;})[_0x8455('0x14')](saveUpdates(_0xed3b63['body'],null))[_0x8455('0x14')](respondWithResult(_0x54eef6,null))['catch'](handleError(_0x54eef6,null));};exports['destroy']=function(_0x1814c3,_0x1738b6){return db['CloudProvider']['find']({'where':{'id':_0x1814c3['params']['id']}})['then'](handleEntityNotFound(_0x1738b6,null))[_0x8455('0x14')](removeEntity(_0x1738b6,null))['catch'](handleError(_0x1738b6,null));};exports[_0x8455('0x46')]=function(_0x956cd1,_0x2e7699){return db[_0x8455('0x1b')]['findOne']({'where':{'id':_0x956cd1[_0x8455('0x39')]['id']},'raw':!![]})[_0x8455('0x14')](function(_0x2e899f){if(!_0x2e899f)return _0x2e7699['sendStatus'](0x194);return{'url':oauth[_0x8455('0x47')](_0x2e899f,_0x956cd1[_0x8455('0x48')]['id'])};})[_0x8455('0x14')](respondWithResult(_0x2e7699,null))['catch'](handleError(_0x2e7699,null));};exports[_0x8455('0x49')]=function(_0x2d62f8,_0x44bea1){var _0x4ff745=_0x2d62f8[_0x8455('0x3d')];var _0x22a02b;var _0x33f92d;if(_0x4ff745[_0x8455('0x4a')])throw _0x4ff745;redis[_0x8455('0x4b')](_0x4ff745[_0x8455('0x4c')])[_0x8455('0x14')](function(_0x868452){if(!_0x868452)throw new Error(_0x8455('0x4d'));_0x22a02b=JSON['parse'](_0x868452);var _0x1d7e6e=Buffer[_0x8455('0x4e')](_0x4ff745[_0x8455('0x4c')],'base64')['toString'](_0x8455('0x4f'));_0x33f92d=JSON['parse'](_0x1d7e6e);if(!oauth[_0x8455('0x50')](_0x4ff745['id_token'],_0x22a02b[_0x8455('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x8455('0x52')](_0x4ff745['state']);return oauth[_0x8455('0x53')](_0x4ff745[_0x8455('0x54')],_0x22a02b);})['then'](function(_0x273ca6){_0x22a02b[_0x8455('0x55')]=_0x273ca6[_0x8455('0x56')];_0x22a02b[_0x8455('0x57')]=_0x273ca6['refresh_token'];return db[_0x8455('0x1b')][_0x8455('0x13')]({'data5':_0x22a02b[_0x8455('0x55')],'data6':_0x22a02b[_0x8455('0x57')]},{'where':{'id':_0x22a02b['id']}});})[_0x8455('0x14')](function(){oauth['startRefreshInterval'](_0x22a02b);socket[_0x8455('0x58')](_0x8455('0x59'),{'id':_0x33f92d['id']});return;})[_0x8455('0x14')](respondWithStatusCode(_0x44bea1,null))['catch'](function(_0x17e041){if(_0x33f92d){socket[_0x8455('0x58')](_0x8455('0x5a'),{'id':_0x33f92d['id']});}if(!_0x22a02b){logger[_0x8455('0x4a')](_0x8455('0x5b'),_0x17e041);return _0x44bea1['status'](0x1f4)[_0x8455('0x5c')](_0x17e041[_0x8455('0x5d')]);}logger[_0x8455('0x4a')](_0x8455('0x5e'),_0x22a02b['id'],JSON['stringify'](_0x17e041));});}; \ No newline at end of file +var _0xe46a=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','merge','service','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','parse','from','state','base64','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','emit','microsoftAuthorization:success','message','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','api','defaults','localhost','redis','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type'];(function(_0x61ad75,_0x198be6){var _0x37bab5=function(_0x13835f){while(--_0x13835f){_0x61ad75['push'](_0x61ad75['shift']());}};_0x37bab5(++_0x198be6);}(_0xe46a,0x1b8));var _0xae46=function(_0x367e21,_0x5373a5){_0x367e21=_0x367e21-0x0;var _0x30901a=_0xe46a[_0x367e21];return _0x30901a;};'use strict';var _=require(_0xae46('0x0'));var Redis=require(_0xae46('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xae46('0x2'));var config=require(_0xae46('0x3'));var logger=require('../../config/logger')(_0xae46('0x4'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xae46('0x5')](config['redis'],{'host':_0xae46('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae46('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x49609e,_0x297386){_0x297386=_0x297386||0xcc;return function(_0x1aad23){if(_0x1aad23){return _0x49609e[_0xae46('0x8')](_0x297386);}return _0x49609e[_0xae46('0x9')](_0x297386)[_0xae46('0xa')]();};}function respondWithResult(_0x1b7cf2,_0x4e0d23){_0x4e0d23=_0x4e0d23||0xc8;return function(_0x19f36f){if(_0x19f36f){return _0x1b7cf2['status'](_0x4e0d23)[_0xae46('0xb')](_0x19f36f);}};}function respondWithFilteredResult(_0x45ca38,_0x5acf0f){return function(_0x2eba73){if(_0x2eba73){var _0xb34b8b=typeof _0x5acf0f[_0xae46('0xc')]===_0xae46('0xd')&&typeof _0x5acf0f['limit']===_0xae46('0xd');var _0x241f4f=_0x2eba73['count'];var _0x37b760=_0xb34b8b?0x0:_0x5acf0f[_0xae46('0xc')];var _0x50be8c=_0xb34b8b?_0x2eba73['count']:_0x5acf0f[_0xae46('0xc')]+_0x5acf0f[_0xae46('0xe')];var _0x2e41ab;if(_0x50be8c>=_0x241f4f){_0x50be8c=_0x241f4f;_0x2e41ab=0xc8;}else{_0x2e41ab=0xce;}_0x45ca38['status'](_0x2e41ab);return _0x45ca38[_0xae46('0xf')](_0xae46('0x10'),_0x37b760+'-'+_0x50be8c+'/'+_0x241f4f)[_0xae46('0xb')](_0x2eba73);}return null;};}function saveUpdates(_0x4d614b){return function(_0xcd6118){if(_0xcd6118){return _0xcd6118[_0xae46('0x11')](_0x4d614b)[_0xae46('0x12')](function(_0x3ef607){return _0x3ef607;});}return null;};}function removeEntity(_0x528927){return function(_0x24e34b){if(_0x24e34b){return _0x24e34b['destroy']()[_0xae46('0x12')](function(){_0x528927['status'](0xcc)[_0xae46('0xa')]();});}};}function handleEntityNotFound(_0x116d28){return function(_0x13b5e7){if(!_0x13b5e7){_0x116d28[_0xae46('0x8')](0x194);}return _0x13b5e7;};}function handleError(_0x3dfa1b,_0x1b8141){_0x1b8141=_0x1b8141||0x1f4;return function(_0x17c4d8){logger[_0xae46('0x13')](_0x17c4d8[_0xae46('0x14')]);if(_0x17c4d8[_0xae46('0x15')]){delete _0x17c4d8[_0xae46('0x15')];}_0x3dfa1b[_0xae46('0x9')](_0x1b8141)[_0xae46('0x16')](_0x17c4d8);};}function maskClientSecret(_0x5d33b3){return _[_0xae46('0x17')](_0x5d33b3[_0xae46('0x18')](0x0,0x3),0x14,'*');}exports[_0xae46('0x19')]=function(_0x5103e7,_0x2f8555){var _0x40c3a0={},_0x53663d={},_0x2aebef={'count':0x0,'rows':[]};var _0x551678=_[_0xae46('0x1a')](db[_0xae46('0x1b')]['rawAttributes'],function(_0x51fa01){return{'name':_0x51fa01[_0xae46('0x1c')],'type':_0x51fa01[_0xae46('0x1d')][_0xae46('0x1e')]};});_0x53663d[_0xae46('0x1f')]=_[_0xae46('0x1a')](_0x551678,_0xae46('0x15'));_0x53663d[_0xae46('0x20')]=_[_0xae46('0x21')](_0x5103e7[_0xae46('0x20')]);_0x53663d[_0xae46('0x22')]=_[_0xae46('0x23')](_0x53663d[_0xae46('0x1f')],_0x53663d[_0xae46('0x20')]);_0x40c3a0[_0xae46('0x24')]=_[_0xae46('0x23')](_0x53663d[_0xae46('0x1f')],qs[_0xae46('0x25')](_0x5103e7['query'][_0xae46('0x25')]));_0x40c3a0[_0xae46('0x24')]=_0x40c3a0[_0xae46('0x24')][_0xae46('0x26')]?_0x40c3a0['attributes']:_0x53663d[_0xae46('0x1f')];if(!_0x5103e7[_0xae46('0x20')][_0xae46('0x27')](_0xae46('0x28'))){_0x40c3a0[_0xae46('0xe')]=qs[_0xae46('0xe')](_0x5103e7[_0xae46('0x20')]['limit']);_0x40c3a0[_0xae46('0xc')]=qs[_0xae46('0xc')](_0x5103e7[_0xae46('0x20')]['offset']);}_0x40c3a0[_0xae46('0x29')]=qs[_0xae46('0x2a')](_0x5103e7[_0xae46('0x20')][_0xae46('0x2a')]);_0x40c3a0[_0xae46('0x2b')]=qs[_0xae46('0x22')](_[_0xae46('0x2c')](_0x5103e7[_0xae46('0x20')],_0x53663d[_0xae46('0x22')]),_0x551678);if(_0x5103e7[_0xae46('0x20')]['filter']){_0x40c3a0[_0xae46('0x2b')]=_['merge'](_0x40c3a0[_0xae46('0x2b')],{'$or':_[_0xae46('0x1a')](_0x551678,function(_0x11e779){if(_0x11e779[_0xae46('0x1d')]!==_0xae46('0x2d')){var _0x32dd5a={};_0x32dd5a[_0x11e779[_0xae46('0x15')]]={'$like':'%'+_0x5103e7['query'][_0xae46('0x2e')]+'%'};return _0x32dd5a;}})});}_0x40c3a0=_['merge']({},_0x40c3a0,_0x5103e7[_0xae46('0x2f')]);var _0x5f2d2f={'where':_0x40c3a0[_0xae46('0x2b')]};return db[_0xae46('0x1b')][_0xae46('0x30')](_0x5f2d2f)[_0xae46('0x12')](function(_0x5de1aa){_0x2aebef[_0xae46('0x30')]=_0x5de1aa;if(_0x5103e7[_0xae46('0x20')][_0xae46('0x31')]){_0x40c3a0[_0xae46('0x32')]=[{'all':!![]}];}return db['CloudProvider'][_0xae46('0x33')](_0x40c3a0);})['then'](function(_0x1200de){_0x2aebef[_0xae46('0x34')]=_[_0xae46('0x1a')](_0x1200de,function(_0x33505c){if(_0x33505c['service']===_0xae46('0x35')){var _0x52e040=encryptor[_0xae46('0x36')](_0x33505c[_0xae46('0x37')]);_0x33505c[_0xae46('0x37')]=maskClientSecret(_0x52e040);}return _0x33505c;});return _0x2aebef;})[_0xae46('0x12')](respondWithFilteredResult(_0x2f8555,_0x40c3a0))[_0xae46('0x38')](handleError(_0x2f8555,null));};exports[_0xae46('0x39')]=function(_0x5f1287,_0x486d28){var _0x22d9fd={'raw':!![],'where':{'id':_0x5f1287[_0xae46('0x3a')]['id']}},_0x150454={};_0x150454[_0xae46('0x1f')]=_[_0xae46('0x21')](db[_0xae46('0x1b')][_0xae46('0x3b')]);_0x150454[_0xae46('0x20')]=_[_0xae46('0x21')](_0x5f1287[_0xae46('0x20')]);_0x150454[_0xae46('0x22')]=_['intersection'](_0x150454['model'],_0x150454['query']);_0x22d9fd['attributes']=_[_0xae46('0x23')](_0x150454[_0xae46('0x1f')],qs['fields'](_0x5f1287[_0xae46('0x20')]['fields']));_0x22d9fd[_0xae46('0x24')]=_0x22d9fd[_0xae46('0x24')][_0xae46('0x26')]?_0x22d9fd[_0xae46('0x24')]:_0x150454[_0xae46('0x1f')];if(_0x5f1287[_0xae46('0x20')][_0xae46('0x31')]){_0x22d9fd['include']=[{'all':!![]}];}_0x22d9fd=_[_0xae46('0x3c')]({},_0x22d9fd,_0x5f1287['options']);return db[_0xae46('0x1b')]['find'](_0x22d9fd)['then'](handleEntityNotFound(_0x486d28,null))[_0xae46('0x12')](function(_0x1d8179){if(_0x1d8179[_0xae46('0x3d')]===_0xae46('0x35')){var _0x5ca01b=encryptor[_0xae46('0x36')](_0x1d8179['data3']);_0x1d8179[_0xae46('0x37')]=maskClientSecret(_0x5ca01b);}return _0x1d8179;})[_0xae46('0x12')](respondWithResult(_0x486d28,null))['catch'](handleError(_0x486d28,null));};exports[_0xae46('0x3e')]=function(_0x36d554,_0x18f7c3){if(!_0x36d554['body'][_0xae46('0x15')])throw new Error(_0xae46('0x3f'));if(!_0x36d554[_0xae46('0x40')]['service'])throw new Error(_0xae46('0x41'));var _0x5274b0=db[_0xae46('0x1b')]['rawAttributes'][_0xae46('0x3d')][_0xae46('0x42')];if(!_0x5274b0[_0xae46('0x43')](_0x36d554[_0xae46('0x40')][_0xae46('0x3d')]))throw new Error(_0xae46('0x44')+_0x5274b0['join'](',\x20'));if(_0x36d554[_0xae46('0x40')][_0xae46('0x3d')]===_0xae46('0x35')&&_0x36d554[_0xae46('0x40')]['data3']){_0x36d554[_0xae46('0x40')][_0xae46('0x37')]=encryptor[_0xae46('0x45')](_0x36d554['body'][_0xae46('0x37')]);}return db[_0xae46('0x1b')][_0xae46('0x3e')](_0x36d554['body'],{})[_0xae46('0x12')](respondWithResult(_0x18f7c3,0xc9))[_0xae46('0x38')](handleError(_0x18f7c3,null));};exports[_0xae46('0x11')]=function(_0x259005,_0x410ee3){if(_0x259005[_0xae46('0x40')]['id']){delete _0x259005[_0xae46('0x40')]['id'];}return db[_0xae46('0x1b')][_0xae46('0x46')]({'where':{'id':_0x259005[_0xae46('0x3a')]['id']}})[_0xae46('0x12')](handleEntityNotFound(_0x410ee3,null))[_0xae46('0x12')](function(_0x4e4961){if(_0x4e4961[_0xae46('0x3d')]===_0xae46('0x35')&&_0x259005[_0xae46('0x40')][_0xae46('0x37')]){_0x259005[_0xae46('0x40')][_0xae46('0x37')]=encryptor[_0xae46('0x45')](_0x259005[_0xae46('0x40')][_0xae46('0x37')]);}return _0x4e4961;})[_0xae46('0x12')](saveUpdates(_0x259005[_0xae46('0x40')],null))[_0xae46('0x12')](respondWithResult(_0x410ee3,null))[_0xae46('0x38')](handleError(_0x410ee3,null));};exports[_0xae46('0x47')]=function(_0x4ba5c2,_0x1dd47e){return db[_0xae46('0x1b')][_0xae46('0x46')]({'where':{'id':_0x4ba5c2[_0xae46('0x3a')]['id']}})[_0xae46('0x12')](handleEntityNotFound(_0x1dd47e,null))[_0xae46('0x12')](removeEntity(_0x1dd47e,null))[_0xae46('0x38')](handleError(_0x1dd47e,null));};exports[_0xae46('0x48')]=function(_0x354760,_0x48be6c){return db[_0xae46('0x1b')][_0xae46('0x49')]({'where':{'id':_0x354760[_0xae46('0x3a')]['id']},'raw':!![]})[_0xae46('0x12')](function(_0x5013c8){if(!_0x5013c8)return _0x48be6c[_0xae46('0x8')](0x194);return{'url':oauth[_0xae46('0x4a')](_0x5013c8,_0x354760['user']['id'])};})['then'](respondWithResult(_0x48be6c,null))[_0xae46('0x38')](handleError(_0x48be6c,null));};exports[_0xae46('0x4b')]=function(_0x3d24ff,_0x25ac14){var _0x253008=_0x3d24ff[_0xae46('0x40')];var _0x43eeca;var _0xfee1b8;if(_0x253008['error'])throw _0x253008;redis[_0xae46('0x4c')](_0x253008['state'])[_0xae46('0x12')](function(_0x5e1f99){if(!_0x5e1f99)throw new Error('Invalid\x20state\x20parameter');_0x43eeca=JSON[_0xae46('0x4d')](_0x5e1f99);var _0x42ace2=Buffer[_0xae46('0x4e')](_0x253008[_0xae46('0x4f')],_0xae46('0x50'))[_0xae46('0x51')]('ascii');_0xfee1b8=JSON[_0xae46('0x4d')](_0x42ace2);if(!oauth[_0xae46('0x52')](_0x253008[_0xae46('0x53')],_0x43eeca['oauth2Claims']))throw new Error(_0xae46('0x54'));redis[_0xae46('0x55')](_0x253008[_0xae46('0x4f')]);return oauth[_0xae46('0x56')](_0x253008[_0xae46('0x57')],_0x43eeca);})[_0xae46('0x12')](function(_0x2ebd31){_0x43eeca[_0xae46('0x58')]=_0x2ebd31['access_token'];_0x43eeca['data6']=_0x2ebd31['refresh_token'];return db[_0xae46('0x1b')]['update']({'data5':_0x43eeca['data5'],'data6':_0x43eeca[_0xae46('0x59')]},{'where':{'id':_0x43eeca['id']}});})[_0xae46('0x12')](function(){oauth['startRefreshInterval'](_0x43eeca);socket[_0xae46('0x5a')](_0xae46('0x5b'),{'id':_0xfee1b8['id']});return;})[_0xae46('0x12')](respondWithStatusCode(_0x25ac14,null))[_0xae46('0x38')](function(_0x3a64b6){if(_0xfee1b8){socket['emit']('microsoftAuthorization:error',{'id':_0xfee1b8['id']});}if(!_0x43eeca){logger[_0xae46('0x13')]('Invalid\x20authentication\x20state\x20parameter',_0x3a64b6);return _0x25ac14['status'](0x1f4)['send'](_0x3a64b6[_0xae46('0x5c')]);}logger[_0xae46('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x43eeca['id'],JSON[_0xae46('0x5d')](_0x3a64b6));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index ae1f2a9..9333f6e 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 _0x0ce2=['cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x1eb4c4,_0xb7bafc){var _0xdcd99a=function(_0x3bbec3){while(--_0x3bbec3){_0x1eb4c4['push'](_0x1eb4c4['shift']());}};_0xdcd99a(++_0xb7bafc);}(_0x0ce2,0xb7));var _0x20ce=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0ce2[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x20ce('0x0'));var util=require('util');var logger=require(_0x20ce('0x1'))(_0x20ce('0x2'));var moment=require(_0x20ce('0x3'));var BPromise=require(_0x20ce('0x4'));var rp=require(_0x20ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20ce('0x6'));var config=require(_0x20ce('0x7'));var attributes=require(_0x20ce('0x8'));module[_0x20ce('0x9')]=function(_0x13633f,_0x641e06){return _0x13633f[_0x20ce('0xa')](_0x20ce('0xb'),attributes,{'tableName':_0x20ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x357a=['./cloudProvider.attributes','exports','define','cloud_providers','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x278596,_0x26b3ae){var _0x4b0e5a=function(_0x5f2cdc){while(--_0x5f2cdc){_0x278596['push'](_0x278596['shift']());}};_0x4b0e5a(++_0x26b3ae);}(_0x357a,0x154));var _0xa357=function(_0x16b16f,_0x4a9cb6){_0x16b16f=_0x16b16f-0x0;var _0x45b687=_0x357a[_0x16b16f];return _0x45b687;};'use strict';var _=require(_0xa357('0x0'));var util=require('util');var logger=require(_0xa357('0x1'))(_0xa357('0x2'));var moment=require(_0xa357('0x3'));var BPromise=require(_0xa357('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa357('0x5'));var rimraf=require(_0xa357('0x6'));var config=require(_0xa357('0x7'));var attributes=require(_0xa357('0x8'));module[_0xa357('0x9')]=function(_0x5336a5,_0xd78cc2){return _0x5336a5[_0xa357('0xa')]('CloudProvider',attributes,{'tableName':_0xa357('0xb'),'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 63d28dc..f559447 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 _0xddff=['data5','access_token','refresh_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','ioredis','request-promise','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','map','type','push','data7','/.default','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','hex','client_id','join','redirect_uri','data4','response_mode','form_post','scope','state','prompt','login','key','value','oauth2/','data1','decode','payload','iss','issuer','aud','audience','nonce','isAfter','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST'];(function(_0x3a8ef5,_0x146321){var _0x785721=function(_0x838a39){while(--_0x838a39){_0x3a8ef5['push'](_0x3a8ef5['shift']());}};_0x785721(++_0x146321);}(_0xddff,0x135));var _0xfddf=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0xddff[_0x44cb92];return _0x56b9e6;};'use strict';var _=require(_0xfddf('0x0'));var crypto=require(_0xfddf('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0xfddf('0x2'));var rp=require(_0xfddf('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xfddf('0x4'));var logger=require(_0xfddf('0x5'))('api');var schedule=require(_0xfddf('0x6'));var db=require(_0xfddf('0x7'))['db'];config[_0xfddf('0x8')]=_[_0xfddf('0x9')](config[_0xfddf('0x8')],{'host':_0xfddf('0xa'),'port':0x18eb});var redis=new Redis(config[_0xfddf('0x8')]);var MICROSOFT_AUTH_URL=_0xfddf('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xfddf('0xc'),'profile',_0xfddf('0xd'),_0xfddf('0xe'),_0xfddf('0xf'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xfddf('0xc'),_0xfddf('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x37f0e0){var _0x32b97e=_[_0xfddf('0x10')](AZURE_AUTH_SCOPES[_0x37f0e0[_0xfddf('0x11')]]);if(_0x37f0e0[_0xfddf('0x11')]==='Dynamics365')_0x32b97e[_0xfddf('0x12')](_0x37f0e0[_0xfddf('0x13')]+_0xfddf('0x14'));return _0x32b97e['join']('\x20');}function getAccessTokenScope(_0x27a294){if(_0x27a294[_0xfddf('0x11')]==='Outlook365')return _0xfddf('0xf');if(_0x27a294[_0xfddf('0x11')]===_0xfddf('0x15'))return _0x27a294[_0xfddf('0x13')]+_0xfddf('0x14');}function generateMicrosoftAuthorizationUrl(_0x4ba5e6,_0x5b9956){var _0x3a5642=MICROSOFT_AUTH_URL[_0xfddf('0x16')](_0xfddf('0x17'),_0x4ba5e6[_0xfddf('0x18')]);var _0x2210ec=[_0xfddf('0x19'),_0xfddf('0x1a')];var _0x361382=Buffer[_0xfddf('0x1b')](JSON[_0xfddf('0x1c')]({'id':_0x5b9956}))['toString']('base64');var _0x5d20e9=crypto[_0xfddf('0x1d')](0x10)['toString'](_0xfddf('0x1e'));var _0x554905=getAuthorizationScopes(_0x4ba5e6);var _0xca5b2=[{'key':_0xfddf('0x1f'),'value':_0x4ba5e6['data1']},{'key':'response_type','value':encodeURIComponent(_0x2210ec[_0xfddf('0x20')]('\x20'))},{'key':_0xfddf('0x21'),'value':_0x4ba5e6[_0xfddf('0x22')]},{'key':_0xfddf('0x23'),'value':_0xfddf('0x24')},{'key':_0xfddf('0x25'),'value':encodeURIComponent(_0x554905)},{'key':_0xfddf('0x26'),'value':_0x361382},{'key':'nonce','value':_0x5d20e9},{'key':_0xfddf('0x27'),'value':_0xfddf('0x28')}];var _0x54cacb=_0x3a5642+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xfddf('0x10')](_0xca5b2,function(_0x188d3e){return _0x188d3e[_0xfddf('0x29')]+'='+_0x188d3e[_0xfddf('0x2a')];})[_0xfddf('0x20')]('&');_0x4ba5e6['oauth2Claims']={'issuer':_0x3a5642[_0xfddf('0x16')](_0xfddf('0x2b'),''),'audience':_0x4ba5e6[_0xfddf('0x2c')],'state':_0x361382,'nonce':_0x5d20e9};redis['set'](_0x361382,JSON['stringify'](_0x4ba5e6));return _0x54cacb;}function isValidIdToken(_0x1bbe20,_0x153592){try{var _0x24fe91=jwt[_0xfddf('0x2d')](_0x1bbe20,{'complete':!![]});var _0x5221fc=_0x24fe91[_0xfddf('0x2e')];if(_0x5221fc[_0xfddf('0x2f')]!==_0x153592[_0xfddf('0x30')])return![];if(_0x5221fc[_0xfddf('0x31')]!==_0x153592[_0xfddf('0x32')])return![];if(_0x5221fc[_0xfddf('0x33')]!==_0x153592[_0xfddf('0x33')])return![];if(moment()[_0xfddf('0x34')](moment['unix'](_0x5221fc['exp'])))return![];return!![];}catch(_0x60b68c){throw _0x60b68c;}}function refreshOauth2MicrosoftAccessToken(_0x337876){return Promise[_0xfddf('0x35')]()[_0xfddf('0x36')](function(){if(_0x337876[_0xfddf('0x37')])return _0x337876;return db[_0xfddf('0x38')][_0xfddf('0x39')]({'where':{'id':_0x337876['id']},'raw':!![]});})[_0xfddf('0x36')](function(_0x4e20a4){var _0x2cb351={'grant_type':'refresh_token','refresh_token':_0x4e20a4[_0xfddf('0x3a')],'scope':getAccessTokenScope(_0x4e20a4),'redirect_uri':_0x4e20a4[_0xfddf('0x22')],'client_id':_0x4e20a4[_0xfddf('0x2c')],'client_secret':encryptor[_0xfddf('0x3b')](_0x4e20a4[_0xfddf('0x37')])};var _0x28f216={'method':_0xfddf('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xfddf('0x16')](_0xfddf('0x17'),_0x4e20a4[_0xfddf('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cb351,'json':!![]};return rp(_0x28f216);})[_0xfddf('0x36')](function(_0x309226){_0x337876[_0xfddf('0x3d')]=_0x309226[_0xfddf('0x3e')];_0x337876['data6']=_0x309226[_0xfddf('0x3f')];return db['CloudProvider']['update']({'data5':_0x337876[_0xfddf('0x3d')],'data6':_0x337876[_0xfddf('0x3a')]},{'where':{'id':_0x337876['id']}});})[_0xfddf('0x36')](function(){return _0x337876;})['catch'](function(_0x15612a){logger[_0xfddf('0x40')](_0xfddf('0x41'),_0x337876['id'],_0x15612a);});}function getOauth2MicrosoftAccessToken(_0xc32447,_0x18f98e){var _0x176bc3={'grant_type':_0xfddf('0x42'),'code':_0xc32447,'scope':getAccessTokenScope(_0x18f98e),'redirect_uri':_0x18f98e[_0xfddf('0x22')],'client_id':_0x18f98e[_0xfddf('0x2c')],'client_secret':encryptor[_0xfddf('0x3b')](_0x18f98e[_0xfddf('0x37')])};var _0x2fc101={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xfddf('0x16')](_0xfddf('0x17'),_0x18f98e[_0xfddf('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x176bc3,'json':!![]};return rp(_0x2fc101);}function startRefreshInterval(_0x52950a){var _0x8c36c0=schedule[_0xfddf('0x43')];if(_0x8c36c0[_0x52950a['id']])clearInterval(_0x8c36c0[_0x52950a['id']]);_0x8c36c0[_0x52950a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfddf('0x44')](this,{'id':_0x52950a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfddf('0x43')]=_0x8c36c0;}function startAllRefreshIntervals(){return db[_0xfddf('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xfddf('0x36')](function(_0x2179fb){var _0xe53538=_0x2179fb[_0xfddf('0x10')](function(_0x1161ad){return refreshOauth2MicrosoftAccessToken(_0x1161ad)[_0xfddf('0x36')](function(_0xbc0927){startRefreshInterval(_0xbc0927);});});return Promise[_0xfddf('0x45')](_0xe53538);})[_0xfddf('0x46')](function(_0x23a236){var _0x215740=_0x23a236?util[_0xfddf('0x47')](_0x23a236,{'showHidden':![],'depth':null}):'';logger[_0xfddf('0x40')](_0xfddf('0x48'),_0x215740);});}module[_0xfddf('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x85e7=['Dynamics365','push','data7','Outlook365','/.default','replace','code','from','stringify','toString','base64','randomBytes','client_id','response_type','join','redirect_uri','response_mode','form_post','scope','nonce','prompt','login','oauth2/','data1','set','decode','payload','iss','audience','isAfter','exp','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','POST','{TENANT_ID}','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type'];(function(_0x405299,_0x5c02b5){var _0x5e0f2e=function(_0x2a10c9){while(--_0x2a10c9){_0x405299['push'](_0x405299['shift']());}};_0x5e0f2e(++_0x5c02b5);}(_0x85e7,0x1a2));var _0x785e=function(_0x27ba12,_0x23ca8a){_0x27ba12=_0x27ba12-0x0;var _0x5a4834=_0x85e7[_0x27ba12];return _0x5a4834;};'use strict';var _=require('lodash');var crypto=require(_0x785e('0x0'));var jwt=require(_0x785e('0x1'));var moment=require('moment');var Redis=require(_0x785e('0x2'));var rp=require('request-promise');var util=require(_0x785e('0x3'));var encryptor=require(_0x785e('0x4'));var config=require(_0x785e('0x5'));var logger=require(_0x785e('0x6'))('api');var schedule=require(_0x785e('0x7'));var db=require(_0x785e('0x8'))['db'];config[_0x785e('0x9')]=_['defaults'](config[_0x785e('0x9')],{'host':_0x785e('0xa'),'port':0x18eb});var redis=new Redis(config[_0x785e('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x785e('0xb'),_0x785e('0xc'),'email',_0x785e('0xd'),_0x785e('0xe'),_0x785e('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x785e('0xb'),_0x785e('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x785e('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x785e('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1936b6){var _0x5d0584=_[_0x785e('0x12')](AZURE_AUTH_SCOPES[_0x1936b6['type']]);if(_0x1936b6[_0x785e('0x13')]===_0x785e('0x14'))_0x5d0584[_0x785e('0x15')](_0x1936b6[_0x785e('0x16')]+'/.default');return _0x5d0584['join']('\x20');}function getAccessTokenScope(_0x1d0439){if(_0x1d0439[_0x785e('0x13')]===_0x785e('0x17'))return _0x785e('0xe');if(_0x1d0439['type']===_0x785e('0x14'))return _0x1d0439[_0x785e('0x16')]+_0x785e('0x18');}function generateMicrosoftAuthorizationUrl(_0x2cb246,_0x3ff156){var _0x36d623=MICROSOFT_AUTH_URL[_0x785e('0x19')]('{TENANT_ID}',_0x2cb246['data2']);var _0xd0e6ab=[_0x785e('0x1a'),'id_token'];var _0x25faca=Buffer[_0x785e('0x1b')](JSON[_0x785e('0x1c')]({'id':_0x3ff156}))[_0x785e('0x1d')](_0x785e('0x1e'));var _0x45b0e1=crypto[_0x785e('0x1f')](0x10)[_0x785e('0x1d')]('hex');var _0x4cc9cb=getAuthorizationScopes(_0x2cb246);var _0x59ee68=[{'key':_0x785e('0x20'),'value':_0x2cb246['data1']},{'key':_0x785e('0x21'),'value':encodeURIComponent(_0xd0e6ab[_0x785e('0x22')]('\x20'))},{'key':_0x785e('0x23'),'value':_0x2cb246['data4']},{'key':_0x785e('0x24'),'value':_0x785e('0x25')},{'key':_0x785e('0x26'),'value':encodeURIComponent(_0x4cc9cb)},{'key':'state','value':_0x25faca},{'key':_0x785e('0x27'),'value':_0x45b0e1},{'key':_0x785e('0x28'),'value':_0x785e('0x29')}];var _0x54e9ee=_0x36d623+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x785e('0x12')](_0x59ee68,function(_0x516852){return _0x516852['key']+'='+_0x516852['value'];})['join']('&');_0x2cb246['oauth2Claims']={'issuer':_0x36d623[_0x785e('0x19')](_0x785e('0x2a'),''),'audience':_0x2cb246[_0x785e('0x2b')],'state':_0x25faca,'nonce':_0x45b0e1};redis[_0x785e('0x2c')](_0x25faca,JSON[_0x785e('0x1c')](_0x2cb246));return _0x54e9ee;}function isValidIdToken(_0x362db4,_0x5a81ea){try{var _0x39c699=jwt[_0x785e('0x2d')](_0x362db4,{'complete':!![]});var _0x2965a6=_0x39c699[_0x785e('0x2e')];if(_0x2965a6[_0x785e('0x2f')]!==_0x5a81ea['issuer'])return![];if(_0x2965a6['aud']!==_0x5a81ea[_0x785e('0x30')])return![];if(_0x2965a6[_0x785e('0x27')]!==_0x5a81ea[_0x785e('0x27')])return![];if(moment()[_0x785e('0x31')](moment['unix'](_0x2965a6[_0x785e('0x32')])))return![];return!![];}catch(_0x37336a){throw _0x37336a;}}function refreshOauth2MicrosoftAccessToken(_0x25b4dd){return Promise['resolve']()[_0x785e('0x33')](function(){if(_0x25b4dd['data3'])return _0x25b4dd;return db[_0x785e('0x34')]['findOne']({'where':{'id':_0x25b4dd['id']},'raw':!![]});})[_0x785e('0x33')](function(_0x1b3a23){var _0x31c2ea={'grant_type':_0x785e('0x35'),'refresh_token':_0x1b3a23[_0x785e('0x36')],'scope':getAccessTokenScope(_0x1b3a23),'redirect_uri':_0x1b3a23[_0x785e('0x37')],'client_id':_0x1b3a23[_0x785e('0x2b')],'client_secret':encryptor[_0x785e('0x38')](_0x1b3a23[_0x785e('0x39')])};var _0xf82c17={'method':_0x785e('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x785e('0x19')](_0x785e('0x3b'),_0x1b3a23[_0x785e('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31c2ea,'json':!![]};return rp(_0xf82c17);})[_0x785e('0x33')](function(_0x841339){_0x25b4dd[_0x785e('0x3d')]=_0x841339[_0x785e('0x3e')];_0x25b4dd[_0x785e('0x36')]=_0x841339['refresh_token'];return db[_0x785e('0x34')][_0x785e('0x3f')]({'data5':_0x25b4dd[_0x785e('0x3d')],'data6':_0x25b4dd[_0x785e('0x36')]},{'where':{'id':_0x25b4dd['id']}});})[_0x785e('0x33')](function(){return _0x25b4dd;})[_0x785e('0x40')](function(_0x57bf50){logger[_0x785e('0x41')](_0x785e('0x42'),_0x25b4dd['id'],_0x57bf50);});}function getOauth2MicrosoftAccessToken(_0x1d82f8,_0x358acd){var _0x577f7d={'grant_type':'authorization_code','code':_0x1d82f8,'scope':getAccessTokenScope(_0x358acd),'redirect_uri':_0x358acd[_0x785e('0x37')],'client_id':_0x358acd['data1'],'client_secret':encryptor[_0x785e('0x38')](_0x358acd[_0x785e('0x39')])};var _0x214219={'method':_0x785e('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x785e('0x19')]('{TENANT_ID}',_0x358acd[_0x785e('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x577f7d,'json':!![]};return rp(_0x214219);}function startRefreshInterval(_0xee7055){var _0x6b9b19=schedule[_0x785e('0x43')];if(_0x6b9b19[_0xee7055['id']])clearInterval(_0x6b9b19[_0xee7055['id']]);_0x6b9b19[_0xee7055['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xee7055['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x785e('0x43')]=_0x6b9b19;}function startAllRefreshIntervals(){return db[_0x785e('0x34')][_0x785e('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x785e('0x33')](function(_0x279639){var _0x558e33=_0x279639[_0x785e('0x12')](function(_0x3faa23){return refreshOauth2MicrosoftAccessToken(_0x3faa23)[_0x785e('0x33')](function(_0x2cdee7){startRefreshInterval(_0x2cdee7);});});return Promise[_0x785e('0x45')](_0x558e33);})[_0x785e('0x40')](function(_0x309149){var _0x59e728=_0x309149?util[_0x785e('0x46')](_0x309149,{'showHidden':![],'depth':null}):'';logger[_0x785e('0x41')](_0x785e('0x47'),_0x59e728);});}module[_0x785e('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 d31dd6c..b007d6a 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 _0x19cb=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x438d52,_0x51347d){var _0x18676f=function(_0xa5857){while(--_0xa5857){_0x438d52['push'](_0x438d52['shift']());}};_0x18676f(++_0x51347d);}(_0x19cb,0x146));var _0xb19c=function(_0x353a15,_0x4e4f37){_0x353a15=_0x353a15-0x0;var _0x3624c4=_0x19cb[_0x353a15];return _0x3624c4;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb19c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb19c('0x4'));var jayson=require(_0xb19c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6a30,_0x477ac1,_0x35c200){return new BPromise(function(_0x262354,_0x5d50d4){return client['request'](_0x2d6a30,_0x35c200)[_0xb19c('0x6')](function(_0x3ffb45){logger[_0xb19c('0x7')](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));logger['debug'](_0xb19c('0xa'),_0x477ac1,_0xb19c('0x9'),JSON[_0xb19c('0xb')](_0x3ffb45));if(_0x3ffb45[_0xb19c('0xc')]){if(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xd')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x477ac1,_0x3ffb45['error'][_0xb19c('0xe')]);return _0x5d50d4(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);}logger['error'](_0xb19c('0x8'),_0x477ac1,_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);return _0x262354(_0x3ffb45['error'][_0xb19c('0xe')]);}else{logger['info'](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));_0x262354(_0x3ffb45[_0xb19c('0xf')][_0xb19c('0xe')]);}})[_0xb19c('0x10')](function(_0x5bae0a){logger[_0xb19c('0xc')](_0xb19c('0x8'),_0x477ac1,_0x5bae0a);_0x5d50d4(_0x5bae0a);});});} \ No newline at end of file +var _0xde46=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a31cc,_0x1827ec){var _0x44f59a=function(_0x5eb20e){while(--_0x5eb20e){_0x1a31cc['push'](_0x1a31cc['shift']());}};_0x44f59a(++_0x1827ec);}(_0xde46,0x14e));var _0x6de4=function(_0x30ec49,_0xa4744b){_0x30ec49=_0x30ec49-0x0;var _0xe10a45=_0xde46[_0x30ec49];return _0xe10a45;};'use strict';var _=require(_0x6de4('0x0'));var util=require(_0x6de4('0x1'));var moment=require(_0x6de4('0x2'));var BPromise=require(_0x6de4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6de4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6de4('0x5'))(_0x6de4('0x6'));var config=require(_0x6de4('0x7'));var jayson=require(_0x6de4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17f7ae,_0x507ca0,_0xb20ddf){return new BPromise(function(_0x12d3bb,_0x503d50){return client[_0x6de4('0x9')](_0x17f7ae,_0xb20ddf)[_0x6de4('0xa')](function(_0xe81ab9){logger[_0x6de4('0xb')](_0x6de4('0xc'),_0x507ca0,_0x6de4('0xd'));logger[_0x6de4('0xe')](_0x6de4('0xf'),_0x507ca0,_0x6de4('0xd'),JSON[_0x6de4('0x10')](_0xe81ab9));if(_0xe81ab9[_0x6de4('0x11')]){if(_0xe81ab9['error'][_0x6de4('0x12')]===0x1f4){logger[_0x6de4('0x11')](_0x6de4('0xc'),_0x507ca0,_0xe81ab9[_0x6de4('0x11')][_0x6de4('0x13')]);return _0x503d50(_0xe81ab9[_0x6de4('0x11')][_0x6de4('0x13')]);}logger[_0x6de4('0x11')]('CloudProvider,\x20%s,\x20%s',_0x507ca0,_0xe81ab9[_0x6de4('0x11')]['message']);return _0x12d3bb(_0xe81ab9[_0x6de4('0x11')][_0x6de4('0x13')]);}else{logger[_0x6de4('0xb')]('CloudProvider,\x20%s,\x20%s',_0x507ca0,_0x6de4('0xd'));_0x12d3bb(_0xe81ab9[_0x6de4('0x14')][_0x6de4('0x13')]);}})[_0x6de4('0x15')](function(_0x4b1584){logger[_0x6de4('0x11')]('CloudProvider,\x20%s,\x20%s',_0x507ca0,_0x4b1584);_0x503d50(_0x4b1584);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 62962a3..1f6919c 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x5f2f,0x73));var _0xf5f2=function(_0xb45535,_0xc4abac){_0xb45535=_0xb45535-0x0;var _0x4872cd=_0x5f2f[_0xb45535];return _0x4872cd;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x41de0e,_0x12bcbe){var _0x727b80=function(_0x281deb){while(--_0x281deb){_0x41de0e['push'](_0x41de0e['shift']());}};_0x727b80(++_0x12bcbe);}(_0x2ef3,0xba));var _0x32ef=function(_0x407710,_0x4df452){_0x407710=_0x407710-0x0;var _0xba8ce0=_0x2ef3[_0x407710];return _0xba8ce0;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 5273619..19ca1b5 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 _0xfb43=['sequelize','exports','STRING'];(function(_0x3066b2,_0xff39a6){var _0x2c37f4=function(_0x2efa9d){while(--_0x2efa9d){_0x3066b2['push'](_0x3066b2['shift']());}};_0x2c37f4(++_0xff39a6);}(_0xfb43,0xfc));var _0x3fb4=function(_0x8b24af,_0x43b130){_0x8b24af=_0x8b24af-0x0;var _0x4e061c=_0xfb43[_0x8b24af];return _0x4e061c;};'use strict';var Sequelize=require(_0x3fb4('0x0'));module[_0x3fb4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3fb4('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x3fb4('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3fb4('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3fb4('0x2')]},'city':{'type':Sequelize[_0x3fb4('0x2')]},'country':{'type':Sequelize[_0x3fb4('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3fb4('0x2')]},'sCountry':{'type':Sequelize[_0x3fb4('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3cfa=['STRING','sequelize','exports','name'];(function(_0x28a757,_0x14c700){var _0x141d1f=function(_0x118c17){while(--_0x118c17){_0x28a757['push'](_0x28a757['shift']());}};_0x141d1f(++_0x14c700);}(_0x3cfa,0x129));var _0xa3cf=function(_0xdfa86d,_0x465c6a){_0xdfa86d=_0xdfa86d-0x0;var _0x71d6cc=_0x3cfa[_0xdfa86d];return _0x71d6cc;};'use strict';var Sequelize=require(_0xa3cf('0x0'));module[_0xa3cf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa3cf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa3cf('0x3')]},'companyId':{'type':Sequelize[_0xa3cf('0x3')]},'website':{'type':Sequelize[_0xa3cf('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa3cf('0x3')]},'street':{'type':Sequelize[_0xa3cf('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa3cf('0x3')]},'email':{'type':Sequelize[_0xa3cf('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xa3cf('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa3cf('0x3')]},'sCountry':{'type':Sequelize[_0xa3cf('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6e59580..acaabe2 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 _0x69ca=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','catch','params','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','getContacts','findOne','CmContact','map','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','save','update','then','destroy','get','UserProfileResource','stack','name','index','CmCompany','model','keys','query','intersection','fields','attributes','length'];(function(_0x18412f,_0x441675){var _0x130b9d=function(_0x4a3aff){while(--_0x4a3aff){_0x18412f['push'](_0x18412f['shift']());}};_0x130b9d(++_0x441675);}(_0x69ca,0x1be));var _0xa69c=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x69ca[_0x276468];return _0x36dc3a;};'use strict';var emlformat=require(_0xa69c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa69c('0x1'));var rp=require(_0xa69c('0x2'));var moment=require(_0xa69c('0x3'));var BPromise=require(_0xa69c('0x4'));var Mustache=require(_0xa69c('0x5'));var util=require('util');var path=require(_0xa69c('0x6'));var sox=require(_0xa69c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa69c('0x8'));var _=require(_0xa69c('0x9'));var squel=require(_0xa69c('0xa'));var crypto=require(_0xa69c('0xb'));var jsforce=require(_0xa69c('0xc'));var deskjs=require(_0xa69c('0xd'));var toCsv=require(_0xa69c('0xe'));var querystring=require('querystring');var Papa=require(_0xa69c('0xf'));var Redis=require(_0xa69c('0x10'));var authService=require(_0xa69c('0x11'));var qs=require(_0xa69c('0x12'));var as=require(_0xa69c('0x13'));var hardwareService=require(_0xa69c('0x14'));var logger=require(_0xa69c('0x15'))('api');var utils=require(_0xa69c('0x16'));var config=require(_0xa69c('0x17'));var licenseUtil=require(_0xa69c('0x18'));var db=require(_0xa69c('0x19'))['db'];function respondWithStatusCode(_0x1a63ea,_0x4edd81){_0x4edd81=_0x4edd81||0xcc;return function(_0x441a01){if(_0x441a01){return _0x1a63ea[_0xa69c('0x1a')](_0x4edd81);}return _0x1a63ea['status'](_0x4edd81)[_0xa69c('0x1b')]();};}function respondWithResult(_0x352323,_0x4c1ea5){_0x4c1ea5=_0x4c1ea5||0xc8;return function(_0x22055d){if(_0x22055d){return _0x352323['status'](_0x4c1ea5)[_0xa69c('0x1c')](_0x22055d);}};}function respondWithFilteredResult(_0x571cd3,_0x299b5a){return function(_0x41b683){if(_0x41b683){var _0x22bba6=typeof _0x299b5a[_0xa69c('0x1d')]===_0xa69c('0x1e')&&typeof _0x299b5a[_0xa69c('0x1f')]==='undefined';var _0x352377=_0x41b683[_0xa69c('0x20')];var _0x3d4875=_0x22bba6?0x0:_0x299b5a['offset'];var _0x1477f5=_0x22bba6?_0x41b683[_0xa69c('0x20')]:_0x299b5a[_0xa69c('0x1d')]+_0x299b5a[_0xa69c('0x1f')];var _0x3e78a0;if(_0x1477f5>=_0x352377){_0x1477f5=_0x352377;_0x3e78a0=0xc8;}else{_0x3e78a0=0xce;}_0x571cd3[_0xa69c('0x21')](_0x3e78a0);return _0x571cd3['set']('Content-Range',_0x3d4875+'-'+_0x1477f5+'/'+_0x352377)['json'](_0x41b683);}return null;};}function patchUpdates(_0x172a96){return function(_0xe19553){try{jsonpatch[_0xa69c('0x22')](_0xe19553,_0x172a96,!![]);}catch(_0x58bc5a){return BPromise['reject'](_0x58bc5a);}return _0xe19553[_0xa69c('0x23')]();};}function saveUpdates(_0x3bd102,_0x7b250){return function(_0x21a380){if(_0x21a380){return _0x21a380[_0xa69c('0x24')](_0x3bd102)[_0xa69c('0x25')](function(_0x108878){return _0x108878;});}return null;};}function removeEntity(_0x545d45,_0x1cd29f){return function(_0x5d9658){if(_0x5d9658){return _0x5d9658[_0xa69c('0x26')]()[_0xa69c('0x25')](function(){var _0x452e0c=_0x5d9658[_0xa69c('0x27')]({'plain':!![]});var _0x3c4bc4='Companies';return db[_0xa69c('0x28')][_0xa69c('0x26')]({'where':{'type':_0x3c4bc4,'resourceId':_0x452e0c['id']}})[_0xa69c('0x25')](function(){return _0x5d9658;});})['then'](function(){_0x545d45[_0xa69c('0x21')](0xcc)[_0xa69c('0x1b')]();});}};}function handleEntityNotFound(_0x53ab05,_0x459c49){return function(_0x429683){if(!_0x429683){_0x53ab05[_0xa69c('0x1a')](0x194);}return _0x429683;};}function handleError(_0x866bb0,_0xca3886){_0xca3886=_0xca3886||0x1f4;return function(_0x469c8e){logger['error'](_0x469c8e[_0xa69c('0x29')]);if(_0x469c8e[_0xa69c('0x2a')]){delete _0x469c8e[_0xa69c('0x2a')];}_0x866bb0[_0xa69c('0x21')](_0xca3886)['send'](_0x469c8e);};}exports[_0xa69c('0x2b')]=function(_0x244a81,_0x22c7e0){var _0x26df5f={},_0x265a87={},_0x3f4f9e={'count':0x0,'rows':[]};return db[_0xa69c('0x2c')]['describe']()[_0xa69c('0x25')](function(_0x28a1cb){_0x265a87[_0xa69c('0x2d')]=_[_0xa69c('0x2e')](_0x28a1cb);_0x265a87[_0xa69c('0x2f')]=_[_0xa69c('0x2e')](_0x244a81[_0xa69c('0x2f')]);_0x265a87['filters']=_['intersection'](_0x265a87[_0xa69c('0x2d')],_0x265a87[_0xa69c('0x2f')]);_0x26df5f['attributes']=_[_0xa69c('0x30')](_0x265a87[_0xa69c('0x2d')],qs[_0xa69c('0x31')](_0x244a81[_0xa69c('0x2f')][_0xa69c('0x31')]));_0x26df5f[_0xa69c('0x32')]=_0x26df5f[_0xa69c('0x32')][_0xa69c('0x33')]?_0x26df5f[_0xa69c('0x32')]:_0x265a87[_0xa69c('0x2d')];if(!_0x244a81[_0xa69c('0x2f')][_0xa69c('0x34')](_0xa69c('0x35'))){_0x26df5f['limit']=qs['limit'](_0x244a81['query']['limit']);_0x26df5f[_0xa69c('0x1d')]=qs[_0xa69c('0x1d')](_0x244a81[_0xa69c('0x2f')][_0xa69c('0x1d')]);}_0x26df5f[_0xa69c('0x36')]=qs[_0xa69c('0x37')](_0x244a81[_0xa69c('0x2f')][_0xa69c('0x37')]);_0x26df5f[_0xa69c('0x38')]=qs[_0xa69c('0x39')](_[_0xa69c('0x3a')](_0x244a81['query'],_0x265a87[_0xa69c('0x39')]),_0x28a1cb);if(_0x244a81[_0xa69c('0x2f')][_0xa69c('0x3b')]){_0x26df5f[_0xa69c('0x38')]=_['merge'](_0x26df5f[_0xa69c('0x38')],{'$or':_['map'](_0x26df5f[_0xa69c('0x32')],function(_0x406111){var _0x54b2d8={};_0x54b2d8[_0x406111]={'$like':'%'+_0x244a81['query']['filter']+'%'};return _0x54b2d8;})});}_0x26df5f=_[_0xa69c('0x3c')]({},_0x26df5f,_0x244a81['options']);var _0x24f21b={'where':_0x26df5f[_0xa69c('0x38')]};return db[_0xa69c('0x2c')][_0xa69c('0x20')](_0x24f21b)[_0xa69c('0x25')](function(_0x307ef0){_0x3f4f9e[_0xa69c('0x20')]=_0x307ef0;if(_0x244a81[_0xa69c('0x2f')][_0xa69c('0x3d')]){_0x26df5f[_0xa69c('0x3e')]=[{'all':!![]}];}return db[_0xa69c('0x2c')]['findAll'](_0x26df5f);})[_0xa69c('0x25')](function(_0x451d95){_0x3f4f9e['rows']=_0x451d95;return _0x3f4f9e;})[_0xa69c('0x25')](respondWithFilteredResult(_0x22c7e0,_0x26df5f))['catch'](handleError(_0x22c7e0,null));})[_0xa69c('0x3f')](handleError(_0x22c7e0,null));};exports['show']=function(_0x188c6c,_0x2b6d8a){var _0x471e34={'raw':![],'where':{'id':_0x188c6c[_0xa69c('0x40')]['id']}},_0x40899c={};_0x40899c[_0xa69c('0x2d')]=_[_0xa69c('0x2e')](db[_0xa69c('0x2c')]['rawAttributes']);_0x40899c[_0xa69c('0x2f')]=_[_0xa69c('0x2e')](_0x188c6c[_0xa69c('0x2f')]);_0x40899c[_0xa69c('0x39')]=_['intersection'](_0x40899c[_0xa69c('0x2d')],_0x40899c[_0xa69c('0x2f')]);_0x471e34[_0xa69c('0x32')]=_[_0xa69c('0x30')](_0x40899c['model'],qs['fields'](_0x188c6c[_0xa69c('0x2f')][_0xa69c('0x31')]));_0x471e34['attributes']=_0x471e34['attributes'][_0xa69c('0x33')]?_0x471e34['attributes']:_0x40899c['model'];if(_0x188c6c[_0xa69c('0x2f')][_0xa69c('0x3d')]){_0x471e34[_0xa69c('0x3e')]=[{'all':!![]}];}_0x471e34=_[_0xa69c('0x3c')]({},_0x471e34,_0x188c6c[_0xa69c('0x41')]);return db[_0xa69c('0x2c')]['find'](_0x471e34)[_0xa69c('0x25')](handleEntityNotFound(_0x2b6d8a,null))[_0xa69c('0x25')](respondWithResult(_0x2b6d8a,null))[_0xa69c('0x3f')](handleError(_0x2b6d8a,null));};exports[_0xa69c('0x42')]=function(_0x28eb6b,_0x289361){return db[_0xa69c('0x2c')][_0xa69c('0x42')](_0x28eb6b['body'],{})[_0xa69c('0x25')](function(_0x3975b9){var _0x21cf9a=_0x28eb6b['user'][_0xa69c('0x27')]({'plain':!![]});if(!_0x21cf9a)throw new Error(_0xa69c('0x43'));if(_0x21cf9a[_0xa69c('0x44')]===_0xa69c('0x45')){var _0x15eeb8=_0x3975b9[_0xa69c('0x27')]({'plain':!![]});var _0xdc577b=_0xa69c('0x46');return db['UserProfileSection'][_0xa69c('0x47')]({'where':{'name':_0xdc577b,'userProfileId':_0x21cf9a['userProfileId']},'raw':!![]})[_0xa69c('0x25')](function(_0x4e1d1d){if(_0x4e1d1d&&_0x4e1d1d[_0xa69c('0x48')]===0x0){return db[_0xa69c('0x28')][_0xa69c('0x42')]({'name':_0x15eeb8[_0xa69c('0x2a')],'resourceId':_0x15eeb8['id'],'type':_0x4e1d1d[_0xa69c('0x2a')],'sectionId':_0x4e1d1d['id']},{})[_0xa69c('0x25')](function(){return _0x3975b9;});}else{return _0x3975b9;}})[_0xa69c('0x3f')](function(_0x2434b1){logger[_0xa69c('0x49')](_0xa69c('0x4a'),_0x2434b1);throw _0x2434b1;});}return _0x3975b9;})[_0xa69c('0x25')](respondWithResult(_0x289361,0xc9))[_0xa69c('0x3f')](handleError(_0x289361,null));};exports[_0xa69c('0x24')]=function(_0x2e09a9,_0x1a14c1){if(_0x2e09a9[_0xa69c('0x4b')]['id']){delete _0x2e09a9[_0xa69c('0x4b')]['id'];}return db[_0xa69c('0x2c')][_0xa69c('0x47')]({'where':{'id':_0x2e09a9[_0xa69c('0x40')]['id']}})[_0xa69c('0x25')](handleEntityNotFound(_0x1a14c1,null))[_0xa69c('0x25')](saveUpdates(_0x2e09a9[_0xa69c('0x4b')],null))[_0xa69c('0x25')](respondWithResult(_0x1a14c1,null))[_0xa69c('0x3f')](handleError(_0x1a14c1,null));};exports[_0xa69c('0x26')]=function(_0x4fa286,_0x474f5f){return db[_0xa69c('0x2c')][_0xa69c('0x47')]({'where':{'id':_0x4fa286[_0xa69c('0x40')]['id']}})[_0xa69c('0x25')](handleEntityNotFound(_0x474f5f,null))[_0xa69c('0x25')](removeEntity(_0x474f5f,null))[_0xa69c('0x3f')](handleError(_0x474f5f,null));};exports[_0xa69c('0x4c')]=function(_0x56e60c,_0x4e9d64){return db[_0xa69c('0x2c')][_0xa69c('0x4c')]()['then'](respondWithResult(_0x4e9d64,null))['catch'](handleError(_0x4e9d64,null));};exports[_0xa69c('0x4d')]=function(_0x3cc3e4,_0xcf4649,_0x4fbd98){return db['CmContact'][_0xa69c('0x47')]({'where':{'id':_0x3cc3e4['params']['id']}})[_0xa69c('0x25')](handleEntityNotFound(_0xcf4649,null))[_0xa69c('0x25')](function(_0x3bf67a){if(_0x3bf67a){return _0x3bf67a[_0xa69c('0x4d')](_0x3cc3e4[_0xa69c('0x4b')][_0xa69c('0x4e')],_['omit'](_0x3cc3e4[_0xa69c('0x4b')],['ids','id'])||{});}})[_0xa69c('0x25')](respondWithResult(_0xcf4649,null))[_0xa69c('0x3f')](handleError(_0xcf4649,null));};exports[_0xa69c('0x4f')]=function(_0x1c3900,_0x40903d,_0x5f5d87){var _0x26bf0d={};var _0xaff168={};var _0x164e97;var _0x1dbf97;return db[_0xa69c('0x2c')][_0xa69c('0x50')]({'where':{'id':_0x1c3900[_0xa69c('0x40')]['id']}})[_0xa69c('0x25')](handleEntityNotFound(_0x40903d,null))[_0xa69c('0x25')](function(_0x470d5a){if(_0x470d5a){_0x164e97=_0x470d5a;_0xaff168['model']=_[_0xa69c('0x2e')](db[_0xa69c('0x51')]['rawAttributes']);_0xaff168[_0xa69c('0x2f')]=_[_0xa69c('0x2e')](_0x1c3900['query']);_0xaff168[_0xa69c('0x39')]=_['intersection'](_0xaff168[_0xa69c('0x2d')],_0xaff168[_0xa69c('0x2f')]);_0x26bf0d[_0xa69c('0x32')]=_['intersection'](_0xaff168['model'],qs[_0xa69c('0x31')](_0x1c3900['query'][_0xa69c('0x31')]));_0x26bf0d[_0xa69c('0x32')]=_0x26bf0d['attributes']['length']?_0x26bf0d[_0xa69c('0x32')]:_0xaff168[_0xa69c('0x2d')];_0x26bf0d[_0xa69c('0x36')]=qs[_0xa69c('0x37')](_0x1c3900[_0xa69c('0x2f')]['sort']);_0x26bf0d[_0xa69c('0x38')]=qs[_0xa69c('0x39')](_[_0xa69c('0x3a')](_0x1c3900['query'],_0xaff168[_0xa69c('0x39')]));if(_0x1c3900[_0xa69c('0x2f')]['filter']){_0x26bf0d[_0xa69c('0x38')]=_['merge'](_0x26bf0d[_0xa69c('0x38')],{'$or':_[_0xa69c('0x52')](_0x26bf0d[_0xa69c('0x32')],function(_0x646c71){var _0x99346={};_0x99346[_0x646c71]={'$like':'%'+_0x1c3900[_0xa69c('0x2f')][_0xa69c('0x3b')]+'%'};return _0x99346;})});}_0x26bf0d=_[_0xa69c('0x3c')]({},_0x26bf0d,_0x1c3900[_0xa69c('0x41')]);return _0x164e97[_0xa69c('0x4f')](_0x26bf0d);}})['then'](function(_0x569c23){if(_0x569c23){_0x1dbf97=_0x569c23[_0xa69c('0x33')];if(!_0x1c3900[_0xa69c('0x2f')]['hasOwnProperty']('nolimit')){_0x26bf0d[_0xa69c('0x1f')]=qs[_0xa69c('0x1f')](_0x1c3900[_0xa69c('0x2f')]['limit']);_0x26bf0d[_0xa69c('0x1d')]=qs['offset'](_0x1c3900['query'][_0xa69c('0x1d')]);}return _0x164e97[_0xa69c('0x4f')](_0x26bf0d);}})['then'](function(_0x1781f4){if(_0x1781f4){return _0x1781f4?{'count':_0x1dbf97,'rows':_0x1781f4}:null;}})[_0xa69c('0x25')](respondWithResult(_0x40903d,null))[_0xa69c('0x3f')](handleError(_0x40903d,null));}; \ No newline at end of file +var _0x75b7=['json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','Companies','UserProfileResource','error','stack','name','status','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','findAll','catch','show','params','rawAttributes','length','find','user','get','UserProfileSection','userProfileId','autoAssociation','create','update','body','addContacts','CmContact','ids','getContacts','pick','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xe3d85b,_0x4fbfd0){var _0x39da04=function(_0x4b80e6){while(--_0x4b80e6){_0xe3d85b['push'](_0xe3d85b['shift']());}};_0x39da04(++_0x4fbfd0);}(_0x75b7,0xdf));var _0x775b=function(_0x371335,_0x53e2c4){_0x371335=_0x371335-0x0;var _0x367dfa=_0x75b7[_0x371335];return _0x367dfa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x775b('0x0'));var zipdir=require(_0x775b('0x1'));var jsonpatch=require(_0x775b('0x2'));var rp=require(_0x775b('0x3'));var moment=require(_0x775b('0x4'));var BPromise=require(_0x775b('0x5'));var Mustache=require(_0x775b('0x6'));var util=require('util');var path=require(_0x775b('0x7'));var sox=require(_0x775b('0x8'));var csv=require(_0x775b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x775b('0xa'));var _=require(_0x775b('0xb'));var squel=require(_0x775b('0xc'));var crypto=require(_0x775b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x775b('0xe'));var toCsv=require(_0x775b('0x9'));var querystring=require(_0x775b('0xf'));var Papa=require(_0x775b('0x10'));var Redis=require(_0x775b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x775b('0x12'));var as=require(_0x775b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x775b('0x14'))(_0x775b('0x15'));var utils=require(_0x775b('0x16'));var config=require(_0x775b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x775b('0x18'))['db'];function respondWithStatusCode(_0x45829c,_0x4983ff){_0x4983ff=_0x4983ff||0xcc;return function(_0x45b147){if(_0x45b147){return _0x45829c[_0x775b('0x19')](_0x4983ff);}return _0x45829c['status'](_0x4983ff)['end']();};}function respondWithResult(_0x4fd3dd,_0x406525){_0x406525=_0x406525||0xc8;return function(_0x4bebb5){if(_0x4bebb5){return _0x4fd3dd['status'](_0x406525)[_0x775b('0x1a')](_0x4bebb5);}};}function respondWithFilteredResult(_0x3e4471,_0x42eb9d){return function(_0x2ba13f){if(_0x2ba13f){var _0x50b3b6=typeof _0x42eb9d[_0x775b('0x1b')]===_0x775b('0x1c')&&typeof _0x42eb9d[_0x775b('0x1d')]==='undefined';var _0x5f3446=_0x2ba13f[_0x775b('0x1e')];var _0x29d510=_0x50b3b6?0x0:_0x42eb9d[_0x775b('0x1b')];var _0x4646e7=_0x50b3b6?_0x2ba13f[_0x775b('0x1e')]:_0x42eb9d['offset']+_0x42eb9d[_0x775b('0x1d')];var _0xe04b9a;if(_0x4646e7>=_0x5f3446){_0x4646e7=_0x5f3446;_0xe04b9a=0xc8;}else{_0xe04b9a=0xce;}_0x3e4471['status'](_0xe04b9a);return _0x3e4471[_0x775b('0x1f')](_0x775b('0x20'),_0x29d510+'-'+_0x4646e7+'/'+_0x5f3446)[_0x775b('0x1a')](_0x2ba13f);}return null;};}function patchUpdates(_0x400b43){return function(_0x558978){try{jsonpatch[_0x775b('0x21')](_0x558978,_0x400b43,!![]);}catch(_0x32bb48){return BPromise['reject'](_0x32bb48);}return _0x558978[_0x775b('0x22')]();};}function saveUpdates(_0x3cf933,_0x2afb18){return function(_0x1355e9){if(_0x1355e9){return _0x1355e9['update'](_0x3cf933)[_0x775b('0x23')](function(_0x119b46){return _0x119b46;});}return null;};}function removeEntity(_0x35ebd8,_0x191137){return function(_0x559af9){if(_0x559af9){return _0x559af9[_0x775b('0x24')]()[_0x775b('0x23')](function(){var _0x3e939b=_0x559af9['get']({'plain':!![]});var _0x35c8a2=_0x775b('0x25');return db[_0x775b('0x26')]['destroy']({'where':{'type':_0x35c8a2,'resourceId':_0x3e939b['id']}})[_0x775b('0x23')](function(){return _0x559af9;});})[_0x775b('0x23')](function(){_0x35ebd8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c66ba,_0x3b906b){return function(_0x49e95f){if(!_0x49e95f){_0x6c66ba[_0x775b('0x19')](0x194);}return _0x49e95f;};}function handleError(_0x4d8d79,_0x5e2fba){_0x5e2fba=_0x5e2fba||0x1f4;return function(_0x415190){logger[_0x775b('0x27')](_0x415190[_0x775b('0x28')]);if(_0x415190[_0x775b('0x29')]){delete _0x415190[_0x775b('0x29')];}_0x4d8d79[_0x775b('0x2a')](_0x5e2fba)['send'](_0x415190);};}exports[_0x775b('0x2b')]=function(_0xc268e8,_0x41a4bc){var _0x72d57b={},_0x140139={},_0x682d07={'count':0x0,'rows':[]};return db[_0x775b('0x2c')][_0x775b('0x2d')]()[_0x775b('0x23')](function(_0x19891f){_0x140139[_0x775b('0x2e')]=_[_0x775b('0x2f')](_0x19891f);_0x140139[_0x775b('0x30')]=_[_0x775b('0x2f')](_0xc268e8[_0x775b('0x30')]);_0x140139['filters']=_[_0x775b('0x31')](_0x140139[_0x775b('0x2e')],_0x140139['query']);_0x72d57b[_0x775b('0x32')]=_['intersection'](_0x140139[_0x775b('0x2e')],qs[_0x775b('0x33')](_0xc268e8[_0x775b('0x30')][_0x775b('0x33')]));_0x72d57b['attributes']=_0x72d57b[_0x775b('0x32')]['length']?_0x72d57b[_0x775b('0x32')]:_0x140139[_0x775b('0x2e')];if(!_0xc268e8['query'][_0x775b('0x34')](_0x775b('0x35'))){_0x72d57b[_0x775b('0x1d')]=qs[_0x775b('0x1d')](_0xc268e8[_0x775b('0x30')]['limit']);_0x72d57b[_0x775b('0x1b')]=qs['offset'](_0xc268e8[_0x775b('0x30')][_0x775b('0x1b')]);}_0x72d57b[_0x775b('0x36')]=qs[_0x775b('0x37')](_0xc268e8[_0x775b('0x30')][_0x775b('0x37')]);_0x72d57b[_0x775b('0x38')]=qs['filters'](_['pick'](_0xc268e8[_0x775b('0x30')],_0x140139[_0x775b('0x39')]),_0x19891f);if(_0xc268e8[_0x775b('0x30')]['filter']){_0x72d57b[_0x775b('0x38')]=_[_0x775b('0x3a')](_0x72d57b[_0x775b('0x38')],{'$or':_['map'](_0x72d57b[_0x775b('0x32')],function(_0x28c36a){var _0x11838c={};_0x11838c[_0x28c36a]={'$like':'%'+_0xc268e8[_0x775b('0x30')][_0x775b('0x3b')]+'%'};return _0x11838c;})});}_0x72d57b=_[_0x775b('0x3a')]({},_0x72d57b,_0xc268e8[_0x775b('0x3c')]);var _0x1a5821={'where':_0x72d57b['where']};return db[_0x775b('0x2c')][_0x775b('0x1e')](_0x1a5821)[_0x775b('0x23')](function(_0x49588e){_0x682d07[_0x775b('0x1e')]=_0x49588e;if(_0xc268e8[_0x775b('0x30')]['includeAll']){_0x72d57b[_0x775b('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0x775b('0x3e')](_0x72d57b);})['then'](function(_0x52d8c7){_0x682d07['rows']=_0x52d8c7;return _0x682d07;})[_0x775b('0x23')](respondWithFilteredResult(_0x41a4bc,_0x72d57b))[_0x775b('0x3f')](handleError(_0x41a4bc,null));})[_0x775b('0x3f')](handleError(_0x41a4bc,null));};exports[_0x775b('0x40')]=function(_0x2d9a58,_0x3c4e03){var _0x15576d={'raw':![],'where':{'id':_0x2d9a58[_0x775b('0x41')]['id']}},_0x703da7={};_0x703da7[_0x775b('0x2e')]=_[_0x775b('0x2f')](db[_0x775b('0x2c')][_0x775b('0x42')]);_0x703da7[_0x775b('0x30')]=_[_0x775b('0x2f')](_0x2d9a58[_0x775b('0x30')]);_0x703da7[_0x775b('0x39')]=_[_0x775b('0x31')](_0x703da7['model'],_0x703da7[_0x775b('0x30')]);_0x15576d[_0x775b('0x32')]=_[_0x775b('0x31')](_0x703da7[_0x775b('0x2e')],qs[_0x775b('0x33')](_0x2d9a58[_0x775b('0x30')][_0x775b('0x33')]));_0x15576d['attributes']=_0x15576d[_0x775b('0x32')][_0x775b('0x43')]?_0x15576d[_0x775b('0x32')]:_0x703da7['model'];if(_0x2d9a58[_0x775b('0x30')]['includeAll']){_0x15576d['include']=[{'all':!![]}];}_0x15576d=_['merge']({},_0x15576d,_0x2d9a58[_0x775b('0x3c')]);return db['CmCompany'][_0x775b('0x44')](_0x15576d)[_0x775b('0x23')](handleEntityNotFound(_0x3c4e03,null))[_0x775b('0x23')](respondWithResult(_0x3c4e03,null))[_0x775b('0x3f')](handleError(_0x3c4e03,null));};exports['create']=function(_0x35416c,_0x3812df){return db[_0x775b('0x2c')]['create'](_0x35416c['body'],{})[_0x775b('0x23')](function(_0x1adc35){var _0x483b2c=_0x35416c['user']['get']({'plain':!![]});if(!_0x483b2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x483b2c['role']===_0x775b('0x45')){var _0x203c4b=_0x1adc35[_0x775b('0x46')]({'plain':!![]});var _0x1a4738=_0x775b('0x25');return db[_0x775b('0x47')]['find']({'where':{'name':_0x1a4738,'userProfileId':_0x483b2c[_0x775b('0x48')]},'raw':!![]})[_0x775b('0x23')](function(_0x7aeb66){if(_0x7aeb66&&_0x7aeb66[_0x775b('0x49')]===0x0){return db['UserProfileResource'][_0x775b('0x4a')]({'name':_0x203c4b[_0x775b('0x29')],'resourceId':_0x203c4b['id'],'type':_0x7aeb66[_0x775b('0x29')],'sectionId':_0x7aeb66['id']},{})[_0x775b('0x23')](function(){return _0x1adc35;});}else{return _0x1adc35;}})[_0x775b('0x3f')](function(_0x88f7ec){logger[_0x775b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x88f7ec);throw _0x88f7ec;});}return _0x1adc35;})['then'](respondWithResult(_0x3812df,0xc9))[_0x775b('0x3f')](handleError(_0x3812df,null));};exports[_0x775b('0x4b')]=function(_0x212268,_0x53373c){if(_0x212268['body']['id']){delete _0x212268[_0x775b('0x4c')]['id'];}return db[_0x775b('0x2c')][_0x775b('0x44')]({'where':{'id':_0x212268[_0x775b('0x41')]['id']}})[_0x775b('0x23')](handleEntityNotFound(_0x53373c,null))['then'](saveUpdates(_0x212268[_0x775b('0x4c')],null))[_0x775b('0x23')](respondWithResult(_0x53373c,null))[_0x775b('0x3f')](handleError(_0x53373c,null));};exports[_0x775b('0x24')]=function(_0x8c0e40,_0xaa3d5a){return db[_0x775b('0x2c')][_0x775b('0x44')]({'where':{'id':_0x8c0e40[_0x775b('0x41')]['id']}})['then'](handleEntityNotFound(_0xaa3d5a,null))[_0x775b('0x23')](removeEntity(_0xaa3d5a,null))[_0x775b('0x3f')](handleError(_0xaa3d5a,null));};exports[_0x775b('0x2d')]=function(_0x5ea341,_0x3e5b4f){return db[_0x775b('0x2c')][_0x775b('0x2d')]()[_0x775b('0x23')](respondWithResult(_0x3e5b4f,null))['catch'](handleError(_0x3e5b4f,null));};exports[_0x775b('0x4d')]=function(_0x5f453f,_0x488783,_0x45b584){return db[_0x775b('0x4e')][_0x775b('0x44')]({'where':{'id':_0x5f453f['params']['id']}})['then'](handleEntityNotFound(_0x488783,null))[_0x775b('0x23')](function(_0x5285a5){if(_0x5285a5){return _0x5285a5['addContacts'](_0x5f453f[_0x775b('0x4c')][_0x775b('0x4f')],_['omit'](_0x5f453f[_0x775b('0x4c')],[_0x775b('0x4f'),'id'])||{});}})[_0x775b('0x23')](respondWithResult(_0x488783,null))[_0x775b('0x3f')](handleError(_0x488783,null));};exports[_0x775b('0x50')]=function(_0x5ccf87,_0x458ef0,_0x5aeb32){var _0xc3bb5c={};var _0x5564dc={};var _0x367c08;var _0x555820;return db['CmCompany']['findOne']({'where':{'id':_0x5ccf87[_0x775b('0x41')]['id']}})[_0x775b('0x23')](handleEntityNotFound(_0x458ef0,null))[_0x775b('0x23')](function(_0x243b99){if(_0x243b99){_0x367c08=_0x243b99;_0x5564dc['model']=_[_0x775b('0x2f')](db[_0x775b('0x4e')][_0x775b('0x42')]);_0x5564dc[_0x775b('0x30')]=_[_0x775b('0x2f')](_0x5ccf87[_0x775b('0x30')]);_0x5564dc['filters']=_[_0x775b('0x31')](_0x5564dc['model'],_0x5564dc[_0x775b('0x30')]);_0xc3bb5c[_0x775b('0x32')]=_['intersection'](_0x5564dc['model'],qs[_0x775b('0x33')](_0x5ccf87[_0x775b('0x30')][_0x775b('0x33')]));_0xc3bb5c[_0x775b('0x32')]=_0xc3bb5c[_0x775b('0x32')][_0x775b('0x43')]?_0xc3bb5c[_0x775b('0x32')]:_0x5564dc[_0x775b('0x2e')];_0xc3bb5c[_0x775b('0x36')]=qs[_0x775b('0x37')](_0x5ccf87[_0x775b('0x30')][_0x775b('0x37')]);_0xc3bb5c[_0x775b('0x38')]=qs['filters'](_[_0x775b('0x51')](_0x5ccf87['query'],_0x5564dc['filters']));if(_0x5ccf87[_0x775b('0x30')][_0x775b('0x3b')]){_0xc3bb5c[_0x775b('0x38')]=_[_0x775b('0x3a')](_0xc3bb5c['where'],{'$or':_[_0x775b('0x52')](_0xc3bb5c[_0x775b('0x32')],function(_0x188371){var _0x2520c3={};_0x2520c3[_0x188371]={'$like':'%'+_0x5ccf87[_0x775b('0x30')]['filter']+'%'};return _0x2520c3;})});}_0xc3bb5c=_[_0x775b('0x3a')]({},_0xc3bb5c,_0x5ccf87[_0x775b('0x3c')]);return _0x367c08[_0x775b('0x50')](_0xc3bb5c);}})[_0x775b('0x23')](function(_0xdb55f4){if(_0xdb55f4){_0x555820=_0xdb55f4[_0x775b('0x43')];if(!_0x5ccf87[_0x775b('0x30')][_0x775b('0x34')](_0x775b('0x35'))){_0xc3bb5c[_0x775b('0x1d')]=qs['limit'](_0x5ccf87['query'][_0x775b('0x1d')]);_0xc3bb5c['offset']=qs[_0x775b('0x1b')](_0x5ccf87[_0x775b('0x30')][_0x775b('0x1b')]);}return _0x367c08['getContacts'](_0xc3bb5c);}})[_0x775b('0x23')](function(_0x10c1e4){if(_0x10c1e4){return _0x10c1e4?{'count':_0x555820,'rows':_0x10c1e4}:null;}})['then'](respondWithResult(_0x458ef0,null))[_0x775b('0x3f')](handleError(_0x458ef0,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 85a67f4..0ec4813 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 _0xb23d=['util','api','bluebird','path','rimraf','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xb23d,0x195));var _0xdb23=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xb23d[_0x43b06b];return _0x2c555b;};'use strict';var _=require('lodash');var util=require(_0xdb23('0x0'));var logger=require('../../config/logger')(_0xdb23('0x1'));var moment=require('moment');var BPromise=require(_0xdb23('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb23('0x3'));var rimraf=require(_0xdb23('0x4'));var config=require('../../config/environment');var attributes=require(_0xdb23('0x5'));module[_0xdb23('0x6')]=function(_0x4c41da,_0x2fc802){return _0x4c41da[_0xdb23('0x7')]('CmCompany',attributes,{'tableName':_0xdb23('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0ed=['request-promise','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','bluebird'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xd0ed,0x80));var _0xdd0e=function(_0x277607,_0x345a06){_0x277607=_0x277607-0x0;var _0x15fe23=_0xd0ed[_0x277607];return _0x15fe23;};'use strict';var _=require(_0xdd0e('0x0'));var util=require(_0xdd0e('0x1'));var logger=require('../../config/logger')(_0xdd0e('0x2'));var moment=require('moment');var BPromise=require(_0xdd0e('0x3'));var rp=require(_0xdd0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd0e('0x5'));var config=require('../../config/environment');var attributes=require(_0xdd0e('0x6'));module[_0xdd0e('0x7')]=function(_0x33bf49,_0x5e124d){return _0x33bf49[_0xdd0e('0x8')](_0xdd0e('0x9'),attributes,{'tableName':_0xdd0e('0xa'),'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 da558c0..e05f07e 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 _0x1013=['info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x1013,0x157));var _0x3101=function(_0x2580af,_0x1106dd){_0x2580af=_0x2580af-0x0;var _0x400590=_0x1013[_0x2580af];return _0x400590;};'use strict';var _=require('lodash');var util=require(_0x3101('0x0'));var moment=require(_0x3101('0x1'));var BPromise=require(_0x3101('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3101('0x3'))['db'];var utils=require(_0x3101('0x4'));var logger=require('../../config/logger')(_0x3101('0x5'));var config=require(_0x3101('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3101('0x7')][_0x3101('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x241f40,_0x549c43,_0x429de1){return new BPromise(function(_0x485e80,_0x338451){return client['request'](_0x241f40,_0x429de1)[_0x3101('0x9')](function(_0x5d9786){logger['info'](_0x3101('0xa'),_0x549c43,_0x3101('0xb'));logger[_0x3101('0xc')](_0x3101('0xd'),_0x549c43,_0x3101('0xb'),JSON['stringify'](_0x5d9786));if(_0x5d9786[_0x3101('0xe')]){if(_0x5d9786[_0x3101('0xe')][_0x3101('0xf')]===0x1f4){logger['error'](_0x3101('0xa'),_0x549c43,_0x5d9786[_0x3101('0xe')]['message']);return _0x338451(_0x5d9786[_0x3101('0xe')][_0x3101('0x10')]);}logger[_0x3101('0xe')](_0x3101('0xa'),_0x549c43,_0x5d9786[_0x3101('0xe')][_0x3101('0x10')]);return _0x485e80(_0x5d9786[_0x3101('0xe')][_0x3101('0x10')]);}else{logger[_0x3101('0x11')](_0x3101('0xa'),_0x549c43,'request\x20sent');_0x485e80(_0x5d9786[_0x3101('0x12')][_0x3101('0x10')]);}})[_0x3101('0x13')](function(_0x30e858){logger['error'](_0x3101('0xa'),_0x549c43,_0x30e858);_0x338451(_0x30e858);});});} \ No newline at end of file +var _0x5f32=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\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','http','request','info'];(function(_0x3e3bbc,_0x374fb4){var _0x3bb3f6=function(_0x15bfd1){while(--_0x15bfd1){_0x3e3bbc['push'](_0x3e3bbc['shift']());}};_0x3bb3f6(++_0x374fb4);}(_0x5f32,0x126));var _0x25f3=function(_0x32eb3f,_0x3cc610){_0x32eb3f=_0x32eb3f-0x0;var _0x372d5f=_0x5f32[_0x32eb3f];return _0x372d5f;};'use strict';var _=require('lodash');var util=require(_0x25f3('0x0'));var moment=require(_0x25f3('0x1'));var BPromise=require(_0x25f3('0x2'));var rs=require(_0x25f3('0x3'));var fs=require('fs');var Redis=require(_0x25f3('0x4'));var db=require(_0x25f3('0x5'))['db'];var utils=require(_0x25f3('0x6'));var logger=require(_0x25f3('0x7'))(_0x25f3('0x8'));var config=require(_0x25f3('0x9'));var jayson=require(_0x25f3('0xa'));var client=jayson['client'][_0x25f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e6052,_0xaf05ef,_0xa90d2){return new BPromise(function(_0xf918ec,_0x253eed){return client[_0x25f3('0xc')](_0x5e6052,_0xa90d2)['then'](function(_0x105078){logger[_0x25f3('0xd')](_0x25f3('0xe'),_0xaf05ef,_0x25f3('0xf'));logger[_0x25f3('0x10')](_0x25f3('0x11'),_0xaf05ef,_0x25f3('0xf'),JSON['stringify'](_0x105078));if(_0x105078[_0x25f3('0x12')]){if(_0x105078['error'][_0x25f3('0x13')]===0x1f4){logger[_0x25f3('0x12')]('CmCompany,\x20%s,\x20%s',_0xaf05ef,_0x105078[_0x25f3('0x12')][_0x25f3('0x14')]);return _0x253eed(_0x105078[_0x25f3('0x12')][_0x25f3('0x14')]);}logger[_0x25f3('0x12')](_0x25f3('0xe'),_0xaf05ef,_0x105078[_0x25f3('0x12')][_0x25f3('0x14')]);return _0xf918ec(_0x105078[_0x25f3('0x12')]['message']);}else{logger[_0x25f3('0xd')](_0x25f3('0xe'),_0xaf05ef,'request\x20sent');_0xf918ec(_0x105078[_0x25f3('0x15')][_0x25f3('0x14')]);}})['catch'](function(_0x2f7606){logger['error'](_0x25f3('0xe'),_0xaf05ef,_0x2f7606);_0x253eed(_0x2f7606);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index e035d1d..41e6401 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 _0xa563=['post','create','/:id/contacts','addContacts','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x545ca0,_0xefd646){var _0x2cdccc=function(_0x1cab50){while(--_0x1cab50){_0x545ca0['push'](_0x545ca0['shift']());}};_0x2cdccc(++_0xefd646);}(_0xa563,0xe4));var _0x3a56=function(_0x69e746,_0x385088){_0x69e746=_0x69e746-0x0;var _0x3d8296=_0xa563[_0x69e746];return _0x3d8296;};'use strict';var multer=require(_0x3a56('0x0'));var util=require(_0x3a56('0x1'));var path=require('path');var timeout=require(_0x3a56('0x2'));var express=require(_0x3a56('0x3'));var router=express[_0x3a56('0x4')]();var fs_extra=require(_0x3a56('0x5'));var auth=require(_0x3a56('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x3a56('0x7')]('/',auth[_0x3a56('0x8')](),controller[_0x3a56('0x9')]);router[_0x3a56('0x7')](_0x3a56('0xa'),auth['isAuthenticated'](),controller[_0x3a56('0xb')]);router[_0x3a56('0x7')](_0x3a56('0xc'),auth[_0x3a56('0x8')](),controller[_0x3a56('0xd')]);router[_0x3a56('0x7')]('/:id/contacts',auth[_0x3a56('0x8')](),controller['getContacts']);router[_0x3a56('0xe')]('/',auth[_0x3a56('0x8')](),controller[_0x3a56('0xf')]);router[_0x3a56('0xe')](_0x3a56('0x10'),auth[_0x3a56('0x8')](),controller[_0x3a56('0x11')]);router[_0x3a56('0x12')](_0x3a56('0xc'),auth[_0x3a56('0x8')](),controller[_0x3a56('0x13')]);router[_0x3a56('0x14')](_0x3a56('0xc'),auth[_0x3a56('0x8')](),controller['destroy']);module[_0x3a56('0x15')]=router; \ No newline at end of file +var _0xdfdf=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','create','post','/:id/contacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x54b17e,_0xc7f0d0){var _0x283ed9=function(_0x438829){while(--_0x438829){_0x54b17e['push'](_0x54b17e['shift']());}};_0x283ed9(++_0xc7f0d0);}(_0xdfdf,0x130));var _0xfdfd=function(_0xe6e867,_0x174b84){_0xe6e867=_0xe6e867-0x0;var _0x475ba5=_0xdfdf[_0xe6e867];return _0x475ba5;};'use strict';var multer=require(_0xfdfd('0x0'));var util=require(_0xfdfd('0x1'));var path=require(_0xfdfd('0x2'));var timeout=require(_0xfdfd('0x3'));var express=require(_0xfdfd('0x4'));var router=express[_0xfdfd('0x5')]();var fs_extra=require(_0xfdfd('0x6'));var auth=require(_0xfdfd('0x7'));var interaction=require(_0xfdfd('0x8'));var config=require(_0xfdfd('0x9'));var controller=require('./cmCompany.controller');router[_0xfdfd('0xa')]('/',auth[_0xfdfd('0xb')](),controller[_0xfdfd('0xc')]);router[_0xfdfd('0xa')](_0xfdfd('0xd'),auth[_0xfdfd('0xb')](),controller[_0xfdfd('0xe')]);router['get'](_0xfdfd('0xf'),auth[_0xfdfd('0xb')](),controller[_0xfdfd('0x10')]);router[_0xfdfd('0xa')]('/:id/contacts',auth[_0xfdfd('0xb')](),controller[_0xfdfd('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfdfd('0x12')]);router[_0xfdfd('0x13')](_0xfdfd('0x14'),auth[_0xfdfd('0xb')](),controller['addContacts']);router[_0xfdfd('0x15')](_0xfdfd('0xf'),auth['isAuthenticated'](),controller[_0xfdfd('0x16')]);router[_0xfdfd('0x17')](_0xfdfd('0xf'),auth[_0xfdfd('0xb')](),controller[_0xfdfd('0x18')]);module[_0xfdfd('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 659685c..25b4f98 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 _0xbf2f=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x4b076c,_0xef12ba){var _0x35544a=function(_0x27534a){while(--_0x27534a){_0x4b076c['push'](_0x4b076c['shift']());}};_0x35544a(++_0xef12ba);}(_0xbf2f,0x10a));var _0xfbf2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbf2f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xfbf2('0x0'));var Sequelize=require('sequelize');module[_0xfbf2('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xfbf2('0x2')]},'street':{'type':Sequelize[_0xfbf2('0x2')]},'postalCode':{'type':Sequelize[_0xfbf2('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xfbf2('0x2')]},'description':{'type':Sequelize[_0xfbf2('0x3')]},'phone':{'type':Sequelize[_0xfbf2('0x2')]},'mobile':{'type':Sequelize[_0xfbf2('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xfbf2('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xfbf2('0x2')]},'fb_data':{'type':Sequelize[_0xfbf2('0x2')]},'twitter':{'type':Sequelize[_0xfbf2('0x2')]},'skype':{'type':Sequelize[_0xfbf2('0x2')]},'teams':{'type':Sequelize[_0xfbf2('0x2')]},'viber':{'type':Sequelize[_0xfbf2('0x2')]},'line':{'type':Sequelize[_0xfbf2('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xfbf2('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xfbf2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfbf2('0x6')]},'dialTimezone':{'type':Sequelize[_0xfbf2('0x2')]},'utcOffset':{'type':Sequelize[_0xfbf2('0x4')]}}; \ No newline at end of file +var _0x54d0=['TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x54d0,0x175));var _0x054d=function(_0xec3cab,_0x3d89a1){_0xec3cab=_0xec3cab-0x0;var _0x2e4e51=_0x54d0[_0xec3cab];return _0x2e4e51;};'use strict';var _=require('lodash');var Sequelize=require(_0x054d('0x0'));module[_0x054d('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x054d('0x2')]},'street':{'type':Sequelize[_0x054d('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x054d('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x054d('0x2')]},'description':{'type':Sequelize[_0x054d('0x3')]},'phone':{'type':Sequelize[_0x054d('0x2')]},'mobile':{'type':Sequelize[_0x054d('0x2')]},'fax':{'type':Sequelize[_0x054d('0x2')]},'email':{'type':Sequelize[_0x054d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x054d('0x2')]},'fb_data':{'type':Sequelize[_0x054d('0x2')]},'twitter':{'type':Sequelize[_0x054d('0x2')]},'skype':{'type':Sequelize[_0x054d('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x054d('0x2')]},'line':{'type':Sequelize[_0x054d('0x2')]},'wechat':{'type':Sequelize[_0x054d('0x2')]},'telegram':{'type':Sequelize[_0x054d('0x2')]},'UserId':{'type':Sequelize[_0x054d('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x054d('0x2')]},'priority':{'type':Sequelize[_0x054d('0x4')](0x2)[_0x054d('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x054d('0x6')],'defaultValue':Sequelize[_0x054d('0x7')]},'dialTimezone':{'type':Sequelize[_0x054d('0x2')]},'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 db796b8..74cfcb6 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(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 _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(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index a32cef5..0ab4c20 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 _0x1a40=['hasOwnProperty','hook','events','CmContact','update','remove','emit'];(function(_0x43b7db,_0xc9b225){var _0x4eebb5=function(_0x51e9fd){while(--_0x51e9fd){_0x43b7db['push'](_0x43b7db['shift']());}};_0x4eebb5(++_0xc9b225);}(_0x1a40,0x191));var _0x01a4=function(_0x2e4e42,_0x30eaf9){_0x2e4e42=_0x2e4e42-0x0;var _0x546d20=_0x1a40[_0x2e4e42];return _0x546d20;};'use strict';var EventEmitter=require(_0x01a4('0x0'));var CmContact=require('../../mysqldb')['db'][_0x01a4('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x01a4('0x2'),'afterDestroy':_0x01a4('0x3')};function emitEvent(_0x2c1464){return function(_0x5bf362,_0x59bb59,_0x113b6e){CmContactEvents[_0x01a4('0x4')](_0x2c1464+':'+_0x5bf362['id'],_0x5bf362);CmContactEvents[_0x01a4('0x4')](_0x2c1464,_0x5bf362);_0x113b6e(null);};}for(var e in events){if(events[_0x01a4('0x5')](e)){var event=events[e];CmContact[_0x01a4('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x3095=['../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x17a24a,_0x2fcf92){var _0x82f671=function(_0x15bd6d){while(--_0x15bd6d){_0x17a24a['push'](_0x17a24a['shift']());}};_0x82f671(++_0x2fcf92);}(_0x3095,0x15f));var _0x5309=function(_0x347733,_0x5de9fa){_0x347733=_0x347733-0x0;var _0x398c75=_0x3095[_0x347733];return _0x398c75;};'use strict';var EventEmitter=require(_0x5309('0x0'));var CmContact=require(_0x5309('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5309('0x2'),'afterUpdate':'update','afterDestroy':_0x5309('0x3')};function emitEvent(_0x5b6ed5){return function(_0x3610e3,_0x1d9782,_0x15641a){CmContactEvents['emit'](_0x5b6ed5+':'+_0x3610e3['id'],_0x3610e3);CmContactEvents[_0x5309('0x4')](_0x5b6ed5,_0x3610e3);_0x15641a(null);};}for(var e in events){if(events[_0x5309('0x5')](e)){var event=events[e];CmContact[_0x5309('0x6')](e,emitEvent(event));}}module[_0x5309('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index ecbabb7..3685ad1 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 _0xa418=['VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','exports','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','email','utf8mb4','utf8mb4_unicode_ci','models','get','error','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','afterCreate','\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','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','BlackLists','cmContact,\x20%s,\x20%s','message','Campaign','onlyIfOpen','List\x20not\x20found','isEmpty','destroy'];(function(_0x1de900,_0x301fb8){var _0x42f72d=function(_0x4a9773){while(--_0x4a9773){_0x1de900['push'](_0x1de900['shift']());}};_0x42f72d(++_0x301fb8);}(_0xa418,0x1b7));var _0x8a41=function(_0x4625cd,_0x246c2a){_0x4625cd=_0x4625cd-0x0;var _0x341ec1=_0xa418[_0x4625cd];return _0x341ec1;};'use strict';var _=require(_0x8a41('0x0'));var util=require('util');var logger=require(_0x8a41('0x1'))(_0x8a41('0x2'));var moment=require(_0x8a41('0x3'));var BPromise=require(_0x8a41('0x4'));var rp=require(_0x8a41('0x5'));var fs=require('fs');var path=require(_0x8a41('0x6'));var rimraf=require('rimraf');var config=require(_0x8a41('0x7'));var shared=require(_0x8a41('0x8'));var attributes=require('./cmContact.attributes');module[_0x8a41('0x9')]=function(_0x26db5c,_0x6af1fd){return _0x26db5c[_0x8a41('0xa')](_0x8a41('0xb'),attributes,{'tableName':_0x8a41('0xc'),'paranoid':!![],'indexes':[{'name':_0x8a41('0xd'),'fields':[_0x8a41('0xd')]},{'name':'fti_cm_contacts','fields':[_0x8a41('0xe'),_0x8a41('0xf'),_0x8a41('0xd'),_0x8a41('0x10'),'fax',_0x8a41('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x8a41('0x12'),'collate':_0x8a41('0x13'),'hooks':{'afterCreate':function(_0x28d18b,_0x44ad9b,_0x45d907){var _0x32a144=_0x26db5c[_0x8a41('0x14')];var _0x4f8344=_0x28d18b[_0x8a41('0x15')]({'plain':!![]});function _0x2efb76(){return function(_0xb936be){logger[_0x8a41('0x16')]('cmContact','afterCreate',util[_0x8a41('0x17')](_0xb936be,{'showHidden':![],'depth':null}));};}function _0x252a84(_0x1c1881,_0x1c2f0b){var _0xe30792=_0x1c2f0b[_0x8a41('0x18')]?_0x1c2f0b[_0x8a41('0x18')]:moment()[_0x8a41('0x19')](_0x8a41('0x1a'));return new BPromise(function(_0x41a3d7,_0x40308e){if(_[_0x8a41('0x1b')](_0x1c2f0b[_0x8a41('0x1c')])){_0x41a3d7({'ret':_0xe30792});}else{_0x32a144[_0x8a41('0x1d')][_0x8a41('0x1e')]({'where':{'id':_0x1c1881['id']}})[_0x8a41('0x1f')](function(_0xf0b86){if(!_['isNil'](_0xf0b86)){var _0x28f063=_0xf0b86['dialTimezone'];if(!_['isNil'](_0x28f063)){var _0x766ed5=shared[_0x8a41('0x20')];var _0x4b8dfa=_0x766ed5[_0x28f063];var _0x8210f=_0x766ed5[_0x1c2f0b[_0x8a41('0x1c')]];if(!_['isNil'](_0x4b8dfa)&&!_['isNil'](_0x8210f)){var _0x8eebcb=_0x4b8dfa[_0x8a41('0x21')]-_0x8210f['utcOffset'];_0xe30792=_0x1c2f0b['scheduledat']?_0x1c2f0b[_0x8a41('0x18')]:moment();var _0xdf26e9=moment(_0xe30792)[_0x8a41('0x22')](_0x8eebcb,_0x8a41('0x23'));_0x41a3d7({'ret':_0xdf26e9[_0x8a41('0x19')](_0x8a41('0x1a'))});}else _0x41a3d7({'ret':_0xe30792});}else _0x41a3d7({'ret':_0xe30792});}else{_0x41a3d7({'ret':_0xe30792});}});}});return 0xa;}var _0x229705=function(_0x10e584){return new BPromise(function(_0x38b282,_0x470571){_0x252a84(_0x10e584,_0x4f8344)[_0x8a41('0x1f')](function(_0x194278){_0x4f8344[_0x8a41('0x18')]=_0x194278[_0x8a41('0x24')];_0x32a144[_0x8a41('0x25')][_0x8a41('0x1e')]({'where':{'phone':_0x4f8344[_0x8a41('0xd')],'VoiceQueueId':_0x10e584['id']}})[_0x8a41('0x1f')](function(_0x34d189){if(!_[_0x8a41('0x1b')](_0x34d189)){throw new Error(_0x8a41('0x26')+_0x4f8344[_0x8a41('0xd')]+_0x8a41('0x27')+_0x10e584['id']);}return _0x32a144['CmHopper'][_0x8a41('0x28')]({'phone':_0x4f8344[_0x8a41('0xd')],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344[_0x8a41('0x29')],'priority':_0x4f8344[_0x8a41('0x2a')]?_0x4f8344[_0x8a41('0x2a')]:0x2,'scheduledat':_0x4f8344[_0x8a41('0x18')]?_0x4f8344[_0x8a41('0x18')]:moment()['format'](_0x8a41('0x1a')),'callback':_0x4f8344[_0x8a41('0x2b')]?!![]:![],'callbackuniqueid':_0x4f8344[_0x8a41('0x2b')]?_0x4f8344[_0x8a41('0x2b')]:undefined,'callbackat':_0x4f8344[_0x8a41('0x2b')]?moment()[_0x8a41('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x10e584['id']});})[_0x8a41('0x2c')](function(_0x16b6c3){_0x470571(_0x16b6c3);});});});};var _0x55e5f9=function(_0x2e3ee0){return new BPromise(function(_0x5b27cd,_0x5112b2){_0x252a84(_0x2e3ee0,_0x4f8344)[_0x8a41('0x1f')](function(_0x44e015){_0x4f8344[_0x8a41('0x18')]=_0x44e015[_0x8a41('0x24')];_0x32a144[_0x8a41('0x25')][_0x8a41('0x1e')]({'where':{'phone':_0x4f8344[_0x8a41('0xd')],'VoiceQueueId':_0x2e3ee0['id']}})[_0x8a41('0x1f')](function(_0x2f2028){if(!_[_0x8a41('0x1b')](_0x2f2028)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4f8344['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x2e3ee0['id']);}return _0x32a144[_0x8a41('0x2d')][_0x8a41('0x1e')]({'where':{'calleridnum':_0x4f8344[_0x8a41('0xd')],'VoiceQueueId':_0x2e3ee0['id']}});})[_0x8a41('0x1f')](function(_0x184b4c){if(!_[_0x8a41('0x1b')](_0x184b4c)){throw new Error(_0x8a41('0x2e')+_0x4f8344['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2e3ee0['id']);}return _0x32a144[_0x8a41('0x25')][_0x8a41('0x28')]({'phone':_0x4f8344['phone'],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344[_0x8a41('0x29')],'priority':_0x4f8344[_0x8a41('0x2a')]?_0x4f8344[_0x8a41('0x2a')]:0x2,'scheduledat':_0x4f8344[_0x8a41('0x18')]?_0x4f8344[_0x8a41('0x18')]:moment()[_0x8a41('0x19')](_0x8a41('0x1a')),'callback':_0x4f8344[_0x8a41('0x2b')]?!![]:![],'callbackuniqueid':_0x4f8344['callbackUniqueid']?_0x4f8344['callbackUniqueid']:undefined,'callbackat':_0x4f8344['callbackUniqueid']?moment()['format'](_0x8a41('0x1a')):undefined,'VoiceQueueId':_0x2e3ee0['id']});})[_0x8a41('0x2c')](function(_0x1f5d9e){_0x5112b2(_0x1f5d9e);});});});};function _0x155a1b(){return function(_0x370704){logger[_0x8a41('0x16')]('cmContact',_0x8a41('0x2f'),util[_0x8a41('0x17')](_0x370704,{'showHidden':![],'depth':null}));};}function _0x227a42(_0x4b8ceb,_0x2913c1){var _0x19d0cb=_0x2913c1[_0x8a41('0x18')]?_0x2913c1[_0x8a41('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1ace6b,_0xbf2a0e){if(_[_0x8a41('0x1b')](_0x2913c1[_0x8a41('0x1c')])){_0x1ace6b({'ret':_0x19d0cb});}else{_0x32a144['Campaign'][_0x8a41('0x1e')]({'where':{'id':_0x4b8ceb['id']}})[_0x8a41('0x1f')](function(_0x1c3fdd){if(!_[_0x8a41('0x1b')](_0x1c3fdd)){var _0x19e455=_0x1c3fdd[_0x8a41('0x1c')];if(!_[_0x8a41('0x1b')](_0x19e455)){var _0x454fd5=shared[_0x8a41('0x20')];var _0x5d9e84=_0x454fd5[_0x19e455];var _0x4d656=_0x454fd5[_0x2913c1[_0x8a41('0x1c')]];if(!_[_0x8a41('0x1b')](_0x5d9e84)&&!_[_0x8a41('0x1b')](_0x4d656)){var _0x145fe7=_0x5d9e84[_0x8a41('0x21')]-_0x4d656[_0x8a41('0x21')];_0x19d0cb=_0x2913c1[_0x8a41('0x18')]?_0x2913c1[_0x8a41('0x18')]:moment();var _0x29cfba=moment(_0x19d0cb)['add'](_0x145fe7,_0x8a41('0x23'));_0x1ace6b({'ret':_0x29cfba[_0x8a41('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1ace6b({'ret':_0x19d0cb});}else _0x1ace6b({'ret':_0x19d0cb});}else{_0x1ace6b({'ret':_0x19d0cb});}});}});return 0xa;}var _0x53079e=function(_0xb71612){return new BPromise(function(_0x383a81,_0x433047){_0x227a42(_0xb71612,_0x4f8344)[_0x8a41('0x1f')](function(_0xe80544){_0x4f8344['scheduledat']=_0xe80544['ret'];_0x32a144[_0x8a41('0x25')][_0x8a41('0x1e')]({'where':{'phone':_0x4f8344[_0x8a41('0xd')],'CampaignId':_0xb71612['id']}})['then'](function(_0x2f82d5){if(!_[_0x8a41('0x1b')](_0x2f82d5)){throw new Error(_0x8a41('0x26')+_0x4f8344[_0x8a41('0xd')]+_0x8a41('0x30')+_0xb71612['id']);}return _0x32a144['CmHopper'][_0x8a41('0x28')]({'phone':_0x4f8344[_0x8a41('0xd')],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344[_0x8a41('0x29')],'priority':_0x4f8344[_0x8a41('0x2a')]?_0x4f8344[_0x8a41('0x2a')]:0x2,'scheduledat':_0x4f8344['scheduledat']?_0x4f8344[_0x8a41('0x18')]:moment()['format'](_0x8a41('0x1a')),'callback':_0x4f8344[_0x8a41('0x2b')]?!![]:![],'callbackuniqueid':_0x4f8344[_0x8a41('0x2b')]?_0x4f8344[_0x8a41('0x2b')]:undefined,'callbackat':_0x4f8344[_0x8a41('0x2b')]?moment()[_0x8a41('0x19')](_0x8a41('0x1a')):undefined,'CampaignId':_0xb71612['id']});})[_0x8a41('0x2c')](function(_0x1cfaac){_0x433047(_0x1cfaac);});});});};var _0x46620e=function(_0x1d6297){return new BPromise(function(_0x3273b3,_0x2d06b1){_0x227a42(_0x1d6297,_0x4f8344)[_0x8a41('0x1f')](function(_0x5cdb31){_0x4f8344[_0x8a41('0x18')]=_0x5cdb31[_0x8a41('0x24')];_0x32a144['CmHopper'][_0x8a41('0x1e')]({'where':{'phone':_0x4f8344[_0x8a41('0xd')],'CampaignId':_0x1d6297['id']}})[_0x8a41('0x1f')](function(_0x106f17){if(!_[_0x8a41('0x1b')](_0x106f17)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4f8344['phone']+_0x8a41('0x31')+_0x1d6297['id']);}return _0x32a144[_0x8a41('0x2d')][_0x8a41('0x1e')]({'where':{'calleridnum':_0x4f8344['phone'],'CampaignId':_0x1d6297['id']}});})[_0x8a41('0x1f')](function(_0x42bd50){if(!_[_0x8a41('0x1b')](_0x42bd50)){throw new Error(_0x8a41('0x2e')+_0x4f8344[_0x8a41('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x1d6297['id']);}return _0x32a144[_0x8a41('0x25')][_0x8a41('0x28')]({'phone':_0x4f8344[_0x8a41('0xd')],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344['ListId'],'priority':_0x4f8344[_0x8a41('0x2a')]?_0x4f8344[_0x8a41('0x2a')]:0x2,'scheduledat':_0x4f8344[_0x8a41('0x18')]?_0x4f8344[_0x8a41('0x18')]:moment()['format'](_0x8a41('0x1a')),'callback':_0x4f8344['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4f8344['callbackUniqueid']?_0x4f8344[_0x8a41('0x2b')]:undefined,'callbackat':_0x4f8344[_0x8a41('0x2b')]?moment()['format'](_0x8a41('0x1a')):undefined,'CampaignId':_0x1d6297['id']});})[_0x8a41('0x2c')](function(_0x597b87){_0x2d06b1(_0x597b87);});});});};if(_0x4f8344[_0x8a41('0x29')]){_0x32a144[_0x8a41('0x1d')][_0x8a41('0x32')]({'where':{'type':_0x8a41('0x33')},'attributes':['id',_0x8a41('0x34'),'dialTimezone'],'include':[{'model':_0x32a144[_0x8a41('0x35')],'as':_0x8a41('0x36'),'where':{'id':_0x4f8344[_0x8a41('0x29')]}}]})['then'](function(_0x2ff3cd){if(_0x2ff3cd){var _0x25ecf1=[];for(var _0x54297e=0x0,_0x58ff44;_0x54297e<_0x2ff3cd[_0x8a41('0x37')];_0x54297e+=0x1){_0x58ff44=_0x2ff3cd[_0x54297e]['get']({'plain':!![]});switch(_0x58ff44[_0x8a41('0x34')]){case _0x8a41('0x38'):_0x55e5f9(_0x58ff44)[_0x8a41('0x2c')](_0x2efb76());break;case'onlyIfOpen':_0x229705(_0x58ff44)[_0x8a41('0x2c')](_0x2efb76());break;default:_0x227a42(_0x58ff44,_0x4f8344)['then'](function(_0x27c55b){_0x4f8344[_0x8a41('0x18')]=_0x27c55b[_0x8a41('0x24')];_0x32a144['CmHopper'][_0x8a41('0x28')]({'phone':_0x4f8344['phone'],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344['ListId'],'scheduledat':_0x4f8344[_0x8a41('0x18')]?_0x4f8344['scheduledat']:moment()['format'](_0x8a41('0x1a')),'priority':_0x4f8344[_0x8a41('0x2a')]?_0x4f8344[_0x8a41('0x2a')]:0x2,'callback':_0x4f8344[_0x8a41('0x2b')]?!![]:![],'callbackuniqueid':_0x4f8344[_0x8a41('0x2b')]?_0x4f8344['callbackUniqueid']:undefined,'callbackat':_0x4f8344[_0x8a41('0x2b')]?moment()[_0x8a41('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x58ff44['id']})['catch'](_0x2efb76());});}}}})[_0x8a41('0x1f')](function(){return _0x32a144[_0x8a41('0x1d')]['findAll']({'where':{'type':_0x8a41('0x33')},'attributes':['id'],'include':[{'model':_0x32a144[_0x8a41('0x35')],'as':_0x8a41('0x39'),'where':{'id':_0x4f8344[_0x8a41('0x29')]}}]})[_0x8a41('0x1f')](function(_0xa07211){if(_0xa07211){var _0x509eb2=[];for(var _0x186d2d=0x0,_0x27ca07;_0x186d2d<_0xa07211[_0x8a41('0x37')];_0x186d2d+=0x1){_0x27ca07=_0xa07211[_0x186d2d][_0x8a41('0x15')]({'plain':!![]});_0x32a144['CmHopperBlack'][_0x8a41('0x28')]({'phone':_0x4f8344[_0x8a41('0xd')],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344[_0x8a41('0x29')],'VoiceQueueId':_0x27ca07['id']})[_0x8a41('0x2c')](function(_0x3acf8f){logger[_0x8a41('0x16')](_0x8a41('0x3a'),_0x8a41('0x2f'),_0x3acf8f[_0x8a41('0x3b')]);});}}});})['then'](function(){return _0x32a144[_0x8a41('0x3c')]['findAll']({'attributes':['id',_0x8a41('0x34'),_0x8a41('0x1c')],'include':[{'model':_0x32a144[_0x8a41('0x35')],'as':_0x8a41('0x36'),'where':{'id':_0x4f8344[_0x8a41('0x29')]}}]})[_0x8a41('0x1f')](function(_0x3f57ff){if(_0x3f57ff){var _0x5a49c8=[];for(var _0x40f3d7=0x0,_0x200ed2;_0x40f3d7<_0x3f57ff['length'];_0x40f3d7+=0x1){_0x200ed2=_0x3f57ff[_0x40f3d7]['get']({'plain':!![]});switch(_0x200ed2[_0x8a41('0x34')]){case'always':_0x46620e(_0x200ed2)[_0x8a41('0x2c')](_0x155a1b());break;case _0x8a41('0x3d'):_0x53079e(_0x200ed2)[_0x8a41('0x2c')](_0x155a1b());break;default:_0x32a144[_0x8a41('0x25')][_0x8a41('0x28')]({'phone':_0x4f8344[_0x8a41('0xd')],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344[_0x8a41('0x29')],'scheduledat':_0x4f8344[_0x8a41('0x18')]?_0x4f8344[_0x8a41('0x18')]:moment()[_0x8a41('0x19')](_0x8a41('0x1a')),'priority':_0x4f8344[_0x8a41('0x2a')]?_0x4f8344[_0x8a41('0x2a')]:0x2,'callback':_0x4f8344['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4f8344[_0x8a41('0x2b')]?_0x4f8344[_0x8a41('0x2b')]:undefined,'callbackat':_0x4f8344[_0x8a41('0x2b')]?moment()[_0x8a41('0x19')](_0x8a41('0x1a')):undefined,'CampaignId':_0x200ed2['id']})[_0x8a41('0x2c')](_0x155a1b());}}}});})[_0x8a41('0x1f')](function(){return _0x32a144[_0x8a41('0x3c')]['findAll']({'attributes':['id'],'include':[{'model':_0x32a144[_0x8a41('0x35')],'as':_0x8a41('0x39'),'where':{'id':_0x4f8344[_0x8a41('0x29')]}}]})[_0x8a41('0x1f')](function(_0x71e9){if(_0x71e9){var _0x57cbd9=[];for(var _0x480e62=0x0,_0x570622;_0x480e62<_0x71e9[_0x8a41('0x37')];_0x480e62+=0x1){_0x570622=_0x71e9[_0x480e62][_0x8a41('0x15')]({'plain':!![]});_0x32a144['CmHopperBlack'][_0x8a41('0x28')]({'phone':_0x4f8344[_0x8a41('0xd')],'ContactId':_0x4f8344['id'],'ListId':_0x4f8344[_0x8a41('0x29')],'CampaignId':_0x570622['id']})['catch'](function(_0x3503d2){logger[_0x8a41('0x16')](_0x8a41('0x3a'),_0x8a41('0x2f'),_0x3503d2['message']);});}}});})[_0x8a41('0x1f')](function(){_0x45d907();})['catch'](function(_0x3ba2b7){logger[_0x8a41('0x16')](_0x8a41('0x3a'),_0x8a41('0x2f'),_0x3ba2b7['message']);_0x45d907(_0x3ba2b7);});}else{_0x45d907(new Error(_0x8a41('0x3e')));}},'afterDestroy':function(_0x3254d5,_0x6477b,_0x411c36){var _0x479e63=_0x26db5c[_0x8a41('0x14')];var _0x58a622=_0x3254d5['get']({'plain':!![]});return _0x479e63[_0x8a41('0x25')][_0x8a41('0x32')]({'raw':!![],'where':{'ListId':_0x58a622[_0x8a41('0x29')],'ContactId':_0x58a622['id']}})[_0x8a41('0x1f')](function(_0x400838){if(!_[_0x8a41('0x3f')](_0x400838)){var _0x48c153=[];for(var _0x182756=0x0;_0x182756<_0x400838[_0x8a41('0x37')];_0x182756+=0x1){var _0x1e3886=_0x479e63[_0x8a41('0x25')][_0x8a41('0x40')]({'where':{'ListId':_0x400838[_0x182756][_0x8a41('0x29')],'ContactId':_0x400838[_0x182756]['ContactId'],'VoiceQueueId':_0x400838[_0x182756][_0x8a41('0x41')],'CampaignId':_0x400838[_0x182756][_0x8a41('0x42')]}});_0x48c153[_0x8a41('0x43')](_0x1e3886);}return BPromise[_0x8a41('0x44')](_0x48c153);}})[_0x8a41('0x1f')](function(_0x426850){logger[_0x8a41('0x45')](_0x8a41('0x46'),util[_0x8a41('0x17')](_0x426850,{'showHidden':![],'depth':null}));_0x411c36();})[_0x8a41('0x2c')](function(_0x28de52){logger[_0x8a41('0x16')](_0x8a41('0x47'),util[_0x8a41('0x17')](_0x28de52,{'showHidden':![],'depth':null}));_0x411c36(_0x28de52);});}}});}; \ No newline at end of file +var _0x3ea9=['findOne','then','isNil','utcOffset','add','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','timezones','minutes','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','length','get','always','onlyIfOpen','outbound','cmContact,\x20%s,\x20%s','message','Campaign','BlackLists','List\x20not\x20found','isEmpty','destroy','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone'];(function(_0x535c2b,_0x13368b){var _0x347f9d=function(_0x1c3b4d){while(--_0x1c3b4d){_0x535c2b['push'](_0x535c2b['shift']());}};_0x347f9d(++_0x13368b);}(_0x3ea9,0xca));var _0x93ea=function(_0x486a47,_0x4412ed){_0x486a47=_0x486a47-0x0;var _0x2dcb89=_0x3ea9[_0x486a47];return _0x2dcb89;};'use strict';var _=require(_0x93ea('0x0'));var util=require(_0x93ea('0x1'));var logger=require('../../config/logger')(_0x93ea('0x2'));var moment=require(_0x93ea('0x3'));var BPromise=require(_0x93ea('0x4'));var rp=require(_0x93ea('0x5'));var fs=require('fs');var path=require(_0x93ea('0x6'));var rimraf=require(_0x93ea('0x7'));var config=require(_0x93ea('0x8'));var shared=require(_0x93ea('0x9'));var attributes=require(_0x93ea('0xa'));module[_0x93ea('0xb')]=function(_0x153f27,_0x507197){return _0x153f27[_0x93ea('0xc')]('CmContact',attributes,{'tableName':_0x93ea('0xd'),'paranoid':!![],'indexes':[{'name':_0x93ea('0xe'),'fields':[_0x93ea('0xe')]},{'name':_0x93ea('0xf'),'fields':[_0x93ea('0x10'),_0x93ea('0x11'),_0x93ea('0xe'),_0x93ea('0x12'),_0x93ea('0x13'),_0x93ea('0x14')],'type':_0x93ea('0x15')}],'timestamps':!![],'charset':_0x93ea('0x16'),'collate':_0x93ea('0x17'),'hooks':{'afterCreate':function(_0x2bc1a3,_0x51a422,_0x1e2ec6){var _0x1dca5e=_0x153f27[_0x93ea('0x18')];var _0x12f1bc=_0x2bc1a3['get']({'plain':!![]});function _0x3b734a(){return function(_0x35f813){logger[_0x93ea('0x19')](_0x93ea('0x1a'),'afterCreate',util[_0x93ea('0x1b')](_0x35f813,{'showHidden':![],'depth':null}));};}function _0x23d9d2(_0x29f743,_0xb0a21c){var _0x3a4378=_0xb0a21c[_0x93ea('0x1c')]?_0xb0a21c[_0x93ea('0x1c')]:moment()[_0x93ea('0x1d')](_0x93ea('0x1e'));return new BPromise(function(_0x11a14a,_0x455faf){if(_['isNil'](_0xb0a21c[_0x93ea('0x1f')])){_0x11a14a({'ret':_0x3a4378});}else{_0x1dca5e['VoiceQueue'][_0x93ea('0x20')]({'where':{'id':_0x29f743['id']}})[_0x93ea('0x21')](function(_0x5e8094){if(!_['isNil'](_0x5e8094)){var _0x531fe2=_0x5e8094[_0x93ea('0x1f')];if(!_[_0x93ea('0x22')](_0x531fe2)){var _0x506a7e=shared['timezones'];var _0x49646d=_0x506a7e[_0x531fe2];var _0x4760ec=_0x506a7e[_0xb0a21c[_0x93ea('0x1f')]];if(!_[_0x93ea('0x22')](_0x49646d)&&!_['isNil'](_0x4760ec)){var _0x300282=_0x49646d[_0x93ea('0x23')]-_0x4760ec[_0x93ea('0x23')];_0x3a4378=_0xb0a21c[_0x93ea('0x1c')]?_0xb0a21c['scheduledat']:moment();var _0x350af1=moment(_0x3a4378)[_0x93ea('0x24')](_0x300282,'minutes');_0x11a14a({'ret':_0x350af1[_0x93ea('0x1d')](_0x93ea('0x1e'))});}else _0x11a14a({'ret':_0x3a4378});}else _0x11a14a({'ret':_0x3a4378});}else{_0x11a14a({'ret':_0x3a4378});}});}});return 0xa;}var _0x943954=function(_0xfbc254){return new BPromise(function(_0x335ed2,_0x230909){_0x23d9d2(_0xfbc254,_0x12f1bc)['then'](function(_0x283369){_0x12f1bc[_0x93ea('0x1c')]=_0x283369[_0x93ea('0x25')];_0x1dca5e[_0x93ea('0x26')][_0x93ea('0x20')]({'where':{'phone':_0x12f1bc[_0x93ea('0xe')],'VoiceQueueId':_0xfbc254['id']}})['then'](function(_0x720efd){if(!_[_0x93ea('0x22')](_0x720efd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x12f1bc[_0x93ea('0xe')]+_0x93ea('0x27')+_0xfbc254['id']);}return _0x1dca5e['CmHopper'][_0x93ea('0x28')]({'phone':_0x12f1bc['phone'],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc[_0x93ea('0x29')],'priority':_0x12f1bc['priority']?_0x12f1bc[_0x93ea('0x2a')]:0x2,'scheduledat':_0x12f1bc[_0x93ea('0x1c')]?_0x12f1bc[_0x93ea('0x1c')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x12f1bc[_0x93ea('0x2b')]?!![]:![],'callbackuniqueid':_0x12f1bc[_0x93ea('0x2b')]?_0x12f1bc[_0x93ea('0x2b')]:undefined,'callbackat':_0x12f1bc[_0x93ea('0x2b')]?moment()[_0x93ea('0x1d')](_0x93ea('0x1e')):undefined,'VoiceQueueId':_0xfbc254['id']});})[_0x93ea('0x2c')](function(_0x3418cd){_0x230909(_0x3418cd);});});});};var _0x133024=function(_0x4f3055){return new BPromise(function(_0x30a87a,_0x44d8d9){_0x23d9d2(_0x4f3055,_0x12f1bc)[_0x93ea('0x21')](function(_0x4d1939){_0x12f1bc[_0x93ea('0x1c')]=_0x4d1939[_0x93ea('0x25')];_0x1dca5e['CmHopper'][_0x93ea('0x20')]({'where':{'phone':_0x12f1bc[_0x93ea('0xe')],'VoiceQueueId':_0x4f3055['id']}})[_0x93ea('0x21')](function(_0x48eaed){if(!_[_0x93ea('0x22')](_0x48eaed)){throw new Error(_0x93ea('0x2d')+_0x12f1bc[_0x93ea('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4f3055['id']);}return _0x1dca5e[_0x93ea('0x2e')][_0x93ea('0x20')]({'where':{'calleridnum':_0x12f1bc[_0x93ea('0xe')],'VoiceQueueId':_0x4f3055['id']}});})['then'](function(_0x405527){if(!_['isNil'](_0x405527)){throw new Error(_0x93ea('0x2f')+_0x12f1bc['phone']+_0x93ea('0x30')+_0x4f3055['id']);}return _0x1dca5e['CmHopper'][_0x93ea('0x28')]({'phone':_0x12f1bc['phone'],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc['ListId'],'priority':_0x12f1bc[_0x93ea('0x2a')]?_0x12f1bc[_0x93ea('0x2a')]:0x2,'scheduledat':_0x12f1bc[_0x93ea('0x1c')]?_0x12f1bc[_0x93ea('0x1c')]:moment()[_0x93ea('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x12f1bc[_0x93ea('0x2b')]?!![]:![],'callbackuniqueid':_0x12f1bc[_0x93ea('0x2b')]?_0x12f1bc[_0x93ea('0x2b')]:undefined,'callbackat':_0x12f1bc[_0x93ea('0x2b')]?moment()[_0x93ea('0x1d')](_0x93ea('0x1e')):undefined,'VoiceQueueId':_0x4f3055['id']});})[_0x93ea('0x2c')](function(_0x21a965){_0x44d8d9(_0x21a965);});});});};function _0x3bd785(){return function(_0x1fa6b6){logger[_0x93ea('0x19')](_0x93ea('0x1a'),_0x93ea('0x31'),util[_0x93ea('0x1b')](_0x1fa6b6,{'showHidden':![],'depth':null}));};}function _0x4240e3(_0x336a52,_0x4ffec4){var _0x408a5b=_0x4ffec4['scheduledat']?_0x4ffec4[_0x93ea('0x1c')]:moment()[_0x93ea('0x1d')](_0x93ea('0x1e'));return new BPromise(function(_0x3865a0,_0x234a4f){if(_[_0x93ea('0x22')](_0x4ffec4[_0x93ea('0x1f')])){_0x3865a0({'ret':_0x408a5b});}else{_0x1dca5e['Campaign'][_0x93ea('0x20')]({'where':{'id':_0x336a52['id']}})['then'](function(_0x58d447){if(!_[_0x93ea('0x22')](_0x58d447)){var _0x589508=_0x58d447[_0x93ea('0x1f')];if(!_[_0x93ea('0x22')](_0x589508)){var _0x2aa4e1=shared[_0x93ea('0x32')];var _0x11ac1d=_0x2aa4e1[_0x589508];var _0x93a4cf=_0x2aa4e1[_0x4ffec4[_0x93ea('0x1f')]];if(!_[_0x93ea('0x22')](_0x11ac1d)&&!_[_0x93ea('0x22')](_0x93a4cf)){var _0x494ff5=_0x11ac1d[_0x93ea('0x23')]-_0x93a4cf['utcOffset'];_0x408a5b=_0x4ffec4[_0x93ea('0x1c')]?_0x4ffec4[_0x93ea('0x1c')]:moment();var _0x1bf215=moment(_0x408a5b)[_0x93ea('0x24')](_0x494ff5,_0x93ea('0x33'));_0x3865a0({'ret':_0x1bf215[_0x93ea('0x1d')](_0x93ea('0x1e'))});}else _0x3865a0({'ret':_0x408a5b});}else _0x3865a0({'ret':_0x408a5b});}else{_0x3865a0({'ret':_0x408a5b});}});}});return 0xa;}var _0xf45c48=function(_0x133ac9){return new BPromise(function(_0x32c937,_0x504ae0){_0x4240e3(_0x133ac9,_0x12f1bc)[_0x93ea('0x21')](function(_0x24e759){_0x12f1bc['scheduledat']=_0x24e759[_0x93ea('0x25')];_0x1dca5e[_0x93ea('0x26')][_0x93ea('0x20')]({'where':{'phone':_0x12f1bc[_0x93ea('0xe')],'CampaignId':_0x133ac9['id']}})[_0x93ea('0x21')](function(_0x43bc75){if(!_[_0x93ea('0x22')](_0x43bc75)){throw new Error(_0x93ea('0x2d')+_0x12f1bc[_0x93ea('0xe')]+_0x93ea('0x34')+_0x133ac9['id']);}return _0x1dca5e[_0x93ea('0x26')]['create']({'phone':_0x12f1bc[_0x93ea('0xe')],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc['ListId'],'priority':_0x12f1bc[_0x93ea('0x2a')]?_0x12f1bc[_0x93ea('0x2a')]:0x2,'scheduledat':_0x12f1bc[_0x93ea('0x1c')]?_0x12f1bc['scheduledat']:moment()[_0x93ea('0x1d')](_0x93ea('0x1e')),'callback':_0x12f1bc[_0x93ea('0x2b')]?!![]:![],'callbackuniqueid':_0x12f1bc[_0x93ea('0x2b')]?_0x12f1bc[_0x93ea('0x2b')]:undefined,'callbackat':_0x12f1bc[_0x93ea('0x2b')]?moment()[_0x93ea('0x1d')](_0x93ea('0x1e')):undefined,'CampaignId':_0x133ac9['id']});})[_0x93ea('0x2c')](function(_0x96ebfd){_0x504ae0(_0x96ebfd);});});});};var _0x5f2888=function(_0x5dedc7){return new BPromise(function(_0x34a9d2,_0x175d54){_0x4240e3(_0x5dedc7,_0x12f1bc)['then'](function(_0x5d0cac){_0x12f1bc['scheduledat']=_0x5d0cac['ret'];_0x1dca5e[_0x93ea('0x26')][_0x93ea('0x20')]({'where':{'phone':_0x12f1bc[_0x93ea('0xe')],'CampaignId':_0x5dedc7['id']}})['then'](function(_0x5cd525){if(!_[_0x93ea('0x22')](_0x5cd525)){throw new Error('cmContact,\x20afterCreate\x20'+_0x12f1bc[_0x93ea('0xe')]+_0x93ea('0x35')+_0x5dedc7['id']);}return _0x1dca5e[_0x93ea('0x2e')]['findOne']({'where':{'calleridnum':_0x12f1bc[_0x93ea('0xe')],'CampaignId':_0x5dedc7['id']}});})[_0x93ea('0x21')](function(_0x2ef5b8){if(!_[_0x93ea('0x22')](_0x2ef5b8)){throw new Error(_0x93ea('0x2f')+_0x12f1bc[_0x93ea('0xe')]+_0x93ea('0x36')+_0x5dedc7['id']);}return _0x1dca5e['CmHopper']['create']({'phone':_0x12f1bc[_0x93ea('0xe')],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc['ListId'],'priority':_0x12f1bc['priority']?_0x12f1bc[_0x93ea('0x2a')]:0x2,'scheduledat':_0x12f1bc[_0x93ea('0x1c')]?_0x12f1bc[_0x93ea('0x1c')]:moment()[_0x93ea('0x1d')](_0x93ea('0x1e')),'callback':_0x12f1bc[_0x93ea('0x2b')]?!![]:![],'callbackuniqueid':_0x12f1bc[_0x93ea('0x2b')]?_0x12f1bc['callbackUniqueid']:undefined,'callbackat':_0x12f1bc[_0x93ea('0x2b')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5dedc7['id']});})[_0x93ea('0x2c')](function(_0xa4fa){_0x175d54(_0xa4fa);});});});};if(_0x12f1bc[_0x93ea('0x29')]){_0x1dca5e[_0x93ea('0x37')][_0x93ea('0x38')]({'where':{'type':'outbound'},'attributes':['id',_0x93ea('0x39'),_0x93ea('0x1f')],'include':[{'model':_0x1dca5e[_0x93ea('0x3a')],'as':_0x93ea('0x3b'),'where':{'id':_0x12f1bc[_0x93ea('0x29')]}}]})['then'](function(_0x16e40d){if(_0x16e40d){var _0x2b888b=[];for(var _0x4e9961=0x0,_0x1b1e62;_0x4e9961<_0x16e40d[_0x93ea('0x3c')];_0x4e9961+=0x1){_0x1b1e62=_0x16e40d[_0x4e9961][_0x93ea('0x3d')]({'plain':!![]});switch(_0x1b1e62[_0x93ea('0x39')]){case _0x93ea('0x3e'):_0x133024(_0x1b1e62)[_0x93ea('0x2c')](_0x3b734a());break;case _0x93ea('0x3f'):_0x943954(_0x1b1e62)[_0x93ea('0x2c')](_0x3b734a());break;default:_0x4240e3(_0x1b1e62,_0x12f1bc)['then'](function(_0x223029){_0x12f1bc[_0x93ea('0x1c')]=_0x223029[_0x93ea('0x25')];_0x1dca5e[_0x93ea('0x26')][_0x93ea('0x28')]({'phone':_0x12f1bc['phone'],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc['ListId'],'scheduledat':_0x12f1bc['scheduledat']?_0x12f1bc[_0x93ea('0x1c')]:moment()[_0x93ea('0x1d')](_0x93ea('0x1e')),'priority':_0x12f1bc[_0x93ea('0x2a')]?_0x12f1bc[_0x93ea('0x2a')]:0x2,'callback':_0x12f1bc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12f1bc[_0x93ea('0x2b')]?_0x12f1bc[_0x93ea('0x2b')]:undefined,'callbackat':_0x12f1bc[_0x93ea('0x2b')]?moment()[_0x93ea('0x1d')](_0x93ea('0x1e')):undefined,'VoiceQueueId':_0x1b1e62['id']})[_0x93ea('0x2c')](_0x3b734a());});}}}})[_0x93ea('0x21')](function(){return _0x1dca5e[_0x93ea('0x37')][_0x93ea('0x38')]({'where':{'type':_0x93ea('0x40')},'attributes':['id'],'include':[{'model':_0x1dca5e[_0x93ea('0x3a')],'as':'BlackLists','where':{'id':_0x12f1bc[_0x93ea('0x29')]}}]})['then'](function(_0x2cf3ef){if(_0x2cf3ef){var _0x2e17ea=[];for(var _0x1e66d5=0x0,_0x4e2d1e;_0x1e66d5<_0x2cf3ef[_0x93ea('0x3c')];_0x1e66d5+=0x1){_0x4e2d1e=_0x2cf3ef[_0x1e66d5][_0x93ea('0x3d')]({'plain':!![]});_0x1dca5e['CmHopperBlack'][_0x93ea('0x28')]({'phone':_0x12f1bc[_0x93ea('0xe')],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc['ListId'],'VoiceQueueId':_0x4e2d1e['id']})[_0x93ea('0x2c')](function(_0x524f4b){logger['error'](_0x93ea('0x41'),_0x93ea('0x31'),_0x524f4b[_0x93ea('0x42')]);});}}});})['then'](function(){return _0x1dca5e[_0x93ea('0x43')][_0x93ea('0x38')]({'attributes':['id',_0x93ea('0x39'),_0x93ea('0x1f')],'include':[{'model':_0x1dca5e['CmList'],'as':'Lists','where':{'id':_0x12f1bc[_0x93ea('0x29')]}}]})[_0x93ea('0x21')](function(_0x28db85){if(_0x28db85){var _0x19fd9b=[];for(var _0xa024c3=0x0,_0x535d98;_0xa024c3<_0x28db85[_0x93ea('0x3c')];_0xa024c3+=0x1){_0x535d98=_0x28db85[_0xa024c3][_0x93ea('0x3d')]({'plain':!![]});switch(_0x535d98['dialCheckDuplicateType']){case _0x93ea('0x3e'):_0x5f2888(_0x535d98)[_0x93ea('0x2c')](_0x3bd785());break;case _0x93ea('0x3f'):_0xf45c48(_0x535d98)[_0x93ea('0x2c')](_0x3bd785());break;default:_0x1dca5e[_0x93ea('0x26')][_0x93ea('0x28')]({'phone':_0x12f1bc[_0x93ea('0xe')],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc[_0x93ea('0x29')],'scheduledat':_0x12f1bc[_0x93ea('0x1c')]?_0x12f1bc[_0x93ea('0x1c')]:moment()[_0x93ea('0x1d')](_0x93ea('0x1e')),'priority':_0x12f1bc[_0x93ea('0x2a')]?_0x12f1bc[_0x93ea('0x2a')]:0x2,'callback':_0x12f1bc[_0x93ea('0x2b')]?!![]:![],'callbackuniqueid':_0x12f1bc[_0x93ea('0x2b')]?_0x12f1bc[_0x93ea('0x2b')]:undefined,'callbackat':_0x12f1bc[_0x93ea('0x2b')]?moment()[_0x93ea('0x1d')](_0x93ea('0x1e')):undefined,'CampaignId':_0x535d98['id']})['catch'](_0x3bd785());}}}});})[_0x93ea('0x21')](function(){return _0x1dca5e['Campaign'][_0x93ea('0x38')]({'attributes':['id'],'include':[{'model':_0x1dca5e[_0x93ea('0x3a')],'as':_0x93ea('0x44'),'where':{'id':_0x12f1bc['ListId']}}]})['then'](function(_0x152bd5){if(_0x152bd5){var _0x53b394=[];for(var _0x2e779f=0x0,_0x3257f2;_0x2e779f<_0x152bd5['length'];_0x2e779f+=0x1){_0x3257f2=_0x152bd5[_0x2e779f][_0x93ea('0x3d')]({'plain':!![]});_0x1dca5e['CmHopperBlack'][_0x93ea('0x28')]({'phone':_0x12f1bc[_0x93ea('0xe')],'ContactId':_0x12f1bc['id'],'ListId':_0x12f1bc[_0x93ea('0x29')],'CampaignId':_0x3257f2['id']})['catch'](function(_0x183508){logger['error'](_0x93ea('0x41'),'afterCreate',_0x183508[_0x93ea('0x42')]);});}}});})[_0x93ea('0x21')](function(){_0x1e2ec6();})[_0x93ea('0x2c')](function(_0x9484e5){logger[_0x93ea('0x19')]('cmContact,\x20%s,\x20%s','afterCreate',_0x9484e5['message']);_0x1e2ec6(_0x9484e5);});}else{_0x1e2ec6(new Error(_0x93ea('0x45')));}},'afterDestroy':function(_0x42cb89,_0xecddc3,_0x11523f){var _0x100031=_0x153f27[_0x93ea('0x18')];var _0x2f7e67=_0x42cb89[_0x93ea('0x3d')]({'plain':!![]});return _0x100031[_0x93ea('0x26')][_0x93ea('0x38')]({'raw':!![],'where':{'ListId':_0x2f7e67[_0x93ea('0x29')],'ContactId':_0x2f7e67['id']}})[_0x93ea('0x21')](function(_0x20e479){if(!_[_0x93ea('0x46')](_0x20e479)){var _0x4e336f=[];for(var _0x2fbfe5=0x0;_0x2fbfe5<_0x20e479['length'];_0x2fbfe5+=0x1){var _0x411181=_0x100031[_0x93ea('0x26')][_0x93ea('0x47')]({'where':{'ListId':_0x20e479[_0x2fbfe5][_0x93ea('0x29')],'ContactId':_0x20e479[_0x2fbfe5]['ContactId'],'VoiceQueueId':_0x20e479[_0x2fbfe5]['VoiceQueueId'],'CampaignId':_0x20e479[_0x2fbfe5][_0x93ea('0x48')]}});_0x4e336f[_0x93ea('0x49')](_0x411181);}return BPromise[_0x93ea('0x4a')](_0x4e336f);}})['then'](function(_0x60575c){logger[_0x93ea('0x4b')](_0x93ea('0x4c'),util[_0x93ea('0x1b')](_0x60575c,{'showHidden':![],'depth':null}));_0x11523f();})[_0x93ea('0x2c')](function(_0x1f9fc4){logger[_0x93ea('0x19')](_0x93ea('0x4d'),util[_0x93ea('0x1b')](_0x1f9fc4,{'showHidden':![],'depth':null}));_0x11523f(_0x1f9fc4);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index d7b9d2a..3cad436 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(_0x3c791a,_0x4e2f27){var _0x5788fc=function(_0x7dfb3a){while(--_0x7dfb3a){_0x3c791a['push'](_0x3c791a['shift']());}};_0x5788fc(++_0x4e2f27);}(_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 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(_0x4b1c05,_0x46a515){var _0xef4c87=function(_0xe4fe29){while(--_0xe4fe29){_0x4b1c05['push'](_0x4b1c05['shift']());}};_0xef4c87(++_0x46a515);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 9fd13f7..baabc87 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 _0x0ba7=['INTEGER','STRING','sequelize'];(function(_0x1b829c,_0xdfb15c){var _0x420da2=function(_0x340c0f){while(--_0x340c0f){_0x1b829c['push'](_0x1b829c['shift']());}};_0x420da2(++_0xdfb15c);}(_0x0ba7,0x16d));var _0x70ba=function(_0x42e128,_0xf301f2){_0x42e128=_0x42e128-0x0;var _0x248bdf=_0x0ba7[_0x42e128];return _0x248bdf;};'use strict';var Sequelize=require(_0x70ba('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x70ba('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x70ba('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x70ba('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x70ba('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x70ba('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x70ba('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x0a9a=['STRING','INTEGER','PHONE','exports'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x0a9a,0x183));var _0xa0a9=function(_0x321f95,_0x1be6cf){_0x321f95=_0x321f95-0x0;var _0x32a51e=_0x0a9a[_0x321f95];return _0x32a51e;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa0a9('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xa0a9('0x1')],'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 d481d74..60f2d3d 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 _0x599a=['sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','CmContactHasItem','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x599a,0x8c));var _0xa599=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x599a[_0x3f00ee];return _0x18a07e;};'use strict';var emlformat=require(_0xa599('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa599('0x1'));var rp=require('request-promise');var moment=require(_0xa599('0x2'));var BPromise=require(_0xa599('0x3'));var Mustache=require('mustache');var util=require(_0xa599('0x4'));var path=require('path');var sox=require(_0xa599('0x5'));var csv=require(_0xa599('0x6'));var ejs=require(_0xa599('0x7'));var fs=require('fs');var fs_extra=require(_0xa599('0x8'));var _=require(_0xa599('0x9'));var squel=require(_0xa599('0xa'));var crypto=require(_0xa599('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa599('0xc'));var toCsv=require(_0xa599('0x6'));var querystring=require('querystring');var Papa=require(_0xa599('0xd'));var Redis=require('ioredis');var authService=require(_0xa599('0xe'));var qs=require(_0xa599('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa599('0x10'));var logger=require(_0xa599('0x11'))(_0xa599('0x12'));var utils=require(_0xa599('0x13'));var config=require(_0xa599('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa599('0x15'))['db'];function respondWithStatusCode(_0xca07c6,_0x4de4ff){_0x4de4ff=_0x4de4ff||0xcc;return function(_0x24b827){if(_0x24b827){return _0xca07c6[_0xa599('0x16')](_0x4de4ff);}return _0xca07c6[_0xa599('0x17')](_0x4de4ff)[_0xa599('0x18')]();};}function respondWithResult(_0x131699,_0x26b67a){_0x26b67a=_0x26b67a||0xc8;return function(_0x379cc5){if(_0x379cc5){return _0x131699[_0xa599('0x17')](_0x26b67a)['json'](_0x379cc5);}};}function respondWithFilteredResult(_0x1630ab,_0x46d8bd){return function(_0x1769d5){if(_0x1769d5){var _0x1857ae=typeof _0x46d8bd['offset']===_0xa599('0x19')&&typeof _0x46d8bd[_0xa599('0x1a')]===_0xa599('0x19');var _0x314be0=_0x1769d5['count'];var _0x341984=_0x1857ae?0x0:_0x46d8bd['offset'];var _0x2dc0d9=_0x1857ae?_0x1769d5[_0xa599('0x1b')]:_0x46d8bd[_0xa599('0x1c')]+_0x46d8bd[_0xa599('0x1a')];var _0x4fb2ac;if(_0x2dc0d9>=_0x314be0){_0x2dc0d9=_0x314be0;_0x4fb2ac=0xc8;}else{_0x4fb2ac=0xce;}_0x1630ab[_0xa599('0x17')](_0x4fb2ac);return _0x1630ab[_0xa599('0x1d')](_0xa599('0x1e'),_0x341984+'-'+_0x2dc0d9+'/'+_0x314be0)[_0xa599('0x1f')](_0x1769d5);}return null;};}function patchUpdates(_0x34fed6){return function(_0x45aea9){try{jsonpatch[_0xa599('0x20')](_0x45aea9,_0x34fed6,!![]);}catch(_0x4327bf){return BPromise[_0xa599('0x21')](_0x4327bf);}return _0x45aea9[_0xa599('0x22')]();};}function saveUpdates(_0x531221,_0x465eb5){return function(_0x2d9f78){if(_0x2d9f78){return _0x2d9f78[_0xa599('0x23')](_0x531221)[_0xa599('0x24')](function(_0x24022d){return _0x24022d;});}return null;};}function removeEntity(_0x2e90e1,_0xc7f119){return function(_0x5bad00){if(_0x5bad00){return _0x5bad00[_0xa599('0x25')]()[_0xa599('0x24')](function(){var _0x63a9df=_0x5bad00[_0xa599('0x26')]({'plain':!![]});var _0x558194=_0xa599('0x27');return db[_0xa599('0x28')]['destroy']({'where':{'type':_0x558194,'resourceId':_0x63a9df['id']}})[_0xa599('0x24')](function(){return _0x5bad00;});})['then'](function(){_0x2e90e1[_0xa599('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cfbd6,_0x38c4f9){return function(_0x124a12){if(!_0x124a12){_0x2cfbd6[_0xa599('0x16')](0x194);}return _0x124a12;};}function handleError(_0x3d00b7,_0x55c5af){_0x55c5af=_0x55c5af||0x1f4;return function(_0x569a91){logger[_0xa599('0x29')](_0x569a91[_0xa599('0x2a')]);if(_0x569a91[_0xa599('0x2b')]){delete _0x569a91['name'];}_0x3d00b7[_0xa599('0x17')](_0x55c5af)[_0xa599('0x2c')](_0x569a91);};}exports['index']=function(_0x4ebb4c,_0x2e40f4){var _0x36e1b6={},_0x2ef7e9={},_0x538a4c={'count':0x0,'rows':[]};var _0xc5cc0d=_['map'](db[_0xa599('0x2d')][_0xa599('0x2e')],function(_0x47bdd9){return{'name':_0x47bdd9[_0xa599('0x2f')],'type':_0x47bdd9['type'][_0xa599('0x30')]};});_0x2ef7e9[_0xa599('0x31')]=_['map'](_0xc5cc0d,_0xa599('0x2b'));_0x2ef7e9[_0xa599('0x32')]=_[_0xa599('0x33')](_0x4ebb4c[_0xa599('0x32')]);_0x2ef7e9[_0xa599('0x34')]=_['intersection'](_0x2ef7e9[_0xa599('0x31')],_0x2ef7e9['query']);_0x36e1b6[_0xa599('0x35')]=_[_0xa599('0x36')](_0x2ef7e9[_0xa599('0x31')],qs[_0xa599('0x37')](_0x4ebb4c[_0xa599('0x32')][_0xa599('0x37')]));_0x36e1b6[_0xa599('0x35')]=_0x36e1b6[_0xa599('0x35')]['length']?_0x36e1b6[_0xa599('0x35')]:_0x2ef7e9[_0xa599('0x31')];if(!_0x4ebb4c[_0xa599('0x32')][_0xa599('0x38')](_0xa599('0x39'))){_0x36e1b6[_0xa599('0x1a')]=qs['limit'](_0x4ebb4c[_0xa599('0x32')]['limit']);_0x36e1b6[_0xa599('0x1c')]=qs[_0xa599('0x1c')](_0x4ebb4c[_0xa599('0x32')][_0xa599('0x1c')]);}_0x36e1b6[_0xa599('0x3a')]=qs[_0xa599('0x3b')](_0x4ebb4c[_0xa599('0x32')][_0xa599('0x3b')]);_0x36e1b6[_0xa599('0x3c')]=qs[_0xa599('0x34')](_['pick'](_0x4ebb4c[_0xa599('0x32')],_0x2ef7e9[_0xa599('0x34')]),_0xc5cc0d);if(_0x4ebb4c[_0xa599('0x32')][_0xa599('0x3d')]){_0x36e1b6[_0xa599('0x3c')]=_[_0xa599('0x3e')](_0x36e1b6['where'],{'$or':_[_0xa599('0x3f')](_0xc5cc0d,function(_0x3a21f9){if(_0x3a21f9[_0xa599('0x40')]!==_0xa599('0x41')){var _0x5893ae={};_0x5893ae[_0x3a21f9['name']]={'$like':'%'+_0x4ebb4c['query'][_0xa599('0x3d')]+'%'};return _0x5893ae;}})});}_0x36e1b6=_[_0xa599('0x3e')]({},_0x36e1b6,_0x4ebb4c['options']);var _0x42dfd2={'where':_0x36e1b6[_0xa599('0x3c')]};return db[_0xa599('0x2d')][_0xa599('0x1b')](_0x42dfd2)['then'](function(_0x426463){_0x538a4c[_0xa599('0x1b')]=_0x426463;if(_0x4ebb4c['query'][_0xa599('0x42')]){_0x36e1b6['include']=[{'all':!![]}];}return db[_0xa599('0x2d')][_0xa599('0x43')](_0x36e1b6);})[_0xa599('0x24')](function(_0x1813c8){_0x538a4c[_0xa599('0x44')]=_0x1813c8;return _0x538a4c;})[_0xa599('0x24')](respondWithFilteredResult(_0x2e40f4,_0x36e1b6))[_0xa599('0x45')](handleError(_0x2e40f4,null));};exports['show']=function(_0x17bf6c,_0x1a235a){var _0x78ea3d={'raw':!![],'where':{'id':_0x17bf6c[_0xa599('0x46')]['id']}},_0x56d9ff={};_0x56d9ff[_0xa599('0x31')]=_[_0xa599('0x33')](db[_0xa599('0x2d')][_0xa599('0x2e')]);_0x56d9ff[_0xa599('0x32')]=_['keys'](_0x17bf6c['query']);_0x56d9ff[_0xa599('0x34')]=_['intersection'](_0x56d9ff[_0xa599('0x31')],_0x56d9ff['query']);_0x78ea3d[_0xa599('0x35')]=_[_0xa599('0x36')](_0x56d9ff[_0xa599('0x31')],qs[_0xa599('0x37')](_0x17bf6c['query']['fields']));_0x78ea3d[_0xa599('0x35')]=_0x78ea3d[_0xa599('0x35')]['length']?_0x78ea3d[_0xa599('0x35')]:_0x56d9ff[_0xa599('0x31')];if(_0x17bf6c[_0xa599('0x32')][_0xa599('0x42')]){_0x78ea3d[_0xa599('0x47')]=[{'all':!![]}];}_0x78ea3d=_['merge']({},_0x78ea3d,_0x17bf6c['options']);return db['CmContactHasItem'][_0xa599('0x48')](_0x78ea3d)[_0xa599('0x24')](handleEntityNotFound(_0x1a235a,null))[_0xa599('0x24')](respondWithResult(_0x1a235a,null))[_0xa599('0x45')](handleError(_0x1a235a,null));};exports[_0xa599('0x49')]=function(_0x1e4038,_0x4940c3){return db[_0xa599('0x2d')][_0xa599('0x49')](_0x1e4038[_0xa599('0x4a')],{})[_0xa599('0x24')](function(_0x45a094){var _0x2dfe8e=_0x1e4038[_0xa599('0x4b')][_0xa599('0x26')]({'plain':!![]});if(!_0x2dfe8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dfe8e[_0xa599('0x4c')]===_0xa599('0x4b')){var _0x9b541d=_0x45a094[_0xa599('0x26')]({'plain':!![]});var _0x3752ca=_0xa599('0x27');return db[_0xa599('0x4d')][_0xa599('0x48')]({'where':{'name':_0x3752ca,'userProfileId':_0x2dfe8e[_0xa599('0x4e')]},'raw':!![]})['then'](function(_0x586270){if(_0x586270&&_0x586270[_0xa599('0x4f')]===0x0){return db[_0xa599('0x28')][_0xa599('0x49')]({'name':_0x9b541d['name'],'resourceId':_0x9b541d['id'],'type':_0x586270['name'],'sectionId':_0x586270['id']},{})[_0xa599('0x24')](function(){return _0x45a094;});}else{return _0x45a094;}})[_0xa599('0x45')](function(_0x103720){logger[_0xa599('0x29')](_0xa599('0x50'),_0x103720);throw _0x103720;});}return _0x45a094;})['then'](respondWithResult(_0x4940c3,0xc9))[_0xa599('0x45')](handleError(_0x4940c3,null));};exports[_0xa599('0x23')]=function(_0x177a19,_0x52fa9d){if(_0x177a19[_0xa599('0x4a')]['id']){delete _0x177a19[_0xa599('0x4a')]['id'];}return db[_0xa599('0x2d')][_0xa599('0x48')]({'where':{'id':_0x177a19[_0xa599('0x46')]['id']}})[_0xa599('0x24')](handleEntityNotFound(_0x52fa9d,null))[_0xa599('0x24')](saveUpdates(_0x177a19[_0xa599('0x4a')],null))[_0xa599('0x24')](respondWithResult(_0x52fa9d,null))[_0xa599('0x45')](handleError(_0x52fa9d,null));};exports[_0xa599('0x25')]=function(_0x14f313,_0x2784f7){return db[_0xa599('0x2d')]['find']({'where':{'id':_0x14f313['params']['id']}})[_0xa599('0x24')](handleEntityNotFound(_0x2784f7,null))[_0xa599('0x24')](removeEntity(_0x2784f7,null))[_0xa599('0x45')](handleError(_0x2784f7,null));}; \ No newline at end of file +var _0x5128=['keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','body','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send','map','CmContactHasItem','rawAttributes','type','key','model','query'];(function(_0x58c8ae,_0x20dff2){var _0xadbae2=function(_0x5a102a){while(--_0x5a102a){_0x58c8ae['push'](_0x58c8ae['shift']());}};_0xadbae2(++_0x20dff2);}(_0x5128,0xfc));var _0x8512=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5128[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x8512('0x0'));var rimraf=require(_0x8512('0x1'));var zipdir=require(_0x8512('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8512('0x3'));var Mustache=require('mustache');var util=require(_0x8512('0x4'));var path=require('path');var sox=require(_0x8512('0x5'));var csv=require(_0x8512('0x6'));var ejs=require(_0x8512('0x7'));var fs=require('fs');var fs_extra=require(_0x8512('0x8'));var _=require(_0x8512('0x9'));var squel=require(_0x8512('0xa'));var crypto=require(_0x8512('0xb'));var jsforce=require(_0x8512('0xc'));var deskjs=require(_0x8512('0xd'));var toCsv=require(_0x8512('0x6'));var querystring=require('querystring');var Papa=require(_0x8512('0xe'));var Redis=require('ioredis');var authService=require(_0x8512('0xf'));var qs=require(_0x8512('0x10'));var as=require(_0x8512('0x11'));var hardwareService=require(_0x8512('0x12'));var logger=require(_0x8512('0x13'))(_0x8512('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaf2f68,_0xc94ec5){_0xc94ec5=_0xc94ec5||0xcc;return function(_0x101247){if(_0x101247){return _0xaf2f68['sendStatus'](_0xc94ec5);}return _0xaf2f68[_0x8512('0x15')](_0xc94ec5)['end']();};}function respondWithResult(_0x4dc757,_0x59dbdf){_0x59dbdf=_0x59dbdf||0xc8;return function(_0x55e8ae){if(_0x55e8ae){return _0x4dc757[_0x8512('0x15')](_0x59dbdf)['json'](_0x55e8ae);}};}function respondWithFilteredResult(_0x582ad1,_0x398d82){return function(_0x32e431){if(_0x32e431){var _0x24007b=typeof _0x398d82[_0x8512('0x16')]===_0x8512('0x17')&&typeof _0x398d82[_0x8512('0x18')]===_0x8512('0x17');var _0x10ba4f=_0x32e431[_0x8512('0x19')];var _0x44c0cd=_0x24007b?0x0:_0x398d82['offset'];var _0x13cb82=_0x24007b?_0x32e431[_0x8512('0x19')]:_0x398d82[_0x8512('0x16')]+_0x398d82['limit'];var _0x36e544;if(_0x13cb82>=_0x10ba4f){_0x13cb82=_0x10ba4f;_0x36e544=0xc8;}else{_0x36e544=0xce;}_0x582ad1[_0x8512('0x15')](_0x36e544);return _0x582ad1[_0x8512('0x1a')](_0x8512('0x1b'),_0x44c0cd+'-'+_0x13cb82+'/'+_0x10ba4f)['json'](_0x32e431);}return null;};}function patchUpdates(_0x9d3701){return function(_0x49390f){try{jsonpatch[_0x8512('0x1c')](_0x49390f,_0x9d3701,!![]);}catch(_0x29f18d){return BPromise['reject'](_0x29f18d);}return _0x49390f[_0x8512('0x1d')]();};}function saveUpdates(_0x1a99e0,_0x2412e7){return function(_0x7a3d29){if(_0x7a3d29){return _0x7a3d29[_0x8512('0x1e')](_0x1a99e0)[_0x8512('0x1f')](function(_0x3e4d6f){return _0x3e4d6f;});}return null;};}function removeEntity(_0x45586c,_0x59c808){return function(_0x221c5d){if(_0x221c5d){return _0x221c5d[_0x8512('0x20')]()[_0x8512('0x1f')](function(){var _0x15b913=_0x221c5d[_0x8512('0x21')]({'plain':!![]});var _0x562740=_0x8512('0x22');return db[_0x8512('0x23')][_0x8512('0x20')]({'where':{'type':_0x562740,'resourceId':_0x15b913['id']}})[_0x8512('0x1f')](function(){return _0x221c5d;});})['then'](function(){_0x45586c[_0x8512('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bee18,_0x2f212f){return function(_0x35d2be){if(!_0x35d2be){_0x5bee18[_0x8512('0x24')](0x194);}return _0x35d2be;};}function handleError(_0x4deb8c,_0xfb135){_0xfb135=_0xfb135||0x1f4;return function(_0x3694d1){logger[_0x8512('0x25')](_0x3694d1[_0x8512('0x26')]);if(_0x3694d1[_0x8512('0x27')]){delete _0x3694d1[_0x8512('0x27')];}_0x4deb8c[_0x8512('0x15')](_0xfb135)[_0x8512('0x28')](_0x3694d1);};}exports['index']=function(_0x4a070e,_0x107edd){var _0x1bf77f={},_0x146957={},_0x1e9ca7={'count':0x0,'rows':[]};var _0x1a93bd=_[_0x8512('0x29')](db[_0x8512('0x2a')][_0x8512('0x2b')],function(_0x1b7ec3){return{'name':_0x1b7ec3['fieldName'],'type':_0x1b7ec3[_0x8512('0x2c')][_0x8512('0x2d')]};});_0x146957[_0x8512('0x2e')]=_[_0x8512('0x29')](_0x1a93bd,_0x8512('0x27'));_0x146957[_0x8512('0x2f')]=_[_0x8512('0x30')](_0x4a070e[_0x8512('0x2f')]);_0x146957[_0x8512('0x31')]=_['intersection'](_0x146957[_0x8512('0x2e')],_0x146957[_0x8512('0x2f')]);_0x1bf77f[_0x8512('0x32')]=_[_0x8512('0x33')](_0x146957[_0x8512('0x2e')],qs[_0x8512('0x34')](_0x4a070e['query'][_0x8512('0x34')]));_0x1bf77f[_0x8512('0x32')]=_0x1bf77f['attributes'][_0x8512('0x35')]?_0x1bf77f[_0x8512('0x32')]:_0x146957[_0x8512('0x2e')];if(!_0x4a070e['query']['hasOwnProperty'](_0x8512('0x36'))){_0x1bf77f[_0x8512('0x18')]=qs[_0x8512('0x18')](_0x4a070e[_0x8512('0x2f')][_0x8512('0x18')]);_0x1bf77f['offset']=qs[_0x8512('0x16')](_0x4a070e[_0x8512('0x2f')][_0x8512('0x16')]);}_0x1bf77f[_0x8512('0x37')]=qs[_0x8512('0x38')](_0x4a070e[_0x8512('0x2f')][_0x8512('0x38')]);_0x1bf77f[_0x8512('0x39')]=qs[_0x8512('0x31')](_[_0x8512('0x3a')](_0x4a070e[_0x8512('0x2f')],_0x146957[_0x8512('0x31')]),_0x1a93bd);if(_0x4a070e[_0x8512('0x2f')][_0x8512('0x3b')]){_0x1bf77f['where']=_[_0x8512('0x3c')](_0x1bf77f['where'],{'$or':_['map'](_0x1a93bd,function(_0x3004af){if(_0x3004af[_0x8512('0x2c')]!==_0x8512('0x3d')){var _0x2c28fb={};_0x2c28fb[_0x3004af[_0x8512('0x27')]]={'$like':'%'+_0x4a070e[_0x8512('0x2f')][_0x8512('0x3b')]+'%'};return _0x2c28fb;}})});}_0x1bf77f=_[_0x8512('0x3c')]({},_0x1bf77f,_0x4a070e[_0x8512('0x3e')]);var _0x492e4f={'where':_0x1bf77f[_0x8512('0x39')]};return db['CmContactHasItem'][_0x8512('0x19')](_0x492e4f)[_0x8512('0x1f')](function(_0x26787c){_0x1e9ca7['count']=_0x26787c;if(_0x4a070e[_0x8512('0x2f')][_0x8512('0x3f')]){_0x1bf77f[_0x8512('0x40')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x8512('0x41')](_0x1bf77f);})[_0x8512('0x1f')](function(_0x4cb6fe){_0x1e9ca7['rows']=_0x4cb6fe;return _0x1e9ca7;})[_0x8512('0x1f')](respondWithFilteredResult(_0x107edd,_0x1bf77f))['catch'](handleError(_0x107edd,null));};exports[_0x8512('0x42')]=function(_0x5f4165,_0x55e9c4){var _0x4abe62={'raw':!![],'where':{'id':_0x5f4165[_0x8512('0x43')]['id']}},_0x2e3920={};_0x2e3920['model']=_['keys'](db['CmContactHasItem'][_0x8512('0x2b')]);_0x2e3920['query']=_['keys'](_0x5f4165[_0x8512('0x2f')]);_0x2e3920[_0x8512('0x31')]=_[_0x8512('0x33')](_0x2e3920[_0x8512('0x2e')],_0x2e3920[_0x8512('0x2f')]);_0x4abe62[_0x8512('0x32')]=_[_0x8512('0x33')](_0x2e3920[_0x8512('0x2e')],qs[_0x8512('0x34')](_0x5f4165['query'][_0x8512('0x34')]));_0x4abe62[_0x8512('0x32')]=_0x4abe62[_0x8512('0x32')]['length']?_0x4abe62[_0x8512('0x32')]:_0x2e3920[_0x8512('0x2e')];if(_0x5f4165[_0x8512('0x2f')][_0x8512('0x3f')]){_0x4abe62[_0x8512('0x40')]=[{'all':!![]}];}_0x4abe62=_[_0x8512('0x3c')]({},_0x4abe62,_0x5f4165[_0x8512('0x3e')]);return db[_0x8512('0x2a')]['find'](_0x4abe62)[_0x8512('0x1f')](handleEntityNotFound(_0x55e9c4,null))[_0x8512('0x1f')](respondWithResult(_0x55e9c4,null))[_0x8512('0x44')](handleError(_0x55e9c4,null));};exports['create']=function(_0x3b0870,_0x1c0409){return db[_0x8512('0x2a')]['create'](_0x3b0870[_0x8512('0x45')],{})[_0x8512('0x1f')](function(_0x33d8ec){var _0x484256=_0x3b0870[_0x8512('0x46')]['get']({'plain':!![]});if(!_0x484256)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x484256['role']===_0x8512('0x46')){var _0x1d44ee=_0x33d8ec[_0x8512('0x21')]({'plain':!![]});var _0x45deb4=_0x8512('0x22');return db[_0x8512('0x47')][_0x8512('0x48')]({'where':{'name':_0x45deb4,'userProfileId':_0x484256[_0x8512('0x49')]},'raw':!![]})['then'](function(_0x19a85c){if(_0x19a85c&&_0x19a85c['autoAssociation']===0x0){return db[_0x8512('0x23')]['create']({'name':_0x1d44ee[_0x8512('0x27')],'resourceId':_0x1d44ee['id'],'type':_0x19a85c[_0x8512('0x27')],'sectionId':_0x19a85c['id']},{})['then'](function(){return _0x33d8ec;});}else{return _0x33d8ec;}})[_0x8512('0x44')](function(_0x59c630){logger[_0x8512('0x25')](_0x8512('0x4a'),_0x59c630);throw _0x59c630;});}return _0x33d8ec;})['then'](respondWithResult(_0x1c0409,0xc9))[_0x8512('0x44')](handleError(_0x1c0409,null));};exports[_0x8512('0x1e')]=function(_0x512048,_0x4ae201){if(_0x512048[_0x8512('0x45')]['id']){delete _0x512048[_0x8512('0x45')]['id'];}return db['CmContactHasItem'][_0x8512('0x48')]({'where':{'id':_0x512048['params']['id']}})['then'](handleEntityNotFound(_0x4ae201,null))[_0x8512('0x1f')](saveUpdates(_0x512048[_0x8512('0x45')],null))[_0x8512('0x1f')](respondWithResult(_0x4ae201,null))['catch'](handleError(_0x4ae201,null));};exports[_0x8512('0x20')]=function(_0x219718,_0x21ec8a){return db[_0x8512('0x2a')][_0x8512('0x48')]({'where':{'id':_0x219718[_0x8512('0x43')]['id']}})['then'](handleEntityNotFound(_0x21ec8a,null))[_0x8512('0x1f')](removeEntity(_0x21ec8a,null))[_0x8512('0x44')](handleError(_0x21ec8a,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 41c4436..5a31273 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 _0xcd51=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x52040f,_0x3067a5){var _0x2da2df=function(_0x31fb35){while(--_0x31fb35){_0x52040f['push'](_0x52040f['shift']());}};_0x2da2df(++_0x3067a5);}(_0xcd51,0x1d4));var _0x1cd5=function(_0x49f98c,_0x2d1bd7){_0x49f98c=_0x49f98c-0x0;var _0x402851=_0xcd51[_0x49f98c];return _0x402851;};'use strict';var _=require(_0x1cd5('0x0'));var util=require(_0x1cd5('0x1'));var logger=require(_0x1cd5('0x2'))('api');var moment=require(_0x1cd5('0x3'));var BPromise=require(_0x1cd5('0x4'));var rp=require(_0x1cd5('0x5'));var fs=require('fs');var path=require(_0x1cd5('0x6'));var rimraf=require(_0x1cd5('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cd5('0x8'));module[_0x1cd5('0x9')]=function(_0x29a5c7,_0x5239f9){return _0x29a5c7[_0x1cd5('0xa')](_0x1cd5('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c0b=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','lodash','util'];(function(_0x5890e0,_0xd23b71){var _0x45823b=function(_0x12bcd4){while(--_0x12bcd4){_0x5890e0['push'](_0x5890e0['shift']());}};_0x45823b(++_0xd23b71);}(_0x1c0b,0x13d));var _0xb1c0=function(_0x26c7fc,_0x359bb3){_0x26c7fc=_0x26c7fc-0x0;var _0x4c6302=_0x1c0b[_0x26c7fc];return _0x4c6302;};'use strict';var _=require(_0xb1c0('0x0'));var util=require(_0xb1c0('0x1'));var logger=require('../../config/logger')(_0xb1c0('0x2'));var moment=require(_0xb1c0('0x3'));var BPromise=require(_0xb1c0('0x4'));var rp=require(_0xb1c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1c0('0x6'));var config=require(_0xb1c0('0x7'));var attributes=require(_0xb1c0('0x8'));module['exports']=function(_0x4380ef,_0x1da0c0){return _0x4380ef[_0xb1c0('0x9')](_0xb1c0('0xa'),attributes,{'tableName':'cm_contact_has_items','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 5065e2e..0ed6184 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 _0x5490=['code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51ac44,_0x2d2855){var _0x1fa133=function(_0x14d706){while(--_0x14d706){_0x51ac44['push'](_0x51ac44['shift']());}};_0x1fa133(++_0x2d2855);}(_0x5490,0x14d));var _0x0549=function(_0x3467a1,_0x311bdd){_0x3467a1=_0x3467a1-0x0;var _0x43b705=_0x5490[_0x3467a1];return _0x43b705;};'use strict';var _=require('lodash');var util=require(_0x0549('0x0'));var moment=require(_0x0549('0x1'));var BPromise=require(_0x0549('0x2'));var rs=require(_0x0549('0x3'));var fs=require('fs');var Redis=require(_0x0549('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0549('0x5'));var logger=require('../../config/logger')(_0x0549('0x6'));var config=require(_0x0549('0x7'));var jayson=require(_0x0549('0x8'));var client=jayson[_0x0549('0x9')][_0x0549('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b54f,_0x4ad1d8,_0x2494e6){return new BPromise(function(_0xd8afe0,_0x213f62){return client[_0x0549('0xb')](_0x38b54f,_0x2494e6)[_0x0549('0xc')](function(_0x12f8cd){logger[_0x0549('0xd')](_0x0549('0xe'),_0x4ad1d8,_0x0549('0xf'));logger['debug'](_0x0549('0x10'),_0x4ad1d8,_0x0549('0xf'),JSON[_0x0549('0x11')](_0x12f8cd));if(_0x12f8cd[_0x0549('0x12')]){if(_0x12f8cd[_0x0549('0x12')][_0x0549('0x13')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4ad1d8,_0x12f8cd[_0x0549('0x12')][_0x0549('0x14')]);return _0x213f62(_0x12f8cd['error'][_0x0549('0x14')]);}logger[_0x0549('0x12')](_0x0549('0xe'),_0x4ad1d8,_0x12f8cd[_0x0549('0x12')][_0x0549('0x14')]);return _0xd8afe0(_0x12f8cd['error']['message']);}else{logger[_0x0549('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x4ad1d8,_0x0549('0xf'));_0xd8afe0(_0x12f8cd[_0x0549('0x15')][_0x0549('0x14')]);}})['catch'](function(_0x130a2e){logger['error'](_0x0549('0xe'),_0x4ad1d8,_0x130a2e);_0x213f62(_0x130a2e);});});} \ No newline at end of file +var _0x43be=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error'];(function(_0x39f66d,_0x330ca0){var _0x224b0a=function(_0x242c18){while(--_0x242c18){_0x39f66d['push'](_0x39f66d['shift']());}};_0x224b0a(++_0x330ca0);}(_0x43be,0x1df));var _0xe43b=function(_0x20e295,_0x308599){_0x20e295=_0x20e295-0x0;var _0x33ffbe=_0x43be[_0x20e295];return _0x33ffbe;};'use strict';var _=require(_0xe43b('0x0'));var util=require(_0xe43b('0x1'));var moment=require(_0xe43b('0x2'));var BPromise=require('bluebird');var rs=require(_0xe43b('0x3'));var fs=require('fs');var Redis=require(_0xe43b('0x4'));var db=require(_0xe43b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe43b('0x6'))(_0xe43b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x397f1e,_0x3b6f27,_0x24cccc){return new BPromise(function(_0xdb125d,_0x38a8f9){return client[_0xe43b('0x8')](_0x397f1e,_0x24cccc)[_0xe43b('0x9')](function(_0x49e99f){logger['info'](_0xe43b('0xa'),_0x3b6f27,_0xe43b('0xb'));logger[_0xe43b('0xc')](_0xe43b('0xd'),_0x3b6f27,_0xe43b('0xb'),JSON['stringify'](_0x49e99f));if(_0x49e99f[_0xe43b('0xe')]){if(_0x49e99f[_0xe43b('0xe')]['code']===0x1f4){logger[_0xe43b('0xe')](_0xe43b('0xa'),_0x3b6f27,_0x49e99f[_0xe43b('0xe')][_0xe43b('0xf')]);return _0x38a8f9(_0x49e99f[_0xe43b('0xe')]['message']);}logger[_0xe43b('0xe')](_0xe43b('0xa'),_0x3b6f27,_0x49e99f[_0xe43b('0xe')][_0xe43b('0xf')]);return _0xdb125d(_0x49e99f[_0xe43b('0xe')][_0xe43b('0xf')]);}else{logger[_0xe43b('0x10')](_0xe43b('0xa'),_0x3b6f27,_0xe43b('0xb'));_0xdb125d(_0x49e99f[_0xe43b('0x11')][_0xe43b('0xf')]);}})[_0xe43b('0x12')](function(_0x19f8fb){logger[_0xe43b('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x3b6f27,_0x19f8fb);_0x38a8f9(_0x19f8fb);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e70d742..494984d 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 _0x7b2a=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x847201,_0x1fea73){var _0x3d0e46=function(_0x3fc277){while(--_0x3fc277){_0x847201['push'](_0x847201['shift']());}};_0x3d0e46(++_0x1fea73);}(_0x7b2a,0x1f1));var _0xa7b2=function(_0x361136,_0x47d120){_0x361136=_0x361136-0x0;var _0x48bea7=_0x7b2a[_0x361136];return _0x48bea7;};'use strict';var multer=require('multer');var util=require(_0xa7b2('0x0'));var path=require(_0xa7b2('0x1'));var timeout=require(_0xa7b2('0x2'));var express=require('express');var router=express[_0xa7b2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa7b2('0x4'));var controller=require(_0xa7b2('0x5'));router[_0xa7b2('0x6')]('/',auth[_0xa7b2('0x7')](),controller[_0xa7b2('0x8')]);router['get']('/:id',auth[_0xa7b2('0x7')](),controller[_0xa7b2('0x9')]);router[_0xa7b2('0xa')]('/',auth[_0xa7b2('0x7')](),controller[_0xa7b2('0xb')]);router[_0xa7b2('0xc')](_0xa7b2('0xd'),auth[_0xa7b2('0x7')](),controller[_0xa7b2('0xe')]);router[_0xa7b2('0xf')](_0xa7b2('0xd'),auth['isAuthenticated'](),controller[_0xa7b2('0x10')]);module[_0xa7b2('0x11')]=router; \ No newline at end of file +var _0x957b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x957b,0x1ee));var _0xb957=function(_0x3ed70a,_0x18c849){_0x3ed70a=_0x3ed70a-0x0;var _0x2add57=_0x957b[_0x3ed70a];return _0x2add57;};'use strict';var multer=require(_0xb957('0x0'));var util=require(_0xb957('0x1'));var path=require(_0xb957('0x2'));var timeout=require(_0xb957('0x3'));var express=require(_0xb957('0x4'));var router=express[_0xb957('0x5')]();var fs_extra=require(_0xb957('0x6'));var auth=require(_0xb957('0x7'));var interaction=require(_0xb957('0x8'));var config=require(_0xb957('0x9'));var controller=require('./cmContactHasItem.controller');router[_0xb957('0xa')]('/',auth[_0xb957('0xb')](),controller['index']);router[_0xb957('0xa')](_0xb957('0xc'),auth[_0xb957('0xb')](),controller['show']);router[_0xb957('0xd')]('/',auth['isAuthenticated'](),controller[_0xb957('0xe')]);router[_0xb957('0xf')](_0xb957('0xc'),auth[_0xb957('0xb')](),controller[_0xb957('0x10')]);router[_0xb957('0x11')](_0xb957('0xc'),auth['isAuthenticated'](),controller[_0xb957('0x12')]);module[_0xb957('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c687ccb..be65c72 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 _0x61c3=['voice','sequelize','lodash','getDataValue','alias','STRING','setDataValue','select','parse','values','stringify','BOOLEAN','ENUM'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x61c3,0x112));var _0x361c=function(_0xf864fd,_0x242065){_0xf864fd=_0xf864fd-0x0;var _0x380a50=_0x61c3[_0xf864fd];return _0x380a50;};'use strict';var Sequelize=require(_0x361c('0x0'));var _=require(_0x361c('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x137ef5){return this[_0x361c('0x2')](_0x361c('0x3'));}},'alias':{'type':Sequelize[_0x361c('0x4')],'allowNull':![],'set':function(_0x13a6dd){this[_0x361c('0x5')](_0x361c('0x3'),_0x13a6dd?_0x13a6dd:this[_0x361c('0x2')]('name'));}},'type':{'type':Sequelize[_0x361c('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x361c('0x2')]('type')===_0x361c('0x6')){return JSON[_0x361c('0x7')](this['getDataValue']('values'));}else{return this[_0x361c('0x2')]('values');}},'set':function(_0x222833){if(Array['isArray'](_0x222833)){this[_0x361c('0x5')](_0x361c('0x8'),JSON[_0x361c('0x9')](_0x222833));}else{this[_0x361c('0x5')](_0x361c('0x8'),_0x222833);}}},'required':{'type':Sequelize[_0x361c('0xa')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x361c('0xa')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x361c('0xb')](_0x361c('0xc'))}}; \ No newline at end of file +var _0x884e=['select','values','setDataValue','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','name','long','type'];(function(_0x1e73ef,_0x22a67a){var _0x34eb2a=function(_0x567bd1){while(--_0x567bd1){_0x1e73ef['push'](_0x1e73ef['shift']());}};_0x34eb2a(++_0x22a67a);}(_0x884e,0x1e6));var _0xe884=function(_0x29d57f,_0x69ef7){_0x29d57f=_0x29d57f-0x0;var _0x3ef3b1=_0x884e[_0x29d57f];return _0x3ef3b1;};'use strict';var Sequelize=require(_0xe884('0x0'));var _=require(_0xe884('0x1'));module[_0xe884('0x2')]={'name':{'type':Sequelize[_0xe884('0x3')],'get':function(_0x140d52){return this[_0xe884('0x4')]('alias');}},'alias':{'type':Sequelize[_0xe884('0x5')],'allowNull':![],'set':function(_0x32e4b7){this['setDataValue']('alias',_0x32e4b7?_0x32e4b7:this[_0xe884('0x4')](_0xe884('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xe884('0x7')),'get':function(){if(this['getDataValue'](_0xe884('0x8'))===_0xe884('0x9')){return JSON['parse'](this[_0xe884('0x4')]('values'));}else{return this[_0xe884('0x4')](_0xe884('0xa'));}},'set':function(_0x29786e){if(Array['isArray'](_0x29786e)){this[_0xe884('0xb')]('values',JSON[_0xe884('0xc')](_0x29786e));}else{this['setDataValue'](_0xe884('0xa'),_0x29786e);}}},'required':{'type':Sequelize[_0xe884('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe884('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xe884('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a39b681..0e668d5 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 _0xf69d=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','body','create','sequelize','transaction','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xf69d,0xa1));var _0xdf69=function(_0x2dc558,_0x1287b3){_0x2dc558=_0x2dc558-0x0;var _0x38dafd=_0xf69d[_0x2dc558];return _0x38dafd;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require('moment');var BPromise=require(_0xdf69('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdf69('0x6'));var csv=require('to-csv');var ejs=require(_0xdf69('0x7'));var fs=require('fs');var fs_extra=require(_0xdf69('0x8'));var _=require(_0xdf69('0x9'));var squel=require(_0xdf69('0xa'));var crypto=require(_0xdf69('0xb'));var jsforce=require(_0xdf69('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdf69('0xd'));var querystring=require('querystring');var Papa=require(_0xdf69('0xe'));var Redis=require(_0xdf69('0xf'));var authService=require(_0xdf69('0x10'));var qs=require(_0xdf69('0x11'));var as=require(_0xdf69('0x12'));var hardwareService=require(_0xdf69('0x13'));var logger=require(_0xdf69('0x14'))(_0xdf69('0x15'));var utils=require(_0xdf69('0x16'));var config=require(_0xdf69('0x17'));var licenseUtil=require(_0xdf69('0x18'));var db=require(_0xdf69('0x19'))['db'];function respondWithStatusCode(_0x65c98a,_0x4dd906){_0x4dd906=_0x4dd906||0xcc;return function(_0x33bf3c){if(_0x33bf3c){return _0x65c98a[_0xdf69('0x1a')](_0x4dd906);}return _0x65c98a[_0xdf69('0x1b')](_0x4dd906)['end']();};}function respondWithResult(_0x188ca1,_0xc1ca07){_0xc1ca07=_0xc1ca07||0xc8;return function(_0x3332e2){if(_0x3332e2){return _0x188ca1[_0xdf69('0x1b')](_0xc1ca07)['json'](_0x3332e2);}};}function respondWithFilteredResult(_0x2fca74,_0x39c472){return function(_0x2eb6a5){if(_0x2eb6a5){var _0x5338b4=typeof _0x39c472[_0xdf69('0x1c')]===_0xdf69('0x1d')&&typeof _0x39c472[_0xdf69('0x1e')]===_0xdf69('0x1d');var _0x4a0713=_0x2eb6a5[_0xdf69('0x1f')];var _0x3abee8=_0x5338b4?0x0:_0x39c472[_0xdf69('0x1c')];var _0x5b95da=_0x5338b4?_0x2eb6a5[_0xdf69('0x1f')]:_0x39c472[_0xdf69('0x1c')]+_0x39c472[_0xdf69('0x1e')];var _0x48f3f9;if(_0x5b95da>=_0x4a0713){_0x5b95da=_0x4a0713;_0x48f3f9=0xc8;}else{_0x48f3f9=0xce;}_0x2fca74['status'](_0x48f3f9);return _0x2fca74[_0xdf69('0x20')](_0xdf69('0x21'),_0x3abee8+'-'+_0x5b95da+'/'+_0x4a0713)[_0xdf69('0x22')](_0x2eb6a5);}return null;};}function patchUpdates(_0x493045){return function(_0x494248){try{jsonpatch[_0xdf69('0x23')](_0x494248,_0x493045,!![]);}catch(_0x189a00){return BPromise[_0xdf69('0x24')](_0x189a00);}return _0x494248[_0xdf69('0x25')]();};}function saveUpdates(_0x57539f,_0x403a0a){return function(_0x4e5078){if(_0x4e5078){return _0x4e5078[_0xdf69('0x26')](_0x57539f)[_0xdf69('0x27')](function(_0x636068){return _0x636068;});}return null;};}function removeEntity(_0x4e06fc,_0x3c0e56){return function(_0x5abf90){if(_0x5abf90){return _0x5abf90[_0xdf69('0x28')]()[_0xdf69('0x27')](function(){_0x4e06fc[_0xdf69('0x1b')](0xcc)[_0xdf69('0x29')]();});}};}function handleEntityNotFound(_0x2982f1,_0x50752f){return function(_0x11f240){if(!_0x11f240){_0x2982f1['sendStatus'](0x194);}return _0x11f240;};}function handleError(_0x24b5d8,_0x8dc7e4){_0x8dc7e4=_0x8dc7e4||0x1f4;return function(_0x1dc118){logger[_0xdf69('0x2a')](_0x1dc118[_0xdf69('0x2b')]);if(_0x1dc118[_0xdf69('0x2c')]){delete _0x1dc118['name'];}_0x24b5d8[_0xdf69('0x1b')](_0x8dc7e4)[_0xdf69('0x2d')](_0x1dc118);};}exports[_0xdf69('0x2e')]=function(_0x3dcb7d,_0x3e7566){var _0xeb081b={},_0x1a1f6e={},_0x2e7fe0={'count':0x0,'rows':[]};var _0x3507ef=_[_0xdf69('0x2f')](db[_0xdf69('0x30')][_0xdf69('0x31')],function(_0x25045f){return{'name':_0x25045f[_0xdf69('0x32')],'type':_0x25045f[_0xdf69('0x33')]['key']};});_0x1a1f6e[_0xdf69('0x34')]=_['differenceBy'](_[_0xdf69('0x2f')](_0x3507ef,_0xdf69('0x2c')),[_0xdf69('0x2c')]);_0x1a1f6e[_0xdf69('0x35')]=_['keys'](_0x3dcb7d[_0xdf69('0x35')]);_0x1a1f6e[_0xdf69('0x36')]=_[_0xdf69('0x37')](_0x1a1f6e[_0xdf69('0x34')],_0x1a1f6e[_0xdf69('0x35')]);_0xeb081b[_0xdf69('0x38')]=_[_0xdf69('0x37')](_0x1a1f6e[_0xdf69('0x34')],qs[_0xdf69('0x39')](_0x3dcb7d[_0xdf69('0x35')]['fields']));_0xeb081b[_0xdf69('0x38')]=_0xeb081b[_0xdf69('0x38')][_0xdf69('0x3a')]?_0xeb081b['attributes']:_0x1a1f6e['model'];if(!_0x3dcb7d['query'][_0xdf69('0x3b')]('nolimit')){_0xeb081b[_0xdf69('0x1e')]=qs[_0xdf69('0x1e')](_0x3dcb7d['query'][_0xdf69('0x1e')]);_0xeb081b['offset']=qs[_0xdf69('0x1c')](_0x3dcb7d[_0xdf69('0x35')][_0xdf69('0x1c')]);}_0xeb081b[_0xdf69('0x3c')]=qs[_0xdf69('0x3d')](_0x3dcb7d[_0xdf69('0x35')]['sort']);_0xeb081b[_0xdf69('0x3e')]=qs[_0xdf69('0x36')](_[_0xdf69('0x3f')](_0x3dcb7d[_0xdf69('0x35')],_0x1a1f6e['filters']),_0x3507ef);if(_0x3dcb7d[_0xdf69('0x35')]['filter']){_0xeb081b[_0xdf69('0x3e')]=_[_0xdf69('0x40')](_0xeb081b['where'],{'$or':_[_0xdf69('0x2f')](_0x3507ef,function(_0x5c39e2){if(_0x5c39e2[_0xdf69('0x33')]!==_0xdf69('0x41')){var _0x173a2b={};_0x173a2b[_0x5c39e2[_0xdf69('0x2c')]]={'$like':'%'+_0x3dcb7d[_0xdf69('0x35')][_0xdf69('0x42')]+'%'};return _0x173a2b;}})});}_0xeb081b=_[_0xdf69('0x40')]({},_0xeb081b,_0x3dcb7d[_0xdf69('0x43')]);var _0x238afd={'where':_0xeb081b['where']};return db[_0xdf69('0x30')]['count'](_0x238afd)[_0xdf69('0x27')](function(_0x3df83c){_0x2e7fe0[_0xdf69('0x1f')]=_0x3df83c;if(_0x3dcb7d[_0xdf69('0x35')][_0xdf69('0x44')]){_0xeb081b[_0xdf69('0x45')]=[{'all':!![]}];}return db['CmCustomField'][_0xdf69('0x46')](_0xeb081b);})[_0xdf69('0x27')](function(_0x5d2ed4){_0x2e7fe0[_0xdf69('0x47')]=_0x5d2ed4;return _0x2e7fe0;})['then'](respondWithFilteredResult(_0x3e7566,_0xeb081b))['catch'](handleError(_0x3e7566,null));};exports[_0xdf69('0x48')]=function(_0x2d36b9,_0xfca0d0){var _0xf214e4={'raw':!![],'where':{'id':_0x2d36b9[_0xdf69('0x49')]['id']}},_0x24782b={};_0x24782b['model']=_['keys'](db[_0xdf69('0x30')][_0xdf69('0x31')]);_0x24782b['query']=_['keys'](_0x2d36b9[_0xdf69('0x35')]);_0x24782b[_0xdf69('0x36')]=_[_0xdf69('0x37')](_0x24782b[_0xdf69('0x34')],_0x24782b[_0xdf69('0x35')]);_0xf214e4['attributes']=_['intersection'](_0x24782b['model'],qs['fields'](_0x2d36b9[_0xdf69('0x35')][_0xdf69('0x39')]));_0xf214e4['attributes']=_0xf214e4[_0xdf69('0x38')]['length']?_0xf214e4['attributes']:_0x24782b[_0xdf69('0x34')];if(_0x2d36b9[_0xdf69('0x35')][_0xdf69('0x44')]){_0xf214e4['include']=[{'all':!![]}];}_0xf214e4=_[_0xdf69('0x40')]({},_0xf214e4,_0x2d36b9[_0xdf69('0x43')]);return db[_0xdf69('0x30')][_0xdf69('0x4a')](_0xf214e4)[_0xdf69('0x27')](handleEntityNotFound(_0xfca0d0,null))[_0xdf69('0x27')](respondWithResult(_0xfca0d0,null))[_0xdf69('0x4b')](handleError(_0xfca0d0,null));};exports[_0xdf69('0x26')]=function(_0x555154,_0x4ff5b2){if(_0x555154['body']['id']){delete _0x555154['body']['id'];}return db[_0xdf69('0x30')]['find']({'where':{'id':_0x555154[_0xdf69('0x49')]['id']}})[_0xdf69('0x27')](handleEntityNotFound(_0x4ff5b2,null))[_0xdf69('0x27')](saveUpdates(_0x555154[_0xdf69('0x4c')],null))[_0xdf69('0x27')](respondWithResult(_0x4ff5b2,null))[_0xdf69('0x4b')](handleError(_0x4ff5b2,null));};exports[_0xdf69('0x28')]=function(_0x3c067b,_0x48eb3a){return db[_0xdf69('0x30')][_0xdf69('0x4a')]({'where':{'id':_0x3c067b[_0xdf69('0x49')]['id']}})[_0xdf69('0x27')](handleEntityNotFound(_0x48eb3a,null))['then'](removeEntity(_0x48eb3a,null))[_0xdf69('0x4b')](handleError(_0x48eb3a,null));};exports[_0xdf69('0x4d')]=function(_0xb825d2,_0x32b6b5){var _0x4ad3a0;return db[_0xdf69('0x4e')][_0xdf69('0x4f')](function(_0x44460e){return db['CmCustomField'][_0xdf69('0x4d')](_0xb825d2['body'],{'transaction':_0x44460e})[_0xdf69('0x27')](function(_0x169afe){_0x4ad3a0=_0x169afe;var _0xda741d={'type':db['Sequelize'][_0xdf69('0x50')],'transaction':_0x44460e};switch(_0xb825d2[_0xdf69('0x4c')][_0xdf69('0x33')]){case _0xdf69('0x51'):_0xda741d['type']=db[_0xdf69('0x52')][_0xdf69('0x50')];break;case'number':_0xda741d[_0xdf69('0x33')]=db['Sequelize'][_0xdf69('0x53')];break;case _0xdf69('0x54'):_0xda741d['type']=db[_0xdf69('0x52')][_0xdf69('0x55')];_0xda741d['defaultValue']=![];break;default:}return db['sequelize'][_0xdf69('0x56')][_0xdf69('0x57')](_0xdf69('0x58'),util[_0xdf69('0x59')](_0xdf69('0x5a'),_0x4ad3a0['id']),_0xda741d);})[_0xdf69('0x27')](function(){return _0x4ad3a0;});})[_0xdf69('0x27')](respondWithResult(_0x32b6b5,0xc9))[_0xdf69('0x4b')](handleError(_0x32b6b5,null));}; \ No newline at end of file +var _0x75bd=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','options','include','findAll','rows','catch','show','params','keys','includeAll','merge','find','body','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x75bd,0x161));var _0xd75b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75bd[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd75b('0x0'));var zipdir=require(_0xd75b('0x1'));var jsonpatch=require(_0xd75b('0x2'));var rp=require(_0xd75b('0x3'));var moment=require(_0xd75b('0x4'));var BPromise=require(_0xd75b('0x5'));var Mustache=require(_0xd75b('0x6'));var util=require(_0xd75b('0x7'));var path=require(_0xd75b('0x8'));var sox=require(_0xd75b('0x9'));var csv=require(_0xd75b('0xa'));var ejs=require(_0xd75b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd75b('0xc'));var squel=require(_0xd75b('0xd'));var crypto=require(_0xd75b('0xe'));var jsforce=require(_0xd75b('0xf'));var deskjs=require(_0xd75b('0x10'));var toCsv=require(_0xd75b('0xa'));var querystring=require(_0xd75b('0x11'));var Papa=require(_0xd75b('0x12'));var Redis=require(_0xd75b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd75b('0x14'));var as=require(_0xd75b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd75b('0x16'))(_0xd75b('0x17'));var utils=require(_0xd75b('0x18'));var config=require(_0xd75b('0x19'));var licenseUtil=require(_0xd75b('0x1a'));var db=require(_0xd75b('0x1b'))['db'];function respondWithStatusCode(_0xf0ddb0,_0x4ce12c){_0x4ce12c=_0x4ce12c||0xcc;return function(_0x1e97d3){if(_0x1e97d3){return _0xf0ddb0[_0xd75b('0x1c')](_0x4ce12c);}return _0xf0ddb0[_0xd75b('0x1d')](_0x4ce12c)['end']();};}function respondWithResult(_0x5c4b60,_0x51540a){_0x51540a=_0x51540a||0xc8;return function(_0x34b5ae){if(_0x34b5ae){return _0x5c4b60[_0xd75b('0x1d')](_0x51540a)[_0xd75b('0x1e')](_0x34b5ae);}};}function respondWithFilteredResult(_0x29de5a,_0x51512d){return function(_0x1e99ec){if(_0x1e99ec){var _0x2c4ca3=typeof _0x51512d['offset']===_0xd75b('0x1f')&&typeof _0x51512d[_0xd75b('0x20')]==='undefined';var _0x4bdd05=_0x1e99ec[_0xd75b('0x21')];var _0x4fee55=_0x2c4ca3?0x0:_0x51512d[_0xd75b('0x22')];var _0x4fb561=_0x2c4ca3?_0x1e99ec[_0xd75b('0x21')]:_0x51512d[_0xd75b('0x22')]+_0x51512d['limit'];var _0x1cd891;if(_0x4fb561>=_0x4bdd05){_0x4fb561=_0x4bdd05;_0x1cd891=0xc8;}else{_0x1cd891=0xce;}_0x29de5a['status'](_0x1cd891);return _0x29de5a['set'](_0xd75b('0x23'),_0x4fee55+'-'+_0x4fb561+'/'+_0x4bdd05)['json'](_0x1e99ec);}return null;};}function patchUpdates(_0x904038){return function(_0x41143a){try{jsonpatch[_0xd75b('0x24')](_0x41143a,_0x904038,!![]);}catch(_0x3b53a9){return BPromise[_0xd75b('0x25')](_0x3b53a9);}return _0x41143a[_0xd75b('0x26')]();};}function saveUpdates(_0x163923,_0x3209be){return function(_0x10df30){if(_0x10df30){return _0x10df30[_0xd75b('0x27')](_0x163923)[_0xd75b('0x28')](function(_0x4f121e){return _0x4f121e;});}return null;};}function removeEntity(_0x2ede3d,_0x434450){return function(_0x17a204){if(_0x17a204){return _0x17a204[_0xd75b('0x29')]()[_0xd75b('0x28')](function(){_0x2ede3d[_0xd75b('0x1d')](0xcc)[_0xd75b('0x2a')]();});}};}function handleEntityNotFound(_0x3054df,_0x4d9e8d){return function(_0x5e7939){if(!_0x5e7939){_0x3054df['sendStatus'](0x194);}return _0x5e7939;};}function handleError(_0xd6a559,_0x312145){_0x312145=_0x312145||0x1f4;return function(_0x3d8940){logger[_0xd75b('0x2b')](_0x3d8940[_0xd75b('0x2c')]);if(_0x3d8940[_0xd75b('0x2d')]){delete _0x3d8940[_0xd75b('0x2d')];}_0xd6a559[_0xd75b('0x1d')](_0x312145)[_0xd75b('0x2e')](_0x3d8940);};}exports[_0xd75b('0x2f')]=function(_0x5ebfcf,_0x31ed34){var _0xaf9a04={},_0x56e417={},_0x7c2ae7={'count':0x0,'rows':[]};var _0x5e5fa3=_['map'](db[_0xd75b('0x30')][_0xd75b('0x31')],function(_0x35636a){return{'name':_0x35636a[_0xd75b('0x32')],'type':_0x35636a[_0xd75b('0x33')][_0xd75b('0x34')]};});_0x56e417[_0xd75b('0x35')]=_[_0xd75b('0x36')](_[_0xd75b('0x37')](_0x5e5fa3,_0xd75b('0x2d')),[_0xd75b('0x2d')]);_0x56e417[_0xd75b('0x38')]=_['keys'](_0x5ebfcf[_0xd75b('0x38')]);_0x56e417['filters']=_[_0xd75b('0x39')](_0x56e417['model'],_0x56e417[_0xd75b('0x38')]);_0xaf9a04[_0xd75b('0x3a')]=_[_0xd75b('0x39')](_0x56e417[_0xd75b('0x35')],qs[_0xd75b('0x3b')](_0x5ebfcf[_0xd75b('0x38')][_0xd75b('0x3b')]));_0xaf9a04[_0xd75b('0x3a')]=_0xaf9a04['attributes'][_0xd75b('0x3c')]?_0xaf9a04[_0xd75b('0x3a')]:_0x56e417[_0xd75b('0x35')];if(!_0x5ebfcf[_0xd75b('0x38')]['hasOwnProperty'](_0xd75b('0x3d'))){_0xaf9a04[_0xd75b('0x20')]=qs['limit'](_0x5ebfcf[_0xd75b('0x38')][_0xd75b('0x20')]);_0xaf9a04[_0xd75b('0x22')]=qs['offset'](_0x5ebfcf[_0xd75b('0x38')][_0xd75b('0x22')]);}_0xaf9a04[_0xd75b('0x3e')]=qs[_0xd75b('0x3f')](_0x5ebfcf[_0xd75b('0x38')]['sort']);_0xaf9a04[_0xd75b('0x40')]=qs[_0xd75b('0x41')](_[_0xd75b('0x42')](_0x5ebfcf[_0xd75b('0x38')],_0x56e417[_0xd75b('0x41')]),_0x5e5fa3);if(_0x5ebfcf[_0xd75b('0x38')]['filter']){_0xaf9a04[_0xd75b('0x40')]=_['merge'](_0xaf9a04[_0xd75b('0x40')],{'$or':_[_0xd75b('0x37')](_0x5e5fa3,function(_0x5a1d35){if(_0x5a1d35['type']!=='VIRTUAL'){var _0x14efc5={};_0x14efc5[_0x5a1d35['name']]={'$like':'%'+_0x5ebfcf[_0xd75b('0x38')]['filter']+'%'};return _0x14efc5;}})});}_0xaf9a04=_['merge']({},_0xaf9a04,_0x5ebfcf[_0xd75b('0x43')]);var _0x1f81b1={'where':_0xaf9a04[_0xd75b('0x40')]};return db[_0xd75b('0x30')][_0xd75b('0x21')](_0x1f81b1)[_0xd75b('0x28')](function(_0x18d53e){_0x7c2ae7[_0xd75b('0x21')]=_0x18d53e;if(_0x5ebfcf['query']['includeAll']){_0xaf9a04[_0xd75b('0x44')]=[{'all':!![]}];}return db['CmCustomField'][_0xd75b('0x45')](_0xaf9a04);})[_0xd75b('0x28')](function(_0x55c57f){_0x7c2ae7[_0xd75b('0x46')]=_0x55c57f;return _0x7c2ae7;})[_0xd75b('0x28')](respondWithFilteredResult(_0x31ed34,_0xaf9a04))[_0xd75b('0x47')](handleError(_0x31ed34,null));};exports[_0xd75b('0x48')]=function(_0x4cd6f6,_0x42feb4){var _0x51494b={'raw':!![],'where':{'id':_0x4cd6f6[_0xd75b('0x49')]['id']}},_0x7cfb33={};_0x7cfb33['model']=_['keys'](db[_0xd75b('0x30')][_0xd75b('0x31')]);_0x7cfb33[_0xd75b('0x38')]=_[_0xd75b('0x4a')](_0x4cd6f6[_0xd75b('0x38')]);_0x7cfb33['filters']=_[_0xd75b('0x39')](_0x7cfb33['model'],_0x7cfb33[_0xd75b('0x38')]);_0x51494b[_0xd75b('0x3a')]=_[_0xd75b('0x39')](_0x7cfb33['model'],qs[_0xd75b('0x3b')](_0x4cd6f6['query']['fields']));_0x51494b[_0xd75b('0x3a')]=_0x51494b[_0xd75b('0x3a')]['length']?_0x51494b['attributes']:_0x7cfb33['model'];if(_0x4cd6f6[_0xd75b('0x38')][_0xd75b('0x4b')]){_0x51494b[_0xd75b('0x44')]=[{'all':!![]}];}_0x51494b=_[_0xd75b('0x4c')]({},_0x51494b,_0x4cd6f6['options']);return db[_0xd75b('0x30')][_0xd75b('0x4d')](_0x51494b)[_0xd75b('0x28')](handleEntityNotFound(_0x42feb4,null))[_0xd75b('0x28')](respondWithResult(_0x42feb4,null))[_0xd75b('0x47')](handleError(_0x42feb4,null));};exports[_0xd75b('0x27')]=function(_0x16b291,_0x1b897f){if(_0x16b291['body']['id']){delete _0x16b291[_0xd75b('0x4e')]['id'];}return db[_0xd75b('0x30')][_0xd75b('0x4d')]({'where':{'id':_0x16b291[_0xd75b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b897f,null))['then'](saveUpdates(_0x16b291[_0xd75b('0x4e')],null))['then'](respondWithResult(_0x1b897f,null))[_0xd75b('0x47')](handleError(_0x1b897f,null));};exports['destroy']=function(_0x5395e9,_0x2cf1f3){return db['CmCustomField']['find']({'where':{'id':_0x5395e9[_0xd75b('0x49')]['id']}})[_0xd75b('0x28')](handleEntityNotFound(_0x2cf1f3,null))[_0xd75b('0x28')](removeEntity(_0x2cf1f3,null))[_0xd75b('0x47')](handleError(_0x2cf1f3,null));};exports[_0xd75b('0x4f')]=function(_0x471246,_0x200c51){var _0x45e8ef;return db[_0xd75b('0x50')][_0xd75b('0x51')](function(_0x22c985){return db[_0xd75b('0x30')]['create'](_0x471246['body'],{'transaction':_0x22c985})[_0xd75b('0x28')](function(_0x4ae6e1){_0x45e8ef=_0x4ae6e1;var _0x3b8547={'type':db[_0xd75b('0x52')]['TEXT'],'transaction':_0x22c985};switch(_0x471246[_0xd75b('0x4e')][_0xd75b('0x33')]){case _0xd75b('0x53'):_0x3b8547['type']=db[_0xd75b('0x52')][_0xd75b('0x54')];break;case'number':_0x3b8547[_0xd75b('0x33')]=db[_0xd75b('0x52')][_0xd75b('0x55')];break;case _0xd75b('0x56'):_0x3b8547[_0xd75b('0x33')]=db[_0xd75b('0x52')][_0xd75b('0x57')];_0x3b8547[_0xd75b('0x58')]=![];break;default:}return db[_0xd75b('0x50')][_0xd75b('0x59')][_0xd75b('0x5a')]('cm_contacts',util[_0xd75b('0x5b')](_0xd75b('0x5c'),_0x45e8ef['id']),_0x3b8547);})[_0xd75b('0x28')](function(){return _0x45e8ef;});})['then'](respondWithResult(_0x200c51,0xc9))[_0xd75b('0x47')](handleError(_0x200c51,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 48b09f2..46ea320 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 _0x78e5=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x78e5,0x1b7));var _0x578e=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x78e5[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x578e('0x0'));var util=require(_0x578e('0x1'));var logger=require(_0x578e('0x2'))('api');var moment=require(_0x578e('0x3'));var BPromise=require('bluebird');var rp=require(_0x578e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x578e('0x5'));var config=require(_0x578e('0x6'));var attributes=require(_0x578e('0x7'));module[_0x578e('0x8')]=function(_0x3fcc74,_0xad66b7){return _0x3fcc74[_0x578e('0x9')]('CmCustomField',attributes,{'tableName':_0x578e('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x742b=['rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x742b,0x145));var _0xb742=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x742b[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb742('0x0'));var util=require(_0xb742('0x1'));var logger=require(_0xb742('0x2'))(_0xb742('0x3'));var moment=require('moment');var BPromise=require(_0xb742('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb742('0x5'));var config=require('../../config/environment');var attributes=require(_0xb742('0x6'));module[_0xb742('0x7')]=function(_0x579e86,_0x1df028){return _0x579e86[_0xb742('0x8')](_0xb742('0x9'),attributes,{'tableName':_0xb742('0xa'),'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 54f2d59..9c2fe90 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 _0xc027=['info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4c8c3e,_0x30b159){var _0x5ad239=function(_0x272a6d){while(--_0x272a6d){_0x4c8c3e['push'](_0x4c8c3e['shift']());}};_0x5ad239(++_0x30b159);}(_0xc027,0x17f));var _0x7c02=function(_0x4392af,_0xec5afe){_0x4392af=_0x4392af-0x0;var _0x9fa8eb=_0xc027[_0x4392af];return _0x9fa8eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c02('0x0'));var BPromise=require('bluebird');var rs=require(_0x7c02('0x1'));var fs=require('fs');var Redis=require(_0x7c02('0x2'));var db=require(_0x7c02('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c02('0x4'))(_0x7c02('0x5'));var config=require(_0x7c02('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7c02('0x7')][_0x7c02('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x442e16,_0x3202d7,_0x19628e){return new BPromise(function(_0x188d87,_0x168041){return client[_0x7c02('0x9')](_0x442e16,_0x19628e)['then'](function(_0x31e101){logger['info'](_0x7c02('0xa'),_0x3202d7,_0x7c02('0xb'));logger['debug'](_0x7c02('0xc'),_0x3202d7,_0x7c02('0xb'),JSON['stringify'](_0x31e101));if(_0x31e101[_0x7c02('0xd')]){if(_0x31e101['error'][_0x7c02('0xe')]===0x1f4){logger['error'](_0x7c02('0xa'),_0x3202d7,_0x31e101['error'][_0x7c02('0xf')]);return _0x168041(_0x31e101[_0x7c02('0xd')][_0x7c02('0xf')]);}logger['error'](_0x7c02('0xa'),_0x3202d7,_0x31e101[_0x7c02('0xd')][_0x7c02('0xf')]);return _0x188d87(_0x31e101['error'][_0x7c02('0xf')]);}else{logger[_0x7c02('0x10')](_0x7c02('0xa'),_0x3202d7,_0x7c02('0xb'));_0x188d87(_0x31e101[_0x7c02('0x11')][_0x7c02('0xf')]);}})[_0x7c02('0x12')](function(_0x21eb62){logger[_0x7c02('0xd')](_0x7c02('0xa'),_0x3202d7,_0x21eb62);_0x168041(_0x21eb62);});});} \ No newline at end of file +var _0x4cd1=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4cd1,0x176));var _0x14cd=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4cd1[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x14cd('0x0'));var rs=require(_0x14cd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14cd('0x2'))['db'];var utils=require(_0x14cd('0x3'));var logger=require(_0x14cd('0x4'))(_0x14cd('0x5'));var config=require(_0x14cd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x14cd('0x7')][_0x14cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fcbe7,_0x4a7f9b,_0x33f34a){return new BPromise(function(_0x567e1f,_0x262768){return client[_0x14cd('0x9')](_0x3fcbe7,_0x33f34a)[_0x14cd('0xa')](function(_0x194fa6){logger[_0x14cd('0xb')]('CmCustomField,\x20%s,\x20%s',_0x4a7f9b,_0x14cd('0xc'));logger[_0x14cd('0xd')](_0x14cd('0xe'),_0x4a7f9b,_0x14cd('0xc'),JSON[_0x14cd('0xf')](_0x194fa6));if(_0x194fa6[_0x14cd('0x10')]){if(_0x194fa6[_0x14cd('0x10')]['code']===0x1f4){logger['error'](_0x14cd('0x11'),_0x4a7f9b,_0x194fa6[_0x14cd('0x10')][_0x14cd('0x12')]);return _0x262768(_0x194fa6[_0x14cd('0x10')]['message']);}logger[_0x14cd('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4a7f9b,_0x194fa6['error']['message']);return _0x567e1f(_0x194fa6[_0x14cd('0x10')][_0x14cd('0x12')]);}else{logger[_0x14cd('0xb')](_0x14cd('0x11'),_0x4a7f9b,_0x14cd('0xc'));_0x567e1f(_0x194fa6[_0x14cd('0x13')]['message']);}})[_0x14cd('0x14')](function(_0x3388e8){logger[_0x14cd('0x10')](_0x14cd('0x11'),_0x4a7f9b,_0x3388e8);_0x262768(_0x3388e8);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 77d4487..6c813ab 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 _0x9009=['get','/:id','show','post','isAuthenticated','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x9009,0x1d4));var _0x9900=function(_0x1ce1f1,_0x88e352){_0x1ce1f1=_0x1ce1f1-0x0;var _0x4f4b36=_0x9009[_0x1ce1f1];return _0x4f4b36;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0xb')]('/',auth[_0x9900('0xc')](),controller[_0x9900('0xd')]);router['put'](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')](_0x9900('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9900('0x10')]=router; \ No newline at end of file +var _0xacea=['path','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util'];(function(_0x2d32a3,_0x13cc58){var _0x391131=function(_0x4c3a64){while(--_0x4c3a64){_0x2d32a3['push'](_0x2d32a3['shift']());}};_0x391131(++_0x13cc58);}(_0xacea,0x1d2));var _0xaace=function(_0x5e2799,_0x18fe1c){_0x5e2799=_0x5e2799-0x0;var _0x3cd939=_0xacea[_0x5e2799];return _0x3cd939;};'use strict';var multer=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var path=require(_0xaace('0x2'));var timeout=require('connect-timeout');var express=require(_0xaace('0x3'));var router=express[_0xaace('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaace('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaace('0x6'));var controller=require(_0xaace('0x7'));router[_0xaace('0x8')]('/',auth[_0xaace('0x9')](),controller[_0xaace('0xa')]);router[_0xaace('0x8')](_0xaace('0xb'),auth[_0xaace('0x9')](),controller[_0xaace('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaace('0xd')]);router['put']('/:id',auth[_0xaace('0x9')](),controller[_0xaace('0xe')]);router[_0xaace('0xf')](_0xaace('0xb'),auth['isAuthenticated'](),controller[_0xaace('0x10')]);module[_0xaace('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b5d54ca..28c13dd 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 _0x46d2=['INTEGER','DATE','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x33f1f1,_0x3f2a10){var _0x3052d4=function(_0x2d62ad){while(--_0x2d62ad){_0x33f1f1['push'](_0x33f1f1['shift']());}};_0x3052d4(++_0x3f2a10);}(_0x46d2,0x10c));var _0x246d=function(_0x14f245,_0x1caf72){_0x14f245=_0x14f245-0x0;var _0x582918=_0x46d2[_0x14f245];return _0x582918;};'use strict';var moment=require('moment');var Sequelize=require(_0x246d('0x0'));module['exports']={'phone':{'type':Sequelize[_0x246d('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x246d('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x246d('0x3'))},'countbusyretry':{'type':Sequelize[_0x246d('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x246d('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x246d('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x246d('0x5')]},'priority':{'type':Sequelize[_0x246d('0x4')](0x2)[_0x246d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x246d('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x246d('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x246d('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x246d('0x4')],'unique':_0x246d('0x7')},'CampaignId':{'type':Sequelize[_0x246d('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x246d('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x246d('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x246d('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x246d('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x246d('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xab9a=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','exports','STRING','BOOLEAN','DATE','format'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xab9a,0x148));var _0xaab9=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xab9a[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xaab9('0x0')]={'phone':{'type':Sequelize[_0xaab9('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xaab9('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xaab9('0x3')],'defaultValue':moment()[_0xaab9('0x4')](_0xaab9('0x5'))},'countbusyretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xaab9('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xaab9('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xaab9('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xaab9('0x8')},'ListId':{'type':Sequelize[_0xaab9('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xaab9('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xaab9('0x6')],'unique':_0xaab9('0x8')},'CampaignId':{'type':Sequelize[_0xaab9('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xaab9('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xaab9('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xaab9('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0xaab9('0x3')],'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 0c54c97..8f0fe16 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 _0x1b20=['$ne','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$any','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','then','rows','show','params','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','ivr','CmContact','firstName','isNil','lastName','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','keys','outbound','preview','dialOrderByScheduledAt','transaction','dialPreviewAutoRecallMe','direction','prev','priority','scheduledAt','DESC','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','hopperIds','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','LOCK','UPDATE','Contact','CmCompany','Company','VoiceQueue','Queue','dialActive','recallme','CmList','List','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','utcOffset','getTimezone','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','status','json','offset','limit','count','Content-Range','update','sendStatus','error','stack','send','map','CmHopper','rawAttributes','fieldName','key','name','query','filters','intersection','model','concat','$or','$gt','$gte','$lt','$lte'];(function(_0xea9764,_0x423219){var _0x55e267=function(_0x137847){while(--_0x137847){_0xea9764['push'](_0xea9764['shift']());}};_0x55e267(++_0x423219);}(_0x1b20,0x66));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require('moment');var _=require(_0x01b2('0x0'));var qs=require(_0x01b2('0x1'));var logger=require('../../config/logger')('api');var shared=require(_0x01b2('0x2'));var db=require(_0x01b2('0x3'))['db'];function respondWithResult(_0x2d6e99,_0x1150fc){_0x1150fc=_0x1150fc||0xc8;return function(_0x1cf757){if(_0x1cf757){return _0x2d6e99[_0x01b2('0x4')](_0x1150fc)[_0x01b2('0x5')](_0x1cf757);}};}function respondWithFilteredResult(_0x28de4a,_0x46e745){return function(_0xa64ad1){if(_0xa64ad1){var _0x43d561=typeof _0x46e745[_0x01b2('0x6')]==='undefined'&&typeof _0x46e745[_0x01b2('0x7')]==='undefined';var _0x2e975d=_0xa64ad1[_0x01b2('0x8')];var _0x3bad99=_0x43d561?0x0:_0x46e745[_0x01b2('0x6')];var _0x9c411f=_0x43d561?_0xa64ad1[_0x01b2('0x8')]:_0x46e745[_0x01b2('0x6')]+_0x46e745[_0x01b2('0x7')];var _0x55804c;if(_0x9c411f>=_0x2e975d){_0x9c411f=_0x2e975d;_0x55804c=0xc8;}else{_0x55804c=0xce;}_0x28de4a[_0x01b2('0x4')](_0x55804c);return _0x28de4a['set'](_0x01b2('0x9'),_0x3bad99+'-'+_0x9c411f+'/'+_0x2e975d)['json'](_0xa64ad1);}return null;};}function saveUpdates(_0x41a618,_0x8ac569){return function(_0x2c6d4d){if(_0x2c6d4d){return _0x2c6d4d[_0x01b2('0xa')](_0x41a618)['then'](function(_0x2f97d1){return _0x2f97d1;});}return null;};}function handleEntityNotFound(_0x2e7b31,_0x4f1c15){return function(_0x1626ba){if(!_0x1626ba){_0x2e7b31[_0x01b2('0xb')](0x194);}return _0x1626ba;};}function handleError(_0x5a36de,_0x299d0c){_0x299d0c=_0x299d0c||0x1f4;return function(_0x3d5833){logger[_0x01b2('0xc')](_0x3d5833[_0x01b2('0xd')]);if(_0x3d5833['name']){delete _0x3d5833['name'];}_0x5a36de[_0x01b2('0x4')](_0x299d0c)[_0x01b2('0xe')](_0x3d5833);};}exports['index']=function(_0x1eafc4,_0x444236){var _0x27a0bc={},_0x5986f5={},_0x25c55f={'count':0x0,'rows':[]};var _0x9f182b=_[_0x01b2('0xf')](db[_0x01b2('0x10')][_0x01b2('0x11')],function(_0x56ea3c){return{'name':_0x56ea3c[_0x01b2('0x12')],'type':_0x56ea3c['type'][_0x01b2('0x13')]};});_0x5986f5['model']=_[_0x01b2('0xf')](_0x9f182b,_0x01b2('0x14'));_0x5986f5[_0x01b2('0x15')]=_['keys'](_0x1eafc4[_0x01b2('0x15')]);_0x5986f5[_0x01b2('0x16')]=_[_0x01b2('0x17')](_0x5986f5[_0x01b2('0x18')],_0x5986f5[_0x01b2('0x15')]);_0x5986f5['filters']=_[_0x01b2('0x19')](_0x5986f5['filters'],['$and',_0x01b2('0x1a'),_0x01b2('0x1b'),_0x01b2('0x1c'),_0x01b2('0x1d'),_0x01b2('0x1e'),_0x01b2('0x1f'),'$eq',_0x01b2('0x20'),_0x01b2('0x21'),_0x01b2('0x22'),_0x01b2('0x23'),'$notIn',_0x01b2('0x24'),'$notLike',_0x01b2('0x25'),_0x01b2('0x26'),'$like',_0x01b2('0x27'),'$contains','$contained',_0x01b2('0x28')]);_0x27a0bc[_0x01b2('0x29')]=_['intersection'](_0x5986f5[_0x01b2('0x18')],qs[_0x01b2('0x2a')](_0x1eafc4[_0x01b2('0x15')][_0x01b2('0x2a')]));_0x27a0bc[_0x01b2('0x29')]=_0x27a0bc[_0x01b2('0x29')][_0x01b2('0x2b')]?_0x27a0bc[_0x01b2('0x29')]:_0x5986f5[_0x01b2('0x18')];if(!_0x1eafc4[_0x01b2('0x15')][_0x01b2('0x2c')]('nolimit')){_0x27a0bc[_0x01b2('0x7')]=qs[_0x01b2('0x7')](_0x1eafc4[_0x01b2('0x15')][_0x01b2('0x7')]);_0x27a0bc[_0x01b2('0x6')]=qs[_0x01b2('0x6')](_0x1eafc4['query']['offset']);}_0x27a0bc[_0x01b2('0x2d')]=qs['sort'](_0x1eafc4['query'][_0x01b2('0x2e')]);_0x27a0bc[_0x01b2('0x2f')]=qs[_0x01b2('0x16')](_[_0x01b2('0x30')](_0x1eafc4['query'],_0x5986f5[_0x01b2('0x16')]),_0x9f182b);if(_0x1eafc4['query'][_0x01b2('0x31')]){_0x27a0bc['where']=_['merge'](_0x27a0bc['where'],{'$or':_[_0x01b2('0xf')](_0x9f182b,function(_0x29532e){if(_0x29532e[_0x01b2('0x32')]!==_0x01b2('0x33')){var _0x4d80d0={};_0x4d80d0[_0x29532e[_0x01b2('0x14')]]={'$like':'%'+_0x1eafc4[_0x01b2('0x15')]['filter']+'%'};return _0x4d80d0;}})});}_0x27a0bc=_[_0x01b2('0x34')]({},_0x27a0bc,_0x1eafc4[_0x01b2('0x35')]);var _0x13dbb4={'where':_0x27a0bc[_0x01b2('0x2f')]};return db[_0x01b2('0x10')][_0x01b2('0x8')](_0x13dbb4)['then'](function(_0x2fb530){_0x25c55f[_0x01b2('0x8')]=_0x2fb530;if(_0x1eafc4['query']['includeAll']){_0x27a0bc[_0x01b2('0x36')]=[{'all':!![]}];}return db[_0x01b2('0x10')][_0x01b2('0x37')](_0x27a0bc);})[_0x01b2('0x38')](function(_0x34fdb2){_0x25c55f[_0x01b2('0x39')]=_0x34fdb2;return _0x25c55f;})['then'](respondWithFilteredResult(_0x444236,_0x27a0bc))['catch'](handleError(_0x444236,null));};exports[_0x01b2('0x3a')]=function(_0x4ba89b,_0xbd7259){var _0x31878={'raw':!![],'where':{'id':_0x4ba89b[_0x01b2('0x3b')]['id']}},_0x1a1e3b={};_0x1a1e3b[_0x01b2('0x18')]=_['keys'](db[_0x01b2('0x10')][_0x01b2('0x11')]);_0x1a1e3b[_0x01b2('0x15')]=_['keys'](_0x4ba89b[_0x01b2('0x15')]);_0x1a1e3b[_0x01b2('0x16')]=_[_0x01b2('0x17')](_0x1a1e3b['model'],_0x1a1e3b[_0x01b2('0x15')]);_0x31878['attributes']=_[_0x01b2('0x17')](_0x1a1e3b[_0x01b2('0x18')],qs['fields'](_0x4ba89b[_0x01b2('0x15')][_0x01b2('0x2a')]));_0x31878['attributes']=_0x31878[_0x01b2('0x29')][_0x01b2('0x2b')]?_0x31878[_0x01b2('0x29')]:_0x1a1e3b[_0x01b2('0x18')];if(_0x4ba89b[_0x01b2('0x15')]['includeAll']){_0x31878[_0x01b2('0x36')]=[{'all':!![]}];}_0x31878=_[_0x01b2('0x34')]({},_0x31878,_0x4ba89b[_0x01b2('0x35')]);return db['CmHopper'][_0x01b2('0x3c')](_0x31878)[_0x01b2('0x38')](handleEntityNotFound(_0xbd7259,null))[_0x01b2('0x38')](respondWithResult(_0xbd7259,null))[_0x01b2('0x3d')](handleError(_0xbd7259,null));};exports[_0x01b2('0x3e')]=function(_0x3f9451,_0x3eda44){return db[_0x01b2('0x10')]['create'](_0x3f9451[_0x01b2('0x3f')],{})[_0x01b2('0x38')](respondWithResult(_0x3eda44,0xc9))[_0x01b2('0x3d')](handleError(_0x3eda44,null));};exports[_0x01b2('0xa')]=function(_0xf36d42,_0x3469b3){if(_0xf36d42[_0x01b2('0x3f')]['id']){delete _0xf36d42['body']['id'];}return db[_0x01b2('0x10')][_0x01b2('0x3c')]({'where':{'id':_0xf36d42[_0x01b2('0x3b')]['id']}})[_0x01b2('0x38')](handleEntityNotFound(_0x3469b3,null))['then'](saveUpdates(_0xf36d42['body'],null))[_0x01b2('0x38')](respondWithResult(_0x3469b3,null))[_0x01b2('0x3d')](handleError(_0x3469b3,null));};exports[_0x01b2('0x40')]=function(_0x49370d,_0x7a6cae){return db[_0x01b2('0x10')][_0x01b2('0x40')]()[_0x01b2('0x38')](respondWithResult(_0x7a6cae,null))[_0x01b2('0x3d')](handleError(_0x7a6cae,null));};exports[_0x01b2('0x41')]=function(_0x5b54c5,_0x2a8b8d){var _0x5e0e70;var _0x272d0d=_0x5b54c5['params']['id'];return db['CmHopper'][_0x01b2('0x3c')]({'where':{'id':_0x5b54c5[_0x01b2('0x3b')]['id']}})[_0x01b2('0x38')](handleEntityNotFound(_0x2a8b8d,null))[_0x01b2('0x38')](function(_0x20cc59){if(_0x20cc59){return _0x20cc59['destroy']()['then'](function(_0x387954){return _0x387954;});}})[_0x01b2('0x38')](function(_0x3ee05b){_0x5e0e70=_0x3ee05b;if(_0x3ee05b){if(_0x3ee05b[_0x01b2('0x42')]||_0x3ee05b[_0x01b2('0x43')]){return db[_0x3ee05b[_0x01b2('0x42')]?'VoiceQueue':_0x01b2('0x44')][_0x01b2('0x3c')]({'where':{'id':_0x3ee05b[_0x01b2('0x42')]?_0x3ee05b[_0x01b2('0x42')]:_0x3ee05b[_0x01b2('0x43')]},'attributes':['id',_0x01b2('0x14')],'raw':!![]});}}})[_0x01b2('0x38')](function(_0x5dcafc){var _0x445fb2={};if(_0x5dcafc){_[_0x01b2('0x34')](_0x445fb2,_[_0x01b2('0x45')](_0x5e0e70[_0x01b2('0x46')],[_0x01b2('0x47'),_0x01b2('0x48'),'id']));_0x445fb2['state']=0x15;_0x445fb2[_0x01b2('0x49')]=_0x01b2('0x4a');_0x445fb2[_0x01b2('0x4b')]=_0x5dcafc[_0x01b2('0x14')];_0x445fb2[_0x01b2('0x4c')]=_0x5b54c5[_0x01b2('0x4d')][_0x01b2('0x14')];_0x445fb2[_0x01b2('0x4e')]=_0x5b54c5[_0x01b2('0x4d')]['id'];_0x445fb2[_0x01b2('0x4a')]=!![];_0x445fb2[_0x01b2('0x4f')]=moment()[_0x01b2('0x50')](_0x01b2('0x51'));_0x445fb2[_0x01b2('0x52')]=_0x5e0e70['phone'];_0x445fb2['campaigntype']=_0x5e0e70['VoiceQueueId']?'queue':_0x01b2('0x53');return db[_0x01b2('0x54')][_0x01b2('0x3c')]({'where':{'id':_0x445fb2['ContactId']},'attributes':[_0x01b2('0x55'),'lastName']})[_0x01b2('0x38')](function(_0x32371b){if(!_[_0x01b2('0x56')](_0x2a8b8d)&&!_[_0x01b2('0x56')](_0x32371b[_0x01b2('0x55')])){_0x445fb2['calleridname']=_0x32371b[_0x01b2('0x55')];if(!_['isNil'](_0x32371b[_0x01b2('0x57')])){_0x445fb2[_0x01b2('0x58')]+='\x20'+_0x32371b['lastName'];}}})[_0x01b2('0x59')](function(){return db['CmHopperFinal'][_0x01b2('0x3e')](_0x445fb2);});}})[_0x01b2('0x38')](function(_0x42c5b8){return db[_0x01b2('0x5a')][_0x01b2('0x41')]({'where':{'CmHopperId':_0x272d0d}});})[_0x01b2('0x38')](function(){return _0x2a8b8d[_0x01b2('0x4')](0xcc)[_0x01b2('0x5b')]();})[_0x01b2('0x3d')](handleError(_0x2a8b8d,null));};exports[_0x01b2('0x5c')]=function(_0x5d7da3,_0x2eb448){var _0x5655b6=[];return db[_0x01b2('0x54')][_0x01b2('0x40')]()[_0x01b2('0x38')](function(_0x58c8de){_0x5655b6=_[_0x01b2('0x5d')](_0x58c8de);return _0x5d7da3['user']['getVoiceQueues']({'where':{'type':_0x01b2('0x5e'),'dialActive':!![],'dialMethod':_0x01b2('0x5f')},'attributes':['id',_0x01b2('0x60'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x01b2('0x38')](function(_0x330cb4){if(_0x330cb4&&_0x330cb4[_0x01b2('0x2b')]){return db['sequelize'][_0x01b2('0x61')](function(_0x429b89){var _0xcbef9c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x01b2('0x50')](_0x01b2('0x51'))},'VoiceQueueId':{'$in':_[_0x01b2('0xf')](_0x330cb4,'id')},'$or':[{'UserId':null},{'UserId':_0x5d7da3[_0x01b2('0x4d')]['id']}]};var _0x56c794={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x330cb4)['filter']([_0x01b2('0x62'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x5d7da3[_0x01b2('0x4d')]['id']}]};var _0x4ca277={'$or':[_0xcbef9c,_0x56c794]};var _0xbe104b=[];if(_0x5d7da3['body'][_0x01b2('0x63')]&&_0x5d7da3[_0x01b2('0x3f')][_0x01b2('0x63')]===_0x01b2('0x64')){if(!_['isEmpty'](_0x5d7da3[_0x01b2('0x3f')]['hopperIds'])){_0x4ca277['id']={'$in':_0x5d7da3[_0x01b2('0x3f')]['hopperIds']};}_0xbe104b=[[_0x01b2('0x65'),'ASC'],[_0x01b2('0x66'),_0x330cb4[0x0][_0x01b2('0x60')]==='ASC'?_0x01b2('0x67'):_0x01b2('0x68')],db[_0x01b2('0x69')][_0x01b2('0x6a')](_0x01b2('0x6b')),['id',_0x01b2('0x67')]];}else{if(!_[_0x01b2('0x6c')](_0x5d7da3[_0x01b2('0x3f')][_0x01b2('0x6d')])){_0x4ca277['id']={'$notIn':_0x5d7da3[_0x01b2('0x3f')][_0x01b2('0x6d')]};}_0xbe104b=[[_0x01b2('0x65'),_0x01b2('0x67')],['scheduledAt',_0x330cb4[0x0]['dialOrderByScheduledAt']],db[_0x01b2('0x69')][_0x01b2('0x6a')](_0x01b2('0x6e')),['id',_0x01b2('0x68')]];}return db[_0x01b2('0x10')][_0x01b2('0x6f')]({'attributes':['id',_0x01b2('0x70'),_0x01b2('0x71'),'recallme'],'where':_0x4ca277,'order':_0xbe104b,'transaction':_0x429b89,'lock':_0x429b89[_0x01b2('0x72')][_0x01b2('0x73')],'include':[{'model':db[_0x01b2('0x54')],'as':_0x01b2('0x74'),'attributes':_0x5655b6,'include':[{'model':db[_0x01b2('0x75')],'as':_0x01b2('0x76'),'attributes':['id',_0x01b2('0x14')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x01b2('0x14')]},{'model':db[_0x01b2('0x77')],'as':_0x01b2('0x78'),'attributes':['id','name',_0x01b2('0x79')]}]})[_0x01b2('0x38')](function(_0x240558){if(_0x240558){return _0x240558['update']({'UserId':_0x5d7da3[_0x01b2('0x4d')]['id']},{'transaction':_0x429b89});}});});}})[_0x01b2('0x38')](handleEntityNotFound(_0x2eb448,null))[_0x01b2('0x38')](respondWithResult(_0x2eb448,null))['catch'](handleError(_0x2eb448,null));};exports['getPreviewRecall']=function(_0x2a820d,_0x4f1d6a,_0x1e1155){var _0x10d19f=[];var _0x2f41b6=_0x2a820d[_0x01b2('0x3b')]['id'];var _0x19a417=_0x2a820d[_0x01b2('0x4d')]['id'];return db['CmContact'][_0x01b2('0x40')]()[_0x01b2('0x38')](function(_0x45caa2){_0x10d19f=_[_0x01b2('0x5d')](_0x45caa2);return db[_0x01b2('0x69')][_0x01b2('0x61')](function(_0x5038b2){const _0x12f5ed={'id':_0x2f41b6};return db[_0x01b2('0x10')][_0x01b2('0x6f')]({'attributes':['id',_0x01b2('0x70'),_0x01b2('0x7a')],'where':_0x12f5ed,'transaction':_0x5038b2,'lock':_0x5038b2[_0x01b2('0x72')]['UPDATE'],'include':[{'model':db[_0x01b2('0x54')],'as':'Contact','attributes':_0x10d19f,'include':[{'model':db[_0x01b2('0x75')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x01b2('0x7b')],'as':_0x01b2('0x7c'),'attributes':['id','name']},{'model':db[_0x01b2('0x77')],'as':_0x01b2('0x78'),'attributes':['id',_0x01b2('0x14'),_0x01b2('0x79')]}]})['then'](function(_0x4095c2){if(_0x4095c2){return _0x4095c2[_0x01b2('0xa')]({'UserId':_0x19a417},{'transaction':_0x5038b2});}});});})[_0x01b2('0x38')](handleEntityNotFound(_0x4f1d6a,null))[_0x01b2('0x38')](respondWithResult(_0x4f1d6a,null))[_0x01b2('0x3d')](handleError(_0x4f1d6a,null));};exports[_0x01b2('0x7d')]=function(_0x27de72,_0x44034b){return _0x27de72[_0x01b2('0x4d')][_0x01b2('0x7e')]({'where':{'type':_0x01b2('0x5e'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x01b2('0x38')](function(_0x3e17c3){if(_0x3e17c3&&_0x3e17c3[_0x01b2('0x2b')]){return db[_0x01b2('0x10')][_0x01b2('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x01b2('0x50')](_0x01b2('0x51'))},'VoiceQueueId':{'$in':_[_0x01b2('0xf')](_0x3e17c3,'id')},'$or':[{'UserId':null},{'UserId':_0x27de72['user']['id']}]}});}return 0x0;})['then'](function(_0xd37088){if(!_[_0x01b2('0x56')](_0xd37088)&&_[_0x01b2('0x7f')](_0xd37088)){return _0x44034b[_0x01b2('0x4')](0xc8)[_0x01b2('0x5')]({'contacts':_0xd37088});}else{logger[_0x01b2('0xc')](_0x01b2('0x80'),_0x01b2('0x7d'),0x194,'entity\x20not\x20found');_0x44034b[_0x01b2('0xb')](0x194);}})[_0x01b2('0x3d')](handleError(_0x44034b,null));};exports[_0x01b2('0x81')]=function(_0x54ccc5,_0x24f9d4){var _0x2dec32=shared[_0x01b2('0x82')];var _0x35aef9=[];_['map'](_0x2dec32,function(_0x5b8abf){_0x35aef9['push']({'id':_0x5b8abf[_0x01b2('0x14')],'name':_0x5b8abf['name'],'utcOffset':_0x5b8abf[_0x01b2('0x83')]});});return _0x24f9d4[_0x01b2('0x4')](0xc8)[_0x01b2('0x5')]({'tz':_0x35aef9});};exports[_0x01b2('0x84')]=function(_0x176ef,_0x372585){var _0x46e1ef=shared[_0x01b2('0x82')];var _0x3fb15f={};if(!_[_0x01b2('0x56')](_0x46e1ef[_0x176ef['body']['id']]))_0x3fb15f=_0x46e1ef[_0x176ef[_0x01b2('0x3f')]['id']];return _0x372585[_0x01b2('0x4')](0xc8)[_0x01b2('0x5')](_0x3fb15f);}; \ No newline at end of file +var _0x0faf=['sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','CmContact','CmCompany','CmList','List','dialActive','getPreviewRecall','scheduledat','recallme','UPDATE','Contact','Company','getOpenContacts','preview','json','CmHopper,\x20%s,\x20%s,\x20%s','timezones','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','intersection','concat','$and','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$iLike','$notILike','$like','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0faf,0x132));var _0xf0fa=function(_0x47888a,_0x7d2f3a){_0x47888a=_0x47888a-0x0;var _0x2b15a4=_0x0faf[_0x47888a];return _0x2b15a4;};'use strict';var moment=require(_0xf0fa('0x0'));var _=require('lodash');var qs=require(_0xf0fa('0x1'));var logger=require(_0xf0fa('0x2'))(_0xf0fa('0x3'));var shared=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];function respondWithResult(_0xdc9ce3,_0x515b12){_0x515b12=_0x515b12||0xc8;return function(_0xc83253){if(_0xc83253){return _0xdc9ce3[_0xf0fa('0x6')](_0x515b12)['json'](_0xc83253);}};}function respondWithFilteredResult(_0x3637a3,_0x44ffa0){return function(_0x25b5c4){if(_0x25b5c4){var _0x3a703b=typeof _0x44ffa0[_0xf0fa('0x7')]==='undefined'&&typeof _0x44ffa0[_0xf0fa('0x8')]===_0xf0fa('0x9');var _0x481a42=_0x25b5c4['count'];var _0x3bda51=_0x3a703b?0x0:_0x44ffa0[_0xf0fa('0x7')];var _0x25dfec=_0x3a703b?_0x25b5c4[_0xf0fa('0xa')]:_0x44ffa0[_0xf0fa('0x7')]+_0x44ffa0[_0xf0fa('0x8')];var _0x379ff6;if(_0x25dfec>=_0x481a42){_0x25dfec=_0x481a42;_0x379ff6=0xc8;}else{_0x379ff6=0xce;}_0x3637a3[_0xf0fa('0x6')](_0x379ff6);return _0x3637a3['set'](_0xf0fa('0xb'),_0x3bda51+'-'+_0x25dfec+'/'+_0x481a42)['json'](_0x25b5c4);}return null;};}function saveUpdates(_0x2f46ff,_0x521034){return function(_0x39ae2b){if(_0x39ae2b){return _0x39ae2b[_0xf0fa('0xc')](_0x2f46ff)[_0xf0fa('0xd')](function(_0x547952){return _0x547952;});}return null;};}function handleEntityNotFound(_0x5821ae,_0x42591b){return function(_0x540a04){if(!_0x540a04){_0x5821ae[_0xf0fa('0xe')](0x194);}return _0x540a04;};}function handleError(_0x81fc49,_0x10ce43){_0x10ce43=_0x10ce43||0x1f4;return function(_0x3203ce){logger[_0xf0fa('0xf')](_0x3203ce[_0xf0fa('0x10')]);if(_0x3203ce[_0xf0fa('0x11')]){delete _0x3203ce[_0xf0fa('0x11')];}_0x81fc49['status'](_0x10ce43)[_0xf0fa('0x12')](_0x3203ce);};}exports[_0xf0fa('0x13')]=function(_0x30ce17,_0x1d3c22){var _0x2bdf82={},_0x386e5f={},_0x5ba2eb={'count':0x0,'rows':[]};var _0x56ef81=_[_0xf0fa('0x14')](db[_0xf0fa('0x15')][_0xf0fa('0x16')],function(_0x2385e2){return{'name':_0x2385e2[_0xf0fa('0x17')],'type':_0x2385e2[_0xf0fa('0x18')][_0xf0fa('0x19')]};});_0x386e5f[_0xf0fa('0x1a')]=_[_0xf0fa('0x14')](_0x56ef81,_0xf0fa('0x11'));_0x386e5f[_0xf0fa('0x1b')]=_['keys'](_0x30ce17[_0xf0fa('0x1b')]);_0x386e5f[_0xf0fa('0x1c')]=_[_0xf0fa('0x1d')](_0x386e5f[_0xf0fa('0x1a')],_0x386e5f[_0xf0fa('0x1b')]);_0x386e5f[_0xf0fa('0x1c')]=_[_0xf0fa('0x1e')](_0x386e5f[_0xf0fa('0x1c')],[_0xf0fa('0x1f'),'$or',_0xf0fa('0x20'),_0xf0fa('0x21'),'$lt',_0xf0fa('0x22'),_0xf0fa('0x23'),_0xf0fa('0x24'),'$not',_0xf0fa('0x25'),_0xf0fa('0x26'),_0xf0fa('0x27'),_0xf0fa('0x28'),'$like','$notLike',_0xf0fa('0x29'),_0xf0fa('0x2a'),_0xf0fa('0x2b'),_0xf0fa('0x2c'),'$contains',_0xf0fa('0x2d'),_0xf0fa('0x2e')]);_0x2bdf82[_0xf0fa('0x2f')]=_['intersection'](_0x386e5f[_0xf0fa('0x1a')],qs['fields'](_0x30ce17[_0xf0fa('0x1b')][_0xf0fa('0x30')]));_0x2bdf82[_0xf0fa('0x2f')]=_0x2bdf82['attributes'][_0xf0fa('0x31')]?_0x2bdf82[_0xf0fa('0x2f')]:_0x386e5f[_0xf0fa('0x1a')];if(!_0x30ce17[_0xf0fa('0x1b')][_0xf0fa('0x32')](_0xf0fa('0x33'))){_0x2bdf82['limit']=qs['limit'](_0x30ce17[_0xf0fa('0x1b')][_0xf0fa('0x8')]);_0x2bdf82['offset']=qs[_0xf0fa('0x7')](_0x30ce17['query']['offset']);}_0x2bdf82['order']=qs[_0xf0fa('0x34')](_0x30ce17['query'][_0xf0fa('0x34')]);_0x2bdf82[_0xf0fa('0x35')]=qs[_0xf0fa('0x1c')](_[_0xf0fa('0x36')](_0x30ce17[_0xf0fa('0x1b')],_0x386e5f[_0xf0fa('0x1c')]),_0x56ef81);if(_0x30ce17[_0xf0fa('0x1b')][_0xf0fa('0x37')]){_0x2bdf82['where']=_[_0xf0fa('0x38')](_0x2bdf82[_0xf0fa('0x35')],{'$or':_[_0xf0fa('0x14')](_0x56ef81,function(_0x5c59a6){if(_0x5c59a6[_0xf0fa('0x18')]!==_0xf0fa('0x39')){var _0x19b137={};_0x19b137[_0x5c59a6[_0xf0fa('0x11')]]={'$like':'%'+_0x30ce17['query']['filter']+'%'};return _0x19b137;}})});}_0x2bdf82=_[_0xf0fa('0x38')]({},_0x2bdf82,_0x30ce17[_0xf0fa('0x3a')]);var _0x2a6560={'where':_0x2bdf82[_0xf0fa('0x35')]};return db[_0xf0fa('0x15')]['count'](_0x2a6560)['then'](function(_0x5a2be0){_0x5ba2eb['count']=_0x5a2be0;if(_0x30ce17[_0xf0fa('0x1b')][_0xf0fa('0x3b')]){_0x2bdf82['include']=[{'all':!![]}];}return db['CmHopper'][_0xf0fa('0x3c')](_0x2bdf82);})[_0xf0fa('0xd')](function(_0x28068c){_0x5ba2eb[_0xf0fa('0x3d')]=_0x28068c;return _0x5ba2eb;})[_0xf0fa('0xd')](respondWithFilteredResult(_0x1d3c22,_0x2bdf82))[_0xf0fa('0x3e')](handleError(_0x1d3c22,null));};exports[_0xf0fa('0x3f')]=function(_0x4f5664,_0x53f408){var _0x344bb0={'raw':!![],'where':{'id':_0x4f5664[_0xf0fa('0x40')]['id']}},_0x1d4830={};_0x1d4830[_0xf0fa('0x1a')]=_[_0xf0fa('0x41')](db[_0xf0fa('0x15')]['rawAttributes']);_0x1d4830[_0xf0fa('0x1b')]=_['keys'](_0x4f5664[_0xf0fa('0x1b')]);_0x1d4830[_0xf0fa('0x1c')]=_[_0xf0fa('0x1d')](_0x1d4830[_0xf0fa('0x1a')],_0x1d4830[_0xf0fa('0x1b')]);_0x344bb0[_0xf0fa('0x2f')]=_[_0xf0fa('0x1d')](_0x1d4830[_0xf0fa('0x1a')],qs[_0xf0fa('0x30')](_0x4f5664['query']['fields']));_0x344bb0['attributes']=_0x344bb0[_0xf0fa('0x2f')][_0xf0fa('0x31')]?_0x344bb0['attributes']:_0x1d4830[_0xf0fa('0x1a')];if(_0x4f5664[_0xf0fa('0x1b')][_0xf0fa('0x3b')]){_0x344bb0[_0xf0fa('0x42')]=[{'all':!![]}];}_0x344bb0=_['merge']({},_0x344bb0,_0x4f5664[_0xf0fa('0x3a')]);return db[_0xf0fa('0x15')][_0xf0fa('0x43')](_0x344bb0)[_0xf0fa('0xd')](handleEntityNotFound(_0x53f408,null))[_0xf0fa('0xd')](respondWithResult(_0x53f408,null))[_0xf0fa('0x3e')](handleError(_0x53f408,null));};exports[_0xf0fa('0x44')]=function(_0x295edd,_0x1b435f){return db['CmHopper'][_0xf0fa('0x44')](_0x295edd[_0xf0fa('0x45')],{})[_0xf0fa('0xd')](respondWithResult(_0x1b435f,0xc9))[_0xf0fa('0x3e')](handleError(_0x1b435f,null));};exports[_0xf0fa('0xc')]=function(_0x2f8c74,_0x53b2a6){if(_0x2f8c74[_0xf0fa('0x45')]['id']){delete _0x2f8c74[_0xf0fa('0x45')]['id'];}return db['CmHopper'][_0xf0fa('0x43')]({'where':{'id':_0x2f8c74[_0xf0fa('0x40')]['id']}})[_0xf0fa('0xd')](handleEntityNotFound(_0x53b2a6,null))[_0xf0fa('0xd')](saveUpdates(_0x2f8c74[_0xf0fa('0x45')],null))[_0xf0fa('0xd')](respondWithResult(_0x53b2a6,null))[_0xf0fa('0x3e')](handleError(_0x53b2a6,null));};exports[_0xf0fa('0x46')]=function(_0x35272e,_0x4cd85e){return db[_0xf0fa('0x15')]['describe']()[_0xf0fa('0xd')](respondWithResult(_0x4cd85e,null))[_0xf0fa('0x3e')](handleError(_0x4cd85e,null));};exports[_0xf0fa('0x47')]=function(_0x569ba9,_0x324765){var _0x20ea09;var _0x354f03=_0x569ba9[_0xf0fa('0x40')]['id'];return db[_0xf0fa('0x15')]['find']({'where':{'id':_0x569ba9[_0xf0fa('0x40')]['id']}})['then'](handleEntityNotFound(_0x324765,null))[_0xf0fa('0xd')](function(_0x821e40){if(_0x821e40){return _0x821e40[_0xf0fa('0x47')]()[_0xf0fa('0xd')](function(_0x8090a7){return _0x8090a7;});}})['then'](function(_0x368f0c){_0x20ea09=_0x368f0c;if(_0x368f0c){if(_0x368f0c[_0xf0fa('0x48')]||_0x368f0c[_0xf0fa('0x49')]){return db[_0x368f0c[_0xf0fa('0x48')]?_0xf0fa('0x4a'):_0xf0fa('0x4b')]['find']({'where':{'id':_0x368f0c[_0xf0fa('0x48')]?_0x368f0c['VoiceQueueId']:_0x368f0c['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xf0fa('0xd')](function(_0x31b4b0){var _0xa256ee={};if(_0x31b4b0){_[_0xf0fa('0x38')](_0xa256ee,_[_0xf0fa('0x4c')](_0x20ea09[_0xf0fa('0x4d')],[_0xf0fa('0x4e'),_0xf0fa('0x4f'),'id']));_0xa256ee[_0xf0fa('0x50')]=0x15;_0xa256ee['statedesc']=_0xf0fa('0x51');_0xa256ee['campaign']=_0x31b4b0[_0xf0fa('0x11')];_0xa256ee[_0xf0fa('0x52')]=_0x569ba9[_0xf0fa('0x53')][_0xf0fa('0x11')];_0xa256ee['UserId']=_0x569ba9[_0xf0fa('0x53')]['id'];_0xa256ee['deleted']=!![];_0xa256ee[_0xf0fa('0x54')]=moment()[_0xf0fa('0x55')](_0xf0fa('0x56'));_0xa256ee[_0xf0fa('0x57')]=_0x20ea09[_0xf0fa('0x58')];_0xa256ee[_0xf0fa('0x59')]=_0x20ea09['VoiceQueueId']?_0xf0fa('0x5a'):_0xf0fa('0x5b');return db['CmContact'][_0xf0fa('0x43')]({'where':{'id':_0xa256ee[_0xf0fa('0x5c')]},'attributes':['firstName',_0xf0fa('0x5d')]})[_0xf0fa('0xd')](function(_0x57dccd){if(!_[_0xf0fa('0x5e')](_0x324765)&&!_[_0xf0fa('0x5e')](_0x57dccd[_0xf0fa('0x5f')])){_0xa256ee['calleridname']=_0x57dccd[_0xf0fa('0x5f')];if(!_[_0xf0fa('0x5e')](_0x57dccd['lastName'])){_0xa256ee[_0xf0fa('0x60')]+='\x20'+_0x57dccd[_0xf0fa('0x5d')];}}})[_0xf0fa('0x61')](function(){return db['CmHopperFinal'][_0xf0fa('0x44')](_0xa256ee);});}})[_0xf0fa('0xd')](function(_0x5c6dde){return db[_0xf0fa('0x62')][_0xf0fa('0x47')]({'where':{'CmHopperId':_0x354f03}});})[_0xf0fa('0xd')](function(){return _0x324765[_0xf0fa('0x6')](0xcc)[_0xf0fa('0x63')]();})[_0xf0fa('0x3e')](handleError(_0x324765,null));};exports[_0xf0fa('0x64')]=function(_0x337640,_0x32c846){var _0x2c2c30=[];return db['CmContact'][_0xf0fa('0x46')]()[_0xf0fa('0xd')](function(_0x298f47){_0x2c2c30=_[_0xf0fa('0x41')](_0x298f47);return _0x337640[_0xf0fa('0x53')][_0xf0fa('0x65')]({'where':{'type':_0xf0fa('0x66'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xf0fa('0x67'),_0xf0fa('0x68')],'raw':!![]});})[_0xf0fa('0xd')](function(_0x28fdf5){if(_0x28fdf5&&_0x28fdf5[_0xf0fa('0x31')]){return db[_0xf0fa('0x69')][_0xf0fa('0x6a')](function(_0x543a2c){var _0x5638e6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf0fa('0x55')](_0xf0fa('0x56'))},'VoiceQueueId':{'$in':_[_0xf0fa('0x14')](_0x28fdf5,'id')},'$or':[{'UserId':null},{'UserId':_0x337640[_0xf0fa('0x53')]['id']}]};var _0x5bf7f2={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x28fdf5)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xf0fa('0x14')]('id')[_0xf0fa('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x337640[_0xf0fa('0x53')]['id']}]};var _0x189d30={'$or':[_0x5638e6,_0x5bf7f2]};var _0x508df9=[];if(_0x337640['body'][_0xf0fa('0x6c')]&&_0x337640['body'][_0xf0fa('0x6c')]===_0xf0fa('0x6d')){if(!_[_0xf0fa('0x6e')](_0x337640[_0xf0fa('0x45')][_0xf0fa('0x6f')])){_0x189d30['id']={'$in':_0x337640['body'][_0xf0fa('0x6f')]};}_0x508df9=[[_0xf0fa('0x70'),_0xf0fa('0x71')],[_0xf0fa('0x72'),_0x28fdf5[0x0][_0xf0fa('0x67')]===_0xf0fa('0x71')?_0xf0fa('0x73'):_0xf0fa('0x71')],db[_0xf0fa('0x69')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xf0fa('0x73')]];}else{if(!_['isEmpty'](_0x337640[_0xf0fa('0x45')]['hopperIds'])){_0x189d30['id']={'$notIn':_0x337640['body']['hopperIds']};}_0x508df9=[[_0xf0fa('0x70'),_0xf0fa('0x73')],[_0xf0fa('0x72'),_0x28fdf5[0x0][_0xf0fa('0x67')]],db[_0xf0fa('0x69')][_0xf0fa('0x74')](_0xf0fa('0x75')),['id',_0xf0fa('0x71')]];}return db[_0xf0fa('0x15')][_0xf0fa('0x76')]({'attributes':['id','scheduledat',_0xf0fa('0x58'),'recallme'],'where':_0x189d30,'order':_0x508df9,'transaction':_0x543a2c,'lock':_0x543a2c[_0xf0fa('0x77')]['UPDATE'],'include':[{'model':db[_0xf0fa('0x78')],'as':'Contact','attributes':_0x2c2c30,'include':[{'model':db[_0xf0fa('0x79')],'as':'Company','attributes':['id',_0xf0fa('0x11')]}]},{'model':db[_0xf0fa('0x7a')],'as':_0xf0fa('0x7b'),'attributes':['id',_0xf0fa('0x11')]},{'model':db[_0xf0fa('0x4a')],'as':'Queue','attributes':['id','name',_0xf0fa('0x7c')]}]})[_0xf0fa('0xd')](function(_0x5da2e6){if(_0x5da2e6){return _0x5da2e6['update']({'UserId':_0x337640[_0xf0fa('0x53')]['id']},{'transaction':_0x543a2c});}});});}})[_0xf0fa('0xd')](handleEntityNotFound(_0x32c846,null))[_0xf0fa('0xd')](respondWithResult(_0x32c846,null))[_0xf0fa('0x3e')](handleError(_0x32c846,null));};exports[_0xf0fa('0x7d')]=function(_0x56838f,_0x1a661d,_0x3bdb88){var _0x16492b=[];var _0x5ab304=_0x56838f['params']['id'];var _0x82277a=_0x56838f[_0xf0fa('0x53')]['id'];return db['CmContact']['describe']()[_0xf0fa('0xd')](function(_0x294c1a){_0x16492b=_[_0xf0fa('0x41')](_0x294c1a);return db['sequelize']['transaction'](function(_0x516eec){const _0x39711c={'id':_0x5ab304};return db['CmHopper']['findOne']({'attributes':['id',_0xf0fa('0x7e'),_0xf0fa('0x7f')],'where':_0x39711c,'transaction':_0x516eec,'lock':_0x516eec[_0xf0fa('0x77')][_0xf0fa('0x80')],'include':[{'model':db[_0xf0fa('0x78')],'as':_0xf0fa('0x81'),'attributes':_0x16492b,'include':[{'model':db['CmCompany'],'as':_0xf0fa('0x82'),'attributes':['id',_0xf0fa('0x11')]}]},{'model':db[_0xf0fa('0x7a')],'as':'List','attributes':['id',_0xf0fa('0x11')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0xf0fa('0x11'),'dialActive']}]})['then'](function(_0x1f8977){if(_0x1f8977){return _0x1f8977[_0xf0fa('0xc')]({'UserId':_0x82277a},{'transaction':_0x516eec});}});});})[_0xf0fa('0xd')](handleEntityNotFound(_0x1a661d,null))['then'](respondWithResult(_0x1a661d,null))[_0xf0fa('0x3e')](handleError(_0x1a661d,null));};exports[_0xf0fa('0x83')]=function(_0x552b9e,_0x6fc2af){return _0x552b9e[_0xf0fa('0x53')][_0xf0fa('0x65')]({'where':{'type':_0xf0fa('0x66'),'dialActive':!![],'dialMethod':_0xf0fa('0x84')},'attributes':['id'],'raw':!![]})[_0xf0fa('0xd')](function(_0x56265f){if(_0x56265f&&_0x56265f[_0xf0fa('0x31')]){return db['CmHopper'][_0xf0fa('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf0fa('0x55')](_0xf0fa('0x56'))},'VoiceQueueId':{'$in':_[_0xf0fa('0x14')](_0x56265f,'id')},'$or':[{'UserId':null},{'UserId':_0x552b9e[_0xf0fa('0x53')]['id']}]}});}return 0x0;})[_0xf0fa('0xd')](function(_0x626079){if(!_['isNil'](_0x626079)&&_['isNumber'](_0x626079)){return _0x6fc2af[_0xf0fa('0x6')](0xc8)[_0xf0fa('0x85')]({'contacts':_0x626079});}else{logger['error'](_0xf0fa('0x86'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x6fc2af[_0xf0fa('0xe')](0x194);}})[_0xf0fa('0x3e')](handleError(_0x6fc2af,null));};exports['getTimezones']=function(_0x5a2717,_0x2fe9b0){var _0x5fbd7f=shared[_0xf0fa('0x87')];var _0x21778b=[];_[_0xf0fa('0x14')](_0x5fbd7f,function(_0x52343e){_0x21778b['push']({'id':_0x52343e[_0xf0fa('0x11')],'name':_0x52343e[_0xf0fa('0x11')],'utcOffset':_0x52343e['utcOffset']});});return _0x2fe9b0[_0xf0fa('0x6')](0xc8)['json']({'tz':_0x21778b});};exports[_0xf0fa('0x88')]=function(_0x57f309,_0x4867ca){var _0x2bb0bf=shared['timezones'];var _0x51db99={};if(!_['isNil'](_0x2bb0bf[_0x57f309['body']['id']]))_0x51db99=_0x2bb0bf[_0x57f309[_0xf0fa('0x45')]['id']];return _0x4867ca['status'](0xc8)[_0xf0fa('0x85')](_0x51db99);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 5372b2c..e641314 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 _0x31f0=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone'];(function(_0x182a91,_0x246712){var _0x33d0b1=function(_0x243aa8){while(--_0x243aa8){_0x182a91['push'](_0x182a91['shift']());}};_0x33d0b1(++_0x246712);}(_0x31f0,0xb7));var _0x031f=function(_0x4196ee,_0x120c51){_0x4196ee=_0x4196ee-0x0;var _0x47a47e=_0x31f0[_0x4196ee];return _0x47a47e;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('CmHopper',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]},{'name':_0x031f('0xb'),'fields':['phone']},{'name':_0x031f('0xc'),'fields':[_0x031f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4af147,_0x133ca9){var _0x460b1a=function(_0x19f1cb){while(--_0x19f1cb){_0x4af147['push'](_0x4af147['shift']());}};_0x460b1a(++_0x133ca9);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4f46f1,_0x2a39b9){_0x4f46f1=_0x4f46f1-0x0;var _0x5e146b=_0xfdbd[_0x4f46f1];return _0x5e146b;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 9e0303b..8d80a75 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 _0x76da=['update','includes','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','MoveContactManagedDialer','CountReScheduled','sequelize','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','Agent','CmList','List','lodash','moment','bluebird','../../config/logger','CmHopper','options','where','attributes','limit','include','map','model','then','info','debug','GetCmHopper','stringify','catch','error','message','find','ShowCmHopper','CreateCmHopper','create','raw','UpdateCmHopper','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','transaction','findAll','order','LOCK','UPDATE','Contact','keys','name','voicePause','UserId'];(function(_0x4033d5,_0x748ad3){var _0x35a902=function(_0x238402){while(--_0x238402){_0x4033d5['push'](_0x4033d5['shift']());}};_0x35a902(++_0x748ad3);}(_0x76da,0x111));var _0xa76d=function(_0x1dfa0b,_0xd258d8){_0x1dfa0b=_0x1dfa0b-0x0;var _0x47914c=_0x76da[_0x1dfa0b];return _0x47914c;};'use strict';var _=require(_0xa76d('0x0'));var util=require('util');var moment=require(_0xa76d('0x1'));var BPromise=require(_0xa76d('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xa76d('0x3'))('rpc');exports['GetCmHopper']=function(_0x2bac2e){var _0x1d70fe=this;return new Promise(function(_0x15e728,_0x5363ff){return db[_0xa76d('0x4')]['findAll']({'raw':_0x2bac2e['options']?_0x2bac2e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2bac2e[_0xa76d('0x5')]?_0x2bac2e[_0xa76d('0x5')][_0xa76d('0x6')]||null:null,'attributes':_0x2bac2e[_0xa76d('0x5')]?_0x2bac2e[_0xa76d('0x5')][_0xa76d('0x7')]||null:null,'limit':_0x2bac2e[_0xa76d('0x5')]?_0x2bac2e[_0xa76d('0x5')][_0xa76d('0x8')]||null:null,'include':_0x2bac2e[_0xa76d('0x5')]?_0x2bac2e['options'][_0xa76d('0x9')]?_[_0xa76d('0xa')](_0x2bac2e[_0xa76d('0x5')][_0xa76d('0x9')],function(_0x4db276){return{'model':db[_0x4db276['model']],'as':_0x4db276['as'],'attributes':_0x4db276[_0xa76d('0x7')],'include':_0x4db276['include']?_[_0xa76d('0xa')](_0x4db276[_0xa76d('0x9')],function(_0x1e00f4){return{'model':db[_0x1e00f4[_0xa76d('0xb')]],'as':_0x1e00f4['as'],'attributes':_0x1e00f4[_0xa76d('0x7')],'include':_0x1e00f4[_0xa76d('0x9')]?_[_0xa76d('0xa')](_0x1e00f4[_0xa76d('0x9')],function(_0x57128b){return{'model':db[_0x57128b['model']],'as':_0x57128b['as'],'attributes':_0x57128b[_0xa76d('0x7')]};}):[]};}):[]};}):[]:[]})[_0xa76d('0xc')](function(_0x40da66){logger[_0xa76d('0xd')]('GetCmHopper',_0x2bac2e);logger[_0xa76d('0xe')](_0xa76d('0xf'),_0x2bac2e,JSON[_0xa76d('0x10')](_0x40da66));_0x15e728(_0x40da66);})[_0xa76d('0x11')](function(_0x54a9d6){logger[_0xa76d('0x12')](_0xa76d('0xf'),_0x54a9d6[_0xa76d('0x13')],_0x2bac2e);_0x5363ff(_0x1d70fe[_0xa76d('0x12')](0x1f4,_0x54a9d6[_0xa76d('0x13')]));});});};exports['ShowCmHopper']=function(_0x1259ea){var _0x5531ad=this;return new Promise(function(_0x585088,_0x25c309){return db['CmHopper'][_0xa76d('0x14')]({'raw':_0x1259ea[_0xa76d('0x5')]?_0x1259ea[_0xa76d('0x5')]['raw']===undefined?!![]:![]:!![],'where':_0x1259ea[_0xa76d('0x5')]?_0x1259ea[_0xa76d('0x5')][_0xa76d('0x6')]||null:null,'attributes':_0x1259ea[_0xa76d('0x5')]?_0x1259ea[_0xa76d('0x5')][_0xa76d('0x7')]||null:null,'include':_0x1259ea['options']?_0x1259ea[_0xa76d('0x5')][_0xa76d('0x9')]?_[_0xa76d('0xa')](_0x1259ea[_0xa76d('0x5')]['include'],function(_0x17c4c4){return{'model':db[_0x17c4c4[_0xa76d('0xb')]],'as':_0x17c4c4['as'],'attributes':_0x17c4c4['attributes'],'include':_0x17c4c4['include']?_[_0xa76d('0xa')](_0x17c4c4[_0xa76d('0x9')],function(_0x1e5aaf){return{'model':db[_0x1e5aaf[_0xa76d('0xb')]],'as':_0x1e5aaf['as'],'attributes':_0x1e5aaf['attributes'],'include':_0x1e5aaf[_0xa76d('0x9')]?_['map'](_0x1e5aaf[_0xa76d('0x9')],function(_0x143d3d){return{'model':db[_0x143d3d['model']],'as':_0x143d3d['as'],'attributes':_0x143d3d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa76d('0xc')](function(_0x57cdf5){logger[_0xa76d('0xd')](_0xa76d('0x15'),_0x1259ea);logger[_0xa76d('0xe')]('ShowCmHopper',_0x1259ea,JSON['stringify'](_0x57cdf5));_0x585088(_0x57cdf5);})['catch'](function(_0x1d473c){logger['error'](_0xa76d('0x15'),_0x1d473c[_0xa76d('0x13')],_0x1259ea);_0x25c309(_0x5531ad['error'](0x1f4,_0x1d473c[_0xa76d('0x13')]));});});};exports[_0xa76d('0x16')]=function(_0x7376c5){var _0x45eef7=this;return new Promise(function(_0x41eb91,_0x1a61d4){return db[_0xa76d('0x4')][_0xa76d('0x17')](_0x7376c5['body'],{'raw':_0x7376c5[_0xa76d('0x5')]?_0x7376c5[_0xa76d('0x5')][_0xa76d('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2c8190){logger['info'](_0xa76d('0x16'),_0x7376c5);logger[_0xa76d('0xe')]('CreateCmHopper',_0x7376c5,JSON['stringify'](_0x2c8190));_0x41eb91(_0x2c8190);})['catch'](function(_0xc6b61a){logger[_0xa76d('0x12')](_0xa76d('0x16'),_0xc6b61a[_0xa76d('0x13')],_0x7376c5);_0x1a61d4(_0x45eef7['error'](0x1f4,_0xc6b61a['message']));});});};exports[_0xa76d('0x19')]=function(_0x2c355c){var _0x2e84f0=this;return new Promise(function(_0x3f041e,_0x26eb9a){return db[_0xa76d('0x4')]['update'](_0x2c355c[_0xa76d('0x1a')],{'raw':_0x2c355c[_0xa76d('0x5')]?_0x2c355c[_0xa76d('0x5')][_0xa76d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c355c[_0xa76d('0x5')]?_0x2c355c['options']['where']||null:null,'attributes':_0x2c355c['options']?_0x2c355c['options']['attributes']||null:null,'limit':_0x2c355c[_0xa76d('0x5')]?_0x2c355c[_0xa76d('0x5')][_0xa76d('0x8')]||null:null})[_0xa76d('0xc')](function(_0x3f983e){logger[_0xa76d('0xd')](_0xa76d('0x19'),_0x2c355c);logger[_0xa76d('0xd')](_0xa76d('0x1b'),JSON[_0xa76d('0x10')](_0x2c355c[_0xa76d('0x5')][_0xa76d('0x6')]),_0x2c355c['body'][_0xa76d('0x1c')]);logger[_0xa76d('0xe')](_0xa76d('0x19'),_0x2c355c,JSON['stringify'](_0x3f983e));_0x3f041e(_0x3f983e);})[_0xa76d('0x11')](function(_0x526f71){logger[_0xa76d('0x12')]('UpdateCmHopper',_0x526f71[_0xa76d('0x13')],_0x2c355c);_0x26eb9a(_0x2e84f0[_0xa76d('0x12')](0x1f4,_0x526f71[_0xa76d('0x13')]));});});};exports[_0xa76d('0x1d')]=function(_0x3fc2c0){var _0x3a8f06=this;return new Promise(function(_0x3d274d,_0x49a3d1){return db['CmHopper'][_0xa76d('0x1e')]({'where':_0x3fc2c0[_0xa76d('0x5')]?_0x3fc2c0[_0xa76d('0x5')]['where']||null:null})[_0xa76d('0xc')](function(_0x17813c){logger['info'](_0xa76d('0x1d'),_0x3fc2c0);logger['debug'](_0xa76d('0x1d'),_0x3fc2c0,JSON[_0xa76d('0x10')](_0x17813c));_0x3d274d(_0x17813c);})[_0xa76d('0x11')](function(_0x4e40da){logger[_0xa76d('0x12')]('DestroyCmHopper',_0x4e40da[_0xa76d('0x13')],_0x3fc2c0);_0x49a3d1(_0x3a8f06[_0xa76d('0x12')](0x1f4,_0x4e40da[_0xa76d('0x13')]));});});};exports['GetContactDialer']=function(_0x497180){var _0x3ef2f9=this;return new Promise(function(_0x3a4cce,_0x25c631){return db[_0xa76d('0x1f')][_0xa76d('0x20')]()['then'](function(_0x3fda6d){return db['sequelize'][_0xa76d('0x21')](function(_0x4528c4){return db[_0xa76d('0x4')][_0xa76d('0x22')]({'where':_0x497180[_0xa76d('0x5')]?_0x497180[_0xa76d('0x5')][_0xa76d('0x6')]||null:null,'attributes':_0x497180[_0xa76d('0x5')]?_0x497180['options'][_0xa76d('0x7')]||null:null,'limit':_0x497180[_0xa76d('0x5')]?_0x497180[_0xa76d('0x5')]['limit']||null:null,'order':_0x497180['options']?_0x497180[_0xa76d('0x5')][_0xa76d('0x23')]||null:null,'transaction':_0x4528c4,'lock':_0x4528c4[_0xa76d('0x24')][_0xa76d('0x25')],'include':[{'model':db[_0xa76d('0x1f')],'as':_0xa76d('0x26'),'attributes':_[_0xa76d('0x27')](_0x3fda6d)},{'model':db['User'],'as':'Agent','attributes':['id',_0xa76d('0x28'),_0xa76d('0x29')]}]})['then'](function(_0x11daa8){var _0x557651=[];var _0x36704f=[];for(var _0x2aaf53=0x0;_0x2aaf53<_0x11daa8['length'];_0x2aaf53+=0x1){var _0x34bb22=_0x11daa8[_0x2aaf53][_0xa76d('0x2a')];if(_0x34bb22===null){_0x557651['push'](_0x11daa8[_0x2aaf53][_0xa76d('0x2b')](_0x497180[_0xa76d('0x1a')],{'transaction':_0x4528c4}));}else if(!_0x36704f[_0xa76d('0x2c')](_0x34bb22)){_0x36704f[_0xa76d('0x2d')](_0x34bb22);_0x557651['push'](_0x11daa8[_0x2aaf53]['update'](_0x497180[_0xa76d('0x1a')],{'transaction':_0x4528c4}));}}return BPromise[_0xa76d('0x2e')](_0x557651);});})[_0xa76d('0xc')](function(_0xc4b6ed){logger[_0xa76d('0xd')]('GetContactDialer',_0x497180);if(_0xc4b6ed[_0xa76d('0x2f')]>0x0){logger[_0xa76d('0xd')](_0xa76d('0x30'),_0xc4b6ed[0x0][_0xa76d('0x31')]['id'],_0xc4b6ed[0x0]['dataValues'][_0xa76d('0x32')],_0xc4b6ed[0x0][_0xa76d('0x31')][_0xa76d('0x1c')]);}logger[_0xa76d('0xe')]('GetContactDialer',_0x497180,JSON[_0xa76d('0x10')](_0xc4b6ed));_0x3a4cce(_0xc4b6ed);})[_0xa76d('0x11')](function(_0xae347e){logger[_0xa76d('0x12')](_0xa76d('0x33'),_0xae347e['message'],_0x497180);_0x25c631(_0x3ef2f9[_0xa76d('0x12')](0x1f4,_0xae347e[_0xa76d('0x13')]));});});});};exports[_0xa76d('0x34')]=function(_0xef3dad){var _0x56c7a4=this;return new Promise(function(_0x568e14,_0x4524df){return db['sequelize'][_0xa76d('0x21')](function(_0x542e45){return db['CmHopperFinal']['create'](_0xef3dad[_0xa76d('0x1a')],{'raw':_0xef3dad[_0xa76d('0x5')]?_0xef3dad[_0xa76d('0x5')][_0xa76d('0x18')]===undefined?!![]:![]:!![],'transaction':_0x542e45})[_0xa76d('0xc')](function(){logger[_0xa76d('0xd')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa76d('0x10')](_0xef3dad['options']['where']),_0xef3dad[_0xa76d('0x5')][_0xa76d('0x6')][_0xa76d('0x1c')]);return db[_0xa76d('0x4')]['destroy']({'where':_0xef3dad[_0xa76d('0x5')]?_0xef3dad['options'][_0xa76d('0x6')]||null:null,'transaction':_0x542e45});});})[_0xa76d('0xc')](function(_0xa36696){logger[_0xa76d('0xd')](_0xa76d('0x34'),_0xef3dad);logger['debug'](_0xa76d('0x34'),_0xef3dad,JSON[_0xa76d('0x10')](_0xa36696));_0x568e14(_0xa36696);})[_0xa76d('0x11')](function(_0x566e50){logger['error']('MoveContactManagedDialer',_0x566e50[_0xa76d('0x13')],_0xef3dad);_0x4524df(_0x56c7a4[_0xa76d('0x12')](0x1f4,_0x566e50[_0xa76d('0x13')]));});});};exports[_0xa76d('0x35')]=function(_0x11020d){var _0x16d03e=this;return new Promise(function(_0x35e605,_0x29dc11){return db[_0xa76d('0x4')][_0xa76d('0x22')]({'raw':_0x11020d[_0xa76d('0x5')]?_0x11020d[_0xa76d('0x5')]['raw']===undefined?!![]:![]:!![],'where':_0x11020d[_0xa76d('0x5')]?_0x11020d[_0xa76d('0x5')][_0xa76d('0x6')]||null:null,'attributes':[[db[_0xa76d('0x36')]['fn']('COUNT',db[_0xa76d('0x36')]['fn']('IF',db['sequelize'][_0xa76d('0x37')]('`scheduledat`\x20>=\x20'+util[_0xa76d('0x38')](_0xa76d('0x39'),moment()['format'](_0xa76d('0x3a')))+_0xa76d('0x3b')))),_0xa76d('0x3c')]]})[_0xa76d('0xc')](function(_0x180a04){logger[_0xa76d('0xd')](_0xa76d('0x35'),_0x11020d);logger[_0xa76d('0xe')](_0xa76d('0x35'),_0x11020d,JSON['stringify'](_0x180a04));_0x35e605(_0x180a04);})[_0xa76d('0x11')](function(_0xd2df8f){logger[_0xa76d('0x12')]('CountReScheduled',_0xd2df8f[_0xa76d('0x13')],_0x11020d);_0x29dc11(_0x16d03e['error'](0x1f4,_0xd2df8f[_0xa76d('0x13')]));});});};exports[_0xa76d('0x3d')]=function(_0x245235){var _0x3f502f=this;return new Promise(function(_0x1d950e,_0x580496){return db[_0xa76d('0x1f')][_0xa76d('0x20')]()[_0xa76d('0xc')](function(){return db[_0xa76d('0x36')][_0xa76d('0x21')](function(_0x4d4d63){return db[_0xa76d('0x4')]['findAll']({'where':_0x245235[_0xa76d('0x5')]?_0x245235[_0xa76d('0x5')]['where']||null:null,'attributes':_0x245235[_0xa76d('0x5')]?_0x245235[_0xa76d('0x5')]['attributes']||null:null,'limit':0x1,'order':_0x245235['options']?_0x245235[_0xa76d('0x5')]['order']||null:null,'group':db[_0xa76d('0x4')][_0xa76d('0x2a')],'transaction':_0x4d4d63,'lock':_0x4d4d63[_0xa76d('0x24')][_0xa76d('0x25')],'include':_0x245235[_0xa76d('0x5')]?_0x245235[_0xa76d('0x5')]['include']?_[_0xa76d('0xa')](_0x245235[_0xa76d('0x5')][_0xa76d('0x9')],function(_0x5e80e2){return{'model':db[_0x5e80e2[_0xa76d('0xb')]],'as':_0x5e80e2['as'],'attributes':_0x5e80e2['attributes'],'include':_0x5e80e2[_0xa76d('0x9')]?_[_0xa76d('0xa')](_0x5e80e2[_0xa76d('0x9')],function(_0x46df40){return{'model':db[_0x46df40[_0xa76d('0xb')]],'as':_0x46df40['as'],'attributes':_0x46df40[_0xa76d('0x7')],'include':_0x46df40[_0xa76d('0x9')]?_['map'](_0x46df40['include'],function(_0x95bcdb){return{'model':db[_0x95bcdb[_0xa76d('0xb')]],'as':_0x95bcdb['as'],'attributes':_0x95bcdb[_0xa76d('0x7')]};}):[]};}):[]};}):[]:[]})[_0xa76d('0xc')](function(_0x5815fb){var _0x5edfc1=[];for(var _0x4458d0=0x0;_0x4458d0<_0x5815fb[_0xa76d('0x2f')];_0x4458d0+=0x1){_0x5edfc1['push'](_0x5815fb[_0x4458d0][_0xa76d('0x2b')](_0x245235[_0xa76d('0x1a')],{'transaction':_0x4d4d63}));}return BPromise[_0xa76d('0x2e')](_0x5edfc1);});})[_0xa76d('0xc')](function(_0x3cdb7f){logger['info'](_0xa76d('0x3d'),_0x245235);logger[_0xa76d('0xe')](_0xa76d('0x3d'),_0x245235,JSON[_0xa76d('0x10')](_0x3cdb7f));_0x1d950e(_0x3cdb7f);})[_0xa76d('0x11')](function(_0x4ec91d){logger[_0xa76d('0x12')]('GetContactRecallMe',_0x4ec91d[_0xa76d('0x13')],_0x245235);_0x580496(_0x3f502f['error'](0x1f4,_0x4ec91d[_0xa76d('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x1db3fe){var _0xb955d=this;return new Promise(function(_0x2d2efe,_0xc2749e){db[_0xa76d('0x1f')][_0xa76d('0x20')]()[_0xa76d('0xc')](function(_0x3a2d88){return db['CmHopper'][_0xa76d('0x22')]({'raw':_0x1db3fe[_0xa76d('0x5')]?_0x1db3fe[_0xa76d('0x5')][_0xa76d('0x18')]===undefined?!![]:![]:!![],'where':_0x1db3fe[_0xa76d('0x5')]?_0x1db3fe[_0xa76d('0x5')][_0xa76d('0x6')]||null:null,'attributes':_0x1db3fe[_0xa76d('0x5')]?_0x1db3fe[_0xa76d('0x5')][_0xa76d('0x7')]||null:null,'limit':_0x1db3fe['options']?_0x1db3fe[_0xa76d('0x5')][_0xa76d('0x8')]||null:null,'include':_0x1db3fe[_0xa76d('0x5')]?_0x1db3fe['options'][_0xa76d('0x9')]?_[_0xa76d('0xa')](_0x1db3fe[_0xa76d('0x5')][_0xa76d('0x9')],function(_0x8df749){return{'model':db[_0x8df749[_0xa76d('0xb')]],'as':_0x8df749['as'],'attributes':_0x8df749['as']===_0xa76d('0x26')?_[_0xa76d('0x27')](_0x3a2d88):_0x8df749[_0xa76d('0x7')],'include':_0x8df749['include']?_[_0xa76d('0xa')](_0x8df749['include'],function(_0x195571){return{'model':db[_0x195571['model']],'as':_0x195571['as'],'attributes':_0x195571['attributes'],'include':_0x195571[_0xa76d('0x9')]?_['map'](_0x195571[_0xa76d('0x9')],function(_0x56781f){return{'model':db[_0x56781f[_0xa76d('0xb')]],'as':_0x56781f['as'],'attributes':_0x56781f[_0xa76d('0x7')]};}):[]};}):[]};}):[]:[]})[_0xa76d('0xc')](function(_0x4659b7){logger['info'](_0xa76d('0xf'),_0x1db3fe);logger[_0xa76d('0xe')](_0xa76d('0xf'),_0x1db3fe,JSON[_0xa76d('0x10')](_0x4659b7));_0x2d2efe(_0x4659b7);})[_0xa76d('0x11')](function(_0x177e24){logger['error'](_0xa76d('0xf'),_0x177e24['message'],_0x1db3fe);_0xc2749e(_0xb955d[_0xa76d('0x12')](0x1f4,_0x177e24[_0xa76d('0x13')]));});});});};exports[_0xa76d('0x3e')]=function(_0x260e34){var _0x5a1bfb=this;return new Promise(function(_0x5a42fe,_0x386119){return db[_0xa76d('0x1f')][_0xa76d('0x3f')]({'raw':!![],'where':{'phone':_0x260e34[_0xa76d('0x5')][_0xa76d('0x6')]['phone']},'attributes':['id',_0xa76d('0x40')],'order':[['id',_0xa76d('0x41')]]})[_0xa76d('0xc')](function(_0x2e3a75){logger[_0xa76d('0xd')]('getContactByPhone',_0x260e34);logger[_0xa76d('0xe')](_0xa76d('0x42'),_0x260e34,JSON[_0xa76d('0x10')](_0x2e3a75));_0x5a42fe(_0x2e3a75);})[_0xa76d('0x11')](function(_0x357d57){logger['error']('getContactByPhone',_0x357d57[_0xa76d('0x13')],_0x260e34);_0x386119(_0x5a1bfb[_0xa76d('0x12')](0x1f4,_0x357d57[_0xa76d('0x13')]));});});};exports[_0xa76d('0x43')]=function(_0x1c458b){var _0x225121=this;return new Promise(function(_0xef4951,_0x44d327){return db[_0xa76d('0x36')][_0xa76d('0x21')](function(_0x26ff26){var _0x5840d2=_0x1c458b[_0xa76d('0x5')]&&_0x1c458b[_0xa76d('0x5')][_0xa76d('0x6')]?_0x1c458b[_0xa76d('0x5')][_0xa76d('0x6')]:{};return db[_0xa76d('0x4')]['update'](_0x1c458b[_0xa76d('0x1a')],{'where':_0x5840d2,'transaction':_0x26ff26})[_0xa76d('0xc')](function(_0x5bc9ee){logger[_0xa76d('0xd')](_0xa76d('0x43'),_0x1c458b);logger[_0xa76d('0xe')]('ResetActiveCalls',_0x1c458b,JSON[_0xa76d('0x10')](_0x5bc9ee));_0xef4951(_0x5bc9ee);})[_0xa76d('0x11')](function(_0x4b7180){logger[_0xa76d('0x12')](_0xa76d('0x43'),_0x4b7180['message'],_0x1c458b);_0x44d327(_0x225121[_0xa76d('0x12')](0x1f4,_0x4b7180[_0xa76d('0x13')]));});});});};exports[_0xa76d('0x44')]=function(_0x55b9a9){var _0x1121b7=this;var _0x2f77d5=_0x55b9a9['body'][_0xa76d('0x6')][_0xa76d('0x45')];var _0x5d0454=_0x55b9a9['body'][_0xa76d('0x6')][_0xa76d('0x46')];var _0x9c9ea7=_0x55b9a9[_0xa76d('0x1a')][_0xa76d('0x6')][_0xa76d('0x47')];return new Promise(function(_0x5514fb,_0x17e6cb){return db['CmHopper'][_0xa76d('0x22')]({'where':{'voiceQueueId':{'$in':_0x2f77d5},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa76d('0x36')][_0xa76d('0x37')](_0xa76d('0x48')+_0x5d0454+_0xa76d('0x49')),'$gt':db[_0xa76d('0x36')][_0xa76d('0x37')](_0xa76d('0x4a'))}},'UserId':{'$in':_0x9c9ea7}},'include':[{'model':db['CmContact'],'as':_0xa76d('0x26')},{'model':db[_0xa76d('0x4b')],'as':_0xa76d('0x4c'),'attributes':['id',_0xa76d('0x28'),_0xa76d('0x29')]},{'model':db[_0xa76d('0x4d')],'as':_0xa76d('0x4e')}]})[_0xa76d('0xc')](function(_0x5a55f6){if(_0x5a55f6[_0xa76d('0x2f')]>0x0){return db[_0xa76d('0x36')][_0xa76d('0x21')](function(_0x145f12){return db[_0xa76d('0x4')][_0xa76d('0x2b')]({'recallmeNotifiedDate':db[_0xa76d('0x36')][_0xa76d('0x37')](_0xa76d('0x4a'))},{'where':{'id':{'$in':_[_0xa76d('0xa')](_0x5a55f6,'id')}},'transaction':_0x145f12})[_0xa76d('0xc')](function(){_0x5514fb(_0x5a55f6);})[_0xa76d('0x11')](function(_0x523d51){logger[_0xa76d('0x12')](_0xa76d('0x44'),_0x523d51[_0xa76d('0x13')],_0x55b9a9);_0x17e6cb(_0x1121b7['error'](0x1f4,_0x523d51[_0xa76d('0x13')]));});})['catch'](function(_0x475cc0){logger[_0xa76d('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x475cc0[_0xa76d('0x13')],_0x55b9a9);_0x17e6cb(_0x1121b7[_0xa76d('0x12')](0x1f4,_0x475cc0[_0xa76d('0x13')]));});}else{_0x5514fb(_0x5a55f6);}});});}; \ No newline at end of file +var _0x562c=['destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','User','Agent','name','voicePause','length','UserId','push','update','all','dataValues','active','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCmHopper','debug','stringify','catch','error','ShowCmHopper','find','info','message','CreateCmHopper','create','body','UpdateCmHopper'];(function(_0x339db5,_0x441041){var _0x142ff8=function(_0x4c8ac0){while(--_0x4c8ac0){_0x339db5['push'](_0x339db5['shift']());}};_0x142ff8(++_0x441041);}(_0x562c,0x121));var _0xc562=function(_0xb85b48,_0x3b5463){_0xb85b48=_0xb85b48-0x0;var _0x2b9e14=_0x562c[_0xb85b48];return _0x2b9e14;};'use strict';var _=require(_0xc562('0x0'));var util=require(_0xc562('0x1'));var moment=require(_0xc562('0x2'));var BPromise=require(_0xc562('0x3'));var db=require(_0xc562('0x4'))['db'];var logger=require(_0xc562('0x5'))(_0xc562('0x6'));exports['GetCmHopper']=function(_0x17fb6a){var _0x2665e3=this;return new Promise(function(_0x4ecf1e,_0x444624){return db[_0xc562('0x7')][_0xc562('0x8')]({'raw':_0x17fb6a['options']?_0x17fb6a[_0xc562('0x9')][_0xc562('0xa')]===undefined?!![]:![]:!![],'where':_0x17fb6a['options']?_0x17fb6a['options'][_0xc562('0xb')]||null:null,'attributes':_0x17fb6a[_0xc562('0x9')]?_0x17fb6a[_0xc562('0x9')][_0xc562('0xc')]||null:null,'limit':_0x17fb6a[_0xc562('0x9')]?_0x17fb6a[_0xc562('0x9')][_0xc562('0xd')]||null:null,'include':_0x17fb6a[_0xc562('0x9')]?_0x17fb6a[_0xc562('0x9')][_0xc562('0xe')]?_['map'](_0x17fb6a[_0xc562('0x9')]['include'],function(_0x2fe312){return{'model':db[_0x2fe312['model']],'as':_0x2fe312['as'],'attributes':_0x2fe312['attributes'],'include':_0x2fe312[_0xc562('0xe')]?_[_0xc562('0xf')](_0x2fe312['include'],function(_0x46defb){return{'model':db[_0x46defb[_0xc562('0x10')]],'as':_0x46defb['as'],'attributes':_0x46defb[_0xc562('0xc')],'include':_0x46defb[_0xc562('0xe')]?_['map'](_0x46defb['include'],function(_0x2ac8d9){return{'model':db[_0x2ac8d9[_0xc562('0x10')]],'as':_0x2ac8d9['as'],'attributes':_0x2ac8d9[_0xc562('0xc')]};}):[]};}):[]};}):[]:[]})[_0xc562('0x11')](function(_0x5a8fcd){logger['info'](_0xc562('0x12'),_0x17fb6a);logger[_0xc562('0x13')]('GetCmHopper',_0x17fb6a,JSON[_0xc562('0x14')](_0x5a8fcd));_0x4ecf1e(_0x5a8fcd);})[_0xc562('0x15')](function(_0x338087){logger[_0xc562('0x16')](_0xc562('0x12'),_0x338087['message'],_0x17fb6a);_0x444624(_0x2665e3[_0xc562('0x16')](0x1f4,_0x338087['message']));});});};exports[_0xc562('0x17')]=function(_0x54aae6){var _0x18a971=this;return new Promise(function(_0x112f9f,_0x5c81a3){return db[_0xc562('0x7')][_0xc562('0x18')]({'raw':_0x54aae6[_0xc562('0x9')]?_0x54aae6['options'][_0xc562('0xa')]===undefined?!![]:![]:!![],'where':_0x54aae6[_0xc562('0x9')]?_0x54aae6['options']['where']||null:null,'attributes':_0x54aae6[_0xc562('0x9')]?_0x54aae6['options'][_0xc562('0xc')]||null:null,'include':_0x54aae6[_0xc562('0x9')]?_0x54aae6[_0xc562('0x9')][_0xc562('0xe')]?_[_0xc562('0xf')](_0x54aae6['options']['include'],function(_0x3d43a7){return{'model':db[_0x3d43a7[_0xc562('0x10')]],'as':_0x3d43a7['as'],'attributes':_0x3d43a7[_0xc562('0xc')],'include':_0x3d43a7[_0xc562('0xe')]?_[_0xc562('0xf')](_0x3d43a7[_0xc562('0xe')],function(_0x219895){return{'model':db[_0x219895['model']],'as':_0x219895['as'],'attributes':_0x219895[_0xc562('0xc')],'include':_0x219895[_0xc562('0xe')]?_[_0xc562('0xf')](_0x219895[_0xc562('0xe')],function(_0x301411){return{'model':db[_0x301411['model']],'as':_0x301411['as'],'attributes':_0x301411[_0xc562('0xc')]};}):[]};}):[]};}):[]:[]})[_0xc562('0x11')](function(_0x11367b){logger[_0xc562('0x19')](_0xc562('0x17'),_0x54aae6);logger[_0xc562('0x13')](_0xc562('0x17'),_0x54aae6,JSON[_0xc562('0x14')](_0x11367b));_0x112f9f(_0x11367b);})[_0xc562('0x15')](function(_0x17824f){logger['error'](_0xc562('0x17'),_0x17824f[_0xc562('0x1a')],_0x54aae6);_0x5c81a3(_0x18a971[_0xc562('0x16')](0x1f4,_0x17824f[_0xc562('0x1a')]));});});};exports[_0xc562('0x1b')]=function(_0x249dd0){var _0x6d4c7=this;return new Promise(function(_0x3781a6,_0x3ceaa0){return db[_0xc562('0x7')][_0xc562('0x1c')](_0x249dd0[_0xc562('0x1d')],{'raw':_0x249dd0[_0xc562('0x9')]?_0x249dd0[_0xc562('0x9')][_0xc562('0xa')]===undefined?!![]:![]:!![]})['then'](function(_0x3b4cbd){logger['info'](_0xc562('0x1b'),_0x249dd0);logger['debug'](_0xc562('0x1b'),_0x249dd0,JSON[_0xc562('0x14')](_0x3b4cbd));_0x3781a6(_0x3b4cbd);})[_0xc562('0x15')](function(_0x3bf35f){logger[_0xc562('0x16')]('CreateCmHopper',_0x3bf35f[_0xc562('0x1a')],_0x249dd0);_0x3ceaa0(_0x6d4c7[_0xc562('0x16')](0x1f4,_0x3bf35f[_0xc562('0x1a')]));});});};exports[_0xc562('0x1e')]=function(_0x2a1654){var _0x17013f=this;return new Promise(function(_0x94707f,_0x449209){return db[_0xc562('0x7')]['update'](_0x2a1654[_0xc562('0x1d')],{'raw':_0x2a1654[_0xc562('0x9')]?_0x2a1654[_0xc562('0x9')][_0xc562('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1654[_0xc562('0x9')]?_0x2a1654[_0xc562('0x9')][_0xc562('0xb')]||null:null,'attributes':_0x2a1654['options']?_0x2a1654[_0xc562('0x9')][_0xc562('0xc')]||null:null,'limit':_0x2a1654['options']?_0x2a1654['options'][_0xc562('0xd')]||null:null})['then'](function(_0x2a4c2f){logger['info']('UpdateCmHopper',_0x2a1654);logger[_0xc562('0x19')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xc562('0x14')](_0x2a1654[_0xc562('0x9')]['where']),_0x2a1654[_0xc562('0x1d')]['active']);logger[_0xc562('0x13')](_0xc562('0x1e'),_0x2a1654,JSON[_0xc562('0x14')](_0x2a4c2f));_0x94707f(_0x2a4c2f);})[_0xc562('0x15')](function(_0x40f6d5){logger['error'](_0xc562('0x1e'),_0x40f6d5[_0xc562('0x1a')],_0x2a1654);_0x449209(_0x17013f['error'](0x1f4,_0x40f6d5[_0xc562('0x1a')]));});});};exports['DestroyCmHopper']=function(_0x2b3c6c){var _0x2b77bf=this;return new Promise(function(_0x1bc2c7,_0x1f4009){return db[_0xc562('0x7')][_0xc562('0x1f')]({'where':_0x2b3c6c[_0xc562('0x9')]?_0x2b3c6c[_0xc562('0x9')][_0xc562('0xb')]||null:null})[_0xc562('0x11')](function(_0x5946d8){logger[_0xc562('0x19')]('DestroyCmHopper',_0x2b3c6c);logger['debug'](_0xc562('0x20'),_0x2b3c6c,JSON['stringify'](_0x5946d8));_0x1bc2c7(_0x5946d8);})[_0xc562('0x15')](function(_0x2c1187){logger[_0xc562('0x16')](_0xc562('0x20'),_0x2c1187['message'],_0x2b3c6c);_0x1f4009(_0x2b77bf[_0xc562('0x16')](0x1f4,_0x2c1187[_0xc562('0x1a')]));});});};exports[_0xc562('0x21')]=function(_0x431d99){var _0x44ba8b=this;return new Promise(function(_0x4e7178,_0x423c2a){return db[_0xc562('0x22')][_0xc562('0x23')]()[_0xc562('0x11')](function(_0x4abc5e){return db[_0xc562('0x24')][_0xc562('0x25')](function(_0x1ed1b1){return db[_0xc562('0x7')][_0xc562('0x8')]({'where':_0x431d99[_0xc562('0x9')]?_0x431d99[_0xc562('0x9')][_0xc562('0xb')]||null:null,'attributes':_0x431d99[_0xc562('0x9')]?_0x431d99['options']['attributes']||null:null,'limit':_0x431d99['options']?_0x431d99[_0xc562('0x9')][_0xc562('0xd')]||null:null,'order':_0x431d99[_0xc562('0x9')]?_0x431d99[_0xc562('0x9')][_0xc562('0x26')]||null:null,'transaction':_0x1ed1b1,'lock':_0x1ed1b1[_0xc562('0x27')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xc562('0x28'),'attributes':_[_0xc562('0x29')](_0x4abc5e)},{'model':db[_0xc562('0x2a')],'as':_0xc562('0x2b'),'attributes':['id',_0xc562('0x2c'),_0xc562('0x2d')]}]})[_0xc562('0x11')](function(_0x54c995){var _0x2d6380=[];var _0x54ffe1=[];for(var _0x574fc2=0x0;_0x574fc2<_0x54c995[_0xc562('0x2e')];_0x574fc2+=0x1){var _0x5d4c01=_0x54c995[_0x574fc2][_0xc562('0x2f')];if(_0x5d4c01===null){_0x2d6380['push'](_0x54c995[_0x574fc2]['update'](_0x431d99[_0xc562('0x1d')],{'transaction':_0x1ed1b1}));}else if(!_0x54ffe1['includes'](_0x5d4c01)){_0x54ffe1['push'](_0x5d4c01);_0x2d6380[_0xc562('0x30')](_0x54c995[_0x574fc2][_0xc562('0x31')](_0x431d99['body'],{'transaction':_0x1ed1b1}));}}return BPromise[_0xc562('0x32')](_0x2d6380);});})[_0xc562('0x11')](function(_0x382083){logger[_0xc562('0x19')]('GetContactDialer',_0x431d99);if(_0x382083[_0xc562('0x2e')]>0x0){logger[_0xc562('0x19')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x382083[0x0][_0xc562('0x33')]['id'],_0x382083[0x0][_0xc562('0x33')]['ContactId'],_0x382083[0x0][_0xc562('0x33')][_0xc562('0x34')]);}logger['debug']('GetContactDialer',_0x431d99,JSON[_0xc562('0x14')](_0x382083));_0x4e7178(_0x382083);})['catch'](function(_0xa5f785){logger[_0xc562('0x16')](_0xc562('0x21'),_0xa5f785[_0xc562('0x1a')],_0x431d99);_0x423c2a(_0x44ba8b[_0xc562('0x16')](0x1f4,_0xa5f785[_0xc562('0x1a')]));});});});};exports[_0xc562('0x35')]=function(_0x1e326a){var _0x5e4841=this;return new Promise(function(_0x41ecf4,_0x3f1c91){return db[_0xc562('0x24')][_0xc562('0x25')](function(_0x1b884a){return db[_0xc562('0x36')][_0xc562('0x1c')](_0x1e326a[_0xc562('0x1d')],{'raw':_0x1e326a[_0xc562('0x9')]?_0x1e326a[_0xc562('0x9')][_0xc562('0xa')]===undefined?!![]:![]:!![],'transaction':_0x1b884a})['then'](function(){logger[_0xc562('0x19')](_0xc562('0x37'),JSON[_0xc562('0x14')](_0x1e326a[_0xc562('0x9')]['where']),_0x1e326a[_0xc562('0x9')][_0xc562('0xb')]['active']);return db[_0xc562('0x7')]['destroy']({'where':_0x1e326a['options']?_0x1e326a[_0xc562('0x9')]['where']||null:null,'transaction':_0x1b884a});});})[_0xc562('0x11')](function(_0x3fd515){logger[_0xc562('0x19')]('MoveContactManagedDialer',_0x1e326a);logger[_0xc562('0x13')]('MoveContactManagedDialer',_0x1e326a,JSON['stringify'](_0x3fd515));_0x41ecf4(_0x3fd515);})['catch'](function(_0x51e1bb){logger[_0xc562('0x16')]('MoveContactManagedDialer',_0x51e1bb[_0xc562('0x1a')],_0x1e326a);_0x3f1c91(_0x5e4841[_0xc562('0x16')](0x1f4,_0x51e1bb[_0xc562('0x1a')]));});});};exports[_0xc562('0x38')]=function(_0x4cdd3c){var _0x8a185b=this;return new Promise(function(_0x3c7918,_0x4f8ff8){return db[_0xc562('0x7')][_0xc562('0x8')]({'raw':_0x4cdd3c[_0xc562('0x9')]?_0x4cdd3c[_0xc562('0x9')][_0xc562('0xa')]===undefined?!![]:![]:!![],'where':_0x4cdd3c['options']?_0x4cdd3c[_0xc562('0x9')]['where']||null:null,'attributes':[[db[_0xc562('0x24')]['fn'](_0xc562('0x39'),db['sequelize']['fn']('IF',db[_0xc562('0x24')][_0xc562('0x3a')]('`scheduledat`\x20>=\x20'+util['format'](_0xc562('0x3b'),moment()[_0xc562('0x3c')](_0xc562('0x3d')))+_0xc562('0x3e')))),_0xc562('0x3f')]]})[_0xc562('0x11')](function(_0x3a4019){logger['info'](_0xc562('0x38'),_0x4cdd3c);logger[_0xc562('0x13')](_0xc562('0x38'),_0x4cdd3c,JSON[_0xc562('0x14')](_0x3a4019));_0x3c7918(_0x3a4019);})[_0xc562('0x15')](function(_0x3c21c4){logger[_0xc562('0x16')]('CountReScheduled',_0x3c21c4[_0xc562('0x1a')],_0x4cdd3c);_0x4f8ff8(_0x8a185b[_0xc562('0x16')](0x1f4,_0x3c21c4[_0xc562('0x1a')]));});});};exports[_0xc562('0x40')]=function(_0x584e7f){var _0x5de156=this;return new Promise(function(_0x3e7f80,_0x50a60b){return db[_0xc562('0x22')]['describe']()[_0xc562('0x11')](function(){return db[_0xc562('0x24')]['transaction'](function(_0x3b17b0){return db[_0xc562('0x7')]['findAll']({'where':_0x584e7f[_0xc562('0x9')]?_0x584e7f[_0xc562('0x9')][_0xc562('0xb')]||null:null,'attributes':_0x584e7f['options']?_0x584e7f[_0xc562('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x584e7f[_0xc562('0x9')]?_0x584e7f['options'][_0xc562('0x26')]||null:null,'group':db[_0xc562('0x7')][_0xc562('0x2f')],'transaction':_0x3b17b0,'lock':_0x3b17b0[_0xc562('0x27')][_0xc562('0x41')],'include':_0x584e7f[_0xc562('0x9')]?_0x584e7f[_0xc562('0x9')][_0xc562('0xe')]?_['map'](_0x584e7f[_0xc562('0x9')][_0xc562('0xe')],function(_0x16c795){return{'model':db[_0x16c795['model']],'as':_0x16c795['as'],'attributes':_0x16c795[_0xc562('0xc')],'include':_0x16c795[_0xc562('0xe')]?_[_0xc562('0xf')](_0x16c795[_0xc562('0xe')],function(_0x14315f){return{'model':db[_0x14315f['model']],'as':_0x14315f['as'],'attributes':_0x14315f[_0xc562('0xc')],'include':_0x14315f[_0xc562('0xe')]?_['map'](_0x14315f[_0xc562('0xe')],function(_0x509cc9){return{'model':db[_0x509cc9[_0xc562('0x10')]],'as':_0x509cc9['as'],'attributes':_0x509cc9[_0xc562('0xc')]};}):[]};}):[]};}):[]:[]})[_0xc562('0x11')](function(_0x461491){var _0x37ba38=[];for(var _0x31365e=0x0;_0x31365e<_0x461491['length'];_0x31365e+=0x1){_0x37ba38[_0xc562('0x30')](_0x461491[_0x31365e][_0xc562('0x31')](_0x584e7f['body'],{'transaction':_0x3b17b0}));}return BPromise['all'](_0x37ba38);});})[_0xc562('0x11')](function(_0x2386ab){logger[_0xc562('0x19')]('GetContactRecallMe',_0x584e7f);logger['debug']('GetContactRecallMe',_0x584e7f,JSON['stringify'](_0x2386ab));_0x3e7f80(_0x2386ab);})['catch'](function(_0x33a7f1){logger[_0xc562('0x16')]('GetContactRecallMe',_0x33a7f1[_0xc562('0x1a')],_0x584e7f);_0x50a60b(_0x5de156[_0xc562('0x16')](0x1f4,_0x33a7f1[_0xc562('0x1a')]));});});});};exports['GetCmHopperPreview']=function(_0x444767){var _0x363f7c=this;return new Promise(function(_0x1893bd,_0x5864f2){db[_0xc562('0x22')][_0xc562('0x23')]()[_0xc562('0x11')](function(_0x196423){return db[_0xc562('0x7')][_0xc562('0x8')]({'raw':_0x444767[_0xc562('0x9')]?_0x444767['options']['raw']===undefined?!![]:![]:!![],'where':_0x444767[_0xc562('0x9')]?_0x444767[_0xc562('0x9')][_0xc562('0xb')]||null:null,'attributes':_0x444767['options']?_0x444767['options'][_0xc562('0xc')]||null:null,'limit':_0x444767['options']?_0x444767[_0xc562('0x9')][_0xc562('0xd')]||null:null,'include':_0x444767[_0xc562('0x9')]?_0x444767[_0xc562('0x9')][_0xc562('0xe')]?_[_0xc562('0xf')](_0x444767['options'][_0xc562('0xe')],function(_0x2c7aee){return{'model':db[_0x2c7aee[_0xc562('0x10')]],'as':_0x2c7aee['as'],'attributes':_0x2c7aee['as']===_0xc562('0x28')?_[_0xc562('0x29')](_0x196423):_0x2c7aee['attributes'],'include':_0x2c7aee[_0xc562('0xe')]?_['map'](_0x2c7aee[_0xc562('0xe')],function(_0x5d175d){return{'model':db[_0x5d175d['model']],'as':_0x5d175d['as'],'attributes':_0x5d175d[_0xc562('0xc')],'include':_0x5d175d['include']?_[_0xc562('0xf')](_0x5d175d[_0xc562('0xe')],function(_0x15429f){return{'model':db[_0x15429f[_0xc562('0x10')]],'as':_0x15429f['as'],'attributes':_0x15429f['attributes']};}):[]};}):[]};}):[]:[]})[_0xc562('0x11')](function(_0xf169e5){logger[_0xc562('0x19')](_0xc562('0x12'),_0x444767);logger[_0xc562('0x13')](_0xc562('0x12'),_0x444767,JSON['stringify'](_0xf169e5));_0x1893bd(_0xf169e5);})[_0xc562('0x15')](function(_0x1c0e83){logger[_0xc562('0x16')](_0xc562('0x12'),_0x1c0e83[_0xc562('0x1a')],_0x444767);_0x5864f2(_0x363f7c[_0xc562('0x16')](0x1f4,_0x1c0e83[_0xc562('0x1a')]));});});});};exports[_0xc562('0x42')]=function(_0x1c88c2){var _0x48602f=this;return new Promise(function(_0x16bb71,_0x58f662){return db[_0xc562('0x22')][_0xc562('0x43')]({'raw':!![],'where':{'phone':_0x1c88c2[_0xc562('0x9')][_0xc562('0xb')]['phone']},'attributes':['id',_0xc562('0x44')],'order':[['id',_0xc562('0x45')]]})[_0xc562('0x11')](function(_0x507d4d){logger[_0xc562('0x19')](_0xc562('0x46'),_0x1c88c2);logger[_0xc562('0x13')](_0xc562('0x46'),_0x1c88c2,JSON[_0xc562('0x14')](_0x507d4d));_0x16bb71(_0x507d4d);})[_0xc562('0x15')](function(_0x56e692){logger['error'](_0xc562('0x46'),_0x56e692['message'],_0x1c88c2);_0x58f662(_0x48602f[_0xc562('0x16')](0x1f4,_0x56e692[_0xc562('0x1a')]));});});};exports[_0xc562('0x47')]=function(_0xdab026){var _0x153821=this;return new Promise(function(_0x583fce,_0x22d406){return db[_0xc562('0x24')]['transaction'](function(_0x225ee3){var _0x2b12f0=_0xdab026[_0xc562('0x9')]&&_0xdab026[_0xc562('0x9')][_0xc562('0xb')]?_0xdab026[_0xc562('0x9')][_0xc562('0xb')]:{};return db[_0xc562('0x7')][_0xc562('0x31')](_0xdab026['body'],{'where':_0x2b12f0,'transaction':_0x225ee3})[_0xc562('0x11')](function(_0x41bde4){logger[_0xc562('0x19')](_0xc562('0x47'),_0xdab026);logger[_0xc562('0x13')]('ResetActiveCalls',_0xdab026,JSON['stringify'](_0x41bde4));_0x583fce(_0x41bde4);})[_0xc562('0x15')](function(_0x3ef2fb){logger['error'](_0xc562('0x47'),_0x3ef2fb[_0xc562('0x1a')],_0xdab026);_0x22d406(_0x153821[_0xc562('0x16')](0x1f4,_0x3ef2fb[_0xc562('0x1a')]));});});});};exports[_0xc562('0x48')]=function(_0x20d007){var _0x300f52=this;var _0x2052b7=_0x20d007['body'][_0xc562('0xb')][_0xc562('0x49')];var _0x21ec49=_0x20d007[_0xc562('0x1d')][_0xc562('0xb')][_0xc562('0x4a')];var _0x6d00e2=_0x20d007[_0xc562('0x1d')][_0xc562('0xb')][_0xc562('0x4b')];return new Promise(function(_0xb53a48,_0x22f461){return db[_0xc562('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x2052b7},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0xc562('0x4c')+_0x21ec49+_0xc562('0x4d')),'$gt':db[_0xc562('0x24')][_0xc562('0x3a')]('NOW()')}},'UserId':{'$in':_0x6d00e2}},'include':[{'model':db[_0xc562('0x22')],'as':_0xc562('0x28')},{'model':db[_0xc562('0x2a')],'as':_0xc562('0x2b'),'attributes':['id',_0xc562('0x2c'),_0xc562('0x2d')]},{'model':db['CmList'],'as':_0xc562('0x4e')}]})[_0xc562('0x11')](function(_0x369fd2){if(_0x369fd2[_0xc562('0x2e')]>0x0){return db[_0xc562('0x24')][_0xc562('0x25')](function(_0x23bf92){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0xc562('0x24')]['literal'](_0xc562('0x4f'))},{'where':{'id':{'$in':_[_0xc562('0xf')](_0x369fd2,'id')}},'transaction':_0x23bf92})[_0xc562('0x11')](function(){_0xb53a48(_0x369fd2);})[_0xc562('0x15')](function(_0x26ab34){logger[_0xc562('0x16')](_0xc562('0x48'),_0x26ab34[_0xc562('0x1a')],_0x20d007);_0x22f461(_0x300f52['error'](0x1f4,_0x26ab34[_0xc562('0x1a')]));});})[_0xc562('0x15')](function(_0x29d1e8){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x29d1e8[_0xc562('0x1a')],_0x20d007);_0x22f461(_0x300f52[_0xc562('0x16')](0x1f4,_0x29d1e8[_0xc562('0x1a')]));});}else{_0xb53a48(_0x369fd2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index fae7604..088bfed 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 _0x1c0e=['/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','/:id','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','/timezones','getTimezones','show'];(function(_0xd1b2de,_0x15f4d1){var _0x15df70=function(_0x2ba9e5){while(--_0x2ba9e5){_0xd1b2de['push'](_0xd1b2de['shift']());}};_0x15df70(++_0x15f4d1);}(_0x1c0e,0x1d0));var _0xe1c0=function(_0xf9b336,_0x37c5df){_0xf9b336=_0xf9b336-0x0;var _0x48fc7c=_0x1c0e[_0xf9b336];return _0x48fc7c;};'use strict';var express=require('express');var router=express[_0xe1c0('0x0')]();var auth=require(_0xe1c0('0x1'));var controller=require(_0xe1c0('0x2'));router[_0xe1c0('0x3')]('/',auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x5')]);router[_0xe1c0('0x3')]('/describe',auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x6')]);router[_0xe1c0('0x3')](_0xe1c0('0x7'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0xe1c0('0x8'),auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x9')]);router[_0xe1c0('0x3')]('/:id',auth[_0xe1c0('0x4')](),controller[_0xe1c0('0xa')]);router['get'](_0xe1c0('0xb'),auth[_0xe1c0('0x4')](),controller[_0xe1c0('0xc')]);router[_0xe1c0('0xd')]('/',auth[_0xe1c0('0x4')](),controller[_0xe1c0('0xe')]);router[_0xe1c0('0xd')](_0xe1c0('0xf'),auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x10')]);router[_0xe1c0('0xd')](_0xe1c0('0x11'),auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x12')]);router[_0xe1c0('0x13')](_0xe1c0('0x14'),auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x15')]);router[_0xe1c0('0x16')]('/:id',auth[_0xe1c0('0x4')](),controller[_0xe1c0('0x17')]);module[_0xe1c0('0x18')]=router; \ No newline at end of file +var _0x48ed=['getOpenContacts','/timezones','getTimezones','/:id','show','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router','./cmHopper.controller','get','isAuthenticated','/describe','describe'];(function(_0x473ea3,_0x2b3481){var _0x2385ac=function(_0x31d70a){while(--_0x31d70a){_0x473ea3['push'](_0x473ea3['shift']());}};_0x2385ac(++_0x2b3481);}(_0x48ed,0x131));var _0xd48e=function(_0x2ed395,_0x24323b){_0x2ed395=_0x2ed395-0x0;var _0x14a5eb=_0x48ed[_0x2ed395];return _0x14a5eb;};'use strict';var express=require(_0xd48e('0x0'));var router=express[_0xd48e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd48e('0x2'));router[_0xd48e('0x3')]('/',auth[_0xd48e('0x4')](),controller['index']);router[_0xd48e('0x3')](_0xd48e('0x5'),auth[_0xd48e('0x4')](),controller[_0xd48e('0x6')]);router[_0xd48e('0x3')]('/opencontacts',auth[_0xd48e('0x4')](),controller[_0xd48e('0x7')]);router[_0xd48e('0x3')](_0xd48e('0x8'),auth[_0xd48e('0x4')](),controller[_0xd48e('0x9')]);router[_0xd48e('0x3')](_0xd48e('0xa'),auth[_0xd48e('0x4')](),controller[_0xd48e('0xb')]);router[_0xd48e('0x3')]('/:id/previewrecall',auth[_0xd48e('0x4')](),controller[_0xd48e('0xc')]);router[_0xd48e('0xd')]('/',auth[_0xd48e('0x4')](),controller[_0xd48e('0xe')]);router[_0xd48e('0xd')](_0xd48e('0xf'),auth['isAuthenticated'](),controller[_0xd48e('0x10')]);router[_0xd48e('0xd')](_0xd48e('0x11'),auth['isAuthenticated'](),controller[_0xd48e('0x12')]);router[_0xd48e('0x13')](_0xd48e('0xa'),auth['isAuthenticated'](),controller[_0xd48e('0x14')]);router[_0xd48e('0x15')](_0xd48e('0xa'),auth[_0xd48e('0x4')](),controller[_0xd48e('0x16')]);module[_0xd48e('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 2935278..3729e65 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 _0xab6d=['INTEGER','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xab6d,0x93));var _0xdab6=function(_0x461b6a,_0x39bcd7){_0x461b6a=_0x461b6a-0x0;var _0x8226d4=_0xab6d[_0x461b6a];return _0x8226d4;};'use strict';var moment=require(_0xdab6('0x0'));var Sequelize=require(_0xdab6('0x1'));module[_0xdab6('0x2')]={'CmHopperId':{'type':Sequelize[_0xdab6('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xdab6('0x4'))},'countbusyretry':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdab6('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd115=['INTEGER','moment','sequelize','exports','STRING','DATE','format'];(function(_0x35964b,_0x229594){var _0x4abfb3=function(_0x25bb5f){while(--_0x25bb5f){_0x35964b['push'](_0x35964b['shift']());}};_0x4abfb3(++_0x229594);}(_0xd115,0x94));var _0x5d11=function(_0x3eedee,_0x300b45){_0x3eedee=_0x3eedee-0x0;var _0x17a503=_0xd115[_0x3eedee];return _0x17a503;};'use strict';var moment=require(_0x5d11('0x0'));var Sequelize=require(_0x5d11('0x1'));module[_0x5d11('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x5d11('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5d11('0x4')],'defaultValue':moment()[_0x5d11('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5d11('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5d11('0x6')],'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 0445ce3..2ec0adf 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 _0x5567=['eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','stack','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','name','filter','options','include','findAll','show','params','length','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xfd9375,_0x1390b2){var _0x410068=function(_0x44fac2){while(--_0x44fac2){_0xfd9375['push'](_0xfd9375['shift']());}};_0x410068(++_0x1390b2);}(_0x5567,0x1ec));var _0x7556=function(_0x2fde42,_0xbdff5d){_0x2fde42=_0x2fde42-0x0;var _0x355e10=_0x5567[_0x2fde42];return _0x355e10;};'use strict';var emlformat=require(_0x7556('0x0'));var rimraf=require(_0x7556('0x1'));var zipdir=require(_0x7556('0x2'));var jsonpatch=require(_0x7556('0x3'));var rp=require('request-promise');var moment=require(_0x7556('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7556('0x5'));var path=require(_0x7556('0x6'));var sox=require(_0x7556('0x7'));var csv=require(_0x7556('0x8'));var ejs=require(_0x7556('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7556('0xa'));var squel=require('squel');var crypto=require(_0x7556('0xb'));var jsforce=require(_0x7556('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7556('0x8'));var querystring=require(_0x7556('0xd'));var Papa=require('papaparse');var Redis=require(_0x7556('0xe'));var authService=require(_0x7556('0xf'));var qs=require(_0x7556('0x10'));var as=require(_0x7556('0x11'));var hardwareService=require(_0x7556('0x12'));var logger=require(_0x7556('0x13'))(_0x7556('0x14'));var utils=require(_0x7556('0x15'));var config=require(_0x7556('0x16'));var licenseUtil=require(_0x7556('0x17'));var db=require(_0x7556('0x18'))['db'];function respondWithStatusCode(_0x484ead,_0x333292){_0x333292=_0x333292||0xcc;return function(_0x12cf88){if(_0x12cf88){return _0x484ead[_0x7556('0x19')](_0x333292);}return _0x484ead[_0x7556('0x1a')](_0x333292)[_0x7556('0x1b')]();};}function respondWithResult(_0x12f312,_0x3aef8a){_0x3aef8a=_0x3aef8a||0xc8;return function(_0x58f1c6){if(_0x58f1c6){return _0x12f312[_0x7556('0x1a')](_0x3aef8a)['json'](_0x58f1c6);}};}function respondWithFilteredResult(_0x356a33,_0x217ee9){return function(_0xdfa5e0){if(_0xdfa5e0){var _0x31f42d=typeof _0x217ee9[_0x7556('0x1c')]==='undefined'&&typeof _0x217ee9[_0x7556('0x1d')]===_0x7556('0x1e');var _0x4096ee=_0xdfa5e0[_0x7556('0x1f')];var _0x4eb1ae=_0x31f42d?0x0:_0x217ee9['offset'];var _0x2671c6=_0x31f42d?_0xdfa5e0[_0x7556('0x1f')]:_0x217ee9['offset']+_0x217ee9[_0x7556('0x1d')];var _0x38374e;if(_0x2671c6>=_0x4096ee){_0x2671c6=_0x4096ee;_0x38374e=0xc8;}else{_0x38374e=0xce;}_0x356a33[_0x7556('0x1a')](_0x38374e);return _0x356a33[_0x7556('0x20')](_0x7556('0x21'),_0x4eb1ae+'-'+_0x2671c6+'/'+_0x4096ee)[_0x7556('0x22')](_0xdfa5e0);}return null;};}function patchUpdates(_0x49303c){return function(_0x267e98){try{jsonpatch[_0x7556('0x23')](_0x267e98,_0x49303c,!![]);}catch(_0x123e6c){return BPromise[_0x7556('0x24')](_0x123e6c);}return _0x267e98[_0x7556('0x25')]();};}function saveUpdates(_0x32239a,_0x2d14e1){return function(_0x6cf1e5){if(_0x6cf1e5){return _0x6cf1e5[_0x7556('0x26')](_0x32239a)[_0x7556('0x27')](function(_0xeaf289){return _0xeaf289;});}return null;};}function removeEntity(_0x2b221f,_0x233013){return function(_0x3f7711){if(_0x3f7711){return _0x3f7711[_0x7556('0x28')]()[_0x7556('0x27')](function(){var _0x4e1f10=_0x3f7711['get']({'plain':!![]});var _0x384077=_0x7556('0x29');return db[_0x7556('0x2a')][_0x7556('0x28')]({'where':{'type':_0x384077,'resourceId':_0x4e1f10['id']}})[_0x7556('0x27')](function(){return _0x3f7711;});})[_0x7556('0x27')](function(){_0x2b221f[_0x7556('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6133,_0x3f6385){return function(_0x2a0704){if(!_0x2a0704){_0x3c6133[_0x7556('0x19')](0x194);}return _0x2a0704;};}function handleError(_0x53a126,_0x535d6d){_0x535d6d=_0x535d6d||0x1f4;return function(_0x3f346b){logger[_0x7556('0x2b')](_0x3f346b[_0x7556('0x2c')]);if(_0x3f346b['name']){delete _0x3f346b['name'];}_0x53a126['status'](_0x535d6d)[_0x7556('0x2d')](_0x3f346b);};}exports[_0x7556('0x2e')]=function(_0x3ef443,_0x203508){var _0x49a5e4={},_0x4f6dae={},_0x41b4a1={'count':0x0,'rows':[]};var _0x46729e=_[_0x7556('0x2f')](db[_0x7556('0x30')][_0x7556('0x31')],function(_0x49aa96){return{'name':_0x49aa96[_0x7556('0x32')],'type':_0x49aa96[_0x7556('0x33')]['key']};});_0x4f6dae['model']=_['map'](_0x46729e,'name');_0x4f6dae['query']=_[_0x7556('0x34')](_0x3ef443[_0x7556('0x35')]);_0x4f6dae[_0x7556('0x36')]=_[_0x7556('0x37')](_0x4f6dae[_0x7556('0x38')],_0x4f6dae[_0x7556('0x35')]);_0x49a5e4[_0x7556('0x39')]=_[_0x7556('0x37')](_0x4f6dae[_0x7556('0x38')],qs[_0x7556('0x3a')](_0x3ef443[_0x7556('0x35')][_0x7556('0x3a')]));_0x49a5e4[_0x7556('0x39')]=_0x49a5e4[_0x7556('0x39')]['length']?_0x49a5e4[_0x7556('0x39')]:_0x4f6dae['model'];if(!_0x3ef443['query']['hasOwnProperty']('nolimit')){_0x49a5e4[_0x7556('0x1d')]=qs[_0x7556('0x1d')](_0x3ef443[_0x7556('0x35')][_0x7556('0x1d')]);_0x49a5e4[_0x7556('0x1c')]=qs[_0x7556('0x1c')](_0x3ef443[_0x7556('0x35')][_0x7556('0x1c')]);}_0x49a5e4[_0x7556('0x3b')]=qs[_0x7556('0x3c')](_0x3ef443[_0x7556('0x35')]['sort']);_0x49a5e4[_0x7556('0x3d')]=qs[_0x7556('0x36')](_[_0x7556('0x3e')](_0x3ef443[_0x7556('0x35')],_0x4f6dae['filters']),_0x46729e);if(_0x3ef443[_0x7556('0x35')]['filter']){_0x49a5e4[_0x7556('0x3d')]=_[_0x7556('0x3f')](_0x49a5e4['where'],{'$or':_['map'](_0x46729e,function(_0x3783be){if(_0x3783be[_0x7556('0x33')]!=='VIRTUAL'){var _0x437f2c={};_0x437f2c[_0x3783be[_0x7556('0x40')]]={'$like':'%'+_0x3ef443[_0x7556('0x35')][_0x7556('0x41')]+'%'};return _0x437f2c;}})});}_0x49a5e4=_[_0x7556('0x3f')]({},_0x49a5e4,_0x3ef443[_0x7556('0x42')]);var _0x5805b8={'where':_0x49a5e4[_0x7556('0x3d')]};return db['CmHopperAdditionalPhone'][_0x7556('0x1f')](_0x5805b8)[_0x7556('0x27')](function(_0x154c76){_0x41b4a1[_0x7556('0x1f')]=_0x154c76;if(_0x3ef443[_0x7556('0x35')]['includeAll']){_0x49a5e4[_0x7556('0x43')]=[{'all':!![]}];}return db[_0x7556('0x30')][_0x7556('0x44')](_0x49a5e4);})[_0x7556('0x27')](function(_0x253f63){_0x41b4a1['rows']=_0x253f63;return _0x41b4a1;})['then'](respondWithFilteredResult(_0x203508,_0x49a5e4))['catch'](handleError(_0x203508,null));};exports[_0x7556('0x45')]=function(_0x2dc1ed,_0x543e11){var _0x468b10={'raw':!![],'where':{'id':_0x2dc1ed[_0x7556('0x46')]['id']}},_0x309054={};_0x309054[_0x7556('0x38')]=_[_0x7556('0x34')](db[_0x7556('0x30')][_0x7556('0x31')]);_0x309054[_0x7556('0x35')]=_['keys'](_0x2dc1ed[_0x7556('0x35')]);_0x309054[_0x7556('0x36')]=_[_0x7556('0x37')](_0x309054[_0x7556('0x38')],_0x309054[_0x7556('0x35')]);_0x468b10['attributes']=_[_0x7556('0x37')](_0x309054[_0x7556('0x38')],qs['fields'](_0x2dc1ed[_0x7556('0x35')][_0x7556('0x3a')]));_0x468b10[_0x7556('0x39')]=_0x468b10[_0x7556('0x39')][_0x7556('0x47')]?_0x468b10[_0x7556('0x39')]:_0x309054[_0x7556('0x38')];if(_0x2dc1ed['query'][_0x7556('0x48')]){_0x468b10[_0x7556('0x43')]=[{'all':!![]}];}_0x468b10=_[_0x7556('0x3f')]({},_0x468b10,_0x2dc1ed['options']);return db['CmHopperAdditionalPhone'][_0x7556('0x49')](_0x468b10)[_0x7556('0x27')](handleEntityNotFound(_0x543e11,null))[_0x7556('0x27')](respondWithResult(_0x543e11,null))[_0x7556('0x4a')](handleError(_0x543e11,null));};exports[_0x7556('0x4b')]=function(_0x26e7a6,_0x324761){return db[_0x7556('0x30')]['create'](_0x26e7a6[_0x7556('0x4c')],{})[_0x7556('0x27')](function(_0x5caa46){var _0x3c06f5=_0x26e7a6[_0x7556('0x4d')][_0x7556('0x4e')]({'plain':!![]});if(!_0x3c06f5)throw new Error(_0x7556('0x4f'));if(_0x3c06f5[_0x7556('0x50')]===_0x7556('0x4d')){var _0x7d3a34=_0x5caa46[_0x7556('0x4e')]({'plain':!![]});var _0xdec2d=_0x7556('0x29');return db['UserProfileSection']['find']({'where':{'name':_0xdec2d,'userProfileId':_0x3c06f5['userProfileId']},'raw':!![]})['then'](function(_0x11b70c){if(_0x11b70c&&_0x11b70c['autoAssociation']===0x0){return db[_0x7556('0x2a')][_0x7556('0x4b')]({'name':_0x7d3a34[_0x7556('0x40')],'resourceId':_0x7d3a34['id'],'type':_0x11b70c[_0x7556('0x40')],'sectionId':_0x11b70c['id']},{})[_0x7556('0x27')](function(){return _0x5caa46;});}else{return _0x5caa46;}})['catch'](function(_0x35962f){logger[_0x7556('0x2b')](_0x7556('0x51'),_0x35962f);throw _0x35962f;});}return _0x5caa46;})['then'](respondWithResult(_0x324761,0xc9))['catch'](handleError(_0x324761,null));};exports[_0x7556('0x26')]=function(_0x5002eb,_0x28c460){if(_0x5002eb['body']['id']){delete _0x5002eb['body']['id'];}return db[_0x7556('0x30')][_0x7556('0x49')]({'where':{'id':_0x5002eb[_0x7556('0x46')]['id']}})[_0x7556('0x27')](handleEntityNotFound(_0x28c460,null))[_0x7556('0x27')](saveUpdates(_0x5002eb['body'],null))[_0x7556('0x27')](respondWithResult(_0x28c460,null))['catch'](handleError(_0x28c460,null));};exports[_0x7556('0x28')]=function(_0x41c649,_0x8d140a){return db[_0x7556('0x30')][_0x7556('0x49')]({'where':{'id':_0x41c649['params']['id']}})['then'](handleEntityNotFound(_0x8d140a,null))[_0x7556('0x27')](removeEntity(_0x8d140a,null))['catch'](handleError(_0x8d140a,null));}; \ No newline at end of file +var _0xb5e1=['attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','CmHopperAdditionalPhone','findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','end','error','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x153b6f,_0x324ea4){var _0x15809b=function(_0x3a26b4){while(--_0x3a26b4){_0x153b6f['push'](_0x153b6f['shift']());}};_0x15809b(++_0x324ea4);}(_0xb5e1,0x168));var _0x1b5e=function(_0x4f6885,_0x10b682){_0x4f6885=_0x4f6885-0x0;var _0x5817a7=_0xb5e1[_0x4f6885];return _0x5817a7;};'use strict';var emlformat=require(_0x1b5e('0x0'));var rimraf=require(_0x1b5e('0x1'));var zipdir=require(_0x1b5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b5e('0x3'));var moment=require(_0x1b5e('0x4'));var BPromise=require(_0x1b5e('0x5'));var Mustache=require('mustache');var util=require(_0x1b5e('0x6'));var path=require(_0x1b5e('0x7'));var sox=require(_0x1b5e('0x8'));var csv=require(_0x1b5e('0x9'));var ejs=require(_0x1b5e('0xa'));var fs=require('fs');var fs_extra=require(_0x1b5e('0xb'));var _=require(_0x1b5e('0xc'));var squel=require(_0x1b5e('0xd'));var crypto=require(_0x1b5e('0xe'));var jsforce=require(_0x1b5e('0xf'));var deskjs=require(_0x1b5e('0x10'));var toCsv=require(_0x1b5e('0x9'));var querystring=require(_0x1b5e('0x11'));var Papa=require(_0x1b5e('0x12'));var Redis=require('ioredis');var authService=require(_0x1b5e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b5e('0x14'));var logger=require(_0x1b5e('0x15'))(_0x1b5e('0x16'));var utils=require('../../config/utils');var config=require(_0x1b5e('0x17'));var licenseUtil=require(_0x1b5e('0x18'));var db=require(_0x1b5e('0x19'))['db'];function respondWithStatusCode(_0x2fd552,_0x427098){_0x427098=_0x427098||0xcc;return function(_0x4f123f){if(_0x4f123f){return _0x2fd552['sendStatus'](_0x427098);}return _0x2fd552[_0x1b5e('0x1a')](_0x427098)['end']();};}function respondWithResult(_0x4cd302,_0x9f1c62){_0x9f1c62=_0x9f1c62||0xc8;return function(_0x39a81a){if(_0x39a81a){return _0x4cd302[_0x1b5e('0x1a')](_0x9f1c62)[_0x1b5e('0x1b')](_0x39a81a);}};}function respondWithFilteredResult(_0x59b807,_0x12413f){return function(_0x113f25){if(_0x113f25){var _0x45cb06=typeof _0x12413f['offset']===_0x1b5e('0x1c')&&typeof _0x12413f['limit']===_0x1b5e('0x1c');var _0x5c7090=_0x113f25[_0x1b5e('0x1d')];var _0x43130c=_0x45cb06?0x0:_0x12413f['offset'];var _0xc195c4=_0x45cb06?_0x113f25['count']:_0x12413f[_0x1b5e('0x1e')]+_0x12413f[_0x1b5e('0x1f')];var _0x4dc90a;if(_0xc195c4>=_0x5c7090){_0xc195c4=_0x5c7090;_0x4dc90a=0xc8;}else{_0x4dc90a=0xce;}_0x59b807[_0x1b5e('0x1a')](_0x4dc90a);return _0x59b807[_0x1b5e('0x20')](_0x1b5e('0x21'),_0x43130c+'-'+_0xc195c4+'/'+_0x5c7090)[_0x1b5e('0x1b')](_0x113f25);}return null;};}function patchUpdates(_0x3805a8){return function(_0x59cafe){try{jsonpatch[_0x1b5e('0x22')](_0x59cafe,_0x3805a8,!![]);}catch(_0x58257e){return BPromise[_0x1b5e('0x23')](_0x58257e);}return _0x59cafe[_0x1b5e('0x24')]();};}function saveUpdates(_0x1ad363,_0x3eb494){return function(_0x4e2222){if(_0x4e2222){return _0x4e2222[_0x1b5e('0x25')](_0x1ad363)[_0x1b5e('0x26')](function(_0x170c66){return _0x170c66;});}return null;};}function removeEntity(_0x1095ac,_0x1f0b79){return function(_0x46a2e7){if(_0x46a2e7){return _0x46a2e7[_0x1b5e('0x27')]()[_0x1b5e('0x26')](function(){var _0x1932ce=_0x46a2e7[_0x1b5e('0x28')]({'plain':!![]});var _0x2028fb=_0x1b5e('0x29');return db['UserProfileResource'][_0x1b5e('0x27')]({'where':{'type':_0x2028fb,'resourceId':_0x1932ce['id']}})[_0x1b5e('0x26')](function(){return _0x46a2e7;});})[_0x1b5e('0x26')](function(){_0x1095ac[_0x1b5e('0x1a')](0xcc)[_0x1b5e('0x2a')]();});}};}function handleEntityNotFound(_0x4feb5b,_0x405c36){return function(_0x4b9278){if(!_0x4b9278){_0x4feb5b['sendStatus'](0x194);}return _0x4b9278;};}function handleError(_0x685abc,_0x5b286e){_0x5b286e=_0x5b286e||0x1f4;return function(_0x30bf2e){logger[_0x1b5e('0x2b')](_0x30bf2e['stack']);if(_0x30bf2e['name']){delete _0x30bf2e[_0x1b5e('0x2c')];}_0x685abc[_0x1b5e('0x1a')](_0x5b286e)[_0x1b5e('0x2d')](_0x30bf2e);};}exports[_0x1b5e('0x2e')]=function(_0x2d9341,_0x2e3322){var _0x46fc2f={},_0x8d9ab4={},_0x5078d6={'count':0x0,'rows':[]};var _0x51aa38=_['map'](db['CmHopperAdditionalPhone'][_0x1b5e('0x2f')],function(_0x34acf0){return{'name':_0x34acf0[_0x1b5e('0x30')],'type':_0x34acf0[_0x1b5e('0x31')][_0x1b5e('0x32')]};});_0x8d9ab4[_0x1b5e('0x33')]=_['map'](_0x51aa38,_0x1b5e('0x2c'));_0x8d9ab4[_0x1b5e('0x34')]=_[_0x1b5e('0x35')](_0x2d9341[_0x1b5e('0x34')]);_0x8d9ab4['filters']=_[_0x1b5e('0x36')](_0x8d9ab4[_0x1b5e('0x33')],_0x8d9ab4[_0x1b5e('0x34')]);_0x46fc2f['attributes']=_[_0x1b5e('0x36')](_0x8d9ab4[_0x1b5e('0x33')],qs['fields'](_0x2d9341['query']['fields']));_0x46fc2f[_0x1b5e('0x37')]=_0x46fc2f[_0x1b5e('0x37')][_0x1b5e('0x38')]?_0x46fc2f['attributes']:_0x8d9ab4['model'];if(!_0x2d9341[_0x1b5e('0x34')][_0x1b5e('0x39')](_0x1b5e('0x3a'))){_0x46fc2f[_0x1b5e('0x1f')]=qs['limit'](_0x2d9341['query'][_0x1b5e('0x1f')]);_0x46fc2f[_0x1b5e('0x1e')]=qs[_0x1b5e('0x1e')](_0x2d9341[_0x1b5e('0x34')][_0x1b5e('0x1e')]);}_0x46fc2f['order']=qs[_0x1b5e('0x3b')](_0x2d9341[_0x1b5e('0x34')]['sort']);_0x46fc2f[_0x1b5e('0x3c')]=qs[_0x1b5e('0x3d')](_[_0x1b5e('0x3e')](_0x2d9341['query'],_0x8d9ab4[_0x1b5e('0x3d')]),_0x51aa38);if(_0x2d9341[_0x1b5e('0x34')][_0x1b5e('0x3f')]){_0x46fc2f[_0x1b5e('0x3c')]=_[_0x1b5e('0x40')](_0x46fc2f['where'],{'$or':_['map'](_0x51aa38,function(_0x320115){if(_0x320115[_0x1b5e('0x31')]!=='VIRTUAL'){var _0x13cf2b={};_0x13cf2b[_0x320115[_0x1b5e('0x2c')]]={'$like':'%'+_0x2d9341[_0x1b5e('0x34')][_0x1b5e('0x3f')]+'%'};return _0x13cf2b;}})});}_0x46fc2f=_[_0x1b5e('0x40')]({},_0x46fc2f,_0x2d9341[_0x1b5e('0x41')]);var _0x2955c2={'where':_0x46fc2f['where']};return db['CmHopperAdditionalPhone'][_0x1b5e('0x1d')](_0x2955c2)[_0x1b5e('0x26')](function(_0x358682){_0x5078d6[_0x1b5e('0x1d')]=_0x358682;if(_0x2d9341[_0x1b5e('0x34')][_0x1b5e('0x42')]){_0x46fc2f['include']=[{'all':!![]}];}return db[_0x1b5e('0x43')][_0x1b5e('0x44')](_0x46fc2f);})[_0x1b5e('0x26')](function(_0x119da4){_0x5078d6[_0x1b5e('0x45')]=_0x119da4;return _0x5078d6;})[_0x1b5e('0x26')](respondWithFilteredResult(_0x2e3322,_0x46fc2f))[_0x1b5e('0x46')](handleError(_0x2e3322,null));};exports[_0x1b5e('0x47')]=function(_0x995d78,_0x4dcda5){var _0x34a873={'raw':!![],'where':{'id':_0x995d78[_0x1b5e('0x48')]['id']}},_0x1fa283={};_0x1fa283[_0x1b5e('0x33')]=_[_0x1b5e('0x35')](db[_0x1b5e('0x43')][_0x1b5e('0x2f')]);_0x1fa283['query']=_['keys'](_0x995d78[_0x1b5e('0x34')]);_0x1fa283['filters']=_[_0x1b5e('0x36')](_0x1fa283[_0x1b5e('0x33')],_0x1fa283[_0x1b5e('0x34')]);_0x34a873[_0x1b5e('0x37')]=_[_0x1b5e('0x36')](_0x1fa283[_0x1b5e('0x33')],qs[_0x1b5e('0x49')](_0x995d78['query'][_0x1b5e('0x49')]));_0x34a873[_0x1b5e('0x37')]=_0x34a873[_0x1b5e('0x37')][_0x1b5e('0x38')]?_0x34a873['attributes']:_0x1fa283['model'];if(_0x995d78[_0x1b5e('0x34')][_0x1b5e('0x42')]){_0x34a873['include']=[{'all':!![]}];}_0x34a873=_[_0x1b5e('0x40')]({},_0x34a873,_0x995d78[_0x1b5e('0x41')]);return db[_0x1b5e('0x43')][_0x1b5e('0x4a')](_0x34a873)['then'](handleEntityNotFound(_0x4dcda5,null))[_0x1b5e('0x26')](respondWithResult(_0x4dcda5,null))[_0x1b5e('0x46')](handleError(_0x4dcda5,null));};exports[_0x1b5e('0x4b')]=function(_0x1e3a96,_0x1a7fc5){return db[_0x1b5e('0x43')][_0x1b5e('0x4b')](_0x1e3a96[_0x1b5e('0x4c')],{})[_0x1b5e('0x26')](function(_0x172060){var _0x30ffd6=_0x1e3a96[_0x1b5e('0x4d')][_0x1b5e('0x28')]({'plain':!![]});if(!_0x30ffd6)throw new Error(_0x1b5e('0x4e'));if(_0x30ffd6[_0x1b5e('0x4f')]===_0x1b5e('0x4d')){var _0x37fb8e=_0x172060['get']({'plain':!![]});var _0x598862=_0x1b5e('0x29');return db['UserProfileSection'][_0x1b5e('0x4a')]({'where':{'name':_0x598862,'userProfileId':_0x30ffd6[_0x1b5e('0x50')]},'raw':!![]})[_0x1b5e('0x26')](function(_0x21a066){if(_0x21a066&&_0x21a066[_0x1b5e('0x51')]===0x0){return db[_0x1b5e('0x52')][_0x1b5e('0x4b')]({'name':_0x37fb8e['name'],'resourceId':_0x37fb8e['id'],'type':_0x21a066[_0x1b5e('0x2c')],'sectionId':_0x21a066['id']},{})[_0x1b5e('0x26')](function(){return _0x172060;});}else{return _0x172060;}})['catch'](function(_0x19ff6e){logger[_0x1b5e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19ff6e);throw _0x19ff6e;});}return _0x172060;})[_0x1b5e('0x26')](respondWithResult(_0x1a7fc5,0xc9))[_0x1b5e('0x46')](handleError(_0x1a7fc5,null));};exports[_0x1b5e('0x25')]=function(_0x48842b,_0x1afbb3){if(_0x48842b[_0x1b5e('0x4c')]['id']){delete _0x48842b['body']['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x48842b[_0x1b5e('0x48')]['id']}})[_0x1b5e('0x26')](handleEntityNotFound(_0x1afbb3,null))[_0x1b5e('0x26')](saveUpdates(_0x48842b[_0x1b5e('0x4c')],null))['then'](respondWithResult(_0x1afbb3,null))[_0x1b5e('0x46')](handleError(_0x1afbb3,null));};exports[_0x1b5e('0x27')]=function(_0x1b6309,_0x42493b){return db[_0x1b5e('0x43')][_0x1b5e('0x4a')]({'where':{'id':_0x1b6309[_0x1b5e('0x48')]['id']}})[_0x1b5e('0x26')](handleEntityNotFound(_0x42493b,null))[_0x1b5e('0x26')](removeEntity(_0x42493b,null))[_0x1b5e('0x46')](handleError(_0x42493b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 726ca94..a4fb08e 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 _0x3d8f=['bluebird','request-promise','path','rimraf','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger','moment'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x3d8f,0x1d3));var _0xf3d8=function(_0x9514c3,_0x2ee0b0){_0x9514c3=_0x9514c3-0x0;var _0x23a47d=_0x3d8f[_0x9514c3];return _0x23a47d;};'use strict';var _=require('lodash');var util=require(_0xf3d8('0x0'));var logger=require(_0xf3d8('0x1'))('api');var moment=require(_0xf3d8('0x2'));var BPromise=require(_0xf3d8('0x3'));var rp=require(_0xf3d8('0x4'));var fs=require('fs');var path=require(_0xf3d8('0x5'));var rimraf=require(_0xf3d8('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x2f3410,_0x30a6c5){return _0x2f3410[_0xf3d8('0x7')](_0xf3d8('0x8'),attributes,{'tableName':_0xf3d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36fe=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x4a746b,_0x2864fc){var _0x2ad77b=function(_0x22abd2){while(--_0x22abd2){_0x4a746b['push'](_0x4a746b['shift']());}};_0x2ad77b(++_0x2864fc);}(_0x36fe,0x17b));var _0xe36f=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0x36fe[_0x3132e8];return _0x43eb8c;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var logger=require(_0xe36f('0x2'))(_0xe36f('0x3'));var moment=require(_0xe36f('0x4'));var BPromise=require(_0xe36f('0x5'));var rp=require(_0xe36f('0x6'));var fs=require('fs');var path=require(_0xe36f('0x7'));var rimraf=require(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var attributes=require(_0xe36f('0xa'));module[_0xe36f('0xb')]=function(_0x24e508,_0x2a4d54){return _0x24e508[_0xe36f('0xc')](_0xe36f('0xd'),attributes,{'tableName':_0xe36f('0xe'),'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 97b07ca..5152f19 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 _0xdb89=['IncrementPreviewCounters','field','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','countdropretry','catch','SwapAdditionalPhones','duration','isNil','scheduledat','minutes','add','countcongestionretry','createdAt','phone','updatedAt','sequelize','update'];(function(_0x47a164,_0x349d82){var _0x558bef=function(_0x30a6ea){while(--_0x30a6ea){_0x47a164['push'](_0x47a164['shift']());}};_0x558bef(++_0x349d82);}(_0xdb89,0xda));var _0x9db8=function(_0x5e5311,_0x140960){_0x5e5311=_0x5e5311-0x0;var _0x550c66=_0xdb89[_0x5e5311];return _0x550c66;};'use strict';var _=require(_0x9db8('0x0'));var util=require(_0x9db8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9db8('0x2'));var fs=require('fs');var Redis=require(_0x9db8('0x3'));var db=require(_0x9db8('0x4'))['db'];var utils=require(_0x9db8('0x5'));var logger=require(_0x9db8('0x6'))(_0x9db8('0x7'));var config=require(_0x9db8('0x8'));var jayson=require(_0x9db8('0x9'));var client=jayson['client'][_0x9db8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4752c8,_0x415729,_0x3584dd){return new BPromise(function(_0x5ba844,_0x129e7b){return client[_0x9db8('0xb')](_0x4752c8,_0x3584dd)[_0x9db8('0xc')](function(_0x407197){logger['info'](_0x9db8('0xd'),_0x415729,_0x9db8('0xe'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x415729,_0x9db8('0xe'),JSON[_0x9db8('0xf')](_0x407197));if(_0x407197[_0x9db8('0x10')]){if(_0x407197[_0x9db8('0x10')][_0x9db8('0x11')]===0x1f4){logger[_0x9db8('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x415729,_0x407197[_0x9db8('0x10')][_0x9db8('0x12')]);return _0x129e7b(_0x407197['error']['message']);}logger[_0x9db8('0x10')](_0x9db8('0xd'),_0x415729,_0x407197[_0x9db8('0x10')][_0x9db8('0x12')]);return _0x5ba844(_0x407197[_0x9db8('0x10')][_0x9db8('0x12')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x415729,_0x9db8('0xe'));_0x5ba844(_0x407197['result'][_0x9db8('0x12')]);}})['catch'](function(_0x1aa9db){logger[_0x9db8('0x10')](_0x9db8('0xd'),_0x415729,_0x1aa9db);_0x129e7b(_0x1aa9db);});});}exports[_0x9db8('0x13')]=function(_0x5632c3){var _0x4feda2=this;return new Promise(function(_0x136621,_0x2442d5){return db[_0x9db8('0x14')][_0x9db8('0x15')]({'raw':!![],'where':{'ContactId':_0x5632c3['body'][_0x9db8('0x16')],'ListId':_0x5632c3[_0x9db8('0x17')][_0x9db8('0x18')],'VoiceQueueId':_0x5632c3[_0x9db8('0x17')][_0x9db8('0x19')]===undefined?null:_0x5632c3[_0x9db8('0x17')]['VoiceQueueId'],'CampaignId':_0x5632c3[_0x9db8('0x17')][_0x9db8('0x1a')]===undefined?null:_0x5632c3[_0x9db8('0x17')][_0x9db8('0x1a')]}})['then'](function(_0x5495f9){if(_0x5495f9!=null){return db[_0x9db8('0x1b')][_0x9db8('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5495f9['id'],'OrderBy':{'$gt':_0x5495f9[_0x9db8('0x1c')]}},'order':[[_0x9db8('0x1c'),_0x9db8('0x1d')]]})[_0x9db8('0xc')](function(_0x581627){var _0x1bfe7a=0x0;if(_0x581627){if(_0x581627[_0x9db8('0x1e')]+_0x581627['countcongestionretry']+_0x581627['countnoanswerretry']+_0x581627[_0x9db8('0x1f')]+_0x581627['countdropretry']+_0x581627[_0x9db8('0x20')]+_0x581627[_0x9db8('0x21')]+_0x581627[_0x9db8('0x22')]<_0x5632c3[_0x9db8('0x23')][_0x9db8('0x24')])_0x1bfe7a=0x1;_0x136621({'additional':_0x1bfe7a});}else{return db['CmHopperAdditionalPhone'][_0x9db8('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5495f9['id']},'order':[[_0x9db8('0x1c'),'ASC']]})[_0x9db8('0xc')](function(_0x418c17){var _0x4a5e54=0x0;if(_0x418c17){if(_0x418c17[_0x9db8('0x1e')]+_0x418c17['countcongestionretry']+_0x418c17[_0x9db8('0x25')]+_0x418c17['countnosuchnumberretry']+_0x418c17[_0x9db8('0x26')]+_0x418c17[_0x9db8('0x20')]+_0x418c17[_0x9db8('0x21')]+_0x418c17[_0x9db8('0x22')]<_0x5632c3[_0x9db8('0x23')][_0x9db8('0x24')])_0x4a5e54=0x1;_0x136621({'additional':_0x4a5e54});}else{_0x136621({'additional':0x0});}})[_0x9db8('0x27')](function(_0xa9cc06){logger[_0x9db8('0x10')](_0x9db8('0x13'),_0xa9cc06[_0x9db8('0x12')]);_0x2442d5(_0x4feda2[_0x9db8('0x10')](0x1f4,_0xa9cc06[_0x9db8('0x12')]));});}})[_0x9db8('0x27')](function(_0x20b4f4){logger['error'](_0x9db8('0x13'),_0x20b4f4[_0x9db8('0x12')]);_0x2442d5(_0x4feda2['error'](0x1f4,_0x20b4f4[_0x9db8('0x12')]));});}else _0x136621({'additional':0x0});});});};exports[_0x9db8('0x28')]=function(_0xc6dbfe){var _0xd4c25a=this;return new Promise(function(_0x5ad7de,_0x3163b2){return db[_0x9db8('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0xc6dbfe[_0x9db8('0x17')][_0x9db8('0x16')],'ListId':_0xc6dbfe[_0x9db8('0x17')][_0x9db8('0x18')],'VoiceQueueId':_0xc6dbfe['body'][_0x9db8('0x19')]===undefined?null:_0xc6dbfe[_0x9db8('0x17')]['VoiceQueueId'],'CampaignId':_0xc6dbfe[_0x9db8('0x17')][_0x9db8('0x1a')]===undefined?null:_0xc6dbfe['body'][_0x9db8('0x1a')]}})['then'](function(_0x27bfe9){if(_0x27bfe9!=null){return db[_0x9db8('0x1b')][_0x9db8('0x15')]({'raw':!![],'where':{'CmHopperId':_0x27bfe9['id'],'OrderBy':{'$gte':_0x27bfe9['OrderBy']}},'order':[[_0x9db8('0x1c'),'ASC']]})[_0x9db8('0xc')](function(_0x21c687){if(_0x21c687)return activateAdditionalPhone(_0x27bfe9,_0xc6dbfe[_0x9db8('0x17')],_0x21c687,_0xc6dbfe['duration'],_0xc6dbfe['waitTime'])['then'](function(_0x27c982){_0x5ad7de(_0x27c982);});else{return db['CmHopperAdditionalPhone'][_0x9db8('0x15')]({'raw':!![],'where':{'CmHopperId':_0x27bfe9['id']},'order':[[_0x9db8('0x1c'),_0x9db8('0x1d')]]})[_0x9db8('0xc')](function(_0x13236d){if(_0x13236d)return activateAdditionalPhone(_0x27bfe9,_0xc6dbfe['body'],_0x13236d,_0xc6dbfe[_0x9db8('0x29')],_0xc6dbfe['waitTime'])['then'](function(_0x3751c8){_0x5ad7de(_0x3751c8);});else{_0x5ad7de({'id':_0x27bfe9['id'],'phone':''});}})[_0x9db8('0x27')](function(_0x21664d){logger[_0x9db8('0x10')](_0x9db8('0x13'),_0x21664d[_0x9db8('0x12')]);_0x3163b2(_0xd4c25a[_0x9db8('0x10')](0x1f4,_0x21664d['message']));});}})[_0x9db8('0x27')](function(_0x8a4e43){logger[_0x9db8('0x10')](_0x9db8('0x13'),_0x8a4e43[_0x9db8('0x12')]);_0x3163b2(_0xd4c25a[_0x9db8('0x10')](0x1f4,_0x8a4e43[_0x9db8('0x12')]));});}else _0x5ad7de(0x1);});});};function activateAdditionalPhone(_0x16d2fb,_0x528c7e,_0x369a2c,_0x1911b2,_0x452374){return new Promise(function(_0x499fcf,_0x28c4d5){var _0x566fac;if(_[_0x9db8('0x2a')](_0x369a2c[_0x9db8('0x2b')])){_0x369a2c['scheduledat']=moment();}if(moment()>moment(_0x369a2c[_0x9db8('0x2b')])){_0x566fac=moment()['add'](_0x452374||0x3,_0x9db8('0x2c'));}else{if(_0x369a2c['OrderBy']==0x0){_0x566fac=moment(_0x369a2c['scheduledat']);}else{_0x566fac=moment()[_0x9db8('0x2d')](_0x452374||0x3,_0x9db8('0x2c'));}}if(_[_0x9db8('0x2a')](_0x566fac)){_0x566fac=moment()[_0x9db8('0x2d')](_0x452374||0x3,_0x9db8('0x2c'));}var _0x33c2f6={'phone':_0x16d2fb['phone'],'active':0x0,'OrderBy':_['isNil'](_0x16d2fb['OrderBy'])?0x0:_0x16d2fb['OrderBy'],'scheduledat':moment()['add'](_0x1911b2||0x1,'minutes'),'countbusyretry':_0x528c7e[_0x9db8('0x1e')],'countcongestionretry':_0x528c7e[_0x9db8('0x2e')],'countnoanswerretry':_0x528c7e[_0x9db8('0x25')],'countnosuchnumberretry':_0x528c7e[_0x9db8('0x1f')],'countdropretry':_0x528c7e[_0x9db8('0x26')],'countabandonedretry':_0x528c7e[_0x9db8('0x20')],'countmachineretry':_0x528c7e['countmachineretry'],'countagentrejectretry':_0x528c7e['countagentrejectretry'],'createdAt':_0x528c7e[_0x9db8('0x2f')],'updatedAt':_0x528c7e['updatedAt']};var _0x3c50ac={'CmHopperId':_0x16d2fb['id'],'phone':_0x369a2c[_0x9db8('0x30')],'active':0x0,'OrderBy':_[_0x9db8('0x2a')](_0x369a2c[_0x9db8('0x1c')])?0x0:_0x369a2c[_0x9db8('0x1c')],'scheduledat':_0x566fac,'countbusyretry':_0x369a2c[_0x9db8('0x1e')],'countcongestionretry':_0x369a2c[_0x9db8('0x2e')],'countnoanswerretry':_0x369a2c[_0x9db8('0x25')],'countnosuchnumberretry':_0x369a2c['countnosuchnumberretry'],'countdropretry':_0x369a2c[_0x9db8('0x26')],'countabandonedretry':_0x369a2c['countabandonedretry'],'countmachineretry':_0x369a2c['countmachineretry'],'countagentrejectretry':_0x369a2c[_0x9db8('0x22')],'createdAt':_0x369a2c['createdAt'],'updatedAt':_0x369a2c[_0x9db8('0x31')]};return db[_0x9db8('0x32')]['transaction'](function(_0x5c5d15){return db['CmHopperAdditionalPhone'][_0x9db8('0x33')](_0x33c2f6,{'where':{'id':_0x369a2c['id']}},{'transaction':_0x5c5d15})[_0x9db8('0xc')](function(){return db[_0x9db8('0x14')][_0x9db8('0x33')](_0x3c50ac,{'where':{'id':_0x16d2fb['id']}},{'transaction':_0x5c5d15});});})['then'](function(_0x4c89be){_0x499fcf({'id':_0x16d2fb['id'],'phone':_0x369a2c[_0x9db8('0x30')]});})[_0x9db8('0x27')](function(_0xdb1b98){logger[_0x9db8('0x10')]('activateAdditionalPhone',_0xdb1b98[_0x9db8('0x12')]);_0x28c4d5({'error':_0xdb1b98[_0x9db8('0x12')]});});});}exports[_0x9db8('0x34')]=function(_0x556099){var _0x444fda=this;return new Promise(function(_0x4ee0ea,_0x3fe3d5){return db[_0x9db8('0x14')][_0x9db8('0x33')](_0x556099[_0x9db8('0x17')][_0x9db8('0x35')],{'where':{'id':_0x556099[_0x9db8('0x17')]['id']}})[_0x9db8('0xc')](function(_0x48f3fa){_0x4ee0ea(_0x48f3fa);})[_0x9db8('0x27')](function(_0x29a79d){logger['error'](_0x9db8('0x34'),_0x29a79d[_0x9db8('0x12')]);_0x3fe3d5(_0x444fda[_0x9db8('0x10')](0x1f4,_0x29a79d[_0x9db8('0x12')]));});});}; \ No newline at end of file +var _0xfec7=['client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','catch','VerifyAdditionalPhones','ContactId','duration','scheduledat','add','minutes','isNil','createdAt','phone','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x104aea,_0x541bf1){var _0x472ade=function(_0x364e88){while(--_0x364e88){_0x104aea['push'](_0x104aea['shift']());}};_0x472ade(++_0x541bf1);}(_0xfec7,0x147));var _0x7fec=function(_0x2b3668,_0x1e0f28){_0x2b3668=_0x2b3668-0x0;var _0x1f23dd=_0xfec7[_0x2b3668];return _0x1f23dd;};'use strict';var _=require(_0x7fec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7fec('0x1'));var rs=require(_0x7fec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fec('0x3'))['db'];var utils=require(_0x7fec('0x4'));var logger=require(_0x7fec('0x5'))(_0x7fec('0x6'));var config=require(_0x7fec('0x7'));var jayson=require(_0x7fec('0x8'));var client=jayson[_0x7fec('0x9')][_0x7fec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35d883,_0x3c314a,_0x2b62a2){return new BPromise(function(_0x56262b,_0x26d94b){return client[_0x7fec('0xb')](_0x35d883,_0x2b62a2)[_0x7fec('0xc')](function(_0x4e578f){logger['info'](_0x7fec('0xd'),_0x3c314a,'request\x20sent');logger[_0x7fec('0xe')](_0x7fec('0xf'),_0x3c314a,_0x7fec('0x10'),JSON[_0x7fec('0x11')](_0x4e578f));if(_0x4e578f['error']){if(_0x4e578f[_0x7fec('0x12')]['code']===0x1f4){logger[_0x7fec('0x12')](_0x7fec('0xd'),_0x3c314a,_0x4e578f[_0x7fec('0x12')][_0x7fec('0x13')]);return _0x26d94b(_0x4e578f[_0x7fec('0x12')][_0x7fec('0x13')]);}logger[_0x7fec('0x12')](_0x7fec('0xd'),_0x3c314a,_0x4e578f[_0x7fec('0x12')]['message']);return _0x56262b(_0x4e578f['error']['message']);}else{logger[_0x7fec('0x14')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3c314a,_0x7fec('0x10'));_0x56262b(_0x4e578f[_0x7fec('0x15')]['message']);}})['catch'](function(_0x155223){logger['error'](_0x7fec('0xd'),_0x3c314a,_0x155223);_0x26d94b(_0x155223);});});}exports['VerifyAdditionalPhones']=function(_0x3a029d){var _0x5455a5=this;return new Promise(function(_0x19d9ee,_0x3f0772){return db[_0x7fec('0x16')][_0x7fec('0x17')]({'raw':!![],'where':{'ContactId':_0x3a029d[_0x7fec('0x18')]['ContactId'],'ListId':_0x3a029d[_0x7fec('0x18')][_0x7fec('0x19')],'VoiceQueueId':_0x3a029d['body'][_0x7fec('0x1a')]===undefined?null:_0x3a029d['body']['VoiceQueueId'],'CampaignId':_0x3a029d[_0x7fec('0x18')][_0x7fec('0x1b')]===undefined?null:_0x3a029d[_0x7fec('0x18')][_0x7fec('0x1b')]}})[_0x7fec('0xc')](function(_0x3dc493){if(_0x3dc493!=null){return db[_0x7fec('0x1c')][_0x7fec('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3dc493['id'],'OrderBy':{'$gt':_0x3dc493[_0x7fec('0x1d')]}},'order':[[_0x7fec('0x1d'),_0x7fec('0x1e')]]})[_0x7fec('0xc')](function(_0xaf4fab){var _0x56afaf=0x0;if(_0xaf4fab){if(_0xaf4fab[_0x7fec('0x1f')]+_0xaf4fab[_0x7fec('0x20')]+_0xaf4fab[_0x7fec('0x21')]+_0xaf4fab['countnosuchnumberretry']+_0xaf4fab[_0x7fec('0x22')]+_0xaf4fab['countabandonedretry']+_0xaf4fab[_0x7fec('0x23')]+_0xaf4fab['countagentrejectretry']<_0x3a029d[_0x7fec('0x24')][_0x7fec('0x25')])_0x56afaf=0x1;_0x19d9ee({'additional':_0x56afaf});}else{return db[_0x7fec('0x1c')][_0x7fec('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3dc493['id']},'order':[[_0x7fec('0x1d'),'ASC']]})[_0x7fec('0xc')](function(_0x543ff4){var _0x40b830=0x0;if(_0x543ff4){if(_0x543ff4[_0x7fec('0x1f')]+_0x543ff4[_0x7fec('0x20')]+_0x543ff4[_0x7fec('0x21')]+_0x543ff4[_0x7fec('0x26')]+_0x543ff4[_0x7fec('0x22')]+_0x543ff4[_0x7fec('0x27')]+_0x543ff4[_0x7fec('0x23')]+_0x543ff4[_0x7fec('0x28')]<_0x3a029d[_0x7fec('0x24')][_0x7fec('0x25')])_0x40b830=0x1;_0x19d9ee({'additional':_0x40b830});}else{_0x19d9ee({'additional':0x0});}})['catch'](function(_0x7d66d){logger[_0x7fec('0x12')]('VerifyAdditionalPhones',_0x7d66d[_0x7fec('0x13')]);_0x3f0772(_0x5455a5[_0x7fec('0x12')](0x1f4,_0x7d66d[_0x7fec('0x13')]));});}})[_0x7fec('0x29')](function(_0x4a4b45){logger[_0x7fec('0x12')](_0x7fec('0x2a'),_0x4a4b45[_0x7fec('0x13')]);_0x3f0772(_0x5455a5[_0x7fec('0x12')](0x1f4,_0x4a4b45['message']));});}else _0x19d9ee({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x18b297){var _0x5c9915=this;return new Promise(function(_0x10208b,_0x32f54b){return db['CmHopper'][_0x7fec('0x17')]({'raw':!![],'where':{'ContactId':_0x18b297[_0x7fec('0x18')][_0x7fec('0x2b')],'ListId':_0x18b297[_0x7fec('0x18')][_0x7fec('0x19')],'VoiceQueueId':_0x18b297['body'][_0x7fec('0x1a')]===undefined?null:_0x18b297[_0x7fec('0x18')][_0x7fec('0x1a')],'CampaignId':_0x18b297[_0x7fec('0x18')][_0x7fec('0x1b')]===undefined?null:_0x18b297[_0x7fec('0x18')][_0x7fec('0x1b')]}})[_0x7fec('0xc')](function(_0x3cf6c5){if(_0x3cf6c5!=null){return db[_0x7fec('0x1c')][_0x7fec('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3cf6c5['id'],'OrderBy':{'$gte':_0x3cf6c5['OrderBy']}},'order':[[_0x7fec('0x1d'),_0x7fec('0x1e')]]})[_0x7fec('0xc')](function(_0xff287b){if(_0xff287b)return activateAdditionalPhone(_0x3cf6c5,_0x18b297[_0x7fec('0x18')],_0xff287b,_0x18b297[_0x7fec('0x2c')],_0x18b297['waitTime'])[_0x7fec('0xc')](function(_0x489385){_0x10208b(_0x489385);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x3cf6c5['id']},'order':[[_0x7fec('0x1d'),_0x7fec('0x1e')]]})['then'](function(_0x4cfb41){if(_0x4cfb41)return activateAdditionalPhone(_0x3cf6c5,_0x18b297[_0x7fec('0x18')],_0x4cfb41,_0x18b297['duration'],_0x18b297['waitTime'])[_0x7fec('0xc')](function(_0x2d3824){_0x10208b(_0x2d3824);});else{_0x10208b({'id':_0x3cf6c5['id'],'phone':''});}})[_0x7fec('0x29')](function(_0x1365d1){logger[_0x7fec('0x12')](_0x7fec('0x2a'),_0x1365d1['message']);_0x32f54b(_0x5c9915[_0x7fec('0x12')](0x1f4,_0x1365d1[_0x7fec('0x13')]));});}})[_0x7fec('0x29')](function(_0x5ed624){logger[_0x7fec('0x12')](_0x7fec('0x2a'),_0x5ed624['message']);_0x32f54b(_0x5c9915[_0x7fec('0x12')](0x1f4,_0x5ed624[_0x7fec('0x13')]));});}else _0x10208b(0x1);});});};function activateAdditionalPhone(_0x443388,_0x512db8,_0x3735be,_0x4bd423,_0x524aec){return new Promise(function(_0xdddf33,_0x160b83){var _0x3323bd;if(_['isNil'](_0x3735be[_0x7fec('0x2d')])){_0x3735be[_0x7fec('0x2d')]=moment();}if(moment()>moment(_0x3735be[_0x7fec('0x2d')])){_0x3323bd=moment()[_0x7fec('0x2e')](_0x524aec||0x3,_0x7fec('0x2f'));}else{if(_0x3735be['OrderBy']==0x0){_0x3323bd=moment(_0x3735be['scheduledat']);}else{_0x3323bd=moment()[_0x7fec('0x2e')](_0x524aec||0x3,_0x7fec('0x2f'));}}if(_[_0x7fec('0x30')](_0x3323bd)){_0x3323bd=moment()[_0x7fec('0x2e')](_0x524aec||0x3,_0x7fec('0x2f'));}var _0x4f3312={'phone':_0x443388['phone'],'active':0x0,'OrderBy':_[_0x7fec('0x30')](_0x443388[_0x7fec('0x1d')])?0x0:_0x443388['OrderBy'],'scheduledat':moment()[_0x7fec('0x2e')](_0x4bd423||0x1,_0x7fec('0x2f')),'countbusyretry':_0x512db8[_0x7fec('0x1f')],'countcongestionretry':_0x512db8['countcongestionretry'],'countnoanswerretry':_0x512db8['countnoanswerretry'],'countnosuchnumberretry':_0x512db8[_0x7fec('0x26')],'countdropretry':_0x512db8[_0x7fec('0x22')],'countabandonedretry':_0x512db8[_0x7fec('0x27')],'countmachineretry':_0x512db8['countmachineretry'],'countagentrejectretry':_0x512db8[_0x7fec('0x28')],'createdAt':_0x512db8[_0x7fec('0x31')],'updatedAt':_0x512db8['updatedAt']};var _0x56961a={'CmHopperId':_0x443388['id'],'phone':_0x3735be[_0x7fec('0x32')],'active':0x0,'OrderBy':_[_0x7fec('0x30')](_0x3735be[_0x7fec('0x1d')])?0x0:_0x3735be[_0x7fec('0x1d')],'scheduledat':_0x3323bd,'countbusyretry':_0x3735be['countbusyretry'],'countcongestionretry':_0x3735be[_0x7fec('0x20')],'countnoanswerretry':_0x3735be[_0x7fec('0x21')],'countnosuchnumberretry':_0x3735be[_0x7fec('0x26')],'countdropretry':_0x3735be['countdropretry'],'countabandonedretry':_0x3735be[_0x7fec('0x27')],'countmachineretry':_0x3735be['countmachineretry'],'countagentrejectretry':_0x3735be[_0x7fec('0x28')],'createdAt':_0x3735be['createdAt'],'updatedAt':_0x3735be[_0x7fec('0x33')]};return db[_0x7fec('0x34')]['transaction'](function(_0x481c0d){return db[_0x7fec('0x1c')]['update'](_0x4f3312,{'where':{'id':_0x3735be['id']}},{'transaction':_0x481c0d})[_0x7fec('0xc')](function(){return db[_0x7fec('0x16')][_0x7fec('0x35')](_0x56961a,{'where':{'id':_0x443388['id']}},{'transaction':_0x481c0d});});})[_0x7fec('0xc')](function(_0x5d71dc){_0xdddf33({'id':_0x443388['id'],'phone':_0x3735be['phone']});})['catch'](function(_0x24a57f){logger[_0x7fec('0x12')](_0x7fec('0x36'),_0x24a57f[_0x7fec('0x13')]);_0x160b83({'error':_0x24a57f[_0x7fec('0x13')]});});});}exports[_0x7fec('0x37')]=function(_0x3b93e6){var _0x318b40=this;return new Promise(function(_0x3916bb,_0x5f02b0){return db[_0x7fec('0x16')]['update'](_0x3b93e6['body']['field'],{'where':{'id':_0x3b93e6[_0x7fec('0x18')]['id']}})['then'](function(_0x140a7b){_0x3916bb(_0x140a7b);})[_0x7fec('0x29')](function(_0xc21574){logger['error'](_0x7fec('0x37'),_0xc21574[_0x7fec('0x13')]);_0x5f02b0(_0x318b40[_0x7fec('0x12')](0x1f4,_0xc21574[_0x7fec('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 38a39bf..e089909 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 _0x37b8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','post','create','update','destroy','exports','multer','util','path','express','Router'];(function(_0x3f2a36,_0x294753){var _0xc265ba=function(_0x180b46){while(--_0x180b46){_0x3f2a36['push'](_0x3f2a36['shift']());}};_0xc265ba(++_0x294753);}(_0x37b8,0x12d));var _0x837b=function(_0x6de9f6,_0x42178a){_0x6de9f6=_0x6de9f6-0x0;var _0x156549=_0x37b8[_0x6de9f6];return _0x156549;};'use strict';var multer=require(_0x837b('0x0'));var util=require(_0x837b('0x1'));var path=require(_0x837b('0x2'));var timeout=require('connect-timeout');var express=require(_0x837b('0x3'));var router=express[_0x837b('0x4')]();var fs_extra=require(_0x837b('0x5'));var auth=require(_0x837b('0x6'));var interaction=require(_0x837b('0x7'));var config=require(_0x837b('0x8'));var controller=require(_0x837b('0x9'));router[_0x837b('0xa')]('/',auth[_0x837b('0xb')](),controller['index']);router[_0x837b('0xa')](_0x837b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x837b('0xd')]('/',auth[_0x837b('0xb')](),controller[_0x837b('0xe')]);router['put'](_0x837b('0xc'),auth[_0x837b('0xb')](),controller[_0x837b('0xf')]);router['delete'](_0x837b('0xc'),auth['isAuthenticated'](),controller[_0x837b('0x10')]);module[_0x837b('0x11')]=router; \ No newline at end of file +var _0x4972=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4972,0x130));var _0x2497=function(_0x37b013,_0x364739){_0x37b013=_0x37b013-0x0;var _0x2f241e=_0x4972[_0x37b013];return _0x2f241e;};'use strict';var multer=require('multer');var util=require(_0x2497('0x0'));var path=require(_0x2497('0x1'));var timeout=require('connect-timeout');var express=require(_0x2497('0x2'));var router=express[_0x2497('0x3')]();var fs_extra=require(_0x2497('0x4'));var auth=require(_0x2497('0x5'));var interaction=require(_0x2497('0x6'));var config=require(_0x2497('0x7'));var controller=require(_0x2497('0x8'));router['get']('/',auth[_0x2497('0x9')](),controller[_0x2497('0xa')]);router['get'](_0x2497('0xb'),auth[_0x2497('0x9')](),controller[_0x2497('0xc')]);router[_0x2497('0xd')]('/',auth[_0x2497('0x9')](),controller[_0x2497('0xe')]);router[_0x2497('0xf')](_0x2497('0xb'),auth['isAuthenticated'](),controller[_0x2497('0x10')]);router[_0x2497('0x11')](_0x2497('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2497('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a4b6c16..75d46f5 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 _0x71c3=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x33eea2,_0x3e526e){var _0x27a5ed=function(_0x38410e){while(--_0x38410e){_0x33eea2['push'](_0x33eea2['shift']());}};_0x27a5ed(++_0x3e526e);}(_0x71c3,0xc6));var _0x371c=function(_0x25e66f,_0x15b9ab){_0x25e66f=_0x25e66f-0x0;var _0x309747=_0x71c3[_0x25e66f];return _0x309747;};'use strict';var moment=require(_0x371c('0x0'));var Sequelize=require(_0x371c('0x1'));module['exports']={'phone':{'type':Sequelize[_0x371c('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x371c('0x3')],'unique':_0x371c('0x4')},'ListId':{'type':Sequelize[_0x371c('0x3')],'unique':_0x371c('0x4')},'VoiceQueueId':{'type':Sequelize[_0x371c('0x3')],'unique':_0x371c('0x4')}}; \ No newline at end of file +var _0x044a=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x252159,_0x1545ee){var _0x17512b=function(_0x2fce69){while(--_0x2fce69){_0x252159['push'](_0x252159['shift']());}};_0x17512b(++_0x1545ee);}(_0x044a,0x173));var _0xa044=function(_0x5ec4df,_0x1de0de){_0x5ec4df=_0x5ec4df-0x0;var _0x4fb5b9=_0x044a[_0x5ec4df];return _0x4fb5b9;};'use strict';var moment=require(_0xa044('0x0'));var Sequelize=require(_0xa044('0x1'));module[_0xa044('0x2')]={'phone':{'type':Sequelize[_0xa044('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa044('0x4')],'unique':_0xa044('0x5')},'ListId':{'type':Sequelize[_0xa044('0x4')],'unique':_0xa044('0x5')},'VoiceQueueId':{'type':Sequelize[_0xa044('0x4')],'unique':_0xa044('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 8bcd5ae..2e6eccf 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 _0xf03d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','model','map','keys','filters','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','find','body','describe','eml-format','rimraf','zip-dir'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xf03d,0x1a7));var _0xdf03=function(_0x259ea4,_0x4a0a1f){_0x259ea4=_0x259ea4-0x0;var _0x3fc910=_0xf03d[_0x259ea4];return _0x3fc910;};'use strict';var emlformat=require(_0xdf03('0x0'));var rimraf=require(_0xdf03('0x1'));var zipdir=require(_0xdf03('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf03('0x3'));var moment=require(_0xdf03('0x4'));var BPromise=require(_0xdf03('0x5'));var Mustache=require(_0xdf03('0x6'));var util=require(_0xdf03('0x7'));var path=require(_0xdf03('0x8'));var sox=require(_0xdf03('0x9'));var csv=require(_0xdf03('0xa'));var ejs=require(_0xdf03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf03('0xc'));var squel=require('squel');var crypto=require(_0xdf03('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdf03('0xe'));var toCsv=require(_0xdf03('0xa'));var querystring=require(_0xdf03('0xf'));var Papa=require(_0xdf03('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdf03('0x11'));var as=require(_0xdf03('0x12'));var hardwareService=require(_0xdf03('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdf03('0x14'));var licenseUtil=require(_0xdf03('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f781d,_0x358892){_0x358892=_0x358892||0xcc;return function(_0x24d1a2){if(_0x24d1a2){return _0x2f781d[_0xdf03('0x16')](_0x358892);}return _0x2f781d[_0xdf03('0x17')](_0x358892)['end']();};}function respondWithResult(_0x5630a1,_0x5b8da2){_0x5b8da2=_0x5b8da2||0xc8;return function(_0x2d99c8){if(_0x2d99c8){return _0x5630a1[_0xdf03('0x17')](_0x5b8da2)[_0xdf03('0x18')](_0x2d99c8);}};}function respondWithFilteredResult(_0x2aa232,_0x5c82e3){return function(_0x43ab5d){if(_0x43ab5d){var _0x1b4b7f=typeof _0x5c82e3[_0xdf03('0x19')]===_0xdf03('0x1a')&&typeof _0x5c82e3[_0xdf03('0x1b')]===_0xdf03('0x1a');var _0x406451=_0x43ab5d[_0xdf03('0x1c')];var _0x4fb72f=_0x1b4b7f?0x0:_0x5c82e3[_0xdf03('0x19')];var _0x5d281a=_0x1b4b7f?_0x43ab5d[_0xdf03('0x1c')]:_0x5c82e3[_0xdf03('0x19')]+_0x5c82e3[_0xdf03('0x1b')];var _0x472b47;if(_0x5d281a>=_0x406451){_0x5d281a=_0x406451;_0x472b47=0xc8;}else{_0x472b47=0xce;}_0x2aa232[_0xdf03('0x17')](_0x472b47);return _0x2aa232[_0xdf03('0x1d')](_0xdf03('0x1e'),_0x4fb72f+'-'+_0x5d281a+'/'+_0x406451)[_0xdf03('0x18')](_0x43ab5d);}return null;};}function patchUpdates(_0x4c5048){return function(_0x2dd5c1){try{jsonpatch[_0xdf03('0x1f')](_0x2dd5c1,_0x4c5048,!![]);}catch(_0x5f1abb){return BPromise[_0xdf03('0x20')](_0x5f1abb);}return _0x2dd5c1['save']();};}function saveUpdates(_0x2b32cc,_0x52e3a2){return function(_0x358836){if(_0x358836){return _0x358836[_0xdf03('0x21')](_0x2b32cc)[_0xdf03('0x22')](function(_0x4a8890){return _0x4a8890;});}return null;};}function removeEntity(_0xca8804,_0x3879f4){return function(_0x87398d){if(_0x87398d){return _0x87398d[_0xdf03('0x23')]()[_0xdf03('0x22')](function(){_0xca8804[_0xdf03('0x17')](0xcc)[_0xdf03('0x24')]();});}};}function handleEntityNotFound(_0x4cc4f3,_0x48c7ee){return function(_0x132035){if(!_0x132035){_0x4cc4f3[_0xdf03('0x16')](0x194);}return _0x132035;};}function handleError(_0x2c61cc,_0x5cd6ce){_0x5cd6ce=_0x5cd6ce||0x1f4;return function(_0x17df6d){logger['error'](_0x17df6d[_0xdf03('0x25')]);if(_0x17df6d[_0xdf03('0x26')]){delete _0x17df6d[_0xdf03('0x26')];}_0x2c61cc[_0xdf03('0x17')](_0x5cd6ce)[_0xdf03('0x27')](_0x17df6d);};}exports[_0xdf03('0x28')]=function(_0x19d26d,_0x3affb7){var _0x1ca481={},_0x587303={},_0x2cc4f0={'count':0x0,'rows':[]};var _0xd1b147=_['map'](db[_0xdf03('0x29')][_0xdf03('0x2a')],function(_0x489bee){return{'name':_0x489bee[_0xdf03('0x2b')],'type':_0x489bee['type']['key']};});_0x587303[_0xdf03('0x2c')]=_[_0xdf03('0x2d')](_0xd1b147,_0xdf03('0x26'));_0x587303['query']=_[_0xdf03('0x2e')](_0x19d26d['query']);_0x587303[_0xdf03('0x2f')]=_['intersection'](_0x587303['model'],_0x587303[_0xdf03('0x30')]);_0x1ca481['attributes']=_['intersection'](_0x587303[_0xdf03('0x2c')],qs['fields'](_0x19d26d[_0xdf03('0x30')][_0xdf03('0x31')]));_0x1ca481['attributes']=_0x1ca481[_0xdf03('0x32')][_0xdf03('0x33')]?_0x1ca481['attributes']:_0x587303[_0xdf03('0x2c')];if(!_0x19d26d[_0xdf03('0x30')]['hasOwnProperty'](_0xdf03('0x34'))){_0x1ca481[_0xdf03('0x1b')]=qs['limit'](_0x19d26d[_0xdf03('0x30')][_0xdf03('0x1b')]);_0x1ca481['offset']=qs[_0xdf03('0x19')](_0x19d26d[_0xdf03('0x30')]['offset']);}_0x1ca481[_0xdf03('0x35')]=qs[_0xdf03('0x36')](_0x19d26d[_0xdf03('0x30')][_0xdf03('0x36')]);_0x1ca481[_0xdf03('0x37')]=qs[_0xdf03('0x2f')](_[_0xdf03('0x38')](_0x19d26d['query'],_0x587303[_0xdf03('0x2f')]),_0xd1b147);if(_0x19d26d[_0xdf03('0x30')][_0xdf03('0x39')]){_0x1ca481[_0xdf03('0x37')]=_[_0xdf03('0x3a')](_0x1ca481[_0xdf03('0x37')],{'$or':_[_0xdf03('0x2d')](_0xd1b147,function(_0x5978d3){if(_0x5978d3[_0xdf03('0x3b')]!==_0xdf03('0x3c')){var _0x1ac94d={};_0x1ac94d[_0x5978d3['name']]={'$like':'%'+_0x19d26d[_0xdf03('0x30')][_0xdf03('0x39')]+'%'};return _0x1ac94d;}})});}_0x1ca481=_[_0xdf03('0x3a')]({},_0x1ca481,_0x19d26d[_0xdf03('0x3d')]);var _0x5cda65={'where':_0x1ca481[_0xdf03('0x37')]};return db[_0xdf03('0x29')][_0xdf03('0x1c')](_0x5cda65)['then'](function(_0x259b85){_0x2cc4f0[_0xdf03('0x1c')]=_0x259b85;if(_0x19d26d[_0xdf03('0x30')][_0xdf03('0x3e')]){_0x1ca481['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1ca481);})[_0xdf03('0x22')](function(_0x1ee49b){_0x2cc4f0[_0xdf03('0x3f')]=_0x1ee49b;return _0x2cc4f0;})[_0xdf03('0x22')](respondWithFilteredResult(_0x3affb7,_0x1ca481))[_0xdf03('0x40')](handleError(_0x3affb7,null));};exports[_0xdf03('0x41')]=function(_0x5e66d9,_0x443373){var _0xe99e4={'raw':!![],'where':{'id':_0x5e66d9[_0xdf03('0x42')]['id']}},_0x3a9d1c={};_0x3a9d1c['model']=_[_0xdf03('0x2e')](db[_0xdf03('0x29')][_0xdf03('0x2a')]);_0x3a9d1c['query']=_['keys'](_0x5e66d9[_0xdf03('0x30')]);_0x3a9d1c[_0xdf03('0x2f')]=_['intersection'](_0x3a9d1c[_0xdf03('0x2c')],_0x3a9d1c[_0xdf03('0x30')]);_0xe99e4['attributes']=_[_0xdf03('0x43')](_0x3a9d1c[_0xdf03('0x2c')],qs[_0xdf03('0x31')](_0x5e66d9[_0xdf03('0x30')][_0xdf03('0x31')]));_0xe99e4[_0xdf03('0x32')]=_0xe99e4[_0xdf03('0x32')]['length']?_0xe99e4[_0xdf03('0x32')]:_0x3a9d1c[_0xdf03('0x2c')];if(_0x5e66d9['query']['includeAll']){_0xe99e4['include']=[{'all':!![]}];}_0xe99e4=_[_0xdf03('0x3a')]({},_0xe99e4,_0x5e66d9[_0xdf03('0x3d')]);return db[_0xdf03('0x29')][_0xdf03('0x44')](_0xe99e4)[_0xdf03('0x22')](handleEntityNotFound(_0x443373,null))[_0xdf03('0x22')](respondWithResult(_0x443373,null))[_0xdf03('0x40')](handleError(_0x443373,null));};exports[_0xdf03('0x21')]=function(_0x314eb1,_0x21a5d2){if(_0x314eb1[_0xdf03('0x45')]['id']){delete _0x314eb1['body']['id'];}return db[_0xdf03('0x29')]['find']({'where':{'id':_0x314eb1[_0xdf03('0x42')]['id']}})[_0xdf03('0x22')](handleEntityNotFound(_0x21a5d2,null))[_0xdf03('0x22')](saveUpdates(_0x314eb1['body'],null))[_0xdf03('0x22')](respondWithResult(_0x21a5d2,null))[_0xdf03('0x40')](handleError(_0x21a5d2,null));};exports[_0xdf03('0x23')]=function(_0x3b0e44,_0x56a92d){return db[_0xdf03('0x29')][_0xdf03('0x44')]({'where':{'id':_0x3b0e44['params']['id']}})['then'](handleEntityNotFound(_0x56a92d,null))[_0xdf03('0x22')](removeEntity(_0x56a92d,null))[_0xdf03('0x40')](handleError(_0x56a92d,null));};exports[_0xdf03('0x46')]=function(_0x30e815,_0x1c87c2){return db['CmHopperBlack'][_0xdf03('0x46')]()[_0xdf03('0x22')](respondWithResult(_0x1c87c2,null))[_0xdf03('0x40')](handleError(_0x1c87c2,null));}; \ No newline at end of file +var _0xb757=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','length','include','body','find','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x41b0a8,_0x1b05cc){var _0x3a83d4=function(_0x3d1011){while(--_0x3d1011){_0x41b0a8['push'](_0x41b0a8['shift']());}};_0x3a83d4(++_0x1b05cc);}(_0xb757,0xf0));var _0x7b75=function(_0x114420,_0x35f783){_0x114420=_0x114420-0x0;var _0x2a9eb7=_0xb757[_0x114420];return _0x2a9eb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b75('0x0'));var zipdir=require(_0x7b75('0x1'));var jsonpatch=require(_0x7b75('0x2'));var rp=require(_0x7b75('0x3'));var moment=require(_0x7b75('0x4'));var BPromise=require(_0x7b75('0x5'));var Mustache=require('mustache');var util=require(_0x7b75('0x6'));var path=require(_0x7b75('0x7'));var sox=require('sox');var csv=require(_0x7b75('0x8'));var ejs=require(_0x7b75('0x9'));var fs=require('fs');var fs_extra=require(_0x7b75('0xa'));var _=require(_0x7b75('0xb'));var squel=require(_0x7b75('0xc'));var crypto=require(_0x7b75('0xd'));var jsforce=require(_0x7b75('0xe'));var deskjs=require(_0x7b75('0xf'));var toCsv=require(_0x7b75('0x8'));var querystring=require('querystring');var Papa=require(_0x7b75('0x10'));var Redis=require(_0x7b75('0x11'));var authService=require(_0x7b75('0x12'));var qs=require(_0x7b75('0x13'));var as=require(_0x7b75('0x14'));var hardwareService=require(_0x7b75('0x15'));var logger=require('../../config/logger')(_0x7b75('0x16'));var utils=require(_0x7b75('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7b75('0x18'))['db'];function respondWithStatusCode(_0x33d44b,_0x4a70a3){_0x4a70a3=_0x4a70a3||0xcc;return function(_0x596dae){if(_0x596dae){return _0x33d44b[_0x7b75('0x19')](_0x4a70a3);}return _0x33d44b[_0x7b75('0x1a')](_0x4a70a3)[_0x7b75('0x1b')]();};}function respondWithResult(_0x463642,_0x160996){_0x160996=_0x160996||0xc8;return function(_0x5a1731){if(_0x5a1731){return _0x463642[_0x7b75('0x1a')](_0x160996)[_0x7b75('0x1c')](_0x5a1731);}};}function respondWithFilteredResult(_0x5a20f0,_0x2f8567){return function(_0x4ca520){if(_0x4ca520){var _0x318bdb=typeof _0x2f8567['offset']===_0x7b75('0x1d')&&typeof _0x2f8567[_0x7b75('0x1e')]==='undefined';var _0x1fafbd=_0x4ca520[_0x7b75('0x1f')];var _0x51be05=_0x318bdb?0x0:_0x2f8567['offset'];var _0x3094d3=_0x318bdb?_0x4ca520[_0x7b75('0x1f')]:_0x2f8567[_0x7b75('0x20')]+_0x2f8567[_0x7b75('0x1e')];var _0x36fee5;if(_0x3094d3>=_0x1fafbd){_0x3094d3=_0x1fafbd;_0x36fee5=0xc8;}else{_0x36fee5=0xce;}_0x5a20f0[_0x7b75('0x1a')](_0x36fee5);return _0x5a20f0['set'](_0x7b75('0x21'),_0x51be05+'-'+_0x3094d3+'/'+_0x1fafbd)[_0x7b75('0x1c')](_0x4ca520);}return null;};}function patchUpdates(_0x10bfc6){return function(_0x36e705){try{jsonpatch[_0x7b75('0x22')](_0x36e705,_0x10bfc6,!![]);}catch(_0x1b1977){return BPromise['reject'](_0x1b1977);}return _0x36e705[_0x7b75('0x23')]();};}function saveUpdates(_0x3d67d7,_0x3b6a9e){return function(_0x11550c){if(_0x11550c){return _0x11550c[_0x7b75('0x24')](_0x3d67d7)[_0x7b75('0x25')](function(_0x27b94e){return _0x27b94e;});}return null;};}function removeEntity(_0x5b1568,_0x6ea23d){return function(_0x174e34){if(_0x174e34){return _0x174e34[_0x7b75('0x26')]()[_0x7b75('0x25')](function(){_0x5b1568[_0x7b75('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ae7d,_0x2df84c){return function(_0x5c4371){if(!_0x5c4371){_0x10ae7d[_0x7b75('0x19')](0x194);}return _0x5c4371;};}function handleError(_0x48fba6,_0x235aa0){_0x235aa0=_0x235aa0||0x1f4;return function(_0x73c298){logger['error'](_0x73c298['stack']);if(_0x73c298[_0x7b75('0x27')]){delete _0x73c298[_0x7b75('0x27')];}_0x48fba6['status'](_0x235aa0)[_0x7b75('0x28')](_0x73c298);};}exports['index']=function(_0x4f8450,_0x22103b){var _0x138578={},_0x5414e2={},_0x1fa2c1={'count':0x0,'rows':[]};var _0x2e5a71=_[_0x7b75('0x29')](db[_0x7b75('0x2a')][_0x7b75('0x2b')],function(_0x372caa){return{'name':_0x372caa[_0x7b75('0x2c')],'type':_0x372caa[_0x7b75('0x2d')][_0x7b75('0x2e')]};});_0x5414e2[_0x7b75('0x2f')]=_[_0x7b75('0x29')](_0x2e5a71,_0x7b75('0x27'));_0x5414e2[_0x7b75('0x30')]=_[_0x7b75('0x31')](_0x4f8450[_0x7b75('0x30')]);_0x5414e2[_0x7b75('0x32')]=_['intersection'](_0x5414e2['model'],_0x5414e2[_0x7b75('0x30')]);_0x138578[_0x7b75('0x33')]=_[_0x7b75('0x34')](_0x5414e2[_0x7b75('0x2f')],qs[_0x7b75('0x35')](_0x4f8450[_0x7b75('0x30')][_0x7b75('0x35')]));_0x138578[_0x7b75('0x33')]=_0x138578[_0x7b75('0x33')]['length']?_0x138578[_0x7b75('0x33')]:_0x5414e2['model'];if(!_0x4f8450['query'][_0x7b75('0x36')](_0x7b75('0x37'))){_0x138578[_0x7b75('0x1e')]=qs[_0x7b75('0x1e')](_0x4f8450['query'][_0x7b75('0x1e')]);_0x138578['offset']=qs[_0x7b75('0x20')](_0x4f8450['query']['offset']);}_0x138578[_0x7b75('0x38')]=qs[_0x7b75('0x39')](_0x4f8450[_0x7b75('0x30')][_0x7b75('0x39')]);_0x138578[_0x7b75('0x3a')]=qs[_0x7b75('0x32')](_[_0x7b75('0x3b')](_0x4f8450[_0x7b75('0x30')],_0x5414e2['filters']),_0x2e5a71);if(_0x4f8450['query'][_0x7b75('0x3c')]){_0x138578[_0x7b75('0x3a')]=_[_0x7b75('0x3d')](_0x138578['where'],{'$or':_[_0x7b75('0x29')](_0x2e5a71,function(_0x51a7c8){if(_0x51a7c8[_0x7b75('0x2d')]!==_0x7b75('0x3e')){var _0x26560d={};_0x26560d[_0x51a7c8[_0x7b75('0x27')]]={'$like':'%'+_0x4f8450[_0x7b75('0x30')]['filter']+'%'};return _0x26560d;}})});}_0x138578=_[_0x7b75('0x3d')]({},_0x138578,_0x4f8450[_0x7b75('0x3f')]);var _0x4da4ca={'where':_0x138578[_0x7b75('0x3a')]};return db[_0x7b75('0x2a')][_0x7b75('0x1f')](_0x4da4ca)[_0x7b75('0x25')](function(_0x1efc15){_0x1fa2c1['count']=_0x1efc15;if(_0x4f8450['query'][_0x7b75('0x40')]){_0x138578['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x7b75('0x41')](_0x138578);})['then'](function(_0x19f2c2){_0x1fa2c1['rows']=_0x19f2c2;return _0x1fa2c1;})[_0x7b75('0x25')](respondWithFilteredResult(_0x22103b,_0x138578))['catch'](handleError(_0x22103b,null));};exports[_0x7b75('0x42')]=function(_0x4cd532,_0x401dcf){var _0x103f56={'raw':!![],'where':{'id':_0x4cd532[_0x7b75('0x43')]['id']}},_0x3e18b6={};_0x3e18b6[_0x7b75('0x2f')]=_[_0x7b75('0x31')](db[_0x7b75('0x2a')]['rawAttributes']);_0x3e18b6[_0x7b75('0x30')]=_[_0x7b75('0x31')](_0x4cd532[_0x7b75('0x30')]);_0x3e18b6['filters']=_[_0x7b75('0x34')](_0x3e18b6[_0x7b75('0x2f')],_0x3e18b6[_0x7b75('0x30')]);_0x103f56[_0x7b75('0x33')]=_[_0x7b75('0x34')](_0x3e18b6[_0x7b75('0x2f')],qs[_0x7b75('0x35')](_0x4cd532[_0x7b75('0x30')]['fields']));_0x103f56[_0x7b75('0x33')]=_0x103f56['attributes'][_0x7b75('0x44')]?_0x103f56['attributes']:_0x3e18b6[_0x7b75('0x2f')];if(_0x4cd532[_0x7b75('0x30')]['includeAll']){_0x103f56[_0x7b75('0x45')]=[{'all':!![]}];}_0x103f56=_['merge']({},_0x103f56,_0x4cd532[_0x7b75('0x3f')]);return db[_0x7b75('0x2a')]['find'](_0x103f56)['then'](handleEntityNotFound(_0x401dcf,null))['then'](respondWithResult(_0x401dcf,null))['catch'](handleError(_0x401dcf,null));};exports['update']=function(_0x2730d1,_0xfd9aee){if(_0x2730d1['body']['id']){delete _0x2730d1[_0x7b75('0x46')]['id'];}return db[_0x7b75('0x2a')][_0x7b75('0x47')]({'where':{'id':_0x2730d1[_0x7b75('0x43')]['id']}})['then'](handleEntityNotFound(_0xfd9aee,null))[_0x7b75('0x25')](saveUpdates(_0x2730d1['body'],null))[_0x7b75('0x25')](respondWithResult(_0xfd9aee,null))[_0x7b75('0x48')](handleError(_0xfd9aee,null));};exports[_0x7b75('0x26')]=function(_0x1b227a,_0x48ebc1){return db[_0x7b75('0x2a')]['find']({'where':{'id':_0x1b227a[_0x7b75('0x43')]['id']}})['then'](handleEntityNotFound(_0x48ebc1,null))[_0x7b75('0x25')](removeEntity(_0x48ebc1,null))['catch'](handleError(_0x48ebc1,null));};exports[_0x7b75('0x49')]=function(_0x810c7f,_0xb40c61){return db[_0x7b75('0x2a')][_0x7b75('0x49')]()[_0x7b75('0x25')](respondWithResult(_0xb40c61,null))['catch'](handleError(_0xb40c61,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 59be123..c59b047 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 _0x6e5a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x95bae7,_0x5c9b85){var _0x1e4c5e=function(_0x328e35){while(--_0x328e35){_0x95bae7['push'](_0x95bae7['shift']());}};_0x1e4c5e(++_0x5c9b85);}(_0x6e5a,0x1e0));var _0xa6e5=function(_0x26ab34,_0x220c55){_0x26ab34=_0x26ab34-0x0;var _0x33892d=_0x6e5a[_0x26ab34];return _0x33892d;};'use strict';var _=require(_0xa6e5('0x0'));var util=require(_0xa6e5('0x1'));var logger=require(_0xa6e5('0x2'))(_0xa6e5('0x3'));var moment=require(_0xa6e5('0x4'));var BPromise=require(_0xa6e5('0x5'));var rp=require(_0xa6e5('0x6'));var fs=require('fs');var path=require(_0xa6e5('0x7'));var rimraf=require(_0xa6e5('0x8'));var config=require(_0xa6e5('0x9'));var attributes=require(_0xa6e5('0xa'));module['exports']=function(_0x1d84cc,_0x4a05ea){return _0x1d84cc['define'](_0xa6e5('0xb'),attributes,{'tableName':_0xa6e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6f6=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','moment','bluebird','path'];(function(_0x64bec,_0x37225c){var _0x46b9c6=function(_0x4cd9af){while(--_0x4cd9af){_0x64bec['push'](_0x64bec['shift']());}};_0x46b9c6(++_0x37225c);}(_0xb6f6,0x10f));var _0x6b6f=function(_0x4eddea,_0x1c3398){_0x4eddea=_0x4eddea-0x0;var _0x285994=_0xb6f6[_0x4eddea];return _0x285994;};'use strict';var _=require(_0x6b6f('0x0'));var util=require(_0x6b6f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b6f('0x2'));var BPromise=require(_0x6b6f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b6f('0x4'));var rimraf=require(_0x6b6f('0x5'));var config=require(_0x6b6f('0x6'));var attributes=require(_0x6b6f('0x7'));module[_0x6b6f('0x8')]=function(_0x1eefa3,_0x2c270c){return _0x1eefa3[_0x6b6f('0x9')](_0x6b6f('0xa'),attributes,{'tableName':_0x6b6f('0xb'),'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 90bca5c..f36f245 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 _0x636f=['destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','body','then'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x636f,0x6e));var _0xf636=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x636f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf636('0x0'));var util=require(_0xf636('0x1'));var moment=require(_0xf636('0x2'));var BPromise=require(_0xf636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf636('0x4'));var db=require(_0xf636('0x5'))['db'];var utils=require(_0xf636('0x6'));var logger=require(_0xf636('0x7'))('rpc');var config=require(_0xf636('0x8'));var jayson=require(_0xf636('0x9'));var client=jayson['client'][_0xf636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x596cd7,_0x5928be,_0x189894){return new BPromise(function(_0x513104,_0x436e49){return client['request'](_0x596cd7,_0x189894)['then'](function(_0x4dc571){logger[_0xf636('0xb')](_0xf636('0xc'),_0x5928be,'request\x20sent');logger[_0xf636('0xd')](_0xf636('0xe'),_0x5928be,_0xf636('0xf'),JSON[_0xf636('0x10')](_0x4dc571));if(_0x4dc571[_0xf636('0x11')]){if(_0x4dc571['error']['code']===0x1f4){logger[_0xf636('0x11')](_0xf636('0xc'),_0x5928be,_0x4dc571['error'][_0xf636('0x12')]);return _0x436e49(_0x4dc571[_0xf636('0x11')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5928be,_0x4dc571['error'][_0xf636('0x12')]);return _0x513104(_0x4dc571['error'][_0xf636('0x12')]);}else{logger[_0xf636('0xb')](_0xf636('0xc'),_0x5928be,_0xf636('0xf'));_0x513104(_0x4dc571[_0xf636('0x13')][_0xf636('0x12')]);}})[_0xf636('0x14')](function(_0x5e2729){logger[_0xf636('0x11')](_0xf636('0xc'),_0x5928be,_0x5e2729);_0x436e49(_0x5e2729);});});}exports[_0xf636('0x15')]=function(_0x3acd1d){var _0x5f05ef=this;return new Promise(function(_0x1ac22e,_0x1a677c){return db[_0xf636('0x16')]['findAll']({'raw':_0x3acd1d[_0xf636('0x17')]?_0x3acd1d[_0xf636('0x17')][_0xf636('0x18')]===undefined?!![]:![]:!![],'where':_0x3acd1d[_0xf636('0x17')]?_0x3acd1d[_0xf636('0x17')][_0xf636('0x19')]||null:null,'attributes':_0x3acd1d[_0xf636('0x17')]?_0x3acd1d[_0xf636('0x17')][_0xf636('0x1a')]||null:null,'limit':_0x3acd1d['options']?_0x3acd1d[_0xf636('0x17')][_0xf636('0x1b')]||null:null,'include':_0x3acd1d[_0xf636('0x17')]?_0x3acd1d['options'][_0xf636('0x1c')]?_['map'](_0x3acd1d[_0xf636('0x17')]['include'],function(_0x2530b7){return{'model':db[_0x2530b7['model']],'as':_0x2530b7['as'],'attributes':_0x2530b7[_0xf636('0x1a')],'include':_0x2530b7['include']?_['map'](_0x2530b7[_0xf636('0x1c')],function(_0x2c4afb){return{'model':db[_0x2c4afb['model']],'as':_0x2c4afb['as'],'attributes':_0x2c4afb[_0xf636('0x1a')],'include':_0x2c4afb[_0xf636('0x1c')]?_[_0xf636('0x1d')](_0x2c4afb[_0xf636('0x1c')],function(_0x53d3b9){return{'model':db[_0x53d3b9[_0xf636('0x1e')]],'as':_0x53d3b9['as'],'attributes':_0x53d3b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fe867){logger['info']('GetCmHopperBlack',_0x3acd1d);logger[_0xf636('0xd')](_0xf636('0x15'),_0x3acd1d,JSON['stringify'](_0x3fe867));_0x1ac22e(_0x3fe867);})[_0xf636('0x14')](function(_0xfdc98c){logger[_0xf636('0x11')](_0xf636('0x15'),_0xfdc98c[_0xf636('0x12')],_0x3acd1d);_0x1a677c(_0x5f05ef['error'](0x1f4,_0xfdc98c['message']));});});};exports[_0xf636('0x1f')]=function(_0x25b91b){var _0x169c3b=this;return new Promise(function(_0x54d8ea,_0x424740){return db[_0xf636('0x16')]['update'](_0x25b91b[_0xf636('0x20')],{'raw':_0x25b91b[_0xf636('0x17')]?_0x25b91b[_0xf636('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25b91b[_0xf636('0x17')]?_0x25b91b['options'][_0xf636('0x19')]||null:null,'attributes':_0x25b91b[_0xf636('0x17')]?_0x25b91b[_0xf636('0x17')][_0xf636('0x1a')]||null:null,'limit':_0x25b91b[_0xf636('0x17')]?_0x25b91b[_0xf636('0x17')][_0xf636('0x1b')]||null:null})[_0xf636('0x21')](function(_0x518654){logger['info']('UpdateCmHopperBlack',_0x25b91b);logger[_0xf636('0xd')](_0xf636('0x1f'),_0x25b91b,JSON[_0xf636('0x10')](_0x518654));_0x54d8ea(_0x518654);})['catch'](function(_0x332140){logger[_0xf636('0x11')](_0xf636('0x1f'),_0x332140[_0xf636('0x12')],_0x25b91b);_0x424740(_0x169c3b[_0xf636('0x11')](0x1f4,_0x332140['message']));});});};exports['DestroyCmHopperBlack']=function(_0x337070){var _0x28fd62=this;return new Promise(function(_0x126155,_0x122601){return db[_0xf636('0x16')][_0xf636('0x22')]({'where':_0x337070['options']?_0x337070[_0xf636('0x17')][_0xf636('0x19')]||null:null})[_0xf636('0x21')](function(_0x5632a2){logger[_0xf636('0xb')](_0xf636('0x23'),_0x337070);logger[_0xf636('0xd')](_0xf636('0x23'),_0x337070,JSON[_0xf636('0x10')](_0x5632a2));_0x126155(_0x5632a2);})[_0xf636('0x14')](function(_0x572e85){logger['error']('DestroyCmHopperBlack',_0x572e85[_0xf636('0x12')],_0x337070);_0x122601(_0x28fd62['error'](0x1f4,_0x572e85['message']));});});}; \ No newline at end of file +var _0x7a5e=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','request\x20sent','result','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map','attributes','UpdateCmHopperBlack','update','where','DestroyCmHopperBlack','destroy','lodash'];(function(_0x79d19e,_0x33173a){var _0x28f000=function(_0x28dead){while(--_0x28dead){_0x79d19e['push'](_0x79d19e['shift']());}};_0x28f000(++_0x33173a);}(_0x7a5e,0xb3));var _0xe7a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe7a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe7a5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7a5('0x2'));var db=require(_0xe7a5('0x3'))['db'];var utils=require(_0xe7a5('0x4'));var logger=require('../../config/logger')(_0xe7a5('0x5'));var config=require(_0xe7a5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe7a5('0x7')][_0xe7a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ec159,_0x5b3c26,_0x341c06){return new BPromise(function(_0x54b6b9,_0x599fb4){return client[_0xe7a5('0x9')](_0x4ec159,_0x341c06)[_0xe7a5('0xa')](function(_0x1e5431){logger[_0xe7a5('0xb')](_0xe7a5('0xc'),_0x5b3c26,'request\x20sent');logger[_0xe7a5('0xd')](_0xe7a5('0xe'),_0x5b3c26,'request\x20sent',JSON[_0xe7a5('0xf')](_0x1e5431));if(_0x1e5431[_0xe7a5('0x10')]){if(_0x1e5431[_0xe7a5('0x10')][_0xe7a5('0x11')]===0x1f4){logger['error'](_0xe7a5('0xc'),_0x5b3c26,_0x1e5431[_0xe7a5('0x10')]['message']);return _0x599fb4(_0x1e5431[_0xe7a5('0x10')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5b3c26,_0x1e5431[_0xe7a5('0x10')]['message']);return _0x54b6b9(_0x1e5431[_0xe7a5('0x10')]['message']);}else{logger['info'](_0xe7a5('0xc'),_0x5b3c26,_0xe7a5('0x12'));_0x54b6b9(_0x1e5431[_0xe7a5('0x13')][_0xe7a5('0x14')]);}})[_0xe7a5('0x15')](function(_0x2d55e3){logger[_0xe7a5('0x10')](_0xe7a5('0xc'),_0x5b3c26,_0x2d55e3);_0x599fb4(_0x2d55e3);});});}exports[_0xe7a5('0x16')]=function(_0x38accf){var _0x3545b3=this;return new Promise(function(_0x21e133,_0x15296e){return db[_0xe7a5('0x17')][_0xe7a5('0x18')]({'raw':_0x38accf[_0xe7a5('0x19')]?_0x38accf[_0xe7a5('0x19')][_0xe7a5('0x1a')]===undefined?!![]:![]:!![],'where':_0x38accf['options']?_0x38accf[_0xe7a5('0x19')]['where']||null:null,'attributes':_0x38accf[_0xe7a5('0x19')]?_0x38accf['options']['attributes']||null:null,'limit':_0x38accf[_0xe7a5('0x19')]?_0x38accf[_0xe7a5('0x19')][_0xe7a5('0x1b')]||null:null,'include':_0x38accf[_0xe7a5('0x19')]?_0x38accf['options'][_0xe7a5('0x1c')]?_[_0xe7a5('0x1d')](_0x38accf[_0xe7a5('0x19')][_0xe7a5('0x1c')],function(_0x4f3122){return{'model':db[_0x4f3122['model']],'as':_0x4f3122['as'],'attributes':_0x4f3122[_0xe7a5('0x1e')],'include':_0x4f3122['include']?_[_0xe7a5('0x1d')](_0x4f3122[_0xe7a5('0x1c')],function(_0x4c4b9c){return{'model':db[_0x4c4b9c['model']],'as':_0x4c4b9c['as'],'attributes':_0x4c4b9c['attributes'],'include':_0x4c4b9c['include']?_[_0xe7a5('0x1d')](_0x4c4b9c[_0xe7a5('0x1c')],function(_0x1a58b7){return{'model':db[_0x1a58b7['model']],'as':_0x1a58b7['as'],'attributes':_0x1a58b7[_0xe7a5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe7a5('0xa')](function(_0x8444d8){logger['info'](_0xe7a5('0x16'),_0x38accf);logger[_0xe7a5('0xd')](_0xe7a5('0x16'),_0x38accf,JSON[_0xe7a5('0xf')](_0x8444d8));_0x21e133(_0x8444d8);})['catch'](function(_0x2c4c31){logger[_0xe7a5('0x10')](_0xe7a5('0x16'),_0x2c4c31[_0xe7a5('0x14')],_0x38accf);_0x15296e(_0x3545b3['error'](0x1f4,_0x2c4c31[_0xe7a5('0x14')]));});});};exports[_0xe7a5('0x1f')]=function(_0x1e689f){var _0xbcdf68=this;return new Promise(function(_0x21a40b,_0x4f5268){return db['CmHopperBlack'][_0xe7a5('0x20')](_0x1e689f['body'],{'raw':_0x1e689f[_0xe7a5('0x19')]?_0x1e689f[_0xe7a5('0x19')][_0xe7a5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e689f['options']?_0x1e689f[_0xe7a5('0x19')][_0xe7a5('0x21')]||null:null,'attributes':_0x1e689f['options']?_0x1e689f['options'][_0xe7a5('0x1e')]||null:null,'limit':_0x1e689f[_0xe7a5('0x19')]?_0x1e689f[_0xe7a5('0x19')]['limit']||null:null})[_0xe7a5('0xa')](function(_0x744fd5){logger[_0xe7a5('0xb')](_0xe7a5('0x1f'),_0x1e689f);logger[_0xe7a5('0xd')](_0xe7a5('0x1f'),_0x1e689f,JSON[_0xe7a5('0xf')](_0x744fd5));_0x21a40b(_0x744fd5);})['catch'](function(_0x183a5c){logger[_0xe7a5('0x10')](_0xe7a5('0x1f'),_0x183a5c[_0xe7a5('0x14')],_0x1e689f);_0x4f5268(_0xbcdf68[_0xe7a5('0x10')](0x1f4,_0x183a5c[_0xe7a5('0x14')]));});});};exports[_0xe7a5('0x22')]=function(_0x233d6a){var _0x2b52bd=this;return new Promise(function(_0x8ef93e,_0x2ba4f8){return db[_0xe7a5('0x17')][_0xe7a5('0x23')]({'where':_0x233d6a['options']?_0x233d6a['options'][_0xe7a5('0x21')]||null:null})[_0xe7a5('0xa')](function(_0x456433){logger[_0xe7a5('0xb')]('DestroyCmHopperBlack',_0x233d6a);logger['debug'](_0xe7a5('0x22'),_0x233d6a,JSON[_0xe7a5('0xf')](_0x456433));_0x8ef93e(_0x456433);})[_0xe7a5('0x15')](function(_0x2e3ac0){logger[_0xe7a5('0x10')](_0xe7a5('0x22'),_0x2e3ac0['message'],_0x233d6a);_0x2ba4f8(_0x2b52bd[_0xe7a5('0x10')](0x1f4,_0x2e3ac0[_0xe7a5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 76d7442..1e607e8 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','util','connect-timeout','express'];(function(_0x25ae65,_0x550dbd){var _0x3bddb9=function(_0x46896d){while(--_0x46896d){_0x25ae65['push'](_0x25ae65['shift']());}};_0x3bddb9(++_0x550dbd);}(_0xadb5,0xad));var _0x5adb=function(_0x3e5858,_0x4d7cec){_0x3e5858=_0x3e5858-0x0;var _0x3f0bba=_0xadb5[_0x3e5858];return _0x3f0bba;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller['update']);router['delete'](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3e24=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','/:id','delete','exports','multer'];(function(_0x42f46f,_0x326127){var _0xed56ef=function(_0x1f8f59){while(--_0x1f8f59){_0x42f46f['push'](_0x42f46f['shift']());}};_0xed56ef(++_0x326127);}(_0x3e24,0x167));var _0x43e2=function(_0xf3f0cc,_0x5a6ff3){_0xf3f0cc=_0xf3f0cc-0x0;var _0x30935a=_0x3e24[_0xf3f0cc];return _0x30935a;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var fs_extra=require(_0x43e2('0x5'));var auth=require(_0x43e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43e2('0x7'));var controller=require(_0x43e2('0x8'));router[_0x43e2('0x9')]('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xb')]);router[_0x43e2('0x9')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0x9')]('/:id',auth[_0x43e2('0xa')](),controller[_0x43e2('0xe')]);router['put'](_0x43e2('0xf'),auth[_0x43e2('0xa')](),controller['update']);router[_0x43e2('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x43e2('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 9b8074d..f91e3f2 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 _0x8fc7=['endtime','setDataValue','followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x190a28,_0x194dd2){var _0x1b694a=function(_0x4c7954){while(--_0x4c7954){_0x190a28['push'](_0x190a28['shift']());}};_0x1b694a(++_0x194dd2);}(_0x8fc7,0x89));var _0x78fc=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x8fc7[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x78fc('0x0'));var moment=require(_0x78fc('0x1'));module[_0x78fc('0x2')]={'state':{'type':Sequelize[_0x78fc('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x78fc('0x4')]},'originatecalleridname':{'type':Sequelize[_0x78fc('0x4')]},'calleridnum':{'type':Sequelize[_0x78fc('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x78fc('0x5')]},'responsetime':{'type':Sequelize[_0x78fc('0x5')]},'answertime':{'type':Sequelize[_0x78fc('0x5')]},'droptime':{'type':Sequelize[_0x78fc('0x5')]},'endtime':{'type':Sequelize[_0x78fc('0x5')]},'ringtime':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x78fc('0x4')]},'campaign':{'type':Sequelize[_0x78fc('0x4')]},'campaigntype':{'type':Sequelize[_0x78fc('0x4')]},'membername':{'type':Sequelize[_0x78fc('0x4')]},'reason':{'type':Sequelize[_0x78fc('0x4')]},'disposition':{'type':Sequelize[_0x78fc('0x4')]},'secondDisposition':{'type':Sequelize[_0x78fc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x78fc('0x4')]},'dispositionat':{'type':Sequelize[_0x78fc('0x5')],'set':function(_0x4f5909){var _0x5761cc=this[_0x78fc('0x6')](_0x78fc('0x7'));if(_0x5761cc&&_0x4f5909){this[_0x78fc('0x8')](_0x78fc('0x9'),moment(_0x4f5909)[_0x78fc('0xa')](moment(_0x5761cc),'seconds'));}}},'amd':{'type':Sequelize[_0x78fc('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x78fc('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x78fc('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x78fc('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x78fc('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x78fc('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x78fc('0x5')]},'recallme':{'type':Sequelize[_0x78fc('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x78fc('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x78fc('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9ee3=['seconds','BOOLEAN','moment','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ee3,0x1c5));var _0x39ee=function(_0x3cc98e,_0x52bf02){_0x3cc98e=_0x3cc98e-0x0;var _0x47987d=_0x9ee3[_0x3cc98e];return _0x47987d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x39ee('0x0'));module['exports']={'state':{'type':Sequelize[_0x39ee('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x39ee('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x39ee('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x39ee('0x3')]},'originatecalleridname':{'type':Sequelize[_0x39ee('0x3')]},'calleridnum':{'type':Sequelize[_0x39ee('0x3')]},'calleridname':{'type':Sequelize[_0x39ee('0x3')]},'starttime':{'type':Sequelize[_0x39ee('0x2')]},'responsetime':{'type':Sequelize[_0x39ee('0x2')]},'answertime':{'type':Sequelize[_0x39ee('0x2')]},'droptime':{'type':Sequelize[_0x39ee('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x39ee('0x3')]},'campaign':{'type':Sequelize[_0x39ee('0x3')]},'campaigntype':{'type':Sequelize[_0x39ee('0x3')]},'membername':{'type':Sequelize[_0x39ee('0x3')]},'reason':{'type':Sequelize[_0x39ee('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x39ee('0x2')],'set':function(_0x2ed2cb){var _0x46e7e8=this[_0x39ee('0x4')](_0x39ee('0x5'));if(_0x46e7e8&&_0x2ed2cb){this[_0x39ee('0x6')](_0x39ee('0x7'),moment(_0x2ed2cb)[_0x39ee('0x8')](moment(_0x46e7e8),_0x39ee('0x9')));}}},'amd':{'type':Sequelize[_0x39ee('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x39ee('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x39ee('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x39ee('0x2')]},'deleted':{'type':Sequelize[_0x39ee('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x39ee('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x39ee('0x2')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x39ee('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 7c92f39..1886cf1 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 _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x5d58,0x187));var _0x85d5=function(_0x522823,_0xdc1ee9){_0x522823=_0x522823-0x0;var _0x156738=_0x5d58[_0x522823];return _0x156738;};'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(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file +var _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x687b,0x14a));var _0xb687=function(_0x4a450a,_0x54d42f){_0x4a450a=_0x4a450a-0x0;var _0x28baf9=_0x687b[_0x4a450a];return _0x28baf9;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 332ce70..34af0e6 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 _0x6370=['cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x8fdfe3,_0x39c95c){var _0x9b768=function(_0x2eebf7){while(--_0x2eebf7){_0x8fdfe3['push'](_0x8fdfe3['shift']());}};_0x9b768(++_0x39c95c);}(_0x6370,0x99));var _0x0637=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x6370[_0x1fb1c1];return _0x1622df;};'use strict';var _=require(_0x0637('0x0'));var util=require(_0x0637('0x1'));var logger=require('../../config/logger')(_0x0637('0x2'));var moment=require(_0x0637('0x3'));var BPromise=require(_0x0637('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0637('0x5'));var rimraf=require(_0x0637('0x6'));var config=require(_0x0637('0x7'));var attributes=require(_0x0637('0x8'));module[_0x0637('0x9')]=function(_0x28f72a,_0x1354fe){return _0x28f72a[_0x0637('0xa')](_0x0637('0xb'),attributes,{'tableName':_0x0637('0xc'),'paranoid':![],'indexes':[{'name':_0x0637('0xd'),'fields':[_0x0637('0xd')]},{'name':'uniqueid','fields':[_0x0637('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x81a5=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x140ae0,_0x3d3b73){var _0x1ecbd8=function(_0x2e0bd4){while(--_0x2e0bd4){_0x140ae0['push'](_0x140ae0['shift']());}};_0x1ecbd8(++_0x3d3b73);}(_0x81a5,0x13d));var _0x581a=function(_0x1903ac,_0x5e96b2){_0x1903ac=_0x1903ac-0x0;var _0x38d640=_0x81a5[_0x1903ac];return _0x38d640;};'use strict';var _=require(_0x581a('0x0'));var util=require(_0x581a('0x1'));var logger=require(_0x581a('0x2'))(_0x581a('0x3'));var moment=require(_0x581a('0x4'));var BPromise=require(_0x581a('0x5'));var rp=require(_0x581a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x581a('0x7'));var config=require(_0x581a('0x8'));var attributes=require(_0x581a('0x9'));module[_0x581a('0xa')]=function(_0xeec1ec,_0x1f77c7){return _0xeec1ec[_0x581a('0xb')](_0x581a('0xc'),attributes,{'tableName':_0x581a('0xd'),'paranoid':![],'indexes':[{'name':_0x581a('0xe'),'fields':[_0x581a('0xe')]},{'name':_0x581a('0xf'),'fields':[_0x581a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 811da01..b5a63a3 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2886ad,_0x418c18){var _0x5f43b3=function(_0x44f8f2){while(--_0x44f8f2){_0x2886ad['push'](_0x2886ad['shift']());}};_0x5f43b3(++_0x418c18);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a766f,_0x135d23){_0x5a766f=_0x5a766f-0x0;var _0xebfcf3=_0xb10b[_0x5a766f];return _0xebfcf3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x542aa4,_0x37e638){var _0x37bd40=function(_0x5d5db9){while(--_0x5d5db9){_0x542aa4['push'](_0x542aa4['shift']());}};_0x37bd40(++_0x37e638);}(_0xb10b,0x12a));var _0xbb10=function(_0x568eca,_0x549174){_0x568eca=_0x568eca-0x0;var _0x767192=_0xb10b[_0x568eca];return _0x767192;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index a054df6..27837a5 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 _0x38d2=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0xdad237,_0x361a1d){var _0x15c575=function(_0x8db2f6){while(--_0x8db2f6){_0xdad237['push'](_0xdad237['shift']());}};_0x15c575(++_0x361a1d);}(_0x38d2,0x112));var _0x238d=function(_0x1ca4b4,_0x53ba03){_0x1ca4b4=_0x1ca4b4-0x0;var _0x4051f7=_0x38d2[_0x1ca4b4];return _0x4051f7;};'use strict';var multer=require('multer');var util=require(_0x238d('0x0'));var path=require(_0x238d('0x1'));var timeout=require(_0x238d('0x2'));var express=require(_0x238d('0x3'));var router=express[_0x238d('0x4')]();var fs_extra=require(_0x238d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x238d('0x6'));var config=require(_0x238d('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x238d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x238d('0x8')](_0x238d('0x9'),auth[_0x238d('0xa')](),controller[_0x238d('0xb')]);router[_0x238d('0x8')](_0x238d('0xc'),auth[_0x238d('0xa')](),controller[_0x238d('0xd')]);router[_0x238d('0x8')](_0x238d('0xe'),auth['isAuthenticated'](),controller[_0x238d('0xf')]);router['get']('/campaign/countAttributes/:id',auth[_0x238d('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x238d('0x10')](_0x238d('0x11'),auth[_0x238d('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x238d('0x10')](_0x238d('0x12'),auth[_0x238d('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x238d('0x13'),auth[_0x238d('0xa')](),controller[_0x238d('0x14')]);router[_0x238d('0x15')](_0x238d('0xc'),auth[_0x238d('0xa')](),controller[_0x238d('0x16')]);module[_0x238d('0x17')]=router; \ No newline at end of file +var _0x15b5=['post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x15b5,0x1bf));var _0x515b=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0x15b5[_0x5d88c0];return _0x1b40f0;};'use strict';var multer=require(_0x515b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x515b('0x1'));var auth=require(_0x515b('0x2'));var interaction=require(_0x515b('0x3'));var config=require(_0x515b('0x4'));var controller=require(_0x515b('0x5'));router[_0x515b('0x6')]('/',auth[_0x515b('0x7')](),controller[_0x515b('0x8')]);router['get'](_0x515b('0x9'),auth[_0x515b('0x7')](),controller['describe']);router[_0x515b('0x6')](_0x515b('0xa'),auth[_0x515b('0x7')](),controller['show']);router[_0x515b('0x6')](_0x515b('0xb'),auth[_0x515b('0x7')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x515b('0x6')]('/campaign/countAttributes/:id',auth[_0x515b('0x7')](),controller[_0x515b('0xc')]);router[_0x515b('0xd')](_0x515b('0xe'),auth[_0x515b('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x515b('0xd')](_0x515b('0xf'),auth['isAuthenticated'](),controller[_0x515b('0x10')]);router[_0x515b('0xd')](_0x515b('0x11'),auth[_0x515b('0x7')](),controller[_0x515b('0x12')]);router['put']('/:id',auth[_0x515b('0x7')](),controller[_0x515b('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c6b7987..f63e7d1 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 _0x02d5=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x1b7717,_0x269e9a){var _0x29711c=function(_0x2fa392){while(--_0x2fa392){_0x1b7717['push'](_0x1b7717['shift']());}};_0x29711c(++_0x269e9a);}(_0x02d5,0x17d));var _0x502d=function(_0x37870d,_0x356e02){_0x37870d=_0x37870d-0x0;var _0x1ae695=_0x02d5[_0x37870d];return _0x1ae695;};'use strict';var Sequelize=require(_0x502d('0x0'));module[_0x502d('0x1')]={'state':{'type':Sequelize[_0x502d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x502d('0x3')]},'scheduledat':{'type':Sequelize[_0x502d('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x502d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x502d('0x3')]},'originatecalleridname':{'type':Sequelize[_0x502d('0x3')]},'calleridnum':{'type':Sequelize[_0x502d('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x502d('0x4')]},'responsetime':{'type':Sequelize[_0x502d('0x4')]},'answertime':{'type':Sequelize[_0x502d('0x4')]},'droptime':{'type':Sequelize[_0x502d('0x4')]},'endtime':{'type':Sequelize[_0x502d('0x4')]},'ringtime':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x502d('0x3')]},'campaign':{'type':Sequelize[_0x502d('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x502d('0x3')]},'amd':{'type':Sequelize[_0x502d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x502d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x502d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x502d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x502d('0x4')]},'recallme':{'type':Sequelize[_0x502d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x502d('0x4')]},'edited':{'type':Sequelize[_0x502d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x502d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x502d('0x3')]}}; \ No newline at end of file +var _0x4c97=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x2af732,_0x852a76){var _0x2f0a55=function(_0x1e87cd){while(--_0x1e87cd){_0x2af732['push'](_0x2af732['shift']());}};_0x2f0a55(++_0x852a76);}(_0x4c97,0xd0));var _0x74c9=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x4c97[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x74c9('0x0'));module[_0x74c9('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x74c9('0x2')]},'scheduledat':{'type':Sequelize[_0x74c9('0x3')]},'countbusyretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x74c9('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x74c9('0x2')]},'starttime':{'type':Sequelize[_0x74c9('0x3')]},'responsetime':{'type':Sequelize[_0x74c9('0x3')]},'answertime':{'type':Sequelize[_0x74c9('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x74c9('0x3')]},'ringtime':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x74c9('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x74c9('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x74c9('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x74c9('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x74c9('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x74c9('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x74c9('0x3')]},'recallme':{'type':Sequelize[_0x74c9('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x74c9('0x3')]},'edited':{'type':Sequelize[_0x74c9('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x74c9('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index d5461f0..753b420 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 _0x72ff=['limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','catch','create','describe','body','uniqueid','find','params','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','offset','count','set','json','apply','save','update','then','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x34673c,_0x5e1151){var _0x38d4fc=function(_0x4f3fbc){while(--_0x4f3fbc){_0x34673c['push'](_0x34673c['shift']());}};_0x38d4fc(++_0x5e1151);}(_0x72ff,0x1d6));var _0xf72f=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x72ff[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0xf72f('0x0'));var rimraf=require(_0xf72f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf72f('0x2'));var rp=require('request-promise');var moment=require(_0xf72f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf72f('0x4'));var util=require(_0xf72f('0x5'));var path=require(_0xf72f('0x6'));var sox=require('sox');var csv=require(_0xf72f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf72f('0x8'));var _=require(_0xf72f('0x9'));var squel=require(_0xf72f('0xa'));var crypto=require(_0xf72f('0xb'));var jsforce=require(_0xf72f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf72f('0x7'));var querystring=require(_0xf72f('0xd'));var Papa=require(_0xf72f('0xe'));var Redis=require(_0xf72f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf72f('0x10'));var as=require(_0xf72f('0x11'));var hardwareService=require(_0xf72f('0x12'));var logger=require(_0xf72f('0x13'))(_0xf72f('0x14'));var utils=require(_0xf72f('0x15'));var config=require(_0xf72f('0x16'));var licenseUtil=require(_0xf72f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52c83a,_0x23ea81){_0x23ea81=_0x23ea81||0xcc;return function(_0x442e8c){if(_0x442e8c){return _0x52c83a[_0xf72f('0x18')](_0x23ea81);}return _0x52c83a[_0xf72f('0x19')](_0x23ea81)[_0xf72f('0x1a')]();};}function respondWithResult(_0x2ebde6,_0x276ac8){_0x276ac8=_0x276ac8||0xc8;return function(_0x1093ff){if(_0x1093ff){return _0x2ebde6[_0xf72f('0x19')](_0x276ac8)['json'](_0x1093ff);}};}function respondWithFilteredResult(_0x554936,_0x5c1ad6){return function(_0x4a6e0d){if(_0x4a6e0d){var _0xfe1c04=typeof _0x5c1ad6['offset']===_0xf72f('0x1b')&&typeof _0x5c1ad6['limit']===_0xf72f('0x1b');var _0x536174=_0x4a6e0d['count'];var _0xcf3f1d=_0xfe1c04?0x0:_0x5c1ad6[_0xf72f('0x1c')];var _0x36fa9f=_0xfe1c04?_0x4a6e0d[_0xf72f('0x1d')]:_0x5c1ad6[_0xf72f('0x1c')]+_0x5c1ad6['limit'];var _0x21a5bb;if(_0x36fa9f>=_0x536174){_0x36fa9f=_0x536174;_0x21a5bb=0xc8;}else{_0x21a5bb=0xce;}_0x554936[_0xf72f('0x19')](_0x21a5bb);return _0x554936[_0xf72f('0x1e')]('Content-Range',_0xcf3f1d+'-'+_0x36fa9f+'/'+_0x536174)[_0xf72f('0x1f')](_0x4a6e0d);}return null;};}function patchUpdates(_0x9b0392){return function(_0x4b9a80){try{jsonpatch[_0xf72f('0x20')](_0x4b9a80,_0x9b0392,!![]);}catch(_0x2ad0de){return BPromise['reject'](_0x2ad0de);}return _0x4b9a80[_0xf72f('0x21')]();};}function saveUpdates(_0x40cff5,_0x27aa08){return function(_0x2f0d93){if(_0x2f0d93){return _0x2f0d93[_0xf72f('0x22')](_0x40cff5)[_0xf72f('0x23')](function(_0x5f0ea5){return _0x5f0ea5;});}return null;};}function removeEntity(_0xe24fea,_0xd96a94){return function(_0x8958e9){if(_0x8958e9){return _0x8958e9['destroy']()[_0xf72f('0x23')](function(){_0xe24fea['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48881f,_0x39f0f4){return function(_0x317974){if(!_0x317974){_0x48881f['sendStatus'](0x194);}return _0x317974;};}function handleError(_0x57f28c,_0x36c89a){_0x36c89a=_0x36c89a||0x1f4;return function(_0xd22a63){logger[_0xf72f('0x24')](_0xd22a63[_0xf72f('0x25')]);if(_0xd22a63[_0xf72f('0x26')]){delete _0xd22a63[_0xf72f('0x26')];}_0x57f28c[_0xf72f('0x19')](_0x36c89a)[_0xf72f('0x27')](_0xd22a63);};}exports[_0xf72f('0x28')]=function(_0x5e2d43,_0x14c564){var _0x1d3430={},_0x150d18={},_0x523fc9={'count':0x0,'rows':[]};var _0x1389ec=_[_0xf72f('0x29')](db[_0xf72f('0x2a')]['rawAttributes'],function(_0xc666f5){return{'name':_0xc666f5[_0xf72f('0x2b')],'type':_0xc666f5[_0xf72f('0x2c')][_0xf72f('0x2d')]};});_0x150d18[_0xf72f('0x2e')]=_[_0xf72f('0x29')](_0x1389ec,_0xf72f('0x26'));_0x150d18[_0xf72f('0x2f')]=_[_0xf72f('0x30')](_0x5e2d43['query']);_0x150d18[_0xf72f('0x31')]=_[_0xf72f('0x32')](_0x150d18[_0xf72f('0x2e')],_0x150d18[_0xf72f('0x2f')]);_0x1d3430['attributes']=_[_0xf72f('0x32')](_0x150d18[_0xf72f('0x2e')],qs['fields'](_0x5e2d43[_0xf72f('0x2f')][_0xf72f('0x33')]));_0x1d3430[_0xf72f('0x34')]=_0x1d3430[_0xf72f('0x34')][_0xf72f('0x35')]?_0x1d3430[_0xf72f('0x34')]:_0x150d18[_0xf72f('0x2e')];if(!_0x5e2d43[_0xf72f('0x2f')][_0xf72f('0x36')]('nolimit')){_0x1d3430[_0xf72f('0x37')]=qs[_0xf72f('0x37')](_0x5e2d43['query'][_0xf72f('0x37')]);_0x1d3430[_0xf72f('0x1c')]=qs[_0xf72f('0x1c')](_0x5e2d43[_0xf72f('0x2f')][_0xf72f('0x1c')]);}_0x1d3430['order']=qs[_0xf72f('0x38')](_0x5e2d43[_0xf72f('0x2f')][_0xf72f('0x38')]);_0x1d3430[_0xf72f('0x39')]=qs['filters'](_[_0xf72f('0x3a')](_0x5e2d43['query'],_0x150d18['filters']),_0x1389ec);if(_0x5e2d43[_0xf72f('0x2f')][_0xf72f('0x3b')]){_0x1d3430[_0xf72f('0x39')]=_[_0xf72f('0x3c')](_0x1d3430[_0xf72f('0x39')],{'$or':_[_0xf72f('0x29')](_0x1389ec,function(_0x5ea65a){if(_0x5ea65a[_0xf72f('0x2c')]!==_0xf72f('0x3d')){var _0x191adb={};_0x191adb[_0x5ea65a[_0xf72f('0x26')]]={'$like':'%'+_0x5e2d43[_0xf72f('0x2f')][_0xf72f('0x3b')]+'%'};return _0x191adb;}})});}_0x1d3430=_[_0xf72f('0x3c')]({},_0x1d3430,_0x5e2d43[_0xf72f('0x3e')]);var _0x55e8ac={'where':_0x1d3430[_0xf72f('0x39')]};return db[_0xf72f('0x2a')][_0xf72f('0x1d')](_0x55e8ac)[_0xf72f('0x23')](function(_0x59906b){_0x523fc9['count']=_0x59906b;if(_0x5e2d43['query'][_0xf72f('0x3f')]){_0x1d3430[_0xf72f('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1d3430);})['then'](function(_0xe73a03){_0x523fc9[_0xf72f('0x41')]=_0xe73a03;return _0x523fc9;})[_0xf72f('0x23')](respondWithFilteredResult(_0x14c564,_0x1d3430))['catch'](handleError(_0x14c564,null));};exports[_0xf72f('0x42')]=function(_0xb301ed,_0x513d75){var _0x1151d0={'raw':!![],'where':{'id':_0xb301ed['params']['id']}},_0x266499={};_0x266499['model']=_[_0xf72f('0x30')](db[_0xf72f('0x2a')][_0xf72f('0x43')]);_0x266499[_0xf72f('0x2f')]=_['keys'](_0xb301ed[_0xf72f('0x2f')]);_0x266499[_0xf72f('0x31')]=_[_0xf72f('0x32')](_0x266499['model'],_0x266499[_0xf72f('0x2f')]);_0x1151d0[_0xf72f('0x34')]=_['intersection'](_0x266499[_0xf72f('0x2e')],qs[_0xf72f('0x33')](_0xb301ed[_0xf72f('0x2f')][_0xf72f('0x33')]));_0x1151d0[_0xf72f('0x34')]=_0x1151d0[_0xf72f('0x34')]['length']?_0x1151d0[_0xf72f('0x34')]:_0x266499[_0xf72f('0x2e')];if(_0xb301ed[_0xf72f('0x2f')][_0xf72f('0x3f')]){_0x1151d0[_0xf72f('0x40')]=[{'all':!![]}];}_0x1151d0=_[_0xf72f('0x3c')]({},_0x1151d0,_0xb301ed[_0xf72f('0x3e')]);return db[_0xf72f('0x2a')]['find'](_0x1151d0)[_0xf72f('0x23')](handleEntityNotFound(_0x513d75,null))[_0xf72f('0x23')](respondWithResult(_0x513d75,null))[_0xf72f('0x44')](handleError(_0x513d75,null));};exports[_0xf72f('0x45')]=function(_0x2b8ab8,_0x3f10d7){return db[_0xf72f('0x2a')]['create'](_0x2b8ab8['body'],{})['then'](respondWithResult(_0x3f10d7,0xc9))[_0xf72f('0x44')](handleError(_0x3f10d7,null));};exports[_0xf72f('0x46')]=function(_0x4983ee,_0x4f7179){return db['CmHopperHistory'][_0xf72f('0x46')]()[_0xf72f('0x23')](respondWithResult(_0x4f7179,null))[_0xf72f('0x44')](handleError(_0x4f7179,null));};exports['update']=function(_0x4db70f,_0x3589d3){if(_0x4db70f[_0xf72f('0x47')][_0xf72f('0x48')]){delete _0x4db70f[_0xf72f('0x47')]['uniqueid'];}return db['CmHopperHistory'][_0xf72f('0x49')]({'where':{'uniqueid':_0x4db70f[_0xf72f('0x4a')]['id']}})[_0xf72f('0x23')](handleEntityNotFound(_0x3589d3,null))[_0xf72f('0x23')](saveUpdates(_0x4db70f[_0xf72f('0x47')],null))[_0xf72f('0x23')](respondWithResult(_0x3589d3,null))[_0xf72f('0x44')](handleError(_0x3589d3,null));}; \ No newline at end of file +var _0x2024=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','CmHopperHistory','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','merge','options','create','describe','body','uniqueid','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0x2024,0x121));var _0x4202=function(_0x2861d3,_0x23a015){_0x2861d3=_0x2861d3-0x0;var _0x4f2dc3=_0x2024[_0x2861d3];return _0x4f2dc3;};'use strict';var emlformat=require(_0x4202('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4202('0x1'));var jsonpatch=require(_0x4202('0x2'));var rp=require(_0x4202('0x3'));var moment=require('moment');var BPromise=require(_0x4202('0x4'));var Mustache=require(_0x4202('0x5'));var util=require(_0x4202('0x6'));var path=require('path');var sox=require(_0x4202('0x7'));var csv=require('to-csv');var ejs=require(_0x4202('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4202('0x9'));var squel=require(_0x4202('0xa'));var crypto=require(_0x4202('0xb'));var jsforce=require(_0x4202('0xc'));var deskjs=require(_0x4202('0xd'));var toCsv=require(_0x4202('0xe'));var querystring=require(_0x4202('0xf'));var Papa=require(_0x4202('0x10'));var Redis=require(_0x4202('0x11'));var authService=require(_0x4202('0x12'));var qs=require(_0x4202('0x13'));var as=require(_0x4202('0x14'));var hardwareService=require(_0x4202('0x15'));var logger=require('../../config/logger')(_0x4202('0x16'));var utils=require('../../config/utils');var config=require(_0x4202('0x17'));var licenseUtil=require(_0x4202('0x18'));var db=require(_0x4202('0x19'))['db'];function respondWithStatusCode(_0x33a25c,_0x365cf6){_0x365cf6=_0x365cf6||0xcc;return function(_0x40ce5e){if(_0x40ce5e){return _0x33a25c[_0x4202('0x1a')](_0x365cf6);}return _0x33a25c['status'](_0x365cf6)[_0x4202('0x1b')]();};}function respondWithResult(_0xe30a2,_0x28538e){_0x28538e=_0x28538e||0xc8;return function(_0x8f14f9){if(_0x8f14f9){return _0xe30a2[_0x4202('0x1c')](_0x28538e)[_0x4202('0x1d')](_0x8f14f9);}};}function respondWithFilteredResult(_0xb13b04,_0x223636){return function(_0x50d78c){if(_0x50d78c){var _0x5ac2a0=typeof _0x223636[_0x4202('0x1e')]===_0x4202('0x1f')&&typeof _0x223636[_0x4202('0x20')]===_0x4202('0x1f');var _0x5ba152=_0x50d78c[_0x4202('0x21')];var _0x1e6403=_0x5ac2a0?0x0:_0x223636[_0x4202('0x1e')];var _0x54d006=_0x5ac2a0?_0x50d78c['count']:_0x223636[_0x4202('0x1e')]+_0x223636[_0x4202('0x20')];var _0x1a20ee;if(_0x54d006>=_0x5ba152){_0x54d006=_0x5ba152;_0x1a20ee=0xc8;}else{_0x1a20ee=0xce;}_0xb13b04[_0x4202('0x1c')](_0x1a20ee);return _0xb13b04[_0x4202('0x22')](_0x4202('0x23'),_0x1e6403+'-'+_0x54d006+'/'+_0x5ba152)['json'](_0x50d78c);}return null;};}function patchUpdates(_0x35d542){return function(_0xc15523){try{jsonpatch[_0x4202('0x24')](_0xc15523,_0x35d542,!![]);}catch(_0x2cf0d0){return BPromise['reject'](_0x2cf0d0);}return _0xc15523[_0x4202('0x25')]();};}function saveUpdates(_0x469eef,_0x4a8677){return function(_0x1e1bf7){if(_0x1e1bf7){return _0x1e1bf7[_0x4202('0x26')](_0x469eef)[_0x4202('0x27')](function(_0x574ec3){return _0x574ec3;});}return null;};}function removeEntity(_0x7bf72d,_0x3891de){return function(_0x3fb887){if(_0x3fb887){return _0x3fb887[_0x4202('0x28')]()[_0x4202('0x27')](function(){_0x7bf72d[_0x4202('0x1c')](0xcc)[_0x4202('0x1b')]();});}};}function handleEntityNotFound(_0x36dafd,_0x325eb0){return function(_0x4abc2b){if(!_0x4abc2b){_0x36dafd['sendStatus'](0x194);}return _0x4abc2b;};}function handleError(_0x5765d9,_0xc8739a){_0xc8739a=_0xc8739a||0x1f4;return function(_0x537959){logger[_0x4202('0x29')](_0x537959[_0x4202('0x2a')]);if(_0x537959[_0x4202('0x2b')]){delete _0x537959[_0x4202('0x2b')];}_0x5765d9[_0x4202('0x1c')](_0xc8739a)[_0x4202('0x2c')](_0x537959);};}exports['index']=function(_0x3e5417,_0x5c1d4f){var _0x1286cc={},_0x93d31a={},_0x16bc3e={'count':0x0,'rows':[]};var _0x3a2ab=_[_0x4202('0x2d')](db[_0x4202('0x2e')]['rawAttributes'],function(_0x21406a){return{'name':_0x21406a[_0x4202('0x2f')],'type':_0x21406a[_0x4202('0x30')][_0x4202('0x31')]};});_0x93d31a[_0x4202('0x32')]=_['map'](_0x3a2ab,_0x4202('0x2b'));_0x93d31a[_0x4202('0x33')]=_[_0x4202('0x34')](_0x3e5417['query']);_0x93d31a['filters']=_[_0x4202('0x35')](_0x93d31a['model'],_0x93d31a['query']);_0x1286cc[_0x4202('0x36')]=_[_0x4202('0x35')](_0x93d31a['model'],qs[_0x4202('0x37')](_0x3e5417[_0x4202('0x33')][_0x4202('0x37')]));_0x1286cc['attributes']=_0x1286cc['attributes'][_0x4202('0x38')]?_0x1286cc[_0x4202('0x36')]:_0x93d31a[_0x4202('0x32')];if(!_0x3e5417['query'][_0x4202('0x39')](_0x4202('0x3a'))){_0x1286cc[_0x4202('0x20')]=qs[_0x4202('0x20')](_0x3e5417[_0x4202('0x33')]['limit']);_0x1286cc[_0x4202('0x1e')]=qs[_0x4202('0x1e')](_0x3e5417['query'][_0x4202('0x1e')]);}_0x1286cc[_0x4202('0x3b')]=qs[_0x4202('0x3c')](_0x3e5417[_0x4202('0x33')][_0x4202('0x3c')]);_0x1286cc[_0x4202('0x3d')]=qs['filters'](_[_0x4202('0x3e')](_0x3e5417[_0x4202('0x33')],_0x93d31a[_0x4202('0x3f')]),_0x3a2ab);if(_0x3e5417[_0x4202('0x33')][_0x4202('0x40')]){_0x1286cc['where']=_['merge'](_0x1286cc[_0x4202('0x3d')],{'$or':_[_0x4202('0x2d')](_0x3a2ab,function(_0x21bd0c){if(_0x21bd0c[_0x4202('0x30')]!==_0x4202('0x41')){var _0x526027={};_0x526027[_0x21bd0c[_0x4202('0x2b')]]={'$like':'%'+_0x3e5417[_0x4202('0x33')]['filter']+'%'};return _0x526027;}})});}_0x1286cc=_['merge']({},_0x1286cc,_0x3e5417['options']);var _0x9ab945={'where':_0x1286cc[_0x4202('0x3d')]};return db[_0x4202('0x2e')][_0x4202('0x21')](_0x9ab945)[_0x4202('0x27')](function(_0x534dcd){_0x16bc3e[_0x4202('0x21')]=_0x534dcd;if(_0x3e5417[_0x4202('0x33')][_0x4202('0x42')]){_0x1286cc[_0x4202('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4202('0x44')](_0x1286cc);})[_0x4202('0x27')](function(_0x435b3a){_0x16bc3e['rows']=_0x435b3a;return _0x16bc3e;})[_0x4202('0x27')](respondWithFilteredResult(_0x5c1d4f,_0x1286cc))[_0x4202('0x45')](handleError(_0x5c1d4f,null));};exports['show']=function(_0x495cde,_0x590e3b){var _0x15e373={'raw':!![],'where':{'id':_0x495cde[_0x4202('0x46')]['id']}},_0x1134a4={};_0x1134a4['model']=_[_0x4202('0x34')](db[_0x4202('0x2e')][_0x4202('0x47')]);_0x1134a4[_0x4202('0x33')]=_[_0x4202('0x34')](_0x495cde[_0x4202('0x33')]);_0x1134a4['filters']=_['intersection'](_0x1134a4[_0x4202('0x32')],_0x1134a4[_0x4202('0x33')]);_0x15e373[_0x4202('0x36')]=_[_0x4202('0x35')](_0x1134a4[_0x4202('0x32')],qs['fields'](_0x495cde[_0x4202('0x33')]['fields']));_0x15e373[_0x4202('0x36')]=_0x15e373[_0x4202('0x36')]['length']?_0x15e373[_0x4202('0x36')]:_0x1134a4[_0x4202('0x32')];if(_0x495cde[_0x4202('0x33')][_0x4202('0x42')]){_0x15e373[_0x4202('0x43')]=[{'all':!![]}];}_0x15e373=_[_0x4202('0x48')]({},_0x15e373,_0x495cde[_0x4202('0x49')]);return db[_0x4202('0x2e')]['find'](_0x15e373)[_0x4202('0x27')](handleEntityNotFound(_0x590e3b,null))[_0x4202('0x27')](respondWithResult(_0x590e3b,null))['catch'](handleError(_0x590e3b,null));};exports[_0x4202('0x4a')]=function(_0x371f9c,_0x3c4285){return db[_0x4202('0x2e')][_0x4202('0x4a')](_0x371f9c['body'],{})[_0x4202('0x27')](respondWithResult(_0x3c4285,0xc9))['catch'](handleError(_0x3c4285,null));};exports[_0x4202('0x4b')]=function(_0x3ac183,_0x302aad){return db['CmHopperHistory'][_0x4202('0x4b')]()[_0x4202('0x27')](respondWithResult(_0x302aad,null))['catch'](handleError(_0x302aad,null));};exports['update']=function(_0x37ee4a,_0x573cbc){if(_0x37ee4a[_0x4202('0x4c')][_0x4202('0x4d')]){delete _0x37ee4a[_0x4202('0x4c')][_0x4202('0x4d')];}return db[_0x4202('0x2e')][_0x4202('0x4e')]({'where':{'uniqueid':_0x37ee4a['params']['id']}})[_0x4202('0x27')](handleEntityNotFound(_0x573cbc,null))[_0x4202('0x27')](saveUpdates(_0x37ee4a['body'],null))[_0x4202('0x27')](respondWithResult(_0x573cbc,null))['catch'](handleError(_0x573cbc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 473dbe4..67bf9bb 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 _0x0424=['define','CmHopperHistory','cm_hopper_history','uniqueid','../../config/logger','api','moment','bluebird','path','./cmHopperHistory.attributes','exports'];(function(_0x5dde9b,_0x18d784){var _0x195095=function(_0x291667){while(--_0x291667){_0x5dde9b['push'](_0x5dde9b['shift']());}};_0x195095(++_0x18d784);}(_0x0424,0x159));var _0x4042=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x0424[_0x1a9204];return _0x17ca68;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));module[_0x4042('0x6')]=function(_0x472795,_0xc0fba0){return _0x472795[_0x4042('0x7')](_0x4042('0x8'),attributes,{'tableName':_0x4042('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x4042('0xa'),'fields':[_0x4042('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x432caa,_0x1edfa1){var _0x21458f=function(_0x37bd18){while(--_0x37bd18){_0x432caa['push'](_0x432caa['shift']());}};_0x21458f(++_0x1edfa1);}(_0xeda7,0x196));var _0x7eda=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeda7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var logger=require(_0x7eda('0x2'))(_0x7eda('0x3'));var moment=require(_0x7eda('0x4'));var BPromise=require(_0x7eda('0x5'));var rp=require(_0x7eda('0x6'));var fs=require('fs');var path=require(_0x7eda('0x7'));var rimraf=require(_0x7eda('0x8'));var config=require(_0x7eda('0x9'));var attributes=require(_0x7eda('0xa'));module[_0x7eda('0xb')]=function(_0x6ee7be,_0x328430){return _0x6ee7be[_0x7eda('0xc')](_0x7eda('0xd'),attributes,{'tableName':_0x7eda('0xe'),'paranoid':![],'indexes':[{'name':_0x7eda('0xf'),'fields':[_0x7eda('0xf')]},{'name':_0x7eda('0x10'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 7b6f002..c54ed03 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 _0x47c0=['message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','outboundReCallsDay','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s'];(function(_0x408c46,_0x35404d){var _0x5c75ea=function(_0x55bdb6){while(--_0x55bdb6){_0x408c46['push'](_0x408c46['shift']());}};_0x5c75ea(++_0x35404d);}(_0x47c0,0x1dc));var _0x047c=function(_0x41f8bc,_0x26a19c){_0x41f8bc=_0x41f8bc-0x0;var _0x4171dd=_0x47c0[_0x41f8bc];return _0x4171dd;};'use strict';var _=require(_0x047c('0x0'));var util=require(_0x047c('0x1'));var moment=require(_0x047c('0x2'));var BPromise=require('bluebird');var rs=require(_0x047c('0x3'));var fs=require('fs');var Redis=require(_0x047c('0x4'));var db=require(_0x047c('0x5'))['db'];var utils=require(_0x047c('0x6'));var logger=require(_0x047c('0x7'))(_0x047c('0x8'));var config=require('../../config/environment');var jayson=require(_0x047c('0x9'));var client=jayson['client'][_0x047c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x168117,_0x4d8363,_0x2d9a91){return new BPromise(function(_0x2161bd,_0x4541b2){return client[_0x047c('0xb')](_0x168117,_0x2d9a91)[_0x047c('0xc')](function(_0x586e8d){logger[_0x047c('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x4d8363,_0x047c('0xe'));logger[_0x047c('0xf')](_0x047c('0x10'),_0x4d8363,'request\x20sent',JSON[_0x047c('0x11')](_0x586e8d));if(_0x586e8d[_0x047c('0x12')]){if(_0x586e8d[_0x047c('0x12')][_0x047c('0x13')]===0x1f4){logger[_0x047c('0x12')](_0x047c('0x14'),_0x4d8363,_0x586e8d[_0x047c('0x12')][_0x047c('0x15')]);return _0x4541b2(_0x586e8d[_0x047c('0x12')][_0x047c('0x15')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4d8363,_0x586e8d['error'][_0x047c('0x15')]);return _0x2161bd(_0x586e8d[_0x047c('0x12')][_0x047c('0x15')]);}else{logger[_0x047c('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x4d8363,'request\x20sent');_0x2161bd(_0x586e8d['result']['message']);}})[_0x047c('0x16')](function(_0x420796){logger[_0x047c('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x4d8363,_0x420796);_0x4541b2(_0x420796);});});}exports[_0x047c('0x17')]=function(_0x3b129a){var _0x14eb6d=this;return new Promise(function(_0x4330b8,_0x46573b){return db[_0x047c('0x18')]['create'](_0x3b129a[_0x047c('0x19')],{'raw':_0x3b129a[_0x047c('0x1a')]?_0x3b129a[_0x047c('0x1a')][_0x047c('0x1b')]===undefined?!![]:![]:!![]})[_0x047c('0xc')](function(_0x3c9dc7){logger[_0x047c('0xd')](_0x047c('0x17'),_0x3b129a);logger[_0x047c('0xf')](_0x047c('0x17'),_0x3b129a,JSON[_0x047c('0x11')](_0x3c9dc7));_0x4330b8(_0x3c9dc7);})[_0x047c('0x16')](function(_0x500cc8){logger[_0x047c('0x12')](_0x047c('0x17'),_0x500cc8[_0x047c('0x15')],_0x3b129a);_0x46573b(_0x14eb6d[_0x047c('0x12')](0x1f4,_0x500cc8[_0x047c('0x15')]));});});};exports['AvgHandleTime']=function(_0x596033){var _0x51bdaf=this;return new Promise(function(_0x45832c,_0x3b0a2c){return db[_0x047c('0x18')][_0x047c('0x1c')]({'raw':_0x596033[_0x047c('0x1a')]?_0x596033[_0x047c('0x1a')][_0x047c('0x1b')]===undefined?!![]:![]:!![],'where':_0x596033[_0x047c('0x1a')]?_0x596033[_0x047c('0x1a')][_0x047c('0x1d')]||null:null,'attributes':[[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')][_0x047c('0x1f')]('id')),_0x047c('0x20')],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x22')))),_0x047c('0x23')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db['sequelize'][_0x047c('0x21')](_0x047c('0x25')))),_0x047c('0x26')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x047c('0x27')))),_0x047c('0x28')],[db['sequelize']['fn'](_0x047c('0x29'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0x047c('0x1e')]['fn'](_0x047c('0x29'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x2b')))),'predictiveIntervalAvgTalktime']]})[_0x047c('0xc')](function(_0x44ffdc){logger[_0x047c('0xd')](_0x047c('0x2c'),_0x596033);logger['debug'](_0x047c('0x2c'),_0x596033,JSON['stringify'](_0x44ffdc));_0x45832c(_0x44ffdc);})[_0x047c('0x16')](function(_0xf3cfa4){logger[_0x047c('0x12')](_0x047c('0x2c'),_0xf3cfa4[_0x047c('0x15')],_0x596033);_0x3b0a2c(_0x51bdaf[_0x047c('0x12')](0x1f4,_0xf3cfa4[_0x047c('0x15')]));});});};exports[_0x047c('0x2d')]=function(_0x43975){var _0x256c9f=this;return new Promise(function(_0x36659e,_0x28c963){return db[_0x047c('0x18')][_0x047c('0x1c')]({'raw':_0x43975[_0x047c('0x1a')]?_0x43975[_0x047c('0x1a')][_0x047c('0x1b')]===undefined?!![]:![]:!![],'where':_0x43975['options']?_0x43975[_0x047c('0x1a')][_0x047c('0x1d')]||null:null,'attributes':[[_0x047c('0x2e'),_0x047c('0x2f')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0x047c('0x30')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x31')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')]['literal'](_0x047c('0x22')))),'outboundAnswerCallsDay'],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db['sequelize'][_0x047c('0x21')](_0x047c('0x32')))),_0x047c('0x33')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')]['literal'](_0x047c('0x34')))),_0x047c('0x35')],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x047c('0x36')))),_0x047c('0x37')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x38')))),'outboundDropCallsDayCallersExit'],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db['sequelize']['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x39')))),_0x047c('0x3a')],[db['sequelize']['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x3b')))),_0x047c('0x3c')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db['sequelize'][_0x047c('0x21')](_0x047c('0x3d')))),_0x047c('0x3e')],[db[_0x047c('0x1e')]['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x3f')))),'outboundRejectCallsDay'],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db['sequelize'][_0x047c('0x21')](_0x047c('0x40')))),_0x047c('0x41')],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x42')))),_0x047c('0x43')],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x047c('0x44')]],'group':['campaign']})[_0x047c('0xc')](function(_0x3de804){logger['info'](_0x047c('0x2d'),_0x43975);logger[_0x047c('0xf')](_0x047c('0x2d'),_0x43975,JSON[_0x047c('0x11')](_0x3de804));_0x36659e(_0x3de804);})[_0x047c('0x16')](function(_0x344077){logger['error'](_0x047c('0x2d'),_0x344077[_0x047c('0x15')],_0x43975);_0x28c963(_0x256c9f[_0x047c('0x12')](0x1f4,_0x344077[_0x047c('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x357563){var _0x51bf5f=this;return new Promise(function(_0x29a118,_0x45b1c2){return db[_0x047c('0x18')]['findAll']({'raw':_0x357563['options']?_0x357563[_0x047c('0x1a')][_0x047c('0x1b')]===undefined?!![]:![]:!![],'where':_0x357563[_0x047c('0x1a')]?_0x357563[_0x047c('0x1a')]['where']||null:null,'attributes':[[_0x047c('0x2e'),'name'],[db['sequelize']['fn'](_0x047c('0x24'),db[_0x047c('0x1e')]['col']('id')),'ivrTotalCallsDays'],[db[_0x047c('0x1e')]['fn']('COUNT',db[_0x047c('0x1e')]['fn']('IF',db[_0x047c('0x1e')][_0x047c('0x21')](_0x047c('0x22')))),_0x047c('0x45')]],'group':[_0x047c('0x2e')]})[_0x047c('0xc')](function(_0x35f655){logger['info'](_0x047c('0x46'),_0x357563);logger[_0x047c('0xf')](_0x047c('0x46'),_0x357563,JSON[_0x047c('0x11')](_0x35f655));_0x29a118(_0x35f655);})[_0x047c('0x16')](function(_0x72115a){logger['error'](_0x047c('0x46'),_0x72115a[_0x047c('0x15')],_0x357563);_0x45b1c2(_0x51bf5f[_0x047c('0x12')](0x1f4,_0x72115a['message']));});});}; \ No newline at end of file +var _0xa45c=['AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa45c,0x6d));var _0xca45=function(_0x538e64,_0xdeed89){_0x538e64=_0x538e64-0x0;var _0x5f0d32=_0xa45c[_0x538e64];return _0x5f0d32;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca45('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca45('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca45('0x5'));var client=jayson[_0xca45('0x6')][_0xca45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15628b,_0x578a7b,_0x1a8b9c){return new BPromise(function(_0x276897,_0x7ceab1){return client[_0xca45('0x8')](_0x15628b,_0x1a8b9c)[_0xca45('0x9')](function(_0x5c18b9){logger[_0xca45('0xa')](_0xca45('0xb'),_0x578a7b,_0xca45('0xc'));logger[_0xca45('0xd')](_0xca45('0xe'),_0x578a7b,_0xca45('0xc'),JSON[_0xca45('0xf')](_0x5c18b9));if(_0x5c18b9['error']){if(_0x5c18b9[_0xca45('0x10')][_0xca45('0x11')]===0x1f4){logger[_0xca45('0x10')](_0xca45('0xb'),_0x578a7b,_0x5c18b9['error'][_0xca45('0x12')]);return _0x7ceab1(_0x5c18b9[_0xca45('0x10')][_0xca45('0x12')]);}logger['error'](_0xca45('0xb'),_0x578a7b,_0x5c18b9['error'][_0xca45('0x12')]);return _0x276897(_0x5c18b9[_0xca45('0x10')][_0xca45('0x12')]);}else{logger[_0xca45('0xa')](_0xca45('0xb'),_0x578a7b,_0xca45('0xc'));_0x276897(_0x5c18b9[_0xca45('0x13')]['message']);}})[_0xca45('0x14')](function(_0x5b4e29){logger['error'](_0xca45('0xb'),_0x578a7b,_0x5b4e29);_0x7ceab1(_0x5b4e29);});});}exports[_0xca45('0x15')]=function(_0x553af4){var _0x2e18aa=this;return new Promise(function(_0x184bbf,_0x5820c8){return db[_0xca45('0x16')][_0xca45('0x17')](_0x553af4[_0xca45('0x18')],{'raw':_0x553af4[_0xca45('0x19')]?_0x553af4['options'][_0xca45('0x1a')]===undefined?!![]:![]:!![]})[_0xca45('0x9')](function(_0x1a16f1){logger[_0xca45('0xa')]('CreateCmHopperHistory',_0x553af4);logger[_0xca45('0xd')](_0xca45('0x15'),_0x553af4,JSON[_0xca45('0xf')](_0x1a16f1));_0x184bbf(_0x1a16f1);})[_0xca45('0x14')](function(_0x2068df){logger[_0xca45('0x10')](_0xca45('0x15'),_0x2068df[_0xca45('0x12')],_0x553af4);_0x5820c8(_0x2e18aa[_0xca45('0x10')](0x1f4,_0x2068df['message']));});});};exports[_0xca45('0x1b')]=function(_0x1acb89){var _0x2cac3d=this;return new Promise(function(_0x295403,_0x242cb1){return db['CmHopperHistory']['findAll']({'raw':_0x1acb89['options']?_0x1acb89[_0xca45('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1acb89['options']?_0x1acb89[_0xca45('0x19')][_0xca45('0x1c')]||null:null,'attributes':[[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['col']('id')),_0xca45('0x1f')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xca45('0x20')))),_0xca45('0x21')],[db['sequelize']['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xca45('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xca45('0x23')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xca45('0x24'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')]['literal'](_0xca45('0x25')))),_0xca45('0x26')],[db['sequelize']['fn'](_0xca45('0x24'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x27')))),_0xca45('0x28')]]})[_0xca45('0x9')](function(_0x291dd6){logger[_0xca45('0xa')](_0xca45('0x1b'),_0x1acb89);logger[_0xca45('0xd')](_0xca45('0x1b'),_0x1acb89,JSON[_0xca45('0xf')](_0x291dd6));_0x295403(_0x291dd6);})['catch'](function(_0x5b3a4f){logger['error'](_0xca45('0x1b'),_0x5b3a4f[_0xca45('0x12')],_0x1acb89);_0x242cb1(_0x2cac3d['error'](0x1f4,_0x5b3a4f['message']));});});};exports[_0xca45('0x29')]=function(_0x4a3eb9){var _0x34cfae=this;return new Promise(function(_0x53202c,_0x4de1d0){return db[_0xca45('0x16')][_0xca45('0x2a')]({'raw':_0x4a3eb9[_0xca45('0x19')]?_0x4a3eb9[_0xca45('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4a3eb9[_0xca45('0x19')]?_0x4a3eb9['options'][_0xca45('0x1c')]||null:null,'attributes':[[_0xca45('0x2b'),_0xca45('0x2c')],[db[_0xca45('0x1d')]['fn']('COUNT',db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x2d')))),_0xca45('0x2e')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x20')))),_0xca45('0x2f')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')]['literal'](_0xca45('0x30')))),_0xca45('0x31')],[db[_0xca45('0x1d')]['fn']('COUNT',db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x32')))),'outboundCongestionCallsDay'],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x33')))),_0xca45('0x34')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x35')))),_0xca45('0x36')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0xca45('0x37')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x38')))),_0xca45('0x39')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x3a')))),'outboundOriginateFailureCallsDay'],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x3b')))),_0xca45('0x3c')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xca45('0x3d')],[db[_0xca45('0x1d')]['fn']('COUNT',db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x3e')))),_0xca45('0x3c')],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')](_0xca45('0x3f')))),_0xca45('0x40')]],'group':[_0xca45('0x2b')]})['then'](function(_0x45de07){logger[_0xca45('0xa')](_0xca45('0x29'),_0x4a3eb9);logger[_0xca45('0xd')](_0xca45('0x29'),_0x4a3eb9,JSON[_0xca45('0xf')](_0x45de07));_0x53202c(_0x45de07);})[_0xca45('0x14')](function(_0x20b060){logger[_0xca45('0x10')]('GetVoiceQueueHopperHistory',_0x20b060['message'],_0x4a3eb9);_0x4de1d0(_0x34cfae['error'](0x1f4,_0x20b060['message']));});});};exports[_0xca45('0x41')]=function(_0x95a764){var _0x3827fa=this;return new Promise(function(_0x3a674f,_0x4e7332){return db[_0xca45('0x16')][_0xca45('0x2a')]({'raw':_0x95a764['options']?_0x95a764[_0xca45('0x19')][_0xca45('0x1a')]===undefined?!![]:![]:!![],'where':_0x95a764['options']?_0x95a764[_0xca45('0x19')]['where']||null:null,'attributes':[[_0xca45('0x2b'),'name'],[db[_0xca45('0x1d')]['fn'](_0xca45('0x1e'),db['sequelize']['col']('id')),_0xca45('0x42')],[db[_0xca45('0x1d')]['fn']('COUNT',db[_0xca45('0x1d')]['fn']('IF',db[_0xca45('0x1d')][_0xca45('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xca45('0x43')]],'group':[_0xca45('0x2b')]})[_0xca45('0x9')](function(_0xb3544e){logger[_0xca45('0xa')](_0xca45('0x41'),_0x95a764);logger[_0xca45('0xd')](_0xca45('0x41'),_0x95a764,JSON[_0xca45('0xf')](_0xb3544e));_0x3a674f(_0xb3544e);})['catch'](function(_0x11fe68){logger[_0xca45('0x10')](_0xca45('0x41'),_0x11fe68[_0xca45('0x12')],_0x95a764);_0x4e7332(_0x3827fa[_0xca45('0x10')](0x1f4,_0x11fe68['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fc5757d..9ed1edf 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 _0x6203=['exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','describe','/:id','create','update'];(function(_0x4074ce,_0x5743ca){var _0x1c5abc=function(_0x48623f){while(--_0x48623f){_0x4074ce['push'](_0x4074ce['shift']());}};_0x1c5abc(++_0x5743ca);}(_0x6203,0x10b));var _0x3620=function(_0x1daa8c,_0xa3586b){_0x1daa8c=_0x1daa8c-0x0;var _0x25b48f=_0x6203[_0x1daa8c];return _0x25b48f;};'use strict';var multer=require(_0x3620('0x0'));var util=require(_0x3620('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3620('0x2'));var auth=require(_0x3620('0x3'));var interaction=require(_0x3620('0x4'));var config=require(_0x3620('0x5'));var controller=require(_0x3620('0x6'));router[_0x3620('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3620('0x7')]('/describe',auth[_0x3620('0x8')](),controller[_0x3620('0x9')]);router[_0x3620('0x7')](_0x3620('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3620('0x8')](),controller[_0x3620('0xb')]);router['put'](_0x3620('0xa'),auth[_0x3620('0x8')](),controller[_0x3620('0xc')]);module[_0x3620('0xd')]=router; \ No newline at end of file +var _0xab15=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','exports','util','path','connect-timeout','express','Router'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xab15,0x8e));var _0x5ab1=function(_0x576e6a,_0x8f1f1c){_0x576e6a=_0x576e6a-0x0;var _0x91d0a9=_0xab15[_0x576e6a];return _0x91d0a9;};'use strict';var multer=require('multer');var util=require(_0x5ab1('0x0'));var path=require(_0x5ab1('0x1'));var timeout=require(_0x5ab1('0x2'));var express=require(_0x5ab1('0x3'));var router=express[_0x5ab1('0x4')]();var fs_extra=require(_0x5ab1('0x5'));var auth=require(_0x5ab1('0x6'));var interaction=require(_0x5ab1('0x7'));var config=require(_0x5ab1('0x8'));var controller=require(_0x5ab1('0x9'));router[_0x5ab1('0xa')]('/',auth[_0x5ab1('0xb')](),controller[_0x5ab1('0xc')]);router[_0x5ab1('0xa')](_0x5ab1('0xd'),auth[_0x5ab1('0xb')](),controller[_0x5ab1('0xe')]);router[_0x5ab1('0xa')](_0x5ab1('0xf'),auth['isAuthenticated'](),controller[_0x5ab1('0x10')]);router[_0x5ab1('0x11')]('/',auth[_0x5ab1('0xb')](),controller[_0x5ab1('0x12')]);router['put'](_0x5ab1('0xf'),auth[_0x5ab1('0xb')](),controller[_0x5ab1('0x13')]);module[_0x5ab1('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 70dbcb2..0119cb2 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 _0x06bf=['name','sequelize','exports','STRING'];(function(_0xeea277,_0x56ce7b){var _0x4a84cb=function(_0x3acad0){while(--_0x3acad0){_0xeea277['push'](_0xeea277['shift']());}};_0x4a84cb(++_0x56ce7b);}(_0x06bf,0x105));var _0xf06b=function(_0x4b2fc7,_0x2bc06a){_0x4b2fc7=_0x4b2fc7-0x0;var _0x5c7afe=_0x06bf[_0x4b2fc7];return _0x5c7afe;};'use strict';var Sequelize=require(_0xf06b('0x0'));module[_0xf06b('0x1')]={'name':{'type':Sequelize[_0xf06b('0x2')],'unique':_0xf06b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf06b('0x2')]},'dialPrefix':{'type':Sequelize[_0xf06b('0x2')]}}; \ No newline at end of file +var _0x0dba=['STRING','name','sequelize','exports'];(function(_0x2265bf,_0xf7dbc9){var _0x21085b=function(_0x50c670){while(--_0x50c670){_0x2265bf['push'](_0x2265bf['shift']());}};_0x21085b(++_0xf7dbc9);}(_0x0dba,0x136));var _0xa0db=function(_0x5cc0a7,_0x9309a4){_0x5cc0a7=_0x5cc0a7-0x0;var _0xdeaf11=_0x0dba[_0x5cc0a7];return _0xdeaf11;};'use strict';var Sequelize=require(_0xa0db('0x0'));module[_0xa0db('0x1')]={'name':{'type':Sequelize[_0xa0db('0x2')],'unique':_0xa0db('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa0db('0x2')]},'dialPrefix':{'type':Sequelize[_0xa0db('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 4bf379c..8f86c60 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 _0xf5c8=['from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','info','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Lists','destroy','end','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','describe','isArray','tags','join','each','omit','success','push','errors','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','OrderBy','alias','select'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xf5c8,0x17b));var _0x8f5c=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0xf5c8[_0x59145a];return _0xf04d7;};'use strict';var emlformat=require(_0x8f5c('0x0'));var rimraf=require(_0x8f5c('0x1'));var zipdir=require(_0x8f5c('0x2'));var jsonpatch=require(_0x8f5c('0x3'));var rp=require(_0x8f5c('0x4'));var moment=require('moment');var BPromise=require(_0x8f5c('0x5'));var Mustache=require(_0x8f5c('0x6'));var util=require('util');var path=require(_0x8f5c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8f5c('0x8'));var fs=require('fs');var fs_extra=require(_0x8f5c('0x9'));var _=require(_0x8f5c('0xa'));var squel=require('squel');var crypto=require(_0x8f5c('0xb'));var jsforce=require(_0x8f5c('0xc'));var deskjs=require(_0x8f5c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8f5c('0xe'));var Papa=require(_0x8f5c('0xf'));var Redis=require(_0x8f5c('0x10'));var authService=require(_0x8f5c('0x11'));var qs=require(_0x8f5c('0x12'));var as=require(_0x8f5c('0x13'));var hardwareService=require(_0x8f5c('0x14'));var logger=require(_0x8f5c('0x15'))(_0x8f5c('0x16'));var utils=require(_0x8f5c('0x17'));var config=require(_0x8f5c('0x18'));var licenseUtil=require(_0x8f5c('0x19'));var db=require(_0x8f5c('0x1a'))['db'];var csv_results;config[_0x8f5c('0x1b')]=_['defaults'](config[_0x8f5c('0x1b')],{'host':_0x8f5c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f5c('0x1b')]));require(_0x8f5c('0x1d'))[_0x8f5c('0x1e')](socket);function respondWithStatusCode(_0x58e4d0,_0x2aa182){_0x2aa182=_0x2aa182||0xcc;return function(_0x1bcea2){if(_0x1bcea2){return _0x58e4d0[_0x8f5c('0x1f')](_0x2aa182);}return _0x58e4d0[_0x8f5c('0x20')](_0x2aa182)['end']();};}function respondWithResult(_0x5d7509,_0x1517d3){_0x1517d3=_0x1517d3||0xc8;return function(_0x353f5b){if(_0x353f5b){return _0x5d7509['status'](_0x1517d3)[_0x8f5c('0x21')](_0x353f5b);}};}function respondWithFilteredResult(_0xe4d10a,_0x53d767){return function(_0x4e2278){if(_0x4e2278){var _0x658028=typeof _0x53d767[_0x8f5c('0x22')]===_0x8f5c('0x23')&&typeof _0x53d767[_0x8f5c('0x24')]==='undefined';var _0xbf02a0=_0x4e2278[_0x8f5c('0x25')];var _0x26fa4c=_0x658028?0x0:_0x53d767[_0x8f5c('0x22')];var _0x1685dd=_0x658028?_0x4e2278[_0x8f5c('0x25')]:_0x53d767['offset']+_0x53d767['limit'];var _0x43a795;if(_0x1685dd>=_0xbf02a0){_0x1685dd=_0xbf02a0;_0x43a795=0xc8;}else{_0x43a795=0xce;}_0xe4d10a[_0x8f5c('0x20')](_0x43a795);return _0xe4d10a[_0x8f5c('0x26')](_0x8f5c('0x27'),_0x26fa4c+'-'+_0x1685dd+'/'+_0xbf02a0)[_0x8f5c('0x21')](_0x4e2278);}return null;};}function patchUpdates(_0x31078c){return function(_0x41df68){try{jsonpatch['apply'](_0x41df68,_0x31078c,!![]);}catch(_0x5c9eed){return BPromise[_0x8f5c('0x28')](_0x5c9eed);}return _0x41df68[_0x8f5c('0x29')]();};}function saveUpdates(_0x304841,_0x2f644b){return function(_0xd58ef5){if(_0xd58ef5){return _0xd58ef5[_0x8f5c('0x2a')](_0x304841)[_0x8f5c('0x2b')](function(_0x498d6e){return _0x498d6e;});}return null;};}function removeEntity(_0x1a002a,_0x496008){return function(_0x2f30fd){if(_0x2f30fd){return _0x2f30fd['destroy']()[_0x8f5c('0x2b')](function(){var _0x830303=_0x2f30fd[_0x8f5c('0x2c')]({'plain':!![]});var _0x2c7d4d=_0x8f5c('0x2d');return db['UserProfileResource'][_0x8f5c('0x2e')]({'where':{'type':_0x2c7d4d,'resourceId':_0x830303['id']}})[_0x8f5c('0x2b')](function(){return _0x2f30fd;});})['then'](function(){_0x1a002a[_0x8f5c('0x20')](0xcc)[_0x8f5c('0x2f')]();});}};}function handleEntityNotFound(_0x91337b,_0x3fdc47){return function(_0xbbcd72){if(!_0xbbcd72){_0x91337b[_0x8f5c('0x1f')](0x194);}return _0xbbcd72;};}function handleError(_0x24899d,_0x25ccc7){_0x25ccc7=_0x25ccc7||0x1f4;return function(_0x5106ea){logger[_0x8f5c('0x30')](_0x5106ea[_0x8f5c('0x31')]);if(_0x5106ea[_0x8f5c('0x32')]){delete _0x5106ea['name'];}_0x24899d[_0x8f5c('0x20')](_0x25ccc7)[_0x8f5c('0x33')](_0x5106ea);};}exports[_0x8f5c('0x34')]=function(_0x151003,_0x39fec9){var _0x47e917={},_0x307db1={},_0x532688={'count':0x0,'rows':[]};var _0x127506=_[_0x8f5c('0x35')](db[_0x8f5c('0x36')][_0x8f5c('0x37')],function(_0x5a5ab6){return{'name':_0x5a5ab6[_0x8f5c('0x38')],'type':_0x5a5ab6[_0x8f5c('0x39')][_0x8f5c('0x3a')]};});_0x307db1['model']=_[_0x8f5c('0x35')](_0x127506,_0x8f5c('0x32'));_0x307db1[_0x8f5c('0x3b')]=_[_0x8f5c('0x3c')](_0x151003[_0x8f5c('0x3b')]);_0x307db1[_0x8f5c('0x3d')]=_[_0x8f5c('0x3e')](_0x307db1['model'],_0x307db1['query']);_0x47e917[_0x8f5c('0x3f')]=_['intersection'](_0x307db1[_0x8f5c('0x40')],qs[_0x8f5c('0x41')](_0x151003[_0x8f5c('0x3b')][_0x8f5c('0x41')]));_0x47e917[_0x8f5c('0x3f')]=_0x47e917[_0x8f5c('0x3f')]['length']?_0x47e917[_0x8f5c('0x3f')]:_0x307db1[_0x8f5c('0x40')];if(!_0x151003['query'][_0x8f5c('0x42')](_0x8f5c('0x43'))){_0x47e917['limit']=qs[_0x8f5c('0x24')](_0x151003[_0x8f5c('0x3b')]['limit']);_0x47e917[_0x8f5c('0x22')]=qs[_0x8f5c('0x22')](_0x151003[_0x8f5c('0x3b')][_0x8f5c('0x22')]);}_0x47e917[_0x8f5c('0x44')]=qs[_0x8f5c('0x45')](_0x151003[_0x8f5c('0x3b')][_0x8f5c('0x45')]);_0x47e917['where']=qs[_0x8f5c('0x3d')](_[_0x8f5c('0x46')](_0x151003[_0x8f5c('0x3b')],_0x307db1[_0x8f5c('0x3d')]),_0x127506);if(_0x151003[_0x8f5c('0x3b')]['filter']){_0x47e917[_0x8f5c('0x47')]=_[_0x8f5c('0x48')](_0x47e917[_0x8f5c('0x47')],{'$or':_[_0x8f5c('0x35')](_0x127506,function(_0x310c6d){if(_0x310c6d[_0x8f5c('0x39')]!==_0x8f5c('0x49')){var _0x414b4f={};_0x414b4f[_0x310c6d[_0x8f5c('0x32')]]={'$like':'%'+_0x151003['query'][_0x8f5c('0x4a')]+'%'};return _0x414b4f;}})});}_0x47e917=_[_0x8f5c('0x48')]({},_0x47e917,_0x151003[_0x8f5c('0x4b')]);var _0x32f045={'where':_0x47e917[_0x8f5c('0x47')]};return db[_0x8f5c('0x36')][_0x8f5c('0x25')](_0x32f045)[_0x8f5c('0x2b')](function(_0x3a3350){_0x532688['count']=_0x3a3350;if(_0x151003['query']['includeAll']){_0x47e917[_0x8f5c('0x4c')]=[{'all':!![]}];}return db[_0x8f5c('0x36')][_0x8f5c('0x4d')](_0x47e917);})[_0x8f5c('0x2b')](function(_0x54d532){_0x532688[_0x8f5c('0x4e')]=_0x54d532;return _0x532688;})['then'](respondWithFilteredResult(_0x39fec9,_0x47e917))['catch'](handleError(_0x39fec9,null));};exports['show']=function(_0xfcc68a,_0xb6cdad){var _0x3c62ac={'raw':![],'where':{'id':_0xfcc68a[_0x8f5c('0x4f')]['id']}},_0xa646af={};_0xa646af['model']=_[_0x8f5c('0x3c')](db[_0x8f5c('0x36')][_0x8f5c('0x37')]);_0xa646af['query']=_[_0x8f5c('0x3c')](_0xfcc68a[_0x8f5c('0x3b')]);_0xa646af['filters']=_[_0x8f5c('0x3e')](_0xa646af[_0x8f5c('0x40')],_0xa646af[_0x8f5c('0x3b')]);_0x3c62ac[_0x8f5c('0x3f')]=_[_0x8f5c('0x3e')](_0xa646af[_0x8f5c('0x40')],qs['fields'](_0xfcc68a[_0x8f5c('0x3b')][_0x8f5c('0x41')]));_0x3c62ac['attributes']=_0x3c62ac[_0x8f5c('0x3f')][_0x8f5c('0x50')]?_0x3c62ac['attributes']:_0xa646af['model'];if(_0xfcc68a[_0x8f5c('0x3b')]['includeAll']){_0x3c62ac[_0x8f5c('0x4c')]=[{'all':!![]}];}_0x3c62ac=_['merge']({},_0x3c62ac,_0xfcc68a[_0x8f5c('0x4b')]);return db[_0x8f5c('0x36')][_0x8f5c('0x51')](_0x3c62ac)['then'](handleEntityNotFound(_0xb6cdad,null))[_0x8f5c('0x2b')](respondWithResult(_0xb6cdad,null))['catch'](handleError(_0xb6cdad,null));};exports[_0x8f5c('0x52')]=function(_0x2bbec9,_0x5261ae){return db[_0x8f5c('0x36')][_0x8f5c('0x52')](_0x2bbec9[_0x8f5c('0x53')],{})[_0x8f5c('0x2b')](function(_0x2c0624){var _0x5d04a7=_0x2bbec9[_0x8f5c('0x54')][_0x8f5c('0x2c')]({'plain':!![]});if(!_0x5d04a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d04a7[_0x8f5c('0x55')]==='user'){var _0x2eba35=_0x2c0624[_0x8f5c('0x2c')]({'plain':!![]});var _0x2539ca='Lists';return db[_0x8f5c('0x56')]['find']({'where':{'name':_0x2539ca,'userProfileId':_0x5d04a7[_0x8f5c('0x57')]},'raw':!![]})[_0x8f5c('0x2b')](function(_0x345f80){if(_0x345f80&&_0x345f80[_0x8f5c('0x58')]===0x0){return db[_0x8f5c('0x59')][_0x8f5c('0x52')]({'name':_0x2eba35[_0x8f5c('0x32')],'resourceId':_0x2eba35['id'],'type':_0x345f80[_0x8f5c('0x32')],'sectionId':_0x345f80['id']},{})[_0x8f5c('0x2b')](function(){return _0x2c0624;});}else{return _0x2c0624;}})['catch'](function(_0xa9abaf){logger['error'](_0x8f5c('0x5a'),_0xa9abaf);throw _0xa9abaf;});}return _0x2c0624;})[_0x8f5c('0x2b')](respondWithResult(_0x5261ae,0xc9))[_0x8f5c('0x5b')](handleError(_0x5261ae,null));};exports[_0x8f5c('0x2a')]=function(_0x45a9e6,_0x14395a){if(_0x45a9e6['body']['id']){delete _0x45a9e6[_0x8f5c('0x53')]['id'];}return db['CmList'][_0x8f5c('0x51')]({'where':{'id':_0x45a9e6[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x14395a,null))[_0x8f5c('0x2b')](saveUpdates(_0x45a9e6[_0x8f5c('0x53')],null))[_0x8f5c('0x2b')](respondWithResult(_0x14395a,null))['catch'](handleError(_0x14395a,null));};exports[_0x8f5c('0x2e')]=function(_0x20c6b8,_0x227a55){return db[_0x8f5c('0x36')][_0x8f5c('0x51')]({'where':{'id':_0x20c6b8[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x227a55,null))['then'](removeEntity(_0x227a55,null))[_0x8f5c('0x5b')](handleError(_0x227a55,null));};exports['describe']=function(_0xa8d1fb,_0x53e7c4){return db[_0x8f5c('0x36')]['describe']()[_0x8f5c('0x2b')](respondWithResult(_0x53e7c4,null))[_0x8f5c('0x5b')](handleError(_0x53e7c4,null));};exports[_0x8f5c('0x5c')]=function(_0x5397c4,_0x43564f,_0x16c74f){if(_0x5397c4[_0x8f5c('0x53')]['id']){delete _0x5397c4[_0x8f5c('0x53')]['id'];}return db[_0x8f5c('0x36')][_0x8f5c('0x51')]({'where':{'id':_0x5397c4[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x43564f,null))['then'](function(_0x43796d){if(_0x43796d){_0x5397c4[_0x8f5c('0x53')][_0x8f5c('0x5d')]=_0x43796d['id'];return db[_0x8f5c('0x5e')]['create'](_0x5397c4[_0x8f5c('0x53')]);}})[_0x8f5c('0x2b')](respondWithResult(_0x43564f,null))[_0x8f5c('0x5b')](handleError(_0x43564f,null));};exports[_0x8f5c('0x5f')]=function(_0x43149c,_0x19790e,_0x7c7351){var _0x54327a={'raw':![],'where':{}};var _0x29ae91={};var _0x8abc2f={'count':0x0,'rows':[]};return db[_0x8f5c('0x36')][_0x8f5c('0x60')]({'where':{'id':_0x43149c[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x19790e,null))['then'](function(_0x343bc0){if(_0x343bc0){_0x29ae91[_0x8f5c('0x40')]=_['keys'](db[_0x8f5c('0x5e')][_0x8f5c('0x37')]);_0x29ae91['query']=_[_0x8f5c('0x3c')](_0x43149c['query']);_0x29ae91[_0x8f5c('0x3d')]=_[_0x8f5c('0x3e')](_0x29ae91[_0x8f5c('0x40')],_0x29ae91['query']);_0x54327a[_0x8f5c('0x3f')]=_[_0x8f5c('0x3e')](_0x29ae91[_0x8f5c('0x40')],qs[_0x8f5c('0x41')](_0x43149c[_0x8f5c('0x3b')]['fields']));_0x54327a[_0x8f5c('0x3f')]=_0x54327a[_0x8f5c('0x3f')]['length']?_0x54327a[_0x8f5c('0x3f')]:_0x29ae91[_0x8f5c('0x40')];if(!_0x43149c[_0x8f5c('0x3b')]['hasOwnProperty'](_0x8f5c('0x43'))){_0x54327a[_0x8f5c('0x24')]=qs[_0x8f5c('0x24')](_0x43149c[_0x8f5c('0x3b')][_0x8f5c('0x24')]);_0x54327a[_0x8f5c('0x22')]=qs['offset'](_0x43149c['query'][_0x8f5c('0x22')]);}_0x54327a['order']=qs['sort'](_0x43149c[_0x8f5c('0x3b')]['sort']);_0x54327a['where']=qs[_0x8f5c('0x3d')](_[_0x8f5c('0x46')](_0x43149c[_0x8f5c('0x3b')],_0x29ae91[_0x8f5c('0x3d')]));_0x54327a[_0x8f5c('0x47')]['ListId']=_0x343bc0['id'];if(_0x43149c['query'][_0x8f5c('0x4a')]){_0x54327a['where']=_[_0x8f5c('0x48')](_0x54327a[_0x8f5c('0x47')],{'$or':_[_0x8f5c('0x35')](_0x54327a[_0x8f5c('0x3f')],function(_0x2f048f){var _0xa70bfd={};_0xa70bfd[_0x2f048f]={'$like':'%'+_0x43149c[_0x8f5c('0x3b')][_0x8f5c('0x4a')]+'%'};return _0xa70bfd;})});}_0x54327a=_[_0x8f5c('0x48')]({},_0x54327a,_0x43149c[_0x8f5c('0x4b')]);return db[_0x8f5c('0x5e')][_0x8f5c('0x25')]({'where':_0x54327a[_0x8f5c('0x47')]})[_0x8f5c('0x2b')](function(_0x2ed635){_0x8abc2f[_0x8f5c('0x25')]=_0x2ed635;if(_0x43149c[_0x8f5c('0x3b')]['includeAll']){_0x54327a[_0x8f5c('0x4c')]=[{'all':!![]}];}return db[_0x8f5c('0x5e')][_0x8f5c('0x4d')](_0x54327a);})[_0x8f5c('0x2b')](function(_0x149249){_0x8abc2f[_0x8f5c('0x4e')]=_0x149249;return _0x8abc2f;});}})[_0x8f5c('0x2b')](respondWithFilteredResult(_0x19790e,_0x54327a))[_0x8f5c('0x5b')](handleError(_0x19790e,null));};exports[_0x8f5c('0x61')]=function(_0x490421,_0x1d9cb0,_0x1492c0){return db[_0x8f5c('0x36')][_0x8f5c('0x51')]({'where':{'id':_0x490421[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x1d9cb0,null))[_0x8f5c('0x2b')](function(_0x3507f8){if(_0x3507f8){return _0x3507f8[_0x8f5c('0x61')](_0x490421[_0x8f5c('0x3b')][_0x8f5c('0x62')]);}})[_0x8f5c('0x2b')](respondWithStatusCode(_0x1d9cb0,null))[_0x8f5c('0x5b')](handleError(_0x1d9cb0,null));};exports[_0x8f5c('0x63')]=function(_0x4dcca6,_0x3a1037,_0x4433c7){return db['CmList'][_0x8f5c('0x51')]({'where':{'id':_0x4dcca6['params']['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x3a1037,null))[_0x8f5c('0x2b')](function(_0xc7f4e5){if(_0xc7f4e5){var _0x442afd=[];var _0x5e6f68={'success':[],'errors':[]};return db[_0x8f5c('0x64')][_0x8f5c('0x65')]()[_0x8f5c('0x2b')](function(_0x568cda){if(_0x4dcca6[_0x8f5c('0x53')]['tags']&&_[_0x8f5c('0x66')](_0x4dcca6[_0x8f5c('0x53')][_0x8f5c('0x67')])){if(_0x4dcca6['body'][_0x8f5c('0x67')][_0x8f5c('0x50')]){_0x4dcca6['body']['tags']=_0x4dcca6[_0x8f5c('0x53')][_0x8f5c('0x67')][_0x8f5c('0x68')](';')+';';}else{_0x4dcca6['body']['tags']=null;}}else{_0x4dcca6['body'][_0x8f5c('0x67')]=null;}if(_0x4dcca6[_0x8f5c('0x53')]&&_[_0x8f5c('0x66')](_0x4dcca6[_0x8f5c('0x53')])){for(var _0xa5f6ff=0x0;_0xa5f6ff<_0x4dcca6[_0x8f5c('0x53')][_0x8f5c('0x50')];_0xa5f6ff+=0x1){_0x4dcca6['body'][_0xa5f6ff][_0x8f5c('0x5d')]=_0x4dcca6[_0x8f5c('0x4f')]['id'];_0x442afd['push'](_0x4dcca6[_0x8f5c('0x53')][_0xa5f6ff]);}return BPromise[_0x8f5c('0x69')](_0x442afd,function(_0x8125b6){return db[_0x8f5c('0x64')]['create'](_[_0x8f5c('0x6a')](_0x8125b6,[_0x8f5c('0x62'),'id'])||{},{'fields':_['keys'](_0x568cda),'raw':!![]})[_0x8f5c('0x2b')](function(_0xa9e859){_0x5e6f68[_0x8f5c('0x6b')][_0x8f5c('0x6c')](_0xa9e859['dataValues']);})[_0x8f5c('0x5b')](function(_0x25a1df){_0x5e6f68[_0x8f5c('0x6d')]['push']({'data':_0x8125b6,'error':_0x25a1df['message']});});})[_0x8f5c('0x2b')](function(_0x3b6fac){return _0x5e6f68;})[_0x8f5c('0x5b')](function(_0x1e1421){return _0x1e1421;});}else{_0x3a1037[_0x8f5c('0x20')](0x190)[_0x8f5c('0x21')]({'message':_0x8f5c('0x6e')});}});}})[_0x8f5c('0x2b')](respondWithResult(_0x3a1037,null))[_0x8f5c('0x5b')](handleError(_0x3a1037,null));};exports['getContacts']=function(_0x59034e,_0x576a11,_0x15469e){var _0x3df859;return db[_0x8f5c('0x36')]['find']({'where':{'id':_0x59034e[_0x8f5c('0x4f')]['id']},'include':[{'model':db[_0x8f5c('0x6f')],'as':_0x8f5c('0x70')}]})[_0x8f5c('0x2b')](handleEntityNotFound(_0x576a11,null))[_0x8f5c('0x2b')](function(_0x5670a1){if(_0x5670a1){_0x3df859=_0x5670a1;return db[_0x8f5c('0x64')]['rawAttributes'];}})[_0x8f5c('0x2b')](function(_0x2e7f32){if(_0x2e7f32){var _0x4b29fc={};var _0x4b1df2={};_0x4b1df2[_0x8f5c('0x40')]=_[_0x8f5c('0x71')](_[_0x8f5c('0x3c')](_0x2e7f32),_[_0x8f5c('0x35')](_0x3df859[_0x8f5c('0x70')],function(_0x38db3f){return util[_0x8f5c('0x72')](_0x8f5c('0x73'),_0x38db3f['id']);}));_0x4b1df2['query']=_[_0x8f5c('0x3c')](_0x59034e[_0x8f5c('0x3b')]);_0x4b1df2[_0x8f5c('0x3d')]=_[_0x8f5c('0x3e')](_0x4b1df2['model'],_0x4b1df2[_0x8f5c('0x3b')]);_0x4b29fc[_0x8f5c('0x3f')]=_[_0x8f5c('0x3e')](_0x4b1df2[_0x8f5c('0x40')],qs[_0x8f5c('0x41')](_0x59034e[_0x8f5c('0x3b')][_0x8f5c('0x41')]));_0x4b29fc[_0x8f5c('0x3f')]=_0x4b29fc[_0x8f5c('0x3f')]['length']?_0x4b29fc[_0x8f5c('0x3f')]:_0x4b1df2[_0x8f5c('0x40')];if(!_0x59034e[_0x8f5c('0x3b')][_0x8f5c('0x42')]('nolimit')){_0x4b29fc[_0x8f5c('0x24')]=qs[_0x8f5c('0x24')](_0x59034e[_0x8f5c('0x3b')][_0x8f5c('0x24')]);_0x4b29fc[_0x8f5c('0x22')]=qs[_0x8f5c('0x22')](_0x59034e[_0x8f5c('0x3b')][_0x8f5c('0x22')]);}_0x4b29fc[_0x8f5c('0x44')]=qs[_0x8f5c('0x45')](_0x59034e[_0x8f5c('0x3b')][_0x8f5c('0x45')]);_0x4b29fc[_0x8f5c('0x47')]=qs[_0x8f5c('0x3d')](_[_0x8f5c('0x46')](_0x59034e['query'],_0x4b1df2[_0x8f5c('0x3d')]));_0x4b29fc[_0x8f5c('0x74')]=!![];if(_0x59034e[_0x8f5c('0x3b')]['filter']){_0x4b29fc[_0x8f5c('0x47')]=_[_0x8f5c('0x48')](_0x4b29fc[_0x8f5c('0x47')],{'$or':_[_0x8f5c('0x35')](_0x4b29fc[_0x8f5c('0x3f')],function(_0x4fb555){var _0x497fad={};_0x497fad[_0x4fb555]={'$like':'%'+_0x59034e[_0x8f5c('0x3b')][_0x8f5c('0x4a')]+'%'};return _0x497fad;})});}_0x4b29fc=_[_0x8f5c('0x48')]({},_0x4b29fc,_0x59034e[_0x8f5c('0x4b')]);return _0x3df859[_0x8f5c('0x75')](_0x4b29fc);}})[_0x8f5c('0x2b')](respondWithResult(_0x576a11,null))[_0x8f5c('0x5b')](handleError(_0x576a11,null));};exports[_0x8f5c('0x76')]=function(_0x5a9632,_0x564251,_0xa2323f){var _0x4fc95;var _0x46c827;var _0x2d346d;var _0x11b595=_0x5a9632['params']['id'];csv_results=[];return db['ContactItemType'][_0x8f5c('0x4d')]({'attributes':['id',_0x8f5c('0x32')],'raw':!![],'order':[_0x8f5c('0x77')]})[_0x8f5c('0x2b')](function(_0x12c2c9){_0x4fc95=_0x12c2c9;var _0x5cf45e=_[_0x8f5c('0x3c')](db[_0x8f5c('0x64')][_0x8f5c('0x37')]);return db[_0x8f5c('0x6f')][_0x8f5c('0x4d')]({'raw':!![],'attributes':['id',_0x8f5c('0x78')]})[_0x8f5c('0x2b')](function(_0x4c7b80){_0x46c827=_0x4c7b80;var _0x37fd2a=squel[_0x8f5c('0x79')]()['fields'](_0x5cf45e)[_0x8f5c('0x7a')](_0x8f5c('0x7b'),'c')['where']('c.ListId\x20=\x20?',_0x11b595)['where'](_0x8f5c('0x7c'))[_0x8f5c('0x7d')]();for(var _0x1323b3=0x0;_0x1323b3<_0x46c827['length'];_0x1323b3++){_0x37fd2a[_0x8f5c('0x7e')](_0x8f5c('0x7f')+_0x46c827[_0x1323b3]['id'],'customField_'+_0x46c827[_0x1323b3][_0x8f5c('0x78')]);}for(var _0x1323b3=0x0;_0x1323b3<_0x4fc95[_0x8f5c('0x50')];_0x1323b3++){_0x37fd2a['field'](squel[_0x8f5c('0x79')]()[_0x8f5c('0x7e')](_0x8f5c('0x80'))[_0x8f5c('0x7a')](_0x8f5c('0x81'))[_0x8f5c('0x47')]('ItemTypeId\x20=\x20?',_0x4fc95[_0x1323b3]['id'])['where'](_0x8f5c('0x82')),_0x8f5c('0x83')+_0x4fc95[_0x1323b3][_0x8f5c('0x32')]);_0x37fd2a['field'](squel[_0x8f5c('0x79')]()[_0x8f5c('0x7e')]('description')[_0x8f5c('0x7a')](_0x8f5c('0x81'))[_0x8f5c('0x47')]('ItemTypeId\x20=\x20?',_0x4fc95[_0x1323b3]['id'])[_0x8f5c('0x47')](_0x8f5c('0x82')),_0x8f5c('0x84')+_0x4fc95[_0x1323b3]['name']);}var _0xb58547=[];_0xb58547[_0x8f5c('0x6c')](_0x37fd2a[_0x8f5c('0x85')]());BPromise[_0x8f5c('0x69')](_0xb58547,handleQuery)[_0x8f5c('0x2b')](function(_0x307e08){handleQuery(_0x37fd2a[_0x8f5c('0x85')]());var _0x48554e=csv_results[0x0];if(!_[_0x8f5c('0x86')](_0x48554e)){var _0x149e79=toCsv(_0x48554e);var _0x59f22d=Date['now']();fs[_0x8f5c('0x87')](util[_0x8f5c('0x72')](_0x8f5c('0x88'),_0x11b595,_0x59f22d),_0x149e79);_0x564251['setHeader']('Content-disposition',_0x8f5c('0x89')+util[_0x8f5c('0x72')](_0x8f5c('0x8a'),_0x11b595,_0x59f22d));_0x564251[_0x8f5c('0x8b')](_0x8f5c('0x8c'),_0x8f5c('0x8d'));return _0x564251[_0x8f5c('0x8e')](util[_0x8f5c('0x72')]('/tmp/list_%d_%s.csv',_0x11b595,_0x59f22d));}else{return _0x564251['sendStatus'](0xcc);}});});});};exports[_0x8f5c('0x8f')]=function(_0x2a95ca,_0x2f1cff,_0x2359ed){var _0x35228c;delete _0x2a95ca[_0x8f5c('0x53')]['id'];return db[_0x8f5c('0x36')][_0x8f5c('0x60')]({'where':{'id':_0x2a95ca[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x2f1cff,null))[_0x8f5c('0x2b')](function(_0x51a57a){if(_0x51a57a){return db['sequelize'][_0x8f5c('0x90')](function(_0x1c933d){return db[_0x8f5c('0x6f')][_0x8f5c('0x52')](_0x2a95ca[_0x8f5c('0x53')],{'transaction':_0x1c933d})[_0x8f5c('0x2b')](function(_0x28879c){_0x35228c=_0x28879c;return _0x51a57a[_0x8f5c('0x91')](_0x28879c,{'transaction':_0x1c933d});})[_0x8f5c('0x2b')](function(){var _0x50193d={'type':db[_0x8f5c('0x92')]['TEXT'],'transaction':_0x1c933d};switch(_0x2a95ca[_0x8f5c('0x53')][_0x8f5c('0x39')]){case _0x8f5c('0x93'):_0x50193d[_0x8f5c('0x39')]=db[_0x8f5c('0x92')]['TEXT'];break;case _0x8f5c('0x94'):_0x50193d[_0x8f5c('0x39')]=db[_0x8f5c('0x92')][_0x8f5c('0x95')];break;case _0x8f5c('0x96'):_0x50193d['type']=db['Sequelize'][_0x8f5c('0x97')];_0x50193d[_0x8f5c('0x98')]=![];break;default:}return db['sequelize'][_0x8f5c('0x99')][_0x8f5c('0x9a')]('cm_contacts',util[_0x8f5c('0x72')](_0x8f5c('0x9b'),_0x35228c['id']),_0x50193d);})[_0x8f5c('0x2b')](function(){return _0x35228c;});});}})[_0x8f5c('0x2b')](respondWithResult(_0x2f1cff,null))[_0x8f5c('0x5b')](handleError(_0x2f1cff,null));};exports[_0x8f5c('0x9c')]=function(_0x5e1779,_0x348f09,_0x2d03b1){var _0x316035={};var _0x2b705d={};var _0x552240;var _0x53d208;return db[_0x8f5c('0x36')]['findOne']({'where':{'id':_0x5e1779[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x348f09,null))[_0x8f5c('0x2b')](function(_0x725cbe){if(_0x725cbe){_0x552240=_0x725cbe;_0x2b705d[_0x8f5c('0x40')]=_[_0x8f5c('0x3c')](db[_0x8f5c('0x6f')][_0x8f5c('0x37')]);_0x2b705d[_0x8f5c('0x3b')]=_['keys'](_0x5e1779[_0x8f5c('0x3b')]);_0x2b705d[_0x8f5c('0x3d')]=_[_0x8f5c('0x3e')](_0x2b705d[_0x8f5c('0x40')],_0x2b705d[_0x8f5c('0x3b')]);_0x316035['attributes']=_[_0x8f5c('0x3e')](_0x2b705d[_0x8f5c('0x40')],qs[_0x8f5c('0x41')](_0x5e1779[_0x8f5c('0x3b')][_0x8f5c('0x41')]));_0x316035[_0x8f5c('0x3f')]=_0x316035['attributes']['length']?_0x316035[_0x8f5c('0x3f')]:_0x2b705d['model'];_0x316035[_0x8f5c('0x44')]=qs['sort'](_0x5e1779[_0x8f5c('0x3b')][_0x8f5c('0x45')]);_0x316035[_0x8f5c('0x47')]=qs['filters'](_[_0x8f5c('0x46')](_0x5e1779[_0x8f5c('0x3b')],_0x2b705d[_0x8f5c('0x3d')]));_0x316035['where']=_[_0x8f5c('0x48')](_0x316035[_0x8f5c('0x47')],{'$or':[{'ListId':_0x725cbe['id']},{'ListId':null}]});if(_0x5e1779[_0x8f5c('0x3b')]['filter']){_0x316035[_0x8f5c('0x47')]=_[_0x8f5c('0x48')](_0x316035[_0x8f5c('0x47')],{'$or':_['map'](_0x316035[_0x8f5c('0x3f')],function(_0x5114c7){var _0x281c7b={};_0x281c7b[_0x5114c7]={'$like':'%'+_0x5e1779[_0x8f5c('0x3b')]['filter']+'%'};return _0x281c7b;})});}_0x316035=_[_0x8f5c('0x48')]({},_0x316035,_0x5e1779[_0x8f5c('0x4b')]);return db[_0x8f5c('0x6f')][_0x8f5c('0x9d')](_0x316035);}})[_0x8f5c('0x2b')](respondWithResult(_0x348f09,null))[_0x8f5c('0x5b')](handleError(_0x348f09,null));};exports[_0x8f5c('0x9e')]=function(_0x3ac0ba,_0x3a6609){return db[_0x8f5c('0x6f')][_0x8f5c('0x9d')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x3a6609,null))['then'](function(_0x550da2){return _0x550da2;})[_0x8f5c('0x2b')](respondWithResult(_0x3a6609,null))[_0x8f5c('0x5b')](handleError(_0x3a6609,null));};exports['addAgents']=function(_0x1fbd70,_0xdd1a63,_0x22e38b){return db[_0x8f5c('0x36')][_0x8f5c('0x51')]({'where':{'id':_0x1fbd70[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0xdd1a63,null))['then'](function(_0x582e97){if(_0x582e97){return _0x582e97[_0x8f5c('0x9f')](_0x1fbd70[_0x8f5c('0x53')]['ids'],_[_0x8f5c('0x6a')](_0x1fbd70[_0x8f5c('0x53')],[_0x8f5c('0x62'),'id'])||{})[_0x8f5c('0xa0')](function(_0x558db9){for(var _0x17def2=0x0;_0x17def2<_0x1fbd70[_0x8f5c('0x53')][_0x8f5c('0x62')]['length'];_0x17def2+=0x1){socket[_0x8f5c('0xa1')]('userCmList:save',{'UserId':Number(_0x1fbd70[_0x8f5c('0x53')][_0x8f5c('0x62')][_0x17def2]),'CmListId':Number(_0x1fbd70[_0x8f5c('0x4f')]['id'])});}return _0x558db9;});}})['then'](respondWithResult(_0xdd1a63,null))[_0x8f5c('0x5b')](handleError(_0xdd1a63,null));};exports['removeAgents']=function(_0x3df566,_0x22f46b,_0x2bce7f){return db[_0x8f5c('0x36')][_0x8f5c('0x51')]({'where':{'id':_0x3df566[_0x8f5c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x22f46b,null))['then'](function(_0x1ce483){if(_0x1ce483){return _0x1ce483[_0x8f5c('0xa2')](_0x3df566[_0x8f5c('0x3b')][_0x8f5c('0x62')])[_0x8f5c('0x2b')](function(){if(_[_0x8f5c('0x66')](_0x3df566[_0x8f5c('0x3b')]['ids'])){for(var _0x123f98=0x0;_0x123f98<_0x3df566['query'][_0x8f5c('0x62')][_0x8f5c('0x50')];_0x123f98+=0x1){socket[_0x8f5c('0xa1')](_0x8f5c('0xa3'),{'UserId':Number(_0x3df566[_0x8f5c('0x3b')][_0x8f5c('0x62')][_0x123f98]),'CmListId':Number(_0x3df566[_0x8f5c('0x4f')]['id'])});}}else{socket[_0x8f5c('0xa1')](_0x8f5c('0xa3'),{'UserId':Number(_0x3df566[_0x8f5c('0x3b')]['ids']),'CmListId':Number(_0x3df566['params']['id'])});}});}})[_0x8f5c('0x2b')](respondWithStatusCode(_0x22f46b,null))[_0x8f5c('0x5b')](handleError(_0x22f46b,null));};exports['getAgents']=function(_0x5e7013,_0x12aee6,_0x57e7f0){var _0x1455ac={};var _0x3e551b={};var _0x3b723c;var _0x2bc0fe;return db[_0x8f5c('0x36')]['findOne']({'where':{'id':_0x5e7013[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2b')](handleEntityNotFound(_0x12aee6,null))[_0x8f5c('0x2b')](function(_0x1596f5){if(_0x1596f5){_0x3b723c=_0x1596f5;_0x3e551b[_0x8f5c('0x40')]=_[_0x8f5c('0x3c')](db['User'][_0x8f5c('0x37')]);_0x3e551b[_0x8f5c('0x3b')]=_[_0x8f5c('0x3c')](_0x5e7013[_0x8f5c('0x3b')]);_0x3e551b[_0x8f5c('0x3d')]=_['intersection'](_0x3e551b[_0x8f5c('0x40')],_0x3e551b[_0x8f5c('0x3b')]);_0x1455ac[_0x8f5c('0x3f')]=_['intersection'](_0x3e551b[_0x8f5c('0x40')],qs[_0x8f5c('0x41')](_0x5e7013['query'][_0x8f5c('0x41')]));_0x1455ac[_0x8f5c('0x3f')]=_0x1455ac[_0x8f5c('0x3f')][_0x8f5c('0x50')]?_0x1455ac['attributes']:_0x3e551b['model'];_0x1455ac[_0x8f5c('0x44')]=qs[_0x8f5c('0x45')](_0x5e7013[_0x8f5c('0x3b')][_0x8f5c('0x45')]);_0x1455ac[_0x8f5c('0x47')]=qs[_0x8f5c('0x3d')](_[_0x8f5c('0x46')](_0x5e7013['query'],_0x3e551b['filters']));if(_0x5e7013[_0x8f5c('0x3b')][_0x8f5c('0x4a')]){_0x1455ac['where']=_['merge'](_0x1455ac[_0x8f5c('0x47')],{'$or':_[_0x8f5c('0x35')](_0x1455ac[_0x8f5c('0x3f')],function(_0x187508){var _0x3ea7c4={};_0x3ea7c4[_0x187508]={'$like':'%'+_0x5e7013['query'][_0x8f5c('0x4a')]+'%'};return _0x3ea7c4;})});}_0x1455ac=_[_0x8f5c('0x48')]({},_0x1455ac,_0x5e7013[_0x8f5c('0x4b')]);return _0x3b723c[_0x8f5c('0xa4')](_0x1455ac);}})['then'](function(_0x30f8d1){if(_0x30f8d1){_0x2bc0fe=_0x30f8d1[_0x8f5c('0x50')];if(!_0x5e7013[_0x8f5c('0x3b')][_0x8f5c('0x42')](_0x8f5c('0x43'))){_0x1455ac[_0x8f5c('0x24')]=qs[_0x8f5c('0x24')](_0x5e7013[_0x8f5c('0x3b')][_0x8f5c('0x24')]);_0x1455ac[_0x8f5c('0x22')]=qs[_0x8f5c('0x22')](_0x5e7013[_0x8f5c('0x3b')][_0x8f5c('0x22')]);}return _0x3b723c[_0x8f5c('0xa4')](_0x1455ac);}})[_0x8f5c('0x2b')](function(_0x292941){if(_0x292941){return _0x292941?{'count':_0x2bc0fe,'rows':_0x292941}:null;}})[_0x8f5c('0x2b')](respondWithResult(_0x12aee6,null))['catch'](handleError(_0x12aee6,null));};function handleQuery(_0x4372ce){logger[_0x8f5c('0xa5')](_0x4372ce);return db[_0x8f5c('0xa6')]['query'](_0x4372ce)[_0x8f5c('0xa0')](function(_0x5b8d9a){csv_results[_0x8f5c('0x6c')](_0x5b8d9a);})[_0x8f5c('0x5b')](function(_0x3c0e5d){logger['error'](_0x3c0e5d['message']);});} \ No newline at end of file +var _0x601b=['getContacts','CmCustomField','concat','format','raw','getContactsCsv','ContactItemType','alias','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','field','select','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','order','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','sort','pick','filter','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','omit','push','dataValues','errors','Malformed\x20request\x20syntax'];(function(_0x99a6c9,_0x3ee884){var _0x4aff06=function(_0x27d0a6){while(--_0x27d0a6){_0x99a6c9['push'](_0x99a6c9['shift']());}};_0x4aff06(++_0x3ee884);}(_0x601b,0x195));var _0xb601=function(_0x27be07,_0x12b093){_0x27be07=_0x27be07-0x0;var _0x5c4a35=_0x601b[_0x27be07];return _0x5c4a35;};'use strict';var emlformat=require(_0xb601('0x0'));var rimraf=require(_0xb601('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb601('0x2'));var rp=require(_0xb601('0x3'));var moment=require(_0xb601('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb601('0x5'));var util=require(_0xb601('0x6'));var path=require('path');var sox=require(_0xb601('0x7'));var csv=require('to-csv');var ejs=require(_0xb601('0x8'));var fs=require('fs');var fs_extra=require(_0xb601('0x9'));var _=require(_0xb601('0xa'));var squel=require(_0xb601('0xb'));var crypto=require(_0xb601('0xc'));var jsforce=require(_0xb601('0xd'));var deskjs=require(_0xb601('0xe'));var toCsv=require(_0xb601('0xf'));var querystring=require('querystring');var Papa=require(_0xb601('0x10'));var Redis=require(_0xb601('0x11'));var authService=require(_0xb601('0x12'));var qs=require(_0xb601('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb601('0x14'))(_0xb601('0x15'));var utils=require(_0xb601('0x16'));var config=require(_0xb601('0x17'));var licenseUtil=require(_0xb601('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xb601('0x19')]=_[_0xb601('0x1a')](config[_0xb601('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb601('0x1b'))(new Redis(config[_0xb601('0x19')]));require(_0xb601('0x1c'))[_0xb601('0x1d')](socket);function respondWithStatusCode(_0x4259f6,_0x1a31a6){_0x1a31a6=_0x1a31a6||0xcc;return function(_0x410c73){if(_0x410c73){return _0x4259f6[_0xb601('0x1e')](_0x1a31a6);}return _0x4259f6[_0xb601('0x1f')](_0x1a31a6)[_0xb601('0x20')]();};}function respondWithResult(_0x988239,_0x2ffc6f){_0x2ffc6f=_0x2ffc6f||0xc8;return function(_0x226db7){if(_0x226db7){return _0x988239['status'](_0x2ffc6f)[_0xb601('0x21')](_0x226db7);}};}function respondWithFilteredResult(_0x2e8967,_0x49809b){return function(_0x3ceeab){if(_0x3ceeab){var _0x19bf3d=typeof _0x49809b['offset']===_0xb601('0x22')&&typeof _0x49809b[_0xb601('0x23')]===_0xb601('0x22');var _0x16f989=_0x3ceeab[_0xb601('0x24')];var _0x364287=_0x19bf3d?0x0:_0x49809b[_0xb601('0x25')];var _0x1cfdc7=_0x19bf3d?_0x3ceeab['count']:_0x49809b[_0xb601('0x25')]+_0x49809b['limit'];var _0x3d8fff;if(_0x1cfdc7>=_0x16f989){_0x1cfdc7=_0x16f989;_0x3d8fff=0xc8;}else{_0x3d8fff=0xce;}_0x2e8967[_0xb601('0x1f')](_0x3d8fff);return _0x2e8967[_0xb601('0x26')](_0xb601('0x27'),_0x364287+'-'+_0x1cfdc7+'/'+_0x16f989)[_0xb601('0x21')](_0x3ceeab);}return null;};}function patchUpdates(_0x1564e8){return function(_0x144e1e){try{jsonpatch[_0xb601('0x28')](_0x144e1e,_0x1564e8,!![]);}catch(_0x1ab58a){return BPromise[_0xb601('0x29')](_0x1ab58a);}return _0x144e1e[_0xb601('0x2a')]();};}function saveUpdates(_0x4274e4,_0x3ae6b4){return function(_0x5b9889){if(_0x5b9889){return _0x5b9889[_0xb601('0x2b')](_0x4274e4)[_0xb601('0x2c')](function(_0xc4bfc6){return _0xc4bfc6;});}return null;};}function removeEntity(_0x486544,_0x155fe5){return function(_0x2312d3){if(_0x2312d3){return _0x2312d3[_0xb601('0x2d')]()[_0xb601('0x2c')](function(){var _0x20f3c2=_0x2312d3['get']({'plain':!![]});var _0x16b3c7='Lists';return db[_0xb601('0x2e')]['destroy']({'where':{'type':_0x16b3c7,'resourceId':_0x20f3c2['id']}})['then'](function(){return _0x2312d3;});})[_0xb601('0x2c')](function(){_0x486544[_0xb601('0x1f')](0xcc)[_0xb601('0x20')]();});}};}function handleEntityNotFound(_0x35b92d,_0x30e54d){return function(_0x121633){if(!_0x121633){_0x35b92d[_0xb601('0x1e')](0x194);}return _0x121633;};}function handleError(_0x56a238,_0x11cd5e){_0x11cd5e=_0x11cd5e||0x1f4;return function(_0x5cbb94){logger[_0xb601('0x2f')](_0x5cbb94['stack']);if(_0x5cbb94['name']){delete _0x5cbb94[_0xb601('0x30')];}_0x56a238[_0xb601('0x1f')](_0x11cd5e)[_0xb601('0x31')](_0x5cbb94);};}exports[_0xb601('0x32')]=function(_0x47e189,_0x4a936a){var _0x29819e={},_0x5db4a7={},_0x23177b={'count':0x0,'rows':[]};var _0x34bfc8=_[_0xb601('0x33')](db[_0xb601('0x34')][_0xb601('0x35')],function(_0x516277){return{'name':_0x516277[_0xb601('0x36')],'type':_0x516277[_0xb601('0x37')][_0xb601('0x38')]};});_0x5db4a7['model']=_[_0xb601('0x33')](_0x34bfc8,_0xb601('0x30'));_0x5db4a7['query']=_[_0xb601('0x39')](_0x47e189[_0xb601('0x3a')]);_0x5db4a7['filters']=_[_0xb601('0x3b')](_0x5db4a7[_0xb601('0x3c')],_0x5db4a7['query']);_0x29819e[_0xb601('0x3d')]=_[_0xb601('0x3b')](_0x5db4a7[_0xb601('0x3c')],qs[_0xb601('0x3e')](_0x47e189[_0xb601('0x3a')]['fields']));_0x29819e['attributes']=_0x29819e[_0xb601('0x3d')][_0xb601('0x3f')]?_0x29819e[_0xb601('0x3d')]:_0x5db4a7[_0xb601('0x3c')];if(!_0x47e189['query']['hasOwnProperty']('nolimit')){_0x29819e[_0xb601('0x23')]=qs[_0xb601('0x23')](_0x47e189[_0xb601('0x3a')]['limit']);_0x29819e['offset']=qs[_0xb601('0x25')](_0x47e189[_0xb601('0x3a')][_0xb601('0x25')]);}_0x29819e[_0xb601('0x40')]=qs['sort'](_0x47e189[_0xb601('0x3a')]['sort']);_0x29819e[_0xb601('0x41')]=qs[_0xb601('0x42')](_['pick'](_0x47e189[_0xb601('0x3a')],_0x5db4a7[_0xb601('0x42')]),_0x34bfc8);if(_0x47e189['query']['filter']){_0x29819e[_0xb601('0x41')]=_[_0xb601('0x43')](_0x29819e['where'],{'$or':_['map'](_0x34bfc8,function(_0x14c217){if(_0x14c217[_0xb601('0x37')]!==_0xb601('0x44')){var _0x305321={};_0x305321[_0x14c217[_0xb601('0x30')]]={'$like':'%'+_0x47e189[_0xb601('0x3a')]['filter']+'%'};return _0x305321;}})});}_0x29819e=_[_0xb601('0x43')]({},_0x29819e,_0x47e189[_0xb601('0x45')]);var _0x4dafcd={'where':_0x29819e['where']};return db[_0xb601('0x34')][_0xb601('0x24')](_0x4dafcd)['then'](function(_0x54971b){_0x23177b[_0xb601('0x24')]=_0x54971b;if(_0x47e189[_0xb601('0x3a')][_0xb601('0x46')]){_0x29819e[_0xb601('0x47')]=[{'all':!![]}];}return db[_0xb601('0x34')][_0xb601('0x48')](_0x29819e);})[_0xb601('0x2c')](function(_0x52d783){_0x23177b[_0xb601('0x49')]=_0x52d783;return _0x23177b;})[_0xb601('0x2c')](respondWithFilteredResult(_0x4a936a,_0x29819e))[_0xb601('0x4a')](handleError(_0x4a936a,null));};exports[_0xb601('0x4b')]=function(_0x55c848,_0x380f6d){var _0x354534={'raw':![],'where':{'id':_0x55c848[_0xb601('0x4c')]['id']}},_0x5a6a1e={};_0x5a6a1e['model']=_['keys'](db[_0xb601('0x34')][_0xb601('0x35')]);_0x5a6a1e['query']=_['keys'](_0x55c848[_0xb601('0x3a')]);_0x5a6a1e[_0xb601('0x42')]=_[_0xb601('0x3b')](_0x5a6a1e[_0xb601('0x3c')],_0x5a6a1e['query']);_0x354534[_0xb601('0x3d')]=_[_0xb601('0x3b')](_0x5a6a1e[_0xb601('0x3c')],qs['fields'](_0x55c848[_0xb601('0x3a')]['fields']));_0x354534['attributes']=_0x354534['attributes'][_0xb601('0x3f')]?_0x354534['attributes']:_0x5a6a1e['model'];if(_0x55c848['query']['includeAll']){_0x354534[_0xb601('0x47')]=[{'all':!![]}];}_0x354534=_['merge']({},_0x354534,_0x55c848[_0xb601('0x45')]);return db[_0xb601('0x34')]['find'](_0x354534)[_0xb601('0x2c')](handleEntityNotFound(_0x380f6d,null))[_0xb601('0x2c')](respondWithResult(_0x380f6d,null))['catch'](handleError(_0x380f6d,null));};exports[_0xb601('0x4d')]=function(_0x73695b,_0xdeba89){return db[_0xb601('0x34')][_0xb601('0x4d')](_0x73695b[_0xb601('0x4e')],{})[_0xb601('0x2c')](function(_0x332333){var _0x12af73=_0x73695b[_0xb601('0x4f')][_0xb601('0x50')]({'plain':!![]});if(!_0x12af73)throw new Error(_0xb601('0x51'));if(_0x12af73[_0xb601('0x52')]==='user'){var _0x4b7647=_0x332333[_0xb601('0x50')]({'plain':!![]});var _0x267637=_0xb601('0x53');return db[_0xb601('0x54')][_0xb601('0x55')]({'where':{'name':_0x267637,'userProfileId':_0x12af73[_0xb601('0x56')]},'raw':!![]})[_0xb601('0x2c')](function(_0x4bc6c6){if(_0x4bc6c6&&_0x4bc6c6[_0xb601('0x57')]===0x0){return db[_0xb601('0x2e')][_0xb601('0x4d')]({'name':_0x4b7647[_0xb601('0x30')],'resourceId':_0x4b7647['id'],'type':_0x4bc6c6[_0xb601('0x30')],'sectionId':_0x4bc6c6['id']},{})['then'](function(){return _0x332333;});}else{return _0x332333;}})['catch'](function(_0x533dd6){logger[_0xb601('0x2f')](_0xb601('0x58'),_0x533dd6);throw _0x533dd6;});}return _0x332333;})['then'](respondWithResult(_0xdeba89,0xc9))['catch'](handleError(_0xdeba89,null));};exports[_0xb601('0x2b')]=function(_0x4c624f,_0x56391a){if(_0x4c624f[_0xb601('0x4e')]['id']){delete _0x4c624f[_0xb601('0x4e')]['id'];}return db[_0xb601('0x34')][_0xb601('0x55')]({'where':{'id':_0x4c624f[_0xb601('0x4c')]['id']}})['then'](handleEntityNotFound(_0x56391a,null))[_0xb601('0x2c')](saveUpdates(_0x4c624f[_0xb601('0x4e')],null))[_0xb601('0x2c')](respondWithResult(_0x56391a,null))[_0xb601('0x4a')](handleError(_0x56391a,null));};exports[_0xb601('0x2d')]=function(_0x1e35f7,_0x6ee2af){return db['CmList'][_0xb601('0x55')]({'where':{'id':_0x1e35f7[_0xb601('0x4c')]['id']}})['then'](handleEntityNotFound(_0x6ee2af,null))[_0xb601('0x2c')](removeEntity(_0x6ee2af,null))[_0xb601('0x4a')](handleError(_0x6ee2af,null));};exports[_0xb601('0x59')]=function(_0x255578,_0x5aa08c){return db[_0xb601('0x34')][_0xb601('0x59')]()['then'](respondWithResult(_0x5aa08c,null))['catch'](handleError(_0x5aa08c,null));};exports[_0xb601('0x5a')]=function(_0x347d4c,_0x6f8385,_0x3d833c){if(_0x347d4c[_0xb601('0x4e')]['id']){delete _0x347d4c[_0xb601('0x4e')]['id'];}return db['CmList'][_0xb601('0x55')]({'where':{'id':_0x347d4c[_0xb601('0x4c')]['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0x6f8385,null))[_0xb601('0x2c')](function(_0x18a589){if(_0x18a589){_0x347d4c[_0xb601('0x4e')][_0xb601('0x5b')]=_0x18a589['id'];return db[_0xb601('0x5c')]['create'](_0x347d4c[_0xb601('0x4e')]);}})[_0xb601('0x2c')](respondWithResult(_0x6f8385,null))[_0xb601('0x4a')](handleError(_0x6f8385,null));};exports[_0xb601('0x5d')]=function(_0x4db44b,_0x3f9621,_0xa1cb9a){var _0x1e816a={'raw':![],'where':{}};var _0x3fd8ab={};var _0x2e5a4b={'count':0x0,'rows':[]};return db[_0xb601('0x34')][_0xb601('0x5e')]({'where':{'id':_0x4db44b[_0xb601('0x4c')]['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0x3f9621,null))[_0xb601('0x2c')](function(_0x5a7eaf){if(_0x5a7eaf){_0x3fd8ab[_0xb601('0x3c')]=_['keys'](db[_0xb601('0x5c')][_0xb601('0x35')]);_0x3fd8ab['query']=_[_0xb601('0x39')](_0x4db44b[_0xb601('0x3a')]);_0x3fd8ab[_0xb601('0x42')]=_['intersection'](_0x3fd8ab[_0xb601('0x3c')],_0x3fd8ab[_0xb601('0x3a')]);_0x1e816a[_0xb601('0x3d')]=_[_0xb601('0x3b')](_0x3fd8ab['model'],qs[_0xb601('0x3e')](_0x4db44b['query']['fields']));_0x1e816a[_0xb601('0x3d')]=_0x1e816a[_0xb601('0x3d')][_0xb601('0x3f')]?_0x1e816a[_0xb601('0x3d')]:_0x3fd8ab[_0xb601('0x3c')];if(!_0x4db44b['query']['hasOwnProperty'](_0xb601('0x5f'))){_0x1e816a[_0xb601('0x23')]=qs[_0xb601('0x23')](_0x4db44b[_0xb601('0x3a')]['limit']);_0x1e816a[_0xb601('0x25')]=qs[_0xb601('0x25')](_0x4db44b[_0xb601('0x3a')][_0xb601('0x25')]);}_0x1e816a[_0xb601('0x40')]=qs[_0xb601('0x60')](_0x4db44b[_0xb601('0x3a')][_0xb601('0x60')]);_0x1e816a[_0xb601('0x41')]=qs['filters'](_[_0xb601('0x61')](_0x4db44b[_0xb601('0x3a')],_0x3fd8ab[_0xb601('0x42')]));_0x1e816a['where'][_0xb601('0x5b')]=_0x5a7eaf['id'];if(_0x4db44b['query']['filter']){_0x1e816a['where']=_[_0xb601('0x43')](_0x1e816a['where'],{'$or':_[_0xb601('0x33')](_0x1e816a['attributes'],function(_0x42d4d2){var _0x169b13={};_0x169b13[_0x42d4d2]={'$like':'%'+_0x4db44b[_0xb601('0x3a')][_0xb601('0x62')]+'%'};return _0x169b13;})});}_0x1e816a=_[_0xb601('0x43')]({},_0x1e816a,_0x4db44b[_0xb601('0x45')]);return db[_0xb601('0x5c')][_0xb601('0x24')]({'where':_0x1e816a[_0xb601('0x41')]})[_0xb601('0x2c')](function(_0x328bc9){_0x2e5a4b[_0xb601('0x24')]=_0x328bc9;if(_0x4db44b[_0xb601('0x3a')][_0xb601('0x46')]){_0x1e816a[_0xb601('0x47')]=[{'all':!![]}];}return db[_0xb601('0x5c')][_0xb601('0x48')](_0x1e816a);})[_0xb601('0x2c')](function(_0xffea40){_0x2e5a4b['rows']=_0xffea40;return _0x2e5a4b;});}})[_0xb601('0x2c')](respondWithFilteredResult(_0x3f9621,_0x1e816a))['catch'](handleError(_0x3f9621,null));};exports[_0xb601('0x63')]=function(_0x3e7421,_0x3f5187,_0x4b19a7){return db[_0xb601('0x34')][_0xb601('0x55')]({'where':{'id':_0x3e7421[_0xb601('0x4c')]['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0x3f5187,null))[_0xb601('0x2c')](function(_0x1bcacc){if(_0x1bcacc){return _0x1bcacc[_0xb601('0x63')](_0x3e7421[_0xb601('0x3a')][_0xb601('0x64')]);}})[_0xb601('0x2c')](respondWithStatusCode(_0x3f5187,null))['catch'](handleError(_0x3f5187,null));};exports[_0xb601('0x65')]=function(_0x10d7c3,_0x53c7f7,_0x2b4345){return db[_0xb601('0x34')]['find']({'where':{'id':_0x10d7c3['params']['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0x53c7f7,null))['then'](function(_0x246111){if(_0x246111){var _0x2a495d=[];var _0x33f900={'success':[],'errors':[]};return db[_0xb601('0x66')][_0xb601('0x59')]()[_0xb601('0x2c')](function(_0x18a6af){if(_0x10d7c3[_0xb601('0x4e')][_0xb601('0x67')]&&_['isArray'](_0x10d7c3[_0xb601('0x4e')][_0xb601('0x67')])){if(_0x10d7c3[_0xb601('0x4e')][_0xb601('0x67')][_0xb601('0x3f')]){_0x10d7c3[_0xb601('0x4e')][_0xb601('0x67')]=_0x10d7c3[_0xb601('0x4e')][_0xb601('0x67')][_0xb601('0x68')](';')+';';}else{_0x10d7c3[_0xb601('0x4e')][_0xb601('0x67')]=null;}}else{_0x10d7c3[_0xb601('0x4e')]['tags']=null;}if(_0x10d7c3['body']&&_[_0xb601('0x69')](_0x10d7c3[_0xb601('0x4e')])){for(var _0x2b83f9=0x0;_0x2b83f9<_0x10d7c3[_0xb601('0x4e')][_0xb601('0x3f')];_0x2b83f9+=0x1){_0x10d7c3[_0xb601('0x4e')][_0x2b83f9][_0xb601('0x5b')]=_0x10d7c3['params']['id'];_0x2a495d['push'](_0x10d7c3['body'][_0x2b83f9]);}return BPromise['each'](_0x2a495d,function(_0x3b32d5){return db[_0xb601('0x66')][_0xb601('0x4d')](_[_0xb601('0x6a')](_0x3b32d5,[_0xb601('0x64'),'id'])||{},{'fields':_[_0xb601('0x39')](_0x18a6af),'raw':!![]})[_0xb601('0x2c')](function(_0x4bbcbf){_0x33f900['success'][_0xb601('0x6b')](_0x4bbcbf[_0xb601('0x6c')]);})[_0xb601('0x4a')](function(_0x41ee69){_0x33f900[_0xb601('0x6d')][_0xb601('0x6b')]({'data':_0x3b32d5,'error':_0x41ee69['message']});});})[_0xb601('0x2c')](function(_0x5285d3){return _0x33f900;})[_0xb601('0x4a')](function(_0x28c1db){return _0x28c1db;});}else{_0x53c7f7[_0xb601('0x1f')](0x190)['json']({'message':_0xb601('0x6e')});}});}})['then'](respondWithResult(_0x53c7f7,null))[_0xb601('0x4a')](handleError(_0x53c7f7,null));};exports[_0xb601('0x6f')]=function(_0x466b15,_0x16095e,_0x3d4e81){var _0x1475e0;return db[_0xb601('0x34')][_0xb601('0x55')]({'where':{'id':_0x466b15['params']['id']},'include':[{'model':db[_0xb601('0x70')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x16095e,null))[_0xb601('0x2c')](function(_0x58858a){if(_0x58858a){_0x1475e0=_0x58858a;return db['CmContact'][_0xb601('0x35')];}})[_0xb601('0x2c')](function(_0x16a903){if(_0x16a903){var _0x2afc7a={};var _0x3d0ca2={};_0x3d0ca2[_0xb601('0x3c')]=_[_0xb601('0x71')](_[_0xb601('0x39')](_0x16a903),_[_0xb601('0x33')](_0x1475e0['CustomFields'],function(_0x142602){return util[_0xb601('0x72')]('cf_%d',_0x142602['id']);}));_0x3d0ca2[_0xb601('0x3a')]=_[_0xb601('0x39')](_0x466b15['query']);_0x3d0ca2[_0xb601('0x42')]=_[_0xb601('0x3b')](_0x3d0ca2['model'],_0x3d0ca2[_0xb601('0x3a')]);_0x2afc7a['attributes']=_[_0xb601('0x3b')](_0x3d0ca2['model'],qs['fields'](_0x466b15[_0xb601('0x3a')][_0xb601('0x3e')]));_0x2afc7a['attributes']=_0x2afc7a[_0xb601('0x3d')]['length']?_0x2afc7a[_0xb601('0x3d')]:_0x3d0ca2['model'];if(!_0x466b15[_0xb601('0x3a')]['hasOwnProperty'](_0xb601('0x5f'))){_0x2afc7a[_0xb601('0x23')]=qs['limit'](_0x466b15[_0xb601('0x3a')][_0xb601('0x23')]);_0x2afc7a[_0xb601('0x25')]=qs['offset'](_0x466b15[_0xb601('0x3a')][_0xb601('0x25')]);}_0x2afc7a[_0xb601('0x40')]=qs['sort'](_0x466b15[_0xb601('0x3a')][_0xb601('0x60')]);_0x2afc7a['where']=qs[_0xb601('0x42')](_[_0xb601('0x61')](_0x466b15[_0xb601('0x3a')],_0x3d0ca2[_0xb601('0x42')]));_0x2afc7a[_0xb601('0x73')]=!![];if(_0x466b15[_0xb601('0x3a')][_0xb601('0x62')]){_0x2afc7a[_0xb601('0x41')]=_[_0xb601('0x43')](_0x2afc7a[_0xb601('0x41')],{'$or':_[_0xb601('0x33')](_0x2afc7a[_0xb601('0x3d')],function(_0x189118){var _0x5ad137={};_0x5ad137[_0x189118]={'$like':'%'+_0x466b15['query'][_0xb601('0x62')]+'%'};return _0x5ad137;})});}_0x2afc7a=_['merge']({},_0x2afc7a,_0x466b15[_0xb601('0x45')]);return _0x1475e0[_0xb601('0x6f')](_0x2afc7a);}})['then'](respondWithResult(_0x16095e,null))['catch'](handleError(_0x16095e,null));};exports[_0xb601('0x74')]=function(_0x1892e0,_0x55dfe4,_0x51c6af){var _0x373a40;var _0x4ef828;var _0x51d573;var _0x3ca4c8=_0x1892e0[_0xb601('0x4c')]['id'];csv_results=[];return db[_0xb601('0x75')][_0xb601('0x48')]({'attributes':['id',_0xb601('0x30')],'raw':!![],'order':['OrderBy']})[_0xb601('0x2c')](function(_0xffc45b){_0x373a40=_0xffc45b;var _0x499883=_[_0xb601('0x39')](db['CmContact'][_0xb601('0x35')]);return db[_0xb601('0x70')][_0xb601('0x48')]({'raw':!![],'attributes':['id',_0xb601('0x76')]})['then'](function(_0x413926){_0x4ef828=_0x413926;var _0x423023=squel['select']()[_0xb601('0x3e')](_0x499883)['from'](_0xb601('0x77'),'c')[_0xb601('0x41')](_0xb601('0x78'),_0x3ca4c8)[_0xb601('0x41')](_0xb601('0x79'))[_0xb601('0x7a')]();for(var _0x4ef355=0x0;_0x4ef355<_0x4ef828[_0xb601('0x3f')];_0x4ef355++){_0x423023['field'](_0xb601('0x7b')+_0x4ef828[_0x4ef355]['id'],'customField_'+_0x4ef828[_0x4ef355][_0xb601('0x76')]);}for(var _0x4ef355=0x0;_0x4ef355<_0x373a40[_0xb601('0x3f')];_0x4ef355++){_0x423023[_0xb601('0x7c')](squel[_0xb601('0x7d')]()[_0xb601('0x7c')](_0xb601('0x7e'))[_0xb601('0x7f')](_0xb601('0x80'))[_0xb601('0x41')](_0xb601('0x81'),_0x373a40[_0x4ef355]['id'])[_0xb601('0x41')](_0xb601('0x82')),_0xb601('0x83')+_0x373a40[_0x4ef355][_0xb601('0x30')]);_0x423023[_0xb601('0x7c')](squel[_0xb601('0x7d')]()[_0xb601('0x7c')]('description')[_0xb601('0x7f')]('cm_contact_has_items')[_0xb601('0x41')](_0xb601('0x81'),_0x373a40[_0x4ef355]['id'])[_0xb601('0x41')](_0xb601('0x82')),_0xb601('0x84')+_0x373a40[_0x4ef355][_0xb601('0x30')]);}var _0x352921=[];_0x352921['push'](_0x423023[_0xb601('0x85')]());BPromise[_0xb601('0x86')](_0x352921,handleQuery)[_0xb601('0x2c')](function(_0xd22efc){handleQuery(_0x423023[_0xb601('0x85')]());var _0x2779d2=csv_results[0x0];if(!_[_0xb601('0x87')](_0x2779d2)){var _0x2717b9=toCsv(_0x2779d2);var _0x58715d=Date[_0xb601('0x88')]();fs[_0xb601('0x89')](util[_0xb601('0x72')]('/tmp/list_%d_%s.csv',_0x3ca4c8,_0x58715d),_0x2717b9);_0x55dfe4['setHeader']('Content-disposition',_0xb601('0x8a')+util['format'](_0xb601('0x8b'),_0x3ca4c8,_0x58715d));_0x55dfe4[_0xb601('0x8c')](_0xb601('0x8d'),_0xb601('0x8e'));return _0x55dfe4[_0xb601('0x8f')](util[_0xb601('0x72')](_0xb601('0x90'),_0x3ca4c8,_0x58715d));}else{return _0x55dfe4['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x2c9bbd,_0x1a0864,_0xe59fa){var _0x410f2a;delete _0x2c9bbd[_0xb601('0x4e')]['id'];return db[_0xb601('0x34')]['findOne']({'where':{'id':_0x2c9bbd[_0xb601('0x4c')]['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0x1a0864,null))[_0xb601('0x2c')](function(_0x50da47){if(_0x50da47){return db[_0xb601('0x91')][_0xb601('0x92')](function(_0x111d3f){return db[_0xb601('0x70')][_0xb601('0x4d')](_0x2c9bbd[_0xb601('0x4e')],{'transaction':_0x111d3f})[_0xb601('0x2c')](function(_0x4f7b1a){_0x410f2a=_0x4f7b1a;return _0x50da47[_0xb601('0x93')](_0x4f7b1a,{'transaction':_0x111d3f});})[_0xb601('0x2c')](function(){var _0x2a5335={'type':db[_0xb601('0x94')][_0xb601('0x95')],'transaction':_0x111d3f};switch(_0x2c9bbd[_0xb601('0x4e')][_0xb601('0x37')]){case _0xb601('0x96'):_0x2a5335[_0xb601('0x37')]=db[_0xb601('0x94')]['TEXT'];break;case _0xb601('0x97'):_0x2a5335[_0xb601('0x37')]=db[_0xb601('0x94')][_0xb601('0x98')];break;case _0xb601('0x99'):_0x2a5335[_0xb601('0x37')]=db[_0xb601('0x94')][_0xb601('0x9a')];_0x2a5335[_0xb601('0x9b')]=![];break;default:}return db['sequelize'][_0xb601('0x9c')][_0xb601('0x9d')](_0xb601('0x77'),util[_0xb601('0x72')](_0xb601('0x9e'),_0x410f2a['id']),_0x2a5335);})['then'](function(){return _0x410f2a;});});}})['then'](respondWithResult(_0x1a0864,null))[_0xb601('0x4a')](handleError(_0x1a0864,null));};exports[_0xb601('0x9f')]=function(_0x3afbd2,_0xe5b2c7,_0x2ef634){var _0x3cc48a={};var _0x52b2f3={};var _0x51810c;var _0x1ae352;return db[_0xb601('0x34')][_0xb601('0x5e')]({'where':{'id':_0x3afbd2[_0xb601('0x4c')]['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0xe5b2c7,null))[_0xb601('0x2c')](function(_0x448b70){if(_0x448b70){_0x51810c=_0x448b70;_0x52b2f3[_0xb601('0x3c')]=_['keys'](db['CmCustomField'][_0xb601('0x35')]);_0x52b2f3['query']=_[_0xb601('0x39')](_0x3afbd2[_0xb601('0x3a')]);_0x52b2f3[_0xb601('0x42')]=_[_0xb601('0x3b')](_0x52b2f3[_0xb601('0x3c')],_0x52b2f3[_0xb601('0x3a')]);_0x3cc48a['attributes']=_['intersection'](_0x52b2f3[_0xb601('0x3c')],qs[_0xb601('0x3e')](_0x3afbd2['query'][_0xb601('0x3e')]));_0x3cc48a['attributes']=_0x3cc48a[_0xb601('0x3d')]['length']?_0x3cc48a['attributes']:_0x52b2f3[_0xb601('0x3c')];_0x3cc48a[_0xb601('0x40')]=qs[_0xb601('0x60')](_0x3afbd2[_0xb601('0x3a')]['sort']);_0x3cc48a[_0xb601('0x41')]=qs[_0xb601('0x42')](_[_0xb601('0x61')](_0x3afbd2[_0xb601('0x3a')],_0x52b2f3['filters']));_0x3cc48a[_0xb601('0x41')]=_[_0xb601('0x43')](_0x3cc48a[_0xb601('0x41')],{'$or':[{'ListId':_0x448b70['id']},{'ListId':null}]});if(_0x3afbd2[_0xb601('0x3a')][_0xb601('0x62')]){_0x3cc48a[_0xb601('0x41')]=_['merge'](_0x3cc48a[_0xb601('0x41')],{'$or':_[_0xb601('0x33')](_0x3cc48a[_0xb601('0x3d')],function(_0x4423ca){var _0x434589={};_0x434589[_0x4423ca]={'$like':'%'+_0x3afbd2['query'][_0xb601('0x62')]+'%'};return _0x434589;})});}_0x3cc48a=_['merge']({},_0x3cc48a,_0x3afbd2['options']);return db['CmCustomField'][_0xb601('0xa0')](_0x3cc48a);}})[_0xb601('0x2c')](respondWithResult(_0xe5b2c7,null))[_0xb601('0x4a')](handleError(_0xe5b2c7,null));};exports[_0xb601('0xa1')]=function(_0x39c9a8,_0x40210f){return db['CmCustomField'][_0xb601('0xa0')]({'where':{'ListId':null}})[_0xb601('0x2c')](handleEntityNotFound(_0x40210f,null))['then'](function(_0x1ea44f){return _0x1ea44f;})['then'](respondWithResult(_0x40210f,null))['catch'](handleError(_0x40210f,null));};exports[_0xb601('0xa2')]=function(_0x37b982,_0xd1b7ef,_0x12fc7c){return db[_0xb601('0x34')][_0xb601('0x55')]({'where':{'id':_0x37b982[_0xb601('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd1b7ef,null))['then'](function(_0x20c137){if(_0x20c137){return _0x20c137['addAgents'](_0x37b982[_0xb601('0x4e')][_0xb601('0x64')],_[_0xb601('0x6a')](_0x37b982[_0xb601('0x4e')],[_0xb601('0x64'),'id'])||{})[_0xb601('0xa3')](function(_0xf9def7){for(var _0x6f8b5b=0x0;_0x6f8b5b<_0x37b982['body'][_0xb601('0x64')][_0xb601('0x3f')];_0x6f8b5b+=0x1){socket[_0xb601('0xa4')](_0xb601('0xa5'),{'UserId':Number(_0x37b982[_0xb601('0x4e')]['ids'][_0x6f8b5b]),'CmListId':Number(_0x37b982[_0xb601('0x4c')]['id'])});}return _0xf9def7;});}})[_0xb601('0x2c')](respondWithResult(_0xd1b7ef,null))['catch'](handleError(_0xd1b7ef,null));};exports[_0xb601('0xa6')]=function(_0x4c416d,_0x2008b1,_0x3cc9cd){return db[_0xb601('0x34')][_0xb601('0x55')]({'where':{'id':_0x4c416d[_0xb601('0x4c')]['id']}})[_0xb601('0x2c')](handleEntityNotFound(_0x2008b1,null))[_0xb601('0x2c')](function(_0x26bbb2){if(_0x26bbb2){return _0x26bbb2[_0xb601('0xa6')](_0x4c416d[_0xb601('0x3a')]['ids'])['then'](function(){if(_[_0xb601('0x69')](_0x4c416d['query'][_0xb601('0x64')])){for(var _0x3ef477=0x0;_0x3ef477<_0x4c416d[_0xb601('0x3a')][_0xb601('0x64')][_0xb601('0x3f')];_0x3ef477+=0x1){socket[_0xb601('0xa4')](_0xb601('0xa7'),{'UserId':Number(_0x4c416d[_0xb601('0x3a')]['ids'][_0x3ef477]),'CmListId':Number(_0x4c416d[_0xb601('0x4c')]['id'])});}}else{socket[_0xb601('0xa4')](_0xb601('0xa7'),{'UserId':Number(_0x4c416d[_0xb601('0x3a')][_0xb601('0x64')]),'CmListId':Number(_0x4c416d[_0xb601('0x4c')]['id'])});}});}})[_0xb601('0x2c')](respondWithStatusCode(_0x2008b1,null))['catch'](handleError(_0x2008b1,null));};exports[_0xb601('0xa8')]=function(_0x28dc38,_0xcce54f,_0x5c15e2){var _0xa470b6={};var _0x2c876={};var _0x1633d6;var _0x512819;return db[_0xb601('0x34')][_0xb601('0x5e')]({'where':{'id':_0x28dc38['params']['id']}})['then'](handleEntityNotFound(_0xcce54f,null))[_0xb601('0x2c')](function(_0x444e12){if(_0x444e12){_0x1633d6=_0x444e12;_0x2c876[_0xb601('0x3c')]=_[_0xb601('0x39')](db[_0xb601('0xa9')]['rawAttributes']);_0x2c876[_0xb601('0x3a')]=_[_0xb601('0x39')](_0x28dc38[_0xb601('0x3a')]);_0x2c876[_0xb601('0x42')]=_[_0xb601('0x3b')](_0x2c876[_0xb601('0x3c')],_0x2c876[_0xb601('0x3a')]);_0xa470b6[_0xb601('0x3d')]=_[_0xb601('0x3b')](_0x2c876[_0xb601('0x3c')],qs[_0xb601('0x3e')](_0x28dc38[_0xb601('0x3a')][_0xb601('0x3e')]));_0xa470b6[_0xb601('0x3d')]=_0xa470b6[_0xb601('0x3d')]['length']?_0xa470b6['attributes']:_0x2c876[_0xb601('0x3c')];_0xa470b6[_0xb601('0x40')]=qs[_0xb601('0x60')](_0x28dc38[_0xb601('0x3a')]['sort']);_0xa470b6[_0xb601('0x41')]=qs[_0xb601('0x42')](_[_0xb601('0x61')](_0x28dc38[_0xb601('0x3a')],_0x2c876[_0xb601('0x42')]));if(_0x28dc38[_0xb601('0x3a')]['filter']){_0xa470b6[_0xb601('0x41')]=_[_0xb601('0x43')](_0xa470b6[_0xb601('0x41')],{'$or':_[_0xb601('0x33')](_0xa470b6[_0xb601('0x3d')],function(_0x5d3b7e){var _0x183e59={};_0x183e59[_0x5d3b7e]={'$like':'%'+_0x28dc38[_0xb601('0x3a')][_0xb601('0x62')]+'%'};return _0x183e59;})});}_0xa470b6=_[_0xb601('0x43')]({},_0xa470b6,_0x28dc38[_0xb601('0x45')]);return _0x1633d6[_0xb601('0xa8')](_0xa470b6);}})[_0xb601('0x2c')](function(_0x382bf6){if(_0x382bf6){_0x512819=_0x382bf6[_0xb601('0x3f')];if(!_0x28dc38[_0xb601('0x3a')]['hasOwnProperty'](_0xb601('0x5f'))){_0xa470b6[_0xb601('0x23')]=qs[_0xb601('0x23')](_0x28dc38[_0xb601('0x3a')][_0xb601('0x23')]);_0xa470b6['offset']=qs['offset'](_0x28dc38[_0xb601('0x3a')][_0xb601('0x25')]);}return _0x1633d6[_0xb601('0xa8')](_0xa470b6);}})[_0xb601('0x2c')](function(_0x17ebfb){if(_0x17ebfb){return _0x17ebfb?{'count':_0x512819,'rows':_0x17ebfb}:null;}})['then'](respondWithResult(_0xcce54f,null))[_0xb601('0x4a')](handleError(_0xcce54f,null));};function handleQuery(_0x4b29e9){logger[_0xb601('0xaa')](_0x4b29e9);return db['sequelize']['query'](_0x4b29e9)[_0xb601('0xa3')](function(_0x1cb98c){csv_results[_0xb601('0x6b')](_0x1cb98c);})[_0xb601('0x4a')](function(_0x40658a){logger[_0xb601('0x2f')](_0x40658a[_0xb601('0xab')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 868ede9..919423c 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0x372aa1,_0x3d3204){_0x372aa1=_0x372aa1-0x0;var _0x527665=_0xe14b[_0x372aa1];return _0x527665;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0xdeabd7,_0x379111){_0xdeabd7=_0xdeabd7-0x0;var _0x160a3f=_0xe14b[_0xdeabd7];return _0x160a3f;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 6810f1b..910323f 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 _0x5b02=['define','CmList','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x3717fc,_0x1c5cb0){var _0x3de354=function(_0x59232a){while(--_0x59232a){_0x3717fc['push'](_0x3717fc['shift']());}};_0x3de354(++_0x1c5cb0);}(_0x5b02,0xe9));var _0x25b0=function(_0x27b990,_0x4e0413){_0x27b990=_0x27b990-0x0;var _0x4415b2=_0x5b02[_0x27b990];return _0x4415b2;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f0d=['./cmList.attributes','define','CmList','cm_lists','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3bcaa3,_0x4cd872){_0x3bcaa3=_0x3bcaa3-0x0;var _0x4d4d6d=_0x6f0d[_0x3bcaa3];return _0x4d4d6d;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a10b5a7..87bd558 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 _0x5c49=['socket.io-emitter','./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x57efa6,_0x4f6d2d){var _0x1e18d0=function(_0x57b061){while(--_0x57b061){_0x57efa6['push'](_0x57efa6['shift']());}};_0x1e18d0(++_0x4f6d2d);}(_0x5c49,0x16c));var _0x95c4=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x5c49[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x95c4('0x0'));var util=require(_0x95c4('0x1'));var moment=require(_0x95c4('0x2'));var BPromise=require(_0x95c4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x95c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x95c4('0x6'));var jayson=require(_0x95c4('0x7'));var client=jayson[_0x95c4('0x8')]['http']({'port':0x232a});config[_0x95c4('0x9')]=_['defaults'](config[_0x95c4('0x9')],{'host':_0x95c4('0xa'),'port':0x18eb});var socket=require(_0x95c4('0xb'))(new Redis(config[_0x95c4('0x9')]));require(_0x95c4('0xc'))['register'](socket);function respondWithRpcPromise(_0x5ee7eb,_0x8187c7,_0x99ae7c){return new BPromise(function(_0x1c3697,_0x59ed0d){return client[_0x95c4('0xd')](_0x5ee7eb,_0x99ae7c)[_0x95c4('0xe')](function(_0x506eb8){logger['info'](_0x95c4('0xf'),_0x8187c7,_0x95c4('0x10'));logger[_0x95c4('0x11')](_0x95c4('0x12'),_0x8187c7,_0x95c4('0x10'),JSON[_0x95c4('0x13')](_0x506eb8));if(_0x506eb8[_0x95c4('0x14')]){if(_0x506eb8[_0x95c4('0x14')]['code']===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x8187c7,_0x506eb8['error']['message']);return _0x59ed0d(_0x506eb8[_0x95c4('0x14')][_0x95c4('0x15')]);}logger[_0x95c4('0x14')](_0x95c4('0xf'),_0x8187c7,_0x506eb8[_0x95c4('0x14')][_0x95c4('0x15')]);return _0x1c3697(_0x506eb8['error']['message']);}else{logger[_0x95c4('0x16')]('CmList,\x20%s,\x20%s',_0x8187c7,'request\x20sent');_0x1c3697(_0x506eb8[_0x95c4('0x17')][_0x95c4('0x15')]);}})[_0x95c4('0x18')](function(_0x3c1500){logger[_0x95c4('0x14')](_0x95c4('0xf'),_0x8187c7,_0x3c1500);_0x59ed0d(_0x3c1500);});});} \ No newline at end of file +var _0x32e2=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x544372,_0x102d0a){var _0x45bf94=function(_0x4ffbdc){while(--_0x4ffbdc){_0x544372['push'](_0x544372['shift']());}};_0x45bf94(++_0x102d0a);}(_0x32e2,0x1b0));var _0x232e=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x32e2[_0x16e0c8];return _0xe4b5af;};'use strict';var _=require(_0x232e('0x0'));var util=require(_0x232e('0x1'));var moment=require(_0x232e('0x2'));var BPromise=require('bluebird');var rs=require(_0x232e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x232e('0x4'))['db'];var utils=require(_0x232e('0x5'));var logger=require(_0x232e('0x6'))(_0x232e('0x7'));var config=require(_0x232e('0x8'));var jayson=require(_0x232e('0x9'));var client=jayson[_0x232e('0xa')][_0x232e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x232e('0xc')],{'host':_0x232e('0xd'),'port':0x18eb});var socket=require(_0x232e('0xe'))(new Redis(config[_0x232e('0xc')]));require(_0x232e('0xf'))[_0x232e('0x10')](socket);function respondWithRpcPromise(_0x3a1c2f,_0x5e6161,_0x5c4116){return new BPromise(function(_0x6a9072,_0xad00c8){return client[_0x232e('0x11')](_0x3a1c2f,_0x5c4116)['then'](function(_0x2d3145){logger[_0x232e('0x12')](_0x232e('0x13'),_0x5e6161,'request\x20sent');logger[_0x232e('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x5e6161,_0x232e('0x15'),JSON[_0x232e('0x16')](_0x2d3145));if(_0x2d3145[_0x232e('0x17')]){if(_0x2d3145['error'][_0x232e('0x18')]===0x1f4){logger[_0x232e('0x17')](_0x232e('0x13'),_0x5e6161,_0x2d3145[_0x232e('0x17')]['message']);return _0xad00c8(_0x2d3145[_0x232e('0x17')][_0x232e('0x19')]);}logger[_0x232e('0x17')](_0x232e('0x13'),_0x5e6161,_0x2d3145[_0x232e('0x17')][_0x232e('0x19')]);return _0x6a9072(_0x2d3145[_0x232e('0x17')][_0x232e('0x19')]);}else{logger['info'](_0x232e('0x13'),_0x5e6161,_0x232e('0x15'));_0x6a9072(_0x2d3145[_0x232e('0x1a')][_0x232e('0x19')]);}})['catch'](function(_0x433bce){logger['error'](_0x232e('0x13'),_0x5e6161,_0x433bce);_0xad00c8(_0x433bce);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3154709..4a1d996 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 _0x4675=['length','cmList:','./cmList.events','save','update','emit','register'];(function(_0x1f0c54,_0x46c53c){var _0x26f31c=function(_0x502990){while(--_0x502990){_0x1f0c54['push'](_0x1f0c54['shift']());}};_0x26f31c(++_0x46c53c);}(_0x4675,0xdb));var _0x5467=function(_0x585417,_0x515b87){_0x585417=_0x585417-0x0;var _0x4c2e47=_0x4675[_0x585417];return _0x4c2e47;};'use strict';var CmListEvents=require(_0x5467('0x0'));var events=[_0x5467('0x1'),'remove',_0x5467('0x2')];function createListener(_0x474562,_0x306ce8){return function(_0x15241d){_0x306ce8[_0x5467('0x3')](_0x474562,_0x15241d);};}function removeListener(_0x3df63f,_0x5717bb){return function(){CmListEvents['removeListener'](_0x3df63f,_0x5717bb);};}exports[_0x5467('0x4')]=function(_0x59c8ee){for(var _0x584408=0x0,_0xf6b7a8=events[_0x5467('0x5')];_0x584408<_0xf6b7a8;_0x584408++){var _0x4d9b3e=events[_0x584408];var _0x397c0e=createListener(_0x5467('0x6')+_0x4d9b3e,_0x59c8ee);CmListEvents['on'](_0x4d9b3e,_0x397c0e);}}; \ No newline at end of file +var _0xd381=['update','emit','removeListener','register','./cmList.events','save','remove'];(function(_0x135511,_0x323278){var _0xa9b6c0=function(_0x19574f){while(--_0x19574f){_0x135511['push'](_0x135511['shift']());}};_0xa9b6c0(++_0x323278);}(_0xd381,0x193));var _0x1d38=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xd381[_0x35d3a8];return _0x182378;};'use strict';var CmListEvents=require(_0x1d38('0x0'));var events=[_0x1d38('0x1'),_0x1d38('0x2'),_0x1d38('0x3')];function createListener(_0x3fb197,_0x48c3ac){return function(_0x24aa08){_0x48c3ac[_0x1d38('0x4')](_0x3fb197,_0x24aa08);};}function removeListener(_0x4af455,_0x22feb8){return function(){CmListEvents[_0x1d38('0x5')](_0x4af455,_0x22feb8);};}exports[_0x1d38('0x6')]=function(_0x2f3f2c){for(var _0x281ff4=0x0,_0x3ecf49=events['length'];_0x281ff4<_0x3ecf49;_0x281ff4++){var _0x122727=events[_0x281ff4];var _0x361794=createListener('cmList:'+_0x122727,_0x2f3f2c);CmListEvents['on'](_0x122727,_0x361794);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3a2e80d..9e85109 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 _0x6e46=['/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','create','post','addDisposition','/:id/contacts','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','get','describe','getGlobalCustomFields','/:id','getDispositions','getContacts'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6e46,0x188));var _0x66e4=function(_0x4a247a,_0x1d45ef){_0x4a247a=_0x4a247a-0x0;var _0x1db4c1=_0x6e46[_0x4a247a];return _0x1db4c1;};'use strict';var multer=require('multer');var util=require(_0x66e4('0x0'));var path=require(_0x66e4('0x1'));var timeout=require(_0x66e4('0x2'));var express=require(_0x66e4('0x3'));var router=express['Router']();var fs_extra=require(_0x66e4('0x4'));var auth=require(_0x66e4('0x5'));var interaction=require(_0x66e4('0x6'));var config=require(_0x66e4('0x7'));var controller=require(_0x66e4('0x8'));router['get']('/',auth[_0x66e4('0x9')](),controller['index']);router[_0x66e4('0xa')]('/describe',auth[_0x66e4('0x9')](),controller[_0x66e4('0xb')]);router['get']('/global_fields',auth[_0x66e4('0x9')](),controller[_0x66e4('0xc')]);router[_0x66e4('0xa')](_0x66e4('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x66e4('0xe')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x66e4('0xf')]);router[_0x66e4('0xa')](_0x66e4('0x10'),auth[_0x66e4('0x9')](),controller[_0x66e4('0x11')]);router[_0x66e4('0xa')]('/:id/fields',auth[_0x66e4('0x9')](),controller['getCustomFields']);router['get'](_0x66e4('0x12'),auth[_0x66e4('0x9')](),controller[_0x66e4('0x13')]);router['post']('/',auth[_0x66e4('0x9')](),controller[_0x66e4('0x14')]);router[_0x66e4('0x15')]('/:id/dispositions',auth[_0x66e4('0x9')](),controller[_0x66e4('0x16')]);router[_0x66e4('0x15')](_0x66e4('0x17'),auth[_0x66e4('0x9')](),controller[_0x66e4('0x18')]);router['post'](_0x66e4('0x19'),auth[_0x66e4('0x9')](),controller[_0x66e4('0x1a')]);router['post']('/:id/users',auth[_0x66e4('0x9')](),controller[_0x66e4('0x1b')]);router[_0x66e4('0x1c')]('/:id',auth[_0x66e4('0x9')](),controller[_0x66e4('0x1d')]);router[_0x66e4('0x1e')]('/:id',auth[_0x66e4('0x9')](),controller[_0x66e4('0x1f')]);router[_0x66e4('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x66e4('0x20')]);router[_0x66e4('0x1e')]('/:id/users',auth[_0x66e4('0x9')](),controller['removeAgents']);module[_0x66e4('0x21')]=router; \ No newline at end of file +var _0xb2b1=['update','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','create','post','/:id/fields','addCustomField','/:id/users','put','/:id'];(function(_0x396309,_0x4e2adf){var _0x4a0888=function(_0x22e748){while(--_0x22e748){_0x396309['push'](_0x396309['shift']());}};_0x4a0888(++_0x4e2adf);}(_0xb2b1,0x190));var _0x1b2b=function(_0x204911,_0x4d76d3){_0x204911=_0x204911-0x0;var _0x19c0eb=_0xb2b1[_0x204911];return _0x19c0eb;};'use strict';var multer=require(_0x1b2b('0x0'));var util=require(_0x1b2b('0x1'));var path=require(_0x1b2b('0x2'));var timeout=require(_0x1b2b('0x3'));var express=require(_0x1b2b('0x4'));var router=express[_0x1b2b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b2b('0x6'));var interaction=require(_0x1b2b('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x1b2b('0x8')]('/',auth[_0x1b2b('0x9')](),controller[_0x1b2b('0xa')]);router[_0x1b2b('0x8')](_0x1b2b('0xb'),auth[_0x1b2b('0x9')](),controller[_0x1b2b('0xc')]);router[_0x1b2b('0x8')](_0x1b2b('0xd'),auth['isAuthenticated'](),controller[_0x1b2b('0xe')]);router[_0x1b2b('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1b2b('0x8')](_0x1b2b('0xf'),auth['isAuthenticated'](),controller[_0x1b2b('0x10')]);router[_0x1b2b('0x8')](_0x1b2b('0x11'),auth[_0x1b2b('0x9')](),controller['getContacts']);router[_0x1b2b('0x8')](_0x1b2b('0x12'),auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x13')]);router[_0x1b2b('0x8')]('/:id/fields',auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x14')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x1b2b('0x15')]);router['post']('/',auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x16')]);router[_0x1b2b('0x17')](_0x1b2b('0xf'),auth[_0x1b2b('0x9')](),controller['addDisposition']);router[_0x1b2b('0x17')](_0x1b2b('0x11'),auth[_0x1b2b('0x9')](),controller['addContacts']);router[_0x1b2b('0x17')](_0x1b2b('0x18'),auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x19')]);router[_0x1b2b('0x17')](_0x1b2b('0x1a'),auth[_0x1b2b('0x9')](),controller['addAgents']);router[_0x1b2b('0x1b')](_0x1b2b('0x1c'),auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x1d')]);router['delete']('/:id',auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x1e')]);router['delete'](_0x1b2b('0xf'),auth[_0x1b2b('0x9')](),controller[_0x1b2b('0x1f')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x1b2b('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 526750f..3c29fd3 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 _0xb4df=['sequelize','exports','VIRTUAL','STRING'];(function(_0x56f888,_0x189a14){var _0x39ca50=function(_0x153258){while(--_0x153258){_0x56f888['push'](_0x56f888['shift']());}};_0x39ca50(++_0x189a14);}(_0xb4df,0x194));var _0xfb4d=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb4df[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0xfb4d('0x0'));module[_0xfb4d('0x1')]={'name':{'type':Sequelize[_0xfb4d('0x2')],'get':function(_0x294693){return this['getDataValue']('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xfb4d('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xfb4d('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x9c36=['VIRTUAL','getDataValue','STRING'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x9c36,0x1e0));var _0x69c3=function(_0x17b0f3,_0x1904bc){_0x17b0f3=_0x17b0f3-0x0;var _0x38ea34=_0x9c36[_0x17b0f3];return _0x38ea34;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x69c3('0x0')],'get':function(_0x59e8c5){return this[_0x69c3('0x1')]('field');}},'field':{'type':Sequelize[_0x69c3('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x69c3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x69c3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 6ae9af7..77543d5 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x98a25d,_0x320e53){var _0xf3eb10=function(_0xff9c47){while(--_0xff9c47){_0x98a25d['push'](_0x98a25d['shift']());}};_0xf3eb10(++_0x320e53);}(_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){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x213b99,_0x38be9c){var _0x3169c0=function(_0x210dda){while(--_0x210dda){_0x213b99['push'](_0x213b99['shift']());}};_0x3169c0(++_0x38be9c);}(_0x7a54,0x106));var _0x47a5=function(_0x2cb8e6,_0x347a5a){_0x2cb8e6=_0x2cb8e6-0x0;var _0x4c9a04=_0x7a54[_0x2cb8e6];return _0x4c9a04;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 3b4bddc..d983a75 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 _0xd2f9=['bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','tools_conditions','util','../../config/logger','api','moment'];(function(_0x1635eb,_0x48e7d4){var _0x2f49eb=function(_0x180031){while(--_0x180031){_0x1635eb['push'](_0x1635eb['shift']());}};_0x2f49eb(++_0x48e7d4);}(_0xd2f9,0xe0));var _0x9d2f=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0xd2f9[_0x11dc39];return _0x457277;};'use strict';var _=require('lodash');var util=require(_0x9d2f('0x0'));var logger=require(_0x9d2f('0x1'))(_0x9d2f('0x2'));var moment=require(_0x9d2f('0x3'));var BPromise=require(_0x9d2f('0x4'));var rp=require(_0x9d2f('0x5'));var fs=require('fs');var path=require(_0x9d2f('0x6'));var rimraf=require(_0x9d2f('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d2f('0x8'));module[_0x9d2f('0x9')]=function(_0x4f2612,_0x4ddbc0){return _0x4f2612[_0x9d2f('0xa')]('Condition',attributes,{'tableName':_0x9d2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f4=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe3f4,0x117));var _0x4e3f=function(_0x4ba19b,_0x5673e1){_0x4ba19b=_0x4ba19b-0x0;var _0x3253a7=_0xe3f4[_0x4ba19b];return _0x3253a7;};'use strict';var _=require(_0x4e3f('0x0'));var util=require(_0x4e3f('0x1'));var logger=require(_0x4e3f('0x2'))(_0x4e3f('0x3'));var moment=require(_0x4e3f('0x4'));var BPromise=require(_0x4e3f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e3f('0x6'));var rimraf=require('rimraf');var config=require(_0x4e3f('0x7'));var attributes=require('./condition.attributes');module[_0x4e3f('0x8')]=function(_0x2a9b13,_0x40231f){return _0x2a9b13[_0x4e3f('0x9')](_0x4e3f('0xa'),attributes,{'tableName':_0x4e3f('0xb'),'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 e6f9c10..f77a4f5 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 _0x8e73=['error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16a7d3,_0x4bfdb0){var _0x393803=function(_0x5000f0){while(--_0x5000f0){_0x16a7d3['push'](_0x16a7d3['shift']());}};_0x393803(++_0x4bfdb0);}(_0x8e73,0x131));var _0x38e7=function(_0x5d8b05,_0x3cbfac){_0x5d8b05=_0x5d8b05-0x0;var _0x9c88c3=_0x8e73[_0x5d8b05];return _0x9c88c3;};'use strict';var _=require(_0x38e7('0x0'));var util=require('util');var moment=require(_0x38e7('0x1'));var BPromise=require(_0x38e7('0x2'));var rs=require(_0x38e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38e7('0x4'))['db'];var utils=require(_0x38e7('0x5'));var logger=require(_0x38e7('0x6'))('rpc');var config=require(_0x38e7('0x7'));var jayson=require(_0x38e7('0x8'));var client=jayson[_0x38e7('0x9')][_0x38e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44986c,_0x53e3a6,_0x29c736){return new BPromise(function(_0x315071,_0x502850){return client['request'](_0x44986c,_0x29c736)[_0x38e7('0xb')](function(_0x43c479){logger[_0x38e7('0xc')]('Condition,\x20%s,\x20%s',_0x53e3a6,_0x38e7('0xd'));logger[_0x38e7('0xe')](_0x38e7('0xf'),_0x53e3a6,_0x38e7('0xd'),JSON[_0x38e7('0x10')](_0x43c479));if(_0x43c479['error']){if(_0x43c479[_0x38e7('0x11')][_0x38e7('0x12')]===0x1f4){logger[_0x38e7('0x11')](_0x38e7('0x13'),_0x53e3a6,_0x43c479[_0x38e7('0x11')][_0x38e7('0x14')]);return _0x502850(_0x43c479[_0x38e7('0x11')][_0x38e7('0x14')]);}logger['error'](_0x38e7('0x13'),_0x53e3a6,_0x43c479[_0x38e7('0x11')][_0x38e7('0x14')]);return _0x315071(_0x43c479[_0x38e7('0x11')][_0x38e7('0x14')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x53e3a6,_0x38e7('0xd'));_0x315071(_0x43c479[_0x38e7('0x15')][_0x38e7('0x14')]);}})[_0x38e7('0x16')](function(_0x21cd88){logger[_0x38e7('0x11')](_0x38e7('0x13'),_0x53e3a6,_0x21cd88);_0x502850(_0x21cd88);});});} \ No newline at end of file +var _0x3ca4=['../../config/logger','../../config/environment','jayson/promise','client','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2f0244,_0x5c752b){var _0x1699a1=function(_0x32d4f9){while(--_0x32d4f9){_0x2f0244['push'](_0x2f0244['shift']());}};_0x1699a1(++_0x5c752b);}(_0x3ca4,0x100));var _0x43ca=function(_0x53fac4,_0x261df7){_0x53fac4=_0x53fac4-0x0;var _0x1971ca=_0x3ca4[_0x53fac4];return _0x1971ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43ca('0x0'));var BPromise=require(_0x43ca('0x1'));var rs=require(_0x43ca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43ca('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x43ca('0x4'))('rpc');var config=require(_0x43ca('0x5'));var jayson=require(_0x43ca('0x6'));var client=jayson[_0x43ca('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e9c6,_0x454bff,_0x343767){return new BPromise(function(_0x309095,_0x39bead){return client['request'](_0x39e9c6,_0x343767)[_0x43ca('0x8')](function(_0x4cc23b){logger['info'](_0x43ca('0x9'),_0x454bff,_0x43ca('0xa'));logger[_0x43ca('0xb')](_0x43ca('0xc'),_0x454bff,_0x43ca('0xa'),JSON[_0x43ca('0xd')](_0x4cc23b));if(_0x4cc23b[_0x43ca('0xe')]){if(_0x4cc23b['error'][_0x43ca('0xf')]===0x1f4){logger[_0x43ca('0xe')](_0x43ca('0x9'),_0x454bff,_0x4cc23b[_0x43ca('0xe')][_0x43ca('0x10')]);return _0x39bead(_0x4cc23b[_0x43ca('0xe')][_0x43ca('0x10')]);}logger[_0x43ca('0xe')](_0x43ca('0x9'),_0x454bff,_0x4cc23b[_0x43ca('0xe')][_0x43ca('0x10')]);return _0x309095(_0x4cc23b['error'][_0x43ca('0x10')]);}else{logger[_0x43ca('0x11')](_0x43ca('0x9'),_0x454bff,_0x43ca('0xa'));_0x309095(_0x4cc23b[_0x43ca('0x12')][_0x43ca('0x10')]);}})[_0x43ca('0x13')](function(_0x31ed64){logger[_0x43ca('0xe')](_0x43ca('0x9'),_0x454bff,_0x31ed64);_0x39bead(_0x31ed64);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 88801ea..51c1258 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 _0xd64f=['../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x318034,_0x4706da){var _0x4560cd=function(_0x39b7e6){while(--_0x39b7e6){_0x318034['push'](_0x318034['shift']());}};_0x4560cd(++_0x4706da);}(_0xd64f,0x1a1));var _0xfd64=function(_0x515e3f,_0x1b3a20){_0x515e3f=_0x515e3f-0x0;var _0x453570=_0xd64f[_0x515e3f];return _0x453570;};'use strict';var multer=require(_0xfd64('0x0'));var util=require(_0xfd64('0x1'));var path=require(_0xfd64('0x2'));var timeout=require(_0xfd64('0x3'));var express=require(_0xfd64('0x4'));var router=express[_0xfd64('0x5')]();var fs_extra=require(_0xfd64('0x6'));var auth=require(_0xfd64('0x7'));var interaction=require(_0xfd64('0x8'));var config=require(_0xfd64('0x9'));var controller=require(_0xfd64('0xa'));router[_0xfd64('0xb')]('/:id',auth[_0xfd64('0xc')](),controller[_0xfd64('0xd')]);router[_0xfd64('0xe')](_0xfd64('0xf'),auth['isAuthenticated'](),controller[_0xfd64('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6068=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','/:id'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x6068,0x81));var _0x8606=function(_0x1a72d3,_0x5aeab4){_0x1a72d3=_0x1a72d3-0x0;var _0x59b506=_0x6068[_0x1a72d3];return _0x59b506;};'use strict';var multer=require(_0x8606('0x0'));var util=require(_0x8606('0x1'));var path=require(_0x8606('0x2'));var timeout=require(_0x8606('0x3'));var express=require(_0x8606('0x4'));var router=express[_0x8606('0x5')]();var fs_extra=require(_0x8606('0x6'));var auth=require(_0x8606('0x7'));var interaction=require(_0x8606('0x8'));var config=require(_0x8606('0x9'));var controller=require(_0x8606('0xa'));router[_0x8606('0xb')]('/:id',auth[_0x8606('0xc')](),controller[_0x8606('0xd')]);router['delete'](_0x8606('0xe'),auth[_0x8606('0xc')](),controller[_0x8606('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 2caf774..5b642e8 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 _0x4b5c=['exports','name','INTEGER','STRING','sequelize'];(function(_0x2f7b51,_0x11f862){var _0x3e2181=function(_0x194bcf){while(--_0x194bcf){_0x2f7b51['push'](_0x2f7b51['shift']());}};_0x3e2181(++_0x11f862);}(_0x4b5c,0x1d5));var _0xc4b5=function(_0x433179,_0x1a67fe){_0x433179=_0x433179-0x0;var _0x415d7b=_0x4b5c[_0x433179];return _0x415d7b;};'use strict';var Sequelize=require(_0xc4b5('0x0'));module[_0xc4b5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc4b5('0x2')},'OrderBy':{'type':Sequelize[_0xc4b5('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xc4b5('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0x1265=['STRING','sequelize','exports','name','INTEGER'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x1265,0x182));var _0x5126=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1265[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x5126('0x0'));module[_0x5126('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5126('0x2')},'OrderBy':{'type':Sequelize[_0x5126('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x5126('0x4')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 8020017..59db4db 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 _0xd7d1=['autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','end','error','stack','name','index','map','ContactItemType','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','userProfileId'];(function(_0x25ecdd,_0x3b7cb4){var _0x478175=function(_0x291d2e){while(--_0x291d2e){_0x25ecdd['push'](_0x25ecdd['shift']());}};_0x478175(++_0x3b7cb4);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x37074d,_0x596432){_0x37074d=_0x37074d-0x0;var _0x3e4bce=_0xd7d1[_0x37074d];return _0x3e4bce;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var licenseUtil=require(_0x1d7d('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11b83f,_0x5ae1c9){_0x5ae1c9=_0x5ae1c9||0xcc;return function(_0x577e07){if(_0x577e07){return _0x11b83f[_0x1d7d('0x1c')](_0x5ae1c9);}return _0x11b83f[_0x1d7d('0x1d')](_0x5ae1c9)['end']();};}function respondWithResult(_0x55dba7,_0x1d3822){_0x1d3822=_0x1d3822||0xc8;return function(_0x334e78){if(_0x334e78){return _0x55dba7[_0x1d7d('0x1d')](_0x1d3822)[_0x1d7d('0x1e')](_0x334e78);}};}function respondWithFilteredResult(_0xeb05b3,_0x53423f){return function(_0x28adf3){if(_0x28adf3){var _0x1de6cc=typeof _0x53423f['offset']===_0x1d7d('0x1f')&&typeof _0x53423f[_0x1d7d('0x20')]===_0x1d7d('0x1f');var _0x47826a=_0x28adf3[_0x1d7d('0x21')];var _0x4db4f2=_0x1de6cc?0x0:_0x53423f[_0x1d7d('0x22')];var _0x191024=_0x1de6cc?_0x28adf3['count']:_0x53423f['offset']+_0x53423f[_0x1d7d('0x20')];var _0x1a5101;if(_0x191024>=_0x47826a){_0x191024=_0x47826a;_0x1a5101=0xc8;}else{_0x1a5101=0xce;}_0xeb05b3[_0x1d7d('0x1d')](_0x1a5101);return _0xeb05b3[_0x1d7d('0x23')](_0x1d7d('0x24'),_0x4db4f2+'-'+_0x191024+'/'+_0x47826a)[_0x1d7d('0x1e')](_0x28adf3);}return null;};}function patchUpdates(_0x54d401){return function(_0x225f85){try{jsonpatch[_0x1d7d('0x25')](_0x225f85,_0x54d401,!![]);}catch(_0x3a93d0){return BPromise['reject'](_0x3a93d0);}return _0x225f85[_0x1d7d('0x26')]();};}function saveUpdates(_0x12c54b,_0x4a1cdc){return function(_0x5950bd){if(_0x5950bd){return _0x5950bd[_0x1d7d('0x27')](_0x12c54b)[_0x1d7d('0x28')](function(_0x3d631f){return _0x3d631f;});}return null;};}function removeEntity(_0x5097b8,_0x377653){return function(_0x106376){if(_0x106376){return _0x106376[_0x1d7d('0x29')]()[_0x1d7d('0x28')](function(){var _0x4fa346=_0x106376[_0x1d7d('0x2a')]({'plain':!![]});var _0x151198='ContactItemTypes';return db['UserProfileResource'][_0x1d7d('0x29')]({'where':{'type':_0x151198,'resourceId':_0x4fa346['id']}})['then'](function(){return _0x106376;});})[_0x1d7d('0x28')](function(){_0x5097b8[_0x1d7d('0x1d')](0xcc)[_0x1d7d('0x2b')]();});}};}function handleEntityNotFound(_0x22c40d,_0x465938){return function(_0x59f827){if(!_0x59f827){_0x22c40d[_0x1d7d('0x1c')](0x194);}return _0x59f827;};}function handleError(_0x98c1ad,_0x352d5a){_0x352d5a=_0x352d5a||0x1f4;return function(_0x58672c){logger[_0x1d7d('0x2c')](_0x58672c[_0x1d7d('0x2d')]);if(_0x58672c[_0x1d7d('0x2e')]){delete _0x58672c['name'];}_0x98c1ad['status'](_0x352d5a)['send'](_0x58672c);};}exports[_0x1d7d('0x2f')]=function(_0x329f56,_0x559f19){var _0x1ebcbc={},_0x3e4136={},_0x16a81d={'count':0x0,'rows':[]};var _0x3336ab=_[_0x1d7d('0x30')](db[_0x1d7d('0x31')][_0x1d7d('0x32')],function(_0x803dc9){return{'name':_0x803dc9[_0x1d7d('0x33')],'type':_0x803dc9[_0x1d7d('0x34')]['key']};});_0x3e4136['model']=_[_0x1d7d('0x30')](_0x3336ab,_0x1d7d('0x2e'));_0x3e4136[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x329f56[_0x1d7d('0x35')]);_0x3e4136[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x3e4136[_0x1d7d('0x39')],_0x3e4136[_0x1d7d('0x35')]);_0x1ebcbc['attributes']=_[_0x1d7d('0x38')](_0x3e4136[_0x1d7d('0x39')],qs[_0x1d7d('0x3a')](_0x329f56[_0x1d7d('0x35')]['fields']));_0x1ebcbc['attributes']=_0x1ebcbc[_0x1d7d('0x3b')][_0x1d7d('0x3c')]?_0x1ebcbc['attributes']:_0x3e4136[_0x1d7d('0x39')];if(!_0x329f56[_0x1d7d('0x35')]['hasOwnProperty']('nolimit')){_0x1ebcbc[_0x1d7d('0x20')]=qs[_0x1d7d('0x20')](_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x20')]);_0x1ebcbc[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x22')]);}_0x1ebcbc[_0x1d7d('0x3d')]=qs[_0x1d7d('0x3e')](_0x329f56['query']['sort']);_0x1ebcbc['where']=qs['filters'](_[_0x1d7d('0x3f')](_0x329f56['query'],_0x3e4136[_0x1d7d('0x37')]),_0x3336ab);if(_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x40')]){_0x1ebcbc['where']=_[_0x1d7d('0x41')](_0x1ebcbc[_0x1d7d('0x42')],{'$or':_[_0x1d7d('0x30')](_0x3336ab,function(_0x5b7e01){if(_0x5b7e01[_0x1d7d('0x34')]!==_0x1d7d('0x43')){var _0xfb9845={};_0xfb9845[_0x5b7e01[_0x1d7d('0x2e')]]={'$like':'%'+_0x329f56['query'][_0x1d7d('0x40')]+'%'};return _0xfb9845;}})});}_0x1ebcbc=_[_0x1d7d('0x41')]({},_0x1ebcbc,_0x329f56[_0x1d7d('0x44')]);var _0x456d51={'where':_0x1ebcbc['where']};return db[_0x1d7d('0x31')]['count'](_0x456d51)[_0x1d7d('0x28')](function(_0x31b850){_0x16a81d[_0x1d7d('0x21')]=_0x31b850;if(_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x45')]){_0x1ebcbc['include']=[{'all':!![]}];}return db['ContactItemType'][_0x1d7d('0x46')](_0x1ebcbc);})[_0x1d7d('0x28')](function(_0x1637fc){_0x16a81d['rows']=_0x1637fc;return _0x16a81d;})['then'](respondWithFilteredResult(_0x559f19,_0x1ebcbc))[_0x1d7d('0x47')](handleError(_0x559f19,null));};exports['show']=function(_0x86e7bc,_0x379e75){var _0x1d1064={'raw':!![],'where':{'id':_0x86e7bc[_0x1d7d('0x48')]['id']}},_0x21394c={};_0x21394c[_0x1d7d('0x39')]=_[_0x1d7d('0x36')](db['ContactItemType'][_0x1d7d('0x32')]);_0x21394c[_0x1d7d('0x35')]=_['keys'](_0x86e7bc[_0x1d7d('0x35')]);_0x21394c[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x21394c[_0x1d7d('0x39')],_0x21394c[_0x1d7d('0x35')]);_0x1d1064[_0x1d7d('0x3b')]=_[_0x1d7d('0x38')](_0x21394c[_0x1d7d('0x39')],qs[_0x1d7d('0x3a')](_0x86e7bc[_0x1d7d('0x35')][_0x1d7d('0x3a')]));_0x1d1064[_0x1d7d('0x3b')]=_0x1d1064['attributes'][_0x1d7d('0x3c')]?_0x1d1064['attributes']:_0x21394c[_0x1d7d('0x39')];if(_0x86e7bc['query'][_0x1d7d('0x45')]){_0x1d1064[_0x1d7d('0x49')]=[{'all':!![]}];}_0x1d1064=_[_0x1d7d('0x41')]({},_0x1d1064,_0x86e7bc[_0x1d7d('0x44')]);return db['ContactItemType'][_0x1d7d('0x4a')](_0x1d1064)['then'](handleEntityNotFound(_0x379e75,null))['then'](respondWithResult(_0x379e75,null))[_0x1d7d('0x47')](handleError(_0x379e75,null));};exports['create']=function(_0x57e416,_0x3727be){return db[_0x1d7d('0x31')]['create'](_0x57e416[_0x1d7d('0x4b')],{})[_0x1d7d('0x28')](function(_0x527711){var _0x1f3a63=_0x57e416[_0x1d7d('0x4c')][_0x1d7d('0x2a')]({'plain':!![]});if(!_0x1f3a63)throw new Error(_0x1d7d('0x4d'));if(_0x1f3a63['role']==='user'){var _0x3f73eb=_0x527711[_0x1d7d('0x2a')]({'plain':!![]});var _0x35ff5d=_0x1d7d('0x4e');return db[_0x1d7d('0x4f')]['find']({'where':{'name':_0x35ff5d,'userProfileId':_0x1f3a63[_0x1d7d('0x50')]},'raw':!![]})[_0x1d7d('0x28')](function(_0x344b66){if(_0x344b66&&_0x344b66[_0x1d7d('0x51')]===0x0){return db[_0x1d7d('0x52')][_0x1d7d('0x53')]({'name':_0x3f73eb[_0x1d7d('0x2e')],'resourceId':_0x3f73eb['id'],'type':_0x344b66[_0x1d7d('0x2e')],'sectionId':_0x344b66['id']},{})[_0x1d7d('0x28')](function(){return _0x527711;});}else{return _0x527711;}})['catch'](function(_0x3e7c4c){logger[_0x1d7d('0x2c')](_0x1d7d('0x54'),_0x3e7c4c);throw _0x3e7c4c;});}return _0x527711;})['then'](respondWithResult(_0x3727be,0xc9))['catch'](handleError(_0x3727be,null));};exports[_0x1d7d('0x27')]=function(_0x2d4cc3,_0x3f5434){if(_0x2d4cc3['body']['id']){delete _0x2d4cc3[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x31')]['find']({'where':{'id':_0x2d4cc3[_0x1d7d('0x48')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x3f5434,null))[_0x1d7d('0x28')](saveUpdates(_0x2d4cc3[_0x1d7d('0x4b')],null))['then'](respondWithResult(_0x3f5434,null))[_0x1d7d('0x47')](handleError(_0x3f5434,null));};exports[_0x1d7d('0x29')]=function(_0x4ba6ec,_0x4d4c34){return db[_0x1d7d('0x31')][_0x1d7d('0x4a')]({'where':{'id':_0x4ba6ec['params']['id']}})['then'](handleEntityNotFound(_0x4d4c34,null))[_0x1d7d('0x28')](db[_0x1d7d('0x55')][_0x1d7d('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4ba6ec[_0x1d7d('0x48')]['id']}}))['then'](removeEntity(_0x4d4c34,null))[_0x1d7d('0x47')](handleError(_0x4d4c34,null));}; \ No newline at end of file +var _0x4b17=['sort','pick','filters','filter','where','merge','options','ContactItemType','include','findAll','rows','show','length','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','params','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query'];(function(_0x23ca3a,_0xe44c43){var _0x5c1aab=function(_0x29bcdd){while(--_0x29bcdd){_0x23ca3a['push'](_0x23ca3a['shift']());}};_0x5c1aab(++_0xe44c43);}(_0x4b17,0x10f));var _0x74b1=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x4b17[_0x15ca1a];return _0x507626;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];function respondWithStatusCode(_0x5cfe85,_0x5f2865){_0x5f2865=_0x5f2865||0xcc;return function(_0x239d04){if(_0x239d04){return _0x5cfe85[_0x74b1('0x17')](_0x5f2865);}return _0x5cfe85['status'](_0x5f2865)['end']();};}function respondWithResult(_0x500ce2,_0x86390){_0x86390=_0x86390||0xc8;return function(_0x5c12eb){if(_0x5c12eb){return _0x500ce2['status'](_0x86390)[_0x74b1('0x18')](_0x5c12eb);}};}function respondWithFilteredResult(_0x12a2c0,_0x3779c5){return function(_0x420662){if(_0x420662){var _0x16b147=typeof _0x3779c5[_0x74b1('0x19')]==='undefined'&&typeof _0x3779c5[_0x74b1('0x1a')]===_0x74b1('0x1b');var _0x1a0851=_0x420662[_0x74b1('0x1c')];var _0xde2736=_0x16b147?0x0:_0x3779c5[_0x74b1('0x19')];var _0x1ab838=_0x16b147?_0x420662['count']:_0x3779c5[_0x74b1('0x19')]+_0x3779c5[_0x74b1('0x1a')];var _0x524ece;if(_0x1ab838>=_0x1a0851){_0x1ab838=_0x1a0851;_0x524ece=0xc8;}else{_0x524ece=0xce;}_0x12a2c0[_0x74b1('0x1d')](_0x524ece);return _0x12a2c0[_0x74b1('0x1e')](_0x74b1('0x1f'),_0xde2736+'-'+_0x1ab838+'/'+_0x1a0851)[_0x74b1('0x18')](_0x420662);}return null;};}function patchUpdates(_0x13bb44){return function(_0x33fee9){try{jsonpatch[_0x74b1('0x20')](_0x33fee9,_0x13bb44,!![]);}catch(_0xaac5f7){return BPromise['reject'](_0xaac5f7);}return _0x33fee9[_0x74b1('0x21')]();};}function saveUpdates(_0x4f1ec9,_0x5da0f7){return function(_0x481bf2){if(_0x481bf2){return _0x481bf2[_0x74b1('0x22')](_0x4f1ec9)[_0x74b1('0x23')](function(_0x405a22){return _0x405a22;});}return null;};}function removeEntity(_0x44bf7e,_0x563781){return function(_0x4ee88b){if(_0x4ee88b){return _0x4ee88b[_0x74b1('0x24')]()['then'](function(){var _0x3a7ef9=_0x4ee88b[_0x74b1('0x25')]({'plain':!![]});var _0xb5af0=_0x74b1('0x26');return db[_0x74b1('0x27')][_0x74b1('0x24')]({'where':{'type':_0xb5af0,'resourceId':_0x3a7ef9['id']}})[_0x74b1('0x23')](function(){return _0x4ee88b;});})[_0x74b1('0x23')](function(){_0x44bf7e['status'](0xcc)[_0x74b1('0x28')]();});}};}function handleEntityNotFound(_0x42b69d,_0x4099af){return function(_0x5c32d2){if(!_0x5c32d2){_0x42b69d[_0x74b1('0x17')](0x194);}return _0x5c32d2;};}function handleError(_0x351392,_0x94b1f8){_0x94b1f8=_0x94b1f8||0x1f4;return function(_0x1b011a){logger[_0x74b1('0x29')](_0x1b011a[_0x74b1('0x2a')]);if(_0x1b011a[_0x74b1('0x2b')]){delete _0x1b011a[_0x74b1('0x2b')];}_0x351392['status'](_0x94b1f8)[_0x74b1('0x2c')](_0x1b011a);};}exports[_0x74b1('0x2d')]=function(_0x51ce6d,_0x543b5){var _0x45404f={},_0x1ac433={},_0x5f4d1b={'count':0x0,'rows':[]};var _0x113300=_[_0x74b1('0x2e')](db['ContactItemType'][_0x74b1('0x2f')],function(_0x33ec7c){return{'name':_0x33ec7c[_0x74b1('0x30')],'type':_0x33ec7c[_0x74b1('0x31')][_0x74b1('0x32')]};});_0x1ac433[_0x74b1('0x33')]=_[_0x74b1('0x2e')](_0x113300,_0x74b1('0x2b'));_0x1ac433['query']=_[_0x74b1('0x34')](_0x51ce6d['query']);_0x1ac433['filters']=_[_0x74b1('0x35')](_0x1ac433['model'],_0x1ac433['query']);_0x45404f[_0x74b1('0x36')]=_[_0x74b1('0x35')](_0x1ac433[_0x74b1('0x33')],qs[_0x74b1('0x37')](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x37')]));_0x45404f[_0x74b1('0x36')]=_0x45404f[_0x74b1('0x36')]['length']?_0x45404f['attributes']:_0x1ac433['model'];if(!_0x51ce6d[_0x74b1('0x38')]['hasOwnProperty']('nolimit')){_0x45404f[_0x74b1('0x1a')]=qs[_0x74b1('0x1a')](_0x51ce6d[_0x74b1('0x38')]['limit']);_0x45404f[_0x74b1('0x19')]=qs['offset'](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x19')]);}_0x45404f['order']=qs['sort'](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x39')]);_0x45404f['where']=qs['filters'](_[_0x74b1('0x3a')](_0x51ce6d['query'],_0x1ac433[_0x74b1('0x3b')]),_0x113300);if(_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x3c')]){_0x45404f[_0x74b1('0x3d')]=_[_0x74b1('0x3e')](_0x45404f['where'],{'$or':_[_0x74b1('0x2e')](_0x113300,function(_0x5a981b){if(_0x5a981b[_0x74b1('0x31')]!=='VIRTUAL'){var _0x23cac2={};_0x23cac2[_0x5a981b['name']]={'$like':'%'+_0x51ce6d['query'][_0x74b1('0x3c')]+'%'};return _0x23cac2;}})});}_0x45404f=_[_0x74b1('0x3e')]({},_0x45404f,_0x51ce6d[_0x74b1('0x3f')]);var _0x49f7da={'where':_0x45404f[_0x74b1('0x3d')]};return db[_0x74b1('0x40')][_0x74b1('0x1c')](_0x49f7da)['then'](function(_0xfecdc){_0x5f4d1b[_0x74b1('0x1c')]=_0xfecdc;if(_0x51ce6d['query']['includeAll']){_0x45404f[_0x74b1('0x41')]=[{'all':!![]}];}return db[_0x74b1('0x40')][_0x74b1('0x42')](_0x45404f);})[_0x74b1('0x23')](function(_0x1d9f5b){_0x5f4d1b[_0x74b1('0x43')]=_0x1d9f5b;return _0x5f4d1b;})[_0x74b1('0x23')](respondWithFilteredResult(_0x543b5,_0x45404f))['catch'](handleError(_0x543b5,null));};exports[_0x74b1('0x44')]=function(_0x118623,_0x456c6e){var _0x452fa0={'raw':!![],'where':{'id':_0x118623['params']['id']}},_0x17a44f={};_0x17a44f[_0x74b1('0x33')]=_[_0x74b1('0x34')](db['ContactItemType']['rawAttributes']);_0x17a44f[_0x74b1('0x38')]=_[_0x74b1('0x34')](_0x118623['query']);_0x17a44f[_0x74b1('0x3b')]=_[_0x74b1('0x35')](_0x17a44f[_0x74b1('0x33')],_0x17a44f[_0x74b1('0x38')]);_0x452fa0[_0x74b1('0x36')]=_[_0x74b1('0x35')](_0x17a44f[_0x74b1('0x33')],qs['fields'](_0x118623['query']['fields']));_0x452fa0[_0x74b1('0x36')]=_0x452fa0[_0x74b1('0x36')][_0x74b1('0x45')]?_0x452fa0[_0x74b1('0x36')]:_0x17a44f[_0x74b1('0x33')];if(_0x118623['query'][_0x74b1('0x46')]){_0x452fa0[_0x74b1('0x41')]=[{'all':!![]}];}_0x452fa0=_[_0x74b1('0x3e')]({},_0x452fa0,_0x118623[_0x74b1('0x3f')]);return db[_0x74b1('0x40')][_0x74b1('0x47')](_0x452fa0)[_0x74b1('0x23')](handleEntityNotFound(_0x456c6e,null))[_0x74b1('0x23')](respondWithResult(_0x456c6e,null))[_0x74b1('0x48')](handleError(_0x456c6e,null));};exports[_0x74b1('0x49')]=function(_0x186516,_0x3038f9){return db['ContactItemType'][_0x74b1('0x49')](_0x186516[_0x74b1('0x4a')],{})['then'](function(_0xf3735e){var _0x4923d2=_0x186516[_0x74b1('0x4b')][_0x74b1('0x25')]({'plain':!![]});if(!_0x4923d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4923d2[_0x74b1('0x4c')]===_0x74b1('0x4b')){var _0x326b98=_0xf3735e['get']({'plain':!![]});var _0x497006=_0x74b1('0x26');return db[_0x74b1('0x4d')][_0x74b1('0x47')]({'where':{'name':_0x497006,'userProfileId':_0x4923d2[_0x74b1('0x4e')]},'raw':!![]})['then'](function(_0x1e7507){if(_0x1e7507&&_0x1e7507['autoAssociation']===0x0){return db[_0x74b1('0x27')][_0x74b1('0x49')]({'name':_0x326b98['name'],'resourceId':_0x326b98['id'],'type':_0x1e7507[_0x74b1('0x2b')],'sectionId':_0x1e7507['id']},{})[_0x74b1('0x23')](function(){return _0xf3735e;});}else{return _0xf3735e;}})[_0x74b1('0x48')](function(_0x54a221){logger[_0x74b1('0x29')](_0x74b1('0x4f'),_0x54a221);throw _0x54a221;});}return _0xf3735e;})['then'](respondWithResult(_0x3038f9,0xc9))[_0x74b1('0x48')](handleError(_0x3038f9,null));};exports['update']=function(_0x4ba250,_0x18cd64){if(_0x4ba250[_0x74b1('0x4a')]['id']){delete _0x4ba250[_0x74b1('0x4a')]['id'];}return db[_0x74b1('0x40')][_0x74b1('0x47')]({'where':{'id':_0x4ba250['params']['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x18cd64,null))[_0x74b1('0x23')](saveUpdates(_0x4ba250['body'],null))[_0x74b1('0x23')](respondWithResult(_0x18cd64,null))[_0x74b1('0x48')](handleError(_0x18cd64,null));};exports[_0x74b1('0x24')]=function(_0x5634d1,_0x2fac5d){return db[_0x74b1('0x40')][_0x74b1('0x47')]({'where':{'id':_0x5634d1['params']['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x2fac5d,null))[_0x74b1('0x23')](db[_0x74b1('0x50')][_0x74b1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5634d1[_0x74b1('0x51')]['id']}}))[_0x74b1('0x23')](removeEntity(_0x2fac5d,null))['catch'](handleError(_0x2fac5d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index b7ca360..bfca2a0 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 _0x0b90=['util','api','moment','request-promise','path','rimraf','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash'];(function(_0x2fadef,_0x5d6003){var _0x1ee285=function(_0x2ef6e0){while(--_0x2ef6e0){_0x2fadef['push'](_0x2fadef['shift']());}};_0x1ee285(++_0x5d6003);}(_0x0b90,0x18b));var _0x00b9=function(_0x3a0f34,_0xc9b056){_0x3a0f34=_0x3a0f34-0x0;var _0xce46ab=_0x0b90[_0x3a0f34];return _0xce46ab;};'use strict';var _=require(_0x00b9('0x0'));var util=require(_0x00b9('0x1'));var logger=require('../../config/logger')(_0x00b9('0x2'));var moment=require(_0x00b9('0x3'));var BPromise=require('bluebird');var rp=require(_0x00b9('0x4'));var fs=require('fs');var path=require(_0x00b9('0x5'));var rimraf=require(_0x00b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x00b9('0x7'));module[_0x00b9('0x8')]=function(_0x145c4e,_0x4b658d){return _0x145c4e[_0x00b9('0x9')](_0x00b9('0xa'),attributes,{'tableName':_0x00b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd2e=['path','rimraf','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types','lodash','util','moment','request-promise'];(function(_0x4b8338,_0xd13dd1){var _0x5381cc=function(_0x26de0a){while(--_0x26de0a){_0x4b8338['push'](_0x4b8338['shift']());}};_0x5381cc(++_0xd13dd1);}(_0xfd2e,0xe3));var _0xefd2=function(_0x11e4f2,_0x128f5b){_0x11e4f2=_0x11e4f2-0x0;var _0x362eff=_0xfd2e[_0x11e4f2];return _0x362eff;};'use strict';var _=require(_0xefd2('0x0'));var util=require(_0xefd2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xefd2('0x2'));var BPromise=require('bluebird');var rp=require(_0xefd2('0x3'));var fs=require('fs');var path=require(_0xefd2('0x4'));var rimraf=require(_0xefd2('0x5'));var config=require(_0xefd2('0x6'));var attributes=require(_0xefd2('0x7'));module[_0xefd2('0x8')]=function(_0x5b428b,_0x4fa157){return _0x5b428b['define'](_0xefd2('0x9'),attributes,{'tableName':_0xefd2('0xa'),'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 a6ce87d..c1d87b6 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 _0x05c8=['http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3b0977,_0x5d7de6){var _0x49325b=function(_0x47651d){while(--_0x47651d){_0x3b0977['push'](_0x3b0977['shift']());}};_0x49325b(++_0x5d7de6);}(_0x05c8,0x7b));var _0x805c=function(_0x1408d4,_0x1bc7ea){_0x1408d4=_0x1408d4-0x0;var _0x4c7180=_0x05c8[_0x1408d4];return _0x4c7180;};'use strict';var _=require(_0x805c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x805c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x805c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x805c('0x3'));var logger=require(_0x805c('0x4'))(_0x805c('0x5'));var config=require(_0x805c('0x6'));var jayson=require(_0x805c('0x7'));var client=jayson[_0x805c('0x8')][_0x805c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x78033d,_0x4a911d,_0x201d9e){return new BPromise(function(_0x3dfffd,_0x31c6f3){return client[_0x805c('0xa')](_0x78033d,_0x201d9e)[_0x805c('0xb')](function(_0x511074){logger[_0x805c('0xc')](_0x805c('0xd'),_0x4a911d,_0x805c('0xe'));logger[_0x805c('0xf')](_0x805c('0x10'),_0x4a911d,_0x805c('0xe'),JSON[_0x805c('0x11')](_0x511074));if(_0x511074[_0x805c('0x12')]){if(_0x511074['error'][_0x805c('0x13')]===0x1f4){logger['error'](_0x805c('0xd'),_0x4a911d,_0x511074[_0x805c('0x12')]['message']);return _0x31c6f3(_0x511074[_0x805c('0x12')][_0x805c('0x14')]);}logger['error'](_0x805c('0xd'),_0x4a911d,_0x511074[_0x805c('0x12')][_0x805c('0x14')]);return _0x3dfffd(_0x511074[_0x805c('0x12')][_0x805c('0x14')]);}else{logger[_0x805c('0xc')]('ContactItemType,\x20%s,\x20%s',_0x4a911d,_0x805c('0xe'));_0x3dfffd(_0x511074['result'][_0x805c('0x14')]);}})[_0x805c('0x15')](function(_0x3267f9){logger['error'](_0x805c('0xd'),_0x4a911d,_0x3267f9);_0x31c6f3(_0x3267f9);});});} \ No newline at end of file +var _0x1a67=['client','http','then','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x8eaa3,_0x1f6af2){var _0x30138c=function(_0x42b717){while(--_0x42b717){_0x8eaa3['push'](_0x8eaa3['shift']());}};_0x30138c(++_0x1f6af2);}(_0x1a67,0x1c5));var _0x71a6=function(_0x5453be,_0x469909){_0x5453be=_0x5453be-0x0;var _0x2c8372=_0x1a67[_0x5453be];return _0x2c8372;};'use strict';var _=require(_0x71a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x71a6('0x1'));var rs=require(_0x71a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71a6('0x3'))['db'];var utils=require(_0x71a6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x71a6('0x5'));var jayson=require(_0x71a6('0x6'));var client=jayson[_0x71a6('0x7')][_0x71a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b0639,_0x19a03d,_0x236196){return new BPromise(function(_0x2da358,_0x477db7){return client['request'](_0x1b0639,_0x236196)[_0x71a6('0x9')](function(_0x310f92){logger['info']('ContactItemType,\x20%s,\x20%s',_0x19a03d,_0x71a6('0xa'));logger['debug'](_0x71a6('0xb'),_0x19a03d,_0x71a6('0xa'),JSON[_0x71a6('0xc')](_0x310f92));if(_0x310f92[_0x71a6('0xd')]){if(_0x310f92[_0x71a6('0xd')][_0x71a6('0xe')]===0x1f4){logger[_0x71a6('0xd')](_0x71a6('0xf'),_0x19a03d,_0x310f92[_0x71a6('0xd')][_0x71a6('0x10')]);return _0x477db7(_0x310f92[_0x71a6('0xd')][_0x71a6('0x10')]);}logger[_0x71a6('0xd')]('ContactItemType,\x20%s,\x20%s',_0x19a03d,_0x310f92[_0x71a6('0xd')]['message']);return _0x2da358(_0x310f92[_0x71a6('0xd')][_0x71a6('0x10')]);}else{logger[_0x71a6('0x11')](_0x71a6('0xf'),_0x19a03d,_0x71a6('0xa'));_0x2da358(_0x310f92[_0x71a6('0x12')][_0x71a6('0x10')]);}})[_0x71a6('0x13')](function(_0xc8ed30){logger['error'](_0x71a6('0xf'),_0x19a03d,_0xc8ed30);_0x477db7(_0xc8ed30);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 09d5621..6c03b77 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 _0x6666=['index','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x6666,0x1ec));var _0x6666=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x6666[_0x310a1b];return _0xdea206;};'use strict';var multer=require(_0x6666('0x0'));var util=require(_0x6666('0x1'));var path=require(_0x6666('0x2'));var timeout=require(_0x6666('0x3'));var express=require('express');var router=express[_0x6666('0x4')]();var fs_extra=require(_0x6666('0x5'));var auth=require(_0x6666('0x6'));var interaction=require(_0x6666('0x7'));var config=require(_0x6666('0x8'));var controller=require(_0x6666('0x9'));router[_0x6666('0xa')]('/',auth[_0x6666('0xb')](),controller[_0x6666('0xc')]);router[_0x6666('0xa')]('/:id',auth[_0x6666('0xb')](),controller['show']);router['post']('/',auth[_0x6666('0xb')](),controller[_0x6666('0xd')]);router['put'](_0x6666('0xe'),auth[_0x6666('0xb')](),controller[_0x6666('0xf')]);router['delete']('/:id',auth[_0x6666('0xb')](),controller[_0x6666('0x10')]);module[_0x6666('0x11')]=router; \ No newline at end of file +var _0xb17b=['show','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xb17b,0x135));var _0xbb17=function(_0x43bf56,_0x14c2b2){_0x43bf56=_0x43bf56-0x0;var _0xd5ecfa=_0xb17b[_0x43bf56];return _0xd5ecfa;};'use strict';var multer=require(_0xbb17('0x0'));var util=require(_0xbb17('0x1'));var path=require(_0xbb17('0x2'));var timeout=require(_0xbb17('0x3'));var express=require(_0xbb17('0x4'));var router=express[_0xbb17('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb17('0x6'));var interaction=require(_0xbb17('0x7'));var config=require(_0xbb17('0x8'));var controller=require(_0xbb17('0x9'));router[_0xbb17('0xa')]('/',auth[_0xbb17('0xb')](),controller[_0xbb17('0xc')]);router['get'](_0xbb17('0xd'),auth[_0xbb17('0xb')](),controller[_0xbb17('0xe')]);router['post']('/',auth[_0xbb17('0xb')](),controller[_0xbb17('0xf')]);router[_0xbb17('0x10')](_0xbb17('0xd'),auth[_0xbb17('0xb')](),controller[_0xbb17('0x11')]);router['delete']('/:id',auth[_0xbb17('0xb')](),controller['destroy']);module[_0xbb17('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 7079a43..6146aac 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 _0xb10b=['name','sequelize','STRING'];(function(_0x28381e,_0x23ccdf){var _0x1cb678=function(_0x57fb49){while(--_0x57fb49){_0x28381e['push'](_0x28381e['shift']());}};_0x1cb678(++_0x23ccdf);}(_0xb10b,0x12a));var _0xbb10=function(_0x14d9b7,_0x41650d){_0x14d9b7=_0x14d9b7-0x0;var _0x254b92=_0xb10b[_0x14d9b7];return _0x254b92;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x5b76b2,_0x12070e){var _0x52ec35=function(_0x42ee7f){while(--_0x42ee7f){_0x5b76b2['push'](_0x5b76b2['shift']());}};_0x52ec35(++_0x12070e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index ccfc930..3cbd0d2 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 _0x3b4d=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','Dashboard','findAll','catch','params','length','include','options','find','create','body','user','role','autoAssociation','clone','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','order','getItems','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse'];(function(_0x368764,_0xb7bee9){var _0x3e30dd=function(_0x5b7e49){while(--_0x5b7e49){_0x368764['push'](_0x368764['shift']());}};_0x3e30dd(++_0xb7bee9);}(_0x3b4d,0x75));var _0xd3b4=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x3b4d[_0x5d7227];return _0x15ac55;};'use strict';var emlformat=require(_0xd3b4('0x0'));var rimraf=require(_0xd3b4('0x1'));var zipdir=require(_0xd3b4('0x2'));var jsonpatch=require(_0xd3b4('0x3'));var rp=require('request-promise');var moment=require(_0xd3b4('0x4'));var BPromise=require(_0xd3b4('0x5'));var Mustache=require(_0xd3b4('0x6'));var util=require('util');var path=require(_0xd3b4('0x7'));var sox=require(_0xd3b4('0x8'));var csv=require(_0xd3b4('0x9'));var ejs=require(_0xd3b4('0xa'));var fs=require('fs');var fs_extra=require(_0xd3b4('0xb'));var _=require(_0xd3b4('0xc'));var squel=require(_0xd3b4('0xd'));var crypto=require('crypto');var jsforce=require(_0xd3b4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd3b4('0x9'));var querystring=require(_0xd3b4('0xf'));var Papa=require(_0xd3b4('0x10'));var Redis=require(_0xd3b4('0x11'));var authService=require(_0xd3b4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd3b4('0x13'));var hardwareService=require(_0xd3b4('0x14'));var logger=require('../../config/logger')(_0xd3b4('0x15'));var utils=require(_0xd3b4('0x16'));var config=require(_0xd3b4('0x17'));var licenseUtil=require(_0xd3b4('0x18'));var db=require(_0xd3b4('0x19'))['db'];config[_0xd3b4('0x1a')]=_[_0xd3b4('0x1b')](config[_0xd3b4('0x1a')],{'host':_0xd3b4('0x1c'),'port':0x18eb});var socket=require(_0xd3b4('0x1d'))(new Redis(config[_0xd3b4('0x1a')]));require(_0xd3b4('0x1e'))[_0xd3b4('0x1f')](socket);function respondWithStatusCode(_0x219642,_0x467350){_0x467350=_0x467350||0xcc;return function(_0x119f59){if(_0x119f59){return _0x219642[_0xd3b4('0x20')](_0x467350);}return _0x219642['status'](_0x467350)[_0xd3b4('0x21')]();};}function respondWithResult(_0x3f3ee9,_0x535936){_0x535936=_0x535936||0xc8;return function(_0x11b892){if(_0x11b892){return _0x3f3ee9[_0xd3b4('0x22')](_0x535936)[_0xd3b4('0x23')](_0x11b892);}};}function respondWithFilteredResult(_0x3af705,_0x529567){return function(_0x1914af){if(_0x1914af){var _0x50b59a=typeof _0x529567['offset']===_0xd3b4('0x24')&&typeof _0x529567[_0xd3b4('0x25')]===_0xd3b4('0x24');var _0x5588a1=_0x1914af[_0xd3b4('0x26')];var _0x31d62d=_0x50b59a?0x0:_0x529567[_0xd3b4('0x27')];var _0x587aa9=_0x50b59a?_0x1914af[_0xd3b4('0x26')]:_0x529567[_0xd3b4('0x27')]+_0x529567[_0xd3b4('0x25')];var _0x33928b;if(_0x587aa9>=_0x5588a1){_0x587aa9=_0x5588a1;_0x33928b=0xc8;}else{_0x33928b=0xce;}_0x3af705['status'](_0x33928b);return _0x3af705[_0xd3b4('0x28')](_0xd3b4('0x29'),_0x31d62d+'-'+_0x587aa9+'/'+_0x5588a1)['json'](_0x1914af);}return null;};}function patchUpdates(_0x4238fd){return function(_0x184baa){try{jsonpatch[_0xd3b4('0x2a')](_0x184baa,_0x4238fd,!![]);}catch(_0x3dcec3){return BPromise[_0xd3b4('0x2b')](_0x3dcec3);}return _0x184baa[_0xd3b4('0x2c')]();};}function saveUpdates(_0x129a11,_0x1d0861){return function(_0x574297){if(_0x574297){return _0x574297[_0xd3b4('0x2d')](_0x129a11)[_0xd3b4('0x2e')](function(_0xa0cfea){return _0xa0cfea;});}return null;};}function removeEntity(_0x399f08,_0x5e0c79){return function(_0x265f9d){if(_0x265f9d){return _0x265f9d['destroy']()[_0xd3b4('0x2e')](function(){var _0xdb1b0=_0x265f9d[_0xd3b4('0x2f')]({'plain':!![]});var _0x4b97d7=_0xd3b4('0x30');return db[_0xd3b4('0x31')][_0xd3b4('0x32')]({'where':{'type':_0x4b97d7,'resourceId':_0xdb1b0['id']}})[_0xd3b4('0x2e')](function(){return _0x265f9d;});})[_0xd3b4('0x2e')](function(){_0x399f08[_0xd3b4('0x22')](0xcc)[_0xd3b4('0x21')]();});}};}function handleEntityNotFound(_0x6d94ae,_0x5cd25f){return function(_0x1d7577){if(!_0x1d7577){_0x6d94ae['sendStatus'](0x194);}return _0x1d7577;};}function handleError(_0x5d0895,_0x13e248){_0x13e248=_0x13e248||0x1f4;return function(_0x5a452b){logger[_0xd3b4('0x33')](_0x5a452b[_0xd3b4('0x34')]);if(_0x5a452b['name']){delete _0x5a452b[_0xd3b4('0x35')];}_0x5d0895[_0xd3b4('0x22')](_0x13e248)[_0xd3b4('0x36')](_0x5a452b);};}exports[_0xd3b4('0x37')]=function(_0x39d02c,_0x30d7fd){var _0xec2ef2={},_0xee509d={},_0x2c9eb3={'count':0x0,'rows':[]};var _0x4750ed=_[_0xd3b4('0x38')](db['Dashboard'][_0xd3b4('0x39')],function(_0x71d96d){return{'name':_0x71d96d['fieldName'],'type':_0x71d96d[_0xd3b4('0x3a')]['key']};});_0xee509d[_0xd3b4('0x3b')]=_['map'](_0x4750ed,_0xd3b4('0x35'));_0xee509d[_0xd3b4('0x3c')]=_[_0xd3b4('0x3d')](_0x39d02c[_0xd3b4('0x3c')]);_0xee509d[_0xd3b4('0x3e')]=_[_0xd3b4('0x3f')](_0xee509d[_0xd3b4('0x3b')],_0xee509d['query']);_0xec2ef2[_0xd3b4('0x40')]=_['intersection'](_0xee509d[_0xd3b4('0x3b')],qs[_0xd3b4('0x41')](_0x39d02c[_0xd3b4('0x3c')]['fields']));_0xec2ef2[_0xd3b4('0x40')]=_0xec2ef2[_0xd3b4('0x40')]['length']?_0xec2ef2[_0xd3b4('0x40')]:_0xee509d['model'];if(!_0x39d02c['query'][_0xd3b4('0x42')]('nolimit')){_0xec2ef2[_0xd3b4('0x25')]=qs['limit'](_0x39d02c[_0xd3b4('0x3c')][_0xd3b4('0x25')]);_0xec2ef2[_0xd3b4('0x27')]=qs['offset'](_0x39d02c['query'][_0xd3b4('0x27')]);}_0xec2ef2['order']=qs[_0xd3b4('0x43')](_0x39d02c['query'][_0xd3b4('0x43')]);_0xec2ef2['where']=qs[_0xd3b4('0x3e')](_[_0xd3b4('0x44')](_0x39d02c[_0xd3b4('0x3c')],_0xee509d[_0xd3b4('0x3e')]),_0x4750ed);if(_0x39d02c[_0xd3b4('0x3c')][_0xd3b4('0x45')]){_0xec2ef2[_0xd3b4('0x46')]=_[_0xd3b4('0x47')](_0xec2ef2['where'],{'$or':_[_0xd3b4('0x38')](_0x4750ed,function(_0x534b30){if(_0x534b30[_0xd3b4('0x3a')]!=='VIRTUAL'){var _0x171c35={};_0x171c35[_0x534b30['name']]={'$like':'%'+_0x39d02c['query']['filter']+'%'};return _0x171c35;}})});}_0xec2ef2=_['merge']({},_0xec2ef2,_0x39d02c['options']);var _0x46d0ca={'where':_0xec2ef2[_0xd3b4('0x46')]};return db[_0xd3b4('0x48')]['count'](_0x46d0ca)[_0xd3b4('0x2e')](function(_0x54f7d4){_0x2c9eb3['count']=_0x54f7d4;if(_0x39d02c[_0xd3b4('0x3c')]['includeAll']){_0xec2ef2['include']=[{'all':!![]}];}return db['Dashboard'][_0xd3b4('0x49')](_0xec2ef2);})[_0xd3b4('0x2e')](function(_0x58e004){_0x2c9eb3['rows']=_0x58e004;return _0x2c9eb3;})['then'](respondWithFilteredResult(_0x30d7fd,_0xec2ef2))[_0xd3b4('0x4a')](handleError(_0x30d7fd,null));};exports['show']=function(_0x20af47,_0x2cf7a1){var _0x3b8ddb={'raw':![],'where':{'id':_0x20af47[_0xd3b4('0x4b')]['id']}},_0x3090e7={};_0x3090e7[_0xd3b4('0x3b')]=_[_0xd3b4('0x3d')](db[_0xd3b4('0x48')][_0xd3b4('0x39')]);_0x3090e7[_0xd3b4('0x3c')]=_['keys'](_0x20af47[_0xd3b4('0x3c')]);_0x3090e7['filters']=_[_0xd3b4('0x3f')](_0x3090e7[_0xd3b4('0x3b')],_0x3090e7['query']);_0x3b8ddb[_0xd3b4('0x40')]=_[_0xd3b4('0x3f')](_0x3090e7['model'],qs[_0xd3b4('0x41')](_0x20af47[_0xd3b4('0x3c')][_0xd3b4('0x41')]));_0x3b8ddb[_0xd3b4('0x40')]=_0x3b8ddb[_0xd3b4('0x40')][_0xd3b4('0x4c')]?_0x3b8ddb[_0xd3b4('0x40')]:_0x3090e7['model'];if(_0x20af47[_0xd3b4('0x3c')]['includeAll']){_0x3b8ddb[_0xd3b4('0x4d')]=[{'all':!![]}];}_0x3b8ddb=_[_0xd3b4('0x47')]({},_0x3b8ddb,_0x20af47[_0xd3b4('0x4e')]);return db['Dashboard'][_0xd3b4('0x4f')](_0x3b8ddb)[_0xd3b4('0x2e')](handleEntityNotFound(_0x2cf7a1,null))[_0xd3b4('0x2e')](respondWithResult(_0x2cf7a1,null))[_0xd3b4('0x4a')](handleError(_0x2cf7a1,null));};exports['create']=function(_0x48f100,_0x4a57fb){return db[_0xd3b4('0x48')][_0xd3b4('0x50')](_0x48f100[_0xd3b4('0x51')],{})[_0xd3b4('0x2e')](function(_0x4e0433){var _0x20050f=_0x48f100[_0xd3b4('0x52')][_0xd3b4('0x2f')]({'plain':!![]});if(!_0x20050f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20050f[_0xd3b4('0x53')]==='user'){var _0x59a790=_0x4e0433[_0xd3b4('0x2f')]({'plain':!![]});var _0x2bac2f=_0xd3b4('0x30');return db['UserProfileSection']['find']({'where':{'name':_0x2bac2f,'userProfileId':_0x20050f['userProfileId']},'raw':!![]})[_0xd3b4('0x2e')](function(_0x51b93f){if(_0x51b93f&&_0x51b93f[_0xd3b4('0x54')]===0x0){return db[_0xd3b4('0x31')][_0xd3b4('0x50')]({'name':_0x59a790['name'],'resourceId':_0x59a790['id'],'type':_0x51b93f['name'],'sectionId':_0x51b93f['id']},{})['then'](function(){return _0x4e0433;});}else{return _0x4e0433;}})['catch'](function(_0x3c5bd9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c5bd9);throw _0x3c5bd9;});}return _0x4e0433;})[_0xd3b4('0x2e')](respondWithResult(_0x4a57fb,0xc9))[_0xd3b4('0x4a')](handleError(_0x4a57fb,null));};exports[_0xd3b4('0x55')]=function(_0x2e12c1,_0x1d79d3){var _0x3d6b04={'where':{'id':_0x2e12c1[_0xd3b4('0x4b')]['id']}},_0x1875f3={};_0x1875f3['model']=_['keys'](db[_0xd3b4('0x48')][_0xd3b4('0x39')]);_0x3d6b04[_0xd3b4('0x40')]=_[_0xd3b4('0x3f')](_0x1875f3[_0xd3b4('0x3b')],qs[_0xd3b4('0x41')](_0x2e12c1[_0xd3b4('0x3c')][_0xd3b4('0x41')]));_0x3d6b04[_0xd3b4('0x40')]=_0x3d6b04[_0xd3b4('0x40')][_0xd3b4('0x4c')]?_0x3d6b04['attributes']:_0x1875f3[_0xd3b4('0x3b')];if(_0x2e12c1['query'][_0xd3b4('0x56')]){_0x3d6b04[_0xd3b4('0x4d')]=[{'all':!![]}];}_0x3d6b04=_['merge']({},_0x3d6b04,_0x2e12c1[_0xd3b4('0x4e')]);return db[_0xd3b4('0x48')][_0xd3b4('0x4f')](_0x3d6b04)['then'](handleEntityNotFound(_0x1d79d3,null))[_0xd3b4('0x2e')](function(_0x151376){if(_0x151376){var _0x2a97f4=_0x151376[_0xd3b4('0x2f')]({'plain':!![]});_0x2a97f4=qs[_0xd3b4('0x57')](_0x2a97f4,['id',_0xd3b4('0x58'),'updatedAt']);_0x2e12c1[_0xd3b4('0x51')]=_[_0xd3b4('0x57')](_0x2e12c1[_0xd3b4('0x51')],['id',_0xd3b4('0x58'),_0xd3b4('0x59')]);return db[_0xd3b4('0x48')][_0xd3b4('0x50')](_[_0xd3b4('0x47')](_0x2a97f4,_0x2e12c1[_0xd3b4('0x51')]),{'include':_0x2e12c1['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd3b4('0x2e')](function(_0x1a49ed){var _0x4f80a7=_0x2e12c1[_0xd3b4('0x52')][_0xd3b4('0x2f')]({'plain':!![]});if(!_0x4f80a7)throw new Error(_0xd3b4('0x5a'));if(_0x4f80a7[_0xd3b4('0x53')]===_0xd3b4('0x52')){var _0x3c699f=_0x1a49ed['get']({'plain':!![]});var _0x591fd6='CustomDashboards';return db[_0xd3b4('0x5b')][_0xd3b4('0x4f')]({'where':{'name':_0x591fd6,'userProfileId':_0x4f80a7[_0xd3b4('0x5c')]},'raw':!![]})[_0xd3b4('0x2e')](function(_0x2e950c){if(_0x2e950c&&_0x2e950c[_0xd3b4('0x54')]===0x0){return db[_0xd3b4('0x31')][_0xd3b4('0x50')]({'name':_0x3c699f[_0xd3b4('0x35')],'resourceId':_0x3c699f['id'],'type':_0x2e950c[_0xd3b4('0x35')],'sectionId':_0x2e950c['id']},{})[_0xd3b4('0x2e')](function(){return _0x1a49ed;});}else{return _0x1a49ed;}})[_0xd3b4('0x4a')](function(_0x549448){logger[_0xd3b4('0x33')](_0xd3b4('0x5d'),_0x549448);throw _0x549448;});}return _0x1a49ed;});}})['then'](respondWithResult(_0x1d79d3,0xc9))[_0xd3b4('0x4a')](handleError(_0x1d79d3,null));};exports[_0xd3b4('0x2d')]=function(_0xeddf38,_0x190e76){if(_0xeddf38[_0xd3b4('0x51')]['id']){delete _0xeddf38['body']['id'];}return db[_0xd3b4('0x48')][_0xd3b4('0x4f')]({'where':{'id':_0xeddf38[_0xd3b4('0x4b')]['id']}})[_0xd3b4('0x2e')](handleEntityNotFound(_0x190e76,null))['then'](saveUpdates(_0xeddf38[_0xd3b4('0x51')],null))[_0xd3b4('0x2e')](respondWithResult(_0x190e76,null))['catch'](handleError(_0x190e76,null));};exports['destroy']=function(_0x4c9588,_0x46d55e){return db[_0xd3b4('0x48')][_0xd3b4('0x4f')]({'where':{'id':_0x4c9588[_0xd3b4('0x4b')]['id']}})[_0xd3b4('0x2e')](handleEntityNotFound(_0x46d55e,null))[_0xd3b4('0x2e')](removeEntity(_0x46d55e,null))[_0xd3b4('0x4a')](handleError(_0x46d55e,null));};function widgetAttributes(_0x59ea89){try{switch(_0x59ea89[_0xd3b4('0x3a')]){case _0xd3b4('0x5e'):return[{'name':_0xd3b4('0x5f'),'value':_0x59ea89[_0xd3b4('0x5f')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x0]?_0x59ea89[_0xd3b4('0x60')][0x0]['value']:undefined)||_0xd3b4('0x61')}];case _0xd3b4('0x62'):return[{'name':_0xd3b4('0x63'),'value':_0x59ea89[_0xd3b4('0x63')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x0]?_0x59ea89['attrs'][0x0]['value']:undefined)||''}];case _0xd3b4('0x64'):return[{'name':_0xd3b4('0x65'),'value':_0x59ea89[_0xd3b4('0x65')]||(_0x59ea89['attrs']&&_0x59ea89[_0xd3b4('0x60')][0x0]?_0x59ea89[_0xd3b4('0x60')][0x0][_0xd3b4('0x66')]:undefined)||_0xd3b4('0x67')},{'name':_0xd3b4('0x68'),'value':_0x59ea89['attrTimezone']||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x1]?_0x59ea89[_0xd3b4('0x60')][0x1][_0xd3b4('0x66')]:undefined)||_0xd3b4('0x69')},{'name':'attrFontSize','value':_0x59ea89[_0xd3b4('0x6a')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x2]?_0x59ea89['attrs'][0x2][_0xd3b4('0x66')]:undefined)||0xc}];case _0xd3b4('0x6b'):return[{'name':_0xd3b4('0x6c'),'value':_0x59ea89['attrMetric']||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x0]?_0x59ea89['attrs'][0x0]['value']:undefined)||_0xd3b4('0x6d')},{'name':'attrVoiceQueues','value':_0x59ea89[_0xd3b4('0x6e')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x1]?_0x59ea89['attrs'][0x1]['value']:undefined)||[]},{'name':_0xd3b4('0x6a'),'value':_0x59ea89[_0xd3b4('0x6a')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x2]?_0x59ea89['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xd3b4('0x6f'),'value':_0x59ea89[_0xd3b4('0x6f')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x3]?_0x59ea89[_0xd3b4('0x60')][0x3][_0xd3b4('0x66')]:undefined)||_0xd3b4('0x70')},{'name':_0xd3b4('0x71'),'value':_0x59ea89[_0xd3b4('0x71')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x4]?_0x59ea89[_0xd3b4('0x60')][0x4][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x72'),'value':_0x59ea89[_0xd3b4('0x72')]||(_0x59ea89['attrs']&&_0x59ea89['attrs'][0x5]?_0x59ea89[_0xd3b4('0x60')][0x5][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x73'),'value':_0x59ea89[_0xd3b4('0x73')]||(_0x59ea89['attrs']&&_0x59ea89[_0xd3b4('0x60')][0x6]?_0x59ea89[_0xd3b4('0x60')][0x6][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x74'),'value':_0x59ea89[_0xd3b4('0x74')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x7]?_0x59ea89['attrs'][0x7][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x75'),'value':_0x59ea89[_0xd3b4('0x75')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x8]?_0x59ea89[_0xd3b4('0x60')][0x8][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x76'),'value':_0x59ea89[_0xd3b4('0x76')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x9]?_0x59ea89['attrs'][0x9][_0xd3b4('0x66')]:undefined)||''}];case _0xd3b4('0x77'):case _0xd3b4('0x78'):return[{'name':'attrSerie1','value':_0x59ea89[_0xd3b4('0x79')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x0]?_0x59ea89[_0xd3b4('0x60')][0x0]['value']:undefined)||'total'},{'name':_0xd3b4('0x7a'),'value':_0x59ea89[_0xd3b4('0x7a')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x1]?_0x59ea89[_0xd3b4('0x60')][0x1][_0xd3b4('0x66')]:undefined)||null},{'name':_0xd3b4('0x7b'),'value':_0x59ea89[_0xd3b4('0x7b')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x2]?_0x59ea89[_0xd3b4('0x60')][0x2][_0xd3b4('0x66')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x59ea89[_0xd3b4('0x6e')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x3]?_0x59ea89[_0xd3b4('0x60')][0x3][_0xd3b4('0x66')]:undefined)||[]},{'name':_0xd3b4('0x6f'),'value':_0x59ea89['attrChannel']||(_0x59ea89['attrs']&&_0x59ea89[_0xd3b4('0x60')][0x4]?_0x59ea89['attrs'][0x4][_0xd3b4('0x66')]:undefined)||_0xd3b4('0x70')},{'name':_0xd3b4('0x71'),'value':_0x59ea89[_0xd3b4('0x71')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x5]?_0x59ea89[_0xd3b4('0x60')][0x5][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x72'),'value':_0x59ea89[_0xd3b4('0x72')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x6]?_0x59ea89[_0xd3b4('0x60')][0x6][_0xd3b4('0x66')]:undefined)||''},{'name':_0xd3b4('0x73'),'value':_0x59ea89[_0xd3b4('0x73')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x7]?_0x59ea89['attrs'][0x7][_0xd3b4('0x66')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x59ea89['attrOpenchannelAccounts']||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x8]?_0x59ea89[_0xd3b4('0x60')][0x8][_0xd3b4('0x66')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x59ea89['attrWhatsappAccounts']||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x9]?_0x59ea89['attrs'][0x9][_0xd3b4('0x66')]:undefined)||''},{'name':'attrChatWebsites','value':_0x59ea89['attrChatWebsites']||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0xa]?_0x59ea89[_0xd3b4('0x60')][0xa][_0xd3b4('0x66')]:undefined)||''}];case _0xd3b4('0x7c'):return[{'name':_0xd3b4('0x7d'),'type':_0x59ea89['reportType']||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89['attrs'][0x0]?_0x59ea89[_0xd3b4('0x60')][0x0]['type']:undefined)||null,'value':_0x59ea89['attrReport']||(_0x59ea89['attrs']&&_0x59ea89[_0xd3b4('0x60')][0x0]?_0x59ea89[_0xd3b4('0x60')][0x0][_0xd3b4('0x66')]:undefined)||null},{'name':'attrRefresh','value':_0x59ea89[_0xd3b4('0x7e')]||(_0x59ea89[_0xd3b4('0x60')]&&_0x59ea89[_0xd3b4('0x60')][0x1]?_0x59ea89[_0xd3b4('0x60')][0x1][_0xd3b4('0x66')]:undefined)||0x0}];default:return[];}}catch(_0x39c8f9){logger[_0xd3b4('0x33')](_0xd3b4('0x7f'),JSON[_0xd3b4('0x80')](_0x39c8f9));return[];}}exports['addItem']=function(_0x2f28e5,_0x3e8579,_0x511663){if(_0x2f28e5['body']['id']){delete _0x2f28e5['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x2f28e5[_0xd3b4('0x4b')]['id']}})[_0xd3b4('0x2e')](handleEntityNotFound(_0x3e8579,null))[_0xd3b4('0x2e')](function(_0x31c900){if(_0x31c900){_0x2f28e5[_0xd3b4('0x51')][_0xd3b4('0x81')]=_0x31c900['id'];_0x2f28e5[_0xd3b4('0x51')]['attrs']=widgetAttributes(_0x2f28e5[_0xd3b4('0x51')]);return db['DashboardItem']['create'](_0x2f28e5[_0xd3b4('0x51')]);}})['then'](respondWithResult(_0x3e8579,null))['catch'](handleError(_0x3e8579,null));};exports['getItems']=function(_0x1ee2c9,_0x43fb20,_0x47690f){var _0x33b0b9={};var _0x4d665e={};var _0x452089;var _0x2f3a56;return db['Dashboard']['findOne']({'where':{'id':_0x1ee2c9['params']['id']}})[_0xd3b4('0x2e')](handleEntityNotFound(_0x43fb20,null))[_0xd3b4('0x2e')](function(_0x47038d){if(_0x47038d){_0x452089=_0x47038d;_0x4d665e[_0xd3b4('0x3b')]=_[_0xd3b4('0x3d')](db[_0xd3b4('0x82')]['rawAttributes']);_0x4d665e[_0xd3b4('0x3c')]=_[_0xd3b4('0x3d')](_0x1ee2c9[_0xd3b4('0x3c')]);_0x4d665e['filters']=_[_0xd3b4('0x3f')](_0x4d665e[_0xd3b4('0x3b')],_0x4d665e[_0xd3b4('0x3c')]);_0x33b0b9['attributes']=_[_0xd3b4('0x3f')](_0x4d665e[_0xd3b4('0x3b')],qs[_0xd3b4('0x41')](_0x1ee2c9[_0xd3b4('0x3c')]['fields']));_0x33b0b9[_0xd3b4('0x40')]=_0x33b0b9[_0xd3b4('0x40')]['length']?_0x33b0b9['attributes']:_0x4d665e['model'];_0x33b0b9[_0xd3b4('0x83')]=qs['sort'](_0x1ee2c9['query'][_0xd3b4('0x43')]);_0x33b0b9[_0xd3b4('0x46')]=qs[_0xd3b4('0x3e')](_[_0xd3b4('0x44')](_0x1ee2c9[_0xd3b4('0x3c')],_0x4d665e[_0xd3b4('0x3e')]));if(_0x1ee2c9[_0xd3b4('0x3c')][_0xd3b4('0x45')]){_0x33b0b9[_0xd3b4('0x46')]=_['merge'](_0x33b0b9[_0xd3b4('0x46')],{'$or':_[_0xd3b4('0x38')](_0x33b0b9['attributes'],function(_0x8503e8){var _0x1b8840={};_0x1b8840[_0x8503e8]={'$like':'%'+_0x1ee2c9[_0xd3b4('0x3c')][_0xd3b4('0x45')]+'%'};return _0x1b8840;})});}_0x33b0b9=_[_0xd3b4('0x47')]({},_0x33b0b9,_0x1ee2c9[_0xd3b4('0x4e')]);return _0x452089[_0xd3b4('0x84')](_0x33b0b9);}})[_0xd3b4('0x2e')](function(_0x563608){if(_0x563608){_0x2f3a56=_0x563608['length'];if(!_0x1ee2c9['query'][_0xd3b4('0x42')](_0xd3b4('0x85'))){_0x33b0b9['limit']=qs[_0xd3b4('0x25')](_0x1ee2c9[_0xd3b4('0x3c')][_0xd3b4('0x25')]);_0x33b0b9[_0xd3b4('0x27')]=qs[_0xd3b4('0x27')](_0x1ee2c9[_0xd3b4('0x3c')][_0xd3b4('0x27')]);}return _0x452089['getItems'](_0x33b0b9);}})['then'](function(_0x5b58f8){if(_0x5b58f8){return _0x5b58f8?{'count':_0x2f3a56,'rows':_0x5b58f8}:null;}})[_0xd3b4('0x2e')](respondWithResult(_0x43fb20,null))[_0xd3b4('0x4a')](handleError(_0x43fb20,null));}; \ No newline at end of file +var _0x7bc5=['mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','Dashboard','findAll','show','params','keys','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','createdAt','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','DashboardItem','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x4ea135,_0xf2f379){var _0x5ddee4=function(_0x10765e){while(--_0x10765e){_0x4ea135['push'](_0x4ea135['shift']());}};_0x5ddee4(++_0xf2f379);}(_0x7bc5,0x17d));var _0x57bc=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x7bc5[_0x152121];return _0x592a85;};'use strict';var emlformat=require(_0x57bc('0x0'));var rimraf=require(_0x57bc('0x1'));var zipdir=require(_0x57bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57bc('0x3'));var moment=require(_0x57bc('0x4'));var BPromise=require(_0x57bc('0x5'));var Mustache=require(_0x57bc('0x6'));var util=require('util');var path=require(_0x57bc('0x7'));var sox=require('sox');var csv=require(_0x57bc('0x8'));var ejs=require(_0x57bc('0x9'));var fs=require('fs');var fs_extra=require(_0x57bc('0xa'));var _=require('lodash');var squel=require(_0x57bc('0xb'));var crypto=require(_0x57bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x57bc('0xd'));var toCsv=require(_0x57bc('0x8'));var querystring=require('querystring');var Papa=require(_0x57bc('0xe'));var Redis=require('ioredis');var authService=require(_0x57bc('0xf'));var qs=require(_0x57bc('0x10'));var as=require(_0x57bc('0x11'));var hardwareService=require(_0x57bc('0x12'));var logger=require(_0x57bc('0x13'))(_0x57bc('0x14'));var utils=require(_0x57bc('0x15'));var config=require(_0x57bc('0x16'));var licenseUtil=require(_0x57bc('0x17'));var db=require(_0x57bc('0x18'))['db'];config[_0x57bc('0x19')]=_[_0x57bc('0x1a')](config[_0x57bc('0x19')],{'host':_0x57bc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57bc('0x19')]));require(_0x57bc('0x1c'))[_0x57bc('0x1d')](socket);function respondWithStatusCode(_0x29201c,_0xfad42e){_0xfad42e=_0xfad42e||0xcc;return function(_0x2452c0){if(_0x2452c0){return _0x29201c[_0x57bc('0x1e')](_0xfad42e);}return _0x29201c['status'](_0xfad42e)['end']();};}function respondWithResult(_0x4a810b,_0x3e7fa6){_0x3e7fa6=_0x3e7fa6||0xc8;return function(_0xc961ae){if(_0xc961ae){return _0x4a810b[_0x57bc('0x1f')](_0x3e7fa6)[_0x57bc('0x20')](_0xc961ae);}};}function respondWithFilteredResult(_0x4dcb5a,_0x56d788){return function(_0x3cf334){if(_0x3cf334){var _0x39becd=typeof _0x56d788[_0x57bc('0x21')]===_0x57bc('0x22')&&typeof _0x56d788[_0x57bc('0x23')]===_0x57bc('0x22');var _0x16106c=_0x3cf334[_0x57bc('0x24')];var _0x1ad2f2=_0x39becd?0x0:_0x56d788[_0x57bc('0x21')];var _0x425527=_0x39becd?_0x3cf334['count']:_0x56d788['offset']+_0x56d788[_0x57bc('0x23')];var _0x194008;if(_0x425527>=_0x16106c){_0x425527=_0x16106c;_0x194008=0xc8;}else{_0x194008=0xce;}_0x4dcb5a['status'](_0x194008);return _0x4dcb5a[_0x57bc('0x25')](_0x57bc('0x26'),_0x1ad2f2+'-'+_0x425527+'/'+_0x16106c)['json'](_0x3cf334);}return null;};}function patchUpdates(_0x44a520){return function(_0x20c0d6){try{jsonpatch[_0x57bc('0x27')](_0x20c0d6,_0x44a520,!![]);}catch(_0x1e2c09){return BPromise[_0x57bc('0x28')](_0x1e2c09);}return _0x20c0d6[_0x57bc('0x29')]();};}function saveUpdates(_0x1c34ed,_0xef7604){return function(_0x5dacc5){if(_0x5dacc5){return _0x5dacc5[_0x57bc('0x2a')](_0x1c34ed)[_0x57bc('0x2b')](function(_0xe13a23){return _0xe13a23;});}return null;};}function removeEntity(_0xd70672,_0xd20782){return function(_0x531a64){if(_0x531a64){return _0x531a64[_0x57bc('0x2c')]()[_0x57bc('0x2b')](function(){var _0x6fa0e3=_0x531a64[_0x57bc('0x2d')]({'plain':!![]});var _0x2806d3=_0x57bc('0x2e');return db[_0x57bc('0x2f')][_0x57bc('0x2c')]({'where':{'type':_0x2806d3,'resourceId':_0x6fa0e3['id']}})[_0x57bc('0x2b')](function(){return _0x531a64;});})[_0x57bc('0x2b')](function(){_0xd70672['status'](0xcc)[_0x57bc('0x30')]();});}};}function handleEntityNotFound(_0x203aef,_0x2917dc){return function(_0x5d3717){if(!_0x5d3717){_0x203aef[_0x57bc('0x1e')](0x194);}return _0x5d3717;};}function handleError(_0x6ad20f,_0x232826){_0x232826=_0x232826||0x1f4;return function(_0xa457d4){logger[_0x57bc('0x31')](_0xa457d4['stack']);if(_0xa457d4[_0x57bc('0x32')]){delete _0xa457d4[_0x57bc('0x32')];}_0x6ad20f[_0x57bc('0x1f')](_0x232826)[_0x57bc('0x33')](_0xa457d4);};}exports[_0x57bc('0x34')]=function(_0x2ca2a9,_0x588299){var _0x3a606a={},_0x18d565={},_0x240b40={'count':0x0,'rows':[]};var _0x1c0768=_[_0x57bc('0x35')](db['Dashboard'][_0x57bc('0x36')],function(_0xa2e5f6){return{'name':_0xa2e5f6[_0x57bc('0x37')],'type':_0xa2e5f6[_0x57bc('0x38')]['key']};});_0x18d565[_0x57bc('0x39')]=_[_0x57bc('0x35')](_0x1c0768,_0x57bc('0x32'));_0x18d565[_0x57bc('0x3a')]=_['keys'](_0x2ca2a9[_0x57bc('0x3a')]);_0x18d565['filters']=_[_0x57bc('0x3b')](_0x18d565[_0x57bc('0x39')],_0x18d565['query']);_0x3a606a[_0x57bc('0x3c')]=_[_0x57bc('0x3b')](_0x18d565['model'],qs[_0x57bc('0x3d')](_0x2ca2a9[_0x57bc('0x3a')][_0x57bc('0x3d')]));_0x3a606a[_0x57bc('0x3c')]=_0x3a606a[_0x57bc('0x3c')][_0x57bc('0x3e')]?_0x3a606a[_0x57bc('0x3c')]:_0x18d565['model'];if(!_0x2ca2a9[_0x57bc('0x3a')][_0x57bc('0x3f')](_0x57bc('0x40'))){_0x3a606a['limit']=qs[_0x57bc('0x23')](_0x2ca2a9[_0x57bc('0x3a')][_0x57bc('0x23')]);_0x3a606a[_0x57bc('0x21')]=qs[_0x57bc('0x21')](_0x2ca2a9[_0x57bc('0x3a')][_0x57bc('0x21')]);}_0x3a606a[_0x57bc('0x41')]=qs[_0x57bc('0x42')](_0x2ca2a9[_0x57bc('0x3a')]['sort']);_0x3a606a[_0x57bc('0x43')]=qs[_0x57bc('0x44')](_['pick'](_0x2ca2a9[_0x57bc('0x3a')],_0x18d565['filters']),_0x1c0768);if(_0x2ca2a9['query']['filter']){_0x3a606a[_0x57bc('0x43')]=_[_0x57bc('0x45')](_0x3a606a[_0x57bc('0x43')],{'$or':_['map'](_0x1c0768,function(_0x5a707d){if(_0x5a707d[_0x57bc('0x38')]!==_0x57bc('0x46')){var _0x349229={};_0x349229[_0x5a707d['name']]={'$like':'%'+_0x2ca2a9['query'][_0x57bc('0x47')]+'%'};return _0x349229;}})});}_0x3a606a=_['merge']({},_0x3a606a,_0x2ca2a9[_0x57bc('0x48')]);var _0x48986b={'where':_0x3a606a[_0x57bc('0x43')]};return db[_0x57bc('0x49')][_0x57bc('0x24')](_0x48986b)['then'](function(_0x3fa616){_0x240b40[_0x57bc('0x24')]=_0x3fa616;if(_0x2ca2a9[_0x57bc('0x3a')]['includeAll']){_0x3a606a['include']=[{'all':!![]}];}return db['Dashboard'][_0x57bc('0x4a')](_0x3a606a);})[_0x57bc('0x2b')](function(_0x1eec79){_0x240b40['rows']=_0x1eec79;return _0x240b40;})['then'](respondWithFilteredResult(_0x588299,_0x3a606a))['catch'](handleError(_0x588299,null));};exports[_0x57bc('0x4b')]=function(_0x52b1c5,_0x25548){var _0x1e1f28={'raw':![],'where':{'id':_0x52b1c5[_0x57bc('0x4c')]['id']}},_0x23fd9c={};_0x23fd9c[_0x57bc('0x39')]=_[_0x57bc('0x4d')](db['Dashboard'][_0x57bc('0x36')]);_0x23fd9c[_0x57bc('0x3a')]=_['keys'](_0x52b1c5['query']);_0x23fd9c[_0x57bc('0x44')]=_[_0x57bc('0x3b')](_0x23fd9c['model'],_0x23fd9c['query']);_0x1e1f28['attributes']=_[_0x57bc('0x3b')](_0x23fd9c[_0x57bc('0x39')],qs['fields'](_0x52b1c5[_0x57bc('0x3a')][_0x57bc('0x3d')]));_0x1e1f28['attributes']=_0x1e1f28[_0x57bc('0x3c')][_0x57bc('0x3e')]?_0x1e1f28[_0x57bc('0x3c')]:_0x23fd9c[_0x57bc('0x39')];if(_0x52b1c5[_0x57bc('0x3a')][_0x57bc('0x4e')]){_0x1e1f28[_0x57bc('0x4f')]=[{'all':!![]}];}_0x1e1f28=_[_0x57bc('0x45')]({},_0x1e1f28,_0x52b1c5[_0x57bc('0x48')]);return db['Dashboard'][_0x57bc('0x50')](_0x1e1f28)[_0x57bc('0x2b')](handleEntityNotFound(_0x25548,null))[_0x57bc('0x2b')](respondWithResult(_0x25548,null))[_0x57bc('0x51')](handleError(_0x25548,null));};exports[_0x57bc('0x52')]=function(_0x49478e,_0x178c41){return db[_0x57bc('0x49')][_0x57bc('0x52')](_0x49478e['body'],{})[_0x57bc('0x2b')](function(_0x5113df){var _0x5ae2f9=_0x49478e['user'][_0x57bc('0x2d')]({'plain':!![]});if(!_0x5ae2f9)throw new Error(_0x57bc('0x53'));if(_0x5ae2f9[_0x57bc('0x54')]===_0x57bc('0x55')){var _0x499fa7=_0x5113df[_0x57bc('0x2d')]({'plain':!![]});var _0x23eff8='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x23eff8,'userProfileId':_0x5ae2f9[_0x57bc('0x56')]},'raw':!![]})[_0x57bc('0x2b')](function(_0x51362c){if(_0x51362c&&_0x51362c[_0x57bc('0x57')]===0x0){return db[_0x57bc('0x2f')][_0x57bc('0x52')]({'name':_0x499fa7[_0x57bc('0x32')],'resourceId':_0x499fa7['id'],'type':_0x51362c[_0x57bc('0x32')],'sectionId':_0x51362c['id']},{})[_0x57bc('0x2b')](function(){return _0x5113df;});}else{return _0x5113df;}})[_0x57bc('0x51')](function(_0x9b09f9){logger[_0x57bc('0x31')](_0x57bc('0x58'),_0x9b09f9);throw _0x9b09f9;});}return _0x5113df;})[_0x57bc('0x2b')](respondWithResult(_0x178c41,0xc9))[_0x57bc('0x51')](handleError(_0x178c41,null));};exports['clone']=function(_0x510da9,_0x2bd695){var _0x2e643b={'where':{'id':_0x510da9[_0x57bc('0x4c')]['id']}},_0x309895={};_0x309895[_0x57bc('0x39')]=_[_0x57bc('0x4d')](db[_0x57bc('0x49')][_0x57bc('0x36')]);_0x2e643b[_0x57bc('0x3c')]=_['intersection'](_0x309895['model'],qs[_0x57bc('0x3d')](_0x510da9['query'][_0x57bc('0x3d')]));_0x2e643b['attributes']=_0x2e643b['attributes'][_0x57bc('0x3e')]?_0x2e643b[_0x57bc('0x3c')]:_0x309895[_0x57bc('0x39')];if(_0x510da9['query'][_0x57bc('0x4e')]){_0x2e643b[_0x57bc('0x4f')]=[{'all':!![]}];}_0x2e643b=_[_0x57bc('0x45')]({},_0x2e643b,_0x510da9[_0x57bc('0x48')]);return db[_0x57bc('0x49')][_0x57bc('0x50')](_0x2e643b)[_0x57bc('0x2b')](handleEntityNotFound(_0x2bd695,null))[_0x57bc('0x2b')](function(_0x36bbe0){if(_0x36bbe0){var _0x3e512a=_0x36bbe0[_0x57bc('0x2d')]({'plain':!![]});_0x3e512a=qs[_0x57bc('0x59')](_0x3e512a,['id','createdAt',_0x57bc('0x5a')]);_0x510da9['body']=_[_0x57bc('0x59')](_0x510da9[_0x57bc('0x5b')],['id',_0x57bc('0x5c'),_0x57bc('0x5a')]);return db[_0x57bc('0x49')]['create'](_[_0x57bc('0x45')](_0x3e512a,_0x510da9['body']),{'include':_0x510da9[_0x57bc('0x3a')][_0x57bc('0x4e')]?[{'all':!![]}]:undefined})[_0x57bc('0x2b')](function(_0x1690ce){var _0x2c5328=_0x510da9[_0x57bc('0x55')]['get']({'plain':!![]});if(!_0x2c5328)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c5328[_0x57bc('0x54')]==='user'){var _0x5e5f86=_0x1690ce[_0x57bc('0x2d')]({'plain':!![]});var _0x59ffbb='CustomDashboards';return db['UserProfileSection'][_0x57bc('0x50')]({'where':{'name':_0x59ffbb,'userProfileId':_0x2c5328[_0x57bc('0x56')]},'raw':!![]})[_0x57bc('0x2b')](function(_0xc3bc32){if(_0xc3bc32&&_0xc3bc32[_0x57bc('0x57')]===0x0){return db[_0x57bc('0x2f')][_0x57bc('0x52')]({'name':_0x5e5f86[_0x57bc('0x32')],'resourceId':_0x5e5f86['id'],'type':_0xc3bc32[_0x57bc('0x32')],'sectionId':_0xc3bc32['id']},{})[_0x57bc('0x2b')](function(){return _0x1690ce;});}else{return _0x1690ce;}})[_0x57bc('0x51')](function(_0x1f7515){logger['error'](_0x57bc('0x58'),_0x1f7515);throw _0x1f7515;});}return _0x1690ce;});}})[_0x57bc('0x2b')](respondWithResult(_0x2bd695,0xc9))['catch'](handleError(_0x2bd695,null));};exports[_0x57bc('0x2a')]=function(_0x18337d,_0x1086de){if(_0x18337d[_0x57bc('0x5b')]['id']){delete _0x18337d[_0x57bc('0x5b')]['id'];}return db[_0x57bc('0x49')]['find']({'where':{'id':_0x18337d[_0x57bc('0x4c')]['id']}})[_0x57bc('0x2b')](handleEntityNotFound(_0x1086de,null))[_0x57bc('0x2b')](saveUpdates(_0x18337d['body'],null))[_0x57bc('0x2b')](respondWithResult(_0x1086de,null))[_0x57bc('0x51')](handleError(_0x1086de,null));};exports[_0x57bc('0x2c')]=function(_0x2cd509,_0x25c465){return db['Dashboard'][_0x57bc('0x50')]({'where':{'id':_0x2cd509[_0x57bc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25c465,null))[_0x57bc('0x2b')](removeEntity(_0x25c465,null))[_0x57bc('0x51')](handleError(_0x25c465,null));};function widgetAttributes(_0x2c03a4){try{switch(_0x2c03a4[_0x57bc('0x38')]){case _0x57bc('0x5d'):return[{'name':_0x57bc('0x5e'),'value':_0x2c03a4[_0x57bc('0x5e')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4['attrs'][0x0]?_0x2c03a4[_0x57bc('0x5f')][0x0][_0x57bc('0x60')]:undefined)||_0x57bc('0x61')}];case'custom':return[{'name':_0x57bc('0x62'),'value':_0x2c03a4[_0x57bc('0x62')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x0]?_0x2c03a4[_0x57bc('0x5f')][0x0]['value']:undefined)||''}];case _0x57bc('0x63'):return[{'name':_0x57bc('0x64'),'value':_0x2c03a4[_0x57bc('0x64')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x0]?_0x2c03a4[_0x57bc('0x5f')][0x0][_0x57bc('0x60')]:undefined)||_0x57bc('0x65')},{'name':_0x57bc('0x66'),'value':_0x2c03a4[_0x57bc('0x66')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x1]?_0x2c03a4[_0x57bc('0x5f')][0x1][_0x57bc('0x60')]:undefined)||_0x57bc('0x67')},{'name':_0x57bc('0x68'),'value':_0x2c03a4['attrFontSize']||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x2]?_0x2c03a4[_0x57bc('0x5f')][0x2][_0x57bc('0x60')]:undefined)||0xc}];case'counter':return[{'name':_0x57bc('0x69'),'value':_0x2c03a4[_0x57bc('0x69')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x0]?_0x2c03a4[_0x57bc('0x5f')][0x0][_0x57bc('0x60')]:undefined)||_0x57bc('0x6a')},{'name':_0x57bc('0x6b'),'value':_0x2c03a4[_0x57bc('0x6b')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x1]?_0x2c03a4[_0x57bc('0x5f')][0x1][_0x57bc('0x60')]:undefined)||[]},{'name':_0x57bc('0x68'),'value':_0x2c03a4[_0x57bc('0x68')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4['attrs'][0x2]?_0x2c03a4[_0x57bc('0x5f')][0x2][_0x57bc('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0x2c03a4['attrChannel']||(_0x2c03a4['attrs']&&_0x2c03a4['attrs'][0x3]?_0x2c03a4[_0x57bc('0x5f')][0x3][_0x57bc('0x60')]:undefined)||_0x57bc('0x6c')},{'name':'attrEmailAccounts','value':_0x2c03a4[_0x57bc('0x6d')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x4]?_0x2c03a4[_0x57bc('0x5f')][0x4][_0x57bc('0x60')]:undefined)||''},{'name':_0x57bc('0x6e'),'value':_0x2c03a4[_0x57bc('0x6e')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x5]?_0x2c03a4['attrs'][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2c03a4[_0x57bc('0x6f')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x6]?_0x2c03a4[_0x57bc('0x5f')][0x6][_0x57bc('0x60')]:undefined)||''},{'name':_0x57bc('0x70'),'value':_0x2c03a4[_0x57bc('0x70')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x7]?_0x2c03a4['attrs'][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2c03a4[_0x57bc('0x71')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x8]?_0x2c03a4[_0x57bc('0x5f')][0x8][_0x57bc('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c03a4[_0x57bc('0x72')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x9]?_0x2c03a4['attrs'][0x9][_0x57bc('0x60')]:undefined)||''}];case _0x57bc('0x73'):case _0x57bc('0x74'):return[{'name':_0x57bc('0x75'),'value':_0x2c03a4[_0x57bc('0x75')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x0]?_0x2c03a4[_0x57bc('0x5f')][0x0]['value']:undefined)||'total'},{'name':_0x57bc('0x76'),'value':_0x2c03a4[_0x57bc('0x76')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x1]?_0x2c03a4['attrs'][0x1]['value']:undefined)||null},{'name':_0x57bc('0x77'),'value':_0x2c03a4[_0x57bc('0x77')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x2]?_0x2c03a4[_0x57bc('0x5f')][0x2][_0x57bc('0x60')]:undefined)||null},{'name':_0x57bc('0x6b'),'value':_0x2c03a4['attrVoiceQueues']||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x3]?_0x2c03a4[_0x57bc('0x5f')][0x3][_0x57bc('0x60')]:undefined)||[]},{'name':_0x57bc('0x78'),'value':_0x2c03a4[_0x57bc('0x78')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x4]?_0x2c03a4[_0x57bc('0x5f')][0x4]['value']:undefined)||_0x57bc('0x6c')},{'name':_0x57bc('0x6d'),'value':_0x2c03a4['attrEmailAccounts']||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x5]?_0x2c03a4[_0x57bc('0x5f')][0x5][_0x57bc('0x60')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2c03a4[_0x57bc('0x6e')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4['attrs'][0x6]?_0x2c03a4['attrs'][0x6][_0x57bc('0x60')]:undefined)||''},{'name':_0x57bc('0x6f'),'value':_0x2c03a4[_0x57bc('0x6f')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4['attrs'][0x7]?_0x2c03a4[_0x57bc('0x5f')][0x7][_0x57bc('0x60')]:undefined)||''},{'name':_0x57bc('0x70'),'value':_0x2c03a4[_0x57bc('0x70')]||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0x8]?_0x2c03a4[_0x57bc('0x5f')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2c03a4[_0x57bc('0x71')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4['attrs'][0x9]?_0x2c03a4[_0x57bc('0x5f')][0x9][_0x57bc('0x60')]:undefined)||''},{'name':_0x57bc('0x72'),'value':_0x2c03a4['attrChatWebsites']||(_0x2c03a4['attrs']&&_0x2c03a4[_0x57bc('0x5f')][0xa]?_0x2c03a4[_0x57bc('0x5f')][0xa][_0x57bc('0x60')]:undefined)||''}];case'web-report':return[{'name':_0x57bc('0x79'),'type':_0x2c03a4['reportType']||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x0]?_0x2c03a4['attrs'][0x0][_0x57bc('0x38')]:undefined)||null,'value':_0x2c03a4['attrReport']||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x0]?_0x2c03a4[_0x57bc('0x5f')][0x0][_0x57bc('0x60')]:undefined)||null},{'name':_0x57bc('0x7a'),'value':_0x2c03a4[_0x57bc('0x7a')]||(_0x2c03a4[_0x57bc('0x5f')]&&_0x2c03a4[_0x57bc('0x5f')][0x1]?_0x2c03a4[_0x57bc('0x5f')][0x1][_0x57bc('0x60')]:undefined)||0x0}];default:return[];}}catch(_0xda72a7){logger[_0x57bc('0x31')](_0x57bc('0x7b'),JSON[_0x57bc('0x7c')](_0xda72a7));return[];}}exports['addItem']=function(_0x568e04,_0x1831b0,_0x1b5f39){if(_0x568e04[_0x57bc('0x5b')]['id']){delete _0x568e04[_0x57bc('0x5b')]['id'];}return db[_0x57bc('0x49')][_0x57bc('0x50')]({'where':{'id':_0x568e04[_0x57bc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1831b0,null))['then'](function(_0x381a32){if(_0x381a32){_0x568e04['body'][_0x57bc('0x7d')]=_0x381a32['id'];_0x568e04[_0x57bc('0x5b')][_0x57bc('0x5f')]=widgetAttributes(_0x568e04['body']);return db['DashboardItem'][_0x57bc('0x52')](_0x568e04['body']);}})[_0x57bc('0x2b')](respondWithResult(_0x1831b0,null))['catch'](handleError(_0x1831b0,null));};exports[_0x57bc('0x7e')]=function(_0x40dbb8,_0x14a29d,_0x531453){var _0x4df998={};var _0x2bb8ae={};var _0x98ffac;var _0x32863f;return db[_0x57bc('0x49')]['findOne']({'where':{'id':_0x40dbb8[_0x57bc('0x4c')]['id']}})[_0x57bc('0x2b')](handleEntityNotFound(_0x14a29d,null))[_0x57bc('0x2b')](function(_0x36374e){if(_0x36374e){_0x98ffac=_0x36374e;_0x2bb8ae['model']=_[_0x57bc('0x4d')](db[_0x57bc('0x7f')][_0x57bc('0x36')]);_0x2bb8ae['query']=_[_0x57bc('0x4d')](_0x40dbb8[_0x57bc('0x3a')]);_0x2bb8ae[_0x57bc('0x44')]=_[_0x57bc('0x3b')](_0x2bb8ae['model'],_0x2bb8ae[_0x57bc('0x3a')]);_0x4df998['attributes']=_[_0x57bc('0x3b')](_0x2bb8ae['model'],qs[_0x57bc('0x3d')](_0x40dbb8[_0x57bc('0x3a')][_0x57bc('0x3d')]));_0x4df998[_0x57bc('0x3c')]=_0x4df998[_0x57bc('0x3c')][_0x57bc('0x3e')]?_0x4df998[_0x57bc('0x3c')]:_0x2bb8ae[_0x57bc('0x39')];_0x4df998[_0x57bc('0x41')]=qs['sort'](_0x40dbb8['query'][_0x57bc('0x42')]);_0x4df998[_0x57bc('0x43')]=qs['filters'](_[_0x57bc('0x80')](_0x40dbb8['query'],_0x2bb8ae[_0x57bc('0x44')]));if(_0x40dbb8['query'][_0x57bc('0x47')]){_0x4df998[_0x57bc('0x43')]=_[_0x57bc('0x45')](_0x4df998[_0x57bc('0x43')],{'$or':_[_0x57bc('0x35')](_0x4df998[_0x57bc('0x3c')],function(_0x1588b7){var _0x813d7f={};_0x813d7f[_0x1588b7]={'$like':'%'+_0x40dbb8[_0x57bc('0x3a')][_0x57bc('0x47')]+'%'};return _0x813d7f;})});}_0x4df998=_[_0x57bc('0x45')]({},_0x4df998,_0x40dbb8['options']);return _0x98ffac['getItems'](_0x4df998);}})[_0x57bc('0x2b')](function(_0x1addbc){if(_0x1addbc){_0x32863f=_0x1addbc[_0x57bc('0x3e')];if(!_0x40dbb8[_0x57bc('0x3a')][_0x57bc('0x3f')](_0x57bc('0x40'))){_0x4df998['limit']=qs[_0x57bc('0x23')](_0x40dbb8[_0x57bc('0x3a')][_0x57bc('0x23')]);_0x4df998['offset']=qs[_0x57bc('0x21')](_0x40dbb8['query'][_0x57bc('0x21')]);}return _0x98ffac['getItems'](_0x4df998);}})[_0x57bc('0x2b')](function(_0x3e6633){if(_0x3e6633){return _0x3e6633?{'count':_0x32863f,'rows':_0x3e6633}:null;}})[_0x57bc('0x2b')](respondWithResult(_0x14a29d,null))[_0x57bc('0x51')](handleError(_0x14a29d,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1a3819e..7edb627 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 _0xcd10=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcd10,0x16d));var _0x0cd1=function(_0x2ba57c,_0xdc785e){_0x2ba57c=_0x2ba57c-0x0;var _0x597045=_0xcd10[_0x2ba57c];return _0x597045;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x0cd1('0x0'))['db'][_0x0cd1('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0cd1('0x2')](0x0);var events={'afterCreate':_0x0cd1('0x3'),'afterUpdate':_0x0cd1('0x4'),'afterDestroy':_0x0cd1('0x5')};function emitEvent(_0x2fbabd){return function(_0xac6cf8,_0x1e09b6,_0x575f62){DashboardEvents[_0x0cd1('0x6')](_0x2fbabd+':'+_0xac6cf8['id'],_0xac6cf8);DashboardEvents[_0x0cd1('0x6')](_0x2fbabd,_0xac6cf8);_0x575f62(null);};}for(var e in events){if(events[_0x0cd1('0x7')](e)){var event=events[e];Dashboard[_0x0cd1('0x8')](e,emitEvent(event));}}module[_0x0cd1('0x9')]=DashboardEvents; \ No newline at end of file +var _0xa699=['setMaxListeners','save','update','remove','emit','../../mysqldb','Dashboard'];(function(_0x1670d5,_0x335c9c){var _0x151edc=function(_0x289b84){while(--_0x289b84){_0x1670d5['push'](_0x1670d5['shift']());}};_0x151edc(++_0x335c9c);}(_0xa699,0x132));var _0x9a69=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xa699[_0x122e9b];return _0x22c247;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x9a69('0x0'))['db'][_0x9a69('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9a69('0x2')](0x0);var events={'afterCreate':_0x9a69('0x3'),'afterUpdate':_0x9a69('0x4'),'afterDestroy':_0x9a69('0x5')};function emitEvent(_0x4cda3e){return function(_0x8b45a3,_0x8faacd,_0x17440b){DashboardEvents[_0x9a69('0x6')](_0x4cda3e+':'+_0x8b45a3['id'],_0x8b45a3);DashboardEvents[_0x9a69('0x6')](_0x4cda3e,_0x8b45a3);_0x17440b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index a61f988..f4293fa 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 _0x1e44=['moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util','../../config/logger','api'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1e44,0x1a9));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e4('0x0'));var util=require(_0x41e4('0x1'));var logger=require(_0x41e4('0x2'))(_0x41e4('0x3'));var moment=require(_0x41e4('0x4'));var BPromise=require(_0x41e4('0x5'));var rp=require(_0x41e4('0x6'));var fs=require('fs');var path=require(_0x41e4('0x7'));var rimraf=require('rimraf');var config=require(_0x41e4('0x8'));var attributes=require(_0x41e4('0x9'));module[_0x41e4('0xa')]=function(_0x4f0c86,_0xf44512){return _0x4f0c86[_0x41e4('0xb')](_0x41e4('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ee5=['./dashboard.attributes','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4ee5,0x1dc));var _0x54ee=function(_0x3bfb5d,_0x47293e){_0x3bfb5d=_0x3bfb5d-0x0;var _0x14fd84=_0x4ee5[_0x3bfb5d];return _0x14fd84;};'use strict';var _=require(_0x54ee('0x0'));var util=require('util');var logger=require(_0x54ee('0x1'))(_0x54ee('0x2'));var moment=require(_0x54ee('0x3'));var BPromise=require(_0x54ee('0x4'));var rp=require(_0x54ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54ee('0x6'));var config=require(_0x54ee('0x7'));var attributes=require(_0x54ee('0x8'));module['exports']=function(_0x59a282,_0x200892){return _0x59a282['define'](_0x54ee('0x9'),attributes,{'tableName':_0x54ee('0xa'),'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 dff750d..e049e5e 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 _0x7162=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x59e4d8,_0x11cfee){var _0x13c00e=function(_0x494060){while(--_0x494060){_0x59e4d8['push'](_0x59e4d8['shift']());}};_0x13c00e(++_0x11cfee);}(_0x7162,0xbb));var _0x2716=function(_0x2e81b4,_0x193298){_0x2e81b4=_0x2e81b4-0x0;var _0x2bdb73=_0x7162[_0x2e81b4];return _0x2bdb73;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2716('0x0'));var BPromise=require(_0x2716('0x1'));var rs=require(_0x2716('0x2'));var fs=require('fs');var Redis=require(_0x2716('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2716('0x4'));var logger=require(_0x2716('0x5'))(_0x2716('0x6'));var config=require(_0x2716('0x7'));var jayson=require(_0x2716('0x8'));var client=jayson[_0x2716('0x9')][_0x2716('0xa')]({'port':0x232a});config[_0x2716('0xb')]=_[_0x2716('0xc')](config[_0x2716('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2716('0xd'))(new Redis(config[_0x2716('0xb')]));require(_0x2716('0xe'))[_0x2716('0xf')](socket);function respondWithRpcPromise(_0x349c50,_0x1b44c4,_0x50621f){return new BPromise(function(_0x38fd64,_0x2e6444){return client[_0x2716('0x10')](_0x349c50,_0x50621f)[_0x2716('0x11')](function(_0x36c8f5){logger[_0x2716('0x12')](_0x2716('0x13'),_0x1b44c4,'request\x20sent');logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1b44c4,_0x2716('0x14'),JSON[_0x2716('0x15')](_0x36c8f5));if(_0x36c8f5['error']){if(_0x36c8f5[_0x2716('0x16')][_0x2716('0x17')]===0x1f4){logger[_0x2716('0x16')](_0x2716('0x13'),_0x1b44c4,_0x36c8f5[_0x2716('0x16')][_0x2716('0x18')]);return _0x2e6444(_0x36c8f5[_0x2716('0x16')][_0x2716('0x18')]);}logger[_0x2716('0x16')](_0x2716('0x13'),_0x1b44c4,_0x36c8f5[_0x2716('0x16')]['message']);return _0x38fd64(_0x36c8f5[_0x2716('0x16')][_0x2716('0x18')]);}else{logger[_0x2716('0x12')](_0x2716('0x13'),_0x1b44c4,_0x2716('0x14'));_0x38fd64(_0x36c8f5['result']['message']);}})[_0x2716('0x19')](function(_0x1b4a8e){logger[_0x2716('0x16')](_0x2716('0x13'),_0x1b44c4,_0x1b4a8e);_0x2e6444(_0x1b4a8e);});});} \ No newline at end of file +var _0x6a96=['./dashboard.socket','register','request','then','info','debug','error','code','Dashboard,\x20%s,\x20%s','message','request\x20sent','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x2a11be,_0x4fe6fe){var _0x16b4d6=function(_0x31cd5f){while(--_0x31cd5f){_0x2a11be['push'](_0x2a11be['shift']());}};_0x16b4d6(++_0x4fe6fe);}(_0x6a96,0x12a));var _0x66a9=function(_0x5875ad,_0x3597b8){_0x5875ad=_0x5875ad-0x0;var _0x32a922=_0x6a96[_0x5875ad];return _0x32a922;};'use strict';var _=require(_0x66a9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x66a9('0x1'));var rs=require(_0x66a9('0x2'));var fs=require('fs');var Redis=require(_0x66a9('0x3'));var db=require(_0x66a9('0x4'))['db'];var utils=require(_0x66a9('0x5'));var logger=require(_0x66a9('0x6'))(_0x66a9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x66a9('0x8')][_0x66a9('0x9')]({'port':0x232a});config[_0x66a9('0xa')]=_[_0x66a9('0xb')](config['redis'],{'host':_0x66a9('0xc'),'port':0x18eb});var socket=require(_0x66a9('0xd'))(new Redis(config[_0x66a9('0xa')]));require(_0x66a9('0xe'))[_0x66a9('0xf')](socket);function respondWithRpcPromise(_0x1b7b95,_0x5c6c40,_0x17be5b){return new BPromise(function(_0x50861f,_0x123ab0){return client[_0x66a9('0x10')](_0x1b7b95,_0x17be5b)[_0x66a9('0x11')](function(_0x534b06){logger[_0x66a9('0x12')]('Dashboard,\x20%s,\x20%s',_0x5c6c40,'request\x20sent');logger[_0x66a9('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5c6c40,'request\x20sent',JSON['stringify'](_0x534b06));if(_0x534b06[_0x66a9('0x14')]){if(_0x534b06[_0x66a9('0x14')][_0x66a9('0x15')]===0x1f4){logger[_0x66a9('0x14')](_0x66a9('0x16'),_0x5c6c40,_0x534b06[_0x66a9('0x14')][_0x66a9('0x17')]);return _0x123ab0(_0x534b06[_0x66a9('0x14')][_0x66a9('0x17')]);}logger['error'](_0x66a9('0x16'),_0x5c6c40,_0x534b06[_0x66a9('0x14')][_0x66a9('0x17')]);return _0x50861f(_0x534b06['error'][_0x66a9('0x17')]);}else{logger[_0x66a9('0x12')](_0x66a9('0x16'),_0x5c6c40,_0x66a9('0x18'));_0x50861f(_0x534b06[_0x66a9('0x19')][_0x66a9('0x17')]);}})['catch'](function(_0x544a66){logger['error'](_0x66a9('0x16'),_0x5c6c40,_0x544a66);_0x123ab0(_0x544a66);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3f2e162..17dec23 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 _0x64e7=['update','emit','removeListener','length','dashboard:','./dashboard.events','remove'];(function(_0x2d0026,_0x5df46a){var _0x59187b=function(_0x36ab41){while(--_0x36ab41){_0x2d0026['push'](_0x2d0026['shift']());}};_0x59187b(++_0x5df46a);}(_0x64e7,0x98));var _0x764e=function(_0x3dc327,_0x153312){_0x3dc327=_0x3dc327-0x0;var _0x46b560=_0x64e7[_0x3dc327];return _0x46b560;};'use strict';var DashboardEvents=require(_0x764e('0x0'));var events=['save',_0x764e('0x1'),_0x764e('0x2')];function createListener(_0x541ba1,_0x1106da){return function(_0x491d9e){_0x1106da[_0x764e('0x3')](_0x541ba1,_0x491d9e);};}function removeListener(_0xd42ffb,_0x1f46ea){return function(){DashboardEvents[_0x764e('0x4')](_0xd42ffb,_0x1f46ea);};}exports['register']=function(_0x3c6a37){for(var _0x28af7f=0x0,_0x20f01a=events[_0x764e('0x5')];_0x28af7f<_0x20f01a;_0x28af7f++){var _0x296fde=events[_0x28af7f];var _0x5d043a=createListener(_0x764e('0x6')+_0x296fde,_0x3c6a37);DashboardEvents['on'](_0x296fde,_0x5d043a);}}; \ No newline at end of file +var _0x35a5=['./dashboard.events','update','emit','removeListener','register','length','dashboard:'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0x35a5,0x1c0));var _0x535a=function(_0x2a01b4,_0x21c5b1){_0x2a01b4=_0x2a01b4-0x0;var _0x5c2e9c=_0x35a5[_0x2a01b4];return _0x5c2e9c;};'use strict';var DashboardEvents=require(_0x535a('0x0'));var events=['save','remove',_0x535a('0x1')];function createListener(_0x490e33,_0x13133c){return function(_0xa634d2){_0x13133c[_0x535a('0x2')](_0x490e33,_0xa634d2);};}function removeListener(_0xe6464c,_0x1bcc6c){return function(){DashboardEvents[_0x535a('0x3')](_0xe6464c,_0x1bcc6c);};}exports[_0x535a('0x4')]=function(_0x131961){for(var _0x2f43e1=0x0,_0x1a84c4=events[_0x535a('0x5')];_0x2f43e1<_0x1a84c4;_0x2f43e1++){var _0x2082e6=events[_0x2f43e1];var _0x26afde=createListener(_0x535a('0x6')+_0x2082e6,_0x131961);DashboardEvents['on'](_0x2082e6,_0x26afde);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1fac15e..bf76630 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 _0x2d20=['/:id/items','post','/:id/clone','clone','addItem','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x28d6d8,_0x1d3a0f){var _0x2ca195=function(_0x2b8b35){while(--_0x2b8b35){_0x28d6d8['push'](_0x28d6d8['shift']());}};_0x2ca195(++_0x1d3a0f);}(_0x2d20,0x105));var _0x02d2=function(_0x31bb33,_0x11df38){_0x31bb33=_0x31bb33-0x0;var _0x4eae64=_0x2d20[_0x31bb33];return _0x4eae64;};'use strict';var multer=require(_0x02d2('0x0'));var util=require(_0x02d2('0x1'));var path=require(_0x02d2('0x2'));var timeout=require(_0x02d2('0x3'));var express=require(_0x02d2('0x4'));var router=express[_0x02d2('0x5')]();var fs_extra=require(_0x02d2('0x6'));var auth=require(_0x02d2('0x7'));var interaction=require(_0x02d2('0x8'));var config=require(_0x02d2('0x9'));var controller=require(_0x02d2('0xa'));router[_0x02d2('0xb')]('/',auth[_0x02d2('0xc')](),controller[_0x02d2('0xd')]);router[_0x02d2('0xb')](_0x02d2('0xe'),auth[_0x02d2('0xc')](),controller['show']);router['get'](_0x02d2('0xf'),auth[_0x02d2('0xc')](),controller['getItems']);router[_0x02d2('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x02d2('0x10')](_0x02d2('0x11'),auth[_0x02d2('0xc')](),controller[_0x02d2('0x12')]);router[_0x02d2('0x10')](_0x02d2('0xf'),auth[_0x02d2('0xc')](),controller[_0x02d2('0x13')]);router[_0x02d2('0x14')](_0x02d2('0xe'),auth[_0x02d2('0xc')](),controller['update']);router['delete'](_0x02d2('0xe'),auth[_0x02d2('0xc')](),controller[_0x02d2('0x15')]);module[_0x02d2('0x16')]=router; \ No newline at end of file +var _0x0f53=['isAuthenticated','index','get','/:id','/:id/items','getItems','post','/:id/clone','addItem','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0f53,0xf4));var _0x30f5=function(_0x22a18c,_0x1ddc4c){_0x22a18c=_0x22a18c-0x0;var _0x146773=_0x0f53[_0x22a18c];return _0x146773;};'use strict';var multer=require(_0x30f5('0x0'));var util=require(_0x30f5('0x1'));var path=require(_0x30f5('0x2'));var timeout=require(_0x30f5('0x3'));var express=require(_0x30f5('0x4'));var router=express[_0x30f5('0x5')]();var fs_extra=require(_0x30f5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x30f5('0x7'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router['get']('/',auth[_0x30f5('0x8')](),controller[_0x30f5('0x9')]);router[_0x30f5('0xa')](_0x30f5('0xb'),auth[_0x30f5('0x8')](),controller['show']);router[_0x30f5('0xa')](_0x30f5('0xc'),auth[_0x30f5('0x8')](),controller[_0x30f5('0xd')]);router[_0x30f5('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x30f5('0xe')](_0x30f5('0xf'),auth[_0x30f5('0x8')](),controller['clone']);router[_0x30f5('0xe')](_0x30f5('0xc'),auth['isAuthenticated'](),controller[_0x30f5('0x10')]);router[_0x30f5('0x11')]('/:id',auth[_0x30f5('0x8')](),controller[_0x30f5('0x12')]);router[_0x30f5('0x13')](_0x30f5('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x30f5('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5a3fe5b..885802d 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 _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x59fd02,_0x4cb9de){var _0x1e7aa5=function(_0x14acec){while(--_0x14acec){_0x59fd02['push'](_0x59fd02['shift']());}};_0x1e7aa5(++_0x4cb9de);}(_0x814b,0x1a2));var _0xb814=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x814b[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0xf61e=['TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x3254cf,_0xf77ee2){var _0x37b354=function(_0x509bcb){while(--_0x509bcb){_0x3254cf['push'](_0x3254cf['shift']());}};_0x37b354(++_0xf77ee2);}(_0xf61e,0x191));var _0xef61=function(_0x33ea3d,_0x310532){_0x33ea3d=_0x33ea3d-0x0;var _0x3aa298=_0xf61e[_0x33ea3d];return _0x3aa298;};'use strict';var Sequelize=require(_0xef61('0x0'));var squel=require(_0xef61('0x1'));var _=require(_0xef61('0x2'));module[_0xef61('0x3')]={'title':{'type':Sequelize[_0xef61('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xef61('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xef61('0x5')](_0xef61('0x6')),'get':function(){try{return JSON[_0xef61('0x7')](this[_0xef61('0x8')](_0xef61('0x9')));}catch(_0x45a18d){return[];}},'set':function(_0x5b00b2){try{this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify'](_0x5b00b2));}catch(_0x2242a7){this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xef61('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xef61('0xb')]},'col':{'type':Sequelize[_0xef61('0xb')]},'background':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xef61('0x4')]},'titleFontSize':{'type':Sequelize[_0xef61('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 548bd7f..a33f35d 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 _0x0a6b=['attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','eml-format','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','then','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts'];(function(_0x4a41e9,_0x116742){var _0x17d55d=function(_0xad8f06){while(--_0xad8f06){_0x4a41e9['push'](_0x4a41e9['shift']());}};_0x17d55d(++_0x116742);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x3b9790,_0xfbcf4b){_0x3b9790=_0x3b9790-0x0;var _0x50a671=_0x0a6b[_0x3b9790];return _0x50a671;};'use strict';var emlformat=require(_0xb0a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb0a6('0x1'));var moment=require('moment');var BPromise=require(_0xb0a6('0x2'));var Mustache=require(_0xb0a6('0x3'));var util=require(_0xb0a6('0x4'));var path=require('path');var sox=require(_0xb0a6('0x5'));var csv=require('to-csv');var ejs=require(_0xb0a6('0x6'));var fs=require('fs');var fs_extra=require(_0xb0a6('0x7'));var _=require('lodash');var squel=require(_0xb0a6('0x8'));var crypto=require(_0xb0a6('0x9'));var jsforce=require(_0xb0a6('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb0a6('0xb'));var Redis=require(_0xb0a6('0xc'));var authService=require(_0xb0a6('0xd'));var qs=require(_0xb0a6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0a6('0xf'));var logger=require(_0xb0a6('0x10'))('api');var utils=require(_0xb0a6('0x11'));var config=require(_0xb0a6('0x12'));var licenseUtil=require(_0xb0a6('0x13'));var db=require(_0xb0a6('0x14'))['db'];config[_0xb0a6('0x15')]=_[_0xb0a6('0x16')](config[_0xb0a6('0x15')],{'host':_0xb0a6('0x17'),'port':0x18eb});var socket=require(_0xb0a6('0x18'))(new Redis(config[_0xb0a6('0x15')]));require('./dashboardItem.socket')[_0xb0a6('0x19')](socket);function respondWithStatusCode(_0x54016c,_0x397c36){_0x397c36=_0x397c36||0xcc;return function(_0x5351ed){if(_0x5351ed){return _0x54016c[_0xb0a6('0x1a')](_0x397c36);}return _0x54016c['status'](_0x397c36)[_0xb0a6('0x1b')]();};}function respondWithResult(_0x382c2f,_0x93243e){_0x93243e=_0x93243e||0xc8;return function(_0x5673ad){if(_0x5673ad){return _0x382c2f['status'](_0x93243e)[_0xb0a6('0x1c')](_0x5673ad);}};}function respondWithFilteredResult(_0x295b53,_0x59bc9c){return function(_0x18f994){if(_0x18f994){var _0x10f504=typeof _0x59bc9c[_0xb0a6('0x1d')]==='undefined'&&typeof _0x59bc9c[_0xb0a6('0x1e')]===_0xb0a6('0x1f');var _0x372457=_0x18f994[_0xb0a6('0x20')];var _0x4406d0=_0x10f504?0x0:_0x59bc9c[_0xb0a6('0x1d')];var _0x4c111f=_0x10f504?_0x18f994[_0xb0a6('0x20')]:_0x59bc9c[_0xb0a6('0x1d')]+_0x59bc9c[_0xb0a6('0x1e')];var _0x6bdcc1;if(_0x4c111f>=_0x372457){_0x4c111f=_0x372457;_0x6bdcc1=0xc8;}else{_0x6bdcc1=0xce;}_0x295b53[_0xb0a6('0x21')](_0x6bdcc1);return _0x295b53[_0xb0a6('0x22')](_0xb0a6('0x23'),_0x4406d0+'-'+_0x4c111f+'/'+_0x372457)[_0xb0a6('0x1c')](_0x18f994);}return null;};}function patchUpdates(_0x4b9a6c){return function(_0x3db6a6){try{jsonpatch['apply'](_0x3db6a6,_0x4b9a6c,!![]);}catch(_0x1322ec){return BPromise[_0xb0a6('0x24')](_0x1322ec);}return _0x3db6a6['save']();};}function saveUpdates(_0x4aa68d,_0x10d753){return function(_0x14993f){if(_0x14993f){return _0x14993f['update'](_0x4aa68d)[_0xb0a6('0x25')](function(_0x24574a){return _0x24574a;});}return null;};}function removeEntity(_0x259f47,_0x5b19c1){return function(_0x5600c5){if(_0x5600c5){return _0x5600c5['destroy']()[_0xb0a6('0x25')](function(){_0x259f47[_0xb0a6('0x21')](0xcc)[_0xb0a6('0x1b')]();});}};}function handleEntityNotFound(_0x58d923,_0x23bec3){return function(_0x3347ac){if(!_0x3347ac){_0x58d923[_0xb0a6('0x1a')](0x194);}return _0x3347ac;};}function handleError(_0xc1c647,_0x10cf86){_0x10cf86=_0x10cf86||0x1f4;return function(_0x3aef2b){logger[_0xb0a6('0x26')](_0x3aef2b[_0xb0a6('0x27')]);if(_0x3aef2b[_0xb0a6('0x28')]){delete _0x3aef2b['name'];}_0xc1c647[_0xb0a6('0x21')](_0x10cf86)[_0xb0a6('0x29')](_0x3aef2b);};}exports[_0xb0a6('0x2a')]=function(_0x5b4c65,_0x31c332){var _0x582fc2={'raw':![],'where':{'id':_0x5b4c65[_0xb0a6('0x2b')]['id']}},_0x131e46={};_0x131e46[_0xb0a6('0x2c')]=_[_0xb0a6('0x2d')](db[_0xb0a6('0x2e')][_0xb0a6('0x2f')]);_0x131e46[_0xb0a6('0x30')]=_[_0xb0a6('0x2d')](_0x5b4c65[_0xb0a6('0x30')]);_0x131e46[_0xb0a6('0x31')]=_['intersection'](_0x131e46['model'],_0x131e46[_0xb0a6('0x30')]);_0x582fc2[_0xb0a6('0x32')]=_[_0xb0a6('0x33')](_0x131e46[_0xb0a6('0x2c')],qs[_0xb0a6('0x34')](_0x5b4c65[_0xb0a6('0x30')][_0xb0a6('0x34')]));_0x582fc2[_0xb0a6('0x32')]=_0x582fc2['attributes'][_0xb0a6('0x35')]?_0x582fc2[_0xb0a6('0x32')]:_0x131e46['model'];if(_0x5b4c65[_0xb0a6('0x30')][_0xb0a6('0x36')]){_0x582fc2['include']=[{'all':!![]}];}_0x582fc2=_['merge']({},_0x582fc2,_0x5b4c65[_0xb0a6('0x37')]);return db[_0xb0a6('0x2e')][_0xb0a6('0x38')](_0x582fc2)[_0xb0a6('0x25')](handleEntityNotFound(_0x31c332,null))[_0xb0a6('0x25')](respondWithResult(_0x31c332,null))[_0xb0a6('0x39')](handleError(_0x31c332,null));};exports['destroy']=function(_0xfb03c9,_0x5c280e){return db[_0xb0a6('0x2e')][_0xb0a6('0x38')]({'where':{'id':_0xfb03c9['params']['id']}})['then'](handleEntityNotFound(_0x5c280e,null))['then'](removeEntity(_0x5c280e,null))[_0xb0a6('0x39')](handleError(_0x5c280e,null));};function widgetAttributes(_0xd484f){try{switch(_0xd484f[_0xb0a6('0x3a')]){case _0xb0a6('0x3b'):return[{'name':_0xb0a6('0x3c'),'value':_0xd484f['attrUrl']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x0]?_0xd484f[_0xb0a6('0x3d')][0x0][_0xb0a6('0x3e')]:undefined)||'https://'}];case _0xb0a6('0x3f'):return[{'name':_0xb0a6('0x40'),'value':_0xd484f[_0xb0a6('0x40')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x0]?_0xd484f['attrs'][0x0]['value']:undefined)||''}];case _0xb0a6('0x41'):return[{'name':_0xb0a6('0x42'),'value':_0xd484f[_0xb0a6('0x42')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x0]?_0xd484f[_0xb0a6('0x3d')][0x0][_0xb0a6('0x3e')]:undefined)||_0xb0a6('0x43')},{'name':'attrTimezone','value':_0xd484f[_0xb0a6('0x44')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x1]?_0xd484f[_0xb0a6('0x3d')][0x1][_0xb0a6('0x3e')]:undefined)||'0.00'},{'name':_0xb0a6('0x45'),'value':_0xd484f['attrFontSize']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x2]?_0xd484f[_0xb0a6('0x3d')][0x2]['value']:undefined)||0xc}];case _0xb0a6('0x46'):return[{'name':_0xb0a6('0x47'),'value':_0xd484f[_0xb0a6('0x47')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x0]?_0xd484f[_0xb0a6('0x3d')][0x0][_0xb0a6('0x3e')]:undefined)||_0xb0a6('0x48')},{'name':_0xb0a6('0x49'),'value':_0xd484f[_0xb0a6('0x49')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x1]?_0xd484f['attrs'][0x1][_0xb0a6('0x3e')]:undefined)||[]},{'name':_0xb0a6('0x45'),'value':_0xd484f['attrFontSize']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x2]?_0xd484f[_0xb0a6('0x3d')][0x2][_0xb0a6('0x3e')]:undefined)||0x14},{'name':_0xb0a6('0x4a'),'value':_0xd484f['attrChannel']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x3]?_0xd484f[_0xb0a6('0x3d')][0x3][_0xb0a6('0x3e')]:undefined)||_0xb0a6('0x4b')},{'name':_0xb0a6('0x4c'),'value':_0xd484f[_0xb0a6('0x4c')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x4]?_0xd484f[_0xb0a6('0x3d')][0x4][_0xb0a6('0x3e')]:undefined)||''},{'name':_0xb0a6('0x4d'),'value':_0xd484f[_0xb0a6('0x4d')]||(_0xd484f['attrs']&&_0xd484f['attrs'][0x5]?_0xd484f['attrs'][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0xd484f['attrSmsAccounts']||(_0xd484f['attrs']&&_0xd484f[_0xb0a6('0x3d')][0x6]?_0xd484f[_0xb0a6('0x3d')][0x6][_0xb0a6('0x3e')]:undefined)||''},{'name':_0xb0a6('0x4e'),'value':_0xd484f[_0xb0a6('0x4e')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x7]?_0xd484f[_0xb0a6('0x3d')][0x7][_0xb0a6('0x3e')]:undefined)||''},{'name':_0xb0a6('0x4f'),'value':_0xd484f[_0xb0a6('0x4f')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x8]?_0xd484f[_0xb0a6('0x3d')][0x8][_0xb0a6('0x3e')]:undefined)||''},{'name':_0xb0a6('0x50'),'value':_0xd484f['attrChatWebsites']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x9]?_0xd484f[_0xb0a6('0x3d')][0x9][_0xb0a6('0x3e')]:undefined)||''}];case _0xb0a6('0x51'):case _0xb0a6('0x52'):return[{'name':_0xb0a6('0x53'),'value':_0xd484f[_0xb0a6('0x53')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x0]?_0xd484f['attrs'][0x0][_0xb0a6('0x3e')]:undefined)||_0xb0a6('0x48')},{'name':_0xb0a6('0x54'),'value':_0xd484f['attrSerie2']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x1]?_0xd484f[_0xb0a6('0x3d')][0x1][_0xb0a6('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0xd484f[_0xb0a6('0x55')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x2]?_0xd484f[_0xb0a6('0x3d')][0x2]['value']:undefined)||null},{'name':_0xb0a6('0x49'),'value':_0xd484f['attrVoiceQueues']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x3]?_0xd484f['attrs'][0x3][_0xb0a6('0x3e')]:undefined)||[]},{'name':_0xb0a6('0x4a'),'value':_0xd484f[_0xb0a6('0x4a')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x4]?_0xd484f['attrs'][0x4][_0xb0a6('0x3e')]:undefined)||'voice'},{'name':_0xb0a6('0x4c'),'value':_0xd484f['attrEmailAccounts']||(_0xd484f['attrs']&&_0xd484f[_0xb0a6('0x3d')][0x5]?_0xd484f[_0xb0a6('0x3d')][0x5]['value']:undefined)||''},{'name':_0xb0a6('0x4d'),'value':_0xd484f['attrFaxAccounts']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x6]?_0xd484f[_0xb0a6('0x3d')][0x6][_0xb0a6('0x3e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xd484f[_0xb0a6('0x56')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x7]?_0xd484f[_0xb0a6('0x3d')][0x7][_0xb0a6('0x3e')]:undefined)||''},{'name':_0xb0a6('0x4e'),'value':_0xd484f['attrOpenchannelAccounts']||(_0xd484f['attrs']&&_0xd484f[_0xb0a6('0x3d')][0x8]?_0xd484f['attrs'][0x8][_0xb0a6('0x3e')]:undefined)||''},{'name':_0xb0a6('0x4f'),'value':_0xd484f[_0xb0a6('0x4f')]||(_0xd484f['attrs']&&_0xd484f[_0xb0a6('0x3d')][0x9]?_0xd484f[_0xb0a6('0x3d')][0x9]['value']:undefined)||''},{'name':_0xb0a6('0x50'),'value':_0xd484f[_0xb0a6('0x50')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0xa]?_0xd484f[_0xb0a6('0x3d')][0xa]['value']:undefined)||''}];case _0xb0a6('0x57'):return[{'name':_0xb0a6('0x58'),'type':_0xd484f['reportType']||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x0]?_0xd484f[_0xb0a6('0x3d')][0x0][_0xb0a6('0x3a')]:undefined)||null,'value':_0xd484f[_0xb0a6('0x58')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f[_0xb0a6('0x3d')][0x0]?_0xd484f[_0xb0a6('0x3d')][0x0][_0xb0a6('0x3e')]:undefined)||null},{'name':_0xb0a6('0x59'),'value':_0xd484f[_0xb0a6('0x59')]||(_0xd484f[_0xb0a6('0x3d')]&&_0xd484f['attrs'][0x1]?_0xd484f[_0xb0a6('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2fb107){logger[_0xb0a6('0x26')](_0xb0a6('0x5a'),JSON[_0xb0a6('0x5b')](_0x2fb107));return[];}}exports['create']=function(_0x22521a,_0x1363e9){if(_0x22521a[_0xb0a6('0x5c')]){_0x22521a[_0xb0a6('0x5c')][_0xb0a6('0x3d')]=widgetAttributes(_0x22521a[_0xb0a6('0x5c')]);}return db[_0xb0a6('0x2e')][_0xb0a6('0x5d')](_0x22521a[_0xb0a6('0x5c')],{})[_0xb0a6('0x25')](respondWithResult(_0x1363e9,0xc9))[_0xb0a6('0x39')](handleError(_0x1363e9,null));};exports[_0xb0a6('0x5e')]=function(_0x3a34d1,_0x2f1b5a){if(_0x3a34d1[_0xb0a6('0x5c')]['id']){delete _0x3a34d1[_0xb0a6('0x5c')]['id'];}_0x3a34d1[_0xb0a6('0x5c')][_0xb0a6('0x3d')]=widgetAttributes(_0x3a34d1['body']);return db[_0xb0a6('0x2e')][_0xb0a6('0x38')]({'where':{'id':_0x3a34d1[_0xb0a6('0x2b')]['id']}})[_0xb0a6('0x25')](handleEntityNotFound(_0x2f1b5a,null))[_0xb0a6('0x25')](saveUpdates(_0x3a34d1[_0xb0a6('0x5c')],null))['then'](respondWithResult(_0x2f1b5a,null))['catch'](handleError(_0x2f1b5a,null));}; \ No newline at end of file +var _0x6363=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6363,0x13a));var _0x3636=function(_0x480086,_0x26cd3b){_0x480086=_0x480086-0x0;var _0x1ea4a1=_0x6363[_0x480086];return _0x1ea4a1;};'use strict';var emlformat=require(_0x3636('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3636('0x1'));var jsonpatch=require(_0x3636('0x2'));var rp=require(_0x3636('0x3'));var moment=require(_0x3636('0x4'));var BPromise=require(_0x3636('0x5'));var Mustache=require(_0x3636('0x6'));var util=require(_0x3636('0x7'));var path=require(_0x3636('0x8'));var sox=require(_0x3636('0x9'));var csv=require(_0x3636('0xa'));var ejs=require(_0x3636('0xb'));var fs=require('fs');var fs_extra=require(_0x3636('0xc'));var _=require(_0x3636('0xd'));var squel=require(_0x3636('0xe'));var crypto=require('crypto');var jsforce=require(_0x3636('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3636('0xa'));var querystring=require(_0x3636('0x10'));var Papa=require(_0x3636('0x11'));var Redis=require(_0x3636('0x12'));var authService=require(_0x3636('0x13'));var qs=require(_0x3636('0x14'));var as=require(_0x3636('0x15'));var hardwareService=require(_0x3636('0x16'));var logger=require(_0x3636('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3636('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3636('0x19'))['db'];config[_0x3636('0x1a')]=_[_0x3636('0x1b')](config[_0x3636('0x1a')],{'host':_0x3636('0x1c'),'port':0x18eb});var socket=require(_0x3636('0x1d'))(new Redis(config[_0x3636('0x1a')]));require(_0x3636('0x1e'))[_0x3636('0x1f')](socket);function respondWithStatusCode(_0x7b4b16,_0x102f90){_0x102f90=_0x102f90||0xcc;return function(_0xaacadb){if(_0xaacadb){return _0x7b4b16[_0x3636('0x20')](_0x102f90);}return _0x7b4b16[_0x3636('0x21')](_0x102f90)[_0x3636('0x22')]();};}function respondWithResult(_0x3cbd0d,_0x2dbd4d){_0x2dbd4d=_0x2dbd4d||0xc8;return function(_0x50474f){if(_0x50474f){return _0x3cbd0d[_0x3636('0x21')](_0x2dbd4d)[_0x3636('0x23')](_0x50474f);}};}function respondWithFilteredResult(_0x4aa7fc,_0xe3be56){return function(_0x5aa0ff){if(_0x5aa0ff){var _0x5e85f2=typeof _0xe3be56[_0x3636('0x24')]===_0x3636('0x25')&&typeof _0xe3be56[_0x3636('0x26')]===_0x3636('0x25');var _0xe0e633=_0x5aa0ff[_0x3636('0x27')];var _0xa2b8fe=_0x5e85f2?0x0:_0xe3be56[_0x3636('0x24')];var _0x538006=_0x5e85f2?_0x5aa0ff['count']:_0xe3be56[_0x3636('0x24')]+_0xe3be56[_0x3636('0x26')];var _0x42b271;if(_0x538006>=_0xe0e633){_0x538006=_0xe0e633;_0x42b271=0xc8;}else{_0x42b271=0xce;}_0x4aa7fc['status'](_0x42b271);return _0x4aa7fc[_0x3636('0x28')](_0x3636('0x29'),_0xa2b8fe+'-'+_0x538006+'/'+_0xe0e633)[_0x3636('0x23')](_0x5aa0ff);}return null;};}function patchUpdates(_0xe34cd9){return function(_0x325dce){try{jsonpatch[_0x3636('0x2a')](_0x325dce,_0xe34cd9,!![]);}catch(_0x4f5b0e){return BPromise['reject'](_0x4f5b0e);}return _0x325dce[_0x3636('0x2b')]();};}function saveUpdates(_0x4ee098,_0x50ba2f){return function(_0x8b3182){if(_0x8b3182){return _0x8b3182['update'](_0x4ee098)[_0x3636('0x2c')](function(_0x4c24cf){return _0x4c24cf;});}return null;};}function removeEntity(_0x36f4c5,_0x477c34){return function(_0xbf9a67){if(_0xbf9a67){return _0xbf9a67[_0x3636('0x2d')]()[_0x3636('0x2c')](function(){_0x36f4c5[_0x3636('0x21')](0xcc)[_0x3636('0x22')]();});}};}function handleEntityNotFound(_0x3c3d45,_0x37ad2d){return function(_0x701651){if(!_0x701651){_0x3c3d45[_0x3636('0x20')](0x194);}return _0x701651;};}function handleError(_0x550443,_0x43811e){_0x43811e=_0x43811e||0x1f4;return function(_0x236f54){logger[_0x3636('0x2e')](_0x236f54[_0x3636('0x2f')]);if(_0x236f54[_0x3636('0x30')]){delete _0x236f54[_0x3636('0x30')];}_0x550443['status'](_0x43811e)[_0x3636('0x31')](_0x236f54);};}exports[_0x3636('0x32')]=function(_0x5ce0ee,_0x8fffb0){var _0x26b6de={'raw':![],'where':{'id':_0x5ce0ee[_0x3636('0x33')]['id']}},_0x306774={};_0x306774[_0x3636('0x34')]=_['keys'](db[_0x3636('0x35')][_0x3636('0x36')]);_0x306774[_0x3636('0x37')]=_[_0x3636('0x38')](_0x5ce0ee[_0x3636('0x37')]);_0x306774[_0x3636('0x39')]=_[_0x3636('0x3a')](_0x306774[_0x3636('0x34')],_0x306774[_0x3636('0x37')]);_0x26b6de['attributes']=_['intersection'](_0x306774[_0x3636('0x34')],qs['fields'](_0x5ce0ee['query'][_0x3636('0x3b')]));_0x26b6de[_0x3636('0x3c')]=_0x26b6de[_0x3636('0x3c')]['length']?_0x26b6de[_0x3636('0x3c')]:_0x306774[_0x3636('0x34')];if(_0x5ce0ee[_0x3636('0x37')][_0x3636('0x3d')]){_0x26b6de[_0x3636('0x3e')]=[{'all':!![]}];}_0x26b6de=_[_0x3636('0x3f')]({},_0x26b6de,_0x5ce0ee[_0x3636('0x40')]);return db[_0x3636('0x35')][_0x3636('0x41')](_0x26b6de)[_0x3636('0x2c')](handleEntityNotFound(_0x8fffb0,null))[_0x3636('0x2c')](respondWithResult(_0x8fffb0,null))[_0x3636('0x42')](handleError(_0x8fffb0,null));};exports[_0x3636('0x2d')]=function(_0x488d51,_0x27b929){return db[_0x3636('0x35')][_0x3636('0x41')]({'where':{'id':_0x488d51[_0x3636('0x33')]['id']}})['then'](handleEntityNotFound(_0x27b929,null))['then'](removeEntity(_0x27b929,null))[_0x3636('0x42')](handleError(_0x27b929,null));};function widgetAttributes(_0x3807ad){try{switch(_0x3807ad[_0x3636('0x43')]){case'iframe':return[{'name':_0x3636('0x44'),'value':_0x3807ad[_0x3636('0x44')]||(_0x3807ad['attrs']&&_0x3807ad['attrs'][0x0]?_0x3807ad[_0x3636('0x45')][0x0]['value']:undefined)||_0x3636('0x46')}];case _0x3636('0x47'):return[{'name':_0x3636('0x48'),'value':_0x3807ad[_0x3636('0x48')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x0]?_0x3807ad[_0x3636('0x45')][0x0][_0x3636('0x49')]:undefined)||''}];case _0x3636('0x4a'):return[{'name':'attrHourFormat','value':_0x3807ad[_0x3636('0x4b')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x0]?_0x3807ad[_0x3636('0x45')][0x0][_0x3636('0x49')]:undefined)||_0x3636('0x4c')},{'name':_0x3636('0x4d'),'value':_0x3807ad[_0x3636('0x4d')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad['attrs'][0x1]?_0x3807ad[_0x3636('0x45')][0x1][_0x3636('0x49')]:undefined)||_0x3636('0x4e')},{'name':_0x3636('0x4f'),'value':_0x3807ad[_0x3636('0x4f')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x2]?_0x3807ad[_0x3636('0x45')][0x2][_0x3636('0x49')]:undefined)||0xc}];case _0x3636('0x50'):return[{'name':_0x3636('0x51'),'value':_0x3807ad[_0x3636('0x51')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x0]?_0x3807ad[_0x3636('0x45')][0x0]['value']:undefined)||_0x3636('0x52')},{'name':_0x3636('0x53'),'value':_0x3807ad[_0x3636('0x53')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x1]?_0x3807ad[_0x3636('0x45')][0x1][_0x3636('0x49')]:undefined)||[]},{'name':_0x3636('0x4f'),'value':_0x3807ad[_0x3636('0x4f')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x2]?_0x3807ad[_0x3636('0x45')][0x2][_0x3636('0x49')]:undefined)||0x14},{'name':'attrChannel','value':_0x3807ad['attrChannel']||(_0x3807ad['attrs']&&_0x3807ad[_0x3636('0x45')][0x3]?_0x3807ad['attrs'][0x3]['value']:undefined)||_0x3636('0x54')},{'name':_0x3636('0x55'),'value':_0x3807ad[_0x3636('0x55')]||(_0x3807ad['attrs']&&_0x3807ad[_0x3636('0x45')][0x4]?_0x3807ad[_0x3636('0x45')][0x4][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x56'),'value':_0x3807ad[_0x3636('0x56')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x5]?_0x3807ad[_0x3636('0x45')][0x5][_0x3636('0x49')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3807ad[_0x3636('0x57')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x6]?_0x3807ad[_0x3636('0x45')][0x6][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x58'),'value':_0x3807ad['attrOpenchannelAccounts']||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x7]?_0x3807ad[_0x3636('0x45')][0x7][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x59'),'value':_0x3807ad['attrWhatsappAccounts']||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x8]?_0x3807ad[_0x3636('0x45')][0x8][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x5a'),'value':_0x3807ad['attrChatWebsites']||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad['attrs'][0x9]?_0x3807ad['attrs'][0x9][_0x3636('0x49')]:undefined)||''}];case _0x3636('0x5b'):case _0x3636('0x5c'):return[{'name':_0x3636('0x5d'),'value':_0x3807ad['attrSerie1']||(_0x3807ad['attrs']&&_0x3807ad[_0x3636('0x45')][0x0]?_0x3807ad[_0x3636('0x45')][0x0][_0x3636('0x49')]:undefined)||_0x3636('0x52')},{'name':_0x3636('0x5e'),'value':_0x3807ad[_0x3636('0x5e')]||(_0x3807ad['attrs']&&_0x3807ad[_0x3636('0x45')][0x1]?_0x3807ad[_0x3636('0x45')][0x1][_0x3636('0x49')]:undefined)||null},{'name':_0x3636('0x5f'),'value':_0x3807ad[_0x3636('0x5f')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x2]?_0x3807ad[_0x3636('0x45')][0x2]['value']:undefined)||null},{'name':_0x3636('0x53'),'value':_0x3807ad['attrVoiceQueues']||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad['attrs'][0x3]?_0x3807ad[_0x3636('0x45')][0x3][_0x3636('0x49')]:undefined)||[]},{'name':_0x3636('0x60'),'value':_0x3807ad[_0x3636('0x60')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x4]?_0x3807ad['attrs'][0x4][_0x3636('0x49')]:undefined)||'voice'},{'name':_0x3636('0x55'),'value':_0x3807ad[_0x3636('0x55')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x5]?_0x3807ad['attrs'][0x5][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x56'),'value':_0x3807ad[_0x3636('0x56')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x6]?_0x3807ad[_0x3636('0x45')][0x6][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x57'),'value':_0x3807ad[_0x3636('0x57')]||(_0x3807ad['attrs']&&_0x3807ad[_0x3636('0x45')][0x7]?_0x3807ad[_0x3636('0x45')][0x7][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x58'),'value':_0x3807ad[_0x3636('0x58')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x8]?_0x3807ad[_0x3636('0x45')][0x8][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x59'),'value':_0x3807ad[_0x3636('0x59')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x9]?_0x3807ad[_0x3636('0x45')][0x9][_0x3636('0x49')]:undefined)||''},{'name':_0x3636('0x5a'),'value':_0x3807ad[_0x3636('0x5a')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0xa]?_0x3807ad[_0x3636('0x45')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x3636('0x61'),'type':_0x3807ad[_0x3636('0x62')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad[_0x3636('0x45')][0x0]?_0x3807ad[_0x3636('0x45')][0x0][_0x3636('0x43')]:undefined)||null,'value':_0x3807ad[_0x3636('0x61')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad['attrs'][0x0]?_0x3807ad[_0x3636('0x45')][0x0]['value']:undefined)||null},{'name':_0x3636('0x63'),'value':_0x3807ad[_0x3636('0x63')]||(_0x3807ad[_0x3636('0x45')]&&_0x3807ad['attrs'][0x1]?_0x3807ad[_0x3636('0x45')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x38d542){logger[_0x3636('0x2e')](_0x3636('0x64'),JSON[_0x3636('0x65')](_0x38d542));return[];}}exports[_0x3636('0x66')]=function(_0x466926,_0xd35a0e){if(_0x466926[_0x3636('0x67')]){_0x466926[_0x3636('0x67')][_0x3636('0x45')]=widgetAttributes(_0x466926['body']);}return db['DashboardItem']['create'](_0x466926[_0x3636('0x67')],{})['then'](respondWithResult(_0xd35a0e,0xc9))[_0x3636('0x42')](handleError(_0xd35a0e,null));};exports[_0x3636('0x68')]=function(_0x4216c9,_0x50b5a7){if(_0x4216c9[_0x3636('0x67')]['id']){delete _0x4216c9[_0x3636('0x67')]['id'];}_0x4216c9[_0x3636('0x67')][_0x3636('0x45')]=widgetAttributes(_0x4216c9['body']);return db[_0x3636('0x35')]['find']({'where':{'id':_0x4216c9[_0x3636('0x33')]['id']}})['then'](handleEntityNotFound(_0x50b5a7,null))['then'](saveUpdates(_0x4216c9[_0x3636('0x67')],null))[_0x3636('0x2c')](respondWithResult(_0x50b5a7,null))[_0x3636('0x42')](handleError(_0x50b5a7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 26d4ada..98fc4e7 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 _0xe24e=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4f234c,_0xee4fc7){var _0x648c6a=function(_0xf461e0){while(--_0xf461e0){_0x4f234c['push'](_0x4f234c['shift']());}};_0x648c6a(++_0xee4fc7);}(_0xe24e,0x15f));var _0xee24=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xe24e[_0x3c504b];return _0x2e5354;};'use strict';var EventEmitter=require(_0xee24('0x0'));var DashboardItem=require(_0xee24('0x1'))['db'][_0xee24('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xee24('0x3')](0x0);var events={'afterCreate':_0xee24('0x4'),'afterUpdate':_0xee24('0x5'),'afterDestroy':_0xee24('0x6')};function emitEvent(_0x4aaefd){return function(_0x451b0a,_0x5ce5fc,_0x57aace){DashboardItemEvents['emit'](_0x4aaefd+':'+_0x451b0a['id'],_0x451b0a);DashboardItemEvents[_0xee24('0x7')](_0x4aaefd,_0x451b0a);_0x57aace(null);};}for(var e in events){if(events[_0xee24('0x8')](e)){var event=events[e];DashboardItem[_0xee24('0x9')](e,emitEvent(event));}}module[_0xee24('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0xcbe1=['../../mysqldb','DashboardItem','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x32de1c,_0x1b9e3b){var _0x34efc5=function(_0x16779d){while(--_0x16779d){_0x32de1c['push'](_0x32de1c['shift']());}};_0x34efc5(++_0x1b9e3b);}(_0xcbe1,0xd7));var _0x1cbe=function(_0x43ddb5,_0x2eafc0){_0x43ddb5=_0x43ddb5-0x0;var _0x540961=_0xcbe1[_0x43ddb5];return _0x540961;};'use strict';var EventEmitter=require(_0x1cbe('0x0'));var DashboardItem=require(_0x1cbe('0x1'))['db'][_0x1cbe('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1cbe('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x205ea1){return function(_0x4865c2,_0x402af5,_0x11acde){DashboardItemEvents[_0x1cbe('0x4')](_0x205ea1+':'+_0x4865c2['id'],_0x4865c2);DashboardItemEvents[_0x1cbe('0x4')](_0x205ea1,_0x4865c2);_0x11acde(null);};}for(var e in events){if(events[_0x1cbe('0x5')](e)){var event=events[e];DashboardItem[_0x1cbe('0x6')](e,emitEvent(event));}}module[_0x1cbe('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 6a71c0c..af036ae 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 _0x160f=['request-promise','path','rimraf','define','DashboardItem','dashboard_items','lodash','util','api','moment','bluebird'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x160f,0x8a));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require('../../config/logger')(_0xf160('0x2'));var moment=require(_0xf160('0x3'));var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x15f382,_0x192cb1){return _0x15f382[_0xf160('0x8')](_0xf160('0x9'),attributes,{'tableName':_0xf160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63e1=['util','api','moment','bluebird','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','lodash'];(function(_0x13a422,_0x4465a4){var _0x9e7e83=function(_0x111831){while(--_0x111831){_0x13a422['push'](_0x13a422['shift']());}};_0x9e7e83(++_0x4465a4);}(_0x63e1,0x6d));var _0x163e=function(_0x4c3131,_0x491c5f){_0x4c3131=_0x4c3131-0x0;var _0x646470=_0x63e1[_0x4c3131];return _0x646470;};'use strict';var _=require(_0x163e('0x0'));var util=require(_0x163e('0x1'));var logger=require('../../config/logger')(_0x163e('0x2'));var moment=require(_0x163e('0x3'));var BPromise=require(_0x163e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x163e('0x5'));var rimraf=require(_0x163e('0x6'));var config=require('../../config/environment');var attributes=require(_0x163e('0x7'));module[_0x163e('0x8')]=function(_0x260bd,_0x4e2ac6){return _0x260bd[_0x163e('0x9')](_0x163e('0xa'),attributes,{'tableName':'dashboard_items','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 946163d..7a1149d 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 _0xcc86=['../../mysqldb','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','ioredis'];(function(_0x4f14cb,_0x3e514b){var _0x1766a5=function(_0x1557c0){while(--_0x1557c0){_0x4f14cb['push'](_0x4f14cb['shift']());}};_0x1766a5(++_0x3e514b);}(_0xcc86,0x130));var _0x6cc8=function(_0x2ef5a5,_0x3397d1){_0x2ef5a5=_0x2ef5a5-0x0;var _0x527916=_0xcc86[_0x2ef5a5];return _0x527916;};'use strict';var _=require(_0x6cc8('0x0'));var util=require(_0x6cc8('0x1'));var moment=require('moment');var BPromise=require(_0x6cc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cc8('0x3'));var db=require(_0x6cc8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6cc8('0x5'));var config=require('../../config/environment');var jayson=require(_0x6cc8('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x6cc8('0x7')]=_[_0x6cc8('0x8')](config[_0x6cc8('0x7')],{'host':_0x6cc8('0x9'),'port':0x18eb});var socket=require(_0x6cc8('0xa'))(new Redis(config[_0x6cc8('0x7')]));require(_0x6cc8('0xb'))['register'](socket);function respondWithRpcPromise(_0x3936a7,_0x4a2918,_0x18d3bf){return new BPromise(function(_0x19ad5c,_0x3d355c){return client[_0x6cc8('0xc')](_0x3936a7,_0x18d3bf)[_0x6cc8('0xd')](function(_0x2bb2ab){logger[_0x6cc8('0xe')](_0x6cc8('0xf'),_0x4a2918,'request\x20sent');logger['debug'](_0x6cc8('0x10'),_0x4a2918,_0x6cc8('0x11'),JSON['stringify'](_0x2bb2ab));if(_0x2bb2ab[_0x6cc8('0x12')]){if(_0x2bb2ab[_0x6cc8('0x12')][_0x6cc8('0x13')]===0x1f4){logger[_0x6cc8('0x12')](_0x6cc8('0xf'),_0x4a2918,_0x2bb2ab[_0x6cc8('0x12')][_0x6cc8('0x14')]);return _0x3d355c(_0x2bb2ab[_0x6cc8('0x12')][_0x6cc8('0x14')]);}logger[_0x6cc8('0x12')]('DashboardItem,\x20%s,\x20%s',_0x4a2918,_0x2bb2ab[_0x6cc8('0x12')][_0x6cc8('0x14')]);return _0x19ad5c(_0x2bb2ab['error'][_0x6cc8('0x14')]);}else{logger[_0x6cc8('0xe')](_0x6cc8('0xf'),_0x4a2918,_0x6cc8('0x11'));_0x19ad5c(_0x2bb2ab[_0x6cc8('0x15')][_0x6cc8('0x14')]);}})['catch'](function(_0x199b3b){logger[_0x6cc8('0x12')]('DashboardItem,\x20%s,\x20%s',_0x4a2918,_0x199b3b);_0x3d355c(_0x199b3b);});});} \ No newline at end of file +var _0x0c47=['request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x3396cd,_0x4047f0){var _0x2d6b4a=function(_0x389663){while(--_0x389663){_0x3396cd['push'](_0x3396cd['shift']());}};_0x2d6b4a(++_0x4047f0);}(_0x0c47,0xc8));var _0x70c4=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0x0c47[_0x2fbcf6];return _0x3e7265;};'use strict';var _=require(_0x70c4('0x0'));var util=require(_0x70c4('0x1'));var moment=require('moment');var BPromise=require(_0x70c4('0x2'));var rs=require(_0x70c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70c4('0x4'))['db'];var utils=require(_0x70c4('0x5'));var logger=require(_0x70c4('0x6'))(_0x70c4('0x7'));var config=require(_0x70c4('0x8'));var jayson=require(_0x70c4('0x9'));var client=jayson['client'][_0x70c4('0xa')]({'port':0x232a});config[_0x70c4('0xb')]=_['defaults'](config[_0x70c4('0xb')],{'host':_0x70c4('0xc'),'port':0x18eb});var socket=require(_0x70c4('0xd'))(new Redis(config[_0x70c4('0xb')]));require(_0x70c4('0xe'))[_0x70c4('0xf')](socket);function respondWithRpcPromise(_0x597d2b,_0x29adf2,_0x1c16e9){return new BPromise(function(_0x415642,_0xd831eb){return client[_0x70c4('0x10')](_0x597d2b,_0x1c16e9)[_0x70c4('0x11')](function(_0x4ea990){logger[_0x70c4('0x12')](_0x70c4('0x13'),_0x29adf2,'request\x20sent');logger[_0x70c4('0x14')](_0x70c4('0x15'),_0x29adf2,_0x70c4('0x16'),JSON[_0x70c4('0x17')](_0x4ea990));if(_0x4ea990['error']){if(_0x4ea990[_0x70c4('0x18')][_0x70c4('0x19')]===0x1f4){logger[_0x70c4('0x18')](_0x70c4('0x13'),_0x29adf2,_0x4ea990[_0x70c4('0x18')][_0x70c4('0x1a')]);return _0xd831eb(_0x4ea990[_0x70c4('0x18')][_0x70c4('0x1a')]);}logger[_0x70c4('0x18')](_0x70c4('0x13'),_0x29adf2,_0x4ea990[_0x70c4('0x18')]['message']);return _0x415642(_0x4ea990[_0x70c4('0x18')]['message']);}else{logger['info'](_0x70c4('0x13'),_0x29adf2,_0x70c4('0x16'));_0x415642(_0x4ea990['result'][_0x70c4('0x1a')]);}})['catch'](function(_0x3943ff){logger[_0x70c4('0x18')](_0x70c4('0x13'),_0x29adf2,_0x3943ff);_0xd831eb(_0x3943ff);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 41031b2..5293230 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 _0xc317=['dashboardItem:','./dashboardItem.events','update','emit','removeListener'];(function(_0x63eeb1,_0x8098b3){var _0x27e078=function(_0x430d7b){while(--_0x430d7b){_0x63eeb1['push'](_0x63eeb1['shift']());}};_0x27e078(++_0x8098b3);}(_0xc317,0x1e1));var _0x7c31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc317[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardItemEvents=require(_0x7c31('0x0'));var events=['save','remove',_0x7c31('0x1')];function createListener(_0x3ab938,_0x216364){return function(_0x4f2757){_0x216364[_0x7c31('0x2')](_0x3ab938,_0x4f2757);};}function removeListener(_0x5b208b,_0x25dc9e){return function(){DashboardItemEvents[_0x7c31('0x3')](_0x5b208b,_0x25dc9e);};}exports['register']=function(_0x4478ce){for(var _0x46e75a=0x0,_0x29c59e=events['length'];_0x46e75a<_0x29c59e;_0x46e75a++){var _0x3aac31=events[_0x46e75a];var _0x3de7c8=createListener(_0x7c31('0x4')+_0x3aac31,_0x4478ce);DashboardItemEvents['on'](_0x3aac31,_0x3de7c8);}}; \ No newline at end of file +var _0x8f15=['./dashboardItem.events','save','emit','length','dashboardItem:'];(function(_0x258f50,_0x2a4bd1){var _0x5699d7=function(_0x48e9fb){while(--_0x48e9fb){_0x258f50['push'](_0x258f50['shift']());}};_0x5699d7(++_0x2a4bd1);}(_0x8f15,0x15e));var _0x58f1=function(_0x58a64e,_0x2951fb){_0x58a64e=_0x58a64e-0x0;var _0x5969fd=_0x8f15[_0x58a64e];return _0x5969fd;};'use strict';var DashboardItemEvents=require(_0x58f1('0x0'));var events=[_0x58f1('0x1'),'remove','update'];function createListener(_0x45322c,_0x47a669){return function(_0x705118){_0x47a669[_0x58f1('0x2')](_0x45322c,_0x705118);};}function removeListener(_0x386c6,_0x30021a){return function(){DashboardItemEvents['removeListener'](_0x386c6,_0x30021a);};}exports['register']=function(_0x19fa16){for(var _0x5a2b8e=0x0,_0x1a080d=events[_0x58f1('0x3')];_0x5a2b8e<_0x1a080d;_0x5a2b8e++){var _0x3461fe=events[_0x5a2b8e];var _0x120789=createListener(_0x58f1('0x4')+_0x3461fe,_0x19fa16);DashboardItemEvents['on'](_0x3461fe,_0x120789);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 2860074..ba013e2 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 _0xac9f=['../../components/interaction/service','./dashboardItem.controller','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service'];(function(_0x3aef6c,_0x42213e){var _0x2bf7b5=function(_0x33cbde){while(--_0x33cbde){_0x3aef6c['push'](_0x3aef6c['shift']());}};_0x2bf7b5(++_0x42213e);}(_0xac9f,0x18c));var _0xfac9=function(_0x2ceda5,_0x58e186){_0x2ceda5=_0x2ceda5-0x0;var _0x529d77=_0xac9f[_0x2ceda5];return _0x529d77;};'use strict';var multer=require(_0xfac9('0x0'));var util=require('util');var path=require(_0xfac9('0x1'));var timeout=require(_0xfac9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfac9('0x3'));var interaction=require(_0xfac9('0x4'));var config=require('../../config/environment');var controller=require(_0xfac9('0x5'));router['get']('/:id',auth[_0xfac9('0x6')](),controller[_0xfac9('0x7')]);router[_0xfac9('0x8')]('/',auth[_0xfac9('0x6')](),controller[_0xfac9('0x9')]);router[_0xfac9('0xa')](_0xfac9('0xb'),auth[_0xfac9('0x6')](),controller[_0xfac9('0xc')]);router[_0xfac9('0xd')](_0xfac9('0xb'),auth[_0xfac9('0x6')](),controller[_0xfac9('0xe')]);module[_0xfac9('0xf')]=router; \ No newline at end of file +var _0x3aba=['/:id','isAuthenticated','create','put','update','delete','destroy','exports','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x5d43b7,_0x2403d5){var _0x31d19a=function(_0x2a93cb){while(--_0x2a93cb){_0x5d43b7['push'](_0x5d43b7['shift']());}};_0x31d19a(++_0x2403d5);}(_0x3aba,0xe8));var _0xa3ab=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x3aba[_0x4c9380];return _0x49a523;};'use strict';var multer=require('multer');var util=require(_0xa3ab('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa3ab('0x1'));var interaction=require(_0xa3ab('0x2'));var config=require(_0xa3ab('0x3'));var controller=require(_0xa3ab('0x4'));router[_0xa3ab('0x5')](_0xa3ab('0x6'),auth[_0xa3ab('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa3ab('0x8')]);router[_0xa3ab('0x9')](_0xa3ab('0x6'),auth[_0xa3ab('0x7')](),controller[_0xa3ab('0xa')]);router[_0xa3ab('0xb')]('/:id',auth[_0xa3ab('0x7')](),controller[_0xa3ab('0xc')]);module[_0xa3ab('0xd')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 79d3ac9..c43c63d 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 _0x60aa=['STRING','first','second','third','sequelize','exports'];(function(_0x54810e,_0xf91484){var _0xb61b02=function(_0xb16fdb){while(--_0xb16fdb){_0x54810e['push'](_0x54810e['shift']());}};_0xb61b02(++_0xf91484);}(_0x60aa,0x11e));var _0xa60a=function(_0x32578c,_0x226d4e){_0x32578c=_0x32578c-0x0;var _0xa40c63=_0x60aa[_0x32578c];return _0xa40c63;};'use strict';var Sequelize=require(_0xa60a('0x0'));module[_0xa60a('0x1')]={'name':{'type':Sequelize[_0xa60a('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xa60a('0x3'),_0xa60a('0x4'),_0xa60a('0x5')),'allowNull':![],'defaultValue':_0xa60a('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf731=['first','second','third','sequelize','STRING'];(function(_0x18e333,_0x1caf42){var _0x41c26e=function(_0x3e3606){while(--_0x3e3606){_0x18e333['push'](_0x18e333['shift']());}};_0x41c26e(++_0x1caf42);}(_0xf731,0x13e));var _0x1f73=function(_0x183a2c,_0x4f851b){_0x183a2c=_0x183a2c-0x0;var _0x4ec838=_0xf731[_0x183a2c];return _0x4ec838;};'use strict';var Sequelize=require(_0x1f73('0x0'));module['exports']={'name':{'type':Sequelize[_0x1f73('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x1f73('0x2'),_0x1f73('0x3'),_0x1f73('0x4')),'allowNull':![],'defaultValue':_0x1f73('0x2')},'description':{'type':Sequelize[_0x1f73('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d18e9a0..e972cbf 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 _0x7deb=['ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','end','name','send','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Disposition','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','path'];(function(_0x322f53,_0x14048d){var _0x167714=function(_0x3a6858){while(--_0x3a6858){_0x322f53['push'](_0x322f53['shift']());}};_0x167714(++_0x14048d);}(_0x7deb,0x97));var _0xb7de=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x7deb[_0x375492];return _0x18ba5b;};'use strict';var emlformat=require(_0xb7de('0x0'));var rimraf=require(_0xb7de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7de('0x2'));var moment=require(_0xb7de('0x3'));var BPromise=require(_0xb7de('0x4'));var Mustache=require('mustache');var util=require(_0xb7de('0x5'));var path=require(_0xb7de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb7de('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb7de('0x8'));var crypto=require(_0xb7de('0x9'));var jsforce=require(_0xb7de('0xa'));var deskjs=require(_0xb7de('0xb'));var toCsv=require(_0xb7de('0xc'));var querystring=require(_0xb7de('0xd'));var Papa=require('papaparse');var Redis=require(_0xb7de('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb7de('0xf'));var hardwareService=require(_0xb7de('0x10'));var logger=require(_0xb7de('0x11'))('api');var utils=require(_0xb7de('0x12'));var config=require(_0xb7de('0x13'));var licenseUtil=require(_0xb7de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63e9,_0x27fe11){_0x27fe11=_0x27fe11||0xcc;return function(_0x3190db){if(_0x3190db){return _0x4d63e9[_0xb7de('0x15')](_0x27fe11);}return _0x4d63e9[_0xb7de('0x16')](_0x27fe11)['end']();};}function respondWithResult(_0x19a48c,_0x1fdb21){_0x1fdb21=_0x1fdb21||0xc8;return function(_0x56c967){if(_0x56c967){return _0x19a48c['status'](_0x1fdb21)[_0xb7de('0x17')](_0x56c967);}};}function respondWithFilteredResult(_0x12433e,_0x311b68){return function(_0x51cfaf){if(_0x51cfaf){var _0x566fcb=typeof _0x311b68[_0xb7de('0x18')]===_0xb7de('0x19')&&typeof _0x311b68['limit']===_0xb7de('0x19');var _0xfae531=_0x51cfaf[_0xb7de('0x1a')];var _0x566837=_0x566fcb?0x0:_0x311b68['offset'];var _0x48bbd7=_0x566fcb?_0x51cfaf[_0xb7de('0x1a')]:_0x311b68['offset']+_0x311b68[_0xb7de('0x1b')];var _0xc5da38;if(_0x48bbd7>=_0xfae531){_0x48bbd7=_0xfae531;_0xc5da38=0xc8;}else{_0xc5da38=0xce;}_0x12433e[_0xb7de('0x16')](_0xc5da38);return _0x12433e[_0xb7de('0x1c')](_0xb7de('0x1d'),_0x566837+'-'+_0x48bbd7+'/'+_0xfae531)['json'](_0x51cfaf);}return null;};}function patchUpdates(_0x9595cf){return function(_0x593602){try{jsonpatch['apply'](_0x593602,_0x9595cf,!![]);}catch(_0x41eec8){return BPromise[_0xb7de('0x1e')](_0x41eec8);}return _0x593602[_0xb7de('0x1f')]();};}function saveUpdates(_0x396de7,_0x26b44f){return function(_0x2634ef){if(_0x2634ef){return _0x2634ef[_0xb7de('0x20')](_0x396de7)[_0xb7de('0x21')](function(_0x5ed6e2){return _0x5ed6e2;});}return null;};}function removeEntity(_0x5a02d8,_0xd9e075){return function(_0x33528a){if(_0x33528a){return _0x33528a[_0xb7de('0x22')]()[_0xb7de('0x21')](function(){var _0xc14b73=_0x33528a[_0xb7de('0x23')]({'plain':!![]});var _0x163697=_0xb7de('0x24');return db[_0xb7de('0x25')][_0xb7de('0x22')]({'where':{'type':_0x163697,'resourceId':_0xc14b73['id']}})[_0xb7de('0x21')](function(){return _0x33528a;});})['then'](function(){_0x5a02d8[_0xb7de('0x16')](0xcc)[_0xb7de('0x26')]();});}};}function handleEntityNotFound(_0x5ae81c,_0x2ac80a){return function(_0x2178ac){if(!_0x2178ac){_0x5ae81c[_0xb7de('0x15')](0x194);}return _0x2178ac;};}function handleError(_0x29f9c8,_0x156e36){_0x156e36=_0x156e36||0x1f4;return function(_0x3a09d7){logger['error'](_0x3a09d7['stack']);if(_0x3a09d7[_0xb7de('0x27')]){delete _0x3a09d7['name'];}_0x29f9c8[_0xb7de('0x16')](_0x156e36)[_0xb7de('0x28')](_0x3a09d7);};}exports['index']=function(_0x65a0ee,_0x1a8797){var _0x142e92={},_0xbaed63={},_0x28b17d={'count':0x0,'rows':[]};var _0x14ee39=_['map'](db['Disposition']['rawAttributes'],function(_0x15787e){return{'name':_0x15787e[_0xb7de('0x29')],'type':_0x15787e[_0xb7de('0x2a')][_0xb7de('0x2b')]};});_0xbaed63['model']=_[_0xb7de('0x2c')](_0x14ee39,_0xb7de('0x27'));_0xbaed63[_0xb7de('0x2d')]=_[_0xb7de('0x2e')](_0x65a0ee['query']);_0xbaed63[_0xb7de('0x2f')]=_[_0xb7de('0x30')](_0xbaed63['model'],_0xbaed63[_0xb7de('0x2d')]);_0x142e92['attributes']=_['intersection'](_0xbaed63[_0xb7de('0x31')],qs['fields'](_0x65a0ee[_0xb7de('0x2d')][_0xb7de('0x32')]));_0x142e92['attributes']=_0x142e92[_0xb7de('0x33')][_0xb7de('0x34')]?_0x142e92[_0xb7de('0x33')]:_0xbaed63['model'];if(!_0x65a0ee[_0xb7de('0x2d')][_0xb7de('0x35')](_0xb7de('0x36'))){_0x142e92[_0xb7de('0x1b')]=qs['limit'](_0x65a0ee[_0xb7de('0x2d')][_0xb7de('0x1b')]);_0x142e92[_0xb7de('0x18')]=qs[_0xb7de('0x18')](_0x65a0ee['query'][_0xb7de('0x18')]);}_0x142e92[_0xb7de('0x37')]=qs['sort'](_0x65a0ee['query'][_0xb7de('0x38')]);_0x142e92[_0xb7de('0x39')]=qs[_0xb7de('0x2f')](_[_0xb7de('0x3a')](_0x65a0ee[_0xb7de('0x2d')],_0xbaed63[_0xb7de('0x2f')]),_0x14ee39);if(_0x65a0ee[_0xb7de('0x2d')][_0xb7de('0x3b')]){_0x142e92[_0xb7de('0x39')]=_['merge'](_0x142e92[_0xb7de('0x39')],{'$or':_[_0xb7de('0x2c')](_0x14ee39,function(_0x2c15b5){if(_0x2c15b5[_0xb7de('0x2a')]!=='VIRTUAL'){var _0x3ada79={};_0x3ada79[_0x2c15b5[_0xb7de('0x27')]]={'$like':'%'+_0x65a0ee['query'][_0xb7de('0x3b')]+'%'};return _0x3ada79;}})});}_0x142e92=_[_0xb7de('0x3c')]({},_0x142e92,_0x65a0ee['options']);var _0x58b917={'where':_0x142e92[_0xb7de('0x39')]};return db[_0xb7de('0x3d')][_0xb7de('0x1a')](_0x58b917)[_0xb7de('0x21')](function(_0x33a537){_0x28b17d[_0xb7de('0x1a')]=_0x33a537;if(_0x65a0ee[_0xb7de('0x2d')][_0xb7de('0x3e')]){_0x142e92[_0xb7de('0x3f')]=[{'all':!![]}];}return db[_0xb7de('0x3d')][_0xb7de('0x40')](_0x142e92);})[_0xb7de('0x21')](function(_0x27b13d){_0x28b17d[_0xb7de('0x41')]=_0x27b13d;return _0x28b17d;})[_0xb7de('0x21')](respondWithFilteredResult(_0x1a8797,_0x142e92))[_0xb7de('0x42')](handleError(_0x1a8797,null));};exports[_0xb7de('0x43')]=function(_0x5e9c64,_0x204cda){var _0x3bda99={'raw':!![],'where':{'id':_0x5e9c64[_0xb7de('0x44')]['id']}},_0x2eef99={};_0x2eef99['model']=_[_0xb7de('0x2e')](db[_0xb7de('0x3d')][_0xb7de('0x45')]);_0x2eef99[_0xb7de('0x2d')]=_[_0xb7de('0x2e')](_0x5e9c64[_0xb7de('0x2d')]);_0x2eef99['filters']=_[_0xb7de('0x30')](_0x2eef99['model'],_0x2eef99['query']);_0x3bda99['attributes']=_[_0xb7de('0x30')](_0x2eef99[_0xb7de('0x31')],qs['fields'](_0x5e9c64[_0xb7de('0x2d')]['fields']));_0x3bda99[_0xb7de('0x33')]=_0x3bda99[_0xb7de('0x33')][_0xb7de('0x34')]?_0x3bda99['attributes']:_0x2eef99[_0xb7de('0x31')];if(_0x5e9c64['query']['includeAll']){_0x3bda99[_0xb7de('0x3f')]=[{'all':!![]}];}_0x3bda99=_['merge']({},_0x3bda99,_0x5e9c64[_0xb7de('0x46')]);return db['Disposition'][_0xb7de('0x47')](_0x3bda99)[_0xb7de('0x21')](handleEntityNotFound(_0x204cda,null))[_0xb7de('0x21')](respondWithResult(_0x204cda,null))[_0xb7de('0x42')](handleError(_0x204cda,null));};exports[_0xb7de('0x48')]=function(_0xee855f,_0x2d0b43){return db[_0xb7de('0x3d')]['create'](_0xee855f[_0xb7de('0x49')],{})[_0xb7de('0x21')](function(_0x5ec4f4){var _0x375729=_0xee855f[_0xb7de('0x4a')][_0xb7de('0x23')]({'plain':!![]});if(!_0x375729)throw new Error(_0xb7de('0x4b'));if(_0x375729['role']===_0xb7de('0x4a')){var _0x237850=_0x5ec4f4[_0xb7de('0x23')]({'plain':!![]});var _0x17b8cc='Dispositions';return db['UserProfileSection'][_0xb7de('0x47')]({'where':{'name':_0x17b8cc,'userProfileId':_0x375729[_0xb7de('0x4c')]},'raw':!![]})[_0xb7de('0x21')](function(_0x5db32e){if(_0x5db32e&&_0x5db32e['autoAssociation']===0x0){return db[_0xb7de('0x25')][_0xb7de('0x48')]({'name':_0x237850[_0xb7de('0x27')],'resourceId':_0x237850['id'],'type':_0x5db32e['name'],'sectionId':_0x5db32e['id']},{})['then'](function(){return _0x5ec4f4;});}else{return _0x5ec4f4;}})[_0xb7de('0x42')](function(_0x351457){logger[_0xb7de('0x4d')](_0xb7de('0x4e'),_0x351457);throw _0x351457;});}return _0x5ec4f4;})[_0xb7de('0x21')](respondWithResult(_0x2d0b43,0xc9))['catch'](handleError(_0x2d0b43,null));};exports[_0xb7de('0x20')]=function(_0x2f1ec2,_0x1474b9){if(_0x2f1ec2[_0xb7de('0x49')]['id']){delete _0x2f1ec2[_0xb7de('0x49')]['id'];}return db[_0xb7de('0x3d')][_0xb7de('0x47')]({'where':{'id':_0x2f1ec2['params']['id']}})['then'](handleEntityNotFound(_0x1474b9,null))['then'](saveUpdates(_0x2f1ec2[_0xb7de('0x49')],null))['then'](respondWithResult(_0x1474b9,null))[_0xb7de('0x42')](handleError(_0x1474b9,null));};exports[_0xb7de('0x22')]=function(_0xe8dacc,_0x567571){return db['Disposition'][_0xb7de('0x47')]({'where':{'id':_0xe8dacc[_0xb7de('0x44')]['id']}})[_0xb7de('0x21')](handleEntityNotFound(_0x567571,null))['then'](removeEntity(_0x567571,null))[_0xb7de('0x42')](handleError(_0x567571,null));}; \ No newline at end of file +var _0x39bb=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','include','findAll','show','params','intersection','find','catch','create','body','user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x39bb,0x1f4));var _0xb39b=function(_0x252834,_0x55f763){_0x252834=_0x252834-0x0;var _0x58c864=_0x39bb[_0x252834];return _0x58c864;};'use strict';var emlformat=require(_0xb39b('0x0'));var rimraf=require(_0xb39b('0x1'));var zipdir=require(_0xb39b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb39b('0x3'));var moment=require('moment');var BPromise=require(_0xb39b('0x4'));var Mustache=require(_0xb39b('0x5'));var util=require(_0xb39b('0x6'));var path=require(_0xb39b('0x7'));var sox=require(_0xb39b('0x8'));var csv=require(_0xb39b('0x9'));var ejs=require(_0xb39b('0xa'));var fs=require('fs');var fs_extra=require(_0xb39b('0xb'));var _=require(_0xb39b('0xc'));var squel=require(_0xb39b('0xd'));var crypto=require(_0xb39b('0xe'));var jsforce=require(_0xb39b('0xf'));var deskjs=require(_0xb39b('0x10'));var toCsv=require(_0xb39b('0x9'));var querystring=require('querystring');var Papa=require(_0xb39b('0x11'));var Redis=require(_0xb39b('0x12'));var authService=require(_0xb39b('0x13'));var qs=require(_0xb39b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39b('0x15'));var logger=require(_0xb39b('0x16'))(_0xb39b('0x17'));var utils=require(_0xb39b('0x18'));var config=require(_0xb39b('0x19'));var licenseUtil=require(_0xb39b('0x1a'));var db=require(_0xb39b('0x1b'))['db'];function respondWithStatusCode(_0xcd1463,_0xda33d8){_0xda33d8=_0xda33d8||0xcc;return function(_0x17ed6a){if(_0x17ed6a){return _0xcd1463[_0xb39b('0x1c')](_0xda33d8);}return _0xcd1463[_0xb39b('0x1d')](_0xda33d8)[_0xb39b('0x1e')]();};}function respondWithResult(_0x27ff7b,_0x1ea7a4){_0x1ea7a4=_0x1ea7a4||0xc8;return function(_0xd90ee4){if(_0xd90ee4){return _0x27ff7b[_0xb39b('0x1d')](_0x1ea7a4)[_0xb39b('0x1f')](_0xd90ee4);}};}function respondWithFilteredResult(_0x4843a9,_0x2f39bd){return function(_0x1f5f83){if(_0x1f5f83){var _0x1e1f51=typeof _0x2f39bd[_0xb39b('0x20')]===_0xb39b('0x21')&&typeof _0x2f39bd[_0xb39b('0x22')]===_0xb39b('0x21');var _0x4c0c24=_0x1f5f83[_0xb39b('0x23')];var _0xe7dba3=_0x1e1f51?0x0:_0x2f39bd['offset'];var _0x39c03c=_0x1e1f51?_0x1f5f83['count']:_0x2f39bd[_0xb39b('0x20')]+_0x2f39bd[_0xb39b('0x22')];var _0xb24a11;if(_0x39c03c>=_0x4c0c24){_0x39c03c=_0x4c0c24;_0xb24a11=0xc8;}else{_0xb24a11=0xce;}_0x4843a9[_0xb39b('0x1d')](_0xb24a11);return _0x4843a9[_0xb39b('0x24')]('Content-Range',_0xe7dba3+'-'+_0x39c03c+'/'+_0x4c0c24)[_0xb39b('0x1f')](_0x1f5f83);}return null;};}function patchUpdates(_0x14c2d6){return function(_0x3e5818){try{jsonpatch['apply'](_0x3e5818,_0x14c2d6,!![]);}catch(_0x44d772){return BPromise[_0xb39b('0x25')](_0x44d772);}return _0x3e5818['save']();};}function saveUpdates(_0x532395,_0x328e3f){return function(_0x322d93){if(_0x322d93){return _0x322d93['update'](_0x532395)[_0xb39b('0x26')](function(_0x1a9b6c){return _0x1a9b6c;});}return null;};}function removeEntity(_0x5d7b0d,_0x261935){return function(_0x2f702f){if(_0x2f702f){return _0x2f702f['destroy']()[_0xb39b('0x26')](function(){var _0x482513=_0x2f702f[_0xb39b('0x27')]({'plain':!![]});var _0x561615='Dispositions';return db[_0xb39b('0x28')][_0xb39b('0x29')]({'where':{'type':_0x561615,'resourceId':_0x482513['id']}})[_0xb39b('0x26')](function(){return _0x2f702f;});})['then'](function(){_0x5d7b0d[_0xb39b('0x1d')](0xcc)[_0xb39b('0x1e')]();});}};}function handleEntityNotFound(_0x1b57d4,_0x2bb8d8){return function(_0x313b97){if(!_0x313b97){_0x1b57d4[_0xb39b('0x1c')](0x194);}return _0x313b97;};}function handleError(_0x505a64,_0xeb1057){_0xeb1057=_0xeb1057||0x1f4;return function(_0x1bd258){logger[_0xb39b('0x2a')](_0x1bd258[_0xb39b('0x2b')]);if(_0x1bd258['name']){delete _0x1bd258[_0xb39b('0x2c')];}_0x505a64[_0xb39b('0x1d')](_0xeb1057)[_0xb39b('0x2d')](_0x1bd258);};}exports[_0xb39b('0x2e')]=function(_0x2bd589,_0x4c1d21){var _0x443b82={},_0x444994={},_0x5195b8={'count':0x0,'rows':[]};var _0x352b51=_[_0xb39b('0x2f')](db[_0xb39b('0x30')][_0xb39b('0x31')],function(_0x1316ef){return{'name':_0x1316ef[_0xb39b('0x32')],'type':_0x1316ef['type'][_0xb39b('0x33')]};});_0x444994[_0xb39b('0x34')]=_['map'](_0x352b51,'name');_0x444994[_0xb39b('0x35')]=_[_0xb39b('0x36')](_0x2bd589[_0xb39b('0x35')]);_0x444994['filters']=_['intersection'](_0x444994['model'],_0x444994['query']);_0x443b82['attributes']=_['intersection'](_0x444994['model'],qs[_0xb39b('0x37')](_0x2bd589[_0xb39b('0x35')]['fields']));_0x443b82[_0xb39b('0x38')]=_0x443b82[_0xb39b('0x38')][_0xb39b('0x39')]?_0x443b82[_0xb39b('0x38')]:_0x444994[_0xb39b('0x34')];if(!_0x2bd589[_0xb39b('0x35')][_0xb39b('0x3a')](_0xb39b('0x3b'))){_0x443b82['limit']=qs[_0xb39b('0x22')](_0x2bd589[_0xb39b('0x35')][_0xb39b('0x22')]);_0x443b82[_0xb39b('0x20')]=qs[_0xb39b('0x20')](_0x2bd589[_0xb39b('0x35')][_0xb39b('0x20')]);}_0x443b82[_0xb39b('0x3c')]=qs['sort'](_0x2bd589[_0xb39b('0x35')][_0xb39b('0x3d')]);_0x443b82[_0xb39b('0x3e')]=qs[_0xb39b('0x3f')](_[_0xb39b('0x40')](_0x2bd589[_0xb39b('0x35')],_0x444994[_0xb39b('0x3f')]),_0x352b51);if(_0x2bd589[_0xb39b('0x35')][_0xb39b('0x41')]){_0x443b82[_0xb39b('0x3e')]=_['merge'](_0x443b82['where'],{'$or':_[_0xb39b('0x2f')](_0x352b51,function(_0x25d6b6){if(_0x25d6b6[_0xb39b('0x42')]!=='VIRTUAL'){var _0x251ae8={};_0x251ae8[_0x25d6b6['name']]={'$like':'%'+_0x2bd589[_0xb39b('0x35')]['filter']+'%'};return _0x251ae8;}})});}_0x443b82=_[_0xb39b('0x43')]({},_0x443b82,_0x2bd589['options']);var _0x487ded={'where':_0x443b82[_0xb39b('0x3e')]};return db[_0xb39b('0x30')][_0xb39b('0x23')](_0x487ded)[_0xb39b('0x26')](function(_0x4d6462){_0x5195b8['count']=_0x4d6462;if(_0x2bd589[_0xb39b('0x35')]['includeAll']){_0x443b82[_0xb39b('0x44')]=[{'all':!![]}];}return db[_0xb39b('0x30')][_0xb39b('0x45')](_0x443b82);})[_0xb39b('0x26')](function(_0x3e9db1){_0x5195b8['rows']=_0x3e9db1;return _0x5195b8;})['then'](respondWithFilteredResult(_0x4c1d21,_0x443b82))['catch'](handleError(_0x4c1d21,null));};exports[_0xb39b('0x46')]=function(_0xf63c35,_0x538265){var _0x53b85a={'raw':!![],'where':{'id':_0xf63c35[_0xb39b('0x47')]['id']}},_0x527121={};_0x527121[_0xb39b('0x34')]=_[_0xb39b('0x36')](db['Disposition']['rawAttributes']);_0x527121[_0xb39b('0x35')]=_[_0xb39b('0x36')](_0xf63c35['query']);_0x527121[_0xb39b('0x3f')]=_[_0xb39b('0x48')](_0x527121[_0xb39b('0x34')],_0x527121['query']);_0x53b85a[_0xb39b('0x38')]=_[_0xb39b('0x48')](_0x527121[_0xb39b('0x34')],qs[_0xb39b('0x37')](_0xf63c35[_0xb39b('0x35')][_0xb39b('0x37')]));_0x53b85a[_0xb39b('0x38')]=_0x53b85a['attributes'][_0xb39b('0x39')]?_0x53b85a['attributes']:_0x527121['model'];if(_0xf63c35[_0xb39b('0x35')]['includeAll']){_0x53b85a[_0xb39b('0x44')]=[{'all':!![]}];}_0x53b85a=_[_0xb39b('0x43')]({},_0x53b85a,_0xf63c35['options']);return db[_0xb39b('0x30')][_0xb39b('0x49')](_0x53b85a)[_0xb39b('0x26')](handleEntityNotFound(_0x538265,null))[_0xb39b('0x26')](respondWithResult(_0x538265,null))[_0xb39b('0x4a')](handleError(_0x538265,null));};exports[_0xb39b('0x4b')]=function(_0x53e82a,_0x313a20){return db['Disposition']['create'](_0x53e82a[_0xb39b('0x4c')],{})[_0xb39b('0x26')](function(_0x97e609){var _0x5c14ac=_0x53e82a[_0xb39b('0x4d')][_0xb39b('0x27')]({'plain':!![]});if(!_0x5c14ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c14ac[_0xb39b('0x4e')]==='user'){var _0x4da9ee=_0x97e609[_0xb39b('0x27')]({'plain':!![]});var _0x5ca290=_0xb39b('0x4f');return db[_0xb39b('0x50')][_0xb39b('0x49')]({'where':{'name':_0x5ca290,'userProfileId':_0x5c14ac[_0xb39b('0x51')]},'raw':!![]})[_0xb39b('0x26')](function(_0x303316){if(_0x303316&&_0x303316[_0xb39b('0x52')]===0x0){return db[_0xb39b('0x28')][_0xb39b('0x4b')]({'name':_0x4da9ee[_0xb39b('0x2c')],'resourceId':_0x4da9ee['id'],'type':_0x303316['name'],'sectionId':_0x303316['id']},{})['then'](function(){return _0x97e609;});}else{return _0x97e609;}})[_0xb39b('0x4a')](function(_0x18c83e){logger[_0xb39b('0x2a')](_0xb39b('0x53'),_0x18c83e);throw _0x18c83e;});}return _0x97e609;})[_0xb39b('0x26')](respondWithResult(_0x313a20,0xc9))['catch'](handleError(_0x313a20,null));};exports[_0xb39b('0x54')]=function(_0x26d2fc,_0x1e6db9){if(_0x26d2fc[_0xb39b('0x4c')]['id']){delete _0x26d2fc['body']['id'];}return db[_0xb39b('0x30')][_0xb39b('0x49')]({'where':{'id':_0x26d2fc[_0xb39b('0x47')]['id']}})[_0xb39b('0x26')](handleEntityNotFound(_0x1e6db9,null))[_0xb39b('0x26')](saveUpdates(_0x26d2fc['body'],null))[_0xb39b('0x26')](respondWithResult(_0x1e6db9,null))['catch'](handleError(_0x1e6db9,null));};exports['destroy']=function(_0x517e84,_0x1aaaff){return db['Disposition'][_0xb39b('0x49')]({'where':{'id':_0x517e84['params']['id']}})[_0xb39b('0x26')](handleEntityNotFound(_0x1aaaff,null))[_0xb39b('0x26')](removeEntity(_0x1aaaff,null))[_0xb39b('0x4a')](handleError(_0x1aaaff,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3fa61cc..29a3784 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 _0x3a91=['rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x420e47,_0x15ab9a){var _0x598f2f=function(_0x14dcfe){while(--_0x14dcfe){_0x420e47['push'](_0x420e47['shift']());}};_0x598f2f(++_0x15ab9a);}(_0x3a91,0x173));var _0x13a9=function(_0x521cca,_0x1f42c2){_0x521cca=_0x521cca-0x0;var _0x9735a7=_0x3a91[_0x521cca];return _0x9735a7;};'use strict';var _=require(_0x13a9('0x0'));var util=require(_0x13a9('0x1'));var logger=require(_0x13a9('0x2'))('api');var moment=require(_0x13a9('0x3'));var BPromise=require(_0x13a9('0x4'));var rp=require(_0x13a9('0x5'));var fs=require('fs');var path=require(_0x13a9('0x6'));var rimraf=require(_0x13a9('0x7'));var config=require('../../config/environment');var attributes=require(_0x13a9('0x8'));module[_0x13a9('0x9')]=function(_0x5d0e20,_0x494d3d){return _0x5d0e20['define'](_0x13a9('0xa'),attributes,{'tableName':_0x13a9('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x13a9('0xc'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x13a9('0xc'),_0x13a9('0xd')]},{'unique':!![],'name':_0x13a9('0xe'),'fields':['name',_0x13a9('0xf')]},{'unique':!![],'name':_0x13a9('0x10'),'fields':['name',_0x13a9('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x13a9('0xc'),_0x13a9('0x12')]},{'unique':!![],'name':_0x13a9('0x13'),'fields':[_0x13a9('0xc'),_0x13a9('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf065=['define','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','exports'];(function(_0x5b6d17,_0x153be1){var _0x2bf9c8=function(_0x4c1bb2){while(--_0x4c1bb2){_0x5b6d17['push'](_0x5b6d17['shift']());}};_0x2bf9c8(++_0x153be1);}(_0xf065,0x139));var _0x5f06=function(_0x38ed9a,_0x472fc0){_0x38ed9a=_0x38ed9a-0x0;var _0x21bf38=_0xf065[_0x38ed9a];return _0x21bf38;};'use strict';var _=require(_0x5f06('0x0'));var util=require('util');var logger=require(_0x5f06('0x1'))(_0x5f06('0x2'));var moment=require('moment');var BPromise=require(_0x5f06('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5f06('0x4'));var config=require(_0x5f06('0x5'));var attributes=require('./disposition.attributes');module[_0x5f06('0x6')]=function(_0x207108,_0x525caa){return _0x207108[_0x5f06('0x7')]('Disposition',attributes,{'tableName':_0x5f06('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x5f06('0x9'),_0x5f06('0xa')]},{'unique':!![],'name':_0x5f06('0xb'),'fields':['name',_0x5f06('0xc')]},{'unique':!![],'name':_0x5f06('0xd'),'fields':[_0x5f06('0x9'),_0x5f06('0xe')]},{'unique':!![],'name':'name_sms','fields':[_0x5f06('0x9'),'SmsAccountId']},{'unique':!![],'name':_0x5f06('0xf'),'fields':['name',_0x5f06('0x10')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x5f06('0x11')]},{'unique':!![],'name':_0x5f06('0x12'),'fields':[_0x5f06('0x9'),_0x5f06('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 71e06e6..9506303 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(_0x4fd0ef,_0x308e95){var _0x241919=function(_0x11124f){while(--_0x11124f){_0x4fd0ef['push'](_0x4fd0ef['shift']());}};_0x241919(++_0x308e95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3fd8a4,_0x150691){var _0x502f14=function(_0x3966d6){while(--_0x3966d6){_0x3fd8a4['push'](_0x3fd8a4['shift']());}};_0x502f14(++_0x150691);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 30803b7..486c857 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 _0x6333=['./disposition.controller','get','/:id','isAuthenticated','update','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x55e790,_0x3529d0){var _0x36b1bf=function(_0x485f9e){while(--_0x485f9e){_0x55e790['push'](_0x55e790['shift']());}};_0x36b1bf(++_0x3529d0);}(_0x6333,0x83));var _0x3633=function(_0x20dc06,_0x545550){_0x20dc06=_0x20dc06-0x0;var _0x4169d9=_0x6333[_0x20dc06];return _0x4169d9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3633('0x0'));var express=require('express');var router=express[_0x3633('0x1')]();var fs_extra=require(_0x3633('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3633('0x3'));var config=require('../../config/environment');var controller=require(_0x3633('0x4'));router[_0x3633('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3633('0x5')](_0x3633('0x6'),auth[_0x3633('0x7')](),controller['show']);router['post']('/',auth[_0x3633('0x7')](),controller['create']);router['put'](_0x3633('0x6'),auth[_0x3633('0x7')](),controller[_0x3633('0x8')]);router['delete'](_0x3633('0x6'),auth[_0x3633('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9d3d=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9d3d,0x77));var _0xd9d3=function(_0x2711b4,_0x3bcdab){_0x2711b4=_0x2711b4-0x0;var _0x2ee5e6=_0x9d3d[_0x2711b4];return _0x2ee5e6;};'use strict';var multer=require(_0xd9d3('0x0'));var util=require(_0xd9d3('0x1'));var path=require(_0xd9d3('0x2'));var timeout=require(_0xd9d3('0x3'));var express=require(_0xd9d3('0x4'));var router=express['Router']();var fs_extra=require(_0xd9d3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9d3('0x6'));var controller=require(_0xd9d3('0x7'));router[_0xd9d3('0x8')]('/',auth[_0xd9d3('0x9')](),controller[_0xd9d3('0xa')]);router[_0xd9d3('0x8')](_0xd9d3('0xb'),auth[_0xd9d3('0x9')](),controller['show']);router[_0xd9d3('0xc')]('/',auth[_0xd9d3('0x9')](),controller[_0xd9d3('0xd')]);router[_0xd9d3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd9d3('0xf')]);router[_0xd9d3('0x10')]('/:id',auth[_0xd9d3('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 019599e..0ba0d51 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 _0x1864=['SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','14400','9600','v17,v27,v29'];(function(_0x40668c,_0x51fd46){var _0x469357=function(_0x2a6edb){while(--_0x2a6edb){_0x40668c['push'](_0x40668c['shift']());}};_0x469357(++_0x51fd46);}(_0x1864,0x17b));var _0x4186=function(_0x545dbe,_0x55d098){_0x545dbe=_0x545dbe-0x0;var _0x20bfcb=_0x1864[_0x545dbe];return _0x20bfcb;};'use strict';var Sequelize=require(_0x4186('0x0'));module[_0x4186('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4186('0x2')]},'ecm':{'type':Sequelize[_0x4186('0x3')]('yes','no'),'defaultValue':_0x4186('0x4')},'headerinfo':{'type':Sequelize[_0x4186('0x2')],'defaultValue':_0x4186('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x4186('0x3')](_0x4186('0x6'),_0x4186('0x7'),_0x4186('0x8'),'9600','12000',_0x4186('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x4186('0x3')](_0x4186('0x6'),_0x4186('0x7'),'7200',_0x4186('0xa'),'12000',_0x4186('0x9')),'defaultValue':_0x4186('0x9')},'modem':{'type':Sequelize[_0x4186('0x2')],'defaultValue':_0x4186('0xb')},'gateway':{'type':Sequelize[_0x4186('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4186('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4186('0x3')](_0x4186('0xc'),_0x4186('0xd'),_0x4186('0xe'),_0x4186('0xf')),'defaultValue':_0x4186('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4186('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4186('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4186('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4186('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4186('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4186('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4186('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4186('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4186('0x11')],'defaultValue':![],'comment':_0x4186('0x14'),'set':function(_0x401859){if(!_0x401859)this['setDataValue'](_0x4186('0x15'),null);this['setDataValue'](_0x4186('0x16'),_0x401859);}}}; \ No newline at end of file +var _0x7aae=['2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','yes','localstationid','ENUM'];(function(_0x347340,_0x1e0356){var _0x265841=function(_0x4eccfe){while(--_0x4eccfe){_0x347340['push'](_0x347340['shift']());}};_0x265841(++_0x1e0356);}(_0x7aae,0x1c7));var _0xe7aa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7aae[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xe7aa('0x0'));module['exports']={'name':{'type':Sequelize[_0xe7aa('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe7aa('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xe7aa('0x2'),'no'),'defaultValue':_0xe7aa('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xe7aa('0x1')],'unique':_0xe7aa('0x3')},'minrate':{'type':Sequelize[_0xe7aa('0x4')](_0xe7aa('0x5'),_0xe7aa('0x6'),_0xe7aa('0x7'),_0xe7aa('0x8'),'12000',_0xe7aa('0x9')),'defaultValue':_0xe7aa('0x6')},'maxrate':{'type':Sequelize[_0xe7aa('0x4')]('2400',_0xe7aa('0x6'),_0xe7aa('0x7'),_0xe7aa('0x8'),_0xe7aa('0xa'),_0xe7aa('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xe7aa('0x1')],'defaultValue':_0xe7aa('0xb')},'gateway':{'type':Sequelize[_0xe7aa('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe7aa('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xe7aa('0xd'),_0xe7aa('0xe'),'DADHI','KHOMP'),'defaultValue':_0xe7aa('0xd')},'key':{'type':Sequelize[_0xe7aa('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe7aa('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe7aa('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe7aa('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe7aa('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe7aa('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe7aa('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe7aa('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe7aa('0x10')],'defaultValue':![],'comment':_0xe7aa('0x11'),'set':function(_0x7d5f04){if(!_0x7d5f04)this[_0xe7aa('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xe7aa('0x13'),_0x7d5f04);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6dc74e6..f4e1b33 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 _0x9094=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','length','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','send','getApplications','context','from-voip-provider','exten','app','system','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','localstationid','gateway','faxdetect','maxrate','modem','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','update','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','json','undefined','offset','limit','set','Content-Range','reject','save','destroy','get','FaxAccounts','UserProfileResource','end','sendStatus','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','show','params','rawAttributes','options'];(function(_0x2f1099,_0x4c24ab){var _0x7564ca=function(_0x373e09){while(--_0x373e09){_0x2f1099['push'](_0x2f1099['shift']());}};_0x7564ca(++_0x4c24ab);}(_0x9094,0x137));var _0x4909=function(_0x356175,_0x4bf5d5){_0x356175=_0x356175-0x0;var _0x200ed5=_0x9094[_0x356175];return _0x200ed5;};'use strict';var emlformat=require(_0x4909('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4909('0x1'));var rp=require(_0x4909('0x2'));var moment=require(_0x4909('0x3'));var BPromise=require(_0x4909('0x4'));var Mustache=require(_0x4909('0x5'));var util=require(_0x4909('0x6'));var path=require('path');var sox=require(_0x4909('0x7'));var csv=require(_0x4909('0x8'));var ejs=require(_0x4909('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4909('0xa'));var squel=require(_0x4909('0xb'));var crypto=require(_0x4909('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4909('0xd'));var toCsv=require(_0x4909('0x8'));var querystring=require(_0x4909('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4909('0xf'));var qs=require(_0x4909('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4909('0x11'))(_0x4909('0x12'));var utils=require(_0x4909('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4909('0x14'))['db'];config[_0x4909('0x15')]=_[_0x4909('0x16')](config[_0x4909('0x15')],{'host':_0x4909('0x17'),'port':0x18eb});var socket=require(_0x4909('0x18'))(new Redis(config[_0x4909('0x15')]));require(_0x4909('0x19'))[_0x4909('0x1a')](socket);var jayson=require(_0x4909('0x1b'));var client=jayson[_0x4909('0x1c')][_0x4909('0x1d')]({'port':0x232c});var client9002=jayson[_0x4909('0x1c')][_0x4909('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x469148,_0x4f3448,_0x5ba275,_0x7a3087){return new BPromise(function(_0x1a4dcb,_0x14e404){var _0x26c880=_0x7a3087||client;return _0x26c880[_0x4909('0x1e')](_0x469148,_0x5ba275)[_0x4909('0x1f')](function(_0x281609){logger[_0x4909('0x20')](_0x4909('0x21'),_0x4f3448,_0x4909('0x22'));logger[_0x4909('0x23')](_0x4909('0x24'),_0x4f3448,'request\x20sent',JSON['stringify'](_0x281609));if(_0x281609['error']){if(_0x281609[_0x4909('0x25')][_0x4909('0x26')]===0x1f4){logger[_0x4909('0x25')](_0x4909('0x21'),_0x4f3448,_0x281609[_0x4909('0x25')][_0x4909('0x27')]);return _0x14e404(_0x281609['error'][_0x4909('0x27')]);}logger[_0x4909('0x25')](_0x4909('0x21'),_0x4f3448,_0x281609[_0x4909('0x25')][_0x4909('0x27')]);return _0x1a4dcb(_0x281609[_0x4909('0x25')][_0x4909('0x27')]);}else{logger['info'](_0x4909('0x21'),_0x4f3448,_0x4909('0x22'));_0x1a4dcb(_0x281609['result']['message']);}})[_0x4909('0x28')](function(_0x4585e0){logger['error'](_0x4909('0x21'),_0x4f3448,_0x4585e0);_0x14e404(_0x4585e0);});});}function respondWithStatusCode(_0x4f2b52,_0x4c35ac){_0x4c35ac=_0x4c35ac||0xcc;return function(_0x2a41e0){if(_0x2a41e0){return _0x4f2b52['sendStatus'](_0x4c35ac);}return _0x4f2b52[_0x4909('0x29')](_0x4c35ac)['end']();};}function respondWithResult(_0x3a88d1,_0x1136a4){_0x1136a4=_0x1136a4||0xc8;return function(_0x41c37c){if(_0x41c37c){return _0x3a88d1[_0x4909('0x29')](_0x1136a4)[_0x4909('0x2a')](_0x41c37c);}};}function respondWithFilteredResult(_0x636014,_0x506ae8){return function(_0x59ecca){if(_0x59ecca){var _0x3ba7f4=typeof _0x506ae8['offset']===_0x4909('0x2b')&&typeof _0x506ae8['limit']===_0x4909('0x2b');var _0x906065=_0x59ecca['count'];var _0xa62e62=_0x3ba7f4?0x0:_0x506ae8[_0x4909('0x2c')];var _0x12d5b6=_0x3ba7f4?_0x59ecca['count']:_0x506ae8[_0x4909('0x2c')]+_0x506ae8[_0x4909('0x2d')];var _0x17aab5;if(_0x12d5b6>=_0x906065){_0x12d5b6=_0x906065;_0x17aab5=0xc8;}else{_0x17aab5=0xce;}_0x636014[_0x4909('0x29')](_0x17aab5);return _0x636014[_0x4909('0x2e')](_0x4909('0x2f'),_0xa62e62+'-'+_0x12d5b6+'/'+_0x906065)[_0x4909('0x2a')](_0x59ecca);}return null;};}function patchUpdates(_0x2843b2){return function(_0x3e4867){try{jsonpatch['apply'](_0x3e4867,_0x2843b2,!![]);}catch(_0x485c4f){return BPromise[_0x4909('0x30')](_0x485c4f);}return _0x3e4867[_0x4909('0x31')]();};}function saveUpdates(_0x5affd6,_0x46902a){return function(_0x52ed88){if(_0x52ed88){return _0x52ed88['update'](_0x5affd6)[_0x4909('0x1f')](function(_0x22eda0){return _0x22eda0;});}return null;};}function removeEntity(_0xf543f1,_0x5b0bed){return function(_0x42912d){if(_0x42912d){return _0x42912d[_0x4909('0x32')]()[_0x4909('0x1f')](function(){var _0x32e0cd=_0x42912d[_0x4909('0x33')]({'plain':!![]});var _0x2b37aa=_0x4909('0x34');return db[_0x4909('0x35')]['destroy']({'where':{'type':_0x2b37aa,'resourceId':_0x32e0cd['id']}})[_0x4909('0x1f')](function(){return _0x42912d;});})[_0x4909('0x1f')](function(){_0xf543f1['status'](0xcc)[_0x4909('0x36')]();});}};}function handleEntityNotFound(_0x59d354,_0x398a42){return function(_0x8382ba){if(!_0x8382ba){_0x59d354[_0x4909('0x37')](0x194);}return _0x8382ba;};}function handleError(_0x2e7146,_0x30292c){_0x30292c=_0x30292c||0x1f4;return function(_0x226ec6){logger[_0x4909('0x25')](_0x226ec6['stack']);if(_0x226ec6[_0x4909('0x38')]){delete _0x226ec6[_0x4909('0x38')];}_0x2e7146[_0x4909('0x29')](_0x30292c)['send'](_0x226ec6);};}exports[_0x4909('0x39')]=function(_0x278c66,_0x5b1537){var _0x5d1d8b={'include':[{'model':db[_0x4909('0x3a')],'as':_0x4909('0x3b')}]},_0x5daf58={},_0x7fbdbc={'count':0x0,'rows':[]};var _0x219817=_[_0x4909('0x3c')](db[_0x4909('0x3d')]['rawAttributes'],function(_0xdf5121){return{'name':_0xdf5121[_0x4909('0x3e')],'type':_0xdf5121[_0x4909('0x3f')][_0x4909('0x40')]};});_0x5daf58[_0x4909('0x41')]=_['map'](_0x219817,_0x4909('0x38'));_0x5daf58['query']=_[_0x4909('0x42')](_0x278c66[_0x4909('0x43')]);_0x5daf58[_0x4909('0x44')]=_[_0x4909('0x45')](_0x5daf58[_0x4909('0x41')],_0x5daf58[_0x4909('0x43')]);_0x5d1d8b[_0x4909('0x46')]=_[_0x4909('0x45')](_0x5daf58['model'],qs[_0x4909('0x47')](_0x278c66[_0x4909('0x43')][_0x4909('0x47')]));_0x5d1d8b[_0x4909('0x46')]=_0x5d1d8b[_0x4909('0x46')]['length']?_0x5d1d8b[_0x4909('0x46')]:_0x5daf58[_0x4909('0x41')];if(!_0x278c66['query'][_0x4909('0x48')](_0x4909('0x49'))){_0x5d1d8b[_0x4909('0x2d')]=qs[_0x4909('0x2d')](_0x278c66[_0x4909('0x43')][_0x4909('0x2d')]);_0x5d1d8b[_0x4909('0x2c')]=qs[_0x4909('0x2c')](_0x278c66[_0x4909('0x43')][_0x4909('0x2c')]);}_0x5d1d8b[_0x4909('0x4a')]=qs[_0x4909('0x4b')](_0x278c66[_0x4909('0x43')]['sort']);_0x5d1d8b[_0x4909('0x4c')]=qs[_0x4909('0x44')](_[_0x4909('0x4d')](_0x278c66['query'],_0x5daf58['filters']),_0x219817);if(_0x278c66[_0x4909('0x43')][_0x4909('0x4e')]){_0x5d1d8b[_0x4909('0x4c')]=_['merge'](_0x5d1d8b[_0x4909('0x4c')],{'$or':_[_0x4909('0x3c')](_0x219817,function(_0x2e0df7){if(_0x2e0df7[_0x4909('0x3f')]!=='VIRTUAL'){var _0x346a09={};_0x346a09[_0x2e0df7['name']]={'$like':'%'+_0x278c66[_0x4909('0x43')][_0x4909('0x4e')]+'%'};return _0x346a09;}})});}_0x5d1d8b=_[_0x4909('0x4f')]({},_0x5d1d8b,_0x278c66['options']);var _0x4ea665={'where':_0x5d1d8b[_0x4909('0x4c')]};return db['FaxAccount'][_0x4909('0x50')](_0x4ea665)[_0x4909('0x1f')](function(_0x57b0e7){_0x7fbdbc['count']=_0x57b0e7;if(_0x278c66[_0x4909('0x43')][_0x4909('0x51')]){_0x5d1d8b[_0x4909('0x52')]=[{'all':!![]}];}return db[_0x4909('0x3d')][_0x4909('0x53')](_0x5d1d8b);})[_0x4909('0x1f')](function(_0x5967b9){_0x7fbdbc[_0x4909('0x54')]=_0x5967b9;return _0x7fbdbc;})[_0x4909('0x1f')](respondWithFilteredResult(_0x5b1537,_0x5d1d8b))[_0x4909('0x28')](handleError(_0x5b1537,null));};exports[_0x4909('0x55')]=function(_0x4850d5,_0x32d411){var _0x32b02a={'raw':![],'where':{'id':_0x4850d5[_0x4909('0x56')]['id']},'include':[{'model':db[_0x4909('0x3a')],'as':_0x4909('0x3b')}]},_0x2e7667={};_0x2e7667[_0x4909('0x41')]=_[_0x4909('0x42')](db['FaxAccount'][_0x4909('0x57')]);_0x2e7667[_0x4909('0x43')]=_[_0x4909('0x42')](_0x4850d5[_0x4909('0x43')]);_0x2e7667[_0x4909('0x44')]=_[_0x4909('0x45')](_0x2e7667[_0x4909('0x41')],_0x2e7667[_0x4909('0x43')]);_0x32b02a[_0x4909('0x46')]=_[_0x4909('0x45')](_0x2e7667[_0x4909('0x41')],qs['fields'](_0x4850d5[_0x4909('0x43')][_0x4909('0x47')]));_0x32b02a[_0x4909('0x46')]=_0x32b02a[_0x4909('0x46')]['length']?_0x32b02a['attributes']:_0x2e7667[_0x4909('0x41')];if(_0x4850d5['query']['includeAll']){_0x32b02a[_0x4909('0x52')]=[{'all':!![]}];}_0x32b02a=_[_0x4909('0x4f')]({},_0x32b02a,_0x4850d5[_0x4909('0x58')]);return db[_0x4909('0x3d')][_0x4909('0x59')](_0x32b02a)['then'](handleEntityNotFound(_0x32d411,null))[_0x4909('0x1f')](respondWithResult(_0x32d411,null))[_0x4909('0x28')](handleError(_0x32d411,null));};exports[_0x4909('0x5a')]=function(_0x849833,_0x6b7301){return db['FaxAccount'][_0x4909('0x5a')](_0x849833['body'],{})[_0x4909('0x1f')](function(_0x5646d6){var _0x12904b=_0x849833[_0x4909('0x5b')][_0x4909('0x33')]({'plain':!![]});if(!_0x12904b)throw new Error(_0x4909('0x5c'));if(_0x12904b[_0x4909('0x5d')]===_0x4909('0x5b')){var _0x2d17d0=_0x5646d6[_0x4909('0x33')]({'plain':!![]});var _0x266406=_0x4909('0x34');return db[_0x4909('0x5e')][_0x4909('0x59')]({'where':{'name':_0x266406,'userProfileId':_0x12904b[_0x4909('0x5f')]},'raw':!![]})['then'](function(_0x5d04f1){if(_0x5d04f1&&_0x5d04f1[_0x4909('0x60')]===0x0){return db[_0x4909('0x35')]['create']({'name':_0x2d17d0[_0x4909('0x38')],'resourceId':_0x2d17d0['id'],'type':_0x5d04f1[_0x4909('0x38')],'sectionId':_0x5d04f1['id']},{})[_0x4909('0x1f')](function(){return _0x5646d6;});}else{return _0x5646d6;}})[_0x4909('0x28')](function(_0x1e2322){logger[_0x4909('0x25')](_0x4909('0x61'),_0x1e2322);throw _0x1e2322;});}return _0x5646d6;})[_0x4909('0x1f')](respondWithResult(_0x6b7301,0xc9))[_0x4909('0x28')](handleError(_0x6b7301,null));};exports['update']=function(_0x93aa2c,_0x5abae4){if(_0x93aa2c['body']['id']){delete _0x93aa2c[_0x4909('0x62')]['id'];}return db[_0x4909('0x3d')][_0x4909('0x59')]({'where':{'id':_0x93aa2c[_0x4909('0x56')]['id']},'include':[{'model':db[_0x4909('0x3a')],'as':_0x4909('0x3b')}]})[_0x4909('0x1f')](handleEntityNotFound(_0x5abae4,null))[_0x4909('0x1f')](saveUpdates(_0x93aa2c[_0x4909('0x62')],null))[_0x4909('0x1f')](respondWithResult(_0x5abae4,null))[_0x4909('0x28')](handleError(_0x5abae4,null));};exports[_0x4909('0x32')]=function(_0x5f5cd8,_0x5bc13a){return db[_0x4909('0x3d')][_0x4909('0x59')]({'where':{'id':_0x5f5cd8[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x5bc13a,null))[_0x4909('0x1f')](removeEntity(_0x5bc13a,null))[_0x4909('0x28')](handleError(_0x5bc13a,null));};exports[_0x4909('0x63')]=function(_0x5bd752,_0x3196c4){return db[_0x4909('0x3d')]['describe']()['then'](respondWithResult(_0x3196c4,null))['catch'](handleError(_0x3196c4,null));};exports[_0x4909('0x64')]=function(_0x10ece2,_0x2852f6,_0x35a75d){if(_0x10ece2[_0x4909('0x62')]['id']){delete _0x10ece2['body']['id'];}return db['FaxAccount'][_0x4909('0x59')]({'where':{'id':_0x10ece2[_0x4909('0x56')]['id']}})['then'](handleEntityNotFound(_0x2852f6,null))[_0x4909('0x1f')](function(_0x3e3fc4){if(_0x3e3fc4){_0x10ece2[_0x4909('0x62')]['FaxAccountId']=_0x3e3fc4['id'];return db[_0x4909('0x65')][_0x4909('0x5a')](_0x10ece2[_0x4909('0x62')]);}})[_0x4909('0x1f')](respondWithResult(_0x2852f6,null))[_0x4909('0x28')](handleError(_0x2852f6,null));};exports[_0x4909('0x66')]=function(_0x4e071a,_0x365085,_0x520b5b){var _0x2628b5={'raw':![],'where':{}};var _0x6a9503={};var _0x57ff3f={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4909('0x67')]({'where':{'id':_0x4e071a['params']['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x365085,null))[_0x4909('0x1f')](function(_0x31ba5c){if(_0x31ba5c){_0x6a9503[_0x4909('0x41')]=_[_0x4909('0x42')](db[_0x4909('0x65')][_0x4909('0x57')]);_0x6a9503['query']=_[_0x4909('0x42')](_0x4e071a[_0x4909('0x43')]);_0x6a9503['filters']=_[_0x4909('0x45')](_0x6a9503[_0x4909('0x41')],_0x6a9503[_0x4909('0x43')]);_0x2628b5['attributes']=_['intersection'](_0x6a9503[_0x4909('0x41')],qs[_0x4909('0x47')](_0x4e071a[_0x4909('0x43')][_0x4909('0x47')]));_0x2628b5[_0x4909('0x46')]=_0x2628b5[_0x4909('0x46')][_0x4909('0x68')]?_0x2628b5[_0x4909('0x46')]:_0x6a9503[_0x4909('0x41')];if(!_0x4e071a[_0x4909('0x43')][_0x4909('0x48')](_0x4909('0x49'))){_0x2628b5[_0x4909('0x2d')]=qs[_0x4909('0x2d')](_0x4e071a['query']['limit']);_0x2628b5[_0x4909('0x2c')]=qs[_0x4909('0x2c')](_0x4e071a['query']['offset']);}_0x2628b5[_0x4909('0x4a')]=qs[_0x4909('0x4b')](_0x4e071a[_0x4909('0x43')][_0x4909('0x4b')]);_0x2628b5[_0x4909('0x4c')]=qs[_0x4909('0x44')](_[_0x4909('0x4d')](_0x4e071a[_0x4909('0x43')],_0x6a9503['filters']));_0x2628b5['where'][_0x4909('0x69')]=_0x31ba5c['id'];if(_0x4e071a[_0x4909('0x43')][_0x4909('0x4e')]){_0x2628b5[_0x4909('0x4c')]=_[_0x4909('0x4f')](_0x2628b5[_0x4909('0x4c')],{'$or':_[_0x4909('0x3c')](_0x2628b5[_0x4909('0x46')],function(_0x2a1b96){var _0x16832c={};_0x16832c[_0x2a1b96]={'$like':'%'+_0x4e071a[_0x4909('0x43')]['filter']+'%'};return _0x16832c;})});}_0x2628b5=_[_0x4909('0x4f')]({},_0x2628b5,_0x4e071a[_0x4909('0x58')]);return db[_0x4909('0x65')][_0x4909('0x50')]({'where':_0x2628b5[_0x4909('0x4c')]})[_0x4909('0x1f')](function(_0x542e39){_0x57ff3f[_0x4909('0x50')]=_0x542e39;if(_0x4e071a[_0x4909('0x43')]['includeAll']){_0x2628b5['include']=[{'all':!![]}];}return db[_0x4909('0x65')][_0x4909('0x53')](_0x2628b5);})['then'](function(_0x5eaf7e){_0x57ff3f['rows']=_0x5eaf7e;return _0x57ff3f;});}})[_0x4909('0x1f')](respondWithFilteredResult(_0x365085,_0x2628b5))[_0x4909('0x28')](handleError(_0x365085,null));};exports[_0x4909('0x6a')]=function(_0x49d561,_0x2fec4f,_0x3a697a){return db['FaxAccount'][_0x4909('0x59')]({'where':{'id':_0x49d561['params']['id']}})['then'](handleEntityNotFound(_0x2fec4f,null))[_0x4909('0x1f')](function(_0x1ab409){if(_0x1ab409){return _0x1ab409[_0x4909('0x6a')](_0x49d561[_0x4909('0x43')][_0x4909('0x6b')]);}})[_0x4909('0x1f')](respondWithStatusCode(_0x2fec4f,null))['catch'](handleError(_0x2fec4f,null));};exports[_0x4909('0x6c')]=function(_0x494ec2,_0x243c98,_0x187c3e){if(_0x494ec2[_0x4909('0x62')]['id']){delete _0x494ec2[_0x4909('0x62')]['id'];}return db['FaxAccount'][_0x4909('0x59')]({'where':{'id':_0x494ec2[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x243c98,null))[_0x4909('0x1f')](function(_0x2b3fc3){if(_0x2b3fc3){_0x494ec2['body'][_0x4909('0x69')]=_0x2b3fc3['id'];return db[_0x4909('0x6d')][_0x4909('0x5a')](_0x494ec2[_0x4909('0x62')]);}})[_0x4909('0x1f')](respondWithResult(_0x243c98,null))['catch'](handleError(_0x243c98,null));};exports['getAnswers']=function(_0x2fd937,_0x22d971,_0x1ce4e8){var _0x358d70={'raw':![],'where':{}};var _0x53678a={};var _0x226d71={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4909('0x67')]({'where':{'id':_0x2fd937[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x22d971,null))[_0x4909('0x1f')](function(_0xe2868c){if(_0xe2868c){_0x53678a[_0x4909('0x41')]=_[_0x4909('0x42')](db[_0x4909('0x6d')]['rawAttributes']);_0x53678a[_0x4909('0x43')]=_[_0x4909('0x42')](_0x2fd937['query']);_0x53678a['filters']=_[_0x4909('0x45')](_0x53678a[_0x4909('0x41')],_0x53678a[_0x4909('0x43')]);_0x358d70['attributes']=_['intersection'](_0x53678a['model'],qs['fields'](_0x2fd937[_0x4909('0x43')]['fields']));_0x358d70[_0x4909('0x46')]=_0x358d70[_0x4909('0x46')][_0x4909('0x68')]?_0x358d70[_0x4909('0x46')]:_0x53678a['model'];if(!_0x2fd937[_0x4909('0x43')][_0x4909('0x48')]('nolimit')){_0x358d70[_0x4909('0x2d')]=qs[_0x4909('0x2d')](_0x2fd937['query'][_0x4909('0x2d')]);_0x358d70[_0x4909('0x2c')]=qs[_0x4909('0x2c')](_0x2fd937['query'][_0x4909('0x2c')]);}_0x358d70[_0x4909('0x4a')]=qs['sort'](_0x2fd937[_0x4909('0x43')][_0x4909('0x4b')]);_0x358d70[_0x4909('0x4c')]=qs['filters'](_[_0x4909('0x4d')](_0x2fd937['query'],_0x53678a[_0x4909('0x44')]));_0x358d70[_0x4909('0x4c')][_0x4909('0x69')]=_0xe2868c['id'];if(_0x2fd937[_0x4909('0x43')][_0x4909('0x4e')]){_0x358d70[_0x4909('0x4c')]=_[_0x4909('0x4f')](_0x358d70[_0x4909('0x4c')],{'$or':_[_0x4909('0x3c')](_0x358d70['attributes'],function(_0xd9f79){var _0x3c134d={};_0x3c134d[_0xd9f79]={'$like':'%'+_0x2fd937[_0x4909('0x43')][_0x4909('0x4e')]+'%'};return _0x3c134d;})});}_0x358d70=_[_0x4909('0x4f')]({},_0x358d70,_0x2fd937['options']);return db[_0x4909('0x6d')][_0x4909('0x50')]({'where':_0x358d70['where']})['then'](function(_0x247864){_0x226d71[_0x4909('0x50')]=_0x247864;if(_0x2fd937['query'][_0x4909('0x51')]){_0x358d70[_0x4909('0x52')]=[{'all':!![]}];}return db[_0x4909('0x6d')][_0x4909('0x53')](_0x358d70);})[_0x4909('0x1f')](function(_0x29b7f5){_0x226d71[_0x4909('0x54')]=_0x29b7f5;return _0x226d71;});}})[_0x4909('0x1f')](respondWithFilteredResult(_0x22d971,_0x358d70))[_0x4909('0x28')](handleError(_0x22d971,null));};exports[_0x4909('0x6e')]=function(_0x43d395,_0x3993ed,_0x358f1e){return db[_0x4909('0x3d')][_0x4909('0x59')]({'where':{'id':_0x43d395[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x3993ed,null))[_0x4909('0x1f')](function(_0x377801){if(_0x377801){return _0x377801[_0x4909('0x6e')](_0x43d395[_0x4909('0x43')]['ids']);}})[_0x4909('0x1f')](respondWithStatusCode(_0x3993ed,null))['catch'](handleError(_0x3993ed,null));};exports[_0x4909('0x6f')]=function(_0x211144,_0x495e82,_0x32bc09){return db[_0x4909('0x70')][_0x4909('0x59')]({'where':{'id':_0x211144[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x495e82,null))[_0x4909('0x1f')](function(_0x2530a7){if(_0x2530a7){return _0x2530a7['addInteraction'](_0x211144[_0x4909('0x62')]['ids'],_[_0x4909('0x71')](_0x211144[_0x4909('0x62')],[_0x4909('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x495e82,null))[_0x4909('0x28')](handleError(_0x495e82,null));};exports[_0x4909('0x72')]=function(_0x55308a,_0x19701b,_0x2c92ee){var _0x2e53fe={'raw':![],'where':{}};var _0x258c62={};var _0x2ebf0c={'count':0x0,'rows':[]};return db[_0x4909('0x3d')][_0x4909('0x67')]({'where':{'id':_0x55308a['params']['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x19701b,null))['then'](function(_0x4e0f3b){if(_0x4e0f3b){_0x258c62[_0x4909('0x41')]=_[_0x4909('0x42')](db[_0x4909('0x70')][_0x4909('0x57')]);_0x258c62['query']=_[_0x4909('0x42')](_0x55308a[_0x4909('0x43')]);_0x258c62['filters']=_[_0x4909('0x45')](_0x258c62[_0x4909('0x41')],_0x258c62['query']);_0x2e53fe['attributes']=_['intersection'](_0x258c62['model'],qs[_0x4909('0x47')](_0x55308a[_0x4909('0x43')]['fields']));_0x2e53fe['attributes']=_0x2e53fe['attributes']['length']?_0x2e53fe['attributes']:_0x258c62[_0x4909('0x41')];if(!_0x55308a[_0x4909('0x43')][_0x4909('0x48')]('nolimit')){_0x2e53fe['limit']=qs[_0x4909('0x2d')](_0x55308a['query'][_0x4909('0x2d')]);_0x2e53fe['offset']=qs['offset'](_0x55308a[_0x4909('0x43')][_0x4909('0x2c')]);}_0x2e53fe[_0x4909('0x4a')]=qs[_0x4909('0x4b')](_0x55308a[_0x4909('0x43')][_0x4909('0x4b')]);_0x2e53fe[_0x4909('0x4c')]=qs[_0x4909('0x44')](_['pick'](_0x55308a['query'],_0x258c62[_0x4909('0x44')]));_0x2e53fe[_0x4909('0x4c')][_0x4909('0x69')]=_0x4e0f3b['id'];if(_0x55308a[_0x4909('0x43')][_0x4909('0x4e')]){_0x2e53fe[_0x4909('0x4c')]=_[_0x4909('0x4f')](_0x2e53fe[_0x4909('0x4c')],{'$or':_[_0x4909('0x3c')](_0x2e53fe[_0x4909('0x46')],function(_0x4ad28a){var _0x13af26={};_0x13af26[_0x4ad28a]={'$like':'%'+_0x55308a[_0x4909('0x43')][_0x4909('0x4e')]+'%'};return _0x13af26;})});}_0x2e53fe=_['merge']({},_0x2e53fe,_0x55308a['options']);return db[_0x4909('0x70')][_0x4909('0x50')]({'where':_0x2e53fe[_0x4909('0x4c')]})[_0x4909('0x1f')](function(_0x5983f1){_0x2ebf0c[_0x4909('0x50')]=_0x5983f1;if(_0x55308a[_0x4909('0x43')][_0x4909('0x51')]){_0x2e53fe[_0x4909('0x52')]=[{'model':db[_0x4909('0x73')],'as':_0x4909('0x74'),'required':![]},{'model':db[_0x4909('0x75')],'as':_0x4909('0x76'),'attributes':[_0x4909('0x38'),_0x4909('0x77'),_0x4909('0x78')],'required':![]},{'model':db['Tag'],'as':_0x4909('0x79'),'attributes':['id',_0x4909('0x38'),_0x4909('0x7a')],'where':_0x55308a[_0x4909('0x43')][_0x4909('0x7b')]?{'id':_0x55308a[_0x4909('0x43')][_0x4909('0x7b')]}:undefined,'required':_0x55308a['query'][_0x4909('0x7b')]?!![]:![]}];}return db[_0x4909('0x70')][_0x4909('0x53')](_0x2e53fe);})['then'](function(_0x3422fc){_0x2ebf0c[_0x4909('0x54')]=_0x3422fc;return _0x2ebf0c;});}})[_0x4909('0x1f')](respondWithFilteredResult(_0x19701b,_0x2e53fe))[_0x4909('0x28')](handleError(_0x19701b,null));};exports[_0x4909('0x7c')]=function(_0x42908c,_0x1b871c){var _0x341e44=_0x42908c['params']['id'];var _0x2413e3=_0x42908c[_0x4909('0x62')];var _0x3bbfdb=0xc8;var _0x4bb451=null;return db[_0x4909('0x7d')][_0x4909('0x7e')]({'isolationLevel':db[_0x4909('0x7d')][_0x4909('0x7f')][_0x4909('0x80')][_0x4909('0x81')]},function(_0x24f685){return db['FaxAccount'][_0x4909('0x67')]({'where':{'id':_0x341e44},'transaction':_0x24f685})[_0x4909('0x1f')](function(_0x17b8fe){if(_0x17b8fe){return db['FaxApplication'][_0x4909('0x32')]({'where':{'FaxAccountId':_0x341e44},'transaction':_0x24f685})[_0x4909('0x1f')](function(){var _0x3bbc2d=_[_0x4909('0x3c')](_0x2413e3,function(_0x48620b){_0x48620b['FaxAccountId']=_0x341e44;return _0x48620b;});return db[_0x4909('0x82')][_0x4909('0x83')](_0x3bbc2d,{'transaction':_0x24f685});});}else{_0x3bbfdb=0x194;_0x4bb451=[];}});})[_0x4909('0x1f')](function(){if(_0x3bbfdb!==0x194){return db[_0x4909('0x82')][_0x4909('0x84')]({'where':{'FaxAccountId':_0x341e44},'order':_0x4909('0x85')})[_0x4909('0x1f')](function(_0x298661){_0x4bb451=_0x298661;});}})[_0x4909('0x28')](function(_0x42c12f){_0x3bbfdb=0x1f4;logger['error'](_0x42c12f[_0x4909('0x86')]);if(_0x42c12f[_0x4909('0x38')]){delete _0x42c12f[_0x4909('0x38')];}_0x4bb451=_0x42c12f;})[_0x4909('0x87')](function(){if(_0x4bb451===null){_0x1b871c[_0x4909('0x37')](_0x3bbfdb);}else{if(_0x3bbfdb===0x1f4){_0x1b871c['status'](_0x3bbfdb)[_0x4909('0x88')](_0x4bb451);}else{_0x1b871c[_0x4909('0x29')](_0x3bbfdb)['json'](_0x4bb451);}}});};exports[_0x4909('0x89')]=function(_0x371f1e,_0x212dc9,_0x295b66){var _0x33b798={};var _0x5c7bda={};var _0x44274f;var _0x4687d9;return db[_0x4909('0x3d')][_0x4909('0x67')]({'where':{'id':_0x371f1e[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x212dc9,null))['then'](function(_0x181cb3){if(_0x181cb3){_0x44274f=_0x181cb3;_0x5c7bda[_0x4909('0x41')]=_[_0x4909('0x42')](db['FaxApplication'][_0x4909('0x57')]);_0x5c7bda[_0x4909('0x43')]=_[_0x4909('0x42')](_0x371f1e['query']);_0x5c7bda[_0x4909('0x44')]=_['intersection'](_0x5c7bda[_0x4909('0x41')],_0x5c7bda[_0x4909('0x43')]);_0x33b798[_0x4909('0x46')]=_[_0x4909('0x45')](_0x5c7bda[_0x4909('0x41')],qs['fields'](_0x371f1e[_0x4909('0x43')][_0x4909('0x47')]));_0x33b798[_0x4909('0x46')]=_0x33b798['attributes'][_0x4909('0x68')]?_0x33b798[_0x4909('0x46')]:_0x5c7bda[_0x4909('0x41')];_0x33b798['order']=qs['sort'](_0x371f1e['query']['sort']);_0x33b798[_0x4909('0x4c')]=qs[_0x4909('0x44')](_[_0x4909('0x4d')](_0x371f1e[_0x4909('0x43')],_0x5c7bda['filters']));if(_0x371f1e[_0x4909('0x43')][_0x4909('0x4e')]){_0x33b798[_0x4909('0x4c')]=_[_0x4909('0x4f')](_0x33b798[_0x4909('0x4c')],{'$or':_[_0x4909('0x3c')](_0x33b798[_0x4909('0x46')],function(_0x33cad1){var _0x22479e={};_0x22479e[_0x33cad1]={'$like':'%'+_0x371f1e[_0x4909('0x43')]['filter']+'%'};return _0x22479e;})});}_0x33b798=_[_0x4909('0x4f')]({},_0x33b798,_0x371f1e[_0x4909('0x58')]);return _0x44274f[_0x4909('0x89')](_0x33b798);}})['then'](function(_0x1107f3){if(_0x1107f3){_0x4687d9=_0x1107f3[_0x4909('0x68')];if(!_0x371f1e[_0x4909('0x43')]['hasOwnProperty'](_0x4909('0x49'))){_0x33b798['limit']=qs['limit'](_0x371f1e[_0x4909('0x43')][_0x4909('0x2d')]);_0x33b798[_0x4909('0x2c')]=qs[_0x4909('0x2c')](_0x371f1e['query'][_0x4909('0x2c')]);}return _0x44274f[_0x4909('0x89')](_0x33b798);}})[_0x4909('0x1f')](function(_0x3212e5){if(_0x3212e5){return _0x3212e5?{'count':_0x4687d9,'rows':_0x3212e5}:null;}})['then'](respondWithResult(_0x212dc9,null))[_0x4909('0x28')](handleError(_0x212dc9,null));};function Extension(_0x3124ba,_0x198161,_0x575eb2,_0x8bfbb){this[_0x4909('0x8a')]=_0x4909('0x8b');this[_0x4909('0x8c')]=_0x3124ba['localstationid'];this[_0x4909('0x8d')]=_0x8bfbb;this[_0x4909('0x3f')]=_0x4909('0x8e');this['description']=_0x4909('0x8f');this[_0x4909('0x69')]=_0x3124ba['id'];this[_0x4909('0x85')]=_0x198161;this['appdata']=_0x575eb2;}function createExtensionsReciveFax(_0x5a3b9c){var _0x481215=0x1;var _0x3a4034=[];_0x3a4034[_0x4909('0x90')](new Extension(_0x5a3b9c,_0x481215,'',_0x4909('0x91')));_0x481215+=0x1;_0x3a4034[_0x4909('0x90')](new Extension(_0x5a3b9c,_0x481215,_0x4909('0x92'),_0x4909('0x93')));_0x481215+=0x1;for(var _0x2eaa5b in _0x5a3b9c){if(_0x5a3b9c['hasOwnProperty'](_0x2eaa5b)&&(_0x2eaa5b==='ecm'||_0x2eaa5b===_0x4909('0x94')||_0x2eaa5b===_0x4909('0x95')||_0x2eaa5b===_0x4909('0x96')||_0x2eaa5b==='headerinfo'||_0x2eaa5b===_0x4909('0x97')||_0x2eaa5b==='minrate'||_0x2eaa5b===_0x4909('0x98')||_0x2eaa5b==='t38timeout')){_0x3a4034[_0x4909('0x90')](new Extension(_0x5a3b9c,_0x481215,_0x4909('0x99')+_0x2eaa5b+')='+_0x5a3b9c[_0x2eaa5b],_0x4909('0x93')));_0x481215+=0x1;}}_0x3a4034[_0x4909('0x90')](new Extension(_0x5a3b9c,_0x481215,'6',_0x4909('0x9a')));_0x481215+=0x1;_0x3a4034[_0x4909('0x90')](new Extension(_0x5a3b9c,_0x481215,'/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',_0x4909('0x9b')));_0x481215=0x0;return _0x3a4034;}exports[_0x4909('0x9c')]=function(_0x47a8d6,_0x4cb6a7,_0x26ad41){var _0x4b61ad;return db[_0x4909('0x7d')][_0x4909('0x7e')](function(_0x2f3696){return db[_0x4909('0x3d')][_0x4909('0x5a')](_0x47a8d6[_0x4909('0x62')],{'transaction':_0x2f3696})['then'](function(_0x592c59){_0x4b61ad=_0x592c59[_0x4909('0x33')]({'plain':!![]});return db[_0x4909('0x9d')][_0x4909('0x83')](createExtensionsReciveFax(_0x4b61ad),{'transaction':_0x2f3696});});})['then'](function(){return _0x4b61ad;})['then'](respondWithResult(_0x4cb6a7,null))[_0x4909('0x28')](handleError(_0x4cb6a7,null));};exports['updateAccountApplications']=function(_0x1c4ad3,_0x3811c8,_0x610d40){var _0x303bba;return db['sequelize'][_0x4909('0x7e')](function(_0x50cb94){return db[_0x4909('0x3d')][_0x4909('0x9e')](_0x1c4ad3[_0x4909('0x62')],{'where':{'id':_0x1c4ad3['body']['id']},'transaction':_0x50cb94})['then'](function(_0x4c0f4f){return db[_0x4909('0x9d')][_0x4909('0x32')]({'where':{'FaxAccountId':_0x1c4ad3[_0x4909('0x62')]['id']},'transaction':_0x50cb94})[_0x4909('0x1f')](function(_0x474de6){return db[_0x4909('0x9d')][_0x4909('0x83')](createExtensionsReciveFax(_[_0x4909('0x71')](_0x1c4ad3[_0x4909('0x62')],[_0x4909('0x9f'),_0x4909('0x40'),_0x4909('0xa0'),_0x4909('0xa1'),_0x4909('0xa2'),_0x4909('0xa3')])),{'transaction':_0x50cb94});});});})[_0x4909('0x1f')](function(){return db[_0x4909('0x3d')]['findById'](_0x1c4ad3[_0x4909('0x62')]['id']);})[_0x4909('0x1f')](respondWithResult(_0x3811c8,null))['catch'](handleError(_0x3811c8,null));};exports['getMessages']=function(_0x1b492f,_0x18de98,_0x4cdf00){var _0x55ca8f={'raw':!![],'where':{}};var _0x4597b5={};var _0x14e1e3={'count':0x0,'rows':[]};return db[_0x4909('0x3d')]['findOne']({'where':{'id':_0x1b492f[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x18de98,null))[_0x4909('0x1f')](function(_0x162f11){if(_0x162f11){_0x4597b5[_0x4909('0x41')]=_[_0x4909('0x42')](db[_0x4909('0xa4')]['rawAttributes']);_0x4597b5[_0x4909('0x43')]=_[_0x4909('0x42')](_0x1b492f[_0x4909('0x43')]);_0x4597b5[_0x4909('0x44')]=_[_0x4909('0x45')](_0x4597b5[_0x4909('0x41')],_0x4597b5[_0x4909('0x43')]);_0x55ca8f[_0x4909('0x46')]=_[_0x4909('0x45')](_0x4597b5['model'],qs[_0x4909('0x47')](_0x1b492f[_0x4909('0x43')]['fields']));_0x55ca8f['attributes']=_0x55ca8f[_0x4909('0x46')][_0x4909('0x68')]?_0x55ca8f[_0x4909('0x46')]:_0x4597b5['model'];if(!_0x1b492f[_0x4909('0x43')][_0x4909('0x48')](_0x4909('0x49'))){_0x55ca8f[_0x4909('0x2d')]=qs[_0x4909('0x2d')](_0x1b492f[_0x4909('0x43')]['limit']);_0x55ca8f[_0x4909('0x2c')]=qs['offset'](_0x1b492f[_0x4909('0x43')]['offset']);}_0x55ca8f[_0x4909('0x4a')]=qs['sort'](_0x1b492f['query'][_0x4909('0x4b')]);_0x55ca8f['where']=qs['filters'](_[_0x4909('0x4d')](_0x1b492f[_0x4909('0x43')],_0x4597b5[_0x4909('0x44')]));_0x55ca8f[_0x4909('0x4c')]['FaxAccountId']=_0x162f11['id'];if(_0x1b492f[_0x4909('0x43')][_0x4909('0x4e')]){_0x55ca8f[_0x4909('0x4c')]=_[_0x4909('0x4f')](_0x55ca8f[_0x4909('0x4c')],{'$or':_['map'](_0x55ca8f[_0x4909('0x46')],function(_0x1553cc){var _0x38bcc2={};_0x38bcc2[_0x1553cc]={'$like':'%'+_0x1b492f[_0x4909('0x43')][_0x4909('0x4e')]+'%'};return _0x38bcc2;})});}if(_0x1b492f[_0x4909('0x43')][_0x4909('0xa5')]){var _0x3c0809=_0x1b492f[_0x4909('0x43')][_0x4909('0xa5')][_0x4909('0xa6')](',');var _0x333b1f={};_0x333b1f[_0x3c0809[0x0]]={'$gte':moment(_0x3c0809[0x1])[_0x4909('0xa7')](_0x4909('0xa8'))};_0x55ca8f['where']=_['merge'](_0x55ca8f[_0x4909('0x4c')],_0x333b1f);}_0x55ca8f=_['merge']({},_0x55ca8f,_0x1b492f[_0x4909('0x58')]);return db[_0x4909('0xa4')]['count']({'where':_0x55ca8f['where']})[_0x4909('0x1f')](function(_0x36d209){_0x14e1e3[_0x4909('0x50')]=_0x36d209;if(_0x1b492f[_0x4909('0x43')][_0x4909('0x51')]){_0x55ca8f['include']=[{'all':!![]}];}return db[_0x4909('0xa4')][_0x4909('0x53')](_0x55ca8f);})[_0x4909('0x1f')](function(_0xd8ece1){_0x14e1e3[_0x4909('0x54')]=_0xd8ece1;return _0x14e1e3;});}})[_0x4909('0x1f')](respondWithFilteredResult(_0x18de98,_0x55ca8f))[_0x4909('0x28')](handleError(_0x18de98,null));};exports['send']=function(_0x4b9a23,_0x470ff1,_0x183a86){var _0xa9f013,_0x4732a1={},_0x24bc34;if(_0x4b9a23['body']['to']){_0x24bc34=_0x4b9a23['body']['to'][0x0];}return db[_0x4909('0x3d')][_0x4909('0x59')]({'where':{'id':_0x4b9a23['params']['id']},'include':[{'model':db[_0x4909('0xa9')],'as':_0x4909('0xaa'),'include':[{'model':db['CmContact'],'as':_0x4909('0xab'),'where':{'fax':_0x24bc34},'limit':0x1,'order':[[_0x4909('0xa1'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x470ff1,null))[_0x4909('0x1f')](function(_0x137bde){_0xa9f013=_0x137bde;if(_0x4b9a23['body'][_0x4909('0xac')]&&_0x4b9a23[_0x4909('0x62')]['attachments'][_0x4909('0x68')]){for(var _0x98010a=0x0;_0x98010a<_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][_0x4909('0x68')];_0x98010a+=0x1){_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][_0x98010a]={'filename':_0x4b9a23['body'][_0x4909('0xac')][_0x98010a][_0x4909('0x38')],'id':_0x4b9a23['body']['attachments'][_0x98010a]['id'],'path':path[_0x4909('0xad')](config[_0x4909('0xae')],_0x4909('0xaf'),_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][_0x98010a][_0x4909('0xb0')])};}}return respondWithRpcPromise('CheckAfterSend',_0x4909('0xb1'),{'FaxAccountId':_[_0x4909('0xb2')](_0x4b9a23['params']['id'])?undefined:_0x4b9a23[_0x4909('0x56')]['id'],'path':_[_0x4909('0xb2')](_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][0x0][_0x4909('0xb3')])?undefined:_0x4b9a23['body'][_0x4909('0xac')][0x0]['path'],'fax':_[_0x4909('0xb2')](_0x4b9a23['body']['to'][0x0])?undefined:_0x4b9a23[_0x4909('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0xa9f013){if(_[_0x4909('0xb2')](_0x4b9a23[_0x4909('0x62')]['from'])){_0x4b9a23['body']['from']=util[_0x4909('0xa7')](_0x4909('0xb4'),_0xa9f013[_0x4909('0x38')],_0xa9f013[_0x4909('0xb5')]);}if(_0xa9f013[_0x4909('0xaa')]){if(_0xa9f013[_0x4909('0xaa')]['Contacts'][_0x4909('0x68')]){return _0xa9f013[_0x4909('0xaa')][_0x4909('0xab')][0x0];}else{return db['CmContact'][_0x4909('0x5a')](_[_0x4909('0x16')](_0x4b9a23[_0x4909('0x62')],{'firstName':_0x4b9a23[_0x4909('0x62')]['to'][0x0],'phone':_0x4b9a23['body']['to'][0x0],'fax':_0x4b9a23['body']['to'][0x0],'ListId':_0xa9f013[_0x4909('0xa3')]}));}}else{throw new Error(_0x4909('0xb6'));}}else{throw new Error(_0x4909('0xb7'));}})[_0x4909('0x1f')](function(_0x3f85ed){if(_0x3f85ed){return db[_0x4909('0x70')][_0x4909('0x59')]({'where':{'ContactId':_0x3f85ed['id'],'closed':![],'FaxAccountId':_0xa9f013['id']}})[_0x4909('0x1f')](function(_0x14c121){if(_0x14c121){return[_0x14c121,![]];}return db['FaxInteraction'][_0x4909('0x5a')]({'UserId':_0x4b9a23[_0x4909('0x5b')]['id'],'ContactId':_0x3f85ed['id'],'FaxAccountId':_0xa9f013['id'],'fax':_0x4b9a23['body']['to'][0x0],'firstMsgDirection':_0x4909('0xb8'),'Messages':[_['merge'](_0x4b9a23[_0x4909('0x62')],{'read':![],'body':_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][0x0][_0x4909('0xb9')],'FaxAccountId':_0xa9f013['id'],'UserId':_0x4b9a23[_0x4909('0x5b')]['id'],'ContactId':_0x3f85ed['id'],'AttachmentId':_0x4b9a23['body'][_0x4909('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x4909('0xa4')],'as':_0x4909('0xba')}]})['then'](function(_0x3e35b2){return[_0x3e35b2,!![]];});});}else{throw new Error(_0x4909('0xbb'));}})[_0x4909('0xbc')](function(_0xd79fe0,_0x349051){if(_0x349051){return _0xd79fe0;}return db['FaxMessage'][_0x4909('0x5a')]({'direction':'out','read':![],'body':_0x4b9a23[_0x4909('0x62')]['attachments'][0x0][_0x4909('0xb9')],'FaxAccountId':_0xa9f013['id'],'FaxInteractionId':_0xd79fe0['id'],'UserId':_0x4b9a23[_0x4909('0x5b')]['id'],'ContactId':_0xd79fe0[_0x4909('0xbd')],'AttachmentId':_0x4b9a23[_0x4909('0x62')]['attachments'][0x0]['id']})[_0x4909('0x1f')](function(_0x416f0d){_0xd79fe0[_0x4909('0xbe')][_0x4909('0xba')]=[];_0xd79fe0[_0x4909('0xbe')]['Messages']['push'](_0x416f0d[_0x4909('0xbe')]);return _0xd79fe0;});})[_0x4909('0x1f')](function(_0x3ff497){respondWithRpcPromise(_0x4909('0xbf'),_0x4909('0xbf'),{'FaxAccountId':_[_0x4909('0xb2')](_0x4b9a23[_0x4909('0x56')]['id'])?undefined:_0x4b9a23[_0x4909('0x56')]['id'],'path':_['isNil'](_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][0x0][_0x4909('0xb3')])?undefined:_0x4b9a23[_0x4909('0x62')][_0x4909('0xac')][0x0][_0x4909('0xb3')],'fax':_[_0x4909('0xb2')](_0x4b9a23[_0x4909('0x62')]['to'][0x0])?undefined:_0x4b9a23['body']['to'][0x0],'AttachmentId':_0x4b9a23['body'][_0x4909('0xac')][0x0]['id']},client9002)[_0x4909('0x1f')](function(_0x5eaefc){logger[_0x4909('0x20')](_0x4909('0xc0'),_0x5eaefc);})[_0x4909('0x28')](function(_0x112ef9){logger['info']('SendFaxRpc,\x20%s',_0x112ef9);});return _0x3ff497;})[_0x4909('0x1f')](respondWithResult(_0x470ff1,null))[_0x4909('0x28')](handleError(_0x470ff1,null));};exports['addAgents']=function(_0x3e5d51,_0x46d744,_0x34ce94){return db[_0x4909('0x3d')][_0x4909('0x59')]({'where':{'id':_0x3e5d51[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x46d744,null))[_0x4909('0x1f')](function(_0x51e57c){if(_0x51e57c){return _0x51e57c[_0x4909('0xc1')](_0x3e5d51[_0x4909('0x62')][_0x4909('0x6b')],_['omit'](_0x3e5d51['body'],[_0x4909('0x6b'),'id'])||{})[_0x4909('0xbc')](function(_0x2e2213){for(var _0x4122fb=0x0;_0x4122fb<_0x3e5d51[_0x4909('0x62')][_0x4909('0x6b')][_0x4909('0x68')];_0x4122fb+=0x1){socket[_0x4909('0xc2')](_0x4909('0xc3'),{'UserId':Number(_0x3e5d51[_0x4909('0x62')][_0x4909('0x6b')][_0x4122fb]),'FaxAccountId':Number(_0x3e5d51[_0x4909('0x56')]['id'])});}return _0x2e2213;});}})[_0x4909('0x1f')](respondWithResult(_0x46d744,null))[_0x4909('0x28')](handleError(_0x46d744,null));};exports[_0x4909('0xc4')]=function(_0x54ff30,_0x2b1182,_0x465756){return db[_0x4909('0x3d')][_0x4909('0x59')]({'where':{'id':_0x54ff30[_0x4909('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b1182,null))[_0x4909('0x1f')](function(_0x280d14){if(_0x280d14){return _0x280d14['removeAgents'](_0x54ff30[_0x4909('0x43')][_0x4909('0x6b')])['then'](function(){if(_[_0x4909('0xc5')](_0x54ff30[_0x4909('0x43')][_0x4909('0x6b')])){for(var _0x3b97ee=0x0;_0x3b97ee<_0x54ff30['query'][_0x4909('0x6b')]['length'];_0x3b97ee+=0x1){socket['emit'](_0x4909('0xc6'),{'UserId':Number(_0x54ff30[_0x4909('0x43')][_0x4909('0x6b')][_0x3b97ee]),'FaxAccountId':Number(_0x54ff30[_0x4909('0x56')]['id'])});}}else{socket[_0x4909('0xc2')](_0x4909('0xc6'),{'UserId':Number(_0x54ff30['query']['ids']),'FaxAccountId':Number(_0x54ff30['params']['id'])});}});}})[_0x4909('0x1f')](respondWithStatusCode(_0x2b1182,null))[_0x4909('0x28')](handleError(_0x2b1182,null));};exports[_0x4909('0xc7')]=function(_0x58d381,_0x2e108b,_0x43d10a){var _0x27d714={};var _0x4cface={};var _0x47ef03;var _0x1cd5f5;return db[_0x4909('0x3d')][_0x4909('0x67')]({'where':{'id':_0x58d381[_0x4909('0x56')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x2e108b,null))[_0x4909('0x1f')](function(_0x2c6843){if(_0x2c6843){_0x47ef03=_0x2c6843;_0x4cface[_0x4909('0x41')]=_[_0x4909('0x42')](db[_0x4909('0x75')][_0x4909('0x57')]);_0x4cface[_0x4909('0x43')]=_['keys'](_0x58d381['query']);_0x4cface[_0x4909('0x44')]=_[_0x4909('0x45')](_0x4cface[_0x4909('0x41')],_0x4cface['query']);_0x27d714[_0x4909('0x46')]=_[_0x4909('0x45')](_0x4cface[_0x4909('0x41')],qs[_0x4909('0x47')](_0x58d381[_0x4909('0x43')][_0x4909('0x47')]));_0x27d714[_0x4909('0x46')]=_0x27d714[_0x4909('0x46')]['length']?_0x27d714[_0x4909('0x46')]:_0x4cface[_0x4909('0x41')];_0x27d714[_0x4909('0x4a')]=qs[_0x4909('0x4b')](_0x58d381[_0x4909('0x43')][_0x4909('0x4b')]);_0x27d714[_0x4909('0x4c')]=qs[_0x4909('0x44')](_[_0x4909('0x4d')](_0x58d381[_0x4909('0x43')],_0x4cface[_0x4909('0x44')]));if(_0x58d381[_0x4909('0x43')]['filter']){_0x27d714[_0x4909('0x4c')]=_[_0x4909('0x4f')](_0x27d714[_0x4909('0x4c')],{'$or':_[_0x4909('0x3c')](_0x27d714[_0x4909('0x46')],function(_0xb11360){var _0x5b336b={};_0x5b336b[_0xb11360]={'$like':'%'+_0x58d381['query'][_0x4909('0x4e')]+'%'};return _0x5b336b;})});}_0x27d714=_[_0x4909('0x4f')]({},_0x27d714,_0x58d381[_0x4909('0x58')]);return _0x47ef03['getAgents'](_0x27d714);}})[_0x4909('0x1f')](function(_0x4f0942){if(_0x4f0942){_0x1cd5f5=_0x4f0942[_0x4909('0x68')];if(!_0x58d381[_0x4909('0x43')][_0x4909('0x48')](_0x4909('0x49'))){_0x27d714[_0x4909('0x2d')]=qs['limit'](_0x58d381[_0x4909('0x43')]['limit']);_0x27d714[_0x4909('0x2c')]=qs[_0x4909('0x2c')](_0x58d381['query'][_0x4909('0x2c')]);}return _0x47ef03['getAgents'](_0x27d714);}})[_0x4909('0x1f')](function(_0x17f18b){if(_0x17f18b){return _0x17f18b?{'count':_0x1cd5f5,'rows':_0x17f18b}:null;}})[_0x4909('0x1f')](respondWithResult(_0x2e108b,null))['catch'](handleError(_0x2e108b,null));}; \ No newline at end of file +var _0x4c9d=['catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','hasOwnProperty','sort','pick','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','options','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','send','json','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','modem','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','FaxMessage','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','reject','save','update','destroy','get','FaxAccounts','stack','name','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','where','filters','filter','merge','VIRTUAL','include','findAll','rows'];(function(_0x24b61b,_0x47b269){var _0x494602=function(_0x5006b9){while(--_0x5006b9){_0x24b61b['push'](_0x24b61b['shift']());}};_0x494602(++_0x47b269);}(_0x4c9d,0x6e));var _0xd4c9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4c9d[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd4c9('0x0'));var jsonpatch=require(_0xd4c9('0x1'));var rp=require('request-promise');var moment=require(_0xd4c9('0x2'));var BPromise=require(_0xd4c9('0x3'));var Mustache=require(_0xd4c9('0x4'));var util=require(_0xd4c9('0x5'));var path=require(_0xd4c9('0x6'));var sox=require(_0xd4c9('0x7'));var csv=require(_0xd4c9('0x8'));var ejs=require(_0xd4c9('0x9'));var fs=require('fs');var fs_extra=require(_0xd4c9('0xa'));var _=require('lodash');var squel=require(_0xd4c9('0xb'));var crypto=require('crypto');var jsforce=require(_0xd4c9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd4c9('0xd'));var Papa=require(_0xd4c9('0xe'));var Redis=require(_0xd4c9('0xf'));var authService=require(_0xd4c9('0x10'));var qs=require(_0xd4c9('0x11'));var as=require(_0xd4c9('0x12'));var hardwareService=require(_0xd4c9('0x13'));var logger=require(_0xd4c9('0x14'))(_0xd4c9('0x15'));var utils=require(_0xd4c9('0x16'));var config=require(_0xd4c9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd4c9('0x18'))['db'];config[_0xd4c9('0x19')]=_[_0xd4c9('0x1a')](config[_0xd4c9('0x19')],{'host':_0xd4c9('0x1b'),'port':0x18eb});var socket=require(_0xd4c9('0x1c'))(new Redis(config[_0xd4c9('0x19')]));require(_0xd4c9('0x1d'))[_0xd4c9('0x1e')](socket);var jayson=require(_0xd4c9('0x1f'));var client=jayson[_0xd4c9('0x20')][_0xd4c9('0x21')]({'port':0x232c});var client9002=jayson[_0xd4c9('0x20')][_0xd4c9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1259e9,_0x4cb265,_0xd834ec,_0x14b330){return new BPromise(function(_0x2549e8,_0x26f252){var _0x2c1561=_0x14b330||client;return _0x2c1561[_0xd4c9('0x22')](_0x1259e9,_0xd834ec)[_0xd4c9('0x23')](function(_0x25b4c6){logger[_0xd4c9('0x24')](_0xd4c9('0x25'),_0x4cb265,_0xd4c9('0x26'));logger[_0xd4c9('0x27')](_0xd4c9('0x28'),_0x4cb265,_0xd4c9('0x26'),JSON[_0xd4c9('0x29')](_0x25b4c6));if(_0x25b4c6[_0xd4c9('0x2a')]){if(_0x25b4c6[_0xd4c9('0x2a')][_0xd4c9('0x2b')]===0x1f4){logger['error'](_0xd4c9('0x25'),_0x4cb265,_0x25b4c6[_0xd4c9('0x2a')][_0xd4c9('0x2c')]);return _0x26f252(_0x25b4c6[_0xd4c9('0x2a')][_0xd4c9('0x2c')]);}logger['error'](_0xd4c9('0x25'),_0x4cb265,_0x25b4c6[_0xd4c9('0x2a')]['message']);return _0x2549e8(_0x25b4c6['error']['message']);}else{logger[_0xd4c9('0x24')]('FaxAccount,\x20%s,\x20%s',_0x4cb265,_0xd4c9('0x26'));_0x2549e8(_0x25b4c6[_0xd4c9('0x2d')][_0xd4c9('0x2c')]);}})['catch'](function(_0x4d112a){logger[_0xd4c9('0x2a')](_0xd4c9('0x25'),_0x4cb265,_0x4d112a);_0x26f252(_0x4d112a);});});}function respondWithStatusCode(_0x189733,_0x1733a9){_0x1733a9=_0x1733a9||0xcc;return function(_0x157f0c){if(_0x157f0c){return _0x189733[_0xd4c9('0x2e')](_0x1733a9);}return _0x189733['status'](_0x1733a9)['end']();};}function respondWithResult(_0x17218c,_0x133c07){_0x133c07=_0x133c07||0xc8;return function(_0x328b55){if(_0x328b55){return _0x17218c[_0xd4c9('0x2f')](_0x133c07)['json'](_0x328b55);}};}function respondWithFilteredResult(_0x555b64,_0x4aab07){return function(_0xf3fd81){if(_0xf3fd81){var _0x3fdde9=typeof _0x4aab07[_0xd4c9('0x30')]===_0xd4c9('0x31')&&typeof _0x4aab07[_0xd4c9('0x32')]===_0xd4c9('0x31');var _0x11a09a=_0xf3fd81[_0xd4c9('0x33')];var _0x9cc0fc=_0x3fdde9?0x0:_0x4aab07['offset'];var _0x564a79=_0x3fdde9?_0xf3fd81['count']:_0x4aab07['offset']+_0x4aab07[_0xd4c9('0x32')];var _0x3d733d;if(_0x564a79>=_0x11a09a){_0x564a79=_0x11a09a;_0x3d733d=0xc8;}else{_0x3d733d=0xce;}_0x555b64[_0xd4c9('0x2f')](_0x3d733d);return _0x555b64[_0xd4c9('0x34')]('Content-Range',_0x9cc0fc+'-'+_0x564a79+'/'+_0x11a09a)['json'](_0xf3fd81);}return null;};}function patchUpdates(_0x3ea140){return function(_0x51ad20){try{jsonpatch['apply'](_0x51ad20,_0x3ea140,!![]);}catch(_0x352bf8){return BPromise[_0xd4c9('0x35')](_0x352bf8);}return _0x51ad20[_0xd4c9('0x36')]();};}function saveUpdates(_0x5c431c,_0x3b1704){return function(_0xeced9d){if(_0xeced9d){return _0xeced9d[_0xd4c9('0x37')](_0x5c431c)[_0xd4c9('0x23')](function(_0x351494){return _0x351494;});}return null;};}function removeEntity(_0x7dbe4,_0x464e7e){return function(_0x55b2ef){if(_0x55b2ef){return _0x55b2ef[_0xd4c9('0x38')]()['then'](function(){var _0x4e6294=_0x55b2ef[_0xd4c9('0x39')]({'plain':!![]});var _0x3e255d=_0xd4c9('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e255d,'resourceId':_0x4e6294['id']}})[_0xd4c9('0x23')](function(){return _0x55b2ef;});})[_0xd4c9('0x23')](function(){_0x7dbe4[_0xd4c9('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x394b18,_0x4a686b){return function(_0x227bec){if(!_0x227bec){_0x394b18[_0xd4c9('0x2e')](0x194);}return _0x227bec;};}function handleError(_0x21d00a,_0x1f57ac){_0x1f57ac=_0x1f57ac||0x1f4;return function(_0x5e2b41){logger[_0xd4c9('0x2a')](_0x5e2b41[_0xd4c9('0x3b')]);if(_0x5e2b41[_0xd4c9('0x3c')]){delete _0x5e2b41[_0xd4c9('0x3c')];}_0x21d00a[_0xd4c9('0x2f')](_0x1f57ac)['send'](_0x5e2b41);};}exports['index']=function(_0x260159,_0x49dd5e){var _0x5217ac={'include':[{'model':db[_0xd4c9('0x3d')],'as':_0xd4c9('0x3e')}]},_0x57f4b7={},_0x4f0aea={'count':0x0,'rows':[]};var _0x568b4c=_['map'](db[_0xd4c9('0x3f')][_0xd4c9('0x40')],function(_0x2dd030){return{'name':_0x2dd030[_0xd4c9('0x41')],'type':_0x2dd030[_0xd4c9('0x42')][_0xd4c9('0x43')]};});_0x57f4b7[_0xd4c9('0x44')]=_[_0xd4c9('0x45')](_0x568b4c,_0xd4c9('0x3c'));_0x57f4b7[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x260159[_0xd4c9('0x46')]);_0x57f4b7['filters']=_[_0xd4c9('0x48')](_0x57f4b7[_0xd4c9('0x44')],_0x57f4b7[_0xd4c9('0x46')]);_0x5217ac[_0xd4c9('0x49')]=_['intersection'](_0x57f4b7[_0xd4c9('0x44')],qs[_0xd4c9('0x4a')](_0x260159[_0xd4c9('0x46')]['fields']));_0x5217ac[_0xd4c9('0x49')]=_0x5217ac[_0xd4c9('0x49')]['length']?_0x5217ac[_0xd4c9('0x49')]:_0x57f4b7[_0xd4c9('0x44')];if(!_0x260159[_0xd4c9('0x46')]['hasOwnProperty'](_0xd4c9('0x4b'))){_0x5217ac[_0xd4c9('0x32')]=qs[_0xd4c9('0x32')](_0x260159[_0xd4c9('0x46')]['limit']);_0x5217ac[_0xd4c9('0x30')]=qs[_0xd4c9('0x30')](_0x260159[_0xd4c9('0x46')]['offset']);}_0x5217ac[_0xd4c9('0x4c')]=qs['sort'](_0x260159['query']['sort']);_0x5217ac[_0xd4c9('0x4d')]=qs[_0xd4c9('0x4e')](_['pick'](_0x260159['query'],_0x57f4b7[_0xd4c9('0x4e')]),_0x568b4c);if(_0x260159[_0xd4c9('0x46')][_0xd4c9('0x4f')]){_0x5217ac[_0xd4c9('0x4d')]=_[_0xd4c9('0x50')](_0x5217ac[_0xd4c9('0x4d')],{'$or':_[_0xd4c9('0x45')](_0x568b4c,function(_0x43b8a0){if(_0x43b8a0[_0xd4c9('0x42')]!==_0xd4c9('0x51')){var _0x3e5a02={};_0x3e5a02[_0x43b8a0[_0xd4c9('0x3c')]]={'$like':'%'+_0x260159['query'][_0xd4c9('0x4f')]+'%'};return _0x3e5a02;}})});}_0x5217ac=_[_0xd4c9('0x50')]({},_0x5217ac,_0x260159['options']);var _0x2e47b0={'where':_0x5217ac['where']};return db[_0xd4c9('0x3f')][_0xd4c9('0x33')](_0x2e47b0)[_0xd4c9('0x23')](function(_0x367f1d){_0x4f0aea[_0xd4c9('0x33')]=_0x367f1d;if(_0x260159[_0xd4c9('0x46')]['includeAll']){_0x5217ac[_0xd4c9('0x52')]=[{'all':!![]}];}return db[_0xd4c9('0x3f')][_0xd4c9('0x53')](_0x5217ac);})['then'](function(_0xca283a){_0x4f0aea[_0xd4c9('0x54')]=_0xca283a;return _0x4f0aea;})['then'](respondWithFilteredResult(_0x49dd5e,_0x5217ac))[_0xd4c9('0x55')](handleError(_0x49dd5e,null));};exports[_0xd4c9('0x56')]=function(_0x463741,_0x38f4d0){var _0x57713e={'raw':![],'where':{'id':_0x463741['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x567c7e={};_0x567c7e[_0xd4c9('0x44')]=_[_0xd4c9('0x47')](db[_0xd4c9('0x3f')]['rawAttributes']);_0x567c7e[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x463741[_0xd4c9('0x46')]);_0x567c7e[_0xd4c9('0x4e')]=_[_0xd4c9('0x48')](_0x567c7e['model'],_0x567c7e[_0xd4c9('0x46')]);_0x57713e[_0xd4c9('0x49')]=_[_0xd4c9('0x48')](_0x567c7e[_0xd4c9('0x44')],qs['fields'](_0x463741[_0xd4c9('0x46')][_0xd4c9('0x4a')]));_0x57713e[_0xd4c9('0x49')]=_0x57713e[_0xd4c9('0x49')][_0xd4c9('0x57')]?_0x57713e[_0xd4c9('0x49')]:_0x567c7e[_0xd4c9('0x44')];if(_0x463741[_0xd4c9('0x46')]['includeAll']){_0x57713e['include']=[{'all':!![]}];}_0x57713e=_[_0xd4c9('0x50')]({},_0x57713e,_0x463741['options']);return db[_0xd4c9('0x3f')][_0xd4c9('0x58')](_0x57713e)['then'](handleEntityNotFound(_0x38f4d0,null))[_0xd4c9('0x23')](respondWithResult(_0x38f4d0,null))['catch'](handleError(_0x38f4d0,null));};exports[_0xd4c9('0x59')]=function(_0x67d674,_0x16be5c){return db[_0xd4c9('0x3f')][_0xd4c9('0x59')](_0x67d674['body'],{})[_0xd4c9('0x23')](function(_0xc371a1){var _0x1dc641=_0x67d674[_0xd4c9('0x5a')]['get']({'plain':!![]});if(!_0x1dc641)throw new Error(_0xd4c9('0x5b'));if(_0x1dc641[_0xd4c9('0x5c')]==='user'){var _0x1d42f6=_0xc371a1[_0xd4c9('0x39')]({'plain':!![]});var _0x589e5f=_0xd4c9('0x3a');return db[_0xd4c9('0x5d')][_0xd4c9('0x58')]({'where':{'name':_0x589e5f,'userProfileId':_0x1dc641['userProfileId']},'raw':!![]})[_0xd4c9('0x23')](function(_0x7e168e){if(_0x7e168e&&_0x7e168e[_0xd4c9('0x5e')]===0x0){return db[_0xd4c9('0x5f')][_0xd4c9('0x59')]({'name':_0x1d42f6[_0xd4c9('0x3c')],'resourceId':_0x1d42f6['id'],'type':_0x7e168e['name'],'sectionId':_0x7e168e['id']},{})[_0xd4c9('0x23')](function(){return _0xc371a1;});}else{return _0xc371a1;}})[_0xd4c9('0x55')](function(_0x4fc747){logger[_0xd4c9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fc747);throw _0x4fc747;});}return _0xc371a1;})[_0xd4c9('0x23')](respondWithResult(_0x16be5c,0xc9))[_0xd4c9('0x55')](handleError(_0x16be5c,null));};exports['update']=function(_0x6e633c,_0x30cf64){if(_0x6e633c[_0xd4c9('0x60')]['id']){delete _0x6e633c['body']['id'];}return db['FaxAccount'][_0xd4c9('0x58')]({'where':{'id':_0x6e633c[_0xd4c9('0x61')]['id']},'include':[{'model':db[_0xd4c9('0x3d')],'as':_0xd4c9('0x3e')}]})[_0xd4c9('0x23')](handleEntityNotFound(_0x30cf64,null))['then'](saveUpdates(_0x6e633c[_0xd4c9('0x60')],null))[_0xd4c9('0x23')](respondWithResult(_0x30cf64,null))[_0xd4c9('0x55')](handleError(_0x30cf64,null));};exports['destroy']=function(_0x4ef398,_0x39000b){return db[_0xd4c9('0x3f')][_0xd4c9('0x58')]({'where':{'id':_0x4ef398[_0xd4c9('0x61')]['id']}})['then'](handleEntityNotFound(_0x39000b,null))[_0xd4c9('0x23')](removeEntity(_0x39000b,null))[_0xd4c9('0x55')](handleError(_0x39000b,null));};exports[_0xd4c9('0x62')]=function(_0x29d6f9,_0x43aa6c){return db[_0xd4c9('0x3f')][_0xd4c9('0x62')]()[_0xd4c9('0x23')](respondWithResult(_0x43aa6c,null))[_0xd4c9('0x55')](handleError(_0x43aa6c,null));};exports[_0xd4c9('0x63')]=function(_0x382150,_0x12e492,_0x3f6920){if(_0x382150[_0xd4c9('0x60')]['id']){delete _0x382150[_0xd4c9('0x60')]['id'];}return db[_0xd4c9('0x3f')][_0xd4c9('0x58')]({'where':{'id':_0x382150[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x12e492,null))['then'](function(_0xdcbed9){if(_0xdcbed9){_0x382150['body'][_0xd4c9('0x64')]=_0xdcbed9['id'];return db[_0xd4c9('0x65')][_0xd4c9('0x59')](_0x382150[_0xd4c9('0x60')]);}})['then'](respondWithResult(_0x12e492,null))[_0xd4c9('0x55')](handleError(_0x12e492,null));};exports[_0xd4c9('0x66')]=function(_0x769b67,_0x5e31f3,_0x4d36fd){var _0x4a2c39={'raw':![],'where':{}};var _0x2c782f={};var _0x3b3d44={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x769b67['params']['id']}})['then'](handleEntityNotFound(_0x5e31f3,null))['then'](function(_0x18d011){if(_0x18d011){_0x2c782f[_0xd4c9('0x44')]=_[_0xd4c9('0x47')](db[_0xd4c9('0x65')][_0xd4c9('0x40')]);_0x2c782f[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x769b67[_0xd4c9('0x46')]);_0x2c782f[_0xd4c9('0x4e')]=_[_0xd4c9('0x48')](_0x2c782f['model'],_0x2c782f[_0xd4c9('0x46')]);_0x4a2c39[_0xd4c9('0x49')]=_[_0xd4c9('0x48')](_0x2c782f[_0xd4c9('0x44')],qs['fields'](_0x769b67[_0xd4c9('0x46')][_0xd4c9('0x4a')]));_0x4a2c39[_0xd4c9('0x49')]=_0x4a2c39[_0xd4c9('0x49')][_0xd4c9('0x57')]?_0x4a2c39[_0xd4c9('0x49')]:_0x2c782f[_0xd4c9('0x44')];if(!_0x769b67[_0xd4c9('0x46')][_0xd4c9('0x67')]('nolimit')){_0x4a2c39[_0xd4c9('0x32')]=qs['limit'](_0x769b67[_0xd4c9('0x46')][_0xd4c9('0x32')]);_0x4a2c39[_0xd4c9('0x30')]=qs[_0xd4c9('0x30')](_0x769b67[_0xd4c9('0x46')]['offset']);}_0x4a2c39[_0xd4c9('0x4c')]=qs[_0xd4c9('0x68')](_0x769b67[_0xd4c9('0x46')][_0xd4c9('0x68')]);_0x4a2c39['where']=qs['filters'](_[_0xd4c9('0x69')](_0x769b67[_0xd4c9('0x46')],_0x2c782f[_0xd4c9('0x4e')]));_0x4a2c39[_0xd4c9('0x4d')]['FaxAccountId']=_0x18d011['id'];if(_0x769b67['query'][_0xd4c9('0x4f')]){_0x4a2c39['where']=_[_0xd4c9('0x50')](_0x4a2c39[_0xd4c9('0x4d')],{'$or':_['map'](_0x4a2c39[_0xd4c9('0x49')],function(_0x32772c){var _0x187cc1={};_0x187cc1[_0x32772c]={'$like':'%'+_0x769b67[_0xd4c9('0x46')][_0xd4c9('0x4f')]+'%'};return _0x187cc1;})});}_0x4a2c39=_[_0xd4c9('0x50')]({},_0x4a2c39,_0x769b67['options']);return db[_0xd4c9('0x65')][_0xd4c9('0x33')]({'where':_0x4a2c39['where']})['then'](function(_0x39c320){_0x3b3d44[_0xd4c9('0x33')]=_0x39c320;if(_0x769b67[_0xd4c9('0x46')][_0xd4c9('0x6a')]){_0x4a2c39[_0xd4c9('0x52')]=[{'all':!![]}];}return db[_0xd4c9('0x65')][_0xd4c9('0x53')](_0x4a2c39);})[_0xd4c9('0x23')](function(_0x148829){_0x3b3d44['rows']=_0x148829;return _0x3b3d44;});}})[_0xd4c9('0x23')](respondWithFilteredResult(_0x5e31f3,_0x4a2c39))[_0xd4c9('0x55')](handleError(_0x5e31f3,null));};exports[_0xd4c9('0x6b')]=function(_0x3deab1,_0x240bb4,_0x33d9f8){return db[_0xd4c9('0x3f')]['find']({'where':{'id':_0x3deab1[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x240bb4,null))[_0xd4c9('0x23')](function(_0xdd044d){if(_0xdd044d){return _0xdd044d[_0xd4c9('0x6b')](_0x3deab1[_0xd4c9('0x46')][_0xd4c9('0x6c')]);}})[_0xd4c9('0x23')](respondWithStatusCode(_0x240bb4,null))[_0xd4c9('0x55')](handleError(_0x240bb4,null));};exports[_0xd4c9('0x6d')]=function(_0x45dcc0,_0x131c2f,_0x459bb7){if(_0x45dcc0[_0xd4c9('0x60')]['id']){delete _0x45dcc0[_0xd4c9('0x60')]['id'];}return db[_0xd4c9('0x3f')][_0xd4c9('0x58')]({'where':{'id':_0x45dcc0['params']['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x131c2f,null))['then'](function(_0x3b3230){if(_0x3b3230){_0x45dcc0['body'][_0xd4c9('0x64')]=_0x3b3230['id'];return db[_0xd4c9('0x6e')][_0xd4c9('0x59')](_0x45dcc0[_0xd4c9('0x60')]);}})[_0xd4c9('0x23')](respondWithResult(_0x131c2f,null))[_0xd4c9('0x55')](handleError(_0x131c2f,null));};exports['getAnswers']=function(_0x72c4b6,_0x1f1773,_0x58057c){var _0x3bdddc={'raw':![],'where':{}};var _0x33fed3={};var _0x4e84b6={'count':0x0,'rows':[]};return db[_0xd4c9('0x3f')][_0xd4c9('0x6f')]({'where':{'id':_0x72c4b6[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x1f1773,null))[_0xd4c9('0x23')](function(_0x4183a6){if(_0x4183a6){_0x33fed3['model']=_[_0xd4c9('0x47')](db[_0xd4c9('0x6e')][_0xd4c9('0x40')]);_0x33fed3[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x72c4b6[_0xd4c9('0x46')]);_0x33fed3[_0xd4c9('0x4e')]=_[_0xd4c9('0x48')](_0x33fed3[_0xd4c9('0x44')],_0x33fed3[_0xd4c9('0x46')]);_0x3bdddc['attributes']=_[_0xd4c9('0x48')](_0x33fed3['model'],qs[_0xd4c9('0x4a')](_0x72c4b6['query'][_0xd4c9('0x4a')]));_0x3bdddc[_0xd4c9('0x49')]=_0x3bdddc[_0xd4c9('0x49')][_0xd4c9('0x57')]?_0x3bdddc['attributes']:_0x33fed3[_0xd4c9('0x44')];if(!_0x72c4b6[_0xd4c9('0x46')][_0xd4c9('0x67')](_0xd4c9('0x4b'))){_0x3bdddc['limit']=qs[_0xd4c9('0x32')](_0x72c4b6[_0xd4c9('0x46')][_0xd4c9('0x32')]);_0x3bdddc[_0xd4c9('0x30')]=qs['offset'](_0x72c4b6['query'][_0xd4c9('0x30')]);}_0x3bdddc[_0xd4c9('0x4c')]=qs['sort'](_0x72c4b6['query'][_0xd4c9('0x68')]);_0x3bdddc[_0xd4c9('0x4d')]=qs[_0xd4c9('0x4e')](_[_0xd4c9('0x69')](_0x72c4b6[_0xd4c9('0x46')],_0x33fed3['filters']));_0x3bdddc['where'][_0xd4c9('0x64')]=_0x4183a6['id'];if(_0x72c4b6[_0xd4c9('0x46')][_0xd4c9('0x4f')]){_0x3bdddc['where']=_['merge'](_0x3bdddc[_0xd4c9('0x4d')],{'$or':_[_0xd4c9('0x45')](_0x3bdddc[_0xd4c9('0x49')],function(_0x3d8490){var _0xd3c39d={};_0xd3c39d[_0x3d8490]={'$like':'%'+_0x72c4b6[_0xd4c9('0x46')][_0xd4c9('0x4f')]+'%'};return _0xd3c39d;})});}_0x3bdddc=_['merge']({},_0x3bdddc,_0x72c4b6[_0xd4c9('0x70')]);return db[_0xd4c9('0x6e')][_0xd4c9('0x33')]({'where':_0x3bdddc[_0xd4c9('0x4d')]})[_0xd4c9('0x23')](function(_0x3dfc8f){_0x4e84b6['count']=_0x3dfc8f;if(_0x72c4b6[_0xd4c9('0x46')][_0xd4c9('0x6a')]){_0x3bdddc[_0xd4c9('0x52')]=[{'all':!![]}];}return db[_0xd4c9('0x6e')][_0xd4c9('0x53')](_0x3bdddc);})[_0xd4c9('0x23')](function(_0x149a91){_0x4e84b6['rows']=_0x149a91;return _0x4e84b6;});}})[_0xd4c9('0x23')](respondWithFilteredResult(_0x1f1773,_0x3bdddc))[_0xd4c9('0x55')](handleError(_0x1f1773,null));};exports['removeAnswers']=function(_0x16db8d,_0x508188,_0x2ab98e){return db[_0xd4c9('0x3f')]['find']({'where':{'id':_0x16db8d[_0xd4c9('0x61')]['id']}})['then'](handleEntityNotFound(_0x508188,null))[_0xd4c9('0x23')](function(_0x4e0df4){if(_0x4e0df4){return _0x4e0df4[_0xd4c9('0x71')](_0x16db8d[_0xd4c9('0x46')][_0xd4c9('0x6c')]);}})[_0xd4c9('0x23')](respondWithStatusCode(_0x508188,null))[_0xd4c9('0x55')](handleError(_0x508188,null));};exports['addInteraction']=function(_0x2145e7,_0x31b047,_0x24409b){return db['FaxInteraction'][_0xd4c9('0x58')]({'where':{'id':_0x2145e7[_0xd4c9('0x61')]['id']}})['then'](handleEntityNotFound(_0x31b047,null))['then'](function(_0x4d5797){if(_0x4d5797){return _0x4d5797[_0xd4c9('0x72')](_0x2145e7[_0xd4c9('0x60')][_0xd4c9('0x6c')],_[_0xd4c9('0x73')](_0x2145e7[_0xd4c9('0x60')],[_0xd4c9('0x6c'),'id'])||{});}})[_0xd4c9('0x23')](respondWithResult(_0x31b047,null))[_0xd4c9('0x55')](handleError(_0x31b047,null));};exports[_0xd4c9('0x74')]=function(_0x3cc874,_0x1e24cc,_0x122f48){var _0x2a660c={'raw':![],'where':{}};var _0x1146b9={};var _0x993c7f={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd4c9('0x6f')]({'where':{'id':_0x3cc874[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x1e24cc,null))[_0xd4c9('0x23')](function(_0x4bde7e){if(_0x4bde7e){_0x1146b9['model']=_[_0xd4c9('0x47')](db['FaxInteraction'][_0xd4c9('0x40')]);_0x1146b9[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x3cc874[_0xd4c9('0x46')]);_0x1146b9['filters']=_[_0xd4c9('0x48')](_0x1146b9['model'],_0x1146b9['query']);_0x2a660c[_0xd4c9('0x49')]=_[_0xd4c9('0x48')](_0x1146b9[_0xd4c9('0x44')],qs[_0xd4c9('0x4a')](_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x4a')]));_0x2a660c[_0xd4c9('0x49')]=_0x2a660c['attributes'][_0xd4c9('0x57')]?_0x2a660c['attributes']:_0x1146b9[_0xd4c9('0x44')];if(!_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x67')](_0xd4c9('0x4b'))){_0x2a660c['limit']=qs[_0xd4c9('0x32')](_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x32')]);_0x2a660c[_0xd4c9('0x30')]=qs['offset'](_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x30')]);}_0x2a660c[_0xd4c9('0x4c')]=qs['sort'](_0x3cc874['query'][_0xd4c9('0x68')]);_0x2a660c[_0xd4c9('0x4d')]=qs[_0xd4c9('0x4e')](_[_0xd4c9('0x69')](_0x3cc874[_0xd4c9('0x46')],_0x1146b9[_0xd4c9('0x4e')]));_0x2a660c[_0xd4c9('0x4d')]['FaxAccountId']=_0x4bde7e['id'];if(_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x4f')]){_0x2a660c[_0xd4c9('0x4d')]=_[_0xd4c9('0x50')](_0x2a660c[_0xd4c9('0x4d')],{'$or':_[_0xd4c9('0x45')](_0x2a660c['attributes'],function(_0x4701db){var _0x49cdb6={};_0x49cdb6[_0x4701db]={'$like':'%'+_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x4f')]+'%'};return _0x49cdb6;})});}_0x2a660c=_[_0xd4c9('0x50')]({},_0x2a660c,_0x3cc874[_0xd4c9('0x70')]);return db[_0xd4c9('0x75')][_0xd4c9('0x33')]({'where':_0x2a660c[_0xd4c9('0x4d')]})['then'](function(_0x38e6dd){_0x993c7f[_0xd4c9('0x33')]=_0x38e6dd;if(_0x3cc874[_0xd4c9('0x46')]['includeAll']){_0x2a660c[_0xd4c9('0x52')]=[{'model':db[_0xd4c9('0x76')],'as':_0xd4c9('0x77'),'required':![]},{'model':db[_0xd4c9('0x78')],'as':_0xd4c9('0x79'),'attributes':[_0xd4c9('0x3c'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xd4c9('0x7a'),'attributes':['id',_0xd4c9('0x3c'),_0xd4c9('0x7b')],'where':_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x7c')]?{'id':_0x3cc874[_0xd4c9('0x46')][_0xd4c9('0x7c')]}:undefined,'required':_0x3cc874[_0xd4c9('0x46')]['tag']?!![]:![]}];}return db[_0xd4c9('0x75')][_0xd4c9('0x53')](_0x2a660c);})[_0xd4c9('0x23')](function(_0xd0a252){_0x993c7f[_0xd4c9('0x54')]=_0xd0a252;return _0x993c7f;});}})[_0xd4c9('0x23')](respondWithFilteredResult(_0x1e24cc,_0x2a660c))[_0xd4c9('0x55')](handleError(_0x1e24cc,null));};exports[_0xd4c9('0x7d')]=function(_0x443451,_0x141a77){var _0x285c5a=_0x443451[_0xd4c9('0x61')]['id'];var _0x37e439=_0x443451[_0xd4c9('0x60')];var _0x544525=0xc8;var _0x5b4118=null;return db[_0xd4c9('0x7e')]['transaction']({'isolationLevel':db[_0xd4c9('0x7e')]['Transaction'][_0xd4c9('0x7f')][_0xd4c9('0x80')]},function(_0x1c9842){return db[_0xd4c9('0x3f')][_0xd4c9('0x6f')]({'where':{'id':_0x285c5a},'transaction':_0x1c9842})[_0xd4c9('0x23')](function(_0x38c226){if(_0x38c226){return db['FaxApplication'][_0xd4c9('0x38')]({'where':{'FaxAccountId':_0x285c5a},'transaction':_0x1c9842})[_0xd4c9('0x23')](function(){var _0x5ad977=_[_0xd4c9('0x45')](_0x37e439,function(_0x43d980){_0x43d980[_0xd4c9('0x64')]=_0x285c5a;return _0x43d980;});return db[_0xd4c9('0x81')][_0xd4c9('0x82')](_0x5ad977,{'transaction':_0x1c9842});});}else{_0x544525=0x194;_0x5b4118=[];}});})[_0xd4c9('0x23')](function(){if(_0x544525!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x285c5a},'order':'priority'})[_0xd4c9('0x23')](function(_0x53b4c5){_0x5b4118=_0x53b4c5;});}})[_0xd4c9('0x55')](function(_0x59bf03){_0x544525=0x1f4;logger[_0xd4c9('0x2a')](_0x59bf03['stack']);if(_0x59bf03[_0xd4c9('0x3c')]){delete _0x59bf03[_0xd4c9('0x3c')];}_0x5b4118=_0x59bf03;})['finally'](function(){if(_0x5b4118===null){_0x141a77['sendStatus'](_0x544525);}else{if(_0x544525===0x1f4){_0x141a77[_0xd4c9('0x2f')](_0x544525)[_0xd4c9('0x83')](_0x5b4118);}else{_0x141a77['status'](_0x544525)[_0xd4c9('0x84')](_0x5b4118);}}});};exports[_0xd4c9('0x85')]=function(_0x1cc214,_0x4e6658,_0x1bb92e){var _0x31b094={};var _0x28bcc2={};var _0x25f18d;var _0xc3d287;return db['FaxAccount'][_0xd4c9('0x6f')]({'where':{'id':_0x1cc214[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x4e6658,null))[_0xd4c9('0x23')](function(_0x1f8ca5){if(_0x1f8ca5){_0x25f18d=_0x1f8ca5;_0x28bcc2[_0xd4c9('0x44')]=_[_0xd4c9('0x47')](db[_0xd4c9('0x81')]['rawAttributes']);_0x28bcc2[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x1cc214[_0xd4c9('0x46')]);_0x28bcc2[_0xd4c9('0x4e')]=_['intersection'](_0x28bcc2[_0xd4c9('0x44')],_0x28bcc2['query']);_0x31b094[_0xd4c9('0x49')]=_[_0xd4c9('0x48')](_0x28bcc2[_0xd4c9('0x44')],qs['fields'](_0x1cc214[_0xd4c9('0x46')][_0xd4c9('0x4a')]));_0x31b094[_0xd4c9('0x49')]=_0x31b094[_0xd4c9('0x49')][_0xd4c9('0x57')]?_0x31b094[_0xd4c9('0x49')]:_0x28bcc2[_0xd4c9('0x44')];_0x31b094[_0xd4c9('0x4c')]=qs[_0xd4c9('0x68')](_0x1cc214[_0xd4c9('0x46')][_0xd4c9('0x68')]);_0x31b094[_0xd4c9('0x4d')]=qs['filters'](_[_0xd4c9('0x69')](_0x1cc214[_0xd4c9('0x46')],_0x28bcc2[_0xd4c9('0x4e')]));if(_0x1cc214[_0xd4c9('0x46')]['filter']){_0x31b094['where']=_['merge'](_0x31b094['where'],{'$or':_[_0xd4c9('0x45')](_0x31b094[_0xd4c9('0x49')],function(_0x3fd582){var _0x1a6eea={};_0x1a6eea[_0x3fd582]={'$like':'%'+_0x1cc214[_0xd4c9('0x46')]['filter']+'%'};return _0x1a6eea;})});}_0x31b094=_[_0xd4c9('0x50')]({},_0x31b094,_0x1cc214['options']);return _0x25f18d[_0xd4c9('0x85')](_0x31b094);}})['then'](function(_0x571665){if(_0x571665){_0xc3d287=_0x571665[_0xd4c9('0x57')];if(!_0x1cc214[_0xd4c9('0x46')]['hasOwnProperty'](_0xd4c9('0x4b'))){_0x31b094[_0xd4c9('0x32')]=qs[_0xd4c9('0x32')](_0x1cc214[_0xd4c9('0x46')][_0xd4c9('0x32')]);_0x31b094[_0xd4c9('0x30')]=qs[_0xd4c9('0x30')](_0x1cc214[_0xd4c9('0x46')]['offset']);}return _0x25f18d[_0xd4c9('0x85')](_0x31b094);}})['then'](function(_0x11b394){if(_0x11b394){return _0x11b394?{'count':_0xc3d287,'rows':_0x11b394}:null;}})[_0xd4c9('0x23')](respondWithResult(_0x4e6658,null))['catch'](handleError(_0x4e6658,null));};function Extension(_0x213126,_0x251626,_0x4a227e,_0x3fdcf3){this[_0xd4c9('0x86')]=_0xd4c9('0x87');this['exten']=_0x213126[_0xd4c9('0x88')];this[_0xd4c9('0x89')]=_0x3fdcf3;this[_0xd4c9('0x42')]=_0xd4c9('0x8a');this[_0xd4c9('0x8b')]=_0xd4c9('0x8c');this[_0xd4c9('0x64')]=_0x213126['id'];this['priority']=_0x251626;this[_0xd4c9('0x8d')]=_0x4a227e;}function createExtensionsReciveFax(_0x9aa6ca){var _0xcbad28=0x1;var _0x2c83d5=[];_0x2c83d5[_0xd4c9('0x8e')](new Extension(_0x9aa6ca,_0xcbad28,'',_0xd4c9('0x8f')));_0xcbad28+=0x1;_0x2c83d5[_0xd4c9('0x8e')](new Extension(_0x9aa6ca,_0xcbad28,_0xd4c9('0x90'),'Set'));_0xcbad28+=0x1;for(var _0x3a6844 in _0x9aa6ca){if(_0x9aa6ca['hasOwnProperty'](_0x3a6844)&&(_0x3a6844===_0xd4c9('0x91')||_0x3a6844===_0xd4c9('0x88')||_0x3a6844===_0xd4c9('0x92')||_0x3a6844===_0xd4c9('0x93')||_0x3a6844===_0xd4c9('0x94')||_0x3a6844===_0xd4c9('0x95')||_0x3a6844==='minrate'||_0x3a6844===_0xd4c9('0x96')||_0x3a6844==='t38timeout')){_0x2c83d5[_0xd4c9('0x8e')](new Extension(_0x9aa6ca,_0xcbad28,'FAXOPT('+_0x3a6844+')='+_0x9aa6ca[_0x3a6844],_0xd4c9('0x97')));_0xcbad28+=0x1;}}_0x2c83d5[_0xd4c9('0x8e')](new Extension(_0x9aa6ca,_0xcbad28,'6',_0xd4c9('0x98')));_0xcbad28+=0x1;_0x2c83d5[_0xd4c9('0x8e')](new Extension(_0x9aa6ca,_0xcbad28,_0xd4c9('0x99'),'ReceiveFax'));_0xcbad28=0x0;return _0x2c83d5;}exports[_0xd4c9('0x9a')]=function(_0x424652,_0x4a4a6e,_0x30dcd1){var _0x1d7c8e;return db[_0xd4c9('0x7e')][_0xd4c9('0x9b')](function(_0xb98836){return db[_0xd4c9('0x3f')][_0xd4c9('0x59')](_0x424652['body'],{'transaction':_0xb98836})[_0xd4c9('0x23')](function(_0x1ef751){_0x1d7c8e=_0x1ef751[_0xd4c9('0x39')]({'plain':!![]});return db[_0xd4c9('0x9c')]['bulkCreate'](createExtensionsReciveFax(_0x1d7c8e),{'transaction':_0xb98836});});})['then'](function(){return _0x1d7c8e;})['then'](respondWithResult(_0x4a4a6e,null))[_0xd4c9('0x55')](handleError(_0x4a4a6e,null));};exports[_0xd4c9('0x9d')]=function(_0x4fbc32,_0x132f79,_0x4c4777){var _0x3997dd;return db[_0xd4c9('0x7e')][_0xd4c9('0x9b')](function(_0x430fd0){return db[_0xd4c9('0x3f')][_0xd4c9('0x37')](_0x4fbc32[_0xd4c9('0x60')],{'where':{'id':_0x4fbc32[_0xd4c9('0x60')]['id']},'transaction':_0x430fd0})['then'](function(_0x1b7d1b){return db[_0xd4c9('0x9c')]['destroy']({'where':{'FaxAccountId':_0x4fbc32[_0xd4c9('0x60')]['id']},'transaction':_0x430fd0})['then'](function(_0x2d8e00){return db[_0xd4c9('0x9c')]['bulkCreate'](createExtensionsReciveFax(_[_0xd4c9('0x73')](_0x4fbc32[_0xd4c9('0x60')],[_0xd4c9('0x9e'),_0xd4c9('0x43'),_0xd4c9('0x9f'),_0xd4c9('0xa0'),_0xd4c9('0xa1'),_0xd4c9('0xa2')])),{'transaction':_0x430fd0});});});})[_0xd4c9('0x23')](function(){return db[_0xd4c9('0x3f')][_0xd4c9('0xa3')](_0x4fbc32[_0xd4c9('0x60')]['id']);})[_0xd4c9('0x23')](respondWithResult(_0x132f79,null))[_0xd4c9('0x55')](handleError(_0x132f79,null));};exports[_0xd4c9('0xa4')]=function(_0x546576,_0x147e1f,_0x4c92c6){var _0x2c5306={'raw':!![],'where':{}};var _0x6229b1={};var _0x1d07a9={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd4c9('0x6f')]({'where':{'id':_0x546576[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x147e1f,null))['then'](function(_0x350f9a){if(_0x350f9a){_0x6229b1[_0xd4c9('0x44')]=_['keys'](db['FaxMessage'][_0xd4c9('0x40')]);_0x6229b1[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x546576[_0xd4c9('0x46')]);_0x6229b1['filters']=_[_0xd4c9('0x48')](_0x6229b1['model'],_0x6229b1[_0xd4c9('0x46')]);_0x2c5306[_0xd4c9('0x49')]=_[_0xd4c9('0x48')](_0x6229b1[_0xd4c9('0x44')],qs[_0xd4c9('0x4a')](_0x546576['query'][_0xd4c9('0x4a')]));_0x2c5306[_0xd4c9('0x49')]=_0x2c5306[_0xd4c9('0x49')][_0xd4c9('0x57')]?_0x2c5306['attributes']:_0x6229b1[_0xd4c9('0x44')];if(!_0x546576[_0xd4c9('0x46')][_0xd4c9('0x67')](_0xd4c9('0x4b'))){_0x2c5306[_0xd4c9('0x32')]=qs[_0xd4c9('0x32')](_0x546576[_0xd4c9('0x46')][_0xd4c9('0x32')]);_0x2c5306['offset']=qs[_0xd4c9('0x30')](_0x546576[_0xd4c9('0x46')][_0xd4c9('0x30')]);}_0x2c5306[_0xd4c9('0x4c')]=qs[_0xd4c9('0x68')](_0x546576[_0xd4c9('0x46')][_0xd4c9('0x68')]);_0x2c5306[_0xd4c9('0x4d')]=qs[_0xd4c9('0x4e')](_[_0xd4c9('0x69')](_0x546576[_0xd4c9('0x46')],_0x6229b1['filters']));_0x2c5306[_0xd4c9('0x4d')]['FaxAccountId']=_0x350f9a['id'];if(_0x546576[_0xd4c9('0x46')][_0xd4c9('0x4f')]){_0x2c5306[_0xd4c9('0x4d')]=_[_0xd4c9('0x50')](_0x2c5306[_0xd4c9('0x4d')],{'$or':_[_0xd4c9('0x45')](_0x2c5306[_0xd4c9('0x49')],function(_0x464925){var _0x1be8ab={};_0x1be8ab[_0x464925]={'$like':'%'+_0x546576[_0xd4c9('0x46')]['filter']+'%'};return _0x1be8ab;})});}if(_0x546576[_0xd4c9('0x46')]['$gte']){var _0x1e10be=_0x546576[_0xd4c9('0x46')][_0xd4c9('0xa5')]['split'](',');var _0x212281={};_0x212281[_0x1e10be[0x0]]={'$gte':moment(_0x1e10be[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2c5306[_0xd4c9('0x4d')]=_[_0xd4c9('0x50')](_0x2c5306[_0xd4c9('0x4d')],_0x212281);}_0x2c5306=_[_0xd4c9('0x50')]({},_0x2c5306,_0x546576[_0xd4c9('0x70')]);return db[_0xd4c9('0xa6')][_0xd4c9('0x33')]({'where':_0x2c5306[_0xd4c9('0x4d')]})[_0xd4c9('0x23')](function(_0x3f4542){_0x1d07a9[_0xd4c9('0x33')]=_0x3f4542;if(_0x546576['query'][_0xd4c9('0x6a')]){_0x2c5306[_0xd4c9('0x52')]=[{'all':!![]}];}return db[_0xd4c9('0xa6')][_0xd4c9('0x53')](_0x2c5306);})[_0xd4c9('0x23')](function(_0xbdc541){_0x1d07a9[_0xd4c9('0x54')]=_0xbdc541;return _0x1d07a9;});}})['then'](respondWithFilteredResult(_0x147e1f,_0x2c5306))[_0xd4c9('0x55')](handleError(_0x147e1f,null));};exports[_0xd4c9('0x83')]=function(_0x24ad0b,_0x17f41a,_0x383085){var _0x3e9d5d,_0x2e2b9e={},_0x21ffdd;if(_0x24ad0b['body']['to']){_0x21ffdd=_0x24ad0b[_0xd4c9('0x60')]['to'][0x0];}return db['FaxAccount'][_0xd4c9('0x58')]({'where':{'id':_0x24ad0b[_0xd4c9('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0xd4c9('0xa7'),'include':[{'model':db[_0xd4c9('0x76')],'as':_0xd4c9('0xa8'),'where':{'fax':_0x21ffdd},'limit':0x1,'order':[['updatedAt',_0xd4c9('0xa9')]]}]}]})[_0xd4c9('0x23')](handleEntityNotFound(_0x17f41a,null))['then'](function(_0x22b23b){_0x3e9d5d=_0x22b23b;if(_0x24ad0b[_0xd4c9('0x60')]['attachments']&&_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][_0xd4c9('0x57')]){for(var _0x4d2445=0x0;_0x4d2445<_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')]['length'];_0x4d2445+=0x1){_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][_0x4d2445]={'filename':_0x24ad0b['body'][_0xd4c9('0xaa')][_0x4d2445][_0xd4c9('0x3c')],'id':_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][_0x4d2445]['id'],'path':path[_0xd4c9('0xab')](config['root'],_0xd4c9('0xac'),_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][_0x4d2445][_0xd4c9('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0xd4c9('0xae'),{'FaxAccountId':_['isNil'](_0x24ad0b['params']['id'])?undefined:_0x24ad0b[_0xd4c9('0x61')]['id'],'path':_[_0xd4c9('0xaf')](_0x24ad0b['body'][_0xd4c9('0xaa')][0x0][_0xd4c9('0x6')])?undefined:_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][0x0]['path'],'fax':_[_0xd4c9('0xaf')](_0x24ad0b['body']['to'][0x0])?undefined:_0x24ad0b['body']['to'][0x0]},client9002);})[_0xd4c9('0x23')](function(){if(_0x3e9d5d){if(_[_0xd4c9('0xaf')](_0x24ad0b['body'][_0xd4c9('0xb0')])){_0x24ad0b[_0xd4c9('0x60')]['from']=util[_0xd4c9('0xb1')](_0xd4c9('0xb2'),_0x3e9d5d[_0xd4c9('0x3c')],_0x3e9d5d[_0xd4c9('0xb3')]);}if(_0x3e9d5d[_0xd4c9('0xa7')]){if(_0x3e9d5d[_0xd4c9('0xa7')]['Contacts'][_0xd4c9('0x57')]){return _0x3e9d5d[_0xd4c9('0xa7')]['Contacts'][0x0];}else{return db['CmContact'][_0xd4c9('0x59')](_[_0xd4c9('0x1a')](_0x24ad0b[_0xd4c9('0x60')],{'firstName':_0x24ad0b[_0xd4c9('0x60')]['to'][0x0],'phone':_0x24ad0b[_0xd4c9('0x60')]['to'][0x0],'fax':_0x24ad0b['body']['to'][0x0],'ListId':_0x3e9d5d[_0xd4c9('0xa2')]}));}}else{throw new Error(_0xd4c9('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x147bc8){if(_0x147bc8){return db[_0xd4c9('0x75')][_0xd4c9('0x58')]({'where':{'ContactId':_0x147bc8['id'],'closed':![],'FaxAccountId':_0x3e9d5d['id']}})[_0xd4c9('0x23')](function(_0x102af8){if(_0x102af8){return[_0x102af8,![]];}return db['FaxInteraction']['create']({'UserId':_0x24ad0b[_0xd4c9('0x5a')]['id'],'ContactId':_0x147bc8['id'],'FaxAccountId':_0x3e9d5d['id'],'fax':_0x24ad0b[_0xd4c9('0x60')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xd4c9('0x50')](_0x24ad0b[_0xd4c9('0x60')],{'read':![],'body':_0x24ad0b[_0xd4c9('0x60')]['attachments'][0x0]['filename'],'FaxAccountId':_0x3e9d5d['id'],'UserId':_0x24ad0b[_0xd4c9('0x5a')]['id'],'ContactId':_0x147bc8['id'],'AttachmentId':_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xd4c9('0xa6')],'as':_0xd4c9('0xb5')}]})[_0xd4c9('0x23')](function(_0x59dd01){return[_0x59dd01,!![]];});});}else{throw new Error(_0xd4c9('0xb6'));}})[_0xd4c9('0xb7')](function(_0x1cb589,_0x5e6473){if(_0x5e6473){return _0x1cb589;}return db[_0xd4c9('0xa6')]['create']({'direction':_0xd4c9('0xb8'),'read':![],'body':_0x24ad0b['body']['attachments'][0x0][_0xd4c9('0xb9')],'FaxAccountId':_0x3e9d5d['id'],'FaxInteractionId':_0x1cb589['id'],'UserId':_0x24ad0b[_0xd4c9('0x5a')]['id'],'ContactId':_0x1cb589[_0xd4c9('0xba')],'AttachmentId':_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][0x0]['id']})['then'](function(_0x21c703){_0x1cb589[_0xd4c9('0xbb')]['Messages']=[];_0x1cb589[_0xd4c9('0xbb')][_0xd4c9('0xb5')][_0xd4c9('0x8e')](_0x21c703[_0xd4c9('0xbb')]);return _0x1cb589;});})[_0xd4c9('0x23')](function(_0x138aaa){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xd4c9('0xaf')](_0x24ad0b[_0xd4c9('0x61')]['id'])?undefined:_0x24ad0b[_0xd4c9('0x61')]['id'],'path':_[_0xd4c9('0xaf')](_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][0x0][_0xd4c9('0x6')])?undefined:_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][0x0][_0xd4c9('0x6')],'fax':_[_0xd4c9('0xaf')](_0x24ad0b['body']['to'][0x0])?undefined:_0x24ad0b[_0xd4c9('0x60')]['to'][0x0],'AttachmentId':_0x24ad0b[_0xd4c9('0x60')][_0xd4c9('0xaa')][0x0]['id']},client9002)['then'](function(_0x421b6a){logger['info']('SendFaxRpc,\x20%s',_0x421b6a);})[_0xd4c9('0x55')](function(_0x1aba06){logger['info'](_0xd4c9('0xbc'),_0x1aba06);});return _0x138aaa;})[_0xd4c9('0x23')](respondWithResult(_0x17f41a,null))[_0xd4c9('0x55')](handleError(_0x17f41a,null));};exports[_0xd4c9('0xbd')]=function(_0x17cb46,_0x3911d3,_0x481525){return db['FaxAccount'][_0xd4c9('0x58')]({'where':{'id':_0x17cb46['params']['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x3911d3,null))[_0xd4c9('0x23')](function(_0x1b7762){if(_0x1b7762){return _0x1b7762[_0xd4c9('0xbd')](_0x17cb46[_0xd4c9('0x60')][_0xd4c9('0x6c')],_[_0xd4c9('0x73')](_0x17cb46[_0xd4c9('0x60')],[_0xd4c9('0x6c'),'id'])||{})[_0xd4c9('0xb7')](function(_0x248d09){for(var _0x40f011=0x0;_0x40f011<_0x17cb46[_0xd4c9('0x60')][_0xd4c9('0x6c')][_0xd4c9('0x57')];_0x40f011+=0x1){socket[_0xd4c9('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x17cb46['body']['ids'][_0x40f011]),'FaxAccountId':Number(_0x17cb46['params']['id'])});}return _0x248d09;});}})['then'](respondWithResult(_0x3911d3,null))[_0xd4c9('0x55')](handleError(_0x3911d3,null));};exports[_0xd4c9('0xbf')]=function(_0x38cf3e,_0x3fc941,_0x1aa143){return db[_0xd4c9('0x3f')][_0xd4c9('0x58')]({'where':{'id':_0x38cf3e[_0xd4c9('0x61')]['id']}})['then'](handleEntityNotFound(_0x3fc941,null))[_0xd4c9('0x23')](function(_0x1c9d4b){if(_0x1c9d4b){return _0x1c9d4b[_0xd4c9('0xbf')](_0x38cf3e[_0xd4c9('0x46')]['ids'])[_0xd4c9('0x23')](function(){if(_[_0xd4c9('0xc0')](_0x38cf3e[_0xd4c9('0x46')][_0xd4c9('0x6c')])){for(var _0x51aea9=0x0;_0x51aea9<_0x38cf3e[_0xd4c9('0x46')][_0xd4c9('0x6c')][_0xd4c9('0x57')];_0x51aea9+=0x1){socket[_0xd4c9('0xbe')](_0xd4c9('0xc1'),{'UserId':Number(_0x38cf3e['query']['ids'][_0x51aea9]),'FaxAccountId':Number(_0x38cf3e[_0xd4c9('0x61')]['id'])});}}else{socket[_0xd4c9('0xbe')](_0xd4c9('0xc1'),{'UserId':Number(_0x38cf3e[_0xd4c9('0x46')][_0xd4c9('0x6c')]),'FaxAccountId':Number(_0x38cf3e[_0xd4c9('0x61')]['id'])});}});}})[_0xd4c9('0x23')](respondWithStatusCode(_0x3fc941,null))[_0xd4c9('0x55')](handleError(_0x3fc941,null));};exports[_0xd4c9('0xc2')]=function(_0x934a2d,_0x57fada,_0x542616){var _0x274878={};var _0x250814={};var _0x3adb64;var _0x3728bf;return db[_0xd4c9('0x3f')]['findOne']({'where':{'id':_0x934a2d[_0xd4c9('0x61')]['id']}})[_0xd4c9('0x23')](handleEntityNotFound(_0x57fada,null))[_0xd4c9('0x23')](function(_0x205ac6){if(_0x205ac6){_0x3adb64=_0x205ac6;_0x250814[_0xd4c9('0x44')]=_[_0xd4c9('0x47')](db[_0xd4c9('0x78')][_0xd4c9('0x40')]);_0x250814[_0xd4c9('0x46')]=_[_0xd4c9('0x47')](_0x934a2d[_0xd4c9('0x46')]);_0x250814['filters']=_['intersection'](_0x250814[_0xd4c9('0x44')],_0x250814[_0xd4c9('0x46')]);_0x274878[_0xd4c9('0x49')]=_[_0xd4c9('0x48')](_0x250814[_0xd4c9('0x44')],qs[_0xd4c9('0x4a')](_0x934a2d[_0xd4c9('0x46')]['fields']));_0x274878['attributes']=_0x274878[_0xd4c9('0x49')][_0xd4c9('0x57')]?_0x274878['attributes']:_0x250814['model'];_0x274878[_0xd4c9('0x4c')]=qs[_0xd4c9('0x68')](_0x934a2d[_0xd4c9('0x46')][_0xd4c9('0x68')]);_0x274878['where']=qs[_0xd4c9('0x4e')](_[_0xd4c9('0x69')](_0x934a2d[_0xd4c9('0x46')],_0x250814['filters']));if(_0x934a2d[_0xd4c9('0x46')]['filter']){_0x274878[_0xd4c9('0x4d')]=_[_0xd4c9('0x50')](_0x274878[_0xd4c9('0x4d')],{'$or':_[_0xd4c9('0x45')](_0x274878[_0xd4c9('0x49')],function(_0x56fbe3){var _0x181bd7={};_0x181bd7[_0x56fbe3]={'$like':'%'+_0x934a2d[_0xd4c9('0x46')]['filter']+'%'};return _0x181bd7;})});}_0x274878=_[_0xd4c9('0x50')]({},_0x274878,_0x934a2d[_0xd4c9('0x70')]);return _0x3adb64['getAgents'](_0x274878);}})['then'](function(_0x32a705){if(_0x32a705){_0x3728bf=_0x32a705[_0xd4c9('0x57')];if(!_0x934a2d[_0xd4c9('0x46')][_0xd4c9('0x67')](_0xd4c9('0x4b'))){_0x274878[_0xd4c9('0x32')]=qs[_0xd4c9('0x32')](_0x934a2d[_0xd4c9('0x46')][_0xd4c9('0x32')]);_0x274878[_0xd4c9('0x30')]=qs['offset'](_0x934a2d['query'][_0xd4c9('0x30')]);}return _0x3adb64[_0xd4c9('0xc2')](_0x274878);}})[_0xd4c9('0x23')](function(_0x308d5a){if(_0x308d5a){return _0x308d5a?{'count':_0x3728bf,'rows':_0x308d5a}:null;}})[_0xd4c9('0x23')](respondWithResult(_0x57fada,null))['catch'](handleError(_0x57fada,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index fdc729f..6f79c22 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 _0xfa89=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x413be2,_0x118619){var _0x53adc4=function(_0x3d2b63){while(--_0x3d2b63){_0x413be2['push'](_0x413be2['shift']());}};_0x53adc4(++_0x118619);}(_0xfa89,0x64));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x9fa8('0x0'))['db'][_0x9fa8('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9fa8('0x2')](0x0);var events={'afterCreate':_0x9fa8('0x3'),'afterUpdate':_0x9fa8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f17dd){return function(_0x44d00b,_0x6c9a9f,_0x1c3e22){FaxAccountEvents[_0x9fa8('0x5')](_0x2f17dd+':'+_0x44d00b['id'],_0x44d00b);FaxAccountEvents[_0x9fa8('0x5')](_0x2f17dd,_0x44d00b);_0x1c3e22(null);};}for(var e in events){if(events[_0x9fa8('0x6')](e)){var event=events[e];FaxAccount[_0x9fa8('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x2363=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x13530f,_0x3d60ad){var _0x33ef81=function(_0x1a80f1){while(--_0x1a80f1){_0x13530f['push'](_0x13530f['shift']());}};_0x33ef81(++_0x3d60ad);}(_0x2363,0x1e6));var _0x3236=function(_0x2b7b50,_0x5a9c78){_0x2b7b50=_0x2b7b50-0x0;var _0x1eacf=_0x2363[_0x2b7b50];return _0x1eacf;};'use strict';var EventEmitter=require(_0x3236('0x0'));var FaxAccount=require(_0x3236('0x1'))['db'][_0x3236('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3236('0x3')](0x0);var events={'afterCreate':_0x3236('0x4'),'afterUpdate':_0x3236('0x5'),'afterDestroy':'remove'};function emitEvent(_0x393612){return function(_0x79f799,_0x2290b2,_0x288a52){FaxAccountEvents[_0x3236('0x6')](_0x393612+':'+_0x79f799['id'],_0x79f799);FaxAccountEvents[_0x3236('0x6')](_0x393612,_0x79f799);_0x288a52(null);};}for(var e in events){if(events[_0x3236('0x7')](e)){var event=events[e];FaxAccount[_0x3236('0x8')](e,emitEvent(event));}}module[_0x3236('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 696acef..61051ad 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 _0x5d23=['fax_accounts','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x12867b,_0x934d70){var _0xde005c=function(_0x407a69){while(--_0x407a69){_0x12867b['push'](_0x12867b['shift']());}};_0xde005c(++_0x934d70);}(_0x5d23,0x1b1));var _0x35d2=function(_0x244c86,_0x5d8ac6){_0x244c86=_0x244c86-0x0;var _0x4515c8=_0x5d23[_0x244c86];return _0x4515c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x35d2('0x0'))('api');var moment=require('moment');var BPromise=require(_0x35d2('0x1'));var rp=require(_0x35d2('0x2'));var fs=require('fs');var path=require(_0x35d2('0x3'));var rimraf=require(_0x35d2('0x4'));var config=require(_0x35d2('0x5'));var attributes=require('./faxAccount.attributes');module[_0x35d2('0x6')]=function(_0x17a7ec,_0x5b378d){return _0x17a7ec[_0x35d2('0x7')]('FaxAccount',attributes,{'tableName':_0x35d2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fc8=['request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','lodash','api','moment'];(function(_0x398437,_0x382e5f){var _0x539597=function(_0x296472){while(--_0x296472){_0x398437['push'](_0x398437['shift']());}};_0x539597(++_0x382e5f);}(_0x9fc8,0x13d));var _0x89fc=function(_0x2908c7,_0x538499){_0x2908c7=_0x2908c7-0x0;var _0x16c521=_0x9fc8[_0x2908c7];return _0x16c521;};'use strict';var _=require(_0x89fc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x89fc('0x1'));var moment=require(_0x89fc('0x2'));var BPromise=require('bluebird');var rp=require(_0x89fc('0x3'));var fs=require('fs');var path=require(_0x89fc('0x4'));var rimraf=require(_0x89fc('0x5'));var config=require(_0x89fc('0x6'));var attributes=require(_0x89fc('0x7'));module['exports']=function(_0x29f611,_0x13f37b){return _0x29f611[_0x89fc('0x8')](_0x89fc('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 9be1fa1..c10e483 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 _0xc1fe=['model','then','debug','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','FaxApplication','Applications','get','applications','list','orderBy','List','length','create','contact','FaxInteraction','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','defaults','redis','localhost','socket.io-emitter','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x1d6265,_0x5dbaae){var _0x3bed33=function(_0x1b06b6){while(--_0x1b06b6){_0x1d6265['push'](_0x1d6265['shift']());}};_0x3bed33(++_0x5dbaae);}(_0xc1fe,0xe6));var _0xec1f=function(_0x4b2300,_0x58cbca){_0x4b2300=_0x4b2300-0x0;var _0xd1b807=_0xc1fe[_0x4b2300];return _0xd1b807;};'use strict';var _=require(_0xec1f('0x0'));var util=require(_0xec1f('0x1'));var moment=require(_0xec1f('0x2'));var BPromise=require(_0xec1f('0x3'));var rs=require(_0xec1f('0x4'));var fs=require('fs');var Redis=require(_0xec1f('0x5'));var db=require(_0xec1f('0x6'))['db'];var utils=require(_0xec1f('0x7'));var logger=require(_0xec1f('0x8'))(_0xec1f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0xec1f('0xa')](config[_0xec1f('0xb')],{'host':_0xec1f('0xc'),'port':0x18eb});var socket=require(_0xec1f('0xd'))(new Redis(config[_0xec1f('0xb')]));require('./faxAccount.socket')[_0xec1f('0xe')](socket);function respondWithRpcPromise(_0x1bb012,_0x32bd4d,_0x1f5271){return new BPromise(function(_0x137b4d,_0x36115b){return client[_0xec1f('0xf')](_0x1bb012,_0x1f5271)['then'](function(_0x1993ca){logger[_0xec1f('0x10')](_0xec1f('0x11'),_0x32bd4d,_0xec1f('0x12'));logger['debug'](_0xec1f('0x13'),_0x32bd4d,_0xec1f('0x12'),JSON['stringify'](_0x1993ca));if(_0x1993ca['error']){if(_0x1993ca[_0xec1f('0x14')][_0xec1f('0x15')]===0x1f4){logger['error'](_0xec1f('0x11'),_0x32bd4d,_0x1993ca['error'][_0xec1f('0x16')]);return _0x36115b(_0x1993ca['error'][_0xec1f('0x16')]);}logger['error'](_0xec1f('0x11'),_0x32bd4d,_0x1993ca[_0xec1f('0x14')][_0xec1f('0x16')]);return _0x137b4d(_0x1993ca[_0xec1f('0x14')]['message']);}else{logger['info'](_0xec1f('0x11'),_0x32bd4d,_0xec1f('0x12'));_0x137b4d(_0x1993ca['result']['message']);}})[_0xec1f('0x17')](function(_0x30858c){logger[_0xec1f('0x14')]('FaxAccount,\x20%s,\x20%s',_0x32bd4d,_0x30858c);_0x36115b(_0x30858c);});});}exports[_0xec1f('0x18')]=function(_0x117eb6){var _0x26dffa=this;return new Promise(function(_0x4921ad,_0x3f857d){return db[_0xec1f('0x19')][_0xec1f('0x1a')]({'raw':_0x117eb6[_0xec1f('0x1b')]?_0x117eb6[_0xec1f('0x1b')][_0xec1f('0x1c')]===undefined?!![]:![]:!![],'where':_0x117eb6[_0xec1f('0x1b')]?_0x117eb6['options'][_0xec1f('0x1d')]||null:null,'attributes':_0x117eb6['options']?_0x117eb6[_0xec1f('0x1b')][_0xec1f('0x1e')]||null:null,'limit':_0x117eb6[_0xec1f('0x1b')]?_0x117eb6[_0xec1f('0x1b')][_0xec1f('0x1f')]||null:null,'include':_0x117eb6[_0xec1f('0x1b')]?_0x117eb6['options'][_0xec1f('0x20')]?_[_0xec1f('0x21')](_0x117eb6[_0xec1f('0x1b')][_0xec1f('0x20')],function(_0x1817a9){return{'model':db[_0x1817a9[_0xec1f('0x22')]],'as':_0x1817a9['as'],'attributes':_0x1817a9[_0xec1f('0x1e')],'include':_0x1817a9[_0xec1f('0x20')]?_[_0xec1f('0x21')](_0x1817a9[_0xec1f('0x20')],function(_0x27c3d9){return{'model':db[_0x27c3d9[_0xec1f('0x22')]],'as':_0x27c3d9['as'],'attributes':_0x27c3d9[_0xec1f('0x1e')],'include':_0x27c3d9[_0xec1f('0x20')]?_[_0xec1f('0x21')](_0x27c3d9[_0xec1f('0x20')],function(_0x163b0a){return{'model':db[_0x163b0a[_0xec1f('0x22')]],'as':_0x163b0a['as'],'attributes':_0x163b0a[_0xec1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xec1f('0x23')](function(_0x5f3e2d){logger['info']('GetFaxAccount',_0x117eb6);logger[_0xec1f('0x24')](_0xec1f('0x18'),_0x117eb6,JSON[_0xec1f('0x25')](_0x5f3e2d));_0x4921ad(_0x5f3e2d);})[_0xec1f('0x17')](function(_0x31b530){logger[_0xec1f('0x14')](_0xec1f('0x18'),_0x31b530[_0xec1f('0x16')],_0x117eb6);_0x3f857d(_0x26dffa['error'](0x1f4,_0x31b530[_0xec1f('0x16')]));});});};exports[_0xec1f('0x26')]=function(_0x2fac96,_0x4ea146,_0x5ae541){var _0x4cf69c=this;return new Promise(function(_0xe10123,_0x867fdd){var _0xad7363={'body':_0x2fac96[_0xec1f('0x27')],'channel':_0xec1f('0x28')};var _0x2ccda1=[];var _0x156c73=[];var _0x34af97={};return db[_0xec1f('0x29')][_0xec1f('0x2a')]()[_0xec1f('0x23')](function(_0x4f2c55){if(!_0x4f2c55){throw new db[(_0xec1f('0x2b'))][(_0xec1f('0x2c'))](_0xec1f('0x2d'));}_0x2ccda1=_['difference'](_[_0xec1f('0x2e')](_0x4f2c55),[_0xec1f('0x2f'),_0xec1f('0x30')]);_0x156c73=_[_0xec1f('0x31')](_[_0xec1f('0x2e')](_0x4f2c55),[_0xec1f('0x2f'),_0xec1f('0x30'),'CompanyId',_0xec1f('0x32')]);if(_0x2fac96['body']['id']){delete _0x2fac96['body']['id'];}if(_[_0xec1f('0x33')](_0x2fac96[_0xec1f('0x27')][_0xec1f('0x34')])){throw new db[(_0xec1f('0x2b'))][(_0xec1f('0x2c'))](_0xec1f('0x35'));}if(_[_0xec1f('0x33')](_0x2fac96['body']['body'])||_0x2fac96[_0xec1f('0x27')]['body']===''){throw new db[(_0xec1f('0x2b'))]['ValidationError'](_0xec1f('0x36'));}if(_['isNil'](_0x2fac96[_0xec1f('0x27')][_0xec1f('0x37')])){throw new db['Sequelize']['ValidationError'](_0xec1f('0x38')+_0x156c73);}if(!_[_0xec1f('0x39')](_0x156c73,_0x2fac96[_0xec1f('0x27')][_0xec1f('0x37')])){throw new db[(_0xec1f('0x2b'))][(_0xec1f('0x2c'))](_0xec1f('0x3a')+_0x156c73);}_0x34af97[_0x2fac96['body'][_0xec1f('0x37')]]=_0x2fac96['body'][_0xec1f('0x34')];})[_0xec1f('0x23')](function(){return db['FaxAccount'][_0xec1f('0x3b')]({'where':{'id':_0x2fac96[_0xec1f('0x3c')]['id']},'include':[{'model':db[_0xec1f('0x3d')],'as':'List','include':[{'model':db['CmContact'],'as':_0xec1f('0x3e'),'where':_0x34af97,'limit':0x1,'order':[[_0xec1f('0x30'),'DESC']]}]},{'model':db[_0xec1f('0x3f')],'as':_0xec1f('0x40')}]});})[_0xec1f('0x23')](function(_0x331228){if(_0x331228&&_0x331228['List']){var _0x487fbe=_0x331228[_0xec1f('0x41')]({'plain':!![]});_0xad7363[_0xec1f('0x3c')]=_0x487fbe;_0xad7363[_0xec1f('0x42')]=_0x487fbe[_0xec1f('0x40')];_0xad7363[_0xec1f('0x43')]=_0x487fbe['List'];_0xad7363[_0xec1f('0x42')]=_[_0xec1f('0x44')](_0xad7363[_0xec1f('0x42')],['priority'],['asc']);if(_0xad7363[_0xec1f('0x3c')]['Applications']){delete _0xad7363['account'][_0xec1f('0x40')];}if(_0xad7363[_0xec1f('0x3c')][_0xec1f('0x45')]&&_0xad7363['account'][_0xec1f('0x45')][_0xec1f('0x3e')][_0xec1f('0x46')]){return _0xad7363[_0xec1f('0x3c')]['List'][_0xec1f('0x3e')][0x0];}var _0x2e74dc=_[_0xec1f('0xa')](_0x2fac96[_0xec1f('0x27')],{'firstName':_0x2fac96['body'][_0xec1f('0x34')],'ListId':_0x487fbe[_0xec1f('0x32')]});_0x2e74dc[_0x2fac96[_0xec1f('0x27')][_0xec1f('0x37')]]=_0x2fac96['body'][_0xec1f('0x34')];return db[_0xec1f('0x29')][_0xec1f('0x47')](_0x2e74dc,{'fields':_0x2ccda1,'raw':!![]});}})[_0xec1f('0x23')](function(_0x177dbe){_0xad7363[_0xec1f('0x48')]=_0x177dbe;if(_0x177dbe){var _0x5b44e7={'ContactId':_0x177dbe['id'],'FaxAccountId':_0x2fac96[_0xec1f('0x3c')]['id'],'fax':_0x177dbe[_0xec1f('0x28')]};return db[_0xec1f('0x49')]['find']({'where':{'ContactId':_0x177dbe['id'],'closed':![],'FaxAccountId':_0x2fac96[_0xec1f('0x3c')]['id']}})[_0xec1f('0x23')](function(_0x540536){if(_0x540536){return[_0x540536,![]];}return db[_0xec1f('0x49')][_0xec1f('0x47')](_0x5b44e7)['then'](function(_0x4f9dd9){return[_0x4f9dd9,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x31377f,_0x54e626){var _0xf2a441=_0x31377f[_0xec1f('0x41')]({'plain':!![]});if(_0x54e626){if(_0xad7363['account'][_0xec1f('0x4a')]){_0xad7363[_0xec1f('0x42')][_0xec1f('0x4b')]({'id':0x0,'priority':_0xad7363[_0xec1f('0x42')][_0xec1f('0x46')]+0x1,'app':_0xec1f('0x4c'),'appdata':_0xec1f('0x4d'),'interval':_0xec1f('0x4e')});}_0xf2a441['created']=!![];}else{_0xf2a441[_0xec1f('0x4f')]=![];}_0xad7363[_0xec1f('0x50')]=_0xf2a441;return db[_0xec1f('0x51')][_0xec1f('0x47')]({'body':_0x2fac96[_0xec1f('0x27')][_0xec1f('0x27')],'FaxAccountId':_0x2fac96[_0xec1f('0x3c')]['id'],'FaxInteractionId':_0x31377f['id'],'direction':'in','ContactId':_0x31377f['ContactId'],'AttachmentId':_0x2fac96[_0xec1f('0x27')][_0xec1f('0x52')]});})[_0xec1f('0x23')](function(_0x4ecaaf){_0xad7363[_0xec1f('0x16')]=_0x4ecaaf;if(_0xad7363[_0xec1f('0x50')][_0xec1f('0x53')]){return db[_0xec1f('0x54')][_0xec1f('0x3b')]({'attributes':['id','name'],'where':{'id':_0xad7363[_0xec1f('0x50')]['UserId']}})['then'](function(_0x1a520a){if(_0x1a520a){_0xad7363['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a520a['name']+','+(_0xad7363['account'][_0xec1f('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xec1f('0x56'),_0xec1f('0x57'),_0xad7363);});}return respondWithRpcPromise('Start','startRouting',_0xad7363);})[_0xec1f('0x23')](function(_0x322c6b){_0xe10123(_0x322c6b);})['catch'](function(_0x2478af){_0x867fdd(_0x4cf69c[_0xec1f('0x14')](0x1f4,_0x2478af['message']));});});}; \ No newline at end of file +var _0xd9de=['map','model','NotifyFaxAccount','fax','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','ListId','body','isNil','from','ValidationError','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','find','CmList','List','DESC','FaxApplication','get','account','applications','Applications','list','orderBy','priority','length','Contacts','defaults','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','debug','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','limit','include'];(function(_0x4bfc2e,_0x52134d){var _0x285558=function(_0x24bec8){while(--_0x24bec8){_0x4bfc2e['push'](_0x4bfc2e['shift']());}};_0x285558(++_0x52134d);}(_0xd9de,0x140));var _0xed9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd9de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xed9d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xed9d('0x1'));var rs=require(_0xed9d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed9d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xed9d('0x4'))(_0xed9d('0x5'));var config=require(_0xed9d('0x6'));var jayson=require(_0xed9d('0x7'));var client=jayson['client'][_0xed9d('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0xed9d('0x9')],{'host':_0xed9d('0xa'),'port':0x18eb});var socket=require(_0xed9d('0xb'))(new Redis(config['redis']));require(_0xed9d('0xc'))[_0xed9d('0xd')](socket);function respondWithRpcPromise(_0x560d10,_0x324fb4,_0x45fc61){return new BPromise(function(_0x6dcf8c,_0x5d0c3b){return client[_0xed9d('0xe')](_0x560d10,_0x45fc61)[_0xed9d('0xf')](function(_0xd68078){logger[_0xed9d('0x10')]('FaxAccount,\x20%s,\x20%s',_0x324fb4,'request\x20sent');logger[_0xed9d('0x11')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x324fb4,_0xed9d('0x12'),JSON['stringify'](_0xd68078));if(_0xd68078[_0xed9d('0x13')]){if(_0xd68078[_0xed9d('0x13')][_0xed9d('0x14')]===0x1f4){logger[_0xed9d('0x13')](_0xed9d('0x15'),_0x324fb4,_0xd68078[_0xed9d('0x13')][_0xed9d('0x16')]);return _0x5d0c3b(_0xd68078[_0xed9d('0x13')]['message']);}logger[_0xed9d('0x13')](_0xed9d('0x15'),_0x324fb4,_0xd68078[_0xed9d('0x13')][_0xed9d('0x16')]);return _0x6dcf8c(_0xd68078['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x324fb4,_0xed9d('0x12'));_0x6dcf8c(_0xd68078[_0xed9d('0x17')][_0xed9d('0x16')]);}})[_0xed9d('0x18')](function(_0x2cbeac){logger[_0xed9d('0x13')](_0xed9d('0x15'),_0x324fb4,_0x2cbeac);_0x5d0c3b(_0x2cbeac);});});}exports[_0xed9d('0x19')]=function(_0x508492){var _0x284149=this;return new Promise(function(_0x2d7922,_0x12c732){return db[_0xed9d('0x1a')][_0xed9d('0x1b')]({'raw':_0x508492[_0xed9d('0x1c')]?_0x508492[_0xed9d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x508492[_0xed9d('0x1c')]?_0x508492[_0xed9d('0x1c')]['where']||null:null,'attributes':_0x508492[_0xed9d('0x1c')]?_0x508492[_0xed9d('0x1c')][_0xed9d('0x1d')]||null:null,'limit':_0x508492[_0xed9d('0x1c')]?_0x508492[_0xed9d('0x1c')][_0xed9d('0x1e')]||null:null,'include':_0x508492['options']?_0x508492[_0xed9d('0x1c')][_0xed9d('0x1f')]?_[_0xed9d('0x20')](_0x508492['options'][_0xed9d('0x1f')],function(_0x12e42d){return{'model':db[_0x12e42d[_0xed9d('0x21')]],'as':_0x12e42d['as'],'attributes':_0x12e42d[_0xed9d('0x1d')],'include':_0x12e42d[_0xed9d('0x1f')]?_['map'](_0x12e42d[_0xed9d('0x1f')],function(_0x54ada3){return{'model':db[_0x54ada3[_0xed9d('0x21')]],'as':_0x54ada3['as'],'attributes':_0x54ada3['attributes'],'include':_0x54ada3[_0xed9d('0x1f')]?_[_0xed9d('0x20')](_0x54ada3[_0xed9d('0x1f')],function(_0x593c42){return{'model':db[_0x593c42['model']],'as':_0x593c42['as'],'attributes':_0x593c42[_0xed9d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xed9d('0xf')](function(_0x412981){logger['info']('GetFaxAccount',_0x508492);logger['debug'](_0xed9d('0x19'),_0x508492,JSON['stringify'](_0x412981));_0x2d7922(_0x412981);})['catch'](function(_0x17151c){logger[_0xed9d('0x13')](_0xed9d('0x19'),_0x17151c[_0xed9d('0x16')],_0x508492);_0x12c732(_0x284149[_0xed9d('0x13')](0x1f4,_0x17151c[_0xed9d('0x16')]));});});};exports[_0xed9d('0x22')]=function(_0x266779,_0x435f79,_0x3e32e2){var _0x506ffe=this;return new Promise(function(_0x366fa8,_0x18c135){var _0x19be13={'body':_0x266779['body'],'channel':_0xed9d('0x23')};var _0x27791a=[];var _0x4e7910=[];var _0x3ae414={};return db['CmContact']['describe']()[_0xed9d('0xf')](function(_0x3a7cad){if(!_0x3a7cad){throw new db['Sequelize']['ValidationError'](_0xed9d('0x24'));}_0x27791a=_['difference'](_[_0xed9d('0x25')](_0x3a7cad),[_0xed9d('0x26'),_0xed9d('0x27')]);_0x4e7910=_[_0xed9d('0x28')](_[_0xed9d('0x25')](_0x3a7cad),[_0xed9d('0x26'),_0xed9d('0x27'),'CompanyId',_0xed9d('0x29')]);if(_0x266779[_0xed9d('0x2a')]['id']){delete _0x266779[_0xed9d('0x2a')]['id'];}if(_[_0xed9d('0x2b')](_0x266779['body'][_0xed9d('0x2c')])){throw new db['Sequelize'][(_0xed9d('0x2d'))]('from\x20is\x20mandatory');}if(_[_0xed9d('0x2b')](_0x266779[_0xed9d('0x2a')][_0xed9d('0x2a')])||_0x266779[_0xed9d('0x2a')][_0xed9d('0x2a')]===''){throw new db[(_0xed9d('0x2e'))]['ValidationError'](_0xed9d('0x2f'));}if(_[_0xed9d('0x2b')](_0x266779[_0xed9d('0x2a')][_0xed9d('0x30')])){throw new db['Sequelize'][(_0xed9d('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e7910);}if(!_[_0xed9d('0x31')](_0x4e7910,_0x266779[_0xed9d('0x2a')][_0xed9d('0x30')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e7910);}_0x3ae414[_0x266779[_0xed9d('0x2a')]['mapKey']]=_0x266779['body']['from'];})[_0xed9d('0xf')](function(){return db[_0xed9d('0x1a')][_0xed9d('0x32')]({'where':{'id':_0x266779['account']['id']},'include':[{'model':db[_0xed9d('0x33')],'as':_0xed9d('0x34'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3ae414,'limit':0x1,'order':[[_0xed9d('0x27'),_0xed9d('0x35')]]}]},{'model':db[_0xed9d('0x36')],'as':'Applications'}]});})[_0xed9d('0xf')](function(_0x1c6d59){if(_0x1c6d59&&_0x1c6d59[_0xed9d('0x34')]){var _0x178d0=_0x1c6d59[_0xed9d('0x37')]({'plain':!![]});_0x19be13[_0xed9d('0x38')]=_0x178d0;_0x19be13[_0xed9d('0x39')]=_0x178d0[_0xed9d('0x3a')];_0x19be13[_0xed9d('0x3b')]=_0x178d0[_0xed9d('0x34')];_0x19be13[_0xed9d('0x39')]=_[_0xed9d('0x3c')](_0x19be13[_0xed9d('0x39')],[_0xed9d('0x3d')],['asc']);if(_0x19be13[_0xed9d('0x38')][_0xed9d('0x3a')]){delete _0x19be13[_0xed9d('0x38')][_0xed9d('0x3a')];}if(_0x19be13[_0xed9d('0x38')][_0xed9d('0x34')]&&_0x19be13[_0xed9d('0x38')]['List']['Contacts'][_0xed9d('0x3e')]){return _0x19be13[_0xed9d('0x38')][_0xed9d('0x34')][_0xed9d('0x3f')][0x0];}var _0x1aa16b=_[_0xed9d('0x40')](_0x266779[_0xed9d('0x2a')],{'firstName':_0x266779[_0xed9d('0x2a')][_0xed9d('0x2c')],'ListId':_0x178d0['ListId']});_0x1aa16b[_0x266779[_0xed9d('0x2a')][_0xed9d('0x30')]]=_0x266779[_0xed9d('0x2a')][_0xed9d('0x2c')];return db[_0xed9d('0x41')][_0xed9d('0x42')](_0x1aa16b,{'fields':_0x27791a,'raw':!![]});}})[_0xed9d('0xf')](function(_0x2fb1da){_0x19be13[_0xed9d('0x43')]=_0x2fb1da;if(_0x2fb1da){var _0x3e096e={'ContactId':_0x2fb1da['id'],'FaxAccountId':_0x266779['account']['id'],'fax':_0x2fb1da[_0xed9d('0x23')]};return db['FaxInteraction'][_0xed9d('0x32')]({'where':{'ContactId':_0x2fb1da['id'],'closed':![],'FaxAccountId':_0x266779[_0xed9d('0x38')]['id']}})[_0xed9d('0xf')](function(_0x2e2b2a){if(_0x2e2b2a){return[_0x2e2b2a,![]];}return db[_0xed9d('0x44')][_0xed9d('0x42')](_0x3e096e)[_0xed9d('0xf')](function(_0x11178a){return[_0x11178a,!![]];});});}else{throw new Error(_0xed9d('0x45'));}})[_0xed9d('0x46')](function(_0x364fa8,_0x404880){var _0x3a19a8=_0x364fa8[_0xed9d('0x37')]({'plain':!![]});if(_0x404880){if(_0x19be13[_0xed9d('0x38')][_0xed9d('0x47')]){_0x19be13[_0xed9d('0x39')][_0xed9d('0x48')]({'id':0x0,'priority':_0x19be13[_0xed9d('0x39')][_0xed9d('0x3e')]+0x1,'app':'close','appdata':_0xed9d('0x49'),'interval':_0xed9d('0x4a')});}_0x3a19a8[_0xed9d('0x4b')]=!![];}else{_0x3a19a8[_0xed9d('0x4b')]=![];}_0x19be13[_0xed9d('0x4c')]=_0x3a19a8;return db[_0xed9d('0x4d')][_0xed9d('0x42')]({'body':_0x266779[_0xed9d('0x2a')][_0xed9d('0x2a')],'FaxAccountId':_0x266779['account']['id'],'FaxInteractionId':_0x364fa8['id'],'direction':'in','ContactId':_0x364fa8[_0xed9d('0x4e')],'AttachmentId':_0x266779['body'][_0xed9d('0x4f')]});})[_0xed9d('0xf')](function(_0x560f5b){_0x19be13[_0xed9d('0x16')]=_0x560f5b;if(_0x19be13[_0xed9d('0x4c')][_0xed9d('0x50')]){return db[_0xed9d('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x19be13[_0xed9d('0x4c')][_0xed9d('0x50')]}})[_0xed9d('0xf')](function(_0x3ee086){if(_0x3ee086){_0x19be13['applications'][_0xed9d('0x52')]({'id':0x0,'priority':0x0,'app':_0xed9d('0x53'),'appdata':_0x3ee086[_0xed9d('0x54')]+','+(_0x19be13[_0xed9d('0x38')][_0xed9d('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xed9d('0x56'),_0xed9d('0x57'),_0x19be13);});}return respondWithRpcPromise('Start',_0xed9d('0x57'),_0x19be13);})[_0xed9d('0xf')](function(_0x49b8c5){_0x366fa8(_0x49b8c5);})[_0xed9d('0x18')](function(_0x56d2a2){_0x18c135(_0x506ffe['error'](0x1f4,_0x56d2a2[_0xed9d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 0dbd2dc..b55192e 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 _0x3ca7=['update'];(function(_0x26bbd1,_0xb274f3){var _0x26b1eb=function(_0x4cf794){while(--_0x4cf794){_0x26bbd1['push'](_0x26bbd1['shift']());}};_0x26b1eb(++_0xb274f3);}(_0x3ca7,0x142));var _0x73ca=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x3ca7[_0x53abe5];return _0xc1c37e;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save','remove',_0x73ca('0x0')];function createListener(_0x5c44c9,_0x174613){return function(_0x5bf705){_0x174613['emit'](_0x5c44c9,_0x5bf705);};}function removeListener(_0x6b6b71,_0x4aad9d){return function(){FaxAccountEvents['removeListener'](_0x6b6b71,_0x4aad9d);};}exports['register']=function(_0x1e04bc){for(var _0x5d3d01=0x0,_0x3fa5ab=events['length'];_0x5d3d01<_0x3fa5ab;_0x5d3d01++){var _0x56d11f=events[_0x5d3d01];var _0x2703e3=createListener('faxAccount:'+_0x56d11f,_0x1e04bc);FaxAccountEvents['on'](_0x56d11f,_0x2703e3);}}; \ No newline at end of file +var _0xbd72=['update','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xbd72,0x10d));var _0x2bd7=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0xbd72[_0x12ca5f];return _0xfc3ae9;};'use strict';var FaxAccountEvents=require(_0x2bd7('0x0'));var events=[_0x2bd7('0x1'),_0x2bd7('0x2'),_0x2bd7('0x3')];function createListener(_0x119152,_0x20ead9){return function(_0x5c2cba){_0x20ead9['emit'](_0x119152,_0x5c2cba);};}function removeListener(_0xd68fea,_0x44b27a){return function(){FaxAccountEvents[_0x2bd7('0x4')](_0xd68fea,_0x44b27a);};}exports[_0x2bd7('0x5')]=function(_0x4b8491){for(var _0x463f9b=0x0,_0x35659f=events[_0x2bd7('0x6')];_0x463f9b<_0x35659f;_0x463f9b++){var _0x12b039=events[_0x463f9b];var _0x559090=createListener(_0x2bd7('0x7')+_0x12b039,_0x4b8491);FaxAccountEvents['on'](_0x12b039,_0x559090);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a62802c..012307e 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(_0x3697c3,_0x1054f5){var _0x343cd1=function(_0x1b1797){while(--_0x1b1797){_0x3697c3['push'](_0x3697c3['shift']());}};_0x343cd1(++_0x1054f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x49b39b,_0x561f3b){var _0x5e48c7=function(_0x40f8fa){while(--_0x40f8fa){_0x49b39b['push'](_0x49b39b['shift']());}};_0x5e48c7(++_0x561f3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 511137f..6cf6bee 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 _0xcc87=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xcc87,0x158));var _0x7cc8=function(_0x65f140,_0x45cbc7){_0x65f140=_0x65f140-0x0;var _0x18fbda=_0xcc87[_0x65f140];return _0x18fbda;};'use strict';var Sequelize=require(_0x7cc8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7cc8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7cc8('0x2')],'allowNull':![],'defaultValue':_0x7cc8('0x3')},'appdata':{'type':Sequelize[_0x7cc8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7cc8('0x2')],'defaultValue':_0x7cc8('0x5')}}; \ No newline at end of file +var _0x6721=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x6721,0x159));var _0x1672=function(_0x104c6f,_0x34ff6d){_0x104c6f=_0x104c6f-0x0;var _0xdb89b4=_0x6721[_0x104c6f];return _0xdb89b4;};'use strict';var Sequelize=require(_0x1672('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1672('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1672('0x2')],'allowNull':![],'defaultValue':_0x1672('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1672('0x2')]},'interval':{'type':Sequelize[_0x1672('0x2')],'defaultValue':_0x1672('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 1650fc5..98ae86c 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 _0x7cbe=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','eml-format','rimraf','request-promise'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x7cbe,0x95));var _0xe7cb=function(_0x47a3af,_0x113c26){_0x47a3af=_0x47a3af-0x0;var _0x3871a8=_0x7cbe[_0x47a3af];return _0x3871a8;};'use strict';var emlformat=require(_0xe7cb('0x0'));var rimraf=require(_0xe7cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe7cb('0x2'));var moment=require(_0xe7cb('0x3'));var BPromise=require(_0xe7cb('0x4'));var Mustache=require(_0xe7cb('0x5'));var util=require(_0xe7cb('0x6'));var path=require(_0xe7cb('0x7'));var sox=require(_0xe7cb('0x8'));var csv=require(_0xe7cb('0x9'));var ejs=require(_0xe7cb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7cb('0xb'));var _=require(_0xe7cb('0xc'));var squel=require(_0xe7cb('0xd'));var crypto=require(_0xe7cb('0xe'));var jsforce=require(_0xe7cb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe7cb('0x10'));var Redis=require(_0xe7cb('0x11'));var authService=require(_0xe7cb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe7cb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7cb('0x14'))(_0xe7cb('0x15'));var utils=require(_0xe7cb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe7cb('0x17'));var db=require(_0xe7cb('0x18'))['db'];function respondWithStatusCode(_0x1212ad,_0x1eed34){_0x1eed34=_0x1eed34||0xcc;return function(_0x9c8a4){if(_0x9c8a4){return _0x1212ad[_0xe7cb('0x19')](_0x1eed34);}return _0x1212ad[_0xe7cb('0x1a')](_0x1eed34)[_0xe7cb('0x1b')]();};}function respondWithResult(_0x175011,_0x1ab2ce){_0x1ab2ce=_0x1ab2ce||0xc8;return function(_0x2b623b){if(_0x2b623b){return _0x175011[_0xe7cb('0x1a')](_0x1ab2ce)[_0xe7cb('0x1c')](_0x2b623b);}};}function respondWithFilteredResult(_0x297fe9,_0x3390c0){return function(_0x1a2bca){if(_0x1a2bca){var _0x125dea=typeof _0x3390c0[_0xe7cb('0x1d')]===_0xe7cb('0x1e')&&typeof _0x3390c0['limit']==='undefined';var _0x57db0c=_0x1a2bca[_0xe7cb('0x1f')];var _0x4f2875=_0x125dea?0x0:_0x3390c0[_0xe7cb('0x1d')];var _0x3d4937=_0x125dea?_0x1a2bca['count']:_0x3390c0[_0xe7cb('0x1d')]+_0x3390c0['limit'];var _0x1ee9bc;if(_0x3d4937>=_0x57db0c){_0x3d4937=_0x57db0c;_0x1ee9bc=0xc8;}else{_0x1ee9bc=0xce;}_0x297fe9[_0xe7cb('0x1a')](_0x1ee9bc);return _0x297fe9[_0xe7cb('0x20')](_0xe7cb('0x21'),_0x4f2875+'-'+_0x3d4937+'/'+_0x57db0c)[_0xe7cb('0x1c')](_0x1a2bca);}return null;};}function patchUpdates(_0x5d7424){return function(_0x5988f2){try{jsonpatch['apply'](_0x5988f2,_0x5d7424,!![]);}catch(_0x3b7e3b){return BPromise[_0xe7cb('0x22')](_0x3b7e3b);}return _0x5988f2['save']();};}function saveUpdates(_0xa75af1,_0x2b700d){return function(_0xea8c2b){if(_0xea8c2b){return _0xea8c2b[_0xe7cb('0x23')](_0xa75af1)[_0xe7cb('0x24')](function(_0x266b2e){return _0x266b2e;});}return null;};}function removeEntity(_0x3d04f6,_0x38ca8c){return function(_0x24344c){if(_0x24344c){return _0x24344c[_0xe7cb('0x25')]()[_0xe7cb('0x24')](function(){_0x3d04f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3881b9,_0x169f23){return function(_0x4f35ec){if(!_0x4f35ec){_0x3881b9[_0xe7cb('0x19')](0x194);}return _0x4f35ec;};}function handleError(_0x51b72a,_0x57ad7a){_0x57ad7a=_0x57ad7a||0x1f4;return function(_0x45237a){logger[_0xe7cb('0x26')](_0x45237a[_0xe7cb('0x27')]);if(_0x45237a[_0xe7cb('0x28')]){delete _0x45237a[_0xe7cb('0x28')];}_0x51b72a[_0xe7cb('0x1a')](_0x57ad7a)[_0xe7cb('0x29')](_0x45237a);};}exports[_0xe7cb('0x2a')]=function(_0x4675ec,_0x4ea6a0){var _0x1f5db4={},_0x379682={},_0x33ca9f={'count':0x0,'rows':[]};var _0x11b971=_[_0xe7cb('0x2b')](db[_0xe7cb('0x2c')][_0xe7cb('0x2d')],function(_0x4a8e4d){return{'name':_0x4a8e4d[_0xe7cb('0x2e')],'type':_0x4a8e4d['type'][_0xe7cb('0x2f')]};});_0x379682['model']=_['map'](_0x11b971,_0xe7cb('0x28'));_0x379682[_0xe7cb('0x30')]=_[_0xe7cb('0x31')](_0x4675ec['query']);_0x379682[_0xe7cb('0x32')]=_['intersection'](_0x379682[_0xe7cb('0x33')],_0x379682[_0xe7cb('0x30')]);_0x1f5db4[_0xe7cb('0x34')]=_[_0xe7cb('0x35')](_0x379682[_0xe7cb('0x33')],qs[_0xe7cb('0x36')](_0x4675ec['query'][_0xe7cb('0x36')]));_0x1f5db4['attributes']=_0x1f5db4[_0xe7cb('0x34')]['length']?_0x1f5db4[_0xe7cb('0x34')]:_0x379682[_0xe7cb('0x33')];if(!_0x4675ec['query']['hasOwnProperty'](_0xe7cb('0x37'))){_0x1f5db4[_0xe7cb('0x38')]=qs[_0xe7cb('0x38')](_0x4675ec[_0xe7cb('0x30')][_0xe7cb('0x38')]);_0x1f5db4['offset']=qs[_0xe7cb('0x1d')](_0x4675ec[_0xe7cb('0x30')][_0xe7cb('0x1d')]);}_0x1f5db4[_0xe7cb('0x39')]=qs[_0xe7cb('0x3a')](_0x4675ec[_0xe7cb('0x30')]['sort']);_0x1f5db4[_0xe7cb('0x3b')]=qs['filters'](_['pick'](_0x4675ec[_0xe7cb('0x30')],_0x379682[_0xe7cb('0x32')]),_0x11b971);if(_0x4675ec[_0xe7cb('0x30')][_0xe7cb('0x3c')]){_0x1f5db4[_0xe7cb('0x3b')]=_[_0xe7cb('0x3d')](_0x1f5db4[_0xe7cb('0x3b')],{'$or':_[_0xe7cb('0x2b')](_0x11b971,function(_0x5abfd5){if(_0x5abfd5[_0xe7cb('0x3e')]!==_0xe7cb('0x3f')){var _0x2083cd={};_0x2083cd[_0x5abfd5[_0xe7cb('0x28')]]={'$like':'%'+_0x4675ec[_0xe7cb('0x30')][_0xe7cb('0x3c')]+'%'};return _0x2083cd;}})});}_0x1f5db4=_['merge']({},_0x1f5db4,_0x4675ec['options']);var _0x205dcf={'where':_0x1f5db4[_0xe7cb('0x3b')]};return db[_0xe7cb('0x2c')][_0xe7cb('0x1f')](_0x205dcf)['then'](function(_0x2245f9){_0x33ca9f['count']=_0x2245f9;if(_0x4675ec[_0xe7cb('0x30')][_0xe7cb('0x40')]){_0x1f5db4[_0xe7cb('0x41')]=[{'all':!![]}];}return db[_0xe7cb('0x2c')][_0xe7cb('0x42')](_0x1f5db4);})[_0xe7cb('0x24')](function(_0x583e3c){_0x33ca9f[_0xe7cb('0x43')]=_0x583e3c;return _0x33ca9f;})['then'](respondWithFilteredResult(_0x4ea6a0,_0x1f5db4))['catch'](handleError(_0x4ea6a0,null));};exports[_0xe7cb('0x44')]=function(_0x59a6ea,_0x24265d){var _0x2f7381={'raw':!![],'where':{'id':_0x59a6ea[_0xe7cb('0x45')]['id']}},_0xb74366={};_0xb74366['model']=_[_0xe7cb('0x31')](db[_0xe7cb('0x2c')][_0xe7cb('0x2d')]);_0xb74366[_0xe7cb('0x30')]=_[_0xe7cb('0x31')](_0x59a6ea[_0xe7cb('0x30')]);_0xb74366[_0xe7cb('0x32')]=_[_0xe7cb('0x35')](_0xb74366[_0xe7cb('0x33')],_0xb74366[_0xe7cb('0x30')]);_0x2f7381[_0xe7cb('0x34')]=_[_0xe7cb('0x35')](_0xb74366[_0xe7cb('0x33')],qs[_0xe7cb('0x36')](_0x59a6ea[_0xe7cb('0x30')][_0xe7cb('0x36')]));_0x2f7381[_0xe7cb('0x34')]=_0x2f7381['attributes'][_0xe7cb('0x46')]?_0x2f7381[_0xe7cb('0x34')]:_0xb74366['model'];if(_0x59a6ea[_0xe7cb('0x30')][_0xe7cb('0x40')]){_0x2f7381[_0xe7cb('0x41')]=[{'all':!![]}];}_0x2f7381=_[_0xe7cb('0x3d')]({},_0x2f7381,_0x59a6ea[_0xe7cb('0x47')]);return db[_0xe7cb('0x2c')][_0xe7cb('0x48')](_0x2f7381)[_0xe7cb('0x24')](handleEntityNotFound(_0x24265d,null))[_0xe7cb('0x24')](respondWithResult(_0x24265d,null))[_0xe7cb('0x49')](handleError(_0x24265d,null));};exports['create']=function(_0xd0d55,_0x1b15ae){return db[_0xe7cb('0x2c')][_0xe7cb('0x4a')](_0xd0d55['body'],{})[_0xe7cb('0x24')](respondWithResult(_0x1b15ae,0xc9))['catch'](handleError(_0x1b15ae,null));};exports['update']=function(_0x16c8ad,_0x3976c0){if(_0x16c8ad[_0xe7cb('0x4b')]['id']){delete _0x16c8ad[_0xe7cb('0x4b')]['id'];}return db[_0xe7cb('0x2c')]['find']({'where':{'id':_0x16c8ad[_0xe7cb('0x45')]['id']}})[_0xe7cb('0x24')](handleEntityNotFound(_0x3976c0,null))['then'](saveUpdates(_0x16c8ad[_0xe7cb('0x4b')],null))[_0xe7cb('0x24')](respondWithResult(_0x3976c0,null))[_0xe7cb('0x49')](handleError(_0x3976c0,null));};exports[_0xe7cb('0x25')]=function(_0x45fde3,_0x150d8f){return db[_0xe7cb('0x2c')][_0xe7cb('0x48')]({'where':{'id':_0x45fde3['params']['id']}})[_0xe7cb('0x24')](handleEntityNotFound(_0x150d8f,null))[_0xe7cb('0x24')](removeEntity(_0x150d8f,null))[_0xe7cb('0x49')](handleError(_0x150d8f,null));}; \ No newline at end of file +var _0xe6f6=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','sendStatus','error','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','VIRTUAL','options','FaxApplication','includeAll','include','rows','catch','show','params','fields','find','create','body','eml-format','zip-dir'];(function(_0x125bd4,_0x129efa){var _0x2ca659=function(_0x296758){while(--_0x296758){_0x125bd4['push'](_0x125bd4['shift']());}};_0x2ca659(++_0x129efa);}(_0xe6f6,0xd3));var _0x6e6f=function(_0x11cd97,_0x1b7d91){_0x11cd97=_0x11cd97-0x0;var _0x273640=_0xe6f6[_0x11cd97];return _0x273640;};'use strict';var emlformat=require(_0x6e6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e6f('0x1'));var jsonpatch=require(_0x6e6f('0x2'));var rp=require(_0x6e6f('0x3'));var moment=require('moment');var BPromise=require(_0x6e6f('0x4'));var Mustache=require(_0x6e6f('0x5'));var util=require(_0x6e6f('0x6'));var path=require('path');var sox=require(_0x6e6f('0x7'));var csv=require(_0x6e6f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e6f('0x9'));var _=require(_0x6e6f('0xa'));var squel=require('squel');var crypto=require(_0x6e6f('0xb'));var jsforce=require(_0x6e6f('0xc'));var deskjs=require(_0x6e6f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e6f('0xe'));var qs=require(_0x6e6f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e6f('0x10'));var logger=require(_0x6e6f('0x11'))(_0x6e6f('0x12'));var utils=require(_0x6e6f('0x13'));var config=require(_0x6e6f('0x14'));var licenseUtil=require(_0x6e6f('0x15'));var db=require(_0x6e6f('0x16'))['db'];function respondWithStatusCode(_0x3df432,_0x2cfe6f){_0x2cfe6f=_0x2cfe6f||0xcc;return function(_0x3f7549){if(_0x3f7549){return _0x3df432['sendStatus'](_0x2cfe6f);}return _0x3df432['status'](_0x2cfe6f)[_0x6e6f('0x17')]();};}function respondWithResult(_0x92be65,_0x49e21a){_0x49e21a=_0x49e21a||0xc8;return function(_0x50cebb){if(_0x50cebb){return _0x92be65[_0x6e6f('0x18')](_0x49e21a)[_0x6e6f('0x19')](_0x50cebb);}};}function respondWithFilteredResult(_0x294a96,_0x267c29){return function(_0x3cc216){if(_0x3cc216){var _0xbcf8ed=typeof _0x267c29[_0x6e6f('0x1a')]===_0x6e6f('0x1b')&&typeof _0x267c29[_0x6e6f('0x1c')]===_0x6e6f('0x1b');var _0x2d034f=_0x3cc216[_0x6e6f('0x1d')];var _0xbc658f=_0xbcf8ed?0x0:_0x267c29[_0x6e6f('0x1a')];var _0x36d6da=_0xbcf8ed?_0x3cc216[_0x6e6f('0x1d')]:_0x267c29[_0x6e6f('0x1a')]+_0x267c29['limit'];var _0xdc8b05;if(_0x36d6da>=_0x2d034f){_0x36d6da=_0x2d034f;_0xdc8b05=0xc8;}else{_0xdc8b05=0xce;}_0x294a96[_0x6e6f('0x18')](_0xdc8b05);return _0x294a96[_0x6e6f('0x1e')](_0x6e6f('0x1f'),_0xbc658f+'-'+_0x36d6da+'/'+_0x2d034f)[_0x6e6f('0x19')](_0x3cc216);}return null;};}function patchUpdates(_0x5bb2a1){return function(_0x1083df){try{jsonpatch['apply'](_0x1083df,_0x5bb2a1,!![]);}catch(_0x42fa5b){return BPromise[_0x6e6f('0x20')](_0x42fa5b);}return _0x1083df['save']();};}function saveUpdates(_0x15c9d6,_0x10f2c5){return function(_0x5cb640){if(_0x5cb640){return _0x5cb640[_0x6e6f('0x21')](_0x15c9d6)[_0x6e6f('0x22')](function(_0x1f7a64){return _0x1f7a64;});}return null;};}function removeEntity(_0x4dca5d,_0x18fc3c){return function(_0x1d2f4a){if(_0x1d2f4a){return _0x1d2f4a['destroy']()[_0x6e6f('0x22')](function(){_0x4dca5d['status'](0xcc)[_0x6e6f('0x17')]();});}};}function handleEntityNotFound(_0x48699f,_0x18570f){return function(_0x53be9e){if(!_0x53be9e){_0x48699f[_0x6e6f('0x23')](0x194);}return _0x53be9e;};}function handleError(_0x2262dc,_0x3747d0){_0x3747d0=_0x3747d0||0x1f4;return function(_0x4cefea){logger[_0x6e6f('0x24')](_0x4cefea['stack']);if(_0x4cefea[_0x6e6f('0x25')]){delete _0x4cefea[_0x6e6f('0x25')];}_0x2262dc[_0x6e6f('0x18')](_0x3747d0)[_0x6e6f('0x26')](_0x4cefea);};}exports[_0x6e6f('0x27')]=function(_0x4978fd,_0x4e99b4){var _0x1c4f2b={},_0x4f0b73={},_0x374e41={'count':0x0,'rows':[]};var _0x4d6c1f=_['map'](db['FaxApplication'][_0x6e6f('0x28')],function(_0x4bdfc0){return{'name':_0x4bdfc0['fieldName'],'type':_0x4bdfc0[_0x6e6f('0x29')][_0x6e6f('0x2a')]};});_0x4f0b73[_0x6e6f('0x2b')]=_['map'](_0x4d6c1f,'name');_0x4f0b73[_0x6e6f('0x2c')]=_[_0x6e6f('0x2d')](_0x4978fd['query']);_0x4f0b73[_0x6e6f('0x2e')]=_[_0x6e6f('0x2f')](_0x4f0b73['model'],_0x4f0b73[_0x6e6f('0x2c')]);_0x1c4f2b[_0x6e6f('0x30')]=_['intersection'](_0x4f0b73['model'],qs['fields'](_0x4978fd['query']['fields']));_0x1c4f2b[_0x6e6f('0x30')]=_0x1c4f2b[_0x6e6f('0x30')][_0x6e6f('0x31')]?_0x1c4f2b[_0x6e6f('0x30')]:_0x4f0b73[_0x6e6f('0x2b')];if(!_0x4978fd[_0x6e6f('0x2c')][_0x6e6f('0x32')](_0x6e6f('0x33'))){_0x1c4f2b[_0x6e6f('0x1c')]=qs[_0x6e6f('0x1c')](_0x4978fd['query'][_0x6e6f('0x1c')]);_0x1c4f2b[_0x6e6f('0x1a')]=qs['offset'](_0x4978fd['query'][_0x6e6f('0x1a')]);}_0x1c4f2b[_0x6e6f('0x34')]=qs[_0x6e6f('0x35')](_0x4978fd['query'][_0x6e6f('0x35')]);_0x1c4f2b['where']=qs[_0x6e6f('0x2e')](_[_0x6e6f('0x36')](_0x4978fd[_0x6e6f('0x2c')],_0x4f0b73[_0x6e6f('0x2e')]),_0x4d6c1f);if(_0x4978fd['query']['filter']){_0x1c4f2b[_0x6e6f('0x37')]=_[_0x6e6f('0x38')](_0x1c4f2b[_0x6e6f('0x37')],{'$or':_[_0x6e6f('0x39')](_0x4d6c1f,function(_0x53b75f){if(_0x53b75f[_0x6e6f('0x29')]!==_0x6e6f('0x3a')){var _0x523445={};_0x523445[_0x53b75f[_0x6e6f('0x25')]]={'$like':'%'+_0x4978fd['query']['filter']+'%'};return _0x523445;}})});}_0x1c4f2b=_['merge']({},_0x1c4f2b,_0x4978fd[_0x6e6f('0x3b')]);var _0x50173f={'where':_0x1c4f2b[_0x6e6f('0x37')]};return db[_0x6e6f('0x3c')][_0x6e6f('0x1d')](_0x50173f)[_0x6e6f('0x22')](function(_0x1700f6){_0x374e41[_0x6e6f('0x1d')]=_0x1700f6;if(_0x4978fd[_0x6e6f('0x2c')][_0x6e6f('0x3d')]){_0x1c4f2b[_0x6e6f('0x3e')]=[{'all':!![]}];}return db[_0x6e6f('0x3c')]['findAll'](_0x1c4f2b);})[_0x6e6f('0x22')](function(_0x228ab3){_0x374e41[_0x6e6f('0x3f')]=_0x228ab3;return _0x374e41;})[_0x6e6f('0x22')](respondWithFilteredResult(_0x4e99b4,_0x1c4f2b))[_0x6e6f('0x40')](handleError(_0x4e99b4,null));};exports[_0x6e6f('0x41')]=function(_0x4f23b2,_0x2324a0){var _0x3be7b0={'raw':!![],'where':{'id':_0x4f23b2[_0x6e6f('0x42')]['id']}},_0x541dd2={};_0x541dd2['model']=_[_0x6e6f('0x2d')](db[_0x6e6f('0x3c')][_0x6e6f('0x28')]);_0x541dd2[_0x6e6f('0x2c')]=_['keys'](_0x4f23b2[_0x6e6f('0x2c')]);_0x541dd2[_0x6e6f('0x2e')]=_[_0x6e6f('0x2f')](_0x541dd2[_0x6e6f('0x2b')],_0x541dd2[_0x6e6f('0x2c')]);_0x3be7b0[_0x6e6f('0x30')]=_[_0x6e6f('0x2f')](_0x541dd2['model'],qs['fields'](_0x4f23b2[_0x6e6f('0x2c')][_0x6e6f('0x43')]));_0x3be7b0[_0x6e6f('0x30')]=_0x3be7b0[_0x6e6f('0x30')][_0x6e6f('0x31')]?_0x3be7b0[_0x6e6f('0x30')]:_0x541dd2[_0x6e6f('0x2b')];if(_0x4f23b2[_0x6e6f('0x2c')]['includeAll']){_0x3be7b0[_0x6e6f('0x3e')]=[{'all':!![]}];}_0x3be7b0=_[_0x6e6f('0x38')]({},_0x3be7b0,_0x4f23b2[_0x6e6f('0x3b')]);return db[_0x6e6f('0x3c')][_0x6e6f('0x44')](_0x3be7b0)[_0x6e6f('0x22')](handleEntityNotFound(_0x2324a0,null))[_0x6e6f('0x22')](respondWithResult(_0x2324a0,null))['catch'](handleError(_0x2324a0,null));};exports[_0x6e6f('0x45')]=function(_0x4eed55,_0x4d2130){return db[_0x6e6f('0x3c')][_0x6e6f('0x45')](_0x4eed55[_0x6e6f('0x46')],{})[_0x6e6f('0x22')](respondWithResult(_0x4d2130,0xc9))[_0x6e6f('0x40')](handleError(_0x4d2130,null));};exports[_0x6e6f('0x21')]=function(_0x33784b,_0x24067c){if(_0x33784b['body']['id']){delete _0x33784b[_0x6e6f('0x46')]['id'];}return db[_0x6e6f('0x3c')][_0x6e6f('0x44')]({'where':{'id':_0x33784b[_0x6e6f('0x42')]['id']}})[_0x6e6f('0x22')](handleEntityNotFound(_0x24067c,null))[_0x6e6f('0x22')](saveUpdates(_0x33784b[_0x6e6f('0x46')],null))[_0x6e6f('0x22')](respondWithResult(_0x24067c,null))[_0x6e6f('0x40')](handleError(_0x24067c,null));};exports['destroy']=function(_0x42375a,_0x3cb086){return db[_0x6e6f('0x3c')][_0x6e6f('0x44')]({'where':{'id':_0x42375a[_0x6e6f('0x42')]['id']}})[_0x6e6f('0x22')](handleEntityNotFound(_0x3cb086,null))[_0x6e6f('0x22')](removeEntity(_0x3cb086,null))['catch'](handleError(_0x3cb086,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9440e5e..4510dc6 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 _0x7710=['path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','moment','request-promise'];(function(_0x5372e1,_0x4cd832){var _0xa44ad0=function(_0x40709f){while(--_0x40709f){_0x5372e1['push'](_0x5372e1['shift']());}};_0xa44ad0(++_0x4cd832);}(_0x7710,0xf8));var _0x0771=function(_0x106487,_0x23de58){_0x106487=_0x106487-0x0;var _0xc1da08=_0x7710[_0x106487];return _0xc1da08;};'use strict';var _=require(_0x0771('0x0'));var util=require(_0x0771('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0771('0x2'));var BPromise=require('bluebird');var rp=require(_0x0771('0x3'));var fs=require('fs');var path=require(_0x0771('0x4'));var rimraf=require(_0x0771('0x5'));var config=require(_0x0771('0x6'));var attributes=require(_0x0771('0x7'));module['exports']=function(_0x562d69,_0x5f1b68){return _0x562d69[_0x0771('0x8')](_0x0771('0x9'),attributes,{'tableName':_0x0771('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0771('0xb')});}; \ No newline at end of file +var _0x1829=['exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x12033e,_0x1a0e23){var _0x229829=function(_0x47b9bf){while(--_0x47b9bf){_0x12033e['push'](_0x12033e['shift']());}};_0x229829(++_0x1a0e23);}(_0x1829,0x1b2));var _0x9182=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x1829[_0x35da42];return _0x370035;};'use strict';var _=require(_0x9182('0x0'));var util=require(_0x9182('0x1'));var logger=require('../../config/logger')(_0x9182('0x2'));var moment=require(_0x9182('0x3'));var BPromise=require(_0x9182('0x4'));var rp=require(_0x9182('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9182('0x6'));var config=require(_0x9182('0x7'));var attributes=require('./faxApplication.attributes');module[_0x9182('0x8')]=function(_0x49bf87,_0x24d2b7){return _0x49bf87[_0x9182('0x9')](_0x9182('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9182('0xb'),'collate':_0x9182('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index dd68556..bc41d45 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 _0x0468=['body','options','raw','where','attributes','then','info','UpdateFaxApplication','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','FaxApplication','update'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0x0468,0x1a9));var _0x8046=function(_0x498bf5,_0x2accb4){_0x498bf5=_0x498bf5-0x0;var _0x8064c0=_0x0468[_0x498bf5];return _0x8064c0;};'use strict';var _=require(_0x8046('0x0'));var util=require(_0x8046('0x1'));var moment=require(_0x8046('0x2'));var BPromise=require(_0x8046('0x3'));var rs=require(_0x8046('0x4'));var fs=require('fs');var Redis=require(_0x8046('0x5'));var db=require(_0x8046('0x6'))['db'];var utils=require(_0x8046('0x7'));var logger=require('../../config/logger')(_0x8046('0x8'));var config=require('../../config/environment');var jayson=require(_0x8046('0x9'));var client=jayson[_0x8046('0xa')][_0x8046('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe37216,_0x5f20f4,_0x370e04){return new BPromise(function(_0x28a65c,_0x515e5a){return client[_0x8046('0xc')](_0xe37216,_0x370e04)['then'](function(_0x132f0e){logger['info']('FaxApplication,\x20%s,\x20%s',_0x5f20f4,_0x8046('0xd'));logger[_0x8046('0xe')](_0x8046('0xf'),_0x5f20f4,_0x8046('0xd'),JSON[_0x8046('0x10')](_0x132f0e));if(_0x132f0e[_0x8046('0x11')]){if(_0x132f0e[_0x8046('0x11')][_0x8046('0x12')]===0x1f4){logger[_0x8046('0x11')](_0x8046('0x13'),_0x5f20f4,_0x132f0e[_0x8046('0x11')][_0x8046('0x14')]);return _0x515e5a(_0x132f0e['error'][_0x8046('0x14')]);}logger[_0x8046('0x11')]('FaxApplication,\x20%s,\x20%s',_0x5f20f4,_0x132f0e[_0x8046('0x11')][_0x8046('0x14')]);return _0x28a65c(_0x132f0e['error']['message']);}else{logger['info'](_0x8046('0x13'),_0x5f20f4,_0x8046('0xd'));_0x28a65c(_0x132f0e['result'][_0x8046('0x14')]);}})['catch'](function(_0x4b186f){logger[_0x8046('0x11')](_0x8046('0x13'),_0x5f20f4,_0x4b186f);_0x515e5a(_0x4b186f);});});}exports['UpdateFaxApplication']=function(_0x18b431){var _0x1f046e=this;return new Promise(function(_0x57c565,_0x1d774c){return db[_0x8046('0x15')][_0x8046('0x16')](_0x18b431[_0x8046('0x17')],{'raw':_0x18b431['options']?_0x18b431[_0x8046('0x18')][_0x8046('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b431[_0x8046('0x18')]?_0x18b431[_0x8046('0x18')][_0x8046('0x1a')]||null:null,'attributes':_0x18b431[_0x8046('0x18')]?_0x18b431['options'][_0x8046('0x1b')]||null:null,'limit':_0x18b431[_0x8046('0x18')]?_0x18b431[_0x8046('0x18')]['limit']||null:null})[_0x8046('0x1c')](function(_0xdfe8b1){logger[_0x8046('0x1d')](_0x8046('0x1e'),_0x18b431);logger[_0x8046('0xe')](_0x8046('0x1e'),_0x18b431,JSON[_0x8046('0x10')](_0xdfe8b1));_0x57c565(_0xdfe8b1);})[_0x8046('0x1f')](function(_0x513c48){logger['error'](_0x8046('0x1e'),_0x513c48[_0x8046('0x14')],_0x18b431);_0x1d774c(_0x1f046e[_0x8046('0x11')](0x1f4,_0x513c48['message']));});});}; \ No newline at end of file +var _0xaeda=['attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where'];(function(_0x2d4bf3,_0x35849a){var _0x49fae7=function(_0x1001f3){while(--_0x1001f3){_0x2d4bf3['push'](_0x2d4bf3['shift']());}};_0x49fae7(++_0x35849a);}(_0xaeda,0x1b4));var _0xaaed=function(_0x5f474b,_0xd04e61){_0x5f474b=_0x5f474b-0x0;var _0x3b01c3=_0xaeda[_0x5f474b];return _0x3b01c3;};'use strict';var _=require(_0xaaed('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaaed('0x1'));var rs=require(_0xaaed('0x2'));var fs=require('fs');var Redis=require(_0xaaed('0x3'));var db=require(_0xaaed('0x4'))['db'];var utils=require(_0xaaed('0x5'));var logger=require('../../config/logger')(_0xaaed('0x6'));var config=require(_0xaaed('0x7'));var jayson=require(_0xaaed('0x8'));var client=jayson[_0xaaed('0x9')][_0xaaed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40c228,_0xdd0bcf,_0x44648a){return new BPromise(function(_0x803226,_0x29e870){return client[_0xaaed('0xb')](_0x40c228,_0x44648a)['then'](function(_0x176aa6){logger[_0xaaed('0xc')](_0xaaed('0xd'),_0xdd0bcf,_0xaaed('0xe'));logger[_0xaaed('0xf')](_0xaaed('0x10'),_0xdd0bcf,'request\x20sent',JSON[_0xaaed('0x11')](_0x176aa6));if(_0x176aa6[_0xaaed('0x12')]){if(_0x176aa6[_0xaaed('0x12')][_0xaaed('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0xdd0bcf,_0x176aa6[_0xaaed('0x12')][_0xaaed('0x14')]);return _0x29e870(_0x176aa6[_0xaaed('0x12')][_0xaaed('0x14')]);}logger[_0xaaed('0x12')](_0xaaed('0xd'),_0xdd0bcf,_0x176aa6[_0xaaed('0x12')][_0xaaed('0x14')]);return _0x803226(_0x176aa6[_0xaaed('0x12')]['message']);}else{logger[_0xaaed('0xc')](_0xaaed('0xd'),_0xdd0bcf,_0xaaed('0xe'));_0x803226(_0x176aa6['result'][_0xaaed('0x14')]);}})[_0xaaed('0x15')](function(_0x16afc4){logger['error'](_0xaaed('0xd'),_0xdd0bcf,_0x16afc4);_0x29e870(_0x16afc4);});});}exports[_0xaaed('0x16')]=function(_0x525c53){var _0x4bdb29=this;return new Promise(function(_0x238493,_0x193119){return db[_0xaaed('0x17')][_0xaaed('0x18')](_0x525c53[_0xaaed('0x19')],{'raw':_0x525c53[_0xaaed('0x1a')]?_0x525c53[_0xaaed('0x1a')][_0xaaed('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525c53[_0xaaed('0x1a')]?_0x525c53['options'][_0xaaed('0x1c')]||null:null,'attributes':_0x525c53[_0xaaed('0x1a')]?_0x525c53['options'][_0xaaed('0x1d')]||null:null,'limit':_0x525c53[_0xaaed('0x1a')]?_0x525c53['options'][_0xaaed('0x1e')]||null:null})['then'](function(_0x112593){logger[_0xaaed('0xc')](_0xaaed('0x16'),_0x525c53);logger[_0xaaed('0xf')](_0xaaed('0x16'),_0x525c53,JSON['stringify'](_0x112593));_0x238493(_0x112593);})[_0xaaed('0x15')](function(_0x55d623){logger[_0xaaed('0x12')](_0xaaed('0x16'),_0x55d623['message'],_0x525c53);_0x193119(_0x4bdb29['error'](0x1f4,_0x55d623['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 323ce20..675632f 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index'];(function(_0x3e6eec,_0x4d87d1){var _0x12b322=function(_0x4ed465){while(--_0x4ed465){_0x3e6eec['push'](_0x3e6eec['shift']());}};_0x12b322(++_0x4d87d1);}(_0x7916,0x128));var _0x6791=function(_0x2451c3,_0x2c16e0){_0x2451c3=_0x2451c3-0x0;var _0x4bc3bb=_0x7916[_0x2451c3];return _0x4bc3bb;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);module[_0x6791('0x11')]=router; \ No newline at end of file +var _0x3423=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','path','connect-timeout','express','Router'];(function(_0x250f50,_0x3b4f44){var _0x1dd16b=function(_0x427715){while(--_0x427715){_0x250f50['push'](_0x250f50['shift']());}};_0x1dd16b(++_0x3b4f44);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0xe')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xf')]);router['put']('/:id',auth[_0x3342('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3342('0x10')]);module[_0x3342('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 2e49af2..b9a3775 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 _0xf4cc=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x150765,_0x4ccac5){var _0x561377=function(_0x326c5f){while(--_0x326c5f){_0x150765['push'](_0x150765['shift']());}};_0x561377(++_0x4ccac5);}(_0xf4cc,0x151));var _0xcf4c=function(_0x40b9cd,_0x15835d){_0x40b9cd=_0x40b9cd-0x0;var _0xc6e2f8=_0xf4cc[_0x40b9cd];return _0xc6e2f8;};'use strict';var Sequelize=require('sequelize');module[_0xcf4c('0x0')]={'closed':{'type':Sequelize[_0xcf4c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcf4c('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcf4c('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcf4c('0x3')]},'note':{'type':Sequelize[_0xcf4c('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xcf4c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcf4c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcf4c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xcf4c('0x4')]('in',_0xcf4c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xaa4c=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x12c0e3,_0x5be87b){var _0xa5ff66=function(_0x593ada){while(--_0x593ada){_0x12c0e3['push'](_0x12c0e3['shift']());}};_0xa5ff66(++_0x5be87b);}(_0xaa4c,0x1e5));var _0xcaa4=function(_0x46f219,_0x49675f){_0x46f219=_0x46f219-0x0;var _0xafab39=_0xaa4c[_0x46f219];return _0xafab39;};'use strict';var Sequelize=require('sequelize');module[_0xcaa4('0x0')]={'closed':{'type':Sequelize[_0xcaa4('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcaa4('0x2')]},'disposition':{'type':Sequelize[_0xcaa4('0x3')]},'secondDisposition':{'type':Sequelize[_0xcaa4('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcaa4('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcaa4('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xcaa4('0x4')]('in',_0xcaa4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcaa4('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 62dd4d3..05589bf 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 _0x2f40=['findAll','fax','query','user','show','params','model','keys','filters','intersection','attributes','fields','include','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','getMessages','findOne','length','nolimit','order','sort','pick','where','FaxInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','setTags','omit','color','emit','removeTags','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve','log','err','rimraf','zip-dir','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','update','destroy','then','error','stack','name','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions'];(function(_0x43528d,_0x21f87c){var _0x487b94=function(_0x10eb88){while(--_0x10eb88){_0x43528d['push'](_0x43528d['shift']());}};_0x487b94(++_0x21f87c);}(_0x2f40,0x1dd));var _0x02f4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2f40[_0x3b380d];return _0x54502b;};'use strict';var rimraf=require(_0x02f4('0x0'));var zipdir=require(_0x02f4('0x1'));var moment=require('moment');var BPromise=require(_0x02f4('0x2'));var util=require('util');var path=require(_0x02f4('0x3'));var fs=require('fs');var _=require(_0x02f4('0x4'));var Redis=require(_0x02f4('0x5'));var interaction=require(_0x02f4('0x6'));var qs=require(_0x02f4('0x7'));var logger=require(_0x02f4('0x8'))('api');var config=require(_0x02f4('0x9'));var db=require('../../mysqldb')['db'];config[_0x02f4('0xa')]=_['defaults'](config['redis'],{'host':_0x02f4('0xb'),'port':0x18eb});var socket=require(_0x02f4('0xc'))(new Redis(config[_0x02f4('0xa')]));require(_0x02f4('0xd'))['register'](socket);function respondWithStatusCode(_0x8e6ef4,_0xb77fdc){_0xb77fdc=_0xb77fdc||0xcc;return function(_0x44a115){if(_0x44a115){return _0x8e6ef4[_0x02f4('0xe')](_0xb77fdc);}return _0x8e6ef4['status'](_0xb77fdc)[_0x02f4('0xf')]();};}function respondWithResult(_0x4e87d6,_0x56f783){_0x56f783=_0x56f783||0xc8;return function(_0x3c6afc){if(_0x3c6afc){return _0x4e87d6['status'](_0x56f783)[_0x02f4('0x10')](_0x3c6afc);}};}function respondWithFilteredResult(_0x5c2905,_0x4414fe){return function(_0x735dcc){if(_0x735dcc){var _0x453e4c=typeof _0x4414fe[_0x02f4('0x11')]==='undefined'&&typeof _0x4414fe['limit']===_0x02f4('0x12');var _0x3a5f82=_0x735dcc[_0x02f4('0x13')];var _0x2019e8=_0x453e4c?0x0:_0x4414fe[_0x02f4('0x11')];var _0x589bfc=_0x453e4c?_0x735dcc[_0x02f4('0x13')]:_0x4414fe['offset']+_0x4414fe[_0x02f4('0x14')];var _0x586c59;if(_0x589bfc>=_0x3a5f82){_0x589bfc=_0x3a5f82;_0x586c59=0xc8;}else{_0x586c59=0xce;}_0x5c2905[_0x02f4('0x15')](_0x586c59);return _0x5c2905[_0x02f4('0x16')](_0x02f4('0x17'),_0x2019e8+'-'+_0x589bfc+'/'+_0x3a5f82)[_0x02f4('0x10')](_0x735dcc);}return null;};}function saveUpdates(_0x2c7625){return function(_0x595bb4){if(_0x595bb4){return _0x595bb4[_0x02f4('0x18')](_0x2c7625)['then'](function(_0x3458ce){return _0x3458ce;});}return null;};}function removeEntity(_0xe55ee7){return function(_0x375d90){if(_0x375d90){return _0x375d90[_0x02f4('0x19')]()[_0x02f4('0x1a')](function(){_0xe55ee7['status'](0xcc)[_0x02f4('0xf')]();});}};}function handleEntityNotFound(_0xe29362){return function(_0x3126ac){if(!_0x3126ac){_0xe29362['sendStatus'](0x194);}return _0x3126ac;};}function handleError(_0x314a4b,_0x16da08){_0x16da08=_0x16da08||0x1f4;return function(_0x36271e){logger[_0x02f4('0x1b')](_0x36271e[_0x02f4('0x1c')]);if(_0x36271e[_0x02f4('0x1d')]){delete _0x36271e[_0x02f4('0x1d')];}_0x314a4b[_0x02f4('0x15')](_0x16da08)['send'](_0x36271e);};}exports[_0x02f4('0x1e')]=function(_0x44ba02,_0x38b195){var _0x37b91c={};var _0x8cba41=_[_0x02f4('0x1f')](db[_0x02f4('0x20')][_0x02f4('0x21')],function(_0x22ada6){return{'name':_0x22ada6[_0x02f4('0x22')],'type':_0x22ada6[_0x02f4('0x23')][_0x02f4('0x24')]};});_0x37b91c=qs[_0x02f4('0x25')](_0x8cba41,_0x44ba02);return interaction[_0x02f4('0x26')](_0x02f4('0x27'),_0x44ba02[_0x02f4('0x28')],_0x44ba02[_0x02f4('0x29')],_0x37b91c,_0x8cba41)[_0x02f4('0x1a')](respondWithFilteredResult(_0x38b195,_0x37b91c))['catch'](handleError(_0x38b195,null));};exports[_0x02f4('0x2a')]=function(_0x59280f,_0x4898c5){var _0x52bfb7={'raw':![],'where':{'id':_0x59280f[_0x02f4('0x2b')]['id']}},_0x29d999={};_0x29d999[_0x02f4('0x2c')]=_['keys'](db[_0x02f4('0x20')][_0x02f4('0x21')]);_0x29d999[_0x02f4('0x28')]=_[_0x02f4('0x2d')](_0x59280f[_0x02f4('0x28')]);_0x29d999[_0x02f4('0x2e')]=_[_0x02f4('0x2f')](_0x29d999['model'],_0x29d999['query']);_0x52bfb7[_0x02f4('0x30')]=_[_0x02f4('0x2f')](_0x29d999['model'],qs[_0x02f4('0x31')](_0x59280f['query'][_0x02f4('0x31')]));_0x52bfb7['attributes']=_0x52bfb7['attributes']['length']?_0x52bfb7[_0x02f4('0x30')]:_0x29d999[_0x02f4('0x2c')];if(_0x59280f['query']['includeAll']){_0x52bfb7[_0x02f4('0x32')]=[{'all':!![]}];}_0x52bfb7=_['merge']({},_0x52bfb7,_0x59280f[_0x02f4('0x33')]);return db[_0x02f4('0x20')][_0x02f4('0x34')](_0x52bfb7)[_0x02f4('0x1a')](handleEntityNotFound(_0x4898c5,null))['then'](respondWithResult(_0x4898c5,null))[_0x02f4('0x35')](handleError(_0x4898c5,null));};exports[_0x02f4('0x36')]=function(_0x19c7e3,_0x317852){return db[_0x02f4('0x20')]['create'](_0x19c7e3['body'],{})[_0x02f4('0x1a')](respondWithResult(_0x317852,0xc9))[_0x02f4('0x35')](handleError(_0x317852,null));};exports[_0x02f4('0x18')]=function(_0x286ab4,_0x20af4f){if(_0x286ab4[_0x02f4('0x37')]['id']){delete _0x286ab4[_0x02f4('0x37')]['id'];}return db[_0x02f4('0x20')][_0x02f4('0x34')]({'where':{'id':_0x286ab4[_0x02f4('0x2b')]['id']}})[_0x02f4('0x1a')](handleEntityNotFound(_0x20af4f,null))['then'](saveUpdates(_0x286ab4['body'],null))[_0x02f4('0x1a')](respondWithResult(_0x20af4f,null))[_0x02f4('0x35')](handleError(_0x20af4f,null));};exports[_0x02f4('0x19')]=function(_0x26862a,_0x2e6347){return db[_0x02f4('0x20')]['find']({'where':{'id':_0x26862a[_0x02f4('0x2b')]['id']}})[_0x02f4('0x1a')](handleEntityNotFound(_0x2e6347,null))['then'](removeEntity(_0x2e6347,null))['catch'](handleError(_0x2e6347,null));};exports['describe']=function(_0x4ebc48,_0x476df3){return db[_0x02f4('0x20')][_0x02f4('0x38')]()['then'](respondWithResult(_0x476df3,null))[_0x02f4('0x35')](handleError(_0x476df3,null));};exports[_0x02f4('0x39')]=function(_0x3d6046,_0x8d91c3){return db[_0x02f4('0x3a')][_0x02f4('0x34')]({'where':{'id':_0x3d6046[_0x02f4('0x2b')]['id']}})[_0x02f4('0x1a')](handleEntityNotFound(_0x8d91c3,null))[_0x02f4('0x1a')](function(_0x31798a){if(_0x31798a){return _0x31798a[_0x02f4('0x39')](_0x3d6046[_0x02f4('0x37')][_0x02f4('0x3b')],_['omit'](_0x3d6046[_0x02f4('0x37')],['ids','id'])||{});}})[_0x02f4('0x1a')](respondWithResult(_0x8d91c3,null))[_0x02f4('0x35')](handleError(_0x8d91c3,null));};exports[_0x02f4('0x3c')]=function(_0x3f8469,_0xffa382){var _0x3bf3ff={'raw':![],'where':{}};var _0x49d37f={};var _0x5e04ff={'count':0x0,'rows':[]};return db[_0x02f4('0x20')][_0x02f4('0x3d')]({'where':{'id':_0x3f8469[_0x02f4('0x2b')]['id']}})[_0x02f4('0x1a')](handleEntityNotFound(_0xffa382,null))[_0x02f4('0x1a')](function(_0x3fcbe2){if(_0x3fcbe2){_0x49d37f[_0x02f4('0x2c')]=_[_0x02f4('0x2d')](db[_0x02f4('0x3a')]['rawAttributes']);_0x49d37f['query']=_[_0x02f4('0x2d')](_0x3f8469['query']);_0x49d37f['filters']=_[_0x02f4('0x2f')](_0x49d37f[_0x02f4('0x2c')],_0x49d37f[_0x02f4('0x28')]);_0x3bf3ff[_0x02f4('0x30')]=_['intersection'](_0x49d37f[_0x02f4('0x2c')],qs[_0x02f4('0x31')](_0x3f8469[_0x02f4('0x28')][_0x02f4('0x31')]));_0x3bf3ff['attributes']=_0x3bf3ff['attributes'][_0x02f4('0x3e')]?_0x3bf3ff[_0x02f4('0x30')]:_0x49d37f[_0x02f4('0x2c')];if(!_0x3f8469[_0x02f4('0x28')]['hasOwnProperty'](_0x02f4('0x3f'))){_0x3bf3ff[_0x02f4('0x14')]=qs[_0x02f4('0x14')](_0x3f8469['query'][_0x02f4('0x14')]);_0x3bf3ff[_0x02f4('0x11')]=qs[_0x02f4('0x11')](_0x3f8469[_0x02f4('0x28')][_0x02f4('0x11')]);}_0x3bf3ff[_0x02f4('0x40')]=qs['sort'](_0x3f8469['query'][_0x02f4('0x41')]);_0x3bf3ff['where']=qs[_0x02f4('0x2e')](_[_0x02f4('0x42')](_0x3f8469[_0x02f4('0x28')],_0x49d37f[_0x02f4('0x2e')]));_0x3bf3ff[_0x02f4('0x43')][_0x02f4('0x44')]=_0x3fcbe2['id'];if(_0x3f8469[_0x02f4('0x28')][_0x02f4('0x45')]){_0x3bf3ff[_0x02f4('0x43')]=_[_0x02f4('0x46')](_0x3bf3ff[_0x02f4('0x43')],{'$or':_[_0x02f4('0x1f')](_0x3bf3ff[_0x02f4('0x30')],function(_0x5547bc){var _0x4dd0ba={};_0x4dd0ba[_0x5547bc]={'$like':'%'+_0x3f8469[_0x02f4('0x28')][_0x02f4('0x45')]+'%'};return _0x4dd0ba;})});}if(_0x3f8469[_0x02f4('0x28')][_0x02f4('0x47')]){var _0x195956=_0x3f8469[_0x02f4('0x28')]['$gte'][_0x02f4('0x48')](',');var _0x39e833={};_0x39e833[_0x195956[0x0]]={'$gte':moment(_0x195956[0x1])[_0x02f4('0x49')](_0x02f4('0x4a'))};_0x3bf3ff[_0x02f4('0x43')]=_[_0x02f4('0x46')](_0x3bf3ff[_0x02f4('0x43')],_0x39e833);}_0x3bf3ff=_['merge']({},_0x3bf3ff,_0x3f8469['options']);return db[_0x02f4('0x3a')]['count']({'where':_0x3bf3ff[_0x02f4('0x43')]})['then'](function(_0x5ce13a){_0x5e04ff[_0x02f4('0x13')]=_0x5ce13a;if(_0x3f8469['query'][_0x02f4('0x4b')]){_0x3bf3ff['include']=[{'all':!![]}];}return db[_0x02f4('0x3a')]['findAll'](_0x3bf3ff);})['then'](function(_0x1c4e2d){_0x5e04ff[_0x02f4('0x4c')]=_0x1c4e2d;return _0x5e04ff;});}})[_0x02f4('0x1a')](respondWithFilteredResult(_0xffa382,_0x3bf3ff))[_0x02f4('0x35')](handleError(_0xffa382,null));};exports['addTags']=function(_0x25f086,_0x258451){return db[_0x02f4('0x20')]['find']({'where':{'id':_0x25f086[_0x02f4('0x2b')]['id']}})[_0x02f4('0x1a')](handleEntityNotFound(_0x258451,null))[_0x02f4('0x1a')](function(_0x15a3bb){if(_0x15a3bb){return _0x15a3bb[_0x02f4('0x4d')](_0x25f086[_0x02f4('0x37')][_0x02f4('0x3b')],_[_0x02f4('0x4e')](_0x25f086[_0x02f4('0x37')],[_0x02f4('0x3b'),'id'])||{})['spread'](function(){return db['Tag'][_0x02f4('0x26')]({'attributes':['id',_0x02f4('0x1d'),_0x02f4('0x4f')],'where':{'id':_0x25f086[_0x02f4('0x37')][_0x02f4('0x3b')]}});})[_0x02f4('0x1a')](function(_0x147671){socket[_0x02f4('0x50')]('faxInteractionTags:save',{'id':Number(_0x25f086[_0x02f4('0x2b')]['id']),'tags':_0x147671||[]});return{'id':Number(_0x25f086['params']['id']),'tags':_0x147671||[]};});}})[_0x02f4('0x1a')](respondWithResult(_0x258451,null))[_0x02f4('0x35')](handleError(_0x258451,null));};exports[_0x02f4('0x51')]=function(_0x18b6de,_0x16c97b){return db[_0x02f4('0x20')][_0x02f4('0x34')]({'where':{'id':_0x18b6de['params']['id']}})['then'](handleEntityNotFound(_0x16c97b,null))['then'](function(_0x16b685){if(_0x16b685){return _0x16b685[_0x02f4('0x51')](_0x18b6de['query'][_0x02f4('0x3b')]);}})[_0x02f4('0x1a')](respondWithStatusCode(_0x16c97b,null))[_0x02f4('0x35')](handleError(_0x16c97b,null));};exports['download']=function(_0x52351c,_0x13a448){var _0x388ddd=moment()[_0x02f4('0x52')]()[_0x02f4('0x53')]();var _0x561c00=path[_0x02f4('0x54')](config[_0x02f4('0x55')],_0x02f4('0x56'),_0x02f4('0x57'),_0x02f4('0x58'));var _0x49bdb6=path[_0x02f4('0x54')](config[_0x02f4('0x55')],_0x02f4('0x56'),_0x02f4('0x57'),'attachments');var _0x371f27=path[_0x02f4('0x54')](_0x561c00,_0x388ddd);var _0x33e574=util[_0x02f4('0x49')](_0x02f4('0x59'),_0x52351c['params']['id'],_0x388ddd);var _0x25864b=path[_0x02f4('0x54')](_0x561c00,_0x33e574);var _0x5d857a=[];_0x5d857a[_0x02f4('0x5a')]({'model':db[_0x02f4('0x5b')],'as':'Attachment','raw':!![]});var _0xea73df=[{'model':db[_0x02f4('0x3a')],'as':_0x02f4('0x5c'),'attributes':['id',_0x02f4('0x37'),_0x02f4('0x5d')],'include':_0x5d857a}];return db[_0x02f4('0x20')][_0x02f4('0x34')]({'where':{'id':_0x52351c[_0x02f4('0x2b')]['id']},'include':_0xea73df})[_0x02f4('0x1a')](handleEntityNotFound(_0x13a448,null))[_0x02f4('0x1a')](function(_0x5ebcda){if(_0x5ebcda&&_0x5ebcda['Messages']){var _0x9dbe08=_0x5ebcda[_0x02f4('0x5e')]({'plain':!![]});fs[_0x02f4('0x5f')](_0x371f27);for(var _0x79cb8e=0x0;_0x79cb8e<_0x9dbe08[_0x02f4('0x5c')][_0x02f4('0x3e')];_0x79cb8e++){var _0x56c8d4=_0x9dbe08[_0x02f4('0x5c')][_0x79cb8e][_0x02f4('0x5b')];if(_0x56c8d4){var _0x2c9190=path[_0x02f4('0x54')](_0x49bdb6,_0x56c8d4[_0x02f4('0x60')]);if(fs[_0x02f4('0x61')](_0x2c9190)){fs[_0x02f4('0x62')](_0x2c9190)['pipe'](fs[_0x02f4('0x63')](path[_0x02f4('0x54')](_0x371f27,_0x56c8d4[_0x02f4('0x60')])));}}}return BPromise[_0x02f4('0x64')]()[_0x02f4('0x1a')](function(){return new BPromise(function(_0x33e691,_0x321b71){zipdir(_0x371f27,{'saveTo':_0x25864b},function(_0x192941,_0x573286){if(_0x192941)return _0x321b71(_0x192941);return _0x33e691(_0x573286);});})[_0x02f4('0x1a')](function(){return new BPromise(function(_0x53d62e,_0x135ec2){rimraf(_0x371f27,function(_0x4bbff9){if(_0x4bbff9)_0x135ec2(_0x4bbff9);return _0x53d62e();});});})[_0x02f4('0x1a')](function(){return _0x13a448['download'](_0x25864b,_0x33e574,function(_0x298575){if(_0x298575){console[_0x02f4('0x65')](_0x02f4('0x66'),_0x298575);}else{fs['unlinkSync'](_0x25864b);}});});});}else{return _0x13a448[_0x02f4('0xe')](0xc8);}})[_0x02f4('0x35')](handleError(_0x13a448,null));}; \ No newline at end of file +var _0x442b=['attributes','fields','length','includeAll','include','find','then','create','body','catch','describe','addMessage','ids','omit','getMessages','findOne','limit','order','sort','where','pick','FaxInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','FaxMessage','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createWriteStream','resolve','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','destroy','end','error','name','send','index','map','FaxInteraction','fieldName','type','key','findAll','fax','query','user','show','params','model','rawAttributes','keys','filters','intersection'];(function(_0x552dee,_0x1e45b0){var _0x30072e=function(_0x151eca){while(--_0x151eca){_0x552dee['push'](_0x552dee['shift']());}};_0x30072e(++_0x1e45b0);}(_0x442b,0xa3));var _0xb442=function(_0xacc2a,_0x8f5b4){_0xacc2a=_0xacc2a-0x0;var _0x511d55=_0x442b[_0xacc2a];return _0x511d55;};'use strict';var rimraf=require(_0xb442('0x0'));var zipdir=require(_0xb442('0x1'));var moment=require(_0xb442('0x2'));var BPromise=require(_0xb442('0x3'));var util=require(_0xb442('0x4'));var path=require(_0xb442('0x5'));var fs=require('fs');var _=require(_0xb442('0x6'));var Redis=require(_0xb442('0x7'));var interaction=require(_0xb442('0x8'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xb442('0x9'));var config=require(_0xb442('0xa'));var db=require(_0xb442('0xb'))['db'];config[_0xb442('0xc')]=_[_0xb442('0xd')](config[_0xb442('0xc')],{'host':_0xb442('0xe'),'port':0x18eb});var socket=require(_0xb442('0xf'))(new Redis(config[_0xb442('0xc')]));require(_0xb442('0x10'))[_0xb442('0x11')](socket);function respondWithStatusCode(_0xc4fcd5,_0x4fe017){_0x4fe017=_0x4fe017||0xcc;return function(_0x24a1e7){if(_0x24a1e7){return _0xc4fcd5[_0xb442('0x12')](_0x4fe017);}return _0xc4fcd5['status'](_0x4fe017)['end']();};}function respondWithResult(_0x198ac3,_0x2c968b){_0x2c968b=_0x2c968b||0xc8;return function(_0x37e682){if(_0x37e682){return _0x198ac3[_0xb442('0x13')](_0x2c968b)[_0xb442('0x14')](_0x37e682);}};}function respondWithFilteredResult(_0x36d45a,_0x110d2d){return function(_0x26dbbd){if(_0x26dbbd){var _0x37a760=typeof _0x110d2d[_0xb442('0x15')]===_0xb442('0x16')&&typeof _0x110d2d['limit']===_0xb442('0x16');var _0x4640c1=_0x26dbbd[_0xb442('0x17')];var _0x21fd86=_0x37a760?0x0:_0x110d2d[_0xb442('0x15')];var _0x340d2a=_0x37a760?_0x26dbbd['count']:_0x110d2d['offset']+_0x110d2d['limit'];var _0x102718;if(_0x340d2a>=_0x4640c1){_0x340d2a=_0x4640c1;_0x102718=0xc8;}else{_0x102718=0xce;}_0x36d45a[_0xb442('0x13')](_0x102718);return _0x36d45a[_0xb442('0x18')](_0xb442('0x19'),_0x21fd86+'-'+_0x340d2a+'/'+_0x4640c1)['json'](_0x26dbbd);}return null;};}function saveUpdates(_0xd9e89){return function(_0x5f0852){if(_0x5f0852){return _0x5f0852[_0xb442('0x1a')](_0xd9e89)['then'](function(_0x4aab5f){return _0x4aab5f;});}return null;};}function removeEntity(_0x1cc607){return function(_0x211366){if(_0x211366){return _0x211366[_0xb442('0x1b')]()['then'](function(){_0x1cc607[_0xb442('0x13')](0xcc)[_0xb442('0x1c')]();});}};}function handleEntityNotFound(_0xaa1109){return function(_0x51e4cc){if(!_0x51e4cc){_0xaa1109[_0xb442('0x12')](0x194);}return _0x51e4cc;};}function handleError(_0xe8811e,_0x19e1a3){_0x19e1a3=_0x19e1a3||0x1f4;return function(_0x133549){logger[_0xb442('0x1d')](_0x133549['stack']);if(_0x133549[_0xb442('0x1e')]){delete _0x133549[_0xb442('0x1e')];}_0xe8811e[_0xb442('0x13')](_0x19e1a3)[_0xb442('0x1f')](_0x133549);};}exports[_0xb442('0x20')]=function(_0xfe2b1b,_0x5740a8){var _0x17ad90={};var _0x25606b=_[_0xb442('0x21')](db[_0xb442('0x22')]['rawAttributes'],function(_0x385c23){return{'name':_0x385c23[_0xb442('0x23')],'type':_0x385c23[_0xb442('0x24')][_0xb442('0x25')]};});_0x17ad90=qs['getOptions'](_0x25606b,_0xfe2b1b);return interaction[_0xb442('0x26')](_0xb442('0x27'),_0xfe2b1b[_0xb442('0x28')],_0xfe2b1b[_0xb442('0x29')],_0x17ad90,_0x25606b)['then'](respondWithFilteredResult(_0x5740a8,_0x17ad90))['catch'](handleError(_0x5740a8,null));};exports[_0xb442('0x2a')]=function(_0x30f9a0,_0x582b03){var _0x36104b={'raw':![],'where':{'id':_0x30f9a0[_0xb442('0x2b')]['id']}},_0x5e3b2e={};_0x5e3b2e[_0xb442('0x2c')]=_['keys'](db['FaxInteraction'][_0xb442('0x2d')]);_0x5e3b2e['query']=_[_0xb442('0x2e')](_0x30f9a0[_0xb442('0x28')]);_0x5e3b2e[_0xb442('0x2f')]=_[_0xb442('0x30')](_0x5e3b2e['model'],_0x5e3b2e[_0xb442('0x28')]);_0x36104b[_0xb442('0x31')]=_[_0xb442('0x30')](_0x5e3b2e[_0xb442('0x2c')],qs[_0xb442('0x32')](_0x30f9a0['query'][_0xb442('0x32')]));_0x36104b[_0xb442('0x31')]=_0x36104b[_0xb442('0x31')][_0xb442('0x33')]?_0x36104b[_0xb442('0x31')]:_0x5e3b2e['model'];if(_0x30f9a0['query'][_0xb442('0x34')]){_0x36104b[_0xb442('0x35')]=[{'all':!![]}];}_0x36104b=_['merge']({},_0x36104b,_0x30f9a0['options']);return db['FaxInteraction'][_0xb442('0x36')](_0x36104b)[_0xb442('0x37')](handleEntityNotFound(_0x582b03,null))['then'](respondWithResult(_0x582b03,null))['catch'](handleError(_0x582b03,null));};exports['create']=function(_0x47dcca,_0x5e37f3){return db[_0xb442('0x22')][_0xb442('0x38')](_0x47dcca[_0xb442('0x39')],{})[_0xb442('0x37')](respondWithResult(_0x5e37f3,0xc9))[_0xb442('0x3a')](handleError(_0x5e37f3,null));};exports[_0xb442('0x1a')]=function(_0x749b8f,_0x4b808d){if(_0x749b8f['body']['id']){delete _0x749b8f[_0xb442('0x39')]['id'];}return db[_0xb442('0x22')][_0xb442('0x36')]({'where':{'id':_0x749b8f[_0xb442('0x2b')]['id']}})[_0xb442('0x37')](handleEntityNotFound(_0x4b808d,null))['then'](saveUpdates(_0x749b8f[_0xb442('0x39')],null))[_0xb442('0x37')](respondWithResult(_0x4b808d,null))['catch'](handleError(_0x4b808d,null));};exports['destroy']=function(_0x15b805,_0x374324){return db['FaxInteraction'][_0xb442('0x36')]({'where':{'id':_0x15b805['params']['id']}})[_0xb442('0x37')](handleEntityNotFound(_0x374324,null))[_0xb442('0x37')](removeEntity(_0x374324,null))[_0xb442('0x3a')](handleError(_0x374324,null));};exports['describe']=function(_0x1e433c,_0x33bc85){return db[_0xb442('0x22')][_0xb442('0x3b')]()[_0xb442('0x37')](respondWithResult(_0x33bc85,null))[_0xb442('0x3a')](handleError(_0x33bc85,null));};exports[_0xb442('0x3c')]=function(_0x4ac9c6,_0x4ff926){return db['FaxMessage'][_0xb442('0x36')]({'where':{'id':_0x4ac9c6['params']['id']}})[_0xb442('0x37')](handleEntityNotFound(_0x4ff926,null))[_0xb442('0x37')](function(_0x5390b5){if(_0x5390b5){return _0x5390b5[_0xb442('0x3c')](_0x4ac9c6['body'][_0xb442('0x3d')],_[_0xb442('0x3e')](_0x4ac9c6[_0xb442('0x39')],[_0xb442('0x3d'),'id'])||{});}})[_0xb442('0x37')](respondWithResult(_0x4ff926,null))[_0xb442('0x3a')](handleError(_0x4ff926,null));};exports[_0xb442('0x3f')]=function(_0x58438e,_0x429ed0){var _0x2c74d9={'raw':![],'where':{}};var _0x31970b={};var _0x2e60af={'count':0x0,'rows':[]};return db[_0xb442('0x22')][_0xb442('0x40')]({'where':{'id':_0x58438e[_0xb442('0x2b')]['id']}})[_0xb442('0x37')](handleEntityNotFound(_0x429ed0,null))[_0xb442('0x37')](function(_0x274da1){if(_0x274da1){_0x31970b[_0xb442('0x2c')]=_['keys'](db['FaxMessage'][_0xb442('0x2d')]);_0x31970b['query']=_[_0xb442('0x2e')](_0x58438e[_0xb442('0x28')]);_0x31970b[_0xb442('0x2f')]=_['intersection'](_0x31970b[_0xb442('0x2c')],_0x31970b['query']);_0x2c74d9[_0xb442('0x31')]=_[_0xb442('0x30')](_0x31970b['model'],qs['fields'](_0x58438e[_0xb442('0x28')][_0xb442('0x32')]));_0x2c74d9[_0xb442('0x31')]=_0x2c74d9['attributes'][_0xb442('0x33')]?_0x2c74d9[_0xb442('0x31')]:_0x31970b[_0xb442('0x2c')];if(!_0x58438e[_0xb442('0x28')]['hasOwnProperty']('nolimit')){_0x2c74d9[_0xb442('0x41')]=qs[_0xb442('0x41')](_0x58438e[_0xb442('0x28')][_0xb442('0x41')]);_0x2c74d9[_0xb442('0x15')]=qs[_0xb442('0x15')](_0x58438e[_0xb442('0x28')]['offset']);}_0x2c74d9[_0xb442('0x42')]=qs['sort'](_0x58438e['query'][_0xb442('0x43')]);_0x2c74d9[_0xb442('0x44')]=qs[_0xb442('0x2f')](_[_0xb442('0x45')](_0x58438e[_0xb442('0x28')],_0x31970b['filters']));_0x2c74d9['where'][_0xb442('0x46')]=_0x274da1['id'];if(_0x58438e[_0xb442('0x28')][_0xb442('0x47')]){_0x2c74d9['where']=_[_0xb442('0x48')](_0x2c74d9[_0xb442('0x44')],{'$or':_[_0xb442('0x21')](_0x2c74d9[_0xb442('0x31')],function(_0x184e9f){var _0x134dd9={};_0x134dd9[_0x184e9f]={'$like':'%'+_0x58438e['query'][_0xb442('0x47')]+'%'};return _0x134dd9;})});}if(_0x58438e['query'][_0xb442('0x49')]){var _0x53cb8f=_0x58438e[_0xb442('0x28')][_0xb442('0x49')][_0xb442('0x4a')](',');var _0x207c61={};_0x207c61[_0x53cb8f[0x0]]={'$gte':moment(_0x53cb8f[0x1])[_0xb442('0x4b')](_0xb442('0x4c'))};_0x2c74d9[_0xb442('0x44')]=_[_0xb442('0x48')](_0x2c74d9[_0xb442('0x44')],_0x207c61);}_0x2c74d9=_['merge']({},_0x2c74d9,_0x58438e[_0xb442('0x4d')]);return db[_0xb442('0x4e')][_0xb442('0x17')]({'where':_0x2c74d9[_0xb442('0x44')]})[_0xb442('0x37')](function(_0x4b7379){_0x2e60af[_0xb442('0x17')]=_0x4b7379;if(_0x58438e[_0xb442('0x28')]['includeAll']){_0x2c74d9[_0xb442('0x35')]=[{'all':!![]}];}return db[_0xb442('0x4e')][_0xb442('0x26')](_0x2c74d9);})['then'](function(_0x3accd5){_0x2e60af[_0xb442('0x4f')]=_0x3accd5;return _0x2e60af;});}})['then'](respondWithFilteredResult(_0x429ed0,_0x2c74d9))[_0xb442('0x3a')](handleError(_0x429ed0,null));};exports[_0xb442('0x50')]=function(_0x1059d9,_0x153c3b){return db[_0xb442('0x22')]['find']({'where':{'id':_0x1059d9[_0xb442('0x2b')]['id']}})['then'](handleEntityNotFound(_0x153c3b,null))[_0xb442('0x37')](function(_0x5694fe){if(_0x5694fe){return _0x5694fe[_0xb442('0x51')](_0x1059d9['body'][_0xb442('0x3d')],_['omit'](_0x1059d9[_0xb442('0x39')],[_0xb442('0x3d'),'id'])||{})[_0xb442('0x52')](function(){return db[_0xb442('0x53')][_0xb442('0x26')]({'attributes':['id',_0xb442('0x1e'),_0xb442('0x54')],'where':{'id':_0x1059d9[_0xb442('0x39')][_0xb442('0x3d')]}});})[_0xb442('0x37')](function(_0x1a046f){socket[_0xb442('0x55')]('faxInteractionTags:save',{'id':Number(_0x1059d9[_0xb442('0x2b')]['id']),'tags':_0x1a046f||[]});return{'id':Number(_0x1059d9[_0xb442('0x2b')]['id']),'tags':_0x1a046f||[]};});}})['then'](respondWithResult(_0x153c3b,null))[_0xb442('0x3a')](handleError(_0x153c3b,null));};exports[_0xb442('0x56')]=function(_0x5287d4,_0x217fcc){return db[_0xb442('0x22')][_0xb442('0x36')]({'where':{'id':_0x5287d4[_0xb442('0x2b')]['id']}})[_0xb442('0x37')](handleEntityNotFound(_0x217fcc,null))[_0xb442('0x37')](function(_0x47c9f1){if(_0x47c9f1){return _0x47c9f1[_0xb442('0x56')](_0x5287d4[_0xb442('0x28')][_0xb442('0x3d')]);}})[_0xb442('0x37')](respondWithStatusCode(_0x217fcc,null))['catch'](handleError(_0x217fcc,null));};exports[_0xb442('0x57')]=function(_0x517276,_0x45699b){var _0x1c45a9=moment()[_0xb442('0x58')]()[_0xb442('0x59')]();var _0x2dbf5d=path[_0xb442('0x5a')](config[_0xb442('0x5b')],_0xb442('0x5c'),_0xb442('0x5d'),'tmp');var _0x10d743=path[_0xb442('0x5a')](config[_0xb442('0x5b')],_0xb442('0x5c'),_0xb442('0x5d'),_0xb442('0x5e'));var _0x5deea0=path[_0xb442('0x5a')](_0x2dbf5d,_0x1c45a9);var _0x5c2a73=util['format'](_0xb442('0x5f'),_0x517276['params']['id'],_0x1c45a9);var _0x11ca1c=path[_0xb442('0x5a')](_0x2dbf5d,_0x5c2a73);var _0x4d1d37=[];_0x4d1d37[_0xb442('0x60')]({'model':db[_0xb442('0x61')],'as':_0xb442('0x61'),'raw':!![]});var _0x3d3979=[{'model':db['FaxMessage'],'as':_0xb442('0x62'),'attributes':['id',_0xb442('0x39'),_0xb442('0x63')],'include':_0x4d1d37}];return db[_0xb442('0x22')][_0xb442('0x36')]({'where':{'id':_0x517276[_0xb442('0x2b')]['id']},'include':_0x3d3979})['then'](handleEntityNotFound(_0x45699b,null))['then'](function(_0x5e2611){if(_0x5e2611&&_0x5e2611[_0xb442('0x62')]){var _0x5aa7ef=_0x5e2611['get']({'plain':!![]});fs[_0xb442('0x64')](_0x5deea0);for(var _0xd0baea=0x0;_0xd0baea<_0x5aa7ef[_0xb442('0x62')][_0xb442('0x33')];_0xd0baea++){var _0x31150e=_0x5aa7ef[_0xb442('0x62')][_0xd0baea][_0xb442('0x61')];if(_0x31150e){var _0x4ae48e=path['join'](_0x10d743,_0x31150e[_0xb442('0x65')]);if(fs[_0xb442('0x66')](_0x4ae48e)){fs['createReadStream'](_0x4ae48e)['pipe'](fs[_0xb442('0x67')](path[_0xb442('0x5a')](_0x5deea0,_0x31150e[_0xb442('0x65')])));}}}return BPromise[_0xb442('0x68')]()['then'](function(){return new BPromise(function(_0x5a43dd,_0x56a921){zipdir(_0x5deea0,{'saveTo':_0x11ca1c},function(_0x134c85,_0x305cba){if(_0x134c85)return _0x56a921(_0x134c85);return _0x5a43dd(_0x305cba);});})[_0xb442('0x37')](function(){return new BPromise(function(_0x3d90d9,_0xcdb35f){rimraf(_0x5deea0,function(_0x1abd93){if(_0x1abd93)_0xcdb35f(_0x1abd93);return _0x3d90d9();});});})[_0xb442('0x37')](function(){return _0x45699b[_0xb442('0x57')](_0x11ca1c,_0x5c2a73,function(_0x4786cb){if(_0x4786cb){console['log']('err',_0x4786cb);}else{fs[_0xb442('0x69')](_0x11ca1c);}});});});}else{return _0x45699b[_0xb442('0x12')](0xc8);}})[_0xb442('0x3a')](handleError(_0x45699b,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 52bb018..6ec3345 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 _0x46ef=['remove','getUsers','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x5f3385,_0x22bf86){var _0x56a128=function(_0x58acb2){while(--_0x58acb2){_0x5f3385['push'](_0x5f3385['shift']());}};_0x56a128(++_0x22bf86);}(_0x46ef,0x12d));var _0xf46e=function(_0x4f31d2,_0x220cb5){_0x4f31d2=_0x4f31d2-0x0;var _0x36d5e0=_0x46ef[_0x4f31d2];return _0x36d5e0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0xf46e('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0xf46e('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf46e('0x2')](0x0);var events={'afterCreate':_0xf46e('0x3'),'afterUpdate':_0xf46e('0x4'),'afterDestroy':_0xf46e('0x5')};function emitEvent(_0x844ff4){return function(_0x1ad5aa,_0x215d00,_0x2cf583){_0x1ad5aa[_0xf46e('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e9fc4){_0x1ad5aa[_0xf46e('0x7')](_0xf46e('0x8'),_0x1e9fc4[_0xf46e('0x9')](function(_0xe64612){return{'id':_0xe64612['id']};}));return FaxMessage[_0xf46e('0xa')]({'where':{'FaxInteractionId':_0x1ad5aa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3c8b4e){_0x1ad5aa[_0xf46e('0x7')]('unreadMessages',_0x3c8b4e[_0xf46e('0xb')]);FaxInteractionEvents['emit'](_0x844ff4+':'+_0x1ad5aa['id'],_0x1ad5aa);FaxInteractionEvents[_0xf46e('0xc')](_0x844ff4,_0x1ad5aa);_0x2cf583(null);})[_0xf46e('0xd')](_0x2cf583(null));};}for(var e in events){if(events[_0xf46e('0xe')](e)){var event=events[e];FaxInteraction[_0xf46e('0xf')](e,emitEvent(event));}}module[_0xf46e('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x8f5f=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','save','update','getUsers','then','setDataValue','map','findAll'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x8f5f,0xf6));var _0xf8f5=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0x8f5f[_0x26e727];return _0x563800;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xf8f5('0x0'))['db'][_0xf8f5('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xf8f5('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8f5('0x3'),'afterUpdate':_0xf8f5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3140e5){return function(_0x2b0469,_0x3e19e5,_0x518c62){_0x2b0469[_0xf8f5('0x5')]({'attributes':['id'],'raw':!![]})[_0xf8f5('0x6')](function(_0x36d021){_0x2b0469[_0xf8f5('0x7')]('Users',_0x36d021[_0xf8f5('0x8')](function(_0x20a47e){return{'id':_0x20a47e['id']};}));return FaxMessage[_0xf8f5('0x9')]({'where':{'FaxInteractionId':_0x2b0469['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf8f5('0x6')](function(_0x57c59b){_0x2b0469['setDataValue'](_0xf8f5('0xa'),_0x57c59b['length']);FaxInteractionEvents[_0xf8f5('0xb')](_0x3140e5+':'+_0x2b0469['id'],_0x2b0469);FaxInteractionEvents[_0xf8f5('0xb')](_0x3140e5,_0x2b0469);_0x518c62(null);})[_0xf8f5('0xc')](_0x518c62(null));};}for(var e in events){if(events[_0xf8f5('0xd')](e)){var event=events[e];FaxInteraction[_0xf8f5('0xe')](e,emitEvent(event));}}module[_0xf8f5('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 4ac4ef8..a57c3dd 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 _0xc833=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxInteraction.attributes','fax_interactions','changed','closed','closedAt','format'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0xc833,0xfd));var _0x3c83=function(_0x25aafc,_0x30489e){_0x25aafc=_0x25aafc-0x0;var _0x3325d3=_0xc833[_0x25aafc];return _0x3325d3;};'use strict';var _=require('lodash');var util=require(_0x3c83('0x0'));var logger=require(_0x3c83('0x1'))(_0x3c83('0x2'));var moment=require(_0x3c83('0x3'));var BPromise=require(_0x3c83('0x4'));var rp=require(_0x3c83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c83('0x6'));var config=require('../../config/environment');var attributes=require(_0x3c83('0x7'));module['exports']=function(_0x25adc4,_0x1e6cd0){return _0x25adc4['define']('FaxInteraction',attributes,{'tableName':_0x3c83('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10f404,_0x13e957,_0x7a45fa){if(_0x10f404[_0x3c83('0x9')](_0x3c83('0xa'))){_0x10f404[_0x3c83('0xb')]=moment()[_0x3c83('0xc')](_0x3c83('0xd'));}_0x7a45fa(null,_0x10f404);}}});}; \ No newline at end of file +var _0xafce=['bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xafce,0x9e));var _0xeafc=function(_0x1d982d,_0xfb3a79){_0x1d982d=_0x1d982d-0x0;var _0x2d24ba=_0xafce[_0x1d982d];return _0x2d24ba;};'use strict';var _=require(_0xeafc('0x0'));var util=require(_0xeafc('0x1'));var logger=require('../../config/logger')(_0xeafc('0x2'));var moment=require(_0xeafc('0x3'));var BPromise=require(_0xeafc('0x4'));var rp=require(_0xeafc('0x5'));var fs=require('fs');var path=require(_0xeafc('0x6'));var rimraf=require(_0xeafc('0x7'));var config=require('../../config/environment');var attributes=require(_0xeafc('0x8'));module[_0xeafc('0x9')]=function(_0x1caf2d,_0x2e719c){return _0x1caf2d[_0xeafc('0xa')](_0xeafc('0xb'),attributes,{'tableName':_0xeafc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x556820,_0x5b61a3,_0x37dab7){if(_0x556820[_0xeafc('0xd')](_0xeafc('0xe'))){_0x556820[_0xeafc('0xf')]=moment()[_0xeafc('0x10')](_0xeafc('0x11'));}_0x37dab7(null,_0x556820);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 0cf9850..0fbca2e 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 _0x0598=['util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','catch','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags'];(function(_0x27bca8,_0x191f63){var _0x370163=function(_0x1329f8){while(--_0x1329f8){_0x27bca8['push'](_0x27bca8['shift']());}};_0x370163(++_0x191f63);}(_0x0598,0x1ad));var _0x8059=function(_0x45ac3a,_0xd642b5){_0x45ac3a=_0x45ac3a-0x0;var _0x5d67b6=_0x0598[_0x45ac3a];return _0x5d67b6;};'use strict';var _=require('lodash');var util=require(_0x8059('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8059('0x1'));var fs=require('fs');var Redis=require(_0x8059('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8059('0x3'));var logger=require(_0x8059('0x4'))(_0x8059('0x5'));var config=require(_0x8059('0x6'));var jayson=require(_0x8059('0x7'));var client=jayson[_0x8059('0x8')][_0x8059('0x9')]({'port':0x232a});config[_0x8059('0xa')]=_['defaults'](config[_0x8059('0xa')],{'host':_0x8059('0xb'),'port':0x18eb});var socket=require(_0x8059('0xc'))(new Redis(config[_0x8059('0xa')]));require(_0x8059('0xd'))[_0x8059('0xe')](socket);function respondWithRpcPromise(_0x4170e7,_0x439eb6,_0x1ea488){return new BPromise(function(_0x31913d,_0x5a2bae){return client[_0x8059('0xf')](_0x4170e7,_0x1ea488)[_0x8059('0x10')](function(_0x5837ab){logger[_0x8059('0x11')](_0x8059('0x12'),_0x439eb6,'request\x20sent');logger[_0x8059('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x439eb6,_0x8059('0x14'),JSON[_0x8059('0x15')](_0x5837ab));if(_0x5837ab[_0x8059('0x16')]){if(_0x5837ab[_0x8059('0x16')][_0x8059('0x17')]===0x1f4){logger[_0x8059('0x16')](_0x8059('0x12'),_0x439eb6,_0x5837ab['error']['message']);return _0x5a2bae(_0x5837ab[_0x8059('0x16')][_0x8059('0x18')]);}logger['error'](_0x8059('0x12'),_0x439eb6,_0x5837ab[_0x8059('0x16')][_0x8059('0x18')]);return _0x31913d(_0x5837ab[_0x8059('0x16')][_0x8059('0x18')]);}else{logger[_0x8059('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x439eb6,'request\x20sent');_0x31913d(_0x5837ab[_0x8059('0x19')][_0x8059('0x18')]);}})['catch'](function(_0x5e9d26){logger['error'](_0x8059('0x12'),_0x439eb6,_0x5e9d26);_0x5a2bae(_0x5e9d26);});});}exports[_0x8059('0x1a')]=function(_0x4a1aef){var _0x479eb0=this;return new Promise(function(_0x16189d,_0x447784){return db[_0x8059('0x1b')]['update'](_0x4a1aef[_0x8059('0x1c')],{'raw':_0x4a1aef['options']?_0x4a1aef[_0x8059('0x1d')][_0x8059('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a1aef[_0x8059('0x1d')]?_0x4a1aef[_0x8059('0x1d')][_0x8059('0x1f')]||null:null,'attributes':_0x4a1aef[_0x8059('0x1d')]?_0x4a1aef[_0x8059('0x1d')]['attributes']||null:null,'limit':_0x4a1aef[_0x8059('0x1d')]?_0x4a1aef[_0x8059('0x1d')]['limit']||null:null})[_0x8059('0x10')](function(_0x540697){logger[_0x8059('0x11')](_0x8059('0x1a'),_0x4a1aef);logger['debug'](_0x8059('0x1a'),_0x4a1aef,JSON['stringify'](_0x540697));_0x16189d(_0x540697);})[_0x8059('0x20')](function(_0xe6fe21){logger[_0x8059('0x16')](_0x8059('0x1a'),_0xe6fe21['message'],_0x4a1aef);_0x447784(_0x479eb0[_0x8059('0x16')](0x1f4,_0xe6fe21[_0x8059('0x18')]));});});};exports[_0x8059('0x21')]=function(_0x34880c){return new Promise(function(_0x389184,_0x2008c9){return db[_0x8059('0x1b')]['find']({'where':_0x34880c[_0x8059('0x1d')]?_0x34880c['options'][_0x8059('0x1f')]||null:null})[_0x8059('0x10')](function(_0x55920a){if(_0x55920a){return _0x55920a[_0x8059('0x22')](_0x34880c[_0x8059('0x1c')][_0x8059('0x23')],_[_0x8059('0x24')](_0x34880c['body'],['ids','id'])||{});}})[_0x8059('0x25')](function(_0x492d86){logger['info'](_0x8059('0x26'),_0x34880c);logger['debug'](_0x8059('0x26'),_0x34880c,JSON[_0x8059('0x15')](_0x492d86));_0x389184(_0x492d86);})['catch'](function(_0xa29c98){logger['error'](_0x8059('0x26'),_0xa29c98[_0x8059('0x18')],_0x34880c);_0x2008c9(_this['error'](0x1f4,_0xa29c98[_0x8059('0x18')]));});});}; \ No newline at end of file +var _0xd151=['debug','request\x20sent','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','then','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','socket.io-emitter','redis','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s'];(function(_0x3254c1,_0x508259){var _0x1ca919=function(_0x4221aa){while(--_0x4221aa){_0x3254c1['push'](_0x3254c1['shift']());}};_0x1ca919(++_0x508259);}(_0xd151,0x8e));var _0x1d15=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0xd151[_0x413aac];return _0x569b11;};'use strict';var _=require(_0x1d15('0x0'));var util=require(_0x1d15('0x1'));var moment=require(_0x1d15('0x2'));var BPromise=require(_0x1d15('0x3'));var rs=require(_0x1d15('0x4'));var fs=require('fs');var Redis=require(_0x1d15('0x5'));var db=require(_0x1d15('0x6'))['db'];var utils=require(_0x1d15('0x7'));var logger=require(_0x1d15('0x8'))(_0x1d15('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d15('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1d15('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1d15('0xc'))(new Redis(config[_0x1d15('0xd')]));require(_0x1d15('0xe'))['register'](socket);function respondWithRpcPromise(_0x202cf8,_0x28f198,_0x5e41a5){return new BPromise(function(_0x3f9434,_0x438aa3){return client[_0x1d15('0xf')](_0x202cf8,_0x5e41a5)['then'](function(_0x157f30){logger[_0x1d15('0x10')](_0x1d15('0x11'),_0x28f198,'request\x20sent');logger[_0x1d15('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x28f198,_0x1d15('0x13'),JSON['stringify'](_0x157f30));if(_0x157f30[_0x1d15('0x14')]){if(_0x157f30['error'][_0x1d15('0x15')]===0x1f4){logger[_0x1d15('0x14')](_0x1d15('0x11'),_0x28f198,_0x157f30['error']['message']);return _0x438aa3(_0x157f30[_0x1d15('0x14')][_0x1d15('0x16')]);}logger[_0x1d15('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x28f198,_0x157f30['error'][_0x1d15('0x16')]);return _0x3f9434(_0x157f30['error'][_0x1d15('0x16')]);}else{logger[_0x1d15('0x10')](_0x1d15('0x11'),_0x28f198,_0x1d15('0x13'));_0x3f9434(_0x157f30[_0x1d15('0x17')][_0x1d15('0x16')]);}})[_0x1d15('0x18')](function(_0xdd3cff){logger[_0x1d15('0x14')](_0x1d15('0x11'),_0x28f198,_0xdd3cff);_0x438aa3(_0xdd3cff);});});}exports[_0x1d15('0x19')]=function(_0x27a460){var _0x49319c=this;return new Promise(function(_0x21dced,_0x57dae3){return db[_0x1d15('0x1a')]['update'](_0x27a460[_0x1d15('0x1b')],{'raw':_0x27a460[_0x1d15('0x1c')]?_0x27a460[_0x1d15('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27a460[_0x1d15('0x1c')]?_0x27a460['options'][_0x1d15('0x1d')]||null:null,'attributes':_0x27a460[_0x1d15('0x1c')]?_0x27a460[_0x1d15('0x1c')][_0x1d15('0x1e')]||null:null,'limit':_0x27a460['options']?_0x27a460['options']['limit']||null:null})[_0x1d15('0x1f')](function(_0x5bce54){logger[_0x1d15('0x10')](_0x1d15('0x19'),_0x27a460);logger[_0x1d15('0x12')](_0x1d15('0x19'),_0x27a460,JSON[_0x1d15('0x20')](_0x5bce54));_0x21dced(_0x5bce54);})[_0x1d15('0x18')](function(_0x5203b0){logger[_0x1d15('0x14')]('UpdateFaxInteraction',_0x5203b0[_0x1d15('0x16')],_0x27a460);_0x57dae3(_0x49319c['error'](0x1f4,_0x5203b0['message']));});});};exports[_0x1d15('0x21')]=function(_0x2ee9ba){return new Promise(function(_0x3fb47f,_0x2946c1){return db['FaxInteraction'][_0x1d15('0x22')]({'where':_0x2ee9ba[_0x1d15('0x1c')]?_0x2ee9ba[_0x1d15('0x1c')][_0x1d15('0x1d')]||null:null})[_0x1d15('0x1f')](function(_0x31df0a){if(_0x31df0a){return _0x31df0a[_0x1d15('0x23')](_0x2ee9ba['body'][_0x1d15('0x24')],_[_0x1d15('0x25')](_0x2ee9ba[_0x1d15('0x1b')],[_0x1d15('0x24'),'id'])||{});}})[_0x1d15('0x26')](function(_0x214b1e){logger[_0x1d15('0x10')]('AddTags',_0x2ee9ba);logger[_0x1d15('0x12')](_0x1d15('0x27'),_0x2ee9ba,JSON['stringify'](_0x214b1e));_0x3fb47f(_0x214b1e);})[_0x1d15('0x18')](function(_0x17fe21){logger['error']('AddTags',_0x17fe21['message'],_0x2ee9ba);_0x2946c1(_this['error'](0x1f4,_0x17fe21[_0x1d15('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 74b9bd7..3402d60 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 _0x2cb1=['save','remove','removeListener','register','length','faxInteraction:'];(function(_0x3275d4,_0x3747ff){var _0x1b2e1b=function(_0x4887f3){while(--_0x4887f3){_0x3275d4['push'](_0x3275d4['shift']());}};_0x1b2e1b(++_0x3747ff);}(_0x2cb1,0x12c));var _0x12cb=function(_0x4ccf6f,_0x57c51d){_0x4ccf6f=_0x4ccf6f-0x0;var _0x3df6b0=_0x2cb1[_0x4ccf6f];return _0x3df6b0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x12cb('0x0'),_0x12cb('0x1'),'update'];function createListener(_0x5dcc2d,_0x5a8acd){return function(_0x1e605f){_0x5a8acd['emit'](_0x5dcc2d,_0x1e605f);};}function removeListener(_0x554922,_0x5bea55){return function(){FaxInteractionEvents[_0x12cb('0x2')](_0x554922,_0x5bea55);};}exports[_0x12cb('0x3')]=function(_0x5a25f0){for(var _0x28b68d=0x0,_0x182bd4=events[_0x12cb('0x4')];_0x28b68d<_0x182bd4;_0x28b68d++){var _0x259a16=events[_0x28b68d];var _0x2be21d=createListener(_0x12cb('0x5')+_0x259a16,_0x5a25f0);FaxInteractionEvents['on'](_0x259a16,_0x2be21d);}}; \ No newline at end of file +var _0xc21f=['update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0xc21f,0x1cc));var _0xfc21=function(_0x3ee94e,_0x163707){_0x3ee94e=_0x3ee94e-0x0;var _0x88cd6f=_0xc21f[_0x3ee94e];return _0x88cd6f;};'use strict';var FaxInteractionEvents=require(_0xfc21('0x0'));var events=['save',_0xfc21('0x1'),_0xfc21('0x2')];function createListener(_0x561403,_0x364ead){return function(_0x1bf524){_0x364ead[_0xfc21('0x3')](_0x561403,_0x1bf524);};}function removeListener(_0x3b7ed7,_0x5d2a21){return function(){FaxInteractionEvents[_0xfc21('0x4')](_0x3b7ed7,_0x5d2a21);};}exports['register']=function(_0x245b88){for(var _0x554900=0x0,_0x1d68a4=events[_0xfc21('0x5')];_0x554900<_0x1d68a4;_0x554900++){var _0xb5584c=events[_0x554900];var _0x4f9250=createListener(_0xfc21('0x6')+_0xb5584c,_0x245b88);FaxInteractionEvents['on'](_0xb5584c,_0x4f9250);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 415baab..2f461c1 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 _0xb51e=['post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','/:id','/:id/messages','/:id/download','download'];(function(_0x23d03d,_0x200409){var _0x24c07c=function(_0x16b7a0){while(--_0x16b7a0){_0x23d03d['push'](_0x23d03d['shift']());}};_0x24c07c(++_0x200409);}(_0xb51e,0x12f));var _0xeb51=function(_0x38a540,_0x1c370d){_0x38a540=_0x38a540-0x0;var _0x1d6c62=_0xb51e[_0x38a540];return _0x1d6c62;};'use strict';var multer=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb51('0x2'));var router=express[_0xeb51('0x3')]();var fs_extra=require(_0xeb51('0x4'));var auth=require(_0xeb51('0x5'));var interaction=require(_0xeb51('0x6'));var config=require(_0xeb51('0x7'));var controller=require(_0xeb51('0x8'));router[_0xeb51('0x9')]('/',auth[_0xeb51('0xa')](),controller['index']);router[_0xeb51('0x9')]('/describe',auth[_0xeb51('0xa')](),controller[_0xeb51('0xb')]);router[_0xeb51('0x9')](_0xeb51('0xc'),auth[_0xeb51('0xa')](),controller['show']);router[_0xeb51('0x9')](_0xeb51('0xd'),auth[_0xeb51('0xa')](),controller['getMessages']);router[_0xeb51('0x9')](_0xeb51('0xe'),auth[_0xeb51('0xa')](),controller[_0xeb51('0xf')]);router[_0xeb51('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeb51('0x10')](_0xeb51('0xd'),auth[_0xeb51('0xa')](),controller[_0xeb51('0x11')]);router[_0xeb51('0x10')](_0xeb51('0x12'),auth[_0xeb51('0xa')](),interaction[_0xeb51('0x13')](_0xeb51('0x14'),_0xeb51('0x15')),controller['addTags']);router[_0xeb51('0x16')](_0xeb51('0xc'),auth[_0xeb51('0xa')](),interaction[_0xeb51('0x13')](_0xeb51('0x14'),_0xeb51('0x17')),controller[_0xeb51('0x18')]);router[_0xeb51('0x19')](_0xeb51('0xc'),auth['isAuthenticated'](),interaction[_0xeb51('0x13')](_0xeb51('0x14'),_0xeb51('0x1a')),controller[_0xeb51('0x1b')]);router[_0xeb51('0x19')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xeb51('0x1c')]=router; \ No newline at end of file +var _0xead8=['/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','/:id','faxinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xead8,0x8f));var _0x8ead=function(_0x2a0dc9,_0x3802f4){_0x2a0dc9=_0x2a0dc9-0x0;var _0x198be1=_0xead8[_0x2a0dc9];return _0x198be1;};'use strict';var multer=require('multer');var util=require(_0x8ead('0x0'));var path=require('path');var timeout=require(_0x8ead('0x1'));var express=require(_0x8ead('0x2'));var router=express['Router']();var fs_extra=require(_0x8ead('0x3'));var auth=require(_0x8ead('0x4'));var interaction=require(_0x8ead('0x5'));var config=require(_0x8ead('0x6'));var controller=require(_0x8ead('0x7'));router[_0x8ead('0x8')]('/',auth[_0x8ead('0x9')](),controller[_0x8ead('0xa')]);router[_0x8ead('0x8')](_0x8ead('0xb'),auth[_0x8ead('0x9')](),controller['describe']);router['get']('/:id',auth[_0x8ead('0x9')](),controller['show']);router[_0x8ead('0x8')](_0x8ead('0xc'),auth['isAuthenticated'](),controller[_0x8ead('0xd')]);router[_0x8ead('0x8')](_0x8ead('0xe'),auth['isAuthenticated'](),controller[_0x8ead('0xf')]);router[_0x8ead('0x10')]('/',auth[_0x8ead('0x9')](),controller[_0x8ead('0x11')]);router['post']('/:id/messages',auth[_0x8ead('0x9')](),controller['addMessage']);router[_0x8ead('0x10')](_0x8ead('0x12'),auth[_0x8ead('0x9')](),interaction[_0x8ead('0x13')](_0x8ead('0x14'),_0x8ead('0x15')),controller[_0x8ead('0x16')]);router[_0x8ead('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x8ead('0x13')](_0x8ead('0x14'),_0x8ead('0x18')),controller['update']);router[_0x8ead('0x19')](_0x8ead('0x1a'),auth['isAuthenticated'](),interaction[_0x8ead('0x13')](_0x8ead('0x14'),_0x8ead('0x1b')),controller[_0x8ead('0x1c')]);router[_0x8ead('0x19')](_0x8ead('0x12'),auth['isAuthenticated'](),controller[_0x8ead('0x1d')]);module[_0x8ead('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d9bbf0e..5bc8743 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 _0xe2cc=['sequelize','exports','BOOLEAN','ENUM','out','TEXT','DATE'];(function(_0x34a128,_0x24b4ad){var _0x1da56c=function(_0x12322f){while(--_0x12322f){_0x34a128['push'](_0x34a128['shift']());}};_0x1da56c(++_0x24b4ad);}(_0xe2cc,0x69));var _0xce2c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe2cc[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xce2c('0x0'));module[_0xce2c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xce2c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xce2c('0x3')]('in',_0xce2c('0x4')),'defaultValue':_0xce2c('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xce2c('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0xce2c('0x6')]}}; \ No newline at end of file +var _0xc5c7=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x2f36a9,_0x73d0bf){_0x2f36a9=_0x2f36a9-0x0;var _0x1efa62=_0xc5c7[_0x2f36a9];return _0x1efa62;};'use strict';var Sequelize=require('sequelize');module[_0x7c5c('0x0')]={'body':{'type':Sequelize[_0x7c5c('0x1')](_0x7c5c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7c5c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7c5c('0x4')]('in',_0x7c5c('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x7c5c('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7c5c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d476b60..b9e43a0 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 _0x1b85=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','debug','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','body','params','describe','fax-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','FaxInteraction','FaxInteractionId','null','RejectMessage','rejectMessage','sequelize','SELECT','internal','event','create','CmContact','findOne','fax','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','join'];(function(_0x56fc9e,_0x1c167c){var _0x3adbfb=function(_0x496355){while(--_0x496355){_0x56fc9e['push'](_0x56fc9e['shift']());}};_0x3adbfb(++_0x1c167c);}(_0x1b85,0x1ad));var _0x51b8=function(_0x45fc9c,_0x70f2cb){_0x45fc9c=_0x45fc9c-0x0;var _0x984946=_0x1b85[_0x45fc9c];return _0x984946;};'use strict';var emlformat=require(_0x51b8('0x0'));var rimraf=require(_0x51b8('0x1'));var zipdir=require(_0x51b8('0x2'));var jsonpatch=require(_0x51b8('0x3'));var rp=require(_0x51b8('0x4'));var moment=require(_0x51b8('0x5'));var BPromise=require(_0x51b8('0x6'));var Mustache=require(_0x51b8('0x7'));var util=require(_0x51b8('0x8'));var path=require(_0x51b8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x51b8('0xa'));var fs=require('fs');var fs_extra=require(_0x51b8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x51b8('0xc'));var jsforce=require(_0x51b8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x51b8('0xe'));var querystring=require(_0x51b8('0xf'));var Papa=require(_0x51b8('0x10'));var Redis=require('ioredis');var authService=require(_0x51b8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x51b8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51b8('0x13'))(_0x51b8('0x14'));var utils=require(_0x51b8('0x15'));var config=require(_0x51b8('0x16'));var licenseUtil=require(_0x51b8('0x17'));var db=require(_0x51b8('0x18'))['db'];config['redis']=_[_0x51b8('0x19')](config[_0x51b8('0x1a')],{'host':_0x51b8('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0x51b8('0x1c')](socket);var jayson=require(_0x51b8('0x1d'));var client=jayson['client'][_0x51b8('0x1e')]({'port':0x232c});var client9002=jayson[_0x51b8('0x1f')][_0x51b8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1b963e,_0x381701,_0x542bc8,_0x5b6feb){return new BPromise(function(_0x3726ff,_0x15b462){var _0x324651=_0x5b6feb||client;return _0x324651[_0x51b8('0x20')](_0x1b963e,_0x542bc8)[_0x51b8('0x21')](function(_0x45b6b9){logger[_0x51b8('0x22')](_0x51b8('0x23'),_0x381701,'request\x20sent');logger[_0x51b8('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x381701,'request\x20sent',JSON[_0x51b8('0x25')](_0x45b6b9));if(_0x45b6b9[_0x51b8('0x26')]){if(_0x45b6b9[_0x51b8('0x26')]['code']===0x1f4){logger[_0x51b8('0x26')](_0x51b8('0x23'),_0x381701,_0x45b6b9['error']['message']);return _0x15b462(_0x45b6b9['error'][_0x51b8('0x27')]);}logger[_0x51b8('0x26')](_0x51b8('0x23'),_0x381701,_0x45b6b9[_0x51b8('0x26')][_0x51b8('0x27')]);return _0x3726ff(_0x45b6b9['error'][_0x51b8('0x27')]);}else{logger[_0x51b8('0x22')](_0x51b8('0x23'),_0x381701,'request\x20sent');_0x3726ff(_0x45b6b9[_0x51b8('0x28')][_0x51b8('0x27')]);}})[_0x51b8('0x29')](function(_0x14cec3){logger['error'](_0x51b8('0x23'),_0x381701,_0x14cec3);_0x15b462(_0x14cec3);});});}function respondWithStatusCode(_0x41693c,_0x7238c0){_0x7238c0=_0x7238c0||0xcc;return function(_0x18b703){if(_0x18b703){return _0x41693c['sendStatus'](_0x7238c0);}return _0x41693c[_0x51b8('0x2a')](_0x7238c0)[_0x51b8('0x2b')]();};}function respondWithResult(_0x9dc473,_0x235818){_0x235818=_0x235818||0xc8;return function(_0x2243e4){if(_0x2243e4){return _0x9dc473['status'](_0x235818)['json'](_0x2243e4);}};}function respondWithFilteredResult(_0x25a9cf,_0x50c3a1){return function(_0x507c01){if(_0x507c01){var _0x2085fb=typeof _0x50c3a1[_0x51b8('0x2c')]===_0x51b8('0x2d')&&typeof _0x50c3a1[_0x51b8('0x2e')]===_0x51b8('0x2d');var _0x47f5c8=_0x507c01[_0x51b8('0x2f')];var _0x4140f3=_0x2085fb?0x0:_0x50c3a1[_0x51b8('0x2c')];var _0x2603d0=_0x2085fb?_0x507c01[_0x51b8('0x2f')]:_0x50c3a1[_0x51b8('0x2c')]+_0x50c3a1[_0x51b8('0x2e')];var _0x546164;if(_0x2603d0>=_0x47f5c8){_0x2603d0=_0x47f5c8;_0x546164=0xc8;}else{_0x546164=0xce;}_0x25a9cf[_0x51b8('0x2a')](_0x546164);return _0x25a9cf[_0x51b8('0x30')](_0x51b8('0x31'),_0x4140f3+'-'+_0x2603d0+'/'+_0x47f5c8)[_0x51b8('0x32')](_0x507c01);}return null;};}function patchUpdates(_0x20d7ff){return function(_0x4d556b){try{jsonpatch['apply'](_0x4d556b,_0x20d7ff,!![]);}catch(_0x1f62cc){return BPromise[_0x51b8('0x33')](_0x1f62cc);}return _0x4d556b[_0x51b8('0x34')]();};}function saveUpdates(_0xf96fce,_0x529904){return function(_0x370802){if(_0x370802){return _0x370802[_0x51b8('0x35')](_0xf96fce)[_0x51b8('0x21')](function(_0x487c4b){return _0x487c4b;});}return null;};}function removeEntity(_0xe4de70,_0xf8bc6d){return function(_0x25d51b){if(_0x25d51b){return _0x25d51b[_0x51b8('0x36')]()['then'](function(){_0xe4de70[_0x51b8('0x2a')](0xcc)[_0x51b8('0x2b')]();});}};}function handleEntityNotFound(_0x2ed0dc,_0x192a0b){return function(_0x305058){if(!_0x305058){_0x2ed0dc[_0x51b8('0x37')](0x194);}return _0x305058;};}function handleError(_0x32dee4,_0x55b924){_0x55b924=_0x55b924||0x1f4;return function(_0x22345d){logger['error'](_0x22345d[_0x51b8('0x38')]);if(_0x22345d[_0x51b8('0x39')]){delete _0x22345d['name'];}_0x32dee4[_0x51b8('0x2a')](_0x55b924)[_0x51b8('0x3a')](_0x22345d);};}exports[_0x51b8('0x3b')]=function(_0x2ce68c,_0x494254){var _0x51fadd={},_0x5e17ae={},_0x3703d1={'count':0x0,'rows':[]};var _0x18ca96=_['map'](db[_0x51b8('0x3c')][_0x51b8('0x3d')],function(_0x4a7ad4){return{'name':_0x4a7ad4[_0x51b8('0x3e')],'type':_0x4a7ad4[_0x51b8('0x3f')][_0x51b8('0x40')]};});_0x5e17ae[_0x51b8('0x41')]=_[_0x51b8('0x42')](_0x18ca96,'name');_0x5e17ae[_0x51b8('0x43')]=_[_0x51b8('0x44')](_0x2ce68c[_0x51b8('0x43')]);_0x5e17ae['filters']=_['intersection'](_0x5e17ae[_0x51b8('0x41')],_0x5e17ae[_0x51b8('0x43')]);_0x51fadd['attributes']=_[_0x51b8('0x45')](_0x5e17ae['model'],qs[_0x51b8('0x46')](_0x2ce68c[_0x51b8('0x43')]['fields']));_0x51fadd['attributes']=_0x51fadd['attributes'][_0x51b8('0x47')]?_0x51fadd[_0x51b8('0x48')]:_0x5e17ae['model'];if(!_0x2ce68c[_0x51b8('0x43')][_0x51b8('0x49')](_0x51b8('0x4a'))){_0x51fadd[_0x51b8('0x2e')]=qs[_0x51b8('0x2e')](_0x2ce68c['query'][_0x51b8('0x2e')]);_0x51fadd['offset']=qs[_0x51b8('0x2c')](_0x2ce68c[_0x51b8('0x43')][_0x51b8('0x2c')]);}_0x51fadd[_0x51b8('0x4b')]=qs['sort'](_0x2ce68c[_0x51b8('0x43')][_0x51b8('0x4c')]);_0x51fadd[_0x51b8('0x4d')]=qs[_0x51b8('0x4e')](_[_0x51b8('0x4f')](_0x2ce68c['query'],_0x5e17ae[_0x51b8('0x4e')]),_0x18ca96);if(_0x2ce68c['query'][_0x51b8('0x50')]){_0x51fadd[_0x51b8('0x4d')]=_[_0x51b8('0x51')](_0x51fadd['where'],{'$or':_[_0x51b8('0x42')](_0x18ca96,function(_0x54c802){if(_0x54c802[_0x51b8('0x3f')]!==_0x51b8('0x52')){var _0x534ea4={};_0x534ea4[_0x54c802[_0x51b8('0x39')]]={'$like':'%'+_0x2ce68c[_0x51b8('0x43')][_0x51b8('0x50')]+'%'};return _0x534ea4;}})});}_0x51fadd=_[_0x51b8('0x51')]({},_0x51fadd,_0x2ce68c[_0x51b8('0x53')]);var _0x3c8910={'where':_0x51fadd[_0x51b8('0x4d')]};return db['FaxMessage'][_0x51b8('0x2f')](_0x3c8910)[_0x51b8('0x21')](function(_0x5a53b1){_0x3703d1[_0x51b8('0x2f')]=_0x5a53b1;if(_0x2ce68c[_0x51b8('0x43')][_0x51b8('0x54')]){_0x51fadd[_0x51b8('0x55')]=[{'all':!![]}];}return db[_0x51b8('0x3c')]['findAll'](_0x51fadd);})[_0x51b8('0x21')](function(_0x171023){_0x3703d1[_0x51b8('0x56')]=_0x171023;return _0x3703d1;})['then'](respondWithFilteredResult(_0x494254,_0x51fadd))[_0x51b8('0x29')](handleError(_0x494254,null));};exports[_0x51b8('0x57')]=function(_0x4f1224,_0x1b38b0){var _0x3909b0={'raw':!![],'where':{'id':_0x4f1224['params']['id']}},_0x34d92e={};_0x34d92e[_0x51b8('0x41')]=_['keys'](db[_0x51b8('0x3c')]['rawAttributes']);_0x34d92e['query']=_[_0x51b8('0x44')](_0x4f1224[_0x51b8('0x43')]);_0x34d92e['filters']=_[_0x51b8('0x45')](_0x34d92e[_0x51b8('0x41')],_0x34d92e[_0x51b8('0x43')]);_0x3909b0['attributes']=_[_0x51b8('0x45')](_0x34d92e[_0x51b8('0x41')],qs['fields'](_0x4f1224[_0x51b8('0x43')][_0x51b8('0x46')]));_0x3909b0[_0x51b8('0x48')]=_0x3909b0[_0x51b8('0x48')][_0x51b8('0x47')]?_0x3909b0[_0x51b8('0x48')]:_0x34d92e[_0x51b8('0x41')];if(_0x4f1224[_0x51b8('0x43')][_0x51b8('0x54')]){_0x3909b0[_0x51b8('0x55')]=[{'all':!![]}];}_0x3909b0=_[_0x51b8('0x51')]({},_0x3909b0,_0x4f1224['options']);return db[_0x51b8('0x3c')][_0x51b8('0x58')](_0x3909b0)[_0x51b8('0x21')](handleEntityNotFound(_0x1b38b0,null))[_0x51b8('0x21')](respondWithResult(_0x1b38b0,null))['catch'](handleError(_0x1b38b0,null));};exports['update']=function(_0x2ec862,_0x55289e){if(_0x2ec862[_0x51b8('0x59')]['id']){delete _0x2ec862[_0x51b8('0x59')]['id'];}return db[_0x51b8('0x3c')][_0x51b8('0x58')]({'where':{'id':_0x2ec862[_0x51b8('0x5a')]['id']}})[_0x51b8('0x21')](handleEntityNotFound(_0x55289e,null))[_0x51b8('0x21')](saveUpdates(_0x2ec862[_0x51b8('0x59')],null))[_0x51b8('0x21')](respondWithResult(_0x55289e,null))[_0x51b8('0x29')](handleError(_0x55289e,null));};exports[_0x51b8('0x36')]=function(_0x22a2e6,_0x370c0e){return db[_0x51b8('0x3c')][_0x51b8('0x58')]({'where':{'id':_0x22a2e6[_0x51b8('0x5a')]['id']}})[_0x51b8('0x21')](handleEntityNotFound(_0x370c0e,null))['then'](removeEntity(_0x370c0e,null))[_0x51b8('0x29')](handleError(_0x370c0e,null));};exports[_0x51b8('0x5b')]=function(_0x4f1e91,_0x4a569d){return db['FaxMessage']['describe']()[_0x51b8('0x21')](respondWithResult(_0x4a569d,null))[_0x51b8('0x29')](handleError(_0x4a569d,null));};var interaction_log=require(_0x51b8('0x13'))(_0x51b8('0x5c'));exports[_0x51b8('0x5d')]=function(_0x91f909,_0x729659,_0x1854ed){var _0xdce407={'agent':{},'channel':'fax'};if(_0x91f909[_0x51b8('0x59')]['id']){delete _0x91f909[_0x51b8('0x59')]['id'];}_0x91f909[_0x51b8('0x59')]['read']=!![];_0x91f909[_0x51b8('0x59')][_0x51b8('0x5e')]=moment()['format'](_0x51b8('0x5f'));_0x91f909['body'][_0x51b8('0x60')]=_0x91f909[_0x51b8('0x59')][_0x51b8('0x60')]||_0x91f909[_0x51b8('0x61')]['id'];_0xdce407[_0x51b8('0x62')]['id']=_0x91f909['body'][_0x51b8('0x60')];return db[_0x51b8('0x3c')]['find']({'where':{'id':_0x91f909[_0x51b8('0x5a')]['id'],'UserId':null}})[_0x51b8('0x21')](handleEntityNotFound(_0x729659,null))[_0x51b8('0x21')](saveUpdates(_0x91f909['body'],null))[_0x51b8('0x21')](function(_0xc5f549){if(_0xc5f549){_0xdce407[_0x51b8('0x27')]=_0xc5f549[_0x51b8('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x51b8('0x58')]({'where':{'id':_0xc5f549['FaxInteractionId']}});}return null;})[_0x51b8('0x21')](handleEntityNotFound(_0x729659,null))[_0x51b8('0x21')](function(_0x4135ed){if(_0x4135ed){return _0x4135ed[_0x51b8('0x35')]({'UserId':_0x91f909[_0x51b8('0x59')][_0x51b8('0x60')],'read1stAt':_[_0x51b8('0x64')](_0x4135ed['read1stAt'])?moment()[_0x51b8('0x65')](_0x51b8('0x5f')):undefined});}return null;})['then'](function(_0x5aeea8){if(_0x5aeea8){_0xdce407[_0x51b8('0x66')]=_0x5aeea8['get']({'plain':!![]});interaction_log[_0x51b8('0x22')](_0x51b8('0x67'),_0x91f909[_0x51b8('0x61')]['id'],_0x91f909['user']['name'],_0x91f909[_0x51b8('0x61')][_0x51b8('0x68')],_0xdce407[_0x51b8('0x66')]['id'],_0x91f909[_0x51b8('0x59')]?JSON[_0x51b8('0x25')](_0x91f909[_0x51b8('0x59')]):'null');return respondWithRpcPromise(_0x51b8('0x69'),_0x51b8('0x6a'),_0xdce407);}return null;})[_0x51b8('0x21')](function(_0x5b9989){var _0x187f25=_0x51b8('0x6b')+_0x5b9989[_0x51b8('0x27')][_0x51b8('0x6c')];return db['sequelize'][_0x51b8('0x43')](_0x187f25,{'type':db[_0x51b8('0x6d')][_0x51b8('0x6e')]['SELECT'],'raw':!![]})[_0x51b8('0x21')](function(_0x52c8b1){return _0x52c8b1;});})[_0x51b8('0x21')](function(_0x366ed4){if(_0x366ed4){_0xdce407[_0x51b8('0x27')][_0x51b8('0x6f')]=_0x366ed4[0x0];if(!_0x91f909[_0x51b8('0x59')]['UserId'])return;return db[_0x51b8('0x70')][_0x51b8('0x58')]({'where':{'id':_0x91f909[_0x51b8('0x59')][_0x51b8('0x60')],'role':_0x51b8('0x62')},'attributes':['id',_0x51b8('0x39'),_0x51b8('0x71'),_0x51b8('0x72'),'internal'],'raw':!![]});}return null;})[_0x51b8('0x21')](function(_0x2f2ece){if(!_0x2f2ece)return null;_0xdce407['message'][_0x51b8('0x62')]=_0x2f2ece;return _0xdce407;})[_0x51b8('0x21')](function(_0x534532){if(_0x534532){if(_0x91f909[_0x51b8('0x59')][_0x51b8('0x73')]){_0xdce407[_0x51b8('0x27')][_0x51b8('0x74')]=util['format'](_0x51b8('0x75'),_0x91f909[_0x51b8('0x61')][_0x51b8('0x39')]);_0xdce407[_0x51b8('0x27')][_0x51b8('0x76')]=_0xdce407[_0x51b8('0x76')];_0xdce407[_0x51b8('0x27')][_0x51b8('0x77')]=_0xdce407[_0x51b8('0x76')];_0xdce407[_0x51b8('0x27')]['event']=_0x51b8('0x5d');return respondWithRpcPromise(_0x51b8('0x78'),_0x51b8('0x78'),{'event':'acceptmessage','message':_0xdce407[_0x51b8('0x27')]},client9002)[_0x51b8('0x21')](function(){return _0xdce407;});}return _0xdce407;}return null;})[_0x51b8('0x21')](respondWithResult(_0x729659,null))[_0x51b8('0x29')](handleError(_0x729659,null));};var interaction_log=require(_0x51b8('0x13'))(_0x51b8('0x5c'));exports[_0x51b8('0x33')]=function(_0x4dadd1,_0x132d21,_0x377109){var _0x110854={'agent':{},'channel':'fax'};if(_0x4dadd1[_0x51b8('0x59')]['id']){delete _0x4dadd1['body']['id'];}_0x4dadd1[_0x51b8('0x59')][_0x51b8('0x60')]=_0x4dadd1[_0x51b8('0x59')][_0x51b8('0x60')]||_0x4dadd1['user']['id'];_0x110854['agent']['id']=_0x4dadd1[_0x51b8('0x59')][_0x51b8('0x60')];return db[_0x51b8('0x3c')][_0x51b8('0x58')]({'where':{'id':_0x4dadd1[_0x51b8('0x5a')]['id'],'UserId':null}})[_0x51b8('0x21')](handleEntityNotFound(_0x132d21,null))[_0x51b8('0x21')](function(_0x676e60){if(_0x676e60){_0x110854[_0x51b8('0x27')]=_0x676e60[_0x51b8('0x63')]({'plain':!![]});return db[_0x51b8('0x79')][_0x51b8('0x58')]({'where':{'id':_0x676e60[_0x51b8('0x7a')]}});}return null;})[_0x51b8('0x21')](handleEntityNotFound(_0x132d21,null))['then'](function(_0x2cfaa4){if(_0x2cfaa4){_0x110854[_0x51b8('0x66')]=_0x2cfaa4[_0x51b8('0x63')]({'plain':!![]});interaction_log[_0x51b8('0x22')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4dadd1[_0x51b8('0x61')]['id'],_0x4dadd1['user'][_0x51b8('0x39')],_0x4dadd1['user'][_0x51b8('0x68')],_0x110854[_0x51b8('0x66')]['id'],_0x4dadd1['body']?JSON[_0x51b8('0x25')](_0x4dadd1[_0x51b8('0x59')]):_0x51b8('0x7b'));return respondWithRpcPromise(_0x51b8('0x7c'),_0x51b8('0x7d'),_0x110854);}return null;})[_0x51b8('0x21')](function(_0x4afa60){var _0x165fe1=_0x51b8('0x6b')+_0x4afa60[_0x51b8('0x27')][_0x51b8('0x6c')];return db[_0x51b8('0x7e')][_0x51b8('0x43')](_0x165fe1,{'type':db[_0x51b8('0x6d')][_0x51b8('0x6e')][_0x51b8('0x7f')],'raw':!![]})['then'](function(_0x26dbd6){return _0x26dbd6;});})[_0x51b8('0x21')](function(_0x23b738){if(_0x23b738){_0x110854['message'][_0x51b8('0x6f')]=_0x23b738[0x0];if(!_0x4dadd1[_0x51b8('0x59')][_0x51b8('0x60')])return;return db['User'][_0x51b8('0x58')]({'where':{'id':_0x4dadd1['body'][_0x51b8('0x60')],'role':_0x51b8('0x62')},'attributes':['id',_0x51b8('0x39'),'fullname',_0x51b8('0x72'),_0x51b8('0x80')],'raw':!![]});}return null;})[_0x51b8('0x21')](function(_0x3b5044){if(!_0x3b5044)return null;_0x110854[_0x51b8('0x27')][_0x51b8('0x62')]=_0x3b5044;return _0x110854;})['then'](function(_0x43e20e){if(_0x43e20e){_0x43e20e[_0x51b8('0x27')]['interface']=util[_0x51b8('0x65')](_0x51b8('0x75'),_0x4dadd1[_0x51b8('0x61')][_0x51b8('0x39')]);_0x43e20e[_0x51b8('0x27')][_0x51b8('0x76')]=_0x110854[_0x51b8('0x76')];_0x43e20e[_0x51b8('0x27')][_0x51b8('0x77')]=_0x110854[_0x51b8('0x76')];_0x43e20e[_0x51b8('0x27')][_0x51b8('0x81')]=_0x51b8('0x33');respondWithRpcPromise('EventManager',_0x51b8('0x78'),{'event':'rejectmessage','message':_0x43e20e['message']},client9002);return _0x110854;}return null;})['then'](respondWithResult(_0x132d21,null))[_0x51b8('0x29')](handleError(_0x132d21,null));};exports['create']=function(_0x9df366,_0x994200){var _0x15666e;return db['FaxMessage'][_0x51b8('0x82')](_0x9df366[_0x51b8('0x59')],{})[_0x51b8('0x21')](function(_0x2e553d){_0x15666e=_0x2e553d;return db[_0x51b8('0x83')][_0x51b8('0x84')]({'where':{'id':_0x15666e[_0x51b8('0x6c')]}});})['then'](function(_0x3a4926){if(_[_0x51b8('0x64')](_0x3a4926)){return;}else{_0x15666e[_0x51b8('0x85')]=_0x3a4926['fax'];return db[_0x51b8('0x86')][_0x51b8('0x84')]({'where':{'id':_0x15666e[_0x51b8('0x87')]}});}})['then'](function(_0x5ee5a9){return respondWithRpcPromise(_0x51b8('0x88'),'SendFax',{'FaxAccountId':_[_0x51b8('0x64')](_0x9df366[_0x51b8('0x59')])?undefined:_0x9df366[_0x51b8('0x59')][_0x51b8('0x89')],'path':_[_0x51b8('0x64')](_0x5ee5a9)?undefined:util[_0x51b8('0x65')](_0x51b8('0x8a'),_0x5ee5a9[_0x51b8('0x8b')]),'fax':_[_0x51b8('0x64')](_0x15666e['fax'])?undefined:_0x15666e[_0x51b8('0x85')],'AttachmentId':_0x15666e[_0x51b8('0x87')]},client9002);})[_0x51b8('0x21')](respondWithResult(_0x994200,0xc9))[_0x51b8('0x29')](handleError(_0x994200,null));};exports[_0x51b8('0x8c')]=function(_0xc6e9c0,_0x1c92d1){var _0x5b47bb=path['join'](config[_0x51b8('0x8d')],'server','files','attachments');return db[_0x51b8('0x3c')][_0x51b8('0x58')]({'where':{'id':_0xc6e9c0[_0x51b8('0x5a')]['id']},'include':[{'model':db['Attachment'],'as':_0x51b8('0x86')}]})[_0x51b8('0x21')](handleEntityNotFound(_0x1c92d1,null))[_0x51b8('0x21')](function(_0x1c07a9){if(_0x1c07a9){return _0x1c92d1[_0x51b8('0x8c')](path[_0x51b8('0x8e')](_0x5b47bb,_0x1c07a9[_0x51b8('0x86')]['basename']));}})['catch'](handleError(_0x1c92d1,null));}; \ No newline at end of file +var _0xf196=['localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','send','index','map','FaxMessage','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','rows','catch','show','merge','options','find','params','describe','fax-interactions','fax','body','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','SELECT','User','rejectmessage','create','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults'];(function(_0x51a292,_0x59a320){var _0x3ef259=function(_0x41df70){while(--_0x41df70){_0x51a292['push'](_0x51a292['shift']());}};_0x3ef259(++_0x59a320);}(_0xf196,0x10a));var _0x6f19=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf196[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x6f19('0x0'));var rimraf=require(_0x6f19('0x1'));var zipdir=require(_0x6f19('0x2'));var jsonpatch=require(_0x6f19('0x3'));var rp=require(_0x6f19('0x4'));var moment=require(_0x6f19('0x5'));var BPromise=require(_0x6f19('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f19('0x7'));var sox=require(_0x6f19('0x8'));var csv=require(_0x6f19('0x9'));var ejs=require(_0x6f19('0xa'));var fs=require('fs');var fs_extra=require(_0x6f19('0xb'));var _=require(_0x6f19('0xc'));var squel=require(_0x6f19('0xd'));var crypto=require(_0x6f19('0xe'));var jsforce=require(_0x6f19('0xf'));var deskjs=require(_0x6f19('0x10'));var toCsv=require(_0x6f19('0x9'));var querystring=require(_0x6f19('0x11'));var Papa=require(_0x6f19('0x12'));var Redis=require(_0x6f19('0x13'));var authService=require(_0x6f19('0x14'));var qs=require(_0x6f19('0x15'));var as=require(_0x6f19('0x16'));var hardwareService=require(_0x6f19('0x17'));var logger=require(_0x6f19('0x18'))(_0x6f19('0x19'));var utils=require(_0x6f19('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f19('0x1b'))['db'];config[_0x6f19('0x1c')]=_[_0x6f19('0x1d')](config[_0x6f19('0x1c')],{'host':_0x6f19('0x1e'),'port':0x18eb});var socket=require(_0x6f19('0x1f'))(new Redis(config[_0x6f19('0x1c')]));require(_0x6f19('0x20'))[_0x6f19('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6f19('0x22')][_0x6f19('0x23')]({'port':0x232c});var client9002=jayson[_0x6f19('0x22')][_0x6f19('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x534dd5,_0x2d2539,_0x25e60f,_0x29a1d0){return new BPromise(function(_0x4a0a27,_0x4d1551){var _0x3a8be9=_0x29a1d0||client;return _0x3a8be9[_0x6f19('0x24')](_0x534dd5,_0x25e60f)['then'](function(_0x476751){logger[_0x6f19('0x25')]('FaxMessage,\x20%s,\x20%s',_0x2d2539,_0x6f19('0x26'));logger[_0x6f19('0x27')](_0x6f19('0x28'),_0x2d2539,_0x6f19('0x26'),JSON[_0x6f19('0x29')](_0x476751));if(_0x476751[_0x6f19('0x2a')]){if(_0x476751[_0x6f19('0x2a')]['code']===0x1f4){logger['error'](_0x6f19('0x2b'),_0x2d2539,_0x476751[_0x6f19('0x2a')][_0x6f19('0x2c')]);return _0x4d1551(_0x476751[_0x6f19('0x2a')][_0x6f19('0x2c')]);}logger[_0x6f19('0x2a')](_0x6f19('0x2b'),_0x2d2539,_0x476751[_0x6f19('0x2a')][_0x6f19('0x2c')]);return _0x4a0a27(_0x476751['error'][_0x6f19('0x2c')]);}else{logger[_0x6f19('0x25')](_0x6f19('0x2b'),_0x2d2539,'request\x20sent');_0x4a0a27(_0x476751[_0x6f19('0x2d')]['message']);}})['catch'](function(_0x3a5fbd){logger[_0x6f19('0x2a')](_0x6f19('0x2b'),_0x2d2539,_0x3a5fbd);_0x4d1551(_0x3a5fbd);});});}function respondWithStatusCode(_0x519e04,_0x453bec){_0x453bec=_0x453bec||0xcc;return function(_0x177cea){if(_0x177cea){return _0x519e04[_0x6f19('0x2e')](_0x453bec);}return _0x519e04[_0x6f19('0x2f')](_0x453bec)[_0x6f19('0x30')]();};}function respondWithResult(_0x564c40,_0x4a2e10){_0x4a2e10=_0x4a2e10||0xc8;return function(_0x500f37){if(_0x500f37){return _0x564c40[_0x6f19('0x2f')](_0x4a2e10)[_0x6f19('0x31')](_0x500f37);}};}function respondWithFilteredResult(_0x2a69c4,_0x499984){return function(_0x30dbfc){if(_0x30dbfc){var _0x4b3cbf=typeof _0x499984[_0x6f19('0x32')]===_0x6f19('0x33')&&typeof _0x499984[_0x6f19('0x34')]===_0x6f19('0x33');var _0x1c3977=_0x30dbfc[_0x6f19('0x35')];var _0x265133=_0x4b3cbf?0x0:_0x499984['offset'];var _0x2060f1=_0x4b3cbf?_0x30dbfc[_0x6f19('0x35')]:_0x499984[_0x6f19('0x32')]+_0x499984['limit'];var _0x21a252;if(_0x2060f1>=_0x1c3977){_0x2060f1=_0x1c3977;_0x21a252=0xc8;}else{_0x21a252=0xce;}_0x2a69c4[_0x6f19('0x2f')](_0x21a252);return _0x2a69c4[_0x6f19('0x36')](_0x6f19('0x37'),_0x265133+'-'+_0x2060f1+'/'+_0x1c3977)[_0x6f19('0x31')](_0x30dbfc);}return null;};}function patchUpdates(_0x163b0d){return function(_0x39a0b2){try{jsonpatch[_0x6f19('0x38')](_0x39a0b2,_0x163b0d,!![]);}catch(_0x1ef7ac){return BPromise['reject'](_0x1ef7ac);}return _0x39a0b2['save']();};}function saveUpdates(_0x165a97,_0x1e7087){return function(_0x2ff198){if(_0x2ff198){return _0x2ff198[_0x6f19('0x39')](_0x165a97)[_0x6f19('0x3a')](function(_0x46117b){return _0x46117b;});}return null;};}function removeEntity(_0x51e16f,_0x1eda57){return function(_0x326ab3){if(_0x326ab3){return _0x326ab3[_0x6f19('0x3b')]()[_0x6f19('0x3a')](function(){_0x51e16f[_0x6f19('0x2f')](0xcc)[_0x6f19('0x30')]();});}};}function handleEntityNotFound(_0x5e60e9,_0x2597e1){return function(_0x821c3a){if(!_0x821c3a){_0x5e60e9[_0x6f19('0x2e')](0x194);}return _0x821c3a;};}function handleError(_0x513288,_0x30f459){_0x30f459=_0x30f459||0x1f4;return function(_0x5ea8dc){logger[_0x6f19('0x2a')](_0x5ea8dc['stack']);if(_0x5ea8dc[_0x6f19('0x3c')]){delete _0x5ea8dc['name'];}_0x513288[_0x6f19('0x2f')](_0x30f459)[_0x6f19('0x3d')](_0x5ea8dc);};}exports[_0x6f19('0x3e')]=function(_0x32e4cb,_0x4079c9){var _0x57a9f5={},_0x43671f={},_0x261de1={'count':0x0,'rows':[]};var _0x17ed08=_[_0x6f19('0x3f')](db[_0x6f19('0x40')]['rawAttributes'],function(_0x1a2ccb){return{'name':_0x1a2ccb[_0x6f19('0x41')],'type':_0x1a2ccb[_0x6f19('0x42')]['key']};});_0x43671f[_0x6f19('0x43')]=_[_0x6f19('0x3f')](_0x17ed08,_0x6f19('0x3c'));_0x43671f[_0x6f19('0x44')]=_[_0x6f19('0x45')](_0x32e4cb[_0x6f19('0x44')]);_0x43671f[_0x6f19('0x46')]=_[_0x6f19('0x47')](_0x43671f[_0x6f19('0x43')],_0x43671f[_0x6f19('0x44')]);_0x57a9f5['attributes']=_[_0x6f19('0x47')](_0x43671f[_0x6f19('0x43')],qs['fields'](_0x32e4cb['query'][_0x6f19('0x48')]));_0x57a9f5[_0x6f19('0x49')]=_0x57a9f5[_0x6f19('0x49')][_0x6f19('0x4a')]?_0x57a9f5['attributes']:_0x43671f[_0x6f19('0x43')];if(!_0x32e4cb[_0x6f19('0x44')][_0x6f19('0x4b')](_0x6f19('0x4c'))){_0x57a9f5[_0x6f19('0x34')]=qs[_0x6f19('0x34')](_0x32e4cb[_0x6f19('0x44')][_0x6f19('0x34')]);_0x57a9f5[_0x6f19('0x32')]=qs[_0x6f19('0x32')](_0x32e4cb[_0x6f19('0x44')][_0x6f19('0x32')]);}_0x57a9f5[_0x6f19('0x4d')]=qs['sort'](_0x32e4cb[_0x6f19('0x44')][_0x6f19('0x4e')]);_0x57a9f5[_0x6f19('0x4f')]=qs[_0x6f19('0x46')](_['pick'](_0x32e4cb[_0x6f19('0x44')],_0x43671f['filters']),_0x17ed08);if(_0x32e4cb['query'][_0x6f19('0x50')]){_0x57a9f5[_0x6f19('0x4f')]=_['merge'](_0x57a9f5[_0x6f19('0x4f')],{'$or':_['map'](_0x17ed08,function(_0x970850){if(_0x970850['type']!==_0x6f19('0x51')){var _0x5d7444={};_0x5d7444[_0x970850[_0x6f19('0x3c')]]={'$like':'%'+_0x32e4cb['query'][_0x6f19('0x50')]+'%'};return _0x5d7444;}})});}_0x57a9f5=_['merge']({},_0x57a9f5,_0x32e4cb['options']);var _0x471323={'where':_0x57a9f5[_0x6f19('0x4f')]};return db[_0x6f19('0x40')][_0x6f19('0x35')](_0x471323)[_0x6f19('0x3a')](function(_0x332250){_0x261de1[_0x6f19('0x35')]=_0x332250;if(_0x32e4cb['query'][_0x6f19('0x52')]){_0x57a9f5[_0x6f19('0x53')]=[{'all':!![]}];}return db[_0x6f19('0x40')]['findAll'](_0x57a9f5);})[_0x6f19('0x3a')](function(_0x3ae52b){_0x261de1[_0x6f19('0x54')]=_0x3ae52b;return _0x261de1;})[_0x6f19('0x3a')](respondWithFilteredResult(_0x4079c9,_0x57a9f5))[_0x6f19('0x55')](handleError(_0x4079c9,null));};exports[_0x6f19('0x56')]=function(_0x54c2e1,_0x5b0168){var _0x453266={'raw':!![],'where':{'id':_0x54c2e1['params']['id']}},_0x50252e={};_0x50252e[_0x6f19('0x43')]=_[_0x6f19('0x45')](db['FaxMessage']['rawAttributes']);_0x50252e[_0x6f19('0x44')]=_[_0x6f19('0x45')](_0x54c2e1[_0x6f19('0x44')]);_0x50252e[_0x6f19('0x46')]=_[_0x6f19('0x47')](_0x50252e[_0x6f19('0x43')],_0x50252e[_0x6f19('0x44')]);_0x453266['attributes']=_[_0x6f19('0x47')](_0x50252e['model'],qs[_0x6f19('0x48')](_0x54c2e1['query']['fields']));_0x453266['attributes']=_0x453266['attributes']['length']?_0x453266[_0x6f19('0x49')]:_0x50252e[_0x6f19('0x43')];if(_0x54c2e1[_0x6f19('0x44')][_0x6f19('0x52')]){_0x453266[_0x6f19('0x53')]=[{'all':!![]}];}_0x453266=_[_0x6f19('0x57')]({},_0x453266,_0x54c2e1[_0x6f19('0x58')]);return db[_0x6f19('0x40')]['find'](_0x453266)[_0x6f19('0x3a')](handleEntityNotFound(_0x5b0168,null))['then'](respondWithResult(_0x5b0168,null))['catch'](handleError(_0x5b0168,null));};exports[_0x6f19('0x39')]=function(_0x5b86a6,_0x511c66){if(_0x5b86a6['body']['id']){delete _0x5b86a6['body']['id'];}return db[_0x6f19('0x40')][_0x6f19('0x59')]({'where':{'id':_0x5b86a6[_0x6f19('0x5a')]['id']}})['then'](handleEntityNotFound(_0x511c66,null))[_0x6f19('0x3a')](saveUpdates(_0x5b86a6['body'],null))[_0x6f19('0x3a')](respondWithResult(_0x511c66,null))[_0x6f19('0x55')](handleError(_0x511c66,null));};exports[_0x6f19('0x3b')]=function(_0x3e165f,_0xdd26e5){return db[_0x6f19('0x40')]['find']({'where':{'id':_0x3e165f[_0x6f19('0x5a')]['id']}})[_0x6f19('0x3a')](handleEntityNotFound(_0xdd26e5,null))[_0x6f19('0x3a')](removeEntity(_0xdd26e5,null))[_0x6f19('0x55')](handleError(_0xdd26e5,null));};exports[_0x6f19('0x5b')]=function(_0xb5a2e7,_0x934cb2){return db[_0x6f19('0x40')][_0x6f19('0x5b')]()[_0x6f19('0x3a')](respondWithResult(_0x934cb2,null))[_0x6f19('0x55')](handleError(_0x934cb2,null));};var interaction_log=require(_0x6f19('0x18'))(_0x6f19('0x5c'));exports['accept']=function(_0x28c947,_0xfae6db,_0x34dc0e){var _0x3ae511={'agent':{},'channel':_0x6f19('0x5d')};if(_0x28c947['body']['id']){delete _0x28c947[_0x6f19('0x5e')]['id'];}_0x28c947['body'][_0x6f19('0x5f')]=!![];_0x28c947[_0x6f19('0x5e')][_0x6f19('0x60')]=moment()['format'](_0x6f19('0x61'));_0x28c947[_0x6f19('0x5e')][_0x6f19('0x62')]=_0x28c947[_0x6f19('0x5e')][_0x6f19('0x62')]||_0x28c947[_0x6f19('0x63')]['id'];_0x3ae511['agent']['id']=_0x28c947['body'][_0x6f19('0x62')];return db['FaxMessage']['find']({'where':{'id':_0x28c947[_0x6f19('0x5a')]['id'],'UserId':null}})[_0x6f19('0x3a')](handleEntityNotFound(_0xfae6db,null))[_0x6f19('0x3a')](saveUpdates(_0x28c947[_0x6f19('0x5e')],null))[_0x6f19('0x3a')](function(_0x3f5506){if(_0x3f5506){_0x3ae511[_0x6f19('0x2c')]=_0x3f5506[_0x6f19('0x64')]({'plain':!![]});return db[_0x6f19('0x65')][_0x6f19('0x59')]({'where':{'id':_0x3f5506[_0x6f19('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xfae6db,null))[_0x6f19('0x3a')](function(_0x234f91){if(_0x234f91){return _0x234f91[_0x6f19('0x39')]({'UserId':_0x28c947[_0x6f19('0x5e')][_0x6f19('0x62')],'read1stAt':_[_0x6f19('0x67')](_0x234f91[_0x6f19('0x68')])?moment()[_0x6f19('0x69')](_0x6f19('0x61')):undefined});}return null;})[_0x6f19('0x3a')](function(_0x4136f1){if(_0x4136f1){_0x3ae511[_0x6f19('0x6a')]=_0x4136f1[_0x6f19('0x64')]({'plain':!![]});interaction_log[_0x6f19('0x25')](_0x6f19('0x6b'),_0x28c947[_0x6f19('0x63')]['id'],_0x28c947[_0x6f19('0x63')]['name'],_0x28c947[_0x6f19('0x63')][_0x6f19('0x6c')],_0x3ae511[_0x6f19('0x6a')]['id'],_0x28c947[_0x6f19('0x5e')]?JSON[_0x6f19('0x29')](_0x28c947[_0x6f19('0x5e')]):'null');return respondWithRpcPromise(_0x6f19('0x6d'),_0x6f19('0x6e'),_0x3ae511);}return null;})[_0x6f19('0x3a')](function(_0x35c200){var _0x1e813d=_0x6f19('0x6f')+_0x35c200[_0x6f19('0x2c')][_0x6f19('0x70')];return db[_0x6f19('0x71')]['query'](_0x1e813d,{'type':db[_0x6f19('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x6f19('0x3a')](function(_0xb5a0c0){return _0xb5a0c0;});})[_0x6f19('0x3a')](function(_0xbdb7b){if(_0xbdb7b){_0x3ae511[_0x6f19('0x2c')][_0x6f19('0x73')]=_0xbdb7b[0x0];if(!_0x28c947[_0x6f19('0x5e')]['UserId'])return;return db['User']['find']({'where':{'id':_0x28c947[_0x6f19('0x5e')][_0x6f19('0x62')],'role':'agent'},'attributes':['id',_0x6f19('0x3c'),_0x6f19('0x74'),_0x6f19('0x75'),_0x6f19('0x76')],'raw':!![]});}return null;})[_0x6f19('0x3a')](function(_0x2b2449){if(!_0x2b2449)return null;_0x3ae511[_0x6f19('0x2c')]['agent']=_0x2b2449;return _0x3ae511;})[_0x6f19('0x3a')](function(_0x4febcb){if(_0x4febcb){if(_0x28c947[_0x6f19('0x5e')][_0x6f19('0x77')]){_0x3ae511['message'][_0x6f19('0x78')]=util[_0x6f19('0x69')](_0x6f19('0x79'),_0x28c947[_0x6f19('0x63')][_0x6f19('0x3c')]);_0x3ae511['message'][_0x6f19('0x7a')]=_0x3ae511['channel'];_0x3ae511['message']['motionChannel']=_0x3ae511['channel'];_0x3ae511[_0x6f19('0x2c')][_0x6f19('0x7b')]='accept';return respondWithRpcPromise(_0x6f19('0x7c'),_0x6f19('0x7c'),{'event':_0x6f19('0x7d'),'message':_0x3ae511[_0x6f19('0x2c')]},client9002)[_0x6f19('0x3a')](function(){return _0x3ae511;});}return _0x3ae511;}return null;})['then'](respondWithResult(_0xfae6db,null))['catch'](handleError(_0xfae6db,null));};var interaction_log=require(_0x6f19('0x18'))('fax-interactions');exports[_0x6f19('0x7e')]=function(_0x2fa33c,_0x4f2bf6,_0x5c59de){var _0x21fae8={'agent':{},'channel':_0x6f19('0x5d')};if(_0x2fa33c[_0x6f19('0x5e')]['id']){delete _0x2fa33c[_0x6f19('0x5e')]['id'];}_0x2fa33c[_0x6f19('0x5e')][_0x6f19('0x62')]=_0x2fa33c[_0x6f19('0x5e')][_0x6f19('0x62')]||_0x2fa33c[_0x6f19('0x63')]['id'];_0x21fae8[_0x6f19('0x7f')]['id']=_0x2fa33c[_0x6f19('0x5e')][_0x6f19('0x62')];return db[_0x6f19('0x40')][_0x6f19('0x59')]({'where':{'id':_0x2fa33c[_0x6f19('0x5a')]['id'],'UserId':null}})[_0x6f19('0x3a')](handleEntityNotFound(_0x4f2bf6,null))['then'](function(_0x49902b){if(_0x49902b){_0x21fae8[_0x6f19('0x2c')]=_0x49902b[_0x6f19('0x64')]({'plain':!![]});return db[_0x6f19('0x65')][_0x6f19('0x59')]({'where':{'id':_0x49902b[_0x6f19('0x66')]}});}return null;})[_0x6f19('0x3a')](handleEntityNotFound(_0x4f2bf6,null))['then'](function(_0x20210c){if(_0x20210c){_0x21fae8[_0x6f19('0x6a')]=_0x20210c['get']({'plain':!![]});interaction_log[_0x6f19('0x25')](_0x6f19('0x80'),_0x2fa33c[_0x6f19('0x63')]['id'],_0x2fa33c['user'][_0x6f19('0x3c')],_0x2fa33c[_0x6f19('0x63')][_0x6f19('0x6c')],_0x21fae8[_0x6f19('0x6a')]['id'],_0x2fa33c[_0x6f19('0x5e')]?JSON[_0x6f19('0x29')](_0x2fa33c[_0x6f19('0x5e')]):_0x6f19('0x81'));return respondWithRpcPromise(_0x6f19('0x82'),_0x6f19('0x83'),_0x21fae8);}return null;})[_0x6f19('0x3a')](function(_0x346893){var _0x102fe4=_0x6f19('0x6f')+_0x346893[_0x6f19('0x2c')][_0x6f19('0x70')];return db[_0x6f19('0x71')][_0x6f19('0x44')](_0x102fe4,{'type':db[_0x6f19('0x72')][_0x6f19('0x84')][_0x6f19('0x85')],'raw':!![]})[_0x6f19('0x3a')](function(_0x4b8699){return _0x4b8699;});})[_0x6f19('0x3a')](function(_0x180674){if(_0x180674){_0x21fae8[_0x6f19('0x2c')][_0x6f19('0x73')]=_0x180674[0x0];if(!_0x2fa33c[_0x6f19('0x5e')][_0x6f19('0x62')])return;return db[_0x6f19('0x86')][_0x6f19('0x59')]({'where':{'id':_0x2fa33c[_0x6f19('0x5e')][_0x6f19('0x62')],'role':_0x6f19('0x7f')},'attributes':['id',_0x6f19('0x3c'),_0x6f19('0x74'),'email',_0x6f19('0x76')],'raw':!![]});}return null;})[_0x6f19('0x3a')](function(_0xddba10){if(!_0xddba10)return null;_0x21fae8[_0x6f19('0x2c')]['agent']=_0xddba10;return _0x21fae8;})[_0x6f19('0x3a')](function(_0x84e3a){if(_0x84e3a){_0x84e3a['message'][_0x6f19('0x78')]=util['format'](_0x6f19('0x79'),_0x2fa33c['user'][_0x6f19('0x3c')]);_0x84e3a[_0x6f19('0x2c')][_0x6f19('0x7a')]=_0x21fae8[_0x6f19('0x7a')];_0x84e3a['message']['motionChannel']=_0x21fae8[_0x6f19('0x7a')];_0x84e3a[_0x6f19('0x2c')][_0x6f19('0x7b')]=_0x6f19('0x7e');respondWithRpcPromise('EventManager','EventManager',{'event':_0x6f19('0x87'),'message':_0x84e3a[_0x6f19('0x2c')]},client9002);return _0x21fae8;}return null;})[_0x6f19('0x3a')](respondWithResult(_0x4f2bf6,null))['catch'](handleError(_0x4f2bf6,null));};exports['create']=function(_0x56bc7d,_0x513a97){var _0x2eb3fc;return db['FaxMessage'][_0x6f19('0x88')](_0x56bc7d[_0x6f19('0x5e')],{})[_0x6f19('0x3a')](function(_0x282f09){_0x2eb3fc=_0x282f09;return db['CmContact'][_0x6f19('0x89')]({'where':{'id':_0x2eb3fc[_0x6f19('0x70')]}});})[_0x6f19('0x3a')](function(_0x53308a){if(_['isNil'](_0x53308a)){return;}else{_0x2eb3fc[_0x6f19('0x5d')]=_0x53308a[_0x6f19('0x5d')];return db[_0x6f19('0x8a')][_0x6f19('0x89')]({'where':{'id':_0x2eb3fc['AttachmentId']}});}})[_0x6f19('0x3a')](function(_0xe4fd8d){return respondWithRpcPromise(_0x6f19('0x8b'),_0x6f19('0x8b'),{'FaxAccountId':_[_0x6f19('0x67')](_0x56bc7d[_0x6f19('0x5e')])?undefined:_0x56bc7d[_0x6f19('0x5e')][_0x6f19('0x8c')],'path':_['isNil'](_0xe4fd8d)?undefined:util['format'](_0x6f19('0x8d'),_0xe4fd8d[_0x6f19('0x8e')]),'fax':_[_0x6f19('0x67')](_0x2eb3fc[_0x6f19('0x5d')])?undefined:_0x2eb3fc[_0x6f19('0x5d')],'AttachmentId':_0x2eb3fc[_0x6f19('0x8f')]},client9002);})['then'](respondWithResult(_0x513a97,0xc9))[_0x6f19('0x55')](handleError(_0x513a97,null));};exports[_0x6f19('0x90')]=function(_0x374498,_0x2ec4d0){var _0x3a1eff=path[_0x6f19('0x91')](config[_0x6f19('0x92')],'server','files',_0x6f19('0x93'));return db['FaxMessage'][_0x6f19('0x59')]({'where':{'id':_0x374498[_0x6f19('0x5a')]['id']},'include':[{'model':db[_0x6f19('0x8a')],'as':_0x6f19('0x8a')}]})['then'](handleEntityNotFound(_0x2ec4d0,null))[_0x6f19('0x3a')](function(_0x46910a){if(_0x46910a){return _0x2ec4d0[_0x6f19('0x90')](path['join'](_0x3a1eff,_0x46910a[_0x6f19('0x8a')][_0x6f19('0x8e')]));}})['catch'](handleError(_0x2ec4d0,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 45e5804..0dad837 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 _0x199c=['remove','emit','exports','FaxMessage','setMaxListeners','save','update'];(function(_0x3edb26,_0x9613b4){var _0x4ad9f5=function(_0x5cb828){while(--_0x5cb828){_0x3edb26['push'](_0x3edb26['shift']());}};_0x4ad9f5(++_0x9613b4);}(_0x199c,0x1d8));var _0xc199=function(_0x36412e,_0x3351c1){_0x36412e=_0x36412e-0x0;var _0x1c8f1e=_0x199c[_0x36412e];return _0x1c8f1e;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0xc199('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc199('0x1')](0x0);var events={'afterCreate':_0xc199('0x2'),'afterUpdate':_0xc199('0x3'),'afterDestroy':_0xc199('0x4')};function emitEvent(_0x2f63ce){return function(_0x3f06cc,_0x1eecc2,_0x4b4a7b){FaxMessageEvents[_0xc199('0x5')](_0x2f63ce+':'+_0x3f06cc['id'],_0x3f06cc);FaxMessageEvents[_0xc199('0x5')](_0x2f63ce,_0x3f06cc);_0x4b4a7b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xc199('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x720b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update'];(function(_0x57b4dc,_0x3fbf56){var _0x19a18a=function(_0x31b596){while(--_0x31b596){_0x57b4dc['push'](_0x57b4dc['shift']());}};_0x19a18a(++_0x3fbf56);}(_0x720b,0x1d8));var _0xb720=function(_0xa50d4a,_0x7776cb){_0xa50d4a=_0xa50d4a-0x0;var _0x3498a8=_0x720b[_0xa50d4a];return _0x3498a8;};'use strict';var EventEmitter=require(_0xb720('0x0'));var FaxMessage=require(_0xb720('0x1'))['db'][_0xb720('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb720('0x3'),'afterUpdate':_0xb720('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f7ac1){return function(_0x3f8acb,_0x33f308,_0x4ddff9){FaxMessageEvents[_0xb720('0x5')](_0x2f7ac1+':'+_0x3f8acb['id'],_0x3f8acb);FaxMessageEvents[_0xb720('0x5')](_0x2f7ac1,_0x3f8acb);_0x4ddff9(null);};}for(var e in events){if(events[_0xb720('0x6')](e)){var event=events[e];FaxMessage[_0xb720('0x7')](e,emitEvent(event));}}module[_0xb720('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3de87a8..10cb3f5 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 _0x5949=['get','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','FaxMessage','fax_messages','fti_fax_messages','body','models'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0x5949,0xa5));var _0x9594=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x5949[_0x296897];return _0x2b44ab;};'use strict';var _=require(_0x9594('0x0'));var util=require(_0x9594('0x1'));var logger=require(_0x9594('0x2'))(_0x9594('0x3'));var moment=require(_0x9594('0x4'));var BPromise=require(_0x9594('0x5'));var rp=require(_0x9594('0x6'));var fs=require('fs');var path=require(_0x9594('0x7'));var rimraf=require(_0x9594('0x8'));var config=require(_0x9594('0x9'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x250f7f,_0x151a04){return _0x250f7f['define'](_0x9594('0xa'),attributes,{'tableName':_0x9594('0xb'),'paranoid':![],'indexes':[{'name':_0x9594('0xc'),'fields':[_0x9594('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36fea2,_0x4aeec8,_0x1abcad){var _0x5eafe3=_0x250f7f[_0x9594('0xe')];var _0x5af2e2=_0x36fea2[_0x9594('0xf')]({'plain':!![]});if(_0x5af2e2['direction'][_0x9594('0x10')]()==='in'||_0x5af2e2['direction'][_0x9594('0x10')]()==='out'&&!_0x5af2e2[_0x9594('0x11')]&&!_[_0x9594('0x12')](_0x5af2e2[_0x9594('0x13')])){_0x5eafe3[_0x9594('0x14')][_0x9594('0x15')]({'where':{'id':_0x5af2e2[_0x9594('0x16')]}})[_0x9594('0x17')](function(_0x207fe8){if(_0x207fe8){_0x207fe8[_0x9594('0x18')]({'lastMsgAt':_0x5af2e2[_0x9594('0x19')],'lastMsgDirection':_0x5af2e2['direction'][_0x9594('0x10')]()});}})[_0x9594('0x1a')](function(_0x504275){console[_0x9594('0x1b')](_0x504275);});}_0x1abcad();}},'charset':_0x9594('0x1c'),'collate':_0x9594('0x1d')});}; \ No newline at end of file +var _0xa920=['direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0xa920,0x151));var _0x0a92=function(_0x910745,_0x3a7a69){_0x910745=_0x910745-0x0;var _0x459fbd=_0xa920[_0x910745];return _0x459fbd;};'use strict';var _=require(_0x0a92('0x0'));var util=require('util');var logger=require(_0x0a92('0x1'))('api');var moment=require(_0x0a92('0x2'));var BPromise=require(_0x0a92('0x3'));var rp=require(_0x0a92('0x4'));var fs=require('fs');var path=require(_0x0a92('0x5'));var rimraf=require(_0x0a92('0x6'));var config=require(_0x0a92('0x7'));var attributes=require(_0x0a92('0x8'));module['exports']=function(_0x1193ec,_0x13fb40){return _0x1193ec['define'](_0x0a92('0x9'),attributes,{'tableName':_0x0a92('0xa'),'paranoid':![],'indexes':[{'name':_0x0a92('0xb'),'fields':['body'],'type':_0x0a92('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38312f,_0x368119,_0x4a8a51){var _0x420232=_0x1193ec[_0x0a92('0xd')];var _0x2390b9=_0x38312f['get']({'plain':!![]});if(_0x2390b9[_0x0a92('0xe')][_0x0a92('0xf')]()==='in'||_0x2390b9['direction'][_0x0a92('0xf')]()===_0x0a92('0x10')&&!_0x2390b9[_0x0a92('0x11')]&&!_['isNil'](_0x2390b9[_0x0a92('0x12')])){_0x420232[_0x0a92('0x13')][_0x0a92('0x14')]({'where':{'id':_0x2390b9[_0x0a92('0x15')]}})['then'](function(_0x33e8b2){if(_0x33e8b2){_0x33e8b2['update']({'lastMsgAt':_0x2390b9[_0x0a92('0x16')],'lastMsgDirection':_0x2390b9[_0x0a92('0xe')][_0x0a92('0xf')]()});}})[_0x0a92('0x17')](function(_0x53f686){console[_0x0a92('0x18')](_0x53f686);});}_0x4a8a51();}},'charset':_0x0a92('0x19'),'collate':_0x0a92('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 64a3c44..ff17388 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 _0x2d17=['create','catch','UpdateFaxMessage','FaxMessage','body','options','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage'];(function(_0x28dfd6,_0x42a114){var _0x29e399=function(_0x158a1c){while(--_0x158a1c){_0x28dfd6['push'](_0x28dfd6['shift']());}};_0x29e399(++_0x42a114);}(_0x2d17,0x17e));var _0x72d1=function(_0x38daff,_0x2b66e9){_0x38daff=_0x38daff-0x0;var _0x1db60f=_0x2d17[_0x38daff];return _0x1db60f;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('FaxMessage,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}exports[_0x72d1('0x19')]=function(_0x1865c1){var _0x8d6890=this;return new Promise(function(_0x2253fd,_0x1e2411){return db['FaxMessage'][_0x72d1('0x1a')](_0x1865c1['body'],{'raw':_0x1865c1['options']?_0x1865c1['options']['raw']===undefined?!![]:![]:!![]})[_0x72d1('0xf')](function(_0x374602){logger['info'](_0x72d1('0x19'),_0x1865c1);logger[_0x72d1('0x13')](_0x72d1('0x19'),_0x1865c1,JSON[_0x72d1('0x14')](_0x374602));_0x2253fd(_0x374602);})[_0x72d1('0x1b')](function(_0x4e6acd){logger['error'](_0x72d1('0x19'),_0x4e6acd[_0x72d1('0x17')],_0x1865c1);_0x1e2411(_0x8d6890[_0x72d1('0x15')](0x1f4,_0x4e6acd[_0x72d1('0x17')]));});});};exports[_0x72d1('0x1c')]=function(_0x33d530){var _0x163bec=this;return new Promise(function(_0x589f7c,_0x57ec9e){return db[_0x72d1('0x1d')]['update'](_0x33d530[_0x72d1('0x1e')],{'raw':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d530[_0x72d1('0x1f')]?_0x33d530['options'][_0x72d1('0x20')]||null:null,'attributes':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')][_0x72d1('0x21')]||null:null,'limit':_0x33d530['options']?_0x33d530[_0x72d1('0x1f')]['limit']||null:null})[_0x72d1('0xf')](function(_0x32dc5e){logger['info'](_0x72d1('0x1c'),_0x33d530);logger[_0x72d1('0x13')](_0x72d1('0x1c'),_0x33d530,JSON[_0x72d1('0x14')](_0x32dc5e));_0x589f7c(_0x32dc5e);})[_0x72d1('0x1b')](function(_0x52511f){logger[_0x72d1('0x15')](_0x72d1('0x1c'),_0x52511f[_0x72d1('0x17')],_0x33d530);_0x57ec9e(_0x163bec['error'](0x1f4,_0x52511f[_0x72d1('0x17')]));});});}; \ No newline at end of file +var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x176b51,_0x1f7f28){var _0x113abc=function(_0x32887c){while(--_0x32887c){_0x176b51['push'](_0x176b51['shift']());}};_0x113abc(++_0x1f7f28);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0xeec6[_0x2de020];return _0x182b7c;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 20fbb48..2849c9c 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 _0x0843=['./faxMessage.events','save','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0843,0xee));var _0x3084=function(_0x2df6ef,_0x2e1625){_0x2df6ef=_0x2df6ef-0x0;var _0x2ca16b=_0x0843[_0x2df6ef];return _0x2ca16b;};'use strict';var FaxMessageEvents=require(_0x3084('0x0'));var events=[_0x3084('0x1'),'remove',_0x3084('0x2')];function createListener(_0x543809,_0x23388e){return function(_0x25c051){_0x23388e[_0x3084('0x3')](_0x543809,_0x25c051);};}function removeListener(_0x21d85d,_0x353718){return function(){FaxMessageEvents[_0x3084('0x4')](_0x21d85d,_0x353718);};}exports[_0x3084('0x5')]=function(_0x175f05){for(var _0x7f207f=0x0,_0x2a053c=events[_0x3084('0x6')];_0x7f207f<_0x2a053c;_0x7f207f++){var _0x4267e3=events[_0x7f207f];var _0x3f1174=createListener('faxMessage:'+_0x4267e3,_0x175f05);FaxMessageEvents['on'](_0x4267e3,_0x3f1174);}}; \ No newline at end of file +var _0x88c9=['./faxMessage.events','save','remove','update','emit','removeListener','faxMessage:'];(function(_0x46d7bb,_0x3ec5fa){var _0x268d0e=function(_0x5ad191){while(--_0x5ad191){_0x46d7bb['push'](_0x46d7bb['shift']());}};_0x268d0e(++_0x3ec5fa);}(_0x88c9,0x1dc));var _0x988c=function(_0x1154d3,_0x4c24c9){_0x1154d3=_0x1154d3-0x0;var _0x3a28bc=_0x88c9[_0x1154d3];return _0x3a28bc;};'use strict';var FaxMessageEvents=require(_0x988c('0x0'));var events=[_0x988c('0x1'),_0x988c('0x2'),_0x988c('0x3')];function createListener(_0x2724d3,_0x40408e){return function(_0x2547c9){_0x40408e[_0x988c('0x4')](_0x2724d3,_0x2547c9);};}function removeListener(_0x35d07c,_0x5e5951){return function(){FaxMessageEvents[_0x988c('0x5')](_0x35d07c,_0x5e5951);};}exports['register']=function(_0x434b27){for(var _0x2233b9=0x0,_0x385c66=events['length'];_0x2233b9<_0x385c66;_0x2233b9++){var _0x4a5c25=events[_0x2233b9];var _0xe55e41=createListener(_0x988c('0x6')+_0x4a5c25,_0x434b27);FaxMessageEvents['on'](_0x4a5c25,_0xe55e41);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 5b1c835..ce202b9 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(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x91a7,0xe7));var _0x791a=function(_0x5716d5,_0x5150e1){_0x5716d5=_0x5716d5-0x0;var _0x635f6f=_0x91a7[_0x5716d5];return _0x635f6f;};'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 _0x2f68=['/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x2f68,0x9a));var _0x82f6=function(_0x10947b,_0x57f639){_0x10947b=_0x10947b-0x0;var _0x51843b=_0x2f68[_0x10947b];return _0x51843b;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./faxMessage.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),interaction[_0x82f6('0xe')](_0x82f6('0xf'),_0x82f6('0x10')),controller['create']);router[_0x82f6('0x11')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x11')](_0x82f6('0x13'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x11')](_0x82f6('0x15'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x16')]);router['delete'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x17')]);module[_0x82f6('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0e63f74..a809430 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 _0x0648=['INTEGER','STRING','name','ENUM','beepall','roundrobin'];(function(_0x1d136c,_0x5ccd0f){var _0xb145ed=function(_0x3c6d43){while(--_0x3c6d43){_0x1d136c['push'](_0x1d136c['shift']());}};_0xb145ed(++_0x5ccd0f);}(_0x0648,0x1a5));var _0x8064=function(_0x4c7634,_0x59ef89){_0x4c7634=_0x4c7634-0x0;var _0xcb7699=_0x0648[_0x4c7634];return _0xcb7699;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8064('0x0')],'unique':_0x8064('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8064('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8064('0x2')]('rrmemory',_0x8064('0x3'),_0x8064('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8064('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe76b=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x139565,_0x3c39f8){var _0x3c3ef3=function(_0x3de62c){while(--_0x3de62c){_0x139565['push'](_0x139565['shift']());}};_0x3c3ef3(++_0x3c39f8);}(_0xe76b,0x72));var _0xbe76=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0xe76b[_0xed5f9c];return _0x3a1c43;};'use strict';var Sequelize=require('sequelize');module[_0xbe76('0x0')]={'name':{'type':Sequelize[_0xbe76('0x1')],'unique':_0xbe76('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbe76('0x1')]},'timeout':{'type':Sequelize[_0xbe76('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe76('0x4')]('rrmemory',_0xbe76('0x5'),_0xbe76('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbe76('0x3')],'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 3b6ca6a..dec0e55 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 _0xeb46=['getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','SIP','getTeams','length','addTeams','online','interface','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','Team','Agents','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','stack','name','send','index','map','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxQueue','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xeb46,0xba));var _0x6eb4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb46[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6eb4('0x0'));var rimraf=require(_0x6eb4('0x1'));var zipdir=require(_0x6eb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6eb4('0x3'));var moment=require(_0x6eb4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6eb4('0x5'));var util=require(_0x6eb4('0x6'));var path=require('path');var sox=require(_0x6eb4('0x7'));var csv=require(_0x6eb4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6eb4('0x9'));var crypto=require(_0x6eb4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6eb4('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6eb4('0xc'));var Papa=require(_0x6eb4('0xd'));var Redis=require(_0x6eb4('0xe'));var authService=require(_0x6eb4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6eb4('0x10'));var hardwareService=require(_0x6eb4('0x11'));var logger=require(_0x6eb4('0x12'))(_0x6eb4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6eb4('0x14'));var db=require(_0x6eb4('0x15'))['db'];config[_0x6eb4('0x16')]=_[_0x6eb4('0x17')](config[_0x6eb4('0x16')],{'host':_0x6eb4('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6eb4('0x16')]));require(_0x6eb4('0x19'))[_0x6eb4('0x1a')](socket);function respondWithStatusCode(_0x3d4721,_0x2a9743){_0x2a9743=_0x2a9743||0xcc;return function(_0x573283){if(_0x573283){return _0x3d4721[_0x6eb4('0x1b')](_0x2a9743);}return _0x3d4721[_0x6eb4('0x1c')](_0x2a9743)[_0x6eb4('0x1d')]();};}function respondWithResult(_0x5d2660,_0x350656){_0x350656=_0x350656||0xc8;return function(_0x1bd596){if(_0x1bd596){return _0x5d2660['status'](_0x350656)[_0x6eb4('0x1e')](_0x1bd596);}};}function respondWithFilteredResult(_0xee0e4f,_0x3dd907){return function(_0x40363b){if(_0x40363b){var _0x49a382=typeof _0x3dd907[_0x6eb4('0x1f')]===_0x6eb4('0x20')&&typeof _0x3dd907[_0x6eb4('0x21')]===_0x6eb4('0x20');var _0x555401=_0x40363b[_0x6eb4('0x22')];var _0x48064a=_0x49a382?0x0:_0x3dd907[_0x6eb4('0x1f')];var _0x414806=_0x49a382?_0x40363b[_0x6eb4('0x22')]:_0x3dd907[_0x6eb4('0x1f')]+_0x3dd907[_0x6eb4('0x21')];var _0x5502ed;if(_0x414806>=_0x555401){_0x414806=_0x555401;_0x5502ed=0xc8;}else{_0x5502ed=0xce;}_0xee0e4f[_0x6eb4('0x1c')](_0x5502ed);return _0xee0e4f['set'](_0x6eb4('0x23'),_0x48064a+'-'+_0x414806+'/'+_0x555401)[_0x6eb4('0x1e')](_0x40363b);}return null;};}function patchUpdates(_0x2ebd57){return function(_0x2d08fe){try{jsonpatch[_0x6eb4('0x24')](_0x2d08fe,_0x2ebd57,!![]);}catch(_0x2fb121){return BPromise[_0x6eb4('0x25')](_0x2fb121);}return _0x2d08fe[_0x6eb4('0x26')]();};}function saveUpdates(_0x668918,_0x401f2a){return function(_0x4357ad){if(_0x4357ad){return _0x4357ad[_0x6eb4('0x27')](_0x668918)[_0x6eb4('0x28')](function(_0x242f3a){return _0x242f3a;});}return null;};}function removeEntity(_0x179250,_0x1e1e95){return function(_0x5a4c38){if(_0x5a4c38){return _0x5a4c38['destroy']()['then'](function(){var _0x56436d=_0x5a4c38[_0x6eb4('0x29')]({'plain':!![]});var _0x30391c=_0x6eb4('0x2a');return db[_0x6eb4('0x2b')][_0x6eb4('0x2c')]({'where':{'type':_0x30391c,'resourceId':_0x56436d['id']}})['then'](function(){return _0x5a4c38;});})[_0x6eb4('0x28')](function(){_0x179250[_0x6eb4('0x1c')](0xcc)[_0x6eb4('0x1d')]();});}};}function handleEntityNotFound(_0x16eff4,_0x66a1fa){return function(_0x45ee44){if(!_0x45ee44){_0x16eff4[_0x6eb4('0x1b')](0x194);}return _0x45ee44;};}function handleError(_0x4e29d6,_0x22125c){_0x22125c=_0x22125c||0x1f4;return function(_0x4cca27){logger['error'](_0x4cca27[_0x6eb4('0x2d')]);if(_0x4cca27[_0x6eb4('0x2e')]){delete _0x4cca27[_0x6eb4('0x2e')];}_0x4e29d6[_0x6eb4('0x1c')](_0x22125c)[_0x6eb4('0x2f')](_0x4cca27);};}exports[_0x6eb4('0x30')]=function(_0x12f37d,_0x41e8d2){var _0x4b3d5e={},_0x551896={},_0x351bf2={'count':0x0,'rows':[]};var _0x466ea7=_[_0x6eb4('0x31')](db['FaxQueue']['rawAttributes'],function(_0x4ef93d){return{'name':_0x4ef93d['fieldName'],'type':_0x4ef93d[_0x6eb4('0x32')]['key']};});_0x551896['model']=_['map'](_0x466ea7,_0x6eb4('0x2e'));_0x551896[_0x6eb4('0x33')]=_[_0x6eb4('0x34')](_0x12f37d[_0x6eb4('0x33')]);_0x551896[_0x6eb4('0x35')]=_['intersection'](_0x551896[_0x6eb4('0x36')],_0x551896['query']);_0x4b3d5e[_0x6eb4('0x37')]=_[_0x6eb4('0x38')](_0x551896[_0x6eb4('0x36')],qs[_0x6eb4('0x39')](_0x12f37d[_0x6eb4('0x33')][_0x6eb4('0x39')]));_0x4b3d5e['attributes']=_0x4b3d5e[_0x6eb4('0x37')]['length']?_0x4b3d5e[_0x6eb4('0x37')]:_0x551896[_0x6eb4('0x36')];if(!_0x12f37d[_0x6eb4('0x33')][_0x6eb4('0x3a')](_0x6eb4('0x3b'))){_0x4b3d5e[_0x6eb4('0x21')]=qs['limit'](_0x12f37d[_0x6eb4('0x33')]['limit']);_0x4b3d5e['offset']=qs[_0x6eb4('0x1f')](_0x12f37d[_0x6eb4('0x33')][_0x6eb4('0x1f')]);}_0x4b3d5e[_0x6eb4('0x3c')]=qs[_0x6eb4('0x3d')](_0x12f37d[_0x6eb4('0x33')][_0x6eb4('0x3d')]);_0x4b3d5e[_0x6eb4('0x3e')]=qs['filters'](_[_0x6eb4('0x3f')](_0x12f37d[_0x6eb4('0x33')],_0x551896['filters']),_0x466ea7);if(_0x12f37d[_0x6eb4('0x33')]['filter']){_0x4b3d5e[_0x6eb4('0x3e')]=_[_0x6eb4('0x40')](_0x4b3d5e[_0x6eb4('0x3e')],{'$or':_[_0x6eb4('0x31')](_0x466ea7,function(_0xb3fbe0){if(_0xb3fbe0[_0x6eb4('0x32')]!==_0x6eb4('0x41')){var _0x4028d0={};_0x4028d0[_0xb3fbe0[_0x6eb4('0x2e')]]={'$like':'%'+_0x12f37d['query'][_0x6eb4('0x42')]+'%'};return _0x4028d0;}})});}_0x4b3d5e=_['merge']({},_0x4b3d5e,_0x12f37d[_0x6eb4('0x43')]);var _0x1b8fee={'where':_0x4b3d5e[_0x6eb4('0x3e')]};return db[_0x6eb4('0x44')][_0x6eb4('0x22')](_0x1b8fee)[_0x6eb4('0x28')](function(_0x5a5641){_0x351bf2[_0x6eb4('0x22')]=_0x5a5641;if(_0x12f37d[_0x6eb4('0x33')][_0x6eb4('0x45')]){_0x4b3d5e['include']=[{'all':!![]}];}return db['FaxQueue'][_0x6eb4('0x46')](_0x4b3d5e);})[_0x6eb4('0x28')](function(_0x718184){_0x351bf2[_0x6eb4('0x47')]=_0x718184;return _0x351bf2;})[_0x6eb4('0x28')](respondWithFilteredResult(_0x41e8d2,_0x4b3d5e))[_0x6eb4('0x48')](handleError(_0x41e8d2,null));};exports['show']=function(_0x5a55d8,_0x327f3f){var _0x435165={'raw':!![],'where':{'id':_0x5a55d8[_0x6eb4('0x49')]['id']}},_0x36ba68={};_0x36ba68[_0x6eb4('0x36')]=_[_0x6eb4('0x34')](db[_0x6eb4('0x44')][_0x6eb4('0x4a')]);_0x36ba68[_0x6eb4('0x33')]=_['keys'](_0x5a55d8[_0x6eb4('0x33')]);_0x36ba68[_0x6eb4('0x35')]=_[_0x6eb4('0x38')](_0x36ba68[_0x6eb4('0x36')],_0x36ba68['query']);_0x435165[_0x6eb4('0x37')]=_[_0x6eb4('0x38')](_0x36ba68[_0x6eb4('0x36')],qs['fields'](_0x5a55d8['query']['fields']));_0x435165[_0x6eb4('0x37')]=_0x435165[_0x6eb4('0x37')]['length']?_0x435165['attributes']:_0x36ba68[_0x6eb4('0x36')];if(_0x5a55d8[_0x6eb4('0x33')][_0x6eb4('0x45')]){_0x435165[_0x6eb4('0x4b')]=[{'all':!![]}];}_0x435165=_['merge']({},_0x435165,_0x5a55d8[_0x6eb4('0x43')]);return db[_0x6eb4('0x44')]['find'](_0x435165)[_0x6eb4('0x28')](handleEntityNotFound(_0x327f3f,null))[_0x6eb4('0x28')](respondWithResult(_0x327f3f,null))[_0x6eb4('0x48')](handleError(_0x327f3f,null));};exports[_0x6eb4('0x4c')]=function(_0x14257,_0x301858){return db[_0x6eb4('0x44')][_0x6eb4('0x4c')](_0x14257[_0x6eb4('0x4d')],{})[_0x6eb4('0x28')](function(_0x3f8eb5){var _0x12d975=_0x14257[_0x6eb4('0x4e')]['get']({'plain':!![]});if(!_0x12d975)throw new Error(_0x6eb4('0x4f'));if(_0x12d975[_0x6eb4('0x50')]===_0x6eb4('0x4e')){var _0x212a48=_0x3f8eb5['get']({'plain':!![]});var _0x48d9bf=_0x6eb4('0x2a');return db[_0x6eb4('0x51')][_0x6eb4('0x52')]({'where':{'name':_0x48d9bf,'userProfileId':_0x12d975[_0x6eb4('0x53')]},'raw':!![]})[_0x6eb4('0x28')](function(_0x2ee9a2){if(_0x2ee9a2&&_0x2ee9a2[_0x6eb4('0x54')]===0x0){return db[_0x6eb4('0x2b')][_0x6eb4('0x4c')]({'name':_0x212a48['name'],'resourceId':_0x212a48['id'],'type':_0x2ee9a2[_0x6eb4('0x2e')],'sectionId':_0x2ee9a2['id']},{})[_0x6eb4('0x28')](function(){return _0x3f8eb5;});}else{return _0x3f8eb5;}})[_0x6eb4('0x48')](function(_0x5152ac){logger[_0x6eb4('0x55')](_0x6eb4('0x56'),_0x5152ac);throw _0x5152ac;});}return _0x3f8eb5;})[_0x6eb4('0x28')](respondWithResult(_0x301858,0xc9))[_0x6eb4('0x48')](handleError(_0x301858,null));};exports[_0x6eb4('0x27')]=function(_0x1d1044,_0x41c0ad){if(_0x1d1044[_0x6eb4('0x4d')]['id']){delete _0x1d1044[_0x6eb4('0x4d')]['id'];}return db[_0x6eb4('0x44')][_0x6eb4('0x52')]({'where':{'id':_0x1d1044[_0x6eb4('0x49')]['id']}})[_0x6eb4('0x28')](handleEntityNotFound(_0x41c0ad,null))['then'](saveUpdates(_0x1d1044['body'],null))[_0x6eb4('0x28')](respondWithResult(_0x41c0ad,null))[_0x6eb4('0x48')](handleError(_0x41c0ad,null));};exports[_0x6eb4('0x2c')]=function(_0x2c59c1,_0x8f950f){return db[_0x6eb4('0x44')][_0x6eb4('0x52')]({'where':{'id':_0x2c59c1[_0x6eb4('0x49')]['id']}})['then'](handleEntityNotFound(_0x8f950f,null))[_0x6eb4('0x28')](removeEntity(_0x8f950f,null))[_0x6eb4('0x48')](handleError(_0x8f950f,null));};exports[_0x6eb4('0x57')]=function(_0x29ffb1,_0x51c434){return db[_0x6eb4('0x44')][_0x6eb4('0x57')]()[_0x6eb4('0x28')](respondWithResult(_0x51c434,null))[_0x6eb4('0x48')](handleError(_0x51c434,null));};exports[_0x6eb4('0x58')]=function(_0x158b85,_0x159c06,_0x7b8646){var _0x180137={'raw':!![],'where':{}},_0x12c859={},_0x1dd37a;return db['FaxQueue'][_0x6eb4('0x59')]({'where':{'id':_0x158b85[_0x6eb4('0x49')]['id']}})[_0x6eb4('0x28')](handleEntityNotFound(_0x159c06,null))[_0x6eb4('0x28')](function(_0x52abfc){if(_0x52abfc){_0x1dd37a=_0x52abfc[_0x6eb4('0x29')]({'plain':!![]});_0x12c859['model']=_[_0x6eb4('0x34')](db[_0x6eb4('0x5a')][_0x6eb4('0x4a')]);_0x12c859['query']=_[_0x6eb4('0x34')](_0x158b85[_0x6eb4('0x33')]);_0x12c859[_0x6eb4('0x35')]=_[_0x6eb4('0x38')](_0x12c859[_0x6eb4('0x36')],_0x12c859[_0x6eb4('0x33')]);_0x180137['attributes']=_[_0x6eb4('0x38')](_0x12c859['model'],qs[_0x6eb4('0x39')](_0x158b85['query'][_0x6eb4('0x39')]));_0x180137[_0x6eb4('0x37')]=_0x180137[_0x6eb4('0x37')]['length']?_0x180137[_0x6eb4('0x37')]:_0x12c859[_0x6eb4('0x36')];if(!_0x158b85['query'][_0x6eb4('0x3a')](_0x6eb4('0x3b'))){_0x180137['limit']=qs[_0x6eb4('0x21')](_0x158b85[_0x6eb4('0x33')]['limit']);_0x180137[_0x6eb4('0x1f')]=qs[_0x6eb4('0x1f')](_0x158b85[_0x6eb4('0x33')]['offset']);}_0x180137['order']=qs[_0x6eb4('0x3d')](_0x158b85['query'][_0x6eb4('0x3d')]);_0x180137[_0x6eb4('0x3e')]=qs[_0x6eb4('0x35')](_['pick'](_0x158b85[_0x6eb4('0x33')],_0x12c859['filters']));_0x180137['where']['FaxQueueId']=_0x52abfc['id'];if(_0x158b85['query']['filter']){_0x180137['where']=_[_0x6eb4('0x40')](_0x180137[_0x6eb4('0x3e')],{'$or':_[_0x6eb4('0x31')](_0x180137['attributes'],function(_0x4d148d){var _0x326e8b={};_0x326e8b[_0x4d148d]={'$like':'%'+_0x158b85[_0x6eb4('0x33')][_0x6eb4('0x42')]+'%'};return _0x326e8b;})});}_0x180137=_[_0x6eb4('0x40')]({},_0x180137,_0x158b85[_0x6eb4('0x43')]);return db[_0x6eb4('0x5a')][_0x6eb4('0x46')](_0x180137);}})[_0x6eb4('0x28')](function(_0x15b85e){if(_0x15b85e){return db[_0x6eb4('0x5b')][_0x6eb4('0x5c')]({'where':{'id':_[_0x6eb4('0x31')](_0x15b85e,_0x6eb4('0x5d')),'role':_0x6eb4('0x5e')},'attributes':['id','name',_0x6eb4('0x5f'),_0x6eb4('0x60'),_0x6eb4('0x61')]});}})[_0x6eb4('0x28')](function(_0x4a770f){if(_0x4a770f){return{'count':_0x4a770f[_0x6eb4('0x22')],'rows':_['map'](_0x4a770f[_0x6eb4('0x47')],function(_0xfd7b74){return{'membername':_0xfd7b74[_0x6eb4('0x2e')],'UserId':_0xfd7b74['id'],'queue_name':_0x1dd37a[_0x6eb4('0x2e')],'FaxQueueId':_0x1dd37a['id'],'interface':util['format']('%s/%s',_0x6eb4('0x62'),_0xfd7b74[_0x6eb4('0x2e')]),'penalty':0x0,'paused':_0xfd7b74[_0x6eb4('0x5f')],'createdAt':_0xfd7b74['createdAt'],'updatedAt':_0xfd7b74[_0x6eb4('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6eb4('0x28')](respondWithFilteredResult(_0x159c06,_0x180137))['catch'](handleError(_0x159c06,null));};exports[_0x6eb4('0x63')]=function(_0x565ee1,_0x311990,_0xe6052){var _0x33fd28={};var _0x3398d3={};var _0x1f6ba5;var _0x4d75a3;return db[_0x6eb4('0x44')][_0x6eb4('0x59')]({'where':{'id':_0x565ee1[_0x6eb4('0x49')]['id']}})['then'](handleEntityNotFound(_0x311990,null))[_0x6eb4('0x28')](function(_0x487fdc){if(_0x487fdc){_0x1f6ba5=_0x487fdc;_0x3398d3[_0x6eb4('0x36')]=_[_0x6eb4('0x34')](db['Team'][_0x6eb4('0x4a')]);_0x3398d3[_0x6eb4('0x33')]=_[_0x6eb4('0x34')](_0x565ee1[_0x6eb4('0x33')]);_0x3398d3[_0x6eb4('0x35')]=_[_0x6eb4('0x38')](_0x3398d3['model'],_0x3398d3[_0x6eb4('0x33')]);_0x33fd28['attributes']=_[_0x6eb4('0x38')](_0x3398d3[_0x6eb4('0x36')],qs['fields'](_0x565ee1[_0x6eb4('0x33')][_0x6eb4('0x39')]));_0x33fd28[_0x6eb4('0x37')]=_0x33fd28['attributes'][_0x6eb4('0x64')]?_0x33fd28['attributes']:_0x3398d3[_0x6eb4('0x36')];_0x33fd28[_0x6eb4('0x3c')]=qs[_0x6eb4('0x3d')](_0x565ee1[_0x6eb4('0x33')]['sort']);_0x33fd28['where']=qs[_0x6eb4('0x35')](_[_0x6eb4('0x3f')](_0x565ee1[_0x6eb4('0x33')],_0x3398d3[_0x6eb4('0x35')]));if(_0x565ee1[_0x6eb4('0x33')][_0x6eb4('0x42')]){_0x33fd28['where']=_[_0x6eb4('0x40')](_0x33fd28['where'],{'$or':_[_0x6eb4('0x31')](_0x33fd28[_0x6eb4('0x37')],function(_0x454b32){var _0x446130={};_0x446130[_0x454b32]={'$like':'%'+_0x565ee1[_0x6eb4('0x33')][_0x6eb4('0x42')]+'%'};return _0x446130;})});}_0x33fd28=_[_0x6eb4('0x40')]({},_0x33fd28,_0x565ee1[_0x6eb4('0x43')]);return _0x1f6ba5[_0x6eb4('0x63')](_0x33fd28);}})[_0x6eb4('0x28')](function(_0x281fcf){if(_0x281fcf){_0x4d75a3=_0x281fcf['length'];if(!_0x565ee1['query'][_0x6eb4('0x3a')]('nolimit')){_0x33fd28[_0x6eb4('0x21')]=qs['limit'](_0x565ee1[_0x6eb4('0x33')]['limit']);_0x33fd28['offset']=qs[_0x6eb4('0x1f')](_0x565ee1[_0x6eb4('0x33')]['offset']);}return _0x1f6ba5[_0x6eb4('0x63')](_0x33fd28);}})['then'](function(_0x25fed9){if(_0x25fed9){return _0x25fed9?{'count':_0x4d75a3,'rows':_0x25fed9}:null;}})['then'](respondWithResult(_0x311990,null))[_0x6eb4('0x48')](handleError(_0x311990,null));};exports[_0x6eb4('0x65')]=function(_0x386e3d,_0x4af378,_0x2d1741){var _0x4dff2b=_0x386e3d[_0x6eb4('0x4d')]['ids'];return db['Team'][_0x6eb4('0x46')]({'where':{'id':_0x4dff2b},'attributes':['id'],'include':[{'model':db[_0x6eb4('0x5b')],'as':'Agents','attributes':['id','name',_0x6eb4('0x66'),'voicePause',_0x6eb4('0x67')],'raw':!![]}]})['then'](function(_0x27085e){if(_0x27085e){var _0x31269a=_['flatMap'](_0x27085e,function(_0x6f4588){var _0x11de91=_0x6f4588['get']({'plain':!![]});return _0x11de91['Agents'];});return db['FaxQueue'][_0x6eb4('0x52')]({'where':{'id':_0x386e3d[_0x6eb4('0x49')]['id']}})[_0x6eb4('0x28')](function(_0x5cd389){return db[_0x6eb4('0x68')][_0x6eb4('0x69')](function(_0xc2ff5a){return _0x5cd389['addTeams'](_0x4dff2b,{'transaction':_0xc2ff5a})[_0x6eb4('0x28')](function(){return BPromise[_0x6eb4('0x6a')](_0x31269a,function(_0x33a486){return db[_0x6eb4('0x5a')]['findOrCreate']({'where':{'UserId':_0x33a486['id'],'FaxQueueId':_0x386e3d['params']['id']},'transaction':_0xc2ff5a});});})[_0x6eb4('0x28')](function(){_0x31269a[_0x6eb4('0x6b')](function(_0x5ac6d0){socket[_0x6eb4('0x6c')](_0x6eb4('0x6d'),{'UserId':_0x5ac6d0['id'],'FaxQueueId':_0x5cd389['id']});});});});});}})[_0x6eb4('0x28')](respondWithStatusCode(_0x4af378,null))['catch'](handleError(_0x4af378,null));};exports[_0x6eb4('0x6e')]=function(_0x5f3467,_0x412aae,_0x340914){return db[_0x6eb4('0x6f')]['findAll']({'where':{'id':_0x5f3467[_0x6eb4('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6eb4('0x5b')],'as':_0x6eb4('0x70'),'attributes':['id'],'raw':!![]}]})[_0x6eb4('0x28')](handleEntityNotFound(_0x412aae,null))['then'](function(_0x5b1bcf){var _0x54a20b=_[_0x6eb4('0x31')](_0x5b1bcf,'id');var _0xae3996=[];var _0x32037d=[];var _0x534026=squel[_0x6eb4('0x71')]();_0x534026[_0x6eb4('0x72')](_0x6eb4('0x73'))['from'](_0x6eb4('0x74'),'tq')['join'](_0x6eb4('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x5f3467[_0x6eb4('0x49')]['id']);for(var _0x37819f=0x0;_0x37819f<_0x5b1bcf[_0x6eb4('0x64')];_0x37819f+=0x1){let _0x5048df=_0x5b1bcf[_0x37819f];for(var _0x11c0c9=0x0;_0x11c0c9<_0x5048df[_0x6eb4('0x70')][_0x6eb4('0x64')];_0x11c0c9+=0x1){let _0x17b10b=_0x5048df['Agents'][_0x11c0c9];var _0x416b87=_0x534026['clone']();_0x416b87[_0x6eb4('0x3e')](_0x6eb4('0x76'),_0x17b10b['id']);_0x32037d[_0x6eb4('0x77')](db['sequelize']['query'](_0x416b87[_0x6eb4('0x78')](),{'type':db[_0x6eb4('0x68')]['QueryTypes'][_0x6eb4('0x79')]})[_0x6eb4('0x28')](function(_0x5da181){if(_0x5da181[_0x6eb4('0x64')]===0x1){return _0x17b10b['id'];}else{var _0x18f284=_['every'](_[_0x6eb4('0x31')](_0x5da181,_0x6eb4('0x7a')),function(_0x31697f){return _[_0x6eb4('0x7b')](_0x54a20b,_0x31697f);});if(_0x18f284){return _0x17b10b['id'];}}}));}}return BPromise[_0x6eb4('0x7c')](_0x32037d)[_0x6eb4('0x28')](function(_0x51722e){_0xae3996=_(_0xae3996)[_0x6eb4('0x7d')](_0x51722e)[_0x6eb4('0x7e')]()[_0x6eb4('0x7f')]();return db[_0x6eb4('0x44')]['find']({'where':{'id':_0x5f3467[_0x6eb4('0x49')]['id']}})[_0x6eb4('0x28')](function(_0x5424d4){return db[_0x6eb4('0x68')]['transaction'](function(_0x465136){return _0x5424d4['removeTeams'](_0x5f3467[_0x6eb4('0x33')][_0x6eb4('0x80')],{'transaction':_0x465136})[_0x6eb4('0x28')](function(){if(!_[_0x6eb4('0x81')](_0xae3996)){return _0x5424d4[_0x6eb4('0x82')](_0xae3996,{'transaction':_0x465136});}})['then'](function(){_0xae3996[_0x6eb4('0x6b')](function(_0x3b3bd0){socket[_0x6eb4('0x6c')]('userFaxQueue:remove',{'UserId':_0x3b3bd0,'FaxQueueId':_0x5424d4['id']});});});});});});})[_0x6eb4('0x28')](respondWithStatusCode(_0x412aae,null))['catch'](handleError(_0x412aae,null));};exports[_0x6eb4('0x83')]=function(_0x1bfe8e,_0x45c793,_0x4f6e32){return db[_0x6eb4('0x44')]['find']({'where':{'id':_0x1bfe8e['params']['id']}})[_0x6eb4('0x28')](handleEntityNotFound(_0x45c793,null))['then'](function(_0x139c6b){if(_0x139c6b){return _0x139c6b[_0x6eb4('0x83')](_0x1bfe8e[_0x6eb4('0x4d')][_0x6eb4('0x80')],_[_0x6eb4('0x84')](_0x1bfe8e[_0x6eb4('0x4d')],[_0x6eb4('0x80'),'id'])||{})[_0x6eb4('0x85')](function(_0x2f4e41){for(var _0x15a6be=0x0;_0x15a6be<_0x1bfe8e[_0x6eb4('0x4d')][_0x6eb4('0x80')]['length'];_0x15a6be+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x1bfe8e[_0x6eb4('0x4d')][_0x6eb4('0x80')][_0x15a6be]),'FaxQueueId':Number(_0x1bfe8e['params']['id'])});}return _0x2f4e41;});}})[_0x6eb4('0x28')](respondWithResult(_0x45c793,null))[_0x6eb4('0x48')](handleError(_0x45c793,null));};exports[_0x6eb4('0x82')]=function(_0x433168,_0x44a4bf,_0x797198){return db[_0x6eb4('0x44')]['find']({'where':{'id':_0x433168[_0x6eb4('0x49')]['id']}})['then'](handleEntityNotFound(_0x44a4bf,null))[_0x6eb4('0x28')](function(_0x1324cf){if(_0x1324cf){return _0x1324cf['removeAgents'](_0x433168[_0x6eb4('0x33')]['ids'])[_0x6eb4('0x28')](function(){if(_[_0x6eb4('0x86')](_0x433168[_0x6eb4('0x33')]['ids'])){for(var _0x518a52=0x0;_0x518a52<_0x433168[_0x6eb4('0x33')]['ids'][_0x6eb4('0x64')];_0x518a52+=0x1){socket[_0x6eb4('0x6c')](_0x6eb4('0x87'),{'UserId':Number(_0x433168[_0x6eb4('0x33')][_0x6eb4('0x80')][_0x518a52]),'FaxQueueId':Number(_0x433168[_0x6eb4('0x49')]['id'])});}}else{socket['emit'](_0x6eb4('0x87'),{'UserId':Number(_0x433168[_0x6eb4('0x33')][_0x6eb4('0x80')]),'FaxQueueId':Number(_0x433168[_0x6eb4('0x49')]['id'])});}});}})[_0x6eb4('0x28')](respondWithStatusCode(_0x44a4bf,null))[_0x6eb4('0x48')](handleError(_0x44a4bf,null));};exports[_0x6eb4('0x88')]=function(_0x58a3cb,_0x5b3ebb,_0x211426){var _0x17acad={};var _0xdefbfc={};var _0xcbb238;var _0x3e0be5;return db[_0x6eb4('0x44')][_0x6eb4('0x59')]({'where':{'id':_0x58a3cb[_0x6eb4('0x49')]['id']}})[_0x6eb4('0x28')](handleEntityNotFound(_0x5b3ebb,null))[_0x6eb4('0x28')](function(_0x304448){if(_0x304448){_0xcbb238=_0x304448;_0xdefbfc[_0x6eb4('0x36')]=_[_0x6eb4('0x34')](db[_0x6eb4('0x5b')]['rawAttributes']);_0xdefbfc[_0x6eb4('0x33')]=_['keys'](_0x58a3cb[_0x6eb4('0x33')]);_0xdefbfc[_0x6eb4('0x35')]=_[_0x6eb4('0x38')](_0xdefbfc[_0x6eb4('0x36')],_0xdefbfc[_0x6eb4('0x33')]);_0x17acad[_0x6eb4('0x37')]=_['intersection'](_0xdefbfc[_0x6eb4('0x36')],qs[_0x6eb4('0x39')](_0x58a3cb['query'][_0x6eb4('0x39')]));_0x17acad[_0x6eb4('0x37')]=_0x17acad[_0x6eb4('0x37')][_0x6eb4('0x64')]?_0x17acad[_0x6eb4('0x37')]:_0xdefbfc['model'];_0x17acad[_0x6eb4('0x3c')]=qs[_0x6eb4('0x3d')](_0x58a3cb[_0x6eb4('0x33')]['sort']);_0x17acad[_0x6eb4('0x3e')]=qs['filters'](_['pick'](_0x58a3cb[_0x6eb4('0x33')],_0xdefbfc[_0x6eb4('0x35')]));if(_0x58a3cb['query'][_0x6eb4('0x42')]){_0x17acad['where']=_[_0x6eb4('0x40')](_0x17acad['where'],{'$or':_['map'](_0x17acad['attributes'],function(_0x5b3428){var _0x453422={};_0x453422[_0x5b3428]={'$like':'%'+_0x58a3cb[_0x6eb4('0x33')]['filter']+'%'};return _0x453422;})});}_0x17acad=_[_0x6eb4('0x40')]({},_0x17acad,_0x58a3cb['options']);return _0xcbb238['getAgents'](_0x17acad);}})[_0x6eb4('0x28')](function(_0x24c02e){if(_0x24c02e){_0x3e0be5=_0x24c02e['length'];if(!_0x58a3cb[_0x6eb4('0x33')]['hasOwnProperty'](_0x6eb4('0x3b'))){_0x17acad[_0x6eb4('0x21')]=qs[_0x6eb4('0x21')](_0x58a3cb[_0x6eb4('0x33')]['limit']);_0x17acad['offset']=qs[_0x6eb4('0x1f')](_0x58a3cb['query']['offset']);}return _0xcbb238[_0x6eb4('0x88')](_0x17acad);}})[_0x6eb4('0x28')](function(_0x2d95d6){if(_0x2d95d6){return _0x2d95d6?{'count':_0x3e0be5,'rows':_0x2d95d6}:null;}})['then'](respondWithResult(_0x5b3ebb,null))[_0x6eb4('0x48')](handleError(_0x5b3ebb,null));}; \ No newline at end of file +var _0x3076=['order','findAndCountAll','faxPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','ids','User','online','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','update','then','destroy','get','UserProfileResource','name','send','FaxQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','map','VIRTUAL','merge','options','where','includeAll','include','findAll','catch','show','keys','create','body','user','role','userProfileId','autoAssociation','find','params','describe','findOne','UserFaxQueue'];(function(_0x2a2e86,_0x3f4667){var _0x62a078=function(_0x4e33b1){while(--_0x4e33b1){_0x2a2e86['push'](_0x2a2e86['shift']());}};_0x62a078(++_0x3f4667);}(_0x3076,0x13a));var _0x6307=function(_0x4b465e,_0x33ac38){_0x4b465e=_0x4b465e-0x0;var _0x18a693=_0x3076[_0x4b465e];return _0x18a693;};'use strict';var emlformat=require(_0x6307('0x0'));var rimraf=require(_0x6307('0x1'));var zipdir=require(_0x6307('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6307('0x3'));var moment=require(_0x6307('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6307('0x5'));var util=require('util');var path=require(_0x6307('0x6'));var sox=require(_0x6307('0x7'));var csv=require(_0x6307('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6307('0x9'));var _=require(_0x6307('0xa'));var squel=require(_0x6307('0xb'));var crypto=require(_0x6307('0xc'));var jsforce=require(_0x6307('0xd'));var deskjs=require(_0x6307('0xe'));var toCsv=require(_0x6307('0x8'));var querystring=require(_0x6307('0xf'));var Papa=require(_0x6307('0x10'));var Redis=require(_0x6307('0x11'));var authService=require(_0x6307('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6307('0x13'));var hardwareService=require(_0x6307('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6307('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6307('0x16'))['db'];config[_0x6307('0x17')]=_[_0x6307('0x18')](config[_0x6307('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6307('0x19'))(new Redis(config[_0x6307('0x17')]));require(_0x6307('0x1a'))[_0x6307('0x1b')](socket);function respondWithStatusCode(_0x5f2cf6,_0x24d488){_0x24d488=_0x24d488||0xcc;return function(_0x48314b){if(_0x48314b){return _0x5f2cf6[_0x6307('0x1c')](_0x24d488);}return _0x5f2cf6['status'](_0x24d488)[_0x6307('0x1d')]();};}function respondWithResult(_0x12e208,_0x7d38d6){_0x7d38d6=_0x7d38d6||0xc8;return function(_0x145fbe){if(_0x145fbe){return _0x12e208[_0x6307('0x1e')](_0x7d38d6)['json'](_0x145fbe);}};}function respondWithFilteredResult(_0x359cbd,_0x89259b){return function(_0x1057c5){if(_0x1057c5){var _0x21cee6=typeof _0x89259b['offset']===_0x6307('0x1f')&&typeof _0x89259b[_0x6307('0x20')]===_0x6307('0x1f');var _0x4b39ea=_0x1057c5[_0x6307('0x21')];var _0x3a2173=_0x21cee6?0x0:_0x89259b[_0x6307('0x22')];var _0xae00a4=_0x21cee6?_0x1057c5[_0x6307('0x21')]:_0x89259b[_0x6307('0x22')]+_0x89259b[_0x6307('0x20')];var _0x3c38bf;if(_0xae00a4>=_0x4b39ea){_0xae00a4=_0x4b39ea;_0x3c38bf=0xc8;}else{_0x3c38bf=0xce;}_0x359cbd[_0x6307('0x1e')](_0x3c38bf);return _0x359cbd[_0x6307('0x23')]('Content-Range',_0x3a2173+'-'+_0xae00a4+'/'+_0x4b39ea)['json'](_0x1057c5);}return null;};}function patchUpdates(_0x34d188){return function(_0x40ec4d){try{jsonpatch['apply'](_0x40ec4d,_0x34d188,!![]);}catch(_0x56e870){return BPromise['reject'](_0x56e870);}return _0x40ec4d['save']();};}function saveUpdates(_0x263e8a,_0x129a9b){return function(_0x354a6a){if(_0x354a6a){return _0x354a6a[_0x6307('0x24')](_0x263e8a)[_0x6307('0x25')](function(_0x4fa18d){return _0x4fa18d;});}return null;};}function removeEntity(_0x348156,_0x14bda0){return function(_0x2181c1){if(_0x2181c1){return _0x2181c1[_0x6307('0x26')]()[_0x6307('0x25')](function(){var _0x709b50=_0x2181c1[_0x6307('0x27')]({'plain':!![]});var _0x181dc4='FaxQueues';return db[_0x6307('0x28')][_0x6307('0x26')]({'where':{'type':_0x181dc4,'resourceId':_0x709b50['id']}})[_0x6307('0x25')](function(){return _0x2181c1;});})[_0x6307('0x25')](function(){_0x348156[_0x6307('0x1e')](0xcc)[_0x6307('0x1d')]();});}};}function handleEntityNotFound(_0x4feba6,_0x566ff7){return function(_0x502be2){if(!_0x502be2){_0x4feba6[_0x6307('0x1c')](0x194);}return _0x502be2;};}function handleError(_0x397248,_0x184408){_0x184408=_0x184408||0x1f4;return function(_0x4eaa4f){logger['error'](_0x4eaa4f['stack']);if(_0x4eaa4f[_0x6307('0x29')]){delete _0x4eaa4f[_0x6307('0x29')];}_0x397248[_0x6307('0x1e')](_0x184408)[_0x6307('0x2a')](_0x4eaa4f);};}exports['index']=function(_0x1e8cd4,_0x2a21df){var _0x48d20f={},_0x5f3061={},_0x1e393a={'count':0x0,'rows':[]};var _0x5060b2=_['map'](db[_0x6307('0x2b')][_0x6307('0x2c')],function(_0x551f32){return{'name':_0x551f32[_0x6307('0x2d')],'type':_0x551f32[_0x6307('0x2e')][_0x6307('0x2f')]};});_0x5f3061[_0x6307('0x30')]=_['map'](_0x5060b2,'name');_0x5f3061['query']=_['keys'](_0x1e8cd4[_0x6307('0x31')]);_0x5f3061[_0x6307('0x32')]=_[_0x6307('0x33')](_0x5f3061[_0x6307('0x30')],_0x5f3061[_0x6307('0x31')]);_0x48d20f['attributes']=_[_0x6307('0x33')](_0x5f3061['model'],qs[_0x6307('0x34')](_0x1e8cd4[_0x6307('0x31')][_0x6307('0x34')]));_0x48d20f[_0x6307('0x35')]=_0x48d20f[_0x6307('0x35')][_0x6307('0x36')]?_0x48d20f['attributes']:_0x5f3061[_0x6307('0x30')];if(!_0x1e8cd4[_0x6307('0x31')][_0x6307('0x37')](_0x6307('0x38'))){_0x48d20f[_0x6307('0x20')]=qs[_0x6307('0x20')](_0x1e8cd4[_0x6307('0x31')][_0x6307('0x20')]);_0x48d20f[_0x6307('0x22')]=qs[_0x6307('0x22')](_0x1e8cd4[_0x6307('0x31')]['offset']);}_0x48d20f['order']=qs[_0x6307('0x39')](_0x1e8cd4[_0x6307('0x31')][_0x6307('0x39')]);_0x48d20f['where']=qs[_0x6307('0x32')](_[_0x6307('0x3a')](_0x1e8cd4[_0x6307('0x31')],_0x5f3061['filters']),_0x5060b2);if(_0x1e8cd4['query'][_0x6307('0x3b')]){_0x48d20f['where']=_['merge'](_0x48d20f['where'],{'$or':_[_0x6307('0x3c')](_0x5060b2,function(_0x2af6a0){if(_0x2af6a0[_0x6307('0x2e')]!==_0x6307('0x3d')){var _0x2f166c={};_0x2f166c[_0x2af6a0[_0x6307('0x29')]]={'$like':'%'+_0x1e8cd4[_0x6307('0x31')][_0x6307('0x3b')]+'%'};return _0x2f166c;}})});}_0x48d20f=_[_0x6307('0x3e')]({},_0x48d20f,_0x1e8cd4[_0x6307('0x3f')]);var _0x4d30a3={'where':_0x48d20f[_0x6307('0x40')]};return db[_0x6307('0x2b')]['count'](_0x4d30a3)['then'](function(_0x396228){_0x1e393a['count']=_0x396228;if(_0x1e8cd4[_0x6307('0x31')][_0x6307('0x41')]){_0x48d20f[_0x6307('0x42')]=[{'all':!![]}];}return db[_0x6307('0x2b')][_0x6307('0x43')](_0x48d20f);})[_0x6307('0x25')](function(_0x1df242){_0x1e393a['rows']=_0x1df242;return _0x1e393a;})[_0x6307('0x25')](respondWithFilteredResult(_0x2a21df,_0x48d20f))[_0x6307('0x44')](handleError(_0x2a21df,null));};exports[_0x6307('0x45')]=function(_0x506892,_0x13de61){var _0xce41e9={'raw':!![],'where':{'id':_0x506892['params']['id']}},_0x28d362={};_0x28d362['model']=_[_0x6307('0x46')](db['FaxQueue'][_0x6307('0x2c')]);_0x28d362[_0x6307('0x31')]=_[_0x6307('0x46')](_0x506892[_0x6307('0x31')]);_0x28d362[_0x6307('0x32')]=_['intersection'](_0x28d362['model'],_0x28d362['query']);_0xce41e9[_0x6307('0x35')]=_['intersection'](_0x28d362[_0x6307('0x30')],qs[_0x6307('0x34')](_0x506892[_0x6307('0x31')][_0x6307('0x34')]));_0xce41e9[_0x6307('0x35')]=_0xce41e9[_0x6307('0x35')][_0x6307('0x36')]?_0xce41e9[_0x6307('0x35')]:_0x28d362[_0x6307('0x30')];if(_0x506892[_0x6307('0x31')][_0x6307('0x41')]){_0xce41e9['include']=[{'all':!![]}];}_0xce41e9=_[_0x6307('0x3e')]({},_0xce41e9,_0x506892[_0x6307('0x3f')]);return db[_0x6307('0x2b')]['find'](_0xce41e9)['then'](handleEntityNotFound(_0x13de61,null))[_0x6307('0x25')](respondWithResult(_0x13de61,null))[_0x6307('0x44')](handleError(_0x13de61,null));};exports[_0x6307('0x47')]=function(_0xc18d31,_0x2171da){return db[_0x6307('0x2b')][_0x6307('0x47')](_0xc18d31[_0x6307('0x48')],{})[_0x6307('0x25')](function(_0x66037b){var _0x4f170d=_0xc18d31[_0x6307('0x49')]['get']({'plain':!![]});if(!_0x4f170d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f170d[_0x6307('0x4a')]===_0x6307('0x49')){var _0x2b2944=_0x66037b[_0x6307('0x27')]({'plain':!![]});var _0x2707b9='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x2707b9,'userProfileId':_0x4f170d[_0x6307('0x4b')]},'raw':!![]})[_0x6307('0x25')](function(_0x3469ce){if(_0x3469ce&&_0x3469ce[_0x6307('0x4c')]===0x0){return db[_0x6307('0x28')]['create']({'name':_0x2b2944[_0x6307('0x29')],'resourceId':_0x2b2944['id'],'type':_0x3469ce['name'],'sectionId':_0x3469ce['id']},{})[_0x6307('0x25')](function(){return _0x66037b;});}else{return _0x66037b;}})[_0x6307('0x44')](function(_0x4a2a08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a2a08);throw _0x4a2a08;});}return _0x66037b;})[_0x6307('0x25')](respondWithResult(_0x2171da,0xc9))[_0x6307('0x44')](handleError(_0x2171da,null));};exports[_0x6307('0x24')]=function(_0x10da41,_0x1f91dd){if(_0x10da41['body']['id']){delete _0x10da41['body']['id'];}return db['FaxQueue']['find']({'where':{'id':_0x10da41['params']['id']}})[_0x6307('0x25')](handleEntityNotFound(_0x1f91dd,null))['then'](saveUpdates(_0x10da41[_0x6307('0x48')],null))[_0x6307('0x25')](respondWithResult(_0x1f91dd,null))[_0x6307('0x44')](handleError(_0x1f91dd,null));};exports[_0x6307('0x26')]=function(_0x496ec8,_0x267b61){return db[_0x6307('0x2b')][_0x6307('0x4d')]({'where':{'id':_0x496ec8[_0x6307('0x4e')]['id']}})[_0x6307('0x25')](handleEntityNotFound(_0x267b61,null))[_0x6307('0x25')](removeEntity(_0x267b61,null))[_0x6307('0x44')](handleError(_0x267b61,null));};exports[_0x6307('0x4f')]=function(_0x575623,_0x5c49fd){return db[_0x6307('0x2b')]['describe']()[_0x6307('0x25')](respondWithResult(_0x5c49fd,null))[_0x6307('0x44')](handleError(_0x5c49fd,null));};exports['getMembers']=function(_0x3fa165,_0x3d2f2d,_0x374556){var _0x2db4f2={'raw':!![],'where':{}},_0x492e82={},_0x30e942;return db[_0x6307('0x2b')][_0x6307('0x50')]({'where':{'id':_0x3fa165['params']['id']}})[_0x6307('0x25')](handleEntityNotFound(_0x3d2f2d,null))[_0x6307('0x25')](function(_0x3ba3e3){if(_0x3ba3e3){_0x30e942=_0x3ba3e3['get']({'plain':!![]});_0x492e82[_0x6307('0x30')]=_[_0x6307('0x46')](db[_0x6307('0x51')][_0x6307('0x2c')]);_0x492e82[_0x6307('0x31')]=_[_0x6307('0x46')](_0x3fa165[_0x6307('0x31')]);_0x492e82['filters']=_[_0x6307('0x33')](_0x492e82[_0x6307('0x30')],_0x492e82[_0x6307('0x31')]);_0x2db4f2[_0x6307('0x35')]=_[_0x6307('0x33')](_0x492e82['model'],qs[_0x6307('0x34')](_0x3fa165[_0x6307('0x31')][_0x6307('0x34')]));_0x2db4f2[_0x6307('0x35')]=_0x2db4f2['attributes'][_0x6307('0x36')]?_0x2db4f2['attributes']:_0x492e82[_0x6307('0x30')];if(!_0x3fa165['query'][_0x6307('0x37')]('nolimit')){_0x2db4f2[_0x6307('0x20')]=qs[_0x6307('0x20')](_0x3fa165['query'][_0x6307('0x20')]);_0x2db4f2[_0x6307('0x22')]=qs[_0x6307('0x22')](_0x3fa165['query'][_0x6307('0x22')]);}_0x2db4f2[_0x6307('0x52')]=qs[_0x6307('0x39')](_0x3fa165[_0x6307('0x31')][_0x6307('0x39')]);_0x2db4f2['where']=qs[_0x6307('0x32')](_[_0x6307('0x3a')](_0x3fa165['query'],_0x492e82[_0x6307('0x32')]));_0x2db4f2[_0x6307('0x40')]['FaxQueueId']=_0x3ba3e3['id'];if(_0x3fa165[_0x6307('0x31')][_0x6307('0x3b')]){_0x2db4f2[_0x6307('0x40')]=_[_0x6307('0x3e')](_0x2db4f2[_0x6307('0x40')],{'$or':_[_0x6307('0x3c')](_0x2db4f2[_0x6307('0x35')],function(_0x3a15e8){var _0x1d0411={};_0x1d0411[_0x3a15e8]={'$like':'%'+_0x3fa165[_0x6307('0x31')][_0x6307('0x3b')]+'%'};return _0x1d0411;})});}_0x2db4f2=_[_0x6307('0x3e')]({},_0x2db4f2,_0x3fa165['options']);return db[_0x6307('0x51')][_0x6307('0x43')](_0x2db4f2);}})[_0x6307('0x25')](function(_0xa45a7c){if(_0xa45a7c){return db['User'][_0x6307('0x53')]({'where':{'id':_[_0x6307('0x3c')](_0xa45a7c,'UserId'),'role':'agent'},'attributes':['id',_0x6307('0x29'),_0x6307('0x54'),_0x6307('0x55'),_0x6307('0x56')]});}})[_0x6307('0x25')](function(_0x578d25){if(_0x578d25){return{'count':_0x578d25[_0x6307('0x21')],'rows':_[_0x6307('0x3c')](_0x578d25[_0x6307('0x57')],function(_0x1e869e){return{'membername':_0x1e869e[_0x6307('0x29')],'UserId':_0x1e869e['id'],'queue_name':_0x30e942[_0x6307('0x29')],'FaxQueueId':_0x30e942['id'],'interface':util[_0x6307('0x58')](_0x6307('0x59'),'SIP',_0x1e869e[_0x6307('0x29')]),'penalty':0x0,'paused':_0x1e869e[_0x6307('0x54')],'createdAt':_0x1e869e[_0x6307('0x56')],'updatedAt':_0x1e869e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3d2f2d,_0x2db4f2))[_0x6307('0x44')](handleError(_0x3d2f2d,null));};exports[_0x6307('0x5a')]=function(_0x468aa8,_0x550573,_0x4e2369){var _0x224ff3={};var _0x3dac89={};var _0x44a064;var _0x321f29;return db[_0x6307('0x2b')]['findOne']({'where':{'id':_0x468aa8[_0x6307('0x4e')]['id']}})[_0x6307('0x25')](handleEntityNotFound(_0x550573,null))[_0x6307('0x25')](function(_0x726854){if(_0x726854){_0x44a064=_0x726854;_0x3dac89[_0x6307('0x30')]=_[_0x6307('0x46')](db[_0x6307('0x5b')]['rawAttributes']);_0x3dac89[_0x6307('0x31')]=_[_0x6307('0x46')](_0x468aa8[_0x6307('0x31')]);_0x3dac89[_0x6307('0x32')]=_[_0x6307('0x33')](_0x3dac89[_0x6307('0x30')],_0x3dac89[_0x6307('0x31')]);_0x224ff3['attributes']=_[_0x6307('0x33')](_0x3dac89['model'],qs[_0x6307('0x34')](_0x468aa8[_0x6307('0x31')][_0x6307('0x34')]));_0x224ff3['attributes']=_0x224ff3[_0x6307('0x35')]['length']?_0x224ff3[_0x6307('0x35')]:_0x3dac89[_0x6307('0x30')];_0x224ff3['order']=qs[_0x6307('0x39')](_0x468aa8[_0x6307('0x31')][_0x6307('0x39')]);_0x224ff3[_0x6307('0x40')]=qs[_0x6307('0x32')](_[_0x6307('0x3a')](_0x468aa8[_0x6307('0x31')],_0x3dac89[_0x6307('0x32')]));if(_0x468aa8[_0x6307('0x31')][_0x6307('0x3b')]){_0x224ff3[_0x6307('0x40')]=_[_0x6307('0x3e')](_0x224ff3[_0x6307('0x40')],{'$or':_['map'](_0x224ff3['attributes'],function(_0x3c7ebb){var _0x4ebcbb={};_0x4ebcbb[_0x3c7ebb]={'$like':'%'+_0x468aa8[_0x6307('0x31')][_0x6307('0x3b')]+'%'};return _0x4ebcbb;})});}_0x224ff3=_['merge']({},_0x224ff3,_0x468aa8['options']);return _0x44a064[_0x6307('0x5a')](_0x224ff3);}})['then'](function(_0x21adde){if(_0x21adde){_0x321f29=_0x21adde[_0x6307('0x36')];if(!_0x468aa8['query'][_0x6307('0x37')](_0x6307('0x38'))){_0x224ff3[_0x6307('0x20')]=qs[_0x6307('0x20')](_0x468aa8[_0x6307('0x31')]['limit']);_0x224ff3[_0x6307('0x22')]=qs[_0x6307('0x22')](_0x468aa8[_0x6307('0x31')][_0x6307('0x22')]);}return _0x44a064[_0x6307('0x5a')](_0x224ff3);}})['then'](function(_0x260def){if(_0x260def){return _0x260def?{'count':_0x321f29,'rows':_0x260def}:null;}})[_0x6307('0x25')](respondWithResult(_0x550573,null))['catch'](handleError(_0x550573,null));};exports['addTeams']=function(_0x9eee26,_0x5b5dfa,_0x32bca8){var _0x354b55=_0x9eee26[_0x6307('0x48')][_0x6307('0x5c')];return db['Team'][_0x6307('0x43')]({'where':{'id':_0x354b55},'attributes':['id'],'include':[{'model':db[_0x6307('0x5d')],'as':'Agents','attributes':['id',_0x6307('0x29'),_0x6307('0x5e'),'voicePause',_0x6307('0x5f')],'raw':!![]}]})['then'](function(_0x1cf9fc){if(_0x1cf9fc){var _0x2c8166=_[_0x6307('0x60')](_0x1cf9fc,function(_0xf68e0){var _0x931c68=_0xf68e0[_0x6307('0x27')]({'plain':!![]});return _0x931c68[_0x6307('0x61')];});return db[_0x6307('0x2b')][_0x6307('0x4d')]({'where':{'id':_0x9eee26[_0x6307('0x4e')]['id']}})[_0x6307('0x25')](function(_0x4f435c){return db[_0x6307('0x62')][_0x6307('0x63')](function(_0x3cd040){return _0x4f435c[_0x6307('0x64')](_0x354b55,{'transaction':_0x3cd040})[_0x6307('0x25')](function(){return BPromise[_0x6307('0x65')](_0x2c8166,function(_0x5b8c29){return db[_0x6307('0x51')][_0x6307('0x66')]({'where':{'UserId':_0x5b8c29['id'],'FaxQueueId':_0x9eee26[_0x6307('0x4e')]['id']},'transaction':_0x3cd040});});})[_0x6307('0x25')](function(){_0x2c8166[_0x6307('0x67')](function(_0x11b9b0){socket[_0x6307('0x68')]('userFaxQueue:save',{'UserId':_0x11b9b0['id'],'FaxQueueId':_0x4f435c['id']});});});});});}})[_0x6307('0x25')](respondWithStatusCode(_0x5b5dfa,null))['catch'](handleError(_0x5b5dfa,null));};exports[_0x6307('0x69')]=function(_0x16d415,_0x35954c,_0xb57576){return db[_0x6307('0x5b')]['findAll']({'where':{'id':_0x16d415['query'][_0x6307('0x5c')]},'attributes':['id'],'include':[{'model':db[_0x6307('0x5d')],'as':_0x6307('0x61'),'attributes':['id'],'raw':!![]}]})[_0x6307('0x25')](handleEntityNotFound(_0x35954c,null))['then'](function(_0x4164aa){var _0x41fb05=_[_0x6307('0x3c')](_0x4164aa,'id');var _0x3d4cea=[];var _0x596994=[];var _0x4920b6=squel['select']();_0x4920b6[_0x6307('0x6a')]('tq.TeamId')[_0x6307('0x6b')](_0x6307('0x6c'),'tq')[_0x6307('0x6d')](_0x6307('0x6e'),'ut',_0x6307('0x6f'))[_0x6307('0x40')](_0x6307('0x70'),_0x16d415[_0x6307('0x4e')]['id']);for(var _0x1b20d9=0x0;_0x1b20d9<_0x4164aa[_0x6307('0x36')];_0x1b20d9+=0x1){let _0x2c1a2d=_0x4164aa[_0x1b20d9];for(var _0x15392f=0x0;_0x15392f<_0x2c1a2d[_0x6307('0x61')][_0x6307('0x36')];_0x15392f+=0x1){let _0xe67ad0=_0x2c1a2d[_0x6307('0x61')][_0x15392f];var _0x25ef48=_0x4920b6[_0x6307('0x71')]();_0x25ef48['where'](_0x6307('0x72'),_0xe67ad0['id']);_0x596994[_0x6307('0x73')](db[_0x6307('0x62')]['query'](_0x25ef48[_0x6307('0x74')](),{'type':db[_0x6307('0x62')][_0x6307('0x75')]['SELECT']})[_0x6307('0x25')](function(_0x33e401){if(_0x33e401[_0x6307('0x36')]===0x1){return _0xe67ad0['id'];}else{var _0x18e009=_[_0x6307('0x76')](_[_0x6307('0x3c')](_0x33e401,'TeamId'),function(_0xfd05d7){return _['includes'](_0x41fb05,_0xfd05d7);});if(_0x18e009){return _0xe67ad0['id'];}}}));}}return BPromise[_0x6307('0x77')](_0x596994)[_0x6307('0x25')](function(_0x4fc824){_0x3d4cea=_(_0x3d4cea)[_0x6307('0x78')](_0x4fc824)[_0x6307('0x79')]()[_0x6307('0x7a')]();return db[_0x6307('0x2b')][_0x6307('0x4d')]({'where':{'id':_0x16d415[_0x6307('0x4e')]['id']}})['then'](function(_0x549437){return db[_0x6307('0x62')]['transaction'](function(_0x52bb31){return _0x549437[_0x6307('0x69')](_0x16d415[_0x6307('0x31')][_0x6307('0x5c')],{'transaction':_0x52bb31})[_0x6307('0x25')](function(){if(!_[_0x6307('0x7b')](_0x3d4cea)){return _0x549437['removeAgents'](_0x3d4cea,{'transaction':_0x52bb31});}})[_0x6307('0x25')](function(){_0x3d4cea[_0x6307('0x67')](function(_0x40d524){socket[_0x6307('0x68')](_0x6307('0x7c'),{'UserId':_0x40d524,'FaxQueueId':_0x549437['id']});});});});});});})[_0x6307('0x25')](respondWithStatusCode(_0x35954c,null))[_0x6307('0x44')](handleError(_0x35954c,null));};exports['addAgents']=function(_0x52d2f2,_0x345f36,_0x4d9a69){return db[_0x6307('0x2b')][_0x6307('0x4d')]({'where':{'id':_0x52d2f2[_0x6307('0x4e')]['id']}})['then'](handleEntityNotFound(_0x345f36,null))['then'](function(_0x3e6982){if(_0x3e6982){return _0x3e6982[_0x6307('0x7d')](_0x52d2f2[_0x6307('0x48')][_0x6307('0x5c')],_[_0x6307('0x7e')](_0x52d2f2[_0x6307('0x48')],['ids','id'])||{})[_0x6307('0x7f')](function(_0x3a7533){for(var _0x26bd75=0x0;_0x26bd75<_0x52d2f2[_0x6307('0x48')][_0x6307('0x5c')][_0x6307('0x36')];_0x26bd75+=0x1){socket[_0x6307('0x68')](_0x6307('0x80'),{'UserId':Number(_0x52d2f2[_0x6307('0x48')]['ids'][_0x26bd75]),'FaxQueueId':Number(_0x52d2f2['params']['id'])});}return _0x3a7533;});}})['then'](respondWithResult(_0x345f36,null))[_0x6307('0x44')](handleError(_0x345f36,null));};exports[_0x6307('0x81')]=function(_0x214356,_0x7195e0,_0x38231d){return db[_0x6307('0x2b')][_0x6307('0x4d')]({'where':{'id':_0x214356[_0x6307('0x4e')]['id']}})[_0x6307('0x25')](handleEntityNotFound(_0x7195e0,null))[_0x6307('0x25')](function(_0x1c3670){if(_0x1c3670){return _0x1c3670[_0x6307('0x81')](_0x214356[_0x6307('0x31')]['ids'])[_0x6307('0x25')](function(){if(_[_0x6307('0x82')](_0x214356[_0x6307('0x31')][_0x6307('0x5c')])){for(var _0x1fd1c9=0x0;_0x1fd1c9<_0x214356['query'][_0x6307('0x5c')][_0x6307('0x36')];_0x1fd1c9+=0x1){socket[_0x6307('0x68')](_0x6307('0x7c'),{'UserId':Number(_0x214356['query']['ids'][_0x1fd1c9]),'FaxQueueId':Number(_0x214356[_0x6307('0x4e')]['id'])});}}else{socket[_0x6307('0x68')](_0x6307('0x7c'),{'UserId':Number(_0x214356[_0x6307('0x31')][_0x6307('0x5c')]),'FaxQueueId':Number(_0x214356[_0x6307('0x4e')]['id'])});}});}})[_0x6307('0x25')](respondWithStatusCode(_0x7195e0,null))[_0x6307('0x44')](handleError(_0x7195e0,null));};exports[_0x6307('0x83')]=function(_0x2c3921,_0x554e10,_0x20fbd2){var _0xef5dd9={};var _0x34099f={};var _0x24c408;var _0x1da7bf;return db[_0x6307('0x2b')][_0x6307('0x50')]({'where':{'id':_0x2c3921[_0x6307('0x4e')]['id']}})[_0x6307('0x25')](handleEntityNotFound(_0x554e10,null))[_0x6307('0x25')](function(_0x138f6c){if(_0x138f6c){_0x24c408=_0x138f6c;_0x34099f[_0x6307('0x30')]=_[_0x6307('0x46')](db['User'][_0x6307('0x2c')]);_0x34099f[_0x6307('0x31')]=_[_0x6307('0x46')](_0x2c3921[_0x6307('0x31')]);_0x34099f[_0x6307('0x32')]=_[_0x6307('0x33')](_0x34099f['model'],_0x34099f[_0x6307('0x31')]);_0xef5dd9['attributes']=_['intersection'](_0x34099f[_0x6307('0x30')],qs[_0x6307('0x34')](_0x2c3921[_0x6307('0x31')][_0x6307('0x34')]));_0xef5dd9[_0x6307('0x35')]=_0xef5dd9['attributes'][_0x6307('0x36')]?_0xef5dd9[_0x6307('0x35')]:_0x34099f[_0x6307('0x30')];_0xef5dd9[_0x6307('0x52')]=qs[_0x6307('0x39')](_0x2c3921[_0x6307('0x31')][_0x6307('0x39')]);_0xef5dd9[_0x6307('0x40')]=qs[_0x6307('0x32')](_['pick'](_0x2c3921[_0x6307('0x31')],_0x34099f[_0x6307('0x32')]));if(_0x2c3921['query'][_0x6307('0x3b')]){_0xef5dd9[_0x6307('0x40')]=_[_0x6307('0x3e')](_0xef5dd9[_0x6307('0x40')],{'$or':_[_0x6307('0x3c')](_0xef5dd9[_0x6307('0x35')],function(_0x4e4702){var _0xccf7c4={};_0xccf7c4[_0x4e4702]={'$like':'%'+_0x2c3921['query'][_0x6307('0x3b')]+'%'};return _0xccf7c4;})});}_0xef5dd9=_[_0x6307('0x3e')]({},_0xef5dd9,_0x2c3921[_0x6307('0x3f')]);return _0x24c408[_0x6307('0x83')](_0xef5dd9);}})[_0x6307('0x25')](function(_0x3f3b1f){if(_0x3f3b1f){_0x1da7bf=_0x3f3b1f['length'];if(!_0x2c3921[_0x6307('0x31')][_0x6307('0x37')](_0x6307('0x38'))){_0xef5dd9[_0x6307('0x20')]=qs[_0x6307('0x20')](_0x2c3921[_0x6307('0x31')][_0x6307('0x20')]);_0xef5dd9[_0x6307('0x22')]=qs['offset'](_0x2c3921[_0x6307('0x31')][_0x6307('0x22')]);}return _0x24c408[_0x6307('0x83')](_0xef5dd9);}})[_0x6307('0x25')](function(_0x1495d6){if(_0x1495d6){return _0x1495d6?{'count':_0x1da7bf,'rows':_0x1495d6}:null;}})['then'](respondWithResult(_0x554e10,null))[_0x6307('0x44')](handleError(_0x554e10,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4b5e370..f176fad 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 _0x9187=['update','remove','hook','events','FaxQueue','setMaxListeners','save'];(function(_0x910ad,_0x48e662){var _0x4006fe=function(_0x10ecc3){while(--_0x10ecc3){_0x910ad['push'](_0x910ad['shift']());}};_0x4006fe(++_0x48e662);}(_0x9187,0x16f));var _0x7918=function(_0x34342a,_0x3e16f5){_0x34342a=_0x34342a-0x0;var _0x427cdf=_0x9187[_0x34342a];return _0x427cdf;};'use strict';var EventEmitter=require(_0x7918('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x7918('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7918('0x2')](0x0);var events={'afterCreate':_0x7918('0x3'),'afterUpdate':_0x7918('0x4'),'afterDestroy':_0x7918('0x5')};function emitEvent(_0x2a26ba){return function(_0x771e4a,_0x4463ef,_0x38be66){FaxQueueEvents['emit'](_0x2a26ba+':'+_0x771e4a['id'],_0x771e4a);FaxQueueEvents['emit'](_0x2a26ba,_0x771e4a);_0x38be66(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x7918('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x407c=['save','update','remove','emit','hook','events','../../mysqldb'];(function(_0xbfb0aa,_0xac9967){var _0x13fc44=function(_0x5ba494){while(--_0x5ba494){_0xbfb0aa['push'](_0xbfb0aa['shift']());}};_0x13fc44(++_0xac9967);}(_0x407c,0x1e8));var _0xc407=function(_0x26ca0f,_0x45126b){_0x26ca0f=_0x26ca0f-0x0;var _0x5ba1c9=_0x407c[_0x26ca0f];return _0x5ba1c9;};'use strict';var EventEmitter=require(_0xc407('0x0'));var FaxQueue=require(_0xc407('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc407('0x2'),'afterUpdate':_0xc407('0x3'),'afterDestroy':_0xc407('0x4')};function emitEvent(_0x419ab8){return function(_0x28e151,_0x957013,_0x3928a9){FaxQueueEvents[_0xc407('0x5')](_0x419ab8+':'+_0x28e151['id'],_0x28e151);FaxQueueEvents['emit'](_0x419ab8,_0x28e151);_0x3928a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xc407('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index c006320..f13e998 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 _0x3855=['rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2b217b,_0x5ad5b3){var _0x538638=function(_0x102dde){while(--_0x102dde){_0x2b217b['push'](_0x2b217b['shift']());}};_0x538638(++_0x5ad5b3);}(_0x3855,0x88));var _0x5385=function(_0x408a7d,_0x22e424){_0x408a7d=_0x408a7d-0x0;var _0x2da444=_0x3855[_0x408a7d];return _0x2da444;};'use strict';var _=require(_0x5385('0x0'));var util=require(_0x5385('0x1'));var logger=require(_0x5385('0x2'))('api');var moment=require(_0x5385('0x3'));var BPromise=require(_0x5385('0x4'));var rp=require(_0x5385('0x5'));var fs=require('fs');var path=require(_0x5385('0x6'));var rimraf=require(_0x5385('0x7'));var config=require(_0x5385('0x8'));var attributes=require(_0x5385('0x9'));module['exports']=function(_0x132991,_0x3f1a78){return _0x132991[_0x5385('0xa')](_0x5385('0xb'),attributes,{'tableName':_0x5385('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc9d=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash'];(function(_0x4f87c4,_0x47c08e){var _0x8cf521=function(_0x439007){while(--_0x439007){_0x4f87c4['push'](_0x4f87c4['shift']());}};_0x8cf521(++_0x47c08e);}(_0xdc9d,0xe3));var _0xddc9=function(_0x4e7b55,_0x31d9ec){_0x4e7b55=_0x4e7b55-0x0;var _0x3176ba=_0xdc9d[_0x4e7b55];return _0x3176ba;};'use strict';var _=require(_0xddc9('0x0'));var util=require(_0xddc9('0x1'));var logger=require(_0xddc9('0x2'))('api');var moment=require(_0xddc9('0x3'));var BPromise=require(_0xddc9('0x4'));var rp=require(_0xddc9('0x5'));var fs=require('fs');var path=require(_0xddc9('0x6'));var rimraf=require('rimraf');var config=require(_0xddc9('0x7'));var attributes=require(_0xddc9('0x8'));module[_0xddc9('0x9')]=function(_0x2a2cf5,_0x476565){return _0x2a2cf5[_0xddc9('0xa')]('FaxQueue',attributes,{'tableName':_0xddc9('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 9efadc2..08617be 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 _0x6c5f=['message','info','result','catch','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','stringify','error','code','FaxQueue,\x20%s,\x20%s'];(function(_0x177e72,_0x28bf32){var _0x392698=function(_0x45a052){while(--_0x45a052){_0x177e72['push'](_0x177e72['shift']());}};_0x392698(++_0x28bf32);}(_0x6c5f,0xad));var _0xf6c5=function(_0x514e52,_0x5aded1){_0x514e52=_0x514e52-0x0;var _0x43b543=_0x6c5f[_0x514e52];return _0x43b543;};'use strict';var _=require(_0xf6c5('0x0'));var util=require(_0xf6c5('0x1'));var moment=require('moment');var BPromise=require(_0xf6c5('0x2'));var rs=require(_0xf6c5('0x3'));var fs=require('fs');var Redis=require(_0xf6c5('0x4'));var db=require(_0xf6c5('0x5'))['db'];var utils=require(_0xf6c5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf6c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6c5('0x8')][_0xf6c5('0x9')]({'port':0x232a});config['redis']=_[_0xf6c5('0xa')](config[_0xf6c5('0xb')],{'host':_0xf6c5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6c5('0xb')]));require('./faxQueue.socket')[_0xf6c5('0xd')](socket);function respondWithRpcPromise(_0x54a31f,_0x3cf068,_0x2b4fff){return new BPromise(function(_0x24842e,_0x5f252c){return client[_0xf6c5('0xe')](_0x54a31f,_0x2b4fff)[_0xf6c5('0xf')](function(_0x44c671){logger['info']('FaxQueue,\x20%s,\x20%s',_0x3cf068,_0xf6c5('0x10'));logger[_0xf6c5('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3cf068,_0xf6c5('0x10'),JSON[_0xf6c5('0x12')](_0x44c671));if(_0x44c671[_0xf6c5('0x13')]){if(_0x44c671['error'][_0xf6c5('0x14')]===0x1f4){logger[_0xf6c5('0x13')](_0xf6c5('0x15'),_0x3cf068,_0x44c671[_0xf6c5('0x13')][_0xf6c5('0x16')]);return _0x5f252c(_0x44c671['error'][_0xf6c5('0x16')]);}logger['error'](_0xf6c5('0x15'),_0x3cf068,_0x44c671[_0xf6c5('0x13')][_0xf6c5('0x16')]);return _0x24842e(_0x44c671[_0xf6c5('0x13')][_0xf6c5('0x16')]);}else{logger[_0xf6c5('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3cf068,_0xf6c5('0x10'));_0x24842e(_0x44c671[_0xf6c5('0x18')][_0xf6c5('0x16')]);}})[_0xf6c5('0x19')](function(_0x540752){logger[_0xf6c5('0x13')](_0xf6c5('0x15'),_0x3cf068,_0x540752);_0x5f252c(_0x540752);});});}exports['GetFaxQueue']=function(_0x3a9bc9){var _0x46ff77=this;return new Promise(function(_0x45813e,_0x5c02a2){return db[_0xf6c5('0x1a')][_0xf6c5('0x1b')]({'raw':_0x3a9bc9[_0xf6c5('0x1c')]?_0x3a9bc9[_0xf6c5('0x1c')][_0xf6c5('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a9bc9[_0xf6c5('0x1c')]?_0x3a9bc9[_0xf6c5('0x1c')]['where']||null:null,'attributes':_0x3a9bc9[_0xf6c5('0x1c')]?_0x3a9bc9['options'][_0xf6c5('0x1e')]||null:null,'limit':_0x3a9bc9[_0xf6c5('0x1c')]?_0x3a9bc9[_0xf6c5('0x1c')][_0xf6c5('0x1f')]||null:null,'include':_0x3a9bc9['options']?_0x3a9bc9[_0xf6c5('0x1c')][_0xf6c5('0x20')]?_[_0xf6c5('0x21')](_0x3a9bc9['options']['include'],function(_0xa2096d){return{'model':db[_0xa2096d[_0xf6c5('0x22')]],'as':_0xa2096d['as'],'attributes':_0xa2096d[_0xf6c5('0x1e')],'include':_0xa2096d[_0xf6c5('0x20')]?_[_0xf6c5('0x21')](_0xa2096d['include'],function(_0x51361e){return{'model':db[_0x51361e['model']],'as':_0x51361e['as'],'attributes':_0x51361e['attributes'],'include':_0x51361e['include']?_['map'](_0x51361e[_0xf6c5('0x20')],function(_0x2bd31d){return{'model':db[_0x2bd31d[_0xf6c5('0x22')]],'as':_0x2bd31d['as'],'attributes':_0x2bd31d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6c5('0xf')](function(_0x3d04d8){logger[_0xf6c5('0x17')]('GetFaxQueue',_0x3a9bc9);logger[_0xf6c5('0x11')]('GetFaxQueue',_0x3a9bc9,JSON[_0xf6c5('0x12')](_0x3d04d8));_0x45813e(_0x3d04d8);})[_0xf6c5('0x19')](function(_0x52268d){logger[_0xf6c5('0x13')](_0xf6c5('0x23'),_0x52268d[_0xf6c5('0x16')],_0x3a9bc9);_0x5c02a2(_0x46ff77[_0xf6c5('0x13')](0x1f4,_0x52268d[_0xf6c5('0x16')]));});});};exports[_0xf6c5('0x24')]=function(_0x4f7256){var _0x54a680=this;return new Promise(function(_0x38c1f8,_0x3aabb2){return db['FaxQueue'][_0xf6c5('0x25')]({'raw':_0x4f7256[_0xf6c5('0x1c')]?_0x4f7256[_0xf6c5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4f7256[_0xf6c5('0x1c')]?_0x4f7256[_0xf6c5('0x1c')][_0xf6c5('0x26')]||null:null,'attributes':_0x4f7256[_0xf6c5('0x1c')]?_0x4f7256[_0xf6c5('0x1c')][_0xf6c5('0x1e')]||null:null,'include':_0x4f7256[_0xf6c5('0x1c')]?_0x4f7256[_0xf6c5('0x1c')][_0xf6c5('0x20')]?_[_0xf6c5('0x21')](_0x4f7256[_0xf6c5('0x1c')][_0xf6c5('0x20')],function(_0x567cf1){return{'model':db[_0x567cf1[_0xf6c5('0x22')]],'as':_0x567cf1['as'],'attributes':_0x567cf1[_0xf6c5('0x1e')],'include':_0x567cf1[_0xf6c5('0x20')]?_['map'](_0x567cf1[_0xf6c5('0x20')],function(_0x2c38c9){return{'model':db[_0x2c38c9[_0xf6c5('0x22')]],'as':_0x2c38c9['as'],'attributes':_0x2c38c9[_0xf6c5('0x1e')],'include':_0x2c38c9[_0xf6c5('0x20')]?_[_0xf6c5('0x21')](_0x2c38c9[_0xf6c5('0x20')],function(_0x42f8c4){return{'model':db[_0x42f8c4[_0xf6c5('0x22')]],'as':_0x42f8c4['as'],'attributes':_0x42f8c4[_0xf6c5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf6c5('0xf')](function(_0xfa75fb){logger[_0xf6c5('0x17')](_0xf6c5('0x24'),_0x4f7256);logger[_0xf6c5('0x11')](_0xf6c5('0x24'),_0x4f7256,JSON[_0xf6c5('0x12')](_0xfa75fb));_0x38c1f8(_0xfa75fb);})[_0xf6c5('0x19')](function(_0x528a03){logger[_0xf6c5('0x13')](_0xf6c5('0x24'),_0x528a03[_0xf6c5('0x16')],_0x4f7256);_0x3aabb2(_0x54a680[_0xf6c5('0x13')](0x1f4,_0x528a03[_0xf6c5('0x16')]));});});}; \ No newline at end of file +var _0xa14f=['map','model','attributes','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include'];(function(_0x7741d3,_0x5db5d6){var _0x438d2d=function(_0x1ba703){while(--_0x1ba703){_0x7741d3['push'](_0x7741d3['shift']());}};_0x438d2d(++_0x5db5d6);}(_0xa14f,0x177));var _0xfa14=function(_0x5cd7a9,_0x1e74f8){_0x5cd7a9=_0x5cd7a9-0x0;var _0x1f4990=_0xa14f[_0x5cd7a9];return _0x1f4990;};'use strict';var _=require(_0xfa14('0x0'));var util=require('util');var moment=require(_0xfa14('0x1'));var BPromise=require(_0xfa14('0x2'));var rs=require(_0xfa14('0x3'));var fs=require('fs');var Redis=require(_0xfa14('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfa14('0x5'));var config=require('../../config/environment');var jayson=require(_0xfa14('0x6'));var client=jayson[_0xfa14('0x7')][_0xfa14('0x8')]({'port':0x232a});config[_0xfa14('0x9')]=_[_0xfa14('0xa')](config[_0xfa14('0x9')],{'host':_0xfa14('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfa14('0xc'))['register'](socket);function respondWithRpcPromise(_0x72f990,_0x9995f4,_0x3e9a39){return new BPromise(function(_0x5c9092,_0x3f5dd2){return client[_0xfa14('0xd')](_0x72f990,_0x3e9a39)[_0xfa14('0xe')](function(_0x1f9406){logger[_0xfa14('0xf')](_0xfa14('0x10'),_0x9995f4,'request\x20sent');logger[_0xfa14('0x11')](_0xfa14('0x12'),_0x9995f4,_0xfa14('0x13'),JSON[_0xfa14('0x14')](_0x1f9406));if(_0x1f9406[_0xfa14('0x15')]){if(_0x1f9406[_0xfa14('0x15')]['code']===0x1f4){logger[_0xfa14('0x15')](_0xfa14('0x10'),_0x9995f4,_0x1f9406[_0xfa14('0x15')][_0xfa14('0x16')]);return _0x3f5dd2(_0x1f9406[_0xfa14('0x15')]['message']);}logger[_0xfa14('0x15')](_0xfa14('0x10'),_0x9995f4,_0x1f9406['error']['message']);return _0x5c9092(_0x1f9406[_0xfa14('0x15')][_0xfa14('0x16')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x9995f4,_0xfa14('0x13'));_0x5c9092(_0x1f9406['result'][_0xfa14('0x16')]);}})[_0xfa14('0x17')](function(_0x31f34e){logger[_0xfa14('0x15')](_0xfa14('0x10'),_0x9995f4,_0x31f34e);_0x3f5dd2(_0x31f34e);});});}exports[_0xfa14('0x18')]=function(_0x3d4e22){var _0x2e0b58=this;return new Promise(function(_0x1e7b87,_0x101916){return db[_0xfa14('0x19')][_0xfa14('0x1a')]({'raw':_0x3d4e22[_0xfa14('0x1b')]?_0x3d4e22['options'][_0xfa14('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d4e22['options']?_0x3d4e22[_0xfa14('0x1b')][_0xfa14('0x1d')]||null:null,'attributes':_0x3d4e22[_0xfa14('0x1b')]?_0x3d4e22['options']['attributes']||null:null,'limit':_0x3d4e22['options']?_0x3d4e22[_0xfa14('0x1b')][_0xfa14('0x1e')]||null:null,'include':_0x3d4e22['options']?_0x3d4e22[_0xfa14('0x1b')][_0xfa14('0x1f')]?_[_0xfa14('0x20')](_0x3d4e22[_0xfa14('0x1b')]['include'],function(_0x24b894){return{'model':db[_0x24b894[_0xfa14('0x21')]],'as':_0x24b894['as'],'attributes':_0x24b894[_0xfa14('0x22')],'include':_0x24b894[_0xfa14('0x1f')]?_[_0xfa14('0x20')](_0x24b894[_0xfa14('0x1f')],function(_0x46c83c){return{'model':db[_0x46c83c[_0xfa14('0x21')]],'as':_0x46c83c['as'],'attributes':_0x46c83c['attributes'],'include':_0x46c83c[_0xfa14('0x1f')]?_['map'](_0x46c83c['include'],function(_0x379be4){return{'model':db[_0x379be4['model']],'as':_0x379be4['as'],'attributes':_0x379be4[_0xfa14('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfa14('0xe')](function(_0x45abd6){logger['info'](_0xfa14('0x18'),_0x3d4e22);logger['debug'](_0xfa14('0x18'),_0x3d4e22,JSON[_0xfa14('0x14')](_0x45abd6));_0x1e7b87(_0x45abd6);})['catch'](function(_0x4a03af){logger[_0xfa14('0x15')]('GetFaxQueue',_0x4a03af[_0xfa14('0x16')],_0x3d4e22);_0x101916(_0x2e0b58['error'](0x1f4,_0x4a03af[_0xfa14('0x16')]));});});};exports[_0xfa14('0x23')]=function(_0x355ab2){var _0x13c169=this;return new Promise(function(_0x411130,_0x3d5084){return db[_0xfa14('0x19')][_0xfa14('0x24')]({'raw':_0x355ab2[_0xfa14('0x1b')]?_0x355ab2[_0xfa14('0x1b')][_0xfa14('0x1c')]===undefined?!![]:![]:!![],'where':_0x355ab2[_0xfa14('0x1b')]?_0x355ab2[_0xfa14('0x1b')]['where']||null:null,'attributes':_0x355ab2[_0xfa14('0x1b')]?_0x355ab2[_0xfa14('0x1b')]['attributes']||null:null,'include':_0x355ab2['options']?_0x355ab2['options'][_0xfa14('0x1f')]?_[_0xfa14('0x20')](_0x355ab2['options'][_0xfa14('0x1f')],function(_0x448b3f){return{'model':db[_0x448b3f[_0xfa14('0x21')]],'as':_0x448b3f['as'],'attributes':_0x448b3f[_0xfa14('0x22')],'include':_0x448b3f[_0xfa14('0x1f')]?_[_0xfa14('0x20')](_0x448b3f[_0xfa14('0x1f')],function(_0x5bfacf){return{'model':db[_0x5bfacf['model']],'as':_0x5bfacf['as'],'attributes':_0x5bfacf['attributes'],'include':_0x5bfacf[_0xfa14('0x1f')]?_['map'](_0x5bfacf['include'],function(_0x23c1a5){return{'model':db[_0x23c1a5[_0xfa14('0x21')]],'as':_0x23c1a5['as'],'attributes':_0x23c1a5['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa14('0xe')](function(_0x5da6df){logger[_0xfa14('0xf')](_0xfa14('0x23'),_0x355ab2);logger['debug']('ShowFaxQueue',_0x355ab2,JSON['stringify'](_0x5da6df));_0x411130(_0x5da6df);})['catch'](function(_0x416469){logger[_0xfa14('0x15')](_0xfa14('0x23'),_0x416469[_0xfa14('0x16')],_0x355ab2);_0x3d5084(_0x13c169[_0xfa14('0x15')](0x1f4,_0x416469['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 70411dd..61d6c04 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 _0xa6db=['length','faxQueue:','./faxQueue.events','save','remove','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6db,0x104));var _0xba6d=function(_0x331c23,_0x4cb3ff){_0x331c23=_0x331c23-0x0;var _0x824184=_0xa6db[_0x331c23];return _0x824184;};'use strict';var FaxQueueEvents=require(_0xba6d('0x0'));var events=[_0xba6d('0x1'),_0xba6d('0x2'),'update'];function createListener(_0x189207,_0x1f07fc){return function(_0xbaafd2){_0x1f07fc['emit'](_0x189207,_0xbaafd2);};}function removeListener(_0x42644c,_0x524d13){return function(){FaxQueueEvents[_0xba6d('0x3')](_0x42644c,_0x524d13);};}exports['register']=function(_0x29f622){for(var _0x4fa6ec=0x0,_0x6c4d7f=events[_0xba6d('0x4')];_0x4fa6ec<_0x6c4d7f;_0x4fa6ec++){var _0x3bbee7=events[_0x4fa6ec];var _0x151e2f=createListener(_0xba6d('0x5')+_0x3bbee7,_0x29f622);FaxQueueEvents['on'](_0x3bbee7,_0x151e2f);}}; \ No newline at end of file +var _0xf408=['./faxQueue.events','save','remove','update','removeListener','register','length'];(function(_0x3ce94d,_0x331820){var _0x2c627a=function(_0x5c04ac){while(--_0x5c04ac){_0x3ce94d['push'](_0x3ce94d['shift']());}};_0x2c627a(++_0x331820);}(_0xf408,0x1ce));var _0x8f40=function(_0x9166ea,_0x1f21b0){_0x9166ea=_0x9166ea-0x0;var _0xdceec9=_0xf408[_0x9166ea];return _0xdceec9;};'use strict';var FaxQueueEvents=require(_0x8f40('0x0'));var events=[_0x8f40('0x1'),_0x8f40('0x2'),_0x8f40('0x3')];function createListener(_0x20189d,_0x4be15b){return function(_0x28196c){_0x4be15b['emit'](_0x20189d,_0x28196c);};}function removeListener(_0x27234e,_0x5d32ca){return function(){FaxQueueEvents[_0x8f40('0x4')](_0x27234e,_0x5d32ca);};}exports[_0x8f40('0x5')]=function(_0x188f74){for(var _0x41c946=0x0,_0x1ab48a=events[_0x8f40('0x6')];_0x41c946<_0x1ab48a;_0x41c946++){var _0x53dc84=events[_0x41c946];var _0xbf957a=createListener('faxQueue:'+_0x53dc84,_0x188f74);FaxQueueEvents['on'](_0x53dc84,_0xbf957a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 997df76..0bc6ea6 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 _0xc9c3=['/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','/:id/teams','removeTeams','removeAgents','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','/describe','isAuthenticated','describe'];(function(_0x4f9c06,_0x22f774){var _0x28641e=function(_0x2fa6a3){while(--_0x2fa6a3){_0x4f9c06['push'](_0x4f9c06['shift']());}};_0x28641e(++_0x22f774);}(_0xc9c3,0x96));var _0x3c9c=function(_0x3c848e,_0x56c165){_0x3c848e=_0x3c848e-0x0;var _0x126db0=_0xc9c3[_0x3c848e];return _0x126db0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x3c9c('0x1'));var router=express[_0x3c9c('0x2')]();var fs_extra=require(_0x3c9c('0x3'));var auth=require(_0x3c9c('0x4'));var interaction=require(_0x3c9c('0x5'));var config=require(_0x3c9c('0x6'));var controller=require(_0x3c9c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3c9c('0x8')](_0x3c9c('0x9'),auth[_0x3c9c('0xa')](),controller[_0x3c9c('0xb')]);router[_0x3c9c('0x8')](_0x3c9c('0xc'),auth[_0x3c9c('0xa')](),controller[_0x3c9c('0xd')]);router[_0x3c9c('0x8')](_0x3c9c('0xe'),auth['isAuthenticated'](),controller[_0x3c9c('0xf')]);router[_0x3c9c('0x8')]('/:id/teams',auth[_0x3c9c('0xa')](),controller['getTeams']);router[_0x3c9c('0x8')](_0x3c9c('0x10'),auth[_0x3c9c('0xa')](),controller[_0x3c9c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3c9c('0x12')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x3c9c('0x12')]('/:id/users',auth[_0x3c9c('0xa')](),controller[_0x3c9c('0x13')]);router[_0x3c9c('0x14')](_0x3c9c('0xc'),auth['isAuthenticated'](),controller[_0x3c9c('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3c9c('0x16')]);router[_0x3c9c('0x17')](_0x3c9c('0x18'),auth[_0x3c9c('0xa')](),controller[_0x3c9c('0x19')]);router[_0x3c9c('0x17')](_0x3c9c('0x10'),auth['isAuthenticated'](),controller[_0x3c9c('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb145=['addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users'];(function(_0x2c7740,_0x540c3f){var _0x141372=function(_0x5e8d77){while(--_0x5e8d77){_0x2c7740['push'](_0x2c7740['shift']());}};_0x141372(++_0x540c3f);}(_0xb145,0xa3));var _0x5b14=function(_0x3f3348,_0x3d76cd){_0x3f3348=_0x3f3348-0x0;var _0x3804a0=_0xb145[_0x3f3348];return _0x3804a0;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x9')]('/:id/members',auth[_0x5b14('0xa')](),controller[_0x5b14('0x10')]);router[_0x5b14('0x9')](_0x5b14('0x11'),auth[_0x5b14('0xa')](),controller['getTeams']);router[_0x5b14('0x9')]('/:id/users',auth[_0x5b14('0xa')](),controller[_0x5b14('0x12')]);router[_0x5b14('0x13')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0x14')]);router[_0x5b14('0x13')]('/:id/teams',auth[_0x5b14('0xa')](),controller[_0x5b14('0x15')]);router[_0x5b14('0x13')](_0x5b14('0x16'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x17')]);router[_0x5b14('0x18')](_0x5b14('0xe'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x19')]);router[_0x5b14('0x1a')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0x1b')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x5b14('0x1c')]);router[_0x5b14('0x1a')](_0x5b14('0x16'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x1d')]);module[_0x5b14('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index de2d517..26e5346 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 _0x5489=['DATE','moment','sequelize','exports','STRING'];(function(_0x4355ba,_0x2e6542){var _0x5ac1a=function(_0x2d650a){while(--_0x2d650a){_0x4355ba['push'](_0x4355ba['shift']());}};_0x5ac1a(++_0x2e6542);}(_0x5489,0x10a));var _0x9548=function(_0x58adea,_0x99c006){_0x58adea=_0x58adea-0x0;var _0x481de4=_0x5489[_0x58adea];return _0x481de4;};'use strict';var moment=require(_0x9548('0x0'));var Sequelize=require(_0x9548('0x1'));module[_0x9548('0x2')]={'uniqueid':{'type':Sequelize[_0x9548('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9548('0x3')]},'joinAt':{'type':Sequelize[_0x9548('0x4')]},'leaveAt':{'type':Sequelize[_0x9548('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9548('0x4')]},'reason':{'type':Sequelize[_0x9548('0x3')]}}; \ No newline at end of file +var _0x231c=['exports','STRING','DATE','moment','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x231c,0x134));var _0xc231=function(_0x5f2f84,_0x443244){_0x5f2f84=_0x5f2f84-0x0;var _0x48965b=_0x231c[_0x5f2f84];return _0x48965b;};'use strict';var moment=require(_0xc231('0x0'));var Sequelize=require(_0xc231('0x1'));module[_0xc231('0x2')]={'uniqueid':{'type':Sequelize[_0xc231('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc231('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc231('0x4')]},'exitAt':{'type':Sequelize[_0xc231('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 b00bcf7..9f5eb30 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 _0x0aaf=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','model','query'];(function(_0x2eeef6,_0x405192){var _0x581402=function(_0x4bb348){while(--_0x4bb348){_0x2eeef6['push'](_0x2eeef6['shift']());}};_0x581402(++_0x405192);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x5c4a87,_0x35cd28){_0x5c4a87=_0x5c4a87-0x0;var _0x1a8c55=_0x0aaf[_0x5c4a87];return _0x1a8c55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0aa('0x0'));var jsonpatch=require(_0xf0aa('0x1'));var rp=require(_0xf0aa('0x2'));var moment=require(_0xf0aa('0x3'));var BPromise=require(_0xf0aa('0x4'));var Mustache=require('mustache');var util=require(_0xf0aa('0x5'));var path=require(_0xf0aa('0x6'));var sox=require('sox');var csv=require(_0xf0aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0aa('0x8'));var _=require('lodash');var squel=require(_0xf0aa('0x9'));var crypto=require(_0xf0aa('0xa'));var jsforce=require(_0xf0aa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf0aa('0x7'));var querystring=require(_0xf0aa('0xc'));var Papa=require('papaparse');var Redis=require(_0xf0aa('0xd'));var authService=require(_0xf0aa('0xe'));var qs=require(_0xf0aa('0xf'));var as=require(_0xf0aa('0x10'));var hardwareService=require(_0xf0aa('0x11'));var logger=require(_0xf0aa('0x12'))(_0xf0aa('0x13'));var utils=require(_0xf0aa('0x14'));var config=require(_0xf0aa('0x15'));var licenseUtil=require(_0xf0aa('0x16'));var db=require(_0xf0aa('0x17'))['db'];function respondWithStatusCode(_0x40b5be,_0x47961e){_0x47961e=_0x47961e||0xcc;return function(_0x4f8622){if(_0x4f8622){return _0x40b5be[_0xf0aa('0x18')](_0x47961e);}return _0x40b5be[_0xf0aa('0x19')](_0x47961e)['end']();};}function respondWithResult(_0x4dc456,_0x37a6ac){_0x37a6ac=_0x37a6ac||0xc8;return function(_0x51bb2c){if(_0x51bb2c){return _0x4dc456[_0xf0aa('0x19')](_0x37a6ac)['json'](_0x51bb2c);}};}function respondWithFilteredResult(_0x22bb2e,_0x4b6219){return function(_0x3fb1fe){if(_0x3fb1fe){var _0x114c96=typeof _0x4b6219[_0xf0aa('0x1a')]===_0xf0aa('0x1b')&&typeof _0x4b6219[_0xf0aa('0x1c')]===_0xf0aa('0x1b');var _0x34e6f7=_0x3fb1fe[_0xf0aa('0x1d')];var _0x4e3fe6=_0x114c96?0x0:_0x4b6219[_0xf0aa('0x1a')];var _0x30f055=_0x114c96?_0x3fb1fe['count']:_0x4b6219[_0xf0aa('0x1a')]+_0x4b6219[_0xf0aa('0x1c')];var _0x35f407;if(_0x30f055>=_0x34e6f7){_0x30f055=_0x34e6f7;_0x35f407=0xc8;}else{_0x35f407=0xce;}_0x22bb2e[_0xf0aa('0x19')](_0x35f407);return _0x22bb2e[_0xf0aa('0x1e')](_0xf0aa('0x1f'),_0x4e3fe6+'-'+_0x30f055+'/'+_0x34e6f7)['json'](_0x3fb1fe);}return null;};}function patchUpdates(_0x112980){return function(_0x227cba){try{jsonpatch[_0xf0aa('0x20')](_0x227cba,_0x112980,!![]);}catch(_0x388893){return BPromise[_0xf0aa('0x21')](_0x388893);}return _0x227cba[_0xf0aa('0x22')]();};}function saveUpdates(_0x49e9fc,_0x5e2470){return function(_0x4c6f86){if(_0x4c6f86){return _0x4c6f86[_0xf0aa('0x23')](_0x49e9fc)['then'](function(_0xc4e56c){return _0xc4e56c;});}return null;};}function removeEntity(_0x245e0c,_0x40cbbb){return function(_0x2983ee){if(_0x2983ee){return _0x2983ee[_0xf0aa('0x24')]()[_0xf0aa('0x25')](function(){_0x245e0c[_0xf0aa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169a07,_0x3c21fc){return function(_0x44a7bf){if(!_0x44a7bf){_0x169a07[_0xf0aa('0x18')](0x194);}return _0x44a7bf;};}function handleError(_0x74188d,_0x1dc140){_0x1dc140=_0x1dc140||0x1f4;return function(_0x17b7f6){logger[_0xf0aa('0x26')](_0x17b7f6['stack']);if(_0x17b7f6['name']){delete _0x17b7f6[_0xf0aa('0x27')];}_0x74188d['status'](_0x1dc140)[_0xf0aa('0x28')](_0x17b7f6);};}exports['index']=function(_0x403ac2,_0x381179){var _0x4d2c9b={},_0x56b555={},_0x3b99ea={'count':0x0,'rows':[]};var _0x132950=_[_0xf0aa('0x29')](db[_0xf0aa('0x2a')][_0xf0aa('0x2b')],function(_0x3f51cd){return{'name':_0x3f51cd[_0xf0aa('0x2c')],'type':_0x3f51cd[_0xf0aa('0x2d')]['key']};});_0x56b555[_0xf0aa('0x2e')]=_[_0xf0aa('0x29')](_0x132950,'name');_0x56b555['query']=_['keys'](_0x403ac2[_0xf0aa('0x2f')]);_0x56b555[_0xf0aa('0x30')]=_['intersection'](_0x56b555[_0xf0aa('0x2e')],_0x56b555['query']);_0x4d2c9b['attributes']=_[_0xf0aa('0x31')](_0x56b555[_0xf0aa('0x2e')],qs['fields'](_0x403ac2[_0xf0aa('0x2f')][_0xf0aa('0x32')]));_0x4d2c9b['attributes']=_0x4d2c9b[_0xf0aa('0x33')][_0xf0aa('0x34')]?_0x4d2c9b[_0xf0aa('0x33')]:_0x56b555[_0xf0aa('0x2e')];if(!_0x403ac2[_0xf0aa('0x2f')][_0xf0aa('0x35')](_0xf0aa('0x36'))){_0x4d2c9b['limit']=qs[_0xf0aa('0x1c')](_0x403ac2['query'][_0xf0aa('0x1c')]);_0x4d2c9b[_0xf0aa('0x1a')]=qs[_0xf0aa('0x1a')](_0x403ac2[_0xf0aa('0x2f')]['offset']);}_0x4d2c9b[_0xf0aa('0x37')]=qs['sort'](_0x403ac2[_0xf0aa('0x2f')][_0xf0aa('0x38')]);_0x4d2c9b[_0xf0aa('0x39')]=qs[_0xf0aa('0x30')](_[_0xf0aa('0x3a')](_0x403ac2[_0xf0aa('0x2f')],_0x56b555[_0xf0aa('0x30')]),_0x132950);if(_0x403ac2['query'][_0xf0aa('0x3b')]){_0x4d2c9b[_0xf0aa('0x39')]=_[_0xf0aa('0x3c')](_0x4d2c9b[_0xf0aa('0x39')],{'$or':_['map'](_0x132950,function(_0x5e11ac){if(_0x5e11ac[_0xf0aa('0x2d')]!==_0xf0aa('0x3d')){var _0x493ed1={};_0x493ed1[_0x5e11ac[_0xf0aa('0x27')]]={'$like':'%'+_0x403ac2[_0xf0aa('0x2f')][_0xf0aa('0x3b')]+'%'};return _0x493ed1;}})});}_0x4d2c9b=_[_0xf0aa('0x3c')]({},_0x4d2c9b,_0x403ac2[_0xf0aa('0x3e')]);var _0x410163={'where':_0x4d2c9b[_0xf0aa('0x39')]};return db[_0xf0aa('0x2a')][_0xf0aa('0x1d')](_0x410163)[_0xf0aa('0x25')](function(_0x26d923){_0x3b99ea[_0xf0aa('0x1d')]=_0x26d923;if(_0x403ac2[_0xf0aa('0x2f')][_0xf0aa('0x3f')]){_0x4d2c9b['include']=[{'all':!![]}];}return db[_0xf0aa('0x2a')]['findAll'](_0x4d2c9b);})['then'](function(_0x2d239d){_0x3b99ea[_0xf0aa('0x40')]=_0x2d239d;return _0x3b99ea;})['then'](respondWithFilteredResult(_0x381179,_0x4d2c9b))[_0xf0aa('0x41')](handleError(_0x381179,null));};exports['show']=function(_0x22d3a6,_0x451eca){var _0x48046c={'raw':!![],'where':{'id':_0x22d3a6[_0xf0aa('0x42')]['id']}},_0x8579d1={};_0x8579d1['model']=_[_0xf0aa('0x43')](db[_0xf0aa('0x2a')][_0xf0aa('0x2b')]);_0x8579d1[_0xf0aa('0x2f')]=_[_0xf0aa('0x43')](_0x22d3a6[_0xf0aa('0x2f')]);_0x8579d1['filters']=_[_0xf0aa('0x31')](_0x8579d1['model'],_0x8579d1[_0xf0aa('0x2f')]);_0x48046c[_0xf0aa('0x33')]=_['intersection'](_0x8579d1[_0xf0aa('0x2e')],qs[_0xf0aa('0x32')](_0x22d3a6[_0xf0aa('0x2f')][_0xf0aa('0x32')]));_0x48046c[_0xf0aa('0x33')]=_0x48046c[_0xf0aa('0x33')][_0xf0aa('0x34')]?_0x48046c['attributes']:_0x8579d1[_0xf0aa('0x2e')];if(_0x22d3a6[_0xf0aa('0x2f')][_0xf0aa('0x3f')]){_0x48046c['include']=[{'all':!![]}];}_0x48046c=_[_0xf0aa('0x3c')]({},_0x48046c,_0x22d3a6[_0xf0aa('0x3e')]);return db['FaxQueueReport'][_0xf0aa('0x44')](_0x48046c)[_0xf0aa('0x25')](handleEntityNotFound(_0x451eca,null))['then'](respondWithResult(_0x451eca,null))[_0xf0aa('0x41')](handleError(_0x451eca,null));};exports[_0xf0aa('0x45')]=function(_0x13f29e,_0xf6dc5b){return db[_0xf0aa('0x2a')][_0xf0aa('0x45')](_0x13f29e[_0xf0aa('0x46')],{})['then'](respondWithResult(_0xf6dc5b,0xc9))[_0xf0aa('0x41')](handleError(_0xf6dc5b,null));};exports[_0xf0aa('0x23')]=function(_0x3a0811,_0x193c12){if(_0x3a0811[_0xf0aa('0x46')]['id']){delete _0x3a0811[_0xf0aa('0x46')]['id'];}return db[_0xf0aa('0x2a')][_0xf0aa('0x44')]({'where':{'id':_0x3a0811[_0xf0aa('0x42')]['id']}})[_0xf0aa('0x25')](handleEntityNotFound(_0x193c12,null))['then'](saveUpdates(_0x3a0811[_0xf0aa('0x46')],null))[_0xf0aa('0x25')](respondWithResult(_0x193c12,null))[_0xf0aa('0x41')](handleError(_0x193c12,null));};exports[_0xf0aa('0x24')]=function(_0x3bf4fb,_0x508df5){return db[_0xf0aa('0x2a')][_0xf0aa('0x44')]({'where':{'id':_0x3bf4fb['params']['id']}})[_0xf0aa('0x25')](handleEntityNotFound(_0x508df5,null))[_0xf0aa('0x25')](removeEntity(_0x508df5,null))[_0xf0aa('0x41')](handleError(_0x508df5,null));};exports[_0xf0aa('0x47')]=function(_0x4c82bc,_0x5cd52b){return db[_0xf0aa('0x2a')][_0xf0aa('0x47')]()[_0xf0aa('0x25')](respondWithResult(_0x5cd52b,null))[_0xf0aa('0x41')](handleError(_0x5cd52b,null));}; \ No newline at end of file +var _0x93e7=['rows','catch','show','params','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','count','includeAll','include','findAll'];(function(_0x395a10,_0x44191f){var _0x120b46=function(_0x221005){while(--_0x221005){_0x395a10['push'](_0x395a10['shift']());}};_0x120b46(++_0x44191f);}(_0x93e7,0x9e));var _0x793e=function(_0x18baf4,_0x33086b){_0x18baf4=_0x18baf4-0x0;var _0x278ed1=_0x93e7[_0x18baf4];return _0x278ed1;};'use strict';var emlformat=require(_0x793e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x793e('0x1'));var jsonpatch=require(_0x793e('0x2'));var rp=require('request-promise');var moment=require(_0x793e('0x3'));var BPromise=require(_0x793e('0x4'));var Mustache=require(_0x793e('0x5'));var util=require(_0x793e('0x6'));var path=require('path');var sox=require(_0x793e('0x7'));var csv=require('to-csv');var ejs=require(_0x793e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x793e('0x9'));var squel=require('squel');var crypto=require(_0x793e('0xa'));var jsforce=require(_0x793e('0xb'));var deskjs=require(_0x793e('0xc'));var toCsv=require(_0x793e('0xd'));var querystring=require(_0x793e('0xe'));var Papa=require(_0x793e('0xf'));var Redis=require(_0x793e('0x10'));var authService=require(_0x793e('0x11'));var qs=require(_0x793e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x793e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x793e('0x14'));var db=require(_0x793e('0x15'))['db'];function respondWithStatusCode(_0x57709f,_0x6a5f34){_0x6a5f34=_0x6a5f34||0xcc;return function(_0x2e2efe){if(_0x2e2efe){return _0x57709f[_0x793e('0x16')](_0x6a5f34);}return _0x57709f[_0x793e('0x17')](_0x6a5f34)[_0x793e('0x18')]();};}function respondWithResult(_0x410914,_0x1c7c58){_0x1c7c58=_0x1c7c58||0xc8;return function(_0x3a0952){if(_0x3a0952){return _0x410914[_0x793e('0x17')](_0x1c7c58)[_0x793e('0x19')](_0x3a0952);}};}function respondWithFilteredResult(_0x1121e5,_0x36686c){return function(_0x418b5f){if(_0x418b5f){var _0x18990a=typeof _0x36686c[_0x793e('0x1a')]===_0x793e('0x1b')&&typeof _0x36686c[_0x793e('0x1c')]===_0x793e('0x1b');var _0xeacea6=_0x418b5f['count'];var _0x3b38ef=_0x18990a?0x0:_0x36686c[_0x793e('0x1a')];var _0x4ba056=_0x18990a?_0x418b5f['count']:_0x36686c['offset']+_0x36686c[_0x793e('0x1c')];var _0x2f0494;if(_0x4ba056>=_0xeacea6){_0x4ba056=_0xeacea6;_0x2f0494=0xc8;}else{_0x2f0494=0xce;}_0x1121e5[_0x793e('0x17')](_0x2f0494);return _0x1121e5[_0x793e('0x1d')](_0x793e('0x1e'),_0x3b38ef+'-'+_0x4ba056+'/'+_0xeacea6)[_0x793e('0x19')](_0x418b5f);}return null;};}function patchUpdates(_0x1af167){return function(_0x9413f9){try{jsonpatch[_0x793e('0x1f')](_0x9413f9,_0x1af167,!![]);}catch(_0x31413a){return BPromise[_0x793e('0x20')](_0x31413a);}return _0x9413f9[_0x793e('0x21')]();};}function saveUpdates(_0x1596bf,_0xed37e){return function(_0x33fe28){if(_0x33fe28){return _0x33fe28[_0x793e('0x22')](_0x1596bf)[_0x793e('0x23')](function(_0x4be20c){return _0x4be20c;});}return null;};}function removeEntity(_0x59a4ff,_0xc259c8){return function(_0x36840f){if(_0x36840f){return _0x36840f['destroy']()[_0x793e('0x23')](function(){_0x59a4ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b37a,_0x59b191){return function(_0x5203aa){if(!_0x5203aa){_0x55b37a[_0x793e('0x16')](0x194);}return _0x5203aa;};}function handleError(_0x74048a,_0x4c7816){_0x4c7816=_0x4c7816||0x1f4;return function(_0x361a87){logger[_0x793e('0x24')](_0x361a87[_0x793e('0x25')]);if(_0x361a87[_0x793e('0x26')]){delete _0x361a87[_0x793e('0x26')];}_0x74048a[_0x793e('0x17')](_0x4c7816)[_0x793e('0x27')](_0x361a87);};}exports[_0x793e('0x28')]=function(_0x597c7d,_0xfe7fb9){var _0x48edff={},_0x4a45ae={},_0x530316={'count':0x0,'rows':[]};var _0xeb38af=_['map'](db[_0x793e('0x29')]['rawAttributes'],function(_0x2bebef){return{'name':_0x2bebef[_0x793e('0x2a')],'type':_0x2bebef['type']['key']};});_0x4a45ae[_0x793e('0x2b')]=_['map'](_0xeb38af,_0x793e('0x26'));_0x4a45ae[_0x793e('0x2c')]=_[_0x793e('0x2d')](_0x597c7d['query']);_0x4a45ae[_0x793e('0x2e')]=_[_0x793e('0x2f')](_0x4a45ae[_0x793e('0x2b')],_0x4a45ae[_0x793e('0x2c')]);_0x48edff[_0x793e('0x30')]=_['intersection'](_0x4a45ae[_0x793e('0x2b')],qs[_0x793e('0x31')](_0x597c7d[_0x793e('0x2c')][_0x793e('0x31')]));_0x48edff['attributes']=_0x48edff[_0x793e('0x30')][_0x793e('0x32')]?_0x48edff[_0x793e('0x30')]:_0x4a45ae[_0x793e('0x2b')];if(!_0x597c7d[_0x793e('0x2c')]['hasOwnProperty'](_0x793e('0x33'))){_0x48edff[_0x793e('0x1c')]=qs[_0x793e('0x1c')](_0x597c7d[_0x793e('0x2c')][_0x793e('0x1c')]);_0x48edff[_0x793e('0x1a')]=qs[_0x793e('0x1a')](_0x597c7d[_0x793e('0x2c')]['offset']);}_0x48edff[_0x793e('0x34')]=qs[_0x793e('0x35')](_0x597c7d[_0x793e('0x2c')][_0x793e('0x35')]);_0x48edff[_0x793e('0x36')]=qs[_0x793e('0x2e')](_['pick'](_0x597c7d[_0x793e('0x2c')],_0x4a45ae[_0x793e('0x2e')]),_0xeb38af);if(_0x597c7d[_0x793e('0x2c')][_0x793e('0x37')]){_0x48edff[_0x793e('0x36')]=_[_0x793e('0x38')](_0x48edff[_0x793e('0x36')],{'$or':_[_0x793e('0x39')](_0xeb38af,function(_0x57fdec){if(_0x57fdec[_0x793e('0x3a')]!==_0x793e('0x3b')){var _0x397af4={};_0x397af4[_0x57fdec[_0x793e('0x26')]]={'$like':'%'+_0x597c7d[_0x793e('0x2c')][_0x793e('0x37')]+'%'};return _0x397af4;}})});}_0x48edff=_['merge']({},_0x48edff,_0x597c7d['options']);var _0x2d4037={'where':_0x48edff[_0x793e('0x36')]};return db[_0x793e('0x29')][_0x793e('0x3c')](_0x2d4037)[_0x793e('0x23')](function(_0x28343b){_0x530316[_0x793e('0x3c')]=_0x28343b;if(_0x597c7d[_0x793e('0x2c')][_0x793e('0x3d')]){_0x48edff[_0x793e('0x3e')]=[{'all':!![]}];}return db[_0x793e('0x29')][_0x793e('0x3f')](_0x48edff);})[_0x793e('0x23')](function(_0x1f3059){_0x530316[_0x793e('0x40')]=_0x1f3059;return _0x530316;})[_0x793e('0x23')](respondWithFilteredResult(_0xfe7fb9,_0x48edff))[_0x793e('0x41')](handleError(_0xfe7fb9,null));};exports[_0x793e('0x42')]=function(_0x1bec3d,_0xd0a349){var _0x10f99e={'raw':!![],'where':{'id':_0x1bec3d[_0x793e('0x43')]['id']}},_0x42883d={};_0x42883d[_0x793e('0x2b')]=_['keys'](db[_0x793e('0x29')]['rawAttributes']);_0x42883d['query']=_[_0x793e('0x2d')](_0x1bec3d[_0x793e('0x2c')]);_0x42883d[_0x793e('0x2e')]=_[_0x793e('0x2f')](_0x42883d[_0x793e('0x2b')],_0x42883d[_0x793e('0x2c')]);_0x10f99e[_0x793e('0x30')]=_[_0x793e('0x2f')](_0x42883d[_0x793e('0x2b')],qs['fields'](_0x1bec3d['query'][_0x793e('0x31')]));_0x10f99e[_0x793e('0x30')]=_0x10f99e[_0x793e('0x30')][_0x793e('0x32')]?_0x10f99e['attributes']:_0x42883d[_0x793e('0x2b')];if(_0x1bec3d[_0x793e('0x2c')][_0x793e('0x3d')]){_0x10f99e[_0x793e('0x3e')]=[{'all':!![]}];}_0x10f99e=_['merge']({},_0x10f99e,_0x1bec3d[_0x793e('0x44')]);return db[_0x793e('0x29')][_0x793e('0x45')](_0x10f99e)[_0x793e('0x23')](handleEntityNotFound(_0xd0a349,null))[_0x793e('0x23')](respondWithResult(_0xd0a349,null))['catch'](handleError(_0xd0a349,null));};exports['create']=function(_0x5cb3a8,_0x494921){return db[_0x793e('0x29')][_0x793e('0x46')](_0x5cb3a8[_0x793e('0x47')],{})[_0x793e('0x23')](respondWithResult(_0x494921,0xc9))['catch'](handleError(_0x494921,null));};exports[_0x793e('0x22')]=function(_0x794076,_0x112645){if(_0x794076['body']['id']){delete _0x794076[_0x793e('0x47')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x794076[_0x793e('0x43')]['id']}})[_0x793e('0x23')](handleEntityNotFound(_0x112645,null))[_0x793e('0x23')](saveUpdates(_0x794076[_0x793e('0x47')],null))['then'](respondWithResult(_0x112645,null))[_0x793e('0x41')](handleError(_0x112645,null));};exports[_0x793e('0x48')]=function(_0x1e1b94,_0x363bf0){return db['FaxQueueReport']['find']({'where':{'id':_0x1e1b94['params']['id']}})[_0x793e('0x23')](handleEntityNotFound(_0x363bf0,null))[_0x793e('0x23')](removeEntity(_0x363bf0,null))[_0x793e('0x41')](handleError(_0x363bf0,null));};exports['describe']=function(_0x40163e,_0x47b465){return db['FaxQueueReport'][_0x793e('0x49')]()[_0x793e('0x23')](respondWithResult(_0x47b465,null))[_0x793e('0x41')](handleError(_0x47b465,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c6dc394..dc49007 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x132efa,_0xba4891){var _0x2b46d0=function(_0x58fa6e){while(--_0x58fa6e){_0x132efa['push'](_0x132efa['shift']());}};_0x2b46d0(++_0xba4891);}(_0xabce,0x103));var _0xeabc=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xabce[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x1cb9,0x14e));var _0x91cb=function(_0xf2d192,_0x56a932){_0xf2d192=_0xf2d192-0x0;var _0x43fd3b=_0x1cb9[_0xf2d192];return _0x43fd3b;};'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_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 18f3d17..8a0e1c7 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 _0x48c9=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','where','attributes','limit','UpdateFaxQueueReport','util','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x2dd6b1,_0x4485d7){var _0x494306=function(_0x46d23d){while(--_0x46d23d){_0x2dd6b1['push'](_0x2dd6b1['shift']());}};_0x494306(++_0x4485d7);}(_0x48c9,0x1e3));var _0x948c=function(_0x2bb3c2,_0x58aa3a){_0x2bb3c2=_0x2bb3c2-0x0;var _0x269cdd=_0x48c9[_0x2bb3c2];return _0x269cdd;};'use strict';var _=require('lodash');var util=require(_0x948c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x948c('0x1'));var db=require(_0x948c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x948c('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x948c('0x4'));var client=jayson['client'][_0x948c('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x10cfb1,_0xeda32e,_0x520301){return new BPromise(function(_0x4bb2e6,_0x2b6fa2){return client[_0x948c('0x6')](_0x10cfb1,_0x520301)[_0x948c('0x7')](function(_0x1696f3){logger[_0x948c('0x8')]('FaxQueueReport,\x20%s,\x20%s',_0xeda32e,_0x948c('0x9'));logger[_0x948c('0xa')](_0x948c('0xb'),_0xeda32e,_0x948c('0x9'),JSON[_0x948c('0xc')](_0x1696f3));if(_0x1696f3[_0x948c('0xd')]){if(_0x1696f3[_0x948c('0xd')]['code']===0x1f4){logger[_0x948c('0xd')](_0x948c('0xe'),_0xeda32e,_0x1696f3[_0x948c('0xd')]['message']);return _0x2b6fa2(_0x1696f3[_0x948c('0xd')]['message']);}logger[_0x948c('0xd')](_0x948c('0xe'),_0xeda32e,_0x1696f3[_0x948c('0xd')][_0x948c('0xf')]);return _0x4bb2e6(_0x1696f3[_0x948c('0xd')][_0x948c('0xf')]);}else{logger['info'](_0x948c('0xe'),_0xeda32e,_0x948c('0x9'));_0x4bb2e6(_0x1696f3[_0x948c('0x10')]['message']);}})[_0x948c('0x11')](function(_0xac0e8d){logger[_0x948c('0xd')](_0x948c('0xe'),_0xeda32e,_0xac0e8d);_0x2b6fa2(_0xac0e8d);});});}exports[_0x948c('0x12')]=function(_0x48165e){var _0x414213=this;return new Promise(function(_0xbe70c2,_0x18c757){return db[_0x948c('0x13')][_0x948c('0x14')](_0x48165e[_0x948c('0x15')],{'raw':_0x48165e[_0x948c('0x16')]?_0x48165e[_0x948c('0x16')][_0x948c('0x17')]===undefined?!![]:![]:!![]})[_0x948c('0x7')](function(_0xdf42c){logger[_0x948c('0x8')](_0x948c('0x12'),_0x48165e);logger[_0x948c('0xa')](_0x948c('0x12'),_0x48165e,JSON[_0x948c('0xc')](_0xdf42c));_0xbe70c2(_0xdf42c);})[_0x948c('0x11')](function(_0x32294e){logger[_0x948c('0xd')](_0x948c('0x12'),_0x32294e[_0x948c('0xf')],_0x48165e);_0x18c757(_0x414213[_0x948c('0xd')](0x1f4,_0x32294e[_0x948c('0xf')]));});});};exports['UpdateFaxQueueReport']=function(_0x1543a4){var _0x553775=this;return new Promise(function(_0x4fd419,_0x34824b){return db['FaxQueueReport'][_0x948c('0x18')](_0x1543a4['body'],{'raw':_0x1543a4['options']?_0x1543a4['options'][_0x948c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1543a4[_0x948c('0x16')]?_0x1543a4[_0x948c('0x16')][_0x948c('0x19')]||null:null,'attributes':_0x1543a4['options']?_0x1543a4[_0x948c('0x16')][_0x948c('0x1a')]||null:null,'limit':_0x1543a4[_0x948c('0x16')]?_0x1543a4['options'][_0x948c('0x1b')]||null:null})[_0x948c('0x7')](function(_0x21f3f7){logger[_0x948c('0x8')]('UpdateFaxQueueReport',_0x1543a4);logger['debug'](_0x948c('0x1c'),_0x1543a4,JSON[_0x948c('0xc')](_0x21f3f7));_0x4fd419(_0x21f3f7);})[_0x948c('0x11')](function(_0xf8caab){logger[_0x948c('0xd')]('UpdateFaxQueueReport',_0xf8caab[_0x948c('0xf')],_0x1543a4);_0x34824b(_0x553775[_0x948c('0xd')](0x1f4,_0xf8caab[_0x948c('0xf')]));});});}; \ No newline at end of file +var _0xeaf6=['../../config/logger','jayson/promise','http','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','then','UpdateFaxQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x51042f,_0x2377bb){var _0x39308a=function(_0x2761cc){while(--_0x2761cc){_0x51042f['push'](_0x51042f['shift']());}};_0x39308a(++_0x2377bb);}(_0xeaf6,0x13f));var _0x6eaf=function(_0x3c4659,_0x51d29a){_0x3c4659=_0x3c4659-0x0;var _0x4db899=_0xeaf6[_0x3c4659];return _0x4db899;};'use strict';var _=require(_0x6eaf('0x0'));var util=require('util');var moment=require(_0x6eaf('0x1'));var BPromise=require(_0x6eaf('0x2'));var rs=require(_0x6eaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eaf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eaf('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6eaf('0x6'));var client=jayson['client'][_0x6eaf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x428e41,_0x534b15,_0x55f001){return new BPromise(function(_0x52c141,_0x2f94f4){return client['request'](_0x428e41,_0x55f001)['then'](function(_0x535b42){logger[_0x6eaf('0x8')](_0x6eaf('0x9'),_0x534b15,'request\x20sent');logger[_0x6eaf('0xa')](_0x6eaf('0xb'),_0x534b15,'request\x20sent',JSON[_0x6eaf('0xc')](_0x535b42));if(_0x535b42['error']){if(_0x535b42[_0x6eaf('0xd')][_0x6eaf('0xe')]===0x1f4){logger['error'](_0x6eaf('0x9'),_0x534b15,_0x535b42[_0x6eaf('0xd')][_0x6eaf('0xf')]);return _0x2f94f4(_0x535b42[_0x6eaf('0xd')]['message']);}logger[_0x6eaf('0xd')](_0x6eaf('0x9'),_0x534b15,_0x535b42[_0x6eaf('0xd')][_0x6eaf('0xf')]);return _0x52c141(_0x535b42[_0x6eaf('0xd')][_0x6eaf('0xf')]);}else{logger[_0x6eaf('0x8')](_0x6eaf('0x9'),_0x534b15,'request\x20sent');_0x52c141(_0x535b42['result'][_0x6eaf('0xf')]);}})[_0x6eaf('0x10')](function(_0x1f51a9){logger[_0x6eaf('0xd')](_0x6eaf('0x9'),_0x534b15,_0x1f51a9);_0x2f94f4(_0x1f51a9);});});}exports[_0x6eaf('0x11')]=function(_0x1e12b5){var _0x185ec9=this;return new Promise(function(_0x94e334,_0x4f55e7){return db[_0x6eaf('0x12')]['create'](_0x1e12b5[_0x6eaf('0x13')],{'raw':_0x1e12b5[_0x6eaf('0x14')]?_0x1e12b5[_0x6eaf('0x14')][_0x6eaf('0x15')]===undefined?!![]:![]:!![]})[_0x6eaf('0x16')](function(_0x5429a2){logger['info']('CreateFaxQueueReport',_0x1e12b5);logger[_0x6eaf('0xa')](_0x6eaf('0x11'),_0x1e12b5,JSON[_0x6eaf('0xc')](_0x5429a2));_0x94e334(_0x5429a2);})[_0x6eaf('0x10')](function(_0x3715f7){logger[_0x6eaf('0xd')]('CreateFaxQueueReport',_0x3715f7[_0x6eaf('0xf')],_0x1e12b5);_0x4f55e7(_0x185ec9[_0x6eaf('0xd')](0x1f4,_0x3715f7[_0x6eaf('0xf')]));});});};exports[_0x6eaf('0x17')]=function(_0x39e6db){var _0x4288cd=this;return new Promise(function(_0x4e7a74,_0x30ebd1){return db[_0x6eaf('0x12')][_0x6eaf('0x18')](_0x39e6db[_0x6eaf('0x13')],{'raw':_0x39e6db[_0x6eaf('0x14')]?_0x39e6db[_0x6eaf('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39e6db['options']?_0x39e6db[_0x6eaf('0x14')][_0x6eaf('0x19')]||null:null,'attributes':_0x39e6db[_0x6eaf('0x14')]?_0x39e6db[_0x6eaf('0x14')]['attributes']||null:null,'limit':_0x39e6db[_0x6eaf('0x14')]?_0x39e6db['options'][_0x6eaf('0x1a')]||null:null})[_0x6eaf('0x16')](function(_0x3a9c0b){logger['info'](_0x6eaf('0x17'),_0x39e6db);logger[_0x6eaf('0xa')]('UpdateFaxQueueReport',_0x39e6db,JSON['stringify'](_0x3a9c0b));_0x4e7a74(_0x3a9c0b);})[_0x6eaf('0x10')](function(_0x48ffdd){logger[_0x6eaf('0xd')](_0x6eaf('0x17'),_0x48ffdd[_0x6eaf('0xf')],_0x39e6db);_0x30ebd1(_0x4288cd[_0x6eaf('0xd')](0x1f4,_0x48ffdd['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b0107cb..8b1a593 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 _0xb1ec=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x22699a,_0x704699){var _0x59eb9e=function(_0x17957b){while(--_0x17957b){_0x22699a['push'](_0x22699a['shift']());}};_0x59eb9e(++_0x704699);}(_0xb1ec,0x11f));var _0xcb1e=function(_0x3e4236,_0x187233){_0x3e4236=_0x3e4236-0x0;var _0x39b22f=_0xb1ec[_0x3e4236];return _0x39b22f;};'use strict';var multer=require(_0xcb1e('0x0'));var util=require(_0xcb1e('0x1'));var path=require(_0xcb1e('0x2'));var timeout=require(_0xcb1e('0x3'));var express=require(_0xcb1e('0x4'));var router=express[_0xcb1e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcb1e('0x6'));var config=require(_0xcb1e('0x7'));var controller=require(_0xcb1e('0x8'));router[_0xcb1e('0x9')]('/',auth['isAuthenticated'](),controller[_0xcb1e('0xa')]);router[_0xcb1e('0x9')](_0xcb1e('0xb'),auth[_0xcb1e('0xc')](),controller['describe']);router[_0xcb1e('0x9')](_0xcb1e('0xd'),auth[_0xcb1e('0xc')](),controller[_0xcb1e('0xe')]);router[_0xcb1e('0xf')]('/',auth[_0xcb1e('0xc')](),controller[_0xcb1e('0x10')]);router[_0xcb1e('0x11')](_0xcb1e('0xd'),auth[_0xcb1e('0xc')](),controller[_0xcb1e('0x12')]);router[_0xcb1e('0x13')](_0xcb1e('0xd'),auth[_0xcb1e('0xc')](),controller[_0xcb1e('0x14')]);module[_0xcb1e('0x15')]=router; \ No newline at end of file +var _0x1a03=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','get','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x5a8112,_0x75bf25){var _0x138f68=function(_0x4d5101){while(--_0x4d5101){_0x5a8112['push'](_0x5a8112['shift']());}};_0x138f68(++_0x75bf25);}(_0x1a03,0x15f));var _0x31a0=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0x1a03[_0x34c4e1];return _0x5a11ef;};'use strict';var multer=require(_0x31a0('0x0'));var util=require(_0x31a0('0x1'));var path=require(_0x31a0('0x2'));var timeout=require(_0x31a0('0x3'));var express=require('express');var router=express[_0x31a0('0x4')]();var fs_extra=require(_0x31a0('0x5'));var auth=require(_0x31a0('0x6'));var interaction=require(_0x31a0('0x7'));var config=require(_0x31a0('0x8'));var controller=require(_0x31a0('0x9'));router['get']('/',auth[_0x31a0('0xa')](),controller['index']);router[_0x31a0('0xb')]('/describe',auth[_0x31a0('0xa')](),controller[_0x31a0('0xc')]);router[_0x31a0('0xb')](_0x31a0('0xd'),auth[_0x31a0('0xa')](),controller['show']);router[_0x31a0('0xe')]('/',auth[_0x31a0('0xa')](),controller[_0x31a0('0xf')]);router[_0x31a0('0x10')]('/:id',auth[_0x31a0('0xa')](),controller[_0x31a0('0x11')]);router[_0x31a0('0x12')]('/:id',auth[_0x31a0('0xa')](),controller[_0x31a0('0x13')]);module[_0x31a0('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 83a1fe3..04461f3 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x9bde,0xe1));var _0xe9bd=function(_0xa265b8,_0x5d6cce){_0xa265b8=_0xa265b8-0x0;var _0x485cf8=_0x9bde[_0xa265b8];return _0x485cf8;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3a1d7d,_0x153e7f){_0x3a1d7d=_0x3a1d7d-0x0;var _0x5c3675=_0x9bde[_0x3a1d7d];return _0x5c3675;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 4358635..c0a8ccb 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 _0x581b=['limit','count','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','offset','undefined'];(function(_0x5e3707,_0x5dea3a){var _0x2dca3e=function(_0x4e1b2a){while(--_0x4e1b2a){_0x5e3707['push'](_0x5e3707['shift']());}};_0x2dca3e(++_0x5dea3a);}(_0x581b,0x1f0));var _0xb581=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x581b[_0x2e3545];return _0xcf18f;};'use strict';var emlformat=require(_0xb581('0x0'));var rimraf=require(_0xb581('0x1'));var zipdir=require(_0xb581('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb581('0x3'));var moment=require(_0xb581('0x4'));var BPromise=require(_0xb581('0x5'));var Mustache=require(_0xb581('0x6'));var util=require(_0xb581('0x7'));var path=require(_0xb581('0x8'));var sox=require(_0xb581('0x9'));var csv=require(_0xb581('0xa'));var ejs=require(_0xb581('0xb'));var fs=require('fs');var fs_extra=require(_0xb581('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb581('0xd'));var jsforce=require(_0xb581('0xe'));var deskjs=require(_0xb581('0xf'));var toCsv=require(_0xb581('0xa'));var querystring=require(_0xb581('0x10'));var Papa=require(_0xb581('0x11'));var Redis=require(_0xb581('0x12'));var authService=require(_0xb581('0x13'));var qs=require(_0xb581('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb581('0x15'));var logger=require(_0xb581('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xb581('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb581('0x18'))['db'];function respondWithStatusCode(_0x2a1bd1,_0x5337cb){_0x5337cb=_0x5337cb||0xcc;return function(_0x2554fa){if(_0x2554fa){return _0x2a1bd1['sendStatus'](_0x5337cb);}return _0x2a1bd1['status'](_0x5337cb)[_0xb581('0x19')]();};}function respondWithResult(_0x35335a,_0xc635f2){_0xc635f2=_0xc635f2||0xc8;return function(_0x511bb5){if(_0x511bb5){return _0x35335a[_0xb581('0x1a')](_0xc635f2)['json'](_0x511bb5);}};}function respondWithFilteredResult(_0x4b2c8f,_0x1980f7){return function(_0x1bf49a){if(_0x1bf49a){var _0x1ec03b=typeof _0x1980f7[_0xb581('0x1b')]===_0xb581('0x1c')&&typeof _0x1980f7[_0xb581('0x1d')]===_0xb581('0x1c');var _0x1fbfae=_0x1bf49a['count'];var _0x5c2c4b=_0x1ec03b?0x0:_0x1980f7[_0xb581('0x1b')];var _0x4c19f6=_0x1ec03b?_0x1bf49a[_0xb581('0x1e')]:_0x1980f7[_0xb581('0x1b')]+_0x1980f7[_0xb581('0x1d')];var _0x5cb62b;if(_0x4c19f6>=_0x1fbfae){_0x4c19f6=_0x1fbfae;_0x5cb62b=0xc8;}else{_0x5cb62b=0xce;}_0x4b2c8f[_0xb581('0x1a')](_0x5cb62b);return _0x4b2c8f['set'](_0xb581('0x1f'),_0x5c2c4b+'-'+_0x4c19f6+'/'+_0x1fbfae)[_0xb581('0x20')](_0x1bf49a);}return null;};}function patchUpdates(_0x1b40f2){return function(_0x4792b8){try{jsonpatch[_0xb581('0x21')](_0x4792b8,_0x1b40f2,!![]);}catch(_0x1e4876){return BPromise['reject'](_0x1e4876);}return _0x4792b8[_0xb581('0x22')]();};}function saveUpdates(_0x5cfab4,_0x40c359){return function(_0x410d3c){if(_0x410d3c){return _0x410d3c[_0xb581('0x23')](_0x5cfab4)['then'](function(_0x8b2130){return _0x8b2130;});}return null;};}function removeEntity(_0x2731a0,_0x47e28e){return function(_0x436dd9){if(_0x436dd9){return _0x436dd9[_0xb581('0x24')]()[_0xb581('0x25')](function(){_0x2731a0['status'](0xcc)[_0xb581('0x19')]();});}};}function handleEntityNotFound(_0x5a616a,_0x1f2ba9){return function(_0x2d818a){if(!_0x2d818a){_0x5a616a[_0xb581('0x26')](0x194);}return _0x2d818a;};}function handleError(_0x2f0f4c,_0x1a58ad){_0x1a58ad=_0x1a58ad||0x1f4;return function(_0xc079fa){logger[_0xb581('0x27')](_0xc079fa['stack']);if(_0xc079fa['name']){delete _0xc079fa[_0xb581('0x28')];}_0x2f0f4c[_0xb581('0x1a')](_0x1a58ad)[_0xb581('0x29')](_0xc079fa);};}exports[_0xb581('0x2a')]=function(_0xdeb062,_0x4bc595){var _0x595d34={},_0x1e0c76={},_0x4d1460={'count':0x0,'rows':[]};var _0x404fbb=_[_0xb581('0x2b')](db[_0xb581('0x2c')][_0xb581('0x2d')],function(_0x46df16){return{'name':_0x46df16[_0xb581('0x2e')],'type':_0x46df16[_0xb581('0x2f')][_0xb581('0x30')]};});_0x1e0c76[_0xb581('0x31')]=_['map'](_0x404fbb,_0xb581('0x28'));_0x1e0c76[_0xb581('0x32')]=_[_0xb581('0x33')](_0xdeb062[_0xb581('0x32')]);_0x1e0c76[_0xb581('0x34')]=_[_0xb581('0x35')](_0x1e0c76['model'],_0x1e0c76['query']);_0x595d34['attributes']=_[_0xb581('0x35')](_0x1e0c76[_0xb581('0x31')],qs[_0xb581('0x36')](_0xdeb062[_0xb581('0x32')][_0xb581('0x36')]));_0x595d34[_0xb581('0x37')]=_0x595d34[_0xb581('0x37')]['length']?_0x595d34[_0xb581('0x37')]:_0x1e0c76[_0xb581('0x31')];if(!_0xdeb062[_0xb581('0x32')][_0xb581('0x38')]('nolimit')){_0x595d34[_0xb581('0x1d')]=qs['limit'](_0xdeb062['query'][_0xb581('0x1d')]);_0x595d34[_0xb581('0x1b')]=qs['offset'](_0xdeb062[_0xb581('0x32')][_0xb581('0x1b')]);}_0x595d34[_0xb581('0x39')]=qs[_0xb581('0x3a')](_0xdeb062[_0xb581('0x32')][_0xb581('0x3a')]);_0x595d34[_0xb581('0x3b')]=qs[_0xb581('0x34')](_['pick'](_0xdeb062['query'],_0x1e0c76['filters']),_0x404fbb);if(_0xdeb062[_0xb581('0x32')][_0xb581('0x3c')]){_0x595d34[_0xb581('0x3b')]=_[_0xb581('0x3d')](_0x595d34['where'],{'$or':_[_0xb581('0x2b')](_0x404fbb,function(_0x39c535){if(_0x39c535[_0xb581('0x2f')]!==_0xb581('0x3e')){var _0xfdd05c={};_0xfdd05c[_0x39c535[_0xb581('0x28')]]={'$like':'%'+_0xdeb062['query'][_0xb581('0x3c')]+'%'};return _0xfdd05c;}})});}_0x595d34=_[_0xb581('0x3d')]({},_0x595d34,_0xdeb062[_0xb581('0x3f')]);var _0x2716de={'where':_0x595d34['where']};return db[_0xb581('0x2c')]['count'](_0x2716de)[_0xb581('0x25')](function(_0x5d852f){_0x4d1460[_0xb581('0x1e')]=_0x5d852f;if(_0xdeb062['query'][_0xb581('0x40')]){_0x595d34[_0xb581('0x41')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x595d34);})[_0xb581('0x25')](function(_0x38773c){_0x4d1460[_0xb581('0x42')]=_0x38773c;return _0x4d1460;})[_0xb581('0x25')](respondWithFilteredResult(_0x4bc595,_0x595d34))[_0xb581('0x43')](handleError(_0x4bc595,null));};exports[_0xb581('0x44')]=function(_0x2ec944,_0x39ed6c){var _0x40c5ef={'raw':!![],'where':{'id':_0x2ec944[_0xb581('0x45')]['id']}},_0x23f05c={};_0x23f05c['model']=_[_0xb581('0x33')](db[_0xb581('0x2c')][_0xb581('0x2d')]);_0x23f05c[_0xb581('0x32')]=_[_0xb581('0x33')](_0x2ec944['query']);_0x23f05c[_0xb581('0x34')]=_[_0xb581('0x35')](_0x23f05c[_0xb581('0x31')],_0x23f05c['query']);_0x40c5ef[_0xb581('0x37')]=_[_0xb581('0x35')](_0x23f05c[_0xb581('0x31')],qs[_0xb581('0x36')](_0x2ec944[_0xb581('0x32')][_0xb581('0x36')]));_0x40c5ef[_0xb581('0x37')]=_0x40c5ef['attributes'][_0xb581('0x46')]?_0x40c5ef[_0xb581('0x37')]:_0x23f05c[_0xb581('0x31')];if(_0x2ec944['query'][_0xb581('0x40')]){_0x40c5ef['include']=[{'all':!![]}];}_0x40c5ef=_[_0xb581('0x3d')]({},_0x40c5ef,_0x2ec944['options']);return db[_0xb581('0x2c')][_0xb581('0x47')](_0x40c5ef)['then'](handleEntityNotFound(_0x39ed6c,null))[_0xb581('0x25')](respondWithResult(_0x39ed6c,null))[_0xb581('0x43')](handleError(_0x39ed6c,null));};exports[_0xb581('0x48')]=function(_0x5f0501,_0x2c86d9){return db['FaxTransferReport'][_0xb581('0x48')](_0x5f0501[_0xb581('0x49')],{})[_0xb581('0x25')](respondWithResult(_0x2c86d9,0xc9))[_0xb581('0x43')](handleError(_0x2c86d9,null));};exports['update']=function(_0x3cd986,_0x42d19b){if(_0x3cd986[_0xb581('0x49')]['id']){delete _0x3cd986[_0xb581('0x49')]['id'];}return db['FaxTransferReport'][_0xb581('0x47')]({'where':{'id':_0x3cd986[_0xb581('0x45')]['id']}})[_0xb581('0x25')](handleEntityNotFound(_0x42d19b,null))[_0xb581('0x25')](saveUpdates(_0x3cd986[_0xb581('0x49')],null))[_0xb581('0x25')](respondWithResult(_0x42d19b,null))['catch'](handleError(_0x42d19b,null));};exports['destroy']=function(_0x2476dd,_0x28c14f){return db[_0xb581('0x2c')]['find']({'where':{'id':_0x2476dd[_0xb581('0x45')]['id']}})['then'](handleEntityNotFound(_0x28c14f,null))[_0xb581('0x25')](removeEntity(_0x28c14f,null))[_0xb581('0x43')](handleError(_0x28c14f,null));};exports[_0xb581('0x4a')]=function(_0x5d5611,_0x2bea8b){return db[_0xb581('0x2c')][_0xb581('0x4a')]()[_0xb581('0x25')](respondWithResult(_0x2bea8b,null))[_0xb581('0x43')](handleError(_0x2bea8b,null));}; \ No newline at end of file +var _0x9a14=['find','describe','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','end','undefined','offset','status','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','FaxTransferReport','count','includeAll','include','params','keys','options','create','body','catch'];(function(_0x52d6ba,_0x51dd9e){var _0x329faa=function(_0xdb83d9){while(--_0xdb83d9){_0x52d6ba['push'](_0x52d6ba['shift']());}};_0x329faa(++_0x51dd9e);}(_0x9a14,0x8c));var _0x49a1=function(_0x5d0d9e,_0xac7beb){_0x5d0d9e=_0x5d0d9e-0x0;var _0x5422fe=_0x9a14[_0x5d0d9e];return _0x5422fe;};'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(_0x49a1('0x0'));var moment=require(_0x49a1('0x1'));var BPromise=require(_0x49a1('0x2'));var Mustache=require('mustache');var util=require(_0x49a1('0x3'));var path=require('path');var sox=require(_0x49a1('0x4'));var csv=require('to-csv');var ejs=require(_0x49a1('0x5'));var fs=require('fs');var fs_extra=require(_0x49a1('0x6'));var _=require(_0x49a1('0x7'));var squel=require(_0x49a1('0x8'));var crypto=require('crypto');var jsforce=require(_0x49a1('0x9'));var deskjs=require(_0x49a1('0xa'));var toCsv=require(_0x49a1('0xb'));var querystring=require(_0x49a1('0xc'));var Papa=require(_0x49a1('0xd'));var Redis=require(_0x49a1('0xe'));var authService=require(_0x49a1('0xf'));var qs=require(_0x49a1('0x10'));var as=require(_0x49a1('0x11'));var hardwareService=require(_0x49a1('0x12'));var logger=require(_0x49a1('0x13'))(_0x49a1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x552cf0,_0x44296c){_0x44296c=_0x44296c||0xcc;return function(_0x40690d){if(_0x40690d){return _0x552cf0[_0x49a1('0x15')](_0x44296c);}return _0x552cf0['status'](_0x44296c)[_0x49a1('0x16')]();};}function respondWithResult(_0x422553,_0x42fdb8){_0x42fdb8=_0x42fdb8||0xc8;return function(_0xcc9ad6){if(_0xcc9ad6){return _0x422553['status'](_0x42fdb8)['json'](_0xcc9ad6);}};}function respondWithFilteredResult(_0x210326,_0x175be3){return function(_0x2a6ed2){if(_0x2a6ed2){var _0x544124=typeof _0x175be3['offset']==='undefined'&&typeof _0x175be3['limit']===_0x49a1('0x17');var _0x496016=_0x2a6ed2['count'];var _0x5e086f=_0x544124?0x0:_0x175be3[_0x49a1('0x18')];var _0x567aec=_0x544124?_0x2a6ed2['count']:_0x175be3[_0x49a1('0x18')]+_0x175be3['limit'];var _0xde1c1e;if(_0x567aec>=_0x496016){_0x567aec=_0x496016;_0xde1c1e=0xc8;}else{_0xde1c1e=0xce;}_0x210326[_0x49a1('0x19')](_0xde1c1e);return _0x210326['set']('Content-Range',_0x5e086f+'-'+_0x567aec+'/'+_0x496016)[_0x49a1('0x1a')](_0x2a6ed2);}return null;};}function patchUpdates(_0x40f000){return function(_0x86aad0){try{jsonpatch[_0x49a1('0x1b')](_0x86aad0,_0x40f000,!![]);}catch(_0x236311){return BPromise[_0x49a1('0x1c')](_0x236311);}return _0x86aad0['save']();};}function saveUpdates(_0x3a2501,_0x2775eb){return function(_0x4f794f){if(_0x4f794f){return _0x4f794f[_0x49a1('0x1d')](_0x3a2501)['then'](function(_0x58ad68){return _0x58ad68;});}return null;};}function removeEntity(_0x2e8dc4,_0x139847){return function(_0x33d76c){if(_0x33d76c){return _0x33d76c[_0x49a1('0x1e')]()[_0x49a1('0x1f')](function(){_0x2e8dc4[_0x49a1('0x19')](0xcc)[_0x49a1('0x16')]();});}};}function handleEntityNotFound(_0x5c1e74,_0x4b98e1){return function(_0x375065){if(!_0x375065){_0x5c1e74['sendStatus'](0x194);}return _0x375065;};}function handleError(_0x208d49,_0x3c4865){_0x3c4865=_0x3c4865||0x1f4;return function(_0x30571f){logger[_0x49a1('0x20')](_0x30571f[_0x49a1('0x21')]);if(_0x30571f[_0x49a1('0x22')]){delete _0x30571f[_0x49a1('0x22')];}_0x208d49[_0x49a1('0x19')](_0x3c4865)[_0x49a1('0x23')](_0x30571f);};}exports[_0x49a1('0x24')]=function(_0x578a1a,_0x536ce4){var _0x3df5d2={},_0x349df1={},_0x2a5b0f={'count':0x0,'rows':[]};var _0x4ee630=_[_0x49a1('0x25')](db['FaxTransferReport']['rawAttributes'],function(_0x4bf4b3){return{'name':_0x4bf4b3[_0x49a1('0x26')],'type':_0x4bf4b3[_0x49a1('0x27')][_0x49a1('0x28')]};});_0x349df1[_0x49a1('0x29')]=_[_0x49a1('0x25')](_0x4ee630,_0x49a1('0x22'));_0x349df1[_0x49a1('0x2a')]=_['keys'](_0x578a1a[_0x49a1('0x2a')]);_0x349df1[_0x49a1('0x2b')]=_[_0x49a1('0x2c')](_0x349df1[_0x49a1('0x29')],_0x349df1[_0x49a1('0x2a')]);_0x3df5d2[_0x49a1('0x2d')]=_['intersection'](_0x349df1[_0x49a1('0x29')],qs[_0x49a1('0x2e')](_0x578a1a[_0x49a1('0x2a')][_0x49a1('0x2e')]));_0x3df5d2['attributes']=_0x3df5d2[_0x49a1('0x2d')][_0x49a1('0x2f')]?_0x3df5d2[_0x49a1('0x2d')]:_0x349df1[_0x49a1('0x29')];if(!_0x578a1a[_0x49a1('0x2a')]['hasOwnProperty'](_0x49a1('0x30'))){_0x3df5d2[_0x49a1('0x31')]=qs['limit'](_0x578a1a['query'][_0x49a1('0x31')]);_0x3df5d2[_0x49a1('0x18')]=qs[_0x49a1('0x18')](_0x578a1a[_0x49a1('0x2a')]['offset']);}_0x3df5d2[_0x49a1('0x32')]=qs[_0x49a1('0x33')](_0x578a1a[_0x49a1('0x2a')][_0x49a1('0x33')]);_0x3df5d2[_0x49a1('0x34')]=qs[_0x49a1('0x2b')](_[_0x49a1('0x35')](_0x578a1a[_0x49a1('0x2a')],_0x349df1[_0x49a1('0x2b')]),_0x4ee630);if(_0x578a1a['query']['filter']){_0x3df5d2['where']=_['merge'](_0x3df5d2[_0x49a1('0x34')],{'$or':_[_0x49a1('0x25')](_0x4ee630,function(_0x447b58){if(_0x447b58[_0x49a1('0x27')]!==_0x49a1('0x36')){var _0x38827b={};_0x38827b[_0x447b58[_0x49a1('0x22')]]={'$like':'%'+_0x578a1a[_0x49a1('0x2a')][_0x49a1('0x37')]+'%'};return _0x38827b;}})});}_0x3df5d2=_[_0x49a1('0x38')]({},_0x3df5d2,_0x578a1a['options']);var _0x1e22a0={'where':_0x3df5d2[_0x49a1('0x34')]};return db[_0x49a1('0x39')][_0x49a1('0x3a')](_0x1e22a0)[_0x49a1('0x1f')](function(_0x18e25f){_0x2a5b0f['count']=_0x18e25f;if(_0x578a1a[_0x49a1('0x2a')][_0x49a1('0x3b')]){_0x3df5d2[_0x49a1('0x3c')]=[{'all':!![]}];}return db[_0x49a1('0x39')]['findAll'](_0x3df5d2);})[_0x49a1('0x1f')](function(_0x2b0705){_0x2a5b0f['rows']=_0x2b0705;return _0x2a5b0f;})[_0x49a1('0x1f')](respondWithFilteredResult(_0x536ce4,_0x3df5d2))['catch'](handleError(_0x536ce4,null));};exports['show']=function(_0x589a23,_0x4f32c2){var _0x3f6356={'raw':!![],'where':{'id':_0x589a23[_0x49a1('0x3d')]['id']}},_0x2c57d1={};_0x2c57d1['model']=_[_0x49a1('0x3e')](db[_0x49a1('0x39')]['rawAttributes']);_0x2c57d1[_0x49a1('0x2a')]=_[_0x49a1('0x3e')](_0x589a23[_0x49a1('0x2a')]);_0x2c57d1[_0x49a1('0x2b')]=_['intersection'](_0x2c57d1[_0x49a1('0x29')],_0x2c57d1[_0x49a1('0x2a')]);_0x3f6356['attributes']=_[_0x49a1('0x2c')](_0x2c57d1['model'],qs['fields'](_0x589a23[_0x49a1('0x2a')][_0x49a1('0x2e')]));_0x3f6356[_0x49a1('0x2d')]=_0x3f6356[_0x49a1('0x2d')][_0x49a1('0x2f')]?_0x3f6356[_0x49a1('0x2d')]:_0x2c57d1['model'];if(_0x589a23[_0x49a1('0x2a')][_0x49a1('0x3b')]){_0x3f6356[_0x49a1('0x3c')]=[{'all':!![]}];}_0x3f6356=_['merge']({},_0x3f6356,_0x589a23[_0x49a1('0x3f')]);return db[_0x49a1('0x39')]['find'](_0x3f6356)[_0x49a1('0x1f')](handleEntityNotFound(_0x4f32c2,null))[_0x49a1('0x1f')](respondWithResult(_0x4f32c2,null))['catch'](handleError(_0x4f32c2,null));};exports[_0x49a1('0x40')]=function(_0x4b63ed,_0x453abb){return db['FaxTransferReport'][_0x49a1('0x40')](_0x4b63ed[_0x49a1('0x41')],{})['then'](respondWithResult(_0x453abb,0xc9))[_0x49a1('0x42')](handleError(_0x453abb,null));};exports[_0x49a1('0x1d')]=function(_0x37f529,_0x2b3148){if(_0x37f529[_0x49a1('0x41')]['id']){delete _0x37f529['body']['id'];}return db['FaxTransferReport'][_0x49a1('0x43')]({'where':{'id':_0x37f529['params']['id']}})[_0x49a1('0x1f')](handleEntityNotFound(_0x2b3148,null))[_0x49a1('0x1f')](saveUpdates(_0x37f529['body'],null))[_0x49a1('0x1f')](respondWithResult(_0x2b3148,null))[_0x49a1('0x42')](handleError(_0x2b3148,null));};exports['destroy']=function(_0x201b04,_0x3230d1){return db[_0x49a1('0x39')][_0x49a1('0x43')]({'where':{'id':_0x201b04[_0x49a1('0x3d')]['id']}})[_0x49a1('0x1f')](handleEntityNotFound(_0x3230d1,null))[_0x49a1('0x1f')](removeEntity(_0x3230d1,null))[_0x49a1('0x42')](handleError(_0x3230d1,null));};exports[_0x49a1('0x44')]=function(_0xb247b6,_0x23e4ff){return db['FaxTransferReport'][_0x49a1('0x44')]()[_0x49a1('0x1f')](respondWithResult(_0x23e4ff,null))[_0x49a1('0x42')](handleError(_0x23e4ff,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 78a35da..31bb1f2 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 _0x5df3=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','./faxTransferReport.attributes','exports','define'];(function(_0xeb43ff,_0x1b5817){var _0xb6dfbb=function(_0x9b2190){while(--_0x9b2190){_0xeb43ff['push'](_0xeb43ff['shift']());}};_0xb6dfbb(++_0x1b5817);}(_0x5df3,0x15f));var _0x35df=function(_0x13639d,_0x3c996b){_0x13639d=_0x13639d-0x0;var _0x52ef14=_0x5df3[_0x13639d];return _0x52ef14;};'use strict';var _=require(_0x35df('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x35df('0x1'));var moment=require(_0x35df('0x2'));var BPromise=require(_0x35df('0x3'));var rp=require(_0x35df('0x4'));var fs=require('fs');var path=require(_0x35df('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x35df('0x6'));module[_0x35df('0x7')]=function(_0x25d21a,_0x5817f9){return _0x25d21a[_0x35df('0x8')](_0x35df('0x9'),attributes,{'tableName':_0x35df('0xa'),'paranoid':![],'indexes':[{'name':_0x35df('0xb'),'fields':[_0x35df('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2065=['define','FaxTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','./faxTransferReport.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2065,0x18f));var _0x5206=function(_0x23b832,_0x3c0026){_0x23b832=_0x23b832-0x0;var _0x400d23=_0x2065[_0x23b832];return _0x400d23;};'use strict';var _=require('lodash');var util=require(_0x5206('0x0'));var logger=require(_0x5206('0x1'))(_0x5206('0x2'));var moment=require(_0x5206('0x3'));var BPromise=require(_0x5206('0x4'));var rp=require(_0x5206('0x5'));var fs=require('fs');var path=require(_0x5206('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5206('0x7'));module[_0x5206('0x8')]=function(_0x470526,_0x10912a){return _0x470526[_0x5206('0x9')](_0x5206('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x5206('0xb'),'fields':[_0x5206('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index f4348ec..a9dffab 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 _0xc48e=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x14d382,_0x54b6bd){var _0x31c6a7=function(_0xc9bb74){while(--_0xc9bb74){_0x14d382['push'](_0x14d382['shift']());}};_0x31c6a7(++_0x54b6bd);}(_0xc48e,0x8d));var _0xec48=function(_0x3cb815,_0x225c17){_0x3cb815=_0x3cb815-0x0;var _0xbeb84f=_0xc48e[_0x3cb815];return _0xbeb84f;};'use strict';var _=require(_0xec48('0x0'));var util=require(_0xec48('0x1'));var moment=require('moment');var BPromise=require(_0xec48('0x2'));var rs=require(_0xec48('0x3'));var fs=require('fs');var Redis=require(_0xec48('0x4'));var db=require(_0xec48('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec48('0x6'));var config=require('../../config/environment');var jayson=require(_0xec48('0x7'));var client=jayson['client'][_0xec48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d69d9,_0x4ef8f5,_0x37219b){return new BPromise(function(_0x247881,_0x375254){return client[_0xec48('0x9')](_0x5d69d9,_0x37219b)[_0xec48('0xa')](function(_0x6643cd){logger[_0xec48('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x4ef8f5,_0xec48('0xc'));logger[_0xec48('0xd')](_0xec48('0xe'),_0x4ef8f5,_0xec48('0xc'),JSON[_0xec48('0xf')](_0x6643cd));if(_0x6643cd['error']){if(_0x6643cd[_0xec48('0x10')][_0xec48('0x11')]===0x1f4){logger[_0xec48('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x4ef8f5,_0x6643cd['error'][_0xec48('0x12')]);return _0x375254(_0x6643cd[_0xec48('0x10')][_0xec48('0x12')]);}logger[_0xec48('0x10')](_0xec48('0x13'),_0x4ef8f5,_0x6643cd[_0xec48('0x10')]['message']);return _0x247881(_0x6643cd[_0xec48('0x10')]['message']);}else{logger['info'](_0xec48('0x13'),_0x4ef8f5,_0xec48('0xc'));_0x247881(_0x6643cd[_0xec48('0x14')][_0xec48('0x12')]);}})[_0xec48('0x15')](function(_0x36a83f){logger['error'](_0xec48('0x13'),_0x4ef8f5,_0x36a83f);_0x375254(_0x36a83f);});});} \ No newline at end of file +var _0xf169=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x58375b,_0x14059a){var _0x12ddb1=function(_0xe43f0f){while(--_0xe43f0f){_0x58375b['push'](_0x58375b['shift']());}};_0x12ddb1(++_0x14059a);}(_0xf169,0x1b5));var _0x9f16=function(_0x24a740,_0x383e9a){_0x24a740=_0x24a740-0x0;var _0x48fd04=_0xf169[_0x24a740];return _0x48fd04;};'use strict';var _=require(_0x9f16('0x0'));var util=require(_0x9f16('0x1'));var moment=require('moment');var BPromise=require(_0x9f16('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f16('0x3'));var db=require(_0x9f16('0x4'))['db'];var utils=require(_0x9f16('0x5'));var logger=require(_0x9f16('0x6'))(_0x9f16('0x7'));var config=require('../../config/environment');var jayson=require(_0x9f16('0x8'));var client=jayson[_0x9f16('0x9')][_0x9f16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37a74d,_0x526870,_0xf9757f){return new BPromise(function(_0x35c0b8,_0x5c8f0e){return client[_0x9f16('0xb')](_0x37a74d,_0xf9757f)['then'](function(_0x4ba0ce){logger[_0x9f16('0xc')](_0x9f16('0xd'),_0x526870,_0x9f16('0xe'));logger[_0x9f16('0xf')](_0x9f16('0x10'),_0x526870,_0x9f16('0xe'),JSON[_0x9f16('0x11')](_0x4ba0ce));if(_0x4ba0ce[_0x9f16('0x12')]){if(_0x4ba0ce[_0x9f16('0x12')]['code']===0x1f4){logger[_0x9f16('0x12')](_0x9f16('0xd'),_0x526870,_0x4ba0ce[_0x9f16('0x12')][_0x9f16('0x13')]);return _0x5c8f0e(_0x4ba0ce[_0x9f16('0x12')][_0x9f16('0x13')]);}logger[_0x9f16('0x12')](_0x9f16('0xd'),_0x526870,_0x4ba0ce['error'][_0x9f16('0x13')]);return _0x35c0b8(_0x4ba0ce[_0x9f16('0x12')][_0x9f16('0x13')]);}else{logger[_0x9f16('0xc')](_0x9f16('0xd'),_0x526870,_0x9f16('0xe'));_0x35c0b8(_0x4ba0ce[_0x9f16('0x14')]['message']);}})[_0x9f16('0x15')](function(_0x4bcbd8){logger['error'](_0x9f16('0xd'),_0x526870,_0x4bcbd8);_0x5c8f0e(_0x4bcbd8);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 13f110e..b1120ea 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 _0x5b9d=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3bf55e,_0x40cf48){var _0x1953b2=function(_0x1bd046){while(--_0x1bd046){_0x3bf55e['push'](_0x3bf55e['shift']());}};_0x1953b2(++_0x40cf48);}(_0x5b9d,0xa1));var _0xd5b9=function(_0x514da6,_0x3b61d9){_0x514da6=_0x514da6-0x0;var _0x3a47e7=_0x5b9d[_0x514da6];return _0x3a47e7;};'use strict';var multer=require(_0xd5b9('0x0'));var util=require(_0xd5b9('0x1'));var path=require(_0xd5b9('0x2'));var timeout=require(_0xd5b9('0x3'));var express=require('express');var router=express[_0xd5b9('0x4')]();var fs_extra=require(_0xd5b9('0x5'));var auth=require(_0xd5b9('0x6'));var interaction=require(_0xd5b9('0x7'));var config=require(_0xd5b9('0x8'));var controller=require(_0xd5b9('0x9'));router[_0xd5b9('0xa')]('/',auth[_0xd5b9('0xb')](),controller[_0xd5b9('0xc')]);router[_0xd5b9('0xa')](_0xd5b9('0xd'),auth[_0xd5b9('0xb')](),controller[_0xd5b9('0xe')]);router['get']('/:id',auth[_0xd5b9('0xb')](),controller['show']);router[_0xd5b9('0xf')]('/',auth[_0xd5b9('0xb')](),controller[_0xd5b9('0x10')]);router[_0xd5b9('0x11')](_0xd5b9('0x12'),auth[_0xd5b9('0xb')](),controller[_0xd5b9('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd5b9('0x14')]);module[_0xd5b9('0x15')]=router; \ No newline at end of file +var _0x6c8b=['update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x6c8b,0x16b));var _0xb6c8=function(_0x53d449,_0x42f242){_0x53d449=_0x53d449-0x0;var _0x21f806=_0x6c8b[_0x53d449];return _0x21f806;};'use strict';var multer=require(_0xb6c8('0x0'));var util=require('util');var path=require(_0xb6c8('0x1'));var timeout=require(_0xb6c8('0x2'));var express=require('express');var router=express[_0xb6c8('0x3')]();var fs_extra=require(_0xb6c8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb6c8('0x5'));var config=require(_0xb6c8('0x6'));var controller=require('./faxTransferReport.controller');router[_0xb6c8('0x7')]('/',auth[_0xb6c8('0x8')](),controller[_0xb6c8('0x9')]);router[_0xb6c8('0x7')](_0xb6c8('0xa'),auth[_0xb6c8('0x8')](),controller[_0xb6c8('0xb')]);router[_0xb6c8('0x7')](_0xb6c8('0xc'),auth[_0xb6c8('0x8')](),controller[_0xb6c8('0xd')]);router[_0xb6c8('0xe')]('/',auth[_0xb6c8('0x8')](),controller[_0xb6c8('0xf')]);router[_0xb6c8('0x10')]('/:id',auth[_0xb6c8('0x8')](),controller[_0xb6c8('0x11')]);router['delete'](_0xb6c8('0xc'),auth[_0xb6c8('0x8')](),controller['destroy']);module[_0xb6c8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 3014c0d..439fef3 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 _0x1a9e=['index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated'];(function(_0x768a3f,_0x194af9){var _0x101144=function(_0x1aed67){while(--_0x1aed67){_0x768a3f['push'](_0x768a3f['shift']());}};_0x101144(++_0x194af9);}(_0x1a9e,0x180));var _0xe1a9=function(_0x590b82,_0x310f64){_0x590b82=_0x590b82-0x0;var _0x5ed23f=_0x1a9e[_0x590b82];return _0x5ed23f;};'use strict';var multer=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var path=require(_0xe1a9('0x2'));var timeout=require(_0xe1a9('0x3'));var express=require(_0xe1a9('0x4'));var router=express['Router']();var fs_extra=require(_0xe1a9('0x5'));var auth=require(_0xe1a9('0x6'));var interaction=require(_0xe1a9('0x7'));var config=require(_0xe1a9('0x8'));var controller=require(_0xe1a9('0x9'));router[_0xe1a9('0xa')]('/',auth[_0xe1a9('0xb')](),controller[_0xe1a9('0xc')]);router[_0xe1a9('0xa')](_0xe1a9('0xd'),auth[_0xe1a9('0xb')](),controller['show']);router[_0xe1a9('0xa')](_0xe1a9('0xe'),auth[_0xe1a9('0xb')](),controller[_0xe1a9('0xf')]);router['get'](_0xe1a9('0x10'),auth[_0xe1a9('0xb')](),controller[_0xe1a9('0x11')]);router[_0xe1a9('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe1a9('0x12')]('/:id/configurations',auth[_0xe1a9('0xb')](),controller[_0xe1a9('0x13')]);router[_0xe1a9('0x14')]('/:id',auth[_0xe1a9('0xb')](),controller[_0xe1a9('0x15')]);router['delete'](_0xe1a9('0xd'),auth[_0xe1a9('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3e65=['destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x3e65,0x16b));var _0x53e6=function(_0x2d65c3,_0x418bc3){_0x2d65c3=_0x2d65c3-0x0;var _0x3048ac=_0x3e65[_0x2d65c3];return _0x3048ac;};'use strict';var multer=require(_0x53e6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x53e6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x53e6('0x2'));var auth=require(_0x53e6('0x3'));var interaction=require(_0x53e6('0x4'));var config=require('../../config/environment');var controller=require(_0x53e6('0x5'));router[_0x53e6('0x6')]('/',auth[_0x53e6('0x7')](),controller['index']);router[_0x53e6('0x6')](_0x53e6('0x8'),auth[_0x53e6('0x7')](),controller[_0x53e6('0x9')]);router['get']('/:id/configurations',auth[_0x53e6('0x7')](),controller['getConfigurations']);router[_0x53e6('0x6')](_0x53e6('0xa'),auth['isAuthenticated'](),controller[_0x53e6('0xb')]);router[_0x53e6('0xc')]('/',auth[_0x53e6('0x7')](),controller['create']);router[_0x53e6('0xc')]('/:id/configurations',auth[_0x53e6('0x7')](),controller[_0x53e6('0xd')]);router[_0x53e6('0xe')](_0x53e6('0x8'),auth[_0x53e6('0x7')](),controller[_0x53e6('0xf')]);router[_0x53e6('0x10')](_0x53e6('0x8'),auth[_0x53e6('0x7')](),controller[_0x53e6('0x11')]);module[_0x53e6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6e4d421..1099269 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 _0xb2a0=['STRING','ENUM','basic','newTab','sequelize','exports'];(function(_0x594168,_0x3ac22f){var _0x31645f=function(_0x47f9a3){while(--_0x47f9a3){_0x594168['push'](_0x594168['shift']());}};_0x31645f(++_0x3ac22f);}(_0xb2a0,0x9a));var _0x0b2a=function(_0x796d19,_0x408c8c){_0x796d19=_0x796d19-0x0;var _0x146274=_0xb2a0[_0x796d19];return _0x146274;};'use strict';var Sequelize=require(_0x0b2a('0x0'));module[_0x0b2a('0x1')]={'name':{'type':Sequelize[_0x0b2a('0x2')]},'description':{'type':Sequelize[_0x0b2a('0x2')]},'username':{'type':Sequelize[_0x0b2a('0x2')]},'remoteUri':{'type':Sequelize[_0x0b2a('0x2')]},'authType':{'type':Sequelize[_0x0b2a('0x3')](_0x0b2a('0x4')),'defaultValue':_0x0b2a('0x4')},'password':{'type':Sequelize[_0x0b2a('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0b2a('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x0b2a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0b2a('0x3')]('integrationTab',_0x0b2a('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x699f=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x34e3fb,_0x40d8ed){var _0x235158=function(_0x44cca0){while(--_0x44cca0){_0x34e3fb['push'](_0x34e3fb['shift']());}};_0x235158(++_0x40d8ed);}(_0x699f,0xa1));var _0xf699=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x699f[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0xf699('0x0'));module[_0xf699('0x1')]={'name':{'type':Sequelize[_0xf699('0x2')]},'description':{'type':Sequelize[_0xf699('0x2')]},'username':{'type':Sequelize[_0xf699('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf699('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0xf699('0x2')]},'consumerKey':{'type':Sequelize[_0xf699('0x2')]},'consumerSecret':{'type':Sequelize[_0xf699('0x2')]},'token':{'type':Sequelize[_0xf699('0x2')]},'tokenSecret':{'type':Sequelize[_0xf699('0x2')]},'serverUrl':{'type':Sequelize[_0xf699('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf699('0x3')](_0xf699('0x4'),_0xf699('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b23e380..f6b7814 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 _0xfdb7=['catch','show','params','merge','find','create','body','update','getConfigurations','findOne','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','DeskConfiguration','DeskField','getFields','priority','username','password','consumerKey','token','tokenSecret','slice','substring','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','concat','_embedded','entries','label','getFields,\x20%s,\x20%s,\x20%s','send','test','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x4739f5,_0x284058){var _0x579c50=function(_0x2e39eb){while(--_0x2e39eb){_0x4739f5['push'](_0x4739f5['shift']());}};_0x579c50(++_0x284058);}(_0xfdb7,0x107));var _0x7fdb=function(_0x1641e6,_0x3e0ba){_0x1641e6=_0x1641e6-0x0;var _0x3d4459=_0xfdb7[_0x1641e6];return _0x3d4459;};'use strict';var emlformat=require(_0x7fdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fdb('0x1'));var jsonpatch=require(_0x7fdb('0x2'));var rp=require(_0x7fdb('0x3'));var moment=require(_0x7fdb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7fdb('0x5'));var util=require('util');var path=require(_0x7fdb('0x6'));var sox=require(_0x7fdb('0x7'));var csv=require(_0x7fdb('0x8'));var ejs=require(_0x7fdb('0x9'));var fs=require('fs');var fs_extra=require(_0x7fdb('0xa'));var _=require(_0x7fdb('0xb'));var squel=require(_0x7fdb('0xc'));var crypto=require('crypto');var jsforce=require(_0x7fdb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7fdb('0xe'));var Papa=require(_0x7fdb('0xf'));var Redis=require(_0x7fdb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7fdb('0x11'));var as=require(_0x7fdb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7fdb('0x13'));var utils=require(_0x7fdb('0x14'));var config=require(_0x7fdb('0x15'));var licenseUtil=require(_0x7fdb('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7fdb('0x17'));function respondWithStatusCode(_0xc5745f,_0x4bc82f){_0x4bc82f=_0x4bc82f||0xcc;return function(_0x5420e4){if(_0x5420e4){return _0xc5745f[_0x7fdb('0x18')](_0x4bc82f);}return _0xc5745f[_0x7fdb('0x19')](_0x4bc82f)[_0x7fdb('0x1a')]();};}function respondWithResult(_0x32acc5,_0x512d60){_0x512d60=_0x512d60||0xc8;return function(_0x3cb08d){if(_0x3cb08d){return _0x32acc5[_0x7fdb('0x19')](_0x512d60)[_0x7fdb('0x1b')](_0x3cb08d);}};}function respondWithFilteredResult(_0x1073bd,_0x50dded){return function(_0x6c6f70){if(_0x6c6f70){var _0xf25664=typeof _0x50dded[_0x7fdb('0x1c')]==='undefined'&&typeof _0x50dded['limit']===_0x7fdb('0x1d');var _0x1bc382=_0x6c6f70[_0x7fdb('0x1e')];var _0x128869=_0xf25664?0x0:_0x50dded[_0x7fdb('0x1c')];var _0x1ed70c=_0xf25664?_0x6c6f70[_0x7fdb('0x1e')]:_0x50dded[_0x7fdb('0x1c')]+_0x50dded['limit'];var _0x2d5d71;if(_0x1ed70c>=_0x1bc382){_0x1ed70c=_0x1bc382;_0x2d5d71=0xc8;}else{_0x2d5d71=0xce;}_0x1073bd[_0x7fdb('0x19')](_0x2d5d71);return _0x1073bd[_0x7fdb('0x1f')](_0x7fdb('0x20'),_0x128869+'-'+_0x1ed70c+'/'+_0x1bc382)[_0x7fdb('0x1b')](_0x6c6f70);}return null;};}function patchUpdates(_0x2fb724){return function(_0x393e68){try{jsonpatch['apply'](_0x393e68,_0x2fb724,!![]);}catch(_0x6a9ba4){return BPromise[_0x7fdb('0x21')](_0x6a9ba4);}return _0x393e68[_0x7fdb('0x22')]();};}function saveUpdates(_0x390517,_0x28c6d7){return function(_0x1af8df){if(_0x1af8df){return _0x1af8df['update'](_0x390517)[_0x7fdb('0x23')](function(_0x57618d){return _0x57618d;});}return null;};}function removeEntity(_0x3044ef,_0xa43e08){return function(_0x25daea){if(_0x25daea){return _0x25daea[_0x7fdb('0x24')]()[_0x7fdb('0x23')](function(){_0x3044ef[_0x7fdb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443149,_0xebfc2b){return function(_0x448a0c){if(!_0x448a0c){_0x443149[_0x7fdb('0x18')](0x194);}return _0x448a0c;};}function handleError(_0x8181db,_0x9a5416){_0x9a5416=_0x9a5416||0x1f4;return function(_0x53a96e){logger[_0x7fdb('0x25')](_0x53a96e[_0x7fdb('0x26')]);if(_0x53a96e['name']){delete _0x53a96e[_0x7fdb('0x27')];}_0x8181db[_0x7fdb('0x19')](_0x9a5416)['send'](_0x53a96e);};}exports[_0x7fdb('0x28')]=function(_0x1da1b6,_0x4ed52b){var _0x1f554c={},_0x433b64={},_0x158fb0={'count':0x0,'rows':[]};var _0x3f2a62=_[_0x7fdb('0x29')](db[_0x7fdb('0x2a')][_0x7fdb('0x2b')],function(_0x573f8c){return{'name':_0x573f8c[_0x7fdb('0x2c')],'type':_0x573f8c[_0x7fdb('0x2d')]['key']};});_0x433b64[_0x7fdb('0x2e')]=_[_0x7fdb('0x29')](_0x3f2a62,_0x7fdb('0x27'));_0x433b64['query']=_[_0x7fdb('0x2f')](_0x1da1b6[_0x7fdb('0x30')]);_0x433b64[_0x7fdb('0x31')]=_['intersection'](_0x433b64[_0x7fdb('0x2e')],_0x433b64['query']);_0x1f554c[_0x7fdb('0x32')]=_[_0x7fdb('0x33')](_0x433b64[_0x7fdb('0x2e')],qs[_0x7fdb('0x34')](_0x1da1b6['query']['fields']));_0x1f554c['attributes']=_0x1f554c[_0x7fdb('0x32')][_0x7fdb('0x35')]?_0x1f554c[_0x7fdb('0x32')]:_0x433b64[_0x7fdb('0x2e')];if(!_0x1da1b6['query'][_0x7fdb('0x36')]('nolimit')){_0x1f554c[_0x7fdb('0x37')]=qs[_0x7fdb('0x37')](_0x1da1b6['query'][_0x7fdb('0x37')]);_0x1f554c[_0x7fdb('0x1c')]=qs[_0x7fdb('0x1c')](_0x1da1b6[_0x7fdb('0x30')][_0x7fdb('0x1c')]);}_0x1f554c[_0x7fdb('0x38')]=qs[_0x7fdb('0x39')](_0x1da1b6[_0x7fdb('0x30')][_0x7fdb('0x39')]);_0x1f554c[_0x7fdb('0x3a')]=qs['filters'](_[_0x7fdb('0x3b')](_0x1da1b6[_0x7fdb('0x30')],_0x433b64[_0x7fdb('0x31')]),_0x3f2a62);if(_0x1da1b6[_0x7fdb('0x30')][_0x7fdb('0x3c')]){_0x1f554c['where']=_['merge'](_0x1f554c[_0x7fdb('0x3a')],{'$or':_[_0x7fdb('0x29')](_0x3f2a62,function(_0x3706ed){if(_0x3706ed[_0x7fdb('0x2d')]!==_0x7fdb('0x3d')){var _0x1aa7c2={};_0x1aa7c2[_0x3706ed['name']]={'$like':'%'+_0x1da1b6['query'][_0x7fdb('0x3c')]+'%'};return _0x1aa7c2;}})});}_0x1f554c=_['merge']({},_0x1f554c,_0x1da1b6[_0x7fdb('0x3e')]);var _0x161719={'where':_0x1f554c[_0x7fdb('0x3a')]};return db[_0x7fdb('0x2a')][_0x7fdb('0x1e')](_0x161719)['then'](function(_0x24cce4){_0x158fb0['count']=_0x24cce4;if(_0x1da1b6['query'][_0x7fdb('0x3f')]){_0x1f554c[_0x7fdb('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0x7fdb('0x41')](_0x1f554c);})[_0x7fdb('0x23')](function(_0xf87a63){_0x158fb0[_0x7fdb('0x42')]=_0xf87a63;return _0x158fb0;})[_0x7fdb('0x23')](respondWithFilteredResult(_0x4ed52b,_0x1f554c))[_0x7fdb('0x43')](handleError(_0x4ed52b,null));};exports[_0x7fdb('0x44')]=function(_0x24bbc7,_0x2221fe){var _0x4eadc6={'raw':![],'where':{'id':_0x24bbc7[_0x7fdb('0x45')]['id']}},_0x137cb4={};_0x137cb4[_0x7fdb('0x2e')]=_[_0x7fdb('0x2f')](db[_0x7fdb('0x2a')][_0x7fdb('0x2b')]);_0x137cb4['query']=_[_0x7fdb('0x2f')](_0x24bbc7['query']);_0x137cb4[_0x7fdb('0x31')]=_[_0x7fdb('0x33')](_0x137cb4[_0x7fdb('0x2e')],_0x137cb4[_0x7fdb('0x30')]);_0x4eadc6[_0x7fdb('0x32')]=_[_0x7fdb('0x33')](_0x137cb4[_0x7fdb('0x2e')],qs[_0x7fdb('0x34')](_0x24bbc7[_0x7fdb('0x30')][_0x7fdb('0x34')]));_0x4eadc6[_0x7fdb('0x32')]=_0x4eadc6[_0x7fdb('0x32')][_0x7fdb('0x35')]?_0x4eadc6[_0x7fdb('0x32')]:_0x137cb4[_0x7fdb('0x2e')];if(_0x24bbc7['query'][_0x7fdb('0x3f')]){_0x4eadc6[_0x7fdb('0x40')]=[{'all':!![]}];}_0x4eadc6=_[_0x7fdb('0x46')]({},_0x4eadc6,_0x24bbc7[_0x7fdb('0x3e')]);return db[_0x7fdb('0x2a')][_0x7fdb('0x47')](_0x4eadc6)[_0x7fdb('0x23')](handleEntityNotFound(_0x2221fe,null))[_0x7fdb('0x23')](respondWithResult(_0x2221fe,null))['catch'](handleError(_0x2221fe,null));};exports[_0x7fdb('0x48')]=function(_0x3bcdb1,_0x300612){return db[_0x7fdb('0x2a')][_0x7fdb('0x48')](_0x3bcdb1[_0x7fdb('0x49')],{})[_0x7fdb('0x23')](respondWithResult(_0x300612,0xc9))[_0x7fdb('0x43')](handleError(_0x300612,null));};exports[_0x7fdb('0x4a')]=function(_0x4f466b,_0xd0f141){if(_0x4f466b[_0x7fdb('0x49')]['id']){delete _0x4f466b[_0x7fdb('0x49')]['id'];}return db[_0x7fdb('0x2a')]['find']({'where':{'id':_0x4f466b[_0x7fdb('0x45')]['id']}})['then'](handleEntityNotFound(_0xd0f141,null))[_0x7fdb('0x23')](saveUpdates(_0x4f466b[_0x7fdb('0x49')],null))[_0x7fdb('0x23')](respondWithResult(_0xd0f141,null))[_0x7fdb('0x43')](handleError(_0xd0f141,null));};exports[_0x7fdb('0x24')]=function(_0x17e946,_0x51ba5a){return db['DeskAccount'][_0x7fdb('0x47')]({'where':{'id':_0x17e946['params']['id']}})[_0x7fdb('0x23')](handleEntityNotFound(_0x51ba5a,null))[_0x7fdb('0x23')](removeEntity(_0x51ba5a,null))[_0x7fdb('0x43')](handleError(_0x51ba5a,null));};exports[_0x7fdb('0x4b')]=function(_0x59e6a9,_0x378cff,_0x310247){var _0x12a6db={};var _0x362a15={};var _0x407c06;var _0x474765;return db['DeskAccount'][_0x7fdb('0x4c')]({'where':{'id':_0x59e6a9[_0x7fdb('0x45')]['id']}})['then'](handleEntityNotFound(_0x378cff,null))[_0x7fdb('0x23')](function(_0x4ef59d){if(_0x4ef59d){_0x407c06=_0x4ef59d;_0x362a15[_0x7fdb('0x2e')]=_[_0x7fdb('0x2f')](db['DeskConfiguration'][_0x7fdb('0x2b')]);_0x362a15['query']=_['keys'](_0x59e6a9[_0x7fdb('0x30')]);_0x362a15[_0x7fdb('0x31')]=_[_0x7fdb('0x33')](_0x362a15['model'],_0x362a15[_0x7fdb('0x30')]);_0x12a6db['attributes']=_[_0x7fdb('0x33')](_0x362a15[_0x7fdb('0x2e')],qs[_0x7fdb('0x34')](_0x59e6a9[_0x7fdb('0x30')]['fields']));_0x12a6db[_0x7fdb('0x32')]=_0x12a6db[_0x7fdb('0x32')][_0x7fdb('0x35')]?_0x12a6db['attributes']:_0x362a15[_0x7fdb('0x2e')];_0x12a6db[_0x7fdb('0x38')]=qs['sort'](_0x59e6a9[_0x7fdb('0x30')][_0x7fdb('0x39')]);_0x12a6db[_0x7fdb('0x3a')]=qs[_0x7fdb('0x31')](_['pick'](_0x59e6a9[_0x7fdb('0x30')],_0x362a15[_0x7fdb('0x31')]));if(_0x59e6a9[_0x7fdb('0x30')][_0x7fdb('0x3c')]){_0x12a6db[_0x7fdb('0x3a')]=_['merge'](_0x12a6db[_0x7fdb('0x3a')],{'$or':_['map'](_0x12a6db['attributes'],function(_0x15fe13){var _0x393473={};_0x393473[_0x15fe13]={'$like':'%'+_0x59e6a9[_0x7fdb('0x30')]['filter']+'%'};return _0x393473;})});}_0x12a6db=_[_0x7fdb('0x46')]({},_0x12a6db,_0x59e6a9[_0x7fdb('0x3e')]);return _0x407c06[_0x7fdb('0x4b')](_0x12a6db);}})[_0x7fdb('0x23')](function(_0x4dc028){if(_0x4dc028){_0x474765=_0x4dc028[_0x7fdb('0x35')];if(!_0x59e6a9[_0x7fdb('0x30')][_0x7fdb('0x36')](_0x7fdb('0x4d'))){_0x12a6db[_0x7fdb('0x37')]=qs[_0x7fdb('0x37')](_0x59e6a9[_0x7fdb('0x30')]['limit']);_0x12a6db[_0x7fdb('0x1c')]=qs[_0x7fdb('0x1c')](_0x59e6a9[_0x7fdb('0x30')][_0x7fdb('0x1c')]);}return _0x407c06[_0x7fdb('0x4b')](_0x12a6db);}})['then'](function(_0x2c1edd){if(_0x2c1edd){return _0x2c1edd?{'count':_0x474765,'rows':_0x2c1edd}:null;}})['then'](respondWithResult(_0x378cff,null))['catch'](handleError(_0x378cff,null));};exports[_0x7fdb('0x4e')]=function(_0x15e13e,_0x42a5ac,_0x4cec10){if(_0x15e13e[_0x7fdb('0x49')]['id']){delete _0x15e13e[_0x7fdb('0x49')]['id'];}return db['DeskAccount'][_0x7fdb('0x4c')]({'where':{'id':_0x15e13e['params']['id']}})[_0x7fdb('0x23')](handleEntityNotFound(_0x42a5ac,null))['then'](function(_0x5b4473){if(_0x5b4473){_0x15e13e['body'][_0x7fdb('0x4f')]=_0x5b4473['id'];_0x15e13e[_0x7fdb('0x49')]['Subjects']=integrations[_0x7fdb('0x50')](_0x15e13e[_0x7fdb('0x49')][_0x7fdb('0x51')],_0x15e13e[_0x7fdb('0x49')][_0x7fdb('0x2d')]);_0x15e13e['body'][_0x7fdb('0x52')]=integrations['getDescriptions'](_0x15e13e[_0x7fdb('0x49')][_0x7fdb('0x51')],_0x15e13e[_0x7fdb('0x49')]['type']);return db[_0x7fdb('0x53')][_0x7fdb('0x48')](_0x15e13e[_0x7fdb('0x49')],{'include':[{'model':db[_0x7fdb('0x54')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x7fdb('0x52')}]});}return null;})['then'](respondWithResult(_0x42a5ac,null))['catch'](handleError(_0x42a5ac,null));};exports[_0x7fdb('0x55')]=function(_0x42fb2c,_0x19929e,_0x3805f7){var _0xfc808c=[{'name':_0x7fdb('0x56'),'label':_0x7fdb('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x31314e='';return db[_0x7fdb('0x2a')]['findOne']({'where':{'id':_0x42fb2c[_0x7fdb('0x45')]['id']},'attributes':['id','remoteUri','authType',_0x7fdb('0x57'),_0x7fdb('0x58'),_0x7fdb('0x59'),'consumerSecret',_0x7fdb('0x5a'),_0x7fdb('0x5b')]})[_0x7fdb('0x23')](handleEntityNotFound(_0x19929e,null))[_0x7fdb('0x23')](function(_0x257045){if(_0x257045){_0x31314e=_0x257045['remoteUri'];var _0x505d4f=_0x31314e[_0x7fdb('0x5c')](-0x1);if(_0x505d4f==='/'){_0x31314e=_0x31314e[_0x7fdb('0x5d')](0x0,_0x31314e['lastIndexOf'](_0x505d4f));}var _0xb5d20e={'method':_0x7fdb('0x5e'),'uri':util[_0x7fdb('0x5f')](_0x7fdb('0x60'),_0x31314e),'headers':{'Content-Type':'application/json','Accept':_0x7fdb('0x61')},'json':!![]};if(_0x257045['authType']===_0x7fdb('0x62')){_0xb5d20e[_0x7fdb('0x63')][_0x7fdb('0x64')]=util[_0x7fdb('0x5f')]('Basic\x20%s',new Buffer(util[_0x7fdb('0x5f')](_0x7fdb('0x65'),_0x257045[_0x7fdb('0x57')],_0x257045[_0x7fdb('0x58')]))[_0x7fdb('0x66')]('base64'));}return rp(_0xb5d20e)[_0x7fdb('0x23')](function(_0x4aef48){return _0xfc808c[_0x7fdb('0x67')](_[_0x7fdb('0x29')](_0x4aef48[_0x7fdb('0x68')][_0x7fdb('0x69')],function(_0x54885a){return{'id':_0x54885a[_0x7fdb('0x27')],'name':_0x54885a[_0x7fdb('0x27')],'type':_0x54885a[_0x7fdb('0x2d')],'active':_0x54885a['active'],'label':_0x54885a[_0x7fdb('0x6a')],'custom':!![]};}));});}})[_0x7fdb('0x23')](function(_0x37e000){return{'count':_0x37e000[_0x7fdb('0x35')],'rows':_0x37e000};})[_0x7fdb('0x23')](respondWithResult(_0x19929e,null))[_0x7fdb('0x43')](function(_0x57de04){var _0x218667=_0x42fb2c['query']['test']?0x1f4:_0x57de04['statusCode']||0x1f4;logger[_0x7fdb('0x25')](_0x7fdb('0x6b'),_0x7fdb('0x55'),_0x218667,JSON['stringify'](_0x57de04));delete _0x57de04['name'];if(_0x218667===0x191){_0x218667=0x190;}_0x19929e[_0x7fdb('0x19')](_0x218667)[_0x7fdb('0x6c')](_0x42fb2c[_0x7fdb('0x30')][_0x7fdb('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x57de04['statusCode']}:_0x57de04);});}; \ No newline at end of file +var _0xb6cc=['undefined','limit','count','status','set','Content-Range','json','save','update','then','destroy','end','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','includeAll','findAll','rows','params','length','include','merge','options','find','create','body','catch','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Basic\x20%s','%s:%s','base64','concat','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','offset'];(function(_0x48f3c1,_0x40ac82){var _0x296673=function(_0x123cc9){while(--_0x123cc9){_0x48f3c1['push'](_0x48f3c1['shift']());}};_0x296673(++_0x40ac82);}(_0xb6cc,0x13d));var _0xcb6c=function(_0x774d3f,_0x5abdda){_0x774d3f=_0x774d3f-0x0;var _0x282498=_0xb6cc[_0x774d3f];return _0x282498;};'use strict';var emlformat=require(_0xcb6c('0x0'));var rimraf=require(_0xcb6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcb6c('0x2'));var moment=require(_0xcb6c('0x3'));var BPromise=require(_0xcb6c('0x4'));var Mustache=require(_0xcb6c('0x5'));var util=require(_0xcb6c('0x6'));var path=require('path');var sox=require(_0xcb6c('0x7'));var csv=require(_0xcb6c('0x8'));var ejs=require(_0xcb6c('0x9'));var fs=require('fs');var fs_extra=require(_0xcb6c('0xa'));var _=require(_0xcb6c('0xb'));var squel=require('squel');var crypto=require(_0xcb6c('0xc'));var jsforce=require(_0xcb6c('0xd'));var deskjs=require(_0xcb6c('0xe'));var toCsv=require(_0xcb6c('0x8'));var querystring=require('querystring');var Papa=require(_0xcb6c('0xf'));var Redis=require(_0xcb6c('0x10'));var authService=require(_0xcb6c('0x11'));var qs=require(_0xcb6c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb6c('0x13'))(_0xcb6c('0x14'));var utils=require(_0xcb6c('0x15'));var config=require(_0xcb6c('0x16'));var licenseUtil=require(_0xcb6c('0x17'));var db=require(_0xcb6c('0x18'))['db'];var integrations=require(_0xcb6c('0x19'));function respondWithStatusCode(_0x522fcf,_0x12972c){_0x12972c=_0x12972c||0xcc;return function(_0x15c9af){if(_0x15c9af){return _0x522fcf[_0xcb6c('0x1a')](_0x12972c);}return _0x522fcf['status'](_0x12972c)['end']();};}function respondWithResult(_0x21f9c4,_0x58209c){_0x58209c=_0x58209c||0xc8;return function(_0x30c854){if(_0x30c854){return _0x21f9c4['status'](_0x58209c)['json'](_0x30c854);}};}function respondWithFilteredResult(_0x17dad6,_0xf69c42){return function(_0x4a6f1b){if(_0x4a6f1b){var _0x1808a4=typeof _0xf69c42[_0xcb6c('0x1b')]===_0xcb6c('0x1c')&&typeof _0xf69c42[_0xcb6c('0x1d')]===_0xcb6c('0x1c');var _0x511efd=_0x4a6f1b[_0xcb6c('0x1e')];var _0xd0388=_0x1808a4?0x0:_0xf69c42[_0xcb6c('0x1b')];var _0x474bbd=_0x1808a4?_0x4a6f1b[_0xcb6c('0x1e')]:_0xf69c42[_0xcb6c('0x1b')]+_0xf69c42['limit'];var _0x8c801;if(_0x474bbd>=_0x511efd){_0x474bbd=_0x511efd;_0x8c801=0xc8;}else{_0x8c801=0xce;}_0x17dad6[_0xcb6c('0x1f')](_0x8c801);return _0x17dad6[_0xcb6c('0x20')](_0xcb6c('0x21'),_0xd0388+'-'+_0x474bbd+'/'+_0x511efd)[_0xcb6c('0x22')](_0x4a6f1b);}return null;};}function patchUpdates(_0x26f374){return function(_0x1e51d7){try{jsonpatch['apply'](_0x1e51d7,_0x26f374,!![]);}catch(_0x224027){return BPromise['reject'](_0x224027);}return _0x1e51d7[_0xcb6c('0x23')]();};}function saveUpdates(_0x5dde40,_0x1ec437){return function(_0x487521){if(_0x487521){return _0x487521[_0xcb6c('0x24')](_0x5dde40)[_0xcb6c('0x25')](function(_0x478680){return _0x478680;});}return null;};}function removeEntity(_0x111337,_0x260877){return function(_0x139446){if(_0x139446){return _0x139446[_0xcb6c('0x26')]()[_0xcb6c('0x25')](function(){_0x111337[_0xcb6c('0x1f')](0xcc)[_0xcb6c('0x27')]();});}};}function handleEntityNotFound(_0x13d1ca,_0x1f02d3){return function(_0x154d54){if(!_0x154d54){_0x13d1ca['sendStatus'](0x194);}return _0x154d54;};}function handleError(_0x1e7bd2,_0x4cb2bc){_0x4cb2bc=_0x4cb2bc||0x1f4;return function(_0x5808c5){logger[_0xcb6c('0x28')](_0x5808c5[_0xcb6c('0x29')]);if(_0x5808c5['name']){delete _0x5808c5[_0xcb6c('0x2a')];}_0x1e7bd2['status'](_0x4cb2bc)[_0xcb6c('0x2b')](_0x5808c5);};}exports[_0xcb6c('0x2c')]=function(_0x478480,_0x38f2dd){var _0x3300a8={},_0x1870de={},_0x45f32b={'count':0x0,'rows':[]};var _0x49b6f2=_[_0xcb6c('0x2d')](db[_0xcb6c('0x2e')][_0xcb6c('0x2f')],function(_0x3c6d76){return{'name':_0x3c6d76[_0xcb6c('0x30')],'type':_0x3c6d76[_0xcb6c('0x31')][_0xcb6c('0x32')]};});_0x1870de[_0xcb6c('0x33')]=_[_0xcb6c('0x2d')](_0x49b6f2,_0xcb6c('0x2a'));_0x1870de[_0xcb6c('0x34')]=_[_0xcb6c('0x35')](_0x478480[_0xcb6c('0x34')]);_0x1870de['filters']=_['intersection'](_0x1870de[_0xcb6c('0x33')],_0x1870de['query']);_0x3300a8[_0xcb6c('0x36')]=_[_0xcb6c('0x37')](_0x1870de[_0xcb6c('0x33')],qs[_0xcb6c('0x38')](_0x478480[_0xcb6c('0x34')][_0xcb6c('0x38')]));_0x3300a8[_0xcb6c('0x36')]=_0x3300a8['attributes']['length']?_0x3300a8[_0xcb6c('0x36')]:_0x1870de[_0xcb6c('0x33')];if(!_0x478480['query'][_0xcb6c('0x39')](_0xcb6c('0x3a'))){_0x3300a8[_0xcb6c('0x1d')]=qs[_0xcb6c('0x1d')](_0x478480[_0xcb6c('0x34')][_0xcb6c('0x1d')]);_0x3300a8[_0xcb6c('0x1b')]=qs[_0xcb6c('0x1b')](_0x478480[_0xcb6c('0x34')][_0xcb6c('0x1b')]);}_0x3300a8[_0xcb6c('0x3b')]=qs[_0xcb6c('0x3c')](_0x478480[_0xcb6c('0x34')]['sort']);_0x3300a8[_0xcb6c('0x3d')]=qs[_0xcb6c('0x3e')](_[_0xcb6c('0x3f')](_0x478480[_0xcb6c('0x34')],_0x1870de[_0xcb6c('0x3e')]),_0x49b6f2);if(_0x478480[_0xcb6c('0x34')][_0xcb6c('0x40')]){_0x3300a8['where']=_['merge'](_0x3300a8[_0xcb6c('0x3d')],{'$or':_[_0xcb6c('0x2d')](_0x49b6f2,function(_0x3d298d){if(_0x3d298d[_0xcb6c('0x31')]!=='VIRTUAL'){var _0x3cb101={};_0x3cb101[_0x3d298d['name']]={'$like':'%'+_0x478480[_0xcb6c('0x34')][_0xcb6c('0x40')]+'%'};return _0x3cb101;}})});}_0x3300a8=_['merge']({},_0x3300a8,_0x478480['options']);var _0x2a3200={'where':_0x3300a8[_0xcb6c('0x3d')]};return db[_0xcb6c('0x2e')][_0xcb6c('0x1e')](_0x2a3200)[_0xcb6c('0x25')](function(_0x44b9f9){_0x45f32b[_0xcb6c('0x1e')]=_0x44b9f9;if(_0x478480[_0xcb6c('0x34')][_0xcb6c('0x41')]){_0x3300a8['include']=[{'all':!![]}];}return db[_0xcb6c('0x2e')][_0xcb6c('0x42')](_0x3300a8);})[_0xcb6c('0x25')](function(_0x5d5ffc){_0x45f32b[_0xcb6c('0x43')]=_0x5d5ffc;return _0x45f32b;})['then'](respondWithFilteredResult(_0x38f2dd,_0x3300a8))['catch'](handleError(_0x38f2dd,null));};exports['show']=function(_0x2ddf96,_0x557b48){var _0x433418={'raw':![],'where':{'id':_0x2ddf96[_0xcb6c('0x44')]['id']}},_0x5d6632={};_0x5d6632[_0xcb6c('0x33')]=_[_0xcb6c('0x35')](db[_0xcb6c('0x2e')][_0xcb6c('0x2f')]);_0x5d6632['query']=_[_0xcb6c('0x35')](_0x2ddf96['query']);_0x5d6632[_0xcb6c('0x3e')]=_[_0xcb6c('0x37')](_0x5d6632[_0xcb6c('0x33')],_0x5d6632[_0xcb6c('0x34')]);_0x433418[_0xcb6c('0x36')]=_[_0xcb6c('0x37')](_0x5d6632[_0xcb6c('0x33')],qs['fields'](_0x2ddf96[_0xcb6c('0x34')]['fields']));_0x433418['attributes']=_0x433418[_0xcb6c('0x36')][_0xcb6c('0x45')]?_0x433418[_0xcb6c('0x36')]:_0x5d6632[_0xcb6c('0x33')];if(_0x2ddf96[_0xcb6c('0x34')][_0xcb6c('0x41')]){_0x433418[_0xcb6c('0x46')]=[{'all':!![]}];}_0x433418=_[_0xcb6c('0x47')]({},_0x433418,_0x2ddf96[_0xcb6c('0x48')]);return db[_0xcb6c('0x2e')][_0xcb6c('0x49')](_0x433418)[_0xcb6c('0x25')](handleEntityNotFound(_0x557b48,null))[_0xcb6c('0x25')](respondWithResult(_0x557b48,null))['catch'](handleError(_0x557b48,null));};exports[_0xcb6c('0x4a')]=function(_0x1b5649,_0x3fe50c){return db['DeskAccount']['create'](_0x1b5649[_0xcb6c('0x4b')],{})[_0xcb6c('0x25')](respondWithResult(_0x3fe50c,0xc9))[_0xcb6c('0x4c')](handleError(_0x3fe50c,null));};exports['update']=function(_0x2ed8f0,_0x38b3b7){if(_0x2ed8f0['body']['id']){delete _0x2ed8f0['body']['id'];}return db[_0xcb6c('0x2e')]['find']({'where':{'id':_0x2ed8f0['params']['id']}})[_0xcb6c('0x25')](handleEntityNotFound(_0x38b3b7,null))['then'](saveUpdates(_0x2ed8f0[_0xcb6c('0x4b')],null))[_0xcb6c('0x25')](respondWithResult(_0x38b3b7,null))['catch'](handleError(_0x38b3b7,null));};exports[_0xcb6c('0x26')]=function(_0x572f76,_0x5e0de8){return db['DeskAccount']['find']({'where':{'id':_0x572f76[_0xcb6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e0de8,null))[_0xcb6c('0x25')](removeEntity(_0x5e0de8,null))[_0xcb6c('0x4c')](handleError(_0x5e0de8,null));};exports[_0xcb6c('0x4d')]=function(_0x5e1a69,_0x256109,_0xc8ee21){var _0x31634d={};var _0x2f5d1d={};var _0x22ff97;var _0x2c11e5;return db[_0xcb6c('0x2e')][_0xcb6c('0x4e')]({'where':{'id':_0x5e1a69[_0xcb6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x256109,null))[_0xcb6c('0x25')](function(_0xa7a0d6){if(_0xa7a0d6){_0x22ff97=_0xa7a0d6;_0x2f5d1d[_0xcb6c('0x33')]=_[_0xcb6c('0x35')](db[_0xcb6c('0x4f')][_0xcb6c('0x2f')]);_0x2f5d1d[_0xcb6c('0x34')]=_['keys'](_0x5e1a69[_0xcb6c('0x34')]);_0x2f5d1d[_0xcb6c('0x3e')]=_[_0xcb6c('0x37')](_0x2f5d1d['model'],_0x2f5d1d['query']);_0x31634d[_0xcb6c('0x36')]=_[_0xcb6c('0x37')](_0x2f5d1d['model'],qs[_0xcb6c('0x38')](_0x5e1a69[_0xcb6c('0x34')][_0xcb6c('0x38')]));_0x31634d[_0xcb6c('0x36')]=_0x31634d[_0xcb6c('0x36')]['length']?_0x31634d[_0xcb6c('0x36')]:_0x2f5d1d[_0xcb6c('0x33')];_0x31634d[_0xcb6c('0x3b')]=qs[_0xcb6c('0x3c')](_0x5e1a69[_0xcb6c('0x34')][_0xcb6c('0x3c')]);_0x31634d[_0xcb6c('0x3d')]=qs[_0xcb6c('0x3e')](_[_0xcb6c('0x3f')](_0x5e1a69[_0xcb6c('0x34')],_0x2f5d1d['filters']));if(_0x5e1a69[_0xcb6c('0x34')][_0xcb6c('0x40')]){_0x31634d[_0xcb6c('0x3d')]=_[_0xcb6c('0x47')](_0x31634d[_0xcb6c('0x3d')],{'$or':_[_0xcb6c('0x2d')](_0x31634d[_0xcb6c('0x36')],function(_0x9f63fb){var _0x51e5ad={};_0x51e5ad[_0x9f63fb]={'$like':'%'+_0x5e1a69[_0xcb6c('0x34')]['filter']+'%'};return _0x51e5ad;})});}_0x31634d=_[_0xcb6c('0x47')]({},_0x31634d,_0x5e1a69[_0xcb6c('0x48')]);return _0x22ff97[_0xcb6c('0x4d')](_0x31634d);}})['then'](function(_0x553ae0){if(_0x553ae0){_0x2c11e5=_0x553ae0[_0xcb6c('0x45')];if(!_0x5e1a69[_0xcb6c('0x34')][_0xcb6c('0x39')]('nolimit')){_0x31634d[_0xcb6c('0x1d')]=qs[_0xcb6c('0x1d')](_0x5e1a69['query'][_0xcb6c('0x1d')]);_0x31634d[_0xcb6c('0x1b')]=qs[_0xcb6c('0x1b')](_0x5e1a69[_0xcb6c('0x34')][_0xcb6c('0x1b')]);}return _0x22ff97['getConfigurations'](_0x31634d);}})[_0xcb6c('0x25')](function(_0x98f871){if(_0x98f871){return _0x98f871?{'count':_0x2c11e5,'rows':_0x98f871}:null;}})[_0xcb6c('0x25')](respondWithResult(_0x256109,null))[_0xcb6c('0x4c')](handleError(_0x256109,null));};exports[_0xcb6c('0x50')]=function(_0x29a2d4,_0x57fb4e,_0x1ecaf0){if(_0x29a2d4[_0xcb6c('0x4b')]['id']){delete _0x29a2d4['body']['id'];}return db[_0xcb6c('0x2e')]['findOne']({'where':{'id':_0x29a2d4[_0xcb6c('0x44')]['id']}})[_0xcb6c('0x25')](handleEntityNotFound(_0x57fb4e,null))['then'](function(_0x22bd9b){if(_0x22bd9b){_0x29a2d4[_0xcb6c('0x4b')][_0xcb6c('0x51')]=_0x22bd9b['id'];_0x29a2d4[_0xcb6c('0x4b')][_0xcb6c('0x52')]=integrations[_0xcb6c('0x53')](_0x29a2d4[_0xcb6c('0x4b')]['channel'],_0x29a2d4[_0xcb6c('0x4b')]['type']);_0x29a2d4[_0xcb6c('0x4b')][_0xcb6c('0x54')]=integrations[_0xcb6c('0x55')](_0x29a2d4[_0xcb6c('0x4b')][_0xcb6c('0x56')],_0x29a2d4[_0xcb6c('0x4b')][_0xcb6c('0x31')]);return db['DeskConfiguration']['create'](_0x29a2d4[_0xcb6c('0x4b')],{'include':[{'model':db[_0xcb6c('0x57')],'as':_0xcb6c('0x52')},{'model':db[_0xcb6c('0x57')],'as':_0xcb6c('0x54')}]});}return null;})[_0xcb6c('0x25')](respondWithResult(_0x57fb4e,null))[_0xcb6c('0x4c')](handleError(_0x57fb4e,null));};exports[_0xcb6c('0x58')]=function(_0x2abbd3,_0x12d47e,_0x1c7e67){var _0x4a566f=[{'name':_0xcb6c('0x59'),'label':_0xcb6c('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4be795='';return db['DeskAccount'][_0xcb6c('0x4e')]({'where':{'id':_0x2abbd3[_0xcb6c('0x44')]['id']},'attributes':['id',_0xcb6c('0x5a'),_0xcb6c('0x5b'),_0xcb6c('0x5c'),_0xcb6c('0x5d'),'consumerKey',_0xcb6c('0x5e'),_0xcb6c('0x5f'),_0xcb6c('0x60')]})[_0xcb6c('0x25')](handleEntityNotFound(_0x12d47e,null))[_0xcb6c('0x25')](function(_0x4dc389){if(_0x4dc389){_0x4be795=_0x4dc389[_0xcb6c('0x5a')];var _0xae4bd4=_0x4be795[_0xcb6c('0x61')](-0x1);if(_0xae4bd4==='/'){_0x4be795=_0x4be795['substring'](0x0,_0x4be795[_0xcb6c('0x62')](_0xae4bd4));}var _0x4b14a4={'method':_0xcb6c('0x63'),'uri':util[_0xcb6c('0x64')](_0xcb6c('0x65'),_0x4be795),'headers':{'Content-Type':_0xcb6c('0x66'),'Accept':'application/json'},'json':!![]};if(_0x4dc389['authType']===_0xcb6c('0x67')){_0x4b14a4['headers']['Authorization']=util[_0xcb6c('0x64')](_0xcb6c('0x68'),new Buffer(util[_0xcb6c('0x64')](_0xcb6c('0x69'),_0x4dc389[_0xcb6c('0x5c')],_0x4dc389[_0xcb6c('0x5d')]))['toString'](_0xcb6c('0x6a')));}return rp(_0x4b14a4)[_0xcb6c('0x25')](function(_0x51433f){return _0x4a566f[_0xcb6c('0x6b')](_[_0xcb6c('0x2d')](_0x51433f['_embedded'][_0xcb6c('0x6c')],function(_0x2fd33a){return{'id':_0x2fd33a[_0xcb6c('0x2a')],'name':_0x2fd33a[_0xcb6c('0x2a')],'type':_0x2fd33a[_0xcb6c('0x31')],'active':_0x2fd33a[_0xcb6c('0x6d')],'label':_0x2fd33a[_0xcb6c('0x6e')],'custom':!![]};}));});}})[_0xcb6c('0x25')](function(_0x57e68d){return{'count':_0x57e68d[_0xcb6c('0x45')],'rows':_0x57e68d};})[_0xcb6c('0x25')](respondWithResult(_0x12d47e,null))[_0xcb6c('0x4c')](function(_0x455636){var _0x17ff39=_0x2abbd3[_0xcb6c('0x34')][_0xcb6c('0x6f')]?0x1f4:_0x455636[_0xcb6c('0x70')]||0x1f4;logger[_0xcb6c('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xcb6c('0x58'),_0x17ff39,JSON[_0xcb6c('0x71')](_0x455636));delete _0x455636[_0xcb6c('0x2a')];if(_0x17ff39===0x191){_0x17ff39=0x190;}_0x12d47e['status'](_0x17ff39)[_0xcb6c('0x2b')](_0x2abbd3[_0xcb6c('0x34')][_0xcb6c('0x6f')]?{'message':_0xcb6c('0x72'),'statusCode':_0x455636[_0xcb6c('0x70')]}:_0x455636);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 8239d1d..622d7d5 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 _0x63d2=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3bcfff,_0xc8fda7){var _0x330638=function(_0x25d928){while(--_0x25d928){_0x3bcfff['push'](_0x3bcfff['shift']());}};_0x330638(++_0xc8fda7);}(_0x63d2,0x165));var _0x263d=function(_0x29f9e4,_0x24e9e8){_0x29f9e4=_0x29f9e4-0x0;var _0x45bee0=_0x63d2[_0x29f9e4];return _0x45bee0;};'use strict';var _=require(_0x263d('0x0'));var util=require(_0x263d('0x1'));var logger=require(_0x263d('0x2'))(_0x263d('0x3'));var moment=require(_0x263d('0x4'));var BPromise=require(_0x263d('0x5'));var rp=require(_0x263d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x263d('0x7'));var config=require(_0x263d('0x8'));var attributes=require(_0x263d('0x9'));var integrations=require(_0x263d('0xa'));module[_0x263d('0xb')]=function(_0x23680b,_0x2e96df){return _0x23680b['define'](_0x263d('0xc'),attributes,{'tableName':_0x263d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c61=['../../components/integrations/configuration','exports','define','DeskAccount','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0xe7286d,_0x153012){var _0x573894=function(_0xdfc37f){while(--_0xdfc37f){_0xe7286d['push'](_0xe7286d['shift']());}};_0x573894(++_0x153012);}(_0x3c61,0x94));var _0x13c6=function(_0x532550,_0x49ab2a){_0x532550=_0x532550-0x0;var _0x5cc4d8=_0x3c61[_0x532550];return _0x5cc4d8;};'use strict';var _=require(_0x13c6('0x0'));var util=require('util');var logger=require(_0x13c6('0x1'))('api');var moment=require(_0x13c6('0x2'));var BPromise=require('bluebird');var rp=require(_0x13c6('0x3'));var fs=require('fs');var path=require(_0x13c6('0x4'));var rimraf=require(_0x13c6('0x5'));var config=require(_0x13c6('0x6'));var attributes=require(_0x13c6('0x7'));var integrations=require(_0x13c6('0x8'));module[_0x13c6('0x9')]=function(_0x33ab32,_0x1b852a){return _0x33ab32[_0x13c6('0xa')](_0x13c6('0xb'),attributes,{'tableName':'int_desk_accounts','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 61e74a6..23a74f3 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 _0x9f23=['attributes','limit','include','model','map','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','GetDeskAccount','findAll','options','raw','where'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x9f23,0xa7));var _0x39f2=function(_0x1c81a4,_0x2dc81f){_0x1c81a4=_0x1c81a4-0x0;var _0x5677d9=_0x9f23[_0x1c81a4];return _0x5677d9;};'use strict';var _=require(_0x39f2('0x0'));var util=require(_0x39f2('0x1'));var moment=require(_0x39f2('0x2'));var BPromise=require('bluebird');var rs=require(_0x39f2('0x3'));var fs=require('fs');var Redis=require(_0x39f2('0x4'));var db=require(_0x39f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39f2('0x6'));var config=require(_0x39f2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x39f2('0x8')][_0x39f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33cf09,_0x31b3ed,_0x57a3a3){return new BPromise(function(_0xb2dbc9,_0x1b8ea5){return client[_0x39f2('0xa')](_0x33cf09,_0x57a3a3)['then'](function(_0x32f3bd){logger['info'](_0x39f2('0xb'),_0x31b3ed,'request\x20sent');logger[_0x39f2('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x31b3ed,_0x39f2('0xd'),JSON[_0x39f2('0xe')](_0x32f3bd));if(_0x32f3bd[_0x39f2('0xf')]){if(_0x32f3bd[_0x39f2('0xf')]['code']===0x1f4){logger[_0x39f2('0xf')](_0x39f2('0xb'),_0x31b3ed,_0x32f3bd[_0x39f2('0xf')][_0x39f2('0x10')]);return _0x1b8ea5(_0x32f3bd[_0x39f2('0xf')][_0x39f2('0x10')]);}logger['error'](_0x39f2('0xb'),_0x31b3ed,_0x32f3bd[_0x39f2('0xf')]['message']);return _0xb2dbc9(_0x32f3bd[_0x39f2('0xf')][_0x39f2('0x10')]);}else{logger[_0x39f2('0x11')]('DeskAccount,\x20%s,\x20%s',_0x31b3ed,_0x39f2('0xd'));_0xb2dbc9(_0x32f3bd[_0x39f2('0x12')][_0x39f2('0x10')]);}})[_0x39f2('0x13')](function(_0x1f70cc){logger[_0x39f2('0xf')](_0x39f2('0xb'),_0x31b3ed,_0x1f70cc);_0x1b8ea5(_0x1f70cc);});});}exports[_0x39f2('0x14')]=function(_0x27441c){var _0xef1697=this;return new Promise(function(_0xc655eb,_0x21f293){return db['DeskAccount'][_0x39f2('0x15')]({'raw':_0x27441c[_0x39f2('0x16')]?_0x27441c['options'][_0x39f2('0x17')]===undefined?!![]:![]:!![],'where':_0x27441c[_0x39f2('0x16')]?_0x27441c[_0x39f2('0x16')][_0x39f2('0x18')]||null:null,'attributes':_0x27441c[_0x39f2('0x16')]?_0x27441c[_0x39f2('0x16')][_0x39f2('0x19')]||null:null,'limit':_0x27441c[_0x39f2('0x16')]?_0x27441c[_0x39f2('0x16')][_0x39f2('0x1a')]||null:null,'include':_0x27441c[_0x39f2('0x16')]?_0x27441c[_0x39f2('0x16')][_0x39f2('0x1b')]?_['map'](_0x27441c[_0x39f2('0x16')][_0x39f2('0x1b')],function(_0x54e8fc){return{'model':db[_0x54e8fc[_0x39f2('0x1c')]],'as':_0x54e8fc['as'],'attributes':_0x54e8fc[_0x39f2('0x19')],'include':_0x54e8fc[_0x39f2('0x1b')]?_[_0x39f2('0x1d')](_0x54e8fc[_0x39f2('0x1b')],function(_0x291075){return{'model':db[_0x291075[_0x39f2('0x1c')]],'as':_0x291075['as'],'attributes':_0x291075['attributes'],'include':_0x291075[_0x39f2('0x1b')]?_[_0x39f2('0x1d')](_0x291075[_0x39f2('0x1b')],function(_0x18f22d){return{'model':db[_0x18f22d['model']],'as':_0x18f22d['as'],'attributes':_0x18f22d[_0x39f2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdecfb6){logger[_0x39f2('0x11')](_0x39f2('0x14'),_0x27441c);logger[_0x39f2('0xc')]('GetDeskAccount',_0x27441c,JSON[_0x39f2('0xe')](_0xdecfb6));_0xc655eb(_0xdecfb6);})[_0x39f2('0x13')](function(_0x4e6106){logger['error'](_0x39f2('0x14'),_0x4e6106[_0x39f2('0x10')],_0x27441c);_0x21f293(_0xef1697['error'](0x1f4,_0x4e6106['message']));});});};exports[_0x39f2('0x1e')]=function(_0x4c6625){var _0x52b915=this;return new Promise(function(_0x1f747e,_0x3e7d4b){return db['DeskAccount'][_0x39f2('0x1f')]({'raw':_0x4c6625[_0x39f2('0x16')]?_0x4c6625['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c6625[_0x39f2('0x16')]?_0x4c6625[_0x39f2('0x16')][_0x39f2('0x18')]||null:null,'attributes':_0x4c6625[_0x39f2('0x16')]?_0x4c6625[_0x39f2('0x16')][_0x39f2('0x19')]||null:null,'include':_0x4c6625[_0x39f2('0x16')]?_0x4c6625[_0x39f2('0x16')][_0x39f2('0x1b')]?_[_0x39f2('0x1d')](_0x4c6625['options'][_0x39f2('0x1b')],function(_0x5f1564){return{'model':db[_0x5f1564[_0x39f2('0x1c')]],'as':_0x5f1564['as'],'attributes':_0x5f1564[_0x39f2('0x19')],'include':_0x5f1564[_0x39f2('0x1b')]?_[_0x39f2('0x1d')](_0x5f1564[_0x39f2('0x1b')],function(_0x2bf422){return{'model':db[_0x2bf422['model']],'as':_0x2bf422['as'],'attributes':_0x2bf422['attributes'],'include':_0x2bf422[_0x39f2('0x1b')]?_['map'](_0x2bf422[_0x39f2('0x1b')],function(_0x15563a){return{'model':db[_0x15563a[_0x39f2('0x1c')]],'as':_0x15563a['as'],'attributes':_0x15563a[_0x39f2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53d160){logger[_0x39f2('0x11')](_0x39f2('0x1e'),_0x4c6625);logger[_0x39f2('0xc')]('ShowDeskAccount',_0x4c6625,JSON['stringify'](_0x53d160));_0x1f747e(_0x53d160);})[_0x39f2('0x13')](function(_0x7183be){logger[_0x39f2('0xf')](_0x39f2('0x1e'),_0x7183be['message'],_0x4c6625);_0x3e7d4b(_0x52b915[_0x39f2('0xf')](0x1f4,_0x7183be[_0x39f2('0x10')]));});});}; \ No newline at end of file +var _0x160b=['http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','map','include','model','debug','ShowDeskAccount','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xf1f395,_0x4b8d53){var _0x5c67f3=function(_0x3db87e){while(--_0x3db87e){_0xf1f395['push'](_0xf1f395['shift']());}};_0x5c67f3(++_0x4b8d53);}(_0x160b,0xd1));var _0xb160=function(_0x22032b,_0xb682b6){_0x22032b=_0x22032b-0x0;var _0x33c487=_0x160b[_0x22032b];return _0x33c487;};'use strict';var _=require(_0xb160('0x0'));var util=require(_0xb160('0x1'));var moment=require(_0xb160('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb160('0x3'))['db'];var utils=require(_0xb160('0x4'));var logger=require('../../config/logger')(_0xb160('0x5'));var config=require(_0xb160('0x6'));var jayson=require(_0xb160('0x7'));var client=jayson['client'][_0xb160('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb1ea5c,_0x28b3cb,_0x219e2c){return new BPromise(function(_0x40ab78,_0x2a58dc){return client[_0xb160('0x9')](_0xb1ea5c,_0x219e2c)[_0xb160('0xa')](function(_0x4f2fb1){logger[_0xb160('0xb')](_0xb160('0xc'),_0x28b3cb,_0xb160('0xd'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x28b3cb,_0xb160('0xd'),JSON[_0xb160('0xe')](_0x4f2fb1));if(_0x4f2fb1[_0xb160('0xf')]){if(_0x4f2fb1['error'][_0xb160('0x10')]===0x1f4){logger[_0xb160('0xf')](_0xb160('0xc'),_0x28b3cb,_0x4f2fb1[_0xb160('0xf')]['message']);return _0x2a58dc(_0x4f2fb1[_0xb160('0xf')][_0xb160('0x11')]);}logger[_0xb160('0xf')](_0xb160('0xc'),_0x28b3cb,_0x4f2fb1['error'][_0xb160('0x11')]);return _0x40ab78(_0x4f2fb1[_0xb160('0xf')][_0xb160('0x11')]);}else{logger[_0xb160('0xb')](_0xb160('0xc'),_0x28b3cb,_0xb160('0xd'));_0x40ab78(_0x4f2fb1[_0xb160('0x12')][_0xb160('0x11')]);}})['catch'](function(_0x2576dd){logger['error'](_0xb160('0xc'),_0x28b3cb,_0x2576dd);_0x2a58dc(_0x2576dd);});});}exports[_0xb160('0x13')]=function(_0x1d24bf){var _0x3880d5=this;return new Promise(function(_0x2b1960,_0x217add){return db[_0xb160('0x14')][_0xb160('0x15')]({'raw':_0x1d24bf[_0xb160('0x16')]?_0x1d24bf[_0xb160('0x16')][_0xb160('0x17')]===undefined?!![]:![]:!![],'where':_0x1d24bf['options']?_0x1d24bf[_0xb160('0x16')][_0xb160('0x18')]||null:null,'attributes':_0x1d24bf[_0xb160('0x16')]?_0x1d24bf[_0xb160('0x16')][_0xb160('0x19')]||null:null,'limit':_0x1d24bf[_0xb160('0x16')]?_0x1d24bf[_0xb160('0x16')]['limit']||null:null,'include':_0x1d24bf[_0xb160('0x16')]?_0x1d24bf[_0xb160('0x16')]['include']?_[_0xb160('0x1a')](_0x1d24bf[_0xb160('0x16')][_0xb160('0x1b')],function(_0x26e284){return{'model':db[_0x26e284[_0xb160('0x1c')]],'as':_0x26e284['as'],'attributes':_0x26e284[_0xb160('0x19')],'include':_0x26e284['include']?_[_0xb160('0x1a')](_0x26e284['include'],function(_0x49a270){return{'model':db[_0x49a270[_0xb160('0x1c')]],'as':_0x49a270['as'],'attributes':_0x49a270[_0xb160('0x19')],'include':_0x49a270[_0xb160('0x1b')]?_[_0xb160('0x1a')](_0x49a270[_0xb160('0x1b')],function(_0x3950c4){return{'model':db[_0x3950c4[_0xb160('0x1c')]],'as':_0x3950c4['as'],'attributes':_0x3950c4[_0xb160('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb160('0xa')](function(_0x10c563){logger[_0xb160('0xb')](_0xb160('0x13'),_0x1d24bf);logger[_0xb160('0x1d')](_0xb160('0x13'),_0x1d24bf,JSON['stringify'](_0x10c563));_0x2b1960(_0x10c563);})['catch'](function(_0x3eabb5){logger[_0xb160('0xf')](_0xb160('0x13'),_0x3eabb5[_0xb160('0x11')],_0x1d24bf);_0x217add(_0x3880d5[_0xb160('0xf')](0x1f4,_0x3eabb5[_0xb160('0x11')]));});});};exports[_0xb160('0x1e')]=function(_0x248f69){var _0x476165=this;return new Promise(function(_0x1c1a90,_0x61578f){return db['DeskAccount']['find']({'raw':_0x248f69[_0xb160('0x16')]?_0x248f69['options'][_0xb160('0x17')]===undefined?!![]:![]:!![],'where':_0x248f69[_0xb160('0x16')]?_0x248f69[_0xb160('0x16')][_0xb160('0x18')]||null:null,'attributes':_0x248f69[_0xb160('0x16')]?_0x248f69[_0xb160('0x16')][_0xb160('0x19')]||null:null,'include':_0x248f69[_0xb160('0x16')]?_0x248f69['options'][_0xb160('0x1b')]?_[_0xb160('0x1a')](_0x248f69[_0xb160('0x16')][_0xb160('0x1b')],function(_0x2eb5bb){return{'model':db[_0x2eb5bb[_0xb160('0x1c')]],'as':_0x2eb5bb['as'],'attributes':_0x2eb5bb[_0xb160('0x19')],'include':_0x2eb5bb[_0xb160('0x1b')]?_[_0xb160('0x1a')](_0x2eb5bb[_0xb160('0x1b')],function(_0xdd8c7e){return{'model':db[_0xdd8c7e[_0xb160('0x1c')]],'as':_0xdd8c7e['as'],'attributes':_0xdd8c7e[_0xb160('0x19')],'include':_0xdd8c7e[_0xb160('0x1b')]?_[_0xb160('0x1a')](_0xdd8c7e[_0xb160('0x1b')],function(_0x476072){return{'model':db[_0x476072[_0xb160('0x1c')]],'as':_0x476072['as'],'attributes':_0x476072[_0xb160('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb160('0xa')](function(_0x3534f8){logger[_0xb160('0xb')](_0xb160('0x1e'),_0x248f69);logger['debug'](_0xb160('0x1e'),_0x248f69,JSON[_0xb160('0xe')](_0x3534f8));_0x1c1a90(_0x3534f8);})['catch'](function(_0x2406b4){logger[_0xb160('0xf')]('ShowDeskAccount',_0x2406b4[_0xb160('0x11')],_0x248f69);_0x61578f(_0x476165[_0xb160('0xf')](0x1f4,_0x2406b4[_0xb160('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6a66f68..18294e6 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 _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4200f6,_0x157129){var _0x53ae35=function(_0x30e832){while(--_0x30e832){_0x4200f6['push'](_0x4200f6['shift']());}};_0x53ae35(++_0x157129);}(_0x34e8,0x12c));var _0x834e=function(_0x313f23,_0x1b7daf){_0x313f23=_0x313f23-0x0;var _0x29ded7=_0x34e8[_0x313f23];return _0x29ded7;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x232059,_0x5624da){var _0x36dc05=function(_0x2f617c){while(--_0x2f617c){_0x232059['push'](_0x232059['shift']());}};_0x36dc05(++_0x5624da);}(_0x34e8,0x12c));var _0x834e=function(_0xd73489,_0x443df0){_0xd73489=_0xd73489-0x0;var _0x34df78=_0x34e8[_0xd73489];return _0x34df78;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e032330..a7eeff6 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 _0xa9c4=['STRING','sequelize','exports'];(function(_0x31b9c7,_0x5d9ed2){var _0x17875a=function(_0x47b09d){while(--_0x47b09d){_0x31b9c7['push'](_0x31b9c7['shift']());}};_0x17875a(++_0x5d9ed2);}(_0xa9c4,0xdf));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4a9c('0x0'));module[_0x4a9c('0x1')]={'name':{'type':Sequelize[_0x4a9c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c2d=['exports','STRING','sequelize'];(function(_0x5db1a4,_0x14aa78){var _0x21ac3f=function(_0x108068){while(--_0x108068){_0x5db1a4['push'](_0x5db1a4['shift']());}};_0x21ac3f(++_0x14aa78);}(_0x6c2d,0x1eb));var _0xd6c2=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x6c2d[_0x17c483];return _0x112bdb;};'use strict';var Sequelize=require(_0xd6c2('0x0'));module[_0xd6c2('0x1')]={'name':{'type':Sequelize[_0xd6c2('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 82b5c76..b91fca2 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 _0xc00a=['Content-Range','apply','save','update','then','destroy','error','name','send','index','DeskConfiguration','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','include','body','find','DeskField','order','getFields','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set'];(function(_0x3bc8b8,_0x3e8590){var _0x2f9a17=function(_0x301e4f){while(--_0x301e4f){_0x3bc8b8['push'](_0x3bc8b8['shift']());}};_0x2f9a17(++_0x3e8590);}(_0xc00a,0x1c3));var _0xac00=function(_0x431ac5,_0x5e319f){_0x431ac5=_0x431ac5-0x0;var _0x235779=_0xc00a[_0x431ac5];return _0x235779;};'use strict';var emlformat=require(_0xac00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac00('0x2'));var util=require(_0xac00('0x3'));var path=require(_0xac00('0x4'));var sox=require(_0xac00('0x5'));var csv=require(_0xac00('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac00('0x7'));var _=require(_0xac00('0x8'));var squel=require(_0xac00('0x9'));var crypto=require(_0xac00('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xac00('0xb'));var toCsv=require(_0xac00('0x6'));var querystring=require('querystring');var Papa=require(_0xac00('0xc'));var Redis=require(_0xac00('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xac00('0xe'));var as=require(_0xac00('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac00('0x10'))(_0xac00('0x11'));var utils=require(_0xac00('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xac00('0x13'));var db=require(_0xac00('0x14'))['db'];function respondWithStatusCode(_0xc03fee,_0x548dc8){_0x548dc8=_0x548dc8||0xcc;return function(_0x30a211){if(_0x30a211){return _0xc03fee['sendStatus'](_0x548dc8);}return _0xc03fee['status'](_0x548dc8)[_0xac00('0x15')]();};}function respondWithResult(_0x29d3cb,_0xa9ae99){_0xa9ae99=_0xa9ae99||0xc8;return function(_0x102979){if(_0x102979){return _0x29d3cb[_0xac00('0x16')](_0xa9ae99)[_0xac00('0x17')](_0x102979);}};}function respondWithFilteredResult(_0x41ce16,_0x43eb0c){return function(_0x25f1a2){if(_0x25f1a2){var _0x4652c6=typeof _0x43eb0c[_0xac00('0x18')]===_0xac00('0x19')&&typeof _0x43eb0c[_0xac00('0x1a')]===_0xac00('0x19');var _0x43baec=_0x25f1a2['count'];var _0x3b2a13=_0x4652c6?0x0:_0x43eb0c[_0xac00('0x18')];var _0x2ec642=_0x4652c6?_0x25f1a2[_0xac00('0x1b')]:_0x43eb0c[_0xac00('0x18')]+_0x43eb0c[_0xac00('0x1a')];var _0x14c9e9;if(_0x2ec642>=_0x43baec){_0x2ec642=_0x43baec;_0x14c9e9=0xc8;}else{_0x14c9e9=0xce;}_0x41ce16['status'](_0x14c9e9);return _0x41ce16[_0xac00('0x1c')](_0xac00('0x1d'),_0x3b2a13+'-'+_0x2ec642+'/'+_0x43baec)[_0xac00('0x17')](_0x25f1a2);}return null;};}function patchUpdates(_0x1f2017){return function(_0x12eb5d){try{jsonpatch[_0xac00('0x1e')](_0x12eb5d,_0x1f2017,!![]);}catch(_0x484bb){return BPromise['reject'](_0x484bb);}return _0x12eb5d[_0xac00('0x1f')]();};}function saveUpdates(_0x3108b5,_0x555b86){return function(_0x3224f0){if(_0x3224f0){return _0x3224f0[_0xac00('0x20')](_0x3108b5)[_0xac00('0x21')](function(_0x470069){return _0x470069;});}return null;};}function removeEntity(_0x5cd943,_0x3ef836){return function(_0x427e92){if(_0x427e92){return _0x427e92[_0xac00('0x22')]()[_0xac00('0x21')](function(){_0x5cd943[_0xac00('0x16')](0xcc)[_0xac00('0x15')]();});}};}function handleEntityNotFound(_0x42d94e,_0x54a3de){return function(_0x24b43d){if(!_0x24b43d){_0x42d94e['sendStatus'](0x194);}return _0x24b43d;};}function handleError(_0x4a5f75,_0x16f181){_0x16f181=_0x16f181||0x1f4;return function(_0x1859d9){logger[_0xac00('0x23')](_0x1859d9['stack']);if(_0x1859d9['name']){delete _0x1859d9[_0xac00('0x24')];}_0x4a5f75[_0xac00('0x16')](_0x16f181)[_0xac00('0x25')](_0x1859d9);};}exports[_0xac00('0x26')]=function(_0x30ec1e,_0x5bd865){var _0x53aba3={},_0x495c1c={},_0x2d146e={'count':0x0,'rows':[]};var _0x1a463c=_['map'](db[_0xac00('0x27')][_0xac00('0x28')],function(_0x197f96){return{'name':_0x197f96[_0xac00('0x29')],'type':_0x197f96['type'][_0xac00('0x2a')]};});_0x495c1c['model']=_['map'](_0x1a463c,_0xac00('0x24'));_0x495c1c[_0xac00('0x2b')]=_['keys'](_0x30ec1e['query']);_0x495c1c['filters']=_[_0xac00('0x2c')](_0x495c1c['model'],_0x495c1c['query']);_0x53aba3['attributes']=_[_0xac00('0x2c')](_0x495c1c[_0xac00('0x2d')],qs[_0xac00('0x2e')](_0x30ec1e['query']['fields']));_0x53aba3['attributes']=_0x53aba3[_0xac00('0x2f')][_0xac00('0x30')]?_0x53aba3[_0xac00('0x2f')]:_0x495c1c['model'];if(!_0x30ec1e[_0xac00('0x2b')][_0xac00('0x31')](_0xac00('0x32'))){_0x53aba3[_0xac00('0x1a')]=qs[_0xac00('0x1a')](_0x30ec1e[_0xac00('0x2b')]['limit']);_0x53aba3['offset']=qs[_0xac00('0x18')](_0x30ec1e[_0xac00('0x2b')][_0xac00('0x18')]);}_0x53aba3['order']=qs[_0xac00('0x33')](_0x30ec1e[_0xac00('0x2b')][_0xac00('0x33')]);_0x53aba3[_0xac00('0x34')]=qs[_0xac00('0x35')](_[_0xac00('0x36')](_0x30ec1e['query'],_0x495c1c[_0xac00('0x35')]),_0x1a463c);if(_0x30ec1e[_0xac00('0x2b')]['filter']){_0x53aba3[_0xac00('0x34')]=_[_0xac00('0x37')](_0x53aba3[_0xac00('0x34')],{'$or':_[_0xac00('0x38')](_0x1a463c,function(_0x282869){if(_0x282869[_0xac00('0x39')]!==_0xac00('0x3a')){var _0x1bcd04={};_0x1bcd04[_0x282869[_0xac00('0x24')]]={'$like':'%'+_0x30ec1e[_0xac00('0x2b')][_0xac00('0x3b')]+'%'};return _0x1bcd04;}})});}_0x53aba3=_[_0xac00('0x37')]({},_0x53aba3,_0x30ec1e[_0xac00('0x3c')]);var _0x46266c={'where':_0x53aba3['where']};return db[_0xac00('0x27')][_0xac00('0x1b')](_0x46266c)[_0xac00('0x21')](function(_0x437439){_0x2d146e['count']=_0x437439;if(_0x30ec1e['query'][_0xac00('0x3d')]){_0x53aba3['include']=[{'all':!![]}];}return db[_0xac00('0x27')][_0xac00('0x3e')](_0x53aba3);})[_0xac00('0x21')](function(_0x42455c){_0x2d146e['rows']=_0x42455c;return _0x2d146e;})[_0xac00('0x21')](respondWithFilteredResult(_0x5bd865,_0x53aba3))[_0xac00('0x3f')](handleError(_0x5bd865,null));};exports[_0xac00('0x40')]=function(_0x187679,_0x2bfb39){var _0x47953e={'raw':![],'where':{'id':_0x187679[_0xac00('0x41')]['id']}},_0x520359={};_0x520359[_0xac00('0x2d')]=_['keys'](db[_0xac00('0x27')][_0xac00('0x28')]);_0x520359[_0xac00('0x2b')]=_[_0xac00('0x42')](_0x187679[_0xac00('0x2b')]);_0x520359[_0xac00('0x35')]=_[_0xac00('0x2c')](_0x520359['model'],_0x520359[_0xac00('0x2b')]);_0x47953e[_0xac00('0x2f')]=_['intersection'](_0x520359['model'],qs[_0xac00('0x2e')](_0x187679[_0xac00('0x2b')][_0xac00('0x2e')]));_0x47953e['attributes']=_0x47953e[_0xac00('0x2f')]['length']?_0x47953e[_0xac00('0x2f')]:_0x520359['model'];if(_0x187679[_0xac00('0x2b')]['includeAll']){_0x47953e[_0xac00('0x43')]=[{'all':!![]}];}_0x47953e=_[_0xac00('0x37')]({},_0x47953e,_0x187679['options']);return db[_0xac00('0x27')]['find'](_0x47953e)[_0xac00('0x21')](handleEntityNotFound(_0x2bfb39,null))[_0xac00('0x21')](respondWithResult(_0x2bfb39,null))[_0xac00('0x3f')](handleError(_0x2bfb39,null));};exports['create']=function(_0x218c1a,_0x128fa2){return db[_0xac00('0x27')]['create'](_0x218c1a['body'],{})[_0xac00('0x21')](respondWithResult(_0x128fa2,0xc9))[_0xac00('0x3f')](handleError(_0x128fa2,null));};exports[_0xac00('0x20')]=function(_0x21a19b,_0x5b7bc8){if(_0x21a19b[_0xac00('0x44')]['id']){delete _0x21a19b['body']['id'];}return db[_0xac00('0x27')][_0xac00('0x45')]({'where':{'id':_0x21a19b['params']['id']}})[_0xac00('0x21')](handleEntityNotFound(_0x5b7bc8,null))[_0xac00('0x21')](saveUpdates(_0x21a19b['body'],null))['then'](respondWithResult(_0x5b7bc8,null))[_0xac00('0x3f')](handleError(_0x5b7bc8,null));};exports[_0xac00('0x22')]=function(_0x2e82ca,_0x5bed1e){return db[_0xac00('0x27')]['find']({'where':{'id':_0x2e82ca[_0xac00('0x41')]['id']}})[_0xac00('0x21')](handleEntityNotFound(_0x5bed1e,null))[_0xac00('0x21')](removeEntity(_0x5bed1e,null))[_0xac00('0x3f')](handleError(_0x5bed1e,null));};exports['getFields']=function(_0x11d3e1,_0x39963b,_0x475603){var _0x2d3baf={};var _0x3b5f2a={};var _0x5c7f0c;var _0x4121eb;return db[_0xac00('0x27')]['findOne']({'where':{'id':_0x11d3e1[_0xac00('0x41')]['id']}})['then'](handleEntityNotFound(_0x39963b,null))[_0xac00('0x21')](function(_0x5be3aa){if(_0x5be3aa){_0x5c7f0c=_0x5be3aa;_0x3b5f2a[_0xac00('0x2d')]=_[_0xac00('0x42')](db[_0xac00('0x46')]['rawAttributes']);_0x3b5f2a[_0xac00('0x2b')]=_[_0xac00('0x42')](_0x11d3e1[_0xac00('0x2b')]);_0x3b5f2a[_0xac00('0x35')]=_[_0xac00('0x2c')](_0x3b5f2a['model'],_0x3b5f2a['query']);_0x2d3baf[_0xac00('0x2f')]=_['intersection'](_0x3b5f2a[_0xac00('0x2d')],qs[_0xac00('0x2e')](_0x11d3e1[_0xac00('0x2b')]['fields']));_0x2d3baf['attributes']=_0x2d3baf[_0xac00('0x2f')]['length']?_0x2d3baf[_0xac00('0x2f')]:_0x3b5f2a[_0xac00('0x2d')];_0x2d3baf[_0xac00('0x47')]=qs[_0xac00('0x33')](_0x11d3e1['query'][_0xac00('0x33')]);_0x2d3baf[_0xac00('0x34')]=qs['filters'](_[_0xac00('0x36')](_0x11d3e1['query'],_0x3b5f2a[_0xac00('0x35')]));if(_0x11d3e1[_0xac00('0x2b')][_0xac00('0x3b')]){_0x2d3baf[_0xac00('0x34')]=_[_0xac00('0x37')](_0x2d3baf['where'],{'$or':_[_0xac00('0x38')](_0x2d3baf[_0xac00('0x2f')],function(_0x2c2c57){var _0x5edbc6={};_0x5edbc6[_0x2c2c57]={'$like':'%'+_0x11d3e1[_0xac00('0x2b')][_0xac00('0x3b')]+'%'};return _0x5edbc6;})});}_0x2d3baf=_[_0xac00('0x37')]({},_0x2d3baf,_0x11d3e1[_0xac00('0x3c')]);return _0x5c7f0c[_0xac00('0x48')](_0x2d3baf);}})[_0xac00('0x21')](function(_0x34f5d7){if(_0x34f5d7){_0x4121eb=_0x34f5d7[_0xac00('0x30')];if(!_0x11d3e1[_0xac00('0x2b')][_0xac00('0x31')]('nolimit')){_0x2d3baf[_0xac00('0x1a')]=qs[_0xac00('0x1a')](_0x11d3e1[_0xac00('0x2b')]['limit']);_0x2d3baf[_0xac00('0x18')]=qs['offset'](_0x11d3e1[_0xac00('0x2b')]['offset']);}return _0x5c7f0c[_0xac00('0x48')](_0x2d3baf);}})[_0xac00('0x21')](function(_0x13492c){if(_0x13492c){return _0x13492c?{'count':_0x4121eb,'rows':_0x13492c}:null;}})['then'](respondWithResult(_0x39963b,null))['catch'](handleError(_0x39963b,null));};exports[_0xac00('0x49')]=function(_0x45fdc0,_0x4a0ba5,_0x47a6e3){var _0x32226c={};var _0x229b14={};var _0x4303a5;var _0x44b61a;return db[_0xac00('0x27')][_0xac00('0x4a')]({'where':{'id':_0x45fdc0[_0xac00('0x41')]['id']}})[_0xac00('0x21')](handleEntityNotFound(_0x4a0ba5,null))[_0xac00('0x21')](function(_0x2635ca){if(_0x2635ca){_0x4303a5=_0x2635ca;_0x229b14[_0xac00('0x2d')]=_[_0xac00('0x42')](db['DeskField'][_0xac00('0x28')]);_0x229b14[_0xac00('0x2b')]=_[_0xac00('0x42')](_0x45fdc0[_0xac00('0x2b')]);_0x229b14[_0xac00('0x35')]=_[_0xac00('0x2c')](_0x229b14['model'],_0x229b14[_0xac00('0x2b')]);_0x32226c[_0xac00('0x2f')]=_[_0xac00('0x2c')](_0x229b14[_0xac00('0x2d')],qs['fields'](_0x45fdc0[_0xac00('0x2b')]['fields']));_0x32226c[_0xac00('0x2f')]=_0x32226c[_0xac00('0x2f')][_0xac00('0x30')]?_0x32226c[_0xac00('0x2f')]:_0x229b14['model'];_0x32226c[_0xac00('0x47')]=qs[_0xac00('0x33')](_0x45fdc0[_0xac00('0x2b')][_0xac00('0x33')]);_0x32226c[_0xac00('0x34')]=qs[_0xac00('0x35')](_[_0xac00('0x36')](_0x45fdc0['query'],_0x229b14[_0xac00('0x35')]));if(_0x45fdc0[_0xac00('0x2b')][_0xac00('0x3b')]){_0x32226c[_0xac00('0x34')]=_[_0xac00('0x37')](_0x32226c[_0xac00('0x34')],{'$or':_[_0xac00('0x38')](_0x32226c[_0xac00('0x2f')],function(_0x1b24ad){var _0x495bd4={};_0x495bd4[_0x1b24ad]={'$like':'%'+_0x45fdc0[_0xac00('0x2b')][_0xac00('0x3b')]+'%'};return _0x495bd4;})});}_0x32226c=_[_0xac00('0x37')]({},_0x32226c,_0x45fdc0[_0xac00('0x3c')]);return _0x4303a5['getSubjects'](_0x32226c);}})[_0xac00('0x21')](function(_0x24723f){if(_0x24723f){_0x44b61a=_0x24723f[_0xac00('0x30')];if(!_0x45fdc0[_0xac00('0x2b')][_0xac00('0x31')]('nolimit')){_0x32226c[_0xac00('0x1a')]=qs[_0xac00('0x1a')](_0x45fdc0[_0xac00('0x2b')][_0xac00('0x1a')]);_0x32226c[_0xac00('0x18')]=qs[_0xac00('0x18')](_0x45fdc0['query'][_0xac00('0x18')]);}return _0x4303a5[_0xac00('0x49')](_0x32226c);}})[_0xac00('0x21')](function(_0x49621e){if(_0x49621e){return _0x49621e?{'count':_0x44b61a,'rows':_0x49621e}:null;}})[_0xac00('0x21')](respondWithResult(_0x4a0ba5,null))[_0xac00('0x3f')](handleError(_0x4a0ba5,null));};exports['getDescriptions']=function(_0x2e14ef,_0x5909b2,_0x5459d6){var _0x160729={};var _0x3e6326={};var _0x1bfb35;var _0x20140f;return db['DeskConfiguration'][_0xac00('0x4a')]({'where':{'id':_0x2e14ef[_0xac00('0x41')]['id']}})[_0xac00('0x21')](handleEntityNotFound(_0x5909b2,null))[_0xac00('0x21')](function(_0x1492ca){if(_0x1492ca){_0x1bfb35=_0x1492ca;_0x3e6326['model']=_[_0xac00('0x42')](db[_0xac00('0x46')]['rawAttributes']);_0x3e6326[_0xac00('0x2b')]=_[_0xac00('0x42')](_0x2e14ef[_0xac00('0x2b')]);_0x3e6326['filters']=_[_0xac00('0x2c')](_0x3e6326[_0xac00('0x2d')],_0x3e6326['query']);_0x160729[_0xac00('0x2f')]=_[_0xac00('0x2c')](_0x3e6326[_0xac00('0x2d')],qs['fields'](_0x2e14ef[_0xac00('0x2b')][_0xac00('0x2e')]));_0x160729[_0xac00('0x2f')]=_0x160729[_0xac00('0x2f')][_0xac00('0x30')]?_0x160729['attributes']:_0x3e6326[_0xac00('0x2d')];_0x160729['order']=qs[_0xac00('0x33')](_0x2e14ef['query'][_0xac00('0x33')]);_0x160729['where']=qs[_0xac00('0x35')](_[_0xac00('0x36')](_0x2e14ef[_0xac00('0x2b')],_0x3e6326[_0xac00('0x35')]));if(_0x2e14ef[_0xac00('0x2b')]['filter']){_0x160729[_0xac00('0x34')]=_['merge'](_0x160729[_0xac00('0x34')],{'$or':_[_0xac00('0x38')](_0x160729[_0xac00('0x2f')],function(_0x273e0c){var _0x1f5fea={};_0x1f5fea[_0x273e0c]={'$like':'%'+_0x2e14ef[_0xac00('0x2b')][_0xac00('0x3b')]+'%'};return _0x1f5fea;})});}_0x160729=_[_0xac00('0x37')]({},_0x160729,_0x2e14ef['options']);return _0x1bfb35['getDescriptions'](_0x160729);}})['then'](function(_0x5c7ff0){if(_0x5c7ff0){_0x20140f=_0x5c7ff0[_0xac00('0x30')];if(!_0x2e14ef[_0xac00('0x2b')][_0xac00('0x31')](_0xac00('0x32'))){_0x160729[_0xac00('0x1a')]=qs[_0xac00('0x1a')](_0x2e14ef[_0xac00('0x2b')]['limit']);_0x160729['offset']=qs[_0xac00('0x18')](_0x2e14ef[_0xac00('0x2b')][_0xac00('0x18')]);}return _0x1bfb35[_0xac00('0x4b')](_0x160729);}})[_0xac00('0x21')](function(_0x4c5ae7){if(_0x4c5ae7){return _0x4c5ae7?{'count':_0x20140f,'rows':_0x4c5ae7}:null;}})['then'](respondWithResult(_0x5909b2,null))[_0xac00('0x3f')](handleError(_0x5909b2,null));};exports['getTags']=function(_0xb69646,_0x3c2072,_0x54f5b1){var _0xa2f9e0={};var _0x295426={};var _0x400f8a;var _0x25831a;return db[_0xac00('0x27')]['findOne']({'where':{'id':_0xb69646[_0xac00('0x41')]['id']}})[_0xac00('0x21')](handleEntityNotFound(_0x3c2072,null))[_0xac00('0x21')](function(_0x1468ea){if(_0x1468ea){_0x400f8a=_0x1468ea;_0x295426[_0xac00('0x2d')]=_[_0xac00('0x42')](db[_0xac00('0x4c')]['rawAttributes']);_0x295426[_0xac00('0x2b')]=_[_0xac00('0x42')](_0xb69646['query']);_0x295426['filters']=_[_0xac00('0x2c')](_0x295426['model'],_0x295426[_0xac00('0x2b')]);_0xa2f9e0[_0xac00('0x2f')]=_[_0xac00('0x2c')](_0x295426[_0xac00('0x2d')],qs['fields'](_0xb69646[_0xac00('0x2b')]['fields']));_0xa2f9e0['attributes']=_0xa2f9e0[_0xac00('0x2f')][_0xac00('0x30')]?_0xa2f9e0['attributes']:_0x295426[_0xac00('0x2d')];_0xa2f9e0[_0xac00('0x47')]=qs[_0xac00('0x33')](_0xb69646[_0xac00('0x2b')][_0xac00('0x33')]);_0xa2f9e0['where']=qs[_0xac00('0x35')](_[_0xac00('0x36')](_0xb69646['query'],_0x295426[_0xac00('0x35')]));if(_0xb69646[_0xac00('0x2b')][_0xac00('0x3b')]){_0xa2f9e0[_0xac00('0x34')]=_[_0xac00('0x37')](_0xa2f9e0['where'],{'$or':_[_0xac00('0x38')](_0xa2f9e0[_0xac00('0x2f')],function(_0x34c771){var _0x5df697={};_0x5df697[_0x34c771]={'$like':'%'+_0xb69646[_0xac00('0x2b')]['filter']+'%'};return _0x5df697;})});}_0xa2f9e0=_['merge']({},_0xa2f9e0,_0xb69646['options']);return _0x400f8a[_0xac00('0x4d')](_0xa2f9e0);}})[_0xac00('0x21')](function(_0x1daed1){if(_0x1daed1){_0x25831a=_0x1daed1[_0xac00('0x30')];if(!_0xb69646['query'][_0xac00('0x31')]('nolimit')){_0xa2f9e0['limit']=qs[_0xac00('0x1a')](_0xb69646['query']['limit']);_0xa2f9e0[_0xac00('0x18')]=qs[_0xac00('0x18')](_0xb69646[_0xac00('0x2b')]['offset']);}return _0x400f8a['getTags'](_0xa2f9e0);}})[_0xac00('0x21')](function(_0x137e2b){if(_0x137e2b){return _0x137e2b?{'count':_0x25831a,'rows':_0x137e2b}:null;}})[_0xac00('0x21')](respondWithResult(_0x3c2072,null))['catch'](handleError(_0x3c2072,null));};exports[_0xac00('0x4e')]=function(_0x2984c9,_0x414c9c,_0x357d05){if(_0x2984c9['body']['id']){delete _0x2984c9[_0xac00('0x44')]['id'];}return db[_0xac00('0x27')][_0xac00('0x4a')]({'where':{'id':_0x2984c9['params']['id']}})['then'](handleEntityNotFound(_0x414c9c,null))[_0xac00('0x21')](function(_0x28035d){if(_0x28035d){return _0x28035d['setTags'](_0x2984c9['body'][_0xac00('0x4f')]||[]);}return null;})[_0xac00('0x21')](respondWithResult(_0x414c9c,null))[_0xac00('0x3f')](handleError(_0x414c9c,null));}; \ No newline at end of file +var _0x54e4=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','DeskConfiguration','rawAttributes','fieldName','map','query','keys','intersection','attributes','fields','length','model','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','findOne','DeskField','hasOwnProperty','getFields','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x54e4,0x148));var _0x454e=function(_0x154473,_0x37936d){_0x154473=_0x154473-0x0;var _0x58f35e=_0x54e4[_0x154473];return _0x58f35e;};'use strict';var emlformat=require(_0x454e('0x0'));var rimraf=require(_0x454e('0x1'));var zipdir=require(_0x454e('0x2'));var jsonpatch=require(_0x454e('0x3'));var rp=require(_0x454e('0x4'));var moment=require(_0x454e('0x5'));var BPromise=require(_0x454e('0x6'));var Mustache=require(_0x454e('0x7'));var util=require(_0x454e('0x8'));var path=require(_0x454e('0x9'));var sox=require(_0x454e('0xa'));var csv=require(_0x454e('0xb'));var ejs=require(_0x454e('0xc'));var fs=require('fs');var fs_extra=require(_0x454e('0xd'));var _=require(_0x454e('0xe'));var squel=require(_0x454e('0xf'));var crypto=require(_0x454e('0x10'));var jsforce=require(_0x454e('0x11'));var deskjs=require(_0x454e('0x12'));var toCsv=require(_0x454e('0xb'));var querystring=require(_0x454e('0x13'));var Papa=require(_0x454e('0x14'));var Redis=require(_0x454e('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x454e('0x16'));var logger=require(_0x454e('0x17'))('api');var utils=require(_0x454e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x454e('0x19'));var db=require(_0x454e('0x1a'))['db'];function respondWithStatusCode(_0x48315e,_0x3bef08){_0x3bef08=_0x3bef08||0xcc;return function(_0x66cea4){if(_0x66cea4){return _0x48315e[_0x454e('0x1b')](_0x3bef08);}return _0x48315e[_0x454e('0x1c')](_0x3bef08)[_0x454e('0x1d')]();};}function respondWithResult(_0x324662,_0x12a0cb){_0x12a0cb=_0x12a0cb||0xc8;return function(_0x3ba589){if(_0x3ba589){return _0x324662['status'](_0x12a0cb)['json'](_0x3ba589);}};}function respondWithFilteredResult(_0x234699,_0x2bec98){return function(_0x5eb15b){if(_0x5eb15b){var _0x4ffb04=typeof _0x2bec98[_0x454e('0x1e')]===_0x454e('0x1f')&&typeof _0x2bec98['limit']==='undefined';var _0x3728be=_0x5eb15b[_0x454e('0x20')];var _0xfa256b=_0x4ffb04?0x0:_0x2bec98['offset'];var _0x2d58cd=_0x4ffb04?_0x5eb15b[_0x454e('0x20')]:_0x2bec98[_0x454e('0x1e')]+_0x2bec98[_0x454e('0x21')];var _0x4aa0c7;if(_0x2d58cd>=_0x3728be){_0x2d58cd=_0x3728be;_0x4aa0c7=0xc8;}else{_0x4aa0c7=0xce;}_0x234699['status'](_0x4aa0c7);return _0x234699['set'](_0x454e('0x22'),_0xfa256b+'-'+_0x2d58cd+'/'+_0x3728be)[_0x454e('0x23')](_0x5eb15b);}return null;};}function patchUpdates(_0x36b61a){return function(_0x55065e){try{jsonpatch[_0x454e('0x24')](_0x55065e,_0x36b61a,!![]);}catch(_0x19f7b4){return BPromise[_0x454e('0x25')](_0x19f7b4);}return _0x55065e[_0x454e('0x26')]();};}function saveUpdates(_0x431872,_0x4d197f){return function(_0x258307){if(_0x258307){return _0x258307['update'](_0x431872)[_0x454e('0x27')](function(_0xc0648){return _0xc0648;});}return null;};}function removeEntity(_0x82d5e3,_0x231490){return function(_0x392111){if(_0x392111){return _0x392111[_0x454e('0x28')]()[_0x454e('0x27')](function(){_0x82d5e3[_0x454e('0x1c')](0xcc)[_0x454e('0x1d')]();});}};}function handleEntityNotFound(_0xaf0432,_0x4654ff){return function(_0x2f8d39){if(!_0x2f8d39){_0xaf0432['sendStatus'](0x194);}return _0x2f8d39;};}function handleError(_0x510045,_0x365b52){_0x365b52=_0x365b52||0x1f4;return function(_0x3fc42b){logger['error'](_0x3fc42b[_0x454e('0x29')]);if(_0x3fc42b[_0x454e('0x2a')]){delete _0x3fc42b[_0x454e('0x2a')];}_0x510045[_0x454e('0x1c')](_0x365b52)['send'](_0x3fc42b);};}exports[_0x454e('0x2b')]=function(_0x18a800,_0x485aa1){var _0x4159dc={},_0x392ad0={},_0x137f61={'count':0x0,'rows':[]};var _0x6b1d5b=_['map'](db[_0x454e('0x2c')][_0x454e('0x2d')],function(_0xf52480){return{'name':_0xf52480[_0x454e('0x2e')],'type':_0xf52480['type']['key']};});_0x392ad0['model']=_[_0x454e('0x2f')](_0x6b1d5b,_0x454e('0x2a'));_0x392ad0[_0x454e('0x30')]=_[_0x454e('0x31')](_0x18a800[_0x454e('0x30')]);_0x392ad0['filters']=_[_0x454e('0x32')](_0x392ad0['model'],_0x392ad0['query']);_0x4159dc[_0x454e('0x33')]=_[_0x454e('0x32')](_0x392ad0['model'],qs[_0x454e('0x34')](_0x18a800[_0x454e('0x30')]['fields']));_0x4159dc['attributes']=_0x4159dc[_0x454e('0x33')][_0x454e('0x35')]?_0x4159dc[_0x454e('0x33')]:_0x392ad0[_0x454e('0x36')];if(!_0x18a800[_0x454e('0x30')]['hasOwnProperty']('nolimit')){_0x4159dc[_0x454e('0x21')]=qs[_0x454e('0x21')](_0x18a800[_0x454e('0x30')][_0x454e('0x21')]);_0x4159dc[_0x454e('0x1e')]=qs[_0x454e('0x1e')](_0x18a800[_0x454e('0x30')][_0x454e('0x1e')]);}_0x4159dc[_0x454e('0x37')]=qs[_0x454e('0x38')](_0x18a800[_0x454e('0x30')][_0x454e('0x38')]);_0x4159dc[_0x454e('0x39')]=qs[_0x454e('0x3a')](_[_0x454e('0x3b')](_0x18a800[_0x454e('0x30')],_0x392ad0[_0x454e('0x3a')]),_0x6b1d5b);if(_0x18a800[_0x454e('0x30')][_0x454e('0x3c')]){_0x4159dc[_0x454e('0x39')]=_[_0x454e('0x3d')](_0x4159dc[_0x454e('0x39')],{'$or':_[_0x454e('0x2f')](_0x6b1d5b,function(_0x391e7e){if(_0x391e7e[_0x454e('0x3e')]!==_0x454e('0x3f')){var _0x155ab1={};_0x155ab1[_0x391e7e['name']]={'$like':'%'+_0x18a800['query'][_0x454e('0x3c')]+'%'};return _0x155ab1;}})});}_0x4159dc=_[_0x454e('0x3d')]({},_0x4159dc,_0x18a800[_0x454e('0x40')]);var _0x48e11e={'where':_0x4159dc[_0x454e('0x39')]};return db[_0x454e('0x2c')][_0x454e('0x20')](_0x48e11e)['then'](function(_0x5d7ef0){_0x137f61[_0x454e('0x20')]=_0x5d7ef0;if(_0x18a800[_0x454e('0x30')][_0x454e('0x41')]){_0x4159dc['include']=[{'all':!![]}];}return db[_0x454e('0x2c')][_0x454e('0x42')](_0x4159dc);})['then'](function(_0x1d6eea){_0x137f61[_0x454e('0x43')]=_0x1d6eea;return _0x137f61;})[_0x454e('0x27')](respondWithFilteredResult(_0x485aa1,_0x4159dc))[_0x454e('0x44')](handleError(_0x485aa1,null));};exports[_0x454e('0x45')]=function(_0x43fcfc,_0x1324fb){var _0x4fcb2e={'raw':![],'where':{'id':_0x43fcfc['params']['id']}},_0xf5d1ac={};_0xf5d1ac['model']=_[_0x454e('0x31')](db['DeskConfiguration'][_0x454e('0x2d')]);_0xf5d1ac[_0x454e('0x30')]=_['keys'](_0x43fcfc[_0x454e('0x30')]);_0xf5d1ac[_0x454e('0x3a')]=_[_0x454e('0x32')](_0xf5d1ac['model'],_0xf5d1ac[_0x454e('0x30')]);_0x4fcb2e[_0x454e('0x33')]=_[_0x454e('0x32')](_0xf5d1ac[_0x454e('0x36')],qs[_0x454e('0x34')](_0x43fcfc[_0x454e('0x30')][_0x454e('0x34')]));_0x4fcb2e['attributes']=_0x4fcb2e[_0x454e('0x33')]['length']?_0x4fcb2e[_0x454e('0x33')]:_0xf5d1ac[_0x454e('0x36')];if(_0x43fcfc[_0x454e('0x30')][_0x454e('0x41')]){_0x4fcb2e[_0x454e('0x46')]=[{'all':!![]}];}_0x4fcb2e=_[_0x454e('0x3d')]({},_0x4fcb2e,_0x43fcfc['options']);return db[_0x454e('0x2c')][_0x454e('0x47')](_0x4fcb2e)[_0x454e('0x27')](handleEntityNotFound(_0x1324fb,null))['then'](respondWithResult(_0x1324fb,null))[_0x454e('0x44')](handleError(_0x1324fb,null));};exports['create']=function(_0x563c3a,_0x45ce20){return db[_0x454e('0x2c')][_0x454e('0x48')](_0x563c3a[_0x454e('0x49')],{})[_0x454e('0x27')](respondWithResult(_0x45ce20,0xc9))[_0x454e('0x44')](handleError(_0x45ce20,null));};exports['update']=function(_0x57821d,_0x1f4747){if(_0x57821d[_0x454e('0x49')]['id']){delete _0x57821d[_0x454e('0x49')]['id'];}return db[_0x454e('0x2c')][_0x454e('0x47')]({'where':{'id':_0x57821d['params']['id']}})[_0x454e('0x27')](handleEntityNotFound(_0x1f4747,null))[_0x454e('0x27')](saveUpdates(_0x57821d['body'],null))[_0x454e('0x27')](respondWithResult(_0x1f4747,null))[_0x454e('0x44')](handleError(_0x1f4747,null));};exports[_0x454e('0x28')]=function(_0x9a4663,_0x328108){return db['DeskConfiguration']['find']({'where':{'id':_0x9a4663[_0x454e('0x4a')]['id']}})[_0x454e('0x27')](handleEntityNotFound(_0x328108,null))[_0x454e('0x27')](removeEntity(_0x328108,null))[_0x454e('0x44')](handleError(_0x328108,null));};exports['getFields']=function(_0x3aba48,_0x14bd1b,_0x2c705d){var _0x3a1ed6={};var _0x30f1de={};var _0x3a3d23;var _0x30d6cb;return db['DeskConfiguration'][_0x454e('0x4b')]({'where':{'id':_0x3aba48[_0x454e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14bd1b,null))[_0x454e('0x27')](function(_0x154356){if(_0x154356){_0x3a3d23=_0x154356;_0x30f1de['model']=_[_0x454e('0x31')](db[_0x454e('0x4c')][_0x454e('0x2d')]);_0x30f1de[_0x454e('0x30')]=_['keys'](_0x3aba48['query']);_0x30f1de['filters']=_[_0x454e('0x32')](_0x30f1de[_0x454e('0x36')],_0x30f1de[_0x454e('0x30')]);_0x3a1ed6[_0x454e('0x33')]=_[_0x454e('0x32')](_0x30f1de['model'],qs[_0x454e('0x34')](_0x3aba48[_0x454e('0x30')][_0x454e('0x34')]));_0x3a1ed6[_0x454e('0x33')]=_0x3a1ed6['attributes'][_0x454e('0x35')]?_0x3a1ed6[_0x454e('0x33')]:_0x30f1de[_0x454e('0x36')];_0x3a1ed6['order']=qs['sort'](_0x3aba48['query']['sort']);_0x3a1ed6[_0x454e('0x39')]=qs[_0x454e('0x3a')](_[_0x454e('0x3b')](_0x3aba48[_0x454e('0x30')],_0x30f1de[_0x454e('0x3a')]));if(_0x3aba48['query'][_0x454e('0x3c')]){_0x3a1ed6['where']=_[_0x454e('0x3d')](_0x3a1ed6[_0x454e('0x39')],{'$or':_[_0x454e('0x2f')](_0x3a1ed6['attributes'],function(_0x5b53cb){var _0x4e8fb8={};_0x4e8fb8[_0x5b53cb]={'$like':'%'+_0x3aba48[_0x454e('0x30')][_0x454e('0x3c')]+'%'};return _0x4e8fb8;})});}_0x3a1ed6=_[_0x454e('0x3d')]({},_0x3a1ed6,_0x3aba48[_0x454e('0x40')]);return _0x3a3d23['getFields'](_0x3a1ed6);}})[_0x454e('0x27')](function(_0x27d89f){if(_0x27d89f){_0x30d6cb=_0x27d89f[_0x454e('0x35')];if(!_0x3aba48[_0x454e('0x30')][_0x454e('0x4d')]('nolimit')){_0x3a1ed6['limit']=qs[_0x454e('0x21')](_0x3aba48[_0x454e('0x30')][_0x454e('0x21')]);_0x3a1ed6[_0x454e('0x1e')]=qs[_0x454e('0x1e')](_0x3aba48[_0x454e('0x30')][_0x454e('0x1e')]);}return _0x3a3d23[_0x454e('0x4e')](_0x3a1ed6);}})[_0x454e('0x27')](function(_0x54edc7){if(_0x54edc7){return _0x54edc7?{'count':_0x30d6cb,'rows':_0x54edc7}:null;}})[_0x454e('0x27')](respondWithResult(_0x14bd1b,null))[_0x454e('0x44')](handleError(_0x14bd1b,null));};exports[_0x454e('0x4f')]=function(_0x40a92a,_0xfd3e15,_0x32ee32){var _0x5da152={};var _0x46f92b={};var _0x229633;var _0x5bdb0c;return db['DeskConfiguration'][_0x454e('0x4b')]({'where':{'id':_0x40a92a[_0x454e('0x4a')]['id']}})[_0x454e('0x27')](handleEntityNotFound(_0xfd3e15,null))[_0x454e('0x27')](function(_0x1eb700){if(_0x1eb700){_0x229633=_0x1eb700;_0x46f92b[_0x454e('0x36')]=_[_0x454e('0x31')](db[_0x454e('0x4c')][_0x454e('0x2d')]);_0x46f92b[_0x454e('0x30')]=_[_0x454e('0x31')](_0x40a92a[_0x454e('0x30')]);_0x46f92b[_0x454e('0x3a')]=_['intersection'](_0x46f92b[_0x454e('0x36')],_0x46f92b[_0x454e('0x30')]);_0x5da152['attributes']=_[_0x454e('0x32')](_0x46f92b[_0x454e('0x36')],qs['fields'](_0x40a92a['query']['fields']));_0x5da152['attributes']=_0x5da152[_0x454e('0x33')][_0x454e('0x35')]?_0x5da152[_0x454e('0x33')]:_0x46f92b[_0x454e('0x36')];_0x5da152[_0x454e('0x37')]=qs[_0x454e('0x38')](_0x40a92a[_0x454e('0x30')][_0x454e('0x38')]);_0x5da152[_0x454e('0x39')]=qs[_0x454e('0x3a')](_[_0x454e('0x3b')](_0x40a92a[_0x454e('0x30')],_0x46f92b[_0x454e('0x3a')]));if(_0x40a92a[_0x454e('0x30')][_0x454e('0x3c')]){_0x5da152[_0x454e('0x39')]=_[_0x454e('0x3d')](_0x5da152['where'],{'$or':_[_0x454e('0x2f')](_0x5da152[_0x454e('0x33')],function(_0x1851e5){var _0x567271={};_0x567271[_0x1851e5]={'$like':'%'+_0x40a92a['query'][_0x454e('0x3c')]+'%'};return _0x567271;})});}_0x5da152=_[_0x454e('0x3d')]({},_0x5da152,_0x40a92a['options']);return _0x229633[_0x454e('0x4f')](_0x5da152);}})[_0x454e('0x27')](function(_0x35a1f7){if(_0x35a1f7){_0x5bdb0c=_0x35a1f7[_0x454e('0x35')];if(!_0x40a92a[_0x454e('0x30')][_0x454e('0x4d')](_0x454e('0x50'))){_0x5da152[_0x454e('0x21')]=qs[_0x454e('0x21')](_0x40a92a[_0x454e('0x30')][_0x454e('0x21')]);_0x5da152[_0x454e('0x1e')]=qs['offset'](_0x40a92a[_0x454e('0x30')][_0x454e('0x1e')]);}return _0x229633[_0x454e('0x4f')](_0x5da152);}})['then'](function(_0x30b102){if(_0x30b102){return _0x30b102?{'count':_0x5bdb0c,'rows':_0x30b102}:null;}})[_0x454e('0x27')](respondWithResult(_0xfd3e15,null))[_0x454e('0x44')](handleError(_0xfd3e15,null));};exports[_0x454e('0x51')]=function(_0x2deb40,_0x528e60,_0x2b3613){var _0xb2a50e={};var _0x7bb283={};var _0x1935a2;var _0x23d999;return db['DeskConfiguration'][_0x454e('0x4b')]({'where':{'id':_0x2deb40['params']['id']}})[_0x454e('0x27')](handleEntityNotFound(_0x528e60,null))['then'](function(_0x5df4f0){if(_0x5df4f0){_0x1935a2=_0x5df4f0;_0x7bb283[_0x454e('0x36')]=_['keys'](db[_0x454e('0x4c')]['rawAttributes']);_0x7bb283[_0x454e('0x30')]=_['keys'](_0x2deb40[_0x454e('0x30')]);_0x7bb283[_0x454e('0x3a')]=_[_0x454e('0x32')](_0x7bb283[_0x454e('0x36')],_0x7bb283[_0x454e('0x30')]);_0xb2a50e[_0x454e('0x33')]=_[_0x454e('0x32')](_0x7bb283['model'],qs[_0x454e('0x34')](_0x2deb40[_0x454e('0x30')][_0x454e('0x34')]));_0xb2a50e[_0x454e('0x33')]=_0xb2a50e[_0x454e('0x33')][_0x454e('0x35')]?_0xb2a50e['attributes']:_0x7bb283[_0x454e('0x36')];_0xb2a50e[_0x454e('0x37')]=qs[_0x454e('0x38')](_0x2deb40[_0x454e('0x30')][_0x454e('0x38')]);_0xb2a50e[_0x454e('0x39')]=qs[_0x454e('0x3a')](_[_0x454e('0x3b')](_0x2deb40[_0x454e('0x30')],_0x7bb283['filters']));if(_0x2deb40[_0x454e('0x30')][_0x454e('0x3c')]){_0xb2a50e[_0x454e('0x39')]=_['merge'](_0xb2a50e[_0x454e('0x39')],{'$or':_[_0x454e('0x2f')](_0xb2a50e[_0x454e('0x33')],function(_0x390387){var _0x528a49={};_0x528a49[_0x390387]={'$like':'%'+_0x2deb40['query']['filter']+'%'};return _0x528a49;})});}_0xb2a50e=_[_0x454e('0x3d')]({},_0xb2a50e,_0x2deb40[_0x454e('0x40')]);return _0x1935a2[_0x454e('0x51')](_0xb2a50e);}})[_0x454e('0x27')](function(_0x12ad76){if(_0x12ad76){_0x23d999=_0x12ad76[_0x454e('0x35')];if(!_0x2deb40['query']['hasOwnProperty']('nolimit')){_0xb2a50e[_0x454e('0x21')]=qs[_0x454e('0x21')](_0x2deb40[_0x454e('0x30')]['limit']);_0xb2a50e['offset']=qs[_0x454e('0x1e')](_0x2deb40[_0x454e('0x30')][_0x454e('0x1e')]);}return _0x1935a2['getDescriptions'](_0xb2a50e);}})[_0x454e('0x27')](function(_0x19ac94){if(_0x19ac94){return _0x19ac94?{'count':_0x23d999,'rows':_0x19ac94}:null;}})['then'](respondWithResult(_0x528e60,null))['catch'](handleError(_0x528e60,null));};exports[_0x454e('0x52')]=function(_0xb615ef,_0x18a11d,_0xe64a6a){var _0x446684={};var _0x43696d={};var _0x270bc1;var _0x13b0c6;return db[_0x454e('0x2c')]['findOne']({'where':{'id':_0xb615ef[_0x454e('0x4a')]['id']}})[_0x454e('0x27')](handleEntityNotFound(_0x18a11d,null))['then'](function(_0x3050a5){if(_0x3050a5){_0x270bc1=_0x3050a5;_0x43696d[_0x454e('0x36')]=_[_0x454e('0x31')](db[_0x454e('0x53')][_0x454e('0x2d')]);_0x43696d[_0x454e('0x30')]=_[_0x454e('0x31')](_0xb615ef['query']);_0x43696d['filters']=_[_0x454e('0x32')](_0x43696d[_0x454e('0x36')],_0x43696d['query']);_0x446684[_0x454e('0x33')]=_[_0x454e('0x32')](_0x43696d['model'],qs[_0x454e('0x34')](_0xb615ef[_0x454e('0x30')][_0x454e('0x34')]));_0x446684[_0x454e('0x33')]=_0x446684[_0x454e('0x33')]['length']?_0x446684[_0x454e('0x33')]:_0x43696d['model'];_0x446684['order']=qs[_0x454e('0x38')](_0xb615ef['query']['sort']);_0x446684['where']=qs['filters'](_[_0x454e('0x3b')](_0xb615ef['query'],_0x43696d[_0x454e('0x3a')]));if(_0xb615ef['query'][_0x454e('0x3c')]){_0x446684[_0x454e('0x39')]=_['merge'](_0x446684[_0x454e('0x39')],{'$or':_[_0x454e('0x2f')](_0x446684[_0x454e('0x33')],function(_0x52dafd){var _0x314963={};_0x314963[_0x52dafd]={'$like':'%'+_0xb615ef[_0x454e('0x30')][_0x454e('0x3c')]+'%'};return _0x314963;})});}_0x446684=_['merge']({},_0x446684,_0xb615ef[_0x454e('0x40')]);return _0x270bc1[_0x454e('0x52')](_0x446684);}})[_0x454e('0x27')](function(_0x3c5d3a){if(_0x3c5d3a){_0x13b0c6=_0x3c5d3a[_0x454e('0x35')];if(!_0xb615ef[_0x454e('0x30')]['hasOwnProperty'](_0x454e('0x50'))){_0x446684[_0x454e('0x21')]=qs[_0x454e('0x21')](_0xb615ef[_0x454e('0x30')][_0x454e('0x21')]);_0x446684[_0x454e('0x1e')]=qs[_0x454e('0x1e')](_0xb615ef[_0x454e('0x30')]['offset']);}return _0x270bc1[_0x454e('0x52')](_0x446684);}})['then'](function(_0x279c45){if(_0x279c45){return _0x279c45?{'count':_0x13b0c6,'rows':_0x279c45}:null;}})[_0x454e('0x27')](respondWithResult(_0x18a11d,null))[_0x454e('0x44')](handleError(_0x18a11d,null));};exports[_0x454e('0x54')]=function(_0x21b447,_0x346c79,_0x2886bb){if(_0x21b447[_0x454e('0x49')]['id']){delete _0x21b447[_0x454e('0x49')]['id'];}return db[_0x454e('0x2c')]['findOne']({'where':{'id':_0x21b447[_0x454e('0x4a')]['id']}})[_0x454e('0x27')](handleEntityNotFound(_0x346c79,null))[_0x454e('0x27')](function(_0xef3dc8){if(_0xef3dc8){return _0xef3dc8['setTags'](_0x21b447[_0x454e('0x49')][_0x454e('0x55')]||[]);}return null;})[_0x454e('0x27')](respondWithResult(_0x346c79,null))[_0x454e('0x44')](handleError(_0x346c79,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 4df184b..24bf7e6 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 _0xcbe0=['request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2ea57d,_0x25a917){var _0x1f204f=function(_0x2e83ec){while(--_0x2e83ec){_0x2ea57d['push'](_0x2ea57d['shift']());}};_0x1f204f(++_0x25a917);}(_0xcbe0,0x103));var _0x0cbe=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0xcbe0[_0x3457b4];return _0xaa8fa9;};'use strict';var _=require(_0x0cbe('0x0'));var util=require(_0x0cbe('0x1'));var logger=require(_0x0cbe('0x2'))('api');var moment=require(_0x0cbe('0x3'));var BPromise=require(_0x0cbe('0x4'));var rp=require(_0x0cbe('0x5'));var fs=require('fs');var path=require(_0x0cbe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0cbe('0x7'));module[_0x0cbe('0x8')]=function(_0x508d27,_0xa90363){return _0x508d27[_0x0cbe('0x9')](_0x0cbe('0xa'),attributes,{'tableName':_0x0cbe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f3d=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2f3d,0xd6));var _0xd2f3=function(_0x419806,_0x23da81){_0x419806=_0x419806-0x0;var _0xef3f42=_0x2f3d[_0x419806];return _0xef3f42;};'use strict';var _=require(_0xd2f3('0x0'));var util=require(_0xd2f3('0x1'));var logger=require(_0xd2f3('0x2'))(_0xd2f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd2f3('0x4'));var fs=require('fs');var path=require(_0xd2f3('0x5'));var rimraf=require(_0xd2f3('0x6'));var config=require(_0xd2f3('0x7'));var attributes=require(_0xd2f3('0x8'));module[_0xd2f3('0x9')]=function(_0x169237,_0x14b005){return _0x169237['define'](_0xd2f3('0xa'),attributes,{'tableName':_0xd2f3('0xb'),'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 802eab9..b586385 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 _0xa742=['result','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa742,0xc7));var _0x2a74=function(_0x2e420a,_0x87eb5e){_0x2e420a=_0x2e420a-0x0;var _0x4f3766=_0xa742[_0x2e420a];return _0x4f3766;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2a74('0x0'));var rs=require(_0x2a74('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a74('0x2'));var logger=require('../../config/logger')(_0x2a74('0x3'));var config=require(_0x2a74('0x4'));var jayson=require(_0x2a74('0x5'));var client=jayson[_0x2a74('0x6')][_0x2a74('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17d10f,_0xc06f58,_0x209234){return new BPromise(function(_0x20e347,_0x2ad653){return client['request'](_0x17d10f,_0x209234)[_0x2a74('0x8')](function(_0x5ca328){logger['info'](_0x2a74('0x9'),_0xc06f58,_0x2a74('0xa'));logger[_0x2a74('0xb')](_0x2a74('0xc'),_0xc06f58,'request\x20sent',JSON[_0x2a74('0xd')](_0x5ca328));if(_0x5ca328['error']){if(_0x5ca328['error']['code']===0x1f4){logger['error'](_0x2a74('0x9'),_0xc06f58,_0x5ca328['error']['message']);return _0x2ad653(_0x5ca328[_0x2a74('0xe')][_0x2a74('0xf')]);}logger[_0x2a74('0xe')](_0x2a74('0x9'),_0xc06f58,_0x5ca328[_0x2a74('0xe')][_0x2a74('0xf')]);return _0x20e347(_0x5ca328[_0x2a74('0xe')][_0x2a74('0xf')]);}else{logger[_0x2a74('0x10')](_0x2a74('0x9'),_0xc06f58,_0x2a74('0xa'));_0x20e347(_0x5ca328[_0x2a74('0x11')][_0x2a74('0xf')]);}})['catch'](function(_0x1f9fd6){logger['error'](_0x2a74('0x9'),_0xc06f58,_0x1f9fd6);_0x2ad653(_0x1f9fd6);});});} \ No newline at end of file +var _0xc692=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0xc692,0x15f));var _0x2c69=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xc692[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var moment=require(_0x2c69('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c69('0x3'));var db=require(_0x2c69('0x4'))['db'];var utils=require(_0x2c69('0x5'));var logger=require(_0x2c69('0x6'))(_0x2c69('0x7'));var config=require(_0x2c69('0x8'));var jayson=require(_0x2c69('0x9'));var client=jayson['client'][_0x2c69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4da70c,_0x5c1260,_0x31688a){return new BPromise(function(_0x7a913a,_0xfc5ebb){return client[_0x2c69('0xb')](_0x4da70c,_0x31688a)[_0x2c69('0xc')](function(_0x131313){logger['info'](_0x2c69('0xd'),_0x5c1260,'request\x20sent');logger[_0x2c69('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5c1260,_0x2c69('0xf'),JSON[_0x2c69('0x10')](_0x131313));if(_0x131313[_0x2c69('0x11')]){if(_0x131313[_0x2c69('0x11')][_0x2c69('0x12')]===0x1f4){logger[_0x2c69('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x5c1260,_0x131313[_0x2c69('0x11')]['message']);return _0xfc5ebb(_0x131313[_0x2c69('0x11')][_0x2c69('0x13')]);}logger[_0x2c69('0x11')](_0x2c69('0xd'),_0x5c1260,_0x131313[_0x2c69('0x11')][_0x2c69('0x13')]);return _0x7a913a(_0x131313['error'][_0x2c69('0x13')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5c1260,_0x2c69('0xf'));_0x7a913a(_0x131313['result'][_0x2c69('0x13')]);}})[_0x2c69('0x14')](function(_0x59e48a){logger['error'](_0x2c69('0xd'),_0x5c1260,_0x59e48a);_0xfc5ebb(_0x59e48a);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 0bf183c..8846430 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 _0xec76=['/:id','show','post','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x1e0779,_0x5ab528){var _0x8093a4=function(_0x603b28){while(--_0x603b28){_0x1e0779['push'](_0x1e0779['shift']());}};_0x8093a4(++_0x5ab528);}(_0xec76,0x1a9));var _0x6ec7=function(_0x13f77f,_0x42e2b9){_0x13f77f=_0x13f77f-0x0;var _0x23c9d0=_0xec76[_0x13f77f];return _0x23c9d0;};'use strict';var multer=require(_0x6ec7('0x0'));var util=require(_0x6ec7('0x1'));var path=require('path');var timeout=require(_0x6ec7('0x2'));var express=require('express');var router=express[_0x6ec7('0x3')]();var fs_extra=require(_0x6ec7('0x4'));var auth=require(_0x6ec7('0x5'));var interaction=require(_0x6ec7('0x6'));var config=require(_0x6ec7('0x7'));var controller=require(_0x6ec7('0x8'));router[_0x6ec7('0x9')]('/',auth[_0x6ec7('0xa')](),controller[_0x6ec7('0xb')]);router[_0x6ec7('0x9')](_0x6ec7('0xc'),auth[_0x6ec7('0xa')](),controller[_0x6ec7('0xd')]);router[_0x6ec7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ec7('0xf')](_0x6ec7('0xc'),auth[_0x6ec7('0xa')](),controller[_0x6ec7('0x10')]);router[_0x6ec7('0x11')](_0x6ec7('0xc'),auth[_0x6ec7('0xa')](),controller['destroy']);module[_0x6ec7('0x12')]=router; \ No newline at end of file +var _0x98e5=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create','put','update','delete','multer'];(function(_0x22f4d3,_0x4f13b5){var _0x1861cf=function(_0x52e90f){while(--_0x52e90f){_0x22f4d3['push'](_0x22f4d3['shift']());}};_0x1861cf(++_0x4f13b5);}(_0x98e5,0xa1));var _0x598e=function(_0x433015,_0x2638f4){_0x433015=_0x433015-0x0;var _0x4e9880=_0x98e5[_0x433015];return _0x4e9880;};'use strict';var multer=require(_0x598e('0x0'));var util=require('util');var path=require(_0x598e('0x1'));var timeout=require(_0x598e('0x2'));var express=require(_0x598e('0x3'));var router=express[_0x598e('0x4')]();var fs_extra=require(_0x598e('0x5'));var auth=require(_0x598e('0x6'));var interaction=require(_0x598e('0x7'));var config=require(_0x598e('0x8'));var controller=require('./intDeskField.controller');router[_0x598e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x598e('0xa'),auth['isAuthenticated'](),controller[_0x598e('0xb')]);router[_0x598e('0xc')]('/',auth[_0x598e('0xd')](),controller[_0x598e('0xe')]);router[_0x598e('0xf')]('/:id',auth[_0x598e('0xd')](),controller[_0x598e('0x10')]);router[_0x598e('0x11')](_0x598e('0xa'),auth[_0x598e('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 763a785..ddf8328 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 _0x1157=['ENUM','sequelize','exports','variable','customVariable','picklist','string','STRING'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x1157,0xb9));var _0x7115=function(_0x20b423,_0x120167){_0x20b423=_0x20b423-0x0;var _0x57437c=_0x1157[_0x20b423];return _0x57437c;};'use strict';var Sequelize=require(_0x7115('0x0'));module[_0x7115('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x7115('0x2'),_0x7115('0x3'),'keyValue',_0x7115('0x4')),'defaultValue':_0x7115('0x5')},'content':{'type':Sequelize[_0x7115('0x6')]},'key':{'type':Sequelize[_0x7115('0x6')]},'keyType':{'type':Sequelize[_0x7115('0x7')](_0x7115('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x7115('0x6')]},'idField':{'type':Sequelize[_0x7115('0x6')]},'nameField':{'type':Sequelize[_0x7115('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7115('0x6')]}}; \ No newline at end of file +var _0xe438=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','picklist'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0xe438,0x111));var _0x8e43=function(_0x37dec3,_0x488a3f){_0x37dec3=_0x37dec3-0x0;var _0x266863=_0xe438[_0x37dec3];return _0x266863;};'use strict';var Sequelize=require(_0x8e43('0x0'));module[_0x8e43('0x1')]={'type':{'type':Sequelize[_0x8e43('0x2')](_0x8e43('0x3'),_0x8e43('0x4'),'customVariable','keyValue',_0x8e43('0x5')),'defaultValue':_0x8e43('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8e43('0x6')]},'keyType':{'type':Sequelize[_0x8e43('0x2')]('string','variable',_0x8e43('0x7'))},'keyContent':{'type':Sequelize[_0x8e43('0x6')]},'idField':{'type':Sequelize[_0x8e43('0x6')]},'nameField':{'type':Sequelize[_0x8e43('0x6')]},'customField':{'type':Sequelize[_0x8e43('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index bbe72c4..1c698b0 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 _0xcc4e=['merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xcc4e,0x174));var _0xecc4=function(_0x2d2618,_0x4dc8b2){_0x2d2618=_0x2d2618-0x0;var _0x3b5c2b=_0xcc4e[_0x2d2618];return _0x3b5c2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xecc4('0x0'));var jsonpatch=require(_0xecc4('0x1'));var rp=require(_0xecc4('0x2'));var moment=require('moment');var BPromise=require(_0xecc4('0x3'));var Mustache=require(_0xecc4('0x4'));var util=require('util');var path=require('path');var sox=require(_0xecc4('0x5'));var csv=require(_0xecc4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecc4('0x7'));var _=require(_0xecc4('0x8'));var squel=require(_0xecc4('0x9'));var crypto=require(_0xecc4('0xa'));var jsforce=require(_0xecc4('0xb'));var deskjs=require(_0xecc4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xecc4('0xd'));var Papa=require(_0xecc4('0xe'));var Redis=require(_0xecc4('0xf'));var authService=require(_0xecc4('0x10'));var qs=require(_0xecc4('0x11'));var as=require(_0xecc4('0x12'));var hardwareService=require(_0xecc4('0x13'));var logger=require(_0xecc4('0x14'))(_0xecc4('0x15'));var utils=require(_0xecc4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xecc4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51be39,_0x5c573e){_0x5c573e=_0x5c573e||0xcc;return function(_0x5871e9){if(_0x5871e9){return _0x51be39['sendStatus'](_0x5c573e);}return _0x51be39['status'](_0x5c573e)[_0xecc4('0x18')]();};}function respondWithResult(_0x356119,_0x31046d){_0x31046d=_0x31046d||0xc8;return function(_0x11eeea){if(_0x11eeea){return _0x356119[_0xecc4('0x19')](_0x31046d)['json'](_0x11eeea);}};}function respondWithFilteredResult(_0x1d1319,_0x491f00){return function(_0x199330){if(_0x199330){var _0x522251=typeof _0x491f00[_0xecc4('0x1a')]===_0xecc4('0x1b')&&typeof _0x491f00[_0xecc4('0x1c')]===_0xecc4('0x1b');var _0x1bf3f3=_0x199330[_0xecc4('0x1d')];var _0xb70bab=_0x522251?0x0:_0x491f00['offset'];var _0x67a6fd=_0x522251?_0x199330['count']:_0x491f00[_0xecc4('0x1a')]+_0x491f00[_0xecc4('0x1c')];var _0x2716eb;if(_0x67a6fd>=_0x1bf3f3){_0x67a6fd=_0x1bf3f3;_0x2716eb=0xc8;}else{_0x2716eb=0xce;}_0x1d1319[_0xecc4('0x19')](_0x2716eb);return _0x1d1319[_0xecc4('0x1e')](_0xecc4('0x1f'),_0xb70bab+'-'+_0x67a6fd+'/'+_0x1bf3f3)[_0xecc4('0x20')](_0x199330);}return null;};}function patchUpdates(_0x486f6c){return function(_0x579c00){try{jsonpatch[_0xecc4('0x21')](_0x579c00,_0x486f6c,!![]);}catch(_0x5a98cb){return BPromise[_0xecc4('0x22')](_0x5a98cb);}return _0x579c00['save']();};}function saveUpdates(_0x550c5d,_0x28fb11){return function(_0x5aa417){if(_0x5aa417){return _0x5aa417[_0xecc4('0x23')](_0x550c5d)['then'](function(_0x42b9d4){return _0x42b9d4;});}return null;};}function removeEntity(_0x2b663a,_0x1598a2){return function(_0x1097e6){if(_0x1097e6){return _0x1097e6['destroy']()[_0xecc4('0x24')](function(){_0x2b663a[_0xecc4('0x19')](0xcc)[_0xecc4('0x18')]();});}};}function handleEntityNotFound(_0x3cb245,_0x4716b2){return function(_0x582e49){if(!_0x582e49){_0x3cb245[_0xecc4('0x25')](0x194);}return _0x582e49;};}function handleError(_0x44dd1a,_0x2e48d5){_0x2e48d5=_0x2e48d5||0x1f4;return function(_0x18d338){logger[_0xecc4('0x26')](_0x18d338[_0xecc4('0x27')]);if(_0x18d338['name']){delete _0x18d338[_0xecc4('0x28')];}_0x44dd1a['status'](_0x2e48d5)[_0xecc4('0x29')](_0x18d338);};}exports['index']=function(_0x5b6a0e,_0x45b30b){var _0x5081e1={},_0x342e2b={},_0x39da1e={'count':0x0,'rows':[]};var _0x470ea3=_[_0xecc4('0x2a')](db[_0xecc4('0x2b')][_0xecc4('0x2c')],function(_0x52d8f4){return{'name':_0x52d8f4[_0xecc4('0x2d')],'type':_0x52d8f4[_0xecc4('0x2e')]['key']};});_0x342e2b[_0xecc4('0x2f')]=_[_0xecc4('0x2a')](_0x470ea3,_0xecc4('0x28'));_0x342e2b[_0xecc4('0x30')]=_['keys'](_0x5b6a0e[_0xecc4('0x30')]);_0x342e2b[_0xecc4('0x31')]=_[_0xecc4('0x32')](_0x342e2b['model'],_0x342e2b[_0xecc4('0x30')]);_0x5081e1[_0xecc4('0x33')]=_['intersection'](_0x342e2b[_0xecc4('0x2f')],qs[_0xecc4('0x34')](_0x5b6a0e['query']['fields']));_0x5081e1[_0xecc4('0x33')]=_0x5081e1[_0xecc4('0x33')][_0xecc4('0x35')]?_0x5081e1[_0xecc4('0x33')]:_0x342e2b[_0xecc4('0x2f')];if(!_0x5b6a0e[_0xecc4('0x30')][_0xecc4('0x36')]('nolimit')){_0x5081e1[_0xecc4('0x1c')]=qs[_0xecc4('0x1c')](_0x5b6a0e['query'][_0xecc4('0x1c')]);_0x5081e1[_0xecc4('0x1a')]=qs[_0xecc4('0x1a')](_0x5b6a0e[_0xecc4('0x30')]['offset']);}_0x5081e1['order']=qs['sort'](_0x5b6a0e[_0xecc4('0x30')][_0xecc4('0x37')]);_0x5081e1['where']=qs[_0xecc4('0x31')](_[_0xecc4('0x38')](_0x5b6a0e[_0xecc4('0x30')],_0x342e2b[_0xecc4('0x31')]),_0x470ea3);if(_0x5b6a0e[_0xecc4('0x30')][_0xecc4('0x39')]){_0x5081e1[_0xecc4('0x3a')]=_['merge'](_0x5081e1['where'],{'$or':_['map'](_0x470ea3,function(_0x285481){if(_0x285481[_0xecc4('0x2e')]!==_0xecc4('0x3b')){var _0x2560cf={};_0x2560cf[_0x285481[_0xecc4('0x28')]]={'$like':'%'+_0x5b6a0e[_0xecc4('0x30')]['filter']+'%'};return _0x2560cf;}})});}_0x5081e1=_[_0xecc4('0x3c')]({},_0x5081e1,_0x5b6a0e[_0xecc4('0x3d')]);var _0xb9de1c={'where':_0x5081e1[_0xecc4('0x3a')]};return db[_0xecc4('0x2b')]['count'](_0xb9de1c)[_0xecc4('0x24')](function(_0x202319){_0x39da1e[_0xecc4('0x1d')]=_0x202319;if(_0x5b6a0e[_0xecc4('0x30')][_0xecc4('0x3e')]){_0x5081e1[_0xecc4('0x3f')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x5081e1);})['then'](function(_0x3db85e){_0x39da1e[_0xecc4('0x40')]=_0x3db85e;return _0x39da1e;})[_0xecc4('0x24')](respondWithFilteredResult(_0x45b30b,_0x5081e1))['catch'](handleError(_0x45b30b,null));};exports[_0xecc4('0x41')]=function(_0x45c291,_0x10241e){var _0x550004={'raw':!![],'where':{'id':_0x45c291[_0xecc4('0x42')]['id']}},_0x1fdd00={};_0x1fdd00[_0xecc4('0x2f')]=_[_0xecc4('0x43')](db['DeskField'][_0xecc4('0x2c')]);_0x1fdd00[_0xecc4('0x30')]=_[_0xecc4('0x43')](_0x45c291['query']);_0x1fdd00[_0xecc4('0x31')]=_[_0xecc4('0x32')](_0x1fdd00[_0xecc4('0x2f')],_0x1fdd00[_0xecc4('0x30')]);_0x550004[_0xecc4('0x33')]=_[_0xecc4('0x32')](_0x1fdd00[_0xecc4('0x2f')],qs[_0xecc4('0x34')](_0x45c291['query']['fields']));_0x550004[_0xecc4('0x33')]=_0x550004[_0xecc4('0x33')][_0xecc4('0x35')]?_0x550004[_0xecc4('0x33')]:_0x1fdd00[_0xecc4('0x2f')];if(_0x45c291[_0xecc4('0x30')][_0xecc4('0x3e')]){_0x550004[_0xecc4('0x3f')]=[{'all':!![]}];}_0x550004=_[_0xecc4('0x3c')]({},_0x550004,_0x45c291[_0xecc4('0x3d')]);return db[_0xecc4('0x2b')][_0xecc4('0x44')](_0x550004)[_0xecc4('0x24')](handleEntityNotFound(_0x10241e,null))['then'](respondWithResult(_0x10241e,null))[_0xecc4('0x45')](handleError(_0x10241e,null));};exports[_0xecc4('0x46')]=function(_0x36fdeb,_0x180ec2){return db['DeskField'][_0xecc4('0x46')](_0x36fdeb['body'],{})[_0xecc4('0x24')](respondWithResult(_0x180ec2,0xc9))[_0xecc4('0x45')](handleError(_0x180ec2,null));};exports[_0xecc4('0x23')]=function(_0x300cd6,_0x2e4b70){if(_0x300cd6['body']['id']){delete _0x300cd6[_0xecc4('0x47')]['id'];}return db[_0xecc4('0x2b')][_0xecc4('0x44')]({'where':{'id':_0x300cd6[_0xecc4('0x42')]['id']}})[_0xecc4('0x24')](handleEntityNotFound(_0x2e4b70,null))[_0xecc4('0x24')](saveUpdates(_0x300cd6['body'],null))[_0xecc4('0x24')](respondWithResult(_0x2e4b70,null))[_0xecc4('0x45')](handleError(_0x2e4b70,null));};exports['destroy']=function(_0xe159cf,_0x3cc8d3){return db['DeskField'][_0xecc4('0x44')]({'where':{'id':_0xe159cf[_0xecc4('0x42')]['id']}})[_0xecc4('0x24')](handleEntityNotFound(_0x3cc8d3,null))[_0xecc4('0x24')](removeEntity(_0x3cc8d3,null))[_0xecc4('0x45')](handleError(_0x3cc8d3,null));}; \ No newline at end of file +var _0x34ec=['../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','merge','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x3f371b,_0x33c074){var _0x126d77=function(_0x186b66){while(--_0x186b66){_0x3f371b['push'](_0x3f371b['shift']());}};_0x126d77(++_0x33c074);}(_0x34ec,0x1f4));var _0xc34e=function(_0x4090ba,_0x15e1da){_0x4090ba=_0x4090ba-0x0;var _0x267e30=_0x34ec[_0x4090ba];return _0x267e30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc34e('0x0'));var jsonpatch=require(_0xc34e('0x1'));var rp=require(_0xc34e('0x2'));var moment=require(_0xc34e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc34e('0x4'));var path=require(_0xc34e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc34e('0x6'));var fs=require('fs');var fs_extra=require(_0xc34e('0x7'));var _=require(_0xc34e('0x8'));var squel=require('squel');var crypto=require(_0xc34e('0x9'));var jsforce=require(_0xc34e('0xa'));var deskjs=require(_0xc34e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc34e('0xc'));var Papa=require(_0xc34e('0xd'));var Redis=require(_0xc34e('0xe'));var authService=require(_0xc34e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc34e('0x10'));var logger=require('../../config/logger')(_0xc34e('0x11'));var utils=require('../../config/utils');var config=require(_0xc34e('0x12'));var licenseUtil=require(_0xc34e('0x13'));var db=require(_0xc34e('0x14'))['db'];function respondWithStatusCode(_0xb73817,_0x45ec78){_0x45ec78=_0x45ec78||0xcc;return function(_0x3cc95a){if(_0x3cc95a){return _0xb73817['sendStatus'](_0x45ec78);}return _0xb73817['status'](_0x45ec78)['end']();};}function respondWithResult(_0x502c07,_0x54baa5){_0x54baa5=_0x54baa5||0xc8;return function(_0x264743){if(_0x264743){return _0x502c07[_0xc34e('0x15')](_0x54baa5)[_0xc34e('0x16')](_0x264743);}};}function respondWithFilteredResult(_0x5966a9,_0x318120){return function(_0x50bff9){if(_0x50bff9){var _0x287691=typeof _0x318120[_0xc34e('0x17')]===_0xc34e('0x18')&&typeof _0x318120[_0xc34e('0x19')]==='undefined';var _0x100d73=_0x50bff9[_0xc34e('0x1a')];var _0x3bd5e4=_0x287691?0x0:_0x318120[_0xc34e('0x17')];var _0x244e61=_0x287691?_0x50bff9[_0xc34e('0x1a')]:_0x318120['offset']+_0x318120[_0xc34e('0x19')];var _0x188d6e;if(_0x244e61>=_0x100d73){_0x244e61=_0x100d73;_0x188d6e=0xc8;}else{_0x188d6e=0xce;}_0x5966a9['status'](_0x188d6e);return _0x5966a9[_0xc34e('0x1b')](_0xc34e('0x1c'),_0x3bd5e4+'-'+_0x244e61+'/'+_0x100d73)[_0xc34e('0x16')](_0x50bff9);}return null;};}function patchUpdates(_0x1fdc98){return function(_0x1f2b7c){try{jsonpatch[_0xc34e('0x1d')](_0x1f2b7c,_0x1fdc98,!![]);}catch(_0x2283ba){return BPromise[_0xc34e('0x1e')](_0x2283ba);}return _0x1f2b7c[_0xc34e('0x1f')]();};}function saveUpdates(_0xc98617,_0x1158e2){return function(_0x2a54af){if(_0x2a54af){return _0x2a54af[_0xc34e('0x20')](_0xc98617)['then'](function(_0x3a06d5){return _0x3a06d5;});}return null;};}function removeEntity(_0x30a83a,_0xb1418e){return function(_0x5adcbc){if(_0x5adcbc){return _0x5adcbc[_0xc34e('0x21')]()[_0xc34e('0x22')](function(){_0x30a83a[_0xc34e('0x15')](0xcc)[_0xc34e('0x23')]();});}};}function handleEntityNotFound(_0x289367,_0x26fdcd){return function(_0x19e842){if(!_0x19e842){_0x289367['sendStatus'](0x194);}return _0x19e842;};}function handleError(_0x23b02d,_0x28102e){_0x28102e=_0x28102e||0x1f4;return function(_0x53513f){logger[_0xc34e('0x24')](_0x53513f['stack']);if(_0x53513f[_0xc34e('0x25')]){delete _0x53513f['name'];}_0x23b02d[_0xc34e('0x15')](_0x28102e)[_0xc34e('0x26')](_0x53513f);};}exports[_0xc34e('0x27')]=function(_0x14a288,_0x187eb9){var _0x4400bf={},_0x7b74d4={},_0x13f737={'count':0x0,'rows':[]};var _0x137d83=_['map'](db[_0xc34e('0x28')][_0xc34e('0x29')],function(_0x235f00){return{'name':_0x235f00[_0xc34e('0x2a')],'type':_0x235f00[_0xc34e('0x2b')][_0xc34e('0x2c')]};});_0x7b74d4[_0xc34e('0x2d')]=_['map'](_0x137d83,_0xc34e('0x25'));_0x7b74d4[_0xc34e('0x2e')]=_[_0xc34e('0x2f')](_0x14a288[_0xc34e('0x2e')]);_0x7b74d4[_0xc34e('0x30')]=_[_0xc34e('0x31')](_0x7b74d4[_0xc34e('0x2d')],_0x7b74d4[_0xc34e('0x2e')]);_0x4400bf[_0xc34e('0x32')]=_[_0xc34e('0x31')](_0x7b74d4[_0xc34e('0x2d')],qs['fields'](_0x14a288[_0xc34e('0x2e')][_0xc34e('0x33')]));_0x4400bf[_0xc34e('0x32')]=_0x4400bf[_0xc34e('0x32')][_0xc34e('0x34')]?_0x4400bf[_0xc34e('0x32')]:_0x7b74d4[_0xc34e('0x2d')];if(!_0x14a288['query'][_0xc34e('0x35')](_0xc34e('0x36'))){_0x4400bf[_0xc34e('0x19')]=qs['limit'](_0x14a288[_0xc34e('0x2e')]['limit']);_0x4400bf[_0xc34e('0x17')]=qs['offset'](_0x14a288[_0xc34e('0x2e')][_0xc34e('0x17')]);}_0x4400bf[_0xc34e('0x37')]=qs[_0xc34e('0x38')](_0x14a288[_0xc34e('0x2e')]['sort']);_0x4400bf[_0xc34e('0x39')]=qs['filters'](_[_0xc34e('0x3a')](_0x14a288['query'],_0x7b74d4[_0xc34e('0x30')]),_0x137d83);if(_0x14a288[_0xc34e('0x2e')][_0xc34e('0x3b')]){_0x4400bf[_0xc34e('0x39')]=_['merge'](_0x4400bf[_0xc34e('0x39')],{'$or':_[_0xc34e('0x3c')](_0x137d83,function(_0x22d499){if(_0x22d499[_0xc34e('0x2b')]!==_0xc34e('0x3d')){var _0x1570e1={};_0x1570e1[_0x22d499[_0xc34e('0x25')]]={'$like':'%'+_0x14a288['query'][_0xc34e('0x3b')]+'%'};return _0x1570e1;}})});}_0x4400bf=_['merge']({},_0x4400bf,_0x14a288[_0xc34e('0x3e')]);var _0x5b937e={'where':_0x4400bf[_0xc34e('0x39')]};return db['DeskField'][_0xc34e('0x1a')](_0x5b937e)[_0xc34e('0x22')](function(_0x3178f0){_0x13f737[_0xc34e('0x1a')]=_0x3178f0;if(_0x14a288['query'][_0xc34e('0x3f')]){_0x4400bf['include']=[{'all':!![]}];}return db[_0xc34e('0x28')][_0xc34e('0x40')](_0x4400bf);})['then'](function(_0x4530c4){_0x13f737[_0xc34e('0x41')]=_0x4530c4;return _0x13f737;})['then'](respondWithFilteredResult(_0x187eb9,_0x4400bf))[_0xc34e('0x42')](handleError(_0x187eb9,null));};exports[_0xc34e('0x43')]=function(_0x53d6b6,_0x2f8eb6){var _0x23f134={'raw':!![],'where':{'id':_0x53d6b6['params']['id']}},_0x4ff093={};_0x4ff093[_0xc34e('0x2d')]=_[_0xc34e('0x2f')](db['DeskField'][_0xc34e('0x29')]);_0x4ff093[_0xc34e('0x2e')]=_[_0xc34e('0x2f')](_0x53d6b6[_0xc34e('0x2e')]);_0x4ff093[_0xc34e('0x30')]=_[_0xc34e('0x31')](_0x4ff093['model'],_0x4ff093[_0xc34e('0x2e')]);_0x23f134[_0xc34e('0x32')]=_['intersection'](_0x4ff093[_0xc34e('0x2d')],qs[_0xc34e('0x33')](_0x53d6b6[_0xc34e('0x2e')][_0xc34e('0x33')]));_0x23f134['attributes']=_0x23f134[_0xc34e('0x32')][_0xc34e('0x34')]?_0x23f134['attributes']:_0x4ff093['model'];if(_0x53d6b6['query'][_0xc34e('0x3f')]){_0x23f134[_0xc34e('0x44')]=[{'all':!![]}];}_0x23f134=_[_0xc34e('0x45')]({},_0x23f134,_0x53d6b6[_0xc34e('0x3e')]);return db[_0xc34e('0x28')][_0xc34e('0x46')](_0x23f134)['then'](handleEntityNotFound(_0x2f8eb6,null))[_0xc34e('0x22')](respondWithResult(_0x2f8eb6,null))[_0xc34e('0x42')](handleError(_0x2f8eb6,null));};exports[_0xc34e('0x47')]=function(_0x470277,_0x297841){return db[_0xc34e('0x28')][_0xc34e('0x47')](_0x470277[_0xc34e('0x48')],{})[_0xc34e('0x22')](respondWithResult(_0x297841,0xc9))[_0xc34e('0x42')](handleError(_0x297841,null));};exports[_0xc34e('0x20')]=function(_0x2fc71d,_0xe6fb43){if(_0x2fc71d['body']['id']){delete _0x2fc71d[_0xc34e('0x48')]['id'];}return db[_0xc34e('0x28')][_0xc34e('0x46')]({'where':{'id':_0x2fc71d[_0xc34e('0x49')]['id']}})[_0xc34e('0x22')](handleEntityNotFound(_0xe6fb43,null))[_0xc34e('0x22')](saveUpdates(_0x2fc71d[_0xc34e('0x48')],null))[_0xc34e('0x22')](respondWithResult(_0xe6fb43,null))[_0xc34e('0x42')](handleError(_0xe6fb43,null));};exports[_0xc34e('0x21')]=function(_0x2947bd,_0x37e97b){return db['DeskField'][_0xc34e('0x46')]({'where':{'id':_0x2947bd['params']['id']}})[_0xc34e('0x22')](handleEntityNotFound(_0x37e97b,null))[_0xc34e('0x22')](removeEntity(_0x37e97b,null))[_0xc34e('0x42')](handleError(_0x37e97b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 5eba5d1..1a4f995 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 _0x4b81=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','idField','FieldId','lodash'];(function(_0x4a9c30,_0x4d567f){var _0xf635d5=function(_0x33b554){while(--_0x33b554){_0x4a9c30['push'](_0x4a9c30['shift']());}};_0xf635d5(++_0x4d567f);}(_0x4b81,0x95));var _0x14b8=function(_0x1dfbe1,_0x45b9c8){_0x1dfbe1=_0x1dfbe1-0x0;var _0x4865ad=_0x4b81[_0x1dfbe1];return _0x4865ad;};'use strict';var _=require(_0x14b8('0x0'));var util=require(_0x14b8('0x1'));var logger=require(_0x14b8('0x2'))(_0x14b8('0x3'));var moment=require(_0x14b8('0x4'));var BPromise=require(_0x14b8('0x5'));var rp=require(_0x14b8('0x6'));var fs=require('fs');var path=require(_0x14b8('0x7'));var rimraf=require('rimraf');var config=require(_0x14b8('0x8'));var attributes=require(_0x14b8('0x9'));module[_0x14b8('0xa')]=function(_0x4d9b1d,_0x299800){return _0x4d9b1d['define'](_0x14b8('0xb'),attributes,{'tableName':_0x14b8('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x14b8('0xd'),_0x14b8('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf77c=['api','moment','bluebird','path','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x2e46a7,_0x5ae2e4){var _0x41d1cf=function(_0x5baded){while(--_0x5baded){_0x2e46a7['push'](_0x2e46a7['shift']());}};_0x41d1cf(++_0x5ae2e4);}(_0xf77c,0x123));var _0xcf77=function(_0x364e2b,_0x30b028){_0x364e2b=_0x364e2b-0x0;var _0x943fef=_0xf77c[_0x364e2b];return _0x943fef;};'use strict';var _=require(_0xcf77('0x0'));var util=require(_0xcf77('0x1'));var logger=require(_0xcf77('0x2'))(_0xcf77('0x3'));var moment=require(_0xcf77('0x4'));var BPromise=require(_0xcf77('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf77('0x6'));var rimraf=require(_0xcf77('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf77('0x8'));module['exports']=function(_0x119872,_0x2bd273){return _0x119872[_0xcf77('0x9')](_0xcf77('0xa'),attributes,{'tableName':_0xcf77('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xcf77('0xc'),_0xcf77('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 859cf1a..bdcd60b 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 _0xe1d6=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x10905a,_0x37de76){var _0x6c1cf3=function(_0x25c0e1){while(--_0x25c0e1){_0x10905a['push'](_0x10905a['shift']());}};_0x6c1cf3(++_0x37de76);}(_0xe1d6,0x128));var _0x6e1d=function(_0x3237a8,_0x32ca63){_0x3237a8=_0x3237a8-0x0;var _0x4516ed=_0xe1d6[_0x3237a8];return _0x4516ed;};'use strict';var _=require(_0x6e1d('0x0'));var util=require(_0x6e1d('0x1'));var moment=require('moment');var BPromise=require(_0x6e1d('0x2'));var rs=require(_0x6e1d('0x3'));var fs=require('fs');var Redis=require(_0x6e1d('0x4'));var db=require(_0x6e1d('0x5'))['db'];var utils=require(_0x6e1d('0x6'));var logger=require(_0x6e1d('0x7'))('rpc');var config=require(_0x6e1d('0x8'));var jayson=require(_0x6e1d('0x9'));var client=jayson[_0x6e1d('0xa')][_0x6e1d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdb4848,_0x154c93,_0x560a9b){return new BPromise(function(_0x40838d,_0x5f4a73){return client[_0x6e1d('0xc')](_0xdb4848,_0x560a9b)[_0x6e1d('0xd')](function(_0x5cc371){logger[_0x6e1d('0xe')](_0x6e1d('0xf'),_0x154c93,_0x6e1d('0x10'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x154c93,_0x6e1d('0x10'),JSON[_0x6e1d('0x11')](_0x5cc371));if(_0x5cc371[_0x6e1d('0x12')]){if(_0x5cc371[_0x6e1d('0x12')][_0x6e1d('0x13')]===0x1f4){logger[_0x6e1d('0x12')](_0x6e1d('0xf'),_0x154c93,_0x5cc371[_0x6e1d('0x12')]['message']);return _0x5f4a73(_0x5cc371['error'][_0x6e1d('0x14')]);}logger['error'](_0x6e1d('0xf'),_0x154c93,_0x5cc371[_0x6e1d('0x12')]['message']);return _0x40838d(_0x5cc371[_0x6e1d('0x12')]['message']);}else{logger[_0x6e1d('0xe')](_0x6e1d('0xf'),_0x154c93,_0x6e1d('0x10'));_0x40838d(_0x5cc371[_0x6e1d('0x15')][_0x6e1d('0x14')]);}})['catch'](function(_0x52371b){logger[_0x6e1d('0x12')](_0x6e1d('0xf'),_0x154c93,_0x52371b);_0x5f4a73(_0x52371b);});});} \ No newline at end of file +var _0x7266=['error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x320243,_0x55038d){var _0x1c9c6a=function(_0x209e5e){while(--_0x209e5e){_0x320243['push'](_0x320243['shift']());}};_0x1c9c6a(++_0x55038d);}(_0x7266,0x1e5));var _0x6726=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7266[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6726('0x2'));var fs=require('fs');var Redis=require(_0x6726('0x3'));var db=require(_0x6726('0x4'))['db'];var utils=require(_0x6726('0x5'));var logger=require(_0x6726('0x6'))(_0x6726('0x7'));var config=require(_0x6726('0x8'));var jayson=require(_0x6726('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x484408,_0x1de27f,_0xc2cee){return new BPromise(function(_0x31e03b,_0x5d6470){return client[_0x6726('0xa')](_0x484408,_0xc2cee)['then'](function(_0x2ff900){logger[_0x6726('0xb')]('DeskField,\x20%s,\x20%s',_0x1de27f,_0x6726('0xc'));logger['debug'](_0x6726('0xd'),_0x1de27f,_0x6726('0xc'),JSON[_0x6726('0xe')](_0x2ff900));if(_0x2ff900['error']){if(_0x2ff900[_0x6726('0xf')][_0x6726('0x10')]===0x1f4){logger['error'](_0x6726('0x11'),_0x1de27f,_0x2ff900[_0x6726('0xf')]['message']);return _0x5d6470(_0x2ff900[_0x6726('0xf')][_0x6726('0x12')]);}logger[_0x6726('0xf')](_0x6726('0x11'),_0x1de27f,_0x2ff900['error'][_0x6726('0x12')]);return _0x31e03b(_0x2ff900[_0x6726('0xf')]['message']);}else{logger[_0x6726('0xb')]('DeskField,\x20%s,\x20%s',_0x1de27f,_0x6726('0xc'));_0x31e03b(_0x2ff900[_0x6726('0x13')][_0x6726('0x12')]);}})['catch'](function(_0x35b212){logger[_0x6726('0xf')](_0x6726('0x11'),_0x1de27f,_0x35b212);_0x5d6470(_0x35b212);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 7de9324..ba7384e 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 _0x91bd=['update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x23c25e,_0x37d9d6){var _0x1193b4=function(_0x2e31be){while(--_0x2e31be){_0x23c25e['push'](_0x23c25e['shift']());}};_0x1193b4(++_0x37d9d6);}(_0x91bd,0x10b));var _0xd91b=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x91bd[_0x4bcf38];return _0x4a89be;};'use strict';var multer=require(_0xd91b('0x0'));var util=require('util');var path=require(_0xd91b('0x1'));var timeout=require(_0xd91b('0x2'));var express=require(_0xd91b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd91b('0x4'));var interaction=require(_0xd91b('0x5'));var config=require('../../config/environment');var controller=require(_0xd91b('0x6'));router['get']('/',auth[_0xd91b('0x7')](),controller[_0xd91b('0x8')]);router[_0xd91b('0x9')](_0xd91b('0xa'),auth[_0xd91b('0x7')](),controller[_0xd91b('0xb')]);router[_0xd91b('0x9')](_0xd91b('0xc'),auth['isAuthenticated'](),controller[_0xd91b('0xd')]);router[_0xd91b('0x9')](_0xd91b('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xd91b('0xf')]('/',auth['isAuthenticated'](),controller[_0xd91b('0x10')]);router[_0xd91b('0xf')](_0xd91b('0xc'),auth[_0xd91b('0x7')](),controller[_0xd91b('0x11')]);router[_0xd91b('0x12')]('/:id',auth[_0xd91b('0x7')](),controller[_0xd91b('0x13')]);router[_0xd91b('0x14')](_0xd91b('0xa'),auth[_0xd91b('0x7')](),controller[_0xd91b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2cd5=['../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x2cd5,0x74));var _0x52cd=function(_0xfc2678,_0x2cf5b3){_0xfc2678=_0xfc2678-0x0;var _0x464846=_0x2cd5[_0xfc2678];return _0x464846;};'use strict';var multer=require(_0x52cd('0x0'));var util=require(_0x52cd('0x1'));var path=require(_0x52cd('0x2'));var timeout=require(_0x52cd('0x3'));var express=require(_0x52cd('0x4'));var router=express[_0x52cd('0x5')]();var fs_extra=require(_0x52cd('0x6'));var auth=require(_0x52cd('0x7'));var interaction=require(_0x52cd('0x8'));var config=require(_0x52cd('0x9'));var controller=require(_0x52cd('0xa'));router[_0x52cd('0xb')]('/',auth['isAuthenticated'](),controller[_0x52cd('0xc')]);router['get'](_0x52cd('0xd'),auth[_0x52cd('0xe')](),controller['show']);router[_0x52cd('0xb')]('/:id/configurations',auth[_0x52cd('0xe')](),controller['getConfigurations']);router[_0x52cd('0xb')](_0x52cd('0xf'),auth[_0x52cd('0xe')](),controller[_0x52cd('0x10')]);router[_0x52cd('0x11')]('/',auth[_0x52cd('0xe')](),controller[_0x52cd('0x12')]);router[_0x52cd('0x11')](_0x52cd('0x13'),auth['isAuthenticated'](),controller[_0x52cd('0x14')]);router[_0x52cd('0x15')](_0x52cd('0xd'),auth['isAuthenticated'](),controller[_0x52cd('0x16')]);router[_0x52cd('0x17')](_0x52cd('0xd'),auth[_0x52cd('0xe')](),controller[_0x52cd('0x18')]);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 4432b2f..27f7a93 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 _0x4fb4=['BOOLEAN','exports','STRING'];(function(_0x3f99a8,_0x160bf7){var _0x25c907=function(_0x4f5dd0){while(--_0x4f5dd0){_0x3f99a8['push'](_0x3f99a8['shift']());}};_0x25c907(++_0x160bf7);}(_0x4fb4,0x190));var _0x44fb=function(_0x2ad9dc,_0x4bfd26){_0x2ad9dc=_0x2ad9dc-0x0;var _0x2198a5=_0x4fb4[_0x2ad9dc];return _0x2198a5;};'use strict';var Sequelize=require('sequelize');module[_0x44fb('0x0')]={'name':{'type':Sequelize[_0x44fb('0x1')]},'username':{'type':Sequelize[_0x44fb('0x1')]},'password':{'type':Sequelize[_0x44fb('0x1')]},'remoteUri':{'type':Sequelize[_0x44fb('0x1')]},'tenantId':{'type':Sequelize[_0x44fb('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x44fb('0x1')]},'serverUrl':{'type':Sequelize[_0x44fb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x44fb('0x1')]},'modernAuthentication':{'type':Sequelize[_0x44fb('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdb8b=['STRING','BOOLEAN','exports'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x4db3c3,_0x22544e){_0x4db3c3=_0x4db3c3-0x0;var _0x4cff35=_0xdb8b[_0x4db3c3];return _0x4cff35;};'use strict';var Sequelize=require('sequelize');module[_0xbdb8('0x0')]={'name':{'type':Sequelize[_0xbdb8('0x1')]},'username':{'type':Sequelize[_0xbdb8('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xbdb8('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xbdb8('0x1')]},'serverUrl':{'type':Sequelize[_0xbdb8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbdb8('0x1')]},'modernAuthentication':{'type':Sequelize[_0xbdb8('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index efd985d..700f97a 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 _0x1987=['keys','rawAttributes','intersection','include','find','create','body','params','destroy','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','access_token','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','api','status','json','offset','count','limit','update','then','end','sendStatus','error','name','send','index','map','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','Dynamics365Account','includeAll','findAll','rows','catch','show'];(function(_0x32c8b5,_0x334806){var _0x457ebc=function(_0x213338){while(--_0x213338){_0x32c8b5['push'](_0x32c8b5['shift']());}};_0x457ebc(++_0x334806);}(_0x1987,0x1f2));var _0x7198=function(_0x1be6b2,_0x86c762){_0x1be6b2=_0x1be6b2-0x0;var _0x63fedd=_0x1987[_0x1be6b2];return _0x63fedd;};'use strict';var rp=require('request-promise');var util=require(_0x7198('0x0'));var _=require(_0x7198('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7198('0x2'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x138325,_0x5121a3){_0x5121a3=_0x5121a3||0xc8;return function(_0x30c86e){if(_0x30c86e){return _0x138325[_0x7198('0x3')](_0x5121a3)[_0x7198('0x4')](_0x30c86e);}};}function respondWithFilteredResult(_0x37bb5b,_0x565f3d){return function(_0x27d826){if(_0x27d826){var _0x3ef432=typeof _0x565f3d[_0x7198('0x5')]==='undefined'&&typeof _0x565f3d['limit']==='undefined';var _0x4c5f28=_0x27d826[_0x7198('0x6')];var _0x2b560b=_0x3ef432?0x0:_0x565f3d[_0x7198('0x5')];var _0x4539ec=_0x3ef432?_0x27d826[_0x7198('0x6')]:_0x565f3d[_0x7198('0x5')]+_0x565f3d[_0x7198('0x7')];var _0x51ac21;if(_0x4539ec>=_0x4c5f28){_0x4539ec=_0x4c5f28;_0x51ac21=0xc8;}else{_0x51ac21=0xce;}_0x37bb5b['status'](_0x51ac21);return _0x37bb5b['set']('Content-Range',_0x2b560b+'-'+_0x4539ec+'/'+_0x4c5f28)['json'](_0x27d826);}return null;};}function saveUpdates(_0x1ad883){return function(_0x36aa81){if(_0x36aa81){return _0x36aa81[_0x7198('0x8')](_0x1ad883)[_0x7198('0x9')](function(_0x25710d){return _0x25710d;});}return null;};}function removeEntity(_0x33e206){return function(_0xb4ed){if(_0xb4ed){return _0xb4ed['destroy']()[_0x7198('0x9')](function(){_0x33e206[_0x7198('0x3')](0xcc)[_0x7198('0xa')]();});}};}function handleEntityNotFound(_0x57ac75){return function(_0x57e59e){if(!_0x57e59e){_0x57ac75[_0x7198('0xb')](0x194);}return _0x57e59e;};}function handleError(_0x37a0a4,_0x4e3a20){_0x4e3a20=_0x4e3a20||0x1f4;return function(_0x39a13d){logger[_0x7198('0xc')](_0x39a13d['stack']);if(_0x39a13d['name']){delete _0x39a13d[_0x7198('0xd')];}_0x37a0a4[_0x7198('0x3')](_0x4e3a20)[_0x7198('0xe')](_0x39a13d);};}exports[_0x7198('0xf')]=function(_0x59d9b6,_0x2a82c5){var _0x4f2edc={},_0x1be281={},_0x3fddba={'count':0x0,'rows':[]};var _0x201e7f=_[_0x7198('0x10')](db['Dynamics365Account']['rawAttributes'],function(_0x1dcc53){return{'name':_0x1dcc53['fieldName'],'type':_0x1dcc53[_0x7198('0x11')][_0x7198('0x12')]};});_0x1be281[_0x7198('0x13')]=_['map'](_0x201e7f,_0x7198('0xd'));_0x1be281[_0x7198('0x14')]=_['keys'](_0x59d9b6[_0x7198('0x14')]);_0x1be281[_0x7198('0x15')]=_['intersection'](_0x1be281[_0x7198('0x13')],_0x1be281[_0x7198('0x14')]);_0x4f2edc['attributes']=_['intersection'](_0x1be281[_0x7198('0x13')],qs[_0x7198('0x16')](_0x59d9b6[_0x7198('0x14')][_0x7198('0x16')]));_0x4f2edc['attributes']=_0x4f2edc[_0x7198('0x17')][_0x7198('0x18')]?_0x4f2edc[_0x7198('0x17')]:_0x1be281[_0x7198('0x13')];if(!_0x59d9b6[_0x7198('0x14')]['hasOwnProperty'](_0x7198('0x19'))){_0x4f2edc['limit']=qs[_0x7198('0x7')](_0x59d9b6[_0x7198('0x14')][_0x7198('0x7')]);_0x4f2edc[_0x7198('0x5')]=qs[_0x7198('0x5')](_0x59d9b6[_0x7198('0x14')]['offset']);}_0x4f2edc[_0x7198('0x1a')]=qs[_0x7198('0x1b')](_0x59d9b6[_0x7198('0x14')][_0x7198('0x1b')]);_0x4f2edc[_0x7198('0x1c')]=qs['filters'](_[_0x7198('0x1d')](_0x59d9b6[_0x7198('0x14')],_0x1be281['filters']),_0x201e7f);if(_0x59d9b6['query'][_0x7198('0x1e')]){_0x4f2edc[_0x7198('0x1c')]=_[_0x7198('0x1f')](_0x4f2edc[_0x7198('0x1c')],{'$or':_[_0x7198('0x10')](_0x201e7f,function(_0x490c7c){if(_0x490c7c[_0x7198('0x11')]!=='VIRTUAL'){var _0x50830d={};_0x50830d[_0x490c7c[_0x7198('0xd')]]={'$like':'%'+_0x59d9b6[_0x7198('0x14')][_0x7198('0x1e')]+'%'};return _0x50830d;}})});}_0x4f2edc=_[_0x7198('0x1f')]({},_0x4f2edc,_0x59d9b6[_0x7198('0x20')]);var _0x3390d6={'where':_0x4f2edc[_0x7198('0x1c')]};return db[_0x7198('0x21')][_0x7198('0x6')](_0x3390d6)[_0x7198('0x9')](function(_0x596d89){_0x3fddba[_0x7198('0x6')]=_0x596d89;if(_0x59d9b6[_0x7198('0x14')][_0x7198('0x22')]){_0x4f2edc['include']=[{'all':!![]}];}return db[_0x7198('0x21')][_0x7198('0x23')](_0x4f2edc);})['then'](function(_0x23ded5){_0x3fddba[_0x7198('0x24')]=_0x23ded5;return _0x3fddba;})[_0x7198('0x9')](respondWithFilteredResult(_0x2a82c5,_0x4f2edc))[_0x7198('0x25')](handleError(_0x2a82c5,null));};exports[_0x7198('0x26')]=function(_0x23132c,_0xdccab4){var _0x10abf2={'raw':![],'where':{'id':_0x23132c['params']['id']}},_0x463016={};_0x463016['model']=_[_0x7198('0x27')](db[_0x7198('0x21')][_0x7198('0x28')]);_0x463016[_0x7198('0x14')]=_['keys'](_0x23132c[_0x7198('0x14')]);_0x463016[_0x7198('0x15')]=_[_0x7198('0x29')](_0x463016['model'],_0x463016['query']);_0x10abf2[_0x7198('0x17')]=_[_0x7198('0x29')](_0x463016['model'],qs[_0x7198('0x16')](_0x23132c[_0x7198('0x14')][_0x7198('0x16')]));_0x10abf2[_0x7198('0x17')]=_0x10abf2['attributes'][_0x7198('0x18')]?_0x10abf2[_0x7198('0x17')]:_0x463016[_0x7198('0x13')];if(_0x23132c['query'][_0x7198('0x22')]){_0x10abf2[_0x7198('0x2a')]=[{'all':!![]}];}_0x10abf2=_[_0x7198('0x1f')]({},_0x10abf2,_0x23132c['options']);return db['Dynamics365Account'][_0x7198('0x2b')](_0x10abf2)[_0x7198('0x9')](handleEntityNotFound(_0xdccab4,null))['then'](respondWithResult(_0xdccab4,null))[_0x7198('0x25')](handleError(_0xdccab4,null));};exports[_0x7198('0x2c')]=function(_0xd94f2f,_0x220bd7){return db[_0x7198('0x21')][_0x7198('0x2c')](_0xd94f2f[_0x7198('0x2d')],{})[_0x7198('0x9')](respondWithResult(_0x220bd7,0xc9))[_0x7198('0x25')](handleError(_0x220bd7,null));};exports[_0x7198('0x8')]=function(_0x383700,_0x1dbaee){if(_0x383700[_0x7198('0x2d')]['id']){delete _0x383700[_0x7198('0x2d')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x383700[_0x7198('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1dbaee,null))[_0x7198('0x9')](saveUpdates(_0x383700['body'],null))[_0x7198('0x9')](respondWithResult(_0x1dbaee,null))[_0x7198('0x25')](handleError(_0x1dbaee,null));};exports[_0x7198('0x2f')]=function(_0x44e9be,_0x124f44){return db[_0x7198('0x21')][_0x7198('0x2b')]({'where':{'id':_0x44e9be[_0x7198('0x2e')]['id']}})['then'](handleEntityNotFound(_0x124f44,null))[_0x7198('0x9')](removeEntity(_0x124f44,null))['catch'](handleError(_0x124f44,null));};exports[_0x7198('0x30')]=function(_0x92464f,_0x31d241){var _0x199b8c={};var _0x5611cb={};var _0x3dc71f;var _0x302ccc;return db[_0x7198('0x21')][_0x7198('0x31')]({'where':{'id':_0x92464f[_0x7198('0x2e')]['id']}})[_0x7198('0x9')](handleEntityNotFound(_0x31d241,null))[_0x7198('0x9')](function(_0x4af09c){if(_0x4af09c){_0x3dc71f=_0x4af09c;_0x5611cb[_0x7198('0x13')]=_['keys'](db[_0x7198('0x32')][_0x7198('0x28')]);_0x5611cb['query']=_[_0x7198('0x27')](_0x92464f['query']);_0x5611cb[_0x7198('0x15')]=_['intersection'](_0x5611cb[_0x7198('0x13')],_0x5611cb[_0x7198('0x14')]);_0x199b8c['attributes']=_['intersection'](_0x5611cb['model'],qs['fields'](_0x92464f[_0x7198('0x14')][_0x7198('0x16')]));_0x199b8c[_0x7198('0x17')]=_0x199b8c['attributes'][_0x7198('0x18')]?_0x199b8c[_0x7198('0x17')]:_0x5611cb['model'];_0x199b8c['order']=qs[_0x7198('0x1b')](_0x92464f[_0x7198('0x14')][_0x7198('0x1b')]);_0x199b8c['where']=qs['filters'](_[_0x7198('0x1d')](_0x92464f[_0x7198('0x14')],_0x5611cb[_0x7198('0x15')]));if(_0x92464f[_0x7198('0x14')]['filter']){_0x199b8c['where']=_[_0x7198('0x1f')](_0x199b8c[_0x7198('0x1c')],{'$or':_[_0x7198('0x10')](_0x199b8c[_0x7198('0x17')],function(_0x3948e2){var _0x217cad={};_0x217cad[_0x3948e2]={'$like':'%'+_0x92464f['query'][_0x7198('0x1e')]+'%'};return _0x217cad;})});}_0x199b8c=_[_0x7198('0x1f')]({},_0x199b8c,_0x92464f[_0x7198('0x20')]);return _0x3dc71f[_0x7198('0x30')](_0x199b8c);}})[_0x7198('0x9')](function(_0x478641){if(_0x478641){_0x302ccc=_0x478641[_0x7198('0x18')];if(!_0x92464f[_0x7198('0x14')][_0x7198('0x33')](_0x7198('0x19'))){_0x199b8c[_0x7198('0x7')]=qs['limit'](_0x92464f['query'][_0x7198('0x7')]);_0x199b8c['offset']=qs[_0x7198('0x5')](_0x92464f['query'][_0x7198('0x5')]);}return _0x3dc71f['getConfigurations'](_0x199b8c);}})['then'](function(_0x2f291e){if(_0x2f291e){return _0x2f291e?{'count':_0x302ccc,'rows':_0x2f291e}:null;}})[_0x7198('0x9')](respondWithResult(_0x31d241,null))[_0x7198('0x25')](handleError(_0x31d241,null));};exports['addConfiguration']=function(_0xb5451d,_0x1e79fe){if(_0xb5451d[_0x7198('0x2d')]['id']){delete _0xb5451d[_0x7198('0x2d')]['id'];}return db[_0x7198('0x21')][_0x7198('0x31')]({'where':{'id':_0xb5451d[_0x7198('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1e79fe,null))['then'](function(_0x1245bb){if(_0x1245bb){_0xb5451d[_0x7198('0x2d')][_0x7198('0x34')]=_0x1245bb['id'];_0xb5451d[_0x7198('0x2d')][_0x7198('0x35')]=integrations[_0x7198('0x36')](_0xb5451d[_0x7198('0x2d')][_0x7198('0x37')],_0xb5451d['body'][_0x7198('0x11')]);_0xb5451d['body'][_0x7198('0x38')]=integrations[_0x7198('0x39')](_0xb5451d[_0x7198('0x2d')]['channel'],_0xb5451d[_0x7198('0x2d')][_0x7198('0x11')]);return db[_0x7198('0x32')]['create'](_0xb5451d[_0x7198('0x2d')],{'include':[{'model':db[_0x7198('0x3a')],'as':'Subjects'},{'model':db[_0x7198('0x3a')],'as':'Descriptions'}]});}return null;})[_0x7198('0x9')](respondWithResult(_0x1e79fe,null))[_0x7198('0x25')](handleError(_0x1e79fe,null));};function sanitizeRemoteUri(_0x13b777){var _0x51fa2b=_0x13b777['slice'](-0x1);if(_0x51fa2b==='/')return _0x13b777[_0x7198('0x3b')](0x0,_0x13b777[_0x7198('0x3c')](_0x51fa2b));return _0x13b777;}function getWebApiUrl(_0x31950b){return util[_0x7198('0x3d')](_0x7198('0x3e'),_0x31950b);}exports[_0x7198('0x3f')]=function(_0x454875,_0x20e2b6){var _0x2b886f=_0x454875[_0x7198('0x14')][_0x7198('0x40')];var _0x31ed6a=_0x2b886f===_0x7198('0x41')?_0x7198('0x42'):_0x7198('0x43');var _0x56f3ab='';var _0x56a0e0='';var _0x154e6e='';var _0x3b68d3='';var _0x493277='';var _0x57eea9='';var _0x176102='';var _0x68eac2='';var _0x46113a=['title',_0x7198('0x44'),'customerid',_0x7198('0x45'),'caseorigincode',_0x7198('0x46'),_0x7198('0x47'),_0x7198('0x48'),_0x7198('0x49'),_0x7198('0x4a')];var _0x400830=[_0x7198('0x4b'),_0x7198('0x4c'),'actualserviceunits',_0x7198('0x4d'),_0x7198('0x4e'),_0x7198('0x4f'),_0x7198('0x50'),_0x7198('0x51'),_0x7198('0x52'),'createdbyexternalpartyyominame',_0x7198('0x53'),_0x7198('0x54'),_0x7198('0x55'),_0x7198('0x56'),_0x7198('0x57'),_0x7198('0x58'),'customeridtype',_0x7198('0x59'),_0x7198('0x5a'),_0x7198('0x5b'),_0x7198('0x5c'),'entityimage_url',_0x7198('0x5d'),_0x7198('0x5e'),_0x7198('0x5f'),'followupby',_0x7198('0x60'),_0x7198('0x61'),'kbarticleidname',_0x7198('0x62'),_0x7198('0x63'),'modifiedbyexternalpartyname',_0x7198('0x64'),_0x7198('0x65'),_0x7198('0x66'),_0x7198('0x67'),'modifiedonbehalfbyname',_0x7198('0x68'),'msdyn_incidenttypename',_0x7198('0x69'),_0x7198('0x6a'),_0x7198('0x6b'),'overriddencreatedon',_0x7198('0x6c'),_0x7198('0x6d'),'owneridyominame',_0x7198('0x6e'),_0x7198('0x6f'),'primarycontactidyominame',_0x7198('0x70'),'productidname',_0x7198('0x71'),_0x7198('0x72'),_0x7198('0x73'),_0x7198('0x74'),'responsiblecontactidname',_0x7198('0x75'),'sentimentvalue',_0x7198('0x76'),_0x7198('0x77'),_0x7198('0x78'),_0x7198('0x79'),'statuscode',_0x7198('0x7a'),_0x7198('0x7b'),_0x7198('0x7c'),_0x7198('0x7d'),_0x7198('0x7e'),'utcconversiontimezonecode','versionnumber'];var _0x5bdb0f=_0x46113a[_0x7198('0x7f')](_0x400830);return db[_0x7198('0x21')][_0x7198('0x31')]({'where':{'id':_0x454875[_0x7198('0x2e')]['id']},'attributes':['id',_0x7198('0x80'),_0x7198('0x81'),_0x7198('0x82'),_0x7198('0x83'),_0x7198('0x84'),_0x7198('0x85'),_0x7198('0x86')],'include':[{'model':db['CloudProvider'],'as':_0x7198('0x87'),'attributes':['id','data5','data7']}]})[_0x7198('0x9')](handleEntityNotFound(_0x20e2b6,null))['then'](function(_0x351dd2){if(_0x351dd2){if(_0x351dd2['modernAuthentication']){_0x351dd2[_0x7198('0x88')]=_0x351dd2[_0x7198('0x87')]['data5'];_0x68eac2=sanitizeRemoteUri(_0x351dd2[_0x7198('0x87')]['data7']);_0x176102=getWebApiUrl(_0x68eac2);return _0x351dd2;}_0x68eac2=sanitizeRemoteUri(_0x351dd2[_0x7198('0x82')]);_0x176102=getWebApiUrl(_0x68eac2);var _0x49572b={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x351dd2[_0x7198('0x83')]+_0x7198('0x89'),'form':{'client_id':_0x351dd2['clientId'],'resource':_0x68eac2,'username':_0x351dd2['username'],'password':_0x351dd2[_0x7198('0x81')],'grant_type':_0x7198('0x81'),'client_secret':_0x351dd2[_0x7198('0x85')]},'json':!![]};return rp(_0x49572b);}})[_0x7198('0x9')](function(_0x12aa8b){_0x57eea9=_0x12aa8b['access_token'];var _0x5ad5d6={'method':_0x7198('0x8a'),'uri':encodeURI(_0x176102+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x31ed6a+'\x27'),'headers':{'Authorization':_0x7198('0x8b')+_0x57eea9,'If-None-Match':null,'OData-Version':_0x7198('0x8c')},'json':!![]};return rp(_0x5ad5d6);})[_0x7198('0x9')](function(_0x5fddd6){var _0x4393f1=_0x5fddd6[_0x7198('0x8d')][0x0];var _0x4354e6=_0x4393f1[_0x7198('0x8e')];var _0x5cb715={'method':'GET','uri':_0x176102+_0x7198('0x8f')+_0x4354e6+_0x7198('0x90'),'headers':{'Authorization':_0x7198('0x8b')+_0x57eea9,'If-None-Match':null,'OData-Version':_0x7198('0x8c')},'json':!![]};return rp(_0x5cb715);})[_0x7198('0x9')](function(_0xff312a){_0x56f3ab=_0xff312a;_0x56a0e0=_0x56f3ab[_0x7198('0x91')];_0x56a0e0=_[_0x7198('0x92')](_0x56a0e0,function(_0x1806ca){return!_0x5bdb0f[_0x7198('0x93')](_0x1806ca[_0x7198('0x94')]);});var _0x1ba28d=[];var _0x1fe8c3=[];_0x56a0e0[_0x7198('0x95')](function(_0x2eae5f){if(_0x2eae5f[_0x7198('0x96')]){var _0x25bebe=_0x2eae5f[_0x7198('0x96')][_0x7198('0x3b')](_0x2eae5f[_0x7198('0x96')]['lastIndexOf']('.')+0x1);if(_0x25bebe===_0x7198('0x97')){_0x1ba28d[_0x7198('0x98')](getSelectList(_0x176102,_0x2b886f,_0x1fe8c3,_0x56f3ab['MetadataId'],_0x2eae5f[_0x7198('0x8e')],_0x57eea9));}}});return Promise[_0x7198('0x99')](_0x1ba28d);})[_0x7198('0x9')](function(_0x2b9fd8){_0x154e6e=_0x2b9fd8[0x0];var _0xdb0a85=[];var _0x1bfe20=[];_0x56a0e0['forEach'](function(_0x3fac24){if(!_[_0x7198('0x9a')](_0x3fac24[_0x7198('0x96')])){var _0xcf13c3=_0x3fac24[_0x7198('0x96')]['substring'](_0x3fac24[_0x7198('0x96')][_0x7198('0x3c')]('.')+0x1);if(_0xcf13c3===_0x7198('0x9b')){_0xdb0a85[_0x7198('0x98')](getBooleanList(_0x176102,_0x2b886f,_0x1bfe20,_0x56f3ab[_0x7198('0x8e')],_0x3fac24[_0x7198('0x8e')],_0x57eea9));}}});return Promise['all'](_0xdb0a85);})['then'](function(_0x3d98cd){_0x3b68d3=_0x3d98cd[0x0];var _0x43f355=[];var _0xcbdbd8=[];_0x56a0e0[_0x7198('0x95')](function(_0x3df9cb){if(_0x3df9cb[_0x7198('0x96')]){var _0x4b32b2=_0x3df9cb[_0x7198('0x96')][_0x7198('0x3b')](_0x3df9cb[_0x7198('0x96')]['lastIndexOf']('.')+0x1);if(_0x4b32b2==='StringAttributeMetadata'||_0x4b32b2===_0x7198('0x9c')||_0x4b32b2===_0x7198('0x9d')||_0x4b32b2===_0x7198('0x9e')||_0x4b32b2===_0x7198('0x9f')||_0x4b32b2==='DateTimeAttributeMetadata'||_0x4b32b2==='StatusAttributeMetadata'||_0x4b32b2===_0x7198('0xa0')||_0x4b32b2===_0x7198('0xa1')||_0x4b32b2===_0x7198('0xa2')){_0x43f355[_0x7198('0x98')](getInputList(_0x176102,_0x2b886f,_0x4b32b2,_0xcbdbd8,_0x56f3ab[_0x7198('0x8e')],_0x3df9cb[_0x7198('0x8e')],_0x57eea9));}}});return Promise[_0x7198('0x99')](_0x43f355);})[_0x7198('0x9')](function(_0x589ee2){_0x493277=_0x589ee2[0x0];var _0x2b67ac=_0x154e6e[_0x7198('0x7f')](_0x3b68d3)[_0x7198('0x7f')](_0x493277);var _0xcc5737={'count':_0x2b67ac[_0x7198('0x18')],'rows':_0x2b67ac};return _0xcc5737;})[_0x7198('0x9')](respondWithResult(_0x20e2b6,null))[_0x7198('0x25')](function(_0x19dd16){var _0x592b03=_0x454875['query'][_0x7198('0xa3')]?0x1f4:_0x19dd16['statusCode']||0x1f4;logger[_0x7198('0xc')](_0x19dd16[_0x7198('0xa4')]);delete _0x19dd16[_0x7198('0xd')];if(_0x592b03===0x191){_0x592b03=0x190;}_0x20e2b6[_0x7198('0x3')](_0x592b03)['send'](_0x454875['query'][_0x7198('0xa3')]?{'message':'Wrong\x20credentials','statusCode':_0x19dd16['statusCode']}:_0x19dd16);});};function getSelectList(_0x33e2d,_0x326ebc,_0x5115ac,_0x4be1b3,_0x1ecf2a,_0x415084){var _0x36d0ed={'method':_0x7198('0x8a'),'uri':_0x33e2d+_0x7198('0x8f')+_0x4be1b3+_0x7198('0xa5')+_0x1ecf2a+_0x7198('0xa6')+_0x7198('0xa7'),'headers':{'Authorization':'Bearer\x20'+_0x415084,'If-None-Match':null,'OData-Version':_0x7198('0x8c')},'json':!![]};return rp(_0x36d0ed)[_0x7198('0x9')](function(_0x5687b5){var _0x249977=[];var _0xae4504=_0x5687b5['OptionSet'][_0x7198('0xa8')];_0xae4504[_0x7198('0x95')](function(_0x9a1295){_0x249977['push']({'name':_0x9a1295[_0x7198('0xa9')][_0x7198('0xaa')]['Label'],'value':String(_0x9a1295[_0x7198('0xab')])});});var _0x1c3404={'id':_0x326ebc+'_'+_0x5687b5[_0x7198('0x94')],'name':_0x5687b5['DisplayName'][_0x7198('0xaa')][_0x7198('0xa9')],'custom':![],'options':_0x249977};_0x5115ac[_0x7198('0x98')](_0x1c3404);return _0x5115ac;});}function getBooleanList(_0x16abc0,_0x1c97a1,_0x26bc40,_0x315480,_0x52c500,_0xb6617d){var _0x3745ff={'method':_0x7198('0x8a'),'uri':_0x16abc0+_0x7198('0x8f')+_0x315480+_0x7198('0xa5')+_0x52c500+_0x7198('0xac'),'headers':{'Authorization':'Bearer\x20'+_0xb6617d,'If-None-Match':null,'OData-Version':_0x7198('0x8c')},'json':!![]};return rp(_0x3745ff)['then'](function(_0x1195f4){var _0x4f7997=[];_0x4f7997[_0x7198('0x98')]({'name':_0x1195f4['OptionSet']['TrueOption'][_0x7198('0xa9')][_0x7198('0xaa')][_0x7198('0xa9')],'value':'true'},{'name':_0x1195f4[_0x7198('0xad')][_0x7198('0xae')][_0x7198('0xa9')][_0x7198('0xaa')]['Label'],'value':_0x7198('0xaf')});var _0x51a539={'id':_0x1c97a1+'_'+_0x1195f4[_0x7198('0x94')],'name':_0x1195f4[_0x7198('0xb0')][_0x7198('0xaa')][_0x7198('0xa9')],'custom':![],'options':_0x4f7997};_0x26bc40[_0x7198('0x98')](_0x51a539);return _0x26bc40;});}function getInputList(_0x57f00d,_0x14e7e8,_0x1a696c,_0x10c4cb,_0x3935eb,_0x11a63b,_0x49f551){var _0x125f44={'method':'GET','uri':_0x57f00d+'EntityDefinitions('+_0x3935eb+_0x7198('0xa5')+_0x11a63b+_0x7198('0xb1')+_0x1a696c+_0x7198('0xb2'),'headers':{'Authorization':_0x7198('0x8b')+_0x49f551,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x125f44)['then'](function(_0x532889){var _0x56cd4b={'id':_0x14e7e8+'_'+_0x532889['LogicalName'],'name':_0x532889[_0x7198('0xb0')][_0x7198('0xaa')]?_0x532889[_0x7198('0xb0')][_0x7198('0xaa')][_0x7198('0xa9')]:_0x532889[_0x7198('0x94')],'custom':![],'options':[]};_0x10c4cb['push'](_0x56cd4b);return _0x10c4cb;});} \ No newline at end of file +var _0x4dc5=['type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','then','includeAll','include','findAll','rows','catch','params','merge','find','create','body','findOne','Dynamics365Configuration','getConfigurations','hasOwnProperty','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','substring','lastIndexOf','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','concat','username','remoteUri','clientId','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','tenantId','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes'];(function(_0x60b354,_0x35c4da){var _0xbcc036=function(_0xcb3cc4){while(--_0xcb3cc4){_0x60b354['push'](_0x60b354['shift']());}};_0xbcc036(++_0x35c4da);}(_0x4dc5,0x96));var _0x54dc=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x4dc5[_0x819464];return _0x49dcc0;};'use strict';var rp=require('request-promise');var util=require(_0x54dc('0x0'));var _=require(_0x54dc('0x1'));var qs=require(_0x54dc('0x2'));var logger=require(_0x54dc('0x3'))(_0x54dc('0x4'));var db=require(_0x54dc('0x5'))['db'];var integrations=require(_0x54dc('0x6'));function respondWithResult(_0x1fe977,_0x122bbc){_0x122bbc=_0x122bbc||0xc8;return function(_0x16782c){if(_0x16782c){return _0x1fe977[_0x54dc('0x7')](_0x122bbc)[_0x54dc('0x8')](_0x16782c);}};}function respondWithFilteredResult(_0x3d625f,_0x214f21){return function(_0x391dc6){if(_0x391dc6){var _0x208b8d=typeof _0x214f21[_0x54dc('0x9')]==='undefined'&&typeof _0x214f21[_0x54dc('0xa')]===_0x54dc('0xb');var _0x68da32=_0x391dc6[_0x54dc('0xc')];var _0x26b585=_0x208b8d?0x0:_0x214f21[_0x54dc('0x9')];var _0x2c3a85=_0x208b8d?_0x391dc6[_0x54dc('0xc')]:_0x214f21['offset']+_0x214f21[_0x54dc('0xa')];var _0x43b78a;if(_0x2c3a85>=_0x68da32){_0x2c3a85=_0x68da32;_0x43b78a=0xc8;}else{_0x43b78a=0xce;}_0x3d625f[_0x54dc('0x7')](_0x43b78a);return _0x3d625f[_0x54dc('0xd')](_0x54dc('0xe'),_0x26b585+'-'+_0x2c3a85+'/'+_0x68da32)['json'](_0x391dc6);}return null;};}function saveUpdates(_0x4257c2){return function(_0x47b0ae){if(_0x47b0ae){return _0x47b0ae[_0x54dc('0xf')](_0x4257c2)['then'](function(_0x1222e2){return _0x1222e2;});}return null;};}function removeEntity(_0x55c5f9){return function(_0x30af19){if(_0x30af19){return _0x30af19[_0x54dc('0x10')]()['then'](function(){_0x55c5f9['status'](0xcc)[_0x54dc('0x11')]();});}};}function handleEntityNotFound(_0x401098){return function(_0x1a46e9){if(!_0x1a46e9){_0x401098[_0x54dc('0x12')](0x194);}return _0x1a46e9;};}function handleError(_0x13010a,_0x2e22ce){_0x2e22ce=_0x2e22ce||0x1f4;return function(_0x3a2387){logger[_0x54dc('0x13')](_0x3a2387[_0x54dc('0x14')]);if(_0x3a2387[_0x54dc('0x15')]){delete _0x3a2387[_0x54dc('0x15')];}_0x13010a[_0x54dc('0x7')](_0x2e22ce)[_0x54dc('0x16')](_0x3a2387);};}exports[_0x54dc('0x17')]=function(_0x1b082f,_0x56313c){var _0x1723aa={},_0x3721d8={},_0x2d3947={'count':0x0,'rows':[]};var _0x19b7bc=_[_0x54dc('0x18')](db[_0x54dc('0x19')][_0x54dc('0x1a')],function(_0xf2045c){return{'name':_0xf2045c['fieldName'],'type':_0xf2045c[_0x54dc('0x1b')][_0x54dc('0x1c')]};});_0x3721d8[_0x54dc('0x1d')]=_[_0x54dc('0x18')](_0x19b7bc,_0x54dc('0x15'));_0x3721d8[_0x54dc('0x1e')]=_[_0x54dc('0x1f')](_0x1b082f[_0x54dc('0x1e')]);_0x3721d8[_0x54dc('0x20')]=_['intersection'](_0x3721d8[_0x54dc('0x1d')],_0x3721d8['query']);_0x1723aa[_0x54dc('0x21')]=_[_0x54dc('0x22')](_0x3721d8[_0x54dc('0x1d')],qs[_0x54dc('0x23')](_0x1b082f[_0x54dc('0x1e')][_0x54dc('0x23')]));_0x1723aa[_0x54dc('0x21')]=_0x1723aa['attributes'][_0x54dc('0x24')]?_0x1723aa[_0x54dc('0x21')]:_0x3721d8[_0x54dc('0x1d')];if(!_0x1b082f[_0x54dc('0x1e')]['hasOwnProperty'](_0x54dc('0x25'))){_0x1723aa[_0x54dc('0xa')]=qs[_0x54dc('0xa')](_0x1b082f[_0x54dc('0x1e')]['limit']);_0x1723aa[_0x54dc('0x9')]=qs[_0x54dc('0x9')](_0x1b082f['query'][_0x54dc('0x9')]);}_0x1723aa[_0x54dc('0x26')]=qs[_0x54dc('0x27')](_0x1b082f[_0x54dc('0x1e')][_0x54dc('0x27')]);_0x1723aa[_0x54dc('0x28')]=qs[_0x54dc('0x20')](_[_0x54dc('0x29')](_0x1b082f['query'],_0x3721d8['filters']),_0x19b7bc);if(_0x1b082f[_0x54dc('0x1e')][_0x54dc('0x2a')]){_0x1723aa['where']=_['merge'](_0x1723aa[_0x54dc('0x28')],{'$or':_[_0x54dc('0x18')](_0x19b7bc,function(_0x39f0c9){if(_0x39f0c9[_0x54dc('0x1b')]!=='VIRTUAL'){var _0x99f41e={};_0x99f41e[_0x39f0c9[_0x54dc('0x15')]]={'$like':'%'+_0x1b082f[_0x54dc('0x1e')][_0x54dc('0x2a')]+'%'};return _0x99f41e;}})});}_0x1723aa=_['merge']({},_0x1723aa,_0x1b082f['options']);var _0x4df393={'where':_0x1723aa['where']};return db[_0x54dc('0x19')][_0x54dc('0xc')](_0x4df393)[_0x54dc('0x2b')](function(_0x13f476){_0x2d3947[_0x54dc('0xc')]=_0x13f476;if(_0x1b082f[_0x54dc('0x1e')][_0x54dc('0x2c')]){_0x1723aa[_0x54dc('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x54dc('0x2e')](_0x1723aa);})['then'](function(_0x3f2849){_0x2d3947[_0x54dc('0x2f')]=_0x3f2849;return _0x2d3947;})[_0x54dc('0x2b')](respondWithFilteredResult(_0x56313c,_0x1723aa))[_0x54dc('0x30')](handleError(_0x56313c,null));};exports['show']=function(_0x2e5072,_0x1b5eb0){var _0xd4a18d={'raw':![],'where':{'id':_0x2e5072[_0x54dc('0x31')]['id']}},_0x166d39={};_0x166d39[_0x54dc('0x1d')]=_['keys'](db[_0x54dc('0x19')][_0x54dc('0x1a')]);_0x166d39[_0x54dc('0x1e')]=_[_0x54dc('0x1f')](_0x2e5072['query']);_0x166d39[_0x54dc('0x20')]=_[_0x54dc('0x22')](_0x166d39[_0x54dc('0x1d')],_0x166d39[_0x54dc('0x1e')]);_0xd4a18d[_0x54dc('0x21')]=_[_0x54dc('0x22')](_0x166d39[_0x54dc('0x1d')],qs[_0x54dc('0x23')](_0x2e5072['query'][_0x54dc('0x23')]));_0xd4a18d[_0x54dc('0x21')]=_0xd4a18d['attributes']['length']?_0xd4a18d[_0x54dc('0x21')]:_0x166d39[_0x54dc('0x1d')];if(_0x2e5072[_0x54dc('0x1e')][_0x54dc('0x2c')]){_0xd4a18d[_0x54dc('0x2d')]=[{'all':!![]}];}_0xd4a18d=_[_0x54dc('0x32')]({},_0xd4a18d,_0x2e5072['options']);return db[_0x54dc('0x19')][_0x54dc('0x33')](_0xd4a18d)[_0x54dc('0x2b')](handleEntityNotFound(_0x1b5eb0,null))[_0x54dc('0x2b')](respondWithResult(_0x1b5eb0,null))[_0x54dc('0x30')](handleError(_0x1b5eb0,null));};exports[_0x54dc('0x34')]=function(_0x2757b8,_0xbc748c){return db[_0x54dc('0x19')][_0x54dc('0x34')](_0x2757b8[_0x54dc('0x35')],{})[_0x54dc('0x2b')](respondWithResult(_0xbc748c,0xc9))[_0x54dc('0x30')](handleError(_0xbc748c,null));};exports[_0x54dc('0xf')]=function(_0x1ef21c,_0x1e9cea){if(_0x1ef21c['body']['id']){delete _0x1ef21c['body']['id'];}return db[_0x54dc('0x19')][_0x54dc('0x33')]({'where':{'id':_0x1ef21c['params']['id']}})[_0x54dc('0x2b')](handleEntityNotFound(_0x1e9cea,null))[_0x54dc('0x2b')](saveUpdates(_0x1ef21c['body'],null))[_0x54dc('0x2b')](respondWithResult(_0x1e9cea,null))['catch'](handleError(_0x1e9cea,null));};exports[_0x54dc('0x10')]=function(_0x3ad85b,_0x144b7a){return db[_0x54dc('0x19')][_0x54dc('0x33')]({'where':{'id':_0x3ad85b[_0x54dc('0x31')]['id']}})[_0x54dc('0x2b')](handleEntityNotFound(_0x144b7a,null))[_0x54dc('0x2b')](removeEntity(_0x144b7a,null))[_0x54dc('0x30')](handleError(_0x144b7a,null));};exports['getConfigurations']=function(_0xe3e992,_0x349629){var _0x504c33={};var _0x46fcbc={};var _0x20c8e2;var _0x486e1c;return db[_0x54dc('0x19')][_0x54dc('0x36')]({'where':{'id':_0xe3e992[_0x54dc('0x31')]['id']}})['then'](handleEntityNotFound(_0x349629,null))['then'](function(_0x38ecf4){if(_0x38ecf4){_0x20c8e2=_0x38ecf4;_0x46fcbc['model']=_[_0x54dc('0x1f')](db[_0x54dc('0x37')][_0x54dc('0x1a')]);_0x46fcbc['query']=_['keys'](_0xe3e992[_0x54dc('0x1e')]);_0x46fcbc['filters']=_['intersection'](_0x46fcbc[_0x54dc('0x1d')],_0x46fcbc['query']);_0x504c33[_0x54dc('0x21')]=_[_0x54dc('0x22')](_0x46fcbc[_0x54dc('0x1d')],qs[_0x54dc('0x23')](_0xe3e992[_0x54dc('0x1e')][_0x54dc('0x23')]));_0x504c33[_0x54dc('0x21')]=_0x504c33[_0x54dc('0x21')][_0x54dc('0x24')]?_0x504c33[_0x54dc('0x21')]:_0x46fcbc['model'];_0x504c33[_0x54dc('0x26')]=qs[_0x54dc('0x27')](_0xe3e992[_0x54dc('0x1e')][_0x54dc('0x27')]);_0x504c33[_0x54dc('0x28')]=qs[_0x54dc('0x20')](_[_0x54dc('0x29')](_0xe3e992['query'],_0x46fcbc[_0x54dc('0x20')]));if(_0xe3e992[_0x54dc('0x1e')][_0x54dc('0x2a')]){_0x504c33['where']=_[_0x54dc('0x32')](_0x504c33['where'],{'$or':_[_0x54dc('0x18')](_0x504c33[_0x54dc('0x21')],function(_0x20f724){var _0x5430d3={};_0x5430d3[_0x20f724]={'$like':'%'+_0xe3e992[_0x54dc('0x1e')][_0x54dc('0x2a')]+'%'};return _0x5430d3;})});}_0x504c33=_[_0x54dc('0x32')]({},_0x504c33,_0xe3e992['options']);return _0x20c8e2[_0x54dc('0x38')](_0x504c33);}})['then'](function(_0x1dc6b6){if(_0x1dc6b6){_0x486e1c=_0x1dc6b6['length'];if(!_0xe3e992[_0x54dc('0x1e')][_0x54dc('0x39')](_0x54dc('0x25'))){_0x504c33['limit']=qs['limit'](_0xe3e992['query']['limit']);_0x504c33[_0x54dc('0x9')]=qs[_0x54dc('0x9')](_0xe3e992[_0x54dc('0x1e')][_0x54dc('0x9')]);}return _0x20c8e2[_0x54dc('0x38')](_0x504c33);}})[_0x54dc('0x2b')](function(_0x5e52dc){if(_0x5e52dc){return _0x5e52dc?{'count':_0x486e1c,'rows':_0x5e52dc}:null;}})[_0x54dc('0x2b')](respondWithResult(_0x349629,null))[_0x54dc('0x30')](handleError(_0x349629,null));};exports['addConfiguration']=function(_0xf39d63,_0x42dee1){if(_0xf39d63[_0x54dc('0x35')]['id']){delete _0xf39d63['body']['id'];}return db['Dynamics365Account'][_0x54dc('0x36')]({'where':{'id':_0xf39d63[_0x54dc('0x31')]['id']}})['then'](handleEntityNotFound(_0x42dee1,null))[_0x54dc('0x2b')](function(_0x3db12a){if(_0x3db12a){_0xf39d63[_0x54dc('0x35')]['AccountId']=_0x3db12a['id'];_0xf39d63['body'][_0x54dc('0x3a')]=integrations[_0x54dc('0x3b')](_0xf39d63[_0x54dc('0x35')][_0x54dc('0x3c')],_0xf39d63[_0x54dc('0x35')][_0x54dc('0x1b')]);_0xf39d63[_0x54dc('0x35')]['Descriptions']=integrations[_0x54dc('0x3d')](_0xf39d63[_0x54dc('0x35')]['channel'],_0xf39d63[_0x54dc('0x35')]['type']);return db[_0x54dc('0x37')][_0x54dc('0x34')](_0xf39d63[_0x54dc('0x35')],{'include':[{'model':db[_0x54dc('0x3e')],'as':'Subjects'},{'model':db[_0x54dc('0x3e')],'as':'Descriptions'}]});}return null;})[_0x54dc('0x2b')](respondWithResult(_0x42dee1,null))[_0x54dc('0x30')](handleError(_0x42dee1,null));};function sanitizeRemoteUri(_0x2c3f22){var _0x229921=_0x2c3f22['slice'](-0x1);if(_0x229921==='/')return _0x2c3f22[_0x54dc('0x3f')](0x0,_0x2c3f22[_0x54dc('0x40')](_0x229921));return _0x2c3f22;}function getWebApiUrl(_0x27f1fa){return util['format'](_0x54dc('0x41'),_0x27f1fa);}exports[_0x54dc('0x42')]=function(_0x4e3859,_0x5d4c15){var _0xdddeed=_0x4e3859[_0x54dc('0x1e')]['ticketType'];var _0x465c99=_0xdddeed===_0x54dc('0x43')?_0x54dc('0x44'):_0x54dc('0x45');var _0x24c407='';var _0x1be7e6='';var _0x1f97dc='';var _0x301fcb='';var _0x303907='';var _0x199f27='';var _0x5aab6b='';var _0xb6dbc1='';var _0x543004=['title','description','customerid',_0x54dc('0x46'),_0x54dc('0x47'),_0x54dc('0x48'),_0x54dc('0x49'),_0x54dc('0x4a'),_0x54dc('0x4b'),_0x54dc('0x4c')];var _0x359c3f=['accountidname',_0x54dc('0x4d'),_0x54dc('0x4e'),_0x54dc('0x4f'),_0x54dc('0x50'),'contactidyominame',_0x54dc('0x51'),_0x54dc('0x52'),_0x54dc('0x53'),_0x54dc('0x54'),'createdbyname',_0x54dc('0x55'),_0x54dc('0x56'),_0x54dc('0x57'),'createdonbehalfbyyominame','customeridname',_0x54dc('0x58'),_0x54dc('0x59'),_0x54dc('0x5a'),_0x54dc('0x5b'),'entityimage_timestamp',_0x54dc('0x5c'),_0x54dc('0x5d'),'exchangerate',_0x54dc('0x5e'),_0x54dc('0x5f'),_0x54dc('0x60'),'influencescore',_0x54dc('0x61'),_0x54dc('0x62'),_0x54dc('0x63'),_0x54dc('0x64'),_0x54dc('0x65'),_0x54dc('0x66'),_0x54dc('0x67'),_0x54dc('0x68'),_0x54dc('0x69'),'modifiedonbehalfbyyominame',_0x54dc('0x6a'),_0x54dc('0x6b'),_0x54dc('0x6c'),_0x54dc('0x6d'),'overriddencreatedon',_0x54dc('0x6e'),_0x54dc('0x6f'),_0x54dc('0x70'),_0x54dc('0x71'),'primarycontactidname',_0x54dc('0x72'),_0x54dc('0x73'),'productidname',_0x54dc('0x74'),_0x54dc('0x75'),_0x54dc('0x76'),_0x54dc('0x77'),_0x54dc('0x78'),_0x54dc('0x79'),'sentimentvalue',_0x54dc('0x7a'),'slaname',_0x54dc('0x7b'),_0x54dc('0x7c'),_0x54dc('0x7d'),_0x54dc('0x7e'),'ticketnumber',_0x54dc('0x7f'),'transactioncurrencyidname',_0x54dc('0x80'),'utcconversiontimezonecode','versionnumber'];var _0x3876ce=_0x543004[_0x54dc('0x81')](_0x359c3f);return db[_0x54dc('0x19')][_0x54dc('0x36')]({'where':{'id':_0x4e3859[_0x54dc('0x31')]['id']},'attributes':['id',_0x54dc('0x82'),'password',_0x54dc('0x83'),'tenantId',_0x54dc('0x84'),'clientSecret',_0x54dc('0x85')],'include':[{'model':db[_0x54dc('0x86')],'as':_0x54dc('0x86'),'attributes':['id',_0x54dc('0x87'),_0x54dc('0x88')]}]})['then'](handleEntityNotFound(_0x5d4c15,null))[_0x54dc('0x2b')](function(_0x2ab934){if(_0x2ab934){if(_0x2ab934[_0x54dc('0x85')]){_0x2ab934['access_token']=_0x2ab934[_0x54dc('0x86')][_0x54dc('0x87')];_0xb6dbc1=sanitizeRemoteUri(_0x2ab934[_0x54dc('0x86')][_0x54dc('0x88')]);_0x5aab6b=getWebApiUrl(_0xb6dbc1);return _0x2ab934;}_0xb6dbc1=sanitizeRemoteUri(_0x2ab934['remoteUri']);_0x5aab6b=getWebApiUrl(_0xb6dbc1);var _0x3010de={'method':_0x54dc('0x89'),'uri':_0x54dc('0x8a')+_0x2ab934[_0x54dc('0x8b')]+'/oauth2/token','form':{'client_id':_0x2ab934['clientId'],'resource':_0xb6dbc1,'username':_0x2ab934[_0x54dc('0x82')],'password':_0x2ab934[_0x54dc('0x8c')],'grant_type':_0x54dc('0x8c'),'client_secret':_0x2ab934['clientSecret']},'json':!![]};return rp(_0x3010de);}})['then'](function(_0x2eecf0){_0x199f27=_0x2eecf0[_0x54dc('0x8d')];var _0x3d9647={'method':'GET','uri':encodeURI(_0x5aab6b+_0x54dc('0x8e')+_0x465c99+'\x27'),'headers':{'Authorization':_0x54dc('0x8f')+_0x199f27,'If-None-Match':null,'OData-Version':_0x54dc('0x90')},'json':!![]};return rp(_0x3d9647);})['then'](function(_0x198b8e){var _0x191b5f=_0x198b8e[_0x54dc('0x91')][0x0];var _0x5d4cea=_0x191b5f[_0x54dc('0x92')];var _0x2e8c6c={'method':_0x54dc('0x93'),'uri':_0x5aab6b+_0x54dc('0x94')+_0x5d4cea+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x54dc('0x8f')+_0x199f27,'If-None-Match':null,'OData-Version':_0x54dc('0x90')},'json':!![]};return rp(_0x2e8c6c);})[_0x54dc('0x2b')](function(_0x4b916d){_0x24c407=_0x4b916d;_0x1be7e6=_0x24c407[_0x54dc('0x95')];_0x1be7e6=_['remove'](_0x1be7e6,function(_0x5745e5){return!_0x3876ce['includes'](_0x5745e5[_0x54dc('0x96')]);});var _0x4abf82=[];var _0x91a9b9=[];_0x1be7e6[_0x54dc('0x97')](function(_0x547a92){if(_0x547a92[_0x54dc('0x98')]){var _0x4f6722=_0x547a92[_0x54dc('0x98')][_0x54dc('0x3f')](_0x547a92[_0x54dc('0x98')][_0x54dc('0x40')]('.')+0x1);if(_0x4f6722===_0x54dc('0x99')){_0x4abf82[_0x54dc('0x9a')](getSelectList(_0x5aab6b,_0xdddeed,_0x91a9b9,_0x24c407[_0x54dc('0x92')],_0x547a92[_0x54dc('0x92')],_0x199f27));}}});return Promise[_0x54dc('0x9b')](_0x4abf82);})['then'](function(_0x84033a){_0x1f97dc=_0x84033a[0x0];var _0x4be982=[];var _0x527298=[];_0x1be7e6[_0x54dc('0x97')](function(_0x38ac61){if(!_['isNil'](_0x38ac61['@odata.type'])){var _0x43556a=_0x38ac61[_0x54dc('0x98')][_0x54dc('0x3f')](_0x38ac61[_0x54dc('0x98')]['lastIndexOf']('.')+0x1);if(_0x43556a==='BooleanAttributeMetadata'){_0x4be982[_0x54dc('0x9a')](getBooleanList(_0x5aab6b,_0xdddeed,_0x527298,_0x24c407[_0x54dc('0x92')],_0x38ac61[_0x54dc('0x92')],_0x199f27));}}});return Promise[_0x54dc('0x9b')](_0x4be982);})[_0x54dc('0x2b')](function(_0x35116f){_0x301fcb=_0x35116f[0x0];var _0x31949a=[];var _0x4f19cb=[];_0x1be7e6['forEach'](function(_0x1cef6f){if(_0x1cef6f[_0x54dc('0x98')]){var _0x54d46c=_0x1cef6f[_0x54dc('0x98')][_0x54dc('0x3f')](_0x1cef6f['@odata.type']['lastIndexOf']('.')+0x1);if(_0x54d46c===_0x54dc('0x9c')||_0x54d46c===_0x54dc('0x9d')||_0x54d46c===_0x54dc('0x9e')||_0x54d46c==='IntegerAttributeMetadata'||_0x54d46c===_0x54dc('0x9f')||_0x54d46c==='DateTimeAttributeMetadata'||_0x54d46c==='StatusAttributeMetadata'||_0x54d46c===_0x54dc('0xa0')||_0x54d46c===_0x54dc('0xa1')||_0x54d46c===_0x54dc('0xa2')){_0x31949a[_0x54dc('0x9a')](getInputList(_0x5aab6b,_0xdddeed,_0x54d46c,_0x4f19cb,_0x24c407[_0x54dc('0x92')],_0x1cef6f['MetadataId'],_0x199f27));}}});return Promise['all'](_0x31949a);})[_0x54dc('0x2b')](function(_0x312794){_0x303907=_0x312794[0x0];var _0x4538bb=_0x1f97dc[_0x54dc('0x81')](_0x301fcb)[_0x54dc('0x81')](_0x303907);var _0x530b36={'count':_0x4538bb[_0x54dc('0x24')],'rows':_0x4538bb};return _0x530b36;})['then'](respondWithResult(_0x5d4c15,null))[_0x54dc('0x30')](function(_0x338749){var _0x55c4ea=_0x4e3859[_0x54dc('0x1e')]['test']?0x1f4:_0x338749['statusCode']||0x1f4;logger[_0x54dc('0x13')](_0x338749[_0x54dc('0x14')]);delete _0x338749['name'];if(_0x55c4ea===0x191){_0x55c4ea=0x190;}_0x5d4c15[_0x54dc('0x7')](_0x55c4ea)['send'](_0x4e3859['query']['test']?{'message':_0x54dc('0xa3'),'statusCode':_0x338749['statusCode']}:_0x338749);});};function getSelectList(_0x2b5c48,_0x3547cd,_0x570cb5,_0x442f69,_0x2b1ef0,_0x27aaab){var _0x5bb27f={'method':_0x54dc('0x93'),'uri':_0x2b5c48+_0x54dc('0x94')+_0x442f69+_0x54dc('0xa4')+_0x2b1ef0+_0x54dc('0xa5')+_0x54dc('0xa6'),'headers':{'Authorization':'Bearer\x20'+_0x27aaab,'If-None-Match':null,'OData-Version':_0x54dc('0x90')},'json':!![]};return rp(_0x5bb27f)['then'](function(_0x5e7341){var _0x1876a2=[];var _0x2d036b=_0x5e7341[_0x54dc('0xa7')][_0x54dc('0xa8')];_0x2d036b[_0x54dc('0x97')](function(_0x20e706){_0x1876a2['push']({'name':_0x20e706[_0x54dc('0xa9')][_0x54dc('0xaa')]['Label'],'value':String(_0x20e706['Value'])});});var _0x5618a1={'id':_0x3547cd+'_'+_0x5e7341[_0x54dc('0x96')],'name':_0x5e7341[_0x54dc('0xab')][_0x54dc('0xaa')][_0x54dc('0xa9')],'custom':![],'options':_0x1876a2};_0x570cb5[_0x54dc('0x9a')](_0x5618a1);return _0x570cb5;});}function getBooleanList(_0x4717cc,_0xedbec3,_0x6989dd,_0x209f22,_0x4af803,_0x280c4e){var _0x28a10a={'method':'GET','uri':_0x4717cc+_0x54dc('0x94')+_0x209f22+_0x54dc('0xa4')+_0x4af803+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x280c4e,'If-None-Match':null,'OData-Version':_0x54dc('0x90')},'json':!![]};return rp(_0x28a10a)['then'](function(_0x466d5b){var _0x37e7e2=[];_0x37e7e2[_0x54dc('0x9a')]({'name':_0x466d5b[_0x54dc('0xa7')]['TrueOption']['Label'][_0x54dc('0xaa')]['Label'],'value':_0x54dc('0xac')},{'name':_0x466d5b[_0x54dc('0xa7')][_0x54dc('0xad')][_0x54dc('0xa9')]['UserLocalizedLabel'][_0x54dc('0xa9')],'value':_0x54dc('0xae')});var _0x320f90={'id':_0xedbec3+'_'+_0x466d5b[_0x54dc('0x96')],'name':_0x466d5b[_0x54dc('0xab')][_0x54dc('0xaa')]['Label'],'custom':![],'options':_0x37e7e2};_0x6989dd[_0x54dc('0x9a')](_0x320f90);return _0x6989dd;});}function getInputList(_0x84e59b,_0x23943,_0x17421c,_0x516cba,_0x5b1297,_0x35e196,_0x5a2385){var _0x10d2e4={'method':_0x54dc('0x93'),'uri':_0x84e59b+'EntityDefinitions('+_0x5b1297+_0x54dc('0xa4')+_0x35e196+_0x54dc('0xaf')+_0x17421c+_0x54dc('0xb0'),'headers':{'Authorization':_0x54dc('0x8f')+_0x5a2385,'If-None-Match':null,'OData-Version':_0x54dc('0x90')},'json':!![]};return rp(_0x10d2e4)[_0x54dc('0x2b')](function(_0x10a33b){var _0x1d8756={'id':_0x23943+'_'+_0x10a33b[_0x54dc('0x96')],'name':_0x10a33b[_0x54dc('0xab')][_0x54dc('0xaa')]?_0x10a33b['DisplayName']['UserLocalizedLabel']['Label']:_0x10a33b['LogicalName'],'custom':![],'options':[]};_0x516cba[_0x54dc('0x9a')](_0x1d8756);return _0x516cba;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index a0e9838..390da74 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x3e47df,_0x1f0d0b){var _0x35a9e1=function(_0x2f3df4){while(--_0x2f3df4){_0x3e47df['push'](_0x3e47df['shift']());}};_0x35a9e1(++_0x1f0d0b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xcb91[_0x3e6d5d];return _0x238923;};'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'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index f4c76a9..8d6a440 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 _0x343e=['model','GetDynamics365Account','debug','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x22c4c2,_0xec17af){var _0x222727=function(_0x44e9a2){while(--_0x44e9a2){_0x22c4c2['push'](_0x22c4c2['shift']());}};_0x222727(++_0xec17af);}(_0x343e,0x10e));var _0xe343=function(_0x1e3ea2,_0x255017){_0x1e3ea2=_0x1e3ea2-0x0;var _0x55046e=_0x343e[_0x1e3ea2];return _0x55046e;};'use strict';var _=require('lodash');var util=require(_0xe343('0x0'));var moment=require(_0xe343('0x1'));var BPromise=require(_0xe343('0x2'));var rs=require(_0xe343('0x3'));var fs=require('fs');var Redis=require(_0xe343('0x4'));var db=require(_0xe343('0x5'))['db'];var utils=require(_0xe343('0x6'));var logger=require(_0xe343('0x7'))(_0xe343('0x8'));var config=require(_0xe343('0x9'));var jayson=require(_0xe343('0xa'));var client=jayson[_0xe343('0xb')][_0xe343('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c8088,_0xe096aa,_0x54b4d7){return new BPromise(function(_0x875e9,_0x10bc8a){return client[_0xe343('0xd')](_0x1c8088,_0x54b4d7)[_0xe343('0xe')](function(_0x5ee2b7){logger[_0xe343('0xf')](_0xe343('0x10'),_0xe096aa,_0xe343('0x11'));logger['debug'](_0xe343('0x12'),_0xe096aa,'request\x20sent',JSON[_0xe343('0x13')](_0x5ee2b7));if(_0x5ee2b7[_0xe343('0x14')]){if(_0x5ee2b7['error'][_0xe343('0x15')]===0x1f4){logger[_0xe343('0x14')](_0xe343('0x10'),_0xe096aa,_0x5ee2b7[_0xe343('0x14')][_0xe343('0x16')]);return _0x10bc8a(_0x5ee2b7[_0xe343('0x14')][_0xe343('0x16')]);}logger[_0xe343('0x14')](_0xe343('0x10'),_0xe096aa,_0x5ee2b7[_0xe343('0x14')][_0xe343('0x16')]);return _0x875e9(_0x5ee2b7[_0xe343('0x14')][_0xe343('0x16')]);}else{logger['info'](_0xe343('0x10'),_0xe096aa,_0xe343('0x11'));_0x875e9(_0x5ee2b7[_0xe343('0x17')][_0xe343('0x16')]);}})[_0xe343('0x18')](function(_0x1dc187){logger[_0xe343('0x14')](_0xe343('0x10'),_0xe096aa,_0x1dc187);_0x10bc8a(_0x1dc187);});});}exports['GetDynamics365Account']=function(_0x12c263){var _0x37713f=this;return new Promise(function(_0x485241,_0x320c43){return db[_0xe343('0x19')][_0xe343('0x1a')]({'raw':_0x12c263[_0xe343('0x1b')]?_0x12c263['options'][_0xe343('0x1c')]===undefined?!![]:![]:!![],'where':_0x12c263[_0xe343('0x1b')]?_0x12c263['options'][_0xe343('0x1d')]||null:null,'attributes':_0x12c263[_0xe343('0x1b')]?_0x12c263['options'][_0xe343('0x1e')]||null:null,'limit':_0x12c263[_0xe343('0x1b')]?_0x12c263[_0xe343('0x1b')][_0xe343('0x1f')]||null:null,'include':_0x12c263[_0xe343('0x1b')]?_0x12c263[_0xe343('0x1b')][_0xe343('0x20')]?_[_0xe343('0x21')](_0x12c263[_0xe343('0x1b')][_0xe343('0x20')],function(_0x49b923){return{'model':db[_0x49b923[_0xe343('0x22')]],'as':_0x49b923['as'],'attributes':_0x49b923['attributes'],'include':_0x49b923[_0xe343('0x20')]?_[_0xe343('0x21')](_0x49b923[_0xe343('0x20')],function(_0x20593c){return{'model':db[_0x20593c['model']],'as':_0x20593c['as'],'attributes':_0x20593c['attributes'],'include':_0x20593c['include']?_['map'](_0x20593c[_0xe343('0x20')],function(_0x464cb6){return{'model':db[_0x464cb6[_0xe343('0x22')]],'as':_0x464cb6['as'],'attributes':_0x464cb6[_0xe343('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe343('0xe')](function(_0x22ef92){logger[_0xe343('0xf')](_0xe343('0x23'),_0x12c263);logger[_0xe343('0x24')](_0xe343('0x23'),_0x12c263,JSON[_0xe343('0x13')](_0x22ef92));_0x485241(_0x22ef92);})[_0xe343('0x18')](function(_0x53a5e4){logger['error'](_0xe343('0x23'),_0x53a5e4[_0xe343('0x16')],_0x12c263);_0x320c43(_0x37713f[_0xe343('0x14')](0x1f4,_0x53a5e4['message']));});});};exports[_0xe343('0x25')]=function(_0x516a6c){var _0x5e57e1=this;return new Promise(function(_0x32231f,_0xd37216){return db[_0xe343('0x19')]['find']({'raw':_0x516a6c[_0xe343('0x1b')]?_0x516a6c[_0xe343('0x1b')][_0xe343('0x1c')]===undefined?!![]:![]:!![],'where':_0x516a6c['options']?_0x516a6c[_0xe343('0x1b')][_0xe343('0x1d')]||null:null,'attributes':_0x516a6c[_0xe343('0x1b')]?_0x516a6c['options'][_0xe343('0x1e')]||null:null,'include':_0x516a6c[_0xe343('0x1b')]?_0x516a6c[_0xe343('0x1b')][_0xe343('0x20')]?_['map'](_0x516a6c[_0xe343('0x1b')][_0xe343('0x20')],function(_0x18f23b){return{'model':db[_0x18f23b[_0xe343('0x22')]],'as':_0x18f23b['as'],'attributes':_0x18f23b[_0xe343('0x1e')],'include':_0x18f23b[_0xe343('0x20')]?_[_0xe343('0x21')](_0x18f23b[_0xe343('0x20')],function(_0x38ce89){return{'model':db[_0x38ce89[_0xe343('0x22')]],'as':_0x38ce89['as'],'attributes':_0x38ce89['attributes'],'include':_0x38ce89[_0xe343('0x20')]?_[_0xe343('0x21')](_0x38ce89[_0xe343('0x20')],function(_0x4a03b5){return{'model':db[_0x4a03b5['model']],'as':_0x4a03b5['as'],'attributes':_0x4a03b5[_0xe343('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe343('0xe')](function(_0x17861d){logger['info']('ShowDynamics365Account',_0x516a6c);logger[_0xe343('0x24')](_0xe343('0x25'),_0x516a6c,JSON['stringify'](_0x17861d));_0x32231f(_0x17861d);})[_0xe343('0x18')](function(_0x21e5ad){logger[_0xe343('0x14')](_0xe343('0x25'),_0x21e5ad['message'],_0x516a6c);_0xd37216(_0x5e57e1[_0xe343('0x14')](0x1f4,_0x21e5ad[_0xe343('0x16')]));});});}; \ No newline at end of file +var _0x4bf1=['../../config/logger','rpc','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowDynamics365Account','find','moment','bluebird','../../mysqldb'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x4bf1,0x19d));var _0x14bf=function(_0xe1384c,_0x4e4a81){_0xe1384c=_0xe1384c-0x0;var _0x31fc85=_0x4bf1[_0xe1384c];return _0x31fc85;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14bf('0x0'));var BPromise=require(_0x14bf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14bf('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x14bf('0x3'))(_0x14bf('0x4'));var config=require(_0x14bf('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x14bf('0x6')][_0x14bf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xafa455,_0x371c73,_0xe5b84f){return new BPromise(function(_0x4c0f96,_0x3495d4){return client['request'](_0xafa455,_0xe5b84f)[_0x14bf('0x8')](function(_0x4f584a){logger[_0x14bf('0x9')](_0x14bf('0xa'),_0x371c73,'request\x20sent');logger['debug'](_0x14bf('0xb'),_0x371c73,_0x14bf('0xc'),JSON[_0x14bf('0xd')](_0x4f584a));if(_0x4f584a[_0x14bf('0xe')]){if(_0x4f584a[_0x14bf('0xe')][_0x14bf('0xf')]===0x1f4){logger['error'](_0x14bf('0xa'),_0x371c73,_0x4f584a[_0x14bf('0xe')][_0x14bf('0x10')]);return _0x3495d4(_0x4f584a[_0x14bf('0xe')][_0x14bf('0x10')]);}logger[_0x14bf('0xe')](_0x14bf('0xa'),_0x371c73,_0x4f584a[_0x14bf('0xe')][_0x14bf('0x10')]);return _0x4c0f96(_0x4f584a[_0x14bf('0xe')][_0x14bf('0x10')]);}else{logger[_0x14bf('0x9')](_0x14bf('0xa'),_0x371c73,_0x14bf('0xc'));_0x4c0f96(_0x4f584a[_0x14bf('0x11')]['message']);}})[_0x14bf('0x12')](function(_0x45163c){logger[_0x14bf('0xe')](_0x14bf('0xa'),_0x371c73,_0x45163c);_0x3495d4(_0x45163c);});});}exports[_0x14bf('0x13')]=function(_0x593747){var _0x319108=this;return new Promise(function(_0x32c2c7,_0x7f75a5){return db['Dynamics365Account'][_0x14bf('0x14')]({'raw':_0x593747['options']?_0x593747[_0x14bf('0x15')][_0x14bf('0x16')]===undefined?!![]:![]:!![],'where':_0x593747['options']?_0x593747[_0x14bf('0x15')][_0x14bf('0x17')]||null:null,'attributes':_0x593747[_0x14bf('0x15')]?_0x593747[_0x14bf('0x15')]['attributes']||null:null,'limit':_0x593747[_0x14bf('0x15')]?_0x593747['options'][_0x14bf('0x18')]||null:null,'include':_0x593747[_0x14bf('0x15')]?_0x593747[_0x14bf('0x15')][_0x14bf('0x19')]?_[_0x14bf('0x1a')](_0x593747[_0x14bf('0x15')][_0x14bf('0x19')],function(_0x7d41bf){return{'model':db[_0x7d41bf[_0x14bf('0x1b')]],'as':_0x7d41bf['as'],'attributes':_0x7d41bf[_0x14bf('0x1c')],'include':_0x7d41bf['include']?_[_0x14bf('0x1a')](_0x7d41bf['include'],function(_0x14f850){return{'model':db[_0x14f850[_0x14bf('0x1b')]],'as':_0x14f850['as'],'attributes':_0x14f850[_0x14bf('0x1c')],'include':_0x14f850[_0x14bf('0x19')]?_['map'](_0x14f850['include'],function(_0x13dffc){return{'model':db[_0x13dffc[_0x14bf('0x1b')]],'as':_0x13dffc['as'],'attributes':_0x13dffc[_0x14bf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x14bf('0x8')](function(_0x2d5fa3){logger[_0x14bf('0x9')](_0x14bf('0x13'),_0x593747);logger[_0x14bf('0x1d')](_0x14bf('0x13'),_0x593747,JSON['stringify'](_0x2d5fa3));_0x32c2c7(_0x2d5fa3);})[_0x14bf('0x12')](function(_0x4728e7){logger['error'](_0x14bf('0x13'),_0x4728e7[_0x14bf('0x10')],_0x593747);_0x7f75a5(_0x319108[_0x14bf('0xe')](0x1f4,_0x4728e7[_0x14bf('0x10')]));});});};exports[_0x14bf('0x1e')]=function(_0x5e5772){var _0x2253b3=this;return new Promise(function(_0x1c9dc1,_0x3c87d3){return db['Dynamics365Account'][_0x14bf('0x1f')]({'raw':_0x5e5772[_0x14bf('0x15')]?_0x5e5772[_0x14bf('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5e5772[_0x14bf('0x15')]?_0x5e5772[_0x14bf('0x15')]['where']||null:null,'attributes':_0x5e5772['options']?_0x5e5772[_0x14bf('0x15')][_0x14bf('0x1c')]||null:null,'include':_0x5e5772[_0x14bf('0x15')]?_0x5e5772[_0x14bf('0x15')]['include']?_['map'](_0x5e5772[_0x14bf('0x15')][_0x14bf('0x19')],function(_0x1aeb3c){return{'model':db[_0x1aeb3c[_0x14bf('0x1b')]],'as':_0x1aeb3c['as'],'attributes':_0x1aeb3c['attributes'],'include':_0x1aeb3c[_0x14bf('0x19')]?_[_0x14bf('0x1a')](_0x1aeb3c[_0x14bf('0x19')],function(_0x312195){return{'model':db[_0x312195[_0x14bf('0x1b')]],'as':_0x312195['as'],'attributes':_0x312195[_0x14bf('0x1c')],'include':_0x312195['include']?_[_0x14bf('0x1a')](_0x312195['include'],function(_0x4101c4){return{'model':db[_0x4101c4[_0x14bf('0x1b')]],'as':_0x4101c4['as'],'attributes':_0x4101c4['attributes']};}):[]};}):[]};}):[]:[]})[_0x14bf('0x8')](function(_0x180d0c){logger[_0x14bf('0x9')](_0x14bf('0x1e'),_0x5e5772);logger[_0x14bf('0x1d')]('ShowDynamics365Account',_0x5e5772,JSON[_0x14bf('0xd')](_0x180d0c));_0x1c9dc1(_0x180d0c);})[_0x14bf('0x12')](function(_0x1db904){logger[_0x14bf('0xe')](_0x14bf('0x1e'),_0x1db904[_0x14bf('0x10')],_0x5e5772);_0x3c87d3(_0x2253b3[_0x14bf('0xe')](0x1f4,_0x1db904[_0x14bf('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 86da5dd..71d3c71 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 _0x3c5f=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x8d5fe5,_0x31e122){var _0x2d2549=function(_0x389a05){while(--_0x389a05){_0x8d5fe5['push'](_0x8d5fe5['shift']());}};_0x2d2549(++_0x31e122);}(_0x3c5f,0x149));var _0xf3c5=function(_0x7ccca5,_0xd0cc6e){_0x7ccca5=_0x7ccca5-0x0;var _0x13da42=_0x3c5f[_0x7ccca5];return _0x13da42;};'use strict';var multer=require('multer');var util=require(_0xf3c5('0x0'));var path=require(_0xf3c5('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3c5('0x2'));var router=express[_0xf3c5('0x3')]();var fs_extra=require(_0xf3c5('0x4'));var auth=require(_0xf3c5('0x5'));var interaction=require(_0xf3c5('0x6'));var config=require(_0xf3c5('0x7'));var controller=require(_0xf3c5('0x8'));router[_0xf3c5('0x9')]('/',auth[_0xf3c5('0xa')](),controller[_0xf3c5('0xb')]);router[_0xf3c5('0x9')](_0xf3c5('0xc'),auth[_0xf3c5('0xa')](),controller['show']);router['get'](_0xf3c5('0xd'),auth[_0xf3c5('0xa')](),controller[_0xf3c5('0xe')]);router[_0xf3c5('0x9')](_0xf3c5('0xf'),auth['isAuthenticated'](),controller[_0xf3c5('0x10')]);router[_0xf3c5('0x9')](_0xf3c5('0x11'),auth[_0xf3c5('0xa')](),controller[_0xf3c5('0x12')]);router[_0xf3c5('0x13')]('/',auth[_0xf3c5('0xa')](),controller['create']);router[_0xf3c5('0x14')](_0xf3c5('0xc'),auth[_0xf3c5('0xa')](),controller[_0xf3c5('0x15')]);router[_0xf3c5('0x16')](_0xf3c5('0xc'),auth[_0xf3c5('0xa')](),controller[_0xf3c5('0x17')]);module[_0xf3c5('0x18')]=router; \ No newline at end of file +var _0xf55c=['getDescriptions','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x31e9f3,_0x3d33d8){var _0x551334=function(_0x4d72f0){while(--_0x4d72f0){_0x31e9f3['push'](_0x31e9f3['shift']());}};_0x551334(++_0x3d33d8);}(_0xf55c,0x1e7));var _0xcf55=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xf55c[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xcf55('0x0'));var util=require('util');var path=require(_0xcf55('0x1'));var timeout=require(_0xcf55('0x2'));var express=require(_0xcf55('0x3'));var router=express[_0xcf55('0x4')]();var fs_extra=require(_0xcf55('0x5'));var auth=require(_0xcf55('0x6'));var interaction=require(_0xcf55('0x7'));var config=require('../../config/environment');var controller=require(_0xcf55('0x8'));router[_0xcf55('0x9')]('/',auth[_0xcf55('0xa')](),controller[_0xcf55('0xb')]);router['get'](_0xcf55('0xc'),auth[_0xcf55('0xa')](),controller[_0xcf55('0xd')]);router[_0xcf55('0x9')]('/:id/fields',auth[_0xcf55('0xa')](),controller[_0xcf55('0xe')]);router[_0xcf55('0x9')](_0xcf55('0xf'),auth[_0xcf55('0xa')](),controller[_0xcf55('0x10')]);router[_0xcf55('0x9')]('/:id/descriptions',auth[_0xcf55('0xa')](),controller[_0xcf55('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcf55('0x12')]);router[_0xcf55('0x13')](_0xcf55('0xc'),auth[_0xcf55('0xa')](),controller[_0xcf55('0x14')]);router[_0xcf55('0x15')](_0xcf55('0xc'),auth[_0xcf55('0xa')](),controller[_0xcf55('0x16')]);module[_0xcf55('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ad4127b..b72827c 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 _0x7368=['incident','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','phonecall'];(function(_0x2f9f2d,_0x80066f){var _0x253445=function(_0x5c6402){while(--_0x5c6402){_0x2f9f2d['push'](_0x2f9f2d['shift']());}};_0x253445(++_0x80066f);}(_0x7368,0x1b4));var _0x8736=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7368[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x8736('0x0'));module[_0x8736('0x1')]={'name':{'type':Sequelize[_0x8736('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8736('0x3')]('incident',_0x8736('0x4')),'defaultValue':_0x8736('0x5')},'moduleCreate':{'type':Sequelize[_0x8736('0x3')](_0x8736('0x6'),_0x8736('0x7')),'defaultValue':_0x8736('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x8736('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa991=['contact','nothing','BOOLEAN','exports','STRING','ENUM','incident'];(function(_0x352e78,_0x25945c){var _0x183d3e=function(_0xfd9fb7){while(--_0xfd9fb7){_0x352e78['push'](_0x352e78['shift']());}};_0x183d3e(++_0x25945c);}(_0xa991,0x1a7));var _0x1a99=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xa991[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require('sequelize');module[_0x1a99('0x0')]={'name':{'type':Sequelize[_0x1a99('0x1')]},'description':{'type':Sequelize[_0x1a99('0x1')]},'ticketType':{'type':Sequelize[_0x1a99('0x2')](_0x1a99('0x3'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x1a99('0x4'),_0x1a99('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1a99('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1a99('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index c0ffdbb..b7e51e8 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 _0x3ac8=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','Dynamics365Field','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x18e819,_0x514eca){var _0x195b82=function(_0x4b043a){while(--_0x4b043a){_0x18e819['push'](_0x18e819['shift']());}};_0x195b82(++_0x514eca);}(_0x3ac8,0xd2));var _0x83ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x83ac('0x0'));var rimraf=require(_0x83ac('0x1'));var zipdir=require(_0x83ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83ac('0x4'));var util=require(_0x83ac('0x5'));var path=require(_0x83ac('0x6'));var sox=require(_0x83ac('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83ac('0x8'));var _=require(_0x83ac('0x9'));var squel=require(_0x83ac('0xa'));var crypto=require(_0x83ac('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x83ac('0xc'));var Papa=require(_0x83ac('0xd'));var Redis=require(_0x83ac('0xe'));var authService=require(_0x83ac('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x83ac('0x10'));var hardwareService=require(_0x83ac('0x11'));var logger=require('../../config/logger')(_0x83ac('0x12'));var utils=require(_0x83ac('0x13'));var config=require(_0x83ac('0x14'));var licenseUtil=require(_0x83ac('0x15'));var db=require(_0x83ac('0x16'))['db'];function respondWithStatusCode(_0x55117d,_0x58d9a9){_0x58d9a9=_0x58d9a9||0xcc;return function(_0x219cca){if(_0x219cca){return _0x55117d['sendStatus'](_0x58d9a9);}return _0x55117d[_0x83ac('0x17')](_0x58d9a9)[_0x83ac('0x18')]();};}function respondWithResult(_0x35af9f,_0x523717){_0x523717=_0x523717||0xc8;return function(_0x348bf3){if(_0x348bf3){return _0x35af9f['status'](_0x523717)[_0x83ac('0x19')](_0x348bf3);}};}function respondWithFilteredResult(_0x81f7ab,_0x3256b1){return function(_0x580b86){if(_0x580b86){var _0x142df4=typeof _0x3256b1[_0x83ac('0x1a')]===_0x83ac('0x1b')&&typeof _0x3256b1[_0x83ac('0x1c')]==='undefined';var _0x3368b1=_0x580b86[_0x83ac('0x1d')];var _0x105850=_0x142df4?0x0:_0x3256b1[_0x83ac('0x1a')];var _0xeb1647=_0x142df4?_0x580b86[_0x83ac('0x1d')]:_0x3256b1['offset']+_0x3256b1['limit'];var _0x8d6973;if(_0xeb1647>=_0x3368b1){_0xeb1647=_0x3368b1;_0x8d6973=0xc8;}else{_0x8d6973=0xce;}_0x81f7ab[_0x83ac('0x17')](_0x8d6973);return _0x81f7ab[_0x83ac('0x1e')](_0x83ac('0x1f'),_0x105850+'-'+_0xeb1647+'/'+_0x3368b1)['json'](_0x580b86);}return null;};}function patchUpdates(_0x5ed002){return function(_0x5714ba){try{jsonpatch[_0x83ac('0x20')](_0x5714ba,_0x5ed002,!![]);}catch(_0x197e69){return BPromise[_0x83ac('0x21')](_0x197e69);}return _0x5714ba[_0x83ac('0x22')]();};}function saveUpdates(_0x530430,_0x176dd8){return function(_0x584214){if(_0x584214){return _0x584214[_0x83ac('0x23')](_0x530430)[_0x83ac('0x24')](function(_0x3da5b2){return _0x3da5b2;});}return null;};}function removeEntity(_0x3be904,_0x3e0b7c){return function(_0x1e8929){if(_0x1e8929){return _0x1e8929['destroy']()[_0x83ac('0x24')](function(){_0x3be904[_0x83ac('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x112644,_0x4843f2){return function(_0x26ae50){if(!_0x26ae50){_0x112644[_0x83ac('0x25')](0x194);}return _0x26ae50;};}function handleError(_0x4b4c34,_0x294dde){_0x294dde=_0x294dde||0x1f4;return function(_0x15ce4c){logger['error'](_0x15ce4c['stack']);if(_0x15ce4c['name']){delete _0x15ce4c[_0x83ac('0x26')];}_0x4b4c34[_0x83ac('0x17')](_0x294dde)[_0x83ac('0x27')](_0x15ce4c);};}exports['index']=function(_0x474df5,_0x20fb99){var _0x30f285={},_0x284efc={},_0x3e5c54={'count':0x0,'rows':[]};var _0x15b6fa=_['map'](db[_0x83ac('0x28')][_0x83ac('0x29')],function(_0x4879df){return{'name':_0x4879df[_0x83ac('0x2a')],'type':_0x4879df[_0x83ac('0x2b')][_0x83ac('0x2c')]};});_0x284efc[_0x83ac('0x2d')]=_[_0x83ac('0x2e')](_0x15b6fa,'name');_0x284efc['query']=_[_0x83ac('0x2f')](_0x474df5[_0x83ac('0x30')]);_0x284efc[_0x83ac('0x31')]=_[_0x83ac('0x32')](_0x284efc[_0x83ac('0x2d')],_0x284efc[_0x83ac('0x30')]);_0x30f285['attributes']=_['intersection'](_0x284efc[_0x83ac('0x2d')],qs[_0x83ac('0x33')](_0x474df5[_0x83ac('0x30')][_0x83ac('0x33')]));_0x30f285['attributes']=_0x30f285[_0x83ac('0x34')][_0x83ac('0x35')]?_0x30f285[_0x83ac('0x34')]:_0x284efc[_0x83ac('0x2d')];if(!_0x474df5[_0x83ac('0x30')][_0x83ac('0x36')]('nolimit')){_0x30f285['limit']=qs[_0x83ac('0x1c')](_0x474df5[_0x83ac('0x30')][_0x83ac('0x1c')]);_0x30f285['offset']=qs[_0x83ac('0x1a')](_0x474df5[_0x83ac('0x30')][_0x83ac('0x1a')]);}_0x30f285[_0x83ac('0x37')]=qs[_0x83ac('0x38')](_0x474df5[_0x83ac('0x30')]['sort']);_0x30f285[_0x83ac('0x39')]=qs[_0x83ac('0x31')](_['pick'](_0x474df5['query'],_0x284efc[_0x83ac('0x31')]),_0x15b6fa);if(_0x474df5[_0x83ac('0x30')][_0x83ac('0x3a')]){_0x30f285[_0x83ac('0x39')]=_[_0x83ac('0x3b')](_0x30f285['where'],{'$or':_['map'](_0x15b6fa,function(_0x2464ac){if(_0x2464ac[_0x83ac('0x2b')]!=='VIRTUAL'){var _0x3dd777={};_0x3dd777[_0x2464ac['name']]={'$like':'%'+_0x474df5[_0x83ac('0x30')]['filter']+'%'};return _0x3dd777;}})});}_0x30f285=_[_0x83ac('0x3b')]({},_0x30f285,_0x474df5['options']);var _0xe64149={'where':_0x30f285['where']};return db[_0x83ac('0x28')][_0x83ac('0x1d')](_0xe64149)[_0x83ac('0x24')](function(_0x47cf60){_0x3e5c54[_0x83ac('0x1d')]=_0x47cf60;if(_0x474df5[_0x83ac('0x30')][_0x83ac('0x3c')]){_0x30f285[_0x83ac('0x3d')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x83ac('0x3e')](_0x30f285);})['then'](function(_0x422f10){_0x3e5c54[_0x83ac('0x3f')]=_0x422f10;return _0x3e5c54;})[_0x83ac('0x24')](respondWithFilteredResult(_0x20fb99,_0x30f285))[_0x83ac('0x40')](handleError(_0x20fb99,null));};exports[_0x83ac('0x41')]=function(_0x3e1b94,_0x4b3435){var _0x3994c5={'raw':![],'where':{'id':_0x3e1b94[_0x83ac('0x42')]['id']}},_0x293426={};_0x293426[_0x83ac('0x2d')]=_[_0x83ac('0x2f')](db[_0x83ac('0x28')][_0x83ac('0x29')]);_0x293426['query']=_[_0x83ac('0x2f')](_0x3e1b94[_0x83ac('0x30')]);_0x293426[_0x83ac('0x31')]=_['intersection'](_0x293426[_0x83ac('0x2d')],_0x293426[_0x83ac('0x30')]);_0x3994c5[_0x83ac('0x34')]=_[_0x83ac('0x32')](_0x293426['model'],qs[_0x83ac('0x33')](_0x3e1b94[_0x83ac('0x30')][_0x83ac('0x33')]));_0x3994c5[_0x83ac('0x34')]=_0x3994c5[_0x83ac('0x34')]['length']?_0x3994c5[_0x83ac('0x34')]:_0x293426[_0x83ac('0x2d')];if(_0x3e1b94[_0x83ac('0x30')][_0x83ac('0x3c')]){_0x3994c5[_0x83ac('0x3d')]=[{'all':!![]}];}_0x3994c5=_[_0x83ac('0x3b')]({},_0x3994c5,_0x3e1b94[_0x83ac('0x43')]);return db['Dynamics365Configuration'][_0x83ac('0x44')](_0x3994c5)[_0x83ac('0x24')](handleEntityNotFound(_0x4b3435,null))[_0x83ac('0x24')](respondWithResult(_0x4b3435,null))['catch'](handleError(_0x4b3435,null));};exports[_0x83ac('0x45')]=function(_0x273654,_0x1f82c3){return db[_0x83ac('0x28')][_0x83ac('0x45')](_0x273654[_0x83ac('0x46')],{})[_0x83ac('0x24')](respondWithResult(_0x1f82c3,0xc9))['catch'](handleError(_0x1f82c3,null));};exports['update']=function(_0x181f14,_0x5a0368){if(_0x181f14[_0x83ac('0x46')]['id']){delete _0x181f14[_0x83ac('0x46')]['id'];}return db[_0x83ac('0x28')][_0x83ac('0x44')]({'where':{'id':_0x181f14[_0x83ac('0x42')]['id']}})[_0x83ac('0x24')](handleEntityNotFound(_0x5a0368,null))[_0x83ac('0x24')](saveUpdates(_0x181f14[_0x83ac('0x46')],null))[_0x83ac('0x24')](respondWithResult(_0x5a0368,null))[_0x83ac('0x40')](handleError(_0x5a0368,null));};exports['destroy']=function(_0x5ef6ac,_0x172e70){return db[_0x83ac('0x28')][_0x83ac('0x44')]({'where':{'id':_0x5ef6ac[_0x83ac('0x42')]['id']}})['then'](handleEntityNotFound(_0x172e70,null))[_0x83ac('0x24')](removeEntity(_0x172e70,null))['catch'](handleError(_0x172e70,null));};exports[_0x83ac('0x47')]=function(_0x32cb96,_0x5b5709,_0x2ace7e){var _0x598795={};var _0x14e6f1={};var _0x168ed6;var _0x4f0d29;return db['Dynamics365Configuration'][_0x83ac('0x48')]({'where':{'id':_0x32cb96[_0x83ac('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b5709,null))[_0x83ac('0x24')](function(_0x94a942){if(_0x94a942){_0x168ed6=_0x94a942;_0x14e6f1[_0x83ac('0x2d')]=_[_0x83ac('0x2f')](db[_0x83ac('0x49')][_0x83ac('0x29')]);_0x14e6f1['query']=_[_0x83ac('0x2f')](_0x32cb96[_0x83ac('0x30')]);_0x14e6f1[_0x83ac('0x31')]=_[_0x83ac('0x32')](_0x14e6f1[_0x83ac('0x2d')],_0x14e6f1[_0x83ac('0x30')]);_0x598795[_0x83ac('0x34')]=_['intersection'](_0x14e6f1[_0x83ac('0x2d')],qs['fields'](_0x32cb96[_0x83ac('0x30')]['fields']));_0x598795[_0x83ac('0x34')]=_0x598795[_0x83ac('0x34')][_0x83ac('0x35')]?_0x598795[_0x83ac('0x34')]:_0x14e6f1[_0x83ac('0x2d')];_0x598795[_0x83ac('0x37')]=qs['sort'](_0x32cb96[_0x83ac('0x30')][_0x83ac('0x38')]);_0x598795['where']=qs[_0x83ac('0x31')](_[_0x83ac('0x4a')](_0x32cb96[_0x83ac('0x30')],_0x14e6f1[_0x83ac('0x31')]));if(_0x32cb96[_0x83ac('0x30')][_0x83ac('0x3a')]){_0x598795[_0x83ac('0x39')]=_['merge'](_0x598795['where'],{'$or':_[_0x83ac('0x2e')](_0x598795[_0x83ac('0x34')],function(_0x15fc7a){var _0x368538={};_0x368538[_0x15fc7a]={'$like':'%'+_0x32cb96[_0x83ac('0x30')][_0x83ac('0x3a')]+'%'};return _0x368538;})});}_0x598795=_[_0x83ac('0x3b')]({},_0x598795,_0x32cb96[_0x83ac('0x43')]);return _0x168ed6[_0x83ac('0x47')](_0x598795);}})[_0x83ac('0x24')](function(_0x5d0bcb){if(_0x5d0bcb){_0x4f0d29=_0x5d0bcb[_0x83ac('0x35')];if(!_0x32cb96['query']['hasOwnProperty'](_0x83ac('0x4b'))){_0x598795[_0x83ac('0x1c')]=qs['limit'](_0x32cb96[_0x83ac('0x30')][_0x83ac('0x1c')]);_0x598795[_0x83ac('0x1a')]=qs[_0x83ac('0x1a')](_0x32cb96[_0x83ac('0x30')]['offset']);}return _0x168ed6[_0x83ac('0x47')](_0x598795);}})[_0x83ac('0x24')](function(_0x15deec){if(_0x15deec){return _0x15deec?{'count':_0x4f0d29,'rows':_0x15deec}:null;}})[_0x83ac('0x24')](respondWithResult(_0x5b5709,null))[_0x83ac('0x40')](handleError(_0x5b5709,null));};exports[_0x83ac('0x4c')]=function(_0x3e7269,_0x5a57b2,_0x52ecf7){var _0x145823={};var _0x3e530c={};var _0x5e0b07;var _0x3ac2cf;return db[_0x83ac('0x28')][_0x83ac('0x48')]({'where':{'id':_0x3e7269[_0x83ac('0x42')]['id']}})[_0x83ac('0x24')](handleEntityNotFound(_0x5a57b2,null))['then'](function(_0x2eb92c){if(_0x2eb92c){_0x5e0b07=_0x2eb92c;_0x3e530c[_0x83ac('0x2d')]=_['keys'](db[_0x83ac('0x49')]['rawAttributes']);_0x3e530c[_0x83ac('0x30')]=_[_0x83ac('0x2f')](_0x3e7269['query']);_0x3e530c[_0x83ac('0x31')]=_[_0x83ac('0x32')](_0x3e530c[_0x83ac('0x2d')],_0x3e530c['query']);_0x145823[_0x83ac('0x34')]=_[_0x83ac('0x32')](_0x3e530c[_0x83ac('0x2d')],qs['fields'](_0x3e7269[_0x83ac('0x30')]['fields']));_0x145823[_0x83ac('0x34')]=_0x145823[_0x83ac('0x34')]['length']?_0x145823[_0x83ac('0x34')]:_0x3e530c[_0x83ac('0x2d')];_0x145823[_0x83ac('0x37')]=qs['sort'](_0x3e7269['query'][_0x83ac('0x38')]);_0x145823['where']=qs[_0x83ac('0x31')](_[_0x83ac('0x4a')](_0x3e7269[_0x83ac('0x30')],_0x3e530c[_0x83ac('0x31')]));if(_0x3e7269['query'][_0x83ac('0x3a')]){_0x145823['where']=_['merge'](_0x145823[_0x83ac('0x39')],{'$or':_[_0x83ac('0x2e')](_0x145823[_0x83ac('0x34')],function(_0x25b528){var _0x15a30a={};_0x15a30a[_0x25b528]={'$like':'%'+_0x3e7269[_0x83ac('0x30')]['filter']+'%'};return _0x15a30a;})});}_0x145823=_[_0x83ac('0x3b')]({},_0x145823,_0x3e7269[_0x83ac('0x43')]);return _0x5e0b07['getSubjects'](_0x145823);}})[_0x83ac('0x24')](function(_0x35247b){if(_0x35247b){_0x3ac2cf=_0x35247b['length'];if(!_0x3e7269[_0x83ac('0x30')][_0x83ac('0x36')](_0x83ac('0x4b'))){_0x145823[_0x83ac('0x1c')]=qs[_0x83ac('0x1c')](_0x3e7269[_0x83ac('0x30')]['limit']);_0x145823[_0x83ac('0x1a')]=qs[_0x83ac('0x1a')](_0x3e7269['query']['offset']);}return _0x5e0b07['getSubjects'](_0x145823);}})[_0x83ac('0x24')](function(_0x58a743){if(_0x58a743){return _0x58a743?{'count':_0x3ac2cf,'rows':_0x58a743}:null;}})[_0x83ac('0x24')](respondWithResult(_0x5a57b2,null))[_0x83ac('0x40')](handleError(_0x5a57b2,null));};exports[_0x83ac('0x4d')]=function(_0x1bac90,_0x3a4f89,_0x2f2474){var _0x21afcc={};var _0x4ff469={};var _0x50acff;var _0x448b97;return db[_0x83ac('0x28')]['findOne']({'where':{'id':_0x1bac90[_0x83ac('0x42')]['id']}})[_0x83ac('0x24')](handleEntityNotFound(_0x3a4f89,null))[_0x83ac('0x24')](function(_0x5c69f4){if(_0x5c69f4){_0x50acff=_0x5c69f4;_0x4ff469['model']=_[_0x83ac('0x2f')](db[_0x83ac('0x49')][_0x83ac('0x29')]);_0x4ff469[_0x83ac('0x30')]=_[_0x83ac('0x2f')](_0x1bac90[_0x83ac('0x30')]);_0x4ff469[_0x83ac('0x31')]=_[_0x83ac('0x32')](_0x4ff469[_0x83ac('0x2d')],_0x4ff469[_0x83ac('0x30')]);_0x21afcc[_0x83ac('0x34')]=_[_0x83ac('0x32')](_0x4ff469[_0x83ac('0x2d')],qs[_0x83ac('0x33')](_0x1bac90[_0x83ac('0x30')]['fields']));_0x21afcc[_0x83ac('0x34')]=_0x21afcc[_0x83ac('0x34')]['length']?_0x21afcc['attributes']:_0x4ff469[_0x83ac('0x2d')];_0x21afcc[_0x83ac('0x37')]=qs[_0x83ac('0x38')](_0x1bac90[_0x83ac('0x30')][_0x83ac('0x38')]);_0x21afcc[_0x83ac('0x39')]=qs[_0x83ac('0x31')](_[_0x83ac('0x4a')](_0x1bac90['query'],_0x4ff469[_0x83ac('0x31')]));if(_0x1bac90[_0x83ac('0x30')][_0x83ac('0x3a')]){_0x21afcc[_0x83ac('0x39')]=_['merge'](_0x21afcc[_0x83ac('0x39')],{'$or':_['map'](_0x21afcc[_0x83ac('0x34')],function(_0x2c6e80){var _0x2a930c={};_0x2a930c[_0x2c6e80]={'$like':'%'+_0x1bac90[_0x83ac('0x30')][_0x83ac('0x3a')]+'%'};return _0x2a930c;})});}_0x21afcc=_[_0x83ac('0x3b')]({},_0x21afcc,_0x1bac90[_0x83ac('0x43')]);return _0x50acff[_0x83ac('0x4d')](_0x21afcc);}})[_0x83ac('0x24')](function(_0x5a4920){if(_0x5a4920){_0x448b97=_0x5a4920[_0x83ac('0x35')];if(!_0x1bac90[_0x83ac('0x30')][_0x83ac('0x36')](_0x83ac('0x4b'))){_0x21afcc[_0x83ac('0x1c')]=qs[_0x83ac('0x1c')](_0x1bac90[_0x83ac('0x30')][_0x83ac('0x1c')]);_0x21afcc[_0x83ac('0x1a')]=qs[_0x83ac('0x1a')](_0x1bac90[_0x83ac('0x30')][_0x83ac('0x1a')]);}return _0x50acff[_0x83ac('0x4d')](_0x21afcc);}})[_0x83ac('0x24')](function(_0x7d2d0a){if(_0x7d2d0a){return _0x7d2d0a?{'count':_0x448b97,'rows':_0x7d2d0a}:null;}})[_0x83ac('0x24')](respondWithResult(_0x3a4f89,null))[_0x83ac('0x40')](handleError(_0x3a4f89,null));}; \ No newline at end of file +var _0xf45d=['../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','Dynamics365Configuration','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','length','find','create','body','getFields','findOne','options','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x2f7371,_0x17edd0){var _0x15024c=function(_0x4fe539){while(--_0x4fe539){_0x2f7371['push'](_0x2f7371['shift']());}};_0x15024c(++_0x17edd0);}(_0xf45d,0x8c));var _0xdf45=function(_0x26c9ff,_0x1ac963){_0x26c9ff=_0x26c9ff-0x0;var _0x26af67=_0xf45d[_0x26c9ff];return _0x26af67;};'use strict';var emlformat=require(_0xdf45('0x0'));var rimraf=require(_0xdf45('0x1'));var zipdir=require(_0xdf45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf45('0x3'));var moment=require('moment');var BPromise=require(_0xdf45('0x4'));var Mustache=require(_0xdf45('0x5'));var util=require('util');var path=require(_0xdf45('0x6'));var sox=require(_0xdf45('0x7'));var csv=require(_0xdf45('0x8'));var ejs=require(_0xdf45('0x9'));var fs=require('fs');var fs_extra=require(_0xdf45('0xa'));var _=require(_0xdf45('0xb'));var squel=require(_0xdf45('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf45('0x8'));var querystring=require(_0xdf45('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf45('0xe'));var authService=require(_0xdf45('0xf'));var qs=require(_0xdf45('0x10'));var as=require(_0xdf45('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf45('0x12'))(_0xdf45('0x13'));var utils=require(_0xdf45('0x14'));var config=require(_0xdf45('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf45('0x16'))['db'];function respondWithStatusCode(_0x58db1e,_0x44beed){_0x44beed=_0x44beed||0xcc;return function(_0x3f5c36){if(_0x3f5c36){return _0x58db1e['sendStatus'](_0x44beed);}return _0x58db1e[_0xdf45('0x17')](_0x44beed)[_0xdf45('0x18')]();};}function respondWithResult(_0xc78ff5,_0x2733be){_0x2733be=_0x2733be||0xc8;return function(_0x2ea845){if(_0x2ea845){return _0xc78ff5[_0xdf45('0x17')](_0x2733be)[_0xdf45('0x19')](_0x2ea845);}};}function respondWithFilteredResult(_0x1fcab8,_0x3a63b2){return function(_0x183c43){if(_0x183c43){var _0x4078e5=typeof _0x3a63b2[_0xdf45('0x1a')]===_0xdf45('0x1b')&&typeof _0x3a63b2[_0xdf45('0x1c')]==='undefined';var _0x14ac08=_0x183c43[_0xdf45('0x1d')];var _0xd1bdc6=_0x4078e5?0x0:_0x3a63b2['offset'];var _0x4605ba=_0x4078e5?_0x183c43['count']:_0x3a63b2[_0xdf45('0x1a')]+_0x3a63b2[_0xdf45('0x1c')];var _0x2c690f;if(_0x4605ba>=_0x14ac08){_0x4605ba=_0x14ac08;_0x2c690f=0xc8;}else{_0x2c690f=0xce;}_0x1fcab8[_0xdf45('0x17')](_0x2c690f);return _0x1fcab8[_0xdf45('0x1e')](_0xdf45('0x1f'),_0xd1bdc6+'-'+_0x4605ba+'/'+_0x14ac08)[_0xdf45('0x19')](_0x183c43);}return null;};}function patchUpdates(_0x4b40f0){return function(_0x58bf76){try{jsonpatch[_0xdf45('0x20')](_0x58bf76,_0x4b40f0,!![]);}catch(_0x4918cd){return BPromise[_0xdf45('0x21')](_0x4918cd);}return _0x58bf76[_0xdf45('0x22')]();};}function saveUpdates(_0x268809,_0x21448b){return function(_0x489824){if(_0x489824){return _0x489824[_0xdf45('0x23')](_0x268809)[_0xdf45('0x24')](function(_0x4c7975){return _0x4c7975;});}return null;};}function removeEntity(_0x1d4730,_0x473e4b){return function(_0x40f920){if(_0x40f920){return _0x40f920[_0xdf45('0x25')]()[_0xdf45('0x24')](function(){_0x1d4730[_0xdf45('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3363bd,_0xbc4bf4){return function(_0x1ac458){if(!_0x1ac458){_0x3363bd[_0xdf45('0x26')](0x194);}return _0x1ac458;};}function handleError(_0x3d0fb4,_0x3c35ed){_0x3c35ed=_0x3c35ed||0x1f4;return function(_0x4ed652){logger['error'](_0x4ed652[_0xdf45('0x27')]);if(_0x4ed652[_0xdf45('0x28')]){delete _0x4ed652[_0xdf45('0x28')];}_0x3d0fb4[_0xdf45('0x17')](_0x3c35ed)['send'](_0x4ed652);};}exports[_0xdf45('0x29')]=function(_0x2ef066,_0x1297b5){var _0xff409a={},_0x5e8a69={},_0x3f649c={'count':0x0,'rows':[]};var _0x3b04e4=_['map'](db[_0xdf45('0x2a')][_0xdf45('0x2b')],function(_0x168417){return{'name':_0x168417[_0xdf45('0x2c')],'type':_0x168417['type'][_0xdf45('0x2d')]};});_0x5e8a69['model']=_[_0xdf45('0x2e')](_0x3b04e4,'name');_0x5e8a69[_0xdf45('0x2f')]=_['keys'](_0x2ef066[_0xdf45('0x2f')]);_0x5e8a69[_0xdf45('0x30')]=_[_0xdf45('0x31')](_0x5e8a69[_0xdf45('0x32')],_0x5e8a69[_0xdf45('0x2f')]);_0xff409a[_0xdf45('0x33')]=_[_0xdf45('0x31')](_0x5e8a69[_0xdf45('0x32')],qs[_0xdf45('0x34')](_0x2ef066[_0xdf45('0x2f')][_0xdf45('0x34')]));_0xff409a[_0xdf45('0x33')]=_0xff409a[_0xdf45('0x33')]['length']?_0xff409a[_0xdf45('0x33')]:_0x5e8a69[_0xdf45('0x32')];if(!_0x2ef066[_0xdf45('0x2f')][_0xdf45('0x35')](_0xdf45('0x36'))){_0xff409a[_0xdf45('0x1c')]=qs[_0xdf45('0x1c')](_0x2ef066[_0xdf45('0x2f')]['limit']);_0xff409a[_0xdf45('0x1a')]=qs[_0xdf45('0x1a')](_0x2ef066[_0xdf45('0x2f')][_0xdf45('0x1a')]);}_0xff409a[_0xdf45('0x37')]=qs['sort'](_0x2ef066[_0xdf45('0x2f')][_0xdf45('0x38')]);_0xff409a[_0xdf45('0x39')]=qs[_0xdf45('0x30')](_[_0xdf45('0x3a')](_0x2ef066[_0xdf45('0x2f')],_0x5e8a69[_0xdf45('0x30')]),_0x3b04e4);if(_0x2ef066[_0xdf45('0x2f')]['filter']){_0xff409a['where']=_[_0xdf45('0x3b')](_0xff409a[_0xdf45('0x39')],{'$or':_['map'](_0x3b04e4,function(_0x65d643){if(_0x65d643[_0xdf45('0x3c')]!==_0xdf45('0x3d')){var _0x259b74={};_0x259b74[_0x65d643[_0xdf45('0x28')]]={'$like':'%'+_0x2ef066[_0xdf45('0x2f')][_0xdf45('0x3e')]+'%'};return _0x259b74;}})});}_0xff409a=_[_0xdf45('0x3b')]({},_0xff409a,_0x2ef066['options']);var _0x27be9f={'where':_0xff409a[_0xdf45('0x39')]};return db['Dynamics365Configuration'][_0xdf45('0x1d')](_0x27be9f)[_0xdf45('0x24')](function(_0x27944b){_0x3f649c['count']=_0x27944b;if(_0x2ef066[_0xdf45('0x2f')][_0xdf45('0x3f')]){_0xff409a['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xdf45('0x40')](_0xff409a);})[_0xdf45('0x24')](function(_0x35fd13){_0x3f649c[_0xdf45('0x41')]=_0x35fd13;return _0x3f649c;})[_0xdf45('0x24')](respondWithFilteredResult(_0x1297b5,_0xff409a))[_0xdf45('0x42')](handleError(_0x1297b5,null));};exports[_0xdf45('0x43')]=function(_0x2e1d9c,_0x22dc81){var _0x32d55d={'raw':![],'where':{'id':_0x2e1d9c[_0xdf45('0x44')]['id']}},_0x29b88f={};_0x29b88f[_0xdf45('0x32')]=_[_0xdf45('0x45')](db[_0xdf45('0x2a')][_0xdf45('0x2b')]);_0x29b88f[_0xdf45('0x2f')]=_['keys'](_0x2e1d9c[_0xdf45('0x2f')]);_0x29b88f['filters']=_['intersection'](_0x29b88f[_0xdf45('0x32')],_0x29b88f[_0xdf45('0x2f')]);_0x32d55d[_0xdf45('0x33')]=_['intersection'](_0x29b88f[_0xdf45('0x32')],qs[_0xdf45('0x34')](_0x2e1d9c[_0xdf45('0x2f')][_0xdf45('0x34')]));_0x32d55d[_0xdf45('0x33')]=_0x32d55d[_0xdf45('0x33')][_0xdf45('0x46')]?_0x32d55d['attributes']:_0x29b88f[_0xdf45('0x32')];if(_0x2e1d9c['query'][_0xdf45('0x3f')]){_0x32d55d['include']=[{'all':!![]}];}_0x32d55d=_[_0xdf45('0x3b')]({},_0x32d55d,_0x2e1d9c['options']);return db[_0xdf45('0x2a')][_0xdf45('0x47')](_0x32d55d)['then'](handleEntityNotFound(_0x22dc81,null))['then'](respondWithResult(_0x22dc81,null))[_0xdf45('0x42')](handleError(_0x22dc81,null));};exports['create']=function(_0x1bd13e,_0x26bf6f){return db[_0xdf45('0x2a')][_0xdf45('0x48')](_0x1bd13e['body'],{})[_0xdf45('0x24')](respondWithResult(_0x26bf6f,0xc9))['catch'](handleError(_0x26bf6f,null));};exports[_0xdf45('0x23')]=function(_0x1df376,_0x20f770){if(_0x1df376[_0xdf45('0x49')]['id']){delete _0x1df376[_0xdf45('0x49')]['id'];}return db[_0xdf45('0x2a')]['find']({'where':{'id':_0x1df376[_0xdf45('0x44')]['id']}})[_0xdf45('0x24')](handleEntityNotFound(_0x20f770,null))[_0xdf45('0x24')](saveUpdates(_0x1df376[_0xdf45('0x49')],null))[_0xdf45('0x24')](respondWithResult(_0x20f770,null))[_0xdf45('0x42')](handleError(_0x20f770,null));};exports['destroy']=function(_0x46e6db,_0x4dbc26){return db[_0xdf45('0x2a')][_0xdf45('0x47')]({'where':{'id':_0x46e6db[_0xdf45('0x44')]['id']}})[_0xdf45('0x24')](handleEntityNotFound(_0x4dbc26,null))[_0xdf45('0x24')](removeEntity(_0x4dbc26,null))[_0xdf45('0x42')](handleError(_0x4dbc26,null));};exports[_0xdf45('0x4a')]=function(_0x57a721,_0x943b72,_0x6a509a){var _0x4f4c19={};var _0x4c9528={};var _0x524004;var _0x23d086;return db[_0xdf45('0x2a')][_0xdf45('0x4b')]({'where':{'id':_0x57a721['params']['id']}})[_0xdf45('0x24')](handleEntityNotFound(_0x943b72,null))[_0xdf45('0x24')](function(_0x2716d5){if(_0x2716d5){_0x524004=_0x2716d5;_0x4c9528[_0xdf45('0x32')]=_[_0xdf45('0x45')](db['Dynamics365Field']['rawAttributes']);_0x4c9528['query']=_[_0xdf45('0x45')](_0x57a721[_0xdf45('0x2f')]);_0x4c9528['filters']=_['intersection'](_0x4c9528[_0xdf45('0x32')],_0x4c9528[_0xdf45('0x2f')]);_0x4f4c19['attributes']=_[_0xdf45('0x31')](_0x4c9528[_0xdf45('0x32')],qs['fields'](_0x57a721[_0xdf45('0x2f')][_0xdf45('0x34')]));_0x4f4c19[_0xdf45('0x33')]=_0x4f4c19[_0xdf45('0x33')][_0xdf45('0x46')]?_0x4f4c19['attributes']:_0x4c9528[_0xdf45('0x32')];_0x4f4c19[_0xdf45('0x37')]=qs[_0xdf45('0x38')](_0x57a721['query'][_0xdf45('0x38')]);_0x4f4c19['where']=qs[_0xdf45('0x30')](_[_0xdf45('0x3a')](_0x57a721[_0xdf45('0x2f')],_0x4c9528[_0xdf45('0x30')]));if(_0x57a721['query'][_0xdf45('0x3e')]){_0x4f4c19[_0xdf45('0x39')]=_[_0xdf45('0x3b')](_0x4f4c19[_0xdf45('0x39')],{'$or':_[_0xdf45('0x2e')](_0x4f4c19[_0xdf45('0x33')],function(_0x3c649b){var _0x3bceed={};_0x3bceed[_0x3c649b]={'$like':'%'+_0x57a721[_0xdf45('0x2f')][_0xdf45('0x3e')]+'%'};return _0x3bceed;})});}_0x4f4c19=_['merge']({},_0x4f4c19,_0x57a721[_0xdf45('0x4c')]);return _0x524004['getFields'](_0x4f4c19);}})[_0xdf45('0x24')](function(_0x5ffd6b){if(_0x5ffd6b){_0x23d086=_0x5ffd6b['length'];if(!_0x57a721[_0xdf45('0x2f')][_0xdf45('0x35')](_0xdf45('0x36'))){_0x4f4c19[_0xdf45('0x1c')]=qs[_0xdf45('0x1c')](_0x57a721[_0xdf45('0x2f')][_0xdf45('0x1c')]);_0x4f4c19[_0xdf45('0x1a')]=qs[_0xdf45('0x1a')](_0x57a721['query'][_0xdf45('0x1a')]);}return _0x524004[_0xdf45('0x4a')](_0x4f4c19);}})[_0xdf45('0x24')](function(_0x36902b){if(_0x36902b){return _0x36902b?{'count':_0x23d086,'rows':_0x36902b}:null;}})[_0xdf45('0x24')](respondWithResult(_0x943b72,null))[_0xdf45('0x42')](handleError(_0x943b72,null));};exports['getSubjects']=function(_0x21a4b1,_0x5477e9,_0x2fde3d){var _0x1ddda3={};var _0x3dd85e={};var _0x3b9774;var _0x58abfa;return db[_0xdf45('0x2a')][_0xdf45('0x4b')]({'where':{'id':_0x21a4b1[_0xdf45('0x44')]['id']}})[_0xdf45('0x24')](handleEntityNotFound(_0x5477e9,null))[_0xdf45('0x24')](function(_0x413a7a){if(_0x413a7a){_0x3b9774=_0x413a7a;_0x3dd85e[_0xdf45('0x32')]=_[_0xdf45('0x45')](db[_0xdf45('0x4d')]['rawAttributes']);_0x3dd85e['query']=_['keys'](_0x21a4b1[_0xdf45('0x2f')]);_0x3dd85e[_0xdf45('0x30')]=_['intersection'](_0x3dd85e[_0xdf45('0x32')],_0x3dd85e[_0xdf45('0x2f')]);_0x1ddda3['attributes']=_[_0xdf45('0x31')](_0x3dd85e['model'],qs[_0xdf45('0x34')](_0x21a4b1['query']['fields']));_0x1ddda3[_0xdf45('0x33')]=_0x1ddda3[_0xdf45('0x33')][_0xdf45('0x46')]?_0x1ddda3[_0xdf45('0x33')]:_0x3dd85e[_0xdf45('0x32')];_0x1ddda3[_0xdf45('0x37')]=qs[_0xdf45('0x38')](_0x21a4b1[_0xdf45('0x2f')][_0xdf45('0x38')]);_0x1ddda3['where']=qs['filters'](_[_0xdf45('0x3a')](_0x21a4b1[_0xdf45('0x2f')],_0x3dd85e[_0xdf45('0x30')]));if(_0x21a4b1[_0xdf45('0x2f')][_0xdf45('0x3e')]){_0x1ddda3[_0xdf45('0x39')]=_[_0xdf45('0x3b')](_0x1ddda3['where'],{'$or':_[_0xdf45('0x2e')](_0x1ddda3[_0xdf45('0x33')],function(_0x443ac7){var _0x25f2ff={};_0x25f2ff[_0x443ac7]={'$like':'%'+_0x21a4b1[_0xdf45('0x2f')]['filter']+'%'};return _0x25f2ff;})});}_0x1ddda3=_[_0xdf45('0x3b')]({},_0x1ddda3,_0x21a4b1[_0xdf45('0x4c')]);return _0x3b9774[_0xdf45('0x4e')](_0x1ddda3);}})[_0xdf45('0x24')](function(_0x5d6fa7){if(_0x5d6fa7){_0x58abfa=_0x5d6fa7[_0xdf45('0x46')];if(!_0x21a4b1[_0xdf45('0x2f')][_0xdf45('0x35')]('nolimit')){_0x1ddda3[_0xdf45('0x1c')]=qs[_0xdf45('0x1c')](_0x21a4b1[_0xdf45('0x2f')]['limit']);_0x1ddda3['offset']=qs[_0xdf45('0x1a')](_0x21a4b1[_0xdf45('0x2f')]['offset']);}return _0x3b9774[_0xdf45('0x4e')](_0x1ddda3);}})['then'](function(_0x2d1674){if(_0x2d1674){return _0x2d1674?{'count':_0x58abfa,'rows':_0x2d1674}:null;}})[_0xdf45('0x24')](respondWithResult(_0x5477e9,null))[_0xdf45('0x42')](handleError(_0x5477e9,null));};exports[_0xdf45('0x4f')]=function(_0x36eb46,_0x17a744,_0xeebb22){var _0xa3bf9e={};var _0x472036={};var _0x58bb0c;var _0x5c472b;return db['Dynamics365Configuration'][_0xdf45('0x4b')]({'where':{'id':_0x36eb46[_0xdf45('0x44')]['id']}})[_0xdf45('0x24')](handleEntityNotFound(_0x17a744,null))[_0xdf45('0x24')](function(_0x4ff603){if(_0x4ff603){_0x58bb0c=_0x4ff603;_0x472036[_0xdf45('0x32')]=_['keys'](db[_0xdf45('0x4d')][_0xdf45('0x2b')]);_0x472036[_0xdf45('0x2f')]=_['keys'](_0x36eb46['query']);_0x472036[_0xdf45('0x30')]=_['intersection'](_0x472036['model'],_0x472036['query']);_0xa3bf9e['attributes']=_['intersection'](_0x472036[_0xdf45('0x32')],qs['fields'](_0x36eb46[_0xdf45('0x2f')][_0xdf45('0x34')]));_0xa3bf9e[_0xdf45('0x33')]=_0xa3bf9e['attributes'][_0xdf45('0x46')]?_0xa3bf9e['attributes']:_0x472036[_0xdf45('0x32')];_0xa3bf9e['order']=qs[_0xdf45('0x38')](_0x36eb46[_0xdf45('0x2f')][_0xdf45('0x38')]);_0xa3bf9e[_0xdf45('0x39')]=qs[_0xdf45('0x30')](_[_0xdf45('0x3a')](_0x36eb46[_0xdf45('0x2f')],_0x472036[_0xdf45('0x30')]));if(_0x36eb46[_0xdf45('0x2f')]['filter']){_0xa3bf9e['where']=_[_0xdf45('0x3b')](_0xa3bf9e['where'],{'$or':_[_0xdf45('0x2e')](_0xa3bf9e[_0xdf45('0x33')],function(_0x17d87c){var _0x256648={};_0x256648[_0x17d87c]={'$like':'%'+_0x36eb46[_0xdf45('0x2f')]['filter']+'%'};return _0x256648;})});}_0xa3bf9e=_[_0xdf45('0x3b')]({},_0xa3bf9e,_0x36eb46['options']);return _0x58bb0c[_0xdf45('0x4f')](_0xa3bf9e);}})[_0xdf45('0x24')](function(_0x470f16){if(_0x470f16){_0x5c472b=_0x470f16[_0xdf45('0x46')];if(!_0x36eb46[_0xdf45('0x2f')][_0xdf45('0x35')](_0xdf45('0x36'))){_0xa3bf9e['limit']=qs[_0xdf45('0x1c')](_0x36eb46[_0xdf45('0x2f')][_0xdf45('0x1c')]);_0xa3bf9e[_0xdf45('0x1a')]=qs[_0xdf45('0x1a')](_0x36eb46[_0xdf45('0x2f')][_0xdf45('0x1a')]);}return _0x58bb0c[_0xdf45('0x4f')](_0xa3bf9e);}})[_0xdf45('0x24')](function(_0x3fb5af){if(_0x3fb5af){return _0x3fb5af?{'count':_0x5c472b,'rows':_0x3fb5af}:null;}})['then'](respondWithResult(_0x17a744,null))[_0xdf45('0x42')](handleError(_0x17a744,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 14430ee..c36935b 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 _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x323cb8,_0x4664c3){var _0x82dae4=function(_0x566d4f){while(--_0x566d4f){_0x323cb8['push'](_0x323cb8['shift']());}};_0x82dae4(++_0x4664c3);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xc3a35b,_0x4b0524){_0xc3a35b=_0xc3a35b-0x0;var _0x4cba7b=_0x8d0e[_0xc3a35b];return _0x4cba7b;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3781b4,_0x3d4f15){var _0x2d3b49=function(_0x75af2f){while(--_0x75af2f){_0x3781b4['push'](_0x3781b4['shift']());}};_0x2d3b49(++_0x3d4f15);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xf3cd[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 24f4c6e..9a85752 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 _0xa4f4=['jayson/promise','client','http','request','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x421617,_0xbef6c4){var _0x12045b=function(_0x407692){while(--_0x407692){_0x421617['push'](_0x421617['shift']());}};_0x12045b(++_0xbef6c4);}(_0xa4f4,0x12f));var _0x4a4f=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xa4f4[_0x411017];return _0x2adeea;};'use strict';var _=require('lodash');var util=require(_0x4a4f('0x0'));var moment=require(_0x4a4f('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a4f('0x2'));var fs=require('fs');var Redis=require(_0x4a4f('0x3'));var db=require(_0x4a4f('0x4'))['db'];var utils=require(_0x4a4f('0x5'));var logger=require(_0x4a4f('0x6'))(_0x4a4f('0x7'));var config=require(_0x4a4f('0x8'));var jayson=require(_0x4a4f('0x9'));var client=jayson[_0x4a4f('0xa')][_0x4a4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2177eb,_0x319d47,_0xb71fe5){return new BPromise(function(_0x17d337,_0x2a5fd5){return client[_0x4a4f('0xc')](_0x2177eb,_0xb71fe5)[_0x4a4f('0xd')](function(_0x3fdffe){logger[_0x4a4f('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x319d47,'request\x20sent');logger[_0x4a4f('0xf')](_0x4a4f('0x10'),_0x319d47,_0x4a4f('0x11'),JSON[_0x4a4f('0x12')](_0x3fdffe));if(_0x3fdffe[_0x4a4f('0x13')]){if(_0x3fdffe['error']['code']===0x1f4){logger['error'](_0x4a4f('0x14'),_0x319d47,_0x3fdffe[_0x4a4f('0x13')]['message']);return _0x2a5fd5(_0x3fdffe['error'][_0x4a4f('0x15')]);}logger['error'](_0x4a4f('0x14'),_0x319d47,_0x3fdffe['error'][_0x4a4f('0x15')]);return _0x17d337(_0x3fdffe[_0x4a4f('0x13')][_0x4a4f('0x15')]);}else{logger[_0x4a4f('0xe')](_0x4a4f('0x14'),_0x319d47,_0x4a4f('0x11'));_0x17d337(_0x3fdffe[_0x4a4f('0x16')][_0x4a4f('0x15')]);}})[_0x4a4f('0x17')](function(_0x31dd0b){logger[_0x4a4f('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x319d47,_0x31dd0b);_0x2a5fd5(_0x31dd0b);});});} \ No newline at end of file +var _0xd212=['info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x46f62c,_0x49eb41){var _0x46d994=function(_0x225d69){while(--_0x225d69){_0x46f62c['push'](_0x46f62c['shift']());}};_0x46d994(++_0x49eb41);}(_0xd212,0x95));var _0x2d21=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0xd212[_0x10316a];return _0x36ac2e;};'use strict';var _=require(_0x2d21('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d21('0x1'));var rs=require(_0x2d21('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d21('0x3'));var logger=require(_0x2d21('0x4'))(_0x2d21('0x5'));var config=require(_0x2d21('0x6'));var jayson=require(_0x2d21('0x7'));var client=jayson[_0x2d21('0x8')][_0x2d21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33abb3,_0x589cd9,_0x2578fe){return new BPromise(function(_0x11d9da,_0x21a55f){return client[_0x2d21('0xa')](_0x33abb3,_0x2578fe)[_0x2d21('0xb')](function(_0x3f5b10){logger[_0x2d21('0xc')](_0x2d21('0xd'),_0x589cd9,'request\x20sent');logger[_0x2d21('0xe')](_0x2d21('0xf'),_0x589cd9,'request\x20sent',JSON[_0x2d21('0x10')](_0x3f5b10));if(_0x3f5b10[_0x2d21('0x11')]){if(_0x3f5b10[_0x2d21('0x11')][_0x2d21('0x12')]===0x1f4){logger['error'](_0x2d21('0xd'),_0x589cd9,_0x3f5b10[_0x2d21('0x11')][_0x2d21('0x13')]);return _0x21a55f(_0x3f5b10['error'][_0x2d21('0x13')]);}logger[_0x2d21('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x589cd9,_0x3f5b10[_0x2d21('0x11')][_0x2d21('0x13')]);return _0x11d9da(_0x3f5b10[_0x2d21('0x11')]['message']);}else{logger[_0x2d21('0xc')](_0x2d21('0xd'),_0x589cd9,_0x2d21('0x14'));_0x11d9da(_0x3f5b10[_0x2d21('0x15')][_0x2d21('0x13')]);}})[_0x2d21('0x16')](function(_0x2298b6){logger[_0x2d21('0x11')](_0x2d21('0xd'),_0x589cd9,_0x2298b6);_0x21a55f(_0x2298b6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f6b4168..4418981 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 _0xb6dd=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer'];(function(_0xc6f2df,_0x222595){var _0x1c853b=function(_0x588dc7){while(--_0x588dc7){_0xc6f2df['push'](_0xc6f2df['shift']());}};_0x1c853b(++_0x222595);}(_0xb6dd,0x18f));var _0xdb6d=function(_0x59c89a,_0x287bda){_0x59c89a=_0x59c89a-0x0;var _0x89eaf9=_0xb6dd[_0x59c89a];return _0x89eaf9;};'use strict';var multer=require(_0xdb6d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb6d('0x1'));var express=require(_0xdb6d('0x2'));var router=express[_0xdb6d('0x3')]();var fs_extra=require(_0xdb6d('0x4'));var auth=require(_0xdb6d('0x5'));var interaction=require(_0xdb6d('0x6'));var config=require(_0xdb6d('0x7'));var controller=require(_0xdb6d('0x8'));router[_0xdb6d('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb6d('0xa')]);router[_0xdb6d('0x9')](_0xdb6d('0xb'),auth[_0xdb6d('0xc')](),controller[_0xdb6d('0xd')]);router[_0xdb6d('0xe')]('/',auth[_0xdb6d('0xc')](),controller[_0xdb6d('0xf')]);router[_0xdb6d('0x10')](_0xdb6d('0xb'),auth[_0xdb6d('0xc')](),controller[_0xdb6d('0x11')]);router[_0xdb6d('0x12')](_0xdb6d('0xb'),auth[_0xdb6d('0xc')](),controller[_0xdb6d('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe9cf=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x46884f,_0x2b5c5a){var _0x78c6c0=function(_0x43ba0a){while(--_0x43ba0a){_0x46884f['push'](_0x46884f['shift']());}};_0x78c6c0(++_0x2b5c5a);}(_0xe9cf,0xa3));var _0xfe9c=function(_0x15ea8d,_0x132b40){_0x15ea8d=_0x15ea8d-0x0;var _0x17e921=_0xe9cf[_0x15ea8d];return _0x17e921;};'use strict';var multer=require(_0xfe9c('0x0'));var util=require(_0xfe9c('0x1'));var path=require('path');var timeout=require(_0xfe9c('0x2'));var express=require(_0xfe9c('0x3'));var router=express[_0xfe9c('0x4')]();var fs_extra=require(_0xfe9c('0x5'));var auth=require(_0xfe9c('0x6'));var interaction=require(_0xfe9c('0x7'));var config=require('../../config/environment');var controller=require(_0xfe9c('0x8'));router[_0xfe9c('0x9')]('/',auth[_0xfe9c('0xa')](),controller[_0xfe9c('0xb')]);router[_0xfe9c('0x9')](_0xfe9c('0xc'),auth['isAuthenticated'](),controller[_0xfe9c('0xd')]);router[_0xfe9c('0xe')]('/',auth[_0xfe9c('0xa')](),controller[_0xfe9c('0xf')]);router[_0xfe9c('0x10')](_0xfe9c('0xc'),auth[_0xfe9c('0xa')](),controller[_0xfe9c('0x11')]);router[_0xfe9c('0x12')](_0xfe9c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe9c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index fc8dba5..47f81c1 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 _0xd885=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd885,0x1d5));var _0x5d88=function(_0x44eb83,_0x53b4cb){_0x44eb83=_0x44eb83-0x0;var _0x19d7ee=_0xd885[_0x44eb83];return _0x19d7ee;};'use strict';var Sequelize=require(_0x5d88('0x0'));module[_0x5d88('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5d88('0x2'),_0x5d88('0x3'),_0x5d88('0x4'),_0x5d88('0x5'),_0x5d88('0x6')),'defaultValue':_0x5d88('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5d88('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x5d88('0x2'),_0x5d88('0x3'),_0x5d88('0x4'))},'keyContent':{'type':Sequelize[_0x5d88('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5d88('0x7')]},'customField':{'type':Sequelize[_0x5d88('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5d88('0x7')]}}; \ No newline at end of file +var _0xf4a8=['string','picklist','STRING','variable','customVariable','BOOLEAN','exports','ENUM'];(function(_0x454cc4,_0x49392e){var _0xfd2568=function(_0x36f9b6){while(--_0x36f9b6){_0x454cc4['push'](_0x454cc4['shift']());}};_0xfd2568(++_0x49392e);}(_0xf4a8,0x166));var _0x8f4a=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xf4a8[_0xcd5a3d];return _0xd43207;};'use strict';var Sequelize=require('sequelize');module[_0x8f4a('0x0')]={'type':{'type':Sequelize[_0x8f4a('0x1')](_0x8f4a('0x2'),'variable','customVariable','keyValue',_0x8f4a('0x3')),'defaultValue':_0x8f4a('0x2')},'content':{'type':Sequelize[_0x8f4a('0x4')]},'key':{'type':Sequelize[_0x8f4a('0x4')]},'keyType':{'type':Sequelize[_0x8f4a('0x1')](_0x8f4a('0x2'),_0x8f4a('0x5'),_0x8f4a('0x6'))},'keyContent':{'type':Sequelize[_0x8f4a('0x4')]},'idField':{'type':Sequelize[_0x8f4a('0x4')]},'nameField':{'type':Sequelize[_0x8f4a('0x4')]},'customField':{'type':Sequelize[_0x8f4a('0x7')],'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 22e4d1a..6c69f58 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 _0x92af=['includeAll','include','findAll','rows','catch','show','params','fields','create','find','body','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','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','status','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','Dynamics365Field'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x92af,0xe3));var _0xf92a=function(_0x49f135,_0x492ed0){_0x49f135=_0x49f135-0x0;var _0x463786=_0x92af[_0x49f135];return _0x463786;};'use strict';var emlformat=require(_0xf92a('0x0'));var rimraf=require(_0xf92a('0x1'));var zipdir=require(_0xf92a('0x2'));var jsonpatch=require(_0xf92a('0x3'));var rp=require(_0xf92a('0x4'));var moment=require(_0xf92a('0x5'));var BPromise=require(_0xf92a('0x6'));var Mustache=require('mustache');var util=require(_0xf92a('0x7'));var path=require('path');var sox=require(_0xf92a('0x8'));var csv=require(_0xf92a('0x9'));var ejs=require(_0xf92a('0xa'));var fs=require('fs');var fs_extra=require(_0xf92a('0xb'));var _=require('lodash');var squel=require(_0xf92a('0xc'));var crypto=require(_0xf92a('0xd'));var jsforce=require(_0xf92a('0xe'));var deskjs=require(_0xf92a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf92a('0x10'));var Papa=require('papaparse');var Redis=require(_0xf92a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf92a('0x12'));var logger=require(_0xf92a('0x13'))(_0xf92a('0x14'));var utils=require(_0xf92a('0x15'));var config=require(_0xf92a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf92a('0x17'))['db'];function respondWithStatusCode(_0x5c6217,_0x517317){_0x517317=_0x517317||0xcc;return function(_0x104737){if(_0x104737){return _0x5c6217[_0xf92a('0x18')](_0x517317);}return _0x5c6217['status'](_0x517317)['end']();};}function respondWithResult(_0x73da40,_0x5f1555){_0x5f1555=_0x5f1555||0xc8;return function(_0x21bc9f){if(_0x21bc9f){return _0x73da40['status'](_0x5f1555)['json'](_0x21bc9f);}};}function respondWithFilteredResult(_0x48e972,_0x30596e){return function(_0x4f8bff){if(_0x4f8bff){var _0xf605d1=typeof _0x30596e[_0xf92a('0x19')]===_0xf92a('0x1a')&&typeof _0x30596e[_0xf92a('0x1b')]===_0xf92a('0x1a');var _0x53bfd6=_0x4f8bff['count'];var _0x520819=_0xf605d1?0x0:_0x30596e['offset'];var _0x32cb91=_0xf605d1?_0x4f8bff[_0xf92a('0x1c')]:_0x30596e[_0xf92a('0x19')]+_0x30596e[_0xf92a('0x1b')];var _0x434cba;if(_0x32cb91>=_0x53bfd6){_0x32cb91=_0x53bfd6;_0x434cba=0xc8;}else{_0x434cba=0xce;}_0x48e972['status'](_0x434cba);return _0x48e972[_0xf92a('0x1d')](_0xf92a('0x1e'),_0x520819+'-'+_0x32cb91+'/'+_0x53bfd6)['json'](_0x4f8bff);}return null;};}function patchUpdates(_0x29a255){return function(_0xc723cb){try{jsonpatch[_0xf92a('0x1f')](_0xc723cb,_0x29a255,!![]);}catch(_0x1c39c3){return BPromise['reject'](_0x1c39c3);}return _0xc723cb[_0xf92a('0x20')]();};}function saveUpdates(_0x27b70e,_0x19f7c5){return function(_0x391da3){if(_0x391da3){return _0x391da3[_0xf92a('0x21')](_0x27b70e)[_0xf92a('0x22')](function(_0x3253ff){return _0x3253ff;});}return null;};}function removeEntity(_0x6333b0,_0x456d07){return function(_0x2fae59){if(_0x2fae59){return _0x2fae59[_0xf92a('0x23')]()['then'](function(){_0x6333b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13084e,_0x1067aa){return function(_0x49cd5a){if(!_0x49cd5a){_0x13084e[_0xf92a('0x18')](0x194);}return _0x49cd5a;};}function handleError(_0x389d16,_0x291c9f){_0x291c9f=_0x291c9f||0x1f4;return function(_0x508445){logger[_0xf92a('0x24')](_0x508445['stack']);if(_0x508445['name']){delete _0x508445[_0xf92a('0x25')];}_0x389d16[_0xf92a('0x26')](_0x291c9f)['send'](_0x508445);};}exports[_0xf92a('0x27')]=function(_0x5e9b6e,_0x3fd524){var _0x394ca3={},_0x1df279={},_0x253b54={'count':0x0,'rows':[]};var _0x698ef8=_[_0xf92a('0x28')](db['Dynamics365Field'][_0xf92a('0x29')],function(_0x403715){return{'name':_0x403715[_0xf92a('0x2a')],'type':_0x403715['type'][_0xf92a('0x2b')]};});_0x1df279[_0xf92a('0x2c')]=_[_0xf92a('0x28')](_0x698ef8,_0xf92a('0x25'));_0x1df279[_0xf92a('0x2d')]=_[_0xf92a('0x2e')](_0x5e9b6e[_0xf92a('0x2d')]);_0x1df279[_0xf92a('0x2f')]=_[_0xf92a('0x30')](_0x1df279[_0xf92a('0x2c')],_0x1df279[_0xf92a('0x2d')]);_0x394ca3[_0xf92a('0x31')]=_[_0xf92a('0x30')](_0x1df279[_0xf92a('0x2c')],qs['fields'](_0x5e9b6e[_0xf92a('0x2d')]['fields']));_0x394ca3[_0xf92a('0x31')]=_0x394ca3[_0xf92a('0x31')][_0xf92a('0x32')]?_0x394ca3[_0xf92a('0x31')]:_0x1df279['model'];if(!_0x5e9b6e['query'][_0xf92a('0x33')](_0xf92a('0x34'))){_0x394ca3[_0xf92a('0x1b')]=qs[_0xf92a('0x1b')](_0x5e9b6e['query'][_0xf92a('0x1b')]);_0x394ca3['offset']=qs[_0xf92a('0x19')](_0x5e9b6e[_0xf92a('0x2d')][_0xf92a('0x19')]);}_0x394ca3['order']=qs[_0xf92a('0x35')](_0x5e9b6e[_0xf92a('0x2d')][_0xf92a('0x35')]);_0x394ca3[_0xf92a('0x36')]=qs[_0xf92a('0x2f')](_[_0xf92a('0x37')](_0x5e9b6e['query'],_0x1df279['filters']),_0x698ef8);if(_0x5e9b6e[_0xf92a('0x2d')]['filter']){_0x394ca3[_0xf92a('0x36')]=_[_0xf92a('0x38')](_0x394ca3[_0xf92a('0x36')],{'$or':_[_0xf92a('0x28')](_0x698ef8,function(_0x3e8280){if(_0x3e8280[_0xf92a('0x39')]!==_0xf92a('0x3a')){var _0x2cd6a8={};_0x2cd6a8[_0x3e8280[_0xf92a('0x25')]]={'$like':'%'+_0x5e9b6e[_0xf92a('0x2d')][_0xf92a('0x3b')]+'%'};return _0x2cd6a8;}})});}_0x394ca3=_[_0xf92a('0x38')]({},_0x394ca3,_0x5e9b6e['options']);var _0x2de447={'where':_0x394ca3[_0xf92a('0x36')]};return db[_0xf92a('0x3c')][_0xf92a('0x1c')](_0x2de447)['then'](function(_0x204f6b){_0x253b54[_0xf92a('0x1c')]=_0x204f6b;if(_0x5e9b6e[_0xf92a('0x2d')][_0xf92a('0x3d')]){_0x394ca3[_0xf92a('0x3e')]=[{'all':!![]}];}return db[_0xf92a('0x3c')][_0xf92a('0x3f')](_0x394ca3);})[_0xf92a('0x22')](function(_0x11eee2){_0x253b54[_0xf92a('0x40')]=_0x11eee2;return _0x253b54;})[_0xf92a('0x22')](respondWithFilteredResult(_0x3fd524,_0x394ca3))[_0xf92a('0x41')](handleError(_0x3fd524,null));};exports[_0xf92a('0x42')]=function(_0x24cadc,_0x5bb337){var _0xeb9e80={'raw':!![],'where':{'id':_0x24cadc[_0xf92a('0x43')]['id']}},_0x34e416={};_0x34e416['model']=_['keys'](db[_0xf92a('0x3c')][_0xf92a('0x29')]);_0x34e416[_0xf92a('0x2d')]=_['keys'](_0x24cadc[_0xf92a('0x2d')]);_0x34e416[_0xf92a('0x2f')]=_['intersection'](_0x34e416[_0xf92a('0x2c')],_0x34e416[_0xf92a('0x2d')]);_0xeb9e80[_0xf92a('0x31')]=_[_0xf92a('0x30')](_0x34e416[_0xf92a('0x2c')],qs['fields'](_0x24cadc['query'][_0xf92a('0x44')]));_0xeb9e80[_0xf92a('0x31')]=_0xeb9e80['attributes'][_0xf92a('0x32')]?_0xeb9e80[_0xf92a('0x31')]:_0x34e416['model'];if(_0x24cadc[_0xf92a('0x2d')][_0xf92a('0x3d')]){_0xeb9e80['include']=[{'all':!![]}];}_0xeb9e80=_['merge']({},_0xeb9e80,_0x24cadc['options']);return db['Dynamics365Field']['find'](_0xeb9e80)[_0xf92a('0x22')](handleEntityNotFound(_0x5bb337,null))[_0xf92a('0x22')](respondWithResult(_0x5bb337,null))[_0xf92a('0x41')](handleError(_0x5bb337,null));};exports[_0xf92a('0x45')]=function(_0x89e078,_0x22a45f){return db[_0xf92a('0x3c')][_0xf92a('0x45')](_0x89e078['body'],{})[_0xf92a('0x22')](respondWithResult(_0x22a45f,0xc9))['catch'](handleError(_0x22a45f,null));};exports[_0xf92a('0x21')]=function(_0x39c933,_0x186292){if(_0x39c933['body']['id']){delete _0x39c933['body']['id'];}return db[_0xf92a('0x3c')][_0xf92a('0x46')]({'where':{'id':_0x39c933[_0xf92a('0x43')]['id']}})[_0xf92a('0x22')](handleEntityNotFound(_0x186292,null))['then'](saveUpdates(_0x39c933[_0xf92a('0x47')],null))['then'](respondWithResult(_0x186292,null))['catch'](handleError(_0x186292,null));};exports[_0xf92a('0x23')]=function(_0x324d6c,_0x251b48){return db[_0xf92a('0x3c')]['find']({'where':{'id':_0x324d6c[_0xf92a('0x43')]['id']}})[_0xf92a('0x22')](handleEntityNotFound(_0x251b48,null))[_0xf92a('0x22')](removeEntity(_0x251b48,null))[_0xf92a('0x41')](handleError(_0x251b48,null));}; \ No newline at end of file +var _0x7585=['reject','update','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','type','VIRTUAL','options','Dynamics365Field','then','includeAll','include','findAll','rows','catch','show','params','keys','filters','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x7585,0x10c));var _0x5758=function(_0x37e934,_0x2bd0ec){_0x37e934=_0x37e934-0x0;var _0xd612d8=_0x7585[_0x37e934];return _0xd612d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5758('0x0'));var zipdir=require(_0x5758('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5758('0x2'));var moment=require(_0x5758('0x3'));var BPromise=require(_0x5758('0x4'));var Mustache=require(_0x5758('0x5'));var util=require(_0x5758('0x6'));var path=require(_0x5758('0x7'));var sox=require(_0x5758('0x8'));var csv=require(_0x5758('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5758('0xa'));var _=require(_0x5758('0xb'));var squel=require(_0x5758('0xc'));var crypto=require(_0x5758('0xd'));var jsforce=require(_0x5758('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5758('0x9'));var querystring=require(_0x5758('0xf'));var Papa=require(_0x5758('0x10'));var Redis=require(_0x5758('0x11'));var authService=require(_0x5758('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5758('0x13'));var hardwareService=require(_0x5758('0x14'));var logger=require(_0x5758('0x15'))(_0x5758('0x16'));var utils=require(_0x5758('0x17'));var config=require(_0x5758('0x18'));var licenseUtil=require(_0x5758('0x19'));var db=require(_0x5758('0x1a'))['db'];function respondWithStatusCode(_0x56a31c,_0x1617b2){_0x1617b2=_0x1617b2||0xcc;return function(_0x54452a){if(_0x54452a){return _0x56a31c['sendStatus'](_0x1617b2);}return _0x56a31c[_0x5758('0x1b')](_0x1617b2)[_0x5758('0x1c')]();};}function respondWithResult(_0x29da43,_0x151afa){_0x151afa=_0x151afa||0xc8;return function(_0x1bc545){if(_0x1bc545){return _0x29da43[_0x5758('0x1b')](_0x151afa)[_0x5758('0x1d')](_0x1bc545);}};}function respondWithFilteredResult(_0x4ba994,_0x4f9831){return function(_0x4ced91){if(_0x4ced91){var _0x36adf9=typeof _0x4f9831[_0x5758('0x1e')]===_0x5758('0x1f')&&typeof _0x4f9831[_0x5758('0x20')]==='undefined';var _0x584ebb=_0x4ced91[_0x5758('0x21')];var _0x25ed6a=_0x36adf9?0x0:_0x4f9831[_0x5758('0x1e')];var _0x2eaebc=_0x36adf9?_0x4ced91[_0x5758('0x21')]:_0x4f9831[_0x5758('0x1e')]+_0x4f9831[_0x5758('0x20')];var _0x2c13eb;if(_0x2eaebc>=_0x584ebb){_0x2eaebc=_0x584ebb;_0x2c13eb=0xc8;}else{_0x2c13eb=0xce;}_0x4ba994[_0x5758('0x1b')](_0x2c13eb);return _0x4ba994[_0x5758('0x22')]('Content-Range',_0x25ed6a+'-'+_0x2eaebc+'/'+_0x584ebb)[_0x5758('0x1d')](_0x4ced91);}return null;};}function patchUpdates(_0x21cbbe){return function(_0x5cd77c){try{jsonpatch[_0x5758('0x23')](_0x5cd77c,_0x21cbbe,!![]);}catch(_0x15e47d){return BPromise[_0x5758('0x24')](_0x15e47d);}return _0x5cd77c['save']();};}function saveUpdates(_0x2bc513,_0x28d806){return function(_0x27e361){if(_0x27e361){return _0x27e361[_0x5758('0x25')](_0x2bc513)['then'](function(_0x5b03b1){return _0x5b03b1;});}return null;};}function removeEntity(_0x2c624a,_0x1955eb){return function(_0x259908){if(_0x259908){return _0x259908['destroy']()['then'](function(){_0x2c624a[_0x5758('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523833,_0xdd90a7){return function(_0xc2d6d8){if(!_0xc2d6d8){_0x523833[_0x5758('0x26')](0x194);}return _0xc2d6d8;};}function handleError(_0x7fed04,_0x4c574a){_0x4c574a=_0x4c574a||0x1f4;return function(_0x1f566b){logger[_0x5758('0x27')](_0x1f566b[_0x5758('0x28')]);if(_0x1f566b[_0x5758('0x29')]){delete _0x1f566b[_0x5758('0x29')];}_0x7fed04['status'](_0x4c574a)['send'](_0x1f566b);};}exports[_0x5758('0x2a')]=function(_0x366a2a,_0x585942){var _0x21baab={},_0x34c264={},_0x486201={'count':0x0,'rows':[]};var _0x2ef246=_[_0x5758('0x2b')](db['Dynamics365Field'][_0x5758('0x2c')],function(_0x6ef97d){return{'name':_0x6ef97d[_0x5758('0x2d')],'type':_0x6ef97d['type']['key']};});_0x34c264['model']=_[_0x5758('0x2b')](_0x2ef246,_0x5758('0x29'));_0x34c264['query']=_['keys'](_0x366a2a[_0x5758('0x2e')]);_0x34c264['filters']=_[_0x5758('0x2f')](_0x34c264[_0x5758('0x30')],_0x34c264[_0x5758('0x2e')]);_0x21baab[_0x5758('0x31')]=_['intersection'](_0x34c264[_0x5758('0x30')],qs['fields'](_0x366a2a[_0x5758('0x2e')][_0x5758('0x32')]));_0x21baab[_0x5758('0x31')]=_0x21baab[_0x5758('0x31')][_0x5758('0x33')]?_0x21baab[_0x5758('0x31')]:_0x34c264[_0x5758('0x30')];if(!_0x366a2a['query'][_0x5758('0x34')](_0x5758('0x35'))){_0x21baab[_0x5758('0x20')]=qs[_0x5758('0x20')](_0x366a2a[_0x5758('0x2e')][_0x5758('0x20')]);_0x21baab[_0x5758('0x1e')]=qs[_0x5758('0x1e')](_0x366a2a[_0x5758('0x2e')][_0x5758('0x1e')]);}_0x21baab['order']=qs[_0x5758('0x36')](_0x366a2a[_0x5758('0x2e')]['sort']);_0x21baab['where']=qs['filters'](_[_0x5758('0x37')](_0x366a2a[_0x5758('0x2e')],_0x34c264['filters']),_0x2ef246);if(_0x366a2a['query']['filter']){_0x21baab['where']=_[_0x5758('0x38')](_0x21baab[_0x5758('0x39')],{'$or':_['map'](_0x2ef246,function(_0x14a051){if(_0x14a051[_0x5758('0x3a')]!==_0x5758('0x3b')){var _0x405438={};_0x405438[_0x14a051[_0x5758('0x29')]]={'$like':'%'+_0x366a2a[_0x5758('0x2e')]['filter']+'%'};return _0x405438;}})});}_0x21baab=_[_0x5758('0x38')]({},_0x21baab,_0x366a2a[_0x5758('0x3c')]);var _0x2507fc={'where':_0x21baab['where']};return db[_0x5758('0x3d')][_0x5758('0x21')](_0x2507fc)[_0x5758('0x3e')](function(_0x241dd9){_0x486201[_0x5758('0x21')]=_0x241dd9;if(_0x366a2a[_0x5758('0x2e')][_0x5758('0x3f')]){_0x21baab[_0x5758('0x40')]=[{'all':!![]}];}return db[_0x5758('0x3d')][_0x5758('0x41')](_0x21baab);})[_0x5758('0x3e')](function(_0x51681d){_0x486201[_0x5758('0x42')]=_0x51681d;return _0x486201;})[_0x5758('0x3e')](respondWithFilteredResult(_0x585942,_0x21baab))[_0x5758('0x43')](handleError(_0x585942,null));};exports[_0x5758('0x44')]=function(_0x33a1e8,_0x2b806e){var _0x1ba0ba={'raw':!![],'where':{'id':_0x33a1e8[_0x5758('0x45')]['id']}},_0x30a1c2={};_0x30a1c2[_0x5758('0x30')]=_[_0x5758('0x46')](db[_0x5758('0x3d')][_0x5758('0x2c')]);_0x30a1c2['query']=_['keys'](_0x33a1e8[_0x5758('0x2e')]);_0x30a1c2[_0x5758('0x47')]=_[_0x5758('0x2f')](_0x30a1c2[_0x5758('0x30')],_0x30a1c2['query']);_0x1ba0ba[_0x5758('0x31')]=_[_0x5758('0x2f')](_0x30a1c2[_0x5758('0x30')],qs['fields'](_0x33a1e8[_0x5758('0x2e')][_0x5758('0x32')]));_0x1ba0ba[_0x5758('0x31')]=_0x1ba0ba[_0x5758('0x31')][_0x5758('0x33')]?_0x1ba0ba['attributes']:_0x30a1c2[_0x5758('0x30')];if(_0x33a1e8[_0x5758('0x2e')]['includeAll']){_0x1ba0ba[_0x5758('0x40')]=[{'all':!![]}];}_0x1ba0ba=_[_0x5758('0x38')]({},_0x1ba0ba,_0x33a1e8[_0x5758('0x3c')]);return db[_0x5758('0x3d')][_0x5758('0x48')](_0x1ba0ba)[_0x5758('0x3e')](handleEntityNotFound(_0x2b806e,null))[_0x5758('0x3e')](respondWithResult(_0x2b806e,null))[_0x5758('0x43')](handleError(_0x2b806e,null));};exports[_0x5758('0x49')]=function(_0x2d25ca,_0x121e7d){return db['Dynamics365Field']['create'](_0x2d25ca['body'],{})[_0x5758('0x3e')](respondWithResult(_0x121e7d,0xc9))[_0x5758('0x43')](handleError(_0x121e7d,null));};exports[_0x5758('0x25')]=function(_0x38d65b,_0x4b0c36){if(_0x38d65b[_0x5758('0x4a')]['id']){delete _0x38d65b[_0x5758('0x4a')]['id'];}return db[_0x5758('0x3d')][_0x5758('0x48')]({'where':{'id':_0x38d65b[_0x5758('0x45')]['id']}})[_0x5758('0x3e')](handleEntityNotFound(_0x4b0c36,null))[_0x5758('0x3e')](saveUpdates(_0x38d65b['body'],null))[_0x5758('0x3e')](respondWithResult(_0x4b0c36,null))['catch'](handleError(_0x4b0c36,null));};exports[_0x5758('0x4b')]=function(_0x5c8a34,_0x472abc){return db[_0x5758('0x3d')][_0x5758('0x48')]({'where':{'id':_0x5c8a34[_0x5758('0x45')]['id']}})[_0x5758('0x3e')](handleEntityNotFound(_0x472abc,null))['then'](removeEntity(_0x472abc,null))['catch'](handleError(_0x472abc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 6e4e3dc..c09d7fc 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 _0x383e=['define','int_dynamics365_fields','dynamics365_unique_index','idField','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x2a5cda,_0x3f5eef){var _0xb4c860=function(_0xf2f875){while(--_0xf2f875){_0x2a5cda['push'](_0x2a5cda['shift']());}};_0xb4c860(++_0x3f5eef);}(_0x383e,0x88));var _0xe383=function(_0x520701,_0x3b4a94){_0x520701=_0x520701-0x0;var _0x458579=_0x383e[_0x520701];return _0x458579;};'use strict';var _=require('lodash');var util=require(_0xe383('0x0'));var logger=require('../../config/logger')(_0xe383('0x1'));var moment=require('moment');var BPromise=require(_0xe383('0x2'));var rp=require(_0xe383('0x3'));var fs=require('fs');var path=require(_0xe383('0x4'));var rimraf=require(_0xe383('0x5'));var config=require(_0xe383('0x6'));var attributes=require(_0xe383('0x7'));module['exports']=function(_0x58e829,_0x3b8b1e){return _0x58e829[_0xe383('0x8')]('Dynamics365Field',attributes,{'tableName':_0xe383('0x9'),'paranoid':![],'indexes':[{'name':_0xe383('0xa'),'fields':[_0xe383('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc07=['exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','util','api','bluebird','request-promise','path','./intDynamics365Field.attributes'];(function(_0x26c19d,_0x3f7b9b){var _0x37d676=function(_0x4d091e){while(--_0x4d091e){_0x26c19d['push'](_0x26c19d['shift']());}};_0x37d676(++_0x3f7b9b);}(_0xbc07,0x118));var _0x7bc0=function(_0x2d8be4,_0x23d58b){_0x2d8be4=_0x2d8be4-0x0;var _0x47a4ed=_0xbc07[_0x2d8be4];return _0x47a4ed;};'use strict';var _=require('lodash');var util=require(_0x7bc0('0x0'));var logger=require('../../config/logger')(_0x7bc0('0x1'));var moment=require('moment');var BPromise=require(_0x7bc0('0x2'));var rp=require(_0x7bc0('0x3'));var fs=require('fs');var path=require(_0x7bc0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7bc0('0x5'));module[_0x7bc0('0x6')]=function(_0x1a4ab3,_0x5ecefe){return _0x1a4ab3[_0x7bc0('0x7')]('Dynamics365Field',attributes,{'tableName':_0x7bc0('0x8'),'paranoid':![],'indexes':[{'name':_0x7bc0('0x9'),'fields':[_0x7bc0('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index eeb52ae..b75aaeb 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 _0xe363=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x39f2f7,_0x3cf0df){var _0x36b4b5=function(_0x428794){while(--_0x428794){_0x39f2f7['push'](_0x39f2f7['shift']());}};_0x36b4b5(++_0x3cf0df);}(_0xe363,0x1af));var _0x3e36=function(_0x5f0e60,_0x303f9a){_0x5f0e60=_0x5f0e60-0x0;var _0x528801=_0xe363[_0x5f0e60];return _0x528801;};'use strict';var _=require(_0x3e36('0x0'));var util=require(_0x3e36('0x1'));var moment=require(_0x3e36('0x2'));var BPromise=require(_0x3e36('0x3'));var rs=require(_0x3e36('0x4'));var fs=require('fs');var Redis=require(_0x3e36('0x5'));var db=require(_0x3e36('0x6'))['db'];var utils=require(_0x3e36('0x7'));var logger=require(_0x3e36('0x8'))(_0x3e36('0x9'));var config=require(_0x3e36('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x502431,_0x52ece6,_0xf1611e){return new BPromise(function(_0xe5c829,_0x1b71c0){return client[_0x3e36('0xc')](_0x502431,_0xf1611e)[_0x3e36('0xd')](function(_0x35cba3){logger[_0x3e36('0xe')](_0x3e36('0xf'),_0x52ece6,_0x3e36('0x10'));logger[_0x3e36('0x11')](_0x3e36('0x12'),_0x52ece6,_0x3e36('0x10'),JSON['stringify'](_0x35cba3));if(_0x35cba3[_0x3e36('0x13')]){if(_0x35cba3[_0x3e36('0x13')][_0x3e36('0x14')]===0x1f4){logger[_0x3e36('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x52ece6,_0x35cba3['error'][_0x3e36('0x15')]);return _0x1b71c0(_0x35cba3[_0x3e36('0x13')]['message']);}logger[_0x3e36('0x13')](_0x3e36('0xf'),_0x52ece6,_0x35cba3[_0x3e36('0x13')]['message']);return _0xe5c829(_0x35cba3[_0x3e36('0x13')][_0x3e36('0x15')]);}else{logger[_0x3e36('0xe')](_0x3e36('0xf'),_0x52ece6,_0x3e36('0x10'));_0xe5c829(_0x35cba3[_0x3e36('0x16')]['message']);}})['catch'](function(_0x5469a3){logger[_0x3e36('0x13')](_0x3e36('0xf'),_0x52ece6,_0x5469a3);_0x1b71c0(_0x5469a3);});});} \ No newline at end of file +var _0xa68e=['rpc','../../config/environment','client','http','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0xa68e,0x116));var _0xea68=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0xa68e[_0x2ca0cf];return _0x12e852;};'use strict';var _=require(_0xea68('0x0'));var util=require(_0xea68('0x1'));var moment=require(_0xea68('0x2'));var BPromise=require(_0xea68('0x3'));var rs=require(_0xea68('0x4'));var fs=require('fs');var Redis=require(_0xea68('0x5'));var db=require(_0xea68('0x6'))['db'];var utils=require(_0xea68('0x7'));var logger=require('../../config/logger')(_0xea68('0x8'));var config=require(_0xea68('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xea68('0xa')][_0xea68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11bd20,_0x412bb5,_0x3945f5){return new BPromise(function(_0xd269ef,_0x224ec7){return client['request'](_0x11bd20,_0x3945f5)['then'](function(_0x509113){logger[_0xea68('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x412bb5,_0xea68('0xd'));logger[_0xea68('0xe')](_0xea68('0xf'),_0x412bb5,_0xea68('0xd'),JSON[_0xea68('0x10')](_0x509113));if(_0x509113[_0xea68('0x11')]){if(_0x509113[_0xea68('0x11')][_0xea68('0x12')]===0x1f4){logger[_0xea68('0x11')](_0xea68('0x13'),_0x412bb5,_0x509113[_0xea68('0x11')]['message']);return _0x224ec7(_0x509113['error'][_0xea68('0x14')]);}logger[_0xea68('0x11')](_0xea68('0x13'),_0x412bb5,_0x509113['error'][_0xea68('0x14')]);return _0xd269ef(_0x509113[_0xea68('0x11')]['message']);}else{logger[_0xea68('0xc')](_0xea68('0x13'),_0x412bb5,_0xea68('0xd'));_0xd269ef(_0x509113[_0xea68('0x15')][_0xea68('0x14')]);}})['catch'](function(_0x12b365){logger[_0xea68('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x412bb5,_0x12b365);_0x224ec7(_0x12b365);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1273056..7866a11 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 _0x8490=['update','delete','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','get','/:id/fields','getFields','create','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8490,0xf9));var _0x0849=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x8490[_0x5f309e];return _0x487b5e;};'use strict';var multer=require('multer');var util=require(_0x0849('0x0'));var path=require(_0x0849('0x1'));var timeout=require(_0x0849('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0849('0x3'));var auth=require(_0x0849('0x4'));var interaction=require(_0x0849('0x5'));var config=require(_0x0849('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x0849('0x7')](),controller[_0x0849('0x8')]);router['get'](_0x0849('0x9'),auth[_0x0849('0x7')](),controller['show']);router['get'](_0x0849('0xa'),auth[_0x0849('0x7')](),controller[_0x0849('0xb')]);router[_0x0849('0xc')](_0x0849('0xd'),auth['isAuthenticated'](),controller[_0x0849('0xe')]);router['post']('/',auth[_0x0849('0x7')](),controller[_0x0849('0xf')]);router[_0x0849('0x10')]('/:id/configurations',auth[_0x0849('0x7')](),controller['addConfiguration']);router['put'](_0x0849('0x9'),auth['isAuthenticated'](),controller[_0x0849('0x11')]);router[_0x0849('0x12')](_0x0849('0x9'),auth[_0x0849('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6da0=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/configurations','create','post'];(function(_0x28951d,_0x336a75){var _0x527c69=function(_0x28b919){while(--_0x28b919){_0x28951d['push'](_0x28951d['shift']());}};_0x527c69(++_0x336a75);}(_0x6da0,0x16d));var _0x06da=function(_0x386e84,_0x56e08a){_0x386e84=_0x386e84-0x0;var _0x3a7941=_0x6da0[_0x386e84];return _0x3a7941;};'use strict';var multer=require(_0x06da('0x0'));var util=require('util');var path=require(_0x06da('0x1'));var timeout=require(_0x06da('0x2'));var express=require(_0x06da('0x3'));var router=express[_0x06da('0x4')]();var fs_extra=require(_0x06da('0x5'));var auth=require(_0x06da('0x6'));var interaction=require(_0x06da('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x06da('0x8')]('/',auth[_0x06da('0x9')](),controller[_0x06da('0xa')]);router[_0x06da('0x8')](_0x06da('0xb'),auth[_0x06da('0x9')](),controller['show']);router[_0x06da('0x8')](_0x06da('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x06da('0x8')]('/:id/fields',auth[_0x06da('0x9')](),controller['getFields']);router['post']('/',auth[_0x06da('0x9')](),controller[_0x06da('0xd')]);router[_0x06da('0xe')]('/:id/configurations',auth[_0x06da('0x9')](),controller['addConfiguration']);router[_0x06da('0xf')](_0x06da('0xb'),auth[_0x06da('0x9')](),controller[_0x06da('0x10')]);router[_0x06da('0x11')](_0x06da('0xb'),auth[_0x06da('0x9')](),controller[_0x06da('0x12')]);module[_0x06da('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d36ebd6..7392cd7 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77e6=['STRING','username','sequelize','exports'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x77e6,0x1a6));var _0x677e=function(_0x2811a9,_0x387fd9){_0x2811a9=_0x2811a9-0x0;var _0x489682=_0x77e6[_0x2811a9];return _0x489682;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'name':{'type':Sequelize[_0x677e('0x2')]},'description':{'type':Sequelize[_0x677e('0x2')]},'username':{'type':Sequelize[_0x677e('0x2')],'unique':_0x677e('0x3')},'apiKey':{'type':Sequelize[_0x677e('0x2')]},'remoteUri':{'type':Sequelize[_0x677e('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x677e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5ddd87,_0x4cee42){var _0x4e4161=function(_0x50fb9d){while(--_0x50fb9d){_0x5ddd87['push'](_0x5ddd87['shift']());}};_0x4e4161(++_0x4cee42);}(_0x5c3c,0x132));var _0xc5c3=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5c3c[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 64ddaad..29d5cc1 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 _0xb9a7=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','FreshdeskAccount','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getDescriptions','FreshdeskConfiguration','getFields','apiKey','slice','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','subject','agent','description','group','source','ticket_type','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','statusCode','stringify','send','test','Wrong\x20credentials','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb9a7,0x112));var _0x7b9a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb9a7[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32f616,_0xec5949){_0xec5949=_0xec5949||0xcc;return function(_0x5e3875){if(_0x5e3875){return _0x32f616[_0x7b9a('0x14')](_0xec5949);}return _0x32f616[_0x7b9a('0x15')](_0xec5949)['end']();};}function respondWithResult(_0xb157e5,_0xde180d){_0xde180d=_0xde180d||0xc8;return function(_0x6fa16a){if(_0x6fa16a){return _0xb157e5[_0x7b9a('0x15')](_0xde180d)[_0x7b9a('0x16')](_0x6fa16a);}};}function respondWithFilteredResult(_0x346daa,_0x22a7e4){return function(_0x35e602){if(_0x35e602){var _0x2f1899=typeof _0x22a7e4['offset']===_0x7b9a('0x17')&&typeof _0x22a7e4['limit']===_0x7b9a('0x17');var _0xa217cb=_0x35e602[_0x7b9a('0x18')];var _0x169d16=_0x2f1899?0x0:_0x22a7e4[_0x7b9a('0x19')];var _0x180a67=_0x2f1899?_0x35e602[_0x7b9a('0x18')]:_0x22a7e4[_0x7b9a('0x19')]+_0x22a7e4[_0x7b9a('0x1a')];var _0x588c48;if(_0x180a67>=_0xa217cb){_0x180a67=_0xa217cb;_0x588c48=0xc8;}else{_0x588c48=0xce;}_0x346daa[_0x7b9a('0x15')](_0x588c48);return _0x346daa[_0x7b9a('0x1b')](_0x7b9a('0x1c'),_0x169d16+'-'+_0x180a67+'/'+_0xa217cb)['json'](_0x35e602);}return null;};}function patchUpdates(_0x993048){return function(_0x59a64d){try{jsonpatch[_0x7b9a('0x1d')](_0x59a64d,_0x993048,!![]);}catch(_0x517e93){return BPromise[_0x7b9a('0x1e')](_0x517e93);}return _0x59a64d[_0x7b9a('0x1f')]();};}function saveUpdates(_0x23d812,_0x54fda7){return function(_0x411eea){if(_0x411eea){return _0x411eea[_0x7b9a('0x20')](_0x23d812)['then'](function(_0x35aca7){return _0x35aca7;});}return null;};}function removeEntity(_0x374dca,_0x269c07){return function(_0x2f7d34){if(_0x2f7d34){return _0x2f7d34[_0x7b9a('0x21')]()['then'](function(){_0x374dca[_0x7b9a('0x15')](0xcc)[_0x7b9a('0x22')]();});}};}function handleEntityNotFound(_0x5809f5,_0x39b7ec){return function(_0x4fa111){if(!_0x4fa111){_0x5809f5[_0x7b9a('0x14')](0x194);}return _0x4fa111;};}function handleError(_0x3091ab,_0x4c2271){_0x4c2271=_0x4c2271||0x1f4;return function(_0x55d01c){logger[_0x7b9a('0x23')](_0x55d01c['stack']);if(_0x55d01c['name']){delete _0x55d01c[_0x7b9a('0x24')];}_0x3091ab['status'](_0x4c2271)['send'](_0x55d01c);};}exports[_0x7b9a('0x25')]=function(_0x4d5880,_0x5c89b6){var _0x314b6d={},_0x4fee38={},_0x1553ae={'count':0x0,'rows':[]};var _0x2e6144=_[_0x7b9a('0x26')](db['FreshdeskAccount'][_0x7b9a('0x27')],function(_0x2ce78b){return{'name':_0x2ce78b[_0x7b9a('0x28')],'type':_0x2ce78b[_0x7b9a('0x29')][_0x7b9a('0x2a')]};});_0x4fee38[_0x7b9a('0x2b')]=_['map'](_0x2e6144,'name');_0x4fee38[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x4d5880[_0x7b9a('0x2c')]);_0x4fee38['filters']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],_0x4fee38['query']);_0x314b6d['attributes']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],qs['fields'](_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x314b6d[_0x7b9a('0x30')]=_0x314b6d[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x314b6d['attributes']:_0x4fee38[_0x7b9a('0x2b')];if(!_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x32')](_0x7b9a('0x33'))){_0x314b6d[_0x7b9a('0x1a')]=qs[_0x7b9a('0x1a')](_0x4d5880['query']['limit']);_0x314b6d[_0x7b9a('0x19')]=qs[_0x7b9a('0x19')](_0x4d5880['query'][_0x7b9a('0x19')]);}_0x314b6d[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_0x4d5880['query'][_0x7b9a('0x35')]);_0x314b6d[_0x7b9a('0x36')]=qs['filters'](_['pick'](_0x4d5880[_0x7b9a('0x2c')],_0x4fee38[_0x7b9a('0x37')]),_0x2e6144);if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x314b6d[_0x7b9a('0x36')]=_[_0x7b9a('0x39')](_0x314b6d[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x2e6144,function(_0x4af212){if(_0x4af212[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x213370={};_0x213370[_0x4af212[_0x7b9a('0x24')]]={'$like':'%'+_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x213370;}})});}_0x314b6d=_[_0x7b9a('0x39')]({},_0x314b6d,_0x4d5880[_0x7b9a('0x3a')]);var _0x5e504f={'where':_0x314b6d[_0x7b9a('0x36')]};return db[_0x7b9a('0x3b')][_0x7b9a('0x18')](_0x5e504f)[_0x7b9a('0x3c')](function(_0x5af103){_0x1553ae[_0x7b9a('0x18')]=_0x5af103;if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x314b6d[_0x7b9a('0x3e')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7b9a('0x3f')](_0x314b6d);})['then'](function(_0x1ee576){_0x1553ae[_0x7b9a('0x40')]=_0x1ee576;return _0x1553ae;})[_0x7b9a('0x3c')](respondWithFilteredResult(_0x5c89b6,_0x314b6d))[_0x7b9a('0x41')](handleError(_0x5c89b6,null));};exports[_0x7b9a('0x42')]=function(_0x41f541,_0x56e274){var _0x33edc6={'raw':![],'where':{'id':_0x41f541[_0x7b9a('0x43')]['id']}},_0x85770={};_0x85770['model']=_['keys'](db[_0x7b9a('0x3b')][_0x7b9a('0x27')]);_0x85770[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x41f541[_0x7b9a('0x2c')]);_0x85770[_0x7b9a('0x37')]=_['intersection'](_0x85770['model'],_0x85770['query']);_0x33edc6[_0x7b9a('0x30')]=_[_0x7b9a('0x2e')](_0x85770['model'],qs[_0x7b9a('0x2f')](_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x33edc6['attributes']=_0x33edc6[_0x7b9a('0x30')]['length']?_0x33edc6[_0x7b9a('0x30')]:_0x85770[_0x7b9a('0x2b')];if(_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x33edc6[_0x7b9a('0x3e')]=[{'all':!![]}];}_0x33edc6=_['merge']({},_0x33edc6,_0x41f541[_0x7b9a('0x3a')]);return db['FreshdeskAccount'][_0x7b9a('0x44')](_0x33edc6)['then'](handleEntityNotFound(_0x56e274,null))['then'](respondWithResult(_0x56e274,null))[_0x7b9a('0x41')](handleError(_0x56e274,null));};exports[_0x7b9a('0x45')]=function(_0x717d08,_0x43cba){return db[_0x7b9a('0x3b')][_0x7b9a('0x45')](_0x717d08[_0x7b9a('0x46')],{})[_0x7b9a('0x3c')](respondWithResult(_0x43cba,0xc9))[_0x7b9a('0x41')](handleError(_0x43cba,null));};exports['update']=function(_0x1d7957,_0x4044ba){if(_0x1d7957['body']['id']){delete _0x1d7957['body']['id'];}return db['FreshdeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x1d7957[_0x7b9a('0x43')]['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x4044ba,null))[_0x7b9a('0x3c')](saveUpdates(_0x1d7957['body'],null))[_0x7b9a('0x3c')](respondWithResult(_0x4044ba,null))[_0x7b9a('0x41')](handleError(_0x4044ba,null));};exports[_0x7b9a('0x21')]=function(_0x33b200,_0x2d083b){return db['FreshdeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x33b200['params']['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x2d083b,null))[_0x7b9a('0x3c')](removeEntity(_0x2d083b,null))[_0x7b9a('0x41')](handleError(_0x2d083b,null));};exports[_0x7b9a('0x47')]=function(_0x52f2ca,_0xd42491,_0x2d353f){var _0x354a87={};var _0x28855a={};var _0x2b0db5;var _0x3e2f1b;return db[_0x7b9a('0x3b')]['findOne']({'where':{'id':_0x52f2ca['params']['id']}})['then'](handleEntityNotFound(_0xd42491,null))[_0x7b9a('0x3c')](function(_0x2f8929){if(_0x2f8929){_0x2b0db5=_0x2f8929;_0x28855a['model']=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x28855a[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x52f2ca[_0x7b9a('0x2c')]);_0x28855a[_0x7b9a('0x37')]=_[_0x7b9a('0x2e')](_0x28855a[_0x7b9a('0x2b')],_0x28855a[_0x7b9a('0x2c')]);_0x354a87[_0x7b9a('0x30')]=_['intersection'](_0x28855a[_0x7b9a('0x2b')],qs['fields'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x354a87[_0x7b9a('0x30')]=_0x354a87[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x354a87['attributes']:_0x28855a[_0x7b9a('0x2b')];_0x354a87['order']=qs[_0x7b9a('0x35')](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x35')]);_0x354a87['where']=qs['filters'](_['pick'](_0x52f2ca['query'],_0x28855a[_0x7b9a('0x37')]));if(_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x354a87['where']=_[_0x7b9a('0x39')](_0x354a87[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x354a87[_0x7b9a('0x30')],function(_0xea7b37){var _0x4c3939={};_0x4c3939[_0xea7b37]={'$like':'%'+_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x4c3939;})});}_0x354a87=_[_0x7b9a('0x39')]({},_0x354a87,_0x52f2ca['options']);return _0x2b0db5['getConfigurations'](_0x354a87);}})['then'](function(_0x14e2d5){if(_0x14e2d5){_0x3e2f1b=_0x14e2d5[_0x7b9a('0x31')];if(!_0x52f2ca[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x33'))){_0x354a87[_0x7b9a('0x1a')]=qs['limit'](_0x52f2ca[_0x7b9a('0x2c')]['limit']);_0x354a87[_0x7b9a('0x19')]=qs['offset'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x19')]);}return _0x2b0db5[_0x7b9a('0x47')](_0x354a87);}})[_0x7b9a('0x3c')](function(_0x5d45ae){if(_0x5d45ae){return _0x5d45ae?{'count':_0x3e2f1b,'rows':_0x5d45ae}:null;}})[_0x7b9a('0x3c')](respondWithResult(_0xd42491,null))[_0x7b9a('0x41')](handleError(_0xd42491,null));};exports[_0x7b9a('0x48')]=function(_0x273134,_0x567328,_0x239b62){if(_0x273134['body']['id']){delete _0x273134[_0x7b9a('0x46')]['id'];}return db['FreshdeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x273134['params']['id']}})['then'](handleEntityNotFound(_0x567328,null))['then'](function(_0x48442a){if(_0x48442a){_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4a')]=_0x48442a['id'];_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4b')]=integrations['getSubjects'](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134['body'][_0x7b9a('0x29')]);_0x273134['body']['Descriptions']=integrations[_0x7b9a('0x4c')](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134[_0x7b9a('0x46')]['type']);return db[_0x7b9a('0x4d')][_0x7b9a('0x45')](_0x273134[_0x7b9a('0x46')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x7b9a('0x3c')](respondWithResult(_0x567328,null))[_0x7b9a('0x41')](handleError(_0x567328,null));};exports[_0x7b9a('0x4e')]=function(_0x2092b6,_0x261a43,_0x147d23){var _0x45014b='';return db['FreshdeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x2092b6[_0x7b9a('0x43')]['id']},'attributes':['id','remoteUri',_0x7b9a('0x4f')]})[_0x7b9a('0x3c')](handleEntityNotFound(_0x261a43,null))[_0x7b9a('0x3c')](function(_0x5aca65){if(_0x5aca65){_0x45014b=_0x5aca65['remoteUri'];var _0x34feb3=_0x45014b[_0x7b9a('0x50')](-0x1);if(_0x34feb3==='/'){_0x45014b=_0x45014b['substring'](0x0,_0x45014b[_0x7b9a('0x51')](_0x34feb3));}return rp({'method':'GET','uri':util[_0x7b9a('0x52')](_0x7b9a('0x53'),_0x45014b,_0x7b9a('0x54')),'headers':{'Authorization':util['format'](_0x7b9a('0x55'),new Buffer(util[_0x7b9a('0x52')](_0x7b9a('0x56'),_0x5aca65[_0x7b9a('0x4f')]))[_0x7b9a('0x57')]('base64'))},'json':!![]});}})['then'](function(_0x211eff){if(_0x211eff){var _0x6ec5ab=['requester',_0x7b9a('0x58'),_0x7b9a('0x59'),_0x7b9a('0x5a'),'status','priority',_0x7b9a('0x5b'),_0x7b9a('0x5c'),_0x7b9a('0x5d'),_0x7b9a('0x5b'),'company'];_[_0x7b9a('0x5e')](_0x211eff,function(_0x276da1){return _0x6ec5ab[_0x7b9a('0x5f')](_0x276da1['name'])||!_0x276da1['default']&&_0x276da1[_0x7b9a('0x29')]!==_0x7b9a('0x60')&&_0x276da1[_0x7b9a('0x29')]!==_0x7b9a('0x61');});return{'count':_0x211eff['length'],'rows':_[_0x7b9a('0x26')](_0x211eff,function(_0x300a44){return{'id':_0x300a44['name'],'name':_0x300a44[_0x7b9a('0x62')],'custom':!_0x300a44[_0x7b9a('0x63')],'options':_0x300a44[_0x7b9a('0x64')]?_[_0x7b9a('0x26')](_0x300a44[_0x7b9a('0x64')],function(_0x3316af){return{'name':_[_0x7b9a('0x65')](_0x3316af),'value':_0x3316af};}):[]};})};}})[_0x7b9a('0x3c')](respondWithResult(_0x261a43,null))[_0x7b9a('0x41')](function(_0x131e20){var _0x4c41dc=_0x2092b6['query']['test']?0x1f4:_0x131e20[_0x7b9a('0x66')]||0x1f4;logger[_0x7b9a('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x7b9a('0x4e'),_0x4c41dc,JSON[_0x7b9a('0x67')](_0x131e20));delete _0x131e20['name'];if(_0x4c41dc===0x191){_0x4c41dc=0x190;}_0x261a43[_0x7b9a('0x15')](_0x4c41dc)[_0x7b9a('0x68')](_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x69')]?{'message':_0x7b9a('0x6a'),'statusCode':_0x131e20[_0x7b9a('0x66')]}:_0x131e20);});}; \ No newline at end of file +var _0x74f0=['%s/%s','api/v2/ticket_fields','base64','requester','subject','agent','group','source','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','statusCode','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','FreshdeskAccount','include','findAll','rows','catch','show','params','options','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','AccountId','getSubjects','Descriptions','channel','FreshdeskField','Subjects','getFields','remoteUri','apiKey','lastIndexOf','GET','format'];(function(_0x88a523,_0x4c930c){var _0x3deebf=function(_0x9d3877){while(--_0x9d3877){_0x88a523['push'](_0x88a523['shift']());}};_0x3deebf(++_0x4c930c);}(_0x74f0,0xf3));var _0x074f=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x74f0[_0x7d62cb];return _0x3a6266;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x074f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x074f('0x1'));var moment=require(_0x074f('0x2'));var BPromise=require(_0x074f('0x3'));var Mustache=require(_0x074f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x074f('0x5'));var csv=require(_0x074f('0x6'));var ejs=require(_0x074f('0x7'));var fs=require('fs');var fs_extra=require(_0x074f('0x8'));var _=require(_0x074f('0x9'));var squel=require(_0x074f('0xa'));var crypto=require(_0x074f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x074f('0xc'));var toCsv=require(_0x074f('0x6'));var querystring=require('querystring');var Papa=require(_0x074f('0xd'));var Redis=require(_0x074f('0xe'));var authService=require(_0x074f('0xf'));var qs=require(_0x074f('0x10'));var as=require(_0x074f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x074f('0x12'));var utils=require(_0x074f('0x13'));var config=require(_0x074f('0x14'));var licenseUtil=require(_0x074f('0x15'));var db=require(_0x074f('0x16'))['db'];var integrations=require(_0x074f('0x17'));function respondWithStatusCode(_0x1d3304,_0x46cea0){_0x46cea0=_0x46cea0||0xcc;return function(_0x2c4596){if(_0x2c4596){return _0x1d3304['sendStatus'](_0x46cea0);}return _0x1d3304[_0x074f('0x18')](_0x46cea0)['end']();};}function respondWithResult(_0x12ed92,_0x3bf07f){_0x3bf07f=_0x3bf07f||0xc8;return function(_0x220d0b){if(_0x220d0b){return _0x12ed92[_0x074f('0x18')](_0x3bf07f)[_0x074f('0x19')](_0x220d0b);}};}function respondWithFilteredResult(_0x237960,_0x7e19fe){return function(_0x1edf9c){if(_0x1edf9c){var _0x3f1a47=typeof _0x7e19fe[_0x074f('0x1a')]===_0x074f('0x1b')&&typeof _0x7e19fe['limit']===_0x074f('0x1b');var _0x367b52=_0x1edf9c[_0x074f('0x1c')];var _0x3facd8=_0x3f1a47?0x0:_0x7e19fe[_0x074f('0x1a')];var _0x1c5406=_0x3f1a47?_0x1edf9c['count']:_0x7e19fe['offset']+_0x7e19fe[_0x074f('0x1d')];var _0x5d8c10;if(_0x1c5406>=_0x367b52){_0x1c5406=_0x367b52;_0x5d8c10=0xc8;}else{_0x5d8c10=0xce;}_0x237960['status'](_0x5d8c10);return _0x237960[_0x074f('0x1e')](_0x074f('0x1f'),_0x3facd8+'-'+_0x1c5406+'/'+_0x367b52)[_0x074f('0x19')](_0x1edf9c);}return null;};}function patchUpdates(_0x5feafd){return function(_0xfa07ea){try{jsonpatch[_0x074f('0x20')](_0xfa07ea,_0x5feafd,!![]);}catch(_0x23406f){return BPromise[_0x074f('0x21')](_0x23406f);}return _0xfa07ea[_0x074f('0x22')]();};}function saveUpdates(_0x2c3b23,_0x335170){return function(_0x3bc3f6){if(_0x3bc3f6){return _0x3bc3f6[_0x074f('0x23')](_0x2c3b23)[_0x074f('0x24')](function(_0x39e502){return _0x39e502;});}return null;};}function removeEntity(_0x1bd2c7,_0xdfa2d8){return function(_0x504632){if(_0x504632){return _0x504632[_0x074f('0x25')]()[_0x074f('0x24')](function(){_0x1bd2c7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e35a3,_0x1051ce){return function(_0x22ce4f){if(!_0x22ce4f){_0x4e35a3[_0x074f('0x26')](0x194);}return _0x22ce4f;};}function handleError(_0x3eb67d,_0x5aabea){_0x5aabea=_0x5aabea||0x1f4;return function(_0x21cec2){logger[_0x074f('0x27')](_0x21cec2[_0x074f('0x28')]);if(_0x21cec2[_0x074f('0x29')]){delete _0x21cec2[_0x074f('0x29')];}_0x3eb67d[_0x074f('0x18')](_0x5aabea)['send'](_0x21cec2);};}exports[_0x074f('0x2a')]=function(_0x3246cf,_0x2b98d7){var _0x53b76d={},_0x1ee652={},_0x5d6edd={'count':0x0,'rows':[]};var _0x4fcfb5=_[_0x074f('0x2b')](db['FreshdeskAccount'][_0x074f('0x2c')],function(_0x214611){return{'name':_0x214611[_0x074f('0x2d')],'type':_0x214611[_0x074f('0x2e')]['key']};});_0x1ee652[_0x074f('0x2f')]=_[_0x074f('0x2b')](_0x4fcfb5,_0x074f('0x29'));_0x1ee652['query']=_[_0x074f('0x30')](_0x3246cf[_0x074f('0x31')]);_0x1ee652[_0x074f('0x32')]=_[_0x074f('0x33')](_0x1ee652[_0x074f('0x2f')],_0x1ee652['query']);_0x53b76d[_0x074f('0x34')]=_[_0x074f('0x33')](_0x1ee652['model'],qs[_0x074f('0x35')](_0x3246cf[_0x074f('0x31')][_0x074f('0x35')]));_0x53b76d['attributes']=_0x53b76d[_0x074f('0x34')][_0x074f('0x36')]?_0x53b76d['attributes']:_0x1ee652[_0x074f('0x2f')];if(!_0x3246cf[_0x074f('0x31')][_0x074f('0x37')](_0x074f('0x38'))){_0x53b76d[_0x074f('0x1d')]=qs[_0x074f('0x1d')](_0x3246cf[_0x074f('0x31')][_0x074f('0x1d')]);_0x53b76d[_0x074f('0x1a')]=qs[_0x074f('0x1a')](_0x3246cf['query'][_0x074f('0x1a')]);}_0x53b76d[_0x074f('0x39')]=qs['sort'](_0x3246cf[_0x074f('0x31')][_0x074f('0x3a')]);_0x53b76d[_0x074f('0x3b')]=qs[_0x074f('0x32')](_[_0x074f('0x3c')](_0x3246cf[_0x074f('0x31')],_0x1ee652[_0x074f('0x32')]),_0x4fcfb5);if(_0x3246cf['query'][_0x074f('0x3d')]){_0x53b76d[_0x074f('0x3b')]=_[_0x074f('0x3e')](_0x53b76d[_0x074f('0x3b')],{'$or':_[_0x074f('0x2b')](_0x4fcfb5,function(_0xdb341a){if(_0xdb341a['type']!==_0x074f('0x3f')){var _0x19866e={};_0x19866e[_0xdb341a['name']]={'$like':'%'+_0x3246cf[_0x074f('0x31')][_0x074f('0x3d')]+'%'};return _0x19866e;}})});}_0x53b76d=_[_0x074f('0x3e')]({},_0x53b76d,_0x3246cf['options']);var _0x4e9c55={'where':_0x53b76d['where']};return db[_0x074f('0x40')][_0x074f('0x1c')](_0x4e9c55)[_0x074f('0x24')](function(_0x5b9a17){_0x5d6edd[_0x074f('0x1c')]=_0x5b9a17;if(_0x3246cf[_0x074f('0x31')]['includeAll']){_0x53b76d[_0x074f('0x41')]=[{'all':!![]}];}return db[_0x074f('0x40')][_0x074f('0x42')](_0x53b76d);})[_0x074f('0x24')](function(_0x3a6e10){_0x5d6edd[_0x074f('0x43')]=_0x3a6e10;return _0x5d6edd;})[_0x074f('0x24')](respondWithFilteredResult(_0x2b98d7,_0x53b76d))[_0x074f('0x44')](handleError(_0x2b98d7,null));};exports[_0x074f('0x45')]=function(_0x406d33,_0x58ff4d){var _0x1bee97={'raw':![],'where':{'id':_0x406d33[_0x074f('0x46')]['id']}},_0x595931={};_0x595931['model']=_[_0x074f('0x30')](db['FreshdeskAccount'][_0x074f('0x2c')]);_0x595931['query']=_[_0x074f('0x30')](_0x406d33[_0x074f('0x31')]);_0x595931[_0x074f('0x32')]=_[_0x074f('0x33')](_0x595931[_0x074f('0x2f')],_0x595931[_0x074f('0x31')]);_0x1bee97[_0x074f('0x34')]=_['intersection'](_0x595931[_0x074f('0x2f')],qs[_0x074f('0x35')](_0x406d33[_0x074f('0x31')][_0x074f('0x35')]));_0x1bee97['attributes']=_0x1bee97[_0x074f('0x34')]['length']?_0x1bee97[_0x074f('0x34')]:_0x595931[_0x074f('0x2f')];if(_0x406d33[_0x074f('0x31')]['includeAll']){_0x1bee97[_0x074f('0x41')]=[{'all':!![]}];}_0x1bee97=_['merge']({},_0x1bee97,_0x406d33[_0x074f('0x47')]);return db[_0x074f('0x40')]['find'](_0x1bee97)[_0x074f('0x24')](handleEntityNotFound(_0x58ff4d,null))['then'](respondWithResult(_0x58ff4d,null))[_0x074f('0x44')](handleError(_0x58ff4d,null));};exports[_0x074f('0x48')]=function(_0x598fee,_0x57c89f){return db['FreshdeskAccount']['create'](_0x598fee[_0x074f('0x49')],{})[_0x074f('0x24')](respondWithResult(_0x57c89f,0xc9))[_0x074f('0x44')](handleError(_0x57c89f,null));};exports[_0x074f('0x23')]=function(_0x53b1e5,_0x1e3364){if(_0x53b1e5[_0x074f('0x49')]['id']){delete _0x53b1e5[_0x074f('0x49')]['id'];}return db[_0x074f('0x40')][_0x074f('0x4a')]({'where':{'id':_0x53b1e5[_0x074f('0x46')]['id']}})[_0x074f('0x24')](handleEntityNotFound(_0x1e3364,null))[_0x074f('0x24')](saveUpdates(_0x53b1e5['body'],null))[_0x074f('0x24')](respondWithResult(_0x1e3364,null))[_0x074f('0x44')](handleError(_0x1e3364,null));};exports[_0x074f('0x25')]=function(_0x306a17,_0x522777){return db[_0x074f('0x40')][_0x074f('0x4a')]({'where':{'id':_0x306a17['params']['id']}})['then'](handleEntityNotFound(_0x522777,null))[_0x074f('0x24')](removeEntity(_0x522777,null))[_0x074f('0x44')](handleError(_0x522777,null));};exports[_0x074f('0x4b')]=function(_0x37f4a8,_0x563343,_0x4ed750){var _0x3db639={};var _0xc38f21={};var _0x2fc9fa;var _0x32684a;return db[_0x074f('0x40')][_0x074f('0x4c')]({'where':{'id':_0x37f4a8[_0x074f('0x46')]['id']}})[_0x074f('0x24')](handleEntityNotFound(_0x563343,null))[_0x074f('0x24')](function(_0x5bda95){if(_0x5bda95){_0x2fc9fa=_0x5bda95;_0xc38f21[_0x074f('0x2f')]=_[_0x074f('0x30')](db[_0x074f('0x4d')][_0x074f('0x2c')]);_0xc38f21[_0x074f('0x31')]=_[_0x074f('0x30')](_0x37f4a8['query']);_0xc38f21[_0x074f('0x32')]=_[_0x074f('0x33')](_0xc38f21['model'],_0xc38f21[_0x074f('0x31')]);_0x3db639[_0x074f('0x34')]=_[_0x074f('0x33')](_0xc38f21[_0x074f('0x2f')],qs[_0x074f('0x35')](_0x37f4a8[_0x074f('0x31')][_0x074f('0x35')]));_0x3db639[_0x074f('0x34')]=_0x3db639[_0x074f('0x34')][_0x074f('0x36')]?_0x3db639['attributes']:_0xc38f21[_0x074f('0x2f')];_0x3db639['order']=qs['sort'](_0x37f4a8[_0x074f('0x31')]['sort']);_0x3db639['where']=qs[_0x074f('0x32')](_[_0x074f('0x3c')](_0x37f4a8[_0x074f('0x31')],_0xc38f21[_0x074f('0x32')]));if(_0x37f4a8[_0x074f('0x31')][_0x074f('0x3d')]){_0x3db639[_0x074f('0x3b')]=_[_0x074f('0x3e')](_0x3db639['where'],{'$or':_['map'](_0x3db639[_0x074f('0x34')],function(_0x3f48b7){var _0x28fedf={};_0x28fedf[_0x3f48b7]={'$like':'%'+_0x37f4a8['query'][_0x074f('0x3d')]+'%'};return _0x28fedf;})});}_0x3db639=_[_0x074f('0x3e')]({},_0x3db639,_0x37f4a8['options']);return _0x2fc9fa['getConfigurations'](_0x3db639);}})[_0x074f('0x24')](function(_0x4e06cb){if(_0x4e06cb){_0x32684a=_0x4e06cb[_0x074f('0x36')];if(!_0x37f4a8[_0x074f('0x31')]['hasOwnProperty'](_0x074f('0x38'))){_0x3db639[_0x074f('0x1d')]=qs[_0x074f('0x1d')](_0x37f4a8[_0x074f('0x31')][_0x074f('0x1d')]);_0x3db639[_0x074f('0x1a')]=qs[_0x074f('0x1a')](_0x37f4a8[_0x074f('0x31')][_0x074f('0x1a')]);}return _0x2fc9fa[_0x074f('0x4b')](_0x3db639);}})[_0x074f('0x24')](function(_0x4556d0){if(_0x4556d0){return _0x4556d0?{'count':_0x32684a,'rows':_0x4556d0}:null;}})['then'](respondWithResult(_0x563343,null))['catch'](handleError(_0x563343,null));};exports['addConfiguration']=function(_0x3766f0,_0x5f3856,_0x2bb228){if(_0x3766f0['body']['id']){delete _0x3766f0[_0x074f('0x49')]['id'];}return db[_0x074f('0x40')]['findOne']({'where':{'id':_0x3766f0[_0x074f('0x46')]['id']}})[_0x074f('0x24')](handleEntityNotFound(_0x5f3856,null))[_0x074f('0x24')](function(_0xfb52ca){if(_0xfb52ca){_0x3766f0[_0x074f('0x49')][_0x074f('0x4e')]=_0xfb52ca['id'];_0x3766f0[_0x074f('0x49')]['Subjects']=integrations[_0x074f('0x4f')](_0x3766f0[_0x074f('0x49')]['channel'],_0x3766f0[_0x074f('0x49')][_0x074f('0x2e')]);_0x3766f0[_0x074f('0x49')][_0x074f('0x50')]=integrations['getDescriptions'](_0x3766f0[_0x074f('0x49')][_0x074f('0x51')],_0x3766f0[_0x074f('0x49')]['type']);return db['FreshdeskConfiguration'][_0x074f('0x48')](_0x3766f0[_0x074f('0x49')],{'include':[{'model':db[_0x074f('0x52')],'as':_0x074f('0x53')},{'model':db[_0x074f('0x52')],'as':'Descriptions'}]});}return null;})[_0x074f('0x24')](respondWithResult(_0x5f3856,null))['catch'](handleError(_0x5f3856,null));};exports[_0x074f('0x54')]=function(_0x7eb0e2,_0x174a0d,_0x16136a){var _0x11c51c='';return db[_0x074f('0x40')][_0x074f('0x4c')]({'where':{'id':_0x7eb0e2[_0x074f('0x46')]['id']},'attributes':['id',_0x074f('0x55'),_0x074f('0x56')]})[_0x074f('0x24')](handleEntityNotFound(_0x174a0d,null))['then'](function(_0x10483b){if(_0x10483b){_0x11c51c=_0x10483b[_0x074f('0x55')];var _0x5af568=_0x11c51c['slice'](-0x1);if(_0x5af568==='/'){_0x11c51c=_0x11c51c['substring'](0x0,_0x11c51c[_0x074f('0x57')](_0x5af568));}return rp({'method':_0x074f('0x58'),'uri':util[_0x074f('0x59')](_0x074f('0x5a'),_0x11c51c,_0x074f('0x5b')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x074f('0x59')]('%s:X',_0x10483b[_0x074f('0x56')]))['toString'](_0x074f('0x5c')))},'json':!![]});}})['then'](function(_0x532ed3){if(_0x532ed3){var _0x304732=[_0x074f('0x5d'),_0x074f('0x5e'),_0x074f('0x5f'),'description',_0x074f('0x18'),'priority',_0x074f('0x60'),_0x074f('0x61'),'ticket_type',_0x074f('0x60'),_0x074f('0x62')];_[_0x074f('0x63')](_0x532ed3,function(_0x4cfb9b){return _0x304732['includes'](_0x4cfb9b[_0x074f('0x29')])||!_0x4cfb9b[_0x074f('0x64')]&&_0x4cfb9b[_0x074f('0x2e')]!==_0x074f('0x65')&&_0x4cfb9b[_0x074f('0x2e')]!==_0x074f('0x66');});return{'count':_0x532ed3[_0x074f('0x36')],'rows':_['map'](_0x532ed3,function(_0xf4da83){return{'id':_0xf4da83[_0x074f('0x29')],'name':_0xf4da83[_0x074f('0x67')],'custom':!_0xf4da83['default'],'options':_0xf4da83[_0x074f('0x68')]?_['map'](_0xf4da83[_0x074f('0x68')],function(_0x46d0c6){return{'name':_[_0x074f('0x69')](_0x46d0c6),'value':_0x46d0c6};}):[]};})};}})[_0x074f('0x24')](respondWithResult(_0x174a0d,null))[_0x074f('0x44')](function(_0x4ad3cc){var _0x347030=_0x7eb0e2[_0x074f('0x31')]['test']?0x1f4:_0x4ad3cc['statusCode']||0x1f4;logger['error'](_0x074f('0x6a'),'getFields',_0x347030,JSON[_0x074f('0x6b')](_0x4ad3cc));delete _0x4ad3cc[_0x074f('0x29')];if(_0x347030===0x191){_0x347030=0x190;}_0x174a0d[_0x074f('0x18')](_0x347030)[_0x074f('0x6c')](_0x7eb0e2[_0x074f('0x31')][_0x074f('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x4ad3cc[_0x074f('0x6e')]}:_0x4ad3cc);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 2ab212d..a7c6ef7 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 _0x0bf8=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x24192c,_0x3bb4d8){var _0x360c14=function(_0x2a0351){while(--_0x2a0351){_0x24192c['push'](_0x24192c['shift']());}};_0x360c14(++_0x3bb4d8);}(_0x0bf8,0x85));var _0x80bf=function(_0x487d6e,_0x590ce7){_0x487d6e=_0x487d6e-0x0;var _0x3d0a2e=_0x0bf8[_0x487d6e];return _0x3d0a2e;};'use strict';var _=require(_0x80bf('0x0'));var util=require(_0x80bf('0x1'));var logger=require(_0x80bf('0x2'))(_0x80bf('0x3'));var moment=require(_0x80bf('0x4'));var BPromise=require(_0x80bf('0x5'));var rp=require(_0x80bf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80bf('0x7'));var config=require(_0x80bf('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x80bf('0x9'));module[_0x80bf('0xa')]=function(_0x4ec97c,_0x5872fd){return _0x4ec97c['define']('FreshdeskAccount',attributes,{'tableName':_0x80bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd381=['../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x20530a,_0xb58828){var _0x5a2397=function(_0x16ece4){while(--_0x16ece4){_0x20530a['push'](_0x20530a['shift']());}};_0x5a2397(++_0xb58828);}(_0xd381,0x1e2));var _0x1d38=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xd381[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x1d38('0x0'));var util=require(_0x1d38('0x1'));var logger=require('../../config/logger')(_0x1d38('0x2'));var moment=require(_0x1d38('0x3'));var BPromise=require(_0x1d38('0x4'));var rp=require(_0x1d38('0x5'));var fs=require('fs');var path=require(_0x1d38('0x6'));var rimraf=require(_0x1d38('0x7'));var config=require(_0x1d38('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x1d38('0x9'));module[_0x1d38('0xa')]=function(_0x1e33bd,_0x176a53){return _0x1e33bd[_0x1d38('0xb')](_0x1d38('0xc'),attributes,{'tableName':_0x1d38('0xd'),'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 14327fc..05a6a93 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 _0xe48a=['../../config/environment','jayson/promise','http','request','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','limit','include','model','map','attributes','info','debug','catch','ShowFreshdeskAccount','find','raw','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x54c811,_0x3bbb57){var _0x35f6b9=function(_0xfdbdb5){while(--_0xfdbdb5){_0x54c811['push'](_0x54c811['shift']());}};_0x35f6b9(++_0x3bbb57);}(_0xe48a,0xad));var _0xae48=function(_0x52b0b2,_0xf6dbf9){_0x52b0b2=_0x52b0b2-0x0;var _0x322769=_0xe48a[_0x52b0b2];return _0x322769;};'use strict';var _=require(_0xae48('0x0'));var util=require('util');var moment=require(_0xae48('0x1'));var BPromise=require('bluebird');var rs=require(_0xae48('0x2'));var fs=require('fs');var Redis=require(_0xae48('0x3'));var db=require(_0xae48('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae48('0x5'))(_0xae48('0x6'));var config=require(_0xae48('0x7'));var jayson=require(_0xae48('0x8'));var client=jayson['client'][_0xae48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x382b6d,_0x5c1cd6,_0xda8b60){return new BPromise(function(_0x4503ca,_0x25b85b){return client[_0xae48('0xa')](_0x382b6d,_0xda8b60)['then'](function(_0x279b5d){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x5c1cd6,_0xae48('0xb'));logger['debug'](_0xae48('0xc'),_0x5c1cd6,_0xae48('0xb'),JSON[_0xae48('0xd')](_0x279b5d));if(_0x279b5d['error']){if(_0x279b5d[_0xae48('0xe')][_0xae48('0xf')]===0x1f4){logger[_0xae48('0xe')](_0xae48('0x10'),_0x5c1cd6,_0x279b5d['error'][_0xae48('0x11')]);return _0x25b85b(_0x279b5d[_0xae48('0xe')][_0xae48('0x11')]);}logger['error'](_0xae48('0x10'),_0x5c1cd6,_0x279b5d[_0xae48('0xe')][_0xae48('0x11')]);return _0x4503ca(_0x279b5d[_0xae48('0xe')][_0xae48('0x11')]);}else{logger['info'](_0xae48('0x10'),_0x5c1cd6,'request\x20sent');_0x4503ca(_0x279b5d[_0xae48('0x12')]['message']);}})['catch'](function(_0x10f592){logger[_0xae48('0xe')](_0xae48('0x10'),_0x5c1cd6,_0x10f592);_0x25b85b(_0x10f592);});});}exports[_0xae48('0x13')]=function(_0x2fb4f3){var _0x178139=this;return new Promise(function(_0x34db70,_0x56d757){return db[_0xae48('0x14')][_0xae48('0x15')]({'raw':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3[_0xae48('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2fb4f3['options']?_0x2fb4f3[_0xae48('0x16')][_0xae48('0x17')]||null:null,'attributes':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3['options']['attributes']||null:null,'limit':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3[_0xae48('0x16')][_0xae48('0x18')]||null:null,'include':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3[_0xae48('0x16')][_0xae48('0x19')]?_['map'](_0x2fb4f3[_0xae48('0x16')][_0xae48('0x19')],function(_0x3ed350){return{'model':db[_0x3ed350[_0xae48('0x1a')]],'as':_0x3ed350['as'],'attributes':_0x3ed350['attributes'],'include':_0x3ed350[_0xae48('0x19')]?_['map'](_0x3ed350[_0xae48('0x19')],function(_0x3807b9){return{'model':db[_0x3807b9[_0xae48('0x1a')]],'as':_0x3807b9['as'],'attributes':_0x3807b9['attributes'],'include':_0x3807b9[_0xae48('0x19')]?_[_0xae48('0x1b')](_0x3807b9['include'],function(_0x468014){return{'model':db[_0x468014['model']],'as':_0x468014['as'],'attributes':_0x468014[_0xae48('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9c5b){logger[_0xae48('0x1d')]('GetFreshdeskAccount',_0x2fb4f3);logger[_0xae48('0x1e')](_0xae48('0x13'),_0x2fb4f3,JSON[_0xae48('0xd')](_0x3f9c5b));_0x34db70(_0x3f9c5b);})[_0xae48('0x1f')](function(_0x56db38){logger[_0xae48('0xe')]('GetFreshdeskAccount',_0x56db38[_0xae48('0x11')],_0x2fb4f3);_0x56d757(_0x178139[_0xae48('0xe')](0x1f4,_0x56db38[_0xae48('0x11')]));});});};exports[_0xae48('0x20')]=function(_0x15ecbb){var _0x3954a7=this;return new Promise(function(_0x32e42a,_0x50f44b){return db[_0xae48('0x14')][_0xae48('0x21')]({'raw':_0x15ecbb[_0xae48('0x16')]?_0x15ecbb[_0xae48('0x16')][_0xae48('0x22')]===undefined?!![]:![]:!![],'where':_0x15ecbb[_0xae48('0x16')]?_0x15ecbb[_0xae48('0x16')][_0xae48('0x17')]||null:null,'attributes':_0x15ecbb[_0xae48('0x16')]?_0x15ecbb['options'][_0xae48('0x1c')]||null:null,'include':_0x15ecbb['options']?_0x15ecbb[_0xae48('0x16')]['include']?_[_0xae48('0x1b')](_0x15ecbb['options'][_0xae48('0x19')],function(_0x599769){return{'model':db[_0x599769[_0xae48('0x1a')]],'as':_0x599769['as'],'attributes':_0x599769[_0xae48('0x1c')],'include':_0x599769[_0xae48('0x19')]?_['map'](_0x599769['include'],function(_0x34baf4){return{'model':db[_0x34baf4[_0xae48('0x1a')]],'as':_0x34baf4['as'],'attributes':_0x34baf4['attributes'],'include':_0x34baf4[_0xae48('0x19')]?_[_0xae48('0x1b')](_0x34baf4['include'],function(_0x50d410){return{'model':db[_0x50d410[_0xae48('0x1a')]],'as':_0x50d410['as'],'attributes':_0x50d410[_0xae48('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae48('0x23')](function(_0x26fac4){logger[_0xae48('0x1d')](_0xae48('0x20'),_0x15ecbb);logger['debug'](_0xae48('0x20'),_0x15ecbb,JSON[_0xae48('0xd')](_0x26fac4));_0x32e42a(_0x26fac4);})[_0xae48('0x1f')](function(_0x80970d){logger['error'](_0xae48('0x20'),_0x80970d[_0xae48('0x11')],_0x15ecbb);_0x50f44b(_0x3954a7['error'](0x1f4,_0x80970d['message']));});});}; \ No newline at end of file +var _0xca89=['code','message','info','catch','GetFreshdeskAccount','FreshdeskAccount','options','where','limit','map','include','model','attributes','ShowFreshdeskAccount','find','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x578098,_0x299627){var _0x2b1bbd=function(_0x68d050){while(--_0x68d050){_0x578098['push'](_0x578098['shift']());}};_0x2b1bbd(++_0x299627);}(_0xca89,0x187));var _0x9ca8=function(_0x5df28f,_0x49ae9a){_0x5df28f=_0x5df28f-0x0;var _0xac6fec=_0xca89[_0x5df28f];return _0xac6fec;};'use strict';var _=require('lodash');var util=require(_0x9ca8('0x0'));var moment=require(_0x9ca8('0x1'));var BPromise=require(_0x9ca8('0x2'));var rs=require(_0x9ca8('0x3'));var fs=require('fs');var Redis=require(_0x9ca8('0x4'));var db=require(_0x9ca8('0x5'))['db'];var utils=require(_0x9ca8('0x6'));var logger=require(_0x9ca8('0x7'))(_0x9ca8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ca8('0x9')][_0x9ca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fc034,_0xc1d3b1,_0x9d4625){return new BPromise(function(_0x26b2d3,_0x5c3d26){return client[_0x9ca8('0xb')](_0x3fc034,_0x9d4625)['then'](function(_0x2e81bf){logger['info'](_0x9ca8('0xc'),_0xc1d3b1,'request\x20sent');logger[_0x9ca8('0xd')](_0x9ca8('0xe'),_0xc1d3b1,_0x9ca8('0xf'),JSON['stringify'](_0x2e81bf));if(_0x2e81bf[_0x9ca8('0x10')]){if(_0x2e81bf[_0x9ca8('0x10')][_0x9ca8('0x11')]===0x1f4){logger['error'](_0x9ca8('0xc'),_0xc1d3b1,_0x2e81bf[_0x9ca8('0x10')]['message']);return _0x5c3d26(_0x2e81bf['error'][_0x9ca8('0x12')]);}logger[_0x9ca8('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0xc1d3b1,_0x2e81bf['error']['message']);return _0x26b2d3(_0x2e81bf['error'][_0x9ca8('0x12')]);}else{logger[_0x9ca8('0x13')](_0x9ca8('0xc'),_0xc1d3b1,_0x9ca8('0xf'));_0x26b2d3(_0x2e81bf['result'][_0x9ca8('0x12')]);}})[_0x9ca8('0x14')](function(_0x38224e){logger[_0x9ca8('0x10')](_0x9ca8('0xc'),_0xc1d3b1,_0x38224e);_0x5c3d26(_0x38224e);});});}exports[_0x9ca8('0x15')]=function(_0x41fe6b){var _0x2563bf=this;return new Promise(function(_0x326516,_0x148bb0){return db[_0x9ca8('0x16')]['findAll']({'raw':_0x41fe6b[_0x9ca8('0x17')]?_0x41fe6b[_0x9ca8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x41fe6b[_0x9ca8('0x17')]?_0x41fe6b[_0x9ca8('0x17')][_0x9ca8('0x18')]||null:null,'attributes':_0x41fe6b[_0x9ca8('0x17')]?_0x41fe6b[_0x9ca8('0x17')]['attributes']||null:null,'limit':_0x41fe6b[_0x9ca8('0x17')]?_0x41fe6b[_0x9ca8('0x17')][_0x9ca8('0x19')]||null:null,'include':_0x41fe6b[_0x9ca8('0x17')]?_0x41fe6b['options']['include']?_[_0x9ca8('0x1a')](_0x41fe6b['options'][_0x9ca8('0x1b')],function(_0x3ec9ef){return{'model':db[_0x3ec9ef[_0x9ca8('0x1c')]],'as':_0x3ec9ef['as'],'attributes':_0x3ec9ef[_0x9ca8('0x1d')],'include':_0x3ec9ef[_0x9ca8('0x1b')]?_[_0x9ca8('0x1a')](_0x3ec9ef[_0x9ca8('0x1b')],function(_0x497c7a){return{'model':db[_0x497c7a[_0x9ca8('0x1c')]],'as':_0x497c7a['as'],'attributes':_0x497c7a[_0x9ca8('0x1d')],'include':_0x497c7a['include']?_[_0x9ca8('0x1a')](_0x497c7a[_0x9ca8('0x1b')],function(_0x182285){return{'model':db[_0x182285[_0x9ca8('0x1c')]],'as':_0x182285['as'],'attributes':_0x182285[_0x9ca8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x303644){logger[_0x9ca8('0x13')](_0x9ca8('0x15'),_0x41fe6b);logger[_0x9ca8('0xd')]('GetFreshdeskAccount',_0x41fe6b,JSON['stringify'](_0x303644));_0x326516(_0x303644);})['catch'](function(_0x11dd51){logger[_0x9ca8('0x10')](_0x9ca8('0x15'),_0x11dd51['message'],_0x41fe6b);_0x148bb0(_0x2563bf['error'](0x1f4,_0x11dd51[_0x9ca8('0x12')]));});});};exports[_0x9ca8('0x1e')]=function(_0x28e5b6){var _0x4a9b4e=this;return new Promise(function(_0x4690c1,_0x3f5831){return db[_0x9ca8('0x16')][_0x9ca8('0x1f')]({'raw':_0x28e5b6[_0x9ca8('0x17')]?_0x28e5b6[_0x9ca8('0x17')][_0x9ca8('0x20')]===undefined?!![]:![]:!![],'where':_0x28e5b6[_0x9ca8('0x17')]?_0x28e5b6[_0x9ca8('0x17')][_0x9ca8('0x18')]||null:null,'attributes':_0x28e5b6[_0x9ca8('0x17')]?_0x28e5b6[_0x9ca8('0x17')][_0x9ca8('0x1d')]||null:null,'include':_0x28e5b6[_0x9ca8('0x17')]?_0x28e5b6['options'][_0x9ca8('0x1b')]?_[_0x9ca8('0x1a')](_0x28e5b6[_0x9ca8('0x17')][_0x9ca8('0x1b')],function(_0x2716c6){return{'model':db[_0x2716c6[_0x9ca8('0x1c')]],'as':_0x2716c6['as'],'attributes':_0x2716c6[_0x9ca8('0x1d')],'include':_0x2716c6[_0x9ca8('0x1b')]?_[_0x9ca8('0x1a')](_0x2716c6[_0x9ca8('0x1b')],function(_0x2dfc69){return{'model':db[_0x2dfc69[_0x9ca8('0x1c')]],'as':_0x2dfc69['as'],'attributes':_0x2dfc69[_0x9ca8('0x1d')],'include':_0x2dfc69[_0x9ca8('0x1b')]?_[_0x9ca8('0x1a')](_0x2dfc69[_0x9ca8('0x1b')],function(_0x39275f){return{'model':db[_0x39275f['model']],'as':_0x39275f['as'],'attributes':_0x39275f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de12b){logger['info']('ShowFreshdeskAccount',_0x28e5b6);logger[_0x9ca8('0xd')](_0x9ca8('0x1e'),_0x28e5b6,JSON[_0x9ca8('0x21')](_0x2de12b));_0x4690c1(_0x2de12b);})[_0x9ca8('0x14')](function(_0x311bd9){logger[_0x9ca8('0x10')](_0x9ca8('0x1e'),_0x311bd9['message'],_0x28e5b6);_0x3f5831(_0x4a9b4e[_0x9ca8('0x10')](0x1f4,_0x311bd9['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 4e06b8c..9746f65 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 _0xeaf4=['index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated'];(function(_0xdd492b,_0x392c7c){var _0x2d15e7=function(_0x4e671c){while(--_0x4e671c){_0xdd492b['push'](_0xdd492b['shift']());}};_0x2d15e7(++_0x392c7c);}(_0xeaf4,0x196));var _0x4eaf=function(_0x4efcda,_0x3b7d36){_0x4efcda=_0x4efcda-0x0;var _0x3a398e=_0xeaf4[_0x4efcda];return _0x3a398e;};'use strict';var multer=require(_0x4eaf('0x0'));var util=require('util');var path=require(_0x4eaf('0x1'));var timeout=require(_0x4eaf('0x2'));var express=require(_0x4eaf('0x3'));var router=express[_0x4eaf('0x4')]();var fs_extra=require(_0x4eaf('0x5'));var auth=require(_0x4eaf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eaf('0x7'));var controller=require(_0x4eaf('0x8'));router['get']('/',auth[_0x4eaf('0x9')](),controller[_0x4eaf('0xa')]);router[_0x4eaf('0xb')](_0x4eaf('0xc'),auth[_0x4eaf('0x9')](),controller['show']);router[_0x4eaf('0xb')](_0x4eaf('0xd'),auth[_0x4eaf('0x9')](),controller[_0x4eaf('0xe')]);router['get'](_0x4eaf('0xf'),auth['isAuthenticated'](),controller[_0x4eaf('0x10')]);router['get'](_0x4eaf('0x11'),auth[_0x4eaf('0x9')](),controller[_0x4eaf('0x12')]);router[_0x4eaf('0xb')](_0x4eaf('0x13'),auth[_0x4eaf('0x9')](),controller[_0x4eaf('0x14')]);router[_0x4eaf('0x15')]('/',auth[_0x4eaf('0x9')](),controller[_0x4eaf('0x16')]);router[_0x4eaf('0x15')]('/:id/tags',auth[_0x4eaf('0x9')](),controller[_0x4eaf('0x17')]);router['put'](_0x4eaf('0xc'),auth[_0x4eaf('0x9')](),controller[_0x4eaf('0x18')]);router[_0x4eaf('0x19')](_0x4eaf('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1432=['fs-extra','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','setTags','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x47535e,_0x520cda){var _0x360d27=function(_0x3f63ff){while(--_0x3f63ff){_0x47535e['push'](_0x47535e['shift']());}};_0x360d27(++_0x520cda);}(_0x1432,0xa4));var _0x2143=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x1432[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require(_0x2143('0x0'));var util=require('util');var path=require(_0x2143('0x1'));var timeout=require('connect-timeout');var express=require(_0x2143('0x2'));var router=express[_0x2143('0x3')]();var fs_extra=require(_0x2143('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x2143('0x5')](),controller[_0x2143('0x6')]);router[_0x2143('0x7')](_0x2143('0x8'),auth['isAuthenticated'](),controller[_0x2143('0x9')]);router[_0x2143('0x7')](_0x2143('0xa'),auth[_0x2143('0x5')](),controller['getFields']);router['get'](_0x2143('0xb'),auth[_0x2143('0x5')](),controller['getSubjects']);router[_0x2143('0x7')](_0x2143('0xc'),auth['isAuthenticated'](),controller[_0x2143('0xd')]);router[_0x2143('0x7')]('/:id/tags',auth[_0x2143('0x5')](),controller['getTags']);router[_0x2143('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2143('0xe')]('/:id/tags',auth['isAuthenticated'](),controller[_0x2143('0xf')]);router[_0x2143('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2143('0x11')]);router[_0x2143('0x12')](_0x2143('0x8'),auth['isAuthenticated'](),controller[_0x2143('0x13')]);module[_0x2143('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 9cd2e79..11f1c77 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 _0x4b16=['exports','STRING','sequelize'];(function(_0x1795bf,_0xbc4ae2){var _0x5ab180=function(_0x5203d9){while(--_0x5203d9){_0x1795bf['push'](_0x1795bf['shift']());}};_0x5ab180(++_0xbc4ae2);}(_0x4b16,0x1e2));var _0x64b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4b16[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x64b1('0x0'));module[_0x64b1('0x1')]={'name':{'type':Sequelize[_0x64b1('0x2')]},'description':{'type':Sequelize[_0x64b1('0x2')]}}; \ No newline at end of file +var _0x8fdc=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fdc,0x15f));var _0xc8fd=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x8fdc[_0x1406ae];return _0x23a076;};'use strict';var Sequelize=require(_0xc8fd('0x0'));module[_0xc8fd('0x1')]={'name':{'type':Sequelize[_0xc8fd('0x2')]},'description':{'type':Sequelize[_0xc8fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f8ed905..ee37793 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 _0xc838=['Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','length','includeAll','options','find','create','body','params','getFields','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','findOne','getTags'];(function(_0x5384ff,_0x2b23c6){var _0x588d40=function(_0x50aeeb){while(--_0x50aeeb){_0x5384ff['push'](_0x5384ff['shift']());}};_0x588d40(++_0x2b23c6);}(_0xc838,0x15b));var _0x8c83=function(_0x3328db,_0x20402d){_0x3328db=_0x3328db-0x0;var _0x26b3ba=_0xc838[_0x3328db];return _0x26b3ba;};'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('mustache');var util=require(_0x8c83('0x7'));var path=require('path');var sox=require(_0x8c83('0x8'));var csv=require(_0x8c83('0x9'));var ejs=require(_0x8c83('0xa'));var fs=require('fs');var fs_extra=require(_0x8c83('0xb'));var _=require(_0x8c83('0xc'));var squel=require(_0x8c83('0xd'));var crypto=require(_0x8c83('0xe'));var jsforce=require(_0x8c83('0xf'));var deskjs=require(_0x8c83('0x10'));var toCsv=require(_0x8c83('0x9'));var querystring=require(_0x8c83('0x11'));var Papa=require('papaparse');var Redis=require(_0x8c83('0x12'));var authService=require(_0x8c83('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c83('0x14'))(_0x8c83('0x15'));var utils=require(_0x8c83('0x16'));var config=require(_0x8c83('0x17'));var licenseUtil=require(_0x8c83('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a11db,_0x53e82e){_0x53e82e=_0x53e82e||0xcc;return function(_0x43aa96){if(_0x43aa96){return _0x1a11db[_0x8c83('0x19')](_0x53e82e);}return _0x1a11db[_0x8c83('0x1a')](_0x53e82e)[_0x8c83('0x1b')]();};}function respondWithResult(_0x2912ca,_0x15abe0){_0x15abe0=_0x15abe0||0xc8;return function(_0x51cf16){if(_0x51cf16){return _0x2912ca[_0x8c83('0x1a')](_0x15abe0)['json'](_0x51cf16);}};}function respondWithFilteredResult(_0x33846e,_0x4c1d1f){return function(_0xe8a2da){if(_0xe8a2da){var _0x43b52e=typeof _0x4c1d1f[_0x8c83('0x1c')]===_0x8c83('0x1d')&&typeof _0x4c1d1f[_0x8c83('0x1e')]===_0x8c83('0x1d');var _0x5d8272=_0xe8a2da[_0x8c83('0x1f')];var _0x5efd04=_0x43b52e?0x0:_0x4c1d1f[_0x8c83('0x1c')];var _0x268c8=_0x43b52e?_0xe8a2da[_0x8c83('0x1f')]:_0x4c1d1f['offset']+_0x4c1d1f[_0x8c83('0x1e')];var _0x17f37a;if(_0x268c8>=_0x5d8272){_0x268c8=_0x5d8272;_0x17f37a=0xc8;}else{_0x17f37a=0xce;}_0x33846e[_0x8c83('0x1a')](_0x17f37a);return _0x33846e[_0x8c83('0x20')](_0x8c83('0x21'),_0x5efd04+'-'+_0x268c8+'/'+_0x5d8272)[_0x8c83('0x22')](_0xe8a2da);}return null;};}function patchUpdates(_0x13d540){return function(_0x5cf159){try{jsonpatch['apply'](_0x5cf159,_0x13d540,!![]);}catch(_0xd6778c){return BPromise[_0x8c83('0x23')](_0xd6778c);}return _0x5cf159[_0x8c83('0x24')]();};}function saveUpdates(_0x535599,_0x40b6be){return function(_0x586f1d){if(_0x586f1d){return _0x586f1d[_0x8c83('0x25')](_0x535599)['then'](function(_0x351c72){return _0x351c72;});}return null;};}function removeEntity(_0x3e8011,_0x433637){return function(_0xa32fcb){if(_0xa32fcb){return _0xa32fcb[_0x8c83('0x26')]()[_0x8c83('0x27')](function(){_0x3e8011[_0x8c83('0x1a')](0xcc)[_0x8c83('0x1b')]();});}};}function handleEntityNotFound(_0x55cace,_0x1cadf1){return function(_0x312554){if(!_0x312554){_0x55cace[_0x8c83('0x19')](0x194);}return _0x312554;};}function handleError(_0x215d22,_0x286d20){_0x286d20=_0x286d20||0x1f4;return function(_0x163b42){logger[_0x8c83('0x28')](_0x163b42[_0x8c83('0x29')]);if(_0x163b42[_0x8c83('0x2a')]){delete _0x163b42[_0x8c83('0x2a')];}_0x215d22[_0x8c83('0x1a')](_0x286d20)[_0x8c83('0x2b')](_0x163b42);};}exports[_0x8c83('0x2c')]=function(_0x1f9c81,_0x10a4f0){var _0x53e795={},_0x829b96={},_0x4b157e={'count':0x0,'rows':[]};var _0x756021=_[_0x8c83('0x2d')](db[_0x8c83('0x2e')][_0x8c83('0x2f')],function(_0x340400){return{'name':_0x340400[_0x8c83('0x30')],'type':_0x340400[_0x8c83('0x31')][_0x8c83('0x32')]};});_0x829b96['model']=_[_0x8c83('0x2d')](_0x756021,_0x8c83('0x2a'));_0x829b96[_0x8c83('0x33')]=_[_0x8c83('0x34')](_0x1f9c81[_0x8c83('0x33')]);_0x829b96['filters']=_[_0x8c83('0x35')](_0x829b96[_0x8c83('0x36')],_0x829b96['query']);_0x53e795[_0x8c83('0x37')]=_[_0x8c83('0x35')](_0x829b96[_0x8c83('0x36')],qs[_0x8c83('0x38')](_0x1f9c81['query'][_0x8c83('0x38')]));_0x53e795['attributes']=_0x53e795[_0x8c83('0x37')]['length']?_0x53e795['attributes']:_0x829b96['model'];if(!_0x1f9c81[_0x8c83('0x33')]['hasOwnProperty'](_0x8c83('0x39'))){_0x53e795['limit']=qs[_0x8c83('0x1e')](_0x1f9c81[_0x8c83('0x33')]['limit']);_0x53e795['offset']=qs[_0x8c83('0x1c')](_0x1f9c81[_0x8c83('0x33')][_0x8c83('0x1c')]);}_0x53e795[_0x8c83('0x3a')]=qs[_0x8c83('0x3b')](_0x1f9c81['query']['sort']);_0x53e795[_0x8c83('0x3c')]=qs[_0x8c83('0x3d')](_[_0x8c83('0x3e')](_0x1f9c81[_0x8c83('0x33')],_0x829b96[_0x8c83('0x3d')]),_0x756021);if(_0x1f9c81['query'][_0x8c83('0x3f')]){_0x53e795[_0x8c83('0x3c')]=_[_0x8c83('0x40')](_0x53e795[_0x8c83('0x3c')],{'$or':_[_0x8c83('0x2d')](_0x756021,function(_0x2f92a4){if(_0x2f92a4[_0x8c83('0x31')]!==_0x8c83('0x41')){var _0x4c142c={};_0x4c142c[_0x2f92a4[_0x8c83('0x2a')]]={'$like':'%'+_0x1f9c81[_0x8c83('0x33')][_0x8c83('0x3f')]+'%'};return _0x4c142c;}})});}_0x53e795=_['merge']({},_0x53e795,_0x1f9c81['options']);var _0x18dbd2={'where':_0x53e795[_0x8c83('0x3c')]};return db['FreshdeskConfiguration'][_0x8c83('0x1f')](_0x18dbd2)[_0x8c83('0x27')](function(_0x136543){_0x4b157e[_0x8c83('0x1f')]=_0x136543;if(_0x1f9c81[_0x8c83('0x33')]['includeAll']){_0x53e795[_0x8c83('0x42')]=[{'all':!![]}];}return db[_0x8c83('0x2e')]['findAll'](_0x53e795);})[_0x8c83('0x27')](function(_0xaca19c){_0x4b157e[_0x8c83('0x43')]=_0xaca19c;return _0x4b157e;})['then'](respondWithFilteredResult(_0x10a4f0,_0x53e795))[_0x8c83('0x44')](handleError(_0x10a4f0,null));};exports['show']=function(_0x2ba0d6,_0x4e061d){var _0x2255a9={'raw':![],'where':{'id':_0x2ba0d6['params']['id']}},_0x4c16a3={};_0x4c16a3['model']=_['keys'](db[_0x8c83('0x2e')][_0x8c83('0x2f')]);_0x4c16a3[_0x8c83('0x33')]=_[_0x8c83('0x34')](_0x2ba0d6[_0x8c83('0x33')]);_0x4c16a3[_0x8c83('0x3d')]=_['intersection'](_0x4c16a3['model'],_0x4c16a3['query']);_0x2255a9['attributes']=_[_0x8c83('0x35')](_0x4c16a3[_0x8c83('0x36')],qs['fields'](_0x2ba0d6['query']['fields']));_0x2255a9[_0x8c83('0x37')]=_0x2255a9[_0x8c83('0x37')][_0x8c83('0x45')]?_0x2255a9[_0x8c83('0x37')]:_0x4c16a3[_0x8c83('0x36')];if(_0x2ba0d6[_0x8c83('0x33')][_0x8c83('0x46')]){_0x2255a9[_0x8c83('0x42')]=[{'all':!![]}];}_0x2255a9=_[_0x8c83('0x40')]({},_0x2255a9,_0x2ba0d6[_0x8c83('0x47')]);return db[_0x8c83('0x2e')][_0x8c83('0x48')](_0x2255a9)['then'](handleEntityNotFound(_0x4e061d,null))['then'](respondWithResult(_0x4e061d,null))[_0x8c83('0x44')](handleError(_0x4e061d,null));};exports[_0x8c83('0x49')]=function(_0x40b858,_0xd03eb5){return db[_0x8c83('0x2e')][_0x8c83('0x49')](_0x40b858[_0x8c83('0x4a')],{})[_0x8c83('0x27')](respondWithResult(_0xd03eb5,0xc9))[_0x8c83('0x44')](handleError(_0xd03eb5,null));};exports['update']=function(_0x109d6d,_0x50fd6a){if(_0x109d6d[_0x8c83('0x4a')]['id']){delete _0x109d6d[_0x8c83('0x4a')]['id'];}return db[_0x8c83('0x2e')][_0x8c83('0x48')]({'where':{'id':_0x109d6d['params']['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x50fd6a,null))[_0x8c83('0x27')](saveUpdates(_0x109d6d[_0x8c83('0x4a')],null))[_0x8c83('0x27')](respondWithResult(_0x50fd6a,null))[_0x8c83('0x44')](handleError(_0x50fd6a,null));};exports[_0x8c83('0x26')]=function(_0x35e2fc,_0x1773c7){return db[_0x8c83('0x2e')]['find']({'where':{'id':_0x35e2fc[_0x8c83('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1773c7,null))[_0x8c83('0x27')](removeEntity(_0x1773c7,null))[_0x8c83('0x44')](handleError(_0x1773c7,null));};exports[_0x8c83('0x4c')]=function(_0x5a9188,_0x1eb8cb,_0x1c2f6e){var _0x5d2fd3={};var _0x5092c1={};var _0x44653a;var _0x25c8a6;return db[_0x8c83('0x2e')]['findOne']({'where':{'id':_0x5a9188['params']['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x1eb8cb,null))['then'](function(_0x46ee60){if(_0x46ee60){_0x44653a=_0x46ee60;_0x5092c1['model']=_[_0x8c83('0x34')](db[_0x8c83('0x4d')][_0x8c83('0x2f')]);_0x5092c1[_0x8c83('0x33')]=_[_0x8c83('0x34')](_0x5a9188[_0x8c83('0x33')]);_0x5092c1['filters']=_[_0x8c83('0x35')](_0x5092c1['model'],_0x5092c1[_0x8c83('0x33')]);_0x5d2fd3[_0x8c83('0x37')]=_[_0x8c83('0x35')](_0x5092c1[_0x8c83('0x36')],qs['fields'](_0x5a9188[_0x8c83('0x33')][_0x8c83('0x38')]));_0x5d2fd3['attributes']=_0x5d2fd3[_0x8c83('0x37')][_0x8c83('0x45')]?_0x5d2fd3[_0x8c83('0x37')]:_0x5092c1[_0x8c83('0x36')];_0x5d2fd3[_0x8c83('0x3a')]=qs[_0x8c83('0x3b')](_0x5a9188['query'][_0x8c83('0x3b')]);_0x5d2fd3[_0x8c83('0x3c')]=qs[_0x8c83('0x3d')](_[_0x8c83('0x3e')](_0x5a9188[_0x8c83('0x33')],_0x5092c1[_0x8c83('0x3d')]));if(_0x5a9188[_0x8c83('0x33')]['filter']){_0x5d2fd3['where']=_[_0x8c83('0x40')](_0x5d2fd3[_0x8c83('0x3c')],{'$or':_['map'](_0x5d2fd3[_0x8c83('0x37')],function(_0x1fe8fe){var _0x1749ef={};_0x1749ef[_0x1fe8fe]={'$like':'%'+_0x5a9188['query'][_0x8c83('0x3f')]+'%'};return _0x1749ef;})});}_0x5d2fd3=_['merge']({},_0x5d2fd3,_0x5a9188[_0x8c83('0x47')]);return _0x44653a[_0x8c83('0x4c')](_0x5d2fd3);}})['then'](function(_0x4ebdee){if(_0x4ebdee){_0x25c8a6=_0x4ebdee[_0x8c83('0x45')];if(!_0x5a9188['query'][_0x8c83('0x4e')]('nolimit')){_0x5d2fd3[_0x8c83('0x1e')]=qs[_0x8c83('0x1e')](_0x5a9188[_0x8c83('0x33')][_0x8c83('0x1e')]);_0x5d2fd3[_0x8c83('0x1c')]=qs[_0x8c83('0x1c')](_0x5a9188['query'][_0x8c83('0x1c')]);}return _0x44653a[_0x8c83('0x4c')](_0x5d2fd3);}})[_0x8c83('0x27')](function(_0x1d2367){if(_0x1d2367){return _0x1d2367?{'count':_0x25c8a6,'rows':_0x1d2367}:null;}})[_0x8c83('0x27')](respondWithResult(_0x1eb8cb,null))[_0x8c83('0x44')](handleError(_0x1eb8cb,null));};exports[_0x8c83('0x4f')]=function(_0xbc7ef4,_0x13d650,_0x856c8a){var _0x502189={};var _0x5ebcdf={};var _0x515f5e;var _0x254394;return db[_0x8c83('0x2e')]['findOne']({'where':{'id':_0xbc7ef4[_0x8c83('0x4b')]['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x13d650,null))[_0x8c83('0x27')](function(_0x42a5ec){if(_0x42a5ec){_0x515f5e=_0x42a5ec;_0x5ebcdf['model']=_['keys'](db['FreshdeskField']['rawAttributes']);_0x5ebcdf['query']=_[_0x8c83('0x34')](_0xbc7ef4[_0x8c83('0x33')]);_0x5ebcdf['filters']=_[_0x8c83('0x35')](_0x5ebcdf[_0x8c83('0x36')],_0x5ebcdf[_0x8c83('0x33')]);_0x502189[_0x8c83('0x37')]=_[_0x8c83('0x35')](_0x5ebcdf[_0x8c83('0x36')],qs[_0x8c83('0x38')](_0xbc7ef4['query'][_0x8c83('0x38')]));_0x502189[_0x8c83('0x37')]=_0x502189[_0x8c83('0x37')][_0x8c83('0x45')]?_0x502189[_0x8c83('0x37')]:_0x5ebcdf['model'];_0x502189['order']=qs[_0x8c83('0x3b')](_0xbc7ef4[_0x8c83('0x33')][_0x8c83('0x3b')]);_0x502189[_0x8c83('0x3c')]=qs[_0x8c83('0x3d')](_[_0x8c83('0x3e')](_0xbc7ef4[_0x8c83('0x33')],_0x5ebcdf[_0x8c83('0x3d')]));if(_0xbc7ef4['query'][_0x8c83('0x3f')]){_0x502189['where']=_[_0x8c83('0x40')](_0x502189[_0x8c83('0x3c')],{'$or':_[_0x8c83('0x2d')](_0x502189[_0x8c83('0x37')],function(_0x4f9edd){var _0x274614={};_0x274614[_0x4f9edd]={'$like':'%'+_0xbc7ef4[_0x8c83('0x33')][_0x8c83('0x3f')]+'%'};return _0x274614;})});}_0x502189=_[_0x8c83('0x40')]({},_0x502189,_0xbc7ef4[_0x8c83('0x47')]);return _0x515f5e['getSubjects'](_0x502189);}})[_0x8c83('0x27')](function(_0x332d09){if(_0x332d09){_0x254394=_0x332d09[_0x8c83('0x45')];if(!_0xbc7ef4[_0x8c83('0x33')][_0x8c83('0x4e')](_0x8c83('0x39'))){_0x502189[_0x8c83('0x1e')]=qs[_0x8c83('0x1e')](_0xbc7ef4['query'][_0x8c83('0x1e')]);_0x502189['offset']=qs[_0x8c83('0x1c')](_0xbc7ef4[_0x8c83('0x33')]['offset']);}return _0x515f5e[_0x8c83('0x4f')](_0x502189);}})[_0x8c83('0x27')](function(_0x1bc058){if(_0x1bc058){return _0x1bc058?{'count':_0x254394,'rows':_0x1bc058}:null;}})['then'](respondWithResult(_0x13d650,null))[_0x8c83('0x44')](handleError(_0x13d650,null));};exports[_0x8c83('0x50')]=function(_0x36a881,_0x37ede9,_0x2f0576){var _0x30c9ba={};var _0x560922={};var _0x1a998d;var _0xc1b32d;return db[_0x8c83('0x2e')][_0x8c83('0x51')]({'where':{'id':_0x36a881[_0x8c83('0x4b')]['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x37ede9,null))[_0x8c83('0x27')](function(_0x1cfb97){if(_0x1cfb97){_0x1a998d=_0x1cfb97;_0x560922['model']=_['keys'](db[_0x8c83('0x4d')][_0x8c83('0x2f')]);_0x560922[_0x8c83('0x33')]=_['keys'](_0x36a881[_0x8c83('0x33')]);_0x560922[_0x8c83('0x3d')]=_['intersection'](_0x560922[_0x8c83('0x36')],_0x560922[_0x8c83('0x33')]);_0x30c9ba[_0x8c83('0x37')]=_['intersection'](_0x560922[_0x8c83('0x36')],qs[_0x8c83('0x38')](_0x36a881[_0x8c83('0x33')][_0x8c83('0x38')]));_0x30c9ba['attributes']=_0x30c9ba[_0x8c83('0x37')][_0x8c83('0x45')]?_0x30c9ba[_0x8c83('0x37')]:_0x560922[_0x8c83('0x36')];_0x30c9ba['order']=qs[_0x8c83('0x3b')](_0x36a881[_0x8c83('0x33')]['sort']);_0x30c9ba['where']=qs[_0x8c83('0x3d')](_['pick'](_0x36a881[_0x8c83('0x33')],_0x560922[_0x8c83('0x3d')]));if(_0x36a881[_0x8c83('0x33')][_0x8c83('0x3f')]){_0x30c9ba[_0x8c83('0x3c')]=_[_0x8c83('0x40')](_0x30c9ba['where'],{'$or':_[_0x8c83('0x2d')](_0x30c9ba[_0x8c83('0x37')],function(_0xbdf07f){var _0x532a09={};_0x532a09[_0xbdf07f]={'$like':'%'+_0x36a881[_0x8c83('0x33')]['filter']+'%'};return _0x532a09;})});}_0x30c9ba=_['merge']({},_0x30c9ba,_0x36a881['options']);return _0x1a998d['getDescriptions'](_0x30c9ba);}})[_0x8c83('0x27')](function(_0x4935b5){if(_0x4935b5){_0xc1b32d=_0x4935b5[_0x8c83('0x45')];if(!_0x36a881[_0x8c83('0x33')][_0x8c83('0x4e')](_0x8c83('0x39'))){_0x30c9ba[_0x8c83('0x1e')]=qs[_0x8c83('0x1e')](_0x36a881[_0x8c83('0x33')][_0x8c83('0x1e')]);_0x30c9ba[_0x8c83('0x1c')]=qs[_0x8c83('0x1c')](_0x36a881[_0x8c83('0x33')][_0x8c83('0x1c')]);}return _0x1a998d[_0x8c83('0x50')](_0x30c9ba);}})['then'](function(_0x7fba96){if(_0x7fba96){return _0x7fba96?{'count':_0xc1b32d,'rows':_0x7fba96}:null;}})['then'](respondWithResult(_0x37ede9,null))[_0x8c83('0x44')](handleError(_0x37ede9,null));};exports[_0x8c83('0x52')]=function(_0x20dd0c,_0x1d4d5c,_0x36091d){var _0x42fe4d={};var _0x4fa3f9={};var _0x5e73a4;var _0x38563d;return db['FreshdeskConfiguration'][_0x8c83('0x51')]({'where':{'id':_0x20dd0c['params']['id']}})[_0x8c83('0x27')](handleEntityNotFound(_0x1d4d5c,null))[_0x8c83('0x27')](function(_0x3bfede){if(_0x3bfede){_0x5e73a4=_0x3bfede;_0x4fa3f9[_0x8c83('0x36')]=_[_0x8c83('0x34')](db[_0x8c83('0x53')][_0x8c83('0x2f')]);_0x4fa3f9[_0x8c83('0x33')]=_[_0x8c83('0x34')](_0x20dd0c[_0x8c83('0x33')]);_0x4fa3f9[_0x8c83('0x3d')]=_[_0x8c83('0x35')](_0x4fa3f9['model'],_0x4fa3f9[_0x8c83('0x33')]);_0x42fe4d[_0x8c83('0x37')]=_[_0x8c83('0x35')](_0x4fa3f9['model'],qs[_0x8c83('0x38')](_0x20dd0c[_0x8c83('0x33')][_0x8c83('0x38')]));_0x42fe4d['attributes']=_0x42fe4d[_0x8c83('0x37')]['length']?_0x42fe4d[_0x8c83('0x37')]:_0x4fa3f9[_0x8c83('0x36')];_0x42fe4d[_0x8c83('0x3a')]=qs['sort'](_0x20dd0c[_0x8c83('0x33')][_0x8c83('0x3b')]);_0x42fe4d[_0x8c83('0x3c')]=qs[_0x8c83('0x3d')](_['pick'](_0x20dd0c['query'],_0x4fa3f9[_0x8c83('0x3d')]));if(_0x20dd0c[_0x8c83('0x33')]['filter']){_0x42fe4d['where']=_[_0x8c83('0x40')](_0x42fe4d['where'],{'$or':_[_0x8c83('0x2d')](_0x42fe4d[_0x8c83('0x37')],function(_0x419d51){var _0x4155d7={};_0x4155d7[_0x419d51]={'$like':'%'+_0x20dd0c['query'][_0x8c83('0x3f')]+'%'};return _0x4155d7;})});}_0x42fe4d=_[_0x8c83('0x40')]({},_0x42fe4d,_0x20dd0c[_0x8c83('0x47')]);return _0x5e73a4[_0x8c83('0x52')](_0x42fe4d);}})[_0x8c83('0x27')](function(_0x4730dd){if(_0x4730dd){_0x38563d=_0x4730dd['length'];if(!_0x20dd0c[_0x8c83('0x33')][_0x8c83('0x4e')](_0x8c83('0x39'))){_0x42fe4d['limit']=qs[_0x8c83('0x1e')](_0x20dd0c[_0x8c83('0x33')][_0x8c83('0x1e')]);_0x42fe4d[_0x8c83('0x1c')]=qs['offset'](_0x20dd0c[_0x8c83('0x33')][_0x8c83('0x1c')]);}return _0x5e73a4[_0x8c83('0x52')](_0x42fe4d);}})[_0x8c83('0x27')](function(_0x433082){if(_0x433082){return _0x433082?{'count':_0x38563d,'rows':_0x433082}:null;}})[_0x8c83('0x27')](respondWithResult(_0x1d4d5c,null))['catch'](handleError(_0x1d4d5c,null));};exports[_0x8c83('0x54')]=function(_0x522cdd,_0x29be79,_0x40f8ed){if(_0x522cdd[_0x8c83('0x4a')]['id']){delete _0x522cdd[_0x8c83('0x4a')]['id'];}return db[_0x8c83('0x2e')][_0x8c83('0x51')]({'where':{'id':_0x522cdd['params']['id']}})['then'](handleEntityNotFound(_0x29be79,null))[_0x8c83('0x27')](function(_0x1aaccc){if(_0x1aaccc){return _0x1aaccc['setTags'](_0x522cdd['body'][_0x8c83('0x55')]||[]);}return null;})[_0x8c83('0x27')](respondWithResult(_0x29be79,null))['catch'](handleError(_0x29be79,null));}; \ No newline at end of file +var _0x528c=['stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','fields','attributes','length','model','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1aa771,_0x525dd4){var _0x17b772=function(_0x4d1acd){while(--_0x4d1acd){_0x1aa771['push'](_0x1aa771['shift']());}};_0x17b772(++_0x525dd4);}(_0x528c,0x186));var _0xc528=function(_0x3902de,_0x44deda){_0x3902de=_0x3902de-0x0;var _0x294145=_0x528c[_0x3902de];return _0x294145;};'use strict';var emlformat=require(_0xc528('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc528('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc528('0x2'));var util=require(_0xc528('0x3'));var path=require(_0xc528('0x4'));var sox=require(_0xc528('0x5'));var csv=require(_0xc528('0x6'));var ejs=require(_0xc528('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc528('0x8'));var squel=require(_0xc528('0x9'));var crypto=require(_0xc528('0xa'));var jsforce=require(_0xc528('0xb'));var deskjs=require(_0xc528('0xc'));var toCsv=require(_0xc528('0x6'));var querystring=require(_0xc528('0xd'));var Papa=require(_0xc528('0xe'));var Redis=require(_0xc528('0xf'));var authService=require(_0xc528('0x10'));var qs=require(_0xc528('0x11'));var as=require(_0xc528('0x12'));var hardwareService=require(_0xc528('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc528('0x14'));var config=require(_0xc528('0x15'));var licenseUtil=require(_0xc528('0x16'));var db=require(_0xc528('0x17'))['db'];function respondWithStatusCode(_0x77951e,_0x958701){_0x958701=_0x958701||0xcc;return function(_0x3010a4){if(_0x3010a4){return _0x77951e[_0xc528('0x18')](_0x958701);}return _0x77951e['status'](_0x958701)[_0xc528('0x19')]();};}function respondWithResult(_0x348eaf,_0x49597d){_0x49597d=_0x49597d||0xc8;return function(_0x5c7752){if(_0x5c7752){return _0x348eaf['status'](_0x49597d)[_0xc528('0x1a')](_0x5c7752);}};}function respondWithFilteredResult(_0x5d09ad,_0x5bd2f5){return function(_0x3aa952){if(_0x3aa952){var _0x251cfe=typeof _0x5bd2f5['offset']===_0xc528('0x1b')&&typeof _0x5bd2f5['limit']===_0xc528('0x1b');var _0x53b1aa=_0x3aa952[_0xc528('0x1c')];var _0x2ae1b7=_0x251cfe?0x0:_0x5bd2f5['offset'];var _0x31af33=_0x251cfe?_0x3aa952[_0xc528('0x1c')]:_0x5bd2f5[_0xc528('0x1d')]+_0x5bd2f5[_0xc528('0x1e')];var _0x2d1e32;if(_0x31af33>=_0x53b1aa){_0x31af33=_0x53b1aa;_0x2d1e32=0xc8;}else{_0x2d1e32=0xce;}_0x5d09ad[_0xc528('0x1f')](_0x2d1e32);return _0x5d09ad[_0xc528('0x20')](_0xc528('0x21'),_0x2ae1b7+'-'+_0x31af33+'/'+_0x53b1aa)[_0xc528('0x1a')](_0x3aa952);}return null;};}function patchUpdates(_0x7f42ab){return function(_0x430d1b){try{jsonpatch[_0xc528('0x22')](_0x430d1b,_0x7f42ab,!![]);}catch(_0x2a8c3b){return BPromise[_0xc528('0x23')](_0x2a8c3b);}return _0x430d1b[_0xc528('0x24')]();};}function saveUpdates(_0x2e4023,_0x217318){return function(_0x342511){if(_0x342511){return _0x342511[_0xc528('0x25')](_0x2e4023)[_0xc528('0x26')](function(_0x5811f7){return _0x5811f7;});}return null;};}function removeEntity(_0x42276b,_0x4cf3e7){return function(_0x25d27a){if(_0x25d27a){return _0x25d27a[_0xc528('0x27')]()[_0xc528('0x26')](function(){_0x42276b[_0xc528('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502c8d,_0x15368c){return function(_0x5b6772){if(!_0x5b6772){_0x502c8d[_0xc528('0x18')](0x194);}return _0x5b6772;};}function handleError(_0x46d238,_0x3968dd){_0x3968dd=_0x3968dd||0x1f4;return function(_0x238b2d){logger['error'](_0x238b2d[_0xc528('0x28')]);if(_0x238b2d[_0xc528('0x29')]){delete _0x238b2d['name'];}_0x46d238[_0xc528('0x1f')](_0x3968dd)[_0xc528('0x2a')](_0x238b2d);};}exports[_0xc528('0x2b')]=function(_0x2d7cef,_0x7ad84c){var _0x5bad32={},_0x2ea978={},_0x189e58={'count':0x0,'rows':[]};var _0x56caf9=_[_0xc528('0x2c')](db[_0xc528('0x2d')][_0xc528('0x2e')],function(_0x337b4b){return{'name':_0x337b4b[_0xc528('0x2f')],'type':_0x337b4b[_0xc528('0x30')]['key']};});_0x2ea978['model']=_['map'](_0x56caf9,_0xc528('0x29'));_0x2ea978[_0xc528('0x31')]=_[_0xc528('0x32')](_0x2d7cef[_0xc528('0x31')]);_0x2ea978[_0xc528('0x33')]=_['intersection'](_0x2ea978['model'],_0x2ea978[_0xc528('0x31')]);_0x5bad32['attributes']=_['intersection'](_0x2ea978['model'],qs[_0xc528('0x34')](_0x2d7cef[_0xc528('0x31')][_0xc528('0x34')]));_0x5bad32[_0xc528('0x35')]=_0x5bad32[_0xc528('0x35')][_0xc528('0x36')]?_0x5bad32['attributes']:_0x2ea978[_0xc528('0x37')];if(!_0x2d7cef['query'][_0xc528('0x38')](_0xc528('0x39'))){_0x5bad32[_0xc528('0x1e')]=qs[_0xc528('0x1e')](_0x2d7cef[_0xc528('0x31')]['limit']);_0x5bad32[_0xc528('0x1d')]=qs[_0xc528('0x1d')](_0x2d7cef[_0xc528('0x31')][_0xc528('0x1d')]);}_0x5bad32['order']=qs['sort'](_0x2d7cef['query'][_0xc528('0x3a')]);_0x5bad32['where']=qs[_0xc528('0x33')](_[_0xc528('0x3b')](_0x2d7cef['query'],_0x2ea978[_0xc528('0x33')]),_0x56caf9);if(_0x2d7cef[_0xc528('0x31')][_0xc528('0x3c')]){_0x5bad32[_0xc528('0x3d')]=_[_0xc528('0x3e')](_0x5bad32[_0xc528('0x3d')],{'$or':_[_0xc528('0x2c')](_0x56caf9,function(_0x1a7da0){if(_0x1a7da0[_0xc528('0x30')]!==_0xc528('0x3f')){var _0x3c4389={};_0x3c4389[_0x1a7da0['name']]={'$like':'%'+_0x2d7cef['query'][_0xc528('0x3c')]+'%'};return _0x3c4389;}})});}_0x5bad32=_['merge']({},_0x5bad32,_0x2d7cef[_0xc528('0x40')]);var _0x53cc5a={'where':_0x5bad32[_0xc528('0x3d')]};return db[_0xc528('0x2d')][_0xc528('0x1c')](_0x53cc5a)['then'](function(_0x21bf89){_0x189e58['count']=_0x21bf89;if(_0x2d7cef[_0xc528('0x31')][_0xc528('0x41')]){_0x5bad32[_0xc528('0x42')]=[{'all':!![]}];}return db[_0xc528('0x2d')][_0xc528('0x43')](_0x5bad32);})['then'](function(_0x2668b4){_0x189e58[_0xc528('0x44')]=_0x2668b4;return _0x189e58;})[_0xc528('0x26')](respondWithFilteredResult(_0x7ad84c,_0x5bad32))[_0xc528('0x45')](handleError(_0x7ad84c,null));};exports[_0xc528('0x46')]=function(_0x4e4226,_0x5de1b3){var _0x2bce42={'raw':![],'where':{'id':_0x4e4226[_0xc528('0x47')]['id']}},_0x12d556={};_0x12d556[_0xc528('0x37')]=_['keys'](db[_0xc528('0x2d')]['rawAttributes']);_0x12d556[_0xc528('0x31')]=_['keys'](_0x4e4226['query']);_0x12d556[_0xc528('0x33')]=_[_0xc528('0x48')](_0x12d556[_0xc528('0x37')],_0x12d556[_0xc528('0x31')]);_0x2bce42[_0xc528('0x35')]=_['intersection'](_0x12d556[_0xc528('0x37')],qs['fields'](_0x4e4226[_0xc528('0x31')]['fields']));_0x2bce42[_0xc528('0x35')]=_0x2bce42[_0xc528('0x35')][_0xc528('0x36')]?_0x2bce42['attributes']:_0x12d556[_0xc528('0x37')];if(_0x4e4226[_0xc528('0x31')]['includeAll']){_0x2bce42[_0xc528('0x42')]=[{'all':!![]}];}_0x2bce42=_[_0xc528('0x3e')]({},_0x2bce42,_0x4e4226['options']);return db[_0xc528('0x2d')][_0xc528('0x49')](_0x2bce42)[_0xc528('0x26')](handleEntityNotFound(_0x5de1b3,null))[_0xc528('0x26')](respondWithResult(_0x5de1b3,null))['catch'](handleError(_0x5de1b3,null));};exports[_0xc528('0x4a')]=function(_0x523577,_0x72716e){return db[_0xc528('0x2d')][_0xc528('0x4a')](_0x523577[_0xc528('0x4b')],{})[_0xc528('0x26')](respondWithResult(_0x72716e,0xc9))['catch'](handleError(_0x72716e,null));};exports['update']=function(_0x599ede,_0x5c487b){if(_0x599ede[_0xc528('0x4b')]['id']){delete _0x599ede['body']['id'];}return db[_0xc528('0x2d')][_0xc528('0x49')]({'where':{'id':_0x599ede[_0xc528('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c487b,null))[_0xc528('0x26')](saveUpdates(_0x599ede[_0xc528('0x4b')],null))[_0xc528('0x26')](respondWithResult(_0x5c487b,null))['catch'](handleError(_0x5c487b,null));};exports['destroy']=function(_0x1b1a79,_0x4ae503){return db[_0xc528('0x2d')]['find']({'where':{'id':_0x1b1a79['params']['id']}})[_0xc528('0x26')](handleEntityNotFound(_0x4ae503,null))['then'](removeEntity(_0x4ae503,null))['catch'](handleError(_0x4ae503,null));};exports[_0xc528('0x4c')]=function(_0x32e860,_0x3ef740,_0x362c99){var _0x2263d6={};var _0x157531={};var _0x23ded0;var _0x217e26;return db['FreshdeskConfiguration'][_0xc528('0x4d')]({'where':{'id':_0x32e860[_0xc528('0x47')]['id']}})[_0xc528('0x26')](handleEntityNotFound(_0x3ef740,null))[_0xc528('0x26')](function(_0x236769){if(_0x236769){_0x23ded0=_0x236769;_0x157531['model']=_[_0xc528('0x32')](db[_0xc528('0x4e')][_0xc528('0x2e')]);_0x157531[_0xc528('0x31')]=_['keys'](_0x32e860[_0xc528('0x31')]);_0x157531[_0xc528('0x33')]=_[_0xc528('0x48')](_0x157531[_0xc528('0x37')],_0x157531[_0xc528('0x31')]);_0x2263d6[_0xc528('0x35')]=_[_0xc528('0x48')](_0x157531[_0xc528('0x37')],qs[_0xc528('0x34')](_0x32e860[_0xc528('0x31')][_0xc528('0x34')]));_0x2263d6['attributes']=_0x2263d6[_0xc528('0x35')][_0xc528('0x36')]?_0x2263d6[_0xc528('0x35')]:_0x157531[_0xc528('0x37')];_0x2263d6[_0xc528('0x4f')]=qs[_0xc528('0x3a')](_0x32e860['query']['sort']);_0x2263d6[_0xc528('0x3d')]=qs[_0xc528('0x33')](_[_0xc528('0x3b')](_0x32e860[_0xc528('0x31')],_0x157531[_0xc528('0x33')]));if(_0x32e860[_0xc528('0x31')][_0xc528('0x3c')]){_0x2263d6[_0xc528('0x3d')]=_[_0xc528('0x3e')](_0x2263d6['where'],{'$or':_[_0xc528('0x2c')](_0x2263d6[_0xc528('0x35')],function(_0x363c6f){var _0x5bcf3b={};_0x5bcf3b[_0x363c6f]={'$like':'%'+_0x32e860['query']['filter']+'%'};return _0x5bcf3b;})});}_0x2263d6=_[_0xc528('0x3e')]({},_0x2263d6,_0x32e860[_0xc528('0x40')]);return _0x23ded0[_0xc528('0x4c')](_0x2263d6);}})['then'](function(_0xe431a2){if(_0xe431a2){_0x217e26=_0xe431a2[_0xc528('0x36')];if(!_0x32e860[_0xc528('0x31')][_0xc528('0x38')](_0xc528('0x39'))){_0x2263d6[_0xc528('0x1e')]=qs[_0xc528('0x1e')](_0x32e860['query'][_0xc528('0x1e')]);_0x2263d6[_0xc528('0x1d')]=qs[_0xc528('0x1d')](_0x32e860['query'][_0xc528('0x1d')]);}return _0x23ded0[_0xc528('0x4c')](_0x2263d6);}})[_0xc528('0x26')](function(_0x217c9e){if(_0x217c9e){return _0x217c9e?{'count':_0x217e26,'rows':_0x217c9e}:null;}})[_0xc528('0x26')](respondWithResult(_0x3ef740,null))[_0xc528('0x45')](handleError(_0x3ef740,null));};exports[_0xc528('0x50')]=function(_0x3ebc04,_0x2501c2,_0x2bf2c1){var _0x2a7bb8={};var _0x53d62f={};var _0x2bcc8b;var _0x312963;return db[_0xc528('0x2d')][_0xc528('0x4d')]({'where':{'id':_0x3ebc04[_0xc528('0x47')]['id']}})[_0xc528('0x26')](handleEntityNotFound(_0x2501c2,null))[_0xc528('0x26')](function(_0x22bd0d){if(_0x22bd0d){_0x2bcc8b=_0x22bd0d;_0x53d62f[_0xc528('0x37')]=_[_0xc528('0x32')](db['FreshdeskField']['rawAttributes']);_0x53d62f['query']=_[_0xc528('0x32')](_0x3ebc04[_0xc528('0x31')]);_0x53d62f['filters']=_[_0xc528('0x48')](_0x53d62f[_0xc528('0x37')],_0x53d62f[_0xc528('0x31')]);_0x2a7bb8[_0xc528('0x35')]=_[_0xc528('0x48')](_0x53d62f[_0xc528('0x37')],qs[_0xc528('0x34')](_0x3ebc04[_0xc528('0x31')]['fields']));_0x2a7bb8[_0xc528('0x35')]=_0x2a7bb8['attributes'][_0xc528('0x36')]?_0x2a7bb8['attributes']:_0x53d62f[_0xc528('0x37')];_0x2a7bb8[_0xc528('0x4f')]=qs[_0xc528('0x3a')](_0x3ebc04[_0xc528('0x31')][_0xc528('0x3a')]);_0x2a7bb8[_0xc528('0x3d')]=qs[_0xc528('0x33')](_[_0xc528('0x3b')](_0x3ebc04['query'],_0x53d62f[_0xc528('0x33')]));if(_0x3ebc04['query'][_0xc528('0x3c')]){_0x2a7bb8[_0xc528('0x3d')]=_['merge'](_0x2a7bb8[_0xc528('0x3d')],{'$or':_[_0xc528('0x2c')](_0x2a7bb8[_0xc528('0x35')],function(_0x1203c7){var _0x114ced={};_0x114ced[_0x1203c7]={'$like':'%'+_0x3ebc04['query']['filter']+'%'};return _0x114ced;})});}_0x2a7bb8=_['merge']({},_0x2a7bb8,_0x3ebc04[_0xc528('0x40')]);return _0x2bcc8b[_0xc528('0x50')](_0x2a7bb8);}})[_0xc528('0x26')](function(_0x1f6b35){if(_0x1f6b35){_0x312963=_0x1f6b35[_0xc528('0x36')];if(!_0x3ebc04[_0xc528('0x31')][_0xc528('0x38')]('nolimit')){_0x2a7bb8['limit']=qs[_0xc528('0x1e')](_0x3ebc04[_0xc528('0x31')][_0xc528('0x1e')]);_0x2a7bb8[_0xc528('0x1d')]=qs[_0xc528('0x1d')](_0x3ebc04[_0xc528('0x31')][_0xc528('0x1d')]);}return _0x2bcc8b[_0xc528('0x50')](_0x2a7bb8);}})[_0xc528('0x26')](function(_0x4c06f8){if(_0x4c06f8){return _0x4c06f8?{'count':_0x312963,'rows':_0x4c06f8}:null;}})[_0xc528('0x26')](respondWithResult(_0x2501c2,null))[_0xc528('0x45')](handleError(_0x2501c2,null));};exports[_0xc528('0x51')]=function(_0x1b4961,_0x2f6dd7,_0x12c164){var _0x5ea079={};var _0x2c0ab0={};var _0x28e7f0;var _0x2ec04c;return db[_0xc528('0x2d')][_0xc528('0x4d')]({'where':{'id':_0x1b4961[_0xc528('0x47')]['id']}})[_0xc528('0x26')](handleEntityNotFound(_0x2f6dd7,null))[_0xc528('0x26')](function(_0x4d491c){if(_0x4d491c){_0x28e7f0=_0x4d491c;_0x2c0ab0[_0xc528('0x37')]=_[_0xc528('0x32')](db['FreshdeskField'][_0xc528('0x2e')]);_0x2c0ab0[_0xc528('0x31')]=_[_0xc528('0x32')](_0x1b4961[_0xc528('0x31')]);_0x2c0ab0['filters']=_[_0xc528('0x48')](_0x2c0ab0['model'],_0x2c0ab0[_0xc528('0x31')]);_0x5ea079[_0xc528('0x35')]=_[_0xc528('0x48')](_0x2c0ab0['model'],qs[_0xc528('0x34')](_0x1b4961[_0xc528('0x31')]['fields']));_0x5ea079[_0xc528('0x35')]=_0x5ea079[_0xc528('0x35')][_0xc528('0x36')]?_0x5ea079['attributes']:_0x2c0ab0[_0xc528('0x37')];_0x5ea079[_0xc528('0x4f')]=qs[_0xc528('0x3a')](_0x1b4961[_0xc528('0x31')]['sort']);_0x5ea079[_0xc528('0x3d')]=qs['filters'](_[_0xc528('0x3b')](_0x1b4961[_0xc528('0x31')],_0x2c0ab0[_0xc528('0x33')]));if(_0x1b4961[_0xc528('0x31')][_0xc528('0x3c')]){_0x5ea079[_0xc528('0x3d')]=_[_0xc528('0x3e')](_0x5ea079[_0xc528('0x3d')],{'$or':_['map'](_0x5ea079[_0xc528('0x35')],function(_0x48dd05){var _0x5496d4={};_0x5496d4[_0x48dd05]={'$like':'%'+_0x1b4961[_0xc528('0x31')][_0xc528('0x3c')]+'%'};return _0x5496d4;})});}_0x5ea079=_[_0xc528('0x3e')]({},_0x5ea079,_0x1b4961[_0xc528('0x40')]);return _0x28e7f0[_0xc528('0x51')](_0x5ea079);}})[_0xc528('0x26')](function(_0x2f604b){if(_0x2f604b){_0x2ec04c=_0x2f604b[_0xc528('0x36')];if(!_0x1b4961[_0xc528('0x31')][_0xc528('0x38')](_0xc528('0x39'))){_0x5ea079['limit']=qs[_0xc528('0x1e')](_0x1b4961[_0xc528('0x31')][_0xc528('0x1e')]);_0x5ea079[_0xc528('0x1d')]=qs[_0xc528('0x1d')](_0x1b4961['query']['offset']);}return _0x28e7f0[_0xc528('0x51')](_0x5ea079);}})[_0xc528('0x26')](function(_0x5569e3){if(_0x5569e3){return _0x5569e3?{'count':_0x2ec04c,'rows':_0x5569e3}:null;}})[_0xc528('0x26')](respondWithResult(_0x2f6dd7,null))[_0xc528('0x45')](handleError(_0x2f6dd7,null));};exports[_0xc528('0x52')]=function(_0x25a8dc,_0x228535,_0x5c8b88){var _0x171c8e={};var _0x3fd8bd={};var _0x3d417f;var _0x350da1;return db['FreshdeskConfiguration'][_0xc528('0x4d')]({'where':{'id':_0x25a8dc['params']['id']}})[_0xc528('0x26')](handleEntityNotFound(_0x228535,null))[_0xc528('0x26')](function(_0x3cd8b5){if(_0x3cd8b5){_0x3d417f=_0x3cd8b5;_0x3fd8bd[_0xc528('0x37')]=_[_0xc528('0x32')](db[_0xc528('0x53')][_0xc528('0x2e')]);_0x3fd8bd['query']=_['keys'](_0x25a8dc[_0xc528('0x31')]);_0x3fd8bd['filters']=_[_0xc528('0x48')](_0x3fd8bd[_0xc528('0x37')],_0x3fd8bd[_0xc528('0x31')]);_0x171c8e['attributes']=_[_0xc528('0x48')](_0x3fd8bd[_0xc528('0x37')],qs[_0xc528('0x34')](_0x25a8dc[_0xc528('0x31')][_0xc528('0x34')]));_0x171c8e['attributes']=_0x171c8e[_0xc528('0x35')][_0xc528('0x36')]?_0x171c8e[_0xc528('0x35')]:_0x3fd8bd[_0xc528('0x37')];_0x171c8e[_0xc528('0x4f')]=qs[_0xc528('0x3a')](_0x25a8dc[_0xc528('0x31')][_0xc528('0x3a')]);_0x171c8e[_0xc528('0x3d')]=qs[_0xc528('0x33')](_[_0xc528('0x3b')](_0x25a8dc[_0xc528('0x31')],_0x3fd8bd[_0xc528('0x33')]));if(_0x25a8dc[_0xc528('0x31')]['filter']){_0x171c8e['where']=_[_0xc528('0x3e')](_0x171c8e['where'],{'$or':_['map'](_0x171c8e['attributes'],function(_0xd63b8a){var _0x387cf7={};_0x387cf7[_0xd63b8a]={'$like':'%'+_0x25a8dc[_0xc528('0x31')][_0xc528('0x3c')]+'%'};return _0x387cf7;})});}_0x171c8e=_[_0xc528('0x3e')]({},_0x171c8e,_0x25a8dc[_0xc528('0x40')]);return _0x3d417f[_0xc528('0x52')](_0x171c8e);}})['then'](function(_0x22a592){if(_0x22a592){_0x350da1=_0x22a592[_0xc528('0x36')];if(!_0x25a8dc[_0xc528('0x31')][_0xc528('0x38')]('nolimit')){_0x171c8e[_0xc528('0x1e')]=qs[_0xc528('0x1e')](_0x25a8dc['query'][_0xc528('0x1e')]);_0x171c8e[_0xc528('0x1d')]=qs[_0xc528('0x1d')](_0x25a8dc[_0xc528('0x31')][_0xc528('0x1d')]);}return _0x3d417f[_0xc528('0x52')](_0x171c8e);}})[_0xc528('0x26')](function(_0x4f1b03){if(_0x4f1b03){return _0x4f1b03?{'count':_0x350da1,'rows':_0x4f1b03}:null;}})[_0xc528('0x26')](respondWithResult(_0x228535,null))[_0xc528('0x45')](handleError(_0x228535,null));};exports['setTags']=function(_0xb3a245,_0x2c01ff,_0x14a3f2){if(_0xb3a245[_0xc528('0x4b')]['id']){delete _0xb3a245[_0xc528('0x4b')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0xb3a245[_0xc528('0x47')]['id']}})[_0xc528('0x26')](handleEntityNotFound(_0x2c01ff,null))[_0xc528('0x26')](function(_0x5f31bb){if(_0x5f31bb){return _0x5f31bb[_0xc528('0x54')](_0xb3a245[_0xc528('0x4b')][_0xc528('0x55')]||[]);}return null;})[_0xc528('0x26')](respondWithResult(_0x2c01ff,null))[_0xc528('0x45')](handleError(_0x2c01ff,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1f386fd..e9472f1 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 _0xfd6a=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x158f01,_0x2af096){var _0x298a04=function(_0x45d56b){while(--_0x45d56b){_0x158f01['push'](_0x158f01['shift']());}};_0x298a04(++_0x2af096);}(_0xfd6a,0x1c8));var _0xafd6=function(_0x5938f0,_0xc9d34e){_0x5938f0=_0x5938f0-0x0;var _0x334f79=_0xfd6a[_0x5938f0];return _0x334f79;};'use strict';var _=require(_0xafd6('0x0'));var util=require(_0xafd6('0x1'));var logger=require('../../config/logger')(_0xafd6('0x2'));var moment=require(_0xafd6('0x3'));var BPromise=require(_0xafd6('0x4'));var rp=require(_0xafd6('0x5'));var fs=require('fs');var path=require(_0xafd6('0x6'));var rimraf=require(_0xafd6('0x7'));var config=require('../../config/environment');var attributes=require(_0xafd6('0x8'));module['exports']=function(_0x4c006f,_0x97edf){return _0x4c006f[_0xafd6('0x9')](_0xafd6('0xa'),attributes,{'tableName':_0xafd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x396b=['bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x396b,0xe4));var _0xb396=function(_0x5b0128,_0x411925){_0x5b0128=_0x5b0128-0x0;var _0x507086=_0x396b[_0x5b0128];return _0x507086;};'use strict';var _=require(_0xb396('0x0'));var util=require('util');var logger=require(_0xb396('0x1'))('api');var moment=require(_0xb396('0x2'));var BPromise=require(_0xb396('0x3'));var rp=require(_0xb396('0x4'));var fs=require('fs');var path=require(_0xb396('0x5'));var rimraf=require(_0xb396('0x6'));var config=require(_0xb396('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x48dc29,_0x3d7407){return _0x48dc29[_0xb396('0x8')](_0xb396('0x9'),attributes,{'tableName':_0xb396('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 7478b55..42dfdb0 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 _0xeb6c=['result','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x24c041,_0x2a4d43){var _0x256ecf=function(_0x8a0b5b){while(--_0x8a0b5b){_0x24c041['push'](_0x24c041['shift']());}};_0x256ecf(++_0x2a4d43);}(_0xeb6c,0x10f));var _0xceb6=function(_0x2a8b09,_0x5cdc37){_0x2a8b09=_0x2a8b09-0x0;var _0x731ccb=_0xeb6c[_0x2a8b09];return _0x731ccb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xceb6('0x0'));var BPromise=require(_0xceb6('0x1'));var rs=require(_0xceb6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xceb6('0x3'))(_0xceb6('0x4'));var config=require('../../config/environment');var jayson=require(_0xceb6('0x5'));var client=jayson[_0xceb6('0x6')][_0xceb6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fba15,_0x390808,_0x3237a1){return new BPromise(function(_0x6a1827,_0x178b2b){return client[_0xceb6('0x8')](_0x4fba15,_0x3237a1)[_0xceb6('0x9')](function(_0x94fbb){logger['info'](_0xceb6('0xa'),_0x390808,_0xceb6('0xb'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x390808,_0xceb6('0xb'),JSON[_0xceb6('0xc')](_0x94fbb));if(_0x94fbb['error']){if(_0x94fbb[_0xceb6('0xd')][_0xceb6('0xe')]===0x1f4){logger[_0xceb6('0xd')](_0xceb6('0xa'),_0x390808,_0x94fbb[_0xceb6('0xd')][_0xceb6('0xf')]);return _0x178b2b(_0x94fbb['error'][_0xceb6('0xf')]);}logger[_0xceb6('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x390808,_0x94fbb[_0xceb6('0xd')][_0xceb6('0xf')]);return _0x6a1827(_0x94fbb[_0xceb6('0xd')][_0xceb6('0xf')]);}else{logger[_0xceb6('0x10')](_0xceb6('0xa'),_0x390808,_0xceb6('0xb'));_0x6a1827(_0x94fbb[_0xceb6('0x11')]['message']);}})['catch'](function(_0x356578){logger[_0xceb6('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x390808,_0x356578);_0x178b2b(_0x356578);});});} \ No newline at end of file +var _0xb6d1=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x4721ff,_0x1ffdb6){var _0x126282=function(_0x51a474){while(--_0x51a474){_0x4721ff['push'](_0x4721ff['shift']());}};_0x126282(++_0x1ffdb6);}(_0xb6d1,0x125));var _0x1b6d=function(_0x1be790,_0x112549){_0x1be790=_0x1be790-0x0;var _0x7668c8=_0xb6d1[_0x1be790];return _0x7668c8;};'use strict';var _=require(_0x1b6d('0x0'));var util=require(_0x1b6d('0x1'));var moment=require(_0x1b6d('0x2'));var BPromise=require(_0x1b6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b6d('0x4'))['db'];var utils=require(_0x1b6d('0x5'));var logger=require(_0x1b6d('0x6'))(_0x1b6d('0x7'));var config=require(_0x1b6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1b6d('0x9')][_0x1b6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20ebb7,_0x16a8b4,_0x3e6381){return new BPromise(function(_0x5fdc79,_0x496d0d){return client[_0x1b6d('0xb')](_0x20ebb7,_0x3e6381)[_0x1b6d('0xc')](function(_0x466ded){logger[_0x1b6d('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x16a8b4,_0x1b6d('0xe'));logger['debug'](_0x1b6d('0xf'),_0x16a8b4,_0x1b6d('0xe'),JSON[_0x1b6d('0x10')](_0x466ded));if(_0x466ded[_0x1b6d('0x11')]){if(_0x466ded['error'][_0x1b6d('0x12')]===0x1f4){logger[_0x1b6d('0x11')](_0x1b6d('0x13'),_0x16a8b4,_0x466ded[_0x1b6d('0x11')][_0x1b6d('0x14')]);return _0x496d0d(_0x466ded['error']['message']);}logger['error'](_0x1b6d('0x13'),_0x16a8b4,_0x466ded['error']['message']);return _0x5fdc79(_0x466ded['error']['message']);}else{logger[_0x1b6d('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x16a8b4,_0x1b6d('0xe'));_0x5fdc79(_0x466ded[_0x1b6d('0x15')]['message']);}})['catch'](function(_0x6d050b){logger[_0x1b6d('0x11')](_0x1b6d('0x13'),_0x16a8b4,_0x6d050b);_0x496d0d(_0x6d050b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e565efb..6ed99bb 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 _0x0b4b=['get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x5481d9,_0x7e00b6){var _0x55defa=function(_0x2f0ea4){while(--_0x2f0ea4){_0x5481d9['push'](_0x5481d9['shift']());}};_0x55defa(++_0x7e00b6);}(_0x0b4b,0x174));var _0xb0b4=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x0b4b[_0x4f5108];return _0x2d56ca;};'use strict';var multer=require('multer');var util=require(_0xb0b4('0x0'));var path=require(_0xb0b4('0x1'));var timeout=require(_0xb0b4('0x2'));var express=require(_0xb0b4('0x3'));var router=express['Router']();var fs_extra=require(_0xb0b4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb0b4('0x5'));var config=require(_0xb0b4('0x6'));var controller=require(_0xb0b4('0x7'));router[_0xb0b4('0x8')]('/',auth[_0xb0b4('0x9')](),controller[_0xb0b4('0xa')]);router[_0xb0b4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb0b4('0xb')]);router[_0xb0b4('0xc')]('/',auth[_0xb0b4('0x9')](),controller[_0xb0b4('0xd')]);router[_0xb0b4('0xe')](_0xb0b4('0xf'),auth['isAuthenticated'](),controller[_0xb0b4('0x10')]);router[_0xb0b4('0x11')]('/:id',auth[_0xb0b4('0x9')](),controller[_0xb0b4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0103=['create','update','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xe906a5,_0x3bfd31){var _0x4fb701=function(_0x18c9f1){while(--_0x18c9f1){_0xe906a5['push'](_0xe906a5['shift']());}};_0x4fb701(++_0x3bfd31);}(_0x0103,0x194));var _0x3010=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0x0103[_0x311666];return _0x2bc692;};'use strict';var multer=require(_0x3010('0x0'));var util=require(_0x3010('0x1'));var path=require(_0x3010('0x2'));var timeout=require(_0x3010('0x3'));var express=require(_0x3010('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3010('0x5'));var config=require('../../config/environment');var controller=require(_0x3010('0x6'));router[_0x3010('0x7')]('/',auth[_0x3010('0x8')](),controller[_0x3010('0x9')]);router['get'](_0x3010('0xa'),auth[_0x3010('0x8')](),controller[_0x3010('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3010('0xc')]);router['put'](_0x3010('0xa'),auth['isAuthenticated'](),controller[_0x3010('0xd')]);router[_0x3010('0xe')](_0x3010('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3010('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 4699dba..967d20f 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 _0x2270=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string'];(function(_0x585dbb,_0x14832a){var _0x26d548=function(_0x1e98b2){while(--_0x1e98b2){_0x585dbb['push'](_0x585dbb['shift']());}};_0x26d548(++_0x14832a);}(_0x2270,0x107));var _0x0227=function(_0x34d4f7,_0x45eca1){_0x34d4f7=_0x34d4f7-0x0;var _0x46ddb2=_0x2270[_0x34d4f7];return _0x46ddb2;};'use strict';var Sequelize=require(_0x0227('0x0'));module[_0x0227('0x1')]={'type':{'type':Sequelize[_0x0227('0x2')]('string','variable',_0x0227('0x3'),_0x0227('0x4'),_0x0227('0x5')),'defaultValue':_0x0227('0x6')},'content':{'type':Sequelize[_0x0227('0x7')]},'key':{'type':Sequelize[_0x0227('0x7')]},'keyType':{'type':Sequelize[_0x0227('0x2')]('string',_0x0227('0x8'),_0x0227('0x3'))},'keyContent':{'type':Sequelize[_0x0227('0x7')]},'idField':{'type':Sequelize[_0x0227('0x7')]},'nameField':{'type':Sequelize[_0x0227('0x7')]},'customField':{'type':Sequelize[_0x0227('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0227('0x7')]}}; \ No newline at end of file +var _0x6f0e=['keyValue','picklist','STRING','exports','ENUM','string','variable','customVariable'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x6f0e,0x1e3));var _0xe6f0=function(_0x5d895c,_0x5cdab2){_0x5d895c=_0x5d895c-0x0;var _0x4ebf9a=_0x6f0e[_0x5d895c];return _0x4ebf9a;};'use strict';var Sequelize=require('sequelize');module[_0xe6f0('0x0')]={'type':{'type':Sequelize[_0xe6f0('0x1')](_0xe6f0('0x2'),_0xe6f0('0x3'),_0xe6f0('0x4'),_0xe6f0('0x5'),_0xe6f0('0x6')),'defaultValue':_0xe6f0('0x2')},'content':{'type':Sequelize[_0xe6f0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe6f0('0x1')](_0xe6f0('0x2'),_0xe6f0('0x3'),_0xe6f0('0x4'))},'keyContent':{'type':Sequelize[_0xe6f0('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe6f0('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe6f0('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f40cbde..84c2eef 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 _0x402f=['Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','FreshdeskField','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','status','limit','undefined','count','offset','set'];(function(_0x3a6f5b,_0x321438){var _0x1a0da8=function(_0x453aef){while(--_0x453aef){_0x3a6f5b['push'](_0x3a6f5b['shift']());}};_0x1a0da8(++_0x321438);}(_0x402f,0x6f));var _0xf402=function(_0x8e1436,_0x2a2aaa){_0x8e1436=_0x8e1436-0x0;var _0xbbcacd=_0x402f[_0x8e1436];return _0xbbcacd;};'use strict';var emlformat=require(_0xf402('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf402('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf402('0x2'));var BPromise=require(_0xf402('0x3'));var Mustache=require(_0xf402('0x4'));var util=require('util');var path=require(_0xf402('0x5'));var sox=require('sox');var csv=require(_0xf402('0x6'));var ejs=require(_0xf402('0x7'));var fs=require('fs');var fs_extra=require(_0xf402('0x8'));var _=require(_0xf402('0x9'));var squel=require(_0xf402('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf402('0xb'));var toCsv=require(_0xf402('0x6'));var querystring=require(_0xf402('0xc'));var Papa=require(_0xf402('0xd'));var Redis=require(_0xf402('0xe'));var authService=require(_0xf402('0xf'));var qs=require(_0xf402('0x10'));var as=require(_0xf402('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf402('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46758d,_0x4f8073){_0x4f8073=_0x4f8073||0xcc;return function(_0x5c127f){if(_0x5c127f){return _0x46758d['sendStatus'](_0x4f8073);}return _0x46758d[_0xf402('0x13')](_0x4f8073)['end']();};}function respondWithResult(_0x2ff50e,_0xb3deb6){_0xb3deb6=_0xb3deb6||0xc8;return function(_0x1ce72a){if(_0x1ce72a){return _0x2ff50e[_0xf402('0x13')](_0xb3deb6)['json'](_0x1ce72a);}};}function respondWithFilteredResult(_0x16767b,_0x4baaec){return function(_0x3af9e3){if(_0x3af9e3){var _0x5e38d8=typeof _0x4baaec['offset']==='undefined'&&typeof _0x4baaec[_0xf402('0x14')]===_0xf402('0x15');var _0xd406bf=_0x3af9e3[_0xf402('0x16')];var _0x2fbe36=_0x5e38d8?0x0:_0x4baaec[_0xf402('0x17')];var _0x3ed3eb=_0x5e38d8?_0x3af9e3[_0xf402('0x16')]:_0x4baaec[_0xf402('0x17')]+_0x4baaec[_0xf402('0x14')];var _0x5bb928;if(_0x3ed3eb>=_0xd406bf){_0x3ed3eb=_0xd406bf;_0x5bb928=0xc8;}else{_0x5bb928=0xce;}_0x16767b[_0xf402('0x13')](_0x5bb928);return _0x16767b[_0xf402('0x18')](_0xf402('0x19'),_0x2fbe36+'-'+_0x3ed3eb+'/'+_0xd406bf)[_0xf402('0x1a')](_0x3af9e3);}return null;};}function patchUpdates(_0x3d3ed4){return function(_0x30f661){try{jsonpatch[_0xf402('0x1b')](_0x30f661,_0x3d3ed4,!![]);}catch(_0xf52248){return BPromise[_0xf402('0x1c')](_0xf52248);}return _0x30f661['save']();};}function saveUpdates(_0x3cfe38,_0x4ffe46){return function(_0x297a68){if(_0x297a68){return _0x297a68[_0xf402('0x1d')](_0x3cfe38)[_0xf402('0x1e')](function(_0x477709){return _0x477709;});}return null;};}function removeEntity(_0x20dca1,_0x9cbd83){return function(_0x1b8064){if(_0x1b8064){return _0x1b8064[_0xf402('0x1f')]()[_0xf402('0x1e')](function(){_0x20dca1[_0xf402('0x13')](0xcc)[_0xf402('0x20')]();});}};}function handleEntityNotFound(_0xfad629,_0x5ddae3){return function(_0x3285bd){if(!_0x3285bd){_0xfad629[_0xf402('0x21')](0x194);}return _0x3285bd;};}function handleError(_0x28fc75,_0x35543b){_0x35543b=_0x35543b||0x1f4;return function(_0x566a3d){logger['error'](_0x566a3d[_0xf402('0x22')]);if(_0x566a3d[_0xf402('0x23')]){delete _0x566a3d[_0xf402('0x23')];}_0x28fc75[_0xf402('0x13')](_0x35543b)[_0xf402('0x24')](_0x566a3d);};}exports['index']=function(_0x39a38a,_0x47c0fb){var _0x1574e3={},_0xe3dc2f={},_0x45ead3={'count':0x0,'rows':[]};var _0xb28d88=_[_0xf402('0x25')](db['FreshdeskField'][_0xf402('0x26')],function(_0x3720c6){return{'name':_0x3720c6[_0xf402('0x27')],'type':_0x3720c6['type']['key']};});_0xe3dc2f[_0xf402('0x28')]=_[_0xf402('0x25')](_0xb28d88,_0xf402('0x23'));_0xe3dc2f[_0xf402('0x29')]=_[_0xf402('0x2a')](_0x39a38a['query']);_0xe3dc2f[_0xf402('0x2b')]=_[_0xf402('0x2c')](_0xe3dc2f[_0xf402('0x28')],_0xe3dc2f[_0xf402('0x29')]);_0x1574e3[_0xf402('0x2d')]=_[_0xf402('0x2c')](_0xe3dc2f['model'],qs[_0xf402('0x2e')](_0x39a38a[_0xf402('0x29')][_0xf402('0x2e')]));_0x1574e3['attributes']=_0x1574e3['attributes'][_0xf402('0x2f')]?_0x1574e3[_0xf402('0x2d')]:_0xe3dc2f[_0xf402('0x28')];if(!_0x39a38a['query'][_0xf402('0x30')](_0xf402('0x31'))){_0x1574e3[_0xf402('0x14')]=qs[_0xf402('0x14')](_0x39a38a[_0xf402('0x29')][_0xf402('0x14')]);_0x1574e3['offset']=qs[_0xf402('0x17')](_0x39a38a[_0xf402('0x29')][_0xf402('0x17')]);}_0x1574e3[_0xf402('0x32')]=qs[_0xf402('0x33')](_0x39a38a['query'][_0xf402('0x33')]);_0x1574e3[_0xf402('0x34')]=qs[_0xf402('0x2b')](_['pick'](_0x39a38a['query'],_0xe3dc2f[_0xf402('0x2b')]),_0xb28d88);if(_0x39a38a['query'][_0xf402('0x35')]){_0x1574e3[_0xf402('0x34')]=_['merge'](_0x1574e3[_0xf402('0x34')],{'$or':_[_0xf402('0x25')](_0xb28d88,function(_0x2bb0b1){if(_0x2bb0b1[_0xf402('0x36')]!==_0xf402('0x37')){var _0x1f224e={};_0x1f224e[_0x2bb0b1[_0xf402('0x23')]]={'$like':'%'+_0x39a38a[_0xf402('0x29')]['filter']+'%'};return _0x1f224e;}})});}_0x1574e3=_[_0xf402('0x38')]({},_0x1574e3,_0x39a38a[_0xf402('0x39')]);var _0xc36243={'where':_0x1574e3[_0xf402('0x34')]};return db[_0xf402('0x3a')]['count'](_0xc36243)[_0xf402('0x1e')](function(_0x5de8c5){_0x45ead3[_0xf402('0x16')]=_0x5de8c5;if(_0x39a38a[_0xf402('0x29')][_0xf402('0x3b')]){_0x1574e3[_0xf402('0x3c')]=[{'all':!![]}];}return db[_0xf402('0x3a')][_0xf402('0x3d')](_0x1574e3);})[_0xf402('0x1e')](function(_0x5d8a26){_0x45ead3['rows']=_0x5d8a26;return _0x45ead3;})[_0xf402('0x1e')](respondWithFilteredResult(_0x47c0fb,_0x1574e3))[_0xf402('0x3e')](handleError(_0x47c0fb,null));};exports[_0xf402('0x3f')]=function(_0x350d71,_0x14fa65){var _0x1fe222={'raw':!![],'where':{'id':_0x350d71[_0xf402('0x40')]['id']}},_0x488587={};_0x488587[_0xf402('0x28')]=_[_0xf402('0x2a')](db[_0xf402('0x3a')]['rawAttributes']);_0x488587[_0xf402('0x29')]=_[_0xf402('0x2a')](_0x350d71[_0xf402('0x29')]);_0x488587[_0xf402('0x2b')]=_[_0xf402('0x2c')](_0x488587[_0xf402('0x28')],_0x488587['query']);_0x1fe222[_0xf402('0x2d')]=_[_0xf402('0x2c')](_0x488587['model'],qs['fields'](_0x350d71[_0xf402('0x29')][_0xf402('0x2e')]));_0x1fe222['attributes']=_0x1fe222[_0xf402('0x2d')][_0xf402('0x2f')]?_0x1fe222[_0xf402('0x2d')]:_0x488587['model'];if(_0x350d71[_0xf402('0x29')]['includeAll']){_0x1fe222[_0xf402('0x3c')]=[{'all':!![]}];}_0x1fe222=_['merge']({},_0x1fe222,_0x350d71[_0xf402('0x39')]);return db[_0xf402('0x3a')]['find'](_0x1fe222)['then'](handleEntityNotFound(_0x14fa65,null))[_0xf402('0x1e')](respondWithResult(_0x14fa65,null))[_0xf402('0x3e')](handleError(_0x14fa65,null));};exports['create']=function(_0x4afd40,_0x213c51){return db[_0xf402('0x3a')][_0xf402('0x41')](_0x4afd40[_0xf402('0x42')],{})[_0xf402('0x1e')](respondWithResult(_0x213c51,0xc9))[_0xf402('0x3e')](handleError(_0x213c51,null));};exports[_0xf402('0x1d')]=function(_0xf91b26,_0x48dc6){if(_0xf91b26['body']['id']){delete _0xf91b26[_0xf402('0x42')]['id'];}return db[_0xf402('0x3a')][_0xf402('0x43')]({'where':{'id':_0xf91b26['params']['id']}})[_0xf402('0x1e')](handleEntityNotFound(_0x48dc6,null))[_0xf402('0x1e')](saveUpdates(_0xf91b26[_0xf402('0x42')],null))[_0xf402('0x1e')](respondWithResult(_0x48dc6,null))['catch'](handleError(_0x48dc6,null));};exports[_0xf402('0x1f')]=function(_0x411fa3,_0x206601){return db[_0xf402('0x3a')][_0xf402('0x43')]({'where':{'id':_0x411fa3[_0xf402('0x40')]['id']}})[_0xf402('0x1e')](handleEntityNotFound(_0x206601,null))[_0xf402('0x1e')](removeEntity(_0x206601,null))[_0xf402('0x3e')](handleError(_0x206601,null));}; \ No newline at end of file +var _0xdb94=['intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskField','rawAttributes','type','model','query','keys'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xdb94,0xab));var _0x4db9=function(_0x2601dc,_0x3aa303){_0x2601dc=_0x2601dc-0x0;var _0xe4804e=_0xdb94[_0x2601dc];return _0xe4804e;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x26')]();});}};}function handleEntityNotFound(_0x2987c6,_0x4dbb1b){return function(_0x3c8237){if(!_0x3c8237){_0x2987c6[_0x4db9('0x17')](0x194);}return _0x3c8237;};}function handleError(_0x43b95e,_0x2d330e){_0x2d330e=_0x2d330e||0x1f4;return function(_0x3f9f7e){logger[_0x4db9('0x27')](_0x3f9f7e[_0x4db9('0x28')]);if(_0x3f9f7e[_0x4db9('0x29')]){delete _0x3f9f7e[_0x4db9('0x29')];}_0x43b95e[_0x4db9('0x18')](_0x2d330e)[_0x4db9('0x2a')](_0x3f9f7e);};}exports[_0x4db9('0x2b')]=function(_0x2d646d,_0x20f133){var _0x583861={},_0x5031fe={},_0x3951b2={'count':0x0,'rows':[]};var _0x331279=_[_0x4db9('0x2c')](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x459131){return{'name':_0x459131['fieldName'],'type':_0x459131[_0x4db9('0x2f')]['key']};});_0x5031fe[_0x4db9('0x30')]=_[_0x4db9('0x2c')](_0x331279,_0x4db9('0x29'));_0x5031fe[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x2d646d['query']);_0x5031fe['filters']=_[_0x4db9('0x33')](_0x5031fe['model'],_0x5031fe[_0x4db9('0x31')]);_0x583861[_0x4db9('0x34')]=_['intersection'](_0x5031fe[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x2d646d[_0x4db9('0x31')]['fields']));_0x583861[_0x4db9('0x34')]=_0x583861['attributes'][_0x4db9('0x36')]?_0x583861[_0x4db9('0x34')]:_0x5031fe[_0x4db9('0x30')];if(!_0x2d646d['query']['hasOwnProperty'](_0x4db9('0x37'))){_0x583861[_0x4db9('0x1c')]=qs[_0x4db9('0x1c')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x1c')]);_0x583861[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x19')]);}_0x583861['order']=qs[_0x4db9('0x38')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x38')]);_0x583861[_0x4db9('0x39')]=qs['filters'](_[_0x4db9('0x3a')](_0x2d646d[_0x4db9('0x31')],_0x5031fe[_0x4db9('0x3b')]),_0x331279);if(_0x2d646d['query'][_0x4db9('0x3c')]){_0x583861[_0x4db9('0x39')]=_[_0x4db9('0x3d')](_0x583861[_0x4db9('0x39')],{'$or':_['map'](_0x331279,function(_0x5a78b4){if(_0x5a78b4[_0x4db9('0x2f')]!==_0x4db9('0x3e')){var _0x32e62b={};_0x32e62b[_0x5a78b4[_0x4db9('0x29')]]={'$like':'%'+_0x2d646d[_0x4db9('0x31')]['filter']+'%'};return _0x32e62b;}})});}_0x583861=_[_0x4db9('0x3d')]({},_0x583861,_0x2d646d[_0x4db9('0x3f')]);var _0x23affc={'where':_0x583861[_0x4db9('0x39')]};return db[_0x4db9('0x2d')]['count'](_0x23affc)[_0x4db9('0x24')](function(_0x324765){_0x3951b2[_0x4db9('0x1b')]=_0x324765;if(_0x2d646d['query'][_0x4db9('0x40')]){_0x583861[_0x4db9('0x41')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x42')](_0x583861);})[_0x4db9('0x24')](function(_0x24aa2a){_0x3951b2[_0x4db9('0x43')]=_0x24aa2a;return _0x3951b2;})[_0x4db9('0x24')](respondWithFilteredResult(_0x20f133,_0x583861))[_0x4db9('0x44')](handleError(_0x20f133,null));};exports[_0x4db9('0x45')]=function(_0x4bb740,_0x56bd68){var _0x48aaf5={'raw':!![],'where':{'id':_0x4bb740[_0x4db9('0x46')]['id']}},_0x22a021={};_0x22a021['model']=_[_0x4db9('0x32')](db[_0x4db9('0x2d')]['rawAttributes']);_0x22a021['query']=_[_0x4db9('0x32')](_0x4bb740['query']);_0x22a021[_0x4db9('0x3b')]=_[_0x4db9('0x33')](_0x22a021['model'],_0x22a021[_0x4db9('0x31')]);_0x48aaf5[_0x4db9('0x34')]=_['intersection'](_0x22a021[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x4bb740[_0x4db9('0x31')]['fields']));_0x48aaf5['attributes']=_0x48aaf5[_0x4db9('0x34')][_0x4db9('0x36')]?_0x48aaf5[_0x4db9('0x34')]:_0x22a021[_0x4db9('0x30')];if(_0x4bb740[_0x4db9('0x31')][_0x4db9('0x40')]){_0x48aaf5[_0x4db9('0x41')]=[{'all':!![]}];}_0x48aaf5=_[_0x4db9('0x3d')]({},_0x48aaf5,_0x4bb740[_0x4db9('0x3f')]);return db[_0x4db9('0x2d')][_0x4db9('0x47')](_0x48aaf5)[_0x4db9('0x24')](handleEntityNotFound(_0x56bd68,null))[_0x4db9('0x24')](respondWithResult(_0x56bd68,null))['catch'](handleError(_0x56bd68,null));};exports[_0x4db9('0x48')]=function(_0x2faacf,_0x3852f0){return db[_0x4db9('0x2d')][_0x4db9('0x48')](_0x2faacf[_0x4db9('0x49')],{})[_0x4db9('0x24')](respondWithResult(_0x3852f0,0xc9))[_0x4db9('0x44')](handleError(_0x3852f0,null));};exports[_0x4db9('0x23')]=function(_0x2d6094,_0x10dccb){if(_0x2d6094['body']['id']){delete _0x2d6094['body']['id'];}return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0x2d6094[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x10dccb,null))[_0x4db9('0x24')](saveUpdates(_0x2d6094[_0x4db9('0x49')],null))[_0x4db9('0x24')](respondWithResult(_0x10dccb,null))[_0x4db9('0x44')](handleError(_0x10dccb,null));};exports['destroy']=function(_0xd8eae3,_0xcb832e){return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0xd8eae3[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0xcb832e,null))[_0x4db9('0x24')](removeEntity(_0xcb832e,null))[_0x4db9('0x44')](handleError(_0xcb832e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 72647e9..3ce878f 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 _0x53a6=['int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','FreshdeskField'];(function(_0x192b9d,_0x95aa4a){var _0x40c1d5=function(_0x5eb808){while(--_0x5eb808){_0x192b9d['push'](_0x192b9d['shift']());}};_0x40c1d5(++_0x95aa4a);}(_0x53a6,0x18f));var _0x653a=function(_0x524f81,_0x4e7d66){_0x524f81=_0x524f81-0x0;var _0x579f2c=_0x53a6[_0x524f81];return _0x579f2c;};'use strict';var _=require(_0x653a('0x0'));var util=require('util');var logger=require(_0x653a('0x1'))('api');var moment=require(_0x653a('0x2'));var BPromise=require(_0x653a('0x3'));var rp=require(_0x653a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x653a('0x5'));var config=require(_0x653a('0x6'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x1fd90f,_0x197706){return _0x1fd90f[_0x653a('0x7')](_0x653a('0x8'),attributes,{'tableName':_0x653a('0x9'),'paranoid':![],'indexes':[{'name':_0x653a('0xa'),'fields':['idField',_0x653a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f5a=['define','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x4d845f,_0xef45b3){var _0x1b7443=function(_0x3571e0){while(--_0x3571e0){_0x4d845f['push'](_0x4d845f['shift']());}};_0x1b7443(++_0xef45b3);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0x4ae763,_0x5e3c1f){_0x4ae763=_0x4ae763-0x0;var _0x58ffaf=_0x6f5a[_0x4ae763];return _0x58ffaf;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var logger=require(_0xa6f5('0x2'))('api');var moment=require(_0xa6f5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f5('0x4'));var rimraf=require(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var attributes=require(_0xa6f5('0x7'));module[_0xa6f5('0x8')]=function(_0x4cf735,_0x21be4d){return _0x4cf735[_0xa6f5('0x9')]('FreshdeskField',attributes,{'tableName':_0xa6f5('0xa'),'paranoid':![],'indexes':[{'name':_0xa6f5('0xb'),'fields':[_0xa6f5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 9baa949..c0229ed 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 _0x7fd7=['FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x256588,_0x3a1697){var _0x44b62f=function(_0x146b0d){while(--_0x146b0d){_0x256588['push'](_0x256588['shift']());}};_0x44b62f(++_0x3a1697);}(_0x7fd7,0x68));var _0x77fd=function(_0x4b140e,_0x3b2701){_0x4b140e=_0x4b140e-0x0;var _0x1d5789=_0x7fd7[_0x4b140e];return _0x1d5789;};'use strict';var _=require(_0x77fd('0x0'));var util=require(_0x77fd('0x1'));var moment=require(_0x77fd('0x2'));var BPromise=require(_0x77fd('0x3'));var rs=require(_0x77fd('0x4'));var fs=require('fs');var Redis=require(_0x77fd('0x5'));var db=require(_0x77fd('0x6'))['db'];var utils=require(_0x77fd('0x7'));var logger=require(_0x77fd('0x8'))(_0x77fd('0x9'));var config=require('../../config/environment');var jayson=require(_0x77fd('0xa'));var client=jayson[_0x77fd('0xb')][_0x77fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11578d,_0x3816c0,_0xa245da){return new BPromise(function(_0x33cf10,_0x588ad2){return client[_0x77fd('0xd')](_0x11578d,_0xa245da)[_0x77fd('0xe')](function(_0x4f8a58){logger[_0x77fd('0xf')](_0x77fd('0x10'),_0x3816c0,_0x77fd('0x11'));logger[_0x77fd('0x12')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3816c0,'request\x20sent',JSON[_0x77fd('0x13')](_0x4f8a58));if(_0x4f8a58[_0x77fd('0x14')]){if(_0x4f8a58[_0x77fd('0x14')][_0x77fd('0x15')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3816c0,_0x4f8a58[_0x77fd('0x14')]['message']);return _0x588ad2(_0x4f8a58[_0x77fd('0x14')][_0x77fd('0x16')]);}logger[_0x77fd('0x14')](_0x77fd('0x10'),_0x3816c0,_0x4f8a58['error'][_0x77fd('0x16')]);return _0x33cf10(_0x4f8a58[_0x77fd('0x14')][_0x77fd('0x16')]);}else{logger[_0x77fd('0xf')](_0x77fd('0x10'),_0x3816c0,_0x77fd('0x11'));_0x33cf10(_0x4f8a58[_0x77fd('0x17')][_0x77fd('0x16')]);}})['catch'](function(_0x3db142){logger[_0x77fd('0x14')](_0x77fd('0x10'),_0x3816c0,_0x3db142);_0x588ad2(_0x3db142);});});} \ No newline at end of file +var _0x84a1=['info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x84a1,0x172));var _0x184a=function(_0x2db568,_0x37db76){_0x2db568=_0x2db568-0x0;var _0x3bb690=_0x84a1[_0x2db568];return _0x3bb690;};'use strict';var _=require('lodash');var util=require(_0x184a('0x0'));var moment=require('moment');var BPromise=require(_0x184a('0x1'));var rs=require(_0x184a('0x2'));var fs=require('fs');var Redis=require(_0x184a('0x3'));var db=require(_0x184a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x184a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x184a('0x6')][_0x184a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ae569,_0x3b770a,_0x4ff3fc){return new BPromise(function(_0x44b664,_0x52bcc2){return client[_0x184a('0x8')](_0x2ae569,_0x4ff3fc)[_0x184a('0x9')](function(_0x7b7f72){logger[_0x184a('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x3b770a,_0x184a('0xb'));logger[_0x184a('0xc')](_0x184a('0xd'),_0x3b770a,_0x184a('0xb'),JSON[_0x184a('0xe')](_0x7b7f72));if(_0x7b7f72[_0x184a('0xf')]){if(_0x7b7f72[_0x184a('0xf')][_0x184a('0x10')]===0x1f4){logger[_0x184a('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x52bcc2(_0x7b7f72[_0x184a('0xf')]['message']);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x44b664(_0x7b7f72[_0x184a('0xf')]['message']);}else{logger['info'](_0x184a('0x11'),_0x3b770a,'request\x20sent');_0x44b664(_0x7b7f72['result'][_0x184a('0x12')]);}})[_0x184a('0x13')](function(_0x396e0f){logger[_0x184a('0xf')](_0x184a('0x11'),_0x3b770a,_0x396e0f);_0x52bcc2(_0x396e0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 3d262f2..d371fae 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 _0x1be1=['getFields','post','create','addConfiguration','/:id','delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields'];(function(_0x2a307a,_0x57cd48){var _0x10637c=function(_0x22d2d2){while(--_0x22d2d2){_0x2a307a['push'](_0x2a307a['shift']());}};_0x10637c(++_0x57cd48);}(_0x1be1,0x192));var _0x11be=function(_0x3fe465,_0x3e1b7f){_0x3fe465=_0x3fe465-0x0;var _0x52b196=_0x1be1[_0x3fe465];return _0x52b196;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['getConfigurations']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),controller[_0x11be('0xe')]);router['post'](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xf')]);router['put'](_0x11be('0x10'),auth[_0x11be('0x8')](),controller['update']);router[_0x11be('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xda3f=['/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x223b0c,_0x371c5a){var _0x4ce5ed=function(_0x528c8b){while(--_0x528c8b){_0x223b0c['push'](_0x223b0c['shift']());}};_0x4ce5ed(++_0x371c5a);}(_0xda3f,0xec));var _0xfda3=function(_0x4d5e39,_0x22f1ce){_0x4d5e39=_0x4d5e39-0x0;var _0x43cd12=_0xda3f[_0x4d5e39];return _0x43cd12;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intFreshsalesAccount.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')]('/',auth['isAuthenticated'](),controller[_0xfda3('0xe')]);router[_0xfda3('0xd')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xf')]);router['put'](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfda3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 9d8bbcc..d92b982 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 _0xcf2f=['exports','STRING','remoteUri','sequelize'];(function(_0x4b916c,_0x52c3a7){var _0xd1e366=function(_0x4a0543){while(--_0x4a0543){_0x4b916c['push'](_0x4b916c['shift']());}};_0xd1e366(++_0x52c3a7);}(_0xcf2f,0xa7));var _0xfcf2=function(_0xdae83b,_0x4979a6){_0xdae83b=_0xdae83b-0x0;var _0x187359=_0xcf2f[_0xdae83b];return _0x187359;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'name':{'type':Sequelize[_0xfcf2('0x2')]},'description':{'type':Sequelize[_0xfcf2('0x2')]},'username':{'type':Sequelize[_0xfcf2('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfcf2('0x2')]},'remoteUri':{'type':Sequelize[_0xfcf2('0x2')],'unique':_0xfcf2('0x3')},'serverUrl':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x301764,_0x5ce9e1){var _0xac6f49=function(_0x25f734){while(--_0x25f734){_0x301764['push'](_0x301764['shift']());}};_0xac6f49(++_0x5ce9e1);}(_0xd943,0x15d));var _0x3d94=function(_0x377698,_0x865115){_0x377698=_0x377698-0x0;var _0x5826e3=_0xd943[_0x377698];return _0x5826e3;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('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 735781f..d14846f 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 _0xffac=['fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','then','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshsalesField','getFields','username','apiKey','remoteUri','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs'];(function(_0x4dee7d,_0x5a85d1){var _0x48f4ec=function(_0x569c33){while(--_0x569c33){_0x4dee7d['push'](_0x4dee7d['shift']());}};_0x48f4ec(++_0x5a85d1);}(_0xffac,0x126));var _0xcffa=function(_0x2937dd,_0x48f238){_0x2937dd=_0x2937dd-0x0;var _0x246d78=_0xffac[_0x2937dd];return _0x246d78;};'use strict';var emlformat=require(_0xcffa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcffa('0x1'));var rp=require(_0xcffa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcffa('0x3'));var util=require(_0xcffa('0x4'));var path=require(_0xcffa('0x5'));var sox=require(_0xcffa('0x6'));var csv=require(_0xcffa('0x7'));var ejs=require(_0xcffa('0x8'));var fs=require('fs');var fs_extra=require(_0xcffa('0x9'));var _=require(_0xcffa('0xa'));var squel=require('squel');var crypto=require(_0xcffa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcffa('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcffa('0xd'));var Papa=require(_0xcffa('0xe'));var Redis=require(_0xcffa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcffa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcffa('0x11'));var logger=require(_0xcffa('0x12'))(_0xcffa('0x13'));var utils=require(_0xcffa('0x14'));var config=require(_0xcffa('0x15'));var licenseUtil=require(_0xcffa('0x16'));var db=require(_0xcffa('0x17'))['db'];var integrations=require(_0xcffa('0x18'));function respondWithStatusCode(_0x52bbbe,_0x4f6be3){_0x4f6be3=_0x4f6be3||0xcc;return function(_0xa07d13){if(_0xa07d13){return _0x52bbbe[_0xcffa('0x19')](_0x4f6be3);}return _0x52bbbe[_0xcffa('0x1a')](_0x4f6be3)[_0xcffa('0x1b')]();};}function respondWithResult(_0xbb1b53,_0x739a20){_0x739a20=_0x739a20||0xc8;return function(_0x1c2a0e){if(_0x1c2a0e){return _0xbb1b53['status'](_0x739a20)[_0xcffa('0x1c')](_0x1c2a0e);}};}function respondWithFilteredResult(_0x4b1e63,_0x3fdac6){return function(_0x2ee6cc){if(_0x2ee6cc){var _0x12b651=typeof _0x3fdac6['offset']==='undefined'&&typeof _0x3fdac6[_0xcffa('0x1d')]===_0xcffa('0x1e');var _0x416aa2=_0x2ee6cc[_0xcffa('0x1f')];var _0x4dd5f9=_0x12b651?0x0:_0x3fdac6[_0xcffa('0x20')];var _0x206925=_0x12b651?_0x2ee6cc['count']:_0x3fdac6[_0xcffa('0x20')]+_0x3fdac6[_0xcffa('0x1d')];var _0x252c95;if(_0x206925>=_0x416aa2){_0x206925=_0x416aa2;_0x252c95=0xc8;}else{_0x252c95=0xce;}_0x4b1e63[_0xcffa('0x1a')](_0x252c95);return _0x4b1e63[_0xcffa('0x21')](_0xcffa('0x22'),_0x4dd5f9+'-'+_0x206925+'/'+_0x416aa2)[_0xcffa('0x1c')](_0x2ee6cc);}return null;};}function patchUpdates(_0x51618b){return function(_0x22a131){try{jsonpatch['apply'](_0x22a131,_0x51618b,!![]);}catch(_0x4e70ed){return BPromise[_0xcffa('0x23')](_0x4e70ed);}return _0x22a131[_0xcffa('0x24')]();};}function saveUpdates(_0x4800c4,_0x3e3150){return function(_0xe7280f){if(_0xe7280f){return _0xe7280f['update'](_0x4800c4)['then'](function(_0x2e611f){return _0x2e611f;});}return null;};}function removeEntity(_0x532c8d,_0x3edd19){return function(_0x5e2cd4){if(_0x5e2cd4){return _0x5e2cd4[_0xcffa('0x25')]()[_0xcffa('0x26')](function(){_0x532c8d[_0xcffa('0x1a')](0xcc)[_0xcffa('0x1b')]();});}};}function handleEntityNotFound(_0x5850c1,_0x1b0f5b){return function(_0x3aee52){if(!_0x3aee52){_0x5850c1[_0xcffa('0x19')](0x194);}return _0x3aee52;};}function handleError(_0x3395cf,_0x1f4177){_0x1f4177=_0x1f4177||0x1f4;return function(_0x2c33ac){logger[_0xcffa('0x27')](_0x2c33ac[_0xcffa('0x28')]);if(_0x2c33ac['name']){delete _0x2c33ac[_0xcffa('0x29')];}_0x3395cf[_0xcffa('0x1a')](_0x1f4177)[_0xcffa('0x2a')](_0x2c33ac);};}exports['index']=function(_0x2b2c01,_0x46ad0e){var _0x544a21={},_0x65d62b={},_0x3de9f3={'count':0x0,'rows':[]};var _0x1c770e=_[_0xcffa('0x2b')](db[_0xcffa('0x2c')][_0xcffa('0x2d')],function(_0x25a44a){return{'name':_0x25a44a[_0xcffa('0x2e')],'type':_0x25a44a[_0xcffa('0x2f')][_0xcffa('0x30')]};});_0x65d62b['model']=_[_0xcffa('0x2b')](_0x1c770e,_0xcffa('0x29'));_0x65d62b[_0xcffa('0x31')]=_[_0xcffa('0x32')](_0x2b2c01['query']);_0x65d62b[_0xcffa('0x33')]=_[_0xcffa('0x34')](_0x65d62b[_0xcffa('0x35')],_0x65d62b[_0xcffa('0x31')]);_0x544a21[_0xcffa('0x36')]=_['intersection'](_0x65d62b['model'],qs[_0xcffa('0x37')](_0x2b2c01[_0xcffa('0x31')][_0xcffa('0x37')]));_0x544a21[_0xcffa('0x36')]=_0x544a21[_0xcffa('0x36')][_0xcffa('0x38')]?_0x544a21[_0xcffa('0x36')]:_0x65d62b['model'];if(!_0x2b2c01[_0xcffa('0x31')]['hasOwnProperty'](_0xcffa('0x39'))){_0x544a21[_0xcffa('0x1d')]=qs[_0xcffa('0x1d')](_0x2b2c01[_0xcffa('0x31')][_0xcffa('0x1d')]);_0x544a21[_0xcffa('0x20')]=qs[_0xcffa('0x20')](_0x2b2c01[_0xcffa('0x31')][_0xcffa('0x20')]);}_0x544a21['order']=qs[_0xcffa('0x3a')](_0x2b2c01[_0xcffa('0x31')][_0xcffa('0x3a')]);_0x544a21[_0xcffa('0x3b')]=qs[_0xcffa('0x33')](_[_0xcffa('0x3c')](_0x2b2c01[_0xcffa('0x31')],_0x65d62b[_0xcffa('0x33')]),_0x1c770e);if(_0x2b2c01[_0xcffa('0x31')][_0xcffa('0x3d')]){_0x544a21[_0xcffa('0x3b')]=_[_0xcffa('0x3e')](_0x544a21['where'],{'$or':_[_0xcffa('0x2b')](_0x1c770e,function(_0x23e56f){if(_0x23e56f[_0xcffa('0x2f')]!==_0xcffa('0x3f')){var _0x5d9198={};_0x5d9198[_0x23e56f[_0xcffa('0x29')]]={'$like':'%'+_0x2b2c01['query']['filter']+'%'};return _0x5d9198;}})});}_0x544a21=_[_0xcffa('0x3e')]({},_0x544a21,_0x2b2c01['options']);var _0x493c51={'where':_0x544a21[_0xcffa('0x3b')]};return db[_0xcffa('0x2c')][_0xcffa('0x1f')](_0x493c51)[_0xcffa('0x26')](function(_0x1ba136){_0x3de9f3[_0xcffa('0x1f')]=_0x1ba136;if(_0x2b2c01[_0xcffa('0x31')][_0xcffa('0x40')]){_0x544a21[_0xcffa('0x41')]=[{'all':!![]}];}return db[_0xcffa('0x2c')][_0xcffa('0x42')](_0x544a21);})[_0xcffa('0x26')](function(_0x47231c){_0x3de9f3[_0xcffa('0x43')]=_0x47231c;return _0x3de9f3;})[_0xcffa('0x26')](respondWithFilteredResult(_0x46ad0e,_0x544a21))[_0xcffa('0x44')](handleError(_0x46ad0e,null));};exports['show']=function(_0x5134b3,_0x317105){var _0x5eaa9b={'raw':![],'where':{'id':_0x5134b3['params']['id']}},_0x1d72da={};_0x1d72da[_0xcffa('0x35')]=_[_0xcffa('0x32')](db[_0xcffa('0x2c')]['rawAttributes']);_0x1d72da[_0xcffa('0x31')]=_[_0xcffa('0x32')](_0x5134b3[_0xcffa('0x31')]);_0x1d72da[_0xcffa('0x33')]=_['intersection'](_0x1d72da[_0xcffa('0x35')],_0x1d72da[_0xcffa('0x31')]);_0x5eaa9b[_0xcffa('0x36')]=_[_0xcffa('0x34')](_0x1d72da[_0xcffa('0x35')],qs[_0xcffa('0x37')](_0x5134b3[_0xcffa('0x31')][_0xcffa('0x37')]));_0x5eaa9b[_0xcffa('0x36')]=_0x5eaa9b['attributes'][_0xcffa('0x38')]?_0x5eaa9b[_0xcffa('0x36')]:_0x1d72da[_0xcffa('0x35')];if(_0x5134b3[_0xcffa('0x31')][_0xcffa('0x40')]){_0x5eaa9b[_0xcffa('0x41')]=[{'all':!![]}];}_0x5eaa9b=_[_0xcffa('0x3e')]({},_0x5eaa9b,_0x5134b3[_0xcffa('0x45')]);return db['FreshsalesAccount'][_0xcffa('0x46')](_0x5eaa9b)[_0xcffa('0x26')](handleEntityNotFound(_0x317105,null))[_0xcffa('0x26')](respondWithResult(_0x317105,null))[_0xcffa('0x44')](handleError(_0x317105,null));};exports[_0xcffa('0x47')]=function(_0x2db2b7,_0x10b133){return db[_0xcffa('0x2c')][_0xcffa('0x47')](_0x2db2b7[_0xcffa('0x48')],{})['then'](respondWithResult(_0x10b133,0xc9))['catch'](handleError(_0x10b133,null));};exports[_0xcffa('0x49')]=function(_0x3f5f89,_0xa45168){if(_0x3f5f89[_0xcffa('0x48')]['id']){delete _0x3f5f89[_0xcffa('0x48')]['id'];}return db[_0xcffa('0x2c')][_0xcffa('0x46')]({'where':{'id':_0x3f5f89[_0xcffa('0x4a')]['id']}})[_0xcffa('0x26')](handleEntityNotFound(_0xa45168,null))['then'](saveUpdates(_0x3f5f89[_0xcffa('0x48')],null))[_0xcffa('0x26')](respondWithResult(_0xa45168,null))['catch'](handleError(_0xa45168,null));};exports[_0xcffa('0x25')]=function(_0x34c0a0,_0x382a54){return db[_0xcffa('0x2c')][_0xcffa('0x46')]({'where':{'id':_0x34c0a0[_0xcffa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x382a54,null))['then'](removeEntity(_0x382a54,null))[_0xcffa('0x44')](handleError(_0x382a54,null));};exports['getConfigurations']=function(_0x342289,_0x348559,_0x21189c){var _0x5f2bca={};var _0x3d9671={};var _0x4f15f2;var _0x5243b9;return db[_0xcffa('0x2c')][_0xcffa('0x4b')]({'where':{'id':_0x342289[_0xcffa('0x4a')]['id']}})[_0xcffa('0x26')](handleEntityNotFound(_0x348559,null))[_0xcffa('0x26')](function(_0xdd262a){if(_0xdd262a){_0x4f15f2=_0xdd262a;_0x3d9671[_0xcffa('0x35')]=_['keys'](db[_0xcffa('0x4c')]['rawAttributes']);_0x3d9671['query']=_['keys'](_0x342289[_0xcffa('0x31')]);_0x3d9671[_0xcffa('0x33')]=_[_0xcffa('0x34')](_0x3d9671[_0xcffa('0x35')],_0x3d9671[_0xcffa('0x31')]);_0x5f2bca[_0xcffa('0x36')]=_['intersection'](_0x3d9671[_0xcffa('0x35')],qs[_0xcffa('0x37')](_0x342289[_0xcffa('0x31')][_0xcffa('0x37')]));_0x5f2bca[_0xcffa('0x36')]=_0x5f2bca['attributes'][_0xcffa('0x38')]?_0x5f2bca[_0xcffa('0x36')]:_0x3d9671['model'];_0x5f2bca['order']=qs[_0xcffa('0x3a')](_0x342289['query'][_0xcffa('0x3a')]);_0x5f2bca[_0xcffa('0x3b')]=qs[_0xcffa('0x33')](_[_0xcffa('0x3c')](_0x342289[_0xcffa('0x31')],_0x3d9671[_0xcffa('0x33')]));if(_0x342289['query'][_0xcffa('0x3d')]){_0x5f2bca[_0xcffa('0x3b')]=_[_0xcffa('0x3e')](_0x5f2bca['where'],{'$or':_[_0xcffa('0x2b')](_0x5f2bca['attributes'],function(_0x159de0){var _0x10eff5={};_0x10eff5[_0x159de0]={'$like':'%'+_0x342289[_0xcffa('0x31')][_0xcffa('0x3d')]+'%'};return _0x10eff5;})});}_0x5f2bca=_[_0xcffa('0x3e')]({},_0x5f2bca,_0x342289[_0xcffa('0x45')]);return _0x4f15f2['getConfigurations'](_0x5f2bca);}})['then'](function(_0xfcf6c3){if(_0xfcf6c3){_0x5243b9=_0xfcf6c3['length'];if(!_0x342289[_0xcffa('0x31')]['hasOwnProperty'](_0xcffa('0x39'))){_0x5f2bca[_0xcffa('0x1d')]=qs[_0xcffa('0x1d')](_0x342289[_0xcffa('0x31')]['limit']);_0x5f2bca[_0xcffa('0x20')]=qs[_0xcffa('0x20')](_0x342289[_0xcffa('0x31')][_0xcffa('0x20')]);}return _0x4f15f2[_0xcffa('0x4d')](_0x5f2bca);}})['then'](function(_0x236ed4){if(_0x236ed4){return _0x236ed4?{'count':_0x5243b9,'rows':_0x236ed4}:null;}})[_0xcffa('0x26')](respondWithResult(_0x348559,null))[_0xcffa('0x44')](handleError(_0x348559,null));};exports[_0xcffa('0x4e')]=function(_0x560263,_0x435cdc,_0x5b3543){if(_0x560263[_0xcffa('0x48')]['id']){delete _0x560263[_0xcffa('0x48')]['id'];}return db[_0xcffa('0x2c')][_0xcffa('0x4b')]({'where':{'id':_0x560263[_0xcffa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x435cdc,null))[_0xcffa('0x26')](function(_0x4f1c70){if(_0x4f1c70){_0x560263[_0xcffa('0x48')][_0xcffa('0x4f')]=_0x4f1c70['id'];_0x560263['body'][_0xcffa('0x50')]=integrations[_0xcffa('0x51')](_0x560263[_0xcffa('0x48')]['channel'],_0x560263[_0xcffa('0x48')][_0xcffa('0x2f')]);_0x560263[_0xcffa('0x48')]['Descriptions']=integrations['getDescriptions'](_0x560263[_0xcffa('0x48')][_0xcffa('0x52')],_0x560263[_0xcffa('0x48')][_0xcffa('0x2f')]);return db[_0xcffa('0x4c')][_0xcffa('0x47')](_0x560263[_0xcffa('0x48')],{'include':[{'model':db[_0xcffa('0x53')],'as':'Subjects'},{'model':db[_0xcffa('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x435cdc,null))[_0xcffa('0x44')](handleError(_0x435cdc,null));};exports[_0xcffa('0x54')]=function(_0x48fc02,_0x238667,_0xc5d3f){var _0x544040='';var _0x1404ac='';return db[_0xcffa('0x2c')][_0xcffa('0x4b')]({'where':{'id':_0x48fc02[_0xcffa('0x4a')]['id']},'attributes':['id',_0xcffa('0x55'),'remoteUri',_0xcffa('0x56')]})['then'](handleEntityNotFound(_0x238667,null))[_0xcffa('0x26')](function(_0x21847c){if(_0x21847c){_0x1404ac=_0x21847c[_0xcffa('0x55')];_0x544040=_0x21847c['remoteUri'];var _0x6ff924=_0x21847c[_0xcffa('0x57')]['slice'](-0x1);if(_0x6ff924==='/'){_0x544040=_0x544040[_0xcffa('0x58')](0x0,_0x544040[_0xcffa('0x59')](_0x6ff924));}return rp({'method':_0xcffa('0x5a'),'uri':util['format'](_0xcffa('0x5b'),_0x544040,_0xcffa('0x5c')),'headers':{'Authorization':_0xcffa('0x5d')+_0x21847c['apiKey']},'json':!![]});}})['then'](function(_0x1ab804){if(_0x1ab804){var _0x2dd2ed=_0x1ab804[_0xcffa('0x5e')];var _0x16773e=![];var _0x536e3f=null;for(_0x536e3f=0x0;_0x536e3f<_0x2dd2ed['length'];_0x536e3f++){if(_0x2dd2ed[_0x536e3f][_0xcffa('0x5f')]===_0x1404ac){_0x16773e=!![];}}if(_0x16773e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcffa('0x60')});}}})[_0xcffa('0x26')](respondWithResult(_0x238667,null))[_0xcffa('0x44')](function(_0x5c4bb4){var _0x32decb=_0x48fc02[_0xcffa('0x31')][_0xcffa('0x61')]?0x1f4:_0x5c4bb4[_0xcffa('0x62')]||0x1f4;logger[_0xcffa('0x27')](_0xcffa('0x63'),_0xcffa('0x54'),_0x32decb,JSON['stringify'](_0x5c4bb4));delete _0x5c4bb4['name'];if(_0x32decb===0x191){_0x32decb=0x190;}_0x238667[_0xcffa('0x1a')](_0x32decb)['send'](_0x48fc02[_0xcffa('0x31')][_0xcffa('0x61')]?{'message':_0xcffa('0x64'),'statusCode':_0x5c4bb4[_0xcffa('0x62')]}:_0x5c4bb4);});}; \ No newline at end of file +var _0xa0e8=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','FreshsalesAccount','includeAll','rows','show','params','rawAttributes','include','options','find','catch','create','body','destroy','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','name','index','fieldName','map','keys','query'];(function(_0x109ac4,_0x3c22ac){var _0x269085=function(_0x5872ad){while(--_0x5872ad){_0x109ac4['push'](_0x109ac4['shift']());}};_0x269085(++_0x3c22ac);}(_0xa0e8,0xa6));var _0x8a0e=function(_0xdf46e7,_0x5a0a46){_0xdf46e7=_0xdf46e7-0x0;var _0x7d094a=_0xa0e8[_0xdf46e7];return _0x7d094a;};'use strict';var emlformat=require(_0x8a0e('0x0'));var rimraf=require(_0x8a0e('0x1'));var zipdir=require(_0x8a0e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a0e('0x3'));var moment=require(_0x8a0e('0x4'));var BPromise=require(_0x8a0e('0x5'));var Mustache=require(_0x8a0e('0x6'));var util=require(_0x8a0e('0x7'));var path=require(_0x8a0e('0x8'));var sox=require(_0x8a0e('0x9'));var csv=require(_0x8a0e('0xa'));var ejs=require(_0x8a0e('0xb'));var fs=require('fs');var fs_extra=require(_0x8a0e('0xc'));var _=require('lodash');var squel=require(_0x8a0e('0xd'));var crypto=require(_0x8a0e('0xe'));var jsforce=require(_0x8a0e('0xf'));var deskjs=require(_0x8a0e('0x10'));var toCsv=require(_0x8a0e('0xa'));var querystring=require(_0x8a0e('0x11'));var Papa=require(_0x8a0e('0x12'));var Redis=require(_0x8a0e('0x13'));var authService=require(_0x8a0e('0x14'));var qs=require(_0x8a0e('0x15'));var as=require(_0x8a0e('0x16'));var hardwareService=require(_0x8a0e('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x8a0e('0x18'));var config=require(_0x8a0e('0x19'));var licenseUtil=require(_0x8a0e('0x1a'));var db=require(_0x8a0e('0x1b'))['db'];var integrations=require(_0x8a0e('0x1c'));function respondWithStatusCode(_0x534ae9,_0x19aee4){_0x19aee4=_0x19aee4||0xcc;return function(_0x2f0eec){if(_0x2f0eec){return _0x534ae9[_0x8a0e('0x1d')](_0x19aee4);}return _0x534ae9[_0x8a0e('0x1e')](_0x19aee4)[_0x8a0e('0x1f')]();};}function respondWithResult(_0x1156bb,_0xd60e02){_0xd60e02=_0xd60e02||0xc8;return function(_0x2e7622){if(_0x2e7622){return _0x1156bb[_0x8a0e('0x1e')](_0xd60e02)['json'](_0x2e7622);}};}function respondWithFilteredResult(_0x10b009,_0x16e665){return function(_0x16909a){if(_0x16909a){var _0x5a5dbd=typeof _0x16e665[_0x8a0e('0x20')]==='undefined'&&typeof _0x16e665[_0x8a0e('0x21')]===_0x8a0e('0x22');var _0x23e90f=_0x16909a[_0x8a0e('0x23')];var _0x3fc8bb=_0x5a5dbd?0x0:_0x16e665['offset'];var _0x5c1c68=_0x5a5dbd?_0x16909a[_0x8a0e('0x23')]:_0x16e665['offset']+_0x16e665['limit'];var _0x362243;if(_0x5c1c68>=_0x23e90f){_0x5c1c68=_0x23e90f;_0x362243=0xc8;}else{_0x362243=0xce;}_0x10b009[_0x8a0e('0x1e')](_0x362243);return _0x10b009[_0x8a0e('0x24')](_0x8a0e('0x25'),_0x3fc8bb+'-'+_0x5c1c68+'/'+_0x23e90f)[_0x8a0e('0x26')](_0x16909a);}return null;};}function patchUpdates(_0x5db074){return function(_0x310ed8){try{jsonpatch[_0x8a0e('0x27')](_0x310ed8,_0x5db074,!![]);}catch(_0x4a03a8){return BPromise[_0x8a0e('0x28')](_0x4a03a8);}return _0x310ed8[_0x8a0e('0x29')]();};}function saveUpdates(_0x4c1491,_0x4cf78c){return function(_0x5f1ed9){if(_0x5f1ed9){return _0x5f1ed9[_0x8a0e('0x2a')](_0x4c1491)[_0x8a0e('0x2b')](function(_0x496733){return _0x496733;});}return null;};}function removeEntity(_0x9fb078,_0x326a3e){return function(_0x1f8078){if(_0x1f8078){return _0x1f8078['destroy']()['then'](function(){_0x9fb078[_0x8a0e('0x1e')](0xcc)[_0x8a0e('0x1f')]();});}};}function handleEntityNotFound(_0x166a9c,_0x2602bd){return function(_0xd64f27){if(!_0xd64f27){_0x166a9c[_0x8a0e('0x1d')](0x194);}return _0xd64f27;};}function handleError(_0x56e502,_0x20409d){_0x20409d=_0x20409d||0x1f4;return function(_0x2bffb0){logger['error'](_0x2bffb0['stack']);if(_0x2bffb0[_0x8a0e('0x2c')]){delete _0x2bffb0[_0x8a0e('0x2c')];}_0x56e502[_0x8a0e('0x1e')](_0x20409d)['send'](_0x2bffb0);};}exports[_0x8a0e('0x2d')]=function(_0x50124e,_0x30152e){var _0x4c21ad={},_0x2edc5f={},_0x4048be={'count':0x0,'rows':[]};var _0x6f07c0=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0xe76aab){return{'name':_0xe76aab[_0x8a0e('0x2e')],'type':_0xe76aab['type']['key']};});_0x2edc5f['model']=_[_0x8a0e('0x2f')](_0x6f07c0,_0x8a0e('0x2c'));_0x2edc5f['query']=_[_0x8a0e('0x30')](_0x50124e[_0x8a0e('0x31')]);_0x2edc5f[_0x8a0e('0x32')]=_[_0x8a0e('0x33')](_0x2edc5f[_0x8a0e('0x34')],_0x2edc5f['query']);_0x4c21ad[_0x8a0e('0x35')]=_['intersection'](_0x2edc5f[_0x8a0e('0x34')],qs[_0x8a0e('0x36')](_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x36')]));_0x4c21ad[_0x8a0e('0x35')]=_0x4c21ad[_0x8a0e('0x35')][_0x8a0e('0x37')]?_0x4c21ad[_0x8a0e('0x35')]:_0x2edc5f[_0x8a0e('0x34')];if(!_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x38')](_0x8a0e('0x39'))){_0x4c21ad[_0x8a0e('0x21')]=qs[_0x8a0e('0x21')](_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x21')]);_0x4c21ad[_0x8a0e('0x20')]=qs[_0x8a0e('0x20')](_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x20')]);}_0x4c21ad[_0x8a0e('0x3a')]=qs[_0x8a0e('0x3b')](_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x3b')]);_0x4c21ad[_0x8a0e('0x3c')]=qs[_0x8a0e('0x32')](_[_0x8a0e('0x3d')](_0x50124e[_0x8a0e('0x31')],_0x2edc5f['filters']),_0x6f07c0);if(_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x3e')]){_0x4c21ad[_0x8a0e('0x3c')]=_[_0x8a0e('0x3f')](_0x4c21ad[_0x8a0e('0x3c')],{'$or':_[_0x8a0e('0x2f')](_0x6f07c0,function(_0x42d11b){if(_0x42d11b[_0x8a0e('0x40')]!==_0x8a0e('0x41')){var _0x35a7c1={};_0x35a7c1[_0x42d11b[_0x8a0e('0x2c')]]={'$like':'%'+_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x3e')]+'%'};return _0x35a7c1;}})});}_0x4c21ad=_[_0x8a0e('0x3f')]({},_0x4c21ad,_0x50124e['options']);var _0x30be61={'where':_0x4c21ad[_0x8a0e('0x3c')]};return db[_0x8a0e('0x42')][_0x8a0e('0x23')](_0x30be61)[_0x8a0e('0x2b')](function(_0x91e863){_0x4048be[_0x8a0e('0x23')]=_0x91e863;if(_0x50124e[_0x8a0e('0x31')][_0x8a0e('0x43')]){_0x4c21ad['include']=[{'all':!![]}];}return db[_0x8a0e('0x42')]['findAll'](_0x4c21ad);})[_0x8a0e('0x2b')](function(_0x4a0e83){_0x4048be[_0x8a0e('0x44')]=_0x4a0e83;return _0x4048be;})[_0x8a0e('0x2b')](respondWithFilteredResult(_0x30152e,_0x4c21ad))['catch'](handleError(_0x30152e,null));};exports[_0x8a0e('0x45')]=function(_0x59cb23,_0x1b0aa1){var _0x10915a={'raw':![],'where':{'id':_0x59cb23[_0x8a0e('0x46')]['id']}},_0x50a985={};_0x50a985[_0x8a0e('0x34')]=_[_0x8a0e('0x30')](db[_0x8a0e('0x42')][_0x8a0e('0x47')]);_0x50a985['query']=_[_0x8a0e('0x30')](_0x59cb23[_0x8a0e('0x31')]);_0x50a985['filters']=_[_0x8a0e('0x33')](_0x50a985[_0x8a0e('0x34')],_0x50a985[_0x8a0e('0x31')]);_0x10915a['attributes']=_[_0x8a0e('0x33')](_0x50a985[_0x8a0e('0x34')],qs[_0x8a0e('0x36')](_0x59cb23[_0x8a0e('0x31')][_0x8a0e('0x36')]));_0x10915a[_0x8a0e('0x35')]=_0x10915a[_0x8a0e('0x35')]['length']?_0x10915a[_0x8a0e('0x35')]:_0x50a985[_0x8a0e('0x34')];if(_0x59cb23[_0x8a0e('0x31')]['includeAll']){_0x10915a[_0x8a0e('0x48')]=[{'all':!![]}];}_0x10915a=_[_0x8a0e('0x3f')]({},_0x10915a,_0x59cb23[_0x8a0e('0x49')]);return db[_0x8a0e('0x42')][_0x8a0e('0x4a')](_0x10915a)[_0x8a0e('0x2b')](handleEntityNotFound(_0x1b0aa1,null))[_0x8a0e('0x2b')](respondWithResult(_0x1b0aa1,null))[_0x8a0e('0x4b')](handleError(_0x1b0aa1,null));};exports[_0x8a0e('0x4c')]=function(_0x1cf682,_0x3ed0f8){return db['FreshsalesAccount'][_0x8a0e('0x4c')](_0x1cf682[_0x8a0e('0x4d')],{})[_0x8a0e('0x2b')](respondWithResult(_0x3ed0f8,0xc9))[_0x8a0e('0x4b')](handleError(_0x3ed0f8,null));};exports['update']=function(_0x350b09,_0xe9c5bb){if(_0x350b09[_0x8a0e('0x4d')]['id']){delete _0x350b09['body']['id'];}return db['FreshsalesAccount'][_0x8a0e('0x4a')]({'where':{'id':_0x350b09[_0x8a0e('0x46')]['id']}})[_0x8a0e('0x2b')](handleEntityNotFound(_0xe9c5bb,null))[_0x8a0e('0x2b')](saveUpdates(_0x350b09['body'],null))[_0x8a0e('0x2b')](respondWithResult(_0xe9c5bb,null))['catch'](handleError(_0xe9c5bb,null));};exports[_0x8a0e('0x4e')]=function(_0x437ed6,_0x565822){return db[_0x8a0e('0x42')]['find']({'where':{'id':_0x437ed6['params']['id']}})['then'](handleEntityNotFound(_0x565822,null))[_0x8a0e('0x2b')](removeEntity(_0x565822,null))[_0x8a0e('0x4b')](handleError(_0x565822,null));};exports[_0x8a0e('0x4f')]=function(_0x3fc46b,_0x5c4a8e,_0xaadcbc){var _0x2d5cea={};var _0x1dfadb={};var _0x36a91b;var _0x21165e;return db[_0x8a0e('0x42')]['findOne']({'where':{'id':_0x3fc46b[_0x8a0e('0x46')]['id']}})[_0x8a0e('0x2b')](handleEntityNotFound(_0x5c4a8e,null))[_0x8a0e('0x2b')](function(_0x1796fc){if(_0x1796fc){_0x36a91b=_0x1796fc;_0x1dfadb['model']=_[_0x8a0e('0x30')](db['FreshsalesConfiguration'][_0x8a0e('0x47')]);_0x1dfadb[_0x8a0e('0x31')]=_[_0x8a0e('0x30')](_0x3fc46b[_0x8a0e('0x31')]);_0x1dfadb[_0x8a0e('0x32')]=_[_0x8a0e('0x33')](_0x1dfadb[_0x8a0e('0x34')],_0x1dfadb['query']);_0x2d5cea['attributes']=_[_0x8a0e('0x33')](_0x1dfadb['model'],qs[_0x8a0e('0x36')](_0x3fc46b[_0x8a0e('0x31')][_0x8a0e('0x36')]));_0x2d5cea[_0x8a0e('0x35')]=_0x2d5cea[_0x8a0e('0x35')][_0x8a0e('0x37')]?_0x2d5cea[_0x8a0e('0x35')]:_0x1dfadb['model'];_0x2d5cea['order']=qs[_0x8a0e('0x3b')](_0x3fc46b[_0x8a0e('0x31')][_0x8a0e('0x3b')]);_0x2d5cea['where']=qs[_0x8a0e('0x32')](_[_0x8a0e('0x3d')](_0x3fc46b[_0x8a0e('0x31')],_0x1dfadb['filters']));if(_0x3fc46b[_0x8a0e('0x31')]['filter']){_0x2d5cea[_0x8a0e('0x3c')]=_[_0x8a0e('0x3f')](_0x2d5cea[_0x8a0e('0x3c')],{'$or':_[_0x8a0e('0x2f')](_0x2d5cea[_0x8a0e('0x35')],function(_0x555098){var _0x296c62={};_0x296c62[_0x555098]={'$like':'%'+_0x3fc46b[_0x8a0e('0x31')][_0x8a0e('0x3e')]+'%'};return _0x296c62;})});}_0x2d5cea=_[_0x8a0e('0x3f')]({},_0x2d5cea,_0x3fc46b[_0x8a0e('0x49')]);return _0x36a91b[_0x8a0e('0x4f')](_0x2d5cea);}})['then'](function(_0x36a4de){if(_0x36a4de){_0x21165e=_0x36a4de['length'];if(!_0x3fc46b['query']['hasOwnProperty']('nolimit')){_0x2d5cea['limit']=qs['limit'](_0x3fc46b['query']['limit']);_0x2d5cea[_0x8a0e('0x20')]=qs[_0x8a0e('0x20')](_0x3fc46b['query']['offset']);}return _0x36a91b[_0x8a0e('0x4f')](_0x2d5cea);}})[_0x8a0e('0x2b')](function(_0x12a95d){if(_0x12a95d){return _0x12a95d?{'count':_0x21165e,'rows':_0x12a95d}:null;}})[_0x8a0e('0x2b')](respondWithResult(_0x5c4a8e,null))['catch'](handleError(_0x5c4a8e,null));};exports[_0x8a0e('0x50')]=function(_0x2b6aba,_0x252f5f,_0x2c20d1){if(_0x2b6aba['body']['id']){delete _0x2b6aba['body']['id'];}return db[_0x8a0e('0x42')][_0x8a0e('0x51')]({'where':{'id':_0x2b6aba['params']['id']}})['then'](handleEntityNotFound(_0x252f5f,null))[_0x8a0e('0x2b')](function(_0x5da57d){if(_0x5da57d){_0x2b6aba[_0x8a0e('0x4d')][_0x8a0e('0x52')]=_0x5da57d['id'];_0x2b6aba['body']['Subjects']=integrations[_0x8a0e('0x53')](_0x2b6aba[_0x8a0e('0x4d')]['channel'],_0x2b6aba[_0x8a0e('0x4d')][_0x8a0e('0x40')]);_0x2b6aba[_0x8a0e('0x4d')]['Descriptions']=integrations[_0x8a0e('0x54')](_0x2b6aba[_0x8a0e('0x4d')][_0x8a0e('0x55')],_0x2b6aba[_0x8a0e('0x4d')][_0x8a0e('0x40')]);return db[_0x8a0e('0x56')][_0x8a0e('0x4c')](_0x2b6aba[_0x8a0e('0x4d')],{'include':[{'model':db[_0x8a0e('0x57')],'as':_0x8a0e('0x58')},{'model':db[_0x8a0e('0x57')],'as':_0x8a0e('0x59')}]});}return null;})[_0x8a0e('0x2b')](respondWithResult(_0x252f5f,null))['catch'](handleError(_0x252f5f,null));};exports[_0x8a0e('0x5a')]=function(_0x3ab866,_0x477b99,_0x300bbe){var _0x13dd79='';var _0x3778b7='';return db[_0x8a0e('0x42')]['findOne']({'where':{'id':_0x3ab866[_0x8a0e('0x46')]['id']},'attributes':['id',_0x8a0e('0x5b'),_0x8a0e('0x5c'),_0x8a0e('0x5d')]})['then'](handleEntityNotFound(_0x477b99,null))[_0x8a0e('0x2b')](function(_0x25ca0d){if(_0x25ca0d){_0x3778b7=_0x25ca0d[_0x8a0e('0x5b')];_0x13dd79=_0x25ca0d[_0x8a0e('0x5c')];var _0x58fcf2=_0x25ca0d['remoteUri'][_0x8a0e('0x5e')](-0x1);if(_0x58fcf2==='/'){_0x13dd79=_0x13dd79[_0x8a0e('0x5f')](0x0,_0x13dd79['lastIndexOf'](_0x58fcf2));}return rp({'method':_0x8a0e('0x60'),'uri':util['format'](_0x8a0e('0x61'),_0x13dd79,_0x8a0e('0x62')),'headers':{'Authorization':_0x8a0e('0x63')+_0x25ca0d['apiKey']},'json':!![]});}})[_0x8a0e('0x2b')](function(_0x3830b0){if(_0x3830b0){var _0x222dab=_0x3830b0[_0x8a0e('0x64')];var _0x391cb2=![];var _0xfb57aa=null;for(_0xfb57aa=0x0;_0xfb57aa<_0x222dab[_0x8a0e('0x37')];_0xfb57aa++){if(_0x222dab[_0xfb57aa][_0x8a0e('0x65')]===_0x3778b7){_0x391cb2=!![];}}if(_0x391cb2){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x8a0e('0x2b')](respondWithResult(_0x477b99,null))[_0x8a0e('0x4b')](function(_0x2f10b4){var _0x337701=_0x3ab866[_0x8a0e('0x31')][_0x8a0e('0x66')]?0x1f4:_0x2f10b4[_0x8a0e('0x67')]||0x1f4;logger[_0x8a0e('0x68')](_0x8a0e('0x69'),'getFields',_0x337701,JSON['stringify'](_0x2f10b4));delete _0x2f10b4[_0x8a0e('0x2c')];if(_0x337701===0x191){_0x337701=0x190;}_0x477b99[_0x8a0e('0x1e')](_0x337701)[_0x8a0e('0x6a')](_0x3ab866[_0x8a0e('0x31')][_0x8a0e('0x66')]?{'message':_0x8a0e('0x6b'),'statusCode':_0x2f10b4['statusCode']}:_0x2f10b4);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 5c002e1..3ed921b 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 _0x7880=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment'];(function(_0x2cd1b9,_0x3b5cdd){var _0x31dea6=function(_0x4f7012){while(--_0x4f7012){_0x2cd1b9['push'](_0x2cd1b9['shift']());}};_0x31dea6(++_0x3b5cdd);}(_0x7880,0x1f4));var _0x0788=function(_0x3ed98d,_0x2f4af7){_0x3ed98d=_0x3ed98d-0x0;var _0x2b81e0=_0x7880[_0x3ed98d];return _0x2b81e0;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));var integrations=require(_0x0788('0x9'));module[_0x0788('0xa')]=function(_0x775629,_0x3f9cb8){return _0x775629[_0x0788('0xb')](_0x0788('0xc'),attributes,{'tableName':_0x0788('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x53ec,0x192));var _0xc53e=function(_0x58e253,_0x30a9c3){_0x58e253=_0x58e253-0x0;var _0x2ffe75=_0x53ec[_0x58e253];return _0x2ffe75;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xc53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 07c7c4a..011273a 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 _0xfcf0=['request','info','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','FreshsalesAccount','find','ShowFreshsalesAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xb35484,_0x346575){var _0x3ee44f=function(_0x571c99){while(--_0x571c99){_0xb35484['push'](_0xb35484['shift']());}};_0x3ee44f(++_0x346575);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xfcf0[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['FreshsalesAccount'][_0x0fcf('0x16')]({'raw':_0x19cfbd[_0x0fcf('0x17')]?_0x19cfbd['options'][_0x0fcf('0x18')]===undefined?!![]:![]:!![],'where':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x17')][_0x0fcf('0x19')]||null:null,'attributes':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x17')][_0x0fcf('0x1a')]||null:null,'limit':_0x19cfbd[_0x0fcf('0x17')]?_0x19cfbd['options'][_0x0fcf('0x1b')]||null:null,'include':_0x19cfbd[_0x0fcf('0x17')]?_0x19cfbd[_0x0fcf('0x17')][_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0x19cfbd[_0x0fcf('0x17')]['include'],function(_0x2eef74){return{'model':db[_0x2eef74[_0x0fcf('0x1e')]],'as':_0x2eef74['as'],'attributes':_0x2eef74[_0x0fcf('0x1a')],'include':_0x2eef74[_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0x2eef74[_0x0fcf('0x1c')],function(_0x2ce990){return{'model':db[_0x2ce990[_0x0fcf('0x1e')]],'as':_0x2ce990['as'],'attributes':_0x2ce990[_0x0fcf('0x1a')],'include':_0x2ce990['include']?_[_0x0fcf('0x1d')](_0x2ce990[_0x0fcf('0x1c')],function(_0x41b7a2){return{'model':db[_0x41b7a2[_0x0fcf('0x1e')]],'as':_0x41b7a2['as'],'attributes':_0x41b7a2[_0x0fcf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0fcf('0x1f')](function(_0x2730b0){logger['info'](_0x0fcf('0x15'),_0x19cfbd);logger[_0x0fcf('0xf')](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x2730b0));_0x18ea32(_0x2730b0);})['catch'](function(_0x5d9bcd){logger['error'](_0x0fcf('0x15'),_0x5d9bcd['message'],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0x5d9bcd[_0x0fcf('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0xdfd3ec){var _0x117041=this;return new Promise(function(_0xa52f52,_0x161496){return db[_0x0fcf('0x20')][_0x0fcf('0x21')]({'raw':_0xdfd3ec['options']?_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x18')]===undefined?!![]:![]:!![],'where':_0xdfd3ec[_0x0fcf('0x17')]?_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x19')]||null:null,'attributes':_0xdfd3ec[_0x0fcf('0x17')]?_0xdfd3ec['options'][_0x0fcf('0x1a')]||null:null,'include':_0xdfd3ec[_0x0fcf('0x17')]?_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0xdfd3ec[_0x0fcf('0x17')][_0x0fcf('0x1c')],function(_0x344957){return{'model':db[_0x344957[_0x0fcf('0x1e')]],'as':_0x344957['as'],'attributes':_0x344957[_0x0fcf('0x1a')],'include':_0x344957[_0x0fcf('0x1c')]?_[_0x0fcf('0x1d')](_0x344957[_0x0fcf('0x1c')],function(_0x17346e){return{'model':db[_0x17346e['model']],'as':_0x17346e['as'],'attributes':_0x17346e['attributes'],'include':_0x17346e[_0x0fcf('0x1c')]?_['map'](_0x17346e['include'],function(_0x1a1e07){return{'model':db[_0x1a1e07[_0x0fcf('0x1e')]],'as':_0x1a1e07['as'],'attributes':_0x1a1e07[_0x0fcf('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57e635){logger[_0x0fcf('0xd')](_0x0fcf('0x22'),_0xdfd3ec);logger[_0x0fcf('0xf')]('ShowFreshsalesAccount',_0xdfd3ec,JSON[_0x0fcf('0x11')](_0x57e635));_0xa52f52(_0x57e635);})[_0x0fcf('0x23')](function(_0x29067e){logger['error']('ShowFreshsalesAccount',_0x29067e['message'],_0xdfd3ec);_0x161496(_0x117041[_0x0fcf('0x12')](0x1f4,_0x29067e[_0x0fcf('0x13')]));});});}; \ No newline at end of file +var _0x5fdc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','include','map','model','ShowFreshsalesAccount','find','where','catch','lodash'];(function(_0x5a27fe,_0x43993b){var _0x121c88=function(_0x2aff1f){while(--_0x2aff1f){_0x5a27fe['push'](_0x5a27fe['shift']());}};_0x121c88(++_0x43993b);}(_0x5fdc,0x127));var _0xc5fd=function(_0x57f8a1,_0x58b8b4){_0x57f8a1=_0x57f8a1-0x0;var _0x49122a=_0x5fdc[_0x57f8a1];return _0x49122a;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['findAll']({'raw':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')]['where']||null:null,'attributes':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1d')]||null:null,'limit':_0x27f611[_0xc5fd('0x1b')]?_0x27f611['options']['limit']||null:null,'include':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1e')],function(_0x56d473){return{'model':db[_0x56d473[_0xc5fd('0x20')]],'as':_0x56d473['as'],'attributes':_0x56d473[_0xc5fd('0x1d')],'include':_0x56d473[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x56d473[_0xc5fd('0x1e')],function(_0x4020af){return{'model':db[_0x4020af[_0xc5fd('0x20')]],'as':_0x4020af['as'],'attributes':_0x4020af['attributes'],'include':_0x4020af[_0xc5fd('0x1e')]?_['map'](_0x4020af[_0xc5fd('0x1e')],function(_0x231368){return{'model':db[_0x231368[_0xc5fd('0x20')]],'as':_0x231368['as'],'attributes':_0x231368[_0xc5fd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x176313){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')](_0xc5fd('0x19'),_0x27f611,JSON[_0xc5fd('0x13')](_0x176313));_0x2ee392(_0x176313);})['catch'](function(_0x412ef7){logger['error']('GetFreshsalesAccount',_0x412ef7[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x412ef7[_0xc5fd('0x16')]));});});};exports[_0xc5fd('0x21')]=function(_0x7693c4){var _0x85fa81=this;return new Promise(function(_0x2a891d,_0x321eea){return db['FreshsalesAccount'][_0xc5fd('0x22')]({'raw':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x23')]||null:null,'attributes':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1d')]||null:null,'include':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')]['include']?_[_0xc5fd('0x1f')](_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1e')],function(_0x1fa329){return{'model':db[_0x1fa329[_0xc5fd('0x20')]],'as':_0x1fa329['as'],'attributes':_0x1fa329[_0xc5fd('0x1d')],'include':_0x1fa329[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x1fa329[_0xc5fd('0x1e')],function(_0x545bfc){return{'model':db[_0x545bfc[_0xc5fd('0x20')]],'as':_0x545bfc['as'],'attributes':_0x545bfc[_0xc5fd('0x1d')],'include':_0x545bfc[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x545bfc[_0xc5fd('0x1e')],function(_0x52267e){return{'model':db[_0x52267e[_0xc5fd('0x20')]],'as':_0x52267e['as'],'attributes':_0x52267e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5fd('0xf')](function(_0xac7c40){logger['info'](_0xc5fd('0x21'),_0x7693c4);logger['debug'](_0xc5fd('0x21'),_0x7693c4,JSON[_0xc5fd('0x13')](_0xac7c40));_0x2a891d(_0xac7c40);})[_0xc5fd('0x24')](function(_0x4cafb1){logger[_0xc5fd('0x14')](_0xc5fd('0x21'),_0x4cafb1['message'],_0x7693c4);_0x321eea(_0x85fa81[_0xc5fd('0x14')](0x1f4,_0x4cafb1[_0xc5fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 39af86c..630b4a2 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 _0x8fab=['../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x54691d,_0x391ae4){var _0x4636bd=function(_0x4972a7){while(--_0x4972a7){_0x54691d['push'](_0x54691d['shift']());}};_0x4636bd(++_0x391ae4);}(_0x8fab,0xc8));var _0xb8fa=function(_0x589911,_0x2c2ab7){_0x589911=_0x589911-0x0;var _0x18d695=_0x8fab[_0x589911];return _0x18d695;};'use strict';var multer=require(_0xb8fa('0x0'));var util=require('util');var path=require(_0xb8fa('0x1'));var timeout=require('connect-timeout');var express=require(_0xb8fa('0x2'));var router=express[_0xb8fa('0x3')]();var fs_extra=require(_0xb8fa('0x4'));var auth=require(_0xb8fa('0x5'));var interaction=require(_0xb8fa('0x6'));var config=require(_0xb8fa('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xb8fa('0x8')]('/',auth[_0xb8fa('0x9')](),controller[_0xb8fa('0xa')]);router[_0xb8fa('0x8')](_0xb8fa('0xb'),auth[_0xb8fa('0x9')](),controller[_0xb8fa('0xc')]);router[_0xb8fa('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xb8fa('0xd')]);router[_0xb8fa('0x8')](_0xb8fa('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xb8fa('0x8')](_0xb8fa('0xf'),auth[_0xb8fa('0x9')](),controller[_0xb8fa('0x10')]);router[_0xb8fa('0x11')]('/',auth[_0xb8fa('0x9')](),controller[_0xb8fa('0x12')]);router[_0xb8fa('0x13')](_0xb8fa('0xb'),auth[_0xb8fa('0x9')](),controller[_0xb8fa('0x14')]);router['delete'](_0xb8fa('0xb'),auth['isAuthenticated'](),controller[_0xb8fa('0x15')]);module[_0xb8fa('0x16')]=router; \ No newline at end of file +var _0x8282=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','update','destroy','exports'];(function(_0x1ba90c,_0x471ef1){var _0x3bc5dd=function(_0x44a483){while(--_0x44a483){_0x1ba90c['push'](_0x1ba90c['shift']());}};_0x3bc5dd(++_0x471ef1);}(_0x8282,0xfc));var _0x2828=function(_0x468b92,_0x17baaf){_0x468b92=_0x468b92-0x0;var _0x191a14=_0x8282[_0x468b92];return _0x191a14;};'use strict';var multer=require(_0x2828('0x0'));var util=require('util');var path=require(_0x2828('0x1'));var timeout=require(_0x2828('0x2'));var express=require('express');var router=express[_0x2828('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2828('0x4'));var interaction=require(_0x2828('0x5'));var config=require(_0x2828('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x2828('0x7')]('/',auth[_0x2828('0x8')](),controller[_0x2828('0x9')]);router[_0x2828('0x7')](_0x2828('0xa'),auth[_0x2828('0x8')](),controller[_0x2828('0xb')]);router[_0x2828('0x7')](_0x2828('0xc'),auth[_0x2828('0x8')](),controller['getSubjects']);router[_0x2828('0x7')](_0x2828('0xd'),auth[_0x2828('0x8')](),controller[_0x2828('0xe')]);router['get'](_0x2828('0xf'),auth[_0x2828('0x8')](),controller[_0x2828('0x10')]);router[_0x2828('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2828('0xa'),auth[_0x2828('0x8')](),controller[_0x2828('0x12')]);router['delete'](_0x2828('0xa'),auth[_0x2828('0x8')](),controller[_0x2828('0x13')]);module[_0x2828('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 8ae253c..3891c48 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 _0xb731=['exports','STRING','sequelize'];(function(_0xd64146,_0x24e5ee){var _0x24fa15=function(_0x507589){while(--_0x507589){_0xd64146['push'](_0xd64146['shift']());}};_0x24fa15(++_0x24e5ee);}(_0xb731,0xa1));var _0x1b73=function(_0x58fdc5,_0x5986a){_0x58fdc5=_0x58fdc5-0x0;var _0x121190=_0xb731[_0x58fdc5];return _0x121190;};'use strict';var Sequelize=require(_0x1b73('0x0'));module[_0x1b73('0x1')]={'name':{'type':Sequelize[_0x1b73('0x2')]},'description':{'type':Sequelize[_0x1b73('0x2')]}}; \ No newline at end of file +var _0x0636=['STRING','exports'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x0636,0x1d7));var _0x6063=function(_0x2e8a0c,_0x29a1e3){_0x2e8a0c=_0x2e8a0c-0x0;var _0x4aa806=_0x0636[_0x2e8a0c];return _0x4aa806;};'use strict';var Sequelize=require('sequelize');module[_0x6063('0x0')]={'name':{'type':Sequelize[_0x6063('0x1')]},'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 36fd6c8..1aa45ec 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 _0x001b=['update','then','error','stack','name','send','FreshsalesConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','merge','where','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','getSubjects','findOne','FreshsalesField','order','filter','getDescriptions','pick','getFields','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save'];(function(_0x4bd898,_0x31fb80){var _0x476502=function(_0x65f138){while(--_0x65f138){_0x4bd898['push'](_0x4bd898['shift']());}};_0x476502(++_0x31fb80);}(_0x001b,0x79));var _0xb001=function(_0x48159e,_0x5993f2){_0x48159e=_0x48159e-0x0;var _0x60a2a=_0x001b[_0x48159e];return _0x60a2a;};'use strict';var emlformat=require(_0xb001('0x0'));var rimraf=require(_0xb001('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb001('0x2'));var rp=require(_0xb001('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb001('0x4'));var util=require(_0xb001('0x5'));var path=require(_0xb001('0x6'));var sox=require('sox');var csv=require(_0xb001('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb001('0x8'));var squel=require(_0xb001('0x9'));var crypto=require(_0xb001('0xa'));var jsforce=require(_0xb001('0xb'));var deskjs=require(_0xb001('0xc'));var toCsv=require(_0xb001('0x7'));var querystring=require(_0xb001('0xd'));var Papa=require('papaparse');var Redis=require(_0xb001('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb001('0xf'));var as=require(_0xb001('0x10'));var hardwareService=require(_0xb001('0x11'));var logger=require(_0xb001('0x12'))(_0xb001('0x13'));var utils=require(_0xb001('0x14'));var config=require(_0xb001('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb001('0x16'))['db'];function respondWithStatusCode(_0x3e59b9,_0x1fcb83){_0x1fcb83=_0x1fcb83||0xcc;return function(_0xa06836){if(_0xa06836){return _0x3e59b9[_0xb001('0x17')](_0x1fcb83);}return _0x3e59b9['status'](_0x1fcb83)[_0xb001('0x18')]();};}function respondWithResult(_0x4153d8,_0x595c6c){_0x595c6c=_0x595c6c||0xc8;return function(_0x1b1f75){if(_0x1b1f75){return _0x4153d8[_0xb001('0x19')](_0x595c6c)[_0xb001('0x1a')](_0x1b1f75);}};}function respondWithFilteredResult(_0x13a34f,_0x226d06){return function(_0x38b4bc){if(_0x38b4bc){var _0x3463f=typeof _0x226d06[_0xb001('0x1b')]==='undefined'&&typeof _0x226d06['limit']==='undefined';var _0x15956a=_0x38b4bc[_0xb001('0x1c')];var _0x3e49f9=_0x3463f?0x0:_0x226d06[_0xb001('0x1b')];var _0x52d3a9=_0x3463f?_0x38b4bc[_0xb001('0x1c')]:_0x226d06[_0xb001('0x1b')]+_0x226d06[_0xb001('0x1d')];var _0x1abedf;if(_0x52d3a9>=_0x15956a){_0x52d3a9=_0x15956a;_0x1abedf=0xc8;}else{_0x1abedf=0xce;}_0x13a34f['status'](_0x1abedf);return _0x13a34f[_0xb001('0x1e')](_0xb001('0x1f'),_0x3e49f9+'-'+_0x52d3a9+'/'+_0x15956a)[_0xb001('0x1a')](_0x38b4bc);}return null;};}function patchUpdates(_0x17f923){return function(_0x5d40eb){try{jsonpatch[_0xb001('0x20')](_0x5d40eb,_0x17f923,!![]);}catch(_0x439b93){return BPromise[_0xb001('0x21')](_0x439b93);}return _0x5d40eb[_0xb001('0x22')]();};}function saveUpdates(_0x2b2362,_0x22451d){return function(_0x5de18a){if(_0x5de18a){return _0x5de18a[_0xb001('0x23')](_0x2b2362)[_0xb001('0x24')](function(_0x51345c){return _0x51345c;});}return null;};}function removeEntity(_0x6130a7,_0x279d74){return function(_0x21ef9c){if(_0x21ef9c){return _0x21ef9c['destroy']()[_0xb001('0x24')](function(){_0x6130a7['status'](0xcc)[_0xb001('0x18')]();});}};}function handleEntityNotFound(_0x2893a0,_0x1c6ae1){return function(_0x1a661b){if(!_0x1a661b){_0x2893a0['sendStatus'](0x194);}return _0x1a661b;};}function handleError(_0x4d5dcb,_0x410466){_0x410466=_0x410466||0x1f4;return function(_0x1585ee){logger[_0xb001('0x25')](_0x1585ee[_0xb001('0x26')]);if(_0x1585ee[_0xb001('0x27')]){delete _0x1585ee[_0xb001('0x27')];}_0x4d5dcb['status'](_0x410466)[_0xb001('0x28')](_0x1585ee);};}exports['index']=function(_0x487ffe,_0x488a96){var _0x300394={},_0x14efa7={},_0xf87af1={'count':0x0,'rows':[]};var _0x10c1aa=_['map'](db[_0xb001('0x29')][_0xb001('0x2a')],function(_0x3aa6eb){return{'name':_0x3aa6eb[_0xb001('0x2b')],'type':_0x3aa6eb[_0xb001('0x2c')][_0xb001('0x2d')]};});_0x14efa7['model']=_[_0xb001('0x2e')](_0x10c1aa,_0xb001('0x27'));_0x14efa7[_0xb001('0x2f')]=_[_0xb001('0x30')](_0x487ffe[_0xb001('0x2f')]);_0x14efa7[_0xb001('0x31')]=_['intersection'](_0x14efa7['model'],_0x14efa7['query']);_0x300394['attributes']=_[_0xb001('0x32')](_0x14efa7[_0xb001('0x33')],qs[_0xb001('0x34')](_0x487ffe['query'][_0xb001('0x34')]));_0x300394['attributes']=_0x300394['attributes'][_0xb001('0x35')]?_0x300394[_0xb001('0x36')]:_0x14efa7[_0xb001('0x33')];if(!_0x487ffe[_0xb001('0x2f')][_0xb001('0x37')](_0xb001('0x38'))){_0x300394['limit']=qs['limit'](_0x487ffe[_0xb001('0x2f')][_0xb001('0x1d')]);_0x300394[_0xb001('0x1b')]=qs[_0xb001('0x1b')](_0x487ffe[_0xb001('0x2f')][_0xb001('0x1b')]);}_0x300394['order']=qs[_0xb001('0x39')](_0x487ffe[_0xb001('0x2f')][_0xb001('0x39')]);_0x300394['where']=qs[_0xb001('0x31')](_['pick'](_0x487ffe['query'],_0x14efa7['filters']),_0x10c1aa);if(_0x487ffe[_0xb001('0x2f')]['filter']){_0x300394['where']=_[_0xb001('0x3a')](_0x300394[_0xb001('0x3b')],{'$or':_['map'](_0x10c1aa,function(_0x8613c7){if(_0x8613c7['type']!==_0xb001('0x3c')){var _0x2d4766={};_0x2d4766[_0x8613c7[_0xb001('0x27')]]={'$like':'%'+_0x487ffe[_0xb001('0x2f')]['filter']+'%'};return _0x2d4766;}})});}_0x300394=_['merge']({},_0x300394,_0x487ffe[_0xb001('0x3d')]);var _0x6ba338={'where':_0x300394[_0xb001('0x3b')]};return db[_0xb001('0x29')]['count'](_0x6ba338)[_0xb001('0x24')](function(_0x436d56){_0xf87af1[_0xb001('0x1c')]=_0x436d56;if(_0x487ffe[_0xb001('0x2f')]['includeAll']){_0x300394[_0xb001('0x3e')]=[{'all':!![]}];}return db[_0xb001('0x29')][_0xb001('0x3f')](_0x300394);})[_0xb001('0x24')](function(_0x1c5b8d){_0xf87af1['rows']=_0x1c5b8d;return _0xf87af1;})['then'](respondWithFilteredResult(_0x488a96,_0x300394))[_0xb001('0x40')](handleError(_0x488a96,null));};exports['show']=function(_0x452988,_0x272ded){var _0x48ca12={'raw':![],'where':{'id':_0x452988[_0xb001('0x41')]['id']}},_0x25d53a={};_0x25d53a[_0xb001('0x33')]=_[_0xb001('0x30')](db[_0xb001('0x29')][_0xb001('0x2a')]);_0x25d53a['query']=_[_0xb001('0x30')](_0x452988[_0xb001('0x2f')]);_0x25d53a[_0xb001('0x31')]=_[_0xb001('0x32')](_0x25d53a[_0xb001('0x33')],_0x25d53a[_0xb001('0x2f')]);_0x48ca12['attributes']=_[_0xb001('0x32')](_0x25d53a[_0xb001('0x33')],qs[_0xb001('0x34')](_0x452988['query'][_0xb001('0x34')]));_0x48ca12[_0xb001('0x36')]=_0x48ca12[_0xb001('0x36')]['length']?_0x48ca12[_0xb001('0x36')]:_0x25d53a[_0xb001('0x33')];if(_0x452988['query'][_0xb001('0x42')]){_0x48ca12[_0xb001('0x3e')]=[{'all':!![]}];}_0x48ca12=_[_0xb001('0x3a')]({},_0x48ca12,_0x452988[_0xb001('0x3d')]);return db['FreshsalesConfiguration'][_0xb001('0x43')](_0x48ca12)[_0xb001('0x24')](handleEntityNotFound(_0x272ded,null))[_0xb001('0x24')](respondWithResult(_0x272ded,null))['catch'](handleError(_0x272ded,null));};exports[_0xb001('0x44')]=function(_0x34495b,_0x1543a7){return db[_0xb001('0x29')][_0xb001('0x44')](_0x34495b['body'],{})[_0xb001('0x24')](respondWithResult(_0x1543a7,0xc9))[_0xb001('0x40')](handleError(_0x1543a7,null));};exports['update']=function(_0x3e6682,_0x54d4d5){if(_0x3e6682[_0xb001('0x45')]['id']){delete _0x3e6682['body']['id'];}return db[_0xb001('0x29')][_0xb001('0x43')]({'where':{'id':_0x3e6682[_0xb001('0x41')]['id']}})[_0xb001('0x24')](handleEntityNotFound(_0x54d4d5,null))[_0xb001('0x24')](saveUpdates(_0x3e6682['body'],null))['then'](respondWithResult(_0x54d4d5,null))[_0xb001('0x40')](handleError(_0x54d4d5,null));};exports['destroy']=function(_0xc7398f,_0x530291){return db['FreshsalesConfiguration'][_0xb001('0x43')]({'where':{'id':_0xc7398f[_0xb001('0x41')]['id']}})['then'](handleEntityNotFound(_0x530291,null))['then'](removeEntity(_0x530291,null))['catch'](handleError(_0x530291,null));};exports[_0xb001('0x46')]=function(_0x29507c,_0x4d4ced,_0x4fc8ee){var _0x52908b={};var _0x35671a={};var _0x3024a5;var _0x405957;return db[_0xb001('0x29')][_0xb001('0x47')]({'where':{'id':_0x29507c[_0xb001('0x41')]['id']}})[_0xb001('0x24')](handleEntityNotFound(_0x4d4ced,null))[_0xb001('0x24')](function(_0x5d9144){if(_0x5d9144){_0x3024a5=_0x5d9144;_0x35671a[_0xb001('0x33')]=_[_0xb001('0x30')](db[_0xb001('0x48')][_0xb001('0x2a')]);_0x35671a[_0xb001('0x2f')]=_[_0xb001('0x30')](_0x29507c[_0xb001('0x2f')]);_0x35671a[_0xb001('0x31')]=_[_0xb001('0x32')](_0x35671a[_0xb001('0x33')],_0x35671a['query']);_0x52908b[_0xb001('0x36')]=_['intersection'](_0x35671a[_0xb001('0x33')],qs['fields'](_0x29507c[_0xb001('0x2f')][_0xb001('0x34')]));_0x52908b[_0xb001('0x36')]=_0x52908b[_0xb001('0x36')][_0xb001('0x35')]?_0x52908b[_0xb001('0x36')]:_0x35671a[_0xb001('0x33')];_0x52908b[_0xb001('0x49')]=qs['sort'](_0x29507c[_0xb001('0x2f')]['sort']);_0x52908b[_0xb001('0x3b')]=qs[_0xb001('0x31')](_['pick'](_0x29507c[_0xb001('0x2f')],_0x35671a[_0xb001('0x31')]));if(_0x29507c[_0xb001('0x2f')][_0xb001('0x4a')]){_0x52908b[_0xb001('0x3b')]=_[_0xb001('0x3a')](_0x52908b[_0xb001('0x3b')],{'$or':_['map'](_0x52908b[_0xb001('0x36')],function(_0x4e7741){var _0x20d69c={};_0x20d69c[_0x4e7741]={'$like':'%'+_0x29507c[_0xb001('0x2f')]['filter']+'%'};return _0x20d69c;})});}_0x52908b=_[_0xb001('0x3a')]({},_0x52908b,_0x29507c[_0xb001('0x3d')]);return _0x3024a5['getSubjects'](_0x52908b);}})[_0xb001('0x24')](function(_0x4de08d){if(_0x4de08d){_0x405957=_0x4de08d[_0xb001('0x35')];if(!_0x29507c['query'][_0xb001('0x37')](_0xb001('0x38'))){_0x52908b[_0xb001('0x1d')]=qs[_0xb001('0x1d')](_0x29507c[_0xb001('0x2f')][_0xb001('0x1d')]);_0x52908b[_0xb001('0x1b')]=qs[_0xb001('0x1b')](_0x29507c[_0xb001('0x2f')][_0xb001('0x1b')]);}return _0x3024a5[_0xb001('0x46')](_0x52908b);}})[_0xb001('0x24')](function(_0x32d5c4){if(_0x32d5c4){return _0x32d5c4?{'count':_0x405957,'rows':_0x32d5c4}:null;}})[_0xb001('0x24')](respondWithResult(_0x4d4ced,null))[_0xb001('0x40')](handleError(_0x4d4ced,null));};exports[_0xb001('0x4b')]=function(_0x1084d2,_0x30af9b,_0x4431be){var _0x1653c2={};var _0x3f6942={};var _0x5fa55;var _0x12fca8;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x1084d2[_0xb001('0x41')]['id']}})[_0xb001('0x24')](handleEntityNotFound(_0x30af9b,null))[_0xb001('0x24')](function(_0x249c69){if(_0x249c69){_0x5fa55=_0x249c69;_0x3f6942['model']=_[_0xb001('0x30')](db[_0xb001('0x48')][_0xb001('0x2a')]);_0x3f6942[_0xb001('0x2f')]=_[_0xb001('0x30')](_0x1084d2['query']);_0x3f6942[_0xb001('0x31')]=_[_0xb001('0x32')](_0x3f6942[_0xb001('0x33')],_0x3f6942[_0xb001('0x2f')]);_0x1653c2[_0xb001('0x36')]=_[_0xb001('0x32')](_0x3f6942['model'],qs[_0xb001('0x34')](_0x1084d2[_0xb001('0x2f')]['fields']));_0x1653c2[_0xb001('0x36')]=_0x1653c2[_0xb001('0x36')][_0xb001('0x35')]?_0x1653c2[_0xb001('0x36')]:_0x3f6942[_0xb001('0x33')];_0x1653c2[_0xb001('0x49')]=qs[_0xb001('0x39')](_0x1084d2['query'][_0xb001('0x39')]);_0x1653c2[_0xb001('0x3b')]=qs[_0xb001('0x31')](_['pick'](_0x1084d2[_0xb001('0x2f')],_0x3f6942[_0xb001('0x31')]));if(_0x1084d2[_0xb001('0x2f')][_0xb001('0x4a')]){_0x1653c2[_0xb001('0x3b')]=_[_0xb001('0x3a')](_0x1653c2[_0xb001('0x3b')],{'$or':_[_0xb001('0x2e')](_0x1653c2[_0xb001('0x36')],function(_0x5dfeb1){var _0x510bfd={};_0x510bfd[_0x5dfeb1]={'$like':'%'+_0x1084d2['query']['filter']+'%'};return _0x510bfd;})});}_0x1653c2=_['merge']({},_0x1653c2,_0x1084d2[_0xb001('0x3d')]);return _0x5fa55[_0xb001('0x4b')](_0x1653c2);}})[_0xb001('0x24')](function(_0x3f1c93){if(_0x3f1c93){_0x12fca8=_0x3f1c93[_0xb001('0x35')];if(!_0x1084d2['query'][_0xb001('0x37')]('nolimit')){_0x1653c2[_0xb001('0x1d')]=qs['limit'](_0x1084d2[_0xb001('0x2f')]['limit']);_0x1653c2[_0xb001('0x1b')]=qs[_0xb001('0x1b')](_0x1084d2[_0xb001('0x2f')][_0xb001('0x1b')]);}return _0x5fa55[_0xb001('0x4b')](_0x1653c2);}})[_0xb001('0x24')](function(_0x4fe044){if(_0x4fe044){return _0x4fe044?{'count':_0x12fca8,'rows':_0x4fe044}:null;}})['then'](respondWithResult(_0x30af9b,null))['catch'](handleError(_0x30af9b,null));};exports['getFields']=function(_0x55e5d0,_0x57a02d,_0x490ec2){var _0x41324f={};var _0x424ddc={};var _0x5290e7;var _0x55a86a;return db[_0xb001('0x29')][_0xb001('0x47')]({'where':{'id':_0x55e5d0[_0xb001('0x41')]['id']}})[_0xb001('0x24')](handleEntityNotFound(_0x57a02d,null))['then'](function(_0x3c636c){if(_0x3c636c){_0x5290e7=_0x3c636c;_0x424ddc[_0xb001('0x33')]=_[_0xb001('0x30')](db[_0xb001('0x48')][_0xb001('0x2a')]);_0x424ddc['query']=_[_0xb001('0x30')](_0x55e5d0[_0xb001('0x2f')]);_0x424ddc[_0xb001('0x31')]=_[_0xb001('0x32')](_0x424ddc[_0xb001('0x33')],_0x424ddc['query']);_0x41324f[_0xb001('0x36')]=_[_0xb001('0x32')](_0x424ddc[_0xb001('0x33')],qs[_0xb001('0x34')](_0x55e5d0['query'][_0xb001('0x34')]));_0x41324f[_0xb001('0x36')]=_0x41324f['attributes']['length']?_0x41324f['attributes']:_0x424ddc[_0xb001('0x33')];_0x41324f[_0xb001('0x49')]=qs[_0xb001('0x39')](_0x55e5d0[_0xb001('0x2f')][_0xb001('0x39')]);_0x41324f[_0xb001('0x3b')]=qs[_0xb001('0x31')](_[_0xb001('0x4c')](_0x55e5d0[_0xb001('0x2f')],_0x424ddc[_0xb001('0x31')]));if(_0x55e5d0[_0xb001('0x2f')][_0xb001('0x4a')]){_0x41324f[_0xb001('0x3b')]=_['merge'](_0x41324f[_0xb001('0x3b')],{'$or':_[_0xb001('0x2e')](_0x41324f[_0xb001('0x36')],function(_0x19c716){var _0x32c643={};_0x32c643[_0x19c716]={'$like':'%'+_0x55e5d0['query'][_0xb001('0x4a')]+'%'};return _0x32c643;})});}_0x41324f=_['merge']({},_0x41324f,_0x55e5d0[_0xb001('0x3d')]);return _0x5290e7[_0xb001('0x4d')](_0x41324f);}})[_0xb001('0x24')](function(_0x142a8a){if(_0x142a8a){_0x55a86a=_0x142a8a['length'];if(!_0x55e5d0[_0xb001('0x2f')][_0xb001('0x37')](_0xb001('0x38'))){_0x41324f[_0xb001('0x1d')]=qs[_0xb001('0x1d')](_0x55e5d0[_0xb001('0x2f')][_0xb001('0x1d')]);_0x41324f[_0xb001('0x1b')]=qs['offset'](_0x55e5d0[_0xb001('0x2f')][_0xb001('0x1b')]);}return _0x5290e7['getFields'](_0x41324f);}})[_0xb001('0x24')](function(_0xd14d8e){if(_0xd14d8e){return _0xd14d8e?{'count':_0x55a86a,'rows':_0xd14d8e}:null;}})[_0xb001('0x24')](respondWithResult(_0x57a02d,null))[_0xb001('0x40')](handleError(_0x57a02d,null));}; \ No newline at end of file +var _0x9e86=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','then','includeAll','include','catch','show','length','options','find','create','body','update','params','findOne','FreshsalesField','getSubjects','getDescriptions','hasOwnProperty','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4b4132,_0x3ecb4e){var _0x2a89f3=function(_0xa55d58){while(--_0xa55d58){_0x4b4132['push'](_0x4b4132['shift']());}};_0x2a89f3(++_0x3ecb4e);}(_0x9e86,0x185));var _0x69e8=function(_0x3fc467,_0x2e6102){_0x3fc467=_0x3fc467-0x0;var _0x584c72=_0x9e86[_0x3fc467];return _0x584c72;};'use strict';var emlformat=require(_0x69e8('0x0'));var rimraf=require(_0x69e8('0x1'));var zipdir=require(_0x69e8('0x2'));var jsonpatch=require(_0x69e8('0x3'));var rp=require(_0x69e8('0x4'));var moment=require(_0x69e8('0x5'));var BPromise=require(_0x69e8('0x6'));var Mustache=require(_0x69e8('0x7'));var util=require(_0x69e8('0x8'));var path=require('path');var sox=require(_0x69e8('0x9'));var csv=require(_0x69e8('0xa'));var ejs=require(_0x69e8('0xb'));var fs=require('fs');var fs_extra=require(_0x69e8('0xc'));var _=require(_0x69e8('0xd'));var squel=require('squel');var crypto=require(_0x69e8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x69e8('0xf'));var toCsv=require(_0x69e8('0xa'));var querystring=require(_0x69e8('0x10'));var Papa=require('papaparse');var Redis=require(_0x69e8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x69e8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69e8('0x13'));var logger=require(_0x69e8('0x14'))(_0x69e8('0x15'));var utils=require(_0x69e8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69e8('0x17'))['db'];function respondWithStatusCode(_0x3832cc,_0x8a7e05){_0x8a7e05=_0x8a7e05||0xcc;return function(_0x109edd){if(_0x109edd){return _0x3832cc[_0x69e8('0x18')](_0x8a7e05);}return _0x3832cc[_0x69e8('0x19')](_0x8a7e05)[_0x69e8('0x1a')]();};}function respondWithResult(_0x4b6fa2,_0x4727ff){_0x4727ff=_0x4727ff||0xc8;return function(_0x467845){if(_0x467845){return _0x4b6fa2[_0x69e8('0x19')](_0x4727ff)[_0x69e8('0x1b')](_0x467845);}};}function respondWithFilteredResult(_0xb32abc,_0x85dfaf){return function(_0x44bc44){if(_0x44bc44){var _0x46c26c=typeof _0x85dfaf[_0x69e8('0x1c')]===_0x69e8('0x1d')&&typeof _0x85dfaf[_0x69e8('0x1e')]===_0x69e8('0x1d');var _0x259e83=_0x44bc44['count'];var _0xea3a87=_0x46c26c?0x0:_0x85dfaf[_0x69e8('0x1c')];var _0x3352e2=_0x46c26c?_0x44bc44['count']:_0x85dfaf[_0x69e8('0x1c')]+_0x85dfaf['limit'];var _0x25dffc;if(_0x3352e2>=_0x259e83){_0x3352e2=_0x259e83;_0x25dffc=0xc8;}else{_0x25dffc=0xce;}_0xb32abc[_0x69e8('0x19')](_0x25dffc);return _0xb32abc[_0x69e8('0x1f')](_0x69e8('0x20'),_0xea3a87+'-'+_0x3352e2+'/'+_0x259e83)[_0x69e8('0x1b')](_0x44bc44);}return null;};}function patchUpdates(_0x139a36){return function(_0x5744d4){try{jsonpatch['apply'](_0x5744d4,_0x139a36,!![]);}catch(_0x474e6f){return BPromise[_0x69e8('0x21')](_0x474e6f);}return _0x5744d4[_0x69e8('0x22')]();};}function saveUpdates(_0x2268ee,_0x5e7778){return function(_0x55bd06){if(_0x55bd06){return _0x55bd06['update'](_0x2268ee)['then'](function(_0x51f319){return _0x51f319;});}return null;};}function removeEntity(_0x56423b,_0x9dacb7){return function(_0x51e25a){if(_0x51e25a){return _0x51e25a[_0x69e8('0x23')]()['then'](function(){_0x56423b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x482140,_0x28a018){return function(_0xd6708e){if(!_0xd6708e){_0x482140['sendStatus'](0x194);}return _0xd6708e;};}function handleError(_0x2e4fee,_0x4f1531){_0x4f1531=_0x4f1531||0x1f4;return function(_0x2ab153){logger[_0x69e8('0x24')](_0x2ab153['stack']);if(_0x2ab153[_0x69e8('0x25')]){delete _0x2ab153[_0x69e8('0x25')];}_0x2e4fee[_0x69e8('0x19')](_0x4f1531)[_0x69e8('0x26')](_0x2ab153);};}exports[_0x69e8('0x27')]=function(_0x859b2b,_0x4aa077){var _0x13cea4={},_0x5591c3={},_0x1b2db4={'count':0x0,'rows':[]};var _0x1e291c=_[_0x69e8('0x28')](db[_0x69e8('0x29')][_0x69e8('0x2a')],function(_0x5dcc47){return{'name':_0x5dcc47['fieldName'],'type':_0x5dcc47[_0x69e8('0x2b')][_0x69e8('0x2c')]};});_0x5591c3[_0x69e8('0x2d')]=_[_0x69e8('0x28')](_0x1e291c,_0x69e8('0x25'));_0x5591c3[_0x69e8('0x2e')]=_[_0x69e8('0x2f')](_0x859b2b[_0x69e8('0x2e')]);_0x5591c3[_0x69e8('0x30')]=_['intersection'](_0x5591c3['model'],_0x5591c3['query']);_0x13cea4[_0x69e8('0x31')]=_[_0x69e8('0x32')](_0x5591c3[_0x69e8('0x2d')],qs['fields'](_0x859b2b[_0x69e8('0x2e')][_0x69e8('0x33')]));_0x13cea4[_0x69e8('0x31')]=_0x13cea4['attributes']['length']?_0x13cea4[_0x69e8('0x31')]:_0x5591c3[_0x69e8('0x2d')];if(!_0x859b2b[_0x69e8('0x2e')]['hasOwnProperty'](_0x69e8('0x34'))){_0x13cea4[_0x69e8('0x1e')]=qs[_0x69e8('0x1e')](_0x859b2b[_0x69e8('0x2e')]['limit']);_0x13cea4[_0x69e8('0x1c')]=qs[_0x69e8('0x1c')](_0x859b2b[_0x69e8('0x2e')][_0x69e8('0x1c')]);}_0x13cea4[_0x69e8('0x35')]=qs[_0x69e8('0x36')](_0x859b2b['query'][_0x69e8('0x36')]);_0x13cea4[_0x69e8('0x37')]=qs[_0x69e8('0x30')](_[_0x69e8('0x38')](_0x859b2b['query'],_0x5591c3['filters']),_0x1e291c);if(_0x859b2b[_0x69e8('0x2e')]['filter']){_0x13cea4[_0x69e8('0x37')]=_[_0x69e8('0x39')](_0x13cea4['where'],{'$or':_[_0x69e8('0x28')](_0x1e291c,function(_0x1ebbaa){if(_0x1ebbaa[_0x69e8('0x2b')]!==_0x69e8('0x3a')){var _0x11b151={};_0x11b151[_0x1ebbaa['name']]={'$like':'%'+_0x859b2b['query'][_0x69e8('0x3b')]+'%'};return _0x11b151;}})});}_0x13cea4=_[_0x69e8('0x39')]({},_0x13cea4,_0x859b2b['options']);var _0x52ec7a={'where':_0x13cea4[_0x69e8('0x37')]};return db[_0x69e8('0x29')][_0x69e8('0x3c')](_0x52ec7a)[_0x69e8('0x3d')](function(_0x3a36c7){_0x1b2db4['count']=_0x3a36c7;if(_0x859b2b['query'][_0x69e8('0x3e')]){_0x13cea4[_0x69e8('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x13cea4);})['then'](function(_0x566a2b){_0x1b2db4['rows']=_0x566a2b;return _0x1b2db4;})[_0x69e8('0x3d')](respondWithFilteredResult(_0x4aa077,_0x13cea4))[_0x69e8('0x40')](handleError(_0x4aa077,null));};exports[_0x69e8('0x41')]=function(_0x24bd2d,_0x140a8a){var _0x2f3592={'raw':![],'where':{'id':_0x24bd2d['params']['id']}},_0x13e6b0={};_0x13e6b0[_0x69e8('0x2d')]=_[_0x69e8('0x2f')](db[_0x69e8('0x29')]['rawAttributes']);_0x13e6b0[_0x69e8('0x2e')]=_[_0x69e8('0x2f')](_0x24bd2d[_0x69e8('0x2e')]);_0x13e6b0[_0x69e8('0x30')]=_[_0x69e8('0x32')](_0x13e6b0[_0x69e8('0x2d')],_0x13e6b0['query']);_0x2f3592[_0x69e8('0x31')]=_['intersection'](_0x13e6b0[_0x69e8('0x2d')],qs[_0x69e8('0x33')](_0x24bd2d[_0x69e8('0x2e')][_0x69e8('0x33')]));_0x2f3592[_0x69e8('0x31')]=_0x2f3592[_0x69e8('0x31')][_0x69e8('0x42')]?_0x2f3592[_0x69e8('0x31')]:_0x13e6b0[_0x69e8('0x2d')];if(_0x24bd2d[_0x69e8('0x2e')]['includeAll']){_0x2f3592[_0x69e8('0x3f')]=[{'all':!![]}];}_0x2f3592=_[_0x69e8('0x39')]({},_0x2f3592,_0x24bd2d[_0x69e8('0x43')]);return db['FreshsalesConfiguration'][_0x69e8('0x44')](_0x2f3592)[_0x69e8('0x3d')](handleEntityNotFound(_0x140a8a,null))[_0x69e8('0x3d')](respondWithResult(_0x140a8a,null))['catch'](handleError(_0x140a8a,null));};exports[_0x69e8('0x45')]=function(_0x4ba19c,_0x301f29){return db[_0x69e8('0x29')]['create'](_0x4ba19c[_0x69e8('0x46')],{})['then'](respondWithResult(_0x301f29,0xc9))[_0x69e8('0x40')](handleError(_0x301f29,null));};exports[_0x69e8('0x47')]=function(_0x4f5050,_0x305d25){if(_0x4f5050['body']['id']){delete _0x4f5050[_0x69e8('0x46')]['id'];}return db['FreshsalesConfiguration'][_0x69e8('0x44')]({'where':{'id':_0x4f5050[_0x69e8('0x48')]['id']}})[_0x69e8('0x3d')](handleEntityNotFound(_0x305d25,null))[_0x69e8('0x3d')](saveUpdates(_0x4f5050['body'],null))['then'](respondWithResult(_0x305d25,null))[_0x69e8('0x40')](handleError(_0x305d25,null));};exports['destroy']=function(_0x334b04,_0x46dd22){return db[_0x69e8('0x29')][_0x69e8('0x44')]({'where':{'id':_0x334b04[_0x69e8('0x48')]['id']}})[_0x69e8('0x3d')](handleEntityNotFound(_0x46dd22,null))[_0x69e8('0x3d')](removeEntity(_0x46dd22,null))[_0x69e8('0x40')](handleError(_0x46dd22,null));};exports['getSubjects']=function(_0x455b2c,_0x371530,_0x1a463c){var _0x40dcff={};var _0x4d1324={};var _0x4948b1;var _0x3e0863;return db[_0x69e8('0x29')][_0x69e8('0x49')]({'where':{'id':_0x455b2c[_0x69e8('0x48')]['id']}})[_0x69e8('0x3d')](handleEntityNotFound(_0x371530,null))['then'](function(_0xfb43a3){if(_0xfb43a3){_0x4948b1=_0xfb43a3;_0x4d1324[_0x69e8('0x2d')]=_[_0x69e8('0x2f')](db[_0x69e8('0x4a')][_0x69e8('0x2a')]);_0x4d1324[_0x69e8('0x2e')]=_[_0x69e8('0x2f')](_0x455b2c[_0x69e8('0x2e')]);_0x4d1324[_0x69e8('0x30')]=_[_0x69e8('0x32')](_0x4d1324[_0x69e8('0x2d')],_0x4d1324[_0x69e8('0x2e')]);_0x40dcff['attributes']=_[_0x69e8('0x32')](_0x4d1324[_0x69e8('0x2d')],qs[_0x69e8('0x33')](_0x455b2c[_0x69e8('0x2e')][_0x69e8('0x33')]));_0x40dcff[_0x69e8('0x31')]=_0x40dcff[_0x69e8('0x31')]['length']?_0x40dcff[_0x69e8('0x31')]:_0x4d1324[_0x69e8('0x2d')];_0x40dcff[_0x69e8('0x35')]=qs[_0x69e8('0x36')](_0x455b2c[_0x69e8('0x2e')][_0x69e8('0x36')]);_0x40dcff['where']=qs[_0x69e8('0x30')](_[_0x69e8('0x38')](_0x455b2c[_0x69e8('0x2e')],_0x4d1324[_0x69e8('0x30')]));if(_0x455b2c[_0x69e8('0x2e')][_0x69e8('0x3b')]){_0x40dcff[_0x69e8('0x37')]=_[_0x69e8('0x39')](_0x40dcff[_0x69e8('0x37')],{'$or':_[_0x69e8('0x28')](_0x40dcff[_0x69e8('0x31')],function(_0x735431){var _0x4f3aa1={};_0x4f3aa1[_0x735431]={'$like':'%'+_0x455b2c['query']['filter']+'%'};return _0x4f3aa1;})});}_0x40dcff=_['merge']({},_0x40dcff,_0x455b2c[_0x69e8('0x43')]);return _0x4948b1[_0x69e8('0x4b')](_0x40dcff);}})[_0x69e8('0x3d')](function(_0x1133a2){if(_0x1133a2){_0x3e0863=_0x1133a2['length'];if(!_0x455b2c[_0x69e8('0x2e')]['hasOwnProperty'](_0x69e8('0x34'))){_0x40dcff[_0x69e8('0x1e')]=qs[_0x69e8('0x1e')](_0x455b2c[_0x69e8('0x2e')][_0x69e8('0x1e')]);_0x40dcff[_0x69e8('0x1c')]=qs[_0x69e8('0x1c')](_0x455b2c[_0x69e8('0x2e')][_0x69e8('0x1c')]);}return _0x4948b1[_0x69e8('0x4b')](_0x40dcff);}})['then'](function(_0x5a323f){if(_0x5a323f){return _0x5a323f?{'count':_0x3e0863,'rows':_0x5a323f}:null;}})[_0x69e8('0x3d')](respondWithResult(_0x371530,null))['catch'](handleError(_0x371530,null));};exports['getDescriptions']=function(_0x1329c8,_0x3b22fd,_0x1672ab){var _0x3dfeec={};var _0x3f613c={};var _0x1f8a5f;var _0x103553;return db[_0x69e8('0x29')][_0x69e8('0x49')]({'where':{'id':_0x1329c8[_0x69e8('0x48')]['id']}})[_0x69e8('0x3d')](handleEntityNotFound(_0x3b22fd,null))[_0x69e8('0x3d')](function(_0x2c952c){if(_0x2c952c){_0x1f8a5f=_0x2c952c;_0x3f613c[_0x69e8('0x2d')]=_[_0x69e8('0x2f')](db[_0x69e8('0x4a')][_0x69e8('0x2a')]);_0x3f613c[_0x69e8('0x2e')]=_[_0x69e8('0x2f')](_0x1329c8[_0x69e8('0x2e')]);_0x3f613c[_0x69e8('0x30')]=_[_0x69e8('0x32')](_0x3f613c[_0x69e8('0x2d')],_0x3f613c[_0x69e8('0x2e')]);_0x3dfeec['attributes']=_['intersection'](_0x3f613c[_0x69e8('0x2d')],qs['fields'](_0x1329c8[_0x69e8('0x2e')]['fields']));_0x3dfeec[_0x69e8('0x31')]=_0x3dfeec['attributes'][_0x69e8('0x42')]?_0x3dfeec[_0x69e8('0x31')]:_0x3f613c[_0x69e8('0x2d')];_0x3dfeec[_0x69e8('0x35')]=qs[_0x69e8('0x36')](_0x1329c8[_0x69e8('0x2e')][_0x69e8('0x36')]);_0x3dfeec[_0x69e8('0x37')]=qs[_0x69e8('0x30')](_[_0x69e8('0x38')](_0x1329c8[_0x69e8('0x2e')],_0x3f613c['filters']));if(_0x1329c8[_0x69e8('0x2e')][_0x69e8('0x3b')]){_0x3dfeec[_0x69e8('0x37')]=_[_0x69e8('0x39')](_0x3dfeec['where'],{'$or':_[_0x69e8('0x28')](_0x3dfeec[_0x69e8('0x31')],function(_0x31fe8a){var _0x102793={};_0x102793[_0x31fe8a]={'$like':'%'+_0x1329c8[_0x69e8('0x2e')]['filter']+'%'};return _0x102793;})});}_0x3dfeec=_[_0x69e8('0x39')]({},_0x3dfeec,_0x1329c8[_0x69e8('0x43')]);return _0x1f8a5f[_0x69e8('0x4c')](_0x3dfeec);}})[_0x69e8('0x3d')](function(_0x1c7b3c){if(_0x1c7b3c){_0x103553=_0x1c7b3c[_0x69e8('0x42')];if(!_0x1329c8['query'][_0x69e8('0x4d')](_0x69e8('0x34'))){_0x3dfeec['limit']=qs[_0x69e8('0x1e')](_0x1329c8[_0x69e8('0x2e')]['limit']);_0x3dfeec[_0x69e8('0x1c')]=qs['offset'](_0x1329c8[_0x69e8('0x2e')]['offset']);}return _0x1f8a5f[_0x69e8('0x4c')](_0x3dfeec);}})[_0x69e8('0x3d')](function(_0x1ac05c){if(_0x1ac05c){return _0x1ac05c?{'count':_0x103553,'rows':_0x1ac05c}:null;}})[_0x69e8('0x3d')](respondWithResult(_0x3b22fd,null))[_0x69e8('0x40')](handleError(_0x3b22fd,null));};exports['getFields']=function(_0x25d965,_0x230b5b,_0xdf661){var _0x574107={};var _0x350028={};var _0x192d4b;var _0x42d416;return db[_0x69e8('0x29')]['findOne']({'where':{'id':_0x25d965['params']['id']}})[_0x69e8('0x3d')](handleEntityNotFound(_0x230b5b,null))[_0x69e8('0x3d')](function(_0x208ca2){if(_0x208ca2){_0x192d4b=_0x208ca2;_0x350028[_0x69e8('0x2d')]=_['keys'](db['FreshsalesField'][_0x69e8('0x2a')]);_0x350028[_0x69e8('0x2e')]=_['keys'](_0x25d965[_0x69e8('0x2e')]);_0x350028[_0x69e8('0x30')]=_[_0x69e8('0x32')](_0x350028['model'],_0x350028[_0x69e8('0x2e')]);_0x574107[_0x69e8('0x31')]=_['intersection'](_0x350028['model'],qs[_0x69e8('0x33')](_0x25d965[_0x69e8('0x2e')][_0x69e8('0x33')]));_0x574107['attributes']=_0x574107[_0x69e8('0x31')]['length']?_0x574107['attributes']:_0x350028[_0x69e8('0x2d')];_0x574107[_0x69e8('0x35')]=qs[_0x69e8('0x36')](_0x25d965[_0x69e8('0x2e')][_0x69e8('0x36')]);_0x574107[_0x69e8('0x37')]=qs['filters'](_[_0x69e8('0x38')](_0x25d965[_0x69e8('0x2e')],_0x350028[_0x69e8('0x30')]));if(_0x25d965[_0x69e8('0x2e')][_0x69e8('0x3b')]){_0x574107['where']=_[_0x69e8('0x39')](_0x574107['where'],{'$or':_['map'](_0x574107[_0x69e8('0x31')],function(_0x136ff2){var _0x30bd24={};_0x30bd24[_0x136ff2]={'$like':'%'+_0x25d965[_0x69e8('0x2e')][_0x69e8('0x3b')]+'%'};return _0x30bd24;})});}_0x574107=_[_0x69e8('0x39')]({},_0x574107,_0x25d965['options']);return _0x192d4b[_0x69e8('0x4e')](_0x574107);}})[_0x69e8('0x3d')](function(_0x3d4a54){if(_0x3d4a54){_0x42d416=_0x3d4a54['length'];if(!_0x25d965[_0x69e8('0x2e')][_0x69e8('0x4d')](_0x69e8('0x34'))){_0x574107[_0x69e8('0x1e')]=qs[_0x69e8('0x1e')](_0x25d965[_0x69e8('0x2e')][_0x69e8('0x1e')]);_0x574107[_0x69e8('0x1c')]=qs['offset'](_0x25d965['query'][_0x69e8('0x1c')]);}return _0x192d4b[_0x69e8('0x4e')](_0x574107);}})[_0x69e8('0x3d')](function(_0x4e1517){if(_0x4e1517){return _0x4e1517?{'count':_0x42d416,'rows':_0x4e1517}:null;}})[_0x69e8('0x3d')](respondWithResult(_0x230b5b,null))[_0x69e8('0x40')](handleError(_0x230b5b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 0467278..a049950 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 _0xd3e8=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x496211,_0x216a55){var _0x506ca6=function(_0x70b28b){while(--_0x70b28b){_0x496211['push'](_0x496211['shift']());}};_0x506ca6(++_0x216a55);}(_0xd3e8,0xb8));var _0x8d3e=function(_0x3ba03b,_0xba0afa){_0x3ba03b=_0x3ba03b-0x0;var _0x3968a8=_0xd3e8[_0x3ba03b];return _0x3968a8;};'use strict';var _=require(_0x8d3e('0x0'));var util=require(_0x8d3e('0x1'));var logger=require(_0x8d3e('0x2'))(_0x8d3e('0x3'));var moment=require('moment');var BPromise=require(_0x8d3e('0x4'));var rp=require(_0x8d3e('0x5'));var fs=require('fs');var path=require(_0x8d3e('0x6'));var rimraf=require(_0x8d3e('0x7'));var config=require(_0x8d3e('0x8'));var attributes=require(_0x8d3e('0x9'));module[_0x8d3e('0xa')]=function(_0x4686fb,_0x47fd6d){return _0x4686fb[_0x8d3e('0xb')](_0x8d3e('0xc'),attributes,{'tableName':_0x8d3e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a9a=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1bd6d9,_0x377aad){var _0x7cadf7=function(_0x38ff81){while(--_0x38ff81){_0x1bd6d9['push'](_0x1bd6d9['shift']());}};_0x7cadf7(++_0x377aad);}(_0x2a9a,0x1a6));var _0xa2a9=function(_0x22678d,_0x14f304){_0x22678d=_0x22678d-0x0;var _0x5d47b1=_0x2a9a[_0x22678d];return _0x5d47b1;};'use strict';var _=require('lodash');var util=require(_0xa2a9('0x0'));var logger=require(_0xa2a9('0x1'))(_0xa2a9('0x2'));var moment=require(_0xa2a9('0x3'));var BPromise=require(_0xa2a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2a9('0x5'));var rimraf=require(_0xa2a9('0x6'));var config=require('../../config/environment');var attributes=require(_0xa2a9('0x7'));module[_0xa2a9('0x8')]=function(_0x5ece1e,_0xf06b43){return _0x5ece1e[_0xa2a9('0x9')](_0xa2a9('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 8b6f062..36663d9 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 _0x0e6f=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x53b24e,_0x584daf){var _0x20e49f=function(_0x1bd49c){while(--_0x1bd49c){_0x53b24e['push'](_0x53b24e['shift']());}};_0x20e49f(++_0x584daf);}(_0x0e6f,0x85));var _0xf0e6=function(_0x2040dd,_0x156a63){_0x2040dd=_0x2040dd-0x0;var _0x27688f=_0x0e6f[_0x2040dd];return _0x27688f;};'use strict';var _=require('lodash');var util=require(_0xf0e6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e6('0x1'));var fs=require('fs');var Redis=require(_0xf0e6('0x2'));var db=require(_0xf0e6('0x3'))['db'];var utils=require(_0xf0e6('0x4'));var logger=require(_0xf0e6('0x5'))(_0xf0e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xf0e6('0x7'));var client=jayson[_0xf0e6('0x8')][_0xf0e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x175fd3,_0x40eafc,_0xda136e){return new BPromise(function(_0x23972a,_0x12a47f){return client[_0xf0e6('0xa')](_0x175fd3,_0xda136e)[_0xf0e6('0xb')](function(_0x5ee7cf){logger[_0xf0e6('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x40eafc,_0xf0e6('0xd'));logger[_0xf0e6('0xe')](_0xf0e6('0xf'),_0x40eafc,_0xf0e6('0xd'),JSON[_0xf0e6('0x10')](_0x5ee7cf));if(_0x5ee7cf[_0xf0e6('0x11')]){if(_0x5ee7cf[_0xf0e6('0x11')][_0xf0e6('0x12')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x40eafc,_0x5ee7cf[_0xf0e6('0x11')][_0xf0e6('0x13')]);return _0x12a47f(_0x5ee7cf[_0xf0e6('0x11')]['message']);}logger[_0xf0e6('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x40eafc,_0x5ee7cf['error'][_0xf0e6('0x13')]);return _0x23972a(_0x5ee7cf[_0xf0e6('0x11')][_0xf0e6('0x13')]);}else{logger['info'](_0xf0e6('0x14'),_0x40eafc,_0xf0e6('0xd'));_0x23972a(_0x5ee7cf['result'][_0xf0e6('0x13')]);}})[_0xf0e6('0x15')](function(_0x4f27eb){logger[_0xf0e6('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x40eafc,_0x4f27eb);_0x12a47f(_0x4f27eb);});});} \ No newline at end of file +var _0x44dc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0x44dc,0xb5));var _0xc44d=function(_0x17e849,_0x588a88){_0x17e849=_0x17e849-0x0;var _0x35d503=_0x44dc[_0x17e849];return _0x35d503;};'use strict';var _=require(_0xc44d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc44d('0x1'));var rs=require(_0xc44d('0x2'));var fs=require('fs');var Redis=require(_0xc44d('0x3'));var db=require(_0xc44d('0x4'))['db'];var utils=require(_0xc44d('0x5'));var logger=require(_0xc44d('0x6'))(_0xc44d('0x7'));var config=require(_0xc44d('0x8'));var jayson=require(_0xc44d('0x9'));var client=jayson['client'][_0xc44d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f9773,_0x364dae,_0x3fd941){return new BPromise(function(_0x233918,_0x3c8ba2){return client[_0xc44d('0xb')](_0x1f9773,_0x3fd941)[_0xc44d('0xc')](function(_0x57ed2a){logger[_0xc44d('0xd')](_0xc44d('0xe'),_0x364dae,_0xc44d('0xf'));logger[_0xc44d('0x10')](_0xc44d('0x11'),_0x364dae,'request\x20sent',JSON[_0xc44d('0x12')](_0x57ed2a));if(_0x57ed2a[_0xc44d('0x13')]){if(_0x57ed2a['error']['code']===0x1f4){logger[_0xc44d('0x13')](_0xc44d('0xe'),_0x364dae,_0x57ed2a[_0xc44d('0x13')][_0xc44d('0x14')]);return _0x3c8ba2(_0x57ed2a[_0xc44d('0x13')]['message']);}logger[_0xc44d('0x13')](_0xc44d('0xe'),_0x364dae,_0x57ed2a[_0xc44d('0x13')]['message']);return _0x233918(_0x57ed2a[_0xc44d('0x13')][_0xc44d('0x14')]);}else{logger[_0xc44d('0xd')](_0xc44d('0xe'),_0x364dae,_0xc44d('0xf'));_0x233918(_0x57ed2a[_0xc44d('0x15')][_0xc44d('0x14')]);}})[_0xc44d('0x16')](function(_0x4f9fcd){logger['error'](_0xc44d('0xe'),_0x364dae,_0x4f9fcd);_0x3c8ba2(_0x4f9fcd);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index b1abf70..c08a61e 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 _0x8e94=['../../components/auth/service','get','isAuthenticated','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x552572,_0x34405f){var _0x1656f3=function(_0x3a46ae){while(--_0x3a46ae){_0x552572['push'](_0x552572['shift']());}};_0x1656f3(++_0x34405f);}(_0x8e94,0xf8));var _0x48e9=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0x8e94[_0x3ed054];return _0x16dd95;};'use strict';var multer=require(_0x48e9('0x0'));var util=require(_0x48e9('0x1'));var path=require('path');var timeout=require(_0x48e9('0x2'));var express=require('express');var router=express[_0x48e9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x48e9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0x48e9('0x5')]('/',auth[_0x48e9('0x6')](),controller['index']);router[_0x48e9('0x5')]('/:id',auth[_0x48e9('0x6')](),controller['show']);router[_0x48e9('0x7')]('/',auth[_0x48e9('0x6')](),controller[_0x48e9('0x8')]);router[_0x48e9('0x9')]('/:id',auth[_0x48e9('0x6')](),controller[_0x48e9('0xa')]);router['delete'](_0x48e9('0xb'),auth['isAuthenticated'](),controller[_0x48e9('0xc')]);module[_0x48e9('0xd')]=router; \ No newline at end of file +var _0x49ac=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','show','put','update','delete'];(function(_0x1894be,_0x4fba20){var _0x4e146e=function(_0x321591){while(--_0x321591){_0x1894be['push'](_0x1894be['shift']());}};_0x4e146e(++_0x4fba20);}(_0x49ac,0x19e));var _0xc49a=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0x49ac[_0x3a2118];return _0x1d181d;};'use strict';var multer=require(_0xc49a('0x0'));var util=require(_0xc49a('0x1'));var path=require(_0xc49a('0x2'));var timeout=require(_0xc49a('0x3'));var express=require(_0xc49a('0x4'));var router=express[_0xc49a('0x5')]();var fs_extra=require(_0xc49a('0x6'));var auth=require(_0xc49a('0x7'));var interaction=require(_0xc49a('0x8'));var config=require(_0xc49a('0x9'));var controller=require(_0xc49a('0xa'));router['get']('/',auth[_0xc49a('0xb')](),controller['index']);router[_0xc49a('0xc')](_0xc49a('0xd'),auth[_0xc49a('0xb')](),controller[_0xc49a('0xe')]);router['post']('/',auth[_0xc49a('0xb')](),controller['create']);router[_0xc49a('0xf')]('/:id',auth[_0xc49a('0xb')](),controller[_0xc49a('0x10')]);router[_0xc49a('0x11')](_0xc49a('0xd'),auth[_0xc49a('0xb')](),controller['destroy']);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 2390dd4..846640a 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 _0xe9fc=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x133077,_0x3be326){var _0x334692=function(_0x5e24ed){while(--_0x5e24ed){_0x133077['push'](_0x133077['shift']());}};_0x334692(++_0x3be326);}(_0xe9fc,0xe8));var _0xce9f=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe9fc[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xce9f('0x0'));module[_0xce9f('0x1')]={'type':{'type':Sequelize[_0xce9f('0x2')]('string',_0xce9f('0x3'),_0xce9f('0x4'),_0xce9f('0x5'),_0xce9f('0x6')),'defaultValue':_0xce9f('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xce9f('0x2')](_0xce9f('0x7'),_0xce9f('0x3'),_0xce9f('0x4'))},'keyContent':{'type':Sequelize[_0xce9f('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xce9f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xce9f('0x8')]}}; \ No newline at end of file +var _0x88db=['picklist','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x59afcb,_0x561a4a){var _0x3d4c13=function(_0x20f81f){while(--_0x20f81f){_0x59afcb['push'](_0x59afcb['shift']());}};_0x3d4c13(++_0x561a4a);}(_0x88db,0x83));var _0xb88d=function(_0x536bb0,_0x208801){_0x536bb0=_0x536bb0-0x0;var _0x77feeb=_0x88db[_0x536bb0];return _0x77feeb;};'use strict';var Sequelize=require(_0xb88d('0x0'));module[_0xb88d('0x1')]={'type':{'type':Sequelize[_0xb88d('0x2')]('string',_0xb88d('0x3'),'customVariable','keyValue',_0xb88d('0x4')),'defaultValue':_0xb88d('0x5')},'content':{'type':Sequelize[_0xb88d('0x6')]},'key':{'type':Sequelize[_0xb88d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xb88d('0x5'),'variable',_0xb88d('0x7'))},'keyContent':{'type':Sequelize[_0xb88d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb88d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb88d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 69ae4eb..452a7c0 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 _0x4b42=['where','pick','type','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort'];(function(_0xcf80d7,_0xc1d7d3){var _0x1393e4=function(_0x50d329){while(--_0x50d329){_0xcf80d7['push'](_0xcf80d7['shift']());}};_0x1393e4(++_0xc1d7d3);}(_0x4b42,0x1b9));var _0x24b4=function(_0x249073,_0x775e5){_0x249073=_0x249073-0x0;var _0x35cf3b=_0x4b42[_0x249073];return _0x35cf3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24b4('0x0'));var jsonpatch=require(_0x24b4('0x1'));var rp=require(_0x24b4('0x2'));var moment=require(_0x24b4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24b4('0x4'));var util=require(_0x24b4('0x5'));var path=require(_0x24b4('0x6'));var sox=require('sox');var csv=require(_0x24b4('0x7'));var ejs=require(_0x24b4('0x8'));var fs=require('fs');var fs_extra=require(_0x24b4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x24b4('0xa'));var deskjs=require(_0x24b4('0xb'));var toCsv=require(_0x24b4('0x7'));var querystring=require(_0x24b4('0xc'));var Papa=require(_0x24b4('0xd'));var Redis=require(_0x24b4('0xe'));var authService=require(_0x24b4('0xf'));var qs=require(_0x24b4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24b4('0x11'));var logger=require(_0x24b4('0x12'))(_0x24b4('0x13'));var utils=require(_0x24b4('0x14'));var config=require(_0x24b4('0x15'));var licenseUtil=require(_0x24b4('0x16'));var db=require(_0x24b4('0x17'))['db'];function respondWithStatusCode(_0x1fb8d9,_0x19f340){_0x19f340=_0x19f340||0xcc;return function(_0xf4cd0d){if(_0xf4cd0d){return _0x1fb8d9[_0x24b4('0x18')](_0x19f340);}return _0x1fb8d9[_0x24b4('0x19')](_0x19f340)[_0x24b4('0x1a')]();};}function respondWithResult(_0x268480,_0x84bb19){_0x84bb19=_0x84bb19||0xc8;return function(_0x490b02){if(_0x490b02){return _0x268480[_0x24b4('0x19')](_0x84bb19)[_0x24b4('0x1b')](_0x490b02);}};}function respondWithFilteredResult(_0x5324d9,_0x42f905){return function(_0x66ba17){if(_0x66ba17){var _0x181de2=typeof _0x42f905[_0x24b4('0x1c')]===_0x24b4('0x1d')&&typeof _0x42f905['limit']===_0x24b4('0x1d');var _0x58c537=_0x66ba17[_0x24b4('0x1e')];var _0x2289ad=_0x181de2?0x0:_0x42f905[_0x24b4('0x1c')];var _0x5d3455=_0x181de2?_0x66ba17[_0x24b4('0x1e')]:_0x42f905['offset']+_0x42f905['limit'];var _0x361ace;if(_0x5d3455>=_0x58c537){_0x5d3455=_0x58c537;_0x361ace=0xc8;}else{_0x361ace=0xce;}_0x5324d9['status'](_0x361ace);return _0x5324d9[_0x24b4('0x1f')]('Content-Range',_0x2289ad+'-'+_0x5d3455+'/'+_0x58c537)['json'](_0x66ba17);}return null;};}function patchUpdates(_0x4eb793){return function(_0x3aa19a){try{jsonpatch[_0x24b4('0x20')](_0x3aa19a,_0x4eb793,!![]);}catch(_0x1269de){return BPromise[_0x24b4('0x21')](_0x1269de);}return _0x3aa19a['save']();};}function saveUpdates(_0x204b56,_0x19616c){return function(_0x592556){if(_0x592556){return _0x592556[_0x24b4('0x22')](_0x204b56)[_0x24b4('0x23')](function(_0x184cfe){return _0x184cfe;});}return null;};}function removeEntity(_0x4e6397,_0x22b513){return function(_0x5c83b0){if(_0x5c83b0){return _0x5c83b0[_0x24b4('0x24')]()[_0x24b4('0x23')](function(){_0x4e6397['status'](0xcc)[_0x24b4('0x1a')]();});}};}function handleEntityNotFound(_0x467148,_0x3ee1c6){return function(_0xafcf4b){if(!_0xafcf4b){_0x467148[_0x24b4('0x18')](0x194);}return _0xafcf4b;};}function handleError(_0xc33631,_0x112598){_0x112598=_0x112598||0x1f4;return function(_0x4e7b0c){logger[_0x24b4('0x25')](_0x4e7b0c[_0x24b4('0x26')]);if(_0x4e7b0c[_0x24b4('0x27')]){delete _0x4e7b0c[_0x24b4('0x27')];}_0xc33631[_0x24b4('0x19')](_0x112598)[_0x24b4('0x28')](_0x4e7b0c);};}exports[_0x24b4('0x29')]=function(_0x29e00b,_0x3c56c0){var _0x594bc4={},_0x495e0a={},_0x443b3e={'count':0x0,'rows':[]};var _0xb902fe=_[_0x24b4('0x2a')](db['FreshsalesField'][_0x24b4('0x2b')],function(_0x60c82d){return{'name':_0x60c82d['fieldName'],'type':_0x60c82d['type'][_0x24b4('0x2c')]};});_0x495e0a[_0x24b4('0x2d')]=_[_0x24b4('0x2a')](_0xb902fe,_0x24b4('0x27'));_0x495e0a[_0x24b4('0x2e')]=_[_0x24b4('0x2f')](_0x29e00b[_0x24b4('0x2e')]);_0x495e0a[_0x24b4('0x30')]=_[_0x24b4('0x31')](_0x495e0a[_0x24b4('0x2d')],_0x495e0a[_0x24b4('0x2e')]);_0x594bc4[_0x24b4('0x32')]=_[_0x24b4('0x31')](_0x495e0a[_0x24b4('0x2d')],qs[_0x24b4('0x33')](_0x29e00b['query'][_0x24b4('0x33')]));_0x594bc4[_0x24b4('0x32')]=_0x594bc4['attributes'][_0x24b4('0x34')]?_0x594bc4[_0x24b4('0x32')]:_0x495e0a[_0x24b4('0x2d')];if(!_0x29e00b[_0x24b4('0x2e')]['hasOwnProperty']('nolimit')){_0x594bc4[_0x24b4('0x35')]=qs[_0x24b4('0x35')](_0x29e00b[_0x24b4('0x2e')][_0x24b4('0x35')]);_0x594bc4[_0x24b4('0x1c')]=qs['offset'](_0x29e00b[_0x24b4('0x2e')][_0x24b4('0x1c')]);}_0x594bc4[_0x24b4('0x36')]=qs[_0x24b4('0x37')](_0x29e00b[_0x24b4('0x2e')]['sort']);_0x594bc4[_0x24b4('0x38')]=qs[_0x24b4('0x30')](_[_0x24b4('0x39')](_0x29e00b[_0x24b4('0x2e')],_0x495e0a[_0x24b4('0x30')]),_0xb902fe);if(_0x29e00b[_0x24b4('0x2e')]['filter']){_0x594bc4[_0x24b4('0x38')]=_['merge'](_0x594bc4['where'],{'$or':_[_0x24b4('0x2a')](_0xb902fe,function(_0x19ce9e){if(_0x19ce9e[_0x24b4('0x3a')]!==_0x24b4('0x3b')){var _0x445083={};_0x445083[_0x19ce9e[_0x24b4('0x27')]]={'$like':'%'+_0x29e00b['query']['filter']+'%'};return _0x445083;}})});}_0x594bc4=_['merge']({},_0x594bc4,_0x29e00b[_0x24b4('0x3c')]);var _0x494b79={'where':_0x594bc4[_0x24b4('0x38')]};return db[_0x24b4('0x3d')][_0x24b4('0x1e')](_0x494b79)[_0x24b4('0x23')](function(_0x1bdc43){_0x443b3e[_0x24b4('0x1e')]=_0x1bdc43;if(_0x29e00b[_0x24b4('0x2e')][_0x24b4('0x3e')]){_0x594bc4[_0x24b4('0x3f')]=[{'all':!![]}];}return db[_0x24b4('0x3d')][_0x24b4('0x40')](_0x594bc4);})[_0x24b4('0x23')](function(_0x2a3949){_0x443b3e['rows']=_0x2a3949;return _0x443b3e;})['then'](respondWithFilteredResult(_0x3c56c0,_0x594bc4))[_0x24b4('0x41')](handleError(_0x3c56c0,null));};exports[_0x24b4('0x42')]=function(_0x2b8884,_0x1af0be){var _0x5c99a0={'raw':!![],'where':{'id':_0x2b8884[_0x24b4('0x43')]['id']}},_0x1fef58={};_0x1fef58[_0x24b4('0x2d')]=_[_0x24b4('0x2f')](db[_0x24b4('0x3d')][_0x24b4('0x2b')]);_0x1fef58[_0x24b4('0x2e')]=_[_0x24b4('0x2f')](_0x2b8884[_0x24b4('0x2e')]);_0x1fef58[_0x24b4('0x30')]=_[_0x24b4('0x31')](_0x1fef58[_0x24b4('0x2d')],_0x1fef58[_0x24b4('0x2e')]);_0x5c99a0[_0x24b4('0x32')]=_[_0x24b4('0x31')](_0x1fef58[_0x24b4('0x2d')],qs['fields'](_0x2b8884['query']['fields']));_0x5c99a0[_0x24b4('0x32')]=_0x5c99a0['attributes'][_0x24b4('0x34')]?_0x5c99a0[_0x24b4('0x32')]:_0x1fef58['model'];if(_0x2b8884['query']['includeAll']){_0x5c99a0[_0x24b4('0x3f')]=[{'all':!![]}];}_0x5c99a0=_['merge']({},_0x5c99a0,_0x2b8884[_0x24b4('0x3c')]);return db['FreshsalesField'][_0x24b4('0x44')](_0x5c99a0)[_0x24b4('0x23')](handleEntityNotFound(_0x1af0be,null))[_0x24b4('0x23')](respondWithResult(_0x1af0be,null))[_0x24b4('0x41')](handleError(_0x1af0be,null));};exports['create']=function(_0x2d5607,_0x3f29b3){return db[_0x24b4('0x3d')][_0x24b4('0x45')](_0x2d5607['body'],{})[_0x24b4('0x23')](respondWithResult(_0x3f29b3,0xc9))[_0x24b4('0x41')](handleError(_0x3f29b3,null));};exports[_0x24b4('0x22')]=function(_0x5e42fb,_0x1a1ef3){if(_0x5e42fb['body']['id']){delete _0x5e42fb['body']['id'];}return db[_0x24b4('0x3d')][_0x24b4('0x44')]({'where':{'id':_0x5e42fb[_0x24b4('0x43')]['id']}})[_0x24b4('0x23')](handleEntityNotFound(_0x1a1ef3,null))[_0x24b4('0x23')](saveUpdates(_0x5e42fb[_0x24b4('0x46')],null))[_0x24b4('0x23')](respondWithResult(_0x1a1ef3,null))[_0x24b4('0x41')](handleError(_0x1a1ef3,null));};exports[_0x24b4('0x24')]=function(_0x505d3c,_0x471a57){return db[_0x24b4('0x3d')]['find']({'where':{'id':_0x505d3c[_0x24b4('0x43')]['id']}})[_0x24b4('0x23')](handleEntityNotFound(_0x471a57,null))[_0x24b4('0x23')](removeEntity(_0x471a57,null))[_0x24b4('0x41')](handleError(_0x471a57,null));}; \ No newline at end of file +var _0x0000=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','map','VIRTUAL','filter','options','FreshsalesField','findAll','rows','catch','params','include','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2c4cee,_0xed54d6){var _0x4cad54=function(_0x5ee3bd){while(--_0x5ee3bd){_0x2c4cee['push'](_0x2c4cee['shift']());}};_0x4cad54(++_0xed54d6);}(_0x0000,0xc1));var _0x0000=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0000[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0000('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0000('0x1'));var rp=require(_0x0000('0x2'));var moment=require('moment');var BPromise=require(_0x0000('0x3'));var Mustache=require('mustache');var util=require(_0x0000('0x4'));var path=require(_0x0000('0x5'));var sox=require('sox');var csv=require(_0x0000('0x6'));var ejs=require(_0x0000('0x7'));var fs=require('fs');var fs_extra=require(_0x0000('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0000('0x9'));var jsforce=require(_0x0000('0xa'));var deskjs=require(_0x0000('0xb'));var toCsv=require(_0x0000('0x6'));var querystring=require(_0x0000('0xc'));var Papa=require(_0x0000('0xd'));var Redis=require('ioredis');var authService=require(_0x0000('0xe'));var qs=require(_0x0000('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0000('0x10'))(_0x0000('0x11'));var utils=require(_0x0000('0x12'));var config=require(_0x0000('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12b03f,_0x4f1521){_0x4f1521=_0x4f1521||0xcc;return function(_0x2bec3b){if(_0x2bec3b){return _0x12b03f[_0x0000('0x14')](_0x4f1521);}return _0x12b03f[_0x0000('0x15')](_0x4f1521)[_0x0000('0x16')]();};}function respondWithResult(_0x6cbe2d,_0x16fc3d){_0x16fc3d=_0x16fc3d||0xc8;return function(_0x3f3542){if(_0x3f3542){return _0x6cbe2d[_0x0000('0x15')](_0x16fc3d)[_0x0000('0x17')](_0x3f3542);}};}function respondWithFilteredResult(_0x272417,_0x5af63a){return function(_0x47d4e9){if(_0x47d4e9){var _0x3107d9=typeof _0x5af63a[_0x0000('0x18')]===_0x0000('0x19')&&typeof _0x5af63a[_0x0000('0x1a')]===_0x0000('0x19');var _0x3901ff=_0x47d4e9[_0x0000('0x1b')];var _0x249f23=_0x3107d9?0x0:_0x5af63a['offset'];var _0x6eeddd=_0x3107d9?_0x47d4e9[_0x0000('0x1b')]:_0x5af63a[_0x0000('0x18')]+_0x5af63a['limit'];var _0x459c36;if(_0x6eeddd>=_0x3901ff){_0x6eeddd=_0x3901ff;_0x459c36=0xc8;}else{_0x459c36=0xce;}_0x272417[_0x0000('0x15')](_0x459c36);return _0x272417[_0x0000('0x1c')](_0x0000('0x1d'),_0x249f23+'-'+_0x6eeddd+'/'+_0x3901ff)['json'](_0x47d4e9);}return null;};}function patchUpdates(_0x41cab2){return function(_0x1ec5d7){try{jsonpatch[_0x0000('0x1e')](_0x1ec5d7,_0x41cab2,!![]);}catch(_0x408551){return BPromise[_0x0000('0x1f')](_0x408551);}return _0x1ec5d7[_0x0000('0x20')]();};}function saveUpdates(_0x33cd64,_0xf92881){return function(_0x21daad){if(_0x21daad){return _0x21daad[_0x0000('0x21')](_0x33cd64)[_0x0000('0x22')](function(_0x14f3a9){return _0x14f3a9;});}return null;};}function removeEntity(_0xd22807,_0xd88646){return function(_0x18e794){if(_0x18e794){return _0x18e794[_0x0000('0x23')]()[_0x0000('0x22')](function(){_0xd22807[_0x0000('0x15')](0xcc)[_0x0000('0x16')]();});}};}function handleEntityNotFound(_0x4c4dac,_0x33d1cb){return function(_0x1498b3){if(!_0x1498b3){_0x4c4dac['sendStatus'](0x194);}return _0x1498b3;};}function handleError(_0x2bb425,_0x1e065d){_0x1e065d=_0x1e065d||0x1f4;return function(_0xc1aedd){logger[_0x0000('0x24')](_0xc1aedd[_0x0000('0x25')]);if(_0xc1aedd[_0x0000('0x26')]){delete _0xc1aedd['name'];}_0x2bb425[_0x0000('0x15')](_0x1e065d)[_0x0000('0x27')](_0xc1aedd);};}exports['index']=function(_0x14f4f8,_0x1c0e3e){var _0x1f9b3c={},_0x224dad={},_0x281c8a={'count':0x0,'rows':[]};var _0xe14cd9=_['map'](db['FreshsalesField'][_0x0000('0x28')],function(_0x5ca9fc){return{'name':_0x5ca9fc[_0x0000('0x29')],'type':_0x5ca9fc[_0x0000('0x2a')][_0x0000('0x2b')]};});_0x224dad['model']=_['map'](_0xe14cd9,_0x0000('0x26'));_0x224dad[_0x0000('0x2c')]=_[_0x0000('0x2d')](_0x14f4f8[_0x0000('0x2c')]);_0x224dad[_0x0000('0x2e')]=_[_0x0000('0x2f')](_0x224dad[_0x0000('0x30')],_0x224dad[_0x0000('0x2c')]);_0x1f9b3c[_0x0000('0x31')]=_['intersection'](_0x224dad[_0x0000('0x30')],qs['fields'](_0x14f4f8[_0x0000('0x2c')][_0x0000('0x32')]));_0x1f9b3c[_0x0000('0x31')]=_0x1f9b3c['attributes']['length']?_0x1f9b3c[_0x0000('0x31')]:_0x224dad[_0x0000('0x30')];if(!_0x14f4f8['query']['hasOwnProperty']('nolimit')){_0x1f9b3c[_0x0000('0x1a')]=qs[_0x0000('0x1a')](_0x14f4f8[_0x0000('0x2c')][_0x0000('0x1a')]);_0x1f9b3c[_0x0000('0x18')]=qs[_0x0000('0x18')](_0x14f4f8['query'][_0x0000('0x18')]);}_0x1f9b3c[_0x0000('0x33')]=qs[_0x0000('0x34')](_0x14f4f8[_0x0000('0x2c')][_0x0000('0x34')]);_0x1f9b3c[_0x0000('0x35')]=qs[_0x0000('0x2e')](_[_0x0000('0x36')](_0x14f4f8[_0x0000('0x2c')],_0x224dad[_0x0000('0x2e')]),_0xe14cd9);if(_0x14f4f8[_0x0000('0x2c')]['filter']){_0x1f9b3c[_0x0000('0x35')]=_[_0x0000('0x37')](_0x1f9b3c[_0x0000('0x35')],{'$or':_[_0x0000('0x38')](_0xe14cd9,function(_0x343347){if(_0x343347[_0x0000('0x2a')]!==_0x0000('0x39')){var _0x304dc0={};_0x304dc0[_0x343347['name']]={'$like':'%'+_0x14f4f8['query'][_0x0000('0x3a')]+'%'};return _0x304dc0;}})});}_0x1f9b3c=_['merge']({},_0x1f9b3c,_0x14f4f8[_0x0000('0x3b')]);var _0xcde21f={'where':_0x1f9b3c['where']};return db[_0x0000('0x3c')][_0x0000('0x1b')](_0xcde21f)[_0x0000('0x22')](function(_0x4e8cdd){_0x281c8a[_0x0000('0x1b')]=_0x4e8cdd;if(_0x14f4f8[_0x0000('0x2c')]['includeAll']){_0x1f9b3c['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x0000('0x3d')](_0x1f9b3c);})[_0x0000('0x22')](function(_0x3eeac3){_0x281c8a[_0x0000('0x3e')]=_0x3eeac3;return _0x281c8a;})[_0x0000('0x22')](respondWithFilteredResult(_0x1c0e3e,_0x1f9b3c))[_0x0000('0x3f')](handleError(_0x1c0e3e,null));};exports['show']=function(_0x2ba73d,_0x3986b7){var _0x31dc40={'raw':!![],'where':{'id':_0x2ba73d[_0x0000('0x40')]['id']}},_0x2fd968={};_0x2fd968[_0x0000('0x30')]=_[_0x0000('0x2d')](db[_0x0000('0x3c')][_0x0000('0x28')]);_0x2fd968[_0x0000('0x2c')]=_[_0x0000('0x2d')](_0x2ba73d[_0x0000('0x2c')]);_0x2fd968[_0x0000('0x2e')]=_[_0x0000('0x2f')](_0x2fd968[_0x0000('0x30')],_0x2fd968['query']);_0x31dc40['attributes']=_[_0x0000('0x2f')](_0x2fd968[_0x0000('0x30')],qs[_0x0000('0x32')](_0x2ba73d[_0x0000('0x2c')][_0x0000('0x32')]));_0x31dc40[_0x0000('0x31')]=_0x31dc40[_0x0000('0x31')]['length']?_0x31dc40[_0x0000('0x31')]:_0x2fd968[_0x0000('0x30')];if(_0x2ba73d[_0x0000('0x2c')]['includeAll']){_0x31dc40[_0x0000('0x41')]=[{'all':!![]}];}_0x31dc40=_['merge']({},_0x31dc40,_0x2ba73d[_0x0000('0x3b')]);return db[_0x0000('0x3c')][_0x0000('0x42')](_0x31dc40)[_0x0000('0x22')](handleEntityNotFound(_0x3986b7,null))[_0x0000('0x22')](respondWithResult(_0x3986b7,null))[_0x0000('0x3f')](handleError(_0x3986b7,null));};exports[_0x0000('0x43')]=function(_0x537e11,_0x3b024f){return db[_0x0000('0x3c')][_0x0000('0x43')](_0x537e11[_0x0000('0x44')],{})[_0x0000('0x22')](respondWithResult(_0x3b024f,0xc9))[_0x0000('0x3f')](handleError(_0x3b024f,null));};exports[_0x0000('0x21')]=function(_0x393332,_0x3eb414){if(_0x393332[_0x0000('0x44')]['id']){delete _0x393332[_0x0000('0x44')]['id'];}return db[_0x0000('0x3c')]['find']({'where':{'id':_0x393332[_0x0000('0x40')]['id']}})[_0x0000('0x22')](handleEntityNotFound(_0x3eb414,null))[_0x0000('0x22')](saveUpdates(_0x393332[_0x0000('0x44')],null))[_0x0000('0x22')](respondWithResult(_0x3eb414,null))[_0x0000('0x3f')](handleError(_0x3eb414,null));};exports[_0x0000('0x23')]=function(_0x37604d,_0x123cbc){return db[_0x0000('0x3c')][_0x0000('0x42')]({'where':{'id':_0x37604d['params']['id']}})[_0x0000('0x22')](handleEntityNotFound(_0x123cbc,null))[_0x0000('0x22')](removeEntity(_0x123cbc,null))['catch'](handleError(_0x123cbc,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index d5cf241..555dcbd 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 _0xa880=['./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa880,0x106));var _0x0a88=function(_0x533daf,_0x19a7bf){_0x533daf=_0x533daf-0x0;var _0x3c161f=_0xa880[_0x533daf];return _0x3c161f;};'use strict';var _=require(_0x0a88('0x0'));var util=require(_0x0a88('0x1'));var logger=require(_0x0a88('0x2'))(_0x0a88('0x3'));var moment=require(_0x0a88('0x4'));var BPromise=require(_0x0a88('0x5'));var rp=require(_0x0a88('0x6'));var fs=require('fs');var path=require(_0x0a88('0x7'));var rimraf=require(_0x0a88('0x8'));var config=require(_0x0a88('0x9'));var attributes=require(_0x0a88('0xa'));module['exports']=function(_0x35c530,_0x2aac39){return _0x35c530[_0x0a88('0xb')](_0x0a88('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x0a88('0xd'),'fields':[_0x0a88('0xe'),_0x0a88('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x608a=['int_freshsales_fields','freshsales_unique_index','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','FreshsalesField'];(function(_0x131c73,_0x53cec3){var _0x186ff1=function(_0x46a180){while(--_0x46a180){_0x131c73['push'](_0x131c73['shift']());}};_0x186ff1(++_0x53cec3);}(_0x608a,0xff));var _0xa608=function(_0x206f00,_0xe37fa9){_0x206f00=_0x206f00-0x0;var _0x3de26b=_0x608a[_0x206f00];return _0x3de26b;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var logger=require(_0xa608('0x1'))('api');var moment=require(_0xa608('0x2'));var BPromise=require(_0xa608('0x3'));var rp=require(_0xa608('0x4'));var fs=require('fs');var path=require(_0xa608('0x5'));var rimraf=require('rimraf');var config=require(_0xa608('0x6'));var attributes=require(_0xa608('0x7'));module['exports']=function(_0x4e24d6,_0x3b0f4e){return _0x4e24d6['define'](_0xa608('0x8'),attributes,{'tableName':_0xa608('0x9'),'paranoid':![],'indexes':[{'name':_0xa608('0xa'),'fields':['idField',_0xa608('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 2e43a7a..e4f1b9a 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 _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5bdf1b,_0x36e1c3){var _0x13e34d=function(_0x5accb5){while(--_0x5accb5){_0x5bdf1b['push'](_0x5bdf1b['shift']());}};_0x13e34d(++_0x36e1c3);}(_0xda19,0xd5));var _0x9da1=function(_0x59d195,_0x124606){_0x59d195=_0x59d195-0x0;var _0x10250e=_0xda19[_0x59d195];return _0x10250e;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file +var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x51f6a2,_0xd320b){var _0x5ed478=function(_0x6cd399){while(--_0x6cd399){_0x51f6a2['push'](_0x51f6a2['shift']());}};_0x5ed478(++_0xd320b);}(_0x1623,0xab));var _0x3162=function(_0x2d95e4,_0x4d97b6){_0x2d95e4=_0x2d95e4-0x0;var _0x241c7b=_0x1623[_0x2d95e4];return _0x241c7b;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5f7c355..25fad82 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(_0x39e080,_0x14a412){var _0x495b74=function(_0x5a3f85){while(--_0x5a3f85){_0x39e080['push'](_0x39e080['shift']());}};_0x495b74(++_0x14a412);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 _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(_0x3450fa,_0x22ef9c){var _0x362f2b=function(_0x57a917){while(--_0x57a917){_0x3450fa['push'](_0x3450fa['shift']());}};_0x362f2b(++_0x22ef9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 96e4a2d..81a5ce3 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 _0xcc58=['ENUM','integrationTab','newTab','sequelize','STRING','username'];(function(_0x43b0f8,_0xba95db){var _0x47bb77=function(_0x4e987b){while(--_0x4e987b){_0x43b0f8['push'](_0x43b0f8['shift']());}};_0x47bb77(++_0xba95db);}(_0xcc58,0xab));var _0x8cc5=function(_0x24147e,_0x39df2c){_0x24147e=_0x24147e-0x0;var _0x20762d=_0xcc58[_0x24147e];return _0x20762d;};'use strict';var Sequelize=require(_0x8cc5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8cc5('0x1')]},'username':{'type':Sequelize[_0x8cc5('0x1')],'unique':_0x8cc5('0x2')},'remoteUri':{'type':Sequelize[_0x8cc5('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8cc5('0x1')]},'securityToken':{'type':Sequelize[_0x8cc5('0x1')]},'serverUrl':{'type':Sequelize[_0x8cc5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8cc5('0x3')](_0x8cc5('0x4'),_0x8cc5('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xef7e=['integrationTab','newTab','sequelize','STRING','username','ENUM'];(function(_0x35383e,_0x501f9a){var _0x17b8cd=function(_0x2e6591){while(--_0x2e6591){_0x35383e['push'](_0x35383e['shift']());}};_0x17b8cd(++_0x501f9a);}(_0xef7e,0x194));var _0xeef7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xef7e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xeef7('0x0'));module['exports']={'name':{'type':Sequelize[_0xeef7('0x1')]},'description':{'type':Sequelize[_0xeef7('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xeef7('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xeef7('0x1')]},'clientId':{'type':Sequelize[_0xeef7('0x1')]},'clientSecret':{'type':Sequelize[_0xeef7('0x1')]},'securityToken':{'type':Sequelize[_0xeef7('0x1')]},'serverUrl':{'type':Sequelize[_0xeef7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xeef7('0x3')](_0xeef7('0x4'),_0xeef7('0x5')),'defaultValue':_0xeef7('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 31edfbd..a411958 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 _0x98ff=['statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceAccount','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','create','body','find','params','getConfigurations','SalesforceConfiguration','rawAttributes','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','findOne','remoteUri','clientSecret','username','password','securityToken','slice','substring','Connection','clientId','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','true','False','false','test','stringify','Wrong\x20credentials'];(function(_0x3ed430,_0x5fafab){var _0xae4a10=function(_0x53105d){while(--_0x53105d){_0x3ed430['push'](_0x3ed430['shift']());}};_0xae4a10(++_0x5fafab);}(_0x98ff,0x187));var _0xf98f=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x98ff[_0x1c546c];return _0x2cc384;};'use strict';var emlformat=require(_0xf98f('0x0'));var rimraf=require(_0xf98f('0x1'));var zipdir=require(_0xf98f('0x2'));var jsonpatch=require(_0xf98f('0x3'));var rp=require(_0xf98f('0x4'));var moment=require(_0xf98f('0x5'));var BPromise=require(_0xf98f('0x6'));var Mustache=require(_0xf98f('0x7'));var util=require(_0xf98f('0x8'));var path=require(_0xf98f('0x9'));var sox=require(_0xf98f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf98f('0xb'));var _=require(_0xf98f('0xc'));var squel=require(_0xf98f('0xd'));var crypto=require(_0xf98f('0xe'));var jsforce=require(_0xf98f('0xf'));var deskjs=require(_0xf98f('0x10'));var toCsv=require(_0xf98f('0x11'));var querystring=require('querystring');var Papa=require(_0xf98f('0x12'));var Redis=require(_0xf98f('0x13'));var authService=require(_0xf98f('0x14'));var qs=require(_0xf98f('0x15'));var as=require(_0xf98f('0x16'));var hardwareService=require(_0xf98f('0x17'));var logger=require(_0xf98f('0x18'))('api');var utils=require(_0xf98f('0x19'));var config=require(_0xf98f('0x1a'));var licenseUtil=require(_0xf98f('0x1b'));var db=require(_0xf98f('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e63f3,_0x2fb7d8){_0x2fb7d8=_0x2fb7d8||0xcc;return function(_0x52aa3b){if(_0x52aa3b){return _0x4e63f3[_0xf98f('0x1d')](_0x2fb7d8);}return _0x4e63f3[_0xf98f('0x1e')](_0x2fb7d8)[_0xf98f('0x1f')]();};}function respondWithResult(_0xed15,_0x43b63c){_0x43b63c=_0x43b63c||0xc8;return function(_0x33bc2f){if(_0x33bc2f){return _0xed15[_0xf98f('0x1e')](_0x43b63c)[_0xf98f('0x20')](_0x33bc2f);}};}function respondWithFilteredResult(_0x592b19,_0x606cfb){return function(_0x63033f){if(_0x63033f){var _0x530820=typeof _0x606cfb[_0xf98f('0x21')]===_0xf98f('0x22')&&typeof _0x606cfb[_0xf98f('0x23')]===_0xf98f('0x22');var _0x1e902c=_0x63033f[_0xf98f('0x24')];var _0x2f5938=_0x530820?0x0:_0x606cfb['offset'];var _0x5352e5=_0x530820?_0x63033f[_0xf98f('0x24')]:_0x606cfb[_0xf98f('0x21')]+_0x606cfb[_0xf98f('0x23')];var _0x5623f2;if(_0x5352e5>=_0x1e902c){_0x5352e5=_0x1e902c;_0x5623f2=0xc8;}else{_0x5623f2=0xce;}_0x592b19[_0xf98f('0x1e')](_0x5623f2);return _0x592b19[_0xf98f('0x25')](_0xf98f('0x26'),_0x2f5938+'-'+_0x5352e5+'/'+_0x1e902c)[_0xf98f('0x20')](_0x63033f);}return null;};}function patchUpdates(_0x1859d8){return function(_0x41236b){try{jsonpatch['apply'](_0x41236b,_0x1859d8,!![]);}catch(_0x1c04d0){return BPromise[_0xf98f('0x27')](_0x1c04d0);}return _0x41236b[_0xf98f('0x28')]();};}function saveUpdates(_0x275b89,_0x53ca65){return function(_0x4bdb90){if(_0x4bdb90){return _0x4bdb90[_0xf98f('0x29')](_0x275b89)['then'](function(_0x35a21d){return _0x35a21d;});}return null;};}function removeEntity(_0x2f1acf,_0x529510){return function(_0x1db23c){if(_0x1db23c){return _0x1db23c[_0xf98f('0x2a')]()[_0xf98f('0x2b')](function(){_0x2f1acf[_0xf98f('0x1e')](0xcc)[_0xf98f('0x1f')]();});}};}function handleEntityNotFound(_0x1abd75,_0x50c228){return function(_0x5d3b71){if(!_0x5d3b71){_0x1abd75['sendStatus'](0x194);}return _0x5d3b71;};}function handleError(_0x29d2de,_0x4ed017){_0x4ed017=_0x4ed017||0x1f4;return function(_0x9c6a66){logger[_0xf98f('0x2c')](_0x9c6a66[_0xf98f('0x2d')]);if(_0x9c6a66['name']){delete _0x9c6a66[_0xf98f('0x2e')];}_0x29d2de[_0xf98f('0x1e')](_0x4ed017)[_0xf98f('0x2f')](_0x9c6a66);};}exports[_0xf98f('0x30')]=function(_0x42e524,_0xade975){var _0x55b753={},_0x4ec540={},_0x21885d={'count':0x0,'rows':[]};var _0x16b888=_[_0xf98f('0x31')](db[_0xf98f('0x32')]['rawAttributes'],function(_0x254c14){return{'name':_0x254c14['fieldName'],'type':_0x254c14[_0xf98f('0x33')][_0xf98f('0x34')]};});_0x4ec540[_0xf98f('0x35')]=_[_0xf98f('0x31')](_0x16b888,_0xf98f('0x2e'));_0x4ec540['query']=_[_0xf98f('0x36')](_0x42e524['query']);_0x4ec540[_0xf98f('0x37')]=_[_0xf98f('0x38')](_0x4ec540[_0xf98f('0x35')],_0x4ec540[_0xf98f('0x39')]);_0x55b753['attributes']=_[_0xf98f('0x38')](_0x4ec540[_0xf98f('0x35')],qs['fields'](_0x42e524[_0xf98f('0x39')][_0xf98f('0x3a')]));_0x55b753[_0xf98f('0x3b')]=_0x55b753[_0xf98f('0x3b')][_0xf98f('0x3c')]?_0x55b753[_0xf98f('0x3b')]:_0x4ec540[_0xf98f('0x35')];if(!_0x42e524[_0xf98f('0x39')][_0xf98f('0x3d')](_0xf98f('0x3e'))){_0x55b753['limit']=qs[_0xf98f('0x23')](_0x42e524['query'][_0xf98f('0x23')]);_0x55b753['offset']=qs[_0xf98f('0x21')](_0x42e524[_0xf98f('0x39')]['offset']);}_0x55b753['order']=qs['sort'](_0x42e524[_0xf98f('0x39')][_0xf98f('0x3f')]);_0x55b753['where']=qs[_0xf98f('0x37')](_[_0xf98f('0x40')](_0x42e524[_0xf98f('0x39')],_0x4ec540[_0xf98f('0x37')]),_0x16b888);if(_0x42e524[_0xf98f('0x39')]['filter']){_0x55b753[_0xf98f('0x41')]=_[_0xf98f('0x42')](_0x55b753[_0xf98f('0x41')],{'$or':_['map'](_0x16b888,function(_0x2ec381){if(_0x2ec381[_0xf98f('0x33')]!==_0xf98f('0x43')){var _0x4240e6={};_0x4240e6[_0x2ec381[_0xf98f('0x2e')]]={'$like':'%'+_0x42e524[_0xf98f('0x39')][_0xf98f('0x44')]+'%'};return _0x4240e6;}})});}_0x55b753=_[_0xf98f('0x42')]({},_0x55b753,_0x42e524[_0xf98f('0x45')]);var _0x24bcc2={'where':_0x55b753[_0xf98f('0x41')]};return db[_0xf98f('0x32')]['count'](_0x24bcc2)[_0xf98f('0x2b')](function(_0x999bad){_0x21885d[_0xf98f('0x24')]=_0x999bad;if(_0x42e524['query'][_0xf98f('0x46')]){_0x55b753[_0xf98f('0x47')]=[{'all':!![]}];}return db[_0xf98f('0x32')]['findAll'](_0x55b753);})[_0xf98f('0x2b')](function(_0x1f3827){_0x21885d[_0xf98f('0x48')]=_0x1f3827;return _0x21885d;})['then'](respondWithFilteredResult(_0xade975,_0x55b753))[_0xf98f('0x49')](handleError(_0xade975,null));};exports[_0xf98f('0x4a')]=function(_0x35a352,_0x425ff3){var _0x5070aa={'raw':![],'where':{'id':_0x35a352['params']['id']}},_0x2acd42={};_0x2acd42[_0xf98f('0x35')]=_[_0xf98f('0x36')](db[_0xf98f('0x32')]['rawAttributes']);_0x2acd42['query']=_[_0xf98f('0x36')](_0x35a352[_0xf98f('0x39')]);_0x2acd42[_0xf98f('0x37')]=_[_0xf98f('0x38')](_0x2acd42[_0xf98f('0x35')],_0x2acd42[_0xf98f('0x39')]);_0x5070aa['attributes']=_['intersection'](_0x2acd42[_0xf98f('0x35')],qs['fields'](_0x35a352[_0xf98f('0x39')]['fields']));_0x5070aa['attributes']=_0x5070aa['attributes']['length']?_0x5070aa['attributes']:_0x2acd42[_0xf98f('0x35')];if(_0x35a352[_0xf98f('0x39')][_0xf98f('0x46')]){_0x5070aa[_0xf98f('0x47')]=[{'all':!![]}];}_0x5070aa=_[_0xf98f('0x42')]({},_0x5070aa,_0x35a352[_0xf98f('0x45')]);return db[_0xf98f('0x32')]['find'](_0x5070aa)[_0xf98f('0x2b')](handleEntityNotFound(_0x425ff3,null))[_0xf98f('0x2b')](respondWithResult(_0x425ff3,null))[_0xf98f('0x49')](handleError(_0x425ff3,null));};exports[_0xf98f('0x4b')]=function(_0x4b43e8,_0x390fb2){return db['SalesforceAccount']['create'](_0x4b43e8[_0xf98f('0x4c')],{})[_0xf98f('0x2b')](respondWithResult(_0x390fb2,0xc9))[_0xf98f('0x49')](handleError(_0x390fb2,null));};exports[_0xf98f('0x29')]=function(_0x7ae7d7,_0x3311ad){if(_0x7ae7d7[_0xf98f('0x4c')]['id']){delete _0x7ae7d7[_0xf98f('0x4c')]['id'];}return db['SalesforceAccount'][_0xf98f('0x4d')]({'where':{'id':_0x7ae7d7[_0xf98f('0x4e')]['id']}})[_0xf98f('0x2b')](handleEntityNotFound(_0x3311ad,null))[_0xf98f('0x2b')](saveUpdates(_0x7ae7d7['body'],null))['then'](respondWithResult(_0x3311ad,null))['catch'](handleError(_0x3311ad,null));};exports['destroy']=function(_0x3294d9,_0x3191fe){return db[_0xf98f('0x32')][_0xf98f('0x4d')]({'where':{'id':_0x3294d9[_0xf98f('0x4e')]['id']}})[_0xf98f('0x2b')](handleEntityNotFound(_0x3191fe,null))[_0xf98f('0x2b')](removeEntity(_0x3191fe,null))[_0xf98f('0x49')](handleError(_0x3191fe,null));};exports[_0xf98f('0x4f')]=function(_0x915128,_0x52ca10,_0x5d899b){var _0xfae169={};var _0x7d10d2={};var _0x3834ef;var _0x214b26;return db[_0xf98f('0x32')]['findOne']({'where':{'id':_0x915128['params']['id']}})[_0xf98f('0x2b')](handleEntityNotFound(_0x52ca10,null))['then'](function(_0x3f0013){if(_0x3f0013){_0x3834ef=_0x3f0013;_0x7d10d2[_0xf98f('0x35')]=_[_0xf98f('0x36')](db[_0xf98f('0x50')][_0xf98f('0x51')]);_0x7d10d2[_0xf98f('0x39')]=_['keys'](_0x915128[_0xf98f('0x39')]);_0x7d10d2[_0xf98f('0x37')]=_[_0xf98f('0x38')](_0x7d10d2[_0xf98f('0x35')],_0x7d10d2[_0xf98f('0x39')]);_0xfae169[_0xf98f('0x3b')]=_[_0xf98f('0x38')](_0x7d10d2[_0xf98f('0x35')],qs[_0xf98f('0x3a')](_0x915128[_0xf98f('0x39')][_0xf98f('0x3a')]));_0xfae169[_0xf98f('0x3b')]=_0xfae169['attributes'][_0xf98f('0x3c')]?_0xfae169[_0xf98f('0x3b')]:_0x7d10d2[_0xf98f('0x35')];_0xfae169['order']=qs['sort'](_0x915128[_0xf98f('0x39')]['sort']);_0xfae169[_0xf98f('0x41')]=qs['filters'](_['pick'](_0x915128[_0xf98f('0x39')],_0x7d10d2[_0xf98f('0x37')]));if(_0x915128[_0xf98f('0x39')][_0xf98f('0x44')]){_0xfae169[_0xf98f('0x41')]=_['merge'](_0xfae169['where'],{'$or':_[_0xf98f('0x31')](_0xfae169[_0xf98f('0x3b')],function(_0x433644){var _0x25bbad={};_0x25bbad[_0x433644]={'$like':'%'+_0x915128[_0xf98f('0x39')][_0xf98f('0x44')]+'%'};return _0x25bbad;})});}_0xfae169=_['merge']({},_0xfae169,_0x915128[_0xf98f('0x45')]);return _0x3834ef[_0xf98f('0x4f')](_0xfae169);}})[_0xf98f('0x2b')](function(_0x13e344){if(_0x13e344){_0x214b26=_0x13e344[_0xf98f('0x3c')];if(!_0x915128[_0xf98f('0x39')][_0xf98f('0x3d')](_0xf98f('0x3e'))){_0xfae169[_0xf98f('0x23')]=qs[_0xf98f('0x23')](_0x915128[_0xf98f('0x39')]['limit']);_0xfae169[_0xf98f('0x21')]=qs[_0xf98f('0x21')](_0x915128[_0xf98f('0x39')]['offset']);}return _0x3834ef[_0xf98f('0x4f')](_0xfae169);}})['then'](function(_0x58ce28){if(_0x58ce28){return _0x58ce28?{'count':_0x214b26,'rows':_0x58ce28}:null;}})[_0xf98f('0x2b')](respondWithResult(_0x52ca10,null))[_0xf98f('0x49')](handleError(_0x52ca10,null));};exports[_0xf98f('0x52')]=function(_0x39c484,_0x4e64f2,_0x5ac90d){if(_0x39c484[_0xf98f('0x4c')]['id']){delete _0x39c484[_0xf98f('0x4c')]['id'];}return db[_0xf98f('0x32')]['findOne']({'where':{'id':_0x39c484[_0xf98f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4e64f2,null))[_0xf98f('0x2b')](function(_0x58a7cf){if(_0x58a7cf){_0x39c484[_0xf98f('0x4c')]['AccountId']=_0x58a7cf['id'];_0x39c484[_0xf98f('0x4c')][_0xf98f('0x53')]=integrations[_0xf98f('0x54')](_0x39c484[_0xf98f('0x4c')][_0xf98f('0x55')],_0x39c484[_0xf98f('0x4c')][_0xf98f('0x33')]);_0x39c484['body']['Descriptions']=integrations[_0xf98f('0x56')](_0x39c484['body'][_0xf98f('0x55')],_0x39c484['body'][_0xf98f('0x33')]);return db[_0xf98f('0x50')][_0xf98f('0x4b')](_0x39c484[_0xf98f('0x4c')],{'include':[{'model':db[_0xf98f('0x57')],'as':'Subjects'},{'model':db[_0xf98f('0x57')],'as':_0xf98f('0x58')}]});}return null;})[_0xf98f('0x2b')](respondWithResult(_0x4e64f2,null))['catch'](handleError(_0x4e64f2,null));};exports[_0xf98f('0x59')]=function(_0x80931a,_0x385be8,_0x22a17e){var _0x423169;var _0x837401='';var _0x37c16d=_0xf98f('0x5a');return db[_0xf98f('0x32')][_0xf98f('0x5b')]({'where':{'id':_0x80931a[_0xf98f('0x4e')]['id']},'attributes':['id',_0xf98f('0x5c'),'clientId',_0xf98f('0x5d'),_0xf98f('0x5e'),_0xf98f('0x5f'),_0xf98f('0x60')]})[_0xf98f('0x2b')](handleEntityNotFound(_0x385be8,null))[_0xf98f('0x2b')](function(_0x1c1587){if(_0x1c1587){_0x837401=_0x1c1587[_0xf98f('0x5c')];var _0x5ee371=_0x837401[_0xf98f('0x61')](-0x1);if(_0x5ee371==='/'){_0x837401=_0x837401[_0xf98f('0x62')](0x0,_0x837401['lastIndexOf'](_0x5ee371));}_0x423169=new jsforce[(_0xf98f('0x63'))]({'oauth2':{'loginUrl':_0x837401,'clientId':_0x1c1587[_0xf98f('0x64')],'clientSecret':_0x1c1587[_0xf98f('0x5d')]}});return _0x423169['login'](_0x1c1587[_0xf98f('0x5e')],_0x1c1587[_0xf98f('0x5f')][_0xf98f('0x65')](_0x1c1587['securityToken']));}})[_0xf98f('0x2b')](function(_0x212909){if(_0x212909){if(!_[_0xf98f('0x66')](_0x80931a['query']['ticketType'])){_0x37c16d=_0x80931a['query'][_0xf98f('0x67')];}return _0x423169[_0xf98f('0x68')](_0x37c16d)[_0xf98f('0x69')]();}})[_0xf98f('0x2b')](function(_0xbf85a5){var _0x558a8c=['OwnerId',_0xf98f('0x6a'),_0xf98f('0x6b'),'IsRecurrence',_0xf98f('0x6c'),_0xf98f('0x6d')];var _0x7dc5fd=['string',_0xf98f('0x6e'),_0xf98f('0x6f'),_0xf98f('0x70'),_0xf98f('0x71'),_0xf98f('0x72'),_0xf98f('0x73')];if(_0xbf85a5){_[_0xf98f('0x74')](_0xbf85a5[_0xf98f('0x3a')],function(_0x31b60b){return _0x558a8c[_0xf98f('0x75')](_0x31b60b[_0xf98f('0x2e')])||!_0x7dc5fd[_0xf98f('0x75')](_0x31b60b['type']);});return{'count':_0xbf85a5[_0xf98f('0x3a')]['length'],'rows':_[_0xf98f('0x31')](_0xbf85a5[_0xf98f('0x3a')],function(_0x237d9b){return{'id':_0x237d9b['name'],'name':_0x237d9b['label'],'custom':_0x237d9b[_0xf98f('0x76')],'options':_0x237d9b[_0xf98f('0x77')]['length']>0x0?_['map'](_0x237d9b['picklistValues'],function(_0xaf7ea8){return{'name':_0xaf7ea8[_0xf98f('0x78')],'value':_0xaf7ea8[_0xf98f('0x79')]};}):_0x237d9b[_0xf98f('0x33')]==_0xf98f('0x70')?[{'name':_0xf98f('0x7a'),'value':_0xf98f('0x7b')},{'name':_0xf98f('0x7c'),'value':_0xf98f('0x7d')}]:[]};})};}})['then'](respondWithResult(_0x385be8,null))['catch'](function(_0x2165e7){var _0x2d6513=_0x80931a[_0xf98f('0x39')][_0xf98f('0x7e')]?0x1f4:_0x2165e7['statusCode']||0x1f4;logger[_0xf98f('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0xf98f('0x59'),_0x2d6513,JSON[_0xf98f('0x7f')](_0x2165e7));delete _0x2165e7[_0xf98f('0x2e')];if(_0x2d6513===0x191){_0x2d6513=0x190;}_0x385be8[_0xf98f('0x1e')](_0x2d6513)[_0xf98f('0x2f')](_0x80931a[_0xf98f('0x39')][_0xf98f('0x7e')]?{'message':_0xf98f('0x80'),'statusCode':_0x2165e7[_0xf98f('0x81')]}:_0x2165e7);});}; \ No newline at end of file +var _0x9d84=['remoteUri','slice','substring','lastIndexOf','Connection','concat','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','int','picklist','boolean','email','includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','then','destroy','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','clientId','clientSecret','username','password','securityToken'];(function(_0x22e9c2,_0x6c7f7f){var _0x1dec3b=function(_0x1c9ceb){while(--_0x1c9ceb){_0x22e9c2['push'](_0x22e9c2['shift']());}};_0x1dec3b(++_0x6c7f7f);}(_0x9d84,0x17b));var _0x49d8=function(_0x358bde,_0xe54c17){_0x358bde=_0x358bde-0x0;var _0x346f1b=_0x9d84[_0x358bde];return _0x346f1b;};'use strict';var emlformat=require(_0x49d8('0x0'));var rimraf=require(_0x49d8('0x1'));var zipdir=require(_0x49d8('0x2'));var jsonpatch=require(_0x49d8('0x3'));var rp=require(_0x49d8('0x4'));var moment=require('moment');var BPromise=require(_0x49d8('0x5'));var Mustache=require(_0x49d8('0x6'));var util=require('util');var path=require(_0x49d8('0x7'));var sox=require('sox');var csv=require(_0x49d8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49d8('0x9'));var _=require(_0x49d8('0xa'));var squel=require('squel');var crypto=require(_0x49d8('0xb'));var jsforce=require(_0x49d8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x49d8('0x8'));var querystring=require(_0x49d8('0xd'));var Papa=require(_0x49d8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49d8('0xf'));var as=require(_0x49d8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49d8('0x11'))(_0x49d8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49d8('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x49d8('0x14'));function respondWithStatusCode(_0x560549,_0x1095ed){_0x1095ed=_0x1095ed||0xcc;return function(_0x2616a6){if(_0x2616a6){return _0x560549[_0x49d8('0x15')](_0x1095ed);}return _0x560549[_0x49d8('0x16')](_0x1095ed)[_0x49d8('0x17')]();};}function respondWithResult(_0x1be677,_0x4878e4){_0x4878e4=_0x4878e4||0xc8;return function(_0x8a14f4){if(_0x8a14f4){return _0x1be677[_0x49d8('0x16')](_0x4878e4)['json'](_0x8a14f4);}};}function respondWithFilteredResult(_0x491b5a,_0x461dd8){return function(_0x187a78){if(_0x187a78){var _0x5d4157=typeof _0x461dd8[_0x49d8('0x18')]==='undefined'&&typeof _0x461dd8[_0x49d8('0x19')]===_0x49d8('0x1a');var _0x1558cb=_0x187a78['count'];var _0x2563e4=_0x5d4157?0x0:_0x461dd8['offset'];var _0x5add74=_0x5d4157?_0x187a78[_0x49d8('0x1b')]:_0x461dd8[_0x49d8('0x18')]+_0x461dd8[_0x49d8('0x19')];var _0x521b20;if(_0x5add74>=_0x1558cb){_0x5add74=_0x1558cb;_0x521b20=0xc8;}else{_0x521b20=0xce;}_0x491b5a[_0x49d8('0x16')](_0x521b20);return _0x491b5a[_0x49d8('0x1c')]('Content-Range',_0x2563e4+'-'+_0x5add74+'/'+_0x1558cb)[_0x49d8('0x1d')](_0x187a78);}return null;};}function patchUpdates(_0x454ab1){return function(_0xf03486){try{jsonpatch[_0x49d8('0x1e')](_0xf03486,_0x454ab1,!![]);}catch(_0x4f1b85){return BPromise[_0x49d8('0x1f')](_0x4f1b85);}return _0xf03486['save']();};}function saveUpdates(_0x4c1b9c,_0x34c3bd){return function(_0x448577){if(_0x448577){return _0x448577['update'](_0x4c1b9c)[_0x49d8('0x20')](function(_0x3c31bd){return _0x3c31bd;});}return null;};}function removeEntity(_0x193c55,_0xc875d3){return function(_0x21f553){if(_0x21f553){return _0x21f553[_0x49d8('0x21')]()['then'](function(){_0x193c55[_0x49d8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4490ef,_0x23ad19){return function(_0x284464){if(!_0x284464){_0x4490ef[_0x49d8('0x15')](0x194);}return _0x284464;};}function handleError(_0x4b4208,_0x1f557a){_0x1f557a=_0x1f557a||0x1f4;return function(_0xb2a6b1){logger[_0x49d8('0x22')](_0xb2a6b1[_0x49d8('0x23')]);if(_0xb2a6b1['name']){delete _0xb2a6b1[_0x49d8('0x24')];}_0x4b4208['status'](_0x1f557a)['send'](_0xb2a6b1);};}exports[_0x49d8('0x25')]=function(_0x1cac0b,_0x13069d){var _0x465337={},_0x1b54a7={},_0x28949f={'count':0x0,'rows':[]};var _0x3235f9=_[_0x49d8('0x26')](db[_0x49d8('0x27')][_0x49d8('0x28')],function(_0x23be9c){return{'name':_0x23be9c[_0x49d8('0x29')],'type':_0x23be9c[_0x49d8('0x2a')]['key']};});_0x1b54a7['model']=_['map'](_0x3235f9,'name');_0x1b54a7['query']=_['keys'](_0x1cac0b['query']);_0x1b54a7['filters']=_['intersection'](_0x1b54a7[_0x49d8('0x2b')],_0x1b54a7[_0x49d8('0x2c')]);_0x465337[_0x49d8('0x2d')]=_[_0x49d8('0x2e')](_0x1b54a7[_0x49d8('0x2b')],qs[_0x49d8('0x2f')](_0x1cac0b[_0x49d8('0x2c')][_0x49d8('0x2f')]));_0x465337[_0x49d8('0x2d')]=_0x465337['attributes'][_0x49d8('0x30')]?_0x465337[_0x49d8('0x2d')]:_0x1b54a7[_0x49d8('0x2b')];if(!_0x1cac0b[_0x49d8('0x2c')][_0x49d8('0x31')](_0x49d8('0x32'))){_0x465337[_0x49d8('0x19')]=qs[_0x49d8('0x19')](_0x1cac0b[_0x49d8('0x2c')][_0x49d8('0x19')]);_0x465337[_0x49d8('0x18')]=qs[_0x49d8('0x18')](_0x1cac0b['query'][_0x49d8('0x18')]);}_0x465337[_0x49d8('0x33')]=qs[_0x49d8('0x34')](_0x1cac0b[_0x49d8('0x2c')]['sort']);_0x465337[_0x49d8('0x35')]=qs[_0x49d8('0x36')](_[_0x49d8('0x37')](_0x1cac0b[_0x49d8('0x2c')],_0x1b54a7[_0x49d8('0x36')]),_0x3235f9);if(_0x1cac0b[_0x49d8('0x2c')][_0x49d8('0x38')]){_0x465337[_0x49d8('0x35')]=_[_0x49d8('0x39')](_0x465337[_0x49d8('0x35')],{'$or':_['map'](_0x3235f9,function(_0x20b7f8){if(_0x20b7f8['type']!==_0x49d8('0x3a')){var _0x41108b={};_0x41108b[_0x20b7f8[_0x49d8('0x24')]]={'$like':'%'+_0x1cac0b[_0x49d8('0x2c')]['filter']+'%'};return _0x41108b;}})});}_0x465337=_[_0x49d8('0x39')]({},_0x465337,_0x1cac0b[_0x49d8('0x3b')]);var _0x3d8999={'where':_0x465337[_0x49d8('0x35')]};return db['SalesforceAccount'][_0x49d8('0x1b')](_0x3d8999)[_0x49d8('0x20')](function(_0x462474){_0x28949f[_0x49d8('0x1b')]=_0x462474;if(_0x1cac0b[_0x49d8('0x2c')][_0x49d8('0x3c')]){_0x465337[_0x49d8('0x3d')]=[{'all':!![]}];}return db[_0x49d8('0x27')][_0x49d8('0x3e')](_0x465337);})[_0x49d8('0x20')](function(_0x28b5a3){_0x28949f['rows']=_0x28b5a3;return _0x28949f;})[_0x49d8('0x20')](respondWithFilteredResult(_0x13069d,_0x465337))[_0x49d8('0x3f')](handleError(_0x13069d,null));};exports['show']=function(_0xe43d9c,_0x17cc96){var _0x16beb8={'raw':![],'where':{'id':_0xe43d9c[_0x49d8('0x40')]['id']}},_0x370669={};_0x370669['model']=_[_0x49d8('0x41')](db[_0x49d8('0x27')][_0x49d8('0x28')]);_0x370669[_0x49d8('0x2c')]=_[_0x49d8('0x41')](_0xe43d9c['query']);_0x370669[_0x49d8('0x36')]=_[_0x49d8('0x2e')](_0x370669['model'],_0x370669['query']);_0x16beb8[_0x49d8('0x2d')]=_[_0x49d8('0x2e')](_0x370669[_0x49d8('0x2b')],qs['fields'](_0xe43d9c[_0x49d8('0x2c')]['fields']));_0x16beb8['attributes']=_0x16beb8[_0x49d8('0x2d')][_0x49d8('0x30')]?_0x16beb8[_0x49d8('0x2d')]:_0x370669[_0x49d8('0x2b')];if(_0xe43d9c[_0x49d8('0x2c')][_0x49d8('0x3c')]){_0x16beb8['include']=[{'all':!![]}];}_0x16beb8=_[_0x49d8('0x39')]({},_0x16beb8,_0xe43d9c[_0x49d8('0x3b')]);return db[_0x49d8('0x27')][_0x49d8('0x42')](_0x16beb8)[_0x49d8('0x20')](handleEntityNotFound(_0x17cc96,null))[_0x49d8('0x20')](respondWithResult(_0x17cc96,null))[_0x49d8('0x3f')](handleError(_0x17cc96,null));};exports[_0x49d8('0x43')]=function(_0x3736dc,_0x1d108f){return db[_0x49d8('0x27')][_0x49d8('0x43')](_0x3736dc[_0x49d8('0x44')],{})['then'](respondWithResult(_0x1d108f,0xc9))[_0x49d8('0x3f')](handleError(_0x1d108f,null));};exports['update']=function(_0x5c3237,_0x59b683){if(_0x5c3237[_0x49d8('0x44')]['id']){delete _0x5c3237[_0x49d8('0x44')]['id'];}return db[_0x49d8('0x27')][_0x49d8('0x42')]({'where':{'id':_0x5c3237['params']['id']}})[_0x49d8('0x20')](handleEntityNotFound(_0x59b683,null))['then'](saveUpdates(_0x5c3237[_0x49d8('0x44')],null))['then'](respondWithResult(_0x59b683,null))[_0x49d8('0x3f')](handleError(_0x59b683,null));};exports[_0x49d8('0x21')]=function(_0x46fed3,_0x10b317){return db[_0x49d8('0x27')][_0x49d8('0x42')]({'where':{'id':_0x46fed3[_0x49d8('0x40')]['id']}})[_0x49d8('0x20')](handleEntityNotFound(_0x10b317,null))[_0x49d8('0x20')](removeEntity(_0x10b317,null))[_0x49d8('0x3f')](handleError(_0x10b317,null));};exports[_0x49d8('0x45')]=function(_0x4bbb70,_0x62d901,_0x5a04f0){var _0x2cce32={};var _0x10d54d={};var _0x424db8;var _0x4b8666;return db[_0x49d8('0x27')][_0x49d8('0x46')]({'where':{'id':_0x4bbb70['params']['id']}})[_0x49d8('0x20')](handleEntityNotFound(_0x62d901,null))[_0x49d8('0x20')](function(_0x364125){if(_0x364125){_0x424db8=_0x364125;_0x10d54d['model']=_[_0x49d8('0x41')](db[_0x49d8('0x47')]['rawAttributes']);_0x10d54d[_0x49d8('0x2c')]=_[_0x49d8('0x41')](_0x4bbb70[_0x49d8('0x2c')]);_0x10d54d['filters']=_[_0x49d8('0x2e')](_0x10d54d[_0x49d8('0x2b')],_0x10d54d['query']);_0x2cce32[_0x49d8('0x2d')]=_[_0x49d8('0x2e')](_0x10d54d[_0x49d8('0x2b')],qs[_0x49d8('0x2f')](_0x4bbb70['query'][_0x49d8('0x2f')]));_0x2cce32['attributes']=_0x2cce32[_0x49d8('0x2d')][_0x49d8('0x30')]?_0x2cce32['attributes']:_0x10d54d[_0x49d8('0x2b')];_0x2cce32[_0x49d8('0x33')]=qs[_0x49d8('0x34')](_0x4bbb70[_0x49d8('0x2c')][_0x49d8('0x34')]);_0x2cce32[_0x49d8('0x35')]=qs[_0x49d8('0x36')](_[_0x49d8('0x37')](_0x4bbb70[_0x49d8('0x2c')],_0x10d54d['filters']));if(_0x4bbb70['query'][_0x49d8('0x38')]){_0x2cce32[_0x49d8('0x35')]=_['merge'](_0x2cce32[_0x49d8('0x35')],{'$or':_['map'](_0x2cce32['attributes'],function(_0x1454dd){var _0x1bce0c={};_0x1bce0c[_0x1454dd]={'$like':'%'+_0x4bbb70[_0x49d8('0x2c')][_0x49d8('0x38')]+'%'};return _0x1bce0c;})});}_0x2cce32=_[_0x49d8('0x39')]({},_0x2cce32,_0x4bbb70['options']);return _0x424db8[_0x49d8('0x45')](_0x2cce32);}})[_0x49d8('0x20')](function(_0x32a484){if(_0x32a484){_0x4b8666=_0x32a484[_0x49d8('0x30')];if(!_0x4bbb70[_0x49d8('0x2c')][_0x49d8('0x31')](_0x49d8('0x32'))){_0x2cce32[_0x49d8('0x19')]=qs[_0x49d8('0x19')](_0x4bbb70['query']['limit']);_0x2cce32[_0x49d8('0x18')]=qs[_0x49d8('0x18')](_0x4bbb70[_0x49d8('0x2c')]['offset']);}return _0x424db8['getConfigurations'](_0x2cce32);}})[_0x49d8('0x20')](function(_0x26777d){if(_0x26777d){return _0x26777d?{'count':_0x4b8666,'rows':_0x26777d}:null;}})[_0x49d8('0x20')](respondWithResult(_0x62d901,null))[_0x49d8('0x3f')](handleError(_0x62d901,null));};exports[_0x49d8('0x48')]=function(_0x4fbcb8,_0x11caa5,_0x1cc8a8){if(_0x4fbcb8[_0x49d8('0x44')]['id']){delete _0x4fbcb8[_0x49d8('0x44')]['id'];}return db[_0x49d8('0x27')][_0x49d8('0x46')]({'where':{'id':_0x4fbcb8['params']['id']}})[_0x49d8('0x20')](handleEntityNotFound(_0x11caa5,null))[_0x49d8('0x20')](function(_0x59fd83){if(_0x59fd83){_0x4fbcb8[_0x49d8('0x44')][_0x49d8('0x49')]=_0x59fd83['id'];_0x4fbcb8['body']['Subjects']=integrations[_0x49d8('0x4a')](_0x4fbcb8[_0x49d8('0x44')][_0x49d8('0x4b')],_0x4fbcb8[_0x49d8('0x44')]['type']);_0x4fbcb8[_0x49d8('0x44')][_0x49d8('0x4c')]=integrations[_0x49d8('0x4d')](_0x4fbcb8[_0x49d8('0x44')]['channel'],_0x4fbcb8[_0x49d8('0x44')][_0x49d8('0x2a')]);return db[_0x49d8('0x47')][_0x49d8('0x43')](_0x4fbcb8[_0x49d8('0x44')],{'include':[{'model':db[_0x49d8('0x4e')],'as':'Subjects'},{'model':db[_0x49d8('0x4e')],'as':_0x49d8('0x4c')}]});}return null;})[_0x49d8('0x20')](respondWithResult(_0x11caa5,null))[_0x49d8('0x3f')](handleError(_0x11caa5,null));};exports['getFields']=function(_0x4cdcf6,_0x55d478,_0x449f7c){var _0x5ccc43;var _0x313fe2='';var _0xfc04c9=_0x49d8('0x4f');return db[_0x49d8('0x27')][_0x49d8('0x46')]({'where':{'id':_0x4cdcf6['params']['id']},'attributes':['id','remoteUri',_0x49d8('0x50'),_0x49d8('0x51'),_0x49d8('0x52'),_0x49d8('0x53'),_0x49d8('0x54')]})[_0x49d8('0x20')](handleEntityNotFound(_0x55d478,null))[_0x49d8('0x20')](function(_0x3f6e04){if(_0x3f6e04){_0x313fe2=_0x3f6e04[_0x49d8('0x55')];var _0x4d63ce=_0x313fe2[_0x49d8('0x56')](-0x1);if(_0x4d63ce==='/'){_0x313fe2=_0x313fe2[_0x49d8('0x57')](0x0,_0x313fe2[_0x49d8('0x58')](_0x4d63ce));}_0x5ccc43=new jsforce[(_0x49d8('0x59'))]({'oauth2':{'loginUrl':_0x313fe2,'clientId':_0x3f6e04[_0x49d8('0x50')],'clientSecret':_0x3f6e04[_0x49d8('0x51')]}});return _0x5ccc43['login'](_0x3f6e04['username'],_0x3f6e04[_0x49d8('0x53')][_0x49d8('0x5a')](_0x3f6e04['securityToken']));}})[_0x49d8('0x20')](function(_0x4cbdf9){if(_0x4cbdf9){if(!_['isNil'](_0x4cdcf6[_0x49d8('0x2c')]['ticketType'])){_0xfc04c9=_0x4cdcf6[_0x49d8('0x2c')][_0x49d8('0x5b')];}return _0x5ccc43[_0x49d8('0x5c')](_0xfc04c9)['describe']();}})[_0x49d8('0x20')](function(_0xb9f4cb){var _0x909d62=[_0x49d8('0x5d'),_0x49d8('0x5e'),_0x49d8('0x5f'),'IsRecurrence',_0x49d8('0x60'),_0x49d8('0x61')];var _0x581327=[_0x49d8('0x62'),_0x49d8('0x63'),_0x49d8('0x64'),_0x49d8('0x65'),_0x49d8('0x66'),'textarea','phone'];if(_0xb9f4cb){_['remove'](_0xb9f4cb[_0x49d8('0x2f')],function(_0x496e56){return _0x909d62[_0x49d8('0x67')](_0x496e56[_0x49d8('0x24')])||!_0x581327[_0x49d8('0x67')](_0x496e56[_0x49d8('0x2a')]);});return{'count':_0xb9f4cb[_0x49d8('0x2f')][_0x49d8('0x30')],'rows':_[_0x49d8('0x26')](_0xb9f4cb[_0x49d8('0x2f')],function(_0x489e7b){return{'id':_0x489e7b[_0x49d8('0x24')],'name':_0x489e7b[_0x49d8('0x68')],'custom':_0x489e7b['custom'],'options':_0x489e7b[_0x49d8('0x69')][_0x49d8('0x30')]>0x0?_['map'](_0x489e7b[_0x49d8('0x69')],function(_0x33a734){return{'name':_0x33a734[_0x49d8('0x68')],'value':_0x33a734[_0x49d8('0x6a')]};}):_0x489e7b[_0x49d8('0x2a')]=='boolean'?[{'name':_0x49d8('0x6b'),'value':_0x49d8('0x6c')},{'name':_0x49d8('0x6d'),'value':_0x49d8('0x6e')}]:[]};})};}})[_0x49d8('0x20')](respondWithResult(_0x55d478,null))[_0x49d8('0x3f')](function(_0x4e7dd1){var _0x3d6601=_0x4cdcf6['query'][_0x49d8('0x6f')]?0x1f4:_0x4e7dd1[_0x49d8('0x70')]||0x1f4;logger[_0x49d8('0x22')](_0x49d8('0x71'),_0x49d8('0x72'),_0x3d6601,JSON[_0x49d8('0x73')](_0x4e7dd1));delete _0x4e7dd1[_0x49d8('0x24')];if(_0x3d6601===0x191){_0x3d6601=0x190;}_0x55d478[_0x49d8('0x16')](_0x3d6601)['send'](_0x4cdcf6[_0x49d8('0x2c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4e7dd1[_0x49d8('0x70')]}:_0x4e7dd1);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 2c110a5..1c0eb8c 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 _0x8215=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8215,0x10d));var _0x5821=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x8215[_0x1ca890];return _0x3f8e01;};'use strict';var _=require(_0x5821('0x0'));var util=require(_0x5821('0x1'));var logger=require(_0x5821('0x2'))(_0x5821('0x3'));var moment=require(_0x5821('0x4'));var BPromise=require('bluebird');var rp=require(_0x5821('0x5'));var fs=require('fs');var path=require(_0x5821('0x6'));var rimraf=require(_0x5821('0x7'));var config=require(_0x5821('0x8'));var attributes=require(_0x5821('0x9'));var integrations=require(_0x5821('0xa'));module[_0x5821('0xb')]=function(_0x48bfc5,_0x917f34){return _0x48bfc5[_0x5821('0xc')](_0x5821('0xd'),attributes,{'tableName':_0x5821('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d7d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts'];(function(_0x20183c,_0xfdbe61){var _0x1f2316=function(_0x52caf2){while(--_0x52caf2){_0x20183c['push'](_0x20183c['shift']());}};_0x1f2316(++_0xfdbe61);}(_0x5d7d,0x134));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d7('0x0'));var util=require(_0xd5d7('0x1'));var logger=require(_0xd5d7('0x2'))(_0xd5d7('0x3'));var moment=require(_0xd5d7('0x4'));var BPromise=require(_0xd5d7('0x5'));var rp=require(_0xd5d7('0x6'));var fs=require('fs');var path=require(_0xd5d7('0x7'));var rimraf=require(_0xd5d7('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5d7('0x9'));var integrations=require(_0xd5d7('0xa'));module[_0xd5d7('0xb')]=function(_0x26dc64,_0x2e13fb){return _0x26dc64[_0xd5d7('0xc')]('SalesforceAccount',attributes,{'tableName':_0xd5d7('0xd'),'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 b443876..93dc117 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 _0xc261=['map','SalesforceAccount','ShowSalesforceAccount','stringify','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','SalesforceAccount,\x20%s,\x20%s','result','GetSalesforceAccount','findAll','options','raw','where','attributes','include','model'];(function(_0xf3ff,_0x58234a){var _0x5dca70=function(_0x240754){while(--_0x240754){_0xf3ff['push'](_0xf3ff['shift']());}};_0x5dca70(++_0x58234a);}(_0xc261,0x137));var _0x1c26=function(_0x141020,_0x45410e){_0x141020=_0x141020-0x0;var _0x27997a=_0xc261[_0x141020];return _0x27997a;};'use strict';var _=require(_0x1c26('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1c26('0x1'));var rs=require(_0x1c26('0x2'));var fs=require('fs');var Redis=require(_0x1c26('0x3'));var db=require(_0x1c26('0x4'))['db'];var utils=require(_0x1c26('0x5'));var logger=require('../../config/logger')(_0x1c26('0x6'));var config=require(_0x1c26('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1c26('0x8')][_0x1c26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f4d34,_0x5f4105,_0x33b180){return new BPromise(function(_0x2c2cd6,_0xa23f14){return client[_0x1c26('0xa')](_0x1f4d34,_0x33b180)[_0x1c26('0xb')](function(_0x529336){logger[_0x1c26('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x5f4105,_0x1c26('0xd'));logger[_0x1c26('0xe')](_0x1c26('0xf'),_0x5f4105,_0x1c26('0xd'),JSON['stringify'](_0x529336));if(_0x529336[_0x1c26('0x10')]){if(_0x529336[_0x1c26('0x10')][_0x1c26('0x11')]===0x1f4){logger[_0x1c26('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x5f4105,_0x529336[_0x1c26('0x10')][_0x1c26('0x12')]);return _0xa23f14(_0x529336[_0x1c26('0x10')][_0x1c26('0x12')]);}logger[_0x1c26('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x5f4105,_0x529336[_0x1c26('0x10')][_0x1c26('0x12')]);return _0x2c2cd6(_0x529336[_0x1c26('0x10')][_0x1c26('0x12')]);}else{logger['info'](_0x1c26('0x13'),_0x5f4105,_0x1c26('0xd'));_0x2c2cd6(_0x529336[_0x1c26('0x14')]['message']);}})['catch'](function(_0x42583f){logger[_0x1c26('0x10')](_0x1c26('0x13'),_0x5f4105,_0x42583f);_0xa23f14(_0x42583f);});});}exports[_0x1c26('0x15')]=function(_0x29397a){var _0x3cdda9=this;return new Promise(function(_0x33dc11,_0x49351e){return db['SalesforceAccount'][_0x1c26('0x16')]({'raw':_0x29397a[_0x1c26('0x17')]?_0x29397a[_0x1c26('0x17')][_0x1c26('0x18')]===undefined?!![]:![]:!![],'where':_0x29397a['options']?_0x29397a['options'][_0x1c26('0x19')]||null:null,'attributes':_0x29397a[_0x1c26('0x17')]?_0x29397a[_0x1c26('0x17')][_0x1c26('0x1a')]||null:null,'limit':_0x29397a[_0x1c26('0x17')]?_0x29397a['options']['limit']||null:null,'include':_0x29397a[_0x1c26('0x17')]?_0x29397a[_0x1c26('0x17')][_0x1c26('0x1b')]?_['map'](_0x29397a[_0x1c26('0x17')][_0x1c26('0x1b')],function(_0x1fa834){return{'model':db[_0x1fa834['model']],'as':_0x1fa834['as'],'attributes':_0x1fa834[_0x1c26('0x1a')],'include':_0x1fa834[_0x1c26('0x1b')]?_['map'](_0x1fa834['include'],function(_0x12e24c){return{'model':db[_0x12e24c[_0x1c26('0x1c')]],'as':_0x12e24c['as'],'attributes':_0x12e24c[_0x1c26('0x1a')],'include':_0x12e24c[_0x1c26('0x1b')]?_[_0x1c26('0x1d')](_0x12e24c['include'],function(_0x10fb1c){return{'model':db[_0x10fb1c[_0x1c26('0x1c')]],'as':_0x10fb1c['as'],'attributes':_0x10fb1c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c26('0xb')](function(_0x270985){logger[_0x1c26('0xc')]('GetSalesforceAccount',_0x29397a);logger['debug']('GetSalesforceAccount',_0x29397a,JSON['stringify'](_0x270985));_0x33dc11(_0x270985);})['catch'](function(_0x3e71ed){logger['error'](_0x1c26('0x15'),_0x3e71ed['message'],_0x29397a);_0x49351e(_0x3cdda9[_0x1c26('0x10')](0x1f4,_0x3e71ed[_0x1c26('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x8c8ac){var _0x5a9b6b=this;return new Promise(function(_0x173dc7,_0x5e4017){return db[_0x1c26('0x1e')]['find']({'raw':_0x8c8ac[_0x1c26('0x17')]?_0x8c8ac[_0x1c26('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x8c8ac[_0x1c26('0x17')]?_0x8c8ac['options']['where']||null:null,'attributes':_0x8c8ac['options']?_0x8c8ac[_0x1c26('0x17')][_0x1c26('0x1a')]||null:null,'include':_0x8c8ac['options']?_0x8c8ac[_0x1c26('0x17')][_0x1c26('0x1b')]?_[_0x1c26('0x1d')](_0x8c8ac[_0x1c26('0x17')][_0x1c26('0x1b')],function(_0x3de109){return{'model':db[_0x3de109[_0x1c26('0x1c')]],'as':_0x3de109['as'],'attributes':_0x3de109[_0x1c26('0x1a')],'include':_0x3de109[_0x1c26('0x1b')]?_[_0x1c26('0x1d')](_0x3de109[_0x1c26('0x1b')],function(_0x7d95e2){return{'model':db[_0x7d95e2[_0x1c26('0x1c')]],'as':_0x7d95e2['as'],'attributes':_0x7d95e2[_0x1c26('0x1a')],'include':_0x7d95e2[_0x1c26('0x1b')]?_['map'](_0x7d95e2[_0x1c26('0x1b')],function(_0x14de68){return{'model':db[_0x14de68['model']],'as':_0x14de68['as'],'attributes':_0x14de68['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c26('0xb')](function(_0x1a39b1){logger[_0x1c26('0xc')]('ShowSalesforceAccount',_0x8c8ac);logger[_0x1c26('0xe')](_0x1c26('0x1f'),_0x8c8ac,JSON[_0x1c26('0x20')](_0x1a39b1));_0x173dc7(_0x1a39b1);})[_0x1c26('0x21')](function(_0x48848a){logger[_0x1c26('0x10')](_0x1c26('0x1f'),_0x48848a[_0x1c26('0x12')],_0x8c8ac);_0x5e4017(_0x5a9b6b[_0x1c26('0x10')](0x1f4,_0x48848a[_0x1c26('0x12')]));});});}; \ No newline at end of file +var _0x8165=['stringify','error','message','SalesforceAccount,\x20%s,\x20%s','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x44ce4b,_0x5ec7da){var _0x5e0872=function(_0x268e20){while(--_0x268e20){_0x44ce4b['push'](_0x44ce4b['shift']());}};_0x5e0872(++_0x5ec7da);}(_0x8165,0x96));var _0x5816=function(_0x12e698,_0x556057){_0x12e698=_0x12e698-0x0;var _0x4c750f=_0x8165[_0x12e698];return _0x4c750f;};'use strict';var _=require(_0x5816('0x0'));var util=require(_0x5816('0x1'));var moment=require(_0x5816('0x2'));var BPromise=require(_0x5816('0x3'));var rs=require(_0x5816('0x4'));var fs=require('fs');var Redis=require(_0x5816('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5816('0x6'));var logger=require(_0x5816('0x7'))(_0x5816('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d28cb,_0x47392f,_0x5a21cd){return new BPromise(function(_0x499f30,_0x5c5ae6){return client[_0x5816('0x9')](_0x2d28cb,_0x5a21cd)[_0x5816('0xa')](function(_0x45deb4){logger[_0x5816('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x47392f,_0x5816('0xc'));logger[_0x5816('0xd')](_0x5816('0xe'),_0x47392f,_0x5816('0xc'),JSON[_0x5816('0xf')](_0x45deb4));if(_0x45deb4['error']){if(_0x45deb4[_0x5816('0x10')]['code']===0x1f4){logger[_0x5816('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x47392f,_0x45deb4['error'][_0x5816('0x11')]);return _0x5c5ae6(_0x45deb4[_0x5816('0x10')]['message']);}logger[_0x5816('0x10')](_0x5816('0x12'),_0x47392f,_0x45deb4[_0x5816('0x10')][_0x5816('0x11')]);return _0x499f30(_0x45deb4[_0x5816('0x10')]['message']);}else{logger['info'](_0x5816('0x12'),_0x47392f,_0x5816('0xc'));_0x499f30(_0x45deb4['result'][_0x5816('0x11')]);}})[_0x5816('0x13')](function(_0x664b41){logger[_0x5816('0x10')](_0x5816('0x12'),_0x47392f,_0x664b41);_0x5c5ae6(_0x664b41);});});}exports[_0x5816('0x14')]=function(_0x3fff0c){var _0x48d645=this;return new Promise(function(_0x483b03,_0x82bf43){return db[_0x5816('0x15')][_0x5816('0x16')]({'raw':_0x3fff0c[_0x5816('0x17')]?_0x3fff0c[_0x5816('0x17')][_0x5816('0x18')]===undefined?!![]:![]:!![],'where':_0x3fff0c[_0x5816('0x17')]?_0x3fff0c[_0x5816('0x17')][_0x5816('0x19')]||null:null,'attributes':_0x3fff0c[_0x5816('0x17')]?_0x3fff0c['options'][_0x5816('0x1a')]||null:null,'limit':_0x3fff0c[_0x5816('0x17')]?_0x3fff0c['options'][_0x5816('0x1b')]||null:null,'include':_0x3fff0c[_0x5816('0x17')]?_0x3fff0c[_0x5816('0x17')][_0x5816('0x1c')]?_[_0x5816('0x1d')](_0x3fff0c[_0x5816('0x17')][_0x5816('0x1c')],function(_0x404cfb){return{'model':db[_0x404cfb[_0x5816('0x1e')]],'as':_0x404cfb['as'],'attributes':_0x404cfb[_0x5816('0x1a')],'include':_0x404cfb['include']?_['map'](_0x404cfb['include'],function(_0x52d892){return{'model':db[_0x52d892[_0x5816('0x1e')]],'as':_0x52d892['as'],'attributes':_0x52d892[_0x5816('0x1a')],'include':_0x52d892[_0x5816('0x1c')]?_[_0x5816('0x1d')](_0x52d892[_0x5816('0x1c')],function(_0x2cdf6f){return{'model':db[_0x2cdf6f[_0x5816('0x1e')]],'as':_0x2cdf6f['as'],'attributes':_0x2cdf6f[_0x5816('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5816('0xa')](function(_0x47f6d2){logger['info'](_0x5816('0x14'),_0x3fff0c);logger[_0x5816('0xd')](_0x5816('0x14'),_0x3fff0c,JSON[_0x5816('0xf')](_0x47f6d2));_0x483b03(_0x47f6d2);})[_0x5816('0x13')](function(_0x2783fb){logger['error'](_0x5816('0x14'),_0x2783fb[_0x5816('0x11')],_0x3fff0c);_0x82bf43(_0x48d645[_0x5816('0x10')](0x1f4,_0x2783fb['message']));});});};exports['ShowSalesforceAccount']=function(_0x2a7822){var _0x3d326d=this;return new Promise(function(_0x4af636,_0x8a9265){return db[_0x5816('0x15')][_0x5816('0x1f')]({'raw':_0x2a7822['options']?_0x2a7822[_0x5816('0x17')][_0x5816('0x18')]===undefined?!![]:![]:!![],'where':_0x2a7822['options']?_0x2a7822[_0x5816('0x17')][_0x5816('0x19')]||null:null,'attributes':_0x2a7822['options']?_0x2a7822[_0x5816('0x17')][_0x5816('0x1a')]||null:null,'include':_0x2a7822[_0x5816('0x17')]?_0x2a7822[_0x5816('0x17')][_0x5816('0x1c')]?_['map'](_0x2a7822[_0x5816('0x17')]['include'],function(_0x6376a7){return{'model':db[_0x6376a7[_0x5816('0x1e')]],'as':_0x6376a7['as'],'attributes':_0x6376a7[_0x5816('0x1a')],'include':_0x6376a7[_0x5816('0x1c')]?_['map'](_0x6376a7[_0x5816('0x1c')],function(_0x129013){return{'model':db[_0x129013[_0x5816('0x1e')]],'as':_0x129013['as'],'attributes':_0x129013[_0x5816('0x1a')],'include':_0x129013['include']?_['map'](_0x129013[_0x5816('0x1c')],function(_0x19589b){return{'model':db[_0x19589b[_0x5816('0x1e')]],'as':_0x19589b['as'],'attributes':_0x19589b[_0x5816('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5816('0xa')](function(_0xe55295){logger[_0x5816('0xb')](_0x5816('0x20'),_0x2a7822);logger['debug'](_0x5816('0x20'),_0x2a7822,JSON['stringify'](_0xe55295));_0x4af636(_0xe55295);})[_0x5816('0x13')](function(_0x54cc88){logger[_0x5816('0x10')](_0x5816('0x20'),_0x54cc88['message'],_0x2a7822);_0x8a9265(_0x3d326d[_0x5816('0x10')](0x1f4,_0x54cc88[_0x5816('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 9dc0e0b..6d8b972 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(_0x29e8dc,_0x3d27eb){var _0x46fd9b=function(_0x33f289){while(--_0x33f289){_0x29e8dc['push'](_0x29e8dc['shift']());}};_0x46fd9b(++_0x3d27eb);}(_0x7a54,0x106));var _0x47a5=function(_0xa3851d,_0x13e41a){_0xa3851d=_0xa3851d-0x0;var _0x14e822=_0x7a54[_0xa3851d];return _0x14e822;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xdb28,0x106));var _0x8db2=function(_0x1015ad,_0x46dbcd){_0x1015ad=_0x1015ad-0x0;var _0x116fed=_0xdb28[_0x1015ad];return _0x116fed;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 817727c..991d503 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 _0x4584=['contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM'];(function(_0x3b2ddb,_0x329bbf){var _0x55f9bd=function(_0x39fba7){while(--_0x39fba7){_0x3b2ddb['push'](_0x3b2ddb['shift']());}};_0x55f9bd(++_0x329bbf);}(_0x4584,0x1be));var _0x4458=function(_0x359500,_0x5b1ba3){_0x359500=_0x359500-0x0;var _0x51e5b5=_0x4584[_0x359500];return _0x51e5b5;};'use strict';var Sequelize=require(_0x4458('0x0'));module[_0x4458('0x1')]={'name':{'type':Sequelize[_0x4458('0x2')]},'description':{'type':Sequelize[_0x4458('0x2')]},'ticketType':{'type':Sequelize[_0x4458('0x3')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x4458('0x3')]('contact_lead',_0x4458('0x4'),_0x4458('0x5'),_0x4458('0x6'),_0x4458('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x4458('0x3')](_0x4458('0x8'),_0x4458('0x4'),_0x4458('0x5'),_0x4458('0x7')),'defaultValue':_0x4458('0x5')},'leadId':{'type':Sequelize[_0x4458('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x4458('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x4458('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x4458('0x2')]}}; \ No newline at end of file +var _0xe37a=['account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Task','contact','lead'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0xe37a,0x14d));var _0xae37=function(_0x231a6e,_0x14630d){_0x231a6e=_0x231a6e-0x0;var _0x148bef=_0xe37a[_0x231a6e];return _0x148bef;};'use strict';var Sequelize=require(_0xae37('0x0'));module[_0xae37('0x1')]={'name':{'type':Sequelize[_0xae37('0x2')]},'description':{'type':Sequelize[_0xae37('0x2')]},'ticketType':{'type':Sequelize[_0xae37('0x3')](_0xae37('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xae37('0x3')]('contact_lead',_0xae37('0x5'),_0xae37('0x6'),_0xae37('0x7'),_0xae37('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xae37('0x3')](_0xae37('0x9'),_0xae37('0x5'),_0xae37('0x6'),_0xae37('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xae37('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xae37('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xae37('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 31eb844..a437ca8 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 _0x4f17=['nolimit','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','findOne','SalesforceField'];(function(_0x45185f,_0x541dcb){var _0x59c3fc=function(_0x348297){while(--_0x348297){_0x45185f['push'](_0x45185f['shift']());}};_0x59c3fc(++_0x541dcb);}(_0x4f17,0x9e));var _0x74f1=function(_0x1ae125,_0x20820a){_0x1ae125=_0x1ae125-0x0;var _0x1f3b2b=_0x4f17[_0x1ae125];return _0x1f3b2b;};'use strict';var emlformat=require(_0x74f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74f1('0x1'));var jsonpatch=require(_0x74f1('0x2'));var rp=require('request-promise');var moment=require(_0x74f1('0x3'));var BPromise=require(_0x74f1('0x4'));var Mustache=require(_0x74f1('0x5'));var util=require(_0x74f1('0x6'));var path=require(_0x74f1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74f1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74f1('0x9'));var squel=require('squel');var crypto=require(_0x74f1('0xa'));var jsforce=require(_0x74f1('0xb'));var deskjs=require(_0x74f1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x74f1('0xd'));var Papa=require('papaparse');var Redis=require(_0x74f1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x74f1('0xf'));var as=require(_0x74f1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x74f1('0x11'));var utils=require(_0x74f1('0x12'));var config=require(_0x74f1('0x13'));var licenseUtil=require(_0x74f1('0x14'));var db=require(_0x74f1('0x15'))['db'];function respondWithStatusCode(_0x2b91bc,_0x467e15){_0x467e15=_0x467e15||0xcc;return function(_0x3a2ce6){if(_0x3a2ce6){return _0x2b91bc[_0x74f1('0x16')](_0x467e15);}return _0x2b91bc[_0x74f1('0x17')](_0x467e15)['end']();};}function respondWithResult(_0xf135d0,_0x4e156f){_0x4e156f=_0x4e156f||0xc8;return function(_0x41488b){if(_0x41488b){return _0xf135d0['status'](_0x4e156f)[_0x74f1('0x18')](_0x41488b);}};}function respondWithFilteredResult(_0x17762d,_0x373b73){return function(_0x1016a7){if(_0x1016a7){var _0x33b851=typeof _0x373b73['offset']===_0x74f1('0x19')&&typeof _0x373b73[_0x74f1('0x1a')]==='undefined';var _0x387937=_0x1016a7[_0x74f1('0x1b')];var _0x520aae=_0x33b851?0x0:_0x373b73[_0x74f1('0x1c')];var _0x29de10=_0x33b851?_0x1016a7[_0x74f1('0x1b')]:_0x373b73[_0x74f1('0x1c')]+_0x373b73[_0x74f1('0x1a')];var _0x4a10ab;if(_0x29de10>=_0x387937){_0x29de10=_0x387937;_0x4a10ab=0xc8;}else{_0x4a10ab=0xce;}_0x17762d[_0x74f1('0x17')](_0x4a10ab);return _0x17762d[_0x74f1('0x1d')](_0x74f1('0x1e'),_0x520aae+'-'+_0x29de10+'/'+_0x387937)[_0x74f1('0x18')](_0x1016a7);}return null;};}function patchUpdates(_0x227fa9){return function(_0x27ae4b){try{jsonpatch['apply'](_0x27ae4b,_0x227fa9,!![]);}catch(_0x551f9a){return BPromise['reject'](_0x551f9a);}return _0x27ae4b[_0x74f1('0x1f')]();};}function saveUpdates(_0x132a81,_0x3d4c18){return function(_0x749f27){if(_0x749f27){return _0x749f27[_0x74f1('0x20')](_0x132a81)[_0x74f1('0x21')](function(_0x34701f){return _0x34701f;});}return null;};}function removeEntity(_0x26cba4,_0x2c336b){return function(_0x15a96a){if(_0x15a96a){return _0x15a96a[_0x74f1('0x22')]()['then'](function(){_0x26cba4['status'](0xcc)[_0x74f1('0x23')]();});}};}function handleEntityNotFound(_0x24e730,_0xad169c){return function(_0x1b9554){if(!_0x1b9554){_0x24e730[_0x74f1('0x16')](0x194);}return _0x1b9554;};}function handleError(_0xddbb89,_0xd079b5){_0xd079b5=_0xd079b5||0x1f4;return function(_0x5c1fa0){logger[_0x74f1('0x24')](_0x5c1fa0[_0x74f1('0x25')]);if(_0x5c1fa0['name']){delete _0x5c1fa0[_0x74f1('0x26')];}_0xddbb89['status'](_0xd079b5)['send'](_0x5c1fa0);};}exports[_0x74f1('0x27')]=function(_0x37894a,_0x365a2f){var _0x27c47e={},_0x115abf={},_0x176340={'count':0x0,'rows':[]};var _0x19390c=_[_0x74f1('0x28')](db[_0x74f1('0x29')][_0x74f1('0x2a')],function(_0xd226be){return{'name':_0xd226be[_0x74f1('0x2b')],'type':_0xd226be[_0x74f1('0x2c')]['key']};});_0x115abf[_0x74f1('0x2d')]=_[_0x74f1('0x28')](_0x19390c,_0x74f1('0x26'));_0x115abf[_0x74f1('0x2e')]=_['keys'](_0x37894a[_0x74f1('0x2e')]);_0x115abf['filters']=_[_0x74f1('0x2f')](_0x115abf[_0x74f1('0x2d')],_0x115abf[_0x74f1('0x2e')]);_0x27c47e[_0x74f1('0x30')]=_['intersection'](_0x115abf[_0x74f1('0x2d')],qs['fields'](_0x37894a[_0x74f1('0x2e')][_0x74f1('0x31')]));_0x27c47e[_0x74f1('0x30')]=_0x27c47e[_0x74f1('0x30')][_0x74f1('0x32')]?_0x27c47e[_0x74f1('0x30')]:_0x115abf[_0x74f1('0x2d')];if(!_0x37894a[_0x74f1('0x2e')][_0x74f1('0x33')]('nolimit')){_0x27c47e[_0x74f1('0x1a')]=qs[_0x74f1('0x1a')](_0x37894a['query'][_0x74f1('0x1a')]);_0x27c47e[_0x74f1('0x1c')]=qs[_0x74f1('0x1c')](_0x37894a[_0x74f1('0x2e')][_0x74f1('0x1c')]);}_0x27c47e[_0x74f1('0x34')]=qs['sort'](_0x37894a[_0x74f1('0x2e')][_0x74f1('0x35')]);_0x27c47e[_0x74f1('0x36')]=qs[_0x74f1('0x37')](_[_0x74f1('0x38')](_0x37894a[_0x74f1('0x2e')],_0x115abf[_0x74f1('0x37')]),_0x19390c);if(_0x37894a[_0x74f1('0x2e')][_0x74f1('0x39')]){_0x27c47e[_0x74f1('0x36')]=_['merge'](_0x27c47e[_0x74f1('0x36')],{'$or':_['map'](_0x19390c,function(_0x353266){if(_0x353266[_0x74f1('0x2c')]!=='VIRTUAL'){var _0xa9b443={};_0xa9b443[_0x353266[_0x74f1('0x26')]]={'$like':'%'+_0x37894a['query'][_0x74f1('0x39')]+'%'};return _0xa9b443;}})});}_0x27c47e=_[_0x74f1('0x3a')]({},_0x27c47e,_0x37894a['options']);var _0x3693cc={'where':_0x27c47e[_0x74f1('0x36')]};return db[_0x74f1('0x29')][_0x74f1('0x1b')](_0x3693cc)[_0x74f1('0x21')](function(_0x42c0b2){_0x176340['count']=_0x42c0b2;if(_0x37894a['query'][_0x74f1('0x3b')]){_0x27c47e[_0x74f1('0x3c')]=[{'all':!![]}];}return db[_0x74f1('0x29')][_0x74f1('0x3d')](_0x27c47e);})[_0x74f1('0x21')](function(_0x465bad){_0x176340[_0x74f1('0x3e')]=_0x465bad;return _0x176340;})[_0x74f1('0x21')](respondWithFilteredResult(_0x365a2f,_0x27c47e))[_0x74f1('0x3f')](handleError(_0x365a2f,null));};exports[_0x74f1('0x40')]=function(_0x4c8bea,_0x55e7ca){var _0x44edeb={'raw':![],'where':{'id':_0x4c8bea[_0x74f1('0x41')]['id']}},_0x4ae128={};_0x4ae128[_0x74f1('0x2d')]=_[_0x74f1('0x42')](db['SalesforceConfiguration'][_0x74f1('0x2a')]);_0x4ae128[_0x74f1('0x2e')]=_[_0x74f1('0x42')](_0x4c8bea[_0x74f1('0x2e')]);_0x4ae128[_0x74f1('0x37')]=_[_0x74f1('0x2f')](_0x4ae128[_0x74f1('0x2d')],_0x4ae128[_0x74f1('0x2e')]);_0x44edeb['attributes']=_['intersection'](_0x4ae128[_0x74f1('0x2d')],qs['fields'](_0x4c8bea[_0x74f1('0x2e')][_0x74f1('0x31')]));_0x44edeb[_0x74f1('0x30')]=_0x44edeb[_0x74f1('0x30')][_0x74f1('0x32')]?_0x44edeb[_0x74f1('0x30')]:_0x4ae128[_0x74f1('0x2d')];if(_0x4c8bea['query'][_0x74f1('0x3b')]){_0x44edeb[_0x74f1('0x3c')]=[{'all':!![]}];}_0x44edeb=_[_0x74f1('0x3a')]({},_0x44edeb,_0x4c8bea[_0x74f1('0x43')]);return db[_0x74f1('0x29')]['find'](_0x44edeb)[_0x74f1('0x21')](handleEntityNotFound(_0x55e7ca,null))[_0x74f1('0x21')](respondWithResult(_0x55e7ca,null))[_0x74f1('0x3f')](handleError(_0x55e7ca,null));};exports[_0x74f1('0x44')]=function(_0x133dd9,_0x2f362c){return db[_0x74f1('0x29')][_0x74f1('0x44')](_0x133dd9[_0x74f1('0x45')],{})['then'](respondWithResult(_0x2f362c,0xc9))[_0x74f1('0x3f')](handleError(_0x2f362c,null));};exports[_0x74f1('0x20')]=function(_0x26199c,_0x4b0a12){if(_0x26199c['body']['id']){delete _0x26199c[_0x74f1('0x45')]['id'];}return db[_0x74f1('0x29')][_0x74f1('0x46')]({'where':{'id':_0x26199c[_0x74f1('0x41')]['id']}})[_0x74f1('0x21')](handleEntityNotFound(_0x4b0a12,null))[_0x74f1('0x21')](saveUpdates(_0x26199c[_0x74f1('0x45')],null))[_0x74f1('0x21')](respondWithResult(_0x4b0a12,null))['catch'](handleError(_0x4b0a12,null));};exports[_0x74f1('0x22')]=function(_0x2c8906,_0xe025a4){return db[_0x74f1('0x29')][_0x74f1('0x46')]({'where':{'id':_0x2c8906[_0x74f1('0x41')]['id']}})['then'](handleEntityNotFound(_0xe025a4,null))[_0x74f1('0x21')](removeEntity(_0xe025a4,null))[_0x74f1('0x3f')](handleError(_0xe025a4,null));};exports['getFields']=function(_0x469cab,_0x258d93,_0x1f9e5f){var _0x1fbdfc={};var _0x1da6fb={};var _0x400e81;var _0x137ff9;return db[_0x74f1('0x29')][_0x74f1('0x47')]({'where':{'id':_0x469cab[_0x74f1('0x41')]['id']}})[_0x74f1('0x21')](handleEntityNotFound(_0x258d93,null))[_0x74f1('0x21')](function(_0x38864f){if(_0x38864f){_0x400e81=_0x38864f;_0x1da6fb[_0x74f1('0x2d')]=_[_0x74f1('0x42')](db[_0x74f1('0x48')][_0x74f1('0x2a')]);_0x1da6fb[_0x74f1('0x2e')]=_[_0x74f1('0x42')](_0x469cab[_0x74f1('0x2e')]);_0x1da6fb[_0x74f1('0x37')]=_[_0x74f1('0x2f')](_0x1da6fb[_0x74f1('0x2d')],_0x1da6fb[_0x74f1('0x2e')]);_0x1fbdfc[_0x74f1('0x30')]=_[_0x74f1('0x2f')](_0x1da6fb[_0x74f1('0x2d')],qs[_0x74f1('0x31')](_0x469cab['query'][_0x74f1('0x31')]));_0x1fbdfc[_0x74f1('0x30')]=_0x1fbdfc[_0x74f1('0x30')][_0x74f1('0x32')]?_0x1fbdfc[_0x74f1('0x30')]:_0x1da6fb[_0x74f1('0x2d')];_0x1fbdfc['order']=qs[_0x74f1('0x35')](_0x469cab[_0x74f1('0x2e')][_0x74f1('0x35')]);_0x1fbdfc[_0x74f1('0x36')]=qs[_0x74f1('0x37')](_[_0x74f1('0x38')](_0x469cab[_0x74f1('0x2e')],_0x1da6fb['filters']));if(_0x469cab[_0x74f1('0x2e')][_0x74f1('0x39')]){_0x1fbdfc['where']=_[_0x74f1('0x3a')](_0x1fbdfc[_0x74f1('0x36')],{'$or':_['map'](_0x1fbdfc[_0x74f1('0x30')],function(_0x3e7a74){var _0x4f2f8d={};_0x4f2f8d[_0x3e7a74]={'$like':'%'+_0x469cab[_0x74f1('0x2e')][_0x74f1('0x39')]+'%'};return _0x4f2f8d;})});}_0x1fbdfc=_['merge']({},_0x1fbdfc,_0x469cab[_0x74f1('0x43')]);return _0x400e81['getFields'](_0x1fbdfc);}})[_0x74f1('0x21')](function(_0x181381){if(_0x181381){_0x137ff9=_0x181381[_0x74f1('0x32')];if(!_0x469cab[_0x74f1('0x2e')][_0x74f1('0x33')](_0x74f1('0x49'))){_0x1fbdfc[_0x74f1('0x1a')]=qs[_0x74f1('0x1a')](_0x469cab[_0x74f1('0x2e')][_0x74f1('0x1a')]);_0x1fbdfc[_0x74f1('0x1c')]=qs['offset'](_0x469cab['query'][_0x74f1('0x1c')]);}return _0x400e81[_0x74f1('0x4a')](_0x1fbdfc);}})[_0x74f1('0x21')](function(_0x1b652b){if(_0x1b652b){return _0x1b652b?{'count':_0x137ff9,'rows':_0x1b652b}:null;}})[_0x74f1('0x21')](respondWithResult(_0x258d93,null))['catch'](handleError(_0x258d93,null));};exports[_0x74f1('0x4b')]=function(_0x3afa2d,_0x4f32e2,_0x2044a7){var _0x1c717e={};var _0x3bcf8f={};var _0x384770;var _0x3a58a2;return db[_0x74f1('0x29')][_0x74f1('0x47')]({'where':{'id':_0x3afa2d['params']['id']}})['then'](handleEntityNotFound(_0x4f32e2,null))[_0x74f1('0x21')](function(_0x4e69f5){if(_0x4e69f5){_0x384770=_0x4e69f5;_0x3bcf8f[_0x74f1('0x2d')]=_[_0x74f1('0x42')](db[_0x74f1('0x48')]['rawAttributes']);_0x3bcf8f[_0x74f1('0x2e')]=_['keys'](_0x3afa2d['query']);_0x3bcf8f[_0x74f1('0x37')]=_['intersection'](_0x3bcf8f[_0x74f1('0x2d')],_0x3bcf8f[_0x74f1('0x2e')]);_0x1c717e[_0x74f1('0x30')]=_[_0x74f1('0x2f')](_0x3bcf8f[_0x74f1('0x2d')],qs[_0x74f1('0x31')](_0x3afa2d[_0x74f1('0x2e')][_0x74f1('0x31')]));_0x1c717e[_0x74f1('0x30')]=_0x1c717e[_0x74f1('0x30')][_0x74f1('0x32')]?_0x1c717e[_0x74f1('0x30')]:_0x3bcf8f[_0x74f1('0x2d')];_0x1c717e[_0x74f1('0x34')]=qs[_0x74f1('0x35')](_0x3afa2d['query'][_0x74f1('0x35')]);_0x1c717e[_0x74f1('0x36')]=qs[_0x74f1('0x37')](_['pick'](_0x3afa2d[_0x74f1('0x2e')],_0x3bcf8f['filters']));if(_0x3afa2d[_0x74f1('0x2e')][_0x74f1('0x39')]){_0x1c717e['where']=_['merge'](_0x1c717e[_0x74f1('0x36')],{'$or':_['map'](_0x1c717e[_0x74f1('0x30')],function(_0x42d82d){var _0x827783={};_0x827783[_0x42d82d]={'$like':'%'+_0x3afa2d['query'][_0x74f1('0x39')]+'%'};return _0x827783;})});}_0x1c717e=_[_0x74f1('0x3a')]({},_0x1c717e,_0x3afa2d['options']);return _0x384770[_0x74f1('0x4b')](_0x1c717e);}})[_0x74f1('0x21')](function(_0x127f9c){if(_0x127f9c){_0x3a58a2=_0x127f9c[_0x74f1('0x32')];if(!_0x3afa2d['query'][_0x74f1('0x33')](_0x74f1('0x49'))){_0x1c717e[_0x74f1('0x1a')]=qs[_0x74f1('0x1a')](_0x3afa2d[_0x74f1('0x2e')][_0x74f1('0x1a')]);_0x1c717e['offset']=qs[_0x74f1('0x1c')](_0x3afa2d[_0x74f1('0x2e')][_0x74f1('0x1c')]);}return _0x384770['getSubjects'](_0x1c717e);}})[_0x74f1('0x21')](function(_0x28c557){if(_0x28c557){return _0x28c557?{'count':_0x3a58a2,'rows':_0x28c557}:null;}})[_0x74f1('0x21')](respondWithResult(_0x4f32e2,null))[_0x74f1('0x3f')](handleError(_0x4f32e2,null));};exports[_0x74f1('0x4c')]=function(_0x15f1bd,_0x507c75,_0x789773){var _0x4cf33d={};var _0x3f565f={};var _0x4acfd7;var _0x5dd90a;return db[_0x74f1('0x29')][_0x74f1('0x47')]({'where':{'id':_0x15f1bd[_0x74f1('0x41')]['id']}})[_0x74f1('0x21')](handleEntityNotFound(_0x507c75,null))[_0x74f1('0x21')](function(_0x18c837){if(_0x18c837){_0x4acfd7=_0x18c837;_0x3f565f[_0x74f1('0x2d')]=_[_0x74f1('0x42')](db[_0x74f1('0x48')][_0x74f1('0x2a')]);_0x3f565f[_0x74f1('0x2e')]=_['keys'](_0x15f1bd[_0x74f1('0x2e')]);_0x3f565f[_0x74f1('0x37')]=_[_0x74f1('0x2f')](_0x3f565f[_0x74f1('0x2d')],_0x3f565f[_0x74f1('0x2e')]);_0x4cf33d[_0x74f1('0x30')]=_[_0x74f1('0x2f')](_0x3f565f['model'],qs['fields'](_0x15f1bd[_0x74f1('0x2e')][_0x74f1('0x31')]));_0x4cf33d['attributes']=_0x4cf33d['attributes'][_0x74f1('0x32')]?_0x4cf33d['attributes']:_0x3f565f[_0x74f1('0x2d')];_0x4cf33d[_0x74f1('0x34')]=qs[_0x74f1('0x35')](_0x15f1bd[_0x74f1('0x2e')][_0x74f1('0x35')]);_0x4cf33d['where']=qs['filters'](_['pick'](_0x15f1bd[_0x74f1('0x2e')],_0x3f565f[_0x74f1('0x37')]));if(_0x15f1bd['query'][_0x74f1('0x39')]){_0x4cf33d[_0x74f1('0x36')]=_[_0x74f1('0x3a')](_0x4cf33d['where'],{'$or':_[_0x74f1('0x28')](_0x4cf33d[_0x74f1('0x30')],function(_0x1de8f9){var _0x46a84b={};_0x46a84b[_0x1de8f9]={'$like':'%'+_0x15f1bd[_0x74f1('0x2e')][_0x74f1('0x39')]+'%'};return _0x46a84b;})});}_0x4cf33d=_[_0x74f1('0x3a')]({},_0x4cf33d,_0x15f1bd[_0x74f1('0x43')]);return _0x4acfd7['getDescriptions'](_0x4cf33d);}})[_0x74f1('0x21')](function(_0x27a8d4){if(_0x27a8d4){_0x5dd90a=_0x27a8d4[_0x74f1('0x32')];if(!_0x15f1bd[_0x74f1('0x2e')][_0x74f1('0x33')](_0x74f1('0x49'))){_0x4cf33d[_0x74f1('0x1a')]=qs[_0x74f1('0x1a')](_0x15f1bd[_0x74f1('0x2e')][_0x74f1('0x1a')]);_0x4cf33d[_0x74f1('0x1c')]=qs['offset'](_0x15f1bd[_0x74f1('0x2e')][_0x74f1('0x1c')]);}return _0x4acfd7[_0x74f1('0x4c')](_0x4cf33d);}})[_0x74f1('0x21')](function(_0x5be66c){if(_0x5be66c){return _0x5be66c?{'count':_0x5dd90a,'rows':_0x5be66c}:null;}})['then'](respondWithResult(_0x507c75,null))['catch'](handleError(_0x507c75,null));}; \ No newline at end of file +var _0x0096=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','end','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','options','findAll','show','params','length','include','find','catch','create','body','destroy','findOne','SalesforceField','getFields','nolimit','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2918cb,_0x5ce880){var _0x4c5d63=function(_0x144cf4){while(--_0x144cf4){_0x2918cb['push'](_0x2918cb['shift']());}};_0x4c5d63(++_0x5ce880);}(_0x0096,0x11c));var _0x6009=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x0096[_0x333798];return _0x389f4e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6009('0x0'));var jsonpatch=require(_0x6009('0x1'));var rp=require(_0x6009('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6009('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x6009('0x4'));var ejs=require(_0x6009('0x5'));var fs=require('fs');var fs_extra=require(_0x6009('0x6'));var _=require('lodash');var squel=require(_0x6009('0x7'));var crypto=require(_0x6009('0x8'));var jsforce=require(_0x6009('0x9'));var deskjs=require(_0x6009('0xa'));var toCsv=require(_0x6009('0x4'));var querystring=require(_0x6009('0xb'));var Papa=require(_0x6009('0xc'));var Redis=require(_0x6009('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6009('0xe'));var hardwareService=require(_0x6009('0xf'));var logger=require(_0x6009('0x10'))(_0x6009('0x11'));var utils=require('../../config/utils');var config=require(_0x6009('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6009('0x13'))['db'];function respondWithStatusCode(_0x431f02,_0x5b9a3b){_0x5b9a3b=_0x5b9a3b||0xcc;return function(_0x5280c2){if(_0x5280c2){return _0x431f02[_0x6009('0x14')](_0x5b9a3b);}return _0x431f02[_0x6009('0x15')](_0x5b9a3b)['end']();};}function respondWithResult(_0x42c70a,_0x4597e8){_0x4597e8=_0x4597e8||0xc8;return function(_0x1c27f7){if(_0x1c27f7){return _0x42c70a[_0x6009('0x15')](_0x4597e8)[_0x6009('0x16')](_0x1c27f7);}};}function respondWithFilteredResult(_0x3076e6,_0x501915){return function(_0xf4aeac){if(_0xf4aeac){var _0x2fb965=typeof _0x501915['offset']===_0x6009('0x17')&&typeof _0x501915[_0x6009('0x18')]===_0x6009('0x17');var _0x1d0d80=_0xf4aeac['count'];var _0x1d8f22=_0x2fb965?0x0:_0x501915[_0x6009('0x19')];var _0x2aeee6=_0x2fb965?_0xf4aeac[_0x6009('0x1a')]:_0x501915[_0x6009('0x19')]+_0x501915['limit'];var _0x53dc3e;if(_0x2aeee6>=_0x1d0d80){_0x2aeee6=_0x1d0d80;_0x53dc3e=0xc8;}else{_0x53dc3e=0xce;}_0x3076e6['status'](_0x53dc3e);return _0x3076e6[_0x6009('0x1b')]('Content-Range',_0x1d8f22+'-'+_0x2aeee6+'/'+_0x1d0d80)['json'](_0xf4aeac);}return null;};}function patchUpdates(_0x3937c9){return function(_0x22c899){try{jsonpatch[_0x6009('0x1c')](_0x22c899,_0x3937c9,!![]);}catch(_0x3709f6){return BPromise[_0x6009('0x1d')](_0x3709f6);}return _0x22c899[_0x6009('0x1e')]();};}function saveUpdates(_0x4af0c4,_0x96eac3){return function(_0xb6633c){if(_0xb6633c){return _0xb6633c[_0x6009('0x1f')](_0x4af0c4)[_0x6009('0x20')](function(_0x379e2a){return _0x379e2a;});}return null;};}function removeEntity(_0xffcf06,_0x50259c){return function(_0x274bdf){if(_0x274bdf){return _0x274bdf['destroy']()[_0x6009('0x20')](function(){_0xffcf06[_0x6009('0x15')](0xcc)[_0x6009('0x21')]();});}};}function handleEntityNotFound(_0x2a0bdb,_0x13baad){return function(_0x16cb0d){if(!_0x16cb0d){_0x2a0bdb[_0x6009('0x14')](0x194);}return _0x16cb0d;};}function handleError(_0x1645e4,_0x4e2f92){_0x4e2f92=_0x4e2f92||0x1f4;return function(_0x3f7114){logger[_0x6009('0x22')](_0x3f7114[_0x6009('0x23')]);if(_0x3f7114[_0x6009('0x24')]){delete _0x3f7114[_0x6009('0x24')];}_0x1645e4[_0x6009('0x15')](_0x4e2f92)['send'](_0x3f7114);};}exports[_0x6009('0x25')]=function(_0x5cffb,_0x1f4a79){var _0x594a7d={},_0x115e90={},_0x5c5971={'count':0x0,'rows':[]};var _0x5e44ed=_[_0x6009('0x26')](db[_0x6009('0x27')][_0x6009('0x28')],function(_0x39e964){return{'name':_0x39e964['fieldName'],'type':_0x39e964[_0x6009('0x29')][_0x6009('0x2a')]};});_0x115e90[_0x6009('0x2b')]=_[_0x6009('0x26')](_0x5e44ed,_0x6009('0x24'));_0x115e90[_0x6009('0x2c')]=_[_0x6009('0x2d')](_0x5cffb['query']);_0x115e90[_0x6009('0x2e')]=_[_0x6009('0x2f')](_0x115e90[_0x6009('0x2b')],_0x115e90[_0x6009('0x2c')]);_0x594a7d['attributes']=_[_0x6009('0x2f')](_0x115e90['model'],qs['fields'](_0x5cffb[_0x6009('0x2c')][_0x6009('0x30')]));_0x594a7d[_0x6009('0x31')]=_0x594a7d[_0x6009('0x31')]['length']?_0x594a7d[_0x6009('0x31')]:_0x115e90['model'];if(!_0x5cffb[_0x6009('0x2c')][_0x6009('0x32')]('nolimit')){_0x594a7d['limit']=qs[_0x6009('0x18')](_0x5cffb[_0x6009('0x2c')]['limit']);_0x594a7d['offset']=qs['offset'](_0x5cffb[_0x6009('0x2c')][_0x6009('0x19')]);}_0x594a7d[_0x6009('0x33')]=qs['sort'](_0x5cffb[_0x6009('0x2c')][_0x6009('0x34')]);_0x594a7d['where']=qs[_0x6009('0x2e')](_[_0x6009('0x35')](_0x5cffb[_0x6009('0x2c')],_0x115e90[_0x6009('0x2e')]),_0x5e44ed);if(_0x5cffb[_0x6009('0x2c')][_0x6009('0x36')]){_0x594a7d[_0x6009('0x37')]=_[_0x6009('0x38')](_0x594a7d['where'],{'$or':_[_0x6009('0x26')](_0x5e44ed,function(_0x2c944c){if(_0x2c944c['type']!=='VIRTUAL'){var _0x3f6ae2={};_0x3f6ae2[_0x2c944c[_0x6009('0x24')]]={'$like':'%'+_0x5cffb[_0x6009('0x2c')]['filter']+'%'};return _0x3f6ae2;}})});}_0x594a7d=_['merge']({},_0x594a7d,_0x5cffb[_0x6009('0x39')]);var _0x5809f7={'where':_0x594a7d['where']};return db[_0x6009('0x27')]['count'](_0x5809f7)[_0x6009('0x20')](function(_0x3ad4f9){_0x5c5971[_0x6009('0x1a')]=_0x3ad4f9;if(_0x5cffb[_0x6009('0x2c')]['includeAll']){_0x594a7d['include']=[{'all':!![]}];}return db[_0x6009('0x27')][_0x6009('0x3a')](_0x594a7d);})[_0x6009('0x20')](function(_0x87a96){_0x5c5971['rows']=_0x87a96;return _0x5c5971;})['then'](respondWithFilteredResult(_0x1f4a79,_0x594a7d))['catch'](handleError(_0x1f4a79,null));};exports[_0x6009('0x3b')]=function(_0x4a20b0,_0x3624f1){var _0x525256={'raw':![],'where':{'id':_0x4a20b0[_0x6009('0x3c')]['id']}},_0x311171={};_0x311171['model']=_[_0x6009('0x2d')](db[_0x6009('0x27')][_0x6009('0x28')]);_0x311171[_0x6009('0x2c')]=_[_0x6009('0x2d')](_0x4a20b0['query']);_0x311171[_0x6009('0x2e')]=_[_0x6009('0x2f')](_0x311171['model'],_0x311171[_0x6009('0x2c')]);_0x525256[_0x6009('0x31')]=_[_0x6009('0x2f')](_0x311171[_0x6009('0x2b')],qs['fields'](_0x4a20b0[_0x6009('0x2c')]['fields']));_0x525256[_0x6009('0x31')]=_0x525256[_0x6009('0x31')][_0x6009('0x3d')]?_0x525256['attributes']:_0x311171[_0x6009('0x2b')];if(_0x4a20b0[_0x6009('0x2c')]['includeAll']){_0x525256[_0x6009('0x3e')]=[{'all':!![]}];}_0x525256=_[_0x6009('0x38')]({},_0x525256,_0x4a20b0[_0x6009('0x39')]);return db[_0x6009('0x27')][_0x6009('0x3f')](_0x525256)[_0x6009('0x20')](handleEntityNotFound(_0x3624f1,null))[_0x6009('0x20')](respondWithResult(_0x3624f1,null))[_0x6009('0x40')](handleError(_0x3624f1,null));};exports['create']=function(_0x40b38f,_0x49620a){return db[_0x6009('0x27')][_0x6009('0x41')](_0x40b38f['body'],{})[_0x6009('0x20')](respondWithResult(_0x49620a,0xc9))[_0x6009('0x40')](handleError(_0x49620a,null));};exports[_0x6009('0x1f')]=function(_0x9dace,_0x3c2988){if(_0x9dace['body']['id']){delete _0x9dace['body']['id'];}return db[_0x6009('0x27')][_0x6009('0x3f')]({'where':{'id':_0x9dace[_0x6009('0x3c')]['id']}})[_0x6009('0x20')](handleEntityNotFound(_0x3c2988,null))[_0x6009('0x20')](saveUpdates(_0x9dace[_0x6009('0x42')],null))['then'](respondWithResult(_0x3c2988,null))[_0x6009('0x40')](handleError(_0x3c2988,null));};exports[_0x6009('0x43')]=function(_0x5763cb,_0x1a767f){return db[_0x6009('0x27')][_0x6009('0x3f')]({'where':{'id':_0x5763cb[_0x6009('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1a767f,null))[_0x6009('0x20')](removeEntity(_0x1a767f,null))['catch'](handleError(_0x1a767f,null));};exports['getFields']=function(_0x543d3f,_0x46ae32,_0xade267){var _0x4186e8={};var _0x1e8c50={};var _0xc97787;var _0x17a511;return db[_0x6009('0x27')][_0x6009('0x44')]({'where':{'id':_0x543d3f[_0x6009('0x3c')]['id']}})['then'](handleEntityNotFound(_0x46ae32,null))[_0x6009('0x20')](function(_0x35c2b4){if(_0x35c2b4){_0xc97787=_0x35c2b4;_0x1e8c50['model']=_[_0x6009('0x2d')](db[_0x6009('0x45')]['rawAttributes']);_0x1e8c50[_0x6009('0x2c')]=_[_0x6009('0x2d')](_0x543d3f[_0x6009('0x2c')]);_0x1e8c50['filters']=_['intersection'](_0x1e8c50[_0x6009('0x2b')],_0x1e8c50['query']);_0x4186e8[_0x6009('0x31')]=_[_0x6009('0x2f')](_0x1e8c50[_0x6009('0x2b')],qs[_0x6009('0x30')](_0x543d3f[_0x6009('0x2c')]['fields']));_0x4186e8[_0x6009('0x31')]=_0x4186e8[_0x6009('0x31')][_0x6009('0x3d')]?_0x4186e8[_0x6009('0x31')]:_0x1e8c50['model'];_0x4186e8[_0x6009('0x33')]=qs[_0x6009('0x34')](_0x543d3f['query']['sort']);_0x4186e8[_0x6009('0x37')]=qs['filters'](_[_0x6009('0x35')](_0x543d3f[_0x6009('0x2c')],_0x1e8c50[_0x6009('0x2e')]));if(_0x543d3f[_0x6009('0x2c')]['filter']){_0x4186e8['where']=_[_0x6009('0x38')](_0x4186e8[_0x6009('0x37')],{'$or':_[_0x6009('0x26')](_0x4186e8['attributes'],function(_0x360d30){var _0x149cf8={};_0x149cf8[_0x360d30]={'$like':'%'+_0x543d3f[_0x6009('0x2c')][_0x6009('0x36')]+'%'};return _0x149cf8;})});}_0x4186e8=_[_0x6009('0x38')]({},_0x4186e8,_0x543d3f[_0x6009('0x39')]);return _0xc97787[_0x6009('0x46')](_0x4186e8);}})[_0x6009('0x20')](function(_0x4220b3){if(_0x4220b3){_0x17a511=_0x4220b3[_0x6009('0x3d')];if(!_0x543d3f[_0x6009('0x2c')][_0x6009('0x32')](_0x6009('0x47'))){_0x4186e8[_0x6009('0x18')]=qs[_0x6009('0x18')](_0x543d3f[_0x6009('0x2c')][_0x6009('0x18')]);_0x4186e8[_0x6009('0x19')]=qs[_0x6009('0x19')](_0x543d3f[_0x6009('0x2c')][_0x6009('0x19')]);}return _0xc97787[_0x6009('0x46')](_0x4186e8);}})[_0x6009('0x20')](function(_0x2f1d50){if(_0x2f1d50){return _0x2f1d50?{'count':_0x17a511,'rows':_0x2f1d50}:null;}})[_0x6009('0x20')](respondWithResult(_0x46ae32,null))[_0x6009('0x40')](handleError(_0x46ae32,null));};exports['getSubjects']=function(_0x57c2a3,_0x1f2de0,_0x2ada72){var _0x14d03b={};var _0xdf3719={};var _0x4facaa;var _0x22d67b;return db[_0x6009('0x27')][_0x6009('0x44')]({'where':{'id':_0x57c2a3['params']['id']}})[_0x6009('0x20')](handleEntityNotFound(_0x1f2de0,null))['then'](function(_0x3bddc9){if(_0x3bddc9){_0x4facaa=_0x3bddc9;_0xdf3719['model']=_[_0x6009('0x2d')](db[_0x6009('0x45')]['rawAttributes']);_0xdf3719[_0x6009('0x2c')]=_[_0x6009('0x2d')](_0x57c2a3[_0x6009('0x2c')]);_0xdf3719[_0x6009('0x2e')]=_[_0x6009('0x2f')](_0xdf3719[_0x6009('0x2b')],_0xdf3719['query']);_0x14d03b[_0x6009('0x31')]=_[_0x6009('0x2f')](_0xdf3719[_0x6009('0x2b')],qs[_0x6009('0x30')](_0x57c2a3[_0x6009('0x2c')][_0x6009('0x30')]));_0x14d03b[_0x6009('0x31')]=_0x14d03b[_0x6009('0x31')][_0x6009('0x3d')]?_0x14d03b[_0x6009('0x31')]:_0xdf3719[_0x6009('0x2b')];_0x14d03b[_0x6009('0x33')]=qs[_0x6009('0x34')](_0x57c2a3[_0x6009('0x2c')][_0x6009('0x34')]);_0x14d03b[_0x6009('0x37')]=qs['filters'](_[_0x6009('0x35')](_0x57c2a3[_0x6009('0x2c')],_0xdf3719['filters']));if(_0x57c2a3['query'][_0x6009('0x36')]){_0x14d03b[_0x6009('0x37')]=_[_0x6009('0x38')](_0x14d03b[_0x6009('0x37')],{'$or':_[_0x6009('0x26')](_0x14d03b[_0x6009('0x31')],function(_0x22720e){var _0x543469={};_0x543469[_0x22720e]={'$like':'%'+_0x57c2a3[_0x6009('0x2c')][_0x6009('0x36')]+'%'};return _0x543469;})});}_0x14d03b=_[_0x6009('0x38')]({},_0x14d03b,_0x57c2a3['options']);return _0x4facaa[_0x6009('0x48')](_0x14d03b);}})['then'](function(_0xabe984){if(_0xabe984){_0x22d67b=_0xabe984['length'];if(!_0x57c2a3['query'][_0x6009('0x32')]('nolimit')){_0x14d03b[_0x6009('0x18')]=qs[_0x6009('0x18')](_0x57c2a3[_0x6009('0x2c')][_0x6009('0x18')]);_0x14d03b[_0x6009('0x19')]=qs['offset'](_0x57c2a3[_0x6009('0x2c')]['offset']);}return _0x4facaa[_0x6009('0x48')](_0x14d03b);}})[_0x6009('0x20')](function(_0x44f14f){if(_0x44f14f){return _0x44f14f?{'count':_0x22d67b,'rows':_0x44f14f}:null;}})['then'](respondWithResult(_0x1f2de0,null))[_0x6009('0x40')](handleError(_0x1f2de0,null));};exports[_0x6009('0x49')]=function(_0x27ea8d,_0x3e4236,_0x21c3a9){var _0x2350b2={};var _0x1c1efc={};var _0x2e3c90;var _0x155b81;return db[_0x6009('0x27')]['findOne']({'where':{'id':_0x27ea8d['params']['id']}})[_0x6009('0x20')](handleEntityNotFound(_0x3e4236,null))[_0x6009('0x20')](function(_0x4b15f0){if(_0x4b15f0){_0x2e3c90=_0x4b15f0;_0x1c1efc['model']=_[_0x6009('0x2d')](db[_0x6009('0x45')][_0x6009('0x28')]);_0x1c1efc[_0x6009('0x2c')]=_['keys'](_0x27ea8d[_0x6009('0x2c')]);_0x1c1efc[_0x6009('0x2e')]=_[_0x6009('0x2f')](_0x1c1efc[_0x6009('0x2b')],_0x1c1efc[_0x6009('0x2c')]);_0x2350b2[_0x6009('0x31')]=_[_0x6009('0x2f')](_0x1c1efc[_0x6009('0x2b')],qs['fields'](_0x27ea8d[_0x6009('0x2c')][_0x6009('0x30')]));_0x2350b2['attributes']=_0x2350b2[_0x6009('0x31')][_0x6009('0x3d')]?_0x2350b2['attributes']:_0x1c1efc[_0x6009('0x2b')];_0x2350b2[_0x6009('0x33')]=qs[_0x6009('0x34')](_0x27ea8d[_0x6009('0x2c')]['sort']);_0x2350b2[_0x6009('0x37')]=qs[_0x6009('0x2e')](_[_0x6009('0x35')](_0x27ea8d[_0x6009('0x2c')],_0x1c1efc[_0x6009('0x2e')]));if(_0x27ea8d['query'][_0x6009('0x36')]){_0x2350b2[_0x6009('0x37')]=_[_0x6009('0x38')](_0x2350b2[_0x6009('0x37')],{'$or':_['map'](_0x2350b2['attributes'],function(_0x2c9374){var _0x37c954={};_0x37c954[_0x2c9374]={'$like':'%'+_0x27ea8d[_0x6009('0x2c')][_0x6009('0x36')]+'%'};return _0x37c954;})});}_0x2350b2=_[_0x6009('0x38')]({},_0x2350b2,_0x27ea8d['options']);return _0x2e3c90[_0x6009('0x49')](_0x2350b2);}})[_0x6009('0x20')](function(_0x3f7766){if(_0x3f7766){_0x155b81=_0x3f7766['length'];if(!_0x27ea8d[_0x6009('0x2c')]['hasOwnProperty'](_0x6009('0x47'))){_0x2350b2['limit']=qs['limit'](_0x27ea8d[_0x6009('0x2c')][_0x6009('0x18')]);_0x2350b2[_0x6009('0x19')]=qs['offset'](_0x27ea8d[_0x6009('0x2c')][_0x6009('0x19')]);}return _0x2e3c90[_0x6009('0x49')](_0x2350b2);}})['then'](function(_0x3e54ac){if(_0x3e54ac){return _0x3e54ac?{'count':_0x155b81,'rows':_0x3e54ac}:null;}})[_0x6009('0x20')](respondWithResult(_0x3e4236,null))[_0x6009('0x40')](handleError(_0x3e4236,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 8c6e820..e33667f 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4481=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intSalesforceConfiguration.attributes'];(function(_0x352a92,_0x5894a8){var _0xb343a8=function(_0x2cb6a9){while(--_0x2cb6a9){_0x352a92['push'](_0x352a92['shift']());}};_0xb343a8(++_0x5894a8);}(_0x4481,0x1c4));var _0x1448=function(_0xfdc0ec,_0x30bf66){_0xfdc0ec=_0xfdc0ec-0x0;var _0x5404f9=_0x4481[_0xfdc0ec];return _0x5404f9;};'use strict';var _=require(_0x1448('0x0'));var util=require(_0x1448('0x1'));var logger=require(_0x1448('0x2'))(_0x1448('0x3'));var moment=require(_0x1448('0x4'));var BPromise=require(_0x1448('0x5'));var rp=require(_0x1448('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1448('0x7'));module['exports']=function(_0x3ca35c,_0x476a25){return _0x3ca35c['define'](_0x1448('0x8'),attributes,{'tableName':_0x1448('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc609=['moment','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','define','lodash','util','../../config/logger','api'];(function(_0x235bc9,_0x56bae3){var _0x47508c=function(_0x440366){while(--_0x440366){_0x235bc9['push'](_0x235bc9['shift']());}};_0x47508c(++_0x56bae3);}(_0xc609,0x1c8));var _0x9c60=function(_0x5571e8,_0x122575){_0x5571e8=_0x5571e8-0x0;var _0x415b5b=_0xc609[_0x5571e8];return _0x415b5b;};'use strict';var _=require(_0x9c60('0x0'));var util=require(_0x9c60('0x1'));var logger=require(_0x9c60('0x2'))(_0x9c60('0x3'));var moment=require(_0x9c60('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c60('0x5'));var fs=require('fs');var path=require(_0x9c60('0x6'));var rimraf=require(_0x9c60('0x7'));var config=require('../../config/environment');var attributes=require(_0x9c60('0x8'));module['exports']=function(_0x459ce7,_0x42c59b){return _0x459ce7[_0x9c60('0x9')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 4a5e307..9ecdce8 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 _0xb899=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x34990e,_0x6b0647){var _0x2740b5=function(_0x5d50ea){while(--_0x5d50ea){_0x34990e['push'](_0x34990e['shift']());}};_0x2740b5(++_0x6b0647);}(_0xb899,0x1b8));var _0x9b89=function(_0x243716,_0x1c88c5){_0x243716=_0x243716-0x0;var _0x510b11=_0xb899[_0x243716];return _0x510b11;};'use strict';var _=require(_0x9b89('0x0'));var util=require('util');var moment=require(_0x9b89('0x1'));var BPromise=require(_0x9b89('0x2'));var rs=require(_0x9b89('0x3'));var fs=require('fs');var Redis=require(_0x9b89('0x4'));var db=require(_0x9b89('0x5'))['db'];var utils=require(_0x9b89('0x6'));var logger=require(_0x9b89('0x7'))('rpc');var config=require(_0x9b89('0x8'));var jayson=require(_0x9b89('0x9'));var client=jayson['client'][_0x9b89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x153486,_0x16d035,_0x46a0eb){return new BPromise(function(_0x28e80b,_0x25cafc){return client[_0x9b89('0xb')](_0x153486,_0x46a0eb)[_0x9b89('0xc')](function(_0x36148e){logger['info'](_0x9b89('0xd'),_0x16d035,_0x9b89('0xe'));logger[_0x9b89('0xf')](_0x9b89('0x10'),_0x16d035,'request\x20sent',JSON['stringify'](_0x36148e));if(_0x36148e[_0x9b89('0x11')]){if(_0x36148e[_0x9b89('0x11')][_0x9b89('0x12')]===0x1f4){logger[_0x9b89('0x11')](_0x9b89('0xd'),_0x16d035,_0x36148e[_0x9b89('0x11')][_0x9b89('0x13')]);return _0x25cafc(_0x36148e[_0x9b89('0x11')][_0x9b89('0x13')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x16d035,_0x36148e[_0x9b89('0x11')][_0x9b89('0x13')]);return _0x28e80b(_0x36148e[_0x9b89('0x11')]['message']);}else{logger[_0x9b89('0x14')](_0x9b89('0xd'),_0x16d035,_0x9b89('0xe'));_0x28e80b(_0x36148e[_0x9b89('0x15')][_0x9b89('0x13')]);}})[_0x9b89('0x16')](function(_0x1ee502){logger['error'](_0x9b89('0xd'),_0x16d035,_0x1ee502);_0x25cafc(_0x1ee502);});});} \ No newline at end of file +var _0x1738=['../../config/environment','jayson/promise','client','http','then','info','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x174724,_0x47eba4){var _0x25901e=function(_0x1c54f7){while(--_0x1c54f7){_0x174724['push'](_0x174724['shift']());}};_0x25901e(++_0x47eba4);}(_0x1738,0xb7));var _0x8173=function(_0x475191,_0x5bce86){_0x475191=_0x475191-0x0;var _0x189e96=_0x1738[_0x475191];return _0x189e96;};'use strict';var _=require('lodash');var util=require(_0x8173('0x0'));var moment=require(_0x8173('0x1'));var BPromise=require(_0x8173('0x2'));var rs=require(_0x8173('0x3'));var fs=require('fs');var Redis=require(_0x8173('0x4'));var db=require(_0x8173('0x5'))['db'];var utils=require(_0x8173('0x6'));var logger=require(_0x8173('0x7'))(_0x8173('0x8'));var config=require(_0x8173('0x9'));var jayson=require(_0x8173('0xa'));var client=jayson[_0x8173('0xb')][_0x8173('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x452613,_0x157939,_0x19e09f){return new BPromise(function(_0x4d077c,_0x518aa3){return client['request'](_0x452613,_0x19e09f)[_0x8173('0xd')](function(_0x374236){logger[_0x8173('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x157939,'request\x20sent');logger[_0x8173('0xf')](_0x8173('0x10'),_0x157939,'request\x20sent',JSON[_0x8173('0x11')](_0x374236));if(_0x374236[_0x8173('0x12')]){if(_0x374236[_0x8173('0x12')][_0x8173('0x13')]===0x1f4){logger[_0x8173('0x12')](_0x8173('0x14'),_0x157939,_0x374236[_0x8173('0x12')][_0x8173('0x15')]);return _0x518aa3(_0x374236['error'][_0x8173('0x15')]);}logger[_0x8173('0x12')](_0x8173('0x14'),_0x157939,_0x374236[_0x8173('0x12')]['message']);return _0x4d077c(_0x374236[_0x8173('0x12')][_0x8173('0x15')]);}else{logger[_0x8173('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x157939,_0x8173('0x16'));_0x4d077c(_0x374236['result'][_0x8173('0x15')]);}})[_0x8173('0x17')](function(_0x2af0b5){logger[_0x8173('0x12')](_0x8173('0x14'),_0x157939,_0x2af0b5);_0x518aa3(_0x2af0b5);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 474a087..9632f51 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 _0x6d8d=['get','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x6d8d,0xf7));var _0xd6d8=function(_0x303a1d,_0x106f98){_0x303a1d=_0x303a1d-0x0;var _0x4fa850=_0x6d8d[_0x303a1d];return _0x4fa850;};'use strict';var multer=require(_0xd6d8('0x0'));var util=require(_0xd6d8('0x1'));var path=require(_0xd6d8('0x2'));var timeout=require(_0xd6d8('0x3'));var express=require(_0xd6d8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd6d8('0x5'));var config=require(_0xd6d8('0x6'));var controller=require(_0xd6d8('0x7'));router[_0xd6d8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd6d8('0x8')](_0xd6d8('0x9'),auth[_0xd6d8('0xa')](),controller[_0xd6d8('0xb')]);router[_0xd6d8('0xc')]('/',auth['isAuthenticated'](),controller[_0xd6d8('0xd')]);router['put']('/:id',auth[_0xd6d8('0xa')](),controller[_0xd6d8('0xe')]);router['delete'](_0xd6d8('0x9'),auth['isAuthenticated'](),controller[_0xd6d8('0xf')]);module[_0xd6d8('0x10')]=router; \ No newline at end of file +var _0x15bc=['util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy'];(function(_0x2dc94d,_0x2e89a6){var _0x3237be=function(_0x35b917){while(--_0x35b917){_0x2dc94d['push'](_0x2dc94d['shift']());}};_0x3237be(++_0x2e89a6);}(_0x15bc,0x77));var _0xc15b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc15b('0x0'));var path=require('path');var timeout=require(_0xc15b('0x1'));var express=require('express');var router=express[_0xc15b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc15b('0x3'));var config=require(_0xc15b('0x4'));var controller=require(_0xc15b('0x5'));router[_0xc15b('0x6')]('/',auth[_0xc15b('0x7')](),controller[_0xc15b('0x8')]);router[_0xc15b('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc15b('0x9')]);router[_0xc15b('0xa')]('/',auth[_0xc15b('0x7')](),controller[_0xc15b('0xb')]);router[_0xc15b('0xc')](_0xc15b('0xd'),auth[_0xc15b('0x7')](),controller[_0xc15b('0xe')]);router[_0xc15b('0xf')](_0xc15b('0xd'),auth[_0xc15b('0x7')](),controller[_0xc15b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 4eaec47..05a2532 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 _0x3ef1=['keyValue','picklist','STRING','sequelize','string','variable','customVariable'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x3ef1,0x129));var _0x13ef=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3ef1[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x13ef('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x13ef('0x1'),_0x13ef('0x2'),_0x13ef('0x3'),_0x13ef('0x4'),_0x13ef('0x5')),'defaultValue':_0x13ef('0x1')},'content':{'type':Sequelize[_0x13ef('0x6')]},'key':{'type':Sequelize[_0x13ef('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x13ef('0x1'),_0x13ef('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x13ef('0x6')]},'variableName':{'type':Sequelize[_0x13ef('0x6')]}}; \ No newline at end of file +var _0x05ba=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x05ba,0x111));var _0xa05b=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x05ba[_0x580b15];return _0x1adb1b;};'use strict';var Sequelize=require(_0xa05b('0x0'));module[_0xa05b('0x1')]={'type':{'type':Sequelize[_0xa05b('0x2')](_0xa05b('0x3'),_0xa05b('0x4'),_0xa05b('0x5'),_0xa05b('0x6'),_0xa05b('0x7')),'defaultValue':_0xa05b('0x3')},'content':{'type':Sequelize[_0xa05b('0x8')]},'key':{'type':Sequelize[_0xa05b('0x8')]},'keyType':{'type':Sequelize[_0xa05b('0x2')](_0xa05b('0x3'),_0xa05b('0x4'),_0xa05b('0x5'))},'keyContent':{'type':Sequelize[_0xa05b('0x8')]},'idField':{'type':Sequelize[_0xa05b('0x8')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index dfceacf..7901dcc 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 _0xb7df=['SalesforceField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','then','destroy','name','index'];(function(_0x138f30,_0x28b343){var _0x363b58=function(_0x54e970){while(--_0x54e970){_0x138f30['push'](_0x138f30['shift']());}};_0x363b58(++_0x28b343);}(_0xb7df,0x193));var _0xfb7d=function(_0xdcf290,_0x5d387a){_0xdcf290=_0xdcf290-0x0;var _0x416cc6=_0xb7df[_0xdcf290];return _0x416cc6;};'use strict';var emlformat=require(_0xfb7d('0x0'));var rimraf=require(_0xfb7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfb7d('0x2'));var BPromise=require(_0xfb7d('0x3'));var Mustache=require(_0xfb7d('0x4'));var util=require(_0xfb7d('0x5'));var path=require(_0xfb7d('0x6'));var sox=require(_0xfb7d('0x7'));var csv=require(_0xfb7d('0x8'));var ejs=require(_0xfb7d('0x9'));var fs=require('fs');var fs_extra=require(_0xfb7d('0xa'));var _=require(_0xfb7d('0xb'));var squel=require(_0xfb7d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb7d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfb7d('0xe'));var Redis=require(_0xfb7d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfb7d('0x10'));var as=require(_0xfb7d('0x11'));var hardwareService=require(_0xfb7d('0x12'));var logger=require(_0xfb7d('0x13'))(_0xfb7d('0x14'));var utils=require(_0xfb7d('0x15'));var config=require(_0xfb7d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb7d('0x17'))['db'];function respondWithStatusCode(_0x3f84f1,_0x102a27){_0x102a27=_0x102a27||0xcc;return function(_0x245e8e){if(_0x245e8e){return _0x3f84f1[_0xfb7d('0x18')](_0x102a27);}return _0x3f84f1['status'](_0x102a27)[_0xfb7d('0x19')]();};}function respondWithResult(_0x3bf45b,_0x2d2385){_0x2d2385=_0x2d2385||0xc8;return function(_0x11205b){if(_0x11205b){return _0x3bf45b['status'](_0x2d2385)[_0xfb7d('0x1a')](_0x11205b);}};}function respondWithFilteredResult(_0x30ffa8,_0x2eb266){return function(_0x255d85){if(_0x255d85){var _0x30160c=typeof _0x2eb266[_0xfb7d('0x1b')]===_0xfb7d('0x1c')&&typeof _0x2eb266['limit']===_0xfb7d('0x1c');var _0x4b265d=_0x255d85[_0xfb7d('0x1d')];var _0x40e3eb=_0x30160c?0x0:_0x2eb266[_0xfb7d('0x1b')];var _0x13121f=_0x30160c?_0x255d85[_0xfb7d('0x1d')]:_0x2eb266['offset']+_0x2eb266[_0xfb7d('0x1e')];var _0x2a450b;if(_0x13121f>=_0x4b265d){_0x13121f=_0x4b265d;_0x2a450b=0xc8;}else{_0x2a450b=0xce;}_0x30ffa8[_0xfb7d('0x1f')](_0x2a450b);return _0x30ffa8[_0xfb7d('0x20')](_0xfb7d('0x21'),_0x40e3eb+'-'+_0x13121f+'/'+_0x4b265d)[_0xfb7d('0x1a')](_0x255d85);}return null;};}function patchUpdates(_0x2d45ad){return function(_0x27b7bb){try{jsonpatch[_0xfb7d('0x22')](_0x27b7bb,_0x2d45ad,!![]);}catch(_0x3527d5){return BPromise['reject'](_0x3527d5);}return _0x27b7bb[_0xfb7d('0x23')]();};}function saveUpdates(_0x78bba0,_0x5be6e7){return function(_0xdfe4ec){if(_0xdfe4ec){return _0xdfe4ec[_0xfb7d('0x24')](_0x78bba0)[_0xfb7d('0x25')](function(_0x186bd6){return _0x186bd6;});}return null;};}function removeEntity(_0x32f9c9,_0x19424d){return function(_0x2521c5){if(_0x2521c5){return _0x2521c5[_0xfb7d('0x26')]()['then'](function(){_0x32f9c9[_0xfb7d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1da583,_0x3bbc30){return function(_0x104515){if(!_0x104515){_0x1da583['sendStatus'](0x194);}return _0x104515;};}function handleError(_0x1ca3b2,_0x5e505d){_0x5e505d=_0x5e505d||0x1f4;return function(_0x37aaea){logger['error'](_0x37aaea['stack']);if(_0x37aaea['name']){delete _0x37aaea[_0xfb7d('0x27')];}_0x1ca3b2[_0xfb7d('0x1f')](_0x5e505d)['send'](_0x37aaea);};}exports[_0xfb7d('0x28')]=function(_0x1871d5,_0x2108e7){var _0xe559f={},_0x7d594e={},_0x194f20={'count':0x0,'rows':[]};var _0x362b7b=_['map'](db[_0xfb7d('0x29')][_0xfb7d('0x2a')],function(_0x381227){return{'name':_0x381227[_0xfb7d('0x2b')],'type':_0x381227['type'][_0xfb7d('0x2c')]};});_0x7d594e[_0xfb7d('0x2d')]=_['map'](_0x362b7b,'name');_0x7d594e['query']=_['keys'](_0x1871d5[_0xfb7d('0x2e')]);_0x7d594e[_0xfb7d('0x2f')]=_[_0xfb7d('0x30')](_0x7d594e[_0xfb7d('0x2d')],_0x7d594e['query']);_0xe559f[_0xfb7d('0x31')]=_['intersection'](_0x7d594e[_0xfb7d('0x2d')],qs[_0xfb7d('0x32')](_0x1871d5[_0xfb7d('0x2e')][_0xfb7d('0x32')]));_0xe559f[_0xfb7d('0x31')]=_0xe559f[_0xfb7d('0x31')][_0xfb7d('0x33')]?_0xe559f['attributes']:_0x7d594e['model'];if(!_0x1871d5[_0xfb7d('0x2e')][_0xfb7d('0x34')](_0xfb7d('0x35'))){_0xe559f[_0xfb7d('0x1e')]=qs[_0xfb7d('0x1e')](_0x1871d5[_0xfb7d('0x2e')][_0xfb7d('0x1e')]);_0xe559f[_0xfb7d('0x1b')]=qs[_0xfb7d('0x1b')](_0x1871d5[_0xfb7d('0x2e')]['offset']);}_0xe559f[_0xfb7d('0x36')]=qs[_0xfb7d('0x37')](_0x1871d5[_0xfb7d('0x2e')][_0xfb7d('0x37')]);_0xe559f[_0xfb7d('0x38')]=qs[_0xfb7d('0x2f')](_[_0xfb7d('0x39')](_0x1871d5['query'],_0x7d594e['filters']),_0x362b7b);if(_0x1871d5[_0xfb7d('0x2e')]['filter']){_0xe559f[_0xfb7d('0x38')]=_['merge'](_0xe559f[_0xfb7d('0x38')],{'$or':_[_0xfb7d('0x3a')](_0x362b7b,function(_0x185a26){if(_0x185a26[_0xfb7d('0x3b')]!=='VIRTUAL'){var _0x47551e={};_0x47551e[_0x185a26[_0xfb7d('0x27')]]={'$like':'%'+_0x1871d5['query'][_0xfb7d('0x3c')]+'%'};return _0x47551e;}})});}_0xe559f=_[_0xfb7d('0x3d')]({},_0xe559f,_0x1871d5[_0xfb7d('0x3e')]);var _0x2b445a={'where':_0xe559f[_0xfb7d('0x38')]};return db[_0xfb7d('0x29')][_0xfb7d('0x1d')](_0x2b445a)[_0xfb7d('0x25')](function(_0x1ee43d){_0x194f20['count']=_0x1ee43d;if(_0x1871d5[_0xfb7d('0x2e')][_0xfb7d('0x3f')]){_0xe559f[_0xfb7d('0x40')]=[{'all':!![]}];}return db[_0xfb7d('0x29')][_0xfb7d('0x41')](_0xe559f);})['then'](function(_0x54f78c){_0x194f20[_0xfb7d('0x42')]=_0x54f78c;return _0x194f20;})[_0xfb7d('0x25')](respondWithFilteredResult(_0x2108e7,_0xe559f))[_0xfb7d('0x43')](handleError(_0x2108e7,null));};exports[_0xfb7d('0x44')]=function(_0x57cac1,_0x3fdf5d){var _0x574fbd={'raw':!![],'where':{'id':_0x57cac1[_0xfb7d('0x45')]['id']}},_0x2e4762={};_0x2e4762['model']=_[_0xfb7d('0x46')](db[_0xfb7d('0x29')][_0xfb7d('0x2a')]);_0x2e4762[_0xfb7d('0x2e')]=_['keys'](_0x57cac1[_0xfb7d('0x2e')]);_0x2e4762[_0xfb7d('0x2f')]=_['intersection'](_0x2e4762['model'],_0x2e4762[_0xfb7d('0x2e')]);_0x574fbd[_0xfb7d('0x31')]=_[_0xfb7d('0x30')](_0x2e4762[_0xfb7d('0x2d')],qs[_0xfb7d('0x32')](_0x57cac1['query'][_0xfb7d('0x32')]));_0x574fbd[_0xfb7d('0x31')]=_0x574fbd[_0xfb7d('0x31')][_0xfb7d('0x33')]?_0x574fbd[_0xfb7d('0x31')]:_0x2e4762[_0xfb7d('0x2d')];if(_0x57cac1[_0xfb7d('0x2e')][_0xfb7d('0x3f')]){_0x574fbd[_0xfb7d('0x40')]=[{'all':!![]}];}_0x574fbd=_[_0xfb7d('0x3d')]({},_0x574fbd,_0x57cac1['options']);return db[_0xfb7d('0x29')][_0xfb7d('0x47')](_0x574fbd)[_0xfb7d('0x25')](handleEntityNotFound(_0x3fdf5d,null))['then'](respondWithResult(_0x3fdf5d,null))[_0xfb7d('0x43')](handleError(_0x3fdf5d,null));};exports[_0xfb7d('0x48')]=function(_0x2cd0e9,_0x204020){return db[_0xfb7d('0x29')]['create'](_0x2cd0e9[_0xfb7d('0x49')],{})[_0xfb7d('0x25')](respondWithResult(_0x204020,0xc9))[_0xfb7d('0x43')](handleError(_0x204020,null));};exports[_0xfb7d('0x24')]=function(_0x289430,_0x3ea386){if(_0x289430[_0xfb7d('0x49')]['id']){delete _0x289430[_0xfb7d('0x49')]['id'];}return db[_0xfb7d('0x29')][_0xfb7d('0x47')]({'where':{'id':_0x289430[_0xfb7d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ea386,null))[_0xfb7d('0x25')](saveUpdates(_0x289430['body'],null))[_0xfb7d('0x25')](respondWithResult(_0x3ea386,null))[_0xfb7d('0x43')](handleError(_0x3ea386,null));};exports[_0xfb7d('0x26')]=function(_0xa77345,_0x7a4eea){return db[_0xfb7d('0x29')][_0xfb7d('0x47')]({'where':{'id':_0xa77345[_0xfb7d('0x45')]['id']}})['then'](handleEntityNotFound(_0x7a4eea,null))['then'](removeEntity(_0x7a4eea,null))[_0xfb7d('0x43')](handleError(_0x7a4eea,null));}; \ No newline at end of file +var _0x75f0=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SalesforceField','include','findAll','rows','catch','show','includeAll','find','create','params','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x124486,_0x545c74){var _0x28455f=function(_0x11527b){while(--_0x11527b){_0x124486['push'](_0x124486['shift']());}};_0x28455f(++_0x545c74);}(_0x75f0,0xae));var _0x075f=function(_0x2904eb,_0x4f23a1){_0x2904eb=_0x2904eb-0x0;var _0x42bd3d=_0x75f0[_0x2904eb];return _0x42bd3d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x075f('0x0'));var jsonpatch=require(_0x075f('0x1'));var rp=require(_0x075f('0x2'));var moment=require(_0x075f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x075f('0x4'));var util=require(_0x075f('0x5'));var path=require('path');var sox=require(_0x075f('0x6'));var csv=require(_0x075f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x075f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x075f('0x9'));var toCsv=require(_0x075f('0x7'));var querystring=require(_0x075f('0xa'));var Papa=require(_0x075f('0xb'));var Redis=require(_0x075f('0xc'));var authService=require(_0x075f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x075f('0xe'));var hardwareService=require(_0x075f('0xf'));var logger=require('../../config/logger')(_0x075f('0x10'));var utils=require(_0x075f('0x11'));var config=require(_0x075f('0x12'));var licenseUtil=require(_0x075f('0x13'));var db=require(_0x075f('0x14'))['db'];function respondWithStatusCode(_0x4f4cce,_0x4aea81){_0x4aea81=_0x4aea81||0xcc;return function(_0x593574){if(_0x593574){return _0x4f4cce[_0x075f('0x15')](_0x4aea81);}return _0x4f4cce[_0x075f('0x16')](_0x4aea81)[_0x075f('0x17')]();};}function respondWithResult(_0x36162d,_0x2cc015){_0x2cc015=_0x2cc015||0xc8;return function(_0x450363){if(_0x450363){return _0x36162d['status'](_0x2cc015)[_0x075f('0x18')](_0x450363);}};}function respondWithFilteredResult(_0x40dbe3,_0x16f996){return function(_0x5d0024){if(_0x5d0024){var _0x142fe5=typeof _0x16f996[_0x075f('0x19')]===_0x075f('0x1a')&&typeof _0x16f996[_0x075f('0x1b')]===_0x075f('0x1a');var _0xac21e8=_0x5d0024[_0x075f('0x1c')];var _0x21903f=_0x142fe5?0x0:_0x16f996[_0x075f('0x19')];var _0x28174a=_0x142fe5?_0x5d0024[_0x075f('0x1c')]:_0x16f996[_0x075f('0x19')]+_0x16f996[_0x075f('0x1b')];var _0x3fb228;if(_0x28174a>=_0xac21e8){_0x28174a=_0xac21e8;_0x3fb228=0xc8;}else{_0x3fb228=0xce;}_0x40dbe3[_0x075f('0x16')](_0x3fb228);return _0x40dbe3[_0x075f('0x1d')](_0x075f('0x1e'),_0x21903f+'-'+_0x28174a+'/'+_0xac21e8)[_0x075f('0x18')](_0x5d0024);}return null;};}function patchUpdates(_0x1d6824){return function(_0xdeb455){try{jsonpatch[_0x075f('0x1f')](_0xdeb455,_0x1d6824,!![]);}catch(_0x54dd5b){return BPromise['reject'](_0x54dd5b);}return _0xdeb455[_0x075f('0x20')]();};}function saveUpdates(_0x2e4b82,_0x2a8e97){return function(_0xa506ea){if(_0xa506ea){return _0xa506ea[_0x075f('0x21')](_0x2e4b82)[_0x075f('0x22')](function(_0x52f060){return _0x52f060;});}return null;};}function removeEntity(_0xda3c03,_0x156d7d){return function(_0x345084){if(_0x345084){return _0x345084[_0x075f('0x23')]()['then'](function(){_0xda3c03[_0x075f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x400bef,_0x36833d){return function(_0x44dccf){if(!_0x44dccf){_0x400bef[_0x075f('0x15')](0x194);}return _0x44dccf;};}function handleError(_0x1bd238,_0x74630){_0x74630=_0x74630||0x1f4;return function(_0x3d8e1e){logger[_0x075f('0x24')](_0x3d8e1e[_0x075f('0x25')]);if(_0x3d8e1e[_0x075f('0x26')]){delete _0x3d8e1e[_0x075f('0x26')];}_0x1bd238[_0x075f('0x16')](_0x74630)[_0x075f('0x27')](_0x3d8e1e);};}exports[_0x075f('0x28')]=function(_0xd318fa,_0x2b5a4a){var _0x20a423={},_0x492447={},_0x141fa3={'count':0x0,'rows':[]};var _0x31ca9b=_[_0x075f('0x29')](db['SalesforceField'][_0x075f('0x2a')],function(_0x31e724){return{'name':_0x31e724[_0x075f('0x2b')],'type':_0x31e724[_0x075f('0x2c')][_0x075f('0x2d')]};});_0x492447[_0x075f('0x2e')]=_['map'](_0x31ca9b,_0x075f('0x26'));_0x492447[_0x075f('0x2f')]=_[_0x075f('0x30')](_0xd318fa[_0x075f('0x2f')]);_0x492447[_0x075f('0x31')]=_[_0x075f('0x32')](_0x492447[_0x075f('0x2e')],_0x492447[_0x075f('0x2f')]);_0x20a423['attributes']=_['intersection'](_0x492447[_0x075f('0x2e')],qs['fields'](_0xd318fa[_0x075f('0x2f')][_0x075f('0x33')]));_0x20a423[_0x075f('0x34')]=_0x20a423[_0x075f('0x34')][_0x075f('0x35')]?_0x20a423['attributes']:_0x492447[_0x075f('0x2e')];if(!_0xd318fa['query'][_0x075f('0x36')](_0x075f('0x37'))){_0x20a423['limit']=qs[_0x075f('0x1b')](_0xd318fa[_0x075f('0x2f')][_0x075f('0x1b')]);_0x20a423['offset']=qs[_0x075f('0x19')](_0xd318fa[_0x075f('0x2f')][_0x075f('0x19')]);}_0x20a423[_0x075f('0x38')]=qs[_0x075f('0x39')](_0xd318fa['query'][_0x075f('0x39')]);_0x20a423[_0x075f('0x3a')]=qs['filters'](_[_0x075f('0x3b')](_0xd318fa[_0x075f('0x2f')],_0x492447['filters']),_0x31ca9b);if(_0xd318fa['query']['filter']){_0x20a423[_0x075f('0x3a')]=_[_0x075f('0x3c')](_0x20a423['where'],{'$or':_['map'](_0x31ca9b,function(_0x2a0d56){if(_0x2a0d56[_0x075f('0x2c')]!==_0x075f('0x3d')){var _0x4b85bf={};_0x4b85bf[_0x2a0d56['name']]={'$like':'%'+_0xd318fa['query'][_0x075f('0x3e')]+'%'};return _0x4b85bf;}})});}_0x20a423=_[_0x075f('0x3c')]({},_0x20a423,_0xd318fa[_0x075f('0x3f')]);var _0x233afb={'where':_0x20a423[_0x075f('0x3a')]};return db[_0x075f('0x40')][_0x075f('0x1c')](_0x233afb)[_0x075f('0x22')](function(_0x4e5462){_0x141fa3[_0x075f('0x1c')]=_0x4e5462;if(_0xd318fa['query']['includeAll']){_0x20a423[_0x075f('0x41')]=[{'all':!![]}];}return db['SalesforceField'][_0x075f('0x42')](_0x20a423);})[_0x075f('0x22')](function(_0x3fa329){_0x141fa3[_0x075f('0x43')]=_0x3fa329;return _0x141fa3;})['then'](respondWithFilteredResult(_0x2b5a4a,_0x20a423))[_0x075f('0x44')](handleError(_0x2b5a4a,null));};exports[_0x075f('0x45')]=function(_0x5b0eca,_0xe8af62){var _0x4d9cb1={'raw':!![],'where':{'id':_0x5b0eca['params']['id']}},_0x59f267={};_0x59f267[_0x075f('0x2e')]=_[_0x075f('0x30')](db[_0x075f('0x40')][_0x075f('0x2a')]);_0x59f267['query']=_[_0x075f('0x30')](_0x5b0eca[_0x075f('0x2f')]);_0x59f267[_0x075f('0x31')]=_[_0x075f('0x32')](_0x59f267[_0x075f('0x2e')],_0x59f267[_0x075f('0x2f')]);_0x4d9cb1['attributes']=_[_0x075f('0x32')](_0x59f267[_0x075f('0x2e')],qs['fields'](_0x5b0eca[_0x075f('0x2f')][_0x075f('0x33')]));_0x4d9cb1[_0x075f('0x34')]=_0x4d9cb1[_0x075f('0x34')]['length']?_0x4d9cb1[_0x075f('0x34')]:_0x59f267[_0x075f('0x2e')];if(_0x5b0eca['query'][_0x075f('0x46')]){_0x4d9cb1[_0x075f('0x41')]=[{'all':!![]}];}_0x4d9cb1=_[_0x075f('0x3c')]({},_0x4d9cb1,_0x5b0eca[_0x075f('0x3f')]);return db[_0x075f('0x40')][_0x075f('0x47')](_0x4d9cb1)['then'](handleEntityNotFound(_0xe8af62,null))[_0x075f('0x22')](respondWithResult(_0xe8af62,null))[_0x075f('0x44')](handleError(_0xe8af62,null));};exports[_0x075f('0x48')]=function(_0x8bd21f,_0xb12961){return db['SalesforceField'][_0x075f('0x48')](_0x8bd21f['body'],{})[_0x075f('0x22')](respondWithResult(_0xb12961,0xc9))[_0x075f('0x44')](handleError(_0xb12961,null));};exports[_0x075f('0x21')]=function(_0x1dcadc,_0x3dc74d){if(_0x1dcadc['body']['id']){delete _0x1dcadc['body']['id'];}return db[_0x075f('0x40')][_0x075f('0x47')]({'where':{'id':_0x1dcadc[_0x075f('0x49')]['id']}})[_0x075f('0x22')](handleEntityNotFound(_0x3dc74d,null))['then'](saveUpdates(_0x1dcadc['body'],null))[_0x075f('0x22')](respondWithResult(_0x3dc74d,null))[_0x075f('0x44')](handleError(_0x3dc74d,null));};exports[_0x075f('0x23')]=function(_0x298f32,_0x108749){return db[_0x075f('0x40')]['find']({'where':{'id':_0x298f32[_0x075f('0x49')]['id']}})[_0x075f('0x22')](handleEntityNotFound(_0x108749,null))[_0x075f('0x22')](removeEntity(_0x108749,null))['catch'](handleError(_0x108749,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 74bfee7..0241bd7 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 _0xb7e8=['./intSalesforceField.attributes','define','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b7e12,_0x386b22){var _0x364e81=function(_0x57cabc){while(--_0x57cabc){_0x3b7e12['push'](_0x3b7e12['shift']());}};_0x364e81(++_0x386b22);}(_0xb7e8,0xbb));var _0x8b7e=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xb7e8[_0xcfc44];return _0x307a25;};'use strict';var _=require(_0x8b7e('0x0'));var util=require(_0x8b7e('0x1'));var logger=require(_0x8b7e('0x2'))(_0x8b7e('0x3'));var moment=require(_0x8b7e('0x4'));var BPromise=require(_0x8b7e('0x5'));var rp=require(_0x8b7e('0x6'));var fs=require('fs');var path=require(_0x8b7e('0x7'));var rimraf=require(_0x8b7e('0x8'));var config=require('../../config/environment');var attributes=require(_0x8b7e('0x9'));module['exports']=function(_0x254d7d,_0x14348c){return _0x254d7d[_0x8b7e('0xa')]('SalesforceField',attributes,{'tableName':_0x8b7e('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x8b7e('0xc'),_0x8b7e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd709=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','bluebird','request-promise','path'];(function(_0x56b4ba,_0x46fb4b){var _0x134229=function(_0xcc64b5){while(--_0xcc64b5){_0x56b4ba['push'](_0x56b4ba['shift']());}};_0x134229(++_0x46fb4b);}(_0xd709,0x81));var _0x9d70=function(_0x1be9f3,_0x5f3924){_0x1be9f3=_0x1be9f3-0x0;var _0x530593=_0xd709[_0x1be9f3];return _0x530593;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9d70('0x0'));var rp=require(_0x9d70('0x1'));var fs=require('fs');var path=require(_0x9d70('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d70('0x3'));module[_0x9d70('0x4')]=function(_0x266aff,_0x56728b){return _0x266aff[_0x9d70('0x5')](_0x9d70('0x6'),attributes,{'tableName':_0x9d70('0x7'),'paranoid':![],'indexes':[{'name':_0x9d70('0x8'),'fields':[_0x9d70('0x9'),_0x9d70('0xa')],'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 17a880f..098b167 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 _0x2a30=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x38568d,_0x4b5b3e){var _0x5556f1=function(_0x4ca361){while(--_0x4ca361){_0x38568d['push'](_0x38568d['shift']());}};_0x5556f1(++_0x4b5b3e);}(_0x2a30,0xdf));var _0x02a3=function(_0x256d5a,_0x229019){_0x256d5a=_0x256d5a-0x0;var _0x2105a9=_0x2a30[_0x256d5a];return _0x2105a9;};'use strict';var _=require(_0x02a3('0x0'));var util=require('util');var moment=require(_0x02a3('0x1'));var BPromise=require(_0x02a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02a3('0x3'));var db=require(_0x02a3('0x4'))['db'];var utils=require(_0x02a3('0x5'));var logger=require(_0x02a3('0x6'))(_0x02a3('0x7'));var config=require(_0x02a3('0x8'));var jayson=require(_0x02a3('0x9'));var client=jayson[_0x02a3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9557,_0x23e29b,_0x331f9b){return new BPromise(function(_0xbc99a,_0x370672){return client[_0x02a3('0xb')](_0x1b9557,_0x331f9b)[_0x02a3('0xc')](function(_0x54edf3){logger[_0x02a3('0xd')](_0x02a3('0xe'),_0x23e29b,'request\x20sent');logger[_0x02a3('0xf')](_0x02a3('0x10'),_0x23e29b,_0x02a3('0x11'),JSON[_0x02a3('0x12')](_0x54edf3));if(_0x54edf3[_0x02a3('0x13')]){if(_0x54edf3[_0x02a3('0x13')][_0x02a3('0x14')]===0x1f4){logger[_0x02a3('0x13')](_0x02a3('0xe'),_0x23e29b,_0x54edf3['error'][_0x02a3('0x15')]);return _0x370672(_0x54edf3[_0x02a3('0x13')][_0x02a3('0x15')]);}logger[_0x02a3('0x13')](_0x02a3('0xe'),_0x23e29b,_0x54edf3['error'][_0x02a3('0x15')]);return _0xbc99a(_0x54edf3[_0x02a3('0x13')][_0x02a3('0x15')]);}else{logger['info'](_0x02a3('0xe'),_0x23e29b,_0x02a3('0x11'));_0xbc99a(_0x54edf3[_0x02a3('0x16')][_0x02a3('0x15')]);}})[_0x02a3('0x17')](function(_0x3c1e80){logger[_0x02a3('0x13')](_0x02a3('0xe'),_0x23e29b,_0x3c1e80);_0x370672(_0x3c1e80);});});} \ No newline at end of file +var _0xb7ba=['error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x52e128,_0x42f4d0){var _0x5436cb=function(_0x1236a9){while(--_0x1236a9){_0x52e128['push'](_0x52e128['shift']());}};_0x5436cb(++_0x42f4d0);}(_0xb7ba,0xb9));var _0xab7b=function(_0x2d04a6,_0x5bbf0a){_0x2d04a6=_0x2d04a6-0x0;var _0x3cd00e=_0xb7ba[_0x2d04a6];return _0x3cd00e;};'use strict';var _=require(_0xab7b('0x0'));var util=require('util');var moment=require(_0xab7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xab7b('0x2'));var fs=require('fs');var Redis=require(_0xab7b('0x3'));var db=require(_0xab7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab7b('0x5'))(_0xab7b('0x6'));var config=require('../../config/environment');var jayson=require(_0xab7b('0x7'));var client=jayson[_0xab7b('0x8')][_0xab7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16ba31,_0x5772a0,_0x1f3583){return new BPromise(function(_0x2532a7,_0x35b8c7){return client[_0xab7b('0xa')](_0x16ba31,_0x1f3583)['then'](function(_0x3fd34d){logger['info'](_0xab7b('0xb'),_0x5772a0,_0xab7b('0xc'));logger[_0xab7b('0xd')](_0xab7b('0xe'),_0x5772a0,_0xab7b('0xc'),JSON['stringify'](_0x3fd34d));if(_0x3fd34d[_0xab7b('0xf')]){if(_0x3fd34d[_0xab7b('0xf')]['code']===0x1f4){logger['error'](_0xab7b('0xb'),_0x5772a0,_0x3fd34d[_0xab7b('0xf')][_0xab7b('0x10')]);return _0x35b8c7(_0x3fd34d[_0xab7b('0xf')]['message']);}logger[_0xab7b('0xf')]('SalesforceField,\x20%s,\x20%s',_0x5772a0,_0x3fd34d['error'][_0xab7b('0x10')]);return _0x2532a7(_0x3fd34d[_0xab7b('0xf')][_0xab7b('0x10')]);}else{logger[_0xab7b('0x11')]('SalesforceField,\x20%s,\x20%s',_0x5772a0,'request\x20sent');_0x2532a7(_0x3fd34d[_0xab7b('0x12')][_0xab7b('0x10')]);}})[_0xab7b('0x13')](function(_0xb3a58e){logger[_0xab7b('0xf')](_0xab7b('0xb'),_0x5772a0,_0xb3a58e);_0x35b8c7(_0xb3a58e);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f407328..286e3e8 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 _0xfca2=['index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x343dfb,_0xed8587){var _0x297fe2=function(_0x19cbbd){while(--_0x19cbbd){_0x343dfb['push'](_0x343dfb['shift']());}};_0x297fe2(++_0xed8587);}(_0xfca2,0x6d));var _0x2fca=function(_0x4a367f,_0x4e05f2){_0x4a367f=_0x4a367f-0x0;var _0x2bedd5=_0xfca2[_0x4a367f];return _0x2bedd5;};'use strict';var multer=require(_0x2fca('0x0'));var util=require('util');var path=require(_0x2fca('0x1'));var timeout=require(_0x2fca('0x2'));var express=require(_0x2fca('0x3'));var router=express[_0x2fca('0x4')]();var fs_extra=require(_0x2fca('0x5'));var auth=require(_0x2fca('0x6'));var interaction=require(_0x2fca('0x7'));var config=require(_0x2fca('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x2fca('0x9')]('/',auth[_0x2fca('0xa')](),controller[_0x2fca('0xb')]);router[_0x2fca('0x9')](_0x2fca('0xc'),auth['isAuthenticated'](),controller[_0x2fca('0xd')]);router[_0x2fca('0x9')]('/:id/configurations',auth[_0x2fca('0xa')](),controller[_0x2fca('0xe')]);router[_0x2fca('0x9')](_0x2fca('0xf'),auth['isAuthenticated'](),controller[_0x2fca('0x10')]);router[_0x2fca('0x11')]('/',auth[_0x2fca('0xa')](),controller[_0x2fca('0x12')]);router[_0x2fca('0x11')](_0x2fca('0x13'),auth[_0x2fca('0xa')](),controller[_0x2fca('0x14')]);router[_0x2fca('0x15')]('/:id',auth[_0x2fca('0xa')](),controller[_0x2fca('0x16')]);router['delete'](_0x2fca('0xc'),auth[_0x2fca('0xa')](),controller[_0x2fca('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6611=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6611,0xdd));var _0x1661=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6611[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x1661('0x0'));var path=require(_0x1661('0x1'));var timeout=require(_0x1661('0x2'));var express=require(_0x1661('0x3'));var router=express[_0x1661('0x4')]();var fs_extra=require(_0x1661('0x5'));var auth=require(_0x1661('0x6'));var interaction=require(_0x1661('0x7'));var config=require(_0x1661('0x8'));var controller=require(_0x1661('0x9'));router[_0x1661('0xa')]('/',auth[_0x1661('0xb')](),controller['index']);router['get'](_0x1661('0xc'),auth[_0x1661('0xb')](),controller['show']);router['get'](_0x1661('0xd'),auth[_0x1661('0xb')](),controller[_0x1661('0xe')]);router[_0x1661('0xa')](_0x1661('0xf'),auth[_0x1661('0xb')](),controller[_0x1661('0x10')]);router[_0x1661('0x11')]('/',auth['isAuthenticated'](),controller[_0x1661('0x12')]);router[_0x1661('0x11')]('/:id/configurations',auth[_0x1661('0xb')](),controller['addConfiguration']);router[_0x1661('0x13')](_0x1661('0xc'),auth[_0x1661('0xb')](),controller[_0x1661('0x14')]);router[_0x1661('0x15')](_0x1661('0xc'),auth[_0x1661('0xb')](),controller[_0x1661('0x16')]);module[_0x1661('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f08f9e8..031c02d 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 _0x204e=['STRING','username','remoteUri','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x204e,0xa3));var _0xe204=function(_0x5a05b1,_0x2659ed){_0x5a05b1=_0x5a05b1-0x0;var _0x20829a=_0x204e[_0x5a05b1];return _0x20829a;};'use strict';var Sequelize=require(_0xe204('0x0'));module[_0xe204('0x1')]={'name':{'type':Sequelize[_0xe204('0x2')]},'description':{'type':Sequelize[_0xe204('0x2')]},'username':{'type':Sequelize[_0xe204('0x2')],'unique':_0xe204('0x3')},'password':{'type':Sequelize[_0xe204('0x2')]},'email':{'type':Sequelize[_0xe204('0x2')]},'remoteUri':{'type':Sequelize[_0xe204('0x2')],'unique':_0xe204('0x4')},'serverUrl':{'type':Sequelize[_0xe204('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1e65=['username','sequelize','exports','STRING'];(function(_0x55187e,_0x5ca602){var _0x24c013=function(_0x210827){while(--_0x210827){_0x55187e['push'](_0x55187e['shift']());}};_0x24c013(++_0x5ca602);}(_0x1e65,0xed));var _0x51e6=function(_0x25daf1,_0x4f71a7){_0x25daf1=_0x25daf1-0x0;var _0x305a58=_0x1e65[_0x25daf1];return _0x305a58;};'use strict';var Sequelize=require(_0x51e6('0x0'));module[_0x51e6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x51e6('0x2')]},'username':{'type':Sequelize[_0x51e6('0x2')],'unique':_0x51e6('0x3')},'password':{'type':Sequelize[_0x51e6('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51e6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1a9a853..98757ec 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 _0x147b=['options','include','findAll','rows','catch','params','intersection','length','includeAll','find','create','body','destroy','getConfigurations','ServicenowConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','upon_reject','child_incidents','approval_history','number','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','business_duration','group_list','work_end','reopened_time','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','serverUrl','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','remove','internalType','label','all','assign','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','error','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','set','reject','save','update','then','status','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x147b,0x123));var _0xb147=function(_0x4b03f8,_0x1dd947){_0x4b03f8=_0x4b03f8-0x0;var _0x1be127=_0x147b[_0x4b03f8];return _0x1be127;};'use strict';var emlformat=require(_0xb147('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb147('0x1'));var jsonpatch=require(_0xb147('0x2'));var rp=require(_0xb147('0x3'));var moment=require(_0xb147('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb147('0x5'));var path=require('path');var sox=require(_0xb147('0x6'));var csv=require(_0xb147('0x7'));var ejs=require(_0xb147('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb147('0x9'));var squel=require(_0xb147('0xa'));var crypto=require(_0xb147('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb147('0xc'));var toCsv=require(_0xb147('0x7'));var querystring=require('querystring');var Papa=require(_0xb147('0xd'));var Redis=require('ioredis');var authService=require(_0xb147('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb147('0xf'));var hardwareService=require(_0xb147('0x10'));var logger=require(_0xb147('0x11'))(_0xb147('0x12'));var utils=require(_0xb147('0x13'));var config=require(_0xb147('0x14'));var licenseUtil=require(_0xb147('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb147('0x16'));function respondWithStatusCode(_0x54c2b7,_0x1c7507){_0x1c7507=_0x1c7507||0xcc;return function(_0x5380a0){if(_0x5380a0){return _0x54c2b7[_0xb147('0x17')](_0x1c7507);}return _0x54c2b7['status'](_0x1c7507)[_0xb147('0x18')]();};}function respondWithResult(_0x241463,_0x273aa6){_0x273aa6=_0x273aa6||0xc8;return function(_0x4f4f23){if(_0x4f4f23){return _0x241463['status'](_0x273aa6)[_0xb147('0x19')](_0x4f4f23);}};}function respondWithFilteredResult(_0x238566,_0x537743){return function(_0x3ea528){if(_0x3ea528){var _0x429e00=typeof _0x537743[_0xb147('0x1a')]===_0xb147('0x1b')&&typeof _0x537743[_0xb147('0x1c')]==='undefined';var _0x4d9768=_0x3ea528[_0xb147('0x1d')];var _0x2b128b=_0x429e00?0x0:_0x537743['offset'];var _0x6db215=_0x429e00?_0x3ea528[_0xb147('0x1d')]:_0x537743[_0xb147('0x1a')]+_0x537743[_0xb147('0x1c')];var _0x1521d2;if(_0x6db215>=_0x4d9768){_0x6db215=_0x4d9768;_0x1521d2=0xc8;}else{_0x1521d2=0xce;}_0x238566['status'](_0x1521d2);return _0x238566[_0xb147('0x1e')]('Content-Range',_0x2b128b+'-'+_0x6db215+'/'+_0x4d9768)[_0xb147('0x19')](_0x3ea528);}return null;};}function patchUpdates(_0x313d97){return function(_0x318c87){try{jsonpatch['apply'](_0x318c87,_0x313d97,!![]);}catch(_0x38717b){return BPromise[_0xb147('0x1f')](_0x38717b);}return _0x318c87[_0xb147('0x20')]();};}function saveUpdates(_0x380160,_0x588e5e){return function(_0x212180){if(_0x212180){return _0x212180[_0xb147('0x21')](_0x380160)[_0xb147('0x22')](function(_0x13da39){return _0x13da39;});}return null;};}function removeEntity(_0x4b7005,_0x5644bc){return function(_0x1f572e){if(_0x1f572e){return _0x1f572e['destroy']()[_0xb147('0x22')](function(){_0x4b7005[_0xb147('0x23')](0xcc)[_0xb147('0x18')]();});}};}function handleEntityNotFound(_0x5910e7,_0x5382bf){return function(_0x17c103){if(!_0x17c103){_0x5910e7[_0xb147('0x17')](0x194);}return _0x17c103;};}function handleError(_0x3b0b1f,_0x34e60f){_0x34e60f=_0x34e60f||0x1f4;return function(_0xa8cf65){logger['error'](_0xa8cf65[_0xb147('0x24')]);if(_0xa8cf65[_0xb147('0x25')]){delete _0xa8cf65[_0xb147('0x25')];}_0x3b0b1f[_0xb147('0x23')](_0x34e60f)[_0xb147('0x26')](_0xa8cf65);};}exports['index']=function(_0x145134,_0x41389d){var _0x2da859={},_0x5654e2={},_0x452335={'count':0x0,'rows':[]};var _0x20327c=_[_0xb147('0x27')](db[_0xb147('0x28')][_0xb147('0x29')],function(_0x46aacd){return{'name':_0x46aacd[_0xb147('0x2a')],'type':_0x46aacd['type']['key']};});_0x5654e2[_0xb147('0x2b')]=_['map'](_0x20327c,'name');_0x5654e2[_0xb147('0x2c')]=_[_0xb147('0x2d')](_0x145134[_0xb147('0x2c')]);_0x5654e2[_0xb147('0x2e')]=_['intersection'](_0x5654e2[_0xb147('0x2b')],_0x5654e2[_0xb147('0x2c')]);_0x2da859['attributes']=_['intersection'](_0x5654e2['model'],qs[_0xb147('0x2f')](_0x145134['query']['fields']));_0x2da859[_0xb147('0x30')]=_0x2da859[_0xb147('0x30')]['length']?_0x2da859[_0xb147('0x30')]:_0x5654e2[_0xb147('0x2b')];if(!_0x145134[_0xb147('0x2c')][_0xb147('0x31')]('nolimit')){_0x2da859['limit']=qs['limit'](_0x145134[_0xb147('0x2c')][_0xb147('0x1c')]);_0x2da859['offset']=qs[_0xb147('0x1a')](_0x145134[_0xb147('0x2c')]['offset']);}_0x2da859[_0xb147('0x32')]=qs[_0xb147('0x33')](_0x145134[_0xb147('0x2c')]['sort']);_0x2da859['where']=qs[_0xb147('0x2e')](_['pick'](_0x145134[_0xb147('0x2c')],_0x5654e2['filters']),_0x20327c);if(_0x145134['query'][_0xb147('0x34')]){_0x2da859[_0xb147('0x35')]=_[_0xb147('0x36')](_0x2da859[_0xb147('0x35')],{'$or':_[_0xb147('0x27')](_0x20327c,function(_0xa26a60){if(_0xa26a60[_0xb147('0x37')]!==_0xb147('0x38')){var _0x392c2d={};_0x392c2d[_0xa26a60[_0xb147('0x25')]]={'$like':'%'+_0x145134[_0xb147('0x2c')]['filter']+'%'};return _0x392c2d;}})});}_0x2da859=_[_0xb147('0x36')]({},_0x2da859,_0x145134[_0xb147('0x39')]);var _0x421ca8={'where':_0x2da859[_0xb147('0x35')]};return db[_0xb147('0x28')]['count'](_0x421ca8)[_0xb147('0x22')](function(_0x39ef2d){_0x452335[_0xb147('0x1d')]=_0x39ef2d;if(_0x145134['query']['includeAll']){_0x2da859[_0xb147('0x3a')]=[{'all':!![]}];}return db[_0xb147('0x28')][_0xb147('0x3b')](_0x2da859);})[_0xb147('0x22')](function(_0x42d45c){_0x452335[_0xb147('0x3c')]=_0x42d45c;return _0x452335;})[_0xb147('0x22')](respondWithFilteredResult(_0x41389d,_0x2da859))[_0xb147('0x3d')](handleError(_0x41389d,null));};exports['show']=function(_0x4a3944,_0x156776){var _0x1e30a4={'raw':![],'where':{'id':_0x4a3944[_0xb147('0x3e')]['id']}},_0x69110c={};_0x69110c[_0xb147('0x2b')]=_['keys'](db[_0xb147('0x28')][_0xb147('0x29')]);_0x69110c[_0xb147('0x2c')]=_[_0xb147('0x2d')](_0x4a3944[_0xb147('0x2c')]);_0x69110c['filters']=_['intersection'](_0x69110c[_0xb147('0x2b')],_0x69110c[_0xb147('0x2c')]);_0x1e30a4['attributes']=_[_0xb147('0x3f')](_0x69110c[_0xb147('0x2b')],qs[_0xb147('0x2f')](_0x4a3944[_0xb147('0x2c')]['fields']));_0x1e30a4[_0xb147('0x30')]=_0x1e30a4[_0xb147('0x30')][_0xb147('0x40')]?_0x1e30a4[_0xb147('0x30')]:_0x69110c[_0xb147('0x2b')];if(_0x4a3944[_0xb147('0x2c')][_0xb147('0x41')]){_0x1e30a4[_0xb147('0x3a')]=[{'all':!![]}];}_0x1e30a4=_['merge']({},_0x1e30a4,_0x4a3944['options']);return db[_0xb147('0x28')][_0xb147('0x42')](_0x1e30a4)[_0xb147('0x22')](handleEntityNotFound(_0x156776,null))[_0xb147('0x22')](respondWithResult(_0x156776,null))['catch'](handleError(_0x156776,null));};exports[_0xb147('0x43')]=function(_0x105e8b,_0x3abcf5){return db[_0xb147('0x28')][_0xb147('0x43')](_0x105e8b[_0xb147('0x44')],{})[_0xb147('0x22')](respondWithResult(_0x3abcf5,0xc9))[_0xb147('0x3d')](handleError(_0x3abcf5,null));};exports[_0xb147('0x21')]=function(_0x318816,_0x7817a1){if(_0x318816[_0xb147('0x44')]['id']){delete _0x318816[_0xb147('0x44')]['id'];}return db[_0xb147('0x28')]['find']({'where':{'id':_0x318816[_0xb147('0x3e')]['id']}})[_0xb147('0x22')](handleEntityNotFound(_0x7817a1,null))['then'](saveUpdates(_0x318816[_0xb147('0x44')],null))[_0xb147('0x22')](respondWithResult(_0x7817a1,null))[_0xb147('0x3d')](handleError(_0x7817a1,null));};exports[_0xb147('0x45')]=function(_0x5c6776,_0xc8d349){return db[_0xb147('0x28')][_0xb147('0x42')]({'where':{'id':_0x5c6776['params']['id']}})['then'](handleEntityNotFound(_0xc8d349,null))[_0xb147('0x22')](removeEntity(_0xc8d349,null))['catch'](handleError(_0xc8d349,null));};exports[_0xb147('0x46')]=function(_0x2afad7,_0xcc6831,_0x24f4e2){var _0x26b97a={};var _0xc4a745={};var _0x488719;var _0xf91d1d;return db[_0xb147('0x28')]['findOne']({'where':{'id':_0x2afad7[_0xb147('0x3e')]['id']}})[_0xb147('0x22')](handleEntityNotFound(_0xcc6831,null))[_0xb147('0x22')](function(_0x2a4675){if(_0x2a4675){_0x488719=_0x2a4675;_0xc4a745['model']=_['keys'](db[_0xb147('0x47')][_0xb147('0x29')]);_0xc4a745[_0xb147('0x2c')]=_[_0xb147('0x2d')](_0x2afad7[_0xb147('0x2c')]);_0xc4a745[_0xb147('0x2e')]=_[_0xb147('0x3f')](_0xc4a745[_0xb147('0x2b')],_0xc4a745[_0xb147('0x2c')]);_0x26b97a[_0xb147('0x30')]=_[_0xb147('0x3f')](_0xc4a745['model'],qs[_0xb147('0x2f')](_0x2afad7[_0xb147('0x2c')]['fields']));_0x26b97a[_0xb147('0x30')]=_0x26b97a['attributes']['length']?_0x26b97a['attributes']:_0xc4a745['model'];_0x26b97a[_0xb147('0x32')]=qs[_0xb147('0x33')](_0x2afad7[_0xb147('0x2c')][_0xb147('0x33')]);_0x26b97a[_0xb147('0x35')]=qs[_0xb147('0x2e')](_[_0xb147('0x48')](_0x2afad7['query'],_0xc4a745[_0xb147('0x2e')]));if(_0x2afad7[_0xb147('0x2c')][_0xb147('0x34')]){_0x26b97a[_0xb147('0x35')]=_[_0xb147('0x36')](_0x26b97a[_0xb147('0x35')],{'$or':_[_0xb147('0x27')](_0x26b97a[_0xb147('0x30')],function(_0x204e66){var _0x144ba6={};_0x144ba6[_0x204e66]={'$like':'%'+_0x2afad7['query'][_0xb147('0x34')]+'%'};return _0x144ba6;})});}_0x26b97a=_['merge']({},_0x26b97a,_0x2afad7[_0xb147('0x39')]);return _0x488719[_0xb147('0x46')](_0x26b97a);}})['then'](function(_0x5dce5b){if(_0x5dce5b){_0xf91d1d=_0x5dce5b[_0xb147('0x40')];if(!_0x2afad7[_0xb147('0x2c')]['hasOwnProperty']('nolimit')){_0x26b97a[_0xb147('0x1c')]=qs[_0xb147('0x1c')](_0x2afad7['query']['limit']);_0x26b97a['offset']=qs[_0xb147('0x1a')](_0x2afad7[_0xb147('0x2c')][_0xb147('0x1a')]);}return _0x488719[_0xb147('0x46')](_0x26b97a);}})[_0xb147('0x22')](function(_0x50f1ab){if(_0x50f1ab){return _0x50f1ab?{'count':_0xf91d1d,'rows':_0x50f1ab}:null;}})['then'](respondWithResult(_0xcc6831,null))[_0xb147('0x3d')](handleError(_0xcc6831,null));};exports[_0xb147('0x49')]=function(_0x38d281,_0x4e622f,_0x280f4d){if(_0x38d281[_0xb147('0x44')]['id']){delete _0x38d281[_0xb147('0x44')]['id'];}return db[_0xb147('0x28')][_0xb147('0x4a')]({'where':{'id':_0x38d281[_0xb147('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4e622f,null))[_0xb147('0x22')](function(_0x560716){if(_0x560716){_0x38d281[_0xb147('0x44')][_0xb147('0x4b')]=_0x560716['id'];_0x38d281[_0xb147('0x44')][_0xb147('0x4c')]=integrations[_0xb147('0x4d')](_0x38d281['body']['channel'],_0x38d281['body']['type']);_0x38d281[_0xb147('0x44')]['Descriptions']=integrations[_0xb147('0x4e')](_0x38d281[_0xb147('0x44')]['channel'],_0x38d281[_0xb147('0x44')][_0xb147('0x37')]);return db[_0xb147('0x47')][_0xb147('0x43')](_0x38d281[_0xb147('0x44')],{'include':[{'model':db[_0xb147('0x4f')],'as':_0xb147('0x4c')},{'model':db[_0xb147('0x4f')],'as':'Descriptions'}]});}return null;})[_0xb147('0x22')](respondWithResult(_0x4e622f,null))[_0xb147('0x3d')](handleError(_0x4e622f,null));};exports[_0xb147('0x50')]=function(_0x1642e0,_0x4e8d51,_0x549d67){var _0x57c0a5=[_0xb147('0x51'),_0xb147('0x52'),_0xb147('0x53'),_0xb147('0x54'),_0xb147('0x55'),_0xb147('0x56'),_0xb147('0x57'),'severity','category'];var _0x55b9d0=['parent','made_sla','caused_by','watch_list',_0xb147('0x58'),'sys_updated_on',_0xb147('0x59'),_0xb147('0x52'),_0xb147('0x5a'),_0xb147('0x5b'),'resolved_by','sys_updated_by',_0xb147('0x5c'),_0xb147('0x5d'),_0xb147('0x5e'),_0xb147('0x5f'),'state',_0xb147('0x60'),_0xb147('0x53'),_0xb147('0x32'),_0xb147('0x61'),_0xb147('0x62'),'cmdb_ci','delivery_plan',_0xb147('0x63'),_0xb147('0x64'),_0xb147('0x65'),_0xb147('0x66'),'priority',_0xb147('0x67'),_0xb147('0x68'),_0xb147('0x69'),'expected_start','opened_at',_0xb147('0x6a'),_0xb147('0x6b'),_0xb147('0x6c'),_0xb147('0x6d'),'resolved_at','caller_id','approval_set',_0xb147('0x54'),_0xb147('0x6e'),_0xb147('0x6f'),'close_code',_0xb147('0x70'),_0xb147('0x71'),_0xb147('0x72'),_0xb147('0x73'),_0xb147('0x74'),_0xb147('0x75'),_0xb147('0x76'),'calendar_duration',_0xb147('0x56'),_0xb147('0x77'),_0xb147('0x78'),'closed_by',_0xb147('0x79'),_0xb147('0x7a'),_0xb147('0x7b'),'contact_type',_0xb147('0x7c'),'incident_state',_0xb147('0x7d'),_0xb147('0x7e'),'company',_0xb147('0x7f'),_0xb147('0x80'),'assigned_to',_0xb147('0x81'),_0xb147('0x82'),'sla_due',_0xb147('0x83'),_0xb147('0x84'),_0xb147('0x85'),_0xb147('0x86'),_0xb147('0x87'),_0xb147('0x88'),_0xb147('0x89'),_0xb147('0x8a'),_0xb147('0x8b'),_0xb147('0x8c'),_0xb147('0x8d')];var _0x169443='';var _0xbdc4e0='';var _0x52c9eb=[];var _0x5e16fb='';var _0x36c218='';var _0x14d937=[];var _0x5f337a='';var _0x377205='';var _0x2db47e={};var _0x3e2f9a='';return db[_0xb147('0x28')][_0xb147('0x4a')]({'where':{'id':_0x1642e0[_0xb147('0x3e')]['id']},'attributes':['id',_0xb147('0x8e'),_0xb147('0x8f'),_0xb147('0x90'),_0xb147('0x91'),_0xb147('0x92')]})['then'](handleEntityNotFound(_0x4e8d51,null))[_0xb147('0x22')](function(_0x4f7219){if(_0x4f7219){_0x3e2f9a=_0x4f7219[_0xb147('0x91')];var _0x576798=_0x3e2f9a['slice'](-0x1);if(_0x576798==='/'){_0x3e2f9a=_0x3e2f9a['substring'](0x0,_0x3e2f9a['lastIndexOf'](_0x576798));}_0x377205=util[_0xb147('0x93')](_0xb147('0x94'),_0x3e2f9a);_0x5f337a=util['format']('%s/api/now/table/',_0x3e2f9a);_0x2db47e={'user':_0x4f7219[_0xb147('0x8e')],'pass':_0x4f7219['password']};var _0x6de701={'method':_0xb147('0x95'),'uri':_0x377205+_0xb147('0x96'),'auth':_0x2db47e,'json':!![]};return rp(_0x6de701);}})['then'](function(_0x2674da){if(_0x2674da['result'][_0xb147('0x40')]>0x0){_0x169443=_0x2674da[_0xb147('0x97')];}console[_0xb147('0x98')]('incident\x20table\x20objects',_0x169443);_0x14d937=[];_0xbdc4e0=Object['assign']([],_0x169443);_[_0xb147('0x99')](_0xbdc4e0,function(_0x1b815d){return!_0x57c0a5['includes'](_0x1b815d[_0xb147('0x25')]);});_0xbdc4e0['forEach'](function(_0x39856f){var _0x6a9350=createFieldObject(_0x5f337a,_0x2db47e,_0x39856f[_0xb147('0x9a')],_0x39856f[_0xb147('0x25')],_0x39856f[_0xb147('0x9b')],![]);_0x14d937['push'](_0x6a9350);});return Promise[_0xb147('0x9c')](_0x14d937);})['then'](function(_0x35d11d){_0x52c9eb=_0x35d11d;_0x5e16fb=Object[_0xb147('0x9d')]([],_0x169443);console[_0xb147('0x98')](_0xb147('0x9e'),_0x169443);_[_0xb147('0x99')](_0x5e16fb,function(_0x5bc81a){return _0x55b9d0[_0xb147('0x9f')](_0x5bc81a[_0xb147('0x25')]);});console['log'](_0xb147('0xa0'),_0x5e16fb);_0x14d937=[];_0x5e16fb['forEach'](function(_0x11f721){var _0xc00557=createFieldObject(_0x5f337a,_0x2db47e,_0x11f721['internalType'],_0x11f721['name'],_0x11f721[_0xb147('0x9b')],!![]);_0x14d937[_0xb147('0xa1')](_0xc00557);});return Promise[_0xb147('0x9c')](_0x14d937);})[_0xb147('0x22')](function(_0x7d633e){_0x36c218=_0x7d633e;var _0x2ab530=_0x52c9eb[_0xb147('0xa2')](_0x36c218);return{'count':_0x2ab530[_0xb147('0x40')],'rows':_0x2ab530};})[_0xb147('0x22')](respondWithResult(_0x4e8d51,null))['catch'](function(_0x32df6d){console[_0xb147('0x98')](_0xb147('0xa3')+_0x32df6d);var _0x1f8f31=_0x1642e0[_0xb147('0x2c')][_0xb147('0xa4')]?0x1f4:_0x32df6d['statusCode']||0x1f4;logger[_0xb147('0xa5')](_0x32df6d[_0xb147('0x24')]);delete _0x32df6d['name'];if(_0x1f8f31===0x191){_0x1f8f31=0x190;}_0x4e8d51[_0xb147('0x23')](_0x1f8f31)[_0xb147('0x26')](_0x1642e0[_0xb147('0x2c')][_0xb147('0xa4')]?{'message':_0xb147('0xa6'),'statusCode':_0x32df6d['statusCode']}:_0x32df6d);});};function createFieldObject(_0x48f12e,_0x127402,_0x33aeb4,_0x4a6bf9,_0x153bde,_0x353438){return new Promise(function(_0x1dbb20,_0x316f2c){var _0x5cd2d5={'id':_0x4a6bf9,'name':_0x153bde,'custom':_0x353438};if(_0x33aeb4===_0xb147('0xa7')){_0x5cd2d5[_0xb147('0x39')]=[{'name':_0xb147('0xa8'),'value':_0xb147('0xa9')},{'name':'False','value':_0xb147('0xaa')}];_0x1dbb20(_0x5cd2d5);}else{var _0x1c7acd={'method':_0xb147('0x95'),'uri':_0x48f12e+_0xb147('0xab')+_0x4a6bf9,'auth':_0x127402,'json':!![]};return rp(_0x1c7acd)[_0xb147('0x22')](function(_0x1d4176){var _0x4ab458=[];if(_0x1d4176[_0xb147('0x97')]['length']>0x0){_0x1d4176[_0xb147('0x97')]['forEach'](function(_0x1d6565){if(_0x1d6565[_0xb147('0xac')]===_0xb147('0xaa')){var _0x230102={'name':_0x1d6565[_0xb147('0x9b')],'value':_0x1d6565[_0xb147('0xad')]};_0x4ab458[_0xb147('0xa1')](_0x230102);}});}_0x5cd2d5[_0xb147('0x39')]=_0x4ab458;if(_0x5cd2d5[_0xb147('0x39')][_0xb147('0x40')]>0x0){_0x1dbb20(_0x5cd2d5);}else{if(_0x353438==![]){_0x1dbb20();}else{_0x1dbb20(_0x5cd2d5);}}});}});} \ No newline at end of file +var _0x2122=['update','then','destroy','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','length','create','body','find','getConfigurations','findOne','ServicenowConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ServicenowField','knowledge','subcategory','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','sys_updated_by','user_input','sys_created_on','state','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','close_code','correlation_display','delivery_task','work_start','assignment_group','description','calendar_duration','notify','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','company','reassignment_count','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','remove','includes','forEach','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x2122,0x91));var _0x2212=function(_0x55cc6a,_0x5dbd65){_0x55cc6a=_0x55cc6a-0x0;var _0x26e2cd=_0x2122[_0x55cc6a];return _0x26e2cd;};'use strict';var emlformat=require(_0x2212('0x0'));var rimraf=require(_0x2212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2212('0x2'));var moment=require(_0x2212('0x3'));var BPromise=require(_0x2212('0x4'));var Mustache=require(_0x2212('0x5'));var util=require('util');var path=require(_0x2212('0x6'));var sox=require(_0x2212('0x7'));var csv=require(_0x2212('0x8'));var ejs=require(_0x2212('0x9'));var fs=require('fs');var fs_extra=require(_0x2212('0xa'));var _=require(_0x2212('0xb'));var squel=require('squel');var crypto=require(_0x2212('0xc'));var jsforce=require(_0x2212('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2212('0xe'));var Papa=require(_0x2212('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2212('0x10'));var as=require(_0x2212('0x11'));var hardwareService=require(_0x2212('0x12'));var logger=require(_0x2212('0x13'))('api');var utils=require(_0x2212('0x14'));var config=require(_0x2212('0x15'));var licenseUtil=require(_0x2212('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2212('0x17'));function respondWithStatusCode(_0x424e36,_0xf6ca58){_0xf6ca58=_0xf6ca58||0xcc;return function(_0x2434ac){if(_0x2434ac){return _0x424e36['sendStatus'](_0xf6ca58);}return _0x424e36[_0x2212('0x18')](_0xf6ca58)[_0x2212('0x19')]();};}function respondWithResult(_0x242a65,_0x3be1ac){_0x3be1ac=_0x3be1ac||0xc8;return function(_0x5785f8){if(_0x5785f8){return _0x242a65[_0x2212('0x18')](_0x3be1ac)[_0x2212('0x1a')](_0x5785f8);}};}function respondWithFilteredResult(_0x5155ea,_0x3cbf71){return function(_0x4f49c5){if(_0x4f49c5){var _0x3a54f0=typeof _0x3cbf71[_0x2212('0x1b')]===_0x2212('0x1c')&&typeof _0x3cbf71[_0x2212('0x1d')]===_0x2212('0x1c');var _0x4a14e9=_0x4f49c5[_0x2212('0x1e')];var _0x9b905d=_0x3a54f0?0x0:_0x3cbf71[_0x2212('0x1b')];var _0x56698d=_0x3a54f0?_0x4f49c5[_0x2212('0x1e')]:_0x3cbf71['offset']+_0x3cbf71['limit'];var _0x198a9c;if(_0x56698d>=_0x4a14e9){_0x56698d=_0x4a14e9;_0x198a9c=0xc8;}else{_0x198a9c=0xce;}_0x5155ea[_0x2212('0x18')](_0x198a9c);return _0x5155ea[_0x2212('0x1f')](_0x2212('0x20'),_0x9b905d+'-'+_0x56698d+'/'+_0x4a14e9)['json'](_0x4f49c5);}return null;};}function patchUpdates(_0x262025){return function(_0x169fa1){try{jsonpatch[_0x2212('0x21')](_0x169fa1,_0x262025,!![]);}catch(_0x411fd6){return BPromise[_0x2212('0x22')](_0x411fd6);}return _0x169fa1[_0x2212('0x23')]();};}function saveUpdates(_0x2ed7ea,_0x3f07b2){return function(_0x59e74f){if(_0x59e74f){return _0x59e74f[_0x2212('0x24')](_0x2ed7ea)[_0x2212('0x25')](function(_0x3ca24a){return _0x3ca24a;});}return null;};}function removeEntity(_0x357f87,_0x59aa07){return function(_0x54ea6e){if(_0x54ea6e){return _0x54ea6e[_0x2212('0x26')]()[_0x2212('0x25')](function(){_0x357f87[_0x2212('0x18')](0xcc)[_0x2212('0x19')]();});}};}function handleEntityNotFound(_0x242363,_0xb053e4){return function(_0x51f36c){if(!_0x51f36c){_0x242363['sendStatus'](0x194);}return _0x51f36c;};}function handleError(_0x590c90,_0x44e177){_0x44e177=_0x44e177||0x1f4;return function(_0xe6f5dd){logger[_0x2212('0x27')](_0xe6f5dd[_0x2212('0x28')]);if(_0xe6f5dd[_0x2212('0x29')]){delete _0xe6f5dd[_0x2212('0x29')];}_0x590c90[_0x2212('0x18')](_0x44e177)[_0x2212('0x2a')](_0xe6f5dd);};}exports[_0x2212('0x2b')]=function(_0x29d8b1,_0x17deeb){var _0x434aa6={},_0x174f77={},_0x5777e2={'count':0x0,'rows':[]};var _0x2143e7=_['map'](db[_0x2212('0x2c')][_0x2212('0x2d')],function(_0x1c9837){return{'name':_0x1c9837[_0x2212('0x2e')],'type':_0x1c9837[_0x2212('0x2f')][_0x2212('0x30')]};});_0x174f77[_0x2212('0x31')]=_[_0x2212('0x32')](_0x2143e7,_0x2212('0x29'));_0x174f77[_0x2212('0x33')]=_[_0x2212('0x34')](_0x29d8b1[_0x2212('0x33')]);_0x174f77[_0x2212('0x35')]=_[_0x2212('0x36')](_0x174f77[_0x2212('0x31')],_0x174f77[_0x2212('0x33')]);_0x434aa6[_0x2212('0x37')]=_[_0x2212('0x36')](_0x174f77['model'],qs[_0x2212('0x38')](_0x29d8b1['query'][_0x2212('0x38')]));_0x434aa6[_0x2212('0x37')]=_0x434aa6[_0x2212('0x37')]['length']?_0x434aa6['attributes']:_0x174f77[_0x2212('0x31')];if(!_0x29d8b1[_0x2212('0x33')][_0x2212('0x39')](_0x2212('0x3a'))){_0x434aa6[_0x2212('0x1d')]=qs['limit'](_0x29d8b1[_0x2212('0x33')][_0x2212('0x1d')]);_0x434aa6[_0x2212('0x1b')]=qs['offset'](_0x29d8b1[_0x2212('0x33')][_0x2212('0x1b')]);}_0x434aa6[_0x2212('0x3b')]=qs[_0x2212('0x3c')](_0x29d8b1[_0x2212('0x33')][_0x2212('0x3c')]);_0x434aa6['where']=qs[_0x2212('0x35')](_[_0x2212('0x3d')](_0x29d8b1['query'],_0x174f77[_0x2212('0x35')]),_0x2143e7);if(_0x29d8b1[_0x2212('0x33')][_0x2212('0x3e')]){_0x434aa6['where']=_[_0x2212('0x3f')](_0x434aa6['where'],{'$or':_[_0x2212('0x32')](_0x2143e7,function(_0x1f2916){if(_0x1f2916[_0x2212('0x2f')]!==_0x2212('0x40')){var _0x5e9bd5={};_0x5e9bd5[_0x1f2916['name']]={'$like':'%'+_0x29d8b1[_0x2212('0x33')][_0x2212('0x3e')]+'%'};return _0x5e9bd5;}})});}_0x434aa6=_[_0x2212('0x3f')]({},_0x434aa6,_0x29d8b1[_0x2212('0x41')]);var _0x2a2c64={'where':_0x434aa6[_0x2212('0x42')]};return db[_0x2212('0x2c')][_0x2212('0x1e')](_0x2a2c64)[_0x2212('0x25')](function(_0x3b9013){_0x5777e2[_0x2212('0x1e')]=_0x3b9013;if(_0x29d8b1[_0x2212('0x33')][_0x2212('0x43')]){_0x434aa6[_0x2212('0x44')]=[{'all':!![]}];}return db[_0x2212('0x2c')][_0x2212('0x45')](_0x434aa6);})[_0x2212('0x25')](function(_0x5da28b){_0x5777e2[_0x2212('0x46')]=_0x5da28b;return _0x5777e2;})[_0x2212('0x25')](respondWithFilteredResult(_0x17deeb,_0x434aa6))[_0x2212('0x47')](handleError(_0x17deeb,null));};exports['show']=function(_0x783b0,_0x40e780){var _0x314f4d={'raw':![],'where':{'id':_0x783b0[_0x2212('0x48')]['id']}},_0x273263={};_0x273263[_0x2212('0x31')]=_[_0x2212('0x34')](db[_0x2212('0x2c')]['rawAttributes']);_0x273263[_0x2212('0x33')]=_['keys'](_0x783b0[_0x2212('0x33')]);_0x273263[_0x2212('0x35')]=_['intersection'](_0x273263['model'],_0x273263[_0x2212('0x33')]);_0x314f4d[_0x2212('0x37')]=_[_0x2212('0x36')](_0x273263[_0x2212('0x31')],qs['fields'](_0x783b0[_0x2212('0x33')][_0x2212('0x38')]));_0x314f4d[_0x2212('0x37')]=_0x314f4d[_0x2212('0x37')][_0x2212('0x49')]?_0x314f4d[_0x2212('0x37')]:_0x273263[_0x2212('0x31')];if(_0x783b0['query'][_0x2212('0x43')]){_0x314f4d[_0x2212('0x44')]=[{'all':!![]}];}_0x314f4d=_[_0x2212('0x3f')]({},_0x314f4d,_0x783b0[_0x2212('0x41')]);return db[_0x2212('0x2c')]['find'](_0x314f4d)[_0x2212('0x25')](handleEntityNotFound(_0x40e780,null))[_0x2212('0x25')](respondWithResult(_0x40e780,null))[_0x2212('0x47')](handleError(_0x40e780,null));};exports[_0x2212('0x4a')]=function(_0x450c79,_0x27cf11){return db[_0x2212('0x2c')]['create'](_0x450c79[_0x2212('0x4b')],{})[_0x2212('0x25')](respondWithResult(_0x27cf11,0xc9))[_0x2212('0x47')](handleError(_0x27cf11,null));};exports[_0x2212('0x24')]=function(_0x100b56,_0x47025a){if(_0x100b56[_0x2212('0x4b')]['id']){delete _0x100b56[_0x2212('0x4b')]['id'];}return db[_0x2212('0x2c')][_0x2212('0x4c')]({'where':{'id':_0x100b56['params']['id']}})[_0x2212('0x25')](handleEntityNotFound(_0x47025a,null))['then'](saveUpdates(_0x100b56[_0x2212('0x4b')],null))[_0x2212('0x25')](respondWithResult(_0x47025a,null))['catch'](handleError(_0x47025a,null));};exports['destroy']=function(_0x457e88,_0xe2efbf){return db[_0x2212('0x2c')][_0x2212('0x4c')]({'where':{'id':_0x457e88['params']['id']}})['then'](handleEntityNotFound(_0xe2efbf,null))[_0x2212('0x25')](removeEntity(_0xe2efbf,null))['catch'](handleError(_0xe2efbf,null));};exports[_0x2212('0x4d')]=function(_0x5a6e24,_0x5a32e5,_0x46d3f4){var _0x135a40={};var _0x38e056={};var _0x1859a6;var _0x4ee3b2;return db[_0x2212('0x2c')][_0x2212('0x4e')]({'where':{'id':_0x5a6e24['params']['id']}})[_0x2212('0x25')](handleEntityNotFound(_0x5a32e5,null))[_0x2212('0x25')](function(_0x4876c6){if(_0x4876c6){_0x1859a6=_0x4876c6;_0x38e056[_0x2212('0x31')]=_[_0x2212('0x34')](db[_0x2212('0x4f')][_0x2212('0x2d')]);_0x38e056[_0x2212('0x33')]=_[_0x2212('0x34')](_0x5a6e24[_0x2212('0x33')]);_0x38e056[_0x2212('0x35')]=_[_0x2212('0x36')](_0x38e056[_0x2212('0x31')],_0x38e056[_0x2212('0x33')]);_0x135a40['attributes']=_[_0x2212('0x36')](_0x38e056[_0x2212('0x31')],qs[_0x2212('0x38')](_0x5a6e24['query'][_0x2212('0x38')]));_0x135a40[_0x2212('0x37')]=_0x135a40['attributes'][_0x2212('0x49')]?_0x135a40['attributes']:_0x38e056[_0x2212('0x31')];_0x135a40['order']=qs[_0x2212('0x3c')](_0x5a6e24[_0x2212('0x33')][_0x2212('0x3c')]);_0x135a40[_0x2212('0x42')]=qs[_0x2212('0x35')](_[_0x2212('0x3d')](_0x5a6e24[_0x2212('0x33')],_0x38e056[_0x2212('0x35')]));if(_0x5a6e24[_0x2212('0x33')][_0x2212('0x3e')]){_0x135a40[_0x2212('0x42')]=_[_0x2212('0x3f')](_0x135a40[_0x2212('0x42')],{'$or':_[_0x2212('0x32')](_0x135a40[_0x2212('0x37')],function(_0x174c2f){var _0x3aae61={};_0x3aae61[_0x174c2f]={'$like':'%'+_0x5a6e24['query']['filter']+'%'};return _0x3aae61;})});}_0x135a40=_[_0x2212('0x3f')]({},_0x135a40,_0x5a6e24['options']);return _0x1859a6['getConfigurations'](_0x135a40);}})[_0x2212('0x25')](function(_0x2ce1fb){if(_0x2ce1fb){_0x4ee3b2=_0x2ce1fb[_0x2212('0x49')];if(!_0x5a6e24[_0x2212('0x33')][_0x2212('0x39')](_0x2212('0x3a'))){_0x135a40[_0x2212('0x1d')]=qs[_0x2212('0x1d')](_0x5a6e24['query'][_0x2212('0x1d')]);_0x135a40[_0x2212('0x1b')]=qs[_0x2212('0x1b')](_0x5a6e24[_0x2212('0x33')][_0x2212('0x1b')]);}return _0x1859a6[_0x2212('0x4d')](_0x135a40);}})[_0x2212('0x25')](function(_0x1ceb89){if(_0x1ceb89){return _0x1ceb89?{'count':_0x4ee3b2,'rows':_0x1ceb89}:null;}})[_0x2212('0x25')](respondWithResult(_0x5a32e5,null))[_0x2212('0x47')](handleError(_0x5a32e5,null));};exports['addConfiguration']=function(_0x1206d3,_0x3304a2,_0x426f66){if(_0x1206d3[_0x2212('0x4b')]['id']){delete _0x1206d3['body']['id'];}return db['ServicenowAccount'][_0x2212('0x4e')]({'where':{'id':_0x1206d3[_0x2212('0x48')]['id']}})[_0x2212('0x25')](handleEntityNotFound(_0x3304a2,null))[_0x2212('0x25')](function(_0x4aad6a){if(_0x4aad6a){_0x1206d3['body'][_0x2212('0x50')]=_0x4aad6a['id'];_0x1206d3['body'][_0x2212('0x51')]=integrations[_0x2212('0x52')](_0x1206d3[_0x2212('0x4b')]['channel'],_0x1206d3['body']['type']);_0x1206d3[_0x2212('0x4b')][_0x2212('0x53')]=integrations[_0x2212('0x54')](_0x1206d3[_0x2212('0x4b')]['channel'],_0x1206d3[_0x2212('0x4b')][_0x2212('0x2f')]);return db['ServicenowConfiguration']['create'](_0x1206d3['body'],{'include':[{'model':db['ServicenowField'],'as':_0x2212('0x51')},{'model':db[_0x2212('0x55')],'as':_0x2212('0x53')}]});}return null;})[_0x2212('0x25')](respondWithResult(_0x3304a2,null))[_0x2212('0x47')](handleError(_0x3304a2,null));};exports['getFields']=function(_0x36cb3d,_0x173273,_0x3c460d){var _0x399498=['made_sla','hold_reason',_0x2212('0x56'),_0x2212('0x57'),'close_code','notify',_0x2212('0x58'),_0x2212('0x59'),_0x2212('0x5a')];var _0x3127f6=[_0x2212('0x5b'),_0x2212('0x5c'),_0x2212('0x5d'),_0x2212('0x5e'),_0x2212('0x5f'),_0x2212('0x60'),_0x2212('0x61'),_0x2212('0x62'),_0x2212('0x63'),'number','resolved_by',_0x2212('0x64'),'opened_by',_0x2212('0x65'),_0x2212('0x66'),'sys_domain',_0x2212('0x67'),'sys_created_by',_0x2212('0x56'),'order','calendar_stc','closed_at',_0x2212('0x68'),_0x2212('0x69'),_0x2212('0x6a'),'active',_0x2212('0x6b'),_0x2212('0x6c'),_0x2212('0x6d'),'sys_domain_path','rfc',_0x2212('0x6e'),_0x2212('0x6f'),_0x2212('0x70'),_0x2212('0x71'),_0x2212('0x72'),_0x2212('0x73'),'reopened_time',_0x2212('0x74'),_0x2212('0x75'),_0x2212('0x76'),_0x2212('0x57'),_0x2212('0x77'),'short_description',_0x2212('0x78'),_0x2212('0x79'),_0x2212('0x7a'),_0x2212('0x7b'),_0x2212('0x7c'),'business_stc','additional_assignee_list',_0x2212('0x7d'),_0x2212('0x7e'),_0x2212('0x7f'),'sys_class_name',_0x2212('0x80'),_0x2212('0x81'),_0x2212('0x82'),_0x2212('0x83'),'sys_id',_0x2212('0x84'),_0x2212('0x85'),_0x2212('0x58'),_0x2212('0x86'),'problem_id',_0x2212('0x87'),_0x2212('0x88'),'activity_due',_0x2212('0x89'),_0x2212('0x59'),_0x2212('0x8a'),_0x2212('0x8b'),_0x2212('0x8c'),'comments_and_work_notes',_0x2212('0x8d'),_0x2212('0x8e'),_0x2212('0x8f'),_0x2212('0x90'),_0x2212('0x91'),_0x2212('0x92'),_0x2212('0x93'),_0x2212('0x94'),'category'];var _0x59d82f='';var _0x1c361a='';var _0x8c0f28=[];var _0xe7cae9='';var _0x240d40='';var _0x47911e=[];var _0xd82f01='';var _0x11023d='';var _0x562867={};var _0x260f6e='';return db[_0x2212('0x2c')][_0x2212('0x4e')]({'where':{'id':_0x36cb3d[_0x2212('0x48')]['id']},'attributes':['id',_0x2212('0x95'),_0x2212('0x96'),_0x2212('0x97'),_0x2212('0x98'),'serverUrl']})[_0x2212('0x25')](handleEntityNotFound(_0x173273,null))[_0x2212('0x25')](function(_0x6ced48){if(_0x6ced48){_0x260f6e=_0x6ced48[_0x2212('0x98')];var _0x21d2fa=_0x260f6e[_0x2212('0x99')](-0x1);if(_0x21d2fa==='/'){_0x260f6e=_0x260f6e['substring'](0x0,_0x260f6e['lastIndexOf'](_0x21d2fa));}_0x11023d=util[_0x2212('0x9a')]('%s/api/now/doc/table/schema/',_0x260f6e);_0xd82f01=util[_0x2212('0x9a')](_0x2212('0x9b'),_0x260f6e);_0x562867={'user':_0x6ced48['username'],'pass':_0x6ced48[_0x2212('0x96')]};var _0x229a63={'method':'GET','uri':_0x11023d+_0x2212('0x9c'),'auth':_0x562867,'json':!![]};return rp(_0x229a63);}})['then'](function(_0x5d23f1){if(_0x5d23f1[_0x2212('0x9d')]['length']>0x0){_0x59d82f=_0x5d23f1['result'];}console[_0x2212('0x9e')]('incident\x20table\x20objects',_0x59d82f);_0x47911e=[];_0x1c361a=Object['assign']([],_0x59d82f);_[_0x2212('0x9f')](_0x1c361a,function(_0x36ab52){return!_0x399498[_0x2212('0xa0')](_0x36ab52[_0x2212('0x29')]);});_0x1c361a[_0x2212('0xa1')](function(_0x1cbc0b){var _0x4c799e=createFieldObject(_0xd82f01,_0x562867,_0x1cbc0b['internalType'],_0x1cbc0b[_0x2212('0x29')],_0x1cbc0b[_0x2212('0xa2')],![]);_0x47911e[_0x2212('0xa3')](_0x4c799e);});return Promise[_0x2212('0xa4')](_0x47911e);})['then'](function(_0x3fe5f8){_0x8c0f28=_0x3fe5f8;_0xe7cae9=Object[_0x2212('0xa5')]([],_0x59d82f);console[_0x2212('0x9e')](_0x2212('0xa6'),_0x59d82f);_['remove'](_0xe7cae9,function(_0x547a36){return _0x3127f6[_0x2212('0xa0')](_0x547a36[_0x2212('0x29')]);});console[_0x2212('0x9e')](_0x2212('0xa7'),_0xe7cae9);_0x47911e=[];_0xe7cae9[_0x2212('0xa1')](function(_0x1062de){var _0x297692=createFieldObject(_0xd82f01,_0x562867,_0x1062de[_0x2212('0xa8')],_0x1062de[_0x2212('0x29')],_0x1062de[_0x2212('0xa2')],!![]);_0x47911e[_0x2212('0xa3')](_0x297692);});return Promise[_0x2212('0xa4')](_0x47911e);})['then'](function(_0x501518){_0x240d40=_0x501518;var _0xf3e285=_0x8c0f28[_0x2212('0xa9')](_0x240d40);return{'count':_0xf3e285['length'],'rows':_0xf3e285};})[_0x2212('0x25')](respondWithResult(_0x173273,null))[_0x2212('0x47')](function(_0x47f0eb){console[_0x2212('0x9e')](_0x2212('0xaa')+_0x47f0eb);var _0x17b011=_0x36cb3d[_0x2212('0x33')][_0x2212('0xab')]?0x1f4:_0x47f0eb[_0x2212('0xac')]||0x1f4;logger[_0x2212('0x27')](_0x47f0eb['stack']);delete _0x47f0eb[_0x2212('0x29')];if(_0x17b011===0x191){_0x17b011=0x190;}_0x173273[_0x2212('0x18')](_0x17b011)[_0x2212('0x2a')](_0x36cb3d[_0x2212('0x33')][_0x2212('0xab')]?{'message':_0x2212('0xad'),'statusCode':_0x47f0eb[_0x2212('0xac')]}:_0x47f0eb);});};function createFieldObject(_0x20852f,_0xfc6884,_0x487d12,_0x38f139,_0x36f354,_0x41627a){return new Promise(function(_0x300bf0,_0x297af4){var _0x4758df={'id':_0x38f139,'name':_0x36f354,'custom':_0x41627a};if(_0x487d12===_0x2212('0xae')){_0x4758df[_0x2212('0x41')]=[{'name':'True','value':_0x2212('0xaf')},{'name':_0x2212('0xb0'),'value':'false'}];_0x300bf0(_0x4758df);}else{var _0xda20ae={'method':_0x2212('0xb1'),'uri':_0x20852f+_0x2212('0xb2')+_0x38f139,'auth':_0xfc6884,'json':!![]};return rp(_0xda20ae)[_0x2212('0x25')](function(_0x59905e){var _0xa0e230=[];if(_0x59905e[_0x2212('0x9d')][_0x2212('0x49')]>0x0){_0x59905e[_0x2212('0x9d')][_0x2212('0xa1')](function(_0x5ae2ff){if(_0x5ae2ff[_0x2212('0xb3')]===_0x2212('0xb4')){var _0x7b1bde={'name':_0x5ae2ff[_0x2212('0xa2')],'value':_0x5ae2ff['value']};_0xa0e230[_0x2212('0xa3')](_0x7b1bde);}});}_0x4758df['options']=_0xa0e230;if(_0x4758df[_0x2212('0x41')][_0x2212('0x49')]>0x0){_0x300bf0(_0x4758df);}else{if(_0x41627a==![]){_0x300bf0();}else{_0x300bf0(_0x4758df);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 0ac0995..0672e61 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x377743,_0x584cab){var _0x30ae30=function(_0x5dde9b){while(--_0x5dde9b){_0x377743['push'](_0x377743['shift']());}};_0x30ae30(++_0x584cab);}(_0x1cb9,0x14e));var _0x91cb=function(_0xe262ad,_0x25b149){_0xe262ad=_0xe262ad-0x0;var _0x1b211a=_0x1cb9[_0xe262ad];return _0x1b211a;};'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'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x21803e,_0x5a4782){var _0x349188=function(_0x3f5862){while(--_0x3f5862){_0x21803e['push'](_0x21803e['shift']());}};_0x349188(++_0x5a4782);}(_0x4c60,0xc1));var _0x04c6=function(_0x32e934,_0x5af9d8){_0x32e934=_0x32e934-0x0;var _0x47be44=_0x4c60[_0x32e934];return _0x47be44;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','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 15574ac..3b3fb7c 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 _0xea88=['model','map','then','debug','ShowServicenowAccount','find','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','ServicenowAccount','raw','options','where','attributes','limit','include'];(function(_0x1104d0,_0x301b4b){var _0x491cae=function(_0x3a7fd6){while(--_0x3a7fd6){_0x1104d0['push'](_0x1104d0['shift']());}};_0x491cae(++_0x301b4b);}(_0xea88,0x10e));var _0x8ea8=function(_0x2d68ba,_0x368442){_0x2d68ba=_0x2d68ba-0x0;var _0x557eab=_0xea88[_0x2d68ba];return _0x557eab;};'use strict';var _=require(_0x8ea8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ea8('0x1'));var fs=require('fs');var Redis=require(_0x8ea8('0x2'));var db=require(_0x8ea8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ea8('0x4'))(_0x8ea8('0x5'));var config=require('../../config/environment');var jayson=require(_0x8ea8('0x6'));var client=jayson[_0x8ea8('0x7')][_0x8ea8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55d59f,_0x5a0ea0,_0x2e4c31){return new BPromise(function(_0x26dceb,_0x36635d){return client[_0x8ea8('0x9')](_0x55d59f,_0x2e4c31)['then'](function(_0x3959f0){logger[_0x8ea8('0xa')](_0x8ea8('0xb'),_0x5a0ea0,_0x8ea8('0xc'));logger['debug'](_0x8ea8('0xd'),_0x5a0ea0,_0x8ea8('0xc'),JSON[_0x8ea8('0xe')](_0x3959f0));if(_0x3959f0[_0x8ea8('0xf')]){if(_0x3959f0[_0x8ea8('0xf')][_0x8ea8('0x10')]===0x1f4){logger[_0x8ea8('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x5a0ea0,_0x3959f0[_0x8ea8('0xf')][_0x8ea8('0x11')]);return _0x36635d(_0x3959f0[_0x8ea8('0xf')]['message']);}logger[_0x8ea8('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x5a0ea0,_0x3959f0['error'][_0x8ea8('0x11')]);return _0x26dceb(_0x3959f0[_0x8ea8('0xf')][_0x8ea8('0x11')]);}else{logger[_0x8ea8('0xa')](_0x8ea8('0xb'),_0x5a0ea0,'request\x20sent');_0x26dceb(_0x3959f0[_0x8ea8('0x12')][_0x8ea8('0x11')]);}})['catch'](function(_0x1a547a){logger[_0x8ea8('0xf')](_0x8ea8('0xb'),_0x5a0ea0,_0x1a547a);_0x36635d(_0x1a547a);});});}exports[_0x8ea8('0x13')]=function(_0x2033ff){var _0x35c622=this;return new Promise(function(_0x373411,_0x55c17e){return db[_0x8ea8('0x14')]['findAll']({'raw':_0x2033ff['options']?_0x2033ff['options'][_0x8ea8('0x15')]===undefined?!![]:![]:!![],'where':_0x2033ff[_0x8ea8('0x16')]?_0x2033ff[_0x8ea8('0x16')][_0x8ea8('0x17')]||null:null,'attributes':_0x2033ff['options']?_0x2033ff['options'][_0x8ea8('0x18')]||null:null,'limit':_0x2033ff[_0x8ea8('0x16')]?_0x2033ff[_0x8ea8('0x16')][_0x8ea8('0x19')]||null:null,'include':_0x2033ff['options']?_0x2033ff[_0x8ea8('0x16')][_0x8ea8('0x1a')]?_['map'](_0x2033ff[_0x8ea8('0x16')][_0x8ea8('0x1a')],function(_0x5d5665){return{'model':db[_0x5d5665[_0x8ea8('0x1b')]],'as':_0x5d5665['as'],'attributes':_0x5d5665['attributes'],'include':_0x5d5665[_0x8ea8('0x1a')]?_['map'](_0x5d5665['include'],function(_0x47318f){return{'model':db[_0x47318f['model']],'as':_0x47318f['as'],'attributes':_0x47318f[_0x8ea8('0x18')],'include':_0x47318f[_0x8ea8('0x1a')]?_[_0x8ea8('0x1c')](_0x47318f['include'],function(_0x4148b7){return{'model':db[_0x4148b7[_0x8ea8('0x1b')]],'as':_0x4148b7['as'],'attributes':_0x4148b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ea8('0x1d')](function(_0x14d0eb){logger[_0x8ea8('0xa')]('GetServicenowAccount',_0x2033ff);logger[_0x8ea8('0x1e')](_0x8ea8('0x13'),_0x2033ff,JSON[_0x8ea8('0xe')](_0x14d0eb));_0x373411(_0x14d0eb);})['catch'](function(_0x41fbc9){logger['error'](_0x8ea8('0x13'),_0x41fbc9[_0x8ea8('0x11')],_0x2033ff);_0x55c17e(_0x35c622[_0x8ea8('0xf')](0x1f4,_0x41fbc9[_0x8ea8('0x11')]));});});};exports[_0x8ea8('0x1f')]=function(_0x366857){var _0x526107=this;return new Promise(function(_0xf559f4,_0x536908){return db[_0x8ea8('0x14')][_0x8ea8('0x20')]({'raw':_0x366857['options']?_0x366857[_0x8ea8('0x16')][_0x8ea8('0x15')]===undefined?!![]:![]:!![],'where':_0x366857[_0x8ea8('0x16')]?_0x366857['options']['where']||null:null,'attributes':_0x366857[_0x8ea8('0x16')]?_0x366857[_0x8ea8('0x16')]['attributes']||null:null,'include':_0x366857[_0x8ea8('0x16')]?_0x366857['options'][_0x8ea8('0x1a')]?_['map'](_0x366857['options'][_0x8ea8('0x1a')],function(_0x2196bd){return{'model':db[_0x2196bd[_0x8ea8('0x1b')]],'as':_0x2196bd['as'],'attributes':_0x2196bd[_0x8ea8('0x18')],'include':_0x2196bd[_0x8ea8('0x1a')]?_[_0x8ea8('0x1c')](_0x2196bd[_0x8ea8('0x1a')],function(_0x5753bf){return{'model':db[_0x5753bf[_0x8ea8('0x1b')]],'as':_0x5753bf['as'],'attributes':_0x5753bf['attributes'],'include':_0x5753bf[_0x8ea8('0x1a')]?_[_0x8ea8('0x1c')](_0x5753bf[_0x8ea8('0x1a')],function(_0xaf780){return{'model':db[_0xaf780[_0x8ea8('0x1b')]],'as':_0xaf780['as'],'attributes':_0xaf780['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ea8('0x1d')](function(_0x1429cc){logger[_0x8ea8('0xa')]('ShowServicenowAccount',_0x366857);logger[_0x8ea8('0x1e')]('ShowServicenowAccount',_0x366857,JSON[_0x8ea8('0xe')](_0x1429cc));_0xf559f4(_0x1429cc);})['catch'](function(_0x3cad75){logger[_0x8ea8('0xf')](_0x8ea8('0x1f'),_0x3cad75[_0x8ea8('0x11')],_0x366857);_0x536908(_0x526107[_0x8ea8('0xf')](0x1f4,_0x3cad75[_0x8ea8('0x11')]));});});}; \ No newline at end of file +var _0xa938=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','ServicenowAccount'];(function(_0x2adf9b,_0xa3921d){var _0x3f7bdb=function(_0x15205e){while(--_0x15205e){_0x2adf9b['push'](_0x2adf9b['shift']());}};_0x3f7bdb(++_0xa3921d);}(_0xa938,0x1ea));var _0x8a93=function(_0x29df86,_0x4422e7){_0x29df86=_0x29df86-0x0;var _0x3cb9fe=_0xa938[_0x29df86];return _0x3cb9fe;};'use strict';var _=require(_0x8a93('0x0'));var util=require('util');var moment=require(_0x8a93('0x1'));var BPromise=require(_0x8a93('0x2'));var rs=require(_0x8a93('0x3'));var fs=require('fs');var Redis=require(_0x8a93('0x4'));var db=require(_0x8a93('0x5'))['db'];var utils=require(_0x8a93('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a93('0x7'));var jayson=require(_0x8a93('0x8'));var client=jayson[_0x8a93('0x9')][_0x8a93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56feec,_0x1b2570,_0x43d62c){return new BPromise(function(_0x3866a2,_0x17bf2a){return client[_0x8a93('0xb')](_0x56feec,_0x43d62c)[_0x8a93('0xc')](function(_0x3cc46d){logger[_0x8a93('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1b2570,'request\x20sent');logger[_0x8a93('0xe')](_0x8a93('0xf'),_0x1b2570,_0x8a93('0x10'),JSON[_0x8a93('0x11')](_0x3cc46d));if(_0x3cc46d['error']){if(_0x3cc46d[_0x8a93('0x12')][_0x8a93('0x13')]===0x1f4){logger['error'](_0x8a93('0x14'),_0x1b2570,_0x3cc46d[_0x8a93('0x12')][_0x8a93('0x15')]);return _0x17bf2a(_0x3cc46d[_0x8a93('0x12')]['message']);}logger['error'](_0x8a93('0x14'),_0x1b2570,_0x3cc46d[_0x8a93('0x12')][_0x8a93('0x15')]);return _0x3866a2(_0x3cc46d['error']['message']);}else{logger[_0x8a93('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1b2570,_0x8a93('0x10'));_0x3866a2(_0x3cc46d['result']['message']);}})[_0x8a93('0x16')](function(_0x4e5712){logger['error'](_0x8a93('0x14'),_0x1b2570,_0x4e5712);_0x17bf2a(_0x4e5712);});});}exports[_0x8a93('0x17')]=function(_0x5251d9){var _0x3edf5f=this;return new Promise(function(_0x5de4a5,_0x15444c){return db['ServicenowAccount'][_0x8a93('0x18')]({'raw':_0x5251d9['options']?_0x5251d9[_0x8a93('0x19')][_0x8a93('0x1a')]===undefined?!![]:![]:!![],'where':_0x5251d9['options']?_0x5251d9[_0x8a93('0x19')][_0x8a93('0x1b')]||null:null,'attributes':_0x5251d9[_0x8a93('0x19')]?_0x5251d9[_0x8a93('0x19')][_0x8a93('0x1c')]||null:null,'limit':_0x5251d9['options']?_0x5251d9['options'][_0x8a93('0x1d')]||null:null,'include':_0x5251d9[_0x8a93('0x19')]?_0x5251d9[_0x8a93('0x19')][_0x8a93('0x1e')]?_[_0x8a93('0x1f')](_0x5251d9[_0x8a93('0x19')][_0x8a93('0x1e')],function(_0x59c1c9){return{'model':db[_0x59c1c9['model']],'as':_0x59c1c9['as'],'attributes':_0x59c1c9[_0x8a93('0x1c')],'include':_0x59c1c9[_0x8a93('0x1e')]?_[_0x8a93('0x1f')](_0x59c1c9[_0x8a93('0x1e')],function(_0x449b19){return{'model':db[_0x449b19[_0x8a93('0x20')]],'as':_0x449b19['as'],'attributes':_0x449b19['attributes'],'include':_0x449b19[_0x8a93('0x1e')]?_[_0x8a93('0x1f')](_0x449b19[_0x8a93('0x1e')],function(_0x122396){return{'model':db[_0x122396[_0x8a93('0x20')]],'as':_0x122396['as'],'attributes':_0x122396['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a93('0xc')](function(_0x2435b1){logger[_0x8a93('0xd')](_0x8a93('0x17'),_0x5251d9);logger[_0x8a93('0xe')]('GetServicenowAccount',_0x5251d9,JSON[_0x8a93('0x11')](_0x2435b1));_0x5de4a5(_0x2435b1);})[_0x8a93('0x16')](function(_0x4eafc0){logger[_0x8a93('0x12')](_0x8a93('0x17'),_0x4eafc0[_0x8a93('0x15')],_0x5251d9);_0x15444c(_0x3edf5f[_0x8a93('0x12')](0x1f4,_0x4eafc0[_0x8a93('0x15')]));});});};exports[_0x8a93('0x21')]=function(_0x301b3e){var _0x28bedf=this;return new Promise(function(_0x112935,_0x2f0e06){return db[_0x8a93('0x22')]['find']({'raw':_0x301b3e['options']?_0x301b3e[_0x8a93('0x19')][_0x8a93('0x1a')]===undefined?!![]:![]:!![],'where':_0x301b3e[_0x8a93('0x19')]?_0x301b3e['options'][_0x8a93('0x1b')]||null:null,'attributes':_0x301b3e['options']?_0x301b3e[_0x8a93('0x19')][_0x8a93('0x1c')]||null:null,'include':_0x301b3e['options']?_0x301b3e[_0x8a93('0x19')][_0x8a93('0x1e')]?_[_0x8a93('0x1f')](_0x301b3e[_0x8a93('0x19')][_0x8a93('0x1e')],function(_0x52b42d){return{'model':db[_0x52b42d[_0x8a93('0x20')]],'as':_0x52b42d['as'],'attributes':_0x52b42d['attributes'],'include':_0x52b42d[_0x8a93('0x1e')]?_[_0x8a93('0x1f')](_0x52b42d[_0x8a93('0x1e')],function(_0x5dd775){return{'model':db[_0x5dd775[_0x8a93('0x20')]],'as':_0x5dd775['as'],'attributes':_0x5dd775[_0x8a93('0x1c')],'include':_0x5dd775[_0x8a93('0x1e')]?_[_0x8a93('0x1f')](_0x5dd775[_0x8a93('0x1e')],function(_0x305b36){return{'model':db[_0x305b36['model']],'as':_0x305b36['as'],'attributes':_0x305b36[_0x8a93('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8a93('0xc')](function(_0xddd7a){logger[_0x8a93('0xd')](_0x8a93('0x21'),_0x301b3e);logger[_0x8a93('0xe')](_0x8a93('0x21'),_0x301b3e,JSON['stringify'](_0xddd7a));_0x112935(_0xddd7a);})['catch'](function(_0x23c535){logger[_0x8a93('0x12')](_0x8a93('0x21'),_0x23c535[_0x8a93('0x15')],_0x301b3e);_0x2f0e06(_0x28bedf[_0x8a93('0x12')](0x1f4,_0x23c535[_0x8a93('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index a741bc7..4f7649a 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 _0xe5ec=['/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x2074b3,_0x54589c){var _0x3529e7=function(_0xfbe935){while(--_0xfbe935){_0x2074b3['push'](_0x2074b3['shift']());}};_0x3529e7(++_0x54589c);}(_0xe5ec,0xf1));var _0xce5e=function(_0x552a73,_0x33d304){_0x552a73=_0x552a73-0x0;var _0x46d8bf=_0xe5ec[_0x552a73];return _0x46d8bf;};'use strict';var multer=require(_0xce5e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xce5e('0x1'));var express=require(_0xce5e('0x2'));var router=express[_0xce5e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xce5e('0x4'));var interaction=require(_0xce5e('0x5'));var config=require(_0xce5e('0x6'));var controller=require(_0xce5e('0x7'));router[_0xce5e('0x8')]('/',auth[_0xce5e('0x9')](),controller[_0xce5e('0xa')]);router[_0xce5e('0x8')]('/:id',auth[_0xce5e('0x9')](),controller[_0xce5e('0xb')]);router[_0xce5e('0x8')](_0xce5e('0xc'),auth[_0xce5e('0x9')](),controller['getFields']);router[_0xce5e('0x8')](_0xce5e('0xd'),auth[_0xce5e('0x9')](),controller[_0xce5e('0xe')]);router['get']('/:id/descriptions',auth[_0xce5e('0x9')](),controller[_0xce5e('0xf')]);router[_0xce5e('0x10')]('/',auth[_0xce5e('0x9')](),controller[_0xce5e('0x11')]);router[_0xce5e('0x12')](_0xce5e('0x13'),auth[_0xce5e('0x9')](),controller['update']);router[_0xce5e('0x14')](_0xce5e('0x13'),auth[_0xce5e('0x9')](),controller[_0xce5e('0x15')]);module[_0xce5e('0x16')]=router; \ No newline at end of file +var _0x9422=['put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','create'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x9422,0x14f));var _0x2942=function(_0x39112a,_0xb92ce6){_0x39112a=_0x39112a-0x0;var _0x26ef70=_0x9422[_0x39112a];return _0x26ef70;};'use strict';var multer=require(_0x2942('0x0'));var util=require(_0x2942('0x1'));var path=require(_0x2942('0x2'));var timeout=require('connect-timeout');var express=require(_0x2942('0x3'));var router=express[_0x2942('0x4')]();var fs_extra=require(_0x2942('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2942('0x6'));var config=require(_0x2942('0x7'));var controller=require(_0x2942('0x8'));router[_0x2942('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2942('0x9')]('/:id',auth[_0x2942('0xa')](),controller[_0x2942('0xb')]);router[_0x2942('0x9')](_0x2942('0xc'),auth[_0x2942('0xa')](),controller[_0x2942('0xd')]);router[_0x2942('0x9')](_0x2942('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x2942('0x9')]('/:id/descriptions',auth[_0x2942('0xa')](),controller[_0x2942('0xf')]);router['post']('/',auth[_0x2942('0xa')](),controller[_0x2942('0x10')]);router[_0x2942('0x11')](_0x2942('0x12'),auth[_0x2942('0xa')](),controller[_0x2942('0x13')]);router['delete'](_0x2942('0x12'),auth[_0x2942('0xa')](),controller[_0x2942('0x14')]);module[_0x2942('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a1331e3..8e31261 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 _0x33b1=['exports','STRING','sequelize'];(function(_0xc1f646,_0x7925b9){var _0x4c51f1=function(_0x4786b4){while(--_0x4786b4){_0xc1f646['push'](_0xc1f646['shift']());}};_0x4c51f1(++_0x7925b9);}(_0x33b1,0x131));var _0x133b=function(_0x383041,_0x15a2c1){_0x383041=_0x383041-0x0;var _0x12c697=_0x33b1[_0x383041];return _0x12c697;};'use strict';var Sequelize=require(_0x133b('0x0'));module[_0x133b('0x1')]={'name':{'type':Sequelize[_0x133b('0x2')]},'description':{'type':Sequelize[_0x133b('0x2')]}}; \ No newline at end of file +var _0x54f9=['sequelize','exports'];(function(_0x5695c3,_0x112429){var _0x32d3d4=function(_0x1faef9){while(--_0x1faef9){_0x5695c3['push'](_0x5695c3['shift']());}};_0x32d3d4(++_0x112429);}(_0x54f9,0xc6));var _0x954f=function(_0x27e21f,_0x3cc784){_0x27e21f=_0x27e21f-0x0;var _0x5c0967=_0x54f9[_0x27e21f];return _0x5c0967;};'use strict';var Sequelize=require(_0x954f('0x0'));module[_0x954f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a299bef..eac02cf 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 _0x2c07=['findOne','ServicenowField','getSubjects','getDescriptions','rimraf','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','getFields'];(function(_0x5234b0,_0x1c06f5){var _0x269eb4=function(_0x59cd50){while(--_0x59cd50){_0x5234b0['push'](_0x5234b0['shift']());}};_0x269eb4(++_0x1c06f5);}(_0x2c07,0x9c));var _0x72c0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2c07[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72c0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x72c0('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x72c0('0x2'));var util=require(_0x72c0('0x3'));var path=require(_0x72c0('0x4'));var sox=require(_0x72c0('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72c0('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x72c0('0x7'));var jsforce=require(_0x72c0('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x72c0('0x9'));var querystring=require(_0x72c0('0xa'));var Papa=require(_0x72c0('0xb'));var Redis=require(_0x72c0('0xc'));var authService=require(_0x72c0('0xd'));var qs=require(_0x72c0('0xe'));var as=require(_0x72c0('0xf'));var hardwareService=require(_0x72c0('0x10'));var logger=require(_0x72c0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x72c0('0x12'));var licenseUtil=require(_0x72c0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ece64,_0x1a6997){_0x1a6997=_0x1a6997||0xcc;return function(_0xc4c98d){if(_0xc4c98d){return _0x2ece64[_0x72c0('0x14')](_0x1a6997);}return _0x2ece64[_0x72c0('0x15')](_0x1a6997)['end']();};}function respondWithResult(_0x46f644,_0x199b75){_0x199b75=_0x199b75||0xc8;return function(_0x4c1c66){if(_0x4c1c66){return _0x46f644[_0x72c0('0x15')](_0x199b75)['json'](_0x4c1c66);}};}function respondWithFilteredResult(_0x4d0ae4,_0x47c0b8){return function(_0x26d338){if(_0x26d338){var _0x59c808=typeof _0x47c0b8[_0x72c0('0x16')]===_0x72c0('0x17')&&typeof _0x47c0b8['limit']===_0x72c0('0x17');var _0x57724a=_0x26d338[_0x72c0('0x18')];var _0xbdb4a2=_0x59c808?0x0:_0x47c0b8[_0x72c0('0x16')];var _0x5e7886=_0x59c808?_0x26d338['count']:_0x47c0b8['offset']+_0x47c0b8[_0x72c0('0x19')];var _0x580e28;if(_0x5e7886>=_0x57724a){_0x5e7886=_0x57724a;_0x580e28=0xc8;}else{_0x580e28=0xce;}_0x4d0ae4['status'](_0x580e28);return _0x4d0ae4['set'](_0x72c0('0x1a'),_0xbdb4a2+'-'+_0x5e7886+'/'+_0x57724a)[_0x72c0('0x1b')](_0x26d338);}return null;};}function patchUpdates(_0x466ef3){return function(_0x2e2d81){try{jsonpatch[_0x72c0('0x1c')](_0x2e2d81,_0x466ef3,!![]);}catch(_0x565c15){return BPromise[_0x72c0('0x1d')](_0x565c15);}return _0x2e2d81[_0x72c0('0x1e')]();};}function saveUpdates(_0x19b845,_0x3208b3){return function(_0x2cfd80){if(_0x2cfd80){return _0x2cfd80[_0x72c0('0x1f')](_0x19b845)['then'](function(_0x40d891){return _0x40d891;});}return null;};}function removeEntity(_0x390817,_0x4a1b96){return function(_0x1e9dee){if(_0x1e9dee){return _0x1e9dee[_0x72c0('0x20')]()[_0x72c0('0x21')](function(){_0x390817[_0x72c0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4076a0,_0x1d420f){return function(_0x3fcb56){if(!_0x3fcb56){_0x4076a0[_0x72c0('0x14')](0x194);}return _0x3fcb56;};}function handleError(_0x4e836a,_0x672c49){_0x672c49=_0x672c49||0x1f4;return function(_0x50fcda){logger['error'](_0x50fcda[_0x72c0('0x22')]);if(_0x50fcda[_0x72c0('0x23')]){delete _0x50fcda[_0x72c0('0x23')];}_0x4e836a['status'](_0x672c49)['send'](_0x50fcda);};}exports[_0x72c0('0x24')]=function(_0x219a64,_0x48deba){var _0x39ca90={},_0x25d771={},_0x505148={'count':0x0,'rows':[]};var _0x33353f=_[_0x72c0('0x25')](db[_0x72c0('0x26')][_0x72c0('0x27')],function(_0x1fc42c){return{'name':_0x1fc42c[_0x72c0('0x28')],'type':_0x1fc42c[_0x72c0('0x29')][_0x72c0('0x2a')]};});_0x25d771[_0x72c0('0x2b')]=_[_0x72c0('0x25')](_0x33353f,'name');_0x25d771[_0x72c0('0x2c')]=_[_0x72c0('0x2d')](_0x219a64[_0x72c0('0x2c')]);_0x25d771[_0x72c0('0x2e')]=_[_0x72c0('0x2f')](_0x25d771[_0x72c0('0x2b')],_0x25d771[_0x72c0('0x2c')]);_0x39ca90[_0x72c0('0x30')]=_[_0x72c0('0x2f')](_0x25d771[_0x72c0('0x2b')],qs[_0x72c0('0x31')](_0x219a64[_0x72c0('0x2c')]['fields']));_0x39ca90[_0x72c0('0x30')]=_0x39ca90['attributes'][_0x72c0('0x32')]?_0x39ca90[_0x72c0('0x30')]:_0x25d771['model'];if(!_0x219a64[_0x72c0('0x2c')][_0x72c0('0x33')](_0x72c0('0x34'))){_0x39ca90['limit']=qs[_0x72c0('0x19')](_0x219a64[_0x72c0('0x2c')][_0x72c0('0x19')]);_0x39ca90[_0x72c0('0x16')]=qs['offset'](_0x219a64[_0x72c0('0x2c')][_0x72c0('0x16')]);}_0x39ca90[_0x72c0('0x35')]=qs['sort'](_0x219a64[_0x72c0('0x2c')][_0x72c0('0x36')]);_0x39ca90[_0x72c0('0x37')]=qs[_0x72c0('0x2e')](_[_0x72c0('0x38')](_0x219a64[_0x72c0('0x2c')],_0x25d771[_0x72c0('0x2e')]),_0x33353f);if(_0x219a64[_0x72c0('0x2c')][_0x72c0('0x39')]){_0x39ca90['where']=_['merge'](_0x39ca90[_0x72c0('0x37')],{'$or':_[_0x72c0('0x25')](_0x33353f,function(_0x1916f7){if(_0x1916f7[_0x72c0('0x29')]!==_0x72c0('0x3a')){var _0x3f17e3={};_0x3f17e3[_0x1916f7['name']]={'$like':'%'+_0x219a64[_0x72c0('0x2c')][_0x72c0('0x39')]+'%'};return _0x3f17e3;}})});}_0x39ca90=_[_0x72c0('0x3b')]({},_0x39ca90,_0x219a64['options']);var _0x2fe94a={'where':_0x39ca90['where']};return db[_0x72c0('0x26')][_0x72c0('0x18')](_0x2fe94a)[_0x72c0('0x21')](function(_0x268c76){_0x505148[_0x72c0('0x18')]=_0x268c76;if(_0x219a64[_0x72c0('0x2c')]['includeAll']){_0x39ca90[_0x72c0('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x72c0('0x3d')](_0x39ca90);})[_0x72c0('0x21')](function(_0x217a36){_0x505148[_0x72c0('0x3e')]=_0x217a36;return _0x505148;})[_0x72c0('0x21')](respondWithFilteredResult(_0x48deba,_0x39ca90))[_0x72c0('0x3f')](handleError(_0x48deba,null));};exports[_0x72c0('0x40')]=function(_0x5b0394,_0x1ef30a){var _0x45633d={'raw':![],'where':{'id':_0x5b0394[_0x72c0('0x41')]['id']}},_0x2b8bf2={};_0x2b8bf2['model']=_[_0x72c0('0x2d')](db[_0x72c0('0x26')]['rawAttributes']);_0x2b8bf2[_0x72c0('0x2c')]=_[_0x72c0('0x2d')](_0x5b0394[_0x72c0('0x2c')]);_0x2b8bf2[_0x72c0('0x2e')]=_[_0x72c0('0x2f')](_0x2b8bf2['model'],_0x2b8bf2[_0x72c0('0x2c')]);_0x45633d['attributes']=_['intersection'](_0x2b8bf2['model'],qs['fields'](_0x5b0394[_0x72c0('0x2c')]['fields']));_0x45633d[_0x72c0('0x30')]=_0x45633d[_0x72c0('0x30')][_0x72c0('0x32')]?_0x45633d[_0x72c0('0x30')]:_0x2b8bf2[_0x72c0('0x2b')];if(_0x5b0394[_0x72c0('0x2c')][_0x72c0('0x42')]){_0x45633d[_0x72c0('0x3c')]=[{'all':!![]}];}_0x45633d=_[_0x72c0('0x3b')]({},_0x45633d,_0x5b0394[_0x72c0('0x43')]);return db[_0x72c0('0x26')][_0x72c0('0x44')](_0x45633d)[_0x72c0('0x21')](handleEntityNotFound(_0x1ef30a,null))[_0x72c0('0x21')](respondWithResult(_0x1ef30a,null))[_0x72c0('0x3f')](handleError(_0x1ef30a,null));};exports['create']=function(_0x32605b,_0x578bee){return db[_0x72c0('0x26')][_0x72c0('0x45')](_0x32605b[_0x72c0('0x46')],{})[_0x72c0('0x21')](respondWithResult(_0x578bee,0xc9))[_0x72c0('0x3f')](handleError(_0x578bee,null));};exports['update']=function(_0x5eec6f,_0x32bf09){if(_0x5eec6f[_0x72c0('0x46')]['id']){delete _0x5eec6f[_0x72c0('0x46')]['id'];}return db[_0x72c0('0x26')][_0x72c0('0x44')]({'where':{'id':_0x5eec6f[_0x72c0('0x41')]['id']}})[_0x72c0('0x21')](handleEntityNotFound(_0x32bf09,null))['then'](saveUpdates(_0x5eec6f[_0x72c0('0x46')],null))[_0x72c0('0x21')](respondWithResult(_0x32bf09,null))[_0x72c0('0x3f')](handleError(_0x32bf09,null));};exports['destroy']=function(_0x2de120,_0x5446da){return db[_0x72c0('0x26')]['find']({'where':{'id':_0x2de120[_0x72c0('0x41')]['id']}})[_0x72c0('0x21')](handleEntityNotFound(_0x5446da,null))[_0x72c0('0x21')](removeEntity(_0x5446da,null))[_0x72c0('0x3f')](handleError(_0x5446da,null));};exports[_0x72c0('0x47')]=function(_0x411a3e,_0x2196c7,_0x11722a){var _0x580397={};var _0x5e7e68={};var _0x200550;var _0x36d497;return db['ServicenowConfiguration'][_0x72c0('0x48')]({'where':{'id':_0x411a3e[_0x72c0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2196c7,null))[_0x72c0('0x21')](function(_0x9a58d7){if(_0x9a58d7){_0x200550=_0x9a58d7;_0x5e7e68[_0x72c0('0x2b')]=_[_0x72c0('0x2d')](db[_0x72c0('0x49')][_0x72c0('0x27')]);_0x5e7e68[_0x72c0('0x2c')]=_[_0x72c0('0x2d')](_0x411a3e['query']);_0x5e7e68['filters']=_['intersection'](_0x5e7e68[_0x72c0('0x2b')],_0x5e7e68[_0x72c0('0x2c')]);_0x580397['attributes']=_['intersection'](_0x5e7e68['model'],qs[_0x72c0('0x31')](_0x411a3e[_0x72c0('0x2c')]['fields']));_0x580397['attributes']=_0x580397['attributes']['length']?_0x580397[_0x72c0('0x30')]:_0x5e7e68[_0x72c0('0x2b')];_0x580397['order']=qs[_0x72c0('0x36')](_0x411a3e[_0x72c0('0x2c')][_0x72c0('0x36')]);_0x580397[_0x72c0('0x37')]=qs[_0x72c0('0x2e')](_['pick'](_0x411a3e[_0x72c0('0x2c')],_0x5e7e68[_0x72c0('0x2e')]));if(_0x411a3e['query']['filter']){_0x580397[_0x72c0('0x37')]=_[_0x72c0('0x3b')](_0x580397['where'],{'$or':_['map'](_0x580397['attributes'],function(_0x39d3c5){var _0x37cdae={};_0x37cdae[_0x39d3c5]={'$like':'%'+_0x411a3e[_0x72c0('0x2c')][_0x72c0('0x39')]+'%'};return _0x37cdae;})});}_0x580397=_[_0x72c0('0x3b')]({},_0x580397,_0x411a3e['options']);return _0x200550[_0x72c0('0x47')](_0x580397);}})[_0x72c0('0x21')](function(_0x2ad52c){if(_0x2ad52c){_0x36d497=_0x2ad52c[_0x72c0('0x32')];if(!_0x411a3e[_0x72c0('0x2c')][_0x72c0('0x33')](_0x72c0('0x34'))){_0x580397['limit']=qs[_0x72c0('0x19')](_0x411a3e[_0x72c0('0x2c')]['limit']);_0x580397[_0x72c0('0x16')]=qs[_0x72c0('0x16')](_0x411a3e['query'][_0x72c0('0x16')]);}return _0x200550['getFields'](_0x580397);}})[_0x72c0('0x21')](function(_0x3d7116){if(_0x3d7116){return _0x3d7116?{'count':_0x36d497,'rows':_0x3d7116}:null;}})[_0x72c0('0x21')](respondWithResult(_0x2196c7,null))[_0x72c0('0x3f')](handleError(_0x2196c7,null));};exports[_0x72c0('0x4a')]=function(_0x1664a1,_0x2dbd95,_0x156dda){var _0x4efa99={};var _0x599399={};var _0x1c292c;var _0x181286;return db[_0x72c0('0x26')][_0x72c0('0x48')]({'where':{'id':_0x1664a1['params']['id']}})['then'](handleEntityNotFound(_0x2dbd95,null))['then'](function(_0x5e54d1){if(_0x5e54d1){_0x1c292c=_0x5e54d1;_0x599399[_0x72c0('0x2b')]=_[_0x72c0('0x2d')](db[_0x72c0('0x49')]['rawAttributes']);_0x599399[_0x72c0('0x2c')]=_['keys'](_0x1664a1[_0x72c0('0x2c')]);_0x599399[_0x72c0('0x2e')]=_[_0x72c0('0x2f')](_0x599399['model'],_0x599399[_0x72c0('0x2c')]);_0x4efa99[_0x72c0('0x30')]=_[_0x72c0('0x2f')](_0x599399['model'],qs[_0x72c0('0x31')](_0x1664a1[_0x72c0('0x2c')][_0x72c0('0x31')]));_0x4efa99[_0x72c0('0x30')]=_0x4efa99[_0x72c0('0x30')][_0x72c0('0x32')]?_0x4efa99[_0x72c0('0x30')]:_0x599399['model'];_0x4efa99[_0x72c0('0x35')]=qs[_0x72c0('0x36')](_0x1664a1['query'][_0x72c0('0x36')]);_0x4efa99[_0x72c0('0x37')]=qs[_0x72c0('0x2e')](_[_0x72c0('0x38')](_0x1664a1[_0x72c0('0x2c')],_0x599399[_0x72c0('0x2e')]));if(_0x1664a1['query'][_0x72c0('0x39')]){_0x4efa99[_0x72c0('0x37')]=_[_0x72c0('0x3b')](_0x4efa99['where'],{'$or':_[_0x72c0('0x25')](_0x4efa99[_0x72c0('0x30')],function(_0x3ba072){var _0x2c8c29={};_0x2c8c29[_0x3ba072]={'$like':'%'+_0x1664a1[_0x72c0('0x2c')][_0x72c0('0x39')]+'%'};return _0x2c8c29;})});}_0x4efa99=_['merge']({},_0x4efa99,_0x1664a1[_0x72c0('0x43')]);return _0x1c292c['getSubjects'](_0x4efa99);}})[_0x72c0('0x21')](function(_0x13f379){if(_0x13f379){_0x181286=_0x13f379[_0x72c0('0x32')];if(!_0x1664a1['query'][_0x72c0('0x33')](_0x72c0('0x34'))){_0x4efa99[_0x72c0('0x19')]=qs[_0x72c0('0x19')](_0x1664a1[_0x72c0('0x2c')]['limit']);_0x4efa99[_0x72c0('0x16')]=qs[_0x72c0('0x16')](_0x1664a1[_0x72c0('0x2c')]['offset']);}return _0x1c292c[_0x72c0('0x4a')](_0x4efa99);}})[_0x72c0('0x21')](function(_0x1d1dad){if(_0x1d1dad){return _0x1d1dad?{'count':_0x181286,'rows':_0x1d1dad}:null;}})[_0x72c0('0x21')](respondWithResult(_0x2dbd95,null))[_0x72c0('0x3f')](handleError(_0x2dbd95,null));};exports['getDescriptions']=function(_0x122f4c,_0x56c62a,_0xcc344b){var _0x372fb6={};var _0x312c26={};var _0x66ae0b;var _0x51f6ff;return db['ServicenowConfiguration'][_0x72c0('0x48')]({'where':{'id':_0x122f4c[_0x72c0('0x41')]['id']}})[_0x72c0('0x21')](handleEntityNotFound(_0x56c62a,null))['then'](function(_0x496e1b){if(_0x496e1b){_0x66ae0b=_0x496e1b;_0x312c26[_0x72c0('0x2b')]=_[_0x72c0('0x2d')](db[_0x72c0('0x49')]['rawAttributes']);_0x312c26['query']=_[_0x72c0('0x2d')](_0x122f4c[_0x72c0('0x2c')]);_0x312c26[_0x72c0('0x2e')]=_['intersection'](_0x312c26[_0x72c0('0x2b')],_0x312c26[_0x72c0('0x2c')]);_0x372fb6[_0x72c0('0x30')]=_[_0x72c0('0x2f')](_0x312c26['model'],qs[_0x72c0('0x31')](_0x122f4c[_0x72c0('0x2c')][_0x72c0('0x31')]));_0x372fb6[_0x72c0('0x30')]=_0x372fb6[_0x72c0('0x30')]['length']?_0x372fb6[_0x72c0('0x30')]:_0x312c26[_0x72c0('0x2b')];_0x372fb6['order']=qs[_0x72c0('0x36')](_0x122f4c[_0x72c0('0x2c')][_0x72c0('0x36')]);_0x372fb6[_0x72c0('0x37')]=qs[_0x72c0('0x2e')](_[_0x72c0('0x38')](_0x122f4c[_0x72c0('0x2c')],_0x312c26['filters']));if(_0x122f4c[_0x72c0('0x2c')][_0x72c0('0x39')]){_0x372fb6[_0x72c0('0x37')]=_[_0x72c0('0x3b')](_0x372fb6[_0x72c0('0x37')],{'$or':_[_0x72c0('0x25')](_0x372fb6['attributes'],function(_0x1e65e5){var _0x1d854a={};_0x1d854a[_0x1e65e5]={'$like':'%'+_0x122f4c[_0x72c0('0x2c')][_0x72c0('0x39')]+'%'};return _0x1d854a;})});}_0x372fb6=_[_0x72c0('0x3b')]({},_0x372fb6,_0x122f4c[_0x72c0('0x43')]);return _0x66ae0b['getDescriptions'](_0x372fb6);}})[_0x72c0('0x21')](function(_0x32263a){if(_0x32263a){_0x51f6ff=_0x32263a[_0x72c0('0x32')];if(!_0x122f4c[_0x72c0('0x2c')][_0x72c0('0x33')](_0x72c0('0x34'))){_0x372fb6[_0x72c0('0x19')]=qs[_0x72c0('0x19')](_0x122f4c[_0x72c0('0x2c')][_0x72c0('0x19')]);_0x372fb6[_0x72c0('0x16')]=qs[_0x72c0('0x16')](_0x122f4c[_0x72c0('0x2c')]['offset']);}return _0x66ae0b[_0x72c0('0x4b')](_0x372fb6);}})[_0x72c0('0x21')](function(_0x595f2a){if(_0x595f2a){return _0x595f2a?{'count':_0x51f6ff,'rows':_0x595f2a}:null;}})[_0x72c0('0x21')](respondWithResult(_0x56c62a,null))[_0x72c0('0x3f')](handleError(_0x56c62a,null));}; \ No newline at end of file +var _0x3741=['to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','ServicenowConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','rows','catch','show','params','keys','rawAttributes','fields','includeAll','include','find','create','body','destroy','getFields','ServicenowField','hasOwnProperty','getSubjects','options','getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x3741,0x91));var _0x1374=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x3741[_0x1399d6];return _0x4a9db4;};'use strict';var emlformat=require(_0x1374('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1374('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1374('0x2'));var moment=require('moment');var BPromise=require(_0x1374('0x3'));var Mustache=require(_0x1374('0x4'));var util=require(_0x1374('0x5'));var path=require('path');var sox=require(_0x1374('0x6'));var csv=require('to-csv');var ejs=require(_0x1374('0x7'));var fs=require('fs');var fs_extra=require(_0x1374('0x8'));var _=require(_0x1374('0x9'));var squel=require(_0x1374('0xa'));var crypto=require(_0x1374('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1374('0xc'));var toCsv=require(_0x1374('0xd'));var querystring=require(_0x1374('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1374('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1374('0x10'));var hardwareService=require(_0x1374('0x11'));var logger=require(_0x1374('0x12'))(_0x1374('0x13'));var utils=require('../../config/utils');var config=require(_0x1374('0x14'));var licenseUtil=require(_0x1374('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x322a48,_0x5b5b0a){_0x5b5b0a=_0x5b5b0a||0xcc;return function(_0x3bae7f){if(_0x3bae7f){return _0x322a48[_0x1374('0x16')](_0x5b5b0a);}return _0x322a48[_0x1374('0x17')](_0x5b5b0a)[_0x1374('0x18')]();};}function respondWithResult(_0x43c233,_0x11ce8f){_0x11ce8f=_0x11ce8f||0xc8;return function(_0x163cd2){if(_0x163cd2){return _0x43c233[_0x1374('0x17')](_0x11ce8f)[_0x1374('0x19')](_0x163cd2);}};}function respondWithFilteredResult(_0x1f4617,_0x4271b7){return function(_0x15f42c){if(_0x15f42c){var _0x2082c7=typeof _0x4271b7['offset']===_0x1374('0x1a')&&typeof _0x4271b7[_0x1374('0x1b')]===_0x1374('0x1a');var _0x2c0a3e=_0x15f42c[_0x1374('0x1c')];var _0x19e3e8=_0x2082c7?0x0:_0x4271b7[_0x1374('0x1d')];var _0x5e99f4=_0x2082c7?_0x15f42c[_0x1374('0x1c')]:_0x4271b7[_0x1374('0x1d')]+_0x4271b7[_0x1374('0x1b')];var _0x12209c;if(_0x5e99f4>=_0x2c0a3e){_0x5e99f4=_0x2c0a3e;_0x12209c=0xc8;}else{_0x12209c=0xce;}_0x1f4617[_0x1374('0x17')](_0x12209c);return _0x1f4617[_0x1374('0x1e')](_0x1374('0x1f'),_0x19e3e8+'-'+_0x5e99f4+'/'+_0x2c0a3e)[_0x1374('0x19')](_0x15f42c);}return null;};}function patchUpdates(_0x446692){return function(_0x2a3f7f){try{jsonpatch[_0x1374('0x20')](_0x2a3f7f,_0x446692,!![]);}catch(_0x145438){return BPromise[_0x1374('0x21')](_0x145438);}return _0x2a3f7f[_0x1374('0x22')]();};}function saveUpdates(_0x23ba34,_0x274f36){return function(_0x15f1eb){if(_0x15f1eb){return _0x15f1eb[_0x1374('0x23')](_0x23ba34)['then'](function(_0x2c0776){return _0x2c0776;});}return null;};}function removeEntity(_0x1ce68c,_0x27cbf9){return function(_0x23209f){if(_0x23209f){return _0x23209f['destroy']()[_0x1374('0x24')](function(){_0x1ce68c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cdc43,_0x33d561){return function(_0x5071d6){if(!_0x5071d6){_0x3cdc43[_0x1374('0x16')](0x194);}return _0x5071d6;};}function handleError(_0x96b1e0,_0x4bd9db){_0x4bd9db=_0x4bd9db||0x1f4;return function(_0x3df630){logger[_0x1374('0x25')](_0x3df630[_0x1374('0x26')]);if(_0x3df630[_0x1374('0x27')]){delete _0x3df630[_0x1374('0x27')];}_0x96b1e0[_0x1374('0x17')](_0x4bd9db)['send'](_0x3df630);};}exports[_0x1374('0x28')]=function(_0x467c20,_0x957552){var _0xc7aac0={},_0x38b444={},_0x2e7dc2={'count':0x0,'rows':[]};var _0x14e2f6=_['map'](db[_0x1374('0x29')]['rawAttributes'],function(_0x47541f){return{'name':_0x47541f[_0x1374('0x2a')],'type':_0x47541f[_0x1374('0x2b')][_0x1374('0x2c')]};});_0x38b444[_0x1374('0x2d')]=_[_0x1374('0x2e')](_0x14e2f6,_0x1374('0x27'));_0x38b444[_0x1374('0x2f')]=_['keys'](_0x467c20['query']);_0x38b444[_0x1374('0x30')]=_[_0x1374('0x31')](_0x38b444[_0x1374('0x2d')],_0x38b444[_0x1374('0x2f')]);_0xc7aac0[_0x1374('0x32')]=_['intersection'](_0x38b444[_0x1374('0x2d')],qs['fields'](_0x467c20[_0x1374('0x2f')]['fields']));_0xc7aac0['attributes']=_0xc7aac0[_0x1374('0x32')][_0x1374('0x33')]?_0xc7aac0[_0x1374('0x32')]:_0x38b444[_0x1374('0x2d')];if(!_0x467c20[_0x1374('0x2f')]['hasOwnProperty'](_0x1374('0x34'))){_0xc7aac0['limit']=qs['limit'](_0x467c20[_0x1374('0x2f')][_0x1374('0x1b')]);_0xc7aac0['offset']=qs[_0x1374('0x1d')](_0x467c20['query'][_0x1374('0x1d')]);}_0xc7aac0[_0x1374('0x35')]=qs[_0x1374('0x36')](_0x467c20[_0x1374('0x2f')][_0x1374('0x36')]);_0xc7aac0[_0x1374('0x37')]=qs[_0x1374('0x30')](_[_0x1374('0x38')](_0x467c20[_0x1374('0x2f')],_0x38b444[_0x1374('0x30')]),_0x14e2f6);if(_0x467c20[_0x1374('0x2f')][_0x1374('0x39')]){_0xc7aac0[_0x1374('0x37')]=_[_0x1374('0x3a')](_0xc7aac0[_0x1374('0x37')],{'$or':_[_0x1374('0x2e')](_0x14e2f6,function(_0x5cdbc9){if(_0x5cdbc9[_0x1374('0x2b')]!==_0x1374('0x3b')){var _0x59e7d9={};_0x59e7d9[_0x5cdbc9[_0x1374('0x27')]]={'$like':'%'+_0x467c20[_0x1374('0x2f')][_0x1374('0x39')]+'%'};return _0x59e7d9;}})});}_0xc7aac0=_[_0x1374('0x3a')]({},_0xc7aac0,_0x467c20['options']);var _0x3e97e1={'where':_0xc7aac0[_0x1374('0x37')]};return db[_0x1374('0x29')][_0x1374('0x1c')](_0x3e97e1)[_0x1374('0x24')](function(_0x2f0efd){_0x2e7dc2[_0x1374('0x1c')]=_0x2f0efd;if(_0x467c20[_0x1374('0x2f')]['includeAll']){_0xc7aac0['include']=[{'all':!![]}];}return db[_0x1374('0x29')]['findAll'](_0xc7aac0);})[_0x1374('0x24')](function(_0x56b312){_0x2e7dc2[_0x1374('0x3c')]=_0x56b312;return _0x2e7dc2;})[_0x1374('0x24')](respondWithFilteredResult(_0x957552,_0xc7aac0))[_0x1374('0x3d')](handleError(_0x957552,null));};exports[_0x1374('0x3e')]=function(_0x5829fd,_0x446495){var _0x1ff9e0={'raw':![],'where':{'id':_0x5829fd[_0x1374('0x3f')]['id']}},_0x8e75ed={};_0x8e75ed[_0x1374('0x2d')]=_[_0x1374('0x40')](db[_0x1374('0x29')][_0x1374('0x41')]);_0x8e75ed[_0x1374('0x2f')]=_[_0x1374('0x40')](_0x5829fd[_0x1374('0x2f')]);_0x8e75ed[_0x1374('0x30')]=_[_0x1374('0x31')](_0x8e75ed[_0x1374('0x2d')],_0x8e75ed[_0x1374('0x2f')]);_0x1ff9e0[_0x1374('0x32')]=_[_0x1374('0x31')](_0x8e75ed[_0x1374('0x2d')],qs[_0x1374('0x42')](_0x5829fd['query'][_0x1374('0x42')]));_0x1ff9e0[_0x1374('0x32')]=_0x1ff9e0['attributes'][_0x1374('0x33')]?_0x1ff9e0[_0x1374('0x32')]:_0x8e75ed['model'];if(_0x5829fd[_0x1374('0x2f')][_0x1374('0x43')]){_0x1ff9e0[_0x1374('0x44')]=[{'all':!![]}];}_0x1ff9e0=_[_0x1374('0x3a')]({},_0x1ff9e0,_0x5829fd['options']);return db[_0x1374('0x29')][_0x1374('0x45')](_0x1ff9e0)[_0x1374('0x24')](handleEntityNotFound(_0x446495,null))[_0x1374('0x24')](respondWithResult(_0x446495,null))[_0x1374('0x3d')](handleError(_0x446495,null));};exports[_0x1374('0x46')]=function(_0x42877d,_0x5a83ae){return db[_0x1374('0x29')][_0x1374('0x46')](_0x42877d[_0x1374('0x47')],{})[_0x1374('0x24')](respondWithResult(_0x5a83ae,0xc9))[_0x1374('0x3d')](handleError(_0x5a83ae,null));};exports[_0x1374('0x23')]=function(_0x4a59d0,_0x4254c0){if(_0x4a59d0[_0x1374('0x47')]['id']){delete _0x4a59d0[_0x1374('0x47')]['id'];}return db['ServicenowConfiguration'][_0x1374('0x45')]({'where':{'id':_0x4a59d0[_0x1374('0x3f')]['id']}})[_0x1374('0x24')](handleEntityNotFound(_0x4254c0,null))[_0x1374('0x24')](saveUpdates(_0x4a59d0[_0x1374('0x47')],null))[_0x1374('0x24')](respondWithResult(_0x4254c0,null))[_0x1374('0x3d')](handleError(_0x4254c0,null));};exports[_0x1374('0x48')]=function(_0x99f7c9,_0x1159fe){return db[_0x1374('0x29')]['find']({'where':{'id':_0x99f7c9['params']['id']}})[_0x1374('0x24')](handleEntityNotFound(_0x1159fe,null))[_0x1374('0x24')](removeEntity(_0x1159fe,null))['catch'](handleError(_0x1159fe,null));};exports[_0x1374('0x49')]=function(_0x4e4459,_0x423771,_0x10a841){var _0x4d054c={};var _0x169981={};var _0x4a6093;var _0x18f773;return db[_0x1374('0x29')]['findOne']({'where':{'id':_0x4e4459[_0x1374('0x3f')]['id']}})['then'](handleEntityNotFound(_0x423771,null))['then'](function(_0x4cf830){if(_0x4cf830){_0x4a6093=_0x4cf830;_0x169981['model']=_[_0x1374('0x40')](db[_0x1374('0x4a')][_0x1374('0x41')]);_0x169981[_0x1374('0x2f')]=_[_0x1374('0x40')](_0x4e4459[_0x1374('0x2f')]);_0x169981['filters']=_[_0x1374('0x31')](_0x169981[_0x1374('0x2d')],_0x169981[_0x1374('0x2f')]);_0x4d054c['attributes']=_[_0x1374('0x31')](_0x169981[_0x1374('0x2d')],qs['fields'](_0x4e4459[_0x1374('0x2f')][_0x1374('0x42')]));_0x4d054c['attributes']=_0x4d054c[_0x1374('0x32')][_0x1374('0x33')]?_0x4d054c[_0x1374('0x32')]:_0x169981['model'];_0x4d054c[_0x1374('0x35')]=qs[_0x1374('0x36')](_0x4e4459['query'][_0x1374('0x36')]);_0x4d054c[_0x1374('0x37')]=qs[_0x1374('0x30')](_[_0x1374('0x38')](_0x4e4459[_0x1374('0x2f')],_0x169981[_0x1374('0x30')]));if(_0x4e4459[_0x1374('0x2f')][_0x1374('0x39')]){_0x4d054c[_0x1374('0x37')]=_[_0x1374('0x3a')](_0x4d054c['where'],{'$or':_[_0x1374('0x2e')](_0x4d054c[_0x1374('0x32')],function(_0x40f920){var _0x4b2467={};_0x4b2467[_0x40f920]={'$like':'%'+_0x4e4459['query'][_0x1374('0x39')]+'%'};return _0x4b2467;})});}_0x4d054c=_[_0x1374('0x3a')]({},_0x4d054c,_0x4e4459['options']);return _0x4a6093[_0x1374('0x49')](_0x4d054c);}})[_0x1374('0x24')](function(_0x4af3f){if(_0x4af3f){_0x18f773=_0x4af3f[_0x1374('0x33')];if(!_0x4e4459['query'][_0x1374('0x4b')](_0x1374('0x34'))){_0x4d054c[_0x1374('0x1b')]=qs[_0x1374('0x1b')](_0x4e4459[_0x1374('0x2f')][_0x1374('0x1b')]);_0x4d054c['offset']=qs['offset'](_0x4e4459['query'][_0x1374('0x1d')]);}return _0x4a6093[_0x1374('0x49')](_0x4d054c);}})['then'](function(_0x311181){if(_0x311181){return _0x311181?{'count':_0x18f773,'rows':_0x311181}:null;}})[_0x1374('0x24')](respondWithResult(_0x423771,null))['catch'](handleError(_0x423771,null));};exports[_0x1374('0x4c')]=function(_0x425744,_0xdd14e7,_0x107f8c){var _0xab7cd5={};var _0x48abf1={};var _0x394a41;var _0xf68e4c;return db[_0x1374('0x29')]['findOne']({'where':{'id':_0x425744[_0x1374('0x3f')]['id']}})['then'](handleEntityNotFound(_0xdd14e7,null))[_0x1374('0x24')](function(_0x55d109){if(_0x55d109){_0x394a41=_0x55d109;_0x48abf1[_0x1374('0x2d')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x48abf1['query']=_[_0x1374('0x40')](_0x425744[_0x1374('0x2f')]);_0x48abf1[_0x1374('0x30')]=_['intersection'](_0x48abf1[_0x1374('0x2d')],_0x48abf1[_0x1374('0x2f')]);_0xab7cd5[_0x1374('0x32')]=_['intersection'](_0x48abf1[_0x1374('0x2d')],qs['fields'](_0x425744[_0x1374('0x2f')][_0x1374('0x42')]));_0xab7cd5['attributes']=_0xab7cd5['attributes'][_0x1374('0x33')]?_0xab7cd5[_0x1374('0x32')]:_0x48abf1['model'];_0xab7cd5[_0x1374('0x35')]=qs['sort'](_0x425744[_0x1374('0x2f')][_0x1374('0x36')]);_0xab7cd5[_0x1374('0x37')]=qs[_0x1374('0x30')](_[_0x1374('0x38')](_0x425744[_0x1374('0x2f')],_0x48abf1['filters']));if(_0x425744[_0x1374('0x2f')]['filter']){_0xab7cd5[_0x1374('0x37')]=_[_0x1374('0x3a')](_0xab7cd5[_0x1374('0x37')],{'$or':_[_0x1374('0x2e')](_0xab7cd5[_0x1374('0x32')],function(_0x2f46dd){var _0x4c9394={};_0x4c9394[_0x2f46dd]={'$like':'%'+_0x425744[_0x1374('0x2f')][_0x1374('0x39')]+'%'};return _0x4c9394;})});}_0xab7cd5=_[_0x1374('0x3a')]({},_0xab7cd5,_0x425744[_0x1374('0x4d')]);return _0x394a41['getSubjects'](_0xab7cd5);}})[_0x1374('0x24')](function(_0x595594){if(_0x595594){_0xf68e4c=_0x595594[_0x1374('0x33')];if(!_0x425744[_0x1374('0x2f')]['hasOwnProperty'](_0x1374('0x34'))){_0xab7cd5[_0x1374('0x1b')]=qs[_0x1374('0x1b')](_0x425744[_0x1374('0x2f')]['limit']);_0xab7cd5[_0x1374('0x1d')]=qs[_0x1374('0x1d')](_0x425744[_0x1374('0x2f')][_0x1374('0x1d')]);}return _0x394a41[_0x1374('0x4c')](_0xab7cd5);}})[_0x1374('0x24')](function(_0x1dba3c){if(_0x1dba3c){return _0x1dba3c?{'count':_0xf68e4c,'rows':_0x1dba3c}:null;}})[_0x1374('0x24')](respondWithResult(_0xdd14e7,null))[_0x1374('0x3d')](handleError(_0xdd14e7,null));};exports[_0x1374('0x4e')]=function(_0x5be7ab,_0x4b408a,_0x30c0d2){var _0x4980f9={};var _0x182103={};var _0x585b5d;var _0x2785d0;return db[_0x1374('0x29')]['findOne']({'where':{'id':_0x5be7ab['params']['id']}})[_0x1374('0x24')](handleEntityNotFound(_0x4b408a,null))[_0x1374('0x24')](function(_0x47f53b){if(_0x47f53b){_0x585b5d=_0x47f53b;_0x182103[_0x1374('0x2d')]=_[_0x1374('0x40')](db[_0x1374('0x4a')][_0x1374('0x41')]);_0x182103['query']=_[_0x1374('0x40')](_0x5be7ab[_0x1374('0x2f')]);_0x182103[_0x1374('0x30')]=_[_0x1374('0x31')](_0x182103['model'],_0x182103[_0x1374('0x2f')]);_0x4980f9['attributes']=_[_0x1374('0x31')](_0x182103['model'],qs[_0x1374('0x42')](_0x5be7ab[_0x1374('0x2f')][_0x1374('0x42')]));_0x4980f9['attributes']=_0x4980f9['attributes'][_0x1374('0x33')]?_0x4980f9['attributes']:_0x182103[_0x1374('0x2d')];_0x4980f9[_0x1374('0x35')]=qs['sort'](_0x5be7ab['query'][_0x1374('0x36')]);_0x4980f9[_0x1374('0x37')]=qs[_0x1374('0x30')](_[_0x1374('0x38')](_0x5be7ab['query'],_0x182103['filters']));if(_0x5be7ab[_0x1374('0x2f')][_0x1374('0x39')]){_0x4980f9[_0x1374('0x37')]=_['merge'](_0x4980f9[_0x1374('0x37')],{'$or':_['map'](_0x4980f9[_0x1374('0x32')],function(_0x482b7e){var _0xb1534={};_0xb1534[_0x482b7e]={'$like':'%'+_0x5be7ab[_0x1374('0x2f')]['filter']+'%'};return _0xb1534;})});}_0x4980f9=_[_0x1374('0x3a')]({},_0x4980f9,_0x5be7ab['options']);return _0x585b5d[_0x1374('0x4e')](_0x4980f9);}})['then'](function(_0x47acac){if(_0x47acac){_0x2785d0=_0x47acac[_0x1374('0x33')];if(!_0x5be7ab[_0x1374('0x2f')][_0x1374('0x4b')](_0x1374('0x34'))){_0x4980f9[_0x1374('0x1b')]=qs[_0x1374('0x1b')](_0x5be7ab[_0x1374('0x2f')][_0x1374('0x1b')]);_0x4980f9['offset']=qs['offset'](_0x5be7ab[_0x1374('0x2f')][_0x1374('0x1d')]);}return _0x585b5d[_0x1374('0x4e')](_0x4980f9);}})[_0x1374('0x24')](function(_0x50b4b4){if(_0x50b4b4){return _0x50b4b4?{'count':_0x2785d0,'rows':_0x50b4b4}:null;}})[_0x1374('0x24')](respondWithResult(_0x4b408a,null))[_0x1374('0x3d')](handleError(_0x4b408a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ccbd35a..e7c52bc 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 _0x5eb8=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api','moment','bluebird'];(function(_0x2ac05e,_0x5970f4){var _0x3d149d=function(_0x2d39ea){while(--_0x2d39ea){_0x2ac05e['push'](_0x2ac05e['shift']());}};_0x3d149d(++_0x5970f4);}(_0x5eb8,0xb0));var _0x85eb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5eb8[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dd2=['../../config/logger','api','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x4dd2,0xf1));var _0x24dd=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x4dd2[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require(_0x24dd('0x0'));var logger=require(_0x24dd('0x1'))(_0x24dd('0x2'));var moment=require('moment');var BPromise=require(_0x24dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24dd('0x4'));var rimraf=require('rimraf');var config=require(_0x24dd('0x5'));var attributes=require(_0x24dd('0x6'));module[_0x24dd('0x7')]=function(_0x5d3f24,_0x524c5b){return _0x5d3f24[_0x24dd('0x8')](_0x24dd('0x9'),attributes,{'tableName':_0x24dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 93d2dbf..ff8ddd4 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 _0x4755=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4755,0x11e));var _0x5475=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x4755[_0x4b4d43];return _0x5706ba;};'use strict';var _=require(_0x5475('0x0'));var util=require('util');var moment=require(_0x5475('0x1'));var BPromise=require(_0x5475('0x2'));var rs=require(_0x5475('0x3'));var fs=require('fs');var Redis=require(_0x5475('0x4'));var db=require(_0x5475('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5475('0x6'))(_0x5475('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5475('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x299c9a,_0x19c819,_0x2b428f){return new BPromise(function(_0x10adb7,_0x134f7b){return client['request'](_0x299c9a,_0x2b428f)[_0x5475('0x9')](function(_0x1d11c6){logger['info'](_0x5475('0xa'),_0x19c819,_0x5475('0xb'));logger[_0x5475('0xc')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x19c819,_0x5475('0xb'),JSON[_0x5475('0xd')](_0x1d11c6));if(_0x1d11c6['error']){if(_0x1d11c6[_0x5475('0xe')][_0x5475('0xf')]===0x1f4){logger[_0x5475('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x19c819,_0x1d11c6[_0x5475('0xe')][_0x5475('0x10')]);return _0x134f7b(_0x1d11c6[_0x5475('0xe')]['message']);}logger['error'](_0x5475('0xa'),_0x19c819,_0x1d11c6['error'][_0x5475('0x10')]);return _0x10adb7(_0x1d11c6[_0x5475('0xe')][_0x5475('0x10')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x19c819,_0x5475('0xb'));_0x10adb7(_0x1d11c6[_0x5475('0x11')][_0x5475('0x10')]);}})[_0x5475('0x12')](function(_0x142b7f){logger[_0x5475('0xe')](_0x5475('0xa'),_0x19c819,_0x142b7f);_0x134f7b(_0x142b7f);});});} \ No newline at end of file +var _0x4fd8=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','ioredis','../../config/environment','jayson/promise','http'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x4fd8,0x129));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84fd('0x0'));var util=require(_0x84fd('0x1'));var moment=require(_0x84fd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84fd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x84fd('0x4'));var jayson=require(_0x84fd('0x5'));var client=jayson['client'][_0x84fd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x55ad56,_0x43e744,_0x2239c6){return new BPromise(function(_0xa5c924,_0x1d9113){return client['request'](_0x55ad56,_0x2239c6)[_0x84fd('0x7')](function(_0x1cd30a){logger[_0x84fd('0x8')](_0x84fd('0x9'),_0x43e744,_0x84fd('0xa'));logger[_0x84fd('0xb')](_0x84fd('0xc'),_0x43e744,_0x84fd('0xa'),JSON['stringify'](_0x1cd30a));if(_0x1cd30a[_0x84fd('0xd')]){if(_0x1cd30a[_0x84fd('0xd')]['code']===0x1f4){logger[_0x84fd('0xd')](_0x84fd('0x9'),_0x43e744,_0x1cd30a[_0x84fd('0xd')][_0x84fd('0xe')]);return _0x1d9113(_0x1cd30a[_0x84fd('0xd')][_0x84fd('0xe')]);}logger[_0x84fd('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x43e744,_0x1cd30a[_0x84fd('0xd')]['message']);return _0xa5c924(_0x1cd30a[_0x84fd('0xd')][_0x84fd('0xe')]);}else{logger[_0x84fd('0x8')](_0x84fd('0x9'),_0x43e744,'request\x20sent');_0xa5c924(_0x1cd30a[_0x84fd('0xf')][_0x84fd('0xe')]);}})['catch'](function(_0x55029c){logger[_0x84fd('0xd')](_0x84fd('0x9'),_0x43e744,_0x55029c);_0x1d9113(_0x55029c);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 1f1383e..32f87fa 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 _0xc0a3=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy'];(function(_0x3b86c5,_0x37723a){var _0x72be1b=function(_0x358e25){while(--_0x358e25){_0x3b86c5['push'](_0x3b86c5['shift']());}};_0x72be1b(++_0x37723a);}(_0xc0a3,0x10f));var _0x3c0a=function(_0x218c58,_0x5b6ae6){_0x218c58=_0x218c58-0x0;var _0x297059=_0xc0a3[_0x218c58];return _0x297059;};'use strict';var multer=require('multer');var util=require(_0x3c0a('0x0'));var path=require(_0x3c0a('0x1'));var timeout=require(_0x3c0a('0x2'));var express=require(_0x3c0a('0x3'));var router=express[_0x3c0a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3c0a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c0a('0x6'));var controller=require(_0x3c0a('0x7'));router[_0x3c0a('0x8')]('/',auth[_0x3c0a('0x9')](),controller[_0x3c0a('0xa')]);router[_0x3c0a('0x8')](_0x3c0a('0xb'),auth[_0x3c0a('0x9')](),controller['show']);router[_0x3c0a('0xc')]('/',auth[_0x3c0a('0x9')](),controller[_0x3c0a('0xd')]);router['put']('/:id',auth[_0x3c0a('0x9')](),controller[_0x3c0a('0xe')]);router[_0x3c0a('0xf')](_0x3c0a('0xb'),auth[_0x3c0a('0x9')](),controller[_0x3c0a('0x10')]);module[_0x3c0a('0x11')]=router; \ No newline at end of file +var _0x0676=['delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','post','put','update'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x0676,0x91));var _0x6067=function(_0x1b16d5,_0x7b1379){_0x1b16d5=_0x1b16d5-0x0;var _0x597f7f=_0x0676[_0x1b16d5];return _0x597f7f;};'use strict';var multer=require(_0x6067('0x0'));var util=require(_0x6067('0x1'));var path=require(_0x6067('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6067('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6067('0x4'));var interaction=require(_0x6067('0x5'));var config=require(_0x6067('0x6'));var controller=require(_0x6067('0x7'));router['get']('/',auth[_0x6067('0x8')](),controller[_0x6067('0x9')]);router[_0x6067('0xa')](_0x6067('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6067('0xc')]('/',auth[_0x6067('0x8')](),controller['create']);router[_0x6067('0xd')](_0x6067('0xb'),auth[_0x6067('0x8')](),controller[_0x6067('0xe')]);router[_0x6067('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4328879..9a1a6c8 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 _0xce01=['keyValue','string','STRING','ENUM','BOOLEAN','sequelize','variable','customVariable'];(function(_0xecca1c,_0x278c47){var _0x53626a=function(_0x24cd2c){while(--_0x24cd2c){_0xecca1c['push'](_0xecca1c['shift']());}};_0x53626a(++_0x278c47);}(_0xce01,0xc5));var _0x1ce0=function(_0x11f90a,_0x4f4c3d){_0x11f90a=_0x11f90a-0x0;var _0x493223=_0xce01[_0x11f90a];return _0x493223;};'use strict';var Sequelize=require(_0x1ce0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x1ce0('0x1'),_0x1ce0('0x2'),_0x1ce0('0x3'),'picklist'),'defaultValue':_0x1ce0('0x4')},'content':{'type':Sequelize[_0x1ce0('0x5')]},'key':{'type':Sequelize[_0x1ce0('0x5')]},'keyType':{'type':Sequelize[_0x1ce0('0x6')](_0x1ce0('0x4'),_0x1ce0('0x1'),_0x1ce0('0x2'))},'keyContent':{'type':Sequelize[_0x1ce0('0x5')]},'idField':{'type':Sequelize[_0x1ce0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1ce0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ce0('0x5')]}}; \ No newline at end of file +var _0x7252=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x1dd8ca,_0x5a2037){var _0x47f46b=function(_0xc13a4f){while(--_0xc13a4f){_0x1dd8ca['push'](_0x1dd8ca['shift']());}};_0x47f46b(++_0x5a2037);}(_0x7252,0x94));var _0x2725=function(_0x14dba1,_0x313893){_0x14dba1=_0x14dba1-0x0;var _0x4857d7=_0x7252[_0x14dba1];return _0x4857d7;};'use strict';var Sequelize=require(_0x2725('0x0'));module[_0x2725('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2725('0x2'),_0x2725('0x3'),_0x2725('0x4'),_0x2725('0x5'),_0x2725('0x6')),'defaultValue':_0x2725('0x2')},'content':{'type':Sequelize[_0x2725('0x7')]},'key':{'type':Sequelize[_0x2725('0x7')]},'keyType':{'type':Sequelize[_0x2725('0x8')](_0x2725('0x2'),_0x2725('0x3'),_0x2725('0x4'))},'keyContent':{'type':Sequelize[_0x2725('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2725('0x7')]},'customField':{'type':Sequelize[_0x2725('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2725('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f1afbb4..c5eedd0 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 _0xb728=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','catch','show','fields','length','find','create','body','params','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x192eb0,_0x571845){var _0x1b5a9c=function(_0x221589){while(--_0x221589){_0x192eb0['push'](_0x192eb0['shift']());}};_0x1b5a9c(++_0x571845);}(_0xb728,0x109));var _0x8b72=function(_0x1b8caa,_0x3ebb92){_0x1b8caa=_0x1b8caa-0x0;var _0x354ba1=_0xb728[_0x1b8caa];return _0x354ba1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8b72('0x0'));var rp=require(_0x8b72('0x1'));var moment=require(_0x8b72('0x2'));var BPromise=require(_0x8b72('0x3'));var Mustache=require(_0x8b72('0x4'));var util=require('util');var path=require(_0x8b72('0x5'));var sox=require(_0x8b72('0x6'));var csv=require(_0x8b72('0x7'));var ejs=require(_0x8b72('0x8'));var fs=require('fs');var fs_extra=require(_0x8b72('0x9'));var _=require('lodash');var squel=require(_0x8b72('0xa'));var crypto=require(_0x8b72('0xb'));var jsforce=require(_0x8b72('0xc'));var deskjs=require(_0x8b72('0xd'));var toCsv=require(_0x8b72('0x7'));var querystring=require('querystring');var Papa=require(_0x8b72('0xe'));var Redis=require(_0x8b72('0xf'));var authService=require(_0x8b72('0x10'));var qs=require(_0x8b72('0x11'));var as=require(_0x8b72('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b72('0x13'))(_0x8b72('0x14'));var utils=require(_0x8b72('0x15'));var config=require(_0x8b72('0x16'));var licenseUtil=require(_0x8b72('0x17'));var db=require(_0x8b72('0x18'))['db'];function respondWithStatusCode(_0x29579e,_0x512fb2){_0x512fb2=_0x512fb2||0xcc;return function(_0x115827){if(_0x115827){return _0x29579e[_0x8b72('0x19')](_0x512fb2);}return _0x29579e[_0x8b72('0x1a')](_0x512fb2)[_0x8b72('0x1b')]();};}function respondWithResult(_0x6ebf7c,_0x384d52){_0x384d52=_0x384d52||0xc8;return function(_0x59a3d1){if(_0x59a3d1){return _0x6ebf7c[_0x8b72('0x1a')](_0x384d52)[_0x8b72('0x1c')](_0x59a3d1);}};}function respondWithFilteredResult(_0x42ed58,_0x22e215){return function(_0x20c106){if(_0x20c106){var _0x3d9f52=typeof _0x22e215[_0x8b72('0x1d')]===_0x8b72('0x1e')&&typeof _0x22e215[_0x8b72('0x1f')]==='undefined';var _0x277263=_0x20c106['count'];var _0x45d1e3=_0x3d9f52?0x0:_0x22e215[_0x8b72('0x1d')];var _0x5158bb=_0x3d9f52?_0x20c106[_0x8b72('0x20')]:_0x22e215[_0x8b72('0x1d')]+_0x22e215['limit'];var _0x2a9106;if(_0x5158bb>=_0x277263){_0x5158bb=_0x277263;_0x2a9106=0xc8;}else{_0x2a9106=0xce;}_0x42ed58['status'](_0x2a9106);return _0x42ed58['set']('Content-Range',_0x45d1e3+'-'+_0x5158bb+'/'+_0x277263)[_0x8b72('0x1c')](_0x20c106);}return null;};}function patchUpdates(_0x454681){return function(_0x5f07e7){try{jsonpatch[_0x8b72('0x21')](_0x5f07e7,_0x454681,!![]);}catch(_0xac0827){return BPromise['reject'](_0xac0827);}return _0x5f07e7[_0x8b72('0x22')]();};}function saveUpdates(_0x1ac2a6,_0x2beb37){return function(_0x4f7516){if(_0x4f7516){return _0x4f7516['update'](_0x1ac2a6)[_0x8b72('0x23')](function(_0x352d63){return _0x352d63;});}return null;};}function removeEntity(_0x996b1f,_0x1366c4){return function(_0x58a13b){if(_0x58a13b){return _0x58a13b[_0x8b72('0x24')]()[_0x8b72('0x23')](function(){_0x996b1f['status'](0xcc)[_0x8b72('0x1b')]();});}};}function handleEntityNotFound(_0x4e7110,_0x9cff1a){return function(_0x2a37c0){if(!_0x2a37c0){_0x4e7110[_0x8b72('0x19')](0x194);}return _0x2a37c0;};}function handleError(_0x16ddc4,_0x53a8bf){_0x53a8bf=_0x53a8bf||0x1f4;return function(_0x1cc828){logger[_0x8b72('0x25')](_0x1cc828[_0x8b72('0x26')]);if(_0x1cc828[_0x8b72('0x27')]){delete _0x1cc828['name'];}_0x16ddc4[_0x8b72('0x1a')](_0x53a8bf)[_0x8b72('0x28')](_0x1cc828);};}exports[_0x8b72('0x29')]=function(_0x1a78ce,_0x35549d){var _0x1056bd={},_0x42be7f={},_0x12584a={'count':0x0,'rows':[]};var _0x5e0f14=_[_0x8b72('0x2a')](db[_0x8b72('0x2b')][_0x8b72('0x2c')],function(_0x575244){return{'name':_0x575244[_0x8b72('0x2d')],'type':_0x575244[_0x8b72('0x2e')]['key']};});_0x42be7f[_0x8b72('0x2f')]=_[_0x8b72('0x2a')](_0x5e0f14,_0x8b72('0x27'));_0x42be7f[_0x8b72('0x30')]=_[_0x8b72('0x31')](_0x1a78ce[_0x8b72('0x30')]);_0x42be7f[_0x8b72('0x32')]=_[_0x8b72('0x33')](_0x42be7f[_0x8b72('0x2f')],_0x42be7f[_0x8b72('0x30')]);_0x1056bd['attributes']=_['intersection'](_0x42be7f[_0x8b72('0x2f')],qs['fields'](_0x1a78ce['query']['fields']));_0x1056bd[_0x8b72('0x34')]=_0x1056bd[_0x8b72('0x34')]['length']?_0x1056bd[_0x8b72('0x34')]:_0x42be7f[_0x8b72('0x2f')];if(!_0x1a78ce[_0x8b72('0x30')][_0x8b72('0x35')](_0x8b72('0x36'))){_0x1056bd['limit']=qs[_0x8b72('0x1f')](_0x1a78ce[_0x8b72('0x30')][_0x8b72('0x1f')]);_0x1056bd['offset']=qs[_0x8b72('0x1d')](_0x1a78ce[_0x8b72('0x30')][_0x8b72('0x1d')]);}_0x1056bd[_0x8b72('0x37')]=qs['sort'](_0x1a78ce[_0x8b72('0x30')][_0x8b72('0x38')]);_0x1056bd[_0x8b72('0x39')]=qs[_0x8b72('0x32')](_[_0x8b72('0x3a')](_0x1a78ce[_0x8b72('0x30')],_0x42be7f[_0x8b72('0x32')]),_0x5e0f14);if(_0x1a78ce[_0x8b72('0x30')]['filter']){_0x1056bd[_0x8b72('0x39')]=_[_0x8b72('0x3b')](_0x1056bd[_0x8b72('0x39')],{'$or':_['map'](_0x5e0f14,function(_0x36a431){if(_0x36a431[_0x8b72('0x2e')]!=='VIRTUAL'){var _0x113521={};_0x113521[_0x36a431[_0x8b72('0x27')]]={'$like':'%'+_0x1a78ce[_0x8b72('0x30')]['filter']+'%'};return _0x113521;}})});}_0x1056bd=_[_0x8b72('0x3b')]({},_0x1056bd,_0x1a78ce[_0x8b72('0x3c')]);var _0x3c35f8={'where':_0x1056bd['where']};return db[_0x8b72('0x2b')][_0x8b72('0x20')](_0x3c35f8)[_0x8b72('0x23')](function(_0x313e01){_0x12584a[_0x8b72('0x20')]=_0x313e01;if(_0x1a78ce['query'][_0x8b72('0x3d')]){_0x1056bd[_0x8b72('0x3e')]=[{'all':!![]}];}return db[_0x8b72('0x2b')]['findAll'](_0x1056bd);})['then'](function(_0x470011){_0x12584a['rows']=_0x470011;return _0x12584a;})['then'](respondWithFilteredResult(_0x35549d,_0x1056bd))[_0x8b72('0x3f')](handleError(_0x35549d,null));};exports[_0x8b72('0x40')]=function(_0x4be7b7,_0x1e72e9){var _0x58f13f={'raw':!![],'where':{'id':_0x4be7b7['params']['id']}},_0x4d3a62={};_0x4d3a62[_0x8b72('0x2f')]=_[_0x8b72('0x31')](db[_0x8b72('0x2b')]['rawAttributes']);_0x4d3a62[_0x8b72('0x30')]=_[_0x8b72('0x31')](_0x4be7b7[_0x8b72('0x30')]);_0x4d3a62[_0x8b72('0x32')]=_[_0x8b72('0x33')](_0x4d3a62[_0x8b72('0x2f')],_0x4d3a62[_0x8b72('0x30')]);_0x58f13f[_0x8b72('0x34')]=_['intersection'](_0x4d3a62['model'],qs[_0x8b72('0x41')](_0x4be7b7[_0x8b72('0x30')]['fields']));_0x58f13f[_0x8b72('0x34')]=_0x58f13f[_0x8b72('0x34')][_0x8b72('0x42')]?_0x58f13f[_0x8b72('0x34')]:_0x4d3a62['model'];if(_0x4be7b7[_0x8b72('0x30')][_0x8b72('0x3d')]){_0x58f13f[_0x8b72('0x3e')]=[{'all':!![]}];}_0x58f13f=_[_0x8b72('0x3b')]({},_0x58f13f,_0x4be7b7['options']);return db[_0x8b72('0x2b')][_0x8b72('0x43')](_0x58f13f)[_0x8b72('0x23')](handleEntityNotFound(_0x1e72e9,null))[_0x8b72('0x23')](respondWithResult(_0x1e72e9,null))['catch'](handleError(_0x1e72e9,null));};exports[_0x8b72('0x44')]=function(_0x3e86d6,_0x541f87){return db[_0x8b72('0x2b')][_0x8b72('0x44')](_0x3e86d6[_0x8b72('0x45')],{})[_0x8b72('0x23')](respondWithResult(_0x541f87,0xc9))['catch'](handleError(_0x541f87,null));};exports['update']=function(_0x2b9703,_0x46351f){if(_0x2b9703[_0x8b72('0x45')]['id']){delete _0x2b9703[_0x8b72('0x45')]['id'];}return db[_0x8b72('0x2b')][_0x8b72('0x43')]({'where':{'id':_0x2b9703[_0x8b72('0x46')]['id']}})[_0x8b72('0x23')](handleEntityNotFound(_0x46351f,null))[_0x8b72('0x23')](saveUpdates(_0x2b9703[_0x8b72('0x45')],null))[_0x8b72('0x23')](respondWithResult(_0x46351f,null))[_0x8b72('0x3f')](handleError(_0x46351f,null));};exports[_0x8b72('0x24')]=function(_0x70029c,_0x58cb97){return db[_0x8b72('0x2b')][_0x8b72('0x43')]({'where':{'id':_0x70029c[_0x8b72('0x46')]['id']}})[_0x8b72('0x23')](handleEntityNotFound(_0x58cb97,null))[_0x8b72('0x23')](removeEntity(_0x58cb97,null))[_0x8b72('0x3f')](handleError(_0x58cb97,null));}; \ No newline at end of file +var _0xadd1=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ServicenowField','findAll','catch','show','params','find','create','body','eml-format'];(function(_0x5de4b5,_0x20b249){var _0x2b5fa7=function(_0x1b1b80){while(--_0x1b1b80){_0x5de4b5['push'](_0x5de4b5['shift']());}};_0x2b5fa7(++_0x20b249);}(_0xadd1,0x167));var _0x1add=function(_0x4ac535,_0x3f5899){_0x4ac535=_0x4ac535-0x0;var _0x18ab19=_0xadd1[_0x4ac535];return _0x18ab19;};'use strict';var emlformat=require(_0x1add('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1add('0x1'));var jsonpatch=require(_0x1add('0x2'));var rp=require(_0x1add('0x3'));var moment=require('moment');var BPromise=require(_0x1add('0x4'));var Mustache=require(_0x1add('0x5'));var util=require('util');var path=require(_0x1add('0x6'));var sox=require(_0x1add('0x7'));var csv=require(_0x1add('0x8'));var ejs=require(_0x1add('0x9'));var fs=require('fs');var fs_extra=require(_0x1add('0xa'));var _=require(_0x1add('0xb'));var squel=require('squel');var crypto=require(_0x1add('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1add('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1add('0xe'));var Papa=require(_0x1add('0xf'));var Redis=require(_0x1add('0x10'));var authService=require(_0x1add('0x11'));var qs=require(_0x1add('0x12'));var as=require(_0x1add('0x13'));var hardwareService=require(_0x1add('0x14'));var logger=require(_0x1add('0x15'))(_0x1add('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1add('0x17'));var db=require(_0x1add('0x18'))['db'];function respondWithStatusCode(_0x11c576,_0x579393){_0x579393=_0x579393||0xcc;return function(_0x2131ab){if(_0x2131ab){return _0x11c576[_0x1add('0x19')](_0x579393);}return _0x11c576[_0x1add('0x1a')](_0x579393)[_0x1add('0x1b')]();};}function respondWithResult(_0x3f7613,_0x2f0dbd){_0x2f0dbd=_0x2f0dbd||0xc8;return function(_0x95676b){if(_0x95676b){return _0x3f7613[_0x1add('0x1a')](_0x2f0dbd)[_0x1add('0x1c')](_0x95676b);}};}function respondWithFilteredResult(_0x2af398,_0x597310){return function(_0x40aa30){if(_0x40aa30){var _0x3511bf=typeof _0x597310[_0x1add('0x1d')]===_0x1add('0x1e')&&typeof _0x597310[_0x1add('0x1f')]===_0x1add('0x1e');var _0x50ac1f=_0x40aa30[_0x1add('0x20')];var _0x2a1716=_0x3511bf?0x0:_0x597310['offset'];var _0x1a9123=_0x3511bf?_0x40aa30['count']:_0x597310[_0x1add('0x1d')]+_0x597310['limit'];var _0x140dbc;if(_0x1a9123>=_0x50ac1f){_0x1a9123=_0x50ac1f;_0x140dbc=0xc8;}else{_0x140dbc=0xce;}_0x2af398[_0x1add('0x1a')](_0x140dbc);return _0x2af398['set'](_0x1add('0x21'),_0x2a1716+'-'+_0x1a9123+'/'+_0x50ac1f)[_0x1add('0x1c')](_0x40aa30);}return null;};}function patchUpdates(_0x4d1362){return function(_0x3c67c4){try{jsonpatch['apply'](_0x3c67c4,_0x4d1362,!![]);}catch(_0x4a5579){return BPromise[_0x1add('0x22')](_0x4a5579);}return _0x3c67c4[_0x1add('0x23')]();};}function saveUpdates(_0x11326e,_0x37af20){return function(_0x428543){if(_0x428543){return _0x428543[_0x1add('0x24')](_0x11326e)[_0x1add('0x25')](function(_0x1117f7){return _0x1117f7;});}return null;};}function removeEntity(_0x549880,_0x5bf9e9){return function(_0x36f474){if(_0x36f474){return _0x36f474[_0x1add('0x26')]()[_0x1add('0x25')](function(){_0x549880[_0x1add('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519eb0,_0x139b0a){return function(_0x1cff26){if(!_0x1cff26){_0x519eb0[_0x1add('0x19')](0x194);}return _0x1cff26;};}function handleError(_0x3afd7e,_0x205888){_0x205888=_0x205888||0x1f4;return function(_0x3a410c){logger[_0x1add('0x27')](_0x3a410c[_0x1add('0x28')]);if(_0x3a410c[_0x1add('0x29')]){delete _0x3a410c[_0x1add('0x29')];}_0x3afd7e['status'](_0x205888)[_0x1add('0x2a')](_0x3a410c);};}exports['index']=function(_0x545539,_0x537baf){var _0x7027ee={},_0x325693={},_0x544673={'count':0x0,'rows':[]};var _0x4b8509=_[_0x1add('0x2b')](db['ServicenowField'][_0x1add('0x2c')],function(_0x1b024d){return{'name':_0x1b024d['fieldName'],'type':_0x1b024d[_0x1add('0x2d')][_0x1add('0x2e')]};});_0x325693[_0x1add('0x2f')]=_[_0x1add('0x2b')](_0x4b8509,_0x1add('0x29'));_0x325693[_0x1add('0x30')]=_[_0x1add('0x31')](_0x545539[_0x1add('0x30')]);_0x325693['filters']=_[_0x1add('0x32')](_0x325693[_0x1add('0x2f')],_0x325693[_0x1add('0x30')]);_0x7027ee[_0x1add('0x33')]=_[_0x1add('0x32')](_0x325693[_0x1add('0x2f')],qs[_0x1add('0x34')](_0x545539[_0x1add('0x30')][_0x1add('0x34')]));_0x7027ee[_0x1add('0x33')]=_0x7027ee[_0x1add('0x33')][_0x1add('0x35')]?_0x7027ee[_0x1add('0x33')]:_0x325693[_0x1add('0x2f')];if(!_0x545539[_0x1add('0x30')][_0x1add('0x36')]('nolimit')){_0x7027ee[_0x1add('0x1f')]=qs[_0x1add('0x1f')](_0x545539['query'][_0x1add('0x1f')]);_0x7027ee[_0x1add('0x1d')]=qs[_0x1add('0x1d')](_0x545539[_0x1add('0x30')][_0x1add('0x1d')]);}_0x7027ee[_0x1add('0x37')]=qs[_0x1add('0x38')](_0x545539[_0x1add('0x30')][_0x1add('0x38')]);_0x7027ee[_0x1add('0x39')]=qs[_0x1add('0x3a')](_[_0x1add('0x3b')](_0x545539['query'],_0x325693[_0x1add('0x3a')]),_0x4b8509);if(_0x545539[_0x1add('0x30')][_0x1add('0x3c')]){_0x7027ee['where']=_['merge'](_0x7027ee[_0x1add('0x39')],{'$or':_[_0x1add('0x2b')](_0x4b8509,function(_0x2dda8b){if(_0x2dda8b[_0x1add('0x2d')]!==_0x1add('0x3d')){var _0x2488db={};_0x2488db[_0x2dda8b[_0x1add('0x29')]]={'$like':'%'+_0x545539[_0x1add('0x30')][_0x1add('0x3c')]+'%'};return _0x2488db;}})});}_0x7027ee=_[_0x1add('0x3e')]({},_0x7027ee,_0x545539[_0x1add('0x3f')]);var _0x4dddc8={'where':_0x7027ee[_0x1add('0x39')]};return db[_0x1add('0x40')][_0x1add('0x20')](_0x4dddc8)['then'](function(_0x28b1e4){_0x544673[_0x1add('0x20')]=_0x28b1e4;if(_0x545539[_0x1add('0x30')]['includeAll']){_0x7027ee['include']=[{'all':!![]}];}return db[_0x1add('0x40')][_0x1add('0x41')](_0x7027ee);})['then'](function(_0x5ed35f){_0x544673['rows']=_0x5ed35f;return _0x544673;})[_0x1add('0x25')](respondWithFilteredResult(_0x537baf,_0x7027ee))[_0x1add('0x42')](handleError(_0x537baf,null));};exports[_0x1add('0x43')]=function(_0x332c19,_0x4fa67b){var _0x2b5a19={'raw':!![],'where':{'id':_0x332c19[_0x1add('0x44')]['id']}},_0x2629ba={};_0x2629ba['model']=_['keys'](db[_0x1add('0x40')][_0x1add('0x2c')]);_0x2629ba[_0x1add('0x30')]=_[_0x1add('0x31')](_0x332c19[_0x1add('0x30')]);_0x2629ba[_0x1add('0x3a')]=_[_0x1add('0x32')](_0x2629ba[_0x1add('0x2f')],_0x2629ba[_0x1add('0x30')]);_0x2b5a19[_0x1add('0x33')]=_[_0x1add('0x32')](_0x2629ba[_0x1add('0x2f')],qs['fields'](_0x332c19[_0x1add('0x30')]['fields']));_0x2b5a19['attributes']=_0x2b5a19[_0x1add('0x33')]['length']?_0x2b5a19['attributes']:_0x2629ba[_0x1add('0x2f')];if(_0x332c19['query']['includeAll']){_0x2b5a19['include']=[{'all':!![]}];}_0x2b5a19=_[_0x1add('0x3e')]({},_0x2b5a19,_0x332c19[_0x1add('0x3f')]);return db[_0x1add('0x40')][_0x1add('0x45')](_0x2b5a19)[_0x1add('0x25')](handleEntityNotFound(_0x4fa67b,null))[_0x1add('0x25')](respondWithResult(_0x4fa67b,null))['catch'](handleError(_0x4fa67b,null));};exports[_0x1add('0x46')]=function(_0x14b360,_0x2cb4d2){return db[_0x1add('0x40')][_0x1add('0x46')](_0x14b360['body'],{})[_0x1add('0x25')](respondWithResult(_0x2cb4d2,0xc9))[_0x1add('0x42')](handleError(_0x2cb4d2,null));};exports[_0x1add('0x24')]=function(_0x383836,_0xe1e9d9){if(_0x383836[_0x1add('0x47')]['id']){delete _0x383836[_0x1add('0x47')]['id'];}return db[_0x1add('0x40')]['find']({'where':{'id':_0x383836[_0x1add('0x44')]['id']}})[_0x1add('0x25')](handleEntityNotFound(_0xe1e9d9,null))[_0x1add('0x25')](saveUpdates(_0x383836[_0x1add('0x47')],null))[_0x1add('0x25')](respondWithResult(_0xe1e9d9,null))[_0x1add('0x42')](handleError(_0xe1e9d9,null));};exports[_0x1add('0x26')]=function(_0x5b5331,_0x32667b){return db[_0x1add('0x40')][_0x1add('0x45')]({'where':{'id':_0x5b5331['params']['id']}})['then'](handleEntityNotFound(_0x32667b,null))[_0x1add('0x25')](removeEntity(_0x32667b,null))['catch'](handleError(_0x32667b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 4a7fa9c..0b4afe5 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 _0xe2dd=['exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x3c2ab0,_0x56c545){var _0x544a5c=function(_0x6fc036){while(--_0x6fc036){_0x3c2ab0['push'](_0x3c2ab0['shift']());}};_0x544a5c(++_0x56c545);}(_0xe2dd,0x92));var _0xde2d=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0xe2dd[_0x36a469];return _0x3347fc;};'use strict';var _=require(_0xde2d('0x0'));var util=require(_0xde2d('0x1'));var logger=require(_0xde2d('0x2'))(_0xde2d('0x3'));var moment=require(_0xde2d('0x4'));var BPromise=require(_0xde2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde2d('0x6'));var config=require(_0xde2d('0x7'));var attributes=require('./intServicenowField.attributes');module[_0xde2d('0x8')]=function(_0x3e29f0,_0x213f26){return _0x3e29f0[_0xde2d('0x9')](_0xde2d('0xa'),attributes,{'tableName':_0xde2d('0xb'),'paranoid':![],'indexes':[{'name':_0xde2d('0xc'),'fields':['idField',_0xde2d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2421=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash'];(function(_0x2f8a7c,_0x3f65fd){var _0x257e01=function(_0x412826){while(--_0x412826){_0x2f8a7c['push'](_0x2f8a7c['shift']());}};_0x257e01(++_0x3f65fd);}(_0x2421,0x12b));var _0x1242=function(_0xbe052d,_0x5687a9){_0xbe052d=_0xbe052d-0x0;var _0x27270c=_0x2421[_0xbe052d];return _0x27270c;};'use strict';var _=require(_0x1242('0x0'));var util=require(_0x1242('0x1'));var logger=require(_0x1242('0x2'))(_0x1242('0x3'));var moment=require(_0x1242('0x4'));var BPromise=require('bluebird');var rp=require(_0x1242('0x5'));var fs=require('fs');var path=require(_0x1242('0x6'));var rimraf=require(_0x1242('0x7'));var config=require(_0x1242('0x8'));var attributes=require(_0x1242('0x9'));module['exports']=function(_0x3c316a,_0x2eccac){return _0x3c316a[_0x1242('0xa')](_0x1242('0xb'),attributes,{'tableName':_0x1242('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1242('0xd'),_0x1242('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 9178742..f1eda79 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x39ad03,_0x6fd75e){var _0x46fa93=function(_0x4279d4){while(--_0x4279d4){_0x39ad03['push'](_0x39ad03['shift']());}};_0x46fa93(++_0x6fd75e);}(_0xaa88,0x137));var _0x8aa8=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0xaa88[_0xc8a11];return _0x55a500;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2dc1a0,_0x29cf94){var _0x3d7e3d=function(_0x25b5d9){while(--_0x25b5d9){_0x2dc1a0['push'](_0x2dc1a0['shift']());}};_0x3d7e3d(++_0x29cf94);}(_0xaa88,0x137));var _0x8aa8=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xaa88[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4f322f9..07d0525 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1af63a,_0x215b9d){var _0x6fe0d4=function(_0x410897){while(--_0x410897){_0x1af63a['push'](_0x1af63a['shift']());}};_0x6fe0d4(++_0x215b9d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x279ff1,_0x474b5){var _0x571459=function(_0x25aa80){while(--_0x25aa80){_0x279ff1['push'](_0x279ff1['shift']());}};_0x571459(++_0x474b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 0c35d1c..fb842d2 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(_0x24605b,_0x1aab1a){var _0x45995f=function(_0x4b66f6){while(--_0x4b66f6){_0x24605b['push'](_0x24605b['shift']());}};_0x45995f(++_0x1aab1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x3d2be5,_0x4c86c1){var _0x175ba8=function(_0x53c053){while(--_0x53c053){_0x3d2be5['push'](_0x3d2be5['shift']());}};_0x175ba8(++_0x4c86c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 2ea5304..6a42cda 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 _0x2756=['remove','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','moment','bluebird','path','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/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','catch','show','intersection','includeAll','find','create','body','params','getConfigurations','findOne','addConfiguration','Subjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','Invalid\x20Login','Password\x20Expired','POST','%s%s','get_module_fields','Calls','values','module_fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2756,0x1ea));var _0x6275=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0x2756[_0x594e11];return _0x5418ad;};'use strict';var emlformat=require(_0x6275('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6275('0x1'));var BPromise=require(_0x6275('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6275('0x3'));var sox=require('sox');var csv=require(_0x6275('0x4'));var ejs=require(_0x6275('0x5'));var fs=require('fs');var fs_extra=require(_0x6275('0x6'));var _=require(_0x6275('0x7'));var squel=require(_0x6275('0x8'));var crypto=require(_0x6275('0x9'));var jsforce=require(_0x6275('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6275('0x4'));var querystring=require(_0x6275('0xb'));var Papa=require(_0x6275('0xc'));var Redis=require(_0x6275('0xd'));var authService=require(_0x6275('0xe'));var qs=require(_0x6275('0xf'));var as=require(_0x6275('0x10'));var hardwareService=require(_0x6275('0x11'));var logger=require(_0x6275('0x12'))(_0x6275('0x13'));var utils=require(_0x6275('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6275('0x15'));var db=require(_0x6275('0x16'))['db'];var integrations=require(_0x6275('0x17'));function respondWithStatusCode(_0xb7f6d4,_0x4f7307){_0x4f7307=_0x4f7307||0xcc;return function(_0x53a985){if(_0x53a985){return _0xb7f6d4[_0x6275('0x18')](_0x4f7307);}return _0xb7f6d4[_0x6275('0x19')](_0x4f7307)['end']();};}function respondWithResult(_0x53d4a1,_0x494d9b){_0x494d9b=_0x494d9b||0xc8;return function(_0x5b600d){if(_0x5b600d){return _0x53d4a1[_0x6275('0x19')](_0x494d9b)[_0x6275('0x1a')](_0x5b600d);}};}function respondWithFilteredResult(_0x52f9fd,_0x4925a6){return function(_0x329f04){if(_0x329f04){var _0x2e841b=typeof _0x4925a6[_0x6275('0x1b')]===_0x6275('0x1c')&&typeof _0x4925a6[_0x6275('0x1d')]===_0x6275('0x1c');var _0x6acaef=_0x329f04['count'];var _0x45a913=_0x2e841b?0x0:_0x4925a6['offset'];var _0x1be40d=_0x2e841b?_0x329f04[_0x6275('0x1e')]:_0x4925a6[_0x6275('0x1b')]+_0x4925a6[_0x6275('0x1d')];var _0x25e99c;if(_0x1be40d>=_0x6acaef){_0x1be40d=_0x6acaef;_0x25e99c=0xc8;}else{_0x25e99c=0xce;}_0x52f9fd['status'](_0x25e99c);return _0x52f9fd[_0x6275('0x1f')](_0x6275('0x20'),_0x45a913+'-'+_0x1be40d+'/'+_0x6acaef)[_0x6275('0x1a')](_0x329f04);}return null;};}function patchUpdates(_0x1f5745){return function(_0x33cb27){try{jsonpatch[_0x6275('0x21')](_0x33cb27,_0x1f5745,!![]);}catch(_0x5b97d7){return BPromise['reject'](_0x5b97d7);}return _0x33cb27[_0x6275('0x22')]();};}function saveUpdates(_0x2e2cbf,_0x3a7c42){return function(_0xfd5f56){if(_0xfd5f56){return _0xfd5f56[_0x6275('0x23')](_0x2e2cbf)[_0x6275('0x24')](function(_0x43958c){return _0x43958c;});}return null;};}function removeEntity(_0x381797,_0xf3402d){return function(_0x29476c){if(_0x29476c){return _0x29476c[_0x6275('0x25')]()[_0x6275('0x24')](function(){_0x381797[_0x6275('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d9f0,_0x46f9df){return function(_0x4823c0){if(!_0x4823c0){_0x52d9f0[_0x6275('0x18')](0x194);}return _0x4823c0;};}function handleError(_0xe09eae,_0xc569d8){_0xc569d8=_0xc569d8||0x1f4;return function(_0x42e7ae){logger['error'](_0x42e7ae[_0x6275('0x26')]);if(_0x42e7ae[_0x6275('0x27')]){delete _0x42e7ae[_0x6275('0x27')];}_0xe09eae[_0x6275('0x19')](_0xc569d8)[_0x6275('0x28')](_0x42e7ae);};}exports[_0x6275('0x29')]=function(_0x1df66e,_0x33e2c4){var _0x2916fb={},_0x1f37e5={},_0x4c967f={'count':0x0,'rows':[]};var _0x462082=_[_0x6275('0x2a')](db[_0x6275('0x2b')][_0x6275('0x2c')],function(_0x53a8ea){return{'name':_0x53a8ea[_0x6275('0x2d')],'type':_0x53a8ea[_0x6275('0x2e')][_0x6275('0x2f')]};});_0x1f37e5[_0x6275('0x30')]=_[_0x6275('0x2a')](_0x462082,'name');_0x1f37e5[_0x6275('0x31')]=_[_0x6275('0x32')](_0x1df66e['query']);_0x1f37e5[_0x6275('0x33')]=_['intersection'](_0x1f37e5[_0x6275('0x30')],_0x1f37e5[_0x6275('0x31')]);_0x2916fb[_0x6275('0x34')]=_['intersection'](_0x1f37e5[_0x6275('0x30')],qs[_0x6275('0x35')](_0x1df66e[_0x6275('0x31')]['fields']));_0x2916fb['attributes']=_0x2916fb[_0x6275('0x34')][_0x6275('0x36')]?_0x2916fb[_0x6275('0x34')]:_0x1f37e5['model'];if(!_0x1df66e[_0x6275('0x31')][_0x6275('0x37')]('nolimit')){_0x2916fb[_0x6275('0x1d')]=qs[_0x6275('0x1d')](_0x1df66e[_0x6275('0x31')][_0x6275('0x1d')]);_0x2916fb[_0x6275('0x1b')]=qs[_0x6275('0x1b')](_0x1df66e[_0x6275('0x31')][_0x6275('0x1b')]);}_0x2916fb[_0x6275('0x38')]=qs['sort'](_0x1df66e[_0x6275('0x31')][_0x6275('0x39')]);_0x2916fb[_0x6275('0x3a')]=qs[_0x6275('0x33')](_[_0x6275('0x3b')](_0x1df66e[_0x6275('0x31')],_0x1f37e5[_0x6275('0x33')]),_0x462082);if(_0x1df66e[_0x6275('0x31')]['filter']){_0x2916fb[_0x6275('0x3a')]=_[_0x6275('0x3c')](_0x2916fb[_0x6275('0x3a')],{'$or':_[_0x6275('0x2a')](_0x462082,function(_0x1e4653){if(_0x1e4653[_0x6275('0x2e')]!=='VIRTUAL'){var _0x1d6970={};_0x1d6970[_0x1e4653['name']]={'$like':'%'+_0x1df66e[_0x6275('0x31')][_0x6275('0x3d')]+'%'};return _0x1d6970;}})});}_0x2916fb=_[_0x6275('0x3c')]({},_0x2916fb,_0x1df66e[_0x6275('0x3e')]);var _0x2457b1={'where':_0x2916fb[_0x6275('0x3a')]};return db[_0x6275('0x2b')][_0x6275('0x1e')](_0x2457b1)['then'](function(_0x346b3b){_0x4c967f[_0x6275('0x1e')]=_0x346b3b;if(_0x1df66e[_0x6275('0x31')]['includeAll']){_0x2916fb[_0x6275('0x3f')]=[{'all':!![]}];}return db[_0x6275('0x2b')][_0x6275('0x40')](_0x2916fb);})[_0x6275('0x24')](function(_0x2e28d6){_0x4c967f['rows']=_0x2e28d6;return _0x4c967f;})[_0x6275('0x24')](respondWithFilteredResult(_0x33e2c4,_0x2916fb))[_0x6275('0x41')](handleError(_0x33e2c4,null));};exports[_0x6275('0x42')]=function(_0x4ed19b,_0x26bde7){var _0x4e530b={'raw':![],'where':{'id':_0x4ed19b['params']['id']}},_0x256fbc={};_0x256fbc[_0x6275('0x30')]=_[_0x6275('0x32')](db['SugarcrmAccount'][_0x6275('0x2c')]);_0x256fbc['query']=_[_0x6275('0x32')](_0x4ed19b[_0x6275('0x31')]);_0x256fbc['filters']=_[_0x6275('0x43')](_0x256fbc[_0x6275('0x30')],_0x256fbc[_0x6275('0x31')]);_0x4e530b[_0x6275('0x34')]=_[_0x6275('0x43')](_0x256fbc['model'],qs[_0x6275('0x35')](_0x4ed19b['query'][_0x6275('0x35')]));_0x4e530b[_0x6275('0x34')]=_0x4e530b[_0x6275('0x34')][_0x6275('0x36')]?_0x4e530b['attributes']:_0x256fbc[_0x6275('0x30')];if(_0x4ed19b['query'][_0x6275('0x44')]){_0x4e530b[_0x6275('0x3f')]=[{'all':!![]}];}_0x4e530b=_[_0x6275('0x3c')]({},_0x4e530b,_0x4ed19b[_0x6275('0x3e')]);return db[_0x6275('0x2b')][_0x6275('0x45')](_0x4e530b)[_0x6275('0x24')](handleEntityNotFound(_0x26bde7,null))[_0x6275('0x24')](respondWithResult(_0x26bde7,null))['catch'](handleError(_0x26bde7,null));};exports[_0x6275('0x46')]=function(_0x519570,_0x51c1c4){return db[_0x6275('0x2b')][_0x6275('0x46')](_0x519570[_0x6275('0x47')],{})[_0x6275('0x24')](respondWithResult(_0x51c1c4,0xc9))[_0x6275('0x41')](handleError(_0x51c1c4,null));};exports[_0x6275('0x23')]=function(_0x21e69e,_0x29a754){if(_0x21e69e[_0x6275('0x47')]['id']){delete _0x21e69e[_0x6275('0x47')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x21e69e[_0x6275('0x48')]['id']}})[_0x6275('0x24')](handleEntityNotFound(_0x29a754,null))[_0x6275('0x24')](saveUpdates(_0x21e69e['body'],null))[_0x6275('0x24')](respondWithResult(_0x29a754,null))['catch'](handleError(_0x29a754,null));};exports[_0x6275('0x25')]=function(_0x49ac5f,_0x474f93){return db[_0x6275('0x2b')][_0x6275('0x45')]({'where':{'id':_0x49ac5f[_0x6275('0x48')]['id']}})['then'](handleEntityNotFound(_0x474f93,null))['then'](removeEntity(_0x474f93,null))[_0x6275('0x41')](handleError(_0x474f93,null));};exports[_0x6275('0x49')]=function(_0x21d74f,_0x3eaf1e,_0x342c09){var _0x34b6c6={};var _0x4ad603={};var _0x222227;var _0x1d2d67;return db[_0x6275('0x2b')][_0x6275('0x4a')]({'where':{'id':_0x21d74f[_0x6275('0x48')]['id']}})['then'](handleEntityNotFound(_0x3eaf1e,null))['then'](function(_0x2adc47){if(_0x2adc47){_0x222227=_0x2adc47;_0x4ad603[_0x6275('0x30')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x4ad603['query']=_[_0x6275('0x32')](_0x21d74f['query']);_0x4ad603[_0x6275('0x33')]=_[_0x6275('0x43')](_0x4ad603['model'],_0x4ad603['query']);_0x34b6c6['attributes']=_['intersection'](_0x4ad603['model'],qs['fields'](_0x21d74f['query'][_0x6275('0x35')]));_0x34b6c6[_0x6275('0x34')]=_0x34b6c6[_0x6275('0x34')][_0x6275('0x36')]?_0x34b6c6[_0x6275('0x34')]:_0x4ad603['model'];_0x34b6c6[_0x6275('0x38')]=qs[_0x6275('0x39')](_0x21d74f[_0x6275('0x31')][_0x6275('0x39')]);_0x34b6c6[_0x6275('0x3a')]=qs[_0x6275('0x33')](_[_0x6275('0x3b')](_0x21d74f[_0x6275('0x31')],_0x4ad603['filters']));if(_0x21d74f[_0x6275('0x31')]['filter']){_0x34b6c6[_0x6275('0x3a')]=_[_0x6275('0x3c')](_0x34b6c6[_0x6275('0x3a')],{'$or':_[_0x6275('0x2a')](_0x34b6c6[_0x6275('0x34')],function(_0x3ff58d){var _0x3062e8={};_0x3062e8[_0x3ff58d]={'$like':'%'+_0x21d74f[_0x6275('0x31')][_0x6275('0x3d')]+'%'};return _0x3062e8;})});}_0x34b6c6=_[_0x6275('0x3c')]({},_0x34b6c6,_0x21d74f[_0x6275('0x3e')]);return _0x222227[_0x6275('0x49')](_0x34b6c6);}})[_0x6275('0x24')](function(_0x240d4e){if(_0x240d4e){_0x1d2d67=_0x240d4e[_0x6275('0x36')];if(!_0x21d74f[_0x6275('0x31')]['hasOwnProperty']('nolimit')){_0x34b6c6[_0x6275('0x1d')]=qs['limit'](_0x21d74f[_0x6275('0x31')][_0x6275('0x1d')]);_0x34b6c6['offset']=qs[_0x6275('0x1b')](_0x21d74f[_0x6275('0x31')][_0x6275('0x1b')]);}return _0x222227[_0x6275('0x49')](_0x34b6c6);}})[_0x6275('0x24')](function(_0x34d20c){if(_0x34d20c){return _0x34d20c?{'count':_0x1d2d67,'rows':_0x34d20c}:null;}})[_0x6275('0x24')](respondWithResult(_0x3eaf1e,null))['catch'](handleError(_0x3eaf1e,null));};exports[_0x6275('0x4b')]=function(_0x1191da,_0x4a41c5,_0x3d9e56){if(_0x1191da[_0x6275('0x47')]['id']){delete _0x1191da[_0x6275('0x47')]['id'];}return db['SugarcrmAccount'][_0x6275('0x4a')]({'where':{'id':_0x1191da['params']['id']}})[_0x6275('0x24')](handleEntityNotFound(_0x4a41c5,null))[_0x6275('0x24')](function(_0x2447d8){if(_0x2447d8){_0x1191da[_0x6275('0x47')]['AccountId']=_0x2447d8['id'];_0x1191da[_0x6275('0x47')][_0x6275('0x4c')]=integrations['getSubjects'](_0x1191da[_0x6275('0x47')][_0x6275('0x4d')],_0x1191da['body'][_0x6275('0x2e')]);_0x1191da[_0x6275('0x47')]['Descriptions']=integrations[_0x6275('0x4e')](_0x1191da[_0x6275('0x47')][_0x6275('0x4d')],_0x1191da[_0x6275('0x47')][_0x6275('0x2e')]);return db['SugarcrmConfiguration'][_0x6275('0x46')](_0x1191da[_0x6275('0x47')],{'include':[{'model':db[_0x6275('0x4f')],'as':_0x6275('0x4c')},{'model':db[_0x6275('0x4f')],'as':_0x6275('0x50')}]});}return null;})[_0x6275('0x24')](respondWithResult(_0x4a41c5,null))['catch'](handleError(_0x4a41c5,null));};exports[_0x6275('0x51')]=function(_0x4ed8b1,_0x532d53,_0x465a60){var _0x275f23='';var _0x3f2267=['id',_0x6275('0x27'),_0x6275('0x52'),_0x6275('0x53'),_0x6275('0x54'),_0x6275('0x55'),'duration_hours','duration_minutes',_0x6275('0x56'),_0x6275('0x57'),_0x6275('0x58'),_0x6275('0x59')];return db['SugarcrmAccount'][_0x6275('0x4a')]({'where':{'id':_0x4ed8b1[_0x6275('0x48')]['id']},'attributes':['id',_0x6275('0x5a'),'password',_0x6275('0x5b')]})[_0x6275('0x24')](handleEntityNotFound(_0x532d53,null))['then'](function(_0x20f70b){if(_0x20f70b){_0x275f23=_0x20f70b['remoteUri'];var _0x1a3840=_0x275f23[_0x6275('0x5c')](-0x1);if(_0x1a3840==='/'){_0x275f23=_0x275f23[_0x6275('0x5d')](0x0,_0x275f23[_0x6275('0x5e')](_0x1a3840));}return rp({'method':'POST','uri':util[_0x6275('0x5f')]('%s%s',_0x275f23,_0x6275('0x60')),'json':!![],'form':{'method':_0x6275('0x61'),'input_type':_0x6275('0x62'),'response_type':'JSON','rest_data':JSON[_0x6275('0x63')]({'user_auth':{'user_name':_0x20f70b[_0x6275('0x5a')],'password':_0x20f70b[_0x6275('0x64')],'encryption':_0x6275('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x6275('0x24')](function(_0x454186){if(_0x454186&&_0x454186[_0x6275('0x27')]!==_0x6275('0x66')&&_0x454186[_0x6275('0x27')]!==_0x6275('0x67')){return rp({'method':_0x6275('0x68'),'uri':util[_0x6275('0x5f')](_0x6275('0x69'),_0x275f23,_0x6275('0x60')),'json':!![],'form':{'method':_0x6275('0x6a'),'input_type':'JSON','response_type':_0x6275('0x62'),'rest_data':JSON[_0x6275('0x63')]({'session':_0x454186['id'],'module_name':_0x6275('0x6b')})}})[_0x6275('0x24')](function(_0x116325){if(_0x116325){var _0x4ecdb9=_[_0x6275('0x6c')](_0x116325[_0x6275('0x6d')]);_[_0x6275('0x6e')](_0x4ecdb9,function(_0x10823c){return _0x3f2267[_0x6275('0x6f')](_0x10823c[_0x6275('0x27')]);});return{'count':_0x4ecdb9['length'],'rows':_[_0x6275('0x2a')](_0x4ecdb9,function(_0x8eb318){return{'id':_0x8eb318[_0x6275('0x27')],'name':_0x8eb318[_0x6275('0x70')],'custom':_[_0x6275('0x71')](_0x8eb318['name'],'_c')?!![]:![],'options':_0x8eb318[_0x6275('0x3e')]?_[_0x6275('0x2a')](_[_0x6275('0x6c')](_0x8eb318[_0x6275('0x3e')]),function(_0x868664){return{'name':_0x868664[_0x6275('0x72')],'value':_0x868664[_0x6275('0x27')]};}):[]};})};}})[_0x6275('0x24')](respondWithResult(_0x532d53,null))[_0x6275('0x41')](function(_0x483d4a){var _0x8eba12=_0x4ed8b1[_0x6275('0x31')][_0x6275('0x73')]?0x1f4:_0x483d4a[_0x6275('0x74')]||0x1f4;logger[_0x6275('0x75')](_0x6275('0x76'),_0x6275('0x51'),_0x8eba12,JSON[_0x6275('0x63')](_0x483d4a));delete _0x483d4a[_0x6275('0x27')];if(_0x8eba12===0x191){_0x8eba12=0x190;}_0x532d53[_0x6275('0x19')](_0x8eba12)[_0x6275('0x28')](_0x4ed8b1['query']['test']?{'message':_0x6275('0x77'),'statusCode':_0x483d4a[_0x6275('0x74')]}:_0x483d4a);});}else{var _0x231b21=0x1f4;_0x532d53['status'](_0x231b21)[_0x6275('0x28')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x78f5=['key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','rows','includeAll','find','create','catch','body','params','nolimit','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','values','includes','label','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','then','error','name','send','map','SugarcrmAccount','rawAttributes','fieldName'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0x78f5,0x12b));var _0x578f=function(_0xdd7a7b,_0x254b3a){_0xdd7a7b=_0xdd7a7b-0x0;var _0x40ca7d=_0x78f5[_0xdd7a7b];return _0x40ca7d;};'use strict';var emlformat=require(_0x578f('0x0'));var rimraf=require(_0x578f('0x1'));var zipdir=require(_0x578f('0x2'));var jsonpatch=require(_0x578f('0x3'));var rp=require(_0x578f('0x4'));var moment=require('moment');var BPromise=require(_0x578f('0x5'));var Mustache=require(_0x578f('0x6'));var util=require('util');var path=require(_0x578f('0x7'));var sox=require('sox');var csv=require(_0x578f('0x8'));var ejs=require(_0x578f('0x9'));var fs=require('fs');var fs_extra=require(_0x578f('0xa'));var _=require(_0x578f('0xb'));var squel=require(_0x578f('0xc'));var crypto=require('crypto');var jsforce=require(_0x578f('0xd'));var deskjs=require(_0x578f('0xe'));var toCsv=require(_0x578f('0x8'));var querystring=require(_0x578f('0xf'));var Papa=require(_0x578f('0x10'));var Redis=require(_0x578f('0x11'));var authService=require(_0x578f('0x12'));var qs=require(_0x578f('0x13'));var as=require(_0x578f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x578f('0x15'))(_0x578f('0x16'));var utils=require(_0x578f('0x17'));var config=require(_0x578f('0x18'));var licenseUtil=require(_0x578f('0x19'));var db=require(_0x578f('0x1a'))['db'];var integrations=require(_0x578f('0x1b'));function respondWithStatusCode(_0x5ddeab,_0x313265){_0x313265=_0x313265||0xcc;return function(_0x2278a9){if(_0x2278a9){return _0x5ddeab[_0x578f('0x1c')](_0x313265);}return _0x5ddeab[_0x578f('0x1d')](_0x313265)[_0x578f('0x1e')]();};}function respondWithResult(_0x2f78d2,_0x284b8b){_0x284b8b=_0x284b8b||0xc8;return function(_0x83e613){if(_0x83e613){return _0x2f78d2['status'](_0x284b8b)[_0x578f('0x1f')](_0x83e613);}};}function respondWithFilteredResult(_0x49a994,_0x467f5e){return function(_0x545f7f){if(_0x545f7f){var _0xed6ff3=typeof _0x467f5e[_0x578f('0x20')]===_0x578f('0x21')&&typeof _0x467f5e[_0x578f('0x22')]==='undefined';var _0x332be3=_0x545f7f[_0x578f('0x23')];var _0x3e92b8=_0xed6ff3?0x0:_0x467f5e[_0x578f('0x20')];var _0x3c3a3c=_0xed6ff3?_0x545f7f[_0x578f('0x23')]:_0x467f5e[_0x578f('0x20')]+_0x467f5e[_0x578f('0x22')];var _0x540da8;if(_0x3c3a3c>=_0x332be3){_0x3c3a3c=_0x332be3;_0x540da8=0xc8;}else{_0x540da8=0xce;}_0x49a994['status'](_0x540da8);return _0x49a994['set'](_0x578f('0x24'),_0x3e92b8+'-'+_0x3c3a3c+'/'+_0x332be3)[_0x578f('0x1f')](_0x545f7f);}return null;};}function patchUpdates(_0xe90a61){return function(_0x1e47e4){try{jsonpatch[_0x578f('0x25')](_0x1e47e4,_0xe90a61,!![]);}catch(_0x1f7c21){return BPromise['reject'](_0x1f7c21);}return _0x1e47e4['save']();};}function saveUpdates(_0x168ebe,_0x4ba31a){return function(_0x30e988){if(_0x30e988){return _0x30e988['update'](_0x168ebe)[_0x578f('0x26')](function(_0x3f576a){return _0x3f576a;});}return null;};}function removeEntity(_0x5008ca,_0x318b8f){return function(_0xcb77ee){if(_0xcb77ee){return _0xcb77ee['destroy']()['then'](function(){_0x5008ca['status'](0xcc)[_0x578f('0x1e')]();});}};}function handleEntityNotFound(_0x304a53,_0x37c606){return function(_0x295ef0){if(!_0x295ef0){_0x304a53[_0x578f('0x1c')](0x194);}return _0x295ef0;};}function handleError(_0x38de52,_0x2ff1f6){_0x2ff1f6=_0x2ff1f6||0x1f4;return function(_0xf3b8f3){logger[_0x578f('0x27')](_0xf3b8f3['stack']);if(_0xf3b8f3['name']){delete _0xf3b8f3[_0x578f('0x28')];}_0x38de52[_0x578f('0x1d')](_0x2ff1f6)[_0x578f('0x29')](_0xf3b8f3);};}exports['index']=function(_0x390808,_0x36b18f){var _0x1ec842={},_0x5e5d25={},_0xd7f73f={'count':0x0,'rows':[]};var _0x45c74c=_[_0x578f('0x2a')](db[_0x578f('0x2b')][_0x578f('0x2c')],function(_0x19ff68){return{'name':_0x19ff68[_0x578f('0x2d')],'type':_0x19ff68['type'][_0x578f('0x2e')]};});_0x5e5d25[_0x578f('0x2f')]=_[_0x578f('0x2a')](_0x45c74c,_0x578f('0x28'));_0x5e5d25['query']=_[_0x578f('0x30')](_0x390808[_0x578f('0x31')]);_0x5e5d25[_0x578f('0x32')]=_[_0x578f('0x33')](_0x5e5d25[_0x578f('0x2f')],_0x5e5d25[_0x578f('0x31')]);_0x1ec842['attributes']=_['intersection'](_0x5e5d25[_0x578f('0x2f')],qs[_0x578f('0x34')](_0x390808[_0x578f('0x31')][_0x578f('0x34')]));_0x1ec842[_0x578f('0x35')]=_0x1ec842[_0x578f('0x35')][_0x578f('0x36')]?_0x1ec842[_0x578f('0x35')]:_0x5e5d25['model'];if(!_0x390808[_0x578f('0x31')][_0x578f('0x37')]('nolimit')){_0x1ec842[_0x578f('0x22')]=qs[_0x578f('0x22')](_0x390808[_0x578f('0x31')][_0x578f('0x22')]);_0x1ec842['offset']=qs[_0x578f('0x20')](_0x390808[_0x578f('0x31')][_0x578f('0x20')]);}_0x1ec842[_0x578f('0x38')]=qs[_0x578f('0x39')](_0x390808[_0x578f('0x31')]['sort']);_0x1ec842[_0x578f('0x3a')]=qs[_0x578f('0x32')](_[_0x578f('0x3b')](_0x390808[_0x578f('0x31')],_0x5e5d25[_0x578f('0x32')]),_0x45c74c);if(_0x390808[_0x578f('0x31')]['filter']){_0x1ec842[_0x578f('0x3a')]=_['merge'](_0x1ec842['where'],{'$or':_[_0x578f('0x2a')](_0x45c74c,function(_0x238c62){if(_0x238c62[_0x578f('0x3c')]!==_0x578f('0x3d')){var _0x1833bd={};_0x1833bd[_0x238c62[_0x578f('0x28')]]={'$like':'%'+_0x390808['query'][_0x578f('0x3e')]+'%'};return _0x1833bd;}})});}_0x1ec842=_[_0x578f('0x3f')]({},_0x1ec842,_0x390808[_0x578f('0x40')]);var _0x56e3d6={'where':_0x1ec842[_0x578f('0x3a')]};return db[_0x578f('0x2b')][_0x578f('0x23')](_0x56e3d6)[_0x578f('0x26')](function(_0x167129){_0xd7f73f[_0x578f('0x23')]=_0x167129;if(_0x390808['query']['includeAll']){_0x1ec842[_0x578f('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x1ec842);})[_0x578f('0x26')](function(_0x3c51b0){_0xd7f73f[_0x578f('0x42')]=_0x3c51b0;return _0xd7f73f;})[_0x578f('0x26')](respondWithFilteredResult(_0x36b18f,_0x1ec842))['catch'](handleError(_0x36b18f,null));};exports['show']=function(_0x5ae397,_0x228df0){var _0x24abbe={'raw':![],'where':{'id':_0x5ae397['params']['id']}},_0x2a2161={};_0x2a2161[_0x578f('0x2f')]=_[_0x578f('0x30')](db[_0x578f('0x2b')][_0x578f('0x2c')]);_0x2a2161[_0x578f('0x31')]=_[_0x578f('0x30')](_0x5ae397[_0x578f('0x31')]);_0x2a2161[_0x578f('0x32')]=_['intersection'](_0x2a2161['model'],_0x2a2161[_0x578f('0x31')]);_0x24abbe[_0x578f('0x35')]=_[_0x578f('0x33')](_0x2a2161['model'],qs[_0x578f('0x34')](_0x5ae397[_0x578f('0x31')][_0x578f('0x34')]));_0x24abbe[_0x578f('0x35')]=_0x24abbe[_0x578f('0x35')][_0x578f('0x36')]?_0x24abbe['attributes']:_0x2a2161[_0x578f('0x2f')];if(_0x5ae397[_0x578f('0x31')][_0x578f('0x43')]){_0x24abbe['include']=[{'all':!![]}];}_0x24abbe=_[_0x578f('0x3f')]({},_0x24abbe,_0x5ae397[_0x578f('0x40')]);return db[_0x578f('0x2b')][_0x578f('0x44')](_0x24abbe)[_0x578f('0x26')](handleEntityNotFound(_0x228df0,null))[_0x578f('0x26')](respondWithResult(_0x228df0,null))['catch'](handleError(_0x228df0,null));};exports[_0x578f('0x45')]=function(_0x29efdb,_0x11267b){return db['SugarcrmAccount'][_0x578f('0x45')](_0x29efdb['body'],{})[_0x578f('0x26')](respondWithResult(_0x11267b,0xc9))[_0x578f('0x46')](handleError(_0x11267b,null));};exports['update']=function(_0x5ed825,_0x115992){if(_0x5ed825[_0x578f('0x47')]['id']){delete _0x5ed825['body']['id'];}return db[_0x578f('0x2b')][_0x578f('0x44')]({'where':{'id':_0x5ed825[_0x578f('0x48')]['id']}})[_0x578f('0x26')](handleEntityNotFound(_0x115992,null))[_0x578f('0x26')](saveUpdates(_0x5ed825[_0x578f('0x47')],null))[_0x578f('0x26')](respondWithResult(_0x115992,null))[_0x578f('0x46')](handleError(_0x115992,null));};exports['destroy']=function(_0x1cc4d0,_0x4c7606){return db['SugarcrmAccount']['find']({'where':{'id':_0x1cc4d0[_0x578f('0x48')]['id']}})[_0x578f('0x26')](handleEntityNotFound(_0x4c7606,null))['then'](removeEntity(_0x4c7606,null))[_0x578f('0x46')](handleError(_0x4c7606,null));};exports['getConfigurations']=function(_0x35884b,_0x2e8f9f,_0x58e041){var _0x42ac10={};var _0x110a10={};var _0xc750cb;var _0x1770a5;return db[_0x578f('0x2b')]['findOne']({'where':{'id':_0x35884b[_0x578f('0x48')]['id']}})[_0x578f('0x26')](handleEntityNotFound(_0x2e8f9f,null))[_0x578f('0x26')](function(_0x22de9b){if(_0x22de9b){_0xc750cb=_0x22de9b;_0x110a10[_0x578f('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0x578f('0x2c')]);_0x110a10[_0x578f('0x31')]=_[_0x578f('0x30')](_0x35884b[_0x578f('0x31')]);_0x110a10[_0x578f('0x32')]=_['intersection'](_0x110a10[_0x578f('0x2f')],_0x110a10[_0x578f('0x31')]);_0x42ac10[_0x578f('0x35')]=_[_0x578f('0x33')](_0x110a10['model'],qs[_0x578f('0x34')](_0x35884b[_0x578f('0x31')][_0x578f('0x34')]));_0x42ac10[_0x578f('0x35')]=_0x42ac10[_0x578f('0x35')][_0x578f('0x36')]?_0x42ac10['attributes']:_0x110a10[_0x578f('0x2f')];_0x42ac10[_0x578f('0x38')]=qs[_0x578f('0x39')](_0x35884b[_0x578f('0x31')][_0x578f('0x39')]);_0x42ac10[_0x578f('0x3a')]=qs[_0x578f('0x32')](_[_0x578f('0x3b')](_0x35884b[_0x578f('0x31')],_0x110a10[_0x578f('0x32')]));if(_0x35884b[_0x578f('0x31')]['filter']){_0x42ac10[_0x578f('0x3a')]=_[_0x578f('0x3f')](_0x42ac10['where'],{'$or':_['map'](_0x42ac10[_0x578f('0x35')],function(_0x2ddff4){var _0x55f1ea={};_0x55f1ea[_0x2ddff4]={'$like':'%'+_0x35884b[_0x578f('0x31')][_0x578f('0x3e')]+'%'};return _0x55f1ea;})});}_0x42ac10=_[_0x578f('0x3f')]({},_0x42ac10,_0x35884b[_0x578f('0x40')]);return _0xc750cb['getConfigurations'](_0x42ac10);}})['then'](function(_0x28ae0b){if(_0x28ae0b){_0x1770a5=_0x28ae0b['length'];if(!_0x35884b[_0x578f('0x31')][_0x578f('0x37')](_0x578f('0x49'))){_0x42ac10[_0x578f('0x22')]=qs[_0x578f('0x22')](_0x35884b[_0x578f('0x31')][_0x578f('0x22')]);_0x42ac10[_0x578f('0x20')]=qs[_0x578f('0x20')](_0x35884b[_0x578f('0x31')][_0x578f('0x20')]);}return _0xc750cb[_0x578f('0x4a')](_0x42ac10);}})[_0x578f('0x26')](function(_0x1baa6e){if(_0x1baa6e){return _0x1baa6e?{'count':_0x1770a5,'rows':_0x1baa6e}:null;}})[_0x578f('0x26')](respondWithResult(_0x2e8f9f,null))[_0x578f('0x46')](handleError(_0x2e8f9f,null));};exports[_0x578f('0x4b')]=function(_0x514e4d,_0x14f081,_0xd55a9){if(_0x514e4d[_0x578f('0x47')]['id']){delete _0x514e4d['body']['id'];}return db[_0x578f('0x2b')][_0x578f('0x4c')]({'where':{'id':_0x514e4d[_0x578f('0x48')]['id']}})[_0x578f('0x26')](handleEntityNotFound(_0x14f081,null))[_0x578f('0x26')](function(_0x7929ea){if(_0x7929ea){_0x514e4d[_0x578f('0x47')][_0x578f('0x4d')]=_0x7929ea['id'];_0x514e4d[_0x578f('0x47')][_0x578f('0x4e')]=integrations['getSubjects'](_0x514e4d[_0x578f('0x47')][_0x578f('0x4f')],_0x514e4d[_0x578f('0x47')]['type']);_0x514e4d['body'][_0x578f('0x50')]=integrations[_0x578f('0x51')](_0x514e4d[_0x578f('0x47')][_0x578f('0x4f')],_0x514e4d[_0x578f('0x47')][_0x578f('0x3c')]);return db[_0x578f('0x52')][_0x578f('0x45')](_0x514e4d[_0x578f('0x47')],{'include':[{'model':db[_0x578f('0x53')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x578f('0x50')}]});}return null;})[_0x578f('0x26')](respondWithResult(_0x14f081,null))[_0x578f('0x46')](handleError(_0x14f081,null));};exports[_0x578f('0x54')]=function(_0x4dbfda,_0x50de89,_0x1430d5){var _0x19ca66='';var _0xef0c8f=['id',_0x578f('0x28'),_0x578f('0x55'),'created_by','description',_0x578f('0x56'),_0x578f('0x57'),_0x578f('0x58'),_0x578f('0x59'),_0x578f('0x5a'),_0x578f('0x5b'),'direction'];return db['SugarcrmAccount'][_0x578f('0x4c')]({'where':{'id':_0x4dbfda['params']['id']},'attributes':['id','username',_0x578f('0x5c'),_0x578f('0x5d')]})['then'](handleEntityNotFound(_0x50de89,null))[_0x578f('0x26')](function(_0xbd5c6b){if(_0xbd5c6b){_0x19ca66=_0xbd5c6b[_0x578f('0x5d')];var _0x3b850f=_0x19ca66[_0x578f('0x5e')](-0x1);if(_0x3b850f==='/'){_0x19ca66=_0x19ca66[_0x578f('0x5f')](0x0,_0x19ca66[_0x578f('0x60')](_0x3b850f));}return rp({'method':_0x578f('0x61'),'uri':util[_0x578f('0x62')](_0x578f('0x63'),_0x19ca66,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x578f('0x64'),'input_type':_0x578f('0x65'),'response_type':_0x578f('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xbd5c6b['username'],'password':_0xbd5c6b[_0x578f('0x5c')],'encryption':_0x578f('0x66')},'application':_0x578f('0x67')})}});}})['then'](function(_0x559115){if(_0x559115&&_0x559115[_0x578f('0x28')]!==_0x578f('0x68')&&_0x559115['name']!==_0x578f('0x69')){return rp({'method':'POST','uri':util[_0x578f('0x62')](_0x578f('0x63'),_0x19ca66,_0x578f('0x6a')),'json':!![],'form':{'method':_0x578f('0x6b'),'input_type':_0x578f('0x65'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x559115['id'],'module_name':_0x578f('0x6c')})}})[_0x578f('0x26')](function(_0xe7f146){if(_0xe7f146){var _0x3317d3=_[_0x578f('0x6d')](_0xe7f146['module_fields']);_['remove'](_0x3317d3,function(_0x68482f){return _0xef0c8f[_0x578f('0x6e')](_0x68482f[_0x578f('0x28')]);});return{'count':_0x3317d3['length'],'rows':_[_0x578f('0x2a')](_0x3317d3,function(_0x45c0b1){return{'id':_0x45c0b1[_0x578f('0x28')],'name':_0x45c0b1[_0x578f('0x6f')],'custom':_[_0x578f('0x70')](_0x45c0b1[_0x578f('0x28')],'_c')?!![]:![],'options':_0x45c0b1[_0x578f('0x40')]?_[_0x578f('0x2a')](_[_0x578f('0x6d')](_0x45c0b1[_0x578f('0x40')]),function(_0x2dc828){return{'name':_0x2dc828['value'],'value':_0x2dc828[_0x578f('0x28')]};}):[]};})};}})[_0x578f('0x26')](respondWithResult(_0x50de89,null))[_0x578f('0x46')](function(_0x30b5bf){var _0x52e9b8=_0x4dbfda[_0x578f('0x31')]['test']?0x1f4:_0x30b5bf[_0x578f('0x71')]||0x1f4;logger['error'](_0x578f('0x72'),_0x578f('0x54'),_0x52e9b8,JSON['stringify'](_0x30b5bf));delete _0x30b5bf[_0x578f('0x28')];if(_0x52e9b8===0x191){_0x52e9b8=0x190;}_0x50de89[_0x578f('0x1d')](_0x52e9b8)[_0x578f('0x29')](_0x4dbfda[_0x578f('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x30b5bf['statusCode']}:_0x30b5bf);});}else{var _0x1ebbff=0x1f4;_0x50de89[_0x578f('0x1d')](_0x1ebbff)[_0x578f('0x29')]({'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 d1946cb..3e05f8e 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 _0x3826=['bluebird','rimraf','../../config/environment','./intSugarcrmAccount.attributes','SugarcrmAccount','lodash','util','../../config/logger','moment'];(function(_0x349054,_0x8dc160){var _0x301f52=function(_0x1dd0c7){while(--_0x1dd0c7){_0x349054['push'](_0x349054['shift']());}};_0x301f52(++_0x8dc160);}(_0x3826,0x83));var _0x6382=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x3826[_0x5af59e];return _0x4240df;};'use strict';var _=require(_0x6382('0x0'));var util=require(_0x6382('0x1'));var logger=require(_0x6382('0x2'))('api');var moment=require(_0x6382('0x3'));var BPromise=require(_0x6382('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6382('0x5'));var config=require(_0x6382('0x6'));var attributes=require(_0x6382('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x575375,_0x2be130){return _0x575375['define'](_0x6382('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x845f=['bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment'];(function(_0x231023,_0x335e88){var _0x3579ee=function(_0x241b57){while(--_0x241b57){_0x231023['push'](_0x231023['shift']());}};_0x3579ee(++_0x335e88);}(_0x845f,0x1b8));var _0xf845=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x845f[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0xf845('0x0'));var util=require(_0xf845('0x1'));var logger=require(_0xf845('0x2'))('api');var moment=require(_0xf845('0x3'));var BPromise=require(_0xf845('0x4'));var rp=require(_0xf845('0x5'));var fs=require('fs');var path=require(_0xf845('0x6'));var rimraf=require(_0xf845('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xf845('0x8'));module[_0xf845('0x9')]=function(_0x1efcaa,_0x21cea){return _0x1efcaa['define'](_0xf845('0xa'),attributes,{'tableName':_0xf845('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 2179539..665ade0 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 _0x4b07=['ShowSugarcrmAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetSugarcrmAccount'];(function(_0x2f96e1,_0x5632ad){var _0xd484f4=function(_0x8aaf9e){while(--_0x8aaf9e){_0x2f96e1['push'](_0x2f96e1['shift']());}};_0xd484f4(++_0x5632ad);}(_0x4b07,0xf0));var _0x74b0=function(_0x52b591,_0x4a0e5f){_0x52b591=_0x52b591-0x0;var _0x2c9dd7=_0x4b07[_0x52b591];return _0x2c9dd7;};'use strict';var _=require(_0x74b0('0x0'));var util=require('util');var moment=require(_0x74b0('0x1'));var BPromise=require(_0x74b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74b0('0x3'));var db=require(_0x74b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x74b0('0x5'))(_0x74b0('0x6'));var config=require(_0x74b0('0x7'));var jayson=require(_0x74b0('0x8'));var client=jayson[_0x74b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1272ae,_0x1d2e66,_0x580a99){return new BPromise(function(_0x3f4f47,_0xd0d52d){return client[_0x74b0('0xa')](_0x1272ae,_0x580a99)[_0x74b0('0xb')](function(_0x128308){logger[_0x74b0('0xc')](_0x74b0('0xd'),_0x1d2e66,_0x74b0('0xe'));logger[_0x74b0('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1d2e66,_0x74b0('0xe'),JSON[_0x74b0('0x10')](_0x128308));if(_0x128308['error']){if(_0x128308[_0x74b0('0x11')][_0x74b0('0x12')]===0x1f4){logger[_0x74b0('0x11')](_0x74b0('0xd'),_0x1d2e66,_0x128308['error'][_0x74b0('0x13')]);return _0xd0d52d(_0x128308[_0x74b0('0x11')][_0x74b0('0x13')]);}logger[_0x74b0('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x1d2e66,_0x128308['error'][_0x74b0('0x13')]);return _0x3f4f47(_0x128308['error']['message']);}else{logger[_0x74b0('0xc')](_0x74b0('0xd'),_0x1d2e66,'request\x20sent');_0x3f4f47(_0x128308[_0x74b0('0x14')][_0x74b0('0x13')]);}})['catch'](function(_0x381ea6){logger[_0x74b0('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x1d2e66,_0x381ea6);_0xd0d52d(_0x381ea6);});});}exports['GetSugarcrmAccount']=function(_0x2114ed){var _0x53fd81=this;return new Promise(function(_0x3f071a,_0x15e015){return db[_0x74b0('0x15')][_0x74b0('0x16')]({'raw':_0x2114ed[_0x74b0('0x17')]?_0x2114ed[_0x74b0('0x17')][_0x74b0('0x18')]===undefined?!![]:![]:!![],'where':_0x2114ed[_0x74b0('0x17')]?_0x2114ed[_0x74b0('0x17')][_0x74b0('0x19')]||null:null,'attributes':_0x2114ed[_0x74b0('0x17')]?_0x2114ed[_0x74b0('0x17')][_0x74b0('0x1a')]||null:null,'limit':_0x2114ed['options']?_0x2114ed['options'][_0x74b0('0x1b')]||null:null,'include':_0x2114ed[_0x74b0('0x17')]?_0x2114ed[_0x74b0('0x17')][_0x74b0('0x1c')]?_['map'](_0x2114ed[_0x74b0('0x17')][_0x74b0('0x1c')],function(_0x4ad104){return{'model':db[_0x4ad104[_0x74b0('0x1d')]],'as':_0x4ad104['as'],'attributes':_0x4ad104[_0x74b0('0x1a')],'include':_0x4ad104[_0x74b0('0x1c')]?_[_0x74b0('0x1e')](_0x4ad104[_0x74b0('0x1c')],function(_0xbc20f){return{'model':db[_0xbc20f[_0x74b0('0x1d')]],'as':_0xbc20f['as'],'attributes':_0xbc20f[_0x74b0('0x1a')],'include':_0xbc20f['include']?_['map'](_0xbc20f[_0x74b0('0x1c')],function(_0x3a6c5e){return{'model':db[_0x3a6c5e[_0x74b0('0x1d')]],'as':_0x3a6c5e['as'],'attributes':_0x3a6c5e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x423c65){logger[_0x74b0('0xc')](_0x74b0('0x1f'),_0x2114ed);logger[_0x74b0('0xf')](_0x74b0('0x1f'),_0x2114ed,JSON[_0x74b0('0x10')](_0x423c65));_0x3f071a(_0x423c65);})['catch'](function(_0x3f8bfa){logger[_0x74b0('0x11')](_0x74b0('0x1f'),_0x3f8bfa['message'],_0x2114ed);_0x15e015(_0x53fd81[_0x74b0('0x11')](0x1f4,_0x3f8bfa[_0x74b0('0x13')]));});});};exports[_0x74b0('0x20')]=function(_0x4521c8){var _0x482cb7=this;return new Promise(function(_0x140e1d,_0x1b1ddf){return db[_0x74b0('0x15')][_0x74b0('0x21')]({'raw':_0x4521c8[_0x74b0('0x17')]?_0x4521c8[_0x74b0('0x17')][_0x74b0('0x18')]===undefined?!![]:![]:!![],'where':_0x4521c8[_0x74b0('0x17')]?_0x4521c8['options'][_0x74b0('0x19')]||null:null,'attributes':_0x4521c8['options']?_0x4521c8[_0x74b0('0x17')][_0x74b0('0x1a')]||null:null,'include':_0x4521c8[_0x74b0('0x17')]?_0x4521c8['options'][_0x74b0('0x1c')]?_[_0x74b0('0x1e')](_0x4521c8['options'][_0x74b0('0x1c')],function(_0x5edb3c){return{'model':db[_0x5edb3c[_0x74b0('0x1d')]],'as':_0x5edb3c['as'],'attributes':_0x5edb3c[_0x74b0('0x1a')],'include':_0x5edb3c[_0x74b0('0x1c')]?_[_0x74b0('0x1e')](_0x5edb3c[_0x74b0('0x1c')],function(_0x495a6b){return{'model':db[_0x495a6b['model']],'as':_0x495a6b['as'],'attributes':_0x495a6b[_0x74b0('0x1a')],'include':_0x495a6b['include']?_[_0x74b0('0x1e')](_0x495a6b['include'],function(_0x5d14bf){return{'model':db[_0x5d14bf[_0x74b0('0x1d')]],'as':_0x5d14bf['as'],'attributes':_0x5d14bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x74b0('0xb')](function(_0x1f17b5){logger[_0x74b0('0xc')]('ShowSugarcrmAccount',_0x4521c8);logger[_0x74b0('0xf')]('ShowSugarcrmAccount',_0x4521c8,JSON[_0x74b0('0x10')](_0x1f17b5));_0x140e1d(_0x1f17b5);})['catch'](function(_0x3047ef){logger[_0x74b0('0x11')]('ShowSugarcrmAccount',_0x3047ef[_0x74b0('0x13')],_0x4521c8);_0x1b1ddf(_0x482cb7['error'](0x1f4,_0x3047ef[_0x74b0('0x13')]));});});}; \ No newline at end of file +var _0x7163=['options','raw','where','include','map','attributes','model','find','ShowSugarcrmAccount','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x46e1b3,_0x3567d1){var _0x2cc460=function(_0x292a60){while(--_0x292a60){_0x46e1b3['push'](_0x46e1b3['shift']());}};_0x2cc460(++_0x3567d1);}(_0x7163,0x1a1));var _0x3716=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x7163[_0x65c50e];return _0x4573e7;};'use strict';var _=require(_0x3716('0x0'));var util=require('util');var moment=require(_0x3716('0x1'));var BPromise=require('bluebird');var rs=require(_0x3716('0x2'));var fs=require('fs');var Redis=require(_0x3716('0x3'));var db=require(_0x3716('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3716('0x5'));var config=require(_0x3716('0x6'));var jayson=require(_0x3716('0x7'));var client=jayson[_0x3716('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39fe9c,_0x4a92ed,_0x185d62){return new BPromise(function(_0x5cad5f,_0x557f51){return client[_0x3716('0x9')](_0x39fe9c,_0x185d62)[_0x3716('0xa')](function(_0x44ac7a){logger[_0x3716('0xb')](_0x3716('0xc'),_0x4a92ed,_0x3716('0xd'));logger[_0x3716('0xe')](_0x3716('0xf'),_0x4a92ed,'request\x20sent',JSON[_0x3716('0x10')](_0x44ac7a));if(_0x44ac7a[_0x3716('0x11')]){if(_0x44ac7a['error'][_0x3716('0x12')]===0x1f4){logger['error'](_0x3716('0xc'),_0x4a92ed,_0x44ac7a['error'][_0x3716('0x13')]);return _0x557f51(_0x44ac7a['error'][_0x3716('0x13')]);}logger[_0x3716('0x11')](_0x3716('0xc'),_0x4a92ed,_0x44ac7a[_0x3716('0x11')][_0x3716('0x13')]);return _0x5cad5f(_0x44ac7a[_0x3716('0x11')][_0x3716('0x13')]);}else{logger[_0x3716('0xb')](_0x3716('0xc'),_0x4a92ed,_0x3716('0xd'));_0x5cad5f(_0x44ac7a[_0x3716('0x14')][_0x3716('0x13')]);}})[_0x3716('0x15')](function(_0x484afb){logger[_0x3716('0x11')](_0x3716('0xc'),_0x4a92ed,_0x484afb);_0x557f51(_0x484afb);});});}exports[_0x3716('0x16')]=function(_0x32fff9){var _0x3210cd=this;return new Promise(function(_0x1216f0,_0x4519cc){return db[_0x3716('0x17')][_0x3716('0x18')]({'raw':_0x32fff9[_0x3716('0x19')]?_0x32fff9[_0x3716('0x19')][_0x3716('0x1a')]===undefined?!![]:![]:!![],'where':_0x32fff9['options']?_0x32fff9['options'][_0x3716('0x1b')]||null:null,'attributes':_0x32fff9[_0x3716('0x19')]?_0x32fff9['options']['attributes']||null:null,'limit':_0x32fff9[_0x3716('0x19')]?_0x32fff9[_0x3716('0x19')]['limit']||null:null,'include':_0x32fff9[_0x3716('0x19')]?_0x32fff9[_0x3716('0x19')][_0x3716('0x1c')]?_[_0x3716('0x1d')](_0x32fff9[_0x3716('0x19')][_0x3716('0x1c')],function(_0x478b9a){return{'model':db[_0x478b9a['model']],'as':_0x478b9a['as'],'attributes':_0x478b9a[_0x3716('0x1e')],'include':_0x478b9a[_0x3716('0x1c')]?_[_0x3716('0x1d')](_0x478b9a[_0x3716('0x1c')],function(_0x3a7504){return{'model':db[_0x3a7504[_0x3716('0x1f')]],'as':_0x3a7504['as'],'attributes':_0x3a7504[_0x3716('0x1e')],'include':_0x3a7504[_0x3716('0x1c')]?_['map'](_0x3a7504[_0x3716('0x1c')],function(_0x28ab17){return{'model':db[_0x28ab17[_0x3716('0x1f')]],'as':_0x28ab17['as'],'attributes':_0x28ab17['attributes']};}):[]};}):[]};}):[]:[]})[_0x3716('0xa')](function(_0x2ed958){logger['info'](_0x3716('0x16'),_0x32fff9);logger[_0x3716('0xe')](_0x3716('0x16'),_0x32fff9,JSON[_0x3716('0x10')](_0x2ed958));_0x1216f0(_0x2ed958);})[_0x3716('0x15')](function(_0x2e7260){logger[_0x3716('0x11')](_0x3716('0x16'),_0x2e7260[_0x3716('0x13')],_0x32fff9);_0x4519cc(_0x3210cd[_0x3716('0x11')](0x1f4,_0x2e7260['message']));});});};exports['ShowSugarcrmAccount']=function(_0x51100f){var _0x451400=this;return new Promise(function(_0x307a3e,_0x533980){return db[_0x3716('0x17')][_0x3716('0x20')]({'raw':_0x51100f[_0x3716('0x19')]?_0x51100f['options']['raw']===undefined?!![]:![]:!![],'where':_0x51100f[_0x3716('0x19')]?_0x51100f[_0x3716('0x19')]['where']||null:null,'attributes':_0x51100f[_0x3716('0x19')]?_0x51100f[_0x3716('0x19')][_0x3716('0x1e')]||null:null,'include':_0x51100f['options']?_0x51100f[_0x3716('0x19')][_0x3716('0x1c')]?_[_0x3716('0x1d')](_0x51100f['options'][_0x3716('0x1c')],function(_0x4902a7){return{'model':db[_0x4902a7[_0x3716('0x1f')]],'as':_0x4902a7['as'],'attributes':_0x4902a7[_0x3716('0x1e')],'include':_0x4902a7['include']?_[_0x3716('0x1d')](_0x4902a7['include'],function(_0x35bf0e){return{'model':db[_0x35bf0e['model']],'as':_0x35bf0e['as'],'attributes':_0x35bf0e['attributes'],'include':_0x35bf0e[_0x3716('0x1c')]?_[_0x3716('0x1d')](_0x35bf0e[_0x3716('0x1c')],function(_0x960d9c){return{'model':db[_0x960d9c[_0x3716('0x1f')]],'as':_0x960d9c['as'],'attributes':_0x960d9c[_0x3716('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c92ee){logger['info'](_0x3716('0x21'),_0x51100f);logger[_0x3716('0xe')]('ShowSugarcrmAccount',_0x51100f,JSON[_0x3716('0x10')](_0x3c92ee));_0x307a3e(_0x3c92ee);})['catch'](function(_0x24107c){logger[_0x3716('0x11')](_0x3716('0x21'),_0x24107c[_0x3716('0x13')],_0x51100f);_0x533980(_0x451400[_0x3716('0x11')](0x1f4,_0x24107c[_0x3716('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f8d9964..e76e2ac 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 _0x007c=['/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x007c,0x87));var _0xc007=function(_0x2247c5,_0x8d6777){_0x2247c5=_0x2247c5-0x0;var _0x49152a=_0x007c[_0x2247c5];return _0x49152a;};'use strict';var multer=require(_0xc007('0x0'));var util=require(_0xc007('0x1'));var path=require(_0xc007('0x2'));var timeout=require(_0xc007('0x3'));var express=require(_0xc007('0x4'));var router=express[_0xc007('0x5')]();var fs_extra=require(_0xc007('0x6'));var auth=require(_0xc007('0x7'));var interaction=require(_0xc007('0x8'));var config=require('../../config/environment');var controller=require(_0xc007('0x9'));router[_0xc007('0xa')]('/',auth[_0xc007('0xb')](),controller[_0xc007('0xc')]);router[_0xc007('0xa')]('/:id',auth[_0xc007('0xb')](),controller[_0xc007('0xd')]);router[_0xc007('0xa')]('/:id/fields',auth[_0xc007('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xc007('0xb')](),controller['getSubjects']);router[_0xc007('0xa')](_0xc007('0xe'),auth['isAuthenticated'](),controller[_0xc007('0xf')]);router[_0xc007('0x10')]('/',auth[_0xc007('0xb')](),controller[_0xc007('0x11')]);router[_0xc007('0x12')](_0xc007('0x13'),auth[_0xc007('0xb')](),controller[_0xc007('0x14')]);router['delete'](_0xc007('0x13'),auth['isAuthenticated'](),controller[_0xc007('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf7ad=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x1d3bb1,_0x6ab85f){var _0x552c35=function(_0x1b69cc){while(--_0x1b69cc){_0x1d3bb1['push'](_0x1d3bb1['shift']());}};_0x552c35(++_0x6ab85f);}(_0xf7ad,0x14f));var _0xdf7a=function(_0x2e2976,_0x4eba59){_0x2e2976=_0x2e2976-0x0;var _0x2385a4=_0xf7ad[_0x2e2976];return _0x2385a4;};'use strict';var multer=require('multer');var util=require(_0xdf7a('0x0'));var path=require(_0xdf7a('0x1'));var timeout=require(_0xdf7a('0x2'));var express=require(_0xdf7a('0x3'));var router=express[_0xdf7a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdf7a('0x5'));var config=require(_0xdf7a('0x6'));var controller=require(_0xdf7a('0x7'));router['get']('/',auth[_0xdf7a('0x8')](),controller[_0xdf7a('0x9')]);router[_0xdf7a('0xa')](_0xdf7a('0xb'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0xc')]);router[_0xdf7a('0xa')]('/:id/fields',auth[_0xdf7a('0x8')](),controller[_0xdf7a('0xd')]);router[_0xdf7a('0xa')]('/:id/subjects',auth[_0xdf7a('0x8')](),controller[_0xdf7a('0xe')]);router[_0xdf7a('0xa')](_0xdf7a('0xf'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0x10')]);router['post']('/',auth[_0xdf7a('0x8')](),controller['create']);router[_0xdf7a('0x11')]('/:id',auth[_0xdf7a('0x8')](),controller[_0xdf7a('0x12')]);router[_0xdf7a('0x13')](_0xdf7a('0xb'),auth[_0xdf7a('0x8')](),controller[_0xdf7a('0x14')]);module[_0xdf7a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index fbc75db..16213bb 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 _0xad8c=['exports','STRING','sequelize'];(function(_0x5b7132,_0x4be95e){var _0x8cf176=function(_0x24cd10){while(--_0x24cd10){_0x5b7132['push'](_0x5b7132['shift']());}};_0x8cf176(++_0x4be95e);}(_0xad8c,0xd4));var _0xcad8=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xad8c[_0x7b5cdd];return _0x3a29ae;};'use strict';var Sequelize=require(_0xcad8('0x0'));module[_0xcad8('0x1')]={'name':{'type':Sequelize[_0xcad8('0x2')]},'description':{'type':Sequelize[_0xcad8('0x2')]}}; \ No newline at end of file +var _0x8f05=['STRING','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8f05,0xd1));var _0x58f0=function(_0x2b9981,_0x4f81b3){_0x2b9981=_0x2b9981-0x0;var _0x314ac1=_0x8f05[_0x2b9981];return _0x314ac1;};'use strict';var Sequelize=require('sequelize');module[_0x58f0('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x58f0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 5c17f1a..1a752d4 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 _0xa2b1=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','findOne','SugarcrmField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa2b1,0x184));var _0x1a2b=function(_0x482dff,_0x5e90a8){_0x482dff=_0x482dff-0x0;var _0x8b41e7=_0xa2b1[_0x482dff];return _0x8b41e7;};'use strict';var emlformat=require(_0x1a2b('0x0'));var rimraf=require(_0x1a2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a2b('0x2'));var rp=require(_0x1a2b('0x3'));var moment=require(_0x1a2b('0x4'));var BPromise=require(_0x1a2b('0x5'));var Mustache=require(_0x1a2b('0x6'));var util=require('util');var path=require(_0x1a2b('0x7'));var sox=require(_0x1a2b('0x8'));var csv=require(_0x1a2b('0x9'));var ejs=require(_0x1a2b('0xa'));var fs=require('fs');var fs_extra=require(_0x1a2b('0xb'));var _=require('lodash');var squel=require(_0x1a2b('0xc'));var crypto=require(_0x1a2b('0xd'));var jsforce=require(_0x1a2b('0xe'));var deskjs=require(_0x1a2b('0xf'));var toCsv=require(_0x1a2b('0x9'));var querystring=require(_0x1a2b('0x10'));var Papa=require(_0x1a2b('0x11'));var Redis=require(_0x1a2b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1a2b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1a2b('0x14'));var utils=require(_0x1a2b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a2b('0x16'));var db=require(_0x1a2b('0x17'))['db'];function respondWithStatusCode(_0x5c7dfb,_0x24eea4){_0x24eea4=_0x24eea4||0xcc;return function(_0x43685a){if(_0x43685a){return _0x5c7dfb[_0x1a2b('0x18')](_0x24eea4);}return _0x5c7dfb['status'](_0x24eea4)[_0x1a2b('0x19')]();};}function respondWithResult(_0x4155c6,_0x1eead2){_0x1eead2=_0x1eead2||0xc8;return function(_0xc4fe2){if(_0xc4fe2){return _0x4155c6[_0x1a2b('0x1a')](_0x1eead2)[_0x1a2b('0x1b')](_0xc4fe2);}};}function respondWithFilteredResult(_0x1ff112,_0x19dd90){return function(_0x49c1fd){if(_0x49c1fd){var _0x446791=typeof _0x19dd90[_0x1a2b('0x1c')]==='undefined'&&typeof _0x19dd90[_0x1a2b('0x1d')]===_0x1a2b('0x1e');var _0x489b14=_0x49c1fd[_0x1a2b('0x1f')];var _0x42d8b9=_0x446791?0x0:_0x19dd90[_0x1a2b('0x1c')];var _0x2b7e8f=_0x446791?_0x49c1fd[_0x1a2b('0x1f')]:_0x19dd90['offset']+_0x19dd90[_0x1a2b('0x1d')];var _0x13308c;if(_0x2b7e8f>=_0x489b14){_0x2b7e8f=_0x489b14;_0x13308c=0xc8;}else{_0x13308c=0xce;}_0x1ff112[_0x1a2b('0x1a')](_0x13308c);return _0x1ff112[_0x1a2b('0x20')](_0x1a2b('0x21'),_0x42d8b9+'-'+_0x2b7e8f+'/'+_0x489b14)[_0x1a2b('0x1b')](_0x49c1fd);}return null;};}function patchUpdates(_0x2edec6){return function(_0x260aba){try{jsonpatch[_0x1a2b('0x22')](_0x260aba,_0x2edec6,!![]);}catch(_0x52fab5){return BPromise['reject'](_0x52fab5);}return _0x260aba[_0x1a2b('0x23')]();};}function saveUpdates(_0x3b54d4,_0x17caef){return function(_0x57c641){if(_0x57c641){return _0x57c641[_0x1a2b('0x24')](_0x3b54d4)[_0x1a2b('0x25')](function(_0x1e4cd4){return _0x1e4cd4;});}return null;};}function removeEntity(_0x19d09d,_0x15a352){return function(_0x4f87e2){if(_0x4f87e2){return _0x4f87e2[_0x1a2b('0x26')]()[_0x1a2b('0x25')](function(){_0x19d09d[_0x1a2b('0x1a')](0xcc)[_0x1a2b('0x19')]();});}};}function handleEntityNotFound(_0x7fbd20,_0xafd9d4){return function(_0x46c2a1){if(!_0x46c2a1){_0x7fbd20['sendStatus'](0x194);}return _0x46c2a1;};}function handleError(_0x6fd2b1,_0x2846f7){_0x2846f7=_0x2846f7||0x1f4;return function(_0x3dd29e){logger[_0x1a2b('0x27')](_0x3dd29e[_0x1a2b('0x28')]);if(_0x3dd29e[_0x1a2b('0x29')]){delete _0x3dd29e[_0x1a2b('0x29')];}_0x6fd2b1[_0x1a2b('0x1a')](_0x2846f7)['send'](_0x3dd29e);};}exports[_0x1a2b('0x2a')]=function(_0x49339f,_0x3b96d4){var _0xc8a527={},_0x2bb72e={},_0x12366d={'count':0x0,'rows':[]};var _0x559ec4=_['map'](db[_0x1a2b('0x2b')][_0x1a2b('0x2c')],function(_0x180547){return{'name':_0x180547[_0x1a2b('0x2d')],'type':_0x180547[_0x1a2b('0x2e')]['key']};});_0x2bb72e[_0x1a2b('0x2f')]=_[_0x1a2b('0x30')](_0x559ec4,_0x1a2b('0x29'));_0x2bb72e[_0x1a2b('0x31')]=_['keys'](_0x49339f[_0x1a2b('0x31')]);_0x2bb72e['filters']=_[_0x1a2b('0x32')](_0x2bb72e[_0x1a2b('0x2f')],_0x2bb72e['query']);_0xc8a527[_0x1a2b('0x33')]=_['intersection'](_0x2bb72e['model'],qs[_0x1a2b('0x34')](_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x34')]));_0xc8a527[_0x1a2b('0x33')]=_0xc8a527[_0x1a2b('0x33')][_0x1a2b('0x35')]?_0xc8a527[_0x1a2b('0x33')]:_0x2bb72e['model'];if(!_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x36')]('nolimit')){_0xc8a527[_0x1a2b('0x1d')]=qs['limit'](_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x1d')]);_0xc8a527[_0x1a2b('0x1c')]=qs[_0x1a2b('0x1c')](_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x1c')]);}_0xc8a527[_0x1a2b('0x37')]=qs['sort'](_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x38')]);_0xc8a527['where']=qs[_0x1a2b('0x39')](_[_0x1a2b('0x3a')](_0x49339f[_0x1a2b('0x31')],_0x2bb72e[_0x1a2b('0x39')]),_0x559ec4);if(_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x3b')]){_0xc8a527[_0x1a2b('0x3c')]=_[_0x1a2b('0x3d')](_0xc8a527[_0x1a2b('0x3c')],{'$or':_['map'](_0x559ec4,function(_0x3cf7d2){if(_0x3cf7d2['type']!==_0x1a2b('0x3e')){var _0x1b1d63={};_0x1b1d63[_0x3cf7d2[_0x1a2b('0x29')]]={'$like':'%'+_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x3b')]+'%'};return _0x1b1d63;}})});}_0xc8a527=_['merge']({},_0xc8a527,_0x49339f[_0x1a2b('0x3f')]);var _0x1790d0={'where':_0xc8a527[_0x1a2b('0x3c')]};return db[_0x1a2b('0x2b')]['count'](_0x1790d0)[_0x1a2b('0x25')](function(_0x321baa){_0x12366d[_0x1a2b('0x1f')]=_0x321baa;if(_0x49339f[_0x1a2b('0x31')][_0x1a2b('0x40')]){_0xc8a527[_0x1a2b('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1a2b('0x42')](_0xc8a527);})['then'](function(_0x4bf999){_0x12366d['rows']=_0x4bf999;return _0x12366d;})[_0x1a2b('0x25')](respondWithFilteredResult(_0x3b96d4,_0xc8a527))[_0x1a2b('0x43')](handleError(_0x3b96d4,null));};exports['show']=function(_0x86ca9a,_0x48c7cb){var _0x4690cc={'raw':![],'where':{'id':_0x86ca9a[_0x1a2b('0x44')]['id']}},_0x27e1dc={};_0x27e1dc[_0x1a2b('0x2f')]=_[_0x1a2b('0x45')](db['SugarcrmConfiguration'][_0x1a2b('0x2c')]);_0x27e1dc['query']=_[_0x1a2b('0x45')](_0x86ca9a[_0x1a2b('0x31')]);_0x27e1dc[_0x1a2b('0x39')]=_[_0x1a2b('0x32')](_0x27e1dc[_0x1a2b('0x2f')],_0x27e1dc[_0x1a2b('0x31')]);_0x4690cc[_0x1a2b('0x33')]=_[_0x1a2b('0x32')](_0x27e1dc[_0x1a2b('0x2f')],qs['fields'](_0x86ca9a[_0x1a2b('0x31')][_0x1a2b('0x34')]));_0x4690cc[_0x1a2b('0x33')]=_0x4690cc['attributes'][_0x1a2b('0x35')]?_0x4690cc[_0x1a2b('0x33')]:_0x27e1dc[_0x1a2b('0x2f')];if(_0x86ca9a[_0x1a2b('0x31')][_0x1a2b('0x40')]){_0x4690cc[_0x1a2b('0x41')]=[{'all':!![]}];}_0x4690cc=_[_0x1a2b('0x3d')]({},_0x4690cc,_0x86ca9a[_0x1a2b('0x3f')]);return db[_0x1a2b('0x2b')][_0x1a2b('0x46')](_0x4690cc)['then'](handleEntityNotFound(_0x48c7cb,null))[_0x1a2b('0x25')](respondWithResult(_0x48c7cb,null))[_0x1a2b('0x43')](handleError(_0x48c7cb,null));};exports[_0x1a2b('0x47')]=function(_0x47f13b,_0xc9d5ee){return db['SugarcrmConfiguration'][_0x1a2b('0x47')](_0x47f13b['body'],{})['then'](respondWithResult(_0xc9d5ee,0xc9))['catch'](handleError(_0xc9d5ee,null));};exports[_0x1a2b('0x24')]=function(_0x462bd4,_0x4ccc67){if(_0x462bd4['body']['id']){delete _0x462bd4[_0x1a2b('0x48')]['id'];}return db[_0x1a2b('0x2b')][_0x1a2b('0x46')]({'where':{'id':_0x462bd4[_0x1a2b('0x44')]['id']}})[_0x1a2b('0x25')](handleEntityNotFound(_0x4ccc67,null))[_0x1a2b('0x25')](saveUpdates(_0x462bd4['body'],null))['then'](respondWithResult(_0x4ccc67,null))[_0x1a2b('0x43')](handleError(_0x4ccc67,null));};exports[_0x1a2b('0x26')]=function(_0x521292,_0x5e0f8b){return db[_0x1a2b('0x2b')][_0x1a2b('0x46')]({'where':{'id':_0x521292[_0x1a2b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e0f8b,null))[_0x1a2b('0x25')](removeEntity(_0x5e0f8b,null))['catch'](handleError(_0x5e0f8b,null));};exports['getFields']=function(_0x134f52,_0x23f731,_0x2eb9f4){var _0x218940={};var _0x59c220={};var _0x3825fb;var _0x287e38;return db[_0x1a2b('0x2b')][_0x1a2b('0x49')]({'where':{'id':_0x134f52[_0x1a2b('0x44')]['id']}})[_0x1a2b('0x25')](handleEntityNotFound(_0x23f731,null))[_0x1a2b('0x25')](function(_0x11530d){if(_0x11530d){_0x3825fb=_0x11530d;_0x59c220[_0x1a2b('0x2f')]=_[_0x1a2b('0x45')](db[_0x1a2b('0x4a')]['rawAttributes']);_0x59c220['query']=_['keys'](_0x134f52['query']);_0x59c220[_0x1a2b('0x39')]=_[_0x1a2b('0x32')](_0x59c220[_0x1a2b('0x2f')],_0x59c220[_0x1a2b('0x31')]);_0x218940[_0x1a2b('0x33')]=_['intersection'](_0x59c220[_0x1a2b('0x2f')],qs[_0x1a2b('0x34')](_0x134f52[_0x1a2b('0x31')][_0x1a2b('0x34')]));_0x218940[_0x1a2b('0x33')]=_0x218940['attributes'][_0x1a2b('0x35')]?_0x218940[_0x1a2b('0x33')]:_0x59c220[_0x1a2b('0x2f')];_0x218940[_0x1a2b('0x37')]=qs['sort'](_0x134f52['query'][_0x1a2b('0x38')]);_0x218940[_0x1a2b('0x3c')]=qs[_0x1a2b('0x39')](_[_0x1a2b('0x3a')](_0x134f52['query'],_0x59c220[_0x1a2b('0x39')]));if(_0x134f52['query'][_0x1a2b('0x3b')]){_0x218940[_0x1a2b('0x3c')]=_[_0x1a2b('0x3d')](_0x218940[_0x1a2b('0x3c')],{'$or':_[_0x1a2b('0x30')](_0x218940['attributes'],function(_0x4c2a41){var _0x1f98a3={};_0x1f98a3[_0x4c2a41]={'$like':'%'+_0x134f52['query'][_0x1a2b('0x3b')]+'%'};return _0x1f98a3;})});}_0x218940=_[_0x1a2b('0x3d')]({},_0x218940,_0x134f52[_0x1a2b('0x3f')]);return _0x3825fb[_0x1a2b('0x4b')](_0x218940);}})[_0x1a2b('0x25')](function(_0x23cb51){if(_0x23cb51){_0x287e38=_0x23cb51[_0x1a2b('0x35')];if(!_0x134f52[_0x1a2b('0x31')][_0x1a2b('0x36')](_0x1a2b('0x4c'))){_0x218940['limit']=qs[_0x1a2b('0x1d')](_0x134f52[_0x1a2b('0x31')][_0x1a2b('0x1d')]);_0x218940[_0x1a2b('0x1c')]=qs[_0x1a2b('0x1c')](_0x134f52[_0x1a2b('0x31')][_0x1a2b('0x1c')]);}return _0x3825fb[_0x1a2b('0x4b')](_0x218940);}})['then'](function(_0x189f11){if(_0x189f11){return _0x189f11?{'count':_0x287e38,'rows':_0x189f11}:null;}})[_0x1a2b('0x25')](respondWithResult(_0x23f731,null))['catch'](handleError(_0x23f731,null));};exports[_0x1a2b('0x4d')]=function(_0x58a0c7,_0x320619,_0x5db9cc){var _0xdbfb1f={};var _0x45d8eb={};var _0x5d592a;var _0x3247be;return db['SugarcrmConfiguration'][_0x1a2b('0x49')]({'where':{'id':_0x58a0c7[_0x1a2b('0x44')]['id']}})['then'](handleEntityNotFound(_0x320619,null))[_0x1a2b('0x25')](function(_0x44e70d){if(_0x44e70d){_0x5d592a=_0x44e70d;_0x45d8eb[_0x1a2b('0x2f')]=_[_0x1a2b('0x45')](db[_0x1a2b('0x4a')][_0x1a2b('0x2c')]);_0x45d8eb[_0x1a2b('0x31')]=_[_0x1a2b('0x45')](_0x58a0c7['query']);_0x45d8eb[_0x1a2b('0x39')]=_[_0x1a2b('0x32')](_0x45d8eb[_0x1a2b('0x2f')],_0x45d8eb[_0x1a2b('0x31')]);_0xdbfb1f[_0x1a2b('0x33')]=_[_0x1a2b('0x32')](_0x45d8eb[_0x1a2b('0x2f')],qs[_0x1a2b('0x34')](_0x58a0c7[_0x1a2b('0x31')][_0x1a2b('0x34')]));_0xdbfb1f[_0x1a2b('0x33')]=_0xdbfb1f[_0x1a2b('0x33')][_0x1a2b('0x35')]?_0xdbfb1f[_0x1a2b('0x33')]:_0x45d8eb['model'];_0xdbfb1f[_0x1a2b('0x37')]=qs[_0x1a2b('0x38')](_0x58a0c7['query'][_0x1a2b('0x38')]);_0xdbfb1f['where']=qs['filters'](_[_0x1a2b('0x3a')](_0x58a0c7[_0x1a2b('0x31')],_0x45d8eb[_0x1a2b('0x39')]));if(_0x58a0c7[_0x1a2b('0x31')][_0x1a2b('0x3b')]){_0xdbfb1f['where']=_[_0x1a2b('0x3d')](_0xdbfb1f[_0x1a2b('0x3c')],{'$or':_['map'](_0xdbfb1f[_0x1a2b('0x33')],function(_0x41b45a){var _0x274bbf={};_0x274bbf[_0x41b45a]={'$like':'%'+_0x58a0c7[_0x1a2b('0x31')]['filter']+'%'};return _0x274bbf;})});}_0xdbfb1f=_['merge']({},_0xdbfb1f,_0x58a0c7[_0x1a2b('0x3f')]);return _0x5d592a[_0x1a2b('0x4d')](_0xdbfb1f);}})['then'](function(_0x349959){if(_0x349959){_0x3247be=_0x349959['length'];if(!_0x58a0c7[_0x1a2b('0x31')][_0x1a2b('0x36')](_0x1a2b('0x4c'))){_0xdbfb1f['limit']=qs[_0x1a2b('0x1d')](_0x58a0c7[_0x1a2b('0x31')][_0x1a2b('0x1d')]);_0xdbfb1f[_0x1a2b('0x1c')]=qs[_0x1a2b('0x1c')](_0x58a0c7['query'][_0x1a2b('0x1c')]);}return _0x5d592a[_0x1a2b('0x4d')](_0xdbfb1f);}})[_0x1a2b('0x25')](function(_0x90a729){if(_0x90a729){return _0x90a729?{'count':_0x3247be,'rows':_0x90a729}:null;}})['then'](respondWithResult(_0x320619,null))[_0x1a2b('0x43')](handleError(_0x320619,null));};exports[_0x1a2b('0x4e')]=function(_0x4f4f83,_0x498185,_0x5101c4){var _0xbafbc7={};var _0x5967ac={};var _0xd4a59b;var _0x140924;return db[_0x1a2b('0x2b')][_0x1a2b('0x49')]({'where':{'id':_0x4f4f83['params']['id']}})[_0x1a2b('0x25')](handleEntityNotFound(_0x498185,null))[_0x1a2b('0x25')](function(_0x484598){if(_0x484598){_0xd4a59b=_0x484598;_0x5967ac['model']=_[_0x1a2b('0x45')](db['SugarcrmField'][_0x1a2b('0x2c')]);_0x5967ac[_0x1a2b('0x31')]=_[_0x1a2b('0x45')](_0x4f4f83[_0x1a2b('0x31')]);_0x5967ac['filters']=_['intersection'](_0x5967ac[_0x1a2b('0x2f')],_0x5967ac[_0x1a2b('0x31')]);_0xbafbc7[_0x1a2b('0x33')]=_[_0x1a2b('0x32')](_0x5967ac[_0x1a2b('0x2f')],qs['fields'](_0x4f4f83[_0x1a2b('0x31')]['fields']));_0xbafbc7['attributes']=_0xbafbc7['attributes'][_0x1a2b('0x35')]?_0xbafbc7[_0x1a2b('0x33')]:_0x5967ac[_0x1a2b('0x2f')];_0xbafbc7[_0x1a2b('0x37')]=qs[_0x1a2b('0x38')](_0x4f4f83['query'][_0x1a2b('0x38')]);_0xbafbc7[_0x1a2b('0x3c')]=qs['filters'](_['pick'](_0x4f4f83['query'],_0x5967ac[_0x1a2b('0x39')]));if(_0x4f4f83[_0x1a2b('0x31')][_0x1a2b('0x3b')]){_0xbafbc7[_0x1a2b('0x3c')]=_[_0x1a2b('0x3d')](_0xbafbc7['where'],{'$or':_[_0x1a2b('0x30')](_0xbafbc7['attributes'],function(_0x43b094){var _0x253356={};_0x253356[_0x43b094]={'$like':'%'+_0x4f4f83[_0x1a2b('0x31')][_0x1a2b('0x3b')]+'%'};return _0x253356;})});}_0xbafbc7=_[_0x1a2b('0x3d')]({},_0xbafbc7,_0x4f4f83[_0x1a2b('0x3f')]);return _0xd4a59b['getDescriptions'](_0xbafbc7);}})[_0x1a2b('0x25')](function(_0x4e8df1){if(_0x4e8df1){_0x140924=_0x4e8df1[_0x1a2b('0x35')];if(!_0x4f4f83['query'][_0x1a2b('0x36')](_0x1a2b('0x4c'))){_0xbafbc7[_0x1a2b('0x1d')]=qs[_0x1a2b('0x1d')](_0x4f4f83[_0x1a2b('0x31')][_0x1a2b('0x1d')]);_0xbafbc7[_0x1a2b('0x1c')]=qs[_0x1a2b('0x1c')](_0x4f4f83[_0x1a2b('0x31')][_0x1a2b('0x1c')]);}return _0xd4a59b[_0x1a2b('0x4e')](_0xbafbc7);}})['then'](function(_0xb43e61){if(_0xb43e61){return _0xb43e61?{'count':_0x140924,'rows':_0xb43e61}:null;}})[_0x1a2b('0x25')](respondWithResult(_0x498185,null))[_0x1a2b('0x43')](handleError(_0x498185,null));}; \ No newline at end of file +var _0x3103=['include','rows','catch','show','params','keys','find','create','body','findOne','SugarcrmField','length','getFields','getSubjects','getDescriptions','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll'];(function(_0x4e3b66,_0x36e365){var _0x19a4be=function(_0x347258){while(--_0x347258){_0x4e3b66['push'](_0x4e3b66['shift']());}};_0x19a4be(++_0x36e365);}(_0x3103,0xb7));var _0x3310=function(_0xf5f512,_0x131ec0){_0xf5f512=_0xf5f512-0x0;var _0x1940c9=_0x3103[_0xf5f512];return _0x1940c9;};'use strict';var emlformat=require(_0x3310('0x0'));var rimraf=require(_0x3310('0x1'));var zipdir=require(_0x3310('0x2'));var jsonpatch=require(_0x3310('0x3'));var rp=require('request-promise');var moment=require(_0x3310('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3310('0x5'));var util=require(_0x3310('0x6'));var path=require(_0x3310('0x7'));var sox=require(_0x3310('0x8'));var csv=require(_0x3310('0x9'));var ejs=require(_0x3310('0xa'));var fs=require('fs');var fs_extra=require(_0x3310('0xb'));var _=require(_0x3310('0xc'));var squel=require(_0x3310('0xd'));var crypto=require(_0x3310('0xe'));var jsforce=require(_0x3310('0xf'));var deskjs=require(_0x3310('0x10'));var toCsv=require(_0x3310('0x9'));var querystring=require(_0x3310('0x11'));var Papa=require(_0x3310('0x12'));var Redis=require('ioredis');var authService=require(_0x3310('0x13'));var qs=require(_0x3310('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3310('0x15'));var logger=require(_0x3310('0x16'))(_0x3310('0x17'));var utils=require(_0x3310('0x18'));var config=require(_0x3310('0x19'));var licenseUtil=require(_0x3310('0x1a'));var db=require(_0x3310('0x1b'))['db'];function respondWithStatusCode(_0x3da2e2,_0x410882){_0x410882=_0x410882||0xcc;return function(_0x82361e){if(_0x82361e){return _0x3da2e2[_0x3310('0x1c')](_0x410882);}return _0x3da2e2['status'](_0x410882)[_0x3310('0x1d')]();};}function respondWithResult(_0x218eaf,_0x338ef5){_0x338ef5=_0x338ef5||0xc8;return function(_0x2f2f95){if(_0x2f2f95){return _0x218eaf[_0x3310('0x1e')](_0x338ef5)[_0x3310('0x1f')](_0x2f2f95);}};}function respondWithFilteredResult(_0x4e6733,_0x179b20){return function(_0x508a76){if(_0x508a76){var _0x41ce19=typeof _0x179b20[_0x3310('0x20')]==='undefined'&&typeof _0x179b20[_0x3310('0x21')]===_0x3310('0x22');var _0x3ce079=_0x508a76['count'];var _0x2f965f=_0x41ce19?0x0:_0x179b20['offset'];var _0x51b328=_0x41ce19?_0x508a76[_0x3310('0x23')]:_0x179b20[_0x3310('0x20')]+_0x179b20[_0x3310('0x21')];var _0x197437;if(_0x51b328>=_0x3ce079){_0x51b328=_0x3ce079;_0x197437=0xc8;}else{_0x197437=0xce;}_0x4e6733[_0x3310('0x1e')](_0x197437);return _0x4e6733[_0x3310('0x24')]('Content-Range',_0x2f965f+'-'+_0x51b328+'/'+_0x3ce079)['json'](_0x508a76);}return null;};}function patchUpdates(_0x2f7de7){return function(_0x3a6dd){try{jsonpatch[_0x3310('0x25')](_0x3a6dd,_0x2f7de7,!![]);}catch(_0x70e88e){return BPromise[_0x3310('0x26')](_0x70e88e);}return _0x3a6dd[_0x3310('0x27')]();};}function saveUpdates(_0x3e71f9,_0x1a1f8e){return function(_0x561cd7){if(_0x561cd7){return _0x561cd7[_0x3310('0x28')](_0x3e71f9)['then'](function(_0x3feaad){return _0x3feaad;});}return null;};}function removeEntity(_0x9b9ea4,_0x508651){return function(_0x51e7f4){if(_0x51e7f4){return _0x51e7f4[_0x3310('0x29')]()['then'](function(){_0x9b9ea4['status'](0xcc)[_0x3310('0x1d')]();});}};}function handleEntityNotFound(_0x9720f0,_0x3640a2){return function(_0x4f94a7){if(!_0x4f94a7){_0x9720f0[_0x3310('0x1c')](0x194);}return _0x4f94a7;};}function handleError(_0x38ff03,_0x2b21f5){_0x2b21f5=_0x2b21f5||0x1f4;return function(_0x2ed682){logger[_0x3310('0x2a')](_0x2ed682[_0x3310('0x2b')]);if(_0x2ed682[_0x3310('0x2c')]){delete _0x2ed682[_0x3310('0x2c')];}_0x38ff03['status'](_0x2b21f5)[_0x3310('0x2d')](_0x2ed682);};}exports[_0x3310('0x2e')]=function(_0x497403,_0x3990aa){var _0x54695d={},_0x4298d3={},_0x4365e2={'count':0x0,'rows':[]};var _0x5821ce=_[_0x3310('0x2f')](db[_0x3310('0x30')][_0x3310('0x31')],function(_0x19c252){return{'name':_0x19c252['fieldName'],'type':_0x19c252[_0x3310('0x32')]['key']};});_0x4298d3[_0x3310('0x33')]=_[_0x3310('0x2f')](_0x5821ce,_0x3310('0x2c'));_0x4298d3['query']=_['keys'](_0x497403[_0x3310('0x34')]);_0x4298d3['filters']=_[_0x3310('0x35')](_0x4298d3[_0x3310('0x33')],_0x4298d3[_0x3310('0x34')]);_0x54695d[_0x3310('0x36')]=_[_0x3310('0x35')](_0x4298d3[_0x3310('0x33')],qs[_0x3310('0x37')](_0x497403[_0x3310('0x34')][_0x3310('0x37')]));_0x54695d[_0x3310('0x36')]=_0x54695d[_0x3310('0x36')]['length']?_0x54695d[_0x3310('0x36')]:_0x4298d3[_0x3310('0x33')];if(!_0x497403[_0x3310('0x34')][_0x3310('0x38')](_0x3310('0x39'))){_0x54695d[_0x3310('0x21')]=qs[_0x3310('0x21')](_0x497403[_0x3310('0x34')]['limit']);_0x54695d[_0x3310('0x20')]=qs['offset'](_0x497403[_0x3310('0x34')]['offset']);}_0x54695d[_0x3310('0x3a')]=qs[_0x3310('0x3b')](_0x497403['query'][_0x3310('0x3b')]);_0x54695d[_0x3310('0x3c')]=qs[_0x3310('0x3d')](_[_0x3310('0x3e')](_0x497403[_0x3310('0x34')],_0x4298d3['filters']),_0x5821ce);if(_0x497403[_0x3310('0x34')][_0x3310('0x3f')]){_0x54695d['where']=_[_0x3310('0x40')](_0x54695d[_0x3310('0x3c')],{'$or':_[_0x3310('0x2f')](_0x5821ce,function(_0x5bcb81){if(_0x5bcb81[_0x3310('0x32')]!==_0x3310('0x41')){var _0x965b26={};_0x965b26[_0x5bcb81[_0x3310('0x2c')]]={'$like':'%'+_0x497403[_0x3310('0x34')][_0x3310('0x3f')]+'%'};return _0x965b26;}})});}_0x54695d=_[_0x3310('0x40')]({},_0x54695d,_0x497403[_0x3310('0x42')]);var _0x580532={'where':_0x54695d[_0x3310('0x3c')]};return db['SugarcrmConfiguration'][_0x3310('0x23')](_0x580532)[_0x3310('0x43')](function(_0xc6955f){_0x4365e2['count']=_0xc6955f;if(_0x497403['query'][_0x3310('0x44')]){_0x54695d[_0x3310('0x45')]=[{'all':!![]}];}return db[_0x3310('0x30')]['findAll'](_0x54695d);})[_0x3310('0x43')](function(_0x5c14f6){_0x4365e2[_0x3310('0x46')]=_0x5c14f6;return _0x4365e2;})['then'](respondWithFilteredResult(_0x3990aa,_0x54695d))[_0x3310('0x47')](handleError(_0x3990aa,null));};exports[_0x3310('0x48')]=function(_0x321da7,_0x3bb7aa){var _0x1b5576={'raw':![],'where':{'id':_0x321da7[_0x3310('0x49')]['id']}},_0x5772e4={};_0x5772e4[_0x3310('0x33')]=_['keys'](db[_0x3310('0x30')][_0x3310('0x31')]);_0x5772e4[_0x3310('0x34')]=_[_0x3310('0x4a')](_0x321da7[_0x3310('0x34')]);_0x5772e4[_0x3310('0x3d')]=_[_0x3310('0x35')](_0x5772e4[_0x3310('0x33')],_0x5772e4[_0x3310('0x34')]);_0x1b5576[_0x3310('0x36')]=_['intersection'](_0x5772e4['model'],qs[_0x3310('0x37')](_0x321da7[_0x3310('0x34')][_0x3310('0x37')]));_0x1b5576[_0x3310('0x36')]=_0x1b5576[_0x3310('0x36')]['length']?_0x1b5576[_0x3310('0x36')]:_0x5772e4[_0x3310('0x33')];if(_0x321da7[_0x3310('0x34')][_0x3310('0x44')]){_0x1b5576[_0x3310('0x45')]=[{'all':!![]}];}_0x1b5576=_[_0x3310('0x40')]({},_0x1b5576,_0x321da7[_0x3310('0x42')]);return db[_0x3310('0x30')][_0x3310('0x4b')](_0x1b5576)['then'](handleEntityNotFound(_0x3bb7aa,null))['then'](respondWithResult(_0x3bb7aa,null))[_0x3310('0x47')](handleError(_0x3bb7aa,null));};exports['create']=function(_0x40d4fe,_0x549e76){return db[_0x3310('0x30')][_0x3310('0x4c')](_0x40d4fe[_0x3310('0x4d')],{})[_0x3310('0x43')](respondWithResult(_0x549e76,0xc9))[_0x3310('0x47')](handleError(_0x549e76,null));};exports['update']=function(_0x2b8b49,_0x40a564){if(_0x2b8b49[_0x3310('0x4d')]['id']){delete _0x2b8b49['body']['id'];}return db[_0x3310('0x30')]['find']({'where':{'id':_0x2b8b49[_0x3310('0x49')]['id']}})[_0x3310('0x43')](handleEntityNotFound(_0x40a564,null))[_0x3310('0x43')](saveUpdates(_0x2b8b49[_0x3310('0x4d')],null))[_0x3310('0x43')](respondWithResult(_0x40a564,null))[_0x3310('0x47')](handleError(_0x40a564,null));};exports['destroy']=function(_0x3ffa58,_0x11c601){return db[_0x3310('0x30')][_0x3310('0x4b')]({'where':{'id':_0x3ffa58[_0x3310('0x49')]['id']}})[_0x3310('0x43')](handleEntityNotFound(_0x11c601,null))['then'](removeEntity(_0x11c601,null))[_0x3310('0x47')](handleError(_0x11c601,null));};exports['getFields']=function(_0x5f00c9,_0x34473b,_0x371198){var _0xe6c18f={};var _0x3fea1b={};var _0x380b5e;var _0x177545;return db[_0x3310('0x30')][_0x3310('0x4e')]({'where':{'id':_0x5f00c9['params']['id']}})[_0x3310('0x43')](handleEntityNotFound(_0x34473b,null))[_0x3310('0x43')](function(_0x1d9e07){if(_0x1d9e07){_0x380b5e=_0x1d9e07;_0x3fea1b[_0x3310('0x33')]=_[_0x3310('0x4a')](db[_0x3310('0x4f')]['rawAttributes']);_0x3fea1b[_0x3310('0x34')]=_[_0x3310('0x4a')](_0x5f00c9[_0x3310('0x34')]);_0x3fea1b[_0x3310('0x3d')]=_[_0x3310('0x35')](_0x3fea1b[_0x3310('0x33')],_0x3fea1b[_0x3310('0x34')]);_0xe6c18f[_0x3310('0x36')]=_[_0x3310('0x35')](_0x3fea1b[_0x3310('0x33')],qs[_0x3310('0x37')](_0x5f00c9['query'][_0x3310('0x37')]));_0xe6c18f[_0x3310('0x36')]=_0xe6c18f['attributes'][_0x3310('0x50')]?_0xe6c18f['attributes']:_0x3fea1b[_0x3310('0x33')];_0xe6c18f['order']=qs['sort'](_0x5f00c9[_0x3310('0x34')][_0x3310('0x3b')]);_0xe6c18f[_0x3310('0x3c')]=qs[_0x3310('0x3d')](_[_0x3310('0x3e')](_0x5f00c9[_0x3310('0x34')],_0x3fea1b[_0x3310('0x3d')]));if(_0x5f00c9['query'][_0x3310('0x3f')]){_0xe6c18f[_0x3310('0x3c')]=_[_0x3310('0x40')](_0xe6c18f[_0x3310('0x3c')],{'$or':_[_0x3310('0x2f')](_0xe6c18f[_0x3310('0x36')],function(_0x189af7){var _0x42c7a5={};_0x42c7a5[_0x189af7]={'$like':'%'+_0x5f00c9[_0x3310('0x34')]['filter']+'%'};return _0x42c7a5;})});}_0xe6c18f=_['merge']({},_0xe6c18f,_0x5f00c9[_0x3310('0x42')]);return _0x380b5e['getFields'](_0xe6c18f);}})['then'](function(_0x26596e){if(_0x26596e){_0x177545=_0x26596e[_0x3310('0x50')];if(!_0x5f00c9[_0x3310('0x34')]['hasOwnProperty'](_0x3310('0x39'))){_0xe6c18f[_0x3310('0x21')]=qs[_0x3310('0x21')](_0x5f00c9['query'][_0x3310('0x21')]);_0xe6c18f[_0x3310('0x20')]=qs[_0x3310('0x20')](_0x5f00c9[_0x3310('0x34')][_0x3310('0x20')]);}return _0x380b5e[_0x3310('0x51')](_0xe6c18f);}})[_0x3310('0x43')](function(_0x21464a){if(_0x21464a){return _0x21464a?{'count':_0x177545,'rows':_0x21464a}:null;}})[_0x3310('0x43')](respondWithResult(_0x34473b,null))[_0x3310('0x47')](handleError(_0x34473b,null));};exports[_0x3310('0x52')]=function(_0x5811f1,_0x38fa4c,_0x32ca3b){var _0x552bc3={};var _0x2a74f9={};var _0x119239;var _0x38f87b;return db[_0x3310('0x30')][_0x3310('0x4e')]({'where':{'id':_0x5811f1[_0x3310('0x49')]['id']}})[_0x3310('0x43')](handleEntityNotFound(_0x38fa4c,null))[_0x3310('0x43')](function(_0x278f46){if(_0x278f46){_0x119239=_0x278f46;_0x2a74f9[_0x3310('0x33')]=_[_0x3310('0x4a')](db[_0x3310('0x4f')][_0x3310('0x31')]);_0x2a74f9[_0x3310('0x34')]=_[_0x3310('0x4a')](_0x5811f1[_0x3310('0x34')]);_0x2a74f9[_0x3310('0x3d')]=_[_0x3310('0x35')](_0x2a74f9[_0x3310('0x33')],_0x2a74f9[_0x3310('0x34')]);_0x552bc3[_0x3310('0x36')]=_[_0x3310('0x35')](_0x2a74f9[_0x3310('0x33')],qs[_0x3310('0x37')](_0x5811f1[_0x3310('0x34')][_0x3310('0x37')]));_0x552bc3[_0x3310('0x36')]=_0x552bc3[_0x3310('0x36')][_0x3310('0x50')]?_0x552bc3[_0x3310('0x36')]:_0x2a74f9[_0x3310('0x33')];_0x552bc3[_0x3310('0x3a')]=qs[_0x3310('0x3b')](_0x5811f1['query'][_0x3310('0x3b')]);_0x552bc3[_0x3310('0x3c')]=qs[_0x3310('0x3d')](_[_0x3310('0x3e')](_0x5811f1[_0x3310('0x34')],_0x2a74f9[_0x3310('0x3d')]));if(_0x5811f1[_0x3310('0x34')][_0x3310('0x3f')]){_0x552bc3[_0x3310('0x3c')]=_[_0x3310('0x40')](_0x552bc3[_0x3310('0x3c')],{'$or':_[_0x3310('0x2f')](_0x552bc3[_0x3310('0x36')],function(_0x58e6d7){var _0x4c7d75={};_0x4c7d75[_0x58e6d7]={'$like':'%'+_0x5811f1[_0x3310('0x34')][_0x3310('0x3f')]+'%'};return _0x4c7d75;})});}_0x552bc3=_[_0x3310('0x40')]({},_0x552bc3,_0x5811f1[_0x3310('0x42')]);return _0x119239[_0x3310('0x52')](_0x552bc3);}})['then'](function(_0x54e7d5){if(_0x54e7d5){_0x38f87b=_0x54e7d5['length'];if(!_0x5811f1[_0x3310('0x34')][_0x3310('0x38')](_0x3310('0x39'))){_0x552bc3[_0x3310('0x21')]=qs[_0x3310('0x21')](_0x5811f1[_0x3310('0x34')][_0x3310('0x21')]);_0x552bc3[_0x3310('0x20')]=qs[_0x3310('0x20')](_0x5811f1[_0x3310('0x34')][_0x3310('0x20')]);}return _0x119239[_0x3310('0x52')](_0x552bc3);}})[_0x3310('0x43')](function(_0x29300d){if(_0x29300d){return _0x29300d?{'count':_0x38f87b,'rows':_0x29300d}:null;}})[_0x3310('0x43')](respondWithResult(_0x38fa4c,null))[_0x3310('0x47')](handleError(_0x38fa4c,null));};exports[_0x3310('0x53')]=function(_0x215f85,_0x1a4770,_0x97674e){var _0x4df34c={};var _0x26e5b0={};var _0x49e73c;var _0x554592;return db[_0x3310('0x30')]['findOne']({'where':{'id':_0x215f85['params']['id']}})['then'](handleEntityNotFound(_0x1a4770,null))[_0x3310('0x43')](function(_0x35eedd){if(_0x35eedd){_0x49e73c=_0x35eedd;_0x26e5b0[_0x3310('0x33')]=_[_0x3310('0x4a')](db['SugarcrmField']['rawAttributes']);_0x26e5b0[_0x3310('0x34')]=_[_0x3310('0x4a')](_0x215f85[_0x3310('0x34')]);_0x26e5b0['filters']=_[_0x3310('0x35')](_0x26e5b0['model'],_0x26e5b0['query']);_0x4df34c['attributes']=_[_0x3310('0x35')](_0x26e5b0[_0x3310('0x33')],qs[_0x3310('0x37')](_0x215f85[_0x3310('0x34')][_0x3310('0x37')]));_0x4df34c[_0x3310('0x36')]=_0x4df34c[_0x3310('0x36')][_0x3310('0x50')]?_0x4df34c[_0x3310('0x36')]:_0x26e5b0[_0x3310('0x33')];_0x4df34c[_0x3310('0x3a')]=qs[_0x3310('0x3b')](_0x215f85['query'][_0x3310('0x3b')]);_0x4df34c['where']=qs[_0x3310('0x3d')](_[_0x3310('0x3e')](_0x215f85[_0x3310('0x34')],_0x26e5b0[_0x3310('0x3d')]));if(_0x215f85[_0x3310('0x34')][_0x3310('0x3f')]){_0x4df34c[_0x3310('0x3c')]=_['merge'](_0x4df34c[_0x3310('0x3c')],{'$or':_['map'](_0x4df34c[_0x3310('0x36')],function(_0x535026){var _0x1af74a={};_0x1af74a[_0x535026]={'$like':'%'+_0x215f85[_0x3310('0x34')]['filter']+'%'};return _0x1af74a;})});}_0x4df34c=_[_0x3310('0x40')]({},_0x4df34c,_0x215f85['options']);return _0x49e73c[_0x3310('0x53')](_0x4df34c);}})['then'](function(_0x56902c){if(_0x56902c){_0x554592=_0x56902c[_0x3310('0x50')];if(!_0x215f85[_0x3310('0x34')]['hasOwnProperty']('nolimit')){_0x4df34c[_0x3310('0x21')]=qs[_0x3310('0x21')](_0x215f85[_0x3310('0x34')][_0x3310('0x21')]);_0x4df34c[_0x3310('0x20')]=qs['offset'](_0x215f85['query'][_0x3310('0x20')]);}return _0x49e73c[_0x3310('0x53')](_0x4df34c);}})['then'](function(_0x28078b){if(_0x28078b){return _0x28078b?{'count':_0x554592,'rows':_0x28078b}:null;}})[_0x3310('0x43')](respondWithResult(_0x1a4770,null))[_0x3310('0x47')](handleError(_0x1a4770,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 59f2359..21d725d 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 _0x0ed4=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x35a484,_0x253c26){var _0x373faf=function(_0x5a15b0){while(--_0x5a15b0){_0x35a484['push'](_0x35a484['shift']());}};_0x373faf(++_0x253c26);}(_0x0ed4,0x178));var _0x40ed=function(_0x5af9ba,_0x30adfb){_0x5af9ba=_0x5af9ba-0x0;var _0x488c7c=_0x0ed4[_0x5af9ba];return _0x488c7c;};'use strict';var _=require(_0x40ed('0x0'));var util=require(_0x40ed('0x1'));var logger=require(_0x40ed('0x2'))(_0x40ed('0x3'));var moment=require(_0x40ed('0x4'));var BPromise=require(_0x40ed('0x5'));var rp=require(_0x40ed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40ed('0x7'));var config=require(_0x40ed('0x8'));var attributes=require(_0x40ed('0x9'));module[_0x40ed('0xa')]=function(_0x3b2fd7,_0x29158e){return _0x3b2fd7['define'](_0x40ed('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd268=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd268,0xf6));var _0x8d26=function(_0x31eadc,_0x28f2f5){_0x31eadc=_0x31eadc-0x0;var _0x5dca32=_0xd268[_0x31eadc];return _0x5dca32;};'use strict';var _=require('lodash');var util=require(_0x8d26('0x0'));var logger=require(_0x8d26('0x1'))(_0x8d26('0x2'));var moment=require(_0x8d26('0x3'));var BPromise=require(_0x8d26('0x4'));var rp=require(_0x8d26('0x5'));var fs=require('fs');var path=require(_0x8d26('0x6'));var rimraf=require(_0x8d26('0x7'));var config=require(_0x8d26('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x8d26('0x9')]=function(_0x18c0f4,_0x5abdd0){return _0x18c0f4[_0x8d26('0xa')](_0x8d26('0xb'),attributes,{'tableName':_0x8d26('0xc'),'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 41894d6..28a0286 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 _0xa19d=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x767540,_0x34a6f0){var _0x460cfc=function(_0x5d2e0f){while(--_0x5d2e0f){_0x767540['push'](_0x767540['shift']());}};_0x460cfc(++_0x34a6f0);}(_0xa19d,0x1ea));var _0xda19=function(_0x2f7a20,_0x12e44c){_0x2f7a20=_0x2f7a20-0x0;var _0x3ccde8=_0xa19d[_0x2f7a20];return _0x3ccde8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda19('0x0'));var BPromise=require(_0xda19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda19('0x2'));var db=require(_0xda19('0x3'))['db'];var utils=require(_0xda19('0x4'));var logger=require(_0xda19('0x5'))(_0xda19('0x6'));var config=require(_0xda19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda19('0x8')][_0xda19('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553d43,_0x3ee109,_0x1cae3d){return new BPromise(function(_0x57abb5,_0x394e53){return client['request'](_0x553d43,_0x1cae3d)[_0xda19('0xa')](function(_0x9106bf){logger[_0xda19('0xb')](_0xda19('0xc'),_0x3ee109,_0xda19('0xd'));logger['debug'](_0xda19('0xe'),_0x3ee109,_0xda19('0xd'),JSON[_0xda19('0xf')](_0x9106bf));if(_0x9106bf[_0xda19('0x10')]){if(_0x9106bf[_0xda19('0x10')][_0xda19('0x11')]===0x1f4){logger[_0xda19('0x10')](_0xda19('0xc'),_0x3ee109,_0x9106bf['error'][_0xda19('0x12')]);return _0x394e53(_0x9106bf[_0xda19('0x10')][_0xda19('0x12')]);}logger[_0xda19('0x10')](_0xda19('0xc'),_0x3ee109,_0x9106bf[_0xda19('0x10')]['message']);return _0x57abb5(_0x9106bf[_0xda19('0x10')][_0xda19('0x12')]);}else{logger[_0xda19('0xb')](_0xda19('0xc'),_0x3ee109,_0xda19('0xd'));_0x57abb5(_0x9106bf[_0xda19('0x13')]['message']);}})[_0xda19('0x14')](function(_0x468878){logger['error'](_0xda19('0xc'),_0x3ee109,_0x468878);_0x394e53(_0x468878);});});} \ No newline at end of file +var _0x2c7a=['request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c7a,0xce));var _0xa2c7=function(_0x1e75b5,_0xa3f20c){_0x1e75b5=_0x1e75b5-0x0;var _0x1f6f4c=_0x2c7a[_0x1e75b5];return _0x1f6f4c;};'use strict';var _=require(_0xa2c7('0x0'));var util=require(_0xa2c7('0x1'));var moment=require(_0xa2c7('0x2'));var BPromise=require(_0xa2c7('0x3'));var rs=require(_0xa2c7('0x4'));var fs=require('fs');var Redis=require(_0xa2c7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2c7('0x6'));var logger=require(_0xa2c7('0x7'))('rpc');var config=require(_0xa2c7('0x8'));var jayson=require(_0xa2c7('0x9'));var client=jayson[_0xa2c7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ea4b5,_0x453c30,_0x5d617b){return new BPromise(function(_0x8f79b7,_0x3f1dad){return client[_0xa2c7('0xb')](_0x5ea4b5,_0x5d617b)[_0xa2c7('0xc')](function(_0x4b16a3){logger['info'](_0xa2c7('0xd'),_0x453c30,_0xa2c7('0xe'));logger[_0xa2c7('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x453c30,'request\x20sent',JSON['stringify'](_0x4b16a3));if(_0x4b16a3[_0xa2c7('0x10')]){if(_0x4b16a3[_0xa2c7('0x10')]['code']===0x1f4){logger[_0xa2c7('0x10')](_0xa2c7('0xd'),_0x453c30,_0x4b16a3[_0xa2c7('0x10')][_0xa2c7('0x11')]);return _0x3f1dad(_0x4b16a3[_0xa2c7('0x10')][_0xa2c7('0x11')]);}logger['error'](_0xa2c7('0xd'),_0x453c30,_0x4b16a3[_0xa2c7('0x10')][_0xa2c7('0x11')]);return _0x8f79b7(_0x4b16a3[_0xa2c7('0x10')][_0xa2c7('0x11')]);}else{logger[_0xa2c7('0x12')](_0xa2c7('0xd'),_0x453c30,_0xa2c7('0xe'));_0x8f79b7(_0x4b16a3[_0xa2c7('0x13')][_0xa2c7('0x11')]);}})['catch'](function(_0x449b08){logger[_0xa2c7('0x10')](_0xa2c7('0xd'),_0x453c30,_0x449b08);_0x3f1dad(_0x449b08);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a289a74..fc1fac1 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 _0xbbec=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x106b42,_0x4243e2){var _0x11c7ca=function(_0x29206b){while(--_0x29206b){_0x106b42['push'](_0x106b42['shift']());}};_0x11c7ca(++_0x4243e2);}(_0xbbec,0x8f));var _0xcbbe=function(_0x4c45ef,_0x3a9029){_0x4c45ef=_0x4c45ef-0x0;var _0x4ca5d5=_0xbbec[_0x4c45ef];return _0x4ca5d5;};'use strict';var multer=require(_0xcbbe('0x0'));var util=require(_0xcbbe('0x1'));var path=require(_0xcbbe('0x2'));var timeout=require(_0xcbbe('0x3'));var express=require(_0xcbbe('0x4'));var router=express[_0xcbbe('0x5')]();var fs_extra=require(_0xcbbe('0x6'));var auth=require(_0xcbbe('0x7'));var interaction=require(_0xcbbe('0x8'));var config=require(_0xcbbe('0x9'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcbbe('0xa'),auth[_0xcbbe('0xb')](),controller[_0xcbbe('0xc')]);router[_0xcbbe('0xd')]('/',auth[_0xcbbe('0xb')](),controller[_0xcbbe('0xe')]);router[_0xcbbe('0xf')](_0xcbbe('0xa'),auth[_0xcbbe('0xb')](),controller[_0xcbbe('0x10')]);router[_0xcbbe('0x11')](_0xcbbe('0xa'),auth[_0xcbbe('0xb')](),controller[_0xcbbe('0x12')]);module[_0xcbbe('0x13')]=router; \ No newline at end of file +var _0xc82f=['express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x37e0a3,_0x12e4f2){var _0x5ed3ef=function(_0x2bbb7d){while(--_0x2bbb7d){_0x37e0a3['push'](_0x37e0a3['shift']());}};_0x5ed3ef(++_0x12e4f2);}(_0xc82f,0x1da));var _0xfc82=function(_0x4c6856,_0x4f377a){_0x4c6856=_0x4c6856-0x0;var _0x417437=_0xc82f[_0x4c6856];return _0x417437;};'use strict';var multer=require('multer');var util=require(_0xfc82('0x0'));var path=require('path');var timeout=require(_0xfc82('0x1'));var express=require(_0xfc82('0x2'));var router=express[_0xfc82('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc82('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfc82('0x5'));var controller=require(_0xfc82('0x6'));router['get']('/',auth[_0xfc82('0x7')](),controller[_0xfc82('0x8')]);router[_0xfc82('0x9')](_0xfc82('0xa'),auth['isAuthenticated'](),controller[_0xfc82('0xb')]);router['post']('/',auth[_0xfc82('0x7')](),controller[_0xfc82('0xc')]);router['put']('/:id',auth[_0xfc82('0x7')](),controller[_0xfc82('0xd')]);router[_0xfc82('0xe')](_0xfc82('0xa'),auth[_0xfc82('0x7')](),controller[_0xfc82('0xf')]);module[_0xfc82('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7a8ce6a..ee18bf1 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 _0x5b39=['string','customVariable','keyValue','STRING','variable','sequelize','ENUM'];(function(_0x385f25,_0x5bf602){var _0x39d2cf=function(_0x202d51){while(--_0x202d51){_0x385f25['push'](_0x385f25['shift']());}};_0x39d2cf(++_0x5bf602);}(_0x5b39,0xd0));var _0x95b3=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x5b39[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0x95b3('0x0'));module['exports']={'type':{'type':Sequelize[_0x95b3('0x1')](_0x95b3('0x2'),'variable',_0x95b3('0x3'),_0x95b3('0x4'),'picklist'),'defaultValue':_0x95b3('0x2')},'content':{'type':Sequelize[_0x95b3('0x5')]},'key':{'type':Sequelize[_0x95b3('0x5')]},'keyType':{'type':Sequelize[_0x95b3('0x1')](_0x95b3('0x2'),_0x95b3('0x6'),_0x95b3('0x3'))},'keyContent':{'type':Sequelize[_0x95b3('0x5')]},'idField':{'type':Sequelize[_0x95b3('0x5')]},'nameField':{'type':Sequelize[_0x95b3('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x95b3('0x5')]}}; \ No newline at end of file +var _0x159d=['ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x50b6cd,_0x428332){var _0x289d3d=function(_0x32e628){while(--_0x32e628){_0x50b6cd['push'](_0x50b6cd['shift']());}};_0x289d3d(++_0x428332);}(_0x159d,0x8e));var _0xd159=function(_0x4f7d08,_0x18f85c){_0x4f7d08=_0x4f7d08-0x0;var _0x301c97=_0x159d[_0x4f7d08];return _0x301c97;};'use strict';var Sequelize=require(_0xd159('0x0'));module[_0xd159('0x1')]={'type':{'type':Sequelize[_0xd159('0x2')](_0xd159('0x3'),'variable',_0xd159('0x4'),_0xd159('0x5'),'picklist'),'defaultValue':_0xd159('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd159('0x6')]},'keyType':{'type':Sequelize[_0xd159('0x2')](_0xd159('0x3'),_0xd159('0x7'),_0xd159('0x4'))},'keyContent':{'type':Sequelize[_0xd159('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd159('0x6')]},'customField':{'type':Sequelize[_0xd159('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd159('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 01f2f3d..8b63222 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 _0x90af=['then','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','reject','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x90af,0xa9));var _0xf90a=function(_0x44ee71,_0x5a7cf1){_0x44ee71=_0x44ee71-0x0;var _0x5de7f6=_0x90af[_0x44ee71];return _0x5de7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf90a('0x0'));var zipdir=require(_0xf90a('0x1'));var jsonpatch=require(_0xf90a('0x2'));var rp=require(_0xf90a('0x3'));var moment=require('moment');var BPromise=require(_0xf90a('0x4'));var Mustache=require('mustache');var util=require(_0xf90a('0x5'));var path=require(_0xf90a('0x6'));var sox=require(_0xf90a('0x7'));var csv=require(_0xf90a('0x8'));var ejs=require(_0xf90a('0x9'));var fs=require('fs');var fs_extra=require(_0xf90a('0xa'));var _=require(_0xf90a('0xb'));var squel=require('squel');var crypto=require(_0xf90a('0xc'));var jsforce=require(_0xf90a('0xd'));var deskjs=require(_0xf90a('0xe'));var toCsv=require(_0xf90a('0x8'));var querystring=require(_0xf90a('0xf'));var Papa=require(_0xf90a('0x10'));var Redis=require(_0xf90a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf90a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf90a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf90a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf90a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41e354,_0x1fb78b){_0x1fb78b=_0x1fb78b||0xcc;return function(_0x72137d){if(_0x72137d){return _0x41e354[_0xf90a('0x16')](_0x1fb78b);}return _0x41e354['status'](_0x1fb78b)[_0xf90a('0x17')]();};}function respondWithResult(_0x27bece,_0x469c65){_0x469c65=_0x469c65||0xc8;return function(_0x26dc7f){if(_0x26dc7f){return _0x27bece[_0xf90a('0x18')](_0x469c65)[_0xf90a('0x19')](_0x26dc7f);}};}function respondWithFilteredResult(_0xd166cb,_0x1a9e2d){return function(_0x3557bc){if(_0x3557bc){var _0x26d13d=typeof _0x1a9e2d[_0xf90a('0x1a')]===_0xf90a('0x1b')&&typeof _0x1a9e2d['limit']===_0xf90a('0x1b');var _0x2789be=_0x3557bc[_0xf90a('0x1c')];var _0x4fa617=_0x26d13d?0x0:_0x1a9e2d['offset'];var _0x3ce526=_0x26d13d?_0x3557bc[_0xf90a('0x1c')]:_0x1a9e2d[_0xf90a('0x1a')]+_0x1a9e2d['limit'];var _0x1a1c3e;if(_0x3ce526>=_0x2789be){_0x3ce526=_0x2789be;_0x1a1c3e=0xc8;}else{_0x1a1c3e=0xce;}_0xd166cb[_0xf90a('0x18')](_0x1a1c3e);return _0xd166cb[_0xf90a('0x1d')]('Content-Range',_0x4fa617+'-'+_0x3ce526+'/'+_0x2789be)[_0xf90a('0x19')](_0x3557bc);}return null;};}function patchUpdates(_0x57599e){return function(_0x4a6cfe){try{jsonpatch['apply'](_0x4a6cfe,_0x57599e,!![]);}catch(_0x30f107){return BPromise[_0xf90a('0x1e')](_0x30f107);}return _0x4a6cfe[_0xf90a('0x1f')]();};}function saveUpdates(_0x1876a5,_0x58e2b8){return function(_0x5f1e91){if(_0x5f1e91){return _0x5f1e91['update'](_0x1876a5)[_0xf90a('0x20')](function(_0x5c744f){return _0x5c744f;});}return null;};}function removeEntity(_0x1db594,_0x11b5cb){return function(_0x21464f){if(_0x21464f){return _0x21464f['destroy']()[_0xf90a('0x20')](function(){_0x1db594['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x540435,_0x15f2f2){return function(_0x1d62c4){if(!_0x1d62c4){_0x540435[_0xf90a('0x16')](0x194);}return _0x1d62c4;};}function handleError(_0x4fbc89,_0x5efd93){_0x5efd93=_0x5efd93||0x1f4;return function(_0x1b88f7){logger['error'](_0x1b88f7[_0xf90a('0x21')]);if(_0x1b88f7[_0xf90a('0x22')]){delete _0x1b88f7[_0xf90a('0x22')];}_0x4fbc89[_0xf90a('0x18')](_0x5efd93)['send'](_0x1b88f7);};}exports[_0xf90a('0x23')]=function(_0x3dd8b4,_0x5da259){var _0x5387a6={},_0x4d79ee={},_0x4221d7={'count':0x0,'rows':[]};var _0x4e96ed=_[_0xf90a('0x24')](db[_0xf90a('0x25')][_0xf90a('0x26')],function(_0x520211){return{'name':_0x520211[_0xf90a('0x27')],'type':_0x520211[_0xf90a('0x28')]['key']};});_0x4d79ee[_0xf90a('0x29')]=_[_0xf90a('0x24')](_0x4e96ed,_0xf90a('0x22'));_0x4d79ee[_0xf90a('0x2a')]=_[_0xf90a('0x2b')](_0x3dd8b4['query']);_0x4d79ee[_0xf90a('0x2c')]=_['intersection'](_0x4d79ee['model'],_0x4d79ee['query']);_0x5387a6[_0xf90a('0x2d')]=_['intersection'](_0x4d79ee[_0xf90a('0x29')],qs['fields'](_0x3dd8b4[_0xf90a('0x2a')][_0xf90a('0x2e')]));_0x5387a6[_0xf90a('0x2d')]=_0x5387a6[_0xf90a('0x2d')][_0xf90a('0x2f')]?_0x5387a6[_0xf90a('0x2d')]:_0x4d79ee[_0xf90a('0x29')];if(!_0x3dd8b4[_0xf90a('0x2a')][_0xf90a('0x30')](_0xf90a('0x31'))){_0x5387a6['limit']=qs['limit'](_0x3dd8b4[_0xf90a('0x2a')]['limit']);_0x5387a6[_0xf90a('0x1a')]=qs[_0xf90a('0x1a')](_0x3dd8b4[_0xf90a('0x2a')][_0xf90a('0x1a')]);}_0x5387a6['order']=qs['sort'](_0x3dd8b4[_0xf90a('0x2a')]['sort']);_0x5387a6[_0xf90a('0x32')]=qs['filters'](_[_0xf90a('0x33')](_0x3dd8b4[_0xf90a('0x2a')],_0x4d79ee[_0xf90a('0x2c')]),_0x4e96ed);if(_0x3dd8b4[_0xf90a('0x2a')][_0xf90a('0x34')]){_0x5387a6[_0xf90a('0x32')]=_[_0xf90a('0x35')](_0x5387a6[_0xf90a('0x32')],{'$or':_['map'](_0x4e96ed,function(_0x21aa78){if(_0x21aa78['type']!==_0xf90a('0x36')){var _0x3302a5={};_0x3302a5[_0x21aa78[_0xf90a('0x22')]]={'$like':'%'+_0x3dd8b4['query'][_0xf90a('0x34')]+'%'};return _0x3302a5;}})});}_0x5387a6=_[_0xf90a('0x35')]({},_0x5387a6,_0x3dd8b4[_0xf90a('0x37')]);var _0x251384={'where':_0x5387a6[_0xf90a('0x32')]};return db[_0xf90a('0x25')]['count'](_0x251384)[_0xf90a('0x20')](function(_0x4e327b){_0x4221d7[_0xf90a('0x1c')]=_0x4e327b;if(_0x3dd8b4[_0xf90a('0x2a')][_0xf90a('0x38')]){_0x5387a6[_0xf90a('0x39')]=[{'all':!![]}];}return db['SugarcrmField'][_0xf90a('0x3a')](_0x5387a6);})[_0xf90a('0x20')](function(_0x46890e){_0x4221d7['rows']=_0x46890e;return _0x4221d7;})[_0xf90a('0x20')](respondWithFilteredResult(_0x5da259,_0x5387a6))['catch'](handleError(_0x5da259,null));};exports[_0xf90a('0x3b')]=function(_0x33b3fe,_0x5d25f3){var _0x1563d0={'raw':!![],'where':{'id':_0x33b3fe[_0xf90a('0x3c')]['id']}},_0x199860={};_0x199860['model']=_[_0xf90a('0x2b')](db[_0xf90a('0x25')][_0xf90a('0x26')]);_0x199860[_0xf90a('0x2a')]=_[_0xf90a('0x2b')](_0x33b3fe[_0xf90a('0x2a')]);_0x199860[_0xf90a('0x2c')]=_[_0xf90a('0x3d')](_0x199860[_0xf90a('0x29')],_0x199860[_0xf90a('0x2a')]);_0x1563d0[_0xf90a('0x2d')]=_[_0xf90a('0x3d')](_0x199860['model'],qs['fields'](_0x33b3fe[_0xf90a('0x2a')][_0xf90a('0x2e')]));_0x1563d0[_0xf90a('0x2d')]=_0x1563d0[_0xf90a('0x2d')][_0xf90a('0x2f')]?_0x1563d0[_0xf90a('0x2d')]:_0x199860[_0xf90a('0x29')];if(_0x33b3fe['query'][_0xf90a('0x38')]){_0x1563d0[_0xf90a('0x39')]=[{'all':!![]}];}_0x1563d0=_['merge']({},_0x1563d0,_0x33b3fe['options']);return db[_0xf90a('0x25')][_0xf90a('0x3e')](_0x1563d0)['then'](handleEntityNotFound(_0x5d25f3,null))[_0xf90a('0x20')](respondWithResult(_0x5d25f3,null))[_0xf90a('0x3f')](handleError(_0x5d25f3,null));};exports[_0xf90a('0x40')]=function(_0x39afd3,_0x1fdec9){return db[_0xf90a('0x25')]['create'](_0x39afd3['body'],{})[_0xf90a('0x20')](respondWithResult(_0x1fdec9,0xc9))[_0xf90a('0x3f')](handleError(_0x1fdec9,null));};exports['update']=function(_0x52fc19,_0x20162c){if(_0x52fc19[_0xf90a('0x41')]['id']){delete _0x52fc19[_0xf90a('0x41')]['id'];}return db[_0xf90a('0x25')][_0xf90a('0x3e')]({'where':{'id':_0x52fc19[_0xf90a('0x3c')]['id']}})[_0xf90a('0x20')](handleEntityNotFound(_0x20162c,null))['then'](saveUpdates(_0x52fc19['body'],null))[_0xf90a('0x20')](respondWithResult(_0x20162c,null))['catch'](handleError(_0x20162c,null));};exports[_0xf90a('0x42')]=function(_0x1f5d8a,_0xb80722){return db[_0xf90a('0x25')][_0xf90a('0x3e')]({'where':{'id':_0x1f5d8a['params']['id']}})[_0xf90a('0x20')](handleEntityNotFound(_0xb80722,null))[_0xf90a('0x20')](removeEntity(_0xb80722,null))[_0xf90a('0x3f')](handleError(_0xb80722,null));}; \ No newline at end of file +var _0xa81e=['key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','filter','includeAll','include','findAll','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type'];(function(_0x4bc7e,_0x2c3c57){var _0x5bf96a=function(_0x5047e3){while(--_0x5047e3){_0x4bc7e['push'](_0x4bc7e['shift']());}};_0x5bf96a(++_0x2c3c57);}(_0xa81e,0x130));var _0xea81=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xa81e[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xea81('0x0'));var rimraf=require(_0xea81('0x1'));var zipdir=require(_0xea81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xea81('0x3'));var Mustache=require(_0xea81('0x4'));var util=require(_0xea81('0x5'));var path=require('path');var sox=require(_0xea81('0x6'));var csv=require(_0xea81('0x7'));var ejs=require(_0xea81('0x8'));var fs=require('fs');var fs_extra=require(_0xea81('0x9'));var _=require(_0xea81('0xa'));var squel=require(_0xea81('0xb'));var crypto=require(_0xea81('0xc'));var jsforce=require(_0xea81('0xd'));var deskjs=require(_0xea81('0xe'));var toCsv=require('to-csv');var querystring=require(_0xea81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xea81('0x10'));var qs=require(_0xea81('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea81('0x12'))(_0xea81('0x13'));var utils=require(_0xea81('0x14'));var config=require(_0xea81('0x15'));var licenseUtil=require(_0xea81('0x16'));var db=require(_0xea81('0x17'))['db'];function respondWithStatusCode(_0x495afc,_0x4686de){_0x4686de=_0x4686de||0xcc;return function(_0x144627){if(_0x144627){return _0x495afc[_0xea81('0x18')](_0x4686de);}return _0x495afc[_0xea81('0x19')](_0x4686de)[_0xea81('0x1a')]();};}function respondWithResult(_0x19d13a,_0x2e1737){_0x2e1737=_0x2e1737||0xc8;return function(_0x153f14){if(_0x153f14){return _0x19d13a[_0xea81('0x19')](_0x2e1737)[_0xea81('0x1b')](_0x153f14);}};}function respondWithFilteredResult(_0x4ba80d,_0x1b64ec){return function(_0x35d0e8){if(_0x35d0e8){var _0x1ed20a=typeof _0x1b64ec[_0xea81('0x1c')]===_0xea81('0x1d')&&typeof _0x1b64ec['limit']===_0xea81('0x1d');var _0xf0b252=_0x35d0e8[_0xea81('0x1e')];var _0x5d591b=_0x1ed20a?0x0:_0x1b64ec[_0xea81('0x1c')];var _0x35f29c=_0x1ed20a?_0x35d0e8['count']:_0x1b64ec[_0xea81('0x1c')]+_0x1b64ec[_0xea81('0x1f')];var _0x4bd7ab;if(_0x35f29c>=_0xf0b252){_0x35f29c=_0xf0b252;_0x4bd7ab=0xc8;}else{_0x4bd7ab=0xce;}_0x4ba80d[_0xea81('0x19')](_0x4bd7ab);return _0x4ba80d[_0xea81('0x20')]('Content-Range',_0x5d591b+'-'+_0x35f29c+'/'+_0xf0b252)[_0xea81('0x1b')](_0x35d0e8);}return null;};}function patchUpdates(_0x8e1df7){return function(_0x112929){try{jsonpatch[_0xea81('0x21')](_0x112929,_0x8e1df7,!![]);}catch(_0x45079c){return BPromise[_0xea81('0x22')](_0x45079c);}return _0x112929[_0xea81('0x23')]();};}function saveUpdates(_0x30fc5b,_0x2d6ecc){return function(_0x1d3526){if(_0x1d3526){return _0x1d3526[_0xea81('0x24')](_0x30fc5b)[_0xea81('0x25')](function(_0x1998c9){return _0x1998c9;});}return null;};}function removeEntity(_0x4491ea,_0x523c58){return function(_0x3a5bbb){if(_0x3a5bbb){return _0x3a5bbb['destroy']()['then'](function(){_0x4491ea[_0xea81('0x19')](0xcc)[_0xea81('0x1a')]();});}};}function handleEntityNotFound(_0x21f585,_0x1aacaa){return function(_0x173073){if(!_0x173073){_0x21f585['sendStatus'](0x194);}return _0x173073;};}function handleError(_0x18f84b,_0x26ccdf){_0x26ccdf=_0x26ccdf||0x1f4;return function(_0x480ea2){logger['error'](_0x480ea2[_0xea81('0x26')]);if(_0x480ea2[_0xea81('0x27')]){delete _0x480ea2[_0xea81('0x27')];}_0x18f84b[_0xea81('0x19')](_0x26ccdf)[_0xea81('0x28')](_0x480ea2);};}exports['index']=function(_0x55e230,_0x5dd41e){var _0x17f02c={},_0x3fac69={},_0x547ef4={'count':0x0,'rows':[]};var _0x229237=_[_0xea81('0x29')](db[_0xea81('0x2a')][_0xea81('0x2b')],function(_0x297653){return{'name':_0x297653[_0xea81('0x2c')],'type':_0x297653[_0xea81('0x2d')][_0xea81('0x2e')]};});_0x3fac69[_0xea81('0x2f')]=_[_0xea81('0x29')](_0x229237,'name');_0x3fac69['query']=_[_0xea81('0x30')](_0x55e230['query']);_0x3fac69['filters']=_[_0xea81('0x31')](_0x3fac69[_0xea81('0x2f')],_0x3fac69[_0xea81('0x32')]);_0x17f02c[_0xea81('0x33')]=_[_0xea81('0x31')](_0x3fac69['model'],qs['fields'](_0x55e230[_0xea81('0x32')][_0xea81('0x34')]));_0x17f02c[_0xea81('0x33')]=_0x17f02c['attributes'][_0xea81('0x35')]?_0x17f02c[_0xea81('0x33')]:_0x3fac69[_0xea81('0x2f')];if(!_0x55e230['query'][_0xea81('0x36')]('nolimit')){_0x17f02c[_0xea81('0x1f')]=qs[_0xea81('0x1f')](_0x55e230[_0xea81('0x32')][_0xea81('0x1f')]);_0x17f02c[_0xea81('0x1c')]=qs[_0xea81('0x1c')](_0x55e230[_0xea81('0x32')][_0xea81('0x1c')]);}_0x17f02c[_0xea81('0x37')]=qs['sort'](_0x55e230[_0xea81('0x32')][_0xea81('0x38')]);_0x17f02c[_0xea81('0x39')]=qs[_0xea81('0x3a')](_['pick'](_0x55e230[_0xea81('0x32')],_0x3fac69['filters']),_0x229237);if(_0x55e230[_0xea81('0x32')]['filter']){_0x17f02c[_0xea81('0x39')]=_[_0xea81('0x3b')](_0x17f02c[_0xea81('0x39')],{'$or':_['map'](_0x229237,function(_0x283991){if(_0x283991[_0xea81('0x2d')]!=='VIRTUAL'){var _0x55c085={};_0x55c085[_0x283991['name']]={'$like':'%'+_0x55e230[_0xea81('0x32')][_0xea81('0x3c')]+'%'};return _0x55c085;}})});}_0x17f02c=_[_0xea81('0x3b')]({},_0x17f02c,_0x55e230['options']);var _0x1240ed={'where':_0x17f02c[_0xea81('0x39')]};return db[_0xea81('0x2a')][_0xea81('0x1e')](_0x1240ed)[_0xea81('0x25')](function(_0xe7a5d2){_0x547ef4[_0xea81('0x1e')]=_0xe7a5d2;if(_0x55e230['query'][_0xea81('0x3d')]){_0x17f02c[_0xea81('0x3e')]=[{'all':!![]}];}return db[_0xea81('0x2a')][_0xea81('0x3f')](_0x17f02c);})[_0xea81('0x25')](function(_0x22ce7f){_0x547ef4['rows']=_0x22ce7f;return _0x547ef4;})['then'](respondWithFilteredResult(_0x5dd41e,_0x17f02c))[_0xea81('0x40')](handleError(_0x5dd41e,null));};exports['show']=function(_0x30a000,_0x350fab){var _0x372578={'raw':!![],'where':{'id':_0x30a000[_0xea81('0x41')]['id']}},_0x23cb39={};_0x23cb39['model']=_[_0xea81('0x30')](db['SugarcrmField'][_0xea81('0x2b')]);_0x23cb39[_0xea81('0x32')]=_['keys'](_0x30a000[_0xea81('0x32')]);_0x23cb39[_0xea81('0x3a')]=_['intersection'](_0x23cb39[_0xea81('0x2f')],_0x23cb39[_0xea81('0x32')]);_0x372578['attributes']=_[_0xea81('0x31')](_0x23cb39['model'],qs[_0xea81('0x34')](_0x30a000[_0xea81('0x32')][_0xea81('0x34')]));_0x372578[_0xea81('0x33')]=_0x372578[_0xea81('0x33')][_0xea81('0x35')]?_0x372578['attributes']:_0x23cb39[_0xea81('0x2f')];if(_0x30a000['query'][_0xea81('0x3d')]){_0x372578[_0xea81('0x3e')]=[{'all':!![]}];}_0x372578=_[_0xea81('0x3b')]({},_0x372578,_0x30a000['options']);return db['SugarcrmField'][_0xea81('0x42')](_0x372578)[_0xea81('0x25')](handleEntityNotFound(_0x350fab,null))['then'](respondWithResult(_0x350fab,null))[_0xea81('0x40')](handleError(_0x350fab,null));};exports[_0xea81('0x43')]=function(_0x1ef222,_0x4b3248){return db['SugarcrmField'][_0xea81('0x43')](_0x1ef222[_0xea81('0x44')],{})[_0xea81('0x25')](respondWithResult(_0x4b3248,0xc9))[_0xea81('0x40')](handleError(_0x4b3248,null));};exports[_0xea81('0x24')]=function(_0x3842fa,_0x16000f){if(_0x3842fa[_0xea81('0x44')]['id']){delete _0x3842fa[_0xea81('0x44')]['id'];}return db[_0xea81('0x2a')][_0xea81('0x42')]({'where':{'id':_0x3842fa[_0xea81('0x41')]['id']}})[_0xea81('0x25')](handleEntityNotFound(_0x16000f,null))[_0xea81('0x25')](saveUpdates(_0x3842fa[_0xea81('0x44')],null))[_0xea81('0x25')](respondWithResult(_0x16000f,null))['catch'](handleError(_0x16000f,null));};exports[_0xea81('0x45')]=function(_0x118832,_0x3aa0eb){return db[_0xea81('0x2a')][_0xea81('0x42')]({'where':{'id':_0x118832[_0xea81('0x41')]['id']}})[_0xea81('0x25')](handleEntityNotFound(_0x3aa0eb,null))[_0xea81('0x25')](removeEntity(_0x3aa0eb,null))[_0xea81('0x40')](handleError(_0x3aa0eb,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index e8f325b..c67c937 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 _0xe1cb=['path','../../config/environment','./intSugarcrmField.attributes','exports','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x438dcd,_0x4894ef){var _0x1446ab=function(_0x22e4ae){while(--_0x22e4ae){_0x438dcd['push'](_0x438dcd['shift']());}};_0x1446ab(++_0x4894ef);}(_0xe1cb,0xc2));var _0xbe1c=function(_0x40375c,_0x57ea2f){_0x40375c=_0x40375c-0x0;var _0xdca3fb=_0xe1cb[_0x40375c];return _0xdca3fb;};'use strict';var _=require('lodash');var util=require(_0xbe1c('0x0'));var logger=require(_0xbe1c('0x1'))(_0xbe1c('0x2'));var moment=require(_0xbe1c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe1c('0x4'));var rimraf=require('rimraf');var config=require(_0xbe1c('0x5'));var attributes=require(_0xbe1c('0x6'));module[_0xbe1c('0x7')]=function(_0x3862a2,_0x68323b){return _0x3862a2['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xbe1c('0x8'),'fields':[_0xbe1c('0x9'),_0xbe1c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a96=['idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x16c60d,_0xf81d7c){var _0x53645b=function(_0x4b9d3e){while(--_0x4b9d3e){_0x16c60d['push'](_0x16c60d['shift']());}};_0x53645b(++_0xf81d7c);}(_0x8a96,0xd2));var _0x68a9=function(_0x46d613,_0xf6aa29){_0x46d613=_0x46d613-0x0;var _0x3494e1=_0x8a96[_0x46d613];return _0x3494e1;};'use strict';var _=require(_0x68a9('0x0'));var util=require('util');var logger=require(_0x68a9('0x1'))(_0x68a9('0x2'));var moment=require(_0x68a9('0x3'));var BPromise=require(_0x68a9('0x4'));var rp=require(_0x68a9('0x5'));var fs=require('fs');var path=require(_0x68a9('0x6'));var rimraf=require(_0x68a9('0x7'));var config=require(_0x68a9('0x8'));var attributes=require(_0x68a9('0x9'));module[_0x68a9('0xa')]=function(_0x129433,_0x338a4b){return _0x129433[_0x68a9('0xb')]('SugarcrmField',attributes,{'tableName':_0x68a9('0xc'),'paranoid':![],'indexes':[{'name':_0x68a9('0xd'),'fields':[_0x68a9('0xe'),_0x68a9('0xf')],'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 ba361c6..3d49d92 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 _0x25ae=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3f50fe,_0x55bf67){var _0x483673=function(_0x3bc223){while(--_0x3bc223){_0x3f50fe['push'](_0x3f50fe['shift']());}};_0x483673(++_0x55bf67);}(_0x25ae,0x11a));var _0xe25a=function(_0x4f3e2c,_0x55f6b6){_0x4f3e2c=_0x4f3e2c-0x0;var _0x1fcc17=_0x25ae[_0x4f3e2c];return _0x1fcc17;};'use strict';var _=require(_0xe25a('0x0'));var util=require(_0xe25a('0x1'));var moment=require(_0xe25a('0x2'));var BPromise=require(_0xe25a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe25a('0x4'));var db=require(_0xe25a('0x5'))['db'];var utils=require(_0xe25a('0x6'));var logger=require('../../config/logger')(_0xe25a('0x7'));var config=require(_0xe25a('0x8'));var jayson=require(_0xe25a('0x9'));var client=jayson[_0xe25a('0xa')][_0xe25a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427e4c,_0x5a298d,_0x18f499){return new BPromise(function(_0xc85030,_0x2169ef){return client[_0xe25a('0xc')](_0x427e4c,_0x18f499)[_0xe25a('0xd')](function(_0x463da9){logger[_0xe25a('0xe')](_0xe25a('0xf'),_0x5a298d,_0xe25a('0x10'));logger['debug'](_0xe25a('0x11'),_0x5a298d,'request\x20sent',JSON[_0xe25a('0x12')](_0x463da9));if(_0x463da9[_0xe25a('0x13')]){if(_0x463da9[_0xe25a('0x13')][_0xe25a('0x14')]===0x1f4){logger['error'](_0xe25a('0xf'),_0x5a298d,_0x463da9[_0xe25a('0x13')][_0xe25a('0x15')]);return _0x2169ef(_0x463da9[_0xe25a('0x13')][_0xe25a('0x15')]);}logger[_0xe25a('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x5a298d,_0x463da9[_0xe25a('0x13')]['message']);return _0xc85030(_0x463da9['error'][_0xe25a('0x15')]);}else{logger[_0xe25a('0xe')](_0xe25a('0xf'),_0x5a298d,'request\x20sent');_0xc85030(_0x463da9[_0xe25a('0x16')][_0xe25a('0x15')]);}})[_0xe25a('0x17')](function(_0x22e548){logger[_0xe25a('0x13')](_0xe25a('0xf'),_0x5a298d,_0x22e548);_0x2169ef(_0x22e548);});});} \ No newline at end of file +var _0xdd26=['http','request','then','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xdd26,0xf4));var _0x6dd2=function(_0x27b987,_0x168ecf){_0x27b987=_0x27b987-0x0;var _0x3a7f32=_0xdd26[_0x27b987];return _0x3a7f32;};'use strict';var _=require('lodash');var util=require(_0x6dd2('0x0'));var moment=require(_0x6dd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x6dd2('0x2'));var fs=require('fs');var Redis=require(_0x6dd2('0x3'));var db=require(_0x6dd2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dd2('0x5'))('rpc');var config=require(_0x6dd2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6dd2('0x7')][_0x6dd2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6063b1,_0x1534a2,_0x2b5340){return new BPromise(function(_0x2757f1,_0x3ffd23){return client[_0x6dd2('0x9')](_0x6063b1,_0x2b5340)[_0x6dd2('0xa')](function(_0x362f96){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1534a2,_0x6dd2('0xb'));logger[_0x6dd2('0xc')](_0x6dd2('0xd'),_0x1534a2,_0x6dd2('0xb'),JSON[_0x6dd2('0xe')](_0x362f96));if(_0x362f96[_0x6dd2('0xf')]){if(_0x362f96[_0x6dd2('0xf')][_0x6dd2('0x10')]===0x1f4){logger['error'](_0x6dd2('0x11'),_0x1534a2,_0x362f96[_0x6dd2('0xf')][_0x6dd2('0x12')]);return _0x3ffd23(_0x362f96[_0x6dd2('0xf')][_0x6dd2('0x12')]);}logger[_0x6dd2('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x1534a2,_0x362f96[_0x6dd2('0xf')][_0x6dd2('0x12')]);return _0x2757f1(_0x362f96[_0x6dd2('0xf')][_0x6dd2('0x12')]);}else{logger[_0x6dd2('0x13')](_0x6dd2('0x11'),_0x1534a2,_0x6dd2('0xb'));_0x2757f1(_0x362f96['result'][_0x6dd2('0x12')]);}})[_0x6dd2('0x14')](function(_0x81a463){logger[_0x6dd2('0xf')](_0x6dd2('0x11'),_0x1534a2,_0x81a463);_0x3ffd23(_0x81a463);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 2322f67..786424a 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 _0x6f49=['connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','util','path'];(function(_0x4d9fc4,_0x2eeda3){var _0x33eeab=function(_0x87932a){while(--_0x87932a){_0x4d9fc4['push'](_0x4d9fc4['shift']());}};_0x33eeab(++_0x2eeda3);}(_0x6f49,0xa6));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x96f4('0x0'));var path=require(_0x96f4('0x1'));var timeout=require(_0x96f4('0x2'));var express=require(_0x96f4('0x3'));var router=express[_0x96f4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x96f4('0x5'));var controller=require('./intVtigerAccount.controller');router[_0x96f4('0x6')]('/',auth[_0x96f4('0x7')](),controller[_0x96f4('0x8')]);router['get'](_0x96f4('0x9'),auth[_0x96f4('0x7')](),controller[_0x96f4('0xa')]);router[_0x96f4('0x6')](_0x96f4('0xb'),auth[_0x96f4('0x7')](),controller[_0x96f4('0xc')]);router[_0x96f4('0x6')](_0x96f4('0xd'),auth['isAuthenticated'](),controller[_0x96f4('0xe')]);router[_0x96f4('0xf')]('/',auth[_0x96f4('0x7')](),controller[_0x96f4('0x10')]);router[_0x96f4('0xf')]('/:id/configurations',auth[_0x96f4('0x7')](),controller[_0x96f4('0x11')]);router[_0x96f4('0x12')]('/:id',auth[_0x96f4('0x7')](),controller[_0x96f4('0x13')]);router[_0x96f4('0x14')](_0x96f4('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6453=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','delete','destroy','multer','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6453,0x88));var _0x3645=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x6453[_0x1bfe2b];return _0x1477d4;};'use strict';var multer=require(_0x3645('0x0'));var util=require(_0x3645('0x1'));var path=require('path');var timeout=require(_0x3645('0x2'));var express=require(_0x3645('0x3'));var router=express[_0x3645('0x4')]();var fs_extra=require(_0x3645('0x5'));var auth=require(_0x3645('0x6'));var interaction=require(_0x3645('0x7'));var config=require(_0x3645('0x8'));var controller=require(_0x3645('0x9'));router[_0x3645('0xa')]('/',auth[_0x3645('0xb')](),controller[_0x3645('0xc')]);router[_0x3645('0xa')](_0x3645('0xd'),auth[_0x3645('0xb')](),controller[_0x3645('0xe')]);router[_0x3645('0xa')](_0x3645('0xf'),auth[_0x3645('0xb')](),controller[_0x3645('0x10')]);router[_0x3645('0xa')](_0x3645('0x11'),auth[_0x3645('0xb')](),controller['getFields']);router[_0x3645('0x12')]('/',auth[_0x3645('0xb')](),controller[_0x3645('0x13')]);router['post'](_0x3645('0xf'),auth[_0x3645('0xb')](),controller[_0x3645('0x14')]);router['put'](_0x3645('0xd'),auth[_0x3645('0xb')](),controller['update']);router[_0x3645('0x15')](_0x3645('0xd'),auth[_0x3645('0xb')](),controller[_0x3645('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f1398ce..cfb5763 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 _0x9662=['exports','STRING','HelpDesk'];(function(_0x48b9b3,_0x494ddd){var _0x11ae1d=function(_0x4fdada){while(--_0x4fdada){_0x48b9b3['push'](_0x48b9b3['shift']());}};_0x11ae1d(++_0x494ddd);}(_0x9662,0xea));var _0x2966=function(_0x4d173b,_0x42592e){_0x4d173b=_0x4d173b-0x0;var _0x553519=_0x9662[_0x4d173b];return _0x553519;};'use strict';var Sequelize=require('sequelize');module[_0x2966('0x0')]={'name':{'type':Sequelize[_0x2966('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2966('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2966('0x1')],'allowNull':![],'defaultValue':_0x2966('0x2')},'remoteUri':{'type':Sequelize[_0x2966('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2966('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2966('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6bb4=['STRING','sequelize'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x6bb4,0xd9));var _0x46bb=function(_0x4a0012,_0x18114f){_0x4a0012=_0x4a0012-0x0;var _0x539013=_0x6bb4[_0x4a0012];return _0x539013;};'use strict';var Sequelize=require(_0x46bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x46bb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x46bb('0x1')]},'username':{'type':Sequelize[_0x46bb('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x46bb('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x46bb('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x46bb('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index dc4fd7d..7aef935 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 _0xba91=['getDescriptions','VtigerField','Descriptions','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','reference','owner','remove','editable','false','startsWith','cf_','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','VtigerAccount','fieldName','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','getConfigurations','VtigerConfiguration','pick','findOne','AccountId','Subjects','getSubjects','channel'];(function(_0xb6f84d,_0x25bafc){var _0x5158da=function(_0x1770cb){while(--_0x1770cb){_0xb6f84d['push'](_0xb6f84d['shift']());}};_0x5158da(++_0x25bafc);}(_0xba91,0x19c));var _0x1ba9=function(_0x6088ca,_0x134af8){_0x6088ca=_0x6088ca-0x0;var _0x2a331b=_0xba91[_0x6088ca];return _0x2a331b;};'use strict';var emlformat=require(_0x1ba9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ba9('0x1'));var jsonpatch=require(_0x1ba9('0x2'));var rp=require(_0x1ba9('0x3'));var moment=require(_0x1ba9('0x4'));var BPromise=require(_0x1ba9('0x5'));var Mustache=require(_0x1ba9('0x6'));var util=require(_0x1ba9('0x7'));var path=require(_0x1ba9('0x8'));var sox=require(_0x1ba9('0x9'));var csv=require(_0x1ba9('0xa'));var ejs=require(_0x1ba9('0xb'));var fs=require('fs');var fs_extra=require(_0x1ba9('0xc'));var _=require(_0x1ba9('0xd'));var squel=require(_0x1ba9('0xe'));var crypto=require('crypto');var jsforce=require(_0x1ba9('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ba9('0x10'));var Papa=require(_0x1ba9('0x11'));var Redis=require(_0x1ba9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1ba9('0x13'));var as=require(_0x1ba9('0x14'));var hardwareService=require(_0x1ba9('0x15'));var logger=require('../../config/logger')(_0x1ba9('0x16'));var utils=require(_0x1ba9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ba9('0x18'));var db=require(_0x1ba9('0x19'))['db'];var integrations=require(_0x1ba9('0x1a'));function respondWithStatusCode(_0x4f12a6,_0x16e31e){_0x16e31e=_0x16e31e||0xcc;return function(_0x32d036){if(_0x32d036){return _0x4f12a6[_0x1ba9('0x1b')](_0x16e31e);}return _0x4f12a6[_0x1ba9('0x1c')](_0x16e31e)[_0x1ba9('0x1d')]();};}function respondWithResult(_0xa3beaa,_0x54d9f4){_0x54d9f4=_0x54d9f4||0xc8;return function(_0x4d46a4){if(_0x4d46a4){return _0xa3beaa[_0x1ba9('0x1c')](_0x54d9f4)['json'](_0x4d46a4);}};}function respondWithFilteredResult(_0x5ccfaf,_0x1dcc70){return function(_0x128ea2){if(_0x128ea2){var _0x321896=typeof _0x1dcc70['offset']===_0x1ba9('0x1e')&&typeof _0x1dcc70[_0x1ba9('0x1f')]===_0x1ba9('0x1e');var _0x582870=_0x128ea2[_0x1ba9('0x20')];var _0x1f8c8b=_0x321896?0x0:_0x1dcc70[_0x1ba9('0x21')];var _0xf9c1df=_0x321896?_0x128ea2[_0x1ba9('0x20')]:_0x1dcc70[_0x1ba9('0x21')]+_0x1dcc70[_0x1ba9('0x1f')];var _0x33a4a8;if(_0xf9c1df>=_0x582870){_0xf9c1df=_0x582870;_0x33a4a8=0xc8;}else{_0x33a4a8=0xce;}_0x5ccfaf[_0x1ba9('0x1c')](_0x33a4a8);return _0x5ccfaf[_0x1ba9('0x22')](_0x1ba9('0x23'),_0x1f8c8b+'-'+_0xf9c1df+'/'+_0x582870)['json'](_0x128ea2);}return null;};}function patchUpdates(_0x5d2fc3){return function(_0x2fc5c7){try{jsonpatch[_0x1ba9('0x24')](_0x2fc5c7,_0x5d2fc3,!![]);}catch(_0x21f760){return BPromise[_0x1ba9('0x25')](_0x21f760);}return _0x2fc5c7[_0x1ba9('0x26')]();};}function saveUpdates(_0x263c36,_0x316ca0){return function(_0x52f738){if(_0x52f738){return _0x52f738['update'](_0x263c36)['then'](function(_0x638b03){return _0x638b03;});}return null;};}function removeEntity(_0x14a842,_0x2a57fd){return function(_0x44b7fe){if(_0x44b7fe){return _0x44b7fe[_0x1ba9('0x27')]()[_0x1ba9('0x28')](function(){_0x14a842[_0x1ba9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22b7ff,_0x3f7c12){return function(_0x55f4db){if(!_0x55f4db){_0x22b7ff[_0x1ba9('0x1b')](0x194);}return _0x55f4db;};}function handleError(_0x49f700,_0xe833d2){_0xe833d2=_0xe833d2||0x1f4;return function(_0x2800e3){logger[_0x1ba9('0x29')](_0x2800e3[_0x1ba9('0x2a')]);if(_0x2800e3[_0x1ba9('0x2b')]){delete _0x2800e3[_0x1ba9('0x2b')];}_0x49f700[_0x1ba9('0x1c')](_0xe833d2)['send'](_0x2800e3);};}exports[_0x1ba9('0x2c')]=function(_0xc16694,_0x105cf2){var _0x731101={},_0x19562b={},_0x5d04bc={'count':0x0,'rows':[]};var _0x161df5=_[_0x1ba9('0x2d')](db[_0x1ba9('0x2e')]['rawAttributes'],function(_0x5d1269){return{'name':_0x5d1269[_0x1ba9('0x2f')],'type':_0x5d1269['type']['key']};});_0x19562b[_0x1ba9('0x30')]=_['map'](_0x161df5,_0x1ba9('0x2b'));_0x19562b['query']=_[_0x1ba9('0x31')](_0xc16694[_0x1ba9('0x32')]);_0x19562b[_0x1ba9('0x33')]=_[_0x1ba9('0x34')](_0x19562b[_0x1ba9('0x30')],_0x19562b['query']);_0x731101[_0x1ba9('0x35')]=_['intersection'](_0x19562b[_0x1ba9('0x30')],qs['fields'](_0xc16694['query'][_0x1ba9('0x36')]));_0x731101[_0x1ba9('0x35')]=_0x731101[_0x1ba9('0x35')][_0x1ba9('0x37')]?_0x731101['attributes']:_0x19562b['model'];if(!_0xc16694[_0x1ba9('0x32')]['hasOwnProperty']('nolimit')){_0x731101['limit']=qs[_0x1ba9('0x1f')](_0xc16694[_0x1ba9('0x32')]['limit']);_0x731101['offset']=qs[_0x1ba9('0x21')](_0xc16694[_0x1ba9('0x32')]['offset']);}_0x731101[_0x1ba9('0x38')]=qs[_0x1ba9('0x39')](_0xc16694['query'][_0x1ba9('0x39')]);_0x731101[_0x1ba9('0x3a')]=qs[_0x1ba9('0x33')](_['pick'](_0xc16694[_0x1ba9('0x32')],_0x19562b['filters']),_0x161df5);if(_0xc16694[_0x1ba9('0x32')][_0x1ba9('0x3b')]){_0x731101['where']=_[_0x1ba9('0x3c')](_0x731101[_0x1ba9('0x3a')],{'$or':_[_0x1ba9('0x2d')](_0x161df5,function(_0x1234dc){if(_0x1234dc[_0x1ba9('0x3d')]!==_0x1ba9('0x3e')){var _0x2b35bc={};_0x2b35bc[_0x1234dc[_0x1ba9('0x2b')]]={'$like':'%'+_0xc16694[_0x1ba9('0x32')]['filter']+'%'};return _0x2b35bc;}})});}_0x731101=_['merge']({},_0x731101,_0xc16694[_0x1ba9('0x3f')]);var _0x5a4d9b={'where':_0x731101[_0x1ba9('0x3a')]};return db[_0x1ba9('0x2e')][_0x1ba9('0x20')](_0x5a4d9b)[_0x1ba9('0x28')](function(_0x2bb9ec){_0x5d04bc[_0x1ba9('0x20')]=_0x2bb9ec;if(_0xc16694[_0x1ba9('0x32')][_0x1ba9('0x40')]){_0x731101[_0x1ba9('0x41')]=[{'all':!![]}];}return db[_0x1ba9('0x2e')][_0x1ba9('0x42')](_0x731101);})[_0x1ba9('0x28')](function(_0x51ceb4){_0x5d04bc[_0x1ba9('0x43')]=_0x51ceb4;return _0x5d04bc;})[_0x1ba9('0x28')](respondWithFilteredResult(_0x105cf2,_0x731101))[_0x1ba9('0x44')](handleError(_0x105cf2,null));};exports[_0x1ba9('0x45')]=function(_0x2a2a84,_0x4b6b82){var _0x428e6b={'raw':![],'where':{'id':_0x2a2a84['params']['id']}},_0x2125c8={};_0x2125c8[_0x1ba9('0x30')]=_[_0x1ba9('0x31')](db[_0x1ba9('0x2e')][_0x1ba9('0x46')]);_0x2125c8['query']=_[_0x1ba9('0x31')](_0x2a2a84[_0x1ba9('0x32')]);_0x2125c8[_0x1ba9('0x33')]=_['intersection'](_0x2125c8[_0x1ba9('0x30')],_0x2125c8[_0x1ba9('0x32')]);_0x428e6b[_0x1ba9('0x35')]=_['intersection'](_0x2125c8[_0x1ba9('0x30')],qs[_0x1ba9('0x36')](_0x2a2a84[_0x1ba9('0x32')][_0x1ba9('0x36')]));_0x428e6b['attributes']=_0x428e6b['attributes'][_0x1ba9('0x37')]?_0x428e6b[_0x1ba9('0x35')]:_0x2125c8['model'];if(_0x2a2a84[_0x1ba9('0x32')]['includeAll']){_0x428e6b[_0x1ba9('0x41')]=[{'all':!![]}];}_0x428e6b=_['merge']({},_0x428e6b,_0x2a2a84[_0x1ba9('0x3f')]);return db[_0x1ba9('0x2e')][_0x1ba9('0x47')](_0x428e6b)[_0x1ba9('0x28')](handleEntityNotFound(_0x4b6b82,null))[_0x1ba9('0x28')](respondWithResult(_0x4b6b82,null))[_0x1ba9('0x44')](handleError(_0x4b6b82,null));};exports['create']=function(_0x59b600,_0x3dc725){return db[_0x1ba9('0x2e')][_0x1ba9('0x48')](_0x59b600['body'],{})[_0x1ba9('0x28')](respondWithResult(_0x3dc725,0xc9))[_0x1ba9('0x44')](handleError(_0x3dc725,null));};exports[_0x1ba9('0x49')]=function(_0x167c8f,_0x458b8c){if(_0x167c8f[_0x1ba9('0x4a')]['id']){delete _0x167c8f[_0x1ba9('0x4a')]['id'];}return db['VtigerAccount'][_0x1ba9('0x47')]({'where':{'id':_0x167c8f['params']['id']}})[_0x1ba9('0x28')](handleEntityNotFound(_0x458b8c,null))[_0x1ba9('0x28')](saveUpdates(_0x167c8f[_0x1ba9('0x4a')],null))[_0x1ba9('0x28')](respondWithResult(_0x458b8c,null))[_0x1ba9('0x44')](handleError(_0x458b8c,null));};exports['destroy']=function(_0x404845,_0x2e860b){return db[_0x1ba9('0x2e')]['find']({'where':{'id':_0x404845[_0x1ba9('0x4b')]['id']}})[_0x1ba9('0x28')](handleEntityNotFound(_0x2e860b,null))[_0x1ba9('0x28')](removeEntity(_0x2e860b,null))[_0x1ba9('0x44')](handleError(_0x2e860b,null));};exports[_0x1ba9('0x4c')]=function(_0x3c8d8d,_0x5243b1,_0x14a53a){var _0x2f3abf={};var _0x54917c={};var _0x4c116c;var _0x534223;return db['VtigerAccount']['findOne']({'where':{'id':_0x3c8d8d['params']['id']}})[_0x1ba9('0x28')](handleEntityNotFound(_0x5243b1,null))['then'](function(_0x251e82){if(_0x251e82){_0x4c116c=_0x251e82;_0x54917c[_0x1ba9('0x30')]=_[_0x1ba9('0x31')](db[_0x1ba9('0x4d')]['rawAttributes']);_0x54917c[_0x1ba9('0x32')]=_[_0x1ba9('0x31')](_0x3c8d8d['query']);_0x54917c[_0x1ba9('0x33')]=_[_0x1ba9('0x34')](_0x54917c['model'],_0x54917c[_0x1ba9('0x32')]);_0x2f3abf[_0x1ba9('0x35')]=_[_0x1ba9('0x34')](_0x54917c[_0x1ba9('0x30')],qs['fields'](_0x3c8d8d[_0x1ba9('0x32')][_0x1ba9('0x36')]));_0x2f3abf['attributes']=_0x2f3abf['attributes'][_0x1ba9('0x37')]?_0x2f3abf[_0x1ba9('0x35')]:_0x54917c[_0x1ba9('0x30')];_0x2f3abf[_0x1ba9('0x38')]=qs['sort'](_0x3c8d8d[_0x1ba9('0x32')][_0x1ba9('0x39')]);_0x2f3abf[_0x1ba9('0x3a')]=qs[_0x1ba9('0x33')](_[_0x1ba9('0x4e')](_0x3c8d8d['query'],_0x54917c[_0x1ba9('0x33')]));if(_0x3c8d8d['query'][_0x1ba9('0x3b')]){_0x2f3abf[_0x1ba9('0x3a')]=_[_0x1ba9('0x3c')](_0x2f3abf[_0x1ba9('0x3a')],{'$or':_[_0x1ba9('0x2d')](_0x2f3abf[_0x1ba9('0x35')],function(_0x415831){var _0x6877e8={};_0x6877e8[_0x415831]={'$like':'%'+_0x3c8d8d[_0x1ba9('0x32')][_0x1ba9('0x3b')]+'%'};return _0x6877e8;})});}_0x2f3abf=_['merge']({},_0x2f3abf,_0x3c8d8d['options']);return _0x4c116c[_0x1ba9('0x4c')](_0x2f3abf);}})[_0x1ba9('0x28')](function(_0x2d0cf7){if(_0x2d0cf7){_0x534223=_0x2d0cf7[_0x1ba9('0x37')];if(!_0x3c8d8d[_0x1ba9('0x32')]['hasOwnProperty']('nolimit')){_0x2f3abf['limit']=qs[_0x1ba9('0x1f')](_0x3c8d8d[_0x1ba9('0x32')]['limit']);_0x2f3abf[_0x1ba9('0x21')]=qs[_0x1ba9('0x21')](_0x3c8d8d[_0x1ba9('0x32')]['offset']);}return _0x4c116c['getConfigurations'](_0x2f3abf);}})[_0x1ba9('0x28')](function(_0x450a1f){if(_0x450a1f){return _0x450a1f?{'count':_0x534223,'rows':_0x450a1f}:null;}})[_0x1ba9('0x28')](respondWithResult(_0x5243b1,null))[_0x1ba9('0x44')](handleError(_0x5243b1,null));};exports['addConfiguration']=function(_0x360124,_0xadd7b6,_0x4d2e12){if(_0x360124[_0x1ba9('0x4a')]['id']){delete _0x360124['body']['id'];}return db[_0x1ba9('0x2e')][_0x1ba9('0x4f')]({'where':{'id':_0x360124[_0x1ba9('0x4b')]['id']}})[_0x1ba9('0x28')](handleEntityNotFound(_0xadd7b6,null))['then'](function(_0x3a6d3d){if(_0x3a6d3d){_0x360124['body'][_0x1ba9('0x50')]=_0x3a6d3d['id'];_0x360124['body'][_0x1ba9('0x51')]=integrations[_0x1ba9('0x52')](_0x360124['body'][_0x1ba9('0x53')],_0x360124[_0x1ba9('0x4a')][_0x1ba9('0x3d')]);_0x360124[_0x1ba9('0x4a')]['Descriptions']=integrations[_0x1ba9('0x54')](_0x360124['body']['channel'],_0x360124[_0x1ba9('0x4a')][_0x1ba9('0x3d')]);return db['VtigerConfiguration'][_0x1ba9('0x48')](_0x360124[_0x1ba9('0x4a')],{'include':[{'model':db[_0x1ba9('0x55')],'as':'Subjects'},{'model':db[_0x1ba9('0x55')],'as':_0x1ba9('0x56')}]});}return null;})[_0x1ba9('0x28')](respondWithResult(_0xadd7b6,null))[_0x1ba9('0x44')](handleError(_0xadd7b6,null));};var md5=require('md5');exports['getFields']=function(_0x393618,_0x4891dd,_0x55ebaa){var _0x404b66=null;var _0x1944ba=null;var _0x2a995e=null;var _0x3870ee=null;var _0x24e8ba='';return db[_0x1ba9('0x2e')]['findOne']({'where':{'id':_0x393618[_0x1ba9('0x4b')]['id']},'attributes':['id',_0x1ba9('0x2b'),_0x1ba9('0x57'),_0x1ba9('0x58'),'moduleName',_0x1ba9('0x59'),_0x1ba9('0x5a'),_0x1ba9('0x5b')]})[_0x1ba9('0x28')](handleEntityNotFound(_0x4891dd,null))[_0x1ba9('0x28')](function(_0x80276f){if(_0x80276f){_0x404b66=_0x80276f['username'];_0x1944ba=_0x80276f['accessKey'];_0x2a995e=_0x80276f[_0x1ba9('0x5c')];_0x24e8ba=_0x80276f[_0x1ba9('0x59')];var _0x20395d=_0x24e8ba[_0x1ba9('0x5d')](-0x1);if(_0x20395d==='/'){_0x24e8ba=_0x24e8ba[_0x1ba9('0x5e')](0x0,_0x24e8ba[_0x1ba9('0x5f')](_0x20395d));}_0x3870ee=util[_0x1ba9('0x60')](_0x1ba9('0x61'),_0x24e8ba);var _0x1f7b7d={'method':_0x1ba9('0x62'),'uri':_0x3870ee,'qs':{'operation':_0x1ba9('0x63'),'username':_0x80276f[_0x1ba9('0x57')]},'json':!![]};return rp(_0x1f7b7d);}})[_0x1ba9('0x28')](function(_0x3ffe57){if(_0x3ffe57[_0x1ba9('0x64')]){var _0x43e4dd={'method':_0x1ba9('0x65'),'uri':_0x3870ee,'form':{'operation':_0x1ba9('0x66'),'username':_0x404b66,'accessKey':md5(_0x3ffe57[_0x1ba9('0x67')][_0x1ba9('0x68')]+_0x1944ba)},'json':!![]};return rp(_0x43e4dd);}})[_0x1ba9('0x28')](function(_0x3cc4db){if(_0x3cc4db[_0x1ba9('0x64')]){var _0x52949b={'method':_0x1ba9('0x62'),'uri':_0x3870ee,'qs':{'operation':_0x1ba9('0x69'),'username':_0x404b66,'sessionName':_0x3cc4db[_0x1ba9('0x67')][_0x1ba9('0x6a')],'elementType':_0x2a995e},'json':!![]};return rp(_0x52949b);}})[_0x1ba9('0x28')](function(_0x7c195e){if(_0x7c195e['success']){var _0x2e5ad2=['autogenerated',_0x1ba9('0x6b'),_0x1ba9('0x6c')];_[_0x1ba9('0x6d')](_0x7c195e[_0x1ba9('0x67')][_0x1ba9('0x36')],function(_0xc7934){return _0x2e5ad2['includes'](_0xc7934['type'][_0x1ba9('0x2b')]);});_[_0x1ba9('0x6d')](_0x7c195e[_0x1ba9('0x67')][_0x1ba9('0x36')],function(_0x30aa70){return _0x30aa70[_0x1ba9('0x6e')]===_0x1ba9('0x6f');});return{'count':_0x7c195e[_0x1ba9('0x67')]['fields'][_0x1ba9('0x37')],'rows':_[_0x1ba9('0x2d')](_0x7c195e[_0x1ba9('0x67')][_0x1ba9('0x36')],function(_0x53a7d7){return{'id':_0x53a7d7[_0x1ba9('0x2b')],'name':_0x53a7d7['label'],'custom':_[_0x1ba9('0x70')](_0x53a7d7[_0x1ba9('0x2b')],_0x1ba9('0x71'))?!![]:![],'options':_0x53a7d7[_0x1ba9('0x3d')][_0x1ba9('0x2b')]===_0x1ba9('0x72')&&_0x53a7d7[_0x1ba9('0x3d')]['picklistValues'][_0x1ba9('0x37')]>0x0?_[_0x1ba9('0x2d')](_0x53a7d7[_0x1ba9('0x3d')][_0x1ba9('0x73')],function(_0x150eae){return{'name':_0x150eae[_0x1ba9('0x74')],'value':_0x150eae['value']};}):[]};})};}})[_0x1ba9('0x28')](respondWithResult(_0x4891dd,null))['catch'](function(_0x277005){console[_0x1ba9('0x75')](_0x1ba9('0x76')+_0x277005);var _0x421830=_0x393618[_0x1ba9('0x32')][_0x1ba9('0x77')]?0x1f4:_0x277005[_0x1ba9('0x78')]||0x1f4;logger[_0x1ba9('0x29')](_0x1ba9('0x79'),_0x1ba9('0x7a'),_0x421830,JSON['stringify'](_0x277005));delete _0x277005[_0x1ba9('0x2b')];if(_0x421830===0x191){_0x421830=0x190;}_0x4891dd[_0x1ba9('0x1c')](_0x421830)['send'](_0x393618['query']['test']?{'message':_0x1ba9('0x7b'),'statusCode':_0x277005[_0x1ba9('0x78')]}:_0x277005);});}; \ No newline at end of file +var _0x4863=['includes','editable','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','create','body','findOne','VtigerConfiguration','options','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','sessionName','reference','owner','remove'];(function(_0x43f13b,_0x1f319e){var _0x5cc313=function(_0x2cbef2){while(--_0x2cbef2){_0x43f13b['push'](_0x43f13b['shift']());}};_0x5cc313(++_0x1f319e);}(_0x4863,0x1e7));var _0x3486=function(_0x49cbf6,_0x452dc1){_0x49cbf6=_0x49cbf6-0x0;var _0x7d90ef=_0x4863[_0x49cbf6];return _0x7d90ef;};'use strict';var emlformat=require(_0x3486('0x0'));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('bluebird');var Mustache=require(_0x3486('0x1'));var util=require('util');var path=require(_0x3486('0x2'));var sox=require(_0x3486('0x3'));var csv=require(_0x3486('0x4'));var ejs=require(_0x3486('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3486('0x6'));var squel=require('squel');var crypto=require(_0x3486('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3486('0x4'));var querystring=require(_0x3486('0x8'));var Papa=require(_0x3486('0x9'));var Redis=require(_0x3486('0xa'));var authService=require(_0x3486('0xb'));var qs=require(_0x3486('0xc'));var as=require(_0x3486('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3486('0xe'))(_0x3486('0xf'));var utils=require('../../config/utils');var config=require(_0x3486('0x10'));var licenseUtil=require(_0x3486('0x11'));var db=require(_0x3486('0x12'))['db'];var integrations=require(_0x3486('0x13'));function respondWithStatusCode(_0x2d5b53,_0x2e1568){_0x2e1568=_0x2e1568||0xcc;return function(_0x3639cd){if(_0x3639cd){return _0x2d5b53[_0x3486('0x14')](_0x2e1568);}return _0x2d5b53[_0x3486('0x15')](_0x2e1568)[_0x3486('0x16')]();};}function respondWithResult(_0x42064e,_0x24b2bc){_0x24b2bc=_0x24b2bc||0xc8;return function(_0x565d9f){if(_0x565d9f){return _0x42064e[_0x3486('0x15')](_0x24b2bc)[_0x3486('0x17')](_0x565d9f);}};}function respondWithFilteredResult(_0x5ed9ac,_0x4f892c){return function(_0x224caa){if(_0x224caa){var _0xfa51e8=typeof _0x4f892c[_0x3486('0x18')]===_0x3486('0x19')&&typeof _0x4f892c[_0x3486('0x1a')]===_0x3486('0x19');var _0x27ba1f=_0x224caa[_0x3486('0x1b')];var _0x59fc0b=_0xfa51e8?0x0:_0x4f892c[_0x3486('0x18')];var _0x5ee65d=_0xfa51e8?_0x224caa[_0x3486('0x1b')]:_0x4f892c[_0x3486('0x18')]+_0x4f892c[_0x3486('0x1a')];var _0x189800;if(_0x5ee65d>=_0x27ba1f){_0x5ee65d=_0x27ba1f;_0x189800=0xc8;}else{_0x189800=0xce;}_0x5ed9ac[_0x3486('0x15')](_0x189800);return _0x5ed9ac['set']('Content-Range',_0x59fc0b+'-'+_0x5ee65d+'/'+_0x27ba1f)[_0x3486('0x17')](_0x224caa);}return null;};}function patchUpdates(_0x46c910){return function(_0x5ae94b){try{jsonpatch[_0x3486('0x1c')](_0x5ae94b,_0x46c910,!![]);}catch(_0x32f4be){return BPromise[_0x3486('0x1d')](_0x32f4be);}return _0x5ae94b[_0x3486('0x1e')]();};}function saveUpdates(_0x4afe2a,_0x3d8514){return function(_0x4aaf15){if(_0x4aaf15){return _0x4aaf15[_0x3486('0x1f')](_0x4afe2a)['then'](function(_0x41a394){return _0x41a394;});}return null;};}function removeEntity(_0x5c8c77,_0x3f9618){return function(_0xc80c9e){if(_0xc80c9e){return _0xc80c9e[_0x3486('0x20')]()[_0x3486('0x21')](function(){_0x5c8c77[_0x3486('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3250e2,_0x1c8e2c){return function(_0x273f82){if(!_0x273f82){_0x3250e2[_0x3486('0x14')](0x194);}return _0x273f82;};}function handleError(_0x2db2de,_0x108b2e){_0x108b2e=_0x108b2e||0x1f4;return function(_0xe44da9){logger[_0x3486('0x22')](_0xe44da9[_0x3486('0x23')]);if(_0xe44da9['name']){delete _0xe44da9['name'];}_0x2db2de[_0x3486('0x15')](_0x108b2e)[_0x3486('0x24')](_0xe44da9);};}exports[_0x3486('0x25')]=function(_0x4286c7,_0x41cc6d){var _0x1a2217={},_0x6f3417={},_0x390990={'count':0x0,'rows':[]};var _0x3e0dc6=_[_0x3486('0x26')](db[_0x3486('0x27')][_0x3486('0x28')],function(_0x3aaa3e){return{'name':_0x3aaa3e[_0x3486('0x29')],'type':_0x3aaa3e[_0x3486('0x2a')][_0x3486('0x2b')]};});_0x6f3417[_0x3486('0x2c')]=_['map'](_0x3e0dc6,_0x3486('0x2d'));_0x6f3417[_0x3486('0x2e')]=_['keys'](_0x4286c7[_0x3486('0x2e')]);_0x6f3417[_0x3486('0x2f')]=_['intersection'](_0x6f3417[_0x3486('0x2c')],_0x6f3417[_0x3486('0x2e')]);_0x1a2217[_0x3486('0x30')]=_[_0x3486('0x31')](_0x6f3417[_0x3486('0x2c')],qs[_0x3486('0x32')](_0x4286c7[_0x3486('0x2e')][_0x3486('0x32')]));_0x1a2217[_0x3486('0x30')]=_0x1a2217['attributes'][_0x3486('0x33')]?_0x1a2217[_0x3486('0x30')]:_0x6f3417[_0x3486('0x2c')];if(!_0x4286c7['query']['hasOwnProperty'](_0x3486('0x34'))){_0x1a2217[_0x3486('0x1a')]=qs[_0x3486('0x1a')](_0x4286c7[_0x3486('0x2e')]['limit']);_0x1a2217[_0x3486('0x18')]=qs[_0x3486('0x18')](_0x4286c7[_0x3486('0x2e')][_0x3486('0x18')]);}_0x1a2217[_0x3486('0x35')]=qs[_0x3486('0x36')](_0x4286c7[_0x3486('0x2e')][_0x3486('0x36')]);_0x1a2217[_0x3486('0x37')]=qs[_0x3486('0x2f')](_[_0x3486('0x38')](_0x4286c7['query'],_0x6f3417[_0x3486('0x2f')]),_0x3e0dc6);if(_0x4286c7[_0x3486('0x2e')][_0x3486('0x39')]){_0x1a2217[_0x3486('0x37')]=_[_0x3486('0x3a')](_0x1a2217[_0x3486('0x37')],{'$or':_['map'](_0x3e0dc6,function(_0x2643aa){if(_0x2643aa[_0x3486('0x2a')]!==_0x3486('0x3b')){var _0x1db61a={};_0x1db61a[_0x2643aa[_0x3486('0x2d')]]={'$like':'%'+_0x4286c7[_0x3486('0x2e')][_0x3486('0x39')]+'%'};return _0x1db61a;}})});}_0x1a2217=_[_0x3486('0x3a')]({},_0x1a2217,_0x4286c7['options']);var _0x107a11={'where':_0x1a2217[_0x3486('0x37')]};return db['VtigerAccount'][_0x3486('0x1b')](_0x107a11)[_0x3486('0x21')](function(_0x5be9aa){_0x390990[_0x3486('0x1b')]=_0x5be9aa;if(_0x4286c7[_0x3486('0x2e')][_0x3486('0x3c')]){_0x1a2217[_0x3486('0x3d')]=[{'all':!![]}];}return db[_0x3486('0x27')]['findAll'](_0x1a2217);})['then'](function(_0x37dafd){_0x390990[_0x3486('0x3e')]=_0x37dafd;return _0x390990;})['then'](respondWithFilteredResult(_0x41cc6d,_0x1a2217))[_0x3486('0x3f')](handleError(_0x41cc6d,null));};exports[_0x3486('0x40')]=function(_0x1c62e2,_0x479f6a){var _0x1ff7cd={'raw':![],'where':{'id':_0x1c62e2[_0x3486('0x41')]['id']}},_0x396a0d={};_0x396a0d[_0x3486('0x2c')]=_[_0x3486('0x42')](db[_0x3486('0x27')]['rawAttributes']);_0x396a0d[_0x3486('0x2e')]=_[_0x3486('0x42')](_0x1c62e2[_0x3486('0x2e')]);_0x396a0d[_0x3486('0x2f')]=_[_0x3486('0x31')](_0x396a0d[_0x3486('0x2c')],_0x396a0d[_0x3486('0x2e')]);_0x1ff7cd[_0x3486('0x30')]=_[_0x3486('0x31')](_0x396a0d[_0x3486('0x2c')],qs[_0x3486('0x32')](_0x1c62e2[_0x3486('0x2e')][_0x3486('0x32')]));_0x1ff7cd[_0x3486('0x30')]=_0x1ff7cd[_0x3486('0x30')][_0x3486('0x33')]?_0x1ff7cd['attributes']:_0x396a0d['model'];if(_0x1c62e2[_0x3486('0x2e')][_0x3486('0x3c')]){_0x1ff7cd[_0x3486('0x3d')]=[{'all':!![]}];}_0x1ff7cd=_[_0x3486('0x3a')]({},_0x1ff7cd,_0x1c62e2['options']);return db['VtigerAccount'][_0x3486('0x43')](_0x1ff7cd)[_0x3486('0x21')](handleEntityNotFound(_0x479f6a,null))[_0x3486('0x21')](respondWithResult(_0x479f6a,null))['catch'](handleError(_0x479f6a,null));};exports[_0x3486('0x44')]=function(_0x401140,_0x47b3c9){return db[_0x3486('0x27')]['create'](_0x401140[_0x3486('0x45')],{})[_0x3486('0x21')](respondWithResult(_0x47b3c9,0xc9))[_0x3486('0x3f')](handleError(_0x47b3c9,null));};exports[_0x3486('0x1f')]=function(_0x300800,_0x237d1f){if(_0x300800[_0x3486('0x45')]['id']){delete _0x300800[_0x3486('0x45')]['id'];}return db[_0x3486('0x27')]['find']({'where':{'id':_0x300800[_0x3486('0x41')]['id']}})[_0x3486('0x21')](handleEntityNotFound(_0x237d1f,null))[_0x3486('0x21')](saveUpdates(_0x300800[_0x3486('0x45')],null))['then'](respondWithResult(_0x237d1f,null))['catch'](handleError(_0x237d1f,null));};exports[_0x3486('0x20')]=function(_0xc17afb,_0x1dd0fd){return db[_0x3486('0x27')]['find']({'where':{'id':_0xc17afb[_0x3486('0x41')]['id']}})[_0x3486('0x21')](handleEntityNotFound(_0x1dd0fd,null))[_0x3486('0x21')](removeEntity(_0x1dd0fd,null))[_0x3486('0x3f')](handleError(_0x1dd0fd,null));};exports['getConfigurations']=function(_0x4395b7,_0x42795d,_0x192c3d){var _0x528c17={};var _0xa4d57e={};var _0x4e89d2;var _0x33ef6e;return db[_0x3486('0x27')][_0x3486('0x46')]({'where':{'id':_0x4395b7[_0x3486('0x41')]['id']}})[_0x3486('0x21')](handleEntityNotFound(_0x42795d,null))[_0x3486('0x21')](function(_0xf7afde){if(_0xf7afde){_0x4e89d2=_0xf7afde;_0xa4d57e[_0x3486('0x2c')]=_[_0x3486('0x42')](db[_0x3486('0x47')][_0x3486('0x28')]);_0xa4d57e[_0x3486('0x2e')]=_[_0x3486('0x42')](_0x4395b7[_0x3486('0x2e')]);_0xa4d57e[_0x3486('0x2f')]=_[_0x3486('0x31')](_0xa4d57e[_0x3486('0x2c')],_0xa4d57e['query']);_0x528c17[_0x3486('0x30')]=_[_0x3486('0x31')](_0xa4d57e['model'],qs[_0x3486('0x32')](_0x4395b7['query'][_0x3486('0x32')]));_0x528c17['attributes']=_0x528c17[_0x3486('0x30')]['length']?_0x528c17[_0x3486('0x30')]:_0xa4d57e[_0x3486('0x2c')];_0x528c17[_0x3486('0x35')]=qs[_0x3486('0x36')](_0x4395b7[_0x3486('0x2e')][_0x3486('0x36')]);_0x528c17[_0x3486('0x37')]=qs['filters'](_['pick'](_0x4395b7[_0x3486('0x2e')],_0xa4d57e['filters']));if(_0x4395b7['query'][_0x3486('0x39')]){_0x528c17['where']=_[_0x3486('0x3a')](_0x528c17[_0x3486('0x37')],{'$or':_['map'](_0x528c17[_0x3486('0x30')],function(_0x15ab57){var _0x237c90={};_0x237c90[_0x15ab57]={'$like':'%'+_0x4395b7[_0x3486('0x2e')][_0x3486('0x39')]+'%'};return _0x237c90;})});}_0x528c17=_['merge']({},_0x528c17,_0x4395b7[_0x3486('0x48')]);return _0x4e89d2[_0x3486('0x49')](_0x528c17);}})['then'](function(_0x4c8ea2){if(_0x4c8ea2){_0x33ef6e=_0x4c8ea2['length'];if(!_0x4395b7['query'][_0x3486('0x4a')](_0x3486('0x34'))){_0x528c17['limit']=qs[_0x3486('0x1a')](_0x4395b7[_0x3486('0x2e')]['limit']);_0x528c17[_0x3486('0x18')]=qs[_0x3486('0x18')](_0x4395b7[_0x3486('0x2e')][_0x3486('0x18')]);}return _0x4e89d2['getConfigurations'](_0x528c17);}})[_0x3486('0x21')](function(_0x351665){if(_0x351665){return _0x351665?{'count':_0x33ef6e,'rows':_0x351665}:null;}})[_0x3486('0x21')](respondWithResult(_0x42795d,null))[_0x3486('0x3f')](handleError(_0x42795d,null));};exports[_0x3486('0x4b')]=function(_0x120d4b,_0x2bc6c9,_0x194c7d){if(_0x120d4b['body']['id']){delete _0x120d4b['body']['id'];}return db[_0x3486('0x27')][_0x3486('0x46')]({'where':{'id':_0x120d4b['params']['id']}})[_0x3486('0x21')](handleEntityNotFound(_0x2bc6c9,null))['then'](function(_0x2aa5d9){if(_0x2aa5d9){_0x120d4b[_0x3486('0x45')][_0x3486('0x4c')]=_0x2aa5d9['id'];_0x120d4b[_0x3486('0x45')][_0x3486('0x4d')]=integrations['getSubjects'](_0x120d4b[_0x3486('0x45')][_0x3486('0x4e')],_0x120d4b[_0x3486('0x45')][_0x3486('0x2a')]);_0x120d4b['body'][_0x3486('0x4f')]=integrations[_0x3486('0x50')](_0x120d4b[_0x3486('0x45')]['channel'],_0x120d4b[_0x3486('0x45')][_0x3486('0x2a')]);return db['VtigerConfiguration'][_0x3486('0x44')](_0x120d4b[_0x3486('0x45')],{'include':[{'model':db[_0x3486('0x51')],'as':_0x3486('0x4d')},{'model':db[_0x3486('0x51')],'as':_0x3486('0x4f')}]});}return null;})[_0x3486('0x21')](respondWithResult(_0x2bc6c9,null))['catch'](handleError(_0x2bc6c9,null));};var md5=require('md5');exports[_0x3486('0x52')]=function(_0x280e5d,_0x5ce9ea,_0x3d6f89){var _0x2d50a5=null;var _0xf1d41c=null;var _0x45108f=null;var _0x279ed1=null;var _0x1b1057='';return db[_0x3486('0x27')]['findOne']({'where':{'id':_0x280e5d[_0x3486('0x41')]['id']},'attributes':['id',_0x3486('0x2d'),_0x3486('0x53'),_0x3486('0x54'),_0x3486('0x55'),_0x3486('0x56'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x5ce9ea,null))[_0x3486('0x21')](function(_0x108643){if(_0x108643){_0x2d50a5=_0x108643[_0x3486('0x53')];_0xf1d41c=_0x108643[_0x3486('0x57')];_0x45108f=_0x108643[_0x3486('0x55')];_0x1b1057=_0x108643[_0x3486('0x56')];var _0x1fa354=_0x1b1057[_0x3486('0x58')](-0x1);if(_0x1fa354==='/'){_0x1b1057=_0x1b1057[_0x3486('0x59')](0x0,_0x1b1057[_0x3486('0x5a')](_0x1fa354));}_0x279ed1=util[_0x3486('0x5b')](_0x3486('0x5c'),_0x1b1057);var _0x2ac270={'method':_0x3486('0x5d'),'uri':_0x279ed1,'qs':{'operation':_0x3486('0x5e'),'username':_0x108643[_0x3486('0x53')]},'json':!![]};return rp(_0x2ac270);}})[_0x3486('0x21')](function(_0x41794c){if(_0x41794c[_0x3486('0x5f')]){var _0x129815={'method':_0x3486('0x60'),'uri':_0x279ed1,'form':{'operation':_0x3486('0x61'),'username':_0x2d50a5,'accessKey':md5(_0x41794c[_0x3486('0x62')]['token']+_0xf1d41c)},'json':!![]};return rp(_0x129815);}})[_0x3486('0x21')](function(_0x5be23a){if(_0x5be23a[_0x3486('0x5f')]){var _0x47318e={'method':'GET','uri':_0x279ed1,'qs':{'operation':'describe','username':_0x2d50a5,'sessionName':_0x5be23a[_0x3486('0x62')][_0x3486('0x63')],'elementType':_0x45108f},'json':!![]};return rp(_0x47318e);}})[_0x3486('0x21')](function(_0x55001c){if(_0x55001c[_0x3486('0x5f')]){var _0x256735=['autogenerated',_0x3486('0x64'),_0x3486('0x65')];_[_0x3486('0x66')](_0x55001c[_0x3486('0x62')]['fields'],function(_0x2e004a){return _0x256735[_0x3486('0x67')](_0x2e004a[_0x3486('0x2a')][_0x3486('0x2d')]);});_[_0x3486('0x66')](_0x55001c[_0x3486('0x62')][_0x3486('0x32')],function(_0x150c4a){return _0x150c4a[_0x3486('0x68')]===_0x3486('0x69');});return{'count':_0x55001c[_0x3486('0x62')][_0x3486('0x32')][_0x3486('0x33')],'rows':_[_0x3486('0x26')](_0x55001c['result']['fields'],function(_0x1a020a){return{'id':_0x1a020a[_0x3486('0x2d')],'name':_0x1a020a[_0x3486('0x6a')],'custom':_[_0x3486('0x6b')](_0x1a020a[_0x3486('0x2d')],_0x3486('0x6c'))?!![]:![],'options':_0x1a020a[_0x3486('0x2a')][_0x3486('0x2d')]==='picklist'&&_0x1a020a[_0x3486('0x2a')][_0x3486('0x6d')][_0x3486('0x33')]>0x0?_[_0x3486('0x26')](_0x1a020a[_0x3486('0x2a')]['picklistValues'],function(_0x2be8a3){return{'name':_0x2be8a3[_0x3486('0x6a')],'value':_0x2be8a3[_0x3486('0x6e')]};}):[]};})};}})['then'](respondWithResult(_0x5ce9ea,null))[_0x3486('0x3f')](function(_0x2fc8f5){console[_0x3486('0x6f')](_0x3486('0x70')+_0x2fc8f5);var _0x11a607=_0x280e5d['query'][_0x3486('0x71')]?0x1f4:_0x2fc8f5[_0x3486('0x72')]||0x1f4;logger[_0x3486('0x22')](_0x3486('0x73'),_0x3486('0x52'),_0x11a607,JSON[_0x3486('0x74')](_0x2fc8f5));delete _0x2fc8f5[_0x3486('0x2d')];if(_0x11a607===0x191){_0x11a607=0x190;}_0x5ce9ea['status'](_0x11a607)[_0x3486('0x24')](_0x280e5d['query'][_0x3486('0x71')]?{'message':_0x3486('0x75'),'statusCode':_0x2fc8f5['statusCode']}:_0x2fc8f5);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 5c3bdd0..cf7c196 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 _0x7043=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts'];(function(_0x31a07b,_0x20c18e){var _0x30d8ab=function(_0x2b212e){while(--_0x2b212e){_0x31a07b['push'](_0x31a07b['shift']());}};_0x30d8ab(++_0x20c18e);}(_0x7043,0x196));var _0x3704=function(_0x5030cb,_0x235afd){_0x5030cb=_0x5030cb-0x0;var _0x2bdf74=_0x7043[_0x5030cb];return _0x2bdf74;};'use strict';var _=require(_0x3704('0x0'));var util=require('util');var logger=require(_0x3704('0x1'))(_0x3704('0x2'));var moment=require(_0x3704('0x3'));var BPromise=require(_0x3704('0x4'));var rp=require(_0x3704('0x5'));var fs=require('fs');var path=require(_0x3704('0x6'));var rimraf=require(_0x3704('0x7'));var config=require(_0x3704('0x8'));var attributes=require(_0x3704('0x9'));var integrations=require(_0x3704('0xa'));module['exports']=function(_0x4b40ba,_0x505364){return _0x4b40ba[_0x3704('0xb')](_0x3704('0xc'),attributes,{'tableName':_0x3704('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x266a=['api','moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x266a,0x93));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var logger=require(_0xa266('0x2'))(_0xa266('0x3'));var moment=require(_0xa266('0x4'));var BPromise=require(_0xa266('0x5'));var rp=require(_0xa266('0x6'));var fs=require('fs');var path=require(_0xa266('0x7'));var rimraf=require(_0xa266('0x8'));var config=require('../../config/environment');var attributes=require(_0xa266('0x9'));var integrations=require(_0xa266('0xa'));module[_0xa266('0xb')]=function(_0x5d8945,_0x3486a1){return _0x5d8945[_0xa266('0xc')](_0xa266('0xd'),attributes,{'tableName':_0xa266('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 9afb51c..34ded8e 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 _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xdc0397,_0x20d1f1){var _0x553d02=function(_0x364781){while(--_0x364781){_0xdc0397['push'](_0xdc0397['shift']());}};_0x553d02(++_0x20d1f1);}(_0xda3f,0xec));var _0xfda3=function(_0x1d22ad,_0x157255){_0x1d22ad=_0x1d22ad-0x0;var _0x1cf6f8=_0xda3f[_0x1d22ad];return _0x1cf6f8;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});}; \ No newline at end of file +var _0x96cc=['model','map','debug','ShowVtigerAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x447f6d,_0x36fc29){var _0x56a9b8=function(_0x16444e){while(--_0x16444e){_0x447f6d['push'](_0x447f6d['shift']());}};_0x56a9b8(++_0x36fc29);}(_0x96cc,0x16c));var _0xc96c=function(_0x44650b,_0x5af069){_0x44650b=_0x44650b-0x0;var _0x13b205=_0x96cc[_0x44650b];return _0x13b205;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});}exports[_0xc96c('0x17')]=function(_0x99c402){var _0x16b6ce=this;return new Promise(function(_0x2ae19a,_0x4aa6a3){return db[_0xc96c('0x18')][_0xc96c('0x19')]({'raw':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1c')]||null:null,'attributes':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'limit':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1e')]||null:null,'include':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')]?_['map'](_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')],function(_0x4456bf){return{'model':db[_0x4456bf[_0xc96c('0x20')]],'as':_0x4456bf['as'],'attributes':_0x4456bf[_0xc96c('0x1d')],'include':_0x4456bf[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4456bf[_0xc96c('0x1f')],function(_0x1a77df){return{'model':db[_0x1a77df[_0xc96c('0x20')]],'as':_0x1a77df['as'],'attributes':_0x1a77df['attributes'],'include':_0x1a77df[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x1a77df[_0xc96c('0x1f')],function(_0x294fee){return{'model':db[_0x294fee['model']],'as':_0x294fee['as'],'attributes':_0x294fee['attributes']};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x12c293){logger[_0xc96c('0xd')](_0xc96c('0x17'),_0x99c402);logger[_0xc96c('0x22')](_0xc96c('0x17'),_0x99c402,JSON[_0xc96c('0x11')](_0x12c293));_0x2ae19a(_0x12c293);})[_0xc96c('0x16')](function(_0xa0efbc){logger[_0xc96c('0x12')](_0xc96c('0x17'),_0xa0efbc[_0xc96c('0x14')],_0x99c402);_0x4aa6a3(_0x16b6ce[_0xc96c('0x12')](0x1f4,_0xa0efbc[_0xc96c('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x3aa436){var _0x53c994=this;return new Promise(function(_0x3f4b0e,_0x442c7f){return db[_0xc96c('0x18')]['find']({'raw':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436['options']['where']||null:null,'attributes':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'include':_0x3aa436['options']?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x3aa436[_0xc96c('0x1a')]['include'],function(_0x4132a9){return{'model':db[_0x4132a9[_0xc96c('0x20')]],'as':_0x4132a9['as'],'attributes':_0x4132a9['attributes'],'include':_0x4132a9[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4132a9[_0xc96c('0x1f')],function(_0x2d2595){return{'model':db[_0x2d2595[_0xc96c('0x20')]],'as':_0x2d2595['as'],'attributes':_0x2d2595[_0xc96c('0x1d')],'include':_0x2d2595['include']?_[_0xc96c('0x21')](_0x2d2595[_0xc96c('0x1f')],function(_0x15b68b){return{'model':db[_0x15b68b[_0xc96c('0x20')]],'as':_0x15b68b['as'],'attributes':_0x15b68b[_0xc96c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x52d4a2){logger['info'](_0xc96c('0x23'),_0x3aa436);logger[_0xc96c('0x22')]('ShowVtigerAccount',_0x3aa436,JSON['stringify'](_0x52d4a2));_0x3f4b0e(_0x52d4a2);})[_0xc96c('0x16')](function(_0x1df393){logger[_0xc96c('0x12')](_0xc96c('0x23'),_0x1df393[_0xc96c('0x14')],_0x3aa436);_0x442c7f(_0x53c994[_0xc96c('0x12')](0x1f4,_0x1df393[_0xc96c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 3c6e073..0c95496 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 _0x6ca9=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6ca9,0x1f4));var _0x96ca=function(_0x3e7cce,_0x571814){_0x3e7cce=_0x3e7cce-0x0;var _0x477ef2=_0x6ca9[_0x3e7cce];return _0x477ef2;};'use strict';var multer=require(_0x96ca('0x0'));var util=require(_0x96ca('0x1'));var path=require(_0x96ca('0x2'));var timeout=require(_0x96ca('0x3'));var express=require('express');var router=express[_0x96ca('0x4')]();var fs_extra=require(_0x96ca('0x5'));var auth=require(_0x96ca('0x6'));var interaction=require(_0x96ca('0x7'));var config=require(_0x96ca('0x8'));var controller=require(_0x96ca('0x9'));router[_0x96ca('0xa')]('/',auth[_0x96ca('0xb')](),controller[_0x96ca('0xc')]);router['get']('/:id',auth[_0x96ca('0xb')](),controller['show']);router[_0x96ca('0xa')]('/:id/fields',auth[_0x96ca('0xb')](),controller[_0x96ca('0xd')]);router[_0x96ca('0xa')](_0x96ca('0xe'),auth[_0x96ca('0xb')](),controller[_0x96ca('0xf')]);router['get'](_0x96ca('0x10'),auth[_0x96ca('0xb')](),controller[_0x96ca('0x11')]);router[_0x96ca('0x12')]('/',auth[_0x96ca('0xb')](),controller[_0x96ca('0x13')]);router[_0x96ca('0x14')](_0x96ca('0x15'),auth[_0x96ca('0xb')](),controller[_0x96ca('0x16')]);router[_0x96ca('0x17')](_0x96ca('0x15'),auth[_0x96ca('0xb')](),controller[_0x96ca('0x18')]);module[_0x96ca('0x19')]=router; \ No newline at end of file +var _0x8b7e=['getDescriptions','delete','destroy','exports','multer','path','express','Router','fs-extra','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x8b7e,0x1a8));var _0xe8b7=function(_0x3ca75e,_0x3c827e){_0x3ca75e=_0x3ca75e-0x0;var _0x3ca1d1=_0x8b7e[_0x3ca75e];return _0x3ca1d1;};'use strict';var multer=require(_0xe8b7('0x0'));var util=require('util');var path=require(_0xe8b7('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b7('0x2'));var router=express[_0xe8b7('0x3')]();var fs_extra=require(_0xe8b7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe8b7('0x5'));router[_0xe8b7('0x6')]('/',auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x8')]);router[_0xe8b7('0x6')](_0xe8b7('0x9'),auth['isAuthenticated'](),controller[_0xe8b7('0xa')]);router[_0xe8b7('0x6')](_0xe8b7('0xb'),auth['isAuthenticated'](),controller[_0xe8b7('0xc')]);router[_0xe8b7('0x6')](_0xe8b7('0xd'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xe')]);router[_0xe8b7('0x6')](_0xe8b7('0xf'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x10')]);router['post']('/',auth[_0xe8b7('0x7')](),controller['create']);router['put']('/:id',auth[_0xe8b7('0x7')](),controller['update']);router[_0xe8b7('0x11')](_0xe8b7('0x9'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x12')]);module[_0xe8b7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index da35ece..4738854 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 _0x3b5e=['exports','STRING'];(function(_0x370008,_0x2d345f){var _0x5e2682=function(_0x323a6b){while(--_0x323a6b){_0x370008['push'](_0x370008['shift']());}};_0x5e2682(++_0x2d345f);}(_0x3b5e,0x82));var _0xe3b5=function(_0x504c88,_0x1c3016){_0x504c88=_0x504c88-0x0;var _0xb5611e=_0x3b5e[_0x504c88];return _0xb5611e;};'use strict';var Sequelize=require('sequelize');module[_0xe3b5('0x0')]={'name':{'type':Sequelize[_0xe3b5('0x1')]},'description':{'type':Sequelize[_0xe3b5('0x1')]}}; \ No newline at end of file +var _0xbc4b=['STRING','exports'];(function(_0x227f06,_0x23e3c1){var _0x453522=function(_0x342033){while(--_0x342033){_0x227f06['push'](_0x227f06['shift']());}};_0x453522(++_0x23e3c1);}(_0xbc4b,0xcd));var _0xbbc4=function(_0x442e11,_0x47488f){_0x442e11=_0x442e11-0x0;var _0x50495d=_0xbc4b[_0x442e11];return _0x50495d;};'use strict';var Sequelize=require('sequelize');module[_0xbbc4('0x0')]={'name':{'type':Sequelize[_0xbbc4('0x1')]},'description':{'type':Sequelize[_0xbbc4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a8aff86..a520a51 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 _0xa79e=['params','intersection','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','VtigerConfiguration','count','includeAll','include','findAll','catch','show'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0xa79e,0xf7));var _0xea79=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xa79e[_0x4dab14];return _0xf41aa;};'use strict';var emlformat=require(_0xea79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea79('0x1'));var jsonpatch=require(_0xea79('0x2'));var rp=require(_0xea79('0x3'));var moment=require(_0xea79('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea79('0x5'));var path=require(_0xea79('0x6'));var sox=require('sox');var csv=require(_0xea79('0x7'));var ejs=require(_0xea79('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea79('0x9'));var squel=require(_0xea79('0xa'));var crypto=require(_0xea79('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea79('0xc'));var Papa=require(_0xea79('0xd'));var Redis=require('ioredis');var authService=require(_0xea79('0xe'));var qs=require(_0xea79('0xf'));var as=require(_0xea79('0x10'));var hardwareService=require(_0xea79('0x11'));var logger=require('../../config/logger')(_0xea79('0x12'));var utils=require(_0xea79('0x13'));var config=require(_0xea79('0x14'));var licenseUtil=require(_0xea79('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x266e43,_0x51ea6c){_0x51ea6c=_0x51ea6c||0xcc;return function(_0x16b7b1){if(_0x16b7b1){return _0x266e43[_0xea79('0x16')](_0x51ea6c);}return _0x266e43[_0xea79('0x17')](_0x51ea6c)['end']();};}function respondWithResult(_0x3189c7,_0x1c7d02){_0x1c7d02=_0x1c7d02||0xc8;return function(_0x564d51){if(_0x564d51){return _0x3189c7[_0xea79('0x17')](_0x1c7d02)[_0xea79('0x18')](_0x564d51);}};}function respondWithFilteredResult(_0x412d87,_0x105c52){return function(_0x5805fb){if(_0x5805fb){var _0x440ec1=typeof _0x105c52[_0xea79('0x19')]===_0xea79('0x1a')&&typeof _0x105c52[_0xea79('0x1b')]===_0xea79('0x1a');var _0x3d03d7=_0x5805fb['count'];var _0x1938c7=_0x440ec1?0x0:_0x105c52[_0xea79('0x19')];var _0xb5cfd2=_0x440ec1?_0x5805fb['count']:_0x105c52['offset']+_0x105c52[_0xea79('0x1b')];var _0xef8bba;if(_0xb5cfd2>=_0x3d03d7){_0xb5cfd2=_0x3d03d7;_0xef8bba=0xc8;}else{_0xef8bba=0xce;}_0x412d87[_0xea79('0x17')](_0xef8bba);return _0x412d87[_0xea79('0x1c')](_0xea79('0x1d'),_0x1938c7+'-'+_0xb5cfd2+'/'+_0x3d03d7)[_0xea79('0x18')](_0x5805fb);}return null;};}function patchUpdates(_0x2fa5bb){return function(_0x4f3cf3){try{jsonpatch[_0xea79('0x1e')](_0x4f3cf3,_0x2fa5bb,!![]);}catch(_0x5b0f04){return BPromise[_0xea79('0x1f')](_0x5b0f04);}return _0x4f3cf3['save']();};}function saveUpdates(_0x5ee3db,_0x2dac7f){return function(_0x49dd61){if(_0x49dd61){return _0x49dd61[_0xea79('0x20')](_0x5ee3db)[_0xea79('0x21')](function(_0x476b29){return _0x476b29;});}return null;};}function removeEntity(_0x3b3e4e,_0x58da97){return function(_0x45adee){if(_0x45adee){return _0x45adee[_0xea79('0x22')]()[_0xea79('0x21')](function(){_0x3b3e4e[_0xea79('0x17')](0xcc)[_0xea79('0x23')]();});}};}function handleEntityNotFound(_0x21399a,_0x589b5b){return function(_0x48b85f){if(!_0x48b85f){_0x21399a[_0xea79('0x16')](0x194);}return _0x48b85f;};}function handleError(_0x4bfbd5,_0x18ce51){_0x18ce51=_0x18ce51||0x1f4;return function(_0x217b8e){logger[_0xea79('0x24')](_0x217b8e['stack']);if(_0x217b8e[_0xea79('0x25')]){delete _0x217b8e[_0xea79('0x25')];}_0x4bfbd5[_0xea79('0x17')](_0x18ce51)[_0xea79('0x26')](_0x217b8e);};}exports[_0xea79('0x27')]=function(_0x523b6c,_0x3d8fca){var _0x720cb9={},_0x63a058={},_0x5100b2={'count':0x0,'rows':[]};var _0x57cc30=_[_0xea79('0x28')](db['VtigerConfiguration'][_0xea79('0x29')],function(_0x50e44e){return{'name':_0x50e44e[_0xea79('0x2a')],'type':_0x50e44e[_0xea79('0x2b')][_0xea79('0x2c')]};});_0x63a058['model']=_[_0xea79('0x28')](_0x57cc30,_0xea79('0x25'));_0x63a058[_0xea79('0x2d')]=_[_0xea79('0x2e')](_0x523b6c[_0xea79('0x2d')]);_0x63a058['filters']=_['intersection'](_0x63a058[_0xea79('0x2f')],_0x63a058[_0xea79('0x2d')]);_0x720cb9[_0xea79('0x30')]=_['intersection'](_0x63a058['model'],qs['fields'](_0x523b6c[_0xea79('0x2d')][_0xea79('0x31')]));_0x720cb9[_0xea79('0x30')]=_0x720cb9[_0xea79('0x30')][_0xea79('0x32')]?_0x720cb9[_0xea79('0x30')]:_0x63a058[_0xea79('0x2f')];if(!_0x523b6c[_0xea79('0x2d')][_0xea79('0x33')](_0xea79('0x34'))){_0x720cb9['limit']=qs[_0xea79('0x1b')](_0x523b6c['query']['limit']);_0x720cb9[_0xea79('0x19')]=qs[_0xea79('0x19')](_0x523b6c[_0xea79('0x2d')][_0xea79('0x19')]);}_0x720cb9[_0xea79('0x35')]=qs[_0xea79('0x36')](_0x523b6c[_0xea79('0x2d')][_0xea79('0x36')]);_0x720cb9[_0xea79('0x37')]=qs[_0xea79('0x38')](_[_0xea79('0x39')](_0x523b6c[_0xea79('0x2d')],_0x63a058[_0xea79('0x38')]),_0x57cc30);if(_0x523b6c[_0xea79('0x2d')][_0xea79('0x3a')]){_0x720cb9[_0xea79('0x37')]=_['merge'](_0x720cb9[_0xea79('0x37')],{'$or':_[_0xea79('0x28')](_0x57cc30,function(_0x42caa0){if(_0x42caa0[_0xea79('0x2b')]!==_0xea79('0x3b')){var _0x59e3bb={};_0x59e3bb[_0x42caa0[_0xea79('0x25')]]={'$like':'%'+_0x523b6c[_0xea79('0x2d')][_0xea79('0x3a')]+'%'};return _0x59e3bb;}})});}_0x720cb9=_[_0xea79('0x3c')]({},_0x720cb9,_0x523b6c[_0xea79('0x3d')]);var _0x392d91={'where':_0x720cb9[_0xea79('0x37')]};return db[_0xea79('0x3e')]['count'](_0x392d91)['then'](function(_0x1b4d31){_0x5100b2[_0xea79('0x3f')]=_0x1b4d31;if(_0x523b6c['query'][_0xea79('0x40')]){_0x720cb9[_0xea79('0x41')]=[{'all':!![]}];}return db[_0xea79('0x3e')][_0xea79('0x42')](_0x720cb9);})[_0xea79('0x21')](function(_0x11c4c3){_0x5100b2['rows']=_0x11c4c3;return _0x5100b2;})[_0xea79('0x21')](respondWithFilteredResult(_0x3d8fca,_0x720cb9))[_0xea79('0x43')](handleError(_0x3d8fca,null));};exports[_0xea79('0x44')]=function(_0x3964d8,_0x575d5d){var _0x234058={'raw':![],'where':{'id':_0x3964d8[_0xea79('0x45')]['id']}},_0xb82bec={};_0xb82bec[_0xea79('0x2f')]=_['keys'](db[_0xea79('0x3e')][_0xea79('0x29')]);_0xb82bec[_0xea79('0x2d')]=_['keys'](_0x3964d8['query']);_0xb82bec['filters']=_[_0xea79('0x46')](_0xb82bec[_0xea79('0x2f')],_0xb82bec[_0xea79('0x2d')]);_0x234058[_0xea79('0x30')]=_['intersection'](_0xb82bec[_0xea79('0x2f')],qs[_0xea79('0x31')](_0x3964d8[_0xea79('0x2d')][_0xea79('0x31')]));_0x234058[_0xea79('0x30')]=_0x234058['attributes'][_0xea79('0x32')]?_0x234058[_0xea79('0x30')]:_0xb82bec[_0xea79('0x2f')];if(_0x3964d8['query'][_0xea79('0x40')]){_0x234058[_0xea79('0x41')]=[{'all':!![]}];}_0x234058=_[_0xea79('0x3c')]({},_0x234058,_0x3964d8[_0xea79('0x3d')]);return db[_0xea79('0x3e')][_0xea79('0x47')](_0x234058)[_0xea79('0x21')](handleEntityNotFound(_0x575d5d,null))['then'](respondWithResult(_0x575d5d,null))[_0xea79('0x43')](handleError(_0x575d5d,null));};exports[_0xea79('0x48')]=function(_0x515a86,_0x4b8b9a){return db[_0xea79('0x3e')][_0xea79('0x48')](_0x515a86[_0xea79('0x49')],{})[_0xea79('0x21')](respondWithResult(_0x4b8b9a,0xc9))[_0xea79('0x43')](handleError(_0x4b8b9a,null));};exports[_0xea79('0x20')]=function(_0xf869ef,_0x5c55b6){if(_0xf869ef['body']['id']){delete _0xf869ef[_0xea79('0x49')]['id'];}return db[_0xea79('0x3e')][_0xea79('0x47')]({'where':{'id':_0xf869ef[_0xea79('0x45')]['id']}})[_0xea79('0x21')](handleEntityNotFound(_0x5c55b6,null))[_0xea79('0x21')](saveUpdates(_0xf869ef['body'],null))[_0xea79('0x21')](respondWithResult(_0x5c55b6,null))[_0xea79('0x43')](handleError(_0x5c55b6,null));};exports[_0xea79('0x22')]=function(_0x26b0fa,_0x2ff258){return db[_0xea79('0x3e')][_0xea79('0x47')]({'where':{'id':_0x26b0fa['params']['id']}})[_0xea79('0x21')](handleEntityNotFound(_0x2ff258,null))[_0xea79('0x21')](removeEntity(_0x2ff258,null))[_0xea79('0x43')](handleError(_0x2ff258,null));};exports[_0xea79('0x4a')]=function(_0x457fbd,_0x54e647,_0x2366e8){var _0x4ef919={};var _0xe395f2={};var _0x42465b;var _0x24bd4a;return db[_0xea79('0x3e')][_0xea79('0x4b')]({'where':{'id':_0x457fbd[_0xea79('0x45')]['id']}})[_0xea79('0x21')](handleEntityNotFound(_0x54e647,null))[_0xea79('0x21')](function(_0x54c719){if(_0x54c719){_0x42465b=_0x54c719;_0xe395f2['model']=_[_0xea79('0x2e')](db[_0xea79('0x4c')][_0xea79('0x29')]);_0xe395f2[_0xea79('0x2d')]=_[_0xea79('0x2e')](_0x457fbd[_0xea79('0x2d')]);_0xe395f2[_0xea79('0x38')]=_[_0xea79('0x46')](_0xe395f2[_0xea79('0x2f')],_0xe395f2[_0xea79('0x2d')]);_0x4ef919[_0xea79('0x30')]=_[_0xea79('0x46')](_0xe395f2[_0xea79('0x2f')],qs[_0xea79('0x31')](_0x457fbd['query']['fields']));_0x4ef919[_0xea79('0x30')]=_0x4ef919[_0xea79('0x30')][_0xea79('0x32')]?_0x4ef919[_0xea79('0x30')]:_0xe395f2[_0xea79('0x2f')];_0x4ef919[_0xea79('0x35')]=qs['sort'](_0x457fbd[_0xea79('0x2d')][_0xea79('0x36')]);_0x4ef919[_0xea79('0x37')]=qs[_0xea79('0x38')](_['pick'](_0x457fbd[_0xea79('0x2d')],_0xe395f2[_0xea79('0x38')]));if(_0x457fbd[_0xea79('0x2d')][_0xea79('0x3a')]){_0x4ef919[_0xea79('0x37')]=_[_0xea79('0x3c')](_0x4ef919[_0xea79('0x37')],{'$or':_[_0xea79('0x28')](_0x4ef919[_0xea79('0x30')],function(_0xfa5c24){var _0x1b9999={};_0x1b9999[_0xfa5c24]={'$like':'%'+_0x457fbd[_0xea79('0x2d')][_0xea79('0x3a')]+'%'};return _0x1b9999;})});}_0x4ef919=_[_0xea79('0x3c')]({},_0x4ef919,_0x457fbd[_0xea79('0x3d')]);return _0x42465b['getFields'](_0x4ef919);}})[_0xea79('0x21')](function(_0x3462b5){if(_0x3462b5){_0x24bd4a=_0x3462b5[_0xea79('0x32')];if(!_0x457fbd[_0xea79('0x2d')][_0xea79('0x33')](_0xea79('0x34'))){_0x4ef919['limit']=qs[_0xea79('0x1b')](_0x457fbd['query'][_0xea79('0x1b')]);_0x4ef919['offset']=qs[_0xea79('0x19')](_0x457fbd[_0xea79('0x2d')]['offset']);}return _0x42465b['getFields'](_0x4ef919);}})[_0xea79('0x21')](function(_0xc9d20d){if(_0xc9d20d){return _0xc9d20d?{'count':_0x24bd4a,'rows':_0xc9d20d}:null;}})['then'](respondWithResult(_0x54e647,null))[_0xea79('0x43')](handleError(_0x54e647,null));};exports[_0xea79('0x4d')]=function(_0x3a1fae,_0xddd38e,_0x4a1221){var _0x31b1b6={};var _0x5bd53b={};var _0x18f9f7;var _0x24a698;return db[_0xea79('0x3e')][_0xea79('0x4b')]({'where':{'id':_0x3a1fae['params']['id']}})[_0xea79('0x21')](handleEntityNotFound(_0xddd38e,null))['then'](function(_0x2b815f){if(_0x2b815f){_0x18f9f7=_0x2b815f;_0x5bd53b[_0xea79('0x2f')]=_[_0xea79('0x2e')](db['VtigerField'][_0xea79('0x29')]);_0x5bd53b[_0xea79('0x2d')]=_[_0xea79('0x2e')](_0x3a1fae[_0xea79('0x2d')]);_0x5bd53b['filters']=_[_0xea79('0x46')](_0x5bd53b[_0xea79('0x2f')],_0x5bd53b[_0xea79('0x2d')]);_0x31b1b6[_0xea79('0x30')]=_[_0xea79('0x46')](_0x5bd53b['model'],qs[_0xea79('0x31')](_0x3a1fae[_0xea79('0x2d')]['fields']));_0x31b1b6[_0xea79('0x30')]=_0x31b1b6['attributes'][_0xea79('0x32')]?_0x31b1b6[_0xea79('0x30')]:_0x5bd53b[_0xea79('0x2f')];_0x31b1b6[_0xea79('0x35')]=qs['sort'](_0x3a1fae[_0xea79('0x2d')][_0xea79('0x36')]);_0x31b1b6[_0xea79('0x37')]=qs[_0xea79('0x38')](_[_0xea79('0x39')](_0x3a1fae[_0xea79('0x2d')],_0x5bd53b[_0xea79('0x38')]));if(_0x3a1fae[_0xea79('0x2d')][_0xea79('0x3a')]){_0x31b1b6['where']=_[_0xea79('0x3c')](_0x31b1b6[_0xea79('0x37')],{'$or':_['map'](_0x31b1b6['attributes'],function(_0x223e71){var _0x5c1483={};_0x5c1483[_0x223e71]={'$like':'%'+_0x3a1fae[_0xea79('0x2d')][_0xea79('0x3a')]+'%'};return _0x5c1483;})});}_0x31b1b6=_[_0xea79('0x3c')]({},_0x31b1b6,_0x3a1fae['options']);return _0x18f9f7[_0xea79('0x4d')](_0x31b1b6);}})[_0xea79('0x21')](function(_0x41e007){if(_0x41e007){_0x24a698=_0x41e007[_0xea79('0x32')];if(!_0x3a1fae[_0xea79('0x2d')][_0xea79('0x33')](_0xea79('0x34'))){_0x31b1b6[_0xea79('0x1b')]=qs[_0xea79('0x1b')](_0x3a1fae[_0xea79('0x2d')][_0xea79('0x1b')]);_0x31b1b6[_0xea79('0x19')]=qs['offset'](_0x3a1fae[_0xea79('0x2d')]['offset']);}return _0x18f9f7[_0xea79('0x4d')](_0x31b1b6);}})[_0xea79('0x21')](function(_0xe9b5c2){if(_0xe9b5c2){return _0xe9b5c2?{'count':_0x24a698,'rows':_0xe9b5c2}:null;}})[_0xea79('0x21')](respondWithResult(_0xddd38e,null))[_0xea79('0x43')](handleError(_0xddd38e,null));};exports[_0xea79('0x4e')]=function(_0x1a9ee8,_0x1ee600,_0x99b127){var _0x405dd6={};var _0x1ed1f6={};var _0x5ba200;var _0x2fa8df;return db[_0xea79('0x3e')][_0xea79('0x4b')]({'where':{'id':_0x1a9ee8[_0xea79('0x45')]['id']}})[_0xea79('0x21')](handleEntityNotFound(_0x1ee600,null))['then'](function(_0x63eab){if(_0x63eab){_0x5ba200=_0x63eab;_0x1ed1f6[_0xea79('0x2f')]=_['keys'](db[_0xea79('0x4c')][_0xea79('0x29')]);_0x1ed1f6[_0xea79('0x2d')]=_[_0xea79('0x2e')](_0x1a9ee8['query']);_0x1ed1f6['filters']=_['intersection'](_0x1ed1f6[_0xea79('0x2f')],_0x1ed1f6['query']);_0x405dd6[_0xea79('0x30')]=_[_0xea79('0x46')](_0x1ed1f6[_0xea79('0x2f')],qs[_0xea79('0x31')](_0x1a9ee8['query'][_0xea79('0x31')]));_0x405dd6[_0xea79('0x30')]=_0x405dd6[_0xea79('0x30')][_0xea79('0x32')]?_0x405dd6[_0xea79('0x30')]:_0x1ed1f6['model'];_0x405dd6[_0xea79('0x35')]=qs['sort'](_0x1a9ee8[_0xea79('0x2d')][_0xea79('0x36')]);_0x405dd6[_0xea79('0x37')]=qs['filters'](_[_0xea79('0x39')](_0x1a9ee8[_0xea79('0x2d')],_0x1ed1f6[_0xea79('0x38')]));if(_0x1a9ee8[_0xea79('0x2d')]['filter']){_0x405dd6['where']=_[_0xea79('0x3c')](_0x405dd6['where'],{'$or':_['map'](_0x405dd6[_0xea79('0x30')],function(_0xc669e7){var _0x259691={};_0x259691[_0xc669e7]={'$like':'%'+_0x1a9ee8['query'][_0xea79('0x3a')]+'%'};return _0x259691;})});}_0x405dd6=_[_0xea79('0x3c')]({},_0x405dd6,_0x1a9ee8[_0xea79('0x3d')]);return _0x5ba200[_0xea79('0x4e')](_0x405dd6);}})[_0xea79('0x21')](function(_0x121532){if(_0x121532){_0x2fa8df=_0x121532[_0xea79('0x32')];if(!_0x1a9ee8[_0xea79('0x2d')][_0xea79('0x33')](_0xea79('0x34'))){_0x405dd6[_0xea79('0x1b')]=qs['limit'](_0x1a9ee8[_0xea79('0x2d')][_0xea79('0x1b')]);_0x405dd6[_0xea79('0x19')]=qs[_0xea79('0x19')](_0x1a9ee8[_0xea79('0x2d')][_0xea79('0x19')]);}return _0x5ba200[_0xea79('0x4e')](_0x405dd6);}})[_0xea79('0x21')](function(_0x57277d){if(_0x57277d){return _0x57277d?{'count':_0x2fa8df,'rows':_0x57277d}:null;}})[_0xea79('0x21')](respondWithResult(_0x1ee600,null))[_0xea79('0x43')](handleError(_0x1ee600,null));}; \ No newline at end of file +var _0xf72f=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','rows','show','params','keys','intersection','catch','create','body','find','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x449132,_0x5b039e){var _0x2de44e=function(_0x2204f7){while(--_0x2204f7){_0x449132['push'](_0x449132['shift']());}};_0x2de44e(++_0x5b039e);}(_0xf72f,0x171));var _0xff72=function(_0x32fecb,_0x44a585){_0x32fecb=_0x32fecb-0x0;var _0x1efbf0=_0xf72f[_0x32fecb];return _0x1efbf0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff72('0x0'));var zipdir=require(_0xff72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff72('0x2'));var moment=require(_0xff72('0x3'));var BPromise=require(_0xff72('0x4'));var Mustache=require(_0xff72('0x5'));var util=require(_0xff72('0x6'));var path=require(_0xff72('0x7'));var sox=require(_0xff72('0x8'));var csv=require(_0xff72('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff72('0xa'));var squel=require('squel');var crypto=require(_0xff72('0xb'));var jsforce=require(_0xff72('0xc'));var deskjs=require(_0xff72('0xd'));var toCsv=require(_0xff72('0x9'));var querystring=require(_0xff72('0xe'));var Papa=require(_0xff72('0xf'));var Redis=require(_0xff72('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff72('0x11'));var as=require(_0xff72('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xff72('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xff72('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c720a,_0x3a2744){_0x3a2744=_0x3a2744||0xcc;return function(_0x38736f){if(_0x38736f){return _0x4c720a[_0xff72('0x15')](_0x3a2744);}return _0x4c720a[_0xff72('0x16')](_0x3a2744)['end']();};}function respondWithResult(_0x22dabc,_0x50cd3f){_0x50cd3f=_0x50cd3f||0xc8;return function(_0x499456){if(_0x499456){return _0x22dabc[_0xff72('0x16')](_0x50cd3f)[_0xff72('0x17')](_0x499456);}};}function respondWithFilteredResult(_0x43ec9b,_0x30d10c){return function(_0xf7b15e){if(_0xf7b15e){var _0x2f7385=typeof _0x30d10c['offset']===_0xff72('0x18')&&typeof _0x30d10c[_0xff72('0x19')]===_0xff72('0x18');var _0x25b007=_0xf7b15e['count'];var _0x40685f=_0x2f7385?0x0:_0x30d10c[_0xff72('0x1a')];var _0x2e5240=_0x2f7385?_0xf7b15e[_0xff72('0x1b')]:_0x30d10c['offset']+_0x30d10c['limit'];var _0x2f953b;if(_0x2e5240>=_0x25b007){_0x2e5240=_0x25b007;_0x2f953b=0xc8;}else{_0x2f953b=0xce;}_0x43ec9b[_0xff72('0x16')](_0x2f953b);return _0x43ec9b['set'](_0xff72('0x1c'),_0x40685f+'-'+_0x2e5240+'/'+_0x25b007)[_0xff72('0x17')](_0xf7b15e);}return null;};}function patchUpdates(_0x12ed64){return function(_0x5dad57){try{jsonpatch[_0xff72('0x1d')](_0x5dad57,_0x12ed64,!![]);}catch(_0x54b4b5){return BPromise['reject'](_0x54b4b5);}return _0x5dad57[_0xff72('0x1e')]();};}function saveUpdates(_0x218336,_0x52bc46){return function(_0x47e647){if(_0x47e647){return _0x47e647[_0xff72('0x1f')](_0x218336)[_0xff72('0x20')](function(_0x20ffd6){return _0x20ffd6;});}return null;};}function removeEntity(_0x654882,_0x23c2ba){return function(_0x147af0){if(_0x147af0){return _0x147af0[_0xff72('0x21')]()['then'](function(){_0x654882['status'](0xcc)[_0xff72('0x22')]();});}};}function handleEntityNotFound(_0xf4d76d,_0x49bf3f){return function(_0x230f21){if(!_0x230f21){_0xf4d76d['sendStatus'](0x194);}return _0x230f21;};}function handleError(_0x94aeb3,_0x12a7bc){_0x12a7bc=_0x12a7bc||0x1f4;return function(_0xb9e565){logger[_0xff72('0x23')](_0xb9e565[_0xff72('0x24')]);if(_0xb9e565[_0xff72('0x25')]){delete _0xb9e565[_0xff72('0x25')];}_0x94aeb3[_0xff72('0x16')](_0x12a7bc)[_0xff72('0x26')](_0xb9e565);};}exports[_0xff72('0x27')]=function(_0x5e4cc4,_0x3a3b59){var _0x2c8631={},_0x2f3f98={},_0x525c48={'count':0x0,'rows':[]};var _0x74f21f=_[_0xff72('0x28')](db['VtigerConfiguration'][_0xff72('0x29')],function(_0x3bcfbb){return{'name':_0x3bcfbb[_0xff72('0x2a')],'type':_0x3bcfbb[_0xff72('0x2b')]['key']};});_0x2f3f98[_0xff72('0x2c')]=_[_0xff72('0x28')](_0x74f21f,_0xff72('0x25'));_0x2f3f98[_0xff72('0x2d')]=_['keys'](_0x5e4cc4[_0xff72('0x2d')]);_0x2f3f98[_0xff72('0x2e')]=_['intersection'](_0x2f3f98[_0xff72('0x2c')],_0x2f3f98[_0xff72('0x2d')]);_0x2c8631['attributes']=_['intersection'](_0x2f3f98[_0xff72('0x2c')],qs[_0xff72('0x2f')](_0x5e4cc4[_0xff72('0x2d')][_0xff72('0x2f')]));_0x2c8631[_0xff72('0x30')]=_0x2c8631[_0xff72('0x30')][_0xff72('0x31')]?_0x2c8631[_0xff72('0x30')]:_0x2f3f98[_0xff72('0x2c')];if(!_0x5e4cc4[_0xff72('0x2d')][_0xff72('0x32')](_0xff72('0x33'))){_0x2c8631[_0xff72('0x19')]=qs[_0xff72('0x19')](_0x5e4cc4[_0xff72('0x2d')]['limit']);_0x2c8631[_0xff72('0x1a')]=qs[_0xff72('0x1a')](_0x5e4cc4[_0xff72('0x2d')]['offset']);}_0x2c8631[_0xff72('0x34')]=qs[_0xff72('0x35')](_0x5e4cc4['query'][_0xff72('0x35')]);_0x2c8631[_0xff72('0x36')]=qs[_0xff72('0x2e')](_[_0xff72('0x37')](_0x5e4cc4['query'],_0x2f3f98['filters']),_0x74f21f);if(_0x5e4cc4[_0xff72('0x2d')][_0xff72('0x38')]){_0x2c8631[_0xff72('0x36')]=_[_0xff72('0x39')](_0x2c8631[_0xff72('0x36')],{'$or':_['map'](_0x74f21f,function(_0x1b04b7){if(_0x1b04b7['type']!==_0xff72('0x3a')){var _0x2609ec={};_0x2609ec[_0x1b04b7[_0xff72('0x25')]]={'$like':'%'+_0x5e4cc4[_0xff72('0x2d')]['filter']+'%'};return _0x2609ec;}})});}_0x2c8631=_[_0xff72('0x39')]({},_0x2c8631,_0x5e4cc4[_0xff72('0x3b')]);var _0xdce011={'where':_0x2c8631['where']};return db[_0xff72('0x3c')][_0xff72('0x1b')](_0xdce011)[_0xff72('0x20')](function(_0x36b755){_0x525c48[_0xff72('0x1b')]=_0x36b755;if(_0x5e4cc4[_0xff72('0x2d')][_0xff72('0x3d')]){_0x2c8631[_0xff72('0x3e')]=[{'all':!![]}];}return db[_0xff72('0x3c')][_0xff72('0x3f')](_0x2c8631);})[_0xff72('0x20')](function(_0x4c534e){_0x525c48[_0xff72('0x40')]=_0x4c534e;return _0x525c48;})[_0xff72('0x20')](respondWithFilteredResult(_0x3a3b59,_0x2c8631))['catch'](handleError(_0x3a3b59,null));};exports[_0xff72('0x41')]=function(_0x39355d,_0x3e46be){var _0x59e3d5={'raw':![],'where':{'id':_0x39355d[_0xff72('0x42')]['id']}},_0x124365={};_0x124365[_0xff72('0x2c')]=_[_0xff72('0x43')](db['VtigerConfiguration'][_0xff72('0x29')]);_0x124365['query']=_[_0xff72('0x43')](_0x39355d['query']);_0x124365[_0xff72('0x2e')]=_[_0xff72('0x44')](_0x124365[_0xff72('0x2c')],_0x124365[_0xff72('0x2d')]);_0x59e3d5[_0xff72('0x30')]=_[_0xff72('0x44')](_0x124365['model'],qs[_0xff72('0x2f')](_0x39355d[_0xff72('0x2d')][_0xff72('0x2f')]));_0x59e3d5['attributes']=_0x59e3d5[_0xff72('0x30')]['length']?_0x59e3d5[_0xff72('0x30')]:_0x124365['model'];if(_0x39355d['query']['includeAll']){_0x59e3d5[_0xff72('0x3e')]=[{'all':!![]}];}_0x59e3d5=_[_0xff72('0x39')]({},_0x59e3d5,_0x39355d[_0xff72('0x3b')]);return db['VtigerConfiguration']['find'](_0x59e3d5)[_0xff72('0x20')](handleEntityNotFound(_0x3e46be,null))[_0xff72('0x20')](respondWithResult(_0x3e46be,null))[_0xff72('0x45')](handleError(_0x3e46be,null));};exports[_0xff72('0x46')]=function(_0x5a39e1,_0x399683){return db['VtigerConfiguration'][_0xff72('0x46')](_0x5a39e1[_0xff72('0x47')],{})['then'](respondWithResult(_0x399683,0xc9))[_0xff72('0x45')](handleError(_0x399683,null));};exports[_0xff72('0x1f')]=function(_0x45100c,_0x5bbd86){if(_0x45100c['body']['id']){delete _0x45100c['body']['id'];}return db[_0xff72('0x3c')]['find']({'where':{'id':_0x45100c[_0xff72('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bbd86,null))['then'](saveUpdates(_0x45100c[_0xff72('0x47')],null))[_0xff72('0x20')](respondWithResult(_0x5bbd86,null))['catch'](handleError(_0x5bbd86,null));};exports[_0xff72('0x21')]=function(_0x58fd1b,_0x18ae7c){return db['VtigerConfiguration'][_0xff72('0x48')]({'where':{'id':_0x58fd1b[_0xff72('0x42')]['id']}})[_0xff72('0x20')](handleEntityNotFound(_0x18ae7c,null))[_0xff72('0x20')](removeEntity(_0x18ae7c,null))[_0xff72('0x45')](handleError(_0x18ae7c,null));};exports['getFields']=function(_0x4e6a5e,_0x5bbbff,_0x3de1cb){var _0x4c1a91={};var _0x29ed6b={};var _0x1108fe;var _0x16b48e;return db[_0xff72('0x3c')][_0xff72('0x49')]({'where':{'id':_0x4e6a5e[_0xff72('0x42')]['id']}})[_0xff72('0x20')](handleEntityNotFound(_0x5bbbff,null))[_0xff72('0x20')](function(_0x28bab5){if(_0x28bab5){_0x1108fe=_0x28bab5;_0x29ed6b[_0xff72('0x2c')]=_[_0xff72('0x43')](db[_0xff72('0x4a')]['rawAttributes']);_0x29ed6b['query']=_[_0xff72('0x43')](_0x4e6a5e[_0xff72('0x2d')]);_0x29ed6b[_0xff72('0x2e')]=_[_0xff72('0x44')](_0x29ed6b[_0xff72('0x2c')],_0x29ed6b[_0xff72('0x2d')]);_0x4c1a91['attributes']=_[_0xff72('0x44')](_0x29ed6b[_0xff72('0x2c')],qs[_0xff72('0x2f')](_0x4e6a5e[_0xff72('0x2d')][_0xff72('0x2f')]));_0x4c1a91[_0xff72('0x30')]=_0x4c1a91[_0xff72('0x30')][_0xff72('0x31')]?_0x4c1a91[_0xff72('0x30')]:_0x29ed6b[_0xff72('0x2c')];_0x4c1a91['order']=qs[_0xff72('0x35')](_0x4e6a5e['query'][_0xff72('0x35')]);_0x4c1a91[_0xff72('0x36')]=qs[_0xff72('0x2e')](_['pick'](_0x4e6a5e['query'],_0x29ed6b[_0xff72('0x2e')]));if(_0x4e6a5e[_0xff72('0x2d')][_0xff72('0x38')]){_0x4c1a91[_0xff72('0x36')]=_['merge'](_0x4c1a91[_0xff72('0x36')],{'$or':_['map'](_0x4c1a91['attributes'],function(_0x1bd6cb){var _0xfb4f59={};_0xfb4f59[_0x1bd6cb]={'$like':'%'+_0x4e6a5e[_0xff72('0x2d')][_0xff72('0x38')]+'%'};return _0xfb4f59;})});}_0x4c1a91=_[_0xff72('0x39')]({},_0x4c1a91,_0x4e6a5e['options']);return _0x1108fe['getFields'](_0x4c1a91);}})[_0xff72('0x20')](function(_0x37b715){if(_0x37b715){_0x16b48e=_0x37b715[_0xff72('0x31')];if(!_0x4e6a5e[_0xff72('0x2d')][_0xff72('0x32')]('nolimit')){_0x4c1a91['limit']=qs[_0xff72('0x19')](_0x4e6a5e[_0xff72('0x2d')][_0xff72('0x19')]);_0x4c1a91[_0xff72('0x1a')]=qs[_0xff72('0x1a')](_0x4e6a5e['query'][_0xff72('0x1a')]);}return _0x1108fe['getFields'](_0x4c1a91);}})[_0xff72('0x20')](function(_0x146eac){if(_0x146eac){return _0x146eac?{'count':_0x16b48e,'rows':_0x146eac}:null;}})[_0xff72('0x20')](respondWithResult(_0x5bbbff,null))[_0xff72('0x45')](handleError(_0x5bbbff,null));};exports[_0xff72('0x4b')]=function(_0x20e126,_0x1bf499,_0x3fa3bf){var _0x18edd2={};var _0x4cf990={};var _0x53cddc;var _0x170430;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x20e126[_0xff72('0x42')]['id']}})[_0xff72('0x20')](handleEntityNotFound(_0x1bf499,null))[_0xff72('0x20')](function(_0x2a5144){if(_0x2a5144){_0x53cddc=_0x2a5144;_0x4cf990[_0xff72('0x2c')]=_[_0xff72('0x43')](db[_0xff72('0x4a')][_0xff72('0x29')]);_0x4cf990['query']=_['keys'](_0x20e126['query']);_0x4cf990['filters']=_[_0xff72('0x44')](_0x4cf990['model'],_0x4cf990['query']);_0x18edd2[_0xff72('0x30')]=_[_0xff72('0x44')](_0x4cf990['model'],qs[_0xff72('0x2f')](_0x20e126['query'][_0xff72('0x2f')]));_0x18edd2[_0xff72('0x30')]=_0x18edd2[_0xff72('0x30')][_0xff72('0x31')]?_0x18edd2[_0xff72('0x30')]:_0x4cf990['model'];_0x18edd2[_0xff72('0x34')]=qs[_0xff72('0x35')](_0x20e126[_0xff72('0x2d')]['sort']);_0x18edd2[_0xff72('0x36')]=qs[_0xff72('0x2e')](_['pick'](_0x20e126[_0xff72('0x2d')],_0x4cf990[_0xff72('0x2e')]));if(_0x20e126['query'][_0xff72('0x38')]){_0x18edd2[_0xff72('0x36')]=_[_0xff72('0x39')](_0x18edd2[_0xff72('0x36')],{'$or':_[_0xff72('0x28')](_0x18edd2[_0xff72('0x30')],function(_0x14a7e3){var _0x2adb86={};_0x2adb86[_0x14a7e3]={'$like':'%'+_0x20e126[_0xff72('0x2d')]['filter']+'%'};return _0x2adb86;})});}_0x18edd2=_['merge']({},_0x18edd2,_0x20e126[_0xff72('0x3b')]);return _0x53cddc['getSubjects'](_0x18edd2);}})['then'](function(_0x20c6c1){if(_0x20c6c1){_0x170430=_0x20c6c1[_0xff72('0x31')];if(!_0x20e126[_0xff72('0x2d')][_0xff72('0x32')](_0xff72('0x33'))){_0x18edd2[_0xff72('0x19')]=qs['limit'](_0x20e126[_0xff72('0x2d')][_0xff72('0x19')]);_0x18edd2[_0xff72('0x1a')]=qs['offset'](_0x20e126[_0xff72('0x2d')]['offset']);}return _0x53cddc[_0xff72('0x4b')](_0x18edd2);}})['then'](function(_0x13491b){if(_0x13491b){return _0x13491b?{'count':_0x170430,'rows':_0x13491b}:null;}})[_0xff72('0x20')](respondWithResult(_0x1bf499,null))[_0xff72('0x45')](handleError(_0x1bf499,null));};exports[_0xff72('0x4c')]=function(_0x5f0fe3,_0x52e3a0,_0x46f826){var _0x166fa1={};var _0x57532a={};var _0x1a188a;var _0x164fca;return db[_0xff72('0x3c')][_0xff72('0x49')]({'where':{'id':_0x5f0fe3[_0xff72('0x42')]['id']}})[_0xff72('0x20')](handleEntityNotFound(_0x52e3a0,null))[_0xff72('0x20')](function(_0x16f716){if(_0x16f716){_0x1a188a=_0x16f716;_0x57532a['model']=_[_0xff72('0x43')](db['VtigerField']['rawAttributes']);_0x57532a['query']=_['keys'](_0x5f0fe3['query']);_0x57532a[_0xff72('0x2e')]=_[_0xff72('0x44')](_0x57532a[_0xff72('0x2c')],_0x57532a[_0xff72('0x2d')]);_0x166fa1[_0xff72('0x30')]=_['intersection'](_0x57532a['model'],qs[_0xff72('0x2f')](_0x5f0fe3[_0xff72('0x2d')][_0xff72('0x2f')]));_0x166fa1[_0xff72('0x30')]=_0x166fa1[_0xff72('0x30')]['length']?_0x166fa1[_0xff72('0x30')]:_0x57532a[_0xff72('0x2c')];_0x166fa1[_0xff72('0x34')]=qs[_0xff72('0x35')](_0x5f0fe3[_0xff72('0x2d')][_0xff72('0x35')]);_0x166fa1[_0xff72('0x36')]=qs[_0xff72('0x2e')](_[_0xff72('0x37')](_0x5f0fe3[_0xff72('0x2d')],_0x57532a['filters']));if(_0x5f0fe3[_0xff72('0x2d')]['filter']){_0x166fa1[_0xff72('0x36')]=_[_0xff72('0x39')](_0x166fa1[_0xff72('0x36')],{'$or':_['map'](_0x166fa1[_0xff72('0x30')],function(_0x146a7d){var _0x1a6ae9={};_0x1a6ae9[_0x146a7d]={'$like':'%'+_0x5f0fe3['query']['filter']+'%'};return _0x1a6ae9;})});}_0x166fa1=_[_0xff72('0x39')]({},_0x166fa1,_0x5f0fe3['options']);return _0x1a188a[_0xff72('0x4c')](_0x166fa1);}})[_0xff72('0x20')](function(_0x59873a){if(_0x59873a){_0x164fca=_0x59873a[_0xff72('0x31')];if(!_0x5f0fe3[_0xff72('0x2d')][_0xff72('0x32')](_0xff72('0x33'))){_0x166fa1[_0xff72('0x19')]=qs[_0xff72('0x19')](_0x5f0fe3[_0xff72('0x2d')]['limit']);_0x166fa1['offset']=qs['offset'](_0x5f0fe3[_0xff72('0x2d')][_0xff72('0x1a')]);}return _0x1a188a[_0xff72('0x4c')](_0x166fa1);}})[_0xff72('0x20')](function(_0x191cfa){if(_0x191cfa){return _0x191cfa?{'count':_0x164fca,'rows':_0x191cfa}:null;}})['then'](respondWithResult(_0x52e3a0,null))[_0xff72('0x45')](handleError(_0x52e3a0,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b4cb2ea..5f3f349 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 _0x4295=['util','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','define','lodash'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x4295,0x121));var _0x5429=function(_0x15ec35,_0x5b9972){_0x15ec35=_0x15ec35-0x0;var _0x937cce=_0x4295[_0x15ec35];return _0x937cce;};'use strict';var _=require(_0x5429('0x0'));var util=require(_0x5429('0x1'));var logger=require('../../config/logger')(_0x5429('0x2'));var moment=require(_0x5429('0x3'));var BPromise=require(_0x5429('0x4'));var rp=require(_0x5429('0x5'));var fs=require('fs');var path=require(_0x5429('0x6'));var rimraf=require('rimraf');var config=require(_0x5429('0x7'));var attributes=require(_0x5429('0x8'));module['exports']=function(_0x25ead7,_0x531571){return _0x25ead7[_0x5429('0x9')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca67=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x7236,_0x592af3){var _0x2a352e=function(_0x104cd3){while(--_0x104cd3){_0x7236['push'](_0x7236['shift']());}};_0x2a352e(++_0x592af3);}(_0xca67,0x8e));var _0x7ca6=function(_0xfca746,_0x2425d9){_0xfca746=_0xfca746-0x0;var _0x1faa60=_0xca67[_0xfca746];return _0x1faa60;};'use strict';var _=require(_0x7ca6('0x0'));var util=require(_0x7ca6('0x1'));var logger=require(_0x7ca6('0x2'))(_0x7ca6('0x3'));var moment=require(_0x7ca6('0x4'));var BPromise=require(_0x7ca6('0x5'));var rp=require(_0x7ca6('0x6'));var fs=require('fs');var path=require(_0x7ca6('0x7'));var rimraf=require('rimraf');var config=require(_0x7ca6('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x7ca6('0x9')]=function(_0x389500,_0xb46715){return _0x389500['define'](_0x7ca6('0xa'),attributes,{'tableName':_0x7ca6('0xb'),'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 e685c35..3707bc0 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 _0xbd56=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','rpc','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xbd56,0x16f));var _0x6bd5=function(_0x259769,_0x557163){_0x259769=_0x259769-0x0;var _0x4cc198=_0xbd56[_0x259769];return _0x4cc198;};'use strict';var _=require(_0x6bd5('0x0'));var util=require(_0x6bd5('0x1'));var moment=require('moment');var BPromise=require(_0x6bd5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bd5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6bd5('0x4'));var config=require('../../config/environment');var jayson=require(_0x6bd5('0x5'));var client=jayson['client'][_0x6bd5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x6ae667,_0x52eea4,_0x4164aa){return new BPromise(function(_0x5c6b8a,_0x1e3986){return client[_0x6bd5('0x7')](_0x6ae667,_0x4164aa)[_0x6bd5('0x8')](function(_0x39d64b){logger[_0x6bd5('0x9')](_0x6bd5('0xa'),_0x52eea4,_0x6bd5('0xb'));logger[_0x6bd5('0xc')](_0x6bd5('0xd'),_0x52eea4,_0x6bd5('0xb'),JSON[_0x6bd5('0xe')](_0x39d64b));if(_0x39d64b['error']){if(_0x39d64b['error'][_0x6bd5('0xf')]===0x1f4){logger['error'](_0x6bd5('0xa'),_0x52eea4,_0x39d64b[_0x6bd5('0x10')][_0x6bd5('0x11')]);return _0x1e3986(_0x39d64b[_0x6bd5('0x10')][_0x6bd5('0x11')]);}logger[_0x6bd5('0x10')](_0x6bd5('0xa'),_0x52eea4,_0x39d64b[_0x6bd5('0x10')][_0x6bd5('0x11')]);return _0x5c6b8a(_0x39d64b['error'][_0x6bd5('0x11')]);}else{logger['info'](_0x6bd5('0xa'),_0x52eea4,_0x6bd5('0xb'));_0x5c6b8a(_0x39d64b[_0x6bd5('0x12')][_0x6bd5('0x11')]);}})[_0x6bd5('0x13')](function(_0x1a01c6){logger[_0x6bd5('0x10')](_0x6bd5('0xa'),_0x52eea4,_0x1a01c6);_0x1e3986(_0x1a01c6);});});} \ No newline at end of file +var _0x0c8b=['error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30be97,_0x3ea719){var _0x1d3a90=function(_0x512e8a){while(--_0x512e8a){_0x30be97['push'](_0x30be97['shift']());}};_0x1d3a90(++_0x3ea719);}(_0x0c8b,0x91));var _0xb0c8=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x0c8b[_0x411add];return _0x238242;};'use strict';var _=require('lodash');var util=require(_0xb0c8('0x0'));var moment=require(_0xb0c8('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0c8('0x2'));var fs=require('fs');var Redis=require(_0xb0c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0c8('0x4'));var logger=require(_0xb0c8('0x5'))(_0xb0c8('0x6'));var config=require('../../config/environment');var jayson=require(_0xb0c8('0x7'));var client=jayson[_0xb0c8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15b261,_0x42f769,_0x4b1b28){return new BPromise(function(_0x2df031,_0x51f9c2){return client['request'](_0x15b261,_0x4b1b28)['then'](function(_0x4b2316){logger[_0xb0c8('0x9')](_0xb0c8('0xa'),_0x42f769,_0xb0c8('0xb'));logger[_0xb0c8('0xc')](_0xb0c8('0xd'),_0x42f769,_0xb0c8('0xb'),JSON[_0xb0c8('0xe')](_0x4b2316));if(_0x4b2316['error']){if(_0x4b2316[_0xb0c8('0xf')][_0xb0c8('0x10')]===0x1f4){logger[_0xb0c8('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x42f769,_0x4b2316[_0xb0c8('0xf')][_0xb0c8('0x11')]);return _0x51f9c2(_0x4b2316[_0xb0c8('0xf')][_0xb0c8('0x11')]);}logger[_0xb0c8('0xf')](_0xb0c8('0xa'),_0x42f769,_0x4b2316[_0xb0c8('0xf')]['message']);return _0x2df031(_0x4b2316['error'][_0xb0c8('0x11')]);}else{logger[_0xb0c8('0x9')](_0xb0c8('0xa'),_0x42f769,_0xb0c8('0xb'));_0x2df031(_0x4b2316[_0xb0c8('0x12')][_0xb0c8('0x11')]);}})[_0xb0c8('0x13')](function(_0x1ac1f6){logger[_0xb0c8('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x42f769,_0x1ac1f6);_0x51f9c2(_0x1ac1f6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index fc4a343..4ca7f5e 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 _0x2318=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x4fc71f,_0x48a37e){var _0x540d4b=function(_0xbc86b9){while(--_0xbc86b9){_0x4fc71f['push'](_0x4fc71f['shift']());}};_0x540d4b(++_0x48a37e);}(_0x2318,0x1a3));var _0x8231=function(_0x47dabb,_0x12feca){_0x47dabb=_0x47dabb-0x0;var _0x4c76a7=_0x2318[_0x47dabb];return _0x4c76a7;};'use strict';var multer=require('multer');var util=require(_0x8231('0x0'));var path=require('path');var timeout=require(_0x8231('0x1'));var express=require(_0x8231('0x2'));var router=express[_0x8231('0x3')]();var fs_extra=require(_0x8231('0x4'));var auth=require(_0x8231('0x5'));var interaction=require(_0x8231('0x6'));var config=require(_0x8231('0x7'));var controller=require(_0x8231('0x8'));router[_0x8231('0x9')]('/',auth[_0x8231('0xa')](),controller[_0x8231('0xb')]);router[_0x8231('0x9')](_0x8231('0xc'),auth[_0x8231('0xa')](),controller[_0x8231('0xd')]);router[_0x8231('0xe')]('/',auth[_0x8231('0xa')](),controller[_0x8231('0xf')]);router[_0x8231('0x10')](_0x8231('0xc'),auth[_0x8231('0xa')](),controller[_0x8231('0x11')]);router[_0x8231('0x12')]('/:id',auth[_0x8231('0xa')](),controller[_0x8231('0x13')]);module[_0x8231('0x14')]=router; \ No newline at end of file +var _0x09a9=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x52dce6,_0x69d474){var _0x54f92a=function(_0x10953f){while(--_0x10953f){_0x52dce6['push'](_0x52dce6['shift']());}};_0x54f92a(++_0x69d474);}(_0x09a9,0x133));var _0x909a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x09a9[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0x909a('0x0'));var util=require(_0x909a('0x1'));var path=require('path');var timeout=require(_0x909a('0x2'));var express=require('express');var router=express[_0x909a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x909a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x909a('0x5'));var controller=require(_0x909a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x909a('0x7')]);router[_0x909a('0x8')](_0x909a('0x9'),auth[_0x909a('0xa')](),controller[_0x909a('0xb')]);router[_0x909a('0xc')]('/',auth[_0x909a('0xa')](),controller[_0x909a('0xd')]);router['put']('/:id',auth[_0x909a('0xa')](),controller[_0x909a('0xe')]);router[_0x909a('0xf')](_0x909a('0x9'),auth['isAuthenticated'](),controller[_0x909a('0x10')]);module[_0x909a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 92dbf86..6519879 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 _0xc060=['picklist','STRING','sequelize','ENUM','string','customVariable'];(function(_0x103f79,_0x5df9ad){var _0x45ef97=function(_0x235cbe){while(--_0x235cbe){_0x103f79['push'](_0x103f79['shift']());}};_0x45ef97(++_0x5df9ad);}(_0xc060,0x1ee));var _0x0c06=function(_0x6bb2b8,_0x355c2d){_0x6bb2b8=_0x6bb2b8-0x0;var _0x27d53c=_0xc060[_0x6bb2b8];return _0x27d53c;};'use strict';var Sequelize=require(_0x0c06('0x0'));module['exports']={'type':{'type':Sequelize[_0x0c06('0x1')](_0x0c06('0x2'),'variable',_0x0c06('0x3'),'keyValue',_0x0c06('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0c06('0x1')](_0x0c06('0x2'),'variable',_0x0c06('0x3'))},'keyContent':{'type':Sequelize[_0x0c06('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0c06('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c06('0x5')]}}; \ No newline at end of file +var _0x959f=['keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x959f,0xc4));var _0xf959=function(_0x1c883b,_0x538863){_0x1c883b=_0x1c883b-0x0;var _0x364c9b=_0x959f[_0x1c883b];return _0x364c9b;};'use strict';var Sequelize=require(_0xf959('0x0'));module[_0xf959('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf959('0x2'),_0xf959('0x3'),_0xf959('0x4'),_0xf959('0x5')),'defaultValue':_0xf959('0x6')},'content':{'type':Sequelize[_0xf959('0x7')]},'key':{'type':Sequelize[_0xf959('0x7')]},'keyType':{'type':Sequelize[_0xf959('0x8')](_0xf959('0x6'),_0xf959('0x2'),_0xf959('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf959('0x7')]},'customField':{'type':Sequelize[_0xf959('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf959('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 5043296..9a0565b 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 _0x19c8=['request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','end','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir'];(function(_0x58be64,_0x309b01){var _0x559060=function(_0x256eaa){while(--_0x256eaa){_0x58be64['push'](_0x58be64['shift']());}};_0x559060(++_0x309b01);}(_0x19c8,0xd9));var _0x819c=function(_0x1a356c,_0x2b7297){_0x1a356c=_0x1a356c-0x0;var _0x4fdafa=_0x19c8[_0x1a356c];return _0x4fdafa;};'use strict';var emlformat=require(_0x819c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x819c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x819c('0x2'));var moment=require('moment');var BPromise=require(_0x819c('0x3'));var Mustache=require(_0x819c('0x4'));var util=require(_0x819c('0x5'));var path=require(_0x819c('0x6'));var sox=require('sox');var csv=require(_0x819c('0x7'));var ejs=require(_0x819c('0x8'));var fs=require('fs');var fs_extra=require(_0x819c('0x9'));var _=require(_0x819c('0xa'));var squel=require(_0x819c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x819c('0x7'));var querystring=require('querystring');var Papa=require(_0x819c('0xc'));var Redis=require(_0x819c('0xd'));var authService=require(_0x819c('0xe'));var qs=require(_0x819c('0xf'));var as=require(_0x819c('0x10'));var hardwareService=require(_0x819c('0x11'));var logger=require('../../config/logger')(_0x819c('0x12'));var utils=require(_0x819c('0x13'));var config=require(_0x819c('0x14'));var licenseUtil=require(_0x819c('0x15'));var db=require(_0x819c('0x16'))['db'];function respondWithStatusCode(_0x390083,_0x2fbf4b){_0x2fbf4b=_0x2fbf4b||0xcc;return function(_0x4cda26){if(_0x4cda26){return _0x390083[_0x819c('0x17')](_0x2fbf4b);}return _0x390083[_0x819c('0x18')](_0x2fbf4b)['end']();};}function respondWithResult(_0x2f3628,_0x1170a7){_0x1170a7=_0x1170a7||0xc8;return function(_0x4ca476){if(_0x4ca476){return _0x2f3628[_0x819c('0x18')](_0x1170a7)[_0x819c('0x19')](_0x4ca476);}};}function respondWithFilteredResult(_0x39e8c0,_0x539137){return function(_0x1a3fd1){if(_0x1a3fd1){var _0x52105c=typeof _0x539137[_0x819c('0x1a')]===_0x819c('0x1b')&&typeof _0x539137[_0x819c('0x1c')]===_0x819c('0x1b');var _0x417455=_0x1a3fd1[_0x819c('0x1d')];var _0x14b23c=_0x52105c?0x0:_0x539137[_0x819c('0x1a')];var _0x22b386=_0x52105c?_0x1a3fd1['count']:_0x539137[_0x819c('0x1a')]+_0x539137[_0x819c('0x1c')];var _0x414632;if(_0x22b386>=_0x417455){_0x22b386=_0x417455;_0x414632=0xc8;}else{_0x414632=0xce;}_0x39e8c0['status'](_0x414632);return _0x39e8c0[_0x819c('0x1e')]('Content-Range',_0x14b23c+'-'+_0x22b386+'/'+_0x417455)[_0x819c('0x19')](_0x1a3fd1);}return null;};}function patchUpdates(_0x1c4b2b){return function(_0x4dcab4){try{jsonpatch['apply'](_0x4dcab4,_0x1c4b2b,!![]);}catch(_0x1921c6){return BPromise[_0x819c('0x1f')](_0x1921c6);}return _0x4dcab4[_0x819c('0x20')]();};}function saveUpdates(_0x1488e3,_0x4a209b){return function(_0x256a3e){if(_0x256a3e){return _0x256a3e[_0x819c('0x21')](_0x1488e3)[_0x819c('0x22')](function(_0xa1dfba){return _0xa1dfba;});}return null;};}function removeEntity(_0x4643c2,_0x41b10a){return function(_0x40f6bd){if(_0x40f6bd){return _0x40f6bd['destroy']()[_0x819c('0x22')](function(){_0x4643c2[_0x819c('0x18')](0xcc)[_0x819c('0x23')]();});}};}function handleEntityNotFound(_0x17de5e,_0x14c738){return function(_0x53cf44){if(!_0x53cf44){_0x17de5e[_0x819c('0x17')](0x194);}return _0x53cf44;};}function handleError(_0x32eca5,_0x1906fb){_0x1906fb=_0x1906fb||0x1f4;return function(_0x58e4d3){logger[_0x819c('0x24')](_0x58e4d3[_0x819c('0x25')]);if(_0x58e4d3[_0x819c('0x26')]){delete _0x58e4d3['name'];}_0x32eca5[_0x819c('0x18')](_0x1906fb)[_0x819c('0x27')](_0x58e4d3);};}exports[_0x819c('0x28')]=function(_0x31213a,_0x560562){var _0x1b9b01={},_0x38427f={},_0x4554ae={'count':0x0,'rows':[]};var _0x3d8ddd=_['map'](db[_0x819c('0x29')][_0x819c('0x2a')],function(_0x3994fe){return{'name':_0x3994fe[_0x819c('0x2b')],'type':_0x3994fe[_0x819c('0x2c')][_0x819c('0x2d')]};});_0x38427f['model']=_[_0x819c('0x2e')](_0x3d8ddd,_0x819c('0x26'));_0x38427f[_0x819c('0x2f')]=_[_0x819c('0x30')](_0x31213a[_0x819c('0x2f')]);_0x38427f[_0x819c('0x31')]=_[_0x819c('0x32')](_0x38427f[_0x819c('0x33')],_0x38427f['query']);_0x1b9b01[_0x819c('0x34')]=_[_0x819c('0x32')](_0x38427f[_0x819c('0x33')],qs['fields'](_0x31213a['query'][_0x819c('0x35')]));_0x1b9b01['attributes']=_0x1b9b01[_0x819c('0x34')]['length']?_0x1b9b01[_0x819c('0x34')]:_0x38427f[_0x819c('0x33')];if(!_0x31213a[_0x819c('0x2f')][_0x819c('0x36')]('nolimit')){_0x1b9b01[_0x819c('0x1c')]=qs[_0x819c('0x1c')](_0x31213a[_0x819c('0x2f')][_0x819c('0x1c')]);_0x1b9b01[_0x819c('0x1a')]=qs[_0x819c('0x1a')](_0x31213a['query'][_0x819c('0x1a')]);}_0x1b9b01[_0x819c('0x37')]=qs[_0x819c('0x38')](_0x31213a[_0x819c('0x2f')][_0x819c('0x38')]);_0x1b9b01[_0x819c('0x39')]=qs['filters'](_['pick'](_0x31213a[_0x819c('0x2f')],_0x38427f[_0x819c('0x31')]),_0x3d8ddd);if(_0x31213a[_0x819c('0x2f')][_0x819c('0x3a')]){_0x1b9b01[_0x819c('0x39')]=_[_0x819c('0x3b')](_0x1b9b01['where'],{'$or':_[_0x819c('0x2e')](_0x3d8ddd,function(_0x339cd0){if(_0x339cd0[_0x819c('0x2c')]!==_0x819c('0x3c')){var _0x1db061={};_0x1db061[_0x339cd0[_0x819c('0x26')]]={'$like':'%'+_0x31213a[_0x819c('0x2f')][_0x819c('0x3a')]+'%'};return _0x1db061;}})});}_0x1b9b01=_[_0x819c('0x3b')]({},_0x1b9b01,_0x31213a[_0x819c('0x3d')]);var _0x2162a3={'where':_0x1b9b01[_0x819c('0x39')]};return db[_0x819c('0x29')][_0x819c('0x1d')](_0x2162a3)['then'](function(_0x15125a){_0x4554ae[_0x819c('0x1d')]=_0x15125a;if(_0x31213a[_0x819c('0x2f')][_0x819c('0x3e')]){_0x1b9b01[_0x819c('0x3f')]=[{'all':!![]}];}return db[_0x819c('0x29')][_0x819c('0x40')](_0x1b9b01);})['then'](function(_0x105183){_0x4554ae[_0x819c('0x41')]=_0x105183;return _0x4554ae;})[_0x819c('0x22')](respondWithFilteredResult(_0x560562,_0x1b9b01))[_0x819c('0x42')](handleError(_0x560562,null));};exports[_0x819c('0x43')]=function(_0x4ae1f6,_0x3ae22b){var _0x30f134={'raw':!![],'where':{'id':_0x4ae1f6[_0x819c('0x44')]['id']}},_0x37b26b={};_0x37b26b[_0x819c('0x33')]=_['keys'](db[_0x819c('0x29')][_0x819c('0x2a')]);_0x37b26b[_0x819c('0x2f')]=_[_0x819c('0x30')](_0x4ae1f6[_0x819c('0x2f')]);_0x37b26b[_0x819c('0x31')]=_[_0x819c('0x32')](_0x37b26b[_0x819c('0x33')],_0x37b26b['query']);_0x30f134[_0x819c('0x34')]=_['intersection'](_0x37b26b['model'],qs[_0x819c('0x35')](_0x4ae1f6[_0x819c('0x2f')][_0x819c('0x35')]));_0x30f134['attributes']=_0x30f134['attributes'][_0x819c('0x45')]?_0x30f134[_0x819c('0x34')]:_0x37b26b[_0x819c('0x33')];if(_0x4ae1f6[_0x819c('0x2f')][_0x819c('0x3e')]){_0x30f134['include']=[{'all':!![]}];}_0x30f134=_[_0x819c('0x3b')]({},_0x30f134,_0x4ae1f6['options']);return db[_0x819c('0x29')][_0x819c('0x46')](_0x30f134)[_0x819c('0x22')](handleEntityNotFound(_0x3ae22b,null))['then'](respondWithResult(_0x3ae22b,null))[_0x819c('0x42')](handleError(_0x3ae22b,null));};exports[_0x819c('0x47')]=function(_0x47afb5,_0x765b4d){return db['VtigerField']['create'](_0x47afb5['body'],{})[_0x819c('0x22')](respondWithResult(_0x765b4d,0xc9))[_0x819c('0x42')](handleError(_0x765b4d,null));};exports['update']=function(_0x59c742,_0x4846cd){if(_0x59c742[_0x819c('0x48')]['id']){delete _0x59c742['body']['id'];}return db[_0x819c('0x29')]['find']({'where':{'id':_0x59c742[_0x819c('0x44')]['id']}})['then'](handleEntityNotFound(_0x4846cd,null))['then'](saveUpdates(_0x59c742[_0x819c('0x48')],null))[_0x819c('0x22')](respondWithResult(_0x4846cd,null))[_0x819c('0x42')](handleError(_0x4846cd,null));};exports['destroy']=function(_0x26c146,_0x312a82){return db[_0x819c('0x29')][_0x819c('0x46')]({'where':{'id':_0x26c146[_0x819c('0x44')]['id']}})[_0x819c('0x22')](handleEntityNotFound(_0x312a82,null))['then'](removeEntity(_0x312a82,null))[_0x819c('0x42')](handleError(_0x312a82,null));}; \ No newline at end of file +var _0x2d76=['save','update','then','destroy','error','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x4c2fe6,_0x30d325){var _0x1de23a=function(_0x527f18){while(--_0x527f18){_0x4c2fe6['push'](_0x4c2fe6['shift']());}};_0x1de23a(++_0x30d325);}(_0x2d76,0x117));var _0x62d7=function(_0x226155,_0x11670e){_0x226155=_0x226155-0x0;var _0x3056c8=_0x2d76[_0x226155];return _0x3056c8;};'use strict';var emlformat=require(_0x62d7('0x0'));var rimraf=require(_0x62d7('0x1'));var zipdir=require(_0x62d7('0x2'));var jsonpatch=require(_0x62d7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x62d7('0x4'));var Mustache=require('mustache');var util=require(_0x62d7('0x5'));var path=require(_0x62d7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x62d7('0x7'));var fs=require('fs');var fs_extra=require(_0x62d7('0x8'));var _=require(_0x62d7('0x9'));var squel=require('squel');var crypto=require(_0x62d7('0xa'));var jsforce=require(_0x62d7('0xb'));var deskjs=require(_0x62d7('0xc'));var toCsv=require(_0x62d7('0xd'));var querystring=require(_0x62d7('0xe'));var Papa=require(_0x62d7('0xf'));var Redis=require(_0x62d7('0x10'));var authService=require(_0x62d7('0x11'));var qs=require(_0x62d7('0x12'));var as=require(_0x62d7('0x13'));var hardwareService=require(_0x62d7('0x14'));var logger=require(_0x62d7('0x15'))(_0x62d7('0x16'));var utils=require(_0x62d7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x62d7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfd0231,_0x5bb82a){_0x5bb82a=_0x5bb82a||0xcc;return function(_0x2957de){if(_0x2957de){return _0xfd0231[_0x62d7('0x19')](_0x5bb82a);}return _0xfd0231[_0x62d7('0x1a')](_0x5bb82a)[_0x62d7('0x1b')]();};}function respondWithResult(_0x1d23d2,_0x317691){_0x317691=_0x317691||0xc8;return function(_0x5f15e8){if(_0x5f15e8){return _0x1d23d2['status'](_0x317691)[_0x62d7('0x1c')](_0x5f15e8);}};}function respondWithFilteredResult(_0x20b4d8,_0x13e8f2){return function(_0x1d6277){if(_0x1d6277){var _0x2cac55=typeof _0x13e8f2[_0x62d7('0x1d')]===_0x62d7('0x1e')&&typeof _0x13e8f2[_0x62d7('0x1f')]===_0x62d7('0x1e');var _0x3645b0=_0x1d6277[_0x62d7('0x20')];var _0x368360=_0x2cac55?0x0:_0x13e8f2[_0x62d7('0x1d')];var _0x558812=_0x2cac55?_0x1d6277[_0x62d7('0x20')]:_0x13e8f2[_0x62d7('0x1d')]+_0x13e8f2[_0x62d7('0x1f')];var _0x26fd4e;if(_0x558812>=_0x3645b0){_0x558812=_0x3645b0;_0x26fd4e=0xc8;}else{_0x26fd4e=0xce;}_0x20b4d8[_0x62d7('0x1a')](_0x26fd4e);return _0x20b4d8[_0x62d7('0x21')](_0x62d7('0x22'),_0x368360+'-'+_0x558812+'/'+_0x3645b0)[_0x62d7('0x1c')](_0x1d6277);}return null;};}function patchUpdates(_0x3851b2){return function(_0x3dc9ed){try{jsonpatch[_0x62d7('0x23')](_0x3dc9ed,_0x3851b2,!![]);}catch(_0x2372d2){return BPromise[_0x62d7('0x24')](_0x2372d2);}return _0x3dc9ed[_0x62d7('0x25')]();};}function saveUpdates(_0x5de7ad,_0x39b0c0){return function(_0x334f18){if(_0x334f18){return _0x334f18[_0x62d7('0x26')](_0x5de7ad)[_0x62d7('0x27')](function(_0x4980b7){return _0x4980b7;});}return null;};}function removeEntity(_0x56c6c8,_0x40380b){return function(_0x3ee0c0){if(_0x3ee0c0){return _0x3ee0c0[_0x62d7('0x28')]()[_0x62d7('0x27')](function(){_0x56c6c8[_0x62d7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d63e2,_0x815d1e){return function(_0x3acdca){if(!_0x3acdca){_0x5d63e2['sendStatus'](0x194);}return _0x3acdca;};}function handleError(_0x4a82ba,_0x3b70b6){_0x3b70b6=_0x3b70b6||0x1f4;return function(_0x1ccbc8){logger[_0x62d7('0x29')](_0x1ccbc8[_0x62d7('0x2a')]);if(_0x1ccbc8[_0x62d7('0x2b')]){delete _0x1ccbc8[_0x62d7('0x2b')];}_0x4a82ba['status'](_0x3b70b6)[_0x62d7('0x2c')](_0x1ccbc8);};}exports['index']=function(_0x480a56,_0x3408f7){var _0x587b3c={},_0x12f56a={},_0x148767={'count':0x0,'rows':[]};var _0xdddbf=_[_0x62d7('0x2d')](db[_0x62d7('0x2e')][_0x62d7('0x2f')],function(_0x4932a5){return{'name':_0x4932a5[_0x62d7('0x30')],'type':_0x4932a5[_0x62d7('0x31')][_0x62d7('0x32')]};});_0x12f56a[_0x62d7('0x33')]=_[_0x62d7('0x2d')](_0xdddbf,'name');_0x12f56a['query']=_['keys'](_0x480a56[_0x62d7('0x34')]);_0x12f56a[_0x62d7('0x35')]=_[_0x62d7('0x36')](_0x12f56a['model'],_0x12f56a['query']);_0x587b3c['attributes']=_['intersection'](_0x12f56a[_0x62d7('0x33')],qs[_0x62d7('0x37')](_0x480a56['query'][_0x62d7('0x37')]));_0x587b3c[_0x62d7('0x38')]=_0x587b3c[_0x62d7('0x38')][_0x62d7('0x39')]?_0x587b3c['attributes']:_0x12f56a['model'];if(!_0x480a56['query'][_0x62d7('0x3a')](_0x62d7('0x3b'))){_0x587b3c[_0x62d7('0x1f')]=qs[_0x62d7('0x1f')](_0x480a56[_0x62d7('0x34')]['limit']);_0x587b3c[_0x62d7('0x1d')]=qs[_0x62d7('0x1d')](_0x480a56[_0x62d7('0x34')]['offset']);}_0x587b3c[_0x62d7('0x3c')]=qs['sort'](_0x480a56[_0x62d7('0x34')][_0x62d7('0x3d')]);_0x587b3c['where']=qs[_0x62d7('0x35')](_[_0x62d7('0x3e')](_0x480a56[_0x62d7('0x34')],_0x12f56a['filters']),_0xdddbf);if(_0x480a56[_0x62d7('0x34')][_0x62d7('0x3f')]){_0x587b3c[_0x62d7('0x40')]=_[_0x62d7('0x41')](_0x587b3c[_0x62d7('0x40')],{'$or':_['map'](_0xdddbf,function(_0x1540f){if(_0x1540f['type']!==_0x62d7('0x42')){var _0x2c5db2={};_0x2c5db2[_0x1540f['name']]={'$like':'%'+_0x480a56[_0x62d7('0x34')]['filter']+'%'};return _0x2c5db2;}})});}_0x587b3c=_[_0x62d7('0x41')]({},_0x587b3c,_0x480a56[_0x62d7('0x43')]);var _0x536661={'where':_0x587b3c['where']};return db[_0x62d7('0x2e')]['count'](_0x536661)[_0x62d7('0x27')](function(_0x129a88){_0x148767[_0x62d7('0x20')]=_0x129a88;if(_0x480a56[_0x62d7('0x34')][_0x62d7('0x44')]){_0x587b3c['include']=[{'all':!![]}];}return db['VtigerField'][_0x62d7('0x45')](_0x587b3c);})[_0x62d7('0x27')](function(_0x3772a2){_0x148767[_0x62d7('0x46')]=_0x3772a2;return _0x148767;})[_0x62d7('0x27')](respondWithFilteredResult(_0x3408f7,_0x587b3c))['catch'](handleError(_0x3408f7,null));};exports[_0x62d7('0x47')]=function(_0x25f51d,_0x3572fd){var _0x3142cb={'raw':!![],'where':{'id':_0x25f51d[_0x62d7('0x48')]['id']}},_0x2b2ed3={};_0x2b2ed3[_0x62d7('0x33')]=_['keys'](db[_0x62d7('0x2e')][_0x62d7('0x2f')]);_0x2b2ed3[_0x62d7('0x34')]=_[_0x62d7('0x49')](_0x25f51d[_0x62d7('0x34')]);_0x2b2ed3['filters']=_[_0x62d7('0x36')](_0x2b2ed3[_0x62d7('0x33')],_0x2b2ed3[_0x62d7('0x34')]);_0x3142cb[_0x62d7('0x38')]=_['intersection'](_0x2b2ed3['model'],qs[_0x62d7('0x37')](_0x25f51d[_0x62d7('0x34')]['fields']));_0x3142cb['attributes']=_0x3142cb[_0x62d7('0x38')][_0x62d7('0x39')]?_0x3142cb['attributes']:_0x2b2ed3[_0x62d7('0x33')];if(_0x25f51d[_0x62d7('0x34')][_0x62d7('0x44')]){_0x3142cb[_0x62d7('0x4a')]=[{'all':!![]}];}_0x3142cb=_[_0x62d7('0x41')]({},_0x3142cb,_0x25f51d[_0x62d7('0x43')]);return db[_0x62d7('0x2e')][_0x62d7('0x4b')](_0x3142cb)[_0x62d7('0x27')](handleEntityNotFound(_0x3572fd,null))['then'](respondWithResult(_0x3572fd,null))['catch'](handleError(_0x3572fd,null));};exports[_0x62d7('0x4c')]=function(_0x3ec4e7,_0x8c1a96){return db[_0x62d7('0x2e')][_0x62d7('0x4c')](_0x3ec4e7[_0x62d7('0x4d')],{})[_0x62d7('0x27')](respondWithResult(_0x8c1a96,0xc9))[_0x62d7('0x4e')](handleError(_0x8c1a96,null));};exports[_0x62d7('0x26')]=function(_0x2fbb97,_0x92ff10){if(_0x2fbb97[_0x62d7('0x4d')]['id']){delete _0x2fbb97[_0x62d7('0x4d')]['id'];}return db['VtigerField'][_0x62d7('0x4b')]({'where':{'id':_0x2fbb97['params']['id']}})[_0x62d7('0x27')](handleEntityNotFound(_0x92ff10,null))['then'](saveUpdates(_0x2fbb97['body'],null))['then'](respondWithResult(_0x92ff10,null))[_0x62d7('0x4e')](handleError(_0x92ff10,null));};exports[_0x62d7('0x28')]=function(_0x56e8fd,_0x48f41c){return db[_0x62d7('0x2e')]['find']({'where':{'id':_0x56e8fd['params']['id']}})[_0x62d7('0x27')](handleEntityNotFound(_0x48f41c,null))[_0x62d7('0x27')](removeEntity(_0x48f41c,null))[_0x62d7('0x4e')](handleError(_0x48f41c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index f4b94e4..7ad96ab 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 _0xb5be=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','define','int_vtiger_fields','idField'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb5be,0xe7));var _0xeb5b=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xb5be[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0xeb5b('0x0'));var logger=require(_0xeb5b('0x1'))('api');var moment=require(_0xeb5b('0x2'));var BPromise=require(_0xeb5b('0x3'));var rp=require(_0xeb5b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb5b('0x5'));var config=require(_0xeb5b('0x6'));var attributes=require(_0xeb5b('0x7'));module['exports']=function(_0x161ee1,_0x410d42){return _0x161ee1[_0xeb5b('0x8')]('VtigerField',attributes,{'tableName':_0xeb5b('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xeb5b('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb97b=['path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb97b,0x1db));var _0xbb97=function(_0x4f6149,_0x19179e){_0x4f6149=_0x4f6149-0x0;var _0x34ce4d=_0xb97b[_0x4f6149];return _0x34ce4d;};'use strict';var _=require(_0xbb97('0x0'));var util=require(_0xbb97('0x1'));var logger=require(_0xbb97('0x2'))(_0xbb97('0x3'));var moment=require(_0xbb97('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb97('0x5'));var rimraf=require(_0xbb97('0x6'));var config=require(_0xbb97('0x7'));var attributes=require(_0xbb97('0x8'));module[_0xbb97('0x9')]=function(_0x3f9324,_0x27b4f1){return _0x3f9324[_0xbb97('0xa')](_0xbb97('0xb'),attributes,{'tableName':_0xbb97('0xc'),'paranoid':![],'indexes':[{'name':_0xbb97('0xd'),'fields':[_0xbb97('0xe'),_0xbb97('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 2cc7f43..2ca573a 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 _0x7a39=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x3b2566,_0x15ebe9){var _0x33ef3e=function(_0x148d72){while(--_0x148d72){_0x3b2566['push'](_0x3b2566['shift']());}};_0x33ef3e(++_0x15ebe9);}(_0x7a39,0x99));var _0x97a3=function(_0x12901b,_0x5f4b87){_0x12901b=_0x12901b-0x0;var _0x212890=_0x7a39[_0x12901b];return _0x212890;};'use strict';var _=require('lodash');var util=require(_0x97a3('0x0'));var moment=require(_0x97a3('0x1'));var BPromise=require(_0x97a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97a3('0x3'));var db=require(_0x97a3('0x4'))['db'];var utils=require(_0x97a3('0x5'));var logger=require('../../config/logger')(_0x97a3('0x6'));var config=require(_0x97a3('0x7'));var jayson=require(_0x97a3('0x8'));var client=jayson[_0x97a3('0x9')][_0x97a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc92fa4,_0x2cdc20,_0x55cc47){return new BPromise(function(_0x5b205b,_0x2cb85b){return client[_0x97a3('0xb')](_0xc92fa4,_0x55cc47)[_0x97a3('0xc')](function(_0x4500cd){logger['info'](_0x97a3('0xd'),_0x2cdc20,_0x97a3('0xe'));logger[_0x97a3('0xf')](_0x97a3('0x10'),_0x2cdc20,_0x97a3('0xe'),JSON[_0x97a3('0x11')](_0x4500cd));if(_0x4500cd[_0x97a3('0x12')]){if(_0x4500cd[_0x97a3('0x12')][_0x97a3('0x13')]===0x1f4){logger[_0x97a3('0x12')](_0x97a3('0xd'),_0x2cdc20,_0x4500cd['error'][_0x97a3('0x14')]);return _0x2cb85b(_0x4500cd[_0x97a3('0x12')][_0x97a3('0x14')]);}logger[_0x97a3('0x12')]('VtigerField,\x20%s,\x20%s',_0x2cdc20,_0x4500cd[_0x97a3('0x12')][_0x97a3('0x14')]);return _0x5b205b(_0x4500cd['error'][_0x97a3('0x14')]);}else{logger[_0x97a3('0x15')]('VtigerField,\x20%s,\x20%s',_0x2cdc20,'request\x20sent');_0x5b205b(_0x4500cd[_0x97a3('0x16')][_0x97a3('0x14')]);}})[_0x97a3('0x17')](function(_0x4b7510){logger[_0x97a3('0x12')]('VtigerField,\x20%s,\x20%s',_0x2cdc20,_0x4b7510);_0x2cb85b(_0x4b7510);});});} \ No newline at end of file +var _0x6797=['request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x6797,0xda));var _0x7679=function(_0x37fac8,_0x290fe0){_0x37fac8=_0x37fac8-0x0;var _0x51edea=_0x6797[_0x37fac8];return _0x51edea;};'use strict';var _=require(_0x7679('0x0'));var util=require(_0x7679('0x1'));var moment=require(_0x7679('0x2'));var BPromise=require(_0x7679('0x3'));var rs=require(_0x7679('0x4'));var fs=require('fs');var Redis=require(_0x7679('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7679('0x6'));var logger=require('../../config/logger')(_0x7679('0x7'));var config=require(_0x7679('0x8'));var jayson=require(_0x7679('0x9'));var client=jayson[_0x7679('0xa')][_0x7679('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x243fbb,_0x52fcaa,_0x1406b3){return new BPromise(function(_0x23e59a,_0x51be53){return client[_0x7679('0xc')](_0x243fbb,_0x1406b3)[_0x7679('0xd')](function(_0xf3f439){logger[_0x7679('0xe')](_0x7679('0xf'),_0x52fcaa,_0x7679('0x10'));logger[_0x7679('0x11')](_0x7679('0x12'),_0x52fcaa,_0x7679('0x10'),JSON['stringify'](_0xf3f439));if(_0xf3f439['error']){if(_0xf3f439[_0x7679('0x13')][_0x7679('0x14')]===0x1f4){logger[_0x7679('0x13')](_0x7679('0xf'),_0x52fcaa,_0xf3f439[_0x7679('0x13')]['message']);return _0x51be53(_0xf3f439[_0x7679('0x13')][_0x7679('0x15')]);}logger['error'](_0x7679('0xf'),_0x52fcaa,_0xf3f439[_0x7679('0x13')][_0x7679('0x15')]);return _0x23e59a(_0xf3f439[_0x7679('0x13')][_0x7679('0x15')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x52fcaa,_0x7679('0x10'));_0x23e59a(_0xf3f439['result'][_0x7679('0x15')]);}})[_0x7679('0x16')](function(_0x473dfb){logger[_0x7679('0x13')](_0x7679('0xf'),_0x52fcaa,_0x473dfb);_0x51be53(_0x473dfb);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 47bd4b9..1167f51 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 _0x283b=['post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','get','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields'];(function(_0x2e23f7,_0x35f041){var _0x436114=function(_0x24f94d){while(--_0x24f94d){_0x2e23f7['push'](_0x2e23f7['shift']());}};_0x436114(++_0x35f041);}(_0x283b,0x188));var _0xb283=function(_0x21e41f,_0x3bb28f){_0x21e41f=_0x21e41f-0x0;var _0x4ba4c8=_0x283b[_0x21e41f];return _0x4ba4c8;};'use strict';var multer=require(_0xb283('0x0'));var util=require(_0xb283('0x1'));var path=require(_0xb283('0x2'));var timeout=require(_0xb283('0x3'));var express=require(_0xb283('0x4'));var router=express[_0xb283('0x5')]();var fs_extra=require(_0xb283('0x6'));var auth=require(_0xb283('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb283('0x8')]);router[_0xb283('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb283('0xa')]);router[_0xb283('0x9')](_0xb283('0xb'),auth[_0xb283('0xc')](),controller[_0xb283('0xd')]);router[_0xb283('0x9')](_0xb283('0xe'),auth[_0xb283('0xc')](),controller[_0xb283('0xf')]);router[_0xb283('0x10')]('/',auth[_0xb283('0xc')](),controller[_0xb283('0x11')]);router[_0xb283('0x10')](_0xb283('0xb'),auth[_0xb283('0xc')](),controller[_0xb283('0x12')]);router[_0xb283('0x13')](_0xb283('0x14'),auth[_0xb283('0xc')](),controller['update']);router[_0xb283('0x15')]('/:id',auth[_0xb283('0xc')](),controller[_0xb283('0x16')]);module[_0xb283('0x17')]=router; \ No newline at end of file +var _0xca13=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy'];(function(_0x36b021,_0x1c8cff){var _0x348e3d=function(_0x4c99ee){while(--_0x4c99ee){_0x36b021['push'](_0x36b021['shift']());}};_0x348e3d(++_0x1c8cff);}(_0xca13,0x114));var _0x3ca1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca13[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ca1('0x0'));var util=require(_0x3ca1('0x1'));var path=require(_0x3ca1('0x2'));var timeout=require(_0x3ca1('0x3'));var express=require(_0x3ca1('0x4'));var router=express[_0x3ca1('0x5')]();var fs_extra=require(_0x3ca1('0x6'));var auth=require(_0x3ca1('0x7'));var interaction=require(_0x3ca1('0x8'));var config=require(_0x3ca1('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x3ca1('0xa')]('/',auth[_0x3ca1('0xb')](),controller[_0x3ca1('0xc')]);router[_0x3ca1('0xa')](_0x3ca1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3ca1('0xa')](_0x3ca1('0xe'),auth[_0x3ca1('0xb')](),controller[_0x3ca1('0xf')]);router['get']('/:id/fields',auth[_0x3ca1('0xb')](),controller[_0x3ca1('0x10')]);router[_0x3ca1('0x11')]('/',auth[_0x3ca1('0xb')](),controller[_0x3ca1('0x12')]);router[_0x3ca1('0x11')](_0x3ca1('0xe'),auth[_0x3ca1('0xb')](),controller[_0x3ca1('0x13')]);router[_0x3ca1('0x14')](_0x3ca1('0xd'),auth[_0x3ca1('0xb')](),controller[_0x3ca1('0x15')]);router[_0x3ca1('0x16')](_0x3ca1('0xd'),auth[_0x3ca1('0xb')](),controller[_0x3ca1('0x17')]);module[_0x3ca1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 75ff112..1e0e3cc 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 _0x9fd4=['password','token','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x585f40,_0x4a3091){var _0x44fc86=function(_0x5bcedc){while(--_0x5bcedc){_0x585f40['push'](_0x585f40['shift']());}};_0x44fc86(++_0x4a3091);}(_0x9fd4,0x16c));var _0x49fd=function(_0x58ed4e,_0x3431de){_0x58ed4e=_0x58ed4e-0x0;var _0xa15bc4=_0x9fd4[_0x58ed4e];return _0xa15bc4;};'use strict';var Sequelize=require(_0x49fd('0x0'));module[_0x49fd('0x1')]={'name':{'type':Sequelize[_0x49fd('0x2')]},'description':{'type':Sequelize[_0x49fd('0x2')]},'username':{'type':Sequelize[_0x49fd('0x2')],'unique':_0x49fd('0x3')},'password':{'type':Sequelize[_0x49fd('0x2')]},'token':{'type':Sequelize[_0x49fd('0x2')]},'remoteUri':{'type':Sequelize[_0x49fd('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x49fd('0x4'),_0x49fd('0x5')),'defaultValue':_0x49fd('0x4')},'serverUrl':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x49fd('0x6'),_0x49fd('0x7')),'defaultValue':_0x49fd('0x6')}}; \ No newline at end of file +var _0x9e2e=['STRING','remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports'];(function(_0x3d78c0,_0x4e9a93){var _0x56c03f=function(_0x13bf57){while(--_0x13bf57){_0x3d78c0['push'](_0x3d78c0['shift']());}};_0x56c03f(++_0x4e9a93);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x558b73,_0x4fc3a3){_0x558b73=_0x558b73-0x0;var _0x442948=_0x9e2e[_0x558b73];return _0x442948;};'use strict';var Sequelize=require(_0xe9e2('0x0'));module[_0xe9e2('0x1')]={'name':{'type':Sequelize[_0xe9e2('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe9e2('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe9e2('0x2')]},'remoteUri':{'type':Sequelize[_0xe9e2('0x2')],'unique':_0xe9e2('0x3')},'authType':{'type':Sequelize[_0xe9e2('0x4')](_0xe9e2('0x5'),_0xe9e2('0x6')),'defaultValue':_0xe9e2('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe9e2('0x4')]('integrationTab',_0xe9e2('0x7')),'defaultValue':_0xe9e2('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 845910f..596e442 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 _0xb688=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','index','map','ZendeskAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','name','options','findAll','rows','catch','show','includeAll','include','find','create','params','body','findOne','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','getFields','username','password','token','remoteUri','slice','substring','%s/%s','authType','format','Basic\x20%s','%s:%s','toString','base64','headers','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','error','stringify','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0xb688,0xcf));var _0x8b68=function(_0x8e3d57,_0x38ee0f){_0x8e3d57=_0x8e3d57-0x0;var _0x1ea8fe=_0xb688[_0x8e3d57];return _0x1ea8fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];var integrations=require(_0x8b68('0x1b'));function respondWithStatusCode(_0x2f3af4,_0xaa8725){_0xaa8725=_0xaa8725||0xcc;return function(_0x137c8e){if(_0x137c8e){return _0x2f3af4[_0x8b68('0x1c')](_0xaa8725);}return _0x2f3af4['status'](_0xaa8725)[_0x8b68('0x1d')]();};}function respondWithResult(_0x509033,_0x5e3c66){_0x5e3c66=_0x5e3c66||0xc8;return function(_0x22f75b){if(_0x22f75b){return _0x509033[_0x8b68('0x1e')](_0x5e3c66)[_0x8b68('0x1f')](_0x22f75b);}};}function respondWithFilteredResult(_0x5d3468,_0x5c8d0e){return function(_0x23bd52){if(_0x23bd52){var _0x5c1e44=typeof _0x5c8d0e[_0x8b68('0x20')]===_0x8b68('0x21')&&typeof _0x5c8d0e[_0x8b68('0x22')]===_0x8b68('0x21');var _0x491695=_0x23bd52[_0x8b68('0x23')];var _0x203dd4=_0x5c1e44?0x0:_0x5c8d0e['offset'];var _0x42b3bd=_0x5c1e44?_0x23bd52[_0x8b68('0x23')]:_0x5c8d0e[_0x8b68('0x20')]+_0x5c8d0e[_0x8b68('0x22')];var _0x38b7a7;if(_0x42b3bd>=_0x491695){_0x42b3bd=_0x491695;_0x38b7a7=0xc8;}else{_0x38b7a7=0xce;}_0x5d3468['status'](_0x38b7a7);return _0x5d3468[_0x8b68('0x24')](_0x8b68('0x25'),_0x203dd4+'-'+_0x42b3bd+'/'+_0x491695)[_0x8b68('0x1f')](_0x23bd52);}return null;};}function patchUpdates(_0x1a9788){return function(_0x35d055){try{jsonpatch[_0x8b68('0x26')](_0x35d055,_0x1a9788,!![]);}catch(_0x5603d4){return BPromise['reject'](_0x5603d4);}return _0x35d055[_0x8b68('0x27')]();};}function saveUpdates(_0x59cb26,_0x332202){return function(_0x30b6d0){if(_0x30b6d0){return _0x30b6d0[_0x8b68('0x28')](_0x59cb26)[_0x8b68('0x29')](function(_0x32ddc5){return _0x32ddc5;});}return null;};}function removeEntity(_0x173524,_0x59bb8a){return function(_0x1a6fe8){if(_0x1a6fe8){return _0x1a6fe8[_0x8b68('0x2a')]()['then'](function(){_0x173524[_0x8b68('0x1e')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x240b0b,_0x5590ec){return function(_0x511ccf){if(!_0x511ccf){_0x240b0b['sendStatus'](0x194);}return _0x511ccf;};}function handleError(_0x92d186,_0x448e43){_0x448e43=_0x448e43||0x1f4;return function(_0x2ba2a3){logger['error'](_0x2ba2a3[_0x8b68('0x2b')]);if(_0x2ba2a3['name']){delete _0x2ba2a3['name'];}_0x92d186[_0x8b68('0x1e')](_0x448e43)['send'](_0x2ba2a3);};}exports[_0x8b68('0x2c')]=function(_0x3ac356,_0x48e2c8){var _0x494ce4={},_0x357635={},_0x1cd230={'count':0x0,'rows':[]};var _0x1e7c06=_[_0x8b68('0x2d')](db[_0x8b68('0x2e')][_0x8b68('0x2f')],function(_0x460c37){return{'name':_0x460c37['fieldName'],'type':_0x460c37[_0x8b68('0x30')]['key']};});_0x357635[_0x8b68('0x31')]=_[_0x8b68('0x2d')](_0x1e7c06,'name');_0x357635[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ac356[_0x8b68('0x32')]);_0x357635['filters']=_['intersection'](_0x357635[_0x8b68('0x31')],_0x357635[_0x8b68('0x32')]);_0x494ce4[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x357635[_0x8b68('0x31')],qs[_0x8b68('0x36')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x36')]));_0x494ce4[_0x8b68('0x34')]=_0x494ce4[_0x8b68('0x34')][_0x8b68('0x37')]?_0x494ce4[_0x8b68('0x34')]:_0x357635[_0x8b68('0x31')];if(!_0x3ac356[_0x8b68('0x32')][_0x8b68('0x38')](_0x8b68('0x39'))){_0x494ce4[_0x8b68('0x22')]=qs[_0x8b68('0x22')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x22')]);_0x494ce4[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3ac356['query']['offset']);}_0x494ce4[_0x8b68('0x3a')]=qs[_0x8b68('0x3b')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x494ce4[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_[_0x8b68('0x3e')](_0x3ac356[_0x8b68('0x32')],_0x357635['filters']),_0x1e7c06);if(_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x494ce4[_0x8b68('0x3c')]=_[_0x8b68('0x40')](_0x494ce4[_0x8b68('0x3c')],{'$or':_[_0x8b68('0x2d')](_0x1e7c06,function(_0xff4080){if(_0xff4080[_0x8b68('0x30')]!=='VIRTUAL'){var _0x3f874c={};_0x3f874c[_0xff4080[_0x8b68('0x41')]]={'$like':'%'+_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3f')]+'%'};return _0x3f874c;}})});}_0x494ce4=_[_0x8b68('0x40')]({},_0x494ce4,_0x3ac356[_0x8b68('0x42')]);var _0xa748c2={'where':_0x494ce4['where']};return db[_0x8b68('0x2e')][_0x8b68('0x23')](_0xa748c2)['then'](function(_0x14ec40){_0x1cd230[_0x8b68('0x23')]=_0x14ec40;if(_0x3ac356['query']['includeAll']){_0x494ce4['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8b68('0x43')](_0x494ce4);})[_0x8b68('0x29')](function(_0x515815){_0x1cd230[_0x8b68('0x44')]=_0x515815;return _0x1cd230;})['then'](respondWithFilteredResult(_0x48e2c8,_0x494ce4))[_0x8b68('0x45')](handleError(_0x48e2c8,null));};exports[_0x8b68('0x46')]=function(_0x5a3193,_0x2f90d9){var _0x5ae345={'raw':![],'where':{'id':_0x5a3193['params']['id']}},_0x4a718c={};_0x4a718c[_0x8b68('0x31')]=_[_0x8b68('0x33')](db[_0x8b68('0x2e')][_0x8b68('0x2f')]);_0x4a718c['query']=_[_0x8b68('0x33')](_0x5a3193['query']);_0x4a718c[_0x8b68('0x3d')]=_[_0x8b68('0x35')](_0x4a718c['model'],_0x4a718c[_0x8b68('0x32')]);_0x5ae345[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x4a718c[_0x8b68('0x31')],qs['fields'](_0x5a3193[_0x8b68('0x32')][_0x8b68('0x36')]));_0x5ae345[_0x8b68('0x34')]=_0x5ae345[_0x8b68('0x34')][_0x8b68('0x37')]?_0x5ae345[_0x8b68('0x34')]:_0x4a718c[_0x8b68('0x31')];if(_0x5a3193[_0x8b68('0x32')][_0x8b68('0x47')]){_0x5ae345[_0x8b68('0x48')]=[{'all':!![]}];}_0x5ae345=_[_0x8b68('0x40')]({},_0x5ae345,_0x5a3193[_0x8b68('0x42')]);return db[_0x8b68('0x2e')][_0x8b68('0x49')](_0x5ae345)[_0x8b68('0x29')](handleEntityNotFound(_0x2f90d9,null))[_0x8b68('0x29')](respondWithResult(_0x2f90d9,null))['catch'](handleError(_0x2f90d9,null));};exports[_0x8b68('0x4a')]=function(_0x20681a,_0x5dd099){return db[_0x8b68('0x2e')]['create'](_0x20681a['body'],{})['then'](respondWithResult(_0x5dd099,0xc9))[_0x8b68('0x45')](handleError(_0x5dd099,null));};exports[_0x8b68('0x28')]=function(_0x34047c,_0x6da48b){if(_0x34047c['body']['id']){delete _0x34047c['body']['id'];}return db[_0x8b68('0x2e')][_0x8b68('0x49')]({'where':{'id':_0x34047c[_0x8b68('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6da48b,null))[_0x8b68('0x29')](saveUpdates(_0x34047c[_0x8b68('0x4c')],null))['then'](respondWithResult(_0x6da48b,null))[_0x8b68('0x45')](handleError(_0x6da48b,null));};exports[_0x8b68('0x2a')]=function(_0x595942,_0x18a9ae){return db[_0x8b68('0x2e')]['find']({'where':{'id':_0x595942[_0x8b68('0x4b')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x18a9ae,null))['then'](removeEntity(_0x18a9ae,null))['catch'](handleError(_0x18a9ae,null));};exports['getConfigurations']=function(_0x28f82d,_0x42eabd,_0x3718b2){var _0x3d4b4f={};var _0x55aad3={};var _0x5a1711;var _0x4492fd;return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x28f82d['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x42eabd,null))[_0x8b68('0x29')](function(_0x3f9d34){if(_0x3f9d34){_0x5a1711=_0x3f9d34;_0x55aad3['model']=_[_0x8b68('0x33')](db['ZendeskConfiguration'][_0x8b68('0x2f')]);_0x55aad3[_0x8b68('0x32')]=_['keys'](_0x28f82d[_0x8b68('0x32')]);_0x55aad3[_0x8b68('0x3d')]=_[_0x8b68('0x35')](_0x55aad3[_0x8b68('0x31')],_0x55aad3[_0x8b68('0x32')]);_0x3d4b4f['attributes']=_[_0x8b68('0x35')](_0x55aad3[_0x8b68('0x31')],qs[_0x8b68('0x36')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x36')]));_0x3d4b4f[_0x8b68('0x34')]=_0x3d4b4f[_0x8b68('0x34')][_0x8b68('0x37')]?_0x3d4b4f['attributes']:_0x55aad3[_0x8b68('0x31')];_0x3d4b4f[_0x8b68('0x3a')]=qs[_0x8b68('0x3b')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x3d4b4f[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_[_0x8b68('0x3e')](_0x28f82d[_0x8b68('0x32')],_0x55aad3[_0x8b68('0x3d')]));if(_0x28f82d[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x3d4b4f[_0x8b68('0x3c')]=_[_0x8b68('0x40')](_0x3d4b4f[_0x8b68('0x3c')],{'$or':_[_0x8b68('0x2d')](_0x3d4b4f[_0x8b68('0x34')],function(_0x3da7b4){var _0xae90f0={};_0xae90f0[_0x3da7b4]={'$like':'%'+_0x28f82d[_0x8b68('0x32')]['filter']+'%'};return _0xae90f0;})});}_0x3d4b4f=_[_0x8b68('0x40')]({},_0x3d4b4f,_0x28f82d['options']);return _0x5a1711['getConfigurations'](_0x3d4b4f);}})[_0x8b68('0x29')](function(_0x5d2476){if(_0x5d2476){_0x4492fd=_0x5d2476[_0x8b68('0x37')];if(!_0x28f82d[_0x8b68('0x32')][_0x8b68('0x38')]('nolimit')){_0x3d4b4f[_0x8b68('0x22')]=qs[_0x8b68('0x22')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x22')]);_0x3d4b4f[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x28f82d[_0x8b68('0x32')]['offset']);}return _0x5a1711['getConfigurations'](_0x3d4b4f);}})[_0x8b68('0x29')](function(_0x4224f5){if(_0x4224f5){return _0x4224f5?{'count':_0x4492fd,'rows':_0x4224f5}:null;}})[_0x8b68('0x29')](respondWithResult(_0x42eabd,null))[_0x8b68('0x45')](handleError(_0x42eabd,null));};exports[_0x8b68('0x4e')]=function(_0x37da34,_0x2d1519,_0x314f1e){if(_0x37da34[_0x8b68('0x4c')]['id']){delete _0x37da34[_0x8b68('0x4c')]['id'];}return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x37da34[_0x8b68('0x4b')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x2d1519,null))[_0x8b68('0x29')](function(_0x414096){if(_0x414096){_0x37da34[_0x8b68('0x4c')][_0x8b68('0x4f')]=_0x414096['id'];_0x37da34['body']['Subjects']=integrations[_0x8b68('0x50')](_0x37da34[_0x8b68('0x4c')]['channel'],_0x37da34['body']['type']);_0x37da34[_0x8b68('0x4c')][_0x8b68('0x51')]=integrations[_0x8b68('0x52')](_0x37da34[_0x8b68('0x4c')][_0x8b68('0x53')],_0x37da34['body'][_0x8b68('0x30')]);return db[_0x8b68('0x54')]['create'](_0x37da34[_0x8b68('0x4c')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x8b68('0x51')}]});}return null;})[_0x8b68('0x29')](respondWithResult(_0x2d1519,null))[_0x8b68('0x45')](handleError(_0x2d1519,null));};exports[_0x8b68('0x55')]=function(_0x864b6b,_0x1fc24c,_0x35b22b){var _0x34456d='';return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x864b6b['params']['id']},'attributes':['id',_0x8b68('0x56'),_0x8b68('0x57'),_0x8b68('0x58'),'authType','remoteUri']})[_0x8b68('0x29')](handleEntityNotFound(_0x1fc24c,null))[_0x8b68('0x29')](function(_0x525b41){if(_0x525b41){_0x34456d=_0x525b41[_0x8b68('0x59')];var _0x2c1c96=_0x34456d[_0x8b68('0x5a')](-0x1);if(_0x2c1c96==='/'){_0x34456d=_0x34456d[_0x8b68('0x5b')](0x0,_0x34456d['lastIndexOf'](_0x2c1c96));}var _0x96e526={'method':'GET','uri':util['format'](_0x8b68('0x5c'),_0x34456d,'ticket_fields'),'json':!![]};switch(_0x525b41[_0x8b68('0x5d')]){case _0x8b68('0x57'):_0x96e526['headers']={'Authorization':util[_0x8b68('0x5e')](_0x8b68('0x5f'),new Buffer(util[_0x8b68('0x5e')](_0x8b68('0x60'),_0x525b41[_0x8b68('0x56')],_0x525b41['password']))[_0x8b68('0x61')](_0x8b68('0x62')))};break;case _0x8b68('0x58'):_0x96e526[_0x8b68('0x63')]={'Authorization':util[_0x8b68('0x5e')]('Basic\x20%s',new Buffer(util['format'](_0x8b68('0x64'),_0x525b41['username'],_0x525b41[_0x8b68('0x58')]))[_0x8b68('0x61')](_0x8b68('0x62')))};break;default:throw new db[(_0x8b68('0x65'))][(_0x8b68('0x66'))](_0x8b68('0x67'));}return rp(_0x96e526);}})[_0x8b68('0x29')](function(_0x486be8){if(_0x486be8){var _0x3033b4=['subject',_0x8b68('0x68'),_0x8b68('0x69'),_0x8b68('0x6a')];_['remove'](_0x486be8[_0x8b68('0x6b')],function(_0x50d0b9){return _0x3033b4[_0x8b68('0x6c')](_0x50d0b9['type']);});return{'count':_0x486be8[_0x8b68('0x6b')][_0x8b68('0x37')],'rows':_[_0x8b68('0x2d')](_0x486be8['ticket_fields'],function(_0x33b775){return{'id':_0x33b775['id'],'name':_0x33b775[_0x8b68('0x6d')]>0x7?_0x33b775[_0x8b68('0x6e')]:_0x33b775[_0x8b68('0x30')],'custom':_0x33b775[_0x8b68('0x6d')]>0x7?!![]:![],'options':_0x33b775[_0x8b68('0x6f')]?_0x33b775[_0x8b68('0x6f')]:_0x33b775[_0x8b68('0x70')]?_0x33b775[_0x8b68('0x70')]:[]};})};}})['then'](respondWithResult(_0x1fc24c,null))[_0x8b68('0x45')](function(_0x3cb970){var _0x9a5bec=_0x864b6b[_0x8b68('0x32')][_0x8b68('0x71')]?0x1f4:_0x3cb970['statusCode']||0x1f4;logger[_0x8b68('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x8b68('0x55'),_0x9a5bec,JSON[_0x8b68('0x73')](_0x3cb970));delete _0x3cb970['name'];if(_0x9a5bec===0x191){_0x9a5bec=0x190;}_0x1fc24c[_0x8b68('0x1e')](_0x9a5bec)[_0x8b68('0x74')](_0x864b6b[_0x8b68('0x32')]['test']?{'message':_0x8b68('0x75'),'statusCode':_0x3cb970[_0x8b68('0x76')]}:_0x3cb970);});}; \ No newline at end of file +var _0x373d=['ZendeskField','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','position','title','system_field_options','custom_field_options','test','stringify','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','ZendeskAccount','rows','catch','show','keys','rawAttributes','find','create','body','params','findOne','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0x373d,0x1e2));var _0xd373=function(_0x1ba88a,_0x30b1d8){_0x1ba88a=_0x1ba88a-0x0;var _0x5d0fe7=_0x373d[_0x1ba88a];return _0x5d0fe7;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5ab89c,_0xcd9b8c){_0xcd9b8c=_0xcd9b8c||0xcc;return function(_0x14a0ee){if(_0x14a0ee){return _0x5ab89c['sendStatus'](_0xcd9b8c);}return _0x5ab89c[_0xd373('0x15')](_0xcd9b8c)[_0xd373('0x16')]();};}function respondWithResult(_0x27c161,_0x23ed86){_0x23ed86=_0x23ed86||0xc8;return function(_0x28b2bf){if(_0x28b2bf){return _0x27c161[_0xd373('0x15')](_0x23ed86)[_0xd373('0x17')](_0x28b2bf);}};}function respondWithFilteredResult(_0x2eacb1,_0x5a286a){return function(_0x2c5854){if(_0x2c5854){var _0x3a5316=typeof _0x5a286a[_0xd373('0x18')]===_0xd373('0x19')&&typeof _0x5a286a['limit']===_0xd373('0x19');var _0x5eab00=_0x2c5854[_0xd373('0x1a')];var _0x36d47a=_0x3a5316?0x0:_0x5a286a['offset'];var _0x1bbdbd=_0x3a5316?_0x2c5854['count']:_0x5a286a['offset']+_0x5a286a[_0xd373('0x1b')];var _0x186fdd;if(_0x1bbdbd>=_0x5eab00){_0x1bbdbd=_0x5eab00;_0x186fdd=0xc8;}else{_0x186fdd=0xce;}_0x2eacb1[_0xd373('0x15')](_0x186fdd);return _0x2eacb1[_0xd373('0x1c')](_0xd373('0x1d'),_0x36d47a+'-'+_0x1bbdbd+'/'+_0x5eab00)[_0xd373('0x17')](_0x2c5854);}return null;};}function patchUpdates(_0x4ba510){return function(_0x18b681){try{jsonpatch[_0xd373('0x1e')](_0x18b681,_0x4ba510,!![]);}catch(_0x1378a0){return BPromise[_0xd373('0x1f')](_0x1378a0);}return _0x18b681[_0xd373('0x20')]();};}function saveUpdates(_0x3aa1c5,_0x4f64bd){return function(_0x355fca){if(_0x355fca){return _0x355fca[_0xd373('0x21')](_0x3aa1c5)[_0xd373('0x22')](function(_0x209ca7){return _0x209ca7;});}return null;};}function removeEntity(_0x217ee7,_0x238ffd){return function(_0x466a03){if(_0x466a03){return _0x466a03[_0xd373('0x23')]()[_0xd373('0x22')](function(){_0x217ee7[_0xd373('0x15')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x34f05a,_0x388182){return function(_0x420a30){if(!_0x420a30){_0x34f05a[_0xd373('0x24')](0x194);}return _0x420a30;};}function handleError(_0x38ba50,_0x50b987){_0x50b987=_0x50b987||0x1f4;return function(_0x13a012){logger[_0xd373('0x25')](_0x13a012[_0xd373('0x26')]);if(_0x13a012[_0xd373('0x27')]){delete _0x13a012[_0xd373('0x27')];}_0x38ba50[_0xd373('0x15')](_0x50b987)[_0xd373('0x28')](_0x13a012);};}exports[_0xd373('0x29')]=function(_0x2869e5,_0x158825){var _0xbc420b={},_0x2ee37c={},_0x7dad3e={'count':0x0,'rows':[]};var _0x5287e7=_[_0xd373('0x2a')](db['ZendeskAccount']['rawAttributes'],function(_0xedc8f3){return{'name':_0xedc8f3[_0xd373('0x2b')],'type':_0xedc8f3[_0xd373('0x2c')][_0xd373('0x2d')]};});_0x2ee37c[_0xd373('0x2e')]=_['map'](_0x5287e7,_0xd373('0x27'));_0x2ee37c[_0xd373('0x2f')]=_['keys'](_0x2869e5[_0xd373('0x2f')]);_0x2ee37c[_0xd373('0x30')]=_[_0xd373('0x31')](_0x2ee37c[_0xd373('0x2e')],_0x2ee37c[_0xd373('0x2f')]);_0xbc420b[_0xd373('0x32')]=_[_0xd373('0x31')](_0x2ee37c[_0xd373('0x2e')],qs[_0xd373('0x33')](_0x2869e5['query'][_0xd373('0x33')]));_0xbc420b[_0xd373('0x32')]=_0xbc420b[_0xd373('0x32')][_0xd373('0x34')]?_0xbc420b[_0xd373('0x32')]:_0x2ee37c[_0xd373('0x2e')];if(!_0x2869e5[_0xd373('0x2f')][_0xd373('0x35')](_0xd373('0x36'))){_0xbc420b[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x2869e5[_0xd373('0x2f')][_0xd373('0x1b')]);_0xbc420b[_0xd373('0x18')]=qs[_0xd373('0x18')](_0x2869e5['query'][_0xd373('0x18')]);}_0xbc420b[_0xd373('0x37')]=qs[_0xd373('0x38')](_0x2869e5[_0xd373('0x2f')]['sort']);_0xbc420b[_0xd373('0x39')]=qs[_0xd373('0x30')](_[_0xd373('0x3a')](_0x2869e5[_0xd373('0x2f')],_0x2ee37c[_0xd373('0x30')]),_0x5287e7);if(_0x2869e5[_0xd373('0x2f')]['filter']){_0xbc420b['where']=_[_0xd373('0x3b')](_0xbc420b['where'],{'$or':_[_0xd373('0x2a')](_0x5287e7,function(_0xe19d5b){if(_0xe19d5b[_0xd373('0x2c')]!=='VIRTUAL'){var _0x287136={};_0x287136[_0xe19d5b[_0xd373('0x27')]]={'$like':'%'+_0x2869e5[_0xd373('0x2f')][_0xd373('0x3c')]+'%'};return _0x287136;}})});}_0xbc420b=_['merge']({},_0xbc420b,_0x2869e5['options']);var _0x5de74e={'where':_0xbc420b[_0xd373('0x39')]};return db['ZendeskAccount'][_0xd373('0x1a')](_0x5de74e)[_0xd373('0x22')](function(_0x4e5e80){_0x7dad3e['count']=_0x4e5e80;if(_0x2869e5['query'][_0xd373('0x3d')]){_0xbc420b[_0xd373('0x3e')]=[{'all':!![]}];}return db[_0xd373('0x3f')]['findAll'](_0xbc420b);})['then'](function(_0xb87e16){_0x7dad3e[_0xd373('0x40')]=_0xb87e16;return _0x7dad3e;})['then'](respondWithFilteredResult(_0x158825,_0xbc420b))[_0xd373('0x41')](handleError(_0x158825,null));};exports[_0xd373('0x42')]=function(_0x1e3de1,_0x9989e4){var _0x2d8c7d={'raw':![],'where':{'id':_0x1e3de1['params']['id']}},_0x4e8bc6={};_0x4e8bc6[_0xd373('0x2e')]=_[_0xd373('0x43')](db[_0xd373('0x3f')][_0xd373('0x44')]);_0x4e8bc6['query']=_[_0xd373('0x43')](_0x1e3de1['query']);_0x4e8bc6[_0xd373('0x30')]=_[_0xd373('0x31')](_0x4e8bc6[_0xd373('0x2e')],_0x4e8bc6[_0xd373('0x2f')]);_0x2d8c7d[_0xd373('0x32')]=_['intersection'](_0x4e8bc6[_0xd373('0x2e')],qs[_0xd373('0x33')](_0x1e3de1['query'][_0xd373('0x33')]));_0x2d8c7d[_0xd373('0x32')]=_0x2d8c7d[_0xd373('0x32')][_0xd373('0x34')]?_0x2d8c7d[_0xd373('0x32')]:_0x4e8bc6[_0xd373('0x2e')];if(_0x1e3de1[_0xd373('0x2f')][_0xd373('0x3d')]){_0x2d8c7d[_0xd373('0x3e')]=[{'all':!![]}];}_0x2d8c7d=_[_0xd373('0x3b')]({},_0x2d8c7d,_0x1e3de1['options']);return db['ZendeskAccount'][_0xd373('0x45')](_0x2d8c7d)['then'](handleEntityNotFound(_0x9989e4,null))[_0xd373('0x22')](respondWithResult(_0x9989e4,null))['catch'](handleError(_0x9989e4,null));};exports['create']=function(_0x5cbc16,_0x280598){return db[_0xd373('0x3f')][_0xd373('0x46')](_0x5cbc16[_0xd373('0x47')],{})[_0xd373('0x22')](respondWithResult(_0x280598,0xc9))[_0xd373('0x41')](handleError(_0x280598,null));};exports[_0xd373('0x21')]=function(_0x4d1088,_0x28ec3e){if(_0x4d1088['body']['id']){delete _0x4d1088[_0xd373('0x47')]['id'];}return db[_0xd373('0x3f')]['find']({'where':{'id':_0x4d1088[_0xd373('0x48')]['id']}})['then'](handleEntityNotFound(_0x28ec3e,null))[_0xd373('0x22')](saveUpdates(_0x4d1088[_0xd373('0x47')],null))[_0xd373('0x22')](respondWithResult(_0x28ec3e,null))[_0xd373('0x41')](handleError(_0x28ec3e,null));};exports[_0xd373('0x23')]=function(_0x4bc631,_0x4971a0){return db['ZendeskAccount'][_0xd373('0x45')]({'where':{'id':_0x4bc631[_0xd373('0x48')]['id']}})['then'](handleEntityNotFound(_0x4971a0,null))[_0xd373('0x22')](removeEntity(_0x4971a0,null))[_0xd373('0x41')](handleError(_0x4971a0,null));};exports['getConfigurations']=function(_0xae7067,_0xb6b583,_0x102101){var _0x473af2={};var _0x3b5e70={};var _0xa2758;var _0xc255ec;return db[_0xd373('0x3f')][_0xd373('0x49')]({'where':{'id':_0xae7067[_0xd373('0x48')]['id']}})[_0xd373('0x22')](handleEntityNotFound(_0xb6b583,null))['then'](function(_0x4b2645){if(_0x4b2645){_0xa2758=_0x4b2645;_0x3b5e70['model']=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x3b5e70[_0xd373('0x2f')]=_[_0xd373('0x43')](_0xae7067['query']);_0x3b5e70['filters']=_['intersection'](_0x3b5e70[_0xd373('0x2e')],_0x3b5e70[_0xd373('0x2f')]);_0x473af2['attributes']=_['intersection'](_0x3b5e70[_0xd373('0x2e')],qs[_0xd373('0x33')](_0xae7067[_0xd373('0x2f')][_0xd373('0x33')]));_0x473af2[_0xd373('0x32')]=_0x473af2['attributes'][_0xd373('0x34')]?_0x473af2[_0xd373('0x32')]:_0x3b5e70[_0xd373('0x2e')];_0x473af2[_0xd373('0x37')]=qs[_0xd373('0x38')](_0xae7067[_0xd373('0x2f')][_0xd373('0x38')]);_0x473af2[_0xd373('0x39')]=qs[_0xd373('0x30')](_[_0xd373('0x3a')](_0xae7067[_0xd373('0x2f')],_0x3b5e70[_0xd373('0x30')]));if(_0xae7067[_0xd373('0x2f')][_0xd373('0x3c')]){_0x473af2[_0xd373('0x39')]=_['merge'](_0x473af2[_0xd373('0x39')],{'$or':_[_0xd373('0x2a')](_0x473af2[_0xd373('0x32')],function(_0x4dba1d){var _0x2bdadf={};_0x2bdadf[_0x4dba1d]={'$like':'%'+_0xae7067['query'][_0xd373('0x3c')]+'%'};return _0x2bdadf;})});}_0x473af2=_['merge']({},_0x473af2,_0xae7067[_0xd373('0x4a')]);return _0xa2758[_0xd373('0x4b')](_0x473af2);}})[_0xd373('0x22')](function(_0x19924a){if(_0x19924a){_0xc255ec=_0x19924a[_0xd373('0x34')];if(!_0xae7067[_0xd373('0x2f')][_0xd373('0x35')](_0xd373('0x36'))){_0x473af2[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0xae7067[_0xd373('0x2f')][_0xd373('0x1b')]);_0x473af2[_0xd373('0x18')]=qs[_0xd373('0x18')](_0xae7067[_0xd373('0x2f')][_0xd373('0x18')]);}return _0xa2758[_0xd373('0x4b')](_0x473af2);}})[_0xd373('0x22')](function(_0x209e76){if(_0x209e76){return _0x209e76?{'count':_0xc255ec,'rows':_0x209e76}:null;}})[_0xd373('0x22')](respondWithResult(_0xb6b583,null))[_0xd373('0x41')](handleError(_0xb6b583,null));};exports[_0xd373('0x4c')]=function(_0x296242,_0x5133,_0x2ada2f){if(_0x296242[_0xd373('0x47')]['id']){delete _0x296242['body']['id'];}return db[_0xd373('0x3f')][_0xd373('0x49')]({'where':{'id':_0x296242[_0xd373('0x48')]['id']}})['then'](handleEntityNotFound(_0x5133,null))[_0xd373('0x22')](function(_0x2d9019){if(_0x2d9019){_0x296242[_0xd373('0x47')][_0xd373('0x4d')]=_0x2d9019['id'];_0x296242[_0xd373('0x47')][_0xd373('0x4e')]=integrations[_0xd373('0x4f')](_0x296242['body'][_0xd373('0x50')],_0x296242[_0xd373('0x47')][_0xd373('0x2c')]);_0x296242[_0xd373('0x47')][_0xd373('0x51')]=integrations[_0xd373('0x52')](_0x296242[_0xd373('0x47')][_0xd373('0x50')],_0x296242['body'][_0xd373('0x2c')]);return db['ZendeskConfiguration'][_0xd373('0x46')](_0x296242[_0xd373('0x47')],{'include':[{'model':db[_0xd373('0x53')],'as':_0xd373('0x4e')},{'model':db[_0xd373('0x53')],'as':_0xd373('0x51')}]});}return null;})[_0xd373('0x22')](respondWithResult(_0x5133,null))[_0xd373('0x41')](handleError(_0x5133,null));};exports['getFields']=function(_0x237f15,_0x5c5855,_0x40f5ad){var _0x27fcbe='';return db[_0xd373('0x3f')][_0xd373('0x49')]({'where':{'id':_0x237f15[_0xd373('0x48')]['id']},'attributes':['id',_0xd373('0x54'),_0xd373('0x55'),'token',_0xd373('0x56'),_0xd373('0x57')]})[_0xd373('0x22')](handleEntityNotFound(_0x5c5855,null))['then'](function(_0x4035d4){if(_0x4035d4){_0x27fcbe=_0x4035d4[_0xd373('0x57')];var _0xaf9102=_0x27fcbe[_0xd373('0x58')](-0x1);if(_0xaf9102==='/'){_0x27fcbe=_0x27fcbe[_0xd373('0x59')](0x0,_0x27fcbe[_0xd373('0x5a')](_0xaf9102));}var _0x6c7c8d={'method':_0xd373('0x5b'),'uri':util[_0xd373('0x5c')](_0xd373('0x5d'),_0x27fcbe,_0xd373('0x5e')),'json':!![]};switch(_0x4035d4[_0xd373('0x56')]){case'password':_0x6c7c8d[_0xd373('0x5f')]={'Authorization':util[_0xd373('0x5c')](_0xd373('0x60'),new Buffer(util['format'](_0xd373('0x61'),_0x4035d4[_0xd373('0x54')],_0x4035d4[_0xd373('0x55')]))['toString'](_0xd373('0x62')))};break;case'token':_0x6c7c8d[_0xd373('0x5f')]={'Authorization':util[_0xd373('0x5c')](_0xd373('0x60'),new Buffer(util[_0xd373('0x5c')]('%s/token:%s',_0x4035d4[_0xd373('0x54')],_0x4035d4['token']))[_0xd373('0x63')](_0xd373('0x62')))};break;default:throw new db[(_0xd373('0x64'))][(_0xd373('0x65'))](_0xd373('0x66'));}return rp(_0x6c7c8d);}})[_0xd373('0x22')](function(_0x53c0a7){if(_0x53c0a7){var _0xb01a00=['subject',_0xd373('0x67'),'group','assignee'];_[_0xd373('0x68')](_0x53c0a7[_0xd373('0x5e')],function(_0x1cff58){return _0xb01a00[_0xd373('0x69')](_0x1cff58['type']);});return{'count':_0x53c0a7['ticket_fields'][_0xd373('0x34')],'rows':_[_0xd373('0x2a')](_0x53c0a7[_0xd373('0x5e')],function(_0x25bf55){return{'id':_0x25bf55['id'],'name':_0x25bf55[_0xd373('0x6a')]>0x7?_0x25bf55[_0xd373('0x6b')]:_0x25bf55[_0xd373('0x2c')],'custom':_0x25bf55[_0xd373('0x6a')]>0x7?!![]:![],'options':_0x25bf55[_0xd373('0x6c')]?_0x25bf55[_0xd373('0x6c')]:_0x25bf55['custom_field_options']?_0x25bf55[_0xd373('0x6d')]:[]};})};}})[_0xd373('0x22')](respondWithResult(_0x5c5855,null))[_0xd373('0x41')](function(_0xa77a42){var _0x9bdd39=_0x237f15[_0xd373('0x2f')][_0xd373('0x6e')]?0x1f4:_0xa77a42['statusCode']||0x1f4;logger[_0xd373('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x9bdd39,JSON[_0xd373('0x6f')](_0xa77a42));delete _0xa77a42[_0xd373('0x27')];if(_0x9bdd39===0x191){_0x9bdd39=0x190;}_0x5c5855[_0xd373('0x15')](_0x9bdd39)[_0xd373('0x28')](_0x237f15[_0xd373('0x2f')][_0xd373('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0xa77a42[_0xd373('0x70')]}:_0xa77a42);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index c8a87a7..6990544 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 _0x67b3=['util','../../config/logger','moment','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','int_zendesk_accounts'];(function(_0x276737,_0x21d994){var _0x55c4a0=function(_0x41513e){while(--_0x41513e){_0x276737['push'](_0x276737['shift']());}};_0x55c4a0(++_0x21d994);}(_0x67b3,0xbd));var _0x367b=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x67b3[_0x503950];return _0x1657a9;};'use strict';var _=require('lodash');var util=require(_0x367b('0x0'));var logger=require(_0x367b('0x1'))('api');var moment=require(_0x367b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x367b('0x3'));var rimraf=require(_0x367b('0x4'));var config=require('../../config/environment');var attributes=require(_0x367b('0x5'));var integrations=require(_0x367b('0x6'));module['exports']=function(_0x159987,_0x526224){return _0x159987['define'](_0x367b('0x7'),attributes,{'tableName':_0x367b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf34=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','exports'];(function(_0x518cbc,_0x38c63c){var _0x2a2a5f=function(_0x2e51e0){while(--_0x2e51e0){_0x518cbc['push'](_0x518cbc['shift']());}};_0x2a2a5f(++_0x38c63c);}(_0xaf34,0xce));var _0x4af3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaf34[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4af3('0x0'));var util=require(_0x4af3('0x1'));var logger=require(_0x4af3('0x2'))('api');var moment=require(_0x4af3('0x3'));var BPromise=require(_0x4af3('0x4'));var rp=require(_0x4af3('0x5'));var fs=require('fs');var path=require(_0x4af3('0x6'));var rimraf=require('rimraf');var config=require(_0x4af3('0x7'));var attributes=require(_0x4af3('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4af3('0x9')]=function(_0x19e566,_0x17bfd1){return _0x19e566['define'](_0x4af3('0xa'),attributes,{'tableName':_0x4af3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 9c69961..0924ab3 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 _0xfcb2=['where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetZendeskAccount','findAll','options','raw','limit','include','map','model','attributes','then','debug','stringify','ShowZendeskAccount','ZendeskAccount'];(function(_0x1c446a,_0x3b3ad2){var _0x899e24=function(_0x579843){while(--_0x579843){_0x1c446a['push'](_0x1c446a['shift']());}};_0x899e24(++_0x3b3ad2);}(_0xfcb2,0x1ae));var _0x2fcb=function(_0x2002a1,_0xf28a29){_0x2002a1=_0x2002a1-0x0;var _0xb11bea=_0xfcb2[_0x2002a1];return _0xb11bea;};'use strict';var _=require('lodash');var util=require(_0x2fcb('0x0'));var moment=require(_0x2fcb('0x1'));var BPromise=require(_0x2fcb('0x2'));var rs=require(_0x2fcb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fcb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fcb('0x5'))(_0x2fcb('0x6'));var config=require(_0x2fcb('0x7'));var jayson=require(_0x2fcb('0x8'));var client=jayson['client'][_0x2fcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x296360,_0x3c1be3,_0x16eedc){return new BPromise(function(_0x1d819c,_0x132f35){return client[_0x2fcb('0xa')](_0x296360,_0x16eedc)['then'](function(_0x104064){logger[_0x2fcb('0xb')](_0x2fcb('0xc'),_0x3c1be3,'request\x20sent');logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3c1be3,_0x2fcb('0xd'),JSON['stringify'](_0x104064));if(_0x104064[_0x2fcb('0xe')]){if(_0x104064[_0x2fcb('0xe')][_0x2fcb('0xf')]===0x1f4){logger[_0x2fcb('0xe')](_0x2fcb('0xc'),_0x3c1be3,_0x104064[_0x2fcb('0xe')][_0x2fcb('0x10')]);return _0x132f35(_0x104064[_0x2fcb('0xe')][_0x2fcb('0x10')]);}logger[_0x2fcb('0xe')](_0x2fcb('0xc'),_0x3c1be3,_0x104064[_0x2fcb('0xe')][_0x2fcb('0x10')]);return _0x1d819c(_0x104064[_0x2fcb('0xe')][_0x2fcb('0x10')]);}else{logger[_0x2fcb('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x3c1be3,_0x2fcb('0xd'));_0x1d819c(_0x104064['result'][_0x2fcb('0x10')]);}})[_0x2fcb('0x11')](function(_0x499e60){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3c1be3,_0x499e60);_0x132f35(_0x499e60);});});}exports[_0x2fcb('0x12')]=function(_0x5d49b8){var _0x42c87c=this;return new Promise(function(_0x7c0dd,_0x13c3b9){return db['ZendeskAccount'][_0x2fcb('0x13')]({'raw':_0x5d49b8[_0x2fcb('0x14')]?_0x5d49b8[_0x2fcb('0x14')][_0x2fcb('0x15')]===undefined?!![]:![]:!![],'where':_0x5d49b8[_0x2fcb('0x14')]?_0x5d49b8[_0x2fcb('0x14')]['where']||null:null,'attributes':_0x5d49b8[_0x2fcb('0x14')]?_0x5d49b8['options']['attributes']||null:null,'limit':_0x5d49b8[_0x2fcb('0x14')]?_0x5d49b8[_0x2fcb('0x14')][_0x2fcb('0x16')]||null:null,'include':_0x5d49b8[_0x2fcb('0x14')]?_0x5d49b8[_0x2fcb('0x14')][_0x2fcb('0x17')]?_[_0x2fcb('0x18')](_0x5d49b8[_0x2fcb('0x14')][_0x2fcb('0x17')],function(_0x259d2d){return{'model':db[_0x259d2d[_0x2fcb('0x19')]],'as':_0x259d2d['as'],'attributes':_0x259d2d['attributes'],'include':_0x259d2d[_0x2fcb('0x17')]?_[_0x2fcb('0x18')](_0x259d2d[_0x2fcb('0x17')],function(_0x5488c2){return{'model':db[_0x5488c2['model']],'as':_0x5488c2['as'],'attributes':_0x5488c2[_0x2fcb('0x1a')],'include':_0x5488c2[_0x2fcb('0x17')]?_['map'](_0x5488c2[_0x2fcb('0x17')],function(_0x28797a){return{'model':db[_0x28797a[_0x2fcb('0x19')]],'as':_0x28797a['as'],'attributes':_0x28797a[_0x2fcb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2fcb('0x1b')](function(_0x3e05c9){logger[_0x2fcb('0xb')](_0x2fcb('0x12'),_0x5d49b8);logger[_0x2fcb('0x1c')](_0x2fcb('0x12'),_0x5d49b8,JSON[_0x2fcb('0x1d')](_0x3e05c9));_0x7c0dd(_0x3e05c9);})['catch'](function(_0x481d3c){logger[_0x2fcb('0xe')](_0x2fcb('0x12'),_0x481d3c['message'],_0x5d49b8);_0x13c3b9(_0x42c87c[_0x2fcb('0xe')](0x1f4,_0x481d3c['message']));});});};exports[_0x2fcb('0x1e')]=function(_0x4fd28e){var _0x587361=this;return new Promise(function(_0x14d7c3,_0x58bf56){return db[_0x2fcb('0x1f')]['find']({'raw':_0x4fd28e[_0x2fcb('0x14')]?_0x4fd28e[_0x2fcb('0x14')][_0x2fcb('0x15')]===undefined?!![]:![]:!![],'where':_0x4fd28e[_0x2fcb('0x14')]?_0x4fd28e[_0x2fcb('0x14')][_0x2fcb('0x20')]||null:null,'attributes':_0x4fd28e[_0x2fcb('0x14')]?_0x4fd28e['options'][_0x2fcb('0x1a')]||null:null,'include':_0x4fd28e[_0x2fcb('0x14')]?_0x4fd28e[_0x2fcb('0x14')]['include']?_['map'](_0x4fd28e['options'][_0x2fcb('0x17')],function(_0xb8a013){return{'model':db[_0xb8a013['model']],'as':_0xb8a013['as'],'attributes':_0xb8a013[_0x2fcb('0x1a')],'include':_0xb8a013[_0x2fcb('0x17')]?_[_0x2fcb('0x18')](_0xb8a013['include'],function(_0x54c28e){return{'model':db[_0x54c28e['model']],'as':_0x54c28e['as'],'attributes':_0x54c28e[_0x2fcb('0x1a')],'include':_0x54c28e[_0x2fcb('0x17')]?_[_0x2fcb('0x18')](_0x54c28e[_0x2fcb('0x17')],function(_0x5dd771){return{'model':db[_0x5dd771['model']],'as':_0x5dd771['as'],'attributes':_0x5dd771[_0x2fcb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2fcb('0x1b')](function(_0xd607d2){logger['info']('ShowZendeskAccount',_0x4fd28e);logger[_0x2fcb('0x1c')](_0x2fcb('0x1e'),_0x4fd28e,JSON[_0x2fcb('0x1d')](_0xd607d2));_0x14d7c3(_0xd607d2);})['catch'](function(_0x405018){logger['error'](_0x2fcb('0x1e'),_0x405018[_0x2fcb('0x10')],_0x4fd28e);_0x58bf56(_0x587361[_0x2fcb('0xe')](0x1f4,_0x405018[_0x2fcb('0x10')]));});});}; \ No newline at end of file +var _0x8028=['result','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','include','map','model','debug','ShowZendeskAccount','util','bluebird','ioredis','../../mysqldb','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x8028,0xcc));var _0x8802=function(_0x383939,_0x2f6e17){_0x383939=_0x383939-0x0;var _0x5b0b68=_0x8028[_0x383939];return _0x5b0b68;};'use strict';var _=require('lodash');var util=require(_0x8802('0x0'));var moment=require('moment');var BPromise=require(_0x8802('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8802('0x2'));var db=require(_0x8802('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1f36,_0x5604c6,_0x559a1e){return new BPromise(function(_0x5ea559,_0x250b29){return client['request'](_0x4d1f36,_0x559a1e)[_0x8802('0x4')](function(_0x17cc41){logger[_0x8802('0x5')](_0x8802('0x6'),_0x5604c6,_0x8802('0x7'));logger['debug'](_0x8802('0x8'),_0x5604c6,'request\x20sent',JSON[_0x8802('0x9')](_0x17cc41));if(_0x17cc41[_0x8802('0xa')]){if(_0x17cc41['error']['code']===0x1f4){logger[_0x8802('0xa')](_0x8802('0x6'),_0x5604c6,_0x17cc41[_0x8802('0xa')][_0x8802('0xb')]);return _0x250b29(_0x17cc41['error'][_0x8802('0xb')]);}logger[_0x8802('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x5604c6,_0x17cc41['error']['message']);return _0x5ea559(_0x17cc41['error'][_0x8802('0xb')]);}else{logger[_0x8802('0x5')]('ZendeskAccount,\x20%s,\x20%s',_0x5604c6,_0x8802('0x7'));_0x5ea559(_0x17cc41[_0x8802('0xc')]['message']);}})['catch'](function(_0x132f3b){logger[_0x8802('0xa')](_0x8802('0x6'),_0x5604c6,_0x132f3b);_0x250b29(_0x132f3b);});});}exports[_0x8802('0xd')]=function(_0x2e414e){var _0x4945d2=this;return new Promise(function(_0x378b7c,_0x5bf6b6){return db[_0x8802('0xe')][_0x8802('0xf')]({'raw':_0x2e414e[_0x8802('0x10')]?_0x2e414e[_0x8802('0x10')]['raw']===undefined?!![]:![]:!![],'where':_0x2e414e[_0x8802('0x10')]?_0x2e414e[_0x8802('0x10')][_0x8802('0x11')]||null:null,'attributes':_0x2e414e['options']?_0x2e414e[_0x8802('0x10')][_0x8802('0x12')]||null:null,'limit':_0x2e414e['options']?_0x2e414e[_0x8802('0x10')]['limit']||null:null,'include':_0x2e414e['options']?_0x2e414e[_0x8802('0x10')][_0x8802('0x13')]?_[_0x8802('0x14')](_0x2e414e['options'][_0x8802('0x13')],function(_0x220165){return{'model':db[_0x220165[_0x8802('0x15')]],'as':_0x220165['as'],'attributes':_0x220165[_0x8802('0x12')],'include':_0x220165['include']?_[_0x8802('0x14')](_0x220165[_0x8802('0x13')],function(_0x4c9120){return{'model':db[_0x4c9120['model']],'as':_0x4c9120['as'],'attributes':_0x4c9120[_0x8802('0x12')],'include':_0x4c9120[_0x8802('0x13')]?_[_0x8802('0x14')](_0x4c9120[_0x8802('0x13')],function(_0x2749b4){return{'model':db[_0x2749b4[_0x8802('0x15')]],'as':_0x2749b4['as'],'attributes':_0x2749b4[_0x8802('0x12')]};}):[]};}):[]};}):[]:[]})[_0x8802('0x4')](function(_0x109d57){logger[_0x8802('0x5')](_0x8802('0xd'),_0x2e414e);logger[_0x8802('0x16')](_0x8802('0xd'),_0x2e414e,JSON['stringify'](_0x109d57));_0x378b7c(_0x109d57);})['catch'](function(_0x466c18){logger[_0x8802('0xa')]('GetZendeskAccount',_0x466c18['message'],_0x2e414e);_0x5bf6b6(_0x4945d2['error'](0x1f4,_0x466c18['message']));});});};exports[_0x8802('0x17')]=function(_0x164619){var _0x482405=this;return new Promise(function(_0x4da803,_0x439b52){return db[_0x8802('0xe')]['find']({'raw':_0x164619[_0x8802('0x10')]?_0x164619[_0x8802('0x10')]['raw']===undefined?!![]:![]:!![],'where':_0x164619[_0x8802('0x10')]?_0x164619['options']['where']||null:null,'attributes':_0x164619[_0x8802('0x10')]?_0x164619['options'][_0x8802('0x12')]||null:null,'include':_0x164619[_0x8802('0x10')]?_0x164619[_0x8802('0x10')][_0x8802('0x13')]?_[_0x8802('0x14')](_0x164619[_0x8802('0x10')][_0x8802('0x13')],function(_0x1098ee){return{'model':db[_0x1098ee[_0x8802('0x15')]],'as':_0x1098ee['as'],'attributes':_0x1098ee['attributes'],'include':_0x1098ee[_0x8802('0x13')]?_[_0x8802('0x14')](_0x1098ee[_0x8802('0x13')],function(_0x20a7ab){return{'model':db[_0x20a7ab[_0x8802('0x15')]],'as':_0x20a7ab['as'],'attributes':_0x20a7ab[_0x8802('0x12')],'include':_0x20a7ab['include']?_[_0x8802('0x14')](_0x20a7ab[_0x8802('0x13')],function(_0x15694f){return{'model':db[_0x15694f['model']],'as':_0x15694f['as'],'attributes':_0x15694f['attributes']};}):[]};}):[]};}):[]:[]})[_0x8802('0x4')](function(_0x511880){logger[_0x8802('0x5')](_0x8802('0x17'),_0x164619);logger['debug'](_0x8802('0x17'),_0x164619,JSON['stringify'](_0x511880));_0x4da803(_0x511880);})['catch'](function(_0x2a5148){logger[_0x8802('0xa')]('ShowZendeskAccount',_0x2a5148['message'],_0x164619);_0x439b52(_0x482405[_0x8802('0xa')](0x1f4,_0x2a5148[_0x8802('0xb')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 8a77b59..f17077e 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 _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0xb688,0xcf));var _0x8b68=function(_0xeda7fa,_0x4d023d){_0xeda7fa=_0xeda7fa-0x0;var _0x11b03f=_0xb688[_0xeda7fa];return _0x11b03f;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file +var _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x135d65,_0x4f8567){var _0x48b99e=function(_0x1a587c){while(--_0x1a587c){_0x135d65['push'](_0x135d65['shift']());}};_0x48b99e(++_0x4f8567);}(_0x91a7,0xe7));var _0x791a=function(_0x5bf8de,_0x5ef5cc){_0x5bf8de=_0x5bf8de-0x0;var _0x47160c=_0x91a7[_0x5bf8de];return _0x47160c;};'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['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5c8510e..b95c351 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 _0xd986=['exports','STRING','sequelize'];(function(_0x3a37a8,_0x392600){var _0x4bd38e=function(_0x384576){while(--_0x384576){_0x3a37a8['push'](_0x3a37a8['shift']());}};_0x4bd38e(++_0x392600);}(_0xd986,0x128));var _0x6d98=function(_0x3c8edb,_0x259488){_0x3c8edb=_0x3c8edb-0x0;var _0x5c2646=_0xd986[_0x3c8edb];return _0x5c2646;};'use strict';var Sequelize=require(_0x6d98('0x0'));module[_0x6d98('0x1')]={'name':{'type':Sequelize[_0x6d98('0x2')]},'description':{'type':Sequelize[_0x6d98('0x2')]}}; \ No newline at end of file +var _0xdf3c=['STRING','exports'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xdf3c,0xf9));var _0xcdf3=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xdf3c[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require('sequelize');module[_0xcdf3('0x0')]={'name':{'type':Sequelize[_0xcdf3('0x1')]},'description':{'type':Sequelize[_0xcdf3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d1699b7..1c78d49 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 _0x7833=['index','ZendeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','name'];(function(_0x2a2c10,_0x2f43f8){var _0x4a112e=function(_0x12ecac){while(--_0x12ecac){_0x2a2c10['push'](_0x2a2c10['shift']());}};_0x4a112e(++_0x2f43f8);}(_0x7833,0x169));var _0x3783=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x7833[_0x946518];return _0x909b69;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3783('0x0'));var jsonpatch=require(_0x3783('0x1'));var rp=require(_0x3783('0x2'));var moment=require(_0x3783('0x3'));var BPromise=require(_0x3783('0x4'));var Mustache=require(_0x3783('0x5'));var util=require(_0x3783('0x6'));var path=require(_0x3783('0x7'));var sox=require('sox');var csv=require(_0x3783('0x8'));var ejs=require(_0x3783('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3783('0xa'));var squel=require(_0x3783('0xb'));var crypto=require(_0x3783('0xc'));var jsforce=require(_0x3783('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3783('0x8'));var querystring=require('querystring');var Papa=require(_0x3783('0xe'));var Redis=require('ioredis');var authService=require(_0x3783('0xf'));var qs=require(_0x3783('0x10'));var as=require(_0x3783('0x11'));var hardwareService=require(_0x3783('0x12'));var logger=require('../../config/logger')(_0x3783('0x13'));var utils=require(_0x3783('0x14'));var config=require(_0x3783('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x128409,_0x542c2c){_0x542c2c=_0x542c2c||0xcc;return function(_0x2fbacb){if(_0x2fbacb){return _0x128409[_0x3783('0x16')](_0x542c2c);}return _0x128409[_0x3783('0x17')](_0x542c2c)[_0x3783('0x18')]();};}function respondWithResult(_0x16bedc,_0x29d107){_0x29d107=_0x29d107||0xc8;return function(_0x497cdb){if(_0x497cdb){return _0x16bedc['status'](_0x29d107)['json'](_0x497cdb);}};}function respondWithFilteredResult(_0x2a30f9,_0x1f1d30){return function(_0x65f5e0){if(_0x65f5e0){var _0x5ab7d5=typeof _0x1f1d30[_0x3783('0x19')]===_0x3783('0x1a')&&typeof _0x1f1d30[_0x3783('0x1b')]===_0x3783('0x1a');var _0x53843e=_0x65f5e0[_0x3783('0x1c')];var _0x55ec1a=_0x5ab7d5?0x0:_0x1f1d30[_0x3783('0x19')];var _0x3969ea=_0x5ab7d5?_0x65f5e0['count']:_0x1f1d30[_0x3783('0x19')]+_0x1f1d30[_0x3783('0x1b')];var _0x8ea0f5;if(_0x3969ea>=_0x53843e){_0x3969ea=_0x53843e;_0x8ea0f5=0xc8;}else{_0x8ea0f5=0xce;}_0x2a30f9[_0x3783('0x17')](_0x8ea0f5);return _0x2a30f9[_0x3783('0x1d')](_0x3783('0x1e'),_0x55ec1a+'-'+_0x3969ea+'/'+_0x53843e)[_0x3783('0x1f')](_0x65f5e0);}return null;};}function patchUpdates(_0x2c3f55){return function(_0x15b2bc){try{jsonpatch[_0x3783('0x20')](_0x15b2bc,_0x2c3f55,!![]);}catch(_0x4e0eb2){return BPromise['reject'](_0x4e0eb2);}return _0x15b2bc[_0x3783('0x21')]();};}function saveUpdates(_0x4e9519,_0x9c79e6){return function(_0x4f8b11){if(_0x4f8b11){return _0x4f8b11[_0x3783('0x22')](_0x4e9519)[_0x3783('0x23')](function(_0x6d2172){return _0x6d2172;});}return null;};}function removeEntity(_0x5cca63,_0x11e058){return function(_0x418140){if(_0x418140){return _0x418140[_0x3783('0x24')]()[_0x3783('0x23')](function(){_0x5cca63[_0x3783('0x17')](0xcc)[_0x3783('0x18')]();});}};}function handleEntityNotFound(_0x5cbd39,_0x438af8){return function(_0x2c8f39){if(!_0x2c8f39){_0x5cbd39[_0x3783('0x16')](0x194);}return _0x2c8f39;};}function handleError(_0x2ce316,_0x4f7cf0){_0x4f7cf0=_0x4f7cf0||0x1f4;return function(_0x2ade90){logger[_0x3783('0x25')](_0x2ade90['stack']);if(_0x2ade90[_0x3783('0x26')]){delete _0x2ade90[_0x3783('0x26')];}_0x2ce316[_0x3783('0x17')](_0x4f7cf0)['send'](_0x2ade90);};}exports[_0x3783('0x27')]=function(_0x1d016a,_0x272219){var _0x2939d0={},_0x1ce7d7={},_0x280ba0={'count':0x0,'rows':[]};var _0x50f51c=_['map'](db[_0x3783('0x28')][_0x3783('0x29')],function(_0x288a91){return{'name':_0x288a91[_0x3783('0x2a')],'type':_0x288a91[_0x3783('0x2b')][_0x3783('0x2c')]};});_0x1ce7d7['model']=_[_0x3783('0x2d')](_0x50f51c,_0x3783('0x26'));_0x1ce7d7[_0x3783('0x2e')]=_[_0x3783('0x2f')](_0x1d016a[_0x3783('0x2e')]);_0x1ce7d7['filters']=_[_0x3783('0x30')](_0x1ce7d7[_0x3783('0x31')],_0x1ce7d7[_0x3783('0x2e')]);_0x2939d0[_0x3783('0x32')]=_[_0x3783('0x30')](_0x1ce7d7[_0x3783('0x31')],qs['fields'](_0x1d016a[_0x3783('0x2e')][_0x3783('0x33')]));_0x2939d0[_0x3783('0x32')]=_0x2939d0[_0x3783('0x32')][_0x3783('0x34')]?_0x2939d0[_0x3783('0x32')]:_0x1ce7d7[_0x3783('0x31')];if(!_0x1d016a[_0x3783('0x2e')][_0x3783('0x35')](_0x3783('0x36'))){_0x2939d0[_0x3783('0x1b')]=qs['limit'](_0x1d016a['query'][_0x3783('0x1b')]);_0x2939d0[_0x3783('0x19')]=qs[_0x3783('0x19')](_0x1d016a[_0x3783('0x2e')][_0x3783('0x19')]);}_0x2939d0[_0x3783('0x37')]=qs['sort'](_0x1d016a[_0x3783('0x2e')][_0x3783('0x38')]);_0x2939d0['where']=qs[_0x3783('0x39')](_[_0x3783('0x3a')](_0x1d016a['query'],_0x1ce7d7[_0x3783('0x39')]),_0x50f51c);if(_0x1d016a['query'][_0x3783('0x3b')]){_0x2939d0[_0x3783('0x3c')]=_[_0x3783('0x3d')](_0x2939d0[_0x3783('0x3c')],{'$or':_[_0x3783('0x2d')](_0x50f51c,function(_0x1807a3){if(_0x1807a3[_0x3783('0x2b')]!=='VIRTUAL'){var _0x392825={};_0x392825[_0x1807a3[_0x3783('0x26')]]={'$like':'%'+_0x1d016a['query'][_0x3783('0x3b')]+'%'};return _0x392825;}})});}_0x2939d0=_[_0x3783('0x3d')]({},_0x2939d0,_0x1d016a[_0x3783('0x3e')]);var _0x447c36={'where':_0x2939d0[_0x3783('0x3c')]};return db[_0x3783('0x28')][_0x3783('0x1c')](_0x447c36)[_0x3783('0x23')](function(_0x5687e3){_0x280ba0['count']=_0x5687e3;if(_0x1d016a[_0x3783('0x2e')][_0x3783('0x3f')]){_0x2939d0['include']=[{'all':!![]}];}return db[_0x3783('0x28')][_0x3783('0x40')](_0x2939d0);})[_0x3783('0x23')](function(_0x4ce564){_0x280ba0[_0x3783('0x41')]=_0x4ce564;return _0x280ba0;})[_0x3783('0x23')](respondWithFilteredResult(_0x272219,_0x2939d0))[_0x3783('0x42')](handleError(_0x272219,null));};exports[_0x3783('0x43')]=function(_0x55b54d,_0x16ce86){var _0x524d3b={'raw':![],'where':{'id':_0x55b54d[_0x3783('0x44')]['id']}},_0x5dd05e={};_0x5dd05e[_0x3783('0x31')]=_['keys'](db[_0x3783('0x28')][_0x3783('0x29')]);_0x5dd05e[_0x3783('0x2e')]=_[_0x3783('0x2f')](_0x55b54d[_0x3783('0x2e')]);_0x5dd05e[_0x3783('0x39')]=_['intersection'](_0x5dd05e[_0x3783('0x31')],_0x5dd05e[_0x3783('0x2e')]);_0x524d3b[_0x3783('0x32')]=_['intersection'](_0x5dd05e[_0x3783('0x31')],qs[_0x3783('0x33')](_0x55b54d['query'][_0x3783('0x33')]));_0x524d3b[_0x3783('0x32')]=_0x524d3b[_0x3783('0x32')][_0x3783('0x34')]?_0x524d3b[_0x3783('0x32')]:_0x5dd05e[_0x3783('0x31')];if(_0x55b54d['query'][_0x3783('0x3f')]){_0x524d3b['include']=[{'all':!![]}];}_0x524d3b=_[_0x3783('0x3d')]({},_0x524d3b,_0x55b54d[_0x3783('0x3e')]);return db['ZendeskConfiguration'][_0x3783('0x45')](_0x524d3b)[_0x3783('0x23')](handleEntityNotFound(_0x16ce86,null))[_0x3783('0x23')](respondWithResult(_0x16ce86,null))[_0x3783('0x42')](handleError(_0x16ce86,null));};exports[_0x3783('0x46')]=function(_0x2d4582,_0x4c24f6){return db[_0x3783('0x28')][_0x3783('0x46')](_0x2d4582[_0x3783('0x47')],{})[_0x3783('0x23')](respondWithResult(_0x4c24f6,0xc9))[_0x3783('0x42')](handleError(_0x4c24f6,null));};exports[_0x3783('0x22')]=function(_0x43cc5a,_0x569f83){if(_0x43cc5a[_0x3783('0x47')]['id']){delete _0x43cc5a[_0x3783('0x47')]['id'];}return db[_0x3783('0x28')][_0x3783('0x45')]({'where':{'id':_0x43cc5a['params']['id']}})['then'](handleEntityNotFound(_0x569f83,null))[_0x3783('0x23')](saveUpdates(_0x43cc5a['body'],null))[_0x3783('0x23')](respondWithResult(_0x569f83,null))['catch'](handleError(_0x569f83,null));};exports['destroy']=function(_0x34e057,_0x48aaa2){return db[_0x3783('0x28')][_0x3783('0x45')]({'where':{'id':_0x34e057[_0x3783('0x44')]['id']}})[_0x3783('0x23')](handleEntityNotFound(_0x48aaa2,null))[_0x3783('0x23')](removeEntity(_0x48aaa2,null))['catch'](handleError(_0x48aaa2,null));};exports[_0x3783('0x48')]=function(_0x52c568,_0x17edb8,_0x5e35bf){var _0x9babd7={};var _0x25e05d={};var _0x5a7f30;var _0x5d93ee;return db[_0x3783('0x28')][_0x3783('0x49')]({'where':{'id':_0x52c568['params']['id']}})['then'](handleEntityNotFound(_0x17edb8,null))['then'](function(_0x1c718c){if(_0x1c718c){_0x5a7f30=_0x1c718c;_0x25e05d[_0x3783('0x31')]=_[_0x3783('0x2f')](db['ZendeskField']['rawAttributes']);_0x25e05d[_0x3783('0x2e')]=_['keys'](_0x52c568[_0x3783('0x2e')]);_0x25e05d[_0x3783('0x39')]=_[_0x3783('0x30')](_0x25e05d['model'],_0x25e05d[_0x3783('0x2e')]);_0x9babd7[_0x3783('0x32')]=_[_0x3783('0x30')](_0x25e05d['model'],qs[_0x3783('0x33')](_0x52c568['query']['fields']));_0x9babd7[_0x3783('0x32')]=_0x9babd7[_0x3783('0x32')]['length']?_0x9babd7[_0x3783('0x32')]:_0x25e05d['model'];_0x9babd7[_0x3783('0x37')]=qs[_0x3783('0x38')](_0x52c568[_0x3783('0x2e')][_0x3783('0x38')]);_0x9babd7[_0x3783('0x3c')]=qs[_0x3783('0x39')](_[_0x3783('0x3a')](_0x52c568[_0x3783('0x2e')],_0x25e05d['filters']));if(_0x52c568[_0x3783('0x2e')][_0x3783('0x3b')]){_0x9babd7[_0x3783('0x3c')]=_[_0x3783('0x3d')](_0x9babd7[_0x3783('0x3c')],{'$or':_[_0x3783('0x2d')](_0x9babd7['attributes'],function(_0x3897de){var _0x142b6a={};_0x142b6a[_0x3897de]={'$like':'%'+_0x52c568['query'][_0x3783('0x3b')]+'%'};return _0x142b6a;})});}_0x9babd7=_['merge']({},_0x9babd7,_0x52c568[_0x3783('0x3e')]);return _0x5a7f30[_0x3783('0x48')](_0x9babd7);}})[_0x3783('0x23')](function(_0x38c68f){if(_0x38c68f){_0x5d93ee=_0x38c68f[_0x3783('0x34')];if(!_0x52c568[_0x3783('0x2e')][_0x3783('0x35')](_0x3783('0x36'))){_0x9babd7['limit']=qs[_0x3783('0x1b')](_0x52c568['query'][_0x3783('0x1b')]);_0x9babd7['offset']=qs[_0x3783('0x19')](_0x52c568[_0x3783('0x2e')][_0x3783('0x19')]);}return _0x5a7f30[_0x3783('0x48')](_0x9babd7);}})[_0x3783('0x23')](function(_0x3239b3){if(_0x3239b3){return _0x3239b3?{'count':_0x5d93ee,'rows':_0x3239b3}:null;}})['then'](respondWithResult(_0x17edb8,null))[_0x3783('0x42')](handleError(_0x17edb8,null));};exports['getSubjects']=function(_0x2670f2,_0x440631,_0x28688f){var _0x53a728={};var _0x49f41f={};var _0x2f0f41;var _0x3044f2;return db[_0x3783('0x28')]['findOne']({'where':{'id':_0x2670f2[_0x3783('0x44')]['id']}})[_0x3783('0x23')](handleEntityNotFound(_0x440631,null))[_0x3783('0x23')](function(_0xec2264){if(_0xec2264){_0x2f0f41=_0xec2264;_0x49f41f[_0x3783('0x31')]=_['keys'](db[_0x3783('0x4a')][_0x3783('0x29')]);_0x49f41f[_0x3783('0x2e')]=_[_0x3783('0x2f')](_0x2670f2['query']);_0x49f41f[_0x3783('0x39')]=_['intersection'](_0x49f41f[_0x3783('0x31')],_0x49f41f['query']);_0x53a728[_0x3783('0x32')]=_[_0x3783('0x30')](_0x49f41f[_0x3783('0x31')],qs[_0x3783('0x33')](_0x2670f2[_0x3783('0x2e')]['fields']));_0x53a728[_0x3783('0x32')]=_0x53a728[_0x3783('0x32')][_0x3783('0x34')]?_0x53a728[_0x3783('0x32')]:_0x49f41f[_0x3783('0x31')];_0x53a728[_0x3783('0x37')]=qs[_0x3783('0x38')](_0x2670f2[_0x3783('0x2e')][_0x3783('0x38')]);_0x53a728[_0x3783('0x3c')]=qs[_0x3783('0x39')](_[_0x3783('0x3a')](_0x2670f2['query'],_0x49f41f[_0x3783('0x39')]));if(_0x2670f2[_0x3783('0x2e')][_0x3783('0x3b')]){_0x53a728[_0x3783('0x3c')]=_['merge'](_0x53a728[_0x3783('0x3c')],{'$or':_[_0x3783('0x2d')](_0x53a728[_0x3783('0x32')],function(_0x4d4201){var _0x4532f8={};_0x4532f8[_0x4d4201]={'$like':'%'+_0x2670f2[_0x3783('0x2e')][_0x3783('0x3b')]+'%'};return _0x4532f8;})});}_0x53a728=_['merge']({},_0x53a728,_0x2670f2[_0x3783('0x3e')]);return _0x2f0f41[_0x3783('0x4b')](_0x53a728);}})[_0x3783('0x23')](function(_0x39ffa4){if(_0x39ffa4){_0x3044f2=_0x39ffa4[_0x3783('0x34')];if(!_0x2670f2[_0x3783('0x2e')][_0x3783('0x35')](_0x3783('0x36'))){_0x53a728[_0x3783('0x1b')]=qs[_0x3783('0x1b')](_0x2670f2[_0x3783('0x2e')][_0x3783('0x1b')]);_0x53a728[_0x3783('0x19')]=qs[_0x3783('0x19')](_0x2670f2['query']['offset']);}return _0x2f0f41[_0x3783('0x4b')](_0x53a728);}})['then'](function(_0x20c98f){if(_0x20c98f){return _0x20c98f?{'count':_0x3044f2,'rows':_0x20c98f}:null;}})[_0x3783('0x23')](respondWithResult(_0x440631,null))[_0x3783('0x42')](handleError(_0x440631,null));};exports[_0x3783('0x4c')]=function(_0x541ba2,_0x811035,_0x508435){var _0x3db879={};var _0x106e5a={};var _0x11fbc3;var _0x554ee9;return db[_0x3783('0x28')][_0x3783('0x49')]({'where':{'id':_0x541ba2[_0x3783('0x44')]['id']}})[_0x3783('0x23')](handleEntityNotFound(_0x811035,null))['then'](function(_0x3d0fb1){if(_0x3d0fb1){_0x11fbc3=_0x3d0fb1;_0x106e5a[_0x3783('0x31')]=_[_0x3783('0x2f')](db['ZendeskField'][_0x3783('0x29')]);_0x106e5a[_0x3783('0x2e')]=_[_0x3783('0x2f')](_0x541ba2['query']);_0x106e5a[_0x3783('0x39')]=_['intersection'](_0x106e5a[_0x3783('0x31')],_0x106e5a['query']);_0x3db879[_0x3783('0x32')]=_[_0x3783('0x30')](_0x106e5a[_0x3783('0x31')],qs[_0x3783('0x33')](_0x541ba2[_0x3783('0x2e')][_0x3783('0x33')]));_0x3db879[_0x3783('0x32')]=_0x3db879[_0x3783('0x32')]['length']?_0x3db879[_0x3783('0x32')]:_0x106e5a['model'];_0x3db879['order']=qs[_0x3783('0x38')](_0x541ba2[_0x3783('0x2e')][_0x3783('0x38')]);_0x3db879[_0x3783('0x3c')]=qs[_0x3783('0x39')](_[_0x3783('0x3a')](_0x541ba2['query'],_0x106e5a[_0x3783('0x39')]));if(_0x541ba2[_0x3783('0x2e')][_0x3783('0x3b')]){_0x3db879['where']=_[_0x3783('0x3d')](_0x3db879[_0x3783('0x3c')],{'$or':_[_0x3783('0x2d')](_0x3db879[_0x3783('0x32')],function(_0x39bcdb){var _0x421f76={};_0x421f76[_0x39bcdb]={'$like':'%'+_0x541ba2[_0x3783('0x2e')][_0x3783('0x3b')]+'%'};return _0x421f76;})});}_0x3db879=_[_0x3783('0x3d')]({},_0x3db879,_0x541ba2[_0x3783('0x3e')]);return _0x11fbc3['getDescriptions'](_0x3db879);}})[_0x3783('0x23')](function(_0x5164ba){if(_0x5164ba){_0x554ee9=_0x5164ba[_0x3783('0x34')];if(!_0x541ba2[_0x3783('0x2e')][_0x3783('0x35')]('nolimit')){_0x3db879[_0x3783('0x1b')]=qs[_0x3783('0x1b')](_0x541ba2[_0x3783('0x2e')]['limit']);_0x3db879[_0x3783('0x19')]=qs[_0x3783('0x19')](_0x541ba2[_0x3783('0x2e')]['offset']);}return _0x11fbc3['getDescriptions'](_0x3db879);}})[_0x3783('0x23')](function(_0x384414){if(_0x384414){return _0x384414?{'count':_0x554ee9,'rows':_0x384414}:null;}})['then'](respondWithResult(_0x811035,null))['catch'](handleError(_0x811035,null));};exports[_0x3783('0x4d')]=function(_0x14f444,_0x107889,_0x5472f1){var _0x1b760a={};var _0x452be3={};var _0x27422f;var _0xde5106;return db[_0x3783('0x28')][_0x3783('0x49')]({'where':{'id':_0x14f444[_0x3783('0x44')]['id']}})[_0x3783('0x23')](handleEntityNotFound(_0x107889,null))[_0x3783('0x23')](function(_0x3bb432){if(_0x3bb432){_0x27422f=_0x3bb432;_0x452be3['model']=_[_0x3783('0x2f')](db['Tag'][_0x3783('0x29')]);_0x452be3[_0x3783('0x2e')]=_[_0x3783('0x2f')](_0x14f444[_0x3783('0x2e')]);_0x452be3[_0x3783('0x39')]=_[_0x3783('0x30')](_0x452be3[_0x3783('0x31')],_0x452be3['query']);_0x1b760a['attributes']=_['intersection'](_0x452be3[_0x3783('0x31')],qs[_0x3783('0x33')](_0x14f444['query'][_0x3783('0x33')]));_0x1b760a[_0x3783('0x32')]=_0x1b760a['attributes'][_0x3783('0x34')]?_0x1b760a[_0x3783('0x32')]:_0x452be3[_0x3783('0x31')];_0x1b760a['order']=qs['sort'](_0x14f444[_0x3783('0x2e')][_0x3783('0x38')]);_0x1b760a[_0x3783('0x3c')]=qs[_0x3783('0x39')](_[_0x3783('0x3a')](_0x14f444['query'],_0x452be3[_0x3783('0x39')]));if(_0x14f444[_0x3783('0x2e')][_0x3783('0x3b')]){_0x1b760a['where']=_[_0x3783('0x3d')](_0x1b760a[_0x3783('0x3c')],{'$or':_[_0x3783('0x2d')](_0x1b760a[_0x3783('0x32')],function(_0x16f316){var _0x2ddde9={};_0x2ddde9[_0x16f316]={'$like':'%'+_0x14f444[_0x3783('0x2e')][_0x3783('0x3b')]+'%'};return _0x2ddde9;})});}_0x1b760a=_[_0x3783('0x3d')]({},_0x1b760a,_0x14f444[_0x3783('0x3e')]);return _0x27422f['getTags'](_0x1b760a);}})[_0x3783('0x23')](function(_0x4179a4){if(_0x4179a4){_0xde5106=_0x4179a4[_0x3783('0x34')];if(!_0x14f444[_0x3783('0x2e')][_0x3783('0x35')](_0x3783('0x36'))){_0x1b760a['limit']=qs['limit'](_0x14f444['query'][_0x3783('0x1b')]);_0x1b760a[_0x3783('0x19')]=qs[_0x3783('0x19')](_0x14f444[_0x3783('0x2e')]['offset']);}return _0x27422f['getTags'](_0x1b760a);}})[_0x3783('0x23')](function(_0x37c54f){if(_0x37c54f){return _0x37c54f?{'count':_0xde5106,'rows':_0x37c54f}:null;}})[_0x3783('0x23')](respondWithResult(_0x107889,null))[_0x3783('0x42')](handleError(_0x107889,null));};exports[_0x3783('0x4e')]=function(_0x33c56f,_0x4b54cb,_0x1c774d){if(_0x33c56f['body']['id']){delete _0x33c56f[_0x3783('0x47')]['id'];}return db[_0x3783('0x28')]['findOne']({'where':{'id':_0x33c56f[_0x3783('0x44')]['id']}})[_0x3783('0x23')](handleEntityNotFound(_0x4b54cb,null))[_0x3783('0x23')](function(_0x19d288){if(_0x19d288){return _0x19d288['setTags'](_0x33c56f[_0x3783('0x47')][_0x3783('0x4f')]||[]);}return null;})[_0x3783('0x23')](respondWithResult(_0x4b54cb,null))['catch'](handleError(_0x4b54cb,null));}; \ No newline at end of file +var _0x1186=['getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','index','ZendeskConfiguration','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','merge','find','create','body','params'];(function(_0x33ac12,_0x9ef3a){var _0x33e5ed=function(_0xa2dd7){while(--_0xa2dd7){_0x33ac12['push'](_0x33ac12['shift']());}};_0x33e5ed(++_0x9ef3a);}(_0x1186,0xa8));var _0x6118=function(_0x147cd4,_0x280d10){_0x147cd4=_0x147cd4-0x0;var _0x5b9e66=_0x1186[_0x147cd4];return _0x5b9e66;};'use strict';var emlformat=require(_0x6118('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6118('0x1'));var rp=require('request-promise');var moment=require(_0x6118('0x2'));var BPromise=require(_0x6118('0x3'));var Mustache=require(_0x6118('0x4'));var util=require(_0x6118('0x5'));var path=require('path');var sox=require(_0x6118('0x6'));var csv=require(_0x6118('0x7'));var ejs=require(_0x6118('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6118('0x9'));var squel=require(_0x6118('0xa'));var crypto=require(_0x6118('0xb'));var jsforce=require(_0x6118('0xc'));var deskjs=require(_0x6118('0xd'));var toCsv=require(_0x6118('0x7'));var querystring=require(_0x6118('0xe'));var Papa=require('papaparse');var Redis=require(_0x6118('0xf'));var authService=require(_0x6118('0x10'));var qs=require(_0x6118('0x11'));var as=require(_0x6118('0x12'));var hardwareService=require(_0x6118('0x13'));var logger=require(_0x6118('0x14'))(_0x6118('0x15'));var utils=require(_0x6118('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6118('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x550a19,_0x213570){_0x213570=_0x213570||0xcc;return function(_0x19ef47){if(_0x19ef47){return _0x550a19['sendStatus'](_0x213570);}return _0x550a19[_0x6118('0x18')](_0x213570)[_0x6118('0x19')]();};}function respondWithResult(_0x3bf1df,_0x4a1b9f){_0x4a1b9f=_0x4a1b9f||0xc8;return function(_0x44f883){if(_0x44f883){return _0x3bf1df[_0x6118('0x18')](_0x4a1b9f)[_0x6118('0x1a')](_0x44f883);}};}function respondWithFilteredResult(_0x3b7320,_0x300499){return function(_0x440da9){if(_0x440da9){var _0x2a0d16=typeof _0x300499[_0x6118('0x1b')]===_0x6118('0x1c')&&typeof _0x300499[_0x6118('0x1d')]===_0x6118('0x1c');var _0x503447=_0x440da9[_0x6118('0x1e')];var _0x3c9f41=_0x2a0d16?0x0:_0x300499[_0x6118('0x1b')];var _0x4489f4=_0x2a0d16?_0x440da9[_0x6118('0x1e')]:_0x300499[_0x6118('0x1b')]+_0x300499[_0x6118('0x1d')];var _0x379235;if(_0x4489f4>=_0x503447){_0x4489f4=_0x503447;_0x379235=0xc8;}else{_0x379235=0xce;}_0x3b7320[_0x6118('0x18')](_0x379235);return _0x3b7320[_0x6118('0x1f')]('Content-Range',_0x3c9f41+'-'+_0x4489f4+'/'+_0x503447)[_0x6118('0x1a')](_0x440da9);}return null;};}function patchUpdates(_0x5b2b93){return function(_0x1ddc6b){try{jsonpatch[_0x6118('0x20')](_0x1ddc6b,_0x5b2b93,!![]);}catch(_0x435b26){return BPromise['reject'](_0x435b26);}return _0x1ddc6b[_0x6118('0x21')]();};}function saveUpdates(_0x1d5799,_0x1d02e9){return function(_0x17aefb){if(_0x17aefb){return _0x17aefb[_0x6118('0x22')](_0x1d5799)[_0x6118('0x23')](function(_0x59eb54){return _0x59eb54;});}return null;};}function removeEntity(_0x26e151,_0x2f3f64){return function(_0x58847f){if(_0x58847f){return _0x58847f['destroy']()[_0x6118('0x23')](function(){_0x26e151[_0x6118('0x18')](0xcc)[_0x6118('0x19')]();});}};}function handleEntityNotFound(_0x140c22,_0x3e2abd){return function(_0x397286){if(!_0x397286){_0x140c22['sendStatus'](0x194);}return _0x397286;};}function handleError(_0x5c4928,_0x1a5565){_0x1a5565=_0x1a5565||0x1f4;return function(_0x5295d4){logger[_0x6118('0x24')](_0x5295d4['stack']);if(_0x5295d4[_0x6118('0x25')]){delete _0x5295d4[_0x6118('0x25')];}_0x5c4928[_0x6118('0x18')](_0x1a5565)['send'](_0x5295d4);};}exports[_0x6118('0x26')]=function(_0x371589,_0x1d8448){var _0x31fcb1={},_0x3fa371={},_0x296f04={'count':0x0,'rows':[]};var _0x44b6e4=_['map'](db[_0x6118('0x27')][_0x6118('0x28')],function(_0x4f964c){return{'name':_0x4f964c['fieldName'],'type':_0x4f964c[_0x6118('0x29')]['key']};});_0x3fa371[_0x6118('0x2a')]=_[_0x6118('0x2b')](_0x44b6e4,_0x6118('0x25'));_0x3fa371[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x371589[_0x6118('0x2c')]);_0x3fa371['filters']=_[_0x6118('0x2e')](_0x3fa371['model'],_0x3fa371[_0x6118('0x2c')]);_0x31fcb1['attributes']=_[_0x6118('0x2e')](_0x3fa371[_0x6118('0x2a')],qs[_0x6118('0x2f')](_0x371589[_0x6118('0x2c')][_0x6118('0x2f')]));_0x31fcb1[_0x6118('0x30')]=_0x31fcb1[_0x6118('0x30')][_0x6118('0x31')]?_0x31fcb1[_0x6118('0x30')]:_0x3fa371['model'];if(!_0x371589[_0x6118('0x2c')][_0x6118('0x32')](_0x6118('0x33'))){_0x31fcb1[_0x6118('0x1d')]=qs[_0x6118('0x1d')](_0x371589[_0x6118('0x2c')][_0x6118('0x1d')]);_0x31fcb1[_0x6118('0x1b')]=qs[_0x6118('0x1b')](_0x371589[_0x6118('0x2c')]['offset']);}_0x31fcb1['order']=qs['sort'](_0x371589['query'][_0x6118('0x34')]);_0x31fcb1['where']=qs[_0x6118('0x35')](_[_0x6118('0x36')](_0x371589[_0x6118('0x2c')],_0x3fa371[_0x6118('0x35')]),_0x44b6e4);if(_0x371589[_0x6118('0x2c')]['filter']){_0x31fcb1['where']=_['merge'](_0x31fcb1[_0x6118('0x37')],{'$or':_['map'](_0x44b6e4,function(_0x4fb67e){if(_0x4fb67e[_0x6118('0x29')]!==_0x6118('0x38')){var _0x3d9a4a={};_0x3d9a4a[_0x4fb67e[_0x6118('0x25')]]={'$like':'%'+_0x371589[_0x6118('0x2c')][_0x6118('0x39')]+'%'};return _0x3d9a4a;}})});}_0x31fcb1=_['merge']({},_0x31fcb1,_0x371589[_0x6118('0x3a')]);var _0x5589e0={'where':_0x31fcb1[_0x6118('0x37')]};return db['ZendeskConfiguration']['count'](_0x5589e0)[_0x6118('0x23')](function(_0x4ff50a){_0x296f04[_0x6118('0x1e')]=_0x4ff50a;if(_0x371589[_0x6118('0x2c')][_0x6118('0x3b')]){_0x31fcb1[_0x6118('0x3c')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x31fcb1);})[_0x6118('0x23')](function(_0x4ae4fa){_0x296f04[_0x6118('0x3d')]=_0x4ae4fa;return _0x296f04;})[_0x6118('0x23')](respondWithFilteredResult(_0x1d8448,_0x31fcb1))[_0x6118('0x3e')](handleError(_0x1d8448,null));};exports[_0x6118('0x3f')]=function(_0x31b03d,_0x1f82ea){var _0x101df2={'raw':![],'where':{'id':_0x31b03d['params']['id']}},_0x29da68={};_0x29da68[_0x6118('0x2a')]=_['keys'](db[_0x6118('0x27')][_0x6118('0x28')]);_0x29da68[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x31b03d[_0x6118('0x2c')]);_0x29da68['filters']=_['intersection'](_0x29da68[_0x6118('0x2a')],_0x29da68[_0x6118('0x2c')]);_0x101df2[_0x6118('0x30')]=_['intersection'](_0x29da68[_0x6118('0x2a')],qs[_0x6118('0x2f')](_0x31b03d[_0x6118('0x2c')][_0x6118('0x2f')]));_0x101df2['attributes']=_0x101df2[_0x6118('0x30')][_0x6118('0x31')]?_0x101df2['attributes']:_0x29da68['model'];if(_0x31b03d['query'][_0x6118('0x3b')]){_0x101df2['include']=[{'all':!![]}];}_0x101df2=_[_0x6118('0x40')]({},_0x101df2,_0x31b03d[_0x6118('0x3a')]);return db['ZendeskConfiguration'][_0x6118('0x41')](_0x101df2)[_0x6118('0x23')](handleEntityNotFound(_0x1f82ea,null))[_0x6118('0x23')](respondWithResult(_0x1f82ea,null))['catch'](handleError(_0x1f82ea,null));};exports[_0x6118('0x42')]=function(_0x528dff,_0x403291){return db[_0x6118('0x27')][_0x6118('0x42')](_0x528dff[_0x6118('0x43')],{})[_0x6118('0x23')](respondWithResult(_0x403291,0xc9))[_0x6118('0x3e')](handleError(_0x403291,null));};exports[_0x6118('0x22')]=function(_0x3e5e72,_0xdc6f01){if(_0x3e5e72['body']['id']){delete _0x3e5e72[_0x6118('0x43')]['id'];}return db[_0x6118('0x27')]['find']({'where':{'id':_0x3e5e72[_0x6118('0x44')]['id']}})[_0x6118('0x23')](handleEntityNotFound(_0xdc6f01,null))[_0x6118('0x23')](saveUpdates(_0x3e5e72[_0x6118('0x43')],null))[_0x6118('0x23')](respondWithResult(_0xdc6f01,null))[_0x6118('0x3e')](handleError(_0xdc6f01,null));};exports['destroy']=function(_0x485586,_0x5911ca){return db[_0x6118('0x27')][_0x6118('0x41')]({'where':{'id':_0x485586['params']['id']}})[_0x6118('0x23')](handleEntityNotFound(_0x5911ca,null))['then'](removeEntity(_0x5911ca,null))[_0x6118('0x3e')](handleError(_0x5911ca,null));};exports[_0x6118('0x45')]=function(_0x5591af,_0x55be91,_0xd41d85){var _0x238492={};var _0x237b79={};var _0x4cd6b0;var _0x2a9afc;return db[_0x6118('0x27')][_0x6118('0x46')]({'where':{'id':_0x5591af[_0x6118('0x44')]['id']}})[_0x6118('0x23')](handleEntityNotFound(_0x55be91,null))[_0x6118('0x23')](function(_0x14b305){if(_0x14b305){_0x4cd6b0=_0x14b305;_0x237b79[_0x6118('0x2a')]=_[_0x6118('0x2d')](db[_0x6118('0x47')][_0x6118('0x28')]);_0x237b79[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x5591af[_0x6118('0x2c')]);_0x237b79['filters']=_['intersection'](_0x237b79['model'],_0x237b79[_0x6118('0x2c')]);_0x238492[_0x6118('0x30')]=_['intersection'](_0x237b79[_0x6118('0x2a')],qs[_0x6118('0x2f')](_0x5591af[_0x6118('0x2c')][_0x6118('0x2f')]));_0x238492[_0x6118('0x30')]=_0x238492[_0x6118('0x30')][_0x6118('0x31')]?_0x238492[_0x6118('0x30')]:_0x237b79[_0x6118('0x2a')];_0x238492[_0x6118('0x48')]=qs[_0x6118('0x34')](_0x5591af[_0x6118('0x2c')][_0x6118('0x34')]);_0x238492[_0x6118('0x37')]=qs[_0x6118('0x35')](_[_0x6118('0x36')](_0x5591af[_0x6118('0x2c')],_0x237b79[_0x6118('0x35')]));if(_0x5591af[_0x6118('0x2c')][_0x6118('0x39')]){_0x238492['where']=_[_0x6118('0x40')](_0x238492[_0x6118('0x37')],{'$or':_[_0x6118('0x2b')](_0x238492[_0x6118('0x30')],function(_0x2458ad){var _0x2fe0c8={};_0x2fe0c8[_0x2458ad]={'$like':'%'+_0x5591af[_0x6118('0x2c')][_0x6118('0x39')]+'%'};return _0x2fe0c8;})});}_0x238492=_[_0x6118('0x40')]({},_0x238492,_0x5591af[_0x6118('0x3a')]);return _0x4cd6b0['getFields'](_0x238492);}})[_0x6118('0x23')](function(_0xb4ff37){if(_0xb4ff37){_0x2a9afc=_0xb4ff37['length'];if(!_0x5591af['query'][_0x6118('0x32')](_0x6118('0x33'))){_0x238492[_0x6118('0x1d')]=qs[_0x6118('0x1d')](_0x5591af[_0x6118('0x2c')][_0x6118('0x1d')]);_0x238492[_0x6118('0x1b')]=qs[_0x6118('0x1b')](_0x5591af[_0x6118('0x2c')]['offset']);}return _0x4cd6b0[_0x6118('0x45')](_0x238492);}})['then'](function(_0x52dace){if(_0x52dace){return _0x52dace?{'count':_0x2a9afc,'rows':_0x52dace}:null;}})[_0x6118('0x23')](respondWithResult(_0x55be91,null))[_0x6118('0x3e')](handleError(_0x55be91,null));};exports[_0x6118('0x49')]=function(_0x678a87,_0x1dd078,_0x1f0bdb){var _0x4d9616={};var _0x6ee4dd={};var _0x2b6a98;var _0x158de6;return db[_0x6118('0x27')][_0x6118('0x46')]({'where':{'id':_0x678a87[_0x6118('0x44')]['id']}})[_0x6118('0x23')](handleEntityNotFound(_0x1dd078,null))[_0x6118('0x23')](function(_0xc27df2){if(_0xc27df2){_0x2b6a98=_0xc27df2;_0x6ee4dd['model']=_[_0x6118('0x2d')](db[_0x6118('0x47')]['rawAttributes']);_0x6ee4dd['query']=_[_0x6118('0x2d')](_0x678a87[_0x6118('0x2c')]);_0x6ee4dd[_0x6118('0x35')]=_[_0x6118('0x2e')](_0x6ee4dd[_0x6118('0x2a')],_0x6ee4dd['query']);_0x4d9616[_0x6118('0x30')]=_[_0x6118('0x2e')](_0x6ee4dd[_0x6118('0x2a')],qs['fields'](_0x678a87['query'][_0x6118('0x2f')]));_0x4d9616[_0x6118('0x30')]=_0x4d9616['attributes'][_0x6118('0x31')]?_0x4d9616[_0x6118('0x30')]:_0x6ee4dd['model'];_0x4d9616['order']=qs['sort'](_0x678a87[_0x6118('0x2c')][_0x6118('0x34')]);_0x4d9616[_0x6118('0x37')]=qs[_0x6118('0x35')](_[_0x6118('0x36')](_0x678a87['query'],_0x6ee4dd[_0x6118('0x35')]));if(_0x678a87[_0x6118('0x2c')][_0x6118('0x39')]){_0x4d9616['where']=_['merge'](_0x4d9616[_0x6118('0x37')],{'$or':_[_0x6118('0x2b')](_0x4d9616[_0x6118('0x30')],function(_0x3e8afb){var _0x5cf671={};_0x5cf671[_0x3e8afb]={'$like':'%'+_0x678a87[_0x6118('0x2c')][_0x6118('0x39')]+'%'};return _0x5cf671;})});}_0x4d9616=_[_0x6118('0x40')]({},_0x4d9616,_0x678a87[_0x6118('0x3a')]);return _0x2b6a98['getSubjects'](_0x4d9616);}})['then'](function(_0x7959b9){if(_0x7959b9){_0x158de6=_0x7959b9[_0x6118('0x31')];if(!_0x678a87[_0x6118('0x2c')][_0x6118('0x32')](_0x6118('0x33'))){_0x4d9616[_0x6118('0x1d')]=qs[_0x6118('0x1d')](_0x678a87[_0x6118('0x2c')][_0x6118('0x1d')]);_0x4d9616[_0x6118('0x1b')]=qs['offset'](_0x678a87[_0x6118('0x2c')][_0x6118('0x1b')]);}return _0x2b6a98[_0x6118('0x49')](_0x4d9616);}})[_0x6118('0x23')](function(_0x5c90e7){if(_0x5c90e7){return _0x5c90e7?{'count':_0x158de6,'rows':_0x5c90e7}:null;}})[_0x6118('0x23')](respondWithResult(_0x1dd078,null))[_0x6118('0x3e')](handleError(_0x1dd078,null));};exports[_0x6118('0x4a')]=function(_0x51ffe4,_0xda6f29,_0x4304d0){var _0x551307={};var _0x39e8e3={};var _0x19ec0b;var _0x1787c8;return db[_0x6118('0x27')][_0x6118('0x46')]({'where':{'id':_0x51ffe4['params']['id']}})['then'](handleEntityNotFound(_0xda6f29,null))[_0x6118('0x23')](function(_0x436cad){if(_0x436cad){_0x19ec0b=_0x436cad;_0x39e8e3[_0x6118('0x2a')]=_[_0x6118('0x2d')](db[_0x6118('0x47')][_0x6118('0x28')]);_0x39e8e3[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x51ffe4[_0x6118('0x2c')]);_0x39e8e3[_0x6118('0x35')]=_[_0x6118('0x2e')](_0x39e8e3['model'],_0x39e8e3[_0x6118('0x2c')]);_0x551307[_0x6118('0x30')]=_[_0x6118('0x2e')](_0x39e8e3[_0x6118('0x2a')],qs['fields'](_0x51ffe4['query']['fields']));_0x551307[_0x6118('0x30')]=_0x551307[_0x6118('0x30')][_0x6118('0x31')]?_0x551307[_0x6118('0x30')]:_0x39e8e3[_0x6118('0x2a')];_0x551307['order']=qs['sort'](_0x51ffe4[_0x6118('0x2c')][_0x6118('0x34')]);_0x551307['where']=qs[_0x6118('0x35')](_[_0x6118('0x36')](_0x51ffe4['query'],_0x39e8e3[_0x6118('0x35')]));if(_0x51ffe4['query']['filter']){_0x551307[_0x6118('0x37')]=_[_0x6118('0x40')](_0x551307[_0x6118('0x37')],{'$or':_['map'](_0x551307[_0x6118('0x30')],function(_0x46a9ae){var _0x1f328c={};_0x1f328c[_0x46a9ae]={'$like':'%'+_0x51ffe4[_0x6118('0x2c')][_0x6118('0x39')]+'%'};return _0x1f328c;})});}_0x551307=_[_0x6118('0x40')]({},_0x551307,_0x51ffe4[_0x6118('0x3a')]);return _0x19ec0b[_0x6118('0x4a')](_0x551307);}})[_0x6118('0x23')](function(_0x2f7ad0){if(_0x2f7ad0){_0x1787c8=_0x2f7ad0[_0x6118('0x31')];if(!_0x51ffe4['query'][_0x6118('0x32')](_0x6118('0x33'))){_0x551307[_0x6118('0x1d')]=qs[_0x6118('0x1d')](_0x51ffe4['query'][_0x6118('0x1d')]);_0x551307[_0x6118('0x1b')]=qs[_0x6118('0x1b')](_0x51ffe4[_0x6118('0x2c')][_0x6118('0x1b')]);}return _0x19ec0b[_0x6118('0x4a')](_0x551307);}})[_0x6118('0x23')](function(_0x15f84b){if(_0x15f84b){return _0x15f84b?{'count':_0x1787c8,'rows':_0x15f84b}:null;}})['then'](respondWithResult(_0xda6f29,null))[_0x6118('0x3e')](handleError(_0xda6f29,null));};exports[_0x6118('0x4b')]=function(_0x2134fb,_0x45a2e2,_0xcbd2e7){var _0x301351={};var _0x2c66c6={};var _0x5677d3;var _0x24b3d2;return db[_0x6118('0x27')][_0x6118('0x46')]({'where':{'id':_0x2134fb[_0x6118('0x44')]['id']}})[_0x6118('0x23')](handleEntityNotFound(_0x45a2e2,null))[_0x6118('0x23')](function(_0x23500f){if(_0x23500f){_0x5677d3=_0x23500f;_0x2c66c6[_0x6118('0x2a')]=_[_0x6118('0x2d')](db[_0x6118('0x4c')][_0x6118('0x28')]);_0x2c66c6[_0x6118('0x2c')]=_['keys'](_0x2134fb['query']);_0x2c66c6[_0x6118('0x35')]=_[_0x6118('0x2e')](_0x2c66c6[_0x6118('0x2a')],_0x2c66c6[_0x6118('0x2c')]);_0x301351[_0x6118('0x30')]=_['intersection'](_0x2c66c6['model'],qs[_0x6118('0x2f')](_0x2134fb[_0x6118('0x2c')]['fields']));_0x301351[_0x6118('0x30')]=_0x301351[_0x6118('0x30')][_0x6118('0x31')]?_0x301351['attributes']:_0x2c66c6['model'];_0x301351[_0x6118('0x48')]=qs['sort'](_0x2134fb['query']['sort']);_0x301351[_0x6118('0x37')]=qs[_0x6118('0x35')](_[_0x6118('0x36')](_0x2134fb[_0x6118('0x2c')],_0x2c66c6[_0x6118('0x35')]));if(_0x2134fb[_0x6118('0x2c')][_0x6118('0x39')]){_0x301351[_0x6118('0x37')]=_[_0x6118('0x40')](_0x301351[_0x6118('0x37')],{'$or':_[_0x6118('0x2b')](_0x301351[_0x6118('0x30')],function(_0x52edfd){var _0x3f3b9b={};_0x3f3b9b[_0x52edfd]={'$like':'%'+_0x2134fb['query'][_0x6118('0x39')]+'%'};return _0x3f3b9b;})});}_0x301351=_[_0x6118('0x40')]({},_0x301351,_0x2134fb['options']);return _0x5677d3[_0x6118('0x4b')](_0x301351);}})['then'](function(_0x42a775){if(_0x42a775){_0x24b3d2=_0x42a775[_0x6118('0x31')];if(!_0x2134fb['query'][_0x6118('0x32')](_0x6118('0x33'))){_0x301351[_0x6118('0x1d')]=qs[_0x6118('0x1d')](_0x2134fb[_0x6118('0x2c')][_0x6118('0x1d')]);_0x301351[_0x6118('0x1b')]=qs['offset'](_0x2134fb[_0x6118('0x2c')]['offset']);}return _0x5677d3[_0x6118('0x4b')](_0x301351);}})[_0x6118('0x23')](function(_0x4e4779){if(_0x4e4779){return _0x4e4779?{'count':_0x24b3d2,'rows':_0x4e4779}:null;}})[_0x6118('0x23')](respondWithResult(_0x45a2e2,null))[_0x6118('0x3e')](handleError(_0x45a2e2,null));};exports[_0x6118('0x4d')]=function(_0x2d2b1e,_0x4d74aa,_0x46e901){if(_0x2d2b1e['body']['id']){delete _0x2d2b1e[_0x6118('0x43')]['id'];}return db['ZendeskConfiguration'][_0x6118('0x46')]({'where':{'id':_0x2d2b1e[_0x6118('0x44')]['id']}})[_0x6118('0x23')](handleEntityNotFound(_0x4d74aa,null))[_0x6118('0x23')](function(_0x5dc0ac){if(_0x5dc0ac){return _0x5dc0ac[_0x6118('0x4d')](_0x2d2b1e[_0x6118('0x43')][_0x6118('0x4e')]||[]);}return null;})[_0x6118('0x23')](respondWithResult(_0x4d74aa,null))[_0x6118('0x3e')](handleError(_0x4d74aa,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1c205ad..cc01d51 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 _0xd824=['rimraf','../../config/environment','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x13b10e,_0x518033){var _0x42223b=function(_0x16cffd){while(--_0x16cffd){_0x13b10e['push'](_0x13b10e['shift']());}};_0x42223b(++_0x518033);}(_0xd824,0xc2));var _0x4d82=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd824[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4d82('0x2'));var BPromise=require(_0x4d82('0x3'));var rp=require(_0x4d82('0x4'));var fs=require('fs');var path=require(_0x4d82('0x5'));var rimraf=require(_0x4d82('0x6'));var config=require(_0x4d82('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0xd00023,_0x583c7c){return _0xd00023['define'](_0x4d82('0x8'),attributes,{'tableName':_0x4d82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x69d3,0xda));var _0x369d=function(_0xedca61,_0x3a55d4){_0xedca61=_0xedca61-0x0;var _0x476414=_0x69d3[_0xedca61];return _0x476414;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'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 97c83aa..07714f9 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 _0xb6a0=['request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','http'];(function(_0x5adc44,_0x4edd02){var _0x30bd5f=function(_0x224bf8){while(--_0x224bf8){_0x5adc44['push'](_0x5adc44['shift']());}};_0x30bd5f(++_0x4edd02);}(_0xb6a0,0x124));var _0x0b6a=function(_0x448690,_0x2b93d7){_0x448690=_0x448690-0x0;var _0x4dded4=_0xb6a0[_0x448690];return _0x4dded4;};'use strict';var _=require(_0x0b6a('0x0'));var util=require(_0x0b6a('0x1'));var moment=require(_0x0b6a('0x2'));var BPromise=require(_0x0b6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b6a('0x4'));var db=require(_0x0b6a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b6a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0b6a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb933f9,_0x706268,_0x27ffa9){return new BPromise(function(_0x1727b0,_0x4adbac){return client[_0x0b6a('0x8')](_0xb933f9,_0x27ffa9)[_0x0b6a('0x9')](function(_0x1e62d7){logger[_0x0b6a('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x706268,_0x0b6a('0xb'));logger[_0x0b6a('0xc')](_0x0b6a('0xd'),_0x706268,_0x0b6a('0xb'),JSON['stringify'](_0x1e62d7));if(_0x1e62d7['error']){if(_0x1e62d7[_0x0b6a('0xe')][_0x0b6a('0xf')]===0x1f4){logger[_0x0b6a('0xe')](_0x0b6a('0x10'),_0x706268,_0x1e62d7['error'][_0x0b6a('0x11')]);return _0x4adbac(_0x1e62d7[_0x0b6a('0xe')][_0x0b6a('0x11')]);}logger[_0x0b6a('0xe')](_0x0b6a('0x10'),_0x706268,_0x1e62d7[_0x0b6a('0xe')]['message']);return _0x1727b0(_0x1e62d7['error'][_0x0b6a('0x11')]);}else{logger[_0x0b6a('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x706268,_0x0b6a('0xb'));_0x1727b0(_0x1e62d7[_0x0b6a('0x12')][_0x0b6a('0x11')]);}})[_0x0b6a('0x13')](function(_0x4c110b){logger[_0x0b6a('0xe')](_0x0b6a('0x10'),_0x706268,_0x4c110b);_0x4adbac(_0x4c110b);});});} \ No newline at end of file +var _0xf204=['request\x20sent','debug','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x2e963b,_0x5e869d){var _0x1fda97=function(_0x1900ce){while(--_0x1900ce){_0x2e963b['push'](_0x2e963b['shift']());}};_0x1fda97(++_0x5e869d);}(_0xf204,0x111));var _0x4f20=function(_0x12d8c7,_0xe7f3df){_0x12d8c7=_0x12d8c7-0x0;var _0x17e75c=_0xf204[_0x12d8c7];return _0x17e75c;};'use strict';var _=require(_0x4f20('0x0'));var util=require(_0x4f20('0x1'));var moment=require(_0x4f20('0x2'));var BPromise=require(_0x4f20('0x3'));var rs=require(_0x4f20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f20('0x5'))['db'];var utils=require(_0x4f20('0x6'));var logger=require('../../config/logger')(_0x4f20('0x7'));var config=require(_0x4f20('0x8'));var jayson=require(_0x4f20('0x9'));var client=jayson['client'][_0x4f20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b410a,_0x989ff8,_0x2dd79b){return new BPromise(function(_0x2516a1,_0x15bc83){return client[_0x4f20('0xb')](_0x1b410a,_0x2dd79b)['then'](function(_0x8d97d5){logger[_0x4f20('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x989ff8,_0x4f20('0xd'));logger[_0x4f20('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x989ff8,_0x4f20('0xd'),JSON[_0x4f20('0xf')](_0x8d97d5));if(_0x8d97d5[_0x4f20('0x10')]){if(_0x8d97d5[_0x4f20('0x10')][_0x4f20('0x11')]===0x1f4){logger[_0x4f20('0x10')](_0x4f20('0x12'),_0x989ff8,_0x8d97d5['error'][_0x4f20('0x13')]);return _0x15bc83(_0x8d97d5[_0x4f20('0x10')][_0x4f20('0x13')]);}logger[_0x4f20('0x10')](_0x4f20('0x12'),_0x989ff8,_0x8d97d5[_0x4f20('0x10')][_0x4f20('0x13')]);return _0x2516a1(_0x8d97d5[_0x4f20('0x10')][_0x4f20('0x13')]);}else{logger['info'](_0x4f20('0x12'),_0x989ff8,_0x4f20('0xd'));_0x2516a1(_0x8d97d5[_0x4f20('0x14')][_0x4f20('0x13')]);}})[_0x4f20('0x15')](function(_0x3b92f1){logger[_0x4f20('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x989ff8,_0x3b92f1);_0x15bc83(_0x3b92f1);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 721007d..4c18543 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 _0xf329=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x29cfb5,_0x2ef35f){var _0x29f81a=function(_0x1fe8c1){while(--_0x1fe8c1){_0x29cfb5['push'](_0x29cfb5['shift']());}};_0x29f81a(++_0x2ef35f);}(_0xf329,0x1ef));var _0x9f32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf329[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9f32('0x0'));var util=require(_0x9f32('0x1'));var path=require('path');var timeout=require(_0x9f32('0x2'));var express=require(_0x9f32('0x3'));var router=express[_0x9f32('0x4')]();var fs_extra=require(_0x9f32('0x5'));var auth=require(_0x9f32('0x6'));var interaction=require(_0x9f32('0x7'));var config=require(_0x9f32('0x8'));var controller=require(_0x9f32('0x9'));router[_0x9f32('0xa')]('/',auth[_0x9f32('0xb')](),controller[_0x9f32('0xc')]);router['get'](_0x9f32('0xd'),auth[_0x9f32('0xb')](),controller[_0x9f32('0xe')]);router[_0x9f32('0xf')]('/',auth[_0x9f32('0xb')](),controller['create']);router[_0x9f32('0x10')](_0x9f32('0xd'),auth[_0x9f32('0xb')](),controller['update']);router[_0x9f32('0x11')]('/:id',auth[_0x9f32('0xb')](),controller[_0x9f32('0x12')]);module[_0x9f32('0x13')]=router; \ No newline at end of file +var _0x4cc9=['isAuthenticated','index','/:id','show','create','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x3875f1,_0x3816aa){var _0xaeebc=function(_0xb6dc84){while(--_0xb6dc84){_0x3875f1['push'](_0x3875f1['shift']());}};_0xaeebc(++_0x3816aa);}(_0x4cc9,0x117));var _0x94cc=function(_0x10ed63,_0x4b3915){_0x10ed63=_0x10ed63-0x0;var _0x4bf33c=_0x4cc9[_0x10ed63];return _0x4bf33c;};'use strict';var multer=require(_0x94cc('0x0'));var util=require(_0x94cc('0x1'));var path=require('path');var timeout=require(_0x94cc('0x2'));var express=require(_0x94cc('0x3'));var router=express[_0x94cc('0x4')]();var fs_extra=require(_0x94cc('0x5'));var auth=require(_0x94cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x94cc('0x7'));var controller=require(_0x94cc('0x8'));router[_0x94cc('0x9')]('/',auth[_0x94cc('0xa')](),controller[_0x94cc('0xb')]);router[_0x94cc('0x9')](_0x94cc('0xc'),auth[_0x94cc('0xa')](),controller[_0x94cc('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x94cc('0xe')]);router['put'](_0x94cc('0xc'),auth[_0x94cc('0xa')](),controller[_0x94cc('0xf')]);router['delete'](_0x94cc('0xc'),auth[_0x94cc('0xa')](),controller['destroy']);module[_0x94cc('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 457f956..5881f15 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 _0xf3dd=['keyValue','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x9f53c8,_0x466517){var _0x5d678c=function(_0x1d59de){while(--_0x1d59de){_0x9f53c8['push'](_0x9f53c8['shift']());}};_0x5d678c(++_0x466517);}(_0xf3dd,0x123));var _0xdf3d=function(_0x69fb6a,_0x46ec8d){_0x69fb6a=_0x69fb6a-0x0;var _0x2faee2=_0xf3dd[_0x69fb6a];return _0x2faee2;};'use strict';var Sequelize=require('sequelize');module[_0xdf3d('0x0')]={'type':{'type':Sequelize[_0xdf3d('0x1')](_0xdf3d('0x2'),_0xdf3d('0x3'),_0xdf3d('0x4'),_0xdf3d('0x5'),'picklist'),'defaultValue':_0xdf3d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdf3d('0x6')]},'keyType':{'type':Sequelize[_0xdf3d('0x1')](_0xdf3d('0x2'),_0xdf3d('0x3'),_0xdf3d('0x4'))},'keyContent':{'type':Sequelize[_0xdf3d('0x6')]},'idField':{'type':Sequelize[_0xdf3d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdf3d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdf3d('0x6')]}}; \ No newline at end of file +var _0x28e4=['ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN','exports'];(function(_0x1b6ab2,_0x3b6a17){var _0x591ed3=function(_0x156cb3){while(--_0x156cb3){_0x1b6ab2['push'](_0x1b6ab2['shift']());}};_0x591ed3(++_0x3b6a17);}(_0x28e4,0xf7));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x428e('0x0')]={'type':{'type':Sequelize[_0x428e('0x1')]('string',_0x428e('0x2'),_0x428e('0x3'),'keyValue',_0x428e('0x4')),'defaultValue':_0x428e('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x428e('0x6')]},'keyType':{'type':Sequelize[_0x428e('0x1')](_0x428e('0x5'),_0x428e('0x2'),_0x428e('0x3'))},'keyContent':{'type':Sequelize[_0x428e('0x6')]},'idField':{'type':Sequelize[_0x428e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x428e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x428e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c2ea573..4fa4239 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 _0x1cd8=['error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','then','include','findAll','rows','catch','show','params','includeAll','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x200521,_0x394b81){var _0x1d4d74=function(_0x21b566){while(--_0x21b566){_0x200521['push'](_0x200521['shift']());}};_0x1d4d74(++_0x394b81);}(_0x1cd8,0x110));var _0x81cd=function(_0x48e8a6,_0x23ef5a){_0x48e8a6=_0x48e8a6-0x0;var _0x1194d7=_0x1cd8[_0x48e8a6];return _0x1194d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x81cd('0x0'));var jsonpatch=require(_0x81cd('0x1'));var rp=require(_0x81cd('0x2'));var moment=require(_0x81cd('0x3'));var BPromise=require(_0x81cd('0x4'));var Mustache=require(_0x81cd('0x5'));var util=require(_0x81cd('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x81cd('0x7'));var ejs=require(_0x81cd('0x8'));var fs=require('fs');var fs_extra=require(_0x81cd('0x9'));var _=require(_0x81cd('0xa'));var squel=require(_0x81cd('0xb'));var crypto=require(_0x81cd('0xc'));var jsforce=require(_0x81cd('0xd'));var deskjs=require(_0x81cd('0xe'));var toCsv=require(_0x81cd('0x7'));var querystring=require(_0x81cd('0xf'));var Papa=require(_0x81cd('0x10'));var Redis=require(_0x81cd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x81cd('0x12'));var hardwareService=require(_0x81cd('0x13'));var logger=require(_0x81cd('0x14'))(_0x81cd('0x15'));var utils=require(_0x81cd('0x16'));var config=require(_0x81cd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x81cd('0x18'))['db'];function respondWithStatusCode(_0x1bc3f0,_0x316d10){_0x316d10=_0x316d10||0xcc;return function(_0x753466){if(_0x753466){return _0x1bc3f0[_0x81cd('0x19')](_0x316d10);}return _0x1bc3f0['status'](_0x316d10)[_0x81cd('0x1a')]();};}function respondWithResult(_0x1ed1e,_0x814090){_0x814090=_0x814090||0xc8;return function(_0x488d1d){if(_0x488d1d){return _0x1ed1e[_0x81cd('0x1b')](_0x814090)[_0x81cd('0x1c')](_0x488d1d);}};}function respondWithFilteredResult(_0x4f990f,_0x60c47d){return function(_0x5f417a){if(_0x5f417a){var _0x3452e7=typeof _0x60c47d[_0x81cd('0x1d')]===_0x81cd('0x1e')&&typeof _0x60c47d['limit']===_0x81cd('0x1e');var _0x528532=_0x5f417a['count'];var _0x55d144=_0x3452e7?0x0:_0x60c47d[_0x81cd('0x1d')];var _0x5a68d6=_0x3452e7?_0x5f417a[_0x81cd('0x1f')]:_0x60c47d[_0x81cd('0x1d')]+_0x60c47d[_0x81cd('0x20')];var _0x9ae655;if(_0x5a68d6>=_0x528532){_0x5a68d6=_0x528532;_0x9ae655=0xc8;}else{_0x9ae655=0xce;}_0x4f990f['status'](_0x9ae655);return _0x4f990f[_0x81cd('0x21')](_0x81cd('0x22'),_0x55d144+'-'+_0x5a68d6+'/'+_0x528532)[_0x81cd('0x1c')](_0x5f417a);}return null;};}function patchUpdates(_0x3fe563){return function(_0x49b224){try{jsonpatch[_0x81cd('0x23')](_0x49b224,_0x3fe563,!![]);}catch(_0x33bffa){return BPromise[_0x81cd('0x24')](_0x33bffa);}return _0x49b224[_0x81cd('0x25')]();};}function saveUpdates(_0x45059f,_0x28c816){return function(_0x16a7b0){if(_0x16a7b0){return _0x16a7b0[_0x81cd('0x26')](_0x45059f)['then'](function(_0x535259){return _0x535259;});}return null;};}function removeEntity(_0x2cf957,_0x518c7b){return function(_0x3f0cc7){if(_0x3f0cc7){return _0x3f0cc7[_0x81cd('0x27')]()['then'](function(){_0x2cf957[_0x81cd('0x1b')](0xcc)[_0x81cd('0x1a')]();});}};}function handleEntityNotFound(_0x1186ed,_0x4c1500){return function(_0x21c56e){if(!_0x21c56e){_0x1186ed[_0x81cd('0x19')](0x194);}return _0x21c56e;};}function handleError(_0x286329,_0xc7d682){_0xc7d682=_0xc7d682||0x1f4;return function(_0xdf4cb1){logger[_0x81cd('0x28')](_0xdf4cb1[_0x81cd('0x29')]);if(_0xdf4cb1['name']){delete _0xdf4cb1[_0x81cd('0x2a')];}_0x286329['status'](_0xc7d682)[_0x81cd('0x2b')](_0xdf4cb1);};}exports[_0x81cd('0x2c')]=function(_0x1e4f0d,_0x10e3bc){var _0xf70304={},_0x28f815={},_0x9119c7={'count':0x0,'rows':[]};var _0x5a30d3=_[_0x81cd('0x2d')](db[_0x81cd('0x2e')][_0x81cd('0x2f')],function(_0x58c294){return{'name':_0x58c294[_0x81cd('0x30')],'type':_0x58c294['type']['key']};});_0x28f815['model']=_['map'](_0x5a30d3,_0x81cd('0x2a'));_0x28f815[_0x81cd('0x31')]=_[_0x81cd('0x32')](_0x1e4f0d[_0x81cd('0x31')]);_0x28f815[_0x81cd('0x33')]=_[_0x81cd('0x34')](_0x28f815['model'],_0x28f815[_0x81cd('0x31')]);_0xf70304['attributes']=_['intersection'](_0x28f815['model'],qs['fields'](_0x1e4f0d[_0x81cd('0x31')][_0x81cd('0x35')]));_0xf70304[_0x81cd('0x36')]=_0xf70304[_0x81cd('0x36')][_0x81cd('0x37')]?_0xf70304[_0x81cd('0x36')]:_0x28f815[_0x81cd('0x38')];if(!_0x1e4f0d[_0x81cd('0x31')][_0x81cd('0x39')](_0x81cd('0x3a'))){_0xf70304[_0x81cd('0x20')]=qs[_0x81cd('0x20')](_0x1e4f0d[_0x81cd('0x31')][_0x81cd('0x20')]);_0xf70304[_0x81cd('0x1d')]=qs[_0x81cd('0x1d')](_0x1e4f0d[_0x81cd('0x31')][_0x81cd('0x1d')]);}_0xf70304[_0x81cd('0x3b')]=qs[_0x81cd('0x3c')](_0x1e4f0d[_0x81cd('0x31')][_0x81cd('0x3c')]);_0xf70304[_0x81cd('0x3d')]=qs['filters'](_[_0x81cd('0x3e')](_0x1e4f0d[_0x81cd('0x31')],_0x28f815['filters']),_0x5a30d3);if(_0x1e4f0d[_0x81cd('0x31')]['filter']){_0xf70304[_0x81cd('0x3d')]=_[_0x81cd('0x3f')](_0xf70304['where'],{'$or':_[_0x81cd('0x2d')](_0x5a30d3,function(_0xfcf793){if(_0xfcf793[_0x81cd('0x40')]!==_0x81cd('0x41')){var _0xf265b4={};_0xf265b4[_0xfcf793[_0x81cd('0x2a')]]={'$like':'%'+_0x1e4f0d[_0x81cd('0x31')]['filter']+'%'};return _0xf265b4;}})});}_0xf70304=_[_0x81cd('0x3f')]({},_0xf70304,_0x1e4f0d[_0x81cd('0x42')]);var _0x17a499={'where':_0xf70304[_0x81cd('0x3d')]};return db[_0x81cd('0x2e')][_0x81cd('0x1f')](_0x17a499)[_0x81cd('0x43')](function(_0x53c03e){_0x9119c7[_0x81cd('0x1f')]=_0x53c03e;if(_0x1e4f0d[_0x81cd('0x31')]['includeAll']){_0xf70304[_0x81cd('0x44')]=[{'all':!![]}];}return db[_0x81cd('0x2e')][_0x81cd('0x45')](_0xf70304);})['then'](function(_0x520f84){_0x9119c7[_0x81cd('0x46')]=_0x520f84;return _0x9119c7;})[_0x81cd('0x43')](respondWithFilteredResult(_0x10e3bc,_0xf70304))[_0x81cd('0x47')](handleError(_0x10e3bc,null));};exports[_0x81cd('0x48')]=function(_0x32424e,_0x1b7440){var _0x52f86d={'raw':!![],'where':{'id':_0x32424e[_0x81cd('0x49')]['id']}},_0x1081f8={};_0x1081f8[_0x81cd('0x38')]=_[_0x81cd('0x32')](db['ZendeskField'][_0x81cd('0x2f')]);_0x1081f8[_0x81cd('0x31')]=_['keys'](_0x32424e['query']);_0x1081f8[_0x81cd('0x33')]=_[_0x81cd('0x34')](_0x1081f8[_0x81cd('0x38')],_0x1081f8[_0x81cd('0x31')]);_0x52f86d['attributes']=_[_0x81cd('0x34')](_0x1081f8[_0x81cd('0x38')],qs['fields'](_0x32424e[_0x81cd('0x31')][_0x81cd('0x35')]));_0x52f86d[_0x81cd('0x36')]=_0x52f86d['attributes'][_0x81cd('0x37')]?_0x52f86d['attributes']:_0x1081f8[_0x81cd('0x38')];if(_0x32424e[_0x81cd('0x31')][_0x81cd('0x4a')]){_0x52f86d[_0x81cd('0x44')]=[{'all':!![]}];}_0x52f86d=_[_0x81cd('0x3f')]({},_0x52f86d,_0x32424e[_0x81cd('0x42')]);return db[_0x81cd('0x2e')]['find'](_0x52f86d)[_0x81cd('0x43')](handleEntityNotFound(_0x1b7440,null))[_0x81cd('0x43')](respondWithResult(_0x1b7440,null))['catch'](handleError(_0x1b7440,null));};exports[_0x81cd('0x4b')]=function(_0x4953a8,_0x8780a6){return db['ZendeskField'][_0x81cd('0x4b')](_0x4953a8[_0x81cd('0x4c')],{})['then'](respondWithResult(_0x8780a6,0xc9))['catch'](handleError(_0x8780a6,null));};exports[_0x81cd('0x26')]=function(_0x43dfe2,_0xc3b77f){if(_0x43dfe2[_0x81cd('0x4c')]['id']){delete _0x43dfe2[_0x81cd('0x4c')]['id'];}return db['ZendeskField'][_0x81cd('0x4d')]({'where':{'id':_0x43dfe2[_0x81cd('0x49')]['id']}})[_0x81cd('0x43')](handleEntityNotFound(_0xc3b77f,null))[_0x81cd('0x43')](saveUpdates(_0x43dfe2[_0x81cd('0x4c')],null))[_0x81cd('0x43')](respondWithResult(_0xc3b77f,null))['catch'](handleError(_0xc3b77f,null));};exports[_0x81cd('0x27')]=function(_0x1f1bc4,_0x4b0a6b){return db[_0x81cd('0x2e')][_0x81cd('0x4d')]({'where':{'id':_0x1f1bc4[_0x81cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b0a6b,null))[_0x81cd('0x43')](removeEntity(_0x4b0a6b,null))[_0x81cd('0x47')](handleError(_0x4b0a6b,null));}; \ No newline at end of file +var _0x49f2=['jsforce','desk.js','to-csv','querystring','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','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','order','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x1d7213,_0x333fdc){var _0x39331b=function(_0x271190){while(--_0x271190){_0x1d7213['push'](_0x1d7213['shift']());}};_0x39331b(++_0x333fdc);}(_0x49f2,0x86));var _0x249f=function(_0x538a9d,_0x36ca1e){_0x538a9d=_0x538a9d-0x0;var _0x5c6cac=_0x49f2[_0x538a9d];return _0x5c6cac;};'use strict';var emlformat=require(_0x249f('0x0'));var rimraf=require(_0x249f('0x1'));var zipdir=require(_0x249f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x249f('0x3'));var moment=require(_0x249f('0x4'));var BPromise=require(_0x249f('0x5'));var Mustache=require('mustache');var util=require(_0x249f('0x6'));var path=require(_0x249f('0x7'));var sox=require(_0x249f('0x8'));var csv=require('to-csv');var ejs=require(_0x249f('0x9'));var fs=require('fs');var fs_extra=require(_0x249f('0xa'));var _=require(_0x249f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x249f('0xc'));var deskjs=require(_0x249f('0xd'));var toCsv=require(_0x249f('0xe'));var querystring=require(_0x249f('0xf'));var Papa=require('papaparse');var Redis=require(_0x249f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x249f('0x11'));var as=require(_0x249f('0x12'));var hardwareService=require(_0x249f('0x13'));var logger=require(_0x249f('0x14'))(_0x249f('0x15'));var utils=require(_0x249f('0x16'));var config=require(_0x249f('0x17'));var licenseUtil=require(_0x249f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347937,_0x4df68b){_0x4df68b=_0x4df68b||0xcc;return function(_0x50d9d3){if(_0x50d9d3){return _0x347937[_0x249f('0x19')](_0x4df68b);}return _0x347937[_0x249f('0x1a')](_0x4df68b)[_0x249f('0x1b')]();};}function respondWithResult(_0x1a9316,_0x21ead8){_0x21ead8=_0x21ead8||0xc8;return function(_0xc2b518){if(_0xc2b518){return _0x1a9316[_0x249f('0x1a')](_0x21ead8)[_0x249f('0x1c')](_0xc2b518);}};}function respondWithFilteredResult(_0x29a5bf,_0x12c781){return function(_0x3031f2){if(_0x3031f2){var _0x2c9cdd=typeof _0x12c781[_0x249f('0x1d')]===_0x249f('0x1e')&&typeof _0x12c781['limit']===_0x249f('0x1e');var _0x16edb5=_0x3031f2[_0x249f('0x1f')];var _0x392ed3=_0x2c9cdd?0x0:_0x12c781['offset'];var _0x3820c5=_0x2c9cdd?_0x3031f2['count']:_0x12c781[_0x249f('0x1d')]+_0x12c781['limit'];var _0x1c3bd8;if(_0x3820c5>=_0x16edb5){_0x3820c5=_0x16edb5;_0x1c3bd8=0xc8;}else{_0x1c3bd8=0xce;}_0x29a5bf['status'](_0x1c3bd8);return _0x29a5bf[_0x249f('0x20')]('Content-Range',_0x392ed3+'-'+_0x3820c5+'/'+_0x16edb5)[_0x249f('0x1c')](_0x3031f2);}return null;};}function patchUpdates(_0x129f64){return function(_0x249e2d){try{jsonpatch[_0x249f('0x21')](_0x249e2d,_0x129f64,!![]);}catch(_0x2ea1ff){return BPromise[_0x249f('0x22')](_0x2ea1ff);}return _0x249e2d[_0x249f('0x23')]();};}function saveUpdates(_0x37fc36,_0x4dad53){return function(_0xe46095){if(_0xe46095){return _0xe46095[_0x249f('0x24')](_0x37fc36)[_0x249f('0x25')](function(_0x452188){return _0x452188;});}return null;};}function removeEntity(_0x4f0ff0,_0x5ebdd1){return function(_0x26deda){if(_0x26deda){return _0x26deda['destroy']()[_0x249f('0x25')](function(){_0x4f0ff0[_0x249f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f1ca3,_0x3a3fd6){return function(_0x33a539){if(!_0x33a539){_0x1f1ca3['sendStatus'](0x194);}return _0x33a539;};}function handleError(_0x45db7f,_0x3f4971){_0x3f4971=_0x3f4971||0x1f4;return function(_0x4f2d8a){logger[_0x249f('0x26')](_0x4f2d8a[_0x249f('0x27')]);if(_0x4f2d8a[_0x249f('0x28')]){delete _0x4f2d8a[_0x249f('0x28')];}_0x45db7f[_0x249f('0x1a')](_0x3f4971)[_0x249f('0x29')](_0x4f2d8a);};}exports[_0x249f('0x2a')]=function(_0x276017,_0x44d41a){var _0x36b383={},_0xfa7e9f={},_0x3ac548={'count':0x0,'rows':[]};var _0x35cf90=_[_0x249f('0x2b')](db[_0x249f('0x2c')][_0x249f('0x2d')],function(_0x24c21e){return{'name':_0x24c21e['fieldName'],'type':_0x24c21e[_0x249f('0x2e')][_0x249f('0x2f')]};});_0xfa7e9f[_0x249f('0x30')]=_['map'](_0x35cf90,'name');_0xfa7e9f['query']=_[_0x249f('0x31')](_0x276017[_0x249f('0x32')]);_0xfa7e9f[_0x249f('0x33')]=_['intersection'](_0xfa7e9f[_0x249f('0x30')],_0xfa7e9f[_0x249f('0x32')]);_0x36b383[_0x249f('0x34')]=_['intersection'](_0xfa7e9f[_0x249f('0x30')],qs[_0x249f('0x35')](_0x276017[_0x249f('0x32')]['fields']));_0x36b383[_0x249f('0x34')]=_0x36b383['attributes'][_0x249f('0x36')]?_0x36b383[_0x249f('0x34')]:_0xfa7e9f['model'];if(!_0x276017[_0x249f('0x32')][_0x249f('0x37')]('nolimit')){_0x36b383[_0x249f('0x38')]=qs[_0x249f('0x38')](_0x276017['query'][_0x249f('0x38')]);_0x36b383[_0x249f('0x1d')]=qs[_0x249f('0x1d')](_0x276017[_0x249f('0x32')][_0x249f('0x1d')]);}_0x36b383[_0x249f('0x39')]=qs['sort'](_0x276017[_0x249f('0x32')]['sort']);_0x36b383[_0x249f('0x3a')]=qs[_0x249f('0x33')](_[_0x249f('0x3b')](_0x276017[_0x249f('0x32')],_0xfa7e9f[_0x249f('0x33')]),_0x35cf90);if(_0x276017[_0x249f('0x32')]['filter']){_0x36b383[_0x249f('0x3a')]=_[_0x249f('0x3c')](_0x36b383[_0x249f('0x3a')],{'$or':_['map'](_0x35cf90,function(_0x3a44c5){if(_0x3a44c5[_0x249f('0x2e')]!==_0x249f('0x3d')){var _0x69bb52={};_0x69bb52[_0x3a44c5[_0x249f('0x28')]]={'$like':'%'+_0x276017['query']['filter']+'%'};return _0x69bb52;}})});}_0x36b383=_[_0x249f('0x3c')]({},_0x36b383,_0x276017[_0x249f('0x3e')]);var _0x136ead={'where':_0x36b383[_0x249f('0x3a')]};return db[_0x249f('0x2c')][_0x249f('0x1f')](_0x136ead)[_0x249f('0x25')](function(_0x4cf60a){_0x3ac548[_0x249f('0x1f')]=_0x4cf60a;if(_0x276017[_0x249f('0x32')][_0x249f('0x3f')]){_0x36b383[_0x249f('0x40')]=[{'all':!![]}];}return db[_0x249f('0x2c')]['findAll'](_0x36b383);})[_0x249f('0x25')](function(_0x3d4872){_0x3ac548[_0x249f('0x41')]=_0x3d4872;return _0x3ac548;})[_0x249f('0x25')](respondWithFilteredResult(_0x44d41a,_0x36b383))[_0x249f('0x42')](handleError(_0x44d41a,null));};exports['show']=function(_0x24da5e,_0x2b6792){var _0x1f6de7={'raw':!![],'where':{'id':_0x24da5e[_0x249f('0x43')]['id']}},_0x44152a={};_0x44152a[_0x249f('0x30')]=_[_0x249f('0x31')](db['ZendeskField']['rawAttributes']);_0x44152a['query']=_['keys'](_0x24da5e[_0x249f('0x32')]);_0x44152a[_0x249f('0x33')]=_[_0x249f('0x44')](_0x44152a['model'],_0x44152a[_0x249f('0x32')]);_0x1f6de7[_0x249f('0x34')]=_[_0x249f('0x44')](_0x44152a[_0x249f('0x30')],qs['fields'](_0x24da5e[_0x249f('0x32')][_0x249f('0x35')]));_0x1f6de7[_0x249f('0x34')]=_0x1f6de7['attributes'][_0x249f('0x36')]?_0x1f6de7['attributes']:_0x44152a['model'];if(_0x24da5e[_0x249f('0x32')]['includeAll']){_0x1f6de7['include']=[{'all':!![]}];}_0x1f6de7=_['merge']({},_0x1f6de7,_0x24da5e[_0x249f('0x3e')]);return db[_0x249f('0x2c')][_0x249f('0x45')](_0x1f6de7)['then'](handleEntityNotFound(_0x2b6792,null))[_0x249f('0x25')](respondWithResult(_0x2b6792,null))['catch'](handleError(_0x2b6792,null));};exports[_0x249f('0x46')]=function(_0x5e324c,_0x26345a){return db['ZendeskField'][_0x249f('0x46')](_0x5e324c[_0x249f('0x47')],{})[_0x249f('0x25')](respondWithResult(_0x26345a,0xc9))[_0x249f('0x42')](handleError(_0x26345a,null));};exports[_0x249f('0x24')]=function(_0x2120ad,_0x19bf54){if(_0x2120ad[_0x249f('0x47')]['id']){delete _0x2120ad[_0x249f('0x47')]['id'];}return db[_0x249f('0x2c')][_0x249f('0x45')]({'where':{'id':_0x2120ad['params']['id']}})[_0x249f('0x25')](handleEntityNotFound(_0x19bf54,null))[_0x249f('0x25')](saveUpdates(_0x2120ad[_0x249f('0x47')],null))['then'](respondWithResult(_0x19bf54,null))[_0x249f('0x42')](handleError(_0x19bf54,null));};exports[_0x249f('0x48')]=function(_0x4d8714,_0x880a40){return db[_0x249f('0x2c')]['find']({'where':{'id':_0x4d8714[_0x249f('0x43')]['id']}})['then'](handleEntityNotFound(_0x880a40,null))[_0x249f('0x25')](removeEntity(_0x880a40,null))[_0x249f('0x42')](handleError(_0x880a40,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index dce92bd..27e2757 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 _0x7a11=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20fb63,_0x597774){var _0x23a7ff=function(_0x214541){while(--_0x214541){_0x20fb63['push'](_0x20fb63['shift']());}};_0x23a7ff(++_0x597774);}(_0x7a11,0x1b9));var _0x17a1=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0x7a11[_0x3452eb];return _0x4244fd;};'use strict';var _=require(_0x17a1('0x0'));var util=require(_0x17a1('0x1'));var logger=require(_0x17a1('0x2'))(_0x17a1('0x3'));var moment=require(_0x17a1('0x4'));var BPromise=require(_0x17a1('0x5'));var rp=require(_0x17a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17a1('0x7'));var config=require(_0x17a1('0x8'));var attributes=require(_0x17a1('0x9'));module[_0x17a1('0xa')]=function(_0x1e98af,_0x4e8ae4){return _0x1e98af[_0x17a1('0xb')](_0x17a1('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x17a1('0xd'),'fields':[_0x17a1('0xe'),_0x17a1('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x015f=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5ba46a,_0x582fe0){var _0x5cbf4f=function(_0x22349b){while(--_0x22349b){_0x5ba46a['push'](_0x5ba46a['shift']());}};_0x5cbf4f(++_0x582fe0);}(_0x015f,0xae));var _0xf015=function(_0x1181f3,_0xf81baa){_0x1181f3=_0x1181f3-0x0;var _0x37abb6=_0x015f[_0x1181f3];return _0x37abb6;};'use strict';var _=require(_0xf015('0x0'));var util=require(_0xf015('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf015('0x2'));var BPromise=require(_0xf015('0x3'));var rp=require(_0xf015('0x4'));var fs=require('fs');var path=require(_0xf015('0x5'));var rimraf=require(_0xf015('0x6'));var config=require(_0xf015('0x7'));var attributes=require(_0xf015('0x8'));module[_0xf015('0x9')]=function(_0x24414a,_0x5bc5c5){return _0x24414a[_0xf015('0xa')](_0xf015('0xb'),attributes,{'tableName':_0xf015('0xc'),'paranoid':![],'indexes':[{'name':_0xf015('0xd'),'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 af38fa0..5cf2caf 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 _0x2a51=['error','code','message','result','catch','lodash','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5a43f6,_0x21e897){var _0x3f062e=function(_0x222ac3){while(--_0x222ac3){_0x5a43f6['push'](_0x5a43f6['shift']());}};_0x3f062e(++_0x21e897);}(_0x2a51,0x126));var _0x12a5=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x2a51[_0xef4ef0];return _0x39b60b;};'use strict';var _=require(_0x12a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12a5('0x2'))(_0x12a5('0x3'));var config=require(_0x12a5('0x4'));var jayson=require(_0x12a5('0x5'));var client=jayson[_0x12a5('0x6')][_0x12a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d8de0,_0x45eaa6,_0x5277ac){return new BPromise(function(_0x56e8b6,_0x423964){return client['request'](_0x5d8de0,_0x5277ac)['then'](function(_0x25be4c){logger[_0x12a5('0x8')](_0x12a5('0x9'),_0x45eaa6,_0x12a5('0xa'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x45eaa6,_0x12a5('0xa'),JSON[_0x12a5('0xb')](_0x25be4c));if(_0x25be4c[_0x12a5('0xc')]){if(_0x25be4c['error'][_0x12a5('0xd')]===0x1f4){logger[_0x12a5('0xc')](_0x12a5('0x9'),_0x45eaa6,_0x25be4c[_0x12a5('0xc')][_0x12a5('0xe')]);return _0x423964(_0x25be4c[_0x12a5('0xc')][_0x12a5('0xe')]);}logger[_0x12a5('0xc')]('ZendeskField,\x20%s,\x20%s',_0x45eaa6,_0x25be4c[_0x12a5('0xc')][_0x12a5('0xe')]);return _0x56e8b6(_0x25be4c[_0x12a5('0xc')][_0x12a5('0xe')]);}else{logger['info'](_0x12a5('0x9'),_0x45eaa6,_0x12a5('0xa'));_0x56e8b6(_0x25be4c[_0x12a5('0xf')][_0x12a5('0xe')]);}})[_0x12a5('0x10')](function(_0x522121){logger[_0x12a5('0xc')](_0x12a5('0x9'),_0x45eaa6,_0x522121);_0x423964(_0x522121);});});} \ No newline at end of file +var _0x0ee3=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4502a7,_0x337f60){var _0x3a42bd=function(_0x301174){while(--_0x301174){_0x4502a7['push'](_0x4502a7['shift']());}};_0x3a42bd(++_0x337f60);}(_0x0ee3,0xeb));var _0x30ee=function(_0x445ab0,_0x1a1226){_0x445ab0=_0x445ab0-0x0;var _0x36b9d6=_0x0ee3[_0x445ab0];return _0x36b9d6;};'use strict';var _=require(_0x30ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30ee('0x1'));var rs=require(_0x30ee('0x2'));var fs=require('fs');var Redis=require(_0x30ee('0x3'));var db=require(_0x30ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x30ee('0x5'))('rpc');var config=require(_0x30ee('0x6'));var jayson=require(_0x30ee('0x7'));var client=jayson[_0x30ee('0x8')][_0x30ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ff60d,_0x207320,_0x4ccdee){return new BPromise(function(_0x4ac792,_0x4e5349){return client[_0x30ee('0xa')](_0x2ff60d,_0x4ccdee)[_0x30ee('0xb')](function(_0x837c4e){logger[_0x30ee('0xc')]('ZendeskField,\x20%s,\x20%s',_0x207320,_0x30ee('0xd'));logger[_0x30ee('0xe')](_0x30ee('0xf'),_0x207320,_0x30ee('0xd'),JSON[_0x30ee('0x10')](_0x837c4e));if(_0x837c4e['error']){if(_0x837c4e[_0x30ee('0x11')][_0x30ee('0x12')]===0x1f4){logger['error'](_0x30ee('0x13'),_0x207320,_0x837c4e[_0x30ee('0x11')][_0x30ee('0x14')]);return _0x4e5349(_0x837c4e[_0x30ee('0x11')]['message']);}logger[_0x30ee('0x11')]('ZendeskField,\x20%s,\x20%s',_0x207320,_0x837c4e[_0x30ee('0x11')][_0x30ee('0x14')]);return _0x4ac792(_0x837c4e['error'][_0x30ee('0x14')]);}else{logger[_0x30ee('0xc')](_0x30ee('0x13'),_0x207320,_0x30ee('0xd'));_0x4ac792(_0x837c4e['result']['message']);}})[_0x30ee('0x15')](function(_0x169179){logger[_0x30ee('0x11')](_0x30ee('0x13'),_0x207320,_0x169179);_0x4e5349(_0x169179);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 0ff8ee3..3b0384a 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 _0xe4c3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','destroy','util','connect-timeout'];(function(_0x4b4776,_0x2c2a31){var _0x5a44a6=function(_0x3c764e){while(--_0x3c764e){_0x4b4776['push'](_0x4b4776['shift']());}};_0x5a44a6(++_0x2c2a31);}(_0xe4c3,0x1f2));var _0x3e4c=function(_0x361ba7,_0x34fcc2){_0x361ba7=_0x361ba7-0x0;var _0x13bab5=_0xe4c3[_0x361ba7];return _0x13bab5;};'use strict';var multer=require('multer');var util=require(_0x3e4c('0x0'));var path=require('path');var timeout=require(_0x3e4c('0x1'));var express=require('express');var router=express[_0x3e4c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3e4c('0x3'));var interaction=require(_0x3e4c('0x4'));var config=require(_0x3e4c('0x5'));var controller=require(_0x3e4c('0x6'));router[_0x3e4c('0x7')]('/',auth[_0x3e4c('0x8')](),controller[_0x3e4c('0x9')]);router[_0x3e4c('0x7')](_0x3e4c('0xa'),auth[_0x3e4c('0x8')](),controller[_0x3e4c('0xb')]);router[_0x3e4c('0x7')](_0x3e4c('0xc'),auth[_0x3e4c('0x8')](),controller[_0x3e4c('0xd')]);router[_0x3e4c('0x7')]('/:id/fields',auth[_0x3e4c('0x8')](),controller['getFields']);router[_0x3e4c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3e4c('0xc'),auth[_0x3e4c('0x8')](),controller[_0x3e4c('0xf')]);router[_0x3e4c('0x10')]('/:id',auth[_0x3e4c('0x8')](),controller[_0x3e4c('0x11')]);router[_0x3e4c('0x12')](_0x3e4c('0xa'),auth[_0x3e4c('0x8')](),controller[_0x3e4c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8cf2=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getFields','create','post','put','/:id','update','destroy','exports'];(function(_0x3e20e9,_0x625fc){var _0x3b6c7f=function(_0x4ceb60){while(--_0x4ceb60){_0x3e20e9['push'](_0x3e20e9['shift']());}};_0x3b6c7f(++_0x625fc);}(_0x8cf2,0x108));var _0x28cf=function(_0xbeba91,_0x1e4f49){_0xbeba91=_0xbeba91-0x0;var _0x5daa36=_0x8cf2[_0xbeba91];return _0x5daa36;};'use strict';var multer=require('multer');var util=require(_0x28cf('0x0'));var path=require(_0x28cf('0x1'));var timeout=require(_0x28cf('0x2'));var express=require(_0x28cf('0x3'));var router=express['Router']();var fs_extra=require(_0x28cf('0x4'));var auth=require(_0x28cf('0x5'));var interaction=require(_0x28cf('0x6'));var config=require(_0x28cf('0x7'));var controller=require(_0x28cf('0x8'));router[_0x28cf('0x9')]('/',auth[_0x28cf('0xa')](),controller[_0x28cf('0xb')]);router[_0x28cf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x28cf('0xc')]);router[_0x28cf('0x9')](_0x28cf('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x28cf('0xa')](),controller[_0x28cf('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x28cf('0xf')]);router[_0x28cf('0x10')]('/:id/configurations',auth[_0x28cf('0xa')](),controller['addConfiguration']);router[_0x28cf('0x11')](_0x28cf('0x12'),auth[_0x28cf('0xa')](),controller[_0x28cf('0x13')]);router['delete'](_0x28cf('0x12'),auth[_0x28cf('0xa')](),controller[_0x28cf('0x14')]);module[_0x28cf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a82cfcd..db46a45 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 _0xaa88=['exports','STRING','sequelize'];(function(_0x3b7cf7,_0x961785){var _0x5ee412=function(_0x4649c7){while(--_0x4649c7){_0x3b7cf7['push'](_0x3b7cf7['shift']());}};_0x5ee412(++_0x961785);}(_0xaa88,0x137));var _0x8aa8=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xaa88[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8aa8('0x2')]},'clientId':{'type':Sequelize[_0x8aa8('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa8('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8aa8('0x2')]},'refreshToken':{'type':Sequelize[_0x8aa8('0x2')]}}; \ No newline at end of file +var _0xd64b=['STRING','sequelize'];(function(_0x22da83,_0x355834){var _0x42d80d=function(_0x20a5ea){while(--_0x20a5ea){_0x22da83['push'](_0x22da83['shift']());}};_0x42d80d(++_0x355834);}(_0xd64b,0xc1));var _0xbd64=function(_0x59de5a,_0x1c31ab){_0x59de5a=_0x59de5a-0x0;var _0x1e86eb=_0xd64b[_0x59de5a];return _0x1e86eb;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index d5b9b71..905e940 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 _0x9fe2=['../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','end','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','ZohoConfiguration','nolimit','addConfiguration','findOne','AccountId','getSubjects','Descriptions','channel','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','stringify','Wrong\x20credentials','statusCode','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x4ba307,_0x511b00){var _0x512f61=function(_0x1fb97f){while(--_0x1fb97f){_0x4ba307['push'](_0x4ba307['shift']());}};_0x512f61(++_0x511b00);}(_0x9fe2,0xea));var _0x29fe=function(_0x40c1c9,_0x304d74){_0x40c1c9=_0x40c1c9-0x0;var _0x2c8ed3=_0x9fe2[_0x40c1c9];return _0x2c8ed3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x29fe('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29fe('0x1'));var moment=require(_0x29fe('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x29fe('0x3'));var util=require(_0x29fe('0x4'));var path=require(_0x29fe('0x5'));var sox=require('sox');var csv=require(_0x29fe('0x6'));var ejs=require(_0x29fe('0x7'));var fs=require('fs');var fs_extra=require(_0x29fe('0x8'));var _=require(_0x29fe('0x9'));var squel=require(_0x29fe('0xa'));var crypto=require('crypto');var jsforce=require(_0x29fe('0xb'));var deskjs=require(_0x29fe('0xc'));var toCsv=require(_0x29fe('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29fe('0xd'));var authService=require(_0x29fe('0xe'));var qs=require(_0x29fe('0xf'));var as=require(_0x29fe('0x10'));var hardwareService=require(_0x29fe('0x11'));var logger=require(_0x29fe('0x12'))('api');var utils=require(_0x29fe('0x13'));var config=require(_0x29fe('0x14'));var licenseUtil=require(_0x29fe('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x9ae53d,_0x27b164){_0x27b164=_0x27b164||0xcc;return function(_0x302e18){if(_0x302e18){return _0x9ae53d[_0x29fe('0x16')](_0x27b164);}return _0x9ae53d['status'](_0x27b164)['end']();};}function respondWithResult(_0x5113b1,_0x364bfe){_0x364bfe=_0x364bfe||0xc8;return function(_0x33f81b){if(_0x33f81b){return _0x5113b1[_0x29fe('0x17')](_0x364bfe)[_0x29fe('0x18')](_0x33f81b);}};}function respondWithFilteredResult(_0x2544f8,_0x5a3a2f){return function(_0x39c357){if(_0x39c357){var _0x5c8d84=typeof _0x5a3a2f['offset']===_0x29fe('0x19')&&typeof _0x5a3a2f[_0x29fe('0x1a')]==='undefined';var _0x306c3e=_0x39c357[_0x29fe('0x1b')];var _0xec81a8=_0x5c8d84?0x0:_0x5a3a2f[_0x29fe('0x1c')];var _0x28a71f=_0x5c8d84?_0x39c357[_0x29fe('0x1b')]:_0x5a3a2f['offset']+_0x5a3a2f[_0x29fe('0x1a')];var _0x5aef25;if(_0x28a71f>=_0x306c3e){_0x28a71f=_0x306c3e;_0x5aef25=0xc8;}else{_0x5aef25=0xce;}_0x2544f8[_0x29fe('0x17')](_0x5aef25);return _0x2544f8[_0x29fe('0x1d')](_0x29fe('0x1e'),_0xec81a8+'-'+_0x28a71f+'/'+_0x306c3e)['json'](_0x39c357);}return null;};}function patchUpdates(_0x34c459){return function(_0x51eaa3){try{jsonpatch['apply'](_0x51eaa3,_0x34c459,!![]);}catch(_0x55fa17){return BPromise[_0x29fe('0x1f')](_0x55fa17);}return _0x51eaa3[_0x29fe('0x20')]();};}function saveUpdates(_0x890ab1,_0xe1e51d){return function(_0x2862ef){if(_0x2862ef){return _0x2862ef[_0x29fe('0x21')](_0x890ab1)[_0x29fe('0x22')](function(_0x4e2635){return _0x4e2635;});}return null;};}function removeEntity(_0x506187,_0x3c5f02){return function(_0x3aa351){if(_0x3aa351){return _0x3aa351['destroy']()[_0x29fe('0x22')](function(){_0x506187[_0x29fe('0x17')](0xcc)[_0x29fe('0x23')]();});}};}function handleEntityNotFound(_0x594f50,_0x29fa73){return function(_0x3415e0){if(!_0x3415e0){_0x594f50[_0x29fe('0x16')](0x194);}return _0x3415e0;};}function handleError(_0x6a310a,_0x4aa366){_0x4aa366=_0x4aa366||0x1f4;return function(_0x120d39){logger[_0x29fe('0x24')](_0x120d39[_0x29fe('0x25')]);if(_0x120d39[_0x29fe('0x26')]){delete _0x120d39[_0x29fe('0x26')];}_0x6a310a[_0x29fe('0x17')](_0x4aa366)['send'](_0x120d39);};}exports['index']=function(_0x2b5f77,_0x30c249){var _0x241797={},_0x5d0c5c={},_0x515eb8={'count':0x0,'rows':[]};var _0x158b97=_[_0x29fe('0x27')](db[_0x29fe('0x28')][_0x29fe('0x29')],function(_0xe53d56){return{'name':_0xe53d56[_0x29fe('0x2a')],'type':_0xe53d56[_0x29fe('0x2b')][_0x29fe('0x2c')]};});_0x5d0c5c[_0x29fe('0x2d')]=_[_0x29fe('0x27')](_0x158b97,_0x29fe('0x26'));_0x5d0c5c[_0x29fe('0x2e')]=_[_0x29fe('0x2f')](_0x2b5f77[_0x29fe('0x2e')]);_0x5d0c5c[_0x29fe('0x30')]=_[_0x29fe('0x31')](_0x5d0c5c[_0x29fe('0x2d')],_0x5d0c5c[_0x29fe('0x2e')]);_0x241797[_0x29fe('0x32')]=_['intersection'](_0x5d0c5c[_0x29fe('0x2d')],qs['fields'](_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x33')]));_0x241797[_0x29fe('0x32')]=_0x241797[_0x29fe('0x32')][_0x29fe('0x34')]?_0x241797[_0x29fe('0x32')]:_0x5d0c5c[_0x29fe('0x2d')];if(!_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x35')]('nolimit')){_0x241797[_0x29fe('0x1a')]=qs[_0x29fe('0x1a')](_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x1a')]);_0x241797[_0x29fe('0x1c')]=qs[_0x29fe('0x1c')](_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x1c')]);}_0x241797[_0x29fe('0x36')]=qs[_0x29fe('0x37')](_0x2b5f77[_0x29fe('0x2e')]['sort']);_0x241797[_0x29fe('0x38')]=qs[_0x29fe('0x30')](_[_0x29fe('0x39')](_0x2b5f77[_0x29fe('0x2e')],_0x5d0c5c['filters']),_0x158b97);if(_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x3a')]){_0x241797['where']=_[_0x29fe('0x3b')](_0x241797['where'],{'$or':_[_0x29fe('0x27')](_0x158b97,function(_0x12c3d4){if(_0x12c3d4[_0x29fe('0x2b')]!==_0x29fe('0x3c')){var _0x1a0572={};_0x1a0572[_0x12c3d4['name']]={'$like':'%'+_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x3a')]+'%'};return _0x1a0572;}})});}_0x241797=_[_0x29fe('0x3b')]({},_0x241797,_0x2b5f77[_0x29fe('0x3d')]);var _0x5e075b={'where':_0x241797[_0x29fe('0x38')]};return db[_0x29fe('0x28')][_0x29fe('0x1b')](_0x5e075b)['then'](function(_0x5e4b27){_0x515eb8[_0x29fe('0x1b')]=_0x5e4b27;if(_0x2b5f77[_0x29fe('0x2e')][_0x29fe('0x3e')]){_0x241797[_0x29fe('0x3f')]=[{'all':!![]}];}return db[_0x29fe('0x28')][_0x29fe('0x40')](_0x241797);})[_0x29fe('0x22')](function(_0x100787){_0x515eb8[_0x29fe('0x41')]=_0x100787;return _0x515eb8;})[_0x29fe('0x22')](respondWithFilteredResult(_0x30c249,_0x241797))[_0x29fe('0x42')](handleError(_0x30c249,null));};exports[_0x29fe('0x43')]=function(_0x57ddf0,_0x48469a){var _0x50735a={'raw':![],'where':{'id':_0x57ddf0[_0x29fe('0x44')]['id']}},_0x563691={};_0x563691[_0x29fe('0x2d')]=_[_0x29fe('0x2f')](db[_0x29fe('0x28')][_0x29fe('0x29')]);_0x563691[_0x29fe('0x2e')]=_['keys'](_0x57ddf0[_0x29fe('0x2e')]);_0x563691[_0x29fe('0x30')]=_[_0x29fe('0x31')](_0x563691[_0x29fe('0x2d')],_0x563691['query']);_0x50735a['attributes']=_['intersection'](_0x563691[_0x29fe('0x2d')],qs[_0x29fe('0x33')](_0x57ddf0[_0x29fe('0x2e')][_0x29fe('0x33')]));_0x50735a['attributes']=_0x50735a[_0x29fe('0x32')][_0x29fe('0x34')]?_0x50735a['attributes']:_0x563691[_0x29fe('0x2d')];if(_0x57ddf0[_0x29fe('0x2e')][_0x29fe('0x3e')]){_0x50735a[_0x29fe('0x3f')]=[{'all':!![]}];}_0x50735a=_[_0x29fe('0x3b')]({},_0x50735a,_0x57ddf0[_0x29fe('0x3d')]);return db['ZohoAccount'][_0x29fe('0x45')](_0x50735a)[_0x29fe('0x22')](handleEntityNotFound(_0x48469a,null))[_0x29fe('0x22')](respondWithResult(_0x48469a,null))[_0x29fe('0x42')](handleError(_0x48469a,null));};exports[_0x29fe('0x46')]=function(_0x26780d,_0x316327){return db[_0x29fe('0x28')][_0x29fe('0x46')](_0x26780d[_0x29fe('0x47')],{})[_0x29fe('0x22')](respondWithResult(_0x316327,0xc9))[_0x29fe('0x42')](handleError(_0x316327,null));};exports['update']=function(_0x4554c6,_0xec5430){if(_0x4554c6[_0x29fe('0x47')]['id']){delete _0x4554c6[_0x29fe('0x47')]['id'];}return db[_0x29fe('0x28')]['find']({'where':{'id':_0x4554c6[_0x29fe('0x44')]['id']}})['then'](handleEntityNotFound(_0xec5430,null))[_0x29fe('0x22')](saveUpdates(_0x4554c6['body'],null))['then'](respondWithResult(_0xec5430,null))[_0x29fe('0x42')](handleError(_0xec5430,null));};exports['destroy']=function(_0x559be4,_0x34cec6){return db['ZohoAccount'][_0x29fe('0x45')]({'where':{'id':_0x559be4[_0x29fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x34cec6,null))[_0x29fe('0x22')](removeEntity(_0x34cec6,null))[_0x29fe('0x42')](handleError(_0x34cec6,null));};exports[_0x29fe('0x48')]=function(_0x1a2169,_0x1cdafc,_0x410ffa){var _0x45a0ec={};var _0x582640={};var _0xc69ba4;var _0x73dfba;return db['ZohoAccount']['findOne']({'where':{'id':_0x1a2169[_0x29fe('0x44')]['id']}})[_0x29fe('0x22')](handleEntityNotFound(_0x1cdafc,null))[_0x29fe('0x22')](function(_0x5c369f){if(_0x5c369f){_0xc69ba4=_0x5c369f;_0x582640[_0x29fe('0x2d')]=_[_0x29fe('0x2f')](db[_0x29fe('0x49')]['rawAttributes']);_0x582640[_0x29fe('0x2e')]=_[_0x29fe('0x2f')](_0x1a2169[_0x29fe('0x2e')]);_0x582640[_0x29fe('0x30')]=_['intersection'](_0x582640[_0x29fe('0x2d')],_0x582640[_0x29fe('0x2e')]);_0x45a0ec[_0x29fe('0x32')]=_[_0x29fe('0x31')](_0x582640[_0x29fe('0x2d')],qs[_0x29fe('0x33')](_0x1a2169[_0x29fe('0x2e')][_0x29fe('0x33')]));_0x45a0ec[_0x29fe('0x32')]=_0x45a0ec[_0x29fe('0x32')][_0x29fe('0x34')]?_0x45a0ec[_0x29fe('0x32')]:_0x582640['model'];_0x45a0ec[_0x29fe('0x36')]=qs[_0x29fe('0x37')](_0x1a2169[_0x29fe('0x2e')][_0x29fe('0x37')]);_0x45a0ec[_0x29fe('0x38')]=qs[_0x29fe('0x30')](_[_0x29fe('0x39')](_0x1a2169[_0x29fe('0x2e')],_0x582640[_0x29fe('0x30')]));if(_0x1a2169[_0x29fe('0x2e')]['filter']){_0x45a0ec[_0x29fe('0x38')]=_[_0x29fe('0x3b')](_0x45a0ec['where'],{'$or':_[_0x29fe('0x27')](_0x45a0ec[_0x29fe('0x32')],function(_0x3ab084){var _0x30b3e2={};_0x30b3e2[_0x3ab084]={'$like':'%'+_0x1a2169[_0x29fe('0x2e')][_0x29fe('0x3a')]+'%'};return _0x30b3e2;})});}_0x45a0ec=_[_0x29fe('0x3b')]({},_0x45a0ec,_0x1a2169[_0x29fe('0x3d')]);return _0xc69ba4[_0x29fe('0x48')](_0x45a0ec);}})['then'](function(_0x2de50b){if(_0x2de50b){_0x73dfba=_0x2de50b['length'];if(!_0x1a2169[_0x29fe('0x2e')]['hasOwnProperty'](_0x29fe('0x4a'))){_0x45a0ec['limit']=qs[_0x29fe('0x1a')](_0x1a2169[_0x29fe('0x2e')]['limit']);_0x45a0ec[_0x29fe('0x1c')]=qs[_0x29fe('0x1c')](_0x1a2169[_0x29fe('0x2e')][_0x29fe('0x1c')]);}return _0xc69ba4[_0x29fe('0x48')](_0x45a0ec);}})[_0x29fe('0x22')](function(_0x39303a){if(_0x39303a){return _0x39303a?{'count':_0x73dfba,'rows':_0x39303a}:null;}})[_0x29fe('0x22')](respondWithResult(_0x1cdafc,null))[_0x29fe('0x42')](handleError(_0x1cdafc,null));};exports[_0x29fe('0x4b')]=function(_0x4b5f93,_0x4bfbfe,_0x1ff7c6){if(_0x4b5f93[_0x29fe('0x47')]['id']){delete _0x4b5f93[_0x29fe('0x47')]['id'];}return db[_0x29fe('0x28')][_0x29fe('0x4c')]({'where':{'id':_0x4b5f93[_0x29fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x4bfbfe,null))['then'](function(_0x1956be){if(_0x1956be){_0x4b5f93[_0x29fe('0x47')][_0x29fe('0x4d')]=_0x1956be['id'];_0x4b5f93[_0x29fe('0x47')]['Subjects']=integrations[_0x29fe('0x4e')](_0x4b5f93[_0x29fe('0x47')]['channel'],_0x4b5f93[_0x29fe('0x47')]['type']);_0x4b5f93[_0x29fe('0x47')][_0x29fe('0x4f')]=integrations['getDescriptions'](_0x4b5f93[_0x29fe('0x47')][_0x29fe('0x50')],_0x4b5f93[_0x29fe('0x47')][_0x29fe('0x2b')]);return db[_0x29fe('0x49')]['create'](_0x4b5f93[_0x29fe('0x47')],{'include':[{'model':db[_0x29fe('0x51')],'as':'Subjects'},{'model':db[_0x29fe('0x51')],'as':_0x29fe('0x4f')}]});}return null;})[_0x29fe('0x22')](respondWithResult(_0x4bfbfe,null))[_0x29fe('0x42')](handleError(_0x4bfbfe,null));};function getAccessToken(_0x809bf3){return new Promise(function(_0x1fcd61,_0x453e4c){var _0x578f5c;switch(_0x809bf3['zone']){case'US':_0x578f5c='https://accounts.zoho.com';break;case'AU':_0x578f5c=_0x29fe('0x52');break;case'EU':_0x578f5c=_0x29fe('0x53');break;case'IN':_0x578f5c=_0x29fe('0x54');break;case'CN':_0x578f5c=_0x29fe('0x55');break;default:_0x578f5c=_0x29fe('0x53');break;}var _0xd5f3c={'method':_0x29fe('0x56'),'uri':_0x578f5c+_0x29fe('0x57'),'qs':{'refresh_token':_0x809bf3[_0x29fe('0x58')],'client_id':_0x809bf3[_0x29fe('0x59')],'client_secret':_0x809bf3['clientSecret'],'grant_type':_0x29fe('0x5a')},'json':!![]};return rp(_0xd5f3c)[_0x29fe('0x22')](function(_0x517738){if(_0x517738[_0x29fe('0x5b')]){_0x1fcd61(_0x517738['access_token']);}else{_0x453e4c(_0x29fe('0x5c'));}})[_0x29fe('0x42')](function(_0x1ba305){_0x453e4c(_0x1ba305);});});}exports[_0x29fe('0x5d')]=function(_0x5e184a,_0x12bd2f,_0x25756a){var _0x219208,_0x32deb4,_0x8413e5,_0x21b4a0,_0x52d214;return db['ZohoAccount'][_0x29fe('0x4c')]({'where':{'id':_0x5e184a[_0x29fe('0x44')]['id']},'attributes':['id',_0x29fe('0x5e'),_0x29fe('0x5f'),_0x29fe('0x59'),'clientSecret',_0x29fe('0x60'),'code','refreshToken']})['then'](handleEntityNotFound(_0x12bd2f,null))[_0x29fe('0x22')](function(_0x390930){_0x52d214=_0x390930;_0x219208=_0x52d214[_0x29fe('0x5e')];_0x32deb4=_0x219208==='zoho.eu'?'eu':_0x29fe('0x61');_0x8413e5=_0x52d214['serverUrl'];var _0x2e2ed9=_0x8413e5['slice'](-0x1);if(_0x2e2ed9==='/'||_0x2e2ed9==='\x5c'||_0x2e2ed9===':'){_0x8413e5=_0x8413e5[_0x29fe('0x62')](0x0,_0x8413e5[_0x29fe('0x63')](_0x2e2ed9));}if(!_0x52d214[_0x29fe('0x58')]){throw new Error(_0x29fe('0x64'));}return getAccessToken(_0x52d214);})[_0x29fe('0x22')](function(_0x2eb5a9){if(_0x2eb5a9){return rp({'method':_0x29fe('0x65'),'uri':util[_0x29fe('0x66')](_0x29fe('0x67'),_0x32deb4),'qs':{'module':'Calls'},'headers':{'Authorization':_0x29fe('0x68')+_0x2eb5a9},'json':!![]});}})[_0x29fe('0x22')](function(_0x1f374b){if(_0x1f374b){if(_0x1f374b[_0x29fe('0x69')]&&_0x1f374b[_0x29fe('0x69')][_0x29fe('0x24')]){throw new Error(_0x1f374b[_0x29fe('0x69')][_0x29fe('0x24')][_0x29fe('0x6a')]);}var _0x165258=[];var _0x1fcb32=[];var _0x439059=[_0x29fe('0x6b'),_0x29fe('0x6c'),_0x29fe('0x6d'),_0x29fe('0x6e'),_0x29fe('0x6f'),_0x29fe('0x70'),_0x29fe('0x71'),'Call_Type'];_0x1fcb32=_['remove'](_0x1f374b[_0x29fe('0x33')],function(_0x852d56){return _0x439059[_0x29fe('0x72')](_0x852d56[_0x29fe('0x73')]);});for(var _0x29dceb=0x0;_0x29dceb<_0x1fcb32[_0x29fe('0x34')];_0x29dceb++){if(_0x1fcb32[_0x29dceb][_0x29fe('0x74')]===![]){_0x165258[_0x29fe('0x75')]({'id':_0x1fcb32[_0x29dceb]['id'],'name':_0x1fcb32[_0x29dceb][_0x29fe('0x76')],'custom':_0x1fcb32[_0x29dceb][_0x29fe('0x77')],'options':_0x1fcb32[_0x29dceb][_0x29fe('0x78')]===_0x29fe('0x79')&&_0x1fcb32[_0x29dceb][_0x29fe('0x7a')][_0x29fe('0x34')]>-0x1?_[_0x29fe('0x27')](_0x1fcb32[_0x29dceb][_0x29fe('0x7a')],function(_0x40b635){return{'name':_0x40b635,'value':_0x40b635};}):[]});}}return{'count':_0x165258[_0x29fe('0x34')],'rows':_0x165258};}else{return{'count':0x0,'rows':[]};}})[_0x29fe('0x22')](respondWithResult(_0x12bd2f,null))['catch'](function(_0x1e37f5){var _0xe6695a=_0x5e184a[_0x29fe('0x2e')][_0x29fe('0x7b')]?0x1f4:_0x1e37f5['statusCode']||0x1f4;logger[_0x29fe('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x29fe('0x5d'),_0xe6695a,JSON[_0x29fe('0x7c')](_0x1e37f5));delete _0x1e37f5[_0x29fe('0x26')];if(_0xe6695a===0x191){_0xe6695a=0x190;}_0x12bd2f[_0x29fe('0x17')](_0xe6695a)['send'](_0x5e184a[_0x29fe('0x2e')][_0x29fe('0x7b')]?{'message':_0x29fe('0x7d'),'statusCode':_0x1e37f5[_0x29fe('0x7e')]}:_0x1e37f5);});}; \ No newline at end of file +var _0x4580=['query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','ZohoAccount','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','getConfigurations','findOne','pick','filter','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','system_mandatory','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','rawAttributes','fieldName','key'];(function(_0x1d389c,_0x1e59d7){var _0x3a4548=function(_0x414912){while(--_0x414912){_0x1d389c['push'](_0x1d389c['shift']());}};_0x3a4548(++_0x1e59d7);}(_0x4580,0x14a));var _0x0458=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x4580[_0x5cd51d];return _0x444608;};'use strict';var emlformat=require(_0x0458('0x0'));var rimraf=require(_0x0458('0x1'));var zipdir=require(_0x0458('0x2'));var jsonpatch=require(_0x0458('0x3'));var rp=require(_0x0458('0x4'));var moment=require('moment');var BPromise=require(_0x0458('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0458('0x6'));var ejs=require(_0x0458('0x7'));var fs=require('fs');var fs_extra=require(_0x0458('0x8'));var _=require(_0x0458('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0458('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0458('0x6'));var querystring=require(_0x0458('0xb'));var Papa=require(_0x0458('0xc'));var Redis=require(_0x0458('0xd'));var authService=require(_0x0458('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0458('0xf'));var logger=require(_0x0458('0x10'))(_0x0458('0x11'));var utils=require(_0x0458('0x12'));var config=require(_0x0458('0x13'));var licenseUtil=require(_0x0458('0x14'));var db=require(_0x0458('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1fe30e,_0x4ae6d8){_0x4ae6d8=_0x4ae6d8||0xcc;return function(_0x288de9){if(_0x288de9){return _0x1fe30e['sendStatus'](_0x4ae6d8);}return _0x1fe30e['status'](_0x4ae6d8)[_0x0458('0x16')]();};}function respondWithResult(_0x2b0ad5,_0x242696){_0x242696=_0x242696||0xc8;return function(_0xac8ab3){if(_0xac8ab3){return _0x2b0ad5[_0x0458('0x17')](_0x242696)[_0x0458('0x18')](_0xac8ab3);}};}function respondWithFilteredResult(_0xe4e985,_0x80d335){return function(_0x10d02b){if(_0x10d02b){var _0x234cd7=typeof _0x80d335['offset']===_0x0458('0x19')&&typeof _0x80d335[_0x0458('0x1a')]===_0x0458('0x19');var _0x56f73a=_0x10d02b['count'];var _0x3a53af=_0x234cd7?0x0:_0x80d335[_0x0458('0x1b')];var _0x500a97=_0x234cd7?_0x10d02b[_0x0458('0x1c')]:_0x80d335[_0x0458('0x1b')]+_0x80d335[_0x0458('0x1a')];var _0x93a0c1;if(_0x500a97>=_0x56f73a){_0x500a97=_0x56f73a;_0x93a0c1=0xc8;}else{_0x93a0c1=0xce;}_0xe4e985[_0x0458('0x17')](_0x93a0c1);return _0xe4e985['set'](_0x0458('0x1d'),_0x3a53af+'-'+_0x500a97+'/'+_0x56f73a)['json'](_0x10d02b);}return null;};}function patchUpdates(_0x22fc69){return function(_0x5889e6){try{jsonpatch[_0x0458('0x1e')](_0x5889e6,_0x22fc69,!![]);}catch(_0x58bb0f){return BPromise[_0x0458('0x1f')](_0x58bb0f);}return _0x5889e6[_0x0458('0x20')]();};}function saveUpdates(_0x35a58d,_0x5557a9){return function(_0x1dcf80){if(_0x1dcf80){return _0x1dcf80['update'](_0x35a58d)[_0x0458('0x21')](function(_0x46c40d){return _0x46c40d;});}return null;};}function removeEntity(_0x175e8e,_0x4e021f){return function(_0x3c7d64){if(_0x3c7d64){return _0x3c7d64[_0x0458('0x22')]()[_0x0458('0x21')](function(){_0x175e8e[_0x0458('0x17')](0xcc)[_0x0458('0x16')]();});}};}function handleEntityNotFound(_0x2760b,_0x33447c){return function(_0x10e79c){if(!_0x10e79c){_0x2760b['sendStatus'](0x194);}return _0x10e79c;};}function handleError(_0x5e3bcc,_0x5c851){_0x5c851=_0x5c851||0x1f4;return function(_0x29d6be){logger['error'](_0x29d6be[_0x0458('0x23')]);if(_0x29d6be['name']){delete _0x29d6be[_0x0458('0x24')];}_0x5e3bcc[_0x0458('0x17')](_0x5c851)[_0x0458('0x25')](_0x29d6be);};}exports['index']=function(_0x55edaf,_0x387929){var _0x3b1cb6={},_0x36df70={},_0x574375={'count':0x0,'rows':[]};var _0x2a9cd9=_[_0x0458('0x26')](db['ZohoAccount'][_0x0458('0x27')],function(_0x28ea5b){return{'name':_0x28ea5b[_0x0458('0x28')],'type':_0x28ea5b['type'][_0x0458('0x29')]};});_0x36df70['model']=_[_0x0458('0x26')](_0x2a9cd9,'name');_0x36df70[_0x0458('0x2a')]=_['keys'](_0x55edaf[_0x0458('0x2a')]);_0x36df70['filters']=_[_0x0458('0x2b')](_0x36df70[_0x0458('0x2c')],_0x36df70[_0x0458('0x2a')]);_0x3b1cb6[_0x0458('0x2d')]=_[_0x0458('0x2b')](_0x36df70[_0x0458('0x2c')],qs[_0x0458('0x2e')](_0x55edaf[_0x0458('0x2a')]['fields']));_0x3b1cb6['attributes']=_0x3b1cb6[_0x0458('0x2d')][_0x0458('0x2f')]?_0x3b1cb6[_0x0458('0x2d')]:_0x36df70[_0x0458('0x2c')];if(!_0x55edaf[_0x0458('0x2a')][_0x0458('0x30')](_0x0458('0x31'))){_0x3b1cb6['limit']=qs[_0x0458('0x1a')](_0x55edaf['query'][_0x0458('0x1a')]);_0x3b1cb6['offset']=qs['offset'](_0x55edaf[_0x0458('0x2a')][_0x0458('0x1b')]);}_0x3b1cb6[_0x0458('0x32')]=qs['sort'](_0x55edaf[_0x0458('0x2a')][_0x0458('0x33')]);_0x3b1cb6[_0x0458('0x34')]=qs[_0x0458('0x35')](_['pick'](_0x55edaf[_0x0458('0x2a')],_0x36df70['filters']),_0x2a9cd9);if(_0x55edaf[_0x0458('0x2a')]['filter']){_0x3b1cb6[_0x0458('0x34')]=_[_0x0458('0x36')](_0x3b1cb6[_0x0458('0x34')],{'$or':_[_0x0458('0x26')](_0x2a9cd9,function(_0x4c91b5){if(_0x4c91b5[_0x0458('0x37')]!==_0x0458('0x38')){var _0x248f33={};_0x248f33[_0x4c91b5['name']]={'$like':'%'+_0x55edaf['query']['filter']+'%'};return _0x248f33;}})});}_0x3b1cb6=_[_0x0458('0x36')]({},_0x3b1cb6,_0x55edaf['options']);var _0x2e1d49={'where':_0x3b1cb6[_0x0458('0x34')]};return db[_0x0458('0x39')][_0x0458('0x1c')](_0x2e1d49)[_0x0458('0x21')](function(_0x4901f1){_0x574375['count']=_0x4901f1;if(_0x55edaf[_0x0458('0x2a')][_0x0458('0x3a')]){_0x3b1cb6[_0x0458('0x3b')]=[{'all':!![]}];}return db[_0x0458('0x39')][_0x0458('0x3c')](_0x3b1cb6);})[_0x0458('0x21')](function(_0x2fce2b){_0x574375[_0x0458('0x3d')]=_0x2fce2b;return _0x574375;})[_0x0458('0x21')](respondWithFilteredResult(_0x387929,_0x3b1cb6))[_0x0458('0x3e')](handleError(_0x387929,null));};exports[_0x0458('0x3f')]=function(_0x4f6da7,_0x4db901){var _0x3b30ac={'raw':![],'where':{'id':_0x4f6da7['params']['id']}},_0x50c436={};_0x50c436[_0x0458('0x2c')]=_['keys'](db[_0x0458('0x39')][_0x0458('0x27')]);_0x50c436[_0x0458('0x2a')]=_[_0x0458('0x40')](_0x4f6da7['query']);_0x50c436[_0x0458('0x35')]=_[_0x0458('0x2b')](_0x50c436[_0x0458('0x2c')],_0x50c436[_0x0458('0x2a')]);_0x3b30ac[_0x0458('0x2d')]=_[_0x0458('0x2b')](_0x50c436['model'],qs[_0x0458('0x2e')](_0x4f6da7[_0x0458('0x2a')][_0x0458('0x2e')]));_0x3b30ac[_0x0458('0x2d')]=_0x3b30ac['attributes'][_0x0458('0x2f')]?_0x3b30ac[_0x0458('0x2d')]:_0x50c436[_0x0458('0x2c')];if(_0x4f6da7[_0x0458('0x2a')][_0x0458('0x3a')]){_0x3b30ac[_0x0458('0x3b')]=[{'all':!![]}];}_0x3b30ac=_[_0x0458('0x36')]({},_0x3b30ac,_0x4f6da7[_0x0458('0x41')]);return db[_0x0458('0x39')][_0x0458('0x42')](_0x3b30ac)[_0x0458('0x21')](handleEntityNotFound(_0x4db901,null))[_0x0458('0x21')](respondWithResult(_0x4db901,null))[_0x0458('0x3e')](handleError(_0x4db901,null));};exports['create']=function(_0x286263,_0x46b58f){return db['ZohoAccount'][_0x0458('0x43')](_0x286263['body'],{})[_0x0458('0x21')](respondWithResult(_0x46b58f,0xc9))[_0x0458('0x3e')](handleError(_0x46b58f,null));};exports['update']=function(_0x437efb,_0x59741b){if(_0x437efb[_0x0458('0x44')]['id']){delete _0x437efb[_0x0458('0x44')]['id'];}return db[_0x0458('0x39')][_0x0458('0x42')]({'where':{'id':_0x437efb[_0x0458('0x45')]['id']}})['then'](handleEntityNotFound(_0x59741b,null))[_0x0458('0x21')](saveUpdates(_0x437efb[_0x0458('0x44')],null))[_0x0458('0x21')](respondWithResult(_0x59741b,null))[_0x0458('0x3e')](handleError(_0x59741b,null));};exports[_0x0458('0x22')]=function(_0x48d142,_0xc00b52){return db['ZohoAccount']['find']({'where':{'id':_0x48d142[_0x0458('0x45')]['id']}})[_0x0458('0x21')](handleEntityNotFound(_0xc00b52,null))[_0x0458('0x21')](removeEntity(_0xc00b52,null))[_0x0458('0x3e')](handleError(_0xc00b52,null));};exports[_0x0458('0x46')]=function(_0x2c8ff3,_0x3d8e1f,_0x3fcd98){var _0x492867={};var _0x4e4b54={};var _0xc84c84;var _0x3b42b9;return db['ZohoAccount'][_0x0458('0x47')]({'where':{'id':_0x2c8ff3[_0x0458('0x45')]['id']}})[_0x0458('0x21')](handleEntityNotFound(_0x3d8e1f,null))[_0x0458('0x21')](function(_0x103c91){if(_0x103c91){_0xc84c84=_0x103c91;_0x4e4b54[_0x0458('0x2c')]=_[_0x0458('0x40')](db['ZohoConfiguration'][_0x0458('0x27')]);_0x4e4b54[_0x0458('0x2a')]=_[_0x0458('0x40')](_0x2c8ff3[_0x0458('0x2a')]);_0x4e4b54[_0x0458('0x35')]=_[_0x0458('0x2b')](_0x4e4b54['model'],_0x4e4b54[_0x0458('0x2a')]);_0x492867[_0x0458('0x2d')]=_['intersection'](_0x4e4b54[_0x0458('0x2c')],qs[_0x0458('0x2e')](_0x2c8ff3[_0x0458('0x2a')][_0x0458('0x2e')]));_0x492867['attributes']=_0x492867[_0x0458('0x2d')][_0x0458('0x2f')]?_0x492867[_0x0458('0x2d')]:_0x4e4b54[_0x0458('0x2c')];_0x492867[_0x0458('0x32')]=qs[_0x0458('0x33')](_0x2c8ff3[_0x0458('0x2a')][_0x0458('0x33')]);_0x492867[_0x0458('0x34')]=qs['filters'](_[_0x0458('0x48')](_0x2c8ff3[_0x0458('0x2a')],_0x4e4b54['filters']));if(_0x2c8ff3[_0x0458('0x2a')]['filter']){_0x492867[_0x0458('0x34')]=_[_0x0458('0x36')](_0x492867[_0x0458('0x34')],{'$or':_[_0x0458('0x26')](_0x492867[_0x0458('0x2d')],function(_0x19c010){var _0x14a9ca={};_0x14a9ca[_0x19c010]={'$like':'%'+_0x2c8ff3[_0x0458('0x2a')][_0x0458('0x49')]+'%'};return _0x14a9ca;})});}_0x492867=_[_0x0458('0x36')]({},_0x492867,_0x2c8ff3[_0x0458('0x41')]);return _0xc84c84[_0x0458('0x46')](_0x492867);}})['then'](function(_0x5bdf07){if(_0x5bdf07){_0x3b42b9=_0x5bdf07[_0x0458('0x2f')];if(!_0x2c8ff3[_0x0458('0x2a')]['hasOwnProperty'](_0x0458('0x31'))){_0x492867[_0x0458('0x1a')]=qs[_0x0458('0x1a')](_0x2c8ff3[_0x0458('0x2a')]['limit']);_0x492867[_0x0458('0x1b')]=qs[_0x0458('0x1b')](_0x2c8ff3[_0x0458('0x2a')]['offset']);}return _0xc84c84['getConfigurations'](_0x492867);}})[_0x0458('0x21')](function(_0x1e8f72){if(_0x1e8f72){return _0x1e8f72?{'count':_0x3b42b9,'rows':_0x1e8f72}:null;}})[_0x0458('0x21')](respondWithResult(_0x3d8e1f,null))['catch'](handleError(_0x3d8e1f,null));};exports[_0x0458('0x4a')]=function(_0x47b24b,_0x33b98e,_0x4102d2){if(_0x47b24b['body']['id']){delete _0x47b24b[_0x0458('0x44')]['id'];}return db[_0x0458('0x39')]['findOne']({'where':{'id':_0x47b24b[_0x0458('0x45')]['id']}})[_0x0458('0x21')](handleEntityNotFound(_0x33b98e,null))[_0x0458('0x21')](function(_0x2fe239){if(_0x2fe239){_0x47b24b['body'][_0x0458('0x4b')]=_0x2fe239['id'];_0x47b24b['body'][_0x0458('0x4c')]=integrations[_0x0458('0x4d')](_0x47b24b[_0x0458('0x44')]['channel'],_0x47b24b[_0x0458('0x44')][_0x0458('0x37')]);_0x47b24b[_0x0458('0x44')][_0x0458('0x4e')]=integrations['getDescriptions'](_0x47b24b[_0x0458('0x44')][_0x0458('0x4f')],_0x47b24b[_0x0458('0x44')][_0x0458('0x37')]);return db[_0x0458('0x50')][_0x0458('0x43')](_0x47b24b['body'],{'include':[{'model':db[_0x0458('0x51')],'as':_0x0458('0x4c')},{'model':db[_0x0458('0x51')],'as':_0x0458('0x4e')}]});}return null;})[_0x0458('0x21')](respondWithResult(_0x33b98e,null))[_0x0458('0x3e')](handleError(_0x33b98e,null));};function getAccessToken(_0x1d7c65){return new Promise(function(_0x478336,_0x34a9d8){var _0x1bad86;switch(_0x1d7c65['zone']){case'US':_0x1bad86='https://accounts.zoho.com';break;case'AU':_0x1bad86=_0x0458('0x52');break;case'EU':_0x1bad86='https://accounts.zoho.eu';break;case'IN':_0x1bad86='https://accounts.zoho.in';break;case'CN':_0x1bad86=_0x0458('0x53');break;default:_0x1bad86=_0x0458('0x54');break;}var _0x32a123={'method':'POST','uri':_0x1bad86+_0x0458('0x55'),'qs':{'refresh_token':_0x1d7c65[_0x0458('0x56')],'client_id':_0x1d7c65[_0x0458('0x57')],'client_secret':_0x1d7c65[_0x0458('0x58')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x32a123)[_0x0458('0x21')](function(_0x548767){if(_0x548767['access_token']){_0x478336(_0x548767[_0x0458('0x59')]);}else{_0x34a9d8(_0x0458('0x5a'));}})[_0x0458('0x3e')](function(_0x4a3684){_0x34a9d8(_0x4a3684);});});}exports[_0x0458('0x5b')]=function(_0x5ca7f1,_0x200c62,_0xb8c782){var _0x1c2adb,_0x2481c6,_0x5003e9,_0x4e9235,_0x4138b0;return db[_0x0458('0x39')][_0x0458('0x47')]({'where':{'id':_0x5ca7f1[_0x0458('0x45')]['id']},'attributes':['id','host',_0x0458('0x5c'),_0x0458('0x57'),_0x0458('0x58'),_0x0458('0x5d'),_0x0458('0x5e'),_0x0458('0x56')]})[_0x0458('0x21')](handleEntityNotFound(_0x200c62,null))[_0x0458('0x21')](function(_0x3265b2){_0x4138b0=_0x3265b2;_0x1c2adb=_0x4138b0['host'];_0x2481c6=_0x1c2adb===_0x0458('0x5f')?'eu':_0x0458('0x60');_0x5003e9=_0x4138b0[_0x0458('0x5d')];var _0x1195ff=_0x5003e9['slice'](-0x1);if(_0x1195ff==='/'||_0x1195ff==='\x5c'||_0x1195ff===':'){_0x5003e9=_0x5003e9[_0x0458('0x61')](0x0,_0x5003e9[_0x0458('0x62')](_0x1195ff));}if(!_0x4138b0[_0x0458('0x56')]){throw new Error(_0x0458('0x63'));}return getAccessToken(_0x4138b0);})[_0x0458('0x21')](function(_0x10c78c){if(_0x10c78c){return rp({'method':_0x0458('0x64'),'uri':util[_0x0458('0x65')](_0x0458('0x66'),_0x2481c6),'qs':{'module':_0x0458('0x67')},'headers':{'Authorization':_0x0458('0x68')+_0x10c78c},'json':!![]});}})[_0x0458('0x21')](function(_0x19c9c6){if(_0x19c9c6){if(_0x19c9c6[_0x0458('0x69')]&&_0x19c9c6['response'][_0x0458('0x6a')]){throw new Error(_0x19c9c6[_0x0458('0x69')][_0x0458('0x6a')][_0x0458('0x6b')]);}var _0x2d75e7=[];var _0x2855a8=[];var _0xf0c756=[_0x0458('0x6c'),_0x0458('0x6d'),_0x0458('0x6e'),_0x0458('0x6f'),'Call_Duration',_0x0458('0x70'),_0x0458('0x71'),'Call_Type'];_0x2855a8=_[_0x0458('0x72')](_0x19c9c6[_0x0458('0x2e')],function(_0x3f6ebd){return _0xf0c756[_0x0458('0x73')](_0x3f6ebd['api_name']);});for(var _0x426ab3=0x0;_0x426ab3<_0x2855a8[_0x0458('0x2f')];_0x426ab3++){if(_0x2855a8[_0x426ab3][_0x0458('0x74')]===![]){_0x2d75e7['push']({'id':_0x2855a8[_0x426ab3]['id'],'name':_0x2855a8[_0x426ab3]['display_label'],'custom':_0x2855a8[_0x426ab3][_0x0458('0x75')],'options':_0x2855a8[_0x426ab3][_0x0458('0x76')]===_0x0458('0x77')&&_0x2855a8[_0x426ab3]['pick_list_values']['length']>-0x1?_[_0x0458('0x26')](_0x2855a8[_0x426ab3]['pick_list_values'],function(_0x173d4c){return{'name':_0x173d4c,'value':_0x173d4c};}):[]});}}return{'count':_0x2d75e7[_0x0458('0x2f')],'rows':_0x2d75e7};}else{return{'count':0x0,'rows':[]};}})[_0x0458('0x21')](respondWithResult(_0x200c62,null))[_0x0458('0x3e')](function(_0x903943){var _0x48bf48=_0x5ca7f1[_0x0458('0x2a')][_0x0458('0x78')]?0x1f4:_0x903943[_0x0458('0x79')]||0x1f4;logger[_0x0458('0x6a')](_0x0458('0x7a'),_0x0458('0x5b'),_0x48bf48,JSON[_0x0458('0x7b')](_0x903943));delete _0x903943[_0x0458('0x24')];if(_0x48bf48===0x191){_0x48bf48=0x190;}_0x200c62[_0x0458('0x17')](_0x48bf48)[_0x0458('0x25')](_0x5ca7f1[_0x0458('0x2a')][_0x0458('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x903943[_0x0458('0x79')]}:_0x903943);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f18d676..a55f19b 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 _0x6e0c=['host','serverUrl','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','clientId','substring','lastIndexOf','https://accounts.zoho.in','/oauth/v2/token','then','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','code'];(function(_0x2dbab1,_0x132aac){var _0x3cd451=function(_0x204866){while(--_0x204866){_0x2dbab1['push'](_0x2dbab1['shift']());}};_0x3cd451(++_0x132aac);}(_0x6e0c,0x148));var _0xc6e0=function(_0x6c6d75,_0xef7deb){_0x6c6d75=_0x6c6d75-0x0;var _0x48a161=_0x6e0c[_0x6c6d75];return _0x48a161;};'use strict';var _=require(_0xc6e0('0x0'));var util=require(_0xc6e0('0x1'));var logger=require(_0xc6e0('0x2'))(_0xc6e0('0x3'));var moment=require(_0xc6e0('0x4'));var BPromise=require(_0xc6e0('0x5'));var rp=require(_0xc6e0('0x6'));var fs=require('fs');var path=require(_0xc6e0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc6e0('0x8'));var integrations=require(_0xc6e0('0x9'));module[_0xc6e0('0xa')]=function(_0x26ff4d,_0x114479){return _0x26ff4d['define'](_0xc6e0('0xb'),attributes,{'tableName':_0xc6e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x31bbc1,_0x1cab55,_0x2043dd){if(_0x31bbc1[_0xc6e0('0xd')](_0xc6e0('0xe'))||_0x31bbc1[_0xc6e0('0xd')]('serverUrl')||_0x31bbc1[_0xc6e0('0xd')]('clientId')||_0x31bbc1[_0xc6e0('0xd')]('clientSecret')||_0x31bbc1[_0xc6e0('0xd')](_0xc6e0('0xf'))||_0x31bbc1[_0xc6e0('0xd')](_0xc6e0('0x10'))){var _0x1f27ca,_0x59ab7f;_0x1f27ca=_0x31bbc1[_0xc6e0('0x11')];var _0x50529e=_0x1f27ca[_0xc6e0('0x12')](-0x1);if(_0x50529e==='/'||_0x50529e==='\x5c'||_0x50529e===':'){_0x1f27ca=_0x1f27ca['substring'](0x0,_0x1f27ca['lastIndexOf'](_0x50529e));}switch(_0x31bbc1[_0xc6e0('0xe')]){case'US':_0x59ab7f=_0xc6e0('0x13');break;case'AU':_0x59ab7f=_0xc6e0('0x14');break;case'IN':_0x59ab7f='https://accounts.zoho.in';break;case'CN':_0x59ab7f=_0xc6e0('0x15');break;default:_0x59ab7f=_0xc6e0('0x16');break;}var _0x553c03={'method':_0xc6e0('0x17'),'uri':_0x59ab7f+'/oauth/v2/token','form':{'grant_type':_0xc6e0('0x18'),'client_id':_0x31bbc1['clientId'],'client_secret':_0x31bbc1[_0xc6e0('0x19')],'redirect_uri':_0x31bbc1[_0xc6e0('0x11')],'code':_0x31bbc1[_0xc6e0('0xf')]},'headers':{'Content-Type':_0xc6e0('0x1a')}};return rp(_0x553c03)['then'](function(_0x4d690c){var _0x4e68fe=JSON[_0xc6e0('0x1b')](_0x4d690c);if(_0x4e68fe[_0xc6e0('0x1c')]){_0x31bbc1['refreshToken']=_0x4e68fe[_0xc6e0('0x1c')];logger['info'](util['format'](_0xc6e0('0x1d'),_0x31bbc1['name'],_0x31bbc1['id']));}else{logger[_0xc6e0('0x1e')](util[_0xc6e0('0x1f')](_0xc6e0('0x20'),_0x31bbc1[_0xc6e0('0x21')],_0x31bbc1['id']),util[_0xc6e0('0x22')](_0x4e68fe,{'showHidden':![],'depth':null}));}return _0x2043dd(null,_0x1cab55);})[_0xc6e0('0x23')](function(_0x1577e4){logger['error'](util['format'](_0xc6e0('0x20'),_0x31bbc1[_0xc6e0('0x21')],_0x31bbc1['id']),util[_0xc6e0('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x2043dd(_0x1577e4);});}else{return _0x2043dd(null,_0x1cab55);}},'beforeUpdate':function(_0x4fb66b,_0x316126,_0x13c0a9){if(_0x4fb66b[_0xc6e0('0xd')](_0xc6e0('0xe'))||_0x4fb66b[_0xc6e0('0xd')]('serverUrl')||_0x4fb66b[_0xc6e0('0xd')](_0xc6e0('0x24'))||_0x4fb66b[_0xc6e0('0xd')](_0xc6e0('0x19'))||_0x4fb66b[_0xc6e0('0xd')]('code')||_0x4fb66b[_0xc6e0('0xd')]('host')){var _0xd3a206,_0x5d265f;_0xd3a206=_0x4fb66b['serverUrl'];var _0x51c361=_0xd3a206[_0xc6e0('0x12')](-0x1);if(_0x51c361==='/'||_0x51c361==='\x5c'||_0x51c361===':'){_0xd3a206=_0xd3a206[_0xc6e0('0x25')](0x0,_0xd3a206[_0xc6e0('0x26')](_0x51c361));}switch(_0x4fb66b[_0xc6e0('0xe')]){case'US':_0x5d265f=_0xc6e0('0x13');break;case'AU':_0x5d265f=_0xc6e0('0x14');break;case'IN':_0x5d265f=_0xc6e0('0x27');break;case'CN':_0x5d265f=_0xc6e0('0x15');break;default:_0x5d265f=_0xc6e0('0x16');break;}var _0x26cb8e={'method':_0xc6e0('0x17'),'uri':_0x5d265f+_0xc6e0('0x28'),'form':{'grant_type':_0xc6e0('0x18'),'client_id':_0x4fb66b[_0xc6e0('0x24')],'client_secret':_0x4fb66b[_0xc6e0('0x19')],'redirect_uri':_0x4fb66b[_0xc6e0('0x11')],'code':_0x4fb66b[_0xc6e0('0xf')]},'headers':{'Content-Type':_0xc6e0('0x1a')}};return rp(_0x26cb8e)[_0xc6e0('0x29')](function(_0x177c8c){var _0x325403=JSON['parse'](_0x177c8c);if(_0x325403['refresh_token']){_0x4fb66b[_0xc6e0('0x2a')]=_0x325403[_0xc6e0('0x1c')];logger['info'](util['format'](_0xc6e0('0x1d'),_0x4fb66b[_0xc6e0('0x21')],_0x4fb66b['id']));}else{logger[_0xc6e0('0x1e')](util['format'](_0xc6e0('0x20'),_0x4fb66b[_0xc6e0('0x21')],_0x4fb66b['id']),util[_0xc6e0('0x22')](_0x325403,{'showHidden':![],'depth':null}));}return _0x13c0a9(null,_0x316126);})[_0xc6e0('0x23')](function(_0x35acc4){logger[_0xc6e0('0x1e')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4fb66b[_0xc6e0('0x21')],_0x4fb66b['id']),util[_0xc6e0('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x13c0a9(_0x35acc4);});}else{return _0x13c0a9(null,_0x316126);}}}});}; \ No newline at end of file +var _0x74a5=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.com.au','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','info','name','error','inspect','catch','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','application/x-www-form-urlencoded','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x304e0e,_0x33b054){var _0x568db1=function(_0x3db7dc){while(--_0x3db7dc){_0x304e0e['push'](_0x304e0e['shift']());}};_0x568db1(++_0x33b054);}(_0x74a5,0x77));var _0x574a=function(_0x51ce3e,_0x4a1ed5){_0x51ce3e=_0x51ce3e-0x0;var _0x175562=_0x74a5[_0x51ce3e];return _0x175562;};'use strict';var _=require(_0x574a('0x0'));var util=require(_0x574a('0x1'));var logger=require(_0x574a('0x2'))(_0x574a('0x3'));var moment=require(_0x574a('0x4'));var BPromise=require(_0x574a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x574a('0x6'));var config=require(_0x574a('0x7'));var attributes=require(_0x574a('0x8'));var integrations=require(_0x574a('0x9'));module['exports']=function(_0x4593ea,_0x11f79a){return _0x4593ea[_0x574a('0xa')](_0x574a('0xb'),attributes,{'tableName':_0x574a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x172d50,_0x442908,_0x117d3f){if(_0x172d50[_0x574a('0xd')](_0x574a('0xe'))||_0x172d50['changed'](_0x574a('0xf'))||_0x172d50[_0x574a('0xd')](_0x574a('0x10'))||_0x172d50[_0x574a('0xd')](_0x574a('0x11'))||_0x172d50[_0x574a('0xd')]('code')||_0x172d50['changed']('host')){var _0x2c5d11,_0x5eabfa;_0x2c5d11=_0x172d50[_0x574a('0xf')];var _0x5c6c50=_0x2c5d11[_0x574a('0x12')](-0x1);if(_0x5c6c50==='/'||_0x5c6c50==='\x5c'||_0x5c6c50===':'){_0x2c5d11=_0x2c5d11[_0x574a('0x13')](0x0,_0x2c5d11[_0x574a('0x14')](_0x5c6c50));}switch(_0x172d50['zone']){case'US':_0x5eabfa='https://accounts.zoho.com';break;case'AU':_0x5eabfa=_0x574a('0x15');break;case'IN':_0x5eabfa='https://accounts.zoho.in';break;case'CN':_0x5eabfa='https://accounts.zoho.com.cn';break;default:_0x5eabfa='https://accounts.zoho.eu';break;}var _0x5ce0e2={'method':_0x574a('0x16'),'uri':_0x5eabfa+_0x574a('0x17'),'form':{'grant_type':_0x574a('0x18'),'client_id':_0x172d50[_0x574a('0x10')],'client_secret':_0x172d50[_0x574a('0x11')],'redirect_uri':_0x172d50[_0x574a('0xf')],'code':_0x172d50[_0x574a('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5ce0e2)[_0x574a('0x1a')](function(_0x561fba){var _0x44bce6=JSON[_0x574a('0x1b')](_0x561fba);if(_0x44bce6[_0x574a('0x1c')]){_0x172d50['refreshToken']=_0x44bce6[_0x574a('0x1c')];logger[_0x574a('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x172d50[_0x574a('0x1e')],_0x172d50['id']));}else{logger[_0x574a('0x1f')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x172d50['name'],_0x172d50['id']),util[_0x574a('0x20')](_0x44bce6,{'showHidden':![],'depth':null}));}return _0x117d3f(null,_0x442908);})[_0x574a('0x21')](function(_0x2d634f){logger[_0x574a('0x1f')](util[_0x574a('0x22')](_0x574a('0x23'),_0x172d50[_0x574a('0x1e')],_0x172d50['id']),util[_0x574a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x117d3f(_0x2d634f);});}else{return _0x117d3f(null,_0x442908);}},'beforeUpdate':function(_0x213476,_0x4efcce,_0x404800){if(_0x213476[_0x574a('0xd')](_0x574a('0xe'))||_0x213476[_0x574a('0xd')]('serverUrl')||_0x213476[_0x574a('0xd')](_0x574a('0x10'))||_0x213476['changed'](_0x574a('0x11'))||_0x213476[_0x574a('0xd')](_0x574a('0x19'))||_0x213476[_0x574a('0xd')](_0x574a('0x24'))){var _0x379229,_0x58919c;_0x379229=_0x213476[_0x574a('0xf')];var _0x4cd334=_0x379229[_0x574a('0x12')](-0x1);if(_0x4cd334==='/'||_0x4cd334==='\x5c'||_0x4cd334===':'){_0x379229=_0x379229[_0x574a('0x13')](0x0,_0x379229[_0x574a('0x14')](_0x4cd334));}switch(_0x213476['zone']){case'US':_0x58919c='https://accounts.zoho.com';break;case'AU':_0x58919c=_0x574a('0x15');break;case'IN':_0x58919c=_0x574a('0x25');break;case'CN':_0x58919c=_0x574a('0x26');break;default:_0x58919c=_0x574a('0x27');break;}var _0x477eef={'method':'POST','uri':_0x58919c+_0x574a('0x17'),'form':{'grant_type':_0x574a('0x18'),'client_id':_0x213476[_0x574a('0x10')],'client_secret':_0x213476['clientSecret'],'redirect_uri':_0x213476[_0x574a('0xf')],'code':_0x213476[_0x574a('0x19')]},'headers':{'Content-Type':_0x574a('0x28')}};return rp(_0x477eef)[_0x574a('0x1a')](function(_0x26a0d3){var _0x260c5c=JSON[_0x574a('0x1b')](_0x26a0d3);if(_0x260c5c['refresh_token']){_0x213476['refreshToken']=_0x260c5c[_0x574a('0x1c')];logger[_0x574a('0x1d')](util['format'](_0x574a('0x29'),_0x213476['name'],_0x213476['id']));}else{logger[_0x574a('0x1f')](util[_0x574a('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x213476[_0x574a('0x1e')],_0x213476['id']),util['inspect'](_0x260c5c,{'showHidden':![],'depth':null}));}return _0x404800(null,_0x4efcce);})[_0x574a('0x21')](function(_0x489d3b){logger[_0x574a('0x1f')](util[_0x574a('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x213476[_0x574a('0x1e')],_0x213476['id']),util[_0x574a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x404800(_0x489d3b);});}else{return _0x404800(null,_0x4efcce);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 0a6b259..2d44c6f 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 _0x1c9a=['limit','include','map','attributes','model','ShowZohoAccount','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw'];(function(_0x4fa8e2,_0x3bd262){var _0x279c8f=function(_0xa3a0d7){while(--_0xa3a0d7){_0x4fa8e2['push'](_0x4fa8e2['shift']());}};_0x279c8f(++_0x3bd262);}(_0x1c9a,0x98));var _0xa1c9=function(_0x117907,_0x17f4bf){_0x117907=_0x117907-0x0;var _0x37a8d4=_0x1c9a[_0x117907];return _0x37a8d4;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}exports[_0xa1c9('0x17')]=function(_0x224ae4){var _0x50db9b=this;return new Promise(function(_0x2fb81e,_0x5ab911){return db[_0xa1c9('0x18')][_0xa1c9('0x19')]({'raw':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4['options'][_0xa1c9('0x1b')]===undefined?!![]:![]:!![],'where':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['where']||null:null,'attributes':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['attributes']||null:null,'limit':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1c')]||null:null,'include':_0x224ae4['options']?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')],function(_0x4a0a0c){return{'model':db[_0x4a0a0c['model']],'as':_0x4a0a0c['as'],'attributes':_0x4a0a0c[_0xa1c9('0x1f')],'include':_0x4a0a0c['include']?_[_0xa1c9('0x1e')](_0x4a0a0c[_0xa1c9('0x1d')],function(_0x1c6f37){return{'model':db[_0x1c6f37[_0xa1c9('0x20')]],'as':_0x1c6f37['as'],'attributes':_0x1c6f37[_0xa1c9('0x1f')],'include':_0x1c6f37['include']?_[_0xa1c9('0x1e')](_0x1c6f37[_0xa1c9('0x1d')],function(_0x20cbe1){return{'model':db[_0x20cbe1['model']],'as':_0x20cbe1['as'],'attributes':_0x20cbe1[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1ca443){logger['info'](_0xa1c9('0x17'),_0x224ae4);logger[_0xa1c9('0xe')]('GetZohoAccount',_0x224ae4,JSON[_0xa1c9('0x10')](_0x1ca443));_0x2fb81e(_0x1ca443);})['catch'](function(_0xdf6d0c){logger[_0xa1c9('0x11')](_0xa1c9('0x17'),_0xdf6d0c[_0xa1c9('0x14')],_0x224ae4);_0x5ab911(_0x50db9b[_0xa1c9('0x11')](0x1f4,_0xdf6d0c[_0xa1c9('0x14')]));});});};exports[_0xa1c9('0x21')]=function(_0x58b900){var _0x5648b8=this;return new Promise(function(_0x4d23cd,_0x1c7038){return db[_0xa1c9('0x18')][_0xa1c9('0x22')]({'raw':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x58b900['options']?_0x58b900['options'][_0xa1c9('0x23')]||null:null,'attributes':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1f')]||null:null,'include':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_['map'](_0x58b900[_0xa1c9('0x1a')]['include'],function(_0x1b8707){return{'model':db[_0x1b8707['model']],'as':_0x1b8707['as'],'attributes':_0x1b8707[_0xa1c9('0x1f')],'include':_0x1b8707[_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x1b8707['include'],function(_0x39818f){return{'model':db[_0x39818f[_0xa1c9('0x20')]],'as':_0x39818f['as'],'attributes':_0x39818f[_0xa1c9('0x1f')],'include':_0x39818f[_0xa1c9('0x1d')]?_['map'](_0x39818f['include'],function(_0x1f1612){return{'model':db[_0x1f1612[_0xa1c9('0x20')]],'as':_0x1f1612['as'],'attributes':_0x1f1612[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1c0cce){logger[_0xa1c9('0xc')](_0xa1c9('0x21'),_0x58b900);logger[_0xa1c9('0xe')](_0xa1c9('0x21'),_0x58b900,JSON[_0xa1c9('0x10')](_0x1c0cce));_0x4d23cd(_0x1c0cce);})['catch'](function(_0x3e6ec0){logger[_0xa1c9('0x11')](_0xa1c9('0x21'),_0x3e6ec0[_0xa1c9('0x14')],_0x58b900);_0x1c7038(_0x5648b8[_0xa1c9('0x11')](0x1f4,_0x3e6ec0[_0xa1c9('0x14')]));});});}; \ No newline at end of file +var _0x7da6=['options','attributes','include','map','model','then','GetZohoAccount','stringify','ShowZohoAccount','find','raw','where','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ZohoAccount','findAll'];(function(_0x228ade,_0x47e287){var _0x2f177a=function(_0x36fdfc){while(--_0x36fdfc){_0x228ade['push'](_0x228ade['shift']());}};_0x2f177a(++_0x47e287);}(_0x7da6,0x124));var _0x67da=function(_0x4c7149,_0x335342){_0x4c7149=_0x4c7149-0x0;var _0x200122=_0x7da6[_0x4c7149];return _0x200122;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67da('0x0'));var BPromise=require(_0x67da('0x1'));var rs=require(_0x67da('0x2'));var fs=require('fs');var Redis=require(_0x67da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67da('0x4'));var logger=require(_0x67da('0x5'))(_0x67da('0x6'));var config=require(_0x67da('0x7'));var jayson=require(_0x67da('0x8'));var client=jayson[_0x67da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb7f52,_0x49025f,_0x4cfe49){return new BPromise(function(_0x3d971d,_0x5ac004){return client[_0x67da('0xa')](_0xb7f52,_0x4cfe49)['then'](function(_0x1e8a4c){logger[_0x67da('0xb')](_0x67da('0xc'),_0x49025f,_0x67da('0xd'));logger[_0x67da('0xe')](_0x67da('0xf'),_0x49025f,_0x67da('0xd'),JSON['stringify'](_0x1e8a4c));if(_0x1e8a4c[_0x67da('0x10')]){if(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x11')]===0x1f4){logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0x1e8a4c[_0x67da('0x10')]['message']);return _0x5ac004(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x12')]);}logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0x1e8a4c[_0x67da('0x10')]['message']);return _0x3d971d(_0x1e8a4c[_0x67da('0x10')][_0x67da('0x12')]);}else{logger['info'](_0x67da('0xc'),_0x49025f,_0x67da('0xd'));_0x3d971d(_0x1e8a4c[_0x67da('0x13')][_0x67da('0x12')]);}})[_0x67da('0x14')](function(_0xb3a67){logger[_0x67da('0x10')](_0x67da('0xc'),_0x49025f,_0xb3a67);_0x5ac004(_0xb3a67);});});}exports['GetZohoAccount']=function(_0xaefe69){var _0x524819=this;return new Promise(function(_0x31454f,_0x5765d5){return db[_0x67da('0x15')][_0x67da('0x16')]({'raw':_0xaefe69[_0x67da('0x17')]?_0xaefe69[_0x67da('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xaefe69[_0x67da('0x17')]?_0xaefe69['options']['where']||null:null,'attributes':_0xaefe69[_0x67da('0x17')]?_0xaefe69[_0x67da('0x17')][_0x67da('0x18')]||null:null,'limit':_0xaefe69[_0x67da('0x17')]?_0xaefe69['options']['limit']||null:null,'include':_0xaefe69['options']?_0xaefe69[_0x67da('0x17')][_0x67da('0x19')]?_[_0x67da('0x1a')](_0xaefe69[_0x67da('0x17')][_0x67da('0x19')],function(_0x4e6cb1){return{'model':db[_0x4e6cb1['model']],'as':_0x4e6cb1['as'],'attributes':_0x4e6cb1[_0x67da('0x18')],'include':_0x4e6cb1[_0x67da('0x19')]?_['map'](_0x4e6cb1[_0x67da('0x19')],function(_0x599a9d){return{'model':db[_0x599a9d[_0x67da('0x1b')]],'as':_0x599a9d['as'],'attributes':_0x599a9d[_0x67da('0x18')],'include':_0x599a9d[_0x67da('0x19')]?_[_0x67da('0x1a')](_0x599a9d[_0x67da('0x19')],function(_0x35b1bc){return{'model':db[_0x35b1bc['model']],'as':_0x35b1bc['as'],'attributes':_0x35b1bc[_0x67da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x67da('0x1c')](function(_0x5875d9){logger['info'](_0x67da('0x1d'),_0xaefe69);logger[_0x67da('0xe')](_0x67da('0x1d'),_0xaefe69,JSON[_0x67da('0x1e')](_0x5875d9));_0x31454f(_0x5875d9);})['catch'](function(_0x1cba18){logger[_0x67da('0x10')](_0x67da('0x1d'),_0x1cba18[_0x67da('0x12')],_0xaefe69);_0x5765d5(_0x524819[_0x67da('0x10')](0x1f4,_0x1cba18[_0x67da('0x12')]));});});};exports[_0x67da('0x1f')]=function(_0x1e2bd0){var _0x36d143=this;return new Promise(function(_0x91fc5c,_0x18dd99){return db[_0x67da('0x15')][_0x67da('0x20')]({'raw':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0['options'][_0x67da('0x21')]===undefined?!![]:![]:!![],'where':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0[_0x67da('0x17')][_0x67da('0x22')]||null:null,'attributes':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0[_0x67da('0x17')]['attributes']||null:null,'include':_0x1e2bd0[_0x67da('0x17')]?_0x1e2bd0[_0x67da('0x17')][_0x67da('0x19')]?_['map'](_0x1e2bd0['options']['include'],function(_0x4cfcab){return{'model':db[_0x4cfcab[_0x67da('0x1b')]],'as':_0x4cfcab['as'],'attributes':_0x4cfcab['attributes'],'include':_0x4cfcab[_0x67da('0x19')]?_[_0x67da('0x1a')](_0x4cfcab[_0x67da('0x19')],function(_0x21c253){return{'model':db[_0x21c253[_0x67da('0x1b')]],'as':_0x21c253['as'],'attributes':_0x21c253[_0x67da('0x18')],'include':_0x21c253[_0x67da('0x19')]?_[_0x67da('0x1a')](_0x21c253[_0x67da('0x19')],function(_0x11ec02){return{'model':db[_0x11ec02[_0x67da('0x1b')]],'as':_0x11ec02['as'],'attributes':_0x11ec02[_0x67da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x67da('0x1c')](function(_0x1348bb){logger[_0x67da('0xb')](_0x67da('0x1f'),_0x1e2bd0);logger[_0x67da('0xe')](_0x67da('0x1f'),_0x1e2bd0,JSON[_0x67da('0x1e')](_0x1348bb));_0x91fc5c(_0x1348bb);})[_0x67da('0x14')](function(_0xa96a4e){logger[_0x67da('0x10')](_0x67da('0x1f'),_0xa96a4e[_0x67da('0x12')],_0x1e2bd0);_0x18dd99(_0x36d143[_0x67da('0x10')](0x1f4,_0xa96a4e[_0x67da('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9608e0c..76399d5 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 _0xcbe5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','post','create','update','exports','multer','util'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xcbe5,0x1a2));var _0x5cbe=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcbe5[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x5cbe('0x0'));var util=require(_0x5cbe('0x1'));var path=require(_0x5cbe('0x2'));var timeout=require('connect-timeout');var express=require(_0x5cbe('0x3'));var router=express[_0x5cbe('0x4')]();var fs_extra=require(_0x5cbe('0x5'));var auth=require(_0x5cbe('0x6'));var interaction=require(_0x5cbe('0x7'));var config=require(_0x5cbe('0x8'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0x5cbe('0x9')](),controller[_0x5cbe('0xa')]);router[_0x5cbe('0xb')](_0x5cbe('0xc'),auth['isAuthenticated'](),controller[_0x5cbe('0xd')]);router['get'](_0x5cbe('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x5cbe('0xb')](_0x5cbe('0xf'),auth[_0x5cbe('0x9')](),controller['getSubjects']);router['get'](_0x5cbe('0x10'),auth[_0x5cbe('0x9')](),controller['getDescriptions']);router[_0x5cbe('0x11')]('/',auth[_0x5cbe('0x9')](),controller[_0x5cbe('0x12')]);router['put'](_0x5cbe('0xc'),auth[_0x5cbe('0x9')](),controller[_0x5cbe('0x13')]);router['delete'](_0x5cbe('0xc'),auth[_0x5cbe('0x9')](),controller['destroy']);module[_0x5cbe('0x14')]=router; \ No newline at end of file +var _0x6211=['getDescriptions','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions'];(function(_0x550bc2,_0x5a5b0e){var _0x16d8dd=function(_0x158676){while(--_0x158676){_0x550bc2['push'](_0x550bc2['shift']());}};_0x16d8dd(++_0x5a5b0e);}(_0x6211,0x8a));var _0x1621=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6211[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x1621('0x0'));var util=require(_0x1621('0x1'));var path=require(_0x1621('0x2'));var timeout=require('connect-timeout');var express=require(_0x1621('0x3'));var router=express[_0x1621('0x4')]();var fs_extra=require(_0x1621('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1621('0x6'));var controller=require(_0x1621('0x7'));router[_0x1621('0x8')]('/',auth[_0x1621('0x9')](),controller[_0x1621('0xa')]);router[_0x1621('0x8')](_0x1621('0xb'),auth[_0x1621('0x9')](),controller[_0x1621('0xc')]);router[_0x1621('0x8')](_0x1621('0xd'),auth[_0x1621('0x9')](),controller['getFields']);router[_0x1621('0x8')](_0x1621('0xe'),auth[_0x1621('0x9')](),controller['getSubjects']);router[_0x1621('0x8')](_0x1621('0xf'),auth[_0x1621('0x9')](),controller[_0x1621('0x10')]);router[_0x1621('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1621('0x12')](_0x1621('0xb'),auth[_0x1621('0x9')](),controller[_0x1621('0x13')]);router[_0x1621('0x14')](_0x1621('0xb'),auth[_0x1621('0x9')](),controller['destroy']);module[_0x1621('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 8fdcc58..e44be50 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 _0x36cf=['ENUM','contact_lead','sequelize','exports','lead','nothing'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x36cf,0xbc));var _0xf36c=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x36cf[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0xf36c('0x0'));module[_0xf36c('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0xf36c('0x2'),'contact',_0xf36c('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xf36c('0x4')](_0xf36c('0x5'),'contact','lead'),'defaultValue':_0xf36c('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x643d=['lead','ENUM','contact_lead','exports','STRING','contact','nothing'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0x643d,0x1df));var _0xd643=function(_0x2820bf,_0x1550f5){_0x2820bf=_0x2820bf-0x0;var _0x4b2973=_0x643d[_0x2820bf];return _0x4b2973;};'use strict';var Sequelize=require('sequelize');module[_0xd643('0x0')]={'name':{'type':Sequelize[_0xd643('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xd643('0x2'),_0xd643('0x3')),'defaultValue':_0xd643('0x4')},'moduleSearch':{'type':Sequelize[_0xd643('0x5')]('contact_lead',_0xd643('0x2'),_0xd643('0x4')),'defaultValue':_0xd643('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index fd50fcf..7f539af 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 _0x913c=['then','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','findOne','getFields','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update'];(function(_0x28316f,_0x3088f3){var _0x4b5522=function(_0xf020d6){while(--_0xf020d6){_0x28316f['push'](_0x28316f['shift']());}};_0x4b5522(++_0x3088f3);}(_0x913c,0x7c));var _0xc913=function(_0x1dbb65,_0x108568){_0x1dbb65=_0x1dbb65-0x0;var _0x5d7702=_0x913c[_0x1dbb65];return _0x5d7702;};'use strict';var emlformat=require(_0xc913('0x0'));var rimraf=require(_0xc913('0x1'));var zipdir=require(_0xc913('0x2'));var jsonpatch=require(_0xc913('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc913('0x4'));var Mustache=require(_0xc913('0x5'));var util=require(_0xc913('0x6'));var path=require(_0xc913('0x7'));var sox=require('sox');var csv=require(_0xc913('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc913('0x9'));var squel=require(_0xc913('0xa'));var crypto=require(_0xc913('0xb'));var jsforce=require(_0xc913('0xc'));var deskjs=require(_0xc913('0xd'));var toCsv=require(_0xc913('0x8'));var querystring=require('querystring');var Papa=require(_0xc913('0xe'));var Redis=require('ioredis');var authService=require(_0xc913('0xf'));var qs=require(_0xc913('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc913('0x11'));var logger=require(_0xc913('0x12'))(_0xc913('0x13'));var utils=require('../../config/utils');var config=require(_0xc913('0x14'));var licenseUtil=require(_0xc913('0x15'));var db=require(_0xc913('0x16'))['db'];function respondWithStatusCode(_0x530e3c,_0x2be0dc){_0x2be0dc=_0x2be0dc||0xcc;return function(_0x8064c2){if(_0x8064c2){return _0x530e3c[_0xc913('0x17')](_0x2be0dc);}return _0x530e3c[_0xc913('0x18')](_0x2be0dc)[_0xc913('0x19')]();};}function respondWithResult(_0x5d982d,_0xfb99a9){_0xfb99a9=_0xfb99a9||0xc8;return function(_0x58fff1){if(_0x58fff1){return _0x5d982d[_0xc913('0x18')](_0xfb99a9)[_0xc913('0x1a')](_0x58fff1);}};}function respondWithFilteredResult(_0xfe698b,_0x695577){return function(_0x1cf0e){if(_0x1cf0e){var _0x2e5d5e=typeof _0x695577[_0xc913('0x1b')]===_0xc913('0x1c')&&typeof _0x695577['limit']===_0xc913('0x1c');var _0x192747=_0x1cf0e[_0xc913('0x1d')];var _0x54d9e6=_0x2e5d5e?0x0:_0x695577[_0xc913('0x1b')];var _0x20e248=_0x2e5d5e?_0x1cf0e[_0xc913('0x1d')]:_0x695577['offset']+_0x695577[_0xc913('0x1e')];var _0x1d9452;if(_0x20e248>=_0x192747){_0x20e248=_0x192747;_0x1d9452=0xc8;}else{_0x1d9452=0xce;}_0xfe698b['status'](_0x1d9452);return _0xfe698b[_0xc913('0x1f')](_0xc913('0x20'),_0x54d9e6+'-'+_0x20e248+'/'+_0x192747)[_0xc913('0x1a')](_0x1cf0e);}return null;};}function patchUpdates(_0x50ef76){return function(_0x4cdafa){try{jsonpatch['apply'](_0x4cdafa,_0x50ef76,!![]);}catch(_0xc38f14){return BPromise[_0xc913('0x21')](_0xc38f14);}return _0x4cdafa[_0xc913('0x22')]();};}function saveUpdates(_0x34a02c,_0x4cbc36){return function(_0x5f3704){if(_0x5f3704){return _0x5f3704[_0xc913('0x23')](_0x34a02c)[_0xc913('0x24')](function(_0x8ad76e){return _0x8ad76e;});}return null;};}function removeEntity(_0x44023b,_0x21cb24){return function(_0x5acf4c){if(_0x5acf4c){return _0x5acf4c['destroy']()['then'](function(){_0x44023b[_0xc913('0x18')](0xcc)[_0xc913('0x19')]();});}};}function handleEntityNotFound(_0x2576e1,_0x5d3cd4){return function(_0x100010){if(!_0x100010){_0x2576e1[_0xc913('0x17')](0x194);}return _0x100010;};}function handleError(_0x44a8e7,_0x3deb5c){_0x3deb5c=_0x3deb5c||0x1f4;return function(_0x294c07){logger[_0xc913('0x25')](_0x294c07[_0xc913('0x26')]);if(_0x294c07[_0xc913('0x27')]){delete _0x294c07['name'];}_0x44a8e7[_0xc913('0x18')](_0x3deb5c)[_0xc913('0x28')](_0x294c07);};}exports[_0xc913('0x29')]=function(_0x23c7c2,_0x4a1d3c){var _0x5b2ced={},_0x755655={},_0x121550={'count':0x0,'rows':[]};var _0x3e11cd=_[_0xc913('0x2a')](db[_0xc913('0x2b')]['rawAttributes'],function(_0x3442f1){return{'name':_0x3442f1[_0xc913('0x2c')],'type':_0x3442f1[_0xc913('0x2d')][_0xc913('0x2e')]};});_0x755655[_0xc913('0x2f')]=_[_0xc913('0x2a')](_0x3e11cd,_0xc913('0x27'));_0x755655[_0xc913('0x30')]=_[_0xc913('0x31')](_0x23c7c2['query']);_0x755655[_0xc913('0x32')]=_[_0xc913('0x33')](_0x755655[_0xc913('0x2f')],_0x755655[_0xc913('0x30')]);_0x5b2ced['attributes']=_[_0xc913('0x33')](_0x755655[_0xc913('0x2f')],qs[_0xc913('0x34')](_0x23c7c2[_0xc913('0x30')]['fields']));_0x5b2ced[_0xc913('0x35')]=_0x5b2ced[_0xc913('0x35')]['length']?_0x5b2ced[_0xc913('0x35')]:_0x755655[_0xc913('0x2f')];if(!_0x23c7c2['query'][_0xc913('0x36')](_0xc913('0x37'))){_0x5b2ced[_0xc913('0x1e')]=qs[_0xc913('0x1e')](_0x23c7c2[_0xc913('0x30')][_0xc913('0x1e')]);_0x5b2ced['offset']=qs[_0xc913('0x1b')](_0x23c7c2['query'][_0xc913('0x1b')]);}_0x5b2ced[_0xc913('0x38')]=qs[_0xc913('0x39')](_0x23c7c2[_0xc913('0x30')][_0xc913('0x39')]);_0x5b2ced[_0xc913('0x3a')]=qs[_0xc913('0x32')](_[_0xc913('0x3b')](_0x23c7c2['query'],_0x755655[_0xc913('0x32')]),_0x3e11cd);if(_0x23c7c2[_0xc913('0x30')][_0xc913('0x3c')]){_0x5b2ced[_0xc913('0x3a')]=_[_0xc913('0x3d')](_0x5b2ced[_0xc913('0x3a')],{'$or':_[_0xc913('0x2a')](_0x3e11cd,function(_0x388aa5){if(_0x388aa5[_0xc913('0x2d')]!==_0xc913('0x3e')){var _0x44a3f5={};_0x44a3f5[_0x388aa5['name']]={'$like':'%'+_0x23c7c2['query'][_0xc913('0x3c')]+'%'};return _0x44a3f5;}})});}_0x5b2ced=_['merge']({},_0x5b2ced,_0x23c7c2[_0xc913('0x3f')]);var _0x53ae09={'where':_0x5b2ced[_0xc913('0x3a')]};return db['ZohoConfiguration']['count'](_0x53ae09)[_0xc913('0x24')](function(_0x426ad4){_0x121550[_0xc913('0x1d')]=_0x426ad4;if(_0x23c7c2[_0xc913('0x30')][_0xc913('0x40')]){_0x5b2ced[_0xc913('0x41')]=[{'all':!![]}];}return db[_0xc913('0x2b')][_0xc913('0x42')](_0x5b2ced);})[_0xc913('0x24')](function(_0x44bd96){_0x121550[_0xc913('0x43')]=_0x44bd96;return _0x121550;})[_0xc913('0x24')](respondWithFilteredResult(_0x4a1d3c,_0x5b2ced))['catch'](handleError(_0x4a1d3c,null));};exports['show']=function(_0x4c043b,_0x58c8ac){var _0x5f4f1e={'raw':![],'where':{'id':_0x4c043b[_0xc913('0x44')]['id']}},_0x1b3fa3={};_0x1b3fa3[_0xc913('0x2f')]=_[_0xc913('0x31')](db[_0xc913('0x2b')][_0xc913('0x45')]);_0x1b3fa3[_0xc913('0x30')]=_['keys'](_0x4c043b[_0xc913('0x30')]);_0x1b3fa3['filters']=_[_0xc913('0x33')](_0x1b3fa3['model'],_0x1b3fa3[_0xc913('0x30')]);_0x5f4f1e[_0xc913('0x35')]=_[_0xc913('0x33')](_0x1b3fa3[_0xc913('0x2f')],qs[_0xc913('0x34')](_0x4c043b[_0xc913('0x30')][_0xc913('0x34')]));_0x5f4f1e['attributes']=_0x5f4f1e[_0xc913('0x35')][_0xc913('0x46')]?_0x5f4f1e['attributes']:_0x1b3fa3[_0xc913('0x2f')];if(_0x4c043b[_0xc913('0x30')][_0xc913('0x40')]){_0x5f4f1e[_0xc913('0x41')]=[{'all':!![]}];}_0x5f4f1e=_[_0xc913('0x3d')]({},_0x5f4f1e,_0x4c043b['options']);return db[_0xc913('0x2b')][_0xc913('0x47')](_0x5f4f1e)[_0xc913('0x24')](handleEntityNotFound(_0x58c8ac,null))[_0xc913('0x24')](respondWithResult(_0x58c8ac,null))[_0xc913('0x48')](handleError(_0x58c8ac,null));};exports[_0xc913('0x49')]=function(_0x405ff4,_0x1efcee){return db[_0xc913('0x2b')][_0xc913('0x49')](_0x405ff4[_0xc913('0x4a')],{})['then'](respondWithResult(_0x1efcee,0xc9))[_0xc913('0x48')](handleError(_0x1efcee,null));};exports[_0xc913('0x23')]=function(_0x2c6e55,_0x416f67){if(_0x2c6e55[_0xc913('0x4a')]['id']){delete _0x2c6e55[_0xc913('0x4a')]['id'];}return db[_0xc913('0x2b')]['find']({'where':{'id':_0x2c6e55[_0xc913('0x44')]['id']}})[_0xc913('0x24')](handleEntityNotFound(_0x416f67,null))[_0xc913('0x24')](saveUpdates(_0x2c6e55[_0xc913('0x4a')],null))[_0xc913('0x24')](respondWithResult(_0x416f67,null))[_0xc913('0x48')](handleError(_0x416f67,null));};exports['destroy']=function(_0x522236,_0x37c32f){return db[_0xc913('0x2b')][_0xc913('0x47')]({'where':{'id':_0x522236['params']['id']}})[_0xc913('0x24')](handleEntityNotFound(_0x37c32f,null))[_0xc913('0x24')](removeEntity(_0x37c32f,null))['catch'](handleError(_0x37c32f,null));};exports['getFields']=function(_0x3ec18c,_0x9b94c4,_0x4b41bf){var _0x8a36c4={};var _0x41924c={};var _0x93718;var _0xd067df;return db[_0xc913('0x2b')][_0xc913('0x4b')]({'where':{'id':_0x3ec18c[_0xc913('0x44')]['id']}})[_0xc913('0x24')](handleEntityNotFound(_0x9b94c4,null))[_0xc913('0x24')](function(_0x4e1a68){if(_0x4e1a68){_0x93718=_0x4e1a68;_0x41924c[_0xc913('0x2f')]=_[_0xc913('0x31')](db['ZohoField'][_0xc913('0x45')]);_0x41924c[_0xc913('0x30')]=_[_0xc913('0x31')](_0x3ec18c[_0xc913('0x30')]);_0x41924c[_0xc913('0x32')]=_[_0xc913('0x33')](_0x41924c[_0xc913('0x2f')],_0x41924c['query']);_0x8a36c4[_0xc913('0x35')]=_[_0xc913('0x33')](_0x41924c[_0xc913('0x2f')],qs[_0xc913('0x34')](_0x3ec18c['query'][_0xc913('0x34')]));_0x8a36c4[_0xc913('0x35')]=_0x8a36c4[_0xc913('0x35')][_0xc913('0x46')]?_0x8a36c4[_0xc913('0x35')]:_0x41924c['model'];_0x8a36c4[_0xc913('0x38')]=qs[_0xc913('0x39')](_0x3ec18c['query']['sort']);_0x8a36c4[_0xc913('0x3a')]=qs[_0xc913('0x32')](_[_0xc913('0x3b')](_0x3ec18c[_0xc913('0x30')],_0x41924c['filters']));if(_0x3ec18c['query'][_0xc913('0x3c')]){_0x8a36c4['where']=_[_0xc913('0x3d')](_0x8a36c4[_0xc913('0x3a')],{'$or':_[_0xc913('0x2a')](_0x8a36c4[_0xc913('0x35')],function(_0x984860){var _0x29b079={};_0x29b079[_0x984860]={'$like':'%'+_0x3ec18c[_0xc913('0x30')][_0xc913('0x3c')]+'%'};return _0x29b079;})});}_0x8a36c4=_[_0xc913('0x3d')]({},_0x8a36c4,_0x3ec18c['options']);return _0x93718[_0xc913('0x4c')](_0x8a36c4);}})[_0xc913('0x24')](function(_0x36f8fc){if(_0x36f8fc){_0xd067df=_0x36f8fc[_0xc913('0x46')];if(!_0x3ec18c['query'][_0xc913('0x36')]('nolimit')){_0x8a36c4[_0xc913('0x1e')]=qs[_0xc913('0x1e')](_0x3ec18c['query'][_0xc913('0x1e')]);_0x8a36c4[_0xc913('0x1b')]=qs['offset'](_0x3ec18c[_0xc913('0x30')][_0xc913('0x1b')]);}return _0x93718['getFields'](_0x8a36c4);}})['then'](function(_0x20dcee){if(_0x20dcee){return _0x20dcee?{'count':_0xd067df,'rows':_0x20dcee}:null;}})[_0xc913('0x24')](respondWithResult(_0x9b94c4,null))[_0xc913('0x48')](handleError(_0x9b94c4,null));};exports['getSubjects']=function(_0x5dc192,_0x52515f,_0x571a52){var _0x126162={};var _0x5a2402={};var _0x305cc2;var _0x378140;return db['ZohoConfiguration'][_0xc913('0x4b')]({'where':{'id':_0x5dc192[_0xc913('0x44')]['id']}})[_0xc913('0x24')](handleEntityNotFound(_0x52515f,null))[_0xc913('0x24')](function(_0x4b5db){if(_0x4b5db){_0x305cc2=_0x4b5db;_0x5a2402['model']=_['keys'](db[_0xc913('0x4d')][_0xc913('0x45')]);_0x5a2402['query']=_['keys'](_0x5dc192['query']);_0x5a2402[_0xc913('0x32')]=_['intersection'](_0x5a2402['model'],_0x5a2402[_0xc913('0x30')]);_0x126162[_0xc913('0x35')]=_[_0xc913('0x33')](_0x5a2402[_0xc913('0x2f')],qs[_0xc913('0x34')](_0x5dc192[_0xc913('0x30')]['fields']));_0x126162['attributes']=_0x126162[_0xc913('0x35')][_0xc913('0x46')]?_0x126162[_0xc913('0x35')]:_0x5a2402[_0xc913('0x2f')];_0x126162['order']=qs['sort'](_0x5dc192[_0xc913('0x30')][_0xc913('0x39')]);_0x126162[_0xc913('0x3a')]=qs[_0xc913('0x32')](_[_0xc913('0x3b')](_0x5dc192[_0xc913('0x30')],_0x5a2402[_0xc913('0x32')]));if(_0x5dc192[_0xc913('0x30')][_0xc913('0x3c')]){_0x126162[_0xc913('0x3a')]=_[_0xc913('0x3d')](_0x126162[_0xc913('0x3a')],{'$or':_[_0xc913('0x2a')](_0x126162[_0xc913('0x35')],function(_0xa8c65f){var _0x3f218e={};_0x3f218e[_0xa8c65f]={'$like':'%'+_0x5dc192[_0xc913('0x30')]['filter']+'%'};return _0x3f218e;})});}_0x126162=_[_0xc913('0x3d')]({},_0x126162,_0x5dc192[_0xc913('0x3f')]);return _0x305cc2[_0xc913('0x4e')](_0x126162);}})[_0xc913('0x24')](function(_0x4b8bd7){if(_0x4b8bd7){_0x378140=_0x4b8bd7['length'];if(!_0x5dc192['query'][_0xc913('0x36')](_0xc913('0x37'))){_0x126162[_0xc913('0x1e')]=qs[_0xc913('0x1e')](_0x5dc192['query'][_0xc913('0x1e')]);_0x126162[_0xc913('0x1b')]=qs[_0xc913('0x1b')](_0x5dc192['query'][_0xc913('0x1b')]);}return _0x305cc2[_0xc913('0x4e')](_0x126162);}})[_0xc913('0x24')](function(_0x338cc7){if(_0x338cc7){return _0x338cc7?{'count':_0x378140,'rows':_0x338cc7}:null;}})[_0xc913('0x24')](respondWithResult(_0x52515f,null))[_0xc913('0x48')](handleError(_0x52515f,null));};exports[_0xc913('0x4f')]=function(_0x1cb2dd,_0x1a832f,_0x499406){var _0x32b1e2={};var _0x4d82b7={};var _0x125609;var _0x180a75;return db[_0xc913('0x2b')][_0xc913('0x4b')]({'where':{'id':_0x1cb2dd[_0xc913('0x44')]['id']}})[_0xc913('0x24')](handleEntityNotFound(_0x1a832f,null))['then'](function(_0x164fad){if(_0x164fad){_0x125609=_0x164fad;_0x4d82b7[_0xc913('0x2f')]=_['keys'](db[_0xc913('0x4d')][_0xc913('0x45')]);_0x4d82b7['query']=_[_0xc913('0x31')](_0x1cb2dd[_0xc913('0x30')]);_0x4d82b7[_0xc913('0x32')]=_[_0xc913('0x33')](_0x4d82b7['model'],_0x4d82b7[_0xc913('0x30')]);_0x32b1e2[_0xc913('0x35')]=_['intersection'](_0x4d82b7[_0xc913('0x2f')],qs['fields'](_0x1cb2dd[_0xc913('0x30')]['fields']));_0x32b1e2[_0xc913('0x35')]=_0x32b1e2[_0xc913('0x35')][_0xc913('0x46')]?_0x32b1e2['attributes']:_0x4d82b7[_0xc913('0x2f')];_0x32b1e2[_0xc913('0x38')]=qs[_0xc913('0x39')](_0x1cb2dd['query']['sort']);_0x32b1e2[_0xc913('0x3a')]=qs[_0xc913('0x32')](_['pick'](_0x1cb2dd['query'],_0x4d82b7['filters']));if(_0x1cb2dd[_0xc913('0x30')][_0xc913('0x3c')]){_0x32b1e2[_0xc913('0x3a')]=_[_0xc913('0x3d')](_0x32b1e2[_0xc913('0x3a')],{'$or':_[_0xc913('0x2a')](_0x32b1e2[_0xc913('0x35')],function(_0x14ab17){var _0x4de4f7={};_0x4de4f7[_0x14ab17]={'$like':'%'+_0x1cb2dd[_0xc913('0x30')][_0xc913('0x3c')]+'%'};return _0x4de4f7;})});}_0x32b1e2=_[_0xc913('0x3d')]({},_0x32b1e2,_0x1cb2dd['options']);return _0x125609[_0xc913('0x4f')](_0x32b1e2);}})[_0xc913('0x24')](function(_0x412eab){if(_0x412eab){_0x180a75=_0x412eab[_0xc913('0x46')];if(!_0x1cb2dd['query'][_0xc913('0x36')](_0xc913('0x37'))){_0x32b1e2[_0xc913('0x1e')]=qs[_0xc913('0x1e')](_0x1cb2dd[_0xc913('0x30')][_0xc913('0x1e')]);_0x32b1e2[_0xc913('0x1b')]=qs[_0xc913('0x1b')](_0x1cb2dd['query'][_0xc913('0x1b')]);}return _0x125609[_0xc913('0x4f')](_0x32b1e2);}})[_0xc913('0x24')](function(_0x52205c){if(_0x52205c){return _0x52205c?{'count':_0x180a75,'rows':_0x52205c}:null;}})['then'](respondWithResult(_0x1a832f,null))[_0xc913('0x48')](handleError(_0x1a832f,null));}; \ No newline at end of file +var _0x36af=['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','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','getFields','findOne','rawAttributes','pick','getSubjects','ZohoField','hasOwnProperty','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring'];(function(_0x5872bb,_0x4bc758){var _0x392d2c=function(_0xf719c6){while(--_0xf719c6){_0x5872bb['push'](_0x5872bb['shift']());}};_0x392d2c(++_0x4bc758);}(_0x36af,0xe3));var _0xf36a=function(_0x350e65,_0x9376a0){_0x350e65=_0x350e65-0x0;var _0x5d30c4=_0x36af[_0x350e65];return _0x5d30c4;};'use strict';var emlformat=require(_0xf36a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf36a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf36a('0x2'));var moment=require('moment');var BPromise=require(_0xf36a('0x3'));var Mustache=require(_0xf36a('0x4'));var util=require(_0xf36a('0x5'));var path=require(_0xf36a('0x6'));var sox=require(_0xf36a('0x7'));var csv=require(_0xf36a('0x8'));var ejs=require(_0xf36a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf36a('0xa'));var squel=require(_0xf36a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf36a('0x8'));var querystring=require(_0xf36a('0xc'));var Papa=require(_0xf36a('0xd'));var Redis=require(_0xf36a('0xe'));var authService=require(_0xf36a('0xf'));var qs=require(_0xf36a('0x10'));var as=require(_0xf36a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf36a('0x12'))(_0xf36a('0x13'));var utils=require(_0xf36a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf36a('0x15'));var db=require(_0xf36a('0x16'))['db'];function respondWithStatusCode(_0x3b3c53,_0x510a87){_0x510a87=_0x510a87||0xcc;return function(_0x4a9d1b){if(_0x4a9d1b){return _0x3b3c53[_0xf36a('0x17')](_0x510a87);}return _0x3b3c53[_0xf36a('0x18')](_0x510a87)[_0xf36a('0x19')]();};}function respondWithResult(_0x1d6bab,_0x12bd13){_0x12bd13=_0x12bd13||0xc8;return function(_0x28fb46){if(_0x28fb46){return _0x1d6bab[_0xf36a('0x18')](_0x12bd13)[_0xf36a('0x1a')](_0x28fb46);}};}function respondWithFilteredResult(_0x49ce45,_0xd6ce3d){return function(_0x2c8303){if(_0x2c8303){var _0x390aa0=typeof _0xd6ce3d['offset']===_0xf36a('0x1b')&&typeof _0xd6ce3d[_0xf36a('0x1c')]===_0xf36a('0x1b');var _0x1f6ed0=_0x2c8303[_0xf36a('0x1d')];var _0x378105=_0x390aa0?0x0:_0xd6ce3d[_0xf36a('0x1e')];var _0x816408=_0x390aa0?_0x2c8303['count']:_0xd6ce3d[_0xf36a('0x1e')]+_0xd6ce3d['limit'];var _0x2b65eb;if(_0x816408>=_0x1f6ed0){_0x816408=_0x1f6ed0;_0x2b65eb=0xc8;}else{_0x2b65eb=0xce;}_0x49ce45[_0xf36a('0x18')](_0x2b65eb);return _0x49ce45[_0xf36a('0x1f')](_0xf36a('0x20'),_0x378105+'-'+_0x816408+'/'+_0x1f6ed0)[_0xf36a('0x1a')](_0x2c8303);}return null;};}function patchUpdates(_0x1dfd1f){return function(_0x10f025){try{jsonpatch[_0xf36a('0x21')](_0x10f025,_0x1dfd1f,!![]);}catch(_0x576a30){return BPromise[_0xf36a('0x22')](_0x576a30);}return _0x10f025[_0xf36a('0x23')]();};}function saveUpdates(_0xfd1730,_0x591e4a){return function(_0x4ef26f){if(_0x4ef26f){return _0x4ef26f[_0xf36a('0x24')](_0xfd1730)[_0xf36a('0x25')](function(_0x40d988){return _0x40d988;});}return null;};}function removeEntity(_0x2aeca7,_0x44ee01){return function(_0x206d81){if(_0x206d81){return _0x206d81[_0xf36a('0x26')]()[_0xf36a('0x25')](function(){_0x2aeca7[_0xf36a('0x18')](0xcc)[_0xf36a('0x19')]();});}};}function handleEntityNotFound(_0x2712bb,_0x48c867){return function(_0x3ac19c){if(!_0x3ac19c){_0x2712bb[_0xf36a('0x17')](0x194);}return _0x3ac19c;};}function handleError(_0x609326,_0x4c7b81){_0x4c7b81=_0x4c7b81||0x1f4;return function(_0x4e7c17){logger[_0xf36a('0x27')](_0x4e7c17[_0xf36a('0x28')]);if(_0x4e7c17[_0xf36a('0x29')]){delete _0x4e7c17[_0xf36a('0x29')];}_0x609326[_0xf36a('0x18')](_0x4c7b81)[_0xf36a('0x2a')](_0x4e7c17);};}exports[_0xf36a('0x2b')]=function(_0xdf59f8,_0x4edd2b){var _0x3a0b7a={},_0x2c4ad5={},_0x22f5a1={'count':0x0,'rows':[]};var _0x4c4254=_[_0xf36a('0x2c')](db[_0xf36a('0x2d')]['rawAttributes'],function(_0x1ec1da){return{'name':_0x1ec1da[_0xf36a('0x2e')],'type':_0x1ec1da[_0xf36a('0x2f')]['key']};});_0x2c4ad5[_0xf36a('0x30')]=_[_0xf36a('0x2c')](_0x4c4254,'name');_0x2c4ad5[_0xf36a('0x31')]=_['keys'](_0xdf59f8['query']);_0x2c4ad5['filters']=_[_0xf36a('0x32')](_0x2c4ad5['model'],_0x2c4ad5['query']);_0x3a0b7a[_0xf36a('0x33')]=_[_0xf36a('0x32')](_0x2c4ad5[_0xf36a('0x30')],qs[_0xf36a('0x34')](_0xdf59f8[_0xf36a('0x31')][_0xf36a('0x34')]));_0x3a0b7a[_0xf36a('0x33')]=_0x3a0b7a['attributes'][_0xf36a('0x35')]?_0x3a0b7a[_0xf36a('0x33')]:_0x2c4ad5[_0xf36a('0x30')];if(!_0xdf59f8[_0xf36a('0x31')]['hasOwnProperty'](_0xf36a('0x36'))){_0x3a0b7a[_0xf36a('0x1c')]=qs[_0xf36a('0x1c')](_0xdf59f8['query'][_0xf36a('0x1c')]);_0x3a0b7a[_0xf36a('0x1e')]=qs[_0xf36a('0x1e')](_0xdf59f8[_0xf36a('0x31')][_0xf36a('0x1e')]);}_0x3a0b7a[_0xf36a('0x37')]=qs['sort'](_0xdf59f8[_0xf36a('0x31')][_0xf36a('0x38')]);_0x3a0b7a[_0xf36a('0x39')]=qs[_0xf36a('0x3a')](_['pick'](_0xdf59f8[_0xf36a('0x31')],_0x2c4ad5[_0xf36a('0x3a')]),_0x4c4254);if(_0xdf59f8[_0xf36a('0x31')][_0xf36a('0x3b')]){_0x3a0b7a['where']=_[_0xf36a('0x3c')](_0x3a0b7a['where'],{'$or':_[_0xf36a('0x2c')](_0x4c4254,function(_0x43c229){if(_0x43c229['type']!==_0xf36a('0x3d')){var _0x59955c={};_0x59955c[_0x43c229[_0xf36a('0x29')]]={'$like':'%'+_0xdf59f8[_0xf36a('0x31')][_0xf36a('0x3b')]+'%'};return _0x59955c;}})});}_0x3a0b7a=_[_0xf36a('0x3c')]({},_0x3a0b7a,_0xdf59f8[_0xf36a('0x3e')]);var _0x2e5747={'where':_0x3a0b7a[_0xf36a('0x39')]};return db[_0xf36a('0x2d')][_0xf36a('0x1d')](_0x2e5747)['then'](function(_0x5955ad){_0x22f5a1['count']=_0x5955ad;if(_0xdf59f8[_0xf36a('0x31')][_0xf36a('0x3f')]){_0x3a0b7a[_0xf36a('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xf36a('0x41')](_0x3a0b7a);})['then'](function(_0xf93073){_0x22f5a1[_0xf36a('0x42')]=_0xf93073;return _0x22f5a1;})[_0xf36a('0x25')](respondWithFilteredResult(_0x4edd2b,_0x3a0b7a))[_0xf36a('0x43')](handleError(_0x4edd2b,null));};exports['show']=function(_0x4f0b7f,_0x328739){var _0x5c6972={'raw':![],'where':{'id':_0x4f0b7f[_0xf36a('0x44')]['id']}},_0x14b5e0={};_0x14b5e0['model']=_[_0xf36a('0x45')](db[_0xf36a('0x2d')]['rawAttributes']);_0x14b5e0['query']=_[_0xf36a('0x45')](_0x4f0b7f[_0xf36a('0x31')]);_0x14b5e0['filters']=_[_0xf36a('0x32')](_0x14b5e0[_0xf36a('0x30')],_0x14b5e0[_0xf36a('0x31')]);_0x5c6972[_0xf36a('0x33')]=_[_0xf36a('0x32')](_0x14b5e0['model'],qs[_0xf36a('0x34')](_0x4f0b7f[_0xf36a('0x31')][_0xf36a('0x34')]));_0x5c6972[_0xf36a('0x33')]=_0x5c6972[_0xf36a('0x33')][_0xf36a('0x35')]?_0x5c6972['attributes']:_0x14b5e0[_0xf36a('0x30')];if(_0x4f0b7f[_0xf36a('0x31')][_0xf36a('0x3f')]){_0x5c6972[_0xf36a('0x40')]=[{'all':!![]}];}_0x5c6972=_[_0xf36a('0x3c')]({},_0x5c6972,_0x4f0b7f[_0xf36a('0x3e')]);return db['ZohoConfiguration'][_0xf36a('0x46')](_0x5c6972)[_0xf36a('0x25')](handleEntityNotFound(_0x328739,null))[_0xf36a('0x25')](respondWithResult(_0x328739,null))[_0xf36a('0x43')](handleError(_0x328739,null));};exports['create']=function(_0x507c21,_0x53cde8){return db[_0xf36a('0x2d')][_0xf36a('0x47')](_0x507c21[_0xf36a('0x48')],{})['then'](respondWithResult(_0x53cde8,0xc9))[_0xf36a('0x43')](handleError(_0x53cde8,null));};exports['update']=function(_0x55d99b,_0x2cc240){if(_0x55d99b['body']['id']){delete _0x55d99b[_0xf36a('0x48')]['id'];}return db[_0xf36a('0x2d')][_0xf36a('0x46')]({'where':{'id':_0x55d99b[_0xf36a('0x44')]['id']}})[_0xf36a('0x25')](handleEntityNotFound(_0x2cc240,null))['then'](saveUpdates(_0x55d99b[_0xf36a('0x48')],null))[_0xf36a('0x25')](respondWithResult(_0x2cc240,null))[_0xf36a('0x43')](handleError(_0x2cc240,null));};exports[_0xf36a('0x26')]=function(_0x20408f,_0x44e93b){return db[_0xf36a('0x2d')][_0xf36a('0x46')]({'where':{'id':_0x20408f[_0xf36a('0x44')]['id']}})[_0xf36a('0x25')](handleEntityNotFound(_0x44e93b,null))[_0xf36a('0x25')](removeEntity(_0x44e93b,null))[_0xf36a('0x43')](handleError(_0x44e93b,null));};exports[_0xf36a('0x49')]=function(_0x25f45c,_0x1afd85,_0x5b6d59){var _0x4c3f8e={};var _0x5ef938={};var _0x15d956;var _0x441545;return db[_0xf36a('0x2d')][_0xf36a('0x4a')]({'where':{'id':_0x25f45c[_0xf36a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1afd85,null))[_0xf36a('0x25')](function(_0x51a7df){if(_0x51a7df){_0x15d956=_0x51a7df;_0x5ef938[_0xf36a('0x30')]=_['keys'](db['ZohoField'][_0xf36a('0x4b')]);_0x5ef938[_0xf36a('0x31')]=_[_0xf36a('0x45')](_0x25f45c[_0xf36a('0x31')]);_0x5ef938[_0xf36a('0x3a')]=_[_0xf36a('0x32')](_0x5ef938[_0xf36a('0x30')],_0x5ef938[_0xf36a('0x31')]);_0x4c3f8e['attributes']=_[_0xf36a('0x32')](_0x5ef938[_0xf36a('0x30')],qs[_0xf36a('0x34')](_0x25f45c[_0xf36a('0x31')][_0xf36a('0x34')]));_0x4c3f8e[_0xf36a('0x33')]=_0x4c3f8e['attributes'][_0xf36a('0x35')]?_0x4c3f8e['attributes']:_0x5ef938[_0xf36a('0x30')];_0x4c3f8e[_0xf36a('0x37')]=qs[_0xf36a('0x38')](_0x25f45c[_0xf36a('0x31')][_0xf36a('0x38')]);_0x4c3f8e[_0xf36a('0x39')]=qs[_0xf36a('0x3a')](_[_0xf36a('0x4c')](_0x25f45c[_0xf36a('0x31')],_0x5ef938[_0xf36a('0x3a')]));if(_0x25f45c[_0xf36a('0x31')][_0xf36a('0x3b')]){_0x4c3f8e[_0xf36a('0x39')]=_['merge'](_0x4c3f8e[_0xf36a('0x39')],{'$or':_[_0xf36a('0x2c')](_0x4c3f8e[_0xf36a('0x33')],function(_0x29502e){var _0x570f7b={};_0x570f7b[_0x29502e]={'$like':'%'+_0x25f45c[_0xf36a('0x31')]['filter']+'%'};return _0x570f7b;})});}_0x4c3f8e=_[_0xf36a('0x3c')]({},_0x4c3f8e,_0x25f45c[_0xf36a('0x3e')]);return _0x15d956[_0xf36a('0x49')](_0x4c3f8e);}})[_0xf36a('0x25')](function(_0x146304){if(_0x146304){_0x441545=_0x146304['length'];if(!_0x25f45c['query']['hasOwnProperty'](_0xf36a('0x36'))){_0x4c3f8e['limit']=qs[_0xf36a('0x1c')](_0x25f45c[_0xf36a('0x31')][_0xf36a('0x1c')]);_0x4c3f8e[_0xf36a('0x1e')]=qs[_0xf36a('0x1e')](_0x25f45c[_0xf36a('0x31')][_0xf36a('0x1e')]);}return _0x15d956[_0xf36a('0x49')](_0x4c3f8e);}})[_0xf36a('0x25')](function(_0x25646b){if(_0x25646b){return _0x25646b?{'count':_0x441545,'rows':_0x25646b}:null;}})[_0xf36a('0x25')](respondWithResult(_0x1afd85,null))['catch'](handleError(_0x1afd85,null));};exports[_0xf36a('0x4d')]=function(_0x5838a9,_0x491944,_0x570ce7){var _0x53231a={};var _0x32943f={};var _0x4cb631;var _0x21d240;return db[_0xf36a('0x2d')]['findOne']({'where':{'id':_0x5838a9['params']['id']}})['then'](handleEntityNotFound(_0x491944,null))[_0xf36a('0x25')](function(_0x1a4478){if(_0x1a4478){_0x4cb631=_0x1a4478;_0x32943f[_0xf36a('0x30')]=_['keys'](db[_0xf36a('0x4e')]['rawAttributes']);_0x32943f[_0xf36a('0x31')]=_[_0xf36a('0x45')](_0x5838a9['query']);_0x32943f[_0xf36a('0x3a')]=_[_0xf36a('0x32')](_0x32943f[_0xf36a('0x30')],_0x32943f['query']);_0x53231a[_0xf36a('0x33')]=_[_0xf36a('0x32')](_0x32943f[_0xf36a('0x30')],qs[_0xf36a('0x34')](_0x5838a9[_0xf36a('0x31')][_0xf36a('0x34')]));_0x53231a['attributes']=_0x53231a['attributes'][_0xf36a('0x35')]?_0x53231a[_0xf36a('0x33')]:_0x32943f[_0xf36a('0x30')];_0x53231a[_0xf36a('0x37')]=qs[_0xf36a('0x38')](_0x5838a9['query'][_0xf36a('0x38')]);_0x53231a['where']=qs['filters'](_['pick'](_0x5838a9['query'],_0x32943f[_0xf36a('0x3a')]));if(_0x5838a9['query']['filter']){_0x53231a[_0xf36a('0x39')]=_[_0xf36a('0x3c')](_0x53231a[_0xf36a('0x39')],{'$or':_[_0xf36a('0x2c')](_0x53231a[_0xf36a('0x33')],function(_0x3d97eb){var _0x56de75={};_0x56de75[_0x3d97eb]={'$like':'%'+_0x5838a9[_0xf36a('0x31')]['filter']+'%'};return _0x56de75;})});}_0x53231a=_[_0xf36a('0x3c')]({},_0x53231a,_0x5838a9[_0xf36a('0x3e')]);return _0x4cb631[_0xf36a('0x4d')](_0x53231a);}})['then'](function(_0x419816){if(_0x419816){_0x21d240=_0x419816[_0xf36a('0x35')];if(!_0x5838a9[_0xf36a('0x31')][_0xf36a('0x4f')]('nolimit')){_0x53231a['limit']=qs['limit'](_0x5838a9[_0xf36a('0x31')][_0xf36a('0x1c')]);_0x53231a[_0xf36a('0x1e')]=qs[_0xf36a('0x1e')](_0x5838a9[_0xf36a('0x31')][_0xf36a('0x1e')]);}return _0x4cb631[_0xf36a('0x4d')](_0x53231a);}})['then'](function(_0x1dc065){if(_0x1dc065){return _0x1dc065?{'count':_0x21d240,'rows':_0x1dc065}:null;}})[_0xf36a('0x25')](respondWithResult(_0x491944,null))['catch'](handleError(_0x491944,null));};exports['getDescriptions']=function(_0x394267,_0x56604f,_0x164724){var _0x22221f={};var _0x558db5={};var _0x380d1f;var _0x27790e;return db[_0xf36a('0x2d')][_0xf36a('0x4a')]({'where':{'id':_0x394267['params']['id']}})[_0xf36a('0x25')](handleEntityNotFound(_0x56604f,null))['then'](function(_0x198f69){if(_0x198f69){_0x380d1f=_0x198f69;_0x558db5[_0xf36a('0x30')]=_[_0xf36a('0x45')](db['ZohoField'][_0xf36a('0x4b')]);_0x558db5['query']=_[_0xf36a('0x45')](_0x394267[_0xf36a('0x31')]);_0x558db5[_0xf36a('0x3a')]=_[_0xf36a('0x32')](_0x558db5[_0xf36a('0x30')],_0x558db5[_0xf36a('0x31')]);_0x22221f['attributes']=_[_0xf36a('0x32')](_0x558db5['model'],qs[_0xf36a('0x34')](_0x394267[_0xf36a('0x31')][_0xf36a('0x34')]));_0x22221f[_0xf36a('0x33')]=_0x22221f['attributes']['length']?_0x22221f[_0xf36a('0x33')]:_0x558db5[_0xf36a('0x30')];_0x22221f[_0xf36a('0x37')]=qs[_0xf36a('0x38')](_0x394267[_0xf36a('0x31')][_0xf36a('0x38')]);_0x22221f['where']=qs[_0xf36a('0x3a')](_[_0xf36a('0x4c')](_0x394267[_0xf36a('0x31')],_0x558db5['filters']));if(_0x394267[_0xf36a('0x31')][_0xf36a('0x3b')]){_0x22221f[_0xf36a('0x39')]=_[_0xf36a('0x3c')](_0x22221f[_0xf36a('0x39')],{'$or':_[_0xf36a('0x2c')](_0x22221f[_0xf36a('0x33')],function(_0x196d72){var _0x154b77={};_0x154b77[_0x196d72]={'$like':'%'+_0x394267[_0xf36a('0x31')][_0xf36a('0x3b')]+'%'};return _0x154b77;})});}_0x22221f=_['merge']({},_0x22221f,_0x394267[_0xf36a('0x3e')]);return _0x380d1f['getDescriptions'](_0x22221f);}})[_0xf36a('0x25')](function(_0x4134c1){if(_0x4134c1){_0x27790e=_0x4134c1['length'];if(!_0x394267[_0xf36a('0x31')][_0xf36a('0x4f')](_0xf36a('0x36'))){_0x22221f[_0xf36a('0x1c')]=qs[_0xf36a('0x1c')](_0x394267[_0xf36a('0x31')]['limit']);_0x22221f[_0xf36a('0x1e')]=qs[_0xf36a('0x1e')](_0x394267[_0xf36a('0x31')]['offset']);}return _0x380d1f['getDescriptions'](_0x22221f);}})[_0xf36a('0x25')](function(_0x22d359){if(_0x22d359){return _0x22d359?{'count':_0x27790e,'rows':_0x22d359}:null;}})[_0xf36a('0x25')](respondWithResult(_0x56604f,null))['catch'](handleError(_0x56604f,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 69a35dd..ef2d027 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 _0x64b5=['ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x168e6a,_0x2dc65e){var _0x481f3c=function(_0x20aab3){while(--_0x20aab3){_0x168e6a['push'](_0x168e6a['shift']());}};_0x481f3c(++_0x2dc65e);}(_0x64b5,0x15e));var _0x564b=function(_0x101b86,_0x3b7f67){_0x101b86=_0x101b86-0x0;var _0x10792a=_0x64b5[_0x101b86];return _0x10792a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x564b('0x0'))(_0x564b('0x1'));var moment=require(_0x564b('0x2'));var BPromise=require(_0x564b('0x3'));var rp=require(_0x564b('0x4'));var fs=require('fs');var path=require(_0x564b('0x5'));var rimraf=require(_0x564b('0x6'));var config=require(_0x564b('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x564b('0x8')]=function(_0x14c27f,_0x2f60c3){return _0x14c27f[_0x564b('0x9')](_0x564b('0xa'),attributes,{'tableName':_0x564b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2ab=['bluebird','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x34d311,_0x180a16){var _0x2845bb=function(_0x2cd24f){while(--_0x2cd24f){_0x34d311['push'](_0x34d311['shift']());}};_0x2845bb(++_0x180a16);}(_0xc2ab,0x11a));var _0xbc2a=function(_0x11ead2,_0x70de8a){_0x11ead2=_0x11ead2-0x0;var _0x3cac96=_0xc2ab[_0x11ead2];return _0x3cac96;};'use strict';var _=require(_0xbc2a('0x0'));var util=require('util');var logger=require(_0xbc2a('0x1'))(_0xbc2a('0x2'));var moment=require(_0xbc2a('0x3'));var BPromise=require(_0xbc2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc2a('0x5'));var config=require('../../config/environment');var attributes=require(_0xbc2a('0x6'));module[_0xbc2a('0x7')]=function(_0x34f3f2,_0x42fb3b){return _0x34f3f2[_0xbc2a('0x8')](_0xbc2a('0x9'),attributes,{'tableName':_0xbc2a('0xa'),'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 189f4f1..ded9202 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 _0xf2e2=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0xcad9e7,_0x255d6f){var _0x170a86=function(_0x38bc38){while(--_0x38bc38){_0xcad9e7['push'](_0xcad9e7['shift']());}};_0x170a86(++_0x255d6f);}(_0xf2e2,0x10d));var _0x2f2e=function(_0x4ab64f,_0x5b6252){_0x4ab64f=_0x4ab64f-0x0;var _0x50e895=_0xf2e2[_0x4ab64f];return _0x50e895;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f2e('0x0'));var BPromise=require(_0x2f2e('0x1'));var rs=require(_0x2f2e('0x2'));var fs=require('fs');var Redis=require(_0x2f2e('0x3'));var db=require(_0x2f2e('0x4'))['db'];var utils=require(_0x2f2e('0x5'));var logger=require(_0x2f2e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2f2e('0x7'));var client=jayson[_0x2f2e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53519e,_0x4cf905,_0x123bee){return new BPromise(function(_0x258cb7,_0x282150){return client['request'](_0x53519e,_0x123bee)[_0x2f2e('0x9')](function(_0x4b158a){logger[_0x2f2e('0xa')](_0x2f2e('0xb'),_0x4cf905,_0x2f2e('0xc'));logger[_0x2f2e('0xd')](_0x2f2e('0xe'),_0x4cf905,_0x2f2e('0xc'),JSON[_0x2f2e('0xf')](_0x4b158a));if(_0x4b158a[_0x2f2e('0x10')]){if(_0x4b158a[_0x2f2e('0x10')][_0x2f2e('0x11')]===0x1f4){logger[_0x2f2e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x4cf905,_0x4b158a[_0x2f2e('0x10')][_0x2f2e('0x12')]);return _0x282150(_0x4b158a[_0x2f2e('0x10')][_0x2f2e('0x12')]);}logger[_0x2f2e('0x10')](_0x2f2e('0xb'),_0x4cf905,_0x4b158a[_0x2f2e('0x10')][_0x2f2e('0x12')]);return _0x258cb7(_0x4b158a[_0x2f2e('0x10')][_0x2f2e('0x12')]);}else{logger[_0x2f2e('0xa')](_0x2f2e('0xb'),_0x4cf905,_0x2f2e('0xc'));_0x258cb7(_0x4b158a[_0x2f2e('0x13')]['message']);}})[_0x2f2e('0x14')](function(_0x101a04){logger[_0x2f2e('0x10')](_0x2f2e('0xb'),_0x4cf905,_0x101a04);_0x282150(_0x101a04);});});} \ No newline at end of file +var _0x3d7b=['../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x3d7b,0x8d));var _0xb3d7=function(_0x13dbe4,_0x215885){_0x13dbe4=_0x13dbe4-0x0;var _0x5c41e7=_0x3d7b[_0x13dbe4];return _0x5c41e7;};'use strict';var _=require('lodash');var util=require(_0xb3d7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb3d7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3d7('0x2'))['db'];var utils=require(_0xb3d7('0x3'));var logger=require(_0xb3d7('0x4'))(_0xb3d7('0x5'));var config=require(_0xb3d7('0x6'));var jayson=require(_0xb3d7('0x7'));var client=jayson[_0xb3d7('0x8')][_0xb3d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d42f,_0x54f9ac,_0x53e7ac){return new BPromise(function(_0x5aeec1,_0x1b768c){return client[_0xb3d7('0xa')](_0x15d42f,_0x53e7ac)[_0xb3d7('0xb')](function(_0x25ae89){logger[_0xb3d7('0xc')](_0xb3d7('0xd'),_0x54f9ac,_0xb3d7('0xe'));logger[_0xb3d7('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x54f9ac,_0xb3d7('0xe'),JSON['stringify'](_0x25ae89));if(_0x25ae89['error']){if(_0x25ae89[_0xb3d7('0x10')][_0xb3d7('0x11')]===0x1f4){logger[_0xb3d7('0x10')](_0xb3d7('0xd'),_0x54f9ac,_0x25ae89['error']['message']);return _0x1b768c(_0x25ae89[_0xb3d7('0x10')][_0xb3d7('0x12')]);}logger[_0xb3d7('0x10')](_0xb3d7('0xd'),_0x54f9ac,_0x25ae89[_0xb3d7('0x10')][_0xb3d7('0x12')]);return _0x5aeec1(_0x25ae89[_0xb3d7('0x10')][_0xb3d7('0x12')]);}else{logger[_0xb3d7('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x54f9ac,_0xb3d7('0xe'));_0x5aeec1(_0x25ae89[_0xb3d7('0x13')][_0xb3d7('0x12')]);}})[_0xb3d7('0x14')](function(_0x14ebbb){logger[_0xb3d7('0x10')](_0xb3d7('0xd'),_0x54f9ac,_0x14ebbb);_0x1b768c(_0x14ebbb);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 4c6a23a..149e0c1 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 _0x8051=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0x215acd,_0x410e3d){var _0x42739c=function(_0x2747fb){while(--_0x2747fb){_0x215acd['push'](_0x215acd['shift']());}};_0x42739c(++_0x410e3d);}(_0x8051,0x10b));var _0x1805=function(_0xbe2c3d,_0x3e2385){_0xbe2c3d=_0xbe2c3d-0x0;var _0x1760ba=_0x8051[_0xbe2c3d];return _0x1760ba;};'use strict';var multer=require(_0x1805('0x0'));var util=require(_0x1805('0x1'));var path=require('path');var timeout=require(_0x1805('0x2'));var express=require(_0x1805('0x3'));var router=express[_0x1805('0x4')]();var fs_extra=require(_0x1805('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1805('0x6'));var config=require(_0x1805('0x7'));var controller=require(_0x1805('0x8'));router[_0x1805('0x9')]('/',auth[_0x1805('0xa')](),controller[_0x1805('0xb')]);router[_0x1805('0x9')](_0x1805('0xc'),auth[_0x1805('0xa')](),controller['show']);router[_0x1805('0xd')]('/',auth['isAuthenticated'](),controller[_0x1805('0xe')]);router[_0x1805('0xf')](_0x1805('0xc'),auth[_0x1805('0xa')](),controller[_0x1805('0x10')]);router['delete']('/:id',auth[_0x1805('0xa')](),controller[_0x1805('0x11')]);module[_0x1805('0x12')]=router; \ No newline at end of file +var _0x21e5=['index','show','put','/:id','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x32d1ae,_0x575e52){var _0x49cf0b=function(_0x7dc05c){while(--_0x7dc05c){_0x32d1ae['push'](_0x32d1ae['shift']());}};_0x49cf0b(++_0x575e52);}(_0x21e5,0x16f));var _0x521e=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x21e5[_0x18afca];return _0x11603f;};'use strict';var multer=require(_0x521e('0x0'));var util=require(_0x521e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x521e('0x2'));var router=express[_0x521e('0x3')]();var fs_extra=require(_0x521e('0x4'));var auth=require(_0x521e('0x5'));var interaction=require(_0x521e('0x6'));var config=require(_0x521e('0x7'));var controller=require(_0x521e('0x8'));router[_0x521e('0x9')]('/',auth[_0x521e('0xa')](),controller[_0x521e('0xb')]);router[_0x521e('0x9')]('/:id',auth[_0x521e('0xa')](),controller[_0x521e('0xc')]);router['post']('/',auth[_0x521e('0xa')](),controller['create']);router[_0x521e('0xd')](_0x521e('0xe'),auth[_0x521e('0xa')](),controller[_0x521e('0xf')]);router[_0x521e('0x10')]('/:id',auth[_0x521e('0xa')](),controller[_0x521e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 81a7565..a9c2130 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 _0x9094=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x332cdd,_0x4dd1cb){var _0x16bbb8=function(_0x2fb301){while(--_0x2fb301){_0x332cdd['push'](_0x332cdd['shift']());}};_0x16bbb8(++_0x4dd1cb);}(_0x9094,0x111));var _0x4909=function(_0x233f1d,_0x53f19f){_0x233f1d=_0x233f1d-0x0;var _0x144068=_0x9094[_0x233f1d];return _0x144068;};'use strict';var Sequelize=require(_0x4909('0x0'));module[_0x4909('0x1')]={'type':{'type':Sequelize[_0x4909('0x2')](_0x4909('0x3'),_0x4909('0x4'),_0x4909('0x5'),_0x4909('0x6'),_0x4909('0x7')),'defaultValue':_0x4909('0x3')},'content':{'type':Sequelize[_0x4909('0x8')]},'key':{'type':Sequelize[_0x4909('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x4909('0x3'),'variable',_0x4909('0x5'))},'keyContent':{'type':Sequelize[_0x4909('0x8')]},'idField':{'type':Sequelize[_0x4909('0x8')]},'nameField':{'type':Sequelize[_0x4909('0x8')]},'customField':{'type':Sequelize[_0x4909('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4909('0x8')]}}; \ No newline at end of file +var _0x76a6=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x2346ad,_0x522019){var _0x33beed=function(_0x1c400b){while(--_0x1c400b){_0x2346ad['push'](_0x2346ad['shift']());}};_0x33beed(++_0x522019);}(_0x76a6,0x18b));var _0x676a=function(_0x3ce301,_0x858468){_0x3ce301=_0x3ce301-0x0;var _0x323499=_0x76a6[_0x3ce301];return _0x323499;};'use strict';var Sequelize=require(_0x676a('0x0'));module[_0x676a('0x1')]={'type':{'type':Sequelize[_0x676a('0x2')](_0x676a('0x3'),_0x676a('0x4'),_0x676a('0x5'),'keyValue',_0x676a('0x6')),'defaultValue':_0x676a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x676a('0x2')](_0x676a('0x3'),'variable',_0x676a('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x676a('0x7')]},'nameField':{'type':Sequelize[_0x676a('0x7')]},'customField':{'type':Sequelize[_0x676a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x676a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 43b5e5c..4196ec6 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 _0x1588=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x1588,0xc1));var _0x8158=function(_0x3fc823,_0x2e5c8b){_0x3fc823=_0x3fc823-0x0;var _0x2848a8=_0x1588[_0x3fc823];return _0x2848a8;};'use strict';var emlformat=require(_0x8158('0x0'));var rimraf=require(_0x8158('0x1'));var zipdir=require(_0x8158('0x2'));var jsonpatch=require(_0x8158('0x3'));var rp=require(_0x8158('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8158('0x5'));var util=require(_0x8158('0x6'));var path=require(_0x8158('0x7'));var sox=require(_0x8158('0x8'));var csv=require('to-csv');var ejs=require(_0x8158('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8158('0xa'));var squel=require(_0x8158('0xb'));var crypto=require('crypto');var jsforce=require(_0x8158('0xc'));var deskjs=require(_0x8158('0xd'));var toCsv=require(_0x8158('0xe'));var querystring=require(_0x8158('0xf'));var Papa=require('papaparse');var Redis=require(_0x8158('0x10'));var authService=require(_0x8158('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8158('0x12'));var logger=require(_0x8158('0x13'))(_0x8158('0x14'));var utils=require(_0x8158('0x15'));var config=require(_0x8158('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8158('0x17'))['db'];function respondWithStatusCode(_0x4277d6,_0x1b50b9){_0x1b50b9=_0x1b50b9||0xcc;return function(_0x381f66){if(_0x381f66){return _0x4277d6[_0x8158('0x18')](_0x1b50b9);}return _0x4277d6[_0x8158('0x19')](_0x1b50b9)[_0x8158('0x1a')]();};}function respondWithResult(_0x4008f4,_0x5f580b){_0x5f580b=_0x5f580b||0xc8;return function(_0x3e4b38){if(_0x3e4b38){return _0x4008f4['status'](_0x5f580b)[_0x8158('0x1b')](_0x3e4b38);}};}function respondWithFilteredResult(_0x27a63b,_0xb563d){return function(_0x3aab9d){if(_0x3aab9d){var _0x36ca69=typeof _0xb563d['offset']===_0x8158('0x1c')&&typeof _0xb563d[_0x8158('0x1d')]===_0x8158('0x1c');var _0x4e07d1=_0x3aab9d[_0x8158('0x1e')];var _0x9be39c=_0x36ca69?0x0:_0xb563d['offset'];var _0x164d41=_0x36ca69?_0x3aab9d[_0x8158('0x1e')]:_0xb563d[_0x8158('0x1f')]+_0xb563d[_0x8158('0x1d')];var _0x4253f6;if(_0x164d41>=_0x4e07d1){_0x164d41=_0x4e07d1;_0x4253f6=0xc8;}else{_0x4253f6=0xce;}_0x27a63b[_0x8158('0x19')](_0x4253f6);return _0x27a63b[_0x8158('0x20')](_0x8158('0x21'),_0x9be39c+'-'+_0x164d41+'/'+_0x4e07d1)['json'](_0x3aab9d);}return null;};}function patchUpdates(_0x5d75ee){return function(_0xcd8a49){try{jsonpatch[_0x8158('0x22')](_0xcd8a49,_0x5d75ee,!![]);}catch(_0x155d27){return BPromise[_0x8158('0x23')](_0x155d27);}return _0xcd8a49['save']();};}function saveUpdates(_0x2e0986,_0x53d5da){return function(_0x17b1f3){if(_0x17b1f3){return _0x17b1f3[_0x8158('0x24')](_0x2e0986)[_0x8158('0x25')](function(_0x32cfb2){return _0x32cfb2;});}return null;};}function removeEntity(_0x2816cc,_0x50b2fd){return function(_0x539ddc){if(_0x539ddc){return _0x539ddc[_0x8158('0x26')]()[_0x8158('0x25')](function(){_0x2816cc[_0x8158('0x19')](0xcc)[_0x8158('0x1a')]();});}};}function handleEntityNotFound(_0x1fcef7,_0x2320a5){return function(_0x2fb59c){if(!_0x2fb59c){_0x1fcef7[_0x8158('0x18')](0x194);}return _0x2fb59c;};}function handleError(_0x431942,_0xf28ef8){_0xf28ef8=_0xf28ef8||0x1f4;return function(_0x54b05c){logger[_0x8158('0x27')](_0x54b05c['stack']);if(_0x54b05c[_0x8158('0x28')]){delete _0x54b05c['name'];}_0x431942[_0x8158('0x19')](_0xf28ef8)[_0x8158('0x29')](_0x54b05c);};}exports['index']=function(_0x10b91b,_0x572ded){var _0x45c358={},_0x4ae9b1={},_0x492ab0={'count':0x0,'rows':[]};var _0x255964=_[_0x8158('0x2a')](db[_0x8158('0x2b')][_0x8158('0x2c')],function(_0x395b32){return{'name':_0x395b32[_0x8158('0x2d')],'type':_0x395b32[_0x8158('0x2e')][_0x8158('0x2f')]};});_0x4ae9b1[_0x8158('0x30')]=_['map'](_0x255964,_0x8158('0x28'));_0x4ae9b1[_0x8158('0x31')]=_[_0x8158('0x32')](_0x10b91b['query']);_0x4ae9b1[_0x8158('0x33')]=_[_0x8158('0x34')](_0x4ae9b1['model'],_0x4ae9b1['query']);_0x45c358[_0x8158('0x35')]=_[_0x8158('0x34')](_0x4ae9b1[_0x8158('0x30')],qs[_0x8158('0x36')](_0x10b91b[_0x8158('0x31')][_0x8158('0x36')]));_0x45c358[_0x8158('0x35')]=_0x45c358[_0x8158('0x35')]['length']?_0x45c358['attributes']:_0x4ae9b1[_0x8158('0x30')];if(!_0x10b91b[_0x8158('0x31')]['hasOwnProperty']('nolimit')){_0x45c358['limit']=qs[_0x8158('0x1d')](_0x10b91b[_0x8158('0x31')][_0x8158('0x1d')]);_0x45c358[_0x8158('0x1f')]=qs[_0x8158('0x1f')](_0x10b91b[_0x8158('0x31')][_0x8158('0x1f')]);}_0x45c358[_0x8158('0x37')]=qs[_0x8158('0x38')](_0x10b91b[_0x8158('0x31')][_0x8158('0x38')]);_0x45c358[_0x8158('0x39')]=qs[_0x8158('0x33')](_['pick'](_0x10b91b[_0x8158('0x31')],_0x4ae9b1[_0x8158('0x33')]),_0x255964);if(_0x10b91b[_0x8158('0x31')][_0x8158('0x3a')]){_0x45c358[_0x8158('0x39')]=_[_0x8158('0x3b')](_0x45c358[_0x8158('0x39')],{'$or':_['map'](_0x255964,function(_0x2df556){if(_0x2df556['type']!==_0x8158('0x3c')){var _0x2548d6={};_0x2548d6[_0x2df556['name']]={'$like':'%'+_0x10b91b['query'][_0x8158('0x3a')]+'%'};return _0x2548d6;}})});}_0x45c358=_[_0x8158('0x3b')]({},_0x45c358,_0x10b91b[_0x8158('0x3d')]);var _0x4b5b2b={'where':_0x45c358[_0x8158('0x39')]};return db[_0x8158('0x2b')][_0x8158('0x1e')](_0x4b5b2b)['then'](function(_0x2d6736){_0x492ab0[_0x8158('0x1e')]=_0x2d6736;if(_0x10b91b[_0x8158('0x31')][_0x8158('0x3e')]){_0x45c358[_0x8158('0x3f')]=[{'all':!![]}];}return db[_0x8158('0x2b')][_0x8158('0x40')](_0x45c358);})['then'](function(_0x389062){_0x492ab0[_0x8158('0x41')]=_0x389062;return _0x492ab0;})['then'](respondWithFilteredResult(_0x572ded,_0x45c358))['catch'](handleError(_0x572ded,null));};exports[_0x8158('0x42')]=function(_0x5a2c22,_0x47b4f8){var _0x5acaca={'raw':!![],'where':{'id':_0x5a2c22[_0x8158('0x43')]['id']}},_0x2d815a={};_0x2d815a['model']=_[_0x8158('0x32')](db[_0x8158('0x2b')]['rawAttributes']);_0x2d815a['query']=_['keys'](_0x5a2c22['query']);_0x2d815a['filters']=_[_0x8158('0x34')](_0x2d815a[_0x8158('0x30')],_0x2d815a[_0x8158('0x31')]);_0x5acaca[_0x8158('0x35')]=_['intersection'](_0x2d815a[_0x8158('0x30')],qs[_0x8158('0x36')](_0x5a2c22['query'][_0x8158('0x36')]));_0x5acaca[_0x8158('0x35')]=_0x5acaca[_0x8158('0x35')][_0x8158('0x44')]?_0x5acaca[_0x8158('0x35')]:_0x2d815a[_0x8158('0x30')];if(_0x5a2c22[_0x8158('0x31')][_0x8158('0x3e')]){_0x5acaca[_0x8158('0x3f')]=[{'all':!![]}];}_0x5acaca=_[_0x8158('0x3b')]({},_0x5acaca,_0x5a2c22[_0x8158('0x3d')]);return db['ZohoField'][_0x8158('0x45')](_0x5acaca)[_0x8158('0x25')](handleEntityNotFound(_0x47b4f8,null))[_0x8158('0x25')](respondWithResult(_0x47b4f8,null))[_0x8158('0x46')](handleError(_0x47b4f8,null));};exports[_0x8158('0x47')]=function(_0x31596e,_0x147ca3){return db['ZohoField'][_0x8158('0x47')](_0x31596e['body'],{})['then'](respondWithResult(_0x147ca3,0xc9))[_0x8158('0x46')](handleError(_0x147ca3,null));};exports[_0x8158('0x24')]=function(_0x344712,_0xee07a9){if(_0x344712[_0x8158('0x48')]['id']){delete _0x344712['body']['id'];}return db[_0x8158('0x2b')][_0x8158('0x45')]({'where':{'id':_0x344712[_0x8158('0x43')]['id']}})['then'](handleEntityNotFound(_0xee07a9,null))['then'](saveUpdates(_0x344712[_0x8158('0x48')],null))[_0x8158('0x25')](respondWithResult(_0xee07a9,null))[_0x8158('0x46')](handleError(_0xee07a9,null));};exports[_0x8158('0x26')]=function(_0x4c33e2,_0x270e17){return db[_0x8158('0x2b')][_0x8158('0x45')]({'where':{'id':_0x4c33e2['params']['id']}})[_0x8158('0x25')](handleEntityNotFound(_0x270e17,null))['then'](removeEntity(_0x270e17,null))['catch'](handleError(_0x270e17,null));}; \ No newline at end of file +var _0xc9d7=['limit','count','offset','set','Content-Range','apply','update','then','stack','name','index','map','ZohoField','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x324277,_0xa7681f){var _0x42965e=function(_0x5689e6){while(--_0x5689e6){_0x324277['push'](_0x324277['shift']());}};_0x42965e(++_0xa7681f);}(_0xc9d7,0x149));var _0x7c9d=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xc9d7[_0xe15270];return _0x1e813b;};'use strict';var emlformat=require(_0x7c9d('0x0'));var rimraf=require(_0x7c9d('0x1'));var zipdir=require(_0x7c9d('0x2'));var jsonpatch=require(_0x7c9d('0x3'));var rp=require(_0x7c9d('0x4'));var moment=require(_0x7c9d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7c9d('0x6'));var util=require(_0x7c9d('0x7'));var path=require(_0x7c9d('0x8'));var sox=require(_0x7c9d('0x9'));var csv=require(_0x7c9d('0xa'));var ejs=require(_0x7c9d('0xb'));var fs=require('fs');var fs_extra=require(_0x7c9d('0xc'));var _=require(_0x7c9d('0xd'));var squel=require('squel');var crypto=require(_0x7c9d('0xe'));var jsforce=require(_0x7c9d('0xf'));var deskjs=require(_0x7c9d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7c9d('0x11'));var Redis=require(_0x7c9d('0x12'));var authService=require(_0x7c9d('0x13'));var qs=require(_0x7c9d('0x14'));var as=require(_0x7c9d('0x15'));var hardwareService=require(_0x7c9d('0x16'));var logger=require(_0x7c9d('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x7c9d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c9d('0x19'))['db'];function respondWithStatusCode(_0x2bdd8a,_0x12711b){_0x12711b=_0x12711b||0xcc;return function(_0x3eee04){if(_0x3eee04){return _0x2bdd8a[_0x7c9d('0x1a')](_0x12711b);}return _0x2bdd8a[_0x7c9d('0x1b')](_0x12711b)[_0x7c9d('0x1c')]();};}function respondWithResult(_0x40b5a0,_0x1650a0){_0x1650a0=_0x1650a0||0xc8;return function(_0x3f4575){if(_0x3f4575){return _0x40b5a0['status'](_0x1650a0)[_0x7c9d('0x1d')](_0x3f4575);}};}function respondWithFilteredResult(_0x3a9d4f,_0x47b317){return function(_0x2e54b3){if(_0x2e54b3){var _0x5890d0=typeof _0x47b317['offset']===_0x7c9d('0x1e')&&typeof _0x47b317[_0x7c9d('0x1f')]===_0x7c9d('0x1e');var _0x27b810=_0x2e54b3[_0x7c9d('0x20')];var _0x15a71b=_0x5890d0?0x0:_0x47b317[_0x7c9d('0x21')];var _0x5eedeb=_0x5890d0?_0x2e54b3[_0x7c9d('0x20')]:_0x47b317['offset']+_0x47b317[_0x7c9d('0x1f')];var _0x3aecc4;if(_0x5eedeb>=_0x27b810){_0x5eedeb=_0x27b810;_0x3aecc4=0xc8;}else{_0x3aecc4=0xce;}_0x3a9d4f[_0x7c9d('0x1b')](_0x3aecc4);return _0x3a9d4f[_0x7c9d('0x22')](_0x7c9d('0x23'),_0x15a71b+'-'+_0x5eedeb+'/'+_0x27b810)[_0x7c9d('0x1d')](_0x2e54b3);}return null;};}function patchUpdates(_0x5033e9){return function(_0x5b03f8){try{jsonpatch[_0x7c9d('0x24')](_0x5b03f8,_0x5033e9,!![]);}catch(_0xa70fd8){return BPromise['reject'](_0xa70fd8);}return _0x5b03f8['save']();};}function saveUpdates(_0x6b838c,_0x2f67ad){return function(_0x27e628){if(_0x27e628){return _0x27e628[_0x7c9d('0x25')](_0x6b838c)[_0x7c9d('0x26')](function(_0x1bcf0a){return _0x1bcf0a;});}return null;};}function removeEntity(_0x1930bc,_0x25dae0){return function(_0x34b9f8){if(_0x34b9f8){return _0x34b9f8['destroy']()[_0x7c9d('0x26')](function(){_0x1930bc[_0x7c9d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x422436,_0x585d77){return function(_0x33cf65){if(!_0x33cf65){_0x422436[_0x7c9d('0x1a')](0x194);}return _0x33cf65;};}function handleError(_0x2e465d,_0x3b92a4){_0x3b92a4=_0x3b92a4||0x1f4;return function(_0x4bf9d4){logger['error'](_0x4bf9d4[_0x7c9d('0x27')]);if(_0x4bf9d4[_0x7c9d('0x28')]){delete _0x4bf9d4[_0x7c9d('0x28')];}_0x2e465d[_0x7c9d('0x1b')](_0x3b92a4)['send'](_0x4bf9d4);};}exports[_0x7c9d('0x29')]=function(_0xd182fd,_0x3be5ab){var _0x39c59d={},_0xa59df4={},_0x4dd61f={'count':0x0,'rows':[]};var _0x271f94=_[_0x7c9d('0x2a')](db[_0x7c9d('0x2b')][_0x7c9d('0x2c')],function(_0x5c2342){return{'name':_0x5c2342['fieldName'],'type':_0x5c2342[_0x7c9d('0x2d')][_0x7c9d('0x2e')]};});_0xa59df4['model']=_[_0x7c9d('0x2a')](_0x271f94,_0x7c9d('0x28'));_0xa59df4[_0x7c9d('0x2f')]=_[_0x7c9d('0x30')](_0xd182fd[_0x7c9d('0x2f')]);_0xa59df4[_0x7c9d('0x31')]=_[_0x7c9d('0x32')](_0xa59df4[_0x7c9d('0x33')],_0xa59df4[_0x7c9d('0x2f')]);_0x39c59d[_0x7c9d('0x34')]=_['intersection'](_0xa59df4[_0x7c9d('0x33')],qs[_0x7c9d('0x35')](_0xd182fd['query'][_0x7c9d('0x35')]));_0x39c59d['attributes']=_0x39c59d['attributes'][_0x7c9d('0x36')]?_0x39c59d[_0x7c9d('0x34')]:_0xa59df4[_0x7c9d('0x33')];if(!_0xd182fd[_0x7c9d('0x2f')][_0x7c9d('0x37')]('nolimit')){_0x39c59d[_0x7c9d('0x1f')]=qs['limit'](_0xd182fd[_0x7c9d('0x2f')][_0x7c9d('0x1f')]);_0x39c59d[_0x7c9d('0x21')]=qs[_0x7c9d('0x21')](_0xd182fd[_0x7c9d('0x2f')]['offset']);}_0x39c59d['order']=qs[_0x7c9d('0x38')](_0xd182fd['query'][_0x7c9d('0x38')]);_0x39c59d['where']=qs[_0x7c9d('0x31')](_['pick'](_0xd182fd[_0x7c9d('0x2f')],_0xa59df4[_0x7c9d('0x31')]),_0x271f94);if(_0xd182fd[_0x7c9d('0x2f')][_0x7c9d('0x39')]){_0x39c59d['where']=_[_0x7c9d('0x3a')](_0x39c59d[_0x7c9d('0x3b')],{'$or':_[_0x7c9d('0x2a')](_0x271f94,function(_0x2b15b3){if(_0x2b15b3[_0x7c9d('0x2d')]!==_0x7c9d('0x3c')){var _0xe40305={};_0xe40305[_0x2b15b3[_0x7c9d('0x28')]]={'$like':'%'+_0xd182fd[_0x7c9d('0x2f')]['filter']+'%'};return _0xe40305;}})});}_0x39c59d=_[_0x7c9d('0x3a')]({},_0x39c59d,_0xd182fd[_0x7c9d('0x3d')]);var _0x2e42d2={'where':_0x39c59d['where']};return db[_0x7c9d('0x2b')][_0x7c9d('0x20')](_0x2e42d2)[_0x7c9d('0x26')](function(_0x4daa5e){_0x4dd61f['count']=_0x4daa5e;if(_0xd182fd['query'][_0x7c9d('0x3e')]){_0x39c59d[_0x7c9d('0x3f')]=[{'all':!![]}];}return db['ZohoField'][_0x7c9d('0x40')](_0x39c59d);})[_0x7c9d('0x26')](function(_0x270f7c){_0x4dd61f[_0x7c9d('0x41')]=_0x270f7c;return _0x4dd61f;})[_0x7c9d('0x26')](respondWithFilteredResult(_0x3be5ab,_0x39c59d))[_0x7c9d('0x42')](handleError(_0x3be5ab,null));};exports['show']=function(_0x518d3e,_0x5b8bff){var _0x39a5c8={'raw':!![],'where':{'id':_0x518d3e[_0x7c9d('0x43')]['id']}},_0x3fa8de={};_0x3fa8de[_0x7c9d('0x33')]=_['keys'](db[_0x7c9d('0x2b')][_0x7c9d('0x2c')]);_0x3fa8de[_0x7c9d('0x2f')]=_['keys'](_0x518d3e['query']);_0x3fa8de[_0x7c9d('0x31')]=_[_0x7c9d('0x32')](_0x3fa8de['model'],_0x3fa8de['query']);_0x39a5c8[_0x7c9d('0x34')]=_[_0x7c9d('0x32')](_0x3fa8de['model'],qs[_0x7c9d('0x35')](_0x518d3e[_0x7c9d('0x2f')]['fields']));_0x39a5c8['attributes']=_0x39a5c8['attributes'][_0x7c9d('0x36')]?_0x39a5c8[_0x7c9d('0x34')]:_0x3fa8de[_0x7c9d('0x33')];if(_0x518d3e['query'][_0x7c9d('0x3e')]){_0x39a5c8[_0x7c9d('0x3f')]=[{'all':!![]}];}_0x39a5c8=_[_0x7c9d('0x3a')]({},_0x39a5c8,_0x518d3e['options']);return db[_0x7c9d('0x2b')][_0x7c9d('0x44')](_0x39a5c8)['then'](handleEntityNotFound(_0x5b8bff,null))[_0x7c9d('0x26')](respondWithResult(_0x5b8bff,null))['catch'](handleError(_0x5b8bff,null));};exports[_0x7c9d('0x45')]=function(_0x2e9409,_0x18fd9d){return db[_0x7c9d('0x2b')][_0x7c9d('0x45')](_0x2e9409['body'],{})[_0x7c9d('0x26')](respondWithResult(_0x18fd9d,0xc9))[_0x7c9d('0x42')](handleError(_0x18fd9d,null));};exports[_0x7c9d('0x25')]=function(_0x57e628,_0x57717d){if(_0x57e628[_0x7c9d('0x46')]['id']){delete _0x57e628['body']['id'];}return db[_0x7c9d('0x2b')][_0x7c9d('0x44')]({'where':{'id':_0x57e628[_0x7c9d('0x43')]['id']}})[_0x7c9d('0x26')](handleEntityNotFound(_0x57717d,null))[_0x7c9d('0x26')](saveUpdates(_0x57e628['body'],null))['then'](respondWithResult(_0x57717d,null))['catch'](handleError(_0x57717d,null));};exports[_0x7c9d('0x47')]=function(_0x42450d,_0x2af384){return db[_0x7c9d('0x2b')][_0x7c9d('0x44')]({'where':{'id':_0x42450d[_0x7c9d('0x43')]['id']}})[_0x7c9d('0x26')](handleEntityNotFound(_0x2af384,null))[_0x7c9d('0x26')](removeEntity(_0x2af384,null))[_0x7c9d('0x42')](handleError(_0x2af384,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 733d47c..c1ed641 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 _0x2d72=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x2d72,0xa8));var _0x22d7=function(_0x4c44e9,_0x34d89b){_0x4c44e9=_0x4c44e9-0x0;var _0x617c06=_0x2d72[_0x4c44e9];return _0x617c06;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x22d7('0xe'),_0x22d7('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId'];(function(_0x295e87,_0xaff0b7){var _0xe4eed7=function(_0x18bc75){while(--_0x18bc75){_0x295e87['push'](_0x295e87['shift']());}};_0xe4eed7(++_0xaff0b7);}(_0x5fab,0x177));var _0xb5fa=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0x5fab[_0xb65e77];return _0x38134b;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['idField',_0xb5fa('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 1a9c916..7bc38eb 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 _0x185e=['debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x2d179a,_0x74c556){var _0x911482=function(_0x5e36f8){while(--_0x5e36f8){_0x2d179a['push'](_0x2d179a['shift']());}};_0x911482(++_0x74c556);}(_0x185e,0xcc));var _0xe185=function(_0x68a64c,_0x4fa1e1){_0x68a64c=_0x68a64c-0x0;var _0x3acf1f=_0x185e[_0x68a64c];return _0x3acf1f;};'use strict';var _=require(_0xe185('0x0'));var util=require(_0xe185('0x1'));var moment=require(_0xe185('0x2'));var BPromise=require(_0xe185('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe185('0x4'));var db=require(_0xe185('0x5'))['db'];var utils=require(_0xe185('0x6'));var logger=require(_0xe185('0x7'))('rpc');var config=require(_0xe185('0x8'));var jayson=require(_0xe185('0x9'));var client=jayson[_0xe185('0xa')][_0xe185('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bd53a,_0x1fce38,_0x198737){return new BPromise(function(_0x1fa9a6,_0x131f62){return client[_0xe185('0xc')](_0x3bd53a,_0x198737)['then'](function(_0x10e9cb){logger[_0xe185('0xd')](_0xe185('0xe'),_0x1fce38,_0xe185('0xf'));logger[_0xe185('0x10')](_0xe185('0x11'),_0x1fce38,_0xe185('0xf'),JSON['stringify'](_0x10e9cb));if(_0x10e9cb['error']){if(_0x10e9cb[_0xe185('0x12')][_0xe185('0x13')]===0x1f4){logger[_0xe185('0x12')]('ZohoField,\x20%s,\x20%s',_0x1fce38,_0x10e9cb[_0xe185('0x12')][_0xe185('0x14')]);return _0x131f62(_0x10e9cb['error'][_0xe185('0x14')]);}logger['error'](_0xe185('0xe'),_0x1fce38,_0x10e9cb['error'][_0xe185('0x14')]);return _0x1fa9a6(_0x10e9cb[_0xe185('0x12')]['message']);}else{logger[_0xe185('0xd')]('ZohoField,\x20%s,\x20%s',_0x1fce38,_0xe185('0xf'));_0x1fa9a6(_0x10e9cb['result'][_0xe185('0x14')]);}})[_0xe185('0x15')](function(_0x4cc82d){logger[_0xe185('0x12')]('ZohoField,\x20%s,\x20%s',_0x1fce38,_0x4cc82d);_0x131f62(_0x4cc82d);});});} \ No newline at end of file +var _0x3b11=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird'];(function(_0x1b17ed,_0x3a621f){var _0x12a2bd=function(_0x1e7316){while(--_0x1e7316){_0x1b17ed['push'](_0x1b17ed['shift']());}};_0x12a2bd(++_0x3a621f);}(_0x3b11,0xee));var _0x13b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b11[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x13b1('0x0'));var moment=require('moment');var BPromise=require(_0x13b1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13b1('0x2'));var db=require(_0x13b1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x13b1('0x4'))('rpc');var config=require(_0x13b1('0x5'));var jayson=require(_0x13b1('0x6'));var client=jayson[_0x13b1('0x7')][_0x13b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29aed1,_0x21d1a6,_0x3e6ed6){return new BPromise(function(_0x2e9fb8,_0x222470){return client[_0x13b1('0x9')](_0x29aed1,_0x3e6ed6)[_0x13b1('0xa')](function(_0x1b0577){logger[_0x13b1('0xb')](_0x13b1('0xc'),_0x21d1a6,_0x13b1('0xd'));logger['debug'](_0x13b1('0xe'),_0x21d1a6,_0x13b1('0xd'),JSON[_0x13b1('0xf')](_0x1b0577));if(_0x1b0577[_0x13b1('0x10')]){if(_0x1b0577['error'][_0x13b1('0x11')]===0x1f4){logger[_0x13b1('0x10')](_0x13b1('0xc'),_0x21d1a6,_0x1b0577[_0x13b1('0x10')]['message']);return _0x222470(_0x1b0577[_0x13b1('0x10')][_0x13b1('0x12')]);}logger[_0x13b1('0x10')](_0x13b1('0xc'),_0x21d1a6,_0x1b0577[_0x13b1('0x10')][_0x13b1('0x12')]);return _0x2e9fb8(_0x1b0577[_0x13b1('0x10')]['message']);}else{logger[_0x13b1('0xb')](_0x13b1('0xc'),_0x21d1a6,_0x13b1('0xd'));_0x2e9fb8(_0x1b0577['result'][_0x13b1('0x12')]);}})[_0x13b1('0x13')](function(_0x3d94e3){logger['error'](_0x13b1('0xc'),_0x21d1a6,_0x3d94e3);_0x222470(_0x3d94e3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8bd3b20..766fa06 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(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e295c,_0x4a2c73){var _0x5899aa=function(_0x25fecf){while(--_0x25fecf){_0x5e295c['push'](_0x5e295c['shift']());}};_0x5899aa(++_0x4a2c73);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e6ba841..5b1bae5 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 _0x1aa8=['INTEGER','BOOLEAN','sequelize','STRING','unique_name_and_version'];(function(_0x324e71,_0x410fb9){var _0x3ba487=function(_0x444b51){while(--_0x444b51){_0x324e71['push'](_0x324e71['shift']());}};_0x3ba487(++_0x410fb9);}(_0x1aa8,0x197));var _0x81aa=function(_0x303e92,_0x3032e2){_0x303e92=_0x303e92-0x0;var _0xacdedc=_0x1aa8[_0x303e92];return _0xacdedc;};'use strict';var Sequelize=require(_0x81aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x81aa('0x1')],'allowNull':![],'unique':_0x81aa('0x2')},'version':{'type':Sequelize[_0x81aa('0x1')],'allowNull':![],'unique':_0x81aa('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x81aa('0x1')]},'path':{'type':Sequelize[_0x81aa('0x1')]},'type':{'type':Sequelize[_0x81aa('0x1')]},'size':{'type':Sequelize[_0x81aa('0x3')]},'active':{'type':Sequelize[_0x81aa('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x81aa('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x81aa('0x1')]},'remoteUri':{'type':Sequelize[_0x81aa('0x1')]},'link':{'type':Sequelize[_0x81aa('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x7799=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x265d28,_0xe1504f){var _0x526bc8=function(_0x1aa4e4){while(--_0x1aa4e4){_0x265d28['push'](_0x265d28['shift']());}};_0x526bc8(++_0xe1504f);}(_0x7799,0xbc));var _0x9779=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x7799[_0x241424];return _0x3da798;};'use strict';var Sequelize=require(_0x9779('0x0'));module['exports']={'name':{'type':Sequelize[_0x9779('0x1')],'allowNull':![],'unique':_0x9779('0x2')},'version':{'type':Sequelize[_0x9779('0x1')],'allowNull':![],'unique':_0x9779('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x9779('0x3')},'filename':{'type':Sequelize[_0x9779('0x1')]},'path':{'type':Sequelize[_0x9779('0x1')]},'type':{'type':Sequelize[_0x9779('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x9779('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x9779('0x5')},'description':{'type':Sequelize[_0x9779('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9779('0x1')]},'link':{'type':Sequelize[_0x9779('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 ea6bd0d..68175ae 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 _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x144dd8,_0x114600){var _0x105822=function(_0x5ef92e){while(--_0x5ef92e){_0x144dd8['push'](_0x144dd8['shift']());}};_0x105822(++_0x114600);}(_0x9f0e,0x116));var _0xe9f0=function(_0xb860f1,_0x44d538){_0xb860f1=_0xb860f1-0x0;var _0x583500=_0x9f0e[_0xb860f1];return _0x583500;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));}; \ No newline at end of file +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(_0x56eb1e,_0x4f021e){var _0x487587=function(_0x4099fb){while(--_0x4099fb){_0x56eb1e['push'](_0x56eb1e['shift']());}};_0x487587(++_0x4f021e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe3da[_0x4a9fb1];return _0x348672;};'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 diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b9c1976..6b9d5be 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 _0x9fee=['lodash','util','api','bluebird','request-promise','path','./integration.attributes','exports','integrations'];(function(_0x59545b,_0x2c3610){var _0x4b4f7d=function(_0x15b1e9){while(--_0x15b1e9){_0x59545b['push'](_0x59545b['shift']());}};_0x4b4f7d(++_0x2c3610);}(_0x9fee,0x1d4));var _0xe9fe=function(_0x28b87a,_0x1e2f1d){_0x28b87a=_0x28b87a-0x0;var _0x1fc468=_0x9fee[_0x28b87a];return _0x1fc468;};'use strict';var _=require(_0xe9fe('0x0'));var util=require(_0xe9fe('0x1'));var logger=require('../../config/logger')(_0xe9fe('0x2'));var moment=require('moment');var BPromise=require(_0xe9fe('0x3'));var rp=require(_0xe9fe('0x4'));var fs=require('fs');var path=require(_0xe9fe('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9fe('0x6'));module[_0xe9fe('0x7')]=function(_0x1a12c0,_0x4c41f3){return _0x1a12c0['define']('Integration',attributes,{'tableName':_0xe9fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fc8=['define','Integration','integrations','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0fc8,0x1c6));var _0x80fc=function(_0x39decf,_0x10e88e){_0x39decf=_0x39decf-0x0;var _0x530b33=_0x0fc8[_0x39decf];return _0x530b33;};'use strict';var _=require(_0x80fc('0x0'));var util=require(_0x80fc('0x1'));var logger=require(_0x80fc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x80fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80fc('0x4'));var rimraf=require(_0x80fc('0x5'));var config=require(_0x80fc('0x6'));var attributes=require(_0x80fc('0x7'));module['exports']=function(_0x499761,_0x47b970){return _0x499761[_0x80fc('0x8')](_0x80fc('0x9'),attributes,{'tableName':_0x80fc('0xa'),'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 241bd73..53f8f2e 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 _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x45c152,_0x3d3b1e){var _0x35c023=function(_0x29a50f){while(--_0x29a50f){_0x45c152['push'](_0x45c152['shift']());}};_0x35c023(++_0x3d3b1e);}(_0xba34,0x119));var _0x4ba3=function(_0x925ebc,_0x275c18){_0x925ebc=_0x925ebc-0x0;var _0x128de5=_0xba34[_0x925ebc];return _0x128de5;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file +var _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x289bd5,_0x2f5f5f){var _0x3f28d7=function(_0x54414d){while(--_0x54414d){_0x289bd5['push'](_0x289bd5['shift']());}};_0x3f28d7(++_0x2f5f5f);}(_0x955f,0x1eb));var _0xf955=function(_0x19d835,_0xd3a0b){_0x19d835=_0x19d835-0x0;var _0x329475=_0x955f[_0x19d835];return _0x329475;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ff678f8..11006d9 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x271c3a,_0x23145c){var _0x416530=function(_0x4b594c){while(--_0x4b594c){_0x271c3a['push'](_0x271c3a['shift']());}};_0x416530(++_0x23145c);}(_0x4975,0x86));var _0x5497=function(_0x5f299b,_0xf9ee14){_0x5f299b=_0x5f299b-0x0;var _0x225b79=_0x4975[_0x5f299b];return _0x225b79;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x40f7e3,_0x5d2c41){var _0x146e15=function(_0x3ef90e){while(--_0x3ef90e){_0x40f7e3['push'](_0x40f7e3['shift']());}};_0x146e15(++_0x5d2c41);}(_0x187d,0x93));var _0xd187=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x187d[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 48fa574..c230f0b 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 _0x8fb5=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0xffce03,_0x516741){var _0x5be386=function(_0x2eb3bf){while(--_0x2eb3bf){_0xffce03['push'](_0xffce03['shift']());}};_0x5be386(++_0x516741);}(_0x8fb5,0x1dd));var _0x58fb=function(_0x22dbc9,_0x3ed2f6){_0x22dbc9=_0x22dbc9-0x0;var _0x53e85a=_0x8fb5[_0x22dbc9];return _0x53e85a;};'use strict';var Sequelize=require(_0x58fb('0x0'));module[_0x58fb('0x1')]={'integration':{'type':Sequelize[_0x58fb('0x2')]},'eventChannel':{'type':Sequelize[_0x58fb('0x2')]},'exitStatus':{'type':Sequelize[_0x58fb('0x2')]},'ticketId':{'type':Sequelize[_0x58fb('0x2')]},'integrationId':{'type':Sequelize[_0x58fb('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x58fb('0x2')]},'calleridnum':{'type':Sequelize[_0x58fb('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x58fb('0x2')]},'interface':{'type':Sequelize[_0x58fb('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x58fb('0x4')]},'agentconnectAt':{'type':Sequelize[_0x58fb('0x4')]},'holdtime':{'type':Sequelize[_0x58fb('0x3')]},'agentcomplete':{'type':Sequelize[_0x58fb('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x58fb('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x58fb('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x58fb('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x58fb('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x58fb('0x4')]},'agentdump':{'type':Sequelize[_0x58fb('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x58fb('0x4')]},'lastevent':{'type':Sequelize[_0x58fb('0x2')]},'channel':{'type':Sequelize[_0x58fb('0x2')]},'channelstate':{'type':Sequelize[_0x58fb('0x3')]},'channelstatedesc':{'type':Sequelize[_0x58fb('0x2')]},'connectedlinenum':{'type':Sequelize[_0x58fb('0x2')]},'connectedlinename':{'type':Sequelize[_0x58fb('0x2')]},'language':{'type':Sequelize[_0x58fb('0x2')]},'accountcode':{'type':Sequelize[_0x58fb('0x2')]},'context':{'type':Sequelize[_0x58fb('0x2')]},'exten':{'type':Sequelize[_0x58fb('0x2')]},'priority':{'type':Sequelize[_0x58fb('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x58fb('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x58fb('0x2')]},'destcalleridnum':{'type':Sequelize[_0x58fb('0x2')]},'destcalleridname':{'type':Sequelize[_0x58fb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x58fb('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x58fb('0x2')]},'destaccountcode':{'type':Sequelize[_0x58fb('0x2')]},'destcontext':{'type':Sequelize[_0x58fb('0x2')]},'destexten':{'type':Sequelize[_0x58fb('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x58fb('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x58fb('0x2')]},'subject':{'type':Sequelize[_0x58fb('0x2')]},'from':{'type':Sequelize[_0x58fb('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x58fb('0x2')]},'attachment':{'type':Sequelize[_0x58fb('0x6')]},'html':{'type':Sequelize[_0x58fb('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x58fb('0x7')](_0x58fb('0x8'),_0x58fb('0x9'),_0x58fb('0xa'),_0x58fb('0xb'))},'url':{'type':Sequelize[_0x58fb('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x58fb('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4acd=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT'];(function(_0xb1ac47,_0x643ac1){var _0x2d964d=function(_0x1b6188){while(--_0x1b6188){_0xb1ac47['push'](_0xb1ac47['shift']());}};_0x2d964d(++_0x643ac1);}(_0x4acd,0x18f));var _0xd4ac=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0x4acd[_0x30a528];return _0x3e029c;};'use strict';var Sequelize=require(_0xd4ac('0x0'));module[_0xd4ac('0x1')]={'integration':{'type':Sequelize[_0xd4ac('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xd4ac('0x2')]},'uniqueid':{'type':Sequelize[_0xd4ac('0x2')]},'calleridnum':{'type':Sequelize[_0xd4ac('0x2')]},'calleridname':{'type':Sequelize[_0xd4ac('0x2')]},'queue':{'type':Sequelize[_0xd4ac('0x2')]},'interface':{'type':Sequelize[_0xd4ac('0x2')]},'membername':{'type':Sequelize[_0xd4ac('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd4ac('0x3')]},'holdtime':{'type':Sequelize[_0xd4ac('0x4')]},'agentcomplete':{'type':Sequelize[_0xd4ac('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd4ac('0x3')]},'talktime':{'type':Sequelize[_0xd4ac('0x4')]},'agentacw':{'type':Sequelize[_0xd4ac('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xd4ac('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xd4ac('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xd4ac('0x3')]},'agentdump':{'type':Sequelize[_0xd4ac('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd4ac('0x3')]},'lastevent':{'type':Sequelize[_0xd4ac('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd4ac('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd4ac('0x2')]},'accountcode':{'type':Sequelize[_0xd4ac('0x2')]},'context':{'type':Sequelize[_0xd4ac('0x2')]},'exten':{'type':Sequelize[_0xd4ac('0x2')]},'priority':{'type':Sequelize[_0xd4ac('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd4ac('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd4ac('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd4ac('0x2')]},'destcalleridname':{'type':Sequelize[_0xd4ac('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd4ac('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd4ac('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd4ac('0x2')]},'destcontext':{'type':Sequelize[_0xd4ac('0x2')]},'destexten':{'type':Sequelize[_0xd4ac('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd4ac('0x2')]},'messageId':{'type':Sequelize[_0xd4ac('0x2')]},'inReplyTo':{'type':Sequelize[_0xd4ac('0x2')]},'subject':{'type':Sequelize[_0xd4ac('0x2')]},'from':{'type':Sequelize[_0xd4ac('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xd4ac('0x2')]},'attachment':{'type':Sequelize[_0xd4ac('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xd4ac('0x7'),_0xd4ac('0x8'),_0xd4ac('0x9'),_0xd4ac('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xd4ac('0x2')]},'projectId':{'type':Sequelize[_0xd4ac('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 588c392..a1c405f 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 _0x6599=['to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','send','index','map','fieldName','type','key','name','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','IntegrationReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox'];(function(_0x44a4b5,_0x312a22){var _0x57e469=function(_0x38c29d){while(--_0x38c29d){_0x44a4b5['push'](_0x44a4b5['shift']());}};_0x57e469(++_0x312a22);}(_0x6599,0x8e));var _0x9659=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x6599[_0x15ca1a];return _0x507626;};'use strict';var emlformat=require(_0x9659('0x0'));var rimraf=require(_0x9659('0x1'));var zipdir=require(_0x9659('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9659('0x3'));var moment=require(_0x9659('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9659('0x5'));var util=require(_0x9659('0x6'));var path=require('path');var sox=require(_0x9659('0x7'));var csv=require(_0x9659('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9659('0x9'));var _=require(_0x9659('0xa'));var squel=require(_0x9659('0xb'));var crypto=require(_0x9659('0xc'));var jsforce=require(_0x9659('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9659('0xe'));var Papa=require(_0x9659('0xf'));var Redis=require(_0x9659('0x10'));var authService=require(_0x9659('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9659('0x12'));var hardwareService=require(_0x9659('0x13'));var logger=require(_0x9659('0x14'))(_0x9659('0x15'));var utils=require(_0x9659('0x16'));var config=require(_0x9659('0x17'));var licenseUtil=require(_0x9659('0x18'));var db=require(_0x9659('0x19'))['db'];function respondWithStatusCode(_0xd2bd5c,_0xd57017){_0xd57017=_0xd57017||0xcc;return function(_0x141600){if(_0x141600){return _0xd2bd5c[_0x9659('0x1a')](_0xd57017);}return _0xd2bd5c[_0x9659('0x1b')](_0xd57017)[_0x9659('0x1c')]();};}function respondWithResult(_0x33a8c4,_0x3ca405){_0x3ca405=_0x3ca405||0xc8;return function(_0x34ea3d){if(_0x34ea3d){return _0x33a8c4[_0x9659('0x1b')](_0x3ca405)[_0x9659('0x1d')](_0x34ea3d);}};}function respondWithFilteredResult(_0x468347,_0x48cd85){return function(_0x56fe80){if(_0x56fe80){var _0x18d440=typeof _0x48cd85[_0x9659('0x1e')]==='undefined'&&typeof _0x48cd85[_0x9659('0x1f')]===_0x9659('0x20');var _0x37b9fc=_0x56fe80[_0x9659('0x21')];var _0x243ffd=_0x18d440?0x0:_0x48cd85[_0x9659('0x1e')];var _0x1a51b0=_0x18d440?_0x56fe80[_0x9659('0x21')]:_0x48cd85[_0x9659('0x1e')]+_0x48cd85[_0x9659('0x1f')];var _0x1338ac;if(_0x1a51b0>=_0x37b9fc){_0x1a51b0=_0x37b9fc;_0x1338ac=0xc8;}else{_0x1338ac=0xce;}_0x468347['status'](_0x1338ac);return _0x468347[_0x9659('0x22')]('Content-Range',_0x243ffd+'-'+_0x1a51b0+'/'+_0x37b9fc)[_0x9659('0x1d')](_0x56fe80);}return null;};}function patchUpdates(_0x30e5b6){return function(_0x11e9c3){try{jsonpatch['apply'](_0x11e9c3,_0x30e5b6,!![]);}catch(_0x11573c){return BPromise['reject'](_0x11573c);}return _0x11e9c3[_0x9659('0x23')]();};}function saveUpdates(_0x53281d,_0x19124f){return function(_0x19f240){if(_0x19f240){return _0x19f240[_0x9659('0x24')](_0x53281d)[_0x9659('0x25')](function(_0x14002d){return _0x14002d;});}return null;};}function removeEntity(_0x13fcf0,_0xc92077){return function(_0x100c17){if(_0x100c17){return _0x100c17['destroy']()[_0x9659('0x25')](function(){_0x13fcf0[_0x9659('0x1b')](0xcc)[_0x9659('0x1c')]();});}};}function handleEntityNotFound(_0x3bf2c7,_0x4f41eb){return function(_0x3b1e70){if(!_0x3b1e70){_0x3bf2c7[_0x9659('0x1a')](0x194);}return _0x3b1e70;};}function handleError(_0x46c668,_0x1412cc){_0x1412cc=_0x1412cc||0x1f4;return function(_0x3f1df3){logger['error'](_0x3f1df3['stack']);if(_0x3f1df3['name']){delete _0x3f1df3['name'];}_0x46c668[_0x9659('0x1b')](_0x1412cc)[_0x9659('0x26')](_0x3f1df3);};}exports[_0x9659('0x27')]=function(_0x3015fb,_0x2ccd43){var _0x110d16={},_0x14895e={},_0x22b427={'count':0x0,'rows':[]};var _0x47e5b9=_[_0x9659('0x28')](db['IntegrationReport']['rawAttributes'],function(_0x3757b4){return{'name':_0x3757b4[_0x9659('0x29')],'type':_0x3757b4[_0x9659('0x2a')][_0x9659('0x2b')]};});_0x14895e['model']=_['map'](_0x47e5b9,_0x9659('0x2c'));_0x14895e[_0x9659('0x2d')]=_['keys'](_0x3015fb['query']);_0x14895e[_0x9659('0x2e')]=_['intersection'](_0x14895e[_0x9659('0x2f')],_0x14895e[_0x9659('0x2d')]);_0x110d16[_0x9659('0x30')]=_[_0x9659('0x31')](_0x14895e[_0x9659('0x2f')],qs['fields'](_0x3015fb['query'][_0x9659('0x32')]));_0x110d16[_0x9659('0x30')]=_0x110d16[_0x9659('0x30')][_0x9659('0x33')]?_0x110d16[_0x9659('0x30')]:_0x14895e[_0x9659('0x2f')];if(!_0x3015fb[_0x9659('0x2d')][_0x9659('0x34')](_0x9659('0x35'))){_0x110d16['limit']=qs['limit'](_0x3015fb['query']['limit']);_0x110d16[_0x9659('0x1e')]=qs[_0x9659('0x1e')](_0x3015fb['query'][_0x9659('0x1e')]);}_0x110d16[_0x9659('0x36')]=qs['sort'](_0x3015fb[_0x9659('0x2d')][_0x9659('0x37')]);_0x110d16[_0x9659('0x38')]=qs[_0x9659('0x2e')](_[_0x9659('0x39')](_0x3015fb[_0x9659('0x2d')],_0x14895e[_0x9659('0x2e')]),_0x47e5b9);if(_0x3015fb['query'][_0x9659('0x3a')]){_0x110d16[_0x9659('0x38')]=_[_0x9659('0x3b')](_0x110d16['where'],{'$or':_['map'](_0x47e5b9,function(_0x2080a6){if(_0x2080a6[_0x9659('0x2a')]!=='VIRTUAL'){var _0x5eb054={};_0x5eb054[_0x2080a6['name']]={'$like':'%'+_0x3015fb[_0x9659('0x2d')][_0x9659('0x3a')]+'%'};return _0x5eb054;}})});}_0x110d16=_[_0x9659('0x3b')]({},_0x110d16,_0x3015fb[_0x9659('0x3c')]);var _0x1c82f9={'where':_0x110d16[_0x9659('0x38')]};return db[_0x9659('0x3d')][_0x9659('0x21')](_0x1c82f9)[_0x9659('0x25')](function(_0x84642b){_0x22b427[_0x9659('0x21')]=_0x84642b;if(_0x3015fb[_0x9659('0x2d')]['includeAll']){_0x110d16[_0x9659('0x3e')]=[{'all':!![]}];}return db[_0x9659('0x3d')][_0x9659('0x3f')](_0x110d16);})[_0x9659('0x25')](function(_0x4d1d39){_0x22b427[_0x9659('0x40')]=_0x4d1d39;return _0x22b427;})[_0x9659('0x25')](respondWithFilteredResult(_0x2ccd43,_0x110d16))[_0x9659('0x41')](handleError(_0x2ccd43,null));};exports[_0x9659('0x42')]=function(_0x169c72,_0x2ac3ca){var _0x2e1c59={'raw':![],'where':{'id':_0x169c72[_0x9659('0x43')]['id']}},_0x331c29={};_0x331c29[_0x9659('0x2f')]=_[_0x9659('0x44')](db[_0x9659('0x3d')]['rawAttributes']);_0x331c29[_0x9659('0x2d')]=_[_0x9659('0x44')](_0x169c72[_0x9659('0x2d')]);_0x331c29[_0x9659('0x2e')]=_[_0x9659('0x31')](_0x331c29[_0x9659('0x2f')],_0x331c29[_0x9659('0x2d')]);_0x2e1c59[_0x9659('0x30')]=_[_0x9659('0x31')](_0x331c29['model'],qs[_0x9659('0x32')](_0x169c72['query'][_0x9659('0x32')]));_0x2e1c59[_0x9659('0x30')]=_0x2e1c59[_0x9659('0x30')][_0x9659('0x33')]?_0x2e1c59[_0x9659('0x30')]:_0x331c29[_0x9659('0x2f')];if(_0x169c72[_0x9659('0x2d')][_0x9659('0x45')]){_0x2e1c59[_0x9659('0x3e')]=[{'all':!![]}];}_0x2e1c59=_[_0x9659('0x3b')]({},_0x2e1c59,_0x169c72[_0x9659('0x3c')]);return db['IntegrationReport'][_0x9659('0x46')](_0x2e1c59)[_0x9659('0x25')](handleEntityNotFound(_0x2ac3ca,null))[_0x9659('0x25')](respondWithResult(_0x2ac3ca,null))[_0x9659('0x41')](handleError(_0x2ac3ca,null));};exports['create']=function(_0x49d590,_0x31e3af){return db[_0x9659('0x3d')][_0x9659('0x47')](_0x49d590[_0x9659('0x48')],{})[_0x9659('0x25')](respondWithResult(_0x31e3af,0xc9))['catch'](handleError(_0x31e3af,null));};exports[_0x9659('0x24')]=function(_0x31f513,_0x3deeea){if(_0x31f513[_0x9659('0x48')]['id']){delete _0x31f513[_0x9659('0x48')]['id'];}return db[_0x9659('0x3d')][_0x9659('0x46')]({'where':{'id':_0x31f513[_0x9659('0x43')]['id']}})[_0x9659('0x25')](handleEntityNotFound(_0x3deeea,null))[_0x9659('0x25')](saveUpdates(_0x31f513[_0x9659('0x48')],null))['then'](respondWithResult(_0x3deeea,null))['catch'](handleError(_0x3deeea,null));};exports[_0x9659('0x49')]=function(_0x208e49,_0x492681){return db['IntegrationReport'][_0x9659('0x46')]({'where':{'id':_0x208e49[_0x9659('0x43')]['id']}})[_0x9659('0x25')](handleEntityNotFound(_0x492681,null))[_0x9659('0x25')](removeEntity(_0x492681,null))[_0x9659('0x41')](handleError(_0x492681,null));};exports[_0x9659('0x4a')]=function(_0x37a400,_0x159e1f){return db[_0x9659('0x3d')][_0x9659('0x4a')]()[_0x9659('0x25')](respondWithResult(_0x159e1f,null))[_0x9659('0x41')](handleError(_0x159e1f,null));}; \ No newline at end of file +var _0x8f38=['stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','IntegrationReport','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','sendStatus'];(function(_0x21cdd8,_0x273525){var _0x43b93e=function(_0x56ae4e){while(--_0x56ae4e){_0x21cdd8['push'](_0x21cdd8['shift']());}};_0x43b93e(++_0x273525);}(_0x8f38,0x144));var _0x88f3=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x8f38[_0x2c7b86];return _0x256735;};'use strict';var emlformat=require(_0x88f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88f3('0x1'));var jsonpatch=require(_0x88f3('0x2'));var rp=require('request-promise');var moment=require(_0x88f3('0x3'));var BPromise=require(_0x88f3('0x4'));var Mustache=require(_0x88f3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x88f3('0x6'));var csv=require(_0x88f3('0x7'));var ejs=require(_0x88f3('0x8'));var fs=require('fs');var fs_extra=require(_0x88f3('0x9'));var _=require(_0x88f3('0xa'));var squel=require('squel');var crypto=require(_0x88f3('0xb'));var jsforce=require(_0x88f3('0xc'));var deskjs=require(_0x88f3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x88f3('0xe'));var Papa=require(_0x88f3('0xf'));var Redis=require('ioredis');var authService=require(_0x88f3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88f3('0x11'));var logger=require('../../config/logger')(_0x88f3('0x12'));var utils=require(_0x88f3('0x13'));var config=require(_0x88f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x88f3('0x15'))['db'];function respondWithStatusCode(_0x3cf290,_0xa0f463){_0xa0f463=_0xa0f463||0xcc;return function(_0x3d87fe){if(_0x3d87fe){return _0x3cf290['sendStatus'](_0xa0f463);}return _0x3cf290[_0x88f3('0x16')](_0xa0f463)[_0x88f3('0x17')]();};}function respondWithResult(_0x154e3e,_0x44028b){_0x44028b=_0x44028b||0xc8;return function(_0x379efa){if(_0x379efa){return _0x154e3e[_0x88f3('0x16')](_0x44028b)['json'](_0x379efa);}};}function respondWithFilteredResult(_0x8cbeb4,_0x5d4dfa){return function(_0x3ce39f){if(_0x3ce39f){var _0x5276bc=typeof _0x5d4dfa[_0x88f3('0x18')]===_0x88f3('0x19')&&typeof _0x5d4dfa[_0x88f3('0x1a')]===_0x88f3('0x19');var _0x1a7af9=_0x3ce39f[_0x88f3('0x1b')];var _0x267353=_0x5276bc?0x0:_0x5d4dfa['offset'];var _0x1e10a3=_0x5276bc?_0x3ce39f[_0x88f3('0x1b')]:_0x5d4dfa[_0x88f3('0x18')]+_0x5d4dfa['limit'];var _0x59be2f;if(_0x1e10a3>=_0x1a7af9){_0x1e10a3=_0x1a7af9;_0x59be2f=0xc8;}else{_0x59be2f=0xce;}_0x8cbeb4[_0x88f3('0x16')](_0x59be2f);return _0x8cbeb4[_0x88f3('0x1c')](_0x88f3('0x1d'),_0x267353+'-'+_0x1e10a3+'/'+_0x1a7af9)[_0x88f3('0x1e')](_0x3ce39f);}return null;};}function patchUpdates(_0x1c7f2e){return function(_0x29a41d){try{jsonpatch['apply'](_0x29a41d,_0x1c7f2e,!![]);}catch(_0x2707f5){return BPromise[_0x88f3('0x1f')](_0x2707f5);}return _0x29a41d[_0x88f3('0x20')]();};}function saveUpdates(_0x555ed4,_0x42c2af){return function(_0x2a89bb){if(_0x2a89bb){return _0x2a89bb['update'](_0x555ed4)[_0x88f3('0x21')](function(_0x399620){return _0x399620;});}return null;};}function removeEntity(_0x5ef8ef,_0x202bdd){return function(_0x316512){if(_0x316512){return _0x316512[_0x88f3('0x22')]()[_0x88f3('0x21')](function(){_0x5ef8ef[_0x88f3('0x16')](0xcc)[_0x88f3('0x17')]();});}};}function handleEntityNotFound(_0x5882b8,_0x3cb894){return function(_0x4452fc){if(!_0x4452fc){_0x5882b8[_0x88f3('0x23')](0x194);}return _0x4452fc;};}function handleError(_0x35389a,_0x295ea0){_0x295ea0=_0x295ea0||0x1f4;return function(_0x46ee59){logger['error'](_0x46ee59[_0x88f3('0x24')]);if(_0x46ee59[_0x88f3('0x25')]){delete _0x46ee59[_0x88f3('0x25')];}_0x35389a['status'](_0x295ea0)[_0x88f3('0x26')](_0x46ee59);};}exports[_0x88f3('0x27')]=function(_0x23f285,_0x56b8b6){var _0x748ec={},_0x3528a3={},_0x16aa47={'count':0x0,'rows':[]};var _0x355635=_[_0x88f3('0x28')](db['IntegrationReport'][_0x88f3('0x29')],function(_0x51e4ee){return{'name':_0x51e4ee[_0x88f3('0x2a')],'type':_0x51e4ee['type'][_0x88f3('0x2b')]};});_0x3528a3[_0x88f3('0x2c')]=_[_0x88f3('0x28')](_0x355635,'name');_0x3528a3[_0x88f3('0x2d')]=_[_0x88f3('0x2e')](_0x23f285[_0x88f3('0x2d')]);_0x3528a3[_0x88f3('0x2f')]=_[_0x88f3('0x30')](_0x3528a3['model'],_0x3528a3[_0x88f3('0x2d')]);_0x748ec[_0x88f3('0x31')]=_[_0x88f3('0x30')](_0x3528a3[_0x88f3('0x2c')],qs[_0x88f3('0x32')](_0x23f285[_0x88f3('0x2d')][_0x88f3('0x32')]));_0x748ec[_0x88f3('0x31')]=_0x748ec[_0x88f3('0x31')][_0x88f3('0x33')]?_0x748ec[_0x88f3('0x31')]:_0x3528a3[_0x88f3('0x2c')];if(!_0x23f285['query'][_0x88f3('0x34')](_0x88f3('0x35'))){_0x748ec['limit']=qs['limit'](_0x23f285[_0x88f3('0x2d')][_0x88f3('0x1a')]);_0x748ec[_0x88f3('0x18')]=qs[_0x88f3('0x18')](_0x23f285[_0x88f3('0x2d')][_0x88f3('0x18')]);}_0x748ec[_0x88f3('0x36')]=qs[_0x88f3('0x37')](_0x23f285[_0x88f3('0x2d')][_0x88f3('0x37')]);_0x748ec[_0x88f3('0x38')]=qs[_0x88f3('0x2f')](_['pick'](_0x23f285[_0x88f3('0x2d')],_0x3528a3['filters']),_0x355635);if(_0x23f285['query']['filter']){_0x748ec[_0x88f3('0x38')]=_[_0x88f3('0x39')](_0x748ec[_0x88f3('0x38')],{'$or':_[_0x88f3('0x28')](_0x355635,function(_0x3d1e89){if(_0x3d1e89['type']!==_0x88f3('0x3a')){var _0x455ae3={};_0x455ae3[_0x3d1e89['name']]={'$like':'%'+_0x23f285[_0x88f3('0x2d')][_0x88f3('0x3b')]+'%'};return _0x455ae3;}})});}_0x748ec=_[_0x88f3('0x39')]({},_0x748ec,_0x23f285[_0x88f3('0x3c')]);var _0xe30a1a={'where':_0x748ec['where']};return db[_0x88f3('0x3d')][_0x88f3('0x1b')](_0xe30a1a)[_0x88f3('0x21')](function(_0x3f7def){_0x16aa47[_0x88f3('0x1b')]=_0x3f7def;if(_0x23f285[_0x88f3('0x2d')][_0x88f3('0x3e')]){_0x748ec[_0x88f3('0x3f')]=[{'all':!![]}];}return db[_0x88f3('0x3d')]['findAll'](_0x748ec);})[_0x88f3('0x21')](function(_0x210e86){_0x16aa47[_0x88f3('0x40')]=_0x210e86;return _0x16aa47;})[_0x88f3('0x21')](respondWithFilteredResult(_0x56b8b6,_0x748ec))['catch'](handleError(_0x56b8b6,null));};exports[_0x88f3('0x41')]=function(_0x3871aa,_0x164f05){var _0x531bd0={'raw':![],'where':{'id':_0x3871aa[_0x88f3('0x42')]['id']}},_0x2e46e1={};_0x2e46e1[_0x88f3('0x2c')]=_[_0x88f3('0x2e')](db[_0x88f3('0x3d')][_0x88f3('0x29')]);_0x2e46e1[_0x88f3('0x2d')]=_[_0x88f3('0x2e')](_0x3871aa[_0x88f3('0x2d')]);_0x2e46e1[_0x88f3('0x2f')]=_[_0x88f3('0x30')](_0x2e46e1[_0x88f3('0x2c')],_0x2e46e1[_0x88f3('0x2d')]);_0x531bd0['attributes']=_['intersection'](_0x2e46e1['model'],qs['fields'](_0x3871aa[_0x88f3('0x2d')][_0x88f3('0x32')]));_0x531bd0[_0x88f3('0x31')]=_0x531bd0[_0x88f3('0x31')][_0x88f3('0x33')]?_0x531bd0[_0x88f3('0x31')]:_0x2e46e1['model'];if(_0x3871aa[_0x88f3('0x2d')][_0x88f3('0x3e')]){_0x531bd0['include']=[{'all':!![]}];}_0x531bd0=_[_0x88f3('0x39')]({},_0x531bd0,_0x3871aa[_0x88f3('0x3c')]);return db[_0x88f3('0x3d')][_0x88f3('0x43')](_0x531bd0)['then'](handleEntityNotFound(_0x164f05,null))[_0x88f3('0x21')](respondWithResult(_0x164f05,null))[_0x88f3('0x44')](handleError(_0x164f05,null));};exports['create']=function(_0x55c507,_0x1eb0f6){return db[_0x88f3('0x3d')][_0x88f3('0x45')](_0x55c507[_0x88f3('0x46')],{})[_0x88f3('0x21')](respondWithResult(_0x1eb0f6,0xc9))[_0x88f3('0x44')](handleError(_0x1eb0f6,null));};exports['update']=function(_0x434981,_0x34ceaa){if(_0x434981['body']['id']){delete _0x434981['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x434981['params']['id']}})[_0x88f3('0x21')](handleEntityNotFound(_0x34ceaa,null))[_0x88f3('0x21')](saveUpdates(_0x434981[_0x88f3('0x46')],null))['then'](respondWithResult(_0x34ceaa,null))[_0x88f3('0x44')](handleError(_0x34ceaa,null));};exports[_0x88f3('0x22')]=function(_0x39f183,_0x1baf23){return db[_0x88f3('0x3d')][_0x88f3('0x43')]({'where':{'id':_0x39f183[_0x88f3('0x42')]['id']}})['then'](handleEntityNotFound(_0x1baf23,null))[_0x88f3('0x21')](removeEntity(_0x1baf23,null))[_0x88f3('0x44')](handleError(_0x1baf23,null));};exports[_0x88f3('0x47')]=function(_0x2a3957,_0x18d20a){return db[_0x88f3('0x3d')]['describe']()[_0x88f3('0x21')](respondWithResult(_0x18d20a,null))['catch'](handleError(_0x18d20a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 39f99fb..2bddc0a 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 _0x1651=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','lodash'];(function(_0x2d963d,_0x5c92ca){var _0x4b1a50=function(_0x23ee85){while(--_0x23ee85){_0x2d963d['push'](_0x2d963d['shift']());}};_0x4b1a50(++_0x5c92ca);}(_0x1651,0x11d));var _0x1165=function(_0x10425c,_0x14441b){_0x10425c=_0x10425c-0x0;var _0x9d6cc8=_0x1651[_0x10425c];return _0x9d6cc8;};'use strict';var _=require(_0x1165('0x0'));var util=require(_0x1165('0x1'));var logger=require(_0x1165('0x2'))(_0x1165('0x3'));var moment=require('moment');var BPromise=require(_0x1165('0x4'));var rp=require(_0x1165('0x5'));var fs=require('fs');var path=require(_0x1165('0x6'));var rimraf=require('rimraf');var config=require(_0x1165('0x7'));var attributes=require(_0x1165('0x8'));module[_0x1165('0x9')]=function(_0xaf6f9d,_0x5fe811){return _0xaf6f9d['define'](_0x1165('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc28d=['moment','bluebird','request-promise','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc28d,0x1ca));var _0xdc28=function(_0x5aa0a1,_0x58d7d4){_0x5aa0a1=_0x5aa0a1-0x0;var _0x38934b=_0xc28d[_0x5aa0a1];return _0x38934b;};'use strict';var _=require('lodash');var util=require(_0xdc28('0x0'));var logger=require('../../config/logger')(_0xdc28('0x1'));var moment=require(_0xdc28('0x2'));var BPromise=require(_0xdc28('0x3'));var rp=require(_0xdc28('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdc28('0x5'));module[_0xdc28('0x6')]=function(_0x51730f,_0x1181f){return _0x51730f[_0xdc28('0x7')](_0xdc28('0x8'),attributes,{'tableName':_0xdc28('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index dcd894b..2a7c3df 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x2ef3,0xba));var _0x32ef=function(_0x52e99b,_0x468153){_0x52e99b=_0x52e99b-0x0;var _0xbae9df=_0x2ef3[_0x52e99b];return _0xbae9df;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x52ce49,_0x18c8d3){var _0x2ba30c=function(_0x5e5fb1){while(--_0x5e5fb1){_0x52ce49['push'](_0x52ce49['shift']());}};_0x2ba30c(++_0x18c8d3);}(_0x2675,0x75));var _0x5267=function(_0x1a6c24,_0x850253){_0x1a6c24=_0x1a6c24-0x0;var _0x57c210=_0x2675[_0x1a6c24];return _0x57c210;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 30f430e..ca48ddd 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 _0x8bc3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','put','destroy','multer','path','express'];(function(_0x1aa76b,_0x39f69a){var _0x261ee2=function(_0x1382e9){while(--_0x1382e9){_0x1aa76b['push'](_0x1aa76b['shift']());}};_0x261ee2(++_0x39f69a);}(_0x8bc3,0x82));var _0x38bc=function(_0x3fd723,_0x1f48b4){_0x3fd723=_0x3fd723-0x0;var _0x131dc2=_0x8bc3[_0x3fd723];return _0x131dc2;};'use strict';var multer=require(_0x38bc('0x0'));var util=require('util');var path=require(_0x38bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x38bc('0x2'));var router=express[_0x38bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x38bc('0x4'));var interaction=require(_0x38bc('0x5'));var config=require(_0x38bc('0x6'));var controller=require(_0x38bc('0x7'));router['get']('/',auth[_0x38bc('0x8')](),controller[_0x38bc('0x9')]);router[_0x38bc('0xa')](_0x38bc('0xb'),auth[_0x38bc('0x8')](),controller['show']);router['get'](_0x38bc('0xc'),auth[_0x38bc('0x8')](),controller[_0x38bc('0xd')]);router[_0x38bc('0xe')]('/',auth[_0x38bc('0x8')](),controller[_0x38bc('0xf')]);router[_0x38bc('0xe')](_0x38bc('0xc'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x10')]);router['post']('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router[_0x38bc('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x38bc('0xb'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdab6=['show','/:id/sub_intervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2b5cf7,_0x32e2b2){var _0x3ac03f=function(_0x2d0dd9){while(--_0x2d0dd9){_0x2b5cf7['push'](_0x2b5cf7['shift']());}};_0x3ac03f(++_0x32e2b2);}(_0xdab6,0x9a));var _0x6dab=function(_0x2cc96b,_0x309e29){_0x2cc96b=_0x2cc96b-0x0;var _0xd7a4aa=_0xdab6[_0x2cc96b];return _0xd7a4aa;};'use strict';var multer=require(_0x6dab('0x0'));var util=require(_0x6dab('0x1'));var path=require(_0x6dab('0x2'));var timeout=require(_0x6dab('0x3'));var express=require(_0x6dab('0x4'));var router=express[_0x6dab('0x5')]();var fs_extra=require(_0x6dab('0x6'));var auth=require(_0x6dab('0x7'));var interaction=require(_0x6dab('0x8'));var config=require(_0x6dab('0x9'));var controller=require('./interval.controller');router[_0x6dab('0xa')]('/',auth[_0x6dab('0xb')](),controller[_0x6dab('0xc')]);router[_0x6dab('0xa')](_0x6dab('0xd'),auth[_0x6dab('0xb')](),controller[_0x6dab('0xe')]);router[_0x6dab('0xa')](_0x6dab('0xf'),auth[_0x6dab('0xb')](),controller['getIntervals']);router[_0x6dab('0x10')]('/',auth[_0x6dab('0xb')](),controller[_0x6dab('0x11')]);router['post'](_0x6dab('0xf'),auth['isAuthenticated'](),controller['addInterval']);router[_0x6dab('0x10')](_0x6dab('0x12'),auth[_0x6dab('0xb')](),controller[_0x6dab('0x13')]);router[_0x6dab('0x14')]('/:id',auth[_0x6dab('0xb')](),controller[_0x6dab('0x15')]);router['delete'](_0x6dab('0xd'),auth[_0x6dab('0xb')](),controller[_0x6dab('0x16')]);module[_0x6dab('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index c37c4a4..d212856 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 _0x00e7=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e7,0x1ae));var _0x700e=function(_0x5f52a4,_0x5706d9){_0x5f52a4=_0x5f52a4-0x0;var _0xde1bce=_0x00e7[_0x5f52a4];return _0xde1bce;};'use strict';var Sequelize=require(_0x700e('0x0'));module[_0x700e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x700e('0x2')]},'interval':{'type':Sequelize[_0x700e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2997=['STRING','sequelize'];(function(_0x516643,_0x6a2a8c){var _0x4904de=function(_0x5c9784){while(--_0x5c9784){_0x516643['push'](_0x516643['shift']());}};_0x4904de(++_0x6a2a8c);}(_0x2997,0x171));var _0x7299=function(_0x133e05,_0x28eb8d){_0x133e05=_0x133e05-0x0;var _0x30d761=_0x2997[_0x133e05];return _0x30d761;};'use strict';var Sequelize=require(_0x7299('0x0'));module['exports']={'name':{'type':Sequelize[_0x7299('0x1')]},'description':{'type':Sequelize[_0x7299('0x1')]},'interval':{'type':Sequelize[_0x7299('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 40e7f36..f9d4bc9 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 _0x45ba=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','Interval','includeAll','findAll','rows','catch','show','params','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','order','addIntervals','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','error','name','send','rawAttributes','fieldName','type','key','model','query'];(function(_0x56405a,_0x2491cf){var _0x54c664=function(_0x29a081){while(--_0x29a081){_0x56405a['push'](_0x56405a['shift']());}};_0x54c664(++_0x2491cf);}(_0x45ba,0x85));var _0xa45b=function(_0x4fc37e,_0x370283){_0x4fc37e=_0x4fc37e-0x0;var _0x488baf=_0x45ba[_0x4fc37e];return _0x488baf;};'use strict';var emlformat=require(_0xa45b('0x0'));var rimraf=require(_0xa45b('0x1'));var zipdir=require(_0xa45b('0x2'));var jsonpatch=require(_0xa45b('0x3'));var rp=require(_0xa45b('0x4'));var moment=require(_0xa45b('0x5'));var BPromise=require(_0xa45b('0x6'));var Mustache=require(_0xa45b('0x7'));var util=require(_0xa45b('0x8'));var path=require(_0xa45b('0x9'));var sox=require(_0xa45b('0xa'));var csv=require(_0xa45b('0xb'));var ejs=require(_0xa45b('0xc'));var fs=require('fs');var fs_extra=require(_0xa45b('0xd'));var _=require(_0xa45b('0xe'));var squel=require('squel');var crypto=require(_0xa45b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa45b('0x10'));var toCsv=require(_0xa45b('0xb'));var querystring=require('querystring');var Papa=require(_0xa45b('0x11'));var Redis=require('ioredis');var authService=require(_0xa45b('0x12'));var qs=require(_0xa45b('0x13'));var as=require(_0xa45b('0x14'));var hardwareService=require(_0xa45b('0x15'));var logger=require(_0xa45b('0x16'))(_0xa45b('0x17'));var utils=require(_0xa45b('0x18'));var config=require(_0xa45b('0x19'));var licenseUtil=require(_0xa45b('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require(_0xa45b('0x1b'));function respondWithStatusCode(_0x493372,_0x5e1893){_0x5e1893=_0x5e1893||0xcc;return function(_0x12dab3){if(_0x12dab3){return _0x493372[_0xa45b('0x1c')](_0x5e1893);}return _0x493372[_0xa45b('0x1d')](_0x5e1893)[_0xa45b('0x1e')]();};}function respondWithResult(_0x352df0,_0x3c6546){_0x3c6546=_0x3c6546||0xc8;return function(_0x2ce949){if(_0x2ce949){return _0x352df0[_0xa45b('0x1d')](_0x3c6546)[_0xa45b('0x1f')](_0x2ce949);}};}function respondWithFilteredResult(_0x189b81,_0x197d14){return function(_0x2a7528){if(_0x2a7528){var _0x4ea868=typeof _0x197d14[_0xa45b('0x20')]===_0xa45b('0x21')&&typeof _0x197d14[_0xa45b('0x22')]===_0xa45b('0x21');var _0x244265=_0x2a7528[_0xa45b('0x23')];var _0x5b629a=_0x4ea868?0x0:_0x197d14[_0xa45b('0x20')];var _0x46b525=_0x4ea868?_0x2a7528[_0xa45b('0x23')]:_0x197d14[_0xa45b('0x20')]+_0x197d14['limit'];var _0x4ab926;if(_0x46b525>=_0x244265){_0x46b525=_0x244265;_0x4ab926=0xc8;}else{_0x4ab926=0xce;}_0x189b81[_0xa45b('0x1d')](_0x4ab926);return _0x189b81[_0xa45b('0x24')]('Content-Range',_0x5b629a+'-'+_0x46b525+'/'+_0x244265)[_0xa45b('0x1f')](_0x2a7528);}return null;};}function patchUpdates(_0x3a7e47){return function(_0x5bb647){try{jsonpatch[_0xa45b('0x25')](_0x5bb647,_0x3a7e47,!![]);}catch(_0x1f81be){return BPromise[_0xa45b('0x26')](_0x1f81be);}return _0x5bb647[_0xa45b('0x27')]();};}function saveUpdates(_0x49b2a8,_0x4734a7){return function(_0x221d96){if(_0x221d96){return _0x221d96[_0xa45b('0x28')](_0x49b2a8)[_0xa45b('0x29')](function(_0x1a1e71){return _0x1a1e71;});}return null;};}function removeEntity(_0x20b134,_0x4dfd5c){return function(_0x29607a){if(_0x29607a){return _0x29607a['destroy']()['then'](function(){var _0xbf09f5=_0x29607a[_0xa45b('0x2a')]({'plain':!![]});var _0x197577=_0xa45b('0x2b');return db[_0xa45b('0x2c')][_0xa45b('0x2d')]({'where':{'type':_0x197577,'resourceId':_0xbf09f5['id']}})['then'](function(){return _0x29607a;});})['then'](function(){_0x20b134[_0xa45b('0x1d')](0xcc)[_0xa45b('0x1e')]();});}};}function handleEntityNotFound(_0xb93aac,_0x3c48ee){return function(_0x3615de){if(!_0x3615de){_0xb93aac[_0xa45b('0x1c')](0x194);}return _0x3615de;};}function handleError(_0x4e7ac5,_0x1e28ed){_0x1e28ed=_0x1e28ed||0x1f4;return function(_0x37a6a0){logger[_0xa45b('0x2e')](_0x37a6a0['stack']);if(_0x37a6a0[_0xa45b('0x2f')]){delete _0x37a6a0['name'];}_0x4e7ac5[_0xa45b('0x1d')](_0x1e28ed)[_0xa45b('0x30')](_0x37a6a0);};}exports['index']=function(_0x215995,_0x106155){var _0x597b7a={},_0xe92e3a={},_0x3e410b={'count':0x0,'rows':[]};var _0x4210f4=_['map'](db['Interval'][_0xa45b('0x31')],function(_0x5c4ada){return{'name':_0x5c4ada[_0xa45b('0x32')],'type':_0x5c4ada[_0xa45b('0x33')][_0xa45b('0x34')]};});_0xe92e3a[_0xa45b('0x35')]=_['map'](_0x4210f4,_0xa45b('0x2f'));_0xe92e3a[_0xa45b('0x36')]=_[_0xa45b('0x37')](_0x215995[_0xa45b('0x36')]);_0xe92e3a[_0xa45b('0x38')]=_[_0xa45b('0x39')](_0xe92e3a[_0xa45b('0x35')],_0xe92e3a[_0xa45b('0x36')]);_0x597b7a['attributes']=_[_0xa45b('0x39')](_0xe92e3a[_0xa45b('0x35')],qs['fields'](_0x215995[_0xa45b('0x36')][_0xa45b('0x3a')]));_0x597b7a[_0xa45b('0x3b')]=_0x597b7a[_0xa45b('0x3b')][_0xa45b('0x3c')]?_0x597b7a['attributes']:_0xe92e3a['model'];if(!_0x215995[_0xa45b('0x36')][_0xa45b('0x3d')](_0xa45b('0x3e'))){_0x597b7a[_0xa45b('0x22')]=qs[_0xa45b('0x22')](_0x215995[_0xa45b('0x36')][_0xa45b('0x22')]);_0x597b7a[_0xa45b('0x20')]=qs[_0xa45b('0x20')](_0x215995[_0xa45b('0x36')][_0xa45b('0x20')]);}_0x597b7a['order']=qs[_0xa45b('0x3f')](_0x215995[_0xa45b('0x36')][_0xa45b('0x3f')]);_0x597b7a['where']=qs[_0xa45b('0x38')](_[_0xa45b('0x40')](_0x215995[_0xa45b('0x36')],_0xe92e3a[_0xa45b('0x38')]),_0x4210f4);if(_0x215995[_0xa45b('0x36')][_0xa45b('0x41')]){_0x597b7a[_0xa45b('0x42')]=_[_0xa45b('0x43')](_0x597b7a[_0xa45b('0x42')],{'$or':_[_0xa45b('0x44')](_0x4210f4,function(_0x3e2ebe){if(_0x3e2ebe[_0xa45b('0x33')]!==_0xa45b('0x45')){var _0x52fd54={};_0x52fd54[_0x3e2ebe[_0xa45b('0x2f')]]={'$like':'%'+_0x215995['query'][_0xa45b('0x41')]+'%'};return _0x52fd54;}})});}_0x597b7a=_['merge']({},_0x597b7a,_0x215995[_0xa45b('0x46')]);var _0x41f96e={'where':_0x597b7a['where']};return db[_0xa45b('0x47')][_0xa45b('0x23')](_0x41f96e)[_0xa45b('0x29')](function(_0x172ce4){_0x3e410b[_0xa45b('0x23')]=_0x172ce4;if(_0x215995[_0xa45b('0x36')][_0xa45b('0x48')]){_0x597b7a['include']=[{'all':!![]}];}return db[_0xa45b('0x47')][_0xa45b('0x49')](_0x597b7a);})[_0xa45b('0x29')](function(_0x5f0326){_0x3e410b[_0xa45b('0x4a')]=_0x5f0326;return _0x3e410b;})[_0xa45b('0x29')](respondWithFilteredResult(_0x106155,_0x597b7a))[_0xa45b('0x4b')](handleError(_0x106155,null));};exports[_0xa45b('0x4c')]=function(_0x559adf,_0x3e74ee){var _0x4cbb2d={'raw':!![],'where':{'id':_0x559adf[_0xa45b('0x4d')]['id']}},_0x314f5f={};_0x314f5f[_0xa45b('0x35')]=_[_0xa45b('0x37')](db['Interval']['rawAttributes']);_0x314f5f[_0xa45b('0x36')]=_[_0xa45b('0x37')](_0x559adf[_0xa45b('0x36')]);_0x314f5f['filters']=_[_0xa45b('0x39')](_0x314f5f[_0xa45b('0x35')],_0x314f5f[_0xa45b('0x36')]);_0x4cbb2d[_0xa45b('0x3b')]=_[_0xa45b('0x39')](_0x314f5f[_0xa45b('0x35')],qs[_0xa45b('0x3a')](_0x559adf[_0xa45b('0x36')][_0xa45b('0x3a')]));_0x4cbb2d[_0xa45b('0x3b')]=_0x4cbb2d['attributes'][_0xa45b('0x3c')]?_0x4cbb2d[_0xa45b('0x3b')]:_0x314f5f['model'];if(_0x559adf[_0xa45b('0x36')][_0xa45b('0x48')]){_0x4cbb2d[_0xa45b('0x4e')]=[{'all':!![]}];}_0x4cbb2d=_[_0xa45b('0x43')]({},_0x4cbb2d,_0x559adf[_0xa45b('0x46')]);return db['Interval'][_0xa45b('0x4f')](_0x4cbb2d)[_0xa45b('0x29')](handleEntityNotFound(_0x3e74ee,null))['then'](respondWithResult(_0x3e74ee,null))[_0xa45b('0x4b')](handleError(_0x3e74ee,null));};exports['create']=function(_0x297220,_0x24cded){return db['Interval']['create'](_0x297220[_0xa45b('0x50')],{})[_0xa45b('0x29')](function(_0x41f884){var _0x13da5b=_0x297220['user'][_0xa45b('0x2a')]({'plain':!![]});if(!_0x13da5b)throw new Error(_0xa45b('0x51'));if(_0x13da5b['role']===_0xa45b('0x52')){var _0x52f5bf=_0x41f884['get']({'plain':!![]});var _0x56ff9b=_0xa45b('0x2b');return db[_0xa45b('0x53')][_0xa45b('0x4f')]({'where':{'name':_0x56ff9b,'userProfileId':_0x13da5b[_0xa45b('0x54')]},'raw':!![]})[_0xa45b('0x29')](function(_0x40d8d6){if(_0x40d8d6&&_0x40d8d6[_0xa45b('0x55')]===0x0){return db[_0xa45b('0x2c')][_0xa45b('0x56')]({'name':_0x52f5bf[_0xa45b('0x2f')],'resourceId':_0x52f5bf['id'],'type':_0x40d8d6[_0xa45b('0x2f')],'sectionId':_0x40d8d6['id']},{})[_0xa45b('0x29')](function(){return _0x41f884;});}else{return _0x41f884;}})['catch'](function(_0x1711f9){logger[_0xa45b('0x2e')](_0xa45b('0x57'),_0x1711f9);throw _0x1711f9;});}return _0x41f884;})[_0xa45b('0x29')](respondWithResult(_0x24cded,0xc9))[_0xa45b('0x4b')](handleError(_0x24cded,null));};exports[_0xa45b('0x28')]=function(_0x4c7510,_0x4fd748){if(_0x4c7510['body']['id']){delete _0x4c7510[_0xa45b('0x50')]['id'];}return db['Interval'][_0xa45b('0x4f')]({'where':{'id':_0x4c7510[_0xa45b('0x4d')]['id']}})[_0xa45b('0x29')](handleEntityNotFound(_0x4fd748,null))[_0xa45b('0x29')](saveUpdates(_0x4c7510[_0xa45b('0x50')],null))[_0xa45b('0x29')](respondWithResult(_0x4fd748,null))['catch'](handleError(_0x4fd748,null));};exports[_0xa45b('0x2d')]=function(_0x4c3ceb,_0x538e6c){return db[_0xa45b('0x47')][_0xa45b('0x4f')]({'where':{'id':_0x4c3ceb['params']['id']}})[_0xa45b('0x29')](handleEntityNotFound(_0x538e6c,null))[_0xa45b('0x29')](removeEntity(_0x538e6c,null))['catch'](handleError(_0x538e6c,null));};exports[_0xa45b('0x58')]=function(_0x257dca,_0x4894a4,_0x275a57){if(_0x257dca[_0xa45b('0x50')]['id']){delete _0x257dca[_0xa45b('0x50')]['id'];}return db[_0xa45b('0x47')][_0xa45b('0x4f')]({'where':{'id':_0x257dca[_0xa45b('0x4d')]['id']}})[_0xa45b('0x29')](handleEntityNotFound(_0x4894a4,null))[_0xa45b('0x29')](function(_0x32c4ce){if(_0x32c4ce){_0x257dca[_0xa45b('0x50')]['IntervalId']=_0x32c4ce['id'];return db[_0xa45b('0x47')]['create'](_0x257dca['body']);}})[_0xa45b('0x29')](respondWithResult(_0x4894a4,null))[_0xa45b('0x4b')](handleError(_0x4894a4,null));};exports[_0xa45b('0x59')]=function(_0x4b1b02,_0x58ecae,_0x278862){var _0x563dc4={};var _0x52261f={};var _0x4889d6;var _0x2da037;return db[_0xa45b('0x47')][_0xa45b('0x5a')]({'where':{'id':_0x4b1b02[_0xa45b('0x4d')]['id']}})[_0xa45b('0x29')](handleEntityNotFound(_0x58ecae,null))['then'](function(_0x4f4735){if(_0x4f4735){_0x4889d6=_0x4f4735;_0x52261f[_0xa45b('0x35')]=_['keys'](db[_0xa45b('0x47')]['rawAttributes']);_0x52261f['query']=_['keys'](_0x4b1b02[_0xa45b('0x36')]);_0x52261f[_0xa45b('0x38')]=_[_0xa45b('0x39')](_0x52261f[_0xa45b('0x35')],_0x52261f[_0xa45b('0x36')]);_0x563dc4['attributes']=_['intersection'](_0x52261f[_0xa45b('0x35')],qs[_0xa45b('0x3a')](_0x4b1b02['query'][_0xa45b('0x3a')]));_0x563dc4[_0xa45b('0x3b')]=_0x563dc4[_0xa45b('0x3b')][_0xa45b('0x3c')]?_0x563dc4[_0xa45b('0x3b')]:_0x52261f['model'];_0x563dc4[_0xa45b('0x5b')]=qs['sort'](_0x4b1b02[_0xa45b('0x36')]['sort']);_0x563dc4[_0xa45b('0x42')]=qs[_0xa45b('0x38')](_[_0xa45b('0x40')](_0x4b1b02[_0xa45b('0x36')],_0x52261f[_0xa45b('0x38')]));if(_0x4b1b02[_0xa45b('0x36')][_0xa45b('0x41')]){_0x563dc4[_0xa45b('0x42')]=_[_0xa45b('0x43')](_0x563dc4[_0xa45b('0x42')],{'$or':_[_0xa45b('0x44')](_0x563dc4['attributes'],function(_0x394a98){var _0x421bab={};_0x421bab[_0x394a98]={'$like':'%'+_0x4b1b02['query'][_0xa45b('0x41')]+'%'};return _0x421bab;})});}_0x563dc4=_[_0xa45b('0x43')]({},_0x563dc4,_0x4b1b02['options']);return _0x4889d6[_0xa45b('0x59')](_0x563dc4);}})[_0xa45b('0x29')](function(_0x3f2f0e){if(_0x3f2f0e){_0x2da037=_0x3f2f0e[_0xa45b('0x3c')];if(!_0x4b1b02[_0xa45b('0x36')]['hasOwnProperty'](_0xa45b('0x3e'))){_0x563dc4[_0xa45b('0x22')]=qs[_0xa45b('0x22')](_0x4b1b02['query']['limit']);_0x563dc4[_0xa45b('0x20')]=qs[_0xa45b('0x20')](_0x4b1b02[_0xa45b('0x36')]['offset']);}return _0x4889d6[_0xa45b('0x59')](_0x563dc4);}})[_0xa45b('0x29')](function(_0x4f97e2){if(_0x4f97e2){return _0x4f97e2?{'count':_0x2da037,'rows':_0x4f97e2}:null;}})[_0xa45b('0x29')](respondWithResult(_0x58ecae,null))[_0xa45b('0x4b')](handleError(_0x58ecae,null));};exports[_0xa45b('0x5c')]=function(_0x36abc6,_0x1526b6,_0x53d92b){return db[_0xa45b('0x47')][_0xa45b('0x5a')]({'where':{'id':_0x36abc6[_0xa45b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1526b6,null))['then'](function(_0x57c66e){if(_0x57c66e){return db['sequelize']['transaction'](function(_0x37113d){return db[_0xa45b('0x47')][_0xa45b('0x2d')]({'where':{'IntervalId':_0x36abc6['params']['id']},'transaction':_0x37113d})['then'](function(_0x3f3960){var _0x5e8bd5=_['map'](_0x36abc6[_0xa45b('0x50')],function(_0x2b729b){delete _0x2b729b['id'];_0x2b729b['IntervalId']=_0x36abc6['params']['id'];return _0x2b729b;});return db[_0xa45b('0x47')][_0xa45b('0x5d')](_0x5e8bd5,{'transaction':_0x37113d});});})[_0xa45b('0x29')](function(){return db[_0xa45b('0x47')]['findAll']({'where':{'IntervalId':_0x36abc6['params']['id']}});});}})[_0xa45b('0x29')](respondWithResult(_0x1526b6,null))[_0xa45b('0x4b')](handleError(_0x1526b6,null));}; \ No newline at end of file +var _0xb5e6=['role','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','sequelize','transaction','IntervalId','bulkCreate','findAll','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Intervals','destroy','error','stack','name','send','Interval','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3ca8d4,_0x3c1d5a){var _0xf702c1=function(_0x11a277){while(--_0x11a277){_0x3ca8d4['push'](_0x3ca8d4['shift']());}};_0xf702c1(++_0x3c1d5a);}(_0xb5e6,0x116));var _0x6b5e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb5e6[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6b5e('0x0'));var rp=require(_0x6b5e('0x1'));var moment=require(_0x6b5e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b5e('0x3'));var path=require(_0x6b5e('0x4'));var sox=require(_0x6b5e('0x5'));var csv=require(_0x6b5e('0x6'));var ejs=require(_0x6b5e('0x7'));var fs=require('fs');var fs_extra=require(_0x6b5e('0x8'));var _=require(_0x6b5e('0x9'));var squel=require(_0x6b5e('0xa'));var crypto=require(_0x6b5e('0xb'));var jsforce=require(_0x6b5e('0xc'));var deskjs=require(_0x6b5e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6b5e('0xe'));var Redis=require(_0x6b5e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b5e('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x6b5e('0x11'));var licenseUtil=require(_0x6b5e('0x12'));var db=require(_0x6b5e('0x13'))['db'];var extensions=require(_0x6b5e('0x14'));function respondWithStatusCode(_0x5a169b,_0x52cffa){_0x52cffa=_0x52cffa||0xcc;return function(_0x9cb7f5){if(_0x9cb7f5){return _0x5a169b['sendStatus'](_0x52cffa);}return _0x5a169b[_0x6b5e('0x15')](_0x52cffa)[_0x6b5e('0x16')]();};}function respondWithResult(_0x2f302f,_0x96a8d4){_0x96a8d4=_0x96a8d4||0xc8;return function(_0x20acaf){if(_0x20acaf){return _0x2f302f[_0x6b5e('0x15')](_0x96a8d4)[_0x6b5e('0x17')](_0x20acaf);}};}function respondWithFilteredResult(_0x39a67d,_0x36aa3f){return function(_0x54eddf){if(_0x54eddf){var _0x252044=typeof _0x36aa3f[_0x6b5e('0x18')]===_0x6b5e('0x19')&&typeof _0x36aa3f[_0x6b5e('0x1a')]===_0x6b5e('0x19');var _0x3ab229=_0x54eddf[_0x6b5e('0x1b')];var _0x40fcbb=_0x252044?0x0:_0x36aa3f[_0x6b5e('0x18')];var _0x40bbee=_0x252044?_0x54eddf[_0x6b5e('0x1b')]:_0x36aa3f[_0x6b5e('0x18')]+_0x36aa3f['limit'];var _0x5a0c4c;if(_0x40bbee>=_0x3ab229){_0x40bbee=_0x3ab229;_0x5a0c4c=0xc8;}else{_0x5a0c4c=0xce;}_0x39a67d[_0x6b5e('0x15')](_0x5a0c4c);return _0x39a67d[_0x6b5e('0x1c')](_0x6b5e('0x1d'),_0x40fcbb+'-'+_0x40bbee+'/'+_0x3ab229)[_0x6b5e('0x17')](_0x54eddf);}return null;};}function patchUpdates(_0x26683b){return function(_0x119ee8){try{jsonpatch[_0x6b5e('0x1e')](_0x119ee8,_0x26683b,!![]);}catch(_0x1bf28c){return BPromise[_0x6b5e('0x1f')](_0x1bf28c);}return _0x119ee8[_0x6b5e('0x20')]();};}function saveUpdates(_0x16a5db,_0x278873){return function(_0x350fb6){if(_0x350fb6){return _0x350fb6[_0x6b5e('0x21')](_0x16a5db)[_0x6b5e('0x22')](function(_0x36526d){return _0x36526d;});}return null;};}function removeEntity(_0x4deb8c,_0x4ed1d7){return function(_0x28307d){if(_0x28307d){return _0x28307d['destroy']()[_0x6b5e('0x22')](function(){var _0x34379c=_0x28307d[_0x6b5e('0x23')]({'plain':!![]});var _0x1c7cdc=_0x6b5e('0x24');return db['UserProfileResource'][_0x6b5e('0x25')]({'where':{'type':_0x1c7cdc,'resourceId':_0x34379c['id']}})[_0x6b5e('0x22')](function(){return _0x28307d;});})[_0x6b5e('0x22')](function(){_0x4deb8c['status'](0xcc)[_0x6b5e('0x16')]();});}};}function handleEntityNotFound(_0xa8a130,_0x1e64d7){return function(_0x20b430){if(!_0x20b430){_0xa8a130['sendStatus'](0x194);}return _0x20b430;};}function handleError(_0x4d7465,_0x3a1f28){_0x3a1f28=_0x3a1f28||0x1f4;return function(_0xff20f9){logger[_0x6b5e('0x26')](_0xff20f9[_0x6b5e('0x27')]);if(_0xff20f9[_0x6b5e('0x28')]){delete _0xff20f9[_0x6b5e('0x28')];}_0x4d7465[_0x6b5e('0x15')](_0x3a1f28)[_0x6b5e('0x29')](_0xff20f9);};}exports['index']=function(_0x17b8b3,_0x4554ce){var _0x102a31={},_0x2855a8={},_0x51d5c4={'count':0x0,'rows':[]};var _0x55a408=_['map'](db[_0x6b5e('0x2a')]['rawAttributes'],function(_0xf25ca6){return{'name':_0xf25ca6['fieldName'],'type':_0xf25ca6[_0x6b5e('0x2b')][_0x6b5e('0x2c')]};});_0x2855a8[_0x6b5e('0x2d')]=_[_0x6b5e('0x2e')](_0x55a408,'name');_0x2855a8['query']=_[_0x6b5e('0x2f')](_0x17b8b3['query']);_0x2855a8[_0x6b5e('0x30')]=_[_0x6b5e('0x31')](_0x2855a8['model'],_0x2855a8[_0x6b5e('0x32')]);_0x102a31[_0x6b5e('0x33')]=_[_0x6b5e('0x31')](_0x2855a8[_0x6b5e('0x2d')],qs[_0x6b5e('0x34')](_0x17b8b3[_0x6b5e('0x32')][_0x6b5e('0x34')]));_0x102a31[_0x6b5e('0x33')]=_0x102a31[_0x6b5e('0x33')][_0x6b5e('0x35')]?_0x102a31['attributes']:_0x2855a8[_0x6b5e('0x2d')];if(!_0x17b8b3['query'][_0x6b5e('0x36')](_0x6b5e('0x37'))){_0x102a31[_0x6b5e('0x1a')]=qs[_0x6b5e('0x1a')](_0x17b8b3['query'][_0x6b5e('0x1a')]);_0x102a31['offset']=qs['offset'](_0x17b8b3[_0x6b5e('0x32')]['offset']);}_0x102a31[_0x6b5e('0x38')]=qs[_0x6b5e('0x39')](_0x17b8b3['query'][_0x6b5e('0x39')]);_0x102a31[_0x6b5e('0x3a')]=qs[_0x6b5e('0x30')](_[_0x6b5e('0x3b')](_0x17b8b3[_0x6b5e('0x32')],_0x2855a8[_0x6b5e('0x30')]),_0x55a408);if(_0x17b8b3[_0x6b5e('0x32')][_0x6b5e('0x3c')]){_0x102a31[_0x6b5e('0x3a')]=_[_0x6b5e('0x3d')](_0x102a31[_0x6b5e('0x3a')],{'$or':_['map'](_0x55a408,function(_0x10312e){if(_0x10312e[_0x6b5e('0x2b')]!==_0x6b5e('0x3e')){var _0x5e8528={};_0x5e8528[_0x10312e[_0x6b5e('0x28')]]={'$like':'%'+_0x17b8b3[_0x6b5e('0x32')][_0x6b5e('0x3c')]+'%'};return _0x5e8528;}})});}_0x102a31=_[_0x6b5e('0x3d')]({},_0x102a31,_0x17b8b3[_0x6b5e('0x3f')]);var _0x53c01d={'where':_0x102a31[_0x6b5e('0x3a')]};return db[_0x6b5e('0x2a')][_0x6b5e('0x1b')](_0x53c01d)[_0x6b5e('0x22')](function(_0x328fc8){_0x51d5c4[_0x6b5e('0x1b')]=_0x328fc8;if(_0x17b8b3[_0x6b5e('0x32')][_0x6b5e('0x40')]){_0x102a31['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x102a31);})['then'](function(_0xa21ab4){_0x51d5c4[_0x6b5e('0x41')]=_0xa21ab4;return _0x51d5c4;})[_0x6b5e('0x22')](respondWithFilteredResult(_0x4554ce,_0x102a31))[_0x6b5e('0x42')](handleError(_0x4554ce,null));};exports[_0x6b5e('0x43')]=function(_0x4a7b03,_0x4edc47){var _0x4a7195={'raw':!![],'where':{'id':_0x4a7b03[_0x6b5e('0x44')]['id']}},_0x1189af={};_0x1189af[_0x6b5e('0x2d')]=_[_0x6b5e('0x2f')](db[_0x6b5e('0x2a')][_0x6b5e('0x45')]);_0x1189af[_0x6b5e('0x32')]=_[_0x6b5e('0x2f')](_0x4a7b03['query']);_0x1189af['filters']=_[_0x6b5e('0x31')](_0x1189af[_0x6b5e('0x2d')],_0x1189af['query']);_0x4a7195['attributes']=_[_0x6b5e('0x31')](_0x1189af['model'],qs[_0x6b5e('0x34')](_0x4a7b03[_0x6b5e('0x32')][_0x6b5e('0x34')]));_0x4a7195[_0x6b5e('0x33')]=_0x4a7195[_0x6b5e('0x33')]['length']?_0x4a7195[_0x6b5e('0x33')]:_0x1189af[_0x6b5e('0x2d')];if(_0x4a7b03[_0x6b5e('0x32')][_0x6b5e('0x40')]){_0x4a7195[_0x6b5e('0x46')]=[{'all':!![]}];}_0x4a7195=_['merge']({},_0x4a7195,_0x4a7b03['options']);return db[_0x6b5e('0x2a')]['find'](_0x4a7195)[_0x6b5e('0x22')](handleEntityNotFound(_0x4edc47,null))['then'](respondWithResult(_0x4edc47,null))['catch'](handleError(_0x4edc47,null));};exports[_0x6b5e('0x47')]=function(_0x2a0ce5,_0x3b24f8){return db[_0x6b5e('0x2a')][_0x6b5e('0x47')](_0x2a0ce5[_0x6b5e('0x48')],{})[_0x6b5e('0x22')](function(_0x33398e){var _0x31c885=_0x2a0ce5['user'][_0x6b5e('0x23')]({'plain':!![]});if(!_0x31c885)throw new Error(_0x6b5e('0x49'));if(_0x31c885[_0x6b5e('0x4a')]===_0x6b5e('0x4b')){var _0x511cc9=_0x33398e[_0x6b5e('0x23')]({'plain':!![]});var _0x3687d6=_0x6b5e('0x24');return db[_0x6b5e('0x4c')][_0x6b5e('0x4d')]({'where':{'name':_0x3687d6,'userProfileId':_0x31c885[_0x6b5e('0x4e')]},'raw':!![]})[_0x6b5e('0x22')](function(_0x508ab6){if(_0x508ab6&&_0x508ab6['autoAssociation']===0x0){return db[_0x6b5e('0x4f')][_0x6b5e('0x47')]({'name':_0x511cc9['name'],'resourceId':_0x511cc9['id'],'type':_0x508ab6[_0x6b5e('0x28')],'sectionId':_0x508ab6['id']},{})[_0x6b5e('0x22')](function(){return _0x33398e;});}else{return _0x33398e;}})['catch'](function(_0x4fe5d9){logger[_0x6b5e('0x26')](_0x6b5e('0x50'),_0x4fe5d9);throw _0x4fe5d9;});}return _0x33398e;})['then'](respondWithResult(_0x3b24f8,0xc9))['catch'](handleError(_0x3b24f8,null));};exports[_0x6b5e('0x21')]=function(_0x253488,_0x113e35){if(_0x253488[_0x6b5e('0x48')]['id']){delete _0x253488[_0x6b5e('0x48')]['id'];}return db[_0x6b5e('0x2a')][_0x6b5e('0x4d')]({'where':{'id':_0x253488['params']['id']}})[_0x6b5e('0x22')](handleEntityNotFound(_0x113e35,null))['then'](saveUpdates(_0x253488[_0x6b5e('0x48')],null))['then'](respondWithResult(_0x113e35,null))[_0x6b5e('0x42')](handleError(_0x113e35,null));};exports[_0x6b5e('0x25')]=function(_0x51cbaf,_0x4414f2){return db[_0x6b5e('0x2a')][_0x6b5e('0x4d')]({'where':{'id':_0x51cbaf[_0x6b5e('0x44')]['id']}})[_0x6b5e('0x22')](handleEntityNotFound(_0x4414f2,null))[_0x6b5e('0x22')](removeEntity(_0x4414f2,null))[_0x6b5e('0x42')](handleError(_0x4414f2,null));};exports[_0x6b5e('0x51')]=function(_0xf8c19a,_0x3a70e3,_0x171404){if(_0xf8c19a['body']['id']){delete _0xf8c19a['body']['id'];}return db[_0x6b5e('0x2a')][_0x6b5e('0x4d')]({'where':{'id':_0xf8c19a[_0x6b5e('0x44')]['id']}})[_0x6b5e('0x22')](handleEntityNotFound(_0x3a70e3,null))[_0x6b5e('0x22')](function(_0x42f0c2){if(_0x42f0c2){_0xf8c19a[_0x6b5e('0x48')]['IntervalId']=_0x42f0c2['id'];return db[_0x6b5e('0x2a')][_0x6b5e('0x47')](_0xf8c19a[_0x6b5e('0x48')]);}})[_0x6b5e('0x22')](respondWithResult(_0x3a70e3,null))[_0x6b5e('0x42')](handleError(_0x3a70e3,null));};exports[_0x6b5e('0x52')]=function(_0x4e087b,_0x430427,_0xae6168){var _0x3e8877={};var _0x4020b9={};var _0x7558b9;var _0x82e6f6;return db[_0x6b5e('0x2a')]['findOne']({'where':{'id':_0x4e087b[_0x6b5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x430427,null))['then'](function(_0x5f3bf6){if(_0x5f3bf6){_0x7558b9=_0x5f3bf6;_0x4020b9['model']=_[_0x6b5e('0x2f')](db['Interval'][_0x6b5e('0x45')]);_0x4020b9[_0x6b5e('0x32')]=_[_0x6b5e('0x2f')](_0x4e087b[_0x6b5e('0x32')]);_0x4020b9[_0x6b5e('0x30')]=_[_0x6b5e('0x31')](_0x4020b9['model'],_0x4020b9[_0x6b5e('0x32')]);_0x3e8877['attributes']=_[_0x6b5e('0x31')](_0x4020b9[_0x6b5e('0x2d')],qs[_0x6b5e('0x34')](_0x4e087b[_0x6b5e('0x32')][_0x6b5e('0x34')]));_0x3e8877[_0x6b5e('0x33')]=_0x3e8877[_0x6b5e('0x33')][_0x6b5e('0x35')]?_0x3e8877['attributes']:_0x4020b9[_0x6b5e('0x2d')];_0x3e8877['order']=qs[_0x6b5e('0x39')](_0x4e087b[_0x6b5e('0x32')]['sort']);_0x3e8877[_0x6b5e('0x3a')]=qs[_0x6b5e('0x30')](_['pick'](_0x4e087b[_0x6b5e('0x32')],_0x4020b9[_0x6b5e('0x30')]));if(_0x4e087b[_0x6b5e('0x32')][_0x6b5e('0x3c')]){_0x3e8877[_0x6b5e('0x3a')]=_[_0x6b5e('0x3d')](_0x3e8877[_0x6b5e('0x3a')],{'$or':_[_0x6b5e('0x2e')](_0x3e8877[_0x6b5e('0x33')],function(_0x19b5d6){var _0xc74a8e={};_0xc74a8e[_0x19b5d6]={'$like':'%'+_0x4e087b['query'][_0x6b5e('0x3c')]+'%'};return _0xc74a8e;})});}_0x3e8877=_['merge']({},_0x3e8877,_0x4e087b['options']);return _0x7558b9['getIntervals'](_0x3e8877);}})[_0x6b5e('0x22')](function(_0x59b309){if(_0x59b309){_0x82e6f6=_0x59b309['length'];if(!_0x4e087b[_0x6b5e('0x32')][_0x6b5e('0x36')](_0x6b5e('0x37'))){_0x3e8877[_0x6b5e('0x1a')]=qs[_0x6b5e('0x1a')](_0x4e087b[_0x6b5e('0x32')][_0x6b5e('0x1a')]);_0x3e8877[_0x6b5e('0x18')]=qs[_0x6b5e('0x18')](_0x4e087b['query'][_0x6b5e('0x18')]);}return _0x7558b9['getIntervals'](_0x3e8877);}})[_0x6b5e('0x22')](function(_0x35d267){if(_0x35d267){return _0x35d267?{'count':_0x82e6f6,'rows':_0x35d267}:null;}})[_0x6b5e('0x22')](respondWithResult(_0x430427,null))['catch'](handleError(_0x430427,null));};exports['addIntervals']=function(_0x22ed76,_0x5af225,_0x55f2f5){return db[_0x6b5e('0x2a')]['findOne']({'where':{'id':_0x22ed76['params']['id']}})[_0x6b5e('0x22')](handleEntityNotFound(_0x5af225,null))[_0x6b5e('0x22')](function(_0x5895b1){if(_0x5895b1){return db[_0x6b5e('0x53')][_0x6b5e('0x54')](function(_0x1f3f5d){return db[_0x6b5e('0x2a')][_0x6b5e('0x25')]({'where':{'IntervalId':_0x22ed76[_0x6b5e('0x44')]['id']},'transaction':_0x1f3f5d})[_0x6b5e('0x22')](function(_0x4df879){var _0x5b2a23=_[_0x6b5e('0x2e')](_0x22ed76[_0x6b5e('0x48')],function(_0x5d5b53){delete _0x5d5b53['id'];_0x5d5b53[_0x6b5e('0x55')]=_0x22ed76[_0x6b5e('0x44')]['id'];return _0x5d5b53;});return db['Interval'][_0x6b5e('0x56')](_0x5b2a23,{'transaction':_0x1f3f5d});});})['then'](function(){return db['Interval'][_0x6b5e('0x57')]({'where':{'IntervalId':_0x22ed76[_0x6b5e('0x44')]['id']}});});}})[_0x6b5e('0x22')](respondWithResult(_0x5af225,null))[_0x6b5e('0x42')](handleError(_0x5af225,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 5afe5ae..eea5329 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 _0x0d27=['all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','iftime','exports','Interval','rewrite','interval','getIntervals','then'];(function(_0x58ed0f,_0x49d7aa){var _0x2da8be=function(_0x4d839c){while(--_0x4d839c){_0x58ed0f['push'](_0x58ed0f['shift']());}};_0x2da8be(++_0x49d7aa);}(_0x0d27,0xee));var _0x70d2=function(_0x49bc47,_0x4b08f0){_0x49bc47=_0x49bc47-0x0;var _0x5d29f1=_0x0d27[_0x49bc47];return _0x5d29f1;};'use strict';var attributes=require(_0x70d2('0x0'));var extensions=require(_0x70d2('0x1'));var iftime=require('../../utils/iftime')[_0x70d2('0x2')];module[_0x70d2('0x3')]=function(_0x3c4e6b){return _0x3c4e6b['define'](_0x70d2('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x520bf9){extensions[_0x70d2('0x5')](_0x3c4e6b,_0x520bf9);},'afterBulkCreate':function(_0x1c2c98,_0x4f314e,_0x363ed5){_0x363ed5();extensions[_0x70d2('0x5')](_0x3c4e6b,_0x1c2c98[0x0]);},'afterUpdate':function(_0x3fb763){extensions[_0x70d2('0x5')](_0x3c4e6b,_0x3fb763);},'afterDestroy':function(_0x6f1e86){extensions['rewrite'](_0x3c4e6b,_0x6f1e86);}},'instanceMethods':{'ifTime':function(_0x15a01a=undefined,_0x540a8a=new Date()){if(typeof this[_0x70d2('0x6')]==='string'){return iftime(this[_0x70d2('0x6')],_0x15a01a,_0x540a8a);}else{return this[_0x70d2('0x7')]()[_0x70d2('0x8')](function(_0x58da55){return Promise[_0x70d2('0x9')](_0x58da55[_0x70d2('0xa')](function(_0x34af50){return _0x34af50[_0x70d2('0xb')](_0x15a01a,_0x540a8a);}));})['then'](function(_0x5a7f06){return _0x5a7f06[_0x70d2('0xc')](function(_0x5e94e5,_0x1f1832){return _0x5e94e5||_0x1f1832;},![]);});}}}});}; \ No newline at end of file +var _0x496a=['all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','string','then'];(function(_0xdf2ac,_0x3746d2){var _0x18b658=function(_0x40f3a9){while(--_0x40f3a9){_0xdf2ac['push'](_0xdf2ac['shift']());}};_0x18b658(++_0x3746d2);}(_0x496a,0xf1));var _0xa496=function(_0x1f5a26,_0x488e5e){_0x1f5a26=_0x1f5a26-0x0;var _0x2002c9=_0x496a[_0x1f5a26];return _0x2002c9;};'use strict';var attributes=require(_0xa496('0x0'));var extensions=require(_0xa496('0x1'));var iftime=require(_0xa496('0x2'))[_0xa496('0x3')];module[_0xa496('0x4')]=function(_0x24b552){return _0x24b552[_0xa496('0x5')](_0xa496('0x6'),attributes,{'tableName':_0xa496('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x247e34){extensions[_0xa496('0x8')](_0x24b552,_0x247e34);},'afterBulkCreate':function(_0x2e4b4f,_0x687d28,_0x53d008){_0x53d008();extensions['rewrite'](_0x24b552,_0x2e4b4f[0x0]);},'afterUpdate':function(_0x3abb6e){extensions[_0xa496('0x8')](_0x24b552,_0x3abb6e);},'afterDestroy':function(_0x4a799a){extensions[_0xa496('0x8')](_0x24b552,_0x4a799a);}},'instanceMethods':{'ifTime':function(_0x5ae662=undefined,_0x4e0b61=new Date()){if(typeof this['interval']===_0xa496('0x9')){return iftime(this['interval'],_0x5ae662,_0x4e0b61);}else{return this['getIntervals']()[_0xa496('0xa')](function(_0x158cbe){return Promise[_0xa496('0xb')](_0x158cbe['map'](function(_0x4ab4cd){return _0x4ab4cd[_0xa496('0xc')](_0x5ae662,_0x4e0b61);}));})[_0xa496('0xa')](function(_0x24ba24){return _0x24ba24[_0xa496('0xd')](function(_0x50adb3,_0x49359b){return _0x50adb3||_0x49359b;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 38b3efe..880731f 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 _0xf5c6=['../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','limit','include','map','model','attributes','then','error','message','ShowInterval','find','where','stringify','catch','all','ifTime','reduce','info','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','lodash','util'];(function(_0x2a702f,_0x377aa7){var _0x52106f=function(_0x45726f){while(--_0x45726f){_0x2a702f['push'](_0x2a702f['shift']());}};_0x52106f(++_0x377aa7);}(_0xf5c6,0x85));var _0x6f5c=function(_0x178012,_0x440431){_0x178012=_0x178012-0x0;var _0x4e5213=_0xf5c6[_0x178012];return _0x4e5213;};'use strict';var _=require(_0x6f5c('0x0'));var util=require(_0x6f5c('0x1'));var db=require(_0x6f5c('0x2'))['db'];var iftime=require(_0x6f5c('0x3'))[_0x6f5c('0x4')];var logger=require(_0x6f5c('0x5'))(_0x6f5c('0x6'));exports[_0x6f5c('0x7')]=function(_0x5d5312){var _0x39dfc=this;return new Promise(function(_0x43f349,_0x4dc75f){return db[_0x6f5c('0x8')][_0x6f5c('0x9')]({'raw':_0x5d5312[_0x6f5c('0xa')]?_0x5d5312['options'][_0x6f5c('0xb')]===undefined?!![]:![]:!![],'where':_0x5d5312[_0x6f5c('0xa')]?_0x5d5312[_0x6f5c('0xa')]['where']||null:null,'attributes':_0x5d5312[_0x6f5c('0xa')]?_0x5d5312['options']['attributes']||null:null,'limit':_0x5d5312[_0x6f5c('0xa')]?_0x5d5312[_0x6f5c('0xa')][_0x6f5c('0xc')]||null:null,'include':_0x5d5312[_0x6f5c('0xa')]?_0x5d5312[_0x6f5c('0xa')][_0x6f5c('0xd')]?_[_0x6f5c('0xe')](_0x5d5312[_0x6f5c('0xa')][_0x6f5c('0xd')],function(_0x2d2004){return{'model':db[_0x2d2004[_0x6f5c('0xf')]],'as':_0x2d2004['as'],'attributes':_0x2d2004[_0x6f5c('0x10')],'include':_0x2d2004[_0x6f5c('0xd')]?_['map'](_0x2d2004[_0x6f5c('0xd')],function(_0x4d48fb){return{'model':db[_0x4d48fb[_0x6f5c('0xf')]],'as':_0x4d48fb['as'],'attributes':_0x4d48fb['attributes'],'include':_0x4d48fb[_0x6f5c('0xd')]?_[_0x6f5c('0xe')](_0x4d48fb['include'],function(_0x33f74e){return{'model':db[_0x33f74e['model']],'as':_0x33f74e['as'],'attributes':_0x33f74e['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f5c('0x11')](function(_0xa94763){logger['info'](_0x6f5c('0x7'),_0x5d5312);logger['debug'](_0x6f5c('0x7'),_0x5d5312,JSON['stringify'](_0xa94763));_0x43f349(_0xa94763);})['catch'](function(_0x2e808b){logger[_0x6f5c('0x12')]('GetInterval',_0x2e808b[_0x6f5c('0x13')],_0x5d5312);_0x4dc75f(_0x39dfc[_0x6f5c('0x12')](0x1f4,_0x2e808b[_0x6f5c('0x13')]));});});};exports[_0x6f5c('0x14')]=function(_0x336447){var _0x2b6d62=this;return new Promise(function(_0x1b4347,_0x1d72c2){return db['Interval'][_0x6f5c('0x15')]({'raw':_0x336447['options']?_0x336447['options'][_0x6f5c('0xb')]===undefined?!![]:![]:!![],'where':_0x336447['options']?_0x336447[_0x6f5c('0xa')][_0x6f5c('0x16')]||null:null,'attributes':_0x336447[_0x6f5c('0xa')]?_0x336447[_0x6f5c('0xa')][_0x6f5c('0x10')]||null:null,'include':_0x336447[_0x6f5c('0xa')]?_0x336447[_0x6f5c('0xa')][_0x6f5c('0xd')]?_['map'](_0x336447[_0x6f5c('0xa')][_0x6f5c('0xd')],function(_0x3a455f){return{'model':db[_0x3a455f[_0x6f5c('0xf')]],'as':_0x3a455f['as'],'attributes':_0x3a455f[_0x6f5c('0x10')],'include':_0x3a455f[_0x6f5c('0xd')]?_[_0x6f5c('0xe')](_0x3a455f[_0x6f5c('0xd')],function(_0x11860f){return{'model':db[_0x11860f[_0x6f5c('0xf')]],'as':_0x11860f['as'],'attributes':_0x11860f[_0x6f5c('0x10')],'include':_0x11860f[_0x6f5c('0xd')]?_['map'](_0x11860f[_0x6f5c('0xd')],function(_0x482371){return{'model':db[_0x482371[_0x6f5c('0xf')]],'as':_0x482371['as'],'attributes':_0x482371[_0x6f5c('0x10')]};}):[]};}):[]};}):[]:[]})[_0x6f5c('0x11')](function(_0x2d388a){logger['info'](_0x6f5c('0x14'),_0x336447);logger['debug'](_0x6f5c('0x14'),_0x336447,JSON[_0x6f5c('0x17')](_0x2d388a));_0x1b4347(_0x2d388a);})[_0x6f5c('0x18')](function(_0x211847){logger[_0x6f5c('0x12')](_0x6f5c('0x14'),_0x211847[_0x6f5c('0x13')],_0x336447);_0x1d72c2(_0x2b6d62[_0x6f5c('0x12')](0x1f4,_0x211847[_0x6f5c('0x13')]));});});};function checkArrayOfIntervals(_0x823e6b,_0x596a78){var _0x1f67db=[];return db[_0x6f5c('0x8')][_0x6f5c('0x9')]({'where':{'id':_0x823e6b}})[_0x6f5c('0x11')](function(_0x3cb9a0){_0x1f67db=_0x3cb9a0;return Promise[_0x6f5c('0x19')](_0x1f67db[_0x6f5c('0xe')](function(_0x5f254d){return _0x5f254d[_0x6f5c('0x1a')](_0x596a78);}));})[_0x6f5c('0x11')](function(_0x1b9bf6){var _0x4c74d3=_0x1b9bf6[_0x6f5c('0x1b')](function(_0x52865e,_0x84b7cd){return _0x52865e||_0x84b7cd;},![]);logger[_0x6f5c('0x1c')](util[_0x6f5c('0x1d')](_0x6f5c('0x1e'),_0x1f67db[_0x6f5c('0xe')](function(_0xde6b91){return _0xde6b91[_0x6f5c('0x1f')];})[_0x6f5c('0x20')](',\x20'),_0x1f67db[_0x6f5c('0xe')](function(_0x47ed3a){return _0x47ed3a['id'];})[_0x6f5c('0x20')](',\x20')));return _0x4c74d3;});}function checkSingleInterval(_0x4fbba7,_0x1a3323){return db[_0x6f5c('0x8')][_0x6f5c('0x21')](_0x4fbba7)[_0x6f5c('0x11')](function(_0x5d7240){if(_0x5d7240){logger['info'](util[_0x6f5c('0x1d')](_0x6f5c('0x22'),_0x5d7240[_0x6f5c('0x1f')],_0x5d7240['id']));return _0x5d7240[_0x6f5c('0x1a')](_0x1a3323);}});}exports[_0x6f5c('0x23')]=function(_0x31c350){var _0x4ba8b4=_0x31c350[_0x6f5c('0x24')];var _0x226bf3=Array[_0x6f5c('0x25')](_0x31c350[_0x6f5c('0x26')])?_0x31c350['intervals']:typeof _0x31c350[_0x6f5c('0x26')]===_0x6f5c('0x27')?[_0x31c350['intervals']]:[];var _0x261065=_0x31c350[_0x6f5c('0x28')]||undefined;var _0x6f4664=![];if(_0x226bf3['length']){logger[_0x6f5c('0x1c')](util['format'](_0x6f5c('0x29'),_0x226bf3[_0x6f5c('0x20')](';\x20')));}if(_0x261065){logger[_0x6f5c('0x1c')](util[_0x6f5c('0x1d')](_0x6f5c('0x2a'),_0x261065));}logger['debug']('Iftime',_0x6f4664);logger[_0x6f5c('0x2b')](_0x6f5c('0x23'),_0x31c350);return Promise[_0x6f5c('0x2c')]()[_0x6f5c('0x11')](function(){if(Array[_0x6f5c('0x25')](_0x4ba8b4)){return checkArrayOfIntervals(_0x4ba8b4,_0x261065);}else if(_0x4ba8b4){return checkSingleInterval(_0x4ba8b4,_0x261065);}})[_0x6f5c('0x11')](function(_0x17a625){var _0x327feb=_0x226bf3[_0x6f5c('0x1b')](function(_0xf87f73,_0x3272d3){return _0xf87f73||iftime(_0x3272d3,_0x261065);},![]);_0x6f4664=_0x17a625||_0x327feb;return _0x6f4664;})[_0x6f5c('0x18')](function(_0x30a89c){logger[_0x6f5c('0x12')](_0x6f5c('0x23'),_0x31c350,_0x30a89c);throw this['error'](0x1f4,_0x30a89c[_0x6f5c('0x13')]);});}; \ No newline at end of file +var _0x23c1=['message','ShowInterval','Interval','find','info','debug','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','catch','lodash','util','../../mysqldb','../../utils/iftime','iftime','GetInterval','findAll','options','raw','where','attributes','limit','map','include','model','then','stringify','error'];(function(_0x9400f4,_0x8fccda){var _0x3f7863=function(_0x2bee02){while(--_0x2bee02){_0x9400f4['push'](_0x9400f4['shift']());}};_0x3f7863(++_0x8fccda);}(_0x23c1,0x1dd));var _0x123c=function(_0x30358b,_0x726597){_0x30358b=_0x30358b-0x0;var _0x1b4825=_0x23c1[_0x30358b];return _0x1b4825;};'use strict';var _=require(_0x123c('0x0'));var util=require(_0x123c('0x1'));var db=require(_0x123c('0x2'))['db'];var iftime=require(_0x123c('0x3'))[_0x123c('0x4')];var logger=require('../../config/logger')('rpc');exports[_0x123c('0x5')]=function(_0x40d0a8){var _0x28a3a3=this;return new Promise(function(_0x23987b,_0xc1f581){return db['Interval'][_0x123c('0x6')]({'raw':_0x40d0a8[_0x123c('0x7')]?_0x40d0a8[_0x123c('0x7')][_0x123c('0x8')]===undefined?!![]:![]:!![],'where':_0x40d0a8[_0x123c('0x7')]?_0x40d0a8[_0x123c('0x7')][_0x123c('0x9')]||null:null,'attributes':_0x40d0a8[_0x123c('0x7')]?_0x40d0a8[_0x123c('0x7')][_0x123c('0xa')]||null:null,'limit':_0x40d0a8[_0x123c('0x7')]?_0x40d0a8[_0x123c('0x7')][_0x123c('0xb')]||null:null,'include':_0x40d0a8['options']?_0x40d0a8[_0x123c('0x7')]['include']?_[_0x123c('0xc')](_0x40d0a8['options']['include'],function(_0xedc05){return{'model':db[_0xedc05['model']],'as':_0xedc05['as'],'attributes':_0xedc05[_0x123c('0xa')],'include':_0xedc05['include']?_['map'](_0xedc05[_0x123c('0xd')],function(_0x4b6884){return{'model':db[_0x4b6884[_0x123c('0xe')]],'as':_0x4b6884['as'],'attributes':_0x4b6884[_0x123c('0xa')],'include':_0x4b6884[_0x123c('0xd')]?_[_0x123c('0xc')](_0x4b6884[_0x123c('0xd')],function(_0x3ff696){return{'model':db[_0x3ff696['model']],'as':_0x3ff696['as'],'attributes':_0x3ff696[_0x123c('0xa')]};}):[]};}):[]};}):[]:[]})[_0x123c('0xf')](function(_0x55ff53){logger['info'](_0x123c('0x5'),_0x40d0a8);logger['debug'](_0x123c('0x5'),_0x40d0a8,JSON[_0x123c('0x10')](_0x55ff53));_0x23987b(_0x55ff53);})['catch'](function(_0x23b51b){logger[_0x123c('0x11')](_0x123c('0x5'),_0x23b51b['message'],_0x40d0a8);_0xc1f581(_0x28a3a3[_0x123c('0x11')](0x1f4,_0x23b51b[_0x123c('0x12')]));});});};exports[_0x123c('0x13')]=function(_0x271eab){var _0x1960e1=this;return new Promise(function(_0x328e9d,_0x1dcf5e){return db[_0x123c('0x14')][_0x123c('0x15')]({'raw':_0x271eab[_0x123c('0x7')]?_0x271eab[_0x123c('0x7')][_0x123c('0x8')]===undefined?!![]:![]:!![],'where':_0x271eab['options']?_0x271eab[_0x123c('0x7')][_0x123c('0x9')]||null:null,'attributes':_0x271eab['options']?_0x271eab[_0x123c('0x7')][_0x123c('0xa')]||null:null,'include':_0x271eab[_0x123c('0x7')]?_0x271eab[_0x123c('0x7')]['include']?_['map'](_0x271eab[_0x123c('0x7')][_0x123c('0xd')],function(_0x5537b1){return{'model':db[_0x5537b1[_0x123c('0xe')]],'as':_0x5537b1['as'],'attributes':_0x5537b1['attributes'],'include':_0x5537b1['include']?_[_0x123c('0xc')](_0x5537b1[_0x123c('0xd')],function(_0xf94025){return{'model':db[_0xf94025[_0x123c('0xe')]],'as':_0xf94025['as'],'attributes':_0xf94025[_0x123c('0xa')],'include':_0xf94025['include']?_[_0x123c('0xc')](_0xf94025[_0x123c('0xd')],function(_0x1cf539){return{'model':db[_0x1cf539[_0x123c('0xe')]],'as':_0x1cf539['as'],'attributes':_0x1cf539[_0x123c('0xa')]};}):[]};}):[]};}):[]:[]})[_0x123c('0xf')](function(_0x12672b){logger[_0x123c('0x16')](_0x123c('0x13'),_0x271eab);logger[_0x123c('0x17')](_0x123c('0x13'),_0x271eab,JSON[_0x123c('0x10')](_0x12672b));_0x328e9d(_0x12672b);})['catch'](function(_0x5eef6b){logger[_0x123c('0x11')](_0x123c('0x13'),_0x5eef6b['message'],_0x271eab);_0x1dcf5e(_0x1960e1[_0x123c('0x11')](0x1f4,_0x5eef6b[_0x123c('0x12')]));});});};function checkArrayOfIntervals(_0x5e4ffb,_0x20b7f8){var _0x492477=[];return db[_0x123c('0x14')][_0x123c('0x6')]({'where':{'id':_0x5e4ffb}})[_0x123c('0xf')](function(_0x57c501){_0x492477=_0x57c501;return Promise[_0x123c('0x18')](_0x492477[_0x123c('0xc')](function(_0x455b4c){return _0x455b4c[_0x123c('0x19')](_0x20b7f8);}));})['then'](function(_0x10397c){var _0x445fd3=_0x10397c[_0x123c('0x1a')](function(_0x4cf26b,_0x2df975){return _0x4cf26b||_0x2df975;},![]);logger['info'](util[_0x123c('0x1b')](_0x123c('0x1c'),_0x492477[_0x123c('0xc')](function(_0x3b621f){return _0x3b621f[_0x123c('0x1d')];})[_0x123c('0x1e')](',\x20'),_0x492477[_0x123c('0xc')](function(_0x4248ed){return _0x4248ed['id'];})[_0x123c('0x1e')](',\x20')));return _0x445fd3;});}function checkSingleInterval(_0x5029d0,_0x49342b){return db[_0x123c('0x14')]['findById'](_0x5029d0)[_0x123c('0xf')](function(_0x2cca73){if(_0x2cca73){logger[_0x123c('0x16')](util[_0x123c('0x1b')](_0x123c('0x1f'),_0x2cca73[_0x123c('0x1d')],_0x2cca73['id']));return _0x2cca73[_0x123c('0x19')](_0x49342b);}});}exports[_0x123c('0x20')]=function(_0x3fb132){var _0x3e2848=_0x3fb132[_0x123c('0x21')];var _0x57f429=Array[_0x123c('0x22')](_0x3fb132[_0x123c('0x23')])?_0x3fb132['intervals']:typeof _0x3fb132['intervals']===_0x123c('0x24')?[_0x3fb132['intervals']]:[];var _0x206c11=_0x3fb132[_0x123c('0x25')]||undefined;var _0x3e7558=![];if(_0x57f429[_0x123c('0x26')]){logger['info'](util[_0x123c('0x1b')](_0x123c('0x27'),_0x57f429[_0x123c('0x1e')](';\x20')));}if(_0x206c11){logger[_0x123c('0x16')](util[_0x123c('0x1b')](_0x123c('0x28'),_0x206c11));}logger[_0x123c('0x17')](_0x123c('0x29'),_0x3e7558);logger[_0x123c('0x2a')](_0x123c('0x20'),_0x3fb132);return Promise[_0x123c('0x2b')]()['then'](function(){if(Array['isArray'](_0x3e2848)){return checkArrayOfIntervals(_0x3e2848,_0x206c11);}else if(_0x3e2848){return checkSingleInterval(_0x3e2848,_0x206c11);}})[_0x123c('0xf')](function(_0xf700b4){var _0x4b8cf1=_0x57f429['reduce'](function(_0x56e40a,_0x5ddc1d){return _0x56e40a||iftime(_0x5ddc1d,_0x206c11);},![]);_0x3e7558=_0xf700b4||_0x4b8cf1;return _0x3e7558;})[_0x123c('0x2c')](function(_0x1e9089){logger[_0x123c('0x11')](_0x123c('0x20'),_0x3fb132,_0x1e9089);throw this[_0x123c('0x11')](0x1f4,_0x1e9089[_0x123c('0x12')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index fcd1257..ff1434c 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x0b0e[_0x4bdf64];return _0x9a1a19;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x32d02f,_0x26af2f){var _0x734fd=function(_0x3438d0){while(--_0x3438d0){_0x32d02f['push'](_0x32d02f['shift']());}};_0x734fd(++_0x26af2f);}(_0xdb28,0x106));var _0x8db2=function(_0x335885,_0x3a310c){_0x335885=_0x335885-0x0;var _0x5ab66f=_0xdb28[_0x335885];return _0x5ab66f;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index e969648..4695de4 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 _0x1db0=['support','3eAmWpBVP0','key','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','setEncoding','end','status','json','parse','api.jira','write','openIssue','socket','remoteAddress','connection','body','https','../../config/logger'];(function(_0x4b2308,_0x5568fb){var _0x35d134=function(_0x17ef2f){while(--_0x17ef2f){_0x4b2308['push'](_0x4b2308['shift']());}};_0x35d134(++_0x5568fb);}(_0x1db0,0x17a));var _0x01db=function(_0x4bc56e,_0x4f2fc0){_0x4bc56e=_0x4bc56e-0x0;var _0x29c230=_0x1db0[_0x4bc56e];return _0x29c230;};'use strict';var BPromise=require('bluebird');var https=require(_0x01db('0x0'));var logger=require(_0x01db('0x1'))('api');var USERNAME=_0x01db('0x2');var PASSWORD=_0x01db('0x3');function openIssue(_0x214280,_0x2409f5){var _0x54a0d1={'fields':{'project':{'key':_0x214280[_0x01db('0x4')]||'MOTGUI'},'summary':(_0x214280['summary']||_0x01db('0x5'))+_0x01db('0x6')+_0x214280['ip'],'description':_0x214280[_0x01db('0x7')]||JSON[_0x01db('0x8')](_0x214280),'issuetype':{'name':_0x214280[_0x01db('0x9')]||_0x01db('0xa')}}};_0x54a0d1[_0x01db('0xb')][_0x01db('0xc')]=_0x214280[_0x01db('0xd')];_0x54a0d1[_0x01db('0xb')][_0x01db('0xe')]=_0x214280[_0x01db('0xf')];_0x54a0d1[_0x01db('0xb')][_0x01db('0x10')]=_0x214280[_0x01db('0x11')];_0x54a0d1['fields'][_0x01db('0x12')]=_0x214280['name'];_0x54a0d1[_0x01db('0xb')][_0x01db('0x13')]=_0x214280['reason'];_0x54a0d1[_0x01db('0xb')][_0x01db('0x14')]=_0x214280['ip'];var _0x183465={'host':_0x01db('0x15'),'port':0x1bb,'path':_0x01db('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x01db('0x17'),'Authorization':_0x01db('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x01db('0x19')]('base64')}};var _0x380315=JSON[_0x01db('0x8')](_0x54a0d1);var _0x5bb765=https['request'](_0x183465,function(_0x5eb070){_0x5eb070[_0x01db('0x1a')]('utf8');var _0x2f36ea='';_0x5eb070['on']('data',function(_0x220ba9){_0x2f36ea+=_0x220ba9;});_0x5eb070['on'](_0x01db('0x1b'),function(){if(_0x2409f5){return _0x2409f5[_0x01db('0x1c')](_0x5eb070['statusCode'])[_0x01db('0x1d')](JSON[_0x01db('0x1e')](_0x2f36ea));}});});_0x5bb765['on']('error',function(_0x3eb76d){if(_0x2409f5){return _0x2409f5[_0x01db('0x1c')](0x1f4)[_0x01db('0x1d')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x01db('0x1f')}]});}});_0x5bb765[_0x01db('0x20')](_0x380315);_0x5bb765[_0x01db('0x1b')]();}exports[_0x01db('0x21')]=openIssue;exports['send']=function(_0x281ebf,_0x164dfa){_0x281ebf['body']['ip']=_0x281ebf['headers']['x-forwarded-for']||_0x281ebf['connection']['remoteAddress']||_0x281ebf[_0x01db('0x22')][_0x01db('0x23')]||_0x281ebf[_0x01db('0x24')]['socket'][_0x01db('0x23')];return openIssue(_0x281ebf[_0x01db('0x25')],_0x164dfa);}; \ No newline at end of file +var _0xe02f=['oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','send','body','headers','remoteAddress','socket','connection','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','Report','stringify','issuetype','Bug','customfield_11500','fields','customfield_11501'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe02f,0x176));var _0xfe02=function(_0x1ee2ae,_0x17c0eb){_0x1ee2ae=_0x1ee2ae-0x0;var _0x1780e5=_0xe02f[_0x1ee2ae];return _0x1780e5;};'use strict';var BPromise=require(_0xfe02('0x0'));var https=require('https');var logger=require(_0xfe02('0x1'))(_0xfe02('0x2'));var USERNAME=_0xfe02('0x3');var PASSWORD=_0xfe02('0x4');function openIssue(_0x4447e3,_0x5f5326){var _0x43af3b={'fields':{'project':{'key':_0x4447e3[_0xfe02('0x5')]||'MOTGUI'},'summary':(_0x4447e3['summary']||_0xfe02('0x6'))+'\x20from\x20'+_0x4447e3['ip'],'description':_0x4447e3['description']||JSON[_0xfe02('0x7')](_0x4447e3),'issuetype':{'name':_0x4447e3[_0xfe02('0x8')]||_0xfe02('0x9')}}};_0x43af3b['fields'][_0xfe02('0xa')]=_0x4447e3['email'];_0x43af3b[_0xfe02('0xb')][_0xfe02('0xc')]=_0x4447e3[_0xfe02('0xd')];_0x43af3b[_0xfe02('0xb')][_0xfe02('0xe')]=_0x4447e3[_0xfe02('0xf')];_0x43af3b[_0xfe02('0xb')][_0xfe02('0x10')]=_0x4447e3[_0xfe02('0x11')];_0x43af3b[_0xfe02('0xb')][_0xfe02('0x12')]=_0x4447e3[_0xfe02('0x13')];_0x43af3b[_0xfe02('0xb')][_0xfe02('0x14')]=_0x4447e3['ip'];var _0x3a91b5={'host':_0xfe02('0x15'),'port':0x1bb,'path':_0xfe02('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xfe02('0x17'),'Authorization':_0xfe02('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xfe02('0x19'))}};var _0x5742a3=JSON[_0xfe02('0x7')](_0x43af3b);var _0x2bb6cc=https['request'](_0x3a91b5,function(_0x50afcc){_0x50afcc['setEncoding'](_0xfe02('0x1a'));var _0x1465f9='';_0x50afcc['on'](_0xfe02('0x1b'),function(_0x2e8a6a){_0x1465f9+=_0x2e8a6a;});_0x50afcc['on']('end',function(){if(_0x5f5326){return _0x5f5326[_0xfe02('0x1c')](_0x50afcc[_0xfe02('0x1d')])[_0xfe02('0x1e')](JSON[_0xfe02('0x1f')](_0x1465f9));}});});_0x2bb6cc['on'](_0xfe02('0x20'),function(_0x48f495){if(_0x5f5326){return _0x5f5326['status'](0x1f4)[_0xfe02('0x1e')]({'errors':[{'message':_0xfe02('0x21'),'type':_0xfe02('0x22')}]});}});_0x2bb6cc['write'](_0x5742a3);_0x2bb6cc[_0xfe02('0x23')]();}exports[_0xfe02('0x24')]=openIssue;exports[_0xfe02('0x25')]=function(_0x53a029,_0x92cea6){_0x53a029[_0xfe02('0x26')]['ip']=_0x53a029[_0xfe02('0x27')]['x-forwarded-for']||_0x53a029['connection'][_0xfe02('0x28')]||_0x53a029[_0xfe02('0x29')][_0xfe02('0x28')]||_0x53a029[_0xfe02('0x2a')]['socket']['remoteAddress'];return openIssue(_0x53a029[_0xfe02('0x26')],_0x92cea6);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ac91b7a..e63c309 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 _0xfd28=['show','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x26425a,_0x1b4d6f){var _0x12802a=function(_0x5db8a7){while(--_0x5db8a7){_0x26425a['push'](_0x26425a['shift']());}};_0x12802a(++_0x1b4d6f);}(_0xfd28,0x148));var _0x8fd2=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xfd28[_0x342baa];return _0x1208f3;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xe')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0xf')]);module[_0x8fd2('0x10')]=router; \ No newline at end of file +var _0xaa88=['/describe','isAuthenticated','describe','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xaa88,0x137));var _0x8aa8=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0xaa88[_0x3f3bad];return _0x4f0801;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0x10')]('/',auth['isAuthenticated'](),controller[_0x8aa8('0x11')]);router[_0x8aa8('0x12')](_0x8aa8('0x13'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x13'),auth['isAuthenticated'](),controller[_0x8aa8('0x15')]);module[_0x8aa8('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 354fd2d..518b4ea 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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x4b892d,_0x4da6c4){_0x4b892d=_0x4b892d-0x0;var _0x144e3c=_0x7a54[_0x4b892d];return _0x144e3c;};'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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a54,0x106));var _0x47a5=function(_0x3bc3b4,_0x5d36b3){_0x3bc3b4=_0x3bc3b4-0x0;var _0x468d1d=_0x7a54[_0x3bc3b4];return _0x468d1d;};'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 1fabaf6..db6658d 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 _0xd101=['then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update'];(function(_0x154087,_0x378f76){var _0x53f7bd=function(_0x1d650c){while(--_0x1d650c){_0x154087['push'](_0x154087['shift']());}};_0x53f7bd(++_0x378f76);}(_0xd101,0xc1));var _0x1d10=function(_0x443cc7,_0x52a07e){_0x443cc7=_0x443cc7-0x0;var _0x15e1de=_0xd101[_0x443cc7];return _0x15e1de;};'use strict';var emlformat=require(_0x1d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d10('0x1'));var jsonpatch=require(_0x1d10('0x2'));var rp=require(_0x1d10('0x3'));var moment=require(_0x1d10('0x4'));var BPromise=require(_0x1d10('0x5'));var Mustache=require(_0x1d10('0x6'));var util=require(_0x1d10('0x7'));var path=require(_0x1d10('0x8'));var sox=require('sox');var csv=require(_0x1d10('0x9'));var ejs=require(_0x1d10('0xa'));var fs=require('fs');var fs_extra=require(_0x1d10('0xb'));var _=require(_0x1d10('0xc'));var squel=require(_0x1d10('0xd'));var crypto=require(_0x1d10('0xe'));var jsforce=require(_0x1d10('0xf'));var deskjs=require(_0x1d10('0x10'));var toCsv=require(_0x1d10('0x9'));var querystring=require(_0x1d10('0x11'));var Papa=require(_0x1d10('0x12'));var Redis=require(_0x1d10('0x13'));var authService=require(_0x1d10('0x14'));var qs=require(_0x1d10('0x15'));var as=require(_0x1d10('0x16'));var hardwareService=require(_0x1d10('0x17'));var logger=require(_0x1d10('0x18'))('api');var utils=require(_0x1d10('0x19'));var config=require(_0x1d10('0x1a'));var licenseUtil=require(_0x1d10('0x1b'));var db=require(_0x1d10('0x1c'))['db'];function respondWithStatusCode(_0x268506,_0x5b71d8){_0x5b71d8=_0x5b71d8||0xcc;return function(_0x3f6bd8){if(_0x3f6bd8){return _0x268506[_0x1d10('0x1d')](_0x5b71d8);}return _0x268506[_0x1d10('0x1e')](_0x5b71d8)[_0x1d10('0x1f')]();};}function respondWithResult(_0x2224ff,_0x183bc4){_0x183bc4=_0x183bc4||0xc8;return function(_0x56bc3d){if(_0x56bc3d){return _0x2224ff[_0x1d10('0x1e')](_0x183bc4)[_0x1d10('0x20')](_0x56bc3d);}};}function respondWithFilteredResult(_0x306953,_0x2ad3c0){return function(_0x4f014a){if(_0x4f014a){var _0x3aedf7=typeof _0x2ad3c0[_0x1d10('0x21')]===_0x1d10('0x22')&&typeof _0x2ad3c0[_0x1d10('0x23')]===_0x1d10('0x22');var _0x382b37=_0x4f014a[_0x1d10('0x24')];var _0x4f3e2a=_0x3aedf7?0x0:_0x2ad3c0[_0x1d10('0x21')];var _0x1163dd=_0x3aedf7?_0x4f014a[_0x1d10('0x24')]:_0x2ad3c0[_0x1d10('0x21')]+_0x2ad3c0[_0x1d10('0x23')];var _0x5e61f8;if(_0x1163dd>=_0x382b37){_0x1163dd=_0x382b37;_0x5e61f8=0xc8;}else{_0x5e61f8=0xce;}_0x306953['status'](_0x5e61f8);return _0x306953[_0x1d10('0x25')]('Content-Range',_0x4f3e2a+'-'+_0x1163dd+'/'+_0x382b37)['json'](_0x4f014a);}return null;};}function patchUpdates(_0x5774f9){return function(_0x237b92){try{jsonpatch[_0x1d10('0x26')](_0x237b92,_0x5774f9,!![]);}catch(_0x24717c){return BPromise[_0x1d10('0x27')](_0x24717c);}return _0x237b92['save']();};}function saveUpdates(_0x5e5315,_0x140147){return function(_0x5da6cf){if(_0x5da6cf){return _0x5da6cf[_0x1d10('0x28')](_0x5e5315)[_0x1d10('0x29')](function(_0x160802){return _0x160802;});}return null;};}function removeEntity(_0x37f22d,_0x127b37){return function(_0x3601ba){if(_0x3601ba){return _0x3601ba[_0x1d10('0x2a')]()[_0x1d10('0x29')](function(){_0x37f22d[_0x1d10('0x1e')](0xcc)[_0x1d10('0x1f')]();});}};}function handleEntityNotFound(_0xf1e4c8,_0x5abc58){return function(_0x666012){if(!_0x666012){_0xf1e4c8[_0x1d10('0x1d')](0x194);}return _0x666012;};}function handleError(_0x475934,_0x15f2ee){_0x15f2ee=_0x15f2ee||0x1f4;return function(_0x18e7d9){logger[_0x1d10('0x2b')](_0x18e7d9[_0x1d10('0x2c')]);if(_0x18e7d9[_0x1d10('0x2d')]){delete _0x18e7d9['name'];}_0x475934[_0x1d10('0x1e')](_0x15f2ee)[_0x1d10('0x2e')](_0x18e7d9);};}exports['index']=function(_0x13a3dc,_0x52d514){var _0x4db221={},_0x41b5b8={},_0x597aea={'count':0x0,'rows':[]};var _0xa4e6aa=_[_0x1d10('0x2f')](db[_0x1d10('0x30')][_0x1d10('0x31')],function(_0x1a43fd){return{'name':_0x1a43fd[_0x1d10('0x32')],'type':_0x1a43fd['type']['key']};});_0x41b5b8[_0x1d10('0x33')]=_[_0x1d10('0x2f')](_0xa4e6aa,_0x1d10('0x2d'));_0x41b5b8[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x13a3dc[_0x1d10('0x34')]);_0x41b5b8[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x41b5b8[_0x1d10('0x33')],_0x41b5b8[_0x1d10('0x34')]);_0x4db221['attributes']=_[_0x1d10('0x37')](_0x41b5b8['model'],qs[_0x1d10('0x38')](_0x13a3dc[_0x1d10('0x34')]['fields']));_0x4db221[_0x1d10('0x39')]=_0x4db221['attributes'][_0x1d10('0x3a')]?_0x4db221[_0x1d10('0x39')]:_0x41b5b8[_0x1d10('0x33')];if(!_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3b')]('nolimit')){_0x4db221['limit']=qs[_0x1d10('0x23')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x23')]);_0x4db221['offset']=qs['offset'](_0x13a3dc['query'][_0x1d10('0x21')]);}_0x4db221['order']=qs[_0x1d10('0x3c')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3c')]);_0x4db221[_0x1d10('0x3d')]=qs['filters'](_['pick'](_0x13a3dc[_0x1d10('0x34')],_0x41b5b8[_0x1d10('0x36')]),_0xa4e6aa);if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]){_0x4db221['where']=_[_0x1d10('0x3f')](_0x4db221['where'],{'$or':_[_0x1d10('0x2f')](_0xa4e6aa,function(_0xec1f49){if(_0xec1f49[_0x1d10('0x40')]!==_0x1d10('0x41')){var _0x38addd={};_0x38addd[_0xec1f49[_0x1d10('0x2d')]]={'$like':'%'+_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]+'%'};return _0x38addd;}})});}_0x4db221=_[_0x1d10('0x3f')]({},_0x4db221,_0x13a3dc[_0x1d10('0x42')]);var _0x1cae38={'where':_0x4db221[_0x1d10('0x3d')]};return db[_0x1d10('0x30')]['count'](_0x1cae38)['then'](function(_0x35b2e3){_0x597aea[_0x1d10('0x24')]=_0x35b2e3;if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x43')]){_0x4db221[_0x1d10('0x44')]=[{'all':!![]}];}return db[_0x1d10('0x30')][_0x1d10('0x45')](_0x4db221);})['then'](function(_0x1a67e9){_0x597aea[_0x1d10('0x46')]=_0x1a67e9;return _0x597aea;})[_0x1d10('0x29')](respondWithFilteredResult(_0x52d514,_0x4db221))['catch'](handleError(_0x52d514,null));};exports[_0x1d10('0x47')]=function(_0x427cd7,_0x2ee987){var _0x598973={'raw':!![],'where':{'id':_0x427cd7[_0x1d10('0x48')]['id']}},_0x5795f1={};_0x5795f1[_0x1d10('0x33')]=_[_0x1d10('0x35')](db[_0x1d10('0x30')][_0x1d10('0x31')]);_0x5795f1[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x427cd7['query']);_0x5795f1[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x5795f1['model'],_0x5795f1[_0x1d10('0x34')]);_0x598973['attributes']=_[_0x1d10('0x37')](_0x5795f1['model'],qs['fields'](_0x427cd7[_0x1d10('0x34')][_0x1d10('0x38')]));_0x598973[_0x1d10('0x39')]=_0x598973[_0x1d10('0x39')][_0x1d10('0x3a')]?_0x598973[_0x1d10('0x39')]:_0x5795f1[_0x1d10('0x33')];if(_0x427cd7[_0x1d10('0x34')][_0x1d10('0x43')]){_0x598973['include']=[{'all':!![]}];}_0x598973=_['merge']({},_0x598973,_0x427cd7[_0x1d10('0x42')]);return db[_0x1d10('0x30')][_0x1d10('0x49')](_0x598973)[_0x1d10('0x29')](handleEntityNotFound(_0x2ee987,null))[_0x1d10('0x29')](respondWithResult(_0x2ee987,null))[_0x1d10('0x4a')](handleError(_0x2ee987,null));};exports['create']=function(_0x2db27f,_0x1b8513){return db[_0x1d10('0x30')][_0x1d10('0x4b')](_0x2db27f[_0x1d10('0x4c')],{})[_0x1d10('0x29')](respondWithResult(_0x1b8513,0xc9))[_0x1d10('0x4a')](handleError(_0x1b8513,null));};exports[_0x1d10('0x28')]=function(_0x39bf64,_0x32a9a9){if(_0x39bf64[_0x1d10('0x4c')]['id']){delete _0x39bf64[_0x1d10('0x4c')]['id'];}return db[_0x1d10('0x30')][_0x1d10('0x49')]({'where':{'id':_0x39bf64['params']['id']}})['then'](handleEntityNotFound(_0x32a9a9,null))[_0x1d10('0x29')](saveUpdates(_0x39bf64['body'],null))['then'](respondWithResult(_0x32a9a9,null))[_0x1d10('0x4a')](handleError(_0x32a9a9,null));};exports[_0x1d10('0x2a')]=function(_0x375fb1,_0x35d8fb){return db[_0x1d10('0x30')]['find']({'where':{'id':_0x375fb1['params']['id']}})['then'](handleEntityNotFound(_0x35d8fb,null))['then'](removeEntity(_0x35d8fb,null))[_0x1d10('0x4a')](handleError(_0x35d8fb,null));};exports[_0x1d10('0x4d')]=function(_0x4570c4,_0x3a4167){return db['JscriptyAnswerReport'][_0x1d10('0x4d')]()[_0x1d10('0x29')](respondWithResult(_0x3a4167,null))[_0x1d10('0x4a')](handleError(_0x3a4167,null));}; \ No newline at end of file +var _0xe181=['keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x182fff,_0x568aee){var _0x1b4171=function(_0x212d46){while(--_0x212d46){_0x182fff['push'](_0x182fff['shift']());}};_0x1b4171(++_0x568aee);}(_0xe181,0x68));var _0x1e18=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0xe181[_0xc40b9f];return _0x535b9c;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];function respondWithStatusCode(_0x1743c3,_0x33a98d){_0x33a98d=_0x33a98d||0xcc;return function(_0x531e1b){if(_0x531e1b){return _0x1743c3[_0x1e18('0x1b')](_0x33a98d);}return _0x1743c3['status'](_0x33a98d)[_0x1e18('0x1c')]();};}function respondWithResult(_0x563eff,_0x404b7f){_0x404b7f=_0x404b7f||0xc8;return function(_0x36b583){if(_0x36b583){return _0x563eff[_0x1e18('0x1d')](_0x404b7f)[_0x1e18('0x1e')](_0x36b583);}};}function respondWithFilteredResult(_0x1687ba,_0x1e1ce6){return function(_0x39bc56){if(_0x39bc56){var _0x33fea1=typeof _0x1e1ce6[_0x1e18('0x1f')]===_0x1e18('0x20')&&typeof _0x1e1ce6[_0x1e18('0x21')]===_0x1e18('0x20');var _0x349f3c=_0x39bc56[_0x1e18('0x22')];var _0x21b851=_0x33fea1?0x0:_0x1e1ce6['offset'];var _0x1c91d2=_0x33fea1?_0x39bc56[_0x1e18('0x22')]:_0x1e1ce6[_0x1e18('0x1f')]+_0x1e1ce6[_0x1e18('0x21')];var _0x2834ee;if(_0x1c91d2>=_0x349f3c){_0x1c91d2=_0x349f3c;_0x2834ee=0xc8;}else{_0x2834ee=0xce;}_0x1687ba[_0x1e18('0x1d')](_0x2834ee);return _0x1687ba[_0x1e18('0x23')](_0x1e18('0x24'),_0x21b851+'-'+_0x1c91d2+'/'+_0x349f3c)[_0x1e18('0x1e')](_0x39bc56);}return null;};}function patchUpdates(_0x22baca){return function(_0x2489c3){try{jsonpatch[_0x1e18('0x25')](_0x2489c3,_0x22baca,!![]);}catch(_0x3c4fdf){return BPromise[_0x1e18('0x26')](_0x3c4fdf);}return _0x2489c3[_0x1e18('0x27')]();};}function saveUpdates(_0x975df0,_0x3fd0a7){return function(_0x5eb6b4){if(_0x5eb6b4){return _0x5eb6b4[_0x1e18('0x28')](_0x975df0)[_0x1e18('0x29')](function(_0x3e9b2c){return _0x3e9b2c;});}return null;};}function removeEntity(_0x52d5e2,_0xf74622){return function(_0xdda2ce){if(_0xdda2ce){return _0xdda2ce[_0x1e18('0x2a')]()[_0x1e18('0x29')](function(){_0x52d5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa4db,_0x53f9d7){return function(_0x5bb03c){if(!_0x5bb03c){_0x6fa4db['sendStatus'](0x194);}return _0x5bb03c;};}function handleError(_0x32a196,_0x29cac0){_0x29cac0=_0x29cac0||0x1f4;return function(_0x41b67d){logger[_0x1e18('0x2b')](_0x41b67d[_0x1e18('0x2c')]);if(_0x41b67d[_0x1e18('0x2d')]){delete _0x41b67d[_0x1e18('0x2d')];}_0x32a196[_0x1e18('0x1d')](_0x29cac0)[_0x1e18('0x2e')](_0x41b67d);};}exports[_0x1e18('0x2f')]=function(_0x1015a3,_0x42c638){var _0x40d0af={},_0x1be225={},_0x558d01={'count':0x0,'rows':[]};var _0x57000b=_['map'](db[_0x1e18('0x30')][_0x1e18('0x31')],function(_0x1f75cd){return{'name':_0x1f75cd[_0x1e18('0x32')],'type':_0x1f75cd[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x1be225[_0x1e18('0x35')]=_[_0x1e18('0x36')](_0x57000b,'name');_0x1be225[_0x1e18('0x37')]=_[_0x1e18('0x38')](_0x1015a3['query']);_0x1be225[_0x1e18('0x39')]=_[_0x1e18('0x3a')](_0x1be225[_0x1e18('0x35')],_0x1be225['query']);_0x40d0af[_0x1e18('0x3b')]=_['intersection'](_0x1be225['model'],qs['fields'](_0x1015a3[_0x1e18('0x37')]['fields']));_0x40d0af[_0x1e18('0x3b')]=_0x40d0af[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x40d0af['attributes']:_0x1be225['model'];if(!_0x1015a3[_0x1e18('0x37')][_0x1e18('0x3d')](_0x1e18('0x3e'))){_0x40d0af[_0x1e18('0x21')]=qs[_0x1e18('0x21')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x21')]);_0x40d0af[_0x1e18('0x1f')]=qs[_0x1e18('0x1f')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x1f')]);}_0x40d0af[_0x1e18('0x3f')]=qs['sort'](_0x1015a3['query'][_0x1e18('0x40')]);_0x40d0af[_0x1e18('0x41')]=qs[_0x1e18('0x39')](_['pick'](_0x1015a3[_0x1e18('0x37')],_0x1be225['filters']),_0x57000b);if(_0x1015a3[_0x1e18('0x37')]['filter']){_0x40d0af['where']=_[_0x1e18('0x42')](_0x40d0af[_0x1e18('0x41')],{'$or':_[_0x1e18('0x36')](_0x57000b,function(_0x206b44){if(_0x206b44[_0x1e18('0x33')]!==_0x1e18('0x43')){var _0x4e2ca3={};_0x4e2ca3[_0x206b44[_0x1e18('0x2d')]]={'$like':'%'+_0x1015a3[_0x1e18('0x37')][_0x1e18('0x44')]+'%'};return _0x4e2ca3;}})});}_0x40d0af=_[_0x1e18('0x42')]({},_0x40d0af,_0x1015a3['options']);var _0x11f839={'where':_0x40d0af['where']};return db[_0x1e18('0x30')][_0x1e18('0x22')](_0x11f839)['then'](function(_0x41c2bd){_0x558d01[_0x1e18('0x22')]=_0x41c2bd;if(_0x1015a3['query']['includeAll']){_0x40d0af['include']=[{'all':!![]}];}return db[_0x1e18('0x30')][_0x1e18('0x45')](_0x40d0af);})[_0x1e18('0x29')](function(_0x602a85){_0x558d01[_0x1e18('0x46')]=_0x602a85;return _0x558d01;})[_0x1e18('0x29')](respondWithFilteredResult(_0x42c638,_0x40d0af))[_0x1e18('0x47')](handleError(_0x42c638,null));};exports[_0x1e18('0x48')]=function(_0x1cae7e,_0x354832){var _0x16ee40={'raw':!![],'where':{'id':_0x1cae7e[_0x1e18('0x49')]['id']}},_0x4821f9={};_0x4821f9['model']=_[_0x1e18('0x38')](db[_0x1e18('0x30')]['rawAttributes']);_0x4821f9['query']=_['keys'](_0x1cae7e[_0x1e18('0x37')]);_0x4821f9[_0x1e18('0x39')]=_['intersection'](_0x4821f9[_0x1e18('0x35')],_0x4821f9[_0x1e18('0x37')]);_0x16ee40['attributes']=_['intersection'](_0x4821f9[_0x1e18('0x35')],qs[_0x1e18('0x4a')](_0x1cae7e[_0x1e18('0x37')][_0x1e18('0x4a')]));_0x16ee40[_0x1e18('0x3b')]=_0x16ee40[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x16ee40[_0x1e18('0x3b')]:_0x4821f9[_0x1e18('0x35')];if(_0x1cae7e[_0x1e18('0x37')]['includeAll']){_0x16ee40['include']=[{'all':!![]}];}_0x16ee40=_[_0x1e18('0x42')]({},_0x16ee40,_0x1cae7e[_0x1e18('0x4b')]);return db[_0x1e18('0x30')][_0x1e18('0x4c')](_0x16ee40)[_0x1e18('0x29')](handleEntityNotFound(_0x354832,null))[_0x1e18('0x29')](respondWithResult(_0x354832,null))[_0x1e18('0x47')](handleError(_0x354832,null));};exports['create']=function(_0x54f69b,_0x54cd71){return db[_0x1e18('0x30')][_0x1e18('0x4d')](_0x54f69b[_0x1e18('0x4e')],{})[_0x1e18('0x29')](respondWithResult(_0x54cd71,0xc9))[_0x1e18('0x47')](handleError(_0x54cd71,null));};exports[_0x1e18('0x28')]=function(_0x191c18,_0x190af4){if(_0x191c18[_0x1e18('0x4e')]['id']){delete _0x191c18[_0x1e18('0x4e')]['id'];}return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x191c18[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x190af4,null))[_0x1e18('0x29')](saveUpdates(_0x191c18[_0x1e18('0x4e')],null))[_0x1e18('0x29')](respondWithResult(_0x190af4,null))[_0x1e18('0x47')](handleError(_0x190af4,null));};exports[_0x1e18('0x2a')]=function(_0x11d573,_0x5d4cbb){return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x11d573[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x5d4cbb,null))[_0x1e18('0x29')](removeEntity(_0x5d4cbb,null))['catch'](handleError(_0x5d4cbb,null));};exports['describe']=function(_0x16b51a,_0x30dc06){return db['JscriptyAnswerReport'][_0x1e18('0x4f')]()[_0x1e18('0x29')](respondWithResult(_0x30dc06,null))[_0x1e18('0x47')](handleError(_0x30dc06,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6ed797b..51eebc5 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 _0x0f39=['api','moment','request-promise','path','rimraf','../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x19aa8d,_0x415811){var _0x460b8d=function(_0x57c9fc){while(--_0x57c9fc){_0x19aa8d['push'](_0x19aa8d['shift']());}};_0x460b8d(++_0x415811);}(_0x0f39,0x132));var _0x90f3=function(_0x47b3c3,_0x44d3a1){_0x47b3c3=_0x47b3c3-0x0;var _0x3d1e9e=_0x0f39[_0x47b3c3];return _0x3d1e9e;};'use strict';var _=require(_0x90f3('0x0'));var util=require(_0x90f3('0x1'));var logger=require('../../config/logger')(_0x90f3('0x2'));var moment=require(_0x90f3('0x3'));var BPromise=require('bluebird');var rp=require(_0x90f3('0x4'));var fs=require('fs');var path=require(_0x90f3('0x5'));var rimraf=require(_0x90f3('0x6'));var config=require(_0x90f3('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x90f3('0x8')]=function(_0x2afed4,_0x499994){return _0x2afed4['define'](_0x90f3('0x9'),attributes,{'tableName':_0x90f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ce0=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','api','moment','bluebird','request-promise'];(function(_0x13b556,_0x43477d){var _0x3e3df8=function(_0x29bd96){while(--_0x29bd96){_0x13b556['push'](_0x13b556['shift']());}};_0x3e3df8(++_0x43477d);}(_0x8ce0,0x18d));var _0x08ce=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x8ce0[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x08ce('0x0'));var util=require(_0x08ce('0x1'));var logger=require('../../config/logger')(_0x08ce('0x2'));var moment=require(_0x08ce('0x3'));var BPromise=require(_0x08ce('0x4'));var rp=require(_0x08ce('0x5'));var fs=require('fs');var path=require(_0x08ce('0x6'));var rimraf=require(_0x08ce('0x7'));var config=require(_0x08ce('0x8'));var attributes=require(_0x08ce('0x9'));module[_0x08ce('0xa')]=function(_0x474649,_0x46722a){return _0x474649[_0x08ce('0xb')]('JscriptyAnswerReport',attributes,{'tableName':_0x08ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 9e025b1..c525a36 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 _0x0568=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x123578,_0x3203ef){var _0x5d1bde=function(_0x5dc668){while(--_0x5dc668){_0x123578['push'](_0x123578['shift']());}};_0x5d1bde(++_0x3203ef);}(_0x0568,0xee));var _0x8056=function(_0x29c7a5,_0x5e29f8){_0x29c7a5=_0x29c7a5-0x0;var _0x2b231c=_0x0568[_0x29c7a5];return _0x2b231c;};'use strict';var _=require(_0x8056('0x0'));var util=require(_0x8056('0x1'));var moment=require('moment');var BPromise=require(_0x8056('0x2'));var rs=require(_0x8056('0x3'));var fs=require('fs');var Redis=require(_0x8056('0x4'));var db=require(_0x8056('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8056('0x6'));var config=require(_0x8056('0x7'));var jayson=require(_0x8056('0x8'));var client=jayson[_0x8056('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f9ca,_0x268dea,_0x5c66e6){return new BPromise(function(_0x8f29ae,_0x1f74f6){return client['request'](_0x17f9ca,_0x5c66e6)[_0x8056('0xa')](function(_0x4697a0){logger[_0x8056('0xb')](_0x8056('0xc'),_0x268dea,_0x8056('0xd'));logger[_0x8056('0xe')](_0x8056('0xf'),_0x268dea,_0x8056('0xd'),JSON[_0x8056('0x10')](_0x4697a0));if(_0x4697a0[_0x8056('0x11')]){if(_0x4697a0['error'][_0x8056('0x12')]===0x1f4){logger[_0x8056('0x11')](_0x8056('0xc'),_0x268dea,_0x4697a0[_0x8056('0x11')]['message']);return _0x1f74f6(_0x4697a0[_0x8056('0x11')][_0x8056('0x13')]);}logger['error'](_0x8056('0xc'),_0x268dea,_0x4697a0[_0x8056('0x11')][_0x8056('0x13')]);return _0x8f29ae(_0x4697a0[_0x8056('0x11')]['message']);}else{logger[_0x8056('0xb')](_0x8056('0xc'),_0x268dea,_0x8056('0xd'));_0x8f29ae(_0x4697a0[_0x8056('0x14')][_0x8056('0x13')]);}})[_0x8056('0x15')](function(_0x3eb86a){logger[_0x8056('0x11')](_0x8056('0xc'),_0x268dea,_0x3eb86a);_0x1f74f6(_0x3eb86a);});});} \ No newline at end of file +var _0x3481=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x3481,0xa5));var _0x1348=function(_0x456ad0,_0x36e9e1){_0x456ad0=_0x456ad0-0x0;var _0x5194f0=_0x3481[_0x456ad0];return _0x5194f0;};'use strict';var _=require(_0x1348('0x0'));var util=require(_0x1348('0x1'));var moment=require(_0x1348('0x2'));var BPromise=require(_0x1348('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1348('0x4'));var db=require(_0x1348('0x5'))['db'];var utils=require(_0x1348('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1348('0x7'));var jayson=require(_0x1348('0x8'));var client=jayson[_0x1348('0x9')][_0x1348('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xed9aad,_0x178014,_0x2349c6){return new BPromise(function(_0x5c5b08,_0x3599b7){return client[_0x1348('0xb')](_0xed9aad,_0x2349c6)['then'](function(_0x57a406){logger[_0x1348('0xc')](_0x1348('0xd'),_0x178014,_0x1348('0xe'));logger[_0x1348('0xf')](_0x1348('0x10'),_0x178014,_0x1348('0xe'),JSON[_0x1348('0x11')](_0x57a406));if(_0x57a406[_0x1348('0x12')]){if(_0x57a406[_0x1348('0x12')][_0x1348('0x13')]===0x1f4){logger[_0x1348('0x12')](_0x1348('0xd'),_0x178014,_0x57a406[_0x1348('0x12')]['message']);return _0x3599b7(_0x57a406['error']['message']);}logger[_0x1348('0x12')](_0x1348('0xd'),_0x178014,_0x57a406['error'][_0x1348('0x14')]);return _0x5c5b08(_0x57a406[_0x1348('0x12')][_0x1348('0x14')]);}else{logger['info'](_0x1348('0xd'),_0x178014,'request\x20sent');_0x5c5b08(_0x57a406[_0x1348('0x15')]['message']);}})[_0x1348('0x16')](function(_0x3f10c3){logger[_0x1348('0x12')](_0x1348('0xd'),_0x178014,_0x3f10c3);_0x3599b7(_0x3f10c3);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 55eeda4..474edaf 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 _0x5cdf=['./jscriptyProject.controller','isAuthenticated','index','get','show','/:id/sessions','getSessions','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x198b3d,_0x4ecfbb){var _0x3b7520=function(_0x3c25c6){while(--_0x3c25c6){_0x198b3d['push'](_0x198b3d['shift']());}};_0x3b7520(++_0x4ecfbb);}(_0x5cdf,0xec));var _0xf5cd=function(_0xc6f792,_0x558bbd){_0xc6f792=_0xc6f792-0x0;var _0x5e2dfc=_0x5cdf[_0xc6f792];return _0x5e2dfc;};'use strict';var multer=require(_0xf5cd('0x0'));var util=require(_0xf5cd('0x1'));var path=require(_0xf5cd('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5cd('0x3'));var router=express[_0xf5cd('0x4')]();var fs_extra=require(_0xf5cd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf5cd('0x6'));var config=require('../../config/environment');var controller=require(_0xf5cd('0x7'));router['get']('/',auth[_0xf5cd('0x8')](),controller[_0xf5cd('0x9')]);router[_0xf5cd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf5cd('0xb')]);router[_0xf5cd('0xa')](_0xf5cd('0xc'),auth[_0xf5cd('0x8')](),controller[_0xf5cd('0xd')]);router[_0xf5cd('0xa')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xf5cd('0xa')](_0xf5cd('0xe'),auth[_0xf5cd('0x8')](),timeout(_0xf5cd('0xf')),controller[_0xf5cd('0x10')]);router[_0xf5cd('0x11')]('/',auth[_0xf5cd('0x8')](),controller[_0xf5cd('0x12')]);router['post'](_0xf5cd('0x13'),auth[_0xf5cd('0x8')](),controller[_0xf5cd('0x14')]);router[_0xf5cd('0x15')](_0xf5cd('0x16'),auth[_0xf5cd('0x8')](),controller[_0xf5cd('0x17')]);router[_0xf5cd('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xf5cd('0x19')]);module[_0xf5cd('0x1a')]=router; \ No newline at end of file +var _0xa5b3=['get','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x466f51,_0x1393ed){var _0x2db305=function(_0x126ae3){while(--_0x126ae3){_0x466f51['push'](_0x466f51['shift']());}};_0x2db305(++_0x1393ed);}(_0xa5b3,0xb0));var _0x3a5b=function(_0x4d3fdc,_0x270cd6){_0x4d3fdc=_0x4d3fdc-0x0;var _0xcfe81f=_0xa5b3[_0x4d3fdc];return _0xcfe81f;};'use strict';var multer=require(_0x3a5b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a5b('0x1'));var express=require(_0x3a5b('0x2'));var router=express['Router']();var fs_extra=require(_0x3a5b('0x3'));var auth=require(_0x3a5b('0x4'));var interaction=require(_0x3a5b('0x5'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x3a5b('0x6')](),controller[_0x3a5b('0x7')]);router[_0x3a5b('0x8')](_0x3a5b('0x9'),auth[_0x3a5b('0x6')](),controller[_0x3a5b('0xa')]);router[_0x3a5b('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x3a5b('0xb')]);router[_0x3a5b('0x8')](_0x3a5b('0xc'),auth[_0x3a5b('0x6')](),controller[_0x3a5b('0xd')]);router[_0x3a5b('0x8')](_0x3a5b('0xe'),auth[_0x3a5b('0x6')](),timeout(_0x3a5b('0xf')),controller['getSummary']);router[_0x3a5b('0x10')]('/',auth[_0x3a5b('0x6')](),controller[_0x3a5b('0x11')]);router[_0x3a5b('0x10')](_0x3a5b('0x12'),auth[_0x3a5b('0x6')](),controller[_0x3a5b('0x13')]);router['put'](_0x3a5b('0x9'),auth[_0x3a5b('0x6')](),controller[_0x3a5b('0x14')]);router[_0x3a5b('0x15')](_0x3a5b('0x9'),auth[_0x3a5b('0x6')](),controller['destroy']);module[_0x3a5b('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 09e0cf0..c9f447c 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 _0xb7c2=['sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','BOOLEAN'];(function(_0x10aa73,_0xc744f4){var _0x3496d9=function(_0x71c780){while(--_0x71c780){_0x10aa73['push'](_0x10aa73['shift']());}};_0x3496d9(++_0xc744f4);}(_0xb7c2,0x150));var _0x2b7c=function(_0x1b590a,_0x461bb6){_0x1b590a=_0x1b590a-0x0;var _0x4f695a=_0xb7c2[_0x1b590a];return _0x4f695a;};'use strict';var Sequelize=require(_0x2b7c('0x0'));var _=require(_0x2b7c('0x1'));var util=require(_0x2b7c('0x2'));module[_0x2b7c('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x2b7c('0x4')},'description':{'type':Sequelize[_0x2b7c('0x5')]},'formData':{'type':Sequelize[_0x2b7c('0x6')](_0x2b7c('0x7')),'set':function(_0x237ec9){if(_[_0x2b7c('0x8')](_0x237ec9)){this[_0x2b7c('0x9')]('formData',JSON[_0x2b7c('0xa')](_0x237ec9));}else if(_[_0x2b7c('0xb')](_0x237ec9)){this['setDataValue'](_0x2b7c('0xc'),_0x237ec9);}else{this[_0x2b7c('0x9')](_0x2b7c('0xc'),util[_0x2b7c('0xd')](_0x2b7c('0xe'),this['getDataValue'](_0x2b7c('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2b7c('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2b7c('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xcca3=['name','TEXT','long','isObjectLike','stringify','isString','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x19f0af,_0x53dbe2){var _0x3717c8=function(_0x3cf428){while(--_0x3cf428){_0x19f0af['push'](_0x19f0af['shift']());}};_0x3717c8(++_0x53dbe2);}(_0xcca3,0xb1));var _0x3cca=function(_0x449235,_0x567736){_0x449235=_0x449235-0x0;var _0x2446ad=_0xcca3[_0x449235];return _0x2446ad;};'use strict';var Sequelize=require(_0x3cca('0x0'));var _=require('lodash');var util=require('util');module[_0x3cca('0x1')]={'name':{'type':Sequelize[_0x3cca('0x2')],'unique':_0x3cca('0x3')},'description':{'type':Sequelize[_0x3cca('0x2')]},'formData':{'type':Sequelize[_0x3cca('0x4')](_0x3cca('0x5')),'set':function(_0x269a12){if(_[_0x3cca('0x6')](_0x269a12)){this['setDataValue']('formData',JSON[_0x3cca('0x7')](_0x269a12));}else if(_[_0x3cca('0x8')](_0x269a12)){this[_0x3cca('0x9')]('formData',_0x269a12);}else{this['setDataValue'](_0x3cca('0xa'),util[_0x3cca('0xb')](_0x3cca('0xc'),this[_0x3cca('0xd')](_0x3cca('0x3'))||'',this[_0x3cca('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3cca('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3cca('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 740405f..780d243 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 _0x8721=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','nolimit','number','indexOf','toString','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','moment','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x319a03,_0x4456d4){var _0x3b6704=function(_0x1f3476){while(--_0x1f3476){_0x319a03['push'](_0x319a03['shift']());}};_0x3b6704(++_0x4456d4);}(_0x8721,0xd9));var _0x1872=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x8721[_0x1034ca];return _0x1a023a;};'use strict';var emlformat=require(_0x1872('0x0'));var rimraf=require(_0x1872('0x1'));var zipdir=require(_0x1872('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1872('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1872('0x4'));var sox=require(_0x1872('0x5'));var csv=require(_0x1872('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1872('0x7'));var squel=require(_0x1872('0x8'));var crypto=require(_0x1872('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1872('0xa'));var toCsv=require(_0x1872('0x6'));var querystring=require(_0x1872('0xb'));var Papa=require(_0x1872('0xc'));var Redis=require(_0x1872('0xd'));var authService=require(_0x1872('0xe'));var qs=require(_0x1872('0xf'));var as=require(_0x1872('0x10'));var hardwareService=require(_0x1872('0x11'));var logger=require(_0x1872('0x12'))(_0x1872('0x13'));var utils=require('../../config/utils');var config=require(_0x1872('0x14'));var licenseUtil=require(_0x1872('0x15'));var db=require(_0x1872('0x16'))['db'];function respondWithStatusCode(_0x4345d0,_0x5122df){_0x5122df=_0x5122df||0xcc;return function(_0x412663){if(_0x412663){return _0x4345d0[_0x1872('0x17')](_0x5122df);}return _0x4345d0[_0x1872('0x18')](_0x5122df)[_0x1872('0x19')]();};}function respondWithResult(_0x4d943c,_0x4df475){_0x4df475=_0x4df475||0xc8;return function(_0xe47f69){if(_0xe47f69){return _0x4d943c[_0x1872('0x18')](_0x4df475)[_0x1872('0x1a')](_0xe47f69);}};}function respondWithFilteredResult(_0x40ee43,_0x1ffc89){return function(_0x5662e6){if(_0x5662e6){var _0x4be58a=typeof _0x1ffc89['offset']===_0x1872('0x1b')&&typeof _0x1ffc89[_0x1872('0x1c')]===_0x1872('0x1b');var _0x47f15f=_0x5662e6[_0x1872('0x1d')];var _0x487791=_0x4be58a?0x0:_0x1ffc89[_0x1872('0x1e')];var _0x34899d=_0x4be58a?_0x5662e6[_0x1872('0x1d')]:_0x1ffc89['offset']+_0x1ffc89[_0x1872('0x1c')];var _0x5a0483;if(_0x34899d>=_0x47f15f){_0x34899d=_0x47f15f;_0x5a0483=0xc8;}else{_0x5a0483=0xce;}_0x40ee43[_0x1872('0x18')](_0x5a0483);return _0x40ee43[_0x1872('0x1f')](_0x1872('0x20'),_0x487791+'-'+_0x34899d+'/'+_0x47f15f)[_0x1872('0x1a')](_0x5662e6);}return null;};}function patchUpdates(_0x15dbbc){return function(_0x506a44){try{jsonpatch[_0x1872('0x21')](_0x506a44,_0x15dbbc,!![]);}catch(_0x18ff91){return BPromise[_0x1872('0x22')](_0x18ff91);}return _0x506a44[_0x1872('0x23')]();};}function saveUpdates(_0xcc4221,_0x3142f8){return function(_0x1fc33f){if(_0x1fc33f){return _0x1fc33f[_0x1872('0x24')](_0xcc4221)[_0x1872('0x25')](function(_0x4908bf){return _0x4908bf;});}return null;};}function removeEntity(_0x54e059,_0x5f29f5){return function(_0x42e0e4){if(_0x42e0e4){return _0x42e0e4[_0x1872('0x26')]()[_0x1872('0x25')](function(){var _0x32499a=_0x42e0e4['get']({'plain':!![]});var _0x323592=_0x1872('0x27');return db[_0x1872('0x28')]['destroy']({'where':{'type':_0x323592,'resourceId':_0x32499a['id']}})[_0x1872('0x25')](function(){return _0x42e0e4;});})['then'](function(){_0x54e059[_0x1872('0x18')](0xcc)[_0x1872('0x19')]();});}};}function handleEntityNotFound(_0x38a335,_0x5aaca0){return function(_0x430b95){if(!_0x430b95){_0x38a335[_0x1872('0x17')](0x194);}return _0x430b95;};}function handleError(_0x57c3c2,_0x4dca12){_0x4dca12=_0x4dca12||0x1f4;return function(_0x33448e){logger['error'](_0x33448e['stack']);if(_0x33448e[_0x1872('0x29')]){delete _0x33448e['name'];}_0x57c3c2[_0x1872('0x18')](_0x4dca12)[_0x1872('0x2a')](_0x33448e);};}exports['index']=function(_0x100271,_0x2887fb){var _0x30ad4f={},_0x558234={},_0x221ac8={'count':0x0,'rows':[]};var _0x903d29=_[_0x1872('0x2b')](db[_0x1872('0x2c')][_0x1872('0x2d')],function(_0x4da00c){return{'name':_0x4da00c[_0x1872('0x2e')],'type':_0x4da00c[_0x1872('0x2f')][_0x1872('0x30')]};});_0x558234[_0x1872('0x31')]=_[_0x1872('0x2b')](_0x903d29,_0x1872('0x29'));_0x558234['query']=_[_0x1872('0x32')](_0x100271[_0x1872('0x33')]);_0x558234[_0x1872('0x34')]=_[_0x1872('0x35')](_0x558234[_0x1872('0x31')],_0x558234[_0x1872('0x33')]);_0x30ad4f[_0x1872('0x36')]=_[_0x1872('0x35')](_0x558234['model'],qs['fields'](_0x100271[_0x1872('0x33')][_0x1872('0x37')]));_0x30ad4f[_0x1872('0x36')]=_0x30ad4f[_0x1872('0x36')][_0x1872('0x38')]?_0x30ad4f[_0x1872('0x36')]:_0x558234['model'];if(!_0x100271[_0x1872('0x33')][_0x1872('0x39')]('nolimit')){_0x30ad4f['limit']=qs['limit'](_0x100271[_0x1872('0x33')][_0x1872('0x1c')]);_0x30ad4f[_0x1872('0x1e')]=qs['offset'](_0x100271[_0x1872('0x33')][_0x1872('0x1e')]);}_0x30ad4f[_0x1872('0x3a')]=qs[_0x1872('0x3b')](_0x100271[_0x1872('0x33')][_0x1872('0x3b')]);_0x30ad4f['where']=qs[_0x1872('0x34')](_[_0x1872('0x3c')](_0x100271[_0x1872('0x33')],_0x558234[_0x1872('0x34')]),_0x903d29);if(_0x100271[_0x1872('0x33')][_0x1872('0x3d')]){_0x30ad4f[_0x1872('0x3e')]=_[_0x1872('0x3f')](_0x30ad4f['where'],{'$or':_[_0x1872('0x2b')](_0x903d29,function(_0x2f5af2){if(_0x2f5af2[_0x1872('0x2f')]!=='VIRTUAL'){var _0x1b0b19={};_0x1b0b19[_0x2f5af2[_0x1872('0x29')]]={'$like':'%'+_0x100271['query'][_0x1872('0x3d')]+'%'};return _0x1b0b19;}})});}_0x30ad4f=_[_0x1872('0x3f')]({},_0x30ad4f,_0x100271[_0x1872('0x40')]);var _0x536fee={'where':_0x30ad4f[_0x1872('0x3e')]};return db['JscriptyProject'][_0x1872('0x1d')](_0x536fee)[_0x1872('0x25')](function(_0x466e8a){_0x221ac8['count']=_0x466e8a;if(_0x100271[_0x1872('0x33')][_0x1872('0x41')]){_0x30ad4f[_0x1872('0x42')]=[{'all':!![]}];}return db[_0x1872('0x2c')][_0x1872('0x43')](_0x30ad4f);})[_0x1872('0x25')](function(_0x857b68){_0x221ac8[_0x1872('0x44')]=_0x857b68;return _0x221ac8;})[_0x1872('0x25')](respondWithFilteredResult(_0x2887fb,_0x30ad4f))['catch'](handleError(_0x2887fb,null));};exports[_0x1872('0x45')]=function(_0xe19db8,_0x344c9d){var _0x44d55f={'raw':![],'where':{'id':_0xe19db8[_0x1872('0x46')]['id']}},_0x3952df={};_0x3952df[_0x1872('0x31')]=_['keys'](db['JscriptyProject'][_0x1872('0x2d')]);_0x3952df[_0x1872('0x33')]=_[_0x1872('0x32')](_0xe19db8[_0x1872('0x33')]);_0x3952df['filters']=_['intersection'](_0x3952df['model'],_0x3952df['query']);_0x44d55f[_0x1872('0x36')]=_['intersection'](_0x3952df[_0x1872('0x31')],qs[_0x1872('0x37')](_0xe19db8['query'][_0x1872('0x37')]));_0x44d55f[_0x1872('0x36')]=_0x44d55f['attributes'][_0x1872('0x38')]?_0x44d55f[_0x1872('0x36')]:_0x3952df['model'];if(_0xe19db8[_0x1872('0x33')][_0x1872('0x41')]){_0x44d55f[_0x1872('0x42')]=[{'all':!![]}];}_0x44d55f=_[_0x1872('0x3f')]({},_0x44d55f,_0xe19db8[_0x1872('0x40')]);return db[_0x1872('0x2c')][_0x1872('0x47')](_0x44d55f)[_0x1872('0x25')](handleEntityNotFound(_0x344c9d,null))['then'](respondWithResult(_0x344c9d,null))['catch'](handleError(_0x344c9d,null));};exports[_0x1872('0x48')]=function(_0x1b555f,_0x3e985e){return db['JscriptyProject'][_0x1872('0x48')](_0x1b555f[_0x1872('0x49')],{})[_0x1872('0x25')](function(_0x11f223){var _0xb31664=_0x1b555f['user'][_0x1872('0x4a')]({'plain':!![]});if(!_0xb31664)throw new Error(_0x1872('0x4b'));if(_0xb31664[_0x1872('0x4c')]===_0x1872('0x4d')){var _0x3fc8c2=_0x11f223['get']({'plain':!![]});var _0x3a6edb=_0x1872('0x27');return db[_0x1872('0x4e')][_0x1872('0x47')]({'where':{'name':_0x3a6edb,'userProfileId':_0xb31664[_0x1872('0x4f')]},'raw':!![]})[_0x1872('0x25')](function(_0x1268a3){if(_0x1268a3&&_0x1268a3[_0x1872('0x50')]===0x0){return db[_0x1872('0x28')]['create']({'name':_0x3fc8c2[_0x1872('0x29')],'resourceId':_0x3fc8c2['id'],'type':_0x1268a3[_0x1872('0x29')],'sectionId':_0x1268a3['id']},{})[_0x1872('0x25')](function(){return _0x11f223;});}else{return _0x11f223;}})[_0x1872('0x51')](function(_0x340570){logger[_0x1872('0x52')](_0x1872('0x53'),_0x340570);throw _0x340570;});}return _0x11f223;})['then'](respondWithResult(_0x3e985e,0xc9))['catch'](handleError(_0x3e985e,null));};exports[_0x1872('0x54')]=function(_0x3145b1,_0x1c3850){var _0x5e4e53={'where':{'id':_0x3145b1[_0x1872('0x46')]['id']}},_0x25004c={};_0x25004c[_0x1872('0x31')]=_[_0x1872('0x32')](db[_0x1872('0x2c')][_0x1872('0x2d')]);_0x5e4e53[_0x1872('0x36')]=_[_0x1872('0x35')](_0x25004c['model'],qs[_0x1872('0x37')](_0x3145b1['query'][_0x1872('0x37')]));_0x5e4e53[_0x1872('0x36')]=_0x5e4e53[_0x1872('0x36')]['length']?_0x5e4e53[_0x1872('0x36')]:_0x25004c['model'];if(_0x3145b1[_0x1872('0x33')]['includeAll']){_0x5e4e53['include']=[{'all':!![]}];}_0x5e4e53=_[_0x1872('0x3f')]({},_0x5e4e53,_0x3145b1[_0x1872('0x40')]);return db[_0x1872('0x2c')][_0x1872('0x47')](_0x5e4e53)['then'](handleEntityNotFound(_0x1c3850,null))[_0x1872('0x25')](function(_0x1beaf4){if(_0x1beaf4){var _0x341209=_0x1beaf4[_0x1872('0x4a')]({'plain':!![]});_0x341209=qs[_0x1872('0x55')](_0x341209,['id',_0x1872('0x56'),_0x1872('0x57')]);_0x3145b1[_0x1872('0x49')]=_[_0x1872('0x55')](_0x3145b1[_0x1872('0x49')],['id',_0x1872('0x56'),_0x1872('0x57')]);return db[_0x1872('0x2c')][_0x1872('0x48')](_[_0x1872('0x3f')](_0x341209,_0x3145b1[_0x1872('0x49')]),{'include':_0x3145b1[_0x1872('0x33')][_0x1872('0x41')]?[{'all':!![]}]:undefined})[_0x1872('0x25')](function(_0x1c3a86){var _0x185bb3=_0x3145b1[_0x1872('0x4d')][_0x1872('0x4a')]({'plain':!![]});if(!_0x185bb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x185bb3[_0x1872('0x4c')]==='user'){var _0x2dcb83=_0x1c3a86['get']({'plain':!![]});var _0x50a211=_0x1872('0x27');return db[_0x1872('0x4e')][_0x1872('0x47')]({'where':{'name':_0x50a211,'userProfileId':_0x185bb3[_0x1872('0x4f')]},'raw':!![]})[_0x1872('0x25')](function(_0x51c0d9){if(_0x51c0d9&&_0x51c0d9[_0x1872('0x50')]===0x0){return db[_0x1872('0x28')][_0x1872('0x48')]({'name':_0x2dcb83[_0x1872('0x29')],'resourceId':_0x2dcb83['id'],'type':_0x51c0d9[_0x1872('0x29')],'sectionId':_0x51c0d9['id']},{})['then'](function(){return _0x1c3a86;});}else{return _0x1c3a86;}})[_0x1872('0x51')](function(_0x4928db){logger[_0x1872('0x52')](_0x1872('0x53'),_0x4928db);throw _0x4928db;});}return _0x1c3a86;});}})[_0x1872('0x25')](respondWithResult(_0x1c3850,0xc9))[_0x1872('0x51')](handleError(_0x1c3850,null));};exports[_0x1872('0x24')]=function(_0x36d3ee,_0x2f0697){if(_0x36d3ee[_0x1872('0x49')]['id']){delete _0x36d3ee['body']['id'];}return db[_0x1872('0x2c')][_0x1872('0x47')]({'where':{'id':_0x36d3ee['params']['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x2f0697,null))['then'](saveUpdates(_0x36d3ee[_0x1872('0x49')],null))['then'](respondWithResult(_0x2f0697,null))[_0x1872('0x51')](handleError(_0x2f0697,null));};exports[_0x1872('0x26')]=function(_0x2d774d,_0x51eec3){return db['JscriptyProject']['find']({'where':{'id':_0x2d774d[_0x1872('0x46')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x51eec3,null))['then'](removeEntity(_0x51eec3,null))[_0x1872('0x51')](handleError(_0x51eec3,null));};exports[_0x1872('0x58')]=function(_0x135b28,_0x273f86,_0x149470){var _0x20e06c={'raw':!![],'where':{}};var _0x53bf87={};var _0x1897fe={'count':0x0,'rows':[]};return db[_0x1872('0x2c')][_0x1872('0x59')]({'where':{'id':_0x135b28[_0x1872('0x46')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x273f86,null))[_0x1872('0x25')](function(_0xa2c346){if(_0xa2c346){_0x53bf87[_0x1872('0x31')]=_[_0x1872('0x32')](db[_0x1872('0x5a')][_0x1872('0x2d')]);_0x53bf87[_0x1872('0x33')]=_[_0x1872('0x32')](_0x135b28[_0x1872('0x33')]);_0x53bf87[_0x1872('0x34')]=_[_0x1872('0x35')](_0x53bf87[_0x1872('0x31')],_0x53bf87['query']);_0x20e06c['attributes']=_[_0x1872('0x35')](_0x53bf87[_0x1872('0x31')],qs[_0x1872('0x37')](_0x135b28['query'][_0x1872('0x37')]));_0x20e06c['attributes']=_0x20e06c['attributes'][_0x1872('0x38')]?_0x20e06c['attributes']:_0x53bf87[_0x1872('0x31')];if(!_0x135b28['query'][_0x1872('0x39')]('nolimit')){_0x20e06c[_0x1872('0x1c')]=qs[_0x1872('0x1c')](_0x135b28[_0x1872('0x33')][_0x1872('0x1c')]);_0x20e06c[_0x1872('0x1e')]=qs[_0x1872('0x1e')](_0x135b28[_0x1872('0x33')][_0x1872('0x1e')]);}_0x20e06c[_0x1872('0x3a')]=qs['sort'](_0x135b28[_0x1872('0x33')][_0x1872('0x3b')]);_0x20e06c[_0x1872('0x3e')]=qs[_0x1872('0x34')](_[_0x1872('0x3c')](_0x135b28[_0x1872('0x33')],_0x53bf87[_0x1872('0x34')]));_0x20e06c[_0x1872('0x3e')][_0x1872('0x5b')]=_0xa2c346['id'];if(_0x135b28[_0x1872('0x33')][_0x1872('0x3d')]){_0x20e06c[_0x1872('0x3e')]=_[_0x1872('0x3f')](_0x20e06c[_0x1872('0x3e')],{'$or':_['map'](_0x20e06c['attributes'],function(_0x5070e3){var _0x408362={};_0x408362[_0x5070e3]={'$like':'%'+_0x135b28['query'][_0x1872('0x3d')]+'%'};return _0x408362;})});}_0x20e06c=_[_0x1872('0x3f')]({},_0x20e06c,_0x135b28[_0x1872('0x40')]);return db[_0x1872('0x5a')]['count']({'where':_0x20e06c[_0x1872('0x3e')]})[_0x1872('0x25')](function(_0x2e984f){_0x1897fe['count']=_0x2e984f;if(_0x135b28[_0x1872('0x33')]['includeAll']){_0x20e06c[_0x1872('0x42')]=[{'all':!![]}];}return db[_0x1872('0x5a')][_0x1872('0x43')](_0x20e06c);})[_0x1872('0x25')](function(_0x546f0d){_0x1897fe['rows']=_0x546f0d;return _0x1897fe;});}})[_0x1872('0x25')](respondWithFilteredResult(_0x273f86,_0x20e06c))[_0x1872('0x51')](handleError(_0x273f86,null));};exports[_0x1872('0x5c')]=function(_0x4e616d,_0x5b69b9,_0x5ab90c){var _0xcaa4a2={'raw':!![],'where':{}};var _0x2af64e={};var _0x1216af={'count':0x0,'rows':[]};return db[_0x1872('0x2c')][_0x1872('0x59')]({'where':{'id':_0x4e616d[_0x1872('0x46')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x5b69b9,null))[_0x1872('0x25')](function(_0x234ed0){if(_0x234ed0){_0x2af64e[_0x1872('0x31')]=_[_0x1872('0x32')](db[_0x1872('0x5d')][_0x1872('0x2d')]);_0x2af64e[_0x1872('0x33')]=_[_0x1872('0x32')](_0x4e616d[_0x1872('0x33')]);_0x2af64e['filters']=_[_0x1872('0x35')](_0x2af64e[_0x1872('0x31')],_0x2af64e[_0x1872('0x33')]);_0xcaa4a2[_0x1872('0x36')]=_[_0x1872('0x35')](_0x2af64e[_0x1872('0x31')],qs[_0x1872('0x37')](_0x4e616d['query'][_0x1872('0x37')]));_0xcaa4a2['attributes']=_0xcaa4a2[_0x1872('0x36')]['length']?_0xcaa4a2[_0x1872('0x36')]:_0x2af64e['model'];if(!_0x4e616d[_0x1872('0x33')]['hasOwnProperty'](_0x1872('0x5e'))){_0xcaa4a2['limit']=qs[_0x1872('0x1c')](_0x4e616d[_0x1872('0x33')]['limit']);_0xcaa4a2[_0x1872('0x1e')]=qs[_0x1872('0x1e')](_0x4e616d[_0x1872('0x33')][_0x1872('0x1e')]);}_0xcaa4a2[_0x1872('0x3a')]=qs['sort'](_0x4e616d[_0x1872('0x33')][_0x1872('0x3b')]);_0xcaa4a2[_0x1872('0x3e')]=qs[_0x1872('0x34')](_[_0x1872('0x3c')](_0x4e616d['query'],_0x2af64e['filters']));_0xcaa4a2[_0x1872('0x3e')]['ProjectId']=_0x234ed0['id'];if(_0x4e616d['query'][_0x1872('0x3d')]){_0xcaa4a2[_0x1872('0x3e')]=_[_0x1872('0x3f')](_0xcaa4a2['where'],{'$or':_[_0x1872('0x2b')](_0xcaa4a2[_0x1872('0x36')],function(_0x40075d){var _0x239275={};_0x239275[_0x40075d]={'$like':'%'+_0x4e616d[_0x1872('0x33')][_0x1872('0x3d')]+'%'};return _0x239275;})});}_0xcaa4a2=_[_0x1872('0x3f')]({},_0xcaa4a2,_0x4e616d[_0x1872('0x40')]);return db[_0x1872('0x5d')][_0x1872('0x1d')]({'where':_0xcaa4a2[_0x1872('0x3e')]})['then'](function(_0x5c299c){_0x1216af[_0x1872('0x1d')]=_0x5c299c;if(_0x4e616d[_0x1872('0x33')]['includeAll']){_0xcaa4a2[_0x1872('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0xcaa4a2);})[_0x1872('0x25')](function(_0x1324f6){_0x1216af[_0x1872('0x44')]=_0x1324f6;return _0x1216af;});}})[_0x1872('0x25')](respondWithFilteredResult(_0x5b69b9,_0xcaa4a2))[_0x1872('0x51')](handleError(_0x5b69b9,null));};function char(_0x19a180){return _0x1872('0x5f')===typeof _0x19a180?String['fromCharCode'][_0x1872('0x21')](null,arguments):_0x19a180;}function needsEncapsulation(_0x3d1cbe){return!!_0x3d1cbe&&(_0x3d1cbe['toString']()[_0x1872('0x60')](char(0xd))>=0x0||_0x3d1cbe[_0x1872('0x61')]()[_0x1872('0x60')](char(0xa))>=0x0||_0x3d1cbe[_0x1872('0x61')]()['indexOf'](char(0x2c))>=0x0||_0x3d1cbe[_0x1872('0x61')]()[_0x1872('0x60')](char(0x22))>=0x0);}function encapsulate(_0x53482a){var _0x16b10e=char(0x22),_0x1dd15c='\x5c'+char(0x22),_0x4eacb8=_0x53482a['toString']()['replace'](new RegExp(_0x16b10e,'g'),_0x1dd15c);return _0x16b10e+_0x4eacb8+_0x16b10e;}exports['getSummary']=function(_0x475313,_0x786cc6,_0x18bd15){var _0x28a405,_0x554fd5;var _0x34ccef={'where':{'ProjectId':_0x475313['params']['id']}};if(_0x475313[_0x1872('0x33')][_0x1872('0x62')]){_0x34ccef['where'][_0x1872('0x63')]=JSON['parse'](_0x475313['query'][_0x1872('0x62')]);}return db['JscriptySessionReport'][_0x1872('0x43')](_0x34ccef)[_0x1872('0x25')](handleEntityNotFound(_0x786cc6,null))[_0x1872('0x25')](function(_0x1084a4){if(_0x1084a4){_0x28a405=_0x1084a4;return db[_0x1872('0x64')][_0x1872('0x43')]({'where':{'SessionId':{'$in':_[_0x1872('0x2b')](_0x28a405,'id')},'ProjectId':_0x475313[_0x1872('0x46')]['id']},'order':_0x1872('0x65')});}})['then'](handleEntityNotFound(_0x786cc6,null))[_0x1872('0x25')](function(_0x12c20c){if(_0x12c20c){_0x554fd5=_0x12c20c;var _0x3592e2={};for(var _0x258eb7=0x0,_0x1a8f1e=_0x554fd5[_0x1872('0x38')];_0x258eb7<_0x1a8f1e;_0x258eb7++){if(!_0x3592e2[_0x1872('0x39')](_0x554fd5[_0x258eb7]['questionId'])){_0x3592e2[_0x554fd5[_0x258eb7][_0x1872('0x66')]]=needsEncapsulation(_0x554fd5[_0x258eb7][_0x1872('0x67')])?encapsulate(_0x554fd5[_0x258eb7][_0x1872('0x67')]):_0x554fd5[_0x258eb7][_0x1872('0x67')];}}var _0x47b7ea=[],_0x37a340={};for(var _0x266aad=0x0,_0x3c75dd=_0x28a405[_0x1872('0x38')];_0x266aad<_0x3c75dd;_0x266aad++){_0x37a340={'ProjectId':_0x475313[_0x1872('0x46')]['id'],'SessionId':_0x28a405[_0x266aad]['id'],'StartTime':moment(_0x28a405[_0x266aad][_0x1872('0x63')])['format'](_0x1872('0x68'))};for(var _0x339b09=0x0,_0x8d0ef6=_0x554fd5[_0x1872('0x38')];_0x339b09<_0x8d0ef6;_0x339b09++){if(_0x554fd5[_0x339b09][_0x1872('0x69')]==_0x28a405[_0x266aad]['id']&&_0x3592e2['hasOwnProperty'](_0x554fd5[_0x339b09]['questionId'])){_0x37a340[_0x3592e2[_0x554fd5[_0x339b09][_0x1872('0x66')]]]=_0x554fd5[_0x339b09]['answer'];}}for(var _0xc91799 in _0x3592e2){if(!_0x37a340[_0x1872('0x39')](_0x3592e2[_0xc91799])){_0x37a340[_0x3592e2[_0xc91799]]=null;}}_0x47b7ea['push'](_0x37a340);}return _0x47b7ea;}})[_0x1872('0x25')](function(_0x170a63){if(!_[_0x1872('0x6a')](_0x170a63)){var _0x125004=toCsv(_0x170a63);var _0x58e45c=Date[_0x1872('0x6b')]();fs[_0x1872('0x6c')](util[_0x1872('0x6d')](_0x1872('0x6e'),_0x475313[_0x1872('0x46')]['id'],_0x58e45c),_0x125004);_0x786cc6['setHeader'](_0x1872('0x6f'),_0x1872('0x70')+util[_0x1872('0x6d')](_0x1872('0x71'),_0x475313[_0x1872('0x46')]['id'],_0x58e45c));_0x786cc6[_0x1872('0x72')](_0x1872('0x73'),_0x1872('0x74'));return _0x786cc6[_0x1872('0x75')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x475313['params']['id'],_0x58e45c));}else{return _0x786cc6[_0x1872('0x17')](0xcc);}})[_0x1872('0x51')](handleError(_0x786cc6,null));}; \ No newline at end of file +var _0x6bc4=['now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','name','index','JscriptyProject','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','ProjectId','JscriptySessionReport','findAll','rows','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','parse','startTime','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty'];(function(_0x5b6103,_0x4e4021){var _0x172960=function(_0xfd3a97){while(--_0xfd3a97){_0x5b6103['push'](_0x5b6103['shift']());}};_0x172960(++_0x4e4021);}(_0x6bc4,0x164));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46bc('0x1'));var rp=require(_0x46bc('0x2'));var moment=require(_0x46bc('0x3'));var BPromise=require(_0x46bc('0x4'));var Mustache=require(_0x46bc('0x5'));var util=require(_0x46bc('0x6'));var path=require('path');var sox=require(_0x46bc('0x7'));var csv=require(_0x46bc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46bc('0x9'));var _=require(_0x46bc('0xa'));var squel=require(_0x46bc('0xb'));var crypto=require(_0x46bc('0xc'));var jsforce=require(_0x46bc('0xd'));var deskjs=require(_0x46bc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x46bc('0xf'));var Papa=require(_0x46bc('0x10'));var Redis=require('ioredis');var authService=require(_0x46bc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x46bc('0x12'));var hardwareService=require(_0x46bc('0x13'));var logger=require('../../config/logger')(_0x46bc('0x14'));var utils=require(_0x46bc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x46bc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16daad,_0x21f3d1){_0x21f3d1=_0x21f3d1||0xcc;return function(_0x873a1a){if(_0x873a1a){return _0x16daad['sendStatus'](_0x21f3d1);}return _0x16daad[_0x46bc('0x17')](_0x21f3d1)[_0x46bc('0x18')]();};}function respondWithResult(_0x4234bd,_0x127f4b){_0x127f4b=_0x127f4b||0xc8;return function(_0x4ef996){if(_0x4ef996){return _0x4234bd[_0x46bc('0x17')](_0x127f4b)[_0x46bc('0x19')](_0x4ef996);}};}function respondWithFilteredResult(_0x442713,_0x55707a){return function(_0x3059fe){if(_0x3059fe){var _0x4f9d8b=typeof _0x55707a[_0x46bc('0x1a')]===_0x46bc('0x1b')&&typeof _0x55707a[_0x46bc('0x1c')]===_0x46bc('0x1b');var _0x42db36=_0x3059fe[_0x46bc('0x1d')];var _0x1da0ce=_0x4f9d8b?0x0:_0x55707a[_0x46bc('0x1a')];var _0x4e931f=_0x4f9d8b?_0x3059fe[_0x46bc('0x1d')]:_0x55707a[_0x46bc('0x1a')]+_0x55707a[_0x46bc('0x1c')];var _0x40942b;if(_0x4e931f>=_0x42db36){_0x4e931f=_0x42db36;_0x40942b=0xc8;}else{_0x40942b=0xce;}_0x442713['status'](_0x40942b);return _0x442713[_0x46bc('0x1e')](_0x46bc('0x1f'),_0x1da0ce+'-'+_0x4e931f+'/'+_0x42db36)[_0x46bc('0x19')](_0x3059fe);}return null;};}function patchUpdates(_0x1b89bc){return function(_0x4b5cdc){try{jsonpatch[_0x46bc('0x20')](_0x4b5cdc,_0x1b89bc,!![]);}catch(_0x18a638){return BPromise[_0x46bc('0x21')](_0x18a638);}return _0x4b5cdc[_0x46bc('0x22')]();};}function saveUpdates(_0x5b167c,_0x36ddf4){return function(_0x3dfb9e){if(_0x3dfb9e){return _0x3dfb9e[_0x46bc('0x23')](_0x5b167c)[_0x46bc('0x24')](function(_0x49d96c){return _0x49d96c;});}return null;};}function removeEntity(_0x3716d4,_0x4ba53b){return function(_0x13d7be){if(_0x13d7be){return _0x13d7be[_0x46bc('0x25')]()['then'](function(){var _0x23872b=_0x13d7be[_0x46bc('0x26')]({'plain':!![]});var _0x1fe9b5=_0x46bc('0x27');return db[_0x46bc('0x28')][_0x46bc('0x25')]({'where':{'type':_0x1fe9b5,'resourceId':_0x23872b['id']}})[_0x46bc('0x24')](function(){return _0x13d7be;});})[_0x46bc('0x24')](function(){_0x3716d4['status'](0xcc)[_0x46bc('0x18')]();});}};}function handleEntityNotFound(_0x1c5407,_0x27c1cd){return function(_0x4550a9){if(!_0x4550a9){_0x1c5407[_0x46bc('0x29')](0x194);}return _0x4550a9;};}function handleError(_0x1b91a8,_0x607ed){_0x607ed=_0x607ed||0x1f4;return function(_0x48d3c9){logger['error'](_0x48d3c9[_0x46bc('0x2a')]);if(_0x48d3c9[_0x46bc('0x2b')]){delete _0x48d3c9[_0x46bc('0x2b')];}_0x1b91a8['status'](_0x607ed)['send'](_0x48d3c9);};}exports[_0x46bc('0x2c')]=function(_0x5c0a06,_0x852d55){var _0x46d2e2={},_0x723c2b={},_0x242a11={'count':0x0,'rows':[]};var _0x51963e=_['map'](db[_0x46bc('0x2d')][_0x46bc('0x2e')],function(_0x489d35){return{'name':_0x489d35[_0x46bc('0x2f')],'type':_0x489d35[_0x46bc('0x30')]['key']};});_0x723c2b[_0x46bc('0x31')]=_[_0x46bc('0x32')](_0x51963e,_0x46bc('0x2b'));_0x723c2b[_0x46bc('0x33')]=_[_0x46bc('0x34')](_0x5c0a06[_0x46bc('0x33')]);_0x723c2b[_0x46bc('0x35')]=_[_0x46bc('0x36')](_0x723c2b['model'],_0x723c2b[_0x46bc('0x33')]);_0x46d2e2[_0x46bc('0x37')]=_['intersection'](_0x723c2b[_0x46bc('0x31')],qs[_0x46bc('0x38')](_0x5c0a06[_0x46bc('0x33')][_0x46bc('0x38')]));_0x46d2e2[_0x46bc('0x37')]=_0x46d2e2[_0x46bc('0x37')][_0x46bc('0x39')]?_0x46d2e2[_0x46bc('0x37')]:_0x723c2b[_0x46bc('0x31')];if(!_0x5c0a06[_0x46bc('0x33')][_0x46bc('0x3a')]('nolimit')){_0x46d2e2[_0x46bc('0x1c')]=qs[_0x46bc('0x1c')](_0x5c0a06['query']['limit']);_0x46d2e2['offset']=qs[_0x46bc('0x1a')](_0x5c0a06[_0x46bc('0x33')][_0x46bc('0x1a')]);}_0x46d2e2[_0x46bc('0x3b')]=qs['sort'](_0x5c0a06['query'][_0x46bc('0x3c')]);_0x46d2e2[_0x46bc('0x3d')]=qs[_0x46bc('0x35')](_[_0x46bc('0x3e')](_0x5c0a06[_0x46bc('0x33')],_0x723c2b[_0x46bc('0x35')]),_0x51963e);if(_0x5c0a06[_0x46bc('0x33')][_0x46bc('0x3f')]){_0x46d2e2[_0x46bc('0x3d')]=_[_0x46bc('0x40')](_0x46d2e2[_0x46bc('0x3d')],{'$or':_[_0x46bc('0x32')](_0x51963e,function(_0x4c40c3){if(_0x4c40c3['type']!==_0x46bc('0x41')){var _0x3c16a6={};_0x3c16a6[_0x4c40c3[_0x46bc('0x2b')]]={'$like':'%'+_0x5c0a06[_0x46bc('0x33')][_0x46bc('0x3f')]+'%'};return _0x3c16a6;}})});}_0x46d2e2=_[_0x46bc('0x40')]({},_0x46d2e2,_0x5c0a06[_0x46bc('0x42')]);var _0xcd6500={'where':_0x46d2e2[_0x46bc('0x3d')]};return db[_0x46bc('0x2d')][_0x46bc('0x1d')](_0xcd6500)[_0x46bc('0x24')](function(_0x1494f2){_0x242a11[_0x46bc('0x1d')]=_0x1494f2;if(_0x5c0a06[_0x46bc('0x33')][_0x46bc('0x43')]){_0x46d2e2[_0x46bc('0x44')]=[{'all':!![]}];}return db[_0x46bc('0x2d')]['findAll'](_0x46d2e2);})[_0x46bc('0x24')](function(_0x21c24d){_0x242a11['rows']=_0x21c24d;return _0x242a11;})[_0x46bc('0x24')](respondWithFilteredResult(_0x852d55,_0x46d2e2))[_0x46bc('0x45')](handleError(_0x852d55,null));};exports[_0x46bc('0x46')]=function(_0x4c1e8b,_0x1e8685){var _0xc8ae19={'raw':![],'where':{'id':_0x4c1e8b[_0x46bc('0x47')]['id']}},_0x58b2b2={};_0x58b2b2[_0x46bc('0x31')]=_['keys'](db['JscriptyProject'][_0x46bc('0x2e')]);_0x58b2b2[_0x46bc('0x33')]=_['keys'](_0x4c1e8b['query']);_0x58b2b2[_0x46bc('0x35')]=_[_0x46bc('0x36')](_0x58b2b2[_0x46bc('0x31')],_0x58b2b2[_0x46bc('0x33')]);_0xc8ae19[_0x46bc('0x37')]=_[_0x46bc('0x36')](_0x58b2b2['model'],qs['fields'](_0x4c1e8b[_0x46bc('0x33')][_0x46bc('0x38')]));_0xc8ae19[_0x46bc('0x37')]=_0xc8ae19[_0x46bc('0x37')][_0x46bc('0x39')]?_0xc8ae19[_0x46bc('0x37')]:_0x58b2b2[_0x46bc('0x31')];if(_0x4c1e8b[_0x46bc('0x33')][_0x46bc('0x43')]){_0xc8ae19['include']=[{'all':!![]}];}_0xc8ae19=_[_0x46bc('0x40')]({},_0xc8ae19,_0x4c1e8b[_0x46bc('0x42')]);return db[_0x46bc('0x2d')]['find'](_0xc8ae19)[_0x46bc('0x24')](handleEntityNotFound(_0x1e8685,null))[_0x46bc('0x24')](respondWithResult(_0x1e8685,null))[_0x46bc('0x45')](handleError(_0x1e8685,null));};exports[_0x46bc('0x48')]=function(_0x3f7fbb,_0x5b9c92){return db['JscriptyProject']['create'](_0x3f7fbb[_0x46bc('0x49')],{})[_0x46bc('0x24')](function(_0x31af37){var _0x216a73=_0x3f7fbb[_0x46bc('0x4a')]['get']({'plain':!![]});if(!_0x216a73)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x216a73[_0x46bc('0x4b')]===_0x46bc('0x4a')){var _0x2b275f=_0x31af37['get']({'plain':!![]});var _0x4853d3=_0x46bc('0x27');return db[_0x46bc('0x4c')][_0x46bc('0x4d')]({'where':{'name':_0x4853d3,'userProfileId':_0x216a73[_0x46bc('0x4e')]},'raw':!![]})[_0x46bc('0x24')](function(_0x4ad406){if(_0x4ad406&&_0x4ad406[_0x46bc('0x4f')]===0x0){return db[_0x46bc('0x28')][_0x46bc('0x48')]({'name':_0x2b275f[_0x46bc('0x2b')],'resourceId':_0x2b275f['id'],'type':_0x4ad406[_0x46bc('0x2b')],'sectionId':_0x4ad406['id']},{})[_0x46bc('0x24')](function(){return _0x31af37;});}else{return _0x31af37;}})[_0x46bc('0x45')](function(_0x2bc2ee){logger[_0x46bc('0x50')](_0x46bc('0x51'),_0x2bc2ee);throw _0x2bc2ee;});}return _0x31af37;})[_0x46bc('0x24')](respondWithResult(_0x5b9c92,0xc9))[_0x46bc('0x45')](handleError(_0x5b9c92,null));};exports[_0x46bc('0x52')]=function(_0x4192e3,_0x104382){var _0x587439={'where':{'id':_0x4192e3[_0x46bc('0x47')]['id']}},_0x44cca3={};_0x44cca3[_0x46bc('0x31')]=_[_0x46bc('0x34')](db['JscriptyProject'][_0x46bc('0x2e')]);_0x587439[_0x46bc('0x37')]=_[_0x46bc('0x36')](_0x44cca3[_0x46bc('0x31')],qs[_0x46bc('0x38')](_0x4192e3['query'][_0x46bc('0x38')]));_0x587439['attributes']=_0x587439[_0x46bc('0x37')][_0x46bc('0x39')]?_0x587439[_0x46bc('0x37')]:_0x44cca3['model'];if(_0x4192e3[_0x46bc('0x33')][_0x46bc('0x43')]){_0x587439[_0x46bc('0x44')]=[{'all':!![]}];}_0x587439=_[_0x46bc('0x40')]({},_0x587439,_0x4192e3[_0x46bc('0x42')]);return db[_0x46bc('0x2d')]['find'](_0x587439)[_0x46bc('0x24')](handleEntityNotFound(_0x104382,null))[_0x46bc('0x24')](function(_0x284e76){if(_0x284e76){var _0x35aabf=_0x284e76[_0x46bc('0x26')]({'plain':!![]});_0x35aabf=qs[_0x46bc('0x53')](_0x35aabf,['id','createdAt',_0x46bc('0x54')]);_0x4192e3['body']=_[_0x46bc('0x53')](_0x4192e3[_0x46bc('0x49')],['id',_0x46bc('0x55'),_0x46bc('0x54')]);return db['JscriptyProject'][_0x46bc('0x48')](_['merge'](_0x35aabf,_0x4192e3[_0x46bc('0x49')]),{'include':_0x4192e3[_0x46bc('0x33')][_0x46bc('0x43')]?[{'all':!![]}]:undefined})[_0x46bc('0x24')](function(_0x1fbd56){var _0x2c565b=_0x4192e3[_0x46bc('0x4a')][_0x46bc('0x26')]({'plain':!![]});if(!_0x2c565b)throw new Error(_0x46bc('0x56'));if(_0x2c565b['role']===_0x46bc('0x4a')){var _0x258aec=_0x1fbd56[_0x46bc('0x26')]({'plain':!![]});var _0x1cb492='Projects';return db[_0x46bc('0x4c')]['find']({'where':{'name':_0x1cb492,'userProfileId':_0x2c565b[_0x46bc('0x4e')]},'raw':!![]})['then'](function(_0x40fee4){if(_0x40fee4&&_0x40fee4[_0x46bc('0x4f')]===0x0){return db['UserProfileResource'][_0x46bc('0x48')]({'name':_0x258aec[_0x46bc('0x2b')],'resourceId':_0x258aec['id'],'type':_0x40fee4[_0x46bc('0x2b')],'sectionId':_0x40fee4['id']},{})[_0x46bc('0x24')](function(){return _0x1fbd56;});}else{return _0x1fbd56;}})[_0x46bc('0x45')](function(_0x15bb4a){logger[_0x46bc('0x50')](_0x46bc('0x51'),_0x15bb4a);throw _0x15bb4a;});}return _0x1fbd56;});}})[_0x46bc('0x24')](respondWithResult(_0x104382,0xc9))[_0x46bc('0x45')](handleError(_0x104382,null));};exports[_0x46bc('0x23')]=function(_0x1a93f0,_0x21e56b){if(_0x1a93f0['body']['id']){delete _0x1a93f0[_0x46bc('0x49')]['id'];}return db[_0x46bc('0x2d')][_0x46bc('0x4d')]({'where':{'id':_0x1a93f0[_0x46bc('0x47')]['id']}})[_0x46bc('0x24')](handleEntityNotFound(_0x21e56b,null))[_0x46bc('0x24')](saveUpdates(_0x1a93f0[_0x46bc('0x49')],null))[_0x46bc('0x24')](respondWithResult(_0x21e56b,null))[_0x46bc('0x45')](handleError(_0x21e56b,null));};exports[_0x46bc('0x25')]=function(_0x215526,_0x558736){return db[_0x46bc('0x2d')][_0x46bc('0x4d')]({'where':{'id':_0x215526[_0x46bc('0x47')]['id']}})[_0x46bc('0x24')](handleEntityNotFound(_0x558736,null))['then'](removeEntity(_0x558736,null))[_0x46bc('0x45')](handleError(_0x558736,null));};exports[_0x46bc('0x57')]=function(_0x379697,_0xa6eda4,_0x4149aa){var _0x38661c={'raw':!![],'where':{}};var _0x1aa90d={};var _0x2dca0e={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x46bc('0x58')]({'where':{'id':_0x379697['params']['id']}})[_0x46bc('0x24')](handleEntityNotFound(_0xa6eda4,null))['then'](function(_0x36378f){if(_0x36378f){_0x1aa90d['model']=_[_0x46bc('0x34')](db['JscriptySessionReport'][_0x46bc('0x2e')]);_0x1aa90d[_0x46bc('0x33')]=_['keys'](_0x379697[_0x46bc('0x33')]);_0x1aa90d[_0x46bc('0x35')]=_[_0x46bc('0x36')](_0x1aa90d['model'],_0x1aa90d[_0x46bc('0x33')]);_0x38661c[_0x46bc('0x37')]=_[_0x46bc('0x36')](_0x1aa90d[_0x46bc('0x31')],qs[_0x46bc('0x38')](_0x379697[_0x46bc('0x33')][_0x46bc('0x38')]));_0x38661c[_0x46bc('0x37')]=_0x38661c['attributes']['length']?_0x38661c['attributes']:_0x1aa90d[_0x46bc('0x31')];if(!_0x379697[_0x46bc('0x33')]['hasOwnProperty']('nolimit')){_0x38661c['limit']=qs[_0x46bc('0x1c')](_0x379697[_0x46bc('0x33')][_0x46bc('0x1c')]);_0x38661c[_0x46bc('0x1a')]=qs[_0x46bc('0x1a')](_0x379697[_0x46bc('0x33')][_0x46bc('0x1a')]);}_0x38661c[_0x46bc('0x3b')]=qs[_0x46bc('0x3c')](_0x379697['query'][_0x46bc('0x3c')]);_0x38661c['where']=qs[_0x46bc('0x35')](_['pick'](_0x379697[_0x46bc('0x33')],_0x1aa90d[_0x46bc('0x35')]));_0x38661c[_0x46bc('0x3d')][_0x46bc('0x59')]=_0x36378f['id'];if(_0x379697['query'][_0x46bc('0x3f')]){_0x38661c[_0x46bc('0x3d')]=_[_0x46bc('0x40')](_0x38661c[_0x46bc('0x3d')],{'$or':_['map'](_0x38661c[_0x46bc('0x37')],function(_0x5ddfa4){var _0x52e534={};_0x52e534[_0x5ddfa4]={'$like':'%'+_0x379697[_0x46bc('0x33')][_0x46bc('0x3f')]+'%'};return _0x52e534;})});}_0x38661c=_[_0x46bc('0x40')]({},_0x38661c,_0x379697[_0x46bc('0x42')]);return db[_0x46bc('0x5a')]['count']({'where':_0x38661c[_0x46bc('0x3d')]})['then'](function(_0x534e12){_0x2dca0e['count']=_0x534e12;if(_0x379697[_0x46bc('0x33')][_0x46bc('0x43')]){_0x38661c[_0x46bc('0x44')]=[{'all':!![]}];}return db[_0x46bc('0x5a')][_0x46bc('0x5b')](_0x38661c);})['then'](function(_0x408d9a){_0x2dca0e[_0x46bc('0x5c')]=_0x408d9a;return _0x2dca0e;});}})[_0x46bc('0x24')](respondWithFilteredResult(_0xa6eda4,_0x38661c))[_0x46bc('0x45')](handleError(_0xa6eda4,null));};exports[_0x46bc('0x5d')]=function(_0xa8ace4,_0x4e5d4a,_0x5f5623){var _0x5d0bdb={'raw':!![],'where':{}};var _0x407a14={};var _0x358dfb={'count':0x0,'rows':[]};return db[_0x46bc('0x2d')][_0x46bc('0x58')]({'where':{'id':_0xa8ace4['params']['id']}})[_0x46bc('0x24')](handleEntityNotFound(_0x4e5d4a,null))[_0x46bc('0x24')](function(_0x5b3d49){if(_0x5b3d49){_0x407a14[_0x46bc('0x31')]=_[_0x46bc('0x34')](db[_0x46bc('0x5e')][_0x46bc('0x2e')]);_0x407a14[_0x46bc('0x33')]=_[_0x46bc('0x34')](_0xa8ace4['query']);_0x407a14[_0x46bc('0x35')]=_[_0x46bc('0x36')](_0x407a14['model'],_0x407a14[_0x46bc('0x33')]);_0x5d0bdb[_0x46bc('0x37')]=_[_0x46bc('0x36')](_0x407a14['model'],qs[_0x46bc('0x38')](_0xa8ace4[_0x46bc('0x33')][_0x46bc('0x38')]));_0x5d0bdb[_0x46bc('0x37')]=_0x5d0bdb['attributes'][_0x46bc('0x39')]?_0x5d0bdb[_0x46bc('0x37')]:_0x407a14['model'];if(!_0xa8ace4[_0x46bc('0x33')]['hasOwnProperty']('nolimit')){_0x5d0bdb[_0x46bc('0x1c')]=qs[_0x46bc('0x1c')](_0xa8ace4[_0x46bc('0x33')][_0x46bc('0x1c')]);_0x5d0bdb[_0x46bc('0x1a')]=qs['offset'](_0xa8ace4[_0x46bc('0x33')][_0x46bc('0x1a')]);}_0x5d0bdb[_0x46bc('0x3b')]=qs[_0x46bc('0x3c')](_0xa8ace4[_0x46bc('0x33')][_0x46bc('0x3c')]);_0x5d0bdb['where']=qs[_0x46bc('0x35')](_[_0x46bc('0x3e')](_0xa8ace4[_0x46bc('0x33')],_0x407a14[_0x46bc('0x35')]));_0x5d0bdb[_0x46bc('0x3d')][_0x46bc('0x59')]=_0x5b3d49['id'];if(_0xa8ace4['query'][_0x46bc('0x3f')]){_0x5d0bdb[_0x46bc('0x3d')]=_['merge'](_0x5d0bdb[_0x46bc('0x3d')],{'$or':_[_0x46bc('0x32')](_0x5d0bdb['attributes'],function(_0x26704c){var _0xb09e75={};_0xb09e75[_0x26704c]={'$like':'%'+_0xa8ace4[_0x46bc('0x33')][_0x46bc('0x3f')]+'%'};return _0xb09e75;})});}_0x5d0bdb=_[_0x46bc('0x40')]({},_0x5d0bdb,_0xa8ace4['options']);return db['JscriptyAnswerReport'][_0x46bc('0x1d')]({'where':_0x5d0bdb[_0x46bc('0x3d')]})['then'](function(_0x377768){_0x358dfb['count']=_0x377768;if(_0xa8ace4['query'][_0x46bc('0x43')]){_0x5d0bdb[_0x46bc('0x44')]=[{'all':!![]}];}return db[_0x46bc('0x5e')][_0x46bc('0x5b')](_0x5d0bdb);})[_0x46bc('0x24')](function(_0x41f429){_0x358dfb[_0x46bc('0x5c')]=_0x41f429;return _0x358dfb;});}})['then'](respondWithFilteredResult(_0x4e5d4a,_0x5d0bdb))[_0x46bc('0x45')](handleError(_0x4e5d4a,null));};function char(_0x1ec55c){return _0x46bc('0x5f')===typeof _0x1ec55c?String['fromCharCode'][_0x46bc('0x20')](null,arguments):_0x1ec55c;}function needsEncapsulation(_0x1e512b){return!!_0x1e512b&&(_0x1e512b[_0x46bc('0x60')]()[_0x46bc('0x61')](char(0xd))>=0x0||_0x1e512b['toString']()[_0x46bc('0x61')](char(0xa))>=0x0||_0x1e512b[_0x46bc('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x1e512b[_0x46bc('0x60')]()[_0x46bc('0x61')](char(0x22))>=0x0);}function encapsulate(_0x332b10){var _0x5065df=char(0x22),_0x4e0fa8='\x5c'+char(0x22),_0x45f05b=_0x332b10[_0x46bc('0x60')]()['replace'](new RegExp(_0x5065df,'g'),_0x4e0fa8);return _0x5065df+_0x45f05b+_0x5065df;}exports[_0x46bc('0x62')]=function(_0x20caf5,_0x4caee0,_0x3a8d7d){var _0x1afb62,_0xab433c;var _0x59532c={'where':{'ProjectId':_0x20caf5[_0x46bc('0x47')]['id']}};if(_0x20caf5[_0x46bc('0x33')]['startTime']){_0x59532c[_0x46bc('0x3d')]['starttime']=JSON[_0x46bc('0x63')](_0x20caf5[_0x46bc('0x33')][_0x46bc('0x64')]);}return db[_0x46bc('0x5a')][_0x46bc('0x5b')](_0x59532c)['then'](handleEntityNotFound(_0x4caee0,null))[_0x46bc('0x24')](function(_0xdf2ba1){if(_0xdf2ba1){_0x1afb62=_0xdf2ba1;return db['JscriptyQuestionReport'][_0x46bc('0x5b')]({'where':{'SessionId':{'$in':_[_0x46bc('0x32')](_0x1afb62,'id')},'ProjectId':_0x20caf5['params']['id']},'order':_0x46bc('0x65')});}})[_0x46bc('0x24')](handleEntityNotFound(_0x4caee0,null))['then'](function(_0x5d7779){if(_0x5d7779){_0xab433c=_0x5d7779;var _0x1e8b21={};for(var _0xf1d608=0x0,_0x2ffc6b=_0xab433c[_0x46bc('0x39')];_0xf1d608<_0x2ffc6b;_0xf1d608++){if(!_0x1e8b21[_0x46bc('0x3a')](_0xab433c[_0xf1d608][_0x46bc('0x66')])){_0x1e8b21[_0xab433c[_0xf1d608][_0x46bc('0x66')]]=needsEncapsulation(_0xab433c[_0xf1d608]['question'])?encapsulate(_0xab433c[_0xf1d608][_0x46bc('0x67')]):_0xab433c[_0xf1d608][_0x46bc('0x67')];}}var _0x33fdaf=[],_0x24c8cd={};for(var _0x38d0c1=0x0,_0x1ebf4f=_0x1afb62[_0x46bc('0x39')];_0x38d0c1<_0x1ebf4f;_0x38d0c1++){_0x24c8cd={'ProjectId':_0x20caf5[_0x46bc('0x47')]['id'],'SessionId':_0x1afb62[_0x38d0c1]['id'],'StartTime':moment(_0x1afb62[_0x38d0c1]['starttime'])['format'](_0x46bc('0x68'))};for(var _0x45125b=0x0,_0x502fdc=_0xab433c[_0x46bc('0x39')];_0x45125b<_0x502fdc;_0x45125b++){if(_0xab433c[_0x45125b][_0x46bc('0x69')]==_0x1afb62[_0x38d0c1]['id']&&_0x1e8b21[_0x46bc('0x3a')](_0xab433c[_0x45125b]['questionId'])){_0x24c8cd[_0x1e8b21[_0xab433c[_0x45125b][_0x46bc('0x66')]]]=_0xab433c[_0x45125b][_0x46bc('0x6a')];}}for(var _0x35b27c in _0x1e8b21){if(!_0x24c8cd[_0x46bc('0x3a')](_0x1e8b21[_0x35b27c])){_0x24c8cd[_0x1e8b21[_0x35b27c]]=null;}}_0x33fdaf['push'](_0x24c8cd);}return _0x33fdaf;}})[_0x46bc('0x24')](function(_0x40996b){if(!_[_0x46bc('0x6b')](_0x40996b)){var _0x5577a9=toCsv(_0x40996b);var _0x4d0787=Date[_0x46bc('0x6c')]();fs['writeFileSync'](util[_0x46bc('0x6d')](_0x46bc('0x6e'),_0x20caf5[_0x46bc('0x47')]['id'],_0x4d0787),_0x5577a9);_0x4caee0[_0x46bc('0x6f')](_0x46bc('0x70'),_0x46bc('0x71')+util[_0x46bc('0x6d')](_0x46bc('0x72'),_0x20caf5[_0x46bc('0x47')]['id'],_0x4d0787));_0x4caee0[_0x46bc('0x6f')]('Content-type',_0x46bc('0x73'));return _0x4caee0['download'](util[_0x46bc('0x6d')](_0x46bc('0x6e'),_0x20caf5[_0x46bc('0x47')]['id'],_0x4d0787));}else{return _0x4caee0[_0x46bc('0x29')](0xcc);}})[_0x46bc('0x45')](handleError(_0x4caee0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e9c5561..2963c45 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 _0xe14b=['bluebird','path','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','moment'];(function(_0x5475a8,_0xa96126){var _0x229b51=function(_0x47be07){while(--_0x47be07){_0x5475a8['push'](_0x5475a8['shift']());}};_0x229b51(++_0xa96126);}(_0xe14b,0x93));var _0xbe14=function(_0x586e34,_0x2e36c6){_0x586e34=_0x586e34-0x0;var _0x2726e5=_0xe14b[_0x586e34];return _0x2726e5;};'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 _0xb2f1=['path','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','api','moment','request-promise'];(function(_0x1c7c27,_0x151cab){var _0x146593=function(_0x2d03da){while(--_0x2d03da){_0x1c7c27['push'](_0x1c7c27['shift']());}};_0x146593(++_0x151cab);}(_0xb2f1,0xee));var _0x1b2f=function(_0x5ec89c,_0x3549e7){_0x5ec89c=_0x5ec89c-0x0;var _0xdcfe=_0xb2f1[_0x5ec89c];return _0xdcfe;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var logger=require('../../config/logger')(_0x1b2f('0x2'));var moment=require(_0x1b2f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b2f('0x4'));var fs=require('fs');var path=require(_0x1b2f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b2f('0x6'));module[_0x1b2f('0x7')]=function(_0xad728b,_0x4326ba){return _0xad728b['define']('JscriptyProject',attributes,{'tableName':_0x1b2f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index ff43527..90c590d 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5ccd06,_0x2ff4f5){var _0x4774b0=function(_0x2cde7d){while(--_0x2cde7d){_0x5ccd06['push'](_0x5ccd06['shift']());}};_0x4774b0(++_0x2ff4f5);}(_0xe706,0xa3));var _0x6e70=function(_0x32be7d,_0x1e1fd6){_0x32be7d=_0x32be7d-0x0;var _0x3ddf=_0xe706[_0x32be7d];return _0x3ddf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x1530d4,_0x4857d1){var _0x1478c7=function(_0x5aca3e){while(--_0x5aca3e){_0x1530d4['push'](_0x1530d4['shift']());}};_0x1478c7(++_0x4857d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 25daeb3..f9865e8 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 _0x0562=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update'];(function(_0x9bd5e9,_0x4f56fa){var _0x809e1b=function(_0x4f6b68){while(--_0x4f6b68){_0x9bd5e9['push'](_0x9bd5e9['shift']());}};_0x809e1b(++_0x4f56fa);}(_0x0562,0x1bc));var _0x2056=function(_0x551dc7,_0x489014){_0x551dc7=_0x551dc7-0x0;var _0x3e0ee1=_0x0562[_0x551dc7];return _0x3e0ee1;};'use strict';var multer=require(_0x2056('0x0'));var util=require(_0x2056('0x1'));var path=require(_0x2056('0x2'));var timeout=require(_0x2056('0x3'));var express=require(_0x2056('0x4'));var router=express[_0x2056('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2056('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2056('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x2056('0x8')]('/',auth[_0x2056('0x9')](),controller['index']);router[_0x2056('0x8')](_0x2056('0xa'),auth[_0x2056('0x9')](),controller[_0x2056('0xb')]);router['get']('/:id',auth[_0x2056('0x9')](),controller[_0x2056('0xc')]);router[_0x2056('0xd')]('/',auth[_0x2056('0x9')](),controller[_0x2056('0xe')]);router[_0x2056('0xf')](_0x2056('0x10'),auth[_0x2056('0x9')](),controller[_0x2056('0x11')]);router[_0x2056('0x12')](_0x2056('0x10'),auth[_0x2056('0x9')](),controller[_0x2056('0x13')]);module[_0x2056('0x14')]=router; \ No newline at end of file +var _0x238f=['destroy','multer','util','path','express','fs-extra','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete'];(function(_0x324cc9,_0x1738b9){var _0x1edff4=function(_0x21a124){while(--_0x21a124){_0x324cc9['push'](_0x324cc9['shift']());}};_0x1edff4(++_0x1738b9);}(_0x238f,0x6d));var _0xf238=function(_0x2c2bc9,_0x23b9a5){_0x2c2bc9=_0x2c2bc9-0x0;var _0x59c7d8=_0x238f[_0x2c2bc9];return _0x59c7d8;};'use strict';var multer=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var path=require(_0xf238('0x2'));var timeout=require('connect-timeout');var express=require(_0xf238('0x3'));var router=express['Router']();var fs_extra=require(_0xf238('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf238('0x5'));var controller=require(_0xf238('0x6'));router[_0xf238('0x7')]('/',auth[_0xf238('0x8')](),controller[_0xf238('0x9')]);router[_0xf238('0x7')](_0xf238('0xa'),auth['isAuthenticated'](),controller[_0xf238('0xb')]);router[_0xf238('0x7')](_0xf238('0xc'),auth['isAuthenticated'](),controller[_0xf238('0xd')]);router[_0xf238('0xe')]('/',auth[_0xf238('0x8')](),controller['create']);router[_0xf238('0xf')](_0xf238('0xc'),auth[_0xf238('0x8')](),controller['update']);router[_0xf238('0x10')](_0xf238('0xc'),auth[_0xf238('0x8')](),controller[_0xf238('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 94d341e..4cbf718 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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x3e7fa9,_0x4aad86){_0x3e7fa9=_0x3e7fa9-0x0;var _0x4158b5=_0x7a54[_0x3e7fa9];return _0x4158b5;};'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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x4b349f,_0x5aea66){_0x4b349f=_0x4b349f-0x0;var _0x55fa25=_0x7a54[_0x4b349f];return _0x55fa25;};'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 23e77ee..d557095 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 _0xa25d=['options','includeAll','rows','show','params','keys','filters','length','include','find','catch','body','describe','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','intersection','model','query','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xa25d,0x119));var _0xda25=function(_0x3bf9b7,_0x2d9b97){_0x3bf9b7=_0x3bf9b7-0x0;var _0x566013=_0xa25d[_0x3bf9b7];return _0x566013;};'use strict';var emlformat=require(_0xda25('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xda25('0x1'));var rp=require(_0xda25('0x2'));var moment=require('moment');var BPromise=require(_0xda25('0x3'));var Mustache=require('mustache');var util=require(_0xda25('0x4'));var path=require('path');var sox=require(_0xda25('0x5'));var csv=require(_0xda25('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda25('0x7'));var squel=require(_0xda25('0x8'));var crypto=require(_0xda25('0x9'));var jsforce=require(_0xda25('0xa'));var deskjs=require(_0xda25('0xb'));var toCsv=require('to-csv');var querystring=require(_0xda25('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda25('0xd'));var hardwareService=require(_0xda25('0xe'));var logger=require(_0xda25('0xf'))('api');var utils=require(_0xda25('0x10'));var config=require(_0xda25('0x11'));var licenseUtil=require(_0xda25('0x12'));var db=require(_0xda25('0x13'))['db'];function respondWithStatusCode(_0x454540,_0x4029d2){_0x4029d2=_0x4029d2||0xcc;return function(_0x6e72bb){if(_0x6e72bb){return _0x454540['sendStatus'](_0x4029d2);}return _0x454540[_0xda25('0x14')](_0x4029d2)[_0xda25('0x15')]();};}function respondWithResult(_0x300d6d,_0x528529){_0x528529=_0x528529||0xc8;return function(_0x28fb6b){if(_0x28fb6b){return _0x300d6d[_0xda25('0x14')](_0x528529)[_0xda25('0x16')](_0x28fb6b);}};}function respondWithFilteredResult(_0x54e024,_0x414a80){return function(_0x53820f){if(_0x53820f){var _0x58d0b4=typeof _0x414a80[_0xda25('0x17')]===_0xda25('0x18')&&typeof _0x414a80[_0xda25('0x19')]==='undefined';var _0x1db55a=_0x53820f[_0xda25('0x1a')];var _0x551ac9=_0x58d0b4?0x0:_0x414a80[_0xda25('0x17')];var _0x392aed=_0x58d0b4?_0x53820f[_0xda25('0x1a')]:_0x414a80['offset']+_0x414a80[_0xda25('0x19')];var _0x1ec456;if(_0x392aed>=_0x1db55a){_0x392aed=_0x1db55a;_0x1ec456=0xc8;}else{_0x1ec456=0xce;}_0x54e024[_0xda25('0x14')](_0x1ec456);return _0x54e024['set']('Content-Range',_0x551ac9+'-'+_0x392aed+'/'+_0x1db55a)[_0xda25('0x16')](_0x53820f);}return null;};}function patchUpdates(_0x347ee0){return function(_0x1cd2dc){try{jsonpatch['apply'](_0x1cd2dc,_0x347ee0,!![]);}catch(_0x3c591e){return BPromise[_0xda25('0x1b')](_0x3c591e);}return _0x1cd2dc[_0xda25('0x1c')]();};}function saveUpdates(_0x4983e3,_0x1755b9){return function(_0x2289e2){if(_0x2289e2){return _0x2289e2[_0xda25('0x1d')](_0x4983e3)[_0xda25('0x1e')](function(_0x1a6028){return _0x1a6028;});}return null;};}function removeEntity(_0x29ded8,_0x501c0d){return function(_0x4e874b){if(_0x4e874b){return _0x4e874b[_0xda25('0x1f')]()[_0xda25('0x1e')](function(){_0x29ded8[_0xda25('0x14')](0xcc)[_0xda25('0x15')]();});}};}function handleEntityNotFound(_0x403fa8,_0x3b0f17){return function(_0x3ae31c){if(!_0x3ae31c){_0x403fa8['sendStatus'](0x194);}return _0x3ae31c;};}function handleError(_0x25fc15,_0x5a21bb){_0x5a21bb=_0x5a21bb||0x1f4;return function(_0x566c8b){logger[_0xda25('0x20')](_0x566c8b['stack']);if(_0x566c8b['name']){delete _0x566c8b[_0xda25('0x21')];}_0x25fc15['status'](_0x5a21bb)[_0xda25('0x22')](_0x566c8b);};}exports[_0xda25('0x23')]=function(_0x423cdb,_0x1deeab){var _0xefb84c={},_0x146689={},_0x4c0e64={'count':0x0,'rows':[]};var _0x5b9d54=_[_0xda25('0x24')](db[_0xda25('0x25')][_0xda25('0x26')],function(_0x597e34){return{'name':_0x597e34[_0xda25('0x27')],'type':_0x597e34[_0xda25('0x28')][_0xda25('0x29')]};});_0x146689['model']=_[_0xda25('0x24')](_0x5b9d54,_0xda25('0x21'));_0x146689['query']=_['keys'](_0x423cdb['query']);_0x146689['filters']=_[_0xda25('0x2a')](_0x146689[_0xda25('0x2b')],_0x146689[_0xda25('0x2c')]);_0xefb84c[_0xda25('0x2d')]=_[_0xda25('0x2a')](_0x146689[_0xda25('0x2b')],qs[_0xda25('0x2e')](_0x423cdb[_0xda25('0x2c')][_0xda25('0x2e')]));_0xefb84c[_0xda25('0x2d')]=_0xefb84c[_0xda25('0x2d')]['length']?_0xefb84c[_0xda25('0x2d')]:_0x146689['model'];if(!_0x423cdb[_0xda25('0x2c')]['hasOwnProperty'](_0xda25('0x2f'))){_0xefb84c[_0xda25('0x19')]=qs[_0xda25('0x19')](_0x423cdb[_0xda25('0x2c')][_0xda25('0x19')]);_0xefb84c[_0xda25('0x17')]=qs[_0xda25('0x17')](_0x423cdb[_0xda25('0x2c')][_0xda25('0x17')]);}_0xefb84c['order']=qs[_0xda25('0x30')](_0x423cdb[_0xda25('0x2c')][_0xda25('0x30')]);_0xefb84c[_0xda25('0x31')]=qs['filters'](_[_0xda25('0x32')](_0x423cdb[_0xda25('0x2c')],_0x146689['filters']),_0x5b9d54);if(_0x423cdb[_0xda25('0x2c')][_0xda25('0x33')]){_0xefb84c[_0xda25('0x31')]=_[_0xda25('0x34')](_0xefb84c[_0xda25('0x31')],{'$or':_[_0xda25('0x24')](_0x5b9d54,function(_0x108b3e){if(_0x108b3e[_0xda25('0x28')]!==_0xda25('0x35')){var _0x2d57d7={};_0x2d57d7[_0x108b3e[_0xda25('0x21')]]={'$like':'%'+_0x423cdb[_0xda25('0x2c')][_0xda25('0x33')]+'%'};return _0x2d57d7;}})});}_0xefb84c=_[_0xda25('0x34')]({},_0xefb84c,_0x423cdb[_0xda25('0x36')]);var _0x1446c1={'where':_0xefb84c[_0xda25('0x31')]};return db[_0xda25('0x25')]['count'](_0x1446c1)[_0xda25('0x1e')](function(_0x17e650){_0x4c0e64['count']=_0x17e650;if(_0x423cdb[_0xda25('0x2c')][_0xda25('0x37')]){_0xefb84c['include']=[{'all':!![]}];}return db[_0xda25('0x25')]['findAll'](_0xefb84c);})[_0xda25('0x1e')](function(_0x5e5af6){_0x4c0e64[_0xda25('0x38')]=_0x5e5af6;return _0x4c0e64;})['then'](respondWithFilteredResult(_0x1deeab,_0xefb84c))['catch'](handleError(_0x1deeab,null));};exports[_0xda25('0x39')]=function(_0x23df0c,_0x5be0f3){var _0x80b9a3={'raw':!![],'where':{'id':_0x23df0c[_0xda25('0x3a')]['id']}},_0x2e92df={};_0x2e92df[_0xda25('0x2b')]=_[_0xda25('0x3b')](db[_0xda25('0x25')]['rawAttributes']);_0x2e92df[_0xda25('0x2c')]=_['keys'](_0x23df0c['query']);_0x2e92df[_0xda25('0x3c')]=_[_0xda25('0x2a')](_0x2e92df[_0xda25('0x2b')],_0x2e92df[_0xda25('0x2c')]);_0x80b9a3[_0xda25('0x2d')]=_['intersection'](_0x2e92df[_0xda25('0x2b')],qs['fields'](_0x23df0c[_0xda25('0x2c')][_0xda25('0x2e')]));_0x80b9a3[_0xda25('0x2d')]=_0x80b9a3['attributes'][_0xda25('0x3d')]?_0x80b9a3[_0xda25('0x2d')]:_0x2e92df['model'];if(_0x23df0c[_0xda25('0x2c')][_0xda25('0x37')]){_0x80b9a3[_0xda25('0x3e')]=[{'all':!![]}];}_0x80b9a3=_[_0xda25('0x34')]({},_0x80b9a3,_0x23df0c[_0xda25('0x36')]);return db[_0xda25('0x25')][_0xda25('0x3f')](_0x80b9a3)[_0xda25('0x1e')](handleEntityNotFound(_0x5be0f3,null))[_0xda25('0x1e')](respondWithResult(_0x5be0f3,null))[_0xda25('0x40')](handleError(_0x5be0f3,null));};exports['create']=function(_0x5946a0,_0x39d7f9){return db[_0xda25('0x25')]['create'](_0x5946a0[_0xda25('0x41')],{})[_0xda25('0x1e')](respondWithResult(_0x39d7f9,0xc9))[_0xda25('0x40')](handleError(_0x39d7f9,null));};exports[_0xda25('0x1d')]=function(_0x39545f,_0x30483d){if(_0x39545f[_0xda25('0x41')]['id']){delete _0x39545f['body']['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x39545f[_0xda25('0x3a')]['id']}})['then'](handleEntityNotFound(_0x30483d,null))[_0xda25('0x1e')](saveUpdates(_0x39545f['body'],null))['then'](respondWithResult(_0x30483d,null))['catch'](handleError(_0x30483d,null));};exports[_0xda25('0x1f')]=function(_0x3f0b6b,_0x19cc4a){return db[_0xda25('0x25')]['find']({'where':{'id':_0x3f0b6b[_0xda25('0x3a')]['id']}})[_0xda25('0x1e')](handleEntityNotFound(_0x19cc4a,null))[_0xda25('0x1e')](removeEntity(_0x19cc4a,null))['catch'](handleError(_0x19cc4a,null));};exports[_0xda25('0x42')]=function(_0x3764a5,_0xc40991){return db[_0xda25('0x25')][_0xda25('0x42')]()['then'](respondWithResult(_0xc40991,null))[_0xda25('0x40')](handleError(_0xc40991,null));}; \ No newline at end of file +var _0xfcde=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','order','where','pick','map','filter','merge','options','includeAll','include','rows','params','attributes','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x413c5b,_0x3aca15){var _0x3a7424=function(_0x8a349c){while(--_0x8a349c){_0x413c5b['push'](_0x413c5b['shift']());}};_0x3a7424(++_0x3aca15);}(_0xfcde,0x1dd));var _0xefcd=function(_0x323ff1,_0xbeac83){_0x323ff1=_0x323ff1-0x0;var _0x3d6931=_0xfcde[_0x323ff1];return _0x3d6931;};'use strict';var emlformat=require(_0xefcd('0x0'));var rimraf=require(_0xefcd('0x1'));var zipdir=require(_0xefcd('0x2'));var jsonpatch=require(_0xefcd('0x3'));var rp=require(_0xefcd('0x4'));var moment=require(_0xefcd('0x5'));var BPromise=require(_0xefcd('0x6'));var Mustache=require(_0xefcd('0x7'));var util=require(_0xefcd('0x8'));var path=require(_0xefcd('0x9'));var sox=require(_0xefcd('0xa'));var csv=require('to-csv');var ejs=require(_0xefcd('0xb'));var fs=require('fs');var fs_extra=require(_0xefcd('0xc'));var _=require('lodash');var squel=require(_0xefcd('0xd'));var crypto=require(_0xefcd('0xe'));var jsforce=require(_0xefcd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xefcd('0x10'));var querystring=require(_0xefcd('0x11'));var Papa=require('papaparse');var Redis=require(_0xefcd('0x12'));var authService=require(_0xefcd('0x13'));var qs=require(_0xefcd('0x14'));var as=require(_0xefcd('0x15'));var hardwareService=require(_0xefcd('0x16'));var logger=require(_0xefcd('0x17'))('api');var utils=require(_0xefcd('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x314e02,_0x197a49){_0x197a49=_0x197a49||0xcc;return function(_0x514200){if(_0x514200){return _0x314e02[_0xefcd('0x19')](_0x197a49);}return _0x314e02['status'](_0x197a49)['end']();};}function respondWithResult(_0x59b2a7,_0x376c1d){_0x376c1d=_0x376c1d||0xc8;return function(_0x29e1a0){if(_0x29e1a0){return _0x59b2a7[_0xefcd('0x1a')](_0x376c1d)[_0xefcd('0x1b')](_0x29e1a0);}};}function respondWithFilteredResult(_0x776860,_0xd0466d){return function(_0x18711e){if(_0x18711e){var _0x2d28f9=typeof _0xd0466d[_0xefcd('0x1c')]===_0xefcd('0x1d')&&typeof _0xd0466d[_0xefcd('0x1e')]===_0xefcd('0x1d');var _0x4eb6e8=_0x18711e[_0xefcd('0x1f')];var _0x6e623c=_0x2d28f9?0x0:_0xd0466d[_0xefcd('0x1c')];var _0x4b9649=_0x2d28f9?_0x18711e[_0xefcd('0x1f')]:_0xd0466d[_0xefcd('0x1c')]+_0xd0466d[_0xefcd('0x1e')];var _0x22752d;if(_0x4b9649>=_0x4eb6e8){_0x4b9649=_0x4eb6e8;_0x22752d=0xc8;}else{_0x22752d=0xce;}_0x776860[_0xefcd('0x1a')](_0x22752d);return _0x776860['set'](_0xefcd('0x20'),_0x6e623c+'-'+_0x4b9649+'/'+_0x4eb6e8)[_0xefcd('0x1b')](_0x18711e);}return null;};}function patchUpdates(_0xc7ce7e){return function(_0x414450){try{jsonpatch[_0xefcd('0x21')](_0x414450,_0xc7ce7e,!![]);}catch(_0x15be0d){return BPromise[_0xefcd('0x22')](_0x15be0d);}return _0x414450['save']();};}function saveUpdates(_0x41a61a,_0x2771fb){return function(_0x27d560){if(_0x27d560){return _0x27d560['update'](_0x41a61a)['then'](function(_0x5b09ef){return _0x5b09ef;});}return null;};}function removeEntity(_0x35c0f6,_0x3740cc){return function(_0x56c975){if(_0x56c975){return _0x56c975[_0xefcd('0x23')]()[_0xefcd('0x24')](function(){_0x35c0f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b02e5,_0x162a27){return function(_0x12f4c1){if(!_0x12f4c1){_0x5b02e5[_0xefcd('0x19')](0x194);}return _0x12f4c1;};}function handleError(_0x1d8908,_0x2a1cdc){_0x2a1cdc=_0x2a1cdc||0x1f4;return function(_0xbdda31){logger[_0xefcd('0x25')](_0xbdda31[_0xefcd('0x26')]);if(_0xbdda31['name']){delete _0xbdda31[_0xefcd('0x27')];}_0x1d8908['status'](_0x2a1cdc)[_0xefcd('0x28')](_0xbdda31);};}exports[_0xefcd('0x29')]=function(_0x20bd5d,_0x48d7c3){var _0x3b7a34={},_0x5b1e80={},_0x44ead0={'count':0x0,'rows':[]};var _0x1101e9=_['map'](db[_0xefcd('0x2a')][_0xefcd('0x2b')],function(_0x421efc){return{'name':_0x421efc[_0xefcd('0x2c')],'type':_0x421efc[_0xefcd('0x2d')]['key']};});_0x5b1e80[_0xefcd('0x2e')]=_['map'](_0x1101e9,_0xefcd('0x27'));_0x5b1e80[_0xefcd('0x2f')]=_[_0xefcd('0x30')](_0x20bd5d[_0xefcd('0x2f')]);_0x5b1e80[_0xefcd('0x31')]=_[_0xefcd('0x32')](_0x5b1e80[_0xefcd('0x2e')],_0x5b1e80['query']);_0x3b7a34['attributes']=_[_0xefcd('0x32')](_0x5b1e80['model'],qs[_0xefcd('0x33')](_0x20bd5d['query'][_0xefcd('0x33')]));_0x3b7a34['attributes']=_0x3b7a34['attributes'][_0xefcd('0x34')]?_0x3b7a34['attributes']:_0x5b1e80['model'];if(!_0x20bd5d[_0xefcd('0x2f')]['hasOwnProperty']('nolimit')){_0x3b7a34[_0xefcd('0x1e')]=qs[_0xefcd('0x1e')](_0x20bd5d[_0xefcd('0x2f')]['limit']);_0x3b7a34[_0xefcd('0x1c')]=qs[_0xefcd('0x1c')](_0x20bd5d[_0xefcd('0x2f')]['offset']);}_0x3b7a34[_0xefcd('0x35')]=qs['sort'](_0x20bd5d[_0xefcd('0x2f')]['sort']);_0x3b7a34[_0xefcd('0x36')]=qs[_0xefcd('0x31')](_[_0xefcd('0x37')](_0x20bd5d[_0xefcd('0x2f')],_0x5b1e80['filters']),_0x1101e9);if(_0x20bd5d[_0xefcd('0x2f')]['filter']){_0x3b7a34['where']=_['merge'](_0x3b7a34['where'],{'$or':_[_0xefcd('0x38')](_0x1101e9,function(_0x10c0b7){if(_0x10c0b7[_0xefcd('0x2d')]!=='VIRTUAL'){var _0x30ab1e={};_0x30ab1e[_0x10c0b7[_0xefcd('0x27')]]={'$like':'%'+_0x20bd5d['query'][_0xefcd('0x39')]+'%'};return _0x30ab1e;}})});}_0x3b7a34=_[_0xefcd('0x3a')]({},_0x3b7a34,_0x20bd5d[_0xefcd('0x3b')]);var _0x38eaf2={'where':_0x3b7a34[_0xefcd('0x36')]};return db[_0xefcd('0x2a')]['count'](_0x38eaf2)['then'](function(_0x25aeac){_0x44ead0['count']=_0x25aeac;if(_0x20bd5d['query'][_0xefcd('0x3c')]){_0x3b7a34[_0xefcd('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x3b7a34);})[_0xefcd('0x24')](function(_0xc1e0fb){_0x44ead0[_0xefcd('0x3e')]=_0xc1e0fb;return _0x44ead0;})[_0xefcd('0x24')](respondWithFilteredResult(_0x48d7c3,_0x3b7a34))['catch'](handleError(_0x48d7c3,null));};exports['show']=function(_0x428dee,_0x276946){var _0x120892={'raw':!![],'where':{'id':_0x428dee[_0xefcd('0x3f')]['id']}},_0x29de71={};_0x29de71[_0xefcd('0x2e')]=_[_0xefcd('0x30')](db[_0xefcd('0x2a')][_0xefcd('0x2b')]);_0x29de71[_0xefcd('0x2f')]=_[_0xefcd('0x30')](_0x428dee['query']);_0x29de71['filters']=_[_0xefcd('0x32')](_0x29de71['model'],_0x29de71[_0xefcd('0x2f')]);_0x120892[_0xefcd('0x40')]=_[_0xefcd('0x32')](_0x29de71['model'],qs[_0xefcd('0x33')](_0x428dee[_0xefcd('0x2f')][_0xefcd('0x33')]));_0x120892[_0xefcd('0x40')]=_0x120892[_0xefcd('0x40')][_0xefcd('0x34')]?_0x120892[_0xefcd('0x40')]:_0x29de71[_0xefcd('0x2e')];if(_0x428dee[_0xefcd('0x2f')][_0xefcd('0x3c')]){_0x120892[_0xefcd('0x3d')]=[{'all':!![]}];}_0x120892=_[_0xefcd('0x3a')]({},_0x120892,_0x428dee['options']);return db[_0xefcd('0x2a')][_0xefcd('0x41')](_0x120892)['then'](handleEntityNotFound(_0x276946,null))[_0xefcd('0x24')](respondWithResult(_0x276946,null))[_0xefcd('0x42')](handleError(_0x276946,null));};exports[_0xefcd('0x43')]=function(_0x430de8,_0x2fbabd){return db['JscriptyQuestionReport']['create'](_0x430de8['body'],{})['then'](respondWithResult(_0x2fbabd,0xc9))[_0xefcd('0x42')](handleError(_0x2fbabd,null));};exports[_0xefcd('0x44')]=function(_0x30819f,_0x3943a3){if(_0x30819f[_0xefcd('0x45')]['id']){delete _0x30819f['body']['id'];}return db[_0xefcd('0x2a')][_0xefcd('0x41')]({'where':{'id':_0x30819f['params']['id']}})['then'](handleEntityNotFound(_0x3943a3,null))[_0xefcd('0x24')](saveUpdates(_0x30819f[_0xefcd('0x45')],null))[_0xefcd('0x24')](respondWithResult(_0x3943a3,null))[_0xefcd('0x42')](handleError(_0x3943a3,null));};exports[_0xefcd('0x23')]=function(_0x3f51e9,_0x5ef4d3){return db[_0xefcd('0x2a')][_0xefcd('0x41')]({'where':{'id':_0x3f51e9[_0xefcd('0x3f')]['id']}})[_0xefcd('0x24')](handleEntityNotFound(_0x5ef4d3,null))[_0xefcd('0x24')](removeEntity(_0x5ef4d3,null))[_0xefcd('0x42')](handleError(_0x5ef4d3,null));};exports['describe']=function(_0x40ef13,_0x3307eb){return db[_0xefcd('0x2a')][_0xefcd('0x46')]()[_0xefcd('0x24')](respondWithResult(_0x3307eb,null))[_0xefcd('0x42')](handleError(_0x3307eb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 06a8a81..d3d0c2c 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 _0x6846=['bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x6846,0xcb));var _0x6684=function(_0x5be068,_0x18b0b8){_0x5be068=_0x5be068-0x0;var _0x5bc2a5=_0x6846[_0x5be068];return _0x5bc2a5;};'use strict';var _=require(_0x6684('0x0'));var util=require(_0x6684('0x1'));var logger=require(_0x6684('0x2'))(_0x6684('0x3'));var moment=require(_0x6684('0x4'));var BPromise=require(_0x6684('0x5'));var rp=require(_0x6684('0x6'));var fs=require('fs');var path=require(_0x6684('0x7'));var rimraf=require(_0x6684('0x8'));var config=require('../../config/environment');var attributes=require(_0x6684('0x9'));module[_0x6684('0xa')]=function(_0x2aba4d,_0x407be5){return _0x2aba4d[_0x6684('0xb')]('JscriptyQuestionReport',attributes,{'tableName':_0x6684('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8430=['path','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','request-promise'];(function(_0x3d0c0a,_0x569519){var _0x338e0e=function(_0x50f9aa){while(--_0x50f9aa){_0x3d0c0a['push'](_0x3d0c0a['shift']());}};_0x338e0e(++_0x569519);}(_0x8430,0x1db));var _0x0843=function(_0x1c7b33,_0x381cc5){_0x1c7b33=_0x1c7b33-0x0;var _0x154be0=_0x8430[_0x1c7b33];return _0x154be0;};'use strict';var _=require(_0x0843('0x0'));var util=require(_0x0843('0x1'));var logger=require(_0x0843('0x2'))(_0x0843('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0843('0x4'));var fs=require('fs');var path=require(_0x0843('0x5'));var rimraf=require('rimraf');var config=require(_0x0843('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x0843('0x7')]=function(_0x3c9715,_0x735520){return _0x3c9715['define'](_0x0843('0x8'),attributes,{'tableName':_0x0843('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 8bf3a49..4fd21a7 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 _0x9e72=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x23958b,_0x341953){var _0x10849d=function(_0x551fd3){while(--_0x551fd3){_0x23958b['push'](_0x23958b['shift']());}};_0x10849d(++_0x341953);}(_0x9e72,0xfe));var _0x29e7=function(_0x42135e,_0x5f4b26){_0x42135e=_0x42135e-0x0;var _0x11b9a8=_0x9e72[_0x42135e];return _0x11b9a8;};'use strict';var _=require(_0x29e7('0x0'));var util=require(_0x29e7('0x1'));var moment=require(_0x29e7('0x2'));var BPromise=require(_0x29e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29e7('0x4'));var db=require(_0x29e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29e7('0x6'))(_0x29e7('0x7'));var config=require('../../config/environment');var jayson=require(_0x29e7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5fc3,_0x5cf24d,_0x47fb54){return new BPromise(function(_0x254324,_0x1b05cc){return client[_0x29e7('0x9')](_0x3e5fc3,_0x47fb54)[_0x29e7('0xa')](function(_0x5beb62){logger[_0x29e7('0xb')](_0x29e7('0xc'),_0x5cf24d,_0x29e7('0xd'));logger[_0x29e7('0xe')](_0x29e7('0xf'),_0x5cf24d,_0x29e7('0xd'),JSON[_0x29e7('0x10')](_0x5beb62));if(_0x5beb62[_0x29e7('0x11')]){if(_0x5beb62['error'][_0x29e7('0x12')]===0x1f4){logger[_0x29e7('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5cf24d,_0x5beb62['error']['message']);return _0x1b05cc(_0x5beb62[_0x29e7('0x11')][_0x29e7('0x13')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5cf24d,_0x5beb62[_0x29e7('0x11')][_0x29e7('0x13')]);return _0x254324(_0x5beb62[_0x29e7('0x11')][_0x29e7('0x13')]);}else{logger[_0x29e7('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5cf24d,_0x29e7('0xd'));_0x254324(_0x5beb62['result'][_0x29e7('0x13')]);}})[_0x29e7('0x14')](function(_0x459dc9){logger['error'](_0x29e7('0xc'),_0x5cf24d,_0x459dc9);_0x1b05cc(_0x459dc9);});});} \ No newline at end of file +var _0xaba7=['catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info'];(function(_0x5d8800,_0xf61eeb){var _0x4a8f53=function(_0x1f7a82){while(--_0x1f7a82){_0x5d8800['push'](_0x5d8800['shift']());}};_0x4a8f53(++_0xf61eeb);}(_0xaba7,0xe8));var _0x7aba=function(_0x319891,_0x9b28dc){_0x319891=_0x319891-0x0;var _0x8df70c=_0xaba7[_0x319891];return _0x8df70c;};'use strict';var _=require(_0x7aba('0x0'));var util=require('util');var moment=require(_0x7aba('0x1'));var BPromise=require('bluebird');var rs=require(_0x7aba('0x2'));var fs=require('fs');var Redis=require(_0x7aba('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7aba('0x4'))(_0x7aba('0x5'));var config=require('../../config/environment');var jayson=require(_0x7aba('0x6'));var client=jayson[_0x7aba('0x7')][_0x7aba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x376ceb,_0x53df04,_0x5931fd){return new BPromise(function(_0x3cd0ec,_0x256161){return client[_0x7aba('0x9')](_0x376ceb,_0x5931fd)[_0x7aba('0xa')](function(_0x2244a5){logger['info'](_0x7aba('0xb'),_0x53df04,_0x7aba('0xc'));logger[_0x7aba('0xd')](_0x7aba('0xe'),_0x53df04,_0x7aba('0xc'),JSON[_0x7aba('0xf')](_0x2244a5));if(_0x2244a5['error']){if(_0x2244a5['error'][_0x7aba('0x10')]===0x1f4){logger[_0x7aba('0x11')](_0x7aba('0xb'),_0x53df04,_0x2244a5[_0x7aba('0x11')][_0x7aba('0x12')]);return _0x256161(_0x2244a5[_0x7aba('0x11')][_0x7aba('0x12')]);}logger[_0x7aba('0x11')](_0x7aba('0xb'),_0x53df04,_0x2244a5[_0x7aba('0x11')][_0x7aba('0x12')]);return _0x3cd0ec(_0x2244a5[_0x7aba('0x11')][_0x7aba('0x12')]);}else{logger[_0x7aba('0x13')](_0x7aba('0xb'),_0x53df04,_0x7aba('0xc'));_0x3cd0ec(_0x2244a5['result'][_0x7aba('0x12')]);}})[_0x7aba('0x14')](function(_0x5b4fb1){logger[_0x7aba('0x11')](_0x7aba('0xb'),_0x53df04,_0x5b4fb1);_0x256161(_0x5b4fb1);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index bf1c866..c6a60b0 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 _0x7084=['../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','/describe','describe','/:id','/:id/questions','getQuestions','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x56ccc9,_0x5be3ed){var _0x2b7480=function(_0xec66cd){while(--_0xec66cd){_0x56ccc9['push'](_0x56ccc9['shift']());}};_0x2b7480(++_0x5be3ed);}(_0x7084,0x8c));var _0x4708=function(_0x2072a7,_0x286fbe){_0x2072a7=_0x2072a7-0x0;var _0x572539=_0x7084[_0x2072a7];return _0x572539;};'use strict';var multer=require(_0x4708('0x0'));var util=require(_0x4708('0x1'));var path=require(_0x4708('0x2'));var timeout=require('connect-timeout');var express=require(_0x4708('0x3'));var router=express['Router']();var fs_extra=require(_0x4708('0x4'));var auth=require(_0x4708('0x5'));var interaction=require(_0x4708('0x6'));var config=require(_0x4708('0x7'));var controller=require(_0x4708('0x8'));router['get']('/',auth[_0x4708('0x9')](),controller['index']);router[_0x4708('0xa')](_0x4708('0xb'),auth[_0x4708('0x9')](),controller[_0x4708('0xc')]);router[_0x4708('0xa')](_0x4708('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4708('0xa')](_0x4708('0xe'),auth[_0x4708('0x9')](),controller[_0x4708('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4708('0x10')]);router[_0x4708('0x11')](_0x4708('0xd'),auth['isAuthenticated'](),controller[_0x4708('0x12')]);router[_0x4708('0x13')](_0x4708('0xd'),auth['isAuthenticated'](),controller[_0x4708('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9f2d=['getQuestions','create','update','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/questions'];(function(_0x32ee8f,_0x26da8a){var _0x2fc956=function(_0x5bf3ac){while(--_0x5bf3ac){_0x32ee8f['push'](_0x32ee8f['shift']());}};_0x2fc956(++_0x26da8a);}(_0x9f2d,0x11c));var _0xd9f2=function(_0x33620f,_0x36f2db){_0x33620f=_0x33620f-0x0;var _0x58faff=_0x9f2d[_0x33620f];return _0x58faff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd9f2('0x0'));var timeout=require('connect-timeout');var express=require(_0xd9f2('0x1'));var router=express[_0xd9f2('0x2')]();var fs_extra=require(_0xd9f2('0x3'));var auth=require(_0xd9f2('0x4'));var interaction=require(_0xd9f2('0x5'));var config=require(_0xd9f2('0x6'));var controller=require(_0xd9f2('0x7'));router[_0xd9f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9f2('0x9')]);router['get'](_0xd9f2('0xa'),auth[_0xd9f2('0xb')](),controller[_0xd9f2('0xc')]);router[_0xd9f2('0x8')](_0xd9f2('0xd'),auth[_0xd9f2('0xb')](),controller[_0xd9f2('0xe')]);router['get'](_0xd9f2('0xf'),auth[_0xd9f2('0xb')](),controller[_0xd9f2('0x10')]);router['post']('/',auth[_0xd9f2('0xb')](),controller[_0xd9f2('0x11')]);router['put'](_0xd9f2('0xd'),auth[_0xd9f2('0xb')](),controller[_0xd9f2('0x12')]);router['delete'](_0xd9f2('0xd'),auth[_0xd9f2('0xb')](),controller[_0xd9f2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7d497f6..115b74f 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 _0x25b4=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize','DATE','setDataValue','starttime'];(function(_0xf3f0cc,_0x5a6ff3){var _0x30935a=function(_0x180114){while(--_0x180114){_0xf3f0cc['push'](_0xf3f0cc['shift']());}};_0x30935a(++_0x5a6ff3);}(_0x25b4,0x94));var _0x425b=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x25b4[_0x6a0266];return _0x309e00;};'use strict';var moment=require('moment');var Sequelize=require(_0x425b('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x425b('0x1')],'set':function(_0x343aee){this[_0x425b('0x2')](_0x425b('0x3'),_0x343aee);this[_0x425b('0x2')](_0x425b('0x4'),moment()[_0x425b('0x5')](_0x425b('0x6')));}},'endtime':{'type':Sequelize[_0x425b('0x1')]},'membername':{'type':Sequelize[_0x425b('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x425b('0x7')]},'uniqueid':{'type':Sequelize[_0x425b('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x425b('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb955=['STRING','moment','sequelize','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x467ea1,_0x18fd97){var _0x1c9fc7=function(_0x57cfbb){while(--_0x57cfbb){_0x467ea1['push'](_0x467ea1['shift']());}};_0x1c9fc7(++_0x18fd97);}(_0xb955,0x123));var _0x5b95=function(_0x58c705,_0x23b527){_0x58c705=_0x58c705-0x0;var _0x8e6cff=_0xb955[_0x58c705];return _0x8e6cff;};'use strict';var moment=require(_0x5b95('0x0'));var Sequelize=require(_0x5b95('0x1'));module[_0x5b95('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x51f9e5){this[_0x5b95('0x3')](_0x5b95('0x4'),_0x51f9e5);this[_0x5b95('0x3')](_0x5b95('0x5'),moment()[_0x5b95('0x6')](_0x5b95('0x7')));}},'endtime':{'type':Sequelize[_0x5b95('0x8')]},'membername':{'type':Sequelize[_0x5b95('0x9')]},'projectname':{'type':Sequelize[_0x5b95('0x9')]},'queue':{'type':Sequelize[_0x5b95('0x9')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5b95('0x9')]},'calleridnum':{'type':Sequelize[_0x5b95('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index ec0b907..58add9a 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 _0xf598=['end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','index','JscriptySessionReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','getQuestions','findOne','keys','JscriptyQuestionReport','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x564105,_0x3d0d3a){var _0x5b68f7=function(_0x8de0e7){while(--_0x8de0e7){_0x564105['push'](_0x564105['shift']());}};_0x5b68f7(++_0x3d0d3a);}(_0xf598,0x16f));var _0x8f59=function(_0x26d90b,_0x5c7d26){_0x26d90b=_0x26d90b-0x0;var _0x115a63=_0xf598[_0x26d90b];return _0x115a63;};'use strict';var emlformat=require(_0x8f59('0x0'));var rimraf=require(_0x8f59('0x1'));var zipdir=require(_0x8f59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f59('0x3'));var moment=require(_0x8f59('0x4'));var BPromise=require(_0x8f59('0x5'));var Mustache=require(_0x8f59('0x6'));var util=require(_0x8f59('0x7'));var path=require(_0x8f59('0x8'));var sox=require(_0x8f59('0x9'));var csv=require(_0x8f59('0xa'));var ejs=require(_0x8f59('0xb'));var fs=require('fs');var fs_extra=require(_0x8f59('0xc'));var _=require(_0x8f59('0xd'));var squel=require(_0x8f59('0xe'));var crypto=require(_0x8f59('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8f59('0x10'));var toCsv=require(_0x8f59('0xa'));var querystring=require('querystring');var Papa=require(_0x8f59('0x11'));var Redis=require(_0x8f59('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8f59('0x13'));var as=require(_0x8f59('0x14'));var hardwareService=require(_0x8f59('0x15'));var logger=require(_0x8f59('0x16'))(_0x8f59('0x17'));var utils=require(_0x8f59('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8f59('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2534b9,_0x4f10a9){_0x4f10a9=_0x4f10a9||0xcc;return function(_0x5a13bb){if(_0x5a13bb){return _0x2534b9[_0x8f59('0x1a')](_0x4f10a9);}return _0x2534b9[_0x8f59('0x1b')](_0x4f10a9)[_0x8f59('0x1c')]();};}function respondWithResult(_0x3733ae,_0x25033c){_0x25033c=_0x25033c||0xc8;return function(_0xc0e924){if(_0xc0e924){return _0x3733ae[_0x8f59('0x1b')](_0x25033c)[_0x8f59('0x1d')](_0xc0e924);}};}function respondWithFilteredResult(_0x15f1cd,_0x210084){return function(_0x3cc8ef){if(_0x3cc8ef){var _0x553014=typeof _0x210084[_0x8f59('0x1e')]===_0x8f59('0x1f')&&typeof _0x210084[_0x8f59('0x20')]===_0x8f59('0x1f');var _0x26b7f3=_0x3cc8ef[_0x8f59('0x21')];var _0x3d6934=_0x553014?0x0:_0x210084[_0x8f59('0x1e')];var _0x45da6e=_0x553014?_0x3cc8ef[_0x8f59('0x21')]:_0x210084[_0x8f59('0x1e')]+_0x210084['limit'];var _0x56d0bc;if(_0x45da6e>=_0x26b7f3){_0x45da6e=_0x26b7f3;_0x56d0bc=0xc8;}else{_0x56d0bc=0xce;}_0x15f1cd['status'](_0x56d0bc);return _0x15f1cd[_0x8f59('0x22')]('Content-Range',_0x3d6934+'-'+_0x45da6e+'/'+_0x26b7f3)['json'](_0x3cc8ef);}return null;};}function patchUpdates(_0x350457){return function(_0x2ccb69){try{jsonpatch[_0x8f59('0x23')](_0x2ccb69,_0x350457,!![]);}catch(_0x24dfbd){return BPromise[_0x8f59('0x24')](_0x24dfbd);}return _0x2ccb69['save']();};}function saveUpdates(_0x5727da,_0x3d3e36){return function(_0x9ec9fb){if(_0x9ec9fb){return _0x9ec9fb[_0x8f59('0x25')](_0x5727da)[_0x8f59('0x26')](function(_0x2182de){return _0x2182de;});}return null;};}function removeEntity(_0x3abeae,_0x5f3d41){return function(_0x45df0d){if(_0x45df0d){return _0x45df0d[_0x8f59('0x27')]()[_0x8f59('0x26')](function(){_0x3abeae[_0x8f59('0x1b')](0xcc)[_0x8f59('0x1c')]();});}};}function handleEntityNotFound(_0x3b6b3d,_0x6c5ee7){return function(_0x542e96){if(!_0x542e96){_0x3b6b3d[_0x8f59('0x1a')](0x194);}return _0x542e96;};}function handleError(_0x2d9c1e,_0x41a9a5){_0x41a9a5=_0x41a9a5||0x1f4;return function(_0x55184d){logger[_0x8f59('0x28')](_0x55184d['stack']);if(_0x55184d[_0x8f59('0x29')]){delete _0x55184d[_0x8f59('0x29')];}_0x2d9c1e[_0x8f59('0x1b')](_0x41a9a5)['send'](_0x55184d);};}exports[_0x8f59('0x2a')]=function(_0x33cfef,_0x2b356c){var _0x50d285={},_0x194cba={},_0x5e24f8={'count':0x0,'rows':[]};var _0x1e623e=_['map'](db[_0x8f59('0x2b')][_0x8f59('0x2c')],function(_0x1b53c6){return{'name':_0x1b53c6[_0x8f59('0x2d')],'type':_0x1b53c6['type'][_0x8f59('0x2e')]};});_0x194cba[_0x8f59('0x2f')]=_['map'](_0x1e623e,'name');_0x194cba[_0x8f59('0x30')]=_['keys'](_0x33cfef[_0x8f59('0x30')]);_0x194cba[_0x8f59('0x31')]=_[_0x8f59('0x32')](_0x194cba['model'],_0x194cba['query']);_0x50d285[_0x8f59('0x33')]=_[_0x8f59('0x32')](_0x194cba[_0x8f59('0x2f')],qs[_0x8f59('0x34')](_0x33cfef['query'][_0x8f59('0x34')]));_0x50d285['attributes']=_0x50d285['attributes'][_0x8f59('0x35')]?_0x50d285[_0x8f59('0x33')]:_0x194cba[_0x8f59('0x2f')];if(!_0x33cfef[_0x8f59('0x30')]['hasOwnProperty'](_0x8f59('0x36'))){_0x50d285[_0x8f59('0x20')]=qs[_0x8f59('0x20')](_0x33cfef[_0x8f59('0x30')]['limit']);_0x50d285['offset']=qs[_0x8f59('0x1e')](_0x33cfef[_0x8f59('0x30')][_0x8f59('0x1e')]);}_0x50d285[_0x8f59('0x37')]=qs[_0x8f59('0x38')](_0x33cfef[_0x8f59('0x30')]['sort']);_0x50d285[_0x8f59('0x39')]=qs[_0x8f59('0x31')](_[_0x8f59('0x3a')](_0x33cfef['query'],_0x194cba[_0x8f59('0x31')]),_0x1e623e);if(_0x33cfef['query'][_0x8f59('0x3b')]){_0x50d285[_0x8f59('0x39')]=_['merge'](_0x50d285['where'],{'$or':_[_0x8f59('0x3c')](_0x1e623e,function(_0x27acea){if(_0x27acea['type']!=='VIRTUAL'){var _0x1cf4ca={};_0x1cf4ca[_0x27acea[_0x8f59('0x29')]]={'$like':'%'+_0x33cfef[_0x8f59('0x30')][_0x8f59('0x3b')]+'%'};return _0x1cf4ca;}})});}_0x50d285=_[_0x8f59('0x3d')]({},_0x50d285,_0x33cfef['options']);var _0x41893d={'where':_0x50d285[_0x8f59('0x39')]};return db[_0x8f59('0x2b')][_0x8f59('0x21')](_0x41893d)[_0x8f59('0x26')](function(_0x46f011){_0x5e24f8[_0x8f59('0x21')]=_0x46f011;if(_0x33cfef['query']['includeAll']){_0x50d285[_0x8f59('0x3e')]=[{'all':!![]}];}return db[_0x8f59('0x2b')][_0x8f59('0x3f')](_0x50d285);})[_0x8f59('0x26')](function(_0x5d908e){_0x5e24f8[_0x8f59('0x40')]=_0x5d908e;return _0x5e24f8;})[_0x8f59('0x26')](respondWithFilteredResult(_0x2b356c,_0x50d285))[_0x8f59('0x41')](handleError(_0x2b356c,null));};exports[_0x8f59('0x42')]=function(_0xd9bac1,_0x381d7b){var _0x23485b={'raw':!![],'where':{'id':_0xd9bac1[_0x8f59('0x43')]['id']}},_0x14d8b4={};_0x14d8b4[_0x8f59('0x2f')]=_['keys'](db[_0x8f59('0x2b')][_0x8f59('0x2c')]);_0x14d8b4['query']=_['keys'](_0xd9bac1[_0x8f59('0x30')]);_0x14d8b4['filters']=_[_0x8f59('0x32')](_0x14d8b4['model'],_0x14d8b4[_0x8f59('0x30')]);_0x23485b[_0x8f59('0x33')]=_[_0x8f59('0x32')](_0x14d8b4[_0x8f59('0x2f')],qs[_0x8f59('0x34')](_0xd9bac1['query'][_0x8f59('0x34')]));_0x23485b['attributes']=_0x23485b[_0x8f59('0x33')]['length']?_0x23485b[_0x8f59('0x33')]:_0x14d8b4['model'];if(_0xd9bac1[_0x8f59('0x30')][_0x8f59('0x44')]){_0x23485b[_0x8f59('0x3e')]=[{'all':!![]}];}_0x23485b=_[_0x8f59('0x3d')]({},_0x23485b,_0xd9bac1[_0x8f59('0x45')]);return db[_0x8f59('0x2b')][_0x8f59('0x46')](_0x23485b)['then'](handleEntityNotFound(_0x381d7b,null))[_0x8f59('0x26')](respondWithResult(_0x381d7b,null))['catch'](handleError(_0x381d7b,null));};exports['create']=function(_0x438bee,_0x256124){return db['JscriptySessionReport'][_0x8f59('0x47')](_0x438bee[_0x8f59('0x48')],{})[_0x8f59('0x26')](respondWithResult(_0x256124,0xc9))['catch'](handleError(_0x256124,null));};exports[_0x8f59('0x25')]=function(_0x306c32,_0x400157){if(_0x306c32[_0x8f59('0x48')]['id']){delete _0x306c32[_0x8f59('0x48')]['id'];}return db[_0x8f59('0x2b')][_0x8f59('0x46')]({'where':{'id':_0x306c32[_0x8f59('0x43')]['id']}})[_0x8f59('0x26')](handleEntityNotFound(_0x400157,null))[_0x8f59('0x26')](saveUpdates(_0x306c32['body'],null))['then'](respondWithResult(_0x400157,null))['catch'](handleError(_0x400157,null));};exports[_0x8f59('0x27')]=function(_0x54a12a,_0x1fbe24){return db[_0x8f59('0x2b')][_0x8f59('0x46')]({'where':{'id':_0x54a12a['params']['id']}})[_0x8f59('0x26')](handleEntityNotFound(_0x1fbe24,null))[_0x8f59('0x26')](removeEntity(_0x1fbe24,null))[_0x8f59('0x41')](handleError(_0x1fbe24,null));};exports[_0x8f59('0x49')]=function(_0x1fa77d,_0x242665){return db['JscriptySessionReport'][_0x8f59('0x49')]()['then'](respondWithResult(_0x242665,null))[_0x8f59('0x41')](handleError(_0x242665,null));};exports[_0x8f59('0x4a')]=function(_0x126f8f,_0x1960bb,_0x150ae1){var _0x439037={'raw':!![],'where':{}};var _0xa0935e={};var _0x46ca81={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x8f59('0x4b')]({'where':{'id':_0x126f8f[_0x8f59('0x43')]['id']}})['then'](handleEntityNotFound(_0x1960bb,null))['then'](function(_0x3a6027){if(_0x3a6027){_0xa0935e['model']=_[_0x8f59('0x4c')](db[_0x8f59('0x4d')][_0x8f59('0x2c')]);_0xa0935e[_0x8f59('0x30')]=_['keys'](_0x126f8f[_0x8f59('0x30')]);_0xa0935e[_0x8f59('0x31')]=_[_0x8f59('0x32')](_0xa0935e[_0x8f59('0x2f')],_0xa0935e[_0x8f59('0x30')]);_0x439037['attributes']=_[_0x8f59('0x32')](_0xa0935e['model'],qs['fields'](_0x126f8f[_0x8f59('0x30')][_0x8f59('0x34')]));_0x439037[_0x8f59('0x33')]=_0x439037[_0x8f59('0x33')]['length']?_0x439037[_0x8f59('0x33')]:_0xa0935e['model'];if(!_0x126f8f[_0x8f59('0x30')][_0x8f59('0x4e')](_0x8f59('0x36'))){_0x439037['limit']=qs[_0x8f59('0x20')](_0x126f8f[_0x8f59('0x30')][_0x8f59('0x20')]);_0x439037[_0x8f59('0x1e')]=qs['offset'](_0x126f8f[_0x8f59('0x30')][_0x8f59('0x1e')]);}_0x439037[_0x8f59('0x37')]=qs[_0x8f59('0x38')](_0x126f8f[_0x8f59('0x30')][_0x8f59('0x38')]);_0x439037[_0x8f59('0x39')]=qs[_0x8f59('0x31')](_[_0x8f59('0x3a')](_0x126f8f[_0x8f59('0x30')],_0xa0935e['filters']));_0x439037['where']['SessionId']=_0x3a6027['id'];if(_0x126f8f[_0x8f59('0x30')][_0x8f59('0x3b')]){_0x439037[_0x8f59('0x39')]=_['merge'](_0x439037[_0x8f59('0x39')],{'$or':_[_0x8f59('0x3c')](_0x439037[_0x8f59('0x33')],function(_0x387182){var _0x525ab3={};_0x525ab3[_0x387182]={'$like':'%'+_0x126f8f[_0x8f59('0x30')]['filter']+'%'};return _0x525ab3;})});}_0x439037=_[_0x8f59('0x3d')]({},_0x439037,_0x126f8f[_0x8f59('0x45')]);return db[_0x8f59('0x4d')]['count']({'where':_0x439037['where']})[_0x8f59('0x26')](function(_0x59362d){_0x46ca81[_0x8f59('0x21')]=_0x59362d;if(_0x126f8f['query'][_0x8f59('0x44')]){_0x439037[_0x8f59('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8f59('0x3f')](_0x439037);})[_0x8f59('0x26')](function(_0xea609f){_0x46ca81[_0x8f59('0x40')]=_0xea609f;return _0x46ca81;});}})['then'](respondWithFilteredResult(_0x1960bb,_0x439037))[_0x8f59('0x41')](handleError(_0x1960bb,null));}; \ No newline at end of file +var _0xc3c2=['rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','where','filters','pick','filter','merge','options','JscriptySessionReport','includeAll','findAll','show','params','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','sort','SessionId','rows','eml-format','fast-json-patch','moment','bluebird','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x3438d4,_0x4296e7){var _0x332e06=function(_0x1297e3){while(--_0x1297e3){_0x3438d4['push'](_0x3438d4['shift']());}};_0x332e06(++_0x4296e7);}(_0xc3c2,0x6d));var _0x2c3c=function(_0x52c062,_0x449490){_0x52c062=_0x52c062-0x0;var _0x5a1a03=_0xc3c2[_0x52c062];return _0x5a1a03;};'use strict';var emlformat=require(_0x2c3c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2c3c('0x1'));var rp=require('request-promise');var moment=require(_0x2c3c('0x2'));var BPromise=require(_0x2c3c('0x3'));var Mustache=require('mustache');var util=require(_0x2c3c('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2c3c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c3c('0x6'));var squel=require(_0x2c3c('0x7'));var crypto=require(_0x2c3c('0x8'));var jsforce=require(_0x2c3c('0x9'));var deskjs=require(_0x2c3c('0xa'));var toCsv=require(_0x2c3c('0x5'));var querystring=require(_0x2c3c('0xb'));var Papa=require(_0x2c3c('0xc'));var Redis=require(_0x2c3c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2c3c('0xe'));var as=require(_0x2c3c('0xf'));var hardwareService=require(_0x2c3c('0x10'));var logger=require(_0x2c3c('0x11'))(_0x2c3c('0x12'));var utils=require(_0x2c3c('0x13'));var config=require(_0x2c3c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c3c('0x15'))['db'];function respondWithStatusCode(_0x203242,_0xbea04c){_0xbea04c=_0xbea04c||0xcc;return function(_0x79e244){if(_0x79e244){return _0x203242[_0x2c3c('0x16')](_0xbea04c);}return _0x203242[_0x2c3c('0x17')](_0xbea04c)[_0x2c3c('0x18')]();};}function respondWithResult(_0x30231e,_0x3cccae){_0x3cccae=_0x3cccae||0xc8;return function(_0x459eba){if(_0x459eba){return _0x30231e['status'](_0x3cccae)['json'](_0x459eba);}};}function respondWithFilteredResult(_0x2ab7ab,_0x3ee1a5){return function(_0x981a6e){if(_0x981a6e){var _0x4a83fc=typeof _0x3ee1a5[_0x2c3c('0x19')]===_0x2c3c('0x1a')&&typeof _0x3ee1a5['limit']==='undefined';var _0x50c09e=_0x981a6e[_0x2c3c('0x1b')];var _0x5e8b0f=_0x4a83fc?0x0:_0x3ee1a5[_0x2c3c('0x19')];var _0x3ce0bd=_0x4a83fc?_0x981a6e['count']:_0x3ee1a5[_0x2c3c('0x19')]+_0x3ee1a5[_0x2c3c('0x1c')];var _0x32d9c9;if(_0x3ce0bd>=_0x50c09e){_0x3ce0bd=_0x50c09e;_0x32d9c9=0xc8;}else{_0x32d9c9=0xce;}_0x2ab7ab['status'](_0x32d9c9);return _0x2ab7ab[_0x2c3c('0x1d')](_0x2c3c('0x1e'),_0x5e8b0f+'-'+_0x3ce0bd+'/'+_0x50c09e)[_0x2c3c('0x1f')](_0x981a6e);}return null;};}function patchUpdates(_0x48aaf1){return function(_0x34aa69){try{jsonpatch['apply'](_0x34aa69,_0x48aaf1,!![]);}catch(_0x18945b){return BPromise[_0x2c3c('0x20')](_0x18945b);}return _0x34aa69[_0x2c3c('0x21')]();};}function saveUpdates(_0x3b8a57,_0x5e11f1){return function(_0xc3d5f6){if(_0xc3d5f6){return _0xc3d5f6[_0x2c3c('0x22')](_0x3b8a57)['then'](function(_0x2f3ef8){return _0x2f3ef8;});}return null;};}function removeEntity(_0x506611,_0x2eaa26){return function(_0x627220){if(_0x627220){return _0x627220[_0x2c3c('0x23')]()[_0x2c3c('0x24')](function(){_0x506611[_0x2c3c('0x17')](0xcc)[_0x2c3c('0x18')]();});}};}function handleEntityNotFound(_0x425279,_0x94b7cb){return function(_0x430ff5){if(!_0x430ff5){_0x425279[_0x2c3c('0x16')](0x194);}return _0x430ff5;};}function handleError(_0x2666c7,_0x5c4486){_0x5c4486=_0x5c4486||0x1f4;return function(_0x1973d0){logger[_0x2c3c('0x25')](_0x1973d0[_0x2c3c('0x26')]);if(_0x1973d0[_0x2c3c('0x27')]){delete _0x1973d0['name'];}_0x2666c7[_0x2c3c('0x17')](_0x5c4486)[_0x2c3c('0x28')](_0x1973d0);};}exports[_0x2c3c('0x29')]=function(_0x445e25,_0xc01bd2){var _0x501da0={},_0x4833f7={},_0x102a58={'count':0x0,'rows':[]};var _0x28b59c=_[_0x2c3c('0x2a')](db['JscriptySessionReport'][_0x2c3c('0x2b')],function(_0x5bd6ed){return{'name':_0x5bd6ed['fieldName'],'type':_0x5bd6ed[_0x2c3c('0x2c')]['key']};});_0x4833f7[_0x2c3c('0x2d')]=_['map'](_0x28b59c,_0x2c3c('0x27'));_0x4833f7[_0x2c3c('0x2e')]=_[_0x2c3c('0x2f')](_0x445e25[_0x2c3c('0x2e')]);_0x4833f7['filters']=_[_0x2c3c('0x30')](_0x4833f7[_0x2c3c('0x2d')],_0x4833f7[_0x2c3c('0x2e')]);_0x501da0[_0x2c3c('0x31')]=_[_0x2c3c('0x30')](_0x4833f7[_0x2c3c('0x2d')],qs[_0x2c3c('0x32')](_0x445e25[_0x2c3c('0x2e')][_0x2c3c('0x32')]));_0x501da0[_0x2c3c('0x31')]=_0x501da0[_0x2c3c('0x31')][_0x2c3c('0x33')]?_0x501da0[_0x2c3c('0x31')]:_0x4833f7['model'];if(!_0x445e25[_0x2c3c('0x2e')]['hasOwnProperty'](_0x2c3c('0x34'))){_0x501da0[_0x2c3c('0x1c')]=qs[_0x2c3c('0x1c')](_0x445e25[_0x2c3c('0x2e')]['limit']);_0x501da0['offset']=qs[_0x2c3c('0x19')](_0x445e25[_0x2c3c('0x2e')][_0x2c3c('0x19')]);}_0x501da0[_0x2c3c('0x35')]=qs['sort'](_0x445e25[_0x2c3c('0x2e')]['sort']);_0x501da0[_0x2c3c('0x36')]=qs[_0x2c3c('0x37')](_[_0x2c3c('0x38')](_0x445e25[_0x2c3c('0x2e')],_0x4833f7['filters']),_0x28b59c);if(_0x445e25[_0x2c3c('0x2e')][_0x2c3c('0x39')]){_0x501da0[_0x2c3c('0x36')]=_[_0x2c3c('0x3a')](_0x501da0[_0x2c3c('0x36')],{'$or':_[_0x2c3c('0x2a')](_0x28b59c,function(_0x3ca2f4){if(_0x3ca2f4[_0x2c3c('0x2c')]!=='VIRTUAL'){var _0x4df45b={};_0x4df45b[_0x3ca2f4['name']]={'$like':'%'+_0x445e25['query'][_0x2c3c('0x39')]+'%'};return _0x4df45b;}})});}_0x501da0=_['merge']({},_0x501da0,_0x445e25[_0x2c3c('0x3b')]);var _0x2926ad={'where':_0x501da0[_0x2c3c('0x36')]};return db[_0x2c3c('0x3c')][_0x2c3c('0x1b')](_0x2926ad)[_0x2c3c('0x24')](function(_0x2b5261){_0x102a58['count']=_0x2b5261;if(_0x445e25[_0x2c3c('0x2e')][_0x2c3c('0x3d')]){_0x501da0['include']=[{'all':!![]}];}return db[_0x2c3c('0x3c')][_0x2c3c('0x3e')](_0x501da0);})['then'](function(_0x57d642){_0x102a58['rows']=_0x57d642;return _0x102a58;})[_0x2c3c('0x24')](respondWithFilteredResult(_0xc01bd2,_0x501da0))['catch'](handleError(_0xc01bd2,null));};exports[_0x2c3c('0x3f')]=function(_0x5bed73,_0x5f38c5){var _0x3a01d6={'raw':!![],'where':{'id':_0x5bed73[_0x2c3c('0x40')]['id']}},_0x145447={};_0x145447[_0x2c3c('0x2d')]=_[_0x2c3c('0x2f')](db[_0x2c3c('0x3c')]['rawAttributes']);_0x145447[_0x2c3c('0x2e')]=_[_0x2c3c('0x2f')](_0x5bed73['query']);_0x145447['filters']=_['intersection'](_0x145447[_0x2c3c('0x2d')],_0x145447[_0x2c3c('0x2e')]);_0x3a01d6[_0x2c3c('0x31')]=_[_0x2c3c('0x30')](_0x145447[_0x2c3c('0x2d')],qs['fields'](_0x5bed73['query'][_0x2c3c('0x32')]));_0x3a01d6['attributes']=_0x3a01d6['attributes']['length']?_0x3a01d6[_0x2c3c('0x31')]:_0x145447['model'];if(_0x5bed73[_0x2c3c('0x2e')][_0x2c3c('0x3d')]){_0x3a01d6['include']=[{'all':!![]}];}_0x3a01d6=_['merge']({},_0x3a01d6,_0x5bed73['options']);return db['JscriptySessionReport'][_0x2c3c('0x41')](_0x3a01d6)[_0x2c3c('0x24')](handleEntityNotFound(_0x5f38c5,null))[_0x2c3c('0x24')](respondWithResult(_0x5f38c5,null))[_0x2c3c('0x42')](handleError(_0x5f38c5,null));};exports[_0x2c3c('0x43')]=function(_0x543ab5,_0x4e0abb){return db['JscriptySessionReport'][_0x2c3c('0x43')](_0x543ab5[_0x2c3c('0x44')],{})[_0x2c3c('0x24')](respondWithResult(_0x4e0abb,0xc9))[_0x2c3c('0x42')](handleError(_0x4e0abb,null));};exports[_0x2c3c('0x22')]=function(_0x365ea9,_0x1cd986){if(_0x365ea9[_0x2c3c('0x44')]['id']){delete _0x365ea9[_0x2c3c('0x44')]['id'];}return db['JscriptySessionReport'][_0x2c3c('0x41')]({'where':{'id':_0x365ea9[_0x2c3c('0x40')]['id']}})[_0x2c3c('0x24')](handleEntityNotFound(_0x1cd986,null))[_0x2c3c('0x24')](saveUpdates(_0x365ea9['body'],null))['then'](respondWithResult(_0x1cd986,null))[_0x2c3c('0x42')](handleError(_0x1cd986,null));};exports[_0x2c3c('0x23')]=function(_0x1093e2,_0x272e92){return db[_0x2c3c('0x3c')]['find']({'where':{'id':_0x1093e2[_0x2c3c('0x40')]['id']}})[_0x2c3c('0x24')](handleEntityNotFound(_0x272e92,null))[_0x2c3c('0x24')](removeEntity(_0x272e92,null))['catch'](handleError(_0x272e92,null));};exports[_0x2c3c('0x45')]=function(_0x1b0050,_0x1f573a){return db[_0x2c3c('0x3c')][_0x2c3c('0x45')]()[_0x2c3c('0x24')](respondWithResult(_0x1f573a,null))[_0x2c3c('0x42')](handleError(_0x1f573a,null));};exports[_0x2c3c('0x46')]=function(_0x332fd2,_0x34a0b1,_0xde9458){var _0x224870={'raw':!![],'where':{}};var _0x1fa1bc={};var _0x30862f={'count':0x0,'rows':[]};return db[_0x2c3c('0x3c')][_0x2c3c('0x47')]({'where':{'id':_0x332fd2[_0x2c3c('0x40')]['id']}})[_0x2c3c('0x24')](handleEntityNotFound(_0x34a0b1,null))[_0x2c3c('0x24')](function(_0x4ec854){if(_0x4ec854){_0x1fa1bc[_0x2c3c('0x2d')]=_[_0x2c3c('0x2f')](db[_0x2c3c('0x48')][_0x2c3c('0x2b')]);_0x1fa1bc['query']=_['keys'](_0x332fd2[_0x2c3c('0x2e')]);_0x1fa1bc['filters']=_[_0x2c3c('0x30')](_0x1fa1bc[_0x2c3c('0x2d')],_0x1fa1bc['query']);_0x224870[_0x2c3c('0x31')]=_[_0x2c3c('0x30')](_0x1fa1bc[_0x2c3c('0x2d')],qs[_0x2c3c('0x32')](_0x332fd2[_0x2c3c('0x2e')]['fields']));_0x224870[_0x2c3c('0x31')]=_0x224870[_0x2c3c('0x31')][_0x2c3c('0x33')]?_0x224870[_0x2c3c('0x31')]:_0x1fa1bc[_0x2c3c('0x2d')];if(!_0x332fd2['query']['hasOwnProperty'](_0x2c3c('0x34'))){_0x224870[_0x2c3c('0x1c')]=qs[_0x2c3c('0x1c')](_0x332fd2[_0x2c3c('0x2e')][_0x2c3c('0x1c')]);_0x224870[_0x2c3c('0x19')]=qs[_0x2c3c('0x19')](_0x332fd2[_0x2c3c('0x2e')][_0x2c3c('0x19')]);}_0x224870[_0x2c3c('0x35')]=qs[_0x2c3c('0x49')](_0x332fd2['query'][_0x2c3c('0x49')]);_0x224870['where']=qs['filters'](_['pick'](_0x332fd2['query'],_0x1fa1bc[_0x2c3c('0x37')]));_0x224870[_0x2c3c('0x36')][_0x2c3c('0x4a')]=_0x4ec854['id'];if(_0x332fd2['query'][_0x2c3c('0x39')]){_0x224870[_0x2c3c('0x36')]=_['merge'](_0x224870['where'],{'$or':_[_0x2c3c('0x2a')](_0x224870['attributes'],function(_0x3b8fe6){var _0x18acde={};_0x18acde[_0x3b8fe6]={'$like':'%'+_0x332fd2[_0x2c3c('0x2e')]['filter']+'%'};return _0x18acde;})});}_0x224870=_['merge']({},_0x224870,_0x332fd2['options']);return db['JscriptyQuestionReport']['count']({'where':_0x224870[_0x2c3c('0x36')]})[_0x2c3c('0x24')](function(_0x4a2849){_0x30862f[_0x2c3c('0x1b')]=_0x4a2849;if(_0x332fd2[_0x2c3c('0x2e')][_0x2c3c('0x3d')]){_0x224870['include']=[{'all':!![]}];}return db[_0x2c3c('0x48')][_0x2c3c('0x3e')](_0x224870);})[_0x2c3c('0x24')](function(_0x9a20e){_0x30862f[_0x2c3c('0x4b')]=_0x9a20e;return _0x30862f;});}})[_0x2c3c('0x24')](respondWithFilteredResult(_0x34a0b1,_0x224870))[_0x2c3c('0x42')](handleError(_0x34a0b1,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3be52a3..19b82d9 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 _0xe14b=['bluebird','path','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','moment'];(function(_0x4f9668,_0x4e01f7){var _0x5c06fb=function(_0x34b662){while(--_0x34b662){_0x4f9668['push'](_0x4f9668['shift']());}};_0x5c06fb(++_0x4e01f7);}(_0xe14b,0x93));var _0xbe14=function(_0x80a76b,_0x3a7abf){_0x80a76b=_0x80a76b-0x0;var _0x2c4266=_0xe14b[_0x80a76b];return _0x2c4266;};'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 _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x4f30d7,_0x5d9c70){var _0x4910c2=function(_0x7006ad){while(--_0x7006ad){_0x4f30d7['push'](_0x4f30d7['shift']());}};_0x4910c2(++_0x5d9c70);}(_0x038b,0x114));var _0xb038=function(_0xdc78bf,_0x157280){_0xdc78bf=_0xdc78bf-0x0;var _0xc6791d=_0x038b[_0xdc78bf];return _0xc6791d;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 2cc05ea..184634a 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 _0x7046=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3e53b1,_0x3c9ea6){var _0x457fbc=function(_0x3bbc8c){while(--_0x3bbc8c){_0x3e53b1['push'](_0x3e53b1['shift']());}};_0x457fbc(++_0x3c9ea6);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});} \ No newline at end of file +var _0x0424=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x0424,0x159));var _0x4042=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x0424[_0x3238ea];return _0x4aaac2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6419e91..7b0db43 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 _0x4945=['isAuthenticated','update','/download_log_file','downloadLogFile','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id'];(function(_0x1c8243,_0x2ecaf7){var _0x1c188c=function(_0x439e86){while(--_0x439e86){_0x1c8243['push'](_0x1c8243['shift']());}};_0x1c188c(++_0x2ecaf7);}(_0x4945,0x1be));var _0x5494=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x4945[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0x5494('0x0'));var path=require(_0x5494('0x1'));var timeout=require(_0x5494('0x2'));var express=require(_0x5494('0x3'));var router=express[_0x5494('0x4')]();var fs_extra=require(_0x5494('0x5'));var auth=require(_0x5494('0x6'));var interaction=require(_0x5494('0x7'));var config=require(_0x5494('0x8'));var controller=require(_0x5494('0x9'));router[_0x5494('0xa')]('/',controller[_0x5494('0xb')]);router['put'](_0x5494('0xc'),auth[_0x5494('0xd')](),controller[_0x5494('0xe')]);router[_0x5494('0xa')](_0x5494('0xf'),auth[_0x5494('0xd')](),controller[_0x5494('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4aca=['get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x4aca,0x195));var _0xa4ac=function(_0x2a1e03,_0x12c122){_0x2a1e03=_0x2a1e03-0x0;var _0x5b94b6=_0x4aca[_0x2a1e03];return _0x5b94b6;};'use strict';var multer=require('multer');var util=require(_0xa4ac('0x0'));var path=require(_0xa4ac('0x1'));var timeout=require(_0xa4ac('0x2'));var express=require(_0xa4ac('0x3'));var router=express['Router']();var fs_extra=require(_0xa4ac('0x4'));var auth=require(_0xa4ac('0x5'));var interaction=require(_0xa4ac('0x6'));var config=require(_0xa4ac('0x7'));var controller=require(_0xa4ac('0x8'));router[_0xa4ac('0x9')]('/',controller[_0xa4ac('0xa')]);router[_0xa4ac('0xb')](_0xa4ac('0xc'),auth[_0xa4ac('0xd')](),controller[_0xa4ac('0xe')]);router[_0xa4ac('0x9')](_0xa4ac('0xf'),auth[_0xa4ac('0xd')](),controller[_0xa4ac('0x10')]);module[_0xa4ac('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 949cb49..537a32c 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 _0x5642=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x33a0a3,_0x14b449){var _0x509dac=function(_0x4ae0bb){while(--_0x4ae0bb){_0x33a0a3['push'](_0x33a0a3['shift']());}};_0x509dac(++_0x14b449);}(_0x5642,0x192));var _0x2564=function(_0x4708eb,_0x9ba6f7){_0x4708eb=_0x4708eb-0x0;var _0xccc1a3=_0x5642[_0x4708eb];return _0xccc1a3;};'use strict';var Sequelize=require(_0x2564('0x0'));module[_0x2564('0x1')]={'license':{'type':Sequelize[_0x2564('0x2')]},'data1':{'type':Sequelize[_0x2564('0x3')]},'data2':{'type':Sequelize[_0x2564('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x2564('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x21a1=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x3c1312,_0x45bfdb){var _0x5b4831=function(_0x53706f){while(--_0x53706f){_0x3c1312['push'](_0x3c1312['shift']());}};_0x5b4831(++_0x45bfdb);}(_0x21a1,0x1b1));var _0x121a=function(_0x4aeff0,_0x52546b){_0x4aeff0=_0x4aeff0-0x0;var _0x39d4c5=_0x21a1[_0x4aeff0];return _0x39d4c5;};'use strict';var Sequelize=require(_0x121a('0x0'));module[_0x121a('0x1')]={'license':{'type':Sequelize[_0x121a('0x2')]},'data1':{'type':Sequelize[_0x121a('0x3')]},'data2':{'type':Sequelize[_0x121a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x121a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 2beed67..3ad5052 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 _0xa766=['name','send','index','model','License','query','filters','intersection','attributes','fields','merge','getLicense','catch','update','body','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','then','destroy','end','error','stack'];(function(_0x27e86e,_0x49d030){var _0x57d83e=function(_0x425a6e){while(--_0x425a6e){_0x27e86e['push'](_0x27e86e['shift']());}};_0x57d83e(++_0x49d030);}(_0xa766,0xa3));var _0x6a76=function(_0x516fa1,_0xada0d7){_0x516fa1=_0x516fa1-0x0;var _0x240b0c=_0xa766[_0x516fa1];return _0x240b0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a76('0x0'));var zipdir=require(_0x6a76('0x1'));var jsonpatch=require(_0x6a76('0x2'));var rp=require(_0x6a76('0x3'));var moment=require(_0x6a76('0x4'));var BPromise=require(_0x6a76('0x5'));var Mustache=require(_0x6a76('0x6'));var util=require(_0x6a76('0x7'));var path=require(_0x6a76('0x8'));var sox=require(_0x6a76('0x9'));var csv=require(_0x6a76('0xa'));var ejs=require(_0x6a76('0xb'));var fs=require('fs');var fs_extra=require(_0x6a76('0xc'));var _=require(_0x6a76('0xd'));var squel=require(_0x6a76('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a76('0xa'));var querystring=require('querystring');var Papa=require(_0x6a76('0xf'));var Redis=require(_0x6a76('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a76('0x11'));var hardwareService=require(_0x6a76('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6a76('0x13'));var db=require(_0x6a76('0x14'))['db'];function respondWithStatusCode(_0x2d01b0,_0x5b98d9){_0x5b98d9=_0x5b98d9||0xcc;return function(_0x1a3d6a){if(_0x1a3d6a){return _0x2d01b0[_0x6a76('0x15')](_0x5b98d9);}return _0x2d01b0['status'](_0x5b98d9)['end']();};}function respondWithResult(_0x57bc3d,_0xe03bc4){_0xe03bc4=_0xe03bc4||0xc8;return function(_0x5cfd0f){if(_0x5cfd0f){return _0x57bc3d[_0x6a76('0x16')](_0xe03bc4)['json'](_0x5cfd0f);}};}function respondWithFilteredResult(_0x31c571,_0x36d6b9){return function(_0x23471d){if(_0x23471d){var _0x4ed0a7=typeof _0x36d6b9[_0x6a76('0x17')]==='undefined'&&typeof _0x36d6b9[_0x6a76('0x18')]===_0x6a76('0x19');var _0x17212c=_0x23471d['count'];var _0x275404=_0x4ed0a7?0x0:_0x36d6b9['offset'];var _0x39c273=_0x4ed0a7?_0x23471d[_0x6a76('0x1a')]:_0x36d6b9[_0x6a76('0x17')]+_0x36d6b9[_0x6a76('0x18')];var _0x1ca103;if(_0x39c273>=_0x17212c){_0x39c273=_0x17212c;_0x1ca103=0xc8;}else{_0x1ca103=0xce;}_0x31c571[_0x6a76('0x16')](_0x1ca103);return _0x31c571[_0x6a76('0x1b')]('Content-Range',_0x275404+'-'+_0x39c273+'/'+_0x17212c)[_0x6a76('0x1c')](_0x23471d);}return null;};}function patchUpdates(_0x57a380){return function(_0x45277e){try{jsonpatch[_0x6a76('0x1d')](_0x45277e,_0x57a380,!![]);}catch(_0x1e3ca0){return BPromise['reject'](_0x1e3ca0);}return _0x45277e['save']();};}function saveUpdates(_0x3715ca,_0x56608){return function(_0xb10dd9){if(_0xb10dd9){return _0xb10dd9['update'](_0x3715ca)[_0x6a76('0x1e')](function(_0x3e4ba0){return _0x3e4ba0;});}return null;};}function removeEntity(_0x2fc310,_0x390d79){return function(_0x274390){if(_0x274390){return _0x274390[_0x6a76('0x1f')]()[_0x6a76('0x1e')](function(){_0x2fc310[_0x6a76('0x16')](0xcc)[_0x6a76('0x20')]();});}};}function handleEntityNotFound(_0x157dac,_0x256e00){return function(_0x3edc23){if(!_0x3edc23){_0x157dac[_0x6a76('0x15')](0x194);}return _0x3edc23;};}function handleError(_0x2bf077,_0x34f87c){_0x34f87c=_0x34f87c||0x1f4;return function(_0x50fbb3){logger[_0x6a76('0x21')](_0x50fbb3[_0x6a76('0x22')]);if(_0x50fbb3[_0x6a76('0x23')]){delete _0x50fbb3[_0x6a76('0x23')];}_0x2bf077['status'](_0x34f87c)[_0x6a76('0x24')](_0x50fbb3);};}var utilLicense=require(_0x6a76('0x13'));exports[_0x6a76('0x25')]=function(_0x3ff1f6,_0x2602fa){var _0x39b003={'raw':!![],'where':{'id':0x1}},_0x3d20ad={};_0x3d20ad[_0x6a76('0x26')]=_['keys'](db[_0x6a76('0x27')]['rawAttributes']);_0x3d20ad[_0x6a76('0x28')]=_['keys'](_0x3ff1f6[_0x6a76('0x28')]);_0x3d20ad[_0x6a76('0x29')]=_[_0x6a76('0x2a')](_0x3d20ad['model'],_0x3d20ad['query']);_0x39b003[_0x6a76('0x2b')]=_['intersection'](_0x3d20ad[_0x6a76('0x26')],qs['fields'](_0x3ff1f6[_0x6a76('0x28')][_0x6a76('0x2c')]));_0x39b003[_0x6a76('0x2b')]=_0x39b003['attributes']['length']?_0x39b003[_0x6a76('0x2b')]:_0x3d20ad[_0x6a76('0x26')];_0x39b003=_[_0x6a76('0x2d')]({},_0x39b003,_0x3ff1f6['options']);return utilLicense[_0x6a76('0x2e')](_0x39b003)['then'](respondWithResult(_0x2602fa,null))[_0x6a76('0x2f')](handleError(_0x2602fa,null));};exports[_0x6a76('0x30')]=function(_0x1ef814,_0x2d4e9d){if(_0x1ef814[_0x6a76('0x31')]['id']){delete _0x1ef814[_0x6a76('0x31')]['id'];}return db[_0x6a76('0x27')][_0x6a76('0x32')]({'where':{'id':_0x1ef814[_0x6a76('0x33')]['id']}})['then'](handleEntityNotFound(_0x2d4e9d,null))[_0x6a76('0x1e')](function(_0xce688c){var _0x4a813d=_0xce688c[_0x6a76('0x34')]({'plain':!![]});return utilLicense[_0x6a76('0x35')](_0x4a813d,_0x1ef814[_0x6a76('0x31')][_0x6a76('0x36')]);})[_0x6a76('0x1e')](function(_0x229053){if(!_0x229053[_0x6a76('0x37')]){return saveUpdates(_0x1ef814[_0x6a76('0x31')],null);}return _0x229053;})['then'](respondWithResult(_0x2d4e9d,null))[_0x6a76('0x2f')](handleError(_0x2d4e9d,null));};exports[_0x6a76('0x38')]=function(_0x36d0da,_0x29c21b){var _0x492345=_0x6a76('0x39');var _0x302202=path[_0x6a76('0x3a')]('/var',_0x6a76('0x3b'),'xcally',_0x492345);_0x29c21b[_0x6a76('0x3c')](_0x6a76('0x3d'),_0x6a76('0x3e')+_0x492345);_0x29c21b[_0x6a76('0x1b')](_0x6a76('0x3f'),_0x6a76('0x40'));_0x29c21b[_0x6a76('0x41')](_0x302202);}; \ No newline at end of file +var _0x1f4b=['reject','save','then','destroy','error','name','index','rawAttributes','keys','query','intersection','model','fields','attributes','merge','getLicense','catch','update','body','License','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','/var','log','xcally','setHeader','attachment;\x20filename=','Content-Type','download','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x32554e,_0x2e45fa){var _0x398088=function(_0x4da197){while(--_0x4da197){_0x32554e['push'](_0x32554e['shift']());}};_0x398088(++_0x2e45fa);}(_0x1f4b,0x16d));var _0xb1f4=function(_0x6b3f9c,_0x433d66){_0x6b3f9c=_0x6b3f9c-0x0;var _0x4178e3=_0x1f4b[_0x6b3f9c];return _0x4178e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1f4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1f4('0x1'));var rp=require(_0xb1f4('0x2'));var moment=require(_0xb1f4('0x3'));var BPromise=require(_0xb1f4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb1f4('0x5'));var csv=require(_0xb1f4('0x6'));var ejs=require(_0xb1f4('0x7'));var fs=require('fs');var fs_extra=require(_0xb1f4('0x8'));var _=require(_0xb1f4('0x9'));var squel=require(_0xb1f4('0xa'));var crypto=require(_0xb1f4('0xb'));var jsforce=require(_0xb1f4('0xc'));var deskjs=require(_0xb1f4('0xd'));var toCsv=require(_0xb1f4('0x6'));var querystring=require('querystring');var Papa=require(_0xb1f4('0xe'));var Redis=require('ioredis');var authService=require(_0xb1f4('0xf'));var qs=require(_0xb1f4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1f4('0x11'))(_0xb1f4('0x12'));var utils=require(_0xb1f4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb1f4('0x14'))['db'];function respondWithStatusCode(_0x1815c3,_0x857dd6){_0x857dd6=_0x857dd6||0xcc;return function(_0x51b336){if(_0x51b336){return _0x1815c3[_0xb1f4('0x15')](_0x857dd6);}return _0x1815c3[_0xb1f4('0x16')](_0x857dd6)[_0xb1f4('0x17')]();};}function respondWithResult(_0x54f6dd,_0x1236e2){_0x1236e2=_0x1236e2||0xc8;return function(_0x3d565f){if(_0x3d565f){return _0x54f6dd[_0xb1f4('0x16')](_0x1236e2)['json'](_0x3d565f);}};}function respondWithFilteredResult(_0x296d80,_0x1fba88){return function(_0x132163){if(_0x132163){var _0x521897=typeof _0x1fba88[_0xb1f4('0x18')]==='undefined'&&typeof _0x1fba88[_0xb1f4('0x19')]===_0xb1f4('0x1a');var _0x3bc98b=_0x132163[_0xb1f4('0x1b')];var _0x886ca9=_0x521897?0x0:_0x1fba88[_0xb1f4('0x18')];var _0x97218f=_0x521897?_0x132163[_0xb1f4('0x1b')]:_0x1fba88[_0xb1f4('0x18')]+_0x1fba88['limit'];var _0x51c714;if(_0x97218f>=_0x3bc98b){_0x97218f=_0x3bc98b;_0x51c714=0xc8;}else{_0x51c714=0xce;}_0x296d80[_0xb1f4('0x16')](_0x51c714);return _0x296d80[_0xb1f4('0x1c')](_0xb1f4('0x1d'),_0x886ca9+'-'+_0x97218f+'/'+_0x3bc98b)['json'](_0x132163);}return null;};}function patchUpdates(_0x5ce13e){return function(_0x48ba69){try{jsonpatch[_0xb1f4('0x1e')](_0x48ba69,_0x5ce13e,!![]);}catch(_0xb9544){return BPromise[_0xb1f4('0x1f')](_0xb9544);}return _0x48ba69[_0xb1f4('0x20')]();};}function saveUpdates(_0x3e2dc3,_0x19d107){return function(_0x3b5109){if(_0x3b5109){return _0x3b5109['update'](_0x3e2dc3)[_0xb1f4('0x21')](function(_0x9bcba5){return _0x9bcba5;});}return null;};}function removeEntity(_0x3d1d2d,_0x19eaf5){return function(_0x5db651){if(_0x5db651){return _0x5db651[_0xb1f4('0x22')]()['then'](function(){_0x3d1d2d['status'](0xcc)[_0xb1f4('0x17')]();});}};}function handleEntityNotFound(_0x1dfd69,_0x303554){return function(_0x171e50){if(!_0x171e50){_0x1dfd69[_0xb1f4('0x15')](0x194);}return _0x171e50;};}function handleError(_0x317253,_0x40d8f7){_0x40d8f7=_0x40d8f7||0x1f4;return function(_0x526f79){logger[_0xb1f4('0x23')](_0x526f79['stack']);if(_0x526f79[_0xb1f4('0x24')]){delete _0x526f79[_0xb1f4('0x24')];}_0x317253[_0xb1f4('0x16')](_0x40d8f7)['send'](_0x526f79);};}var utilLicense=require('../../config/license/util');exports[_0xb1f4('0x25')]=function(_0x2bd38f,_0x544136){var _0x500ee2={'raw':!![],'where':{'id':0x1}},_0x1c4260={};_0x1c4260['model']=_['keys'](db['License'][_0xb1f4('0x26')]);_0x1c4260['query']=_[_0xb1f4('0x27')](_0x2bd38f[_0xb1f4('0x28')]);_0x1c4260['filters']=_[_0xb1f4('0x29')](_0x1c4260[_0xb1f4('0x2a')],_0x1c4260[_0xb1f4('0x28')]);_0x500ee2['attributes']=_[_0xb1f4('0x29')](_0x1c4260[_0xb1f4('0x2a')],qs[_0xb1f4('0x2b')](_0x2bd38f[_0xb1f4('0x28')][_0xb1f4('0x2b')]));_0x500ee2[_0xb1f4('0x2c')]=_0x500ee2['attributes']['length']?_0x500ee2[_0xb1f4('0x2c')]:_0x1c4260[_0xb1f4('0x2a')];_0x500ee2=_[_0xb1f4('0x2d')]({},_0x500ee2,_0x2bd38f['options']);return utilLicense[_0xb1f4('0x2e')](_0x500ee2)[_0xb1f4('0x21')](respondWithResult(_0x544136,null))[_0xb1f4('0x2f')](handleError(_0x544136,null));};exports[_0xb1f4('0x30')]=function(_0x2a9e98,_0xa9364a){if(_0x2a9e98['body']['id']){delete _0x2a9e98[_0xb1f4('0x31')]['id'];}return db[_0xb1f4('0x32')][_0xb1f4('0x33')]({'where':{'id':_0x2a9e98[_0xb1f4('0x34')]['id']}})[_0xb1f4('0x21')](handleEntityNotFound(_0xa9364a,null))[_0xb1f4('0x21')](function(_0x3acc40){var _0x130c45=_0x3acc40[_0xb1f4('0x35')]({'plain':!![]});return utilLicense[_0xb1f4('0x36')](_0x130c45,_0x2a9e98[_0xb1f4('0x31')][_0xb1f4('0x37')]);})[_0xb1f4('0x21')](function(_0x57f0ba){if(!_0x57f0ba[_0xb1f4('0x38')]){return saveUpdates(_0x2a9e98[_0xb1f4('0x31')],null);}return _0x57f0ba;})[_0xb1f4('0x21')](respondWithResult(_0xa9364a,null))[_0xb1f4('0x2f')](handleError(_0xa9364a,null));};exports[_0xb1f4('0x39')]=function(_0x4d9d23,_0x376432){var _0x31f801=_0xb1f4('0x3a');var _0x291ee4=path['join'](_0xb1f4('0x3b'),_0xb1f4('0x3c'),_0xb1f4('0x3d'),_0x31f801);_0x376432[_0xb1f4('0x3e')]('Content-disposition',_0xb1f4('0x3f')+_0x31f801);_0x376432[_0xb1f4('0x1c')](_0xb1f4('0x40'),'text/plain');_0x376432[_0xb1f4('0x41')](_0x291ee4);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c2c09c4..175915b 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 _0x453c=['license','lodash','moment','path','rimraf','./license.attributes','License'];(function(_0x5efdb2,_0x3dde91){var _0x3b8d17=function(_0x1d5cf4){while(--_0x1d5cf4){_0x5efdb2['push'](_0x5efdb2['shift']());}};_0x3b8d17(++_0x3dde91);}(_0x453c,0x1e4));var _0xc453=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x453c[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require(_0xc453('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc453('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc453('0x2'));var rimraf=require(_0xc453('0x3'));var config=require('../../config/environment');var attributes=require(_0xc453('0x4'));module['exports']=function(_0x56fd87,_0x19d307){return _0x56fd87['define'](_0xc453('0x5'),attributes,{'tableName':_0xc453('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9245=['license','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./license.attributes','define'];(function(_0x1e6278,_0x4e4342){var _0x259fa2=function(_0x35e99e){while(--_0x35e99e){_0x1e6278['push'](_0x1e6278['shift']());}};_0x259fa2(++_0x4e4342);}(_0x9245,0x12d));var _0x5924=function(_0x51ebf7,_0x5aed3e){_0x51ebf7=_0x51ebf7-0x0;var _0x3c64f2=_0x9245[_0x51ebf7];return _0x3c64f2;};'use strict';var _=require(_0x5924('0x0'));var util=require('util');var logger=require(_0x5924('0x1'))(_0x5924('0x2'));var moment=require(_0x5924('0x3'));var BPromise=require(_0x5924('0x4'));var rp=require(_0x5924('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5924('0x6'));var attributes=require(_0x5924('0x7'));module['exports']=function(_0xe92a5b,_0x54f313){return _0xe92a5b[_0x5924('0x8')]('License',attributes,{'tableName':_0x5924('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 4e34f13..0f84a23 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 _0x3e30=['ioredis','../../config/logger','rpc','client','request','then','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x42f883,_0xb2aac1){var _0x180944=function(_0x2172b7){while(--_0x2172b7){_0x42f883['push'](_0x42f883['shift']());}};_0x180944(++_0xb2aac1);}(_0x3e30,0x18a));var _0x03e3=function(_0x494c01,_0x5a74fe){_0x494c01=_0x494c01-0x0;var _0x584980=_0x3e30[_0x494c01];return _0x584980;};'use strict';var _=require(_0x03e3('0x0'));var util=require(_0x03e3('0x1'));var moment=require(_0x03e3('0x2'));var BPromise=require(_0x03e3('0x3'));var rs=require(_0x03e3('0x4'));var fs=require('fs');var Redis=require(_0x03e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03e3('0x6'))(_0x03e3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x03e3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56b2a5,_0xb1c13a,_0x449f42){return new BPromise(function(_0x4646ad,_0x3a5088){return client[_0x03e3('0x9')](_0x56b2a5,_0x449f42)[_0x03e3('0xa')](function(_0x49c70c){logger['info']('License,\x20%s,\x20%s',_0xb1c13a,_0x03e3('0xb'));logger['debug'](_0x03e3('0xc'),_0xb1c13a,'request\x20sent',JSON[_0x03e3('0xd')](_0x49c70c));if(_0x49c70c[_0x03e3('0xe')]){if(_0x49c70c['error'][_0x03e3('0xf')]===0x1f4){logger[_0x03e3('0xe')](_0x03e3('0x10'),_0xb1c13a,_0x49c70c['error'][_0x03e3('0x11')]);return _0x3a5088(_0x49c70c[_0x03e3('0xe')][_0x03e3('0x11')]);}logger['error'](_0x03e3('0x10'),_0xb1c13a,_0x49c70c[_0x03e3('0xe')][_0x03e3('0x11')]);return _0x4646ad(_0x49c70c[_0x03e3('0xe')][_0x03e3('0x11')]);}else{logger[_0x03e3('0x12')](_0x03e3('0x10'),_0xb1c13a,'request\x20sent');_0x4646ad(_0x49c70c[_0x03e3('0x13')][_0x03e3('0x11')]);}})[_0x03e3('0x14')](function(_0x20b40b){logger[_0x03e3('0xe')](_0x03e3('0x10'),_0xb1c13a,_0x20b40b);_0x3a5088(_0x20b40b);});});} \ No newline at end of file +var _0xcaed=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4a721e,_0x5550c6){var _0x51e78e=function(_0x12197f){while(--_0x12197f){_0x4a721e['push'](_0x4a721e['shift']());}};_0x51e78e(++_0x5550c6);}(_0xcaed,0x170));var _0xdcae=function(_0x306ac7,_0x2b3e46){_0x306ac7=_0x306ac7-0x0;var _0x1cd36d=_0xcaed[_0x306ac7];return _0x1cd36d;};'use strict';var _=require(_0xdcae('0x0'));var util=require('util');var moment=require(_0xdcae('0x1'));var BPromise=require('bluebird');var rs=require(_0xdcae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcae('0x3'))['db'];var utils=require(_0xdcae('0x4'));var logger=require('../../config/logger')(_0xdcae('0x5'));var config=require(_0xdcae('0x6'));var jayson=require(_0xdcae('0x7'));var client=jayson[_0xdcae('0x8')][_0xdcae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x480567,_0x83fd03,_0x150220){return new BPromise(function(_0x54eb10,_0x42c4dc){return client[_0xdcae('0xa')](_0x480567,_0x150220)[_0xdcae('0xb')](function(_0x58d4b6){logger[_0xdcae('0xc')](_0xdcae('0xd'),_0x83fd03,_0xdcae('0xe'));logger[_0xdcae('0xf')](_0xdcae('0x10'),_0x83fd03,_0xdcae('0xe'),JSON[_0xdcae('0x11')](_0x58d4b6));if(_0x58d4b6[_0xdcae('0x12')]){if(_0x58d4b6[_0xdcae('0x12')][_0xdcae('0x13')]===0x1f4){logger[_0xdcae('0x12')]('License,\x20%s,\x20%s',_0x83fd03,_0x58d4b6[_0xdcae('0x12')][_0xdcae('0x14')]);return _0x42c4dc(_0x58d4b6[_0xdcae('0x12')][_0xdcae('0x14')]);}logger[_0xdcae('0x12')](_0xdcae('0xd'),_0x83fd03,_0x58d4b6[_0xdcae('0x12')][_0xdcae('0x14')]);return _0x54eb10(_0x58d4b6[_0xdcae('0x12')]['message']);}else{logger[_0xdcae('0xc')](_0xdcae('0xd'),_0x83fd03,_0xdcae('0xe'));_0x54eb10(_0x58d4b6['result']['message']);}})['catch'](function(_0x4faf53){logger[_0xdcae('0x12')](_0xdcae('0xd'),_0x83fd03,_0x4faf53);_0x42c4dc(_0x4faf53);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9746c0c..08d6a61 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 _0x7018=['/:id/interactions','addInteraction','/:id/applications','/:id/send','send','addAgents','put','update','delete','removeImap','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/canned_answers','create','addImap','addSmtp'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x7018,0xe7));var _0x8701=function(_0x573a3e,_0x2ba5f4){_0x573a3e=_0x573a3e-0x0;var _0x5b45f5=_0x7018[_0x573a3e];return _0x5b45f5;};'use strict';var multer=require(_0x8701('0x0'));var util=require('util');var path=require(_0x8701('0x1'));var timeout=require('connect-timeout');var express=require(_0x8701('0x2'));var router=express[_0x8701('0x3')]();var fs_extra=require(_0x8701('0x4'));var auth=require(_0x8701('0x5'));var interaction=require(_0x8701('0x6'));var config=require(_0x8701('0x7'));var controller=require(_0x8701('0x8'));router[_0x8701('0x9')]('/',auth[_0x8701('0xa')](),controller[_0x8701('0xb')]);router[_0x8701('0x9')](_0x8701('0xc'),auth[_0x8701('0xa')](),controller[_0x8701('0xd')]);router[_0x8701('0x9')](_0x8701('0xe'),auth['isAuthenticated'](),controller[_0x8701('0xf')]);router['get'](_0x8701('0x10'),auth[_0x8701('0xa')](),controller['getDispositions']);router[_0x8701('0x9')]('/:id/canned_answers',auth[_0x8701('0xa')](),controller[_0x8701('0x11')]);router[_0x8701('0x9')](_0x8701('0x12'),auth['isAuthenticated'](),controller['getImap']);router[_0x8701('0x9')](_0x8701('0x13'),auth[_0x8701('0xa')](),controller[_0x8701('0x14')]);router['get']('/:id/interactions',auth[_0x8701('0xa')](),controller['getInteractions']);router[_0x8701('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8701('0x15')]);router[_0x8701('0x9')](_0x8701('0x16'),auth[_0x8701('0xa')](),controller[_0x8701('0x17')]);router[_0x8701('0x9')](_0x8701('0x18'),auth[_0x8701('0xa')](),controller[_0x8701('0x19')]);router['get'](_0x8701('0x1a'),auth['isAuthenticated'](),controller[_0x8701('0x1b')]);router['post'](_0x8701('0x10'),auth[_0x8701('0xa')](),controller['addDisposition']);router[_0x8701('0x1c')](_0x8701('0x1d'),auth[_0x8701('0xa')](),controller['addAnswer']);router[_0x8701('0x1c')]('/',auth[_0x8701('0xa')](),controller[_0x8701('0x1e')]);router[_0x8701('0x1c')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x8701('0x1f')]);router['post'](_0x8701('0x13'),auth['isAuthenticated'](),controller[_0x8701('0x20')]);router['post'](_0x8701('0x21'),auth[_0x8701('0xa')](),controller[_0x8701('0x22')]);router[_0x8701('0x1c')](_0x8701('0x23'),auth['isAuthenticated'](),controller['addApplications']);router[_0x8701('0x1c')](_0x8701('0x24'),auth[_0x8701('0xa')](),controller[_0x8701('0x25')]);router[_0x8701('0x1c')](_0x8701('0x1a'),auth[_0x8701('0xa')](),controller[_0x8701('0x26')]);router[_0x8701('0x27')]('/:id',auth[_0x8701('0xa')](),controller[_0x8701('0x28')]);router[_0x8701('0x29')](_0x8701('0x10'),auth[_0x8701('0xa')](),controller['removeDispositions']);router['delete'](_0x8701('0x1d'),auth[_0x8701('0xa')](),controller['removeAnswers']);router[_0x8701('0x29')](_0x8701('0x12'),auth[_0x8701('0xa')](),controller[_0x8701('0x2a')]);router['delete'](_0x8701('0x13'),auth[_0x8701('0xa')](),controller['removeSmtp']);router[_0x8701('0x29')](_0x8701('0xe'),auth[_0x8701('0xa')](),controller['destroy']);router[_0x8701('0x29')](_0x8701('0x1a'),auth[_0x8701('0xa')](),controller[_0x8701('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x39fc=['/:id/interactions','getInteractions','/:id/applications','getApplications','verifySmtp','/:id/users','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','addAgents','put','removeDispositions','delete','removeImap','removeSmtp','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAnswers','getImap','getSmtp'];(function(_0x54298d,_0x3aeda7){var _0x51acbc=function(_0x10a4b8){while(--_0x10a4b8){_0x54298d['push'](_0x54298d['shift']());}};_0x51acbc(++_0x3aeda7);}(_0x39fc,0xc8));var _0xc39f=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x39fc[_0xa990b7];return _0x52c99c;};'use strict';var multer=require(_0xc39f('0x0'));var util=require(_0xc39f('0x1'));var path=require(_0xc39f('0x2'));var timeout=require(_0xc39f('0x3'));var express=require(_0xc39f('0x4'));var router=express[_0xc39f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc39f('0x6'));var interaction=require(_0xc39f('0x7'));var config=require(_0xc39f('0x8'));var controller=require(_0xc39f('0x9'));router[_0xc39f('0xa')]('/',auth[_0xc39f('0xb')](),controller[_0xc39f('0xc')]);router[_0xc39f('0xa')](_0xc39f('0xd'),auth[_0xc39f('0xb')](),controller[_0xc39f('0xe')]);router[_0xc39f('0xa')](_0xc39f('0xf'),auth[_0xc39f('0xb')](),controller[_0xc39f('0x10')]);router[_0xc39f('0xa')]('/:id/dispositions',auth[_0xc39f('0xb')](),controller['getDispositions']);router[_0xc39f('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc39f('0x11')]);router[_0xc39f('0xa')]('/:id/in_servers',auth[_0xc39f('0xb')](),controller[_0xc39f('0x12')]);router['get']('/:id/out_servers',auth[_0xc39f('0xb')](),controller[_0xc39f('0x13')]);router[_0xc39f('0xa')](_0xc39f('0x14'),auth['isAuthenticated'](),controller[_0xc39f('0x15')]);router['get'](_0xc39f('0x16'),auth['isAuthenticated'](),controller[_0xc39f('0x17')]);router['get']('/:id/messages',auth[_0xc39f('0xb')](),controller['getMessages']);router[_0xc39f('0xa')]('/:id/verify',auth[_0xc39f('0xb')](),controller[_0xc39f('0x18')]);router[_0xc39f('0xa')](_0xc39f('0x19'),auth[_0xc39f('0xb')](),controller['getAgents']);router[_0xc39f('0x1a')](_0xc39f('0x1b'),auth['isAuthenticated'](),controller[_0xc39f('0x1c')]);router[_0xc39f('0x1a')](_0xc39f('0x1d'),auth[_0xc39f('0xb')](),controller[_0xc39f('0x1e')]);router[_0xc39f('0x1a')]('/',auth[_0xc39f('0xb')](),controller[_0xc39f('0x1f')]);router[_0xc39f('0x1a')](_0xc39f('0x20'),auth[_0xc39f('0xb')](),controller[_0xc39f('0x21')]);router[_0xc39f('0x1a')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xc39f('0x22')]);router[_0xc39f('0x1a')](_0xc39f('0x14'),auth[_0xc39f('0xb')](),controller[_0xc39f('0x23')]);router[_0xc39f('0x1a')](_0xc39f('0x16'),auth[_0xc39f('0xb')](),controller[_0xc39f('0x24')]);router[_0xc39f('0x1a')]('/:id/send',auth[_0xc39f('0xb')](),controller['send']);router[_0xc39f('0x1a')](_0xc39f('0x19'),auth['isAuthenticated'](),controller[_0xc39f('0x25')]);router[_0xc39f('0x26')](_0xc39f('0xf'),auth[_0xc39f('0xb')](),controller['update']);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc39f('0x27')]);router[_0xc39f('0x28')](_0xc39f('0x1d'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xc39f('0x20'),auth[_0xc39f('0xb')](),controller[_0xc39f('0x29')]);router[_0xc39f('0x28')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xc39f('0x2a')]);router[_0xc39f('0x28')](_0xc39f('0xf'),auth['isAuthenticated'](),controller[_0xc39f('0x2b')]);router[_0xc39f('0x28')](_0xc39f('0x19'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 06015be..050da3f 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 _0xe9d3=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','gmail','yahoo','outlook365','getDataValue','provider','custom','sequelize'];(function(_0x194482,_0x4556e9){var _0x38eaa2=function(_0x3167da){while(--_0x3167da){_0x194482['push'](_0x194482['shift']());}};_0x38eaa2(++_0x4556e9);}(_0xe9d3,0x131));var _0x3e9d=function(_0x62de1a,_0x26ce5a){_0x62de1a=_0x62de1a-0x0;var _0x5018b3=_0xe9d3[_0x62de1a];return _0x5018b3;};'use strict';var Sequelize=require(_0x3e9d('0x0'));module[_0x3e9d('0x1')]={'description':{'type':Sequelize[_0x3e9d('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3e9d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3e9d('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x3e9d('0x4')]},'markAsUnread':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3e9d('0x2')],'allowNull':![],'defaultValue':_0x3e9d('0x5')},'fontSize':{'type':Sequelize[_0x3e9d('0x6')](0x2)[_0x3e9d('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3e9d('0x4')],'defaultValue':function(){return _0x3e9d('0x8');}},'notificationSound':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e9d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e9d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x3e9d('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x3e9d('0x3')],'defaultValue':![],'comment':_0x3e9d('0xa'),'set':function(_0x15439e){if(!_0x15439e)this[_0x3e9d('0xb')]('mandatoryDispositionPauseId',null);this[_0x3e9d('0xb')]('mandatoryDisposition',_0x15439e);}},'provider':{'type':Sequelize['ENUM'](_0x3e9d('0xc'),'hotmail',_0x3e9d('0xd'),_0x3e9d('0xe')),'defaultValue':null,'get':function(){if(!this[_0x3e9d('0xf')](_0x3e9d('0x10')))return _0x3e9d('0x11');return this[_0x3e9d('0xf')]('provider');},'set':function(_0x3cd17c){if(_0x3cd17c===_0x3e9d('0x11'))_0x3cd17c=null;return this['setDataValue'](_0x3e9d('0x10'),_0x3cd17c);}}}; \ No newline at end of file +var _0xca49=['setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xca49,0x14c));var _0x9ca4=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xca49[_0x3794a0];return _0x5bdaba;};'use strict';var Sequelize=require(_0x9ca4('0x0'));module[_0x9ca4('0x1')]={'description':{'type':Sequelize[_0x9ca4('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9ca4('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9ca4('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x9ca4('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9ca4('0x5');}},'notificationSound':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9ca4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ca4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ca4('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9ca4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ca4('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9ca4('0x7'),'set':function(_0x4af8d6){if(!_0x4af8d6)this[_0x9ca4('0x8')](_0x9ca4('0x9'),null);this[_0x9ca4('0x8')]('mandatoryDisposition',_0x4af8d6);}},'provider':{'type':Sequelize[_0x9ca4('0xa')](_0x9ca4('0xb'),_0x9ca4('0xc'),'yahoo',_0x9ca4('0xd')),'defaultValue':null,'get':function(){if(!this[_0x9ca4('0xe')](_0x9ca4('0xf')))return'custom';return this[_0x9ca4('0xe')]('provider');},'set':function(_0x2ff78b){if(_0x2ff78b===_0x9ca4('0x10'))_0x2ff78b=null;return this[_0x9ca4('0x8')]('provider',_0x2ff78b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2484a64..12128b8 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 _0x2f1f=['READ_COMMITTED','MailApplication','stack','getApplications','pick','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','MailAccounts','UserProfileResource','name','send','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','options','include','findAll','rows','catch','params','MailServerIn','keys','find','body','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','sort','includeAll','removeDispositions','ids','CannedAnswer','removeAnswers','key','email','ListId','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','findOne','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x2f1f,0x1a3));var _0xf2f1=function(_0x4dea48,_0x1236bb){_0x4dea48=_0x4dea48-0x0;var _0x120e4f=_0x2f1f[_0x4dea48];return _0x120e4f;};'use strict';var moment=require(_0xf2f1('0x0'));var BPromise=require(_0xf2f1('0x1'));var util=require(_0xf2f1('0x2'));var path=require(_0xf2f1('0x3'));var _=require(_0xf2f1('0x4'));var juice=require(_0xf2f1('0x5'));var Redis=require(_0xf2f1('0x6'));var qs=require(_0xf2f1('0x7'));var logger=require(_0xf2f1('0x8'))(_0xf2f1('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf2f1('0xa')]=_[_0xf2f1('0xb')](config[_0xf2f1('0xa')],{'host':_0xf2f1('0xc'),'port':0x18eb});var socket=require(_0xf2f1('0xd'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xf2f1('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf2f1('0xf')][_0xf2f1('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x59e1c3,_0x3e64a1,_0x4d6d61,_0x38c724){return new BPromise(function(_0x1306c3,_0x42efb2){var _0x1f7c95=_0x38c724||client;return _0x1f7c95[_0xf2f1('0x11')](_0x59e1c3,_0x4d6d61)[_0xf2f1('0x12')](function(_0x37a6d7){logger[_0xf2f1('0x13')](_0xf2f1('0x14'),_0x3e64a1,_0xf2f1('0x15'));logger[_0xf2f1('0x16')](_0xf2f1('0x17'),_0x3e64a1,_0xf2f1('0x15'),JSON[_0xf2f1('0x18')](_0x37a6d7));if(_0x37a6d7[_0xf2f1('0x19')]){if(_0x37a6d7[_0xf2f1('0x19')]['code']===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x3e64a1,_0x37a6d7['error'][_0xf2f1('0x1a')]);return _0x42efb2(_0x37a6d7[_0xf2f1('0x19')][_0xf2f1('0x1a')]);}logger[_0xf2f1('0x19')](_0xf2f1('0x14'),_0x3e64a1,_0x37a6d7[_0xf2f1('0x19')]['message']);return _0x1306c3(_0x37a6d7[_0xf2f1('0x19')]['message']);}else{logger[_0xf2f1('0x13')](_0xf2f1('0x14'),_0x3e64a1,_0xf2f1('0x15'));_0x1306c3(_0x37a6d7['result'][_0xf2f1('0x1a')]);}})['catch'](function(_0xe6587){logger[_0xf2f1('0x19')]('MailAccount,\x20%s,\x20%s',_0x3e64a1,_0xe6587);_0x42efb2(_0xe6587);});});}function respondWithStatusCode(_0x5cd3a7,_0x16b5c8){_0x16b5c8=_0x16b5c8||0xcc;return function(_0x52fe04){if(_0x52fe04){return _0x5cd3a7[_0xf2f1('0x1b')](_0x16b5c8);}return _0x5cd3a7[_0xf2f1('0x1c')](_0x16b5c8)['end']();};}function respondWithResult(_0x21dd90,_0x5d5b59){_0x5d5b59=_0x5d5b59||0xc8;return function(_0x57990){if(_0x57990){return _0x21dd90[_0xf2f1('0x1c')](_0x5d5b59)[_0xf2f1('0x1d')](_0x57990);}};}function respondWithFilteredResult(_0x1e5933,_0x4ea016){return function(_0x3deb2e){if(_0x3deb2e){var _0x56d9d5=typeof _0x4ea016[_0xf2f1('0x1e')]===_0xf2f1('0x1f')&&typeof _0x4ea016[_0xf2f1('0x20')]==='undefined';var _0x5bc7dc=_0x3deb2e['count'];var _0x1e9a57=_0x56d9d5?0x0:_0x4ea016['offset'];var _0x4bb0f8=_0x56d9d5?_0x3deb2e[_0xf2f1('0x21')]:_0x4ea016[_0xf2f1('0x1e')]+_0x4ea016[_0xf2f1('0x20')];var _0x3050a9;if(_0x4bb0f8>=_0x5bc7dc){_0x4bb0f8=_0x5bc7dc;_0x3050a9=0xc8;}else{_0x3050a9=0xce;}_0x1e5933['status'](_0x3050a9);return _0x1e5933[_0xf2f1('0x22')](_0xf2f1('0x23'),_0x1e9a57+'-'+_0x4bb0f8+'/'+_0x5bc7dc)['json'](_0x3deb2e);}return null;};}function saveUpdates(_0x25f37c){return function(_0x5f2b58){if(_0x5f2b58){return _0x5f2b58[_0xf2f1('0x24')](_0x25f37c)[_0xf2f1('0x12')](function(_0x5de0b6){return _0x5de0b6;});}return null;};}function removeEntity(_0x5da2fa){return function(_0x6a4768){if(_0x6a4768){return _0x6a4768[_0xf2f1('0x25')]()[_0xf2f1('0x12')](function(){var _0x1f57a7=_0x6a4768['get']({'plain':!![]});var _0x1143f2=_0xf2f1('0x26');return db[_0xf2f1('0x27')][_0xf2f1('0x25')]({'where':{'type':_0x1143f2,'resourceId':_0x1f57a7['id']}})[_0xf2f1('0x12')](function(){return _0x6a4768;});})[_0xf2f1('0x12')](function(){_0x5da2fa[_0xf2f1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a3c3){return function(_0x36e675){if(!_0x36e675){_0x15a3c3[_0xf2f1('0x1b')](0x194);}return _0x36e675;};}function handleError(_0x435fdd,_0x2fc13e){_0x2fc13e=_0x2fc13e||0x1f4;return function(_0x338fae){logger[_0xf2f1('0x19')](_0x338fae['stack']);if(_0x338fae[_0xf2f1('0x28')]){delete _0x338fae[_0xf2f1('0x28')];}_0x435fdd['status'](_0x2fc13e)[_0xf2f1('0x29')](_0x338fae);};}function getImapHost(_0x251c86){switch(_0x251c86){case _0xf2f1('0x2a'):return'imap.gmail.com';case'yahoo':return _0xf2f1('0x2b');case _0xf2f1('0x2c'):return _0xf2f1('0x2d');case _0xf2f1('0x2e'):return _0xf2f1('0x2f');}throw new Error(_0xf2f1('0x30'),_0x251c86);}function getSmtpHost(_0x1f4130){switch(_0x1f4130){case _0xf2f1('0x2a'):return _0xf2f1('0x31');case _0xf2f1('0x32'):return _0xf2f1('0x33');case _0xf2f1('0x2c'):return _0xf2f1('0x34');case _0xf2f1('0x2e'):return'smtp.office365.com';}throw new Error(_0xf2f1('0x30'),_0x1f4130);}function getAuthenticationOptions(_0x27dad9,_0x46d449){var _0x3b70d7={};var _0x28256d={};if(_0x27dad9){_0x3b70d7[_0xf2f1('0x35')]=_0x28256d[_0xf2f1('0x35')]=_0x46d449[_0xf2f1('0x36')];_0x3b70d7[_0xf2f1('0x37')]=_0x28256d[_0xf2f1('0x38')]=_0x46d449['password'];if(_0x46d449[_0xf2f1('0x39')]){_0x3b70d7[_0xf2f1('0x39')]=_0x28256d['modernAuthentication']=!![];_0x3b70d7[_0xf2f1('0x3a')]=_0x28256d[_0xf2f1('0x3a')]=_0x46d449[_0xf2f1('0x3a')];_0x3b70d7[_0xf2f1('0x37')]=_0x28256d[_0xf2f1('0x38')]=null;}else{_0x3b70d7[_0xf2f1('0x3a')]=_0x28256d[_0xf2f1('0x3a')]=null;}_0x3b70d7['host']=getImapHost(_0x27dad9);_0x3b70d7[_0xf2f1('0x3b')]=0x3e1;_0x28256d[_0xf2f1('0x3c')]=getSmtpHost(_0x27dad9);_0x28256d[_0xf2f1('0x3b')]=0x24b;_0x28256d[_0xf2f1('0x3d')]=![];_0x3b70d7['service']=_0x28256d[_0xf2f1('0x3e')]=null;}else{if(_0x46d449[_0xf2f1('0x3f')]){_0x3b70d7[_0xf2f1('0x35')]=_0x28256d[_0xf2f1('0x35')]=_0x46d449['username'];_0x3b70d7[_0xf2f1('0x37')]=_0x28256d[_0xf2f1('0x38')]=_0x46d449['password'];}else{_0x3b70d7[_0xf2f1('0x3f')]=_0x28256d[_0xf2f1('0x3f')]=![];_0x3b70d7[_0xf2f1('0x35')]=_0x28256d['user']=null;_0x3b70d7['password']=_0x28256d[_0xf2f1('0x38')]=null;}_0x3b70d7[_0xf2f1('0x3c')]=_0x46d449['Imap'][_0xf2f1('0x3c')];_0x3b70d7[_0xf2f1('0x3b')]=_0x46d449[_0xf2f1('0x40')][_0xf2f1('0x3b')];_0x28256d[_0xf2f1('0x3c')]=_0x46d449[_0xf2f1('0x41')][_0xf2f1('0x3c')];_0x28256d[_0xf2f1('0x3b')]=_0x46d449[_0xf2f1('0x41')][_0xf2f1('0x3b')];}return{'Imap':_0x3b70d7,'Smtp':_0x28256d};}exports['index']=function(_0x4e4c14,_0x2fcdd9){var _0x4bc2ba={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xf2f1('0x42')],'as':_0xf2f1('0x41')},{'model':db[_0xf2f1('0x43')],'as':_0xf2f1('0x44')}]},_0x293cd4={},_0x36fc91={'count':0x0,'rows':[]};var _0x18d1ec=_[_0xf2f1('0x45')](db[_0xf2f1('0x46')][_0xf2f1('0x47')],function(_0x2537dc){return{'name':_0x2537dc['fieldName'],'type':_0x2537dc['type']['key']};});_0x293cd4[_0xf2f1('0x48')]=_[_0xf2f1('0x45')](_0x18d1ec,_0xf2f1('0x28'));_0x293cd4[_0xf2f1('0x49')]=_['keys'](_0x4e4c14[_0xf2f1('0x49')]);_0x293cd4['filters']=_['intersection'](_0x293cd4[_0xf2f1('0x48')],_0x293cd4[_0xf2f1('0x49')]);_0x4bc2ba[_0xf2f1('0x4a')]=_[_0xf2f1('0x4b')](_0x293cd4['model'],qs[_0xf2f1('0x4c')](_0x4e4c14[_0xf2f1('0x49')]['fields']));_0x4bc2ba[_0xf2f1('0x4a')]=_0x4bc2ba[_0xf2f1('0x4a')][_0xf2f1('0x4d')]?_0x4bc2ba['attributes']:_0x293cd4[_0xf2f1('0x48')];if(!_0x4e4c14[_0xf2f1('0x49')][_0xf2f1('0x4e')](_0xf2f1('0x4f'))){_0x4bc2ba['limit']=qs[_0xf2f1('0x20')](_0x4e4c14[_0xf2f1('0x49')]['limit']);_0x4bc2ba['offset']=qs[_0xf2f1('0x1e')](_0x4e4c14[_0xf2f1('0x49')][_0xf2f1('0x1e')]);}_0x4bc2ba[_0xf2f1('0x50')]=qs['sort'](_0x4e4c14['query']['sort']);_0x4bc2ba[_0xf2f1('0x51')]=qs[_0xf2f1('0x52')](_['pick'](_0x4e4c14['query'],_0x293cd4[_0xf2f1('0x52')]),_0x18d1ec);if(_0x4e4c14[_0xf2f1('0x49')][_0xf2f1('0x53')]){_0x4bc2ba['where']=_[_0xf2f1('0x54')](_0x4bc2ba[_0xf2f1('0x51')],{'$or':_[_0xf2f1('0x45')](_0x18d1ec,function(_0x1d8fb4){if(_0x1d8fb4[_0xf2f1('0x55')]!=='VIRTUAL'){var _0x541109={};_0x541109[_0x1d8fb4[_0xf2f1('0x28')]]={'$like':'%'+_0x4e4c14[_0xf2f1('0x49')][_0xf2f1('0x53')]+'%'};return _0x541109;}})});}_0x4bc2ba=_['merge']({},_0x4bc2ba,_0x4e4c14[_0xf2f1('0x56')]);var _0x1e5bdc={'where':_0x4bc2ba['where']};return db[_0xf2f1('0x46')][_0xf2f1('0x21')](_0x1e5bdc)[_0xf2f1('0x12')](function(_0x1adb61){_0x36fc91[_0xf2f1('0x21')]=_0x1adb61;if(_0x4e4c14['query']['includeAll']){_0x4bc2ba[_0xf2f1('0x57')]=[{'all':!![]}];}return db['MailAccount'][_0xf2f1('0x58')](_0x4bc2ba);})[_0xf2f1('0x12')](function(_0x394171){_0x36fc91[_0xf2f1('0x59')]=_0x394171;return _0x36fc91;})[_0xf2f1('0x12')](respondWithFilteredResult(_0x2fcdd9,_0x4bc2ba))[_0xf2f1('0x5a')](handleError(_0x2fcdd9,null));};exports['show']=function(_0x45f105,_0x3b3792){var _0x42fb52={'raw':![],'where':{'id':_0x45f105[_0xf2f1('0x5b')]['id']},'include':[{'model':db[_0xf2f1('0x5c')],'as':_0xf2f1('0x40')},{'model':db[_0xf2f1('0x42')],'as':'Smtp'},{'model':db[_0xf2f1('0x43')],'as':_0xf2f1('0x44')}]},_0x4f8b46={};_0x4f8b46[_0xf2f1('0x48')]=_[_0xf2f1('0x5d')](db[_0xf2f1('0x46')][_0xf2f1('0x47')]);_0x4f8b46['query']=_['keys'](_0x45f105[_0xf2f1('0x49')]);_0x4f8b46[_0xf2f1('0x52')]=_['intersection'](_0x4f8b46[_0xf2f1('0x48')],_0x4f8b46[_0xf2f1('0x49')]);_0x42fb52[_0xf2f1('0x4a')]=_[_0xf2f1('0x4b')](_0x4f8b46[_0xf2f1('0x48')],qs[_0xf2f1('0x4c')](_0x45f105[_0xf2f1('0x49')][_0xf2f1('0x4c')]));_0x42fb52[_0xf2f1('0x4a')]=_0x42fb52[_0xf2f1('0x4a')][_0xf2f1('0x4d')]?_0x42fb52[_0xf2f1('0x4a')]:_0x4f8b46[_0xf2f1('0x48')];if(_0x45f105[_0xf2f1('0x49')]['includeAll']){_0x42fb52[_0xf2f1('0x57')]=[{'all':!![]}];}_0x42fb52=_[_0xf2f1('0x54')]({},_0x42fb52,_0x45f105[_0xf2f1('0x56')]);return db['MailAccount'][_0xf2f1('0x5e')](_0x42fb52)[_0xf2f1('0x12')](handleEntityNotFound(_0x3b3792,null))['then'](respondWithResult(_0x3b3792,null))[_0xf2f1('0x5a')](handleError(_0x3b3792,null));};exports['update']=function(_0x19615a,_0x1cb231){if(_0x19615a['body']['id']){delete _0x19615a[_0xf2f1('0x5f')]['id'];}var _0x257ad8=_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x60')]==='custom'?null:_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x60')];var _0x1507a6=_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x40')]||{};var _0x5ebe0e=_0x19615a[_0xf2f1('0x5f')]['Smtp']||{};if(_0x257ad8){_0x1507a6[_0xf2f1('0x3c')]=getImapHost(_0x257ad8);_0x1507a6['port']=0x3e1;_0x5ebe0e[_0xf2f1('0x3c')]=getSmtpHost(_0x257ad8);_0x5ebe0e['port']=0x24b;_0x5ebe0e[_0xf2f1('0x3d')]=![];}if(_0x5ebe0e[_0xf2f1('0x39')]){_0x5ebe0e['secure']=![];}else{_0x5ebe0e[_0xf2f1('0x3a')]=null;}if(!_0x1507a6[_0xf2f1('0x39')])_0x1507a6['CloudProviderId']=null;_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x40')]=_0x1507a6;_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x41')]=_0x5ebe0e;return db[_0xf2f1('0x46')][_0xf2f1('0x5e')]({'where':{'id':_0x19615a[_0xf2f1('0x5b')]['id']},'include':[{'model':db[_0xf2f1('0x5c')],'as':_0xf2f1('0x40')},{'model':db[_0xf2f1('0x42')],'as':_0xf2f1('0x41')},{'model':db[_0xf2f1('0x43')],'as':_0xf2f1('0x44')}]})[_0xf2f1('0x12')](handleEntityNotFound(_0x1cb231,null))[_0xf2f1('0x12')](function(_0x7a498b){if(!_0x7a498b)throw new Error(_0xf2f1('0x61'));if(_0x7a498b['service'])delete _0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x40')];return _0x7a498b;})['then'](saveUpdates(_0x19615a[_0xf2f1('0x5f')],null))[_0xf2f1('0x12')](function(_0xcbe74){if(!_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x40')])return _0xcbe74;return db[_0xf2f1('0x5c')]['update'](_0x19615a['body'][_0xf2f1('0x40')],{'where':{'MailAccountId':_0xcbe74['id']}})[_0xf2f1('0x12')](function(){return _0xcbe74;});})[_0xf2f1('0x12')](function(_0x54d920){if(!_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x41')])return _0x54d920;return db[_0xf2f1('0x42')][_0xf2f1('0x24')](_0x19615a[_0xf2f1('0x5f')][_0xf2f1('0x41')],{'where':{'MailAccountId':_0x54d920['id']}})['then'](function(){return _0x54d920;});})[_0xf2f1('0x12')](respondWithResult(_0x1cb231,null))['catch'](handleError(_0x1cb231,null));};exports[_0xf2f1('0x62')]=function(_0x7765a3,_0xa18087){return db['MailAccount']['describe']()[_0xf2f1('0x12')](respondWithResult(_0xa18087,null))[_0xf2f1('0x5a')](handleError(_0xa18087,null));};exports[_0xf2f1('0x63')]=function(_0x81100c,_0xc2bc4c){if(_0x81100c[_0xf2f1('0x5f')]['id']){delete _0x81100c[_0xf2f1('0x5f')]['id'];}return db['MailAccount'][_0xf2f1('0x5e')]({'where':{'id':_0x81100c[_0xf2f1('0x5b')]['id']}})['then'](handleEntityNotFound(_0xc2bc4c,null))[_0xf2f1('0x12')](function(_0x2ef646){if(_0x2ef646){_0x81100c[_0xf2f1('0x5f')][_0xf2f1('0x64')]=_0x2ef646['id'];return db[_0xf2f1('0x65')][_0xf2f1('0x66')](_0x81100c[_0xf2f1('0x5f')]);}})[_0xf2f1('0x12')](respondWithResult(_0xc2bc4c,null))[_0xf2f1('0x5a')](handleError(_0xc2bc4c,null));};exports[_0xf2f1('0x67')]=function(_0x41c613,_0x50fc1b){var _0x2e79c5={'raw':![],'where':{}};var _0xaa4f3e={};var _0x4640e8={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x41c613['params']['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x50fc1b,null))[_0xf2f1('0x12')](function(_0x176806){if(_0x176806){_0xaa4f3e[_0xf2f1('0x48')]=_['keys'](db['Disposition'][_0xf2f1('0x47')]);_0xaa4f3e[_0xf2f1('0x49')]=_[_0xf2f1('0x5d')](_0x41c613[_0xf2f1('0x49')]);_0xaa4f3e['filters']=_['intersection'](_0xaa4f3e[_0xf2f1('0x48')],_0xaa4f3e['query']);_0x2e79c5[_0xf2f1('0x4a')]=_[_0xf2f1('0x4b')](_0xaa4f3e[_0xf2f1('0x48')],qs[_0xf2f1('0x4c')](_0x41c613[_0xf2f1('0x49')]['fields']));_0x2e79c5['attributes']=_0x2e79c5['attributes']['length']?_0x2e79c5[_0xf2f1('0x4a')]:_0xaa4f3e['model'];if(!_0x41c613[_0xf2f1('0x49')][_0xf2f1('0x4e')](_0xf2f1('0x4f'))){_0x2e79c5[_0xf2f1('0x20')]=qs[_0xf2f1('0x20')](_0x41c613['query'][_0xf2f1('0x20')]);_0x2e79c5[_0xf2f1('0x1e')]=qs[_0xf2f1('0x1e')](_0x41c613[_0xf2f1('0x49')][_0xf2f1('0x1e')]);}_0x2e79c5[_0xf2f1('0x50')]=qs[_0xf2f1('0x68')](_0x41c613[_0xf2f1('0x49')]['sort']);_0x2e79c5[_0xf2f1('0x51')]=qs[_0xf2f1('0x52')](_['pick'](_0x41c613[_0xf2f1('0x49')],_0xaa4f3e[_0xf2f1('0x52')]));_0x2e79c5[_0xf2f1('0x51')][_0xf2f1('0x64')]=_0x176806['id'];if(_0x41c613['query'][_0xf2f1('0x53')]){_0x2e79c5[_0xf2f1('0x51')]=_[_0xf2f1('0x54')](_0x2e79c5[_0xf2f1('0x51')],{'$or':_[_0xf2f1('0x45')](_0x2e79c5['attributes'],function(_0x2b5e43){var _0x55c44f={};_0x55c44f[_0x2b5e43]={'$like':'%'+_0x41c613[_0xf2f1('0x49')][_0xf2f1('0x53')]+'%'};return _0x55c44f;})});}_0x2e79c5=_['merge']({},_0x2e79c5,_0x41c613['options']);return db['Disposition']['count']({'where':_0x2e79c5[_0xf2f1('0x51')]})[_0xf2f1('0x12')](function(_0x37035c){_0x4640e8[_0xf2f1('0x21')]=_0x37035c;if(_0x41c613['query'][_0xf2f1('0x69')]){_0x2e79c5[_0xf2f1('0x57')]=[{'all':!![]}];}return db[_0xf2f1('0x65')][_0xf2f1('0x58')](_0x2e79c5);})[_0xf2f1('0x12')](function(_0x501f4e){_0x4640e8['rows']=_0x501f4e;return _0x4640e8;});}})[_0xf2f1('0x12')](respondWithFilteredResult(_0x50fc1b,_0x2e79c5))[_0xf2f1('0x5a')](handleError(_0x50fc1b,null));};exports[_0xf2f1('0x6a')]=function(_0xc637e0,_0x107c77){return db[_0xf2f1('0x46')][_0xf2f1('0x5e')]({'where':{'id':_0xc637e0[_0xf2f1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x107c77,null))[_0xf2f1('0x12')](function(_0x42832d){if(_0x42832d){return _0x42832d['removeDispositions'](_0xc637e0[_0xf2f1('0x49')][_0xf2f1('0x6b')]);}})[_0xf2f1('0x12')](respondWithStatusCode(_0x107c77,null))[_0xf2f1('0x5a')](handleError(_0x107c77,null));};exports['addAnswer']=function(_0x53e339,_0x3f9003){if(_0x53e339[_0xf2f1('0x5f')]['id']){delete _0x53e339[_0xf2f1('0x5f')]['id'];}return db[_0xf2f1('0x46')]['find']({'where':{'id':_0x53e339[_0xf2f1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3f9003,null))[_0xf2f1('0x12')](function(_0x507315){if(_0x507315){_0x53e339[_0xf2f1('0x5f')][_0xf2f1('0x64')]=_0x507315['id'];return db[_0xf2f1('0x6c')][_0xf2f1('0x66')](_0x53e339[_0xf2f1('0x5f')]);}})['then'](respondWithResult(_0x3f9003,null))[_0xf2f1('0x5a')](handleError(_0x3f9003,null));};exports['getAnswers']=function(_0x53f2c5,_0x500b3c){var _0xe5b06f={'raw':![],'where':{}};var _0x33e725={};var _0x244c3f={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x53f2c5['params']['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x500b3c,null))[_0xf2f1('0x12')](function(_0x2f5f90){if(_0x2f5f90){_0x33e725[_0xf2f1('0x48')]=_[_0xf2f1('0x5d')](db[_0xf2f1('0x6c')]['rawAttributes']);_0x33e725[_0xf2f1('0x49')]=_[_0xf2f1('0x5d')](_0x53f2c5['query']);_0x33e725[_0xf2f1('0x52')]=_['intersection'](_0x33e725['model'],_0x33e725['query']);_0xe5b06f[_0xf2f1('0x4a')]=_['intersection'](_0x33e725[_0xf2f1('0x48')],qs[_0xf2f1('0x4c')](_0x53f2c5[_0xf2f1('0x49')][_0xf2f1('0x4c')]));_0xe5b06f['attributes']=_0xe5b06f['attributes'][_0xf2f1('0x4d')]?_0xe5b06f[_0xf2f1('0x4a')]:_0x33e725[_0xf2f1('0x48')];if(!_0x53f2c5['query']['hasOwnProperty'](_0xf2f1('0x4f'))){_0xe5b06f[_0xf2f1('0x20')]=qs[_0xf2f1('0x20')](_0x53f2c5[_0xf2f1('0x49')]['limit']);_0xe5b06f[_0xf2f1('0x1e')]=qs[_0xf2f1('0x1e')](_0x53f2c5[_0xf2f1('0x49')]['offset']);}_0xe5b06f['order']=qs[_0xf2f1('0x68')](_0x53f2c5[_0xf2f1('0x49')][_0xf2f1('0x68')]);_0xe5b06f[_0xf2f1('0x51')]=qs[_0xf2f1('0x52')](_['pick'](_0x53f2c5[_0xf2f1('0x49')],_0x33e725['filters']));_0xe5b06f['where']['MailAccountId']=_0x2f5f90['id'];if(_0x53f2c5[_0xf2f1('0x49')][_0xf2f1('0x53')]){_0xe5b06f[_0xf2f1('0x51')]=_[_0xf2f1('0x54')](_0xe5b06f[_0xf2f1('0x51')],{'$or':_[_0xf2f1('0x45')](_0xe5b06f[_0xf2f1('0x4a')],function(_0x4bca74){var _0x9ace2d={};_0x9ace2d[_0x4bca74]={'$like':'%'+_0x53f2c5[_0xf2f1('0x49')][_0xf2f1('0x53')]+'%'};return _0x9ace2d;})});}_0xe5b06f=_[_0xf2f1('0x54')]({},_0xe5b06f,_0x53f2c5[_0xf2f1('0x56')]);return db[_0xf2f1('0x6c')][_0xf2f1('0x21')]({'where':_0xe5b06f['where']})[_0xf2f1('0x12')](function(_0x33ffab){_0x244c3f['count']=_0x33ffab;if(_0x53f2c5['query'][_0xf2f1('0x69')]){_0xe5b06f[_0xf2f1('0x57')]=[{'all':!![]}];}return db[_0xf2f1('0x6c')]['findAll'](_0xe5b06f);})[_0xf2f1('0x12')](function(_0x5e8c23){_0x244c3f[_0xf2f1('0x59')]=_0x5e8c23;return _0x244c3f;});}})['then'](respondWithFilteredResult(_0x500b3c,_0xe5b06f))[_0xf2f1('0x5a')](handleError(_0x500b3c,null));};exports['removeAnswers']=function(_0x44b528,_0x716640){return db[_0xf2f1('0x46')]['find']({'where':{'id':_0x44b528[_0xf2f1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x716640,null))[_0xf2f1('0x12')](function(_0x4eb881){if(_0x4eb881){return _0x4eb881[_0xf2f1('0x6d')](_0x44b528[_0xf2f1('0x49')]['ids']);}})[_0xf2f1('0x12')](respondWithStatusCode(_0x716640,null))[_0xf2f1('0x5a')](handleError(_0x716640,null));};exports[_0xf2f1('0x66')]=function(_0x209ef2,_0x30cc9b){var _0x4577e1={'name':_0x209ef2[_0xf2f1('0x5f')][_0xf2f1('0x28')],'key':_0x209ef2['body'][_0xf2f1('0x6e')],'provider':_0x209ef2[_0xf2f1('0x5f')][_0xf2f1('0x60')]==='custom'?null:_0x209ef2[_0xf2f1('0x5f')][_0xf2f1('0x60')],'email':_0x209ef2[_0xf2f1('0x5f')][_0xf2f1('0x6f')],'ListId':_0x209ef2['body'][_0xf2f1('0x70')],'active':!_['isNil'](_0x209ef2[_0xf2f1('0x5f')][_0xf2f1('0x71')])?_0x209ef2[_0xf2f1('0x5f')][_0xf2f1('0x71')]:!![],'description':_0x209ef2[_0xf2f1('0x5f')]['description']||null};var _0x216203=getAuthenticationOptions(_0x4577e1[_0xf2f1('0x60')],_0x209ef2[_0xf2f1('0x5f')]);_0x4577e1['Imap']=_0x216203[_0xf2f1('0x40')];_0x4577e1[_0xf2f1('0x41')]=_0x216203[_0xf2f1('0x41')];return db['MailAccount'][_0xf2f1('0x66')](_0x4577e1,{'include':[{'model':db[_0xf2f1('0x42')],'as':_0xf2f1('0x41')},{'model':db[_0xf2f1('0x5c')],'as':'Imap'}]})['then'](function(_0x3448d8){var _0x896486=_0x209ef2[_0xf2f1('0x35')]['get']({'plain':!![]});if(!_0x896486)throw new Error(_0xf2f1('0x72'));if(_0x896486['role']===_0xf2f1('0x35')){var _0x2b3b01=_0x3448d8['get']({'plain':!![]});return db[_0xf2f1('0x73')]['find']({'where':{'name':_0xf2f1('0x26'),'userProfileId':_0x896486[_0xf2f1('0x74')]},'raw':!![]})[_0xf2f1('0x12')](function(_0x2fbc66){if(_0x2fbc66&&_0x2fbc66[_0xf2f1('0x75')]===0x0){return db[_0xf2f1('0x27')][_0xf2f1('0x66')]({'name':_0x2b3b01[_0xf2f1('0x28')],'resourceId':_0x2b3b01['id'],'type':_0x2fbc66[_0xf2f1('0x28')],'sectionId':_0x2fbc66['id']},{})[_0xf2f1('0x12')](function(){return _0x3448d8;});}else{return _0x3448d8;}})['catch'](function(_0x2af51f){logger[_0xf2f1('0x19')](_0xf2f1('0x76'),_0x2af51f);throw _0x2af51f;});}return _0x3448d8;})[_0xf2f1('0x12')](respondWithResult(_0x30cc9b,0xc9))['catch'](handleError(_0x30cc9b,null));};exports[_0xf2f1('0x77')]=function(_0x1b07da,_0x369531){return db[_0xf2f1('0x46')]['findOne']({'where':{'id':_0x1b07da[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x369531,null))['then'](function(_0x1956b3){if(_0x1956b3){return _0x1956b3['getImap']();}return null;})['then'](respondWithResult(_0x369531,null))[_0xf2f1('0x5a')](handleError(_0x369531,null));};exports[_0xf2f1('0x78')]=function(_0x3aca68,_0x5bf671){if(_0x3aca68['body']['id']){delete _0x3aca68['body']['id'];}return db['MailAccount'][_0xf2f1('0x5e')]({'where':{'id':_0x3aca68[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x5bf671,null))[_0xf2f1('0x12')](function(_0x4ea9d5){if(_0x4ea9d5){_0x3aca68[_0xf2f1('0x5f')]['MailAccountId']=_0x4ea9d5['id'];return db[_0xf2f1('0x5c')]['create'](_0x3aca68[_0xf2f1('0x5f')]);}})[_0xf2f1('0x12')](respondWithResult(_0x5bf671,null))[_0xf2f1('0x5a')](handleError(_0x5bf671,null));};exports[_0xf2f1('0x79')]=function(_0xcdfc12,_0x350455){return db['MailAccount'][_0xf2f1('0x7a')]({'where':{'id':_0xcdfc12[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x350455,null))['then'](function(_0x36c68b){if(_0x36c68b){return _0x36c68b[_0xf2f1('0x7b')](null);}return null;})['then'](respondWithStatusCode(_0x350455,null))[_0xf2f1('0x5a')](handleError(_0x350455,null));};exports[_0xf2f1('0x7c')]=function(_0x195de7,_0x4f7aa4){return db[_0xf2f1('0x46')][_0xf2f1('0x7a')]({'where':{'id':_0x195de7[_0xf2f1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4f7aa4,null))[_0xf2f1('0x12')](function(_0x560bd0){if(_0x560bd0){return _0x560bd0['getSmtp']();}return null;})[_0xf2f1('0x12')](respondWithResult(_0x4f7aa4,null))[_0xf2f1('0x5a')](handleError(_0x4f7aa4,null));};exports[_0xf2f1('0x7d')]=function(_0x4c9818,_0x1ef9f8){if(_0x4c9818[_0xf2f1('0x5f')]['id']){delete _0x4c9818[_0xf2f1('0x5f')]['id'];}return db['MailAccount'][_0xf2f1('0x5e')]({'where':{'id':_0x4c9818[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x1ef9f8,null))['then'](function(_0x1469b3){if(_0x1469b3){_0x4c9818[_0xf2f1('0x5f')][_0xf2f1('0x64')]=_0x1469b3['id'];return db['MailServerOut']['create'](_0x4c9818[_0xf2f1('0x5f')]);}})[_0xf2f1('0x12')](respondWithResult(_0x1ef9f8,null))[_0xf2f1('0x5a')](handleError(_0x1ef9f8,null));};exports[_0xf2f1('0x7e')]=function(_0x5bc713,_0x13b569){return db[_0xf2f1('0x46')][_0xf2f1('0x7a')]({'where':{'id':_0x5bc713['params']['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x13b569,null))[_0xf2f1('0x12')](function(_0x21ab7a){if(_0x21ab7a){return _0x21ab7a[_0xf2f1('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x13b569,null))[_0xf2f1('0x5a')](handleError(_0x13b569,null));};exports[_0xf2f1('0x80')]=function(_0x477273,_0x578d78){return db[_0xf2f1('0x81')][_0xf2f1('0x5e')]({'where':{'id':_0x477273[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x578d78,null))[_0xf2f1('0x12')](function(_0x2ff421){if(_0x2ff421){return _0x2ff421['addInteraction'](_0x477273[_0xf2f1('0x5f')][_0xf2f1('0x6b')],_[_0xf2f1('0x82')](_0x477273['body'],[_0xf2f1('0x6b'),'id'])||{});}})[_0xf2f1('0x12')](respondWithResult(_0x578d78,null))['catch'](handleError(_0x578d78,null));};exports[_0xf2f1('0x83')]=function(_0x2959b4,_0x579f20){var _0x1a1f66={'raw':![],'where':{}};var _0x1b1ecd={};var _0x1841de={'count':0x0,'rows':[]};return db['MailAccount'][_0xf2f1('0x7a')]({'where':{'id':_0x2959b4['params']['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x579f20,null))[_0xf2f1('0x12')](function(_0x5053d3){if(_0x5053d3){_0x1b1ecd[_0xf2f1('0x48')]=_[_0xf2f1('0x5d')](db['MailInteraction'][_0xf2f1('0x47')]);_0x1b1ecd[_0xf2f1('0x49')]=_['keys'](_0x2959b4[_0xf2f1('0x49')]);_0x1b1ecd['filters']=_[_0xf2f1('0x4b')](_0x1b1ecd[_0xf2f1('0x48')],_0x1b1ecd[_0xf2f1('0x49')]);_0x1a1f66[_0xf2f1('0x4a')]=_[_0xf2f1('0x4b')](_0x1b1ecd[_0xf2f1('0x48')],qs[_0xf2f1('0x4c')](_0x2959b4[_0xf2f1('0x49')][_0xf2f1('0x4c')]));_0x1a1f66[_0xf2f1('0x4a')]=_0x1a1f66[_0xf2f1('0x4a')][_0xf2f1('0x4d')]?_0x1a1f66['attributes']:_0x1b1ecd[_0xf2f1('0x48')];if(!_0x2959b4[_0xf2f1('0x49')][_0xf2f1('0x4e')](_0xf2f1('0x4f'))){_0x1a1f66[_0xf2f1('0x20')]=qs[_0xf2f1('0x20')](_0x2959b4['query']['limit']);_0x1a1f66[_0xf2f1('0x1e')]=qs['offset'](_0x2959b4[_0xf2f1('0x49')]['offset']);}_0x1a1f66['order']=qs[_0xf2f1('0x68')](_0x2959b4['query'][_0xf2f1('0x68')]);_0x1a1f66[_0xf2f1('0x51')]=qs[_0xf2f1('0x52')](_['pick'](_0x2959b4[_0xf2f1('0x49')],_0x1b1ecd[_0xf2f1('0x52')]));_0x1a1f66[_0xf2f1('0x51')][_0xf2f1('0x64')]=_0x5053d3['id'];if(_0x2959b4['query'][_0xf2f1('0x53')]){_0x1a1f66[_0xf2f1('0x51')]=_[_0xf2f1('0x54')](_0x1a1f66['where'],{'$or':_[_0xf2f1('0x45')](_0x1a1f66[_0xf2f1('0x4a')],function(_0x479e63){var _0x350810={};_0x350810[_0x479e63]={'$like':'%'+_0x2959b4[_0xf2f1('0x49')]['filter']+'%'};return _0x350810;})});}_0x1a1f66=_[_0xf2f1('0x54')]({},_0x1a1f66,_0x2959b4[_0xf2f1('0x56')]);return db[_0xf2f1('0x81')][_0xf2f1('0x21')]({'where':_0x1a1f66['where']})['then'](function(_0x502c15){_0x1841de['count']=_0x502c15;if(_0x2959b4[_0xf2f1('0x49')][_0xf2f1('0x69')]){_0x1a1f66[_0xf2f1('0x57')]=[{'model':db[_0xf2f1('0x84')],'as':_0xf2f1('0x85'),'required':![]},{'model':db[_0xf2f1('0x86')],'as':_0xf2f1('0x87'),'attributes':['name',_0xf2f1('0x88'),_0xf2f1('0x89')],'required':![]},{'model':db[_0xf2f1('0x8a')],'as':'Tags','attributes':['id',_0xf2f1('0x28'),_0xf2f1('0x8b')],'where':_0x2959b4[_0xf2f1('0x49')][_0xf2f1('0x8c')]?{'id':_0x2959b4[_0xf2f1('0x49')]['tag']}:undefined,'required':_0x2959b4['query'][_0xf2f1('0x8c')]?!![]:![]}];}return db['MailInteraction'][_0xf2f1('0x58')](_0x1a1f66);})[_0xf2f1('0x12')](function(_0x5424b3){_0x1841de[_0xf2f1('0x59')]=_0x5424b3;return _0x1841de;});}})[_0xf2f1('0x12')](respondWithFilteredResult(_0x579f20,_0x1a1f66))['catch'](handleError(_0x579f20,null));};exports[_0xf2f1('0x8d')]=function addApplications(_0x9a253,_0x306967){var _0x2adc98=_0x9a253['params']['id'];var _0xd0f7c1=_0x9a253[_0xf2f1('0x5f')];var _0x2cb63f=0xc8;var _0x2b2680=null;return db['sequelize'][_0xf2f1('0x8e')]({'isolationLevel':db[_0xf2f1('0x8f')]['Transaction'][_0xf2f1('0x90')][_0xf2f1('0x91')]},function(_0x6cc848){return db[_0xf2f1('0x46')][_0xf2f1('0x7a')]({'where':{'id':_0x2adc98},'transaction':_0x6cc848})[_0xf2f1('0x12')](function(_0x3d92c7){if(_0x3d92c7){return db[_0xf2f1('0x92')][_0xf2f1('0x25')]({'where':{'MailAccountId':_0x2adc98},'transaction':_0x6cc848})[_0xf2f1('0x12')](function(){var _0x153535=_['map'](_0xd0f7c1,function(_0x30f4d0){_0x30f4d0[_0xf2f1('0x64')]=_0x2adc98;return _0x30f4d0;});return db['MailApplication']['bulkCreate'](_0x153535,{'transaction':_0x6cc848});});}else{_0x2cb63f=0x194;_0x2b2680=[];}});})['then'](function(){if(_0x2cb63f!==0x194){return db[_0xf2f1('0x92')]['findAndCountAll']({'where':{'MailAccountId':_0x2adc98},'order':'priority'})[_0xf2f1('0x12')](function(_0x80d852){_0x2b2680=_0x80d852;});}})[_0xf2f1('0x5a')](function(_0x2456e){_0x2cb63f=0x1f4;logger[_0xf2f1('0x19')](_0x2456e[_0xf2f1('0x93')]);if(_0x2456e['name']){delete _0x2456e[_0xf2f1('0x28')];}_0x2b2680=_0x2456e;})['finally'](function(){if(_0x2b2680===null){_0x306967[_0xf2f1('0x1b')](_0x2cb63f);}else{if(_0x2cb63f===0x1f4){_0x306967[_0xf2f1('0x1c')](_0x2cb63f)[_0xf2f1('0x29')](_0x2b2680);}else{_0x306967[_0xf2f1('0x1c')](_0x2cb63f)[_0xf2f1('0x1d')](_0x2b2680);}}});};exports[_0xf2f1('0x94')]=function(_0x419d15,_0x513d1a){var _0x4e87b1={};var _0x552ccf={};var _0x293e3a;var _0x5e53ce;return db[_0xf2f1('0x46')][_0xf2f1('0x7a')]({'where':{'id':_0x419d15['params']['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x513d1a,null))[_0xf2f1('0x12')](function(_0xd11494){if(_0xd11494){_0x293e3a=_0xd11494;_0x552ccf[_0xf2f1('0x48')]=_[_0xf2f1('0x5d')](db[_0xf2f1('0x92')][_0xf2f1('0x47')]);_0x552ccf['query']=_[_0xf2f1('0x5d')](_0x419d15['query']);_0x552ccf['filters']=_['intersection'](_0x552ccf[_0xf2f1('0x48')],_0x552ccf['query']);_0x4e87b1[_0xf2f1('0x4a')]=_['intersection'](_0x552ccf['model'],qs[_0xf2f1('0x4c')](_0x419d15[_0xf2f1('0x49')][_0xf2f1('0x4c')]));_0x4e87b1['attributes']=_0x4e87b1[_0xf2f1('0x4a')][_0xf2f1('0x4d')]?_0x4e87b1[_0xf2f1('0x4a')]:_0x552ccf['model'];_0x4e87b1[_0xf2f1('0x50')]=qs['sort'](_0x419d15['query']['sort']);_0x4e87b1['where']=qs[_0xf2f1('0x52')](_[_0xf2f1('0x95')](_0x419d15[_0xf2f1('0x49')],_0x552ccf['filters']));if(_0x419d15[_0xf2f1('0x49')][_0xf2f1('0x53')]){_0x4e87b1[_0xf2f1('0x51')]=_['merge'](_0x4e87b1['where'],{'$or':_[_0xf2f1('0x45')](_0x4e87b1[_0xf2f1('0x4a')],function(_0x3237f9){var _0x1e5871={};_0x1e5871[_0x3237f9]={'$like':'%'+_0x419d15[_0xf2f1('0x49')][_0xf2f1('0x53')]+'%'};return _0x1e5871;})});}_0x4e87b1=_[_0xf2f1('0x54')]({},_0x4e87b1,_0x419d15[_0xf2f1('0x56')]);return _0x293e3a[_0xf2f1('0x94')](_0x4e87b1);}})['then'](function(_0x58270f){if(_0x58270f){_0x5e53ce=_0x58270f[_0xf2f1('0x4d')];if(!_0x419d15[_0xf2f1('0x49')][_0xf2f1('0x4e')](_0xf2f1('0x4f'))){_0x4e87b1[_0xf2f1('0x20')]=qs[_0xf2f1('0x20')](_0x419d15[_0xf2f1('0x49')][_0xf2f1('0x20')]);_0x4e87b1['offset']=qs[_0xf2f1('0x1e')](_0x419d15['query'][_0xf2f1('0x1e')]);}return _0x293e3a[_0xf2f1('0x94')](_0x4e87b1);}})[_0xf2f1('0x12')](function(_0xeae9e5){if(_0xeae9e5){return _0xeae9e5?{'count':_0x5e53ce,'rows':_0xeae9e5}:null;}})[_0xf2f1('0x12')](respondWithResult(_0x513d1a,null))[_0xf2f1('0x5a')](handleError(_0x513d1a,null));};exports[_0xf2f1('0x96')]=function(_0x2a559f,_0x14273a){var _0x21a1fe={'raw':!![],'where':{}};var _0x332030={};var _0x324575={'count':0x0,'rows':[]};return db[_0xf2f1('0x46')][_0xf2f1('0x7a')]({'where':{'id':_0x2a559f[_0xf2f1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x14273a,null))[_0xf2f1('0x12')](function(_0xe3e599){if(_0xe3e599){_0x332030[_0xf2f1('0x48')]=_['keys'](db[_0xf2f1('0x97')][_0xf2f1('0x47')]);_0x332030[_0xf2f1('0x49')]=_[_0xf2f1('0x5d')](_0x2a559f[_0xf2f1('0x49')]);_0x332030[_0xf2f1('0x52')]=_['intersection'](_0x332030[_0xf2f1('0x48')],_0x332030[_0xf2f1('0x49')]);_0x21a1fe[_0xf2f1('0x4a')]=_[_0xf2f1('0x4b')](_0x332030[_0xf2f1('0x48')],qs['fields'](_0x2a559f['query'][_0xf2f1('0x4c')]));_0x21a1fe[_0xf2f1('0x4a')]=_0x21a1fe[_0xf2f1('0x4a')][_0xf2f1('0x4d')]?_0x21a1fe[_0xf2f1('0x4a')]:_0x332030[_0xf2f1('0x48')];if(!_0x2a559f[_0xf2f1('0x49')][_0xf2f1('0x4e')]('nolimit')){_0x21a1fe[_0xf2f1('0x20')]=qs['limit'](_0x2a559f[_0xf2f1('0x49')]['limit']);_0x21a1fe[_0xf2f1('0x1e')]=qs[_0xf2f1('0x1e')](_0x2a559f['query'][_0xf2f1('0x1e')]);}_0x21a1fe[_0xf2f1('0x50')]=qs[_0xf2f1('0x68')](_0x2a559f[_0xf2f1('0x49')][_0xf2f1('0x68')]);_0x21a1fe[_0xf2f1('0x51')]=qs['filters'](_[_0xf2f1('0x95')](_0x2a559f[_0xf2f1('0x49')],_0x332030['filters']));_0x21a1fe[_0xf2f1('0x51')][_0xf2f1('0x64')]=_0xe3e599['id'];if(_0x2a559f[_0xf2f1('0x49')]['filter']){_0x21a1fe[_0xf2f1('0x51')]=_[_0xf2f1('0x54')](_0x21a1fe['where'],{'$or':_[_0xf2f1('0x45')](_0x21a1fe[_0xf2f1('0x4a')],function(_0x1b73ea){var _0x78447a={};_0x78447a[_0x1b73ea]={'$like':'%'+_0x2a559f[_0xf2f1('0x49')][_0xf2f1('0x53')]+'%'};return _0x78447a;})});}if(_0x2a559f['query']['$gte']){var _0x53d58d=_0x2a559f[_0xf2f1('0x49')][_0xf2f1('0x98')][_0xf2f1('0x99')](',');var _0x3bd8e7={};_0x3bd8e7[_0x53d58d[0x0]]={'$gte':moment(_0x53d58d[0x1])[_0xf2f1('0x9a')](_0xf2f1('0x9b'))};_0x21a1fe[_0xf2f1('0x51')]=_['merge'](_0x21a1fe['where'],_0x3bd8e7);}_0x21a1fe=_['merge']({},_0x21a1fe,_0x2a559f['options']);return db[_0xf2f1('0x97')]['count']({'where':_0x21a1fe['where']})[_0xf2f1('0x12')](function(_0x49fedf){_0x324575[_0xf2f1('0x21')]=_0x49fedf;if(_0x2a559f[_0xf2f1('0x49')][_0xf2f1('0x69')]){_0x21a1fe['include']=[{'all':!![]}];}return db[_0xf2f1('0x97')][_0xf2f1('0x58')](_0x21a1fe);})['then'](function(_0x4e6859){if(_0x2a559f[_0xf2f1('0x49')][_0xf2f1('0x9c')]===_0xf2f1('0x9d')){for(var _0x3c35e5=0x0;_0x3c35e5<_0x4e6859['length'];_0x3c35e5++){_0x4e6859[_0x3c35e5]['body']=juice(_0x4e6859[_0x3c35e5]['body']);}}_0x324575['rows']=_0x4e6859;return _0x324575;});}})[_0xf2f1('0x12')](respondWithFilteredResult(_0x14273a,_0x21a1fe))[_0xf2f1('0x5a')](handleError(_0x14273a,null));};exports[_0xf2f1('0x29')]=function(_0x50d2b3,_0x3b96bc){var _0x879b9a,_0x9950bc={},_0x18965a;if(_0x50d2b3[_0xf2f1('0x5f')]['to']){_0x18965a=_0x50d2b3[_0xf2f1('0x5f')]['to']['split'](',')[0x0];}return db[_0xf2f1('0x46')]['find']({'where':{'id':_0x50d2b3[_0xf2f1('0x5b')]['id']},'include':[{'model':db[_0xf2f1('0x9e')],'as':_0xf2f1('0x9f'),'include':[{'model':db[_0xf2f1('0x84')],'as':_0xf2f1('0xa0'),'where':{'email':_0x18965a},'limit':0x1,'order':[[_0xf2f1('0xa1'),_0xf2f1('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf2f1('0xa3')],'as':_0xf2f1('0xa3'),'raw':!![]}]}]})[_0xf2f1('0x12')](handleEntityNotFound(_0x3b96bc,null))[_0xf2f1('0x12')](function(_0x3e6311){if(!_0x3e6311)return;_0x879b9a=_0x3e6311;if(!_0x3e6311[_0xf2f1('0x41')])throw new Error(_0xf2f1('0xa4'));if(_[_0xf2f1('0xa5')](_0x50d2b3[_0xf2f1('0x5f')][_0xf2f1('0xa6')])){_0x50d2b3[_0xf2f1('0x5f')]['from']=util[_0xf2f1('0x9a')](_0xf2f1('0xa7'),_0x3e6311[_0xf2f1('0x28')],_0x3e6311[_0xf2f1('0x6f')]||_0x3e6311['Smtp'][_0xf2f1('0x35')]);}if(_0x50d2b3['body']['attachments']&&_0x50d2b3[_0xf2f1('0x5f')]['attachments']['length']){for(var _0x5a3348=0x0;_0x5a3348<_0x50d2b3[_0xf2f1('0x5f')][_0xf2f1('0xa8')][_0xf2f1('0x4d')];_0x5a3348+=0x1){_0x50d2b3['body'][_0xf2f1('0xa8')][_0x5a3348]={'filename':_0x50d2b3['body'][_0xf2f1('0xa8')][_0x5a3348][_0xf2f1('0x28')],'path':path[_0xf2f1('0xa9')](config[_0xf2f1('0xaa')],'server/files/attachments',_0x50d2b3[_0xf2f1('0x5f')][_0xf2f1('0xa8')][_0x5a3348]['basename'])};}}var _0x1544a7=_0x3e6311[_0xf2f1('0xab')]();return respondWithRpcPromise(_0xf2f1('0xac'),_0xf2f1('0xad'),{'account':_0x1544a7,'message':_0x50d2b3[_0xf2f1('0x5f')]});})['then'](function(_0xe12c4a){if(!_0xe12c4a)return;_0x9950bc=_0xe12c4a;if(!_0x879b9a[_0xf2f1('0x9f')])throw new Error(_0xf2f1('0xae'));if(_0x879b9a[_0xf2f1('0x9f')][_0xf2f1('0xa0')][_0xf2f1('0x4d')])return _0x879b9a[_0xf2f1('0x9f')]['Contacts'][0x0];return db['CmContact'][_0xf2f1('0x66')](_['defaults'](_0x50d2b3[_0xf2f1('0x5f')],{'firstName':_0x50d2b3[_0xf2f1('0x5f')]['to'],'email':_0x50d2b3[_0xf2f1('0x5f')]['to'],'phone':_0x50d2b3[_0xf2f1('0x5f')]['to'],'ListId':_0x879b9a['ListId']}));})[_0xf2f1('0x12')](function(_0xe9b241){if(!_0xe9b241)return;var _0x5b2060={'UserId':_0x50d2b3[_0xf2f1('0x35')]['id'],'ContactId':_0xe9b241['id'],'MailAccountId':_0x879b9a['id'],'inReplyTo':_0x9950bc[_0xf2f1('0xaf')],'to':_0x50d2b3[_0xf2f1('0x5f')]['from'],'cc':_0x50d2b3[_0xf2f1('0x5f')]['cc'],'subject':_0x50d2b3['body']['subject'],'attach':_0x50d2b3[_0xf2f1('0x5f')][_0xf2f1('0xb0')],'firstMsgDirection':_0xf2f1('0xb1'),'lastMsgAt':moment()[_0xf2f1('0x9a')](_0xf2f1('0x9b')),'lastMsgDirection':'out','Messages':[_['merge'](_0x50d2b3[_0xf2f1('0x5f')],{'messageId':_0x9950bc[_0xf2f1('0xaf')],'sentAt':moment()[_0xf2f1('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x879b9a['id'],'UserId':_0x50d2b3['user']['id'],'ContactId':_0xe9b241['id']})]};if(_0x50d2b3[_0xf2f1('0x5f')][_0xf2f1('0xb2')]){_0x5b2060=_[_0xf2f1('0x54')](_0x5b2060,_0x50d2b3[_0xf2f1('0x5f')][_0xf2f1('0xb2')]);}return db['MailInteraction'][_0xf2f1('0x66')](_0x5b2060,{'include':[{'model':db[_0xf2f1('0x97')],'as':_0xf2f1('0xb3')}]});})[_0xf2f1('0x12')](respondWithResult(_0x3b96bc,null))[_0xf2f1('0x5a')](handleError(_0x3b96bc,null));};exports['verifySmtp']=function(_0x3d2f01,_0x446b29){return db[_0xf2f1('0x46')][_0xf2f1('0x5e')]({'where':{'id':_0x3d2f01[_0xf2f1('0x5b')]['id']},'include':[{'model':db[_0xf2f1('0x42')],'as':_0xf2f1('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf2f1('0xa3'),'raw':!![]}]}]})[_0xf2f1('0x12')](handleEntityNotFound(_0x446b29,null))[_0xf2f1('0x12')](function(_0x338a19){if(!_0x338a19['Smtp'])return;var _0x571a57=_0x338a19[_0xf2f1('0xab')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x571a57});})['then'](respondWithResult(_0x446b29,null))[_0xf2f1('0x5a')](handleError(_0x446b29,null));};exports[_0xf2f1('0x25')]=function(_0x4e2038,_0x17f1aa){return db[_0xf2f1('0x46')][_0xf2f1('0x5e')]({'where':{'id':_0x4e2038[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x17f1aa,null))['then'](function(_0x3d9358){if(_0x3d9358&&_0x3d9358[_0xf2f1('0x3e')]){throw new db['Sequelize']['ValidationError'](_0xf2f1('0xb4'));}return _0x3d9358;})['then'](removeEntity(_0x17f1aa,null))[_0xf2f1('0x5a')](handleError(_0x17f1aa,null));};exports[_0xf2f1('0xb5')]=function(_0x4572b3,_0x37008d){return db[_0xf2f1('0x46')][_0xf2f1('0x5e')]({'where':{'id':_0x4572b3[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x37008d,null))[_0xf2f1('0x12')](function(_0x57f5f0){if(_0x57f5f0){return _0x57f5f0[_0xf2f1('0xb5')](_0x4572b3[_0xf2f1('0x5f')][_0xf2f1('0x6b')],_[_0xf2f1('0x82')](_0x4572b3['body'],[_0xf2f1('0x6b'),'id'])||{})[_0xf2f1('0xb6')](function(_0x4c123b){for(var _0x28ea0f=0x0;_0x28ea0f<_0x4572b3['body'][_0xf2f1('0x6b')]['length'];_0x28ea0f+=0x1){socket[_0xf2f1('0xb7')]('userMailAccount:save',{'UserId':Number(_0x4572b3[_0xf2f1('0x5f')][_0xf2f1('0x6b')][_0x28ea0f]),'MailAccountId':Number(_0x4572b3[_0xf2f1('0x5b')]['id'])});}return _0x4c123b;});}})[_0xf2f1('0x12')](respondWithResult(_0x37008d,null))[_0xf2f1('0x5a')](handleError(_0x37008d,null));};exports[_0xf2f1('0xb8')]=function(_0x5e3bf7,_0x265922){return db[_0xf2f1('0x46')][_0xf2f1('0x5e')]({'where':{'id':_0x5e3bf7[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x265922,null))[_0xf2f1('0x12')](function(_0x4a9388){if(_0x4a9388){return _0x4a9388[_0xf2f1('0xb8')](_0x5e3bf7[_0xf2f1('0x49')]['ids'])['then'](function(){if(_[_0xf2f1('0xb9')](_0x5e3bf7[_0xf2f1('0x49')][_0xf2f1('0x6b')])){for(var _0x489a3e=0x0;_0x489a3e<_0x5e3bf7[_0xf2f1('0x49')][_0xf2f1('0x6b')]['length'];_0x489a3e+=0x1){socket[_0xf2f1('0xb7')](_0xf2f1('0xba'),{'UserId':Number(_0x5e3bf7[_0xf2f1('0x49')][_0xf2f1('0x6b')][_0x489a3e]),'MailAccountId':Number(_0x5e3bf7[_0xf2f1('0x5b')]['id'])});}}else{socket[_0xf2f1('0xb7')](_0xf2f1('0xba'),{'UserId':Number(_0x5e3bf7['query'][_0xf2f1('0x6b')]),'MailAccountId':Number(_0x5e3bf7[_0xf2f1('0x5b')]['id'])});}});}})[_0xf2f1('0x12')](respondWithStatusCode(_0x265922,null))[_0xf2f1('0x5a')](handleError(_0x265922,null));};exports[_0xf2f1('0xbb')]=function(_0x21f194,_0x5868b4){var _0x164783={};var _0x170f27={};var _0x48d6e9;var _0x5b272c;return db[_0xf2f1('0x46')]['findOne']({'where':{'id':_0x21f194[_0xf2f1('0x5b')]['id']}})[_0xf2f1('0x12')](handleEntityNotFound(_0x5868b4,null))[_0xf2f1('0x12')](function(_0x110512){if(_0x110512){_0x48d6e9=_0x110512;_0x170f27[_0xf2f1('0x48')]=_[_0xf2f1('0x5d')](db[_0xf2f1('0x86')][_0xf2f1('0x47')]);_0x170f27[_0xf2f1('0x49')]=_['keys'](_0x21f194[_0xf2f1('0x49')]);_0x170f27['filters']=_[_0xf2f1('0x4b')](_0x170f27[_0xf2f1('0x48')],_0x170f27[_0xf2f1('0x49')]);_0x164783['attributes']=_[_0xf2f1('0x4b')](_0x170f27[_0xf2f1('0x48')],qs['fields'](_0x21f194[_0xf2f1('0x49')]['fields']));_0x164783[_0xf2f1('0x4a')]=_0x164783[_0xf2f1('0x4a')][_0xf2f1('0x4d')]?_0x164783[_0xf2f1('0x4a')]:_0x170f27[_0xf2f1('0x48')];_0x164783[_0xf2f1('0x50')]=qs[_0xf2f1('0x68')](_0x21f194[_0xf2f1('0x49')][_0xf2f1('0x68')]);_0x164783[_0xf2f1('0x51')]=qs[_0xf2f1('0x52')](_['pick'](_0x21f194['query'],_0x170f27['filters']));if(_0x21f194[_0xf2f1('0x49')][_0xf2f1('0x53')]){_0x164783['where']=_[_0xf2f1('0x54')](_0x164783[_0xf2f1('0x51')],{'$or':_[_0xf2f1('0x45')](_0x164783[_0xf2f1('0x4a')],function(_0x1d0eb6){var _0x333b48={};_0x333b48[_0x1d0eb6]={'$like':'%'+_0x21f194[_0xf2f1('0x49')][_0xf2f1('0x53')]+'%'};return _0x333b48;})});}_0x164783=_[_0xf2f1('0x54')]({},_0x164783,_0x21f194[_0xf2f1('0x56')]);return _0x48d6e9[_0xf2f1('0xbb')](_0x164783);}})['then'](function(_0x4edbee){if(_0x4edbee){_0x5b272c=_0x4edbee[_0xf2f1('0x4d')];if(!_0x21f194[_0xf2f1('0x49')][_0xf2f1('0x4e')](_0xf2f1('0x4f'))){_0x164783[_0xf2f1('0x20')]=qs[_0xf2f1('0x20')](_0x21f194[_0xf2f1('0x49')][_0xf2f1('0x20')]);_0x164783[_0xf2f1('0x1e')]=qs[_0xf2f1('0x1e')](_0x21f194[_0xf2f1('0x49')][_0xf2f1('0x1e')]);}return _0x48d6e9['getAgents'](_0x164783);}})[_0xf2f1('0x12')](function(_0x295f2e){if(_0x295f2e){return _0x295f2e?{'count':_0x5b272c,'rows':_0x295f2e}:null;}})[_0xf2f1('0x12')](respondWithResult(_0x5868b4,null))['catch'](handleError(_0x5868b4,null));}; \ No newline at end of file +var _0x2cbb=['Smtp','index','MailServerIn','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','provider','custom','modernAuthentication','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','Disposition','create','findOne','nolimit','order','sort','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','get','MailAccounts','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.mail.yahoo.com','smtp.office365.com','user','password','pass','CloudProviderId','port','secure','service','authentication','Imap','host'];(function(_0x5016d8,_0x4dadd7){var _0x1c5abc=function(_0x9cfd28){while(--_0x9cfd28){_0x5016d8['push'](_0x5016d8['shift']());}};_0x1c5abc(++_0x4dadd7);}(_0x2cbb,0x84));var _0xb2cb=function(_0x43cba5,_0x4a2f83){_0x43cba5=_0x43cba5-0x0;var _0x359d1a=_0x2cbb[_0x43cba5];return _0x359d1a;};'use strict';var moment=require('moment');var BPromise=require(_0xb2cb('0x0'));var util=require(_0xb2cb('0x1'));var path=require(_0xb2cb('0x2'));var _=require(_0xb2cb('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0xb2cb('0x4'));var logger=require(_0xb2cb('0x5'))(_0xb2cb('0x6'));var config=require(_0xb2cb('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb2cb('0x8')](config[_0xb2cb('0x9')],{'host':_0xb2cb('0xa'),'port':0x18eb});var socket=require(_0xb2cb('0xb'))(new Redis(config[_0xb2cb('0x9')]));require(_0xb2cb('0xc'))[_0xb2cb('0xd')](socket);var jayson=require(_0xb2cb('0xe'));var client=jayson[_0xb2cb('0xf')][_0xb2cb('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x44e8f8,_0x4fef8d,_0x31a6b6,_0x58211d){return new BPromise(function(_0x28404e,_0x3ec701){var _0x34aeb4=_0x58211d||client;return _0x34aeb4['request'](_0x44e8f8,_0x31a6b6)[_0xb2cb('0x11')](function(_0x793fbe){logger[_0xb2cb('0x12')](_0xb2cb('0x13'),_0x4fef8d,_0xb2cb('0x14'));logger[_0xb2cb('0x15')](_0xb2cb('0x16'),_0x4fef8d,_0xb2cb('0x14'),JSON[_0xb2cb('0x17')](_0x793fbe));if(_0x793fbe[_0xb2cb('0x18')]){if(_0x793fbe[_0xb2cb('0x18')][_0xb2cb('0x19')]===0x1f4){logger[_0xb2cb('0x18')]('MailAccount,\x20%s,\x20%s',_0x4fef8d,_0x793fbe[_0xb2cb('0x18')][_0xb2cb('0x1a')]);return _0x3ec701(_0x793fbe[_0xb2cb('0x18')][_0xb2cb('0x1a')]);}logger[_0xb2cb('0x18')]('MailAccount,\x20%s,\x20%s',_0x4fef8d,_0x793fbe[_0xb2cb('0x18')][_0xb2cb('0x1a')]);return _0x28404e(_0x793fbe[_0xb2cb('0x18')][_0xb2cb('0x1a')]);}else{logger[_0xb2cb('0x12')](_0xb2cb('0x13'),_0x4fef8d,'request\x20sent');_0x28404e(_0x793fbe['result'][_0xb2cb('0x1a')]);}})['catch'](function(_0x2d6e67){logger[_0xb2cb('0x18')](_0xb2cb('0x13'),_0x4fef8d,_0x2d6e67);_0x3ec701(_0x2d6e67);});});}function respondWithStatusCode(_0x1dc4b0,_0x4b6d2c){_0x4b6d2c=_0x4b6d2c||0xcc;return function(_0x22cdad){if(_0x22cdad){return _0x1dc4b0[_0xb2cb('0x1b')](_0x4b6d2c);}return _0x1dc4b0[_0xb2cb('0x1c')](_0x4b6d2c)[_0xb2cb('0x1d')]();};}function respondWithResult(_0x1297f1,_0x5ab3ae){_0x5ab3ae=_0x5ab3ae||0xc8;return function(_0x5b08e2){if(_0x5b08e2){return _0x1297f1['status'](_0x5ab3ae)[_0xb2cb('0x1e')](_0x5b08e2);}};}function respondWithFilteredResult(_0x1e69be,_0x53d1c9){return function(_0x110322){if(_0x110322){var _0x562869=typeof _0x53d1c9['offset']===_0xb2cb('0x1f')&&typeof _0x53d1c9[_0xb2cb('0x20')]===_0xb2cb('0x1f');var _0x42c867=_0x110322[_0xb2cb('0x21')];var _0x44ce98=_0x562869?0x0:_0x53d1c9['offset'];var _0x4c43d4=_0x562869?_0x110322['count']:_0x53d1c9[_0xb2cb('0x22')]+_0x53d1c9[_0xb2cb('0x20')];var _0x25f9ab;if(_0x4c43d4>=_0x42c867){_0x4c43d4=_0x42c867;_0x25f9ab=0xc8;}else{_0x25f9ab=0xce;}_0x1e69be[_0xb2cb('0x1c')](_0x25f9ab);return _0x1e69be[_0xb2cb('0x23')](_0xb2cb('0x24'),_0x44ce98+'-'+_0x4c43d4+'/'+_0x42c867)[_0xb2cb('0x1e')](_0x110322);}return null;};}function saveUpdates(_0x1c05d0){return function(_0x1a96f9){if(_0x1a96f9){return _0x1a96f9['update'](_0x1c05d0)[_0xb2cb('0x11')](function(_0x4e2f8c){return _0x4e2f8c;});}return null;};}function removeEntity(_0x2d9891){return function(_0x581b69){if(_0x581b69){return _0x581b69[_0xb2cb('0x25')]()[_0xb2cb('0x11')](function(){var _0x19b984=_0x581b69[_0xb2cb('0x26')]({'plain':!![]});var _0x2f19e7=_0xb2cb('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f19e7,'resourceId':_0x19b984['id']}})['then'](function(){return _0x581b69;});})['then'](function(){_0x2d9891['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b62ac){return function(_0x4757ed){if(!_0x4757ed){_0x3b62ac[_0xb2cb('0x1b')](0x194);}return _0x4757ed;};}function handleError(_0x29d8b1,_0x4bc28d){_0x4bc28d=_0x4bc28d||0x1f4;return function(_0x3d8e38){logger[_0xb2cb('0x18')](_0x3d8e38[_0xb2cb('0x28')]);if(_0x3d8e38[_0xb2cb('0x29')]){delete _0x3d8e38[_0xb2cb('0x29')];}_0x29d8b1['status'](_0x4bc28d)[_0xb2cb('0x2a')](_0x3d8e38);};}function getImapHost(_0x48e875){switch(_0x48e875){case'gmail':return _0xb2cb('0x2b');case _0xb2cb('0x2c'):return _0xb2cb('0x2d');case _0xb2cb('0x2e'):return _0xb2cb('0x2f');case _0xb2cb('0x30'):return _0xb2cb('0x31');}throw new Error(_0xb2cb('0x32'),_0x48e875);}function getSmtpHost(_0x522bc5){switch(_0x522bc5){case _0xb2cb('0x33'):return'smtp.gmail.com';case'yahoo':return _0xb2cb('0x34');case _0xb2cb('0x2e'):return'smtp-mail.outlook.com';case _0xb2cb('0x30'):return _0xb2cb('0x35');}throw new Error(_0xb2cb('0x32'),_0x522bc5);}function getAuthenticationOptions(_0x499b4c,_0x1d75d9){var _0x447352={};var _0x44c87d={};if(_0x499b4c){_0x447352[_0xb2cb('0x36')]=_0x44c87d['user']=_0x1d75d9['username'];_0x447352[_0xb2cb('0x37')]=_0x44c87d[_0xb2cb('0x38')]=_0x1d75d9[_0xb2cb('0x37')];if(_0x1d75d9['modernAuthentication']){_0x447352['modernAuthentication']=_0x44c87d['modernAuthentication']=!![];_0x447352['CloudProviderId']=_0x44c87d['CloudProviderId']=_0x1d75d9[_0xb2cb('0x39')];_0x447352[_0xb2cb('0x37')]=_0x44c87d['pass']=null;}else{_0x447352[_0xb2cb('0x39')]=_0x44c87d[_0xb2cb('0x39')]=null;}_0x447352['host']=getImapHost(_0x499b4c);_0x447352[_0xb2cb('0x3a')]=0x3e1;_0x44c87d['host']=getSmtpHost(_0x499b4c);_0x44c87d['port']=0x24b;_0x44c87d[_0xb2cb('0x3b')]=![];_0x447352[_0xb2cb('0x3c')]=_0x44c87d[_0xb2cb('0x3c')]=null;}else{if(_0x1d75d9[_0xb2cb('0x3d')]){_0x447352['user']=_0x44c87d[_0xb2cb('0x36')]=_0x1d75d9['username'];_0x447352[_0xb2cb('0x37')]=_0x44c87d[_0xb2cb('0x38')]=_0x1d75d9[_0xb2cb('0x37')];}else{_0x447352[_0xb2cb('0x3d')]=_0x44c87d[_0xb2cb('0x3d')]=![];_0x447352['user']=_0x44c87d[_0xb2cb('0x36')]=null;_0x447352[_0xb2cb('0x37')]=_0x44c87d[_0xb2cb('0x38')]=null;}_0x447352['host']=_0x1d75d9[_0xb2cb('0x3e')][_0xb2cb('0x3f')];_0x447352[_0xb2cb('0x3a')]=_0x1d75d9['Imap'][_0xb2cb('0x3a')];_0x44c87d['host']=_0x1d75d9[_0xb2cb('0x40')][_0xb2cb('0x3f')];_0x44c87d[_0xb2cb('0x3a')]=_0x1d75d9[_0xb2cb('0x40')][_0xb2cb('0x3a')];}return{'Imap':_0x447352,'Smtp':_0x44c87d};}exports[_0xb2cb('0x41')]=function(_0x5e7b34,_0x2dbdad){var _0x380116={'include':[{'model':db[_0xb2cb('0x42')],'as':_0xb2cb('0x3e')},{'model':db[_0xb2cb('0x43')],'as':_0xb2cb('0x40')},{'model':db[_0xb2cb('0x44')],'as':'mandatoryDispositionPause'}]},_0x2eaf18={},_0x5f358d={'count':0x0,'rows':[]};var _0x17a699=_[_0xb2cb('0x45')](db[_0xb2cb('0x46')][_0xb2cb('0x47')],function(_0x39eaae){return{'name':_0x39eaae[_0xb2cb('0x48')],'type':_0x39eaae[_0xb2cb('0x49')][_0xb2cb('0x4a')]};});_0x2eaf18['model']=_[_0xb2cb('0x45')](_0x17a699,_0xb2cb('0x29'));_0x2eaf18[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x5e7b34[_0xb2cb('0x4b')]);_0x2eaf18['filters']=_['intersection'](_0x2eaf18[_0xb2cb('0x4d')],_0x2eaf18[_0xb2cb('0x4b')]);_0x380116[_0xb2cb('0x4e')]=_[_0xb2cb('0x4f')](_0x2eaf18[_0xb2cb('0x4d')],qs[_0xb2cb('0x50')](_0x5e7b34['query'][_0xb2cb('0x50')]));_0x380116[_0xb2cb('0x4e')]=_0x380116[_0xb2cb('0x4e')][_0xb2cb('0x51')]?_0x380116[_0xb2cb('0x4e')]:_0x2eaf18[_0xb2cb('0x4d')];if(!_0x5e7b34[_0xb2cb('0x4b')][_0xb2cb('0x52')]('nolimit')){_0x380116[_0xb2cb('0x20')]=qs[_0xb2cb('0x20')](_0x5e7b34[_0xb2cb('0x4b')][_0xb2cb('0x20')]);_0x380116[_0xb2cb('0x22')]=qs['offset'](_0x5e7b34[_0xb2cb('0x4b')][_0xb2cb('0x22')]);}_0x380116['order']=qs['sort'](_0x5e7b34[_0xb2cb('0x4b')]['sort']);_0x380116[_0xb2cb('0x53')]=qs[_0xb2cb('0x54')](_[_0xb2cb('0x55')](_0x5e7b34['query'],_0x2eaf18[_0xb2cb('0x54')]),_0x17a699);if(_0x5e7b34['query'][_0xb2cb('0x56')]){_0x380116[_0xb2cb('0x53')]=_[_0xb2cb('0x57')](_0x380116[_0xb2cb('0x53')],{'$or':_[_0xb2cb('0x45')](_0x17a699,function(_0x116407){if(_0x116407[_0xb2cb('0x49')]!==_0xb2cb('0x58')){var _0x4bc110={};_0x4bc110[_0x116407[_0xb2cb('0x29')]]={'$like':'%'+_0x5e7b34[_0xb2cb('0x4b')][_0xb2cb('0x56')]+'%'};return _0x4bc110;}})});}_0x380116=_[_0xb2cb('0x57')]({},_0x380116,_0x5e7b34[_0xb2cb('0x59')]);var _0x320d85={'where':_0x380116[_0xb2cb('0x53')]};return db['MailAccount'][_0xb2cb('0x21')](_0x320d85)['then'](function(_0x2e2d91){_0x5f358d[_0xb2cb('0x21')]=_0x2e2d91;if(_0x5e7b34[_0xb2cb('0x4b')][_0xb2cb('0x5a')]){_0x380116[_0xb2cb('0x5b')]=[{'all':!![]}];}return db[_0xb2cb('0x46')][_0xb2cb('0x5c')](_0x380116);})[_0xb2cb('0x11')](function(_0x12d8b3){_0x5f358d[_0xb2cb('0x5d')]=_0x12d8b3;return _0x5f358d;})[_0xb2cb('0x11')](respondWithFilteredResult(_0x2dbdad,_0x380116))[_0xb2cb('0x5e')](handleError(_0x2dbdad,null));};exports['show']=function(_0x2f944c,_0x23d3e8){var _0x407034={'raw':![],'where':{'id':_0x2f944c[_0xb2cb('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xb2cb('0x3e')},{'model':db[_0xb2cb('0x43')],'as':_0xb2cb('0x40')},{'model':db[_0xb2cb('0x44')],'as':'mandatoryDispositionPause'}]},_0x50838c={};_0x50838c[_0xb2cb('0x4d')]=_[_0xb2cb('0x4c')](db['MailAccount'][_0xb2cb('0x47')]);_0x50838c[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x2f944c[_0xb2cb('0x4b')]);_0x50838c[_0xb2cb('0x54')]=_['intersection'](_0x50838c[_0xb2cb('0x4d')],_0x50838c[_0xb2cb('0x4b')]);_0x407034[_0xb2cb('0x4e')]=_[_0xb2cb('0x4f')](_0x50838c[_0xb2cb('0x4d')],qs[_0xb2cb('0x50')](_0x2f944c['query']['fields']));_0x407034[_0xb2cb('0x4e')]=_0x407034[_0xb2cb('0x4e')][_0xb2cb('0x51')]?_0x407034[_0xb2cb('0x4e')]:_0x50838c[_0xb2cb('0x4d')];if(_0x2f944c[_0xb2cb('0x4b')][_0xb2cb('0x5a')]){_0x407034['include']=[{'all':!![]}];}_0x407034=_['merge']({},_0x407034,_0x2f944c[_0xb2cb('0x59')]);return db[_0xb2cb('0x46')][_0xb2cb('0x60')](_0x407034)[_0xb2cb('0x11')](handleEntityNotFound(_0x23d3e8,null))[_0xb2cb('0x11')](respondWithResult(_0x23d3e8,null))[_0xb2cb('0x5e')](handleError(_0x23d3e8,null));};exports['update']=function(_0x4213e5,_0x3c2988){if(_0x4213e5[_0xb2cb('0x61')]['id']){delete _0x4213e5[_0xb2cb('0x61')]['id'];}var _0x465729=_0x4213e5[_0xb2cb('0x61')][_0xb2cb('0x62')]===_0xb2cb('0x63')?null:_0x4213e5[_0xb2cb('0x61')]['provider'];var _0x4b5bfb=_0x4213e5[_0xb2cb('0x61')][_0xb2cb('0x3e')]||{};var _0xf23d65=_0x4213e5[_0xb2cb('0x61')][_0xb2cb('0x40')]||{};if(_0x465729){_0x4b5bfb[_0xb2cb('0x3f')]=getImapHost(_0x465729);_0x4b5bfb[_0xb2cb('0x3a')]=0x3e1;_0xf23d65[_0xb2cb('0x3f')]=getSmtpHost(_0x465729);_0xf23d65[_0xb2cb('0x3a')]=0x24b;_0xf23d65['secure']=![];}if(_0xf23d65[_0xb2cb('0x64')]){_0xf23d65['secure']=![];}else{_0xf23d65['CloudProviderId']=null;}if(!_0x4b5bfb['modernAuthentication'])_0x4b5bfb[_0xb2cb('0x39')]=null;_0x4213e5[_0xb2cb('0x61')]['Imap']=_0x4b5bfb;_0x4213e5['body'][_0xb2cb('0x40')]=_0xf23d65;return db['MailAccount'][_0xb2cb('0x60')]({'where':{'id':_0x4213e5[_0xb2cb('0x5f')]['id']},'include':[{'model':db[_0xb2cb('0x42')],'as':_0xb2cb('0x3e')},{'model':db[_0xb2cb('0x43')],'as':'Smtp'},{'model':db[_0xb2cb('0x44')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3c2988,null))[_0xb2cb('0x11')](function(_0x2d24ae){if(!_0x2d24ae)throw new Error(_0xb2cb('0x65'));if(_0x2d24ae[_0xb2cb('0x3c')])delete _0x4213e5['body'][_0xb2cb('0x3e')];return _0x2d24ae;})['then'](saveUpdates(_0x4213e5['body'],null))[_0xb2cb('0x11')](function(_0x4c9844){if(!_0x4213e5['body']['Imap'])return _0x4c9844;return db[_0xb2cb('0x42')][_0xb2cb('0x66')](_0x4213e5['body'][_0xb2cb('0x3e')],{'where':{'MailAccountId':_0x4c9844['id']}})[_0xb2cb('0x11')](function(){return _0x4c9844;});})[_0xb2cb('0x11')](function(_0x8211f1){if(!_0x4213e5['body'][_0xb2cb('0x40')])return _0x8211f1;return db[_0xb2cb('0x43')][_0xb2cb('0x66')](_0x4213e5['body'][_0xb2cb('0x40')],{'where':{'MailAccountId':_0x8211f1['id']}})[_0xb2cb('0x11')](function(){return _0x8211f1;});})[_0xb2cb('0x11')](respondWithResult(_0x3c2988,null))[_0xb2cb('0x5e')](handleError(_0x3c2988,null));};exports[_0xb2cb('0x67')]=function(_0x50ce1b,_0x75f53e){return db[_0xb2cb('0x46')][_0xb2cb('0x67')]()[_0xb2cb('0x11')](respondWithResult(_0x75f53e,null))[_0xb2cb('0x5e')](handleError(_0x75f53e,null));};exports[_0xb2cb('0x68')]=function(_0x42c2bb,_0x4b92cc){if(_0x42c2bb[_0xb2cb('0x61')]['id']){delete _0x42c2bb['body']['id'];}return db['MailAccount'][_0xb2cb('0x60')]({'where':{'id':_0x42c2bb['params']['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x4b92cc,null))[_0xb2cb('0x11')](function(_0x1ffd1b){if(_0x1ffd1b){_0x42c2bb[_0xb2cb('0x61')][_0xb2cb('0x69')]=_0x1ffd1b['id'];return db[_0xb2cb('0x6a')][_0xb2cb('0x6b')](_0x42c2bb[_0xb2cb('0x61')]);}})[_0xb2cb('0x11')](respondWithResult(_0x4b92cc,null))['catch'](handleError(_0x4b92cc,null));};exports['getDispositions']=function(_0x612c91,_0x56681f){var _0x22818d={'raw':![],'where':{}};var _0x5c7987={};var _0x35c354={'count':0x0,'rows':[]};return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x612c91[_0xb2cb('0x5f')]['id']}})['then'](handleEntityNotFound(_0x56681f,null))[_0xb2cb('0x11')](function(_0x45a2af){if(_0x45a2af){_0x5c7987['model']=_['keys'](db[_0xb2cb('0x6a')][_0xb2cb('0x47')]);_0x5c7987[_0xb2cb('0x4b')]=_['keys'](_0x612c91['query']);_0x5c7987['filters']=_[_0xb2cb('0x4f')](_0x5c7987[_0xb2cb('0x4d')],_0x5c7987[_0xb2cb('0x4b')]);_0x22818d[_0xb2cb('0x4e')]=_[_0xb2cb('0x4f')](_0x5c7987['model'],qs[_0xb2cb('0x50')](_0x612c91[_0xb2cb('0x4b')][_0xb2cb('0x50')]));_0x22818d['attributes']=_0x22818d['attributes']['length']?_0x22818d['attributes']:_0x5c7987[_0xb2cb('0x4d')];if(!_0x612c91[_0xb2cb('0x4b')]['hasOwnProperty'](_0xb2cb('0x6d'))){_0x22818d[_0xb2cb('0x20')]=qs[_0xb2cb('0x20')](_0x612c91[_0xb2cb('0x4b')][_0xb2cb('0x20')]);_0x22818d[_0xb2cb('0x22')]=qs['offset'](_0x612c91['query'][_0xb2cb('0x22')]);}_0x22818d[_0xb2cb('0x6e')]=qs[_0xb2cb('0x6f')](_0x612c91['query'][_0xb2cb('0x6f')]);_0x22818d[_0xb2cb('0x53')]=qs[_0xb2cb('0x54')](_[_0xb2cb('0x55')](_0x612c91[_0xb2cb('0x4b')],_0x5c7987['filters']));_0x22818d[_0xb2cb('0x53')]['MailAccountId']=_0x45a2af['id'];if(_0x612c91['query'][_0xb2cb('0x56')]){_0x22818d['where']=_[_0xb2cb('0x57')](_0x22818d[_0xb2cb('0x53')],{'$or':_[_0xb2cb('0x45')](_0x22818d[_0xb2cb('0x4e')],function(_0x2c2b62){var _0x145bf9={};_0x145bf9[_0x2c2b62]={'$like':'%'+_0x612c91[_0xb2cb('0x4b')]['filter']+'%'};return _0x145bf9;})});}_0x22818d=_[_0xb2cb('0x57')]({},_0x22818d,_0x612c91[_0xb2cb('0x59')]);return db[_0xb2cb('0x6a')][_0xb2cb('0x21')]({'where':_0x22818d[_0xb2cb('0x53')]})[_0xb2cb('0x11')](function(_0x130dd9){_0x35c354[_0xb2cb('0x21')]=_0x130dd9;if(_0x612c91[_0xb2cb('0x4b')]['includeAll']){_0x22818d['include']=[{'all':!![]}];}return db['Disposition'][_0xb2cb('0x5c')](_0x22818d);})['then'](function(_0xa087a9){_0x35c354[_0xb2cb('0x5d')]=_0xa087a9;return _0x35c354;});}})[_0xb2cb('0x11')](respondWithFilteredResult(_0x56681f,_0x22818d))[_0xb2cb('0x5e')](handleError(_0x56681f,null));};exports[_0xb2cb('0x70')]=function(_0x46bd8c,_0x2fdccd){return db[_0xb2cb('0x46')][_0xb2cb('0x60')]({'where':{'id':_0x46bd8c[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x2fdccd,null))[_0xb2cb('0x11')](function(_0x4d384d){if(_0x4d384d){return _0x4d384d['removeDispositions'](_0x46bd8c[_0xb2cb('0x4b')][_0xb2cb('0x71')]);}})['then'](respondWithStatusCode(_0x2fdccd,null))[_0xb2cb('0x5e')](handleError(_0x2fdccd,null));};exports['addAnswer']=function(_0x1a5c72,_0x4fb6dd){if(_0x1a5c72['body']['id']){delete _0x1a5c72[_0xb2cb('0x61')]['id'];}return db[_0xb2cb('0x46')][_0xb2cb('0x60')]({'where':{'id':_0x1a5c72[_0xb2cb('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4fb6dd,null))[_0xb2cb('0x11')](function(_0x517599){if(_0x517599){_0x1a5c72[_0xb2cb('0x61')][_0xb2cb('0x69')]=_0x517599['id'];return db[_0xb2cb('0x72')][_0xb2cb('0x6b')](_0x1a5c72['body']);}})['then'](respondWithResult(_0x4fb6dd,null))[_0xb2cb('0x5e')](handleError(_0x4fb6dd,null));};exports[_0xb2cb('0x73')]=function(_0x76d04b,_0x54ee51){var _0x1e01d3={'raw':![],'where':{}};var _0x59b829={};var _0x32c9aa={'count':0x0,'rows':[]};return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x76d04b[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x54ee51,null))[_0xb2cb('0x11')](function(_0x211e0d){if(_0x211e0d){_0x59b829[_0xb2cb('0x4d')]=_['keys'](db[_0xb2cb('0x72')][_0xb2cb('0x47')]);_0x59b829[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x76d04b['query']);_0x59b829[_0xb2cb('0x54')]=_[_0xb2cb('0x4f')](_0x59b829['model'],_0x59b829['query']);_0x1e01d3[_0xb2cb('0x4e')]=_[_0xb2cb('0x4f')](_0x59b829['model'],qs[_0xb2cb('0x50')](_0x76d04b[_0xb2cb('0x4b')][_0xb2cb('0x50')]));_0x1e01d3[_0xb2cb('0x4e')]=_0x1e01d3[_0xb2cb('0x4e')]['length']?_0x1e01d3[_0xb2cb('0x4e')]:_0x59b829[_0xb2cb('0x4d')];if(!_0x76d04b[_0xb2cb('0x4b')][_0xb2cb('0x52')](_0xb2cb('0x6d'))){_0x1e01d3[_0xb2cb('0x20')]=qs[_0xb2cb('0x20')](_0x76d04b[_0xb2cb('0x4b')][_0xb2cb('0x20')]);_0x1e01d3['offset']=qs[_0xb2cb('0x22')](_0x76d04b['query']['offset']);}_0x1e01d3[_0xb2cb('0x6e')]=qs[_0xb2cb('0x6f')](_0x76d04b[_0xb2cb('0x4b')][_0xb2cb('0x6f')]);_0x1e01d3[_0xb2cb('0x53')]=qs['filters'](_[_0xb2cb('0x55')](_0x76d04b[_0xb2cb('0x4b')],_0x59b829[_0xb2cb('0x54')]));_0x1e01d3[_0xb2cb('0x53')][_0xb2cb('0x69')]=_0x211e0d['id'];if(_0x76d04b['query']['filter']){_0x1e01d3[_0xb2cb('0x53')]=_[_0xb2cb('0x57')](_0x1e01d3['where'],{'$or':_[_0xb2cb('0x45')](_0x1e01d3[_0xb2cb('0x4e')],function(_0x3d29d1){var _0x1af8ab={};_0x1af8ab[_0x3d29d1]={'$like':'%'+_0x76d04b[_0xb2cb('0x4b')][_0xb2cb('0x56')]+'%'};return _0x1af8ab;})});}_0x1e01d3=_[_0xb2cb('0x57')]({},_0x1e01d3,_0x76d04b[_0xb2cb('0x59')]);return db[_0xb2cb('0x72')][_0xb2cb('0x21')]({'where':_0x1e01d3['where']})[_0xb2cb('0x11')](function(_0x4e52eb){_0x32c9aa[_0xb2cb('0x21')]=_0x4e52eb;if(_0x76d04b[_0xb2cb('0x4b')][_0xb2cb('0x5a')]){_0x1e01d3[_0xb2cb('0x5b')]=[{'all':!![]}];}return db[_0xb2cb('0x72')][_0xb2cb('0x5c')](_0x1e01d3);})[_0xb2cb('0x11')](function(_0x5ba927){_0x32c9aa[_0xb2cb('0x5d')]=_0x5ba927;return _0x32c9aa;});}})[_0xb2cb('0x11')](respondWithFilteredResult(_0x54ee51,_0x1e01d3))[_0xb2cb('0x5e')](handleError(_0x54ee51,null));};exports[_0xb2cb('0x74')]=function(_0x18a355,_0x4cf8da){return db[_0xb2cb('0x46')][_0xb2cb('0x60')]({'where':{'id':_0x18a355[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x4cf8da,null))[_0xb2cb('0x11')](function(_0x5400bb){if(_0x5400bb){return _0x5400bb[_0xb2cb('0x74')](_0x18a355[_0xb2cb('0x4b')]['ids']);}})[_0xb2cb('0x11')](respondWithStatusCode(_0x4cf8da,null))[_0xb2cb('0x5e')](handleError(_0x4cf8da,null));};exports[_0xb2cb('0x6b')]=function(_0x2796cb,_0x3826a8){var _0x4779ba={'name':_0x2796cb[_0xb2cb('0x61')][_0xb2cb('0x29')],'key':_0x2796cb['body']['key'],'provider':_0x2796cb['body'][_0xb2cb('0x62')]===_0xb2cb('0x63')?null:_0x2796cb['body'][_0xb2cb('0x62')],'email':_0x2796cb['body'][_0xb2cb('0x75')],'ListId':_0x2796cb[_0xb2cb('0x61')][_0xb2cb('0x76')],'active':!_[_0xb2cb('0x77')](_0x2796cb[_0xb2cb('0x61')][_0xb2cb('0x78')])?_0x2796cb['body'][_0xb2cb('0x78')]:!![],'description':_0x2796cb['body'][_0xb2cb('0x79')]||null};var _0x59673c=getAuthenticationOptions(_0x4779ba[_0xb2cb('0x62')],_0x2796cb[_0xb2cb('0x61')]);_0x4779ba[_0xb2cb('0x3e')]=_0x59673c[_0xb2cb('0x3e')];_0x4779ba[_0xb2cb('0x40')]=_0x59673c['Smtp'];return db[_0xb2cb('0x46')][_0xb2cb('0x6b')](_0x4779ba,{'include':[{'model':db[_0xb2cb('0x43')],'as':_0xb2cb('0x40')},{'model':db[_0xb2cb('0x42')],'as':_0xb2cb('0x3e')}]})[_0xb2cb('0x11')](function(_0x5ad971){var _0x2e94f3=_0x2796cb[_0xb2cb('0x36')][_0xb2cb('0x26')]({'plain':!![]});if(!_0x2e94f3)throw new Error(_0xb2cb('0x7a'));if(_0x2e94f3[_0xb2cb('0x7b')]==='user'){var _0x4873e3=_0x5ad971['get']({'plain':!![]});return db[_0xb2cb('0x7c')][_0xb2cb('0x60')]({'where':{'name':_0xb2cb('0x27'),'userProfileId':_0x2e94f3[_0xb2cb('0x7d')]},'raw':!![]})[_0xb2cb('0x11')](function(_0x37d4fc){if(_0x37d4fc&&_0x37d4fc[_0xb2cb('0x7e')]===0x0){return db[_0xb2cb('0x7f')][_0xb2cb('0x6b')]({'name':_0x4873e3['name'],'resourceId':_0x4873e3['id'],'type':_0x37d4fc[_0xb2cb('0x29')],'sectionId':_0x37d4fc['id']},{})[_0xb2cb('0x11')](function(){return _0x5ad971;});}else{return _0x5ad971;}})[_0xb2cb('0x5e')](function(_0x53395a){logger[_0xb2cb('0x18')](_0xb2cb('0x80'),_0x53395a);throw _0x53395a;});}return _0x5ad971;})[_0xb2cb('0x11')](respondWithResult(_0x3826a8,0xc9))[_0xb2cb('0x5e')](handleError(_0x3826a8,null));};exports[_0xb2cb('0x81')]=function(_0x1b22c5,_0x5f47b3){return db['MailAccount']['findOne']({'where':{'id':_0x1b22c5[_0xb2cb('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5f47b3,null))[_0xb2cb('0x11')](function(_0x962ecb){if(_0x962ecb){return _0x962ecb['getImap']();}return null;})['then'](respondWithResult(_0x5f47b3,null))[_0xb2cb('0x5e')](handleError(_0x5f47b3,null));};exports[_0xb2cb('0x82')]=function(_0x8e334c,_0x205442){if(_0x8e334c[_0xb2cb('0x61')]['id']){delete _0x8e334c['body']['id'];}return db[_0xb2cb('0x46')][_0xb2cb('0x60')]({'where':{'id':_0x8e334c['params']['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x205442,null))[_0xb2cb('0x11')](function(_0x53f10a){if(_0x53f10a){_0x8e334c[_0xb2cb('0x61')][_0xb2cb('0x69')]=_0x53f10a['id'];return db[_0xb2cb('0x42')][_0xb2cb('0x6b')](_0x8e334c[_0xb2cb('0x61')]);}})[_0xb2cb('0x11')](respondWithResult(_0x205442,null))['catch'](handleError(_0x205442,null));};exports[_0xb2cb('0x83')]=function(_0x4ae5e7,_0x17f0d3){return db['MailAccount'][_0xb2cb('0x6c')]({'where':{'id':_0x4ae5e7[_0xb2cb('0x5f')]['id']}})['then'](handleEntityNotFound(_0x17f0d3,null))[_0xb2cb('0x11')](function(_0x338e6f){if(_0x338e6f){return _0x338e6f[_0xb2cb('0x84')](null);}return null;})[_0xb2cb('0x11')](respondWithStatusCode(_0x17f0d3,null))[_0xb2cb('0x5e')](handleError(_0x17f0d3,null));};exports[_0xb2cb('0x85')]=function(_0x4cbfec,_0x1b1a32){return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x4cbfec[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x1b1a32,null))[_0xb2cb('0x11')](function(_0x4e91d6){if(_0x4e91d6){return _0x4e91d6[_0xb2cb('0x85')]();}return null;})[_0xb2cb('0x11')](respondWithResult(_0x1b1a32,null))[_0xb2cb('0x5e')](handleError(_0x1b1a32,null));};exports[_0xb2cb('0x86')]=function(_0x2d889a,_0x295846){if(_0x2d889a[_0xb2cb('0x61')]['id']){delete _0x2d889a[_0xb2cb('0x61')]['id'];}return db[_0xb2cb('0x46')][_0xb2cb('0x60')]({'where':{'id':_0x2d889a[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x295846,null))['then'](function(_0x505f00){if(_0x505f00){_0x2d889a['body'][_0xb2cb('0x69')]=_0x505f00['id'];return db[_0xb2cb('0x43')][_0xb2cb('0x6b')](_0x2d889a[_0xb2cb('0x61')]);}})['then'](respondWithResult(_0x295846,null))[_0xb2cb('0x5e')](handleError(_0x295846,null));};exports[_0xb2cb('0x87')]=function(_0x49521c,_0x32d7f9){return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x49521c[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x32d7f9,null))[_0xb2cb('0x11')](function(_0x4f08c9){if(_0x4f08c9){return _0x4f08c9['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x32d7f9,null))[_0xb2cb('0x5e')](handleError(_0x32d7f9,null));};exports[_0xb2cb('0x88')]=function(_0x45eaa2,_0x541d9b){return db['MailInteraction'][_0xb2cb('0x60')]({'where':{'id':_0x45eaa2[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x541d9b,null))[_0xb2cb('0x11')](function(_0x4fe10d){if(_0x4fe10d){return _0x4fe10d[_0xb2cb('0x88')](_0x45eaa2[_0xb2cb('0x61')][_0xb2cb('0x71')],_[_0xb2cb('0x89')](_0x45eaa2[_0xb2cb('0x61')],['ids','id'])||{});}})[_0xb2cb('0x11')](respondWithResult(_0x541d9b,null))[_0xb2cb('0x5e')](handleError(_0x541d9b,null));};exports[_0xb2cb('0x8a')]=function(_0x41e3c2,_0x7728a5){var _0x387316={'raw':![],'where':{}};var _0x27764a={};var _0x88e7cf={'count':0x0,'rows':[]};return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x41e3c2['params']['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x7728a5,null))[_0xb2cb('0x11')](function(_0x4f1bd1){if(_0x4f1bd1){_0x27764a['model']=_[_0xb2cb('0x4c')](db[_0xb2cb('0x8b')][_0xb2cb('0x47')]);_0x27764a[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x41e3c2[_0xb2cb('0x4b')]);_0x27764a[_0xb2cb('0x54')]=_[_0xb2cb('0x4f')](_0x27764a[_0xb2cb('0x4d')],_0x27764a[_0xb2cb('0x4b')]);_0x387316['attributes']=_[_0xb2cb('0x4f')](_0x27764a[_0xb2cb('0x4d')],qs[_0xb2cb('0x50')](_0x41e3c2[_0xb2cb('0x4b')][_0xb2cb('0x50')]));_0x387316['attributes']=_0x387316['attributes']['length']?_0x387316[_0xb2cb('0x4e')]:_0x27764a[_0xb2cb('0x4d')];if(!_0x41e3c2['query'][_0xb2cb('0x52')](_0xb2cb('0x6d'))){_0x387316['limit']=qs[_0xb2cb('0x20')](_0x41e3c2[_0xb2cb('0x4b')][_0xb2cb('0x20')]);_0x387316[_0xb2cb('0x22')]=qs[_0xb2cb('0x22')](_0x41e3c2['query']['offset']);}_0x387316[_0xb2cb('0x6e')]=qs[_0xb2cb('0x6f')](_0x41e3c2['query'][_0xb2cb('0x6f')]);_0x387316['where']=qs[_0xb2cb('0x54')](_[_0xb2cb('0x55')](_0x41e3c2[_0xb2cb('0x4b')],_0x27764a[_0xb2cb('0x54')]));_0x387316[_0xb2cb('0x53')][_0xb2cb('0x69')]=_0x4f1bd1['id'];if(_0x41e3c2[_0xb2cb('0x4b')]['filter']){_0x387316[_0xb2cb('0x53')]=_[_0xb2cb('0x57')](_0x387316[_0xb2cb('0x53')],{'$or':_[_0xb2cb('0x45')](_0x387316[_0xb2cb('0x4e')],function(_0x580ef3){var _0x3a1a7c={};_0x3a1a7c[_0x580ef3]={'$like':'%'+_0x41e3c2['query'][_0xb2cb('0x56')]+'%'};return _0x3a1a7c;})});}_0x387316=_[_0xb2cb('0x57')]({},_0x387316,_0x41e3c2[_0xb2cb('0x59')]);return db['MailInteraction']['count']({'where':_0x387316[_0xb2cb('0x53')]})[_0xb2cb('0x11')](function(_0x2a8818){_0x88e7cf[_0xb2cb('0x21')]=_0x2a8818;if(_0x41e3c2[_0xb2cb('0x4b')][_0xb2cb('0x5a')]){_0x387316['include']=[{'model':db[_0xb2cb('0x8c')],'as':'Contact','required':![]},{'model':db[_0xb2cb('0x8d')],'as':_0xb2cb('0x8e'),'attributes':[_0xb2cb('0x29'),_0xb2cb('0x8f'),_0xb2cb('0x90')],'required':![]},{'model':db[_0xb2cb('0x91')],'as':_0xb2cb('0x92'),'attributes':['id','name','color'],'where':_0x41e3c2['query']['tag']?{'id':_0x41e3c2['query'][_0xb2cb('0x93')]}:undefined,'required':_0x41e3c2[_0xb2cb('0x4b')]['tag']?!![]:![]}];}return db[_0xb2cb('0x8b')]['findAll'](_0x387316);})[_0xb2cb('0x11')](function(_0x485273){_0x88e7cf[_0xb2cb('0x5d')]=_0x485273;return _0x88e7cf;});}})[_0xb2cb('0x11')](respondWithFilteredResult(_0x7728a5,_0x387316))['catch'](handleError(_0x7728a5,null));};exports['addApplications']=function addApplications(_0x512f4f,_0x568ab1){var _0x2a335a=_0x512f4f[_0xb2cb('0x5f')]['id'];var _0x32805c=_0x512f4f['body'];var _0x3fe6ac=0xc8;var _0x300b4e=null;return db[_0xb2cb('0x94')]['transaction']({'isolationLevel':db['sequelize'][_0xb2cb('0x95')][_0xb2cb('0x96')][_0xb2cb('0x97')]},function(_0x5e4ed7){return db['MailAccount'][_0xb2cb('0x6c')]({'where':{'id':_0x2a335a},'transaction':_0x5e4ed7})[_0xb2cb('0x11')](function(_0x5089d2){if(_0x5089d2){return db[_0xb2cb('0x98')]['destroy']({'where':{'MailAccountId':_0x2a335a},'transaction':_0x5e4ed7})[_0xb2cb('0x11')](function(){var _0x1e2af6=_['map'](_0x32805c,function(_0x16bf8d){_0x16bf8d['MailAccountId']=_0x2a335a;return _0x16bf8d;});return db[_0xb2cb('0x98')][_0xb2cb('0x99')](_0x1e2af6,{'transaction':_0x5e4ed7});});}else{_0x3fe6ac=0x194;_0x300b4e=[];}});})['then'](function(){if(_0x3fe6ac!==0x194){return db[_0xb2cb('0x98')][_0xb2cb('0x9a')]({'where':{'MailAccountId':_0x2a335a},'order':_0xb2cb('0x9b')})[_0xb2cb('0x11')](function(_0x1e8718){_0x300b4e=_0x1e8718;});}})['catch'](function(_0x1f87ae){_0x3fe6ac=0x1f4;logger['error'](_0x1f87ae[_0xb2cb('0x28')]);if(_0x1f87ae[_0xb2cb('0x29')]){delete _0x1f87ae[_0xb2cb('0x29')];}_0x300b4e=_0x1f87ae;})[_0xb2cb('0x9c')](function(){if(_0x300b4e===null){_0x568ab1['sendStatus'](_0x3fe6ac);}else{if(_0x3fe6ac===0x1f4){_0x568ab1[_0xb2cb('0x1c')](_0x3fe6ac)[_0xb2cb('0x2a')](_0x300b4e);}else{_0x568ab1[_0xb2cb('0x1c')](_0x3fe6ac)[_0xb2cb('0x1e')](_0x300b4e);}}});};exports[_0xb2cb('0x9d')]=function(_0x5e0feb,_0x551787){var _0x366e23={};var _0x40e0e1={};var _0x87ab92;var _0x30088e;return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x5e0feb[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x551787,null))['then'](function(_0x26dae7){if(_0x26dae7){_0x87ab92=_0x26dae7;_0x40e0e1[_0xb2cb('0x4d')]=_[_0xb2cb('0x4c')](db[_0xb2cb('0x98')][_0xb2cb('0x47')]);_0x40e0e1[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x5e0feb[_0xb2cb('0x4b')]);_0x40e0e1[_0xb2cb('0x54')]=_[_0xb2cb('0x4f')](_0x40e0e1[_0xb2cb('0x4d')],_0x40e0e1[_0xb2cb('0x4b')]);_0x366e23['attributes']=_[_0xb2cb('0x4f')](_0x40e0e1[_0xb2cb('0x4d')],qs[_0xb2cb('0x50')](_0x5e0feb[_0xb2cb('0x4b')][_0xb2cb('0x50')]));_0x366e23['attributes']=_0x366e23['attributes'][_0xb2cb('0x51')]?_0x366e23[_0xb2cb('0x4e')]:_0x40e0e1['model'];_0x366e23[_0xb2cb('0x6e')]=qs['sort'](_0x5e0feb[_0xb2cb('0x4b')][_0xb2cb('0x6f')]);_0x366e23[_0xb2cb('0x53')]=qs[_0xb2cb('0x54')](_[_0xb2cb('0x55')](_0x5e0feb[_0xb2cb('0x4b')],_0x40e0e1[_0xb2cb('0x54')]));if(_0x5e0feb[_0xb2cb('0x4b')][_0xb2cb('0x56')]){_0x366e23[_0xb2cb('0x53')]=_['merge'](_0x366e23['where'],{'$or':_['map'](_0x366e23['attributes'],function(_0x4622b3){var _0x5952e9={};_0x5952e9[_0x4622b3]={'$like':'%'+_0x5e0feb[_0xb2cb('0x4b')][_0xb2cb('0x56')]+'%'};return _0x5952e9;})});}_0x366e23=_[_0xb2cb('0x57')]({},_0x366e23,_0x5e0feb[_0xb2cb('0x59')]);return _0x87ab92[_0xb2cb('0x9d')](_0x366e23);}})[_0xb2cb('0x11')](function(_0x323f15){if(_0x323f15){_0x30088e=_0x323f15['length'];if(!_0x5e0feb[_0xb2cb('0x4b')][_0xb2cb('0x52')](_0xb2cb('0x6d'))){_0x366e23[_0xb2cb('0x20')]=qs[_0xb2cb('0x20')](_0x5e0feb['query']['limit']);_0x366e23['offset']=qs[_0xb2cb('0x22')](_0x5e0feb[_0xb2cb('0x4b')][_0xb2cb('0x22')]);}return _0x87ab92[_0xb2cb('0x9d')](_0x366e23);}})[_0xb2cb('0x11')](function(_0x5c79fa){if(_0x5c79fa){return _0x5c79fa?{'count':_0x30088e,'rows':_0x5c79fa}:null;}})[_0xb2cb('0x11')](respondWithResult(_0x551787,null))[_0xb2cb('0x5e')](handleError(_0x551787,null));};exports[_0xb2cb('0x9e')]=function(_0x4e42da,_0x5ad621){var _0x440bc3={'raw':!![],'where':{}};var _0x21560b={};var _0x44f3d8={'count':0x0,'rows':[]};return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x4e42da[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x5ad621,null))[_0xb2cb('0x11')](function(_0x592067){if(_0x592067){_0x21560b['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x21560b[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x4e42da['query']);_0x21560b[_0xb2cb('0x54')]=_[_0xb2cb('0x4f')](_0x21560b[_0xb2cb('0x4d')],_0x21560b[_0xb2cb('0x4b')]);_0x440bc3['attributes']=_['intersection'](_0x21560b[_0xb2cb('0x4d')],qs['fields'](_0x4e42da['query'][_0xb2cb('0x50')]));_0x440bc3[_0xb2cb('0x4e')]=_0x440bc3[_0xb2cb('0x4e')][_0xb2cb('0x51')]?_0x440bc3['attributes']:_0x21560b[_0xb2cb('0x4d')];if(!_0x4e42da['query']['hasOwnProperty'](_0xb2cb('0x6d'))){_0x440bc3['limit']=qs[_0xb2cb('0x20')](_0x4e42da[_0xb2cb('0x4b')][_0xb2cb('0x20')]);_0x440bc3['offset']=qs['offset'](_0x4e42da[_0xb2cb('0x4b')]['offset']);}_0x440bc3['order']=qs[_0xb2cb('0x6f')](_0x4e42da[_0xb2cb('0x4b')]['sort']);_0x440bc3['where']=qs[_0xb2cb('0x54')](_[_0xb2cb('0x55')](_0x4e42da[_0xb2cb('0x4b')],_0x21560b[_0xb2cb('0x54')]));_0x440bc3[_0xb2cb('0x53')][_0xb2cb('0x69')]=_0x592067['id'];if(_0x4e42da['query'][_0xb2cb('0x56')]){_0x440bc3[_0xb2cb('0x53')]=_[_0xb2cb('0x57')](_0x440bc3[_0xb2cb('0x53')],{'$or':_[_0xb2cb('0x45')](_0x440bc3[_0xb2cb('0x4e')],function(_0x4ec0cb){var _0x3b0322={};_0x3b0322[_0x4ec0cb]={'$like':'%'+_0x4e42da[_0xb2cb('0x4b')][_0xb2cb('0x56')]+'%'};return _0x3b0322;})});}if(_0x4e42da['query'][_0xb2cb('0x9f')]){var _0x3bea2e=_0x4e42da['query'][_0xb2cb('0x9f')][_0xb2cb('0xa0')](',');var _0x2f5b76={};_0x2f5b76[_0x3bea2e[0x0]]={'$gte':moment(_0x3bea2e[0x1])['format'](_0xb2cb('0xa1'))};_0x440bc3[_0xb2cb('0x53')]=_['merge'](_0x440bc3[_0xb2cb('0x53')],_0x2f5b76);}_0x440bc3=_[_0xb2cb('0x57')]({},_0x440bc3,_0x4e42da[_0xb2cb('0x59')]);return db['MailMessage'][_0xb2cb('0x21')]({'where':_0x440bc3['where']})['then'](function(_0x590c5b){_0x44f3d8[_0xb2cb('0x21')]=_0x590c5b;if(_0x4e42da[_0xb2cb('0x4b')][_0xb2cb('0x5a')]){_0x440bc3[_0xb2cb('0x5b')]=[{'all':!![]}];}return db[_0xb2cb('0xa2')]['findAll'](_0x440bc3);})[_0xb2cb('0x11')](function(_0x5154b7){if(_0x4e42da['query']['inlineCss']===_0xb2cb('0xa3')){for(var _0xbff135=0x0;_0xbff135<_0x5154b7[_0xb2cb('0x51')];_0xbff135++){_0x5154b7[_0xbff135][_0xb2cb('0x61')]=juice(_0x5154b7[_0xbff135]['body']);}}_0x44f3d8[_0xb2cb('0x5d')]=_0x5154b7;return _0x44f3d8;});}})[_0xb2cb('0x11')](respondWithFilteredResult(_0x5ad621,_0x440bc3))[_0xb2cb('0x5e')](handleError(_0x5ad621,null));};exports[_0xb2cb('0x2a')]=function(_0x48507b,_0x3de27b){var _0x405f6b,_0x28aa66={},_0x29aabe;if(_0x48507b['body']['to']){_0x29aabe=_0x48507b['body']['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x48507b[_0xb2cb('0x5f')]['id']},'include':[{'model':db[_0xb2cb('0xa4')],'as':_0xb2cb('0xa5'),'include':[{'model':db[_0xb2cb('0x8c')],'as':'Contacts','where':{'email':_0x29aabe},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xb2cb('0x43')],'as':_0xb2cb('0x40'),'raw':!![],'include':[{'model':db[_0xb2cb('0xa6')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x3de27b,null))[_0xb2cb('0x11')](function(_0x280431){if(!_0x280431)return;_0x405f6b=_0x280431;if(!_0x280431[_0xb2cb('0x40')])throw new Error(_0xb2cb('0xa7'));if(_[_0xb2cb('0x77')](_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xa8')])){_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xa8')]=util[_0xb2cb('0xa9')]('%s\x20<%s>',_0x280431[_0xb2cb('0x29')],_0x280431[_0xb2cb('0x75')]||_0x280431['Smtp'][_0xb2cb('0x36')]);}if(_0x48507b['body']['attachments']&&_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xaa')][_0xb2cb('0x51')]){for(var _0x5ef02c=0x0;_0x5ef02c<_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xaa')][_0xb2cb('0x51')];_0x5ef02c+=0x1){_0x48507b['body'][_0xb2cb('0xaa')][_0x5ef02c]={'filename':_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xaa')][_0x5ef02c][_0xb2cb('0x29')],'path':path[_0xb2cb('0xab')](config[_0xb2cb('0xac')],_0xb2cb('0xad'),_0x48507b['body'][_0xb2cb('0xaa')][_0x5ef02c]['basename'])};}}var _0x174338=_0x280431[_0xb2cb('0xae')]();return respondWithRpcPromise(_0xb2cb('0xaf'),_0xb2cb('0xb0'),{'account':_0x174338,'message':_0x48507b[_0xb2cb('0x61')]});})[_0xb2cb('0x11')](function(_0x28002f){if(!_0x28002f)return;_0x28aa66=_0x28002f;if(!_0x405f6b[_0xb2cb('0xa5')])throw new Error(_0xb2cb('0xb1'));if(_0x405f6b[_0xb2cb('0xa5')]['Contacts'][_0xb2cb('0x51')])return _0x405f6b[_0xb2cb('0xa5')][_0xb2cb('0xb2')][0x0];return db[_0xb2cb('0x8c')][_0xb2cb('0x6b')](_[_0xb2cb('0x8')](_0x48507b[_0xb2cb('0x61')],{'firstName':_0x48507b[_0xb2cb('0x61')]['to'],'email':_0x48507b[_0xb2cb('0x61')]['to'],'phone':_0x48507b[_0xb2cb('0x61')]['to'],'ListId':_0x405f6b[_0xb2cb('0x76')]}));})['then'](function(_0x404ce6){if(!_0x404ce6)return;var _0x13d212={'UserId':_0x48507b[_0xb2cb('0x36')]['id'],'ContactId':_0x404ce6['id'],'MailAccountId':_0x405f6b['id'],'inReplyTo':_0x28aa66[_0xb2cb('0xb3')],'to':_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xa8')],'cc':_0x48507b['body']['cc'],'subject':_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xb4')],'attach':_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xb5')],'firstMsgDirection':_0xb2cb('0xb6'),'lastMsgAt':moment()['format'](_0xb2cb('0xa1')),'lastMsgDirection':_0xb2cb('0xb6'),'Messages':[_[_0xb2cb('0x57')](_0x48507b[_0xb2cb('0x61')],{'messageId':_0x28aa66[_0xb2cb('0xb3')],'sentAt':moment()[_0xb2cb('0xa9')](_0xb2cb('0xa1')),'read':!![],'MailAccountId':_0x405f6b['id'],'UserId':_0x48507b[_0xb2cb('0x36')]['id'],'ContactId':_0x404ce6['id']})]};if(_0x48507b['body']['Interaction']){_0x13d212=_[_0xb2cb('0x57')](_0x13d212,_0x48507b[_0xb2cb('0x61')][_0xb2cb('0xb7')]);}return db[_0xb2cb('0x8b')][_0xb2cb('0x6b')](_0x13d212,{'include':[{'model':db[_0xb2cb('0xa2')],'as':_0xb2cb('0xb8')}]});})[_0xb2cb('0x11')](respondWithResult(_0x3de27b,null))[_0xb2cb('0x5e')](handleError(_0x3de27b,null));};exports[_0xb2cb('0xb9')]=function(_0x2e39eb,_0x178894){return db[_0xb2cb('0x46')]['find']({'where':{'id':_0x2e39eb[_0xb2cb('0x5f')]['id']},'include':[{'model':db[_0xb2cb('0x43')],'as':_0xb2cb('0x40'),'raw':!![],'include':[{'model':db[_0xb2cb('0xa6')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x178894,null))['then'](function(_0x218f2d){if(!_0x218f2d[_0xb2cb('0x40')])return;var _0x556eb1=_0x218f2d['getSmtpOptions']();return respondWithRpcPromise(_0xb2cb('0xba'),_0xb2cb('0xb9'),{'account':_0x556eb1});})[_0xb2cb('0x11')](respondWithResult(_0x178894,null))['catch'](handleError(_0x178894,null));};exports['destroy']=function(_0x15f80b,_0x28cb18){return db['MailAccount'][_0xb2cb('0x60')]({'where':{'id':_0x15f80b[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x28cb18,null))[_0xb2cb('0x11')](function(_0x2c506b){if(_0x2c506b&&_0x2c506b[_0xb2cb('0x3c')]){throw new db[(_0xb2cb('0xbb'))][(_0xb2cb('0xbc'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2c506b;})[_0xb2cb('0x11')](removeEntity(_0x28cb18,null))[_0xb2cb('0x5e')](handleError(_0x28cb18,null));};exports[_0xb2cb('0xbd')]=function(_0x652dee,_0x21e09b){return db[_0xb2cb('0x46')]['find']({'where':{'id':_0x652dee['params']['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x21e09b,null))['then'](function(_0xa627b5){if(_0xa627b5){return _0xa627b5[_0xb2cb('0xbd')](_0x652dee[_0xb2cb('0x61')][_0xb2cb('0x71')],_[_0xb2cb('0x89')](_0x652dee[_0xb2cb('0x61')],[_0xb2cb('0x71'),'id'])||{})['spread'](function(_0x14c816){for(var _0x342bae=0x0;_0x342bae<_0x652dee[_0xb2cb('0x61')][_0xb2cb('0x71')][_0xb2cb('0x51')];_0x342bae+=0x1){socket['emit'](_0xb2cb('0xbe'),{'UserId':Number(_0x652dee[_0xb2cb('0x61')][_0xb2cb('0x71')][_0x342bae]),'MailAccountId':Number(_0x652dee[_0xb2cb('0x5f')]['id'])});}return _0x14c816;});}})[_0xb2cb('0x11')](respondWithResult(_0x21e09b,null))['catch'](handleError(_0x21e09b,null));};exports[_0xb2cb('0xbf')]=function(_0x5a7123,_0x3eace3){return db['MailAccount'][_0xb2cb('0x60')]({'where':{'id':_0x5a7123[_0xb2cb('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3eace3,null))[_0xb2cb('0x11')](function(_0xdb6f00){if(_0xdb6f00){return _0xdb6f00['removeAgents'](_0x5a7123[_0xb2cb('0x4b')]['ids'])[_0xb2cb('0x11')](function(){if(_[_0xb2cb('0xc0')](_0x5a7123[_0xb2cb('0x4b')]['ids'])){for(var _0xb003a8=0x0;_0xb003a8<_0x5a7123[_0xb2cb('0x4b')]['ids'][_0xb2cb('0x51')];_0xb003a8+=0x1){socket[_0xb2cb('0xc1')](_0xb2cb('0xc2'),{'UserId':Number(_0x5a7123[_0xb2cb('0x4b')][_0xb2cb('0x71')][_0xb003a8]),'MailAccountId':Number(_0x5a7123[_0xb2cb('0x5f')]['id'])});}}else{socket[_0xb2cb('0xc1')](_0xb2cb('0xc2'),{'UserId':Number(_0x5a7123[_0xb2cb('0x4b')]['ids']),'MailAccountId':Number(_0x5a7123[_0xb2cb('0x5f')]['id'])});}});}})[_0xb2cb('0x11')](respondWithStatusCode(_0x3eace3,null))[_0xb2cb('0x5e')](handleError(_0x3eace3,null));};exports[_0xb2cb('0xc3')]=function(_0x17def2,_0x26a7a5){var _0x4cc3ed={};var _0x415433={};var _0xc5655a;var _0x3e5073;return db[_0xb2cb('0x46')][_0xb2cb('0x6c')]({'where':{'id':_0x17def2[_0xb2cb('0x5f')]['id']}})[_0xb2cb('0x11')](handleEntityNotFound(_0x26a7a5,null))[_0xb2cb('0x11')](function(_0x2b10db){if(_0x2b10db){_0xc5655a=_0x2b10db;_0x415433[_0xb2cb('0x4d')]=_[_0xb2cb('0x4c')](db[_0xb2cb('0x8d')]['rawAttributes']);_0x415433[_0xb2cb('0x4b')]=_[_0xb2cb('0x4c')](_0x17def2['query']);_0x415433['filters']=_[_0xb2cb('0x4f')](_0x415433[_0xb2cb('0x4d')],_0x415433[_0xb2cb('0x4b')]);_0x4cc3ed[_0xb2cb('0x4e')]=_[_0xb2cb('0x4f')](_0x415433[_0xb2cb('0x4d')],qs[_0xb2cb('0x50')](_0x17def2[_0xb2cb('0x4b')][_0xb2cb('0x50')]));_0x4cc3ed[_0xb2cb('0x4e')]=_0x4cc3ed[_0xb2cb('0x4e')][_0xb2cb('0x51')]?_0x4cc3ed[_0xb2cb('0x4e')]:_0x415433[_0xb2cb('0x4d')];_0x4cc3ed['order']=qs[_0xb2cb('0x6f')](_0x17def2[_0xb2cb('0x4b')]['sort']);_0x4cc3ed['where']=qs[_0xb2cb('0x54')](_[_0xb2cb('0x55')](_0x17def2['query'],_0x415433[_0xb2cb('0x54')]));if(_0x17def2[_0xb2cb('0x4b')]['filter']){_0x4cc3ed['where']=_[_0xb2cb('0x57')](_0x4cc3ed[_0xb2cb('0x53')],{'$or':_[_0xb2cb('0x45')](_0x4cc3ed[_0xb2cb('0x4e')],function(_0x5e67e5){var _0x20442f={};_0x20442f[_0x5e67e5]={'$like':'%'+_0x17def2['query'][_0xb2cb('0x56')]+'%'};return _0x20442f;})});}_0x4cc3ed=_[_0xb2cb('0x57')]({},_0x4cc3ed,_0x17def2[_0xb2cb('0x59')]);return _0xc5655a[_0xb2cb('0xc3')](_0x4cc3ed);}})[_0xb2cb('0x11')](function(_0x45ae1b){if(_0x45ae1b){_0x3e5073=_0x45ae1b['length'];if(!_0x17def2['query'][_0xb2cb('0x52')](_0xb2cb('0x6d'))){_0x4cc3ed[_0xb2cb('0x20')]=qs[_0xb2cb('0x20')](_0x17def2[_0xb2cb('0x4b')][_0xb2cb('0x20')]);_0x4cc3ed[_0xb2cb('0x22')]=qs['offset'](_0x17def2[_0xb2cb('0x4b')][_0xb2cb('0x22')]);}return _0xc5655a[_0xb2cb('0xc3')](_0x4cc3ed);}})['then'](function(_0x4fe86e){if(_0x4fe86e){return _0x4fe86e?{'count':_0x3e5073,'rows':_0x4fe86e}:null;}})[_0xb2cb('0x11')](respondWithResult(_0x26a7a5,null))[_0xb2cb('0x5e')](handleError(_0x26a7a5,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 811dd29..3a9ebb6 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 _0xb3f9=['emit','hook','exports','events','../../mysqldb','save','remove'];(function(_0x3c19ff,_0x5b3737){var _0x216240=function(_0x2bc367){while(--_0x2bc367){_0x3c19ff['push'](_0x3c19ff['shift']());}};_0x216240(++_0x5b3737);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x91939,_0x2cced5){_0x91939=_0x91939-0x0;var _0x3ccca6=_0xb3f9[_0x91939];return _0x3ccca6;};'use strict';var EventEmitter=require(_0x9b3f('0x0'));var MailAccount=require(_0x9b3f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b3f('0x2'),'afterUpdate':'update','afterDestroy':_0x9b3f('0x3')};function emitEvent(_0x361db7){return function(_0x35fd0b,_0xa9df41,_0x227cca){MailAccountEvents[_0x9b3f('0x4')](_0x361db7+':'+_0x35fd0b['id'],_0x35fd0b);MailAccountEvents['emit'](_0x361db7,_0x35fd0b);_0x227cca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x9b3f('0x5')](e,emitEvent(event));}}module[_0x9b3f('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x57ca=['hasOwnProperty','hook','exports','../../mysqldb','MailAccount','save','update','remove','emit'];(function(_0x206e2a,_0x4f1370){var _0x542326=function(_0x552789){while(--_0x552789){_0x206e2a['push'](_0x206e2a['shift']());}};_0x542326(++_0x4f1370);}(_0x57ca,0x108));var _0xa57c=function(_0x285027,_0x58d608){_0x285027=_0x285027-0x0;var _0x41a0a6=_0x57ca[_0x285027];return _0x41a0a6;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xa57c('0x0'))['db'][_0xa57c('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa57c('0x2'),'afterUpdate':_0xa57c('0x3'),'afterDestroy':_0xa57c('0x4')};function emitEvent(_0x15e330){return function(_0x1da469,_0x48be2d,_0x40ba22){MailAccountEvents[_0xa57c('0x5')](_0x15e330+':'+_0x1da469['id'],_0x1da469);MailAccountEvents[_0xa57c('0x5')](_0x15e330,_0x1da469);_0x40ba22(null);};}for(var e in events){if(events[_0xa57c('0x6')](e)){var event=events[e];MailAccount[_0xa57c('0x7')](e,emitEvent(event));}}module[_0xa57c('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 9ffa1c3..84328ea 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 _0x69ab=['provider','custom','service','Smtp','host','port','secure','modernAuthentication','auth','OAuth2','user','CloudProvider','data5','./mailAccount.attributes','exports','define'];(function(_0x20645f,_0x5688f0){var _0xf0485b=function(_0x4220af){while(--_0x4220af){_0x20645f['push'](_0x20645f['shift']());}};_0xf0485b(++_0x5688f0);}(_0x69ab,0x14d));var _0xb69a=function(_0x159d86,_0xdae0c7){_0x159d86=_0x159d86-0x0;var _0x38cb1d=_0x69ab[_0x159d86];return _0x38cb1d;};'use strict';var attributes=require(_0xb69a('0x0'));module[_0xb69a('0x1')]=function(_0x2b7009){return _0x2b7009[_0xb69a('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x57766b=this;var _0x46f41a={'id':_0x57766b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x57766b[_0xb69a('0x3')]!==_0xb69a('0x4')){_0x46f41a[_0xb69a('0x5')]=_0x57766b[_0xb69a('0x3')];}else{_0x46f41a['host']=_0x57766b[_0xb69a('0x6')][_0xb69a('0x7')];_0x46f41a[_0xb69a('0x8')]=_0x57766b[_0xb69a('0x6')][_0xb69a('0x8')];_0x46f41a[_0xb69a('0x9')]=_0x57766b['Smtp'][_0xb69a('0x9')];}if(_0x57766b['Smtp']['authentication']){if(_0x57766b[_0xb69a('0x6')][_0xb69a('0xa')]){if(!_0x57766b['Smtp']['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x46f41a[_0xb69a('0xb')]={'type':_0xb69a('0xc'),'user':_0x57766b[_0xb69a('0x6')][_0xb69a('0xd')],'accessToken':_0x57766b[_0xb69a('0x6')][_0xb69a('0xe')][_0xb69a('0xf')]};}else{_0x46f41a['auth']={'user':_0x57766b[_0xb69a('0x6')][_0xb69a('0xd')],'pass':_0x57766b['Smtp']['pass']};}}return _0x46f41a;}}});}; \ No newline at end of file +var _0xd98f=['custom','service','host','Smtp','port','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider'];(function(_0x250b26,_0x132e93){var _0xd731de=function(_0x20e93e){while(--_0x20e93e){_0x250b26['push'](_0x250b26['shift']());}};_0xd731de(++_0x132e93);}(_0xd98f,0x13d));var _0xfd98=function(_0x4a07ac,_0x35c7cb){_0x4a07ac=_0x4a07ac-0x0;var _0x29a4ad=_0xd98f[_0x4a07ac];return _0x29a4ad;};'use strict';var attributes=require(_0xfd98('0x0'));module[_0xfd98('0x1')]=function(_0x2c9689){return _0x2c9689[_0xfd98('0x2')](_0xfd98('0x3'),attributes,{'tableName':_0xfd98('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x40793f=this;var _0x45d528={'id':_0x40793f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x40793f[_0xfd98('0x5')]!==_0xfd98('0x6')){_0x45d528[_0xfd98('0x7')]=_0x40793f[_0xfd98('0x5')];}else{_0x45d528[_0xfd98('0x8')]=_0x40793f[_0xfd98('0x9')]['host'];_0x45d528[_0xfd98('0xa')]=_0x40793f[_0xfd98('0x9')][_0xfd98('0xa')];_0x45d528['secure']=_0x40793f[_0xfd98('0x9')][_0xfd98('0xb')];}if(_0x40793f[_0xfd98('0x9')]['authentication']){if(_0x40793f[_0xfd98('0x9')]['modernAuthentication']){if(!_0x40793f[_0xfd98('0x9')][_0xfd98('0xc')])throw new Error(_0xfd98('0xd'));_0x45d528[_0xfd98('0xe')]={'type':_0xfd98('0xf'),'user':_0x40793f[_0xfd98('0x9')][_0xfd98('0x10')],'accessToken':_0x40793f['Smtp'][_0xfd98('0xc')][_0xfd98('0x11')]};}else{_0x45d528[_0xfd98('0xe')]={'user':_0x40793f[_0xfd98('0x9')][_0xfd98('0x10')],'pass':_0x40793f[_0xfd98('0x9')][_0xfd98('0x12')]};}}return _0x45d528;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 57f4957..f130c66 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 _0xda2d=['CloudProvider','List','get','Applications','getSmtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','find','where','setDataValue','smtpOptions','mail','difference','keys','CmContact','rawAttributes','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','MailApplication','MailServerOut'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xda2d,0x102));var _0xdda2=function(_0x5758fe,_0x3820d9){_0x5758fe=_0x5758fe-0x0;var _0x362670=_0xda2d[_0x5758fe];return _0x362670;};'use strict';var _=require('lodash');var moment=require(_0xdda2('0x0'));var BPromise=require(_0xdda2('0x1'));var rs=require(_0xdda2('0x2'));var Redis=require(_0xdda2('0x3'));var db=require(_0xdda2('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdda2('0x5'));var client=jayson[_0xdda2('0x6')][_0xdda2('0x7')]({'port':0x232c});config[_0xdda2('0x8')]=_[_0xdda2('0x9')](config[_0xdda2('0x8')],{'host':_0xdda2('0xa'),'port':0x18eb});var socket=require(_0xdda2('0xb'))(new Redis(config[_0xdda2('0x8')]));require(_0xdda2('0xc'))['register'](socket);function respondWithRpcPromise(_0x1a774e,_0x22c6e5,_0x4df6b8){return new BPromise(function(_0x1c11b2,_0x2f3454){return client[_0xdda2('0xd')](_0x1a774e,_0x4df6b8)[_0xdda2('0xe')](function(_0x171123){logger[_0xdda2('0xf')](_0xdda2('0x10'),_0x22c6e5,_0xdda2('0x11'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x22c6e5,'request\x20sent',JSON[_0xdda2('0x12')](_0x171123));if(_0x171123[_0xdda2('0x13')]){if(_0x171123[_0xdda2('0x13')][_0xdda2('0x14')]===0x1f4){logger[_0xdda2('0x13')](_0xdda2('0x10'),_0x22c6e5,_0x171123[_0xdda2('0x13')]['message']);return _0x2f3454(_0x171123[_0xdda2('0x13')]['message']);}logger[_0xdda2('0x13')](_0xdda2('0x10'),_0x22c6e5,_0x171123[_0xdda2('0x13')][_0xdda2('0x15')]);return _0x1c11b2(_0x171123[_0xdda2('0x13')]['message']);}else{logger['info'](_0xdda2('0x10'),_0x22c6e5,'request\x20sent');_0x1c11b2(_0x171123[_0xdda2('0x16')][_0xdda2('0x15')]);}})[_0xdda2('0x17')](function(_0x2b6ee8){logger[_0xdda2('0x13')](_0xdda2('0x10'),_0x22c6e5,_0x2b6ee8);_0x2f3454(_0x2b6ee8);});});}exports[_0xdda2('0x18')]=function(_0x351151){var _0x3c02a4=this;return new Promise(function(_0x337b0b,_0x312ef1){return db[_0xdda2('0x19')]['findAll']({'raw':_0x351151[_0xdda2('0x1a')]?_0x351151['options'][_0xdda2('0x1b')]===undefined?!![]:![]:!![],'where':_0x351151[_0xdda2('0x1a')]?_0x351151[_0xdda2('0x1a')]['where']||null:null,'attributes':_0x351151[_0xdda2('0x1a')]?_0x351151['options'][_0xdda2('0x1c')]||null:null,'limit':_0x351151[_0xdda2('0x1a')]?_0x351151['options'][_0xdda2('0x1d')]||null:null,'include':_0x351151[_0xdda2('0x1a')]?_0x351151[_0xdda2('0x1a')][_0xdda2('0x1e')]?_[_0xdda2('0x1f')](_0x351151['options'][_0xdda2('0x1e')],function(_0x4be5ea){return{'model':db[_0x4be5ea[_0xdda2('0x20')]],'as':_0x4be5ea['as'],'attributes':_0x4be5ea[_0xdda2('0x1c')],'include':_0x4be5ea['include']?_['map'](_0x4be5ea[_0xdda2('0x1e')],function(_0x4567e7){return{'model':db[_0x4567e7[_0xdda2('0x20')]],'as':_0x4567e7['as'],'attributes':_0x4567e7['attributes'],'include':_0x4567e7[_0xdda2('0x1e')]?_[_0xdda2('0x1f')](_0x4567e7[_0xdda2('0x1e')],function(_0xe53dee){return{'model':db[_0xe53dee[_0xdda2('0x20')]],'as':_0xe53dee['as'],'attributes':_0xe53dee[_0xdda2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24c37d){logger[_0xdda2('0xf')]('GetMailAccount',_0x351151);logger[_0xdda2('0x21')](_0xdda2('0x18'),_0x351151,JSON[_0xdda2('0x12')](_0x24c37d));_0x337b0b(_0x24c37d);})[_0xdda2('0x17')](function(_0x5540e5){logger[_0xdda2('0x13')](_0xdda2('0x18'),_0x5540e5['message'],_0x351151);_0x312ef1(_0x3c02a4[_0xdda2('0x13')](0x1f4,_0x5540e5['message']));});});};exports[_0xdda2('0x22')]=function(_0x55809a){var _0x53ff76=this;return new Promise(function(_0x510b7b,_0x239c25){return db['MailAccount'][_0xdda2('0x23')]({'raw':_0x55809a['options']?_0x55809a['options']['raw']===undefined?!![]:![]:!![],'where':_0x55809a[_0xdda2('0x1a')]?_0x55809a[_0xdda2('0x1a')][_0xdda2('0x24')]||null:null,'attributes':_0x55809a[_0xdda2('0x1a')]?_0x55809a[_0xdda2('0x1a')][_0xdda2('0x1c')]||null:null,'include':_0x55809a[_0xdda2('0x1a')]?_0x55809a[_0xdda2('0x1a')][_0xdda2('0x1e')]?_[_0xdda2('0x1f')](_0x55809a['options'][_0xdda2('0x1e')],function(_0x4212da){return{'model':db[_0x4212da[_0xdda2('0x20')]],'as':_0x4212da['as'],'attributes':_0x4212da[_0xdda2('0x1c')],'include':_0x4212da[_0xdda2('0x1e')]?_[_0xdda2('0x1f')](_0x4212da[_0xdda2('0x1e')],function(_0x5835cd){return{'model':db[_0x5835cd['model']],'as':_0x5835cd['as'],'attributes':_0x5835cd[_0xdda2('0x1c')],'include':_0x5835cd[_0xdda2('0x1e')]?_[_0xdda2('0x1f')](_0x5835cd['include'],function(_0x54e211){return{'model':db[_0x54e211[_0xdda2('0x20')]],'as':_0x54e211['as'],'attributes':_0x54e211[_0xdda2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdda2('0xe')](function(_0x11f1f6){if(_0x55809a[_0xdda2('0x1a')]['smtp']===!![])_0x11f1f6[_0xdda2('0x25')](_0xdda2('0x26'),_0x11f1f6['getSmtpOptions']());logger['info'](_0xdda2('0x22'),_0x55809a);logger[_0xdda2('0x21')](_0xdda2('0x22'),_0x55809a,JSON[_0xdda2('0x12')](_0x11f1f6));_0x510b7b(_0x11f1f6);})[_0xdda2('0x17')](function(_0x585eba){logger[_0xdda2('0x13')](_0xdda2('0x22'),_0x585eba[_0xdda2('0x15')],_0x55809a);_0x239c25(_0x53ff76[_0xdda2('0x13')](0x1f4,_0x585eba['message']));});});};exports['NotifyMailAccount']=function(_0x203972){var _0x2e0524=this;return new Promise(function(_0x7a25fe,_0x5a92e9){var _0x1bb2a7={'body':_0x203972['body'],'channel':_0xdda2('0x27')};var _0x4c68d7=_[_0xdda2('0x28')](_[_0xdda2('0x29')](db[_0xdda2('0x2a')][_0xdda2('0x2b')]),['createdAt',_0xdda2('0x2c'),'CompanyId',_0xdda2('0x2d')]);var _0x4d3b78=![];if(_0x203972[_0xdda2('0x2e')]['id']){delete _0x203972[_0xdda2('0x2e')]['id'];}if(_[_0xdda2('0x2f')](_0x203972[_0xdda2('0x2e')][_0xdda2('0x30')])){return _0x5a92e9(_0x2e0524['error'](0x1f4,_0xdda2('0x31')));}if(_[_0xdda2('0x2f')](_0x203972['body'][_0xdda2('0x2e')])||_0x203972['body'][_0xdda2('0x2e')]===''){return _0x5a92e9(_0x2e0524[_0xdda2('0x13')](0x1f4,_0xdda2('0x32')));}if(_[_0xdda2('0x2f')](_0x203972[_0xdda2('0x2e')][_0xdda2('0x33')])){return _0x5a92e9(_0x2e0524[_0xdda2('0x13')](0x1f4,_0xdda2('0x34')+_0x4c68d7));}if(!_[_0xdda2('0x35')](_0x4c68d7,_0x203972[_0xdda2('0x2e')][_0xdda2('0x33')])){return _0x5a92e9(_0x2e0524[_0xdda2('0x13')](0x1f4,_0xdda2('0x36')+_0x4c68d7));}var _0x4d22b3={};_0x4d22b3[_0x203972['body']['mapKey']]=_0x203972[_0xdda2('0x2e')][_0xdda2('0x30')];return db['MailAccount'][_0xdda2('0x23')]({'where':{'id':_0x203972[_0xdda2('0x37')]['id']},'include':[{'model':db[_0xdda2('0x38')],'as':'List','include':[{'model':db[_0xdda2('0x2a')],'as':_0xdda2('0x39'),'where':_0x4d22b3,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xdda2('0x3a')],'as':'Applications'},{'model':db[_0xdda2('0x3b')],'as':'Smtp','include':[{'model':db[_0xdda2('0x3c')],'as':_0xdda2('0x3c')}]}]})['then'](function(_0x585665){if(_0x585665&&_0x585665[_0xdda2('0x3d')]){var _0x413f8a=_0x585665[_0xdda2('0x3e')]({'plain':!![]});_0x1bb2a7[_0xdda2('0x37')]=_['omit'](_0x413f8a,[_0xdda2('0x3f'),_0xdda2('0x3d')]);_0x1bb2a7[_0xdda2('0x37')][_0xdda2('0x26')]=_0x585665[_0xdda2('0x40')]();_0x1bb2a7['applications']=_0x413f8a[_0xdda2('0x3f')];_0x1bb2a7[_0xdda2('0x41')]=_0x413f8a['List'];_0x1bb2a7[_0xdda2('0x42')]=_[_0xdda2('0x43')](_0x1bb2a7[_0xdda2('0x42')],[_0xdda2('0x44')],[_0xdda2('0x45')]);if(_0x1bb2a7[_0xdda2('0x37')]&&_0x1bb2a7['account'][_0xdda2('0x46')]){_0x1bb2a7['applications'][_0xdda2('0x47')]({'id':0x0,'priority':_0x1bb2a7['applications'][_0xdda2('0x48')]+0x1,'app':'close','appdata':_0xdda2('0x46'),'interval':_0xdda2('0x49')});}if(_0x1bb2a7[_0xdda2('0x37')][_0xdda2('0x3f')]){delete _0x1bb2a7[_0xdda2('0x37')][_0xdda2('0x3f')];}if(_0x1bb2a7[_0xdda2('0x37')][_0xdda2('0x3d')]){delete _0x1bb2a7['account'][_0xdda2('0x3d')];}if(_0x413f8a[_0xdda2('0x3d')][_0xdda2('0x39')]['length']){return _0x413f8a[_0xdda2('0x3d')][_0xdda2('0x39')][0x0];}var _0x56ddf2=_[_0xdda2('0x9')](_0x203972['body'],{'firstName':_0x203972[_0xdda2('0x2e')][_0xdda2('0x30')],'ListId':_0x413f8a[_0xdda2('0x2d')]});_0x56ddf2[_0x203972[_0xdda2('0x2e')][_0xdda2('0x33')]]=_0x203972['body']['from'];return db['CmContact'][_0xdda2('0x4a')](_0x56ddf2);}else{throw new Error(_0xdda2('0x4b'));}})['then'](function(_0x44637d){_0x1bb2a7[_0xdda2('0x4c')]=_0x44637d;if(_0x44637d){if(!_0x203972[_0xdda2('0x2e')]['message'][_0xdda2('0x4d')]){_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')]['messageId']=rs[_0xdda2('0x4e')]()+'\x20'+_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x30')];}var _0x5d8602={'ContactId':_0x44637d['id'],'MailAccountId':_0x203972[_0xdda2('0x37')]['id'],'inReplyTo':_0x203972['body']['message']['messageId'],'to':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x30')],'cc':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')]['cc'],'subject':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x4f')],'attach':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x50')],'lastMsgAt':moment()['format'](_0xdda2('0x51')),'lastMsgDirection':'in'};return db[_0xdda2('0x52')][_0xdda2('0x23')]({'where':{'closed':![],'MailAccountId':_0x203972[_0xdda2('0x37')]['id']},'include':[{'model':db[_0xdda2('0x53')],'as':_0xdda2('0x54'),'attributes':[_0xdda2('0x4d')],'where':{'messageId':_0x203972['body'][_0xdda2('0x15')][_0xdda2('0x55')]}}]})[_0xdda2('0xe')](function(_0xe8d81a){if(_0xe8d81a){return[_0xe8d81a,![]];}return db[_0xdda2('0x52')]['create'](_0x5d8602)[_0xdda2('0xe')](function(_0x145d45){return[_0x145d45,!![]];});});}else{throw new Error(_0xdda2('0x56'));}})[_0xdda2('0x57')](function(_0x21d0e4,_0x4a6f28){if(_0x21d0e4){_0x4d3b78=_0x4a6f28;if(!_0x4a6f28){return _0x21d0e4[_0xdda2('0x58')]({'inReplyTo':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x4d')],'to':_0x203972[_0xdda2('0x2e')]['message'][_0xdda2('0x30')],'cc':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')]['cc'],'subject':_0x203972['body'][_0xdda2('0x15')]['subject'],'attach':_0x21d0e4[_0xdda2('0x50')]?_0x21d0e4[_0xdda2('0x50')]:_0x203972[_0xdda2('0x2e')]['message'][_0xdda2('0x50')],'substatus':null,'substatusAt':moment()[_0xdda2('0x59')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xdda2('0x59')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x21d0e4;}}})[_0xdda2('0xe')](function(_0xc97cb1){_0x1bb2a7[_0xdda2('0x5a')]=_0xc97cb1[_0xdda2('0x3e')]({'plain':!![]});_0x1bb2a7[_0xdda2('0x5a')]['created']=_0x4d3b78;return db['MailMessage'][_0xdda2('0x4a')]({'body':_0x203972[_0xdda2('0x2e')]['body'],'MailAccountId':_0x203972['account']['id'],'MailInteractionId':_0xc97cb1['id'],'direction':'in','ContactId':_0x1bb2a7[_0xdda2('0x4c')]['id'],'messageId':_0x203972['body'][_0xdda2('0x15')][_0xdda2('0x4d')],'from':_0x203972['body'][_0xdda2('0x15')][_0xdda2('0x30')],'to':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')]['to'],'cc':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')]['cc'],'subject':_0x203972['body'][_0xdda2('0x15')][_0xdda2('0x4f')],'attach':_0x203972[_0xdda2('0x2e')]['message'][_0xdda2('0x50')],'Attachments':_0x203972[_0xdda2('0x2e')]['message']['attachments'],'originTo':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x5b')],'originCc':_0x203972['body']['message'][_0xdda2('0x5c')],'bcc':_0x203972['body'][_0xdda2('0x15')][_0xdda2('0x5d')],'ChatWebsiteId':_0x203972[_0xdda2('0x2e')][_0xdda2('0x15')][_0xdda2('0x5e')]||null,'originChannel':_0x203972[_0xdda2('0x2e')]['message']['originChannel']||_0xdda2('0x5f'),'ChatOfflineMessageId':_0x203972['body'][_0xdda2('0x15')][_0xdda2('0x60')]||null},{'include':[{'model':db[_0xdda2('0x61')],'as':_0xdda2('0x62')}]});})[_0xdda2('0xe')](function(_0x104024){_0x1bb2a7[_0xdda2('0x15')]=_0x104024;if(_0x1bb2a7[_0xdda2('0x5a')][_0xdda2('0x63')]){return db['User'][_0xdda2('0x23')]({'attributes':['id',_0xdda2('0x64')],'where':{'id':_0x1bb2a7[_0xdda2('0x5a')][_0xdda2('0x63')]}})['then'](function(_0x3b535d){if(_0x3b535d){_0x1bb2a7[_0xdda2('0x42')][_0xdda2('0x65')]({'id':0x0,'priority':0x0,'app':_0xdda2('0x66'),'appdata':_0x3b535d['name']+','+(_0x1bb2a7['account'][_0xdda2('0x67')]||0xa),'interval':_0xdda2('0x49')});}return respondWithRpcPromise(_0xdda2('0x68'),_0xdda2('0x69'),_0x1bb2a7);});}return respondWithRpcPromise('Start',_0xdda2('0x69'),_0x1bb2a7);})[_0xdda2('0xe')](function(_0x17656d){_0x7a25fe(_0x17656d);})[_0xdda2('0x17')](function(_0x2dda16){_0x5a92e9(_0x2e0524[_0xdda2('0x13')](0x1f4,_0x2dda16[_0xdda2('0x15')]));});});}; \ No newline at end of file +var _0x2ef3=['result','catch','MailAccount','findAll','options','attributes','limit','model','include','map','GetMailAccount','find','raw','smtp','setDataValue','smtpOptions','ShowMailAccount','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','account','omit','getSmtpOptions','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','messageId','generate','attach','MailInteraction','update','subject','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','ChatWebsiteId','Email','ChatOfflineMessageId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x15953e,_0x537be1){var _0x2117fc=function(_0x1718f1){while(--_0x1718f1){_0x15953e['push'](_0x15953e['shift']());}};_0x2117fc(++_0x537be1);}(_0x2ef3,0xba));var _0x32ef=function(_0x27b29e,_0x2b4d31){_0x27b29e=_0x27b29e-0x0;var _0x1c45ab=_0x2ef3[_0x27b29e];return _0x1c45ab;};'use strict';var _=require(_0x32ef('0x0'));var moment=require(_0x32ef('0x1'));var BPromise=require(_0x32ef('0x2'));var rs=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var db=require(_0x32ef('0x5'))['db'];var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x8')][_0x32ef('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0x32ef('0xa')],{'host':_0x32ef('0xb'),'port':0x18eb});var socket=require(_0x32ef('0xc'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xd'))[_0x32ef('0xe')](socket);function respondWithRpcPromise(_0x2484a0,_0x2bbb50,_0x28275c){return new BPromise(function(_0x77df79,_0x56eb42){return client['request'](_0x2484a0,_0x28275c)[_0x32ef('0xf')](function(_0x33281d){logger[_0x32ef('0x10')](_0x32ef('0x11'),_0x2bbb50,'request\x20sent');logger[_0x32ef('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2bbb50,_0x32ef('0x13'),JSON['stringify'](_0x33281d));if(_0x33281d[_0x32ef('0x14')]){if(_0x33281d[_0x32ef('0x14')]['code']===0x1f4){logger['error'](_0x32ef('0x11'),_0x2bbb50,_0x33281d['error'][_0x32ef('0x15')]);return _0x56eb42(_0x33281d[_0x32ef('0x14')][_0x32ef('0x15')]);}logger[_0x32ef('0x14')]('MailAccount,\x20%s,\x20%s',_0x2bbb50,_0x33281d['error']['message']);return _0x77df79(_0x33281d[_0x32ef('0x14')][_0x32ef('0x15')]);}else{logger[_0x32ef('0x10')]('MailAccount,\x20%s,\x20%s',_0x2bbb50,'request\x20sent');_0x77df79(_0x33281d[_0x32ef('0x16')][_0x32ef('0x15')]);}})[_0x32ef('0x17')](function(_0x57863c){logger[_0x32ef('0x14')](_0x32ef('0x11'),_0x2bbb50,_0x57863c);_0x56eb42(_0x57863c);});});}exports['GetMailAccount']=function(_0x304505){var _0x314ef1=this;return new Promise(function(_0x26aff3,_0x251084){return db[_0x32ef('0x18')][_0x32ef('0x19')]({'raw':_0x304505['options']?_0x304505[_0x32ef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')]['where']||null:null,'attributes':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')][_0x32ef('0x1b')]||null:null,'limit':_0x304505['options']?_0x304505['options'][_0x32ef('0x1c')]||null:null,'include':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')]['include']?_['map'](_0x304505[_0x32ef('0x1a')]['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1d')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1b')],'include':_0x51a412[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x51a412[_0x32ef('0x1e')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1d')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1b')],'include':_0x234175[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x234175[_0x32ef('0x1e')],function(_0xba4b3f){return{'model':db[_0xba4b3f['model']],'as':_0xba4b3f['as'],'attributes':_0xba4b3f[_0x32ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xf')](function(_0x5a04cd){logger[_0x32ef('0x10')](_0x32ef('0x20'),_0x304505);logger[_0x32ef('0x12')](_0x32ef('0x20'),_0x304505,JSON['stringify'](_0x5a04cd));_0x26aff3(_0x5a04cd);})[_0x32ef('0x17')](function(_0x22bf86){logger[_0x32ef('0x14')](_0x32ef('0x20'),_0x22bf86[_0x32ef('0x15')],_0x304505);_0x251084(_0x314ef1[_0x32ef('0x14')](0x1f4,_0x22bf86[_0x32ef('0x15')]));});});};exports['ShowMailAccount']=function(_0x36ac37){var _0x537214=this;return new Promise(function(_0x38bf73,_0x2b6c6a){return db['MailAccount'][_0x32ef('0x21')]({'raw':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x22')]===undefined?!![]:![]:!![],'where':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37['options']['where']||null:null,'attributes':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37['options'][_0x32ef('0x1b')]||null:null,'include':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x36ac37[_0x32ef('0x1a')]['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1b')],'include':_0x482d3a[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1d')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1b')],'include':_0x4fb402[_0x32ef('0x1e')]?_['map'](_0x4fb402['include'],function(_0xcbdec8){return{'model':db[_0xcbdec8[_0x32ef('0x1d')]],'as':_0xcbdec8['as'],'attributes':_0xcbdec8[_0x32ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xf')](function(_0x3a7c49){if(_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x23')]===!![])_0x3a7c49[_0x32ef('0x24')](_0x32ef('0x25'),_0x3a7c49['getSmtpOptions']());logger[_0x32ef('0x10')](_0x32ef('0x26'),_0x36ac37);logger[_0x32ef('0x12')]('ShowMailAccount',_0x36ac37,JSON[_0x32ef('0x27')](_0x3a7c49));_0x38bf73(_0x3a7c49);})[_0x32ef('0x17')](function(_0x879e33){logger[_0x32ef('0x14')](_0x32ef('0x26'),_0x879e33[_0x32ef('0x15')],_0x36ac37);_0x2b6c6a(_0x537214[_0x32ef('0x14')](0x1f4,_0x879e33[_0x32ef('0x15')]));});});};exports[_0x32ef('0x28')]=function(_0x57a3c0){var _0xb4db74=this;return new Promise(function(_0x4615b4,_0x48e071){var _0x3cac2e={'body':_0x57a3c0[_0x32ef('0x29')],'channel':_0x32ef('0x2a')};var _0x1733e3=_[_0x32ef('0x2b')](_[_0x32ef('0x2c')](db[_0x32ef('0x2d')]['rawAttributes']),['createdAt',_0x32ef('0x2e'),_0x32ef('0x2f'),_0x32ef('0x30')]);var _0x765c63=![];if(_0x57a3c0['body']['id']){delete _0x57a3c0[_0x32ef('0x29')]['id'];}if(_[_0x32ef('0x31')](_0x57a3c0['body'][_0x32ef('0x32')])){return _0x48e071(_0xb4db74['error'](0x1f4,_0x32ef('0x33')));}if(_[_0x32ef('0x31')](_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x29')])||_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x29')]===''){return _0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,_0x32ef('0x34')));}if(_[_0x32ef('0x31')](_0x57a3c0[_0x32ef('0x29')]['mapKey'])){return _0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1733e3));}if(!_[_0x32ef('0x35')](_0x1733e3,_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x36')])){return _0x48e071(_0xb4db74['error'](0x1f4,_0x32ef('0x37')+_0x1733e3));}var _0x230ac9={};_0x230ac9[_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x36')]]=_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')];return db[_0x32ef('0x18')]['find']({'where':{'id':_0x57a3c0['account']['id']},'include':[{'model':db[_0x32ef('0x38')],'as':_0x32ef('0x39'),'include':[{'model':db[_0x32ef('0x2d')],'as':_0x32ef('0x3a'),'where':_0x230ac9,'limit':0x1,'order':[[_0x32ef('0x2e'),_0x32ef('0x3b')]]}]},{'model':db[_0x32ef('0x3c')],'as':_0x32ef('0x3d')},{'model':db[_0x32ef('0x3e')],'as':_0x32ef('0x3f'),'include':[{'model':db[_0x32ef('0x40')],'as':_0x32ef('0x40')}]}]})[_0x32ef('0xf')](function(_0x4c2534){if(_0x4c2534&&_0x4c2534[_0x32ef('0x39')]){var _0x12fbd7=_0x4c2534[_0x32ef('0x41')]({'plain':!![]});_0x3cac2e[_0x32ef('0x42')]=_[_0x32ef('0x43')](_0x12fbd7,[_0x32ef('0x3d'),_0x32ef('0x39')]);_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x25')]=_0x4c2534[_0x32ef('0x44')]();_0x3cac2e[_0x32ef('0x45')]=_0x12fbd7[_0x32ef('0x3d')];_0x3cac2e[_0x32ef('0x46')]=_0x12fbd7[_0x32ef('0x39')];_0x3cac2e[_0x32ef('0x45')]=_[_0x32ef('0x47')](_0x3cac2e[_0x32ef('0x45')],[_0x32ef('0x48')],['asc']);if(_0x3cac2e['account']&&_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x49')]){_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x4a')]({'id':0x0,'priority':_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x4b')]+0x1,'app':_0x32ef('0x4c'),'appdata':_0x32ef('0x49'),'interval':_0x32ef('0x4d')});}if(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x3d')]){delete _0x3cac2e['account'][_0x32ef('0x3d')];}if(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x39')]){delete _0x3cac2e[_0x32ef('0x42')][_0x32ef('0x39')];}if(_0x12fbd7[_0x32ef('0x39')]['Contacts'][_0x32ef('0x4b')]){return _0x12fbd7[_0x32ef('0x39')][_0x32ef('0x3a')][0x0];}var _0x56b7ce=_[_0x32ef('0x4e')](_0x57a3c0['body'],{'firstName':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')],'ListId':_0x12fbd7['ListId']});_0x56b7ce[_0x57a3c0[_0x32ef('0x29')]['mapKey']]=_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')];return db[_0x32ef('0x2d')][_0x32ef('0x4f')](_0x56b7ce);}else{throw new Error(_0x32ef('0x50'));}})[_0x32ef('0xf')](function(_0x42c7f4){_0x3cac2e['contact']=_0x42c7f4;if(_0x42c7f4){if(!_0x57a3c0['body'][_0x32ef('0x15')]['messageId']){_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x51')]=rs[_0x32ef('0x52')]()+'\x20'+_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x32')];}var _0x316547={'ContactId':_0x42c7f4['id'],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id'],'inReplyTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['messageId'],'to':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x32')],'cc':_0x57a3c0['body'][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['subject'],'attach':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x53')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x32ef('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x32ef('0x51')],'where':{'messageId':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['inReplyTo']}}]})[_0x32ef('0xf')](function(_0x222b24){if(_0x222b24){return[_0x222b24,![]];}return db[_0x32ef('0x54')]['create'](_0x316547)[_0x32ef('0xf')](function(_0x12b7f8){return[_0x12b7f8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x2e20dc,_0x3a6697){if(_0x2e20dc){_0x765c63=_0x3a6697;if(!_0x3a6697){return _0x2e20dc[_0x32ef('0x55')]({'inReplyTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x51')],'to':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x32')],'cc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x56')],'attach':_0x2e20dc[_0x32ef('0x53')]?_0x2e20dc[_0x32ef('0x53')]:_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x53')],'substatus':null,'substatusAt':moment()[_0x32ef('0x57')](_0x32ef('0x58')),'lastMsgAt':moment()[_0x32ef('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x2e20dc;}}})['then'](function(_0x2125de){_0x3cac2e[_0x32ef('0x59')]=_0x2125de[_0x32ef('0x41')]({'plain':!![]});_0x3cac2e[_0x32ef('0x59')][_0x32ef('0x5a')]=_0x765c63;return db['MailMessage'][_0x32ef('0x4f')]({'body':_0x57a3c0['body'][_0x32ef('0x29')],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id'],'MailInteractionId':_0x2125de['id'],'direction':'in','ContactId':_0x3cac2e['contact']['id'],'messageId':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x51')],'from':_0x57a3c0[_0x32ef('0x29')]['message']['from'],'to':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['to'],'cc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x56')],'attach':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x53')],'Attachments':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x5b')],'originTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x5c')],'originCc':_0x57a3c0[_0x32ef('0x29')]['message']['originCc'],'bcc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['bcc'],'ChatWebsiteId':_0x57a3c0[_0x32ef('0x29')]['message'][_0x32ef('0x5d')]||null,'originChannel':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['originChannel']||_0x32ef('0x5e'),'ChatOfflineMessageId':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x32ef('0xf')](function(_0x5970db){_0x3cac2e[_0x32ef('0x15')]=_0x5970db;if(_0x3cac2e['interaction'][_0x32ef('0x60')]){return db[_0x32ef('0x61')][_0x32ef('0x21')]({'attributes':['id','name'],'where':{'id':_0x3cac2e['interaction']['UserId']}})[_0x32ef('0xf')](function(_0x5e5766){if(_0x5e5766){_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x62')]({'id':0x0,'priority':0x0,'app':_0x32ef('0x63'),'appdata':_0x5e5766[_0x32ef('0x64')]+','+(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x32ef('0x66'),'startRouting',_0x3cac2e);});}return respondWithRpcPromise('Start',_0x32ef('0x67'),_0x3cac2e);})['then'](function(_0x145e27){_0x4615b4(_0x145e27);})[_0x32ef('0x17')](function(_0x4d64ec){_0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,_0x4d64ec[_0x32ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 00bb2ee..f5dd9cf 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 _0x7f0e=['length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x5575cd,_0x73ab7a){var _0x4979a0=function(_0x1ac744){while(--_0x1ac744){_0x5575cd['push'](_0x5575cd['shift']());}};_0x4979a0(++_0x73ab7a);}(_0x7f0e,0xd1));var _0xe7f0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7f0e[_0x1facfa];return _0x9ec701;};'use strict';var MailAccountEvents=require(_0xe7f0('0x0'));var events=[_0xe7f0('0x1'),_0xe7f0('0x2'),_0xe7f0('0x3')];function createListener(_0x619fca,_0x428439){return function(_0x12d6b8){_0x428439[_0xe7f0('0x4')](_0x619fca,_0x12d6b8);};}function removeListener(_0x132e7e,_0x527be5){return function(){MailAccountEvents[_0xe7f0('0x5')](_0x132e7e,_0x527be5);};}exports[_0xe7f0('0x6')]=function(_0x10d7dc){for(var _0x472d60=0x0,_0x49b173=events[_0xe7f0('0x7')];_0x472d60<_0x49b173;_0x472d60++){var _0x44aa5e=events[_0x472d60];var _0x39a6f6=createListener(_0xe7f0('0x8')+_0x44aa5e,_0x10d7dc);MailAccountEvents['on'](_0x44aa5e,_0x39a6f6);}}; \ No newline at end of file +var _0x268c=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','emit'];(function(_0x54f0ec,_0x2fef4d){var _0x2111ac=function(_0xd2b88b){while(--_0xd2b88b){_0x54f0ec['push'](_0x54f0ec['shift']());}};_0x2111ac(++_0x2fef4d);}(_0x268c,0xb3));var _0xc268=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0x268c[_0x55d911];return _0x3104c2;};'use strict';var MailAccountEvents=require(_0xc268('0x0'));var events=['save',_0xc268('0x1'),'update'];function createListener(_0x12d634,_0x498234){return function(_0x4f78a7){_0x498234[_0xc268('0x2')](_0x12d634,_0x4f78a7);};}function removeListener(_0x55edc9,_0x19f84f){return function(){MailAccountEvents[_0xc268('0x3')](_0x55edc9,_0x19f84f);};}exports[_0xc268('0x4')]=function(_0x3d0ecf){for(var _0x4e2a03=0x0,_0x4b843c=events[_0xc268('0x5')];_0x4e2a03<_0x4b843c;_0x4e2a03++){var _0x2f7f1b=events[_0x4e2a03];var _0x596f88=createListener(_0xc268('0x6')+_0x2f7f1b,_0x3d0ecf);MailAccountEvents['on'](_0x2f7f1b,_0x596f88);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f6c3da7..cd9b595 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 _0xe496=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0xe496,0x1ed));var _0x6e49=function(_0x4c8ad2,_0x4ddaab){_0x4c8ad2=_0x4c8ad2-0x0;var _0x17dde1=_0xe496[_0x4c8ad2];return _0x17dde1;};'use strict';var multer=require(_0x6e49('0x0'));var util=require(_0x6e49('0x1'));var path=require('path');var timeout=require(_0x6e49('0x2'));var express=require('express');var router=express[_0x6e49('0x3')]();var fs_extra=require(_0x6e49('0x4'));var auth=require(_0x6e49('0x5'));var interaction=require(_0x6e49('0x6'));var config=require(_0x6e49('0x7'));var controller=require(_0x6e49('0x8'));router[_0x6e49('0x9')](_0x6e49('0xa'),auth[_0x6e49('0xb')](),controller[_0x6e49('0xc')]);router[_0x6e49('0xd')](_0x6e49('0xa'),auth[_0x6e49('0xb')](),controller[_0x6e49('0xe')]);router[_0x6e49('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6e49('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4ff2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ff2,0x66));var _0x24ff=function(_0xfd1fcd,_0x3182b7){_0xfd1fcd=_0xfd1fcd-0x0;var _0x1e0646=_0x4ff2[_0xfd1fcd];return _0x1e0646;};'use strict';var multer=require(_0x24ff('0x0'));var util=require(_0x24ff('0x1'));var path=require(_0x24ff('0x2'));var timeout=require(_0x24ff('0x3'));var express=require(_0x24ff('0x4'));var router=express[_0x24ff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x24ff('0x6'));var interaction=require(_0x24ff('0x7'));var config=require('../../config/environment');var controller=require(_0x24ff('0x8'));router[_0x24ff('0x9')](_0x24ff('0xa'),auth[_0x24ff('0xb')](),controller[_0x24ff('0xc')]);router[_0x24ff('0xd')](_0x24ff('0xa'),auth[_0x24ff('0xb')](),controller[_0x24ff('0xe')]);router['delete']('/:id',auth[_0x24ff('0xb')](),controller[_0x24ff('0xf')]);module[_0x24ff('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 2373f64..fddf986 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 _0x5c8f=['INTEGER','STRING','sequelize'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x5c8f,0xc8));var _0xf5c8=function(_0x25ac2d,_0x193953){_0x25ac2d=_0x25ac2d-0x0;var _0x410fe7=_0x5c8f[_0x25ac2d];return _0x410fe7;};'use strict';var Sequelize=require(_0xf5c8('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf5c8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf5c8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf5c8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd8b9=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x171fb7,_0x10ea75){var _0x25fda5=function(_0x212e03){while(--_0x212e03){_0x171fb7['push'](_0x171fb7['shift']());}};_0x25fda5(++_0x10ea75);}(_0xd8b9,0x15e));var _0x9d8b=function(_0x3d2e03,_0x33f13c){_0x3d2e03=_0x3d2e03-0x0;var _0x1a20bf=_0xd8b9[_0x3d2e03];return _0x1a20bf;};'use strict';var Sequelize=require(_0x9d8b('0x0'));module[_0x9d8b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9d8b('0x2')],'allowNull':![],'defaultValue':_0x9d8b('0x3')},'appdata':{'type':Sequelize[_0x9d8b('0x4')]()},'description':{'type':Sequelize[_0x9d8b('0x2')]},'interval':{'type':Sequelize[_0x9d8b('0x2')],'defaultValue':_0x9d8b('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 23103c1..e5ace97 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 _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3c6682,_0x55ecdf){var _0xe30c20=function(_0x3f6904){while(--_0x3f6904){_0x3c6682['push'](_0x3c6682['shift']());}};_0xe30c20(++_0x55ecdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3882e8,_0x578a08){var _0x18a490=function(_0x1aa40a){while(--_0x1aa40a){_0x3882e8['push'](_0x3882e8['shift']());}};_0x18a490(++_0x578a08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a886c97..475c594 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 _0xf6a9=['bluebird','request-promise','path','./mailApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0xf6a9,0x19f));var _0x9f6a=function(_0x532584,_0x29bf97){_0x532584=_0x532584-0x0;var _0x39f2f5=_0xf6a9[_0x532584];return _0x39f2f5;};'use strict';var _=require(_0x9f6a('0x0'));var util=require(_0x9f6a('0x1'));var logger=require(_0x9f6a('0x2'))(_0x9f6a('0x3'));var moment=require(_0x9f6a('0x4'));var BPromise=require(_0x9f6a('0x5'));var rp=require(_0x9f6a('0x6'));var fs=require('fs');var path=require(_0x9f6a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9f6a('0x8'));module[_0x9f6a('0x9')]=function(_0x1a35ca,_0x5125f0){return _0x1a35ca[_0x9f6a('0xa')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9f6a('0xb')});}; \ No newline at end of file +var _0x4493=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0xb399f1,_0x4f1c17){var _0x4765ef=function(_0x2dc8dc){while(--_0x2dc8dc){_0xb399f1['push'](_0xb399f1['shift']());}};_0x4765ef(++_0x4f1c17);}(_0x4493,0x8c));var _0x3449=function(_0x52951f,_0x53cce8){_0x52951f=_0x52951f-0x0;var _0x36f951=_0x4493[_0x52951f];return _0x36f951;};'use strict';var _=require(_0x3449('0x0'));var util=require(_0x3449('0x1'));var logger=require(_0x3449('0x2'))(_0x3449('0x3'));var moment=require(_0x3449('0x4'));var BPromise=require('bluebird');var rp=require(_0x3449('0x5'));var fs=require('fs');var path=require(_0x3449('0x6'));var rimraf=require(_0x3449('0x7'));var config=require(_0x3449('0x8'));var attributes=require(_0x3449('0x9'));module['exports']=function(_0x125f59,_0xaddb30){return _0x125f59[_0x3449('0xa')]('MailApplication',attributes,{'tableName':_0x3449('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3449('0xc'),'collate':_0x3449('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c4fc18c..454b32a 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 _0x5d99=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','then','debug','lodash','moment','bluebird'];(function(_0x5734e1,_0x3e1d75){var _0x22c784=function(_0x4fe1eb){while(--_0x4fe1eb){_0x5734e1['push'](_0x5734e1['shift']());}};_0x22c784(++_0x3e1d75);}(_0x5d99,0x84));var _0x95d9=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x5d99[_0x289891];return _0x31cf2e;};'use strict';var _=require(_0x95d9('0x0'));var util=require('util');var moment=require(_0x95d9('0x1'));var BPromise=require(_0x95d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95d9('0x3'))['db'];var utils=require(_0x95d9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x95d9('0x5'));var jayson=require(_0x95d9('0x6'));var client=jayson[_0x95d9('0x7')][_0x95d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x392fe0,_0x28150b,_0x3e4f88){return new BPromise(function(_0x3679c,_0x389d06){return client['request'](_0x392fe0,_0x3e4f88)['then'](function(_0x42a09d){logger[_0x95d9('0x9')](_0x95d9('0xa'),_0x28150b,_0x95d9('0xb'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x28150b,'request\x20sent',JSON[_0x95d9('0xc')](_0x42a09d));if(_0x42a09d['error']){if(_0x42a09d[_0x95d9('0xd')][_0x95d9('0xe')]===0x1f4){logger[_0x95d9('0xd')](_0x95d9('0xa'),_0x28150b,_0x42a09d[_0x95d9('0xd')][_0x95d9('0xf')]);return _0x389d06(_0x42a09d[_0x95d9('0xd')][_0x95d9('0xf')]);}logger['error'](_0x95d9('0xa'),_0x28150b,_0x42a09d[_0x95d9('0xd')][_0x95d9('0xf')]);return _0x3679c(_0x42a09d[_0x95d9('0xd')][_0x95d9('0xf')]);}else{logger[_0x95d9('0x9')](_0x95d9('0xa'),_0x28150b,_0x95d9('0xb'));_0x3679c(_0x42a09d[_0x95d9('0x10')]['message']);}})[_0x95d9('0x11')](function(_0x137734){logger[_0x95d9('0xd')](_0x95d9('0xa'),_0x28150b,_0x137734);_0x389d06(_0x137734);});});}exports[_0x95d9('0x12')]=function(_0x4be7aa){var _0x1149c3=this;return new Promise(function(_0xdbc52b,_0x3d300d){return db[_0x95d9('0x13')][_0x95d9('0x14')](_0x4be7aa[_0x95d9('0x15')],{'raw':_0x4be7aa[_0x95d9('0x16')]?_0x4be7aa[_0x95d9('0x16')][_0x95d9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4be7aa[_0x95d9('0x16')]?_0x4be7aa['options'][_0x95d9('0x18')]||null:null,'attributes':_0x4be7aa[_0x95d9('0x16')]?_0x4be7aa[_0x95d9('0x16')]['attributes']||null:null,'limit':_0x4be7aa[_0x95d9('0x16')]?_0x4be7aa[_0x95d9('0x16')]['limit']||null:null})[_0x95d9('0x19')](function(_0x37f61b){logger[_0x95d9('0x9')](_0x95d9('0x12'),_0x4be7aa);logger[_0x95d9('0x1a')](_0x95d9('0x12'),_0x4be7aa,JSON[_0x95d9('0xc')](_0x37f61b));_0xdbc52b(_0x37f61b);})[_0x95d9('0x11')](function(_0x4dfd8b){logger[_0x95d9('0xd')](_0x95d9('0x12'),_0x4dfd8b[_0x95d9('0xf')],_0x4be7aa);_0x3d300d(_0x1149c3[_0x95d9('0xd')](0x1f4,_0x4dfd8b[_0x95d9('0xf')]));});});}; \ No newline at end of file +var _0x2df2=['error','code','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0x2df2,0xe6));var _0x22df=function(_0x15decc,_0xab69b){_0x15decc=_0x15decc-0x0;var _0x536f23=_0x2df2[_0x15decc];return _0x536f23;};'use strict';var _=require(_0x22df('0x0'));var util=require(_0x22df('0x1'));var moment=require(_0x22df('0x2'));var BPromise=require('bluebird');var rs=require(_0x22df('0x3'));var fs=require('fs');var Redis=require(_0x22df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x22df('0x5'));var logger=require(_0x22df('0x6'))(_0x22df('0x7'));var config=require(_0x22df('0x8'));var jayson=require(_0x22df('0x9'));var client=jayson[_0x22df('0xa')][_0x22df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec491,_0xa8609d,_0x31a998){return new BPromise(function(_0x714530,_0x55db63){return client[_0x22df('0xc')](_0x3ec491,_0x31a998)[_0x22df('0xd')](function(_0x38074b){logger[_0x22df('0xe')](_0x22df('0xf'),_0xa8609d,_0x22df('0x10'));logger[_0x22df('0x11')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xa8609d,_0x22df('0x10'),JSON['stringify'](_0x38074b));if(_0x38074b[_0x22df('0x12')]){if(_0x38074b[_0x22df('0x12')][_0x22df('0x13')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0xa8609d,_0x38074b[_0x22df('0x12')][_0x22df('0x14')]);return _0x55db63(_0x38074b[_0x22df('0x12')][_0x22df('0x14')]);}logger[_0x22df('0x12')](_0x22df('0xf'),_0xa8609d,_0x38074b[_0x22df('0x12')][_0x22df('0x14')]);return _0x714530(_0x38074b[_0x22df('0x12')][_0x22df('0x14')]);}else{logger[_0x22df('0xe')](_0x22df('0xf'),_0xa8609d,_0x22df('0x10'));_0x714530(_0x38074b[_0x22df('0x15')]['message']);}})[_0x22df('0x16')](function(_0x48fac9){logger[_0x22df('0x12')]('MailApplication,\x20%s,\x20%s',_0xa8609d,_0x48fac9);_0x55db63(_0x48fac9);});});}exports[_0x22df('0x17')]=function(_0x42109e){var _0x10cf54=this;return new Promise(function(_0x1d8954,_0x581b50){return db['MailApplication'][_0x22df('0x18')](_0x42109e['body'],{'raw':_0x42109e[_0x22df('0x19')]?_0x42109e[_0x22df('0x19')][_0x22df('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42109e[_0x22df('0x19')]?_0x42109e[_0x22df('0x19')][_0x22df('0x1b')]||null:null,'attributes':_0x42109e[_0x22df('0x19')]?_0x42109e[_0x22df('0x19')][_0x22df('0x1c')]||null:null,'limit':_0x42109e[_0x22df('0x19')]?_0x42109e[_0x22df('0x19')][_0x22df('0x1d')]||null:null})[_0x22df('0xd')](function(_0x589cac){logger[_0x22df('0xe')]('UpdateMailApplication',_0x42109e);logger['debug'](_0x22df('0x17'),_0x42109e,JSON[_0x22df('0x1e')](_0x589cac));_0x1d8954(_0x589cac);})[_0x22df('0x16')](function(_0x54621a){logger['error']('UpdateMailApplication',_0x54621a[_0x22df('0x14')],_0x42109e);_0x581b50(_0x10cf54[_0x22df('0x12')](0x1f4,_0x54621a[_0x22df('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 3d7354a..804ddd3 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 _0xcb3f=['tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','addMessage','/:id/tags'];(function(_0x3daa35,_0x3db5be){var _0x1ee49e=function(_0x38137c){while(--_0x38137c){_0x3daa35['push'](_0x3daa35['shift']());}};_0x1ee49e(++_0x3db5be);}(_0xcb3f,0xc0));var _0xfcb3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcb3f[_0x4b055c];return _0x4b62bb;};'use strict';var express=require(_0xfcb3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfcb3('0x1'));var controller=require(_0xfcb3('0x2'));router[_0xfcb3('0x3')]('/',auth[_0xfcb3('0x4')](),controller['index']);router['get'](_0xfcb3('0x5'),auth[_0xfcb3('0x4')](),controller[_0xfcb3('0x6')]);router[_0xfcb3('0x3')](_0xfcb3('0x7'),auth[_0xfcb3('0x4')](),controller[_0xfcb3('0x8')]);router[_0xfcb3('0x3')]('/:id/messages',auth[_0xfcb3('0x4')](),controller[_0xfcb3('0x9')]);router[_0xfcb3('0x3')](_0xfcb3('0xa'),auth['isAuthenticated'](),controller[_0xfcb3('0xb')]);router['post']('/',auth[_0xfcb3('0x4')](),controller[_0xfcb3('0xc')]);router[_0xfcb3('0xd')]('/:id/messages',auth[_0xfcb3('0x4')](),controller[_0xfcb3('0xe')]);router['post'](_0xfcb3('0xf'),auth[_0xfcb3('0x4')](),interaction[_0xfcb3('0x10')](_0xfcb3('0x11'),_0xfcb3('0x12')),controller[_0xfcb3('0x13')]);router[_0xfcb3('0x14')](_0xfcb3('0x7'),auth['isAuthenticated'](),interaction[_0xfcb3('0x10')](_0xfcb3('0x11'),_0xfcb3('0x15')),controller['update']);router[_0xfcb3('0x16')](_0xfcb3('0x7'),auth[_0xfcb3('0x4')](),interaction[_0xfcb3('0x10')](_0xfcb3('0x11'),_0xfcb3('0x17')),controller[_0xfcb3('0x18')]);router['delete'](_0xfcb3('0xf'),auth['isAuthenticated'](),controller[_0xfcb3('0x19')]);module['exports']=router; \ No newline at end of file +var _0xd94c=['show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','destroy','removeTags','express','Router','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id'];(function(_0x40f6a3,_0x52c0b7){var _0x4f3511=function(_0x166649){while(--_0x166649){_0x40f6a3['push'](_0x40f6a3['shift']());}};_0x4f3511(++_0x52c0b7);}(_0xd94c,0xe2));var _0xcd94=function(_0x4c3f05,_0x3ac33a){_0x4c3f05=_0x4c3f05-0x0;var _0x57b7b4=_0xd94c[_0x4c3f05];return _0x57b7b4;};'use strict';var express=require(_0xcd94('0x0'));var router=express[_0xcd94('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xcd94('0x2'));var controller=require('./mailInteraction.controller');router[_0xcd94('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd94('0x3')](_0xcd94('0x4'),auth[_0xcd94('0x5')](),controller[_0xcd94('0x6')]);router[_0xcd94('0x3')](_0xcd94('0x7'),auth[_0xcd94('0x5')](),controller[_0xcd94('0x8')]);router[_0xcd94('0x3')](_0xcd94('0x9'),auth[_0xcd94('0x5')](),controller[_0xcd94('0xa')]);router[_0xcd94('0x3')]('/:id/download',auth[_0xcd94('0x5')](),controller[_0xcd94('0xb')]);router[_0xcd94('0xc')]('/',auth[_0xcd94('0x5')](),controller[_0xcd94('0xd')]);router[_0xcd94('0xc')](_0xcd94('0x9'),auth[_0xcd94('0x5')](),controller[_0xcd94('0xe')]);router[_0xcd94('0xc')](_0xcd94('0xf'),auth[_0xcd94('0x5')](),interaction['tracked'](_0xcd94('0x10'),_0xcd94('0x11')),controller[_0xcd94('0x12')]);router[_0xcd94('0x13')](_0xcd94('0x7'),auth[_0xcd94('0x5')](),interaction[_0xcd94('0x14')](_0xcd94('0x10'),_0xcd94('0x15')),controller[_0xcd94('0x16')]);router[_0xcd94('0x17')](_0xcd94('0x7'),auth[_0xcd94('0x5')](),interaction[_0xcd94('0x14')]('mail','mailinteraction:destroy'),controller[_0xcd94('0x18')]);router[_0xcd94('0x17')](_0xcd94('0xf'),auth[_0xcd94('0x5')](),controller[_0xcd94('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index cc116fb..ca6395c 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 _0xaf40=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xaf40,0x75));var _0x0af4=function(_0x199d23,_0x149eac){_0x199d23=_0x199d23-0x0;var _0xee368e=_0xaf40[_0x199d23];return _0xee368e;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x0af4('0x0'));module[_0x0af4('0x1')]={'closed':{'type':Sequelize[_0x0af4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0af4('0x3')]},'disposition':{'type':Sequelize[_0x0af4('0x4')]},'secondDisposition':{'type':Sequelize[_0x0af4('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0af4('0x4')]},'note':{'type':Sequelize[_0x0af4('0x4')]},'inReplyTo':{'type':Sequelize[_0x0af4('0x4')](0x1fe)},'to':{'type':Sequelize[_0x0af4('0x4')]},'cc':{'type':Sequelize[_0x0af4('0x5')](_0x0af4('0x6'))},'subject':{'type':Sequelize[_0x0af4('0x5')]()},'attach':{'type':Sequelize[_0x0af4('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0af4('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x0af4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0af4('0x7')]('in',_0x0af4('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0af4('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0af4('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5733=['ENUM','out','sequelize','iconv','DATE','STRING','TEXT','long'];(function(_0x5edb20,_0x2fa491){var _0x53b891=function(_0x4ac134){while(--_0x4ac134){_0x5edb20['push'](_0x5edb20['shift']());}};_0x53b891(++_0x2fa491);}(_0x5733,0x1b2));var _0x3573=function(_0x102c45,_0x2490d0){_0x102c45=_0x102c45-0x0;var _0x2f0b5d=_0x5733[_0x102c45];return _0x2f0b5d;};'use strict';var Sequelize=require(_0x3573('0x0'));var iconv=require(_0x3573('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3573('0x2')]},'disposition':{'type':Sequelize[_0x3573('0x3')]},'secondDisposition':{'type':Sequelize[_0x3573('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3573('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3573('0x3')](0x1fe)},'to':{'type':Sequelize[_0x3573('0x3')]},'cc':{'type':Sequelize[_0x3573('0x4')](_0x3573('0x5'))},'subject':{'type':Sequelize[_0x3573('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3573('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x3573('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3573('0x6')]('in',_0x3573('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3573('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3573('0x6')]('in',_0x3573('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 608f5f3..3871f8c 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 _0xa99e=['update','body','find','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','subject','createdAt','each','missing.recipient@your.company.com','decode','headers','Attachments','basename','existsSync','type','writeFileSync','message%d.eml','rimraf','zip-dir','util','juice','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','name','send','rawAttributes','fieldName','getOptions','mail','query','user','show','params','model','keys','MailInteraction','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xa99e,0x117));var _0xea99=function(_0x15b98e,_0x4894f8){_0x15b98e=_0x15b98e-0x0;var _0x5a680b=_0xa99e[_0x15b98e];return _0x5a680b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea99('0x0'));var zipdir=require(_0xea99('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xea99('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0xea99('0x3'));var Redis=require(_0xea99('0x4'));var interaction=require(_0xea99('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xea99('0x6'));var config=require(_0xea99('0x7'));var db=require(_0xea99('0x8'))['db'];var htmlEntities=require(_0xea99('0x9'));config[_0xea99('0xa')]=_[_0xea99('0xb')](config['redis'],{'host':_0xea99('0xc'),'port':0x18eb});var socket=require(_0xea99('0xd'))(new Redis(config[_0xea99('0xa')]));require(_0xea99('0xe'))[_0xea99('0xf')](socket);function respondWithStatusCode(_0x515bb3,_0x375c24){_0x375c24=_0x375c24||0xcc;return function(_0x5c6b4b){if(_0x5c6b4b){return _0x515bb3[_0xea99('0x10')](_0x375c24);}return _0x515bb3[_0xea99('0x11')](_0x375c24)['end']();};}function respondWithResult(_0x1a248f,_0x2cf58c){_0x2cf58c=_0x2cf58c||0xc8;return function(_0x5b3d9d){if(_0x5b3d9d){return _0x1a248f[_0xea99('0x11')](_0x2cf58c)[_0xea99('0x12')](_0x5b3d9d);}};}function respondWithFilteredResult(_0x224ceb,_0x39e90b){return function(_0x3ce51f){if(_0x3ce51f){var _0x1053ad=typeof _0x39e90b[_0xea99('0x13')]===_0xea99('0x14')&&typeof _0x39e90b[_0xea99('0x15')]===_0xea99('0x14');var _0x18b0ce=_0x3ce51f[_0xea99('0x16')];var _0x4b8c61=_0x1053ad?0x0:_0x39e90b[_0xea99('0x13')];var _0x162664=_0x1053ad?_0x3ce51f[_0xea99('0x16')]:_0x39e90b[_0xea99('0x13')]+_0x39e90b[_0xea99('0x15')];var _0xa6aa8e;if(_0x162664>=_0x18b0ce){_0x162664=_0x18b0ce;_0xa6aa8e=0xc8;}else{_0xa6aa8e=0xce;}_0x224ceb[_0xea99('0x11')](_0xa6aa8e);return _0x224ceb[_0xea99('0x17')](_0xea99('0x18'),_0x4b8c61+'-'+_0x162664+'/'+_0x18b0ce)['json'](_0x3ce51f);}return null;};}function saveUpdates(_0x4749cf){return function(_0x538f41){if(_0x538f41){return _0x538f41['update'](_0x4749cf)[_0xea99('0x19')](function(_0x5caa8e){return _0x5caa8e;});}return null;};}function removeEntity(_0x3aa082){return function(_0xc6386e){if(_0xc6386e){return _0xc6386e[_0xea99('0x1a')]()[_0xea99('0x19')](function(){_0x3aa082[_0xea99('0x11')](0xcc)[_0xea99('0x1b')]();});}};}function handleEntityNotFound(_0x1f0e5f){return function(_0x4377e1){if(!_0x4377e1){_0x1f0e5f[_0xea99('0x10')](0x194);}return _0x4377e1;};}function handleError(_0x3f53d1,_0x14bfe5){_0x14bfe5=_0x14bfe5||0x1f4;return function(_0x1cb6e4){logger['error'](_0x1cb6e4['stack']);if(_0x1cb6e4[_0xea99('0x1c')]){delete _0x1cb6e4[_0xea99('0x1c')];}_0x3f53d1[_0xea99('0x11')](_0x14bfe5)[_0xea99('0x1d')](_0x1cb6e4);};}exports['index']=function(_0x200b61,_0x1bfa52){var _0xc668f0={};var _0x39eee1=_['map'](db['MailInteraction'][_0xea99('0x1e')],function(_0xc084fa){return{'name':_0xc084fa[_0xea99('0x1f')],'type':_0xc084fa['type']['key']};});_0xc668f0=qs[_0xea99('0x20')](_0x39eee1,_0x200b61);return interaction['findAll'](_0xea99('0x21'),_0x200b61[_0xea99('0x22')],_0x200b61[_0xea99('0x23')],_0xc668f0,_0x39eee1)[_0xea99('0x19')](respondWithFilteredResult(_0x1bfa52,_0xc668f0))['catch'](handleError(_0x1bfa52,null));};exports[_0xea99('0x24')]=function(_0x17a4e6,_0x3ff35b){var _0x3696a8={'raw':![],'where':{'id':_0x17a4e6[_0xea99('0x25')]['id']}},_0x47af63={};_0x47af63[_0xea99('0x26')]=_[_0xea99('0x27')](db[_0xea99('0x28')]['rawAttributes']);_0x47af63[_0xea99('0x22')]=_[_0xea99('0x27')](_0x17a4e6['query']);_0x47af63[_0xea99('0x29')]=_[_0xea99('0x2a')](_0x47af63['model'],_0x47af63['query']);_0x3696a8[_0xea99('0x2b')]=_[_0xea99('0x2a')](_0x47af63[_0xea99('0x26')],qs[_0xea99('0x2c')](_0x17a4e6[_0xea99('0x22')][_0xea99('0x2c')]));_0x3696a8['attributes']=_0x3696a8['attributes'][_0xea99('0x2d')]?_0x3696a8[_0xea99('0x2b')]:_0x47af63[_0xea99('0x26')];if(_0x17a4e6[_0xea99('0x22')][_0xea99('0x2e')]){_0x3696a8['include']=[{'all':!![]}];}_0x3696a8=_[_0xea99('0x2f')]({},_0x3696a8,_0x17a4e6[_0xea99('0x30')]);return db[_0xea99('0x28')]['find'](_0x3696a8)['then'](handleEntityNotFound(_0x3ff35b,null))[_0xea99('0x19')](respondWithResult(_0x3ff35b,null))[_0xea99('0x31')](handleError(_0x3ff35b,null));};exports[_0xea99('0x32')]=function(_0x17cf57,_0x43a1d5){return db['MailInteraction'][_0xea99('0x32')](_0x17cf57['body'],{})[_0xea99('0x19')](respondWithResult(_0x43a1d5,0xc9))[_0xea99('0x31')](handleError(_0x43a1d5,null));};exports[_0xea99('0x33')]=function(_0x4a8f45,_0x429f96){if(_0x4a8f45[_0xea99('0x34')]['id']){delete _0x4a8f45['body']['id'];}return db[_0xea99('0x28')][_0xea99('0x35')]({'where':{'id':_0x4a8f45[_0xea99('0x25')]['id']}})[_0xea99('0x19')](handleEntityNotFound(_0x429f96,null))[_0xea99('0x19')](saveUpdates(_0x4a8f45[_0xea99('0x34')],null))['then'](respondWithResult(_0x429f96,null))[_0xea99('0x31')](handleError(_0x429f96,null));};exports['destroy']=function(_0x20dc20,_0x515526){return db[_0xea99('0x28')]['find']({'where':{'id':_0x20dc20[_0xea99('0x25')]['id']}})[_0xea99('0x19')](handleEntityNotFound(_0x515526,null))[_0xea99('0x19')](removeEntity(_0x515526,null))[_0xea99('0x31')](handleError(_0x515526,null));};exports[_0xea99('0x36')]=function(_0x3fe2cf,_0x4a5950){return db[_0xea99('0x28')][_0xea99('0x36')]()[_0xea99('0x19')](respondWithResult(_0x4a5950,null))[_0xea99('0x31')](handleError(_0x4a5950,null));};exports[_0xea99('0x37')]=function(_0x3e3b67,_0x113ae2){return db[_0xea99('0x38')][_0xea99('0x35')]({'where':{'id':_0x3e3b67[_0xea99('0x25')]['id']}})[_0xea99('0x19')](handleEntityNotFound(_0x113ae2,null))[_0xea99('0x19')](function(_0x580578){if(_0x580578){return _0x580578[_0xea99('0x37')](_0x3e3b67[_0xea99('0x34')][_0xea99('0x39')],_[_0xea99('0x3a')](_0x3e3b67[_0xea99('0x34')],[_0xea99('0x39'),'id'])||{});}})[_0xea99('0x19')](respondWithResult(_0x113ae2,null))[_0xea99('0x31')](handleError(_0x113ae2,null));};exports[_0xea99('0x3b')]=function(_0x3b428c,_0x32ce0a){var _0x14e328={'raw':![],'where':{}};var _0x17a008={};var _0xf32b97={'count':0x0,'rows':[]};return db[_0xea99('0x28')][_0xea99('0x3c')]({'where':{'id':_0x3b428c[_0xea99('0x25')]['id']}})['then'](handleEntityNotFound(_0x32ce0a,null))[_0xea99('0x19')](function(_0x1074b2){if(_0x1074b2){_0x17a008[_0xea99('0x26')]=_[_0xea99('0x27')](db[_0xea99('0x38')][_0xea99('0x1e')]);_0x17a008[_0xea99('0x22')]=_['keys'](_0x3b428c[_0xea99('0x22')]);_0x17a008[_0xea99('0x29')]=_['intersection'](_0x17a008[_0xea99('0x26')],_0x17a008[_0xea99('0x22')]);_0x14e328[_0xea99('0x2b')]=_['intersection'](_0x17a008[_0xea99('0x26')],qs[_0xea99('0x2c')](_0x3b428c[_0xea99('0x22')]['fields']));_0x14e328['attributes']=_0x14e328[_0xea99('0x2b')][_0xea99('0x2d')]?_0x14e328['attributes']:_0x17a008[_0xea99('0x26')];if(!_0x3b428c[_0xea99('0x22')][_0xea99('0x3d')](_0xea99('0x3e'))){_0x14e328[_0xea99('0x15')]=qs[_0xea99('0x15')](_0x3b428c[_0xea99('0x22')]['limit']);_0x14e328['offset']=qs[_0xea99('0x13')](_0x3b428c['query'][_0xea99('0x13')]);}_0x14e328[_0xea99('0x3f')]=qs[_0xea99('0x40')](_0x3b428c[_0xea99('0x22')][_0xea99('0x40')]);_0x14e328['where']=qs['filters'](_['pick'](_0x3b428c['query'],_0x17a008['filters']));_0x14e328[_0xea99('0x41')][_0xea99('0x42')]=_0x1074b2['id'];if(_0x3b428c[_0xea99('0x22')][_0xea99('0x43')]){_0x14e328[_0xea99('0x41')]=_['merge'](_0x14e328[_0xea99('0x41')],{'$or':_[_0xea99('0x44')](_0x14e328[_0xea99('0x2b')],function(_0x4330f6){var _0x2543c4={};_0x2543c4[_0x4330f6]={'$like':'%'+_0x3b428c[_0xea99('0x22')][_0xea99('0x43')]+'%'};return _0x2543c4;})});}if(_0x3b428c[_0xea99('0x22')]['$gte']){var _0x233784=_0x3b428c[_0xea99('0x22')][_0xea99('0x45')][_0xea99('0x46')](',');var _0x5d9415={};_0x5d9415[_0x233784[0x0]]={'$gte':moment(_0x233784[0x1])[_0xea99('0x47')](_0xea99('0x48'))};_0x14e328[_0xea99('0x41')]=_[_0xea99('0x2f')](_0x14e328[_0xea99('0x41')],_0x5d9415);}_0x14e328=_[_0xea99('0x2f')]({},_0x14e328,_0x3b428c['options']);return db[_0xea99('0x38')][_0xea99('0x16')]({'where':_0x14e328[_0xea99('0x41')]})['then'](function(_0x4789ec){_0xf32b97[_0xea99('0x16')]=_0x4789ec;if(_0x3b428c[_0xea99('0x22')][_0xea99('0x2e')]){_0x14e328['include']=[{'all':!![]}];}return db[_0xea99('0x38')][_0xea99('0x49')](_0x14e328);})['then'](function(_0x5530a7){if(_0x3b428c['query'][_0xea99('0x4a')]===_0xea99('0x4b')){for(var _0x2f7c9f=0x0;_0x2f7c9f<_0x5530a7['length'];_0x2f7c9f++){_0x5530a7[_0x2f7c9f][_0xea99('0x34')]=juice(_0x5530a7[_0x2f7c9f][_0xea99('0x34')]);}}_0xf32b97[_0xea99('0x4c')]=_0x5530a7;return _0xf32b97;});}})[_0xea99('0x19')](respondWithFilteredResult(_0x32ce0a,_0x14e328))['catch'](handleError(_0x32ce0a,null));};exports[_0xea99('0x4d')]=function(_0x21755c,_0x483575){return db[_0xea99('0x28')][_0xea99('0x35')]({'where':{'id':_0x21755c[_0xea99('0x25')]['id']}})[_0xea99('0x19')](handleEntityNotFound(_0x483575,null))[_0xea99('0x19')](function(_0x3cb5ba){if(_0x3cb5ba){return _0x3cb5ba[_0xea99('0x4e')](_0x21755c[_0xea99('0x34')]['ids'],_[_0xea99('0x3a')](_0x21755c[_0xea99('0x34')],[_0xea99('0x39'),'id'])||{})['spread'](function(){return db[_0xea99('0x4f')]['findAll']({'attributes':['id','name',_0xea99('0x50')],'where':{'id':_0x21755c[_0xea99('0x34')][_0xea99('0x39')]}});})[_0xea99('0x19')](function(_0x3ff5ac){socket['emit'](_0xea99('0x51'),{'id':Number(_0x21755c[_0xea99('0x25')]['id']),'tags':_0x3ff5ac||[]});return{'id':Number(_0x21755c[_0xea99('0x25')]['id']),'tags':_0x3ff5ac||[]};});}})[_0xea99('0x19')](respondWithResult(_0x483575,null))[_0xea99('0x31')](handleError(_0x483575,null));};exports[_0xea99('0x52')]=function(_0x1c51db,_0x3d7dca){return db[_0xea99('0x28')][_0xea99('0x35')]({'where':{'id':_0x1c51db['params']['id']}})[_0xea99('0x19')](handleEntityNotFound(_0x3d7dca,null))[_0xea99('0x19')](function(_0x163a12){if(_0x163a12){return _0x163a12['removeTags'](_0x1c51db['query'][_0xea99('0x39')]);}})[_0xea99('0x19')](respondWithStatusCode(_0x3d7dca,null))['catch'](handleError(_0x3d7dca,null));};exports[_0xea99('0x53')]=function(_0x5bcd47,_0x1e1a21){var _0x28c7d7=moment()[_0xea99('0x54')]()[_0xea99('0x55')]();var _0x4df86e=path[_0xea99('0x56')](config[_0xea99('0x57')],_0xea99('0x58'),'files',_0xea99('0x59'));var _0x447e58=path[_0xea99('0x56')](config['root'],_0xea99('0x58'),_0xea99('0x5a'),_0xea99('0x5b'));var _0x15d889=path[_0xea99('0x56')](_0x4df86e,_0x28c7d7);var _0x504cb4=util[_0xea99('0x47')](_0xea99('0x5c'),_0x5bcd47['params']['id'],_0x28c7d7);var _0x4035d7=path[_0xea99('0x56')](_0x4df86e,_0x504cb4);var _0x57b499=[];if(_0x5bcd47[_0xea99('0x22')][_0xea99('0x5b')]){_0x57b499[_0xea99('0x5d')]({'model':db[_0xea99('0x5e')],'as':'Attachments','raw':!![]});}var _0x10d571=[{'model':db['MailMessage'],'as':_0xea99('0x5f'),'attributes':['id',_0xea99('0x34'),_0xea99('0x60'),'to','cc',_0xea99('0x61'),_0xea99('0x62'),_0xea99('0x63')],'where':{'secret':![]},'order':qs[_0xea99('0x40')]('id'),'include':_0x57b499}];return db['MailInteraction']['find']({'where':{'id':_0x5bcd47['params']['id']},'include':_0x10d571})[_0xea99('0x19')](handleEntityNotFound(_0x1e1a21,null))['then'](function(_0x1189d4){if(_0x1189d4&&_0x1189d4[_0xea99('0x5f')]){var _0x4a5dc9=_0x1189d4['get']({'plain':!![]});fs['mkdirSync'](_0x15d889);return BPromise[_0xea99('0x64')](_0x4a5dc9['Messages'],function(_0x4c1563,_0x3c0ec9){var _0x29b125={'from':_0x4c1563[_0xea99('0x60')],'to':_0x4c1563['to']||_0xea99('0x65'),'subject':_0x4c1563[_0xea99('0x62')],'html':htmlEntities[_0xea99('0x66')](_0x4c1563[_0xea99('0x34')]),'headers':{'Date':moment(_0x4c1563[_0xea99('0x63')])[_0xea99('0x47')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4c1563['cc']){_0x29b125[_0xea99('0x67')]['Cc']=_0x4c1563['cc'];}if(_0x4c1563[_0xea99('0x61')]){_0x29b125[_0xea99('0x67')]['Bcc']=_0x4c1563[_0xea99('0x61')];}return new BPromise(function(_0x3e2b20,_0x3b35de){if(_0x4c1563[_0xea99('0x68')]){for(var _0xb51aeb=0x0;_0xb51aeb<_0x4c1563[_0xea99('0x68')][_0xea99('0x2d')];_0xb51aeb++){var _0x3a22a2=_0x4c1563['Attachments'][_0xb51aeb];var _0x1c92e6=path['join'](_0x447e58,_0x3a22a2[_0xea99('0x69')]);if(fs[_0xea99('0x6a')](_0x1c92e6)){_0x29b125['attachments'][_0xea99('0x5d')]({'name':_0x3a22a2['name'],'contentType':_0x3a22a2[_0xea99('0x6b')],'data':fs['readFileSync'](_0x1c92e6)});}}}emlformat['build'](_0x29b125,function(_0x3a531f,_0x4108f6){if(_0x3a531f)return _0x3b35de(_0x3a531f);fs[_0xea99('0x6c')](path['join'](_0x15d889,util['format'](_0xea99('0x6d'),_0x3c0ec9)),_0x4108f6);return _0x3e2b20(_0x4108f6);});});})[_0xea99('0x19')](function(){return new BPromise(function(_0xdd550b,_0x5e4838){zipdir(_0x15d889,{'saveTo':_0x4035d7},function(_0x530588,_0x5521f6){if(_0x530588)return _0x5e4838(_0x530588);return _0xdd550b(_0x5521f6);});})[_0xea99('0x19')](function(){return new BPromise(function(_0x59ad37,_0x5b6a4f){rimraf(_0x15d889,function(_0x41d41a){if(_0x41d41a)_0x5b6a4f(_0x41d41a);return _0x59ad37();});});})['then'](function(){return _0x1e1a21['download'](_0x4035d7,_0x504cb4,function(_0xd93b0e){if(!_0xd93b0e)fs['unlinkSync'](_0x4035d7);});});});}else{return _0x1e1a21[_0xea99('0x10')](0xc8);}})[_0xea99('0x31')](handleError(_0x1e1a21,null));}; \ No newline at end of file +var _0xe4d7=['addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','createdAt','get','mkdirSync','each','from','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','push','readFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','html-entities','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','MailInteraction','rawAttributes','type','key','getOptions','mail','catch','show','params','model','query','keys','filters','intersection','fields','attributes','includeAll','include','options','find','create','body','describe','MailMessage','addMessage','ids','omit','getMessages','length','nolimit','order','sort','where','pick','MailInteractionId','merge','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows'];(function(_0x346b7f,_0xefad2f){var _0x6561b=function(_0x440ad4){while(--_0x440ad4){_0x346b7f['push'](_0x346b7f['shift']());}};_0x6561b(++_0xefad2f);}(_0xe4d7,0x93));var _0x7e4d=function(_0x180237,_0xfd4959){_0x180237=_0x180237-0x0;var _0x56fa74=_0xe4d7[_0x180237];return _0x56fa74;};'use strict';var emlformat=require(_0x7e4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e4d('0x1'));var moment=require(_0x7e4d('0x2'));var BPromise=require(_0x7e4d('0x3'));var util=require(_0x7e4d('0x4'));var path=require(_0x7e4d('0x5'));var fs=require('fs');var _=require(_0x7e4d('0x6'));var juice=require('juice');var Redis=require(_0x7e4d('0x7'));var interaction=require(_0x7e4d('0x8'));var qs=require(_0x7e4d('0x9'));var logger=require(_0x7e4d('0xa'))('api');var config=require('../../config/environment');var db=require(_0x7e4d('0xb'))['db'];var htmlEntities=require(_0x7e4d('0xc'));config[_0x7e4d('0xd')]=_['defaults'](config[_0x7e4d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e4d('0xe'))(new Redis(config[_0x7e4d('0xd')]));require(_0x7e4d('0xf'))[_0x7e4d('0x10')](socket);function respondWithStatusCode(_0x47ac6a,_0x595b2e){_0x595b2e=_0x595b2e||0xcc;return function(_0x4ce02b){if(_0x4ce02b){return _0x47ac6a[_0x7e4d('0x11')](_0x595b2e);}return _0x47ac6a[_0x7e4d('0x12')](_0x595b2e)[_0x7e4d('0x13')]();};}function respondWithResult(_0x1c9693,_0x8b181e){_0x8b181e=_0x8b181e||0xc8;return function(_0x4b1de5){if(_0x4b1de5){return _0x1c9693['status'](_0x8b181e)[_0x7e4d('0x14')](_0x4b1de5);}};}function respondWithFilteredResult(_0x2f41da,_0x1fc154){return function(_0xaea138){if(_0xaea138){var _0xa3735b=typeof _0x1fc154[_0x7e4d('0x15')]==='undefined'&&typeof _0x1fc154[_0x7e4d('0x16')]==='undefined';var _0x25227b=_0xaea138[_0x7e4d('0x17')];var _0x194d41=_0xa3735b?0x0:_0x1fc154[_0x7e4d('0x15')];var _0x73ae04=_0xa3735b?_0xaea138[_0x7e4d('0x17')]:_0x1fc154[_0x7e4d('0x15')]+_0x1fc154[_0x7e4d('0x16')];var _0x6411c;if(_0x73ae04>=_0x25227b){_0x73ae04=_0x25227b;_0x6411c=0xc8;}else{_0x6411c=0xce;}_0x2f41da['status'](_0x6411c);return _0x2f41da[_0x7e4d('0x18')](_0x7e4d('0x19'),_0x194d41+'-'+_0x73ae04+'/'+_0x25227b)[_0x7e4d('0x14')](_0xaea138);}return null;};}function saveUpdates(_0x56e5ef){return function(_0x3bde60){if(_0x3bde60){return _0x3bde60[_0x7e4d('0x1a')](_0x56e5ef)[_0x7e4d('0x1b')](function(_0x577a94){return _0x577a94;});}return null;};}function removeEntity(_0x1d3197){return function(_0x3b1f27){if(_0x3b1f27){return _0x3b1f27[_0x7e4d('0x1c')]()[_0x7e4d('0x1b')](function(){_0x1d3197['status'](0xcc)[_0x7e4d('0x13')]();});}};}function handleEntityNotFound(_0x29f278){return function(_0x59f331){if(!_0x59f331){_0x29f278[_0x7e4d('0x11')](0x194);}return _0x59f331;};}function handleError(_0x4925ae,_0x1a2dc2){_0x1a2dc2=_0x1a2dc2||0x1f4;return function(_0x193cfe){logger[_0x7e4d('0x1d')](_0x193cfe[_0x7e4d('0x1e')]);if(_0x193cfe[_0x7e4d('0x1f')]){delete _0x193cfe[_0x7e4d('0x1f')];}_0x4925ae[_0x7e4d('0x12')](_0x1a2dc2)[_0x7e4d('0x20')](_0x193cfe);};}exports[_0x7e4d('0x21')]=function(_0x1495a1,_0x1a160e){var _0x39b1a6={};var _0x1e5e90=_[_0x7e4d('0x22')](db[_0x7e4d('0x23')][_0x7e4d('0x24')],function(_0x138422){return{'name':_0x138422['fieldName'],'type':_0x138422[_0x7e4d('0x25')][_0x7e4d('0x26')]};});_0x39b1a6=qs[_0x7e4d('0x27')](_0x1e5e90,_0x1495a1);return interaction['findAll'](_0x7e4d('0x28'),_0x1495a1['query'],_0x1495a1['user'],_0x39b1a6,_0x1e5e90)['then'](respondWithFilteredResult(_0x1a160e,_0x39b1a6))[_0x7e4d('0x29')](handleError(_0x1a160e,null));};exports[_0x7e4d('0x2a')]=function(_0x52c280,_0x23ae03){var _0x3747be={'raw':![],'where':{'id':_0x52c280[_0x7e4d('0x2b')]['id']}},_0x4ea411={};_0x4ea411[_0x7e4d('0x2c')]=_['keys'](db[_0x7e4d('0x23')][_0x7e4d('0x24')]);_0x4ea411[_0x7e4d('0x2d')]=_[_0x7e4d('0x2e')](_0x52c280[_0x7e4d('0x2d')]);_0x4ea411[_0x7e4d('0x2f')]=_[_0x7e4d('0x30')](_0x4ea411['model'],_0x4ea411['query']);_0x3747be['attributes']=_['intersection'](_0x4ea411[_0x7e4d('0x2c')],qs[_0x7e4d('0x31')](_0x52c280[_0x7e4d('0x2d')][_0x7e4d('0x31')]));_0x3747be[_0x7e4d('0x32')]=_0x3747be[_0x7e4d('0x32')]['length']?_0x3747be[_0x7e4d('0x32')]:_0x4ea411[_0x7e4d('0x2c')];if(_0x52c280[_0x7e4d('0x2d')][_0x7e4d('0x33')]){_0x3747be[_0x7e4d('0x34')]=[{'all':!![]}];}_0x3747be=_['merge']({},_0x3747be,_0x52c280[_0x7e4d('0x35')]);return db[_0x7e4d('0x23')][_0x7e4d('0x36')](_0x3747be)[_0x7e4d('0x1b')](handleEntityNotFound(_0x23ae03,null))[_0x7e4d('0x1b')](respondWithResult(_0x23ae03,null))['catch'](handleError(_0x23ae03,null));};exports[_0x7e4d('0x37')]=function(_0x295496,_0x5ed5c1){return db['MailInteraction'][_0x7e4d('0x37')](_0x295496[_0x7e4d('0x38')],{})[_0x7e4d('0x1b')](respondWithResult(_0x5ed5c1,0xc9))[_0x7e4d('0x29')](handleError(_0x5ed5c1,null));};exports[_0x7e4d('0x1a')]=function(_0x46ed96,_0x7e9a1){if(_0x46ed96[_0x7e4d('0x38')]['id']){delete _0x46ed96[_0x7e4d('0x38')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x46ed96['params']['id']}})['then'](handleEntityNotFound(_0x7e9a1,null))['then'](saveUpdates(_0x46ed96[_0x7e4d('0x38')],null))[_0x7e4d('0x1b')](respondWithResult(_0x7e9a1,null))[_0x7e4d('0x29')](handleError(_0x7e9a1,null));};exports[_0x7e4d('0x1c')]=function(_0x3e1b00,_0x1cc4cf){return db[_0x7e4d('0x23')][_0x7e4d('0x36')]({'where':{'id':_0x3e1b00[_0x7e4d('0x2b')]['id']}})[_0x7e4d('0x1b')](handleEntityNotFound(_0x1cc4cf,null))[_0x7e4d('0x1b')](removeEntity(_0x1cc4cf,null))[_0x7e4d('0x29')](handleError(_0x1cc4cf,null));};exports['describe']=function(_0x444b00,_0x2c6633){return db[_0x7e4d('0x23')][_0x7e4d('0x39')]()[_0x7e4d('0x1b')](respondWithResult(_0x2c6633,null))[_0x7e4d('0x29')](handleError(_0x2c6633,null));};exports['addMessage']=function(_0x8c60fb,_0x6214dd){return db[_0x7e4d('0x3a')][_0x7e4d('0x36')]({'where':{'id':_0x8c60fb[_0x7e4d('0x2b')]['id']}})[_0x7e4d('0x1b')](handleEntityNotFound(_0x6214dd,null))[_0x7e4d('0x1b')](function(_0x370d75){if(_0x370d75){return _0x370d75[_0x7e4d('0x3b')](_0x8c60fb['body'][_0x7e4d('0x3c')],_[_0x7e4d('0x3d')](_0x8c60fb['body'],[_0x7e4d('0x3c'),'id'])||{});}})[_0x7e4d('0x1b')](respondWithResult(_0x6214dd,null))['catch'](handleError(_0x6214dd,null));};exports[_0x7e4d('0x3e')]=function(_0x3ff1ca,_0x94d26a){var _0x3e508e={'raw':![],'where':{}};var _0x47f292={};var _0x585a0a={'count':0x0,'rows':[]};return db[_0x7e4d('0x23')]['findOne']({'where':{'id':_0x3ff1ca['params']['id']}})[_0x7e4d('0x1b')](handleEntityNotFound(_0x94d26a,null))[_0x7e4d('0x1b')](function(_0x3ad3be){if(_0x3ad3be){_0x47f292[_0x7e4d('0x2c')]=_['keys'](db[_0x7e4d('0x3a')][_0x7e4d('0x24')]);_0x47f292[_0x7e4d('0x2d')]=_[_0x7e4d('0x2e')](_0x3ff1ca['query']);_0x47f292[_0x7e4d('0x2f')]=_[_0x7e4d('0x30')](_0x47f292[_0x7e4d('0x2c')],_0x47f292[_0x7e4d('0x2d')]);_0x3e508e[_0x7e4d('0x32')]=_[_0x7e4d('0x30')](_0x47f292[_0x7e4d('0x2c')],qs[_0x7e4d('0x31')](_0x3ff1ca[_0x7e4d('0x2d')][_0x7e4d('0x31')]));_0x3e508e[_0x7e4d('0x32')]=_0x3e508e['attributes'][_0x7e4d('0x3f')]?_0x3e508e[_0x7e4d('0x32')]:_0x47f292[_0x7e4d('0x2c')];if(!_0x3ff1ca[_0x7e4d('0x2d')]['hasOwnProperty'](_0x7e4d('0x40'))){_0x3e508e[_0x7e4d('0x16')]=qs[_0x7e4d('0x16')](_0x3ff1ca[_0x7e4d('0x2d')][_0x7e4d('0x16')]);_0x3e508e['offset']=qs['offset'](_0x3ff1ca['query']['offset']);}_0x3e508e[_0x7e4d('0x41')]=qs[_0x7e4d('0x42')](_0x3ff1ca[_0x7e4d('0x2d')][_0x7e4d('0x42')]);_0x3e508e[_0x7e4d('0x43')]=qs[_0x7e4d('0x2f')](_[_0x7e4d('0x44')](_0x3ff1ca[_0x7e4d('0x2d')],_0x47f292[_0x7e4d('0x2f')]));_0x3e508e['where'][_0x7e4d('0x45')]=_0x3ad3be['id'];if(_0x3ff1ca[_0x7e4d('0x2d')]['filter']){_0x3e508e[_0x7e4d('0x43')]=_[_0x7e4d('0x46')](_0x3e508e[_0x7e4d('0x43')],{'$or':_[_0x7e4d('0x22')](_0x3e508e[_0x7e4d('0x32')],function(_0x35b28b){var _0x487212={};_0x487212[_0x35b28b]={'$like':'%'+_0x3ff1ca[_0x7e4d('0x2d')][_0x7e4d('0x47')]+'%'};return _0x487212;})});}if(_0x3ff1ca[_0x7e4d('0x2d')][_0x7e4d('0x48')]){var _0x20c53d=_0x3ff1ca['query'][_0x7e4d('0x48')][_0x7e4d('0x49')](',');var _0x1d34b7={};_0x1d34b7[_0x20c53d[0x0]]={'$gte':moment(_0x20c53d[0x1])['format'](_0x7e4d('0x4a'))};_0x3e508e['where']=_[_0x7e4d('0x46')](_0x3e508e[_0x7e4d('0x43')],_0x1d34b7);}_0x3e508e=_['merge']({},_0x3e508e,_0x3ff1ca[_0x7e4d('0x35')]);return db[_0x7e4d('0x3a')][_0x7e4d('0x17')]({'where':_0x3e508e[_0x7e4d('0x43')]})[_0x7e4d('0x1b')](function(_0x3b184e){_0x585a0a[_0x7e4d('0x17')]=_0x3b184e;if(_0x3ff1ca[_0x7e4d('0x2d')][_0x7e4d('0x33')]){_0x3e508e['include']=[{'all':!![]}];}return db[_0x7e4d('0x3a')][_0x7e4d('0x4b')](_0x3e508e);})['then'](function(_0x565982){if(_0x3ff1ca['query']['inlineCss']==='true'){for(var _0x2d90c2=0x0;_0x2d90c2<_0x565982[_0x7e4d('0x3f')];_0x2d90c2++){_0x565982[_0x2d90c2][_0x7e4d('0x38')]=juice(_0x565982[_0x2d90c2][_0x7e4d('0x38')]);}}_0x585a0a[_0x7e4d('0x4c')]=_0x565982;return _0x585a0a;});}})[_0x7e4d('0x1b')](respondWithFilteredResult(_0x94d26a,_0x3e508e))['catch'](handleError(_0x94d26a,null));};exports[_0x7e4d('0x4d')]=function(_0x4657e5,_0x354d1e){return db[_0x7e4d('0x23')][_0x7e4d('0x36')]({'where':{'id':_0x4657e5['params']['id']}})[_0x7e4d('0x1b')](handleEntityNotFound(_0x354d1e,null))[_0x7e4d('0x1b')](function(_0x5e51a){if(_0x5e51a){return _0x5e51a[_0x7e4d('0x4e')](_0x4657e5[_0x7e4d('0x38')][_0x7e4d('0x3c')],_[_0x7e4d('0x3d')](_0x4657e5[_0x7e4d('0x38')],['ids','id'])||{})[_0x7e4d('0x4f')](function(){return db[_0x7e4d('0x50')][_0x7e4d('0x4b')]({'attributes':['id',_0x7e4d('0x1f'),_0x7e4d('0x51')],'where':{'id':_0x4657e5[_0x7e4d('0x38')][_0x7e4d('0x3c')]}});})['then'](function(_0x678e1e){socket[_0x7e4d('0x52')](_0x7e4d('0x53'),{'id':Number(_0x4657e5[_0x7e4d('0x2b')]['id']),'tags':_0x678e1e||[]});return{'id':Number(_0x4657e5[_0x7e4d('0x2b')]['id']),'tags':_0x678e1e||[]};});}})[_0x7e4d('0x1b')](respondWithResult(_0x354d1e,null))[_0x7e4d('0x29')](handleError(_0x354d1e,null));};exports[_0x7e4d('0x54')]=function(_0x31146b,_0x3d3b3c){return db[_0x7e4d('0x23')][_0x7e4d('0x36')]({'where':{'id':_0x31146b[_0x7e4d('0x2b')]['id']}})[_0x7e4d('0x1b')](handleEntityNotFound(_0x3d3b3c,null))[_0x7e4d('0x1b')](function(_0x10e50e){if(_0x10e50e){return _0x10e50e[_0x7e4d('0x54')](_0x31146b[_0x7e4d('0x2d')]['ids']);}})['then'](respondWithStatusCode(_0x3d3b3c,null))[_0x7e4d('0x29')](handleError(_0x3d3b3c,null));};exports[_0x7e4d('0x55')]=function(_0x32ab96,_0x311f96){var _0x123329=moment()[_0x7e4d('0x56')]()[_0x7e4d('0x57')]();var _0x3bf5d3=path[_0x7e4d('0x58')](config[_0x7e4d('0x59')],_0x7e4d('0x5a'),'files','tmp');var _0x54701a=path[_0x7e4d('0x58')](config[_0x7e4d('0x59')],_0x7e4d('0x5a'),_0x7e4d('0x5b'),_0x7e4d('0x5c'));var _0x6b487c=path['join'](_0x3bf5d3,_0x123329);var _0x597aa4=util['format'](_0x7e4d('0x5d'),_0x32ab96['params']['id'],_0x123329);var _0x4e5992=path[_0x7e4d('0x58')](_0x3bf5d3,_0x597aa4);var _0x3d85cc=[];if(_0x32ab96[_0x7e4d('0x2d')]['attachments']){_0x3d85cc['push']({'model':db[_0x7e4d('0x5e')],'as':_0x7e4d('0x5f'),'raw':!![]});}var _0x32352b=[{'model':db[_0x7e4d('0x3a')],'as':_0x7e4d('0x60'),'attributes':['id','body','from','to','cc','bcc',_0x7e4d('0x61'),_0x7e4d('0x62')],'where':{'secret':![]},'order':qs[_0x7e4d('0x42')]('id'),'include':_0x3d85cc}];return db[_0x7e4d('0x23')][_0x7e4d('0x36')]({'where':{'id':_0x32ab96['params']['id']},'include':_0x32352b})[_0x7e4d('0x1b')](handleEntityNotFound(_0x311f96,null))[_0x7e4d('0x1b')](function(_0x2c3fed){if(_0x2c3fed&&_0x2c3fed[_0x7e4d('0x60')]){var _0x129694=_0x2c3fed[_0x7e4d('0x63')]({'plain':!![]});fs[_0x7e4d('0x64')](_0x6b487c);return BPromise[_0x7e4d('0x65')](_0x129694[_0x7e4d('0x60')],function(_0x18aea5,_0x34c0c3){var _0x86ce2a={'from':_0x18aea5[_0x7e4d('0x66')],'to':_0x18aea5['to']||'missing.recipient@your.company.com','subject':_0x18aea5[_0x7e4d('0x61')],'html':htmlEntities['decode'](_0x18aea5[_0x7e4d('0x38')]),'headers':{'Date':moment(_0x18aea5[_0x7e4d('0x62')])[_0x7e4d('0x67')](_0x7e4d('0x68'))},'attachments':[]};if(_0x18aea5['cc']){_0x86ce2a[_0x7e4d('0x69')]['Cc']=_0x18aea5['cc'];}if(_0x18aea5[_0x7e4d('0x6a')]){_0x86ce2a[_0x7e4d('0x69')]['Bcc']=_0x18aea5[_0x7e4d('0x6a')];}return new BPromise(function(_0x5e94f7,_0x2562b2){if(_0x18aea5[_0x7e4d('0x5f')]){for(var _0x2f81d9=0x0;_0x2f81d9<_0x18aea5['Attachments'][_0x7e4d('0x3f')];_0x2f81d9++){var _0x476b30=_0x18aea5[_0x7e4d('0x5f')][_0x2f81d9];var _0x5bbd85=path['join'](_0x54701a,_0x476b30[_0x7e4d('0x6b')]);if(fs['existsSync'](_0x5bbd85)){_0x86ce2a[_0x7e4d('0x5c')][_0x7e4d('0x6c')]({'name':_0x476b30[_0x7e4d('0x1f')],'contentType':_0x476b30[_0x7e4d('0x25')],'data':fs[_0x7e4d('0x6d')](_0x5bbd85)});}}}emlformat['build'](_0x86ce2a,function(_0x3320a4,_0x523926){if(_0x3320a4)return _0x2562b2(_0x3320a4);fs['writeFileSync'](path[_0x7e4d('0x58')](_0x6b487c,util['format'](_0x7e4d('0x6e'),_0x34c0c3)),_0x523926);return _0x5e94f7(_0x523926);});});})[_0x7e4d('0x1b')](function(){return new BPromise(function(_0xf58e01,_0x3720d4){zipdir(_0x6b487c,{'saveTo':_0x4e5992},function(_0x139304,_0x12c462){if(_0x139304)return _0x3720d4(_0x139304);return _0xf58e01(_0x12c462);});})['then'](function(){return new BPromise(function(_0x2c8cf7,_0x153d81){rimraf(_0x6b487c,function(_0x2bd368){if(_0x2bd368)_0x153d81(_0x2bd368);return _0x2c8cf7();});});})[_0x7e4d('0x1b')](function(){return _0x311f96[_0x7e4d('0x55')](_0x4e5992,_0x597aa4,function(_0x5aade2){if(!_0x5aade2)fs[_0x7e4d('0x6f')](_0x4e5992);});});});}else{return _0x311f96[_0x7e4d('0x11')](0xc8);}})[_0x7e4d('0x29')](handleError(_0x311f96,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a5c7ee3..a07cdb0 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 _0x60d4=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x60d4,0x187));var _0x460d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x60d4[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x460d('0x0'));var MailInteraction=require(_0x460d('0x1'))['db'][_0x460d('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x460d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x460d('0x4')](0x0);var events={'afterCreate':_0x460d('0x5'),'afterUpdate':_0x460d('0x6'),'afterDestroy':_0x460d('0x7')};function emitEvent(_0x9a5725){return function(_0x47c4dc,_0x5cb820,_0x4234a2){_0x47c4dc[_0x460d('0x8')]({'attributes':['id'],'raw':!![]})[_0x460d('0x9')](function(_0x35e328){_0x47c4dc[_0x460d('0xa')](_0x460d('0xb'),_0x35e328[_0x460d('0xc')](function(_0xb760f1){return{'id':_0xb760f1['id']};}));return MailMessage[_0x460d('0xd')]({'where':{'MailInteractionId':_0x47c4dc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x460d('0x9')](function(_0x21e677){_0x47c4dc['setDataValue'](_0x460d('0xe'),_0x21e677[_0x460d('0xf')]);MailInteractionEvents[_0x460d('0x10')](_0x9a5725+':'+_0x47c4dc['id'],_0x47c4dc);MailInteractionEvents[_0x460d('0x10')](_0x9a5725,_0x47c4dc);_0x4234a2(null);})['catch'](_0x4234a2(null));};}for(var e in events){if(events[_0x460d('0x11')](e)){var event=events[e];MailInteraction[_0x460d('0x12')](e,emitEvent(event));}}module[_0x460d('0x13')]=MailInteractionEvents; \ No newline at end of file +var _0xd251=['../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','Users','map','length','hasOwnProperty','hook'];(function(_0x132720,_0x3b86d1){var _0xc66e45=function(_0x44b071){while(--_0x44b071){_0x132720['push'](_0x132720['shift']());}};_0xc66e45(++_0x3b86d1);}(_0xd251,0xfc));var _0x1d25=function(_0x565c57,_0x1805ff){_0x565c57=_0x565c57-0x0;var _0x583c5b=_0xd251[_0x565c57];return _0x583c5b;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x1d25('0x0'))['db'][_0x1d25('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x1d25('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d25('0x3'),'afterUpdate':_0x1d25('0x4'),'afterDestroy':_0x1d25('0x5')};function emitEvent(_0x238e67){return function(_0x3f746f,_0x2a9eb5,_0x21b8d2){_0x3f746f[_0x1d25('0x6')]({'attributes':['id'],'raw':!![]})[_0x1d25('0x7')](function(_0x3a734e){_0x3f746f[_0x1d25('0x8')](_0x1d25('0x9'),_0x3a734e[_0x1d25('0xa')](function(_0x306037){return{'id':_0x306037['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3f746f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24a5fc){_0x3f746f[_0x1d25('0x8')]('unreadMessages',_0x24a5fc[_0x1d25('0xb')]);MailInteractionEvents['emit'](_0x238e67+':'+_0x3f746f['id'],_0x3f746f);MailInteractionEvents['emit'](_0x238e67,_0x3f746f);_0x21b8d2(null);})['catch'](_0x21b8d2(null));};}for(var e in events){if(events[_0x1d25('0xc')](e)){var event=events[e];MailInteraction[_0x1d25('0xd')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 35c75bf..815053a 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 _0xc5b4=['substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus'];(function(_0x509f25,_0xe866c){var _0x46c924=function(_0x24d49b){while(--_0x24d49b){_0x509f25['push'](_0x509f25['shift']());}};_0x46c924(++_0xe866c);}(_0xc5b4,0x184));var _0x4c5b=function(_0x3ec358,_0x3df159){_0x3ec358=_0x3ec358-0x0;var _0x18318d=_0xc5b4[_0x3ec358];return _0x18318d;};'use strict';var _=require(_0x4c5b('0x0'));var util=require('util');var logger=require(_0x4c5b('0x1'))('api');var moment=require(_0x4c5b('0x2'));var BPromise=require(_0x4c5b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c5b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x4c5b('0x5')]=function(_0x445549,_0xcb8720){return _0x445549[_0x4c5b('0x6')](_0x4c5b('0x7'),attributes,{'tableName':_0x4c5b('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x4c5b('0x9'),'to'],'type':_0x4c5b('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c50b1,_0x330e0f,_0x14077b){if(_0x1c50b1[_0x4c5b('0xb')]){_0x1c50b1[_0x4c5b('0xc')]=moment()['format'](_0x4c5b('0xd'));}if(_0x1c50b1[_0x4c5b('0xe')]){_0x1c50b1[_0x4c5b('0xf')]=moment()[_0x4c5b('0x10')](_0x4c5b('0xd'));}_0x14077b(null,_0x330e0f);},'beforeUpdate':function(_0x26913a,_0x2e6c98,_0x5216db){if(_0x26913a[_0x4c5b('0x11')](_0x4c5b('0xb'))){_0x26913a[_0x4c5b('0xc')]=_0x26913a[_0x4c5b('0xb')]?moment()[_0x4c5b('0x10')](_0x4c5b('0xd')):null;}if(_0x26913a[_0x4c5b('0x11')](_0x4c5b('0xe'))){_0x26913a[_0x4c5b('0xf')]=moment()['format'](_0x4c5b('0xd'));_0x26913a[_0x4c5b('0xb')]=null;_0x26913a[_0x4c5b('0xc')]=null;}_0x5216db(null,_0x26913a);},'afterUpdate':function(_0x446cc4,_0x4089f4,_0x294ce6){var _0x107861=_0x445549[_0x4c5b('0x12')];var _0x175483=_0x446cc4[_0x4c5b('0x13')]({'plain':!![]});if(_0x175483['closed']){return _0x107861[_0x4c5b('0x14')][_0x4c5b('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x175483['id']}})['then'](function(){_0x294ce6();})[_0x4c5b('0x16')](function(_0x5b81e1){_0x294ce6(_0x5b81e1);});}else{_0x294ce6();}}},'charset':_0x4c5b('0x17'),'collate':_0x4c5b('0x18')});}; \ No newline at end of file +var _0x86bb=['get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models'];(function(_0x58ba5a,_0x5cd3b2){var _0x4d711f=function(_0x9c28d6){while(--_0x9c28d6){_0x58ba5a['push'](_0x58ba5a['shift']());}};_0x4d711f(++_0x5cd3b2);}(_0x86bb,0x156));var _0xb86b=function(_0x35cb03,_0x578e9d){_0x35cb03=_0x35cb03-0x0;var _0x696377=_0x86bb[_0x35cb03];return _0x696377;};'use strict';var _=require(_0xb86b('0x0'));var util=require(_0xb86b('0x1'));var logger=require(_0xb86b('0x2'))(_0xb86b('0x3'));var moment=require(_0xb86b('0x4'));var BPromise=require(_0xb86b('0x5'));var rp=require(_0xb86b('0x6'));var fs=require('fs');var path=require(_0xb86b('0x7'));var rimraf=require(_0xb86b('0x8'));var config=require(_0xb86b('0x9'));var attributes=require(_0xb86b('0xa'));module[_0xb86b('0xb')]=function(_0x449a83,_0x9d7c94){return _0x449a83['define']('MailInteraction',attributes,{'tableName':_0xb86b('0xc'),'paranoid':![],'indexes':[{'name':_0xb86b('0xd'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2169ab,_0x1de27f,_0x5c1390){if(_0x2169ab[_0xb86b('0xe')]){_0x2169ab[_0xb86b('0xf')]=moment()[_0xb86b('0x10')](_0xb86b('0x11'));}if(_0x2169ab[_0xb86b('0x12')]){_0x2169ab[_0xb86b('0x13')]=moment()[_0xb86b('0x10')](_0xb86b('0x11'));}_0x5c1390(null,_0x1de27f);},'beforeUpdate':function(_0x5bc55c,_0x59e91d,_0x19bf3a){if(_0x5bc55c[_0xb86b('0x14')](_0xb86b('0xe'))){_0x5bc55c[_0xb86b('0xf')]=_0x5bc55c['substatus']?moment()[_0xb86b('0x10')](_0xb86b('0x11')):null;}if(_0x5bc55c[_0xb86b('0x14')]('closed')){_0x5bc55c[_0xb86b('0x13')]=moment()['format'](_0xb86b('0x11'));_0x5bc55c['substatus']=null;_0x5bc55c[_0xb86b('0xf')]=null;}_0x19bf3a(null,_0x5bc55c);},'afterUpdate':function(_0x18e1c5,_0x516af9,_0x250dc0){var _0x39718b=_0x449a83[_0xb86b('0x15')];var _0x3a0f68=_0x18e1c5[_0xb86b('0x16')]({'plain':!![]});if(_0x3a0f68[_0xb86b('0x12')]){return _0x39718b[_0xb86b('0x17')][_0xb86b('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x3a0f68['id']}})['then'](function(){_0x250dc0();})[_0xb86b('0x19')](function(_0x284541){_0x250dc0(_0x284541);});}else{_0x250dc0();}}},'charset':_0xb86b('0x1a'),'collate':_0xb86b('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3133a04..8788762 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 _0x2b67=['http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','body','options','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','ids','omit','AddTags','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x508aac,_0x18711b){var _0xb780e4=function(_0xc317db){while(--_0xc317db){_0x508aac['push'](_0x508aac['shift']());}};_0xb780e4(++_0x18711b);}(_0x2b67,0x67));var _0x72b6=function(_0x21359c,_0x585cd6){_0x21359c=_0x21359c-0x0;var _0x1d221d=_0x2b67[_0x21359c];return _0x1d221d;};'use strict';var _=require(_0x72b6('0x0'));var util=require('util');var moment=require(_0x72b6('0x1'));var BPromise=require(_0x72b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x72b6('0x4'))(_0x72b6('0x5'));var config=require(_0x72b6('0x6'));var jayson=require(_0x72b6('0x7'));var client=jayson['client'][_0x72b6('0x8')]({'port':0x232a});config[_0x72b6('0x9')]=_[_0x72b6('0xa')](config[_0x72b6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x72b6('0xb'))(new Redis(config[_0x72b6('0x9')]));require(_0x72b6('0xc'))[_0x72b6('0xd')](socket);function respondWithRpcPromise(_0x319c13,_0x392a3a,_0x5a5253){return new BPromise(function(_0x1a7a0f,_0x5e8376){return client[_0x72b6('0xe')](_0x319c13,_0x5a5253)[_0x72b6('0xf')](function(_0x6774f2){logger[_0x72b6('0x10')]('MailInteraction,\x20%s,\x20%s',_0x392a3a,'request\x20sent');logger[_0x72b6('0x11')](_0x72b6('0x12'),_0x392a3a,_0x72b6('0x13'),JSON[_0x72b6('0x14')](_0x6774f2));if(_0x6774f2[_0x72b6('0x15')]){if(_0x6774f2[_0x72b6('0x15')]['code']===0x1f4){logger[_0x72b6('0x15')](_0x72b6('0x16'),_0x392a3a,_0x6774f2[_0x72b6('0x15')][_0x72b6('0x17')]);return _0x5e8376(_0x6774f2[_0x72b6('0x15')]['message']);}logger[_0x72b6('0x15')](_0x72b6('0x16'),_0x392a3a,_0x6774f2[_0x72b6('0x15')]['message']);return _0x1a7a0f(_0x6774f2[_0x72b6('0x15')][_0x72b6('0x17')]);}else{logger[_0x72b6('0x10')](_0x72b6('0x16'),_0x392a3a,_0x72b6('0x13'));_0x1a7a0f(_0x6774f2[_0x72b6('0x18')][_0x72b6('0x17')]);}})[_0x72b6('0x19')](function(_0x152966){logger['error'](_0x72b6('0x16'),_0x392a3a,_0x152966);_0x5e8376(_0x152966);});});}exports['UpdateMailInteraction']=function(_0x141fe2){var _0x3c8d3e=this;return new Promise(function(_0x1735cd,_0x55367f){return db[_0x72b6('0x1a')]['update'](_0x141fe2[_0x72b6('0x1b')],{'raw':_0x141fe2[_0x72b6('0x1c')]?_0x141fe2[_0x72b6('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x141fe2[_0x72b6('0x1c')]?_0x141fe2[_0x72b6('0x1c')][_0x72b6('0x1d')]||null:null,'attributes':_0x141fe2['options']?_0x141fe2['options'][_0x72b6('0x1e')]||null:null,'limit':_0x141fe2['options']?_0x141fe2[_0x72b6('0x1c')][_0x72b6('0x1f')]||null:null})[_0x72b6('0xf')](function(_0x44ee5b){logger['info'](_0x72b6('0x20'),_0x141fe2);logger[_0x72b6('0x11')]('UpdateMailInteraction',_0x141fe2,JSON[_0x72b6('0x14')](_0x44ee5b));_0x1735cd(_0x44ee5b);})[_0x72b6('0x19')](function(_0x590a97){logger['error']('UpdateMailInteraction',_0x590a97[_0x72b6('0x17')],_0x141fe2);_0x55367f(_0x3c8d3e['error'](0x1f4,_0x590a97[_0x72b6('0x17')]));});});};exports[_0x72b6('0x21')]=function(_0x58afe5){return new Promise(function(_0x22a3d3,_0x5a8cc4){return db[_0x72b6('0x1a')]['find']({'where':_0x58afe5[_0x72b6('0x1c')]?_0x58afe5['options']['where']||null:null})[_0x72b6('0xf')](function(_0x452ba9){if(_0x452ba9){return _0x452ba9['addTags'](_0x58afe5['body'][_0x72b6('0x22')],_[_0x72b6('0x23')](_0x58afe5[_0x72b6('0x1b')],[_0x72b6('0x22'),'id'])||{});}})['spread'](function(_0x7a0d5){logger[_0x72b6('0x10')](_0x72b6('0x24'),_0x58afe5);logger[_0x72b6('0x11')]('AddTags',_0x58afe5,JSON[_0x72b6('0x14')](_0x7a0d5));_0x22a3d3(_0x7a0d5);})[_0x72b6('0x19')](function(_0x57af31){logger[_0x72b6('0x15')]('AddTags',_0x57af31[_0x72b6('0x17')],_0x58afe5);_0x5a8cc4(_this[_0x72b6('0x15')](0x1f4,_0x57af31[_0x72b6('0x17')]));});});}; \ No newline at end of file +var _0xb067=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','find','ids','omit','AddTags','stringify','util','moment'];(function(_0x35760b,_0x223d79){var _0x1c80c9=function(_0x147755){while(--_0x147755){_0x35760b['push'](_0x35760b['shift']());}};_0x1c80c9(++_0x223d79);}(_0xb067,0xc1));var _0x7b06=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb067[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7b06('0x0'));var moment=require(_0x7b06('0x1'));var BPromise=require(_0x7b06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b06('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b06('0x4'));var logger=require(_0x7b06('0x5'))(_0x7b06('0x6'));var config=require(_0x7b06('0x7'));var jayson=require(_0x7b06('0x8'));var client=jayson[_0x7b06('0x9')][_0x7b06('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7b06('0xb'))(new Redis(config[_0x7b06('0xc')]));require(_0x7b06('0xd'))[_0x7b06('0xe')](socket);function respondWithRpcPromise(_0x57f959,_0x54d12f,_0x13d5b1){return new BPromise(function(_0xea7f2c,_0x6ea271){return client[_0x7b06('0xf')](_0x57f959,_0x13d5b1)[_0x7b06('0x10')](function(_0x3d88c8){logger[_0x7b06('0x11')](_0x7b06('0x12'),_0x54d12f,'request\x20sent');logger[_0x7b06('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x54d12f,_0x7b06('0x14'),JSON['stringify'](_0x3d88c8));if(_0x3d88c8[_0x7b06('0x15')]){if(_0x3d88c8[_0x7b06('0x15')]['code']===0x1f4){logger[_0x7b06('0x15')](_0x7b06('0x12'),_0x54d12f,_0x3d88c8['error'][_0x7b06('0x16')]);return _0x6ea271(_0x3d88c8[_0x7b06('0x15')][_0x7b06('0x16')]);}logger[_0x7b06('0x15')]('MailInteraction,\x20%s,\x20%s',_0x54d12f,_0x3d88c8['error']['message']);return _0xea7f2c(_0x3d88c8['error'][_0x7b06('0x16')]);}else{logger[_0x7b06('0x11')](_0x7b06('0x12'),_0x54d12f,'request\x20sent');_0xea7f2c(_0x3d88c8[_0x7b06('0x17')][_0x7b06('0x16')]);}})[_0x7b06('0x18')](function(_0x248cff){logger[_0x7b06('0x15')](_0x7b06('0x12'),_0x54d12f,_0x248cff);_0x6ea271(_0x248cff);});});}exports[_0x7b06('0x19')]=function(_0x212399){var _0xcfb188=this;return new Promise(function(_0x40cbd8,_0x2cdb46){return db[_0x7b06('0x1a')][_0x7b06('0x1b')](_0x212399[_0x7b06('0x1c')],{'raw':_0x212399[_0x7b06('0x1d')]?_0x212399[_0x7b06('0x1d')][_0x7b06('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212399[_0x7b06('0x1d')]?_0x212399[_0x7b06('0x1d')][_0x7b06('0x1f')]||null:null,'attributes':_0x212399[_0x7b06('0x1d')]?_0x212399['options'][_0x7b06('0x20')]||null:null,'limit':_0x212399[_0x7b06('0x1d')]?_0x212399[_0x7b06('0x1d')][_0x7b06('0x21')]||null:null})[_0x7b06('0x10')](function(_0x36f912){logger[_0x7b06('0x11')](_0x7b06('0x19'),_0x212399);logger[_0x7b06('0x13')]('UpdateMailInteraction',_0x212399,JSON['stringify'](_0x36f912));_0x40cbd8(_0x36f912);})[_0x7b06('0x18')](function(_0xde2909){logger[_0x7b06('0x15')](_0x7b06('0x19'),_0xde2909['message'],_0x212399);_0x2cdb46(_0xcfb188[_0x7b06('0x15')](0x1f4,_0xde2909['message']));});});};exports['AddTagsToMailInteraction']=function(_0x51441f){return new Promise(function(_0x3fe7e7,_0x25b619){return db[_0x7b06('0x1a')][_0x7b06('0x22')]({'where':_0x51441f['options']?_0x51441f[_0x7b06('0x1d')][_0x7b06('0x1f')]||null:null})['then'](function(_0x1a1311){if(_0x1a1311){return _0x1a1311['addTags'](_0x51441f[_0x7b06('0x1c')][_0x7b06('0x23')],_[_0x7b06('0x24')](_0x51441f[_0x7b06('0x1c')],[_0x7b06('0x23'),'id'])||{});}})['spread'](function(_0x250ee8){logger[_0x7b06('0x11')](_0x7b06('0x25'),_0x51441f);logger[_0x7b06('0x13')](_0x7b06('0x25'),_0x51441f,JSON[_0x7b06('0x26')](_0x250ee8));_0x3fe7e7(_0x250ee8);})[_0x7b06('0x18')](function(_0xc9b0a){logger['error']('AddTags',_0xc9b0a[_0x7b06('0x16')],_0x51441f);_0x25b619(_this[_0x7b06('0x15')](0x1f4,_0xc9b0a[_0x7b06('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 4271920..9cb0960 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 _0x5b46=['remove','update','removeListener','register','length','./mailInteraction.events'];(function(_0xb04a0,_0x1c28ed){var _0x294fe4=function(_0x37d8cf){while(--_0x37d8cf){_0xb04a0['push'](_0xb04a0['shift']());}};_0x294fe4(++_0x1c28ed);}(_0x5b46,0x17f));var _0x65b4=function(_0x2261b4,_0x266c4f){_0x2261b4=_0x2261b4-0x0;var _0x2f5298=_0x5b46[_0x2261b4];return _0x2f5298;};'use strict';var MailInteractionEvents=require(_0x65b4('0x0'));var events=['save',_0x65b4('0x1'),_0x65b4('0x2')];function createListener(_0x319272,_0x58cab6){return function(_0x587e32){_0x58cab6['emit'](_0x319272,_0x587e32);};}function removeListener(_0x2a47f5,_0x1993f2){return function(){MailInteractionEvents[_0x65b4('0x3')](_0x2a47f5,_0x1993f2);};}exports[_0x65b4('0x4')]=function(_0x37ae24){for(var _0x149aad=0x0,_0x353482=events[_0x65b4('0x5')];_0x149aad<_0x353482;_0x149aad++){var _0x50f40a=events[_0x149aad];var _0x1e041b=createListener('mailInteraction:'+_0x50f40a,_0x37ae24);MailInteractionEvents['on'](_0x50f40a,_0x1e041b);}}; \ No newline at end of file +var _0x041c=['save','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x25af3a,_0x4b9989){var _0x1d012b=function(_0x2b8d14){while(--_0x2b8d14){_0x25af3a['push'](_0x25af3a['shift']());}};_0x1d012b(++_0x4b9989);}(_0x041c,0x188));var _0xc041=function(_0x5397e,_0x514a17){_0x5397e=_0x5397e-0x0;var _0x5a4805=_0x041c[_0x5397e];return _0x5a4805;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xc041('0x0'),'remove',_0xc041('0x1')];function createListener(_0x36d482,_0x3da57a){return function(_0x17e838){_0x3da57a[_0xc041('0x2')](_0x36d482,_0x17e838);};}function removeListener(_0x18b7b6,_0x2a7b0f){return function(){MailInteractionEvents[_0xc041('0x3')](_0x18b7b6,_0x2a7b0f);};}exports[_0xc041('0x4')]=function(_0x3d68c6){for(var _0x1a29bf=0x0,_0x27dd84=events[_0xc041('0x5')];_0x1a29bf<_0x27dd84;_0x1a29bf++){var _0x276336=events[_0x1a29bf];var _0x4c4137=createListener(_0xc041('0x6')+_0x276336,_0x3d68c6);MailInteractionEvents['on'](_0x276336,_0x4c4137);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1fc8b6e..c881066 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 _0xf9b2=['get','isAuthenticated','index','/describe','/:id','download','post','tracked','mail','create','put','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','./mailMessage.controller'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0xf9b2,0x9a));var _0x2f9b=function(_0x7c5478,_0xe4ac40){_0x7c5478=_0x7c5478-0x0;var _0x555362=_0xf9b2[_0x7c5478];return _0x555362;};'use strict';var multer=require(_0x2f9b('0x0'));var util=require(_0x2f9b('0x1'));var path=require(_0x2f9b('0x2'));var timeout=require(_0x2f9b('0x3'));var express=require('express');var router=express[_0x2f9b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f9b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f9b('0x6'));router[_0x2f9b('0x7')]('/',auth[_0x2f9b('0x8')](),controller[_0x2f9b('0x9')]);router[_0x2f9b('0x7')](_0x2f9b('0xa'),auth[_0x2f9b('0x8')](),controller['describe']);router[_0x2f9b('0x7')](_0x2f9b('0xb'),auth[_0x2f9b('0x8')](),controller['show']);router[_0x2f9b('0x7')]('/:id/download',auth[_0x2f9b('0x8')](),controller[_0x2f9b('0xc')]);router[_0x2f9b('0xd')]('/',auth[_0x2f9b('0x8')](),interaction[_0x2f9b('0xe')](_0x2f9b('0xf'),'mailmessage:create'),controller[_0x2f9b('0x10')]);router[_0x2f9b('0x11')](_0x2f9b('0xb'),auth[_0x2f9b('0x8')](),controller['update']);router[_0x2f9b('0x11')](_0x2f9b('0x12'),auth['isAuthenticated'](),controller[_0x2f9b('0x13')]);router[_0x2f9b('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0x2f9b('0x14')]);router[_0x2f9b('0x15')](_0x2f9b('0xb'),auth[_0x2f9b('0x8')](),controller[_0x2f9b('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3526=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','util'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x3526,0x1db));var _0x6352=function(_0x3c403f,_0xba44a9){_0x3c403f=_0x3c403f-0x0;var _0x1c4515=_0x3526[_0x3c403f];return _0x1c4515;};'use strict';var multer=require('multer');var util=require(_0x6352('0x0'));var path=require(_0x6352('0x1'));var timeout=require(_0x6352('0x2'));var express=require(_0x6352('0x3'));var router=express[_0x6352('0x4')]();var fs_extra=require(_0x6352('0x5'));var auth=require(_0x6352('0x6'));var interaction=require(_0x6352('0x7'));var config=require(_0x6352('0x8'));var controller=require(_0x6352('0x9'));router[_0x6352('0xa')]('/',auth[_0x6352('0xb')](),controller[_0x6352('0xc')]);router[_0x6352('0xa')](_0x6352('0xd'),auth[_0x6352('0xb')](),controller[_0x6352('0xe')]);router[_0x6352('0xa')](_0x6352('0xf'),auth[_0x6352('0xb')](),controller['show']);router[_0x6352('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x6352('0xb')](),interaction[_0x6352('0x10')](_0x6352('0x11'),_0x6352('0x12')),controller[_0x6352('0x13')]);router[_0x6352('0x14')]('/:id',auth[_0x6352('0xb')](),controller[_0x6352('0x15')]);router[_0x6352('0x14')](_0x6352('0x16'),auth[_0x6352('0xb')](),controller[_0x6352('0x17')]);router['put']('/:id/reject',auth[_0x6352('0xb')](),controller[_0x6352('0x18')]);router[_0x6352('0x19')]('/:id',auth[_0x6352('0xb')](),controller[_0x6352('0x1a')]);module[_0x6352('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 5019784..35a5791 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 _0xfc0c=['out','STRING','TEXT','INTEGER','DATE','Email','Chat','lodash','exports','long','BOOLEAN','ENUM'];(function(_0x2a6228,_0x3ba119){var _0x2c8082=function(_0x1ef5a3){while(--_0x1ef5a3){_0x2a6228['push'](_0x2a6228['shift']());}};_0x2c8082(++_0x3ba119);}(_0xfc0c,0x103));var _0xcfc0=function(_0x51ff39,_0x10f53f){_0x51ff39=_0x51ff39-0x0;var _0x234c8=_0xfc0c[_0x51ff39];return _0x234c8;};'use strict';var Sequelize=require('sequelize');var _=require(_0xcfc0('0x0'));module[_0xcfc0('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcfc0('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xcfc0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcfc0('0x4')]('in',_0xcfc0('0x5')),'defaultValue':_0xcfc0('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcfc0('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcfc0('0x7')](_0xcfc0('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xcfc0('0x2'))},'bcc':{'type':Sequelize[_0xcfc0('0x7')]('long')},'subject':{'type':Sequelize[_0xcfc0('0x7')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xcfc0('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcfc0('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcfc0('0x9')]},'originTo':{'type':Sequelize[_0xcfc0('0x7')](_0xcfc0('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0xcfc0('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0xcfc0('0xa'),_0xcfc0('0xb')),'defaultValue':_0xcfc0('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x07ba=['Email','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE'];(function(_0x121dad,_0x483afc){var _0x4f030a=function(_0x4356f5){while(--_0x4356f5){_0x121dad['push'](_0x121dad['shift']());}};_0x4f030a(++_0x483afc);}(_0x07ba,0x1ba));var _0xa07b=function(_0x5c4f0c,_0x44ed75){_0x5c4f0c=_0x5c4f0c-0x0;var _0x21a349=_0x07ba[_0x5c4f0c];return _0x21a349;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xa07b('0x0')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xa07b('0x1'))},'read':{'type':Sequelize[_0xa07b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa07b('0x3')]('in','out'),'defaultValue':_0xa07b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa07b('0x5')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xa07b('0x6'))},'cc':{'type':Sequelize[_0xa07b('0x0')](_0xa07b('0x6'))},'bcc':{'type':Sequelize['TEXT'](_0xa07b('0x6'))},'subject':{'type':Sequelize[_0xa07b('0x0')]},'sentAt':{'type':Sequelize[_0xa07b('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xa07b('0x0')](_0xa07b('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0xa07b('0x6'))},'originChannel':{'type':Sequelize[_0xa07b('0x3')](_0xa07b('0x8'),'Chat'),'defaultValue':_0xa07b('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e5449e6..e4040ab 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 _0xbf3c=['result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','body','find','params','describe','create','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','channel','fromString','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','motionChannel','event','EventManager','rejectmessage','download','unix','toString','join','root','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x40354f,_0x3aff58){var _0x1d3894=function(_0x4ee9e2){while(--_0x4ee9e2){_0x40354f['push'](_0x40354f['shift']());}};_0x1d3894(++_0x3aff58);}(_0xbf3c,0x7c));var _0xcbf3=function(_0x1f1521,_0x3e753c){_0x1f1521=_0x1f1521-0x0;var _0x199f7d=_0xbf3c[_0x1f1521];return _0x199f7d;};'use strict';var emlformat=require(_0xcbf3('0x0'));var moment=require(_0xcbf3('0x1'));var BPromise=require(_0xcbf3('0x2'));var util=require('util');var path=require(_0xcbf3('0x3'));var fs=require('fs');var _=require(_0xcbf3('0x4'));var Redis=require(_0xcbf3('0x5'));var htmlToText=require(_0xcbf3('0x6'));var qs=require(_0xcbf3('0x7'));var logger=require(_0xcbf3('0x8'))(_0xcbf3('0x9'));var interaction_log=require(_0xcbf3('0x8'))(_0xcbf3('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xcbf3('0xb')]=_[_0xcbf3('0xc')](config[_0xcbf3('0xb')],{'host':_0xcbf3('0xd'),'port':0x18eb});var socket=require(_0xcbf3('0xe'))(new Redis(config[_0xcbf3('0xb')]));var htmlEntities=require(_0xcbf3('0xf'));require('./mailMessage.socket')[_0xcbf3('0x10')](socket);var jayson=require(_0xcbf3('0x11'));var client=jayson[_0xcbf3('0x12')][_0xcbf3('0x13')]({'port':0x232c});var client9003=jayson[_0xcbf3('0x12')]['http']({'port':0x232b});var client9002=jayson[_0xcbf3('0x12')][_0xcbf3('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x2dd149,_0x3c9085,_0x5069cf,_0x58a19a){return new BPromise(function(_0xa864ea,_0x274ee7){var _0x3e7b71=_0x58a19a||client;return _0x3e7b71[_0xcbf3('0x14')](_0x2dd149,_0x5069cf)[_0xcbf3('0x15')](function(_0x915906){logger[_0xcbf3('0x16')](_0xcbf3('0x17'),_0x3c9085,_0xcbf3('0x18'));logger['debug'](_0xcbf3('0x19'),_0x3c9085,_0xcbf3('0x18'),JSON['stringify'](_0x915906));if(_0x915906[_0xcbf3('0x1a')]){if(_0x915906['error'][_0xcbf3('0x1b')]===0x1f4){logger[_0xcbf3('0x1a')](_0xcbf3('0x17'),_0x3c9085,_0x915906['error']['message']);return _0x274ee7(_0x915906[_0xcbf3('0x1a')]['message']);}logger[_0xcbf3('0x1a')]('MailMessage,\x20%s,\x20%s',_0x3c9085,_0x915906[_0xcbf3('0x1a')][_0xcbf3('0x1c')]);return _0xa864ea(_0x915906['error']['message']);}else{logger['info'](_0xcbf3('0x17'),_0x3c9085,_0xcbf3('0x18'));_0xa864ea(_0x915906[_0xcbf3('0x1d')]['message']);}})['catch'](function(_0x386fda){logger[_0xcbf3('0x1a')](_0xcbf3('0x17'),_0x3c9085,_0x386fda);_0x274ee7(_0x386fda);});});}function respondWithResult(_0x53ad08,_0x261ed5){_0x261ed5=_0x261ed5||0xc8;return function(_0x3b3f5a){if(_0x3b3f5a){return _0x53ad08[_0xcbf3('0x1e')](_0x261ed5)[_0xcbf3('0x1f')](_0x3b3f5a);}};}function respondWithFilteredResult(_0x5e75b9,_0xaf14c3){return function(_0x2ba0a7){if(_0x2ba0a7){var _0x24f703=typeof _0xaf14c3[_0xcbf3('0x20')]===_0xcbf3('0x21')&&typeof _0xaf14c3[_0xcbf3('0x22')]===_0xcbf3('0x21');var _0x31a0d2=_0x2ba0a7[_0xcbf3('0x23')];var _0x40238f=_0x24f703?0x0:_0xaf14c3[_0xcbf3('0x20')];var _0x492460=_0x24f703?_0x2ba0a7[_0xcbf3('0x23')]:_0xaf14c3[_0xcbf3('0x20')]+_0xaf14c3[_0xcbf3('0x22')];var _0x5ba881;if(_0x492460>=_0x31a0d2){_0x492460=_0x31a0d2;_0x5ba881=0xc8;}else{_0x5ba881=0xce;}_0x5e75b9['status'](_0x5ba881);return _0x5e75b9[_0xcbf3('0x24')](_0xcbf3('0x25'),_0x40238f+'-'+_0x492460+'/'+_0x31a0d2)[_0xcbf3('0x1f')](_0x2ba0a7);}return null;};}function saveUpdates(_0x3ae45e){return function(_0xf52043){if(_0xf52043){return _0xf52043[_0xcbf3('0x26')](_0x3ae45e)[_0xcbf3('0x15')](function(_0x30825e){return _0x30825e;});}return null;};}function removeEntity(_0xe4f253){return function(_0xc2a32b){if(_0xc2a32b){return _0xc2a32b[_0xcbf3('0x27')]()[_0xcbf3('0x15')](function(){_0xe4f253['status'](0xcc)[_0xcbf3('0x28')]();});}};}function handleEntityNotFound(_0x1c283d){return function(_0x5be5f2){if(!_0x5be5f2){_0x1c283d['sendStatus'](0x194);}return _0x5be5f2;};}function handleError(_0x55febd,_0x51cb9f){_0x51cb9f=_0x51cb9f||0x1f4;return function(_0x5231a9){logger[_0xcbf3('0x1a')](_0x5231a9['stack']);if(_0x5231a9['name']){delete _0x5231a9[_0xcbf3('0x29')];}_0x55febd[_0xcbf3('0x1e')](_0x51cb9f)[_0xcbf3('0x2a')](_0x5231a9);};}exports[_0xcbf3('0x2b')]=function(_0x812f4f,_0x2c905f){var _0x5b60bb={},_0x2e0e11={},_0xd14d06={'count':0x0,'rows':[]};var _0x1bba40=_[_0xcbf3('0x2c')](db[_0xcbf3('0x2d')]['rawAttributes'],function(_0x25d83f){return{'name':_0x25d83f[_0xcbf3('0x2e')],'type':_0x25d83f[_0xcbf3('0x2f')][_0xcbf3('0x30')]};});_0x2e0e11[_0xcbf3('0x31')]=_[_0xcbf3('0x2c')](_0x1bba40,_0xcbf3('0x29'));_0x2e0e11[_0xcbf3('0x32')]=_[_0xcbf3('0x33')](_0x812f4f['query']);_0x2e0e11['filters']=_[_0xcbf3('0x34')](_0x2e0e11['model'],_0x2e0e11[_0xcbf3('0x32')]);_0x5b60bb[_0xcbf3('0x35')]=_[_0xcbf3('0x34')](_0x2e0e11[_0xcbf3('0x31')],qs[_0xcbf3('0x36')](_0x812f4f[_0xcbf3('0x32')][_0xcbf3('0x36')]));_0x5b60bb['attributes']=_0x5b60bb[_0xcbf3('0x35')][_0xcbf3('0x37')]?_0x5b60bb[_0xcbf3('0x35')]:_0x2e0e11[_0xcbf3('0x31')];if(!_0x812f4f[_0xcbf3('0x32')][_0xcbf3('0x38')](_0xcbf3('0x39'))){_0x5b60bb[_0xcbf3('0x22')]=qs[_0xcbf3('0x22')](_0x812f4f[_0xcbf3('0x32')][_0xcbf3('0x22')]);_0x5b60bb[_0xcbf3('0x20')]=qs['offset'](_0x812f4f[_0xcbf3('0x32')][_0xcbf3('0x20')]);}_0x5b60bb['order']=qs['sort'](_0x812f4f[_0xcbf3('0x32')]['sort']);_0x5b60bb['where']=qs[_0xcbf3('0x3a')](_['pick'](_0x812f4f[_0xcbf3('0x32')],_0x2e0e11['filters']),_0x1bba40);if(_0x812f4f[_0xcbf3('0x32')]['filter']){_0x5b60bb[_0xcbf3('0x3b')]=_[_0xcbf3('0x3c')](_0x5b60bb[_0xcbf3('0x3b')],{'$or':_[_0xcbf3('0x2c')](_0x1bba40,function(_0x2118c6){if(_0x2118c6[_0xcbf3('0x2f')]!==_0xcbf3('0x3d')){var _0x5713a2={};_0x5713a2[_0x2118c6[_0xcbf3('0x29')]]={'$like':'%'+_0x812f4f[_0xcbf3('0x32')][_0xcbf3('0x3e')]+'%'};return _0x5713a2;}})});}_0x5b60bb=_[_0xcbf3('0x3c')]({},_0x5b60bb,_0x812f4f[_0xcbf3('0x3f')]);var _0x3459cc={'where':_0x5b60bb[_0xcbf3('0x3b')]};return db['MailMessage'][_0xcbf3('0x23')](_0x3459cc)[_0xcbf3('0x15')](function(_0x69aee8){_0xd14d06[_0xcbf3('0x23')]=_0x69aee8;if(_0x812f4f[_0xcbf3('0x32')][_0xcbf3('0x40')]){_0x5b60bb[_0xcbf3('0x41')]=[{'all':!![]}];}return db[_0xcbf3('0x2d')][_0xcbf3('0x42')](_0x5b60bb);})[_0xcbf3('0x15')](function(_0x2a34f9){_0xd14d06['rows']=_0x2a34f9;return _0xd14d06;})[_0xcbf3('0x15')](respondWithFilteredResult(_0x2c905f,_0x5b60bb))[_0xcbf3('0x43')](handleError(_0x2c905f,null));};exports['show']=function(_0x39a378,_0x72fa27){var _0x33a820={'raw':!![],'where':{'id':_0x39a378['params']['id']}},_0x1d4c5e={};_0x1d4c5e[_0xcbf3('0x31')]=_[_0xcbf3('0x33')](db['MailMessage']['rawAttributes']);_0x1d4c5e[_0xcbf3('0x32')]=_['keys'](_0x39a378[_0xcbf3('0x32')]);_0x1d4c5e['filters']=_[_0xcbf3('0x34')](_0x1d4c5e['model'],_0x1d4c5e[_0xcbf3('0x32')]);_0x33a820[_0xcbf3('0x35')]=_[_0xcbf3('0x34')](_0x1d4c5e['model'],qs[_0xcbf3('0x36')](_0x39a378[_0xcbf3('0x32')][_0xcbf3('0x36')]));_0x33a820[_0xcbf3('0x35')]=_0x33a820[_0xcbf3('0x35')][_0xcbf3('0x37')]?_0x33a820['attributes']:_0x1d4c5e[_0xcbf3('0x31')];if(_0x39a378[_0xcbf3('0x32')][_0xcbf3('0x40')]){_0x33a820[_0xcbf3('0x41')]=[{'all':!![]}];}_0x33a820=_[_0xcbf3('0x3c')]({},_0x33a820,_0x39a378[_0xcbf3('0x3f')]);return db[_0xcbf3('0x2d')]['find'](_0x33a820)[_0xcbf3('0x15')](handleEntityNotFound(_0x72fa27,null))[_0xcbf3('0x15')](respondWithResult(_0x72fa27,null))['catch'](handleError(_0x72fa27,null));};exports[_0xcbf3('0x26')]=function(_0x396e83,_0x15b0d9){if(_0x396e83[_0xcbf3('0x44')]['id']){delete _0x396e83['body']['id'];}return db[_0xcbf3('0x2d')][_0xcbf3('0x45')]({'where':{'id':_0x396e83[_0xcbf3('0x46')]['id']}})[_0xcbf3('0x15')](handleEntityNotFound(_0x15b0d9,null))[_0xcbf3('0x15')](saveUpdates(_0x396e83['body'],null))[_0xcbf3('0x15')](respondWithResult(_0x15b0d9,null))[_0xcbf3('0x43')](handleError(_0x15b0d9,null));};exports[_0xcbf3('0x27')]=function(_0x38f82e,_0x28474e){return db[_0xcbf3('0x2d')][_0xcbf3('0x45')]({'where':{'id':_0x38f82e[_0xcbf3('0x46')]['id']}})[_0xcbf3('0x15')](handleEntityNotFound(_0x28474e,null))['then'](removeEntity(_0x28474e,null))['catch'](handleError(_0x28474e,null));};exports[_0xcbf3('0x47')]=function(_0x148489,_0x4af485){return db[_0xcbf3('0x2d')][_0xcbf3('0x47')]()['then'](respondWithResult(_0x4af485,null))[_0xcbf3('0x43')](handleError(_0x4af485,null));};exports[_0xcbf3('0x48')]=function(_0x3ab1c6,_0x4b025e){return db[_0xcbf3('0x2d')][_0xcbf3('0x48')](_0x3ab1c6[_0xcbf3('0x44')])['then'](function(_0x411598){if(_0x411598){if(_0x411598['direction']===_0xcbf3('0x49')&&!_0x411598['secret']){var _0x2585ff,_0x9cf445,_0x5ce6f2;if(_0x3ab1c6[_0xcbf3('0x44')]['to']){_0x9cf445=_0x3ab1c6[_0xcbf3('0x44')]['to'][_0xcbf3('0x4a')](',')[0x0];}return db[_0xcbf3('0x4b')][_0xcbf3('0x4c')]({'where':{'id':_0x411598[_0xcbf3('0x4d')]},'include':[{'model':db[_0xcbf3('0x4e')],'as':_0xcbf3('0x4f'),'include':[{'model':db[_0xcbf3('0x50')],'as':'Contacts','where':{'email':_0x9cf445},'limit':0x1,'order':[[_0xcbf3('0x51'),'DESC']]}]},{'model':db[_0xcbf3('0x52')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xcbf3('0x53')],'as':_0xcbf3('0x53'),'raw':!![]}]}]})[_0xcbf3('0x15')](function(_0x3dfdcb){_0x2585ff=_0x3dfdcb;if(!_0x2585ff||!_0x2585ff[_0xcbf3('0x54')])return;var _0x36b3de=_0x2585ff[_0xcbf3('0x55')]();if(_0x3ab1c6['body'][_0xcbf3('0x56')]&&_0x3ab1c6[_0xcbf3('0x44')][_0xcbf3('0x56')][_0xcbf3('0x37')]){for(var _0x1a507d=0x0;_0x1a507d<_0x3ab1c6['body']['attachments'][_0xcbf3('0x37')];_0x1a507d+=0x1){_0x3ab1c6[_0xcbf3('0x44')]['attachments'][_0x1a507d]={'filename':_0x3ab1c6[_0xcbf3('0x44')]['attachments'][_0x1a507d][_0xcbf3('0x29')],'path':path['join'](config['root'],_0xcbf3('0x57'),_0x3ab1c6[_0xcbf3('0x44')][_0xcbf3('0x56')][_0x1a507d][_0xcbf3('0x58')])};}}_0x5ce6f2={'account':_0x36b3de,'message':_0x3ab1c6['body']};return;})[_0xcbf3('0x15')](function(){if(_0x2585ff[_0xcbf3('0x4f')]){if(_0x2585ff[_0xcbf3('0x4f')][_0xcbf3('0x59')][_0xcbf3('0x37')]){return _0x2585ff[_0xcbf3('0x4f')][_0xcbf3('0x59')][0x0];}else{return db['CmContact'][_0xcbf3('0x48')](_[_0xcbf3('0xc')](_0x3ab1c6[_0xcbf3('0x44')],{'firstName':_0x3ab1c6[_0xcbf3('0x44')]['to'],'email':_0x3ab1c6[_0xcbf3('0x44')]['to'],'phone':_0x3ab1c6[_0xcbf3('0x44')]['to'],'ListId':_0x2585ff[_0xcbf3('0x5a')]}));}}else{throw new Error(_0xcbf3('0x5b'));}})[_0xcbf3('0x15')](function(){if(_0x5ce6f2){return respondWithRpcPromise('SendMail','sendMail',_0x5ce6f2,client9003)[_0xcbf3('0x15')](function(_0x30b1a9){return _0x411598[_0xcbf3('0x26')]({'read':!![],'messageId':_0x30b1a9[_0xcbf3('0x5c')],'sentAt':moment()[_0xcbf3('0x5d')](_0xcbf3('0x5e'))});})[_0xcbf3('0x43')](function(_0x998165){logger['error']('%s',JSON[_0xcbf3('0x5f')](_0x998165));return _0x411598;});}return _0x411598;});}return _0x411598;}})[_0xcbf3('0x15')](respondWithResult(_0x4b025e,0xc9))[_0xcbf3('0x43')](handleError(_0x4b025e,null));};exports['accept']=function(_0x5389bb,_0x38d9f7){var _0x2f7333={'agent':{},'channel':'mail'};if(_0x5389bb['body']['id']){delete _0x5389bb[_0xcbf3('0x44')]['id'];}_0x5389bb[_0xcbf3('0x44')][_0xcbf3('0x60')]=!![];_0x5389bb['body'][_0xcbf3('0x61')]=moment()[_0xcbf3('0x5d')](_0xcbf3('0x5e'));_0x5389bb[_0xcbf3('0x44')][_0xcbf3('0x62')]=_0x5389bb['body']['UserId']||_0x5389bb[_0xcbf3('0x63')]['id'];_0x2f7333[_0xcbf3('0x64')]['id']=_0x5389bb['body']['UserId'];return db[_0xcbf3('0x2d')][_0xcbf3('0x45')]({'where':{'id':_0x5389bb[_0xcbf3('0x46')]['id'],'UserId':null}})[_0xcbf3('0x15')](handleEntityNotFound(_0x38d9f7,null))['then'](saveUpdates(_0x5389bb[_0xcbf3('0x44')],null))['then'](function(_0x58f331){if(_0x58f331){_0x2f7333['message']=_0x58f331[_0xcbf3('0x65')]({'plain':!![]});return db[_0xcbf3('0x66')]['find']({'where':{'id':_0x58f331[_0xcbf3('0x67')]}});}return null;})[_0xcbf3('0x15')](handleEntityNotFound(_0x38d9f7,null))[_0xcbf3('0x15')](function(_0x5713ff){if(_0x5713ff){return _0x5713ff['update']({'UserId':_0x5389bb['body']['UserId'],'read1stAt':_['isNil'](_0x5713ff[_0xcbf3('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcbf3('0x15')](function(_0x40af24){if(_0x40af24){_0x2f7333['interaction']=_0x40af24[_0xcbf3('0x65')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5389bb[_0xcbf3('0x63')]['id'],_0x5389bb[_0xcbf3('0x63')][_0xcbf3('0x29')],_0x5389bb[_0xcbf3('0x63')]['role'],_0x2f7333[_0xcbf3('0x69')]['id'],_0x5389bb[_0xcbf3('0x44')]?JSON[_0xcbf3('0x5f')](_0x5389bb[_0xcbf3('0x44')]):_0xcbf3('0x6a'));return respondWithRpcPromise(_0xcbf3('0x6b'),_0xcbf3('0x6c'),_0x2f7333);}return null;})[_0xcbf3('0x15')](function(_0x52a6ec){var _0x12c2e0=_0xcbf3('0x6d')+_0x52a6ec['message']['ContactId'];return db[_0xcbf3('0x6e')][_0xcbf3('0x32')](_0x12c2e0,{'type':db['Sequelize'][_0xcbf3('0x6f')]['SELECT'],'raw':!![]})[_0xcbf3('0x15')](function(_0x183606){return _0x183606;});})[_0xcbf3('0x15')](function(_0x5574f3){if(_0x5574f3){_0x2f7333[_0xcbf3('0x1c')][_0xcbf3('0x70')]=_0x5574f3[0x0];if(!_0x5389bb[_0xcbf3('0x44')]['UserId'])return;return db['User'][_0xcbf3('0x45')]({'where':{'id':_0x5389bb[_0xcbf3('0x44')][_0xcbf3('0x62')],'role':_0xcbf3('0x64')},'attributes':['id',_0xcbf3('0x29'),_0xcbf3('0x71'),_0xcbf3('0x72'),_0xcbf3('0x73')],'raw':!![]});}return null;})['then'](function(_0x435746){if(!_0x435746)return null;_0x2f7333[_0xcbf3('0x1c')][_0xcbf3('0x64')]=_0x435746;return _0x2f7333;})[_0xcbf3('0x15')](function(_0x4b3c74){if(_0x4b3c74){if(_0x5389bb[_0xcbf3('0x44')][_0xcbf3('0x74')]){_0x2f7333['message'][_0xcbf3('0x75')]=util[_0xcbf3('0x5d')]('SIP/%s',_0x5389bb[_0xcbf3('0x63')][_0xcbf3('0x29')]);_0x2f7333[_0xcbf3('0x1c')][_0xcbf3('0x76')]=_0x2f7333[_0xcbf3('0x76')];_0x2f7333[_0xcbf3('0x1c')]['motionChannel']=_0x2f7333[_0xcbf3('0x76')];_0x2f7333[_0xcbf3('0x1c')]['event']='accept';_0x2f7333['message'][_0xcbf3('0x44')]=htmlToText[_0xcbf3('0x77')](_0x2f7333[_0xcbf3('0x1c')][_0xcbf3('0x44')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xcbf3('0x78'),'message':_0x2f7333[_0xcbf3('0x1c')]},client9002)['then'](function(){return _0x2f7333;});}return _0x2f7333;}return null;})[_0xcbf3('0x15')](respondWithResult(_0x38d9f7,null))['catch'](handleError(_0x38d9f7,null));};exports[_0xcbf3('0x79')]=function(_0x5812f1,_0x1fe0d8){var _0x1dfad={'agent':{},'channel':_0xcbf3('0x7a')};if(_0x5812f1[_0xcbf3('0x44')]['id']){delete _0x5812f1[_0xcbf3('0x44')]['id'];}_0x5812f1[_0xcbf3('0x44')][_0xcbf3('0x62')]=_0x5812f1['body'][_0xcbf3('0x62')]||_0x5812f1[_0xcbf3('0x63')]['id'];_0x1dfad[_0xcbf3('0x64')]['id']=_0x5812f1[_0xcbf3('0x44')][_0xcbf3('0x62')];return db['MailMessage'][_0xcbf3('0x45')]({'where':{'id':_0x5812f1[_0xcbf3('0x46')]['id'],'UserId':null}})[_0xcbf3('0x15')](handleEntityNotFound(_0x1fe0d8,null))[_0xcbf3('0x15')](function(_0x1e3ab9){if(_0x1e3ab9){_0x1dfad['message']=_0x1e3ab9[_0xcbf3('0x65')]({'plain':!![]});return db['MailInteraction'][_0xcbf3('0x45')]({'where':{'id':_0x1e3ab9[_0xcbf3('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1fe0d8,null))[_0xcbf3('0x15')](function(_0x117583){if(_0x117583){_0x1dfad[_0xcbf3('0x69')]=_0x117583[_0xcbf3('0x65')]({'plain':!![]});interaction_log[_0xcbf3('0x16')](_0xcbf3('0x7b'),_0x5812f1[_0xcbf3('0x63')]['id'],_0x5812f1[_0xcbf3('0x63')][_0xcbf3('0x29')],_0x5812f1['user']['role'],_0x1dfad['interaction']['id'],_0x5812f1[_0xcbf3('0x44')]?JSON[_0xcbf3('0x5f')](_0x5812f1[_0xcbf3('0x44')]):_0xcbf3('0x6a'));return respondWithRpcPromise(_0xcbf3('0x7c'),_0xcbf3('0x7d'),_0x1dfad);}return null;})[_0xcbf3('0x15')](function(_0x186db2){var _0x4b58d5=_0xcbf3('0x6d')+_0x186db2[_0xcbf3('0x1c')]['ContactId'];return db[_0xcbf3('0x6e')][_0xcbf3('0x32')](_0x4b58d5,{'type':db['Sequelize']['QueryTypes'][_0xcbf3('0x7e')],'raw':!![]})[_0xcbf3('0x15')](function(_0x437a2e){return _0x437a2e;});})['then'](function(_0x387c8f){if(_0x387c8f){_0x1dfad['message'][_0xcbf3('0x70')]=_0x387c8f[0x0];if(!_0x5812f1[_0xcbf3('0x44')][_0xcbf3('0x62')])return;return db['User'][_0xcbf3('0x45')]({'where':{'id':_0x5812f1['body']['UserId'],'role':_0xcbf3('0x64')},'attributes':['id',_0xcbf3('0x29'),_0xcbf3('0x71'),_0xcbf3('0x72'),_0xcbf3('0x73')],'raw':!![]});}return null;})[_0xcbf3('0x15')](function(_0x2cc76e){if(!_0x2cc76e)return null;_0x1dfad[_0xcbf3('0x1c')][_0xcbf3('0x64')]=_0x2cc76e;return _0x1dfad;})[_0xcbf3('0x15')](function(_0x5ab03e){if(_0x5ab03e){_0x5ab03e[_0xcbf3('0x1c')]['interface']=util[_0xcbf3('0x5d')]('SIP/%s',_0x5812f1['user']['name']);_0x5ab03e[_0xcbf3('0x1c')]['channel']=_0x1dfad[_0xcbf3('0x76')];_0x5ab03e[_0xcbf3('0x1c')][_0xcbf3('0x7f')]=_0x1dfad[_0xcbf3('0x76')];_0x5ab03e[_0xcbf3('0x1c')][_0xcbf3('0x80')]=_0xcbf3('0x79');_0x5ab03e['message'][_0xcbf3('0x44')]=htmlToText[_0xcbf3('0x77')](_0x1dfad[_0xcbf3('0x1c')][_0xcbf3('0x44')]);respondWithRpcPromise(_0xcbf3('0x81'),_0xcbf3('0x81'),{'event':_0xcbf3('0x82'),'message':_0x5ab03e['message']},client9002);return _0x1dfad;}return null;})[_0xcbf3('0x15')](respondWithResult(_0x1fe0d8,null))[_0xcbf3('0x43')](handleError(_0x1fe0d8,null));};exports[_0xcbf3('0x83')]=function(_0x313793,_0x490aa1){var _0x356ae6=moment()[_0xcbf3('0x84')]()[_0xcbf3('0x85')]();var _0x4a35aa=path[_0xcbf3('0x86')](config[_0xcbf3('0x87')],'server',_0xcbf3('0x88'),_0xcbf3('0x89'));var _0x27e905=path['join'](config['root'],'server',_0xcbf3('0x88'),'attachments');var _0x5cd29d=util[_0xcbf3('0x5d')](_0xcbf3('0x8a'),_0x356ae6);return db[_0xcbf3('0x2d')][_0xcbf3('0x45')]({'where':{'id':_0x313793['params']['id']},'attributes':['id',_0xcbf3('0x44'),_0xcbf3('0x8b'),'to','cc',_0xcbf3('0x8c'),_0xcbf3('0x8d'),_0xcbf3('0x8e')],'include':_0x313793[_0xcbf3('0x32')][_0xcbf3('0x56')]?[{'model':db[_0xcbf3('0x8f')],'as':_0xcbf3('0x90')}]:undefined})[_0xcbf3('0x15')](handleEntityNotFound(_0x490aa1,null))[_0xcbf3('0x15')](function(_0x436814){if(_0x436814){var _0x4f4fbc=_0x436814;var _0x4a0578={'from':_0x4f4fbc[_0xcbf3('0x8b')],'to':_0x4f4fbc['to'],'subject':_0x4f4fbc[_0xcbf3('0x8d')],'html':htmlEntities[_0xcbf3('0x91')](_0x4f4fbc['body']),'headers':{'Date':moment(_0x4f4fbc['createdAt'])[_0xcbf3('0x5d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x436814['cc']){_0x4a0578[_0xcbf3('0x92')]['Cc']=_0x436814['cc'];}if(_0x436814[_0xcbf3('0x8c')]){_0x4a0578[_0xcbf3('0x92')][_0xcbf3('0x93')]=_0x436814[_0xcbf3('0x8c')];}return new BPromise(function(_0x5e2f14,_0x1f7214){if(_0x436814['Attachments']){for(var _0x5dc6b7=0x0;_0x5dc6b7<_0x436814[_0xcbf3('0x90')][_0xcbf3('0x37')];_0x5dc6b7++){var _0x25f77f=_0x436814[_0xcbf3('0x90')][_0x5dc6b7];var _0x174e80=path[_0xcbf3('0x86')](_0x27e905,_0x25f77f[_0xcbf3('0x58')]);if(fs[_0xcbf3('0x94')](_0x174e80)){_0x4a0578[_0xcbf3('0x56')][_0xcbf3('0x95')]({'name':_0x25f77f[_0xcbf3('0x29')],'contentType':_0x25f77f[_0xcbf3('0x2f')],'data':fs[_0xcbf3('0x96')](_0x174e80)});}}}emlformat[_0xcbf3('0x97')](_0x4a0578,function(_0x1e53c3,_0x494774){if(_0x1e53c3)return _0x1f7214(_0x1e53c3);fs['writeFileSync'](path['join'](_0x4a35aa,_0x5cd29d),_0x494774);return _0x5e2f14(_0x494774);});});}})[_0xcbf3('0x15')](function(_0xb5314c){if(_0xb5314c){return _0x490aa1[_0xcbf3('0x83')](path[_0xcbf3('0x86')](_0x4a35aa,_0x5cd29d),_0x5cd29d,function(_0x3f4244){if(!_0x3f4244)fs[_0xcbf3('0x98')](path['join'](_0x4a35aa,_0x5cd29d));});}})[_0xcbf3('0x43')](handleError(_0x490aa1,null));}; \ No newline at end of file +var _0xfe44=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','find','body','destroy','describe','create','out','secret','split','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','readAt','format','UserId','user','agent','get','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','User','fullname','email','manual','interface','channel','motionChannel','event','fromString','EventManager','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','Sequelize','QueryTypes','internal','reject','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','register','client','http','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','status','json','offset','limit','count','set','Content-Range','update','end','sendStatus','stack','name','index','map','MailMessage'];(function(_0x3ec4d9,_0x1090e3){var _0x34df0f=function(_0x3e5444){while(--_0x3e5444){_0x3ec4d9['push'](_0x3ec4d9['shift']());}};_0x34df0f(++_0x1090e3);}(_0xfe44,0x105));var _0x4fe4=function(_0x3f618b,_0x33e91a){_0x3f618b=_0x3f618b-0x0;var _0x752c51=_0xfe44[_0x3f618b];return _0x752c51;};'use strict';var emlformat=require(_0x4fe4('0x0'));var moment=require('moment');var BPromise=require(_0x4fe4('0x1'));var util=require(_0x4fe4('0x2'));var path=require(_0x4fe4('0x3'));var fs=require('fs');var _=require(_0x4fe4('0x4'));var Redis=require(_0x4fe4('0x5'));var htmlToText=require(_0x4fe4('0x6'));var qs=require(_0x4fe4('0x7'));var logger=require(_0x4fe4('0x8'))('api');var interaction_log=require(_0x4fe4('0x8'))(_0x4fe4('0x9'));var config=require(_0x4fe4('0xa'));var db=require(_0x4fe4('0xb'))['db'];config['redis']=_[_0x4fe4('0xc')](config[_0x4fe4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4fe4('0xe'))(new Redis(config[_0x4fe4('0xd')]));var htmlEntities=require('html-entities');require(_0x4fe4('0xf'))[_0x4fe4('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4fe4('0x11')][_0x4fe4('0x12')]({'port':0x232c});var client9003=jayson['client'][_0x4fe4('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x4fe4('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x4ce298,_0x48087e,_0xc17f98,_0x440570){return new BPromise(function(_0x35eafe,_0x386cfb){var _0x3c4a8e=_0x440570||client;return _0x3c4a8e['request'](_0x4ce298,_0xc17f98)[_0x4fe4('0x13')](function(_0xbcd9f6){logger['info'](_0x4fe4('0x14'),_0x48087e,'request\x20sent');logger[_0x4fe4('0x15')](_0x4fe4('0x16'),_0x48087e,_0x4fe4('0x17'),JSON[_0x4fe4('0x18')](_0xbcd9f6));if(_0xbcd9f6[_0x4fe4('0x19')]){if(_0xbcd9f6[_0x4fe4('0x19')]['code']===0x1f4){logger[_0x4fe4('0x19')](_0x4fe4('0x14'),_0x48087e,_0xbcd9f6[_0x4fe4('0x19')][_0x4fe4('0x1a')]);return _0x386cfb(_0xbcd9f6[_0x4fe4('0x19')]['message']);}logger[_0x4fe4('0x19')](_0x4fe4('0x14'),_0x48087e,_0xbcd9f6[_0x4fe4('0x19')][_0x4fe4('0x1a')]);return _0x35eafe(_0xbcd9f6[_0x4fe4('0x19')]['message']);}else{logger[_0x4fe4('0x1b')](_0x4fe4('0x14'),_0x48087e,_0x4fe4('0x17'));_0x35eafe(_0xbcd9f6[_0x4fe4('0x1c')][_0x4fe4('0x1a')]);}})[_0x4fe4('0x1d')](function(_0x3c54de){logger[_0x4fe4('0x19')](_0x4fe4('0x14'),_0x48087e,_0x3c54de);_0x386cfb(_0x3c54de);});});}function respondWithResult(_0x57eb12,_0x3041f2){_0x3041f2=_0x3041f2||0xc8;return function(_0x57ce8c){if(_0x57ce8c){return _0x57eb12[_0x4fe4('0x1e')](_0x3041f2)[_0x4fe4('0x1f')](_0x57ce8c);}};}function respondWithFilteredResult(_0x15e627,_0x4acdb7){return function(_0x515486){if(_0x515486){var _0x108e85=typeof _0x4acdb7[_0x4fe4('0x20')]==='undefined'&&typeof _0x4acdb7[_0x4fe4('0x21')]==='undefined';var _0x20446c=_0x515486[_0x4fe4('0x22')];var _0x4ae0ab=_0x108e85?0x0:_0x4acdb7['offset'];var _0x170369=_0x108e85?_0x515486[_0x4fe4('0x22')]:_0x4acdb7[_0x4fe4('0x20')]+_0x4acdb7[_0x4fe4('0x21')];var _0x585673;if(_0x170369>=_0x20446c){_0x170369=_0x20446c;_0x585673=0xc8;}else{_0x585673=0xce;}_0x15e627[_0x4fe4('0x1e')](_0x585673);return _0x15e627[_0x4fe4('0x23')](_0x4fe4('0x24'),_0x4ae0ab+'-'+_0x170369+'/'+_0x20446c)[_0x4fe4('0x1f')](_0x515486);}return null;};}function saveUpdates(_0x4d2129){return function(_0x57bc36){if(_0x57bc36){return _0x57bc36[_0x4fe4('0x25')](_0x4d2129)[_0x4fe4('0x13')](function(_0x5ec63f){return _0x5ec63f;});}return null;};}function removeEntity(_0xbb4cd7){return function(_0x43c14b){if(_0x43c14b){return _0x43c14b['destroy']()[_0x4fe4('0x13')](function(){_0xbb4cd7[_0x4fe4('0x1e')](0xcc)[_0x4fe4('0x26')]();});}};}function handleEntityNotFound(_0x5a9fcc){return function(_0x450c24){if(!_0x450c24){_0x5a9fcc[_0x4fe4('0x27')](0x194);}return _0x450c24;};}function handleError(_0x3dd744,_0x45fea5){_0x45fea5=_0x45fea5||0x1f4;return function(_0x49411d){logger[_0x4fe4('0x19')](_0x49411d[_0x4fe4('0x28')]);if(_0x49411d[_0x4fe4('0x29')]){delete _0x49411d[_0x4fe4('0x29')];}_0x3dd744[_0x4fe4('0x1e')](_0x45fea5)['send'](_0x49411d);};}exports[_0x4fe4('0x2a')]=function(_0x12aa43,_0x3fe484){var _0x1b3c68={},_0x1c824c={},_0x101d54={'count':0x0,'rows':[]};var _0x52793c=_[_0x4fe4('0x2b')](db[_0x4fe4('0x2c')]['rawAttributes'],function(_0x594ab3){return{'name':_0x594ab3[_0x4fe4('0x2d')],'type':_0x594ab3[_0x4fe4('0x2e')][_0x4fe4('0x2f')]};});_0x1c824c[_0x4fe4('0x30')]=_['map'](_0x52793c,_0x4fe4('0x29'));_0x1c824c[_0x4fe4('0x31')]=_[_0x4fe4('0x32')](_0x12aa43['query']);_0x1c824c[_0x4fe4('0x33')]=_['intersection'](_0x1c824c['model'],_0x1c824c[_0x4fe4('0x31')]);_0x1b3c68['attributes']=_[_0x4fe4('0x34')](_0x1c824c['model'],qs[_0x4fe4('0x35')](_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x35')]));_0x1b3c68[_0x4fe4('0x36')]=_0x1b3c68[_0x4fe4('0x36')][_0x4fe4('0x37')]?_0x1b3c68[_0x4fe4('0x36')]:_0x1c824c[_0x4fe4('0x30')];if(!_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x38')](_0x4fe4('0x39'))){_0x1b3c68[_0x4fe4('0x21')]=qs['limit'](_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x21')]);_0x1b3c68[_0x4fe4('0x20')]=qs['offset'](_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x20')]);}_0x1b3c68[_0x4fe4('0x3a')]=qs['sort'](_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x3b')]);_0x1b3c68['where']=qs[_0x4fe4('0x33')](_['pick'](_0x12aa43[_0x4fe4('0x31')],_0x1c824c[_0x4fe4('0x33')]),_0x52793c);if(_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x3c')]){_0x1b3c68[_0x4fe4('0x3d')]=_[_0x4fe4('0x3e')](_0x1b3c68[_0x4fe4('0x3d')],{'$or':_['map'](_0x52793c,function(_0x2bcd78){if(_0x2bcd78[_0x4fe4('0x2e')]!==_0x4fe4('0x3f')){var _0x438978={};_0x438978[_0x2bcd78[_0x4fe4('0x29')]]={'$like':'%'+_0x12aa43[_0x4fe4('0x31')]['filter']+'%'};return _0x438978;}})});}_0x1b3c68=_['merge']({},_0x1b3c68,_0x12aa43[_0x4fe4('0x40')]);var _0x122d75={'where':_0x1b3c68[_0x4fe4('0x3d')]};return db['MailMessage'][_0x4fe4('0x22')](_0x122d75)[_0x4fe4('0x13')](function(_0x19da98){_0x101d54[_0x4fe4('0x22')]=_0x19da98;if(_0x12aa43[_0x4fe4('0x31')][_0x4fe4('0x41')]){_0x1b3c68['include']=[{'all':!![]}];}return db['MailMessage'][_0x4fe4('0x42')](_0x1b3c68);})[_0x4fe4('0x13')](function(_0x309b8b){_0x101d54[_0x4fe4('0x43')]=_0x309b8b;return _0x101d54;})[_0x4fe4('0x13')](respondWithFilteredResult(_0x3fe484,_0x1b3c68))[_0x4fe4('0x1d')](handleError(_0x3fe484,null));};exports[_0x4fe4('0x44')]=function(_0x3f9385,_0x2ae0ce){var _0x4707b3={'raw':!![],'where':{'id':_0x3f9385[_0x4fe4('0x45')]['id']}},_0x36b3df={};_0x36b3df[_0x4fe4('0x30')]=_[_0x4fe4('0x32')](db[_0x4fe4('0x2c')][_0x4fe4('0x46')]);_0x36b3df['query']=_[_0x4fe4('0x32')](_0x3f9385[_0x4fe4('0x31')]);_0x36b3df[_0x4fe4('0x33')]=_[_0x4fe4('0x34')](_0x36b3df[_0x4fe4('0x30')],_0x36b3df[_0x4fe4('0x31')]);_0x4707b3[_0x4fe4('0x36')]=_['intersection'](_0x36b3df[_0x4fe4('0x30')],qs[_0x4fe4('0x35')](_0x3f9385[_0x4fe4('0x31')][_0x4fe4('0x35')]));_0x4707b3[_0x4fe4('0x36')]=_0x4707b3[_0x4fe4('0x36')]['length']?_0x4707b3[_0x4fe4('0x36')]:_0x36b3df[_0x4fe4('0x30')];if(_0x3f9385[_0x4fe4('0x31')][_0x4fe4('0x41')]){_0x4707b3['include']=[{'all':!![]}];}_0x4707b3=_[_0x4fe4('0x3e')]({},_0x4707b3,_0x3f9385[_0x4fe4('0x40')]);return db[_0x4fe4('0x2c')][_0x4fe4('0x47')](_0x4707b3)[_0x4fe4('0x13')](handleEntityNotFound(_0x2ae0ce,null))['then'](respondWithResult(_0x2ae0ce,null))[_0x4fe4('0x1d')](handleError(_0x2ae0ce,null));};exports['update']=function(_0x480a5c,_0x20a857){if(_0x480a5c[_0x4fe4('0x48')]['id']){delete _0x480a5c[_0x4fe4('0x48')]['id'];}return db['MailMessage'][_0x4fe4('0x47')]({'where':{'id':_0x480a5c[_0x4fe4('0x45')]['id']}})['then'](handleEntityNotFound(_0x20a857,null))[_0x4fe4('0x13')](saveUpdates(_0x480a5c[_0x4fe4('0x48')],null))[_0x4fe4('0x13')](respondWithResult(_0x20a857,null))['catch'](handleError(_0x20a857,null));};exports[_0x4fe4('0x49')]=function(_0x573254,_0x178625){return db[_0x4fe4('0x2c')][_0x4fe4('0x47')]({'where':{'id':_0x573254[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x13')](handleEntityNotFound(_0x178625,null))[_0x4fe4('0x13')](removeEntity(_0x178625,null))[_0x4fe4('0x1d')](handleError(_0x178625,null));};exports[_0x4fe4('0x4a')]=function(_0x287a01,_0x23b8d6){return db[_0x4fe4('0x2c')][_0x4fe4('0x4a')]()[_0x4fe4('0x13')](respondWithResult(_0x23b8d6,null))[_0x4fe4('0x1d')](handleError(_0x23b8d6,null));};exports[_0x4fe4('0x4b')]=function(_0x3da9d8,_0xd2c113){return db[_0x4fe4('0x2c')][_0x4fe4('0x4b')](_0x3da9d8[_0x4fe4('0x48')])['then'](function(_0x48f04d){if(_0x48f04d){if(_0x48f04d['direction']===_0x4fe4('0x4c')&&!_0x48f04d[_0x4fe4('0x4d')]){var _0x64082c,_0x189a74,_0x313f8f;if(_0x3da9d8[_0x4fe4('0x48')]['to']){_0x189a74=_0x3da9d8[_0x4fe4('0x48')]['to'][_0x4fe4('0x4e')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x48f04d[_0x4fe4('0x4f')]},'include':[{'model':db[_0x4fe4('0x50')],'as':_0x4fe4('0x51'),'include':[{'model':db['CmContact'],'as':_0x4fe4('0x52'),'where':{'email':_0x189a74},'limit':0x1,'order':[[_0x4fe4('0x53'),_0x4fe4('0x54')]]}]},{'model':db[_0x4fe4('0x55')],'as':_0x4fe4('0x56'),'raw':!![],'include':[{'model':db[_0x4fe4('0x57')],'as':_0x4fe4('0x57'),'raw':!![]}]}]})['then'](function(_0x2f7204){_0x64082c=_0x2f7204;if(!_0x64082c||!_0x64082c['Smtp'])return;var _0x4d1fb3=_0x64082c[_0x4fe4('0x58')]();if(_0x3da9d8[_0x4fe4('0x48')][_0x4fe4('0x59')]&&_0x3da9d8[_0x4fe4('0x48')]['attachments'][_0x4fe4('0x37')]){for(var _0xcc46e6=0x0;_0xcc46e6<_0x3da9d8['body'][_0x4fe4('0x59')][_0x4fe4('0x37')];_0xcc46e6+=0x1){_0x3da9d8['body'][_0x4fe4('0x59')][_0xcc46e6]={'filename':_0x3da9d8['body']['attachments'][_0xcc46e6][_0x4fe4('0x29')],'path':path[_0x4fe4('0x5a')](config['root'],_0x4fe4('0x5b'),_0x3da9d8[_0x4fe4('0x48')]['attachments'][_0xcc46e6][_0x4fe4('0x5c')])};}}_0x313f8f={'account':_0x4d1fb3,'message':_0x3da9d8[_0x4fe4('0x48')]};return;})[_0x4fe4('0x13')](function(){if(_0x64082c[_0x4fe4('0x51')]){if(_0x64082c['List']['Contacts'][_0x4fe4('0x37')]){return _0x64082c[_0x4fe4('0x51')][_0x4fe4('0x52')][0x0];}else{return db[_0x4fe4('0x5d')][_0x4fe4('0x4b')](_['defaults'](_0x3da9d8[_0x4fe4('0x48')],{'firstName':_0x3da9d8[_0x4fe4('0x48')]['to'],'email':_0x3da9d8[_0x4fe4('0x48')]['to'],'phone':_0x3da9d8[_0x4fe4('0x48')]['to'],'ListId':_0x64082c[_0x4fe4('0x5e')]}));}}else{throw new Error(_0x4fe4('0x5f'));}})[_0x4fe4('0x13')](function(){if(_0x313f8f){return respondWithRpcPromise('SendMail',_0x4fe4('0x60'),_0x313f8f,client9003)[_0x4fe4('0x13')](function(_0x4cb95c){return _0x48f04d[_0x4fe4('0x25')]({'read':!![],'messageId':_0x4cb95c[_0x4fe4('0x61')],'sentAt':moment()['format'](_0x4fe4('0x62'))});})[_0x4fe4('0x1d')](function(_0x223367){logger[_0x4fe4('0x19')]('%s',JSON['stringify'](_0x223367));return _0x48f04d;});}return _0x48f04d;});}return _0x48f04d;}})[_0x4fe4('0x13')](respondWithResult(_0xd2c113,0xc9))['catch'](handleError(_0xd2c113,null));};exports['accept']=function(_0x378c01,_0x40e707){var _0x399725={'agent':{},'channel':'mail'};if(_0x378c01[_0x4fe4('0x48')]['id']){delete _0x378c01[_0x4fe4('0x48')]['id'];}_0x378c01[_0x4fe4('0x48')]['read']=!![];_0x378c01[_0x4fe4('0x48')][_0x4fe4('0x63')]=moment()[_0x4fe4('0x64')](_0x4fe4('0x62'));_0x378c01[_0x4fe4('0x48')]['UserId']=_0x378c01[_0x4fe4('0x48')][_0x4fe4('0x65')]||_0x378c01[_0x4fe4('0x66')]['id'];_0x399725[_0x4fe4('0x67')]['id']=_0x378c01[_0x4fe4('0x48')][_0x4fe4('0x65')];return db[_0x4fe4('0x2c')][_0x4fe4('0x47')]({'where':{'id':_0x378c01[_0x4fe4('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x40e707,null))['then'](saveUpdates(_0x378c01[_0x4fe4('0x48')],null))['then'](function(_0x176609){if(_0x176609){_0x399725[_0x4fe4('0x1a')]=_0x176609[_0x4fe4('0x68')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x176609['MailInteractionId']}});}return null;})[_0x4fe4('0x13')](handleEntityNotFound(_0x40e707,null))[_0x4fe4('0x13')](function(_0x3febf2){if(_0x3febf2){return _0x3febf2[_0x4fe4('0x25')]({'UserId':_0x378c01[_0x4fe4('0x48')][_0x4fe4('0x65')],'read1stAt':_[_0x4fe4('0x69')](_0x3febf2['read1stAt'])?moment()[_0x4fe4('0x64')](_0x4fe4('0x62')):undefined});}return null;})[_0x4fe4('0x13')](function(_0x3a9ab5){if(_0x3a9ab5){_0x399725[_0x4fe4('0x6a')]=_0x3a9ab5['get']({'plain':!![]});interaction_log['info'](_0x4fe4('0x6b'),_0x378c01['user']['id'],_0x378c01[_0x4fe4('0x66')][_0x4fe4('0x29')],_0x378c01['user']['role'],_0x399725[_0x4fe4('0x6a')]['id'],_0x378c01[_0x4fe4('0x48')]?JSON[_0x4fe4('0x18')](_0x378c01[_0x4fe4('0x48')]):'null');return respondWithRpcPromise(_0x4fe4('0x6c'),_0x4fe4('0x6d'),_0x399725);}return null;})[_0x4fe4('0x13')](function(_0x4d1dab){var _0x5be269=_0x4fe4('0x6e')+_0x4d1dab[_0x4fe4('0x1a')]['ContactId'];return db[_0x4fe4('0x6f')][_0x4fe4('0x31')](_0x5be269,{'type':db['Sequelize']['QueryTypes'][_0x4fe4('0x70')],'raw':!![]})[_0x4fe4('0x13')](function(_0x470d29){return _0x470d29;});})['then'](function(_0x1a8d24){if(_0x1a8d24){_0x399725['message']['contact']=_0x1a8d24[0x0];if(!_0x378c01['body'][_0x4fe4('0x65')])return;return db[_0x4fe4('0x71')][_0x4fe4('0x47')]({'where':{'id':_0x378c01['body']['UserId'],'role':_0x4fe4('0x67')},'attributes':['id','name',_0x4fe4('0x72'),_0x4fe4('0x73'),'internal'],'raw':!![]});}return null;})[_0x4fe4('0x13')](function(_0x5c1278){if(!_0x5c1278)return null;_0x399725[_0x4fe4('0x1a')][_0x4fe4('0x67')]=_0x5c1278;return _0x399725;})[_0x4fe4('0x13')](function(_0x415d65){if(_0x415d65){if(_0x378c01[_0x4fe4('0x48')][_0x4fe4('0x74')]){_0x399725[_0x4fe4('0x1a')][_0x4fe4('0x75')]=util[_0x4fe4('0x64')]('SIP/%s',_0x378c01['user'][_0x4fe4('0x29')]);_0x399725[_0x4fe4('0x1a')][_0x4fe4('0x76')]=_0x399725[_0x4fe4('0x76')];_0x399725[_0x4fe4('0x1a')][_0x4fe4('0x77')]=_0x399725[_0x4fe4('0x76')];_0x399725['message'][_0x4fe4('0x78')]='accept';_0x399725[_0x4fe4('0x1a')][_0x4fe4('0x48')]=htmlToText[_0x4fe4('0x79')](_0x399725[_0x4fe4('0x1a')][_0x4fe4('0x48')]);return respondWithRpcPromise(_0x4fe4('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x399725[_0x4fe4('0x1a')]},client9002)[_0x4fe4('0x13')](function(){return _0x399725;});}return _0x399725;}return null;})[_0x4fe4('0x13')](respondWithResult(_0x40e707,null))[_0x4fe4('0x1d')](handleError(_0x40e707,null));};exports['reject']=function(_0x3e77c1,_0x5681de){var _0x523cc5={'agent':{},'channel':_0x4fe4('0x7b')};if(_0x3e77c1[_0x4fe4('0x48')]['id']){delete _0x3e77c1[_0x4fe4('0x48')]['id'];}_0x3e77c1['body'][_0x4fe4('0x65')]=_0x3e77c1['body'][_0x4fe4('0x65')]||_0x3e77c1[_0x4fe4('0x66')]['id'];_0x523cc5[_0x4fe4('0x67')]['id']=_0x3e77c1[_0x4fe4('0x48')][_0x4fe4('0x65')];return db[_0x4fe4('0x2c')][_0x4fe4('0x47')]({'where':{'id':_0x3e77c1[_0x4fe4('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5681de,null))['then'](function(_0x3914a9){if(_0x3914a9){_0x523cc5['message']=_0x3914a9[_0x4fe4('0x68')]({'plain':!![]});return db[_0x4fe4('0x7c')][_0x4fe4('0x47')]({'where':{'id':_0x3914a9['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5681de,null))[_0x4fe4('0x13')](function(_0x3fcbdc){if(_0x3fcbdc){_0x523cc5[_0x4fe4('0x6a')]=_0x3fcbdc[_0x4fe4('0x68')]({'plain':!![]});interaction_log['info'](_0x4fe4('0x7d'),_0x3e77c1['user']['id'],_0x3e77c1[_0x4fe4('0x66')][_0x4fe4('0x29')],_0x3e77c1['user'][_0x4fe4('0x7e')],_0x523cc5[_0x4fe4('0x6a')]['id'],_0x3e77c1[_0x4fe4('0x48')]?JSON[_0x4fe4('0x18')](_0x3e77c1[_0x4fe4('0x48')]):'null');return respondWithRpcPromise(_0x4fe4('0x7f'),'rejectMessage',_0x523cc5);}return null;})['then'](function(_0x42bc51){var _0x2ce86c=_0x4fe4('0x6e')+_0x42bc51[_0x4fe4('0x1a')]['ContactId'];return db[_0x4fe4('0x6f')][_0x4fe4('0x31')](_0x2ce86c,{'type':db[_0x4fe4('0x80')][_0x4fe4('0x81')][_0x4fe4('0x70')],'raw':!![]})[_0x4fe4('0x13')](function(_0x16c558){return _0x16c558;});})[_0x4fe4('0x13')](function(_0x4bec45){if(_0x4bec45){_0x523cc5[_0x4fe4('0x1a')]['contact']=_0x4bec45[0x0];if(!_0x3e77c1[_0x4fe4('0x48')][_0x4fe4('0x65')])return;return db[_0x4fe4('0x71')]['find']({'where':{'id':_0x3e77c1[_0x4fe4('0x48')][_0x4fe4('0x65')],'role':_0x4fe4('0x67')},'attributes':['id','name',_0x4fe4('0x72'),_0x4fe4('0x73'),_0x4fe4('0x82')],'raw':!![]});}return null;})[_0x4fe4('0x13')](function(_0x41aa8e){if(!_0x41aa8e)return null;_0x523cc5['message'][_0x4fe4('0x67')]=_0x41aa8e;return _0x523cc5;})['then'](function(_0x2489e0){if(_0x2489e0){_0x2489e0[_0x4fe4('0x1a')][_0x4fe4('0x75')]=util['format']('SIP/%s',_0x3e77c1[_0x4fe4('0x66')]['name']);_0x2489e0[_0x4fe4('0x1a')][_0x4fe4('0x76')]=_0x523cc5['channel'];_0x2489e0[_0x4fe4('0x1a')][_0x4fe4('0x77')]=_0x523cc5[_0x4fe4('0x76')];_0x2489e0['message'][_0x4fe4('0x78')]=_0x4fe4('0x83');_0x2489e0['message'][_0x4fe4('0x48')]=htmlToText['fromString'](_0x523cc5['message']['body']);respondWithRpcPromise(_0x4fe4('0x7a'),_0x4fe4('0x7a'),{'event':_0x4fe4('0x84'),'message':_0x2489e0[_0x4fe4('0x1a')]},client9002);return _0x523cc5;}return null;})[_0x4fe4('0x13')](respondWithResult(_0x5681de,null))[_0x4fe4('0x1d')](handleError(_0x5681de,null));};exports[_0x4fe4('0x85')]=function(_0x11d936,_0x4dbc34){var _0x2c440e=moment()[_0x4fe4('0x86')]()[_0x4fe4('0x87')]();var _0x12fdfc=path['join'](config[_0x4fe4('0x88')],_0x4fe4('0x89'),_0x4fe4('0x8a'),_0x4fe4('0x8b'));var _0x26e571=path[_0x4fe4('0x5a')](config[_0x4fe4('0x88')],'server',_0x4fe4('0x8a'),'attachments');var _0x56c90b=util[_0x4fe4('0x64')](_0x4fe4('0x8c'),_0x2c440e);return db[_0x4fe4('0x2c')][_0x4fe4('0x47')]({'where':{'id':_0x11d936[_0x4fe4('0x45')]['id']},'attributes':['id',_0x4fe4('0x48'),_0x4fe4('0x8d'),'to','cc',_0x4fe4('0x8e'),_0x4fe4('0x8f'),_0x4fe4('0x90')],'include':_0x11d936[_0x4fe4('0x31')][_0x4fe4('0x59')]?[{'model':db[_0x4fe4('0x91')],'as':_0x4fe4('0x92')}]:undefined})['then'](handleEntityNotFound(_0x4dbc34,null))['then'](function(_0x261502){if(_0x261502){var _0x382a20=_0x261502;var _0x48815c={'from':_0x382a20[_0x4fe4('0x8d')],'to':_0x382a20['to'],'subject':_0x382a20['subject'],'html':htmlEntities['decode'](_0x382a20[_0x4fe4('0x48')]),'headers':{'Date':moment(_0x382a20['createdAt'])['format'](_0x4fe4('0x93'))},'attachments':[]};if(_0x261502['cc']){_0x48815c[_0x4fe4('0x94')]['Cc']=_0x261502['cc'];}if(_0x261502[_0x4fe4('0x8e')]){_0x48815c[_0x4fe4('0x94')]['Bcc']=_0x261502[_0x4fe4('0x8e')];}return new BPromise(function(_0xb7888f,_0x4d8867){if(_0x261502[_0x4fe4('0x92')]){for(var _0x5e96af=0x0;_0x5e96af<_0x261502['Attachments']['length'];_0x5e96af++){var _0x19d945=_0x261502['Attachments'][_0x5e96af];var _0x4e1269=path[_0x4fe4('0x5a')](_0x26e571,_0x19d945[_0x4fe4('0x5c')]);if(fs[_0x4fe4('0x95')](_0x4e1269)){_0x48815c[_0x4fe4('0x59')][_0x4fe4('0x96')]({'name':_0x19d945['name'],'contentType':_0x19d945['type'],'data':fs[_0x4fe4('0x97')](_0x4e1269)});}}}emlformat['build'](_0x48815c,function(_0x205875,_0x1c35a0){if(_0x205875)return _0x4d8867(_0x205875);fs['writeFileSync'](path[_0x4fe4('0x5a')](_0x12fdfc,_0x56c90b),_0x1c35a0);return _0xb7888f(_0x1c35a0);});});}})[_0x4fe4('0x13')](function(_0x18b060){if(_0x18b060){return _0x4dbc34[_0x4fe4('0x85')](path[_0x4fe4('0x5a')](_0x12fdfc,_0x56c90b),_0x56c90b,function(_0x329df6){if(!_0x329df6)fs[_0x4fe4('0x98')](path['join'](_0x12fdfc,_0x56c90b));});}})[_0x4fe4('0x1d')](handleError(_0x4dbc34,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 27fb53c..3d5bc33 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 _0x7f54=['save','update','remove','hook','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x45823d,_0x1ccd2c){var _0x4171e8=function(_0x108821){while(--_0x108821){_0x45823d['push'](_0x45823d['shift']());}};_0x4171e8(++_0x1ccd2c);}(_0x7f54,0x154));var _0x47f5=function(_0x40edce,_0x12336e){_0x40edce=_0x40edce-0x0;var _0x14fe67=_0x7f54[_0x40edce];return _0x14fe67;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x47f5('0x0'))['db'][_0x47f5('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x47f5('0x2')](0x0);var events={'afterCreate':_0x47f5('0x3'),'afterUpdate':_0x47f5('0x4'),'afterDestroy':_0x47f5('0x5')};function emitEvent(_0x1a01ed){return function(_0x4e547a,_0x41a254,_0x44399a){MailMessageEvents['emit'](_0x1a01ed+':'+_0x4e547a['id'],_0x4e547a);MailMessageEvents['emit'](_0x1a01ed,_0x4e547a);_0x44399a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x47f5('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xd4df=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x100668,_0x2fbb4a){var _0x232dd2=function(_0x41b5e1){while(--_0x41b5e1){_0x100668['push'](_0x100668['shift']());}};_0x232dd2(++_0x2fbb4a);}(_0xd4df,0xef));var _0xfd4d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4df[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xfd4d('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfd4d('0x1')](0x0);var events={'afterCreate':_0xfd4d('0x2'),'afterUpdate':_0xfd4d('0x3'),'afterDestroy':_0xfd4d('0x4')};function emitEvent(_0x332a1d){return function(_0x5ca7ae,_0x53d73d,_0x1d5cbd){MailMessageEvents[_0xfd4d('0x5')](_0x332a1d+':'+_0x5ca7ae['id'],_0x5ca7ae);MailMessageEvents[_0xfd4d('0x5')](_0x332a1d,_0x5ca7ae);_0x1d5cbd(null);};}for(var e in events){if(events[_0xfd4d('0x6')](e)){var event=events[e];MailMessage[_0xfd4d('0x7')](e,emitEvent(event));}}module[_0xfd4d('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 0bd5d8c..532f6d7 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 _0xf022=['lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xf022,0x98));var _0x2f02=function(_0x96be88,_0x2c01a4){_0x96be88=_0x96be88-0x0;var _0x1c14c0=_0xf022[_0x96be88];return _0x1c14c0;};'use strict';var _=require(_0x2f02('0x0'));var util=require(_0x2f02('0x1'));var logger=require(_0x2f02('0x2'))(_0x2f02('0x3'));var moment=require(_0x2f02('0x4'));var BPromise=require('bluebird');var rp=require(_0x2f02('0x5'));var htmlToText=require(_0x2f02('0x6'));var fs=require('fs');var path=require(_0x2f02('0x7'));var rimraf=require(_0x2f02('0x8'));var config=require(_0x2f02('0x9'));var attributes=require(_0x2f02('0xa'));module[_0x2f02('0xb')]=function(_0x464f37,_0x2a5108){return _0x464f37[_0x2f02('0xc')](_0x2f02('0xd'),attributes,{'tableName':_0x2f02('0xe'),'paranoid':![],'indexes':[{'name':_0x2f02('0xf'),'fields':[_0x2f02('0xf')]},{'name':_0x2f02('0x10'),'fields':[_0x2f02('0x11'),_0x2f02('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2af0de,_0x5bedae,_0x9bfcb6){if(_0x2af0de[_0x2f02('0x13')]){_0x2af0de['plainBody']=htmlToText[_0x2f02('0x14')](_0x2af0de[_0x2f02('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x9bfcb6(null,_0x5bedae);},'afterCreate':function(_0x42ca31,_0x22ae98,_0x59b52d){var _0x1cc561=_0x464f37[_0x2f02('0x15')];var _0x8d37f6=_0x42ca31[_0x2f02('0x16')]({'plain':!![]});if(_0x8d37f6[_0x2f02('0x17')][_0x2f02('0x18')]()==='in'||_0x8d37f6['direction'][_0x2f02('0x18')]()===_0x2f02('0x19')&&!_0x8d37f6[_0x2f02('0x1a')]&&!_[_0x2f02('0x1b')](_0x8d37f6[_0x2f02('0x1c')])){_0x1cc561[_0x2f02('0x1d')][_0x2f02('0x1e')]({'where':{'id':_0x8d37f6[_0x2f02('0x1f')]}})[_0x2f02('0x20')](function(_0x1978ef){if(_0x1978ef){_0x1978ef[_0x2f02('0x21')]({'lastMsgAt':_0x8d37f6[_0x2f02('0x22')],'lastMsgDirection':_0x8d37f6[_0x2f02('0x17')][_0x2f02('0x18')]()});}})[_0x2f02('0x23')](function(_0x55c903){console['error'](_0x55c903);});}_0x59b52d();}},'charset':_0x2f02('0x24'),'collate':_0x2f02('0x25')});}; \ No newline at end of file +var _0xb914=['rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','models','get','direction','toLowerCase','secret','UserId','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x253d1e,_0x15dc5b){var _0x4a94e3=function(_0x2996cb){while(--_0x2996cb){_0x253d1e['push'](_0x253d1e['shift']());}};_0x4a94e3(++_0x15dc5b);}(_0xb914,0x1e2));var _0x4b91=function(_0x25eb17,_0x3a8726){_0x25eb17=_0x25eb17-0x0;var _0x170b2b=_0xb914[_0x25eb17];return _0x170b2b;};'use strict';var _=require(_0x4b91('0x0'));var util=require(_0x4b91('0x1'));var logger=require(_0x4b91('0x2'))(_0x4b91('0x3'));var moment=require(_0x4b91('0x4'));var BPromise=require(_0x4b91('0x5'));var rp=require(_0x4b91('0x6'));var htmlToText=require(_0x4b91('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b91('0x8'));var config=require('../../config/environment');var attributes=require(_0x4b91('0x9'));module[_0x4b91('0xa')]=function(_0x206f43,_0x14aa1c){return _0x206f43[_0x4b91('0xb')](_0x4b91('0xc'),attributes,{'tableName':_0x4b91('0xd'),'paranoid':![],'indexes':[{'name':_0x4b91('0xe'),'fields':[_0x4b91('0xe')]},{'name':_0x4b91('0xf'),'fields':[_0x4b91('0x10'),_0x4b91('0x11')],'type':_0x4b91('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d6473,_0x2e932d,_0x345cbf){if(_0x1d6473['body']){_0x1d6473[_0x4b91('0x10')]=htmlToText[_0x4b91('0x13')](_0x1d6473['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x345cbf(null,_0x2e932d);},'afterCreate':function(_0x108946,_0x5cafbf,_0xb15446){var _0x191e9f=_0x206f43[_0x4b91('0x14')];var _0x5d6054=_0x108946[_0x4b91('0x15')]({'plain':!![]});if(_0x5d6054['direction']['toLowerCase']()==='in'||_0x5d6054[_0x4b91('0x16')][_0x4b91('0x17')]()==='out'&&!_0x5d6054[_0x4b91('0x18')]&&!_['isNil'](_0x5d6054[_0x4b91('0x19')])){_0x191e9f[_0x4b91('0x1a')][_0x4b91('0x1b')]({'where':{'id':_0x5d6054['MailInteractionId']}})[_0x4b91('0x1c')](function(_0x388d8a){if(_0x388d8a){_0x388d8a[_0x4b91('0x1d')]({'lastMsgAt':_0x5d6054[_0x4b91('0x1e')],'lastMsgDirection':_0x5d6054[_0x4b91('0x16')][_0x4b91('0x17')]()});}})[_0x4b91('0x1f')](function(_0x21226d){console[_0x4b91('0x20')](_0x21226d);});}_0xb15446();}},'charset':_0x4b91('0x21'),'collate':_0x4b91('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index af12849..2b5ee43 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 _0x1a37=['debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent'];(function(_0x5ecc01,_0x325532){var _0x53c629=function(_0x128db8){while(--_0x128db8){_0x5ecc01['push'](_0x5ecc01['shift']());}};_0x53c629(++_0x325532);}(_0x1a37,0xb4));var _0x71a3=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x1a37[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});}exports[_0x71a3('0x1b')]=function(_0x1c4ec2){var _0x4a7980=this;return new Promise(function(_0x596328,_0x1ab947){return db[_0x71a3('0x1c')][_0x71a3('0x1d')](_0x1c4ec2[_0x71a3('0x1e')],{'raw':_0x1c4ec2[_0x71a3('0x1f')]?_0x1c4ec2['options'][_0x71a3('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3bf78e){logger[_0x71a3('0x19')](_0x71a3('0x1b'),_0x1c4ec2);logger[_0x71a3('0x12')](_0x71a3('0x1b'),_0x1c4ec2,JSON[_0x71a3('0x14')](_0x3bf78e));_0x596328(_0x3bf78e);})['catch'](function(_0x26e6e7){logger[_0x71a3('0x15')](_0x71a3('0x1b'),_0x26e6e7[_0x71a3('0x18')],_0x1c4ec2);_0x1ab947(_0x4a7980[_0x71a3('0x15')](0x1f4,_0x26e6e7['message']));});});}; \ No newline at end of file +var _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x196568,_0x3f0657){var _0x2fe767=function(_0x5c9bb4){while(--_0x5c9bb4){_0x196568['push'](_0x196568['shift']());}};_0x2fe767(++_0x3f0657);}(_0x5c3c,0x132));var _0xc5c3=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x5c3c[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 4159765..16ec67e 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 _0xf03c=['mailMessage:','./mailMessage.events','save','remove','emit','register','length'];(function(_0x2f366c,_0xcd026c){var _0x22296c=function(_0x49eb08){while(--_0x49eb08){_0x2f366c['push'](_0x2f366c['shift']());}};_0x22296c(++_0xcd026c);}(_0xf03c,0xbe));var _0xcf03=function(_0x3904bd,_0x3256a9){_0x3904bd=_0x3904bd-0x0;var _0x132d45=_0xf03c[_0x3904bd];return _0x132d45;};'use strict';var MailMessageEvents=require(_0xcf03('0x0'));var events=[_0xcf03('0x1'),_0xcf03('0x2'),'update'];function createListener(_0x11d439,_0x259979){return function(_0x46ff78){_0x259979[_0xcf03('0x3')](_0x11d439,_0x46ff78);};}function removeListener(_0x287aa4,_0x1e5f34){return function(){MailMessageEvents['removeListener'](_0x287aa4,_0x1e5f34);};}exports[_0xcf03('0x4')]=function(_0x1f801c){for(var _0x56b9db=0x0,_0x107187=events[_0xcf03('0x5')];_0x56b9db<_0x107187;_0x56b9db++){var _0x42a6b5=events[_0x56b9db];var _0x4d0b2a=createListener(_0xcf03('0x6')+_0x42a6b5,_0x1f801c);MailMessageEvents['on'](_0x42a6b5,_0x4d0b2a);}}; \ No newline at end of file +var _0x203a=['update','removeListener','register','mailMessage:','save','remove'];(function(_0x17cd4b,_0x46d9af){var _0x42f092=function(_0x4e7c4b){while(--_0x4e7c4b){_0x17cd4b['push'](_0x17cd4b['shift']());}};_0x42f092(++_0x46d9af);}(_0x203a,0x136));var _0xa203=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x203a[_0x2c91e9];return _0x13f0ff;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xa203('0x0'),_0xa203('0x1'),_0xa203('0x2')];function createListener(_0xe5df99,_0x46fd26){return function(_0x5454fa){_0x46fd26['emit'](_0xe5df99,_0x5454fa);};}function removeListener(_0x4541c8,_0xba923f){return function(){MailMessageEvents[_0xa203('0x3')](_0x4541c8,_0xba923f);};}exports[_0xa203('0x4')]=function(_0x3eb0f4){for(var _0x23575f=0x0,_0x52436d=events['length'];_0x23575f<_0x52436d;_0x23575f++){var _0x2a4da3=events[_0x23575f];var _0x42fa78=createListener(_0xa203('0x5')+_0x2a4da3,_0x3eb0f4);MailMessageEvents['on'](_0x2a4da3,_0x42fa78);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index daa8a04..532fe95 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 _0xbca7=['/describe','isAuthenticated','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x5f52e4,_0x5a69b3){var _0x25148b=function(_0x461a44){while(--_0x461a44){_0x5f52e4['push'](_0x5f52e4['shift']());}};_0x25148b(++_0x5a69b3);}(_0xbca7,0xe0));var _0x7bca=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xbca7[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0x7bca('0x0'));var util=require(_0x7bca('0x1'));var path=require('path');var timeout=require(_0x7bca('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7bca('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7bca('0x4'));var config=require(_0x7bca('0x5'));var controller=require(_0x7bca('0x6'));router[_0x7bca('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7bca('0x8'),auth[_0x7bca('0x9')](),controller[_0x7bca('0xa')]);router[_0x7bca('0x7')](_0x7bca('0xb'),auth[_0x7bca('0x9')](),controller[_0x7bca('0xc')]);router[_0x7bca('0x7')](_0x7bca('0xd'),auth[_0x7bca('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x7bca('0xe')]);router[_0x7bca('0x7')](_0x7bca('0xf'),auth[_0x7bca('0x9')](),controller[_0x7bca('0x10')]);router[_0x7bca('0x11')]('/',auth[_0x7bca('0x9')](),controller[_0x7bca('0x12')]);router[_0x7bca('0x11')](_0x7bca('0x13'),auth[_0x7bca('0x9')](),controller[_0x7bca('0x14')]);router[_0x7bca('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x7bca('0x15')]);router[_0x7bca('0x16')]('/:id',auth[_0x7bca('0x9')](),controller[_0x7bca('0x17')]);router[_0x7bca('0x18')](_0x7bca('0xb'),auth[_0x7bca('0x9')](),controller[_0x7bca('0x19')]);router['delete'](_0x7bca('0x13'),auth[_0x7bca('0x9')](),controller[_0x7bca('0x1a')]);router[_0x7bca('0x18')](_0x7bca('0xf'),auth[_0x7bca('0x9')](),controller[_0x7bca('0x1b')]);module[_0x7bca('0x1c')]=router; \ No newline at end of file +var _0xb290=['/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/:id','show'];(function(_0x242daf,_0x142ae6){var _0x7214d6=function(_0x280733){while(--_0x280733){_0x242daf['push'](_0x242daf['shift']());}};_0x7214d6(++_0x142ae6);}(_0xb290,0xb5));var _0x0b29=function(_0x93ef32,_0xeeec1){_0x93ef32=_0x93ef32-0x0;var _0x528b6c=_0xb290[_0x93ef32];return _0x528b6c;};'use strict';var multer=require(_0x0b29('0x0'));var util=require(_0x0b29('0x1'));var path=require(_0x0b29('0x2'));var timeout=require(_0x0b29('0x3'));var express=require(_0x0b29('0x4'));var router=express[_0x0b29('0x5')]();var fs_extra=require(_0x0b29('0x6'));var auth=require(_0x0b29('0x7'));var interaction=require(_0x0b29('0x8'));var config=require('../../config/environment');var controller=require(_0x0b29('0x9'));router['get']('/',auth[_0x0b29('0xa')](),controller[_0x0b29('0xb')]);router[_0x0b29('0xc')]('/describe',auth[_0x0b29('0xa')](),controller['describe']);router['get'](_0x0b29('0xd'),auth[_0x0b29('0xa')](),controller[_0x0b29('0xe')]);router[_0x0b29('0xc')](_0x0b29('0xf'),auth[_0x0b29('0xa')](),controller[_0x0b29('0x10')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x0b29('0x11')]);router['get'](_0x0b29('0x12'),auth['isAuthenticated'](),controller[_0x0b29('0x13')]);router[_0x0b29('0x14')]('/',auth[_0x0b29('0xa')](),controller['create']);router['post'](_0x0b29('0x15'),auth['isAuthenticated'](),controller[_0x0b29('0x16')]);router[_0x0b29('0x14')](_0x0b29('0x12'),auth['isAuthenticated'](),controller[_0x0b29('0x17')]);router[_0x0b29('0x18')](_0x0b29('0xd'),auth[_0x0b29('0xa')](),controller[_0x0b29('0x19')]);router[_0x0b29('0x1a')](_0x0b29('0xd'),auth[_0x0b29('0xa')](),controller['destroy']);router['delete'](_0x0b29('0x15'),auth['isAuthenticated'](),controller[_0x0b29('0x1b')]);router['delete'](_0x0b29('0x12'),auth[_0x0b29('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 409302d..c884f31 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 _0x5154=['rrmemory','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x94f593,_0x416fa2){var _0xb69483=function(_0x4894f6){while(--_0x4894f6){_0x94f593['push'](_0x94f593['shift']());}};_0xb69483(++_0x416fa2);}(_0x5154,0x8c));var _0x4515=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5154[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4515('0x0'));module['exports']={'name':{'type':Sequelize[_0x4515('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4515('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4515('0x3')](_0x4515('0x4'),'beepall',_0x4515('0x5'))}}; \ No newline at end of file +var _0xcea4=['exports','name','STRING','INTEGER','beepall','roundrobin','sequelize'];(function(_0xa96525,_0x462871){var _0x3b5f32=function(_0x3ea3af){while(--_0x3ea3af){_0xa96525['push'](_0xa96525['shift']());}};_0x3b5f32(++_0x462871);}(_0xcea4,0x15d));var _0x4cea=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xcea4[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x4cea('0x0'));module[_0x4cea('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4cea('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4cea('0x3')]},'timeout':{'type':Sequelize[_0x4cea('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4cea('0x5'),_0x4cea('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 126b148..16d0a33 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 _0xf418=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','emit','userMailQueue:save','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','sequelize','QueryTypes','every','all','union','value','transaction','removeTeams','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','MailQueues','end','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','filters','intersection'];(function(_0x57e774,_0x59b603){var _0x400c9f=function(_0xe94b83){while(--_0xe94b83){_0x57e774['push'](_0x57e774['shift']());}};_0x400c9f(++_0x59b603);}(_0xf418,0x1e3));var _0x8f41=function(_0x351b6b,_0x2abdc1){_0x351b6b=_0x351b6b-0x0;var _0x14a3b6=_0xf418[_0x351b6b];return _0x14a3b6;};'use strict';var emlformat=require(_0x8f41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f41('0x2'));var moment=require(_0x8f41('0x3'));var BPromise=require(_0x8f41('0x4'));var Mustache=require(_0x8f41('0x5'));var util=require('util');var path=require(_0x8f41('0x6'));var sox=require(_0x8f41('0x7'));var csv=require(_0x8f41('0x8'));var ejs=require(_0x8f41('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f41('0xa'));var squel=require(_0x8f41('0xb'));var crypto=require(_0x8f41('0xc'));var jsforce=require(_0x8f41('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f41('0xe'));var Redis=require(_0x8f41('0xf'));var authService=require(_0x8f41('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8f41('0x11'));var hardwareService=require(_0x8f41('0x12'));var logger=require(_0x8f41('0x13'))('api');var utils=require(_0x8f41('0x14'));var config=require(_0x8f41('0x15'));var licenseUtil=require(_0x8f41('0x16'));var db=require('../../mysqldb')['db'];config[_0x8f41('0x17')]=_[_0x8f41('0x18')](config[_0x8f41('0x17')],{'host':_0x8f41('0x19'),'port':0x18eb});var socket=require(_0x8f41('0x1a'))(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x54b08f,_0x2e2ced){_0x2e2ced=_0x2e2ced||0xcc;return function(_0x42500d){if(_0x42500d){return _0x54b08f[_0x8f41('0x1b')](_0x2e2ced);}return _0x54b08f[_0x8f41('0x1c')](_0x2e2ced)['end']();};}function respondWithResult(_0xac6f50,_0x436ebd){_0x436ebd=_0x436ebd||0xc8;return function(_0x4061e1){if(_0x4061e1){return _0xac6f50[_0x8f41('0x1c')](_0x436ebd)[_0x8f41('0x1d')](_0x4061e1);}};}function respondWithFilteredResult(_0x2a534d,_0x7f3dd2){return function(_0x3eaa02){if(_0x3eaa02){var _0x569450=typeof _0x7f3dd2[_0x8f41('0x1e')]===_0x8f41('0x1f')&&typeof _0x7f3dd2['limit']===_0x8f41('0x1f');var _0x120e11=_0x3eaa02[_0x8f41('0x20')];var _0x4f70bf=_0x569450?0x0:_0x7f3dd2[_0x8f41('0x1e')];var _0x1b4c9b=_0x569450?_0x3eaa02[_0x8f41('0x20')]:_0x7f3dd2[_0x8f41('0x1e')]+_0x7f3dd2[_0x8f41('0x21')];var _0x12363b;if(_0x1b4c9b>=_0x120e11){_0x1b4c9b=_0x120e11;_0x12363b=0xc8;}else{_0x12363b=0xce;}_0x2a534d[_0x8f41('0x1c')](_0x12363b);return _0x2a534d[_0x8f41('0x22')](_0x8f41('0x23'),_0x4f70bf+'-'+_0x1b4c9b+'/'+_0x120e11)['json'](_0x3eaa02);}return null;};}function patchUpdates(_0x23aaaa){return function(_0xb7970a){try{jsonpatch[_0x8f41('0x24')](_0xb7970a,_0x23aaaa,!![]);}catch(_0x447a81){return BPromise[_0x8f41('0x25')](_0x447a81);}return _0xb7970a['save']();};}function saveUpdates(_0x4c0920,_0x257bc8){return function(_0x36f48b){if(_0x36f48b){return _0x36f48b[_0x8f41('0x26')](_0x4c0920)[_0x8f41('0x27')](function(_0x4c0075){return _0x4c0075;});}return null;};}function removeEntity(_0x5597df,_0x332c19){return function(_0x3245cd){if(_0x3245cd){return _0x3245cd[_0x8f41('0x28')]()[_0x8f41('0x27')](function(){var _0xe4415a=_0x3245cd['get']({'plain':!![]});var _0x248301=_0x8f41('0x29');return db['UserProfileResource'][_0x8f41('0x28')]({'where':{'type':_0x248301,'resourceId':_0xe4415a['id']}})['then'](function(){return _0x3245cd;});})[_0x8f41('0x27')](function(){_0x5597df[_0x8f41('0x1c')](0xcc)[_0x8f41('0x2a')]();});}};}function handleEntityNotFound(_0x280d88,_0x1d9156){return function(_0x4d99dd){if(!_0x4d99dd){_0x280d88[_0x8f41('0x1b')](0x194);}return _0x4d99dd;};}function handleError(_0x4bde2b,_0x794f09){_0x794f09=_0x794f09||0x1f4;return function(_0x17493d){logger[_0x8f41('0x2b')](_0x17493d[_0x8f41('0x2c')]);if(_0x17493d[_0x8f41('0x2d')]){delete _0x17493d[_0x8f41('0x2d')];}_0x4bde2b[_0x8f41('0x1c')](_0x794f09)[_0x8f41('0x2e')](_0x17493d);};}exports[_0x8f41('0x2f')]=function(_0x5ddea9,_0x1f4861){var _0x2b674a={},_0x3734e5={},_0x3f76be={'count':0x0,'rows':[]};var _0x1568f2=_[_0x8f41('0x30')](db[_0x8f41('0x31')][_0x8f41('0x32')],function(_0x2587ac){return{'name':_0x2587ac[_0x8f41('0x33')],'type':_0x2587ac[_0x8f41('0x34')]['key']};});_0x3734e5[_0x8f41('0x35')]=_['map'](_0x1568f2,'name');_0x3734e5['query']=_['keys'](_0x5ddea9[_0x8f41('0x36')]);_0x3734e5[_0x8f41('0x37')]=_[_0x8f41('0x38')](_0x3734e5[_0x8f41('0x35')],_0x3734e5['query']);_0x2b674a[_0x8f41('0x39')]=_['intersection'](_0x3734e5[_0x8f41('0x35')],qs[_0x8f41('0x3a')](_0x5ddea9['query']['fields']));_0x2b674a[_0x8f41('0x39')]=_0x2b674a[_0x8f41('0x39')][_0x8f41('0x3b')]?_0x2b674a[_0x8f41('0x39')]:_0x3734e5[_0x8f41('0x35')];if(!_0x5ddea9[_0x8f41('0x36')][_0x8f41('0x3c')](_0x8f41('0x3d'))){_0x2b674a['limit']=qs[_0x8f41('0x21')](_0x5ddea9[_0x8f41('0x36')][_0x8f41('0x21')]);_0x2b674a[_0x8f41('0x1e')]=qs['offset'](_0x5ddea9['query'][_0x8f41('0x1e')]);}_0x2b674a[_0x8f41('0x3e')]=qs['sort'](_0x5ddea9[_0x8f41('0x36')][_0x8f41('0x3f')]);_0x2b674a[_0x8f41('0x40')]=qs[_0x8f41('0x37')](_[_0x8f41('0x41')](_0x5ddea9[_0x8f41('0x36')],_0x3734e5['filters']),_0x1568f2);if(_0x5ddea9[_0x8f41('0x36')][_0x8f41('0x42')]){_0x2b674a['where']=_[_0x8f41('0x43')](_0x2b674a[_0x8f41('0x40')],{'$or':_[_0x8f41('0x30')](_0x1568f2,function(_0x4edec0){if(_0x4edec0[_0x8f41('0x34')]!==_0x8f41('0x44')){var _0x406862={};_0x406862[_0x4edec0[_0x8f41('0x2d')]]={'$like':'%'+_0x5ddea9[_0x8f41('0x36')][_0x8f41('0x42')]+'%'};return _0x406862;}})});}_0x2b674a=_[_0x8f41('0x43')]({},_0x2b674a,_0x5ddea9[_0x8f41('0x45')]);var _0x387e0b={'where':_0x2b674a[_0x8f41('0x40')]};return db[_0x8f41('0x31')][_0x8f41('0x20')](_0x387e0b)[_0x8f41('0x27')](function(_0x3d2202){_0x3f76be['count']=_0x3d2202;if(_0x5ddea9[_0x8f41('0x36')][_0x8f41('0x46')]){_0x2b674a[_0x8f41('0x47')]=[{'all':!![]}];}return db[_0x8f41('0x31')]['findAll'](_0x2b674a);})['then'](function(_0x376b40){_0x3f76be[_0x8f41('0x48')]=_0x376b40;return _0x3f76be;})[_0x8f41('0x27')](respondWithFilteredResult(_0x1f4861,_0x2b674a))[_0x8f41('0x49')](handleError(_0x1f4861,null));};exports[_0x8f41('0x4a')]=function(_0x304e46,_0x37bd08){var _0xdcd296={'raw':!![],'where':{'id':_0x304e46[_0x8f41('0x4b')]['id']}},_0x3c61ff={};_0x3c61ff[_0x8f41('0x35')]=_[_0x8f41('0x4c')](db[_0x8f41('0x31')][_0x8f41('0x32')]);_0x3c61ff[_0x8f41('0x36')]=_[_0x8f41('0x4c')](_0x304e46['query']);_0x3c61ff[_0x8f41('0x37')]=_[_0x8f41('0x38')](_0x3c61ff[_0x8f41('0x35')],_0x3c61ff['query']);_0xdcd296[_0x8f41('0x39')]=_[_0x8f41('0x38')](_0x3c61ff['model'],qs[_0x8f41('0x3a')](_0x304e46[_0x8f41('0x36')][_0x8f41('0x3a')]));_0xdcd296[_0x8f41('0x39')]=_0xdcd296[_0x8f41('0x39')][_0x8f41('0x3b')]?_0xdcd296['attributes']:_0x3c61ff[_0x8f41('0x35')];if(_0x304e46[_0x8f41('0x36')][_0x8f41('0x46')]){_0xdcd296[_0x8f41('0x47')]=[{'all':!![]}];}_0xdcd296=_[_0x8f41('0x43')]({},_0xdcd296,_0x304e46[_0x8f41('0x45')]);return db[_0x8f41('0x31')]['find'](_0xdcd296)[_0x8f41('0x27')](handleEntityNotFound(_0x37bd08,null))['then'](respondWithResult(_0x37bd08,null))['catch'](handleError(_0x37bd08,null));};exports[_0x8f41('0x4d')]=function(_0x143543,_0x55eed1){return db['MailQueue']['create'](_0x143543[_0x8f41('0x4e')],{})[_0x8f41('0x27')](function(_0x137cca){var _0x6ec78f=_0x143543[_0x8f41('0x4f')][_0x8f41('0x50')]({'plain':!![]});if(!_0x6ec78f)throw new Error(_0x8f41('0x51'));if(_0x6ec78f['role']===_0x8f41('0x4f')){var _0x1c5396=_0x137cca[_0x8f41('0x50')]({'plain':!![]});var _0x54e4c6=_0x8f41('0x29');return db[_0x8f41('0x52')][_0x8f41('0x53')]({'where':{'name':_0x54e4c6,'userProfileId':_0x6ec78f[_0x8f41('0x54')]},'raw':!![]})[_0x8f41('0x27')](function(_0xa8f705){if(_0xa8f705&&_0xa8f705[_0x8f41('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c5396[_0x8f41('0x2d')],'resourceId':_0x1c5396['id'],'type':_0xa8f705['name'],'sectionId':_0xa8f705['id']},{})['then'](function(){return _0x137cca;});}else{return _0x137cca;}})[_0x8f41('0x49')](function(_0x43c740){logger['error'](_0x8f41('0x56'),_0x43c740);throw _0x43c740;});}return _0x137cca;})[_0x8f41('0x27')](respondWithResult(_0x55eed1,0xc9))[_0x8f41('0x49')](handleError(_0x55eed1,null));};exports[_0x8f41('0x26')]=function(_0x3c10b0,_0x458994){if(_0x3c10b0['body']['id']){delete _0x3c10b0['body']['id'];}return db[_0x8f41('0x31')][_0x8f41('0x53')]({'where':{'id':_0x3c10b0['params']['id']}})[_0x8f41('0x27')](handleEntityNotFound(_0x458994,null))[_0x8f41('0x27')](saveUpdates(_0x3c10b0[_0x8f41('0x4e')],null))['then'](respondWithResult(_0x458994,null))[_0x8f41('0x49')](handleError(_0x458994,null));};exports['destroy']=function(_0x362cfb,_0x4c3155){return db['MailQueue']['find']({'where':{'id':_0x362cfb[_0x8f41('0x4b')]['id']}})[_0x8f41('0x27')](handleEntityNotFound(_0x4c3155,null))[_0x8f41('0x27')](removeEntity(_0x4c3155,null))[_0x8f41('0x49')](handleError(_0x4c3155,null));};exports[_0x8f41('0x57')]=function(_0xe2899e,_0x3fb21c){return db[_0x8f41('0x31')][_0x8f41('0x57')]()['then'](respondWithResult(_0x3fb21c,null))['catch'](handleError(_0x3fb21c,null));};exports[_0x8f41('0x58')]=function(_0x33ec72,_0x1c8653,_0xe4cea2){var _0x528564={'raw':!![],'where':{}},_0x35bc66={},_0x4c4271;return db['MailQueue'][_0x8f41('0x59')]({'where':{'id':_0x33ec72[_0x8f41('0x4b')]['id']}})[_0x8f41('0x27')](handleEntityNotFound(_0x1c8653,null))[_0x8f41('0x27')](function(_0x309d51){if(_0x309d51){_0x4c4271=_0x309d51[_0x8f41('0x50')]({'plain':!![]});_0x35bc66[_0x8f41('0x35')]=_[_0x8f41('0x4c')](db[_0x8f41('0x5a')]['rawAttributes']);_0x35bc66[_0x8f41('0x36')]=_[_0x8f41('0x4c')](_0x33ec72[_0x8f41('0x36')]);_0x35bc66[_0x8f41('0x37')]=_[_0x8f41('0x38')](_0x35bc66['model'],_0x35bc66[_0x8f41('0x36')]);_0x528564[_0x8f41('0x39')]=_[_0x8f41('0x38')](_0x35bc66[_0x8f41('0x35')],qs[_0x8f41('0x3a')](_0x33ec72['query'][_0x8f41('0x3a')]));_0x528564[_0x8f41('0x39')]=_0x528564['attributes'][_0x8f41('0x3b')]?_0x528564[_0x8f41('0x39')]:_0x35bc66[_0x8f41('0x35')];if(!_0x33ec72[_0x8f41('0x36')][_0x8f41('0x3c')](_0x8f41('0x3d'))){_0x528564['limit']=qs[_0x8f41('0x21')](_0x33ec72[_0x8f41('0x36')][_0x8f41('0x21')]);_0x528564[_0x8f41('0x1e')]=qs['offset'](_0x33ec72[_0x8f41('0x36')][_0x8f41('0x1e')]);}_0x528564[_0x8f41('0x3e')]=qs['sort'](_0x33ec72['query'][_0x8f41('0x3f')]);_0x528564[_0x8f41('0x40')]=qs['filters'](_[_0x8f41('0x41')](_0x33ec72[_0x8f41('0x36')],_0x35bc66[_0x8f41('0x37')]));_0x528564[_0x8f41('0x40')]['MailQueueId']=_0x309d51['id'];if(_0x33ec72[_0x8f41('0x36')][_0x8f41('0x42')]){_0x528564[_0x8f41('0x40')]=_[_0x8f41('0x43')](_0x528564[_0x8f41('0x40')],{'$or':_['map'](_0x528564[_0x8f41('0x39')],function(_0x4fc472){var _0x4794a5={};_0x4794a5[_0x4fc472]={'$like':'%'+_0x33ec72[_0x8f41('0x36')][_0x8f41('0x42')]+'%'};return _0x4794a5;})});}_0x528564=_[_0x8f41('0x43')]({},_0x528564,_0x33ec72[_0x8f41('0x45')]);return db[_0x8f41('0x5a')][_0x8f41('0x5b')](_0x528564);}})[_0x8f41('0x27')](function(_0x4822d9){if(_0x4822d9){return db[_0x8f41('0x5c')][_0x8f41('0x5d')]({'where':{'id':_[_0x8f41('0x30')](_0x4822d9,_0x8f41('0x5e')),'role':_0x8f41('0x5f')},'attributes':['id',_0x8f41('0x2d'),_0x8f41('0x60'),_0x8f41('0x61'),'createdAt']});}})['then'](function(_0x4b083d){if(_0x4b083d){return{'count':_0x4b083d[_0x8f41('0x20')],'rows':_[_0x8f41('0x30')](_0x4b083d[_0x8f41('0x48')],function(_0x2ae9f5){return{'membername':_0x2ae9f5[_0x8f41('0x2d')],'UserId':_0x2ae9f5['id'],'queue_name':_0x4c4271[_0x8f41('0x2d')],'MailQueueId':_0x4c4271['id'],'interface':util[_0x8f41('0x62')](_0x8f41('0x63'),'SIP',_0x2ae9f5[_0x8f41('0x2d')]),'penalty':0x0,'paused':_0x2ae9f5[_0x8f41('0x60')],'createdAt':_0x2ae9f5['createdAt'],'updatedAt':_0x2ae9f5[_0x8f41('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8f41('0x27')](respondWithFilteredResult(_0x1c8653,_0x528564))[_0x8f41('0x49')](handleError(_0x1c8653,null));};exports['getTeams']=function(_0x4afa2d,_0xfdab07,_0x2476eb){var _0x1a9a70={};var _0x3318ad={};var _0x118629;var _0x423d9e;return db[_0x8f41('0x31')][_0x8f41('0x59')]({'where':{'id':_0x4afa2d['params']['id']}})['then'](handleEntityNotFound(_0xfdab07,null))['then'](function(_0x3928a9){if(_0x3928a9){_0x118629=_0x3928a9;_0x3318ad[_0x8f41('0x35')]=_[_0x8f41('0x4c')](db[_0x8f41('0x64')][_0x8f41('0x32')]);_0x3318ad[_0x8f41('0x36')]=_[_0x8f41('0x4c')](_0x4afa2d[_0x8f41('0x36')]);_0x3318ad[_0x8f41('0x37')]=_[_0x8f41('0x38')](_0x3318ad['model'],_0x3318ad[_0x8f41('0x36')]);_0x1a9a70[_0x8f41('0x39')]=_[_0x8f41('0x38')](_0x3318ad[_0x8f41('0x35')],qs[_0x8f41('0x3a')](_0x4afa2d[_0x8f41('0x36')][_0x8f41('0x3a')]));_0x1a9a70[_0x8f41('0x39')]=_0x1a9a70['attributes'][_0x8f41('0x3b')]?_0x1a9a70[_0x8f41('0x39')]:_0x3318ad[_0x8f41('0x35')];_0x1a9a70[_0x8f41('0x3e')]=qs[_0x8f41('0x3f')](_0x4afa2d[_0x8f41('0x36')]['sort']);_0x1a9a70['where']=qs[_0x8f41('0x37')](_[_0x8f41('0x41')](_0x4afa2d[_0x8f41('0x36')],_0x3318ad['filters']));if(_0x4afa2d[_0x8f41('0x36')][_0x8f41('0x42')]){_0x1a9a70['where']=_[_0x8f41('0x43')](_0x1a9a70['where'],{'$or':_[_0x8f41('0x30')](_0x1a9a70[_0x8f41('0x39')],function(_0x146015){var _0x124872={};_0x124872[_0x146015]={'$like':'%'+_0x4afa2d['query'][_0x8f41('0x42')]+'%'};return _0x124872;})});}_0x1a9a70=_[_0x8f41('0x43')]({},_0x1a9a70,_0x4afa2d[_0x8f41('0x45')]);return _0x118629[_0x8f41('0x65')](_0x1a9a70);}})['then'](function(_0x5d6ef5){if(_0x5d6ef5){_0x423d9e=_0x5d6ef5[_0x8f41('0x3b')];if(!_0x4afa2d[_0x8f41('0x36')][_0x8f41('0x3c')](_0x8f41('0x3d'))){_0x1a9a70['limit']=qs[_0x8f41('0x21')](_0x4afa2d[_0x8f41('0x36')][_0x8f41('0x21')]);_0x1a9a70[_0x8f41('0x1e')]=qs[_0x8f41('0x1e')](_0x4afa2d[_0x8f41('0x36')][_0x8f41('0x1e')]);}return _0x118629[_0x8f41('0x65')](_0x1a9a70);}})[_0x8f41('0x27')](function(_0x1d19f0){if(_0x1d19f0){return _0x1d19f0?{'count':_0x423d9e,'rows':_0x1d19f0}:null;}})['then'](respondWithResult(_0xfdab07,null))[_0x8f41('0x49')](handleError(_0xfdab07,null));};exports[_0x8f41('0x66')]=function(_0x26a0ab,_0x3cc26e,_0x1de8e2){var _0x622403=_0x26a0ab[_0x8f41('0x4e')][_0x8f41('0x67')];return db['Team'][_0x8f41('0x5b')]({'where':{'id':_0x622403},'attributes':['id'],'include':[{'model':db[_0x8f41('0x5c')],'as':_0x8f41('0x68'),'attributes':['id','name',_0x8f41('0x69'),_0x8f41('0x6a'),_0x8f41('0x6b')],'raw':!![]}]})[_0x8f41('0x27')](function(_0x446d58){if(_0x446d58){var _0x4db20b=_[_0x8f41('0x6c')](_0x446d58,function(_0x459409){var _0x450451=_0x459409[_0x8f41('0x50')]({'plain':!![]});return _0x450451[_0x8f41('0x68')];});return db[_0x8f41('0x31')][_0x8f41('0x53')]({'where':{'id':_0x26a0ab[_0x8f41('0x4b')]['id']}})[_0x8f41('0x27')](function(_0x2be606){return db['sequelize']['transaction'](function(_0x559752){return _0x2be606[_0x8f41('0x66')](_0x622403,{'transaction':_0x559752})[_0x8f41('0x27')](function(){return BPromise[_0x8f41('0x6d')](_0x4db20b,function(_0x5d1e56){return db[_0x8f41('0x5a')]['findOrCreate']({'where':{'UserId':_0x5d1e56['id'],'MailQueueId':_0x26a0ab[_0x8f41('0x4b')]['id']},'transaction':_0x559752});});})[_0x8f41('0x27')](function(){_0x4db20b['forEach'](function(_0x2509d4){socket[_0x8f41('0x6e')](_0x8f41('0x6f'),{'UserId':_0x2509d4['id'],'MailQueueId':_0x2be606['id']});});});});});}})[_0x8f41('0x27')](respondWithStatusCode(_0x3cc26e,null))[_0x8f41('0x49')](handleError(_0x3cc26e,null));};exports['removeTeams']=function(_0x1f9648,_0x112cff,_0x32dc89){return db[_0x8f41('0x64')][_0x8f41('0x5b')]({'where':{'id':_0x1f9648[_0x8f41('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8f41('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8f41('0x27')](handleEntityNotFound(_0x112cff,null))['then'](function(_0x9bbfe){var _0x40ad22=_[_0x8f41('0x30')](_0x9bbfe,'id');var _0x286d71=[];var _0x3fae6c=[];var _0x248a4d=squel[_0x8f41('0x70')]();_0x248a4d['field']('tq.TeamId')['from']('team_has_mail_queues','tq')[_0x8f41('0x71')](_0x8f41('0x72'),'ut',_0x8f41('0x73'))[_0x8f41('0x40')]('MailQueueId\x20=\x20?',_0x1f9648[_0x8f41('0x4b')]['id']);for(var _0xc90f18=0x0;_0xc90f18<_0x9bbfe['length'];_0xc90f18+=0x1){let _0x1c1021=_0x9bbfe[_0xc90f18];for(var _0x1f312a=0x0;_0x1f312a<_0x1c1021[_0x8f41('0x68')][_0x8f41('0x3b')];_0x1f312a+=0x1){let _0x75c661=_0x1c1021[_0x8f41('0x68')][_0x1f312a];var _0x1c88e9=_0x248a4d[_0x8f41('0x74')]();_0x1c88e9[_0x8f41('0x40')]('ut.UserId\x20=\x20?',_0x75c661['id']);_0x3fae6c[_0x8f41('0x75')](db['sequelize']['query'](_0x1c88e9[_0x8f41('0x76')](),{'type':db[_0x8f41('0x77')][_0x8f41('0x78')]['SELECT']})['then'](function(_0x2c4654){if(_0x2c4654['length']===0x1){return _0x75c661['id'];}else{var _0x388ab9=_[_0x8f41('0x79')](_['map'](_0x2c4654,'TeamId'),function(_0x3e8817){return _['includes'](_0x40ad22,_0x3e8817);});if(_0x388ab9){return _0x75c661['id'];}}}));}}return BPromise[_0x8f41('0x7a')](_0x3fae6c)[_0x8f41('0x27')](function(_0x386931){_0x286d71=_(_0x286d71)[_0x8f41('0x7b')](_0x386931)['compact']()[_0x8f41('0x7c')]();return db[_0x8f41('0x31')][_0x8f41('0x53')]({'where':{'id':_0x1f9648[_0x8f41('0x4b')]['id']}})[_0x8f41('0x27')](function(_0x559c68){return db[_0x8f41('0x77')][_0x8f41('0x7d')](function(_0x3f5ded){return _0x559c68[_0x8f41('0x7e')](_0x1f9648['query'][_0x8f41('0x67')],{'transaction':_0x3f5ded})[_0x8f41('0x27')](function(){if(!_[_0x8f41('0x7f')](_0x286d71)){return _0x559c68['removeAgents'](_0x286d71,{'transaction':_0x3f5ded});}})[_0x8f41('0x27')](function(){_0x286d71['forEach'](function(_0x2c3a2f){socket[_0x8f41('0x6e')](_0x8f41('0x80'),{'UserId':_0x2c3a2f,'MailQueueId':_0x559c68['id']});});});});});});})[_0x8f41('0x27')](respondWithStatusCode(_0x112cff,null))[_0x8f41('0x49')](handleError(_0x112cff,null));};exports['addAgents']=function(_0x2bf292,_0x179118,_0x217856){return db[_0x8f41('0x31')][_0x8f41('0x53')]({'where':{'id':_0x2bf292[_0x8f41('0x4b')]['id']}})[_0x8f41('0x27')](handleEntityNotFound(_0x179118,null))[_0x8f41('0x27')](function(_0x348620){if(_0x348620){return _0x348620[_0x8f41('0x81')](_0x2bf292[_0x8f41('0x4e')]['ids'],_[_0x8f41('0x82')](_0x2bf292[_0x8f41('0x4e')],['ids','id'])||{})[_0x8f41('0x83')](function(_0x470fe6){for(var _0x502432=0x0;_0x502432<_0x2bf292['body'][_0x8f41('0x67')][_0x8f41('0x3b')];_0x502432+=0x1){socket[_0x8f41('0x6e')](_0x8f41('0x6f'),{'UserId':Number(_0x2bf292[_0x8f41('0x4e')][_0x8f41('0x67')][_0x502432]),'MailQueueId':Number(_0x2bf292[_0x8f41('0x4b')]['id'])});}return _0x470fe6;});}})['then'](respondWithResult(_0x179118,null))[_0x8f41('0x49')](handleError(_0x179118,null));};exports[_0x8f41('0x84')]=function(_0x3f4e57,_0x5b8a6c,_0x10dcb9){return db[_0x8f41('0x31')][_0x8f41('0x53')]({'where':{'id':_0x3f4e57[_0x8f41('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b8a6c,null))['then'](function(_0xecb6d9){if(_0xecb6d9){return _0xecb6d9[_0x8f41('0x84')](_0x3f4e57['query']['ids'])['then'](function(){if(_[_0x8f41('0x85')](_0x3f4e57[_0x8f41('0x36')][_0x8f41('0x67')])){for(var _0x54c9b4=0x0;_0x54c9b4<_0x3f4e57[_0x8f41('0x36')][_0x8f41('0x67')][_0x8f41('0x3b')];_0x54c9b4+=0x1){socket[_0x8f41('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x3f4e57[_0x8f41('0x36')][_0x8f41('0x67')][_0x54c9b4]),'MailQueueId':Number(_0x3f4e57['params']['id'])});}}else{socket['emit'](_0x8f41('0x80'),{'UserId':Number(_0x3f4e57[_0x8f41('0x36')]['ids']),'MailQueueId':Number(_0x3f4e57[_0x8f41('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b8a6c,null))[_0x8f41('0x49')](handleError(_0x5b8a6c,null));};exports['getAgents']=function(_0x556dd8,_0x457c9a,_0x4e58d8){var _0x515a03={};var _0x20af74={};var _0x2d5707;var _0x45ab06;return db['MailQueue'][_0x8f41('0x59')]({'where':{'id':_0x556dd8[_0x8f41('0x4b')]['id']}})[_0x8f41('0x27')](handleEntityNotFound(_0x457c9a,null))['then'](function(_0x44a721){if(_0x44a721){_0x2d5707=_0x44a721;_0x20af74[_0x8f41('0x35')]=_[_0x8f41('0x4c')](db[_0x8f41('0x5c')]['rawAttributes']);_0x20af74[_0x8f41('0x36')]=_[_0x8f41('0x4c')](_0x556dd8[_0x8f41('0x36')]);_0x20af74['filters']=_[_0x8f41('0x38')](_0x20af74[_0x8f41('0x35')],_0x20af74[_0x8f41('0x36')]);_0x515a03[_0x8f41('0x39')]=_[_0x8f41('0x38')](_0x20af74['model'],qs[_0x8f41('0x3a')](_0x556dd8[_0x8f41('0x36')][_0x8f41('0x3a')]));_0x515a03['attributes']=_0x515a03[_0x8f41('0x39')][_0x8f41('0x3b')]?_0x515a03[_0x8f41('0x39')]:_0x20af74[_0x8f41('0x35')];_0x515a03['order']=qs['sort'](_0x556dd8[_0x8f41('0x36')][_0x8f41('0x3f')]);_0x515a03['where']=qs[_0x8f41('0x37')](_[_0x8f41('0x41')](_0x556dd8['query'],_0x20af74[_0x8f41('0x37')]));if(_0x556dd8['query']['filter']){_0x515a03[_0x8f41('0x40')]=_[_0x8f41('0x43')](_0x515a03[_0x8f41('0x40')],{'$or':_[_0x8f41('0x30')](_0x515a03[_0x8f41('0x39')],function(_0x4c5e3f){var _0x1b3d1c={};_0x1b3d1c[_0x4c5e3f]={'$like':'%'+_0x556dd8[_0x8f41('0x36')][_0x8f41('0x42')]+'%'};return _0x1b3d1c;})});}_0x515a03=_['merge']({},_0x515a03,_0x556dd8['options']);return _0x2d5707['getAgents'](_0x515a03);}})['then'](function(_0x579349){if(_0x579349){_0x45ab06=_0x579349[_0x8f41('0x3b')];if(!_0x556dd8[_0x8f41('0x36')][_0x8f41('0x3c')](_0x8f41('0x3d'))){_0x515a03[_0x8f41('0x21')]=qs[_0x8f41('0x21')](_0x556dd8[_0x8f41('0x36')][_0x8f41('0x21')]);_0x515a03['offset']=qs['offset'](_0x556dd8[_0x8f41('0x36')][_0x8f41('0x1e')]);}return _0x2d5707[_0x8f41('0x86')](_0x515a03);}})[_0x8f41('0x27')](function(_0x5bc290){if(_0x5bc290){return _0x5bc290?{'count':_0x45ab06,'rows':_0x5bc290}:null;}})[_0x8f41('0x27')](respondWithResult(_0x457c9a,null))['catch'](handleError(_0x457c9a,null));}; \ No newline at end of file +var _0x2aaa=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','findAll','findAndCountAll','UserId','agent','createdAt','format','%s/%s','mailPause','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','transaction','each','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','forEach','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','get','MailQueues','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0x2aaa,0x1d8));var _0xa2aa=function(_0x4cad63,_0x653a6b){_0x4cad63=_0x4cad63-0x0;var _0x3e43b4=_0x2aaa[_0x4cad63];return _0x3e43b4;};'use strict';var emlformat=require(_0xa2aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2aa('0x1'));var jsonpatch=require(_0xa2aa('0x2'));var rp=require(_0xa2aa('0x3'));var moment=require('moment');var BPromise=require(_0xa2aa('0x4'));var Mustache=require(_0xa2aa('0x5'));var util=require(_0xa2aa('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa2aa('0x7'));var ejs=require(_0xa2aa('0x8'));var fs=require('fs');var fs_extra=require(_0xa2aa('0x9'));var _=require(_0xa2aa('0xa'));var squel=require(_0xa2aa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa2aa('0xc'));var toCsv=require(_0xa2aa('0x7'));var querystring=require(_0xa2aa('0xd'));var Papa=require(_0xa2aa('0xe'));var Redis=require(_0xa2aa('0xf'));var authService=require(_0xa2aa('0x10'));var qs=require(_0xa2aa('0x11'));var as=require(_0xa2aa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2aa('0x13'))(_0xa2aa('0x14'));var utils=require('../../config/utils');var config=require(_0xa2aa('0x15'));var licenseUtil=require(_0xa2aa('0x16'));var db=require('../../mysqldb')['db'];config[_0xa2aa('0x17')]=_[_0xa2aa('0x18')](config[_0xa2aa('0x17')],{'host':_0xa2aa('0x19'),'port':0x18eb});var socket=require(_0xa2aa('0x1a'))(new Redis(config[_0xa2aa('0x17')]));require(_0xa2aa('0x1b'))[_0xa2aa('0x1c')](socket);function respondWithStatusCode(_0x2478c8,_0x10b327){_0x10b327=_0x10b327||0xcc;return function(_0xfab757){if(_0xfab757){return _0x2478c8[_0xa2aa('0x1d')](_0x10b327);}return _0x2478c8[_0xa2aa('0x1e')](_0x10b327)[_0xa2aa('0x1f')]();};}function respondWithResult(_0x587f3b,_0xad37ea){_0xad37ea=_0xad37ea||0xc8;return function(_0x1e9882){if(_0x1e9882){return _0x587f3b[_0xa2aa('0x1e')](_0xad37ea)[_0xa2aa('0x20')](_0x1e9882);}};}function respondWithFilteredResult(_0x43372f,_0x53767a){return function(_0x496e6e){if(_0x496e6e){var _0x348243=typeof _0x53767a[_0xa2aa('0x21')]===_0xa2aa('0x22')&&typeof _0x53767a['limit']===_0xa2aa('0x22');var _0xa0a8f4=_0x496e6e[_0xa2aa('0x23')];var _0xad1fc0=_0x348243?0x0:_0x53767a[_0xa2aa('0x21')];var _0x53ab91=_0x348243?_0x496e6e[_0xa2aa('0x23')]:_0x53767a[_0xa2aa('0x21')]+_0x53767a[_0xa2aa('0x24')];var _0x5148eb;if(_0x53ab91>=_0xa0a8f4){_0x53ab91=_0xa0a8f4;_0x5148eb=0xc8;}else{_0x5148eb=0xce;}_0x43372f[_0xa2aa('0x1e')](_0x5148eb);return _0x43372f['set'](_0xa2aa('0x25'),_0xad1fc0+'-'+_0x53ab91+'/'+_0xa0a8f4)[_0xa2aa('0x20')](_0x496e6e);}return null;};}function patchUpdates(_0x217830){return function(_0x537c3e){try{jsonpatch['apply'](_0x537c3e,_0x217830,!![]);}catch(_0x499080){return BPromise[_0xa2aa('0x26')](_0x499080);}return _0x537c3e[_0xa2aa('0x27')]();};}function saveUpdates(_0x9badbd,_0x597146){return function(_0x4cd358){if(_0x4cd358){return _0x4cd358[_0xa2aa('0x28')](_0x9badbd)[_0xa2aa('0x29')](function(_0xfdfbc9){return _0xfdfbc9;});}return null;};}function removeEntity(_0x3d63cf,_0x3a8cb9){return function(_0x437655){if(_0x437655){return _0x437655['destroy']()[_0xa2aa('0x29')](function(){var _0x104640=_0x437655[_0xa2aa('0x2a')]({'plain':!![]});var _0x176f49=_0xa2aa('0x2b');return db[_0xa2aa('0x2c')]['destroy']({'where':{'type':_0x176f49,'resourceId':_0x104640['id']}})['then'](function(){return _0x437655;});})[_0xa2aa('0x29')](function(){_0x3d63cf['status'](0xcc)[_0xa2aa('0x1f')]();});}};}function handleEntityNotFound(_0xd3d76c,_0x36db0d){return function(_0x1b407b){if(!_0x1b407b){_0xd3d76c[_0xa2aa('0x1d')](0x194);}return _0x1b407b;};}function handleError(_0x2f6b44,_0x33c12e){_0x33c12e=_0x33c12e||0x1f4;return function(_0x30a5b4){logger[_0xa2aa('0x2d')](_0x30a5b4['stack']);if(_0x30a5b4[_0xa2aa('0x2e')]){delete _0x30a5b4[_0xa2aa('0x2e')];}_0x2f6b44[_0xa2aa('0x1e')](_0x33c12e)[_0xa2aa('0x2f')](_0x30a5b4);};}exports[_0xa2aa('0x30')]=function(_0x2a7e40,_0x5e6ec2){var _0x17f8c4={},_0x407c0c={},_0x57d2f5={'count':0x0,'rows':[]};var _0x40504c=_[_0xa2aa('0x31')](db[_0xa2aa('0x32')][_0xa2aa('0x33')],function(_0xb1bdb7){return{'name':_0xb1bdb7[_0xa2aa('0x34')],'type':_0xb1bdb7[_0xa2aa('0x35')][_0xa2aa('0x36')]};});_0x407c0c['model']=_[_0xa2aa('0x31')](_0x40504c,'name');_0x407c0c[_0xa2aa('0x37')]=_[_0xa2aa('0x38')](_0x2a7e40[_0xa2aa('0x37')]);_0x407c0c[_0xa2aa('0x39')]=_['intersection'](_0x407c0c[_0xa2aa('0x3a')],_0x407c0c[_0xa2aa('0x37')]);_0x17f8c4[_0xa2aa('0x3b')]=_[_0xa2aa('0x3c')](_0x407c0c['model'],qs[_0xa2aa('0x3d')](_0x2a7e40[_0xa2aa('0x37')][_0xa2aa('0x3d')]));_0x17f8c4[_0xa2aa('0x3b')]=_0x17f8c4[_0xa2aa('0x3b')][_0xa2aa('0x3e')]?_0x17f8c4[_0xa2aa('0x3b')]:_0x407c0c[_0xa2aa('0x3a')];if(!_0x2a7e40['query'][_0xa2aa('0x3f')]('nolimit')){_0x17f8c4[_0xa2aa('0x24')]=qs['limit'](_0x2a7e40[_0xa2aa('0x37')][_0xa2aa('0x24')]);_0x17f8c4['offset']=qs[_0xa2aa('0x21')](_0x2a7e40[_0xa2aa('0x37')][_0xa2aa('0x21')]);}_0x17f8c4[_0xa2aa('0x40')]=qs['sort'](_0x2a7e40[_0xa2aa('0x37')][_0xa2aa('0x41')]);_0x17f8c4[_0xa2aa('0x42')]=qs[_0xa2aa('0x39')](_[_0xa2aa('0x43')](_0x2a7e40[_0xa2aa('0x37')],_0x407c0c[_0xa2aa('0x39')]),_0x40504c);if(_0x2a7e40[_0xa2aa('0x37')]['filter']){_0x17f8c4[_0xa2aa('0x42')]=_['merge'](_0x17f8c4[_0xa2aa('0x42')],{'$or':_['map'](_0x40504c,function(_0x47d52d){if(_0x47d52d[_0xa2aa('0x35')]!=='VIRTUAL'){var _0xc6e629={};_0xc6e629[_0x47d52d['name']]={'$like':'%'+_0x2a7e40[_0xa2aa('0x37')][_0xa2aa('0x44')]+'%'};return _0xc6e629;}})});}_0x17f8c4=_[_0xa2aa('0x45')]({},_0x17f8c4,_0x2a7e40[_0xa2aa('0x46')]);var _0xb46d69={'where':_0x17f8c4[_0xa2aa('0x42')]};return db['MailQueue']['count'](_0xb46d69)[_0xa2aa('0x29')](function(_0x201561){_0x57d2f5[_0xa2aa('0x23')]=_0x201561;if(_0x2a7e40[_0xa2aa('0x37')][_0xa2aa('0x47')]){_0x17f8c4[_0xa2aa('0x48')]=[{'all':!![]}];}return db[_0xa2aa('0x32')]['findAll'](_0x17f8c4);})['then'](function(_0x1199c3){_0x57d2f5[_0xa2aa('0x49')]=_0x1199c3;return _0x57d2f5;})[_0xa2aa('0x29')](respondWithFilteredResult(_0x5e6ec2,_0x17f8c4))[_0xa2aa('0x4a')](handleError(_0x5e6ec2,null));};exports[_0xa2aa('0x4b')]=function(_0x1974e2,_0x573692){var _0x10ac30={'raw':!![],'where':{'id':_0x1974e2[_0xa2aa('0x4c')]['id']}},_0x5de155={};_0x5de155['model']=_[_0xa2aa('0x38')](db[_0xa2aa('0x32')][_0xa2aa('0x33')]);_0x5de155[_0xa2aa('0x37')]=_['keys'](_0x1974e2[_0xa2aa('0x37')]);_0x5de155[_0xa2aa('0x39')]=_['intersection'](_0x5de155[_0xa2aa('0x3a')],_0x5de155[_0xa2aa('0x37')]);_0x10ac30['attributes']=_[_0xa2aa('0x3c')](_0x5de155[_0xa2aa('0x3a')],qs[_0xa2aa('0x3d')](_0x1974e2[_0xa2aa('0x37')]['fields']));_0x10ac30['attributes']=_0x10ac30['attributes'][_0xa2aa('0x3e')]?_0x10ac30['attributes']:_0x5de155[_0xa2aa('0x3a')];if(_0x1974e2[_0xa2aa('0x37')][_0xa2aa('0x47')]){_0x10ac30[_0xa2aa('0x48')]=[{'all':!![]}];}_0x10ac30=_[_0xa2aa('0x45')]({},_0x10ac30,_0x1974e2[_0xa2aa('0x46')]);return db['MailQueue'][_0xa2aa('0x4d')](_0x10ac30)[_0xa2aa('0x29')](handleEntityNotFound(_0x573692,null))['then'](respondWithResult(_0x573692,null))[_0xa2aa('0x4a')](handleError(_0x573692,null));};exports[_0xa2aa('0x4e')]=function(_0x4319af,_0x5add51){return db['MailQueue']['create'](_0x4319af[_0xa2aa('0x4f')],{})[_0xa2aa('0x29')](function(_0x3f164c){var _0x18b42b=_0x4319af[_0xa2aa('0x50')][_0xa2aa('0x2a')]({'plain':!![]});if(!_0x18b42b)throw new Error(_0xa2aa('0x51'));if(_0x18b42b[_0xa2aa('0x52')]===_0xa2aa('0x50')){var _0x8d1ac9=_0x3f164c[_0xa2aa('0x2a')]({'plain':!![]});var _0x251309=_0xa2aa('0x2b');return db[_0xa2aa('0x53')]['find']({'where':{'name':_0x251309,'userProfileId':_0x18b42b['userProfileId']},'raw':!![]})['then'](function(_0x345dba){if(_0x345dba&&_0x345dba[_0xa2aa('0x54')]===0x0){return db[_0xa2aa('0x2c')]['create']({'name':_0x8d1ac9['name'],'resourceId':_0x8d1ac9['id'],'type':_0x345dba[_0xa2aa('0x2e')],'sectionId':_0x345dba['id']},{})[_0xa2aa('0x29')](function(){return _0x3f164c;});}else{return _0x3f164c;}})[_0xa2aa('0x4a')](function(_0x5726e8){logger[_0xa2aa('0x2d')](_0xa2aa('0x55'),_0x5726e8);throw _0x5726e8;});}return _0x3f164c;})['then'](respondWithResult(_0x5add51,0xc9))[_0xa2aa('0x4a')](handleError(_0x5add51,null));};exports['update']=function(_0x44a0ff,_0x20f0ad){if(_0x44a0ff[_0xa2aa('0x4f')]['id']){delete _0x44a0ff[_0xa2aa('0x4f')]['id'];}return db[_0xa2aa('0x32')][_0xa2aa('0x4d')]({'where':{'id':_0x44a0ff[_0xa2aa('0x4c')]['id']}})[_0xa2aa('0x29')](handleEntityNotFound(_0x20f0ad,null))['then'](saveUpdates(_0x44a0ff['body'],null))[_0xa2aa('0x29')](respondWithResult(_0x20f0ad,null))[_0xa2aa('0x4a')](handleError(_0x20f0ad,null));};exports['destroy']=function(_0x5be151,_0x2c48e5){return db['MailQueue'][_0xa2aa('0x4d')]({'where':{'id':_0x5be151['params']['id']}})[_0xa2aa('0x29')](handleEntityNotFound(_0x2c48e5,null))[_0xa2aa('0x29')](removeEntity(_0x2c48e5,null))[_0xa2aa('0x4a')](handleError(_0x2c48e5,null));};exports['describe']=function(_0x323edc,_0x447b38){return db[_0xa2aa('0x32')][_0xa2aa('0x56')]()[_0xa2aa('0x29')](respondWithResult(_0x447b38,null))['catch'](handleError(_0x447b38,null));};exports[_0xa2aa('0x57')]=function(_0x1c65f2,_0x2ff01d,_0x33faf8){var _0x4bc256={'raw':!![],'where':{}},_0x5e2036={},_0x38e794;return db[_0xa2aa('0x32')][_0xa2aa('0x58')]({'where':{'id':_0x1c65f2[_0xa2aa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ff01d,null))[_0xa2aa('0x29')](function(_0xf74936){if(_0xf74936){_0x38e794=_0xf74936[_0xa2aa('0x2a')]({'plain':!![]});_0x5e2036[_0xa2aa('0x3a')]=_['keys'](db[_0xa2aa('0x59')][_0xa2aa('0x33')]);_0x5e2036[_0xa2aa('0x37')]=_[_0xa2aa('0x38')](_0x1c65f2['query']);_0x5e2036[_0xa2aa('0x39')]=_[_0xa2aa('0x3c')](_0x5e2036['model'],_0x5e2036[_0xa2aa('0x37')]);_0x4bc256[_0xa2aa('0x3b')]=_[_0xa2aa('0x3c')](_0x5e2036[_0xa2aa('0x3a')],qs[_0xa2aa('0x3d')](_0x1c65f2[_0xa2aa('0x37')][_0xa2aa('0x3d')]));_0x4bc256[_0xa2aa('0x3b')]=_0x4bc256[_0xa2aa('0x3b')][_0xa2aa('0x3e')]?_0x4bc256[_0xa2aa('0x3b')]:_0x5e2036[_0xa2aa('0x3a')];if(!_0x1c65f2['query'][_0xa2aa('0x3f')](_0xa2aa('0x5a'))){_0x4bc256['limit']=qs[_0xa2aa('0x24')](_0x1c65f2[_0xa2aa('0x37')][_0xa2aa('0x24')]);_0x4bc256[_0xa2aa('0x21')]=qs[_0xa2aa('0x21')](_0x1c65f2[_0xa2aa('0x37')][_0xa2aa('0x21')]);}_0x4bc256[_0xa2aa('0x40')]=qs[_0xa2aa('0x41')](_0x1c65f2[_0xa2aa('0x37')][_0xa2aa('0x41')]);_0x4bc256[_0xa2aa('0x42')]=qs['filters'](_[_0xa2aa('0x43')](_0x1c65f2['query'],_0x5e2036['filters']));_0x4bc256[_0xa2aa('0x42')][_0xa2aa('0x5b')]=_0xf74936['id'];if(_0x1c65f2['query'][_0xa2aa('0x44')]){_0x4bc256[_0xa2aa('0x42')]=_[_0xa2aa('0x45')](_0x4bc256[_0xa2aa('0x42')],{'$or':_[_0xa2aa('0x31')](_0x4bc256[_0xa2aa('0x3b')],function(_0x2e579c){var _0x1d60e3={};_0x1d60e3[_0x2e579c]={'$like':'%'+_0x1c65f2[_0xa2aa('0x37')][_0xa2aa('0x44')]+'%'};return _0x1d60e3;})});}_0x4bc256=_[_0xa2aa('0x45')]({},_0x4bc256,_0x1c65f2[_0xa2aa('0x46')]);return db[_0xa2aa('0x59')][_0xa2aa('0x5c')](_0x4bc256);}})[_0xa2aa('0x29')](function(_0x1106bb){if(_0x1106bb){return db['User'][_0xa2aa('0x5d')]({'where':{'id':_['map'](_0x1106bb,_0xa2aa('0x5e')),'role':_0xa2aa('0x5f')},'attributes':['id',_0xa2aa('0x2e'),'mailPause','updatedAt',_0xa2aa('0x60')]});}})[_0xa2aa('0x29')](function(_0x2f5a3a){if(_0x2f5a3a){return{'count':_0x2f5a3a[_0xa2aa('0x23')],'rows':_[_0xa2aa('0x31')](_0x2f5a3a[_0xa2aa('0x49')],function(_0x233dc8){return{'membername':_0x233dc8[_0xa2aa('0x2e')],'UserId':_0x233dc8['id'],'queue_name':_0x38e794[_0xa2aa('0x2e')],'MailQueueId':_0x38e794['id'],'interface':util[_0xa2aa('0x61')](_0xa2aa('0x62'),'SIP',_0x233dc8[_0xa2aa('0x2e')]),'penalty':0x0,'paused':_0x233dc8[_0xa2aa('0x63')],'createdAt':_0x233dc8[_0xa2aa('0x60')],'updatedAt':_0x233dc8[_0xa2aa('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa2aa('0x29')](respondWithFilteredResult(_0x2ff01d,_0x4bc256))['catch'](handleError(_0x2ff01d,null));};exports['getTeams']=function(_0x5e0b1c,_0x46c120,_0x3da2c6){var _0x169c89={};var _0x24dae6={};var _0x54169a;var _0x226e5c;return db[_0xa2aa('0x32')]['findOne']({'where':{'id':_0x5e0b1c[_0xa2aa('0x4c')]['id']}})[_0xa2aa('0x29')](handleEntityNotFound(_0x46c120,null))[_0xa2aa('0x29')](function(_0x44b901){if(_0x44b901){_0x54169a=_0x44b901;_0x24dae6[_0xa2aa('0x3a')]=_[_0xa2aa('0x38')](db[_0xa2aa('0x65')][_0xa2aa('0x33')]);_0x24dae6['query']=_[_0xa2aa('0x38')](_0x5e0b1c[_0xa2aa('0x37')]);_0x24dae6['filters']=_[_0xa2aa('0x3c')](_0x24dae6[_0xa2aa('0x3a')],_0x24dae6[_0xa2aa('0x37')]);_0x169c89['attributes']=_[_0xa2aa('0x3c')](_0x24dae6['model'],qs[_0xa2aa('0x3d')](_0x5e0b1c['query']['fields']));_0x169c89[_0xa2aa('0x3b')]=_0x169c89['attributes'][_0xa2aa('0x3e')]?_0x169c89[_0xa2aa('0x3b')]:_0x24dae6['model'];_0x169c89[_0xa2aa('0x40')]=qs[_0xa2aa('0x41')](_0x5e0b1c['query'][_0xa2aa('0x41')]);_0x169c89[_0xa2aa('0x42')]=qs[_0xa2aa('0x39')](_['pick'](_0x5e0b1c[_0xa2aa('0x37')],_0x24dae6[_0xa2aa('0x39')]));if(_0x5e0b1c[_0xa2aa('0x37')]['filter']){_0x169c89[_0xa2aa('0x42')]=_[_0xa2aa('0x45')](_0x169c89[_0xa2aa('0x42')],{'$or':_[_0xa2aa('0x31')](_0x169c89[_0xa2aa('0x3b')],function(_0x594b60){var _0x50df65={};_0x50df65[_0x594b60]={'$like':'%'+_0x5e0b1c[_0xa2aa('0x37')][_0xa2aa('0x44')]+'%'};return _0x50df65;})});}_0x169c89=_[_0xa2aa('0x45')]({},_0x169c89,_0x5e0b1c[_0xa2aa('0x46')]);return _0x54169a['getTeams'](_0x169c89);}})[_0xa2aa('0x29')](function(_0x24344c){if(_0x24344c){_0x226e5c=_0x24344c[_0xa2aa('0x3e')];if(!_0x5e0b1c[_0xa2aa('0x37')][_0xa2aa('0x3f')](_0xa2aa('0x5a'))){_0x169c89[_0xa2aa('0x24')]=qs[_0xa2aa('0x24')](_0x5e0b1c[_0xa2aa('0x37')][_0xa2aa('0x24')]);_0x169c89[_0xa2aa('0x21')]=qs[_0xa2aa('0x21')](_0x5e0b1c[_0xa2aa('0x37')]['offset']);}return _0x54169a[_0xa2aa('0x66')](_0x169c89);}})[_0xa2aa('0x29')](function(_0x294a95){if(_0x294a95){return _0x294a95?{'count':_0x226e5c,'rows':_0x294a95}:null;}})['then'](respondWithResult(_0x46c120,null))[_0xa2aa('0x4a')](handleError(_0x46c120,null));};exports[_0xa2aa('0x67')]=function(_0xd4edb1,_0xf1353b,_0x2f1c81){var _0x13b3df=_0xd4edb1[_0xa2aa('0x4f')][_0xa2aa('0x68')];return db['Team']['findAll']({'where':{'id':_0x13b3df},'attributes':['id'],'include':[{'model':db[_0xa2aa('0x69')],'as':_0xa2aa('0x6a'),'attributes':['id','name',_0xa2aa('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0xa2aa('0x29')](function(_0x5a2f73){if(_0x5a2f73){var _0x4274ec=_['flatMap'](_0x5a2f73,function(_0x4f4810){var _0x5e7cf6=_0x4f4810['get']({'plain':!![]});return _0x5e7cf6['Agents'];});return db['MailQueue']['find']({'where':{'id':_0xd4edb1['params']['id']}})[_0xa2aa('0x29')](function(_0x4ba030){return db['sequelize'][_0xa2aa('0x6c')](function(_0x112023){return _0x4ba030[_0xa2aa('0x67')](_0x13b3df,{'transaction':_0x112023})[_0xa2aa('0x29')](function(){return BPromise[_0xa2aa('0x6d')](_0x4274ec,function(_0x4cc150){return db[_0xa2aa('0x59')]['findOrCreate']({'where':{'UserId':_0x4cc150['id'],'MailQueueId':_0xd4edb1[_0xa2aa('0x4c')]['id']},'transaction':_0x112023});});})[_0xa2aa('0x29')](function(){_0x4274ec['forEach'](function(_0x1c8fda){socket[_0xa2aa('0x6e')](_0xa2aa('0x6f'),{'UserId':_0x1c8fda['id'],'MailQueueId':_0x4ba030['id']});});});});});}})[_0xa2aa('0x29')](respondWithStatusCode(_0xf1353b,null))['catch'](handleError(_0xf1353b,null));};exports[_0xa2aa('0x70')]=function(_0x1d2f0d,_0x3fe5d8,_0xf85419){return db[_0xa2aa('0x65')][_0xa2aa('0x5c')]({'where':{'id':_0x1d2f0d[_0xa2aa('0x37')][_0xa2aa('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa2aa('0x69')],'as':_0xa2aa('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xa2aa('0x29')](handleEntityNotFound(_0x3fe5d8,null))['then'](function(_0x3b820c){var _0x6f708b=_[_0xa2aa('0x31')](_0x3b820c,'id');var _0x561066=[];var _0x16160d=[];var _0x6568e7=squel[_0xa2aa('0x71')]();_0x6568e7[_0xa2aa('0x72')](_0xa2aa('0x73'))[_0xa2aa('0x74')](_0xa2aa('0x75'),'tq')['join'](_0xa2aa('0x76'),'ut',_0xa2aa('0x77'))['where'](_0xa2aa('0x78'),_0x1d2f0d[_0xa2aa('0x4c')]['id']);for(var _0x2d2bd4=0x0;_0x2d2bd4<_0x3b820c[_0xa2aa('0x3e')];_0x2d2bd4+=0x1){let _0x3c3747=_0x3b820c[_0x2d2bd4];for(var _0x2484a8=0x0;_0x2484a8<_0x3c3747[_0xa2aa('0x6a')]['length'];_0x2484a8+=0x1){let _0x102dae=_0x3c3747[_0xa2aa('0x6a')][_0x2484a8];var _0x43b5af=_0x6568e7['clone']();_0x43b5af[_0xa2aa('0x42')]('ut.UserId\x20=\x20?',_0x102dae['id']);_0x16160d[_0xa2aa('0x79')](db[_0xa2aa('0x7a')][_0xa2aa('0x37')](_0x43b5af[_0xa2aa('0x7b')](),{'type':db[_0xa2aa('0x7a')][_0xa2aa('0x7c')][_0xa2aa('0x7d')]})[_0xa2aa('0x29')](function(_0x599039){if(_0x599039[_0xa2aa('0x3e')]===0x1){return _0x102dae['id'];}else{var _0x5449a2=_[_0xa2aa('0x7e')](_['map'](_0x599039,_0xa2aa('0x7f')),function(_0x2ac0e8){return _[_0xa2aa('0x80')](_0x6f708b,_0x2ac0e8);});if(_0x5449a2){return _0x102dae['id'];}}}));}}return BPromise['all'](_0x16160d)['then'](function(_0x419af5){_0x561066=_(_0x561066)[_0xa2aa('0x81')](_0x419af5)['compact']()[_0xa2aa('0x82')]();return db[_0xa2aa('0x32')][_0xa2aa('0x4d')]({'where':{'id':_0x1d2f0d[_0xa2aa('0x4c')]['id']}})[_0xa2aa('0x29')](function(_0x303dbe){return db[_0xa2aa('0x7a')]['transaction'](function(_0x141cc0){return _0x303dbe['removeTeams'](_0x1d2f0d[_0xa2aa('0x37')][_0xa2aa('0x68')],{'transaction':_0x141cc0})[_0xa2aa('0x29')](function(){if(!_[_0xa2aa('0x83')](_0x561066)){return _0x303dbe['removeAgents'](_0x561066,{'transaction':_0x141cc0});}})['then'](function(){_0x561066[_0xa2aa('0x84')](function(_0x50457d){socket[_0xa2aa('0x6e')](_0xa2aa('0x85'),{'UserId':_0x50457d,'MailQueueId':_0x303dbe['id']});});});});});});})[_0xa2aa('0x29')](respondWithStatusCode(_0x3fe5d8,null))[_0xa2aa('0x4a')](handleError(_0x3fe5d8,null));};exports['addAgents']=function(_0x1e9683,_0x3c8317,_0xceca9d){return db[_0xa2aa('0x32')][_0xa2aa('0x4d')]({'where':{'id':_0x1e9683['params']['id']}})['then'](handleEntityNotFound(_0x3c8317,null))[_0xa2aa('0x29')](function(_0x137415){if(_0x137415){return _0x137415[_0xa2aa('0x86')](_0x1e9683['body'][_0xa2aa('0x68')],_['omit'](_0x1e9683['body'],['ids','id'])||{})[_0xa2aa('0x87')](function(_0x14f901){for(var _0x1d4f9a=0x0;_0x1d4f9a<_0x1e9683[_0xa2aa('0x4f')]['ids'][_0xa2aa('0x3e')];_0x1d4f9a+=0x1){socket[_0xa2aa('0x6e')](_0xa2aa('0x6f'),{'UserId':Number(_0x1e9683[_0xa2aa('0x4f')][_0xa2aa('0x68')][_0x1d4f9a]),'MailQueueId':Number(_0x1e9683['params']['id'])});}return _0x14f901;});}})[_0xa2aa('0x29')](respondWithResult(_0x3c8317,null))[_0xa2aa('0x4a')](handleError(_0x3c8317,null));};exports[_0xa2aa('0x88')]=function(_0x3ce465,_0xf2bb14,_0x381bb7){return db['MailQueue']['find']({'where':{'id':_0x3ce465['params']['id']}})[_0xa2aa('0x29')](handleEntityNotFound(_0xf2bb14,null))['then'](function(_0x48e9e){if(_0x48e9e){return _0x48e9e[_0xa2aa('0x88')](_0x3ce465[_0xa2aa('0x37')][_0xa2aa('0x68')])['then'](function(){if(_[_0xa2aa('0x89')](_0x3ce465[_0xa2aa('0x37')][_0xa2aa('0x68')])){for(var _0x1c9767=0x0;_0x1c9767<_0x3ce465['query']['ids'][_0xa2aa('0x3e')];_0x1c9767+=0x1){socket[_0xa2aa('0x6e')](_0xa2aa('0x85'),{'UserId':Number(_0x3ce465[_0xa2aa('0x37')]['ids'][_0x1c9767]),'MailQueueId':Number(_0x3ce465[_0xa2aa('0x4c')]['id'])});}}else{socket[_0xa2aa('0x6e')](_0xa2aa('0x85'),{'UserId':Number(_0x3ce465[_0xa2aa('0x37')][_0xa2aa('0x68')]),'MailQueueId':Number(_0x3ce465[_0xa2aa('0x4c')]['id'])});}});}})[_0xa2aa('0x29')](respondWithStatusCode(_0xf2bb14,null))['catch'](handleError(_0xf2bb14,null));};exports[_0xa2aa('0x8a')]=function(_0x18999f,_0x26e6e8,_0x450a28){var _0x14d304={};var _0x19edd8={};var _0x52e58c;var _0x4193ca;return db[_0xa2aa('0x32')][_0xa2aa('0x58')]({'where':{'id':_0x18999f['params']['id']}})[_0xa2aa('0x29')](handleEntityNotFound(_0x26e6e8,null))['then'](function(_0x153019){if(_0x153019){_0x52e58c=_0x153019;_0x19edd8[_0xa2aa('0x3a')]=_[_0xa2aa('0x38')](db['User'][_0xa2aa('0x33')]);_0x19edd8[_0xa2aa('0x37')]=_[_0xa2aa('0x38')](_0x18999f[_0xa2aa('0x37')]);_0x19edd8[_0xa2aa('0x39')]=_['intersection'](_0x19edd8[_0xa2aa('0x3a')],_0x19edd8[_0xa2aa('0x37')]);_0x14d304[_0xa2aa('0x3b')]=_[_0xa2aa('0x3c')](_0x19edd8[_0xa2aa('0x3a')],qs[_0xa2aa('0x3d')](_0x18999f[_0xa2aa('0x37')][_0xa2aa('0x3d')]));_0x14d304['attributes']=_0x14d304[_0xa2aa('0x3b')][_0xa2aa('0x3e')]?_0x14d304[_0xa2aa('0x3b')]:_0x19edd8[_0xa2aa('0x3a')];_0x14d304[_0xa2aa('0x40')]=qs[_0xa2aa('0x41')](_0x18999f[_0xa2aa('0x37')][_0xa2aa('0x41')]);_0x14d304['where']=qs[_0xa2aa('0x39')](_['pick'](_0x18999f[_0xa2aa('0x37')],_0x19edd8[_0xa2aa('0x39')]));if(_0x18999f[_0xa2aa('0x37')]['filter']){_0x14d304[_0xa2aa('0x42')]=_['merge'](_0x14d304[_0xa2aa('0x42')],{'$or':_[_0xa2aa('0x31')](_0x14d304[_0xa2aa('0x3b')],function(_0x416900){var _0x159501={};_0x159501[_0x416900]={'$like':'%'+_0x18999f[_0xa2aa('0x37')]['filter']+'%'};return _0x159501;})});}_0x14d304=_[_0xa2aa('0x45')]({},_0x14d304,_0x18999f[_0xa2aa('0x46')]);return _0x52e58c['getAgents'](_0x14d304);}})[_0xa2aa('0x29')](function(_0x503e38){if(_0x503e38){_0x4193ca=_0x503e38[_0xa2aa('0x3e')];if(!_0x18999f[_0xa2aa('0x37')][_0xa2aa('0x3f')](_0xa2aa('0x5a'))){_0x14d304[_0xa2aa('0x24')]=qs[_0xa2aa('0x24')](_0x18999f[_0xa2aa('0x37')][_0xa2aa('0x24')]);_0x14d304[_0xa2aa('0x21')]=qs['offset'](_0x18999f[_0xa2aa('0x37')][_0xa2aa('0x21')]);}return _0x52e58c[_0xa2aa('0x8a')](_0x14d304);}})[_0xa2aa('0x29')](function(_0x40c62a){if(_0x40c62a){return _0x40c62a?{'count':_0x4193ca,'rows':_0x40c62a}:null;}})['then'](respondWithResult(_0x26e6e8,null))['catch'](handleError(_0x26e6e8,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b9d951c..4db4545 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 _0x72cd=['exports','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x2ebe2b,_0x5b67de){var _0x197a69=function(_0x18a272){while(--_0x18a272){_0x2ebe2b['push'](_0x2ebe2b['shift']());}};_0x197a69(++_0x5b67de);}(_0x72cd,0x199));var _0xd72c=function(_0x2c899e,_0x46ae0c){_0x2c899e=_0x2c899e-0x0;var _0x4067e8=_0x72cd[_0x2c899e];return _0x4067e8;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xd72c('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd72c('0x1')](0x0);var events={'afterCreate':_0xd72c('0x2'),'afterUpdate':'update','afterDestroy':_0xd72c('0x3')};function emitEvent(_0x4e86b9){return function(_0x2dffe6,_0x31cd67,_0x2854c6){MailQueueEvents[_0xd72c('0x4')](_0x4e86b9+':'+_0x2dffe6['id'],_0x2dffe6);MailQueueEvents[_0xd72c('0x4')](_0x4e86b9,_0x2dffe6);_0x2854c6(null);};}for(var e in events){if(events[_0xd72c('0x5')](e)){var event=events[e];MailQueue[_0xd72c('0x6')](e,emitEvent(event));}}module[_0xd72c('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xcfae=['hasOwnProperty','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x236c12,_0x38cfec){var _0x3bc65d=function(_0x4b4d04){while(--_0x4b4d04){_0x236c12['push'](_0x236c12['shift']());}};_0x3bc65d(++_0x38cfec);}(_0xcfae,0x1c4));var _0xecfa=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xcfae[_0xc6be3a];return _0x56a310;};'use strict';var EventEmitter=require(_0xecfa('0x0'));var MailQueue=require(_0xecfa('0x1'))['db'][_0xecfa('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xecfa('0x3')](0x0);var events={'afterCreate':_0xecfa('0x4'),'afterUpdate':_0xecfa('0x5'),'afterDestroy':_0xecfa('0x6')};function emitEvent(_0x57b823){return function(_0x401e83,_0x3c586a,_0xe58a0){MailQueueEvents[_0xecfa('0x7')](_0x57b823+':'+_0x401e83['id'],_0x401e83);MailQueueEvents[_0xecfa('0x7')](_0x57b823,_0x401e83);_0xe58a0(null);};}for(var e in events){if(events[_0xecfa('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xecfa('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c841f67..5748876 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 _0x8053=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailQueue'];(function(_0x223c7e,_0x52c1c9){var _0x36096c=function(_0x235479){while(--_0x235479){_0x223c7e['push'](_0x223c7e['shift']());}};_0x36096c(++_0x52c1c9);}(_0x8053,0x1b8));var _0x3805=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x8053[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0x3805('0x0'));var util=require(_0x3805('0x1'));var logger=require('../../config/logger')(_0x3805('0x2'));var moment=require(_0x3805('0x3'));var BPromise=require(_0x3805('0x4'));var rp=require(_0x3805('0x5'));var fs=require('fs');var path=require(_0x3805('0x6'));var rimraf=require('rimraf');var config=require(_0x3805('0x7'));var attributes=require('./mailQueue.attributes');module[_0x3805('0x8')]=function(_0x558a0a,_0x3bb7c1){return _0x558a0a[_0x3805('0x9')](_0x3805('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc04=['MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc04,0xb6));var _0x4cc0=function(_0x13ec8f,_0x540a3f){_0x13ec8f=_0x13ec8f-0x0;var _0x3e6c13=_0xcc04[_0x13ec8f];return _0x3e6c13;};'use strict';var _=require(_0x4cc0('0x0'));var util=require(_0x4cc0('0x1'));var logger=require(_0x4cc0('0x2'))(_0x4cc0('0x3'));var moment=require(_0x4cc0('0x4'));var BPromise=require(_0x4cc0('0x5'));var rp=require(_0x4cc0('0x6'));var fs=require('fs');var path=require(_0x4cc0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4cc0('0x8'));module[_0x4cc0('0x9')]=function(_0x387456,_0x16e5ee){return _0x387456['define'](_0x4cc0('0xa'),attributes,{'tableName':_0x4cc0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index d290c65..cdaca42 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 _0x669d=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailQueue','MailQueue','options','where','attributes','include','model','map','ShowMailQueue','find'];(function(_0x451524,_0x5f2639){var _0x31c51d=function(_0x304b3c){while(--_0x304b3c){_0x451524['push'](_0x451524['shift']());}};_0x31c51d(++_0x5f2639);}(_0x669d,0xc9));var _0xd669=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x669d[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xd669('0x0'));var util=require(_0xd669('0x1'));var moment=require(_0xd669('0x2'));var BPromise=require(_0xd669('0x3'));var rs=require(_0xd669('0x4'));var fs=require('fs');var Redis=require(_0xd669('0x5'));var db=require(_0xd669('0x6'))['db'];var utils=require(_0xd669('0x7'));var logger=require('../../config/logger')(_0xd669('0x8'));var config=require(_0xd669('0x9'));var jayson=require(_0xd669('0xa'));var client=jayson[_0xd669('0xb')][_0xd669('0xc')]({'port':0x232a});config[_0xd669('0xd')]=_[_0xd669('0xe')](config[_0xd669('0xd')],{'host':_0xd669('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')[_0xd669('0x10')](socket);function respondWithRpcPromise(_0x5dba88,_0xa24cf0,_0x527d55){return new BPromise(function(_0x4cf6f6,_0x53c496){return client[_0xd669('0x11')](_0x5dba88,_0x527d55)[_0xd669('0x12')](function(_0x55624c){logger[_0xd669('0x13')](_0xd669('0x14'),_0xa24cf0,'request\x20sent');logger[_0xd669('0x15')](_0xd669('0x16'),_0xa24cf0,_0xd669('0x17'),JSON[_0xd669('0x18')](_0x55624c));if(_0x55624c['error']){if(_0x55624c[_0xd669('0x19')][_0xd669('0x1a')]===0x1f4){logger[_0xd669('0x19')](_0xd669('0x14'),_0xa24cf0,_0x55624c['error']['message']);return _0x53c496(_0x55624c[_0xd669('0x19')][_0xd669('0x1b')]);}logger[_0xd669('0x19')](_0xd669('0x14'),_0xa24cf0,_0x55624c[_0xd669('0x19')][_0xd669('0x1b')]);return _0x4cf6f6(_0x55624c[_0xd669('0x19')][_0xd669('0x1b')]);}else{logger[_0xd669('0x13')](_0xd669('0x14'),_0xa24cf0,'request\x20sent');_0x4cf6f6(_0x55624c[_0xd669('0x1c')]['message']);}})['catch'](function(_0x3b9e0c){logger[_0xd669('0x19')](_0xd669('0x14'),_0xa24cf0,_0x3b9e0c);_0x53c496(_0x3b9e0c);});});}exports[_0xd669('0x1d')]=function(_0x52d3f2){var _0x413845=this;return new Promise(function(_0x3acb07,_0x57b527){return db[_0xd669('0x1e')]['findAll']({'raw':_0x52d3f2[_0xd669('0x1f')]?_0x52d3f2[_0xd669('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x52d3f2[_0xd669('0x1f')]?_0x52d3f2[_0xd669('0x1f')][_0xd669('0x20')]||null:null,'attributes':_0x52d3f2[_0xd669('0x1f')]?_0x52d3f2[_0xd669('0x1f')][_0xd669('0x21')]||null:null,'limit':_0x52d3f2[_0xd669('0x1f')]?_0x52d3f2['options']['limit']||null:null,'include':_0x52d3f2[_0xd669('0x1f')]?_0x52d3f2[_0xd669('0x1f')][_0xd669('0x22')]?_['map'](_0x52d3f2[_0xd669('0x1f')][_0xd669('0x22')],function(_0x3c63e7){return{'model':db[_0x3c63e7[_0xd669('0x23')]],'as':_0x3c63e7['as'],'attributes':_0x3c63e7[_0xd669('0x21')],'include':_0x3c63e7[_0xd669('0x22')]?_[_0xd669('0x24')](_0x3c63e7[_0xd669('0x22')],function(_0x4fa4e7){return{'model':db[_0x4fa4e7[_0xd669('0x23')]],'as':_0x4fa4e7['as'],'attributes':_0x4fa4e7[_0xd669('0x21')],'include':_0x4fa4e7[_0xd669('0x22')]?_[_0xd669('0x24')](_0x4fa4e7[_0xd669('0x22')],function(_0xc01c7e){return{'model':db[_0xc01c7e[_0xd669('0x23')]],'as':_0xc01c7e['as'],'attributes':_0xc01c7e[_0xd669('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd669('0x12')](function(_0x17c8e1){logger[_0xd669('0x13')](_0xd669('0x1d'),_0x52d3f2);logger['debug'](_0xd669('0x1d'),_0x52d3f2,JSON['stringify'](_0x17c8e1));_0x3acb07(_0x17c8e1);})['catch'](function(_0x354074){logger['error']('GetMailQueue',_0x354074[_0xd669('0x1b')],_0x52d3f2);_0x57b527(_0x413845[_0xd669('0x19')](0x1f4,_0x354074[_0xd669('0x1b')]));});});};exports[_0xd669('0x25')]=function(_0x23a1da){var _0x1ef1f5=this;return new Promise(function(_0x35fa2e,_0x2ed7b2){return db['MailQueue'][_0xd669('0x26')]({'raw':_0x23a1da[_0xd669('0x1f')]?_0x23a1da[_0xd669('0x1f')][_0xd669('0x27')]===undefined?!![]:![]:!![],'where':_0x23a1da[_0xd669('0x1f')]?_0x23a1da[_0xd669('0x1f')]['where']||null:null,'attributes':_0x23a1da[_0xd669('0x1f')]?_0x23a1da[_0xd669('0x1f')][_0xd669('0x21')]||null:null,'include':_0x23a1da[_0xd669('0x1f')]?_0x23a1da[_0xd669('0x1f')][_0xd669('0x22')]?_[_0xd669('0x24')](_0x23a1da[_0xd669('0x1f')][_0xd669('0x22')],function(_0x537405){return{'model':db[_0x537405[_0xd669('0x23')]],'as':_0x537405['as'],'attributes':_0x537405['attributes'],'include':_0x537405[_0xd669('0x22')]?_['map'](_0x537405[_0xd669('0x22')],function(_0x2d8ef8){return{'model':db[_0x2d8ef8['model']],'as':_0x2d8ef8['as'],'attributes':_0x2d8ef8[_0xd669('0x21')],'include':_0x2d8ef8[_0xd669('0x22')]?_[_0xd669('0x24')](_0x2d8ef8['include'],function(_0x3859f6){return{'model':db[_0x3859f6[_0xd669('0x23')]],'as':_0x3859f6['as'],'attributes':_0x3859f6[_0xd669('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd669('0x12')](function(_0x53d2ed){logger[_0xd669('0x13')]('ShowMailQueue',_0x23a1da);logger[_0xd669('0x15')](_0xd669('0x25'),_0x23a1da,JSON['stringify'](_0x53d2ed));_0x35fa2e(_0x53d2ed);})['catch'](function(_0x342648){logger['error'](_0xd669('0x25'),_0x342648['message'],_0x23a1da);_0x2ed7b2(_0x1ef1f5[_0xd669('0x19')](0x1f4,_0x342648['message']));});});}; \ No newline at end of file +var _0x67be=['ShowMailQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','MailQueue','findAll','options','raw','limit','include','model','attributes','map','GetMailQueue'];(function(_0x435df9,_0x31ac27){var _0x4cc30b=function(_0x362503){while(--_0x362503){_0x435df9['push'](_0x435df9['shift']());}};_0x4cc30b(++_0x31ac27);}(_0x67be,0x105));var _0xe67b=function(_0x49d4dc,_0xcb20b2){_0x49d4dc=_0x49d4dc-0x0;var _0x9d6c26=_0x67be[_0x49d4dc];return _0x9d6c26;};'use strict';var _=require(_0xe67b('0x0'));var util=require(_0xe67b('0x1'));var moment=require(_0xe67b('0x2'));var BPromise=require(_0xe67b('0x3'));var rs=require(_0xe67b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe67b('0x5'))['db'];var utils=require(_0xe67b('0x6'));var logger=require(_0xe67b('0x7'))(_0xe67b('0x8'));var config=require('../../config/environment');var jayson=require(_0xe67b('0x9'));var client=jayson[_0xe67b('0xa')][_0xe67b('0xb')]({'port':0x232a});config['redis']=_[_0xe67b('0xc')](config['redis'],{'host':_0xe67b('0xd'),'port':0x18eb});var socket=require(_0xe67b('0xe'))(new Redis(config[_0xe67b('0xf')]));require(_0xe67b('0x10'))[_0xe67b('0x11')](socket);function respondWithRpcPromise(_0x338ecc,_0x2dfd8a,_0x5139cd){return new BPromise(function(_0x2ed69f,_0xf18ad0){return client[_0xe67b('0x12')](_0x338ecc,_0x5139cd)[_0xe67b('0x13')](function(_0x3d5903){logger[_0xe67b('0x14')]('MailQueue,\x20%s,\x20%s',_0x2dfd8a,'request\x20sent');logger[_0xe67b('0x15')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x2dfd8a,_0xe67b('0x16'),JSON[_0xe67b('0x17')](_0x3d5903));if(_0x3d5903[_0xe67b('0x18')]){if(_0x3d5903[_0xe67b('0x18')][_0xe67b('0x19')]===0x1f4){logger[_0xe67b('0x18')](_0xe67b('0x1a'),_0x2dfd8a,_0x3d5903[_0xe67b('0x18')][_0xe67b('0x1b')]);return _0xf18ad0(_0x3d5903[_0xe67b('0x18')][_0xe67b('0x1b')]);}logger[_0xe67b('0x18')](_0xe67b('0x1a'),_0x2dfd8a,_0x3d5903['error']['message']);return _0x2ed69f(_0x3d5903['error'][_0xe67b('0x1b')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x2dfd8a,_0xe67b('0x16'));_0x2ed69f(_0x3d5903[_0xe67b('0x1c')]['message']);}})[_0xe67b('0x1d')](function(_0x284eb3){logger['error'](_0xe67b('0x1a'),_0x2dfd8a,_0x284eb3);_0xf18ad0(_0x284eb3);});});}exports['GetMailQueue']=function(_0x2e2c80){var _0x1898cf=this;return new Promise(function(_0x859836,_0x46b08b){return db[_0xe67b('0x1e')][_0xe67b('0x1f')]({'raw':_0x2e2c80[_0xe67b('0x20')]?_0x2e2c80[_0xe67b('0x20')][_0xe67b('0x21')]===undefined?!![]:![]:!![],'where':_0x2e2c80[_0xe67b('0x20')]?_0x2e2c80[_0xe67b('0x20')]['where']||null:null,'attributes':_0x2e2c80[_0xe67b('0x20')]?_0x2e2c80[_0xe67b('0x20')]['attributes']||null:null,'limit':_0x2e2c80[_0xe67b('0x20')]?_0x2e2c80[_0xe67b('0x20')][_0xe67b('0x22')]||null:null,'include':_0x2e2c80[_0xe67b('0x20')]?_0x2e2c80[_0xe67b('0x20')][_0xe67b('0x23')]?_['map'](_0x2e2c80[_0xe67b('0x20')][_0xe67b('0x23')],function(_0x2c907a){return{'model':db[_0x2c907a[_0xe67b('0x24')]],'as':_0x2c907a['as'],'attributes':_0x2c907a[_0xe67b('0x25')],'include':_0x2c907a[_0xe67b('0x23')]?_['map'](_0x2c907a[_0xe67b('0x23')],function(_0x176307){return{'model':db[_0x176307[_0xe67b('0x24')]],'as':_0x176307['as'],'attributes':_0x176307[_0xe67b('0x25')],'include':_0x176307[_0xe67b('0x23')]?_[_0xe67b('0x26')](_0x176307[_0xe67b('0x23')],function(_0x54f99e){return{'model':db[_0x54f99e[_0xe67b('0x24')]],'as':_0x54f99e['as'],'attributes':_0x54f99e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe67b('0x13')](function(_0x235627){logger[_0xe67b('0x14')](_0xe67b('0x27'),_0x2e2c80);logger[_0xe67b('0x15')](_0xe67b('0x27'),_0x2e2c80,JSON[_0xe67b('0x17')](_0x235627));_0x859836(_0x235627);})['catch'](function(_0x302b84){logger[_0xe67b('0x18')](_0xe67b('0x27'),_0x302b84['message'],_0x2e2c80);_0x46b08b(_0x1898cf[_0xe67b('0x18')](0x1f4,_0x302b84['message']));});});};exports[_0xe67b('0x28')]=function(_0x5bacc){var _0x331693=this;return new Promise(function(_0x80d907,_0x480dfe){return db[_0xe67b('0x1e')][_0xe67b('0x29')]({'raw':_0x5bacc['options']?_0x5bacc[_0xe67b('0x20')][_0xe67b('0x21')]===undefined?!![]:![]:!![],'where':_0x5bacc['options']?_0x5bacc['options'][_0xe67b('0x2a')]||null:null,'attributes':_0x5bacc['options']?_0x5bacc[_0xe67b('0x20')][_0xe67b('0x25')]||null:null,'include':_0x5bacc[_0xe67b('0x20')]?_0x5bacc['options'][_0xe67b('0x23')]?_['map'](_0x5bacc[_0xe67b('0x20')][_0xe67b('0x23')],function(_0x215847){return{'model':db[_0x215847[_0xe67b('0x24')]],'as':_0x215847['as'],'attributes':_0x215847['attributes'],'include':_0x215847[_0xe67b('0x23')]?_[_0xe67b('0x26')](_0x215847['include'],function(_0x2f5fd6){return{'model':db[_0x2f5fd6['model']],'as':_0x2f5fd6['as'],'attributes':_0x2f5fd6[_0xe67b('0x25')],'include':_0x2f5fd6[_0xe67b('0x23')]?_[_0xe67b('0x26')](_0x2f5fd6['include'],function(_0x4406b3){return{'model':db[_0x4406b3[_0xe67b('0x24')]],'as':_0x4406b3['as'],'attributes':_0x4406b3[_0xe67b('0x25')]};}):[]};}):[]};}):[]:[]})[_0xe67b('0x13')](function(_0x4459f6){logger[_0xe67b('0x14')](_0xe67b('0x28'),_0x5bacc);logger['debug'](_0xe67b('0x28'),_0x5bacc,JSON[_0xe67b('0x17')](_0x4459f6));_0x80d907(_0x4459f6);})['catch'](function(_0x1ac94d){logger[_0xe67b('0x18')]('ShowMailQueue',_0x1ac94d['message'],_0x5bacc);_0x480dfe(_0x331693['error'](0x1f4,_0x1ac94d[_0xe67b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index a423a8f..bb51eba 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 _0xfbe6=['emit','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfbe6,0x6d));var _0x6fbe=function(_0x246c15,_0x1b7382){_0x246c15=_0x246c15-0x0;var _0x3b116b=_0xfbe6[_0x246c15];return _0x3b116b;};'use strict';var MailQueueEvents=require(_0x6fbe('0x0'));var events=[_0x6fbe('0x1'),_0x6fbe('0x2'),'update'];function createListener(_0xb54cc1,_0x8f9f17){return function(_0x3c7f69){_0x8f9f17[_0x6fbe('0x3')](_0xb54cc1,_0x3c7f69);};}function removeListener(_0xb7d8ac,_0x591c40){return function(){MailQueueEvents[_0x6fbe('0x4')](_0xb7d8ac,_0x591c40);};}exports[_0x6fbe('0x5')]=function(_0x46b337){for(var _0x120352=0x0,_0x533992=events[_0x6fbe('0x6')];_0x120352<_0x533992;_0x120352++){var _0x1be794=events[_0x120352];var _0x439feb=createListener('mailQueue:'+_0x1be794,_0x46b337);MailQueueEvents['on'](_0x1be794,_0x439feb);}}; \ No newline at end of file +var _0x59d8=['update','emit','register','length','./mailQueue.events'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x59d8,0x95));var _0x859d=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x59d8[_0x24061a];return _0x82054e;};'use strict';var MailQueueEvents=require(_0x859d('0x0'));var events=['save','remove',_0x859d('0x1')];function createListener(_0x2ea34e,_0x2e8a4a){return function(_0x2e3cbb){_0x2e8a4a[_0x859d('0x2')](_0x2ea34e,_0x2e3cbb);};}function removeListener(_0x4fbe3a,_0x4d248a){return function(){MailQueueEvents['removeListener'](_0x4fbe3a,_0x4d248a);};}exports[_0x859d('0x3')]=function(_0x41d5d0){for(var _0xeb8264=0x0,_0x3107df=events[_0x859d('0x4')];_0xeb8264<_0x3107df;_0xeb8264++){var _0x3113a0=events[_0xeb8264];var _0x403f55=createListener('mailQueue:'+_0x3113a0,_0x41d5d0);MailQueueEvents['on'](_0x3113a0,_0x403f55);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index cacabb5..8429870 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 _0x7f5d=['show','post','put','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x598fa0,_0x183280){var _0x29a6ab=function(_0x2f82f9){while(--_0x2f82f9){_0x598fa0['push'](_0x598fa0['shift']());}};_0x29a6ab(++_0x183280);}(_0x7f5d,0x1db));var _0xd7f5=function(_0x154025,_0x5a3bfe){_0x154025=_0x154025-0x0;var _0x36089c=_0x7f5d[_0x154025];return _0x36089c;};'use strict';var multer=require(_0xd7f5('0x0'));var util=require('util');var path=require(_0xd7f5('0x1'));var timeout=require('connect-timeout');var express=require(_0xd7f5('0x2'));var router=express[_0xd7f5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd7f5('0x4'));var config=require('../../config/environment');var controller=require(_0xd7f5('0x5'));router[_0xd7f5('0x6')]('/',auth[_0xd7f5('0x7')](),controller['index']);router['get'](_0xd7f5('0x8'),auth[_0xd7f5('0x7')](),controller[_0xd7f5('0x9')]);router['get'](_0xd7f5('0xa'),auth[_0xd7f5('0x7')](),controller[_0xd7f5('0xb')]);router[_0xd7f5('0xc')]('/',auth[_0xd7f5('0x7')](),controller['create']);router[_0xd7f5('0xd')]('/:id',auth[_0xd7f5('0x7')](),controller[_0xd7f5('0xe')]);router[_0xd7f5('0xf')](_0xd7f5('0xa'),auth[_0xd7f5('0x7')](),controller[_0xd7f5('0x10')]);module[_0xd7f5('0x11')]=router; \ No newline at end of file +var _0x4559=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2a2f7e,_0x27df25){var _0x18c674=function(_0x484fb0){while(--_0x484fb0){_0x2a2f7e['push'](_0x2a2f7e['shift']());}};_0x18c674(++_0x27df25);}(_0x4559,0x15f));var _0x9455=function(_0x4ddc7a,_0x5b6cb8){_0x4ddc7a=_0x4ddc7a-0x0;var _0x4547c1=_0x4559[_0x4ddc7a];return _0x4547c1;};'use strict';var multer=require('multer');var util=require(_0x9455('0x0'));var path=require(_0x9455('0x1'));var timeout=require(_0x9455('0x2'));var express=require(_0x9455('0x3'));var router=express[_0x9455('0x4')]();var fs_extra=require(_0x9455('0x5'));var auth=require(_0x9455('0x6'));var interaction=require(_0x9455('0x7'));var config=require(_0x9455('0x8'));var controller=require('./mailQueueReport.controller');router[_0x9455('0x9')]('/',auth[_0x9455('0xa')](),controller[_0x9455('0xb')]);router['get'](_0x9455('0xc'),auth[_0x9455('0xa')](),controller[_0x9455('0xd')]);router[_0x9455('0x9')](_0x9455('0xe'),auth[_0x9455('0xa')](),controller[_0x9455('0xf')]);router['post']('/',auth[_0x9455('0xa')](),controller[_0x9455('0x10')]);router[_0x9455('0x11')]('/:id',auth[_0x9455('0xa')](),controller['update']);router[_0x9455('0x12')](_0x9455('0xe'),auth[_0x9455('0xa')](),controller[_0x9455('0x13')]);module[_0x9455('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ca1558e..cf60674 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 _0x1155=['STRING','DATE','moment','sequelize','exports'];(function(_0xeeca1c,_0x556712){var _0x2f4aaa=function(_0x1cb949){while(--_0x1cb949){_0xeeca1c['push'](_0xeeca1c['shift']());}};_0x2f4aaa(++_0x556712);}(_0x1155,0x1dd));var _0x5115=function(_0x823e50,_0x15f0aa){_0x823e50=_0x823e50-0x0;var _0x221de4=_0x1155[_0x823e50];return _0x221de4;};'use strict';var moment=require(_0x5115('0x0'));var Sequelize=require(_0x5115('0x1'));module[_0x5115('0x2')]={'uniqueid':{'type':Sequelize[_0x5115('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5115('0x3')]},'joinAt':{'type':Sequelize[_0x5115('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5115('0x4')]},'exitAt':{'type':Sequelize[_0x5115('0x4')]},'reason':{'type':Sequelize[_0x5115('0x3')]}}; \ No newline at end of file +var _0xe801=['moment','sequelize','exports','STRING','DATE'];(function(_0x2bbb47,_0x1838d9){var _0x2192b6=function(_0x58779b){while(--_0x58779b){_0x2bbb47['push'](_0x2bbb47['shift']());}};_0x2192b6(++_0x1838d9);}(_0xe801,0x69));var _0x1e80=function(_0x39a2cc,_0x367537){_0x39a2cc=_0x39a2cc-0x0;var _0x2ecf87=_0xe801[_0x39a2cc];return _0x2ecf87;};'use strict';var moment=require(_0x1e80('0x0'));var Sequelize=require(_0x1e80('0x1'));module[_0x1e80('0x2')]={'uniqueid':{'type':Sequelize[_0x1e80('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1e80('0x4')]},'acceptAt':{'type':Sequelize[_0x1e80('0x4')]},'exitAt':{'type':Sequelize[_0x1e80('0x4')]},'reason':{'type':Sequelize[_0x1e80('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 6ee8eae..7681c23 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 _0x3a6d=['keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','type','options','includeAll','rows','catch','params','rawAttributes','merge','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','then','error','stack','name','send','index','map','MailQueueReport','fieldName','key','query'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3a6d,0x143));var _0xd3a6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3a6d[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xd3a6('0x0'));var rimraf=require(_0xd3a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3a6('0x2'));var rp=require(_0xd3a6('0x3'));var moment=require(_0xd3a6('0x4'));var BPromise=require(_0xd3a6('0x5'));var Mustache=require(_0xd3a6('0x6'));var util=require('util');var path=require(_0xd3a6('0x7'));var sox=require(_0xd3a6('0x8'));var csv=require(_0xd3a6('0x9'));var ejs=require(_0xd3a6('0xa'));var fs=require('fs');var fs_extra=require(_0xd3a6('0xb'));var _=require(_0xd3a6('0xc'));var squel=require('squel');var crypto=require(_0xd3a6('0xd'));var jsforce=require(_0xd3a6('0xe'));var deskjs=require(_0xd3a6('0xf'));var toCsv=require(_0xd3a6('0x9'));var querystring=require(_0xd3a6('0x10'));var Papa=require(_0xd3a6('0x11'));var Redis=require(_0xd3a6('0x12'));var authService=require(_0xd3a6('0x13'));var qs=require(_0xd3a6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3a6('0x15'));var logger=require(_0xd3a6('0x16'))(_0xd3a6('0x17'));var utils=require(_0xd3a6('0x18'));var config=require(_0xd3a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b0467,_0x1c6ad7){_0x1c6ad7=_0x1c6ad7||0xcc;return function(_0x671004){if(_0x671004){return _0x4b0467[_0xd3a6('0x1a')](_0x1c6ad7);}return _0x4b0467[_0xd3a6('0x1b')](_0x1c6ad7)[_0xd3a6('0x1c')]();};}function respondWithResult(_0x2911a0,_0xa56452){_0xa56452=_0xa56452||0xc8;return function(_0x4e67fb){if(_0x4e67fb){return _0x2911a0[_0xd3a6('0x1b')](_0xa56452)[_0xd3a6('0x1d')](_0x4e67fb);}};}function respondWithFilteredResult(_0x171a8f,_0x500a37){return function(_0x3c2399){if(_0x3c2399){var _0x305b61=typeof _0x500a37[_0xd3a6('0x1e')]==='undefined'&&typeof _0x500a37[_0xd3a6('0x1f')]==='undefined';var _0x518b6d=_0x3c2399[_0xd3a6('0x20')];var _0x8d1286=_0x305b61?0x0:_0x500a37[_0xd3a6('0x1e')];var _0xbe58b4=_0x305b61?_0x3c2399[_0xd3a6('0x20')]:_0x500a37[_0xd3a6('0x1e')]+_0x500a37[_0xd3a6('0x1f')];var _0x4ec27c;if(_0xbe58b4>=_0x518b6d){_0xbe58b4=_0x518b6d;_0x4ec27c=0xc8;}else{_0x4ec27c=0xce;}_0x171a8f[_0xd3a6('0x1b')](_0x4ec27c);return _0x171a8f['set'](_0xd3a6('0x21'),_0x8d1286+'-'+_0xbe58b4+'/'+_0x518b6d)[_0xd3a6('0x1d')](_0x3c2399);}return null;};}function patchUpdates(_0x12f2c1){return function(_0x20a34e){try{jsonpatch[_0xd3a6('0x22')](_0x20a34e,_0x12f2c1,!![]);}catch(_0x6ecd88){return BPromise['reject'](_0x6ecd88);}return _0x20a34e[_0xd3a6('0x23')]();};}function saveUpdates(_0x422f5c,_0x57cf15){return function(_0x543a6a){if(_0x543a6a){return _0x543a6a['update'](_0x422f5c)['then'](function(_0x5c9075){return _0x5c9075;});}return null;};}function removeEntity(_0x98a12a,_0x400982){return function(_0x3d0b28){if(_0x3d0b28){return _0x3d0b28['destroy']()[_0xd3a6('0x24')](function(){_0x98a12a['status'](0xcc)[_0xd3a6('0x1c')]();});}};}function handleEntityNotFound(_0x16afc8,_0x429079){return function(_0x4f6130){if(!_0x4f6130){_0x16afc8[_0xd3a6('0x1a')](0x194);}return _0x4f6130;};}function handleError(_0x3bc8d1,_0x1b09ac){_0x1b09ac=_0x1b09ac||0x1f4;return function(_0x219e32){logger[_0xd3a6('0x25')](_0x219e32[_0xd3a6('0x26')]);if(_0x219e32['name']){delete _0x219e32[_0xd3a6('0x27')];}_0x3bc8d1[_0xd3a6('0x1b')](_0x1b09ac)[_0xd3a6('0x28')](_0x219e32);};}exports[_0xd3a6('0x29')]=function(_0x30abc2,_0x45c628){var _0x5c2186={},_0x535bd4={},_0x1f4859={'count':0x0,'rows':[]};var _0x210aa1=_[_0xd3a6('0x2a')](db[_0xd3a6('0x2b')]['rawAttributes'],function(_0x3de3bb){return{'name':_0x3de3bb[_0xd3a6('0x2c')],'type':_0x3de3bb['type'][_0xd3a6('0x2d')]};});_0x535bd4['model']=_[_0xd3a6('0x2a')](_0x210aa1,_0xd3a6('0x27'));_0x535bd4[_0xd3a6('0x2e')]=_[_0xd3a6('0x2f')](_0x30abc2[_0xd3a6('0x2e')]);_0x535bd4[_0xd3a6('0x30')]=_[_0xd3a6('0x31')](_0x535bd4['model'],_0x535bd4['query']);_0x5c2186[_0xd3a6('0x32')]=_[_0xd3a6('0x31')](_0x535bd4[_0xd3a6('0x33')],qs['fields'](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x34')]));_0x5c2186[_0xd3a6('0x32')]=_0x5c2186[_0xd3a6('0x32')][_0xd3a6('0x35')]?_0x5c2186[_0xd3a6('0x32')]:_0x535bd4[_0xd3a6('0x33')];if(!_0x30abc2[_0xd3a6('0x2e')]['hasOwnProperty'](_0xd3a6('0x36'))){_0x5c2186[_0xd3a6('0x1f')]=qs[_0xd3a6('0x1f')](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x1f')]);_0x5c2186[_0xd3a6('0x1e')]=qs['offset'](_0x30abc2[_0xd3a6('0x2e')]['offset']);}_0x5c2186[_0xd3a6('0x37')]=qs[_0xd3a6('0x38')](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x38')]);_0x5c2186['where']=qs['filters'](_[_0xd3a6('0x39')](_0x30abc2[_0xd3a6('0x2e')],_0x535bd4[_0xd3a6('0x30')]),_0x210aa1);if(_0x30abc2['query'][_0xd3a6('0x3a')]){_0x5c2186[_0xd3a6('0x3b')]=_['merge'](_0x5c2186[_0xd3a6('0x3b')],{'$or':_['map'](_0x210aa1,function(_0x1e695a){if(_0x1e695a[_0xd3a6('0x3c')]!=='VIRTUAL'){var _0x219ba5={};_0x219ba5[_0x1e695a['name']]={'$like':'%'+_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x3a')]+'%'};return _0x219ba5;}})});}_0x5c2186=_['merge']({},_0x5c2186,_0x30abc2[_0xd3a6('0x3d')]);var _0xfcef03={'where':_0x5c2186[_0xd3a6('0x3b')]};return db[_0xd3a6('0x2b')]['count'](_0xfcef03)[_0xd3a6('0x24')](function(_0x324dbd){_0x1f4859[_0xd3a6('0x20')]=_0x324dbd;if(_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x3e')]){_0x5c2186['include']=[{'all':!![]}];}return db[_0xd3a6('0x2b')]['findAll'](_0x5c2186);})[_0xd3a6('0x24')](function(_0x1bc18a){_0x1f4859[_0xd3a6('0x3f')]=_0x1bc18a;return _0x1f4859;})['then'](respondWithFilteredResult(_0x45c628,_0x5c2186))[_0xd3a6('0x40')](handleError(_0x45c628,null));};exports['show']=function(_0x23aa99,_0x4cbf76){var _0x448213={'raw':!![],'where':{'id':_0x23aa99[_0xd3a6('0x41')]['id']}},_0x629153={};_0x629153[_0xd3a6('0x33')]=_[_0xd3a6('0x2f')](db[_0xd3a6('0x2b')][_0xd3a6('0x42')]);_0x629153['query']=_[_0xd3a6('0x2f')](_0x23aa99[_0xd3a6('0x2e')]);_0x629153[_0xd3a6('0x30')]=_[_0xd3a6('0x31')](_0x629153['model'],_0x629153[_0xd3a6('0x2e')]);_0x448213[_0xd3a6('0x32')]=_[_0xd3a6('0x31')](_0x629153[_0xd3a6('0x33')],qs[_0xd3a6('0x34')](_0x23aa99[_0xd3a6('0x2e')][_0xd3a6('0x34')]));_0x448213[_0xd3a6('0x32')]=_0x448213['attributes'][_0xd3a6('0x35')]?_0x448213[_0xd3a6('0x32')]:_0x629153[_0xd3a6('0x33')];if(_0x23aa99[_0xd3a6('0x2e')][_0xd3a6('0x3e')]){_0x448213['include']=[{'all':!![]}];}_0x448213=_[_0xd3a6('0x43')]({},_0x448213,_0x23aa99[_0xd3a6('0x3d')]);return db[_0xd3a6('0x2b')][_0xd3a6('0x44')](_0x448213)[_0xd3a6('0x24')](handleEntityNotFound(_0x4cbf76,null))[_0xd3a6('0x24')](respondWithResult(_0x4cbf76,null))[_0xd3a6('0x40')](handleError(_0x4cbf76,null));};exports[_0xd3a6('0x45')]=function(_0x4ac576,_0x7828c2){return db['MailQueueReport'][_0xd3a6('0x45')](_0x4ac576[_0xd3a6('0x46')],{})['then'](respondWithResult(_0x7828c2,0xc9))[_0xd3a6('0x40')](handleError(_0x7828c2,null));};exports[_0xd3a6('0x47')]=function(_0x3cf99a,_0x375067){if(_0x3cf99a[_0xd3a6('0x46')]['id']){delete _0x3cf99a[_0xd3a6('0x46')]['id'];}return db[_0xd3a6('0x2b')][_0xd3a6('0x44')]({'where':{'id':_0x3cf99a[_0xd3a6('0x41')]['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x375067,null))['then'](saveUpdates(_0x3cf99a[_0xd3a6('0x46')],null))[_0xd3a6('0x24')](respondWithResult(_0x375067,null))[_0xd3a6('0x40')](handleError(_0x375067,null));};exports[_0xd3a6('0x48')]=function(_0x26bd65,_0x225393){return db[_0xd3a6('0x2b')][_0xd3a6('0x44')]({'where':{'id':_0x26bd65[_0xd3a6('0x41')]['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x225393,null))['then'](removeEntity(_0x225393,null))[_0xd3a6('0x40')](handleError(_0x225393,null));};exports[_0xd3a6('0x49')]=function(_0x618b72,_0x4995b7){return db[_0xd3a6('0x2b')]['describe']()['then'](respondWithResult(_0x4995b7,null))['catch'](handleError(_0x4995b7,null));}; \ No newline at end of file +var _0x1893=['query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','map','VIRTUAL','filter','includeAll','include','catch','keys','merge','find','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','reject','save','update','then','error','send','index','MailQueueReport','rawAttributes','type','key','model','name'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x1893,0xa2));var _0x3189=function(_0x44a518,_0x413a2d){_0x44a518=_0x44a518-0x0;var _0x4a3cdf=_0x1893[_0x44a518];return _0x4a3cdf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3189('0x0'));var jsonpatch=require(_0x3189('0x1'));var rp=require(_0x3189('0x2'));var moment=require(_0x3189('0x3'));var BPromise=require(_0x3189('0x4'));var Mustache=require(_0x3189('0x5'));var util=require(_0x3189('0x6'));var path=require('path');var sox=require(_0x3189('0x7'));var csv=require(_0x3189('0x8'));var ejs=require(_0x3189('0x9'));var fs=require('fs');var fs_extra=require(_0x3189('0xa'));var _=require(_0x3189('0xb'));var squel=require(_0x3189('0xc'));var crypto=require(_0x3189('0xd'));var jsforce=require(_0x3189('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3189('0x8'));var querystring=require('querystring');var Papa=require(_0x3189('0xf'));var Redis=require('ioredis');var authService=require(_0x3189('0x10'));var qs=require(_0x3189('0x11'));var as=require(_0x3189('0x12'));var hardwareService=require(_0x3189('0x13'));var logger=require('../../config/logger')(_0x3189('0x14'));var utils=require(_0x3189('0x15'));var config=require(_0x3189('0x16'));var licenseUtil=require(_0x3189('0x17'));var db=require(_0x3189('0x18'))['db'];function respondWithStatusCode(_0x5d9fff,_0x22b11e){_0x22b11e=_0x22b11e||0xcc;return function(_0x353b17){if(_0x353b17){return _0x5d9fff[_0x3189('0x19')](_0x22b11e);}return _0x5d9fff[_0x3189('0x1a')](_0x22b11e)[_0x3189('0x1b')]();};}function respondWithResult(_0x20dcc2,_0xef438){_0xef438=_0xef438||0xc8;return function(_0x25a917){if(_0x25a917){return _0x20dcc2['status'](_0xef438)[_0x3189('0x1c')](_0x25a917);}};}function respondWithFilteredResult(_0xb3e4c2,_0x1c209b){return function(_0x2fb62b){if(_0x2fb62b){var _0x486dd2=typeof _0x1c209b[_0x3189('0x1d')]==='undefined'&&typeof _0x1c209b['limit']===_0x3189('0x1e');var _0x49b1bc=_0x2fb62b[_0x3189('0x1f')];var _0xf8aed7=_0x486dd2?0x0:_0x1c209b[_0x3189('0x1d')];var _0x9905c4=_0x486dd2?_0x2fb62b['count']:_0x1c209b[_0x3189('0x1d')]+_0x1c209b[_0x3189('0x20')];var _0x16edd7;if(_0x9905c4>=_0x49b1bc){_0x9905c4=_0x49b1bc;_0x16edd7=0xc8;}else{_0x16edd7=0xce;}_0xb3e4c2['status'](_0x16edd7);return _0xb3e4c2[_0x3189('0x21')](_0x3189('0x22'),_0xf8aed7+'-'+_0x9905c4+'/'+_0x49b1bc)[_0x3189('0x1c')](_0x2fb62b);}return null;};}function patchUpdates(_0x2c1e59){return function(_0x29b275){try{jsonpatch['apply'](_0x29b275,_0x2c1e59,!![]);}catch(_0x1771a8){return BPromise[_0x3189('0x23')](_0x1771a8);}return _0x29b275[_0x3189('0x24')]();};}function saveUpdates(_0x539e12,_0x309c6e){return function(_0x47abb4){if(_0x47abb4){return _0x47abb4[_0x3189('0x25')](_0x539e12)[_0x3189('0x26')](function(_0x200f16){return _0x200f16;});}return null;};}function removeEntity(_0x38e56a,_0x1cbe33){return function(_0x393fcb){if(_0x393fcb){return _0x393fcb['destroy']()['then'](function(){_0x38e56a[_0x3189('0x1a')](0xcc)[_0x3189('0x1b')]();});}};}function handleEntityNotFound(_0x1dc1c8,_0x3cc1e5){return function(_0x103de4){if(!_0x103de4){_0x1dc1c8[_0x3189('0x19')](0x194);}return _0x103de4;};}function handleError(_0xdda38b,_0x379a48){_0x379a48=_0x379a48||0x1f4;return function(_0x17b540){logger[_0x3189('0x27')](_0x17b540['stack']);if(_0x17b540['name']){delete _0x17b540['name'];}_0xdda38b[_0x3189('0x1a')](_0x379a48)[_0x3189('0x28')](_0x17b540);};}exports[_0x3189('0x29')]=function(_0x90c31,_0x36b258){var _0x2f7504={},_0x4d453a={},_0x1ab94b={'count':0x0,'rows':[]};var _0x37b9ec=_['map'](db[_0x3189('0x2a')][_0x3189('0x2b')],function(_0x39c5e4){return{'name':_0x39c5e4['fieldName'],'type':_0x39c5e4[_0x3189('0x2c')][_0x3189('0x2d')]};});_0x4d453a[_0x3189('0x2e')]=_['map'](_0x37b9ec,_0x3189('0x2f'));_0x4d453a[_0x3189('0x30')]=_['keys'](_0x90c31[_0x3189('0x30')]);_0x4d453a[_0x3189('0x31')]=_[_0x3189('0x32')](_0x4d453a[_0x3189('0x2e')],_0x4d453a[_0x3189('0x30')]);_0x2f7504['attributes']=_['intersection'](_0x4d453a[_0x3189('0x2e')],qs['fields'](_0x90c31[_0x3189('0x30')][_0x3189('0x33')]));_0x2f7504[_0x3189('0x34')]=_0x2f7504[_0x3189('0x34')][_0x3189('0x35')]?_0x2f7504[_0x3189('0x34')]:_0x4d453a[_0x3189('0x2e')];if(!_0x90c31[_0x3189('0x30')][_0x3189('0x36')]('nolimit')){_0x2f7504[_0x3189('0x20')]=qs[_0x3189('0x20')](_0x90c31[_0x3189('0x30')][_0x3189('0x20')]);_0x2f7504[_0x3189('0x1d')]=qs[_0x3189('0x1d')](_0x90c31[_0x3189('0x30')]['offset']);}_0x2f7504['order']=qs[_0x3189('0x37')](_0x90c31['query'][_0x3189('0x37')]);_0x2f7504[_0x3189('0x38')]=qs['filters'](_[_0x3189('0x39')](_0x90c31[_0x3189('0x30')],_0x4d453a[_0x3189('0x31')]),_0x37b9ec);if(_0x90c31[_0x3189('0x30')]['filter']){_0x2f7504[_0x3189('0x38')]=_['merge'](_0x2f7504['where'],{'$or':_[_0x3189('0x3a')](_0x37b9ec,function(_0xed3041){if(_0xed3041[_0x3189('0x2c')]!==_0x3189('0x3b')){var _0x12dee0={};_0x12dee0[_0xed3041[_0x3189('0x2f')]]={'$like':'%'+_0x90c31[_0x3189('0x30')][_0x3189('0x3c')]+'%'};return _0x12dee0;}})});}_0x2f7504=_['merge']({},_0x2f7504,_0x90c31['options']);var _0x407e0a={'where':_0x2f7504[_0x3189('0x38')]};return db[_0x3189('0x2a')][_0x3189('0x1f')](_0x407e0a)[_0x3189('0x26')](function(_0xb52c70){_0x1ab94b['count']=_0xb52c70;if(_0x90c31[_0x3189('0x30')][_0x3189('0x3d')]){_0x2f7504[_0x3189('0x3e')]=[{'all':!![]}];}return db[_0x3189('0x2a')]['findAll'](_0x2f7504);})[_0x3189('0x26')](function(_0x2f0d49){_0x1ab94b['rows']=_0x2f0d49;return _0x1ab94b;})['then'](respondWithFilteredResult(_0x36b258,_0x2f7504))[_0x3189('0x3f')](handleError(_0x36b258,null));};exports['show']=function(_0x376787,_0x3074b9){var _0x38bf83={'raw':!![],'where':{'id':_0x376787['params']['id']}},_0x9593f3={};_0x9593f3[_0x3189('0x2e')]=_[_0x3189('0x40')](db['MailQueueReport'][_0x3189('0x2b')]);_0x9593f3[_0x3189('0x30')]=_[_0x3189('0x40')](_0x376787[_0x3189('0x30')]);_0x9593f3[_0x3189('0x31')]=_['intersection'](_0x9593f3['model'],_0x9593f3[_0x3189('0x30')]);_0x38bf83['attributes']=_[_0x3189('0x32')](_0x9593f3[_0x3189('0x2e')],qs[_0x3189('0x33')](_0x376787['query'][_0x3189('0x33')]));_0x38bf83[_0x3189('0x34')]=_0x38bf83[_0x3189('0x34')]['length']?_0x38bf83[_0x3189('0x34')]:_0x9593f3[_0x3189('0x2e')];if(_0x376787[_0x3189('0x30')][_0x3189('0x3d')]){_0x38bf83[_0x3189('0x3e')]=[{'all':!![]}];}_0x38bf83=_[_0x3189('0x41')]({},_0x38bf83,_0x376787['options']);return db['MailQueueReport'][_0x3189('0x42')](_0x38bf83)['then'](handleEntityNotFound(_0x3074b9,null))['then'](respondWithResult(_0x3074b9,null))[_0x3189('0x3f')](handleError(_0x3074b9,null));};exports['create']=function(_0x2d58fd,_0x1b6f09){return db[_0x3189('0x2a')]['create'](_0x2d58fd[_0x3189('0x43')],{})['then'](respondWithResult(_0x1b6f09,0xc9))[_0x3189('0x3f')](handleError(_0x1b6f09,null));};exports['update']=function(_0x49c4a8,_0x244166){if(_0x49c4a8['body']['id']){delete _0x49c4a8[_0x3189('0x43')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x49c4a8[_0x3189('0x44')]['id']}})[_0x3189('0x26')](handleEntityNotFound(_0x244166,null))[_0x3189('0x26')](saveUpdates(_0x49c4a8[_0x3189('0x43')],null))[_0x3189('0x26')](respondWithResult(_0x244166,null))[_0x3189('0x3f')](handleError(_0x244166,null));};exports['destroy']=function(_0x21d446,_0x549bc7){return db['MailQueueReport'][_0x3189('0x42')]({'where':{'id':_0x21d446[_0x3189('0x44')]['id']}})[_0x3189('0x26')](handleEntityNotFound(_0x549bc7,null))[_0x3189('0x26')](removeEntity(_0x549bc7,null))[_0x3189('0x3f')](handleError(_0x549bc7,null));};exports[_0x3189('0x45')]=function(_0x556ee5,_0x5117fb){return db['MailQueueReport'][_0x3189('0x45')]()[_0x3189('0x26')](respondWithResult(_0x5117fb,null))[_0x3189('0x3f')](handleError(_0x5117fb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ba2b4a0..461daa8 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 _0x351c=['moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x351c,0xd5));var _0xc351=function(_0x19ac4e,_0x3136ed){_0x19ac4e=_0x19ac4e-0x0;var _0x1af2c5=_0x351c[_0x19ac4e];return _0x1af2c5;};'use strict';var _=require('lodash');var util=require(_0xc351('0x0'));var logger=require(_0xc351('0x1'))(_0xc351('0x2'));var moment=require(_0xc351('0x3'));var BPromise=require(_0xc351('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc351('0x5'));var rimraf=require(_0xc351('0x6'));var config=require(_0xc351('0x7'));var attributes=require(_0xc351('0x8'));module['exports']=function(_0x41a3f5,_0x2c3cc3){return _0x41a3f5['define'](_0xc351('0x9'),attributes,{'tableName':_0xc351('0xa'),'paranoid':![],'indexes':[{'name':_0xc351('0xb'),'fields':[_0xc351('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a3c=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x17c676,_0x10affa){var _0xa46e88=function(_0x47c468){while(--_0x47c468){_0x17c676['push'](_0x17c676['shift']());}};_0xa46e88(++_0x10affa);}(_0x0a3c,0x1f4));var _0xc0a3=function(_0x361405,_0xc2b4f){_0x361405=_0x361405-0x0;var _0x595276=_0x0a3c[_0x361405];return _0x595276;};'use strict';var _=require(_0xc0a3('0x0'));var util=require(_0xc0a3('0x1'));var logger=require(_0xc0a3('0x2'))(_0xc0a3('0x3'));var moment=require(_0xc0a3('0x4'));var BPromise=require(_0xc0a3('0x5'));var rp=require(_0xc0a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a3('0x7'));var config=require(_0xc0a3('0x8'));var attributes=require(_0xc0a3('0x9'));module[_0xc0a3('0xa')]=function(_0x142873,_0xd463b9){return _0x142873[_0xc0a3('0xb')](_0xc0a3('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xc0a3('0xd'),'fields':[_0xc0a3('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 d0771e5..3e7de56 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x2f2a0d,_0x5d1976){var _0x823f5e=function(_0x5c42d5){while(--_0x5c42d5){_0x2f2a0d['push'](_0x2f2a0d['shift']());}};_0x823f5e(++_0x5d1976);}(_0x2ef3,0xba));var _0x32ef=function(_0x113b0c,_0xc696db){_0x113b0c=_0x113b0c-0x0;var _0x22453e=_0x2ef3[_0x113b0c];return _0x22453e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x26cb1e,_0x2f7e4d){var _0x7a5f40=function(_0xfae629){while(--_0xfae629){_0x26cb1e['push'](_0x26cb1e['shift']());}};_0x7a5f40(++_0x2f7e4d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 99547c7..d673a0a 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x7009f6,_0x51e290){var _0x421356=function(_0x5a805d){while(--_0x5a805d){_0x7009f6['push'](_0x7009f6['shift']());}};_0x421356(++_0x51e290);}(_0xedd9,0xfc));var _0x9edd=function(_0x397494,_0x1fa63c){_0x397494=_0x397494-0x0;var _0x17abf2=_0xedd9[_0x397494];return _0x17abf2;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x147a44,_0x2d9343){var _0x18b2f9=function(_0x1c075d){while(--_0x1c075d){_0x147a44['push'](_0x147a44['shift']());}};_0x18b2f9(++_0x2d9343);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index e0eb4ee..894869d 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 _0x6c25=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3759c4,_0x1710cf){var _0x1569cd=function(_0x41c54c){while(--_0x41c54c){_0x3759c4['push'](_0x3759c4['shift']());}};_0x1569cd(++_0x1710cf);}(_0x6c25,0x9d));var _0x56c2=function(_0x260ebf,_0x31c14d){_0x260ebf=_0x260ebf-0x0;var _0x1124a4=_0x6c25[_0x260ebf];return _0x1124a4;};'use strict';var Sequelize=require(_0x56c2('0x0'));module[_0x56c2('0x1')]={'description':{'type':Sequelize[_0x56c2('0x2')]},'host':{'type':Sequelize[_0x56c2('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x56c2('0x2')]},'password':{'type':Sequelize[_0x56c2('0x2')]},'port':{'type':Sequelize[_0x56c2('0x3')]},'tls':{'type':Sequelize[_0x56c2('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x56c2('0x2')],'defaultValue':_0x56c2('0x5')},'connTimeout':{'type':Sequelize[_0x56c2('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x56c2('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x56c2('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x142a=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x34f689,_0x362847){var _0xe23b2e=function(_0x378458){while(--_0x378458){_0x34f689['push'](_0x34f689['shift']());}};_0xe23b2e(++_0x362847);}(_0x142a,0x18b));var _0xa142=function(_0x2df4d7,_0x57da82){_0x2df4d7=_0x2df4d7-0x0;var _0x40787a=_0x142a[_0x2df4d7];return _0x40787a;};'use strict';var Sequelize=require(_0xa142('0x0'));module[_0xa142('0x1')]={'description':{'type':Sequelize[_0xa142('0x2')]},'host':{'type':Sequelize[_0xa142('0x2')]},'authentication':{'type':Sequelize[_0xa142('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa142('0x2')]},'port':{'type':Sequelize[_0xa142('0x4')]},'tls':{'type':Sequelize[_0xa142('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xa142('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xa142('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 78a9719..0f9ddb7 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 _0xcc10=['define','MailServerIn','mail_servers_in','lodash','util','api','moment','request-promise','path','../../config/environment','./mailServerIn.attributes'];(function(_0x13e8c5,_0x1eb4da){var _0x3f0e74=function(_0x4fc9bb){while(--_0x4fc9bb){_0x13e8c5['push'](_0x13e8c5['shift']());}};_0x3f0e74(++_0x1eb4da);}(_0xcc10,0x10b));var _0x0cc1=function(_0x4b1226,_0x590c48){_0x4b1226=_0x4b1226-0x0;var _0x8bc664=_0xcc10[_0x4b1226];return _0x8bc664;};'use strict';var _=require(_0x0cc1('0x0'));var util=require(_0x0cc1('0x1'));var logger=require('../../config/logger')(_0x0cc1('0x2'));var moment=require(_0x0cc1('0x3'));var BPromise=require('bluebird');var rp=require(_0x0cc1('0x4'));var fs=require('fs');var path=require(_0x0cc1('0x5'));var rimraf=require('rimraf');var config=require(_0x0cc1('0x6'));var attributes=require(_0x0cc1('0x7'));module['exports']=function(_0x5a1459,_0x316e06){return _0x5a1459[_0x0cc1('0x8')](_0x0cc1('0x9'),attributes,{'tableName':_0x0cc1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c47=['../../config/logger','api','moment','bluebird','request-promise','path','./mailServerIn.attributes','exports','MailServerIn','lodash'];(function(_0x3abb39,_0x14b33d){var _0x38cdcd=function(_0x1aa151){while(--_0x1aa151){_0x3abb39['push'](_0x3abb39['shift']());}};_0x38cdcd(++_0x14b33d);}(_0x1c47,0x149));var _0x71c4=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x1c47[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x71c4('0x0'));var util=require('util');var logger=require(_0x71c4('0x1'))(_0x71c4('0x2'));var moment=require(_0x71c4('0x3'));var BPromise=require(_0x71c4('0x4'));var rp=require(_0x71c4('0x5'));var fs=require('fs');var path=require(_0x71c4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x71c4('0x7'));module[_0x71c4('0x8')]=function(_0x5db625,_0x207165){return _0x5db625['define'](_0x71c4('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index a9e6231..e7efb9a 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 _0xa1b9=['findAll','options','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xa1b9,0x71));var _0x9a1b=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa1b9[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x9a1b('0x0'));var util=require('util');var moment=require(_0x9a1b('0x1'));var BPromise=require(_0x9a1b('0x2'));var rs=require(_0x9a1b('0x3'));var fs=require('fs');var Redis=require(_0x9a1b('0x4'));var db=require(_0x9a1b('0x5'))['db'];var utils=require(_0x9a1b('0x6'));var logger=require(_0x9a1b('0x7'))('rpc');var config=require(_0x9a1b('0x8'));var jayson=require(_0x9a1b('0x9'));var client=jayson[_0x9a1b('0xa')][_0x9a1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47cb95,_0x185401,_0x534151){return new BPromise(function(_0x17b671,_0x4387ac){return client[_0x9a1b('0xc')](_0x47cb95,_0x534151)[_0x9a1b('0xd')](function(_0x1ddb9e){logger['info'](_0x9a1b('0xe'),_0x185401,_0x9a1b('0xf'));logger[_0x9a1b('0x10')](_0x9a1b('0x11'),_0x185401,_0x9a1b('0xf'),JSON[_0x9a1b('0x12')](_0x1ddb9e));if(_0x1ddb9e[_0x9a1b('0x13')]){if(_0x1ddb9e['error'][_0x9a1b('0x14')]===0x1f4){logger[_0x9a1b('0x13')](_0x9a1b('0xe'),_0x185401,_0x1ddb9e['error'][_0x9a1b('0x15')]);return _0x4387ac(_0x1ddb9e[_0x9a1b('0x13')][_0x9a1b('0x15')]);}logger[_0x9a1b('0x13')](_0x9a1b('0xe'),_0x185401,_0x1ddb9e[_0x9a1b('0x13')][_0x9a1b('0x15')]);return _0x17b671(_0x1ddb9e[_0x9a1b('0x13')][_0x9a1b('0x15')]);}else{logger[_0x9a1b('0x16')]('MailServerIn,\x20%s,\x20%s',_0x185401,_0x9a1b('0xf'));_0x17b671(_0x1ddb9e[_0x9a1b('0x17')]['message']);}})[_0x9a1b('0x18')](function(_0xbac830){logger[_0x9a1b('0x13')](_0x9a1b('0xe'),_0x185401,_0xbac830);_0x4387ac(_0xbac830);});});}exports[_0x9a1b('0x19')]=function(_0x478626){var _0xe7a820=this;return new Promise(function(_0x599325,_0x403250){return db[_0x9a1b('0x1a')][_0x9a1b('0x1b')]({'raw':_0x478626[_0x9a1b('0x1c')]?_0x478626[_0x9a1b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x478626[_0x9a1b('0x1c')]?_0x478626[_0x9a1b('0x1c')][_0x9a1b('0x1d')]||null:null,'attributes':_0x478626[_0x9a1b('0x1c')]?_0x478626['options'][_0x9a1b('0x1e')]||null:null,'limit':_0x478626[_0x9a1b('0x1c')]?_0x478626[_0x9a1b('0x1c')][_0x9a1b('0x1f')]||null:null,'include':_0x478626[_0x9a1b('0x1c')]?_0x478626[_0x9a1b('0x1c')][_0x9a1b('0x20')]?_[_0x9a1b('0x21')](_0x478626[_0x9a1b('0x1c')][_0x9a1b('0x20')],function(_0x5841c1){return{'model':db[_0x5841c1[_0x9a1b('0x22')]],'as':_0x5841c1['as'],'attributes':_0x5841c1[_0x9a1b('0x1e')],'include':_0x5841c1[_0x9a1b('0x20')]?_['map'](_0x5841c1['include'],function(_0x3b0ff3){return{'model':db[_0x3b0ff3['model']],'as':_0x3b0ff3['as'],'attributes':_0x3b0ff3[_0x9a1b('0x1e')],'include':_0x3b0ff3['include']?_['map'](_0x3b0ff3['include'],function(_0x432a3d){return{'model':db[_0x432a3d['model']],'as':_0x432a3d['as'],'attributes':_0x432a3d[_0x9a1b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9a1b('0xd')](function(_0x4983f6){logger[_0x9a1b('0x16')](_0x9a1b('0x19'),_0x478626);logger[_0x9a1b('0x10')](_0x9a1b('0x19'),_0x478626,JSON[_0x9a1b('0x12')](_0x4983f6));_0x599325(_0x4983f6);})[_0x9a1b('0x18')](function(_0x2d9ca8){logger['error']('GetMailServerIn',_0x2d9ca8[_0x9a1b('0x15')],_0x478626);_0x403250(_0xe7a820[_0x9a1b('0x13')](0x1f4,_0x2d9ca8['message']));});});}; \ No newline at end of file +var _0xab26=['then','info','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetMailServerIn','MailServerIn','options','raw','where','map','include','model','attributes','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xab26,0x196));var _0x6ab2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xab26[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x6ab2('0x0'));var util=require(_0x6ab2('0x1'));var moment=require(_0x6ab2('0x2'));var BPromise=require(_0x6ab2('0x3'));var rs=require(_0x6ab2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ab2('0x5'))['db'];var utils=require(_0x6ab2('0x6'));var logger=require(_0x6ab2('0x7'))(_0x6ab2('0x8'));var config=require(_0x6ab2('0x9'));var jayson=require(_0x6ab2('0xa'));var client=jayson[_0x6ab2('0xb')][_0x6ab2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c1f14,_0x2f66af,_0x4ed98b){return new BPromise(function(_0x522099,_0x502d6d){return client[_0x6ab2('0xd')](_0x5c1f14,_0x4ed98b)[_0x6ab2('0xe')](function(_0xf3fbf1){logger[_0x6ab2('0xf')](_0x6ab2('0x10'),_0x2f66af,'request\x20sent');logger['debug'](_0x6ab2('0x11'),_0x2f66af,'request\x20sent',JSON[_0x6ab2('0x12')](_0xf3fbf1));if(_0xf3fbf1['error']){if(_0xf3fbf1[_0x6ab2('0x13')][_0x6ab2('0x14')]===0x1f4){logger[_0x6ab2('0x13')](_0x6ab2('0x10'),_0x2f66af,_0xf3fbf1[_0x6ab2('0x13')][_0x6ab2('0x15')]);return _0x502d6d(_0xf3fbf1[_0x6ab2('0x13')][_0x6ab2('0x15')]);}logger[_0x6ab2('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2f66af,_0xf3fbf1['error'][_0x6ab2('0x15')]);return _0x522099(_0xf3fbf1[_0x6ab2('0x13')][_0x6ab2('0x15')]);}else{logger['info'](_0x6ab2('0x10'),_0x2f66af,_0x6ab2('0x16'));_0x522099(_0xf3fbf1[_0x6ab2('0x17')][_0x6ab2('0x15')]);}})['catch'](function(_0x365de9){logger[_0x6ab2('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2f66af,_0x365de9);_0x502d6d(_0x365de9);});});}exports[_0x6ab2('0x18')]=function(_0x11e316){var _0x571512=this;return new Promise(function(_0x1ae9cc,_0x17ec78){return db[_0x6ab2('0x19')]['findAll']({'raw':_0x11e316[_0x6ab2('0x1a')]?_0x11e316['options'][_0x6ab2('0x1b')]===undefined?!![]:![]:!![],'where':_0x11e316[_0x6ab2('0x1a')]?_0x11e316[_0x6ab2('0x1a')][_0x6ab2('0x1c')]||null:null,'attributes':_0x11e316[_0x6ab2('0x1a')]?_0x11e316['options']['attributes']||null:null,'limit':_0x11e316[_0x6ab2('0x1a')]?_0x11e316[_0x6ab2('0x1a')]['limit']||null:null,'include':_0x11e316[_0x6ab2('0x1a')]?_0x11e316[_0x6ab2('0x1a')]['include']?_[_0x6ab2('0x1d')](_0x11e316[_0x6ab2('0x1a')][_0x6ab2('0x1e')],function(_0x472f61){return{'model':db[_0x472f61[_0x6ab2('0x1f')]],'as':_0x472f61['as'],'attributes':_0x472f61[_0x6ab2('0x20')],'include':_0x472f61[_0x6ab2('0x1e')]?_[_0x6ab2('0x1d')](_0x472f61[_0x6ab2('0x1e')],function(_0x5b4266){return{'model':db[_0x5b4266[_0x6ab2('0x1f')]],'as':_0x5b4266['as'],'attributes':_0x5b4266['attributes'],'include':_0x5b4266[_0x6ab2('0x1e')]?_[_0x6ab2('0x1d')](_0x5b4266['include'],function(_0x3cdc0d){return{'model':db[_0x3cdc0d['model']],'as':_0x3cdc0d['as'],'attributes':_0x3cdc0d[_0x6ab2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6ab2('0xe')](function(_0x352fc4){logger['info'](_0x6ab2('0x18'),_0x11e316);logger[_0x6ab2('0x21')](_0x6ab2('0x18'),_0x11e316,JSON[_0x6ab2('0x12')](_0x352fc4));_0x1ae9cc(_0x352fc4);})[_0x6ab2('0x22')](function(_0x5cdb4d){logger['error'](_0x6ab2('0x18'),_0x5cdb4d['message'],_0x11e316);_0x17ec78(_0x571512[_0x6ab2('0x13')](0x1f4,_0x5cdb4d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 2762cfd..97d58ce 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 8ecbe16..2ccde02 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 _0xa571=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x49dea0,_0x2150ec){var _0x533e42=function(_0x177d3f){while(--_0x177d3f){_0x49dea0['push'](_0x49dea0['shift']());}};_0x533e42(++_0x2150ec);}(_0xa571,0x107));var _0x1a57=function(_0x3e284f,_0x53a94f){_0x3e284f=_0x3e284f-0x0;var _0x3f0719=_0xa571[_0x3e284f];return _0x3f0719;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'description':{'type':Sequelize[_0x1a57('0x2')]},'host':{'type':Sequelize[_0x1a57('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1a57('0x2')]},'port':{'type':Sequelize[_0x1a57('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1a57('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xab40=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xab40,0xcd));var _0x0ab4=function(_0x3abe3e,_0x506e04){_0x3abe3e=_0x3abe3e-0x0;var _0x414b0e=_0xab40[_0x3abe3e];return _0x414b0e;};'use strict';var Sequelize=require(_0x0ab4('0x0'));module[_0x0ab4('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0ab4('0x2')]},'port':{'type':Sequelize[_0x0ab4('0x3')]},'secure':{'type':Sequelize[_0x0ab4('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x0ab4('0x2')]},'authentication':{'type':Sequelize[_0x0ab4('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 0c992ab..b6a973b 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 _0x2e22=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','MailServerOut','includeAll','include','findAll','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x2e22,0x162));var _0x22e2=function(_0x2f7c40,_0xb36203){_0x2f7c40=_0x2f7c40-0x0;var _0x57a4a5=_0x2e22[_0x2f7c40];return _0x57a4a5;};'use strict';var emlformat=require(_0x22e2('0x0'));var rimraf=require(_0x22e2('0x1'));var zipdir=require(_0x22e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x22e2('0x3'));var moment=require(_0x22e2('0x4'));var BPromise=require(_0x22e2('0x5'));var Mustache=require(_0x22e2('0x6'));var util=require(_0x22e2('0x7'));var path=require('path');var sox=require(_0x22e2('0x8'));var csv=require('to-csv');var ejs=require(_0x22e2('0x9'));var fs=require('fs');var fs_extra=require(_0x22e2('0xa'));var _=require(_0x22e2('0xb'));var squel=require(_0x22e2('0xc'));var crypto=require(_0x22e2('0xd'));var jsforce=require(_0x22e2('0xe'));var deskjs=require(_0x22e2('0xf'));var toCsv=require(_0x22e2('0x10'));var querystring=require(_0x22e2('0x11'));var Papa=require('papaparse');var Redis=require(_0x22e2('0x12'));var authService=require(_0x22e2('0x13'));var qs=require(_0x22e2('0x14'));var as=require(_0x22e2('0x15'));var hardwareService=require(_0x22e2('0x16'));var logger=require(_0x22e2('0x17'))(_0x22e2('0x18'));var utils=require('../../config/utils');var config=require(_0x22e2('0x19'));var licenseUtil=require(_0x22e2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54565f,_0x91d95f){_0x91d95f=_0x91d95f||0xcc;return function(_0x37b37f){if(_0x37b37f){return _0x54565f[_0x22e2('0x1b')](_0x91d95f);}return _0x54565f[_0x22e2('0x1c')](_0x91d95f)['end']();};}function respondWithResult(_0x2f700c,_0x5559f7){_0x5559f7=_0x5559f7||0xc8;return function(_0x51a9da){if(_0x51a9da){return _0x2f700c[_0x22e2('0x1c')](_0x5559f7)[_0x22e2('0x1d')](_0x51a9da);}};}function respondWithFilteredResult(_0x101b76,_0x1e9eda){return function(_0x4ebea2){if(_0x4ebea2){var _0x54ef2c=typeof _0x1e9eda[_0x22e2('0x1e')]===_0x22e2('0x1f')&&typeof _0x1e9eda[_0x22e2('0x20')]===_0x22e2('0x1f');var _0x565823=_0x4ebea2[_0x22e2('0x21')];var _0x52e02c=_0x54ef2c?0x0:_0x1e9eda[_0x22e2('0x1e')];var _0x44223e=_0x54ef2c?_0x4ebea2[_0x22e2('0x21')]:_0x1e9eda[_0x22e2('0x1e')]+_0x1e9eda[_0x22e2('0x20')];var _0x54c35e;if(_0x44223e>=_0x565823){_0x44223e=_0x565823;_0x54c35e=0xc8;}else{_0x54c35e=0xce;}_0x101b76[_0x22e2('0x1c')](_0x54c35e);return _0x101b76['set'](_0x22e2('0x22'),_0x52e02c+'-'+_0x44223e+'/'+_0x565823)[_0x22e2('0x1d')](_0x4ebea2);}return null;};}function patchUpdates(_0x267748){return function(_0x38250e){try{jsonpatch[_0x22e2('0x23')](_0x38250e,_0x267748,!![]);}catch(_0x1be913){return BPromise[_0x22e2('0x24')](_0x1be913);}return _0x38250e[_0x22e2('0x25')]();};}function saveUpdates(_0x52af87,_0x27c29d){return function(_0x6e0e42){if(_0x6e0e42){return _0x6e0e42[_0x22e2('0x26')](_0x52af87)['then'](function(_0x37aaed){return _0x37aaed;});}return null;};}function removeEntity(_0x337020,_0x31b0fa){return function(_0x164209){if(_0x164209){return _0x164209[_0x22e2('0x27')]()[_0x22e2('0x28')](function(){_0x337020[_0x22e2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e46c8,_0x547aea){return function(_0x4a511d){if(!_0x4a511d){_0x1e46c8[_0x22e2('0x1b')](0x194);}return _0x4a511d;};}function handleError(_0x489dbb,_0x6aece9){_0x6aece9=_0x6aece9||0x1f4;return function(_0x2643d2){logger[_0x22e2('0x29')](_0x2643d2['stack']);if(_0x2643d2['name']){delete _0x2643d2[_0x22e2('0x2a')];}_0x489dbb[_0x22e2('0x1c')](_0x6aece9)[_0x22e2('0x2b')](_0x2643d2);};}exports[_0x22e2('0x2c')]=function(_0x3ed45c,_0x56227a){var _0x8e7173={},_0x342113={},_0x58de1c={'count':0x0,'rows':[]};var _0x374510=_[_0x22e2('0x2d')](db['MailServerOut'][_0x22e2('0x2e')],function(_0x2648ed){return{'name':_0x2648ed[_0x22e2('0x2f')],'type':_0x2648ed[_0x22e2('0x30')]['key']};});_0x342113['model']=_[_0x22e2('0x2d')](_0x374510,_0x22e2('0x2a'));_0x342113['query']=_[_0x22e2('0x31')](_0x3ed45c[_0x22e2('0x32')]);_0x342113[_0x22e2('0x33')]=_['intersection'](_0x342113[_0x22e2('0x34')],_0x342113[_0x22e2('0x32')]);_0x8e7173[_0x22e2('0x35')]=_[_0x22e2('0x36')](_0x342113[_0x22e2('0x34')],qs[_0x22e2('0x37')](_0x3ed45c['query']['fields']));_0x8e7173[_0x22e2('0x35')]=_0x8e7173[_0x22e2('0x35')][_0x22e2('0x38')]?_0x8e7173[_0x22e2('0x35')]:_0x342113[_0x22e2('0x34')];if(!_0x3ed45c[_0x22e2('0x32')]['hasOwnProperty'](_0x22e2('0x39'))){_0x8e7173[_0x22e2('0x20')]=qs[_0x22e2('0x20')](_0x3ed45c['query'][_0x22e2('0x20')]);_0x8e7173[_0x22e2('0x1e')]=qs[_0x22e2('0x1e')](_0x3ed45c[_0x22e2('0x32')][_0x22e2('0x1e')]);}_0x8e7173['order']=qs[_0x22e2('0x3a')](_0x3ed45c['query'][_0x22e2('0x3a')]);_0x8e7173[_0x22e2('0x3b')]=qs['filters'](_['pick'](_0x3ed45c[_0x22e2('0x32')],_0x342113[_0x22e2('0x33')]),_0x374510);if(_0x3ed45c[_0x22e2('0x32')][_0x22e2('0x3c')]){_0x8e7173[_0x22e2('0x3b')]=_[_0x22e2('0x3d')](_0x8e7173[_0x22e2('0x3b')],{'$or':_['map'](_0x374510,function(_0x624daf){if(_0x624daf['type']!==_0x22e2('0x3e')){var _0x5e1172={};_0x5e1172[_0x624daf[_0x22e2('0x2a')]]={'$like':'%'+_0x3ed45c['query']['filter']+'%'};return _0x5e1172;}})});}_0x8e7173=_[_0x22e2('0x3d')]({},_0x8e7173,_0x3ed45c['options']);var _0x17b5b3={'where':_0x8e7173[_0x22e2('0x3b')]};return db[_0x22e2('0x3f')][_0x22e2('0x21')](_0x17b5b3)[_0x22e2('0x28')](function(_0x273607){_0x58de1c[_0x22e2('0x21')]=_0x273607;if(_0x3ed45c[_0x22e2('0x32')][_0x22e2('0x40')]){_0x8e7173[_0x22e2('0x41')]=[{'all':!![]}];}return db[_0x22e2('0x3f')][_0x22e2('0x42')](_0x8e7173);})['then'](function(_0x53ba8f){_0x58de1c[_0x22e2('0x43')]=_0x53ba8f;return _0x58de1c;})[_0x22e2('0x28')](respondWithFilteredResult(_0x56227a,_0x8e7173))[_0x22e2('0x44')](handleError(_0x56227a,null));};exports['show']=function(_0x2c00c7,_0x41cc1d){var _0x22d8d2={'raw':!![],'where':{'id':_0x2c00c7['params']['id']}},_0x1b4112={};_0x1b4112['model']=_[_0x22e2('0x31')](db['MailServerOut'][_0x22e2('0x2e')]);_0x1b4112[_0x22e2('0x32')]=_[_0x22e2('0x31')](_0x2c00c7[_0x22e2('0x32')]);_0x1b4112['filters']=_[_0x22e2('0x36')](_0x1b4112[_0x22e2('0x34')],_0x1b4112[_0x22e2('0x32')]);_0x22d8d2['attributes']=_[_0x22e2('0x36')](_0x1b4112['model'],qs[_0x22e2('0x37')](_0x2c00c7[_0x22e2('0x32')]['fields']));_0x22d8d2[_0x22e2('0x35')]=_0x22d8d2[_0x22e2('0x35')]['length']?_0x22d8d2[_0x22e2('0x35')]:_0x1b4112[_0x22e2('0x34')];if(_0x2c00c7['query'][_0x22e2('0x40')]){_0x22d8d2[_0x22e2('0x41')]=[{'all':!![]}];}_0x22d8d2=_['merge']({},_0x22d8d2,_0x2c00c7['options']);return db[_0x22e2('0x3f')][_0x22e2('0x45')](_0x22d8d2)[_0x22e2('0x28')](handleEntityNotFound(_0x41cc1d,null))[_0x22e2('0x28')](respondWithResult(_0x41cc1d,null))[_0x22e2('0x44')](handleError(_0x41cc1d,null));};exports['create']=function(_0x1df446,_0x7743ff){return db['MailServerOut'][_0x22e2('0x46')](_0x1df446['body'],{})[_0x22e2('0x28')](respondWithResult(_0x7743ff,0xc9))[_0x22e2('0x44')](handleError(_0x7743ff,null));};exports[_0x22e2('0x26')]=function(_0x1c2bf1,_0x476b7d){if(_0x1c2bf1[_0x22e2('0x47')]['id']){delete _0x1c2bf1[_0x22e2('0x47')]['id'];}return db['MailServerOut'][_0x22e2('0x45')]({'where':{'id':_0x1c2bf1['params']['id']}})[_0x22e2('0x28')](handleEntityNotFound(_0x476b7d,null))['then'](saveUpdates(_0x1c2bf1[_0x22e2('0x47')],null))['then'](respondWithResult(_0x476b7d,null))['catch'](handleError(_0x476b7d,null));};exports[_0x22e2('0x27')]=function(_0x10e57a,_0x4d0835){return db[_0x22e2('0x3f')][_0x22e2('0x45')]({'where':{'id':_0x10e57a[_0x22e2('0x48')]['id']}})[_0x22e2('0x28')](handleEntityNotFound(_0x4d0835,null))[_0x22e2('0x28')](removeEntity(_0x4d0835,null))[_0x22e2('0x44')](handleError(_0x4d0835,null));}; \ No newline at end of file +var _0xcb18=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0xfc5b47,_0x2ec02d){var _0x17b3c0=function(_0x49b956){while(--_0x49b956){_0xfc5b47['push'](_0xfc5b47['shift']());}};_0x17b3c0(++_0x2ec02d);}(_0xcb18,0x1ab));var _0x8cb1=function(_0xad1486,_0x307e5f){_0xad1486=_0xad1486-0x0;var _0x3ad5e2=_0xcb18[_0xad1486];return _0x3ad5e2;};'use strict';var emlformat=require(_0x8cb1('0x0'));var rimraf=require(_0x8cb1('0x1'));var zipdir=require(_0x8cb1('0x2'));var jsonpatch=require(_0x8cb1('0x3'));var rp=require(_0x8cb1('0x4'));var moment=require(_0x8cb1('0x5'));var BPromise=require(_0x8cb1('0x6'));var Mustache=require(_0x8cb1('0x7'));var util=require('util');var path=require(_0x8cb1('0x8'));var sox=require(_0x8cb1('0x9'));var csv=require(_0x8cb1('0xa'));var ejs=require(_0x8cb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cb1('0xc'));var squel=require(_0x8cb1('0xd'));var crypto=require(_0x8cb1('0xe'));var jsforce=require(_0x8cb1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8cb1('0xa'));var querystring=require(_0x8cb1('0x10'));var Papa=require(_0x8cb1('0x11'));var Redis=require('ioredis');var authService=require(_0x8cb1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8cb1('0x13'));var hardwareService=require(_0x8cb1('0x14'));var logger=require(_0x8cb1('0x15'))(_0x8cb1('0x16'));var utils=require('../../config/utils');var config=require(_0x8cb1('0x17'));var licenseUtil=require(_0x8cb1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57d7ab,_0x4641fc){_0x4641fc=_0x4641fc||0xcc;return function(_0x5c9ebf){if(_0x5c9ebf){return _0x57d7ab[_0x8cb1('0x19')](_0x4641fc);}return _0x57d7ab[_0x8cb1('0x1a')](_0x4641fc)['end']();};}function respondWithResult(_0x7c904c,_0x55a348){_0x55a348=_0x55a348||0xc8;return function(_0x450a6a){if(_0x450a6a){return _0x7c904c[_0x8cb1('0x1a')](_0x55a348)['json'](_0x450a6a);}};}function respondWithFilteredResult(_0x5a932b,_0x305b76){return function(_0x5ec932){if(_0x5ec932){var _0x341a73=typeof _0x305b76[_0x8cb1('0x1b')]===_0x8cb1('0x1c')&&typeof _0x305b76[_0x8cb1('0x1d')]===_0x8cb1('0x1c');var _0x495023=_0x5ec932[_0x8cb1('0x1e')];var _0x364d85=_0x341a73?0x0:_0x305b76[_0x8cb1('0x1b')];var _0x2e79f7=_0x341a73?_0x5ec932[_0x8cb1('0x1e')]:_0x305b76['offset']+_0x305b76['limit'];var _0x359feb;if(_0x2e79f7>=_0x495023){_0x2e79f7=_0x495023;_0x359feb=0xc8;}else{_0x359feb=0xce;}_0x5a932b[_0x8cb1('0x1a')](_0x359feb);return _0x5a932b[_0x8cb1('0x1f')](_0x8cb1('0x20'),_0x364d85+'-'+_0x2e79f7+'/'+_0x495023)[_0x8cb1('0x21')](_0x5ec932);}return null;};}function patchUpdates(_0x49caab){return function(_0x29d509){try{jsonpatch['apply'](_0x29d509,_0x49caab,!![]);}catch(_0x49e0a9){return BPromise[_0x8cb1('0x22')](_0x49e0a9);}return _0x29d509[_0x8cb1('0x23')]();};}function saveUpdates(_0xd859fb,_0x551168){return function(_0x4e2e04){if(_0x4e2e04){return _0x4e2e04['update'](_0xd859fb)[_0x8cb1('0x24')](function(_0x306110){return _0x306110;});}return null;};}function removeEntity(_0x2afc74,_0x4b7475){return function(_0x2ed179){if(_0x2ed179){return _0x2ed179['destroy']()[_0x8cb1('0x24')](function(){_0x2afc74[_0x8cb1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b1eec,_0x50e6a0){return function(_0x2646b0){if(!_0x2646b0){_0x1b1eec[_0x8cb1('0x19')](0x194);}return _0x2646b0;};}function handleError(_0x4bfbc9,_0x555e87){_0x555e87=_0x555e87||0x1f4;return function(_0x3a7b2a){logger[_0x8cb1('0x25')](_0x3a7b2a[_0x8cb1('0x26')]);if(_0x3a7b2a[_0x8cb1('0x27')]){delete _0x3a7b2a['name'];}_0x4bfbc9[_0x8cb1('0x1a')](_0x555e87)[_0x8cb1('0x28')](_0x3a7b2a);};}exports['index']=function(_0x438bc5,_0xcfa47c){var _0x33ff40={},_0x5444a0={},_0x364e27={'count':0x0,'rows':[]};var _0x237f55=_[_0x8cb1('0x29')](db[_0x8cb1('0x2a')][_0x8cb1('0x2b')],function(_0x268101){return{'name':_0x268101[_0x8cb1('0x2c')],'type':_0x268101['type']['key']};});_0x5444a0[_0x8cb1('0x2d')]=_[_0x8cb1('0x29')](_0x237f55,'name');_0x5444a0['query']=_[_0x8cb1('0x2e')](_0x438bc5[_0x8cb1('0x2f')]);_0x5444a0[_0x8cb1('0x30')]=_[_0x8cb1('0x31')](_0x5444a0[_0x8cb1('0x2d')],_0x5444a0[_0x8cb1('0x2f')]);_0x33ff40[_0x8cb1('0x32')]=_[_0x8cb1('0x31')](_0x5444a0[_0x8cb1('0x2d')],qs[_0x8cb1('0x33')](_0x438bc5[_0x8cb1('0x2f')]['fields']));_0x33ff40[_0x8cb1('0x32')]=_0x33ff40[_0x8cb1('0x32')][_0x8cb1('0x34')]?_0x33ff40[_0x8cb1('0x32')]:_0x5444a0['model'];if(!_0x438bc5[_0x8cb1('0x2f')]['hasOwnProperty'](_0x8cb1('0x35'))){_0x33ff40[_0x8cb1('0x1d')]=qs[_0x8cb1('0x1d')](_0x438bc5['query'][_0x8cb1('0x1d')]);_0x33ff40[_0x8cb1('0x1b')]=qs[_0x8cb1('0x1b')](_0x438bc5[_0x8cb1('0x2f')][_0x8cb1('0x1b')]);}_0x33ff40[_0x8cb1('0x36')]=qs[_0x8cb1('0x37')](_0x438bc5['query'][_0x8cb1('0x37')]);_0x33ff40[_0x8cb1('0x38')]=qs[_0x8cb1('0x30')](_['pick'](_0x438bc5[_0x8cb1('0x2f')],_0x5444a0[_0x8cb1('0x30')]),_0x237f55);if(_0x438bc5[_0x8cb1('0x2f')][_0x8cb1('0x39')]){_0x33ff40[_0x8cb1('0x38')]=_[_0x8cb1('0x3a')](_0x33ff40[_0x8cb1('0x38')],{'$or':_[_0x8cb1('0x29')](_0x237f55,function(_0x19c68e){if(_0x19c68e[_0x8cb1('0x3b')]!==_0x8cb1('0x3c')){var _0x49bb88={};_0x49bb88[_0x19c68e[_0x8cb1('0x27')]]={'$like':'%'+_0x438bc5[_0x8cb1('0x2f')][_0x8cb1('0x39')]+'%'};return _0x49bb88;}})});}_0x33ff40=_[_0x8cb1('0x3a')]({},_0x33ff40,_0x438bc5[_0x8cb1('0x3d')]);var _0x206842={'where':_0x33ff40[_0x8cb1('0x38')]};return db[_0x8cb1('0x2a')][_0x8cb1('0x1e')](_0x206842)['then'](function(_0x201b0a){_0x364e27['count']=_0x201b0a;if(_0x438bc5['query'][_0x8cb1('0x3e')]){_0x33ff40[_0x8cb1('0x3f')]=[{'all':!![]}];}return db[_0x8cb1('0x2a')][_0x8cb1('0x40')](_0x33ff40);})[_0x8cb1('0x24')](function(_0x51d5bd){_0x364e27[_0x8cb1('0x41')]=_0x51d5bd;return _0x364e27;})['then'](respondWithFilteredResult(_0xcfa47c,_0x33ff40))['catch'](handleError(_0xcfa47c,null));};exports[_0x8cb1('0x42')]=function(_0x5f3495,_0x1fc934){var _0x321f2f={'raw':!![],'where':{'id':_0x5f3495[_0x8cb1('0x43')]['id']}},_0x9fd0f8={};_0x9fd0f8[_0x8cb1('0x2d')]=_[_0x8cb1('0x2e')](db['MailServerOut'][_0x8cb1('0x2b')]);_0x9fd0f8[_0x8cb1('0x2f')]=_[_0x8cb1('0x2e')](_0x5f3495[_0x8cb1('0x2f')]);_0x9fd0f8[_0x8cb1('0x30')]=_[_0x8cb1('0x31')](_0x9fd0f8[_0x8cb1('0x2d')],_0x9fd0f8[_0x8cb1('0x2f')]);_0x321f2f[_0x8cb1('0x32')]=_[_0x8cb1('0x31')](_0x9fd0f8['model'],qs[_0x8cb1('0x33')](_0x5f3495[_0x8cb1('0x2f')][_0x8cb1('0x33')]));_0x321f2f[_0x8cb1('0x32')]=_0x321f2f[_0x8cb1('0x32')][_0x8cb1('0x34')]?_0x321f2f[_0x8cb1('0x32')]:_0x9fd0f8['model'];if(_0x5f3495['query'][_0x8cb1('0x3e')]){_0x321f2f[_0x8cb1('0x3f')]=[{'all':!![]}];}_0x321f2f=_[_0x8cb1('0x3a')]({},_0x321f2f,_0x5f3495[_0x8cb1('0x3d')]);return db[_0x8cb1('0x2a')][_0x8cb1('0x44')](_0x321f2f)[_0x8cb1('0x24')](handleEntityNotFound(_0x1fc934,null))[_0x8cb1('0x24')](respondWithResult(_0x1fc934,null))[_0x8cb1('0x45')](handleError(_0x1fc934,null));};exports[_0x8cb1('0x46')]=function(_0x1ca3d7,_0x17a82a){return db[_0x8cb1('0x2a')]['create'](_0x1ca3d7[_0x8cb1('0x47')],{})[_0x8cb1('0x24')](respondWithResult(_0x17a82a,0xc9))[_0x8cb1('0x45')](handleError(_0x17a82a,null));};exports[_0x8cb1('0x48')]=function(_0x218b45,_0x4a18b4){if(_0x218b45[_0x8cb1('0x47')]['id']){delete _0x218b45[_0x8cb1('0x47')]['id'];}return db[_0x8cb1('0x2a')][_0x8cb1('0x44')]({'where':{'id':_0x218b45['params']['id']}})[_0x8cb1('0x24')](handleEntityNotFound(_0x4a18b4,null))['then'](saveUpdates(_0x218b45[_0x8cb1('0x47')],null))[_0x8cb1('0x24')](respondWithResult(_0x4a18b4,null))[_0x8cb1('0x45')](handleError(_0x4a18b4,null));};exports[_0x8cb1('0x49')]=function(_0x1a4bac,_0x670594){return db[_0x8cb1('0x2a')][_0x8cb1('0x44')]({'where':{'id':_0x1a4bac[_0x8cb1('0x43')]['id']}})[_0x8cb1('0x24')](handleEntityNotFound(_0x670594,null))[_0x8cb1('0x24')](removeEntity(_0x670594,null))[_0x8cb1('0x45')](handleError(_0x670594,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d3147af..ba6d838 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 _0x9d5f=['mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailServerOut'];(function(_0x42b408,_0x4f47e9){var _0x454b83=function(_0x2bae1c){while(--_0x2bae1c){_0x42b408['push'](_0x42b408['shift']());}};_0x454b83(++_0x4f47e9);}(_0x9d5f,0x181));var _0xf9d5=function(_0x522b43,_0x338f03){_0x522b43=_0x522b43-0x0;var _0x340e1f=_0x9d5f[_0x522b43];return _0x340e1f;};'use strict';var _=require(_0xf9d5('0x0'));var util=require('util');var logger=require(_0xf9d5('0x1'))(_0xf9d5('0x2'));var moment=require(_0xf9d5('0x3'));var BPromise=require(_0xf9d5('0x4'));var rp=require(_0xf9d5('0x5'));var fs=require('fs');var path=require(_0xf9d5('0x6'));var rimraf=require(_0xf9d5('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xf9d5('0x8')]=function(_0x356772,_0x32ec37){return _0x356772[_0xf9d5('0x9')](_0xf9d5('0xa'),attributes,{'tableName':_0xf9d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb74=['define','MailServerOut','mail_servers_out','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports'];(function(_0x32f845,_0x335cb9){var _0x3c0de4=function(_0x44c308){while(--_0x44c308){_0x32f845['push'](_0x32f845['shift']());}};_0x3c0de4(++_0x335cb9);}(_0xfb74,0x177));var _0x4fb7=function(_0x3c79d1,_0x1e55d4){_0x3c79d1=_0x3c79d1-0x0;var _0x1646e8=_0xfb74[_0x3c79d1];return _0x1646e8;};'use strict';var _=require('lodash');var util=require(_0x4fb7('0x0'));var logger=require(_0x4fb7('0x1'))('api');var moment=require(_0x4fb7('0x2'));var BPromise=require(_0x4fb7('0x3'));var rp=require(_0x4fb7('0x4'));var fs=require('fs');var path=require(_0x4fb7('0x5'));var rimraf=require(_0x4fb7('0x6'));var config=require('../../config/environment');var attributes=require(_0x4fb7('0x7'));module[_0x4fb7('0x8')]=function(_0xf739b3,_0x830b2c){return _0xf739b3[_0x4fb7('0x9')](_0x4fb7('0xa'),attributes,{'tableName':_0x4fb7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 5dfd3ad..8ba5af4 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\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(_0x38bc91,_0x270555){var _0x9a6320=function(_0x47bd16){while(--_0x47bd16){_0x38bc91['push'](_0x38bc91['shift']());}};_0x9a6320(++_0x270555);}(_0x1261,0x144));var _0x1126=function(_0x368590,_0x48ad74){_0x368590=_0x368590-0x0;var _0x5ceb60=_0x1261[_0x368590];return _0x5ceb60;};'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')]('MailServerOut,\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 _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(_0x31dab2,_0x2e988a){var _0x967a94=function(_0x587d3c){while(--_0x587d3c){_0x31dab2['push'](_0x31dab2['shift']());}};_0x967a94(++_0x2e988a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 22ab930..b0ba5f6 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 _0xa38d=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa38d,0x12e));var _0xda38=function(_0x3fa0ba,_0x10743d){_0x3fa0ba=_0x3fa0ba-0x0;var _0x1c29c3=_0xa38d[_0x3fa0ba];return _0x1c29c3;};'use strict';var multer=require('multer');var util=require(_0xda38('0x0'));var path=require('path');var timeout=require(_0xda38('0x1'));var express=require(_0xda38('0x2'));var router=express[_0xda38('0x3')]();var fs_extra=require(_0xda38('0x4'));var auth=require(_0xda38('0x5'));var interaction=require(_0xda38('0x6'));var config=require(_0xda38('0x7'));var controller=require(_0xda38('0x8'));router[_0xda38('0x9')]('/',auth[_0xda38('0xa')](),controller['index']);router[_0xda38('0x9')](_0xda38('0xb'),auth[_0xda38('0xa')](),controller[_0xda38('0xc')]);router[_0xda38('0x9')](_0xda38('0xd'),auth[_0xda38('0xa')](),controller['show']);router['post']('/',auth[_0xda38('0xa')](),controller[_0xda38('0xe')]);router[_0xda38('0xf')](_0xda38('0xd'),auth[_0xda38('0xa')](),controller[_0xda38('0x10')]);router[_0xda38('0x11')](_0xda38('0xd'),auth['isAuthenticated'](),controller[_0xda38('0x12')]);module[_0xda38('0x13')]=router; \ No newline at end of file +var _0x2064=['create','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','isAuthenticated','/:id','post'];(function(_0x382d8e,_0x2a5761){var _0x23993d=function(_0x1f491c){while(--_0x1f491c){_0x382d8e['push'](_0x382d8e['shift']());}};_0x23993d(++_0x2a5761);}(_0x2064,0xee));var _0x4206=function(_0x34ed48,_0x2cc995){_0x34ed48=_0x34ed48-0x0;var _0x37da5c=_0x2064[_0x34ed48];return _0x37da5c;};'use strict';var multer=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var path=require(_0x4206('0x2'));var timeout=require('connect-timeout');var express=require(_0x4206('0x3'));var router=express[_0x4206('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4206('0x5'));var interaction=require(_0x4206('0x6'));var config=require('../../config/environment');var controller=require(_0x4206('0x7'));router[_0x4206('0x8')]('/',auth['isAuthenticated'](),controller[_0x4206('0x9')]);router[_0x4206('0x8')](_0x4206('0xa'),auth[_0x4206('0xb')](),controller['describe']);router[_0x4206('0x8')](_0x4206('0xc'),auth[_0x4206('0xb')](),controller['show']);router[_0x4206('0xd')]('/',auth[_0x4206('0xb')](),controller[_0x4206('0xe')]);router[_0x4206('0xf')](_0x4206('0xc'),auth[_0x4206('0xb')](),controller[_0x4206('0x10')]);router['delete'](_0x4206('0xc'),auth[_0x4206('0xb')](),controller['destroy']);module[_0x4206('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c7ad362..e4d23f6 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 _0x5496=['name','sequelize','exports','STRING'];(function(_0x2a0bd4,_0x53eb33){var _0x420de3=function(_0x41592b){while(--_0x41592b){_0x2a0bd4['push'](_0x2a0bd4['shift']());}};_0x420de3(++_0x53eb33);}(_0x5496,0x175));var _0x6549=function(_0x19c0b8,_0x1d38ee){_0x19c0b8=_0x19c0b8-0x0;var _0x11373b=_0x5496[_0x19c0b8];return _0x11373b;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'unique':_0x6549('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6549('0x2')]}}; \ No newline at end of file +var _0x0a6b=['sequelize','STRING'];(function(_0x1664ad,_0x1bf6d3){var _0xd64515=function(_0x5382f5){while(--_0x5382f5){_0x1664ad['push'](_0x1664ad['shift']());}};_0xd64515(++_0x1bf6d3);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x555f58,_0x449260){_0x555f58=_0x555f58-0x0;var _0x38a126=_0x0a6b[_0x555f58];return _0x38a126;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb0a6('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 60c99b7..a008230 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 _0xe0c1=['params','include','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show'];(function(_0x9e29dd,_0x592c7e){var _0x639665=function(_0x1ae93f){while(--_0x1ae93f){_0x9e29dd['push'](_0x9e29dd['shift']());}};_0x639665(++_0x592c7e);}(_0xe0c1,0x9f));var _0x1e0c=function(_0x1f4a42,_0x345d75){_0x1f4a42=_0x1f4a42-0x0;var _0x3ac203=_0xe0c1[_0x1f4a42];return _0x3ac203;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e0c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e0c('0x1'));var rp=require(_0x1e0c('0x2'));var moment=require(_0x1e0c('0x3'));var BPromise=require(_0x1e0c('0x4'));var Mustache=require('mustache');var util=require(_0x1e0c('0x5'));var path=require(_0x1e0c('0x6'));var sox=require('sox');var csv=require(_0x1e0c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e0c('0x8'));var _=require(_0x1e0c('0x9'));var squel=require(_0x1e0c('0xa'));var crypto=require(_0x1e0c('0xb'));var jsforce=require(_0x1e0c('0xc'));var deskjs=require(_0x1e0c('0xd'));var toCsv=require(_0x1e0c('0x7'));var querystring=require(_0x1e0c('0xe'));var Papa=require(_0x1e0c('0xf'));var Redis=require('ioredis');var authService=require(_0x1e0c('0x10'));var qs=require(_0x1e0c('0x11'));var as=require(_0x1e0c('0x12'));var hardwareService=require(_0x1e0c('0x13'));var logger=require('../../config/logger')(_0x1e0c('0x14'));var utils=require(_0x1e0c('0x15'));var config=require(_0x1e0c('0x16'));var licenseUtil=require(_0x1e0c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2481e8,_0x3c0180){_0x3c0180=_0x3c0180||0xcc;return function(_0x1afc6c){if(_0x1afc6c){return _0x2481e8['sendStatus'](_0x3c0180);}return _0x2481e8[_0x1e0c('0x18')](_0x3c0180)[_0x1e0c('0x19')]();};}function respondWithResult(_0x1b8306,_0x1fc873){_0x1fc873=_0x1fc873||0xc8;return function(_0x25301b){if(_0x25301b){return _0x1b8306[_0x1e0c('0x18')](_0x1fc873)[_0x1e0c('0x1a')](_0x25301b);}};}function respondWithFilteredResult(_0x46aa53,_0xdbb7d7){return function(_0x16b466){if(_0x16b466){var _0x24afbe=typeof _0xdbb7d7[_0x1e0c('0x1b')]===_0x1e0c('0x1c')&&typeof _0xdbb7d7[_0x1e0c('0x1d')]===_0x1e0c('0x1c');var _0x9681c8=_0x16b466[_0x1e0c('0x1e')];var _0x419297=_0x24afbe?0x0:_0xdbb7d7['offset'];var _0x112a7c=_0x24afbe?_0x16b466[_0x1e0c('0x1e')]:_0xdbb7d7[_0x1e0c('0x1b')]+_0xdbb7d7[_0x1e0c('0x1d')];var _0x307cb2;if(_0x112a7c>=_0x9681c8){_0x112a7c=_0x9681c8;_0x307cb2=0xc8;}else{_0x307cb2=0xce;}_0x46aa53['status'](_0x307cb2);return _0x46aa53[_0x1e0c('0x1f')](_0x1e0c('0x20'),_0x419297+'-'+_0x112a7c+'/'+_0x9681c8)[_0x1e0c('0x1a')](_0x16b466);}return null;};}function patchUpdates(_0x2c53fd){return function(_0x1534d3){try{jsonpatch[_0x1e0c('0x21')](_0x1534d3,_0x2c53fd,!![]);}catch(_0xee1454){return BPromise[_0x1e0c('0x22')](_0xee1454);}return _0x1534d3['save']();};}function saveUpdates(_0x5952fc,_0x4030eb){return function(_0x15ab45){if(_0x15ab45){return _0x15ab45[_0x1e0c('0x23')](_0x5952fc)['then'](function(_0x417577){return _0x417577;});}return null;};}function removeEntity(_0x3727fd,_0x17b9b9){return function(_0x52139c){if(_0x52139c){return _0x52139c[_0x1e0c('0x24')]()[_0x1e0c('0x25')](function(){_0x3727fd['status'](0xcc)[_0x1e0c('0x19')]();});}};}function handleEntityNotFound(_0x5bd327,_0x25f8cf){return function(_0x549814){if(!_0x549814){_0x5bd327[_0x1e0c('0x26')](0x194);}return _0x549814;};}function handleError(_0x4bec22,_0x1cd00a){_0x1cd00a=_0x1cd00a||0x1f4;return function(_0x3c113b){logger[_0x1e0c('0x27')](_0x3c113b[_0x1e0c('0x28')]);if(_0x3c113b[_0x1e0c('0x29')]){delete _0x3c113b['name'];}_0x4bec22[_0x1e0c('0x18')](_0x1cd00a)[_0x1e0c('0x2a')](_0x3c113b);};}exports['index']=function(_0x18478a,_0x14ce3d){var _0x4201d8={},_0x477d3e={},_0x57b91c={'count':0x0,'rows':[]};var _0x28e555=_[_0x1e0c('0x2b')](db[_0x1e0c('0x2c')][_0x1e0c('0x2d')],function(_0x720d06){return{'name':_0x720d06[_0x1e0c('0x2e')],'type':_0x720d06['type'][_0x1e0c('0x2f')]};});_0x477d3e[_0x1e0c('0x30')]=_[_0x1e0c('0x2b')](_0x28e555,_0x1e0c('0x29'));_0x477d3e[_0x1e0c('0x31')]=_[_0x1e0c('0x32')](_0x18478a[_0x1e0c('0x31')]);_0x477d3e[_0x1e0c('0x33')]=_['intersection'](_0x477d3e[_0x1e0c('0x30')],_0x477d3e[_0x1e0c('0x31')]);_0x4201d8['attributes']=_[_0x1e0c('0x34')](_0x477d3e['model'],qs[_0x1e0c('0x35')](_0x18478a['query'][_0x1e0c('0x35')]));_0x4201d8[_0x1e0c('0x36')]=_0x4201d8[_0x1e0c('0x36')][_0x1e0c('0x37')]?_0x4201d8[_0x1e0c('0x36')]:_0x477d3e['model'];if(!_0x18478a[_0x1e0c('0x31')][_0x1e0c('0x38')](_0x1e0c('0x39'))){_0x4201d8[_0x1e0c('0x1d')]=qs[_0x1e0c('0x1d')](_0x18478a[_0x1e0c('0x31')][_0x1e0c('0x1d')]);_0x4201d8['offset']=qs[_0x1e0c('0x1b')](_0x18478a[_0x1e0c('0x31')][_0x1e0c('0x1b')]);}_0x4201d8[_0x1e0c('0x3a')]=qs['sort'](_0x18478a[_0x1e0c('0x31')]['sort']);_0x4201d8[_0x1e0c('0x3b')]=qs[_0x1e0c('0x33')](_[_0x1e0c('0x3c')](_0x18478a['query'],_0x477d3e[_0x1e0c('0x33')]),_0x28e555);if(_0x18478a[_0x1e0c('0x31')][_0x1e0c('0x3d')]){_0x4201d8['where']=_[_0x1e0c('0x3e')](_0x4201d8[_0x1e0c('0x3b')],{'$or':_[_0x1e0c('0x2b')](_0x28e555,function(_0x55976b){if(_0x55976b[_0x1e0c('0x3f')]!==_0x1e0c('0x40')){var _0x42600f={};_0x42600f[_0x55976b[_0x1e0c('0x29')]]={'$like':'%'+_0x18478a[_0x1e0c('0x31')][_0x1e0c('0x3d')]+'%'};return _0x42600f;}})});}_0x4201d8=_[_0x1e0c('0x3e')]({},_0x4201d8,_0x18478a[_0x1e0c('0x41')]);var _0x2ef3de={'where':_0x4201d8[_0x1e0c('0x3b')]};return db[_0x1e0c('0x2c')][_0x1e0c('0x1e')](_0x2ef3de)['then'](function(_0x21e24c){_0x57b91c[_0x1e0c('0x1e')]=_0x21e24c;if(_0x18478a[_0x1e0c('0x31')][_0x1e0c('0x42')]){_0x4201d8['include']=[{'all':!![]}];}return db[_0x1e0c('0x2c')]['findAll'](_0x4201d8);})['then'](function(_0x33a3d9){_0x57b91c[_0x1e0c('0x43')]=_0x33a3d9;return _0x57b91c;})[_0x1e0c('0x25')](respondWithFilteredResult(_0x14ce3d,_0x4201d8))['catch'](handleError(_0x14ce3d,null));};exports[_0x1e0c('0x44')]=function(_0x19ef9a,_0x385396){var _0x4db38d={'raw':!![],'where':{'id':_0x19ef9a[_0x1e0c('0x45')]['id']}},_0x582f6d={};_0x582f6d[_0x1e0c('0x30')]=_[_0x1e0c('0x32')](db[_0x1e0c('0x2c')][_0x1e0c('0x2d')]);_0x582f6d['query']=_[_0x1e0c('0x32')](_0x19ef9a[_0x1e0c('0x31')]);_0x582f6d[_0x1e0c('0x33')]=_[_0x1e0c('0x34')](_0x582f6d[_0x1e0c('0x30')],_0x582f6d[_0x1e0c('0x31')]);_0x4db38d[_0x1e0c('0x36')]=_[_0x1e0c('0x34')](_0x582f6d['model'],qs[_0x1e0c('0x35')](_0x19ef9a['query'][_0x1e0c('0x35')]));_0x4db38d[_0x1e0c('0x36')]=_0x4db38d[_0x1e0c('0x36')]['length']?_0x4db38d[_0x1e0c('0x36')]:_0x582f6d[_0x1e0c('0x30')];if(_0x19ef9a['query'][_0x1e0c('0x42')]){_0x4db38d[_0x1e0c('0x46')]=[{'all':!![]}];}_0x4db38d=_['merge']({},_0x4db38d,_0x19ef9a['options']);return db[_0x1e0c('0x2c')][_0x1e0c('0x47')](_0x4db38d)[_0x1e0c('0x25')](handleEntityNotFound(_0x385396,null))[_0x1e0c('0x25')](respondWithResult(_0x385396,null))[_0x1e0c('0x48')](handleError(_0x385396,null));};exports[_0x1e0c('0x49')]=function(_0x2ceaa7,_0x1b1ea7){return db['MailSubstatus'][_0x1e0c('0x49')](_0x2ceaa7['body'],{})[_0x1e0c('0x25')](respondWithResult(_0x1b1ea7,0xc9))[_0x1e0c('0x48')](handleError(_0x1b1ea7,null));};exports[_0x1e0c('0x23')]=function(_0x55003e,_0x50763e){if(_0x55003e[_0x1e0c('0x4a')]['id']){delete _0x55003e[_0x1e0c('0x4a')]['id'];}return db[_0x1e0c('0x2c')][_0x1e0c('0x47')]({'where':{'id':_0x55003e[_0x1e0c('0x45')]['id']}})[_0x1e0c('0x25')](handleEntityNotFound(_0x50763e,null))['then'](saveUpdates(_0x55003e[_0x1e0c('0x4a')],null))['then'](respondWithResult(_0x50763e,null))[_0x1e0c('0x48')](handleError(_0x50763e,null));};exports['destroy']=function(_0x164ff8,_0x515a0b){return db[_0x1e0c('0x2c')][_0x1e0c('0x47')]({'where':{'id':_0x164ff8[_0x1e0c('0x45')]['id']}})[_0x1e0c('0x25')](handleEntityNotFound(_0x515a0b,null))[_0x1e0c('0x25')](removeEntity(_0x515a0b,null))[_0x1e0c('0x48')](handleError(_0x515a0b,null));};exports[_0x1e0c('0x4b')]=function(_0x19a084,_0x2d77ad){return db['MailSubstatus']['describe']()['then'](respondWithResult(_0x2d77ad,null))[_0x1e0c('0x48')](handleError(_0x2d77ad,null));}; \ No newline at end of file +var _0xb850=['body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','create'];(function(_0x51fd16,_0x197719){var _0x46f2ed=function(_0x420451){while(--_0x420451){_0x51fd16['push'](_0x51fd16['shift']());}};_0x46f2ed(++_0x197719);}(_0xb850,0x144));var _0x0b85=function(_0x58f363,_0x135c64){_0x58f363=_0x58f363-0x0;var _0xcb2c83=_0xb850[_0x58f363];return _0xcb2c83;};'use strict';var emlformat=require(_0x0b85('0x0'));var rimraf=require(_0x0b85('0x1'));var zipdir=require(_0x0b85('0x2'));var jsonpatch=require(_0x0b85('0x3'));var rp=require(_0x0b85('0x4'));var moment=require(_0x0b85('0x5'));var BPromise=require(_0x0b85('0x6'));var Mustache=require('mustache');var util=require(_0x0b85('0x7'));var path=require('path');var sox=require(_0x0b85('0x8'));var csv=require(_0x0b85('0x9'));var ejs=require(_0x0b85('0xa'));var fs=require('fs');var fs_extra=require(_0x0b85('0xb'));var _=require(_0x0b85('0xc'));var squel=require(_0x0b85('0xd'));var crypto=require(_0x0b85('0xe'));var jsforce=require(_0x0b85('0xf'));var deskjs=require(_0x0b85('0x10'));var toCsv=require(_0x0b85('0x9'));var querystring=require(_0x0b85('0x11'));var Papa=require(_0x0b85('0x12'));var Redis=require(_0x0b85('0x13'));var authService=require(_0x0b85('0x14'));var qs=require(_0x0b85('0x15'));var as=require(_0x0b85('0x16'));var hardwareService=require(_0x0b85('0x17'));var logger=require(_0x0b85('0x18'))(_0x0b85('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b85('0x1a'));var db=require(_0x0b85('0x1b'))['db'];function respondWithStatusCode(_0x47dde3,_0xfbd4ac){_0xfbd4ac=_0xfbd4ac||0xcc;return function(_0x46cee7){if(_0x46cee7){return _0x47dde3['sendStatus'](_0xfbd4ac);}return _0x47dde3['status'](_0xfbd4ac)[_0x0b85('0x1c')]();};}function respondWithResult(_0x4749fa,_0x17170e){_0x17170e=_0x17170e||0xc8;return function(_0x2d590c){if(_0x2d590c){return _0x4749fa[_0x0b85('0x1d')](_0x17170e)[_0x0b85('0x1e')](_0x2d590c);}};}function respondWithFilteredResult(_0x9aae63,_0x289e5e){return function(_0x29cd57){if(_0x29cd57){var _0x2a19b5=typeof _0x289e5e[_0x0b85('0x1f')]===_0x0b85('0x20')&&typeof _0x289e5e[_0x0b85('0x21')]===_0x0b85('0x20');var _0x130a03=_0x29cd57[_0x0b85('0x22')];var _0x2fc83c=_0x2a19b5?0x0:_0x289e5e[_0x0b85('0x1f')];var _0x4a01ca=_0x2a19b5?_0x29cd57[_0x0b85('0x22')]:_0x289e5e['offset']+_0x289e5e['limit'];var _0x3352fc;if(_0x4a01ca>=_0x130a03){_0x4a01ca=_0x130a03;_0x3352fc=0xc8;}else{_0x3352fc=0xce;}_0x9aae63[_0x0b85('0x1d')](_0x3352fc);return _0x9aae63[_0x0b85('0x23')](_0x0b85('0x24'),_0x2fc83c+'-'+_0x4a01ca+'/'+_0x130a03)[_0x0b85('0x1e')](_0x29cd57);}return null;};}function patchUpdates(_0x41013f){return function(_0x4d553b){try{jsonpatch[_0x0b85('0x25')](_0x4d553b,_0x41013f,!![]);}catch(_0x25e486){return BPromise[_0x0b85('0x26')](_0x25e486);}return _0x4d553b[_0x0b85('0x27')]();};}function saveUpdates(_0x2668a6,_0x11b89b){return function(_0x43888d){if(_0x43888d){return _0x43888d[_0x0b85('0x28')](_0x2668a6)['then'](function(_0x3dd09a){return _0x3dd09a;});}return null;};}function removeEntity(_0x37b6df,_0xe2f6){return function(_0x4a4c25){if(_0x4a4c25){return _0x4a4c25['destroy']()[_0x0b85('0x29')](function(){_0x37b6df[_0x0b85('0x1d')](0xcc)[_0x0b85('0x1c')]();});}};}function handleEntityNotFound(_0x43b53d,_0xc5a1d9){return function(_0x23c28b){if(!_0x23c28b){_0x43b53d[_0x0b85('0x2a')](0x194);}return _0x23c28b;};}function handleError(_0x456f54,_0x21a4b9){_0x21a4b9=_0x21a4b9||0x1f4;return function(_0x35f0e7){logger[_0x0b85('0x2b')](_0x35f0e7[_0x0b85('0x2c')]);if(_0x35f0e7[_0x0b85('0x2d')]){delete _0x35f0e7['name'];}_0x456f54[_0x0b85('0x1d')](_0x21a4b9)['send'](_0x35f0e7);};}exports['index']=function(_0x4da0ab,_0x23579b){var _0xc956a2={},_0x2f4f81={},_0x1e5c62={'count':0x0,'rows':[]};var _0x2a251e=_[_0x0b85('0x2e')](db[_0x0b85('0x2f')][_0x0b85('0x30')],function(_0x1497e8){return{'name':_0x1497e8[_0x0b85('0x31')],'type':_0x1497e8[_0x0b85('0x32')][_0x0b85('0x33')]};});_0x2f4f81[_0x0b85('0x34')]=_[_0x0b85('0x2e')](_0x2a251e,_0x0b85('0x2d'));_0x2f4f81[_0x0b85('0x35')]=_['keys'](_0x4da0ab['query']);_0x2f4f81['filters']=_[_0x0b85('0x36')](_0x2f4f81[_0x0b85('0x34')],_0x2f4f81['query']);_0xc956a2[_0x0b85('0x37')]=_[_0x0b85('0x36')](_0x2f4f81['model'],qs[_0x0b85('0x38')](_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x38')]));_0xc956a2['attributes']=_0xc956a2[_0x0b85('0x37')][_0x0b85('0x39')]?_0xc956a2['attributes']:_0x2f4f81[_0x0b85('0x34')];if(!_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x3a')](_0x0b85('0x3b'))){_0xc956a2[_0x0b85('0x21')]=qs[_0x0b85('0x21')](_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x21')]);_0xc956a2[_0x0b85('0x1f')]=qs[_0x0b85('0x1f')](_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x1f')]);}_0xc956a2[_0x0b85('0x3c')]=qs['sort'](_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x3d')]);_0xc956a2[_0x0b85('0x3e')]=qs[_0x0b85('0x3f')](_[_0x0b85('0x40')](_0x4da0ab[_0x0b85('0x35')],_0x2f4f81[_0x0b85('0x3f')]),_0x2a251e);if(_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x41')]){_0xc956a2[_0x0b85('0x3e')]=_[_0x0b85('0x42')](_0xc956a2['where'],{'$or':_[_0x0b85('0x2e')](_0x2a251e,function(_0x4c9ea9){if(_0x4c9ea9[_0x0b85('0x32')]!=='VIRTUAL'){var _0x5bd71f={};_0x5bd71f[_0x4c9ea9[_0x0b85('0x2d')]]={'$like':'%'+_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x41')]+'%'};return _0x5bd71f;}})});}_0xc956a2=_[_0x0b85('0x42')]({},_0xc956a2,_0x4da0ab[_0x0b85('0x43')]);var _0x43f042={'where':_0xc956a2[_0x0b85('0x3e')]};return db[_0x0b85('0x2f')]['count'](_0x43f042)[_0x0b85('0x29')](function(_0x3f99d7){_0x1e5c62[_0x0b85('0x22')]=_0x3f99d7;if(_0x4da0ab[_0x0b85('0x35')][_0x0b85('0x44')]){_0xc956a2[_0x0b85('0x45')]=[{'all':!![]}];}return db[_0x0b85('0x2f')][_0x0b85('0x46')](_0xc956a2);})[_0x0b85('0x29')](function(_0x343b4d){_0x1e5c62[_0x0b85('0x47')]=_0x343b4d;return _0x1e5c62;})['then'](respondWithFilteredResult(_0x23579b,_0xc956a2))[_0x0b85('0x48')](handleError(_0x23579b,null));};exports[_0x0b85('0x49')]=function(_0x50dedb,_0x3ead3f){var _0x4555ab={'raw':!![],'where':{'id':_0x50dedb['params']['id']}},_0x59b564={};_0x59b564[_0x0b85('0x34')]=_[_0x0b85('0x4a')](db[_0x0b85('0x2f')][_0x0b85('0x30')]);_0x59b564[_0x0b85('0x35')]=_['keys'](_0x50dedb[_0x0b85('0x35')]);_0x59b564[_0x0b85('0x3f')]=_[_0x0b85('0x36')](_0x59b564['model'],_0x59b564['query']);_0x4555ab[_0x0b85('0x37')]=_['intersection'](_0x59b564[_0x0b85('0x34')],qs[_0x0b85('0x38')](_0x50dedb[_0x0b85('0x35')]['fields']));_0x4555ab[_0x0b85('0x37')]=_0x4555ab[_0x0b85('0x37')][_0x0b85('0x39')]?_0x4555ab['attributes']:_0x59b564['model'];if(_0x50dedb[_0x0b85('0x35')]['includeAll']){_0x4555ab['include']=[{'all':!![]}];}_0x4555ab=_[_0x0b85('0x42')]({},_0x4555ab,_0x50dedb[_0x0b85('0x43')]);return db['MailSubstatus']['find'](_0x4555ab)[_0x0b85('0x29')](handleEntityNotFound(_0x3ead3f,null))[_0x0b85('0x29')](respondWithResult(_0x3ead3f,null))['catch'](handleError(_0x3ead3f,null));};exports[_0x0b85('0x4b')]=function(_0x52d2e1,_0xcec6eb){return db[_0x0b85('0x2f')][_0x0b85('0x4b')](_0x52d2e1[_0x0b85('0x4c')],{})[_0x0b85('0x29')](respondWithResult(_0xcec6eb,0xc9))[_0x0b85('0x48')](handleError(_0xcec6eb,null));};exports[_0x0b85('0x28')]=function(_0xd9ad0d,_0x59f383){if(_0xd9ad0d[_0x0b85('0x4c')]['id']){delete _0xd9ad0d['body']['id'];}return db['MailSubstatus'][_0x0b85('0x4d')]({'where':{'id':_0xd9ad0d['params']['id']}})[_0x0b85('0x29')](handleEntityNotFound(_0x59f383,null))[_0x0b85('0x29')](saveUpdates(_0xd9ad0d[_0x0b85('0x4c')],null))['then'](respondWithResult(_0x59f383,null))[_0x0b85('0x48')](handleError(_0x59f383,null));};exports[_0x0b85('0x4e')]=function(_0x4e9fa6,_0x665818){return db[_0x0b85('0x2f')][_0x0b85('0x4d')]({'where':{'id':_0x4e9fa6['params']['id']}})[_0x0b85('0x29')](handleEntityNotFound(_0x665818,null))[_0x0b85('0x29')](removeEntity(_0x665818,null))['catch'](handleError(_0x665818,null));};exports[_0x0b85('0x4f')]=function(_0x5847da,_0x19c9db){return db[_0x0b85('0x2f')]['describe']()['then'](respondWithResult(_0x19c9db,null))[_0x0b85('0x48')](handleError(_0x19c9db,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0ca4830..a13dfc1 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 _0x30da=['exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','hook'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x30da,0x189));var _0xa30d=function(_0x4ff96e,_0x52d777){_0x4ff96e=_0x4ff96e-0x0;var _0xafdd85=_0x30da[_0x4ff96e];return _0xafdd85;};'use strict';var EventEmitter=require(_0xa30d('0x0'));var MailSubstatus=require(_0xa30d('0x1'))['db'][_0xa30d('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa30d('0x3')](0x0);var events={'afterUpdate':_0xa30d('0x4')};function emitEvent(_0x342e83){return function(_0x7be19a,_0x5d19ef,_0x580c73){MailSubstatusEvents['emit'](_0x342e83+':'+_0x7be19a['id'],_0x7be19a);MailSubstatusEvents['emit'](_0x342e83,_0x7be19a);_0x580c73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xa30d('0x5')](e,emitEvent(event));}}module[_0xa30d('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x2430=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hook'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x2430,0x17a));var _0x0243=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x2430[_0x56b138];return _0x3df878;};'use strict';var EventEmitter=require(_0x0243('0x0'));var MailSubstatus=require(_0x0243('0x1'))['db'][_0x0243('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0243('0x3')](0x0);var events={'afterUpdate':_0x0243('0x4')};function emitEvent(_0x5184b7){return function(_0x56b085,_0x44bea5,_0x32bb55){MailSubstatusEvents['emit'](_0x5184b7+':'+_0x56b085['id'],_0x56b085);MailSubstatusEvents[_0x0243('0x5')](_0x5184b7,_0x56b085);_0x32bb55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x0243('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 7602a32..d655a02 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 _0x8297=['mail_substatuses','update','_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','define','MailSubstatus'];(function(_0x30ef8f,_0x5047fe){var _0x281e11=function(_0x5b7b53){while(--_0x5b7b53){_0x30ef8f['push'](_0x30ef8f['shift']());}};_0x281e11(++_0x5047fe);}(_0x8297,0x18c));var _0x7829=function(_0x28397f,_0x400d46){_0x28397f=_0x28397f-0x0;var _0x580405=_0x8297[_0x28397f];return _0x580405;};'use strict';var attributes=require(_0x7829('0x0'));module[_0x7829('0x1')]=function(_0x2eec4a){var _0x2e043d=_0x2eec4a['models'];return _0x2eec4a[_0x7829('0x2')](_0x7829('0x3'),attributes,{'tableName':_0x7829('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xdb2f23,_0x43cab6,_0x2c33b3){return _0x2e043d['Condition'][_0x7829('0x5')]({'value':_0xdb2f23['name']},{'where':{'field':'mailSubstatus','value':_0xdb2f23[_0x7829('0x6')][_0x7829('0x7')]}})[_0x7829('0x8')](function(){_0x2c33b3();})[_0x7829('0x9')](function(_0x265de7){_0x2c33b3(_0x265de7);});}}});}; \ No newline at end of file +var _0x95f1=['update','name','then','./mailSubstatus.attributes','exports','models','define','MailSubstatus','Condition'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x95f1,0x1b3));var _0x195f=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x95f1[_0x710815];return _0x5b3b89;};'use strict';var attributes=require(_0x195f('0x0'));module[_0x195f('0x1')]=function(_0x34109c){var _0x28844a=_0x34109c[_0x195f('0x2')];return _0x34109c[_0x195f('0x3')](_0x195f('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4906a2,_0x1f8fbe,_0x3bf15a){return _0x28844a[_0x195f('0x5')][_0x195f('0x6')]({'value':_0x4906a2[_0x195f('0x7')]},{'where':{'field':'mailSubstatus','value':_0x4906a2['_previousDataValues'][_0x195f('0x7')]}})[_0x195f('0x8')](function(){_0x3bf15a();})['catch'](function(_0x19a532){_0x3bf15a(_0x19a532);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6364fa4..4e4986f 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 _0xc80f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5d3206,_0x5c5f5e){var _0x68c141=function(_0x48c9e4){while(--_0x48c9e4){_0x5d3206['push'](_0x5d3206['shift']());}};_0x68c141(++_0x5c5f5e);}(_0xc80f,0x7e));var _0xfc80=function(_0x1a4240,_0x185b66){_0x1a4240=_0x1a4240-0x0;var _0x33d677=_0xc80f[_0x1a4240];return _0x33d677;};'use strict';var _=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var moment=require(_0xfc80('0x2'));var BPromise=require(_0xfc80('0x3'));var rs=require(_0xfc80('0x4'));var fs=require('fs');var Redis=require(_0xfc80('0x5'));var db=require(_0xfc80('0x6'))['db'];var utils=require(_0xfc80('0x7'));var logger=require(_0xfc80('0x8'))(_0xfc80('0x9'));var config=require(_0xfc80('0xa'));var jayson=require(_0xfc80('0xb'));var client=jayson['client'][_0xfc80('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58022e,_0x385ebb,_0x394e73){return new BPromise(function(_0x78a674,_0x1e1197){return client[_0xfc80('0xd')](_0x58022e,_0x394e73)['then'](function(_0x598584){logger[_0xfc80('0xe')](_0xfc80('0xf'),_0x385ebb,'request\x20sent');logger[_0xfc80('0x10')](_0xfc80('0x11'),_0x385ebb,_0xfc80('0x12'),JSON[_0xfc80('0x13')](_0x598584));if(_0x598584[_0xfc80('0x14')]){if(_0x598584[_0xfc80('0x14')][_0xfc80('0x15')]===0x1f4){logger[_0xfc80('0x14')](_0xfc80('0xf'),_0x385ebb,_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);return _0x1e1197(_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);}logger[_0xfc80('0x14')](_0xfc80('0xf'),_0x385ebb,_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);return _0x78a674(_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);}else{logger[_0xfc80('0xe')](_0xfc80('0xf'),_0x385ebb,_0xfc80('0x12'));_0x78a674(_0x598584[_0xfc80('0x17')][_0xfc80('0x16')]);}})[_0xfc80('0x18')](function(_0x2d84a6){logger[_0xfc80('0x14')](_0xfc80('0xf'),_0x385ebb,_0x2d84a6);_0x1e1197(_0x2d84a6);});});} \ No newline at end of file +var _0x7596=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3682af,_0x4d7012){var _0x3fbe49=function(_0x5d558f){while(--_0x5d558f){_0x3682af['push'](_0x3682af['shift']());}};_0x3fbe49(++_0x4d7012);}(_0x7596,0xa2));var _0x6759=function(_0x1be584,_0xcb595){_0x1be584=_0x1be584-0x0;var _0x5c60d2=_0x7596[_0x1be584];return _0x5c60d2;};'use strict';var _=require(_0x6759('0x0'));var util=require(_0x6759('0x1'));var moment=require(_0x6759('0x2'));var BPromise=require(_0x6759('0x3'));var rs=require(_0x6759('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6759('0x5'));var logger=require(_0x6759('0x6'))(_0x6759('0x7'));var config=require(_0x6759('0x8'));var jayson=require(_0x6759('0x9'));var client=jayson[_0x6759('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b51f4,_0x1f48d7,_0x5780ee){return new BPromise(function(_0x1d7e85,_0x4a789c){return client[_0x6759('0xb')](_0x4b51f4,_0x5780ee)[_0x6759('0xc')](function(_0x248531){logger[_0x6759('0xd')](_0x6759('0xe'),_0x1f48d7,'request\x20sent');logger[_0x6759('0xf')](_0x6759('0x10'),_0x1f48d7,_0x6759('0x11'),JSON[_0x6759('0x12')](_0x248531));if(_0x248531[_0x6759('0x13')]){if(_0x248531[_0x6759('0x13')][_0x6759('0x14')]===0x1f4){logger[_0x6759('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x1f48d7,_0x248531[_0x6759('0x13')][_0x6759('0x15')]);return _0x4a789c(_0x248531[_0x6759('0x13')][_0x6759('0x15')]);}logger[_0x6759('0x13')](_0x6759('0xe'),_0x1f48d7,_0x248531[_0x6759('0x13')][_0x6759('0x15')]);return _0x1d7e85(_0x248531[_0x6759('0x13')][_0x6759('0x15')]);}else{logger[_0x6759('0xd')](_0x6759('0xe'),_0x1f48d7,_0x6759('0x11'));_0x1d7e85(_0x248531['result'][_0x6759('0x15')]);}})[_0x6759('0x16')](function(_0xc5e7db){logger[_0x6759('0x13')](_0x6759('0xe'),_0x1f48d7,_0xc5e7db);_0x4a789c(_0xc5e7db);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index cf3414a..5f8077c 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 _0x64d8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','/describe','describe','get','/:id','isAuthenticated','show','post'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x64d8,0xde));var _0x864d=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0x64d8[_0x32cf96];return _0x125cc1;};'use strict';var multer=require(_0x864d('0x0'));var util=require(_0x864d('0x1'));var path=require(_0x864d('0x2'));var timeout=require(_0x864d('0x3'));var express=require(_0x864d('0x4'));var router=express['Router']();var fs_extra=require(_0x864d('0x5'));var auth=require(_0x864d('0x6'));var interaction=require(_0x864d('0x7'));var config=require(_0x864d('0x8'));var controller=require(_0x864d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x864d('0xa')]);router['get'](_0x864d('0xb'),auth['isAuthenticated'](),controller[_0x864d('0xc')]);router[_0x864d('0xd')](_0x864d('0xe'),auth[_0x864d('0xf')](),controller[_0x864d('0x10')]);router[_0x864d('0x11')]('/',auth[_0x864d('0xf')](),controller[_0x864d('0x12')]);router[_0x864d('0x13')](_0x864d('0xe'),auth[_0x864d('0xf')](),controller[_0x864d('0x14')]);router[_0x864d('0x15')](_0x864d('0xe'),auth[_0x864d('0xf')](),controller[_0x864d('0x16')]);module[_0x864d('0x17')]=router; \ No newline at end of file +var _0x0c26=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x0c26,0x64));var _0x60c2=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x0c26[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x60c2('0x0'));var util=require(_0x60c2('0x1'));var path=require(_0x60c2('0x2'));var timeout=require(_0x60c2('0x3'));var express=require(_0x60c2('0x4'));var router=express[_0x60c2('0x5')]();var fs_extra=require(_0x60c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x60c2('0x7'));var config=require(_0x60c2('0x8'));var controller=require(_0x60c2('0x9'));router[_0x60c2('0xa')]('/',auth[_0x60c2('0xb')](),controller[_0x60c2('0xc')]);router['get']('/describe',auth[_0x60c2('0xb')](),controller[_0x60c2('0xd')]);router[_0x60c2('0xa')](_0x60c2('0xe'),auth['isAuthenticated'](),controller[_0x60c2('0xf')]);router['post']('/',auth[_0x60c2('0xb')](),controller[_0x60c2('0x10')]);router[_0x60c2('0x11')](_0x60c2('0xe'),auth[_0x60c2('0xb')](),controller[_0x60c2('0x12')]);router[_0x60c2('0x13')](_0x60c2('0xe'),auth[_0x60c2('0xb')](),controller[_0x60c2('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 90c847b..3e75eb6 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(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x9bde,0xe1));var _0xe9bd=function(_0xb5faed,_0x48465c){_0xb5faed=_0xb5faed-0x0;var _0x4875f4=_0x9bde[_0xb5faed];return _0x4875f4;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12df67,_0x1fd19f){_0x12df67=_0x12df67-0x0;var _0x40cd6a=_0xb43b[_0x12df67];return _0x40cd6a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6a72614..53c3240 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 _0xdb96=['fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','map','MailTransferReport','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x404af3,_0x25df6c){var _0x5e9d02=function(_0x125e24){while(--_0x125e24){_0x404af3['push'](_0x404af3['shift']());}};_0x5e9d02(++_0x25df6c);}(_0xdb96,0xd5));var _0x6db9=function(_0x3038b0,_0xb6aa6d){_0x3038b0=_0x3038b0-0x0;var _0x36ddb3=_0xdb96[_0x3038b0];return _0x36ddb3;};'use strict';var emlformat=require(_0x6db9('0x0'));var rimraf=require(_0x6db9('0x1'));var zipdir=require(_0x6db9('0x2'));var jsonpatch=require(_0x6db9('0x3'));var rp=require(_0x6db9('0x4'));var moment=require('moment');var BPromise=require(_0x6db9('0x5'));var Mustache=require(_0x6db9('0x6'));var util=require(_0x6db9('0x7'));var path=require(_0x6db9('0x8'));var sox=require(_0x6db9('0x9'));var csv=require(_0x6db9('0xa'));var ejs=require(_0x6db9('0xb'));var fs=require('fs');var fs_extra=require(_0x6db9('0xc'));var _=require(_0x6db9('0xd'));var squel=require(_0x6db9('0xe'));var crypto=require('crypto');var jsforce=require(_0x6db9('0xf'));var deskjs=require(_0x6db9('0x10'));var toCsv=require(_0x6db9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6db9('0x11'));var authService=require(_0x6db9('0x12'));var qs=require(_0x6db9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6db9('0x14'));var logger=require(_0x6db9('0x15'))(_0x6db9('0x16'));var utils=require(_0x6db9('0x17'));var config=require(_0x6db9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6db9('0x19'))['db'];function respondWithStatusCode(_0x439b2a,_0x4c3ae5){_0x4c3ae5=_0x4c3ae5||0xcc;return function(_0x3b7773){if(_0x3b7773){return _0x439b2a[_0x6db9('0x1a')](_0x4c3ae5);}return _0x439b2a[_0x6db9('0x1b')](_0x4c3ae5)[_0x6db9('0x1c')]();};}function respondWithResult(_0x305f91,_0x5f1df7){_0x5f1df7=_0x5f1df7||0xc8;return function(_0x56c654){if(_0x56c654){return _0x305f91[_0x6db9('0x1b')](_0x5f1df7)['json'](_0x56c654);}};}function respondWithFilteredResult(_0xa142a7,_0x401694){return function(_0x5f47c5){if(_0x5f47c5){var _0x5f325=typeof _0x401694[_0x6db9('0x1d')]==='undefined'&&typeof _0x401694[_0x6db9('0x1e')]===_0x6db9('0x1f');var _0x3adee1=_0x5f47c5[_0x6db9('0x20')];var _0x5028ff=_0x5f325?0x0:_0x401694[_0x6db9('0x1d')];var _0x36c519=_0x5f325?_0x5f47c5['count']:_0x401694[_0x6db9('0x1d')]+_0x401694[_0x6db9('0x1e')];var _0x3a805e;if(_0x36c519>=_0x3adee1){_0x36c519=_0x3adee1;_0x3a805e=0xc8;}else{_0x3a805e=0xce;}_0xa142a7[_0x6db9('0x1b')](_0x3a805e);return _0xa142a7[_0x6db9('0x21')](_0x6db9('0x22'),_0x5028ff+'-'+_0x36c519+'/'+_0x3adee1)[_0x6db9('0x23')](_0x5f47c5);}return null;};}function patchUpdates(_0x4a40f0){return function(_0x5c48d4){try{jsonpatch[_0x6db9('0x24')](_0x5c48d4,_0x4a40f0,!![]);}catch(_0x4f9c90){return BPromise['reject'](_0x4f9c90);}return _0x5c48d4[_0x6db9('0x25')]();};}function saveUpdates(_0x1daa55,_0x38264d){return function(_0xba7c98){if(_0xba7c98){return _0xba7c98[_0x6db9('0x26')](_0x1daa55)[_0x6db9('0x27')](function(_0x505121){return _0x505121;});}return null;};}function removeEntity(_0x147e7b,_0x2ecb80){return function(_0x11e9f8){if(_0x11e9f8){return _0x11e9f8[_0x6db9('0x28')]()[_0x6db9('0x27')](function(){_0x147e7b[_0x6db9('0x1b')](0xcc)[_0x6db9('0x1c')]();});}};}function handleEntityNotFound(_0x10cf77,_0x3d65b3){return function(_0x359020){if(!_0x359020){_0x10cf77['sendStatus'](0x194);}return _0x359020;};}function handleError(_0x48ddac,_0x4b061e){_0x4b061e=_0x4b061e||0x1f4;return function(_0x25dd0b){logger[_0x6db9('0x29')](_0x25dd0b['stack']);if(_0x25dd0b[_0x6db9('0x2a')]){delete _0x25dd0b['name'];}_0x48ddac[_0x6db9('0x1b')](_0x4b061e)['send'](_0x25dd0b);};}exports['index']=function(_0x3959c2,_0x566c28){var _0x8e512f={},_0x1e6a35={},_0x72c8de={'count':0x0,'rows':[]};var _0x49fcc5=_[_0x6db9('0x2b')](db[_0x6db9('0x2c')]['rawAttributes'],function(_0x60dc6){return{'name':_0x60dc6[_0x6db9('0x2d')],'type':_0x60dc6[_0x6db9('0x2e')]['key']};});_0x1e6a35[_0x6db9('0x2f')]=_[_0x6db9('0x2b')](_0x49fcc5,_0x6db9('0x2a'));_0x1e6a35['query']=_[_0x6db9('0x30')](_0x3959c2[_0x6db9('0x31')]);_0x1e6a35[_0x6db9('0x32')]=_['intersection'](_0x1e6a35['model'],_0x1e6a35['query']);_0x8e512f[_0x6db9('0x33')]=_[_0x6db9('0x34')](_0x1e6a35['model'],qs[_0x6db9('0x35')](_0x3959c2[_0x6db9('0x31')]['fields']));_0x8e512f['attributes']=_0x8e512f[_0x6db9('0x33')]['length']?_0x8e512f[_0x6db9('0x33')]:_0x1e6a35[_0x6db9('0x2f')];if(!_0x3959c2[_0x6db9('0x31')][_0x6db9('0x36')](_0x6db9('0x37'))){_0x8e512f[_0x6db9('0x1e')]=qs['limit'](_0x3959c2[_0x6db9('0x31')][_0x6db9('0x1e')]);_0x8e512f['offset']=qs[_0x6db9('0x1d')](_0x3959c2[_0x6db9('0x31')]['offset']);}_0x8e512f[_0x6db9('0x38')]=qs['sort'](_0x3959c2['query'][_0x6db9('0x39')]);_0x8e512f[_0x6db9('0x3a')]=qs[_0x6db9('0x32')](_['pick'](_0x3959c2['query'],_0x1e6a35[_0x6db9('0x32')]),_0x49fcc5);if(_0x3959c2[_0x6db9('0x31')]['filter']){_0x8e512f['where']=_[_0x6db9('0x3b')](_0x8e512f['where'],{'$or':_[_0x6db9('0x2b')](_0x49fcc5,function(_0x226fbf){if(_0x226fbf['type']!==_0x6db9('0x3c')){var _0x65a9c3={};_0x65a9c3[_0x226fbf[_0x6db9('0x2a')]]={'$like':'%'+_0x3959c2[_0x6db9('0x31')]['filter']+'%'};return _0x65a9c3;}})});}_0x8e512f=_['merge']({},_0x8e512f,_0x3959c2[_0x6db9('0x3d')]);var _0x52b1b8={'where':_0x8e512f[_0x6db9('0x3a')]};return db[_0x6db9('0x2c')]['count'](_0x52b1b8)[_0x6db9('0x27')](function(_0x652b8e){_0x72c8de['count']=_0x652b8e;if(_0x3959c2[_0x6db9('0x31')]['includeAll']){_0x8e512f[_0x6db9('0x3e')]=[{'all':!![]}];}return db[_0x6db9('0x2c')][_0x6db9('0x3f')](_0x8e512f);})[_0x6db9('0x27')](function(_0x107f53){_0x72c8de[_0x6db9('0x40')]=_0x107f53;return _0x72c8de;})[_0x6db9('0x27')](respondWithFilteredResult(_0x566c28,_0x8e512f))[_0x6db9('0x41')](handleError(_0x566c28,null));};exports[_0x6db9('0x42')]=function(_0x258851,_0x50d7f3){var _0x530dc5={'raw':!![],'where':{'id':_0x258851[_0x6db9('0x43')]['id']}},_0x5c9c7e={};_0x5c9c7e['model']=_[_0x6db9('0x30')](db[_0x6db9('0x2c')][_0x6db9('0x44')]);_0x5c9c7e[_0x6db9('0x31')]=_[_0x6db9('0x30')](_0x258851['query']);_0x5c9c7e[_0x6db9('0x32')]=_[_0x6db9('0x34')](_0x5c9c7e[_0x6db9('0x2f')],_0x5c9c7e[_0x6db9('0x31')]);_0x530dc5['attributes']=_[_0x6db9('0x34')](_0x5c9c7e[_0x6db9('0x2f')],qs[_0x6db9('0x35')](_0x258851[_0x6db9('0x31')][_0x6db9('0x35')]));_0x530dc5[_0x6db9('0x33')]=_0x530dc5['attributes'][_0x6db9('0x45')]?_0x530dc5['attributes']:_0x5c9c7e[_0x6db9('0x2f')];if(_0x258851[_0x6db9('0x31')][_0x6db9('0x46')]){_0x530dc5[_0x6db9('0x3e')]=[{'all':!![]}];}_0x530dc5=_[_0x6db9('0x3b')]({},_0x530dc5,_0x258851[_0x6db9('0x3d')]);return db[_0x6db9('0x2c')][_0x6db9('0x47')](_0x530dc5)[_0x6db9('0x27')](handleEntityNotFound(_0x50d7f3,null))[_0x6db9('0x27')](respondWithResult(_0x50d7f3,null))['catch'](handleError(_0x50d7f3,null));};exports[_0x6db9('0x48')]=function(_0x12be43,_0x10af40){return db['MailTransferReport'][_0x6db9('0x48')](_0x12be43[_0x6db9('0x49')],{})[_0x6db9('0x27')](respondWithResult(_0x10af40,0xc9))['catch'](handleError(_0x10af40,null));};exports[_0x6db9('0x26')]=function(_0x59cfc6,_0x3b1905){if(_0x59cfc6['body']['id']){delete _0x59cfc6['body']['id'];}return db['MailTransferReport'][_0x6db9('0x47')]({'where':{'id':_0x59cfc6[_0x6db9('0x43')]['id']}})[_0x6db9('0x27')](handleEntityNotFound(_0x3b1905,null))['then'](saveUpdates(_0x59cfc6['body'],null))[_0x6db9('0x27')](respondWithResult(_0x3b1905,null))[_0x6db9('0x41')](handleError(_0x3b1905,null));};exports[_0x6db9('0x28')]=function(_0x499208,_0x5ed847){return db[_0x6db9('0x2c')][_0x6db9('0x47')]({'where':{'id':_0x499208[_0x6db9('0x43')]['id']}})[_0x6db9('0x27')](handleEntityNotFound(_0x5ed847,null))['then'](removeEntity(_0x5ed847,null))['catch'](handleError(_0x5ed847,null));};exports['describe']=function(_0x274529,_0x41384d){return db[_0x6db9('0x2c')][_0x6db9('0x4a')]()[_0x6db9('0x27')](respondWithResult(_0x41384d,null))['catch'](handleError(_0x41384d,null));}; \ No newline at end of file +var _0x167f=['filter','merge','VIRTUAL','include','MailTransferReport','findAll','rows','catch','show','params','includeAll','options','find','create','body','update','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','status','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','sort','where','pick'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x167f,0x1ec));var _0xf167=function(_0x586c70,_0x4a8cb3){_0x586c70=_0x586c70-0x0;var _0x26db79=_0x167f[_0x586c70];return _0x26db79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf167('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf167('0x1'));var rp=require(_0xf167('0x2'));var moment=require(_0xf167('0x3'));var BPromise=require(_0xf167('0x4'));var Mustache=require(_0xf167('0x5'));var util=require(_0xf167('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf167('0x7'));var ejs=require(_0xf167('0x8'));var fs=require('fs');var fs_extra=require(_0xf167('0x9'));var _=require(_0xf167('0xa'));var squel=require(_0xf167('0xb'));var crypto=require(_0xf167('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf167('0xd'));var toCsv=require(_0xf167('0x7'));var querystring=require(_0xf167('0xe'));var Papa=require(_0xf167('0xf'));var Redis=require(_0xf167('0x10'));var authService=require(_0xf167('0x11'));var qs=require(_0xf167('0x12'));var as=require(_0xf167('0x13'));var hardwareService=require(_0xf167('0x14'));var logger=require(_0xf167('0x15'))(_0xf167('0x16'));var utils=require(_0xf167('0x17'));var config=require(_0xf167('0x18'));var licenseUtil=require(_0xf167('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa4b02c,_0x4ec570){_0x4ec570=_0x4ec570||0xcc;return function(_0x8aa697){if(_0x8aa697){return _0xa4b02c[_0xf167('0x1a')](_0x4ec570);}return _0xa4b02c['status'](_0x4ec570)[_0xf167('0x1b')]();};}function respondWithResult(_0x2b6e0b,_0x40ad6c){_0x40ad6c=_0x40ad6c||0xc8;return function(_0x44b464){if(_0x44b464){return _0x2b6e0b['status'](_0x40ad6c)[_0xf167('0x1c')](_0x44b464);}};}function respondWithFilteredResult(_0x64e95e,_0x3c8eea){return function(_0xf67b5){if(_0xf67b5){var _0x11bcea=typeof _0x3c8eea[_0xf167('0x1d')]===_0xf167('0x1e')&&typeof _0x3c8eea[_0xf167('0x1f')]==='undefined';var _0x1d8c7e=_0xf67b5[_0xf167('0x20')];var _0x199e2c=_0x11bcea?0x0:_0x3c8eea[_0xf167('0x1d')];var _0x4a62e6=_0x11bcea?_0xf67b5[_0xf167('0x20')]:_0x3c8eea[_0xf167('0x1d')]+_0x3c8eea['limit'];var _0x1e1c96;if(_0x4a62e6>=_0x1d8c7e){_0x4a62e6=_0x1d8c7e;_0x1e1c96=0xc8;}else{_0x1e1c96=0xce;}_0x64e95e['status'](_0x1e1c96);return _0x64e95e[_0xf167('0x21')](_0xf167('0x22'),_0x199e2c+'-'+_0x4a62e6+'/'+_0x1d8c7e)[_0xf167('0x1c')](_0xf67b5);}return null;};}function patchUpdates(_0x18a5bb){return function(_0x4511c2){try{jsonpatch[_0xf167('0x23')](_0x4511c2,_0x18a5bb,!![]);}catch(_0x39c17f){return BPromise[_0xf167('0x24')](_0x39c17f);}return _0x4511c2[_0xf167('0x25')]();};}function saveUpdates(_0x5b5f8c,_0x13508c){return function(_0x51a0c6){if(_0x51a0c6){return _0x51a0c6['update'](_0x5b5f8c)[_0xf167('0x26')](function(_0x51663b){return _0x51663b;});}return null;};}function removeEntity(_0x4ecbc3,_0x44029b){return function(_0x16133e){if(_0x16133e){return _0x16133e['destroy']()[_0xf167('0x26')](function(){_0x4ecbc3[_0xf167('0x27')](0xcc)[_0xf167('0x1b')]();});}};}function handleEntityNotFound(_0x2fc321,_0x55c97f){return function(_0x4c1b8d){if(!_0x4c1b8d){_0x2fc321[_0xf167('0x1a')](0x194);}return _0x4c1b8d;};}function handleError(_0x50a48a,_0x2dedf0){_0x2dedf0=_0x2dedf0||0x1f4;return function(_0x24eba5){logger[_0xf167('0x28')](_0x24eba5[_0xf167('0x29')]);if(_0x24eba5[_0xf167('0x2a')]){delete _0x24eba5['name'];}_0x50a48a[_0xf167('0x27')](_0x2dedf0)[_0xf167('0x2b')](_0x24eba5);};}exports[_0xf167('0x2c')]=function(_0x130f80,_0x581e02){var _0x56d633={},_0x10bbea={},_0x3f1410={'count':0x0,'rows':[]};var _0x46f1a1=_[_0xf167('0x2d')](db['MailTransferReport'][_0xf167('0x2e')],function(_0x1ae833){return{'name':_0x1ae833[_0xf167('0x2f')],'type':_0x1ae833[_0xf167('0x30')][_0xf167('0x31')]};});_0x10bbea['model']=_[_0xf167('0x2d')](_0x46f1a1,_0xf167('0x2a'));_0x10bbea[_0xf167('0x32')]=_[_0xf167('0x33')](_0x130f80[_0xf167('0x32')]);_0x10bbea[_0xf167('0x34')]=_[_0xf167('0x35')](_0x10bbea['model'],_0x10bbea[_0xf167('0x32')]);_0x56d633[_0xf167('0x36')]=_['intersection'](_0x10bbea[_0xf167('0x37')],qs[_0xf167('0x38')](_0x130f80[_0xf167('0x32')][_0xf167('0x38')]));_0x56d633[_0xf167('0x36')]=_0x56d633[_0xf167('0x36')][_0xf167('0x39')]?_0x56d633[_0xf167('0x36')]:_0x10bbea[_0xf167('0x37')];if(!_0x130f80[_0xf167('0x32')]['hasOwnProperty']('nolimit')){_0x56d633[_0xf167('0x1f')]=qs[_0xf167('0x1f')](_0x130f80['query'][_0xf167('0x1f')]);_0x56d633[_0xf167('0x1d')]=qs['offset'](_0x130f80[_0xf167('0x32')][_0xf167('0x1d')]);}_0x56d633['order']=qs[_0xf167('0x3a')](_0x130f80[_0xf167('0x32')][_0xf167('0x3a')]);_0x56d633[_0xf167('0x3b')]=qs[_0xf167('0x34')](_[_0xf167('0x3c')](_0x130f80['query'],_0x10bbea[_0xf167('0x34')]),_0x46f1a1);if(_0x130f80['query'][_0xf167('0x3d')]){_0x56d633['where']=_[_0xf167('0x3e')](_0x56d633[_0xf167('0x3b')],{'$or':_[_0xf167('0x2d')](_0x46f1a1,function(_0x345550){if(_0x345550[_0xf167('0x30')]!==_0xf167('0x3f')){var _0x4acb11={};_0x4acb11[_0x345550[_0xf167('0x2a')]]={'$like':'%'+_0x130f80[_0xf167('0x32')][_0xf167('0x3d')]+'%'};return _0x4acb11;}})});}_0x56d633=_[_0xf167('0x3e')]({},_0x56d633,_0x130f80['options']);var _0x4719b5={'where':_0x56d633[_0xf167('0x3b')]};return db['MailTransferReport'][_0xf167('0x20')](_0x4719b5)[_0xf167('0x26')](function(_0x460863){_0x3f1410[_0xf167('0x20')]=_0x460863;if(_0x130f80[_0xf167('0x32')]['includeAll']){_0x56d633[_0xf167('0x40')]=[{'all':!![]}];}return db[_0xf167('0x41')][_0xf167('0x42')](_0x56d633);})['then'](function(_0x57b021){_0x3f1410[_0xf167('0x43')]=_0x57b021;return _0x3f1410;})[_0xf167('0x26')](respondWithFilteredResult(_0x581e02,_0x56d633))[_0xf167('0x44')](handleError(_0x581e02,null));};exports[_0xf167('0x45')]=function(_0xd6bb46,_0x2b3315){var _0x554e85={'raw':!![],'where':{'id':_0xd6bb46[_0xf167('0x46')]['id']}},_0x464c62={};_0x464c62[_0xf167('0x37')]=_['keys'](db[_0xf167('0x41')][_0xf167('0x2e')]);_0x464c62['query']=_['keys'](_0xd6bb46['query']);_0x464c62[_0xf167('0x34')]=_[_0xf167('0x35')](_0x464c62[_0xf167('0x37')],_0x464c62[_0xf167('0x32')]);_0x554e85[_0xf167('0x36')]=_['intersection'](_0x464c62[_0xf167('0x37')],qs[_0xf167('0x38')](_0xd6bb46[_0xf167('0x32')]['fields']));_0x554e85['attributes']=_0x554e85[_0xf167('0x36')]['length']?_0x554e85[_0xf167('0x36')]:_0x464c62['model'];if(_0xd6bb46[_0xf167('0x32')][_0xf167('0x47')]){_0x554e85[_0xf167('0x40')]=[{'all':!![]}];}_0x554e85=_[_0xf167('0x3e')]({},_0x554e85,_0xd6bb46[_0xf167('0x48')]);return db['MailTransferReport'][_0xf167('0x49')](_0x554e85)[_0xf167('0x26')](handleEntityNotFound(_0x2b3315,null))['then'](respondWithResult(_0x2b3315,null))[_0xf167('0x44')](handleError(_0x2b3315,null));};exports[_0xf167('0x4a')]=function(_0x36f2af,_0x95de1f){return db[_0xf167('0x41')][_0xf167('0x4a')](_0x36f2af[_0xf167('0x4b')],{})[_0xf167('0x26')](respondWithResult(_0x95de1f,0xc9))[_0xf167('0x44')](handleError(_0x95de1f,null));};exports[_0xf167('0x4c')]=function(_0x391723,_0x160df1){if(_0x391723[_0xf167('0x4b')]['id']){delete _0x391723['body']['id'];}return db[_0xf167('0x41')][_0xf167('0x49')]({'where':{'id':_0x391723['params']['id']}})[_0xf167('0x26')](handleEntityNotFound(_0x160df1,null))[_0xf167('0x26')](saveUpdates(_0x391723[_0xf167('0x4b')],null))['then'](respondWithResult(_0x160df1,null))['catch'](handleError(_0x160df1,null));};exports[_0xf167('0x4d')]=function(_0x39b7d2,_0x2ab94a){return db[_0xf167('0x41')][_0xf167('0x49')]({'where':{'id':_0x39b7d2[_0xf167('0x46')]['id']}})[_0xf167('0x26')](handleEntityNotFound(_0x2ab94a,null))['then'](removeEntity(_0x2ab94a,null))[_0xf167('0x44')](handleError(_0x2ab94a,null));};exports['describe']=function(_0x68cd3b,_0x1e1f5c){return db[_0xf167('0x41')][_0xf167('0x4e')]()[_0xf167('0x26')](respondWithResult(_0x1e1f5c,null))['catch'](handleError(_0x1e1f5c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c6d3701..999290e 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 _0x5c4d=['MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define'];(function(_0x3601a9,_0x377825){var _0x6b15ab=function(_0x184d3b){while(--_0x184d3b){_0x3601a9['push'](_0x3601a9['shift']());}};_0x6b15ab(++_0x377825);}(_0x5c4d,0x18f));var _0xd5c4=function(_0x4210d7,_0x1db32c){_0x4210d7=_0x4210d7-0x0;var _0x299785=_0x5c4d[_0x4210d7];return _0x299785;};'use strict';var _=require(_0xd5c4('0x0'));var util=require('util');var logger=require(_0xd5c4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5c4('0x2'));var fs=require('fs');var path=require(_0xd5c4('0x3'));var rimraf=require(_0xd5c4('0x4'));var config=require('../../config/environment');var attributes=require(_0xd5c4('0x5'));module[_0xd5c4('0x6')]=function(_0x204a6f,_0x422cd8){return _0x204a6f[_0xd5c4('0x7')](_0xd5c4('0x8'),attributes,{'tableName':_0xd5c4('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd5c4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f1=['util','../../config/logger','moment','request-promise','rimraf','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x23f4d2,_0x448ace){var _0x1e9e36=function(_0x1010a1){while(--_0x1010a1){_0x23f4d2['push'](_0x23f4d2['shift']());}};_0x1e9e36(++_0x448ace);}(_0xc1f1,0x122));var _0x1c1f=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xc1f1[_0x5a1a51];return _0x47edd7;};'use strict';var _=require('lodash');var util=require(_0x1c1f('0x0'));var logger=require(_0x1c1f('0x1'))('api');var moment=require(_0x1c1f('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c1f('0x4'));var config=require('../../config/environment');var attributes=require(_0x1c1f('0x5'));module['exports']=function(_0x1940d7,_0x2d91a5){return _0x1940d7[_0x1c1f('0x6')](_0x1c1f('0x7'),attributes,{'tableName':_0x1c1f('0x8'),'paranoid':![],'indexes':[{'name':_0x1c1f('0x9'),'fields':[_0x1c1f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index de67c46..90a751c 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 _0x971f=['http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x2f285e,_0x46a97c){var _0x2fc826=function(_0x20d469){while(--_0x20d469){_0x2f285e['push'](_0x2f285e['shift']());}};_0x2fc826(++_0x46a97c);}(_0x971f,0x1c3));var _0xf971=function(_0x788633,_0x3aeae5){_0x788633=_0x788633-0x0;var _0x816007=_0x971f[_0x788633];return _0x816007;};'use strict';var _=require(_0xf971('0x0'));var util=require('util');var moment=require(_0xf971('0x1'));var BPromise=require(_0xf971('0x2'));var rs=require(_0xf971('0x3'));var fs=require('fs');var Redis=require(_0xf971('0x4'));var db=require(_0xf971('0x5'))['db'];var utils=require(_0xf971('0x6'));var logger=require(_0xf971('0x7'))(_0xf971('0x8'));var config=require('../../config/environment');var jayson=require(_0xf971('0x9'));var client=jayson[_0xf971('0xa')][_0xf971('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54b2fd,_0x32912f,_0x1cc247){return new BPromise(function(_0x5880f4,_0x5ee702){return client[_0xf971('0xc')](_0x54b2fd,_0x1cc247)[_0xf971('0xd')](function(_0x2374b1){logger['info'](_0xf971('0xe'),_0x32912f,_0xf971('0xf'));logger[_0xf971('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x32912f,_0xf971('0xf'),JSON[_0xf971('0x11')](_0x2374b1));if(_0x2374b1[_0xf971('0x12')]){if(_0x2374b1[_0xf971('0x12')][_0xf971('0x13')]===0x1f4){logger[_0xf971('0x12')](_0xf971('0xe'),_0x32912f,_0x2374b1['error'][_0xf971('0x14')]);return _0x5ee702(_0x2374b1[_0xf971('0x12')][_0xf971('0x14')]);}logger['error'](_0xf971('0xe'),_0x32912f,_0x2374b1[_0xf971('0x12')][_0xf971('0x14')]);return _0x5880f4(_0x2374b1[_0xf971('0x12')][_0xf971('0x14')]);}else{logger['info'](_0xf971('0xe'),_0x32912f,'request\x20sent');_0x5880f4(_0x2374b1[_0xf971('0x15')][_0xf971('0x14')]);}})['catch'](function(_0x33ed8e){logger[_0xf971('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x32912f,_0x33ed8e);_0x5ee702(_0x33ed8e);});});} \ No newline at end of file +var _0x9160=['bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0x9160,0x18e));var _0x0916=function(_0x352bc4,_0xb2f793){_0x352bc4=_0x352bc4-0x0;var _0x24cf6c=_0x9160[_0x352bc4];return _0x24cf6c;};'use strict';var _=require(_0x0916('0x0'));var util=require(_0x0916('0x1'));var moment=require('moment');var BPromise=require(_0x0916('0x2'));var rs=require(_0x0916('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0916('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0916('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0916('0x6'));var client=jayson[_0x0916('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e452,_0x1c43ec,_0x16098c){return new BPromise(function(_0x33a8cf,_0x87aeb1){return client[_0x0916('0x8')](_0x37e452,_0x16098c)[_0x0916('0x9')](function(_0x1b6f6a){logger['info'](_0x0916('0xa'),_0x1c43ec,_0x0916('0xb'));logger[_0x0916('0xc')](_0x0916('0xd'),_0x1c43ec,_0x0916('0xb'),JSON['stringify'](_0x1b6f6a));if(_0x1b6f6a[_0x0916('0xe')]){if(_0x1b6f6a[_0x0916('0xe')][_0x0916('0xf')]===0x1f4){logger[_0x0916('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x1c43ec,_0x1b6f6a[_0x0916('0xe')]['message']);return _0x87aeb1(_0x1b6f6a['error'][_0x0916('0x10')]);}logger[_0x0916('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x1c43ec,_0x1b6f6a['error'][_0x0916('0x10')]);return _0x33a8cf(_0x1b6f6a[_0x0916('0xe')][_0x0916('0x10')]);}else{logger[_0x0916('0x11')](_0x0916('0xa'),_0x1c43ec,_0x0916('0xb'));_0x33a8cf(_0x1b6f6a[_0x0916('0x12')][_0x0916('0x10')]);}})[_0x0916('0x13')](function(_0x59ec5f){logger[_0x0916('0xe')](_0x0916('0xa'),_0x1c43ec,_0x59ec5f);_0x87aeb1(_0x59ec5f);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 1bb106b..43a13d1 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 _0xd913=['describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x11aa73,_0x52ddcb){var _0x213a7e=function(_0x204173){while(--_0x204173){_0x11aa73['push'](_0x11aa73['shift']());}};_0x213a7e(++_0x52ddcb);}(_0xd913,0x126));var _0x3d91=function(_0x598cff,_0x23d815){_0x598cff=_0x598cff-0x0;var _0x22fb8d=_0xd913[_0x598cff];return _0x22fb8d;};'use strict';var multer=require(_0x3d91('0x0'));var util=require(_0x3d91('0x1'));var path=require(_0x3d91('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d91('0x3'));var interaction=require(_0x3d91('0x4'));var config=require(_0x3d91('0x5'));var controller=require('./memberReport.controller');router[_0x3d91('0x6')]('/',auth[_0x3d91('0x7')](),controller[_0x3d91('0x8')]);router['get'](_0x3d91('0x9'),auth[_0x3d91('0x7')](),controller[_0x3d91('0xa')]);router[_0x3d91('0x6')](_0x3d91('0xb'),auth[_0x3d91('0x7')](),controller[_0x3d91('0xc')]);router[_0x3d91('0xd')]('/',auth[_0x3d91('0x7')](),controller[_0x3d91('0xe')]);router[_0x3d91('0xf')](_0x3d91('0xb'),auth[_0x3d91('0x7')](),controller[_0x3d91('0x10')]);router['delete'](_0x3d91('0xb'),auth['isAuthenticated'](),controller[_0x3d91('0x11')]);module[_0x3d91('0x12')]=router; \ No newline at end of file +var _0xe7d1=['show','create','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x541dcf,_0x4f77f9){var _0x47ada2=function(_0x3100ff){while(--_0x3100ff){_0x541dcf['push'](_0x541dcf['shift']());}};_0x47ada2(++_0x4f77f9);}(_0xe7d1,0x17f));var _0x1e7d=function(_0x2416e5,_0x50bb6f){_0x2416e5=_0x2416e5-0x0;var _0xcb802=_0xe7d1[_0x2416e5];return _0xcb802;};'use strict';var multer=require(_0x1e7d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e7d('0x1'));var router=express[_0x1e7d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1e7d('0x3'));var interaction=require(_0x1e7d('0x4'));var config=require(_0x1e7d('0x5'));var controller=require(_0x1e7d('0x6'));router[_0x1e7d('0x7')]('/',auth[_0x1e7d('0x8')](),controller[_0x1e7d('0x9')]);router['get'](_0x1e7d('0xa'),auth[_0x1e7d('0x8')](),controller[_0x1e7d('0xb')]);router['get'](_0x1e7d('0xc'),auth[_0x1e7d('0x8')](),controller[_0x1e7d('0xd')]);router['post']('/',auth[_0x1e7d('0x8')](),controller[_0x1e7d('0xe')]);router['put'](_0x1e7d('0xc'),auth[_0x1e7d('0x8')](),controller[_0x1e7d('0xf')]);router[_0x1e7d('0x10')](_0x1e7d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x1e7d('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 3aef06a..2f42edd 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 _0x61b9=['talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x2ef714,_0x49e1c4){var _0x252ab0=function(_0x868e73){while(--_0x868e73){_0x2ef714['push'](_0x2ef714['shift']());}};_0x252ab0(++_0x49e1c4);}(_0x61b9,0xe2));var _0x961b=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0x61b9[_0x2f32c4];return _0x3f3018;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x961b('0x0'));module[_0x961b('0x1')]={'channel':{'type':Sequelize[_0x961b('0x2')]},'membername':{'type':Sequelize[_0x961b('0x2')]},'interface':{'type':Sequelize[_0x961b('0x2')]},'type':{'type':Sequelize[_0x961b('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x961b('0x3')},'duration':{'type':Sequelize[_0x961b('0x4')]},'enterAt':{'type':Sequelize[_0x961b('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x54c649){var _0x2f3c0d=moment(_0x54c649);var _0x167c76=moment(this[_0x961b('0x6')](_0x961b('0x7')));var _0xc9c83e=_0x2f3c0d[_0x961b('0x8')](_0x167c76,_0x961b('0x9'));this['setDataValue']('exitAt',_0x54c649);this[_0x961b('0xa')](_0x961b('0xb'),_0xc9c83e>=0x0?_0xc9c83e:null);}},'data1':{'type':Sequelize[_0x961b('0x2')],'comment':_0x961b('0xc')},'data2':{'type':Sequelize[_0x961b('0x2')],'comment':_0x961b('0xd')},'data3':{'type':Sequelize[_0x961b('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x961b('0x2')],'comment':_0x961b('0xe')},'data5':{'type':Sequelize[_0x961b('0x2')],'comment':_0x961b('0xf')},'role':{'type':Sequelize[_0x961b('0x2')]},'internal':{'type':Sequelize[_0x961b('0x4')]},'uniqueid':{'type':Sequelize[_0x961b('0x2')]}}; \ No newline at end of file +var _0x4a1b=['moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x1eef14,_0x6521a5){var _0x447837=function(_0x3ffeb2){while(--_0x3ffeb2){_0x1eef14['push'](_0x1eef14['shift']());}};_0x447837(++_0x6521a5);}(_0x4a1b,0x68));var _0xb4a1=function(_0x1b2cf0,_0x3e1559){_0x1b2cf0=_0x1b2cf0-0x0;var _0x566935=_0x4a1b[_0x1b2cf0];return _0x566935;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb4a1('0x0'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb4a1('0x1')]},'interface':{'type':Sequelize[_0xb4a1('0x1')]},'type':{'type':Sequelize[_0xb4a1('0x1')],'defaultValue':_0xb4a1('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb4a1('0x3')]},'enterAt':{'type':Sequelize[_0xb4a1('0x4')]},'exitAt':{'type':Sequelize[_0xb4a1('0x4')],'set':function(_0x315a73){var _0x4f7f9b=moment(_0x315a73);var _0x33a460=moment(this[_0xb4a1('0x5')]('enterAt'));var _0x2270bf=_0x4f7f9b[_0xb4a1('0x6')](_0x33a460,_0xb4a1('0x7'));this[_0xb4a1('0x8')](_0xb4a1('0x9'),_0x315a73);this['setDataValue']('duration',_0x2270bf>=0x0?_0x2270bf:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xb4a1('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xb4a1('0x1')],'comment':_0xb4a1('0xa')},'data4':{'type':Sequelize[_0xb4a1('0x1')],'comment':_0xb4a1('0xb')},'data5':{'type':Sequelize[_0xb4a1('0x1')],'comment':_0xb4a1('0xc')},'role':{'type':Sequelize[_0xb4a1('0x1')]},'internal':{'type':Sequelize[_0xb4a1('0x3')]},'uniqueid':{'type':Sequelize[_0xb4a1('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 5951810..d23f877 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(_0x5d6a51,_0x1bb917){var _0x2ebed0=function(_0x3cd4f1){while(--_0x3cd4f1){_0x5d6a51['push'](_0x5d6a51['shift']());}};_0x2ebed0(++_0x1bb917);}(_0x3e74,0x175));var _0x43e7=function(_0x3c632c,_0x6886cf){_0x3c632c=_0x3c632c-0x0;var _0x2e4c03=_0x3e74[_0x3c632c];return _0x2e4c03;};'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 _0x9c44=['catch','params','find','create','body','describe','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','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x28c8dc,_0x2c0ce4){var _0x30bc65=function(_0xbdbc8d){while(--_0xbdbc8d){_0x28c8dc['push'](_0x28c8dc['shift']());}};_0x30bc65(++_0x2c0ce4);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 7df2d8d..cf6c81c 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 _0xdc86=['../../config/environment','exports','define','MemberReport','report_member','membername_interface','membername','util','api','bluebird','request-promise','path','rimraf'];(function(_0x1149a9,_0x45139a){var _0x119b79=function(_0x2a976a){while(--_0x2a976a){_0x1149a9['push'](_0x1149a9['shift']());}};_0x119b79(++_0x45139a);}(_0xdc86,0x118));var _0x6dc8=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xdc86[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0x6dc8('0x0'));var logger=require('../../config/logger')(_0x6dc8('0x1'));var moment=require('moment');var BPromise=require(_0x6dc8('0x2'));var rp=require(_0x6dc8('0x3'));var fs=require('fs');var path=require(_0x6dc8('0x4'));var rimraf=require(_0x6dc8('0x5'));var config=require(_0x6dc8('0x6'));var attributes=require('./memberReport.attributes');module[_0x6dc8('0x7')]=function(_0x3109bf,_0xbc9bc4){return _0x3109bf[_0x6dc8('0x8')](_0x6dc8('0x9'),attributes,{'tableName':_0x6dc8('0xa'),'paranoid':![],'indexes':[{'name':_0x6dc8('0xb'),'fields':[_0x6dc8('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcd6=['membername_interface','interface','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0xdcd6,0x92));var _0x6dcd=function(_0x799277,_0x574d5f){_0x799277=_0x799277-0x0;var _0x56d41f=_0xdcd6[_0x799277];return _0x56d41f;};'use strict';var _=require(_0x6dcd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6dcd('0x1'));var moment=require(_0x6dcd('0x2'));var BPromise=require('bluebird');var rp=require(_0x6dcd('0x3'));var fs=require('fs');var path=require(_0x6dcd('0x4'));var rimraf=require(_0x6dcd('0x5'));var config=require(_0x6dcd('0x6'));var attributes=require(_0x6dcd('0x7'));module[_0x6dcd('0x8')]=function(_0x496e2e,_0x5d7423){return _0x496e2e[_0x6dcd('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x6dcd('0xa'),'fields':['membername',_0x6dcd('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 dba997a..b25f7a0 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 _0xb7b6=['where','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','limit','include','map','model','attributes','info','CreateMemberReport','UpdateMemberReport','update','body'];(function(_0x30eb4b,_0x4ee73f){var _0xc82cd0=function(_0x5f20cc){while(--_0x5f20cc){_0x30eb4b['push'](_0x30eb4b['shift']());}};_0xc82cd0(++_0x4ee73f);}(_0xb7b6,0x15f));var _0x6b7b=function(_0x3d0962,_0x448b4f){_0x3d0962=_0x3d0962-0x0;var _0x186e18=_0xb7b6[_0x3d0962];return _0x186e18;};'use strict';var _=require(_0x6b7b('0x0'));var util=require(_0x6b7b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b7b('0x2'));var fs=require('fs');var Redis=require(_0x6b7b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b7b('0x4'));var logger=require(_0x6b7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b7b('0x6'));var client=jayson[_0x6b7b('0x7')][_0x6b7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xff519e,_0x24359f,_0x483b9c){return new BPromise(function(_0x49a6c8,_0x2bb86d){return client[_0x6b7b('0x9')](_0xff519e,_0x483b9c)[_0x6b7b('0xa')](function(_0x115f2d){logger['info']('MemberReport,\x20%s,\x20%s',_0x24359f,'request\x20sent');logger[_0x6b7b('0xb')](_0x6b7b('0xc'),_0x24359f,_0x6b7b('0xd'),JSON[_0x6b7b('0xe')](_0x115f2d));if(_0x115f2d[_0x6b7b('0xf')]){if(_0x115f2d[_0x6b7b('0xf')]['code']===0x1f4){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x115f2d['error'][_0x6b7b('0x11')]);return _0x2bb86d(_0x115f2d[_0x6b7b('0xf')]['message']);}logger[_0x6b7b('0xf')]('MemberReport,\x20%s,\x20%s',_0x24359f,_0x115f2d[_0x6b7b('0xf')][_0x6b7b('0x11')]);return _0x49a6c8(_0x115f2d[_0x6b7b('0xf')]['message']);}else{logger['info'](_0x6b7b('0x10'),_0x24359f,'request\x20sent');_0x49a6c8(_0x115f2d['result'][_0x6b7b('0x11')]);}})[_0x6b7b('0x12')](function(_0x4ef35b){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x4ef35b);_0x2bb86d(_0x4ef35b);});});}exports[_0x6b7b('0x13')]=function(_0x41f48e){var _0x51b01f=this;return new Promise(function(_0x3d025c,_0x2036ec){return db[_0x6b7b('0x14')][_0x6b7b('0x15')]({'raw':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e[_0x6b7b('0x16')][_0x6b7b('0x17')]===undefined?!![]:![]:!![],'where':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e['options']['where']||null:null,'attributes':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e['options']['attributes']||null:null,'limit':_0x41f48e['options']?_0x41f48e['options'][_0x6b7b('0x18')]||null:null,'include':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e['options'][_0x6b7b('0x19')]?_[_0x6b7b('0x1a')](_0x41f48e['options'][_0x6b7b('0x19')],function(_0x1d3c69){return{'model':db[_0x1d3c69[_0x6b7b('0x1b')]],'as':_0x1d3c69['as'],'attributes':_0x1d3c69[_0x6b7b('0x1c')],'include':_0x1d3c69[_0x6b7b('0x19')]?_[_0x6b7b('0x1a')](_0x1d3c69[_0x6b7b('0x19')],function(_0x6edf){return{'model':db[_0x6edf[_0x6b7b('0x1b')]],'as':_0x6edf['as'],'attributes':_0x6edf[_0x6b7b('0x1c')],'include':_0x6edf[_0x6b7b('0x19')]?_[_0x6b7b('0x1a')](_0x6edf[_0x6b7b('0x19')],function(_0x2fc275){return{'model':db[_0x2fc275[_0x6b7b('0x1b')]],'as':_0x2fc275['as'],'attributes':_0x2fc275['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3120a3){logger[_0x6b7b('0x1d')](_0x6b7b('0x13'),_0x41f48e);logger['debug'](_0x6b7b('0x13'),_0x41f48e,JSON['stringify'](_0x3120a3));_0x3d025c(_0x3120a3);})[_0x6b7b('0x12')](function(_0x3117db){logger[_0x6b7b('0xf')](_0x6b7b('0x13'),_0x3117db['message'],_0x41f48e);_0x2036ec(_0x51b01f['error'](0x1f4,_0x3117db[_0x6b7b('0x11')]));});});};exports[_0x6b7b('0x1e')]=function(_0x3622e0){var _0x3ee2b6=this;return new Promise(function(_0x4f70e3,_0xef8922){return db[_0x6b7b('0x14')]['create'](_0x3622e0['body'],{'raw':_0x3622e0[_0x6b7b('0x16')]?_0x3622e0[_0x6b7b('0x16')][_0x6b7b('0x17')]===undefined?!![]:![]:!![]})[_0x6b7b('0xa')](function(_0x48e25b){logger['info'](_0x6b7b('0x1e'),_0x3622e0);logger[_0x6b7b('0xb')]('CreateMemberReport',_0x3622e0,JSON[_0x6b7b('0xe')](_0x48e25b));_0x4f70e3(_0x48e25b);})[_0x6b7b('0x12')](function(_0x2ae633){logger[_0x6b7b('0xf')](_0x6b7b('0x1e'),_0x2ae633['message'],_0x3622e0);_0xef8922(_0x3ee2b6[_0x6b7b('0xf')](0x1f4,_0x2ae633[_0x6b7b('0x11')]));});});};exports[_0x6b7b('0x1f')]=function(_0x5a1086){var _0x29e3e1=this;return new Promise(function(_0x1175dd,_0x5bb0f8){return db['MemberReport'][_0x6b7b('0x20')](_0x5a1086[_0x6b7b('0x21')],{'raw':_0x5a1086[_0x6b7b('0x16')]?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1086['options']?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x22')]||null:null,'attributes':_0x5a1086[_0x6b7b('0x16')]?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x1c')]||null:null,'limit':_0x5a1086[_0x6b7b('0x16')]?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x18')]||null:null})[_0x6b7b('0xa')](function(_0x49b593){logger[_0x6b7b('0x1d')](_0x6b7b('0x1f'),_0x5a1086);logger[_0x6b7b('0xb')](_0x6b7b('0x1f'),_0x5a1086,JSON[_0x6b7b('0xe')](_0x49b593));_0x1175dd(_0x49b593);})[_0x6b7b('0x12')](function(_0x28ba67){logger['error'](_0x6b7b('0x1f'),_0x28ba67[_0x6b7b('0x11')],_0x5a1086);_0x5bb0f8(_0x29e3e1[_0x6b7b('0xf')](0x1f4,_0x28ba67[_0x6b7b('0x11')]));});});}; \ No newline at end of file +var _0x195f=['attributes','GetMemberReport','stringify','CreateMemberReport','create','body','raw','UpdateMemberReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MemberReport','options','where','limit','include','map','model'];(function(_0x8a6f8d,_0x17098a){var _0x4fbbee=function(_0x527f61){while(--_0x527f61){_0x8a6f8d['push'](_0x8a6f8d['shift']());}};_0x4fbbee(++_0x17098a);}(_0x195f,0x113));var _0xf195=function(_0x2166a3,_0x237c50){_0x2166a3=_0x2166a3-0x0;var _0x260035=_0x195f[_0x2166a3];return _0x260035;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var moment=require('moment');var BPromise=require(_0xf195('0x2'));var rs=require(_0xf195('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf195('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf195('0x5'))(_0xf195('0x6'));var config=require(_0xf195('0x7'));var jayson=require(_0xf195('0x8'));var client=jayson[_0xf195('0x9')][_0xf195('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2770db,_0x59d783,_0x5eac33){return new BPromise(function(_0x327cc3,_0x15d465){return client[_0xf195('0xb')](_0x2770db,_0x5eac33)[_0xf195('0xc')](function(_0x7b3e6f){logger[_0xf195('0xd')](_0xf195('0xe'),_0x59d783,'request\x20sent');logger[_0xf195('0xf')](_0xf195('0x10'),_0x59d783,_0xf195('0x11'),JSON['stringify'](_0x7b3e6f));if(_0x7b3e6f[_0xf195('0x12')]){if(_0x7b3e6f[_0xf195('0x12')][_0xf195('0x13')]===0x1f4){logger[_0xf195('0x12')]('MemberReport,\x20%s,\x20%s',_0x59d783,_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);return _0x15d465(_0x7b3e6f['error'][_0xf195('0x14')]);}logger['error'](_0xf195('0xe'),_0x59d783,_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);return _0x327cc3(_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);}else{logger[_0xf195('0xd')](_0xf195('0xe'),_0x59d783,_0xf195('0x11'));_0x327cc3(_0x7b3e6f['result']['message']);}})[_0xf195('0x15')](function(_0x3ad05f){logger[_0xf195('0x12')](_0xf195('0xe'),_0x59d783,_0x3ad05f);_0x15d465(_0x3ad05f);});});}exports['GetMemberReport']=function(_0x374fc6){var _0x1ae33e=this;return new Promise(function(_0x5cf7dc,_0x452931){return db[_0xf195('0x16')]['findAll']({'raw':_0x374fc6[_0xf195('0x17')]?_0x374fc6[_0xf195('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x374fc6[_0xf195('0x17')]?_0x374fc6[_0xf195('0x17')][_0xf195('0x18')]||null:null,'attributes':_0x374fc6[_0xf195('0x17')]?_0x374fc6['options']['attributes']||null:null,'limit':_0x374fc6['options']?_0x374fc6[_0xf195('0x17')][_0xf195('0x19')]||null:null,'include':_0x374fc6[_0xf195('0x17')]?_0x374fc6[_0xf195('0x17')][_0xf195('0x1a')]?_[_0xf195('0x1b')](_0x374fc6[_0xf195('0x17')][_0xf195('0x1a')],function(_0x45cfa4){return{'model':db[_0x45cfa4[_0xf195('0x1c')]],'as':_0x45cfa4['as'],'attributes':_0x45cfa4[_0xf195('0x1d')],'include':_0x45cfa4[_0xf195('0x1a')]?_['map'](_0x45cfa4[_0xf195('0x1a')],function(_0x246750){return{'model':db[_0x246750[_0xf195('0x1c')]],'as':_0x246750['as'],'attributes':_0x246750[_0xf195('0x1d')],'include':_0x246750[_0xf195('0x1a')]?_[_0xf195('0x1b')](_0x246750[_0xf195('0x1a')],function(_0x3c1371){return{'model':db[_0x3c1371['model']],'as':_0x3c1371['as'],'attributes':_0x3c1371['attributes']};}):[]};}):[]};}):[]:[]})[_0xf195('0xc')](function(_0x37d9e9){logger[_0xf195('0xd')](_0xf195('0x1e'),_0x374fc6);logger[_0xf195('0xf')](_0xf195('0x1e'),_0x374fc6,JSON[_0xf195('0x1f')](_0x37d9e9));_0x5cf7dc(_0x37d9e9);})[_0xf195('0x15')](function(_0x5dbca){logger[_0xf195('0x12')](_0xf195('0x1e'),_0x5dbca[_0xf195('0x14')],_0x374fc6);_0x452931(_0x1ae33e[_0xf195('0x12')](0x1f4,_0x5dbca[_0xf195('0x14')]));});});};exports[_0xf195('0x20')]=function(_0x245a06){var _0x20e0e3=this;return new Promise(function(_0x26f511,_0xdd63ec){return db['MemberReport'][_0xf195('0x21')](_0x245a06[_0xf195('0x22')],{'raw':_0x245a06[_0xf195('0x17')]?_0x245a06[_0xf195('0x17')][_0xf195('0x23')]===undefined?!![]:![]:!![]})[_0xf195('0xc')](function(_0x12b169){logger[_0xf195('0xd')](_0xf195('0x20'),_0x245a06);logger[_0xf195('0xf')](_0xf195('0x20'),_0x245a06,JSON[_0xf195('0x1f')](_0x12b169));_0x26f511(_0x12b169);})[_0xf195('0x15')](function(_0x9eff93){logger[_0xf195('0x12')](_0xf195('0x20'),_0x9eff93[_0xf195('0x14')],_0x245a06);_0xdd63ec(_0x20e0e3['error'](0x1f4,_0x9eff93[_0xf195('0x14')]));});});};exports[_0xf195('0x24')]=function(_0x2d0ef1){var _0xc0a617=this;return new Promise(function(_0x32e5ee,_0x58a1a9){return db[_0xf195('0x16')][_0xf195('0x25')](_0x2d0ef1[_0xf195('0x22')],{'raw':_0x2d0ef1['options']?_0x2d0ef1['options'][_0xf195('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d0ef1[_0xf195('0x17')]?_0x2d0ef1[_0xf195('0x17')][_0xf195('0x18')]||null:null,'attributes':_0x2d0ef1[_0xf195('0x17')]?_0x2d0ef1[_0xf195('0x17')][_0xf195('0x1d')]||null:null,'limit':_0x2d0ef1[_0xf195('0x17')]?_0x2d0ef1[_0xf195('0x17')][_0xf195('0x19')]||null:null})['then'](function(_0x4eaa8c){logger[_0xf195('0xd')](_0xf195('0x24'),_0x2d0ef1);logger[_0xf195('0xf')](_0xf195('0x24'),_0x2d0ef1,JSON[_0xf195('0x1f')](_0x4eaa8c));_0x32e5ee(_0x4eaa8c);})[_0xf195('0x15')](function(_0x11958c){logger[_0xf195('0x12')]('UpdateMemberReport',_0x11958c[_0xf195('0x14')],_0x2d0ef1);_0x58a1a9(_0xc0a617['error'](0x1f4,_0x11958c['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6764af9..0217567 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 _0xcb41=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0xcb41,0x1df));var _0x1cb4=function(_0x5cc051,_0x4841d2){_0x5cc051=_0x5cc051-0x0;var _0x530654=_0xcb41[_0x5cc051];return _0x530654;};'use strict';var multer=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var path=require(_0x1cb4('0x2'));var timeout=require(_0x1cb4('0x3'));var express=require('express');var router=express[_0x1cb4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb4('0x5'));var interaction=require(_0x1cb4('0x6'));var config=require(_0x1cb4('0x7'));var controller=require(_0x1cb4('0x8'));router[_0x1cb4('0x9')]('/',controller[_0x1cb4('0xa')]);module[_0x1cb4('0xb')]=router; \ No newline at end of file +var _0xcc34=['../../config/environment','./migration.controller','get','index','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcc34,0x7e));var _0x4cc3=function(_0x272ca9,_0x42c145){_0x272ca9=_0x272ca9-0x0;var _0x55ae78=_0xcc34[_0x272ca9];return _0x55ae78;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4cc3('0x0'));var timeout=require('connect-timeout');var express=require(_0x4cc3('0x1'));var router=express[_0x4cc3('0x2')]();var fs_extra=require(_0x4cc3('0x3'));var auth=require(_0x4cc3('0x4'));var interaction=require(_0x4cc3('0x5'));var config=require(_0x4cc3('0x6'));var controller=require(_0x4cc3('0x7'));router[_0x4cc3('0x8')]('/',controller[_0x4cc3('0x9')]);module[_0x4cc3('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 ae44117..b1a4bd3 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 _0x88cb=['sequelize','STRING','version'];(function(_0x3256d1,_0x5f2a82){var _0x8543ca=function(_0x112baf){while(--_0x112baf){_0x3256d1['push'](_0x3256d1['shift']());}};_0x8543ca(++_0x5f2a82);}(_0x88cb,0xbd));var _0xb88c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88cb[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xb88c('0x0'));module['exports']={'version':{'type':Sequelize[_0xb88c('0x1')],'unique':_0xb88c('0x2')}}; \ No newline at end of file +var _0x2291=['sequelize','exports','STRING','version'];(function(_0x46dadc,_0x27724b){var _0x214ead=function(_0x4a14cc){while(--_0x4a14cc){_0x46dadc['push'](_0x46dadc['shift']());}};_0x214ead(++_0x27724b);}(_0x2291,0x130));var _0x1229=function(_0x168edb,_0x33dd54){_0x168edb=_0x168edb-0x0;var _0x413600=_0x2291[_0x168edb];return _0x413600;};'use strict';var Sequelize=require(_0x1229('0x0'));module[_0x1229('0x1')]={'version':{'type':Sequelize[_0x1229('0x2')],'unique':_0x1229('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 29c1f6f..20d9ce2 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 _0x3e10=['offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x41b5c7,_0x823e96){var _0x4e86a5=function(_0x5051b5){while(--_0x5051b5){_0x41b5c7['push'](_0x41b5c7['shift']());}};_0x4e86a5(++_0x823e96);}(_0x3e10,0x67));var _0x03e1=function(_0x58d662,_0x213b06){_0x58d662=_0x58d662-0x0;var _0xa398ce=_0x3e10[_0x58d662];return _0xa398ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03e1('0x0'));var zipdir=require(_0x03e1('0x1'));var jsonpatch=require(_0x03e1('0x2'));var rp=require('request-promise');var moment=require(_0x03e1('0x3'));var BPromise=require(_0x03e1('0x4'));var Mustache=require('mustache');var util=require(_0x03e1('0x5'));var path=require(_0x03e1('0x6'));var sox=require(_0x03e1('0x7'));var csv=require(_0x03e1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03e1('0x9'));var _=require('lodash');var squel=require(_0x03e1('0xa'));var crypto=require(_0x03e1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x03e1('0xc'));var toCsv=require(_0x03e1('0x8'));var querystring=require(_0x03e1('0xd'));var Papa=require(_0x03e1('0xe'));var Redis=require(_0x03e1('0xf'));var authService=require(_0x03e1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03e1('0x11'));var logger=require(_0x03e1('0x12'))(_0x03e1('0x13'));var utils=require('../../config/utils');var config=require(_0x03e1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03e1('0x15'))['db'];function respondWithStatusCode(_0x5bfd17,_0x2c6a7c){_0x2c6a7c=_0x2c6a7c||0xcc;return function(_0xf1baf0){if(_0xf1baf0){return _0x5bfd17[_0x03e1('0x16')](_0x2c6a7c);}return _0x5bfd17[_0x03e1('0x17')](_0x2c6a7c)['end']();};}function respondWithResult(_0x57db13,_0x1a6f30){_0x1a6f30=_0x1a6f30||0xc8;return function(_0x263f62){if(_0x263f62){return _0x57db13[_0x03e1('0x17')](_0x1a6f30)[_0x03e1('0x18')](_0x263f62);}};}function respondWithFilteredResult(_0xe6cd68,_0x1a5bbb){return function(_0x32ab1b){if(_0x32ab1b){var _0x53e555=typeof _0x1a5bbb[_0x03e1('0x19')]===_0x03e1('0x1a')&&typeof _0x1a5bbb[_0x03e1('0x1b')]===_0x03e1('0x1a');var _0x527ce6=_0x32ab1b[_0x03e1('0x1c')];var _0x42c804=_0x53e555?0x0:_0x1a5bbb[_0x03e1('0x19')];var _0x6a46b1=_0x53e555?_0x32ab1b[_0x03e1('0x1c')]:_0x1a5bbb[_0x03e1('0x19')]+_0x1a5bbb[_0x03e1('0x1b')];var _0x4c292b;if(_0x6a46b1>=_0x527ce6){_0x6a46b1=_0x527ce6;_0x4c292b=0xc8;}else{_0x4c292b=0xce;}_0xe6cd68[_0x03e1('0x17')](_0x4c292b);return _0xe6cd68['set'](_0x03e1('0x1d'),_0x42c804+'-'+_0x6a46b1+'/'+_0x527ce6)['json'](_0x32ab1b);}return null;};}function patchUpdates(_0x53c6f1){return function(_0x51e529){try{jsonpatch['apply'](_0x51e529,_0x53c6f1,!![]);}catch(_0x4e9d62){return BPromise['reject'](_0x4e9d62);}return _0x51e529[_0x03e1('0x1e')]();};}function saveUpdates(_0x197329,_0x586744){return function(_0x5f2fef){if(_0x5f2fef){return _0x5f2fef[_0x03e1('0x1f')](_0x197329)[_0x03e1('0x20')](function(_0x40e16f){return _0x40e16f;});}return null;};}function removeEntity(_0x9ec8e1,_0x427bd8){return function(_0x1cab79){if(_0x1cab79){return _0x1cab79[_0x03e1('0x21')]()['then'](function(){_0x9ec8e1[_0x03e1('0x17')](0xcc)[_0x03e1('0x22')]();});}};}function handleEntityNotFound(_0x33a627,_0x59af7f){return function(_0x38cbf5){if(!_0x38cbf5){_0x33a627['sendStatus'](0x194);}return _0x38cbf5;};}function handleError(_0xb85dbe,_0x4d2952){_0x4d2952=_0x4d2952||0x1f4;return function(_0x35e4ec){logger[_0x03e1('0x23')](_0x35e4ec[_0x03e1('0x24')]);if(_0x35e4ec[_0x03e1('0x25')]){delete _0x35e4ec['name'];}_0xb85dbe['status'](_0x4d2952)['send'](_0x35e4ec);};}exports['index']=function(_0x1488ae,_0x9c6ef2){var _0x268ee2={},_0x56879d={},_0x4e054d={'count':0x0,'rows':[]};var _0x207277=_[_0x03e1('0x26')](db[_0x03e1('0x27')][_0x03e1('0x28')],function(_0x292457){return{'name':_0x292457[_0x03e1('0x29')],'type':_0x292457[_0x03e1('0x2a')][_0x03e1('0x2b')]};});_0x56879d[_0x03e1('0x2c')]=_['map'](_0x207277,'name');_0x56879d[_0x03e1('0x2d')]=_[_0x03e1('0x2e')](_0x1488ae[_0x03e1('0x2d')]);_0x56879d[_0x03e1('0x2f')]=_[_0x03e1('0x30')](_0x56879d[_0x03e1('0x2c')],_0x56879d[_0x03e1('0x2d')]);_0x268ee2[_0x03e1('0x31')]=_['intersection'](_0x56879d['model'],qs[_0x03e1('0x32')](_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x32')]));_0x268ee2[_0x03e1('0x31')]=_0x268ee2['attributes'][_0x03e1('0x33')]?_0x268ee2[_0x03e1('0x31')]:_0x56879d[_0x03e1('0x2c')];if(!_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x34')](_0x03e1('0x35'))){_0x268ee2[_0x03e1('0x1b')]=qs['limit'](_0x1488ae['query'][_0x03e1('0x1b')]);_0x268ee2[_0x03e1('0x19')]=qs[_0x03e1('0x19')](_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x19')]);}_0x268ee2[_0x03e1('0x36')]=qs['sort'](_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x37')]);_0x268ee2['where']=qs['filters'](_['pick'](_0x1488ae['query'],_0x56879d[_0x03e1('0x2f')]),_0x207277);if(_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x38')]){_0x268ee2[_0x03e1('0x39')]=_[_0x03e1('0x3a')](_0x268ee2[_0x03e1('0x39')],{'$or':_[_0x03e1('0x26')](_0x207277,function(_0x307adb){if(_0x307adb[_0x03e1('0x2a')]!==_0x03e1('0x3b')){var _0x1d5e31={};_0x1d5e31[_0x307adb[_0x03e1('0x25')]]={'$like':'%'+_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x38')]+'%'};return _0x1d5e31;}})});}_0x268ee2=_[_0x03e1('0x3a')]({},_0x268ee2,_0x1488ae['options']);var _0x1028a6={'where':_0x268ee2['where']};return db[_0x03e1('0x27')][_0x03e1('0x1c')](_0x1028a6)[_0x03e1('0x20')](function(_0xc3d77c){_0x4e054d[_0x03e1('0x1c')]=_0xc3d77c;if(_0x1488ae[_0x03e1('0x2d')][_0x03e1('0x3c')]){_0x268ee2[_0x03e1('0x3d')]=[{'all':!![]}];}return db[_0x03e1('0x27')][_0x03e1('0x3e')](_0x268ee2);})[_0x03e1('0x20')](function(_0x2f5f1b){_0x4e054d[_0x03e1('0x3f')]=_0x2f5f1b;return _0x4e054d;})[_0x03e1('0x20')](respondWithFilteredResult(_0x9c6ef2,_0x268ee2))['catch'](handleError(_0x9c6ef2,null));}; \ No newline at end of file +var _0xe19c=['filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','include','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','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','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe19c,0x1a3));var _0xce19=function(_0x469348,_0x39af3d){_0x469348=_0x469348-0x0;var _0x5a13a1=_0xe19c[_0x469348];return _0x5a13a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce19('0x0'));var zipdir=require(_0xce19('0x1'));var jsonpatch=require(_0xce19('0x2'));var rp=require(_0xce19('0x3'));var moment=require(_0xce19('0x4'));var BPromise=require(_0xce19('0x5'));var Mustache=require(_0xce19('0x6'));var util=require('util');var path=require(_0xce19('0x7'));var sox=require(_0xce19('0x8'));var csv=require(_0xce19('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce19('0xa'));var _=require(_0xce19('0xb'));var squel=require(_0xce19('0xc'));var crypto=require('crypto');var jsforce=require(_0xce19('0xd'));var deskjs=require(_0xce19('0xe'));var toCsv=require(_0xce19('0x9'));var querystring=require(_0xce19('0xf'));var Papa=require(_0xce19('0x10'));var Redis=require('ioredis');var authService=require(_0xce19('0x11'));var qs=require(_0xce19('0x12'));var as=require(_0xce19('0x13'));var hardwareService=require(_0xce19('0x14'));var logger=require('../../config/logger')(_0xce19('0x15'));var utils=require(_0xce19('0x16'));var config=require(_0xce19('0x17'));var licenseUtil=require(_0xce19('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ced8d,_0x3ddeb0){_0x3ddeb0=_0x3ddeb0||0xcc;return function(_0x43a3ef){if(_0x43a3ef){return _0x4ced8d[_0xce19('0x19')](_0x3ddeb0);}return _0x4ced8d[_0xce19('0x1a')](_0x3ddeb0)['end']();};}function respondWithResult(_0x562457,_0x5aa05a){_0x5aa05a=_0x5aa05a||0xc8;return function(_0x4ace3c){if(_0x4ace3c){return _0x562457['status'](_0x5aa05a)[_0xce19('0x1b')](_0x4ace3c);}};}function respondWithFilteredResult(_0x4f104f,_0x1bc37a){return function(_0xa63ea7){if(_0xa63ea7){var _0x59be49=typeof _0x1bc37a[_0xce19('0x1c')]==='undefined'&&typeof _0x1bc37a['limit']===_0xce19('0x1d');var _0x42383f=_0xa63ea7[_0xce19('0x1e')];var _0x1297de=_0x59be49?0x0:_0x1bc37a['offset'];var _0x119691=_0x59be49?_0xa63ea7['count']:_0x1bc37a[_0xce19('0x1c')]+_0x1bc37a['limit'];var _0x4c5bac;if(_0x119691>=_0x42383f){_0x119691=_0x42383f;_0x4c5bac=0xc8;}else{_0x4c5bac=0xce;}_0x4f104f[_0xce19('0x1a')](_0x4c5bac);return _0x4f104f[_0xce19('0x1f')](_0xce19('0x20'),_0x1297de+'-'+_0x119691+'/'+_0x42383f)[_0xce19('0x1b')](_0xa63ea7);}return null;};}function patchUpdates(_0x3438e5){return function(_0x76ade8){try{jsonpatch['apply'](_0x76ade8,_0x3438e5,!![]);}catch(_0x4dfbae){return BPromise[_0xce19('0x21')](_0x4dfbae);}return _0x76ade8[_0xce19('0x22')]();};}function saveUpdates(_0x3ab4da,_0x4a2b6a){return function(_0xea5429){if(_0xea5429){return _0xea5429[_0xce19('0x23')](_0x3ab4da)[_0xce19('0x24')](function(_0x4b82ed){return _0x4b82ed;});}return null;};}function removeEntity(_0x1b3928,_0x3bc393){return function(_0x3fb1bc){if(_0x3fb1bc){return _0x3fb1bc[_0xce19('0x25')]()[_0xce19('0x24')](function(){_0x1b3928[_0xce19('0x1a')](0xcc)[_0xce19('0x26')]();});}};}function handleEntityNotFound(_0x5199fd,_0x4abbe0){return function(_0x2401f8){if(!_0x2401f8){_0x5199fd[_0xce19('0x19')](0x194);}return _0x2401f8;};}function handleError(_0x1535f5,_0x5dfeed){_0x5dfeed=_0x5dfeed||0x1f4;return function(_0x33f728){logger['error'](_0x33f728[_0xce19('0x27')]);if(_0x33f728[_0xce19('0x28')]){delete _0x33f728[_0xce19('0x28')];}_0x1535f5[_0xce19('0x1a')](_0x5dfeed)[_0xce19('0x29')](_0x33f728);};}exports[_0xce19('0x2a')]=function(_0x43a898,_0x3da9c9){var _0x918fd7={},_0x38a1ee={},_0x120d84={'count':0x0,'rows':[]};var _0x52a677=_[_0xce19('0x2b')](db[_0xce19('0x2c')][_0xce19('0x2d')],function(_0x151af9){return{'name':_0x151af9[_0xce19('0x2e')],'type':_0x151af9[_0xce19('0x2f')]['key']};});_0x38a1ee[_0xce19('0x30')]=_[_0xce19('0x2b')](_0x52a677,_0xce19('0x28'));_0x38a1ee[_0xce19('0x31')]=_['keys'](_0x43a898[_0xce19('0x31')]);_0x38a1ee[_0xce19('0x32')]=_['intersection'](_0x38a1ee['model'],_0x38a1ee[_0xce19('0x31')]);_0x918fd7[_0xce19('0x33')]=_['intersection'](_0x38a1ee[_0xce19('0x30')],qs[_0xce19('0x34')](_0x43a898[_0xce19('0x31')][_0xce19('0x34')]));_0x918fd7[_0xce19('0x33')]=_0x918fd7[_0xce19('0x33')][_0xce19('0x35')]?_0x918fd7[_0xce19('0x33')]:_0x38a1ee[_0xce19('0x30')];if(!_0x43a898[_0xce19('0x31')][_0xce19('0x36')](_0xce19('0x37'))){_0x918fd7['limit']=qs[_0xce19('0x38')](_0x43a898[_0xce19('0x31')]['limit']);_0x918fd7['offset']=qs[_0xce19('0x1c')](_0x43a898[_0xce19('0x31')][_0xce19('0x1c')]);}_0x918fd7[_0xce19('0x39')]=qs[_0xce19('0x3a')](_0x43a898[_0xce19('0x31')][_0xce19('0x3a')]);_0x918fd7[_0xce19('0x3b')]=qs[_0xce19('0x32')](_['pick'](_0x43a898[_0xce19('0x31')],_0x38a1ee['filters']),_0x52a677);if(_0x43a898['query'][_0xce19('0x3c')]){_0x918fd7[_0xce19('0x3b')]=_[_0xce19('0x3d')](_0x918fd7[_0xce19('0x3b')],{'$or':_[_0xce19('0x2b')](_0x52a677,function(_0x5209aa){if(_0x5209aa[_0xce19('0x2f')]!=='VIRTUAL'){var _0x503bf1={};_0x503bf1[_0x5209aa[_0xce19('0x28')]]={'$like':'%'+_0x43a898[_0xce19('0x31')][_0xce19('0x3c')]+'%'};return _0x503bf1;}})});}_0x918fd7=_['merge']({},_0x918fd7,_0x43a898[_0xce19('0x3e')]);var _0x50aefa={'where':_0x918fd7[_0xce19('0x3b')]};return db[_0xce19('0x2c')][_0xce19('0x1e')](_0x50aefa)[_0xce19('0x24')](function(_0xe7940d){_0x120d84[_0xce19('0x1e')]=_0xe7940d;if(_0x43a898['query']['includeAll']){_0x918fd7[_0xce19('0x3f')]=[{'all':!![]}];}return db[_0xce19('0x2c')][_0xce19('0x40')](_0x918fd7);})[_0xce19('0x24')](function(_0x1c0554){_0x120d84[_0xce19('0x41')]=_0x1c0554;return _0x120d84;})['then'](respondWithFilteredResult(_0x3da9c9,_0x918fd7))[_0xce19('0x42')](handleError(_0x3da9c9,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f3981d9..4f57506 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 _0xe45f=['moment','bluebird','path','rimraf','../../config/environment','exports','define','migrations','lodash','util','../../config/logger'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe45f,0xef));var _0xfe45=function(_0x44dff0,_0x2b0cda){_0x44dff0=_0x44dff0-0x0;var _0x4a4dad=_0xe45f[_0x44dff0];return _0x4a4dad;};'use strict';var _=require(_0xfe45('0x0'));var util=require(_0xfe45('0x1'));var logger=require(_0xfe45('0x2'))('api');var moment=require(_0xfe45('0x3'));var BPromise=require(_0xfe45('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe45('0x5'));var rimraf=require(_0xfe45('0x6'));var config=require(_0xfe45('0x7'));var attributes=require('./migration.attributes');module[_0xfe45('0x8')]=function(_0x407e8f,_0x2f3513){return _0x407e8f[_0xfe45('0x9')]('Migration',attributes,{'tableName':_0xfe45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c00=['request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3f5ed4,_0x433b00){var _0x3c8208=function(_0x151fb0){while(--_0x151fb0){_0x3f5ed4['push'](_0x3f5ed4['shift']());}};_0x3c8208(++_0x433b00);}(_0x9c00,0x19b));var _0x09c0=function(_0x27ac32,_0x42771f){_0x27ac32=_0x27ac32-0x0;var _0x20c811=_0x9c00[_0x27ac32];return _0x20c811;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require(_0x09c0('0x2'))('api');var moment=require(_0x09c0('0x3'));var BPromise=require(_0x09c0('0x4'));var rp=require(_0x09c0('0x5'));var fs=require('fs');var path=require(_0x09c0('0x6'));var rimraf=require(_0x09c0('0x7'));var config=require(_0x09c0('0x8'));var attributes=require(_0x09c0('0x9'));module[_0x09c0('0xa')]=function(_0x1255e2,_0xca7a96){return _0x1255e2['define'](_0x09c0('0xb'),attributes,{'tableName':_0x09c0('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 2a0060f..c1a2f88 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 _0x2be0=['request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s'];(function(_0x23ae76,_0x578c83){var _0x473049=function(_0x3daf90){while(--_0x3daf90){_0x23ae76['push'](_0x23ae76['shift']());}};_0x473049(++_0x578c83);}(_0x2be0,0x128));var _0x02be=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x2be0[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x02be('0x0'));var util=require(_0x02be('0x1'));var moment=require(_0x02be('0x2'));var BPromise=require(_0x02be('0x3'));var rs=require(_0x02be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02be('0x5'))['db'];var utils=require(_0x02be('0x6'));var logger=require(_0x02be('0x7'))('rpc');var config=require(_0x02be('0x8'));var jayson=require(_0x02be('0x9'));var client=jayson[_0x02be('0xa')][_0x02be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x522686,_0x32748e,_0x3eaa8a){return new BPromise(function(_0x22686f,_0xd049ec){return client[_0x02be('0xc')](_0x522686,_0x3eaa8a)[_0x02be('0xd')](function(_0x3e701d){logger[_0x02be('0xe')](_0x02be('0xf'),_0x32748e,_0x02be('0x10'));logger[_0x02be('0x11')](_0x02be('0x12'),_0x32748e,_0x02be('0x10'),JSON[_0x02be('0x13')](_0x3e701d));if(_0x3e701d['error']){if(_0x3e701d[_0x02be('0x14')][_0x02be('0x15')]===0x1f4){logger[_0x02be('0x14')](_0x02be('0xf'),_0x32748e,_0x3e701d['error'][_0x02be('0x16')]);return _0xd049ec(_0x3e701d['error'][_0x02be('0x16')]);}logger[_0x02be('0x14')](_0x02be('0xf'),_0x32748e,_0x3e701d[_0x02be('0x14')][_0x02be('0x16')]);return _0x22686f(_0x3e701d[_0x02be('0x14')][_0x02be('0x16')]);}else{logger[_0x02be('0xe')]('Migration,\x20%s,\x20%s',_0x32748e,_0x02be('0x10'));_0x22686f(_0x3e701d[_0x02be('0x17')]['message']);}})['catch'](function(_0x4376a3){logger['error']('Migration,\x20%s,\x20%s',_0x32748e,_0x4376a3);_0xd049ec(_0x4376a3);});});} \ No newline at end of file +var _0xf958=['then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x103ef6,_0x46ba39){var _0x73d766=function(_0x162726){while(--_0x162726){_0x103ef6['push'](_0x103ef6['shift']());}};_0x73d766(++_0x46ba39);}(_0xf958,0xe6));var _0x8f95=function(_0x3a9488,_0x53f62d){_0x3a9488=_0x3a9488-0x0;var _0x3941e5=_0xf958[_0x3a9488];return _0x3941e5;};'use strict';var _=require(_0x8f95('0x0'));var util=require('util');var moment=require(_0x8f95('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f95('0x3'))['db'];var utils=require(_0x8f95('0x4'));var logger=require(_0x8f95('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f95('0x6'));var client=jayson[_0x8f95('0x7')][_0x8f95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c2af8,_0x5cfc04,_0x1ae9c4){return new BPromise(function(_0x109bed,_0x435b5b){return client[_0x8f95('0x9')](_0x5c2af8,_0x1ae9c4)[_0x8f95('0xa')](function(_0x585025){logger[_0x8f95('0xb')](_0x8f95('0xc'),_0x5cfc04,'request\x20sent');logger[_0x8f95('0xd')](_0x8f95('0xe'),_0x5cfc04,_0x8f95('0xf'),JSON['stringify'](_0x585025));if(_0x585025[_0x8f95('0x10')]){if(_0x585025[_0x8f95('0x10')][_0x8f95('0x11')]===0x1f4){logger['error'](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x435b5b(_0x585025['error'][_0x8f95('0x12')]);}logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x109bed(_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x5cfc04,'request\x20sent');_0x109bed(_0x585025['result']['message']);}})[_0x8f95('0x13')](function(_0x2f01cd){logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x2f01cd);_0x435b5b(_0x2f01cd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 0e70ba2..bba4157 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 _0x8fcd=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','show','post','create','multer','util','path','connect-timeout'];(function(_0x252812,_0x311bee){var _0x10a659=function(_0x38e2de){while(--_0x38e2de){_0x252812['push'](_0x252812['shift']());}};_0x10a659(++_0x311bee);}(_0x8fcd,0xa1));var _0xd8fc=function(_0xb4fd1,_0x42375f){_0xb4fd1=_0xb4fd1-0x0;var _0xf69a8c=_0x8fcd[_0xb4fd1];return _0xf69a8c;};'use strict';var multer=require(_0xd8fc('0x0'));var util=require(_0xd8fc('0x1'));var path=require(_0xd8fc('0x2'));var timeout=require(_0xd8fc('0x3'));var express=require(_0xd8fc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd8fc('0x5'));var interaction=require(_0xd8fc('0x6'));var config=require(_0xd8fc('0x7'));var controller=require(_0xd8fc('0x8'));router[_0xd8fc('0x9')]('/',auth[_0xd8fc('0xa')](),controller['index']);router['get'](_0xd8fc('0xb'),auth['isAuthenticated'](),controller[_0xd8fc('0xc')]);router[_0xd8fc('0xd')]('/',auth[_0xd8fc('0xa')](),controller[_0xd8fc('0xe')]);router['put']('/:id',auth[_0xd8fc('0xa')](),controller['update']);router['delete'](_0xd8fc('0xb'),auth[_0xd8fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x644f=['create','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x644f,0xc2));var _0xf644=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x644f[_0x381379];return _0x3e1063;};'use strict';var multer=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf644('0x2'));var router=express[_0xf644('0x3')]();var fs_extra=require(_0xf644('0x4'));var auth=require(_0xf644('0x5'));var interaction=require(_0xf644('0x6'));var config=require(_0xf644('0x7'));var controller=require(_0xf644('0x8'));router[_0xf644('0x9')]('/',auth[_0xf644('0xa')](),controller[_0xf644('0xb')]);router[_0xf644('0x9')](_0xf644('0xc'),auth['isAuthenticated'](),controller[_0xf644('0xd')]);router[_0xf644('0xe')]('/',auth['isAuthenticated'](),controller[_0xf644('0xf')]);router['put']('/:id',auth[_0xf644('0xa')](),controller['update']);router[_0xf644('0x10')](_0xf644('0xc'),auth['isAuthenticated'](),controller[_0xf644('0x11')]);module[_0xf644('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 4088f0c..374ab87 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 _0x8423=['STRING','sequelize','exports','ENUM','externip','turn'];(function(_0x48f79a,_0x3d329c){var _0x45bbd4=function(_0x25091e){while(--_0x25091e){_0x48f79a['push'](_0x48f79a['shift']());}};_0x45bbd4(++_0x3d329c);}(_0x8423,0x73));var _0x3842=function(_0x16aeb2,_0x4644da){_0x16aeb2=_0x16aeb2-0x0;var _0xa031f7=_0x8423[_0x16aeb2];return _0xa031f7;};'use strict';var Sequelize=require(_0x3842('0x0'));module[_0x3842('0x1')]={'type':{'type':Sequelize[_0x3842('0x2')]('localnet',_0x3842('0x3'),'stun',_0x3842('0x4'))},'value':{'type':Sequelize[_0x3842('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3842('0x5')]}}; \ No newline at end of file +var _0x21f0=['turn','STRING','exports','localnet','externip'];(function(_0xe7d07d,_0x52e4e3){var _0x229e46=function(_0x376839){while(--_0x376839){_0xe7d07d['push'](_0xe7d07d['shift']());}};_0x229e46(++_0x52e4e3);}(_0x21f0,0xe8));var _0x021f=function(_0x4d6b35,_0x5c3298){_0x4d6b35=_0x4d6b35-0x0;var _0x2fe76a=_0x21f0[_0x4d6b35];return _0x2fe76a;};'use strict';var Sequelize=require('sequelize');module[_0x021f('0x0')]={'type':{'type':Sequelize['ENUM'](_0x021f('0x1'),_0x021f('0x2'),'stun',_0x021f('0x3'))},'value':{'type':Sequelize[_0x021f('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x021f('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d0fc777..2fcf0d8 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 _0xda17=['type','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','readFileSync','server/files/templates/network.ejs','format','Reload','STUN','/etc/asterisk/stun_xcally.conf','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','status','set','update','destroy','end','sendStatus','stack','name','send','index','map','Network'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xda17,0x1d4));var _0x7da1=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xda17[_0x5c351c];return _0x26f3b3;};'use strict';var util=require(_0x7da1('0x0'));var path=require(_0x7da1('0x1'));var ejs=require(_0x7da1('0x2'));var fs=require('fs');var _=require(_0x7da1('0x3'));var qs=require(_0x7da1('0x4'));var logger=require(_0x7da1('0x5'))(_0x7da1('0x6'));var config=require('../../config/environment');var db=require(_0x7da1('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x542fb1,_0x5383c2,_0x254b07,_0x224fc9){return new Promise(function(_0x14e7b4,_0x1f9227){var _0x3f36ad=_0x224fc9||client;return _0x3f36ad[_0x7da1('0x8')](_0x542fb1,_0x254b07)[_0x7da1('0x9')](function(_0x1b444d){logger['info'](_0x7da1('0xa'),_0x5383c2,_0x7da1('0xb'));logger[_0x7da1('0xc')]('Network,\x20%s,\x20%s,\x20%s',_0x5383c2,_0x7da1('0xb'),JSON[_0x7da1('0xd')](_0x1b444d));if(_0x1b444d[_0x7da1('0xe')]){if(_0x1b444d[_0x7da1('0xe')][_0x7da1('0xf')]===0x1f4){logger[_0x7da1('0xe')](_0x7da1('0xa'),_0x5383c2,_0x1b444d['error'][_0x7da1('0x10')]);return _0x1f9227(_0x1b444d[_0x7da1('0xe')][_0x7da1('0x10')]);}logger['error'](_0x7da1('0xa'),_0x5383c2,_0x1b444d['error'][_0x7da1('0x10')]);return _0x14e7b4(_0x1b444d[_0x7da1('0xe')][_0x7da1('0x10')]);}else{logger['info'](_0x7da1('0xa'),_0x5383c2,_0x7da1('0xb'));_0x14e7b4(_0x1b444d[_0x7da1('0x11')][_0x7da1('0x10')]);}})[_0x7da1('0x12')](function(_0x3817fc){logger[_0x7da1('0xe')](_0x7da1('0xa'),_0x5383c2,_0x3817fc);_0x1f9227(_0x3817fc);});});}function respondWithResult(_0x242fc1,_0x1f639e){_0x1f639e=_0x1f639e||0xc8;return function(_0x56d611){if(_0x56d611){return _0x242fc1['status'](_0x1f639e)[_0x7da1('0x13')](_0x56d611);}};}function respondWithFilteredResult(_0x408b05,_0xba252){return function(_0x5b8a6a){if(_0x5b8a6a){var _0x1292ec=typeof _0xba252[_0x7da1('0x14')]===_0x7da1('0x15')&&typeof _0xba252[_0x7da1('0x16')]===_0x7da1('0x15');var _0x4bc51d=_0x5b8a6a[_0x7da1('0x17')];var _0x13e1f8=_0x1292ec?0x0:_0xba252[_0x7da1('0x14')];var _0xc9cfe0=_0x1292ec?_0x5b8a6a[_0x7da1('0x17')]:_0xba252[_0x7da1('0x14')]+_0xba252[_0x7da1('0x16')];var _0x3290aa;if(_0xc9cfe0>=_0x4bc51d){_0xc9cfe0=_0x4bc51d;_0x3290aa=0xc8;}else{_0x3290aa=0xce;}_0x408b05[_0x7da1('0x18')](_0x3290aa);return _0x408b05[_0x7da1('0x19')]('Content-Range',_0x13e1f8+'-'+_0xc9cfe0+'/'+_0x4bc51d)['json'](_0x5b8a6a);}return null;};}function saveUpdates(_0x22587a){return function(_0x13109a){if(_0x13109a){return _0x13109a[_0x7da1('0x1a')](_0x22587a)[_0x7da1('0x9')](function(_0x53290a){return _0x53290a;});}return null;};}function removeEntity(_0x50e1b9){return function(_0x3f2989){if(_0x3f2989){return _0x3f2989[_0x7da1('0x1b')]()[_0x7da1('0x9')](function(){_0x50e1b9[_0x7da1('0x18')](0xcc)[_0x7da1('0x1c')]();});}};}function handleEntityNotFound(_0x30ae7a){return function(_0x2d635e){if(!_0x2d635e){_0x30ae7a[_0x7da1('0x1d')](0x194);}return _0x2d635e;};}function handleError(_0x58d6fe,_0x68d12d){_0x68d12d=_0x68d12d||0x1f4;return function(_0x5cd82d){logger['error'](_0x5cd82d[_0x7da1('0x1e')]);if(_0x5cd82d[_0x7da1('0x1f')]){delete _0x5cd82d['name'];}_0x58d6fe[_0x7da1('0x18')](_0x68d12d)[_0x7da1('0x20')](_0x5cd82d);};}exports[_0x7da1('0x21')]=function(_0x1b88a6,_0x48d538){var _0x4fdf62={},_0x2233a0={},_0x2f6962={'count':0x0,'rows':[]};var _0x3ad005=_[_0x7da1('0x22')](db[_0x7da1('0x23')]['rawAttributes'],function(_0x4254e2){return{'name':_0x4254e2['fieldName'],'type':_0x4254e2[_0x7da1('0x24')]['key']};});_0x2233a0['model']=_['map'](_0x3ad005,'name');_0x2233a0[_0x7da1('0x25')]=_[_0x7da1('0x26')](_0x1b88a6['query']);_0x2233a0['filters']=_['intersection'](_0x2233a0[_0x7da1('0x27')],_0x2233a0[_0x7da1('0x25')]);_0x4fdf62[_0x7da1('0x28')]=_[_0x7da1('0x29')](_0x2233a0['model'],qs[_0x7da1('0x2a')](_0x1b88a6['query'][_0x7da1('0x2a')]));_0x4fdf62[_0x7da1('0x28')]=_0x4fdf62[_0x7da1('0x28')]['length']?_0x4fdf62[_0x7da1('0x28')]:_0x2233a0[_0x7da1('0x27')];if(!_0x1b88a6[_0x7da1('0x25')][_0x7da1('0x2b')](_0x7da1('0x2c'))){_0x4fdf62['limit']=qs[_0x7da1('0x16')](_0x1b88a6['query'][_0x7da1('0x16')]);_0x4fdf62[_0x7da1('0x14')]=qs[_0x7da1('0x14')](_0x1b88a6[_0x7da1('0x25')][_0x7da1('0x14')]);}_0x4fdf62[_0x7da1('0x2d')]=qs['sort'](_0x1b88a6[_0x7da1('0x25')][_0x7da1('0x2e')]);_0x4fdf62[_0x7da1('0x2f')]=qs[_0x7da1('0x30')](_[_0x7da1('0x31')](_0x1b88a6[_0x7da1('0x25')],_0x2233a0['filters']),_0x3ad005);if(_0x1b88a6['query'][_0x7da1('0x32')]){_0x4fdf62[_0x7da1('0x2f')]=_[_0x7da1('0x33')](_0x4fdf62[_0x7da1('0x2f')],{'$or':_[_0x7da1('0x22')](_0x3ad005,function(_0x587a40){if(_0x587a40[_0x7da1('0x24')]!==_0x7da1('0x34')){var _0x3253a5={};_0x3253a5[_0x587a40[_0x7da1('0x1f')]]={'$like':'%'+_0x1b88a6[_0x7da1('0x25')][_0x7da1('0x32')]+'%'};return _0x3253a5;}})});}_0x4fdf62=_['merge']({},_0x4fdf62,_0x1b88a6[_0x7da1('0x35')]);var _0x540c9e={'where':_0x4fdf62['where']};return db[_0x7da1('0x23')]['count'](_0x540c9e)[_0x7da1('0x9')](function(_0x16305b){_0x2f6962[_0x7da1('0x17')]=_0x16305b;if(_0x1b88a6['query'][_0x7da1('0x36')]){_0x4fdf62['include']=[{'all':!![]}];}return db[_0x7da1('0x23')][_0x7da1('0x37')](_0x4fdf62);})[_0x7da1('0x9')](function(_0x20d8de){_0x2f6962[_0x7da1('0x38')]=_0x20d8de;return _0x2f6962;})[_0x7da1('0x9')](respondWithFilteredResult(_0x48d538,_0x4fdf62))['catch'](handleError(_0x48d538,null));};exports[_0x7da1('0x39')]=function(_0x51e870,_0x1fbb19){var _0xeeedaa={'raw':!![],'where':{'id':_0x51e870[_0x7da1('0x3a')]['id']}},_0x257cb0={};_0x257cb0['model']=_[_0x7da1('0x26')](db['Network'][_0x7da1('0x3b')]);_0x257cb0[_0x7da1('0x25')]=_[_0x7da1('0x26')](_0x51e870['query']);_0x257cb0['filters']=_[_0x7da1('0x29')](_0x257cb0['model'],_0x257cb0[_0x7da1('0x25')]);_0xeeedaa['attributes']=_[_0x7da1('0x29')](_0x257cb0[_0x7da1('0x27')],qs['fields'](_0x51e870['query'][_0x7da1('0x2a')]));_0xeeedaa[_0x7da1('0x28')]=_0xeeedaa[_0x7da1('0x28')]['length']?_0xeeedaa[_0x7da1('0x28')]:_0x257cb0[_0x7da1('0x27')];if(_0x51e870['query'][_0x7da1('0x36')]){_0xeeedaa[_0x7da1('0x3c')]=[{'all':!![]}];}_0xeeedaa=_[_0x7da1('0x33')]({},_0xeeedaa,_0x51e870['options']);return db[_0x7da1('0x23')][_0x7da1('0x3d')](_0xeeedaa)[_0x7da1('0x9')](handleEntityNotFound(_0x1fbb19,null))[_0x7da1('0x9')](respondWithResult(_0x1fbb19,null))[_0x7da1('0x12')](handleError(_0x1fbb19,null));};exports[_0x7da1('0x3e')]=function(_0x3eea04,_0x8ff6d9){var _0x1273c8;return db[_0x7da1('0x23')]['create'](_0x3eea04[_0x7da1('0x3f')],{'raw':!![]})[_0x7da1('0x9')](function(_0x28196d){_0x1273c8=_0x28196d;return db[_0x7da1('0x23')][_0x7da1('0x37')]({'where':{'type':_0x3eea04['body'][_0x7da1('0x24')]},'raw':!![]});})['then'](function(_0x11517a){if(_0x1273c8[_0x7da1('0x24')]['toUpperCase']()=='STUN'){var _0x35bf91=fs['readFileSync'](path[_0x7da1('0x40')](config[_0x7da1('0x41')],_0x7da1('0x42')),'utf8');var _0x55650e=ejs[_0x7da1('0x43')](_0x35bf91,{'networks':_0x11517a||[]});fs[_0x7da1('0x44')]('/etc/asterisk/stun_xcally.conf',_0x55650e);return respondWithRpcPromise('Reload',_0x7da1('0x3e'),{'module':_0x7da1('0x45')});}else if(_0x1273c8[_0x7da1('0x24')][_0x7da1('0x46')]()==_0x7da1('0x47')){var _0x283b84=fs['readFileSync'](path['join'](config[_0x7da1('0x41')],_0x7da1('0x48')),_0x7da1('0x49'));var _0x45d5ae=ejs[_0x7da1('0x43')](_0x283b84,{'networks':_0x11517a||[]});fs['writeFileSync'](_0x7da1('0x4a'),_0x45d5ae);return respondWithRpcPromise('Reload',_0x7da1('0x3e'),{'module':'res_stun_monitor.so'});}else{var _0x17b6fe=fs[_0x7da1('0x4b')](path[_0x7da1('0x40')](config[_0x7da1('0x41')],_0x7da1('0x4c')),'utf8');var _0x422871=ejs[_0x7da1('0x43')](_0x17b6fe,{'networks':_0x11517a||[]});fs[_0x7da1('0x44')](util[_0x7da1('0x4d')]('/etc/asterisk/sip_xcally_%s.conf',_0x3eea04['body'][_0x7da1('0x24')]['toLowerCase']()),_0x422871);return respondWithRpcPromise(_0x7da1('0x4e'),_0x7da1('0x3e'),{'module':'chan_sip.so'});}})[_0x7da1('0x9')](function(){return _0x1273c8;})[_0x7da1('0x9')](respondWithResult(_0x8ff6d9,0xc9))[_0x7da1('0x12')](handleError(_0x8ff6d9,null));};exports[_0x7da1('0x1a')]=function(_0x4591ad,_0x1f9e21){var _0x547eaa;return db[_0x7da1('0x23')][_0x7da1('0x3d')]({'where':{'id':_0x4591ad[_0x7da1('0x3a')]['id']}})[_0x7da1('0x9')](handleEntityNotFound(_0x1f9e21,null))[_0x7da1('0x9')](saveUpdates(_0x4591ad['body'],null))[_0x7da1('0x9')](function(_0xf17d30){if(_0xf17d30){_0x547eaa=_0xf17d30;return db['Network'][_0x7da1('0x37')]({'where':{'type':_0x547eaa['type']},'raw':!![]});}return null;})[_0x7da1('0x9')](function(_0x3e2c14){if(_0x547eaa[_0x7da1('0x24')][_0x7da1('0x46')]()==_0x7da1('0x4f')){var _0x1fc0d6=fs[_0x7da1('0x4b')](path[_0x7da1('0x40')](config[_0x7da1('0x41')],_0x7da1('0x42')),_0x7da1('0x49'));var _0x199e64=ejs[_0x7da1('0x43')](_0x1fc0d6,{'networks':_0x3e2c14||[]});fs['writeFileSync'](_0x7da1('0x50'),_0x199e64);return respondWithRpcPromise(_0x7da1('0x4e'),'update',{'module':'res_stun_monitor.so'});}else if(_0x547eaa[_0x7da1('0x24')]['toUpperCase']()==_0x7da1('0x47')){var _0x576315=fs[_0x7da1('0x4b')](path[_0x7da1('0x40')](config[_0x7da1('0x41')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xf31d10=ejs[_0x7da1('0x43')](_0x576315,{'networks':_0x3e2c14||[]});fs[_0x7da1('0x44')](_0x7da1('0x4a'),_0xf31d10);return respondWithRpcPromise(_0x7da1('0x4e'),'update',{'module':_0x7da1('0x45')});}else{var _0x54dfba=fs['readFileSync'](path['join'](config['root'],_0x7da1('0x4c')),_0x7da1('0x49'));var _0x173dae=ejs[_0x7da1('0x43')](_0x54dfba,{'networks':_0x3e2c14||[]});fs[_0x7da1('0x44')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4591ad[_0x7da1('0x3f')][_0x7da1('0x24')]['toLowerCase']()),_0x173dae);return respondWithRpcPromise('Reload',_0x7da1('0x1a'),{'module':_0x7da1('0x51')});}})[_0x7da1('0x9')](function(_0x70be4){if(_0x70be4){return _0x547eaa;}return null;})[_0x7da1('0x9')](respondWithResult(_0x1f9e21,null))[_0x7da1('0x12')](handleError(_0x1f9e21,null));};exports[_0x7da1('0x1b')]=function(_0x140b94,_0x26155){var _0x27d31d;return db[_0x7da1('0x23')][_0x7da1('0x3d')]({'where':{'id':_0x140b94[_0x7da1('0x3a')]['id']}})['then'](function(_0xec7a22){_0x27d31d=_0xec7a22;return _0xec7a22;})[_0x7da1('0x9')](handleEntityNotFound(_0x26155,null))[_0x7da1('0x9')](removeEntity(_0x26155,null))[_0x7da1('0x9')](function(){if(_0x27d31d){return db['Network'][_0x7da1('0x37')]({'where':{'type':_0x27d31d[_0x7da1('0x24')]},'raw':!![]});}})[_0x7da1('0x9')](function(_0x52dcb4){if(_0x27d31d[_0x7da1('0x24')][_0x7da1('0x46')]()=='STUN'){var _0xef459e=fs[_0x7da1('0x4b')](path[_0x7da1('0x40')](config[_0x7da1('0x41')],_0x7da1('0x42')),_0x7da1('0x49'));var _0x3931db=ejs[_0x7da1('0x43')](_0xef459e,{'networks':_0x52dcb4||[]});fs[_0x7da1('0x44')](_0x7da1('0x50'),_0x3931db);return respondWithRpcPromise('Reload',_0x7da1('0x1b'),{'module':_0x7da1('0x45')});}else if(_0x27d31d[_0x7da1('0x24')][_0x7da1('0x46')]()=='TURN'){var _0x46395f=fs[_0x7da1('0x4b')](path['join'](config[_0x7da1('0x41')],_0x7da1('0x48')),_0x7da1('0x49'));var _0x121118=ejs[_0x7da1('0x43')](_0x46395f,{'networks':_0x52dcb4||[]});fs[_0x7da1('0x44')](_0x7da1('0x4a'),_0x121118);return respondWithRpcPromise(_0x7da1('0x4e'),_0x7da1('0x1b'),{'module':_0x7da1('0x45')});}else{var _0x390d65=fs['readFileSync'](path[_0x7da1('0x40')](config[_0x7da1('0x41')],_0x7da1('0x4c')),'utf8');var _0x48af6c=ejs['render'](_0x390d65,{'networks':_0x52dcb4||[]});fs[_0x7da1('0x44')](util[_0x7da1('0x4d')](_0x7da1('0x52'),_0x27d31d[_0x7da1('0x24')][_0x7da1('0x53')]()),_0x48af6c);return respondWithRpcPromise(_0x7da1('0x4e'),'destroy',{'module':_0x7da1('0x51')});}})[_0x7da1('0x12')](handleError(_0x26155,null));}; \ No newline at end of file +var _0xdad9=['find','create','findAll','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','destroy','path','ejs','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','count','set','Content-Range','update','then','stack','name','send','map','Network','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params'];(function(_0x22f48d,_0x51b8e1){var _0x26ba9a=function(_0x5ee718){while(--_0x5ee718){_0x22f48d['push'](_0x22f48d['shift']());}};_0x26ba9a(++_0x51b8e1);}(_0xdad9,0x1a4));var _0x9dad=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdad9[_0x4565bf];return _0x5610ba;};'use strict';var util=require('util');var path=require(_0x9dad('0x0'));var ejs=require(_0x9dad('0x1'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x9dad('0x2'))('api');var config=require(_0x9dad('0x3'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x9dad('0x4')][_0x9dad('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x145e66,_0x2f88e2,_0x5e26ce,_0x31b842){return new Promise(function(_0x3867b3,_0x33025d){var _0x4b2506=_0x31b842||client;return _0x4b2506[_0x9dad('0x6')](_0x145e66,_0x5e26ce)['then'](function(_0x402ebf){logger[_0x9dad('0x7')]('Network,\x20%s,\x20%s',_0x2f88e2,_0x9dad('0x8'));logger[_0x9dad('0x9')](_0x9dad('0xa'),_0x2f88e2,_0x9dad('0x8'),JSON['stringify'](_0x402ebf));if(_0x402ebf[_0x9dad('0xb')]){if(_0x402ebf['error'][_0x9dad('0xc')]===0x1f4){logger[_0x9dad('0xb')](_0x9dad('0xd'),_0x2f88e2,_0x402ebf[_0x9dad('0xb')][_0x9dad('0xe')]);return _0x33025d(_0x402ebf['error'][_0x9dad('0xe')]);}logger[_0x9dad('0xb')]('Network,\x20%s,\x20%s',_0x2f88e2,_0x402ebf[_0x9dad('0xb')]['message']);return _0x3867b3(_0x402ebf[_0x9dad('0xb')]['message']);}else{logger[_0x9dad('0x7')](_0x9dad('0xd'),_0x2f88e2,_0x9dad('0x8'));_0x3867b3(_0x402ebf[_0x9dad('0xf')]['message']);}})[_0x9dad('0x10')](function(_0x1d7292){logger['error'](_0x9dad('0xd'),_0x2f88e2,_0x1d7292);_0x33025d(_0x1d7292);});});}function respondWithResult(_0x2471b5,_0x43e024){_0x43e024=_0x43e024||0xc8;return function(_0x1a03f0){if(_0x1a03f0){return _0x2471b5[_0x9dad('0x11')](_0x43e024)[_0x9dad('0x12')](_0x1a03f0);}};}function respondWithFilteredResult(_0x358bdd,_0x118599){return function(_0x1c8cdb){if(_0x1c8cdb){var _0x204aad=typeof _0x118599[_0x9dad('0x13')]==='undefined'&&typeof _0x118599[_0x9dad('0x14')]==='undefined';var _0x562cbd=_0x1c8cdb[_0x9dad('0x15')];var _0x539e0e=_0x204aad?0x0:_0x118599[_0x9dad('0x13')];var _0x4eeea9=_0x204aad?_0x1c8cdb['count']:_0x118599[_0x9dad('0x13')]+_0x118599['limit'];var _0x500930;if(_0x4eeea9>=_0x562cbd){_0x4eeea9=_0x562cbd;_0x500930=0xc8;}else{_0x500930=0xce;}_0x358bdd['status'](_0x500930);return _0x358bdd[_0x9dad('0x16')](_0x9dad('0x17'),_0x539e0e+'-'+_0x4eeea9+'/'+_0x562cbd)[_0x9dad('0x12')](_0x1c8cdb);}return null;};}function saveUpdates(_0x5ad3ba){return function(_0x429e4e){if(_0x429e4e){return _0x429e4e[_0x9dad('0x18')](_0x5ad3ba)[_0x9dad('0x19')](function(_0x2e43f4){return _0x2e43f4;});}return null;};}function removeEntity(_0xe09f64){return function(_0x5ac02a){if(_0x5ac02a){return _0x5ac02a['destroy']()[_0x9dad('0x19')](function(){_0xe09f64[_0x9dad('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x536ffa){return function(_0x5e93d6){if(!_0x5e93d6){_0x536ffa['sendStatus'](0x194);}return _0x5e93d6;};}function handleError(_0xec10ef,_0x930205){_0x930205=_0x930205||0x1f4;return function(_0x5c6d74){logger[_0x9dad('0xb')](_0x5c6d74[_0x9dad('0x1a')]);if(_0x5c6d74['name']){delete _0x5c6d74[_0x9dad('0x1b')];}_0xec10ef[_0x9dad('0x11')](_0x930205)[_0x9dad('0x1c')](_0x5c6d74);};}exports['index']=function(_0x5d16ef,_0x11b0fb){var _0x2fbfe5={},_0x39285f={},_0x425283={'count':0x0,'rows':[]};var _0x4cc43b=_[_0x9dad('0x1d')](db[_0x9dad('0x1e')][_0x9dad('0x1f')],function(_0x4bbd76){return{'name':_0x4bbd76['fieldName'],'type':_0x4bbd76[_0x9dad('0x20')]['key']};});_0x39285f[_0x9dad('0x21')]=_[_0x9dad('0x1d')](_0x4cc43b,'name');_0x39285f['query']=_['keys'](_0x5d16ef[_0x9dad('0x22')]);_0x39285f['filters']=_['intersection'](_0x39285f[_0x9dad('0x21')],_0x39285f[_0x9dad('0x22')]);_0x2fbfe5[_0x9dad('0x23')]=_[_0x9dad('0x24')](_0x39285f[_0x9dad('0x21')],qs[_0x9dad('0x25')](_0x5d16ef[_0x9dad('0x22')][_0x9dad('0x25')]));_0x2fbfe5['attributes']=_0x2fbfe5[_0x9dad('0x23')][_0x9dad('0x26')]?_0x2fbfe5[_0x9dad('0x23')]:_0x39285f[_0x9dad('0x21')];if(!_0x5d16ef[_0x9dad('0x22')][_0x9dad('0x27')](_0x9dad('0x28'))){_0x2fbfe5['limit']=qs['limit'](_0x5d16ef[_0x9dad('0x22')][_0x9dad('0x14')]);_0x2fbfe5[_0x9dad('0x13')]=qs[_0x9dad('0x13')](_0x5d16ef[_0x9dad('0x22')][_0x9dad('0x13')]);}_0x2fbfe5[_0x9dad('0x29')]=qs[_0x9dad('0x2a')](_0x5d16ef['query'][_0x9dad('0x2a')]);_0x2fbfe5[_0x9dad('0x2b')]=qs[_0x9dad('0x2c')](_[_0x9dad('0x2d')](_0x5d16ef[_0x9dad('0x22')],_0x39285f['filters']),_0x4cc43b);if(_0x5d16ef[_0x9dad('0x22')][_0x9dad('0x2e')]){_0x2fbfe5[_0x9dad('0x2b')]=_[_0x9dad('0x2f')](_0x2fbfe5[_0x9dad('0x2b')],{'$or':_[_0x9dad('0x1d')](_0x4cc43b,function(_0x16d0b5){if(_0x16d0b5[_0x9dad('0x20')]!==_0x9dad('0x30')){var _0x18d3c9={};_0x18d3c9[_0x16d0b5['name']]={'$like':'%'+_0x5d16ef['query'][_0x9dad('0x2e')]+'%'};return _0x18d3c9;}})});}_0x2fbfe5=_[_0x9dad('0x2f')]({},_0x2fbfe5,_0x5d16ef['options']);var _0x189333={'where':_0x2fbfe5[_0x9dad('0x2b')]};return db[_0x9dad('0x1e')][_0x9dad('0x15')](_0x189333)['then'](function(_0x22d28a){_0x425283[_0x9dad('0x15')]=_0x22d28a;if(_0x5d16ef[_0x9dad('0x22')][_0x9dad('0x31')]){_0x2fbfe5[_0x9dad('0x32')]=[{'all':!![]}];}return db[_0x9dad('0x1e')]['findAll'](_0x2fbfe5);})[_0x9dad('0x19')](function(_0x25dbed){_0x425283[_0x9dad('0x33')]=_0x25dbed;return _0x425283;})[_0x9dad('0x19')](respondWithFilteredResult(_0x11b0fb,_0x2fbfe5))[_0x9dad('0x10')](handleError(_0x11b0fb,null));};exports[_0x9dad('0x34')]=function(_0x118d22,_0x1d4929){var _0x185215={'raw':!![],'where':{'id':_0x118d22[_0x9dad('0x35')]['id']}},_0x51a910={};_0x51a910[_0x9dad('0x21')]=_['keys'](db[_0x9dad('0x1e')]['rawAttributes']);_0x51a910[_0x9dad('0x22')]=_['keys'](_0x118d22['query']);_0x51a910[_0x9dad('0x2c')]=_[_0x9dad('0x24')](_0x51a910[_0x9dad('0x21')],_0x51a910['query']);_0x185215[_0x9dad('0x23')]=_[_0x9dad('0x24')](_0x51a910['model'],qs[_0x9dad('0x25')](_0x118d22[_0x9dad('0x22')][_0x9dad('0x25')]));_0x185215[_0x9dad('0x23')]=_0x185215[_0x9dad('0x23')][_0x9dad('0x26')]?_0x185215[_0x9dad('0x23')]:_0x51a910['model'];if(_0x118d22[_0x9dad('0x22')][_0x9dad('0x31')]){_0x185215[_0x9dad('0x32')]=[{'all':!![]}];}_0x185215=_[_0x9dad('0x2f')]({},_0x185215,_0x118d22['options']);return db[_0x9dad('0x1e')][_0x9dad('0x36')](_0x185215)[_0x9dad('0x19')](handleEntityNotFound(_0x1d4929,null))[_0x9dad('0x19')](respondWithResult(_0x1d4929,null))[_0x9dad('0x10')](handleError(_0x1d4929,null));};exports[_0x9dad('0x37')]=function(_0x5d5770,_0x5505d3){var _0x291dad;return db[_0x9dad('0x1e')][_0x9dad('0x37')](_0x5d5770['body'],{'raw':!![]})[_0x9dad('0x19')](function(_0x12790c){_0x291dad=_0x12790c;return db['Network'][_0x9dad('0x38')]({'where':{'type':_0x5d5770[_0x9dad('0x39')][_0x9dad('0x20')]},'raw':!![]});})['then'](function(_0x3c042b){if(_0x291dad[_0x9dad('0x20')][_0x9dad('0x3a')]()==_0x9dad('0x3b')){var _0x18b041=fs[_0x9dad('0x3c')](path['join'](config[_0x9dad('0x3d')],_0x9dad('0x3e')),_0x9dad('0x3f'));var _0x3658a7=ejs[_0x9dad('0x40')](_0x18b041,{'networks':_0x3c042b||[]});fs['writeFileSync'](_0x9dad('0x41'),_0x3658a7);return respondWithRpcPromise('Reload','create',{'module':_0x9dad('0x42')});}else if(_0x291dad[_0x9dad('0x20')][_0x9dad('0x3a')]()==_0x9dad('0x43')){var _0x37aafb=fs[_0x9dad('0x3c')](path[_0x9dad('0x44')](config[_0x9dad('0x3d')],_0x9dad('0x45')),'utf8');var _0x4cc346=ejs[_0x9dad('0x40')](_0x37aafb,{'networks':_0x3c042b||[]});fs[_0x9dad('0x46')](_0x9dad('0x47'),_0x4cc346);return respondWithRpcPromise(_0x9dad('0x48'),_0x9dad('0x37'),{'module':_0x9dad('0x42')});}else{var _0x2f31cc=fs[_0x9dad('0x3c')](path[_0x9dad('0x44')](config[_0x9dad('0x3d')],_0x9dad('0x49')),_0x9dad('0x3f'));var _0xd13f3b=ejs[_0x9dad('0x40')](_0x2f31cc,{'networks':_0x3c042b||[]});fs['writeFileSync'](util[_0x9dad('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x5d5770[_0x9dad('0x39')][_0x9dad('0x20')][_0x9dad('0x4b')]()),_0xd13f3b);return respondWithRpcPromise(_0x9dad('0x48'),'create',{'module':_0x9dad('0x4c')});}})[_0x9dad('0x19')](function(){return _0x291dad;})[_0x9dad('0x19')](respondWithResult(_0x5505d3,0xc9))['catch'](handleError(_0x5505d3,null));};exports[_0x9dad('0x18')]=function(_0xa35cfd,_0x482a63){var _0x15b8b2;return db[_0x9dad('0x1e')][_0x9dad('0x36')]({'where':{'id':_0xa35cfd['params']['id']}})[_0x9dad('0x19')](handleEntityNotFound(_0x482a63,null))[_0x9dad('0x19')](saveUpdates(_0xa35cfd[_0x9dad('0x39')],null))['then'](function(_0x1c1bae){if(_0x1c1bae){_0x15b8b2=_0x1c1bae;return db[_0x9dad('0x1e')]['findAll']({'where':{'type':_0x15b8b2[_0x9dad('0x20')]},'raw':!![]});}return null;})[_0x9dad('0x19')](function(_0x423629){if(_0x15b8b2[_0x9dad('0x20')][_0x9dad('0x3a')]()==_0x9dad('0x3b')){var _0x31f5f6=fs[_0x9dad('0x3c')](path[_0x9dad('0x44')](config[_0x9dad('0x3d')],_0x9dad('0x3e')),_0x9dad('0x3f'));var _0x1dcae6=ejs[_0x9dad('0x40')](_0x31f5f6,{'networks':_0x423629||[]});fs[_0x9dad('0x46')](_0x9dad('0x41'),_0x1dcae6);return respondWithRpcPromise('Reload',_0x9dad('0x18'),{'module':_0x9dad('0x42')});}else if(_0x15b8b2[_0x9dad('0x20')]['toUpperCase']()==_0x9dad('0x43')){var _0x4d8c15=fs[_0x9dad('0x3c')](path[_0x9dad('0x44')](config['root'],_0x9dad('0x45')),'utf8');var _0x240fb7=ejs[_0x9dad('0x40')](_0x4d8c15,{'networks':_0x423629||[]});fs['writeFileSync'](_0x9dad('0x47'),_0x240fb7);return respondWithRpcPromise(_0x9dad('0x48'),_0x9dad('0x18'),{'module':_0x9dad('0x42')});}else{var _0x10f7c6=fs['readFileSync'](path[_0x9dad('0x44')](config['root'],'server/files/templates/network.ejs'),_0x9dad('0x3f'));var _0x30dacf=ejs[_0x9dad('0x40')](_0x10f7c6,{'networks':_0x423629||[]});fs[_0x9dad('0x46')](util[_0x9dad('0x4a')](_0x9dad('0x4d'),_0xa35cfd[_0x9dad('0x39')][_0x9dad('0x20')][_0x9dad('0x4b')]()),_0x30dacf);return respondWithRpcPromise(_0x9dad('0x48'),'update',{'module':_0x9dad('0x4c')});}})[_0x9dad('0x19')](function(_0x39e9c2){if(_0x39e9c2){return _0x15b8b2;}return null;})[_0x9dad('0x19')](respondWithResult(_0x482a63,null))[_0x9dad('0x10')](handleError(_0x482a63,null));};exports[_0x9dad('0x4e')]=function(_0x38058b,_0x21365c){var _0x1e0c14;return db['Network'][_0x9dad('0x36')]({'where':{'id':_0x38058b[_0x9dad('0x35')]['id']}})[_0x9dad('0x19')](function(_0x5ce58){_0x1e0c14=_0x5ce58;return _0x5ce58;})[_0x9dad('0x19')](handleEntityNotFound(_0x21365c,null))[_0x9dad('0x19')](removeEntity(_0x21365c,null))['then'](function(){if(_0x1e0c14){return db['Network'][_0x9dad('0x38')]({'where':{'type':_0x1e0c14[_0x9dad('0x20')]},'raw':!![]});}})[_0x9dad('0x19')](function(_0x2d2072){if(_0x1e0c14[_0x9dad('0x20')][_0x9dad('0x3a')]()=='STUN'){var _0x3ae2d1=fs['readFileSync'](path[_0x9dad('0x44')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x9dad('0x3f'));var _0x170022=ejs[_0x9dad('0x40')](_0x3ae2d1,{'networks':_0x2d2072||[]});fs['writeFileSync'](_0x9dad('0x41'),_0x170022);return respondWithRpcPromise(_0x9dad('0x48'),_0x9dad('0x4e'),{'module':_0x9dad('0x42')});}else if(_0x1e0c14['type'][_0x9dad('0x3a')]()==_0x9dad('0x43')){var _0x311fe5=fs[_0x9dad('0x3c')](path[_0x9dad('0x44')](config[_0x9dad('0x3d')],_0x9dad('0x45')),_0x9dad('0x3f'));var _0x94db7=ejs[_0x9dad('0x40')](_0x311fe5,{'networks':_0x2d2072||[]});fs[_0x9dad('0x46')](_0x9dad('0x47'),_0x94db7);return respondWithRpcPromise(_0x9dad('0x48'),_0x9dad('0x4e'),{'module':_0x9dad('0x42')});}else{var _0x222340=fs['readFileSync'](path[_0x9dad('0x44')](config['root'],_0x9dad('0x49')),_0x9dad('0x3f'));var _0x59e5c4=ejs[_0x9dad('0x40')](_0x222340,{'networks':_0x2d2072||[]});fs[_0x9dad('0x46')](util[_0x9dad('0x4a')](_0x9dad('0x4d'),_0x1e0c14[_0x9dad('0x20')][_0x9dad('0x4b')]()),_0x59e5c4);return respondWithRpcPromise(_0x9dad('0x48'),_0x9dad('0x4e'),{'module':_0x9dad('0x4c')});}})[_0x9dad('0x10')](handleError(_0x21365c,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8292237..71f05f9 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 _0xb332=['define','lodash','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x457846,_0x22b8f1){var _0x4e602f=function(_0x3bb4d7){while(--_0x3bb4d7){_0x457846['push'](_0x457846['shift']());}};_0x4e602f(++_0x22b8f1);}(_0xb332,0xd9));var _0x2b33=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xb332[_0x295314];return _0x584b0c;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var moment=require('moment');var BPromise=require(_0x2b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b33('0x4'));var rimraf=require('rimraf');var config=require(_0x2b33('0x5'));var attributes=require('./network.attributes');module[_0x2b33('0x6')]=function(_0x22d66,_0x478214){return _0x22d66[_0x2b33('0x7')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf72b=['./network.attributes','exports','define','Network','network','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2ff0f7,_0x57969a){var _0x5cff8a=function(_0x3ec104){while(--_0x3ec104){_0x2ff0f7['push'](_0x2ff0f7['shift']());}};_0x5cff8a(++_0x57969a);}(_0xf72b,0x1d9));var _0xbf72=function(_0x2d113e,_0x3589f0){_0x2d113e=_0x2d113e-0x0;var _0x3e8082=_0xf72b[_0x2d113e];return _0x3e8082;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var logger=require(_0xbf72('0x1'))('api');var moment=require(_0xbf72('0x2'));var BPromise=require(_0xbf72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf72('0x4'));var rimraf=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var attributes=require(_0xbf72('0x7'));module[_0xbf72('0x8')]=function(_0x2b8440,_0x5ee060){return _0x2b8440[_0xbf72('0x9')](_0xbf72('0xa'),attributes,{'tableName':_0xbf72('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 b57fa8f..85a46ae 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x1996d3,_0x4e1120){_0x1996d3=_0x1996d3-0x0;var _0x4bcb31=_0x7a54[_0x1996d3];return _0x4bcb31;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x2222bd,_0x4a5465){_0x2222bd=_0x2222bd-0x0;var _0x52cffa=_0x7a54[_0x2222bd];return _0x52cffa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f5c9556..30d238f 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 _0x55e1=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addAnswer','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated'];(function(_0x3a14ea,_0x1338f2){var _0x1939fb=function(_0x42b3ec){while(--_0x42b3ec){_0x3a14ea['push'](_0x3a14ea['shift']());}};_0x1939fb(++_0x1338f2);}(_0x55e1,0x116));var _0x155e=function(_0x4d40d8,_0x221cc2){_0x4d40d8=_0x4d40d8-0x0;var _0x39da4b=_0x55e1[_0x4d40d8];return _0x39da4b;};'use strict';var multer=require('multer');var util=require(_0x155e('0x0'));var path=require('path');var timeout=require(_0x155e('0x1'));var express=require(_0x155e('0x2'));var router=express[_0x155e('0x3')]();var fs_extra=require(_0x155e('0x4'));var auth=require(_0x155e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x155e('0x6'));var controller=require(_0x155e('0x7'));router[_0x155e('0x8')]('/',auth[_0x155e('0x9')](),controller['index']);router[_0x155e('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x155e('0xa')]);router['get'](_0x155e('0xb'),auth[_0x155e('0x9')](),controller[_0x155e('0xc')]);router[_0x155e('0x8')](_0x155e('0xd'),auth[_0x155e('0x9')](),controller[_0x155e('0xe')]);router[_0x155e('0x8')](_0x155e('0xf'),auth['isAuthenticated'](),controller[_0x155e('0x10')]);router[_0x155e('0x8')](_0x155e('0x11'),auth[_0x155e('0x9')](),controller['getApplications']);router[_0x155e('0x8')](_0x155e('0x12'),auth[_0x155e('0x9')](),controller[_0x155e('0x13')]);router[_0x155e('0x8')](_0x155e('0x14'),auth['isAuthenticated'](),controller[_0x155e('0x15')]);router[_0x155e('0x16')]('/',auth[_0x155e('0x9')](),controller['create']);router['post'](_0x155e('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x155e('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x155e('0x17')]);router['post']('/:id/notify',controller['notify']);router[_0x155e('0x16')]('/:id/applications',auth[_0x155e('0x9')](),controller[_0x155e('0x18')]);router[_0x155e('0x16')](_0x155e('0x14'),auth[_0x155e('0x9')](),controller['addAgents']);router[_0x155e('0x16')](_0x155e('0x19'),auth[_0x155e('0x9')](),controller[_0x155e('0x1a')]);router[_0x155e('0x1b')](_0x155e('0xb'),auth[_0x155e('0x9')](),controller[_0x155e('0x1c')]);router[_0x155e('0x1d')](_0x155e('0xb'),auth[_0x155e('0x9')](),controller[_0x155e('0x1e')]);router[_0x155e('0x1d')](_0x155e('0xd'),auth[_0x155e('0x9')](),controller[_0x155e('0x1f')]);router[_0x155e('0x1d')](_0x155e('0xf'),auth[_0x155e('0x9')](),controller['removeAnswers']);router[_0x155e('0x1d')](_0x155e('0x14'),auth[_0x155e('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xa701=['addDisposition','addAnswer','/:id/notify','addAgents','/:id/send','send','put','destroy','removeDispositions','removeAnswers','delete','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions'];(function(_0x36c072,_0x413a2c){var _0x40c93e=function(_0x3e5e1f){while(--_0x3e5e1f){_0x36c072['push'](_0x36c072['shift']());}};_0x40c93e(++_0x413a2c);}(_0xa701,0x17f));var _0x1a70=function(_0x2027a5,_0x24d744){_0x2027a5=_0x2027a5-0x0;var _0x537ee2=_0xa701[_0x2027a5];return _0x537ee2;};'use strict';var multer=require(_0x1a70('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1a70('0x1'));var express=require(_0x1a70('0x2'));var router=express[_0x1a70('0x3')]();var fs_extra=require(_0x1a70('0x4'));var auth=require(_0x1a70('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a70('0x6'));var controller=require(_0x1a70('0x7'));router[_0x1a70('0x8')]('/',auth[_0x1a70('0x9')](),controller['index']);router[_0x1a70('0x8')](_0x1a70('0xa'),auth[_0x1a70('0x9')](),controller[_0x1a70('0xb')]);router['get'](_0x1a70('0xc'),auth[_0x1a70('0x9')](),controller[_0x1a70('0xd')]);router[_0x1a70('0x8')]('/:id/dispositions',auth[_0x1a70('0x9')](),controller['getDispositions']);router[_0x1a70('0x8')](_0x1a70('0xe'),auth[_0x1a70('0x9')](),controller[_0x1a70('0xf')]);router[_0x1a70('0x8')](_0x1a70('0x10'),auth['isAuthenticated'](),controller[_0x1a70('0x11')]);router[_0x1a70('0x8')](_0x1a70('0x12'),auth['isAuthenticated'](),controller[_0x1a70('0x13')]);router[_0x1a70('0x8')](_0x1a70('0x14'),auth[_0x1a70('0x9')](),controller[_0x1a70('0x15')]);router[_0x1a70('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a70('0x16')](_0x1a70('0x17'),auth[_0x1a70('0x9')](),controller[_0x1a70('0x18')]);router[_0x1a70('0x16')](_0x1a70('0xe'),auth['isAuthenticated'](),controller[_0x1a70('0x19')]);router[_0x1a70('0x16')](_0x1a70('0x1a'),controller['notify']);router[_0x1a70('0x16')](_0x1a70('0x10'),auth[_0x1a70('0x9')](),controller['addApplications']);router[_0x1a70('0x16')](_0x1a70('0x14'),auth[_0x1a70('0x9')](),controller[_0x1a70('0x1b')]);router[_0x1a70('0x16')](_0x1a70('0x1c'),auth[_0x1a70('0x9')](),controller[_0x1a70('0x1d')]);router[_0x1a70('0x1e')](_0x1a70('0xc'),auth[_0x1a70('0x9')](),controller['update']);router['delete'](_0x1a70('0xc'),auth['isAuthenticated'](),controller[_0x1a70('0x1f')]);router['delete'](_0x1a70('0x17'),auth[_0x1a70('0x9')](),controller[_0x1a70('0x20')]);router['delete']('/:id/canned_answers',auth[_0x1a70('0x9')](),controller[_0x1a70('0x21')]);router[_0x1a70('0x22')](_0x1a70('0x14'),auth[_0x1a70('0x9')](),controller[_0x1a70('0x23')]);module[_0x1a70('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 69856df..1e32efd 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 _0x881c=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x4917fe,_0x34f0b6){var _0x2a7037=function(_0x150200){while(--_0x150200){_0x4917fe['push'](_0x4917fe['shift']());}};_0x2a7037(++_0x34f0b6);}(_0x881c,0x119));var _0xc881=function(_0x37ee0b,_0x577702){_0x37ee0b=_0x37ee0b-0x0;var _0x4558c7=_0x881c[_0x37ee0b];return _0x4558c7;};'use strict';var Sequelize=require(_0xc881('0x0'));var rs=require(_0xc881('0x1'));module[_0xc881('0x2')]={'name':{'type':Sequelize[_0xc881('0x3')],'unique':_0xc881('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xc881('0x3')]},'token':{'type':Sequelize[_0xc881('0x3')],'defaultValue':function(){return rs[_0xc881('0x5')]();}},'replyUri':{'type':Sequelize[_0xc881('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc881('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc881('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc881('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc881('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc881('0x3')]},'queueTransfer':{'type':Sequelize[_0xc881('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc881('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc881('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc881('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc881('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc881('0x7')],'defaultValue':![],'comment':_0xc881('0x9'),'set':function(_0x3a5f0a){if(!_0x3a5f0a)this[_0xc881('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc881('0xb'),_0x3a5f0a);}}}; \ No newline at end of file +var _0x9a0b=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','name','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'];(function(_0x6f6f7b,_0x2a216d){var _0x53ad2e=function(_0x20796a){while(--_0x20796a){_0x6f6f7b['push'](_0x6f6f7b['shift']());}};_0x53ad2e(++_0x2a216d);}(_0x9a0b,0x1f2));var _0xb9a0=function(_0xa60c7c,_0xc70f6b){_0xa60c7c=_0xa60c7c-0x0;var _0x409313=_0x9a0b[_0xa60c7c];return _0x409313;};'use strict';var Sequelize=require(_0xb9a0('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xb9a0('0x1')],'unique':_0xb9a0('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb9a0('0x1')]},'token':{'type':Sequelize[_0xb9a0('0x1')],'defaultValue':function(){return rs[_0xb9a0('0x3')]();}},'replyUri':{'type':Sequelize[_0xb9a0('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb9a0('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb9a0('0x4')],'defaultValue':function(){return _0xb9a0('0x5');}},'notificationSound':{'type':Sequelize[_0xb9a0('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb9a0('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb9a0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb9a0('0x1')]},'queueTransfer':{'type':Sequelize[_0xb9a0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb9a0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb9a0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb9a0('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xb9a0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb9a0('0x6')],'defaultValue':![],'comment':_0xb9a0('0x9'),'set':function(_0x2c6a5e){if(!_0x2c6a5e)this['setDataValue'](_0xb9a0('0xa'),null);this[_0xb9a0('0xb')](_0xb9a0('0xc'),_0x2c6a5e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1f731e7..d5422dc 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 _0xc30d=['merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','rawAttributes','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','firstName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','findOne','Contact','User','fullname','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x413b13,_0x4a25de){var _0x1cad2e=function(_0x757303){while(--_0x757303){_0x413b13['push'](_0x413b13['shift']());}};_0x1cad2e(++_0x4a25de);}(_0xc30d,0x6e));var _0xdc30=function(_0x2fba2b,_0x4977bf){_0x2fba2b=_0x2fba2b-0x0;var _0x438896=_0xc30d[_0x2fba2b];return _0x438896;};'use strict';var emlformat=require(_0xdc30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc30('0x1'));var jsonpatch=require(_0xdc30('0x2'));var rp=require(_0xdc30('0x3'));var moment=require(_0xdc30('0x4'));var BPromise=require(_0xdc30('0x5'));var Mustache=require('mustache');var util=require(_0xdc30('0x6'));var path=require('path');var sox=require(_0xdc30('0x7'));var csv=require(_0xdc30('0x8'));var ejs=require(_0xdc30('0x9'));var fs=require('fs');var fs_extra=require(_0xdc30('0xa'));var _=require(_0xdc30('0xb'));var squel=require(_0xdc30('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc30('0xd'));var deskjs=require(_0xdc30('0xe'));var toCsv=require(_0xdc30('0x8'));var querystring=require(_0xdc30('0xf'));var Papa=require(_0xdc30('0x10'));var Redis=require(_0xdc30('0x11'));var authService=require(_0xdc30('0x12'));var qs=require(_0xdc30('0x13'));var as=require(_0xdc30('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdc30('0x15'));var config=require(_0xdc30('0x16'));var licenseUtil=require(_0xdc30('0x17'));var db=require(_0xdc30('0x18'))['db'];config[_0xdc30('0x19')]=_[_0xdc30('0x1a')](config[_0xdc30('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc30('0x1b'))(new Redis(config[_0xdc30('0x19')]));require(_0xdc30('0x1c'))[_0xdc30('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdc30('0x1e')][_0xdc30('0x1f')]({'port':0x232c});var client9002=jayson[_0xdc30('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21e3f1,_0x160404,_0x3a3cb5,_0x36cc43){return new BPromise(function(_0x358251,_0xc88c27){var _0x37d9bb=_0x36cc43||client;return _0x37d9bb['request'](_0x21e3f1,_0x3a3cb5)[_0xdc30('0x20')](function(_0x158bfc){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x160404,_0xdc30('0x21'));logger[_0xdc30('0x22')](_0xdc30('0x23'),_0x160404,_0xdc30('0x21'),JSON[_0xdc30('0x24')](_0x158bfc));if(_0x158bfc[_0xdc30('0x25')]){if(_0x158bfc[_0xdc30('0x25')][_0xdc30('0x26')]===0x1f4){logger[_0xdc30('0x25')](_0xdc30('0x27'),_0x160404,_0x158bfc[_0xdc30('0x25')][_0xdc30('0x28')]);return _0xc88c27(_0x158bfc[_0xdc30('0x25')][_0xdc30('0x28')]);}logger[_0xdc30('0x25')](_0xdc30('0x27'),_0x160404,_0x158bfc['error'][_0xdc30('0x28')]);return _0x358251(_0x158bfc['error']['message']);}else{logger[_0xdc30('0x29')](_0xdc30('0x27'),_0x160404,_0xdc30('0x21'));_0x358251(_0x158bfc['result'][_0xdc30('0x28')]);}})[_0xdc30('0x2a')](function(_0x4fdafc){logger[_0xdc30('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x160404,_0x4fdafc);_0xc88c27(_0x4fdafc);});});}function respondWithStatusCode(_0x4726d1,_0x4c0725){_0x4c0725=_0x4c0725||0xcc;return function(_0x2c1af3){if(_0x2c1af3){return _0x4726d1[_0xdc30('0x2b')](_0x4c0725);}return _0x4726d1[_0xdc30('0x2c')](_0x4c0725)['end']();};}function respondWithResult(_0x590f58,_0x7c310e){_0x7c310e=_0x7c310e||0xc8;return function(_0x4c6c6d){if(_0x4c6c6d){return _0x590f58[_0xdc30('0x2c')](_0x7c310e)[_0xdc30('0x2d')](_0x4c6c6d);}};}function respondWithFilteredResult(_0x457574,_0x373ad7){return function(_0x1f4553){if(_0x1f4553){var _0x2c309e=typeof _0x373ad7['offset']===_0xdc30('0x2e')&&typeof _0x373ad7[_0xdc30('0x2f')]===_0xdc30('0x2e');var _0x2548d1=_0x1f4553[_0xdc30('0x30')];var _0x5d8da3=_0x2c309e?0x0:_0x373ad7[_0xdc30('0x31')];var _0xf15db3=_0x2c309e?_0x1f4553[_0xdc30('0x30')]:_0x373ad7[_0xdc30('0x31')]+_0x373ad7['limit'];var _0x3e9e62;if(_0xf15db3>=_0x2548d1){_0xf15db3=_0x2548d1;_0x3e9e62=0xc8;}else{_0x3e9e62=0xce;}_0x457574[_0xdc30('0x2c')](_0x3e9e62);return _0x457574[_0xdc30('0x32')](_0xdc30('0x33'),_0x5d8da3+'-'+_0xf15db3+'/'+_0x2548d1)[_0xdc30('0x2d')](_0x1f4553);}return null;};}function patchUpdates(_0x24233b){return function(_0x253adc){try{jsonpatch[_0xdc30('0x34')](_0x253adc,_0x24233b,!![]);}catch(_0x211786){return BPromise[_0xdc30('0x35')](_0x211786);}return _0x253adc['save']();};}function saveUpdates(_0x327a7f,_0xa70641){return function(_0x13937c){if(_0x13937c){return _0x13937c[_0xdc30('0x36')](_0x327a7f)[_0xdc30('0x20')](function(_0x4fcf33){return _0x4fcf33;});}return null;};}function removeEntity(_0x157bee,_0x103fe3){return function(_0x84435b){if(_0x84435b){return _0x84435b[_0xdc30('0x37')]()[_0xdc30('0x20')](function(){var _0x38c4bb=_0x84435b[_0xdc30('0x38')]({'plain':!![]});var _0x2b5135=_0xdc30('0x39');return db['UserProfileResource'][_0xdc30('0x37')]({'where':{'type':_0x2b5135,'resourceId':_0x38c4bb['id']}})[_0xdc30('0x20')](function(){return _0x84435b;});})[_0xdc30('0x20')](function(){_0x157bee[_0xdc30('0x2c')](0xcc)[_0xdc30('0x3a')]();});}};}function handleEntityNotFound(_0x1fd5cd,_0x3d11e5){return function(_0x18acaf){if(!_0x18acaf){_0x1fd5cd[_0xdc30('0x2b')](0x194);}return _0x18acaf;};}function handleError(_0x438ad2,_0x19a1f3){_0x19a1f3=_0x19a1f3||0x1f4;return function(_0x7a8cb3){logger[_0xdc30('0x25')](_0x7a8cb3[_0xdc30('0x3b')]);if(_0x7a8cb3[_0xdc30('0x3c')]){delete _0x7a8cb3[_0xdc30('0x3c')];}_0x438ad2[_0xdc30('0x2c')](_0x19a1f3)[_0xdc30('0x3d')](_0x7a8cb3);};}exports[_0xdc30('0x3e')]=function(_0x185bfe,_0x5b729d){var _0x20ae82={'include':[{'model':db[_0xdc30('0x3f')],'as':_0xdc30('0x40')}]},_0x3f1955={},_0x3ec3ac={'count':0x0,'rows':[]};var _0x1d42af=_['map'](db[_0xdc30('0x41')]['rawAttributes'],function(_0x360bc2){return{'name':_0x360bc2[_0xdc30('0x42')],'type':_0x360bc2['type'][_0xdc30('0x43')]};});_0x3f1955[_0xdc30('0x44')]=_[_0xdc30('0x45')](_0x1d42af,_0xdc30('0x3c'));_0x3f1955[_0xdc30('0x46')]=_[_0xdc30('0x47')](_0x185bfe[_0xdc30('0x46')]);_0x3f1955[_0xdc30('0x48')]=_[_0xdc30('0x49')](_0x3f1955[_0xdc30('0x44')],_0x3f1955[_0xdc30('0x46')]);_0x20ae82['attributes']=_[_0xdc30('0x49')](_0x3f1955['model'],qs[_0xdc30('0x4a')](_0x185bfe['query'][_0xdc30('0x4a')]));_0x20ae82[_0xdc30('0x4b')]=_0x20ae82[_0xdc30('0x4b')]['length']?_0x20ae82[_0xdc30('0x4b')]:_0x3f1955[_0xdc30('0x44')];if(!_0x185bfe['query'][_0xdc30('0x4c')](_0xdc30('0x4d'))){_0x20ae82[_0xdc30('0x2f')]=qs[_0xdc30('0x2f')](_0x185bfe['query'][_0xdc30('0x2f')]);_0x20ae82[_0xdc30('0x31')]=qs[_0xdc30('0x31')](_0x185bfe[_0xdc30('0x46')][_0xdc30('0x31')]);}_0x20ae82[_0xdc30('0x4e')]=qs[_0xdc30('0x4f')](_0x185bfe[_0xdc30('0x46')][_0xdc30('0x4f')]);_0x20ae82[_0xdc30('0x50')]=qs[_0xdc30('0x48')](_[_0xdc30('0x51')](_0x185bfe[_0xdc30('0x46')],_0x3f1955[_0xdc30('0x48')]),_0x1d42af);if(_0x185bfe['query']['filter']){_0x20ae82[_0xdc30('0x50')]=_[_0xdc30('0x52')](_0x20ae82[_0xdc30('0x50')],{'$or':_[_0xdc30('0x45')](_0x1d42af,function(_0x1ed39e){if(_0x1ed39e[_0xdc30('0x53')]!==_0xdc30('0x54')){var _0x3741af={};_0x3741af[_0x1ed39e[_0xdc30('0x3c')]]={'$like':'%'+_0x185bfe['query'][_0xdc30('0x55')]+'%'};return _0x3741af;}})});}_0x20ae82=_['merge']({},_0x20ae82,_0x185bfe[_0xdc30('0x56')]);var _0x5036b2={'where':_0x20ae82['where']};return db['OpenchannelAccount'][_0xdc30('0x30')](_0x5036b2)[_0xdc30('0x20')](function(_0x17743f){_0x3ec3ac[_0xdc30('0x30')]=_0x17743f;if(_0x185bfe[_0xdc30('0x46')][_0xdc30('0x57')]){_0x20ae82[_0xdc30('0x58')]=[{'all':!![]}];}return db[_0xdc30('0x41')][_0xdc30('0x59')](_0x20ae82);})[_0xdc30('0x20')](function(_0x2282ea){_0x3ec3ac[_0xdc30('0x5a')]=_0x2282ea;return _0x3ec3ac;})[_0xdc30('0x20')](respondWithFilteredResult(_0x5b729d,_0x20ae82))['catch'](handleError(_0x5b729d,null));};exports['show']=function(_0x126359,_0x14e9f7){var _0xdf0baf={'raw':![],'where':{'id':_0x126359[_0xdc30('0x5b')]['id']},'include':[{'model':db[_0xdc30('0x3f')],'as':_0xdc30('0x40')}]},_0x34189e={};_0x34189e[_0xdc30('0x44')]=_[_0xdc30('0x47')](db[_0xdc30('0x41')]['rawAttributes']);_0x34189e[_0xdc30('0x46')]=_[_0xdc30('0x47')](_0x126359['query']);_0x34189e[_0xdc30('0x48')]=_[_0xdc30('0x49')](_0x34189e[_0xdc30('0x44')],_0x34189e[_0xdc30('0x46')]);_0xdf0baf['attributes']=_[_0xdc30('0x49')](_0x34189e[_0xdc30('0x44')],qs['fields'](_0x126359['query'][_0xdc30('0x4a')]));_0xdf0baf[_0xdc30('0x4b')]=_0xdf0baf['attributes'][_0xdc30('0x5c')]?_0xdf0baf[_0xdc30('0x4b')]:_0x34189e[_0xdc30('0x44')];if(_0x126359[_0xdc30('0x46')][_0xdc30('0x57')]){_0xdf0baf[_0xdc30('0x58')]=[{'all':!![]}];}_0xdf0baf=_[_0xdc30('0x52')]({},_0xdf0baf,_0x126359['options']);return db[_0xdc30('0x41')][_0xdc30('0x5d')](_0xdf0baf)[_0xdc30('0x20')](handleEntityNotFound(_0x14e9f7,null))[_0xdc30('0x20')](respondWithResult(_0x14e9f7,null))[_0xdc30('0x2a')](handleError(_0x14e9f7,null));};exports[_0xdc30('0x5e')]=function(_0x11f245,_0x2190bb){return db['OpenchannelAccount'][_0xdc30('0x5e')](_0x11f245[_0xdc30('0x5f')],{})[_0xdc30('0x20')](function(_0x390b93){var _0x2bde6a=_0x11f245['user'][_0xdc30('0x38')]({'plain':!![]});if(!_0x2bde6a)throw new Error(_0xdc30('0x60'));if(_0x2bde6a[_0xdc30('0x61')]===_0xdc30('0x62')){var _0x46f724=_0x390b93['get']({'plain':!![]});var _0x46b6cb=_0xdc30('0x39');return db[_0xdc30('0x63')][_0xdc30('0x5d')]({'where':{'name':_0x46b6cb,'userProfileId':_0x2bde6a['userProfileId']},'raw':!![]})[_0xdc30('0x20')](function(_0x4f6e4d){if(_0x4f6e4d&&_0x4f6e4d[_0xdc30('0x64')]===0x0){return db['UserProfileResource'][_0xdc30('0x5e')]({'name':_0x46f724['name'],'resourceId':_0x46f724['id'],'type':_0x4f6e4d['name'],'sectionId':_0x4f6e4d['id']},{})[_0xdc30('0x20')](function(){return _0x390b93;});}else{return _0x390b93;}})[_0xdc30('0x2a')](function(_0x48fa4d){logger[_0xdc30('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48fa4d);throw _0x48fa4d;});}return _0x390b93;})['then'](respondWithResult(_0x2190bb,0xc9))['catch'](handleError(_0x2190bb,null));};exports[_0xdc30('0x36')]=function(_0x4036f7,_0x1e8185){if(_0x4036f7['body']['id']){delete _0x4036f7['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x4036f7[_0xdc30('0x5b')]['id']},'include':[{'model':db[_0xdc30('0x3f')],'as':_0xdc30('0x40')}]})[_0xdc30('0x20')](handleEntityNotFound(_0x1e8185,null))[_0xdc30('0x20')](saveUpdates(_0x4036f7[_0xdc30('0x5f')],null))[_0xdc30('0x20')](respondWithResult(_0x1e8185,null))['catch'](handleError(_0x1e8185,null));};exports[_0xdc30('0x37')]=function(_0x2aeda8,_0x287786){return db[_0xdc30('0x41')][_0xdc30('0x5d')]({'where':{'id':_0x2aeda8['params']['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x287786,null))[_0xdc30('0x20')](removeEntity(_0x287786,null))[_0xdc30('0x2a')](handleError(_0x287786,null));};exports[_0xdc30('0x65')]=function(_0x3f1176,_0x450908){return db['OpenchannelAccount'][_0xdc30('0x65')]()['then'](respondWithResult(_0x450908,null))[_0xdc30('0x2a')](handleError(_0x450908,null));};exports[_0xdc30('0x66')]=function(_0x23fb25,_0x6a9aba,_0x4ff8c5){if(_0x23fb25[_0xdc30('0x5f')]['id']){delete _0x23fb25['body']['id'];}return db[_0xdc30('0x41')][_0xdc30('0x5d')]({'where':{'id':_0x23fb25[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x6a9aba,null))[_0xdc30('0x20')](function(_0x46ba67){if(_0x46ba67){_0x23fb25[_0xdc30('0x5f')][_0xdc30('0x67')]=_0x46ba67['id'];return db[_0xdc30('0x68')][_0xdc30('0x5e')](_0x23fb25['body']);}})[_0xdc30('0x20')](respondWithResult(_0x6a9aba,null))[_0xdc30('0x2a')](handleError(_0x6a9aba,null));};exports[_0xdc30('0x69')]=function(_0x4b3ad3,_0x11a12b,_0x2e6e23){var _0x2793b2={'raw':![],'where':{}};var _0x37c939={};var _0x19567a={'count':0x0,'rows':[]};return db[_0xdc30('0x41')]['findOne']({'where':{'id':_0x4b3ad3[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x11a12b,null))[_0xdc30('0x20')](function(_0x3cdf6a){if(_0x3cdf6a){_0x37c939[_0xdc30('0x44')]=_[_0xdc30('0x47')](db['Disposition'][_0xdc30('0x6a')]);_0x37c939[_0xdc30('0x46')]=_[_0xdc30('0x47')](_0x4b3ad3[_0xdc30('0x46')]);_0x37c939['filters']=_[_0xdc30('0x49')](_0x37c939['model'],_0x37c939[_0xdc30('0x46')]);_0x2793b2[_0xdc30('0x4b')]=_['intersection'](_0x37c939[_0xdc30('0x44')],qs[_0xdc30('0x4a')](_0x4b3ad3[_0xdc30('0x46')]['fields']));_0x2793b2[_0xdc30('0x4b')]=_0x2793b2[_0xdc30('0x4b')][_0xdc30('0x5c')]?_0x2793b2['attributes']:_0x37c939[_0xdc30('0x44')];if(!_0x4b3ad3[_0xdc30('0x46')]['hasOwnProperty'](_0xdc30('0x4d'))){_0x2793b2['limit']=qs['limit'](_0x4b3ad3['query'][_0xdc30('0x2f')]);_0x2793b2[_0xdc30('0x31')]=qs[_0xdc30('0x31')](_0x4b3ad3[_0xdc30('0x46')][_0xdc30('0x31')]);}_0x2793b2[_0xdc30('0x4e')]=qs[_0xdc30('0x4f')](_0x4b3ad3[_0xdc30('0x46')][_0xdc30('0x4f')]);_0x2793b2[_0xdc30('0x50')]=qs[_0xdc30('0x48')](_['pick'](_0x4b3ad3[_0xdc30('0x46')],_0x37c939[_0xdc30('0x48')]));_0x2793b2[_0xdc30('0x50')][_0xdc30('0x67')]=_0x3cdf6a['id'];if(_0x4b3ad3[_0xdc30('0x46')][_0xdc30('0x55')]){_0x2793b2[_0xdc30('0x50')]=_[_0xdc30('0x52')](_0x2793b2[_0xdc30('0x50')],{'$or':_['map'](_0x2793b2['attributes'],function(_0x18d1ff){var _0x56cc82={};_0x56cc82[_0x18d1ff]={'$like':'%'+_0x4b3ad3[_0xdc30('0x46')][_0xdc30('0x55')]+'%'};return _0x56cc82;})});}_0x2793b2=_[_0xdc30('0x52')]({},_0x2793b2,_0x4b3ad3[_0xdc30('0x56')]);return db[_0xdc30('0x68')][_0xdc30('0x30')]({'where':_0x2793b2[_0xdc30('0x50')]})[_0xdc30('0x20')](function(_0x4a7020){_0x19567a['count']=_0x4a7020;if(_0x4b3ad3[_0xdc30('0x46')][_0xdc30('0x57')]){_0x2793b2[_0xdc30('0x58')]=[{'all':!![]}];}return db[_0xdc30('0x68')][_0xdc30('0x59')](_0x2793b2);})[_0xdc30('0x20')](function(_0x396be1){_0x19567a[_0xdc30('0x5a')]=_0x396be1;return _0x19567a;});}})[_0xdc30('0x20')](respondWithFilteredResult(_0x11a12b,_0x2793b2))['catch'](handleError(_0x11a12b,null));};exports['removeDispositions']=function(_0x28a3d3,_0x135ce3,_0x31731f){return db[_0xdc30('0x41')][_0xdc30('0x5d')]({'where':{'id':_0x28a3d3[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x135ce3,null))['then'](function(_0x55a173){if(_0x55a173){return _0x55a173[_0xdc30('0x6b')](_0x28a3d3[_0xdc30('0x46')][_0xdc30('0x6c')]);}})[_0xdc30('0x20')](respondWithStatusCode(_0x135ce3,null))[_0xdc30('0x2a')](handleError(_0x135ce3,null));};exports[_0xdc30('0x6d')]=function(_0x51be45,_0x2b36c5,_0x3f1636){if(_0x51be45[_0xdc30('0x5f')]['id']){delete _0x51be45[_0xdc30('0x5f')]['id'];}return db[_0xdc30('0x41')]['find']({'where':{'id':_0x51be45[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x2b36c5,null))[_0xdc30('0x20')](function(_0x139bcb){if(_0x139bcb){_0x51be45[_0xdc30('0x5f')][_0xdc30('0x67')]=_0x139bcb['id'];return db[_0xdc30('0x6e')][_0xdc30('0x5e')](_0x51be45[_0xdc30('0x5f')]);}})['then'](respondWithResult(_0x2b36c5,null))['catch'](handleError(_0x2b36c5,null));};exports['getAnswers']=function(_0x1f8f12,_0x49d295,_0x3bf703){var _0x432254={'raw':![],'where':{}};var _0x32841a={};var _0x455286={'count':0x0,'rows':[]};return db[_0xdc30('0x41')]['findOne']({'where':{'id':_0x1f8f12[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x49d295,null))['then'](function(_0x5c47ec){if(_0x5c47ec){_0x32841a[_0xdc30('0x44')]=_[_0xdc30('0x47')](db[_0xdc30('0x6e')]['rawAttributes']);_0x32841a[_0xdc30('0x46')]=_[_0xdc30('0x47')](_0x1f8f12['query']);_0x32841a[_0xdc30('0x48')]=_['intersection'](_0x32841a[_0xdc30('0x44')],_0x32841a['query']);_0x432254[_0xdc30('0x4b')]=_[_0xdc30('0x49')](_0x32841a[_0xdc30('0x44')],qs[_0xdc30('0x4a')](_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x4a')]));_0x432254[_0xdc30('0x4b')]=_0x432254['attributes'][_0xdc30('0x5c')]?_0x432254[_0xdc30('0x4b')]:_0x32841a[_0xdc30('0x44')];if(!_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x4c')](_0xdc30('0x4d'))){_0x432254[_0xdc30('0x2f')]=qs[_0xdc30('0x2f')](_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x2f')]);_0x432254[_0xdc30('0x31')]=qs[_0xdc30('0x31')](_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x31')]);}_0x432254['order']=qs[_0xdc30('0x4f')](_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x4f')]);_0x432254[_0xdc30('0x50')]=qs[_0xdc30('0x48')](_['pick'](_0x1f8f12['query'],_0x32841a['filters']));_0x432254[_0xdc30('0x50')][_0xdc30('0x67')]=_0x5c47ec['id'];if(_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x55')]){_0x432254['where']=_[_0xdc30('0x52')](_0x432254[_0xdc30('0x50')],{'$or':_[_0xdc30('0x45')](_0x432254[_0xdc30('0x4b')],function(_0x53ea50){var _0x57a0a0={};_0x57a0a0[_0x53ea50]={'$like':'%'+_0x1f8f12[_0xdc30('0x46')][_0xdc30('0x55')]+'%'};return _0x57a0a0;})});}_0x432254=_[_0xdc30('0x52')]({},_0x432254,_0x1f8f12['options']);return db[_0xdc30('0x6e')][_0xdc30('0x30')]({'where':_0x432254[_0xdc30('0x50')]})[_0xdc30('0x20')](function(_0x2a7716){_0x455286[_0xdc30('0x30')]=_0x2a7716;if(_0x1f8f12[_0xdc30('0x46')]['includeAll']){_0x432254['include']=[{'all':!![]}];}return db[_0xdc30('0x6e')][_0xdc30('0x59')](_0x432254);})[_0xdc30('0x20')](function(_0x527e49){_0x455286[_0xdc30('0x5a')]=_0x527e49;return _0x455286;});}})[_0xdc30('0x20')](respondWithFilteredResult(_0x49d295,_0x432254))[_0xdc30('0x2a')](handleError(_0x49d295,null));};exports[_0xdc30('0x6f')]=function(_0xc6b221,_0x31c4c8,_0x2024da){return db[_0xdc30('0x41')][_0xdc30('0x5d')]({'where':{'id':_0xc6b221[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x31c4c8,null))[_0xdc30('0x20')](function(_0x5f29a7){if(_0x5f29a7){return _0x5f29a7[_0xdc30('0x6f')](_0xc6b221['query'][_0xdc30('0x6c')]);}})['then'](respondWithStatusCode(_0x31c4c8,null))[_0xdc30('0x2a')](handleError(_0x31c4c8,null));};exports[_0xdc30('0x70')]=function(_0x3907f3,_0x8bbce,_0x4992fc){var _0x4cce7e={'body':_0x3907f3[_0xdc30('0x5f')],'channel':_0xdc30('0x71')};var _0x527596=[];var _0x9c11c1=[];var _0x4dc6fa={};var _0x1c5f6c=![];return db[_0xdc30('0x72')][_0xdc30('0x65')]()[_0xdc30('0x20')](function(_0x40cbf1){if(!_0x40cbf1){throw new db[(_0xdc30('0x73'))]['ValidationError'](_0xdc30('0x74'));}_0x527596=_[_0xdc30('0x75')](_[_0xdc30('0x47')](_0x40cbf1),[_0xdc30('0x76'),'updatedAt']);_0x9c11c1=_[_0xdc30('0x75')](_[_0xdc30('0x47')](_0x40cbf1),['createdAt',_0xdc30('0x77'),_0xdc30('0x78'),_0xdc30('0x79')]);if(_0x3907f3[_0xdc30('0x5f')]['id']){delete _0x3907f3['body']['id'];}if(_[_0xdc30('0x7a')](_0x3907f3['body'][_0xdc30('0x7b')])){throw new db[(_0xdc30('0x73'))][(_0xdc30('0x7c'))](_0xdc30('0x7d'));}if(_['isNil'](_0x3907f3['body']['body'])||_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x5f')]===''){throw new db[(_0xdc30('0x73'))][(_0xdc30('0x7c'))](_0xdc30('0x7e'));}if(_['isNil'](_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x7f')])){throw new db[(_0xdc30('0x73'))][(_0xdc30('0x7c'))](_0xdc30('0x80')+_0x9c11c1);}if(!_['includes'](_0x9c11c1,_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x7f')])){throw new db[(_0xdc30('0x73'))]['ValidationError'](_0xdc30('0x81')+_0x9c11c1);}_0x4dc6fa[_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x7f')]]=_0x3907f3['body'][_0xdc30('0x7b')];})[_0xdc30('0x20')](function(){return db[_0xdc30('0x41')][_0xdc30('0x5d')]({'where':{'id':_0x3907f3[_0xdc30('0x5b')]['id']},'include':[{'model':db[_0xdc30('0x82')],'as':_0xdc30('0x83'),'include':[{'model':db[_0xdc30('0x72')],'as':_0xdc30('0x84'),'where':_0x4dc6fa,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xdc30('0x85')],'as':_0xdc30('0x86')}]});})[_0xdc30('0x20')](handleEntityNotFound(_0x8bbce,null))[_0xdc30('0x20')](function(_0x239b1f){if(_0x239b1f&&_0x239b1f[_0xdc30('0x83')]){_0x4cce7e['account']=_0x239b1f;_0x4cce7e[_0xdc30('0x87')]=_0x239b1f[_0xdc30('0x86')];_0x4cce7e[_0xdc30('0x88')]=_0x239b1f[_0xdc30('0x83')];_0x4cce7e['applications']=_[_0xdc30('0x89')](_0x4cce7e[_0xdc30('0x87')],[_0xdc30('0x8a')],[_0xdc30('0x8b')]);if(_0x4cce7e[_0xdc30('0x8c')][_0xdc30('0x86')]){delete _0x4cce7e[_0xdc30('0x8c')][_0xdc30('0x86')];}if(_0x4cce7e['account'][_0xdc30('0x83')]&&_0x4cce7e[_0xdc30('0x8c')][_0xdc30('0x83')][_0xdc30('0x84')]['length']){return _0x4cce7e[_0xdc30('0x8c')][_0xdc30('0x83')][_0xdc30('0x84')][0x0];}var _0x2b09ef=_[_0xdc30('0x1a')](_0x3907f3[_0xdc30('0x5f')],{'firstName':_0x3907f3[_0xdc30('0x5f')]['from'],'ListId':_0x239b1f[_0xdc30('0x79')]});_0x2b09ef[_0x3907f3[_0xdc30('0x5f')]['mapKey']]=_0x3907f3['body'][_0xdc30('0x7b')];return db[_0xdc30('0x72')][_0xdc30('0x5e')](_0x2b09ef,{'fields':_0x527596,'raw':!![]});}})[_0xdc30('0x20')](handleEntityNotFound(_0x8bbce,null))[_0xdc30('0x20')](function(_0x119b97){_0x4cce7e['contact']=_0x119b97;if(_0x119b97){var _0x2c6e56={'ContactId':_0x119b97['id'],'OpenchannelAccountId':_0x3907f3[_0xdc30('0x5b')]['id'],'from':(_0x119b97['firstName']||'')+'\x20'+(_0x119b97['lastName']||'')};var _0x513137={'OpenchannelAccountId':_0x3907f3['params']['id'],'closed':![]};if(_0x3907f3['body'][_0xdc30('0x8d')]){_0x513137['threadId']=_0x3907f3['body'][_0xdc30('0x8d')];return db['OpenchannelInteraction']['find']({'where':_0x513137})[_0xdc30('0x20')](function(_0x27d74d){if(_0x27d74d){return[_0x27d74d,![]];}_0x2c6e56[_0xdc30('0x8d')]=_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x8d')];_0x2c6e56[_0xdc30('0x8e')]=_0x3907f3['body'][_0xdc30('0x8e')];return db[_0xdc30('0x8f')][_0xdc30('0x5e')](_0x2c6e56)[_0xdc30('0x20')](function(_0x28f256){return[_0x28f256,!![]];});});}else{_0x513137[_0xdc30('0x8d')]=null;}_0x513137[_0xdc30('0x90')]=_0x119b97['id'];return db[_0xdc30('0x8f')]['find']({'where':_0x513137})[_0xdc30('0x20')](function(_0x35912b){if(_0x35912b){return[_0x35912b,![]];}return db[_0xdc30('0x8f')][_0xdc30('0x5e')](_0x2c6e56)[_0xdc30('0x20')](function(_0x36f5b5){return[_0x36f5b5,!![]];});});}})[_0xdc30('0x91')](function(_0x294a0e,_0x4a7994){if(_0x294a0e){_0x1c5f6c=_0x4a7994;if(!_0x4a7994){var _0x3178d9={'from':(_0x4cce7e[_0xdc30('0x92')][_0xdc30('0x93')]||'')+'\x20'+(_0x4cce7e[_0xdc30('0x92')]['lastName']||'')};if(_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x8d')]&&_0x3907f3['body']['messageId']&&_0x3907f3[_0xdc30('0x5f')]['threadId']!=_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x94')]){_0x3178d9[_0xdc30('0x8d')]=_0x3907f3['body'][_0xdc30('0x94')];}return _0x294a0e[_0xdc30('0x36')](_0x3178d9);}else{return _0x294a0e;}}})[_0xdc30('0x20')](function(_0x1374ec){_0x4cce7e[_0xdc30('0x95')]=_0x1374ec[_0xdc30('0x38')]({'plain':!![]});_0x4cce7e['interaction']['created']=_0x1c5f6c;if(_0x4cce7e[_0xdc30('0x95')][_0xdc30('0x96')]){if(_0x4cce7e['account'][_0xdc30('0x97')]){_0x4cce7e['applications']['push']({'id':0x0,'priority':_0x4cce7e[_0xdc30('0x87')][_0xdc30('0x5c')]+0x1,'app':_0xdc30('0x98'),'appdata':_0xdc30('0x99'),'interval':_0xdc30('0x9a')});}}return db[_0xdc30('0x9b')][_0xdc30('0x5e')]({'body':_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x5f')],'OpenchannelAccountId':_0x3907f3['params']['id'],'OpenchannelInteractionId':_0x1374ec['id'],'direction':'in','ContactId':_0x4cce7e[_0xdc30('0x92')]['id'],'AttachmentId':_0x3907f3[_0xdc30('0x5f')][_0xdc30('0x9c')]});})[_0xdc30('0x20')](function(_0x409115){_0x4cce7e[_0xdc30('0x28')]=_0x409115;if(_0x4cce7e[_0xdc30('0x95')]['UserId']){return db['User']['find']({'attributes':['id',_0xdc30('0x3c')],'where':{'id':_0x4cce7e[_0xdc30('0x95')][_0xdc30('0x9d')]}})[_0xdc30('0x20')](function(_0x39220f){if(_0x39220f){_0x4cce7e[_0xdc30('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x39220f['name']+','+(_0x4cce7e[_0xdc30('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x4cce7e[_0xdc30('0x9e')]=![];}return respondWithRpcPromise(_0xdc30('0x9f'),_0xdc30('0xa0'),_0x4cce7e);});}return respondWithRpcPromise('Start',_0xdc30('0xa0'),_0x4cce7e);})['then'](function(_0x2081e3){respondWithRpcPromise(_0xdc30('0xa1'),_0xdc30('0xa1'),{'event':'notify','message':_0x2081e3},client9002);return _0x2081e3;})[_0xdc30('0x20')](respondWithResult(_0x8bbce,null))[_0xdc30('0x2a')](handleError(_0x8bbce,null));};exports[_0xdc30('0xa2')]=function(_0x1cfc6d,_0x519635){var _0x3b55b8=_0x1cfc6d['params']['id'];var _0x429ada=_0x1cfc6d[_0xdc30('0x5f')];var _0x43c906=0xc8;var _0x531887=null;return db[_0xdc30('0xa3')][_0xdc30('0xa4')]({'isolationLevel':db[_0xdc30('0xa3')][_0xdc30('0xa5')][_0xdc30('0xa6')][_0xdc30('0xa7')]},function(_0x3aa498){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3b55b8},'transaction':_0x3aa498})[_0xdc30('0x20')](function(_0x25a865){if(_0x25a865){return db['OpenchannelApplication'][_0xdc30('0x37')]({'where':{'OpenchannelAccountId':_0x3b55b8},'transaction':_0x3aa498})['then'](function(){var _0x389504=_[_0xdc30('0x45')](_0x429ada,function(_0x5d44ca){_0x5d44ca[_0xdc30('0x67')]=_0x3b55b8;return _0x5d44ca;});return db[_0xdc30('0x85')][_0xdc30('0xa8')](_0x389504,{'transaction':_0x3aa498});});}else{_0x43c906=0x194;_0x531887=[];}});})[_0xdc30('0x20')](function(){if(_0x43c906!==0x194){return db[_0xdc30('0x85')][_0xdc30('0xa9')]({'where':{'OpenchannelAccountId':_0x3b55b8},'order':_0xdc30('0x8a')})['then'](function(_0x41ed8b){_0x531887=_0x41ed8b;});}})['catch'](function(_0xedccc9){_0x43c906=0x1f4;logger[_0xdc30('0x25')](_0xedccc9['stack']);if(_0xedccc9[_0xdc30('0x3c')]){delete _0xedccc9[_0xdc30('0x3c')];}_0x531887=_0xedccc9;})[_0xdc30('0xaa')](function(){if(_0x531887===null){_0x519635[_0xdc30('0x2b')](_0x43c906);}else{if(_0x43c906===0x1f4){_0x519635[_0xdc30('0x2c')](_0x43c906)['send'](_0x531887);}else{_0x519635[_0xdc30('0x2c')](_0x43c906)[_0xdc30('0x2d')](_0x531887);}}});};exports[_0xdc30('0xab')]=function(_0x50fdd0,_0x4173f8,_0x501e5c){var _0x436aa9={};var _0xa911d7={};var _0x47620f;var _0x3ac74b;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x50fdd0[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x4173f8,null))[_0xdc30('0x20')](function(_0x1bb32a){if(_0x1bb32a){_0x47620f=_0x1bb32a;_0xa911d7[_0xdc30('0x44')]=_['keys'](db[_0xdc30('0x85')][_0xdc30('0x6a')]);_0xa911d7[_0xdc30('0x46')]=_['keys'](_0x50fdd0['query']);_0xa911d7[_0xdc30('0x48')]=_['intersection'](_0xa911d7[_0xdc30('0x44')],_0xa911d7[_0xdc30('0x46')]);_0x436aa9[_0xdc30('0x4b')]=_[_0xdc30('0x49')](_0xa911d7[_0xdc30('0x44')],qs[_0xdc30('0x4a')](_0x50fdd0[_0xdc30('0x46')][_0xdc30('0x4a')]));_0x436aa9[_0xdc30('0x4b')]=_0x436aa9['attributes'][_0xdc30('0x5c')]?_0x436aa9[_0xdc30('0x4b')]:_0xa911d7[_0xdc30('0x44')];_0x436aa9[_0xdc30('0x4e')]=qs['sort'](_0x50fdd0[_0xdc30('0x46')]['sort']);_0x436aa9[_0xdc30('0x50')]=qs[_0xdc30('0x48')](_[_0xdc30('0x51')](_0x50fdd0[_0xdc30('0x46')],_0xa911d7['filters']));if(_0x50fdd0[_0xdc30('0x46')][_0xdc30('0x55')]){_0x436aa9[_0xdc30('0x50')]=_[_0xdc30('0x52')](_0x436aa9[_0xdc30('0x50')],{'$or':_[_0xdc30('0x45')](_0x436aa9[_0xdc30('0x4b')],function(_0xd16652){var _0x11f3d3={};_0x11f3d3[_0xd16652]={'$like':'%'+_0x50fdd0[_0xdc30('0x46')]['filter']+'%'};return _0x11f3d3;})});}_0x436aa9=_['merge']({},_0x436aa9,_0x50fdd0[_0xdc30('0x56')]);return _0x47620f[_0xdc30('0xab')](_0x436aa9);}})['then'](function(_0x734817){if(_0x734817){_0x3ac74b=_0x734817[_0xdc30('0x5c')];if(!_0x50fdd0[_0xdc30('0x46')][_0xdc30('0x4c')]('nolimit')){_0x436aa9['limit']=qs['limit'](_0x50fdd0[_0xdc30('0x46')][_0xdc30('0x2f')]);_0x436aa9[_0xdc30('0x31')]=qs[_0xdc30('0x31')](_0x50fdd0['query'][_0xdc30('0x31')]);}return _0x47620f[_0xdc30('0xab')](_0x436aa9);}})[_0xdc30('0x20')](function(_0x288358){if(_0x288358){return _0x288358?{'count':_0x3ac74b,'rows':_0x288358}:null;}})[_0xdc30('0x20')](respondWithResult(_0x4173f8,null))[_0xdc30('0x2a')](handleError(_0x4173f8,null));};exports[_0xdc30('0xac')]=function(_0xb823aa,_0x35ac3a,_0x3f586e){var _0x4f1fd1={'raw':![],'where':{}};var _0x2e2dfe={};var _0x7fa101={'count':0x0,'rows':[]};return db[_0xdc30('0x41')][_0xdc30('0xad')]({'where':{'id':_0xb823aa[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x35ac3a,null))[_0xdc30('0x20')](function(_0x43e293){if(_0x43e293){_0x2e2dfe['model']=_['keys'](db['OpenchannelInteraction'][_0xdc30('0x6a')]);_0x2e2dfe[_0xdc30('0x46')]=_[_0xdc30('0x47')](_0xb823aa['query']);_0x2e2dfe[_0xdc30('0x48')]=_[_0xdc30('0x49')](_0x2e2dfe[_0xdc30('0x44')],_0x2e2dfe[_0xdc30('0x46')]);_0x4f1fd1[_0xdc30('0x4b')]=_['intersection'](_0x2e2dfe[_0xdc30('0x44')],qs[_0xdc30('0x4a')](_0xb823aa[_0xdc30('0x46')][_0xdc30('0x4a')]));_0x4f1fd1[_0xdc30('0x4b')]=_0x4f1fd1[_0xdc30('0x4b')][_0xdc30('0x5c')]?_0x4f1fd1[_0xdc30('0x4b')]:_0x2e2dfe[_0xdc30('0x44')];if(!_0xb823aa['query'][_0xdc30('0x4c')](_0xdc30('0x4d'))){_0x4f1fd1[_0xdc30('0x2f')]=qs['limit'](_0xb823aa[_0xdc30('0x46')][_0xdc30('0x2f')]);_0x4f1fd1[_0xdc30('0x31')]=qs[_0xdc30('0x31')](_0xb823aa[_0xdc30('0x46')]['offset']);}_0x4f1fd1[_0xdc30('0x4e')]=qs[_0xdc30('0x4f')](_0xb823aa[_0xdc30('0x46')]['sort']);_0x4f1fd1['where']=qs[_0xdc30('0x48')](_[_0xdc30('0x51')](_0xb823aa[_0xdc30('0x46')],_0x2e2dfe[_0xdc30('0x48')]));_0x4f1fd1[_0xdc30('0x50')]['OpenchannelAccountId']=_0x43e293['id'];if(_0xb823aa[_0xdc30('0x46')][_0xdc30('0x55')]){_0x4f1fd1[_0xdc30('0x50')]=_['merge'](_0x4f1fd1['where'],{'$or':_[_0xdc30('0x45')](_0x4f1fd1[_0xdc30('0x4b')],function(_0x24909b){var _0x3c8933={};_0x3c8933[_0x24909b]={'$like':'%'+_0xb823aa['query']['filter']+'%'};return _0x3c8933;})});}_0x4f1fd1=_[_0xdc30('0x52')]({},_0x4f1fd1,_0xb823aa[_0xdc30('0x56')]);return db[_0xdc30('0x8f')]['count']({'where':_0x4f1fd1[_0xdc30('0x50')]})[_0xdc30('0x20')](function(_0x1bff36){_0x7fa101['count']=_0x1bff36;if(_0xb823aa[_0xdc30('0x46')][_0xdc30('0x57')]){_0x4f1fd1[_0xdc30('0x58')]=[{'model':db['CmContact'],'as':_0xdc30('0xae'),'required':![]},{'model':db[_0xdc30('0xaf')],'as':'Owner','attributes':[_0xdc30('0x3c'),_0xdc30('0xb0'),'internal'],'required':![]},{'model':db[_0xdc30('0xb1')],'as':'Tags','attributes':['id',_0xdc30('0x3c'),_0xdc30('0xb2')],'where':_0xb823aa[_0xdc30('0x46')]['tag']?{'id':_0xb823aa[_0xdc30('0x46')][_0xdc30('0xb3')]}:undefined,'required':_0xb823aa['query'][_0xdc30('0xb3')]?!![]:![]}];}return db[_0xdc30('0x8f')]['findAll'](_0x4f1fd1);})[_0xdc30('0x20')](function(_0x1a05f8){_0x7fa101['rows']=_0x1a05f8;return _0x7fa101;});}})[_0xdc30('0x20')](respondWithFilteredResult(_0x35ac3a,_0x4f1fd1))[_0xdc30('0x2a')](handleError(_0x35ac3a,null));};exports[_0xdc30('0xb4')]=function(_0x42fe62,_0x4f6602,_0x94cf43){return db[_0xdc30('0x41')]['find']({'where':{'id':_0x42fe62[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x4f6602,null))[_0xdc30('0x20')](function(_0x1b901a){if(_0x1b901a){return _0x1b901a[_0xdc30('0xb4')](_0x42fe62[_0xdc30('0x5f')][_0xdc30('0x6c')],_[_0xdc30('0xb5')](_0x42fe62[_0xdc30('0x5f')],[_0xdc30('0x6c'),'id'])||{})['spread'](function(_0x37b24b){for(var _0x5e81cd=0x0;_0x5e81cd<_0x42fe62[_0xdc30('0x5f')][_0xdc30('0x6c')][_0xdc30('0x5c')];_0x5e81cd+=0x1){socket[_0xdc30('0xb6')]('userOpenchannelAccount:save',{'UserId':Number(_0x42fe62[_0xdc30('0x5f')][_0xdc30('0x6c')][_0x5e81cd]),'OpenchannelAccountId':Number(_0x42fe62[_0xdc30('0x5b')]['id'])});}return _0x37b24b;});}})[_0xdc30('0x20')](respondWithResult(_0x4f6602,null))['catch'](handleError(_0x4f6602,null));};exports[_0xdc30('0xb7')]=function(_0x23540a,_0x3fb904,_0x3299d0){return db['OpenchannelAccount'][_0xdc30('0x5d')]({'where':{'id':_0x23540a[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x3fb904,null))[_0xdc30('0x20')](function(_0x8ce30d){if(_0x8ce30d){return _0x8ce30d['removeAgents'](_0x23540a[_0xdc30('0x46')][_0xdc30('0x6c')])[_0xdc30('0x20')](function(){if(_[_0xdc30('0xb8')](_0x23540a[_0xdc30('0x46')][_0xdc30('0x6c')])){for(var _0x2dd83e=0x0;_0x2dd83e<_0x23540a['query'][_0xdc30('0x6c')][_0xdc30('0x5c')];_0x2dd83e+=0x1){socket[_0xdc30('0xb6')](_0xdc30('0xb9'),{'UserId':Number(_0x23540a[_0xdc30('0x46')][_0xdc30('0x6c')][_0x2dd83e]),'OpenchannelAccountId':Number(_0x23540a[_0xdc30('0x5b')]['id'])});}}else{socket[_0xdc30('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x23540a[_0xdc30('0x46')]['ids']),'OpenchannelAccountId':Number(_0x23540a[_0xdc30('0x5b')]['id'])});}});}})[_0xdc30('0x20')](respondWithStatusCode(_0x3fb904,null))[_0xdc30('0x2a')](handleError(_0x3fb904,null));};exports[_0xdc30('0xba')]=function(_0x1b4769,_0x22f928,_0x133db3){var _0x57c74a={};var _0x3c863={};var _0xee8712;var _0x33c42e;return db[_0xdc30('0x41')][_0xdc30('0xad')]({'where':{'id':_0x1b4769[_0xdc30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x22f928,null))[_0xdc30('0x20')](function(_0x248b46){if(_0x248b46){_0xee8712=_0x248b46;_0x3c863[_0xdc30('0x44')]=_[_0xdc30('0x47')](db['User'][_0xdc30('0x6a')]);_0x3c863[_0xdc30('0x46')]=_[_0xdc30('0x47')](_0x1b4769[_0xdc30('0x46')]);_0x3c863['filters']=_['intersection'](_0x3c863[_0xdc30('0x44')],_0x3c863['query']);_0x57c74a['attributes']=_[_0xdc30('0x49')](_0x3c863[_0xdc30('0x44')],qs['fields'](_0x1b4769[_0xdc30('0x46')][_0xdc30('0x4a')]));_0x57c74a[_0xdc30('0x4b')]=_0x57c74a['attributes'][_0xdc30('0x5c')]?_0x57c74a[_0xdc30('0x4b')]:_0x3c863['model'];_0x57c74a[_0xdc30('0x4e')]=qs[_0xdc30('0x4f')](_0x1b4769['query'][_0xdc30('0x4f')]);_0x57c74a[_0xdc30('0x50')]=qs[_0xdc30('0x48')](_[_0xdc30('0x51')](_0x1b4769[_0xdc30('0x46')],_0x3c863[_0xdc30('0x48')]));if(_0x1b4769[_0xdc30('0x46')]['filter']){_0x57c74a[_0xdc30('0x50')]=_[_0xdc30('0x52')](_0x57c74a[_0xdc30('0x50')],{'$or':_[_0xdc30('0x45')](_0x57c74a[_0xdc30('0x4b')],function(_0x53c3d4){var _0x2b975a={};_0x2b975a[_0x53c3d4]={'$like':'%'+_0x1b4769[_0xdc30('0x46')][_0xdc30('0x55')]+'%'};return _0x2b975a;})});}_0x57c74a=_['merge']({},_0x57c74a,_0x1b4769['options']);return _0xee8712[_0xdc30('0xba')](_0x57c74a);}})[_0xdc30('0x20')](function(_0x36d5de){if(_0x36d5de){_0x33c42e=_0x36d5de[_0xdc30('0x5c')];if(!_0x1b4769[_0xdc30('0x46')][_0xdc30('0x4c')](_0xdc30('0x4d'))){_0x57c74a[_0xdc30('0x2f')]=qs[_0xdc30('0x2f')](_0x1b4769['query'][_0xdc30('0x2f')]);_0x57c74a[_0xdc30('0x31')]=qs[_0xdc30('0x31')](_0x1b4769['query'][_0xdc30('0x31')]);}return _0xee8712[_0xdc30('0xba')](_0x57c74a);}})[_0xdc30('0x20')](function(_0x5d821f){if(_0x5d821f){return _0x5d821f?{'count':_0x33c42e,'rows':_0x5d821f}:null;}})[_0xdc30('0x20')](respondWithResult(_0x22f928,null))[_0xdc30('0x2a')](handleError(_0x22f928,null));};exports[_0xdc30('0x3d')]=function(_0x2c72ea,_0x3a4a97,_0x4bb319){var _0x5b2a7d,_0x435419,_0x51f050;if(_['isNil'](_0x2c72ea[_0xdc30('0x5f')]['body'])||_0x2c72ea[_0xdc30('0x5f')][_0xdc30('0x5f')]===''){throw new db[(_0xdc30('0x73'))][(_0xdc30('0x7c'))](_0xdc30('0x7e'));}if(_[_0xdc30('0x7a')](_0x2c72ea['body']['to'])){}_0x5b2a7d=_0x2c72ea['body']['to'];return db[_0xdc30('0x41')][_0xdc30('0xad')]({'where':{'id':_0x2c72ea[_0xdc30('0x5b')]['id']}})[_0xdc30('0x20')](handleEntityNotFound(_0x3a4a97,null))[_0xdc30('0x20')](function(_0x46a248){if(_0x46a248){return db['OpenchannelAccount'][_0xdc30('0x5d')]({'where':{'id':_0x46a248['id']},'include':[{'model':db[_0xdc30('0x82')],'as':_0xdc30('0x83'),'include':[{'model':db['CmContact'],'as':_0xdc30('0x84'),'where':{[_0x46a248['mapKey']]:_0x5b2a7d},'limit':0x1,'order':[['updatedAt',_0xdc30('0xbb')]]}]}]})[_0xdc30('0x20')](handleEntityNotFound(_0x3a4a97,null))[_0xdc30('0x20')](function(_0x3833b9){if(_0x3833b9&&_0x3833b9[_0xdc30('0x83')]){_0x435419=_0x3833b9[_0xdc30('0x38')]({'plain':!![]});if(_0x435419[_0xdc30('0x83')]&&_0x435419['List']['Contacts'][_0xdc30('0x5c')]){return _0x435419['List'][_0xdc30('0x84')][0x0];}return db[_0xdc30('0x72')][_0xdc30('0x5e')](_['defaults'](_0x2c72ea['body'],{'firstName':_0x5b2a7d,[_0x3833b9[_0xdc30('0x7f')]]:_0x5b2a7d,'phone':_0x5b2a7d,'ListId':_0x435419['ListId']}));}})[_0xdc30('0x20')](handleEntityNotFound(_0x3a4a97,null))[_0xdc30('0x20')](function(_0x3e3ae3){if(_0x3e3ae3){_0x51f050=_0x3e3ae3;return db[_0xdc30('0x8f')][_0xdc30('0x5d')]({'where':{'ContactId':_0x51f050['id'],'closed':![],'OpenchannelAccountId':_0x435419['id']}})[_0xdc30('0x20')](function(_0x4f6918){if(_0x4f6918){return[_0x4f6918,![]];}return db[_0xdc30('0x8f')][_0xdc30('0x5e')]({'UserId':_0x2c72ea[_0xdc30('0x62')]['id'],'ContactId':_0x51f050['id'],'OpenchannelAccountId':_0x435419['id'],'lastMsgDirection':_0xdc30('0xbc'),'firstMsgDirection':_0xdc30('0xbc'),'Messages':[_['merge'](_0x2c72ea['body'],{'read':![],'body':_0x2c72ea['body'][_0xdc30('0x5f')],'OpenchannelAccountId':_0x435419['id'],'UserId':_0x2c72ea['user']['id'],'ContactId':_0x51f050['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xdc30('0xbd')}]})[_0xdc30('0x20')](function(_0x543dbb){return[_0x543dbb,!![]];});});}})[_0xdc30('0x91')](function(_0x4f9b62,_0x8e160e){if(_0x8e160e){return _0x4f9b62;}return db[_0xdc30('0x9b')][_0xdc30('0x5e')](_[_0xdc30('0x52')](_0x2c72ea['body'],{'read':![],'body':_0x2c72ea[_0xdc30('0x5f')]['body'],'OpenchannelAccountId':_0x435419['id'],'OpenchannelInteractionId':_0x4f9b62['id'],'UserId':_0x2c72ea[_0xdc30('0x62')]['id'],'ContactId':_0x51f050['id']}))[_0xdc30('0x20')](function(_0x570642){_0x4f9b62[_0xdc30('0xbe')][_0xdc30('0xbd')]=[];_0x4f9b62[_0xdc30('0xbe')]['Messages'][_0xdc30('0xbf')](_0x570642[_0xdc30('0xbe')]);return _0x4f9b62;});});}})[_0xdc30('0x20')](respondWithResult(_0x3a4a97,null))[_0xdc30('0x2a')](handleError(_0x3a4a97,null));}; \ No newline at end of file +var _0xf9fd=['CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','send','getApplications','Contact','Owner','fullname','internal','Tag','tag','addAgents','omit','userOpenchannelAccount:save','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','dataValues','Messages','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','show','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','addAnswer'];(function(_0x24b043,_0x1bc6be){var _0x360404=function(_0xa19182){while(--_0xa19182){_0x24b043['push'](_0x24b043['shift']());}};_0x360404(++_0x1bc6be);}(_0xf9fd,0x118));var _0xdf9f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf9fd[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xdf9f('0x0'));var rimraf=require(_0xdf9f('0x1'));var zipdir=require(_0xdf9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf9f('0x3'));var moment=require(_0xdf9f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf9f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdf9f('0x6'));var csv=require('to-csv');var ejs=require(_0xdf9f('0x7'));var fs=require('fs');var fs_extra=require(_0xdf9f('0x8'));var _=require('lodash');var squel=require(_0xdf9f('0x9'));var crypto=require(_0xdf9f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdf9f('0xb'));var toCsv=require(_0xdf9f('0xc'));var querystring=require('querystring');var Papa=require(_0xdf9f('0xd'));var Redis=require(_0xdf9f('0xe'));var authService=require(_0xdf9f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdf9f('0x10'));var hardwareService=require(_0xdf9f('0x11'));var logger=require(_0xdf9f('0x12'))(_0xdf9f('0x13'));var utils=require(_0xdf9f('0x14'));var config=require(_0xdf9f('0x15'));var licenseUtil=require(_0xdf9f('0x16'));var db=require(_0xdf9f('0x17'))['db'];config['redis']=_[_0xdf9f('0x18')](config['redis'],{'host':_0xdf9f('0x19'),'port':0x18eb});var socket=require(_0xdf9f('0x1a'))(new Redis(config[_0xdf9f('0x1b')]));require(_0xdf9f('0x1c'))[_0xdf9f('0x1d')](socket);var jayson=require(_0xdf9f('0x1e'));var client=jayson[_0xdf9f('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xdf9f('0x1f')][_0xdf9f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x180627,_0x6fb173,_0x4bac62,_0x33e541){return new BPromise(function(_0x4885d4,_0x387d15){var _0x1205c2=_0x33e541||client;return _0x1205c2[_0xdf9f('0x21')](_0x180627,_0x4bac62)[_0xdf9f('0x22')](function(_0x552b3b){logger[_0xdf9f('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x6fb173,_0xdf9f('0x24'));logger[_0xdf9f('0x25')](_0xdf9f('0x26'),_0x6fb173,_0xdf9f('0x24'),JSON[_0xdf9f('0x27')](_0x552b3b));if(_0x552b3b[_0xdf9f('0x28')]){if(_0x552b3b[_0xdf9f('0x28')]['code']===0x1f4){logger[_0xdf9f('0x28')](_0xdf9f('0x29'),_0x6fb173,_0x552b3b['error'][_0xdf9f('0x2a')]);return _0x387d15(_0x552b3b['error'][_0xdf9f('0x2a')]);}logger[_0xdf9f('0x28')](_0xdf9f('0x29'),_0x6fb173,_0x552b3b[_0xdf9f('0x28')][_0xdf9f('0x2a')]);return _0x4885d4(_0x552b3b[_0xdf9f('0x28')]['message']);}else{logger['info'](_0xdf9f('0x29'),_0x6fb173,_0xdf9f('0x24'));_0x4885d4(_0x552b3b[_0xdf9f('0x2b')][_0xdf9f('0x2a')]);}})[_0xdf9f('0x2c')](function(_0x2ce75d){logger[_0xdf9f('0x28')](_0xdf9f('0x29'),_0x6fb173,_0x2ce75d);_0x387d15(_0x2ce75d);});});}function respondWithStatusCode(_0x4c96bc,_0x3a3e74){_0x3a3e74=_0x3a3e74||0xcc;return function(_0x5b82b1){if(_0x5b82b1){return _0x4c96bc[_0xdf9f('0x2d')](_0x3a3e74);}return _0x4c96bc[_0xdf9f('0x2e')](_0x3a3e74)[_0xdf9f('0x2f')]();};}function respondWithResult(_0x2955b5,_0x57b516){_0x57b516=_0x57b516||0xc8;return function(_0x495c0b){if(_0x495c0b){return _0x2955b5[_0xdf9f('0x2e')](_0x57b516)[_0xdf9f('0x30')](_0x495c0b);}};}function respondWithFilteredResult(_0x37ad46,_0x498805){return function(_0x3dc6f0){if(_0x3dc6f0){var _0x1d1867=typeof _0x498805[_0xdf9f('0x31')]==='undefined'&&typeof _0x498805[_0xdf9f('0x32')]==='undefined';var _0x3fad42=_0x3dc6f0[_0xdf9f('0x33')];var _0x2793c6=_0x1d1867?0x0:_0x498805[_0xdf9f('0x31')];var _0x549cba=_0x1d1867?_0x3dc6f0[_0xdf9f('0x33')]:_0x498805['offset']+_0x498805[_0xdf9f('0x32')];var _0x29846c;if(_0x549cba>=_0x3fad42){_0x549cba=_0x3fad42;_0x29846c=0xc8;}else{_0x29846c=0xce;}_0x37ad46['status'](_0x29846c);return _0x37ad46[_0xdf9f('0x34')](_0xdf9f('0x35'),_0x2793c6+'-'+_0x549cba+'/'+_0x3fad42)[_0xdf9f('0x30')](_0x3dc6f0);}return null;};}function patchUpdates(_0x2068f8){return function(_0x47b955){try{jsonpatch[_0xdf9f('0x36')](_0x47b955,_0x2068f8,!![]);}catch(_0x4e9d2a){return BPromise['reject'](_0x4e9d2a);}return _0x47b955[_0xdf9f('0x37')]();};}function saveUpdates(_0x174347,_0x3f6e0f){return function(_0x5998ce){if(_0x5998ce){return _0x5998ce[_0xdf9f('0x38')](_0x174347)['then'](function(_0x867d49){return _0x867d49;});}return null;};}function removeEntity(_0x2c2d1a,_0x510c8a){return function(_0x26001a){if(_0x26001a){return _0x26001a[_0xdf9f('0x39')]()[_0xdf9f('0x22')](function(){var _0x47665e=_0x26001a[_0xdf9f('0x3a')]({'plain':!![]});var _0x26d799='OpenchannelAccounts';return db[_0xdf9f('0x3b')][_0xdf9f('0x39')]({'where':{'type':_0x26d799,'resourceId':_0x47665e['id']}})[_0xdf9f('0x22')](function(){return _0x26001a;});})[_0xdf9f('0x22')](function(){_0x2c2d1a[_0xdf9f('0x2e')](0xcc)[_0xdf9f('0x2f')]();});}};}function handleEntityNotFound(_0x480a79,_0x169408){return function(_0x438e9d){if(!_0x438e9d){_0x480a79['sendStatus'](0x194);}return _0x438e9d;};}function handleError(_0x597c8a,_0x4c17f3){_0x4c17f3=_0x4c17f3||0x1f4;return function(_0x17cc2b){logger[_0xdf9f('0x28')](_0x17cc2b['stack']);if(_0x17cc2b[_0xdf9f('0x3c')]){delete _0x17cc2b[_0xdf9f('0x3c')];}_0x597c8a[_0xdf9f('0x2e')](_0x4c17f3)['send'](_0x17cc2b);};}exports[_0xdf9f('0x3d')]=function(_0x24f6e,_0x142f10){var _0x1e0fc7={'include':[{'model':db[_0xdf9f('0x3e')],'as':_0xdf9f('0x3f')}]},_0x484389={},_0x517c50={'count':0x0,'rows':[]};var _0x1fa305=_[_0xdf9f('0x40')](db[_0xdf9f('0x41')][_0xdf9f('0x42')],function(_0xea03d7){return{'name':_0xea03d7[_0xdf9f('0x43')],'type':_0xea03d7[_0xdf9f('0x44')][_0xdf9f('0x45')]};});_0x484389[_0xdf9f('0x46')]=_[_0xdf9f('0x40')](_0x1fa305,'name');_0x484389[_0xdf9f('0x47')]=_[_0xdf9f('0x48')](_0x24f6e[_0xdf9f('0x47')]);_0x484389[_0xdf9f('0x49')]=_['intersection'](_0x484389[_0xdf9f('0x46')],_0x484389[_0xdf9f('0x47')]);_0x1e0fc7[_0xdf9f('0x4a')]=_[_0xdf9f('0x4b')](_0x484389[_0xdf9f('0x46')],qs[_0xdf9f('0x4c')](_0x24f6e['query']['fields']));_0x1e0fc7[_0xdf9f('0x4a')]=_0x1e0fc7[_0xdf9f('0x4a')][_0xdf9f('0x4d')]?_0x1e0fc7[_0xdf9f('0x4a')]:_0x484389[_0xdf9f('0x46')];if(!_0x24f6e[_0xdf9f('0x47')][_0xdf9f('0x4e')](_0xdf9f('0x4f'))){_0x1e0fc7[_0xdf9f('0x32')]=qs[_0xdf9f('0x32')](_0x24f6e['query'][_0xdf9f('0x32')]);_0x1e0fc7[_0xdf9f('0x31')]=qs[_0xdf9f('0x31')](_0x24f6e[_0xdf9f('0x47')][_0xdf9f('0x31')]);}_0x1e0fc7['order']=qs[_0xdf9f('0x50')](_0x24f6e['query'][_0xdf9f('0x50')]);_0x1e0fc7[_0xdf9f('0x51')]=qs[_0xdf9f('0x49')](_[_0xdf9f('0x52')](_0x24f6e['query'],_0x484389[_0xdf9f('0x49')]),_0x1fa305);if(_0x24f6e[_0xdf9f('0x47')][_0xdf9f('0x53')]){_0x1e0fc7['where']=_[_0xdf9f('0x54')](_0x1e0fc7[_0xdf9f('0x51')],{'$or':_[_0xdf9f('0x40')](_0x1fa305,function(_0x3a9612){if(_0x3a9612['type']!=='VIRTUAL'){var _0x4aa0ad={};_0x4aa0ad[_0x3a9612[_0xdf9f('0x3c')]]={'$like':'%'+_0x24f6e['query']['filter']+'%'};return _0x4aa0ad;}})});}_0x1e0fc7=_['merge']({},_0x1e0fc7,_0x24f6e[_0xdf9f('0x55')]);var _0x2d409b={'where':_0x1e0fc7[_0xdf9f('0x51')]};return db['OpenchannelAccount'][_0xdf9f('0x33')](_0x2d409b)[_0xdf9f('0x22')](function(_0x2ece72){_0x517c50[_0xdf9f('0x33')]=_0x2ece72;if(_0x24f6e['query']['includeAll']){_0x1e0fc7['include']=[{'all':!![]}];}return db[_0xdf9f('0x41')][_0xdf9f('0x56')](_0x1e0fc7);})['then'](function(_0x3dacba){_0x517c50['rows']=_0x3dacba;return _0x517c50;})[_0xdf9f('0x22')](respondWithFilteredResult(_0x142f10,_0x1e0fc7))[_0xdf9f('0x2c')](handleError(_0x142f10,null));};exports[_0xdf9f('0x57')]=function(_0x37a443,_0x3bf34f){var _0x402893={'raw':![],'where':{'id':_0x37a443['params']['id']},'include':[{'model':db[_0xdf9f('0x3e')],'as':_0xdf9f('0x3f')}]},_0x324f3f={};_0x324f3f['model']=_[_0xdf9f('0x48')](db['OpenchannelAccount'][_0xdf9f('0x42')]);_0x324f3f['query']=_['keys'](_0x37a443[_0xdf9f('0x47')]);_0x324f3f[_0xdf9f('0x49')]=_[_0xdf9f('0x4b')](_0x324f3f[_0xdf9f('0x46')],_0x324f3f[_0xdf9f('0x47')]);_0x402893[_0xdf9f('0x4a')]=_['intersection'](_0x324f3f[_0xdf9f('0x46')],qs[_0xdf9f('0x4c')](_0x37a443[_0xdf9f('0x47')]['fields']));_0x402893[_0xdf9f('0x4a')]=_0x402893[_0xdf9f('0x4a')][_0xdf9f('0x4d')]?_0x402893[_0xdf9f('0x4a')]:_0x324f3f[_0xdf9f('0x46')];if(_0x37a443[_0xdf9f('0x47')][_0xdf9f('0x58')]){_0x402893[_0xdf9f('0x59')]=[{'all':!![]}];}_0x402893=_[_0xdf9f('0x54')]({},_0x402893,_0x37a443[_0xdf9f('0x55')]);return db[_0xdf9f('0x41')][_0xdf9f('0x5a')](_0x402893)[_0xdf9f('0x22')](handleEntityNotFound(_0x3bf34f,null))[_0xdf9f('0x22')](respondWithResult(_0x3bf34f,null))[_0xdf9f('0x2c')](handleError(_0x3bf34f,null));};exports['create']=function(_0x268298,_0x4fac22){return db[_0xdf9f('0x41')][_0xdf9f('0x5b')](_0x268298[_0xdf9f('0x5c')],{})['then'](function(_0x21768f){var _0xc2197d=_0x268298[_0xdf9f('0x5d')][_0xdf9f('0x3a')]({'plain':!![]});if(!_0xc2197d)throw new Error(_0xdf9f('0x5e'));if(_0xc2197d[_0xdf9f('0x5f')]===_0xdf9f('0x5d')){var _0x5431a3=_0x21768f[_0xdf9f('0x3a')]({'plain':!![]});var _0x1fe439=_0xdf9f('0x60');return db[_0xdf9f('0x61')]['find']({'where':{'name':_0x1fe439,'userProfileId':_0xc2197d[_0xdf9f('0x62')]},'raw':!![]})[_0xdf9f('0x22')](function(_0x5e7f1a){if(_0x5e7f1a&&_0x5e7f1a[_0xdf9f('0x63')]===0x0){return db['UserProfileResource'][_0xdf9f('0x5b')]({'name':_0x5431a3[_0xdf9f('0x3c')],'resourceId':_0x5431a3['id'],'type':_0x5e7f1a[_0xdf9f('0x3c')],'sectionId':_0x5e7f1a['id']},{})[_0xdf9f('0x22')](function(){return _0x21768f;});}else{return _0x21768f;}})[_0xdf9f('0x2c')](function(_0x4ef2b6){logger['error'](_0xdf9f('0x64'),_0x4ef2b6);throw _0x4ef2b6;});}return _0x21768f;})[_0xdf9f('0x22')](respondWithResult(_0x4fac22,0xc9))[_0xdf9f('0x2c')](handleError(_0x4fac22,null));};exports[_0xdf9f('0x38')]=function(_0x3dcf84,_0x38f257){if(_0x3dcf84['body']['id']){delete _0x3dcf84[_0xdf9f('0x5c')]['id'];}return db[_0xdf9f('0x41')]['find']({'where':{'id':_0x3dcf84[_0xdf9f('0x65')]['id']},'include':[{'model':db[_0xdf9f('0x3e')],'as':_0xdf9f('0x3f')}]})[_0xdf9f('0x22')](handleEntityNotFound(_0x38f257,null))['then'](saveUpdates(_0x3dcf84[_0xdf9f('0x5c')],null))[_0xdf9f('0x22')](respondWithResult(_0x38f257,null))[_0xdf9f('0x2c')](handleError(_0x38f257,null));};exports[_0xdf9f('0x39')]=function(_0x3c2435,_0x4366ae){return db[_0xdf9f('0x41')][_0xdf9f('0x5a')]({'where':{'id':_0x3c2435[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x4366ae,null))[_0xdf9f('0x22')](removeEntity(_0x4366ae,null))[_0xdf9f('0x2c')](handleError(_0x4366ae,null));};exports[_0xdf9f('0x66')]=function(_0x37b903,_0x17ae57){return db[_0xdf9f('0x41')][_0xdf9f('0x66')]()[_0xdf9f('0x22')](respondWithResult(_0x17ae57,null))['catch'](handleError(_0x17ae57,null));};exports['addDisposition']=function(_0x468616,_0xc0984,_0x2e8835){if(_0x468616[_0xdf9f('0x5c')]['id']){delete _0x468616[_0xdf9f('0x5c')]['id'];}return db[_0xdf9f('0x41')][_0xdf9f('0x5a')]({'where':{'id':_0x468616[_0xdf9f('0x65')]['id']}})['then'](handleEntityNotFound(_0xc0984,null))['then'](function(_0xae050f){if(_0xae050f){_0x468616[_0xdf9f('0x5c')][_0xdf9f('0x67')]=_0xae050f['id'];return db[_0xdf9f('0x68')][_0xdf9f('0x5b')](_0x468616[_0xdf9f('0x5c')]);}})['then'](respondWithResult(_0xc0984,null))['catch'](handleError(_0xc0984,null));};exports[_0xdf9f('0x69')]=function(_0x372528,_0x101a37,_0x2c19ea){var _0x43503d={'raw':![],'where':{}};var _0x592d75={};var _0x4ead8d={'count':0x0,'rows':[]};return db[_0xdf9f('0x41')][_0xdf9f('0x6a')]({'where':{'id':_0x372528[_0xdf9f('0x65')]['id']}})['then'](handleEntityNotFound(_0x101a37,null))[_0xdf9f('0x22')](function(_0x312358){if(_0x312358){_0x592d75[_0xdf9f('0x46')]=_['keys'](db['Disposition'][_0xdf9f('0x42')]);_0x592d75[_0xdf9f('0x47')]=_[_0xdf9f('0x48')](_0x372528[_0xdf9f('0x47')]);_0x592d75[_0xdf9f('0x49')]=_[_0xdf9f('0x4b')](_0x592d75['model'],_0x592d75['query']);_0x43503d[_0xdf9f('0x4a')]=_[_0xdf9f('0x4b')](_0x592d75[_0xdf9f('0x46')],qs['fields'](_0x372528['query']['fields']));_0x43503d[_0xdf9f('0x4a')]=_0x43503d[_0xdf9f('0x4a')]['length']?_0x43503d[_0xdf9f('0x4a')]:_0x592d75[_0xdf9f('0x46')];if(!_0x372528[_0xdf9f('0x47')]['hasOwnProperty'](_0xdf9f('0x4f'))){_0x43503d['limit']=qs[_0xdf9f('0x32')](_0x372528[_0xdf9f('0x47')]['limit']);_0x43503d['offset']=qs[_0xdf9f('0x31')](_0x372528[_0xdf9f('0x47')][_0xdf9f('0x31')]);}_0x43503d[_0xdf9f('0x6b')]=qs['sort'](_0x372528[_0xdf9f('0x47')][_0xdf9f('0x50')]);_0x43503d[_0xdf9f('0x51')]=qs['filters'](_[_0xdf9f('0x52')](_0x372528[_0xdf9f('0x47')],_0x592d75[_0xdf9f('0x49')]));_0x43503d[_0xdf9f('0x51')][_0xdf9f('0x67')]=_0x312358['id'];if(_0x372528[_0xdf9f('0x47')]['filter']){_0x43503d[_0xdf9f('0x51')]=_[_0xdf9f('0x54')](_0x43503d['where'],{'$or':_['map'](_0x43503d['attributes'],function(_0x136732){var _0x5c276f={};_0x5c276f[_0x136732]={'$like':'%'+_0x372528['query'][_0xdf9f('0x53')]+'%'};return _0x5c276f;})});}_0x43503d=_['merge']({},_0x43503d,_0x372528['options']);return db[_0xdf9f('0x68')][_0xdf9f('0x33')]({'where':_0x43503d[_0xdf9f('0x51')]})['then'](function(_0xe8125f){_0x4ead8d[_0xdf9f('0x33')]=_0xe8125f;if(_0x372528[_0xdf9f('0x47')][_0xdf9f('0x58')]){_0x43503d['include']=[{'all':!![]}];}return db[_0xdf9f('0x68')][_0xdf9f('0x56')](_0x43503d);})['then'](function(_0x1aa808){_0x4ead8d[_0xdf9f('0x6c')]=_0x1aa808;return _0x4ead8d;});}})[_0xdf9f('0x22')](respondWithFilteredResult(_0x101a37,_0x43503d))['catch'](handleError(_0x101a37,null));};exports['removeDispositions']=function(_0x2b7f85,_0x227274,_0x90aa8f){return db['OpenchannelAccount'][_0xdf9f('0x5a')]({'where':{'id':_0x2b7f85[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x227274,null))['then'](function(_0x49c8f4){if(_0x49c8f4){return _0x49c8f4[_0xdf9f('0x6d')](_0x2b7f85[_0xdf9f('0x47')][_0xdf9f('0x6e')]);}})[_0xdf9f('0x22')](respondWithStatusCode(_0x227274,null))[_0xdf9f('0x2c')](handleError(_0x227274,null));};exports[_0xdf9f('0x6f')]=function(_0x2ec50a,_0x13d585,_0x464b34){if(_0x2ec50a[_0xdf9f('0x5c')]['id']){delete _0x2ec50a['body']['id'];}return db[_0xdf9f('0x41')]['find']({'where':{'id':_0x2ec50a[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x13d585,null))[_0xdf9f('0x22')](function(_0x146f77){if(_0x146f77){_0x2ec50a[_0xdf9f('0x5c')][_0xdf9f('0x67')]=_0x146f77['id'];return db[_0xdf9f('0x70')][_0xdf9f('0x5b')](_0x2ec50a[_0xdf9f('0x5c')]);}})[_0xdf9f('0x22')](respondWithResult(_0x13d585,null))['catch'](handleError(_0x13d585,null));};exports['getAnswers']=function(_0x12be67,_0x5b278c,_0x3024e6){var _0x34c9b9={'raw':![],'where':{}};var _0x5b341c={};var _0xcaf49d={'count':0x0,'rows':[]};return db[_0xdf9f('0x41')][_0xdf9f('0x6a')]({'where':{'id':_0x12be67[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x5b278c,null))['then'](function(_0x237891){if(_0x237891){_0x5b341c[_0xdf9f('0x46')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x5b341c[_0xdf9f('0x47')]=_['keys'](_0x12be67[_0xdf9f('0x47')]);_0x5b341c[_0xdf9f('0x49')]=_[_0xdf9f('0x4b')](_0x5b341c['model'],_0x5b341c[_0xdf9f('0x47')]);_0x34c9b9[_0xdf9f('0x4a')]=_[_0xdf9f('0x4b')](_0x5b341c[_0xdf9f('0x46')],qs[_0xdf9f('0x4c')](_0x12be67[_0xdf9f('0x47')][_0xdf9f('0x4c')]));_0x34c9b9['attributes']=_0x34c9b9[_0xdf9f('0x4a')][_0xdf9f('0x4d')]?_0x34c9b9[_0xdf9f('0x4a')]:_0x5b341c[_0xdf9f('0x46')];if(!_0x12be67['query']['hasOwnProperty'](_0xdf9f('0x4f'))){_0x34c9b9[_0xdf9f('0x32')]=qs[_0xdf9f('0x32')](_0x12be67[_0xdf9f('0x47')][_0xdf9f('0x32')]);_0x34c9b9[_0xdf9f('0x31')]=qs[_0xdf9f('0x31')](_0x12be67[_0xdf9f('0x47')][_0xdf9f('0x31')]);}_0x34c9b9[_0xdf9f('0x6b')]=qs['sort'](_0x12be67['query']['sort']);_0x34c9b9[_0xdf9f('0x51')]=qs[_0xdf9f('0x49')](_[_0xdf9f('0x52')](_0x12be67[_0xdf9f('0x47')],_0x5b341c['filters']));_0x34c9b9[_0xdf9f('0x51')][_0xdf9f('0x67')]=_0x237891['id'];if(_0x12be67[_0xdf9f('0x47')]['filter']){_0x34c9b9[_0xdf9f('0x51')]=_['merge'](_0x34c9b9[_0xdf9f('0x51')],{'$or':_[_0xdf9f('0x40')](_0x34c9b9[_0xdf9f('0x4a')],function(_0x1ef8c6){var _0x2fa197={};_0x2fa197[_0x1ef8c6]={'$like':'%'+_0x12be67[_0xdf9f('0x47')][_0xdf9f('0x53')]+'%'};return _0x2fa197;})});}_0x34c9b9=_[_0xdf9f('0x54')]({},_0x34c9b9,_0x12be67[_0xdf9f('0x55')]);return db[_0xdf9f('0x70')][_0xdf9f('0x33')]({'where':_0x34c9b9[_0xdf9f('0x51')]})['then'](function(_0x5e1035){_0xcaf49d[_0xdf9f('0x33')]=_0x5e1035;if(_0x12be67[_0xdf9f('0x47')][_0xdf9f('0x58')]){_0x34c9b9[_0xdf9f('0x59')]=[{'all':!![]}];}return db[_0xdf9f('0x70')][_0xdf9f('0x56')](_0x34c9b9);})[_0xdf9f('0x22')](function(_0x59a86a){_0xcaf49d[_0xdf9f('0x6c')]=_0x59a86a;return _0xcaf49d;});}})['then'](respondWithFilteredResult(_0x5b278c,_0x34c9b9))[_0xdf9f('0x2c')](handleError(_0x5b278c,null));};exports[_0xdf9f('0x71')]=function(_0x18525c,_0x25d173,_0x27a50d){return db[_0xdf9f('0x41')][_0xdf9f('0x5a')]({'where':{'id':_0x18525c[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x25d173,null))[_0xdf9f('0x22')](function(_0x1aef6f){if(_0x1aef6f){return _0x1aef6f['removeAnswers'](_0x18525c[_0xdf9f('0x47')][_0xdf9f('0x6e')]);}})['then'](respondWithStatusCode(_0x25d173,null))[_0xdf9f('0x2c')](handleError(_0x25d173,null));};exports[_0xdf9f('0x72')]=function(_0x1763d9,_0x443734,_0xd91c99){var _0xe3de4f={'body':_0x1763d9[_0xdf9f('0x5c')],'channel':_0xdf9f('0x73')};var _0x2fed59=[];var _0x5b2bb8=[];var _0x33d423={};var _0x6fda8b=![];return db[_0xdf9f('0x74')][_0xdf9f('0x66')]()[_0xdf9f('0x22')](function(_0x175628){if(!_0x175628){throw new db[(_0xdf9f('0x75'))][(_0xdf9f('0x76'))](_0xdf9f('0x77'));}_0x2fed59=_['difference'](_[_0xdf9f('0x48')](_0x175628),[_0xdf9f('0x78'),_0xdf9f('0x79')]);_0x5b2bb8=_[_0xdf9f('0x7a')](_[_0xdf9f('0x48')](_0x175628),['createdAt',_0xdf9f('0x79'),_0xdf9f('0x7b'),_0xdf9f('0x7c')]);if(_0x1763d9[_0xdf9f('0x5c')]['id']){delete _0x1763d9[_0xdf9f('0x5c')]['id'];}if(_['isNil'](_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x7d')])){throw new db[(_0xdf9f('0x75'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xdf9f('0x7e')](_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x5c')])||_0x1763d9['body'][_0xdf9f('0x5c')]===''){throw new db[(_0xdf9f('0x75'))][(_0xdf9f('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdf9f('0x7e')](_0x1763d9[_0xdf9f('0x5c')]['mapKey'])){throw new db[(_0xdf9f('0x75'))][(_0xdf9f('0x76'))](_0xdf9f('0x7f')+_0x5b2bb8);}if(!_[_0xdf9f('0x80')](_0x5b2bb8,_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x81')])){throw new db['Sequelize']['ValidationError'](_0xdf9f('0x82')+_0x5b2bb8);}_0x33d423[_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x81')]]=_0x1763d9['body'][_0xdf9f('0x7d')];})['then'](function(){return db[_0xdf9f('0x41')][_0xdf9f('0x5a')]({'where':{'id':_0x1763d9['params']['id']},'include':[{'model':db[_0xdf9f('0x83')],'as':_0xdf9f('0x84'),'include':[{'model':db[_0xdf9f('0x74')],'as':_0xdf9f('0x85'),'where':_0x33d423,'limit':0x1,'order':[[_0xdf9f('0x79'),'DESC']]}]},{'model':db[_0xdf9f('0x86')],'as':'Applications'}]});})[_0xdf9f('0x22')](handleEntityNotFound(_0x443734,null))[_0xdf9f('0x22')](function(_0x5253f5){if(_0x5253f5&&_0x5253f5[_0xdf9f('0x84')]){_0xe3de4f[_0xdf9f('0x87')]=_0x5253f5;_0xe3de4f[_0xdf9f('0x88')]=_0x5253f5[_0xdf9f('0x89')];_0xe3de4f[_0xdf9f('0x8a')]=_0x5253f5[_0xdf9f('0x84')];_0xe3de4f[_0xdf9f('0x88')]=_[_0xdf9f('0x8b')](_0xe3de4f[_0xdf9f('0x88')],[_0xdf9f('0x8c')],[_0xdf9f('0x8d')]);if(_0xe3de4f[_0xdf9f('0x87')][_0xdf9f('0x89')]){delete _0xe3de4f['account'][_0xdf9f('0x89')];}if(_0xe3de4f[_0xdf9f('0x87')]['List']&&_0xe3de4f[_0xdf9f('0x87')][_0xdf9f('0x84')][_0xdf9f('0x85')][_0xdf9f('0x4d')]){return _0xe3de4f[_0xdf9f('0x87')][_0xdf9f('0x84')]['Contacts'][0x0];}var _0x225a69=_[_0xdf9f('0x18')](_0x1763d9[_0xdf9f('0x5c')],{'firstName':_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x7d')],'ListId':_0x5253f5[_0xdf9f('0x7c')]});_0x225a69[_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x81')]]=_0x1763d9['body']['from'];return db[_0xdf9f('0x74')][_0xdf9f('0x5b')](_0x225a69,{'fields':_0x2fed59,'raw':!![]});}})[_0xdf9f('0x22')](handleEntityNotFound(_0x443734,null))[_0xdf9f('0x22')](function(_0x46f9cc){_0xe3de4f[_0xdf9f('0x8e')]=_0x46f9cc;if(_0x46f9cc){var _0x405060={'ContactId':_0x46f9cc['id'],'OpenchannelAccountId':_0x1763d9[_0xdf9f('0x65')]['id'],'from':(_0x46f9cc[_0xdf9f('0x8f')]||'')+'\x20'+(_0x46f9cc[_0xdf9f('0x90')]||'')};var _0x755289={'OpenchannelAccountId':_0x1763d9[_0xdf9f('0x65')]['id'],'closed':![]};if(_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x91')]){_0x755289[_0xdf9f('0x91')]=_0x1763d9['body']['threadId'];return db[_0xdf9f('0x92')]['find']({'where':_0x755289})[_0xdf9f('0x22')](function(_0x4f5a2d){if(_0x4f5a2d){return[_0x4f5a2d,![]];}_0x405060[_0xdf9f('0x91')]=_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x91')];_0x405060['externalUrl']=_0x1763d9[_0xdf9f('0x5c')]['externalUrl'];return db['OpenchannelInteraction'][_0xdf9f('0x5b')](_0x405060)[_0xdf9f('0x22')](function(_0x994837){return[_0x994837,!![]];});});}else{_0x755289[_0xdf9f('0x91')]=null;}_0x755289[_0xdf9f('0x93')]=_0x46f9cc['id'];return db['OpenchannelInteraction']['find']({'where':_0x755289})[_0xdf9f('0x22')](function(_0x4f74d0){if(_0x4f74d0){return[_0x4f74d0,![]];}return db[_0xdf9f('0x92')][_0xdf9f('0x5b')](_0x405060)[_0xdf9f('0x22')](function(_0x583cc0){return[_0x583cc0,!![]];});});}})[_0xdf9f('0x94')](function(_0x825312,_0x145181){if(_0x825312){_0x6fda8b=_0x145181;if(!_0x145181){var _0x3c6848={'from':(_0xe3de4f[_0xdf9f('0x8e')][_0xdf9f('0x8f')]||'')+'\x20'+(_0xe3de4f[_0xdf9f('0x8e')][_0xdf9f('0x90')]||'')};if(_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x91')]&&_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x95')]&&_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x91')]!=_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x95')]){_0x3c6848[_0xdf9f('0x91')]=_0x1763d9[_0xdf9f('0x5c')]['messageId'];}return _0x825312[_0xdf9f('0x38')](_0x3c6848);}else{return _0x825312;}}})[_0xdf9f('0x22')](function(_0x24cda2){_0xe3de4f[_0xdf9f('0x96')]=_0x24cda2[_0xdf9f('0x3a')]({'plain':!![]});_0xe3de4f['interaction'][_0xdf9f('0x97')]=_0x6fda8b;if(_0xe3de4f[_0xdf9f('0x96')][_0xdf9f('0x97')]){if(_0xe3de4f['account'][_0xdf9f('0x98')]){_0xe3de4f[_0xdf9f('0x88')][_0xdf9f('0x99')]({'id':0x0,'priority':_0xe3de4f['applications'][_0xdf9f('0x4d')]+0x1,'app':_0xdf9f('0x9a'),'appdata':'unmanaged','interval':_0xdf9f('0x9b')});}}return db[_0xdf9f('0x9c')][_0xdf9f('0x5b')]({'body':_0x1763d9['body']['body'],'OpenchannelAccountId':_0x1763d9[_0xdf9f('0x65')]['id'],'OpenchannelInteractionId':_0x24cda2['id'],'direction':'in','ContactId':_0xe3de4f['contact']['id'],'AttachmentId':_0x1763d9[_0xdf9f('0x5c')][_0xdf9f('0x9d')]});})[_0xdf9f('0x22')](function(_0x1dc2cc){_0xe3de4f[_0xdf9f('0x2a')]=_0x1dc2cc;if(_0xe3de4f[_0xdf9f('0x96')]['UserId']){return db[_0xdf9f('0x9e')][_0xdf9f('0x5a')]({'attributes':['id',_0xdf9f('0x3c')],'where':{'id':_0xe3de4f[_0xdf9f('0x96')][_0xdf9f('0x9f')]}})['then'](function(_0x50bdb7){if(_0x50bdb7){_0xe3de4f[_0xdf9f('0x88')][_0xdf9f('0xa0')]({'id':0x0,'priority':0x0,'app':_0xdf9f('0xa1'),'appdata':_0x50bdb7[_0xdf9f('0x3c')]+','+(_0xe3de4f[_0xdf9f('0x87')][_0xdf9f('0xa2')]||0xa),'interval':_0xdf9f('0x9b')});_0xe3de4f[_0xdf9f('0xa3')]=![];}return respondWithRpcPromise(_0xdf9f('0xa4'),_0xdf9f('0xa5'),_0xe3de4f);});}return respondWithRpcPromise(_0xdf9f('0xa4'),'startRouting',_0xe3de4f);})['then'](function(_0x289d6d){respondWithRpcPromise(_0xdf9f('0xa6'),'EventManager',{'event':_0xdf9f('0x72'),'message':_0x289d6d},client9002);return _0x289d6d;})[_0xdf9f('0x22')](respondWithResult(_0x443734,null))['catch'](handleError(_0x443734,null));};exports[_0xdf9f('0xa7')]=function(_0x55ca23,_0x33b2e9){var _0x533681=_0x55ca23[_0xdf9f('0x65')]['id'];var _0x1a830f=_0x55ca23[_0xdf9f('0x5c')];var _0x5c4cab=0xc8;var _0x5b6be4=null;return db[_0xdf9f('0xa8')][_0xdf9f('0xa9')]({'isolationLevel':db['sequelize'][_0xdf9f('0xaa')][_0xdf9f('0xab')][_0xdf9f('0xac')]},function(_0x2ef79c){return db[_0xdf9f('0x41')][_0xdf9f('0x6a')]({'where':{'id':_0x533681},'transaction':_0x2ef79c})[_0xdf9f('0x22')](function(_0x36f07b){if(_0x36f07b){return db[_0xdf9f('0x86')][_0xdf9f('0x39')]({'where':{'OpenchannelAccountId':_0x533681},'transaction':_0x2ef79c})[_0xdf9f('0x22')](function(){var _0x3bd57b=_[_0xdf9f('0x40')](_0x1a830f,function(_0x3e8ada){_0x3e8ada[_0xdf9f('0x67')]=_0x533681;return _0x3e8ada;});return db[_0xdf9f('0x86')][_0xdf9f('0xad')](_0x3bd57b,{'transaction':_0x2ef79c});});}else{_0x5c4cab=0x194;_0x5b6be4=[];}});})[_0xdf9f('0x22')](function(){if(_0x5c4cab!==0x194){return db[_0xdf9f('0x86')][_0xdf9f('0xae')]({'where':{'OpenchannelAccountId':_0x533681},'order':_0xdf9f('0x8c')})[_0xdf9f('0x22')](function(_0x4cfa69){_0x5b6be4=_0x4cfa69;});}})[_0xdf9f('0x2c')](function(_0x205d19){_0x5c4cab=0x1f4;logger[_0xdf9f('0x28')](_0x205d19[_0xdf9f('0xaf')]);if(_0x205d19[_0xdf9f('0x3c')]){delete _0x205d19['name'];}_0x5b6be4=_0x205d19;})[_0xdf9f('0xb0')](function(){if(_0x5b6be4===null){_0x33b2e9[_0xdf9f('0x2d')](_0x5c4cab);}else{if(_0x5c4cab===0x1f4){_0x33b2e9[_0xdf9f('0x2e')](_0x5c4cab)[_0xdf9f('0xb1')](_0x5b6be4);}else{_0x33b2e9[_0xdf9f('0x2e')](_0x5c4cab)['json'](_0x5b6be4);}}});};exports[_0xdf9f('0xb2')]=function(_0x54941d,_0x940f8d,_0x3bee4b){var _0x1a4480={};var _0x43ee35={};var _0x53dd40;var _0x382849;return db[_0xdf9f('0x41')][_0xdf9f('0x6a')]({'where':{'id':_0x54941d['params']['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x940f8d,null))[_0xdf9f('0x22')](function(_0x7c7496){if(_0x7c7496){_0x53dd40=_0x7c7496;_0x43ee35[_0xdf9f('0x46')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x43ee35[_0xdf9f('0x47')]=_[_0xdf9f('0x48')](_0x54941d[_0xdf9f('0x47')]);_0x43ee35[_0xdf9f('0x49')]=_[_0xdf9f('0x4b')](_0x43ee35[_0xdf9f('0x46')],_0x43ee35[_0xdf9f('0x47')]);_0x1a4480[_0xdf9f('0x4a')]=_[_0xdf9f('0x4b')](_0x43ee35[_0xdf9f('0x46')],qs[_0xdf9f('0x4c')](_0x54941d['query'][_0xdf9f('0x4c')]));_0x1a4480['attributes']=_0x1a4480[_0xdf9f('0x4a')][_0xdf9f('0x4d')]?_0x1a4480[_0xdf9f('0x4a')]:_0x43ee35['model'];_0x1a4480[_0xdf9f('0x6b')]=qs['sort'](_0x54941d['query'][_0xdf9f('0x50')]);_0x1a4480['where']=qs[_0xdf9f('0x49')](_[_0xdf9f('0x52')](_0x54941d['query'],_0x43ee35[_0xdf9f('0x49')]));if(_0x54941d['query'][_0xdf9f('0x53')]){_0x1a4480['where']=_[_0xdf9f('0x54')](_0x1a4480['where'],{'$or':_[_0xdf9f('0x40')](_0x1a4480[_0xdf9f('0x4a')],function(_0x3af7cb){var _0x547e37={};_0x547e37[_0x3af7cb]={'$like':'%'+_0x54941d['query'][_0xdf9f('0x53')]+'%'};return _0x547e37;})});}_0x1a4480=_[_0xdf9f('0x54')]({},_0x1a4480,_0x54941d['options']);return _0x53dd40[_0xdf9f('0xb2')](_0x1a4480);}})[_0xdf9f('0x22')](function(_0x474f52){if(_0x474f52){_0x382849=_0x474f52[_0xdf9f('0x4d')];if(!_0x54941d['query'][_0xdf9f('0x4e')]('nolimit')){_0x1a4480[_0xdf9f('0x32')]=qs[_0xdf9f('0x32')](_0x54941d[_0xdf9f('0x47')][_0xdf9f('0x32')]);_0x1a4480['offset']=qs[_0xdf9f('0x31')](_0x54941d['query'][_0xdf9f('0x31')]);}return _0x53dd40[_0xdf9f('0xb2')](_0x1a4480);}})[_0xdf9f('0x22')](function(_0x19cc03){if(_0x19cc03){return _0x19cc03?{'count':_0x382849,'rows':_0x19cc03}:null;}})['then'](respondWithResult(_0x940f8d,null))[_0xdf9f('0x2c')](handleError(_0x940f8d,null));};exports['getInteractions']=function(_0x401b53,_0x1ec46d,_0x424dc){var _0x4fec8c={'raw':![],'where':{}};var _0x2d7e19={};var _0x4b3319={'count':0x0,'rows':[]};return db[_0xdf9f('0x41')][_0xdf9f('0x6a')]({'where':{'id':_0x401b53[_0xdf9f('0x65')]['id']}})['then'](handleEntityNotFound(_0x1ec46d,null))[_0xdf9f('0x22')](function(_0x3d61f6){if(_0x3d61f6){_0x2d7e19[_0xdf9f('0x46')]=_['keys'](db[_0xdf9f('0x92')][_0xdf9f('0x42')]);_0x2d7e19[_0xdf9f('0x47')]=_['keys'](_0x401b53[_0xdf9f('0x47')]);_0x2d7e19[_0xdf9f('0x49')]=_[_0xdf9f('0x4b')](_0x2d7e19[_0xdf9f('0x46')],_0x2d7e19['query']);_0x4fec8c[_0xdf9f('0x4a')]=_[_0xdf9f('0x4b')](_0x2d7e19[_0xdf9f('0x46')],qs[_0xdf9f('0x4c')](_0x401b53[_0xdf9f('0x47')][_0xdf9f('0x4c')]));_0x4fec8c[_0xdf9f('0x4a')]=_0x4fec8c['attributes'][_0xdf9f('0x4d')]?_0x4fec8c[_0xdf9f('0x4a')]:_0x2d7e19[_0xdf9f('0x46')];if(!_0x401b53[_0xdf9f('0x47')][_0xdf9f('0x4e')](_0xdf9f('0x4f'))){_0x4fec8c[_0xdf9f('0x32')]=qs['limit'](_0x401b53[_0xdf9f('0x47')][_0xdf9f('0x32')]);_0x4fec8c[_0xdf9f('0x31')]=qs['offset'](_0x401b53['query']['offset']);}_0x4fec8c[_0xdf9f('0x6b')]=qs[_0xdf9f('0x50')](_0x401b53['query']['sort']);_0x4fec8c['where']=qs[_0xdf9f('0x49')](_['pick'](_0x401b53[_0xdf9f('0x47')],_0x2d7e19[_0xdf9f('0x49')]));_0x4fec8c['where']['OpenchannelAccountId']=_0x3d61f6['id'];if(_0x401b53[_0xdf9f('0x47')][_0xdf9f('0x53')]){_0x4fec8c[_0xdf9f('0x51')]=_['merge'](_0x4fec8c['where'],{'$or':_[_0xdf9f('0x40')](_0x4fec8c[_0xdf9f('0x4a')],function(_0x3a34f1){var _0x1712c5={};_0x1712c5[_0x3a34f1]={'$like':'%'+_0x401b53[_0xdf9f('0x47')][_0xdf9f('0x53')]+'%'};return _0x1712c5;})});}_0x4fec8c=_['merge']({},_0x4fec8c,_0x401b53[_0xdf9f('0x55')]);return db['OpenchannelInteraction']['count']({'where':_0x4fec8c['where']})['then'](function(_0x4c301d){_0x4b3319[_0xdf9f('0x33')]=_0x4c301d;if(_0x401b53['query'][_0xdf9f('0x58')]){_0x4fec8c[_0xdf9f('0x59')]=[{'model':db['CmContact'],'as':_0xdf9f('0xb3'),'required':![]},{'model':db[_0xdf9f('0x9e')],'as':_0xdf9f('0xb4'),'attributes':[_0xdf9f('0x3c'),_0xdf9f('0xb5'),_0xdf9f('0xb6')],'required':![]},{'model':db[_0xdf9f('0xb7')],'as':'Tags','attributes':['id',_0xdf9f('0x3c'),'color'],'where':_0x401b53[_0xdf9f('0x47')]['tag']?{'id':_0x401b53[_0xdf9f('0x47')][_0xdf9f('0xb8')]}:undefined,'required':_0x401b53[_0xdf9f('0x47')][_0xdf9f('0xb8')]?!![]:![]}];}return db[_0xdf9f('0x92')][_0xdf9f('0x56')](_0x4fec8c);})[_0xdf9f('0x22')](function(_0x56f06a){_0x4b3319[_0xdf9f('0x6c')]=_0x56f06a;return _0x4b3319;});}})['then'](respondWithFilteredResult(_0x1ec46d,_0x4fec8c))[_0xdf9f('0x2c')](handleError(_0x1ec46d,null));};exports[_0xdf9f('0xb9')]=function(_0x5d4b11,_0x457c27,_0x1a04ce){return db['OpenchannelAccount'][_0xdf9f('0x5a')]({'where':{'id':_0x5d4b11[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x457c27,null))[_0xdf9f('0x22')](function(_0x60553a){if(_0x60553a){return _0x60553a[_0xdf9f('0xb9')](_0x5d4b11['body']['ids'],_[_0xdf9f('0xba')](_0x5d4b11['body'],[_0xdf9f('0x6e'),'id'])||{})[_0xdf9f('0x94')](function(_0x2916bb){for(var _0x37b4e1=0x0;_0x37b4e1<_0x5d4b11[_0xdf9f('0x5c')][_0xdf9f('0x6e')][_0xdf9f('0x4d')];_0x37b4e1+=0x1){socket['emit'](_0xdf9f('0xbb'),{'UserId':Number(_0x5d4b11[_0xdf9f('0x5c')][_0xdf9f('0x6e')][_0x37b4e1]),'OpenchannelAccountId':Number(_0x5d4b11['params']['id'])});}return _0x2916bb;});}})['then'](respondWithResult(_0x457c27,null))['catch'](handleError(_0x457c27,null));};exports['removeAgents']=function(_0x384f79,_0xf32ddc,_0x32f190){return db[_0xdf9f('0x41')]['find']({'where':{'id':_0x384f79[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0xf32ddc,null))['then'](function(_0x407b87){if(_0x407b87){return _0x407b87['removeAgents'](_0x384f79[_0xdf9f('0x47')][_0xdf9f('0x6e')])[_0xdf9f('0x22')](function(){if(_['isArray'](_0x384f79[_0xdf9f('0x47')][_0xdf9f('0x6e')])){for(var _0x1f0f2d=0x0;_0x1f0f2d<_0x384f79[_0xdf9f('0x47')][_0xdf9f('0x6e')]['length'];_0x1f0f2d+=0x1){socket[_0xdf9f('0xbc')](_0xdf9f('0xbd'),{'UserId':Number(_0x384f79[_0xdf9f('0x47')][_0xdf9f('0x6e')][_0x1f0f2d]),'OpenchannelAccountId':Number(_0x384f79[_0xdf9f('0x65')]['id'])});}}else{socket[_0xdf9f('0xbc')](_0xdf9f('0xbd'),{'UserId':Number(_0x384f79['query'][_0xdf9f('0x6e')]),'OpenchannelAccountId':Number(_0x384f79['params']['id'])});}});}})[_0xdf9f('0x22')](respondWithStatusCode(_0xf32ddc,null))['catch'](handleError(_0xf32ddc,null));};exports[_0xdf9f('0xbe')]=function(_0x478394,_0xa53052,_0x314b4c){var _0x1f82b5={};var _0x3f31cf={};var _0x257b0b;var _0x238edc;return db[_0xdf9f('0x41')][_0xdf9f('0x6a')]({'where':{'id':_0x478394[_0xdf9f('0x65')]['id']}})['then'](handleEntityNotFound(_0xa53052,null))['then'](function(_0x1dde7e){if(_0x1dde7e){_0x257b0b=_0x1dde7e;_0x3f31cf[_0xdf9f('0x46')]=_['keys'](db['User'][_0xdf9f('0x42')]);_0x3f31cf[_0xdf9f('0x47')]=_['keys'](_0x478394[_0xdf9f('0x47')]);_0x3f31cf[_0xdf9f('0x49')]=_[_0xdf9f('0x4b')](_0x3f31cf[_0xdf9f('0x46')],_0x3f31cf['query']);_0x1f82b5[_0xdf9f('0x4a')]=_[_0xdf9f('0x4b')](_0x3f31cf[_0xdf9f('0x46')],qs['fields'](_0x478394['query'][_0xdf9f('0x4c')]));_0x1f82b5[_0xdf9f('0x4a')]=_0x1f82b5[_0xdf9f('0x4a')][_0xdf9f('0x4d')]?_0x1f82b5[_0xdf9f('0x4a')]:_0x3f31cf['model'];_0x1f82b5['order']=qs['sort'](_0x478394[_0xdf9f('0x47')][_0xdf9f('0x50')]);_0x1f82b5[_0xdf9f('0x51')]=qs[_0xdf9f('0x49')](_[_0xdf9f('0x52')](_0x478394[_0xdf9f('0x47')],_0x3f31cf['filters']));if(_0x478394['query'][_0xdf9f('0x53')]){_0x1f82b5[_0xdf9f('0x51')]=_[_0xdf9f('0x54')](_0x1f82b5[_0xdf9f('0x51')],{'$or':_[_0xdf9f('0x40')](_0x1f82b5[_0xdf9f('0x4a')],function(_0x27b2c9){var _0x1c2780={};_0x1c2780[_0x27b2c9]={'$like':'%'+_0x478394[_0xdf9f('0x47')][_0xdf9f('0x53')]+'%'};return _0x1c2780;})});}_0x1f82b5=_[_0xdf9f('0x54')]({},_0x1f82b5,_0x478394['options']);return _0x257b0b[_0xdf9f('0xbe')](_0x1f82b5);}})[_0xdf9f('0x22')](function(_0x3ed359){if(_0x3ed359){_0x238edc=_0x3ed359['length'];if(!_0x478394[_0xdf9f('0x47')][_0xdf9f('0x4e')](_0xdf9f('0x4f'))){_0x1f82b5[_0xdf9f('0x32')]=qs[_0xdf9f('0x32')](_0x478394['query'][_0xdf9f('0x32')]);_0x1f82b5[_0xdf9f('0x31')]=qs[_0xdf9f('0x31')](_0x478394[_0xdf9f('0x47')]['offset']);}return _0x257b0b[_0xdf9f('0xbe')](_0x1f82b5);}})['then'](function(_0x5c762d){if(_0x5c762d){return _0x5c762d?{'count':_0x238edc,'rows':_0x5c762d}:null;}})['then'](respondWithResult(_0xa53052,null))[_0xdf9f('0x2c')](handleError(_0xa53052,null));};exports['send']=function(_0x35bb2f,_0x5db9c1,_0x45b1cb){var _0x122780,_0x3bb9f6,_0x1829d4;if(_[_0xdf9f('0x7e')](_0x35bb2f['body'][_0xdf9f('0x5c')])||_0x35bb2f[_0xdf9f('0x5c')]['body']===''){throw new db[(_0xdf9f('0x75'))]['ValidationError'](_0xdf9f('0xbf'));}if(_[_0xdf9f('0x7e')](_0x35bb2f[_0xdf9f('0x5c')]['to'])){}_0x122780=_0x35bb2f[_0xdf9f('0x5c')]['to'];return db[_0xdf9f('0x41')]['findOne']({'where':{'id':_0x35bb2f[_0xdf9f('0x65')]['id']}})[_0xdf9f('0x22')](handleEntityNotFound(_0x5db9c1,null))[_0xdf9f('0x22')](function(_0x58960d){if(_0x58960d){return db[_0xdf9f('0x41')][_0xdf9f('0x5a')]({'where':{'id':_0x58960d['id']},'include':[{'model':db[_0xdf9f('0x83')],'as':_0xdf9f('0x84'),'include':[{'model':db[_0xdf9f('0x74')],'as':_0xdf9f('0x85'),'where':{[_0x58960d[_0xdf9f('0x81')]]:_0x122780},'limit':0x1,'order':[['updatedAt',_0xdf9f('0xc0')]]}]}]})[_0xdf9f('0x22')](handleEntityNotFound(_0x5db9c1,null))[_0xdf9f('0x22')](function(_0x2aaf20){if(_0x2aaf20&&_0x2aaf20[_0xdf9f('0x84')]){_0x3bb9f6=_0x2aaf20[_0xdf9f('0x3a')]({'plain':!![]});if(_0x3bb9f6[_0xdf9f('0x84')]&&_0x3bb9f6['List'][_0xdf9f('0x85')][_0xdf9f('0x4d')]){return _0x3bb9f6[_0xdf9f('0x84')][_0xdf9f('0x85')][0x0];}return db[_0xdf9f('0x74')][_0xdf9f('0x5b')](_[_0xdf9f('0x18')](_0x35bb2f[_0xdf9f('0x5c')],{'firstName':_0x122780,[_0x2aaf20[_0xdf9f('0x81')]]:_0x122780,'phone':_0x122780,'ListId':_0x3bb9f6[_0xdf9f('0x7c')]}));}})['then'](handleEntityNotFound(_0x5db9c1,null))[_0xdf9f('0x22')](function(_0x3d4192){if(_0x3d4192){_0x1829d4=_0x3d4192;return db[_0xdf9f('0x92')][_0xdf9f('0x5a')]({'where':{'ContactId':_0x1829d4['id'],'closed':![],'OpenchannelAccountId':_0x3bb9f6['id']}})[_0xdf9f('0x22')](function(_0x52a1a9){if(_0x52a1a9){return[_0x52a1a9,![]];}return db[_0xdf9f('0x92')]['create']({'UserId':_0x35bb2f[_0xdf9f('0x5d')]['id'],'ContactId':_0x1829d4['id'],'OpenchannelAccountId':_0x3bb9f6['id'],'lastMsgDirection':_0xdf9f('0xc1'),'firstMsgDirection':'out','Messages':[_['merge'](_0x35bb2f['body'],{'read':![],'body':_0x35bb2f[_0xdf9f('0x5c')]['body'],'OpenchannelAccountId':_0x3bb9f6['id'],'UserId':_0x35bb2f[_0xdf9f('0x5d')]['id'],'ContactId':_0x1829d4['id']})]},{'include':[{'model':db[_0xdf9f('0x9c')],'as':'Messages'}]})[_0xdf9f('0x22')](function(_0x5aca20){return[_0x5aca20,!![]];});});}})[_0xdf9f('0x94')](function(_0x169262,_0x86bafd){if(_0x86bafd){return _0x169262;}return db['OpenchannelMessage'][_0xdf9f('0x5b')](_[_0xdf9f('0x54')](_0x35bb2f['body'],{'read':![],'body':_0x35bb2f['body'][_0xdf9f('0x5c')],'OpenchannelAccountId':_0x3bb9f6['id'],'OpenchannelInteractionId':_0x169262['id'],'UserId':_0x35bb2f[_0xdf9f('0x5d')]['id'],'ContactId':_0x1829d4['id']}))[_0xdf9f('0x22')](function(_0x2b6373){_0x169262[_0xdf9f('0xc2')][_0xdf9f('0xc3')]=[];_0x169262[_0xdf9f('0xc2')]['Messages']['push'](_0x2b6373['dataValues']);return _0x169262;});});}})[_0xdf9f('0x22')](respondWithResult(_0x5db9c1,null))[_0xdf9f('0x2c')](handleError(_0x5db9c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 03998c8..288ec46 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 _0x1be1=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x3f315d,_0x563fff){var _0xea8ba2=function(_0x7b4858){while(--_0x7b4858){_0x3f315d['push'](_0x3f315d['shift']());}};_0xea8ba2(++_0x563fff);}(_0x1be1,0x192));var _0x11be=function(_0x3d5acc,_0x31cf31){_0x3d5acc=_0x3d5acc-0x0;var _0x3d946e=_0x1be1[_0x3d5acc];return _0x3d946e;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x11be('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x11be('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xe706=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove','emit'];(function(_0x309388,_0x1cc585){var _0x4d290f=function(_0x407ffc){while(--_0x407ffc){_0x309388['push'](_0x309388['shift']());}};_0x4d290f(++_0x1cc585);}(_0xe706,0xa3));var _0x6e70=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0xe706[_0x454165];return _0x56db53;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var OpenchannelAccount=require(_0x6e70('0x1'))['db'][_0x6e70('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x3'),'afterUpdate':_0x6e70('0x4'),'afterDestroy':_0x6e70('0x5')};function emitEvent(_0x7dfbc3){return function(_0x142c27,_0x2164a4,_0x376a8d){OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3+':'+_0x142c27['id'],_0x142c27);OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3,_0x142c27);_0x376a8d(null);};}for(var e in events){if(events[_0x6e70('0x7')](e)){var event=events[e];OpenchannelAccount[_0x6e70('0x8')](e,emitEvent(event));}}module[_0x6e70('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 9ce9e37..e09d9a3 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(_0x1269d2,_0x293f62){var _0x4e14ce=function(_0x147c90){while(--_0x147c90){_0x1269d2['push'](_0x1269d2['shift']());}};_0x4e14ce(++_0x293f62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x302c8f,_0xa979d4){var _0x1894c=function(_0x180f56){while(--_0x180f56){_0x302c8f['push'](_0x302c8f['shift']());}};_0x1894c(++_0xa979d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 a0e5c95..69aa3af 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 _0x593e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x20ca50,_0x5f05b0){var _0xa5b099=function(_0x412b19){while(--_0x412b19){_0x20ca50['push'](_0x20ca50['shift']());}};_0xa5b099(++_0x5f05b0);}(_0x593e,0xcb));var _0xe593=function(_0x3db300,_0x126a60){_0x3db300=_0x3db300-0x0;var _0x432f34=_0x593e[_0x3db300];return _0x432f34;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});config[_0xe593('0xd')]=_[_0xe593('0xe')](config[_0xe593('0xd')],{'host':_0xe593('0xf'),'port':0x18eb});var socket=require(_0xe593('0x10'))(new Redis(config['redis']));require(_0xe593('0x11'))[_0xe593('0x12')](socket);function respondWithRpcPromise(_0x38d977,_0x5ba75c,_0x5f1222){return new BPromise(function(_0x3032ee,_0xeefe30){return client[_0xe593('0x13')](_0x38d977,_0x5f1222)['then'](function(_0x6a5d4f){logger[_0xe593('0x14')](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));logger[_0xe593('0x17')](_0xe593('0x18'),_0x5ba75c,_0xe593('0x16'),JSON[_0xe593('0x19')](_0x6a5d4f));if(_0x6a5d4f[_0xe593('0x1a')]){if(_0x6a5d4f[_0xe593('0x1a')]['code']===0x1f4){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f['error'][_0xe593('0x1b')]);return _0xeefe30(_0x6a5d4f[_0xe593('0x1a')]['message']);}logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);return _0x3032ee(_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);}else{logger['info'](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));_0x3032ee(_0x6a5d4f['result'][_0xe593('0x1b')]);}})[_0xe593('0x1c')](function(_0x56b4ff){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x56b4ff);_0xeefe30(_0x56b4ff);});});} \ No newline at end of file +var _0x9e6b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','register','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x2c4842,_0x4b09fe){var _0x4b6b7f=function(_0x8627e0){while(--_0x8627e0){_0x2c4842['push'](_0x2c4842['shift']());}};_0x4b6b7f(++_0x4b09fe);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9e6b[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var moment=require('moment');var BPromise=require(_0xb9e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9e6('0x3'))['db'];var utils=require(_0xb9e6('0x4'));var logger=require(_0xb9e6('0x5'))(_0xb9e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9e6('0x7'));var client=jayson[_0xb9e6('0x8')][_0xb9e6('0x9')]({'port':0x232a});config['redis']=_[_0xb9e6('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9e6('0xb')]));require('./openchannelAccount.socket')[_0xb9e6('0xc')](socket);function respondWithRpcPromise(_0x216b1a,_0x477b52,_0x3e18bf){return new BPromise(function(_0x40d57b,_0x43e8c8){return client[_0xb9e6('0xd')](_0x216b1a,_0x3e18bf)[_0xb9e6('0xe')](function(_0x165903){logger[_0xb9e6('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x477b52,_0xb9e6('0x10'));logger[_0xb9e6('0x11')](_0xb9e6('0x12'),_0x477b52,_0xb9e6('0x10'),JSON['stringify'](_0x165903));if(_0x165903[_0xb9e6('0x13')]){if(_0x165903[_0xb9e6('0x13')]['code']===0x1f4){logger['error'](_0xb9e6('0x14'),_0x477b52,_0x165903[_0xb9e6('0x13')][_0xb9e6('0x15')]);return _0x43e8c8(_0x165903[_0xb9e6('0x13')]['message']);}logger[_0xb9e6('0x13')](_0xb9e6('0x14'),_0x477b52,_0x165903[_0xb9e6('0x13')][_0xb9e6('0x15')]);return _0x40d57b(_0x165903[_0xb9e6('0x13')][_0xb9e6('0x15')]);}else{logger[_0xb9e6('0xf')](_0xb9e6('0x14'),_0x477b52,_0xb9e6('0x10'));_0x40d57b(_0x165903[_0xb9e6('0x16')]['message']);}})[_0xb9e6('0x17')](function(_0x53a357){logger[_0xb9e6('0x13')](_0xb9e6('0x14'),_0x477b52,_0x53a357);_0x43e8c8(_0x53a357);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 55f7ba0..8dbc030 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 _0xcb18=['remove','emit','removeListener','register','openchannelAccount:'];(function(_0x37574c,_0x2b0d40){var _0x20905=function(_0x277ae5){while(--_0x277ae5){_0x37574c['push'](_0x37574c['shift']());}};_0x20905(++_0x2b0d40);}(_0xcb18,0x159));var _0x8cb1=function(_0x31b7ab,_0x484da9){_0x31b7ab=_0x31b7ab-0x0;var _0x5025f4=_0xcb18[_0x31b7ab];return _0x5025f4;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x8cb1('0x0'),'update'];function createListener(_0x3df352,_0x50513d){return function(_0x5e800d){_0x50513d[_0x8cb1('0x1')](_0x3df352,_0x5e800d);};}function removeListener(_0x87b1d3,_0x15d761){return function(){OpenchannelAccountEvents[_0x8cb1('0x2')](_0x87b1d3,_0x15d761);};}exports[_0x8cb1('0x3')]=function(_0x503927){for(var _0x355d91=0x0,_0x335e41=events['length'];_0x355d91<_0x335e41;_0x355d91++){var _0x186f71=events[_0x355d91];var _0x510e92=createListener(_0x8cb1('0x4')+_0x186f71,_0x503927);OpenchannelAccountEvents['on'](_0x186f71,_0x510e92);}}; \ No newline at end of file +var _0x4058=['emit','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4058,0x129));var _0x8405=function(_0x23b275,_0x4e8a16){_0x23b275=_0x23b275-0x0;var _0x244151=_0x4058[_0x23b275];return _0x244151;};'use strict';var OpenchannelAccountEvents=require(_0x8405('0x0'));var events=[_0x8405('0x1'),_0x8405('0x2'),_0x8405('0x3')];function createListener(_0x46c215,_0x22f2ce){return function(_0x70944b){_0x22f2ce[_0x8405('0x4')](_0x46c215,_0x70944b);};}function removeListener(_0xf8c24c,_0x4948b2){return function(){OpenchannelAccountEvents['removeListener'](_0xf8c24c,_0x4948b2);};}exports['register']=function(_0x1db7ea){for(var _0x257d43=0x0,_0x3d9bf6=events[_0x8405('0x5')];_0x257d43<_0x3d9bf6;_0x257d43++){var _0x1cb061=events[_0x257d43];var _0x479c97=createListener(_0x8405('0x6')+_0x1cb061,_0x1db7ea);OpenchannelAccountEvents['on'](_0x1cb061,_0x479c97);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 90ff965..88816e8 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 _0xe4f9=['put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xe4f9,0x140));var _0x9e4f=function(_0x3aec82,_0x447bdc){_0x3aec82=_0x3aec82-0x0;var _0xd766a5=_0xe4f9[_0x3aec82];return _0xd766a5;};'use strict';var multer=require(_0x9e4f('0x0'));var util=require(_0x9e4f('0x1'));var path=require(_0x9e4f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e4f('0x3')]();var fs_extra=require(_0x9e4f('0x4'));var auth=require(_0x9e4f('0x5'));var interaction=require(_0x9e4f('0x6'));var config=require(_0x9e4f('0x7'));var controller=require(_0x9e4f('0x8'));router[_0x9e4f('0x9')]('/',auth[_0x9e4f('0xa')](),controller[_0x9e4f('0xb')]);router[_0x9e4f('0x9')](_0x9e4f('0xc'),auth['isAuthenticated'](),controller[_0x9e4f('0xd')]);router[_0x9e4f('0xe')]('/',auth[_0x9e4f('0xa')](),controller[_0x9e4f('0xf')]);router[_0x9e4f('0x10')]('/:id',auth[_0x9e4f('0xa')](),controller[_0x9e4f('0x11')]);router[_0x9e4f('0x12')](_0x9e4f('0xc'),auth['isAuthenticated'](),controller[_0x9e4f('0x13')]);module[_0x9e4f('0x14')]=router; \ No newline at end of file +var _0xa2c4=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','path','express','Router','fs-extra'];(function(_0x284268,_0x338286){var _0x2c043b=function(_0x186db7){while(--_0x186db7){_0x284268['push'](_0x284268['shift']());}};_0x2c043b(++_0x338286);}(_0xa2c4,0x7c));var _0x4a2c=function(_0x4f5731,_0x45747a){_0x4f5731=_0x4f5731-0x0;var _0x24af31=_0xa2c4[_0x4f5731];return _0x24af31;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a2c('0x0'));var timeout=require('connect-timeout');var express=require(_0x4a2c('0x1'));var router=express[_0x4a2c('0x2')]();var fs_extra=require(_0x4a2c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4a2c('0x4'));var config=require(_0x4a2c('0x5'));var controller=require(_0x4a2c('0x6'));router[_0x4a2c('0x7')]('/',auth['isAuthenticated'](),controller[_0x4a2c('0x8')]);router[_0x4a2c('0x7')](_0x4a2c('0x9'),auth[_0x4a2c('0xa')](),controller['show']);router[_0x4a2c('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4a2c('0xc')]('/:id',auth[_0x4a2c('0xa')](),controller[_0x4a2c('0xd')]);router[_0x4a2c('0xe')](_0x4a2c('0x9'),auth[_0x4a2c('0xa')](),controller[_0x4a2c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d891401..c1f2d16 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 _0x82e2=['noop','*,*,*,*','sequelize','exports','STRING'];(function(_0xb6c185,_0x1fba89){var _0x18717b=function(_0x1ac33d){while(--_0x1ac33d){_0xb6c185['push'](_0xb6c185['shift']());}};_0x18717b(++_0x1fba89);}(_0x82e2,0x14c));var _0x282e=function(_0x21f3c3,_0x42e32c){_0x21f3c3=_0x21f3c3-0x0;var _0x15957=_0x82e2[_0x21f3c3];return _0x15957;};'use strict';var Sequelize=require(_0x282e('0x0'));module[_0x282e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x282e('0x2')],'allowNull':![],'defaultValue':_0x282e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x282e('0x2')]},'interval':{'type':Sequelize[_0x282e('0x2')],'defaultValue':_0x282e('0x4')}}; \ No newline at end of file +var _0xc744=['INTEGER','STRING','exports'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xc744,0x1bb));var _0x4c74=function(_0x65298a,_0x4e7672){_0x65298a=_0x65298a-0x0;var _0x1a9cce=_0xc744[_0x65298a];return _0x1a9cce;};'use strict';var Sequelize=require('sequelize');module[_0x4c74('0x0')]={'priority':{'type':Sequelize[_0x4c74('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4c74('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4c74('0x2')]},'interval':{'type':Sequelize[_0x4c74('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 5e845f6..93c61a3 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 _0x8887=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','catch','show','keys','includeAll','include','create','body','destroy','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','filters'];(function(_0x46e3ff,_0x50ca39){var _0x4bf847=function(_0x3fa9b9){while(--_0x3fa9b9){_0x46e3ff['push'](_0x46e3ff['shift']());}};_0x4bf847(++_0x50ca39);}(_0x8887,0xec));var _0x7888=function(_0x407444,_0x54723b){_0x407444=_0x407444-0x0;var _0x262633=_0x8887[_0x407444];return _0x262633;};'use strict';var emlformat=require(_0x7888('0x0'));var rimraf=require(_0x7888('0x1'));var zipdir=require(_0x7888('0x2'));var jsonpatch=require(_0x7888('0x3'));var rp=require(_0x7888('0x4'));var moment=require('moment');var BPromise=require(_0x7888('0x5'));var Mustache=require('mustache');var util=require(_0x7888('0x6'));var path=require('path');var sox=require(_0x7888('0x7'));var csv=require(_0x7888('0x8'));var ejs=require(_0x7888('0x9'));var fs=require('fs');var fs_extra=require(_0x7888('0xa'));var _=require(_0x7888('0xb'));var squel=require(_0x7888('0xc'));var crypto=require('crypto');var jsforce=require(_0x7888('0xd'));var deskjs=require(_0x7888('0xe'));var toCsv=require(_0x7888('0x8'));var querystring=require(_0x7888('0xf'));var Papa=require('papaparse');var Redis=require(_0x7888('0x10'));var authService=require(_0x7888('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7888('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7888('0x13'))(_0x7888('0x14'));var utils=require(_0x7888('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7888('0x16'));var db=require(_0x7888('0x17'))['db'];function respondWithStatusCode(_0x49b486,_0x319cff){_0x319cff=_0x319cff||0xcc;return function(_0x29d91f){if(_0x29d91f){return _0x49b486[_0x7888('0x18')](_0x319cff);}return _0x49b486[_0x7888('0x19')](_0x319cff)[_0x7888('0x1a')]();};}function respondWithResult(_0x4ea403,_0x135f15){_0x135f15=_0x135f15||0xc8;return function(_0x304255){if(_0x304255){return _0x4ea403[_0x7888('0x19')](_0x135f15)[_0x7888('0x1b')](_0x304255);}};}function respondWithFilteredResult(_0x1e9533,_0x339884){return function(_0x45b323){if(_0x45b323){var _0x130b11=typeof _0x339884[_0x7888('0x1c')]===_0x7888('0x1d')&&typeof _0x339884[_0x7888('0x1e')]===_0x7888('0x1d');var _0x593c29=_0x45b323['count'];var _0x175337=_0x130b11?0x0:_0x339884[_0x7888('0x1c')];var _0x3e0f67=_0x130b11?_0x45b323[_0x7888('0x1f')]:_0x339884['offset']+_0x339884[_0x7888('0x1e')];var _0x54a520;if(_0x3e0f67>=_0x593c29){_0x3e0f67=_0x593c29;_0x54a520=0xc8;}else{_0x54a520=0xce;}_0x1e9533['status'](_0x54a520);return _0x1e9533[_0x7888('0x20')]('Content-Range',_0x175337+'-'+_0x3e0f67+'/'+_0x593c29)['json'](_0x45b323);}return null;};}function patchUpdates(_0x3e640e){return function(_0x128581){try{jsonpatch[_0x7888('0x21')](_0x128581,_0x3e640e,!![]);}catch(_0x634256){return BPromise[_0x7888('0x22')](_0x634256);}return _0x128581['save']();};}function saveUpdates(_0x1aaf58,_0x390f4b){return function(_0x35aefe){if(_0x35aefe){return _0x35aefe[_0x7888('0x23')](_0x1aaf58)['then'](function(_0x244305){return _0x244305;});}return null;};}function removeEntity(_0x4325cc,_0x13012c){return function(_0x4f9659){if(_0x4f9659){return _0x4f9659['destroy']()[_0x7888('0x24')](function(){_0x4325cc[_0x7888('0x19')](0xcc)[_0x7888('0x1a')]();});}};}function handleEntityNotFound(_0x5602ea,_0x592a9f){return function(_0x10e256){if(!_0x10e256){_0x5602ea[_0x7888('0x18')](0x194);}return _0x10e256;};}function handleError(_0x2e6617,_0x4452d3){_0x4452d3=_0x4452d3||0x1f4;return function(_0x4b4661){logger['error'](_0x4b4661[_0x7888('0x25')]);if(_0x4b4661[_0x7888('0x26')]){delete _0x4b4661[_0x7888('0x26')];}_0x2e6617[_0x7888('0x19')](_0x4452d3)['send'](_0x4b4661);};}exports[_0x7888('0x27')]=function(_0x2cc7a3,_0x3e2f70){var _0x1040e8={},_0x325eb1={},_0x4e438e={'count':0x0,'rows':[]};var _0x108081=_[_0x7888('0x28')](db[_0x7888('0x29')][_0x7888('0x2a')],function(_0x2ec618){return{'name':_0x2ec618['fieldName'],'type':_0x2ec618[_0x7888('0x2b')][_0x7888('0x2c')]};});_0x325eb1[_0x7888('0x2d')]=_[_0x7888('0x28')](_0x108081,'name');_0x325eb1[_0x7888('0x2e')]=_['keys'](_0x2cc7a3[_0x7888('0x2e')]);_0x325eb1[_0x7888('0x2f')]=_[_0x7888('0x30')](_0x325eb1[_0x7888('0x2d')],_0x325eb1[_0x7888('0x2e')]);_0x1040e8[_0x7888('0x31')]=_[_0x7888('0x30')](_0x325eb1[_0x7888('0x2d')],qs[_0x7888('0x32')](_0x2cc7a3['query'][_0x7888('0x32')]));_0x1040e8[_0x7888('0x31')]=_0x1040e8[_0x7888('0x31')][_0x7888('0x33')]?_0x1040e8[_0x7888('0x31')]:_0x325eb1[_0x7888('0x2d')];if(!_0x2cc7a3['query'][_0x7888('0x34')](_0x7888('0x35'))){_0x1040e8['limit']=qs[_0x7888('0x1e')](_0x2cc7a3[_0x7888('0x2e')]['limit']);_0x1040e8[_0x7888('0x1c')]=qs[_0x7888('0x1c')](_0x2cc7a3[_0x7888('0x2e')]['offset']);}_0x1040e8[_0x7888('0x36')]=qs[_0x7888('0x37')](_0x2cc7a3[_0x7888('0x2e')][_0x7888('0x37')]);_0x1040e8[_0x7888('0x38')]=qs['filters'](_['pick'](_0x2cc7a3['query'],_0x325eb1[_0x7888('0x2f')]),_0x108081);if(_0x2cc7a3['query'][_0x7888('0x39')]){_0x1040e8[_0x7888('0x38')]=_[_0x7888('0x3a')](_0x1040e8[_0x7888('0x38')],{'$or':_['map'](_0x108081,function(_0x4bc722){if(_0x4bc722['type']!==_0x7888('0x3b')){var _0x1317f9={};_0x1317f9[_0x4bc722[_0x7888('0x26')]]={'$like':'%'+_0x2cc7a3['query'][_0x7888('0x39')]+'%'};return _0x1317f9;}})});}_0x1040e8=_[_0x7888('0x3a')]({},_0x1040e8,_0x2cc7a3[_0x7888('0x3c')]);var _0x2a2bc9={'where':_0x1040e8[_0x7888('0x38')]};return db[_0x7888('0x29')][_0x7888('0x1f')](_0x2a2bc9)[_0x7888('0x24')](function(_0x18238e){_0x4e438e['count']=_0x18238e;if(_0x2cc7a3[_0x7888('0x2e')]['includeAll']){_0x1040e8['include']=[{'all':!![]}];}return db[_0x7888('0x29')]['findAll'](_0x1040e8);})[_0x7888('0x24')](function(_0x14888f){_0x4e438e['rows']=_0x14888f;return _0x4e438e;})[_0x7888('0x24')](respondWithFilteredResult(_0x3e2f70,_0x1040e8))[_0x7888('0x3d')](handleError(_0x3e2f70,null));};exports[_0x7888('0x3e')]=function(_0x476b96,_0x3fb223){var _0x4c2065={'raw':!![],'where':{'id':_0x476b96['params']['id']}},_0x37c593={};_0x37c593[_0x7888('0x2d')]=_[_0x7888('0x3f')](db[_0x7888('0x29')]['rawAttributes']);_0x37c593[_0x7888('0x2e')]=_['keys'](_0x476b96[_0x7888('0x2e')]);_0x37c593[_0x7888('0x2f')]=_[_0x7888('0x30')](_0x37c593[_0x7888('0x2d')],_0x37c593[_0x7888('0x2e')]);_0x4c2065[_0x7888('0x31')]=_[_0x7888('0x30')](_0x37c593['model'],qs['fields'](_0x476b96[_0x7888('0x2e')][_0x7888('0x32')]));_0x4c2065[_0x7888('0x31')]=_0x4c2065['attributes']['length']?_0x4c2065[_0x7888('0x31')]:_0x37c593[_0x7888('0x2d')];if(_0x476b96['query'][_0x7888('0x40')]){_0x4c2065[_0x7888('0x41')]=[{'all':!![]}];}_0x4c2065=_[_0x7888('0x3a')]({},_0x4c2065,_0x476b96[_0x7888('0x3c')]);return db[_0x7888('0x29')]['find'](_0x4c2065)[_0x7888('0x24')](handleEntityNotFound(_0x3fb223,null))[_0x7888('0x24')](respondWithResult(_0x3fb223,null))['catch'](handleError(_0x3fb223,null));};exports[_0x7888('0x42')]=function(_0x324384,_0x5bbbe8){return db['OpenchannelApplication'][_0x7888('0x42')](_0x324384[_0x7888('0x43')],{})[_0x7888('0x24')](respondWithResult(_0x5bbbe8,0xc9))[_0x7888('0x3d')](handleError(_0x5bbbe8,null));};exports['update']=function(_0xfa377f,_0x5961b9){if(_0xfa377f[_0x7888('0x43')]['id']){delete _0xfa377f[_0x7888('0x43')]['id'];}return db[_0x7888('0x29')]['find']({'where':{'id':_0xfa377f['params']['id']}})[_0x7888('0x24')](handleEntityNotFound(_0x5961b9,null))[_0x7888('0x24')](saveUpdates(_0xfa377f[_0x7888('0x43')],null))[_0x7888('0x24')](respondWithResult(_0x5961b9,null))[_0x7888('0x3d')](handleError(_0x5961b9,null));};exports[_0x7888('0x44')]=function(_0x4fd6cd,_0x509ca5){return db[_0x7888('0x29')][_0x7888('0x45')]({'where':{'id':_0x4fd6cd[_0x7888('0x46')]['id']}})[_0x7888('0x24')](handleEntityNotFound(_0x509ca5,null))[_0x7888('0x24')](removeEntity(_0x509ca5,null))[_0x7888('0x3d')](handleError(_0x509ca5,null));}; \ No newline at end of file +var _0x576d=['find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','OpenchannelApplication','include','findAll','rows','catch','show','length','includeAll'];(function(_0x2cf714,_0x4c03d1){var _0x135a2a=function(_0x41a1aa){while(--_0x41a1aa){_0x2cf714['push'](_0x2cf714['shift']());}};_0x135a2a(++_0x4c03d1);}(_0x576d,0x149));var _0xd576=function(_0x371710,_0xca9370){_0x371710=_0x371710-0x0;var _0xdf90e2=_0x576d[_0x371710];return _0xdf90e2;};'use strict';var emlformat=require(_0xd576('0x0'));var rimraf=require(_0xd576('0x1'));var zipdir=require(_0xd576('0x2'));var jsonpatch=require(_0xd576('0x3'));var rp=require(_0xd576('0x4'));var moment=require(_0xd576('0x5'));var BPromise=require(_0xd576('0x6'));var Mustache=require('mustache');var util=require(_0xd576('0x7'));var path=require(_0xd576('0x8'));var sox=require(_0xd576('0x9'));var csv=require(_0xd576('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd576('0xb'));var squel=require(_0xd576('0xc'));var crypto=require(_0xd576('0xd'));var jsforce=require(_0xd576('0xe'));var deskjs=require(_0xd576('0xf'));var toCsv=require(_0xd576('0xa'));var querystring=require(_0xd576('0x10'));var Papa=require(_0xd576('0x11'));var Redis=require(_0xd576('0x12'));var authService=require(_0xd576('0x13'));var qs=require(_0xd576('0x14'));var as=require(_0xd576('0x15'));var hardwareService=require(_0xd576('0x16'));var logger=require(_0xd576('0x17'))(_0xd576('0x18'));var utils=require(_0xd576('0x19'));var config=require(_0xd576('0x1a'));var licenseUtil=require(_0xd576('0x1b'));var db=require(_0xd576('0x1c'))['db'];function respondWithStatusCode(_0x3c0dbf,_0x56a23a){_0x56a23a=_0x56a23a||0xcc;return function(_0x33edb7){if(_0x33edb7){return _0x3c0dbf[_0xd576('0x1d')](_0x56a23a);}return _0x3c0dbf[_0xd576('0x1e')](_0x56a23a)[_0xd576('0x1f')]();};}function respondWithResult(_0x2ea98f,_0x677394){_0x677394=_0x677394||0xc8;return function(_0x57b7ba){if(_0x57b7ba){return _0x2ea98f[_0xd576('0x1e')](_0x677394)[_0xd576('0x20')](_0x57b7ba);}};}function respondWithFilteredResult(_0x47df2d,_0x4841fc){return function(_0x4036f0){if(_0x4036f0){var _0x5137c7=typeof _0x4841fc[_0xd576('0x21')]===_0xd576('0x22')&&typeof _0x4841fc['limit']===_0xd576('0x22');var _0x1ce768=_0x4036f0['count'];var _0x3fbc72=_0x5137c7?0x0:_0x4841fc[_0xd576('0x21')];var _0x11c9eb=_0x5137c7?_0x4036f0[_0xd576('0x23')]:_0x4841fc[_0xd576('0x21')]+_0x4841fc[_0xd576('0x24')];var _0x3911e2;if(_0x11c9eb>=_0x1ce768){_0x11c9eb=_0x1ce768;_0x3911e2=0xc8;}else{_0x3911e2=0xce;}_0x47df2d[_0xd576('0x1e')](_0x3911e2);return _0x47df2d[_0xd576('0x25')](_0xd576('0x26'),_0x3fbc72+'-'+_0x11c9eb+'/'+_0x1ce768)[_0xd576('0x20')](_0x4036f0);}return null;};}function patchUpdates(_0x400e64){return function(_0x4b1031){try{jsonpatch[_0xd576('0x27')](_0x4b1031,_0x400e64,!![]);}catch(_0x7684e2){return BPromise[_0xd576('0x28')](_0x7684e2);}return _0x4b1031[_0xd576('0x29')]();};}function saveUpdates(_0xfeafc0,_0x3f1565){return function(_0x448060){if(_0x448060){return _0x448060['update'](_0xfeafc0)['then'](function(_0xa5cb6f){return _0xa5cb6f;});}return null;};}function removeEntity(_0x12808c,_0x9984f9){return function(_0x198458){if(_0x198458){return _0x198458[_0xd576('0x2a')]()[_0xd576('0x2b')](function(){_0x12808c[_0xd576('0x1e')](0xcc)[_0xd576('0x1f')]();});}};}function handleEntityNotFound(_0x1ccc78,_0x14402e){return function(_0x207ecd){if(!_0x207ecd){_0x1ccc78[_0xd576('0x1d')](0x194);}return _0x207ecd;};}function handleError(_0x419327,_0x33fda8){_0x33fda8=_0x33fda8||0x1f4;return function(_0x520dd2){logger[_0xd576('0x2c')](_0x520dd2[_0xd576('0x2d')]);if(_0x520dd2[_0xd576('0x2e')]){delete _0x520dd2[_0xd576('0x2e')];}_0x419327['status'](_0x33fda8)[_0xd576('0x2f')](_0x520dd2);};}exports[_0xd576('0x30')]=function(_0x18f655,_0x5070f4){var _0x226e8f={},_0x47201b={},_0x596842={'count':0x0,'rows':[]};var _0x2b8069=_[_0xd576('0x31')](db['OpenchannelApplication'][_0xd576('0x32')],function(_0x1e6bec){return{'name':_0x1e6bec[_0xd576('0x33')],'type':_0x1e6bec[_0xd576('0x34')]['key']};});_0x47201b['model']=_[_0xd576('0x31')](_0x2b8069,_0xd576('0x2e'));_0x47201b[_0xd576('0x35')]=_[_0xd576('0x36')](_0x18f655[_0xd576('0x35')]);_0x47201b[_0xd576('0x37')]=_[_0xd576('0x38')](_0x47201b['model'],_0x47201b[_0xd576('0x35')]);_0x226e8f[_0xd576('0x39')]=_[_0xd576('0x38')](_0x47201b[_0xd576('0x3a')],qs[_0xd576('0x3b')](_0x18f655[_0xd576('0x35')][_0xd576('0x3b')]));_0x226e8f[_0xd576('0x39')]=_0x226e8f[_0xd576('0x39')]['length']?_0x226e8f[_0xd576('0x39')]:_0x47201b[_0xd576('0x3a')];if(!_0x18f655[_0xd576('0x35')][_0xd576('0x3c')](_0xd576('0x3d'))){_0x226e8f[_0xd576('0x24')]=qs['limit'](_0x18f655[_0xd576('0x35')][_0xd576('0x24')]);_0x226e8f['offset']=qs[_0xd576('0x21')](_0x18f655[_0xd576('0x35')][_0xd576('0x21')]);}_0x226e8f['order']=qs['sort'](_0x18f655[_0xd576('0x35')]['sort']);_0x226e8f[_0xd576('0x3e')]=qs[_0xd576('0x37')](_[_0xd576('0x3f')](_0x18f655[_0xd576('0x35')],_0x47201b[_0xd576('0x37')]),_0x2b8069);if(_0x18f655[_0xd576('0x35')]['filter']){_0x226e8f[_0xd576('0x3e')]=_['merge'](_0x226e8f[_0xd576('0x3e')],{'$or':_[_0xd576('0x31')](_0x2b8069,function(_0x14f7ea){if(_0x14f7ea['type']!==_0xd576('0x40')){var _0x3136c6={};_0x3136c6[_0x14f7ea[_0xd576('0x2e')]]={'$like':'%'+_0x18f655['query'][_0xd576('0x41')]+'%'};return _0x3136c6;}})});}_0x226e8f=_[_0xd576('0x42')]({},_0x226e8f,_0x18f655[_0xd576('0x43')]);var _0x271c5f={'where':_0x226e8f[_0xd576('0x3e')]};return db[_0xd576('0x44')][_0xd576('0x23')](_0x271c5f)['then'](function(_0x31ce11){_0x596842['count']=_0x31ce11;if(_0x18f655[_0xd576('0x35')]['includeAll']){_0x226e8f[_0xd576('0x45')]=[{'all':!![]}];}return db[_0xd576('0x44')][_0xd576('0x46')](_0x226e8f);})['then'](function(_0x3dda31){_0x596842[_0xd576('0x47')]=_0x3dda31;return _0x596842;})[_0xd576('0x2b')](respondWithFilteredResult(_0x5070f4,_0x226e8f))[_0xd576('0x48')](handleError(_0x5070f4,null));};exports[_0xd576('0x49')]=function(_0x254bc6,_0x239f50){var _0x34ab69={'raw':!![],'where':{'id':_0x254bc6['params']['id']}},_0x25b931={};_0x25b931[_0xd576('0x3a')]=_['keys'](db[_0xd576('0x44')][_0xd576('0x32')]);_0x25b931['query']=_['keys'](_0x254bc6[_0xd576('0x35')]);_0x25b931[_0xd576('0x37')]=_[_0xd576('0x38')](_0x25b931[_0xd576('0x3a')],_0x25b931[_0xd576('0x35')]);_0x34ab69['attributes']=_[_0xd576('0x38')](_0x25b931[_0xd576('0x3a')],qs[_0xd576('0x3b')](_0x254bc6[_0xd576('0x35')][_0xd576('0x3b')]));_0x34ab69[_0xd576('0x39')]=_0x34ab69[_0xd576('0x39')][_0xd576('0x4a')]?_0x34ab69[_0xd576('0x39')]:_0x25b931[_0xd576('0x3a')];if(_0x254bc6['query'][_0xd576('0x4b')]){_0x34ab69[_0xd576('0x45')]=[{'all':!![]}];}_0x34ab69=_[_0xd576('0x42')]({},_0x34ab69,_0x254bc6[_0xd576('0x43')]);return db[_0xd576('0x44')][_0xd576('0x4c')](_0x34ab69)[_0xd576('0x2b')](handleEntityNotFound(_0x239f50,null))[_0xd576('0x2b')](respondWithResult(_0x239f50,null))[_0xd576('0x48')](handleError(_0x239f50,null));};exports[_0xd576('0x4d')]=function(_0x414d0a,_0x437ac8){return db[_0xd576('0x44')][_0xd576('0x4d')](_0x414d0a[_0xd576('0x4e')],{})[_0xd576('0x2b')](respondWithResult(_0x437ac8,0xc9))[_0xd576('0x48')](handleError(_0x437ac8,null));};exports[_0xd576('0x4f')]=function(_0x2bde23,_0x5c049b){if(_0x2bde23[_0xd576('0x4e')]['id']){delete _0x2bde23['body']['id'];}return db[_0xd576('0x44')][_0xd576('0x4c')]({'where':{'id':_0x2bde23['params']['id']}})[_0xd576('0x2b')](handleEntityNotFound(_0x5c049b,null))['then'](saveUpdates(_0x2bde23['body'],null))[_0xd576('0x2b')](respondWithResult(_0x5c049b,null))[_0xd576('0x48')](handleError(_0x5c049b,null));};exports[_0xd576('0x2a')]=function(_0x434ce0,_0x1b8001){return db['OpenchannelApplication'][_0xd576('0x4c')]({'where':{'id':_0x434ce0[_0xd576('0x50')]['id']}})[_0xd576('0x2b')](handleEntityNotFound(_0x1b8001,null))[_0xd576('0x2b')](removeEntity(_0x1b8001,null))['catch'](handleError(_0x1b8001,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 195a050..7eb4239 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 _0xd1d6=['moment','request-promise','path','rimraf','./openchannelApplication.attributes','define','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x410696,_0x399e19){var _0x26d93d=function(_0x32d91e){while(--_0x32d91e){_0x410696['push'](_0x410696['shift']());}};_0x26d93d(++_0x399e19);}(_0xd1d6,0xc5));var _0x6d1d=function(_0x544e45,_0x3c8fc1){_0x544e45=_0x544e45-0x0;var _0x5189cc=_0xd1d6[_0x544e45];return _0x5189cc;};'use strict';var _=require('lodash');var util=require(_0x6d1d('0x0'));var logger=require(_0x6d1d('0x1'))(_0x6d1d('0x2'));var moment=require(_0x6d1d('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d1d('0x4'));var fs=require('fs');var path=require(_0x6d1d('0x5'));var rimraf=require(_0x6d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d1d('0x7'));module['exports']=function(_0x3a2f1e,_0x17bea8){return _0x3a2f1e[_0x6d1d('0x8')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6d1d('0x9')});}; \ No newline at end of file +var _0x8e53=['moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x503cdb,_0x49e7c3){var _0x26c512=function(_0x1cb990){while(--_0x1cb990){_0x503cdb['push'](_0x503cdb['shift']());}};_0x26c512(++_0x49e7c3);}(_0x8e53,0x1ca));var _0x38e5=function(_0x2f346f,_0x1f61d5){_0x2f346f=_0x2f346f-0x0;var _0x209307=_0x8e53[_0x2f346f];return _0x209307;};'use strict';var _=require(_0x38e5('0x0'));var util=require(_0x38e5('0x1'));var logger=require(_0x38e5('0x2'))(_0x38e5('0x3'));var moment=require(_0x38e5('0x4'));var BPromise=require(_0x38e5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38e5('0x6'));var rimraf=require(_0x38e5('0x7'));var config=require(_0x38e5('0x8'));var attributes=require(_0x38e5('0x9'));module[_0x38e5('0xa')]=function(_0x23d542,_0x182f94){return _0x23d542['define'](_0x38e5('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x38e5('0xc'),'collate':_0x38e5('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7a27ddd..e69e979 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 _0x273b=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','UpdateOpenchannelApplication','lodash','util','moment'];(function(_0x2f646a,_0x269601){var _0x25121a=function(_0x361b13){while(--_0x361b13){_0x2f646a['push'](_0x2f646a['shift']());}};_0x25121a(++_0x269601);}(_0x273b,0x98));var _0xb273=function(_0x1bce17,_0x52b7cf){_0x1bce17=_0x1bce17-0x0;var _0x383c15=_0x273b[_0x1bce17];return _0x383c15;};'use strict';var _=require(_0xb273('0x0'));var util=require(_0xb273('0x1'));var moment=require(_0xb273('0x2'));var BPromise=require(_0xb273('0x3'));var rs=require(_0xb273('0x4'));var fs=require('fs');var Redis=require(_0xb273('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb273('0x6'));var config=require(_0xb273('0x7'));var jayson=require(_0xb273('0x8'));var client=jayson[_0xb273('0x9')][_0xb273('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4973ba,_0x59af58,_0x41d38){return new BPromise(function(_0x36127d,_0x684be){return client[_0xb273('0xb')](_0x4973ba,_0x41d38)['then'](function(_0x438f99){logger[_0xb273('0xc')](_0xb273('0xd'),_0x59af58,'request\x20sent');logger[_0xb273('0xe')](_0xb273('0xf'),_0x59af58,'request\x20sent',JSON['stringify'](_0x438f99));if(_0x438f99['error']){if(_0x438f99['error'][_0xb273('0x10')]===0x1f4){logger[_0xb273('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x59af58,_0x438f99['error'][_0xb273('0x12')]);return _0x684be(_0x438f99[_0xb273('0x11')][_0xb273('0x12')]);}logger[_0xb273('0x11')](_0xb273('0xd'),_0x59af58,_0x438f99['error'][_0xb273('0x12')]);return _0x36127d(_0x438f99[_0xb273('0x11')]['message']);}else{logger['info'](_0xb273('0xd'),_0x59af58,'request\x20sent');_0x36127d(_0x438f99[_0xb273('0x13')][_0xb273('0x12')]);}})[_0xb273('0x14')](function(_0x4b0f51){logger['error'](_0xb273('0xd'),_0x59af58,_0x4b0f51);_0x684be(_0x4b0f51);});});}exports['UpdateOpenchannelApplication']=function(_0x299da0){var _0x39d955=this;return new Promise(function(_0x23510c,_0x20b525){return db[_0xb273('0x15')][_0xb273('0x16')](_0x299da0[_0xb273('0x17')],{'raw':_0x299da0[_0xb273('0x18')]?_0x299da0[_0xb273('0x18')][_0xb273('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x299da0[_0xb273('0x18')]?_0x299da0[_0xb273('0x18')][_0xb273('0x1a')]||null:null,'attributes':_0x299da0[_0xb273('0x18')]?_0x299da0['options'][_0xb273('0x1b')]||null:null,'limit':_0x299da0[_0xb273('0x18')]?_0x299da0[_0xb273('0x18')][_0xb273('0x1c')]||null:null})[_0xb273('0x1d')](function(_0x25f808){logger[_0xb273('0xc')](_0xb273('0x1e'),_0x299da0);logger[_0xb273('0xe')]('UpdateOpenchannelApplication',_0x299da0,JSON['stringify'](_0x25f808));_0x23510c(_0x25f808);})[_0xb273('0x14')](function(_0x44a326){logger[_0xb273('0x11')](_0xb273('0x1e'),_0x44a326['message'],_0x299da0);_0x20b525(_0x39d955['error'](0x1f4,_0x44a326[_0xb273('0x12')]));});});}; \ No newline at end of file +var _0x3105=['update','body','options','raw','where','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x3105,0xd2));var _0x5310=function(_0x5342b4,_0x51d3a7){_0x5342b4=_0x5342b4-0x0;var _0x3c8182=_0x3105[_0x5342b4];return _0x3c8182;};'use strict';var _=require(_0x5310('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5310('0x1'));var fs=require('fs');var Redis=require(_0x5310('0x2'));var db=require(_0x5310('0x3'))['db'];var utils=require(_0x5310('0x4'));var logger=require('../../config/logger')(_0x5310('0x5'));var config=require('../../config/environment');var jayson=require(_0x5310('0x6'));var client=jayson['client'][_0x5310('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x417a7c,_0x45901a,_0x42d84d){return new BPromise(function(_0x4db027,_0x4d36bc){return client[_0x5310('0x8')](_0x417a7c,_0x42d84d)[_0x5310('0x9')](function(_0x3caf7c){logger[_0x5310('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x45901a,_0x5310('0xb'));logger[_0x5310('0xc')](_0x5310('0xd'),_0x45901a,'request\x20sent',JSON[_0x5310('0xe')](_0x3caf7c));if(_0x3caf7c[_0x5310('0xf')]){if(_0x3caf7c[_0x5310('0xf')]['code']===0x1f4){logger['error'](_0x5310('0x10'),_0x45901a,_0x3caf7c['error'][_0x5310('0x11')]);return _0x4d36bc(_0x3caf7c[_0x5310('0xf')][_0x5310('0x11')]);}logger['error'](_0x5310('0x10'),_0x45901a,_0x3caf7c[_0x5310('0xf')][_0x5310('0x11')]);return _0x4db027(_0x3caf7c[_0x5310('0xf')]['message']);}else{logger[_0x5310('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x45901a,_0x5310('0xb'));_0x4db027(_0x3caf7c[_0x5310('0x12')][_0x5310('0x11')]);}})[_0x5310('0x13')](function(_0x4b6e14){logger[_0x5310('0xf')](_0x5310('0x10'),_0x45901a,_0x4b6e14);_0x4d36bc(_0x4b6e14);});});}exports[_0x5310('0x14')]=function(_0x12c882){var _0x4a0cc2=this;return new Promise(function(_0x5d9e1b,_0x3ca451){return db[_0x5310('0x15')][_0x5310('0x16')](_0x12c882[_0x5310('0x17')],{'raw':_0x12c882[_0x5310('0x18')]?_0x12c882[_0x5310('0x18')][_0x5310('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c882['options']?_0x12c882[_0x5310('0x18')][_0x5310('0x1a')]||null:null,'attributes':_0x12c882[_0x5310('0x18')]?_0x12c882[_0x5310('0x18')][_0x5310('0x1b')]||null:null,'limit':_0x12c882['options']?_0x12c882[_0x5310('0x18')][_0x5310('0x1c')]||null:null})[_0x5310('0x9')](function(_0x325c08){logger['info'](_0x5310('0x14'),_0x12c882);logger[_0x5310('0xc')]('UpdateOpenchannelApplication',_0x12c882,JSON[_0x5310('0xe')](_0x325c08));_0x5d9e1b(_0x325c08);})[_0x5310('0x13')](function(_0x3e4c83){logger[_0x5310('0xf')](_0x5310('0x14'),_0x3e4c83[_0x5310('0x11')],_0x12c882);_0x3ca451(_0x4a0cc2[_0x5310('0xf')](0x1f4,_0x3e4c83[_0x5310('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 53b2e95..c8a1267 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 _0x2b8c=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','index','/describe','isAuthenticated','describe','/:id','show','get','/:id/messages','getMessages','/:id/download','download','post','openchannel','addTags','put','openchannelinteraction:update','update','delete','tracked','openchannelinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1d0b80,_0x41fc24){var _0x35d642=function(_0x4c2cb5){while(--_0x4c2cb5){_0x1d0b80['push'](_0x1d0b80['shift']());}};_0x35d642(++_0x41fc24);}(_0x2b8c,0xfa));var _0xc2b8=function(_0x164d6d,_0x4d7e1b){_0x164d6d=_0x164d6d-0x0;var _0x232955=_0x2b8c[_0x164d6d];return _0x232955;};'use strict';var multer=require('multer');var util=require(_0xc2b8('0x0'));var path=require(_0xc2b8('0x1'));var timeout=require(_0xc2b8('0x2'));var express=require(_0xc2b8('0x3'));var router=express[_0xc2b8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc2b8('0x5'));var interaction=require(_0xc2b8('0x6'));var config=require(_0xc2b8('0x7'));var controller=require(_0xc2b8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc2b8('0x9')]);router['get'](_0xc2b8('0xa'),auth[_0xc2b8('0xb')](),controller[_0xc2b8('0xc')]);router['get'](_0xc2b8('0xd'),auth[_0xc2b8('0xb')](),controller[_0xc2b8('0xe')]);router[_0xc2b8('0xf')](_0xc2b8('0x10'),auth[_0xc2b8('0xb')](),controller[_0xc2b8('0x11')]);router[_0xc2b8('0xf')](_0xc2b8('0x12'),auth['isAuthenticated'](),controller[_0xc2b8('0x13')]);router[_0xc2b8('0x14')]('/',auth[_0xc2b8('0xb')](),controller['create']);router[_0xc2b8('0x14')](_0xc2b8('0x10'),auth[_0xc2b8('0xb')](),controller['addMessage']);router[_0xc2b8('0x14')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xc2b8('0x15'),'openchannelinteraction:addtags'),controller[_0xc2b8('0x16')]);router[_0xc2b8('0x17')](_0xc2b8('0xd'),auth[_0xc2b8('0xb')](),interaction['tracked'](_0xc2b8('0x15'),_0xc2b8('0x18')),controller[_0xc2b8('0x19')]);router[_0xc2b8('0x1a')](_0xc2b8('0xd'),auth[_0xc2b8('0xb')](),interaction[_0xc2b8('0x1b')](_0xc2b8('0x15'),_0xc2b8('0x1c')),controller[_0xc2b8('0x1d')]);router[_0xc2b8('0x1a')]('/:id/tags',auth[_0xc2b8('0xb')](),controller[_0xc2b8('0x1e')]);module[_0xc2b8('0x1f')]=router; \ No newline at end of file +var _0x7196=['./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','/:id','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x335391,_0x1984f8){var _0x4fadee=function(_0x5930cd){while(--_0x5930cd){_0x335391['push'](_0x335391['shift']());}};_0x4fadee(++_0x1984f8);}(_0x7196,0x18d));var _0x6719=function(_0x38c1b1,_0x1382c2){_0x38c1b1=_0x38c1b1-0x0;var _0x34983c=_0x7196[_0x38c1b1];return _0x34983c;};'use strict';var multer=require(_0x6719('0x0'));var util=require(_0x6719('0x1'));var path=require(_0x6719('0x2'));var timeout=require(_0x6719('0x3'));var express=require(_0x6719('0x4'));var router=express[_0x6719('0x5')]();var fs_extra=require(_0x6719('0x6'));var auth=require(_0x6719('0x7'));var interaction=require(_0x6719('0x8'));var config=require('../../config/environment');var controller=require(_0x6719('0x9'));router[_0x6719('0xa')]('/',auth[_0x6719('0xb')](),controller[_0x6719('0xc')]);router['get']('/describe',auth[_0x6719('0xb')](),controller[_0x6719('0xd')]);router['get']('/:id',auth[_0x6719('0xb')](),controller['show']);router[_0x6719('0xa')](_0x6719('0xe'),auth[_0x6719('0xb')](),controller['getMessages']);router['get'](_0x6719('0xf'),auth[_0x6719('0xb')](),controller[_0x6719('0x10')]);router[_0x6719('0x11')]('/',auth[_0x6719('0xb')](),controller['create']);router[_0x6719('0x11')]('/:id/messages',auth[_0x6719('0xb')](),controller[_0x6719('0x12')]);router[_0x6719('0x11')](_0x6719('0x13'),auth[_0x6719('0xb')](),interaction[_0x6719('0x14')](_0x6719('0x15'),_0x6719('0x16')),controller['addTags']);router['put'](_0x6719('0x17'),auth[_0x6719('0xb')](),interaction[_0x6719('0x14')](_0x6719('0x15'),'openchannelinteraction:update'),controller[_0x6719('0x18')]);router[_0x6719('0x19')](_0x6719('0x17'),auth['isAuthenticated'](),interaction[_0x6719('0x14')](_0x6719('0x15'),_0x6719('0x1a')),controller['destroy']);router['delete'](_0x6719('0x13'),auth[_0x6719('0xb')](),controller[_0x6719('0x1b')]);module[_0x6719('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 0716b32..4c8b86b 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 _0xb790=['BOOLEAN','exports','STRING','DATE','ENUM','out'];(function(_0x456432,_0x4321fd){var _0x39900e=function(_0x4d0d7b){while(--_0x4d0d7b){_0x456432['push'](_0x456432['shift']());}};_0x39900e(++_0x4321fd);}(_0xb790,0xe5));var _0x0b79=function(_0x1d0458,_0x389f29){_0x1d0458=_0x1d0458-0x0;var _0x35eea4=_0xb790[_0x1d0458];return _0x35eea4;};'use strict';var Sequelize=require('sequelize');module[_0x0b79('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0b79('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0b79('0x2')]},'threadId':{'type':Sequelize[_0x0b79('0x1')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0b79('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x0b79('0x3')]('in',_0x0b79('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x0b79('0x3')]('in',_0x0b79('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0b79('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0x0b79('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x652b=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x652b,0x68));var _0xb652=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0x652b[_0x450bf9];return _0x268350;};'use strict';var Sequelize=require(_0xb652('0x0'));module[_0xb652('0x1')]={'closed':{'type':Sequelize[_0xb652('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb652('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb652('0x3')]},'read1stAt':{'type':Sequelize[_0xb652('0x4')]},'threadId':{'type':Sequelize[_0xb652('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb652('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb652('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xb652('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 49a80c1..6099abb 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 _0x2da3=['hasOwnProperty','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','User','fullname','push','firstName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Public','Private','basename','createReadStream','pipe','out','System','Contact','value','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','path','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','stack','name','map','OpenchannelInteraction','key','getOptions','findAll','query','user','catch','show','type','from','params','keys','rawAttributes','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','length'];(function(_0x5e67cb,_0x10ea43){var _0x512c4f=function(_0x50385c){while(--_0x50385c){_0x5e67cb['push'](_0x5e67cb['shift']());}};_0x512c4f(++_0x10ea43);}(_0x2da3,0x1a7));var _0x32da=function(_0x2125d4,_0x4a5b20){_0x2125d4=_0x2125d4-0x0;var _0x59a013=_0x2da3[_0x2125d4];return _0x59a013;};'use strict';var rimraf=require(_0x32da('0x0'));var zipdir=require(_0x32da('0x1'));var moment=require('moment');var util=require('util');var path=require(_0x32da('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x32da('0x3'));var qs=require(_0x32da('0x4'));var pdf=require(_0x32da('0x5'));var logger=require(_0x32da('0x6'))(_0x32da('0x7'));var config=require('../../config/environment');var db=require(_0x32da('0x8'))['db'];config[_0x32da('0x9')]=_[_0x32da('0xa')](config[_0x32da('0x9')],{'host':_0x32da('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32da('0x9')]));require(_0x32da('0xc'))['register'](socket);function respondWithStatusCode(_0x275f3f,_0x38ef67){_0x38ef67=_0x38ef67||0xcc;return function(_0x220fb7){if(_0x220fb7){return _0x275f3f[_0x32da('0xd')](_0x38ef67);}return _0x275f3f[_0x32da('0xe')](_0x38ef67)['end']();};}function respondWithResult(_0x513633,_0x2655aa){_0x2655aa=_0x2655aa||0xc8;return function(_0x519a4d){if(_0x519a4d){return _0x513633[_0x32da('0xe')](_0x2655aa)[_0x32da('0xf')](_0x519a4d);}};}function respondWithFilteredResult(_0x378be4,_0x5c6071){return function(_0x2e4095){if(_0x2e4095){var _0x218810=typeof _0x5c6071['offset']===_0x32da('0x10')&&typeof _0x5c6071['limit']==='undefined';var _0x83d906=_0x2e4095[_0x32da('0x11')];var _0x24fd6a=_0x218810?0x0:_0x5c6071['offset'];var _0x584d49=_0x218810?_0x2e4095[_0x32da('0x11')]:_0x5c6071[_0x32da('0x12')]+_0x5c6071[_0x32da('0x13')];var _0x4ec187;if(_0x584d49>=_0x83d906){_0x584d49=_0x83d906;_0x4ec187=0xc8;}else{_0x4ec187=0xce;}_0x378be4[_0x32da('0xe')](_0x4ec187);return _0x378be4[_0x32da('0x14')](_0x32da('0x15'),_0x24fd6a+'-'+_0x584d49+'/'+_0x83d906)['json'](_0x2e4095);}return null;};}function saveUpdates(_0x5c9038){return function(_0x15fed6){if(_0x15fed6){return _0x15fed6[_0x32da('0x16')](_0x5c9038)[_0x32da('0x17')](function(_0x52aee3){return _0x52aee3;});}return null;};}function removeEntity(_0x36de3f){return function(_0x56d266){if(_0x56d266){return _0x56d266['destroy']()[_0x32da('0x17')](function(){_0x36de3f[_0x32da('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ccd17){return function(_0x5124af){if(!_0x5124af){_0x3ccd17[_0x32da('0xd')](0x194);}return _0x5124af;};}function handleError(_0x1add63,_0x80bf8){_0x80bf8=_0x80bf8||0x1f4;return function(_0x7b6b6b){logger['error'](_0x7b6b6b[_0x32da('0x18')]);if(_0x7b6b6b[_0x32da('0x19')]){delete _0x7b6b6b[_0x32da('0x19')];}_0x1add63[_0x32da('0xe')](_0x80bf8)['send'](_0x7b6b6b);};}exports['index']=function(_0x36e825,_0x4286ff){var _0x299a90={};var _0x3cad76=_[_0x32da('0x1a')](db[_0x32da('0x1b')]['rawAttributes'],function(_0x4bf238){return{'name':_0x4bf238['fieldName'],'type':_0x4bf238['type'][_0x32da('0x1c')]};});_0x299a90=qs[_0x32da('0x1d')](_0x3cad76,_0x36e825);return interaction[_0x32da('0x1e')]('openchannel',_0x36e825[_0x32da('0x1f')],_0x36e825[_0x32da('0x20')],_0x299a90,_0x3cad76)['then'](respondWithFilteredResult(_0x4286ff,_0x299a90))[_0x32da('0x21')](handleError(_0x4286ff,null));};exports[_0x32da('0x22')]=function(_0x781104,_0x522279){var _0x3c62c4={};if(_0x781104[_0x32da('0x1f')][_0x32da('0x23')]&&_0x781104['query'][_0x32da('0x23')]===_0x32da('0x24')){_0x3c62c4[_0x32da('0x24')]=_0x781104[_0x32da('0x25')]['id'];}else{_0x3c62c4['id']=_0x781104['params']['id'];}var _0x4bd8f8={'raw':![],'where':_0x3c62c4},_0x3c3b60={};_0x3c3b60['model']=_[_0x32da('0x26')](db[_0x32da('0x1b')][_0x32da('0x27')]);_0x3c3b60[_0x32da('0x1f')]=_[_0x32da('0x26')](_0x781104['query']);_0x3c3b60[_0x32da('0x28')]=_[_0x32da('0x29')](_0x3c3b60[_0x32da('0x2a')],_0x3c3b60[_0x32da('0x1f')]);_0x4bd8f8[_0x32da('0x2b')]=_[_0x32da('0x29')](_0x3c3b60['model'],qs[_0x32da('0x2c')](_0x781104[_0x32da('0x1f')][_0x32da('0x2c')]));_0x4bd8f8['attributes']=_0x4bd8f8[_0x32da('0x2b')]['length']?_0x4bd8f8['attributes']:_0x3c3b60['model'];if(_0x781104['query'][_0x32da('0x2d')]){_0x4bd8f8[_0x32da('0x2e')]=[{'all':!![]}];}_0x4bd8f8=_[_0x32da('0x2f')]({},_0x4bd8f8,_0x781104[_0x32da('0x30')]);return db['OpenchannelInteraction'][_0x32da('0x31')](_0x4bd8f8)[_0x32da('0x17')](handleEntityNotFound(_0x522279,null))[_0x32da('0x17')](respondWithResult(_0x522279,null))[_0x32da('0x21')](handleError(_0x522279,null));};exports['create']=function(_0x2ebff4,_0x5096ce){return db['OpenchannelInteraction'][_0x32da('0x32')](_0x2ebff4['body'],{})[_0x32da('0x17')](respondWithResult(_0x5096ce,0xc9))['catch'](handleError(_0x5096ce,null));};exports[_0x32da('0x16')]=function(_0x33104e,_0x1598d0){if(_0x33104e[_0x32da('0x33')]['id']){delete _0x33104e[_0x32da('0x33')]['id'];}return db['OpenchannelInteraction'][_0x32da('0x31')]({'where':{'id':_0x33104e['params']['id']}})['then'](handleEntityNotFound(_0x1598d0,null))[_0x32da('0x17')](saveUpdates(_0x33104e[_0x32da('0x33')],null))[_0x32da('0x17')](respondWithResult(_0x1598d0,null))[_0x32da('0x21')](handleError(_0x1598d0,null));};exports[_0x32da('0x34')]=function(_0x435acf,_0x2fa4){return db[_0x32da('0x1b')]['find']({'where':{'id':_0x435acf[_0x32da('0x25')]['id']}})['then'](handleEntityNotFound(_0x2fa4,null))[_0x32da('0x17')](removeEntity(_0x2fa4,null))[_0x32da('0x21')](handleError(_0x2fa4,null));};exports['describe']=function(_0x52e515,_0x20f5fb){return db[_0x32da('0x1b')][_0x32da('0x35')]()[_0x32da('0x17')](respondWithResult(_0x20f5fb,null))[_0x32da('0x21')](handleError(_0x20f5fb,null));};exports[_0x32da('0x36')]=function(_0x453c13,_0x3359da){return db[_0x32da('0x37')][_0x32da('0x31')]({'where':{'id':_0x453c13[_0x32da('0x25')]['id']}})[_0x32da('0x17')](handleEntityNotFound(_0x3359da,null))['then'](function(_0x5651a9){if(_0x5651a9){return _0x5651a9[_0x32da('0x36')](_0x453c13[_0x32da('0x33')][_0x32da('0x38')],_[_0x32da('0x39')](_0x453c13[_0x32da('0x33')],['ids','id'])||{});}})['then'](respondWithResult(_0x3359da,null))[_0x32da('0x21')](handleError(_0x3359da,null));};exports[_0x32da('0x3a')]=function(_0x188433,_0x3b1a7f){var _0x5e6679={'raw':![],'where':{}};var _0x4e5b47={};var _0x58e1b8={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x32da('0x3b')]({'where':{'id':_0x188433[_0x32da('0x25')]['id']}})[_0x32da('0x17')](handleEntityNotFound(_0x3b1a7f,null))[_0x32da('0x17')](function(_0x1079be){if(_0x1079be){_0x4e5b47[_0x32da('0x2a')]=_[_0x32da('0x26')](db[_0x32da('0x37')][_0x32da('0x27')]);_0x4e5b47['query']=_[_0x32da('0x26')](_0x188433[_0x32da('0x1f')]);_0x4e5b47[_0x32da('0x28')]=_[_0x32da('0x29')](_0x4e5b47[_0x32da('0x2a')],_0x4e5b47['query']);_0x5e6679[_0x32da('0x2b')]=_[_0x32da('0x29')](_0x4e5b47[_0x32da('0x2a')],qs['fields'](_0x188433['query'][_0x32da('0x2c')]));_0x5e6679[_0x32da('0x2b')]=_0x5e6679[_0x32da('0x2b')][_0x32da('0x3c')]?_0x5e6679[_0x32da('0x2b')]:_0x4e5b47[_0x32da('0x2a')];if(!_0x188433[_0x32da('0x1f')][_0x32da('0x3d')]('nolimit')){_0x5e6679[_0x32da('0x13')]=qs['limit'](_0x188433[_0x32da('0x1f')]['limit']);_0x5e6679['offset']=qs[_0x32da('0x12')](_0x188433[_0x32da('0x1f')][_0x32da('0x12')]);}_0x5e6679[_0x32da('0x3e')]=qs['sort'](_0x188433[_0x32da('0x1f')][_0x32da('0x3f')]);_0x5e6679[_0x32da('0x40')]=qs[_0x32da('0x28')](_[_0x32da('0x41')](_0x188433[_0x32da('0x1f')],_0x4e5b47['filters']));_0x5e6679['where'][_0x32da('0x42')]=_0x1079be['id'];if(_0x188433[_0x32da('0x1f')][_0x32da('0x43')]){_0x5e6679[_0x32da('0x40')]=_[_0x32da('0x2f')](_0x5e6679[_0x32da('0x40')],{'$or':_[_0x32da('0x1a')](_0x5e6679[_0x32da('0x2b')],function(_0x297f7e){var _0x4f495f={};_0x4f495f[_0x297f7e]={'$like':'%'+_0x188433['query'][_0x32da('0x43')]+'%'};return _0x4f495f;})});}if(_0x188433[_0x32da('0x1f')][_0x32da('0x44')]){var _0x20e7c0=_0x188433[_0x32da('0x1f')][_0x32da('0x44')][_0x32da('0x45')](',');var _0xce0f8e={};_0xce0f8e[_0x20e7c0[0x0]]={'$gte':moment(_0x20e7c0[0x1])[_0x32da('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5e6679[_0x32da('0x40')]=_[_0x32da('0x2f')](_0x5e6679[_0x32da('0x40')],_0xce0f8e);}_0x5e6679=_[_0x32da('0x2f')]({},_0x5e6679,_0x188433[_0x32da('0x30')]);return db[_0x32da('0x37')][_0x32da('0x11')]({'where':_0x5e6679[_0x32da('0x40')]})[_0x32da('0x17')](function(_0x9c478c){_0x58e1b8[_0x32da('0x11')]=_0x9c478c;if(_0x188433[_0x32da('0x1f')][_0x32da('0x2d')]){_0x5e6679[_0x32da('0x2e')]=[{'all':!![]}];}return db[_0x32da('0x37')][_0x32da('0x1e')](_0x5e6679);})[_0x32da('0x17')](function(_0x15c307){_0x58e1b8['rows']=_0x15c307;return _0x58e1b8;});}})[_0x32da('0x17')](respondWithFilteredResult(_0x3b1a7f,_0x5e6679))[_0x32da('0x21')](handleError(_0x3b1a7f,null));};exports['addTags']=function(_0x2fc01a,_0x373fc3){return db['OpenchannelInteraction'][_0x32da('0x31')]({'where':{'id':_0x2fc01a[_0x32da('0x25')]['id']}})[_0x32da('0x17')](handleEntityNotFound(_0x373fc3,null))['then'](function(_0x8c0d60){if(_0x8c0d60){return _0x8c0d60[_0x32da('0x47')](_0x2fc01a[_0x32da('0x33')][_0x32da('0x38')],_[_0x32da('0x39')](_0x2fc01a[_0x32da('0x33')],['ids','id'])||{})[_0x32da('0x48')](function(){return db[_0x32da('0x49')]['findAll']({'attributes':['id',_0x32da('0x19'),_0x32da('0x4a')],'where':{'id':_0x2fc01a[_0x32da('0x33')]['ids']}});})['then'](function(_0x3e929a){socket[_0x32da('0x4b')](_0x32da('0x4c'),{'id':Number(_0x2fc01a[_0x32da('0x25')]['id']),'tags':_0x3e929a||[]});return{'id':Number(_0x2fc01a['params']['id']),'tags':_0x3e929a||[]};});}})['then'](respondWithResult(_0x373fc3,null))[_0x32da('0x21')](handleError(_0x373fc3,null));};exports[_0x32da('0x4d')]=function(_0x58138f,_0x3c1f5f){return db['OpenchannelInteraction'][_0x32da('0x31')]({'where':{'id':_0x58138f[_0x32da('0x25')]['id']}})[_0x32da('0x17')](handleEntityNotFound(_0x3c1f5f,null))[_0x32da('0x17')](function(_0x1d9920){if(_0x1d9920){return _0x1d9920[_0x32da('0x4d')](_0x58138f[_0x32da('0x1f')][_0x32da('0x38')]);}})['then'](respondWithStatusCode(_0x3c1f5f,null))['catch'](handleError(_0x3c1f5f,null));};exports[_0x32da('0x4e')]=function(_0x530a82,_0x4ca50b){var _0x12de65=moment()[_0x32da('0x4f')]()[_0x32da('0x50')]();var _0x4b7846=path[_0x32da('0x51')](config[_0x32da('0x52')],_0x32da('0x53'),_0x32da('0x54'),_0x32da('0x55'));var _0x39352d=path['join'](config[_0x32da('0x52')],_0x32da('0x53'),_0x32da('0x54'),_0x32da('0x56'));var _0x804c77=path[_0x32da('0x51')](_0x4b7846,_0x12de65);var _0x2c98ea=util[_0x32da('0x46')]('transcript-%d-%s.zip',_0x530a82[_0x32da('0x25')]['id'],_0x12de65);var _0x221904=path[_0x32da('0x51')](_0x4b7846,_0x2c98ea);var _0x57ccbb=[];_0x57ccbb['push']({'model':db[_0x32da('0x57')],'as':'User','attributes':['id',_0x32da('0x58')],'raw':!![]});_0x57ccbb[_0x32da('0x59')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x32da('0x5a'),'lastName'],'raw':!![]});if(_0x530a82['query']['attachments']){_0x57ccbb[_0x32da('0x59')]({'model':db[_0x32da('0x5b')],'as':_0x32da('0x5b'),'raw':!![]});}var _0x51b935=[{'model':db[_0x32da('0x37')],'as':_0x32da('0x5c'),'attributes':['id',_0x32da('0x33'),_0x32da('0x5d'),_0x32da('0x5e'),_0x32da('0x5f'),_0x32da('0x60')],'include':_0x57ccbb}];_0x51b935[_0x32da('0x59')]({'model':db[_0x32da('0x61')],'as':_0x32da('0x62'),'attributes':['id','name']});_0x51b935['push']({'model':db[_0x32da('0x57')],'as':_0x32da('0x63'),'attributes':['id',_0x32da('0x58')]});return db[_0x32da('0x1b')][_0x32da('0x31')]({'where':{'id':_0x530a82['params']['id']},'include':_0x51b935})['then'](handleEntityNotFound(_0x4ca50b,null))[_0x32da('0x17')](function(_0x13130f){if(_0x13130f){var _0x2f6cb6=_0x13130f[_0x32da('0x64')]({'plain':!![]});fs[_0x32da('0x65')](_0x804c77);var _0x3bfa82={'channel':'Openchannel','account':_0x2f6cb6[_0x32da('0x62')][_0x32da('0x19')],'agent':_0x2f6cb6['Owner']?_0x2f6cb6[_0x32da('0x63')][_0x32da('0x58')]:'N.A.','createdAt':moment(_0x2f6cb6['createdAt'])[_0x32da('0x46')](_0x32da('0x66'))[_0x32da('0x50')](),'closedAt':_0x2f6cb6['closed']?moment(_0x2f6cb6[_0x32da('0x67')])['format'](_0x32da('0x66'))[_0x32da('0x50')]():'','disposition':_0x2f6cb6[_0x32da('0x68')],'visibility':_0x2f6cb6['threadId']?_0x32da('0x69'):_0x32da('0x6a'),'messages':_(_0x2f6cb6[_0x32da('0x5c')])[_0x32da('0x43')]({'secret':![]})[_0x32da('0x1a')](function(_0x48103a){if(_0x48103a[_0x32da('0x5b')]){var _0x361892=path[_0x32da('0x51')](_0x39352d,_0x48103a[_0x32da('0x5b')][_0x32da('0x6b')]);if(fs['existsSync'](_0x361892)){fs[_0x32da('0x6c')](_0x361892)[_0x32da('0x6d')](fs['createWriteStream'](path['join'](_0x804c77,_0x48103a[_0x32da('0x5b')][_0x32da('0x6b')])));}}return{'date':moment(_0x48103a[_0x32da('0x5d')])[_0x32da('0x46')](_0x32da('0x66'))[_0x32da('0x50')](),'sender':_0x48103a[_0x32da('0x5e')]===_0x32da('0x6e')?_0x48103a[_0x32da('0x57')]?_0x48103a['User'][_0x32da('0x58')]:_0x32da('0x6f'):_0x48103a[_0x32da('0x70')][_0x32da('0x5a')]+(_0x48103a[_0x32da('0x70')]['lastName']?'\x20'+_0x48103a[_0x32da('0x70')]['lastName']:''),'body':_0x48103a[_0x32da('0x5b')]?_0x48103a['Attachment']['basename']:_0x48103a[_0x32da('0x33')],'direction':_0x48103a[_0x32da('0x5e')]===_0x32da('0x6e')?'A':'C','secret':_0x48103a[_0x32da('0x5f')],'read':_0x48103a[_0x32da('0x60')],'attachment':_0x48103a[_0x32da('0x5b')]};})[_0x32da('0x71')]()};return ejs[_0x32da('0x72')](path[_0x32da('0x51')](config[_0x32da('0x52')],_0x32da('0x53'),_0x32da('0x73'),_0x32da('0x74')),{'interaction':_0x3bfa82})[_0x32da('0x17')](function(_0x168167){var _0x39783e=path[_0x32da('0x51')](_0x804c77,'transcript-'+_0x2f6cb6['id']+'-'+_0x12de65+_0x32da('0x75'));var _0x1f899d={'path':_0x39783e,'channel':_0x32da('0x76'),'interactionId':_0x2f6cb6['id']};return pdf['createPdfFromHTML'](_0x168167,_0x1f899d);})[_0x32da('0x17')](function(){return new Promise(function(_0x22b6e9,_0x53b5d1){zipdir(_0x804c77,{'saveTo':_0x221904},function(_0x1e992f,_0x118af6){if(_0x1e992f)return _0x53b5d1(_0x1e992f);return _0x22b6e9(_0x118af6);});})[_0x32da('0x17')](function(){return new Promise(function(_0x13593d,_0x16d795){rimraf(_0x804c77,function(_0x200c0b){if(_0x200c0b)_0x16d795(_0x200c0b);return _0x13593d();});});})[_0x32da('0x17')](function(){return _0x4ca50b[_0x32da('0x4e')](_0x221904,_0x2c98ea,function(_0xcb19c){if(_0xcb19c){logger['error'](_0x32da('0x77'),_0xcb19c);}else{fs[_0x32da('0x78')](_0x221904);}});});});}else{return _0x4ca50b[_0x32da('0xd')](0xc8);}})[_0x32da('0x21')](handleError(_0x4ca50b,null));}; \ No newline at end of file +var _0xff60=['openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','push','User','fullname','CmContact','Contact','Attachment','Messages','direction','secret','read','Account','Owner','get','Openchannel','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','error','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','create','body','describe','OpenchannelMessage','find','addMessage','ids','omit','getMessages','sort','where','OpenchannelInteractionId','merge','map','filter','$gte','split','format','include','rows','spread','color','emit'];(function(_0x30b93e,_0x469575){var _0x37ad85=function(_0x55c568){while(--_0x55c568){_0x30b93e['push'](_0x30b93e['shift']());}};_0x37ad85(++_0x469575);}(_0xff60,0x132));var _0x0ff6=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xff60[_0x37bd26];return _0xe83dc4;};'use strict';var rimraf=require(_0x0ff6('0x0'));var zipdir=require(_0x0ff6('0x1'));var moment=require(_0x0ff6('0x2'));var util=require('util');var path=require(_0x0ff6('0x3'));var ejs=require(_0x0ff6('0x4'));var fs=require('fs');var _=require(_0x0ff6('0x5'));var Redis=require('ioredis');var interaction=require(_0x0ff6('0x6'));var qs=require(_0x0ff6('0x7'));var pdf=require(_0x0ff6('0x8'));var logger=require(_0x0ff6('0x9'))(_0x0ff6('0xa'));var config=require(_0x0ff6('0xb'));var db=require(_0x0ff6('0xc'))['db'];config[_0x0ff6('0xd')]=_[_0x0ff6('0xe')](config['redis'],{'host':_0x0ff6('0xf'),'port':0x18eb});var socket=require(_0x0ff6('0x10'))(new Redis(config[_0x0ff6('0xd')]));require(_0x0ff6('0x11'))[_0x0ff6('0x12')](socket);function respondWithStatusCode(_0x199355,_0x35dfcb){_0x35dfcb=_0x35dfcb||0xcc;return function(_0x5c81a7){if(_0x5c81a7){return _0x199355[_0x0ff6('0x13')](_0x35dfcb);}return _0x199355[_0x0ff6('0x14')](_0x35dfcb)[_0x0ff6('0x15')]();};}function respondWithResult(_0x5db213,_0x5ece19){_0x5ece19=_0x5ece19||0xc8;return function(_0x4955d2){if(_0x4955d2){return _0x5db213[_0x0ff6('0x14')](_0x5ece19)[_0x0ff6('0x16')](_0x4955d2);}};}function respondWithFilteredResult(_0x20d0fb,_0x2b8d58){return function(_0x348f9f){if(_0x348f9f){var _0x53fa32=typeof _0x2b8d58[_0x0ff6('0x17')]===_0x0ff6('0x18')&&typeof _0x2b8d58['limit']==='undefined';var _0x2565a2=_0x348f9f['count'];var _0x6674b6=_0x53fa32?0x0:_0x2b8d58['offset'];var _0x4caa87=_0x53fa32?_0x348f9f[_0x0ff6('0x19')]:_0x2b8d58['offset']+_0x2b8d58[_0x0ff6('0x1a')];var _0x58c92c;if(_0x4caa87>=_0x2565a2){_0x4caa87=_0x2565a2;_0x58c92c=0xc8;}else{_0x58c92c=0xce;}_0x20d0fb[_0x0ff6('0x14')](_0x58c92c);return _0x20d0fb[_0x0ff6('0x1b')](_0x0ff6('0x1c'),_0x6674b6+'-'+_0x4caa87+'/'+_0x2565a2)[_0x0ff6('0x16')](_0x348f9f);}return null;};}function saveUpdates(_0xb8e7fc){return function(_0x148841){if(_0x148841){return _0x148841[_0x0ff6('0x1d')](_0xb8e7fc)['then'](function(_0x554179){return _0x554179;});}return null;};}function removeEntity(_0x204fbb){return function(_0x4f023a){if(_0x4f023a){return _0x4f023a[_0x0ff6('0x1e')]()[_0x0ff6('0x1f')](function(){_0x204fbb[_0x0ff6('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a0190){return function(_0x5c9fa7){if(!_0x5c9fa7){_0x5a0190[_0x0ff6('0x13')](0x194);}return _0x5c9fa7;};}function handleError(_0x26ad31,_0x1bb5e8){_0x1bb5e8=_0x1bb5e8||0x1f4;return function(_0x192214){logger[_0x0ff6('0x20')](_0x192214['stack']);if(_0x192214[_0x0ff6('0x21')]){delete _0x192214[_0x0ff6('0x21')];}_0x26ad31['status'](_0x1bb5e8)['send'](_0x192214);};}exports[_0x0ff6('0x22')]=function(_0xda6dbc,_0x366df6){var _0x8f0f40={};var _0x1b9679=_['map'](db[_0x0ff6('0x23')][_0x0ff6('0x24')],function(_0x44e639){return{'name':_0x44e639[_0x0ff6('0x25')],'type':_0x44e639[_0x0ff6('0x26')][_0x0ff6('0x27')]};});_0x8f0f40=qs[_0x0ff6('0x28')](_0x1b9679,_0xda6dbc);return interaction[_0x0ff6('0x29')](_0x0ff6('0x2a'),_0xda6dbc[_0x0ff6('0x2b')],_0xda6dbc[_0x0ff6('0x2c')],_0x8f0f40,_0x1b9679)[_0x0ff6('0x1f')](respondWithFilteredResult(_0x366df6,_0x8f0f40))[_0x0ff6('0x2d')](handleError(_0x366df6,null));};exports[_0x0ff6('0x2e')]=function(_0x1bca7a,_0x465a68){var _0x186398={};if(_0x1bca7a['query'][_0x0ff6('0x26')]&&_0x1bca7a[_0x0ff6('0x2b')][_0x0ff6('0x26')]===_0x0ff6('0x2f')){_0x186398[_0x0ff6('0x2f')]=_0x1bca7a[_0x0ff6('0x30')]['id'];}else{_0x186398['id']=_0x1bca7a['params']['id'];}var _0x1bfbd6={'raw':![],'where':_0x186398},_0x1d918f={};_0x1d918f[_0x0ff6('0x31')]=_[_0x0ff6('0x32')](db[_0x0ff6('0x23')][_0x0ff6('0x24')]);_0x1d918f['query']=_[_0x0ff6('0x32')](_0x1bca7a[_0x0ff6('0x2b')]);_0x1d918f[_0x0ff6('0x33')]=_[_0x0ff6('0x34')](_0x1d918f[_0x0ff6('0x31')],_0x1d918f[_0x0ff6('0x2b')]);_0x1bfbd6[_0x0ff6('0x35')]=_['intersection'](_0x1d918f['model'],qs[_0x0ff6('0x36')](_0x1bca7a[_0x0ff6('0x2b')][_0x0ff6('0x36')]));_0x1bfbd6['attributes']=_0x1bfbd6['attributes'][_0x0ff6('0x37')]?_0x1bfbd6['attributes']:_0x1d918f[_0x0ff6('0x31')];if(_0x1bca7a['query'][_0x0ff6('0x38')]){_0x1bfbd6['include']=[{'all':!![]}];}_0x1bfbd6=_['merge']({},_0x1bfbd6,_0x1bca7a[_0x0ff6('0x39')]);return db['OpenchannelInteraction']['find'](_0x1bfbd6)[_0x0ff6('0x1f')](handleEntityNotFound(_0x465a68,null))['then'](respondWithResult(_0x465a68,null))[_0x0ff6('0x2d')](handleError(_0x465a68,null));};exports[_0x0ff6('0x3a')]=function(_0x526a35,_0x214ab6){return db['OpenchannelInteraction']['create'](_0x526a35[_0x0ff6('0x3b')],{})[_0x0ff6('0x1f')](respondWithResult(_0x214ab6,0xc9))['catch'](handleError(_0x214ab6,null));};exports[_0x0ff6('0x1d')]=function(_0x5592ef,_0xfdd618){if(_0x5592ef[_0x0ff6('0x3b')]['id']){delete _0x5592ef[_0x0ff6('0x3b')]['id'];}return db[_0x0ff6('0x23')]['find']({'where':{'id':_0x5592ef[_0x0ff6('0x30')]['id']}})[_0x0ff6('0x1f')](handleEntityNotFound(_0xfdd618,null))[_0x0ff6('0x1f')](saveUpdates(_0x5592ef[_0x0ff6('0x3b')],null))[_0x0ff6('0x1f')](respondWithResult(_0xfdd618,null))['catch'](handleError(_0xfdd618,null));};exports['destroy']=function(_0x56c984,_0x27984d){return db[_0x0ff6('0x23')]['find']({'where':{'id':_0x56c984[_0x0ff6('0x30')]['id']}})[_0x0ff6('0x1f')](handleEntityNotFound(_0x27984d,null))['then'](removeEntity(_0x27984d,null))[_0x0ff6('0x2d')](handleError(_0x27984d,null));};exports['describe']=function(_0xe30370,_0x5629db){return db['OpenchannelInteraction'][_0x0ff6('0x3c')]()[_0x0ff6('0x1f')](respondWithResult(_0x5629db,null))[_0x0ff6('0x2d')](handleError(_0x5629db,null));};exports['addMessage']=function(_0x2d5460,_0x1d72db){return db[_0x0ff6('0x3d')][_0x0ff6('0x3e')]({'where':{'id':_0x2d5460[_0x0ff6('0x30')]['id']}})[_0x0ff6('0x1f')](handleEntityNotFound(_0x1d72db,null))[_0x0ff6('0x1f')](function(_0x35c282){if(_0x35c282){return _0x35c282[_0x0ff6('0x3f')](_0x2d5460[_0x0ff6('0x3b')][_0x0ff6('0x40')],_[_0x0ff6('0x41')](_0x2d5460[_0x0ff6('0x3b')],[_0x0ff6('0x40'),'id'])||{});}})[_0x0ff6('0x1f')](respondWithResult(_0x1d72db,null))[_0x0ff6('0x2d')](handleError(_0x1d72db,null));};exports[_0x0ff6('0x42')]=function(_0x31aba6,_0x284545){var _0x58dcba={'raw':![],'where':{}};var _0x42a4f6={};var _0x455e6b={'count':0x0,'rows':[]};return db[_0x0ff6('0x23')]['findOne']({'where':{'id':_0x31aba6[_0x0ff6('0x30')]['id']}})['then'](handleEntityNotFound(_0x284545,null))[_0x0ff6('0x1f')](function(_0x3c0581){if(_0x3c0581){_0x42a4f6['model']=_[_0x0ff6('0x32')](db[_0x0ff6('0x3d')]['rawAttributes']);_0x42a4f6[_0x0ff6('0x2b')]=_[_0x0ff6('0x32')](_0x31aba6[_0x0ff6('0x2b')]);_0x42a4f6[_0x0ff6('0x33')]=_[_0x0ff6('0x34')](_0x42a4f6['model'],_0x42a4f6['query']);_0x58dcba['attributes']=_[_0x0ff6('0x34')](_0x42a4f6['model'],qs[_0x0ff6('0x36')](_0x31aba6[_0x0ff6('0x2b')]['fields']));_0x58dcba[_0x0ff6('0x35')]=_0x58dcba['attributes'][_0x0ff6('0x37')]?_0x58dcba[_0x0ff6('0x35')]:_0x42a4f6[_0x0ff6('0x31')];if(!_0x31aba6['query']['hasOwnProperty']('nolimit')){_0x58dcba[_0x0ff6('0x1a')]=qs['limit'](_0x31aba6['query']['limit']);_0x58dcba[_0x0ff6('0x17')]=qs[_0x0ff6('0x17')](_0x31aba6[_0x0ff6('0x2b')][_0x0ff6('0x17')]);}_0x58dcba['order']=qs[_0x0ff6('0x43')](_0x31aba6[_0x0ff6('0x2b')]['sort']);_0x58dcba[_0x0ff6('0x44')]=qs['filters'](_['pick'](_0x31aba6['query'],_0x42a4f6[_0x0ff6('0x33')]));_0x58dcba['where'][_0x0ff6('0x45')]=_0x3c0581['id'];if(_0x31aba6[_0x0ff6('0x2b')]['filter']){_0x58dcba[_0x0ff6('0x44')]=_[_0x0ff6('0x46')](_0x58dcba['where'],{'$or':_[_0x0ff6('0x47')](_0x58dcba[_0x0ff6('0x35')],function(_0x544dfe){var _0xe758c5={};_0xe758c5[_0x544dfe]={'$like':'%'+_0x31aba6['query'][_0x0ff6('0x48')]+'%'};return _0xe758c5;})});}if(_0x31aba6[_0x0ff6('0x2b')]['$gte']){var _0x590a8b=_0x31aba6[_0x0ff6('0x2b')][_0x0ff6('0x49')][_0x0ff6('0x4a')](',');var _0x14dfef={};_0x14dfef[_0x590a8b[0x0]]={'$gte':moment(_0x590a8b[0x1])[_0x0ff6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x58dcba[_0x0ff6('0x44')]=_[_0x0ff6('0x46')](_0x58dcba[_0x0ff6('0x44')],_0x14dfef);}_0x58dcba=_['merge']({},_0x58dcba,_0x31aba6[_0x0ff6('0x39')]);return db[_0x0ff6('0x3d')][_0x0ff6('0x19')]({'where':_0x58dcba[_0x0ff6('0x44')]})[_0x0ff6('0x1f')](function(_0x568873){_0x455e6b['count']=_0x568873;if(_0x31aba6[_0x0ff6('0x2b')][_0x0ff6('0x38')]){_0x58dcba[_0x0ff6('0x4c')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x0ff6('0x29')](_0x58dcba);})['then'](function(_0x1ecb09){_0x455e6b[_0x0ff6('0x4d')]=_0x1ecb09;return _0x455e6b;});}})[_0x0ff6('0x1f')](respondWithFilteredResult(_0x284545,_0x58dcba))['catch'](handleError(_0x284545,null));};exports['addTags']=function(_0x1998ab,_0x2cb2e8){return db[_0x0ff6('0x23')][_0x0ff6('0x3e')]({'where':{'id':_0x1998ab[_0x0ff6('0x30')]['id']}})[_0x0ff6('0x1f')](handleEntityNotFound(_0x2cb2e8,null))[_0x0ff6('0x1f')](function(_0x28cb02){if(_0x28cb02){return _0x28cb02['setTags'](_0x1998ab[_0x0ff6('0x3b')]['ids'],_[_0x0ff6('0x41')](_0x1998ab['body'],[_0x0ff6('0x40'),'id'])||{})[_0x0ff6('0x4e')](function(){return db['Tag'][_0x0ff6('0x29')]({'attributes':['id',_0x0ff6('0x21'),_0x0ff6('0x4f')],'where':{'id':_0x1998ab[_0x0ff6('0x3b')]['ids']}});})[_0x0ff6('0x1f')](function(_0x2dd6d3){socket[_0x0ff6('0x50')](_0x0ff6('0x51'),{'id':Number(_0x1998ab[_0x0ff6('0x30')]['id']),'tags':_0x2dd6d3||[]});return{'id':Number(_0x1998ab[_0x0ff6('0x30')]['id']),'tags':_0x2dd6d3||[]};});}})[_0x0ff6('0x1f')](respondWithResult(_0x2cb2e8,null))[_0x0ff6('0x2d')](handleError(_0x2cb2e8,null));};exports[_0x0ff6('0x52')]=function(_0x20cce4,_0x33e1e5){return db[_0x0ff6('0x23')][_0x0ff6('0x3e')]({'where':{'id':_0x20cce4['params']['id']}})[_0x0ff6('0x1f')](handleEntityNotFound(_0x33e1e5,null))[_0x0ff6('0x1f')](function(_0x1c1414){if(_0x1c1414){return _0x1c1414[_0x0ff6('0x52')](_0x20cce4[_0x0ff6('0x2b')][_0x0ff6('0x40')]);}})[_0x0ff6('0x1f')](respondWithStatusCode(_0x33e1e5,null))['catch'](handleError(_0x33e1e5,null));};exports[_0x0ff6('0x53')]=function(_0x2f7679,_0x18d253){var _0x37938d=moment()[_0x0ff6('0x54')]()[_0x0ff6('0x55')]();var _0x40e58f=path[_0x0ff6('0x56')](config[_0x0ff6('0x57')],_0x0ff6('0x58'),_0x0ff6('0x59'),'tmp');var _0x44f9ae=path[_0x0ff6('0x56')](config['root'],'server',_0x0ff6('0x59'),_0x0ff6('0x5a'));var _0x140779=path['join'](_0x40e58f,_0x37938d);var _0x102abf=util[_0x0ff6('0x4b')]('transcript-%d-%s.zip',_0x2f7679[_0x0ff6('0x30')]['id'],_0x37938d);var _0x14987b=path[_0x0ff6('0x56')](_0x40e58f,_0x102abf);var _0x4e130=[];_0x4e130[_0x0ff6('0x5b')]({'model':db['User'],'as':_0x0ff6('0x5c'),'attributes':['id',_0x0ff6('0x5d')],'raw':!![]});_0x4e130[_0x0ff6('0x5b')]({'model':db[_0x0ff6('0x5e')],'as':_0x0ff6('0x5f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x2f7679[_0x0ff6('0x2b')][_0x0ff6('0x5a')]){_0x4e130[_0x0ff6('0x5b')]({'model':db['Attachment'],'as':_0x0ff6('0x60'),'raw':!![]});}var _0x553b35=[{'model':db['OpenchannelMessage'],'as':_0x0ff6('0x61'),'attributes':['id',_0x0ff6('0x3b'),'createdAt',_0x0ff6('0x62'),_0x0ff6('0x63'),_0x0ff6('0x64')],'include':_0x4e130}];_0x553b35[_0x0ff6('0x5b')]({'model':db['OpenchannelAccount'],'as':_0x0ff6('0x65'),'attributes':['id',_0x0ff6('0x21')]});_0x553b35[_0x0ff6('0x5b')]({'model':db[_0x0ff6('0x5c')],'as':_0x0ff6('0x66'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0x0ff6('0x3e')]({'where':{'id':_0x2f7679['params']['id']},'include':_0x553b35})[_0x0ff6('0x1f')](handleEntityNotFound(_0x18d253,null))['then'](function(_0x392639){if(_0x392639){var _0x186b5f=_0x392639[_0x0ff6('0x67')]({'plain':!![]});fs['mkdirSync'](_0x140779);var _0x42e0fd={'channel':_0x0ff6('0x68'),'account':_0x186b5f[_0x0ff6('0x65')][_0x0ff6('0x21')],'agent':_0x186b5f[_0x0ff6('0x66')]?_0x186b5f['Owner']['fullname']:_0x0ff6('0x69'),'createdAt':moment(_0x186b5f[_0x0ff6('0x6a')])[_0x0ff6('0x4b')](_0x0ff6('0x6b'))[_0x0ff6('0x55')](),'closedAt':_0x186b5f[_0x0ff6('0x6c')]?moment(_0x186b5f['closedAt'])[_0x0ff6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x186b5f[_0x0ff6('0x6d')],'visibility':_0x186b5f[_0x0ff6('0x6e')]?_0x0ff6('0x6f'):_0x0ff6('0x70'),'messages':_(_0x186b5f[_0x0ff6('0x61')])['filter']({'secret':![]})[_0x0ff6('0x47')](function(_0x50566f){if(_0x50566f[_0x0ff6('0x60')]){var _0x4d41da=path['join'](_0x44f9ae,_0x50566f[_0x0ff6('0x60')]['basename']);if(fs[_0x0ff6('0x71')](_0x4d41da)){fs[_0x0ff6('0x72')](_0x4d41da)[_0x0ff6('0x73')](fs[_0x0ff6('0x74')](path[_0x0ff6('0x56')](_0x140779,_0x50566f[_0x0ff6('0x60')][_0x0ff6('0x75')])));}}return{'date':moment(_0x50566f[_0x0ff6('0x6a')])['format'](_0x0ff6('0x6b'))[_0x0ff6('0x55')](),'sender':_0x50566f[_0x0ff6('0x62')]===_0x0ff6('0x76')?_0x50566f[_0x0ff6('0x5c')]?_0x50566f[_0x0ff6('0x5c')][_0x0ff6('0x5d')]:_0x0ff6('0x77'):_0x50566f[_0x0ff6('0x5f')]['firstName']+(_0x50566f[_0x0ff6('0x5f')]['lastName']?'\x20'+_0x50566f[_0x0ff6('0x5f')]['lastName']:''),'body':_0x50566f[_0x0ff6('0x60')]?_0x50566f['Attachment'][_0x0ff6('0x75')]:_0x50566f['body'],'direction':_0x50566f['direction']==='out'?'A':'C','secret':_0x50566f['secret'],'read':_0x50566f[_0x0ff6('0x64')],'attachment':_0x50566f[_0x0ff6('0x60')]};})[_0x0ff6('0x78')]()};return ejs[_0x0ff6('0x79')](path['join'](config['root'],_0x0ff6('0x58'),_0x0ff6('0x7a'),_0x0ff6('0x7b')),{'interaction':_0x42e0fd})[_0x0ff6('0x1f')](function(_0x1e1f64){var _0x4c68ea=path[_0x0ff6('0x56')](_0x140779,_0x0ff6('0x7c')+_0x186b5f['id']+'-'+_0x37938d+_0x0ff6('0x7d'));var _0x5e10f3={'path':_0x4c68ea,'channel':_0x0ff6('0x68'),'interactionId':_0x186b5f['id']};return pdf[_0x0ff6('0x7e')](_0x1e1f64,_0x5e10f3);})[_0x0ff6('0x1f')](function(){return new Promise(function(_0x49cec1,_0x266dbb){zipdir(_0x140779,{'saveTo':_0x14987b},function(_0x49a494,_0x1821f8){if(_0x49a494)return _0x266dbb(_0x49a494);return _0x49cec1(_0x1821f8);});})[_0x0ff6('0x1f')](function(){return new Promise(function(_0xf16425,_0x152dff){rimraf(_0x140779,function(_0x2c61ef){if(_0x2c61ef)_0x152dff(_0x2c61ef);return _0xf16425();});});})[_0x0ff6('0x1f')](function(){return _0x18d253[_0x0ff6('0x53')](_0x14987b,_0x102abf,function(_0x4c997d){if(_0x4c997d){logger['error'](_0x0ff6('0x7f'),_0x4c997d);}else{fs[_0x0ff6('0x80')](_0x14987b);}});});});}else{return _0x18d253[_0x0ff6('0x13')](0xc8);}})['catch'](handleError(_0x18d253,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 9d0e7eb..48b9f72 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 _0xe961=['update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hook','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','save'];(function(_0x3d98fe,_0x3e2f69){var _0x322b78=function(_0x4150d7){while(--_0x4150d7){_0x3d98fe['push'](_0x3d98fe['shift']());}};_0x322b78(++_0x3e2f69);}(_0xe961,0x8c));var _0x1e96=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xe961[_0x481bf7];return _0x461787;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x1e96('0x0'))['db'][_0x1e96('0x1')];var OpenchannelMessage=require(_0x1e96('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1e96('0x2')](0x0);var events={'afterCreate':_0x1e96('0x3'),'afterUpdate':_0x1e96('0x4'),'afterDestroy':_0x1e96('0x5')};function emitEvent(_0x492218){return function(_0x3965eb,_0x285e5b,_0x31b363){_0x3965eb[_0x1e96('0x6')]({'attributes':['id'],'raw':!![]})[_0x1e96('0x7')](function(_0x33c46c){_0x3965eb[_0x1e96('0x8')](_0x1e96('0x9'),_0x33c46c['map'](function(_0x5b61ea){return{'id':_0x5b61ea['id']};}));return OpenchannelMessage[_0x1e96('0xa')]({'where':{'OpenchannelInteractionId':_0x3965eb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e96('0x7')](function(_0x2e0569){_0x3965eb['setDataValue'](_0x1e96('0xb'),_0x2e0569[_0x1e96('0xc')]);OpenchannelInteractionEvents[_0x1e96('0xd')](_0x492218+':'+_0x3965eb['id'],_0x3965eb);OpenchannelInteractionEvents[_0x1e96('0xd')](_0x492218,_0x3965eb);_0x31b363(null);})['catch'](_0x31b363(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x1e96('0xe')](e,emitEvent(event));}}module[_0x1e96('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x670b=['events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0x670b,0xbb));var _0xb670=function(_0x298917,_0x33e4ff){_0x298917=_0x298917-0x0;var _0x857d91=_0x670b[_0x298917];return _0x857d91;};'use strict';var EventEmitter=require(_0xb670('0x0'));var OpenchannelInteraction=require(_0xb670('0x1'))['db'][_0xb670('0x2')];var OpenchannelMessage=require(_0xb670('0x1'))['db'][_0xb670('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb670('0x4')](0x0);var events={'afterCreate':_0xb670('0x5'),'afterUpdate':'update','afterDestroy':_0xb670('0x6')};function emitEvent(_0x372f30){return function(_0x5d37d2,_0x22f814,_0x396af6){_0x5d37d2[_0xb670('0x7')]({'attributes':['id'],'raw':!![]})[_0xb670('0x8')](function(_0x10eda4){_0x5d37d2[_0xb670('0x9')](_0xb670('0xa'),_0x10eda4['map'](function(_0x2b649c){return{'id':_0x2b649c['id']};}));return OpenchannelMessage[_0xb670('0xb')]({'where':{'OpenchannelInteractionId':_0x5d37d2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24fb0e){_0x5d37d2[_0xb670('0x9')](_0xb670('0xc'),_0x24fb0e[_0xb670('0xd')]);OpenchannelInteractionEvents[_0xb670('0xe')](_0x372f30+':'+_0x5d37d2['id'],_0x5d37d2);OpenchannelInteractionEvents[_0xb670('0xe')](_0x372f30,_0x5d37d2);_0x396af6(null);})['catch'](_0x396af6(null));};}for(var e in events){if(events[_0xb670('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xb670('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 7354400..644bbcb 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 _0x5a95=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','lodash','util','api','moment'];(function(_0x5b6117,_0x285670){var _0x5e7d36=function(_0x5ed25e){while(--_0x5ed25e){_0x5b6117['push'](_0x5b6117['shift']());}};_0x5e7d36(++_0x285670);}(_0x5a95,0x140));var _0x55a9=function(_0x198cfd,_0x9fad0f){_0x198cfd=_0x198cfd-0x0;var _0x1a1959=_0x5a95[_0x198cfd];return _0x1a1959;};'use strict';var _=require(_0x55a9('0x0'));var util=require(_0x55a9('0x1'));var logger=require('../../config/logger')(_0x55a9('0x2'));var moment=require(_0x55a9('0x3'));var BPromise=require(_0x55a9('0x4'));var rp=require(_0x55a9('0x5'));var fs=require('fs');var path=require(_0x55a9('0x6'));var rimraf=require(_0x55a9('0x7'));var config=require(_0x55a9('0x8'));var attributes=require(_0x55a9('0x9'));module[_0x55a9('0xa')]=function(_0x3ff359,_0x2b8884){return _0x3ff359[_0x55a9('0xb')](_0x55a9('0xc'),attributes,{'tableName':_0x55a9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x55a9('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4ac1b9,_0x53f71b,_0x36c54a){if(_0x4ac1b9[_0x55a9('0xf')](_0x55a9('0x10'))){_0x4ac1b9[_0x55a9('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x36c54a(null,_0x4ac1b9);}}});}; \ No newline at end of file +var _0x890b=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelInteraction','utf8mb4_unicode_ci','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x890b,0x168));var _0xb890=function(_0x297485,_0x222646){_0x297485=_0x297485-0x0;var _0x44c7d1=_0x890b[_0x297485];return _0x44c7d1;};'use strict';var _=require(_0xb890('0x0'));var util=require('util');var logger=require(_0xb890('0x1'))(_0xb890('0x2'));var moment=require(_0xb890('0x3'));var BPromise=require(_0xb890('0x4'));var rp=require(_0xb890('0x5'));var fs=require('fs');var path=require(_0xb890('0x6'));var rimraf=require(_0xb890('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xb890('0x8')]=function(_0x51d3a8,_0x28e19c){return _0x51d3a8[_0xb890('0x9')](_0xb890('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb890('0xb'),'hooks':{'beforeUpdate':function(_0x23a816,_0xab9e2b,_0x2a84ce){if(_0x23a816['changed'](_0xb890('0xc'))){_0x23a816['closedAt']=moment()[_0xb890('0xd')](_0xb890('0xe'));}_0x2a84ce(null,_0x23a816);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ecb8f70..f5751f4 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 _0x422d=['util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','stringify','lodash'];(function(_0x5cf8db,_0x25e73f){var _0x2223be=function(_0x70d7e8){while(--_0x70d7e8){_0x5cf8db['push'](_0x5cf8db['shift']());}};_0x2223be(++_0x25e73f);}(_0x422d,0x13f));var _0xd422=function(_0x83b7d2,_0x87fe8d){_0x83b7d2=_0x83b7d2-0x0;var _0x46f5a2=_0x422d[_0x83b7d2];return _0x46f5a2;};'use strict';var _=require(_0xd422('0x0'));var util=require(_0xd422('0x1'));var moment=require(_0xd422('0x2'));var BPromise=require(_0xd422('0x3'));var rs=require(_0xd422('0x4'));var fs=require('fs');var Redis=require(_0xd422('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd422('0x6'));var jayson=require(_0xd422('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xd422('0x8')]=_[_0xd422('0x9')](config[_0xd422('0x8')],{'host':_0xd422('0xa'),'port':0x18eb});var socket=require(_0xd422('0xb'))(new Redis(config[_0xd422('0x8')]));require(_0xd422('0xc'))['register'](socket);function respondWithRpcPromise(_0x1cc197,_0x1f46ed,_0x3b4c53){return new BPromise(function(_0x352da5,_0x24399b){return client[_0xd422('0xd')](_0x1cc197,_0x3b4c53)[_0xd422('0xe')](function(_0x2668e4){logger[_0xd422('0xf')](_0xd422('0x10'),_0x1f46ed,_0xd422('0x11'));logger[_0xd422('0x12')](_0xd422('0x13'),_0x1f46ed,_0xd422('0x11'),JSON['stringify'](_0x2668e4));if(_0x2668e4['error']){if(_0x2668e4['error'][_0xd422('0x14')]===0x1f4){logger[_0xd422('0x15')](_0xd422('0x10'),_0x1f46ed,_0x2668e4['error'][_0xd422('0x16')]);return _0x24399b(_0x2668e4['error'][_0xd422('0x16')]);}logger[_0xd422('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1f46ed,_0x2668e4[_0xd422('0x15')][_0xd422('0x16')]);return _0x352da5(_0x2668e4[_0xd422('0x15')][_0xd422('0x16')]);}else{logger[_0xd422('0xf')](_0xd422('0x10'),_0x1f46ed,'request\x20sent');_0x352da5(_0x2668e4[_0xd422('0x17')][_0xd422('0x16')]);}})[_0xd422('0x18')](function(_0x4abb13){logger['error'](_0xd422('0x10'),_0x1f46ed,_0x4abb13);_0x24399b(_0x4abb13);});});}exports[_0xd422('0x19')]=function(_0x4cf7fb){var _0x13f8bb=this;return new Promise(function(_0x31ee3a,_0x13eca5){return db[_0xd422('0x1a')]['update'](_0x4cf7fb[_0xd422('0x1b')],{'raw':_0x4cf7fb[_0xd422('0x1c')]?_0x4cf7fb[_0xd422('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf7fb[_0xd422('0x1c')]?_0x4cf7fb[_0xd422('0x1c')][_0xd422('0x1d')]||null:null,'attributes':_0x4cf7fb[_0xd422('0x1c')]?_0x4cf7fb[_0xd422('0x1c')][_0xd422('0x1e')]||null:null,'limit':_0x4cf7fb['options']?_0x4cf7fb[_0xd422('0x1c')][_0xd422('0x1f')]||null:null})[_0xd422('0xe')](function(_0x2b9b24){logger[_0xd422('0xf')](_0xd422('0x19'),_0x4cf7fb);logger[_0xd422('0x12')](_0xd422('0x19'),_0x4cf7fb,JSON['stringify'](_0x2b9b24));_0x31ee3a(_0x2b9b24);})[_0xd422('0x18')](function(_0x177c1f){logger['error']('UpdateOpenchannelInteraction',_0x177c1f[_0xd422('0x16')],_0x4cf7fb);_0x13eca5(_0x13f8bb[_0xd422('0x15')](0x1f4,_0x177c1f[_0xd422('0x16')]));});});};exports[_0xd422('0x20')]=function(_0x160fe8){return new Promise(function(_0xb52c48,_0x475cd8){return db[_0xd422('0x1a')][_0xd422('0x21')]({'where':_0x160fe8[_0xd422('0x1c')]?_0x160fe8[_0xd422('0x1c')][_0xd422('0x1d')]||null:null})[_0xd422('0xe')](function(_0xeb2560){if(_0xeb2560){return _0xeb2560[_0xd422('0x22')](_0x160fe8[_0xd422('0x1b')]['ids'],_[_0xd422('0x23')](_0x160fe8[_0xd422('0x1b')],[_0xd422('0x24'),'id'])||{});}})[_0xd422('0x25')](function(_0x51bb06){logger['info'](_0xd422('0x26'),_0x160fe8);logger[_0xd422('0x12')](_0xd422('0x26'),_0x160fe8,JSON[_0xd422('0x27')](_0x51bb06));_0xb52c48(_0x51bb06);})['catch'](function(_0x21ac87){logger[_0xd422('0x15')](_0xd422('0x26'),_0x21ac87[_0xd422('0x16')],_0x160fe8);_0x475cd8(_this[_0xd422('0x15')](0x1f4,_0x21ac87[_0xd422('0x16')]));});});}; \ No newline at end of file +var _0x5c97=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','limit','then','AddTagsToOpenchannelInteraction','find','body','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','localhost','./openchannelInteraction.socket','register'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x5c97,0x11b));var _0x75c9=function(_0x11731f,_0x2271b5){_0x11731f=_0x11731f-0x0;var _0x14587c=_0x5c97[_0x11731f];return _0x14587c;};'use strict';var _=require('lodash');var util=require(_0x75c9('0x0'));var moment=require(_0x75c9('0x1'));var BPromise=require(_0x75c9('0x2'));var rs=require(_0x75c9('0x3'));var fs=require('fs');var Redis=require(_0x75c9('0x4'));var db=require(_0x75c9('0x5'))['db'];var utils=require(_0x75c9('0x6'));var logger=require('../../config/logger')(_0x75c9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x75c9('0x8')]({'port':0x232a});config[_0x75c9('0x9')]=_['defaults'](config[_0x75c9('0x9')],{'host':_0x75c9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75c9('0x9')]));require(_0x75c9('0xb'))[_0x75c9('0xc')](socket);function respondWithRpcPromise(_0x1585b2,_0x429014,_0x425ebd){return new BPromise(function(_0x4f3a43,_0x3af249){return client['request'](_0x1585b2,_0x425ebd)['then'](function(_0x2be1f0){logger[_0x75c9('0xd')](_0x75c9('0xe'),_0x429014,_0x75c9('0xf'));logger[_0x75c9('0x10')](_0x75c9('0x11'),_0x429014,_0x75c9('0xf'),JSON[_0x75c9('0x12')](_0x2be1f0));if(_0x2be1f0[_0x75c9('0x13')]){if(_0x2be1f0[_0x75c9('0x13')][_0x75c9('0x14')]===0x1f4){logger['error'](_0x75c9('0xe'),_0x429014,_0x2be1f0[_0x75c9('0x13')][_0x75c9('0x15')]);return _0x3af249(_0x2be1f0['error'][_0x75c9('0x15')]);}logger['error'](_0x75c9('0xe'),_0x429014,_0x2be1f0[_0x75c9('0x13')]['message']);return _0x4f3a43(_0x2be1f0[_0x75c9('0x13')][_0x75c9('0x15')]);}else{logger[_0x75c9('0xd')]('OpenchannelInteraction,\x20%s,\x20%s',_0x429014,_0x75c9('0xf'));_0x4f3a43(_0x2be1f0['result']['message']);}})[_0x75c9('0x16')](function(_0x40b67a){logger['error'](_0x75c9('0xe'),_0x429014,_0x40b67a);_0x3af249(_0x40b67a);});});}exports[_0x75c9('0x17')]=function(_0x49749c){var _0x52fb85=this;return new Promise(function(_0x2c2d33,_0x3ecaa9){return db[_0x75c9('0x18')]['update'](_0x49749c['body'],{'raw':_0x49749c[_0x75c9('0x19')]?_0x49749c[_0x75c9('0x19')][_0x75c9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49749c[_0x75c9('0x19')]?_0x49749c[_0x75c9('0x19')][_0x75c9('0x1b')]||null:null,'attributes':_0x49749c[_0x75c9('0x19')]?_0x49749c['options']['attributes']||null:null,'limit':_0x49749c[_0x75c9('0x19')]?_0x49749c['options'][_0x75c9('0x1c')]||null:null})[_0x75c9('0x1d')](function(_0x483ecf){logger['info'](_0x75c9('0x17'),_0x49749c);logger['debug'](_0x75c9('0x17'),_0x49749c,JSON[_0x75c9('0x12')](_0x483ecf));_0x2c2d33(_0x483ecf);})[_0x75c9('0x16')](function(_0x4a2e5c){logger['error'](_0x75c9('0x17'),_0x4a2e5c[_0x75c9('0x15')],_0x49749c);_0x3ecaa9(_0x52fb85[_0x75c9('0x13')](0x1f4,_0x4a2e5c['message']));});});};exports[_0x75c9('0x1e')]=function(_0x516c58){return new Promise(function(_0x43208f,_0x1ecc8b){return db[_0x75c9('0x18')][_0x75c9('0x1f')]({'where':_0x516c58[_0x75c9('0x19')]?_0x516c58['options'][_0x75c9('0x1b')]||null:null})[_0x75c9('0x1d')](function(_0x54a9c2){if(_0x54a9c2){return _0x54a9c2['addTags'](_0x516c58[_0x75c9('0x20')]['ids'],_[_0x75c9('0x21')](_0x516c58[_0x75c9('0x20')],[_0x75c9('0x22'),'id'])||{});}})[_0x75c9('0x23')](function(_0x2c592b){logger[_0x75c9('0xd')](_0x75c9('0x24'),_0x516c58);logger['debug'](_0x75c9('0x24'),_0x516c58,JSON[_0x75c9('0x12')](_0x2c592b));_0x43208f(_0x2c592b);})[_0x75c9('0x16')](function(_0x5b8313){logger[_0x75c9('0x13')](_0x75c9('0x24'),_0x5b8313['message'],_0x516c58);_0x1ecc8b(_this[_0x75c9('0x13')](0x1f4,_0x5b8313[_0x75c9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 6b83b7c..c172414 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 _0x53e7=['register','openchannelInteraction:','./openchannelInteraction.events','update','removeListener'];(function(_0x12ed67,_0x1a5083){var _0x197263=function(_0x2cf3d5){while(--_0x2cf3d5){_0x12ed67['push'](_0x12ed67['shift']());}};_0x197263(++_0x1a5083);}(_0x53e7,0xc0));var _0x753e=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x53e7[_0x3bf925];return _0x2128a1;};'use strict';var OpenchannelInteractionEvents=require(_0x753e('0x0'));var events=['save','remove',_0x753e('0x1')];function createListener(_0x54a37e,_0x22af9e){return function(_0x1cc32f){_0x22af9e['emit'](_0x54a37e,_0x1cc32f);};}function removeListener(_0x341f66,_0xa43e11){return function(){OpenchannelInteractionEvents[_0x753e('0x2')](_0x341f66,_0xa43e11);};}exports[_0x753e('0x3')]=function(_0x4d1191){for(var _0x1666ac=0x0,_0xe1f381=events['length'];_0x1666ac<_0xe1f381;_0x1666ac++){var _0x28525e=events[_0x1666ac];var _0x202bfd=createListener(_0x753e('0x4')+_0x28525e,_0x4d1191);OpenchannelInteractionEvents['on'](_0x28525e,_0x202bfd);}}; \ No newline at end of file +var _0x34d4=['openchannelInteraction:','save','remove','update','removeListener'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x34d4,0x1d2));var _0x434d=function(_0x22618c,_0x11baec){_0x22618c=_0x22618c-0x0;var _0x13ad67=_0x34d4[_0x22618c];return _0x13ad67;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x434d('0x0'),_0x434d('0x1'),_0x434d('0x2')];function createListener(_0x4c3c4b,_0x44afae){return function(_0x4c6784){_0x44afae['emit'](_0x4c3c4b,_0x4c6784);};}function removeListener(_0x4f911f,_0x1d14d2){return function(){OpenchannelInteractionEvents[_0x434d('0x3')](_0x4f911f,_0x1d14d2);};}exports['register']=function(_0x105f13){for(var _0x2efe6c=0x0,_0x5534cc=events['length'];_0x2efe6c<_0x5534cc;_0x2efe6c++){var _0x10c4b3=events[_0x2efe6c];var _0x446fa0=createListener(_0x434d('0x4')+_0x10c4b3,_0x105f13);OpenchannelInteractionEvents['on'](_0x10c4b3,_0x446fa0);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a0f3f36..1205355 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x2577f2,_0x52a299){var _0x1b0666=function(_0x57b06c){while(--_0x57b06c){_0x2577f2['push'](_0x2577f2['shift']());}};_0x1b0666(++_0x52a299);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x33ec0b,_0x13ab74){var _0x411c05=function(_0x3f29eb){while(--_0x3f29eb){_0x33ec0b['push'](_0x33ec0b['shift']());}};_0x411c05(++_0x13ab74);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 58ef2b9..93f1b12 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 _0xdca3=['ENUM','out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0x3d7cb7,_0x4e2c89){var _0xed162a=function(_0x4b9a25){while(--_0x4b9a25){_0x3d7cb7['push'](_0x3d7cb7['shift']());}};_0xed162a(++_0x4e2c89);}(_0xdca3,0x64));var _0x3dca=function(_0x55d065,_0x51853a){_0x55d065=_0x55d065-0x0;var _0x2bce74=_0xdca3[_0x55d065];return _0x2bce74;};'use strict';var Sequelize=require(_0x3dca('0x0'));module['exports']={'body':{'type':Sequelize[_0x3dca('0x1')](_0x3dca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3dca('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3dca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3dca('0x4')]('in',_0x3dca('0x5')),'defaultValue':_0x3dca('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3dca('0x6')]},'providerName':{'type':Sequelize[_0x3dca('0x7')]},'providerResponse':{'type':Sequelize[_0x3dca('0x1')]}}; \ No newline at end of file +var _0x693f=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x460f8c,_0x308ee5){var _0x146540=function(_0x369304){while(--_0x369304){_0x460f8c['push'](_0x460f8c['shift']());}};_0x146540(++_0x308ee5);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xf693('0x0'));module[_0xf693('0x1')]={'body':{'type':Sequelize[_0xf693('0x2')](_0xf693('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf693('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf693('0x5')]('in',_0xf693('0x6')),'defaultValue':_0xf693('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf693('0x7')]},'providerName':{'type':Sequelize[_0xf693('0x8')]},'providerResponse':{'type':Sequelize[_0xf693('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c80861c..4e1969c 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 _0x72bb=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','body','../../config/logger','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','channel','motionChannel','accept','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','internal','SIP/%s','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','fieldName','type'];(function(_0x319807,_0x5ac442){var _0x270e1a=function(_0x592fc1){while(--_0x592fc1){_0x319807['push'](_0x319807['shift']());}};_0x270e1a(++_0x5ac442);}(_0x72bb,0x14a));var _0xb72b=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x72bb[_0x295314];return _0x584b0c;};'use strict';var emlformat=require(_0xb72b('0x0'));var rimraf=require(_0xb72b('0x1'));var zipdir=require(_0xb72b('0x2'));var jsonpatch=require(_0xb72b('0x3'));var rp=require(_0xb72b('0x4'));var moment=require(_0xb72b('0x5'));var BPromise=require(_0xb72b('0x6'));var Mustache=require(_0xb72b('0x7'));var util=require(_0xb72b('0x8'));var path=require(_0xb72b('0x9'));var sox=require(_0xb72b('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb72b('0xb'));var squel=require(_0xb72b('0xc'));var crypto=require(_0xb72b('0xd'));var jsforce=require(_0xb72b('0xe'));var deskjs=require(_0xb72b('0xf'));var toCsv=require(_0xb72b('0x10'));var querystring=require(_0xb72b('0x11'));var Papa=require(_0xb72b('0x12'));var Redis=require('ioredis');var authService=require(_0xb72b('0x13'));var qs=require(_0xb72b('0x14'));var as=require(_0xb72b('0x15'));var hardwareService=require(_0xb72b('0x16'));var logger=require('../../config/logger')(_0xb72b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb72b('0x18'))['db'];config[_0xb72b('0x19')]=_[_0xb72b('0x1a')](config[_0xb72b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb72b('0x1b'))(new Redis(config[_0xb72b('0x19')]));require('./openchannelMessage.socket')[_0xb72b('0x1c')](socket);var jayson=require(_0xb72b('0x1d'));var client=jayson[_0xb72b('0x1e')][_0xb72b('0x1f')]({'port':0x232c});var client9002=jayson[_0xb72b('0x1e')][_0xb72b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5dd10c,_0x1f993d,_0x292302,_0x1bf788){return new BPromise(function(_0x53c05d,_0x2e83d6){var _0x1e8e5f=_0x1bf788||client;return _0x1e8e5f[_0xb72b('0x20')](_0x5dd10c,_0x292302)['then'](function(_0x25f3d9){logger[_0xb72b('0x21')](_0xb72b('0x22'),_0x1f993d,_0xb72b('0x23'));logger['debug'](_0xb72b('0x24'),_0x1f993d,_0xb72b('0x23'),JSON[_0xb72b('0x25')](_0x25f3d9));if(_0x25f3d9[_0xb72b('0x26')]){if(_0x25f3d9[_0xb72b('0x26')][_0xb72b('0x27')]===0x1f4){logger['error'](_0xb72b('0x22'),_0x1f993d,_0x25f3d9[_0xb72b('0x26')]['message']);return _0x2e83d6(_0x25f3d9[_0xb72b('0x26')][_0xb72b('0x28')]);}logger[_0xb72b('0x26')](_0xb72b('0x22'),_0x1f993d,_0x25f3d9[_0xb72b('0x26')][_0xb72b('0x28')]);return _0x53c05d(_0x25f3d9['error'][_0xb72b('0x28')]);}else{logger[_0xb72b('0x21')](_0xb72b('0x22'),_0x1f993d,'request\x20sent');_0x53c05d(_0x25f3d9['result'][_0xb72b('0x28')]);}})[_0xb72b('0x29')](function(_0x43bff9){logger[_0xb72b('0x26')](_0xb72b('0x22'),_0x1f993d,_0x43bff9);_0x2e83d6(_0x43bff9);});});}function respondWithStatusCode(_0x266d54,_0x44f07d){_0x44f07d=_0x44f07d||0xcc;return function(_0x4357a5){if(_0x4357a5){return _0x266d54['sendStatus'](_0x44f07d);}return _0x266d54[_0xb72b('0x2a')](_0x44f07d)[_0xb72b('0x2b')]();};}function respondWithResult(_0x1096f3,_0x4e1cd8){_0x4e1cd8=_0x4e1cd8||0xc8;return function(_0x565380){if(_0x565380){return _0x1096f3[_0xb72b('0x2a')](_0x4e1cd8)[_0xb72b('0x2c')](_0x565380);}};}function respondWithFilteredResult(_0x5c190b,_0x2efe60){return function(_0x747961){if(_0x747961){var _0x1160b9=typeof _0x2efe60[_0xb72b('0x2d')]===_0xb72b('0x2e')&&typeof _0x2efe60['limit']===_0xb72b('0x2e');var _0x5ead94=_0x747961[_0xb72b('0x2f')];var _0x18f6bc=_0x1160b9?0x0:_0x2efe60[_0xb72b('0x2d')];var _0x35ad94=_0x1160b9?_0x747961[_0xb72b('0x2f')]:_0x2efe60[_0xb72b('0x2d')]+_0x2efe60[_0xb72b('0x30')];var _0x45f185;if(_0x35ad94>=_0x5ead94){_0x35ad94=_0x5ead94;_0x45f185=0xc8;}else{_0x45f185=0xce;}_0x5c190b[_0xb72b('0x2a')](_0x45f185);return _0x5c190b[_0xb72b('0x31')](_0xb72b('0x32'),_0x18f6bc+'-'+_0x35ad94+'/'+_0x5ead94)[_0xb72b('0x2c')](_0x747961);}return null;};}function patchUpdates(_0x39f399){return function(_0x5c1b55){try{jsonpatch['apply'](_0x5c1b55,_0x39f399,!![]);}catch(_0x5e1f85){return BPromise['reject'](_0x5e1f85);}return _0x5c1b55['save']();};}function saveUpdates(_0x516a05,_0x4c7a77){return function(_0x250b64){if(_0x250b64){return _0x250b64[_0xb72b('0x33')](_0x516a05)[_0xb72b('0x34')](function(_0x2d7393){return _0x2d7393;});}return null;};}function removeEntity(_0x3c615d,_0x5d9dc0){return function(_0x55802b){if(_0x55802b){return _0x55802b[_0xb72b('0x35')]()[_0xb72b('0x34')](function(){_0x3c615d[_0xb72b('0x2a')](0xcc)[_0xb72b('0x2b')]();});}};}function handleEntityNotFound(_0x48b202,_0x1ffc4b){return function(_0x231058){if(!_0x231058){_0x48b202[_0xb72b('0x36')](0x194);}return _0x231058;};}function handleError(_0x402a2d,_0xd508cb){_0xd508cb=_0xd508cb||0x1f4;return function(_0x2f2ec2){logger[_0xb72b('0x26')](_0x2f2ec2[_0xb72b('0x37')]);if(_0x2f2ec2[_0xb72b('0x38')]){delete _0x2f2ec2[_0xb72b('0x38')];}_0x402a2d[_0xb72b('0x2a')](_0xd508cb)[_0xb72b('0x39')](_0x2f2ec2);};}exports[_0xb72b('0x3a')]=function(_0x31cc45,_0x1fbf98){var _0x5a461d={},_0x508381={},_0x6177d6={'count':0x0,'rows':[]};var _0x46ef09=_[_0xb72b('0x3b')](db[_0xb72b('0x3c')]['rawAttributes'],function(_0xd7729){return{'name':_0xd7729[_0xb72b('0x3d')],'type':_0xd7729[_0xb72b('0x3e')]['key']};});_0x508381[_0xb72b('0x3f')]=_['map'](_0x46ef09,'name');_0x508381[_0xb72b('0x40')]=_[_0xb72b('0x41')](_0x31cc45['query']);_0x508381[_0xb72b('0x42')]=_[_0xb72b('0x43')](_0x508381[_0xb72b('0x3f')],_0x508381[_0xb72b('0x40')]);_0x5a461d[_0xb72b('0x44')]=_['intersection'](_0x508381[_0xb72b('0x3f')],qs[_0xb72b('0x45')](_0x31cc45['query']['fields']));_0x5a461d[_0xb72b('0x44')]=_0x5a461d[_0xb72b('0x44')][_0xb72b('0x46')]?_0x5a461d[_0xb72b('0x44')]:_0x508381[_0xb72b('0x3f')];if(!_0x31cc45[_0xb72b('0x40')][_0xb72b('0x47')](_0xb72b('0x48'))){_0x5a461d['limit']=qs[_0xb72b('0x30')](_0x31cc45['query']['limit']);_0x5a461d[_0xb72b('0x2d')]=qs[_0xb72b('0x2d')](_0x31cc45[_0xb72b('0x40')][_0xb72b('0x2d')]);}_0x5a461d['order']=qs[_0xb72b('0x49')](_0x31cc45[_0xb72b('0x40')][_0xb72b('0x49')]);_0x5a461d[_0xb72b('0x4a')]=qs[_0xb72b('0x42')](_['pick'](_0x31cc45[_0xb72b('0x40')],_0x508381[_0xb72b('0x42')]),_0x46ef09);if(_0x31cc45[_0xb72b('0x40')][_0xb72b('0x4b')]){_0x5a461d[_0xb72b('0x4a')]=_[_0xb72b('0x4c')](_0x5a461d[_0xb72b('0x4a')],{'$or':_['map'](_0x46ef09,function(_0x3fa5fc){if(_0x3fa5fc[_0xb72b('0x3e')]!==_0xb72b('0x4d')){var _0x557f51={};_0x557f51[_0x3fa5fc[_0xb72b('0x38')]]={'$like':'%'+_0x31cc45[_0xb72b('0x40')][_0xb72b('0x4b')]+'%'};return _0x557f51;}})});}_0x5a461d=_[_0xb72b('0x4c')]({},_0x5a461d,_0x31cc45['options']);var _0x127f79={'where':_0x5a461d['where']};return db['OpenchannelMessage'][_0xb72b('0x2f')](_0x127f79)[_0xb72b('0x34')](function(_0x589181){_0x6177d6['count']=_0x589181;if(_0x31cc45[_0xb72b('0x40')][_0xb72b('0x4e')]){_0x5a461d['include']=[{'all':!![]}];}return db[_0xb72b('0x3c')][_0xb72b('0x4f')](_0x5a461d);})[_0xb72b('0x34')](function(_0x3034de){_0x6177d6[_0xb72b('0x50')]=_0x3034de;return _0x6177d6;})[_0xb72b('0x34')](respondWithFilteredResult(_0x1fbf98,_0x5a461d))[_0xb72b('0x29')](handleError(_0x1fbf98,null));};exports[_0xb72b('0x51')]=function(_0x919ea8,_0x53381e){var _0x16301a={'raw':!![],'where':{'id':_0x919ea8[_0xb72b('0x52')]['id']}},_0x2319d1={};_0x2319d1['model']=_['keys'](db[_0xb72b('0x3c')][_0xb72b('0x53')]);_0x2319d1[_0xb72b('0x40')]=_[_0xb72b('0x41')](_0x919ea8[_0xb72b('0x40')]);_0x2319d1[_0xb72b('0x42')]=_[_0xb72b('0x43')](_0x2319d1[_0xb72b('0x3f')],_0x2319d1[_0xb72b('0x40')]);_0x16301a[_0xb72b('0x44')]=_['intersection'](_0x2319d1[_0xb72b('0x3f')],qs[_0xb72b('0x45')](_0x919ea8['query'][_0xb72b('0x45')]));_0x16301a['attributes']=_0x16301a[_0xb72b('0x44')][_0xb72b('0x46')]?_0x16301a[_0xb72b('0x44')]:_0x2319d1[_0xb72b('0x3f')];if(_0x919ea8[_0xb72b('0x40')]['includeAll']){_0x16301a[_0xb72b('0x54')]=[{'all':!![]}];}_0x16301a=_['merge']({},_0x16301a,_0x919ea8[_0xb72b('0x55')]);return db[_0xb72b('0x3c')][_0xb72b('0x56')](_0x16301a)[_0xb72b('0x34')](handleEntityNotFound(_0x53381e,null))['then'](respondWithResult(_0x53381e,null))['catch'](handleError(_0x53381e,null));};exports['create']=function(_0x45052d,_0x2bc479){return db[_0xb72b('0x3c')]['create'](_0x45052d[_0xb72b('0x57')],{})[_0xb72b('0x34')](respondWithResult(_0x2bc479,0xc9))[_0xb72b('0x29')](handleError(_0x2bc479,null));};exports['update']=function(_0x3482bf,_0x46b3c6){if(_0x3482bf[_0xb72b('0x57')]['id']){delete _0x3482bf['body']['id'];}return db[_0xb72b('0x3c')][_0xb72b('0x56')]({'where':{'id':_0x3482bf[_0xb72b('0x52')]['id']}})[_0xb72b('0x34')](handleEntityNotFound(_0x46b3c6,null))[_0xb72b('0x34')](saveUpdates(_0x3482bf[_0xb72b('0x57')],null))[_0xb72b('0x34')](respondWithResult(_0x46b3c6,null))[_0xb72b('0x29')](handleError(_0x46b3c6,null));};exports[_0xb72b('0x35')]=function(_0x24380f,_0x5d0d10){return db[_0xb72b('0x3c')][_0xb72b('0x56')]({'where':{'id':_0x24380f[_0xb72b('0x52')]['id']}})[_0xb72b('0x34')](handleEntityNotFound(_0x5d0d10,null))[_0xb72b('0x34')](removeEntity(_0x5d0d10,null))[_0xb72b('0x29')](handleError(_0x5d0d10,null));};exports['describe']=function(_0x59522f,_0x4a640c){return db[_0xb72b('0x3c')]['describe']()[_0xb72b('0x34')](respondWithResult(_0x4a640c,null))[_0xb72b('0x29')](handleError(_0x4a640c,null));};var interaction_log=require(_0xb72b('0x58'))(_0xb72b('0x59'));exports['accept']=function(_0x1b46d9,_0x5d6e68,_0x58d83b){var _0x151e32={'agent':{},'channel':_0xb72b('0x5a')};if(_0x1b46d9[_0xb72b('0x57')]['id']){delete _0x1b46d9[_0xb72b('0x57')]['id'];}_0x1b46d9['body'][_0xb72b('0x5b')]=!![];_0x1b46d9[_0xb72b('0x57')][_0xb72b('0x5c')]=moment()[_0xb72b('0x5d')](_0xb72b('0x5e'));_0x1b46d9[_0xb72b('0x57')][_0xb72b('0x5f')]=_0x1b46d9[_0xb72b('0x57')][_0xb72b('0x5f')]||_0x1b46d9[_0xb72b('0x60')]['id'];_0x151e32[_0xb72b('0x61')]['id']=_0x1b46d9[_0xb72b('0x57')][_0xb72b('0x5f')];return db['OpenchannelMessage'][_0xb72b('0x56')]({'where':{'id':_0x1b46d9[_0xb72b('0x52')]['id'],'UserId':null}})[_0xb72b('0x34')](handleEntityNotFound(_0x5d6e68,null))[_0xb72b('0x34')](saveUpdates(_0x1b46d9[_0xb72b('0x57')],null))[_0xb72b('0x34')](function(_0x16340a){if(_0x16340a){_0x151e32[_0xb72b('0x28')]=_0x16340a[_0xb72b('0x62')]({'plain':!![]});return db[_0xb72b('0x63')]['find']({'where':{'id':_0x16340a[_0xb72b('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x5d6e68,null))[_0xb72b('0x34')](function(_0x1d84fc){if(_0x1d84fc){return _0x1d84fc['update']({'UserId':_0x1b46d9[_0xb72b('0x57')][_0xb72b('0x5f')],'read1stAt':_[_0xb72b('0x65')](_0x1d84fc[_0xb72b('0x66')])?moment()['format'](_0xb72b('0x5e')):undefined});}return null;})[_0xb72b('0x34')](function(_0x27ef2f){if(_0x27ef2f){_0x151e32[_0xb72b('0x67')]=_0x27ef2f[_0xb72b('0x62')]({'plain':!![]});interaction_log[_0xb72b('0x21')](_0xb72b('0x68'),_0x1b46d9[_0xb72b('0x60')]['id'],_0x1b46d9[_0xb72b('0x60')][_0xb72b('0x38')],_0x1b46d9['user'][_0xb72b('0x69')],_0x151e32['interaction']['id'],_0x1b46d9[_0xb72b('0x57')]?JSON[_0xb72b('0x25')](_0x1b46d9[_0xb72b('0x57')]):_0xb72b('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x151e32);}return null;})[_0xb72b('0x34')](function(_0x3b0ea9){var _0x3b1574=_0xb72b('0x6b')+_0x3b0ea9[_0xb72b('0x28')][_0xb72b('0x6c')];return db[_0xb72b('0x6d')][_0xb72b('0x40')](_0x3b1574,{'type':db[_0xb72b('0x6e')][_0xb72b('0x6f')][_0xb72b('0x70')],'raw':!![]})['then'](function(_0x1bbed4){return _0x1bbed4;});})[_0xb72b('0x34')](function(_0xbe3bbd){if(_0xbe3bbd){_0x151e32[_0xb72b('0x28')]['contact']=_0xbe3bbd[0x0];if(!_0x1b46d9['body'][_0xb72b('0x5f')])return;return db[_0xb72b('0x71')][_0xb72b('0x56')]({'where':{'id':_0x1b46d9[_0xb72b('0x57')]['UserId'],'role':_0xb72b('0x61')},'attributes':['id',_0xb72b('0x38'),_0xb72b('0x72'),_0xb72b('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3a8bd3){if(!_0x3a8bd3)return null;_0x151e32['message']['agent']=_0x3a8bd3;return _0x151e32;})[_0xb72b('0x34')](function(_0x51f2d6){if(_0x51f2d6){if(_0x1b46d9[_0xb72b('0x57')][_0xb72b('0x74')]){_0x151e32['message'][_0xb72b('0x75')]=util[_0xb72b('0x5d')]('SIP/%s',_0x1b46d9['user'][_0xb72b('0x38')]);_0x151e32[_0xb72b('0x28')][_0xb72b('0x76')]=_0x151e32[_0xb72b('0x76')];_0x151e32[_0xb72b('0x28')][_0xb72b('0x77')]=_0x151e32[_0xb72b('0x76')];_0x151e32[_0xb72b('0x28')]['event']=_0xb72b('0x78');return respondWithRpcPromise('EventManager',_0xb72b('0x79'),{'event':_0xb72b('0x7a'),'message':_0x151e32[_0xb72b('0x28')]},client9002)[_0xb72b('0x34')](function(){return _0x151e32;});}return _0x151e32;}return null;})[_0xb72b('0x34')](respondWithResult(_0x5d6e68,null))[_0xb72b('0x29')](handleError(_0x5d6e68,null));};var interaction_log=require(_0xb72b('0x58'))(_0xb72b('0x59'));exports[_0xb72b('0x7b')]=function(_0x557a47,_0x3d4bc7,_0x1a466e){var _0x1c2bd9={'agent':{},'channel':_0xb72b('0x5a')};if(_0x557a47[_0xb72b('0x57')]['id']){delete _0x557a47[_0xb72b('0x57')]['id'];}_0x557a47['body'][_0xb72b('0x5f')]=_0x557a47[_0xb72b('0x57')][_0xb72b('0x5f')]||_0x557a47[_0xb72b('0x60')]['id'];_0x1c2bd9[_0xb72b('0x61')]['id']=_0x557a47[_0xb72b('0x57')][_0xb72b('0x5f')];return db[_0xb72b('0x3c')][_0xb72b('0x56')]({'where':{'id':_0x557a47[_0xb72b('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d4bc7,null))['then'](function(_0x2d43f5){if(_0x2d43f5){_0x1c2bd9['message']=_0x2d43f5['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x2d43f5['OpenchannelInteractionId']}});}return null;})[_0xb72b('0x34')](handleEntityNotFound(_0x3d4bc7,null))[_0xb72b('0x34')](function(_0x2d05ce){if(_0x2d05ce){_0x1c2bd9[_0xb72b('0x67')]=_0x2d05ce['get']({'plain':!![]});interaction_log[_0xb72b('0x21')](_0xb72b('0x7c'),_0x557a47[_0xb72b('0x60')]['id'],_0x557a47[_0xb72b('0x60')][_0xb72b('0x38')],_0x557a47[_0xb72b('0x60')]['role'],_0x1c2bd9[_0xb72b('0x67')]['id'],_0x557a47['body']?JSON[_0xb72b('0x25')](_0x557a47['body']):_0xb72b('0x6a'));return respondWithRpcPromise(_0xb72b('0x7d'),_0xb72b('0x7e'),_0x1c2bd9);}return null;})['then'](function(_0x1814f8){var _0x40a3b2=_0xb72b('0x6b')+_0x1814f8[_0xb72b('0x28')][_0xb72b('0x6c')];return db[_0xb72b('0x6d')]['query'](_0x40a3b2,{'type':db[_0xb72b('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb72b('0x34')](function(_0x1f8f6d){return _0x1f8f6d;});})['then'](function(_0x228199){if(_0x228199){_0x1c2bd9[_0xb72b('0x28')][_0xb72b('0x7f')]=_0x228199[0x0];if(!_0x557a47[_0xb72b('0x57')]['UserId'])return;return db[_0xb72b('0x71')]['find']({'where':{'id':_0x557a47[_0xb72b('0x57')][_0xb72b('0x5f')],'role':_0xb72b('0x61')},'attributes':['id',_0xb72b('0x38'),'fullname','email',_0xb72b('0x80')],'raw':!![]});}return null;})[_0xb72b('0x34')](function(_0x200897){if(!_0x200897)return null;_0x1c2bd9[_0xb72b('0x28')]['agent']=_0x200897;return _0x1c2bd9;})['then'](function(_0x5a7c2d){if(_0x5a7c2d){_0x5a7c2d['message'][_0xb72b('0x75')]=util[_0xb72b('0x5d')](_0xb72b('0x81'),_0x557a47[_0xb72b('0x60')][_0xb72b('0x38')]);_0x5a7c2d['message'][_0xb72b('0x76')]=_0x1c2bd9[_0xb72b('0x76')];_0x5a7c2d[_0xb72b('0x28')]['motionChannel']=_0x1c2bd9[_0xb72b('0x76')];_0x5a7c2d[_0xb72b('0x28')][_0xb72b('0x82')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x5a7c2d['message']},client9002);return _0x1c2bd9;}return null;})[_0xb72b('0x34')](respondWithResult(_0x3d4bc7,null))[_0xb72b('0x29')](handleError(_0x3d4bc7,null));}; \ No newline at end of file +var _0x51ba=['filters','model','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','intersection','fields','create','body','find','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','interface','SIP/%s','channel','EventManager','acceptmessage','openchannel-interactions','openchannel','OpenchannelInteractionId','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','internal','motionChannel','event','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51ba,0xc1));var _0xa51b=function(_0x10c864,_0x30f475){_0x10c864=_0x10c864-0x0;var _0x4eed47=_0x51ba[_0x10c864];return _0x4eed47;};'use strict';var emlformat=require(_0xa51b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa51b('0x1'));var jsonpatch=require(_0xa51b('0x2'));var rp=require('request-promise');var moment=require(_0xa51b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa51b('0x4'));var util=require('util');var path=require(_0xa51b('0x5'));var sox=require(_0xa51b('0x6'));var csv=require('to-csv');var ejs=require(_0xa51b('0x7'));var fs=require('fs');var fs_extra=require(_0xa51b('0x8'));var _=require('lodash');var squel=require(_0xa51b('0x9'));var crypto=require(_0xa51b('0xa'));var jsforce=require(_0xa51b('0xb'));var deskjs=require(_0xa51b('0xc'));var toCsv=require(_0xa51b('0xd'));var querystring=require(_0xa51b('0xe'));var Papa=require(_0xa51b('0xf'));var Redis=require('ioredis');var authService=require(_0xa51b('0x10'));var qs=require(_0xa51b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa51b('0x12'));var logger=require(_0xa51b('0x13'))('api');var utils=require(_0xa51b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa51b('0x15'));var db=require(_0xa51b('0x16'))['db'];config[_0xa51b('0x17')]=_[_0xa51b('0x18')](config[_0xa51b('0x17')],{'host':_0xa51b('0x19'),'port':0x18eb});var socket=require(_0xa51b('0x1a'))(new Redis(config['redis']));require(_0xa51b('0x1b'))[_0xa51b('0x1c')](socket);var jayson=require(_0xa51b('0x1d'));var client=jayson['client'][_0xa51b('0x1e')]({'port':0x232c});var client9002=jayson[_0xa51b('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20055d,_0x17c1ef,_0x1c8a7b,_0x56fa10){return new BPromise(function(_0x4c567c,_0x4de478){var _0x1f6d91=_0x56fa10||client;return _0x1f6d91['request'](_0x20055d,_0x1c8a7b)[_0xa51b('0x20')](function(_0x2d0e3e){logger['info'](_0xa51b('0x21'),_0x17c1ef,_0xa51b('0x22'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x17c1ef,_0xa51b('0x22'),JSON[_0xa51b('0x23')](_0x2d0e3e));if(_0x2d0e3e['error']){if(_0x2d0e3e[_0xa51b('0x24')][_0xa51b('0x25')]===0x1f4){logger[_0xa51b('0x24')](_0xa51b('0x21'),_0x17c1ef,_0x2d0e3e['error'][_0xa51b('0x26')]);return _0x4de478(_0x2d0e3e[_0xa51b('0x24')]['message']);}logger[_0xa51b('0x24')](_0xa51b('0x21'),_0x17c1ef,_0x2d0e3e[_0xa51b('0x24')][_0xa51b('0x26')]);return _0x4c567c(_0x2d0e3e['error'][_0xa51b('0x26')]);}else{logger[_0xa51b('0x27')](_0xa51b('0x21'),_0x17c1ef,'request\x20sent');_0x4c567c(_0x2d0e3e[_0xa51b('0x28')][_0xa51b('0x26')]);}})[_0xa51b('0x29')](function(_0x3472ab){logger[_0xa51b('0x24')](_0xa51b('0x21'),_0x17c1ef,_0x3472ab);_0x4de478(_0x3472ab);});});}function respondWithStatusCode(_0x11f97c,_0x5d272b){_0x5d272b=_0x5d272b||0xcc;return function(_0x1ff9b8){if(_0x1ff9b8){return _0x11f97c[_0xa51b('0x2a')](_0x5d272b);}return _0x11f97c['status'](_0x5d272b)[_0xa51b('0x2b')]();};}function respondWithResult(_0x22ba42,_0x14a565){_0x14a565=_0x14a565||0xc8;return function(_0x1a0d19){if(_0x1a0d19){return _0x22ba42[_0xa51b('0x2c')](_0x14a565)[_0xa51b('0x2d')](_0x1a0d19);}};}function respondWithFilteredResult(_0x5887b1,_0x53aac0){return function(_0x1d5acc){if(_0x1d5acc){var _0x25a166=typeof _0x53aac0['offset']===_0xa51b('0x2e')&&typeof _0x53aac0[_0xa51b('0x2f')]===_0xa51b('0x2e');var _0x959714=_0x1d5acc[_0xa51b('0x30')];var _0x45b287=_0x25a166?0x0:_0x53aac0[_0xa51b('0x31')];var _0x5b75c1=_0x25a166?_0x1d5acc[_0xa51b('0x30')]:_0x53aac0[_0xa51b('0x31')]+_0x53aac0['limit'];var _0x411b20;if(_0x5b75c1>=_0x959714){_0x5b75c1=_0x959714;_0x411b20=0xc8;}else{_0x411b20=0xce;}_0x5887b1[_0xa51b('0x2c')](_0x411b20);return _0x5887b1['set'](_0xa51b('0x32'),_0x45b287+'-'+_0x5b75c1+'/'+_0x959714)['json'](_0x1d5acc);}return null;};}function patchUpdates(_0x3f3169){return function(_0xe149d){try{jsonpatch[_0xa51b('0x33')](_0xe149d,_0x3f3169,!![]);}catch(_0x2392b1){return BPromise[_0xa51b('0x34')](_0x2392b1);}return _0xe149d[_0xa51b('0x35')]();};}function saveUpdates(_0x524e89,_0x5e2e25){return function(_0x4fc455){if(_0x4fc455){return _0x4fc455[_0xa51b('0x36')](_0x524e89)[_0xa51b('0x20')](function(_0x1619e1){return _0x1619e1;});}return null;};}function removeEntity(_0x173999,_0x457027){return function(_0x2777ae){if(_0x2777ae){return _0x2777ae[_0xa51b('0x37')]()[_0xa51b('0x20')](function(){_0x173999[_0xa51b('0x2c')](0xcc)[_0xa51b('0x2b')]();});}};}function handleEntityNotFound(_0x18151f,_0x58aa86){return function(_0x4d3d8b){if(!_0x4d3d8b){_0x18151f['sendStatus'](0x194);}return _0x4d3d8b;};}function handleError(_0x5d88ab,_0x1fbd89){_0x1fbd89=_0x1fbd89||0x1f4;return function(_0x4b61f3){logger[_0xa51b('0x24')](_0x4b61f3[_0xa51b('0x38')]);if(_0x4b61f3[_0xa51b('0x39')]){delete _0x4b61f3[_0xa51b('0x39')];}_0x5d88ab[_0xa51b('0x2c')](_0x1fbd89)[_0xa51b('0x3a')](_0x4b61f3);};}exports[_0xa51b('0x3b')]=function(_0x2f2fac,_0x30e518){var _0x5aa802={},_0x50bc5e={},_0x35f663={'count':0x0,'rows':[]};var _0x577db2=_['map'](db[_0xa51b('0x3c')][_0xa51b('0x3d')],function(_0x4f5cc3){return{'name':_0x4f5cc3[_0xa51b('0x3e')],'type':_0x4f5cc3[_0xa51b('0x3f')][_0xa51b('0x40')]};});_0x50bc5e['model']=_['map'](_0x577db2,_0xa51b('0x39'));_0x50bc5e[_0xa51b('0x41')]=_[_0xa51b('0x42')](_0x2f2fac[_0xa51b('0x41')]);_0x50bc5e[_0xa51b('0x43')]=_['intersection'](_0x50bc5e[_0xa51b('0x44')],_0x50bc5e['query']);_0x5aa802['attributes']=_['intersection'](_0x50bc5e[_0xa51b('0x44')],qs['fields'](_0x2f2fac[_0xa51b('0x41')]['fields']));_0x5aa802[_0xa51b('0x45')]=_0x5aa802[_0xa51b('0x45')][_0xa51b('0x46')]?_0x5aa802[_0xa51b('0x45')]:_0x50bc5e[_0xa51b('0x44')];if(!_0x2f2fac['query'][_0xa51b('0x47')]('nolimit')){_0x5aa802[_0xa51b('0x2f')]=qs[_0xa51b('0x2f')](_0x2f2fac[_0xa51b('0x41')][_0xa51b('0x2f')]);_0x5aa802[_0xa51b('0x31')]=qs[_0xa51b('0x31')](_0x2f2fac[_0xa51b('0x41')][_0xa51b('0x31')]);}_0x5aa802[_0xa51b('0x48')]=qs[_0xa51b('0x49')](_0x2f2fac['query'][_0xa51b('0x49')]);_0x5aa802[_0xa51b('0x4a')]=qs[_0xa51b('0x43')](_[_0xa51b('0x4b')](_0x2f2fac['query'],_0x50bc5e[_0xa51b('0x43')]),_0x577db2);if(_0x2f2fac[_0xa51b('0x41')]['filter']){_0x5aa802[_0xa51b('0x4a')]=_[_0xa51b('0x4c')](_0x5aa802['where'],{'$or':_[_0xa51b('0x4d')](_0x577db2,function(_0x1b7d58){if(_0x1b7d58[_0xa51b('0x3f')]!==_0xa51b('0x4e')){var _0x375a2d={};_0x375a2d[_0x1b7d58['name']]={'$like':'%'+_0x2f2fac['query'][_0xa51b('0x4f')]+'%'};return _0x375a2d;}})});}_0x5aa802=_[_0xa51b('0x4c')]({},_0x5aa802,_0x2f2fac[_0xa51b('0x50')]);var _0x563aca={'where':_0x5aa802[_0xa51b('0x4a')]};return db[_0xa51b('0x3c')]['count'](_0x563aca)['then'](function(_0x1e4e3e){_0x35f663[_0xa51b('0x30')]=_0x1e4e3e;if(_0x2f2fac[_0xa51b('0x41')][_0xa51b('0x51')]){_0x5aa802[_0xa51b('0x52')]=[{'all':!![]}];}return db[_0xa51b('0x3c')][_0xa51b('0x53')](_0x5aa802);})[_0xa51b('0x20')](function(_0x98107d){_0x35f663[_0xa51b('0x54')]=_0x98107d;return _0x35f663;})[_0xa51b('0x20')](respondWithFilteredResult(_0x30e518,_0x5aa802))['catch'](handleError(_0x30e518,null));};exports[_0xa51b('0x55')]=function(_0x44fb09,_0x565445){var _0x22ba13={'raw':!![],'where':{'id':_0x44fb09[_0xa51b('0x56')]['id']}},_0x312140={};_0x312140[_0xa51b('0x44')]=_['keys'](db[_0xa51b('0x3c')][_0xa51b('0x3d')]);_0x312140['query']=_[_0xa51b('0x42')](_0x44fb09[_0xa51b('0x41')]);_0x312140[_0xa51b('0x43')]=_[_0xa51b('0x57')](_0x312140[_0xa51b('0x44')],_0x312140['query']);_0x22ba13[_0xa51b('0x45')]=_[_0xa51b('0x57')](_0x312140['model'],qs[_0xa51b('0x58')](_0x44fb09[_0xa51b('0x41')]['fields']));_0x22ba13[_0xa51b('0x45')]=_0x22ba13[_0xa51b('0x45')][_0xa51b('0x46')]?_0x22ba13['attributes']:_0x312140[_0xa51b('0x44')];if(_0x44fb09[_0xa51b('0x41')][_0xa51b('0x51')]){_0x22ba13[_0xa51b('0x52')]=[{'all':!![]}];}_0x22ba13=_['merge']({},_0x22ba13,_0x44fb09[_0xa51b('0x50')]);return db['OpenchannelMessage']['find'](_0x22ba13)[_0xa51b('0x20')](handleEntityNotFound(_0x565445,null))[_0xa51b('0x20')](respondWithResult(_0x565445,null))['catch'](handleError(_0x565445,null));};exports[_0xa51b('0x59')]=function(_0x398881,_0x39484e){return db[_0xa51b('0x3c')][_0xa51b('0x59')](_0x398881[_0xa51b('0x5a')],{})[_0xa51b('0x20')](respondWithResult(_0x39484e,0xc9))[_0xa51b('0x29')](handleError(_0x39484e,null));};exports[_0xa51b('0x36')]=function(_0x25490b,_0x50c52e){if(_0x25490b[_0xa51b('0x5a')]['id']){delete _0x25490b['body']['id'];}return db[_0xa51b('0x3c')][_0xa51b('0x5b')]({'where':{'id':_0x25490b[_0xa51b('0x56')]['id']}})['then'](handleEntityNotFound(_0x50c52e,null))['then'](saveUpdates(_0x25490b['body'],null))[_0xa51b('0x20')](respondWithResult(_0x50c52e,null))[_0xa51b('0x29')](handleError(_0x50c52e,null));};exports[_0xa51b('0x37')]=function(_0xfe9133,_0x1325d7){return db[_0xa51b('0x3c')][_0xa51b('0x5b')]({'where':{'id':_0xfe9133[_0xa51b('0x56')]['id']}})[_0xa51b('0x20')](handleEntityNotFound(_0x1325d7,null))[_0xa51b('0x20')](removeEntity(_0x1325d7,null))[_0xa51b('0x29')](handleError(_0x1325d7,null));};exports[_0xa51b('0x5c')]=function(_0x385e30,_0xe749d4){return db[_0xa51b('0x3c')][_0xa51b('0x5c')]()['then'](respondWithResult(_0xe749d4,null))[_0xa51b('0x29')](handleError(_0xe749d4,null));};var interaction_log=require(_0xa51b('0x13'))('openchannel-interactions');exports[_0xa51b('0x5d')]=function(_0x42990f,_0x6572b,_0x4796d4){var _0x5ed8b2={'agent':{},'channel':'openchannel'};if(_0x42990f['body']['id']){delete _0x42990f['body']['id'];}_0x42990f[_0xa51b('0x5a')][_0xa51b('0x5e')]=!![];_0x42990f['body']['readAt']=moment()[_0xa51b('0x5f')](_0xa51b('0x60'));_0x42990f[_0xa51b('0x5a')][_0xa51b('0x61')]=_0x42990f[_0xa51b('0x5a')][_0xa51b('0x61')]||_0x42990f['user']['id'];_0x5ed8b2[_0xa51b('0x62')]['id']=_0x42990f['body'][_0xa51b('0x61')];return db[_0xa51b('0x3c')][_0xa51b('0x5b')]({'where':{'id':_0x42990f[_0xa51b('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6572b,null))['then'](saveUpdates(_0x42990f[_0xa51b('0x5a')],null))['then'](function(_0x4beb7a){if(_0x4beb7a){_0x5ed8b2[_0xa51b('0x26')]=_0x4beb7a[_0xa51b('0x63')]({'plain':!![]});return db[_0xa51b('0x64')][_0xa51b('0x5b')]({'where':{'id':_0x4beb7a['OpenchannelInteractionId']}});}return null;})[_0xa51b('0x20')](handleEntityNotFound(_0x6572b,null))[_0xa51b('0x20')](function(_0x2d1e5b){if(_0x2d1e5b){return _0x2d1e5b[_0xa51b('0x36')]({'UserId':_0x42990f[_0xa51b('0x5a')][_0xa51b('0x61')],'read1stAt':_['isNil'](_0x2d1e5b[_0xa51b('0x65')])?moment()[_0xa51b('0x5f')](_0xa51b('0x60')):undefined});}return null;})[_0xa51b('0x20')](function(_0x257c60){if(_0x257c60){_0x5ed8b2[_0xa51b('0x66')]=_0x257c60[_0xa51b('0x63')]({'plain':!![]});interaction_log[_0xa51b('0x27')](_0xa51b('0x67'),_0x42990f[_0xa51b('0x68')]['id'],_0x42990f[_0xa51b('0x68')][_0xa51b('0x39')],_0x42990f['user']['role'],_0x5ed8b2['interaction']['id'],_0x42990f['body']?JSON[_0xa51b('0x23')](_0x42990f['body']):_0xa51b('0x69'));return respondWithRpcPromise(_0xa51b('0x6a'),'acceptMessage',_0x5ed8b2);}return null;})['then'](function(_0x4c95b7){var _0x47588f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4c95b7[_0xa51b('0x26')][_0xa51b('0x6b')];return db[_0xa51b('0x6c')][_0xa51b('0x41')](_0x47588f,{'type':db[_0xa51b('0x6d')][_0xa51b('0x6e')]['SELECT'],'raw':!![]})[_0xa51b('0x20')](function(_0x1f06c0){return _0x1f06c0;});})['then'](function(_0x4f3bbc){if(_0x4f3bbc){_0x5ed8b2['message']['contact']=_0x4f3bbc[0x0];if(!_0x42990f['body'][_0xa51b('0x61')])return;return db[_0xa51b('0x6f')][_0xa51b('0x5b')]({'where':{'id':_0x42990f[_0xa51b('0x5a')][_0xa51b('0x61')],'role':_0xa51b('0x62')},'attributes':['id','name',_0xa51b('0x70'),_0xa51b('0x71'),'internal'],'raw':!![]});}return null;})[_0xa51b('0x20')](function(_0xa3e2de){if(!_0xa3e2de)return null;_0x5ed8b2[_0xa51b('0x26')][_0xa51b('0x62')]=_0xa3e2de;return _0x5ed8b2;})[_0xa51b('0x20')](function(_0x39f442){if(_0x39f442){if(_0x42990f[_0xa51b('0x5a')]['manual']){_0x5ed8b2['message'][_0xa51b('0x72')]=util[_0xa51b('0x5f')](_0xa51b('0x73'),_0x42990f[_0xa51b('0x68')][_0xa51b('0x39')]);_0x5ed8b2[_0xa51b('0x26')]['channel']=_0x5ed8b2['channel'];_0x5ed8b2['message']['motionChannel']=_0x5ed8b2[_0xa51b('0x74')];_0x5ed8b2['message']['event']=_0xa51b('0x5d');return respondWithRpcPromise(_0xa51b('0x75'),_0xa51b('0x75'),{'event':_0xa51b('0x76'),'message':_0x5ed8b2[_0xa51b('0x26')]},client9002)[_0xa51b('0x20')](function(){return _0x5ed8b2;});}return _0x5ed8b2;}return null;})['then'](respondWithResult(_0x6572b,null))['catch'](handleError(_0x6572b,null));};var interaction_log=require('../../config/logger')(_0xa51b('0x77'));exports[_0xa51b('0x34')]=function(_0x4b525b,_0x492588,_0x1ababd){var _0x5d6322={'agent':{},'channel':_0xa51b('0x78')};if(_0x4b525b[_0xa51b('0x5a')]['id']){delete _0x4b525b[_0xa51b('0x5a')]['id'];}_0x4b525b[_0xa51b('0x5a')][_0xa51b('0x61')]=_0x4b525b['body'][_0xa51b('0x61')]||_0x4b525b[_0xa51b('0x68')]['id'];_0x5d6322[_0xa51b('0x62')]['id']=_0x4b525b[_0xa51b('0x5a')]['UserId'];return db[_0xa51b('0x3c')][_0xa51b('0x5b')]({'where':{'id':_0x4b525b['params']['id'],'UserId':null}})[_0xa51b('0x20')](handleEntityNotFound(_0x492588,null))[_0xa51b('0x20')](function(_0x1e4511){if(_0x1e4511){_0x5d6322[_0xa51b('0x26')]=_0x1e4511[_0xa51b('0x63')]({'plain':!![]});return db[_0xa51b('0x64')][_0xa51b('0x5b')]({'where':{'id':_0x1e4511[_0xa51b('0x79')]}});}return null;})[_0xa51b('0x20')](handleEntityNotFound(_0x492588,null))[_0xa51b('0x20')](function(_0x396578){if(_0x396578){_0x5d6322[_0xa51b('0x66')]=_0x396578[_0xa51b('0x63')]({'plain':!![]});interaction_log[_0xa51b('0x27')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b525b[_0xa51b('0x68')]['id'],_0x4b525b[_0xa51b('0x68')][_0xa51b('0x39')],_0x4b525b[_0xa51b('0x68')][_0xa51b('0x7a')],_0x5d6322['interaction']['id'],_0x4b525b[_0xa51b('0x5a')]?JSON['stringify'](_0x4b525b[_0xa51b('0x5a')]):_0xa51b('0x69'));return respondWithRpcPromise(_0xa51b('0x7b'),'rejectMessage',_0x5d6322);}return null;})[_0xa51b('0x20')](function(_0x25331c){var _0x229eb2=_0xa51b('0x7c')+_0x25331c[_0xa51b('0x26')][_0xa51b('0x6b')];return db[_0xa51b('0x6c')][_0xa51b('0x41')](_0x229eb2,{'type':db[_0xa51b('0x6d')]['QueryTypes'][_0xa51b('0x7d')],'raw':!![]})[_0xa51b('0x20')](function(_0x4b69d6){return _0x4b69d6;});})['then'](function(_0x105dea){if(_0x105dea){_0x5d6322[_0xa51b('0x26')][_0xa51b('0x7e')]=_0x105dea[0x0];if(!_0x4b525b[_0xa51b('0x5a')][_0xa51b('0x61')])return;return db[_0xa51b('0x6f')][_0xa51b('0x5b')]({'where':{'id':_0x4b525b['body'][_0xa51b('0x61')],'role':_0xa51b('0x62')},'attributes':['id',_0xa51b('0x39'),_0xa51b('0x70'),_0xa51b('0x71'),_0xa51b('0x7f')],'raw':!![]});}return null;})[_0xa51b('0x20')](function(_0x2da0f6){if(!_0x2da0f6)return null;_0x5d6322['message'][_0xa51b('0x62')]=_0x2da0f6;return _0x5d6322;})[_0xa51b('0x20')](function(_0x3d30fd){if(_0x3d30fd){_0x3d30fd[_0xa51b('0x26')][_0xa51b('0x72')]=util[_0xa51b('0x5f')](_0xa51b('0x73'),_0x4b525b[_0xa51b('0x68')][_0xa51b('0x39')]);_0x3d30fd[_0xa51b('0x26')][_0xa51b('0x74')]=_0x5d6322[_0xa51b('0x74')];_0x3d30fd[_0xa51b('0x26')][_0xa51b('0x80')]=_0x5d6322[_0xa51b('0x74')];_0x3d30fd['message'][_0xa51b('0x81')]=_0xa51b('0x34');respondWithRpcPromise(_0xa51b('0x75'),_0xa51b('0x75'),{'event':'rejectmessage','message':_0x3d30fd[_0xa51b('0x26')]},client9002);return _0x5d6322;}return null;})[_0xa51b('0x20')](respondWithResult(_0x492588,null))[_0xa51b('0x29')](handleError(_0x492588,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 44640dc..da12d82 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 _0xeb8f=['remove','emit','hasOwnProperty','events','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x197bf2,_0x15e8e2){var _0x194564=function(_0x1ffd54){while(--_0x1ffd54){_0x197bf2['push'](_0x197bf2['shift']());}};_0x194564(++_0x15e8e2);}(_0xeb8f,0xeb));var _0xfeb8=function(_0x247883,_0xebbb46){_0x247883=_0x247883-0x0;var _0x4434bc=_0xeb8f[_0x247883];return _0x4434bc;};'use strict';var EventEmitter=require(_0xfeb8('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xfeb8('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xfeb8('0x2')](0x0);var events={'afterCreate':_0xfeb8('0x3'),'afterUpdate':_0xfeb8('0x4'),'afterDestroy':_0xfeb8('0x5')};function emitEvent(_0x3e1cfb){return function(_0x141912,_0x3ab753,_0x534fdd){OpenchannelMessageEvents['emit'](_0x3e1cfb+':'+_0x141912['id'],_0x141912);OpenchannelMessageEvents[_0xfeb8('0x6')](_0x3e1cfb,_0x141912);_0x534fdd(null);};}for(var e in events){if(events[_0xfeb8('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x5fdf=['save','remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x5fdf,0x1a3));var _0xf5fd=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x5fdf[_0x5a7f64];return _0x3d30f1;};'use strict';var EventEmitter=require(_0xf5fd('0x0'));var OpenchannelMessage=require(_0xf5fd('0x1'))['db'][_0xf5fd('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf5fd('0x3')](0x0);var events={'afterCreate':_0xf5fd('0x4'),'afterUpdate':'update','afterDestroy':_0xf5fd('0x5')};function emitEvent(_0x27eda0){return function(_0x2f9556,_0x3d97d6,_0x2c660c){OpenchannelMessageEvents[_0xf5fd('0x6')](_0x27eda0+':'+_0x2f9556['id'],_0x2f9556);OpenchannelMessageEvents[_0xf5fd('0x6')](_0x27eda0,_0x2f9556);_0x2c660c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xf5fd('0x7')](e,emitEvent(event));}}module[_0xf5fd('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 661d04d..b680fd6 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 _0x8fce=['Forwarding\x20message\x20%d\x20to\x20%s','omit','POST','threadId','Interaction','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x8fce,0x15f));var _0xe8fc=function(_0x411327,_0x247f0b){_0x411327=_0x411327-0x0;var _0x26c71a=_0x8fce[_0x411327];return _0x26c71a;};'use strict';var _=require(_0xe8fc('0x0'));var util=require(_0xe8fc('0x1'));var logger=require(_0xe8fc('0x2'))(_0xe8fc('0x3'));var moment=require(_0xe8fc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8fc('0x5'));var rimraf=require(_0xe8fc('0x6'));var config=require(_0xe8fc('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xe8fc('0x8')]=function(_0x363643,_0x4432c){return _0x363643[_0xe8fc('0x9')](_0xe8fc('0xa'),attributes,{'tableName':_0xe8fc('0xb'),'paranoid':![],'indexes':[{'name':_0xe8fc('0xc'),'fields':[_0xe8fc('0xd')],'type':_0xe8fc('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7a0509,_0x2313fd,_0x410bff){var _0x57b8c4=_0x363643[_0xe8fc('0xf')];var _0x40bb4d=_0x7a0509['get']({'plain':!![]});if(_0x40bb4d['direction']['toLowerCase']()==='in'||_0x40bb4d[_0xe8fc('0x10')]['toLowerCase']()===_0xe8fc('0x11')&&!_0x40bb4d['secret']&&!_[_0xe8fc('0x12')](_0x40bb4d[_0xe8fc('0x13')])){_0x57b8c4[_0xe8fc('0x14')]['findOne']({'where':{'id':_0x40bb4d[_0xe8fc('0x15')]}})[_0xe8fc('0x16')](function(_0x3de62f){if(_0x3de62f){_0x3de62f[_0xe8fc('0x17')]({'lastMsgAt':_0x40bb4d[_0xe8fc('0x18')],'lastMsgDirection':_0x40bb4d[_0xe8fc('0x10')][_0xe8fc('0x19')]()});}})[_0xe8fc('0x1a')](function(_0xa9b5a5){console[_0xe8fc('0x1b')](_0xa9b5a5);});}if(_0x40bb4d[_0xe8fc('0x10')]===_0xe8fc('0x11')&&!_0x40bb4d['secret']){var _0x22ad7f;_0x57b8c4[_0xe8fc('0x1c')][_0xe8fc('0x1d')]()['then'](function(_0x47e9e3){return _0x57b8c4[_0xe8fc('0x1e')]['find']({'where':{'id':_0x40bb4d[_0xe8fc('0x1f')]},'include':[{'model':_0x57b8c4['OpenchannelInteraction'],'as':_0xe8fc('0x20'),'where':{'id':_0x40bb4d['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x57b8c4[_0xe8fc('0x1c')],'as':_0xe8fc('0x21'),'attributes':_[_0xe8fc('0x22')](_0x47e9e3)}]}]});})[_0xe8fc('0x16')](function(_0x4bfc68){_0x22ad7f=_0x4bfc68[_0xe8fc('0x23')]({'plain':!![]});if(_0x22ad7f&&_0x22ad7f[_0xe8fc('0x24')]){logger[_0xe8fc('0x25')](_0xe8fc('0x26'),_0xe8fc('0x27'),util[_0xe8fc('0x28')](_0xe8fc('0x29'),_0x40bb4d['id'],_0x22ad7f[_0xe8fc('0x24')]));if(_0x22ad7f['Interactions']&&_0x22ad7f['Interactions']['length']){_0x40bb4d['Interaction']=_[_0xe8fc('0x2a')](_0x22ad7f[_0xe8fc('0x20')][0x0],_0xe8fc('0x21'));_0x40bb4d[_0xe8fc('0x21')]=_0x22ad7f[_0xe8fc('0x20')][0x0][_0xe8fc('0x21')];}var _0x2313fd={'method':_0xe8fc('0x2b'),'uri':encodeURI(_0x22ad7f[_0xe8fc('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2313fd['method']){case'GET':_0x2313fd['qs']=_0x40bb4d;break;case _0xe8fc('0x2b'):_0x2313fd[_0xe8fc('0xd')]=_0x40bb4d;break;}return rp(_0x2313fd)['then'](function(_0x1c8278){logger['info'](_0xe8fc('0x26'),_0xe8fc('0x27'),util[_0xe8fc('0x28')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x40bb4d['id'],_0x22ad7f[_0xe8fc('0x24')]));if(_0x1c8278[_0xe8fc('0xd')][_0xe8fc('0x2c')]&&_0x1c8278[_0xe8fc('0xd')]['threadId']!=_0x40bb4d[_0xe8fc('0x2d')][_0xe8fc('0x2c')]){return _0x57b8c4[_0xe8fc('0x14')][_0xe8fc('0x17')]({'threadId':_0x1c8278[_0xe8fc('0xd')][_0xe8fc('0x2c')]},{'where':{'id':_0x40bb4d['Interaction']['id']}});}else{return;}})[_0xe8fc('0x16')](function(){return _0x7a0509[_0xe8fc('0x17')]({'read':!![]});})[_0xe8fc('0x1a')](function(_0x387b62){logger[_0xe8fc('0x1b')](_0xe8fc('0x26'),'afterCreate',util[_0xe8fc('0x2e')](_0x387b62,{'showHidden':![],'depth':null}));_0x410bff();});}else{_0x410bff();}})[_0xe8fc('0x2f')](function(){_0x410bff();});}else{_0x410bff();}}},'charset':_0xe8fc('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x58c2=['secret','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','lodash','util','../../config/logger','api','moment','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','direction','catch','error'];(function(_0x137d7f,_0x549478){var _0x5acc7d=function(_0x4e1615){while(--_0x4e1615){_0x137d7f['push'](_0x137d7f['shift']());}};_0x5acc7d(++_0x549478);}(_0x58c2,0x142));var _0x258c=function(_0x3ed9ed,_0x5841b0){_0x3ed9ed=_0x3ed9ed-0x0;var _0x4e9106=_0x58c2[_0x3ed9ed];return _0x4e9106;};'use strict';var _=require(_0x258c('0x0'));var util=require(_0x258c('0x1'));var logger=require(_0x258c('0x2'))(_0x258c('0x3'));var moment=require(_0x258c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x258c('0x5'));var rimraf=require('rimraf');var config=require(_0x258c('0x6'));var attributes=require(_0x258c('0x7'));module[_0x258c('0x8')]=function(_0x145bd1,_0x32ab56){return _0x145bd1[_0x258c('0x9')](_0x258c('0xa'),attributes,{'tableName':_0x258c('0xb'),'paranoid':![],'indexes':[{'name':_0x258c('0xc'),'fields':[_0x258c('0xd')],'type':_0x258c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49f795,_0x29e358,_0x1d7b06){var _0x4acc54=_0x145bd1[_0x258c('0xf')];var _0x2f6cb5=_0x49f795[_0x258c('0x10')]({'plain':!![]});if(_0x2f6cb5['direction'][_0x258c('0x11')]()==='in'||_0x2f6cb5['direction'][_0x258c('0x11')]()===_0x258c('0x12')&&!_0x2f6cb5['secret']&&!_[_0x258c('0x13')](_0x2f6cb5[_0x258c('0x14')])){_0x4acc54[_0x258c('0x15')][_0x258c('0x16')]({'where':{'id':_0x2f6cb5['OpenchannelInteractionId']}})[_0x258c('0x17')](function(_0x1e0780){if(_0x1e0780){_0x1e0780[_0x258c('0x18')]({'lastMsgAt':_0x2f6cb5['createdAt'],'lastMsgDirection':_0x2f6cb5[_0x258c('0x19')][_0x258c('0x11')]()});}})[_0x258c('0x1a')](function(_0x192e95){console[_0x258c('0x1b')](_0x192e95);});}if(_0x2f6cb5[_0x258c('0x19')]===_0x258c('0x12')&&!_0x2f6cb5[_0x258c('0x1c')]){var _0x3c0f07;_0x4acc54[_0x258c('0x1d')][_0x258c('0x1e')]()[_0x258c('0x17')](function(_0x2ef52e){return _0x4acc54['OpenchannelAccount'][_0x258c('0x1f')]({'where':{'id':_0x2f6cb5[_0x258c('0x20')]},'include':[{'model':_0x4acc54[_0x258c('0x15')],'as':_0x258c('0x21'),'where':{'id':_0x2f6cb5['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x4acc54['CmContact'],'as':_0x258c('0x22'),'attributes':_[_0x258c('0x23')](_0x2ef52e)}]}]});})['then'](function(_0x14eccd){_0x3c0f07=_0x14eccd[_0x258c('0x10')]({'plain':!![]});if(_0x3c0f07&&_0x3c0f07[_0x258c('0x24')]){logger['info'](_0x258c('0x25'),_0x258c('0x26'),util[_0x258c('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x2f6cb5['id'],_0x3c0f07['replyUri']));if(_0x3c0f07[_0x258c('0x21')]&&_0x3c0f07[_0x258c('0x21')][_0x258c('0x28')]){_0x2f6cb5['Interaction']=_['omit'](_0x3c0f07['Interactions'][0x0],'Contact');_0x2f6cb5[_0x258c('0x22')]=_0x3c0f07[_0x258c('0x21')][0x0][_0x258c('0x22')];}var _0x29e358={'method':_0x258c('0x29'),'uri':encodeURI(_0x3c0f07[_0x258c('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x29e358[_0x258c('0x2a')]){case _0x258c('0x2b'):_0x29e358['qs']=_0x2f6cb5;break;case _0x258c('0x29'):_0x29e358[_0x258c('0xd')]=_0x2f6cb5;break;}return rp(_0x29e358)[_0x258c('0x17')](function(_0x2e55bb){logger[_0x258c('0x2c')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x258c('0x2d'),_0x2f6cb5['id'],_0x3c0f07['replyUri']));if(_0x2e55bb[_0x258c('0xd')]['threadId']&&_0x2e55bb['body'][_0x258c('0x2e')]!=_0x2f6cb5['Interaction'][_0x258c('0x2e')]){return _0x4acc54[_0x258c('0x15')][_0x258c('0x18')]({'threadId':_0x2e55bb[_0x258c('0xd')][_0x258c('0x2e')]},{'where':{'id':_0x2f6cb5[_0x258c('0x2f')]['id']}});}else{return;}})[_0x258c('0x17')](function(){return _0x49f795['update']({'read':!![]});})[_0x258c('0x1a')](function(_0x59fce4){logger[_0x258c('0x1b')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['inspect'](_0x59fce4,{'showHidden':![],'depth':null}));_0x1d7b06();});}else{_0x1d7b06();}})[_0x258c('0x30')](function(){_0x1d7b06();});}else{_0x1d7b06();}}},'charset':_0x258c('0x31'),'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 10e6881..9001ff7 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 _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x354311,_0x57567b){var _0x1f154b=function(_0x3946d5){while(--_0x3946d5){_0x354311['push'](_0x354311['shift']());}};_0x1f154b(++_0x57567b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x0b0e[_0x4d7116];return _0x4593dc;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3c93d9,_0x500378){var _0x22dbb8=function(_0x1a7a57){while(--_0x1a7a57){_0x3c93d9['push'](_0x3c93d9['shift']());}};_0x22dbb8(++_0x500378);}(_0xadb5,0xad));var _0x5adb=function(_0x227980,_0x55ed6f){_0x227980=_0x227980-0x0;var _0x45d194=_0xadb5[_0x227980];return _0x45d194;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c547f34..f87b9dd 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 _0x154f=['emit','removeListener','register','length','save','update'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x154f,0x82));var _0xf154=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x154f[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xf154('0x0'),'remove',_0xf154('0x1')];function createListener(_0xdc5719,_0x37df6f){return function(_0x4e5e7c){_0x37df6f[_0xf154('0x2')](_0xdc5719,_0x4e5e7c);};}function removeListener(_0x2e74b4,_0x379ec9){return function(){OpenchannelMessageEvents[_0xf154('0x3')](_0x2e74b4,_0x379ec9);};}exports[_0xf154('0x4')]=function(_0x5c356d){for(var _0x312043=0x0,_0x2461c1=events[_0xf154('0x5')];_0x312043<_0x2461c1;_0x312043++){var _0x41f0cb=events[_0x312043];var _0x201cfb=createListener('openchannelMessage:'+_0x41f0cb,_0x5c356d);OpenchannelMessageEvents['on'](_0x41f0cb,_0x201cfb);}}; \ No newline at end of file +var _0xfa12=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x348d0b,_0x4ab1d9){var _0x270395=function(_0x422f08){while(--_0x422f08){_0x348d0b['push'](_0x348d0b['shift']());}};_0x270395(++_0x4ab1d9);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x363063,_0x863a4c){_0x363063=_0x363063-0x0;var _0x27f875=_0xfa12[_0x363063];return _0x27f875;};'use strict';var OpenchannelMessageEvents=require(_0x2fa1('0x0'));var events=[_0x2fa1('0x1'),_0x2fa1('0x2'),'update'];function createListener(_0x577931,_0x3555d0){return function(_0x1a08dc){_0x3555d0['emit'](_0x577931,_0x1a08dc);};}function removeListener(_0x4ec644,_0x41eaf6){return function(){OpenchannelMessageEvents[_0x2fa1('0x3')](_0x4ec644,_0x41eaf6);};}exports[_0x2fa1('0x4')]=function(_0x4dfb6e){for(var _0x19a57a=0x0,_0x5d5fb4=events[_0x2fa1('0x5')];_0x19a57a<_0x5d5fb4;_0x19a57a++){var _0x1adece=events[_0x19a57a];var _0x3ee801=createListener(_0x2fa1('0x6')+_0x1adece,_0x4dfb6e);OpenchannelMessageEvents['on'](_0x1adece,_0x3ee801);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0e144ed..7116262 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 _0xfb64=['../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','create','addTeams','addAgents','put','update','destroy','removeTeams','delete','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x299ee9,_0x3106fa){var _0x3125e8=function(_0xc10908){while(--_0xc10908){_0x299ee9['push'](_0x299ee9['shift']());}};_0x3125e8(++_0x3106fa);}(_0xfb64,0x137));var _0x4fb6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb64[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x4fb6('0x0'));var path=require(_0x4fb6('0x1'));var timeout=require(_0x4fb6('0x2'));var express=require(_0x4fb6('0x3'));var router=express[_0x4fb6('0x4')]();var fs_extra=require(_0x4fb6('0x5'));var auth=require(_0x4fb6('0x6'));var interaction=require(_0x4fb6('0x7'));var config=require(_0x4fb6('0x8'));var controller=require(_0x4fb6('0x9'));router['get']('/',auth[_0x4fb6('0xa')](),controller[_0x4fb6('0xb')]);router[_0x4fb6('0xc')]('/describe',auth[_0x4fb6('0xa')](),controller[_0x4fb6('0xd')]);router[_0x4fb6('0xc')](_0x4fb6('0xe'),auth['isAuthenticated'](),controller[_0x4fb6('0xf')]);router['get'](_0x4fb6('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0x4fb6('0xc')](_0x4fb6('0x11'),auth[_0x4fb6('0xa')](),controller['getTeams']);router[_0x4fb6('0xc')](_0x4fb6('0x12'),auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x13')]);router['post']('/',auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x14')]);router['post'](_0x4fb6('0x11'),auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x15')]);router['post'](_0x4fb6('0x12'),auth['isAuthenticated'](),controller[_0x4fb6('0x16')]);router[_0x4fb6('0x17')](_0x4fb6('0xe'),auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x18')]);router['delete']('/:id',auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x19')]);router['delete']('/:id/teams',auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x1a')]);router[_0x4fb6('0x1b')]('/:id/users',auth[_0x4fb6('0xa')](),controller[_0x4fb6('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x6c38=['index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeAgents','exports','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x4215a2,_0x466895){var _0x3d72db=function(_0x47ee78){while(--_0x47ee78){_0x4215a2['push'](_0x4215a2['shift']());}};_0x3d72db(++_0x466895);}(_0x6c38,0x89));var _0x86c3=function(_0x55ffee,_0x1862c1){_0x55ffee=_0x55ffee-0x0;var _0x27992d=_0x6c38[_0x55ffee];return _0x27992d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x86c3('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86c3('0x1'));var interaction=require(_0x86c3('0x2'));var config=require(_0x86c3('0x3'));var controller=require(_0x86c3('0x4'));router[_0x86c3('0x5')]('/',auth[_0x86c3('0x6')](),controller[_0x86c3('0x7')]);router[_0x86c3('0x5')]('/describe',auth[_0x86c3('0x6')](),controller['describe']);router['get'](_0x86c3('0x8'),auth[_0x86c3('0x6')](),controller[_0x86c3('0x9')]);router[_0x86c3('0x5')](_0x86c3('0xa'),auth[_0x86c3('0x6')](),controller[_0x86c3('0xb')]);router[_0x86c3('0x5')](_0x86c3('0xc'),auth['isAuthenticated'](),controller[_0x86c3('0xd')]);router['get'](_0x86c3('0xe'),auth[_0x86c3('0x6')](),controller[_0x86c3('0xf')]);router[_0x86c3('0x10')]('/',auth[_0x86c3('0x6')](),controller['create']);router[_0x86c3('0x10')]('/:id/teams',auth[_0x86c3('0x6')](),controller[_0x86c3('0x11')]);router[_0x86c3('0x10')](_0x86c3('0xe'),auth[_0x86c3('0x6')](),controller[_0x86c3('0x12')]);router[_0x86c3('0x13')](_0x86c3('0x8'),auth['isAuthenticated'](),controller[_0x86c3('0x14')]);router[_0x86c3('0x15')](_0x86c3('0x8'),auth[_0x86c3('0x6')](),controller['destroy']);router[_0x86c3('0x15')](_0x86c3('0xc'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x86c3('0x6')](),controller[_0x86c3('0x16')]);module[_0x86c3('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 6e75c02..d794c3b 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 _0x145c=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x145c,0x1b4));var _0xc145=function(_0x1c2b69,_0x40408e){_0x1c2b69=_0x1c2b69-0x0;var _0x20f69b=_0x145c[_0x1c2b69];return _0x20f69b;};'use strict';var Sequelize=require(_0xc145('0x0'));module[_0xc145('0x1')]={'name':{'type':Sequelize[_0xc145('0x2')],'unique':_0xc145('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc145('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc145('0x5')](_0xc145('0x6'),_0xc145('0x7'),_0xc145('0x8'))}}; \ No newline at end of file +var _0xb34a=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x360aef,_0x18ce3a){var _0x1fe8fd=function(_0x357ea0){while(--_0x357ea0){_0x360aef['push'](_0x360aef['shift']());}};_0x1fe8fd(++_0x18ce3a);}(_0xb34a,0xf5));var _0xab34=function(_0x225f53,_0x2d7b05){_0x225f53=_0x225f53-0x0;var _0x665a9a=_0xb34a[_0x225f53];return _0x665a9a;};'use strict';var Sequelize=require(_0xab34('0x0'));module['exports']={'name':{'type':Sequelize[_0xab34('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xab34('0x1')]},'timeout':{'type':Sequelize[_0xab34('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xab34('0x3'),_0xab34('0x4'),_0xab34('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 9c96322..def1c57 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 _0xf514=['userOpenchannelQueue:remove','addAgents','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','OpenchannelQueues','UserProfileResource','error','name','send','index','OpenchannelQueue','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','value','isEmpty','emit'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf514,0x1b1));var _0x4f51=function(_0x1db1d2,_0x3c482e){_0x1db1d2=_0x1db1d2-0x0;var _0x571bbe=_0xf514[_0x1db1d2];return _0x571bbe;};'use strict';var emlformat=require(_0x4f51('0x0'));var rimraf=require(_0x4f51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f51('0x2'));var rp=require(_0x4f51('0x3'));var moment=require(_0x4f51('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f51('0x5'));var path=require(_0x4f51('0x6'));var sox=require(_0x4f51('0x7'));var csv=require(_0x4f51('0x8'));var ejs=require(_0x4f51('0x9'));var fs=require('fs');var fs_extra=require(_0x4f51('0xa'));var _=require(_0x4f51('0xb'));var squel=require('squel');var crypto=require(_0x4f51('0xc'));var jsforce=require(_0x4f51('0xd'));var deskjs=require(_0x4f51('0xe'));var toCsv=require(_0x4f51('0x8'));var querystring=require(_0x4f51('0xf'));var Papa=require(_0x4f51('0x10'));var Redis=require(_0x4f51('0x11'));var authService=require(_0x4f51('0x12'));var qs=require(_0x4f51('0x13'));var as=require(_0x4f51('0x14'));var hardwareService=require(_0x4f51('0x15'));var logger=require(_0x4f51('0x16'))(_0x4f51('0x17'));var utils=require('../../config/utils');var config=require(_0x4f51('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f51('0x19'))['db'];config['redis']=_[_0x4f51('0x1a')](config[_0x4f51('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f51('0x1c'))(new Redis(config[_0x4f51('0x1b')]));require(_0x4f51('0x1d'))[_0x4f51('0x1e')](socket);function respondWithStatusCode(_0x276753,_0x171dd7){_0x171dd7=_0x171dd7||0xcc;return function(_0x243039){if(_0x243039){return _0x276753[_0x4f51('0x1f')](_0x171dd7);}return _0x276753[_0x4f51('0x20')](_0x171dd7)[_0x4f51('0x21')]();};}function respondWithResult(_0x4eb833,_0x1151e5){_0x1151e5=_0x1151e5||0xc8;return function(_0x4a45af){if(_0x4a45af){return _0x4eb833[_0x4f51('0x20')](_0x1151e5)['json'](_0x4a45af);}};}function respondWithFilteredResult(_0x5cadc8,_0xf2d41){return function(_0x19ab7e){if(_0x19ab7e){var _0xb95c99=typeof _0xf2d41[_0x4f51('0x22')]==='undefined'&&typeof _0xf2d41[_0x4f51('0x23')]==='undefined';var _0x339216=_0x19ab7e[_0x4f51('0x24')];var _0x5d27c5=_0xb95c99?0x0:_0xf2d41[_0x4f51('0x22')];var _0x236b9f=_0xb95c99?_0x19ab7e['count']:_0xf2d41[_0x4f51('0x22')]+_0xf2d41[_0x4f51('0x23')];var _0x5d503e;if(_0x236b9f>=_0x339216){_0x236b9f=_0x339216;_0x5d503e=0xc8;}else{_0x5d503e=0xce;}_0x5cadc8[_0x4f51('0x20')](_0x5d503e);return _0x5cadc8[_0x4f51('0x25')](_0x4f51('0x26'),_0x5d27c5+'-'+_0x236b9f+'/'+_0x339216)[_0x4f51('0x27')](_0x19ab7e);}return null;};}function patchUpdates(_0x3ea3f5){return function(_0x169203){try{jsonpatch[_0x4f51('0x28')](_0x169203,_0x3ea3f5,!![]);}catch(_0x1923dc){return BPromise[_0x4f51('0x29')](_0x1923dc);}return _0x169203['save']();};}function saveUpdates(_0x39d6f5,_0x112d17){return function(_0x2cdb07){if(_0x2cdb07){return _0x2cdb07[_0x4f51('0x2a')](_0x39d6f5)[_0x4f51('0x2b')](function(_0x5e54f7){return _0x5e54f7;});}return null;};}function removeEntity(_0x1f5ffe,_0x46417d){return function(_0x12b7f8){if(_0x12b7f8){return _0x12b7f8[_0x4f51('0x2c')]()[_0x4f51('0x2b')](function(){var _0x155ade=_0x12b7f8['get']({'plain':!![]});var _0x16edea=_0x4f51('0x2d');return db[_0x4f51('0x2e')][_0x4f51('0x2c')]({'where':{'type':_0x16edea,'resourceId':_0x155ade['id']}})['then'](function(){return _0x12b7f8;});})[_0x4f51('0x2b')](function(){_0x1f5ffe[_0x4f51('0x20')](0xcc)[_0x4f51('0x21')]();});}};}function handleEntityNotFound(_0x34efda,_0x10c389){return function(_0x1ebb1a){if(!_0x1ebb1a){_0x34efda[_0x4f51('0x1f')](0x194);}return _0x1ebb1a;};}function handleError(_0x3baae6,_0xc04422){_0xc04422=_0xc04422||0x1f4;return function(_0x6085b){logger[_0x4f51('0x2f')](_0x6085b['stack']);if(_0x6085b[_0x4f51('0x30')]){delete _0x6085b[_0x4f51('0x30')];}_0x3baae6['status'](_0xc04422)[_0x4f51('0x31')](_0x6085b);};}exports[_0x4f51('0x32')]=function(_0x4e75e6,_0x27a154){var _0x32998c={},_0x25568b={},_0x2dea72={'count':0x0,'rows':[]};var _0x42acf4=_['map'](db[_0x4f51('0x33')][_0x4f51('0x34')],function(_0x283d40){return{'name':_0x283d40['fieldName'],'type':_0x283d40['type'][_0x4f51('0x35')]};});_0x25568b['model']=_[_0x4f51('0x36')](_0x42acf4,_0x4f51('0x30'));_0x25568b[_0x4f51('0x37')]=_[_0x4f51('0x38')](_0x4e75e6[_0x4f51('0x37')]);_0x25568b[_0x4f51('0x39')]=_[_0x4f51('0x3a')](_0x25568b[_0x4f51('0x3b')],_0x25568b[_0x4f51('0x37')]);_0x32998c['attributes']=_[_0x4f51('0x3a')](_0x25568b['model'],qs[_0x4f51('0x3c')](_0x4e75e6['query'][_0x4f51('0x3c')]));_0x32998c[_0x4f51('0x3d')]=_0x32998c['attributes'][_0x4f51('0x3e')]?_0x32998c[_0x4f51('0x3d')]:_0x25568b[_0x4f51('0x3b')];if(!_0x4e75e6[_0x4f51('0x37')][_0x4f51('0x3f')]('nolimit')){_0x32998c['limit']=qs[_0x4f51('0x23')](_0x4e75e6[_0x4f51('0x37')][_0x4f51('0x23')]);_0x32998c[_0x4f51('0x22')]=qs[_0x4f51('0x22')](_0x4e75e6[_0x4f51('0x37')][_0x4f51('0x22')]);}_0x32998c[_0x4f51('0x40')]=qs[_0x4f51('0x41')](_0x4e75e6['query']['sort']);_0x32998c['where']=qs[_0x4f51('0x39')](_[_0x4f51('0x42')](_0x4e75e6[_0x4f51('0x37')],_0x25568b[_0x4f51('0x39')]),_0x42acf4);if(_0x4e75e6[_0x4f51('0x37')]['filter']){_0x32998c[_0x4f51('0x43')]=_[_0x4f51('0x44')](_0x32998c['where'],{'$or':_[_0x4f51('0x36')](_0x42acf4,function(_0x380c91){if(_0x380c91[_0x4f51('0x45')]!==_0x4f51('0x46')){var _0x3b8930={};_0x3b8930[_0x380c91[_0x4f51('0x30')]]={'$like':'%'+_0x4e75e6[_0x4f51('0x37')][_0x4f51('0x47')]+'%'};return _0x3b8930;}})});}_0x32998c=_[_0x4f51('0x44')]({},_0x32998c,_0x4e75e6[_0x4f51('0x48')]);var _0x12f60e={'where':_0x32998c[_0x4f51('0x43')]};return db[_0x4f51('0x33')][_0x4f51('0x24')](_0x12f60e)['then'](function(_0xd0b2eb){_0x2dea72[_0x4f51('0x24')]=_0xd0b2eb;if(_0x4e75e6['query'][_0x4f51('0x49')]){_0x32998c[_0x4f51('0x4a')]=[{'all':!![]}];}return db[_0x4f51('0x33')][_0x4f51('0x4b')](_0x32998c);})['then'](function(_0x427ce1){_0x2dea72[_0x4f51('0x4c')]=_0x427ce1;return _0x2dea72;})[_0x4f51('0x2b')](respondWithFilteredResult(_0x27a154,_0x32998c))['catch'](handleError(_0x27a154,null));};exports[_0x4f51('0x4d')]=function(_0x3d8265,_0x1e810e){var _0xb05f90={'raw':!![],'where':{'id':_0x3d8265[_0x4f51('0x4e')]['id']}},_0x294b6c={};_0x294b6c[_0x4f51('0x3b')]=_[_0x4f51('0x38')](db['OpenchannelQueue']['rawAttributes']);_0x294b6c[_0x4f51('0x37')]=_['keys'](_0x3d8265['query']);_0x294b6c[_0x4f51('0x39')]=_['intersection'](_0x294b6c['model'],_0x294b6c[_0x4f51('0x37')]);_0xb05f90[_0x4f51('0x3d')]=_['intersection'](_0x294b6c[_0x4f51('0x3b')],qs[_0x4f51('0x3c')](_0x3d8265[_0x4f51('0x37')][_0x4f51('0x3c')]));_0xb05f90[_0x4f51('0x3d')]=_0xb05f90[_0x4f51('0x3d')][_0x4f51('0x3e')]?_0xb05f90[_0x4f51('0x3d')]:_0x294b6c['model'];if(_0x3d8265[_0x4f51('0x37')]['includeAll']){_0xb05f90[_0x4f51('0x4a')]=[{'all':!![]}];}_0xb05f90=_[_0x4f51('0x44')]({},_0xb05f90,_0x3d8265['options']);return db[_0x4f51('0x33')][_0x4f51('0x4f')](_0xb05f90)[_0x4f51('0x2b')](handleEntityNotFound(_0x1e810e,null))[_0x4f51('0x2b')](respondWithResult(_0x1e810e,null))[_0x4f51('0x50')](handleError(_0x1e810e,null));};exports[_0x4f51('0x51')]=function(_0x1423d2,_0xda8cd7){return db[_0x4f51('0x33')][_0x4f51('0x51')](_0x1423d2['body'],{})['then'](function(_0x568df7){var _0x321c5f=_0x1423d2[_0x4f51('0x52')][_0x4f51('0x53')]({'plain':!![]});if(!_0x321c5f)throw new Error(_0x4f51('0x54'));if(_0x321c5f[_0x4f51('0x55')]===_0x4f51('0x52')){var _0xa9009e=_0x568df7[_0x4f51('0x53')]({'plain':!![]});var _0x182b27='OpenchannelQueues';return db[_0x4f51('0x56')]['find']({'where':{'name':_0x182b27,'userProfileId':_0x321c5f[_0x4f51('0x57')]},'raw':!![]})['then'](function(_0x421b27){if(_0x421b27&&_0x421b27[_0x4f51('0x58')]===0x0){return db[_0x4f51('0x2e')][_0x4f51('0x51')]({'name':_0xa9009e[_0x4f51('0x30')],'resourceId':_0xa9009e['id'],'type':_0x421b27[_0x4f51('0x30')],'sectionId':_0x421b27['id']},{})[_0x4f51('0x2b')](function(){return _0x568df7;});}else{return _0x568df7;}})[_0x4f51('0x50')](function(_0x53e767){logger['error'](_0x4f51('0x59'),_0x53e767);throw _0x53e767;});}return _0x568df7;})['then'](respondWithResult(_0xda8cd7,0xc9))['catch'](handleError(_0xda8cd7,null));};exports[_0x4f51('0x2a')]=function(_0x208d27,_0x116120){if(_0x208d27[_0x4f51('0x5a')]['id']){delete _0x208d27['body']['id'];}return db[_0x4f51('0x33')][_0x4f51('0x4f')]({'where':{'id':_0x208d27[_0x4f51('0x4e')]['id']}})['then'](handleEntityNotFound(_0x116120,null))[_0x4f51('0x2b')](saveUpdates(_0x208d27['body'],null))[_0x4f51('0x2b')](respondWithResult(_0x116120,null))[_0x4f51('0x50')](handleError(_0x116120,null));};exports[_0x4f51('0x2c')]=function(_0x19997d,_0x32955e){return db[_0x4f51('0x33')][_0x4f51('0x4f')]({'where':{'id':_0x19997d[_0x4f51('0x4e')]['id']}})[_0x4f51('0x2b')](handleEntityNotFound(_0x32955e,null))[_0x4f51('0x2b')](removeEntity(_0x32955e,null))[_0x4f51('0x50')](handleError(_0x32955e,null));};exports[_0x4f51('0x5b')]=function(_0x5e9704,_0x3048d1){return db['OpenchannelQueue'][_0x4f51('0x5b')]()[_0x4f51('0x2b')](respondWithResult(_0x3048d1,null))['catch'](handleError(_0x3048d1,null));};exports[_0x4f51('0x5c')]=function(_0x4dafad,_0x448065,_0xedc166){var _0x4d4c57={'raw':!![],'where':{}},_0x562637={},_0x10499b;return db[_0x4f51('0x33')][_0x4f51('0x5d')]({'where':{'id':_0x4dafad[_0x4f51('0x4e')]['id']}})[_0x4f51('0x2b')](handleEntityNotFound(_0x448065,null))[_0x4f51('0x2b')](function(_0x5af856){if(_0x5af856){_0x10499b=_0x5af856[_0x4f51('0x53')]({'plain':!![]});_0x562637[_0x4f51('0x3b')]=_[_0x4f51('0x38')](db[_0x4f51('0x5e')][_0x4f51('0x34')]);_0x562637['query']=_[_0x4f51('0x38')](_0x4dafad[_0x4f51('0x37')]);_0x562637[_0x4f51('0x39')]=_[_0x4f51('0x3a')](_0x562637[_0x4f51('0x3b')],_0x562637['query']);_0x4d4c57[_0x4f51('0x3d')]=_['intersection'](_0x562637[_0x4f51('0x3b')],qs[_0x4f51('0x3c')](_0x4dafad[_0x4f51('0x37')][_0x4f51('0x3c')]));_0x4d4c57[_0x4f51('0x3d')]=_0x4d4c57[_0x4f51('0x3d')][_0x4f51('0x3e')]?_0x4d4c57['attributes']:_0x562637[_0x4f51('0x3b')];if(!_0x4dafad[_0x4f51('0x37')][_0x4f51('0x3f')](_0x4f51('0x5f'))){_0x4d4c57[_0x4f51('0x23')]=qs[_0x4f51('0x23')](_0x4dafad['query']['limit']);_0x4d4c57['offset']=qs[_0x4f51('0x22')](_0x4dafad[_0x4f51('0x37')][_0x4f51('0x22')]);}_0x4d4c57[_0x4f51('0x40')]=qs['sort'](_0x4dafad['query'][_0x4f51('0x41')]);_0x4d4c57[_0x4f51('0x43')]=qs[_0x4f51('0x39')](_[_0x4f51('0x42')](_0x4dafad['query'],_0x562637[_0x4f51('0x39')]));_0x4d4c57['where'][_0x4f51('0x60')]=_0x5af856['id'];if(_0x4dafad[_0x4f51('0x37')]['filter']){_0x4d4c57[_0x4f51('0x43')]=_[_0x4f51('0x44')](_0x4d4c57[_0x4f51('0x43')],{'$or':_['map'](_0x4d4c57[_0x4f51('0x3d')],function(_0x52cb13){var _0x104505={};_0x104505[_0x52cb13]={'$like':'%'+_0x4dafad[_0x4f51('0x37')][_0x4f51('0x47')]+'%'};return _0x104505;})});}_0x4d4c57=_[_0x4f51('0x44')]({},_0x4d4c57,_0x4dafad['options']);return db['UserOpenchannelQueue']['findAll'](_0x4d4c57);}})[_0x4f51('0x2b')](function(_0x3695f6){if(_0x3695f6){return db[_0x4f51('0x61')][_0x4f51('0x62')]({'where':{'id':_[_0x4f51('0x36')](_0x3695f6,_0x4f51('0x63')),'role':_0x4f51('0x64')},'attributes':['id',_0x4f51('0x30'),_0x4f51('0x65'),_0x4f51('0x66'),_0x4f51('0x67')]});}})[_0x4f51('0x2b')](function(_0xb9cf28){if(_0xb9cf28){return{'count':_0xb9cf28[_0x4f51('0x24')],'rows':_[_0x4f51('0x36')](_0xb9cf28[_0x4f51('0x4c')],function(_0x1f5a6b){return{'membername':_0x1f5a6b[_0x4f51('0x30')],'UserId':_0x1f5a6b['id'],'queue_name':_0x10499b[_0x4f51('0x30')],'OpenchannelQueueId':_0x10499b['id'],'interface':util[_0x4f51('0x68')]('%s/%s',_0x4f51('0x69'),_0x1f5a6b[_0x4f51('0x30')]),'penalty':0x0,'paused':_0x1f5a6b[_0x4f51('0x65')],'createdAt':_0x1f5a6b[_0x4f51('0x67')],'updatedAt':_0x1f5a6b[_0x4f51('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x448065,_0x4d4c57))['catch'](handleError(_0x448065,null));};exports[_0x4f51('0x6a')]=function(_0x42fbea,_0x48e6c3,_0x1a8e48){var _0x18ff00={};var _0x20e7c2={};var _0x10aa86;var _0x313293;return db[_0x4f51('0x33')][_0x4f51('0x5d')]({'where':{'id':_0x42fbea[_0x4f51('0x4e')]['id']}})[_0x4f51('0x2b')](handleEntityNotFound(_0x48e6c3,null))[_0x4f51('0x2b')](function(_0x1fb037){if(_0x1fb037){_0x10aa86=_0x1fb037;_0x20e7c2[_0x4f51('0x3b')]=_[_0x4f51('0x38')](db[_0x4f51('0x6b')][_0x4f51('0x34')]);_0x20e7c2['query']=_[_0x4f51('0x38')](_0x42fbea[_0x4f51('0x37')]);_0x20e7c2[_0x4f51('0x39')]=_[_0x4f51('0x3a')](_0x20e7c2['model'],_0x20e7c2[_0x4f51('0x37')]);_0x18ff00[_0x4f51('0x3d')]=_[_0x4f51('0x3a')](_0x20e7c2[_0x4f51('0x3b')],qs[_0x4f51('0x3c')](_0x42fbea[_0x4f51('0x37')][_0x4f51('0x3c')]));_0x18ff00[_0x4f51('0x3d')]=_0x18ff00[_0x4f51('0x3d')][_0x4f51('0x3e')]?_0x18ff00[_0x4f51('0x3d')]:_0x20e7c2['model'];_0x18ff00[_0x4f51('0x40')]=qs[_0x4f51('0x41')](_0x42fbea[_0x4f51('0x37')][_0x4f51('0x41')]);_0x18ff00[_0x4f51('0x43')]=qs[_0x4f51('0x39')](_[_0x4f51('0x42')](_0x42fbea[_0x4f51('0x37')],_0x20e7c2['filters']));if(_0x42fbea['query']['filter']){_0x18ff00[_0x4f51('0x43')]=_['merge'](_0x18ff00[_0x4f51('0x43')],{'$or':_['map'](_0x18ff00['attributes'],function(_0x58e7b5){var _0xc0b1a6={};_0xc0b1a6[_0x58e7b5]={'$like':'%'+_0x42fbea[_0x4f51('0x37')][_0x4f51('0x47')]+'%'};return _0xc0b1a6;})});}_0x18ff00=_[_0x4f51('0x44')]({},_0x18ff00,_0x42fbea[_0x4f51('0x48')]);return _0x10aa86[_0x4f51('0x6a')](_0x18ff00);}})['then'](function(_0x1ae792){if(_0x1ae792){_0x313293=_0x1ae792[_0x4f51('0x3e')];if(!_0x42fbea['query'][_0x4f51('0x3f')](_0x4f51('0x5f'))){_0x18ff00[_0x4f51('0x23')]=qs[_0x4f51('0x23')](_0x42fbea[_0x4f51('0x37')][_0x4f51('0x23')]);_0x18ff00[_0x4f51('0x22')]=qs['offset'](_0x42fbea[_0x4f51('0x37')][_0x4f51('0x22')]);}return _0x10aa86[_0x4f51('0x6a')](_0x18ff00);}})[_0x4f51('0x2b')](function(_0x2e28d3){if(_0x2e28d3){return _0x2e28d3?{'count':_0x313293,'rows':_0x2e28d3}:null;}})['then'](respondWithResult(_0x48e6c3,null))[_0x4f51('0x50')](handleError(_0x48e6c3,null));};exports['addTeams']=function(_0x47f110,_0x3e04df,_0x18a2eb){var _0x5c2c67=_0x47f110[_0x4f51('0x5a')]['ids'];return db['Team'][_0x4f51('0x4b')]({'where':{'id':_0x5c2c67},'attributes':['id'],'include':[{'model':db[_0x4f51('0x61')],'as':_0x4f51('0x6c'),'attributes':['id',_0x4f51('0x30'),_0x4f51('0x6d'),_0x4f51('0x6e'),_0x4f51('0x6f')],'raw':!![]}]})[_0x4f51('0x2b')](function(_0x284acf){if(_0x284acf){var _0x420039=_[_0x4f51('0x70')](_0x284acf,function(_0x121016){var _0x2ce2c0=_0x121016[_0x4f51('0x53')]({'plain':!![]});return _0x2ce2c0['Agents'];});return db[_0x4f51('0x33')]['find']({'where':{'id':_0x47f110['params']['id']}})['then'](function(_0x370a18){return db[_0x4f51('0x71')][_0x4f51('0x72')](function(_0x300daa){return _0x370a18[_0x4f51('0x73')](_0x5c2c67,{'transaction':_0x300daa})[_0x4f51('0x2b')](function(){return BPromise[_0x4f51('0x74')](_0x420039,function(_0xf29d5c){return db[_0x4f51('0x5e')]['findOrCreate']({'where':{'UserId':_0xf29d5c['id'],'OpenchannelQueueId':_0x47f110['params']['id']},'transaction':_0x300daa});});})[_0x4f51('0x2b')](function(){_0x420039[_0x4f51('0x75')](function(_0x35319a){socket['emit'](_0x4f51('0x76'),{'UserId':_0x35319a['id'],'OpenchannelQueueId':_0x370a18['id']});});});});});}})[_0x4f51('0x2b')](respondWithStatusCode(_0x3e04df,null))[_0x4f51('0x50')](handleError(_0x3e04df,null));};exports[_0x4f51('0x77')]=function(_0x132180,_0x2732b4,_0x333a39){return db[_0x4f51('0x6b')][_0x4f51('0x4b')]({'where':{'id':_0x132180[_0x4f51('0x37')][_0x4f51('0x78')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4f51('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x4f51('0x2b')](handleEntityNotFound(_0x2732b4,null))[_0x4f51('0x2b')](function(_0x324cc1){var _0x3d3fc6=_[_0x4f51('0x36')](_0x324cc1,'id');var _0x118ab2=[];var _0x167fe2=[];var _0x22dfd3=squel[_0x4f51('0x79')]();_0x22dfd3[_0x4f51('0x7a')](_0x4f51('0x7b'))[_0x4f51('0x7c')](_0x4f51('0x7d'),'tq')['join'](_0x4f51('0x7e'),'ut',_0x4f51('0x7f'))[_0x4f51('0x43')]('OpenchannelQueueId\x20=\x20?',_0x132180['params']['id']);for(var _0x144f77=0x0;_0x144f77<_0x324cc1[_0x4f51('0x3e')];_0x144f77+=0x1){let _0x4de0b6=_0x324cc1[_0x144f77];for(var _0x5755cc=0x0;_0x5755cc<_0x4de0b6[_0x4f51('0x6c')]['length'];_0x5755cc+=0x1){let _0x2fcbb9=_0x4de0b6['Agents'][_0x5755cc];var _0x3d347d=_0x22dfd3[_0x4f51('0x80')]();_0x3d347d['where'](_0x4f51('0x81'),_0x2fcbb9['id']);_0x167fe2[_0x4f51('0x82')](db['sequelize']['query'](_0x3d347d[_0x4f51('0x83')](),{'type':db[_0x4f51('0x71')]['QueryTypes'][_0x4f51('0x84')]})[_0x4f51('0x2b')](function(_0x29c08c){if(_0x29c08c[_0x4f51('0x3e')]===0x1){return _0x2fcbb9['id'];}else{var _0x5d66c2=_[_0x4f51('0x85')](_[_0x4f51('0x36')](_0x29c08c,_0x4f51('0x86')),function(_0x57e087){return _[_0x4f51('0x87')](_0x3d3fc6,_0x57e087);});if(_0x5d66c2){return _0x2fcbb9['id'];}}}));}}return BPromise['all'](_0x167fe2)[_0x4f51('0x2b')](function(_0x55a37f){_0x118ab2=_(_0x118ab2)['union'](_0x55a37f)['compact']()[_0x4f51('0x88')]();return db[_0x4f51('0x33')][_0x4f51('0x4f')]({'where':{'id':_0x132180['params']['id']}})['then'](function(_0x5adb00){return db[_0x4f51('0x71')][_0x4f51('0x72')](function(_0x384149){return _0x5adb00[_0x4f51('0x77')](_0x132180[_0x4f51('0x37')]['ids'],{'transaction':_0x384149})[_0x4f51('0x2b')](function(){if(!_[_0x4f51('0x89')](_0x118ab2)){return _0x5adb00['removeAgents'](_0x118ab2,{'transaction':_0x384149});}})[_0x4f51('0x2b')](function(){_0x118ab2['forEach'](function(_0x18024a){socket[_0x4f51('0x8a')](_0x4f51('0x8b'),{'UserId':_0x18024a,'OpenchannelQueueId':_0x5adb00['id']});});});});});});})[_0x4f51('0x2b')](respondWithStatusCode(_0x2732b4,null))[_0x4f51('0x50')](handleError(_0x2732b4,null));};exports[_0x4f51('0x8c')]=function(_0x24157b,_0x1f4857,_0x4fc8c2){return db['OpenchannelQueue'][_0x4f51('0x4f')]({'where':{'id':_0x24157b[_0x4f51('0x4e')]['id']}})[_0x4f51('0x2b')](handleEntityNotFound(_0x1f4857,null))[_0x4f51('0x2b')](function(_0x4ebf78){if(_0x4ebf78){return _0x4ebf78[_0x4f51('0x8c')](_0x24157b[_0x4f51('0x5a')][_0x4f51('0x78')],_['omit'](_0x24157b[_0x4f51('0x5a')],[_0x4f51('0x78'),'id'])||{})['spread'](function(_0x2fc611){for(var _0x26f207=0x0;_0x26f207<_0x24157b['body'][_0x4f51('0x78')][_0x4f51('0x3e')];_0x26f207+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x24157b[_0x4f51('0x5a')][_0x4f51('0x78')][_0x26f207]),'OpenchannelQueueId':Number(_0x24157b[_0x4f51('0x4e')]['id'])});}return _0x2fc611;});}})['then'](respondWithResult(_0x1f4857,null))['catch'](handleError(_0x1f4857,null));};exports[_0x4f51('0x8d')]=function(_0x1a3497,_0x2389bb,_0x270616){return db[_0x4f51('0x33')][_0x4f51('0x4f')]({'where':{'id':_0x1a3497[_0x4f51('0x4e')]['id']}})[_0x4f51('0x2b')](handleEntityNotFound(_0x2389bb,null))[_0x4f51('0x2b')](function(_0x2594c2){if(_0x2594c2){return _0x2594c2['removeAgents'](_0x1a3497[_0x4f51('0x37')][_0x4f51('0x78')])[_0x4f51('0x2b')](function(){if(_['isArray'](_0x1a3497[_0x4f51('0x37')][_0x4f51('0x78')])){for(var _0x39c0c0=0x0;_0x39c0c0<_0x1a3497[_0x4f51('0x37')][_0x4f51('0x78')][_0x4f51('0x3e')];_0x39c0c0+=0x1){socket['emit'](_0x4f51('0x8b'),{'UserId':Number(_0x1a3497[_0x4f51('0x37')][_0x4f51('0x78')][_0x39c0c0]),'OpenchannelQueueId':Number(_0x1a3497[_0x4f51('0x4e')]['id'])});}}else{socket[_0x4f51('0x8a')](_0x4f51('0x8b'),{'UserId':Number(_0x1a3497[_0x4f51('0x37')][_0x4f51('0x78')]),'OpenchannelQueueId':Number(_0x1a3497[_0x4f51('0x4e')]['id'])});}});}})[_0x4f51('0x2b')](respondWithStatusCode(_0x2389bb,null))[_0x4f51('0x50')](handleError(_0x2389bb,null));};exports[_0x4f51('0x8e')]=function(_0x2faf27,_0x41a219,_0x2a2325){var _0x3e8d70={};var _0x264614={};var _0x325657;var _0x84a65c;return db['OpenchannelQueue'][_0x4f51('0x5d')]({'where':{'id':_0x2faf27['params']['id']}})[_0x4f51('0x2b')](handleEntityNotFound(_0x41a219,null))[_0x4f51('0x2b')](function(_0x14868b){if(_0x14868b){_0x325657=_0x14868b;_0x264614[_0x4f51('0x3b')]=_[_0x4f51('0x38')](db[_0x4f51('0x61')][_0x4f51('0x34')]);_0x264614[_0x4f51('0x37')]=_[_0x4f51('0x38')](_0x2faf27[_0x4f51('0x37')]);_0x264614[_0x4f51('0x39')]=_[_0x4f51('0x3a')](_0x264614['model'],_0x264614[_0x4f51('0x37')]);_0x3e8d70[_0x4f51('0x3d')]=_[_0x4f51('0x3a')](_0x264614[_0x4f51('0x3b')],qs['fields'](_0x2faf27[_0x4f51('0x37')][_0x4f51('0x3c')]));_0x3e8d70[_0x4f51('0x3d')]=_0x3e8d70[_0x4f51('0x3d')][_0x4f51('0x3e')]?_0x3e8d70[_0x4f51('0x3d')]:_0x264614[_0x4f51('0x3b')];_0x3e8d70['order']=qs['sort'](_0x2faf27['query'][_0x4f51('0x41')]);_0x3e8d70[_0x4f51('0x43')]=qs[_0x4f51('0x39')](_[_0x4f51('0x42')](_0x2faf27[_0x4f51('0x37')],_0x264614[_0x4f51('0x39')]));if(_0x2faf27[_0x4f51('0x37')][_0x4f51('0x47')]){_0x3e8d70[_0x4f51('0x43')]=_[_0x4f51('0x44')](_0x3e8d70['where'],{'$or':_['map'](_0x3e8d70[_0x4f51('0x3d')],function(_0x34c6c7){var _0x20a8d1={};_0x20a8d1[_0x34c6c7]={'$like':'%'+_0x2faf27[_0x4f51('0x37')]['filter']+'%'};return _0x20a8d1;})});}_0x3e8d70=_[_0x4f51('0x44')]({},_0x3e8d70,_0x2faf27[_0x4f51('0x48')]);return _0x325657[_0x4f51('0x8e')](_0x3e8d70);}})[_0x4f51('0x2b')](function(_0x199362){if(_0x199362){_0x84a65c=_0x199362[_0x4f51('0x3e')];if(!_0x2faf27[_0x4f51('0x37')][_0x4f51('0x3f')]('nolimit')){_0x3e8d70[_0x4f51('0x23')]=qs['limit'](_0x2faf27[_0x4f51('0x37')][_0x4f51('0x23')]);_0x3e8d70[_0x4f51('0x22')]=qs['offset'](_0x2faf27['query'][_0x4f51('0x22')]);}return _0x325657['getAgents'](_0x3e8d70);}})[_0x4f51('0x2b')](function(_0x4d4344){if(_0x4d4344){return _0x4d4344?{'count':_0x84a65c,'rows':_0x4d4344}:null;}})[_0x4f51('0x2b')](respondWithResult(_0x41a219,null))[_0x4f51('0x50')](handleError(_0x41a219,null));}; \ No newline at end of file +var _0xb3e7=['UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','OpenchannelQueueId','options','findAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','SELECT','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','get','OpenchannelQueues','UserProfileResource','then','error','stack','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','order','where','pick','filter','merge','VIRTUAL','name','OpenchannelQueue','includeAll','catch','params','keys','fields','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xb3e7,0xd1));var _0x7b3e=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xb3e7[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x7b3e('0x0'));var rimraf=require(_0x7b3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b3e('0x2'));var rp=require(_0x7b3e('0x3'));var moment=require(_0x7b3e('0x4'));var BPromise=require(_0x7b3e('0x5'));var Mustache=require(_0x7b3e('0x6'));var util=require(_0x7b3e('0x7'));var path=require(_0x7b3e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b3e('0x9'));var fs=require('fs');var fs_extra=require(_0x7b3e('0xa'));var _=require(_0x7b3e('0xb'));var squel=require(_0x7b3e('0xc'));var crypto=require('crypto');var jsforce=require(_0x7b3e('0xd'));var deskjs=require(_0x7b3e('0xe'));var toCsv=require(_0x7b3e('0xf'));var querystring=require('querystring');var Papa=require(_0x7b3e('0x10'));var Redis=require(_0x7b3e('0x11'));var authService=require(_0x7b3e('0x12'));var qs=require(_0x7b3e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b3e('0x14'));var logger=require(_0x7b3e('0x15'))('api');var utils=require(_0x7b3e('0x16'));var config=require(_0x7b3e('0x17'));var licenseUtil=require(_0x7b3e('0x18'));var db=require(_0x7b3e('0x19'))['db'];config[_0x7b3e('0x1a')]=_['defaults'](config[_0x7b3e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b3e('0x1b'))(new Redis(config[_0x7b3e('0x1a')]));require('./openchannelQueue.socket')[_0x7b3e('0x1c')](socket);function respondWithStatusCode(_0x2e6293,_0x383cc7){_0x383cc7=_0x383cc7||0xcc;return function(_0xd35d0c){if(_0xd35d0c){return _0x2e6293[_0x7b3e('0x1d')](_0x383cc7);}return _0x2e6293[_0x7b3e('0x1e')](_0x383cc7)[_0x7b3e('0x1f')]();};}function respondWithResult(_0x10193e,_0x2e3870){_0x2e3870=_0x2e3870||0xc8;return function(_0x2f8272){if(_0x2f8272){return _0x10193e['status'](_0x2e3870)[_0x7b3e('0x20')](_0x2f8272);}};}function respondWithFilteredResult(_0x42f1d6,_0x5af97c){return function(_0x218636){if(_0x218636){var _0xc238eb=typeof _0x5af97c[_0x7b3e('0x21')]===_0x7b3e('0x22')&&typeof _0x5af97c['limit']===_0x7b3e('0x22');var _0x354565=_0x218636[_0x7b3e('0x23')];var _0x4eeacd=_0xc238eb?0x0:_0x5af97c[_0x7b3e('0x21')];var _0x37d5ba=_0xc238eb?_0x218636[_0x7b3e('0x23')]:_0x5af97c[_0x7b3e('0x21')]+_0x5af97c[_0x7b3e('0x24')];var _0x520fb7;if(_0x37d5ba>=_0x354565){_0x37d5ba=_0x354565;_0x520fb7=0xc8;}else{_0x520fb7=0xce;}_0x42f1d6[_0x7b3e('0x1e')](_0x520fb7);return _0x42f1d6[_0x7b3e('0x25')](_0x7b3e('0x26'),_0x4eeacd+'-'+_0x37d5ba+'/'+_0x354565)[_0x7b3e('0x20')](_0x218636);}return null;};}function patchUpdates(_0x9e45a4){return function(_0x1089b8){try{jsonpatch['apply'](_0x1089b8,_0x9e45a4,!![]);}catch(_0x431dca){return BPromise['reject'](_0x431dca);}return _0x1089b8[_0x7b3e('0x27')]();};}function saveUpdates(_0x85385d,_0x3fb3f9){return function(_0x400c81){if(_0x400c81){return _0x400c81[_0x7b3e('0x28')](_0x85385d)['then'](function(_0x4720b2){return _0x4720b2;});}return null;};}function removeEntity(_0x24765c,_0x12fea6){return function(_0x55a3fc){if(_0x55a3fc){return _0x55a3fc['destroy']()['then'](function(){var _0x38d8b9=_0x55a3fc[_0x7b3e('0x29')]({'plain':!![]});var _0x3e649c=_0x7b3e('0x2a');return db[_0x7b3e('0x2b')]['destroy']({'where':{'type':_0x3e649c,'resourceId':_0x38d8b9['id']}})[_0x7b3e('0x2c')](function(){return _0x55a3fc;});})['then'](function(){_0x24765c['status'](0xcc)[_0x7b3e('0x1f')]();});}};}function handleEntityNotFound(_0x1d81cb,_0x3ca116){return function(_0x2473e9){if(!_0x2473e9){_0x1d81cb['sendStatus'](0x194);}return _0x2473e9;};}function handleError(_0x475bbe,_0x1a82c1){_0x1a82c1=_0x1a82c1||0x1f4;return function(_0x4e3a32){logger[_0x7b3e('0x2d')](_0x4e3a32[_0x7b3e('0x2e')]);if(_0x4e3a32['name']){delete _0x4e3a32['name'];}_0x475bbe['status'](_0x1a82c1)[_0x7b3e('0x2f')](_0x4e3a32);};}exports[_0x7b3e('0x30')]=function(_0xe7e70a,_0x1acdf1){var _0x4b27ff={},_0x95b7ce={},_0x56ec92={'count':0x0,'rows':[]};var _0x24e86c=_[_0x7b3e('0x31')](db['OpenchannelQueue'][_0x7b3e('0x32')],function(_0x1dad86){return{'name':_0x1dad86[_0x7b3e('0x33')],'type':_0x1dad86[_0x7b3e('0x34')][_0x7b3e('0x35')]};});_0x95b7ce['model']=_[_0x7b3e('0x31')](_0x24e86c,'name');_0x95b7ce[_0x7b3e('0x36')]=_['keys'](_0xe7e70a[_0x7b3e('0x36')]);_0x95b7ce[_0x7b3e('0x37')]=_[_0x7b3e('0x38')](_0x95b7ce[_0x7b3e('0x39')],_0x95b7ce[_0x7b3e('0x36')]);_0x4b27ff[_0x7b3e('0x3a')]=_[_0x7b3e('0x38')](_0x95b7ce[_0x7b3e('0x39')],qs['fields'](_0xe7e70a[_0x7b3e('0x36')]['fields']));_0x4b27ff[_0x7b3e('0x3a')]=_0x4b27ff[_0x7b3e('0x3a')]['length']?_0x4b27ff[_0x7b3e('0x3a')]:_0x95b7ce['model'];if(!_0xe7e70a[_0x7b3e('0x36')]['hasOwnProperty']('nolimit')){_0x4b27ff[_0x7b3e('0x24')]=qs['limit'](_0xe7e70a[_0x7b3e('0x36')][_0x7b3e('0x24')]);_0x4b27ff['offset']=qs[_0x7b3e('0x21')](_0xe7e70a[_0x7b3e('0x36')][_0x7b3e('0x21')]);}_0x4b27ff[_0x7b3e('0x3b')]=qs['sort'](_0xe7e70a[_0x7b3e('0x36')]['sort']);_0x4b27ff[_0x7b3e('0x3c')]=qs[_0x7b3e('0x37')](_[_0x7b3e('0x3d')](_0xe7e70a[_0x7b3e('0x36')],_0x95b7ce[_0x7b3e('0x37')]),_0x24e86c);if(_0xe7e70a['query'][_0x7b3e('0x3e')]){_0x4b27ff[_0x7b3e('0x3c')]=_[_0x7b3e('0x3f')](_0x4b27ff[_0x7b3e('0x3c')],{'$or':_['map'](_0x24e86c,function(_0x166248){if(_0x166248[_0x7b3e('0x34')]!==_0x7b3e('0x40')){var _0x99fdc2={};_0x99fdc2[_0x166248[_0x7b3e('0x41')]]={'$like':'%'+_0xe7e70a[_0x7b3e('0x36')][_0x7b3e('0x3e')]+'%'};return _0x99fdc2;}})});}_0x4b27ff=_['merge']({},_0x4b27ff,_0xe7e70a['options']);var _0x443828={'where':_0x4b27ff[_0x7b3e('0x3c')]};return db[_0x7b3e('0x42')][_0x7b3e('0x23')](_0x443828)[_0x7b3e('0x2c')](function(_0x220a2e){_0x56ec92['count']=_0x220a2e;if(_0xe7e70a[_0x7b3e('0x36')][_0x7b3e('0x43')]){_0x4b27ff['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x4b27ff);})[_0x7b3e('0x2c')](function(_0x5e1003){_0x56ec92['rows']=_0x5e1003;return _0x56ec92;})['then'](respondWithFilteredResult(_0x1acdf1,_0x4b27ff))[_0x7b3e('0x44')](handleError(_0x1acdf1,null));};exports['show']=function(_0x5693c4,_0x263ac2){var _0x552c00={'raw':!![],'where':{'id':_0x5693c4[_0x7b3e('0x45')]['id']}},_0x349c8c={};_0x349c8c['model']=_[_0x7b3e('0x46')](db['OpenchannelQueue']['rawAttributes']);_0x349c8c['query']=_[_0x7b3e('0x46')](_0x5693c4[_0x7b3e('0x36')]);_0x349c8c['filters']=_[_0x7b3e('0x38')](_0x349c8c[_0x7b3e('0x39')],_0x349c8c[_0x7b3e('0x36')]);_0x552c00[_0x7b3e('0x3a')]=_[_0x7b3e('0x38')](_0x349c8c[_0x7b3e('0x39')],qs[_0x7b3e('0x47')](_0x5693c4[_0x7b3e('0x36')]['fields']));_0x552c00[_0x7b3e('0x3a')]=_0x552c00[_0x7b3e('0x3a')][_0x7b3e('0x48')]?_0x552c00['attributes']:_0x349c8c[_0x7b3e('0x39')];if(_0x5693c4[_0x7b3e('0x36')][_0x7b3e('0x43')]){_0x552c00['include']=[{'all':!![]}];}_0x552c00=_[_0x7b3e('0x3f')]({},_0x552c00,_0x5693c4['options']);return db[_0x7b3e('0x42')]['find'](_0x552c00)['then'](handleEntityNotFound(_0x263ac2,null))[_0x7b3e('0x2c')](respondWithResult(_0x263ac2,null))[_0x7b3e('0x44')](handleError(_0x263ac2,null));};exports[_0x7b3e('0x49')]=function(_0x3f4780,_0x3de2d6){return db['OpenchannelQueue']['create'](_0x3f4780['body'],{})['then'](function(_0x22fbbf){var _0x421651=_0x3f4780['user']['get']({'plain':!![]});if(!_0x421651)throw new Error(_0x7b3e('0x4a'));if(_0x421651[_0x7b3e('0x4b')]===_0x7b3e('0x4c')){var _0x131cd5=_0x22fbbf[_0x7b3e('0x29')]({'plain':!![]});var _0x2e5259=_0x7b3e('0x2a');return db[_0x7b3e('0x4d')][_0x7b3e('0x4e')]({'where':{'name':_0x2e5259,'userProfileId':_0x421651[_0x7b3e('0x4f')]},'raw':!![]})[_0x7b3e('0x2c')](function(_0x3e4aea){if(_0x3e4aea&&_0x3e4aea['autoAssociation']===0x0){return db[_0x7b3e('0x2b')][_0x7b3e('0x49')]({'name':_0x131cd5[_0x7b3e('0x41')],'resourceId':_0x131cd5['id'],'type':_0x3e4aea[_0x7b3e('0x41')],'sectionId':_0x3e4aea['id']},{})['then'](function(){return _0x22fbbf;});}else{return _0x22fbbf;}})[_0x7b3e('0x44')](function(_0x12515e){logger[_0x7b3e('0x2d')](_0x7b3e('0x50'),_0x12515e);throw _0x12515e;});}return _0x22fbbf;})['then'](respondWithResult(_0x3de2d6,0xc9))[_0x7b3e('0x44')](handleError(_0x3de2d6,null));};exports[_0x7b3e('0x28')]=function(_0xde9ee3,_0x21ad52){if(_0xde9ee3['body']['id']){delete _0xde9ee3[_0x7b3e('0x51')]['id'];}return db[_0x7b3e('0x42')][_0x7b3e('0x4e')]({'where':{'id':_0xde9ee3[_0x7b3e('0x45')]['id']}})['then'](handleEntityNotFound(_0x21ad52,null))[_0x7b3e('0x2c')](saveUpdates(_0xde9ee3[_0x7b3e('0x51')],null))['then'](respondWithResult(_0x21ad52,null))['catch'](handleError(_0x21ad52,null));};exports[_0x7b3e('0x52')]=function(_0x292e2d,_0x56cadf){return db['OpenchannelQueue'][_0x7b3e('0x4e')]({'where':{'id':_0x292e2d['params']['id']}})[_0x7b3e('0x2c')](handleEntityNotFound(_0x56cadf,null))['then'](removeEntity(_0x56cadf,null))[_0x7b3e('0x44')](handleError(_0x56cadf,null));};exports[_0x7b3e('0x53')]=function(_0x16b678,_0x2f8bb8){return db[_0x7b3e('0x42')][_0x7b3e('0x53')]()[_0x7b3e('0x2c')](respondWithResult(_0x2f8bb8,null))[_0x7b3e('0x44')](handleError(_0x2f8bb8,null));};exports[_0x7b3e('0x54')]=function(_0x55c0b5,_0x205715,_0xab6ce6){var _0x2e6ed4={'raw':!![],'where':{}},_0x31ebc3={},_0x2a3f5d;return db[_0x7b3e('0x42')][_0x7b3e('0x55')]({'where':{'id':_0x55c0b5['params']['id']}})[_0x7b3e('0x2c')](handleEntityNotFound(_0x205715,null))[_0x7b3e('0x2c')](function(_0x17296a){if(_0x17296a){_0x2a3f5d=_0x17296a[_0x7b3e('0x29')]({'plain':!![]});_0x31ebc3[_0x7b3e('0x39')]=_[_0x7b3e('0x46')](db[_0x7b3e('0x56')][_0x7b3e('0x32')]);_0x31ebc3[_0x7b3e('0x36')]=_[_0x7b3e('0x46')](_0x55c0b5[_0x7b3e('0x36')]);_0x31ebc3[_0x7b3e('0x37')]=_[_0x7b3e('0x38')](_0x31ebc3['model'],_0x31ebc3[_0x7b3e('0x36')]);_0x2e6ed4[_0x7b3e('0x3a')]=_[_0x7b3e('0x38')](_0x31ebc3[_0x7b3e('0x39')],qs[_0x7b3e('0x47')](_0x55c0b5[_0x7b3e('0x36')][_0x7b3e('0x47')]));_0x2e6ed4['attributes']=_0x2e6ed4['attributes'][_0x7b3e('0x48')]?_0x2e6ed4['attributes']:_0x31ebc3[_0x7b3e('0x39')];if(!_0x55c0b5['query'][_0x7b3e('0x57')](_0x7b3e('0x58'))){_0x2e6ed4[_0x7b3e('0x24')]=qs[_0x7b3e('0x24')](_0x55c0b5[_0x7b3e('0x36')][_0x7b3e('0x24')]);_0x2e6ed4['offset']=qs[_0x7b3e('0x21')](_0x55c0b5['query'][_0x7b3e('0x21')]);}_0x2e6ed4[_0x7b3e('0x3b')]=qs[_0x7b3e('0x59')](_0x55c0b5[_0x7b3e('0x36')][_0x7b3e('0x59')]);_0x2e6ed4[_0x7b3e('0x3c')]=qs[_0x7b3e('0x37')](_['pick'](_0x55c0b5['query'],_0x31ebc3[_0x7b3e('0x37')]));_0x2e6ed4[_0x7b3e('0x3c')][_0x7b3e('0x5a')]=_0x17296a['id'];if(_0x55c0b5[_0x7b3e('0x36')][_0x7b3e('0x3e')]){_0x2e6ed4[_0x7b3e('0x3c')]=_[_0x7b3e('0x3f')](_0x2e6ed4['where'],{'$or':_['map'](_0x2e6ed4['attributes'],function(_0x4d35f){var _0x411069={};_0x411069[_0x4d35f]={'$like':'%'+_0x55c0b5[_0x7b3e('0x36')][_0x7b3e('0x3e')]+'%'};return _0x411069;})});}_0x2e6ed4=_[_0x7b3e('0x3f')]({},_0x2e6ed4,_0x55c0b5[_0x7b3e('0x5b')]);return db[_0x7b3e('0x56')][_0x7b3e('0x5c')](_0x2e6ed4);}})['then'](function(_0x2491af){if(_0x2491af){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x2491af,_0x7b3e('0x5d')),'role':_0x7b3e('0x5e')},'attributes':['id',_0x7b3e('0x41'),_0x7b3e('0x5f'),_0x7b3e('0x60'),'createdAt']});}})['then'](function(_0x30403f){if(_0x30403f){return{'count':_0x30403f[_0x7b3e('0x23')],'rows':_['map'](_0x30403f['rows'],function(_0x332d90){return{'membername':_0x332d90[_0x7b3e('0x41')],'UserId':_0x332d90['id'],'queue_name':_0x2a3f5d['name'],'OpenchannelQueueId':_0x2a3f5d['id'],'interface':util[_0x7b3e('0x61')](_0x7b3e('0x62'),_0x7b3e('0x63'),_0x332d90[_0x7b3e('0x41')]),'penalty':0x0,'paused':_0x332d90[_0x7b3e('0x5f')],'createdAt':_0x332d90[_0x7b3e('0x64')],'updatedAt':_0x332d90[_0x7b3e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7b3e('0x2c')](respondWithFilteredResult(_0x205715,_0x2e6ed4))[_0x7b3e('0x44')](handleError(_0x205715,null));};exports['getTeams']=function(_0x24ec54,_0x3487e7,_0x117bb0){var _0x2a3c5a={};var _0x4d0f08={};var _0x488a38;var _0x8289e5;return db[_0x7b3e('0x42')][_0x7b3e('0x55')]({'where':{'id':_0x24ec54['params']['id']}})[_0x7b3e('0x2c')](handleEntityNotFound(_0x3487e7,null))[_0x7b3e('0x2c')](function(_0x451af8){if(_0x451af8){_0x488a38=_0x451af8;_0x4d0f08[_0x7b3e('0x39')]=_[_0x7b3e('0x46')](db['Team'][_0x7b3e('0x32')]);_0x4d0f08[_0x7b3e('0x36')]=_[_0x7b3e('0x46')](_0x24ec54[_0x7b3e('0x36')]);_0x4d0f08[_0x7b3e('0x37')]=_[_0x7b3e('0x38')](_0x4d0f08['model'],_0x4d0f08['query']);_0x2a3c5a[_0x7b3e('0x3a')]=_['intersection'](_0x4d0f08[_0x7b3e('0x39')],qs['fields'](_0x24ec54[_0x7b3e('0x36')][_0x7b3e('0x47')]));_0x2a3c5a[_0x7b3e('0x3a')]=_0x2a3c5a[_0x7b3e('0x3a')][_0x7b3e('0x48')]?_0x2a3c5a[_0x7b3e('0x3a')]:_0x4d0f08[_0x7b3e('0x39')];_0x2a3c5a['order']=qs[_0x7b3e('0x59')](_0x24ec54[_0x7b3e('0x36')][_0x7b3e('0x59')]);_0x2a3c5a[_0x7b3e('0x3c')]=qs[_0x7b3e('0x37')](_[_0x7b3e('0x3d')](_0x24ec54['query'],_0x4d0f08[_0x7b3e('0x37')]));if(_0x24ec54[_0x7b3e('0x36')][_0x7b3e('0x3e')]){_0x2a3c5a[_0x7b3e('0x3c')]=_[_0x7b3e('0x3f')](_0x2a3c5a[_0x7b3e('0x3c')],{'$or':_[_0x7b3e('0x31')](_0x2a3c5a[_0x7b3e('0x3a')],function(_0x53196d){var _0x1c1360={};_0x1c1360[_0x53196d]={'$like':'%'+_0x24ec54['query'][_0x7b3e('0x3e')]+'%'};return _0x1c1360;})});}_0x2a3c5a=_[_0x7b3e('0x3f')]({},_0x2a3c5a,_0x24ec54[_0x7b3e('0x5b')]);return _0x488a38['getTeams'](_0x2a3c5a);}})['then'](function(_0x5a585a){if(_0x5a585a){_0x8289e5=_0x5a585a[_0x7b3e('0x48')];if(!_0x24ec54[_0x7b3e('0x36')]['hasOwnProperty'](_0x7b3e('0x58'))){_0x2a3c5a[_0x7b3e('0x24')]=qs[_0x7b3e('0x24')](_0x24ec54['query'][_0x7b3e('0x24')]);_0x2a3c5a[_0x7b3e('0x21')]=qs[_0x7b3e('0x21')](_0x24ec54[_0x7b3e('0x36')][_0x7b3e('0x21')]);}return _0x488a38[_0x7b3e('0x65')](_0x2a3c5a);}})[_0x7b3e('0x2c')](function(_0x5b3950){if(_0x5b3950){return _0x5b3950?{'count':_0x8289e5,'rows':_0x5b3950}:null;}})['then'](respondWithResult(_0x3487e7,null))[_0x7b3e('0x44')](handleError(_0x3487e7,null));};exports[_0x7b3e('0x66')]=function(_0xe7804a,_0x42c4da,_0x596e58){var _0x393d43=_0xe7804a[_0x7b3e('0x51')][_0x7b3e('0x67')];return db[_0x7b3e('0x68')][_0x7b3e('0x5c')]({'where':{'id':_0x393d43},'attributes':['id'],'include':[{'model':db[_0x7b3e('0x69')],'as':_0x7b3e('0x6a'),'attributes':['id',_0x7b3e('0x41'),_0x7b3e('0x6b'),_0x7b3e('0x6c'),_0x7b3e('0x6d')],'raw':!![]}]})[_0x7b3e('0x2c')](function(_0x41abf1){if(_0x41abf1){var _0x99bf6e=_[_0x7b3e('0x6e')](_0x41abf1,function(_0x13a8fd){var _0x2566f7=_0x13a8fd[_0x7b3e('0x29')]({'plain':!![]});return _0x2566f7[_0x7b3e('0x6a')];});return db[_0x7b3e('0x42')]['find']({'where':{'id':_0xe7804a[_0x7b3e('0x45')]['id']}})[_0x7b3e('0x2c')](function(_0x2c0a53){return db['sequelize']['transaction'](function(_0x24e4ad){return _0x2c0a53['addTeams'](_0x393d43,{'transaction':_0x24e4ad})[_0x7b3e('0x2c')](function(){return BPromise['each'](_0x99bf6e,function(_0x224ab8){return db[_0x7b3e('0x56')][_0x7b3e('0x6f')]({'where':{'UserId':_0x224ab8['id'],'OpenchannelQueueId':_0xe7804a[_0x7b3e('0x45')]['id']},'transaction':_0x24e4ad});});})[_0x7b3e('0x2c')](function(){_0x99bf6e[_0x7b3e('0x70')](function(_0x2524c7){socket[_0x7b3e('0x71')](_0x7b3e('0x72'),{'UserId':_0x2524c7['id'],'OpenchannelQueueId':_0x2c0a53['id']});});});});});}})[_0x7b3e('0x2c')](respondWithStatusCode(_0x42c4da,null))[_0x7b3e('0x44')](handleError(_0x42c4da,null));};exports[_0x7b3e('0x73')]=function(_0x4cbedd,_0x24d990,_0x3b5a1b){return db[_0x7b3e('0x68')][_0x7b3e('0x5c')]({'where':{'id':_0x4cbedd['query'][_0x7b3e('0x67')]},'attributes':['id'],'include':[{'model':db[_0x7b3e('0x69')],'as':_0x7b3e('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x7b3e('0x2c')](handleEntityNotFound(_0x24d990,null))[_0x7b3e('0x2c')](function(_0x2f9797){var _0x578340=_['map'](_0x2f9797,'id');var _0x5c4613=[];var _0x1d2ea=[];var _0x14b445=squel[_0x7b3e('0x74')]();_0x14b445[_0x7b3e('0x75')](_0x7b3e('0x76'))[_0x7b3e('0x77')]('team_has_openchannel_queues','tq')[_0x7b3e('0x78')](_0x7b3e('0x79'),'ut',_0x7b3e('0x7a'))[_0x7b3e('0x3c')]('OpenchannelQueueId\x20=\x20?',_0x4cbedd['params']['id']);for(var _0x1f3018=0x0;_0x1f3018<_0x2f9797['length'];_0x1f3018+=0x1){let _0x282102=_0x2f9797[_0x1f3018];for(var _0x9720ac=0x0;_0x9720ac<_0x282102[_0x7b3e('0x6a')][_0x7b3e('0x48')];_0x9720ac+=0x1){let _0x3858e6=_0x282102[_0x7b3e('0x6a')][_0x9720ac];var _0x3574a2=_0x14b445[_0x7b3e('0x7b')]();_0x3574a2[_0x7b3e('0x3c')]('ut.UserId\x20=\x20?',_0x3858e6['id']);_0x1d2ea[_0x7b3e('0x7c')](db[_0x7b3e('0x7d')]['query'](_0x3574a2[_0x7b3e('0x7e')](),{'type':db[_0x7b3e('0x7d')]['QueryTypes'][_0x7b3e('0x7f')]})[_0x7b3e('0x2c')](function(_0x399363){if(_0x399363['length']===0x1){return _0x3858e6['id'];}else{var _0x1baaf5=_['every'](_['map'](_0x399363,_0x7b3e('0x80')),function(_0x3b2d8d){return _[_0x7b3e('0x81')](_0x578340,_0x3b2d8d);});if(_0x1baaf5){return _0x3858e6['id'];}}}));}}return BPromise[_0x7b3e('0x82')](_0x1d2ea)[_0x7b3e('0x2c')](function(_0x1b17d3){_0x5c4613=_(_0x5c4613)[_0x7b3e('0x83')](_0x1b17d3)[_0x7b3e('0x84')]()[_0x7b3e('0x85')]();return db[_0x7b3e('0x42')][_0x7b3e('0x4e')]({'where':{'id':_0x4cbedd[_0x7b3e('0x45')]['id']}})[_0x7b3e('0x2c')](function(_0x26d6e2){return db['sequelize'][_0x7b3e('0x86')](function(_0x54c7aa){return _0x26d6e2['removeTeams'](_0x4cbedd[_0x7b3e('0x36')][_0x7b3e('0x67')],{'transaction':_0x54c7aa})[_0x7b3e('0x2c')](function(){if(!_[_0x7b3e('0x87')](_0x5c4613)){return _0x26d6e2[_0x7b3e('0x88')](_0x5c4613,{'transaction':_0x54c7aa});}})[_0x7b3e('0x2c')](function(){_0x5c4613[_0x7b3e('0x70')](function(_0x51b6ad){socket[_0x7b3e('0x71')](_0x7b3e('0x89'),{'UserId':_0x51b6ad,'OpenchannelQueueId':_0x26d6e2['id']});});});});});});})['then'](respondWithStatusCode(_0x24d990,null))['catch'](handleError(_0x24d990,null));};exports[_0x7b3e('0x8a')]=function(_0x3058b,_0x19ee44,_0x187d59){return db[_0x7b3e('0x42')]['find']({'where':{'id':_0x3058b[_0x7b3e('0x45')]['id']}})['then'](handleEntityNotFound(_0x19ee44,null))[_0x7b3e('0x2c')](function(_0x267c2a){if(_0x267c2a){return _0x267c2a['addAgents'](_0x3058b[_0x7b3e('0x51')][_0x7b3e('0x67')],_[_0x7b3e('0x8b')](_0x3058b[_0x7b3e('0x51')],[_0x7b3e('0x67'),'id'])||{})[_0x7b3e('0x8c')](function(_0x595e73){for(var _0x30abfb=0x0;_0x30abfb<_0x3058b[_0x7b3e('0x51')]['ids'][_0x7b3e('0x48')];_0x30abfb+=0x1){socket[_0x7b3e('0x71')](_0x7b3e('0x72'),{'UserId':Number(_0x3058b['body'][_0x7b3e('0x67')][_0x30abfb]),'OpenchannelQueueId':Number(_0x3058b['params']['id'])});}return _0x595e73;});}})[_0x7b3e('0x2c')](respondWithResult(_0x19ee44,null))[_0x7b3e('0x44')](handleError(_0x19ee44,null));};exports[_0x7b3e('0x88')]=function(_0x4edef3,_0x7b81a6,_0x5d59f5){return db[_0x7b3e('0x42')][_0x7b3e('0x4e')]({'where':{'id':_0x4edef3[_0x7b3e('0x45')]['id']}})[_0x7b3e('0x2c')](handleEntityNotFound(_0x7b81a6,null))['then'](function(_0x3fd7d6){if(_0x3fd7d6){return _0x3fd7d6['removeAgents'](_0x4edef3[_0x7b3e('0x36')][_0x7b3e('0x67')])['then'](function(){if(_[_0x7b3e('0x8d')](_0x4edef3[_0x7b3e('0x36')][_0x7b3e('0x67')])){for(var _0xdd4afe=0x0;_0xdd4afe<_0x4edef3[_0x7b3e('0x36')][_0x7b3e('0x67')][_0x7b3e('0x48')];_0xdd4afe+=0x1){socket[_0x7b3e('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4edef3[_0x7b3e('0x36')]['ids'][_0xdd4afe]),'OpenchannelQueueId':Number(_0x4edef3[_0x7b3e('0x45')]['id'])});}}else{socket[_0x7b3e('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4edef3[_0x7b3e('0x36')][_0x7b3e('0x67')]),'OpenchannelQueueId':Number(_0x4edef3['params']['id'])});}});}})[_0x7b3e('0x2c')](respondWithStatusCode(_0x7b81a6,null))[_0x7b3e('0x44')](handleError(_0x7b81a6,null));};exports[_0x7b3e('0x8e')]=function(_0x40f970,_0x3bb740,_0x423a0c){var _0x7c0715={};var _0x482714={};var _0x235c64;var _0x49c5b5;return db[_0x7b3e('0x42')][_0x7b3e('0x55')]({'where':{'id':_0x40f970[_0x7b3e('0x45')]['id']}})[_0x7b3e('0x2c')](handleEntityNotFound(_0x3bb740,null))[_0x7b3e('0x2c')](function(_0xe58e50){if(_0xe58e50){_0x235c64=_0xe58e50;_0x482714[_0x7b3e('0x39')]=_[_0x7b3e('0x46')](db[_0x7b3e('0x69')][_0x7b3e('0x32')]);_0x482714[_0x7b3e('0x36')]=_[_0x7b3e('0x46')](_0x40f970[_0x7b3e('0x36')]);_0x482714['filters']=_[_0x7b3e('0x38')](_0x482714[_0x7b3e('0x39')],_0x482714[_0x7b3e('0x36')]);_0x7c0715['attributes']=_[_0x7b3e('0x38')](_0x482714[_0x7b3e('0x39')],qs['fields'](_0x40f970['query'][_0x7b3e('0x47')]));_0x7c0715[_0x7b3e('0x3a')]=_0x7c0715[_0x7b3e('0x3a')][_0x7b3e('0x48')]?_0x7c0715[_0x7b3e('0x3a')]:_0x482714[_0x7b3e('0x39')];_0x7c0715[_0x7b3e('0x3b')]=qs['sort'](_0x40f970['query'][_0x7b3e('0x59')]);_0x7c0715[_0x7b3e('0x3c')]=qs[_0x7b3e('0x37')](_[_0x7b3e('0x3d')](_0x40f970[_0x7b3e('0x36')],_0x482714[_0x7b3e('0x37')]));if(_0x40f970[_0x7b3e('0x36')][_0x7b3e('0x3e')]){_0x7c0715['where']=_[_0x7b3e('0x3f')](_0x7c0715[_0x7b3e('0x3c')],{'$or':_[_0x7b3e('0x31')](_0x7c0715[_0x7b3e('0x3a')],function(_0x18cc85){var _0x3106e3={};_0x3106e3[_0x18cc85]={'$like':'%'+_0x40f970['query']['filter']+'%'};return _0x3106e3;})});}_0x7c0715=_[_0x7b3e('0x3f')]({},_0x7c0715,_0x40f970[_0x7b3e('0x5b')]);return _0x235c64[_0x7b3e('0x8e')](_0x7c0715);}})[_0x7b3e('0x2c')](function(_0x33d717){if(_0x33d717){_0x49c5b5=_0x33d717[_0x7b3e('0x48')];if(!_0x40f970[_0x7b3e('0x36')][_0x7b3e('0x57')]('nolimit')){_0x7c0715[_0x7b3e('0x24')]=qs[_0x7b3e('0x24')](_0x40f970[_0x7b3e('0x36')][_0x7b3e('0x24')]);_0x7c0715[_0x7b3e('0x21')]=qs[_0x7b3e('0x21')](_0x40f970['query'][_0x7b3e('0x21')]);}return _0x235c64['getAgents'](_0x7c0715);}})['then'](function(_0x206135){if(_0x206135){return _0x206135?{'count':_0x49c5b5,'rows':_0x206135}:null;}})['then'](respondWithResult(_0x3bb740,null))[_0x7b3e('0x44')](handleError(_0x3bb740,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1920b48..2197cea 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 _0x1bd9=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x326704,_0x28e132){var _0x5631a7=function(_0x385a9f){while(--_0x385a9f){_0x326704['push'](_0x326704['shift']());}};_0x5631a7(++_0x28e132);}(_0x1bd9,0xbd));var _0x91bd=function(_0x1c0b60,_0xd42072){_0x1c0b60=_0x1c0b60-0x0;var _0x21044b=_0x1bd9[_0x1c0b60];return _0x21044b;};'use strict';var EventEmitter=require(_0x91bd('0x0'));var OpenchannelQueue=require(_0x91bd('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x91bd('0x2')](0x0);var events={'afterCreate':_0x91bd('0x3'),'afterUpdate':_0x91bd('0x4'),'afterDestroy':_0x91bd('0x5')};function emitEvent(_0x4e0b38){return function(_0x2d2c7e,_0x309c28,_0xe84f2f){OpenchannelQueueEvents[_0x91bd('0x6')](_0x4e0b38+':'+_0x2d2c7e['id'],_0x2d2c7e);OpenchannelQueueEvents[_0x91bd('0x6')](_0x4e0b38,_0x2d2c7e);_0xe84f2f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x91bd('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x1879=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0x2d9adf,_0x2fff47){var _0x3aa401=function(_0xdb465f){while(--_0xdb465f){_0x2d9adf['push'](_0x2d9adf['shift']());}};_0x3aa401(++_0x2fff47);}(_0x1879,0xe0));var _0x9187=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0x1879[_0x106214];return _0x5f5cea;};'use strict';var EventEmitter=require(_0x9187('0x0'));var OpenchannelQueue=require(_0x9187('0x1'))['db'][_0x9187('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9187('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x23c9c7){return function(_0x5b6bd3,_0x30e16d,_0x7fc839){OpenchannelQueueEvents['emit'](_0x23c9c7+':'+_0x5b6bd3['id'],_0x5b6bd3);OpenchannelQueueEvents[_0x9187('0x4')](_0x23c9c7,_0x5b6bd3);_0x7fc839(null);};}for(var e in events){if(events[_0x9187('0x5')](e)){var event=events[e];OpenchannelQueue[_0x9187('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index fba566e..95ae131 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 _0x3cb8=['OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird','request-promise','path','./openchannelQueue.attributes','exports','define'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x3cb8,0x120));var _0x83cb=function(_0x29002d,_0x39353b){_0x29002d=_0x29002d-0x0;var _0x2000ae=_0x3cb8[_0x29002d];return _0x2000ae;};'use strict';var _=require(_0x83cb('0x0'));var util=require(_0x83cb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x83cb('0x2'));var BPromise=require(_0x83cb('0x3'));var rp=require(_0x83cb('0x4'));var fs=require('fs');var path=require(_0x83cb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x83cb('0x6'));module[_0x83cb('0x7')]=function(_0x20aba5,_0x2c1b10){return _0x20aba5[_0x83cb('0x8')](_0x83cb('0x9'),attributes,{'tableName':_0x83cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8990=['request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x1fd3e2,_0x1a6772){var _0x5a9210=function(_0x37e9c3){while(--_0x37e9c3){_0x1fd3e2['push'](_0x1fd3e2['shift']());}};_0x5a9210(++_0x1a6772);}(_0x8990,0xec));var _0x0899=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x8990[_0x4d21ff];return _0x22b554;};'use strict';var _=require(_0x0899('0x0'));var util=require('util');var logger=require(_0x0899('0x1'))('api');var moment=require(_0x0899('0x2'));var BPromise=require(_0x0899('0x3'));var rp=require(_0x0899('0x4'));var fs=require('fs');var path=require(_0x0899('0x5'));var rimraf=require('rimraf');var config=require(_0x0899('0x6'));var attributes=require(_0x0899('0x7'));module[_0x0899('0x8')]=function(_0x3cd391,_0x445557){return _0x3cd391[_0x0899('0x9')](_0x0899('0xa'),attributes,{'tableName':_0x0899('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index d5e770c..5a50d63 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 _0x4586=['socket.io-emitter','register','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4586,0x152));var _0x6458=function(_0x47a204,_0x24b906){_0x47a204=_0x47a204-0x0;var _0x5623fc=_0x4586[_0x47a204];return _0x5623fc;};'use strict';var _=require(_0x6458('0x0'));var util=require(_0x6458('0x1'));var moment=require(_0x6458('0x2'));var BPromise=require('bluebird');var rs=require(_0x6458('0x3'));var fs=require('fs');var Redis=require(_0x6458('0x4'));var db=require(_0x6458('0x5'))['db'];var utils=require(_0x6458('0x6'));var logger=require(_0x6458('0x7'))(_0x6458('0x8'));var config=require('../../config/environment');var jayson=require(_0x6458('0x9'));var client=jayson[_0x6458('0xa')]['http']({'port':0x232a});config[_0x6458('0xb')]=_['defaults'](config[_0x6458('0xb')],{'host':_0x6458('0xc'),'port':0x18eb});var socket=require(_0x6458('0xd'))(new Redis(config[_0x6458('0xb')]));require('./openchannelQueue.socket')[_0x6458('0xe')](socket);function respondWithRpcPromise(_0x2c403e,_0x2646e6,_0x2e2365){return new BPromise(function(_0x5da201,_0x1e49e6){return client[_0x6458('0xf')](_0x2c403e,_0x2e2365)['then'](function(_0x311c24){logger[_0x6458('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x2646e6,_0x6458('0x11'));logger[_0x6458('0x12')](_0x6458('0x13'),_0x2646e6,'request\x20sent',JSON[_0x6458('0x14')](_0x311c24));if(_0x311c24['error']){if(_0x311c24[_0x6458('0x15')][_0x6458('0x16')]===0x1f4){logger[_0x6458('0x15')](_0x6458('0x17'),_0x2646e6,_0x311c24['error'][_0x6458('0x18')]);return _0x1e49e6(_0x311c24[_0x6458('0x15')]['message']);}logger[_0x6458('0x15')](_0x6458('0x17'),_0x2646e6,_0x311c24[_0x6458('0x15')][_0x6458('0x18')]);return _0x5da201(_0x311c24['error']['message']);}else{logger['info'](_0x6458('0x17'),_0x2646e6,_0x6458('0x11'));_0x5da201(_0x311c24[_0x6458('0x19')][_0x6458('0x18')]);}})[_0x6458('0x1a')](function(_0x5ead55){logger[_0x6458('0x15')](_0x6458('0x17'),_0x2646e6,_0x5ead55);_0x1e49e6(_0x5ead55);});});}exports[_0x6458('0x1b')]=function(_0x14178d){var _0x126bf6=this;return new Promise(function(_0x8ff198,_0x3315d7){return db[_0x6458('0x1c')][_0x6458('0x1d')]({'raw':_0x14178d['options']?_0x14178d[_0x6458('0x1e')][_0x6458('0x1f')]===undefined?!![]:![]:!![],'where':_0x14178d[_0x6458('0x1e')]?_0x14178d[_0x6458('0x1e')][_0x6458('0x20')]||null:null,'attributes':_0x14178d[_0x6458('0x1e')]?_0x14178d[_0x6458('0x1e')][_0x6458('0x21')]||null:null,'limit':_0x14178d['options']?_0x14178d['options']['limit']||null:null,'include':_0x14178d[_0x6458('0x1e')]?_0x14178d[_0x6458('0x1e')][_0x6458('0x22')]?_[_0x6458('0x23')](_0x14178d[_0x6458('0x1e')][_0x6458('0x22')],function(_0x15252e){return{'model':db[_0x15252e[_0x6458('0x24')]],'as':_0x15252e['as'],'attributes':_0x15252e[_0x6458('0x21')],'include':_0x15252e[_0x6458('0x22')]?_['map'](_0x15252e['include'],function(_0x5de06e){return{'model':db[_0x5de06e[_0x6458('0x24')]],'as':_0x5de06e['as'],'attributes':_0x5de06e['attributes'],'include':_0x5de06e[_0x6458('0x22')]?_[_0x6458('0x23')](_0x5de06e['include'],function(_0x12ca92){return{'model':db[_0x12ca92[_0x6458('0x24')]],'as':_0x12ca92['as'],'attributes':_0x12ca92[_0x6458('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6458('0x25')](function(_0x1187e7){logger[_0x6458('0x10')](_0x6458('0x1b'),_0x14178d);logger[_0x6458('0x12')]('GetOpenchannelQueue',_0x14178d,JSON['stringify'](_0x1187e7));_0x8ff198(_0x1187e7);})[_0x6458('0x1a')](function(_0x20d4fc){logger[_0x6458('0x15')]('GetOpenchannelQueue',_0x20d4fc[_0x6458('0x18')],_0x14178d);_0x3315d7(_0x126bf6['error'](0x1f4,_0x20d4fc[_0x6458('0x18')]));});});};exports[_0x6458('0x26')]=function(_0x56a3ce){var _0x4ae626=this;return new Promise(function(_0x31a867,_0x5acdc8){return db[_0x6458('0x1c')]['find']({'raw':_0x56a3ce[_0x6458('0x1e')]?_0x56a3ce[_0x6458('0x1e')][_0x6458('0x1f')]===undefined?!![]:![]:!![],'where':_0x56a3ce['options']?_0x56a3ce[_0x6458('0x1e')][_0x6458('0x20')]||null:null,'attributes':_0x56a3ce[_0x6458('0x1e')]?_0x56a3ce['options']['attributes']||null:null,'include':_0x56a3ce[_0x6458('0x1e')]?_0x56a3ce['options'][_0x6458('0x22')]?_[_0x6458('0x23')](_0x56a3ce[_0x6458('0x1e')]['include'],function(_0x381579){return{'model':db[_0x381579[_0x6458('0x24')]],'as':_0x381579['as'],'attributes':_0x381579[_0x6458('0x21')],'include':_0x381579[_0x6458('0x22')]?_['map'](_0x381579[_0x6458('0x22')],function(_0x13469a){return{'model':db[_0x13469a['model']],'as':_0x13469a['as'],'attributes':_0x13469a[_0x6458('0x21')],'include':_0x13469a[_0x6458('0x22')]?_[_0x6458('0x23')](_0x13469a[_0x6458('0x22')],function(_0x3caaad){return{'model':db[_0x3caaad['model']],'as':_0x3caaad['as'],'attributes':_0x3caaad[_0x6458('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6458('0x25')](function(_0x4131d6){logger[_0x6458('0x10')]('ShowOpenchannelQueue',_0x56a3ce);logger[_0x6458('0x12')]('ShowOpenchannelQueue',_0x56a3ce,JSON[_0x6458('0x14')](_0x4131d6));_0x31a867(_0x4131d6);})['catch'](function(_0x71e61a){logger[_0x6458('0x15')](_0x6458('0x26'),_0x71e61a[_0x6458('0x18')],_0x56a3ce);_0x5acdc8(_0x4ae626[_0x6458('0x15')](0x1f4,_0x71e61a['message']));});});}; \ No newline at end of file +var _0x6934=['../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','OpenchannelQueue','options','where','attributes','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','raw','util','moment','../../mysqldb','../../config/utils','rpc'];(function(_0x753026,_0x34dc5c){var _0x443ddf=function(_0x499149){while(--_0x499149){_0x753026['push'](_0x753026['shift']());}};_0x443ddf(++_0x34dc5c);}(_0x6934,0xc7));var _0x4693=function(_0x4e5c43,_0x3f42c6){_0x4e5c43=_0x4e5c43-0x0;var _0x5a2d85=_0x6934[_0x4e5c43];return _0x5a2d85;};'use strict';var _=require('lodash');var util=require(_0x4693('0x0'));var moment=require(_0x4693('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4693('0x2'))['db'];var utils=require(_0x4693('0x3'));var logger=require('../../config/logger')(_0x4693('0x4'));var config=require(_0x4693('0x5'));var jayson=require(_0x4693('0x6'));var client=jayson[_0x4693('0x7')]['http']({'port':0x232a});config[_0x4693('0x8')]=_[_0x4693('0x9')](config[_0x4693('0x8')],{'host':_0x4693('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4693('0x8')]));require(_0x4693('0xb'))[_0x4693('0xc')](socket);function respondWithRpcPromise(_0x47c990,_0x2bf7b7,_0x1a486a){return new BPromise(function(_0x15b7e4,_0x288b50){return client[_0x4693('0xd')](_0x47c990,_0x1a486a)[_0x4693('0xe')](function(_0x71028b){logger[_0x4693('0xf')](_0x4693('0x10'),_0x2bf7b7,'request\x20sent');logger[_0x4693('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2bf7b7,_0x4693('0x12'),JSON[_0x4693('0x13')](_0x71028b));if(_0x71028b[_0x4693('0x14')]){if(_0x71028b[_0x4693('0x14')]['code']===0x1f4){logger['error'](_0x4693('0x10'),_0x2bf7b7,_0x71028b[_0x4693('0x14')][_0x4693('0x15')]);return _0x288b50(_0x71028b[_0x4693('0x14')][_0x4693('0x15')]);}logger[_0x4693('0x14')](_0x4693('0x10'),_0x2bf7b7,_0x71028b[_0x4693('0x14')][_0x4693('0x15')]);return _0x15b7e4(_0x71028b[_0x4693('0x14')][_0x4693('0x15')]);}else{logger[_0x4693('0xf')](_0x4693('0x10'),_0x2bf7b7,'request\x20sent');_0x15b7e4(_0x71028b[_0x4693('0x16')]['message']);}})[_0x4693('0x17')](function(_0x27630c){logger['error'](_0x4693('0x10'),_0x2bf7b7,_0x27630c);_0x288b50(_0x27630c);});});}exports['GetOpenchannelQueue']=function(_0xa52254){var _0x14be55=this;return new Promise(function(_0x123ff7,_0x53b291){return db[_0x4693('0x18')]['findAll']({'raw':_0xa52254[_0x4693('0x19')]?_0xa52254['options']['raw']===undefined?!![]:![]:!![],'where':_0xa52254[_0x4693('0x19')]?_0xa52254[_0x4693('0x19')][_0x4693('0x1a')]||null:null,'attributes':_0xa52254[_0x4693('0x19')]?_0xa52254['options'][_0x4693('0x1b')]||null:null,'limit':_0xa52254[_0x4693('0x19')]?_0xa52254['options']['limit']||null:null,'include':_0xa52254[_0x4693('0x19')]?_0xa52254['options'][_0x4693('0x1c')]?_[_0x4693('0x1d')](_0xa52254['options'][_0x4693('0x1c')],function(_0x4ac372){return{'model':db[_0x4ac372[_0x4693('0x1e')]],'as':_0x4ac372['as'],'attributes':_0x4ac372[_0x4693('0x1b')],'include':_0x4ac372[_0x4693('0x1c')]?_[_0x4693('0x1d')](_0x4ac372['include'],function(_0x2f9574){return{'model':db[_0x2f9574[_0x4693('0x1e')]],'as':_0x2f9574['as'],'attributes':_0x2f9574[_0x4693('0x1b')],'include':_0x2f9574['include']?_[_0x4693('0x1d')](_0x2f9574[_0x4693('0x1c')],function(_0x3c28cf){return{'model':db[_0x3c28cf[_0x4693('0x1e')]],'as':_0x3c28cf['as'],'attributes':_0x3c28cf[_0x4693('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4693('0xe')](function(_0x299e31){logger[_0x4693('0xf')](_0x4693('0x1f'),_0xa52254);logger['debug'](_0x4693('0x1f'),_0xa52254,JSON[_0x4693('0x13')](_0x299e31));_0x123ff7(_0x299e31);})[_0x4693('0x17')](function(_0x3c6203){logger[_0x4693('0x14')]('GetOpenchannelQueue',_0x3c6203[_0x4693('0x15')],_0xa52254);_0x53b291(_0x14be55['error'](0x1f4,_0x3c6203[_0x4693('0x15')]));});});};exports[_0x4693('0x20')]=function(_0x3277cd){var _0x259b76=this;return new Promise(function(_0x106331,_0x436a3c){return db[_0x4693('0x18')]['find']({'raw':_0x3277cd['options']?_0x3277cd[_0x4693('0x19')][_0x4693('0x21')]===undefined?!![]:![]:!![],'where':_0x3277cd[_0x4693('0x19')]?_0x3277cd[_0x4693('0x19')]['where']||null:null,'attributes':_0x3277cd[_0x4693('0x19')]?_0x3277cd['options'][_0x4693('0x1b')]||null:null,'include':_0x3277cd['options']?_0x3277cd[_0x4693('0x19')]['include']?_['map'](_0x3277cd[_0x4693('0x19')][_0x4693('0x1c')],function(_0x37e649){return{'model':db[_0x37e649[_0x4693('0x1e')]],'as':_0x37e649['as'],'attributes':_0x37e649[_0x4693('0x1b')],'include':_0x37e649[_0x4693('0x1c')]?_[_0x4693('0x1d')](_0x37e649['include'],function(_0x8d4e7e){return{'model':db[_0x8d4e7e[_0x4693('0x1e')]],'as':_0x8d4e7e['as'],'attributes':_0x8d4e7e[_0x4693('0x1b')],'include':_0x8d4e7e[_0x4693('0x1c')]?_['map'](_0x8d4e7e['include'],function(_0x134356){return{'model':db[_0x134356['model']],'as':_0x134356['as'],'attributes':_0x134356[_0x4693('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4693('0xe')](function(_0x4ada6f){logger[_0x4693('0xf')](_0x4693('0x20'),_0x3277cd);logger['debug']('ShowOpenchannelQueue',_0x3277cd,JSON['stringify'](_0x4ada6f));_0x106331(_0x4ada6f);})[_0x4693('0x17')](function(_0x4b70ca){logger['error'](_0x4693('0x20'),_0x4b70ca[_0x4693('0x15')],_0x3277cd);_0x436a3c(_0x259b76[_0x4693('0x14')](0x1f4,_0x4b70ca['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4b1dfcb..0b21de3 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 _0x716d=['emit','removeListener','register','length','remove','update'];(function(_0x29cdb8,_0x33a9d6){var _0x42f164=function(_0x28978e){while(--_0x28978e){_0x29cdb8['push'](_0x29cdb8['shift']());}};_0x42f164(++_0x33a9d6);}(_0x716d,0x1de));var _0xd716=function(_0x361acc,_0x245081){_0x361acc=_0x361acc-0x0;var _0x44fade=_0x716d[_0x361acc];return _0x44fade;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xd716('0x0'),_0xd716('0x1')];function createListener(_0x4d4393,_0x179cad){return function(_0x207639){_0x179cad[_0xd716('0x2')](_0x4d4393,_0x207639);};}function removeListener(_0xfd19c5,_0x33a7d7){return function(){OpenchannelQueueEvents[_0xd716('0x3')](_0xfd19c5,_0x33a7d7);};}exports[_0xd716('0x4')]=function(_0x155311){for(var _0x7f78eb=0x0,_0x2cc398=events[_0xd716('0x5')];_0x7f78eb<_0x2cc398;_0x7f78eb++){var _0x9a2cd1=events[_0x7f78eb];var _0x382f68=createListener('openchannelQueue:'+_0x9a2cd1,_0x155311);OpenchannelQueueEvents['on'](_0x9a2cd1,_0x382f68);}}; \ No newline at end of file +var _0x9200=['length','openchannelQueue:','remove','emit'];(function(_0x246422,_0x4367e5){var _0xe86ae7=function(_0x5750b1){while(--_0x5750b1){_0x246422['push'](_0x246422['shift']());}};_0xe86ae7(++_0x4367e5);}(_0x9200,0x6e));var _0x0920=function(_0x50aa29,_0x514228){_0x50aa29=_0x50aa29-0x0;var _0x45c679=_0x9200[_0x50aa29];return _0x45c679;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x0920('0x0'),'update'];function createListener(_0x3c1875,_0x44c85f){return function(_0x263fd3){_0x44c85f[_0x0920('0x1')](_0x3c1875,_0x263fd3);};}function removeListener(_0x24ecd5,_0x19cdf5){return function(){OpenchannelQueueEvents['removeListener'](_0x24ecd5,_0x19cdf5);};}exports['register']=function(_0x38bcac){for(var _0x10ece6=0x0,_0x2b4a77=events[_0x0920('0x2')];_0x10ece6<_0x2b4a77;_0x10ece6++){var _0x59d387=events[_0x10ece6];var _0xe54e59=createListener(_0x0920('0x3')+_0x59d387,_0x38bcac);OpenchannelQueueEvents['on'](_0x59d387,_0xe54e59);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ea2cef1..5429b1f 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 _0x1f83=['../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x1f83,0x19f));var _0x31f8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1f83[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x31f8('0x0'));var util=require(_0x31f8('0x1'));var path=require(_0x31f8('0x2'));var timeout=require(_0x31f8('0x3'));var express=require('express');var router=express[_0x31f8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x31f8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31f8('0x6'));router[_0x31f8('0x7')]('/',auth[_0x31f8('0x8')](),controller[_0x31f8('0x9')]);router[_0x31f8('0x7')](_0x31f8('0xa'),auth[_0x31f8('0x8')](),controller[_0x31f8('0xb')]);router[_0x31f8('0x7')](_0x31f8('0xc'),auth['isAuthenticated'](),controller[_0x31f8('0xd')]);router[_0x31f8('0xe')]('/',auth[_0x31f8('0x8')](),controller[_0x31f8('0xf')]);router[_0x31f8('0x10')](_0x31f8('0xc'),auth[_0x31f8('0x8')](),controller['update']);router[_0x31f8('0x11')](_0x31f8('0xc'),auth[_0x31f8('0x8')](),controller[_0x31f8('0x12')]);module[_0x31f8('0x13')]=router; \ No newline at end of file +var _0x3a9e=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a9e,0x84));var _0xe3a9=function(_0x310eb9,_0x1aed15){_0x310eb9=_0x310eb9-0x0;var _0x28915c=_0x3a9e[_0x310eb9];return _0x28915c;};'use strict';var multer=require(_0xe3a9('0x0'));var util=require('util');var path=require(_0xe3a9('0x1'));var timeout=require('connect-timeout');var express=require(_0xe3a9('0x2'));var router=express['Router']();var fs_extra=require(_0xe3a9('0x3'));var auth=require(_0xe3a9('0x4'));var interaction=require(_0xe3a9('0x5'));var config=require(_0xe3a9('0x6'));var controller=require(_0xe3a9('0x7'));router[_0xe3a9('0x8')]('/',auth[_0xe3a9('0x9')](),controller['index']);router['get'](_0xe3a9('0xa'),auth[_0xe3a9('0x9')](),controller[_0xe3a9('0xb')]);router[_0xe3a9('0x8')](_0xe3a9('0xc'),auth[_0xe3a9('0x9')](),controller[_0xe3a9('0xd')]);router[_0xe3a9('0xe')]('/',auth[_0xe3a9('0x9')](),controller[_0xe3a9('0xf')]);router[_0xe3a9('0x10')]('/:id',auth[_0xe3a9('0x9')](),controller[_0xe3a9('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe3a9('0x12')]);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 96826df..27678fe 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 _0x77aa=['exports','STRING','DATE','moment','sequelize'];(function(_0x1720b1,_0x36595a){var _0x1b230d=function(_0x248127){while(--_0x248127){_0x1720b1['push'](_0x1720b1['shift']());}};_0x1b230d(++_0x36595a);}(_0x77aa,0x161));var _0xa77a=function(_0x4b4b09,_0x5b976f){_0x4b4b09=_0x4b4b09-0x0;var _0x314ded=_0x77aa[_0x4b4b09];return _0x314ded;};'use strict';var moment=require(_0xa77a('0x0'));var Sequelize=require(_0xa77a('0x1'));module[_0xa77a('0x2')]={'uniqueid':{'type':Sequelize[_0xa77a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa77a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa77a('0x4')]},'acceptAt':{'type':Sequelize[_0xa77a('0x4')]},'exitAt':{'type':Sequelize[_0xa77a('0x4')]},'reason':{'type':Sequelize[_0xa77a('0x3')]}}; \ No newline at end of file +var _0xdd05=['sequelize','STRING','DATE','moment'];(function(_0x5dfaa2,_0x387b71){var _0x4685d3=function(_0x733b78){while(--_0x733b78){_0x5dfaa2['push'](_0x5dfaa2['shift']());}};_0x4685d3(++_0x387b71);}(_0xdd05,0xfb));var _0x5dd0=function(_0x4a0b15,_0x54818b){_0x4a0b15=_0x4a0b15-0x0;var _0x54f515=_0xdd05[_0x4a0b15];return _0x54f515;};'use strict';var moment=require(_0x5dd0('0x0'));var Sequelize=require(_0x5dd0('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5dd0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5dd0('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5dd0('0x3')]},'acceptAt':{'type':Sequelize[_0x5dd0('0x3')]},'exitAt':{'type':Sequelize[_0x5dd0('0x3')]},'reason':{'type':Sequelize[_0x5dd0('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6cbe7d2..3f770fb 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 _0xe936=['squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x1f517e,_0x19f8b9){var _0x195738=function(_0x3e1f24){while(--_0x3e1f24){_0x1f517e['push'](_0x1f517e['shift']());}};_0x195738(++_0x19f8b9);}(_0xe936,0x88));var _0x6e93=function(_0x3b2e82,_0x21dd10){_0x3b2e82=_0x3b2e82-0x0;var _0x259c51=_0xe936[_0x3b2e82];return _0x259c51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e93('0x0'));var zipdir=require(_0x6e93('0x1'));var jsonpatch=require(_0x6e93('0x2'));var rp=require('request-promise');var moment=require(_0x6e93('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e93('0x4'));var util=require(_0x6e93('0x5'));var path=require('path');var sox=require(_0x6e93('0x6'));var csv=require(_0x6e93('0x7'));var ejs=require(_0x6e93('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e93('0x9'));var squel=require(_0x6e93('0xa'));var crypto=require(_0x6e93('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6e93('0xc'));var toCsv=require(_0x6e93('0x7'));var querystring=require('querystring');var Papa=require(_0x6e93('0xd'));var Redis=require(_0x6e93('0xe'));var authService=require(_0x6e93('0xf'));var qs=require(_0x6e93('0x10'));var as=require(_0x6e93('0x11'));var hardwareService=require(_0x6e93('0x12'));var logger=require('../../config/logger')(_0x6e93('0x13'));var utils=require(_0x6e93('0x14'));var config=require(_0x6e93('0x15'));var licenseUtil=require(_0x6e93('0x16'));var db=require(_0x6e93('0x17'))['db'];function respondWithStatusCode(_0x2553bd,_0x7fc59a){_0x7fc59a=_0x7fc59a||0xcc;return function(_0x452854){if(_0x452854){return _0x2553bd[_0x6e93('0x18')](_0x7fc59a);}return _0x2553bd[_0x6e93('0x19')](_0x7fc59a)[_0x6e93('0x1a')]();};}function respondWithResult(_0x15dcf0,_0x30563d){_0x30563d=_0x30563d||0xc8;return function(_0x6234e6){if(_0x6234e6){return _0x15dcf0[_0x6e93('0x19')](_0x30563d)[_0x6e93('0x1b')](_0x6234e6);}};}function respondWithFilteredResult(_0x3591f5,_0x3d6bcb){return function(_0x159e2e){if(_0x159e2e){var _0x2aa50c=typeof _0x3d6bcb['offset']===_0x6e93('0x1c')&&typeof _0x3d6bcb['limit']==='undefined';var _0x2c6aae=_0x159e2e[_0x6e93('0x1d')];var _0x1a2766=_0x2aa50c?0x0:_0x3d6bcb[_0x6e93('0x1e')];var _0x496c0c=_0x2aa50c?_0x159e2e['count']:_0x3d6bcb[_0x6e93('0x1e')]+_0x3d6bcb[_0x6e93('0x1f')];var _0x63fcec;if(_0x496c0c>=_0x2c6aae){_0x496c0c=_0x2c6aae;_0x63fcec=0xc8;}else{_0x63fcec=0xce;}_0x3591f5[_0x6e93('0x19')](_0x63fcec);return _0x3591f5[_0x6e93('0x20')](_0x6e93('0x21'),_0x1a2766+'-'+_0x496c0c+'/'+_0x2c6aae)[_0x6e93('0x1b')](_0x159e2e);}return null;};}function patchUpdates(_0x5895ec){return function(_0x3c2b5c){try{jsonpatch[_0x6e93('0x22')](_0x3c2b5c,_0x5895ec,!![]);}catch(_0x26fdb0){return BPromise[_0x6e93('0x23')](_0x26fdb0);}return _0x3c2b5c['save']();};}function saveUpdates(_0x2f6380,_0x43bf9e){return function(_0x90dbf1){if(_0x90dbf1){return _0x90dbf1[_0x6e93('0x24')](_0x2f6380)[_0x6e93('0x25')](function(_0x63cfb7){return _0x63cfb7;});}return null;};}function removeEntity(_0x44e421,_0x3fa1d9){return function(_0x288068){if(_0x288068){return _0x288068[_0x6e93('0x26')]()[_0x6e93('0x25')](function(){_0x44e421[_0x6e93('0x19')](0xcc)[_0x6e93('0x1a')]();});}};}function handleEntityNotFound(_0x44e775,_0x220d5f){return function(_0x4bc3ec){if(!_0x4bc3ec){_0x44e775[_0x6e93('0x18')](0x194);}return _0x4bc3ec;};}function handleError(_0x391d13,_0x35e3b8){_0x35e3b8=_0x35e3b8||0x1f4;return function(_0x449152){logger[_0x6e93('0x27')](_0x449152['stack']);if(_0x449152[_0x6e93('0x28')]){delete _0x449152[_0x6e93('0x28')];}_0x391d13[_0x6e93('0x19')](_0x35e3b8)[_0x6e93('0x29')](_0x449152);};}exports['index']=function(_0x10e33a,_0x46d3cb){var _0x1eab33={},_0x2f9e47={},_0x3faaba={'count':0x0,'rows':[]};var _0x123ddb=_[_0x6e93('0x2a')](db[_0x6e93('0x2b')][_0x6e93('0x2c')],function(_0x3efc0d){return{'name':_0x3efc0d[_0x6e93('0x2d')],'type':_0x3efc0d[_0x6e93('0x2e')]['key']};});_0x2f9e47[_0x6e93('0x2f')]=_[_0x6e93('0x2a')](_0x123ddb,_0x6e93('0x28'));_0x2f9e47[_0x6e93('0x30')]=_['keys'](_0x10e33a[_0x6e93('0x30')]);_0x2f9e47[_0x6e93('0x31')]=_[_0x6e93('0x32')](_0x2f9e47[_0x6e93('0x2f')],_0x2f9e47[_0x6e93('0x30')]);_0x1eab33[_0x6e93('0x33')]=_['intersection'](_0x2f9e47['model'],qs[_0x6e93('0x34')](_0x10e33a['query'][_0x6e93('0x34')]));_0x1eab33[_0x6e93('0x33')]=_0x1eab33[_0x6e93('0x33')][_0x6e93('0x35')]?_0x1eab33['attributes']:_0x2f9e47['model'];if(!_0x10e33a['query']['hasOwnProperty'](_0x6e93('0x36'))){_0x1eab33['limit']=qs[_0x6e93('0x1f')](_0x10e33a['query'][_0x6e93('0x1f')]);_0x1eab33[_0x6e93('0x1e')]=qs['offset'](_0x10e33a['query']['offset']);}_0x1eab33[_0x6e93('0x37')]=qs[_0x6e93('0x38')](_0x10e33a[_0x6e93('0x30')]['sort']);_0x1eab33[_0x6e93('0x39')]=qs['filters'](_[_0x6e93('0x3a')](_0x10e33a['query'],_0x2f9e47[_0x6e93('0x31')]),_0x123ddb);if(_0x10e33a[_0x6e93('0x30')][_0x6e93('0x3b')]){_0x1eab33[_0x6e93('0x39')]=_[_0x6e93('0x3c')](_0x1eab33[_0x6e93('0x39')],{'$or':_['map'](_0x123ddb,function(_0x29c286){if(_0x29c286[_0x6e93('0x2e')]!==_0x6e93('0x3d')){var _0x3ff8f4={};_0x3ff8f4[_0x29c286[_0x6e93('0x28')]]={'$like':'%'+_0x10e33a['query'][_0x6e93('0x3b')]+'%'};return _0x3ff8f4;}})});}_0x1eab33=_['merge']({},_0x1eab33,_0x10e33a['options']);var _0x350141={'where':_0x1eab33[_0x6e93('0x39')]};return db['OpenchannelQueueReport']['count'](_0x350141)['then'](function(_0x44057c){_0x3faaba[_0x6e93('0x1d')]=_0x44057c;if(_0x10e33a[_0x6e93('0x30')]['includeAll']){_0x1eab33[_0x6e93('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x6e93('0x3f')](_0x1eab33);})[_0x6e93('0x25')](function(_0x2a058a){_0x3faaba[_0x6e93('0x40')]=_0x2a058a;return _0x3faaba;})[_0x6e93('0x25')](respondWithFilteredResult(_0x46d3cb,_0x1eab33))[_0x6e93('0x41')](handleError(_0x46d3cb,null));};exports[_0x6e93('0x42')]=function(_0x4ebf3a,_0x11c324){var _0x161161={'raw':!![],'where':{'id':_0x4ebf3a[_0x6e93('0x43')]['id']}},_0x1d420b={};_0x1d420b[_0x6e93('0x2f')]=_['keys'](db[_0x6e93('0x2b')][_0x6e93('0x2c')]);_0x1d420b[_0x6e93('0x30')]=_['keys'](_0x4ebf3a['query']);_0x1d420b[_0x6e93('0x31')]=_[_0x6e93('0x32')](_0x1d420b[_0x6e93('0x2f')],_0x1d420b[_0x6e93('0x30')]);_0x161161[_0x6e93('0x33')]=_['intersection'](_0x1d420b[_0x6e93('0x2f')],qs[_0x6e93('0x34')](_0x4ebf3a[_0x6e93('0x30')][_0x6e93('0x34')]));_0x161161[_0x6e93('0x33')]=_0x161161[_0x6e93('0x33')][_0x6e93('0x35')]?_0x161161[_0x6e93('0x33')]:_0x1d420b[_0x6e93('0x2f')];if(_0x4ebf3a[_0x6e93('0x30')][_0x6e93('0x44')]){_0x161161[_0x6e93('0x3e')]=[{'all':!![]}];}_0x161161=_['merge']({},_0x161161,_0x4ebf3a['options']);return db['OpenchannelQueueReport']['find'](_0x161161)[_0x6e93('0x25')](handleEntityNotFound(_0x11c324,null))[_0x6e93('0x25')](respondWithResult(_0x11c324,null))['catch'](handleError(_0x11c324,null));};exports[_0x6e93('0x45')]=function(_0x2937e4,_0x2fde28){return db[_0x6e93('0x2b')][_0x6e93('0x45')](_0x2937e4[_0x6e93('0x46')],{})[_0x6e93('0x25')](respondWithResult(_0x2fde28,0xc9))[_0x6e93('0x41')](handleError(_0x2fde28,null));};exports[_0x6e93('0x24')]=function(_0x44bd09,_0x2b61b3){if(_0x44bd09[_0x6e93('0x46')]['id']){delete _0x44bd09[_0x6e93('0x46')]['id'];}return db[_0x6e93('0x2b')][_0x6e93('0x47')]({'where':{'id':_0x44bd09[_0x6e93('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b61b3,null))[_0x6e93('0x25')](saveUpdates(_0x44bd09['body'],null))[_0x6e93('0x25')](respondWithResult(_0x2b61b3,null))[_0x6e93('0x41')](handleError(_0x2b61b3,null));};exports['destroy']=function(_0x537ab0,_0x1c1d1e){return db[_0x6e93('0x2b')][_0x6e93('0x47')]({'where':{'id':_0x537ab0['params']['id']}})[_0x6e93('0x25')](handleEntityNotFound(_0x1c1d1e,null))[_0x6e93('0x25')](removeEntity(_0x1c1d1e,null))[_0x6e93('0x41')](handleError(_0x1c1d1e,null));};exports[_0x6e93('0x48')]=function(_0x2909c6,_0x474eeb){return db['OpenchannelQueueReport'][_0x6e93('0x48')]()['then'](respondWithResult(_0x474eeb,null))[_0x6e93('0x41')](handleError(_0x474eeb,null));}; \ No newline at end of file +var _0xf1a1=['type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','stack','send','OpenchannelQueueReport','rawAttributes'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf1a1,0x69));var _0x1f1a=function(_0x5debab,_0x2abef8){_0x5debab=_0x5debab-0x0;var _0x20333e=_0xf1a1[_0x5debab];return _0x20333e;};'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(_0x1f1a('0x0'));var Mustache=require(_0x1f1a('0x1'));var util=require(_0x1f1a('0x2'));var path=require(_0x1f1a('0x3'));var sox=require(_0x1f1a('0x4'));var csv=require(_0x1f1a('0x5'));var ejs=require(_0x1f1a('0x6'));var fs=require('fs');var fs_extra=require(_0x1f1a('0x7'));var _=require(_0x1f1a('0x8'));var squel=require(_0x1f1a('0x9'));var crypto=require(_0x1f1a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1f1a('0x5'));var querystring=require(_0x1f1a('0xb'));var Papa=require(_0x1f1a('0xc'));var Redis=require(_0x1f1a('0xd'));var authService=require(_0x1f1a('0xe'));var qs=require(_0x1f1a('0xf'));var as=require(_0x1f1a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f1a('0x11'))(_0x1f1a('0x12'));var utils=require(_0x1f1a('0x13'));var config=require(_0x1f1a('0x14'));var licenseUtil=require(_0x1f1a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d1044,_0x355d1b){_0x355d1b=_0x355d1b||0xcc;return function(_0x3f4c59){if(_0x3f4c59){return _0x4d1044[_0x1f1a('0x16')](_0x355d1b);}return _0x4d1044[_0x1f1a('0x17')](_0x355d1b)[_0x1f1a('0x18')]();};}function respondWithResult(_0x351d38,_0x5580ec){_0x5580ec=_0x5580ec||0xc8;return function(_0x139b3a){if(_0x139b3a){return _0x351d38[_0x1f1a('0x17')](_0x5580ec)[_0x1f1a('0x19')](_0x139b3a);}};}function respondWithFilteredResult(_0x49e8e4,_0x456673){return function(_0x2db0cb){if(_0x2db0cb){var _0x5bd5e4=typeof _0x456673[_0x1f1a('0x1a')]==='undefined'&&typeof _0x456673[_0x1f1a('0x1b')]===_0x1f1a('0x1c');var _0x369ccc=_0x2db0cb['count'];var _0x17b433=_0x5bd5e4?0x0:_0x456673['offset'];var _0x45801f=_0x5bd5e4?_0x2db0cb[_0x1f1a('0x1d')]:_0x456673[_0x1f1a('0x1a')]+_0x456673[_0x1f1a('0x1b')];var _0x256548;if(_0x45801f>=_0x369ccc){_0x45801f=_0x369ccc;_0x256548=0xc8;}else{_0x256548=0xce;}_0x49e8e4[_0x1f1a('0x17')](_0x256548);return _0x49e8e4['set'](_0x1f1a('0x1e'),_0x17b433+'-'+_0x45801f+'/'+_0x369ccc)[_0x1f1a('0x19')](_0x2db0cb);}return null;};}function patchUpdates(_0x398a39){return function(_0x23de83){try{jsonpatch[_0x1f1a('0x1f')](_0x23de83,_0x398a39,!![]);}catch(_0x150671){return BPromise[_0x1f1a('0x20')](_0x150671);}return _0x23de83['save']();};}function saveUpdates(_0x2b51ab,_0x33cc4b){return function(_0x5eac8b){if(_0x5eac8b){return _0x5eac8b[_0x1f1a('0x21')](_0x2b51ab)[_0x1f1a('0x22')](function(_0x29915f){return _0x29915f;});}return null;};}function removeEntity(_0x2f77b5,_0x1cf232){return function(_0x22b734){if(_0x22b734){return _0x22b734['destroy']()[_0x1f1a('0x22')](function(){_0x2f77b5[_0x1f1a('0x17')](0xcc)[_0x1f1a('0x18')]();});}};}function handleEntityNotFound(_0x2a8f5a,_0x344430){return function(_0x190066){if(!_0x190066){_0x2a8f5a['sendStatus'](0x194);}return _0x190066;};}function handleError(_0x1e006b,_0x37e436){_0x37e436=_0x37e436||0x1f4;return function(_0x21a8d0){logger['error'](_0x21a8d0[_0x1f1a('0x23')]);if(_0x21a8d0['name']){delete _0x21a8d0['name'];}_0x1e006b[_0x1f1a('0x17')](_0x37e436)[_0x1f1a('0x24')](_0x21a8d0);};}exports['index']=function(_0x382701,_0x3942a2){var _0xdd6aa0={},_0x17e93a={},_0x43a28b={'count':0x0,'rows':[]};var _0x4b2b1c=_['map'](db[_0x1f1a('0x25')][_0x1f1a('0x26')],function(_0x276414){return{'name':_0x276414['fieldName'],'type':_0x276414[_0x1f1a('0x27')]['key']};});_0x17e93a[_0x1f1a('0x28')]=_[_0x1f1a('0x29')](_0x4b2b1c,'name');_0x17e93a['query']=_[_0x1f1a('0x2a')](_0x382701[_0x1f1a('0x2b')]);_0x17e93a[_0x1f1a('0x2c')]=_[_0x1f1a('0x2d')](_0x17e93a[_0x1f1a('0x28')],_0x17e93a[_0x1f1a('0x2b')]);_0xdd6aa0['attributes']=_['intersection'](_0x17e93a[_0x1f1a('0x28')],qs[_0x1f1a('0x2e')](_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x2e')]));_0xdd6aa0['attributes']=_0xdd6aa0[_0x1f1a('0x2f')][_0x1f1a('0x30')]?_0xdd6aa0[_0x1f1a('0x2f')]:_0x17e93a['model'];if(!_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x31')](_0x1f1a('0x32'))){_0xdd6aa0[_0x1f1a('0x1b')]=qs[_0x1f1a('0x1b')](_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x1b')]);_0xdd6aa0[_0x1f1a('0x1a')]=qs['offset'](_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x1a')]);}_0xdd6aa0[_0x1f1a('0x33')]=qs['sort'](_0x382701['query'][_0x1f1a('0x34')]);_0xdd6aa0[_0x1f1a('0x35')]=qs[_0x1f1a('0x2c')](_[_0x1f1a('0x36')](_0x382701[_0x1f1a('0x2b')],_0x17e93a[_0x1f1a('0x2c')]),_0x4b2b1c);if(_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x37')]){_0xdd6aa0[_0x1f1a('0x35')]=_[_0x1f1a('0x38')](_0xdd6aa0['where'],{'$or':_[_0x1f1a('0x29')](_0x4b2b1c,function(_0x9596a4){if(_0x9596a4[_0x1f1a('0x27')]!==_0x1f1a('0x39')){var _0x5cb215={};_0x5cb215[_0x9596a4[_0x1f1a('0x3a')]]={'$like':'%'+_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x37')]+'%'};return _0x5cb215;}})});}_0xdd6aa0=_[_0x1f1a('0x38')]({},_0xdd6aa0,_0x382701['options']);var _0x119007={'where':_0xdd6aa0['where']};return db[_0x1f1a('0x25')][_0x1f1a('0x1d')](_0x119007)[_0x1f1a('0x22')](function(_0x3de535){_0x43a28b['count']=_0x3de535;if(_0x382701[_0x1f1a('0x2b')][_0x1f1a('0x3b')]){_0xdd6aa0[_0x1f1a('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x1f1a('0x3d')](_0xdd6aa0);})[_0x1f1a('0x22')](function(_0x4c59aa){_0x43a28b[_0x1f1a('0x3e')]=_0x4c59aa;return _0x43a28b;})[_0x1f1a('0x22')](respondWithFilteredResult(_0x3942a2,_0xdd6aa0))[_0x1f1a('0x3f')](handleError(_0x3942a2,null));};exports[_0x1f1a('0x40')]=function(_0x4035ab,_0x5deb90){var _0x1b70f9={'raw':!![],'where':{'id':_0x4035ab[_0x1f1a('0x41')]['id']}},_0x4b9d62={};_0x4b9d62[_0x1f1a('0x28')]=_[_0x1f1a('0x2a')](db[_0x1f1a('0x25')][_0x1f1a('0x26')]);_0x4b9d62[_0x1f1a('0x2b')]=_['keys'](_0x4035ab['query']);_0x4b9d62[_0x1f1a('0x2c')]=_['intersection'](_0x4b9d62['model'],_0x4b9d62[_0x1f1a('0x2b')]);_0x1b70f9[_0x1f1a('0x2f')]=_[_0x1f1a('0x2d')](_0x4b9d62[_0x1f1a('0x28')],qs[_0x1f1a('0x2e')](_0x4035ab[_0x1f1a('0x2b')][_0x1f1a('0x2e')]));_0x1b70f9['attributes']=_0x1b70f9[_0x1f1a('0x2f')][_0x1f1a('0x30')]?_0x1b70f9[_0x1f1a('0x2f')]:_0x4b9d62[_0x1f1a('0x28')];if(_0x4035ab[_0x1f1a('0x2b')][_0x1f1a('0x3b')]){_0x1b70f9[_0x1f1a('0x3c')]=[{'all':!![]}];}_0x1b70f9=_['merge']({},_0x1b70f9,_0x4035ab[_0x1f1a('0x42')]);return db[_0x1f1a('0x25')][_0x1f1a('0x43')](_0x1b70f9)[_0x1f1a('0x22')](handleEntityNotFound(_0x5deb90,null))[_0x1f1a('0x22')](respondWithResult(_0x5deb90,null))[_0x1f1a('0x3f')](handleError(_0x5deb90,null));};exports['create']=function(_0x23d070,_0x5baae3){return db[_0x1f1a('0x25')][_0x1f1a('0x44')](_0x23d070['body'],{})[_0x1f1a('0x22')](respondWithResult(_0x5baae3,0xc9))[_0x1f1a('0x3f')](handleError(_0x5baae3,null));};exports[_0x1f1a('0x21')]=function(_0x331281,_0x3c0806){if(_0x331281[_0x1f1a('0x45')]['id']){delete _0x331281[_0x1f1a('0x45')]['id'];}return db[_0x1f1a('0x25')]['find']({'where':{'id':_0x331281['params']['id']}})[_0x1f1a('0x22')](handleEntityNotFound(_0x3c0806,null))[_0x1f1a('0x22')](saveUpdates(_0x331281['body'],null))[_0x1f1a('0x22')](respondWithResult(_0x3c0806,null))[_0x1f1a('0x3f')](handleError(_0x3c0806,null));};exports[_0x1f1a('0x46')]=function(_0x21009d,_0xa34c62){return db[_0x1f1a('0x25')][_0x1f1a('0x43')]({'where':{'id':_0x21009d['params']['id']}})[_0x1f1a('0x22')](handleEntityNotFound(_0xa34c62,null))[_0x1f1a('0x22')](removeEntity(_0xa34c62,null))['catch'](handleError(_0xa34c62,null));};exports[_0x1f1a('0x47')]=function(_0xdf23ba,_0x5d7a6a){return db['OpenchannelQueueReport'][_0x1f1a('0x47')]()[_0x1f1a('0x22')](respondWithResult(_0x5d7a6a,null))[_0x1f1a('0x3f')](handleError(_0x5d7a6a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 83f8158..4571fff 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x59c056,_0xbfb8ac){var _0x33f48d=function(_0x541abc){while(--_0x541abc){_0x59c056['push'](_0x59c056['shift']());}};_0x33f48d(++_0xbfb8ac);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x5fc3[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x573203,_0x2f2246){var _0x3b7167=function(_0x4716e9){while(--_0x4716e9){_0x573203['push'](_0x573203['shift']());}};_0x3b7167(++_0x2f2246);}(_0x7a54,0x106));var _0x47a5=function(_0x3b44b2,_0x5690){_0x3b44b2=_0x3b44b2-0x0;var _0xfa21dc=_0x7a54[_0x3b44b2];return _0xfa21dc;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 1aa0024..21525c3 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 _0x7fea=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','debug','stringify','update','body','where','attributes','limit','UpdateOpenchannelQueueReport','util'];(function(_0x88bc08,_0x3f03c3){var _0x501784=function(_0x3ff779){while(--_0x3ff779){_0x88bc08['push'](_0x88bc08['shift']());}};_0x501784(++_0x3f03c3);}(_0x7fea,0x149));var _0xa7fe=function(_0x2ed612,_0x5090f5){_0x2ed612=_0x2ed612-0x0;var _0xff695b=_0x7fea[_0x2ed612];return _0xff695b;};'use strict';var _=require('lodash');var util=require(_0xa7fe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa7fe('0x1'));var fs=require('fs');var Redis=require(_0xa7fe('0x2'));var db=require(_0xa7fe('0x3'))['db'];var utils=require(_0xa7fe('0x4'));var logger=require(_0xa7fe('0x5'))(_0xa7fe('0x6'));var config=require('../../config/environment');var jayson=require(_0xa7fe('0x7'));var client=jayson[_0xa7fe('0x8')][_0xa7fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1132f1,_0x45f967,_0x3597b0){return new BPromise(function(_0x4668f0,_0x3d9135){return client['request'](_0x1132f1,_0x3597b0)['then'](function(_0x1db10e){logger[_0xa7fe('0xa')](_0xa7fe('0xb'),_0x45f967,_0xa7fe('0xc'));logger['debug'](_0xa7fe('0xd'),_0x45f967,_0xa7fe('0xc'),JSON['stringify'](_0x1db10e));if(_0x1db10e[_0xa7fe('0xe')]){if(_0x1db10e['error'][_0xa7fe('0xf')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x45f967,_0x1db10e[_0xa7fe('0xe')][_0xa7fe('0x10')]);return _0x3d9135(_0x1db10e[_0xa7fe('0xe')][_0xa7fe('0x10')]);}logger[_0xa7fe('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x45f967,_0x1db10e['error'][_0xa7fe('0x10')]);return _0x4668f0(_0x1db10e[_0xa7fe('0xe')][_0xa7fe('0x10')]);}else{logger[_0xa7fe('0xa')](_0xa7fe('0xb'),_0x45f967,'request\x20sent');_0x4668f0(_0x1db10e[_0xa7fe('0x11')][_0xa7fe('0x10')]);}})[_0xa7fe('0x12')](function(_0x253293){logger[_0xa7fe('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x45f967,_0x253293);_0x3d9135(_0x253293);});});}exports[_0xa7fe('0x13')]=function(_0x1e4966){var _0x2bf8db=this;return new Promise(function(_0x2ef53c,_0x179b9e){return db[_0xa7fe('0x14')][_0xa7fe('0x15')](_0x1e4966['body'],{'raw':_0x1e4966['options']?_0x1e4966[_0xa7fe('0x16')][_0xa7fe('0x17')]===undefined?!![]:![]:!![]})[_0xa7fe('0x18')](function(_0x529990){logger[_0xa7fe('0xa')](_0xa7fe('0x13'),_0x1e4966);logger[_0xa7fe('0x19')]('CreateOpenchannelQueueReport',_0x1e4966,JSON[_0xa7fe('0x1a')](_0x529990));_0x2ef53c(_0x529990);})[_0xa7fe('0x12')](function(_0x1619c1){logger[_0xa7fe('0xe')](_0xa7fe('0x13'),_0x1619c1[_0xa7fe('0x10')],_0x1e4966);_0x179b9e(_0x2bf8db[_0xa7fe('0xe')](0x1f4,_0x1619c1[_0xa7fe('0x10')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x3415b8){var _0x4fb801=this;return new Promise(function(_0x4ce2e7,_0x37c8fa){return db[_0xa7fe('0x14')][_0xa7fe('0x1b')](_0x3415b8[_0xa7fe('0x1c')],{'raw':_0x3415b8[_0xa7fe('0x16')]?_0x3415b8['options'][_0xa7fe('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3415b8[_0xa7fe('0x16')]?_0x3415b8[_0xa7fe('0x16')][_0xa7fe('0x1d')]||null:null,'attributes':_0x3415b8[_0xa7fe('0x16')]?_0x3415b8[_0xa7fe('0x16')][_0xa7fe('0x1e')]||null:null,'limit':_0x3415b8[_0xa7fe('0x16')]?_0x3415b8[_0xa7fe('0x16')][_0xa7fe('0x1f')]||null:null})[_0xa7fe('0x18')](function(_0x19dd83){logger[_0xa7fe('0xa')](_0xa7fe('0x20'),_0x3415b8);logger[_0xa7fe('0x19')](_0xa7fe('0x20'),_0x3415b8,JSON[_0xa7fe('0x1a')](_0x19dd83));_0x4ce2e7(_0x19dd83);})[_0xa7fe('0x12')](function(_0x1c9e5a){logger[_0xa7fe('0xe')]('UpdateOpenchannelQueueReport',_0x1c9e5a[_0xa7fe('0x10')],_0x3415b8);_0x37c8fa(_0x4fb801[_0xa7fe('0xe')](0x1f4,_0x1c9e5a['message']));});});}; \ No newline at end of file +var _0xd4f4=['options','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelQueueReport','create','body'];(function(_0x548ebc,_0x8395d0){var _0x228ab5=function(_0x532213){while(--_0x532213){_0x548ebc['push'](_0x548ebc['shift']());}};_0x228ab5(++_0x8395d0);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x32ba0a,_0x313b51){_0x32ba0a=_0x32ba0a-0x0;var _0x4cabfb=_0xd4f4[_0x32ba0a];return _0x4cabfb;};'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']('OpenchannelQueueReport,\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')]('OpenchannelQueueReport,\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['OpenchannelQueueReport'][_0x4d4f('0x18')](_0x51dcf1[_0x4d4f('0x19')],{'raw':_0x51dcf1[_0x4d4f('0x1a')]?_0x51dcf1[_0x4d4f('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e1ae2){logger['info'](_0x4d4f('0x17'),_0x51dcf1);logger[_0x4d4f('0x10')](_0x4d4f('0x17'),_0x51dcf1,JSON[_0x4d4f('0x12')](_0x1e1ae2));_0x519501(_0x1e1ae2);})[_0x4d4f('0x16')](function(_0x5beab4){logger['error'](_0x4d4f('0x17'),_0x5beab4['message'],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x5beab4[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x1b')]=function(_0x3f4a55){var _0xf3f7a4=this;return new Promise(function(_0x497cec,_0x44bd2f){return db[_0x4d4f('0x1c')][_0x4d4f('0x1d')](_0x3f4a55[_0x4d4f('0x19')],{'raw':_0x3f4a55['options']?_0x3f4a55['options'][_0x4d4f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x1f')]||null:null,'attributes':_0x3f4a55['options']?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x20')]||null:null,'limit':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')]['limit']||null:null})[_0x4d4f('0xc')](function(_0x51cb3d){logger[_0x4d4f('0xd')](_0x4d4f('0x1b'),_0x3f4a55);logger['debug'](_0x4d4f('0x1b'),_0x3f4a55,JSON[_0x4d4f('0x12')](_0x51cb3d));_0x497cec(_0x51cb3d);})[_0x4d4f('0x16')](function(_0x3d7f14){logger[_0x4d4f('0x13')](_0x4d4f('0x1b'),_0x3d7f14['message'],_0x3f4a55);_0x44bd2f(_0xf3f7a4[_0x4d4f('0x13')](0x1f4,_0x3d7f14[_0x4d4f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 86b6c73..8581fdd 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 _0xfc84=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path'];(function(_0x4fda63,_0x48f004){var _0x399f78=function(_0x3062b1){while(--_0x3062b1){_0x4fda63['push'](_0x4fda63['shift']());}};_0x399f78(++_0x48f004);}(_0xfc84,0x11a));var _0x4fc8=function(_0x4c4463,_0x232312){_0x4c4463=_0x4c4463-0x0;var _0x369615=_0xfc84[_0x4c4463];return _0x369615;};'use strict';var multer=require(_0x4fc8('0x0'));var util=require(_0x4fc8('0x1'));var path=require(_0x4fc8('0x2'));var timeout=require(_0x4fc8('0x3'));var express=require(_0x4fc8('0x4'));var router=express['Router']();var fs_extra=require(_0x4fc8('0x5'));var auth=require(_0x4fc8('0x6'));var interaction=require(_0x4fc8('0x7'));var config=require('../../config/environment');var controller=require(_0x4fc8('0x8'));router[_0x4fc8('0x9')]('/',auth[_0x4fc8('0xa')](),controller[_0x4fc8('0xb')]);router[_0x4fc8('0x9')](_0x4fc8('0xc'),auth[_0x4fc8('0xa')](),controller[_0x4fc8('0xd')]);router[_0x4fc8('0x9')](_0x4fc8('0xe'),auth[_0x4fc8('0xa')](),controller[_0x4fc8('0xf')]);router[_0x4fc8('0x10')]('/',auth[_0x4fc8('0xa')](),controller['create']);router[_0x4fc8('0x11')](_0x4fc8('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x4fc8('0x12')](_0x4fc8('0xe'),auth[_0x4fc8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x91e5=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','post','create','put','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91e5,0x18d));var _0x591e=function(_0x1ed75d,_0x164214){_0x1ed75d=_0x1ed75d-0x0;var _0x12fdfc=_0x91e5[_0x1ed75d];return _0x12fdfc;};'use strict';var multer=require(_0x591e('0x0'));var util=require(_0x591e('0x1'));var path=require(_0x591e('0x2'));var timeout=require(_0x591e('0x3'));var express=require('express');var router=express[_0x591e('0x4')]();var fs_extra=require(_0x591e('0x5'));var auth=require(_0x591e('0x6'));var interaction=require(_0x591e('0x7'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x591e('0x8')]('/',auth[_0x591e('0x9')](),controller['index']);router['get'](_0x591e('0xa'),auth['isAuthenticated'](),controller[_0x591e('0xb')]);router['get'](_0x591e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x591e('0xd')]('/',auth['isAuthenticated'](),controller[_0x591e('0xe')]);router[_0x591e('0xf')](_0x591e('0xc'),auth[_0x591e('0x9')](),controller['update']);router[_0x591e('0x10')](_0x591e('0xc'),auth[_0x591e('0x9')](),controller[_0x591e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6d619d0..6bb3a9f 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4310e8,_0x3ba783){var _0x301445=function(_0x5907ee){while(--_0x5907ee){_0x4310e8['push'](_0x4310e8['shift']());}};_0x301445(++_0x3ba783);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3fea13,_0x5ed39c){_0x3fea13=_0x3fea13-0x0;var _0x3e76dc=_0x9bde[_0x3fea13];return _0x3e76dc;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 8f9d5ef..04964b5 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 _0x393e=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','length','find','create','body','params','describe'];(function(_0x131770,_0x49574b){var _0xf34a56=function(_0x372fc7){while(--_0x372fc7){_0x131770['push'](_0x131770['shift']());}};_0xf34a56(++_0x49574b);}(_0x393e,0xde));var _0xe393=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x393e[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0xe393('0x0'));var rimraf=require(_0xe393('0x1'));var zipdir=require(_0xe393('0x2'));var jsonpatch=require(_0xe393('0x3'));var rp=require('request-promise');var moment=require(_0xe393('0x4'));var BPromise=require(_0xe393('0x5'));var Mustache=require('mustache');var util=require(_0xe393('0x6'));var path=require(_0xe393('0x7'));var sox=require('sox');var csv=require(_0xe393('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe393('0x9'));var squel=require(_0xe393('0xa'));var crypto=require(_0xe393('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe393('0xc'));var toCsv=require(_0xe393('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe393('0xd'));var authService=require(_0xe393('0xe'));var qs=require(_0xe393('0xf'));var as=require(_0xe393('0x10'));var hardwareService=require(_0xe393('0x11'));var logger=require(_0xe393('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe393('0x13'));var db=require(_0xe393('0x14'))['db'];function respondWithStatusCode(_0x319ab9,_0x5d8d29){_0x5d8d29=_0x5d8d29||0xcc;return function(_0x1109df){if(_0x1109df){return _0x319ab9[_0xe393('0x15')](_0x5d8d29);}return _0x319ab9[_0xe393('0x16')](_0x5d8d29)[_0xe393('0x17')]();};}function respondWithResult(_0x86ae7,_0x5bfcc1){_0x5bfcc1=_0x5bfcc1||0xc8;return function(_0x2aa218){if(_0x2aa218){return _0x86ae7[_0xe393('0x16')](_0x5bfcc1)['json'](_0x2aa218);}};}function respondWithFilteredResult(_0x5af6a1,_0x32b163){return function(_0x20d2cb){if(_0x20d2cb){var _0x343d74=typeof _0x32b163[_0xe393('0x18')]===_0xe393('0x19')&&typeof _0x32b163['limit']===_0xe393('0x19');var _0x132b10=_0x20d2cb[_0xe393('0x1a')];var _0x3c48da=_0x343d74?0x0:_0x32b163[_0xe393('0x18')];var _0x1410d5=_0x343d74?_0x20d2cb[_0xe393('0x1a')]:_0x32b163[_0xe393('0x18')]+_0x32b163[_0xe393('0x1b')];var _0x433f5c;if(_0x1410d5>=_0x132b10){_0x1410d5=_0x132b10;_0x433f5c=0xc8;}else{_0x433f5c=0xce;}_0x5af6a1[_0xe393('0x16')](_0x433f5c);return _0x5af6a1[_0xe393('0x1c')](_0xe393('0x1d'),_0x3c48da+'-'+_0x1410d5+'/'+_0x132b10)['json'](_0x20d2cb);}return null;};}function patchUpdates(_0x354b13){return function(_0xb19393){try{jsonpatch[_0xe393('0x1e')](_0xb19393,_0x354b13,!![]);}catch(_0x2ea76f){return BPromise[_0xe393('0x1f')](_0x2ea76f);}return _0xb19393[_0xe393('0x20')]();};}function saveUpdates(_0x497d17,_0x278f90){return function(_0x3c448c){if(_0x3c448c){return _0x3c448c[_0xe393('0x21')](_0x497d17)[_0xe393('0x22')](function(_0x3f9de2){return _0x3f9de2;});}return null;};}function removeEntity(_0x526530,_0x668935){return function(_0x4a69cd){if(_0x4a69cd){return _0x4a69cd[_0xe393('0x23')]()[_0xe393('0x22')](function(){_0x526530[_0xe393('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fbacb,_0xd9f430){return function(_0x456417){if(!_0x456417){_0x8fbacb[_0xe393('0x15')](0x194);}return _0x456417;};}function handleError(_0x567b1f,_0x14dd2b){_0x14dd2b=_0x14dd2b||0x1f4;return function(_0x1a3f73){logger[_0xe393('0x24')](_0x1a3f73[_0xe393('0x25')]);if(_0x1a3f73['name']){delete _0x1a3f73[_0xe393('0x26')];}_0x567b1f[_0xe393('0x16')](_0x14dd2b)[_0xe393('0x27')](_0x1a3f73);};}exports[_0xe393('0x28')]=function(_0x55bac5,_0x578b37){var _0x48aca1={},_0x575b1c={},_0x51968d={'count':0x0,'rows':[]};var _0x4a1658=_[_0xe393('0x29')](db[_0xe393('0x2a')][_0xe393('0x2b')],function(_0xf178f6){return{'name':_0xf178f6[_0xe393('0x2c')],'type':_0xf178f6[_0xe393('0x2d')][_0xe393('0x2e')]};});_0x575b1c[_0xe393('0x2f')]=_[_0xe393('0x29')](_0x4a1658,_0xe393('0x26'));_0x575b1c[_0xe393('0x30')]=_[_0xe393('0x31')](_0x55bac5[_0xe393('0x30')]);_0x575b1c[_0xe393('0x32')]=_['intersection'](_0x575b1c['model'],_0x575b1c[_0xe393('0x30')]);_0x48aca1['attributes']=_[_0xe393('0x33')](_0x575b1c[_0xe393('0x2f')],qs['fields'](_0x55bac5[_0xe393('0x30')][_0xe393('0x34')]));_0x48aca1[_0xe393('0x35')]=_0x48aca1['attributes']['length']?_0x48aca1['attributes']:_0x575b1c[_0xe393('0x2f')];if(!_0x55bac5[_0xe393('0x30')][_0xe393('0x36')](_0xe393('0x37'))){_0x48aca1['limit']=qs[_0xe393('0x1b')](_0x55bac5[_0xe393('0x30')][_0xe393('0x1b')]);_0x48aca1[_0xe393('0x18')]=qs[_0xe393('0x18')](_0x55bac5[_0xe393('0x30')][_0xe393('0x18')]);}_0x48aca1[_0xe393('0x38')]=qs[_0xe393('0x39')](_0x55bac5['query'][_0xe393('0x39')]);_0x48aca1[_0xe393('0x3a')]=qs[_0xe393('0x32')](_[_0xe393('0x3b')](_0x55bac5[_0xe393('0x30')],_0x575b1c[_0xe393('0x32')]),_0x4a1658);if(_0x55bac5[_0xe393('0x30')][_0xe393('0x3c')]){_0x48aca1['where']=_[_0xe393('0x3d')](_0x48aca1['where'],{'$or':_[_0xe393('0x29')](_0x4a1658,function(_0x12f37c){if(_0x12f37c[_0xe393('0x2d')]!==_0xe393('0x3e')){var _0x3114dc={};_0x3114dc[_0x12f37c[_0xe393('0x26')]]={'$like':'%'+_0x55bac5[_0xe393('0x30')][_0xe393('0x3c')]+'%'};return _0x3114dc;}})});}_0x48aca1=_[_0xe393('0x3d')]({},_0x48aca1,_0x55bac5[_0xe393('0x3f')]);var _0x5ab517={'where':_0x48aca1['where']};return db['OpenchannelTransferReport']['count'](_0x5ab517)['then'](function(_0x45f85c){_0x51968d['count']=_0x45f85c;if(_0x55bac5[_0xe393('0x30')]['includeAll']){_0x48aca1[_0xe393('0x40')]=[{'all':!![]}];}return db[_0xe393('0x2a')]['findAll'](_0x48aca1);})[_0xe393('0x22')](function(_0x40ab48){_0x51968d[_0xe393('0x41')]=_0x40ab48;return _0x51968d;})[_0xe393('0x22')](respondWithFilteredResult(_0x578b37,_0x48aca1))[_0xe393('0x42')](handleError(_0x578b37,null));};exports[_0xe393('0x43')]=function(_0x3f8e52,_0x10b56e){var _0x25e45e={'raw':!![],'where':{'id':_0x3f8e52['params']['id']}},_0x1d7bf1={};_0x1d7bf1[_0xe393('0x2f')]=_[_0xe393('0x31')](db[_0xe393('0x2a')][_0xe393('0x2b')]);_0x1d7bf1[_0xe393('0x30')]=_[_0xe393('0x31')](_0x3f8e52[_0xe393('0x30')]);_0x1d7bf1[_0xe393('0x32')]=_['intersection'](_0x1d7bf1[_0xe393('0x2f')],_0x1d7bf1[_0xe393('0x30')]);_0x25e45e[_0xe393('0x35')]=_[_0xe393('0x33')](_0x1d7bf1[_0xe393('0x2f')],qs[_0xe393('0x34')](_0x3f8e52[_0xe393('0x30')][_0xe393('0x34')]));_0x25e45e[_0xe393('0x35')]=_0x25e45e[_0xe393('0x35')][_0xe393('0x44')]?_0x25e45e[_0xe393('0x35')]:_0x1d7bf1[_0xe393('0x2f')];if(_0x3f8e52['query']['includeAll']){_0x25e45e[_0xe393('0x40')]=[{'all':!![]}];}_0x25e45e=_[_0xe393('0x3d')]({},_0x25e45e,_0x3f8e52[_0xe393('0x3f')]);return db['OpenchannelTransferReport'][_0xe393('0x45')](_0x25e45e)[_0xe393('0x22')](handleEntityNotFound(_0x10b56e,null))[_0xe393('0x22')](respondWithResult(_0x10b56e,null))[_0xe393('0x42')](handleError(_0x10b56e,null));};exports['create']=function(_0x118295,_0x56777c){return db[_0xe393('0x2a')][_0xe393('0x46')](_0x118295[_0xe393('0x47')],{})['then'](respondWithResult(_0x56777c,0xc9))[_0xe393('0x42')](handleError(_0x56777c,null));};exports[_0xe393('0x21')]=function(_0xd0090,_0xf99db4){if(_0xd0090['body']['id']){delete _0xd0090['body']['id'];}return db[_0xe393('0x2a')][_0xe393('0x45')]({'where':{'id':_0xd0090[_0xe393('0x48')]['id']}})['then'](handleEntityNotFound(_0xf99db4,null))[_0xe393('0x22')](saveUpdates(_0xd0090[_0xe393('0x47')],null))[_0xe393('0x22')](respondWithResult(_0xf99db4,null))['catch'](handleError(_0xf99db4,null));};exports['destroy']=function(_0x2ed5b2,_0x1ddf4c){return db['OpenchannelTransferReport'][_0xe393('0x45')]({'where':{'id':_0x2ed5b2['params']['id']}})[_0xe393('0x22')](handleEntityNotFound(_0x1ddf4c,null))[_0xe393('0x22')](removeEntity(_0x1ddf4c,null))['catch'](handleError(_0x1ddf4c,null));};exports['describe']=function(_0x1527fb,_0x2397c2){return db[_0xe393('0x2a')][_0xe393('0x49')]()['then'](respondWithResult(_0x2397c2,null))['catch'](handleError(_0x2397c2,null));}; \ No newline at end of file +var _0xb262=['name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','includeAll','include','findAll','then','rows','catch','show','length','options','find','create','body','params','describe','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0xb262,0xfe));var _0x2b26=function(_0x27c27c,_0x53a14c){_0x27c27c=_0x27c27c-0x0;var _0x5ef7b1=_0xb262[_0x27c27c];return _0x5ef7b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b26('0x0'));var rp=require(_0x2b26('0x1'));var moment=require(_0x2b26('0x2'));var BPromise=require(_0x2b26('0x3'));var Mustache=require(_0x2b26('0x4'));var util=require('util');var path=require(_0x2b26('0x5'));var sox=require(_0x2b26('0x6'));var csv=require(_0x2b26('0x7'));var ejs=require(_0x2b26('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b26('0x9'));var squel=require(_0x2b26('0xa'));var crypto=require(_0x2b26('0xb'));var jsforce=require(_0x2b26('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2b26('0x7'));var querystring=require(_0x2b26('0xd'));var Papa=require(_0x2b26('0xe'));var Redis=require(_0x2b26('0xf'));var authService=require(_0x2b26('0x10'));var qs=require(_0x2b26('0x11'));var as=require(_0x2b26('0x12'));var hardwareService=require(_0x2b26('0x13'));var logger=require('../../config/logger')(_0x2b26('0x14'));var utils=require('../../config/utils');var config=require(_0x2b26('0x15'));var licenseUtil=require(_0x2b26('0x16'));var db=require(_0x2b26('0x17'))['db'];function respondWithStatusCode(_0x4c066a,_0x5e1500){_0x5e1500=_0x5e1500||0xcc;return function(_0xe0c27e){if(_0xe0c27e){return _0x4c066a['sendStatus'](_0x5e1500);}return _0x4c066a[_0x2b26('0x18')](_0x5e1500)[_0x2b26('0x19')]();};}function respondWithResult(_0x3ee388,_0x372b2f){_0x372b2f=_0x372b2f||0xc8;return function(_0x3d11a1){if(_0x3d11a1){return _0x3ee388[_0x2b26('0x18')](_0x372b2f)['json'](_0x3d11a1);}};}function respondWithFilteredResult(_0x50e572,_0xea9306){return function(_0x42b289){if(_0x42b289){var _0x1ec2e1=typeof _0xea9306[_0x2b26('0x1a')]===_0x2b26('0x1b')&&typeof _0xea9306[_0x2b26('0x1c')]===_0x2b26('0x1b');var _0x50e4ed=_0x42b289[_0x2b26('0x1d')];var _0x9b7196=_0x1ec2e1?0x0:_0xea9306[_0x2b26('0x1a')];var _0xda6019=_0x1ec2e1?_0x42b289['count']:_0xea9306['offset']+_0xea9306[_0x2b26('0x1c')];var _0x5b61ae;if(_0xda6019>=_0x50e4ed){_0xda6019=_0x50e4ed;_0x5b61ae=0xc8;}else{_0x5b61ae=0xce;}_0x50e572[_0x2b26('0x18')](_0x5b61ae);return _0x50e572[_0x2b26('0x1e')](_0x2b26('0x1f'),_0x9b7196+'-'+_0xda6019+'/'+_0x50e4ed)['json'](_0x42b289);}return null;};}function patchUpdates(_0x4ba56e){return function(_0x2e5122){try{jsonpatch[_0x2b26('0x20')](_0x2e5122,_0x4ba56e,!![]);}catch(_0x5482d0){return BPromise[_0x2b26('0x21')](_0x5482d0);}return _0x2e5122[_0x2b26('0x22')]();};}function saveUpdates(_0x392797,_0x413ab4){return function(_0x455ec4){if(_0x455ec4){return _0x455ec4['update'](_0x392797)['then'](function(_0x1658c8){return _0x1658c8;});}return null;};}function removeEntity(_0x2153bf,_0x581234){return function(_0x121ffe){if(_0x121ffe){return _0x121ffe[_0x2b26('0x23')]()['then'](function(){_0x2153bf['status'](0xcc)[_0x2b26('0x19')]();});}};}function handleEntityNotFound(_0x5810bd,_0x250ef4){return function(_0x43fa64){if(!_0x43fa64){_0x5810bd['sendStatus'](0x194);}return _0x43fa64;};}function handleError(_0x4966fa,_0x30a8ba){_0x30a8ba=_0x30a8ba||0x1f4;return function(_0x176e50){logger[_0x2b26('0x24')](_0x176e50[_0x2b26('0x25')]);if(_0x176e50[_0x2b26('0x26')]){delete _0x176e50[_0x2b26('0x26')];}_0x4966fa[_0x2b26('0x18')](_0x30a8ba)[_0x2b26('0x27')](_0x176e50);};}exports[_0x2b26('0x28')]=function(_0x3d6c33,_0xe11763){var _0x26aad1={},_0x384f7f={},_0x31c291={'count':0x0,'rows':[]};var _0x115bbe=_[_0x2b26('0x29')](db[_0x2b26('0x2a')][_0x2b26('0x2b')],function(_0x3926aa){return{'name':_0x3926aa[_0x2b26('0x2c')],'type':_0x3926aa[_0x2b26('0x2d')]['key']};});_0x384f7f[_0x2b26('0x2e')]=_[_0x2b26('0x29')](_0x115bbe,'name');_0x384f7f[_0x2b26('0x2f')]=_[_0x2b26('0x30')](_0x3d6c33[_0x2b26('0x2f')]);_0x384f7f[_0x2b26('0x31')]=_[_0x2b26('0x32')](_0x384f7f[_0x2b26('0x2e')],_0x384f7f[_0x2b26('0x2f')]);_0x26aad1[_0x2b26('0x33')]=_[_0x2b26('0x32')](_0x384f7f[_0x2b26('0x2e')],qs[_0x2b26('0x34')](_0x3d6c33['query'][_0x2b26('0x34')]));_0x26aad1[_0x2b26('0x33')]=_0x26aad1[_0x2b26('0x33')]['length']?_0x26aad1[_0x2b26('0x33')]:_0x384f7f[_0x2b26('0x2e')];if(!_0x3d6c33[_0x2b26('0x2f')]['hasOwnProperty'](_0x2b26('0x35'))){_0x26aad1['limit']=qs['limit'](_0x3d6c33[_0x2b26('0x2f')][_0x2b26('0x1c')]);_0x26aad1['offset']=qs[_0x2b26('0x1a')](_0x3d6c33[_0x2b26('0x2f')]['offset']);}_0x26aad1[_0x2b26('0x36')]=qs['sort'](_0x3d6c33[_0x2b26('0x2f')][_0x2b26('0x37')]);_0x26aad1[_0x2b26('0x38')]=qs[_0x2b26('0x31')](_['pick'](_0x3d6c33[_0x2b26('0x2f')],_0x384f7f[_0x2b26('0x31')]),_0x115bbe);if(_0x3d6c33['query']['filter']){_0x26aad1['where']=_[_0x2b26('0x39')](_0x26aad1[_0x2b26('0x38')],{'$or':_[_0x2b26('0x29')](_0x115bbe,function(_0x49db6d){if(_0x49db6d[_0x2b26('0x2d')]!=='VIRTUAL'){var _0x46844d={};_0x46844d[_0x49db6d[_0x2b26('0x26')]]={'$like':'%'+_0x3d6c33[_0x2b26('0x2f')][_0x2b26('0x3a')]+'%'};return _0x46844d;}})});}_0x26aad1=_[_0x2b26('0x39')]({},_0x26aad1,_0x3d6c33['options']);var _0x354239={'where':_0x26aad1[_0x2b26('0x38')]};return db[_0x2b26('0x2a')][_0x2b26('0x1d')](_0x354239)['then'](function(_0x2ac68c){_0x31c291[_0x2b26('0x1d')]=_0x2ac68c;if(_0x3d6c33[_0x2b26('0x2f')][_0x2b26('0x3b')]){_0x26aad1[_0x2b26('0x3c')]=[{'all':!![]}];}return db[_0x2b26('0x2a')][_0x2b26('0x3d')](_0x26aad1);})[_0x2b26('0x3e')](function(_0x5d174f){_0x31c291[_0x2b26('0x3f')]=_0x5d174f;return _0x31c291;})[_0x2b26('0x3e')](respondWithFilteredResult(_0xe11763,_0x26aad1))[_0x2b26('0x40')](handleError(_0xe11763,null));};exports[_0x2b26('0x41')]=function(_0x7124c7,_0x46a484){var _0x28f25b={'raw':!![],'where':{'id':_0x7124c7['params']['id']}},_0x21b2a4={};_0x21b2a4['model']=_['keys'](db[_0x2b26('0x2a')][_0x2b26('0x2b')]);_0x21b2a4[_0x2b26('0x2f')]=_[_0x2b26('0x30')](_0x7124c7[_0x2b26('0x2f')]);_0x21b2a4[_0x2b26('0x31')]=_[_0x2b26('0x32')](_0x21b2a4['model'],_0x21b2a4[_0x2b26('0x2f')]);_0x28f25b['attributes']=_[_0x2b26('0x32')](_0x21b2a4[_0x2b26('0x2e')],qs[_0x2b26('0x34')](_0x7124c7[_0x2b26('0x2f')][_0x2b26('0x34')]));_0x28f25b[_0x2b26('0x33')]=_0x28f25b[_0x2b26('0x33')][_0x2b26('0x42')]?_0x28f25b['attributes']:_0x21b2a4[_0x2b26('0x2e')];if(_0x7124c7[_0x2b26('0x2f')][_0x2b26('0x3b')]){_0x28f25b[_0x2b26('0x3c')]=[{'all':!![]}];}_0x28f25b=_[_0x2b26('0x39')]({},_0x28f25b,_0x7124c7[_0x2b26('0x43')]);return db[_0x2b26('0x2a')][_0x2b26('0x44')](_0x28f25b)[_0x2b26('0x3e')](handleEntityNotFound(_0x46a484,null))[_0x2b26('0x3e')](respondWithResult(_0x46a484,null))[_0x2b26('0x40')](handleError(_0x46a484,null));};exports[_0x2b26('0x45')]=function(_0x312ab5,_0x453d4a){return db[_0x2b26('0x2a')]['create'](_0x312ab5['body'],{})[_0x2b26('0x3e')](respondWithResult(_0x453d4a,0xc9))[_0x2b26('0x40')](handleError(_0x453d4a,null));};exports['update']=function(_0x193f45,_0x434902){if(_0x193f45[_0x2b26('0x46')]['id']){delete _0x193f45[_0x2b26('0x46')]['id'];}return db[_0x2b26('0x2a')][_0x2b26('0x44')]({'where':{'id':_0x193f45[_0x2b26('0x47')]['id']}})['then'](handleEntityNotFound(_0x434902,null))[_0x2b26('0x3e')](saveUpdates(_0x193f45[_0x2b26('0x46')],null))[_0x2b26('0x3e')](respondWithResult(_0x434902,null))[_0x2b26('0x40')](handleError(_0x434902,null));};exports[_0x2b26('0x23')]=function(_0xa332a5,_0x59c27c){return db[_0x2b26('0x2a')]['find']({'where':{'id':_0xa332a5[_0x2b26('0x47')]['id']}})[_0x2b26('0x3e')](handleEntityNotFound(_0x59c27c,null))[_0x2b26('0x3e')](removeEntity(_0x59c27c,null))['catch'](handleError(_0x59c27c,null));};exports[_0x2b26('0x48')]=function(_0x12e8da,_0x5b3b2a){return db['OpenchannelTransferReport'][_0x2b26('0x48')]()['then'](respondWithResult(_0x5b3b2a,null))[_0x2b26('0x40')](handleError(_0x5b3b2a,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f33c537..273e8e4 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 _0xb9a0=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52f561,_0x59b79f){var _0x132503=function(_0x18c157){while(--_0x18c157){_0x52f561['push'](_0x52f561['shift']());}};_0x132503(++_0x59b79f);}(_0xb9a0,0x192));var _0x0b9a=function(_0x447fe4,_0x54558f){_0x447fe4=_0x447fe4-0x0;var _0x150a40=_0xb9a0[_0x447fe4];return _0x150a40;};'use strict';var _=require(_0x0b9a('0x0'));var util=require(_0x0b9a('0x1'));var logger=require(_0x0b9a('0x2'))(_0x0b9a('0x3'));var moment=require(_0x0b9a('0x4'));var BPromise=require(_0x0b9a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b9a('0x6'));var rimraf=require(_0x0b9a('0x7'));var config=require(_0x0b9a('0x8'));var attributes=require(_0x0b9a('0x9'));module['exports']=function(_0x20416d,_0x58179d){return _0x20416d['define'](_0x0b9a('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x0b9a('0xb'),'fields':[_0x0b9a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x52c3=['bluebird','rimraf','../../config/environment','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x4b541d,_0x55bf69){var _0xf1e5d3=function(_0x8a1f6d){while(--_0x8a1f6d){_0x4b541d['push'](_0x4b541d['shift']());}};_0xf1e5d3(++_0x55bf69);}(_0x52c3,0x180));var _0x352c=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x52c3[_0x67f95e];return _0x538f5a;};'use strict';var _=require(_0x352c('0x0'));var util=require(_0x352c('0x1'));var logger=require(_0x352c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x352c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x352c('0x4'));var config=require(_0x352c('0x5'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x7c0735,_0xebfb9a){return _0x7c0735[_0x352c('0x6')]('OpenchannelTransferReport',attributes,{'tableName':_0x352c('0x7'),'paranoid':![],'indexes':[{'name':_0x352c('0x8'),'fields':[_0x352c('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 8a0dfba..f70dbbe 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 _0x3edc=['request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e5cbd,_0x5523d8){var _0x43c2f0=function(_0x331903){while(--_0x331903){_0x5e5cbd['push'](_0x5e5cbd['shift']());}};_0x43c2f0(++_0x5523d8);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0x3edc[_0x45c0da];return _0x51efff;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var moment=require(_0xc3ed('0x2'));var BPromise=require(_0xc3ed('0x3'));var rs=require(_0xc3ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3ed('0x6'))(_0xc3ed('0x7'));var config=require(_0xc3ed('0x8'));var jayson=require(_0xc3ed('0x9'));var client=jayson[_0xc3ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b28d4,_0x323058,_0x14d194){return new BPromise(function(_0x2f28ce,_0x13999f){return client[_0xc3ed('0xb')](_0x1b28d4,_0x14d194)['then'](function(_0x81590e){logger[_0xc3ed('0xc')](_0xc3ed('0xd'),_0x323058,'request\x20sent');logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x323058,_0xc3ed('0xe'),JSON[_0xc3ed('0xf')](_0x81590e));if(_0x81590e[_0xc3ed('0x10')]){if(_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x11')]===0x1f4){logger[_0xc3ed('0x10')](_0xc3ed('0xd'),_0x323058,_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x12')]);return _0x13999f(_0x81590e[_0xc3ed('0x10')]['message']);}logger[_0xc3ed('0x10')](_0xc3ed('0xd'),_0x323058,_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x12')]);return _0x2f28ce(_0x81590e['error']['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x323058,_0xc3ed('0xe'));_0x2f28ce(_0x81590e[_0xc3ed('0x13')]['message']);}})[_0xc3ed('0x14')](function(_0x15eb2e){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x323058,_0x15eb2e);_0x13999f(_0x15eb2e);});});} \ No newline at end of file +var _0x28e3=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x28e3,0x106));var _0x328e=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x28e3[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var BPromise=require(_0x328e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328e('0x4'));var db=require(_0x328e('0x5'))['db'];var utils=require(_0x328e('0x6'));var logger=require(_0x328e('0x7'))(_0x328e('0x8'));var config=require(_0x328e('0x9'));var jayson=require(_0x328e('0xa'));var client=jayson[_0x328e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5c91,_0x58885f,_0x2bddaa){return new BPromise(function(_0x3696b6,_0x3467ee){return client[_0x328e('0xc')](_0x4b5c91,_0x2bddaa)[_0x328e('0xd')](function(_0x4a4f53){logger[_0x328e('0xe')](_0x328e('0xf'),_0x58885f,_0x328e('0x10'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x58885f,'request\x20sent',JSON[_0x328e('0x11')](_0x4a4f53));if(_0x4a4f53[_0x328e('0x12')]){if(_0x4a4f53[_0x328e('0x12')][_0x328e('0x13')]===0x1f4){logger[_0x328e('0x12')](_0x328e('0xf'),_0x58885f,_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);return _0x3467ee(_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);}logger[_0x328e('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x58885f,_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);return _0x3696b6(_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);}else{logger[_0x328e('0xe')](_0x328e('0xf'),_0x58885f,_0x328e('0x10'));_0x3696b6(_0x4a4f53[_0x328e('0x15')][_0x328e('0x14')]);}})['catch'](function(_0x1fdb79){logger[_0x328e('0x12')](_0x328e('0xf'),_0x58885f,_0x1fdb79);_0x3467ee(_0x1fdb79);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index beeb070..bdb111f 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 _0x95b3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x1da3f4,_0x2e3cee){var _0x217eba=function(_0x429511){while(--_0x429511){_0x1da3f4['push'](_0x1da3f4['shift']());}};_0x217eba(++_0x2e3cee);}(_0x95b3,0x164));var _0x395b=function(_0xda6822,_0x596b16){_0xda6822=_0xda6822-0x0;var _0x863c90=_0x95b3[_0xda6822];return _0x863c90;};'use strict';var multer=require(_0x395b('0x0'));var util=require(_0x395b('0x1'));var path=require(_0x395b('0x2'));var timeout=require(_0x395b('0x3'));var express=require(_0x395b('0x4'));var router=express[_0x395b('0x5')]();var fs_extra=require(_0x395b('0x6'));var auth=require(_0x395b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x395b('0x8'));var controller=require(_0x395b('0x9'));router[_0x395b('0xa')]('/',auth[_0x395b('0xb')](),controller[_0x395b('0xc')]);router[_0x395b('0xa')](_0x395b('0xd'),auth[_0x395b('0xb')](),controller[_0x395b('0xe')]);router[_0x395b('0xf')]('/',auth[_0x395b('0xb')](),controller[_0x395b('0x10')]);router['put'](_0x395b('0xd'),auth[_0x395b('0xb')](),controller[_0x395b('0x11')]);router[_0x395b('0x12')](_0x395b('0xd'),auth[_0x395b('0xb')](),controller[_0x395b('0x13')]);module[_0x395b('0x14')]=router; \ No newline at end of file +var _0xaaf8=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','show','isAuthenticated','create','put','/:id'];(function(_0x2fe621,_0x51ed95){var _0xa93d83=function(_0x12325b){while(--_0x12325b){_0x2fe621['push'](_0x2fe621['shift']());}};_0xa93d83(++_0x51ed95);}(_0xaaf8,0x1ab));var _0x8aaf=function(_0x2f4d41,_0x525047){_0x2f4d41=_0x2f4d41-0x0;var _0x3b0bb2=_0xaaf8[_0x2f4d41];return _0x3b0bb2;};'use strict';var multer=require('multer');var util=require(_0x8aaf('0x0'));var path=require('path');var timeout=require(_0x8aaf('0x1'));var express=require(_0x8aaf('0x2'));var router=express[_0x8aaf('0x3')]();var fs_extra=require(_0x8aaf('0x4'));var auth=require(_0x8aaf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8aaf('0x6'));var controller=require(_0x8aaf('0x7'));router[_0x8aaf('0x8')]('/',auth['isAuthenticated'](),controller[_0x8aaf('0x9')]);router[_0x8aaf('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8aaf('0xa')]);router['post']('/',auth[_0x8aaf('0xb')](),controller[_0x8aaf('0xc')]);router[_0x8aaf('0xd')](_0x8aaf('0xe'),auth[_0x8aaf('0xb')](),controller['update']);router[_0x8aaf('0xf')](_0x8aaf('0xe'),auth[_0x8aaf('0xb')](),controller[_0x8aaf('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9deef46..31a4a45 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 _0x7f8c=['sequelize','exports','STRING','name'];(function(_0x5299a1,_0x29fb6b){var _0xc10c58=function(_0x21fa0d){while(--_0x21fa0d){_0x5299a1['push'](_0x5299a1['shift']());}};_0xc10c58(++_0x29fb6b);}(_0x7f8c,0xdc));var _0xc7f8=function(_0x3198e7,_0x1d197b){_0x3198e7=_0x3198e7-0x0;var _0x1f5ef5=_0x7f8c[_0x3198e7];return _0x1f5ef5;};'use strict';var Sequelize=require(_0xc7f8('0x0'));module[_0xc7f8('0x1')]={'name':{'type':Sequelize[_0xc7f8('0x2')],'unique':_0xc7f8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc7f8('0x2')]}}; \ No newline at end of file +var _0xe67d=['STRING','sequelize','name'];(function(_0xd9c141,_0x4d7246){var _0x365d19=function(_0x50cfa3){while(--_0x50cfa3){_0xd9c141['push'](_0xd9c141['shift']());}};_0x365d19(++_0x4d7246);}(_0xe67d,0x9d));var _0xde67=function(_0x2f6629,_0x1b013c){_0x2f6629=_0x2f6629-0x0;var _0x317739=_0xe67d[_0x2f6629];return _0x317739;};'use strict';var Sequelize=require(_0xde67('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xde67('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xde67('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9b096bc..7eea424 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 _0x9565=['keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','map','query'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x9565,0x1c9));var _0x5956=function(_0x1eedf3,_0x14dabc){_0x1eedf3=_0x1eedf3-0x0;var _0x1c9ebc=_0x9565[_0x1eedf3];return _0x1c9ebc;};'use strict';var emlformat=require(_0x5956('0x0'));var rimraf=require(_0x5956('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5956('0x2'));var rp=require(_0x5956('0x3'));var moment=require(_0x5956('0x4'));var BPromise=require(_0x5956('0x5'));var Mustache=require(_0x5956('0x6'));var util=require(_0x5956('0x7'));var path=require(_0x5956('0x8'));var sox=require(_0x5956('0x9'));var csv=require(_0x5956('0xa'));var ejs=require(_0x5956('0xb'));var fs=require('fs');var fs_extra=require(_0x5956('0xc'));var _=require(_0x5956('0xd'));var squel=require(_0x5956('0xe'));var crypto=require(_0x5956('0xf'));var jsforce=require(_0x5956('0x10'));var deskjs=require(_0x5956('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5956('0x12'));var Papa=require(_0x5956('0x13'));var Redis=require(_0x5956('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5956('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5956('0x16'));var licenseUtil=require(_0x5956('0x17'));var db=require(_0x5956('0x18'))['db'];function respondWithStatusCode(_0x570d9e,_0x386a44){_0x386a44=_0x386a44||0xcc;return function(_0x387e58){if(_0x387e58){return _0x570d9e[_0x5956('0x19')](_0x386a44);}return _0x570d9e['status'](_0x386a44)[_0x5956('0x1a')]();};}function respondWithResult(_0x42c42f,_0x4fd986){_0x4fd986=_0x4fd986||0xc8;return function(_0x1239fc){if(_0x1239fc){return _0x42c42f['status'](_0x4fd986)[_0x5956('0x1b')](_0x1239fc);}};}function respondWithFilteredResult(_0x6a383b,_0x4f1de6){return function(_0x3945d4){if(_0x3945d4){var _0x5ede98=typeof _0x4f1de6[_0x5956('0x1c')]===_0x5956('0x1d')&&typeof _0x4f1de6[_0x5956('0x1e')]===_0x5956('0x1d');var _0x28e408=_0x3945d4['count'];var _0x5307cd=_0x5ede98?0x0:_0x4f1de6[_0x5956('0x1c')];var _0x553d32=_0x5ede98?_0x3945d4['count']:_0x4f1de6[_0x5956('0x1c')]+_0x4f1de6[_0x5956('0x1e')];var _0x1ea531;if(_0x553d32>=_0x28e408){_0x553d32=_0x28e408;_0x1ea531=0xc8;}else{_0x1ea531=0xce;}_0x6a383b[_0x5956('0x1f')](_0x1ea531);return _0x6a383b[_0x5956('0x20')](_0x5956('0x21'),_0x5307cd+'-'+_0x553d32+'/'+_0x28e408)['json'](_0x3945d4);}return null;};}function patchUpdates(_0x5c5766){return function(_0x3eb2d1){try{jsonpatch['apply'](_0x3eb2d1,_0x5c5766,!![]);}catch(_0x2fa05a){return BPromise[_0x5956('0x22')](_0x2fa05a);}return _0x3eb2d1[_0x5956('0x23')]();};}function saveUpdates(_0x25397a,_0x53ab9e){return function(_0x10f06f){if(_0x10f06f){return _0x10f06f[_0x5956('0x24')](_0x25397a)['then'](function(_0x113c8b){return _0x113c8b;});}return null;};}function removeEntity(_0x573746,_0x1a18aa){return function(_0x3713bf){if(_0x3713bf){return _0x3713bf[_0x5956('0x25')]()[_0x5956('0x26')](function(){var _0x3a5d9b=_0x3713bf[_0x5956('0x27')]({'plain':!![]});var _0x53361d='Pauses';return db[_0x5956('0x28')]['destroy']({'where':{'type':_0x53361d,'resourceId':_0x3a5d9b['id']}})[_0x5956('0x26')](function(){return _0x3713bf;});})[_0x5956('0x26')](function(){_0x573746[_0x5956('0x1f')](0xcc)[_0x5956('0x1a')]();});}};}function handleEntityNotFound(_0x2e56fa,_0xa1b42b){return function(_0x211dfd){if(!_0x211dfd){_0x2e56fa[_0x5956('0x19')](0x194);}return _0x211dfd;};}function handleError(_0x14a599,_0x2476d0){_0x2476d0=_0x2476d0||0x1f4;return function(_0x52e5ae){logger[_0x5956('0x29')](_0x52e5ae[_0x5956('0x2a')]);if(_0x52e5ae[_0x5956('0x2b')]){delete _0x52e5ae[_0x5956('0x2b')];}_0x14a599[_0x5956('0x1f')](_0x2476d0)[_0x5956('0x2c')](_0x52e5ae);};}exports[_0x5956('0x2d')]=function(_0x5b043a,_0x2428df){var _0x3a7f3d={},_0x156676={},_0x3b22d4={'count':0x0,'rows':[]};var _0x183865=_['map'](db[_0x5956('0x2e')][_0x5956('0x2f')],function(_0x37a750){return{'name':_0x37a750[_0x5956('0x30')],'type':_0x37a750[_0x5956('0x31')][_0x5956('0x32')]};});_0x156676['model']=_[_0x5956('0x33')](_0x183865,_0x5956('0x2b'));_0x156676[_0x5956('0x34')]=_[_0x5956('0x35')](_0x5b043a[_0x5956('0x34')]);_0x156676[_0x5956('0x36')]=_[_0x5956('0x37')](_0x156676['model'],_0x156676['query']);_0x3a7f3d[_0x5956('0x38')]=_[_0x5956('0x37')](_0x156676[_0x5956('0x39')],qs[_0x5956('0x3a')](_0x5b043a['query'][_0x5956('0x3a')]));_0x3a7f3d[_0x5956('0x38')]=_0x3a7f3d[_0x5956('0x38')][_0x5956('0x3b')]?_0x3a7f3d[_0x5956('0x38')]:_0x156676[_0x5956('0x39')];if(!_0x5b043a[_0x5956('0x34')]['hasOwnProperty'](_0x5956('0x3c'))){_0x3a7f3d[_0x5956('0x1e')]=qs[_0x5956('0x1e')](_0x5b043a[_0x5956('0x34')][_0x5956('0x1e')]);_0x3a7f3d[_0x5956('0x1c')]=qs['offset'](_0x5b043a[_0x5956('0x34')][_0x5956('0x1c')]);}_0x3a7f3d[_0x5956('0x3d')]=qs['sort'](_0x5b043a[_0x5956('0x34')][_0x5956('0x3e')]);_0x3a7f3d['where']=qs[_0x5956('0x36')](_[_0x5956('0x3f')](_0x5b043a['query'],_0x156676[_0x5956('0x36')]),_0x183865);if(_0x5b043a[_0x5956('0x34')][_0x5956('0x40')]){_0x3a7f3d[_0x5956('0x41')]=_[_0x5956('0x42')](_0x3a7f3d[_0x5956('0x41')],{'$or':_[_0x5956('0x33')](_0x183865,function(_0x434103){if(_0x434103[_0x5956('0x31')]!==_0x5956('0x43')){var _0x1e683b={};_0x1e683b[_0x434103[_0x5956('0x2b')]]={'$like':'%'+_0x5b043a[_0x5956('0x34')][_0x5956('0x40')]+'%'};return _0x1e683b;}})});}_0x3a7f3d=_['merge']({},_0x3a7f3d,_0x5b043a[_0x5956('0x44')]);var _0x7a0eab={'where':_0x3a7f3d[_0x5956('0x41')]};return db['Pause'][_0x5956('0x45')](_0x7a0eab)[_0x5956('0x26')](function(_0x1c6069){_0x3b22d4['count']=_0x1c6069;if(_0x5b043a[_0x5956('0x34')]['includeAll']){_0x3a7f3d['include']=[{'all':!![]}];}return db[_0x5956('0x2e')][_0x5956('0x46')](_0x3a7f3d);})[_0x5956('0x26')](function(_0x4d349c){_0x3b22d4[_0x5956('0x47')]=_0x4d349c;return _0x3b22d4;})['then'](respondWithFilteredResult(_0x2428df,_0x3a7f3d))[_0x5956('0x48')](handleError(_0x2428df,null));};exports[_0x5956('0x49')]=function(_0x2d8f77,_0x52491c){var _0x2f4851={'raw':!![],'where':{'id':_0x2d8f77[_0x5956('0x4a')]['id']}},_0x11557e={};_0x11557e['model']=_[_0x5956('0x35')](db[_0x5956('0x2e')][_0x5956('0x2f')]);_0x11557e[_0x5956('0x34')]=_[_0x5956('0x35')](_0x2d8f77[_0x5956('0x34')]);_0x11557e[_0x5956('0x36')]=_[_0x5956('0x37')](_0x11557e[_0x5956('0x39')],_0x11557e['query']);_0x2f4851[_0x5956('0x38')]=_[_0x5956('0x37')](_0x11557e[_0x5956('0x39')],qs[_0x5956('0x3a')](_0x2d8f77[_0x5956('0x34')][_0x5956('0x3a')]));_0x2f4851['attributes']=_0x2f4851[_0x5956('0x38')]['length']?_0x2f4851[_0x5956('0x38')]:_0x11557e['model'];if(_0x2d8f77[_0x5956('0x34')]['includeAll']){_0x2f4851['include']=[{'all':!![]}];}_0x2f4851=_[_0x5956('0x42')]({},_0x2f4851,_0x2d8f77[_0x5956('0x44')]);return db[_0x5956('0x2e')][_0x5956('0x4b')](_0x2f4851)[_0x5956('0x26')](handleEntityNotFound(_0x52491c,null))[_0x5956('0x26')](respondWithResult(_0x52491c,null))[_0x5956('0x48')](handleError(_0x52491c,null));};exports[_0x5956('0x4c')]=function(_0x3ed04a,_0x46fdc5){return db[_0x5956('0x2e')][_0x5956('0x4c')](_0x3ed04a['body'],{})['then'](function(_0x3c5d86){var _0x52124b=_0x3ed04a[_0x5956('0x4d')][_0x5956('0x27')]({'plain':!![]});if(!_0x52124b)throw new Error(_0x5956('0x4e'));if(_0x52124b['role']===_0x5956('0x4d')){var _0x119525=_0x3c5d86[_0x5956('0x27')]({'plain':!![]});var _0x289498=_0x5956('0x4f');return db[_0x5956('0x50')][_0x5956('0x4b')]({'where':{'name':_0x289498,'userProfileId':_0x52124b[_0x5956('0x51')]},'raw':!![]})[_0x5956('0x26')](function(_0x3da196){if(_0x3da196&&_0x3da196[_0x5956('0x52')]===0x0){return db[_0x5956('0x28')]['create']({'name':_0x119525[_0x5956('0x2b')],'resourceId':_0x119525['id'],'type':_0x3da196[_0x5956('0x2b')],'sectionId':_0x3da196['id']},{})['then'](function(){return _0x3c5d86;});}else{return _0x3c5d86;}})[_0x5956('0x48')](function(_0x503057){logger[_0x5956('0x29')](_0x5956('0x53'),_0x503057);throw _0x503057;});}return _0x3c5d86;})[_0x5956('0x26')](respondWithResult(_0x46fdc5,0xc9))[_0x5956('0x48')](handleError(_0x46fdc5,null));};exports['update']=function(_0x31af58,_0x2cf83d){if(_0x31af58[_0x5956('0x54')]['id']){delete _0x31af58[_0x5956('0x54')]['id'];}return db[_0x5956('0x2e')][_0x5956('0x4b')]({'where':{'id':_0x31af58[_0x5956('0x4a')]['id']}})[_0x5956('0x26')](handleEntityNotFound(_0x2cf83d,null))[_0x5956('0x26')](saveUpdates(_0x31af58[_0x5956('0x54')],null))['then'](respondWithResult(_0x2cf83d,null))[_0x5956('0x48')](handleError(_0x2cf83d,null));};exports[_0x5956('0x25')]=function(_0x5921ab,_0x219cdc){return db['Pause']['find']({'where':{'id':_0x5921ab['params']['id']}})['then'](handleEntityNotFound(_0x219cdc,null))[_0x5956('0x26')](removeEntity(_0x219cdc,null))[_0x5956('0x48')](handleError(_0x219cdc,null));}; \ No newline at end of file +var _0x25d1=['moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','Pauses','UserProfileResource','then','stack','name','send','index','Pause','fieldName','type','key','map','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','sort','filter','where','options','include','findAll','params','rawAttributes','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','fast-json-patch'];(function(_0x21e034,_0x59fc14){var _0x1faab3=function(_0x2bd3ba){while(--_0x2bd3ba){_0x21e034['push'](_0x21e034['shift']());}};_0x1faab3(++_0x59fc14);}(_0x25d1,0xa8));var _0x125d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x25d1[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require(_0x125d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x125d('0x1'));var rp=require('request-promise');var moment=require(_0x125d('0x2'));var BPromise=require(_0x125d('0x3'));var Mustache=require('mustache');var util=require(_0x125d('0x4'));var path=require(_0x125d('0x5'));var sox=require(_0x125d('0x6'));var csv=require(_0x125d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x125d('0x8'));var _=require(_0x125d('0x9'));var squel=require(_0x125d('0xa'));var crypto=require(_0x125d('0xb'));var jsforce=require(_0x125d('0xc'));var deskjs=require(_0x125d('0xd'));var toCsv=require(_0x125d('0x7'));var querystring=require(_0x125d('0xe'));var Papa=require(_0x125d('0xf'));var Redis=require(_0x125d('0x10'));var authService=require(_0x125d('0x11'));var qs=require(_0x125d('0x12'));var as=require(_0x125d('0x13'));var hardwareService=require(_0x125d('0x14'));var logger=require(_0x125d('0x15'))(_0x125d('0x16'));var utils=require('../../config/utils');var config=require(_0x125d('0x17'));var licenseUtil=require(_0x125d('0x18'));var db=require(_0x125d('0x19'))['db'];function respondWithStatusCode(_0x4678e2,_0x37f9f8){_0x37f9f8=_0x37f9f8||0xcc;return function(_0x255aef){if(_0x255aef){return _0x4678e2[_0x125d('0x1a')](_0x37f9f8);}return _0x4678e2[_0x125d('0x1b')](_0x37f9f8)[_0x125d('0x1c')]();};}function respondWithResult(_0x2526ef,_0x43660a){_0x43660a=_0x43660a||0xc8;return function(_0x4e0382){if(_0x4e0382){return _0x2526ef['status'](_0x43660a)[_0x125d('0x1d')](_0x4e0382);}};}function respondWithFilteredResult(_0x3fda2b,_0x4199ac){return function(_0x45048a){if(_0x45048a){var _0x3db1ca=typeof _0x4199ac[_0x125d('0x1e')]===_0x125d('0x1f')&&typeof _0x4199ac[_0x125d('0x20')]===_0x125d('0x1f');var _0x4d7a3d=_0x45048a[_0x125d('0x21')];var _0x8c0646=_0x3db1ca?0x0:_0x4199ac['offset'];var _0x5660ca=_0x3db1ca?_0x45048a['count']:_0x4199ac[_0x125d('0x1e')]+_0x4199ac['limit'];var _0x30c95c;if(_0x5660ca>=_0x4d7a3d){_0x5660ca=_0x4d7a3d;_0x30c95c=0xc8;}else{_0x30c95c=0xce;}_0x3fda2b[_0x125d('0x1b')](_0x30c95c);return _0x3fda2b[_0x125d('0x22')](_0x125d('0x23'),_0x8c0646+'-'+_0x5660ca+'/'+_0x4d7a3d)[_0x125d('0x1d')](_0x45048a);}return null;};}function patchUpdates(_0x38d457){return function(_0x47e5f0){try{jsonpatch[_0x125d('0x24')](_0x47e5f0,_0x38d457,!![]);}catch(_0x30a70d){return BPromise[_0x125d('0x25')](_0x30a70d);}return _0x47e5f0[_0x125d('0x26')]();};}function saveUpdates(_0x51ad36,_0x349a75){return function(_0x3a1e1b){if(_0x3a1e1b){return _0x3a1e1b['update'](_0x51ad36)['then'](function(_0x3a157f){return _0x3a157f;});}return null;};}function removeEntity(_0x4f8108,_0xf50e22){return function(_0x459070){if(_0x459070){return _0x459070[_0x125d('0x27')]()['then'](function(){var _0x23ba87=_0x459070[_0x125d('0x28')]({'plain':!![]});var _0x5dcde1=_0x125d('0x29');return db[_0x125d('0x2a')][_0x125d('0x27')]({'where':{'type':_0x5dcde1,'resourceId':_0x23ba87['id']}})[_0x125d('0x2b')](function(){return _0x459070;});})['then'](function(){_0x4f8108[_0x125d('0x1b')](0xcc)[_0x125d('0x1c')]();});}};}function handleEntityNotFound(_0x12ce1a,_0x40bd3d){return function(_0x252056){if(!_0x252056){_0x12ce1a[_0x125d('0x1a')](0x194);}return _0x252056;};}function handleError(_0x38e641,_0x26537e){_0x26537e=_0x26537e||0x1f4;return function(_0x53d0f3){logger['error'](_0x53d0f3[_0x125d('0x2c')]);if(_0x53d0f3['name']){delete _0x53d0f3[_0x125d('0x2d')];}_0x38e641[_0x125d('0x1b')](_0x26537e)[_0x125d('0x2e')](_0x53d0f3);};}exports[_0x125d('0x2f')]=function(_0x8486d,_0x417ad1){var _0x31a69={},_0x60057a={},_0x298f30={'count':0x0,'rows':[]};var _0x2cca85=_['map'](db[_0x125d('0x30')]['rawAttributes'],function(_0x55c2e1){return{'name':_0x55c2e1[_0x125d('0x31')],'type':_0x55c2e1[_0x125d('0x32')][_0x125d('0x33')]};});_0x60057a['model']=_[_0x125d('0x34')](_0x2cca85,_0x125d('0x2d'));_0x60057a['query']=_[_0x125d('0x35')](_0x8486d['query']);_0x60057a[_0x125d('0x36')]=_[_0x125d('0x37')](_0x60057a[_0x125d('0x38')],_0x60057a['query']);_0x31a69[_0x125d('0x39')]=_[_0x125d('0x37')](_0x60057a['model'],qs[_0x125d('0x3a')](_0x8486d['query']['fields']));_0x31a69[_0x125d('0x39')]=_0x31a69[_0x125d('0x39')][_0x125d('0x3b')]?_0x31a69[_0x125d('0x39')]:_0x60057a[_0x125d('0x38')];if(!_0x8486d[_0x125d('0x3c')][_0x125d('0x3d')](_0x125d('0x3e'))){_0x31a69['limit']=qs[_0x125d('0x20')](_0x8486d[_0x125d('0x3c')][_0x125d('0x20')]);_0x31a69[_0x125d('0x1e')]=qs[_0x125d('0x1e')](_0x8486d[_0x125d('0x3c')][_0x125d('0x1e')]);}_0x31a69['order']=qs[_0x125d('0x3f')](_0x8486d[_0x125d('0x3c')][_0x125d('0x3f')]);_0x31a69['where']=qs[_0x125d('0x36')](_['pick'](_0x8486d[_0x125d('0x3c')],_0x60057a['filters']),_0x2cca85);if(_0x8486d[_0x125d('0x3c')][_0x125d('0x40')]){_0x31a69['where']=_['merge'](_0x31a69[_0x125d('0x41')],{'$or':_[_0x125d('0x34')](_0x2cca85,function(_0x1db632){if(_0x1db632[_0x125d('0x32')]!=='VIRTUAL'){var _0x460bc5={};_0x460bc5[_0x1db632['name']]={'$like':'%'+_0x8486d[_0x125d('0x3c')][_0x125d('0x40')]+'%'};return _0x460bc5;}})});}_0x31a69=_['merge']({},_0x31a69,_0x8486d[_0x125d('0x42')]);var _0x5efa6f={'where':_0x31a69['where']};return db[_0x125d('0x30')][_0x125d('0x21')](_0x5efa6f)[_0x125d('0x2b')](function(_0xcd36b4){_0x298f30[_0x125d('0x21')]=_0xcd36b4;if(_0x8486d['query']['includeAll']){_0x31a69[_0x125d('0x43')]=[{'all':!![]}];}return db['Pause'][_0x125d('0x44')](_0x31a69);})['then'](function(_0x41b90d){_0x298f30['rows']=_0x41b90d;return _0x298f30;})[_0x125d('0x2b')](respondWithFilteredResult(_0x417ad1,_0x31a69))['catch'](handleError(_0x417ad1,null));};exports['show']=function(_0x36078f,_0x3e7d85){var _0x3404fb={'raw':!![],'where':{'id':_0x36078f[_0x125d('0x45')]['id']}},_0x3df659={};_0x3df659[_0x125d('0x38')]=_[_0x125d('0x35')](db[_0x125d('0x30')][_0x125d('0x46')]);_0x3df659[_0x125d('0x3c')]=_[_0x125d('0x35')](_0x36078f[_0x125d('0x3c')]);_0x3df659[_0x125d('0x36')]=_[_0x125d('0x37')](_0x3df659[_0x125d('0x38')],_0x3df659[_0x125d('0x3c')]);_0x3404fb['attributes']=_[_0x125d('0x37')](_0x3df659['model'],qs[_0x125d('0x3a')](_0x36078f[_0x125d('0x3c')][_0x125d('0x3a')]));_0x3404fb[_0x125d('0x39')]=_0x3404fb['attributes'][_0x125d('0x3b')]?_0x3404fb[_0x125d('0x39')]:_0x3df659[_0x125d('0x38')];if(_0x36078f[_0x125d('0x3c')][_0x125d('0x47')]){_0x3404fb['include']=[{'all':!![]}];}_0x3404fb=_[_0x125d('0x48')]({},_0x3404fb,_0x36078f[_0x125d('0x42')]);return db[_0x125d('0x30')][_0x125d('0x49')](_0x3404fb)[_0x125d('0x2b')](handleEntityNotFound(_0x3e7d85,null))[_0x125d('0x2b')](respondWithResult(_0x3e7d85,null))[_0x125d('0x4a')](handleError(_0x3e7d85,null));};exports[_0x125d('0x4b')]=function(_0x2bd051,_0x13f1ac){return db[_0x125d('0x30')]['create'](_0x2bd051[_0x125d('0x4c')],{})['then'](function(_0x4635ff){var _0x33f6eb=_0x2bd051[_0x125d('0x4d')][_0x125d('0x28')]({'plain':!![]});if(!_0x33f6eb)throw new Error(_0x125d('0x4e'));if(_0x33f6eb[_0x125d('0x4f')]===_0x125d('0x4d')){var _0x275aa5=_0x4635ff['get']({'plain':!![]});var _0x2dc8b3=_0x125d('0x29');return db[_0x125d('0x50')][_0x125d('0x49')]({'where':{'name':_0x2dc8b3,'userProfileId':_0x33f6eb['userProfileId']},'raw':!![]})[_0x125d('0x2b')](function(_0x58aa2a){if(_0x58aa2a&&_0x58aa2a[_0x125d('0x51')]===0x0){return db[_0x125d('0x2a')]['create']({'name':_0x275aa5[_0x125d('0x2d')],'resourceId':_0x275aa5['id'],'type':_0x58aa2a[_0x125d('0x2d')],'sectionId':_0x58aa2a['id']},{})[_0x125d('0x2b')](function(){return _0x4635ff;});}else{return _0x4635ff;}})[_0x125d('0x4a')](function(_0x111c59){logger[_0x125d('0x52')](_0x125d('0x53'),_0x111c59);throw _0x111c59;});}return _0x4635ff;})[_0x125d('0x2b')](respondWithResult(_0x13f1ac,0xc9))['catch'](handleError(_0x13f1ac,null));};exports[_0x125d('0x54')]=function(_0x86e265,_0x53f488){if(_0x86e265[_0x125d('0x4c')]['id']){delete _0x86e265[_0x125d('0x4c')]['id'];}return db[_0x125d('0x30')][_0x125d('0x49')]({'where':{'id':_0x86e265['params']['id']}})[_0x125d('0x2b')](handleEntityNotFound(_0x53f488,null))['then'](saveUpdates(_0x86e265['body'],null))[_0x125d('0x2b')](respondWithResult(_0x53f488,null))['catch'](handleError(_0x53f488,null));};exports[_0x125d('0x27')]=function(_0x3656be,_0x302ad6){return db['Pause']['find']({'where':{'id':_0x3656be[_0x125d('0x45')]['id']}})['then'](handleEntityNotFound(_0x302ad6,null))[_0x125d('0x2b')](removeEntity(_0x302ad6,null))['catch'](handleError(_0x302ad6,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1426d8a..ce96d99 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4d30b7,_0x220583){var _0x5e8cf2=function(_0x5dc8d1){while(--_0x5dc8d1){_0x4d30b7['push'](_0x4d30b7['shift']());}};_0x5e8cf2(++_0x220583);}(_0x1cb9,0x14e));var _0x91cb=function(_0x465812,_0x36e649){_0x465812=_0x465812-0x0;var _0xee12b4=_0x1cb9[_0x465812];return _0xee12b4;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x4098ed,_0x21e1eb){var _0x5622e7=function(_0x1d0b95){while(--_0x1d0b95){_0x4098ed['push'](_0x4098ed['shift']());}};_0x5622e7(++_0x21e1eb);}(_0x326f,0xd1));var _0xf326=function(_0x4026e6,_0x14c98b){_0x4026e6=_0x4026e6-0x0;var _0x41d5ec=_0x326f[_0x4026e6];return _0x41d5ec;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index bd26865..78befcb 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x6149f6,_0x5d016d){var _0x503dd5=function(_0x3ec8ba){while(--_0x3ec8ba){_0x6149f6['push'](_0x6149f6['shift']());}};_0x503dd5(++_0x5d016d);}(_0xb10b,0x12a));var _0xbb10=function(_0x322296,_0x57eb19){_0x322296=_0x322296-0x0;var _0x432ea7=_0xb10b[_0x322296];return _0x432ea7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x27226,_0x193920){var _0x565b0a=function(_0x39f6a5){while(--_0x39f6a5){_0x27226['push'](_0x27226['shift']());}};_0x565b0a(++_0x193920);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e0c31,_0x208e9f){_0x4e0c31=_0x4e0c31-0x0;var _0x3fd7df=_0xb10b[_0x4e0c31];return _0x3fd7df;};'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 7462e72..64d5088 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 _0x4fdb=['server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','/webhook','webhookGet','get','show','/:id/download','download','diskStorage','root'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x270913,_0xb25fb4){_0x270913=_0x270913-0x0;var _0x1e1dba=_0x4fdb[_0x270913];return _0x1e1dba;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),controller[_0xb4fd('0xc')]);router[_0xb4fd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb4fd('0xe')]);router[_0xb4fd('0xd')](_0xb4fd('0xf'),auth['isAuthenticated'](),controller[_0xb4fd('0x10')]);var upload=multer({'storage':multer[_0xb4fd('0x11')]({'destination':function(_0x2148db,_0x23b08f,_0x306bd4){_0x306bd4(null,path['join'](config[_0xb4fd('0x12')],_0xb4fd('0x13')));},'filename':function(_0x2e8ee1,_0x120c2e,_0x5ba7e1){_0x120c2e[_0xb4fd('0x14')]=_0x120c2e[_0xb4fd('0x14')][_0xb4fd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ba7e1(null,util['format'](_0xb4fd('0x16'),path[_0xb4fd('0x17')](_0x120c2e[_0xb4fd('0x14')],path[_0xb4fd('0x18')](_0x120c2e[_0xb4fd('0x14')])),Date[_0xb4fd('0x19')](),path[_0xb4fd('0x18')](_0x120c2e['originalname'])));}})});router[_0xb4fd('0x1a')]('/',upload[_0xb4fd('0x1b')](_0xb4fd('0x1c')),controller[_0xb4fd('0x1d')]);router[_0xb4fd('0x1a')](_0xb4fd('0xb'),controller[_0xb4fd('0x1e')]);router[_0xb4fd('0x1f')](_0xb4fd('0x20'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module[_0xb4fd('0x22')]=router; \ No newline at end of file +var _0x4d9e=['upload','webhookPost','put','delete','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','%s-%s%s','basename','originalname','now','extname','single','file'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x1b1acd,_0x506a0a){_0x1b1acd=_0x1b1acd-0x0;var _0x5ed4c2=_0x4d9e[_0x1b1acd];return _0x5ed4c2;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),controller['webhookGet']);router[_0xe4d9('0x6')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xb')]);router[_0xe4d9('0x6')](_0xe4d9('0xc'),auth['isAuthenticated'](),controller[_0xe4d9('0xd')]);var upload=multer({'storage':multer[_0xe4d9('0xe')]({'destination':function(_0x32eb8a,_0x3575ac,_0xddd1fb){_0xddd1fb(null,path[_0xe4d9('0xf')](config[_0xe4d9('0x10')],'server/files/plugins'));},'filename':function(_0x5ee099,_0x580c50,_0x4e0d15){_0x580c50['originalname']=_0x580c50['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4e0d15(null,util['format'](_0xe4d9('0x11'),path[_0xe4d9('0x12')](_0x580c50[_0xe4d9('0x13')],path['extname'](_0x580c50[_0xe4d9('0x13')])),Date[_0xe4d9('0x14')](),path[_0xe4d9('0x15')](_0x580c50[_0xe4d9('0x13')])));}})});router['post']('/',upload[_0xe4d9('0x16')](_0xe4d9('0x17')),controller[_0xe4d9('0x18')]);router['post']('/webhook',controller[_0xe4d9('0x19')]);router[_0xe4d9('0x1a')]('/:id',auth[_0xe4d9('0x7')](),controller['update']);router[_0xe4d9('0x1b')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 081bef3..bfa9a6a 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 _0x4f7a=['adminOnly','agentOnly','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'];(function(_0x4bac5b,_0x176d38){var _0x5ca927=function(_0xee0f0){while(--_0xee0f0){_0x4bac5b['push'](_0x4bac5b['shift']());}};_0x5ca927(++_0x176d38);}(_0x4f7a,0xd5));var _0xa4f7=function(_0x11484a,_0x4ff1dc){_0x11484a=_0x11484a-0x0;var _0x149500=_0x4f7a[_0x11484a];return _0x149500;};'use strict';var Sequelize=require(_0xa4f7('0x0'));module['exports']={'name':{'type':Sequelize[_0xa4f7('0x1')]},'type':{'type':Sequelize[_0xa4f7('0x2')](_0xa4f7('0x3'),_0xa4f7('0x4'))},'description':{'type':Sequelize[_0xa4f7('0x5')]},'version':{'type':Sequelize[_0xa4f7('0x5')]},'path':{'type':Sequelize[_0xa4f7('0x1')],'comment':_0xa4f7('0x6')},'active':{'type':Sequelize[_0xa4f7('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xa4f7('0x8'),_0xa4f7('0x9'),_0xa4f7('0xa'),_0xa4f7('0xb')),'defaultValue':'always','comment':_0xa4f7('0xc')},'icon':{'type':Sequelize[_0xa4f7('0x1')]},'adminUrl':{'type':Sequelize[_0xa4f7('0x1')]},'agentUrl':{'type':Sequelize[_0xa4f7('0x1')]},'scriptName':{'type':Sequelize[_0xa4f7('0x1')]},'scriptPath':{'type':Sequelize[_0xa4f7('0x1')]}}; \ No newline at end of file +var _0x2282=['STRING','ENUM','html','script','TEXT','BOOLEAN','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','exports'];(function(_0x38c869,_0x2248d1){var _0x1a90e9=function(_0x280f3e){while(--_0x280f3e){_0x38c869['push'](_0x38c869['shift']());}};_0x1a90e9(++_0x2248d1);}(_0x2282,0xa7));var _0x2228=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0x2282[_0x59145a];return _0xf04d7;};'use strict';var Sequelize=require(_0x2228('0x0'));module[_0x2228('0x1')]={'name':{'type':Sequelize[_0x2228('0x2')]},'type':{'type':Sequelize[_0x2228('0x3')](_0x2228('0x4'),_0x2228('0x5'))},'description':{'type':Sequelize[_0x2228('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x2228('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x2228('0x7')],'defaultValue':0x0,'comment':_0x2228('0x8')},'sidebar':{'type':Sequelize[_0x2228('0x3')](_0x2228('0x9'),_0x2228('0xa'),'always','never'),'defaultValue':_0x2228('0xb'),'comment':_0x2228('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x2228('0x2')]},'agentUrl':{'type':Sequelize[_0x2228('0x2')]},'scriptName':{'type':Sequelize[_0x2228('0x2')]},'scriptPath':{'type':Sequelize[_0x2228('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2116fca..64d764d 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 _0x32ce=['delete','dirname','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','json','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','%s%s','eml-format','rimraf','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Plugins','UserProfileResource','destroy','error','stack','name','send','Plugin','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','path','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed'];(function(_0x2b4d34,_0x30d597){var _0x2616f0=function(_0x542121){while(--_0x542121){_0x2b4d34['push'](_0x2b4d34['shift']());}};_0x2616f0(++_0x30d597);}(_0x32ce,0x15a));var _0xe32c=function(_0xaca219,_0x5c535a){_0xaca219=_0xaca219-0x0;var _0xe76f4c=_0x32ce[_0xaca219];return _0xe76f4c;};'use strict';var emlformat=require(_0xe32c('0x0'));var rimraf=require(_0xe32c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe32c('0x2'));var rp=require('request-promise');var moment=require(_0xe32c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe32c('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe32c('0x5'));var ejs=require(_0xe32c('0x6'));var fs=require('fs');var fs_extra=require(_0xe32c('0x7'));var _=require(_0xe32c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe32c('0x9'));var toCsv=require(_0xe32c('0x5'));var querystring=require(_0xe32c('0xa'));var Papa=require(_0xe32c('0xb'));var extract=require('extract-zip');var rimraf=require(_0xe32c('0x1'));var archiver=require('archiver');var Redis=require(_0xe32c('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xe32c('0xd'));var as=require(_0xe32c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe32c('0xf'))(_0xe32c('0x10'));var utils=require(_0xe32c('0x11'));var config=require(_0xe32c('0x12'));var licenseUtil=require(_0xe32c('0x13'));var db=require('../../mysqldb')['db'];config[_0xe32c('0x14')]=_[_0xe32c('0x15')](config['redis'],{'host':_0xe32c('0x16'),'port':0x18eb});var socket=require(_0xe32c('0x17'))(new Redis(config[_0xe32c('0x14')]));require('./plugin.socket')[_0xe32c('0x18')](socket);function respondWithStatusCode(_0x3a8a76,_0x4a90a3){_0x4a90a3=_0x4a90a3||0xcc;return function(_0x4045b9){if(_0x4045b9){return _0x3a8a76[_0xe32c('0x19')](_0x4a90a3);}return _0x3a8a76['status'](_0x4a90a3)[_0xe32c('0x1a')]();};}function respondWithResult(_0x44883c,_0x2dfcd5){_0x2dfcd5=_0x2dfcd5||0xc8;return function(_0x498127){if(_0x498127){return _0x44883c[_0xe32c('0x1b')](_0x2dfcd5)['json'](_0x498127);}};}function respondWithFilteredResult(_0x320131,_0x597049){return function(_0x1f5cbd){if(_0x1f5cbd){var _0x3e60ac=typeof _0x597049[_0xe32c('0x1c')]===_0xe32c('0x1d')&&typeof _0x597049[_0xe32c('0x1e')]===_0xe32c('0x1d');var _0x57db52=_0x1f5cbd[_0xe32c('0x1f')];var _0xfed171=_0x3e60ac?0x0:_0x597049[_0xe32c('0x1c')];var _0x91abb4=_0x3e60ac?_0x1f5cbd[_0xe32c('0x1f')]:_0x597049[_0xe32c('0x1c')]+_0x597049[_0xe32c('0x1e')];var _0x120d8d;if(_0x91abb4>=_0x57db52){_0x91abb4=_0x57db52;_0x120d8d=0xc8;}else{_0x120d8d=0xce;}_0x320131[_0xe32c('0x1b')](_0x120d8d);return _0x320131[_0xe32c('0x20')]('Content-Range',_0xfed171+'-'+_0x91abb4+'/'+_0x57db52)['json'](_0x1f5cbd);}return null;};}function patchUpdates(_0x28978e){return function(_0x5c5495){try{jsonpatch[_0xe32c('0x21')](_0x5c5495,_0x28978e,!![]);}catch(_0x15d07b){return BPromise[_0xe32c('0x22')](_0x15d07b);}return _0x5c5495[_0xe32c('0x23')]();};}function saveUpdates(_0x30af0a,_0x3de9f9){return function(_0x3e3c59){if(_0x3e3c59){return _0x3e3c59[_0xe32c('0x24')](_0x30af0a)[_0xe32c('0x25')](function(_0x4d94ce){return _0x4d94ce;});}return null;};}function removeEntity(_0x572769,_0x2b854c){return function(_0x5a3b54){if(_0x5a3b54){return _0x5a3b54['destroy']()['then'](function(){var _0x68460f=_0x5a3b54[_0xe32c('0x26')]({'plain':!![]});var _0xfe30cd=_0xe32c('0x27');return db[_0xe32c('0x28')][_0xe32c('0x29')]({'where':{'type':_0xfe30cd,'resourceId':_0x68460f['id']}})[_0xe32c('0x25')](function(){return _0x5a3b54;});})['then'](function(){_0x572769[_0xe32c('0x1b')](0xcc)[_0xe32c('0x1a')]();});}};}function handleEntityNotFound(_0x173c26,_0x1edada){return function(_0x510af7){if(!_0x510af7){_0x173c26[_0xe32c('0x19')](0x194);}return _0x510af7;};}function handleError(_0x3546a2,_0x39f337){_0x39f337=_0x39f337||0x1f4;return function(_0xfe7be6){logger[_0xe32c('0x2a')](_0xfe7be6[_0xe32c('0x2b')]);if(_0xfe7be6[_0xe32c('0x2c')]){delete _0xfe7be6[_0xe32c('0x2c')];}_0x3546a2[_0xe32c('0x1b')](_0x39f337)[_0xe32c('0x2d')](_0xfe7be6);};}exports['index']=function(_0x4b18a3,_0x27b04e){var _0x43830b={},_0x4bfe99={},_0x63be7c={'count':0x0,'rows':[]};var _0x3ff6ec=_['map'](db[_0xe32c('0x2e')][_0xe32c('0x2f')],function(_0x28790b){return{'name':_0x28790b['fieldName'],'type':_0x28790b[_0xe32c('0x30')][_0xe32c('0x31')]};});_0x4bfe99[_0xe32c('0x32')]=_[_0xe32c('0x33')](_0x3ff6ec,_0xe32c('0x2c'));_0x4bfe99[_0xe32c('0x34')]=_['keys'](_0x4b18a3[_0xe32c('0x34')]);_0x4bfe99[_0xe32c('0x35')]=_[_0xe32c('0x36')](_0x4bfe99['model'],_0x4bfe99[_0xe32c('0x34')]);_0x43830b[_0xe32c('0x37')]=_[_0xe32c('0x36')](_0x4bfe99[_0xe32c('0x32')],qs[_0xe32c('0x38')](_0x4b18a3['query'][_0xe32c('0x38')]));_0x43830b[_0xe32c('0x37')]=_0x43830b['attributes'][_0xe32c('0x39')]?_0x43830b[_0xe32c('0x37')]:_0x4bfe99[_0xe32c('0x32')];if(!_0x4b18a3['query'][_0xe32c('0x3a')](_0xe32c('0x3b'))){_0x43830b['limit']=qs[_0xe32c('0x1e')](_0x4b18a3[_0xe32c('0x34')][_0xe32c('0x1e')]);_0x43830b['offset']=qs[_0xe32c('0x1c')](_0x4b18a3[_0xe32c('0x34')][_0xe32c('0x1c')]);}_0x43830b['order']=qs[_0xe32c('0x3c')](_0x4b18a3[_0xe32c('0x34')][_0xe32c('0x3c')]);_0x43830b[_0xe32c('0x3d')]=qs[_0xe32c('0x35')](_[_0xe32c('0x3e')](_0x4b18a3[_0xe32c('0x34')],_0x4bfe99[_0xe32c('0x35')]),_0x3ff6ec);if(_0x4b18a3['query'][_0xe32c('0x3f')]){_0x43830b[_0xe32c('0x3d')]=_[_0xe32c('0x40')](_0x43830b[_0xe32c('0x3d')],{'$or':_['map'](_0x3ff6ec,function(_0x270ead){if(_0x270ead[_0xe32c('0x30')]!==_0xe32c('0x41')){var _0x503bd8={};_0x503bd8[_0x270ead['name']]={'$like':'%'+_0x4b18a3[_0xe32c('0x34')][_0xe32c('0x3f')]+'%'};return _0x503bd8;}})});}_0x43830b=_['merge']({},_0x43830b,_0x4b18a3[_0xe32c('0x42')]);var _0x177eff={'where':_0x43830b[_0xe32c('0x3d')]};return db[_0xe32c('0x2e')][_0xe32c('0x1f')](_0x177eff)[_0xe32c('0x25')](function(_0x13177e){_0x63be7c[_0xe32c('0x1f')]=_0x13177e;if(_0x4b18a3[_0xe32c('0x34')]['includeAll']){_0x43830b[_0xe32c('0x43')]=[{'all':!![]}];}return db['Plugin'][_0xe32c('0x44')](_0x43830b);})[_0xe32c('0x25')](function(_0xfd7898){_0x63be7c[_0xe32c('0x45')]=_0xfd7898;return _0x63be7c;})[_0xe32c('0x25')](respondWithFilteredResult(_0x27b04e,_0x43830b))[_0xe32c('0x46')](handleError(_0x27b04e,null));};exports['show']=function(_0x234a3a,_0x1672e0){var _0x409378={'raw':!![],'where':{'id':_0x234a3a[_0xe32c('0x47')]['id']}},_0x46c832={};_0x46c832[_0xe32c('0x32')]=_[_0xe32c('0x48')](db[_0xe32c('0x2e')][_0xe32c('0x2f')]);_0x46c832[_0xe32c('0x34')]=_[_0xe32c('0x48')](_0x234a3a[_0xe32c('0x34')]);_0x46c832[_0xe32c('0x35')]=_[_0xe32c('0x36')](_0x46c832[_0xe32c('0x32')],_0x46c832[_0xe32c('0x34')]);_0x409378[_0xe32c('0x37')]=_['intersection'](_0x46c832['model'],qs[_0xe32c('0x38')](_0x234a3a[_0xe32c('0x34')][_0xe32c('0x38')]));_0x409378[_0xe32c('0x37')]=_0x409378[_0xe32c('0x37')][_0xe32c('0x39')]?_0x409378[_0xe32c('0x37')]:_0x46c832[_0xe32c('0x32')];if(_0x234a3a['query'][_0xe32c('0x49')]){_0x409378[_0xe32c('0x43')]=[{'all':!![]}];}_0x409378=_[_0xe32c('0x40')]({},_0x409378,_0x234a3a[_0xe32c('0x42')]);return db[_0xe32c('0x2e')][_0xe32c('0x4a')](_0x409378)['then'](handleEntityNotFound(_0x1672e0,null))['then'](respondWithResult(_0x1672e0,null))['catch'](handleError(_0x1672e0,null));};exports['download']=function(_0x5ef758,_0x149324,_0x5bf5f4){return db['Plugin'][_0xe32c('0x4a')]({'where':{'id':_0x5ef758['params']['id']},'attributes':[_0xe32c('0x2c'),'path'],'raw':!![]})[_0xe32c('0x25')](handleEntityNotFound(_0x149324,null))[_0xe32c('0x25')](function(_0x56aa79){if(_0x56aa79){var _0x52f1d4=path[_0xe32c('0x4b')](config['root'],_0xe32c('0x4c'),util[_0xe32c('0x4d')](_0xe32c('0x4e'),path[_0xe32c('0x4f')](_0x56aa79['path'])));var _0x2fe2ba=fs[_0xe32c('0x50')](_0x52f1d4);var _0x222cdb=archiver(_0xe32c('0x51'),{'zlib':{'level':0x9}});_0x222cdb['on'](_0xe32c('0x52'),function(_0x964f34){if(_0x964f34[_0xe32c('0x53')]===_0xe32c('0x54')){logger['error'](_0x964f34);}else{throw new db[(_0xe32c('0x55'))][(_0xe32c('0x56'))](_0xe32c('0x57'));}});_0x222cdb['on'](_0xe32c('0x2a'),function(_0x46cc06){throw new db[(_0xe32c('0x55'))][(_0xe32c('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x222cdb[_0xe32c('0x58')](_0x2fe2ba);_0x222cdb[_0xe32c('0x59')]('**/*',{'cwd':path[_0xe32c('0x4b')](config[_0xe32c('0x5a')],'server/files/plugins',path['dirname'](_0x56aa79['path'])),'ignore':[path[_0xe32c('0x4b')](path['basename'](_0x56aa79[_0xe32c('0x5b')]),'node_modules/**/*'),path[_0xe32c('0x4b')](path[_0xe32c('0x4f')](_0x56aa79['path']),_0xe32c('0x5c'))],'nodir':!![]})[_0xe32c('0x5d')]();_0x2fe2ba['on'](_0xe32c('0x5e'),function(){if(!fs[_0xe32c('0x5f')](_0x52f1d4)){throw new db['Sequelize'][(_0xe32c('0x56'))](_0xe32c('0x60'));}return _0x149324['download'](_0x52f1d4,util[_0xe32c('0x4d')]('%s.zip',path['basename'](_0x56aa79[_0xe32c('0x5b')])),function(_0x181e14){if(_0x181e14){throw new db[(_0xe32c('0x55'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xe32c('0x61')](_0x52f1d4);logger[_0xe32c('0x62')]('Download\x20completed');logger[_0xe32c('0x62')](_0xe32c('0x63'));});});}return null;})[_0xe32c('0x46')](handleError(_0x149324,null));};exports[_0xe32c('0x64')]=function(_0x3b635f,_0x417fee,_0x2d0d52){var _0x2fecd8=path[_0xe32c('0x4f')](_0x3b635f[_0xe32c('0x65')][_0xe32c('0x66')],path[_0xe32c('0x67')](_0x3b635f[_0xe32c('0x65')]['filename']));var _0x1e273a=path[_0xe32c('0x4b')](config[_0xe32c('0x5a')],_0xe32c('0x4c'),_0x3b635f[_0xe32c('0x65')]['filename']);var _0x454c2b=path[_0xe32c('0x4b')](config['root'],_0xe32c('0x4c'),_0x2fecd8);logger[_0xe32c('0x62')]('Plugin\x20upload\x20filepath:\x20%s',_0x1e273a);logger[_0xe32c('0x62')](_0xe32c('0x68'),_0x454c2b);try{fs[_0xe32c('0x69')](_0x1e273a,parseInt(_0xe32c('0x6a'),0x8));extract(_0x1e273a,{'dir':_0x454c2b},function(_0x59048a){if(_0x59048a){logger[_0xe32c('0x2a')](_0x59048a);handleError(_0x59048a,!![]);};var _0x262d19=fs['readdirSync'](_0x454c2b);if(_0x262d19[_0xe32c('0x39')]>0x1){removeReferences(_0x1e273a,_0x454c2b);logger[_0xe32c('0x2a')](_0xe32c('0x6b'));return _0x2d0d52(new Error(_0xe32c('0x6b')));}var _0xf4e365=fs[_0xe32c('0x6c')](path[_0xe32c('0x4b')](_0x454c2b,_0x262d19[0x0]));if(_0xf4e365[_0xe32c('0x6d')]()){removeReferences(_0x1e273a,_0x454c2b);logger[_0xe32c('0x2a')](_0xe32c('0x6b'));return _0x2d0d52(new Error('Invalid\x20plugin\x20structure'));}if(_0xf4e365[_0xe32c('0x6e')]()){var _0x4d3e73=fs[_0xe32c('0x6f')](path['join'](_0x454c2b,_0x262d19[0x0]));if(_0x4d3e73[_0xe32c('0x39')]===0x0){removeReferences(_0x1e273a,_0x454c2b);logger[_0xe32c('0x2a')](_0xe32c('0x6b'));return _0x2d0d52(new Error(_0xe32c('0x6b')));}var _0x1017f2=_0x4d3e73[_0xe32c('0x70')](function(_0x2387fd){return _0x2387fd===_0xe32c('0x71');});if(!_0x1017f2){return _0x2d0d52(new Error(_0xe32c('0x72')));}var _0x3a4823=fs[_0xe32c('0x73')](path['join'](_0x454c2b,_0x262d19[0x0],_0xe32c('0x71')));var _0x4b2a42=JSON[_0xe32c('0x74')](_0x3a4823);if(_0xe32c('0x1d')==typeof _0x4b2a42[_0xe32c('0x2c')]){return _0x2d0d52(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xe32c('0x1d')==typeof _0x4b2a42[_0xe32c('0x30')]){return _0x2d0d52(new Error(_0xe32c('0x75')));}if(_0xe32c('0x1d')==typeof _0x4b2a42[_0xe32c('0x76')]){return _0x2d0d52(new Error(_0xe32c('0x77')));}if('undefined'==typeof _0x4b2a42[_0xe32c('0x78')]){return _0x2d0d52(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4b2a42[_0xe32c('0x30')]===_0xe32c('0x79')){if('undefined'==typeof _0x4b2a42['parameters']['views']){return _0x2d0d52(new Error(_0xe32c('0x7a')));}if(_0xe32c('0x1d')==typeof _0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7b')]['admin']&&_0xe32c('0x1d')==typeof _0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7b')]['agent']){return _0x2d0d52(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4b2a42[_0xe32c('0x30')]===_0xe32c('0x7c')){if('undefined'==typeof _0x4b2a42[_0xe32c('0x78')]['scriptName']){return _0x2d0d52(new Error(_0xe32c('0x7d')));}if(_0xe32c('0x1d')==typeof _0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7e')]){return _0x2d0d52(new Error(_0xe32c('0x7f')));}}else{return _0x2d0d52(new Error(_0xe32c('0x80')));}var _0x586bf0=_0x4b2a42[_0xe32c('0x2c')];var _0xd79db2=_0x4b2a42[_0xe32c('0x81')];var _0x551c6d=_0x4b2a42[_0xe32c('0x30')];var _0x2f31bc=_0x4b2a42['sidebar']?_0x4b2a42['sidebar']:_0xe32c('0x82');var _0x1312cd=_0x4b2a42[_0xe32c('0x83')]?_0x4b2a42[_0xe32c('0x83')]:_0xe32c('0x84');var _0x11b12f='';var _0x5aeb67='';var _0x1d9081='';var _0x507e7c='';var _0x3d419e=_0x4b2a42[_0xe32c('0x76')];if(_0x551c6d==='html'){if(_0xe32c('0x1d')!=typeof _0x4b2a42[_0xe32c('0x78')]['views'][_0xe32c('0x85')]){var _0x77367=_0x4b2a42['parameters'][_0xe32c('0x7b')][_0xe32c('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xe32c('0x86')](_0x77367)){_0x11b12f=path[_0xe32c('0x4b')](_0xe32c('0x87'),_0x2fecd8,_0x262d19[0x0],_0x77367);}else{_0x11b12f=_0x77367;}}else{logger['info'](_0xe32c('0x88'));}if(_0xe32c('0x1d')!=typeof _0x4b2a42[_0xe32c('0x78')]['views'][_0xe32c('0x89')]){var _0x118f44=_0x4b2a42['parameters'][_0xe32c('0x7b')][_0xe32c('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xe32c('0x86')](_0x118f44)){_0x5aeb67=path[_0xe32c('0x4b')]('plugins',_0x2fecd8,_0x262d19[0x0],_0x118f44);}else{_0x5aeb67=_0x118f44;}}else{logger[_0xe32c('0x62')](_0xe32c('0x8a'));}}else if(_0x551c6d===_0xe32c('0x7c')){_0x1d9081=_0x4b2a42[_0xe32c('0x78')][_0xe32c('0x8b')];_0x507e7c=_0x4b2a42['parameters'][_0xe32c('0x7e')];if(_0xe32c('0x1d')!=typeof _0x4b2a42[_0xe32c('0x78')]['views']){if('undefined'!=typeof _0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7b')][_0xe32c('0x85')]){var _0x77367=_0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7b')][_0xe32c('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x77367)){_0x11b12f=path[_0xe32c('0x4b')](_0xe32c('0x87'),_0x2fecd8,_0x262d19[0x0],_0x77367);}else{_0x11b12f=_0x77367;}}if(_0xe32c('0x1d')!=typeof _0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7b')]['agent']){var _0x118f44=_0x4b2a42[_0xe32c('0x78')][_0xe32c('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x118f44)){_0x5aeb67=path[_0xe32c('0x4b')](_0xe32c('0x87'),_0x2fecd8,_0x262d19[0x0],_0x118f44);}else{_0x5aeb67=_0x118f44;}}}}var _0x4aa1e1={'name':_0x586bf0,'description':_0xd79db2,'path':path[_0xe32c('0x4b')](_0x2fecd8,_0x262d19[0x0]),'type':_0x551c6d,'sidebar':_0x2f31bc,'icon':_0x1312cd,'adminUrl':_0x11b12f,'agentUrl':_0x5aeb67,'scriptName':_0x1d9081,'scriptPath':_0x507e7c,'version':_0x3d419e};removeReferences(_0x1e273a,null);return db['Plugin']['create'](_0x4aa1e1)[_0xe32c('0x25')](function(_0x32e3e7){var _0x16bbf8={'role':_0x3b635f[_0xe32c('0x8c')][_0xe32c('0x8d')],'userProfileId':_0x3b635f[_0xe32c('0x8c')][_0xe32c('0x8e')]};if(!_0x16bbf8)throw new Error(_0xe32c('0x8f'));if(_0x16bbf8[_0xe32c('0x8d')]===_0xe32c('0x90')){var _0x4b7857=_0x32e3e7[_0xe32c('0x26')]({'plain':!![]});return db[_0xe32c('0x91')]['find']({'where':{'name':_0xe32c('0x27'),'userProfileId':_0x16bbf8[_0xe32c('0x8e')]},'raw':!![]})['then'](function(_0xc1c8c){if(_0xc1c8c&&_0xc1c8c['autoAssociation']===0x0){return db['UserProfileResource'][_0xe32c('0x92')]({'name':_0x4b7857[_0xe32c('0x2c')],'resourceId':_0x4b7857['id'],'type':_0xc1c8c[_0xe32c('0x2c')],'sectionId':_0xc1c8c['id']},{})[_0xe32c('0x25')](function(){return _0x32e3e7;});}else{return _0x32e3e7;}})[_0xe32c('0x46')](function(_0x3396e1){logger[_0xe32c('0x2a')](_0xe32c('0x93'),_0x3396e1);throw _0x3396e1;});}return _0x32e3e7;})[_0xe32c('0x25')](respondWithResult(_0x417fee,null))[_0xe32c('0x46')](handleError(_0x417fee,null));}});}catch(_0x1982ac){_0x417fee[_0xe32c('0x1b')](0x1f4)[_0xe32c('0x2d')](_0x1982ac);}};function removeReferences(_0x5376d3,_0xbd3dfe){try{if(_0x5376d3){fs[_0xe32c('0x61')](_0x5376d3);logger[_0xe32c('0x62')](_0xe32c('0x94'));}if(_0xbd3dfe){rimraf(_0xbd3dfe,function(){});logger[_0xe32c('0x62')]('Extracted\x20folder\x20removed');}}catch(_0x214fe4){logger[_0xe32c('0x2a')](_0x214fe4);}}exports['update']=function(_0x3e0447,_0x4405eb,_0x2d3547){return db[_0xe32c('0x2e')][_0xe32c('0x4a')]({'where':{'id':_0x3e0447[_0xe32c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4405eb,null))['then'](saveUpdates(_0x3e0447[_0xe32c('0x8c')],null))[_0xe32c('0x25')](respondWithResult(_0x4405eb,null))[_0xe32c('0x46')](handleError(_0x4405eb,null));};exports[_0xe32c('0x95')]=function(_0x52cd4b,_0x21c1ee,_0x418d23){return db[_0xe32c('0x2e')][_0xe32c('0x4a')]({'where':{'id':_0x52cd4b[_0xe32c('0x47')]['id']}})[_0xe32c('0x25')](function(_0x2fe185){if(_0x2fe185){return _0x2fe185[_0xe32c('0x29')]();}})[_0xe32c('0x25')](function(_0x2680c7){rimraf(path[_0xe32c('0x4b')](config['root'],_0xe32c('0x4c'),path[_0xe32c('0x96')](_0x2680c7[_0xe32c('0x5b')])),function(){});return _0x2680c7;})[_0xe32c('0x25')](handleEntityNotFound(_0x21c1ee,null))['then'](respondWithStatusCode(_0x21c1ee,null))[_0xe32c('0x46')](handleError(_0x21c1ee,null));};exports['webhookGet']=function(_0x1ad9c6,_0x4fe8b8,_0x11bf54){return BPromise[_0xe32c('0x97')]()[_0xe32c('0x25')](function(){if(!_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x5b')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1ad9c6[_0xe32c('0x34')]['port']){throw new Error(_0xe32c('0x98'));}var _0x381c2f=_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x99')]?_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x99')]+':'+_0x1ad9c6[_0xe32c('0x34')]['port']:'http://localhost:'+_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x9a')];var _0x57bb90=_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x9b')]?_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x9b')]:!![];var _0x8cf0db=_0x1ad9c6[_0xe32c('0x34')][_0xe32c('0x9c')]?_0x1ad9c6[_0xe32c('0x34')]['encoding']:null;var _0xcd1fe5={'method':_0x1ad9c6[_0xe32c('0x9d')],'uri':util['format']('%s%s',_0x381c2f,_0x1ad9c6[_0xe32c('0x34')]['path']),'json':_0x57bb90,'resolveWithFullResponse':!![],'encoding':_0x8cf0db,'qs':_0x1ad9c6[_0xe32c('0x34')]};if(_0x1ad9c6[_0xe32c('0x9e')]){_0xcd1fe5[_0xe32c('0x9e')]=_0x1ad9c6[_0xe32c('0x9e')];if(_0xcd1fe5['headers']['content-length']){delete _0xcd1fe5[_0xe32c('0x9e')][_0xe32c('0x9f')];}}if(_0xcd1fe5[_0xe32c('0x9e')][_0xe32c('0xa0')]){delete _0xcd1fe5[_0xe32c('0x9e')]['content-type'];}return rp(_0xcd1fe5);})[_0xe32c('0x25')](function(_0x3f7a3f){if(_0x3f7a3f){_0x4fe8b8[_0xe32c('0x20')](_0x3f7a3f[_0xe32c('0x9e')]);logger[_0xe32c('0x62')](_0x3f7a3f['body']);if(_[_0xe32c('0xa1')](_0x1ad9c6[_0xe32c('0x34')]['path'],'download')&&_0x3f7a3f['statusCode']==0x1f4){return _0x4fe8b8[_0xe32c('0x19')](_0x3f7a3f[_0xe32c('0xa2')]);}else{return _0x4fe8b8[_0xe32c('0x1b')](_0x3f7a3f['statusCode'])[_0xe32c('0x2d')](_0x3f7a3f[_0xe32c('0x8c')]);}}else{return _0x4fe8b8[_0xe32c('0x19')](0xc8);}})['catch'](handleError(_0x4fe8b8,null));};exports[_0xe32c('0xa3')]=function(_0x1c387a,_0x17bca1,_0x449655){return BPromise['resolve']()[_0xe32c('0x25')](function(){if(!_0x1c387a[_0xe32c('0x34')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1c387a[_0xe32c('0x34')][_0xe32c('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5a1310=_0x1c387a[_0xe32c('0x34')][_0xe32c('0x99')]?_0x1c387a[_0xe32c('0x34')][_0xe32c('0x99')]+':'+_0x1c387a[_0xe32c('0x34')]['port']:'http://localhost:'+_0x1c387a['query'][_0xe32c('0x9a')];var _0x372370=_0x1c387a[_0xe32c('0x34')][_0xe32c('0x9b')]?_0x1c387a[_0xe32c('0x34')][_0xe32c('0x9b')]:!![];var _0x53ed42=_0x1c387a['query'][_0xe32c('0x9c')]?_0x1c387a['query'][_0xe32c('0x9c')]:null;var _0x5af510={'method':_0x1c387a['method'],'uri':util[_0xe32c('0x4d')](_0xe32c('0xa4'),_0x5a1310,_0x1c387a[_0xe32c('0x34')]['path']),'json':_0x372370,'resolveWithFullResponse':!![],'encoding':_0x53ed42,'body':_0x1c387a['body']};if(_0x1c387a[_0xe32c('0x9e')]){_0x5af510[_0xe32c('0x9e')]=_0x1c387a[_0xe32c('0x9e')];if(_0x5af510[_0xe32c('0x9e')][_0xe32c('0x9f')]){delete _0x5af510[_0xe32c('0x9e')][_0xe32c('0x9f')];}}if(_0x5af510[_0xe32c('0x9e')][_0xe32c('0xa0')]){delete _0x5af510[_0xe32c('0x9e')][_0xe32c('0xa0')];}return rp(_0x5af510);})['then'](function(_0x4884a1){if(_0x4884a1){_0x17bca1[_0xe32c('0x20')](_0x4884a1[_0xe32c('0x9e')]);logger[_0xe32c('0x62')](_0x4884a1[_0xe32c('0x8c')]);return _0x17bca1[_0xe32c('0x1b')](_0x4884a1[_0xe32c('0xa2')])['send'](_0x4884a1[_0xe32c('0x8c')]);}else{return _0x17bca1[_0xe32c('0x19')](0xc8);}})[_0xe32c('0x46')](handleError(_0x17bca1,null));}; \ No newline at end of file +var _0x5693=['lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','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','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','set','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','port','%s%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','update','destroy','get','Plugins','then','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','catch','show','keys','length','includeAll','download','find','params','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','finalize','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','root','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure'];(function(_0x4fa47e,_0x15b71e){var _0x3dd3c0=function(_0x56d69f){while(--_0x56d69f){_0x4fa47e['push'](_0x4fa47e['shift']());}};_0x3dd3c0(++_0x15b71e);}(_0x5693,0x18c));var _0x3569=function(_0x9c0852,_0x54a062){_0x9c0852=_0x9c0852-0x0;var _0x707adb=_0x5693[_0x9c0852];return _0x707adb;};'use strict';var emlformat=require(_0x3569('0x0'));var rimraf=require(_0x3569('0x1'));var zipdir=require(_0x3569('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3569('0x3'));var moment=require(_0x3569('0x4'));var BPromise=require(_0x3569('0x5'));var Mustache=require(_0x3569('0x6'));var util=require(_0x3569('0x7'));var path=require(_0x3569('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3569('0x9'));var fs=require('fs');var fs_extra=require(_0x3569('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3569('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3569('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3569('0xd'));var extract=require(_0x3569('0xe'));var rimraf=require(_0x3569('0x1'));var archiver=require(_0x3569('0xf'));var Redis=require(_0x3569('0x10'));var authService=require(_0x3569('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3569('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3569('0x13'))(_0x3569('0x14'));var utils=require(_0x3569('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3569('0x16'));var db=require('../../mysqldb')['db'];config[_0x3569('0x17')]=_[_0x3569('0x18')](config[_0x3569('0x17')],{'host':_0x3569('0x19'),'port':0x18eb});var socket=require(_0x3569('0x1a'))(new Redis(config[_0x3569('0x17')]));require(_0x3569('0x1b'))[_0x3569('0x1c')](socket);function respondWithStatusCode(_0x1ab18e,_0x224964){_0x224964=_0x224964||0xcc;return function(_0xffe20c){if(_0xffe20c){return _0x1ab18e[_0x3569('0x1d')](_0x224964);}return _0x1ab18e[_0x3569('0x1e')](_0x224964)['end']();};}function respondWithResult(_0xbf8237,_0xabf5a2){_0xabf5a2=_0xabf5a2||0xc8;return function(_0xeaf655){if(_0xeaf655){return _0xbf8237[_0x3569('0x1e')](_0xabf5a2)[_0x3569('0x1f')](_0xeaf655);}};}function respondWithFilteredResult(_0x2e0b06,_0x4b5926){return function(_0x30285d){if(_0x30285d){var _0x53f81e=typeof _0x4b5926[_0x3569('0x20')]===_0x3569('0x21')&&typeof _0x4b5926['limit']==='undefined';var _0x4739e4=_0x30285d[_0x3569('0x22')];var _0x55d212=_0x53f81e?0x0:_0x4b5926[_0x3569('0x20')];var _0x474d9d=_0x53f81e?_0x30285d[_0x3569('0x22')]:_0x4b5926['offset']+_0x4b5926[_0x3569('0x23')];var _0x132e14;if(_0x474d9d>=_0x4739e4){_0x474d9d=_0x4739e4;_0x132e14=0xc8;}else{_0x132e14=0xce;}_0x2e0b06[_0x3569('0x1e')](_0x132e14);return _0x2e0b06['set'](_0x3569('0x24'),_0x55d212+'-'+_0x474d9d+'/'+_0x4739e4)[_0x3569('0x1f')](_0x30285d);}return null;};}function patchUpdates(_0x576fe1){return function(_0x36544a){try{jsonpatch['apply'](_0x36544a,_0x576fe1,!![]);}catch(_0x1b1f9e){return BPromise[_0x3569('0x25')](_0x1b1f9e);}return _0x36544a['save']();};}function saveUpdates(_0x124316,_0x4f470f){return function(_0x3b91af){if(_0x3b91af){return _0x3b91af[_0x3569('0x26')](_0x124316)['then'](function(_0x2c6199){return _0x2c6199;});}return null;};}function removeEntity(_0x214336,_0x280637){return function(_0x427971){if(_0x427971){return _0x427971[_0x3569('0x27')]()['then'](function(){var _0x372c0a=_0x427971[_0x3569('0x28')]({'plain':!![]});var _0x16a55e=_0x3569('0x29');return db['UserProfileResource'][_0x3569('0x27')]({'where':{'type':_0x16a55e,'resourceId':_0x372c0a['id']}})[_0x3569('0x2a')](function(){return _0x427971;});})['then'](function(){_0x214336[_0x3569('0x1e')](0xcc)[_0x3569('0x2b')]();});}};}function handleEntityNotFound(_0x29f578,_0x5533d5){return function(_0x2eef07){if(!_0x2eef07){_0x29f578[_0x3569('0x1d')](0x194);}return _0x2eef07;};}function handleError(_0x5044a4,_0x5260d5){_0x5260d5=_0x5260d5||0x1f4;return function(_0xc8392a){logger[_0x3569('0x2c')](_0xc8392a[_0x3569('0x2d')]);if(_0xc8392a[_0x3569('0x2e')]){delete _0xc8392a[_0x3569('0x2e')];}_0x5044a4[_0x3569('0x1e')](_0x5260d5)[_0x3569('0x2f')](_0xc8392a);};}exports[_0x3569('0x30')]=function(_0x3d3c04,_0x2f9daf){var _0x4df9e0={},_0x44bfa8={},_0x7c30e0={'count':0x0,'rows':[]};var _0x5cd27b=_[_0x3569('0x31')](db[_0x3569('0x32')][_0x3569('0x33')],function(_0x1da181){return{'name':_0x1da181[_0x3569('0x34')],'type':_0x1da181[_0x3569('0x35')][_0x3569('0x36')]};});_0x44bfa8['model']=_[_0x3569('0x31')](_0x5cd27b,_0x3569('0x2e'));_0x44bfa8[_0x3569('0x37')]=_['keys'](_0x3d3c04[_0x3569('0x37')]);_0x44bfa8[_0x3569('0x38')]=_[_0x3569('0x39')](_0x44bfa8[_0x3569('0x3a')],_0x44bfa8[_0x3569('0x37')]);_0x4df9e0[_0x3569('0x3b')]=_[_0x3569('0x39')](_0x44bfa8[_0x3569('0x3a')],qs[_0x3569('0x3c')](_0x3d3c04['query'][_0x3569('0x3c')]));_0x4df9e0[_0x3569('0x3b')]=_0x4df9e0[_0x3569('0x3b')]['length']?_0x4df9e0[_0x3569('0x3b')]:_0x44bfa8[_0x3569('0x3a')];if(!_0x3d3c04['query'][_0x3569('0x3d')](_0x3569('0x3e'))){_0x4df9e0[_0x3569('0x23')]=qs['limit'](_0x3d3c04[_0x3569('0x37')][_0x3569('0x23')]);_0x4df9e0['offset']=qs[_0x3569('0x20')](_0x3d3c04[_0x3569('0x37')]['offset']);}_0x4df9e0[_0x3569('0x3f')]=qs['sort'](_0x3d3c04[_0x3569('0x37')][_0x3569('0x40')]);_0x4df9e0['where']=qs['filters'](_[_0x3569('0x41')](_0x3d3c04[_0x3569('0x37')],_0x44bfa8[_0x3569('0x38')]),_0x5cd27b);if(_0x3d3c04[_0x3569('0x37')][_0x3569('0x42')]){_0x4df9e0[_0x3569('0x43')]=_[_0x3569('0x44')](_0x4df9e0[_0x3569('0x43')],{'$or':_[_0x3569('0x31')](_0x5cd27b,function(_0x24d6a0){if(_0x24d6a0[_0x3569('0x35')]!==_0x3569('0x45')){var _0x533a6b={};_0x533a6b[_0x24d6a0[_0x3569('0x2e')]]={'$like':'%'+_0x3d3c04[_0x3569('0x37')][_0x3569('0x42')]+'%'};return _0x533a6b;}})});}_0x4df9e0=_[_0x3569('0x44')]({},_0x4df9e0,_0x3d3c04[_0x3569('0x46')]);var _0xbe6648={'where':_0x4df9e0[_0x3569('0x43')]};return db[_0x3569('0x32')][_0x3569('0x22')](_0xbe6648)[_0x3569('0x2a')](function(_0x1c15c9){_0x7c30e0['count']=_0x1c15c9;if(_0x3d3c04[_0x3569('0x37')]['includeAll']){_0x4df9e0[_0x3569('0x47')]=[{'all':!![]}];}return db[_0x3569('0x32')]['findAll'](_0x4df9e0);})[_0x3569('0x2a')](function(_0xf76e30){_0x7c30e0['rows']=_0xf76e30;return _0x7c30e0;})['then'](respondWithFilteredResult(_0x2f9daf,_0x4df9e0))[_0x3569('0x48')](handleError(_0x2f9daf,null));};exports[_0x3569('0x49')]=function(_0x2b755b,_0x588a9a){var _0x3cb825={'raw':!![],'where':{'id':_0x2b755b['params']['id']}},_0x44f7b6={};_0x44f7b6['model']=_[_0x3569('0x4a')](db[_0x3569('0x32')][_0x3569('0x33')]);_0x44f7b6[_0x3569('0x37')]=_[_0x3569('0x4a')](_0x2b755b[_0x3569('0x37')]);_0x44f7b6[_0x3569('0x38')]=_['intersection'](_0x44f7b6[_0x3569('0x3a')],_0x44f7b6[_0x3569('0x37')]);_0x3cb825[_0x3569('0x3b')]=_[_0x3569('0x39')](_0x44f7b6['model'],qs['fields'](_0x2b755b[_0x3569('0x37')]['fields']));_0x3cb825['attributes']=_0x3cb825[_0x3569('0x3b')][_0x3569('0x4b')]?_0x3cb825[_0x3569('0x3b')]:_0x44f7b6[_0x3569('0x3a')];if(_0x2b755b[_0x3569('0x37')][_0x3569('0x4c')]){_0x3cb825[_0x3569('0x47')]=[{'all':!![]}];}_0x3cb825=_[_0x3569('0x44')]({},_0x3cb825,_0x2b755b[_0x3569('0x46')]);return db[_0x3569('0x32')]['find'](_0x3cb825)['then'](handleEntityNotFound(_0x588a9a,null))['then'](respondWithResult(_0x588a9a,null))[_0x3569('0x48')](handleError(_0x588a9a,null));};exports[_0x3569('0x4d')]=function(_0x54d5de,_0x13f194,_0x667841){return db[_0x3569('0x32')][_0x3569('0x4e')]({'where':{'id':_0x54d5de[_0x3569('0x4f')]['id']},'attributes':['name',_0x3569('0x8')],'raw':!![]})[_0x3569('0x2a')](handleEntityNotFound(_0x13f194,null))['then'](function(_0x46bf69){if(_0x46bf69){var _0x5dd9c0=path[_0x3569('0x50')](config['root'],_0x3569('0x51'),util[_0x3569('0x52')](_0x3569('0x53'),path[_0x3569('0x54')](_0x46bf69['path'])));var _0x132296=fs[_0x3569('0x55')](_0x5dd9c0);var _0x2bccae=archiver(_0x3569('0x56'),{'zlib':{'level':0x9}});_0x2bccae['on'](_0x3569('0x57'),function(_0x3d3726){if(_0x3d3726['code']==='ENOENT'){logger[_0x3569('0x2c')](_0x3d3726);}else{throw new db['Sequelize'][(_0x3569('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2bccae['on'](_0x3569('0x2c'),function(_0x3faf0c){throw new db[(_0x3569('0x59'))]['Error'](_0x3569('0x5a'));});_0x2bccae[_0x3569('0x5b')](_0x132296);_0x2bccae[_0x3569('0x5c')](_0x3569('0x5d'),{'cwd':path['join'](config['root'],_0x3569('0x51'),path[_0x3569('0x5e')](_0x46bf69[_0x3569('0x8')])),'ignore':[path[_0x3569('0x50')](path['basename'](_0x46bf69['path']),_0x3569('0x5f')),path[_0x3569('0x50')](path['basename'](_0x46bf69[_0x3569('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x3569('0x60')]();_0x132296['on']('close',function(){if(!fs['existsSync'](_0x5dd9c0)){throw new db[(_0x3569('0x59'))][(_0x3569('0x58'))](_0x3569('0x61'));}return _0x13f194['download'](_0x5dd9c0,util[_0x3569('0x52')](_0x3569('0x53'),path[_0x3569('0x54')](_0x46bf69[_0x3569('0x8')])),function(_0x168d32){if(_0x168d32){throw new db['Sequelize'][(_0x3569('0x58'))](_0x3569('0x62'));}fs[_0x3569('0x63')](_0x5dd9c0);logger[_0x3569('0x64')](_0x3569('0x65'));logger[_0x3569('0x64')](_0x3569('0x66'));});});}return null;})[_0x3569('0x48')](handleError(_0x13f194,null));};exports[_0x3569('0x67')]=function(_0x167683,_0x417748,_0x991e06){var _0x40faba=path[_0x3569('0x54')](_0x167683[_0x3569('0x68')][_0x3569('0x69')],path['extname'](_0x167683[_0x3569('0x68')][_0x3569('0x69')]));var _0x33a73c=path[_0x3569('0x50')](config[_0x3569('0x6a')],'server/files/plugins',_0x167683[_0x3569('0x68')][_0x3569('0x69')]);var _0x16633a=path[_0x3569('0x50')](config['root'],_0x3569('0x51'),_0x40faba);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x33a73c);logger[_0x3569('0x64')](_0x3569('0x6b'),_0x16633a);try{fs[_0x3569('0x6c')](_0x33a73c,parseInt(_0x3569('0x6d'),0x8));extract(_0x33a73c,{'dir':_0x16633a},function(_0x445f70){if(_0x445f70){logger[_0x3569('0x2c')](_0x445f70);handleError(_0x445f70,!![]);};var _0xe1318a=fs['readdirSync'](_0x16633a);if(_0xe1318a['length']>0x1){removeReferences(_0x33a73c,_0x16633a);logger['error'](_0x3569('0x6e'));return _0x991e06(new Error('Invalid\x20plugin\x20structure'));}var _0x1caf28=fs[_0x3569('0x6f')](path[_0x3569('0x50')](_0x16633a,_0xe1318a[0x0]));if(_0x1caf28[_0x3569('0x70')]()){removeReferences(_0x33a73c,_0x16633a);logger[_0x3569('0x2c')]('Invalid\x20plugin\x20structure');return _0x991e06(new Error('Invalid\x20plugin\x20structure'));}if(_0x1caf28['isDirectory']()){var _0x1e4ffd=fs['readdirSync'](path[_0x3569('0x50')](_0x16633a,_0xe1318a[0x0]));if(_0x1e4ffd[_0x3569('0x4b')]===0x0){removeReferences(_0x33a73c,_0x16633a);logger[_0x3569('0x2c')](_0x3569('0x6e'));return _0x991e06(new Error('Invalid\x20plugin\x20structure'));}var _0x4aba4f=_0x1e4ffd[_0x3569('0x71')](function(_0xd5fc44){return _0xd5fc44===_0x3569('0x72');});if(!_0x4aba4f){return _0x991e06(new Error(_0x3569('0x73')));}var _0x1c141d=fs[_0x3569('0x74')](path[_0x3569('0x50')](_0x16633a,_0xe1318a[0x0],_0x3569('0x72')));var _0x49fe05=JSON['parse'](_0x1c141d);if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x2e')]){return _0x991e06(new Error(_0x3569('0x75')));}if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x35')]){return _0x991e06(new Error(_0x3569('0x76')));}if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x77')]){return _0x991e06(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x78')]){return _0x991e06(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x49fe05[_0x3569('0x35')]===_0x3569('0x79')){if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')]){return _0x991e06(new Error(_0x3569('0x7b')));}if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7c')]&&_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7d')]){return _0x991e06(new Error(_0x3569('0x7e')));}}else if(_0x49fe05['type']===_0x3569('0x7f')){if(_0x3569('0x21')==typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x80')]){return _0x991e06(new Error(_0x3569('0x81')));}if('undefined'==typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x82')]){return _0x991e06(new Error(_0x3569('0x83')));}}else{return _0x991e06(new Error(_0x3569('0x84')));}var _0x11cca8=_0x49fe05[_0x3569('0x2e')];var _0x1a51a6=_0x49fe05[_0x3569('0x85')];var _0x31ff68=_0x49fe05[_0x3569('0x35')];var _0x5171b1=_0x49fe05['sidebar']?_0x49fe05[_0x3569('0x86')]:_0x3569('0x87');var _0x5eb0bc=_0x49fe05[_0x3569('0x88')]?_0x49fe05[_0x3569('0x88')]:_0x3569('0x89');var _0x5a825a='';var _0x784d3e='';var _0x465f53='';var _0xf4917b='';var _0x349cb3=_0x49fe05[_0x3569('0x77')];if(_0x31ff68===_0x3569('0x79')){if(_0x3569('0x21')!=typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7c')]){var _0x8bb8e8=_0x49fe05[_0x3569('0x78')][_0x3569('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x8bb8e8)){_0x5a825a=path[_0x3569('0x50')](_0x3569('0x8a'),_0x40faba,_0xe1318a[0x0],_0x8bb8e8);}else{_0x5a825a=_0x8bb8e8;}}else{logger[_0x3569('0x64')](_0x3569('0x8b'));}if('undefined'!=typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7d')]){var _0x550884=_0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x3569('0x8c')](_0x550884)){_0x784d3e=path[_0x3569('0x50')](_0x3569('0x8a'),_0x40faba,_0xe1318a[0x0],_0x550884);}else{_0x784d3e=_0x550884;}}else{logger[_0x3569('0x64')](_0x3569('0x8d'));}}else if(_0x31ff68===_0x3569('0x7f')){_0x465f53=_0x49fe05['parameters'][_0x3569('0x80')];_0xf4917b=_0x49fe05[_0x3569('0x78')][_0x3569('0x82')];if(_0x3569('0x21')!=typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')]){if(_0x3569('0x21')!=typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7c')]){var _0x8bb8e8=_0x49fe05[_0x3569('0x78')][_0x3569('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x8bb8e8)){_0x5a825a=path[_0x3569('0x50')](_0x3569('0x8a'),_0x40faba,_0xe1318a[0x0],_0x8bb8e8);}else{_0x5a825a=_0x8bb8e8;}}if(_0x3569('0x21')!=typeof _0x49fe05[_0x3569('0x78')][_0x3569('0x7a')][_0x3569('0x7d')]){var _0x550884=_0x49fe05[_0x3569('0x78')]['views'][_0x3569('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x3569('0x8c')](_0x550884)){_0x784d3e=path[_0x3569('0x50')](_0x3569('0x8a'),_0x40faba,_0xe1318a[0x0],_0x550884);}else{_0x784d3e=_0x550884;}}}}var _0x5859cf={'name':_0x11cca8,'description':_0x1a51a6,'path':path[_0x3569('0x50')](_0x40faba,_0xe1318a[0x0]),'type':_0x31ff68,'sidebar':_0x5171b1,'icon':_0x5eb0bc,'adminUrl':_0x5a825a,'agentUrl':_0x784d3e,'scriptName':_0x465f53,'scriptPath':_0xf4917b,'version':_0x349cb3};removeReferences(_0x33a73c,null);return db['Plugin'][_0x3569('0x8e')](_0x5859cf)['then'](function(_0x480dac){var _0x15010a={'role':_0x167683[_0x3569('0x8f')][_0x3569('0x90')],'userProfileId':_0x167683[_0x3569('0x8f')]['userProfileId']};if(!_0x15010a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15010a['role']===_0x3569('0x91')){var _0x1ac503=_0x480dac[_0x3569('0x28')]({'plain':!![]});return db[_0x3569('0x92')][_0x3569('0x4e')]({'where':{'name':'Plugins','userProfileId':_0x15010a['userProfileId']},'raw':!![]})[_0x3569('0x2a')](function(_0x2da457){if(_0x2da457&&_0x2da457[_0x3569('0x93')]===0x0){return db[_0x3569('0x94')][_0x3569('0x8e')]({'name':_0x1ac503['name'],'resourceId':_0x1ac503['id'],'type':_0x2da457['name'],'sectionId':_0x2da457['id']},{})[_0x3569('0x2a')](function(){return _0x480dac;});}else{return _0x480dac;}})[_0x3569('0x48')](function(_0x473ad1){logger[_0x3569('0x2c')](_0x3569('0x95'),_0x473ad1);throw _0x473ad1;});}return _0x480dac;})['then'](respondWithResult(_0x417748,null))[_0x3569('0x48')](handleError(_0x417748,null));}});}catch(_0x1bd804){_0x417748[_0x3569('0x1e')](0x1f4)['send'](_0x1bd804);}};function removeReferences(_0x1cca4b,_0x3e6ceb){try{if(_0x1cca4b){fs['unlinkSync'](_0x1cca4b);logger[_0x3569('0x64')](_0x3569('0x96'));}if(_0x3e6ceb){rimraf(_0x3e6ceb,function(){});logger[_0x3569('0x64')](_0x3569('0x97'));}}catch(_0x107c5b){logger[_0x3569('0x2c')](_0x107c5b);}}exports[_0x3569('0x26')]=function(_0xbe24e4,_0x44d115,_0x84b4fb){return db[_0x3569('0x32')][_0x3569('0x4e')]({'where':{'id':_0xbe24e4[_0x3569('0x4f')]['id']}})[_0x3569('0x2a')](handleEntityNotFound(_0x44d115,null))['then'](saveUpdates(_0xbe24e4['body'],null))[_0x3569('0x2a')](respondWithResult(_0x44d115,null))[_0x3569('0x48')](handleError(_0x44d115,null));};exports[_0x3569('0x98')]=function(_0x3a9e17,_0x397d20,_0x324461){return db[_0x3569('0x32')][_0x3569('0x4e')]({'where':{'id':_0x3a9e17[_0x3569('0x4f')]['id']}})[_0x3569('0x2a')](function(_0x11a177){if(_0x11a177){return _0x11a177[_0x3569('0x27')]();}})[_0x3569('0x2a')](function(_0x4cbfce){rimraf(path[_0x3569('0x50')](config['root'],_0x3569('0x51'),path[_0x3569('0x5e')](_0x4cbfce[_0x3569('0x8')])),function(){});return _0x4cbfce;})['then'](handleEntityNotFound(_0x397d20,null))[_0x3569('0x2a')](respondWithStatusCode(_0x397d20,null))[_0x3569('0x48')](handleError(_0x397d20,null));};exports[_0x3569('0x99')]=function(_0x5e46d7,_0x47db88,_0x42bfab){return BPromise[_0x3569('0x9a')]()[_0x3569('0x2a')](function(){if(!_0x5e46d7['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5e46d7[_0x3569('0x37')]['port']){throw new Error(_0x3569('0x9b'));}var _0x8583=_0x5e46d7['query'][_0x3569('0x9c')]?_0x5e46d7['query'][_0x3569('0x9c')]+':'+_0x5e46d7[_0x3569('0x37')]['port']:_0x3569('0x9d')+_0x5e46d7[_0x3569('0x37')]['port'];var _0x342393=_0x5e46d7[_0x3569('0x37')][_0x3569('0x1f')]?_0x5e46d7[_0x3569('0x37')][_0x3569('0x1f')]:!![];var _0x2909fd=_0x5e46d7['query'][_0x3569('0x9e')]?_0x5e46d7['query'][_0x3569('0x9e')]:null;var _0x36a43a={'method':_0x5e46d7[_0x3569('0x9f')],'uri':util['format']('%s%s',_0x8583,_0x5e46d7[_0x3569('0x37')][_0x3569('0x8')]),'json':_0x342393,'resolveWithFullResponse':!![],'encoding':_0x2909fd,'qs':_0x5e46d7[_0x3569('0x37')]};if(_0x5e46d7[_0x3569('0xa0')]){_0x36a43a[_0x3569('0xa0')]=_0x5e46d7[_0x3569('0xa0')];if(_0x36a43a[_0x3569('0xa0')][_0x3569('0xa1')]){delete _0x36a43a[_0x3569('0xa0')][_0x3569('0xa1')];}}if(_0x36a43a[_0x3569('0xa0')]['content-type']){delete _0x36a43a['headers'][_0x3569('0xa2')];}return rp(_0x36a43a);})[_0x3569('0x2a')](function(_0x20c727){if(_0x20c727){_0x47db88[_0x3569('0xa3')](_0x20c727[_0x3569('0xa0')]);logger[_0x3569('0x64')](_0x20c727[_0x3569('0x8f')]);if(_['endsWith'](_0x5e46d7[_0x3569('0x37')][_0x3569('0x8')],_0x3569('0x4d'))&&_0x20c727[_0x3569('0xa4')]==0x1f4){return _0x47db88[_0x3569('0x1d')](_0x20c727['statusCode']);}else{return _0x47db88[_0x3569('0x1e')](_0x20c727[_0x3569('0xa4')])[_0x3569('0x2f')](_0x20c727[_0x3569('0x8f')]);}}else{return _0x47db88[_0x3569('0x1d')](0xc8);}})['catch'](handleError(_0x47db88,null));};exports[_0x3569('0xa5')]=function(_0x30785e,_0x1775bd,_0x5cfbc3){return BPromise[_0x3569('0x9a')]()[_0x3569('0x2a')](function(){if(!_0x30785e[_0x3569('0x37')][_0x3569('0x8')]){throw new Error(_0x3569('0xa6'));}if(!_0x30785e[_0x3569('0x37')][_0x3569('0xa7')]){throw new Error(_0x3569('0x9b'));}var _0x1702b3=_0x30785e[_0x3569('0x37')][_0x3569('0x9c')]?_0x30785e[_0x3569('0x37')][_0x3569('0x9c')]+':'+_0x30785e['query']['port']:_0x3569('0x9d')+_0x30785e[_0x3569('0x37')]['port'];var _0x3f882a=_0x30785e['query']['json']?_0x30785e[_0x3569('0x37')][_0x3569('0x1f')]:!![];var _0x13fb77=_0x30785e[_0x3569('0x37')][_0x3569('0x9e')]?_0x30785e[_0x3569('0x37')][_0x3569('0x9e')]:null;var _0x46ea0c={'method':_0x30785e[_0x3569('0x9f')],'uri':util[_0x3569('0x52')](_0x3569('0xa8'),_0x1702b3,_0x30785e[_0x3569('0x37')]['path']),'json':_0x3f882a,'resolveWithFullResponse':!![],'encoding':_0x13fb77,'body':_0x30785e[_0x3569('0x8f')]};if(_0x30785e[_0x3569('0xa0')]){_0x46ea0c['headers']=_0x30785e[_0x3569('0xa0')];if(_0x46ea0c[_0x3569('0xa0')][_0x3569('0xa1')]){delete _0x46ea0c[_0x3569('0xa0')][_0x3569('0xa1')];}}if(_0x46ea0c['headers'][_0x3569('0xa2')]){delete _0x46ea0c[_0x3569('0xa0')][_0x3569('0xa2')];}return rp(_0x46ea0c);})['then'](function(_0x12e40b){if(_0x12e40b){_0x1775bd[_0x3569('0xa3')](_0x12e40b['headers']);logger['info'](_0x12e40b[_0x3569('0x8f')]);return _0x1775bd['status'](_0x12e40b['statusCode'])['send'](_0x12e40b[_0x3569('0x8f')]);}else{return _0x1775bd[_0x3569('0x1d')](0xc8);}})[_0x3569('0x48')](handleError(_0x1775bd,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 04ec88c..6233ece 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 _0x87f1=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0xdb5677,_0x228511){var _0x3f58a0=function(_0x10209d){while(--_0x10209d){_0xdb5677['push'](_0xdb5677['shift']());}};_0x3f58a0(++_0x228511);}(_0x87f1,0x170));var _0x187f=function(_0x59e225,_0x190985){_0x59e225=_0x59e225-0x0;var _0x5dc34b=_0x87f1[_0x59e225];return _0x5dc34b;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){PluginEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);PluginEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=PluginEvents; \ No newline at end of file +var _0x1b9b=['exports','events','Plugin','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x9ae292,_0x130cef){var _0xadefdd=function(_0x4506a0){while(--_0x4506a0){_0x9ae292['push'](_0x9ae292['shift']());}};_0xadefdd(++_0x130cef);}(_0x1b9b,0x89));var _0xb1b9=function(_0x93a500,_0x1878a6){_0x93a500=_0x93a500-0x0;var _0x3abec1=_0x1b9b[_0x93a500];return _0x3abec1;};'use strict';var EventEmitter=require(_0xb1b9('0x0'));var Plugin=require('../../mysqldb')['db'][_0xb1b9('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb1b9('0x2')](0x0);var events={'afterCreate':_0xb1b9('0x3'),'afterUpdate':_0xb1b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x38f77a){return function(_0x411464,_0x597f8f,_0x5c24be){PluginEvents['emit'](_0x38f77a+':'+_0x411464['id'],_0x411464);PluginEvents[_0xb1b9('0x5')](_0x38f77a,_0x411464);_0x5c24be(null);};}for(var e in events){if(events[_0xb1b9('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xb1b9('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 03fb1ca..c02a203 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 _0x1dba=['bluebird','request-promise','path','../../config/environment','define','Plugin','util','../../config/logger','moment'];(function(_0xa5663b,_0x41d03f){var _0x3e6238=function(_0x28eb95){while(--_0x28eb95){_0xa5663b['push'](_0xa5663b['shift']());}};_0x3e6238(++_0x41d03f);}(_0x1dba,0x14a));var _0xa1db=function(_0x3ba58b,_0x345628){_0x3ba58b=_0x3ba58b-0x0;var _0x28fbda=_0x1dba[_0x3ba58b];return _0x28fbda;};'use strict';var _=require('lodash');var util=require(_0xa1db('0x0'));var logger=require(_0xa1db('0x1'))('api');var moment=require(_0xa1db('0x2'));var BPromise=require(_0xa1db('0x3'));var rp=require(_0xa1db('0x4'));var fs=require('fs');var path=require(_0xa1db('0x5'));var rimraf=require('rimraf');var config=require(_0xa1db('0x6'));var attributes=require('./plugin.attributes');module['exports']=function(_0x36f26c,_0x3b69b4){return _0x36f26c[_0xa1db('0x7')](_0xa1db('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3297=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash'];(function(_0x2d4857,_0x320bb4){var _0x10db5c=function(_0x4ad53b){while(--_0x4ad53b){_0x2d4857['push'](_0x2d4857['shift']());}};_0x10db5c(++_0x320bb4);}(_0x3297,0x19f));var _0x7329=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3297[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var logger=require(_0x7329('0x2'))('api');var moment=require(_0x7329('0x3'));var BPromise=require(_0x7329('0x4'));var rp=require(_0x7329('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7329('0x6'));var config=require(_0x7329('0x7'));var attributes=require(_0x7329('0x8'));module[_0x7329('0x9')]=function(_0x2167b3,_0x2f593b){return _0x2167b3[_0x7329('0xa')](_0x7329('0xb'),attributes,{'tableName':_0x7329('0xc'),'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 907de1a..5f46721 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 _0x35fc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','CreatePlugin','Plugin','create','body','options','stringify','lodash','util','bluebird','randomstring','ioredis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x35fc,0x7f));var _0xc35f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x35fc[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc35f('0x0'));var util=require(_0xc35f('0x1'));var moment=require('moment');var BPromise=require(_0xc35f('0x2'));var rs=require(_0xc35f('0x3'));var fs=require('fs');var Redis=require(_0xc35f('0x4'));var db=require(_0xc35f('0x5'))['db'];var utils=require(_0xc35f('0x6'));var logger=require(_0xc35f('0x7'))(_0xc35f('0x8'));var config=require(_0xc35f('0x9'));var jayson=require(_0xc35f('0xa'));var client=jayson[_0xc35f('0xb')][_0xc35f('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc35f('0xd')],{'host':_0xc35f('0xe'),'port':0x18eb});var socket=require(_0xc35f('0xf'))(new Redis(config[_0xc35f('0xd')]));require(_0xc35f('0x10'))['register'](socket);function respondWithRpcPromise(_0x5ca5e0,_0x495b8a,_0x2e09c3){return new BPromise(function(_0x58332b,_0x538d7b){return client[_0xc35f('0x11')](_0x5ca5e0,_0x2e09c3)['then'](function(_0x47fac3){logger[_0xc35f('0x12')](_0xc35f('0x13'),_0x495b8a,_0xc35f('0x14'));logger[_0xc35f('0x15')](_0xc35f('0x16'),_0x495b8a,_0xc35f('0x14'),JSON['stringify'](_0x47fac3));if(_0x47fac3[_0xc35f('0x17')]){if(_0x47fac3[_0xc35f('0x17')][_0xc35f('0x18')]===0x1f4){logger[_0xc35f('0x17')]('Plugin,\x20%s,\x20%s',_0x495b8a,_0x47fac3['error']['message']);return _0x538d7b(_0x47fac3[_0xc35f('0x17')]['message']);}logger[_0xc35f('0x17')]('Plugin,\x20%s,\x20%s',_0x495b8a,_0x47fac3[_0xc35f('0x17')][_0xc35f('0x19')]);return _0x58332b(_0x47fac3[_0xc35f('0x17')][_0xc35f('0x19')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x495b8a,_0xc35f('0x14'));_0x58332b(_0x47fac3[_0xc35f('0x1a')][_0xc35f('0x19')]);}})['catch'](function(_0x5aec53){logger[_0xc35f('0x17')](_0xc35f('0x13'),_0x495b8a,_0x5aec53);_0x538d7b(_0x5aec53);});});}exports[_0xc35f('0x1b')]=function(_0x4f581a){var _0x131228=this;return new Promise(function(_0x3b2177,_0x2668ef){return db[_0xc35f('0x1c')][_0xc35f('0x1d')](_0x4f581a[_0xc35f('0x1e')],{'raw':_0x4f581a['options']?_0x4f581a[_0xc35f('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x481921){logger[_0xc35f('0x12')](_0xc35f('0x1b'),_0x4f581a);logger[_0xc35f('0x15')](_0xc35f('0x1b'),_0x4f581a,JSON[_0xc35f('0x20')](_0x481921));_0x3b2177(_0x481921);})['catch'](function(_0x55c29c){logger[_0xc35f('0x17')](_0xc35f('0x1b'),_0x55c29c[_0xc35f('0x19')],_0x4f581a);_0x2668ef(_0x131228[_0xc35f('0x17')](0x1f4,_0x55c29c['message']));});});}; \ No newline at end of file +var _0x1cf6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','create','options','stringify'];(function(_0x1c136b,_0x16dfac){var _0x4c190a=function(_0x3fd220){while(--_0x3fd220){_0x1c136b['push'](_0x1c136b['shift']());}};_0x4c190a(++_0x16dfac);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x365c80,_0xee0c87){_0x365c80=_0x365c80-0x0;var _0x200358=_0x1cf6[_0x365c80];return _0x200358;};'use strict';var _=require('lodash');var util=require(_0x61cf('0x0'));var moment=require(_0x61cf('0x1'));var BPromise=require(_0x61cf('0x2'));var rs=require(_0x61cf('0x3'));var fs=require('fs');var Redis=require(_0x61cf('0x4'));var db=require(_0x61cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x61cf('0x6'))(_0x61cf('0x7'));var config=require(_0x61cf('0x8'));var jayson=require(_0x61cf('0x9'));var client=jayson[_0x61cf('0xa')][_0x61cf('0xb')]({'port':0x232a});config[_0x61cf('0xc')]=_[_0x61cf('0xd')](config[_0x61cf('0xc')],{'host':_0x61cf('0xe'),'port':0x18eb});var socket=require(_0x61cf('0xf'))(new Redis(config[_0x61cf('0xc')]));require(_0x61cf('0x10'))[_0x61cf('0x11')](socket);function respondWithRpcPromise(_0x1aab6b,_0x43681d,_0x4b6ea4){return new BPromise(function(_0x24b82f,_0x4f6914){return client[_0x61cf('0x12')](_0x1aab6b,_0x4b6ea4)[_0x61cf('0x13')](function(_0x4b849d){logger[_0x61cf('0x14')](_0x61cf('0x15'),_0x43681d,_0x61cf('0x16'));logger[_0x61cf('0x17')](_0x61cf('0x18'),_0x43681d,'request\x20sent',JSON['stringify'](_0x4b849d));if(_0x4b849d[_0x61cf('0x19')]){if(_0x4b849d[_0x61cf('0x19')][_0x61cf('0x1a')]===0x1f4){logger[_0x61cf('0x19')](_0x61cf('0x15'),_0x43681d,_0x4b849d[_0x61cf('0x19')][_0x61cf('0x1b')]);return _0x4f6914(_0x4b849d['error'][_0x61cf('0x1b')]);}logger[_0x61cf('0x19')](_0x61cf('0x15'),_0x43681d,_0x4b849d[_0x61cf('0x19')][_0x61cf('0x1b')]);return _0x24b82f(_0x4b849d['error'][_0x61cf('0x1b')]);}else{logger[_0x61cf('0x14')](_0x61cf('0x15'),_0x43681d,_0x61cf('0x16'));_0x24b82f(_0x4b849d[_0x61cf('0x1c')][_0x61cf('0x1b')]);}})[_0x61cf('0x1d')](function(_0x5e203c){logger['error'](_0x61cf('0x15'),_0x43681d,_0x5e203c);_0x4f6914(_0x5e203c);});});}exports[_0x61cf('0x1e')]=function(_0x52cabf){var _0x15f8c1=this;return new Promise(function(_0x5bb38d,_0x508617){return db[_0x61cf('0x1f')][_0x61cf('0x20')](_0x52cabf['body'],{'raw':_0x52cabf['options']?_0x52cabf[_0x61cf('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x61cf('0x13')](function(_0x58b6f5){logger['info'](_0x61cf('0x1e'),_0x52cabf);logger[_0x61cf('0x17')](_0x61cf('0x1e'),_0x52cabf,JSON[_0x61cf('0x22')](_0x58b6f5));_0x5bb38d(_0x58b6f5);})[_0x61cf('0x1d')](function(_0x147892){logger['error']('CreatePlugin',_0x147892[_0x61cf('0x1b')],_0x52cabf);_0x508617(_0x15f8c1[_0x61cf('0x19')](0x1f4,_0x147892[_0x61cf('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 947b81c..a9c7a06 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 _0x33d7=['plugin:','save','remove','update','emit','register','length'];(function(_0x26a0e1,_0x3aceaf){var _0x152950=function(_0x42ccf8){while(--_0x42ccf8){_0x26a0e1['push'](_0x26a0e1['shift']());}};_0x152950(++_0x3aceaf);}(_0x33d7,0x17b));var _0x733d=function(_0xe57a2d,_0x20b337){_0xe57a2d=_0xe57a2d-0x0;var _0x4f1d02=_0x33d7[_0xe57a2d];return _0x4f1d02;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x733d('0x0'),_0x733d('0x1'),_0x733d('0x2')];function createListener(_0x54064b,_0x1f1782){return function(_0x58c652){_0x1f1782[_0x733d('0x3')](_0x54064b,_0x58c652);};}function removeListener(_0x4c1f97,_0x51932b){return function(){PluginEvents['removeListener'](_0x4c1f97,_0x51932b);};}exports[_0x733d('0x4')]=function(_0x398359){for(var _0x277581=0x0,_0x40fdfe=events[_0x733d('0x5')];_0x277581<_0x40fdfe;_0x277581++){var _0x4686f1=events[_0x277581];var _0x32d95b=createListener(_0x733d('0x6')+_0x4686f1,_0x398359);PluginEvents['on'](_0x4686f1,_0x32d95b);}}; \ No newline at end of file +var _0x2c4c=['./plugin.events','remove','emit','plugin:'];(function(_0x99f50a,_0x4fd49f){var _0xd82349=function(_0x2ba122){while(--_0x2ba122){_0x99f50a['push'](_0x99f50a['shift']());}};_0xd82349(++_0x4fd49f);}(_0x2c4c,0x134));var _0xc2c4=function(_0xb51463,_0x1c7959){_0xb51463=_0xb51463-0x0;var _0x15f379=_0x2c4c[_0xb51463];return _0x15f379;};'use strict';var PluginEvents=require(_0xc2c4('0x0'));var events=['save',_0xc2c4('0x1'),'update'];function createListener(_0x468bcb,_0x4c1706){return function(_0x497d36){_0x4c1706[_0xc2c4('0x2')](_0x468bcb,_0x497d36);};}function removeListener(_0x3fb6f0,_0x3d0460){return function(){PluginEvents['removeListener'](_0x3fb6f0,_0x3d0460);};}exports['register']=function(_0x4e663c){for(var _0x1e90a7=0x0,_0x48d5c4=events['length'];_0x1e90a7<_0x48d5c4;_0x1e90a7++){var _0x3291aa=events[_0x1e90a7];var _0x7c54ec=createListener(_0xc2c4('0x3')+_0x3291aa,_0x4e663c);PluginEvents['on'](_0x3291aa,_0x7c54ec);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 4bd4c78..00955b4 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(_0x2a643a,_0x1bf181){var _0x1200de=function(_0x564404){while(--_0x564404){_0x2a643a['push'](_0x2a643a['shift']());}};_0x1200de(++_0x1bf181);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x11f6ce,_0x381e81){var _0x354883=function(_0x50a056){while(--_0x50a056){_0x11f6ce['push'](_0x11f6ce['shift']());}};_0x354883(++_0x381e81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 51605ab..c75239e 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 _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x37630f,_0x19f21b){var _0x444cec=function(_0x31a623){while(--_0x31a623){_0x37630f['push'](_0x37630f['shift']());}};_0x444cec(++_0x19f21b);}(_0x2750,0x13b));var _0x0275=function(_0x389ec1,_0x594a88){_0x389ec1=_0x389ec1-0x0;var _0x8cb696=_0x2750[_0x389ec1];return _0x8cb696;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xb7c8=['start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname'];(function(_0x542c56,_0x53b4c7){var _0x36c023=function(_0x49e53a){while(--_0x49e53a){_0x542c56['push'](_0x542c56['shift']());}};_0x36c023(++_0x53b4c7);}(_0xb7c8,0x119));var _0x8b7c=function(_0x910329,_0x5e184b){_0x910329=_0x910329-0x0;var _0x377fcd=_0xb7c8[_0x910329];return _0x377fcd;};'use strict';var _=require('lodash');var pm2=require(_0x8b7c('0x0'));var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var path=require(_0x8b7c('0x3'));var exec=require(_0x8b7c('0x4'))[_0x8b7c('0x5')];var BPromise=require(_0x8b7c('0x6'));function handleEntityNotFound(_0x50113e,_0x38672b){return function(_0x412f93){if(!_0x412f93){_0x50113e[_0x8b7c('0x7')](0x194);;}return _0x412f93;};}function respondWithResult(_0x440900,_0x107428){_0x107428=_0x107428||0xc8;return function(_0x12665c){if(_0x12665c){return _0x440900[_0x8b7c('0x8')](_0x107428)[_0x8b7c('0x9')](_0x12665c);}return null;};}function handleError(_0x6afb55,_0x30a924){_0x30a924=_0x30a924||0x1f4;return function(_0x187046){logger[_0x8b7c('0xa')](_0x187046['stack']);if(_0x187046[_0x8b7c('0xb')]){delete _0x187046['name'];}_0x6afb55[_0x8b7c('0x8')](_0x30a924)[_0x8b7c('0xc')](_0x187046);};}function execChildProcess(){return new BPromise(function(_0x5868ec,_0x189a25){exec(_0x8b7c('0xd'),function(_0x3594b1,_0x586826,_0x4adbe2){logger[_0x8b7c('0xe')](_0x586826);logger[_0x8b7c('0xe')](_0x4adbe2);if(_0x3594b1){logger[_0x8b7c('0xa')](_0x3594b1);return _0x189a25(_0x3594b1);}return _0x5868ec(_0x586826);});});}exports[_0x8b7c('0xf')]=function(_0x3e3e58,_0x247e3a){return pm2[_0x8b7c('0x10')]()['then'](function(_0x2b60a7){if(_0x2b60a7){var _0x19c63e=_[_0x8b7c('0x11')](_0x2b60a7,function(_0x52cfe7){return _0x52cfe7[_0x8b7c('0xb')]===_0x8b7c('0x12')||_0x52cfe7['name']===_0x8b7c('0x13');});return{'rows':_0x19c63e,'count':_0x19c63e[_0x8b7c('0x14')]};}return null;})[_0x8b7c('0x15')](respondWithResult(_0x247e3a,null))[_0x8b7c('0x16')](handleError(_0x247e3a,null));};exports[_0x8b7c('0x17')]=function(_0x4cc809,_0x402448){return pm2[_0x8b7c('0x18')](_0x4cc809[_0x8b7c('0x19')]['id'])[_0x8b7c('0x15')](respondWithResult(_0x402448,null))[_0x8b7c('0x15')](handleEntityNotFound(_0x402448,null))['catch'](handleError(_0x402448,null));};exports[_0x8b7c('0x1a')]=function(_0x2b0874,_0x450ab7){if(_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0xb')]&&_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0x1c')]){var _0xd0c3e6=path[_0x8b7c('0x1d')](__dirname,_0x8b7c('0x1e'),_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0x1c')]);var _0x53451d=process[_0x8b7c('0x1f')]();process[_0x8b7c('0x20')](path[_0x8b7c('0x21')](_0xd0c3e6));return execChildProcess()[_0x8b7c('0x15')](function(_0x9365e3){process[_0x8b7c('0x20')](_0x53451d);return pm2[_0x8b7c('0x22')]({'name':_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0xb')],'script':_0xd0c3e6});})[_0x8b7c('0x15')](function(_0x5e131c){pm2['dump']();return _0x5e131c[0x0];})[_0x8b7c('0x15')](respondWithResult(_0x450ab7,0xc9))['catch'](handleError(_0x450ab7,null));}else{return _0x450ab7[_0x8b7c('0x8')](0x1f4)[_0x8b7c('0xc')]({'message':_0x8b7c('0x23')});}};exports[_0x8b7c('0x24')]=function(_0x3e35b8,_0x3d2dfa){if(_0x3e35b8['body']['id']){delete _0x3e35b8[_0x8b7c('0x1b')]['id'];}var _0x31390d={'online':_0x8b7c('0x25'),'stopped':_0x8b7c('0x26')};if(_0x31390d[_0x8b7c('0x27')](_0x3e35b8[_0x8b7c('0x1b')][_0x8b7c('0x8')])){return pm2[_0x31390d[_0x3e35b8[_0x8b7c('0x1b')][_0x8b7c('0x8')]]](_0x3e35b8[_0x8b7c('0x19')]['id'])['then'](respondWithResult(_0x3d2dfa,0xc8))['catch'](handleError(_0x3d2dfa,null));}else{return _0x3d2dfa[_0x8b7c('0x8')](0x1f4)[_0x8b7c('0xc')]({'message':_0x8b7c('0x28')});}};exports[_0x8b7c('0x29')]=function(_0x3bfe78,_0x1f373f){if(_0x3bfe78[_0x8b7c('0x1b')]['id']){delete _0x3bfe78[_0x8b7c('0x1b')]['id'];}if(_0x3bfe78[_0x8b7c('0x19')]['id']){return pm2[_0x8b7c('0x2a')](_0x3bfe78['params']['id'])[_0x8b7c('0x15')](function(_0x5906bd){pm2[_0x8b7c('0x2b')]();return _0x5906bd[0x0];})[_0x8b7c('0x15')](respondWithResult(_0x1f373f,null))['catch'](handleError(_0x1f373f,null));}else{return _0x1f373f[_0x8b7c('0x8')](0x1f4)['send']({'message':_0x8b7c('0x2c')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 900dc2f..722278d 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 _0x57fb=['./realtime.controller','get','getAgents','/queues','express','Router','../../components/auth/service'];(function(_0x5e10ab,_0x1664ce){var _0x3614cc=function(_0x48d1f3){while(--_0x48d1f3){_0x5e10ab['push'](_0x5e10ab['shift']());}};_0x3614cc(++_0x1664ce);}(_0x57fb,0x1cb));var _0xb57f=function(_0x1f8144,_0xc0f21c){_0x1f8144=_0x1f8144-0x0;var _0x249027=_0x57fb[_0x1f8144];return _0x249027;};'use strict';var express=require(_0xb57f('0x0'));var router=express[_0xb57f('0x1')]();var auth=require(_0xb57f('0x2'));var controller=require(_0xb57f('0x3'));router[_0xb57f('0x4')]('/agents',auth['isAuthenticated'](),controller[_0xb57f('0x5')]);router[_0xb57f('0x4')](_0xb57f('0x6'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0xd161=['getQueues','exports','express','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x5c71b6,_0x48ef51){var _0x2626a3=function(_0x40dbc0){while(--_0x40dbc0){_0x5c71b6['push'](_0x5c71b6['shift']());}};_0x2626a3(++_0x48ef51);}(_0xd161,0x102));var _0x1d16=function(_0x2c9dcc,_0x2bf089){_0x2c9dcc=_0x2c9dcc-0x0;var _0x23e250=_0xd161[_0x2c9dcc];return _0x23e250;};'use strict';var express=require(_0x1d16('0x0'));var router=express['Router']();var auth=require(_0x1d16('0x1'));var controller=require(_0x1d16('0x2'));router[_0x1d16('0x3')](_0x1d16('0x4'),auth[_0x1d16('0x5')](),controller['getAgents']);router[_0x1d16('0x3')]('/queues',auth[_0x1d16('0x5')](),controller[_0x1d16('0x6')]);module[_0x1d16('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d45f7ce..f3a8d73 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 _0x6241=['channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','key','role','agent','online','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','Agents','assign','UserProfile','getResources','rows','find','filterAgentAttributes','merge','getAgentStatus','includes','Status','sortAgentsByStatus','fields','split','pick','catch','isValidChannel','startCase','type','voice','outbound','dialActive','getOptions','userProfileId','name','filter','findAndCountAll','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','set','Content-Range','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x6241,0x186));var _0x1624=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x6241[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x1624('0x0'));var rta=require(_0x1624('0x1'));var rtq=require(_0x1624('0x2'));var qs=require(_0x1624('0x3'));var utils=require('../../config/utils');var db=require(_0x1624('0x4'))['db'];var APIBadRequestError=require(_0x1624('0x5'))[_0x1624('0x6')];var APIHandleError=require(_0x1624('0x5'))[_0x1624('0x7')];function respondWithFilteredResult(_0x5bbb52,_0xd7009c){return function(_0x517973){if(_0x517973){var _0x7704cc=typeof _0xd7009c[_0x1624('0x8')]===_0x1624('0x9')&&typeof _0xd7009c[_0x1624('0xa')]===_0x1624('0x9');var _0x45ec7f=_0x517973[_0x1624('0xb')];var _0x16ddb5=_0x7704cc?0x0:_0xd7009c['offset'];var _0x4384ea=_0x7704cc?_0x517973[_0x1624('0xb')]:_0xd7009c['offset']+_0xd7009c[_0x1624('0xa')];var _0x1c957f;if(_0x4384ea>=_0x45ec7f){_0x4384ea=_0x45ec7f;_0x1c957f=0xc8;}else{_0x1c957f=0xce;}_0x5bbb52[_0x1624('0xc')](_0x1c957f);return _0x5bbb52[_0x1624('0xd')](_0x1624('0xe'),_0x16ddb5+'-'+_0x4384ea+'/'+_0x45ec7f)['json'](_0x517973);}return null;};}exports[_0x1624('0xf')]=function(_0x404884,_0x57ce17){var _0x5b6a89={'count':0x0,'rows':[]};var _0x122457={};var _0x169236;var _0xa1952c=utils[_0x1624('0x10')]();var _0x3ccd34;var _0x20b4a9;var _0x1c6ab6=_0x404884[_0x1624('0x11')][_0x1624('0x12')];var _0xdf7164=_0x404884[_0x1624('0x11')][_0x1624('0x13')];var _0x3f4dea=_0x404884[_0x1624('0x11')][_0x1624('0x14')];var _0x53af4f=_0xdf7164===_0x1624('0x15')||_0xdf7164===_0x1624('0x16')?!![]:![];var _0x53a858=[];var _0x13969c;var _0x3b311c;Promise[_0x1624('0x17')]()[_0x1624('0x18')](function(){if(_0x404884[_0x1624('0x11')]['channel']){if(!utils['isValidChannel'](_0x404884['query'][_0x1624('0x19')])){throw new APIBadRequestError(util[_0x1624('0x1a')](_0x1624('0x1b'),_0x404884['query'][_0x1624('0x19')]));}_0x169236=_0x404884[_0x1624('0x11')]['channel'][_0x1624('0x1c')]();}if(!_0x404884['query'][_0x1624('0x1d')]||!_0x404884[_0x1624('0x11')]['sort']['includes'](_0x1624('0x1e'))){_0x404884[_0x1624('0x11')]['sort']=rta[_0x1624('0x1f')](_0x404884['query']['sort']);return;}var _0x19511d=rta[_0x1624('0x20')](_0x404884[_0x1624('0x11')][_0x1624('0x1d')]);_0x404884['query'][_0x1624('0x1d')]=_0x19511d['fields'][_0x1624('0x21')](',');_0x13969c=_0x19511d['order'];})['then'](function(){if(!_0x1c6ab6){return[];}return rta[_0x1624('0x22')](_0x1c6ab6,_0x169236);})[_0x1624('0x18')](function(_0x3368c3){_0x53a858=_0x3368c3;return rta[_0x1624('0x23')]();})[_0x1624('0x18')](function(_0x3b9880){_0x20b4a9=_0x3b9880['rows'];if((!_0xdf7164||_0x53af4f)&&!_0x13969c){return _0x53a858;}if(_0x13969c&&!_0xdf7164){return rta[_0x1624('0x24')](_0x20b4a9,_0x53a858,_0x13969c);}else{return rta['getAgentIdsByStatus'](_0x20b4a9,_0x53a858,_0xdf7164);}})[_0x1624('0x18')](function(_0x439824){_0x53a858=_0x439824;var _0x463d6f=![];if(_0x53a858[_0x1624('0x25')]===0x0){if(_0x1c6ab6||_0xdf7164){_0x463d6f=!![];}if(_0x53af4f){_0x463d6f=![];}}if(_0x463d6f){return _0x5b6a89;}var _0x21f859=_[_0x1624('0x26')](db[_0x1624('0x27')][_0x1624('0x28')],function(_0x20cc09){return{'name':_0x20cc09[_0x1624('0x29')],'type':_0x20cc09['type'][_0x1624('0x2a')]};});_0x404884[_0x1624('0x11')][_0x1624('0x2b')]=_0x1624('0x2c');_0x404884[_0x1624('0x11')][_0x1624('0x2d')]=!![];_0x122457=qs['getOptions'](_0x21f859,_0x404884);_0x122457[_0x1624('0x2e')]=!![];var _0x143183=[];if(_0x53a858[_0x1624('0x25')]>0x0){_0x143183[_0x1624('0x2f')]({'id':{'$in':_0x53a858}});if(_0x13969c&&!_0xdf7164){_0x3b311c=[db[_0x1624('0x30')][_0x1624('0x31')](_0x1624('0x32')+_0x53a858+')')];_0x122457['order']=_0x3b311c;}}if(_0x53af4f){_0xa1952c[_0x1624('0x33')](function(_0x540ae4){var _0x5ad74b=!![];if(_0xdf7164==='*pause'&&_0x169236!==_0x540ae4){_0x5ad74b=![];}_0x143183[_0x1624('0x2f')]({[_0x540ae4+'Pause']:_0x5ad74b});});if(_0x3f4dea){_0x143183[_0x1624('0x2f')]({'pauseType':_0x3f4dea});}}else if(_0xdf7164){_0xa1952c[_0x1624('0x33')](function(_0x2fb74e){_0x143183[_0x1624('0x2f')]({[_0x2fb74e+_0x1624('0x34')]:![]});});}_0x122457[_0x1624('0x35')]=_['merge'](_0x122457[_0x1624('0x35')],{'$and':_0x143183});if(_0x404884[_0x1624('0x36')][_0x1624('0x2b')]===_0x1624('0x36')){var _0x43d6d8={'params':{'id':_0x404884[_0x1624('0x36')]['userProfileId']},'query':{'section':_0x1624('0x37'),'role':_0x1624('0x2c'),'online':!![],'raw':!![],'ids':_0x53a858,'customSorting':_0x3b311c}};if(_0x53af4f){_0x43d6d8[_0x1624('0x11')]['extraQueryConditions']=_0x143183;}_0x43d6d8['query']=Object[_0x1624('0x38')](_0x43d6d8[_0x1624('0x11')],_0x404884[_0x1624('0x11')]);delete _0x43d6d8[_0x1624('0x11')]['id'];return db[_0x1624('0x39')][_0x1624('0x3a')](_0x43d6d8);}return db[_0x1624('0x27')]['findAndCountAll'](_0x122457);})[_0x1624('0x18')](function(_0x5007d7){_0x5b6a89[_0x1624('0xb')]=_0x5007d7[_0x1624('0xb')];_0x3ccd34=_0x5007d7[_0x1624('0x3b')];return _0x3ccd34[_0x1624('0x26')](function(_0x4831a6){var _0x559767=_[_0x1624('0x3c')](_0x20b4a9,['id',_0x4831a6['id']]);if(_0x559767){var _0x146688=rta[_0x1624('0x3d')](_0x559767);_[_0x1624('0x3e')](_0x4831a6,_0x146688);}_0x4831a6[_0x1624('0x1e')]=rta[_0x1624('0x3f')](_0x4831a6);if(_0x4831a6[_0x1624('0x1e')][_0x1624('0x40')](_0x1624('0x15'))){_0xa1952c[_0x1624('0x33')](function(_0x5267ca){if(_0x4831a6[_0x5267ca+_0x1624('0x34')]){_0x4831a6[_0x5267ca+_0x1624('0x41')]=_0x1624('0x15');}});}return _0x4831a6;});})[_0x1624('0x18')](function(_0x195ce4){if(!_0x13969c||_0x3b311c){return _0x195ce4;}return rta[_0x1624('0x42')](_0x195ce4,_0x13969c);})[_0x1624('0x18')](function(_0x454187){var _0x5c8958=null;if(_0x404884[_0x1624('0x11')][_0x1624('0x43')]){var _0x425382=_0x404884[_0x1624('0x11')][_0x1624('0x43')][_0x1624('0x44')](',');_0x5c8958=_0x454187[_0x1624('0x26')](function(_0x570219){return _[_0x1624('0x45')](_0x570219,_0x425382);});}_0x5b6a89['rows']=_0x5c8958||_0x454187;return _0x5b6a89;})[_0x1624('0x18')](respondWithFilteredResult(_0x57ce17,_0x122457))[_0x1624('0x46')](APIHandleError(_0x57ce17));};exports['getQueues']=function(_0x514d5b,_0x26e8c6){var _0x527f26={'count':0x0,'rows':[]};var _0x22d05c={};var _0x56d210;var _0x5f40f6;var _0x2682a7;Promise['resolve']()['then'](function(){if(_0x514d5b['query'][_0x1624('0x19')]){if(!utils[_0x1624('0x47')](_0x514d5b['query'][_0x1624('0x19')])){throw new APIBadRequestError(util[_0x1624('0x1a')](_0x1624('0x1b'),_0x514d5b['query'][_0x1624('0x19')]));}_0x56d210=_0x514d5b[_0x1624('0x11')][_0x1624('0x19')]['toLowerCase']();}var _0x480aff=_[_0x1624('0x48')](_0x56d210)+'Queue';var _0x24b419=_[_0x1624('0x26')](db[_0x480aff][_0x1624('0x28')],function(_0x2b13cf){return{'name':_0x2b13cf[_0x1624('0x29')],'type':_0x2b13cf[_0x1624('0x49')]['key']};});if(!_0x514d5b[_0x1624('0x11')]['fields']){var _0x400019=['id','name'];if(_0x56d210===_0x1624('0x4a')){_0x400019['push']('type');if(_0x514d5b[_0x1624('0x11')][_0x1624('0x49')]===_0x1624('0x4b')){_0x400019[_0x1624('0x2f')]([_0x1624('0x4c'),'dialMethod']);}}_0x514d5b['query'][_0x1624('0x43')]=_0x400019[_0x1624('0x21')](',');}_0x22d05c=qs[_0x1624('0x4d')](_0x24b419,_0x514d5b);if(_0x514d5b[_0x1624('0x36')]['role']==='user'){var _0x242880={'params':{'id':_0x514d5b['user'][_0x1624('0x4e')]},'query':{'section':_0x56d210===_0x1624('0x4a')&&_0x514d5b['query'][_0x1624('0x49')]===_0x1624('0x4b')?'QueueCampaigns':_[_0x1624('0x48')](_0x56d210)+'Queues','type':_0x514d5b[_0x1624('0x11')]['type'],'nolimit':!![],'sort':_0x1624('0x4f'),'filter':_0x514d5b['query'][_0x1624('0x50')]}};return db[_0x1624('0x39')][_0x1624('0x3a')](_0x242880);}return db[_0x480aff][_0x1624('0x51')](_0x22d05c);})[_0x1624('0x18')](function(_0x1805aa){_0x527f26[_0x1624('0xb')]=_0x1805aa[_0x1624('0xb')];_0x5f40f6=_0x1805aa['rows'];return rtq['getRealtimeQueues'](_0x514d5b,_0x56d210);})[_0x1624('0x18')](function(_0x5723bf){_0x2682a7=_0x5723bf[_0x1624('0x3b')];return rtq[_0x1624('0x52')](_0x5f40f6,_0x2682a7,_0x56d210,_0x514d5b['query'][_0x1624('0x49')]);})[_0x1624('0x18')](function(_0x2ff443){_0x527f26[_0x1624('0x3b')]=_0x2ff443;return _0x527f26;})[_0x1624('0x18')](respondWithFilteredResult(_0x26e8c6,_0x22d05c))[_0x1624('0x46')](APIHandleError(_0x26e8c6));}; \ No newline at end of file +var _0x98a1=['APIBadRequestError','handleError','offset','undefined','count','status','Content-Range','json','getAgents','getChannels','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','*pause','then','isValidChannel','channel','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','type','role','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','Agents','agent','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','rows','find','filterAgentAttributes','getAgentStatus','Status','split','catch','getQueues','resolve','format','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','key','name','voice','outbound','dialActive','QueueCampaigns','Queues','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api'];(function(_0x4d78bf,_0x178316){var _0x2d40dd=function(_0x29601e){while(--_0x29601e){_0x4d78bf['push'](_0x4d78bf['shift']());}};_0x2d40dd(++_0x178316);}(_0x98a1,0x198));var _0x198a=function(_0x5105e9,_0x423661){_0x5105e9=_0x5105e9-0x0;var _0x4d7b74=_0x98a1[_0x5105e9];return _0x4d7b74;};'use strict';var _=require(_0x198a('0x0'));var util=require(_0x198a('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x198a('0x2'));var qs=require(_0x198a('0x3'));var utils=require(_0x198a('0x4'));var db=require(_0x198a('0x5'))['db'];var APIBadRequestError=require(_0x198a('0x6'))[_0x198a('0x7')];var APIHandleError=require('../../errors/api')[_0x198a('0x8')];function respondWithFilteredResult(_0x548b5b,_0x51f9b7){return function(_0x149f3d){if(_0x149f3d){var _0x17a619=typeof _0x51f9b7[_0x198a('0x9')]===_0x198a('0xa')&&typeof _0x51f9b7['limit']===_0x198a('0xa');var _0x2de173=_0x149f3d[_0x198a('0xb')];var _0x5c6109=_0x17a619?0x0:_0x51f9b7['offset'];var _0x59b197=_0x17a619?_0x149f3d[_0x198a('0xb')]:_0x51f9b7[_0x198a('0x9')]+_0x51f9b7['limit'];var _0xc60530;if(_0x59b197>=_0x2de173){_0x59b197=_0x2de173;_0xc60530=0xc8;}else{_0xc60530=0xce;}_0x548b5b[_0x198a('0xc')](_0xc60530);return _0x548b5b['set'](_0x198a('0xd'),_0x5c6109+'-'+_0x59b197+'/'+_0x2de173)[_0x198a('0xe')](_0x149f3d);}return null;};}exports[_0x198a('0xf')]=function(_0x37b430,_0x2c3095){var _0x187a70={'count':0x0,'rows':[]};var _0x246cff={};var _0x5beb35;var _0x32e06c=utils[_0x198a('0x10')]();var _0x45de0b;var _0xcdaf72;var _0x5f1fb9=_0x37b430['query'][_0x198a('0x11')];var _0x12eb0d=_0x37b430[_0x198a('0x12')][_0x198a('0x13')];var _0x3029a2=_0x37b430[_0x198a('0x12')][_0x198a('0x14')];var _0x2df320=_0x12eb0d===_0x198a('0x15')||_0x12eb0d===_0x198a('0x16')?!![]:![];var _0x247462=[];var _0x3156f3;var _0x12e494;Promise['resolve']()[_0x198a('0x17')](function(){if(_0x37b430['query']['channel']){if(!utils[_0x198a('0x18')](_0x37b430['query'][_0x198a('0x19')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x37b430[_0x198a('0x12')][_0x198a('0x19')]));}_0x5beb35=_0x37b430[_0x198a('0x12')][_0x198a('0x19')]['toLowerCase']();}if(!_0x37b430['query'][_0x198a('0x1a')]||!_0x37b430['query']['sort'][_0x198a('0x1b')](_0x198a('0x1c'))){_0x37b430[_0x198a('0x12')][_0x198a('0x1a')]=rta['validateSortParameter'](_0x37b430[_0x198a('0x12')][_0x198a('0x1a')]);return;}var _0x27402f=rta[_0x198a('0x1d')](_0x37b430[_0x198a('0x12')][_0x198a('0x1a')]);_0x37b430[_0x198a('0x12')]['sort']=_0x27402f[_0x198a('0x1e')][_0x198a('0x1f')](',');_0x3156f3=_0x27402f[_0x198a('0x20')];})[_0x198a('0x17')](function(){if(!_0x5f1fb9){return[];}return rta['getAgentIdsByQueues'](_0x5f1fb9,_0x5beb35);})[_0x198a('0x17')](function(_0xac51f){_0x247462=_0xac51f;return rta[_0x198a('0x21')]();})['then'](function(_0x5b44ba){_0xcdaf72=_0x5b44ba['rows'];if((!_0x12eb0d||_0x2df320)&&!_0x3156f3){return _0x247462;}if(_0x3156f3&&!_0x12eb0d){return rta[_0x198a('0x22')](_0xcdaf72,_0x247462,_0x3156f3);}else{return rta[_0x198a('0x23')](_0xcdaf72,_0x247462,_0x12eb0d);}})[_0x198a('0x17')](function(_0x177713){_0x247462=_0x177713;var _0x2bf4ba=![];if(_0x247462[_0x198a('0x24')]===0x0){if(_0x5f1fb9||_0x12eb0d){_0x2bf4ba=!![];}if(_0x2df320){_0x2bf4ba=![];}}if(_0x2bf4ba){return _0x187a70;}var _0x419a84=_[_0x198a('0x25')](db[_0x198a('0x26')][_0x198a('0x27')],function(_0x1cb441){return{'name':_0x1cb441['fieldName'],'type':_0x1cb441[_0x198a('0x28')]['key']};});_0x37b430[_0x198a('0x12')][_0x198a('0x29')]='agent';_0x37b430[_0x198a('0x12')]['online']=!![];_0x246cff=qs[_0x198a('0x2a')](_0x419a84,_0x37b430);_0x246cff[_0x198a('0x2b')]=!![];var _0x387399=[];if(_0x247462[_0x198a('0x24')]>0x0){_0x387399[_0x198a('0x2c')]({'id':{'$in':_0x247462}});if(_0x3156f3&&!_0x12eb0d){_0x12e494=[db[_0x198a('0x2d')][_0x198a('0x2e')](_0x198a('0x2f')+_0x247462+')')];_0x246cff[_0x198a('0x20')]=_0x12e494;}}if(_0x2df320){_0x32e06c[_0x198a('0x30')](function(_0x12d2b7){var _0x5f02c6=!![];if(_0x12eb0d===_0x198a('0x16')&&_0x5beb35!==_0x12d2b7){_0x5f02c6=![];}_0x387399[_0x198a('0x2c')]({[_0x12d2b7+'Pause']:_0x5f02c6});});if(_0x3029a2){_0x387399[_0x198a('0x2c')]({'pauseType':_0x3029a2});}}else if(_0x12eb0d){_0x32e06c[_0x198a('0x30')](function(_0x1b81ef){_0x387399[_0x198a('0x2c')]({[_0x1b81ef+_0x198a('0x31')]:![]});});}_0x246cff[_0x198a('0x32')]=_[_0x198a('0x33')](_0x246cff[_0x198a('0x32')],{'$and':_0x387399});if(_0x37b430[_0x198a('0x34')][_0x198a('0x29')]===_0x198a('0x34')){var _0x24bf3b={'params':{'id':_0x37b430[_0x198a('0x34')][_0x198a('0x35')]},'query':{'section':_0x198a('0x36'),'role':_0x198a('0x37'),'online':!![],'raw':!![],'ids':_0x247462,'customSorting':_0x12e494}};if(_0x2df320){_0x24bf3b[_0x198a('0x12')][_0x198a('0x38')]=_0x387399;}_0x24bf3b[_0x198a('0x12')]=Object[_0x198a('0x39')](_0x24bf3b[_0x198a('0x12')],_0x37b430['query']);delete _0x24bf3b[_0x198a('0x12')]['id'];return db[_0x198a('0x3a')][_0x198a('0x3b')](_0x24bf3b);}return db['User'][_0x198a('0x3c')](_0x246cff);})[_0x198a('0x17')](function(_0x5b2300){_0x187a70['count']=_0x5b2300[_0x198a('0xb')];_0x45de0b=_0x5b2300[_0x198a('0x3d')];return _0x45de0b[_0x198a('0x25')](function(_0x32b32f){var _0x5aac38=_[_0x198a('0x3e')](_0xcdaf72,['id',_0x32b32f['id']]);if(_0x5aac38){var _0x408693=rta[_0x198a('0x3f')](_0x5aac38);_[_0x198a('0x33')](_0x32b32f,_0x408693);}_0x32b32f[_0x198a('0x1c')]=rta[_0x198a('0x40')](_0x32b32f);if(_0x32b32f[_0x198a('0x1c')][_0x198a('0x1b')]('pause')){_0x32e06c['forEach'](function(_0x443f85){if(_0x32b32f[_0x443f85+_0x198a('0x31')]){_0x32b32f[_0x443f85+_0x198a('0x41')]=_0x198a('0x15');}});}return _0x32b32f;});})[_0x198a('0x17')](function(_0x185355){if(!_0x3156f3||_0x12e494){return _0x185355;}return rta['sortAgentsByStatus'](_0x185355,_0x3156f3);})['then'](function(_0x4a0cbb){var _0x7fd15f=null;if(_0x37b430[_0x198a('0x12')][_0x198a('0x1e')]){var _0x152587=_0x37b430[_0x198a('0x12')][_0x198a('0x1e')][_0x198a('0x42')](',');_0x7fd15f=_0x4a0cbb[_0x198a('0x25')](function(_0xa6f7fc){return _['pick'](_0xa6f7fc,_0x152587);});}_0x187a70[_0x198a('0x3d')]=_0x7fd15f||_0x4a0cbb;return _0x187a70;})[_0x198a('0x17')](respondWithFilteredResult(_0x2c3095,_0x246cff))[_0x198a('0x43')](APIHandleError(_0x2c3095));};exports[_0x198a('0x44')]=function(_0x3b2786,_0x24e13d){var _0x328607={'count':0x0,'rows':[]};var _0x1385a2={};var _0xcc6009;var _0x47d1f7;var _0x4eaf96;Promise[_0x198a('0x45')]()[_0x198a('0x17')](function(){if(_0x3b2786['query'][_0x198a('0x19')]){if(!utils[_0x198a('0x18')](_0x3b2786[_0x198a('0x12')][_0x198a('0x19')])){throw new APIBadRequestError(util[_0x198a('0x46')](_0x198a('0x47'),_0x3b2786[_0x198a('0x12')][_0x198a('0x19')]));}_0xcc6009=_0x3b2786[_0x198a('0x12')][_0x198a('0x19')]['toLowerCase']();}var _0x586333=_[_0x198a('0x48')](_0xcc6009)+_0x198a('0x49');var _0x27d1c3=_[_0x198a('0x25')](db[_0x586333][_0x198a('0x27')],function(_0x4085df){return{'name':_0x4085df['fieldName'],'type':_0x4085df[_0x198a('0x28')][_0x198a('0x4a')]};});if(!_0x3b2786[_0x198a('0x12')][_0x198a('0x1e')]){var _0x3d9522=['id',_0x198a('0x4b')];if(_0xcc6009===_0x198a('0x4c')){_0x3d9522[_0x198a('0x2c')](_0x198a('0x28'));if(_0x3b2786['query'][_0x198a('0x28')]===_0x198a('0x4d')){_0x3d9522[_0x198a('0x2c')]([_0x198a('0x4e'),'dialMethod']);}}_0x3b2786[_0x198a('0x12')][_0x198a('0x1e')]=_0x3d9522[_0x198a('0x1f')](',');}_0x1385a2=qs[_0x198a('0x2a')](_0x27d1c3,_0x3b2786);if(_0x3b2786[_0x198a('0x34')][_0x198a('0x29')]===_0x198a('0x34')){var _0x12d3c7={'params':{'id':_0x3b2786['user'][_0x198a('0x35')]},'query':{'section':_0xcc6009==='voice'&&_0x3b2786['query'][_0x198a('0x28')]===_0x198a('0x4d')?_0x198a('0x4f'):_[_0x198a('0x48')](_0xcc6009)+_0x198a('0x50'),'type':_0x3b2786['query'][_0x198a('0x28')],'nolimit':!![],'sort':_0x198a('0x4b'),'filter':_0x3b2786[_0x198a('0x12')]['filter']}};return db[_0x198a('0x3a')]['getResources'](_0x12d3c7);}return db[_0x586333][_0x198a('0x3c')](_0x1385a2);})[_0x198a('0x17')](function(_0x123555){_0x328607['count']=_0x123555[_0x198a('0xb')];_0x47d1f7=_0x123555[_0x198a('0x3d')];return rtq[_0x198a('0x51')](_0x3b2786,_0xcc6009);})[_0x198a('0x17')](function(_0xe9157f){_0x4eaf96=_0xe9157f[_0x198a('0x3d')];return rtq[_0x198a('0x52')](_0x47d1f7,_0x4eaf96,_0xcc6009,_0x3b2786[_0x198a('0x12')][_0x198a('0x28')]);})[_0x198a('0x17')](function(_0x4b0f38){_0x328607[_0x198a('0x3d')]=_0x4b0f38;return _0x328607;})[_0x198a('0x17')](respondWithFilteredResult(_0x24e13d,_0x1385a2))[_0x198a('0x43')](APIHandleError(_0x24e13d));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3351b8b..bf8f99a 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x92237a,_0x573baa){var _0x191633=function(_0x433f6e){while(--_0x433f6e){_0x92237a['push'](_0x92237a['shift']());}};_0x191633(++_0x573baa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2e11ba,_0x4376cb){var _0x3ba5f4=function(_0x3055b1){while(--_0x3055b1){_0x2e11ba['push'](_0x2e11ba['shift']());}};_0x3ba5f4(++_0x4376cb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xcb91[_0x3e6d5d];return _0x238923;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index dcc15bb..a363de2 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 _0xcd59=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xcd59,0x14b));var _0x9cd5=function(_0xe04ebf,_0x5b44cd){_0xe04ebf=_0xe04ebf-0x0;var _0x36256f=_0xcd59[_0xe04ebf];return _0x36256f;};'use strict';var Sequelize=require(_0x9cd5('0x0'));module[_0x9cd5('0x1')]={'state':{'type':Sequelize[_0x9cd5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9cd5('0x3')]},'scheduledat':{'type':Sequelize[_0x9cd5('0x4')]},'uniqueid':{'type':Sequelize[_0x9cd5('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9cd5('0x4')]},'ringtime':{'type':Sequelize[_0x9cd5('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9cd5('0x3')]},'campaigntype':{'type':Sequelize[_0x9cd5('0x3')]},'membername':{'type':Sequelize[_0x9cd5('0x3')]}}; \ No newline at end of file +var _0x2f74=['INTEGER','STRING','DATE','sequelize'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x2f74,0x7b));var _0x42f7=function(_0x171a8a,_0x2c6407){_0x171a8a=_0x171a8a-0x0;var _0x178cbc=_0x2f74[_0x171a8a];return _0x178cbc;};'use strict';var Sequelize=require(_0x42f7('0x0'));module['exports']={'state':{'type':Sequelize[_0x42f7('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x42f7('0x2')]},'scheduledat':{'type':Sequelize[_0x42f7('0x3')]},'uniqueid':{'type':Sequelize[_0x42f7('0x2')]},'starttime':{'type':Sequelize[_0x42f7('0x3')]},'responsetime':{'type':Sequelize[_0x42f7('0x3')]},'ringtime':{'type':Sequelize[_0x42f7('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x42f7('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b05f4ef..f431420 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 _0x1e83=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x31d2d1,_0x38565f){var _0xdbf03a=function(_0x5ad917){while(--_0x5ad917){_0x31d2d1['push'](_0x31d2d1['shift']());}};_0xdbf03a(++_0x38565f);}(_0x1e83,0xba));var _0x31e8=function(_0x41b58b,_0x4e8f52){_0x41b58b=_0x41b58b-0x0;var _0x43df18=_0x1e83[_0x41b58b];return _0x43df18;};'use strict';var _=require(_0x31e8('0x0'));var util=require(_0x31e8('0x1'));var logger=require('../../config/logger')(_0x31e8('0x2'));var moment=require(_0x31e8('0x3'));var BPromise=require(_0x31e8('0x4'));var rp=require(_0x31e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31e8('0x6'));var config=require(_0x31e8('0x7'));var attributes=require(_0x31e8('0x8'));module['exports']=function(_0x311dbe,_0x2d478d){return _0x311dbe['define'](_0x31e8('0x9'),attributes,{'tableName':_0x31e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bfb=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','ReportAgentPreview','report_agent_preview'];(function(_0x2e1ba4,_0x59c821){var _0x9d462=function(_0x2fe03f){while(--_0x2fe03f){_0x2e1ba4['push'](_0x2e1ba4['shift']());}};_0x9d462(++_0x59c821);}(_0x4bfb,0x1e0));var _0xb4bf=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0x4bfb[_0x224dda];return _0x2987ac;};'use strict';var _=require(_0xb4bf('0x0'));var util=require(_0xb4bf('0x1'));var logger=require(_0xb4bf('0x2'))(_0xb4bf('0x3'));var moment=require('moment');var BPromise=require(_0xb4bf('0x4'));var rp=require(_0xb4bf('0x5'));var fs=require('fs');var path=require(_0xb4bf('0x6'));var rimraf=require(_0xb4bf('0x7'));var config=require(_0xb4bf('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xb4bf('0x9')]=function(_0x1632d2,_0x3ab006){return _0x1632d2['define'](_0xb4bf('0xa'),attributes,{'tableName':_0xb4bf('0xb'),'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 1532bcd..1b2dce4 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 _0xe733=['info','request\x20sent','debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','create','body','options','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x213f86,_0x4cf3c7){var _0x5b0c14=function(_0x4588a3){while(--_0x4588a3){_0x213f86['push'](_0x213f86['shift']());}};_0x5b0c14(++_0x4cf3c7);}(_0xe733,0x1b7));var _0x3e73=function(_0x4fcdeb,_0x5c9105){_0x4fcdeb=_0x4fcdeb-0x0;var _0x162396=_0xe733[_0x4fcdeb];return _0x162396;};'use strict';var _=require(_0x3e73('0x0'));var util=require(_0x3e73('0x1'));var moment=require('moment');var BPromise=require(_0x3e73('0x2'));var rs=require(_0x3e73('0x3'));var fs=require('fs');var Redis=require(_0x3e73('0x4'));var db=require(_0x3e73('0x5'))['db'];var utils=require(_0x3e73('0x6'));var logger=require(_0x3e73('0x7'))('rpc');var config=require(_0x3e73('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bb6e9,_0x438f62,_0x247813){return new BPromise(function(_0x2098a3,_0x24433e){return client[_0x3e73('0xa')](_0x2bb6e9,_0x247813)['then'](function(_0x5692c0){logger[_0x3e73('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x438f62,_0x3e73('0xc'));logger[_0x3e73('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x438f62,_0x3e73('0xc'),JSON[_0x3e73('0xe')](_0x5692c0));if(_0x5692c0['error']){if(_0x5692c0[_0x3e73('0xf')][_0x3e73('0x10')]===0x1f4){logger[_0x3e73('0xf')](_0x3e73('0x11'),_0x438f62,_0x5692c0[_0x3e73('0xf')][_0x3e73('0x12')]);return _0x24433e(_0x5692c0[_0x3e73('0xf')][_0x3e73('0x12')]);}logger[_0x3e73('0xf')](_0x3e73('0x11'),_0x438f62,_0x5692c0[_0x3e73('0xf')][_0x3e73('0x12')]);return _0x2098a3(_0x5692c0[_0x3e73('0xf')][_0x3e73('0x12')]);}else{logger[_0x3e73('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x438f62,_0x3e73('0xc'));_0x2098a3(_0x5692c0['result'][_0x3e73('0x12')]);}})[_0x3e73('0x13')](function(_0x119e82){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x438f62,_0x119e82);_0x24433e(_0x119e82);});});}exports[_0x3e73('0x14')]=function(_0x2be1d6){var _0x38eefa=this;return new Promise(function(_0x49d611,_0x2f2505){return db['ReportAgentPreview'][_0x3e73('0x15')](_0x2be1d6[_0x3e73('0x16')],{'raw':_0x2be1d6[_0x3e73('0x17')]?_0x2be1d6[_0x3e73('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3e73('0x18')](function(_0x30bbff){logger[_0x3e73('0xb')](_0x3e73('0x14'),_0x2be1d6);logger[_0x3e73('0xd')](_0x3e73('0x14'),_0x2be1d6,JSON[_0x3e73('0xe')](_0x30bbff));_0x49d611(_0x30bbff);})[_0x3e73('0x13')](function(_0x3581cc){logger[_0x3e73('0xf')](_0x3e73('0x14'),_0x3581cc[_0x3e73('0x12')],_0x2be1d6);_0x2f2505(_0x38eefa[_0x3e73('0xf')](0x1f4,_0x3581cc[_0x3e73('0x12')]));});});}; \ No newline at end of file +var _0xed58=['CreateReportAgentPreview','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','stringify','error','message','ReportAgentPreview,\x20%s,\x20%s','result','catch'];(function(_0xc7adcc,_0x14eb6a){var _0x20a7bf=function(_0x260d95){while(--_0x260d95){_0xc7adcc['push'](_0xc7adcc['shift']());}};_0x20a7bf(++_0x14eb6a);}(_0xed58,0x1e7));var _0x8ed5=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xed58[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x8ed5('0x0'));var moment=require(_0x8ed5('0x1'));var BPromise=require('bluebird');var rs=require(_0x8ed5('0x2'));var fs=require('fs');var Redis=require(_0x8ed5('0x3'));var db=require(_0x8ed5('0x4'))['db'];var utils=require(_0x8ed5('0x5'));var logger=require('../../config/logger')(_0x8ed5('0x6'));var config=require(_0x8ed5('0x7'));var jayson=require(_0x8ed5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x357e26,_0x21632f,_0x5c806d){return new BPromise(function(_0x4e46c8,_0xcaf0d){return client['request'](_0x357e26,_0x5c806d)[_0x8ed5('0x9')](function(_0x3d4417){logger[_0x8ed5('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x21632f,_0x8ed5('0xb'));logger[_0x8ed5('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x21632f,'request\x20sent',JSON[_0x8ed5('0xd')](_0x3d4417));if(_0x3d4417[_0x8ed5('0xe')]){if(_0x3d4417[_0x8ed5('0xe')]['code']===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x21632f,_0x3d4417[_0x8ed5('0xe')][_0x8ed5('0xf')]);return _0xcaf0d(_0x3d4417[_0x8ed5('0xe')][_0x8ed5('0xf')]);}logger[_0x8ed5('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x21632f,_0x3d4417[_0x8ed5('0xe')][_0x8ed5('0xf')]);return _0x4e46c8(_0x3d4417['error']['message']);}else{logger[_0x8ed5('0xa')](_0x8ed5('0x10'),_0x21632f,_0x8ed5('0xb'));_0x4e46c8(_0x3d4417[_0x8ed5('0x11')][_0x8ed5('0xf')]);}})[_0x8ed5('0x12')](function(_0x42b657){logger['error'](_0x8ed5('0x10'),_0x21632f,_0x42b657);_0xcaf0d(_0x42b657);});});}exports[_0x8ed5('0x13')]=function(_0x25afbb){var _0x732766=this;return new Promise(function(_0x526cd1,_0x17cfcc){return db['ReportAgentPreview']['create'](_0x25afbb[_0x8ed5('0x14')],{'raw':_0x25afbb[_0x8ed5('0x15')]?_0x25afbb[_0x8ed5('0x15')][_0x8ed5('0x16')]===undefined?!![]:![]:!![]})[_0x8ed5('0x9')](function(_0x593f7a){logger[_0x8ed5('0xa')](_0x8ed5('0x13'),_0x25afbb);logger[_0x8ed5('0xc')](_0x8ed5('0x13'),_0x25afbb,JSON[_0x8ed5('0xd')](_0x593f7a));_0x526cd1(_0x593f7a);})[_0x8ed5('0x12')](function(_0x7dbf9c){logger[_0x8ed5('0xe')]('CreateReportAgentPreview',_0x7dbf9c[_0x8ed5('0xf')],_0x25afbb);_0x17cfcc(_0x732766[_0x8ed5('0xe')](0x1f4,_0x7dbf9c[_0x8ed5('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8845e02..b541497 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 _0x26e8=['voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','showMailQueues','post','chat','/chat/queues/:id','showChatQueues','queueNotify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','/mail/queues','mailQueues','openchannelQueues','/sms/queues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels'];(function(_0x2aa4ec,_0x5747ae){var _0x2edf2c=function(_0x4637bc){while(--_0x4637bc){_0x2aa4ec['push'](_0x2aa4ec['shift']());}};_0x2edf2c(++_0x5747ae);}(_0x26e8,0xdd));var _0x826e=function(_0x2c9062,_0x525a88){_0x2c9062=_0x2c9062-0x0;var _0x48fa9f=_0x26e8[_0x2c9062];return _0x48fa9f;};'use strict';var multer=require('multer');var util=require(_0x826e('0x0'));var path=require('path');var express=require(_0x826e('0x1'));var router=express[_0x826e('0x2')]();var auth=require(_0x826e('0x3'));var controller=require('./rpc.controller');router[_0x826e('0x4')](_0x826e('0x5'),auth[_0x826e('0x6')](),controller[_0x826e('0x7')]);router[_0x826e('0x4')](_0x826e('0x8'),auth[_0x826e('0x6')](),controller[_0x826e('0x9')]);router[_0x826e('0x4')](_0x826e('0xa'),auth['isAuthenticated'](),controller[_0x826e('0xb')]);router[_0x826e('0x4')]('/voice/queues',auth['isAuthenticated'](),controller[_0x826e('0xc')]);router[_0x826e('0x4')](_0x826e('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x826e('0x4')](_0x826e('0xe'),auth[_0x826e('0x6')](),controller[_0x826e('0xf')]);router[_0x826e('0x4')]('/mail/accounts',auth[_0x826e('0x6')](),controller['mailAccounts']);router[_0x826e('0x4')]('/openchannel/queues',auth[_0x826e('0x6')](),controller[_0x826e('0x10')]);router[_0x826e('0x4')](_0x826e('0x11'),auth[_0x826e('0x6')](),controller['smsQueues']);router['get'](_0x826e('0x12'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x826e('0x4')]('/fax/queues',auth[_0x826e('0x6')](),controller[_0x826e('0x13')]);router['get'](_0x826e('0x14'),auth[_0x826e('0x6')](),controller['voiceQueuesPreview']);router[_0x826e('0x4')](_0x826e('0x15'),auth[_0x826e('0x6')](),controller[_0x826e('0x16')]);router[_0x826e('0x4')](_0x826e('0x17'),auth[_0x826e('0x6')](),controller[_0x826e('0x18')]);router[_0x826e('0x4')](_0x826e('0x19'),auth['isAuthenticated'](),controller[_0x826e('0x1a')]);router['get'](_0x826e('0x1b'),auth[_0x826e('0x6')](),controller[_0x826e('0x1c')]);router[_0x826e('0x4')]('/voice/queues/:id',auth[_0x826e('0x6')](),controller[_0x826e('0x1d')]);router[_0x826e('0x1e')](_0x826e('0x1f'),auth['isAuthenticated'](),controller[_0x826e('0x20')]);router['get']('/outbound',auth[_0x826e('0x6')](),controller[_0x826e('0x21')]);router[_0x826e('0x4')](_0x826e('0x22'),auth[_0x826e('0x6')](),controller[_0x826e('0x23')]);router[_0x826e('0x4')](_0x826e('0x24'),auth[_0x826e('0x6')](),controller['agents']);router[_0x826e('0x1e')]('/agents/:id/capacity',auth[_0x826e('0x6')](),controller['agentCapacity']);router[_0x826e('0x4')](_0x826e('0x25'),auth[_0x826e('0x6')](),controller[_0x826e('0x26')]);router[_0x826e('0x4')](_0x826e('0x27'),auth[_0x826e('0x6')](),controller[_0x826e('0x28')]);router[_0x826e('0x4')](_0x826e('0x29'),auth[_0x826e('0x6')](),controller[_0x826e('0x2a')]);router[_0x826e('0x4')](_0x826e('0x2b'),auth['isAuthenticated'](),controller[_0x826e('0x2c')]);router[_0x826e('0x4')](_0x826e('0x2d'),auth[_0x826e('0x6')](),controller[_0x826e('0x2e')]);router[_0x826e('0x4')](_0x826e('0x2f'),auth[_0x826e('0x6')](),controller[_0x826e('0x30')]);router[_0x826e('0x4')](_0x826e('0x31'),auth[_0x826e('0x6')](),controller[_0x826e('0x32')]);router[_0x826e('0x4')](_0x826e('0x33'),auth['isAuthenticated'](),controller[_0x826e('0x34')]);router[_0x826e('0x4')]('/sms/queues/waitinginteractions',auth[_0x826e('0x6')](),controller[_0x826e('0x35')]);router[_0x826e('0x4')](_0x826e('0x36'),auth['isAuthenticated'](),controller[_0x826e('0x37')]);router[_0x826e('0x4')](_0x826e('0x38'),auth[_0x826e('0x6')](),controller[_0x826e('0x39')]);router['post'](_0x826e('0x3a'),auth[_0x826e('0x6')](),controller['queueNotify']('mail'));router['get']('/mail/queues/:id',auth[_0x826e('0x6')](),controller[_0x826e('0x3b')]);router[_0x826e('0x3c')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x826e('0x3d')));router[_0x826e('0x4')](_0x826e('0x3e'),auth[_0x826e('0x6')](),controller[_0x826e('0x3f')]);router[_0x826e('0x3c')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x826e('0x40')]('fax'));router[_0x826e('0x4')](_0x826e('0x41'),auth['isAuthenticated'](),controller[_0x826e('0x42')]);router['post'](_0x826e('0x43'),auth['isAuthenticated'](),controller[_0x826e('0x40')](_0x826e('0x44')));router[_0x826e('0x4')](_0x826e('0x45'),auth[_0x826e('0x6')](),controller[_0x826e('0x46')]);router['post'](_0x826e('0x47'),auth['isAuthenticated'](),controller[_0x826e('0x40')](_0x826e('0x48')));router[_0x826e('0x3c')]('/whatsapp/queues/:id/notify',auth[_0x826e('0x6')](),controller[_0x826e('0x40')](_0x826e('0x49')));router[_0x826e('0x4')](_0x826e('0x4a'),auth[_0x826e('0x6')](),controller[_0x826e('0x4b')]);router[_0x826e('0x4')](_0x826e('0x4c'),auth['isAuthenticated'](),controller[_0x826e('0x4d')]);router['post'](_0x826e('0x4e'),auth[_0x826e('0x6')](),controller[_0x826e('0x4f')]);module[_0x826e('0x50')]=router; \ No newline at end of file +var _0x8abb=['post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id','openchannel','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','util','path','express','Router','../../components/auth/service','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','outbound','/outbound/channels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues'];(function(_0x45d20b,_0x2dc142){var _0x57f468=function(_0x440500){while(--_0x440500){_0x45d20b['push'](_0x45d20b['shift']());}};_0x57f468(++_0x2dc142);}(_0x8abb,0x195));var _0xb8ab=function(_0x48d052,_0x4312b3){_0x48d052=_0x48d052-0x0;var _0x321fbf=_0x8abb[_0x48d052];return _0x321fbf;};'use strict';var multer=require('multer');var util=require(_0xb8ab('0x0'));var path=require(_0xb8ab('0x1'));var express=require(_0xb8ab('0x2'));var router=express[_0xb8ab('0x3')]();var auth=require(_0xb8ab('0x4'));var controller=require('./rpc.controller');router['get']('/voice/channels',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x6')]);router[_0xb8ab('0x7')](_0xb8ab('0x8'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x9')]);router['get'](_0xb8ab('0xa'),auth['isAuthenticated'](),controller[_0xb8ab('0xb')]);router[_0xb8ab('0x7')](_0xb8ab('0xc'),auth['isAuthenticated'](),controller[_0xb8ab('0xd')]);router['get'](_0xb8ab('0xe'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0xf')]);router[_0xb8ab('0x7')](_0xb8ab('0x10'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x11')]);router['get'](_0xb8ab('0x12'),auth[_0xb8ab('0x5')](),controller['mailAccounts']);router['get'](_0xb8ab('0x13'),auth[_0xb8ab('0x5')](),controller['openchannelQueues']);router['get'](_0xb8ab('0x14'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x15')]);router['get'](_0xb8ab('0x16'),auth['isAuthenticated'](),controller[_0xb8ab('0x17')]);router[_0xb8ab('0x7')](_0xb8ab('0x18'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x19')]);router[_0xb8ab('0x7')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xb8ab('0x1a')]);router['get'](_0xb8ab('0x1b'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x1c')]);router[_0xb8ab('0x7')](_0xb8ab('0x1d'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0xb8ab('0x5')](),controller['voiceQueuesChannelHangup']);router[_0xb8ab('0x7')](_0xb8ab('0x1f'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x20')]);router[_0xb8ab('0x7')](_0xb8ab('0x21'),auth[_0xb8ab('0x5')](),controller['showVoiceQueues']);router[_0xb8ab('0x22')](_0xb8ab('0x21'),auth[_0xb8ab('0x5')](),controller['updateVoiceQueue']);router['get']('/outbound',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x23')]);router[_0xb8ab('0x7')](_0xb8ab('0x24'),auth[_0xb8ab('0x5')](),controller['outboundChannels']);router[_0xb8ab('0x7')]('/agents',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x25')]);router[_0xb8ab('0x22')](_0xb8ab('0x26'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x27')]);router[_0xb8ab('0x7')](_0xb8ab('0x28'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x29')]);router[_0xb8ab('0x7')](_0xb8ab('0x2a'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x2b')]);router[_0xb8ab('0x7')]('/campaigns',auth[_0xb8ab('0x5')](),controller['campaigns']);router['get'](_0xb8ab('0x2c'),auth[_0xb8ab('0x5')](),controller['faxAccounts']);router[_0xb8ab('0x7')](_0xb8ab('0x2d'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x2e')]);router[_0xb8ab('0x7')](_0xb8ab('0x2f'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x30')]);router[_0xb8ab('0x7')](_0xb8ab('0x31'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x32')]);router[_0xb8ab('0x7')](_0xb8ab('0x33'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x34')]);router[_0xb8ab('0x7')]('/sms/queues/waitinginteractions',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x35')]);router['get'](_0xb8ab('0x36'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x37')]);router[_0xb8ab('0x7')](_0xb8ab('0x38'),auth['isAuthenticated'](),controller[_0xb8ab('0x39')]);router['post'](_0xb8ab('0x3a'),auth['isAuthenticated'](),controller[_0xb8ab('0x3b')](_0xb8ab('0x3c')));router[_0xb8ab('0x7')](_0xb8ab('0x3d'),auth['isAuthenticated'](),controller[_0xb8ab('0x3e')]);router[_0xb8ab('0x3f')](_0xb8ab('0x40'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x3b')](_0xb8ab('0x41')));router[_0xb8ab('0x7')](_0xb8ab('0x42'),auth[_0xb8ab('0x5')](),controller['showChatQueues']);router[_0xb8ab('0x3f')]('/fax/queues/:id/notify',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x3b')]('fax'));router[_0xb8ab('0x7')](_0xb8ab('0x43'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xb8ab('0x3f')]('/openchannel/queues/:id/notify',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x3b')](_0xb8ab('0x44')));router['get']('/openchannel/queues/:id',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x45')]);router['post']('/sms/queues/:id/notify',auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x3b')](_0xb8ab('0x46')));router['post'](_0xb8ab('0x47'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x3b')](_0xb8ab('0x48')));router[_0xb8ab('0x7')](_0xb8ab('0x49'),auth[_0xb8ab('0x5')](),controller[_0xb8ab('0x4a')]);router['get'](_0xb8ab('0x4b'),auth['isAuthenticated'](),controller[_0xb8ab('0x4c')]);router[_0xb8ab('0x3f')](_0xb8ab('0x4d'),auth[_0xb8ab('0x5')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index fa31940..96c4612 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032e=['MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','uniq','value','filter','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','Interaction','update','queue','MessageId','InteractionId','From','TransferReport','agentNotify','Channel\x20field\x20is\x20mandatory','channel','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','create','Start','bluebird','lodash','util','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x032e,0x124));var _0xe032=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x032e[_0x4709c0];return _0x13348b;};'use strict';var BPromise=require(_0xe032('0x0'));var moment=require('moment');var _=require(_0xe032('0x1'));var util=require(_0xe032('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe032('0x3'));var jayson=require(_0xe032('0x4'));var amiClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232a});var mailClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232b});var routingClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){var _0x3b0ef8=_0x3289b0?_0x3289b0:amiClient;return _0x3b0ef8[_0xe032('0x7')](_0x37432f,_0x1576c8)[_0xe032('0x8')](function(_0x2dc9e5){if(_0x2dc9e5[_0xe032('0x9')]){if(_0x2dc9e5['error'][_0xe032('0xa')]===0x1f4){return _0xaf3907(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}return _0xd84027(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}else{_0xd84027(_0x2dc9e5[_0xe032('0xc')]);}})[_0xe032('0xd')](function(_0x5bcb5b){_0xaf3907(_0x5bcb5b);});});}function respondWithResult(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xc8;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0xe')](_0x266d71)['json'](_0x28c2b6);}return _0x646979[_0xe032('0xf')](0x194);};}function handleError(_0x2e267b,_0x176547){_0x176547=_0x176547||0x1f4;return function(_0x422e96){logger[_0xe032('0x9')](_0x422e96[_0xe032('0x10')]);if(_0x422e96[_0xe032('0x11')]){delete _0x422e96['name'];}_0x2e267b[_0xe032('0xe')](_0x176547)[_0xe032('0x12')](_0x422e96);};}function findById(_0x36fb7c){return function(_0x3b57d3){if(!_[_0xe032('0x13')](_0x36fb7c)&&!_[_0xe032('0x13')](_0x3b57d3)&&!_['isNil'](_0x3b57d3[_0xe032('0x14')])){return _[_0xe032('0x15')](_0x3b57d3[_0xe032('0x14')],function(_0x41d2a5){return _0x41d2a5['id']==_0x36fb7c;});}return null;};}exports[_0xe032('0x16')]=function(_0x5721ce,_0x4b644b){return respondWithRpcPromise('VoiceChannels',_0x5721ce[_0xe032('0x17')])['then'](respondWithResult(_0x4b644b,null))[_0xe032('0xd')](handleError(_0x4b644b,null));};exports[_0xe032('0x18')]=function(_0x3f0257,_0x2aa342){return respondWithRpcPromise(_0xe032('0x19'),_[_0xe032('0x1a')](_0x3f0257[_0xe032('0x17')],_0x3f0257['params']))[_0xe032('0x8')](respondWithResult(_0x2aa342,null))[_0xe032('0xd')](handleError(_0x2aa342,null));};exports[_0xe032('0x1b')]=function(_0x2be433,_0x2ca592){return respondWithRpcPromise(_0xe032('0x1c'),_[_0xe032('0x1a')](_0x2be433[_0xe032('0x17')],_0x2be433['params']))['then'](respondWithResult(_0x2ca592,null))['catch'](handleError(_0x2ca592,null));};exports[_0xe032('0x1d')]=function(_0x2568ce,_0x302559){return respondWithRpcPromise(_0xe032('0x1e'),_0x2568ce[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x302559,null))[_0xe032('0xd')](handleError(_0x302559,null));};exports[_0xe032('0x1f')]=function(_0x4dcbf1,_0x1ac20b){return respondWithRpcPromise('VoiceQueues',_0x4dcbf1[_0xe032('0x17')])[_0xe032('0x8')](findById(_0x4dcbf1[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x1ac20b,null))['catch'](handleError(_0x1ac20b,null));};exports['updateVoiceQueue']=function(_0x3e2575,_0x38e7ea){return respondWithRpcPromise(_0xe032('0x21'),_[_0xe032('0x1a')](_0x3e2575['body'],_0x3e2575['params']))['then'](respondWithResult(_0x38e7ea,null))[_0xe032('0xd')](handleError(_0x38e7ea,null));};exports[_0xe032('0x22')]=function(_0x5518ac,_0x707b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xe032('0x1a')](_0x5518ac[_0xe032('0x17')],_0x5518ac[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x707b,null))[_0xe032('0xd')](handleError(_0x707b,null));};exports['voiceQueuesChannels']=function(_0xd90bd5,_0x33634c){return respondWithRpcPromise(_0xe032('0x23'),_0xd90bd5[_0xe032('0x17')])['then'](respondWithResult(_0x33634c,null))[_0xe032('0xd')](handleError(_0x33634c,null));};exports['voiceQueuesChannel']=function(_0x2f3e59,_0x53df28){return respondWithRpcPromise(_0xe032('0x24'),_['merge'](_0x2f3e59[_0xe032('0x17')],_0x2f3e59['params']))[_0xe032('0x8')](respondWithResult(_0x53df28,null))[_0xe032('0xd')](handleError(_0x53df28,null));};exports['voiceQueuesChannelHangup']=function(_0x3e3598,_0x2fdf41){return respondWithRpcPromise(_0xe032('0x25'),_[_0xe032('0x1a')](_0x3e3598['query'],_0x3e3598[_0xe032('0x20')]))['then'](respondWithResult(_0x2fdf41,null))[_0xe032('0xd')](handleError(_0x2fdf41,null));};exports[_0xe032('0x26')]=function(_0x5d02c1,_0x450ba4){return respondWithRpcPromise(_0xe032('0x27'),_['merge'](_0x5d02c1[_0xe032('0x17')],_0x5d02c1[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x450ba4,null))[_0xe032('0xd')](handleError(_0x450ba4,null));};exports[_0xe032('0x28')]=function(_0x42f58a,_0x19ee0a){return respondWithRpcPromise(_0xe032('0x29'),_0x42f58a[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x19ee0a,null))[_0xe032('0xd')](handleError(_0x19ee0a,null));};exports[_0xe032('0x2a')]=function(_0x30571c,_0x28ba5d){return respondWithRpcPromise(_0xe032('0x2b'),_0x30571c[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x28ba5d,null))['catch'](handleError(_0x28ba5d,null));};exports[_0xe032('0x2c')]=function(_0x536c76,_0x3d02c1){var _0x2bcfb4;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76[_0xe032('0x17')])[_0xe032('0x8')](function(_0x5eccad){_0x2bcfb4=_0x5eccad;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76['query'],routingClient);})[_0xe032('0x8')](function(_0x590be2){return _[_0xe032('0x1a')]({},_0x590be2,_0x2bcfb4);})[_0xe032('0x8')](respondWithResult(_0x3d02c1,null))[_0xe032('0xd')](handleError(_0x3d02c1,null));};exports[_0xe032('0x2e')]=function(_0x4dc836,_0x477360){if(_0x4dc836['body']&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]&&_0x4dc836[_0xe032('0x31')]&&_0x4dc836[_0xe032('0x31')]['name']){for(var _0x513b0c in _0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]){if(_0x4dc836['body'][_0xe032('0x30')][_0xe032('0x32')](_0x513b0c)){db[_0xe032('0x33')][_0xe032('0x34')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'type':_0xe032('0x35'),'exitAt':null,'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')]?{'$notIn':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]}:{'$ne':null}}})['then'](function(_0x535f34){var _0x1b0e28=moment()['format'](_0xe032('0x37'));for(var _0x277207=0x0,_0x1873a6=_0x535f34[_0xe032('0x36')];_0x277207<_0x1873a6;_0x277207+=0x1){_0x535f34[_0x277207][_0xe032('0x38')]({'exitAt':_0x1b0e28});}});for(var _0x3dfb51=0x0;_0x3dfb51<_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')];_0x3dfb51+=0x1){db['MemberReport'][_0xe032('0x39')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836['user']['name'],'type':_0xe032('0x35'),'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51],'exitAt':null},'defaults':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'interface':_[_0xe032('0x13')](_0x4dc836[_0xe032('0x31')][_0xe032('0x3a')])?util[_0xe032('0x3b')](_0xe032('0x3c'),_0x4dc836[_0xe032('0x31')][_0xe032('0x11')]):_0x4dc836['user'][_0xe032('0x3a')],'type':_0xe032('0x35'),'enterAt':moment()['format'](_0xe032('0x37')),'role':_0xe032('0x3d'),'internal':_0x4dc836[_0xe032('0x31')][_0xe032('0x3e')],'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51]}});}}}}return respondWithRpcPromise(_0xe032('0x3f'),{'id':_0x4dc836[_0xe032('0x20')]['id'],'capacity':_0x4dc836[_0xe032('0x2f')][_0xe032('0x40')]},routingClient)[_0xe032('0x8')](respondWithResult(_0x477360,null))[_0xe032('0xd')](handleError(_0x477360,null));};exports[_0xe032('0x41')]=function(_0x2f8114,_0x4eabfc){return respondWithRpcPromise(_0xe032('0x42'),_0x2f8114['query'])[_0xe032('0x8')](respondWithResult(_0x4eabfc,null))[_0xe032('0xd')](handleError(_0x4eabfc,null));};exports[_0xe032('0x43')]=function(_0x11ae58,_0x41289d){return respondWithRpcPromise(_0xe032('0x44'),_0x11ae58[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x41289d,null))[_0xe032('0xd')](handleError(_0x41289d,null));};exports[_0xe032('0x45')]=function(_0x1b9012,_0x564fe0){return respondWithRpcPromise(_0xe032('0x46'),_0x1b9012[_0xe032('0x17')])['then'](respondWithResult(_0x564fe0,null))[_0xe032('0xd')](handleError(_0x564fe0,null));};exports['chatQueues']=function(_0x39b878,_0x1f2422){return respondWithRpcPromise(_0xe032('0x47'),_0x39b878[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1f2422,null))['catch'](handleError(_0x1f2422,null));};exports[_0xe032('0x48')]=function(_0x2dbc33,_0x1e1277){return respondWithRpcPromise(_0xe032('0x47'),_0x2dbc33[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x2dbc33[_0xe032('0x20')]['id']))['then'](respondWithResult(_0x1e1277,null))[_0xe032('0xd')](handleError(_0x1e1277,null));};exports[_0xe032('0x49')]=function(_0x454b29,_0x15325e){return respondWithRpcPromise(_0xe032('0x4a'),_0x454b29[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x15325e,null))[_0xe032('0xd')](handleError(_0x15325e,null));};exports[_0xe032('0x4b')]=function(_0x54c0b0,_0x795a58){return respondWithRpcPromise(_0xe032('0x4a'),_0x54c0b0[_0xe032('0x17')],routingClient)['then'](findById(_0x54c0b0[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x795a58,null))['catch'](handleError(_0x795a58,null));};exports[_0xe032('0x4c')]=function(_0x29dfa7,_0x43ad0d){return respondWithRpcPromise(_0xe032('0x4d'),_0x29dfa7[_0xe032('0x17')],mailClient)[_0xe032('0x8')](respondWithResult(_0x43ad0d,null))[_0xe032('0xd')](handleError(_0x43ad0d,null));};exports[_0xe032('0x4e')]=function(_0x1aa18e,_0x19ce2b){return respondWithRpcPromise(_0xe032('0x4f'),_0x1aa18e['query'],routingClient)[_0xe032('0x8')](respondWithResult(_0x19ce2b,null))[_0xe032('0xd')](handleError(_0x19ce2b,null));};exports[_0xe032('0x50')]=function(_0xd5cf55,_0x3d7a3f){return respondWithRpcPromise('OpenchannelQueues',_0xd5cf55[_0xe032('0x17')],routingClient)['then'](findById(_0xd5cf55[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x3d7a3f,null))[_0xe032('0xd')](handleError(_0x3d7a3f,null));};exports[_0xe032('0x51')]=function(_0x3c5eb8,_0x1ddb11){return respondWithRpcPromise(_0xe032('0x52'),_0x3c5eb8[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1ddb11,null))['catch'](handleError(_0x1ddb11,null));};exports['showSmsQueues']=function(_0x5c516a,_0x221473){return respondWithRpcPromise(_0xe032('0x52'),_0x5c516a[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x5c516a[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x221473,null))['catch'](handleError(_0x221473,null));};exports[_0xe032('0x53')]=function(_0x1d66c3,_0x1018d4){return respondWithRpcPromise('WhatsappQueues',_0x1d66c3[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x1018d4,null))[_0xe032('0xd')](handleError(_0x1018d4,null));};exports[_0xe032('0x54')]=function(_0x48063d,_0x590905){return respondWithRpcPromise('WhatsappQueues',_0x48063d[_0xe032('0x17')],routingClient)['then'](findById(_0x48063d['params']['id']))[_0xe032('0x8')](respondWithResult(_0x590905,null))[_0xe032('0xd')](handleError(_0x590905,null));};exports[_0xe032('0x55')]=function(_0x4ed078,_0x193a0f){return respondWithRpcPromise('FaxQueues',_0x4ed078[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x193a0f,null))[_0xe032('0xd')](handleError(_0x193a0f,null));};exports[_0xe032('0x56')]=function(_0x1f24ec,_0x2b987b){return respondWithRpcPromise(_0xe032('0x57'),_0x1f24ec[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x1f24ec[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x2b987b,null))['catch'](handleError(_0x2b987b,null));};exports[_0xe032('0x58')]=function(_0x338ef2,_0x5aa7a6){return respondWithRpcPromise('FaxAccounts',_0x338ef2[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x5aa7a6,null))[_0xe032('0xd')](handleError(_0x5aa7a6,null));};exports[_0xe032('0x59')]=function(_0x1e38bd,_0x23922e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1e38bd[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x23922e,null))['catch'](handleError(_0x23922e,null));};exports[_0xe032('0x5a')]=function(_0x2ea4a5,_0x1c3601){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2ea4a5[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1c3601,null))[_0xe032('0xd')](handleError(_0x1c3601,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52dfa0,_0xdd691c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52dfa0[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0xdd691c,null))[_0xe032('0xd')](handleError(_0xdd691c,null));};exports[_0xe032('0x5b')]=function(_0x37af62,_0x443fcc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37af62[_0xe032('0x17')],routingClient)[_0xe032('0x8')](function(_0x33e7c3){if(_0x37af62['query'][_0xe032('0x5c')]!==undefined){var _0x48e9c9=_(_0x33e7c3[_0xe032('0x14')])['filter']([_0x37af62[_0xe032('0x17')][_0xe032('0x5c')],_0x37af62[_0xe032('0x20')]['id']])['map'](_0xe032('0x5d'))[_0xe032('0x5e')]()[_0xe032('0x5f')]();return _0x33e7c3[_0xe032('0x14')][_0xe032('0x60')](function(_0x2a2c98){return _0x48e9c9['indexOf'](_0x2a2c98[_0xe032('0x5d')])>-0x1;});}else{return _0x33e7c3[_0xe032('0x14')]['filter'](function(_0x50fd01){return _0x50fd01[_0xe032('0x5d')]===parseInt(_0x37af62[_0xe032('0x20')]['id']);});}})[_0xe032('0x8')](respondWithResult(_0x443fcc,null))[_0xe032('0xd')](handleError(_0x443fcc,null));};exports[_0xe032('0x61')]=function(_0x54803e,_0x3a04b9){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x54803e[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x3a04b9,null))[_0xe032('0xd')](handleError(_0x3a04b9,null));};exports[_0xe032('0x62')]=function(_0x36137b,_0x2ecdc7){return respondWithRpcPromise(_0xe032('0x63'),_0x36137b[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x2ecdc7,null))[_0xe032('0xd')](handleError(_0x2ecdc7,null));};exports['faxQueuesWaitingInteractions']=function(_0x4ee54a,_0x485458){return respondWithRpcPromise(_0xe032('0x64'),_0x4ee54a[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x485458,null))[_0xe032('0xd')](handleError(_0x485458,null));};exports['queueNotify']=function(_0x5f42b1){return function(_0x2f2b74,_0x10873b){var _0x577f56,_0x4ab179;var _0x45e28d=_[_0xe032('0x65')](_0x5f42b1);var _0x51d89a=_0x5f42b1===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db[_0x45e28d+_0xe032('0x69')]['findOne']({'raw':!![],'where':{'id':_0x2f2b74[_0xe032('0x20')]['id']}})['then'](function(_0x1caebf){if(_[_0xe032('0x13')](_0x1caebf)){throw new Error(_0x45e28d+_0xe032('0x6a'));}_0x577f56=_0x1caebf;return db[_0x45e28d+'Message'][_0xe032('0x6b')]({'where':{'id':_0x2f2b74[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x45e28d+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x45e28d+_0x51d89a],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3c1b08){if(_[_0xe032('0x13')](_0x3c1b08)){throw new Error(_0x45e28d+'\x20Message\x20not\x20found');}_0x4ab179=_0x3c1b08;return _0x3c1b08[_0xe032('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe032('0x8')](function(){var _0x27eb0c={'uniqueid':_0x5f42b1+'.'+_0x4ab179['id']+'.'+_0x4ab179[_0xe032('0x6c')]['id'],'FromUserId':_0x2f2b74[_0xe032('0x31')]['id'],'type':_0xe032('0x6e')};_0x27eb0c[_0x45e28d+_0xe032('0x6f')]=_0x4ab179['id'];_0x27eb0c[_0x45e28d+_0xe032('0x70')]=_0x4ab179[_0xe032('0x6c')]['id'];_0x27eb0c[_0xe032('0x71')+_0x45e28d+_0x51d89a+'Id']=_0x4ab179[_0xe032('0x68')]['id'];_0x27eb0c['To'+_0x45e28d+'QueueId']=_0x577f56['id'];return db[_0x45e28d+_0xe032('0x72')]['create'](_0x27eb0c);})[_0xe032('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x5f42b1,'interaction':_0x4ab179[_0xe032('0x6c')],'message':_0x4ab179,'account':_0x4ab179[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x577f56[_0xe032('0x11')]+','+(_0x4ab179['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe032('0x8')](respondWithResult(_0x10873b,null))[_0xe032('0xd')](handleError(_0x10873b,null));};};exports[_0xe032('0x73')]=function(_0x4e9f83,_0x210e7a){var _0x2e6dad,_0x2d68aa;if(_['isNil'](_0x4e9f83[_0xe032('0x2f')]['channel'])){throw new Error(_0xe032('0x74'));}var _0x868fad=_0x4e9f83[_0xe032('0x2f')][_0xe032('0x75')];var _0x3ee725=_[_0xe032('0x65')](_0x868fad);var _0x205058=_0x868fad===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e9f83[_0xe032('0x20')]['id'],'role':_0xe032('0x3d')}})[_0xe032('0x8')](function(_0x1d9498){if(_['isNil'](_0x1d9498)){throw new Error(_0xe032('0x76'));}_0x2e6dad=_0x1d9498;return db[_0x3ee725+_0xe032('0x77')][_0xe032('0x6b')]({'where':{'id':_0x4e9f83[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x3ee725+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x3ee725+_0x205058],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3cf0bc){if(_[_0xe032('0x13')](_0x3cf0bc)){throw new Error(_0x3ee725+_0xe032('0x78'));}_0x2d68aa=_0x3cf0bc;return _0x3cf0bc['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x56523f={'uniqueid':_0x868fad+'.'+_0x2d68aa['id']+'.'+_0x2d68aa['Interaction']['id'],'FromUserId':_0x4e9f83['user']['id'],'type':_0xe032('0x6e'),'ToUserId':_0x2e6dad['id']};_0x56523f[_0x3ee725+_0xe032('0x6f')]=_0x2d68aa['id'];_0x56523f[_0x3ee725+_0xe032('0x70')]=_0x2d68aa[_0xe032('0x6c')]['id'];_0x56523f[_0xe032('0x71')+_0x3ee725+_0x205058+'Id']=_0x2d68aa['Account']['id'];return db[_0x3ee725+_0xe032('0x72')][_0xe032('0x79')](_0x56523f);})[_0xe032('0x8')](function(){return respondWithRpcPromise(_0xe032('0x7a'),{'channel':_0x868fad,'interaction':_0x2d68aa[_0xe032('0x6c')],'message':_0x2d68aa,'account':_0x2d68aa[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe032('0x3d'),'appdata':_0x2e6dad[_0xe032('0x11')]+','+(_0x2d68aa[_0xe032('0x68')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x210e7a,null))[_0xe032('0xd')](handleError(_0x210e7a,null));}; \ No newline at end of file +var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x58b6a8,_0x307021){var _0xc566dc=function(_0x59bd76){while(--_0x59bd76){_0x58b6a8['push'](_0x58b6a8['shift']());}};_0xc566dc(++_0x307021);}(_0xa630,0xbe));var _0x0a63=function(_0x1022a9,_0x50de38){_0x1022a9=_0x1022a9-0x0;var _0xffc0d0=_0xa630[_0x1022a9];return _0xffc0d0;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 13cfb82..a186887 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 _0xc2d2=['get','/:id','show','run','create','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xc2d2,0x15c));var _0x2c2d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xc2d2[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require('multer');var util=require(_0x2c2d('0x0'));var path=require('path');var timeout=require(_0x2c2d('0x1'));var express=require(_0x2c2d('0x2'));var router=express['Router']();var fs_extra=require(_0x2c2d('0x3'));var auth=require(_0x2c2d('0x4'));var interaction=require(_0x2c2d('0x5'));var config=require('../../config/environment');var controller=require(_0x2c2d('0x6'));router['get']('/',auth[_0x2c2d('0x7')](),controller[_0x2c2d('0x8')]);router[_0x2c2d('0x9')](_0x2c2d('0xa'),auth[_0x2c2d('0x7')](),controller[_0x2c2d('0xb')]);router[_0x2c2d('0x9')]('/:id/run',auth[_0x2c2d('0x7')](),controller[_0x2c2d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2c2d('0xd')]);router['put'](_0x2c2d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2c2d('0xe')](_0x2c2d('0xa'),auth[_0x2c2d('0x7')](),controller[_0x2c2d('0xf')]);module[_0x2c2d('0x10')]=router; \ No newline at end of file +var _0xa940=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','/:id/run','run','create','exports','multer'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa940,0x1d0));var _0x0a94=function(_0x4cb312,_0x4c28cd){_0x4cb312=_0x4cb312-0x0;var _0x2d48d9=_0xa940[_0x4cb312];return _0x2d48d9;};'use strict';var multer=require(_0x0a94('0x0'));var util=require('util');var path=require(_0x0a94('0x1'));var timeout=require(_0x0a94('0x2'));var express=require(_0x0a94('0x3'));var router=express['Router']();var fs_extra=require(_0x0a94('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a94('0x5'));var config=require(_0x0a94('0x6'));var controller=require(_0x0a94('0x7'));router[_0x0a94('0x8')]('/',auth[_0x0a94('0x9')](),controller['index']);router[_0x0a94('0x8')](_0x0a94('0xa'),auth[_0x0a94('0x9')](),controller['show']);router[_0x0a94('0x8')](_0x0a94('0xb'),auth[_0x0a94('0x9')](),controller[_0x0a94('0xc')]);router['post']('/',auth[_0x0a94('0x9')](),controller[_0x0a94('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0a94('0xe')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 1f888da..e6807f4 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 _0x826f=['DATE','INTEGER','ENUM','quarters','months','weeks','days','csv','pdf','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*'];(function(_0x340904,_0x6e0455){var _0x171719=function(_0x541736){while(--_0x541736){_0x340904['push'](_0x340904['shift']());}};_0x171719(++_0x6e0455);}(_0x826f,0xdc));var _0xf826=function(_0x3e3e01,_0x181684){_0x3e3e01=_0x3e3e01-0x0;var _0xc8add5=_0x826f[_0x3e3e01];return _0xc8add5;};'use strict';var Sequelize=require(_0xf826('0x0'));module[_0xf826('0x1')]={'name':{'type':Sequelize[_0xf826('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf826('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf826('0x2')],'allowNull':![],'defaultValue':_0xf826('0x3')},'startAt':{'type':Sequelize[_0xf826('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf826('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf826('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf826('0x6')]('years',_0xf826('0x7'),_0xf826('0x8'),_0xf826('0x9'),_0xf826('0xa'),'hours','minutes'),'allowNull':![],'defaultValue':_0xf826('0xa')},'output':{'type':Sequelize['ENUM'](_0xf826('0xb'),_0xf826('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0xf826('0xb')},'type':{'type':Sequelize[_0xf826('0x6')](_0xf826('0xd'),'default'),'allowNull':![],'defaultValue':_0xf826('0xd')},'sendMail':{'type':Sequelize[_0xf826('0xe')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf826('0xf')]},'bcc':{'type':Sequelize[_0xf826('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xed52=['days','csv','xlsx','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours'];(function(_0x54aa90,_0x34d0db){var _0x39cc24=function(_0x1a50db){while(--_0x1a50db){_0x54aa90['push'](_0x54aa90['shift']());}};_0x39cc24(++_0x34d0db);}(_0xed52,0x15b));var _0x2ed5=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xed52[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0x2ed5('0x0'));module[_0x2ed5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2ed5('0x2')]},'active':{'type':Sequelize[_0x2ed5('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2ed5('0x2')],'allowNull':![],'defaultValue':_0x2ed5('0x4')},'startAt':{'type':Sequelize[_0x2ed5('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2ed5('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2ed5('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2ed5('0x7')](_0x2ed5('0x8'),_0x2ed5('0x9'),_0x2ed5('0xa'),_0x2ed5('0xb'),'days',_0x2ed5('0xc'),'minutes'),'allowNull':![],'defaultValue':_0x2ed5('0xd')},'output':{'type':Sequelize[_0x2ed5('0x7')](_0x2ed5('0xe'),'pdf',_0x2ed5('0xf')),'allowNull':![],'defaultValue':_0x2ed5('0xe')},'type':{'type':Sequelize[_0x2ed5('0x7')]('custom',_0x2ed5('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x2ed5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2ed5('0x2')]},'cc':{'type':Sequelize[_0x2ed5('0x11')]},'bcc':{'type':Sequelize[_0x2ed5('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x2ed5('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 56b9a0d..fde3365 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 _0x2dee=['save','then','destroy','get','UserProfileResource','error','name','send','index','Schedule','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject'];(function(_0x3a14ee,_0x5617f8){var _0x5e876e=function(_0x4e4a48){while(--_0x4e4a48){_0x3a14ee['push'](_0x3a14ee['shift']());}};_0x5e876e(++_0x5617f8);}(_0x2dee,0x16b));var _0xe2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2dee[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2de('0x0'));var zipdir=require(_0xe2de('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2de('0x2'));var moment=require(_0xe2de('0x3'));var BPromise=require(_0xe2de('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe2de('0x5'));var sox=require(_0xe2de('0x6'));var csv=require(_0xe2de('0x7'));var ejs=require(_0xe2de('0x8'));var fs=require('fs');var fs_extra=require(_0xe2de('0x9'));var _=require(_0xe2de('0xa'));var squel=require(_0xe2de('0xb'));var crypto=require(_0xe2de('0xc'));var jsforce=require(_0xe2de('0xd'));var deskjs=require(_0xe2de('0xe'));var toCsv=require(_0xe2de('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe2de('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe2de('0x10'));var as=require(_0xe2de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2de('0x12'))('api');var utils=require(_0xe2de('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe2de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x522a85,_0xd9c75f){_0xd9c75f=_0xd9c75f||0xcc;return function(_0x422959){if(_0x422959){return _0x522a85[_0xe2de('0x15')](_0xd9c75f);}return _0x522a85[_0xe2de('0x16')](_0xd9c75f)[_0xe2de('0x17')]();};}function respondWithResult(_0x30f810,_0x3fbffd){_0x3fbffd=_0x3fbffd||0xc8;return function(_0x174ab8){if(_0x174ab8){return _0x30f810['status'](_0x3fbffd)[_0xe2de('0x18')](_0x174ab8);}};}function respondWithFilteredResult(_0xb37bf1,_0x492543){return function(_0x5c28cf){if(_0x5c28cf){var _0x17e4f7=typeof _0x492543['offset']===_0xe2de('0x19')&&typeof _0x492543[_0xe2de('0x1a')]===_0xe2de('0x19');var _0x2f92b0=_0x5c28cf[_0xe2de('0x1b')];var _0x507a49=_0x17e4f7?0x0:_0x492543[_0xe2de('0x1c')];var _0x2013c3=_0x17e4f7?_0x5c28cf['count']:_0x492543[_0xe2de('0x1c')]+_0x492543[_0xe2de('0x1a')];var _0x58e20c;if(_0x2013c3>=_0x2f92b0){_0x2013c3=_0x2f92b0;_0x58e20c=0xc8;}else{_0x58e20c=0xce;}_0xb37bf1[_0xe2de('0x16')](_0x58e20c);return _0xb37bf1[_0xe2de('0x1d')]('Content-Range',_0x507a49+'-'+_0x2013c3+'/'+_0x2f92b0)['json'](_0x5c28cf);}return null;};}function patchUpdates(_0x57638e){return function(_0x528187){try{jsonpatch[_0xe2de('0x1e')](_0x528187,_0x57638e,!![]);}catch(_0x2001f4){return BPromise[_0xe2de('0x1f')](_0x2001f4);}return _0x528187[_0xe2de('0x20')]();};}function saveUpdates(_0x5484a3,_0x2c9a){return function(_0x208055){if(_0x208055){return _0x208055['update'](_0x5484a3)[_0xe2de('0x21')](function(_0x13688e){return _0x13688e;});}return null;};}function removeEntity(_0x3ccf64,_0x5472a5){return function(_0x4028c3){if(_0x4028c3){return _0x4028c3[_0xe2de('0x22')]()[_0xe2de('0x21')](function(){var _0xaac084=_0x4028c3[_0xe2de('0x23')]({'plain':!![]});var _0x3d8566='Scheduler';return db[_0xe2de('0x24')][_0xe2de('0x22')]({'where':{'type':_0x3d8566,'resourceId':_0xaac084['id']}})[_0xe2de('0x21')](function(){return _0x4028c3;});})['then'](function(){_0x3ccf64['status'](0xcc)[_0xe2de('0x17')]();});}};}function handleEntityNotFound(_0x175bc6,_0xab88ee){return function(_0x35c0a3){if(!_0x35c0a3){_0x175bc6[_0xe2de('0x15')](0x194);}return _0x35c0a3;};}function handleError(_0x16e998,_0x3ab0ce){_0x3ab0ce=_0x3ab0ce||0x1f4;return function(_0x5f569b){logger[_0xe2de('0x25')](_0x5f569b['stack']);if(_0x5f569b['name']){delete _0x5f569b[_0xe2de('0x26')];}_0x16e998[_0xe2de('0x16')](_0x3ab0ce)[_0xe2de('0x27')](_0x5f569b);};}exports[_0xe2de('0x28')]=function(_0x140d51,_0xb5eb69){var _0x1d315d={},_0x49dda4={},_0x1dac33={'count':0x0,'rows':[]};var _0x451a60=_['map'](db[_0xe2de('0x29')][_0xe2de('0x2a')],function(_0x12c513){return{'name':_0x12c513[_0xe2de('0x2b')],'type':_0x12c513[_0xe2de('0x2c')]['key']};});_0x49dda4[_0xe2de('0x2d')]=_[_0xe2de('0x2e')](_0x451a60,'name');_0x49dda4['query']=_[_0xe2de('0x2f')](_0x140d51[_0xe2de('0x30')]);_0x49dda4[_0xe2de('0x31')]=_[_0xe2de('0x32')](_0x49dda4[_0xe2de('0x2d')],_0x49dda4[_0xe2de('0x30')]);_0x1d315d[_0xe2de('0x33')]=_[_0xe2de('0x32')](_0x49dda4[_0xe2de('0x2d')],qs[_0xe2de('0x34')](_0x140d51[_0xe2de('0x30')][_0xe2de('0x34')]));_0x1d315d[_0xe2de('0x33')]=_0x1d315d['attributes'][_0xe2de('0x35')]?_0x1d315d[_0xe2de('0x33')]:_0x49dda4[_0xe2de('0x2d')];if(!_0x140d51[_0xe2de('0x30')][_0xe2de('0x36')](_0xe2de('0x37'))){_0x1d315d[_0xe2de('0x1a')]=qs[_0xe2de('0x1a')](_0x140d51[_0xe2de('0x30')][_0xe2de('0x1a')]);_0x1d315d[_0xe2de('0x1c')]=qs[_0xe2de('0x1c')](_0x140d51[_0xe2de('0x30')]['offset']);}_0x1d315d[_0xe2de('0x38')]=qs[_0xe2de('0x39')](_0x140d51[_0xe2de('0x30')][_0xe2de('0x39')]);_0x1d315d[_0xe2de('0x3a')]=qs[_0xe2de('0x31')](_[_0xe2de('0x3b')](_0x140d51[_0xe2de('0x30')],_0x49dda4[_0xe2de('0x31')]),_0x451a60);if(_0x140d51[_0xe2de('0x30')][_0xe2de('0x3c')]){_0x1d315d[_0xe2de('0x3a')]=_[_0xe2de('0x3d')](_0x1d315d['where'],{'$or':_[_0xe2de('0x2e')](_0x451a60,function(_0x2137aa){if(_0x2137aa[_0xe2de('0x2c')]!=='VIRTUAL'){var _0x380c42={};_0x380c42[_0x2137aa[_0xe2de('0x26')]]={'$like':'%'+_0x140d51[_0xe2de('0x30')][_0xe2de('0x3c')]+'%'};return _0x380c42;}})});}_0x1d315d=_['merge']({},_0x1d315d,_0x140d51[_0xe2de('0x3e')]);var _0x567104={'where':_0x1d315d['where']};return db['Schedule']['count'](_0x567104)['then'](function(_0x47821e){_0x1dac33['count']=_0x47821e;if(_0x140d51[_0xe2de('0x30')][_0xe2de('0x3f')]){_0x1d315d[_0xe2de('0x40')]=[{'all':!![]}];}return db[_0xe2de('0x29')][_0xe2de('0x41')](_0x1d315d);})['then'](function(_0x421f20){_0x1dac33['rows']=_0x421f20;return _0x1dac33;})[_0xe2de('0x21')](respondWithFilteredResult(_0xb5eb69,_0x1d315d))[_0xe2de('0x42')](handleError(_0xb5eb69,null));};exports['show']=function(_0x585950,_0x1cd136){var _0x403c1f={'raw':![],'where':{'id':_0x585950[_0xe2de('0x43')]['id']}},_0x259c48={};_0x259c48['model']=_['keys'](db[_0xe2de('0x29')]['rawAttributes']);_0x259c48[_0xe2de('0x30')]=_[_0xe2de('0x2f')](_0x585950[_0xe2de('0x30')]);_0x259c48[_0xe2de('0x31')]=_[_0xe2de('0x32')](_0x259c48[_0xe2de('0x2d')],_0x259c48[_0xe2de('0x30')]);_0x403c1f[_0xe2de('0x33')]=_[_0xe2de('0x32')](_0x259c48[_0xe2de('0x2d')],qs[_0xe2de('0x34')](_0x585950[_0xe2de('0x30')][_0xe2de('0x34')]));_0x403c1f[_0xe2de('0x33')]=_0x403c1f['attributes'][_0xe2de('0x35')]?_0x403c1f['attributes']:_0x259c48[_0xe2de('0x2d')];if(_0x585950[_0xe2de('0x30')][_0xe2de('0x3f')]){_0x403c1f[_0xe2de('0x40')]=[{'all':!![]}];}_0x403c1f=_[_0xe2de('0x3d')]({},_0x403c1f,_0x585950[_0xe2de('0x3e')]);return db[_0xe2de('0x29')][_0xe2de('0x44')](_0x403c1f)[_0xe2de('0x21')](handleEntityNotFound(_0x1cd136,null))[_0xe2de('0x21')](respondWithResult(_0x1cd136,null))[_0xe2de('0x42')](handleError(_0x1cd136,null));};exports[_0xe2de('0x45')]=function(_0x42a188,_0x58b923){return db['Schedule'][_0xe2de('0x45')](_0x42a188[_0xe2de('0x46')],{})[_0xe2de('0x21')](function(_0x535c51){var _0x1b1203=_0x42a188[_0xe2de('0x47')][_0xe2de('0x23')]({'plain':!![]});if(!_0x1b1203)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b1203['role']==='user'){var _0x2f7cd5=_0x535c51[_0xe2de('0x23')]({'plain':!![]});var _0x3de2e7=_0xe2de('0x48');return db[_0xe2de('0x49')][_0xe2de('0x44')]({'where':{'name':_0x3de2e7,'userProfileId':_0x1b1203[_0xe2de('0x4a')]},'raw':!![]})['then'](function(_0x335853){if(_0x335853&&_0x335853[_0xe2de('0x4b')]===0x0){return db[_0xe2de('0x24')][_0xe2de('0x45')]({'name':_0x2f7cd5['name'],'resourceId':_0x2f7cd5['id'],'type':_0x335853[_0xe2de('0x26')],'sectionId':_0x335853['id']},{})[_0xe2de('0x21')](function(){return _0x535c51;});}else{return _0x535c51;}})[_0xe2de('0x42')](function(_0xf30351){logger[_0xe2de('0x25')](_0xe2de('0x4c'),_0xf30351);throw _0xf30351;});}return _0x535c51;})[_0xe2de('0x21')](respondWithResult(_0x58b923,0xc9))[_0xe2de('0x42')](handleError(_0x58b923,null));};exports['update']=function(_0x2e8b15,_0x2ceea5){if(_0x2e8b15['body']['id']){delete _0x2e8b15[_0xe2de('0x46')]['id'];}return db[_0xe2de('0x29')][_0xe2de('0x44')]({'where':{'id':_0x2e8b15['params']['id']}})['then'](handleEntityNotFound(_0x2ceea5,null))[_0xe2de('0x21')](saveUpdates(_0x2e8b15[_0xe2de('0x46')],null))[_0xe2de('0x21')](respondWithResult(_0x2ceea5,null))[_0xe2de('0x42')](handleError(_0x2ceea5,null));};exports[_0xe2de('0x22')]=function(_0x1a2549,_0xdcc1a4){return db[_0xe2de('0x29')][_0xe2de('0x44')]({'where':{'id':_0x1a2549[_0xe2de('0x43')]['id']}})[_0xe2de('0x21')](handleEntityNotFound(_0xdcc1a4,null))[_0xe2de('0x21')](removeEntity(_0xdcc1a4,null))[_0xe2de('0x42')](handleError(_0xdcc1a4,null));};exports[_0xe2de('0x4d')]=function(_0xbee0f7,_0x5dba62,_0x35d576){var _0xc3f84b=require(_0xe2de('0x4e'));return db['Schedule'][_0xe2de('0x44')]({'where':{'id':_0xbee0f7[_0xe2de('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5dba62,null))[_0xe2de('0x21')](function(){_0xc3f84b[_0xe2de('0x4d')](_0xbee0f7[_0xe2de('0x43')]['id']);})[_0xe2de('0x21')](respondWithStatusCode(_0x5dba62,null))[_0xe2de('0x42')](handleError(_0x5dba62,null));}; \ No newline at end of file +var _0x6730=['body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','keys','find','catch','create'];(function(_0x5769e3,_0x4410ee){var _0x3b5026=function(_0x3ee7ff){while(--_0x3ee7ff){_0x5769e3['push'](_0x5769e3['shift']());}};_0x3b5026(++_0x4410ee);}(_0x6730,0x106));var _0x0673=function(_0x2bef19,_0x40b26b){_0x2bef19=_0x2bef19-0x0;var _0x1521e7=_0x6730[_0x2bef19];return _0x1521e7;};'use strict';var emlformat=require(_0x0673('0x0'));var rimraf=require(_0x0673('0x1'));var zipdir=require(_0x0673('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0673('0x3'));var BPromise=require(_0x0673('0x4'));var Mustache=require('mustache');var util=require(_0x0673('0x5'));var path=require(_0x0673('0x6'));var sox=require(_0x0673('0x7'));var csv=require(_0x0673('0x8'));var ejs=require(_0x0673('0x9'));var fs=require('fs');var fs_extra=require(_0x0673('0xa'));var _=require('lodash');var squel=require(_0x0673('0xb'));var crypto=require(_0x0673('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0673('0xd'));var toCsv=require(_0x0673('0x8'));var querystring=require(_0x0673('0xe'));var Papa=require(_0x0673('0xf'));var Redis=require(_0x0673('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0673('0x11'));var as=require(_0x0673('0x12'));var hardwareService=require(_0x0673('0x13'));var logger=require('../../config/logger')(_0x0673('0x14'));var utils=require(_0x0673('0x15'));var config=require(_0x0673('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0673('0x17'))['db'];function respondWithStatusCode(_0x1ce639,_0x46e909){_0x46e909=_0x46e909||0xcc;return function(_0xe824e4){if(_0xe824e4){return _0x1ce639[_0x0673('0x18')](_0x46e909);}return _0x1ce639['status'](_0x46e909)[_0x0673('0x19')]();};}function respondWithResult(_0x3ea410,_0x324443){_0x324443=_0x324443||0xc8;return function(_0x5886d7){if(_0x5886d7){return _0x3ea410[_0x0673('0x1a')](_0x324443)[_0x0673('0x1b')](_0x5886d7);}};}function respondWithFilteredResult(_0x5776cc,_0x573df7){return function(_0x17b48c){if(_0x17b48c){var _0x4c42ca=typeof _0x573df7[_0x0673('0x1c')]===_0x0673('0x1d')&&typeof _0x573df7['limit']===_0x0673('0x1d');var _0x1f84ad=_0x17b48c[_0x0673('0x1e')];var _0x59fd7a=_0x4c42ca?0x0:_0x573df7['offset'];var _0x4de8da=_0x4c42ca?_0x17b48c[_0x0673('0x1e')]:_0x573df7[_0x0673('0x1c')]+_0x573df7[_0x0673('0x1f')];var _0x4f17e6;if(_0x4de8da>=_0x1f84ad){_0x4de8da=_0x1f84ad;_0x4f17e6=0xc8;}else{_0x4f17e6=0xce;}_0x5776cc[_0x0673('0x1a')](_0x4f17e6);return _0x5776cc['set'](_0x0673('0x20'),_0x59fd7a+'-'+_0x4de8da+'/'+_0x1f84ad)['json'](_0x17b48c);}return null;};}function patchUpdates(_0x5876c6){return function(_0x531ab2){try{jsonpatch[_0x0673('0x21')](_0x531ab2,_0x5876c6,!![]);}catch(_0x288e3d){return BPromise[_0x0673('0x22')](_0x288e3d);}return _0x531ab2['save']();};}function saveUpdates(_0x4cebda,_0x11d99f){return function(_0x4cb9d5){if(_0x4cb9d5){return _0x4cb9d5[_0x0673('0x23')](_0x4cebda)[_0x0673('0x24')](function(_0x58b311){return _0x58b311;});}return null;};}function removeEntity(_0xc4b2b4,_0x407e73){return function(_0x5ac3fd){if(_0x5ac3fd){return _0x5ac3fd[_0x0673('0x25')]()[_0x0673('0x24')](function(){var _0x18b8f3=_0x5ac3fd[_0x0673('0x26')]({'plain':!![]});var _0x199ae1='Scheduler';return db[_0x0673('0x27')]['destroy']({'where':{'type':_0x199ae1,'resourceId':_0x18b8f3['id']}})['then'](function(){return _0x5ac3fd;});})[_0x0673('0x24')](function(){_0xc4b2b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a6c89,_0x2b309e){return function(_0x52abda){if(!_0x52abda){_0x8a6c89['sendStatus'](0x194);}return _0x52abda;};}function handleError(_0x36c669,_0x424e8f){_0x424e8f=_0x424e8f||0x1f4;return function(_0x1e2145){logger['error'](_0x1e2145[_0x0673('0x28')]);if(_0x1e2145[_0x0673('0x29')]){delete _0x1e2145['name'];}_0x36c669['status'](_0x424e8f)[_0x0673('0x2a')](_0x1e2145);};}exports[_0x0673('0x2b')]=function(_0x102c59,_0x271b77){var _0x1506de={},_0x5715a5={},_0x57f0c9={'count':0x0,'rows':[]};var _0x278a7f=_[_0x0673('0x2c')](db[_0x0673('0x2d')][_0x0673('0x2e')],function(_0x4e9d50){return{'name':_0x4e9d50[_0x0673('0x2f')],'type':_0x4e9d50[_0x0673('0x30')][_0x0673('0x31')]};});_0x5715a5[_0x0673('0x32')]=_['map'](_0x278a7f,_0x0673('0x29'));_0x5715a5[_0x0673('0x33')]=_['keys'](_0x102c59[_0x0673('0x33')]);_0x5715a5[_0x0673('0x34')]=_['intersection'](_0x5715a5[_0x0673('0x32')],_0x5715a5[_0x0673('0x33')]);_0x1506de['attributes']=_[_0x0673('0x35')](_0x5715a5[_0x0673('0x32')],qs['fields'](_0x102c59[_0x0673('0x33')][_0x0673('0x36')]));_0x1506de[_0x0673('0x37')]=_0x1506de[_0x0673('0x37')][_0x0673('0x38')]?_0x1506de[_0x0673('0x37')]:_0x5715a5['model'];if(!_0x102c59[_0x0673('0x33')][_0x0673('0x39')](_0x0673('0x3a'))){_0x1506de[_0x0673('0x1f')]=qs[_0x0673('0x1f')](_0x102c59[_0x0673('0x33')][_0x0673('0x1f')]);_0x1506de[_0x0673('0x1c')]=qs[_0x0673('0x1c')](_0x102c59[_0x0673('0x33')][_0x0673('0x1c')]);}_0x1506de[_0x0673('0x3b')]=qs['sort'](_0x102c59[_0x0673('0x33')][_0x0673('0x3c')]);_0x1506de[_0x0673('0x3d')]=qs['filters'](_['pick'](_0x102c59[_0x0673('0x33')],_0x5715a5[_0x0673('0x34')]),_0x278a7f);if(_0x102c59[_0x0673('0x33')][_0x0673('0x3e')]){_0x1506de[_0x0673('0x3d')]=_[_0x0673('0x3f')](_0x1506de['where'],{'$or':_['map'](_0x278a7f,function(_0x50e734){if(_0x50e734[_0x0673('0x30')]!=='VIRTUAL'){var _0x280afd={};_0x280afd[_0x50e734['name']]={'$like':'%'+_0x102c59[_0x0673('0x33')][_0x0673('0x3e')]+'%'};return _0x280afd;}})});}_0x1506de=_[_0x0673('0x3f')]({},_0x1506de,_0x102c59[_0x0673('0x40')]);var _0x3bc4f9={'where':_0x1506de[_0x0673('0x3d')]};return db[_0x0673('0x2d')][_0x0673('0x1e')](_0x3bc4f9)['then'](function(_0x14aa35){_0x57f0c9[_0x0673('0x1e')]=_0x14aa35;if(_0x102c59['query'][_0x0673('0x41')]){_0x1506de[_0x0673('0x42')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x1506de);})[_0x0673('0x24')](function(_0x1a1ee2){_0x57f0c9[_0x0673('0x43')]=_0x1a1ee2;return _0x57f0c9;})[_0x0673('0x24')](respondWithFilteredResult(_0x271b77,_0x1506de))['catch'](handleError(_0x271b77,null));};exports[_0x0673('0x44')]=function(_0x2191f8,_0x394792){var _0xb31fef={'raw':![],'where':{'id':_0x2191f8[_0x0673('0x45')]['id']}},_0x24c78c={};_0x24c78c['model']=_['keys'](db[_0x0673('0x2d')][_0x0673('0x2e')]);_0x24c78c[_0x0673('0x33')]=_[_0x0673('0x46')](_0x2191f8[_0x0673('0x33')]);_0x24c78c[_0x0673('0x34')]=_[_0x0673('0x35')](_0x24c78c[_0x0673('0x32')],_0x24c78c[_0x0673('0x33')]);_0xb31fef[_0x0673('0x37')]=_[_0x0673('0x35')](_0x24c78c[_0x0673('0x32')],qs['fields'](_0x2191f8[_0x0673('0x33')][_0x0673('0x36')]));_0xb31fef['attributes']=_0xb31fef[_0x0673('0x37')]['length']?_0xb31fef['attributes']:_0x24c78c[_0x0673('0x32')];if(_0x2191f8[_0x0673('0x33')][_0x0673('0x41')]){_0xb31fef[_0x0673('0x42')]=[{'all':!![]}];}_0xb31fef=_[_0x0673('0x3f')]({},_0xb31fef,_0x2191f8[_0x0673('0x40')]);return db[_0x0673('0x2d')][_0x0673('0x47')](_0xb31fef)[_0x0673('0x24')](handleEntityNotFound(_0x394792,null))[_0x0673('0x24')](respondWithResult(_0x394792,null))[_0x0673('0x48')](handleError(_0x394792,null));};exports['create']=function(_0x4ffa73,_0x3d4612){return db[_0x0673('0x2d')][_0x0673('0x49')](_0x4ffa73[_0x0673('0x4a')],{})['then'](function(_0x5cdea3){var _0x4ed599=_0x4ffa73['user'][_0x0673('0x26')]({'plain':!![]});if(!_0x4ed599)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ed599[_0x0673('0x4b')]===_0x0673('0x4c')){var _0x1c538d=_0x5cdea3[_0x0673('0x26')]({'plain':!![]});var _0x2a3f1b='Scheduler';return db[_0x0673('0x4d')][_0x0673('0x47')]({'where':{'name':_0x2a3f1b,'userProfileId':_0x4ed599[_0x0673('0x4e')]},'raw':!![]})[_0x0673('0x24')](function(_0x13cdbf){if(_0x13cdbf&&_0x13cdbf[_0x0673('0x4f')]===0x0){return db['UserProfileResource'][_0x0673('0x49')]({'name':_0x1c538d[_0x0673('0x29')],'resourceId':_0x1c538d['id'],'type':_0x13cdbf[_0x0673('0x29')],'sectionId':_0x13cdbf['id']},{})[_0x0673('0x24')](function(){return _0x5cdea3;});}else{return _0x5cdea3;}})[_0x0673('0x48')](function(_0x4df224){logger[_0x0673('0x50')](_0x0673('0x51'),_0x4df224);throw _0x4df224;});}return _0x5cdea3;})[_0x0673('0x24')](respondWithResult(_0x3d4612,0xc9))[_0x0673('0x48')](handleError(_0x3d4612,null));};exports[_0x0673('0x23')]=function(_0x397da5,_0x414692){if(_0x397da5[_0x0673('0x4a')]['id']){delete _0x397da5[_0x0673('0x4a')]['id'];}return db[_0x0673('0x2d')][_0x0673('0x47')]({'where':{'id':_0x397da5[_0x0673('0x45')]['id']}})[_0x0673('0x24')](handleEntityNotFound(_0x414692,null))[_0x0673('0x24')](saveUpdates(_0x397da5[_0x0673('0x4a')],null))[_0x0673('0x24')](respondWithResult(_0x414692,null))[_0x0673('0x48')](handleError(_0x414692,null));};exports[_0x0673('0x25')]=function(_0x4782c8,_0x2e4a61){return db[_0x0673('0x2d')]['find']({'where':{'id':_0x4782c8[_0x0673('0x45')]['id']}})[_0x0673('0x24')](handleEntityNotFound(_0x2e4a61,null))[_0x0673('0x24')](removeEntity(_0x2e4a61,null))['catch'](handleError(_0x2e4a61,null));};exports['run']=function(_0x11f328,_0xefab52,_0x37bbfc){var _0x2d230b=require(_0x0673('0x52'));return db[_0x0673('0x2d')]['find']({'where':{'id':_0x11f328[_0x0673('0x45')]['id']},'raw':!![]})[_0x0673('0x24')](handleEntityNotFound(_0xefab52,null))[_0x0673('0x24')](function(){_0x2d230b[_0x0673('0x53')](_0x11f328['params']['id']);})[_0x0673('0x24')](respondWithStatusCode(_0xefab52,null))['catch'](handleError(_0xefab52,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1198664..f8e9c40 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 _0xfee4=['path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','api','bluebird','request-promise'];(function(_0x1bc24d,_0x5c149b){var _0x411101=function(_0x26e749){while(--_0x26e749){_0x1bc24d['push'](_0x1bc24d['shift']());}};_0x411101(++_0x5c149b);}(_0xfee4,0x130));var _0x4fee=function(_0x314097,_0x26a19d){_0x314097=_0x314097-0x0;var _0x3baf1f=_0xfee4[_0x314097];return _0x3baf1f;};'use strict';var _=require(_0x4fee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4fee('0x1'));var moment=require('moment');var BPromise=require(_0x4fee('0x2'));var rp=require(_0x4fee('0x3'));var fs=require('fs');var path=require(_0x4fee('0x4'));var rimraf=require(_0x4fee('0x5'));var config=require(_0x4fee('0x6'));var attributes=require(_0x4fee('0x7'));module['exports']=function(_0x3935c9,_0x628de0){return _0x3935c9[_0x4fee('0x8')](_0x4fee('0x9'),attributes,{'tableName':_0x4fee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ab4=['exports','tools_schedules','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes'];(function(_0x5e6fca,_0x540568){var _0x505941=function(_0x4c1d36){while(--_0x4c1d36){_0x5e6fca['push'](_0x5e6fca['shift']());}};_0x505941(++_0x540568);}(_0x1ab4,0x14c));var _0x41ab=function(_0x32506f,_0x373192){_0x32506f=_0x32506f-0x0;var _0x1e6b33=_0x1ab4[_0x32506f];return _0x1e6b33;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41ab('0x0'))('api');var moment=require(_0x41ab('0x1'));var BPromise=require(_0x41ab('0x2'));var rp=require(_0x41ab('0x3'));var fs=require('fs');var path=require(_0x41ab('0x4'));var rimraf=require(_0x41ab('0x5'));var config=require(_0x41ab('0x6'));var attributes=require(_0x41ab('0x7'));module[_0x41ab('0x8')]=function(_0x16aa43,_0x2eff03){return _0x16aa43['define']('Schedule',attributes,{'tableName':_0x41ab('0x9'),'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 56aa139..9425b1d 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 _0x43e3=['client','http','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x43e3,0x1d9));var _0x343e=function(_0x153ab3,_0x5c7acb){_0x153ab3=_0x153ab3-0x0;var _0x4e2455=_0x43e3[_0x153ab3];return _0x4e2455;};'use strict';var _=require(_0x343e('0x0'));var util=require(_0x343e('0x1'));var moment=require(_0x343e('0x2'));var BPromise=require(_0x343e('0x3'));var rs=require(_0x343e('0x4'));var fs=require('fs');var Redis=require(_0x343e('0x5'));var db=require(_0x343e('0x6'))['db'];var utils=require(_0x343e('0x7'));var logger=require(_0x343e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x343e('0x9'));var client=jayson[_0x343e('0xa')][_0x343e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x393b38,_0x182a9c,_0x5673e8){return new BPromise(function(_0x24b284,_0x21f0e4){return client['request'](_0x393b38,_0x5673e8)[_0x343e('0xc')](function(_0x5d1123){logger['info'](_0x343e('0xd'),_0x182a9c,_0x343e('0xe'));logger['debug'](_0x343e('0xf'),_0x182a9c,_0x343e('0xe'),JSON['stringify'](_0x5d1123));if(_0x5d1123[_0x343e('0x10')]){if(_0x5d1123[_0x343e('0x10')][_0x343e('0x11')]===0x1f4){logger['error'](_0x343e('0xd'),_0x182a9c,_0x5d1123[_0x343e('0x10')]['message']);return _0x21f0e4(_0x5d1123['error'][_0x343e('0x12')]);}logger['error'](_0x343e('0xd'),_0x182a9c,_0x5d1123['error'][_0x343e('0x12')]);return _0x24b284(_0x5d1123[_0x343e('0x10')][_0x343e('0x12')]);}else{logger['info'](_0x343e('0xd'),_0x182a9c,_0x343e('0xe'));_0x24b284(_0x5d1123[_0x343e('0x13')]['message']);}})[_0x343e('0x14')](function(_0x2c13dd){logger[_0x343e('0x10')](_0x343e('0xd'),_0x182a9c,_0x2c13dd);_0x21f0e4(_0x2c13dd);});});} \ No newline at end of file +var _0x6a79=['request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x437841,_0x587e32){var _0x3254b3=function(_0x299b12){while(--_0x299b12){_0x437841['push'](_0x437841['shift']());}};_0x3254b3(++_0x587e32);}(_0x6a79,0xa0));var _0x96a7=function(_0x2fff52,_0x1580ac){_0x2fff52=_0x2fff52-0x0;var _0x4fef52=_0x6a79[_0x2fff52];return _0x4fef52;};'use strict';var _=require(_0x96a7('0x0'));var util=require('util');var moment=require(_0x96a7('0x1'));var BPromise=require(_0x96a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96a7('0x3'));var db=require(_0x96a7('0x4'))['db'];var utils=require(_0x96a7('0x5'));var logger=require(_0x96a7('0x6'))(_0x96a7('0x7'));var config=require(_0x96a7('0x8'));var jayson=require(_0x96a7('0x9'));var client=jayson[_0x96a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x178041,_0x52408e,_0x1259aa){return new BPromise(function(_0x4b2d95,_0x5f1c18){return client[_0x96a7('0xb')](_0x178041,_0x1259aa)[_0x96a7('0xc')](function(_0x1b17be){logger[_0x96a7('0xd')](_0x96a7('0xe'),_0x52408e,'request\x20sent');logger['debug'](_0x96a7('0xf'),_0x52408e,_0x96a7('0x10'),JSON[_0x96a7('0x11')](_0x1b17be));if(_0x1b17be['error']){if(_0x1b17be[_0x96a7('0x12')][_0x96a7('0x13')]===0x1f4){logger['error'](_0x96a7('0xe'),_0x52408e,_0x1b17be[_0x96a7('0x12')][_0x96a7('0x14')]);return _0x5f1c18(_0x1b17be['error'][_0x96a7('0x14')]);}logger[_0x96a7('0x12')]('Schedule,\x20%s,\x20%s',_0x52408e,_0x1b17be['error']['message']);return _0x4b2d95(_0x1b17be[_0x96a7('0x12')]['message']);}else{logger[_0x96a7('0xd')]('Schedule,\x20%s,\x20%s',_0x52408e,'request\x20sent');_0x4b2d95(_0x1b17be[_0x96a7('0x15')][_0x96a7('0x14')]);}})['catch'](function(_0x16dbb9){logger[_0x96a7('0x12')](_0x96a7('0xe'),_0x52408e,_0x16dbb9);_0x5f1c18(_0x16dbb9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 50f22e8..5ff3d2c 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 _0xf5bb=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x598c4c,_0x24cb45){var _0x2b4528=function(_0x2d36ac){while(--_0x2d36ac){_0x598c4c['push'](_0x598c4c['shift']());}};_0x2b4528(++_0x24cb45);}(_0xf5bb,0x157));var _0xbf5b=function(_0x520138,_0x40f17e){_0x520138=_0x520138-0x0;var _0x1d66fc=_0xf5bb[_0x520138];return _0x1d66fc;};'use strict';var multer=require(_0xbf5b('0x0'));var util=require(_0xbf5b('0x1'));var path=require(_0xbf5b('0x2'));var timeout=require(_0xbf5b('0x3'));var express=require(_0xbf5b('0x4'));var router=express[_0xbf5b('0x5')]();var fs_extra=require(_0xbf5b('0x6'));var auth=require(_0xbf5b('0x7'));var interaction=require(_0xbf5b('0x8'));var config=require(_0xbf5b('0x9'));var controller=require(_0xbf5b('0xa'));router[_0xbf5b('0xb')]('/',auth[_0xbf5b('0xc')](),controller[_0xbf5b('0xd')]);router['get'](_0xbf5b('0xe'),auth[_0xbf5b('0xc')](),controller[_0xbf5b('0xf')]);router['get'](_0xbf5b('0x10'),auth[_0xbf5b('0xc')](),controller['show']);router['get'](_0xbf5b('0x11'),auth[_0xbf5b('0xc')](),controller['download']);router[_0xbf5b('0x12')]('/',auth['isAuthenticated'](),controller[_0xbf5b('0x13')]);router['put']('/:id',auth[_0xbf5b('0xc')](),controller[_0xbf5b('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xbf5b('0x15')]=router; \ No newline at end of file +var _0x4628=['/describe','describe','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x5b3946,_0x23053c){var _0x2bd577=function(_0x406e40){while(--_0x406e40){_0x5b3946['push'](_0x5b3946['shift']());}};_0x2bd577(++_0x23053c);}(_0x4628,0x156));var _0x8462=function(_0x463454,_0x10857f){_0x463454=_0x463454-0x0;var _0x192b6a=_0x4628[_0x463454];return _0x192b6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8462('0x0'));var timeout=require(_0x8462('0x1'));var express=require(_0x8462('0x2'));var router=express['Router']();var fs_extra=require(_0x8462('0x3'));var auth=require(_0x8462('0x4'));var interaction=require(_0x8462('0x5'));var config=require(_0x8462('0x6'));var controller=require(_0x8462('0x7'));router[_0x8462('0x8')]('/',auth[_0x8462('0x9')](),controller['index']);router[_0x8462('0x8')](_0x8462('0xa'),auth[_0x8462('0x9')](),controller[_0x8462('0xb')]);router[_0x8462('0x8')](_0x8462('0xc'),auth[_0x8462('0x9')](),controller[_0x8462('0xd')]);router[_0x8462('0x8')](_0x8462('0xe'),auth[_0x8462('0x9')](),controller[_0x8462('0xf')]);router['post']('/',auth[_0x8462('0x9')](),controller[_0x8462('0x10')]);router[_0x8462('0x11')](_0x8462('0xc'),auth[_0x8462('0x9')](),controller[_0x8462('0x12')]);router[_0x8462('0x13')](_0x8462('0xc'),auth['isAuthenticated'](),controller[_0x8462('0x14')]);module[_0x8462('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2fe6719..a697c28 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 _0xf7d9=['toString','createdAt','sequelize','moment','path','../../config/environment','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm'];(function(_0x194428,_0x5a83ba){var _0x45adc0=function(_0x504b9b){while(--_0x504b9b){_0x194428['push'](_0x194428['shift']());}};_0x45adc0(++_0x5a83ba);}(_0xf7d9,0x122));var _0x9f7d=function(_0x2f9eed,_0x590a29){_0x2f9eed=_0x2f9eed-0x0;var _0x33fffa=_0xf7d9[_0x2f9eed];return _0x33fffa;};'use strict';var Sequelize=require(_0x9f7d('0x0'));var moment=require(_0x9f7d('0x1'));var path=require(_0x9f7d('0x2'));var config=require(_0x9f7d('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9f7d('0x4')]('value')?path[_0x9f7d('0x5')](this[_0x9f7d('0x4')](_0x9f7d('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x9f7d('0x7')]},'channel':{'type':Sequelize[_0x9f7d('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x4dc6b9){var _0xf09259=_0x4dc6b9[_0x9f7d('0x8')](/\\/g,'/');this[_0x9f7d('0x9')](_0x9f7d('0x6'),_0xf09259);}},'rating':{'type':Sequelize[_0x9f7d('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9f7d('0xa')],'set':function(_0x5290e2){this[_0x9f7d('0x9')](_0x9f7d('0xb'),moment()['subtract'](_0x5290e2,'ms'));this[_0x9f7d('0x9')](_0x9f7d('0xc'),moment());this[_0x9f7d('0x9')]('duration',_0x5290e2);}},'startedAt':{'type':Sequelize[_0x9f7d('0xd')],'get':function(){return moment(this[_0x9f7d('0x4')](_0x9f7d('0xb')))[_0x9f7d('0xe')](_0x9f7d('0xf'))[_0x9f7d('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9f7d('0x4')](_0x9f7d('0xc')))[_0x9f7d('0xe')](_0x9f7d('0xf'))['toString']();}},'createdAt':{'type':Sequelize[_0x9f7d('0xd')],'get':function(){return moment(this[_0x9f7d('0x4')](_0x9f7d('0x11')))[_0x9f7d('0xe')](_0x9f7d('0xf'))[_0x9f7d('0x10')]();}},'updatedAt':{'type':Sequelize[_0x9f7d('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x9f7d('0xe')](_0x9f7d('0xf'))[_0x9f7d('0x10')]();}}}; \ No newline at end of file +var _0x6b47=['createdAt','updatedAt','moment','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x25fff3,_0x57a414){var _0x510446=function(_0x5d3907){while(--_0x5d3907){_0x25fff3['push'](_0x25fff3['shift']());}};_0x510446(++_0x57a414);}(_0x6b47,0xe9));var _0x76b4=function(_0x4becb8,_0x4ad3d3){_0x4becb8=_0x4becb8-0x0;var _0x5c8a37=_0x6b47[_0x4becb8];return _0x5c8a37;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x76b4('0x0'));var path=require('path');var config=require(_0x76b4('0x1'));module[_0x76b4('0x2')]={'format':{'type':Sequelize[_0x76b4('0x3')],'get':function(){return this[_0x76b4('0x4')]('value')?path[_0x76b4('0x5')](this[_0x76b4('0x4')](_0x76b4('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x76b4('0x7')]},'channel':{'type':Sequelize[_0x76b4('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x461190){var _0x2a0690=_0x461190[_0x76b4('0x8')](/\\/g,'/');this[_0x76b4('0x9')](_0x76b4('0x6'),_0x2a0690);}},'rating':{'type':Sequelize[_0x76b4('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x76b4('0xa')],'set':function(_0x127be2){this[_0x76b4('0x9')](_0x76b4('0xb'),moment()[_0x76b4('0xc')](_0x127be2,'ms'));this[_0x76b4('0x9')](_0x76b4('0xd'),moment());this['setDataValue'](_0x76b4('0xe'),_0x127be2);}},'startedAt':{'type':Sequelize[_0x76b4('0xf')],'get':function(){return moment(this['getDataValue'](_0x76b4('0xb')))[_0x76b4('0x10')](_0x76b4('0x11'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x76b4('0x4')](_0x76b4('0xd')))[_0x76b4('0x10')](_0x76b4('0x11'))[_0x76b4('0x12')]();}},'createdAt':{'type':Sequelize[_0x76b4('0xf')],'get':function(){return moment(this[_0x76b4('0x4')](_0x76b4('0x13')))[_0x76b4('0x10')](_0x76b4('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x76b4('0x4')](_0x76b4('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x76b4('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 2da4eab..3432347 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 _0x8ef6=['keys','find','create','update','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','ValidationError','ScreenRecording\x20not\x20found','filename','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params'];(function(_0x3eb755,_0x481093){var _0x1859b2=function(_0x4693b2){while(--_0x4693b2){_0x3eb755['push'](_0x3eb755['shift']());}};_0x1859b2(++_0x481093);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3f352a,_0xce513a){_0x3f352a=_0x3f352a-0x0;var _0xaba834=_0x8ef6[_0x3f352a];return _0xaba834;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x13280b,_0x5e4dbe){return function(_0x178460){if(!_0x178460){_0x13280b['sendStatus'](0x194);}return _0x178460;};}function handleError(_0x599243,_0x55d8b0){_0x55d8b0=_0x55d8b0||0x1f4;return function(_0x1a7ce1){logger[_0x68ef('0x29')](_0x1a7ce1[_0x68ef('0x2a')]);if(_0x1a7ce1[_0x68ef('0x2b')]){delete _0x1a7ce1['name'];}_0x599243['status'](_0x55d8b0)[_0x68ef('0x2c')](_0x1a7ce1);};}exports[_0x68ef('0x2d')]=function(_0x7bf96,_0x263b30){var _0x22ef25={},_0x201884={},_0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x2e')][_0x68ef('0x2f')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x30')]['key']};});_0x201884[_0x68ef('0x31')]=_[_0x68ef('0x32')](_['map'](_0x4579cb,'name'),[_0x68ef('0x33')]);_0x201884[_0x68ef('0x34')]=_['keys'](_0x7bf96[_0x68ef('0x34')]);_0x201884[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x201884[_0x68ef('0x31')],_0x201884['query']);_0x22ef25[_0x68ef('0x37')]=_[_0x68ef('0x36')](_0x201884['model'],qs[_0x68ef('0x38')](_0x7bf96['query'][_0x68ef('0x38')]));_0x22ef25[_0x68ef('0x37')]=_0x22ef25['attributes'][_0x68ef('0x39')]?_0x22ef25['attributes']:_0x201884[_0x68ef('0x31')];if(!_0x7bf96['query'][_0x68ef('0x3a')](_0x68ef('0x3b'))){_0x22ef25[_0x68ef('0x21')]=qs['limit'](_0x7bf96[_0x68ef('0x34')]['limit']);_0x22ef25[_0x68ef('0x1f')]=qs['offset'](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x1f')]);}_0x22ef25[_0x68ef('0x3c')]=qs[_0x68ef('0x3d')](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3d')]);_0x22ef25['where']=qs[_0x68ef('0x35')](_[_0x68ef('0x3e')](_0x7bf96[_0x68ef('0x34')],_0x201884['filters']),_0x4579cb);if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3f')]){_0x22ef25[_0x68ef('0x40')]=_['merge'](_0x22ef25['where'],{'$or':_[_0x68ef('0x41')](_0x4579cb,function(_0xec7de3){if(_0xec7de3[_0x68ef('0x30')]!==_0x68ef('0x42')){var _0x401459={};_0x401459[_0xec7de3[_0x68ef('0x2b')]]={'$like':'%'+_0x7bf96[_0x68ef('0x34')]['filter']+'%'};return _0x401459;}})});}_0x22ef25=_[_0x68ef('0x43')]({},_0x22ef25,_0x7bf96[_0x68ef('0x44')]);var _0x2f6ee0={'where':_0x22ef25[_0x68ef('0x40')]};return db['ScreenRecording'][_0x68ef('0x45')](_0x2f6ee0)[_0x68ef('0x27')](function(_0xcf595d){_0x26288a[_0x68ef('0x45')]=_0xcf595d;if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x46')]){_0x22ef25['include']=[{'all':!![]}];}return db[_0x68ef('0x2e')][_0x68ef('0x47')](_0x22ef25);})[_0x68ef('0x27')](function(_0x43796b){_0x26288a[_0x68ef('0x48')]=_0x43796b;return _0x26288a;})[_0x68ef('0x27')](respondWithFilteredResult(_0x263b30,_0x22ef25))[_0x68ef('0x49')](handleError(_0x263b30,null));};exports[_0x68ef('0x4a')]=function(_0xc687ab,_0x531096){var _0xad1a28={'raw':![],'where':{'id':_0xc687ab[_0x68ef('0x4b')]['id']}},_0x19d7a1={};_0x19d7a1[_0x68ef('0x31')]=_[_0x68ef('0x4c')](db[_0x68ef('0x2e')][_0x68ef('0x2f')]);_0x19d7a1['query']=_[_0x68ef('0x4c')](_0xc687ab['query']);_0x19d7a1[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x19d7a1[_0x68ef('0x31')],_0x19d7a1[_0x68ef('0x34')]);_0xad1a28['attributes']=_[_0x68ef('0x36')](_0x19d7a1['model'],qs[_0x68ef('0x38')](_0xc687ab['query'][_0x68ef('0x38')]));_0xad1a28[_0x68ef('0x37')]=_0xad1a28[_0x68ef('0x37')]['length']?_0xad1a28['attributes']:_0x19d7a1[_0x68ef('0x31')];if(_0xc687ab[_0x68ef('0x34')]['includeAll']){_0xad1a28['include']=[{'all':!![]}];}_0xad1a28=_['merge']({},_0xad1a28,_0xc687ab[_0x68ef('0x44')]);return db[_0x68ef('0x2e')][_0x68ef('0x4d')](_0xad1a28)[_0x68ef('0x27')](handleEntityNotFound(_0x531096,null))[_0x68ef('0x27')](respondWithResult(_0x531096,null))['catch'](handleError(_0x531096,null));};exports['create']=function(_0xc39f5b,_0x21f064){return db[_0x68ef('0x2e')][_0x68ef('0x4e')](_0xc39f5b['body'],{})[_0x68ef('0x27')](respondWithResult(_0x21f064,0xc9))[_0x68ef('0x49')](handleError(_0x21f064,null));};exports[_0x68ef('0x4f')]=function(_0x14142a,_0x53880c){if(_0x14142a['body']['id']){delete _0x14142a[_0x68ef('0x50')]['id'];}delete _0x14142a[_0x68ef('0x50')]['duration'];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x51')];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x52')];delete _0x14142a[_0x68ef('0x50')]['value'];return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':{'id':_0x14142a[_0x68ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53880c,null))[_0x68ef('0x27')](saveUpdates(_0x14142a[_0x68ef('0x50')],null))[_0x68ef('0x27')](respondWithResult(_0x53880c,null))['catch'](handleError(_0x53880c,null));};exports[_0x68ef('0x53')]=function(_0x59e8ee,_0x574573){return db[_0x68ef('0x2e')]['describe']()[_0x68ef('0x27')](respondWithResult(_0x574573,null))[_0x68ef('0x49')](handleError(_0x574573,null));};exports[_0x68ef('0x54')]=function(_0x1e651f,_0x2a0be0,_0x45ae42){var _0x363498=require(_0x68ef('0x55'));var _0x2b35f4=![];var _0x247915={};if(_0x1e651f['query']['type']&&_0x1e651f[_0x68ef('0x34')][_0x68ef('0x30')]===_0x68ef('0x56')){_0x247915[_0x68ef('0x56')]=_0x1e651f[_0x68ef('0x4b')]['id'];}else{_0x247915['id']=_0x1e651f[_0x68ef('0x4b')]['id'];}return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':_0x247915,'attributes':['id',_0x68ef('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x2a0be0,null))['then'](function(_0x42a4b2){if(_0x42a4b2){var _0x5781c8=path[_0x68ef('0x58')](config['root'],_0x68ef('0x59'),_0x42a4b2[_0x68ef('0x57')]);var _0x552736=util[_0x68ef('0x33')]('%s.cypher',_0x5781c8);if(fs[_0x68ef('0x5a')](_0x552736)){_0x2b35f4=!![];return _0x363498[_0x68ef('0x5b')](_0x552736,_0x5781c8,config[_0x68ef('0x5c')][_0x68ef('0x5d')])[_0x68ef('0x27')](function(){return _0x42a4b2;});}return _0x42a4b2;}})[_0x68ef('0x27')](function(_0x5c347c){if(_0x5c347c){var _0x1cdaef=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],_0x68ef('0x59'),_0x5c347c[_0x68ef('0x57')]);if(!fs[_0x68ef('0x5a')](_0x1cdaef)){throw new db['Sequelize'][(_0x68ef('0x5f'))](_0x68ef('0x60'));}if(_0x5c347c['filename']){return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,_0x5c347c[_0x68ef('0x61')]+path[_0x68ef('0x62')](_0x1cdaef),function(){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}else{return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,function(_0x49d197){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}}})[_0x68ef('0x49')](function(_0x540da5){if(_0x540da5[_0x68ef('0x63')]==='ScreenRecording\x20not\x20found'){_0x2a0be0[_0x68ef('0x1d')](0x194)[_0x68ef('0x2c')](_0x68ef('0x64'));}else{return handleError(_0x2a0be0,null);}});};exports[_0x68ef('0x28')]=function(_0x19ce17,_0x19a9c4){return db['ScreenRecording'][_0x68ef('0x4d')]({'where':{'id':_0x19ce17['params']['id']}})[_0x68ef('0x27')](function(_0x4b0c3e){if(_[_0x68ef('0x65')](_0x4b0c3e)){throw new ReferenceError(_0x68ef('0x66'));}return _0x4b0c3e;})[_0x68ef('0x27')](function(_0xf0a40f){var _0x2f409c=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],'server/files/screen_recordings',_0xf0a40f[_0x68ef('0x57')]);logger[_0x68ef('0x67')](_0x68ef('0x68'),_0x2f409c);if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs['existsSync'](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}_0x2f409c=_0x2f409c+'.cypher';if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs[_0x68ef('0x5a')](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}return _0xf0a40f;})[_0x68ef('0x27')](function(_0x2d916e){if(!_0x2d916e)throw new InternalError();return _0x2d916e[_0x68ef('0x28')]();})['then'](function(){_0x19a9c4['status'](0xcc)[_0x68ef('0x1c')]();})[_0x68ef('0x49')](handleError(_0x19a9c4,null));}; \ No newline at end of file +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(_0x2aec1b,_0x50b92b){var _0x1def7b=function(_0x4303d3){while(--_0x4303d3){_0x2aec1b['push'](_0x2aec1b['shift']());}};_0x1def7b(++_0x50b92b);}(_0xa41a,0x6b));var _0xaa41=function(_0x3475b1,_0xdc1269){_0x3475b1=_0x3475b1-0x0;var _0x34b828=_0xa41a[_0x3475b1];return _0x34b828;};'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 diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index cc25c10..57bd09c 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 _0x859c=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ScreenRecording','interactionid','lodash'];(function(_0x5b05ff,_0x369cdd){var _0x3fb474=function(_0x299c80){while(--_0x299c80){_0x5b05ff['push'](_0x5b05ff['shift']());}};_0x3fb474(++_0x369cdd);}(_0x859c,0x151));var _0xc859=function(_0x2ab98f,_0x48f6de){_0x2ab98f=_0x2ab98f-0x0;var _0x3f7297=_0x859c[_0x2ab98f];return _0x3f7297;};'use strict';var _=require(_0xc859('0x0'));var util=require(_0xc859('0x1'));var logger=require(_0xc859('0x2'))(_0xc859('0x3'));var moment=require(_0xc859('0x4'));var BPromise=require(_0xc859('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc859('0x6'));var rimraf=require(_0xc859('0x7'));var config=require(_0xc859('0x8'));var attributes=require('./screenRecording.attributes');module[_0xc859('0x9')]=function(_0x4246ea,_0x166c51){return _0x4246ea[_0xc859('0xa')](_0xc859('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xc859('0xc'),'fields':[_0xc859('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1bc1=['../../config/logger','api','bluebird','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util'];(function(_0x5b1a2e,_0x150cba){var _0x13260d=function(_0x15537e){while(--_0x15537e){_0x5b1a2e['push'](_0x5b1a2e['shift']());}};_0x13260d(++_0x150cba);}(_0x1bc1,0x112));var _0x11bc=function(_0xefebd8,_0x1d95b9){_0xefebd8=_0xefebd8-0x0;var _0x1b08e3=_0x1bc1[_0xefebd8];return _0x1b08e3;};'use strict';var _=require(_0x11bc('0x0'));var util=require(_0x11bc('0x1'));var logger=require(_0x11bc('0x2'))(_0x11bc('0x3'));var moment=require('moment');var BPromise=require(_0x11bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11bc('0x5'));var config=require('../../config/environment');var attributes=require(_0x11bc('0x6'));module[_0x11bc('0x7')]=function(_0x5d1466,_0x414706){return _0x5d1466[_0x11bc('0x8')](_0x11bc('0x9'),attributes,{'tableName':_0x11bc('0xa'),'paranoid':![],'indexes':[{'name':_0x11bc('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5f1a2ee..df3bfd9 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 _0x21fa=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2fc170,_0x524d6f){var _0x28ef77=function(_0x2efe94){while(--_0x2efe94){_0x2fc170['push'](_0x2fc170['shift']());}};_0x28ef77(++_0x524d6f);}(_0x21fa,0x1b7));var _0xa21f=function(_0x1e950c,_0x2b6844){_0x1e950c=_0x1e950c-0x0;var _0x441214=_0x21fa[_0x1e950c];return _0x441214;};'use strict';var _=require(_0xa21f('0x0'));var util=require(_0xa21f('0x1'));var moment=require('moment');var BPromise=require(_0xa21f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa21f('0x3'));var db=require(_0xa21f('0x4'))['db'];var utils=require(_0xa21f('0x5'));var logger=require(_0xa21f('0x6'))(_0xa21f('0x7'));var config=require(_0xa21f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa21f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7db5,_0x3b9ae9,_0x1f16a3){return new BPromise(function(_0x2d5bb5,_0x44170a){return client[_0xa21f('0xa')](_0x4c7db5,_0x1f16a3)[_0xa21f('0xb')](function(_0x4ecd67){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x3b9ae9,_0xa21f('0xc'));logger[_0xa21f('0xd')](_0xa21f('0xe'),_0x3b9ae9,_0xa21f('0xc'),JSON['stringify'](_0x4ecd67));if(_0x4ecd67['error']){if(_0x4ecd67[_0xa21f('0xf')][_0xa21f('0x10')]===0x1f4){logger[_0xa21f('0xf')](_0xa21f('0x11'),_0x3b9ae9,_0x4ecd67['error'][_0xa21f('0x12')]);return _0x44170a(_0x4ecd67['error'][_0xa21f('0x12')]);}logger[_0xa21f('0xf')](_0xa21f('0x11'),_0x3b9ae9,_0x4ecd67[_0xa21f('0xf')][_0xa21f('0x12')]);return _0x2d5bb5(_0x4ecd67[_0xa21f('0xf')][_0xa21f('0x12')]);}else{logger['info'](_0xa21f('0x11'),_0x3b9ae9,_0xa21f('0xc'));_0x2d5bb5(_0x4ecd67[_0xa21f('0x13')]['message']);}})[_0xa21f('0x14')](function(_0x50cc58){logger[_0xa21f('0xf')](_0xa21f('0x11'),_0x3b9ae9,_0x50cc58);_0x44170a(_0x50cc58);});});} \ No newline at end of file +var _0x630a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x630a,0x6a));var _0xa630=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x630a[_0x25d2fb];return _0x1ded53;};'use strict';var _=require(_0xa630('0x0'));var util=require(_0xa630('0x1'));var moment=require(_0xa630('0x2'));var BPromise=require('bluebird');var rs=require(_0xa630('0x3'));var fs=require('fs');var Redis=require(_0xa630('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa630('0x5'));var logger=require(_0xa630('0x6'))(_0xa630('0x7'));var config=require(_0xa630('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa630('0x9')][_0xa630('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc41fd,_0x58a27e,_0x7beab2){return new BPromise(function(_0x4a377c,_0x4ee241){return client[_0xa630('0xb')](_0xcc41fd,_0x7beab2)[_0xa630('0xc')](function(_0xfd3d1d){logger[_0xa630('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x58a27e,'request\x20sent');logger[_0xa630('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x58a27e,_0xa630('0xf'),JSON['stringify'](_0xfd3d1d));if(_0xfd3d1d[_0xa630('0x10')]){if(_0xfd3d1d[_0xa630('0x10')][_0xa630('0x11')]===0x1f4){logger[_0xa630('0x10')](_0xa630('0x12'),_0x58a27e,_0xfd3d1d[_0xa630('0x10')][_0xa630('0x13')]);return _0x4ee241(_0xfd3d1d[_0xa630('0x10')][_0xa630('0x13')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x58a27e,_0xfd3d1d[_0xa630('0x10')][_0xa630('0x13')]);return _0x4a377c(_0xfd3d1d['error']['message']);}else{logger[_0xa630('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x58a27e,'request\x20sent');_0x4a377c(_0xfd3d1d[_0xa630('0x14')][_0xa630('0x13')]);}})[_0xa630('0x15')](function(_0x91d968){logger[_0xa630('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x58a27e,_0x91d968);_0x4ee241(_0x91d968);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 832d6f6..a7fb439 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 _0xccf5=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/now','getDate','/:id','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','addLogo','logologin','post','file','addLogoLogin','favicon','exports','util'];(function(_0x271834,_0x3cac4a){var _0x54f307=function(_0x92c91f){while(--_0x92c91f){_0x271834['push'](_0x271834['shift']());}};_0x54f307(++_0x3cac4a);}(_0xccf5,0x17b));var _0x5ccf=function(_0x3d5993,_0x4592e5){_0x3d5993=_0x3d5993-0x0;var _0x11fc48=_0xccf5[_0x3d5993];return _0x11fc48;};'use strict';var multer=require('multer');var util=require(_0x5ccf('0x0'));var path=require(_0x5ccf('0x1'));var timeout=require(_0x5ccf('0x2'));var express=require(_0x5ccf('0x3'));var router=express[_0x5ccf('0x4')]();var fs_extra=require(_0x5ccf('0x5'));var auth=require(_0x5ccf('0x6'));var interaction=require(_0x5ccf('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x5ccf('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ccf('0x8')](_0x5ccf('0x9'),controller[_0x5ccf('0xa')]);router[_0x5ccf('0x8')](_0x5ccf('0xb'),controller['show']);router[_0x5ccf('0x8')](_0x5ccf('0xc'),controller[_0x5ccf('0xd')]);router[_0x5ccf('0x8')]('/:id/logo_login',controller[_0x5ccf('0xe')]);router['get'](_0x5ccf('0xf'),controller[_0x5ccf('0x10')]);router[_0x5ccf('0x8')](_0x5ccf('0x11'),controller[_0x5ccf('0x12')]);router[_0x5ccf('0x8')](_0x5ccf('0x13'),controller[_0x5ccf('0x14')]);var upload=multer({'storage':multer[_0x5ccf('0x15')]({'destination':function(_0x1fd580,_0x4c113c,_0x1dc2bf){_0x1dc2bf(null,path[_0x5ccf('0x16')](config[_0x5ccf('0x17')],_0x5ccf('0x18')));},'filename':function(_0x245c33,_0x2d96e6,_0x57350d){_0x57350d(null,util[_0x5ccf('0x19')](_0x5ccf('0x1a'),_0x5ccf('0x1b'),path[_0x5ccf('0x1c')](_0x2d96e6[_0x5ccf('0x1d')])));}})});router['post']('/:id/logo',upload[_0x5ccf('0x1e')]('file'),controller[_0x5ccf('0x1f')]);var upload=multer({'storage':multer[_0x5ccf('0x15')]({'destination':function(_0x89ae3b,_0x557f36,_0x169597){_0x169597(null,path[_0x5ccf('0x16')](config['root'],_0x5ccf('0x18')));},'filename':function(_0x441141,_0x3763f7,_0x16b7eb){_0x16b7eb(null,util[_0x5ccf('0x19')](_0x5ccf('0x1a'),_0x5ccf('0x20'),path['extname'](_0x3763f7['originalname'])));}})});router[_0x5ccf('0x21')]('/:id/logo_login',upload[_0x5ccf('0x1e')](_0x5ccf('0x22')),controller[_0x5ccf('0x23')]);var upload=multer({'storage':multer[_0x5ccf('0x15')]({'destination':function(_0x18bd1b,_0xc4cc5c,_0x4ca4d7){_0x4ca4d7(null,path[_0x5ccf('0x16')](config[_0x5ccf('0x17')],_0x5ccf('0x18')));},'filename':function(_0x3ddaff,_0x405805,_0x573771){_0x573771(null,util[_0x5ccf('0x19')]('%s%s','preferred',path[_0x5ccf('0x1c')](_0x405805[_0x5ccf('0x1d')])));}})});router[_0x5ccf('0x21')](_0x5ccf('0x11'),upload[_0x5ccf('0x1e')](_0x5ccf('0x22')),controller['addPreferred']);var upload=multer({'storage':multer[_0x5ccf('0x15')]({'destination':function(_0x318cef,_0x56b130,_0x421b4e){_0x421b4e(null,path['join'](config[_0x5ccf('0x17')],'server/files/images/logos/'));},'filename':function(_0x3ec830,_0x2d722f,_0x2e00ff){_0x2e00ff(null,util[_0x5ccf('0x19')]('%s%s',_0x5ccf('0x24'),path[_0x5ccf('0x1c')](_0x2d722f['originalname'])));}})});router['post'](_0x5ccf('0x13'),upload[_0x5ccf('0x1e')](_0x5ccf('0x22')),controller['addFavicon']);router['put'](_0x5ccf('0xb'),auth['isAuthenticated'](),controller['update']);module[_0x5ccf('0x25')]=router; \ No newline at end of file +var _0x5730=['root','originalname','post','file','addLogoLogin','diskStorage','preferred','extname','addFavicon','put','update','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','single'];(function(_0x395a99,_0x200efe){var _0x193b64=function(_0x5dbd84){while(--_0x5dbd84){_0x395a99['push'](_0x395a99['shift']());}};_0x193b64(++_0x200efe);}(_0x5730,0x19c));var _0x0573=function(_0x24eaf9,_0xe9a8c9){_0x24eaf9=_0x24eaf9-0x0;var _0x39e6fe=_0x5730[_0x24eaf9];return _0x39e6fe;};'use strict';var multer=require('multer');var util=require(_0x0573('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0573('0x1'));var router=express[_0x0573('0x2')]();var fs_extra=require(_0x0573('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0573('0x4'));var config=require(_0x0573('0x5'));var controller=require('./setting.controller');router[_0x0573('0x6')]('/',auth[_0x0573('0x7')](),controller[_0x0573('0x8')]);router[_0x0573('0x6')](_0x0573('0x9'),controller[_0x0573('0xa')]);router[_0x0573('0x6')](_0x0573('0xb'),controller[_0x0573('0xc')]);router['get'](_0x0573('0xd'),controller[_0x0573('0xe')]);router['get'](_0x0573('0xf'),controller[_0x0573('0x10')]);router[_0x0573('0x6')](_0x0573('0x11'),controller[_0x0573('0x12')]);router[_0x0573('0x6')](_0x0573('0x13'),controller['getPreferred']);router[_0x0573('0x6')](_0x0573('0x14'),controller[_0x0573('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x311c45,_0x58c3ec,_0xde1cf7){_0xde1cf7(null,path[_0x0573('0x16')](config['root'],_0x0573('0x17')));},'filename':function(_0x164b93,_0x5c952c,_0x22c0a3){_0x22c0a3(null,util[_0x0573('0x18')](_0x0573('0x19'),_0x0573('0x1a'),path['extname'](_0x5c952c['originalname'])));}})});router['post'](_0x0573('0xd'),upload[_0x0573('0x1b')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2745d4,_0x592b07,_0x23e835){_0x23e835(null,path[_0x0573('0x16')](config[_0x0573('0x1c')],_0x0573('0x17')));},'filename':function(_0x3f337f,_0x1a20cf,_0x16867b){_0x16867b(null,util[_0x0573('0x18')](_0x0573('0x19'),'logologin',path['extname'](_0x1a20cf[_0x0573('0x1d')])));}})});router[_0x0573('0x1e')](_0x0573('0xf'),upload['single'](_0x0573('0x1f')),controller[_0x0573('0x20')]);var upload=multer({'storage':multer[_0x0573('0x21')]({'destination':function(_0x3ade8a,_0x12d21e,_0x4f9d1b){_0x4f9d1b(null,path[_0x0573('0x16')](config[_0x0573('0x1c')],_0x0573('0x17')));},'filename':function(_0x2c5f46,_0x2570ac,_0x2847a2){_0x2847a2(null,util['format'](_0x0573('0x19'),_0x0573('0x22'),path[_0x0573('0x23')](_0x2570ac['originalname'])));}})});router[_0x0573('0x1e')](_0x0573('0x13'),upload[_0x0573('0x1b')](_0x0573('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cec54,_0x1eca9a,_0x4dc849){_0x4dc849(null,path[_0x0573('0x16')](config[_0x0573('0x1c')],_0x0573('0x17')));},'filename':function(_0x4b7110,_0xa46b3e,_0x515e9a){_0x515e9a(null,util[_0x0573('0x18')](_0x0573('0x19'),'favicon',path[_0x0573('0x23')](_0xa46b3e['originalname'])));}})});router['post']('/:id/favicon',upload[_0x0573('0x1b')](_0x0573('0x1f')),controller[_0x0573('0x24')]);router[_0x0573('0x25')](_0x0573('0xb'),auth[_0x0573('0x7')](),controller[_0x0573('0x26')]);module[_0x0573('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7792a74..8b2a52e 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(_0x1c2aa9,_0x22472f){var _0x53eaf8=function(_0x43a830){while(--_0x43a830){_0x1c2aa9['push'](_0x1c2aa9['shift']());}};_0x53eaf8(++_0x22472f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x144128,_0x5164a1){var _0x3e39d7=function(_0x1eec7f){while(--_0x1eec7f){_0x144128['push'](_0x144128['shift']());}};_0x3e39d7(++_0x5164a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 4def9d5..fe55400 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 _0x8781=['result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','stack','name','index','rawAttributes','type','key','model','map','query','keys','attributes','fields','length','where','filters','pick','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','show','params','intersection','find','body','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','download','getLogoLogin','getLicense','upperFirst','default_loginLogo.svg','ValidationError','gdpr','securePassword','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8781,0x1c8));var _0x1878=function(_0x4f398e,_0x1341b6){_0x4f398e=_0x4f398e-0x0;var _0x5405f1=_0x8781[_0x4f398e];return _0x5405f1;};'use strict';var emlformat=require(_0x1878('0x0'));var rimraf=require(_0x1878('0x1'));var zipdir=require(_0x1878('0x2'));var jsonpatch=require(_0x1878('0x3'));var rp=require(_0x1878('0x4'));var moment=require(_0x1878('0x5'));var BPromise=require(_0x1878('0x6'));var Mustache=require('mustache');var util=require(_0x1878('0x7'));var path=require(_0x1878('0x8'));var sox=require(_0x1878('0x9'));var csv=require(_0x1878('0xa'));var ejs=require(_0x1878('0xb'));var fs=require('fs');var fs_extra=require(_0x1878('0xc'));var _=require('lodash');var squel=require(_0x1878('0xd'));var crypto=require(_0x1878('0xe'));var jsforce=require(_0x1878('0xf'));var deskjs=require(_0x1878('0x10'));var toCsv=require(_0x1878('0xa'));var querystring=require(_0x1878('0x11'));var Papa=require(_0x1878('0x12'));var Redis=require(_0x1878('0x13'));var authService=require(_0x1878('0x14'));var qs=require(_0x1878('0x15'));var as=require(_0x1878('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1878('0x17'))(_0x1878('0x18'));var utils=require(_0x1878('0x19'));var config=require(_0x1878('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x1878('0x1b'));var client=jayson[_0x1878('0x1c')][_0x1878('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x394d1d,_0x565fb4,_0x5804de,_0x19ffaa){return new BPromise(function(_0x396f3a,_0x49d3a1){var _0x46992e=_0x19ffaa||client;return _0x46992e[_0x1878('0x1e')](_0x394d1d,_0x5804de)[_0x1878('0x1f')](function(_0x4a5ba9){logger['info'](_0x1878('0x20'),_0x565fb4,_0x1878('0x21'));logger[_0x1878('0x22')](_0x1878('0x23'),_0x565fb4,_0x1878('0x21'),JSON[_0x1878('0x24')](_0x4a5ba9));if(_0x4a5ba9[_0x1878('0x25')]){if(_0x4a5ba9[_0x1878('0x25')][_0x1878('0x26')]===0x1f4){logger[_0x1878('0x25')](_0x1878('0x20'),_0x565fb4,_0x4a5ba9['error']['message']);return _0x49d3a1(_0x4a5ba9[_0x1878('0x25')][_0x1878('0x27')]);}logger['error'](_0x1878('0x20'),_0x565fb4,_0x4a5ba9[_0x1878('0x25')][_0x1878('0x27')]);return _0x396f3a(_0x4a5ba9[_0x1878('0x25')][_0x1878('0x27')]);}else{logger['info'](_0x1878('0x20'),_0x565fb4,'request\x20sent');_0x396f3a(_0x4a5ba9[_0x1878('0x28')][_0x1878('0x27')]);}})[_0x1878('0x29')](function(_0x2e9939){logger[_0x1878('0x25')]('Setting,\x20%s,\x20%s',_0x565fb4,_0x2e9939);_0x49d3a1(_0x2e9939);});});}function respondWithStatusCode(_0x461905,_0x10ce95){_0x10ce95=_0x10ce95||0xcc;return function(_0x215e59){if(_0x215e59){return _0x461905[_0x1878('0x2a')](_0x10ce95);}return _0x461905[_0x1878('0x2b')](_0x10ce95)[_0x1878('0x2c')]();};}function respondWithResult(_0x21ae23,_0x4e114d){_0x4e114d=_0x4e114d||0xc8;return function(_0x122c65){if(_0x122c65){return _0x21ae23[_0x1878('0x2b')](_0x4e114d)[_0x1878('0x2d')](_0x122c65);}};}function respondWithFilteredResult(_0xb191d0,_0x46f5b7){return function(_0x57580b){if(_0x57580b){var _0x2f7e55=typeof _0x46f5b7[_0x1878('0x2e')]===_0x1878('0x2f')&&typeof _0x46f5b7[_0x1878('0x30')]==='undefined';var _0x110aa2=_0x57580b[_0x1878('0x31')];var _0x13fb40=_0x2f7e55?0x0:_0x46f5b7[_0x1878('0x2e')];var _0x1eda2b=_0x2f7e55?_0x57580b[_0x1878('0x31')]:_0x46f5b7['offset']+_0x46f5b7[_0x1878('0x30')];var _0x6ad492;if(_0x1eda2b>=_0x110aa2){_0x1eda2b=_0x110aa2;_0x6ad492=0xc8;}else{_0x6ad492=0xce;}_0xb191d0['status'](_0x6ad492);return _0xb191d0['set'](_0x1878('0x32'),_0x13fb40+'-'+_0x1eda2b+'/'+_0x110aa2)['json'](_0x57580b);}return null;};}function patchUpdates(_0x5e9d48){return function(_0x1f2e3b){try{jsonpatch[_0x1878('0x33')](_0x1f2e3b,_0x5e9d48,!![]);}catch(_0x43352e){return BPromise['reject'](_0x43352e);}return _0x1f2e3b[_0x1878('0x34')]();};}function saveUpdates(_0x1ecd8d,_0x10a40a){return function(_0x15b97b){if(_0x15b97b){return _0x15b97b['update'](_0x1ecd8d)[_0x1878('0x1f')](function(_0x2bf18a){return _0x2bf18a;});}return null;};}function removeEntity(_0x3935a6,_0x5702f6){return function(_0x4f3cc9){if(_0x4f3cc9){return _0x4f3cc9[_0x1878('0x35')]()['then'](function(){_0x3935a6[_0x1878('0x2b')](0xcc)[_0x1878('0x2c')]();});}};}function handleEntityNotFound(_0x4ebdbe,_0x5a4dfb){return function(_0x53b5b2){if(!_0x53b5b2){_0x4ebdbe[_0x1878('0x2a')](0x194);}return _0x53b5b2;};}function handleError(_0x3b6cd8,_0x388d1c){_0x388d1c=_0x388d1c||0x1f4;return function(_0x2fdf95){logger['error'](_0x2fdf95[_0x1878('0x36')]);if(_0x2fdf95['name']){delete _0x2fdf95[_0x1878('0x37')];}_0x3b6cd8[_0x1878('0x2b')](_0x388d1c)['send'](_0x2fdf95);};}exports[_0x1878('0x38')]=function(_0x1efcef,_0x5f4d0e){var _0xd589dc={},_0x4086ea={},_0x592cfc={'count':0x0,'rows':[]};var _0xd3f20b=_['map'](db['Setting'][_0x1878('0x39')],function(_0x33c4c3){return{'name':_0x33c4c3['fieldName'],'type':_0x33c4c3[_0x1878('0x3a')][_0x1878('0x3b')]};});_0x4086ea[_0x1878('0x3c')]=_[_0x1878('0x3d')](_0xd3f20b,'name');_0x4086ea[_0x1878('0x3e')]=_[_0x1878('0x3f')](_0x1efcef[_0x1878('0x3e')]);_0x4086ea['filters']=_['intersection'](_0x4086ea[_0x1878('0x3c')],_0x4086ea[_0x1878('0x3e')]);_0xd589dc[_0x1878('0x40')]=_['intersection'](_0x4086ea[_0x1878('0x3c')],qs[_0x1878('0x41')](_0x1efcef[_0x1878('0x3e')]['fields']));_0xd589dc[_0x1878('0x40')]=_0xd589dc['attributes'][_0x1878('0x42')]?_0xd589dc['attributes']:_0x4086ea['model'];if(!_0x1efcef[_0x1878('0x3e')]['hasOwnProperty']('nolimit')){_0xd589dc[_0x1878('0x30')]=qs[_0x1878('0x30')](_0x1efcef[_0x1878('0x3e')][_0x1878('0x30')]);_0xd589dc[_0x1878('0x2e')]=qs[_0x1878('0x2e')](_0x1efcef[_0x1878('0x3e')]['offset']);}_0xd589dc['order']=qs['sort'](_0x1efcef[_0x1878('0x3e')]['sort']);_0xd589dc[_0x1878('0x43')]=qs[_0x1878('0x44')](_[_0x1878('0x45')](_0x1efcef['query'],_0x4086ea[_0x1878('0x44')]),_0xd3f20b);if(_0x1efcef[_0x1878('0x3e')][_0x1878('0x46')]){_0xd589dc[_0x1878('0x43')]=_[_0x1878('0x47')](_0xd589dc['where'],{'$or':_['map'](_0xd3f20b,function(_0x8fdad7){if(_0x8fdad7[_0x1878('0x3a')]!==_0x1878('0x48')){var _0x11ac48={};_0x11ac48[_0x8fdad7[_0x1878('0x37')]]={'$like':'%'+_0x1efcef['query'][_0x1878('0x46')]+'%'};return _0x11ac48;}})});}_0xd589dc=_[_0x1878('0x47')]({},_0xd589dc,_0x1efcef[_0x1878('0x49')]);var _0x137105={'where':_0xd589dc['where']};return db[_0x1878('0x4a')][_0x1878('0x31')](_0x137105)[_0x1878('0x1f')](function(_0x75539b){_0x592cfc[_0x1878('0x31')]=_0x75539b;if(_0x1efcef[_0x1878('0x3e')][_0x1878('0x4b')]){_0xd589dc[_0x1878('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x1878('0x4d')](_0xd589dc);})[_0x1878('0x1f')](function(_0x503e7a){_0x592cfc[_0x1878('0x4e')]=_0x503e7a;return _0x592cfc;})[_0x1878('0x1f')](respondWithFilteredResult(_0x5f4d0e,_0xd589dc))[_0x1878('0x29')](handleError(_0x5f4d0e,null));};exports[_0x1878('0x4f')]=function(_0x1f7c97,_0x56441e){var _0x2e9bee={'raw':![],'where':{'id':_0x1f7c97[_0x1878('0x50')]['id']}},_0x4f2ac1={};_0x4f2ac1[_0x1878('0x3c')]=_[_0x1878('0x3f')](db[_0x1878('0x4a')][_0x1878('0x39')]);_0x4f2ac1[_0x1878('0x3e')]=_[_0x1878('0x3f')](_0x1f7c97[_0x1878('0x3e')]);_0x4f2ac1[_0x1878('0x44')]=_[_0x1878('0x51')](_0x4f2ac1[_0x1878('0x3c')],_0x4f2ac1[_0x1878('0x3e')]);_0x2e9bee['attributes']=_[_0x1878('0x51')](_0x4f2ac1[_0x1878('0x3c')],qs[_0x1878('0x41')](_0x1f7c97[_0x1878('0x3e')][_0x1878('0x41')]));_0x2e9bee[_0x1878('0x40')]=_0x2e9bee[_0x1878('0x40')][_0x1878('0x42')]?_0x2e9bee[_0x1878('0x40')]:_0x4f2ac1[_0x1878('0x3c')];if(_0x1f7c97[_0x1878('0x3e')][_0x1878('0x4b')]){_0x2e9bee[_0x1878('0x4c')]=[{'all':!![]}];}_0x2e9bee=_[_0x1878('0x47')]({},_0x2e9bee,_0x1f7c97['options']);return db[_0x1878('0x4a')][_0x1878('0x52')](_0x2e9bee)['then'](handleEntityNotFound(_0x56441e,null))[_0x1878('0x1f')](respondWithResult(_0x56441e,null))[_0x1878('0x29')](handleError(_0x56441e,null));};exports['update']=function(_0x268cc4,_0x122922){if(_0x268cc4['body']['id']){delete _0x268cc4['body']['id'];}return db['Setting']['find']({'where':{'id':_0x268cc4['params']['id']}})[_0x1878('0x1f')](handleEntityNotFound(_0x122922,null))[_0x1878('0x1f')](saveUpdates(_0x268cc4[_0x1878('0x53')],null))[_0x1878('0x1f')](respondWithResult(_0x122922,null))[_0x1878('0x29')](handleError(_0x122922,null));};exports[_0x1878('0x54')]=function(_0x460074,_0x5a3614,_0x2f07e3){if(_0x460074[_0x1878('0x55')]&&_0x460074[_0x1878('0x55')][_0x1878('0x56')]){_0x460074[_0x1878('0x53')]['logo']=_0x460074[_0x1878('0x55')][_0x1878('0x56')];}return db['Setting'][_0x1878('0x52')]({'where':{'id':_0x460074[_0x1878('0x50')]['id']}})[_0x1878('0x1f')](handleEntityNotFound(_0x5a3614,null))[_0x1878('0x1f')](saveUpdates(_0x460074[_0x1878('0x53')],null))[_0x1878('0x1f')](respondWithResult(_0x5a3614,null))['catch'](handleError(_0x5a3614,null));};exports[_0x1878('0x57')]=function(_0x4a7982,_0x4abb7a,_0x2d2d83){if(_0x4a7982[_0x1878('0x55')]&&_0x4a7982[_0x1878('0x55')][_0x1878('0x56')]){_0x4a7982[_0x1878('0x53')][_0x1878('0x58')]=_0x4a7982[_0x1878('0x55')][_0x1878('0x56')];}return db['Setting']['find']({'where':{'id':_0x4a7982['params']['id']}})[_0x1878('0x1f')](handleEntityNotFound(_0x4abb7a,null))[_0x1878('0x1f')](saveUpdates(_0x4a7982[_0x1878('0x53')],null))['then'](respondWithResult(_0x4abb7a,null))['catch'](handleError(_0x4abb7a,null));};var utilLicense=require(_0x1878('0x59'));exports['getLogo']=function(_0x5e0b87,_0x32cced,_0x544eba){var _0x5e0afb=_0x1878('0x5a');var _0x5c343b={'custom':![]};return utilLicense['getLicense']()[_0x1878('0x1f')](function(_0x4aaa2a){if(_0x4aaa2a){_0x5c343b=_0x4aaa2a;}return db[_0x1878('0x4a')][_0x1878('0x52')]({'where':{'id':_0x5e0b87['params']['id']},'attributes':[_0x1878('0x5b'),_0x1878('0x58'),_0x1878('0x5c'),_0x1878('0x5d'),_0x1878('0x5e'),_0x1878('0x5f'),_0x1878('0x60'),_0x1878('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x32cced,null))[_0x1878('0x1f')](function(_0x54af42){if(_0x54af42){var _0x15f18f=_0x54af42[_0x1878('0x5b')]&&fs[_0x1878('0x62')](path[_0x1878('0x63')](config[_0x1878('0x64')],_0x5e0afb,_['toLower'](_0x54af42[_0x1878('0x5b')])))?path['join'](config[_0x1878('0x64')],_0x5e0afb,_['toLower'](_0x54af42[_0x1878('0x5b')])):path[_0x1878('0x63')](config['root'],_0x5e0afb,_[_0x1878('0x65')](_0x1878('0x66')));var _0x35f798=_0x1878('0x67')+_['upperFirst'](_0x1878('0x5b'));if(_0x54af42[_0x35f798]||!_0x5c343b[_0x1878('0x68')]){_0x15f18f=path[_0x1878('0x63')](config[_0x1878('0x64')],_0x5e0afb,_[_0x1878('0x65')]('default_logo.svg'));}if(!fs[_0x1878('0x62')](_0x15f18f)){throw new db[(_0x1878('0x69'))]['ValidationError'](_['upperFirst'](_0x1878('0x5b'))+'\x20not\x20found');}return _0x32cced[_0x1878('0x6a')](_0x15f18f);}})[_0x1878('0x29')](handleError(_0x32cced,null));};var utilLicense=require(_0x1878('0x59'));exports[_0x1878('0x6b')]=function(_0x30579b,_0x457c3e,_0x10ed19){var _0x298f8e=_0x1878('0x5a');var _0x71fbbf={'custom':![]};return utilLicense[_0x1878('0x6c')]()[_0x1878('0x1f')](function(_0x17841b){if(_0x17841b){_0x71fbbf=_0x17841b;}return db[_0x1878('0x4a')]['find']({'where':{'id':_0x30579b[_0x1878('0x50')]['id']},'attributes':[_0x1878('0x5b'),'loginLogo',_0x1878('0x5c'),_0x1878('0x5d'),'defaultLogo',_0x1878('0x5f'),_0x1878('0x60'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x457c3e,null))[_0x1878('0x1f')](function(_0x36d8b3){if(_0x36d8b3){var _0x59f930=_0x36d8b3[_0x1878('0x58')]&&fs[_0x1878('0x62')](path['join'](config[_0x1878('0x64')],_0x298f8e,_[_0x1878('0x65')](_0x36d8b3[_0x1878('0x58')])))?path[_0x1878('0x63')](config['root'],_0x298f8e,_[_0x1878('0x65')](_0x36d8b3[_0x1878('0x58')])):path[_0x1878('0x63')](config['root'],_0x298f8e,_[_0x1878('0x65')]('default_loginLogo.svg'));var _0x2e45cd=_0x1878('0x67')+_[_0x1878('0x6d')](_0x1878('0x58'));if(_0x36d8b3[_0x2e45cd]||!_0x71fbbf[_0x1878('0x68')]){_0x59f930=path[_0x1878('0x63')](config[_0x1878('0x64')],_0x298f8e,_[_0x1878('0x65')](_0x1878('0x6e')));}if(!fs[_0x1878('0x62')](_0x59f930)){throw new db[(_0x1878('0x69'))][(_0x1878('0x6f'))](_[_0x1878('0x6d')](_0x1878('0x58'))+'\x20not\x20found');}return _0x457c3e[_0x1878('0x6a')](_0x59f930);}})['catch'](handleError(_0x457c3e,null));};exports[_0x1878('0x70')]=function(_0x57ee43,_0xbf4574){return db[_0x1878('0x4a')][_0x1878('0x52')]({'where':{'id':_0x57ee43[_0x1878('0x50')]['id']},'attributes':[_0x1878('0x71')]})[_0x1878('0x1f')](respondWithResult(_0xbf4574,null))[_0x1878('0x29')](handleError(_0xbf4574,null));};exports['addPreferred']=function(_0x7b00c9,_0x29b4ab,_0x3173d3){if(_0x7b00c9['file']&&_0x7b00c9[_0x1878('0x55')][_0x1878('0x56')]){_0x7b00c9[_0x1878('0x53')][_0x1878('0x5c')]=_0x7b00c9['file']['filename'];}return db[_0x1878('0x4a')][_0x1878('0x52')]({'where':{'id':_0x7b00c9['params']['id']}})[_0x1878('0x1f')](handleEntityNotFound(_0x29b4ab,null))[_0x1878('0x1f')](saveUpdates(_0x7b00c9[_0x1878('0x53')],null))['then'](respondWithResult(_0x29b4ab,null))['catch'](handleError(_0x29b4ab,null));};var utilLicense=require(_0x1878('0x59'));exports[_0x1878('0x72')]=function(_0x3c5003,_0x50648a,_0x5bcc00){var _0xd98877='server/files/images/logos';var _0x7c0533={'custom':![]};return utilLicense[_0x1878('0x6c')]()[_0x1878('0x1f')](function(_0x295fc7){if(_0x295fc7){_0x7c0533=_0x295fc7;}return db[_0x1878('0x4a')][_0x1878('0x52')]({'where':{'id':_0x3c5003[_0x1878('0x50')]['id']},'attributes':[_0x1878('0x5b'),_0x1878('0x58'),'preferred',_0x1878('0x5d'),'defaultLogo',_0x1878('0x5f'),'defaultPreferred',_0x1878('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x50648a,null))['then'](function(_0x284be3){if(_0x284be3){var _0x2a525b=_0x284be3[_0x1878('0x5c')]&&fs[_0x1878('0x62')](path['join'](config[_0x1878('0x64')],_0xd98877,_['toLower'](_0x284be3[_0x1878('0x5c')])))?path[_0x1878('0x63')](config['root'],_0xd98877,_[_0x1878('0x65')](_0x284be3['preferred'])):path['join'](config['root'],_0xd98877,_[_0x1878('0x65')](_0x1878('0x73')));var _0x59fabb=_0x1878('0x67')+_[_0x1878('0x6d')](_0x1878('0x5c'));if(_0x284be3[_0x59fabb]||!_0x7c0533['custom']||!_0x7c0533[_0x1878('0x5c')]){_0x2a525b=path[_0x1878('0x63')](config[_0x1878('0x64')],_0xd98877,_[_0x1878('0x65')](_0x1878('0x73')));}if(!fs[_0x1878('0x62')](_0x2a525b)){throw new db['Sequelize'][(_0x1878('0x6f'))](_[_0x1878('0x6d')](_0x1878('0x5c'))+_0x1878('0x74'));}return _0x50648a[_0x1878('0x6a')](_0x2a525b);}})[_0x1878('0x29')](handleError(_0x50648a,null));};exports[_0x1878('0x75')]=function(_0xf06624,_0x25afbd,_0x159004){if(_0xf06624[_0x1878('0x55')]&&_0xf06624[_0x1878('0x55')][_0x1878('0x56')]){_0xf06624[_0x1878('0x53')]['favicon']=_0xf06624['file'][_0x1878('0x56')];}return db[_0x1878('0x4a')][_0x1878('0x52')]({'where':{'id':_0xf06624[_0x1878('0x50')]['id']}})[_0x1878('0x1f')](handleEntityNotFound(_0x25afbd,null))['then'](saveUpdates(_0xf06624[_0x1878('0x53')],null))[_0x1878('0x1f')](respondWithResult(_0x25afbd,null))[_0x1878('0x29')](handleError(_0x25afbd,null));};var utilLicense=require('../../config/license/util');exports[_0x1878('0x76')]=function(_0x3e87fb,_0xec04d5,_0x1beef3){var _0xbf0169=_0x1878('0x5a');var _0x47e793={'custom':![]};return utilLicense[_0x1878('0x6c')]()[_0x1878('0x1f')](function(_0x34cd45){if(_0x34cd45){_0x47e793=_0x34cd45;}return db[_0x1878('0x4a')][_0x1878('0x52')]({'where':{'id':_0x3e87fb['params']['id']},'attributes':[_0x1878('0x5b'),'loginLogo',_0x1878('0x5c'),'favicon','defaultLogo',_0x1878('0x5f'),_0x1878('0x60'),_0x1878('0x61')],'raw':!![]});})[_0x1878('0x1f')](handleEntityNotFound(_0xec04d5,null))[_0x1878('0x1f')](function(_0x394c09){if(_0x394c09){var _0x4171cf=_0x394c09['favicon']&&fs[_0x1878('0x62')](path[_0x1878('0x63')](config[_0x1878('0x64')],_0xbf0169,_[_0x1878('0x65')](_0x394c09['favicon'])))?path[_0x1878('0x63')](config[_0x1878('0x64')],_0xbf0169,_['toLower'](_0x394c09[_0x1878('0x5d')])):path[_0x1878('0x63')](config[_0x1878('0x64')],_0xbf0169,_['toLower'](_0x1878('0x77')));var _0x589087=_0x1878('0x67')+_['upperFirst'](_0x1878('0x5d'));if(_0x394c09[_0x589087]||!_0x47e793[_0x1878('0x68')]){_0x4171cf=path['join'](config[_0x1878('0x64')],_0xbf0169,_[_0x1878('0x65')](_0x1878('0x77')));}if(!fs[_0x1878('0x62')](_0x4171cf)){throw new db[(_0x1878('0x69'))][(_0x1878('0x6f'))](_[_0x1878('0x6d')](_0x1878('0x5d'))+_0x1878('0x74'));}return _0xec04d5[_0x1878('0x6a')](_0x4171cf);}})[_0x1878('0x29')](handleError(_0xec04d5,null));};exports[_0x1878('0x78')]=function(_0x312840,_0x5d5dea){var _0x43ed64={'offset':moment()[_0x1878('0x79')]()};_0x43ed64[_0x1878('0x7a')]=moment()['utcOffset'](_0x43ed64[_0x1878('0x2e')])['format'](_0x1878('0x7b'));return _0x5d5dea[_0x1878('0x2b')](0xc8)['send'](_0x43ed64);}; \ No newline at end of file +var _0xaaea=['gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','defaultLogo','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Setting','include','findAll','rows','show','params','keys','includeAll','find','body','file','logo','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','defaultLoginLogo','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','preferred','favicon','defaultPreferred','default_loginLogo.svg','download'];(function(_0x54b34a,_0x2d34c3){var _0x1633cc=function(_0x580da2){while(--_0x580da2){_0x54b34a['push'](_0x54b34a['shift']());}};_0x1633cc(++_0x2d34c3);}(_0xaaea,0x183));var _0xaaae=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xaaea[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaae('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaaae('0x1'));var rp=require(_0xaaae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaaae('0x3'));var util=require(_0xaaae('0x4'));var path=require(_0xaaae('0x5'));var sox=require(_0xaaae('0x6'));var csv=require('to-csv');var ejs=require(_0xaaae('0x7'));var fs=require('fs');var fs_extra=require(_0xaaae('0x8'));var _=require(_0xaaae('0x9'));var squel=require(_0xaaae('0xa'));var crypto=require('crypto');var jsforce=require(_0xaaae('0xb'));var deskjs=require(_0xaaae('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaaae('0xd'));var Papa=require(_0xaaae('0xe'));var Redis=require('ioredis');var authService=require(_0xaaae('0xf'));var qs=require(_0xaaae('0x10'));var as=require(_0xaaae('0x11'));var hardwareService=require(_0xaaae('0x12'));var logger=require(_0xaaae('0x13'))(_0xaaae('0x14'));var utils=require(_0xaaae('0x15'));var config=require(_0xaaae('0x16'));var licenseUtil=require(_0xaaae('0x17'));var db=require(_0xaaae('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xaaae('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33be02,_0x1e2938,_0x422da2,_0x199db9){return new BPromise(function(_0xdc69e3,_0x498e85){var _0x4fc6aa=_0x199db9||client;return _0x4fc6aa['request'](_0x33be02,_0x422da2)['then'](function(_0x389218){logger[_0xaaae('0x1a')](_0xaaae('0x1b'),_0x1e2938,_0xaaae('0x1c'));logger[_0xaaae('0x1d')](_0xaaae('0x1e'),_0x1e2938,_0xaaae('0x1c'),JSON[_0xaaae('0x1f')](_0x389218));if(_0x389218['error']){if(_0x389218[_0xaaae('0x20')][_0xaaae('0x21')]===0x1f4){logger['error'](_0xaaae('0x1b'),_0x1e2938,_0x389218[_0xaaae('0x20')][_0xaaae('0x22')]);return _0x498e85(_0x389218[_0xaaae('0x20')][_0xaaae('0x22')]);}logger['error'](_0xaaae('0x1b'),_0x1e2938,_0x389218['error'][_0xaaae('0x22')]);return _0xdc69e3(_0x389218['error'][_0xaaae('0x22')]);}else{logger[_0xaaae('0x1a')]('Setting,\x20%s,\x20%s',_0x1e2938,'request\x20sent');_0xdc69e3(_0x389218[_0xaaae('0x23')]['message']);}})[_0xaaae('0x24')](function(_0x37ab2e){logger[_0xaaae('0x20')](_0xaaae('0x1b'),_0x1e2938,_0x37ab2e);_0x498e85(_0x37ab2e);});});}function respondWithStatusCode(_0x12c86f,_0x10b126){_0x10b126=_0x10b126||0xcc;return function(_0x2f1360){if(_0x2f1360){return _0x12c86f[_0xaaae('0x25')](_0x10b126);}return _0x12c86f['status'](_0x10b126)[_0xaaae('0x26')]();};}function respondWithResult(_0x476f8c,_0x3fcf65){_0x3fcf65=_0x3fcf65||0xc8;return function(_0x24a448){if(_0x24a448){return _0x476f8c[_0xaaae('0x27')](_0x3fcf65)[_0xaaae('0x28')](_0x24a448);}};}function respondWithFilteredResult(_0x3e266d,_0x407de8){return function(_0x11ff12){if(_0x11ff12){var _0xbe3e28=typeof _0x407de8[_0xaaae('0x29')]===_0xaaae('0x2a')&&typeof _0x407de8[_0xaaae('0x2b')]===_0xaaae('0x2a');var _0x526bff=_0x11ff12[_0xaaae('0x2c')];var _0x3c9da1=_0xbe3e28?0x0:_0x407de8[_0xaaae('0x29')];var _0x43776a=_0xbe3e28?_0x11ff12['count']:_0x407de8[_0xaaae('0x29')]+_0x407de8['limit'];var _0x3e94e8;if(_0x43776a>=_0x526bff){_0x43776a=_0x526bff;_0x3e94e8=0xc8;}else{_0x3e94e8=0xce;}_0x3e266d['status'](_0x3e94e8);return _0x3e266d[_0xaaae('0x2d')]('Content-Range',_0x3c9da1+'-'+_0x43776a+'/'+_0x526bff)[_0xaaae('0x28')](_0x11ff12);}return null;};}function patchUpdates(_0x1a2e04){return function(_0x39ab24){try{jsonpatch[_0xaaae('0x2e')](_0x39ab24,_0x1a2e04,!![]);}catch(_0xfd473){return BPromise[_0xaaae('0x2f')](_0xfd473);}return _0x39ab24[_0xaaae('0x30')]();};}function saveUpdates(_0x30f9da,_0x4c9717){return function(_0x19d568){if(_0x19d568){return _0x19d568[_0xaaae('0x31')](_0x30f9da)[_0xaaae('0x32')](function(_0x5da746){return _0x5da746;});}return null;};}function removeEntity(_0x317f1d,_0x171d17){return function(_0x238f01){if(_0x238f01){return _0x238f01['destroy']()[_0xaaae('0x32')](function(){_0x317f1d['status'](0xcc)[_0xaaae('0x26')]();});}};}function handleEntityNotFound(_0x5f4b61,_0x3e0ae9){return function(_0x565500){if(!_0x565500){_0x5f4b61[_0xaaae('0x25')](0x194);}return _0x565500;};}function handleError(_0x550889,_0x46dc27){_0x46dc27=_0x46dc27||0x1f4;return function(_0x71c1a6){logger[_0xaaae('0x20')](_0x71c1a6[_0xaaae('0x33')]);if(_0x71c1a6[_0xaaae('0x34')]){delete _0x71c1a6[_0xaaae('0x34')];}_0x550889['status'](_0x46dc27)[_0xaaae('0x35')](_0x71c1a6);};}exports[_0xaaae('0x36')]=function(_0x24cfb8,_0x5dfe3f){var _0x1789c7={},_0x372efc={},_0xeb8b={'count':0x0,'rows':[]};var _0x39c6f6=_[_0xaaae('0x37')](db['Setting'][_0xaaae('0x38')],function(_0x4b0e0f){return{'name':_0x4b0e0f[_0xaaae('0x39')],'type':_0x4b0e0f[_0xaaae('0x3a')][_0xaaae('0x3b')]};});_0x372efc[_0xaaae('0x3c')]=_[_0xaaae('0x37')](_0x39c6f6,_0xaaae('0x34'));_0x372efc['query']=_['keys'](_0x24cfb8[_0xaaae('0x3d')]);_0x372efc[_0xaaae('0x3e')]=_[_0xaaae('0x3f')](_0x372efc[_0xaaae('0x3c')],_0x372efc['query']);_0x1789c7['attributes']=_['intersection'](_0x372efc['model'],qs[_0xaaae('0x40')](_0x24cfb8[_0xaaae('0x3d')][_0xaaae('0x40')]));_0x1789c7['attributes']=_0x1789c7['attributes'][_0xaaae('0x41')]?_0x1789c7[_0xaaae('0x42')]:_0x372efc[_0xaaae('0x3c')];if(!_0x24cfb8['query'][_0xaaae('0x43')](_0xaaae('0x44'))){_0x1789c7[_0xaaae('0x2b')]=qs[_0xaaae('0x2b')](_0x24cfb8[_0xaaae('0x3d')][_0xaaae('0x2b')]);_0x1789c7[_0xaaae('0x29')]=qs[_0xaaae('0x29')](_0x24cfb8[_0xaaae('0x3d')][_0xaaae('0x29')]);}_0x1789c7[_0xaaae('0x45')]=qs['sort'](_0x24cfb8['query'][_0xaaae('0x46')]);_0x1789c7[_0xaaae('0x47')]=qs[_0xaaae('0x3e')](_['pick'](_0x24cfb8[_0xaaae('0x3d')],_0x372efc[_0xaaae('0x3e')]),_0x39c6f6);if(_0x24cfb8['query'][_0xaaae('0x48')]){_0x1789c7[_0xaaae('0x47')]=_[_0xaaae('0x49')](_0x1789c7[_0xaaae('0x47')],{'$or':_['map'](_0x39c6f6,function(_0x5cb7e2){if(_0x5cb7e2['type']!==_0xaaae('0x4a')){var _0x1b9c8a={};_0x1b9c8a[_0x5cb7e2['name']]={'$like':'%'+_0x24cfb8[_0xaaae('0x3d')][_0xaaae('0x48')]+'%'};return _0x1b9c8a;}})});}_0x1789c7=_[_0xaaae('0x49')]({},_0x1789c7,_0x24cfb8[_0xaaae('0x4b')]);var _0x492fb3={'where':_0x1789c7[_0xaaae('0x47')]};return db[_0xaaae('0x4c')][_0xaaae('0x2c')](_0x492fb3)[_0xaaae('0x32')](function(_0x468b4d){_0xeb8b[_0xaaae('0x2c')]=_0x468b4d;if(_0x24cfb8['query']['includeAll']){_0x1789c7[_0xaaae('0x4d')]=[{'all':!![]}];}return db[_0xaaae('0x4c')][_0xaaae('0x4e')](_0x1789c7);})[_0xaaae('0x32')](function(_0x54fcb4){_0xeb8b[_0xaaae('0x4f')]=_0x54fcb4;return _0xeb8b;})[_0xaaae('0x32')](respondWithFilteredResult(_0x5dfe3f,_0x1789c7))[_0xaaae('0x24')](handleError(_0x5dfe3f,null));};exports[_0xaaae('0x50')]=function(_0x3e21aa,_0x336d72){var _0x38ad6d={'raw':![],'where':{'id':_0x3e21aa[_0xaaae('0x51')]['id']}},_0x1d2c5f={};_0x1d2c5f[_0xaaae('0x3c')]=_[_0xaaae('0x52')](db[_0xaaae('0x4c')][_0xaaae('0x38')]);_0x1d2c5f[_0xaaae('0x3d')]=_[_0xaaae('0x52')](_0x3e21aa['query']);_0x1d2c5f['filters']=_[_0xaaae('0x3f')](_0x1d2c5f[_0xaaae('0x3c')],_0x1d2c5f[_0xaaae('0x3d')]);_0x38ad6d[_0xaaae('0x42')]=_[_0xaaae('0x3f')](_0x1d2c5f[_0xaaae('0x3c')],qs[_0xaaae('0x40')](_0x3e21aa[_0xaaae('0x3d')][_0xaaae('0x40')]));_0x38ad6d['attributes']=_0x38ad6d[_0xaaae('0x42')][_0xaaae('0x41')]?_0x38ad6d[_0xaaae('0x42')]:_0x1d2c5f[_0xaaae('0x3c')];if(_0x3e21aa[_0xaaae('0x3d')][_0xaaae('0x53')]){_0x38ad6d[_0xaaae('0x4d')]=[{'all':!![]}];}_0x38ad6d=_[_0xaaae('0x49')]({},_0x38ad6d,_0x3e21aa['options']);return db[_0xaaae('0x4c')][_0xaaae('0x54')](_0x38ad6d)['then'](handleEntityNotFound(_0x336d72,null))[_0xaaae('0x32')](respondWithResult(_0x336d72,null))[_0xaaae('0x24')](handleError(_0x336d72,null));};exports['update']=function(_0x43267a,_0x20dee5){if(_0x43267a['body']['id']){delete _0x43267a['body']['id'];}return db[_0xaaae('0x4c')][_0xaaae('0x54')]({'where':{'id':_0x43267a[_0xaaae('0x51')]['id']}})[_0xaaae('0x32')](handleEntityNotFound(_0x20dee5,null))[_0xaaae('0x32')](saveUpdates(_0x43267a[_0xaaae('0x55')],null))[_0xaaae('0x32')](respondWithResult(_0x20dee5,null))[_0xaaae('0x24')](handleError(_0x20dee5,null));};exports['addLogo']=function(_0x177313,_0x49f3b3,_0x10e76b){if(_0x177313[_0xaaae('0x56')]&&_0x177313[_0xaaae('0x56')]['filename']){_0x177313[_0xaaae('0x55')][_0xaaae('0x57')]=_0x177313[_0xaaae('0x56')][_0xaaae('0x58')];}return db[_0xaaae('0x4c')][_0xaaae('0x54')]({'where':{'id':_0x177313[_0xaaae('0x51')]['id']}})['then'](handleEntityNotFound(_0x49f3b3,null))[_0xaaae('0x32')](saveUpdates(_0x177313[_0xaaae('0x55')],null))[_0xaaae('0x32')](respondWithResult(_0x49f3b3,null))[_0xaaae('0x24')](handleError(_0x49f3b3,null));};exports[_0xaaae('0x59')]=function(_0x28918a,_0x8571f4,_0x5d777b){if(_0x28918a[_0xaaae('0x56')]&&_0x28918a['file'][_0xaaae('0x58')]){_0x28918a['body']['loginLogo']=_0x28918a[_0xaaae('0x56')][_0xaaae('0x58')];}return db['Setting']['find']({'where':{'id':_0x28918a['params']['id']}})[_0xaaae('0x32')](handleEntityNotFound(_0x8571f4,null))[_0xaaae('0x32')](saveUpdates(_0x28918a[_0xaaae('0x55')],null))[_0xaaae('0x32')](respondWithResult(_0x8571f4,null))[_0xaaae('0x24')](handleError(_0x8571f4,null));};var utilLicense=require('../../config/license/util');exports[_0xaaae('0x5a')]=function(_0x21ca60,_0x3ce1bc,_0xce1f97){var _0x393d63=_0xaaae('0x5b');var _0x35a9ab={'custom':![]};return utilLicense[_0xaaae('0x5c')]()['then'](function(_0x50b555){if(_0x50b555){_0x35a9ab=_0x50b555;}return db[_0xaaae('0x4c')]['find']({'where':{'id':_0x21ca60[_0xaaae('0x51')]['id']},'attributes':[_0xaaae('0x57'),_0xaaae('0x5d'),'preferred','favicon','defaultLogo',_0xaaae('0x5e'),'defaultPreferred',_0xaaae('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x3ce1bc,null))['then'](function(_0x5cf9fa){if(_0x5cf9fa){var _0x1bb71e=_0x5cf9fa[_0xaaae('0x57')]&&fs[_0xaaae('0x60')](path[_0xaaae('0x61')](config['root'],_0x393d63,_[_0xaaae('0x62')](_0x5cf9fa['logo'])))?path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x393d63,_[_0xaaae('0x62')](_0x5cf9fa['logo'])):path['join'](config[_0xaaae('0x63')],_0x393d63,_[_0xaaae('0x62')](_0xaaae('0x64')));var _0x27d28c=_0xaaae('0x65')+_[_0xaaae('0x66')](_0xaaae('0x57'));if(_0x5cf9fa[_0x27d28c]||!_0x35a9ab[_0xaaae('0x67')]){_0x1bb71e=path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x393d63,_['toLower'](_0xaaae('0x64')));}if(!fs[_0xaaae('0x60')](_0x1bb71e)){throw new db[(_0xaaae('0x68'))][(_0xaaae('0x69'))](_[_0xaaae('0x66')]('logo')+_0xaaae('0x6a'));}return _0x3ce1bc['download'](_0x1bb71e);}})[_0xaaae('0x24')](handleError(_0x3ce1bc,null));};var utilLicense=require(_0xaaae('0x17'));exports[_0xaaae('0x6b')]=function(_0x33e0c6,_0x238859,_0x41bef1){var _0x277ecb=_0xaaae('0x5b');var _0x16ca51={'custom':![]};return utilLicense[_0xaaae('0x5c')]()['then'](function(_0x3acd04){if(_0x3acd04){_0x16ca51=_0x3acd04;}return db[_0xaaae('0x4c')]['find']({'where':{'id':_0x33e0c6[_0xaaae('0x51')]['id']},'attributes':[_0xaaae('0x57'),_0xaaae('0x5d'),_0xaaae('0x6c'),_0xaaae('0x6d'),'defaultLogo','defaultLoginLogo',_0xaaae('0x6e'),_0xaaae('0x5f')],'raw':!![]});})[_0xaaae('0x32')](handleEntityNotFound(_0x238859,null))['then'](function(_0x20b027){if(_0x20b027){var _0x4721ec=_0x20b027[_0xaaae('0x5d')]&&fs[_0xaaae('0x60')](path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x277ecb,_[_0xaaae('0x62')](_0x20b027[_0xaaae('0x5d')])))?path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x277ecb,_[_0xaaae('0x62')](_0x20b027[_0xaaae('0x5d')])):path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x277ecb,_['toLower'](_0xaaae('0x6f')));var _0xd7fa02=_0xaaae('0x65')+_['upperFirst'](_0xaaae('0x5d'));if(_0x20b027[_0xd7fa02]||!_0x16ca51[_0xaaae('0x67')]){_0x4721ec=path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x277ecb,_[_0xaaae('0x62')](_0xaaae('0x6f')));}if(!fs[_0xaaae('0x60')](_0x4721ec)){throw new db[(_0xaaae('0x68'))][(_0xaaae('0x69'))](_[_0xaaae('0x66')](_0xaaae('0x5d'))+_0xaaae('0x6a'));}return _0x238859[_0xaaae('0x70')](_0x4721ec);}})['catch'](handleError(_0x238859,null));};exports[_0xaaae('0x71')]=function(_0x1d99e9,_0x47a684){return db[_0xaaae('0x4c')][_0xaaae('0x54')]({'where':{'id':_0x1d99e9[_0xaaae('0x51')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x47a684,null))[_0xaaae('0x24')](handleError(_0x47a684,null));};exports[_0xaaae('0x72')]=function(_0x2efab4,_0x4bd14b,_0x2f7fcb){if(_0x2efab4[_0xaaae('0x56')]&&_0x2efab4[_0xaaae('0x56')][_0xaaae('0x58')]){_0x2efab4['body'][_0xaaae('0x6c')]=_0x2efab4[_0xaaae('0x56')][_0xaaae('0x58')];}return db[_0xaaae('0x4c')][_0xaaae('0x54')]({'where':{'id':_0x2efab4[_0xaaae('0x51')]['id']}})['then'](handleEntityNotFound(_0x4bd14b,null))['then'](saveUpdates(_0x2efab4[_0xaaae('0x55')],null))['then'](respondWithResult(_0x4bd14b,null))[_0xaaae('0x24')](handleError(_0x4bd14b,null));};var utilLicense=require(_0xaaae('0x17'));exports[_0xaaae('0x73')]=function(_0x41ba44,_0x39d07c,_0x196b36){var _0x1517f2='server/files/images/logos';var _0x32f7f0={'custom':![]};return utilLicense[_0xaaae('0x5c')]()[_0xaaae('0x32')](function(_0x24afd3){if(_0x24afd3){_0x32f7f0=_0x24afd3;}return db[_0xaaae('0x4c')][_0xaaae('0x54')]({'where':{'id':_0x41ba44[_0xaaae('0x51')]['id']},'attributes':[_0xaaae('0x57'),_0xaaae('0x5d'),_0xaaae('0x6c'),'favicon','defaultLogo',_0xaaae('0x5e'),_0xaaae('0x6e'),_0xaaae('0x5f')],'raw':!![]});})[_0xaaae('0x32')](handleEntityNotFound(_0x39d07c,null))[_0xaaae('0x32')](function(_0xea492){if(_0xea492){var _0x15da00=_0xea492[_0xaaae('0x6c')]&&fs[_0xaaae('0x60')](path['join'](config['root'],_0x1517f2,_[_0xaaae('0x62')](_0xea492[_0xaaae('0x6c')])))?path['join'](config[_0xaaae('0x63')],_0x1517f2,_[_0xaaae('0x62')](_0xea492['preferred'])):path[_0xaaae('0x61')](config['root'],_0x1517f2,_[_0xaaae('0x62')](_0xaaae('0x74')));var _0x2a3b2c=_0xaaae('0x65')+_[_0xaaae('0x66')](_0xaaae('0x6c'));if(_0xea492[_0x2a3b2c]||!_0x32f7f0[_0xaaae('0x67')]||!_0x32f7f0[_0xaaae('0x6c')]){_0x15da00=path['join'](config['root'],_0x1517f2,_[_0xaaae('0x62')]('default_preferred.png'));}if(!fs[_0xaaae('0x60')](_0x15da00)){throw new db[(_0xaaae('0x68'))][(_0xaaae('0x69'))](_[_0xaaae('0x66')]('preferred')+_0xaaae('0x6a'));}return _0x39d07c[_0xaaae('0x70')](_0x15da00);}})[_0xaaae('0x24')](handleError(_0x39d07c,null));};exports[_0xaaae('0x75')]=function(_0x5c4684,_0x315182,_0x14b5fc){if(_0x5c4684[_0xaaae('0x56')]&&_0x5c4684[_0xaaae('0x56')][_0xaaae('0x58')]){_0x5c4684[_0xaaae('0x55')][_0xaaae('0x6d')]=_0x5c4684['file'][_0xaaae('0x58')];}return db[_0xaaae('0x4c')][_0xaaae('0x54')]({'where':{'id':_0x5c4684[_0xaaae('0x51')]['id']}})[_0xaaae('0x32')](handleEntityNotFound(_0x315182,null))[_0xaaae('0x32')](saveUpdates(_0x5c4684[_0xaaae('0x55')],null))[_0xaaae('0x32')](respondWithResult(_0x315182,null))['catch'](handleError(_0x315182,null));};var utilLicense=require('../../config/license/util');exports[_0xaaae('0x76')]=function(_0x396204,_0x966338,_0x489388){var _0x3ba047=_0xaaae('0x5b');var _0x6dc4ee={'custom':![]};return utilLicense[_0xaaae('0x5c')]()['then'](function(_0x5ad99c){if(_0x5ad99c){_0x6dc4ee=_0x5ad99c;}return db['Setting'][_0xaaae('0x54')]({'where':{'id':_0x396204[_0xaaae('0x51')]['id']},'attributes':['logo',_0xaaae('0x5d'),_0xaaae('0x6c'),_0xaaae('0x6d'),_0xaaae('0x77'),_0xaaae('0x5e'),_0xaaae('0x6e'),_0xaaae('0x5f')],'raw':!![]});})[_0xaaae('0x32')](handleEntityNotFound(_0x966338,null))['then'](function(_0xd21d03){if(_0xd21d03){var _0x2ff5f4=_0xd21d03[_0xaaae('0x6d')]&&fs[_0xaaae('0x60')](path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x3ba047,_['toLower'](_0xd21d03[_0xaaae('0x6d')])))?path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x3ba047,_[_0xaaae('0x62')](_0xd21d03[_0xaaae('0x6d')])):path[_0xaaae('0x61')](config[_0xaaae('0x63')],_0x3ba047,_[_0xaaae('0x62')](_0xaaae('0x78')));var _0x3f5a50='default'+_[_0xaaae('0x66')](_0xaaae('0x6d'));if(_0xd21d03[_0x3f5a50]||!_0x6dc4ee[_0xaaae('0x67')]){_0x2ff5f4=path['join'](config['root'],_0x3ba047,_['toLower'](_0xaaae('0x78')));}if(!fs['existsSync'](_0x2ff5f4)){throw new db[(_0xaaae('0x68'))][(_0xaaae('0x69'))](_[_0xaaae('0x66')]('favicon')+_0xaaae('0x6a'));}return _0x966338[_0xaaae('0x70')](_0x2ff5f4);}})[_0xaaae('0x24')](handleError(_0x966338,null));};exports[_0xaaae('0x79')]=function(_0x2bf55a,_0xf96e76){var _0x18dd08={'offset':moment()['utcOffset']()};_0x18dd08[_0xaaae('0x7a')]=moment()[_0xaaae('0x7b')](_0x18dd08['offset'])['format'](_0xaaae('0x7c'));return _0xf96e76[_0xaaae('0x27')](0xc8)[_0xaaae('0x35')](_0x18dd08);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 9374a8f..24ed540 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x27b9c9,_0x394ac9){var _0x7c3ab4=function(_0x4fb3ab){while(--_0x4fb3ab){_0x27b9c9['push'](_0x27b9c9['shift']());}};_0x7c3ab4(++_0x394ac9);}(_0xe14b,0x93));var _0xbe14=function(_0x12bc78,_0x1e3216){_0x12bc78=_0x12bc78-0x0;var _0x361603=_0xe14b[_0x12bc78];return _0x361603;};'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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x55ca,0x126));var _0xa55c=function(_0x52a2be,_0x4bd252){_0x52a2be=_0x52a2be-0x0;var _0x246f1d=_0x55ca[_0x52a2be];return _0x246f1d;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index a3746d1..5996960 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 _0x53f1=['error','code','Setting,\x20%s,\x20%s','message','info','catch','ShowSetting','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c385b,_0x5b9005){var _0x4e5650=function(_0x587a36){while(--_0x587a36){_0x1c385b['push'](_0x1c385b['shift']());}};_0x4e5650(++_0x5b9005);}(_0x53f1,0x158));var _0x153f=function(_0x756a3a,_0x180d50){_0x756a3a=_0x756a3a-0x0;var _0x91be4=_0x53f1[_0x756a3a];return _0x91be4;};'use strict';var _=require(_0x153f('0x0'));var util=require('util');var moment=require(_0x153f('0x1'));var BPromise=require(_0x153f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x153f('0x3'));var db=require(_0x153f('0x4'))['db'];var utils=require(_0x153f('0x5'));var logger=require(_0x153f('0x6'))(_0x153f('0x7'));var config=require(_0x153f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x153f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4be82f,_0x363c7e,_0x11600f){return new BPromise(function(_0x5c727c,_0x52797d){return client[_0x153f('0xa')](_0x4be82f,_0x11600f)[_0x153f('0xb')](function(_0x2697e2){logger['info']('Setting,\x20%s,\x20%s',_0x363c7e,_0x153f('0xc'));logger[_0x153f('0xd')](_0x153f('0xe'),_0x363c7e,'request\x20sent',JSON[_0x153f('0xf')](_0x2697e2));if(_0x2697e2[_0x153f('0x10')]){if(_0x2697e2['error'][_0x153f('0x11')]===0x1f4){logger[_0x153f('0x10')](_0x153f('0x12'),_0x363c7e,_0x2697e2[_0x153f('0x10')][_0x153f('0x13')]);return _0x52797d(_0x2697e2['error']['message']);}logger[_0x153f('0x10')](_0x153f('0x12'),_0x363c7e,_0x2697e2[_0x153f('0x10')][_0x153f('0x13')]);return _0x5c727c(_0x2697e2[_0x153f('0x10')][_0x153f('0x13')]);}else{logger[_0x153f('0x14')]('Setting,\x20%s,\x20%s',_0x363c7e,_0x153f('0xc'));_0x5c727c(_0x2697e2['result'][_0x153f('0x13')]);}})[_0x153f('0x15')](function(_0x42a768){logger[_0x153f('0x10')](_0x153f('0x12'),_0x363c7e,_0x42a768);_0x52797d(_0x42a768);});});}exports[_0x153f('0x16')]=function(_0x44e01a){var _0x4d847b=this;return new Promise(function(_0x3b0360,_0x1a57b0){return db['Setting']['find']({'raw':_0x44e01a[_0x153f('0x17')]?_0x44e01a['options'][_0x153f('0x18')]===undefined?!![]:![]:!![],'where':_0x44e01a['options']?_0x44e01a[_0x153f('0x17')][_0x153f('0x19')]||null:null,'attributes':_0x44e01a[_0x153f('0x17')]?_0x44e01a[_0x153f('0x17')][_0x153f('0x1a')]||null:null,'include':_0x44e01a[_0x153f('0x17')]?_0x44e01a['options'][_0x153f('0x1b')]?_[_0x153f('0x1c')](_0x44e01a[_0x153f('0x17')][_0x153f('0x1b')],function(_0x55576b){return{'model':db[_0x55576b[_0x153f('0x1d')]],'as':_0x55576b['as'],'attributes':_0x55576b[_0x153f('0x1a')],'include':_0x55576b[_0x153f('0x1b')]?_[_0x153f('0x1c')](_0x55576b['include'],function(_0x5e7296){return{'model':db[_0x5e7296[_0x153f('0x1d')]],'as':_0x5e7296['as'],'attributes':_0x5e7296[_0x153f('0x1a')],'include':_0x5e7296[_0x153f('0x1b')]?_[_0x153f('0x1c')](_0x5e7296[_0x153f('0x1b')],function(_0x2c32ac){return{'model':db[_0x2c32ac[_0x153f('0x1d')]],'as':_0x2c32ac['as'],'attributes':_0x2c32ac['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42a234){logger[_0x153f('0x14')](_0x153f('0x16'),_0x44e01a);logger[_0x153f('0xd')](_0x153f('0x16'),_0x44e01a,JSON[_0x153f('0xf')](_0x42a234));_0x3b0360(_0x42a234);})[_0x153f('0x15')](function(_0x5b1813){logger[_0x153f('0x10')](_0x153f('0x16'),_0x5b1813[_0x153f('0x13')],_0x44e01a);_0x1a57b0(_0x4d847b[_0x153f('0x10')](0x1f4,_0x5b1813['message']));});});}; \ No newline at end of file +var _0x7f3d=['raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSetting','find','options'];(function(_0x43d701,_0x50e7a0){var _0x3d5b45=function(_0x51324e){while(--_0x51324e){_0x43d701['push'](_0x43d701['shift']());}};_0x3d5b45(++_0x50e7a0);}(_0x7f3d,0x7e));var _0xd7f3=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x7f3d[_0x680821];return _0x3f132c;};'use strict';var _=require(_0xd7f3('0x0'));var util=require(_0xd7f3('0x1'));var moment=require(_0xd7f3('0x2'));var BPromise=require(_0xd7f3('0x3'));var rs=require(_0xd7f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7f3('0x5'))['db'];var utils=require(_0xd7f3('0x6'));var logger=require(_0xd7f3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd7f3('0x8'));var client=jayson[_0xd7f3('0x9')][_0xd7f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359c9f,_0x15e5dd,_0x3afd06){return new BPromise(function(_0xad69da,_0x25e43b){return client['request'](_0x359c9f,_0x3afd06)[_0xd7f3('0xb')](function(_0x1e2605){logger[_0xd7f3('0xc')](_0xd7f3('0xd'),_0x15e5dd,_0xd7f3('0xe'));logger[_0xd7f3('0xf')](_0xd7f3('0x10'),_0x15e5dd,'request\x20sent',JSON[_0xd7f3('0x11')](_0x1e2605));if(_0x1e2605[_0xd7f3('0x12')]){if(_0x1e2605['error'][_0xd7f3('0x13')]===0x1f4){logger[_0xd7f3('0x12')](_0xd7f3('0xd'),_0x15e5dd,_0x1e2605[_0xd7f3('0x12')]['message']);return _0x25e43b(_0x1e2605[_0xd7f3('0x12')][_0xd7f3('0x14')]);}logger[_0xd7f3('0x12')](_0xd7f3('0xd'),_0x15e5dd,_0x1e2605[_0xd7f3('0x12')]['message']);return _0xad69da(_0x1e2605[_0xd7f3('0x12')][_0xd7f3('0x14')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x15e5dd,_0xd7f3('0xe'));_0xad69da(_0x1e2605['result'][_0xd7f3('0x14')]);}})['catch'](function(_0x2ec6b5){logger['error'](_0xd7f3('0xd'),_0x15e5dd,_0x2ec6b5);_0x25e43b(_0x2ec6b5);});});}exports[_0xd7f3('0x15')]=function(_0xc67717){var _0x2a78f2=this;return new Promise(function(_0x5cc7f2,_0x581bc6){return db['Setting'][_0xd7f3('0x16')]({'raw':_0xc67717['options']?_0xc67717[_0xd7f3('0x17')][_0xd7f3('0x18')]===undefined?!![]:![]:!![],'where':_0xc67717[_0xd7f3('0x17')]?_0xc67717[_0xd7f3('0x17')][_0xd7f3('0x19')]||null:null,'attributes':_0xc67717[_0xd7f3('0x17')]?_0xc67717['options'][_0xd7f3('0x1a')]||null:null,'include':_0xc67717[_0xd7f3('0x17')]?_0xc67717[_0xd7f3('0x17')][_0xd7f3('0x1b')]?_['map'](_0xc67717[_0xd7f3('0x17')][_0xd7f3('0x1b')],function(_0x218a24){return{'model':db[_0x218a24[_0xd7f3('0x1c')]],'as':_0x218a24['as'],'attributes':_0x218a24[_0xd7f3('0x1a')],'include':_0x218a24[_0xd7f3('0x1b')]?_[_0xd7f3('0x1d')](_0x218a24[_0xd7f3('0x1b')],function(_0x29a2e7){return{'model':db[_0x29a2e7['model']],'as':_0x29a2e7['as'],'attributes':_0x29a2e7[_0xd7f3('0x1a')],'include':_0x29a2e7['include']?_['map'](_0x29a2e7[_0xd7f3('0x1b')],function(_0x3dca23){return{'model':db[_0x3dca23[_0xd7f3('0x1c')]],'as':_0x3dca23['as'],'attributes':_0x3dca23[_0xd7f3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd7f3('0xb')](function(_0x46214b){logger[_0xd7f3('0xc')](_0xd7f3('0x15'),_0xc67717);logger['debug'](_0xd7f3('0x15'),_0xc67717,JSON[_0xd7f3('0x11')](_0x46214b));_0x5cc7f2(_0x46214b);})['catch'](function(_0x17154d){logger[_0xd7f3('0x12')]('ShowSetting',_0x17154d[_0xd7f3('0x14')],_0xc67717);_0x581bc6(_0x2a78f2[_0xd7f3('0x12')](0x1f4,_0x17154d[_0xd7f3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 52c7d55..96b3200 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 _0x55ca=['describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0x55ca,0x126));var _0xa55c=function(_0x4347cd,_0x562582){_0x4347cd=_0x4347cd-0x0;var _0x40c6d7=_0x55ca[_0x4347cd];return _0x40c6d7;};'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['getApplications']);router['get'](_0xa55c('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xa55c('0x12'),controller[_0xa55c('0x13')]);router[_0xa55c('0x7')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x17')](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);router[_0xa55c('0x17')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller['addAnswer']);router[_0xa55c('0x17')](_0xa55c('0x19'),controller[_0xa55c('0x1a')]);router[_0xa55c('0x17')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['addApplications']);router['post'](_0xa55c('0x1b'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1c')]);router['post'](_0xa55c('0x12'),controller[_0xa55c('0x1d')]);router['post'](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1e')]);router[_0xa55c('0x1f')](_0xa55c('0xb'),auth['isAuthenticated'](),controller[_0xa55c('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x21')]);router['delete'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x22')]);router[_0xa55c('0x23')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x24')]);router[_0xa55c('0x23')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x25')]);module['exports']=router; \ No newline at end of file +var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x3e35e9,_0x343705){var _0x5a9829=function(_0x590aa6){while(--_0x590aa6){_0x3e35e9['push'](_0x3e35e9['shift']());}};_0x5a9829(++_0x343705);}(_0x326f,0xd1));var _0xf326=function(_0x328583,_0x8db747){_0x328583=_0x328583-0x0;var _0x32c8eb=_0x326f[_0x328583];return _0x32c8eb;};'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',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index a68256c..aec2a2f 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 _0x87f3=['mandatoryDispositionPauseId','mandatoryDisposition','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x8e41a7,_0x5991d8){var _0x436126=function(_0x1e7dca){while(--_0x1e7dca){_0x8e41a7['push'](_0x8e41a7['shift']());}};_0x436126(++_0x5991d8);}(_0x87f3,0x95));var _0x387f=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x87f3[_0x1a72b8];return _0x39f72d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x387f('0x0'),'allowNull':![]},'key':{'type':Sequelize[_0x387f('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x387f('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x387f('0x1')],'defaultValue':function(){return rs[_0x387f('0x2')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x387f('0x3')](_0x387f('0x4'),_0x387f('0x5'),_0x387f('0x6'),_0x387f('0x7'),_0x387f('0x8'),_0x387f('0x9'),_0x387f('0xa'),'csc',_0x387f('0xb'),_0x387f('0xc'))},'accountSid':{'type':Sequelize[_0x387f('0x1')]},'authId':{'type':Sequelize[_0x387f('0x1')]},'authToken':{'type':Sequelize[_0x387f('0x1')]},'smsMethod':{'type':Sequelize[_0x387f('0x3')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x387f('0x1')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x387f('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x387f('0x1')]},'deliveryReport':{'type':Sequelize[_0x387f('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x387f('0x1')]},'notificationTemplate':{'type':Sequelize[_0x387f('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x387f('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x387f('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x387f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x387f('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x387f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x387f('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x387f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x387f('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x387f('0xf')],'comment':_0x387f('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x387f('0xd')],'defaultValue':![],'comment':_0x387f('0x11'),'set':function(_0x411e22){if(!_0x411e22)this[_0x387f('0x12')](_0x387f('0x13'),null);this[_0x387f('0x12')](_0x387f('0x14'),_0x411e22);}}}; \ No newline at end of file +var _0x5c40=['intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','plivo','clickatell','bandwidth','csc','infobip'];(function(_0x587bf2,_0x198c02){var _0x113268=function(_0x2af791){while(--_0x2af791){_0x587bf2['push'](_0x587bf2['shift']());}};_0x113268(++_0x198c02);}(_0x5c40,0x1bf));var _0x05c4=function(_0x4a5fda,_0x49433c){_0x4a5fda=_0x4a5fda-0x0;var _0x2d8ccd=_0x5c40[_0x4a5fda];return _0x2d8ccd;};'use strict';var Sequelize=require(_0x05c4('0x0'));var rs=require(_0x05c4('0x1'));module[_0x05c4('0x2')]={'name':{'type':Sequelize[_0x05c4('0x3')],'unique':_0x05c4('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x05c4('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x05c4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x05c4('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x05c4('0x5')](_0x05c4('0x6'),_0x05c4('0x7'),'connectel','clicksend',_0x05c4('0x8'),_0x05c4('0x9'),_0x05c4('0xa'),_0x05c4('0xb'),_0x05c4('0xc'),_0x05c4('0xd'))},'accountSid':{'type':Sequelize[_0x05c4('0x3')]},'authId':{'type':Sequelize[_0x05c4('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x05c4('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x05c4('0x3')]},'password':{'type':Sequelize[_0x05c4('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x05c4('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x05c4('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x05c4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x05c4('0xf')],'defaultValue':function(){return _0x05c4('0x10');}},'notificationSound':{'type':Sequelize[_0x05c4('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x05c4('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x05c4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x05c4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x05c4('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x05c4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x05c4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x05c4('0x11')],'comment':_0x05c4('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x05c4('0xe')],'defaultValue':![],'comment':_0x05c4('0x13'),'set':function(_0x5d4e86){if(!_0x5d4e86)this[_0x05c4('0x14')](_0x05c4('0x15'),null);this[_0x05c4('0x14')](_0x05c4('0x16'),_0x5d4e86);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5f2468a..02de8ab 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 _0x8ab5=['VIRTUAL','filter','options','findAll','rows','fields','length','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','SmsAccountId','Disposition','findOne','hasOwnProperty','nolimit','order','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','Applications','account','priority','Sequelize','updatedAt','difference','createdAt','CompanyId','ListId','mobile','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','list','omit','Contacts','defaults','contact','SmsInteraction','interaction','autoclose','applications','close','unmanaged','created','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','send','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','getApplications','Contact','User','fullname','Tags','color','tag','List','DESC','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','sort','where','pick','merge'];(function(_0x4b256a,_0x154505){var _0x14ca6f=function(_0x3c9f41){while(--_0x3c9f41){_0x4b256a['push'](_0x4b256a['shift']());}};_0x14ca6f(++_0x154505);}(_0x8ab5,0x175));var _0x58ab=function(_0x4e2a96,_0x29151c){_0x4e2a96=_0x4e2a96-0x0;var _0x483777=_0x8ab5[_0x4e2a96];return _0x483777;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58ab('0x0'));var zipdir=require(_0x58ab('0x1'));var jsonpatch=require(_0x58ab('0x2'));var rp=require(_0x58ab('0x3'));var moment=require(_0x58ab('0x4'));var BPromise=require(_0x58ab('0x5'));var Mustache=require(_0x58ab('0x6'));var util=require(_0x58ab('0x7'));var path=require(_0x58ab('0x8'));var sox=require(_0x58ab('0x9'));var csv=require(_0x58ab('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58ab('0xb'));var _=require('lodash');var squel=require(_0x58ab('0xc'));var crypto=require(_0x58ab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x58ab('0xe'));var toCsv=require(_0x58ab('0xa'));var querystring=require(_0x58ab('0xf'));var Papa=require(_0x58ab('0x10'));var Redis=require(_0x58ab('0x11'));var authService=require(_0x58ab('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58ab('0x13'));var logger=require(_0x58ab('0x14'))(_0x58ab('0x15'));var utils=require(_0x58ab('0x16'));var config=require(_0x58ab('0x17'));var licenseUtil=require(_0x58ab('0x18'));var db=require(_0x58ab('0x19'))['db'];config[_0x58ab('0x1a')]=_['defaults'](config[_0x58ab('0x1a')],{'host':_0x58ab('0x1b'),'port':0x18eb});var socket=require(_0x58ab('0x1c'))(new Redis(config[_0x58ab('0x1a')]));require(_0x58ab('0x1d'))['register'](socket);var jayson=require(_0x58ab('0x1e'));var client=jayson[_0x58ab('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3f219,_0x26e590,_0x1af5b9,_0x5a3505){return new BPromise(function(_0x454e92,_0x4881f1){var _0x342296=_0x5a3505||client;return _0x342296[_0x58ab('0x20')](_0x3f219,_0x1af5b9)[_0x58ab('0x21')](function(_0x27c332){logger[_0x58ab('0x22')](_0x58ab('0x23'),_0x26e590,_0x58ab('0x24'));logger[_0x58ab('0x25')](_0x58ab('0x26'),_0x26e590,_0x58ab('0x24'),JSON[_0x58ab('0x27')](_0x27c332));if(_0x27c332[_0x58ab('0x28')]){if(_0x27c332[_0x58ab('0x28')][_0x58ab('0x29')]===0x1f4){logger[_0x58ab('0x28')](_0x58ab('0x23'),_0x26e590,_0x27c332[_0x58ab('0x28')][_0x58ab('0x2a')]);return _0x4881f1(_0x27c332['error'][_0x58ab('0x2a')]);}logger[_0x58ab('0x28')](_0x58ab('0x23'),_0x26e590,_0x27c332[_0x58ab('0x28')][_0x58ab('0x2a')]);return _0x454e92(_0x27c332[_0x58ab('0x28')][_0x58ab('0x2a')]);}else{logger[_0x58ab('0x22')]('SmsAccount,\x20%s,\x20%s',_0x26e590,'request\x20sent');_0x454e92(_0x27c332[_0x58ab('0x2b')][_0x58ab('0x2a')]);}})[_0x58ab('0x2c')](function(_0x165bbb){logger[_0x58ab('0x28')](_0x58ab('0x23'),_0x26e590,_0x165bbb);_0x4881f1(_0x165bbb);});});}function respondWithStatusCode(_0x49ab0f,_0x2d647c){_0x2d647c=_0x2d647c||0xcc;return function(_0x21255f){if(_0x21255f){return _0x49ab0f['sendStatus'](_0x2d647c);}return _0x49ab0f[_0x58ab('0x2d')](_0x2d647c)[_0x58ab('0x2e')]();};}function respondWithResult(_0x5e1dc4,_0x555ca1){_0x555ca1=_0x555ca1||0xc8;return function(_0x58d037){if(_0x58d037){return _0x5e1dc4[_0x58ab('0x2d')](_0x555ca1)[_0x58ab('0x2f')](_0x58d037);}};}function respondWithFilteredResult(_0x3ee9eb,_0xb0d6ac){return function(_0x155659){if(_0x155659){var _0x27bc28=typeof _0xb0d6ac['offset']==='undefined'&&typeof _0xb0d6ac[_0x58ab('0x30')]==='undefined';var _0x3f8fc4=_0x155659[_0x58ab('0x31')];var _0x11c457=_0x27bc28?0x0:_0xb0d6ac[_0x58ab('0x32')];var _0x3cb44d=_0x27bc28?_0x155659['count']:_0xb0d6ac[_0x58ab('0x32')]+_0xb0d6ac[_0x58ab('0x30')];var _0x4334de;if(_0x3cb44d>=_0x3f8fc4){_0x3cb44d=_0x3f8fc4;_0x4334de=0xc8;}else{_0x4334de=0xce;}_0x3ee9eb[_0x58ab('0x2d')](_0x4334de);return _0x3ee9eb[_0x58ab('0x33')](_0x58ab('0x34'),_0x11c457+'-'+_0x3cb44d+'/'+_0x3f8fc4)['json'](_0x155659);}return null;};}function patchUpdates(_0x430570){return function(_0xb595c0){try{jsonpatch[_0x58ab('0x35')](_0xb595c0,_0x430570,!![]);}catch(_0x25d600){return BPromise[_0x58ab('0x36')](_0x25d600);}return _0xb595c0[_0x58ab('0x37')]();};}function saveUpdates(_0x15b4a0,_0x6f939a){return function(_0x554ed3){if(_0x554ed3){return _0x554ed3['update'](_0x15b4a0)['then'](function(_0x277e59){return _0x277e59;});}return null;};}function removeEntity(_0x4679fc,_0x1ac24e){return function(_0x3d3875){if(_0x3d3875){return _0x3d3875[_0x58ab('0x38')]()['then'](function(){var _0x1b4b28=_0x3d3875[_0x58ab('0x39')]({'plain':!![]});var _0x19e987=_0x58ab('0x3a');return db[_0x58ab('0x3b')][_0x58ab('0x38')]({'where':{'type':_0x19e987,'resourceId':_0x1b4b28['id']}})[_0x58ab('0x21')](function(){return _0x3d3875;});})[_0x58ab('0x21')](function(){_0x4679fc[_0x58ab('0x2d')](0xcc)[_0x58ab('0x2e')]();});}};}function handleEntityNotFound(_0x1e6e3e,_0xd2722a){return function(_0x49b28a){if(!_0x49b28a){_0x1e6e3e[_0x58ab('0x3c')](0x194);}return _0x49b28a;};}function handleError(_0x2b89d3,_0x2e99a1){_0x2e99a1=_0x2e99a1||0x1f4;return function(_0x1bb448){logger['error'](_0x1bb448['stack']);if(_0x1bb448['name']){delete _0x1bb448[_0x58ab('0x3d')];}_0x2b89d3[_0x58ab('0x2d')](_0x2e99a1)['send'](_0x1bb448);};}exports[_0x58ab('0x3e')]=function(_0x52c75f,_0x2660ca){var _0xed6594={'include':[{'model':db[_0x58ab('0x3f')],'as':_0x58ab('0x40')}]},_0x13a997={},_0x5eee27={'count':0x0,'rows':[]};var _0x521527=_[_0x58ab('0x41')](db[_0x58ab('0x42')][_0x58ab('0x43')],function(_0x54f0c9){return{'name':_0x54f0c9[_0x58ab('0x44')],'type':_0x54f0c9[_0x58ab('0x45')][_0x58ab('0x46')]};});_0x13a997['model']=_[_0x58ab('0x41')](_0x521527,'name');_0x13a997[_0x58ab('0x47')]=_[_0x58ab('0x48')](_0x52c75f['query']);_0x13a997[_0x58ab('0x49')]=_[_0x58ab('0x4a')](_0x13a997[_0x58ab('0x4b')],_0x13a997['query']);_0xed6594['attributes']=_['intersection'](_0x13a997[_0x58ab('0x4b')],qs['fields'](_0x52c75f[_0x58ab('0x47')]['fields']));_0xed6594['attributes']=_0xed6594[_0x58ab('0x4c')]['length']?_0xed6594['attributes']:_0x13a997['model'];if(!_0x52c75f[_0x58ab('0x47')]['hasOwnProperty']('nolimit')){_0xed6594['limit']=qs['limit'](_0x52c75f[_0x58ab('0x47')][_0x58ab('0x30')]);_0xed6594[_0x58ab('0x32')]=qs[_0x58ab('0x32')](_0x52c75f[_0x58ab('0x47')][_0x58ab('0x32')]);}_0xed6594['order']=qs[_0x58ab('0x4d')](_0x52c75f[_0x58ab('0x47')]['sort']);_0xed6594[_0x58ab('0x4e')]=qs['filters'](_[_0x58ab('0x4f')](_0x52c75f[_0x58ab('0x47')],_0x13a997['filters']),_0x521527);if(_0x52c75f[_0x58ab('0x47')]['filter']){_0xed6594['where']=_[_0x58ab('0x50')](_0xed6594['where'],{'$or':_['map'](_0x521527,function(_0x43f50d){if(_0x43f50d[_0x58ab('0x45')]!==_0x58ab('0x51')){var _0x10ad8a={};_0x10ad8a[_0x43f50d[_0x58ab('0x3d')]]={'$like':'%'+_0x52c75f['query'][_0x58ab('0x52')]+'%'};return _0x10ad8a;}})});}_0xed6594=_[_0x58ab('0x50')]({},_0xed6594,_0x52c75f[_0x58ab('0x53')]);var _0x10a567={'where':_0xed6594[_0x58ab('0x4e')]};return db['SmsAccount']['count'](_0x10a567)[_0x58ab('0x21')](function(_0x7cbe98){_0x5eee27[_0x58ab('0x31')]=_0x7cbe98;if(_0x52c75f['query']['includeAll']){_0xed6594['include']=[{'all':!![]}];}return db['SmsAccount'][_0x58ab('0x54')](_0xed6594);})[_0x58ab('0x21')](function(_0x19081e){_0x5eee27[_0x58ab('0x55')]=_0x19081e;return _0x5eee27;})[_0x58ab('0x21')](respondWithFilteredResult(_0x2660ca,_0xed6594))[_0x58ab('0x2c')](handleError(_0x2660ca,null));};exports['show']=function(_0x53137f,_0x4cf872){var _0x1d9ccf={'raw':![],'where':{'id':_0x53137f['params']['id']},'include':[{'model':db[_0x58ab('0x3f')],'as':_0x58ab('0x40')}]},_0xe38b68={};_0xe38b68[_0x58ab('0x4b')]=_[_0x58ab('0x48')](db[_0x58ab('0x42')][_0x58ab('0x43')]);_0xe38b68[_0x58ab('0x47')]=_[_0x58ab('0x48')](_0x53137f['query']);_0xe38b68[_0x58ab('0x49')]=_[_0x58ab('0x4a')](_0xe38b68[_0x58ab('0x4b')],_0xe38b68[_0x58ab('0x47')]);_0x1d9ccf[_0x58ab('0x4c')]=_[_0x58ab('0x4a')](_0xe38b68['model'],qs[_0x58ab('0x56')](_0x53137f[_0x58ab('0x47')][_0x58ab('0x56')]));_0x1d9ccf['attributes']=_0x1d9ccf[_0x58ab('0x4c')][_0x58ab('0x57')]?_0x1d9ccf['attributes']:_0xe38b68['model'];if(_0x53137f[_0x58ab('0x47')][_0x58ab('0x58')]){_0x1d9ccf['include']=[{'all':!![]}];}_0x1d9ccf=_[_0x58ab('0x50')]({},_0x1d9ccf,_0x53137f['options']);return db[_0x58ab('0x42')][_0x58ab('0x59')](_0x1d9ccf)[_0x58ab('0x21')](handleEntityNotFound(_0x4cf872,null))[_0x58ab('0x21')](respondWithResult(_0x4cf872,null))['catch'](handleError(_0x4cf872,null));};exports[_0x58ab('0x5a')]=function(_0x376765,_0x4d942c){return db[_0x58ab('0x42')][_0x58ab('0x5a')](_0x376765[_0x58ab('0x5b')],{})['then'](function(_0x2034ec){var _0x584f52=_0x376765[_0x58ab('0x5c')][_0x58ab('0x39')]({'plain':!![]});if(!_0x584f52)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x584f52[_0x58ab('0x5d')]==='user'){var _0x3b0aaa=_0x2034ec[_0x58ab('0x39')]({'plain':!![]});var _0x2f8bd8=_0x58ab('0x3a');return db[_0x58ab('0x5e')][_0x58ab('0x59')]({'where':{'name':_0x2f8bd8,'userProfileId':_0x584f52[_0x58ab('0x5f')]},'raw':!![]})[_0x58ab('0x21')](function(_0x33139a){if(_0x33139a&&_0x33139a['autoAssociation']===0x0){return db[_0x58ab('0x3b')][_0x58ab('0x5a')]({'name':_0x3b0aaa[_0x58ab('0x3d')],'resourceId':_0x3b0aaa['id'],'type':_0x33139a['name'],'sectionId':_0x33139a['id']},{})['then'](function(){return _0x2034ec;});}else{return _0x2034ec;}})[_0x58ab('0x2c')](function(_0x4df8bc){logger['error'](_0x58ab('0x60'),_0x4df8bc);throw _0x4df8bc;});}return _0x2034ec;})[_0x58ab('0x21')](respondWithResult(_0x4d942c,0xc9))[_0x58ab('0x2c')](handleError(_0x4d942c,null));};exports[_0x58ab('0x61')]=function(_0x3a97a8,_0x54a591){if(_0x3a97a8['body']['id']){delete _0x3a97a8[_0x58ab('0x5b')]['id'];}return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x3a97a8[_0x58ab('0x62')]['id']},'include':[{'model':db[_0x58ab('0x3f')],'as':_0x58ab('0x40')}]})[_0x58ab('0x21')](handleEntityNotFound(_0x54a591,null))[_0x58ab('0x21')](saveUpdates(_0x3a97a8[_0x58ab('0x5b')],null))[_0x58ab('0x21')](respondWithResult(_0x54a591,null))['catch'](handleError(_0x54a591,null));};exports[_0x58ab('0x38')]=function(_0x544ba6,_0x5aeebd){return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x544ba6[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x5aeebd,null))[_0x58ab('0x21')](removeEntity(_0x5aeebd,null))[_0x58ab('0x2c')](handleError(_0x5aeebd,null));};exports[_0x58ab('0x63')]=function(_0x55cc4c,_0x5e9fc4){return db['SmsAccount']['describe']()[_0x58ab('0x21')](respondWithResult(_0x5e9fc4,null))[_0x58ab('0x2c')](handleError(_0x5e9fc4,null));};exports['addDisposition']=function(_0x22bd7f,_0x1fdf16,_0x46fa1e){if(_0x22bd7f[_0x58ab('0x5b')]['id']){delete _0x22bd7f[_0x58ab('0x5b')]['id'];}return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x22bd7f[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x1fdf16,null))[_0x58ab('0x21')](function(_0x27a75b){if(_0x27a75b){_0x22bd7f[_0x58ab('0x5b')][_0x58ab('0x64')]=_0x27a75b['id'];return db[_0x58ab('0x65')][_0x58ab('0x5a')](_0x22bd7f[_0x58ab('0x5b')]);}})['then'](respondWithResult(_0x1fdf16,null))[_0x58ab('0x2c')](handleError(_0x1fdf16,null));};exports['getDispositions']=function(_0x4918f2,_0x3d34ac,_0xc61436){var _0x3f2076={'raw':![],'where':{}};var _0x9c83b2={};var _0x37044e={'count':0x0,'rows':[]};return db[_0x58ab('0x42')][_0x58ab('0x66')]({'where':{'id':_0x4918f2[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x3d34ac,null))[_0x58ab('0x21')](function(_0x512327){if(_0x512327){_0x9c83b2[_0x58ab('0x4b')]=_[_0x58ab('0x48')](db[_0x58ab('0x65')]['rawAttributes']);_0x9c83b2[_0x58ab('0x47')]=_[_0x58ab('0x48')](_0x4918f2[_0x58ab('0x47')]);_0x9c83b2[_0x58ab('0x49')]=_['intersection'](_0x9c83b2['model'],_0x9c83b2[_0x58ab('0x47')]);_0x3f2076['attributes']=_[_0x58ab('0x4a')](_0x9c83b2[_0x58ab('0x4b')],qs[_0x58ab('0x56')](_0x4918f2[_0x58ab('0x47')][_0x58ab('0x56')]));_0x3f2076[_0x58ab('0x4c')]=_0x3f2076[_0x58ab('0x4c')]['length']?_0x3f2076[_0x58ab('0x4c')]:_0x9c83b2[_0x58ab('0x4b')];if(!_0x4918f2['query'][_0x58ab('0x67')](_0x58ab('0x68'))){_0x3f2076[_0x58ab('0x30')]=qs[_0x58ab('0x30')](_0x4918f2[_0x58ab('0x47')][_0x58ab('0x30')]);_0x3f2076[_0x58ab('0x32')]=qs[_0x58ab('0x32')](_0x4918f2[_0x58ab('0x47')][_0x58ab('0x32')]);}_0x3f2076[_0x58ab('0x69')]=qs['sort'](_0x4918f2[_0x58ab('0x47')][_0x58ab('0x4d')]);_0x3f2076['where']=qs['filters'](_[_0x58ab('0x4f')](_0x4918f2[_0x58ab('0x47')],_0x9c83b2[_0x58ab('0x49')]));_0x3f2076[_0x58ab('0x4e')]['SmsAccountId']=_0x512327['id'];if(_0x4918f2[_0x58ab('0x47')][_0x58ab('0x52')]){_0x3f2076[_0x58ab('0x4e')]=_[_0x58ab('0x50')](_0x3f2076[_0x58ab('0x4e')],{'$or':_[_0x58ab('0x41')](_0x3f2076['attributes'],function(_0x2d746f){var _0xc91b90={};_0xc91b90[_0x2d746f]={'$like':'%'+_0x4918f2[_0x58ab('0x47')]['filter']+'%'};return _0xc91b90;})});}_0x3f2076=_[_0x58ab('0x50')]({},_0x3f2076,_0x4918f2['options']);return db['Disposition'][_0x58ab('0x31')]({'where':_0x3f2076['where']})[_0x58ab('0x21')](function(_0x33ba95){_0x37044e[_0x58ab('0x31')]=_0x33ba95;if(_0x4918f2[_0x58ab('0x47')][_0x58ab('0x58')]){_0x3f2076[_0x58ab('0x6a')]=[{'all':!![]}];}return db['Disposition'][_0x58ab('0x54')](_0x3f2076);})['then'](function(_0xbb3d53){_0x37044e['rows']=_0xbb3d53;return _0x37044e;});}})[_0x58ab('0x21')](respondWithFilteredResult(_0x3d34ac,_0x3f2076))[_0x58ab('0x2c')](handleError(_0x3d34ac,null));};exports[_0x58ab('0x6b')]=function(_0x53af0e,_0x2e2f7a,_0x157766){return db['SmsAccount'][_0x58ab('0x59')]({'where':{'id':_0x53af0e[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x2e2f7a,null))[_0x58ab('0x21')](function(_0x5bc40e){if(_0x5bc40e){return _0x5bc40e[_0x58ab('0x6b')](_0x53af0e['query'][_0x58ab('0x6c')]);}})[_0x58ab('0x21')](respondWithStatusCode(_0x2e2f7a,null))['catch'](handleError(_0x2e2f7a,null));};exports[_0x58ab('0x6d')]=function(_0x5bba90,_0x27e20e,_0x2556b2){if(_0x5bba90[_0x58ab('0x5b')]['id']){delete _0x5bba90[_0x58ab('0x5b')]['id'];}return db[_0x58ab('0x42')]['find']({'where':{'id':_0x5bba90[_0x58ab('0x62')]['id']}})['then'](handleEntityNotFound(_0x27e20e,null))[_0x58ab('0x21')](function(_0x5e6cf6){if(_0x5e6cf6){_0x5bba90[_0x58ab('0x5b')][_0x58ab('0x64')]=_0x5e6cf6['id'];return db[_0x58ab('0x6e')][_0x58ab('0x5a')](_0x5bba90[_0x58ab('0x5b')]);}})[_0x58ab('0x21')](respondWithResult(_0x27e20e,null))['catch'](handleError(_0x27e20e,null));};exports[_0x58ab('0x6f')]=function(_0x5b9c7a,_0x542241,_0x444923){var _0x33a30f={'raw':![],'where':{}};var _0xb559be={};var _0x53f80e={'count':0x0,'rows':[]};return db[_0x58ab('0x42')][_0x58ab('0x66')]({'where':{'id':_0x5b9c7a[_0x58ab('0x62')]['id']}})['then'](handleEntityNotFound(_0x542241,null))['then'](function(_0x29d7c6){if(_0x29d7c6){_0xb559be['model']=_['keys'](db['CannedAnswer'][_0x58ab('0x43')]);_0xb559be[_0x58ab('0x47')]=_[_0x58ab('0x48')](_0x5b9c7a[_0x58ab('0x47')]);_0xb559be[_0x58ab('0x49')]=_[_0x58ab('0x4a')](_0xb559be[_0x58ab('0x4b')],_0xb559be[_0x58ab('0x47')]);_0x33a30f[_0x58ab('0x4c')]=_['intersection'](_0xb559be['model'],qs[_0x58ab('0x56')](_0x5b9c7a[_0x58ab('0x47')]['fields']));_0x33a30f['attributes']=_0x33a30f[_0x58ab('0x4c')][_0x58ab('0x57')]?_0x33a30f[_0x58ab('0x4c')]:_0xb559be[_0x58ab('0x4b')];if(!_0x5b9c7a[_0x58ab('0x47')][_0x58ab('0x67')](_0x58ab('0x68'))){_0x33a30f['limit']=qs['limit'](_0x5b9c7a[_0x58ab('0x47')][_0x58ab('0x30')]);_0x33a30f[_0x58ab('0x32')]=qs[_0x58ab('0x32')](_0x5b9c7a[_0x58ab('0x47')]['offset']);}_0x33a30f[_0x58ab('0x69')]=qs['sort'](_0x5b9c7a[_0x58ab('0x47')][_0x58ab('0x4d')]);_0x33a30f[_0x58ab('0x4e')]=qs[_0x58ab('0x49')](_[_0x58ab('0x4f')](_0x5b9c7a[_0x58ab('0x47')],_0xb559be[_0x58ab('0x49')]));_0x33a30f[_0x58ab('0x4e')][_0x58ab('0x64')]=_0x29d7c6['id'];if(_0x5b9c7a[_0x58ab('0x47')][_0x58ab('0x52')]){_0x33a30f[_0x58ab('0x4e')]=_[_0x58ab('0x50')](_0x33a30f[_0x58ab('0x4e')],{'$or':_[_0x58ab('0x41')](_0x33a30f[_0x58ab('0x4c')],function(_0x4d5506){var _0x1eadec={};_0x1eadec[_0x4d5506]={'$like':'%'+_0x5b9c7a[_0x58ab('0x47')][_0x58ab('0x52')]+'%'};return _0x1eadec;})});}_0x33a30f=_[_0x58ab('0x50')]({},_0x33a30f,_0x5b9c7a[_0x58ab('0x53')]);return db[_0x58ab('0x6e')][_0x58ab('0x31')]({'where':_0x33a30f[_0x58ab('0x4e')]})['then'](function(_0x41e8e1){_0x53f80e[_0x58ab('0x31')]=_0x41e8e1;if(_0x5b9c7a[_0x58ab('0x47')]['includeAll']){_0x33a30f[_0x58ab('0x6a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x58ab('0x54')](_0x33a30f);})['then'](function(_0x22a056){_0x53f80e[_0x58ab('0x55')]=_0x22a056;return _0x53f80e;});}})['then'](respondWithFilteredResult(_0x542241,_0x33a30f))[_0x58ab('0x2c')](handleError(_0x542241,null));};exports[_0x58ab('0x70')]=function(_0x3cfbbc,_0x237fc6,_0x42d75b){return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x3cfbbc[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x237fc6,null))[_0x58ab('0x21')](function(_0x3e1aee){if(_0x3e1aee){return _0x3e1aee[_0x58ab('0x70')](_0x3cfbbc[_0x58ab('0x47')][_0x58ab('0x6c')]);}})[_0x58ab('0x21')](respondWithStatusCode(_0x237fc6,null))[_0x58ab('0x2c')](handleError(_0x237fc6,null));};exports['notify']=function(_0x23ecf1,_0x42d138,_0x28e716){var _0x3445d4={'channel':'sms'};var _0x3810a9=[];var _0x8f9dba=[];var _0x21978d={};return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x23ecf1['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x58ab('0x71')}]})['then'](handleEntityNotFound(_0x42d138,null))[_0x58ab('0x21')](function(_0xdecf99){_0x3445d4[_0x58ab('0x72')]=_0xdecf99;_0x3445d4['applications']=_['orderBy'](_0xdecf99[_0x58ab('0x71')],[_0x58ab('0x73')],['asc']);if(_0x3445d4[_0x58ab('0x72')]['Applications']){delete _0x3445d4['account']['Applications'];}return db['CmContact'][_0x58ab('0x63')]();})[_0x58ab('0x21')](function(_0x2d383b){if(!_0x2d383b){throw new db[(_0x58ab('0x74'))]['ValidationError']('no\x20available\x20attributes');}_0x3810a9=_['difference'](_[_0x58ab('0x48')](_0x2d383b),['createdAt',_0x58ab('0x75')]);_0x8f9dba=_[_0x58ab('0x76')](_['keys'](_0x2d383b),[_0x58ab('0x77'),_0x58ab('0x75'),_0x58ab('0x78'),_0x58ab('0x79')]);_0x3445d4['body']={'mapKey':_0x58ab('0x7a')};if(_0x3445d4[_0x58ab('0x72')][_0x58ab('0x45')]){switch(_0x3445d4[_0x58ab('0x72')]['type']){case'twilio':_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')]=_0x23ecf1['body'][_0x58ab('0x7c')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1['body']['Body'];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7d')]=_0x23ecf1['body'][_0x58ab('0x7e')];break;case _0x58ab('0x7f'):_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')]='+'+_0x23ecf1['body'][_0x58ab('0x80')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1['body'][_0x58ab('0x81')];break;case _0x58ab('0x82'):_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x7b')];_0x3445d4[_0x58ab('0x5b')]['body']=_0x23ecf1['body'][_0x58ab('0x2a')];break;case _0x58ab('0x83'):_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')]=_0x23ecf1[_0x58ab('0x5b')]['from'];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x5b')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7d')]=_0x23ecf1['body'][_0x58ab('0x84')];break;case _0x58ab('0x85'):_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x7c')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x86')];_0x3445d4[_0x58ab('0x5b')]['messageId']=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x87')];break;case _0x58ab('0x88'):_0x3445d4['body']['from']='+'+_0x23ecf1['body'][_0x58ab('0x89')][0x0][_0x58ab('0x7b')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x89')][0x0][_0x58ab('0x81')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7d')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x89')][0x0][_0x58ab('0x7d')];break;case _0x58ab('0x8a'):_0x3445d4[_0x58ab('0x5b')]['from']=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x8b')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1[_0x58ab('0x5b')]['segmentedMessage']['message'];break;case _0x58ab('0x8c'):_0x3445d4[_0x58ab('0x5b')]['from']=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x8d')];_0x3445d4['body'][_0x58ab('0x5b')]=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x81')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7d')]=_0x23ecf1['body'][_0x58ab('0x8e')];break;case _0x58ab('0x8f'):_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7d')]=_0x23ecf1['body'][0x0][_0x58ab('0x2a')]['id'];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')]=_0x23ecf1['body'][0x0][_0x58ab('0x2a')][_0x58ab('0x7b')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1['body'][0x0][_0x58ab('0x2a')][_0x58ab('0x81')];break;case _0x58ab('0x90'):_0x3445d4[_0x58ab('0x5b')]['from']=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x7b')];_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')]=_0x23ecf1[_0x58ab('0x5b')]['message'];_0x3445d4[_0x58ab('0x5b')]['messageId']=_0x23ecf1[_0x58ab('0x5b')][_0x58ab('0x91')];break;}}if(_0x3445d4[_0x58ab('0x5b')]['id']){delete _0x3445d4[_0x58ab('0x5b')]['id'];}if(_[_0x58ab('0x92')](_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')])){throw new db[(_0x58ab('0x74'))][(_0x58ab('0x93'))](_0x58ab('0x94'));}if(_[_0x58ab('0x92')](_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x5b')])||_0x3445d4['body'][_0x58ab('0x5b')]===''){throw new db[(_0x58ab('0x74'))][(_0x58ab('0x93'))](_0x58ab('0x95'));}if(_[_0x58ab('0x92')](_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x96')])){throw new db[(_0x58ab('0x74'))][(_0x58ab('0x93'))](_0x58ab('0x97')+_0x8f9dba);}if(!_[_0x58ab('0x98')](_0x8f9dba,_0x3445d4['body'][_0x58ab('0x96')])){throw new db[(_0x58ab('0x74'))][(_0x58ab('0x93'))](_0x58ab('0x99')+_0x8f9dba);}_0x21978d[_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x96')]]=_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')];return db[_0x58ab('0x9a')][_0x58ab('0x59')]({'where':{'id':_0x3445d4[_0x58ab('0x72')][_0x58ab('0x79')]},'include':[{'model':db[_0x58ab('0x9b')],'as':'Contacts','where':_0x21978d,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x42d138,null))[_0x58ab('0x21')](function(_0x2c4e6d){if(_0x2c4e6d){_0x3445d4[_0x58ab('0x9c')]=_[_0x58ab('0x9d')](_0x2c4e6d,[_0x58ab('0x9e')]);if(_0x2c4e6d[_0x58ab('0x9e')][_0x58ab('0x57')]){return _0x2c4e6d['Contacts'][0x0];}var _0x408cb9=_[_0x58ab('0x9f')](_0x3445d4[_0x58ab('0x5b')],{'firstName':_0x3445d4['body'][_0x58ab('0x7b')],'ListId':_0x2c4e6d['id']});_0x408cb9[_0x3445d4[_0x58ab('0x5b')]['mapKey']]=_0x3445d4[_0x58ab('0x5b')][_0x58ab('0x7b')];return db[_0x58ab('0x9b')]['create'](_0x408cb9,{'fields':_0x3810a9,'raw':!![]});}})['then'](handleEntityNotFound(_0x42d138,null))[_0x58ab('0x21')](function(_0x14ca5e){if(_0x14ca5e){_0x3445d4[_0x58ab('0xa0')]=_0x14ca5e;var _0x23843b={'ContactId':_0x14ca5e['id'],'phone':_0x3445d4[_0x58ab('0x5b')]['from'],'SmsAccountId':_0x23ecf1[_0x58ab('0x62')]['id']};var _0x5553e9={'ContactId':_0x14ca5e['id'],'SmsAccountId':_0x23ecf1[_0x58ab('0x62')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x5553e9})['then'](function(_0x1e26d6){if(_0x1e26d6){return[_0x1e26d6,![]];}return db[_0x58ab('0xa1')]['create'](_0x23843b)['then'](function(_0x542b34){return[_0x542b34,!![]];});});}})['spread'](function(_0x341935,_0x4c3537){_0x3445d4[_0x58ab('0xa2')]=_0x341935[_0x58ab('0x39')]({'plain':!![]});_0x3445d4['interaction']['created']=![];if(_0x4c3537){if(_0x3445d4[_0x58ab('0x72')][_0x58ab('0xa3')]){_0x3445d4[_0x58ab('0xa4')]['push']({'id':0x0,'priority':_0x3445d4[_0x58ab('0xa4')][_0x58ab('0x57')]+0x1,'app':_0x58ab('0xa5'),'appdata':_0x58ab('0xa6'),'interval':'*,*,*,*'});}_0x3445d4[_0x58ab('0xa2')][_0x58ab('0xa7')]=!![];}return db[_0x58ab('0xa8')][_0x58ab('0x5a')]({'phone':_0x3445d4['body'][_0x58ab('0x7b')],'messageId':_0x3445d4[_0x58ab('0x5b')]['messageId'],'body':_0x3445d4['body'][_0x58ab('0x5b')],'SmsAccountId':_0x23ecf1[_0x58ab('0x62')]['id'],'SmsInteractionId':_0x341935['id'],'direction':'in','ContactId':_0x341935[_0x58ab('0xa9')],'AttachmentId':_0x3445d4[_0x58ab('0x5b')][_0x58ab('0xaa')]});})[_0x58ab('0x21')](function(_0x5608a3){_0x3445d4[_0x58ab('0x2a')]=_0x5608a3;if(_0x3445d4[_0x58ab('0xa2')][_0x58ab('0xab')]){return db['User'][_0x58ab('0x59')]({'attributes':['id',_0x58ab('0x3d')],'where':{'id':_0x3445d4[_0x58ab('0xa2')][_0x58ab('0xab')]}})[_0x58ab('0x21')](function(_0x318c36){if(_0x318c36){_0x3445d4[_0x58ab('0xa4')][_0x58ab('0xac')]({'id':0x0,'priority':0x0,'app':_0x58ab('0xad'),'appdata':_0x318c36[_0x58ab('0x3d')]+','+(_0x3445d4[_0x58ab('0x72')][_0x58ab('0xae')]||0xa),'interval':_0x58ab('0xaf')});}return respondWithRpcPromise(_0x58ab('0xb0'),_0x58ab('0xb1'),_0x3445d4);});}return respondWithRpcPromise('Start',_0x58ab('0xb1'),_0x3445d4);})[_0x58ab('0x21')](function(_0x5306ee){if(_0x5306ee){var _0xf100=0xc8;var _0x3da322=_0x58ab('0xb2');logger[_0x58ab('0x22')](_0x58ab('0x26'),_0x3da322,_0xf100,_0x58ab('0xb3'));logger[_0x58ab('0x25')](_0x58ab('0xb4'),_0x3da322,_0xf100,_0x58ab('0xb3'),JSON[_0x58ab('0x27')](_0x5306ee));if(_0x3445d4[_0x58ab('0x72')][_0x58ab('0x45')]===_0x58ab('0xb5')){return _0x42d138[_0x58ab('0x2d')](_0xf100)['set']('Content-Type','text/xml')[_0x58ab('0xb6')]('\x0a');}else{return _0x42d138[_0x58ab('0x2d')](_0xf100)[_0x58ab('0x2f')](_0x5306ee);}}})['catch'](handleError(_0x42d138,null));};exports[_0x58ab('0xb7')]=function(_0x299480,_0x2d551f){var _0x138193=_0x299480[_0x58ab('0x62')]['id'];var _0x2842a9=_0x299480['body'];var _0x5e5770=0xc8;var _0x5e94d8=null;return db['sequelize'][_0x58ab('0xb8')]({'isolationLevel':db['sequelize']['Transaction'][_0x58ab('0xb9')][_0x58ab('0xba')]},function(_0x1ffc8a){return db['SmsAccount']['findOne']({'where':{'id':_0x138193},'transaction':_0x1ffc8a})[_0x58ab('0x21')](function(_0x2bee0a){if(_0x2bee0a){return db['SmsApplication'][_0x58ab('0x38')]({'where':{'SmsAccountId':_0x138193},'transaction':_0x1ffc8a})[_0x58ab('0x21')](function(){var _0x59cb6b=_['map'](_0x2842a9,function(_0x30229a){_0x30229a[_0x58ab('0x64')]=_0x138193;return _0x30229a;});return db[_0x58ab('0xbb')][_0x58ab('0xbc')](_0x59cb6b,{'transaction':_0x1ffc8a});});}else{_0x5e5770=0x194;_0x5e94d8=[];}});})[_0x58ab('0x21')](function(){if(_0x5e5770!==0x194){return db['SmsApplication'][_0x58ab('0xbd')]({'where':{'SmsAccountId':_0x138193},'order':_0x58ab('0x73')})[_0x58ab('0x21')](function(_0x27fc93){_0x5e94d8=_0x27fc93;});}})['catch'](function(_0x3d5382){_0x5e5770=0x1f4;logger[_0x58ab('0x28')](_0x3d5382[_0x58ab('0xbe')]);if(_0x3d5382[_0x58ab('0x3d')]){delete _0x3d5382[_0x58ab('0x3d')];}_0x5e94d8=_0x3d5382;})['finally'](function(){if(_0x5e94d8===null){_0x2d551f[_0x58ab('0x3c')](_0x5e5770);}else{if(_0x5e5770===0x1f4){_0x2d551f[_0x58ab('0x2d')](_0x5e5770)['send'](_0x5e94d8);}else{_0x2d551f[_0x58ab('0x2d')](_0x5e5770)[_0x58ab('0x2f')](_0x5e94d8);}}});};exports[_0x58ab('0xbf')]=function(_0x1f60b1,_0x3567ff,_0x387011){var _0x56bf19={};var _0x3795dd={};var _0x549e12;var _0x42f312;return db['SmsAccount'][_0x58ab('0x66')]({'where':{'id':_0x1f60b1['params']['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x3567ff,null))['then'](function(_0x5ab575){if(_0x5ab575){_0x549e12=_0x5ab575;_0x3795dd['model']=_[_0x58ab('0x48')](db[_0x58ab('0xbb')][_0x58ab('0x43')]);_0x3795dd['query']=_[_0x58ab('0x48')](_0x1f60b1['query']);_0x3795dd['filters']=_[_0x58ab('0x4a')](_0x3795dd[_0x58ab('0x4b')],_0x3795dd[_0x58ab('0x47')]);_0x56bf19[_0x58ab('0x4c')]=_['intersection'](_0x3795dd['model'],qs[_0x58ab('0x56')](_0x1f60b1['query'][_0x58ab('0x56')]));_0x56bf19['attributes']=_0x56bf19[_0x58ab('0x4c')][_0x58ab('0x57')]?_0x56bf19[_0x58ab('0x4c')]:_0x3795dd[_0x58ab('0x4b')];_0x56bf19[_0x58ab('0x69')]=qs[_0x58ab('0x4d')](_0x1f60b1[_0x58ab('0x47')][_0x58ab('0x4d')]);_0x56bf19[_0x58ab('0x4e')]=qs[_0x58ab('0x49')](_[_0x58ab('0x4f')](_0x1f60b1[_0x58ab('0x47')],_0x3795dd[_0x58ab('0x49')]));if(_0x1f60b1['query'][_0x58ab('0x52')]){_0x56bf19[_0x58ab('0x4e')]=_[_0x58ab('0x50')](_0x56bf19['where'],{'$or':_[_0x58ab('0x41')](_0x56bf19[_0x58ab('0x4c')],function(_0x3370ad){var _0x4fc737={};_0x4fc737[_0x3370ad]={'$like':'%'+_0x1f60b1[_0x58ab('0x47')]['filter']+'%'};return _0x4fc737;})});}_0x56bf19=_[_0x58ab('0x50')]({},_0x56bf19,_0x1f60b1['options']);return _0x549e12[_0x58ab('0xbf')](_0x56bf19);}})[_0x58ab('0x21')](function(_0x1cb938){if(_0x1cb938){_0x42f312=_0x1cb938[_0x58ab('0x57')];if(!_0x1f60b1[_0x58ab('0x47')]['hasOwnProperty']('nolimit')){_0x56bf19['limit']=qs['limit'](_0x1f60b1[_0x58ab('0x47')][_0x58ab('0x30')]);_0x56bf19[_0x58ab('0x32')]=qs['offset'](_0x1f60b1[_0x58ab('0x47')][_0x58ab('0x32')]);}return _0x549e12[_0x58ab('0xbf')](_0x56bf19);}})[_0x58ab('0x21')](function(_0x2bd9d5){if(_0x2bd9d5){return _0x2bd9d5?{'count':_0x42f312,'rows':_0x2bd9d5}:null;}})[_0x58ab('0x21')](respondWithResult(_0x3567ff,null))[_0x58ab('0x2c')](handleError(_0x3567ff,null));};exports['getInteractions']=function(_0x580dcf,_0x339f14,_0x103ceb){var _0x1a69da={'raw':![],'where':{}};var _0x63246d={};var _0x5e54c6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x58ab('0x66')]({'where':{'id':_0x580dcf[_0x58ab('0x62')]['id']}})['then'](handleEntityNotFound(_0x339f14,null))[_0x58ab('0x21')](function(_0x494f61){if(_0x494f61){_0x63246d[_0x58ab('0x4b')]=_[_0x58ab('0x48')](db[_0x58ab('0xa1')][_0x58ab('0x43')]);_0x63246d['query']=_[_0x58ab('0x48')](_0x580dcf[_0x58ab('0x47')]);_0x63246d[_0x58ab('0x49')]=_[_0x58ab('0x4a')](_0x63246d[_0x58ab('0x4b')],_0x63246d[_0x58ab('0x47')]);_0x1a69da[_0x58ab('0x4c')]=_[_0x58ab('0x4a')](_0x63246d[_0x58ab('0x4b')],qs[_0x58ab('0x56')](_0x580dcf[_0x58ab('0x47')]['fields']));_0x1a69da[_0x58ab('0x4c')]=_0x1a69da[_0x58ab('0x4c')][_0x58ab('0x57')]?_0x1a69da[_0x58ab('0x4c')]:_0x63246d[_0x58ab('0x4b')];if(!_0x580dcf['query'][_0x58ab('0x67')](_0x58ab('0x68'))){_0x1a69da[_0x58ab('0x30')]=qs['limit'](_0x580dcf['query'][_0x58ab('0x30')]);_0x1a69da[_0x58ab('0x32')]=qs[_0x58ab('0x32')](_0x580dcf[_0x58ab('0x47')][_0x58ab('0x32')]);}_0x1a69da['order']=qs[_0x58ab('0x4d')](_0x580dcf[_0x58ab('0x47')]['sort']);_0x1a69da[_0x58ab('0x4e')]=qs[_0x58ab('0x49')](_[_0x58ab('0x4f')](_0x580dcf[_0x58ab('0x47')],_0x63246d[_0x58ab('0x49')]));_0x1a69da['where']['SmsAccountId']=_0x494f61['id'];if(_0x580dcf[_0x58ab('0x47')]['filter']){_0x1a69da[_0x58ab('0x4e')]=_['merge'](_0x1a69da[_0x58ab('0x4e')],{'$or':_['map'](_0x1a69da['attributes'],function(_0x27bb68){var _0x82953d={};_0x82953d[_0x27bb68]={'$like':'%'+_0x580dcf['query'][_0x58ab('0x52')]+'%'};return _0x82953d;})});}_0x1a69da=_['merge']({},_0x1a69da,_0x580dcf[_0x58ab('0x53')]);return db['SmsInteraction'][_0x58ab('0x31')]({'where':_0x1a69da[_0x58ab('0x4e')]})['then'](function(_0x4cf88b){_0x5e54c6[_0x58ab('0x31')]=_0x4cf88b;if(_0x580dcf['query']['includeAll']){_0x1a69da[_0x58ab('0x6a')]=[{'model':db['CmContact'],'as':_0x58ab('0xc0'),'required':![]},{'model':db[_0x58ab('0xc1')],'as':'Owner','attributes':['name',_0x58ab('0xc2'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x58ab('0xc3'),'attributes':['id',_0x58ab('0x3d'),_0x58ab('0xc4')],'where':_0x580dcf['query'][_0x58ab('0xc5')]?{'id':_0x580dcf[_0x58ab('0x47')][_0x58ab('0xc5')]}:undefined,'required':_0x580dcf[_0x58ab('0x47')]['tag']?!![]:![]}];}return db[_0x58ab('0xa1')][_0x58ab('0x54')](_0x1a69da);})['then'](function(_0x3cc417){_0x5e54c6[_0x58ab('0x55')]=_0x3cc417;return _0x5e54c6;});}})[_0x58ab('0x21')](respondWithFilteredResult(_0x339f14,_0x1a69da))[_0x58ab('0x2c')](handleError(_0x339f14,null));};exports[_0x58ab('0xb6')]=function(_0x2a31d4,_0x16b11f,_0x2294ee){var _0x4de34c,_0x254b5b,_0x36fcad;if(_[_0x58ab('0x92')](_0x2a31d4[_0x58ab('0x5b')][_0x58ab('0x5b')])||_0x2a31d4['body']['body']===''){throw new db[(_0x58ab('0x74'))][(_0x58ab('0x93'))](_0x58ab('0x95'));}if(_[_0x58ab('0x92')](_0x2a31d4[_0x58ab('0x5b')]['to'])){throw new db[(_0x58ab('0x74'))][(_0x58ab('0x93'))]('to\x20is\x20mandatory');}_0x4de34c=_0x2a31d4[_0x58ab('0x5b')]['to'];return db[_0x58ab('0x42')]['find']({'where':{'id':_0x2a31d4['params']['id']},'include':[{'model':db[_0x58ab('0x9a')],'as':_0x58ab('0xc6'),'include':[{'model':db['CmContact'],'as':_0x58ab('0x9e'),'where':{'mobile':_0x4de34c},'limit':0x1,'order':[[_0x58ab('0x75'),_0x58ab('0xc7')]]}]}]})[_0x58ab('0x21')](handleEntityNotFound(_0x16b11f,null))['then'](function(_0x114f91){if(_0x114f91&&_0x114f91['List']){_0x254b5b=_0x114f91[_0x58ab('0x39')]({'plain':!![]});if(_0x254b5b[_0x58ab('0xc6')]&&_0x254b5b[_0x58ab('0xc6')]['Contacts']['length']){return _0x254b5b[_0x58ab('0xc6')][_0x58ab('0x9e')][0x0];}return db['CmContact']['create'](_[_0x58ab('0x9f')](_0x2a31d4[_0x58ab('0x5b')],{'firstName':_0x4de34c,'mobile':_0x4de34c,'phone':_0x4de34c,'ListId':_0x254b5b[_0x58ab('0x79')]}));}})[_0x58ab('0x21')](handleEntityNotFound(_0x16b11f,null))['then'](function(_0x313140){if(_0x313140){_0x36fcad=_0x313140;return db[_0x58ab('0xa1')]['find']({'where':{'ContactId':_0x36fcad['id'],'closed':![],'SmsAccountId':_0x254b5b['id']}})['then'](function(_0xa71ca6){if(_0xa71ca6){return[_0xa71ca6,![]];}return db['SmsInteraction'][_0x58ab('0x5a')]({'UserId':_0x2a31d4['user']['id'],'ContactId':_0x36fcad['id'],'SmsAccountId':_0x254b5b['id'],'phone':_0x4de34c,'firstMsgDirection':_0x58ab('0xc8'),'Messages':[_[_0x58ab('0x50')](_0x2a31d4[_0x58ab('0x5b')],{'read':![],'body':_0x2a31d4[_0x58ab('0x5b')][_0x58ab('0x5b')],'phone':_0x4de34c,'SmsAccountId':_0x254b5b['id'],'UserId':_0x2a31d4[_0x58ab('0x5c')]['id'],'ContactId':_0x36fcad['id']})]},{'include':[{'model':db[_0x58ab('0xa8')],'as':_0x58ab('0xc9')}]})[_0x58ab('0x21')](function(_0x1e3369){return[_0x1e3369,!![]];});});}})[_0x58ab('0xca')](function(_0x41b4b7,_0x22425e){if(_0x22425e){return _0x41b4b7;}return db['SmsMessage'][_0x58ab('0x5a')](_[_0x58ab('0x50')](_0x2a31d4[_0x58ab('0x5b')],{'read':![],'body':_0x2a31d4[_0x58ab('0x5b')][_0x58ab('0x5b')],'phone':_0x4de34c,'SmsAccountId':_0x254b5b['id'],'SmsInteractionId':_0x41b4b7['id'],'UserId':_0x2a31d4[_0x58ab('0x5c')]['id'],'ContactId':_0x36fcad['id']}))['then'](function(_0x324dd7){_0x41b4b7[_0x58ab('0xcb')]['Messages']=[];_0x41b4b7['dataValues'][_0x58ab('0xc9')]['push'](_0x324dd7[_0x58ab('0xcb')]);return _0x41b4b7;});})[_0x58ab('0x21')](respondWithResult(_0x16b11f,null))[_0x58ab('0x2c')](handleError(_0x16b11f,null));};exports[_0x58ab('0x2d')]=function(_0x58e7ea,_0xb91e63,_0x41550e){if(_0x58e7ea[_0x58ab('0x5b')]['id']){delete _0x58e7ea['body']['id'];}var _0x5a92a9,_0x2f0e56,_0x1694b4;return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x58e7ea[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0xb91e63,null))['then'](function(_0x1ff6ec){if(_0x1ff6ec){_0x1694b4=_0x1ff6ec;logger[_0x58ab('0x25')](_0x58ab('0x26'),_0x58ab('0x2d'),_0x58ab('0xcc'),_0x1ff6ec[_0x58ab('0x45')],util[_0x58ab('0xcd')](_0x58e7ea['body'],{'showHidden':![],'depth':null}));switch(_0x1ff6ec[_0x58ab('0x45')]){case _0x58ab('0x7f'):if(_0x58e7ea[_0x58ab('0x5b')]['skebby_dispatch_id']&&_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0x2d')]){_0x2f0e56=_0x58e7ea['body'][_0x58ab('0x2d')];return db[_0x58ab('0xa8')]['find']({'where':{'messageId':_0x58e7ea['body'][_0x58ab('0xce')]}});}break;case _0x58ab('0x82'):if(_0x58e7ea[_0x58ab('0x5b')]['requestid']&&_0x58e7ea['body'][_0x58ab('0xcf')]){_0x2f0e56=_0x58e7ea['body']['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0xd0')]}});}break;case _0x58ab('0x83'):if(_0x58e7ea['body'][_0x58ab('0x84')]&&_0x58e7ea['body'][_0x58ab('0xd1')]){_0x2f0e56=_0x58e7ea['body'][_0x58ab('0xd1')];return db['SmsMessage'][_0x58ab('0x59')]({'where':{'messageId':_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0x84')]}});}break;case'infobip':var _0x128a24=_0x58e7ea['body']['results'][0x0];if(_0x128a24['messageId']&&_0x128a24[_0x58ab('0x2d')][_0x58ab('0xd2')]===_0x58ab('0xd3')){_0x2f0e56=_0x128a24['status'][_0x58ab('0xd2')];return db[_0x58ab('0xa8')][_0x58ab('0x59')]({'where':{'messageId':_0x128a24[_0x58ab('0x7d')]}});}break;case _0x58ab('0x8c'):if(_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0x7d')]&&_0x58e7ea['body']['status']){_0x2f0e56=_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0x2d')];return db[_0x58ab('0xa8')][_0x58ab('0x59')]({'where':{'messageId':_0x58e7ea[_0x58ab('0x5b')]['messageId']}});}break;case _0x58ab('0x8f'):if(_0x58e7ea[_0x58ab('0x5b')][0x0][_0x58ab('0x2a')]['id']){_0x2f0e56=_0x58e7ea[_0x58ab('0x5b')][0x0]['type'];return db[_0x58ab('0xa8')][_0x58ab('0x59')]({'where':{'messageId':_0x58e7ea['body'][0x0]['message']['id']}});}break;case _0x58ab('0x90'):if(_0x58e7ea['body']['redif']&&_0x58e7ea['body']['status']){_0x2f0e56=_0x58e7ea[_0x58ab('0x5b')]['status'];return db[_0x58ab('0xa8')][_0x58ab('0x59')]({'where':{'messageId':_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0xd4')]}});}break;}}})[_0x58ab('0x21')](handleEntityNotFound(_0xb91e63,null))[_0x58ab('0x21')](function(_0x27af9d){if(_0x27af9d){_0x5a92a9=_0x27af9d;switch(_0x1694b4[_0x58ab('0x45')]){case _0x58ab('0x7f'):if(_0x2f0e56===_0x58ab('0xd3')){return _0x5a92a9['update']({'read':!![]});}else{logger['error'](_0x58ab('0x26'),_0x58ab('0x2d'),_0x58ab('0x7f'),util[_0x58ab('0xcd')](_0x58e7ea[_0x58ab('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x58ab('0x82'):if(_0x2f0e56==='1'){return _0x5a92a9[_0x58ab('0x61')]({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),_0x58ab('0x2d'),'skebby',util[_0x58ab('0xcd')](_0x58e7ea[_0x58ab('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x58ab('0x83'):if(!_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0xd5')]&&_0x2f0e56>=0xc8&&_0x2f0e56<=0xce){return _0x5a92a9[_0x58ab('0x61')]({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),_0x58ab('0x2d'),_0x58ab('0x83'),util[_0x58ab('0xcd')](_0x58e7ea['body'],{'showHidden':![],'depth':null}));}break;case _0x58ab('0x88'):var _0x5babeb=_0x58e7ea[_0x58ab('0x5b')][_0x58ab('0x89')][0x0];if(_0x5babeb[_0x58ab('0x2d')][_0x58ab('0xd2')]===_0x58ab('0xd3')){return _0x5a92a9[_0x58ab('0x61')]({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),_0x58ab('0x2d'),_0x58ab('0x88'),util[_0x58ab('0xcd')](_0x58e7ea[_0x58ab('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x58ab('0x8c'):if(_0x2f0e56==_0x58ab('0xd6')||_0x2f0e56==_0x58ab('0xd7')){return _0x5a92a9[_0x58ab('0x61')]({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),_0x58ab('0x2d'),'clickatell',util[_0x58ab('0xcd')](_0x58e7ea[_0x58ab('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x58ab('0x8f'):if(_0x2f0e56==_0x58ab('0xd8')){return _0x5a92a9[_0x58ab('0x61')]({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),_0x58ab('0x2d'),_0x58ab('0x8f'),util[_0x58ab('0xcd')](_0x58e7ea[_0x58ab('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x58ab('0x90'):if(_0x2f0e56===_0x58ab('0xd9')||_0x2f0e56==='ACCEPTD'){return _0x5a92a9['update']({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),_0x58ab('0x2d'),_0x58ab('0x90'),util[_0x58ab('0xcd')](_0x58e7ea[_0x58ab('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5a92a9;}})[_0x58ab('0x21')](respondWithResult(_0xb91e63,null))['catch'](handleError(_0xb91e63,null));};exports[_0x58ab('0xda')]=function(_0x2b675a,_0x1c2d29,_0x4a2bd7){var _0x2b13ae,_0x4713d7,_0x45a370;return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x2b675a[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x1c2d29,null))[_0x58ab('0x21')](function(_0x4ad61b){if(_0x4ad61b){_0x45a370=_0x4ad61b;logger['debug'](_0x58ab('0x26'),_0x58ab('0x2d'),'received\x20delivery\x20report\x20from',_0x4ad61b[_0x58ab('0x45')],util[_0x58ab('0xcd')](_0x2b675a[_0x58ab('0x47')],{'showHidden':![],'depth':null}));switch(_0x4ad61b[_0x58ab('0x45')]){case _0x58ab('0x8a'):if(_0x2b675a[_0x58ab('0x47')][_0x58ab('0xdb')]&&_0x2b675a[_0x58ab('0x47')]['state']){_0x4713d7=_0x2b675a[_0x58ab('0x47')][_0x58ab('0xdc')];return db[_0x58ab('0xa8')]['find']({'where':{'messageId':_0x2b675a[_0x58ab('0x47')][_0x58ab('0xdb')]}});}break;}}})[_0x58ab('0x21')](handleEntityNotFound(_0x1c2d29,null))[_0x58ab('0x21')](function(_0x48b09a){if(_0x48b09a){_0x2b13ae=_0x48b09a;switch(_0x45a370[_0x58ab('0x45')]){case _0x58ab('0x8a'):if(_0x4713d7==='2'||_0x4713d7==='6'){return _0x2b13ae[_0x58ab('0x61')]({'read':!![]});}else{logger[_0x58ab('0x28')](_0x58ab('0x26'),'status','csc',util[_0x58ab('0xcd')](_0x2b675a[_0x58ab('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x2b13ae;}})[_0x58ab('0x21')](respondWithResult(_0x1c2d29,null))['catch'](handleError(_0x1c2d29,null));};exports[_0x58ab('0xdd')]=function(_0x518ce0,_0x19f9f3,_0x4c1fe6){return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x518ce0[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x19f9f3,null))[_0x58ab('0x21')](function(_0x4656cf){if(_0x4656cf){return _0x4656cf[_0x58ab('0xdd')](_0x518ce0['body'][_0x58ab('0x6c')],_[_0x58ab('0x9d')](_0x518ce0[_0x58ab('0x5b')],['ids','id'])||{})[_0x58ab('0xca')](function(_0x4a0fcc){for(var _0x4ed0d9=0x0;_0x4ed0d9<_0x518ce0['body'][_0x58ab('0x6c')]['length'];_0x4ed0d9+=0x1){socket['emit'](_0x58ab('0xde'),{'UserId':Number(_0x518ce0[_0x58ab('0x5b')][_0x58ab('0x6c')][_0x4ed0d9]),'SmsAccountId':Number(_0x518ce0[_0x58ab('0x62')]['id'])});}return _0x4a0fcc;});}})[_0x58ab('0x21')](respondWithResult(_0x19f9f3,null))[_0x58ab('0x2c')](handleError(_0x19f9f3,null));};exports[_0x58ab('0xdf')]=function(_0x41c936,_0x3507da,_0x6e2ef3){return db[_0x58ab('0x42')][_0x58ab('0x59')]({'where':{'id':_0x41c936[_0x58ab('0x62')]['id']}})['then'](handleEntityNotFound(_0x3507da,null))[_0x58ab('0x21')](function(_0x1149ca){if(_0x1149ca){return _0x1149ca['removeAgents'](_0x41c936['query'][_0x58ab('0x6c')])[_0x58ab('0x21')](function(){if(_['isArray'](_0x41c936[_0x58ab('0x47')][_0x58ab('0x6c')])){for(var _0x4f5cbf=0x0;_0x4f5cbf<_0x41c936[_0x58ab('0x47')][_0x58ab('0x6c')][_0x58ab('0x57')];_0x4f5cbf+=0x1){socket[_0x58ab('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x41c936['query'][_0x58ab('0x6c')][_0x4f5cbf]),'SmsAccountId':Number(_0x41c936[_0x58ab('0x62')]['id'])});}}else{socket[_0x58ab('0xe0')](_0x58ab('0xe1'),{'UserId':Number(_0x41c936['query'][_0x58ab('0x6c')]),'SmsAccountId':Number(_0x41c936[_0x58ab('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x3507da,null))['catch'](handleError(_0x3507da,null));};exports[_0x58ab('0xe2')]=function(_0x5ab8ad,_0x3e5551,_0x267f9a){var _0x2b8159={};var _0x24eb8f={};var _0x1bd8fd;var _0xdaab5e;return db[_0x58ab('0x42')][_0x58ab('0x66')]({'where':{'id':_0x5ab8ad[_0x58ab('0x62')]['id']}})[_0x58ab('0x21')](handleEntityNotFound(_0x3e5551,null))[_0x58ab('0x21')](function(_0x38a4cc){if(_0x38a4cc){_0x1bd8fd=_0x38a4cc;_0x24eb8f['model']=_[_0x58ab('0x48')](db[_0x58ab('0xc1')]['rawAttributes']);_0x24eb8f[_0x58ab('0x47')]=_[_0x58ab('0x48')](_0x5ab8ad[_0x58ab('0x47')]);_0x24eb8f[_0x58ab('0x49')]=_[_0x58ab('0x4a')](_0x24eb8f[_0x58ab('0x4b')],_0x24eb8f[_0x58ab('0x47')]);_0x2b8159['attributes']=_[_0x58ab('0x4a')](_0x24eb8f[_0x58ab('0x4b')],qs[_0x58ab('0x56')](_0x5ab8ad[_0x58ab('0x47')][_0x58ab('0x56')]));_0x2b8159[_0x58ab('0x4c')]=_0x2b8159[_0x58ab('0x4c')][_0x58ab('0x57')]?_0x2b8159[_0x58ab('0x4c')]:_0x24eb8f[_0x58ab('0x4b')];_0x2b8159[_0x58ab('0x69')]=qs[_0x58ab('0x4d')](_0x5ab8ad[_0x58ab('0x47')][_0x58ab('0x4d')]);_0x2b8159[_0x58ab('0x4e')]=qs[_0x58ab('0x49')](_['pick'](_0x5ab8ad[_0x58ab('0x47')],_0x24eb8f[_0x58ab('0x49')]));if(_0x5ab8ad['query'][_0x58ab('0x52')]){_0x2b8159[_0x58ab('0x4e')]=_[_0x58ab('0x50')](_0x2b8159[_0x58ab('0x4e')],{'$or':_['map'](_0x2b8159[_0x58ab('0x4c')],function(_0xd4f728){var _0xadba1b={};_0xadba1b[_0xd4f728]={'$like':'%'+_0x5ab8ad[_0x58ab('0x47')]['filter']+'%'};return _0xadba1b;})});}_0x2b8159=_[_0x58ab('0x50')]({},_0x2b8159,_0x5ab8ad[_0x58ab('0x53')]);return _0x1bd8fd[_0x58ab('0xe2')](_0x2b8159);}})[_0x58ab('0x21')](function(_0x5688c3){if(_0x5688c3){_0xdaab5e=_0x5688c3[_0x58ab('0x57')];if(!_0x5ab8ad[_0x58ab('0x47')][_0x58ab('0x67')](_0x58ab('0x68'))){_0x2b8159[_0x58ab('0x30')]=qs[_0x58ab('0x30')](_0x5ab8ad[_0x58ab('0x47')][_0x58ab('0x30')]);_0x2b8159['offset']=qs[_0x58ab('0x32')](_0x5ab8ad[_0x58ab('0x47')][_0x58ab('0x32')]);}return _0x1bd8fd[_0x58ab('0xe2')](_0x2b8159);}})['then'](function(_0x48a125){if(_0x48a125){return _0x48a125?{'count':_0xdaab5e,'rows':_0x48a125}:null;}})[_0x58ab('0x21')](respondWithResult(_0x3e5551,null))[_0x58ab('0x2c')](handleError(_0x3e5551,null));}; \ No newline at end of file +var _0xf4c6=['removeAnswers','notify','SmsApplication','account','applications','Applications','priority','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','MessageSid','skebby','from','sender','text','connectel','clicksend','messageId','message_id','plivo','infobip','results','csc','originatingAddress','segmentedMessage','bandwidth','refid','isNil','from\x20is\x20mandatory','mapKey','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Contact','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','inspect','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','rows','show','includeAll','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','SmsAccountId','getDispositions','findOne','Disposition','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers'];(function(_0x20a726,_0x1af270){var _0x3ee0b6=function(_0x353c54){while(--_0x353c54){_0x20a726['push'](_0x20a726['shift']());}};_0x3ee0b6(++_0x1af270);}(_0xf4c6,0x6d));var _0x6f4c=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0xf4c6[_0x210718];return _0x541bfc;};'use strict';var emlformat=require(_0x6f4c('0x0'));var rimraf=require(_0x6f4c('0x1'));var zipdir=require(_0x6f4c('0x2'));var jsonpatch=require(_0x6f4c('0x3'));var rp=require('request-promise');var moment=require(_0x6f4c('0x4'));var BPromise=require(_0x6f4c('0x5'));var Mustache=require(_0x6f4c('0x6'));var util=require(_0x6f4c('0x7'));var path=require(_0x6f4c('0x8'));var sox=require(_0x6f4c('0x9'));var csv=require(_0x6f4c('0xa'));var ejs=require(_0x6f4c('0xb'));var fs=require('fs');var fs_extra=require(_0x6f4c('0xc'));var _=require(_0x6f4c('0xd'));var squel=require(_0x6f4c('0xe'));var crypto=require(_0x6f4c('0xf'));var jsforce=require(_0x6f4c('0x10'));var deskjs=require(_0x6f4c('0x11'));var toCsv=require(_0x6f4c('0xa'));var querystring=require('querystring');var Papa=require(_0x6f4c('0x12'));var Redis=require(_0x6f4c('0x13'));var authService=require(_0x6f4c('0x14'));var qs=require(_0x6f4c('0x15'));var as=require(_0x6f4c('0x16'));var hardwareService=require(_0x6f4c('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x6f4c('0x18'));var config=require(_0x6f4c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f4c('0x1a'))['db'];config[_0x6f4c('0x1b')]=_[_0x6f4c('0x1c')](config['redis'],{'host':_0x6f4c('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f4c('0x1b')]));require(_0x6f4c('0x1e'))['register'](socket);var jayson=require(_0x6f4c('0x1f'));var client=jayson[_0x6f4c('0x20')][_0x6f4c('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x222075,_0x28f26d,_0x13aed1,_0x373acf){return new BPromise(function(_0xe20fe3,_0x209b5b){var _0x16b66e=_0x373acf||client;return _0x16b66e[_0x6f4c('0x22')](_0x222075,_0x13aed1)[_0x6f4c('0x23')](function(_0x4a1f5e){logger[_0x6f4c('0x24')](_0x6f4c('0x25'),_0x28f26d,_0x6f4c('0x26'));logger[_0x6f4c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x28f26d,_0x6f4c('0x26'),JSON[_0x6f4c('0x28')](_0x4a1f5e));if(_0x4a1f5e['error']){if(_0x4a1f5e[_0x6f4c('0x29')][_0x6f4c('0x2a')]===0x1f4){logger[_0x6f4c('0x29')]('SmsAccount,\x20%s,\x20%s',_0x28f26d,_0x4a1f5e[_0x6f4c('0x29')]['message']);return _0x209b5b(_0x4a1f5e[_0x6f4c('0x29')][_0x6f4c('0x2b')]);}logger[_0x6f4c('0x29')](_0x6f4c('0x25'),_0x28f26d,_0x4a1f5e[_0x6f4c('0x29')][_0x6f4c('0x2b')]);return _0xe20fe3(_0x4a1f5e[_0x6f4c('0x29')]['message']);}else{logger['info'](_0x6f4c('0x25'),_0x28f26d,_0x6f4c('0x26'));_0xe20fe3(_0x4a1f5e[_0x6f4c('0x2c')][_0x6f4c('0x2b')]);}})[_0x6f4c('0x2d')](function(_0x320caa){logger['error'](_0x6f4c('0x25'),_0x28f26d,_0x320caa);_0x209b5b(_0x320caa);});});}function respondWithStatusCode(_0x1c9bd3,_0x3fe03d){_0x3fe03d=_0x3fe03d||0xcc;return function(_0x138f3b){if(_0x138f3b){return _0x1c9bd3[_0x6f4c('0x2e')](_0x3fe03d);}return _0x1c9bd3[_0x6f4c('0x2f')](_0x3fe03d)[_0x6f4c('0x30')]();};}function respondWithResult(_0x4e4be2,_0x19813e){_0x19813e=_0x19813e||0xc8;return function(_0xe70f4c){if(_0xe70f4c){return _0x4e4be2[_0x6f4c('0x2f')](_0x19813e)[_0x6f4c('0x31')](_0xe70f4c);}};}function respondWithFilteredResult(_0x44c7ec,_0x4450b1){return function(_0x463116){if(_0x463116){var _0x30dfaf=typeof _0x4450b1[_0x6f4c('0x32')]==='undefined'&&typeof _0x4450b1[_0x6f4c('0x33')]===_0x6f4c('0x34');var _0x4bfb4f=_0x463116[_0x6f4c('0x35')];var _0x352ada=_0x30dfaf?0x0:_0x4450b1[_0x6f4c('0x32')];var _0x49261e=_0x30dfaf?_0x463116[_0x6f4c('0x35')]:_0x4450b1['offset']+_0x4450b1['limit'];var _0x298952;if(_0x49261e>=_0x4bfb4f){_0x49261e=_0x4bfb4f;_0x298952=0xc8;}else{_0x298952=0xce;}_0x44c7ec[_0x6f4c('0x2f')](_0x298952);return _0x44c7ec[_0x6f4c('0x36')]('Content-Range',_0x352ada+'-'+_0x49261e+'/'+_0x4bfb4f)[_0x6f4c('0x31')](_0x463116);}return null;};}function patchUpdates(_0x4f00b6){return function(_0x3bdd41){try{jsonpatch[_0x6f4c('0x37')](_0x3bdd41,_0x4f00b6,!![]);}catch(_0x120546){return BPromise['reject'](_0x120546);}return _0x3bdd41[_0x6f4c('0x38')]();};}function saveUpdates(_0xf03f2d,_0x431fb9){return function(_0x55c2dc){if(_0x55c2dc){return _0x55c2dc[_0x6f4c('0x39')](_0xf03f2d)[_0x6f4c('0x23')](function(_0x57a37b){return _0x57a37b;});}return null;};}function removeEntity(_0x13fb0d,_0x31ac15){return function(_0x30970b){if(_0x30970b){return _0x30970b[_0x6f4c('0x3a')]()[_0x6f4c('0x23')](function(){var _0x4e0d95=_0x30970b[_0x6f4c('0x3b')]({'plain':!![]});var _0x8ef858=_0x6f4c('0x3c');return db[_0x6f4c('0x3d')]['destroy']({'where':{'type':_0x8ef858,'resourceId':_0x4e0d95['id']}})[_0x6f4c('0x23')](function(){return _0x30970b;});})[_0x6f4c('0x23')](function(){_0x13fb0d[_0x6f4c('0x2f')](0xcc)[_0x6f4c('0x30')]();});}};}function handleEntityNotFound(_0xb89002,_0x24ce26){return function(_0x2580b4){if(!_0x2580b4){_0xb89002[_0x6f4c('0x2e')](0x194);}return _0x2580b4;};}function handleError(_0x1296fd,_0x1ca574){_0x1ca574=_0x1ca574||0x1f4;return function(_0x5a4624){logger[_0x6f4c('0x29')](_0x5a4624['stack']);if(_0x5a4624['name']){delete _0x5a4624[_0x6f4c('0x3e')];}_0x1296fd[_0x6f4c('0x2f')](_0x1ca574)[_0x6f4c('0x3f')](_0x5a4624);};}exports['index']=function(_0x5817ba,_0x58e2e5){var _0x11e5e7={'include':[{'model':db[_0x6f4c('0x40')],'as':_0x6f4c('0x41')}]},_0x30c000={},_0x4a16b2={'count':0x0,'rows':[]};var _0x3e2362=_[_0x6f4c('0x42')](db[_0x6f4c('0x43')][_0x6f4c('0x44')],function(_0x1d326a){return{'name':_0x1d326a[_0x6f4c('0x45')],'type':_0x1d326a['type'][_0x6f4c('0x46')]};});_0x30c000['model']=_[_0x6f4c('0x42')](_0x3e2362,_0x6f4c('0x3e'));_0x30c000[_0x6f4c('0x47')]=_[_0x6f4c('0x48')](_0x5817ba['query']);_0x30c000[_0x6f4c('0x49')]=_[_0x6f4c('0x4a')](_0x30c000[_0x6f4c('0x4b')],_0x30c000[_0x6f4c('0x47')]);_0x11e5e7[_0x6f4c('0x4c')]=_[_0x6f4c('0x4a')](_0x30c000[_0x6f4c('0x4b')],qs[_0x6f4c('0x4d')](_0x5817ba[_0x6f4c('0x47')]['fields']));_0x11e5e7['attributes']=_0x11e5e7[_0x6f4c('0x4c')][_0x6f4c('0x4e')]?_0x11e5e7[_0x6f4c('0x4c')]:_0x30c000[_0x6f4c('0x4b')];if(!_0x5817ba[_0x6f4c('0x47')][_0x6f4c('0x4f')](_0x6f4c('0x50'))){_0x11e5e7[_0x6f4c('0x33')]=qs[_0x6f4c('0x33')](_0x5817ba[_0x6f4c('0x47')][_0x6f4c('0x33')]);_0x11e5e7['offset']=qs[_0x6f4c('0x32')](_0x5817ba[_0x6f4c('0x47')][_0x6f4c('0x32')]);}_0x11e5e7[_0x6f4c('0x51')]=qs[_0x6f4c('0x52')](_0x5817ba['query'][_0x6f4c('0x52')]);_0x11e5e7[_0x6f4c('0x53')]=qs[_0x6f4c('0x49')](_['pick'](_0x5817ba[_0x6f4c('0x47')],_0x30c000[_0x6f4c('0x49')]),_0x3e2362);if(_0x5817ba['query'][_0x6f4c('0x54')]){_0x11e5e7[_0x6f4c('0x53')]=_['merge'](_0x11e5e7[_0x6f4c('0x53')],{'$or':_[_0x6f4c('0x42')](_0x3e2362,function(_0x6ee231){if(_0x6ee231[_0x6f4c('0x55')]!==_0x6f4c('0x56')){var _0x2fd923={};_0x2fd923[_0x6ee231[_0x6f4c('0x3e')]]={'$like':'%'+_0x5817ba['query'][_0x6f4c('0x54')]+'%'};return _0x2fd923;}})});}_0x11e5e7=_[_0x6f4c('0x57')]({},_0x11e5e7,_0x5817ba[_0x6f4c('0x58')]);var _0x37c34c={'where':_0x11e5e7[_0x6f4c('0x53')]};return db['SmsAccount']['count'](_0x37c34c)[_0x6f4c('0x23')](function(_0x512132){_0x4a16b2[_0x6f4c('0x35')]=_0x512132;if(_0x5817ba[_0x6f4c('0x47')]['includeAll']){_0x11e5e7[_0x6f4c('0x59')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x11e5e7);})[_0x6f4c('0x23')](function(_0x3e29ce){_0x4a16b2[_0x6f4c('0x5a')]=_0x3e29ce;return _0x4a16b2;})[_0x6f4c('0x23')](respondWithFilteredResult(_0x58e2e5,_0x11e5e7))[_0x6f4c('0x2d')](handleError(_0x58e2e5,null));};exports[_0x6f4c('0x5b')]=function(_0x4358db,_0x5f44ce){var _0x23d71d={'raw':![],'where':{'id':_0x4358db['params']['id']},'include':[{'model':db['Pause'],'as':_0x6f4c('0x41')}]},_0x20fc52={};_0x20fc52['model']=_['keys'](db['SmsAccount'][_0x6f4c('0x44')]);_0x20fc52['query']=_[_0x6f4c('0x48')](_0x4358db[_0x6f4c('0x47')]);_0x20fc52[_0x6f4c('0x49')]=_['intersection'](_0x20fc52[_0x6f4c('0x4b')],_0x20fc52['query']);_0x23d71d[_0x6f4c('0x4c')]=_[_0x6f4c('0x4a')](_0x20fc52[_0x6f4c('0x4b')],qs[_0x6f4c('0x4d')](_0x4358db['query'][_0x6f4c('0x4d')]));_0x23d71d['attributes']=_0x23d71d[_0x6f4c('0x4c')][_0x6f4c('0x4e')]?_0x23d71d[_0x6f4c('0x4c')]:_0x20fc52['model'];if(_0x4358db[_0x6f4c('0x47')][_0x6f4c('0x5c')]){_0x23d71d[_0x6f4c('0x59')]=[{'all':!![]}];}_0x23d71d=_[_0x6f4c('0x57')]({},_0x23d71d,_0x4358db['options']);return db['SmsAccount'][_0x6f4c('0x5d')](_0x23d71d)[_0x6f4c('0x23')](handleEntityNotFound(_0x5f44ce,null))['then'](respondWithResult(_0x5f44ce,null))[_0x6f4c('0x2d')](handleError(_0x5f44ce,null));};exports[_0x6f4c('0x5e')]=function(_0x333840,_0x5d1c1e){return db[_0x6f4c('0x43')]['create'](_0x333840[_0x6f4c('0x5f')],{})[_0x6f4c('0x23')](function(_0x411e1b){var _0x2ba3eb=_0x333840[_0x6f4c('0x60')]['get']({'plain':!![]});if(!_0x2ba3eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ba3eb[_0x6f4c('0x61')]===_0x6f4c('0x60')){var _0x31380b=_0x411e1b[_0x6f4c('0x3b')]({'plain':!![]});var _0x7f474=_0x6f4c('0x3c');return db['UserProfileSection'][_0x6f4c('0x5d')]({'where':{'name':_0x7f474,'userProfileId':_0x2ba3eb[_0x6f4c('0x62')]},'raw':!![]})['then'](function(_0x1bc3f9){if(_0x1bc3f9&&_0x1bc3f9['autoAssociation']===0x0){return db[_0x6f4c('0x3d')]['create']({'name':_0x31380b[_0x6f4c('0x3e')],'resourceId':_0x31380b['id'],'type':_0x1bc3f9[_0x6f4c('0x3e')],'sectionId':_0x1bc3f9['id']},{})[_0x6f4c('0x23')](function(){return _0x411e1b;});}else{return _0x411e1b;}})[_0x6f4c('0x2d')](function(_0x1d74f1){logger[_0x6f4c('0x29')](_0x6f4c('0x63'),_0x1d74f1);throw _0x1d74f1;});}return _0x411e1b;})['then'](respondWithResult(_0x5d1c1e,0xc9))[_0x6f4c('0x2d')](handleError(_0x5d1c1e,null));};exports[_0x6f4c('0x39')]=function(_0x31c57c,_0xbc7840){if(_0x31c57c[_0x6f4c('0x5f')]['id']){delete _0x31c57c['body']['id'];}return db[_0x6f4c('0x43')]['find']({'where':{'id':_0x31c57c['params']['id']},'include':[{'model':db[_0x6f4c('0x40')],'as':_0x6f4c('0x41')}]})[_0x6f4c('0x23')](handleEntityNotFound(_0xbc7840,null))[_0x6f4c('0x23')](saveUpdates(_0x31c57c[_0x6f4c('0x5f')],null))[_0x6f4c('0x23')](respondWithResult(_0xbc7840,null))[_0x6f4c('0x2d')](handleError(_0xbc7840,null));};exports[_0x6f4c('0x3a')]=function(_0x3f6b1e,_0x172f6d){return db[_0x6f4c('0x43')][_0x6f4c('0x5d')]({'where':{'id':_0x3f6b1e['params']['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x172f6d,null))['then'](removeEntity(_0x172f6d,null))[_0x6f4c('0x2d')](handleError(_0x172f6d,null));};exports['describe']=function(_0x25e6ff,_0x4d51bc){return db['SmsAccount']['describe']()[_0x6f4c('0x23')](respondWithResult(_0x4d51bc,null))[_0x6f4c('0x2d')](handleError(_0x4d51bc,null));};exports['addDisposition']=function(_0x149d4d,_0x53f385,_0x1d10ce){if(_0x149d4d['body']['id']){delete _0x149d4d['body']['id'];}return db[_0x6f4c('0x43')][_0x6f4c('0x5d')]({'where':{'id':_0x149d4d[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x53f385,null))['then'](function(_0x119651){if(_0x119651){_0x149d4d[_0x6f4c('0x5f')][_0x6f4c('0x65')]=_0x119651['id'];return db['Disposition'][_0x6f4c('0x5e')](_0x149d4d[_0x6f4c('0x5f')]);}})[_0x6f4c('0x23')](respondWithResult(_0x53f385,null))[_0x6f4c('0x2d')](handleError(_0x53f385,null));};exports[_0x6f4c('0x66')]=function(_0x94ef0b,_0xc39b80,_0x67c9ef){var _0x838def={'raw':![],'where':{}};var _0x37e825={};var _0x38fde7={'count':0x0,'rows':[]};return db[_0x6f4c('0x43')][_0x6f4c('0x67')]({'where':{'id':_0x94ef0b[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0xc39b80,null))[_0x6f4c('0x23')](function(_0x5cd1a5){if(_0x5cd1a5){_0x37e825['model']=_['keys'](db[_0x6f4c('0x68')][_0x6f4c('0x44')]);_0x37e825[_0x6f4c('0x47')]=_['keys'](_0x94ef0b[_0x6f4c('0x47')]);_0x37e825['filters']=_[_0x6f4c('0x4a')](_0x37e825[_0x6f4c('0x4b')],_0x37e825[_0x6f4c('0x47')]);_0x838def[_0x6f4c('0x4c')]=_['intersection'](_0x37e825[_0x6f4c('0x4b')],qs[_0x6f4c('0x4d')](_0x94ef0b[_0x6f4c('0x47')]['fields']));_0x838def[_0x6f4c('0x4c')]=_0x838def['attributes'][_0x6f4c('0x4e')]?_0x838def[_0x6f4c('0x4c')]:_0x37e825[_0x6f4c('0x4b')];if(!_0x94ef0b[_0x6f4c('0x47')]['hasOwnProperty'](_0x6f4c('0x50'))){_0x838def[_0x6f4c('0x33')]=qs[_0x6f4c('0x33')](_0x94ef0b[_0x6f4c('0x47')][_0x6f4c('0x33')]);_0x838def['offset']=qs[_0x6f4c('0x32')](_0x94ef0b['query'][_0x6f4c('0x32')]);}_0x838def[_0x6f4c('0x51')]=qs['sort'](_0x94ef0b[_0x6f4c('0x47')][_0x6f4c('0x52')]);_0x838def['where']=qs['filters'](_[_0x6f4c('0x69')](_0x94ef0b[_0x6f4c('0x47')],_0x37e825['filters']));_0x838def['where'][_0x6f4c('0x65')]=_0x5cd1a5['id'];if(_0x94ef0b[_0x6f4c('0x47')][_0x6f4c('0x54')]){_0x838def[_0x6f4c('0x53')]=_[_0x6f4c('0x57')](_0x838def[_0x6f4c('0x53')],{'$or':_['map'](_0x838def[_0x6f4c('0x4c')],function(_0x93427e){var _0x12c87e={};_0x12c87e[_0x93427e]={'$like':'%'+_0x94ef0b[_0x6f4c('0x47')][_0x6f4c('0x54')]+'%'};return _0x12c87e;})});}_0x838def=_['merge']({},_0x838def,_0x94ef0b[_0x6f4c('0x58')]);return db[_0x6f4c('0x68')][_0x6f4c('0x35')]({'where':_0x838def[_0x6f4c('0x53')]})[_0x6f4c('0x23')](function(_0x41986f){_0x38fde7[_0x6f4c('0x35')]=_0x41986f;if(_0x94ef0b['query'][_0x6f4c('0x5c')]){_0x838def[_0x6f4c('0x59')]=[{'all':!![]}];}return db[_0x6f4c('0x68')][_0x6f4c('0x6a')](_0x838def);})['then'](function(_0x345643){_0x38fde7[_0x6f4c('0x5a')]=_0x345643;return _0x38fde7;});}})[_0x6f4c('0x23')](respondWithFilteredResult(_0xc39b80,_0x838def))[_0x6f4c('0x2d')](handleError(_0xc39b80,null));};exports[_0x6f4c('0x6b')]=function(_0x1a0f36,_0xdeb439,_0x598c24){return db[_0x6f4c('0x43')][_0x6f4c('0x5d')]({'where':{'id':_0x1a0f36[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0xdeb439,null))['then'](function(_0x5154c5){if(_0x5154c5){return _0x5154c5[_0x6f4c('0x6b')](_0x1a0f36[_0x6f4c('0x47')][_0x6f4c('0x6c')]);}})[_0x6f4c('0x23')](respondWithStatusCode(_0xdeb439,null))['catch'](handleError(_0xdeb439,null));};exports[_0x6f4c('0x6d')]=function(_0x17c63b,_0x3c3033,_0x25f9ff){if(_0x17c63b['body']['id']){delete _0x17c63b[_0x6f4c('0x5f')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x17c63b[_0x6f4c('0x64')]['id']}})['then'](handleEntityNotFound(_0x3c3033,null))[_0x6f4c('0x23')](function(_0x1e3afd){if(_0x1e3afd){_0x17c63b[_0x6f4c('0x5f')][_0x6f4c('0x65')]=_0x1e3afd['id'];return db[_0x6f4c('0x6e')][_0x6f4c('0x5e')](_0x17c63b[_0x6f4c('0x5f')]);}})[_0x6f4c('0x23')](respondWithResult(_0x3c3033,null))[_0x6f4c('0x2d')](handleError(_0x3c3033,null));};exports[_0x6f4c('0x6f')]=function(_0x12f688,_0x559db3,_0x159f7e){var _0x3aaa61={'raw':![],'where':{}};var _0x4b48de={};var _0x48b3f0={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6f4c('0x67')]({'where':{'id':_0x12f688[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x559db3,null))[_0x6f4c('0x23')](function(_0x3633c6){if(_0x3633c6){_0x4b48de[_0x6f4c('0x4b')]=_[_0x6f4c('0x48')](db[_0x6f4c('0x6e')][_0x6f4c('0x44')]);_0x4b48de[_0x6f4c('0x47')]=_[_0x6f4c('0x48')](_0x12f688['query']);_0x4b48de['filters']=_[_0x6f4c('0x4a')](_0x4b48de[_0x6f4c('0x4b')],_0x4b48de[_0x6f4c('0x47')]);_0x3aaa61[_0x6f4c('0x4c')]=_[_0x6f4c('0x4a')](_0x4b48de['model'],qs[_0x6f4c('0x4d')](_0x12f688[_0x6f4c('0x47')][_0x6f4c('0x4d')]));_0x3aaa61[_0x6f4c('0x4c')]=_0x3aaa61[_0x6f4c('0x4c')][_0x6f4c('0x4e')]?_0x3aaa61[_0x6f4c('0x4c')]:_0x4b48de[_0x6f4c('0x4b')];if(!_0x12f688['query']['hasOwnProperty']('nolimit')){_0x3aaa61['limit']=qs[_0x6f4c('0x33')](_0x12f688[_0x6f4c('0x47')][_0x6f4c('0x33')]);_0x3aaa61[_0x6f4c('0x32')]=qs['offset'](_0x12f688[_0x6f4c('0x47')]['offset']);}_0x3aaa61[_0x6f4c('0x51')]=qs[_0x6f4c('0x52')](_0x12f688[_0x6f4c('0x47')][_0x6f4c('0x52')]);_0x3aaa61[_0x6f4c('0x53')]=qs[_0x6f4c('0x49')](_[_0x6f4c('0x69')](_0x12f688[_0x6f4c('0x47')],_0x4b48de[_0x6f4c('0x49')]));_0x3aaa61[_0x6f4c('0x53')][_0x6f4c('0x65')]=_0x3633c6['id'];if(_0x12f688[_0x6f4c('0x47')][_0x6f4c('0x54')]){_0x3aaa61[_0x6f4c('0x53')]=_[_0x6f4c('0x57')](_0x3aaa61[_0x6f4c('0x53')],{'$or':_[_0x6f4c('0x42')](_0x3aaa61[_0x6f4c('0x4c')],function(_0x1591b4){var _0x43bd4e={};_0x43bd4e[_0x1591b4]={'$like':'%'+_0x12f688[_0x6f4c('0x47')][_0x6f4c('0x54')]+'%'};return _0x43bd4e;})});}_0x3aaa61=_[_0x6f4c('0x57')]({},_0x3aaa61,_0x12f688[_0x6f4c('0x58')]);return db['CannedAnswer'][_0x6f4c('0x35')]({'where':_0x3aaa61[_0x6f4c('0x53')]})['then'](function(_0x27550d){_0x48b3f0[_0x6f4c('0x35')]=_0x27550d;if(_0x12f688['query'][_0x6f4c('0x5c')]){_0x3aaa61[_0x6f4c('0x59')]=[{'all':!![]}];}return db[_0x6f4c('0x6e')][_0x6f4c('0x6a')](_0x3aaa61);})[_0x6f4c('0x23')](function(_0x51d194){_0x48b3f0[_0x6f4c('0x5a')]=_0x51d194;return _0x48b3f0;});}})[_0x6f4c('0x23')](respondWithFilteredResult(_0x559db3,_0x3aaa61))[_0x6f4c('0x2d')](handleError(_0x559db3,null));};exports[_0x6f4c('0x70')]=function(_0x1dbe9e,_0x1b9ffa,_0x1c8e1c){return db['SmsAccount'][_0x6f4c('0x5d')]({'where':{'id':_0x1dbe9e[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x1b9ffa,null))[_0x6f4c('0x23')](function(_0x1b5bd2){if(_0x1b5bd2){return _0x1b5bd2['removeAnswers'](_0x1dbe9e[_0x6f4c('0x47')][_0x6f4c('0x6c')]);}})[_0x6f4c('0x23')](respondWithStatusCode(_0x1b9ffa,null))[_0x6f4c('0x2d')](handleError(_0x1b9ffa,null));};exports[_0x6f4c('0x71')]=function(_0x347a6f,_0x1c0a71,_0x1e1052){var _0xb09074={'channel':'sms'};var _0x26e800=[];var _0x48a7d0=[];var _0x38a3ab={};return db['SmsAccount'][_0x6f4c('0x5d')]({'where':{'id':_0x347a6f[_0x6f4c('0x64')]['id']},'include':[{'model':db[_0x6f4c('0x72')],'as':'Applications'}]})[_0x6f4c('0x23')](handleEntityNotFound(_0x1c0a71,null))[_0x6f4c('0x23')](function(_0x10cb85){_0xb09074[_0x6f4c('0x73')]=_0x10cb85;_0xb09074[_0x6f4c('0x74')]=_['orderBy'](_0x10cb85[_0x6f4c('0x75')],[_0x6f4c('0x76')],['asc']);if(_0xb09074[_0x6f4c('0x73')]['Applications']){delete _0xb09074[_0x6f4c('0x73')][_0x6f4c('0x75')];}return db[_0x6f4c('0x77')][_0x6f4c('0x78')]();})[_0x6f4c('0x23')](function(_0x590009){if(!_0x590009){throw new db[(_0x6f4c('0x79'))][(_0x6f4c('0x7a'))](_0x6f4c('0x7b'));}_0x26e800=_[_0x6f4c('0x7c')](_[_0x6f4c('0x48')](_0x590009),[_0x6f4c('0x7d'),'updatedAt']);_0x48a7d0=_['difference'](_[_0x6f4c('0x48')](_0x590009),[_0x6f4c('0x7d'),_0x6f4c('0x7e'),'CompanyId',_0x6f4c('0x7f')]);_0xb09074[_0x6f4c('0x5f')]={'mapKey':_0x6f4c('0x80')};if(_0xb09074[_0x6f4c('0x73')][_0x6f4c('0x55')]){switch(_0xb09074[_0x6f4c('0x73')][_0x6f4c('0x55')]){case _0x6f4c('0x81'):_0xb09074[_0x6f4c('0x5f')]['from']=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x82')];_0xb09074['body'][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')]['Body'];_0xb09074[_0x6f4c('0x5f')]['messageId']=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x83')];break;case _0x6f4c('0x84'):_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')]='+'+_0x347a6f['body'][_0x6f4c('0x86')];_0xb09074['body'][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x87')];break;case _0x6f4c('0x88'):_0xb09074[_0x6f4c('0x5f')]['from']=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x85')];_0xb09074['body'][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x2b')];break;case _0x6f4c('0x89'):_0xb09074['body'][_0x6f4c('0x85')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x85')];_0xb09074['body'][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x5f')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x8a')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x8b')];break;case _0x6f4c('0x8c'):_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')]=_0x347a6f['body'][_0x6f4c('0x82')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')]['Text'];_0xb09074['body']['messageId']=_0x347a6f[_0x6f4c('0x5f')]['MessageUUID'];break;case _0x6f4c('0x8d'):_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')]='+'+_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x8e')][0x0][_0x6f4c('0x85')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x8e')][0x0]['text'];_0xb09074[_0x6f4c('0x5f')]['messageId']=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x8e')][0x0][_0x6f4c('0x8a')];break;case _0x6f4c('0x8f'):_0xb09074['body']['from']=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x90')];_0xb09074['body'][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x91')][_0x6f4c('0x2b')];break;case'clickatell':_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')]=_0x347a6f[_0x6f4c('0x5f')]['fromNumber'];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x87')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x8a')]=_0x347a6f['body']['replyMessageId'];break;case _0x6f4c('0x92'):_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x8a')]=_0x347a6f[_0x6f4c('0x5f')][0x0]['message']['id'];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')]=_0x347a6f[_0x6f4c('0x5f')][0x0][_0x6f4c('0x2b')][_0x6f4c('0x85')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][0x0]['message'][_0x6f4c('0x87')];break;case'intelepeer':_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')]=_0x347a6f['body'][_0x6f4c('0x85')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x2b')];_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x8a')]=_0x347a6f[_0x6f4c('0x5f')][_0x6f4c('0x93')];break;}}if(_0xb09074[_0x6f4c('0x5f')]['id']){delete _0xb09074[_0x6f4c('0x5f')]['id'];}if(_[_0x6f4c('0x94')](_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')])){throw new db[(_0x6f4c('0x79'))][(_0x6f4c('0x7a'))](_0x6f4c('0x95'));}if(_['isNil'](_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')])||_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x5f')]===''){throw new db[(_0x6f4c('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6f4c('0x94')](_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x96')])){throw new db[(_0x6f4c('0x79'))][(_0x6f4c('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48a7d0);}if(!_['includes'](_0x48a7d0,_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x96')])){throw new db[(_0x6f4c('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48a7d0);}_0x38a3ab[_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x96')]]=_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')];return db[_0x6f4c('0x97')][_0x6f4c('0x5d')]({'where':{'id':_0xb09074[_0x6f4c('0x73')][_0x6f4c('0x7f')]},'include':[{'model':db['CmContact'],'as':_0x6f4c('0x98'),'where':_0x38a3ab,'limit':0x1,'order':[['updatedAt',_0x6f4c('0x99')]]}]});})[_0x6f4c('0x23')](handleEntityNotFound(_0x1c0a71,null))['then'](function(_0x2bae3e){if(_0x2bae3e){_0xb09074['list']=_[_0x6f4c('0x9a')](_0x2bae3e,['Contacts']);if(_0x2bae3e[_0x6f4c('0x98')][_0x6f4c('0x4e')]){return _0x2bae3e[_0x6f4c('0x98')][0x0];}var _0x51776=_[_0x6f4c('0x1c')](_0xb09074[_0x6f4c('0x5f')],{'firstName':_0xb09074[_0x6f4c('0x5f')]['from'],'ListId':_0x2bae3e['id']});_0x51776[_0xb09074[_0x6f4c('0x5f')]['mapKey']]=_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')];return db[_0x6f4c('0x77')]['create'](_0x51776,{'fields':_0x26e800,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c0a71,null))[_0x6f4c('0x23')](function(_0x5e1372){if(_0x5e1372){_0xb09074[_0x6f4c('0x9b')]=_0x5e1372;var _0x5a4ce5={'ContactId':_0x5e1372['id'],'phone':_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')],'SmsAccountId':_0x347a6f[_0x6f4c('0x64')]['id']};var _0x3c8f4a={'ContactId':_0x5e1372['id'],'SmsAccountId':_0x347a6f[_0x6f4c('0x64')]['id'],'closed':![]};return db[_0x6f4c('0x9c')]['find']({'where':_0x3c8f4a})[_0x6f4c('0x23')](function(_0x2b00b8){if(_0x2b00b8){return[_0x2b00b8,![]];}return db[_0x6f4c('0x9c')][_0x6f4c('0x5e')](_0x5a4ce5)[_0x6f4c('0x23')](function(_0x1d90da){return[_0x1d90da,!![]];});});}})[_0x6f4c('0x9d')](function(_0x414993,_0x3713c0){_0xb09074[_0x6f4c('0x9e')]=_0x414993[_0x6f4c('0x3b')]({'plain':!![]});_0xb09074[_0x6f4c('0x9e')][_0x6f4c('0x9f')]=![];if(_0x3713c0){if(_0xb09074['account'][_0x6f4c('0xa0')]){_0xb09074[_0x6f4c('0x74')][_0x6f4c('0xa1')]({'id':0x0,'priority':_0xb09074['applications'][_0x6f4c('0x4e')]+0x1,'app':'close','appdata':_0x6f4c('0xa2'),'interval':_0x6f4c('0xa3')});}_0xb09074['interaction'][_0x6f4c('0x9f')]=!![];}return db['SmsMessage']['create']({'phone':_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0x85')],'messageId':_0xb09074['body']['messageId'],'body':_0xb09074['body']['body'],'SmsAccountId':_0x347a6f[_0x6f4c('0x64')]['id'],'SmsInteractionId':_0x414993['id'],'direction':'in','ContactId':_0x414993['ContactId'],'AttachmentId':_0xb09074[_0x6f4c('0x5f')][_0x6f4c('0xa4')]});})[_0x6f4c('0x23')](function(_0x276847){_0xb09074[_0x6f4c('0x2b')]=_0x276847;if(_0xb09074[_0x6f4c('0x9e')][_0x6f4c('0xa5')]){return db[_0x6f4c('0xa6')]['find']({'attributes':['id',_0x6f4c('0x3e')],'where':{'id':_0xb09074['interaction']['UserId']}})[_0x6f4c('0x23')](function(_0x311acc){if(_0x311acc){_0xb09074[_0x6f4c('0x74')][_0x6f4c('0xa7')]({'id':0x0,'priority':0x0,'app':_0x6f4c('0xa8'),'appdata':_0x311acc[_0x6f4c('0x3e')]+','+(_0xb09074[_0x6f4c('0x73')][_0x6f4c('0xa9')]||0xa),'interval':_0x6f4c('0xa3')});}return respondWithRpcPromise('Start',_0x6f4c('0xaa'),_0xb09074);});}return respondWithRpcPromise(_0x6f4c('0xab'),_0x6f4c('0xaa'),_0xb09074);})['then'](function(_0x1ac603){if(_0x1ac603){var _0x2c03e4=0xc8;var _0x3479f2=_0x6f4c('0xac');logger[_0x6f4c('0x24')](_0x6f4c('0xad'),_0x3479f2,_0x2c03e4,_0x6f4c('0xae'));logger[_0x6f4c('0x27')](_0x6f4c('0xaf'),_0x3479f2,_0x2c03e4,_0x6f4c('0xae'),JSON[_0x6f4c('0x28')](_0x1ac603));if(_0xb09074['account']['type']==='twilio'){return _0x1c0a71[_0x6f4c('0x2f')](_0x2c03e4)['set']('Content-Type','text/xml')[_0x6f4c('0x3f')]('\x0a');}else{return _0x1c0a71['status'](_0x2c03e4)[_0x6f4c('0x31')](_0x1ac603);}}})[_0x6f4c('0x2d')](handleError(_0x1c0a71,null));};exports[_0x6f4c('0xb0')]=function(_0x3088d1,_0x23565f){var _0x4d31c8=_0x3088d1[_0x6f4c('0x64')]['id'];var _0x2d381a=_0x3088d1[_0x6f4c('0x5f')];var _0x113fb0=0xc8;var _0x3920c9=null;return db['sequelize'][_0x6f4c('0xb1')]({'isolationLevel':db[_0x6f4c('0xb2')][_0x6f4c('0xb3')][_0x6f4c('0xb4')][_0x6f4c('0xb5')]},function(_0x483227){return db[_0x6f4c('0x43')][_0x6f4c('0x67')]({'where':{'id':_0x4d31c8},'transaction':_0x483227})[_0x6f4c('0x23')](function(_0x5a235b){if(_0x5a235b){return db[_0x6f4c('0x72')][_0x6f4c('0x3a')]({'where':{'SmsAccountId':_0x4d31c8},'transaction':_0x483227})[_0x6f4c('0x23')](function(){var _0x5b94df=_[_0x6f4c('0x42')](_0x2d381a,function(_0xfbe539){_0xfbe539['SmsAccountId']=_0x4d31c8;return _0xfbe539;});return db['SmsApplication'][_0x6f4c('0xb6')](_0x5b94df,{'transaction':_0x483227});});}else{_0x113fb0=0x194;_0x3920c9=[];}});})['then'](function(){if(_0x113fb0!==0x194){return db[_0x6f4c('0x72')][_0x6f4c('0xb7')]({'where':{'SmsAccountId':_0x4d31c8},'order':'priority'})[_0x6f4c('0x23')](function(_0x11f1f7){_0x3920c9=_0x11f1f7;});}})[_0x6f4c('0x2d')](function(_0x3898bb){_0x113fb0=0x1f4;logger[_0x6f4c('0x29')](_0x3898bb['stack']);if(_0x3898bb['name']){delete _0x3898bb[_0x6f4c('0x3e')];}_0x3920c9=_0x3898bb;})[_0x6f4c('0xb8')](function(){if(_0x3920c9===null){_0x23565f[_0x6f4c('0x2e')](_0x113fb0);}else{if(_0x113fb0===0x1f4){_0x23565f['status'](_0x113fb0)[_0x6f4c('0x3f')](_0x3920c9);}else{_0x23565f['status'](_0x113fb0)[_0x6f4c('0x31')](_0x3920c9);}}});};exports[_0x6f4c('0xb9')]=function(_0x3a9512,_0x13edf4,_0x1180f8){var _0x4303b5={};var _0xc9666c={};var _0x1a3f5a;var _0x54ab88;return db[_0x6f4c('0x43')]['findOne']({'where':{'id':_0x3a9512['params']['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x13edf4,null))[_0x6f4c('0x23')](function(_0x53671f){if(_0x53671f){_0x1a3f5a=_0x53671f;_0xc9666c['model']=_[_0x6f4c('0x48')](db[_0x6f4c('0x72')]['rawAttributes']);_0xc9666c[_0x6f4c('0x47')]=_[_0x6f4c('0x48')](_0x3a9512['query']);_0xc9666c[_0x6f4c('0x49')]=_['intersection'](_0xc9666c[_0x6f4c('0x4b')],_0xc9666c[_0x6f4c('0x47')]);_0x4303b5['attributes']=_[_0x6f4c('0x4a')](_0xc9666c['model'],qs[_0x6f4c('0x4d')](_0x3a9512[_0x6f4c('0x47')][_0x6f4c('0x4d')]));_0x4303b5[_0x6f4c('0x4c')]=_0x4303b5[_0x6f4c('0x4c')][_0x6f4c('0x4e')]?_0x4303b5[_0x6f4c('0x4c')]:_0xc9666c['model'];_0x4303b5[_0x6f4c('0x51')]=qs[_0x6f4c('0x52')](_0x3a9512[_0x6f4c('0x47')][_0x6f4c('0x52')]);_0x4303b5[_0x6f4c('0x53')]=qs[_0x6f4c('0x49')](_[_0x6f4c('0x69')](_0x3a9512[_0x6f4c('0x47')],_0xc9666c['filters']));if(_0x3a9512[_0x6f4c('0x47')]['filter']){_0x4303b5[_0x6f4c('0x53')]=_[_0x6f4c('0x57')](_0x4303b5[_0x6f4c('0x53')],{'$or':_[_0x6f4c('0x42')](_0x4303b5[_0x6f4c('0x4c')],function(_0x4dbe3c){var _0x3babb6={};_0x3babb6[_0x4dbe3c]={'$like':'%'+_0x3a9512[_0x6f4c('0x47')][_0x6f4c('0x54')]+'%'};return _0x3babb6;})});}_0x4303b5=_['merge']({},_0x4303b5,_0x3a9512['options']);return _0x1a3f5a['getApplications'](_0x4303b5);}})[_0x6f4c('0x23')](function(_0x1816d7){if(_0x1816d7){_0x54ab88=_0x1816d7['length'];if(!_0x3a9512[_0x6f4c('0x47')][_0x6f4c('0x4f')](_0x6f4c('0x50'))){_0x4303b5[_0x6f4c('0x33')]=qs[_0x6f4c('0x33')](_0x3a9512['query'][_0x6f4c('0x33')]);_0x4303b5[_0x6f4c('0x32')]=qs[_0x6f4c('0x32')](_0x3a9512['query'][_0x6f4c('0x32')]);}return _0x1a3f5a[_0x6f4c('0xb9')](_0x4303b5);}})[_0x6f4c('0x23')](function(_0x1f37bf){if(_0x1f37bf){return _0x1f37bf?{'count':_0x54ab88,'rows':_0x1f37bf}:null;}})[_0x6f4c('0x23')](respondWithResult(_0x13edf4,null))[_0x6f4c('0x2d')](handleError(_0x13edf4,null));};exports['getInteractions']=function(_0x508657,_0x28687a,_0x179bc5){var _0x19e70b={'raw':![],'where':{}};var _0x3ec299={};var _0x54abb5={'count':0x0,'rows':[]};return db[_0x6f4c('0x43')][_0x6f4c('0x67')]({'where':{'id':_0x508657['params']['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x28687a,null))['then'](function(_0x29557c){if(_0x29557c){_0x3ec299[_0x6f4c('0x4b')]=_[_0x6f4c('0x48')](db[_0x6f4c('0x9c')]['rawAttributes']);_0x3ec299[_0x6f4c('0x47')]=_[_0x6f4c('0x48')](_0x508657[_0x6f4c('0x47')]);_0x3ec299['filters']=_[_0x6f4c('0x4a')](_0x3ec299[_0x6f4c('0x4b')],_0x3ec299[_0x6f4c('0x47')]);_0x19e70b['attributes']=_[_0x6f4c('0x4a')](_0x3ec299[_0x6f4c('0x4b')],qs[_0x6f4c('0x4d')](_0x508657[_0x6f4c('0x47')]['fields']));_0x19e70b[_0x6f4c('0x4c')]=_0x19e70b['attributes']['length']?_0x19e70b['attributes']:_0x3ec299[_0x6f4c('0x4b')];if(!_0x508657[_0x6f4c('0x47')][_0x6f4c('0x4f')]('nolimit')){_0x19e70b[_0x6f4c('0x33')]=qs['limit'](_0x508657[_0x6f4c('0x47')]['limit']);_0x19e70b[_0x6f4c('0x32')]=qs[_0x6f4c('0x32')](_0x508657[_0x6f4c('0x47')]['offset']);}_0x19e70b[_0x6f4c('0x51')]=qs[_0x6f4c('0x52')](_0x508657['query'][_0x6f4c('0x52')]);_0x19e70b[_0x6f4c('0x53')]=qs[_0x6f4c('0x49')](_[_0x6f4c('0x69')](_0x508657[_0x6f4c('0x47')],_0x3ec299[_0x6f4c('0x49')]));_0x19e70b['where'][_0x6f4c('0x65')]=_0x29557c['id'];if(_0x508657[_0x6f4c('0x47')]['filter']){_0x19e70b[_0x6f4c('0x53')]=_['merge'](_0x19e70b[_0x6f4c('0x53')],{'$or':_[_0x6f4c('0x42')](_0x19e70b['attributes'],function(_0x4d31c1){var _0x59d627={};_0x59d627[_0x4d31c1]={'$like':'%'+_0x508657['query']['filter']+'%'};return _0x59d627;})});}_0x19e70b=_[_0x6f4c('0x57')]({},_0x19e70b,_0x508657[_0x6f4c('0x58')]);return db[_0x6f4c('0x9c')][_0x6f4c('0x35')]({'where':_0x19e70b[_0x6f4c('0x53')]})['then'](function(_0x5a0966){_0x54abb5['count']=_0x5a0966;if(_0x508657[_0x6f4c('0x47')]['includeAll']){_0x19e70b['include']=[{'model':db[_0x6f4c('0x77')],'as':_0x6f4c('0xba'),'required':![]},{'model':db[_0x6f4c('0xa6')],'as':'Owner','attributes':[_0x6f4c('0x3e'),_0x6f4c('0xbb'),'internal'],'required':![]},{'model':db[_0x6f4c('0xbc')],'as':_0x6f4c('0xbd'),'attributes':['id',_0x6f4c('0x3e'),_0x6f4c('0xbe')],'where':_0x508657[_0x6f4c('0x47')][_0x6f4c('0xbf')]?{'id':_0x508657['query']['tag']}:undefined,'required':_0x508657['query']['tag']?!![]:![]}];}return db[_0x6f4c('0x9c')][_0x6f4c('0x6a')](_0x19e70b);})[_0x6f4c('0x23')](function(_0xa901b){_0x54abb5[_0x6f4c('0x5a')]=_0xa901b;return _0x54abb5;});}})[_0x6f4c('0x23')](respondWithFilteredResult(_0x28687a,_0x19e70b))[_0x6f4c('0x2d')](handleError(_0x28687a,null));};exports[_0x6f4c('0x3f')]=function(_0x4e52e2,_0x1ef0a3,_0x222a92){var _0x38ecc0,_0x233130,_0x288eb1;if(_[_0x6f4c('0x94')](_0x4e52e2[_0x6f4c('0x5f')][_0x6f4c('0x5f')])||_0x4e52e2[_0x6f4c('0x5f')][_0x6f4c('0x5f')]===''){throw new db[(_0x6f4c('0x79'))][(_0x6f4c('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6f4c('0x94')](_0x4e52e2['body']['to'])){throw new db['Sequelize'][(_0x6f4c('0x7a'))](_0x6f4c('0xc0'));}_0x38ecc0=_0x4e52e2[_0x6f4c('0x5f')]['to'];return db[_0x6f4c('0x43')][_0x6f4c('0x5d')]({'where':{'id':_0x4e52e2[_0x6f4c('0x64')]['id']},'include':[{'model':db[_0x6f4c('0x97')],'as':_0x6f4c('0xc1'),'include':[{'model':db[_0x6f4c('0x77')],'as':_0x6f4c('0x98'),'where':{'mobile':_0x38ecc0},'limit':0x1,'order':[['updatedAt',_0x6f4c('0x99')]]}]}]})['then'](handleEntityNotFound(_0x1ef0a3,null))[_0x6f4c('0x23')](function(_0x28783d){if(_0x28783d&&_0x28783d[_0x6f4c('0xc1')]){_0x233130=_0x28783d['get']({'plain':!![]});if(_0x233130[_0x6f4c('0xc1')]&&_0x233130[_0x6f4c('0xc1')]['Contacts'][_0x6f4c('0x4e')]){return _0x233130[_0x6f4c('0xc1')][_0x6f4c('0x98')][0x0];}return db[_0x6f4c('0x77')]['create'](_['defaults'](_0x4e52e2[_0x6f4c('0x5f')],{'firstName':_0x38ecc0,'mobile':_0x38ecc0,'phone':_0x38ecc0,'ListId':_0x233130[_0x6f4c('0x7f')]}));}})[_0x6f4c('0x23')](handleEntityNotFound(_0x1ef0a3,null))[_0x6f4c('0x23')](function(_0x1dc1d8){if(_0x1dc1d8){_0x288eb1=_0x1dc1d8;return db['SmsInteraction'][_0x6f4c('0x5d')]({'where':{'ContactId':_0x288eb1['id'],'closed':![],'SmsAccountId':_0x233130['id']}})['then'](function(_0x2b35bb){if(_0x2b35bb){return[_0x2b35bb,![]];}return db[_0x6f4c('0x9c')][_0x6f4c('0x5e')]({'UserId':_0x4e52e2[_0x6f4c('0x60')]['id'],'ContactId':_0x288eb1['id'],'SmsAccountId':_0x233130['id'],'phone':_0x38ecc0,'firstMsgDirection':_0x6f4c('0xc2'),'Messages':[_['merge'](_0x4e52e2[_0x6f4c('0x5f')],{'read':![],'body':_0x4e52e2['body'][_0x6f4c('0x5f')],'phone':_0x38ecc0,'SmsAccountId':_0x233130['id'],'UserId':_0x4e52e2[_0x6f4c('0x60')]['id'],'ContactId':_0x288eb1['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x6f4c('0xc3')}]})[_0x6f4c('0x23')](function(_0x1b3cf0){return[_0x1b3cf0,!![]];});});}})['spread'](function(_0x1d271a,_0x2fdd47){if(_0x2fdd47){return _0x1d271a;}return db[_0x6f4c('0xc4')][_0x6f4c('0x5e')](_[_0x6f4c('0x57')](_0x4e52e2[_0x6f4c('0x5f')],{'read':![],'body':_0x4e52e2[_0x6f4c('0x5f')]['body'],'phone':_0x38ecc0,'SmsAccountId':_0x233130['id'],'SmsInteractionId':_0x1d271a['id'],'UserId':_0x4e52e2[_0x6f4c('0x60')]['id'],'ContactId':_0x288eb1['id']}))[_0x6f4c('0x23')](function(_0x3603b4){_0x1d271a[_0x6f4c('0xc5')][_0x6f4c('0xc3')]=[];_0x1d271a[_0x6f4c('0xc5')][_0x6f4c('0xc3')][_0x6f4c('0xa1')](_0x3603b4[_0x6f4c('0xc5')]);return _0x1d271a;});})[_0x6f4c('0x23')](respondWithResult(_0x1ef0a3,null))[_0x6f4c('0x2d')](handleError(_0x1ef0a3,null));};exports[_0x6f4c('0x2f')]=function(_0x1943bf,_0x5ab716,_0x5a01da){if(_0x1943bf[_0x6f4c('0x5f')]['id']){delete _0x1943bf['body']['id'];}var _0x1ba911,_0x506b57,_0x4ba404;return db['SmsAccount'][_0x6f4c('0x5d')]({'where':{'id':_0x1943bf[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x5ab716,null))[_0x6f4c('0x23')](function(_0x5a5745){if(_0x5a5745){_0x4ba404=_0x5a5745;logger[_0x6f4c('0x27')](_0x6f4c('0xad'),_0x6f4c('0x2f'),'received\x20delivery\x20report\x20from',_0x5a5745[_0x6f4c('0x55')],util[_0x6f4c('0xc6')](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));switch(_0x5a5745['type']){case _0x6f4c('0x84'):if(_0x1943bf[_0x6f4c('0x5f')]['skebby_dispatch_id']&&_0x1943bf['body'][_0x6f4c('0x2f')]){_0x506b57=_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0x2f')];return db[_0x6f4c('0xc4')][_0x6f4c('0x5d')]({'where':{'messageId':_0x1943bf[_0x6f4c('0x5f')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x1943bf[_0x6f4c('0x5f')]['requestid']&&_0x1943bf['body'][_0x6f4c('0xc7')]){_0x506b57=_0x1943bf[_0x6f4c('0x5f')]['statusInt'];return db[_0x6f4c('0xc4')][_0x6f4c('0x5d')]({'where':{'messageId':_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0xc8')]}});}break;case _0x6f4c('0x89'):if(_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0x8b')]&&_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0xc9')]){_0x506b57=_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0xc9')];return db['SmsMessage'][_0x6f4c('0x5d')]({'where':{'messageId':_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0x8b')]}});}break;case _0x6f4c('0x8d'):var _0x42dc66=_0x1943bf['body'][_0x6f4c('0x8e')][0x0];if(_0x42dc66[_0x6f4c('0x8a')]&&_0x42dc66[_0x6f4c('0x2f')][_0x6f4c('0xca')]===_0x6f4c('0xcb')){_0x506b57=_0x42dc66[_0x6f4c('0x2f')]['groupName'];return db[_0x6f4c('0xc4')][_0x6f4c('0x5d')]({'where':{'messageId':_0x42dc66[_0x6f4c('0x8a')]}});}break;case _0x6f4c('0xcc'):if(_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0x8a')]&&_0x1943bf['body'][_0x6f4c('0x2f')]){_0x506b57=_0x1943bf['body'][_0x6f4c('0x2f')];return db[_0x6f4c('0xc4')][_0x6f4c('0x5d')]({'where':{'messageId':_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0x8a')]}});}break;case'bandwidth':if(_0x1943bf[_0x6f4c('0x5f')][0x0][_0x6f4c('0x2b')]['id']){_0x506b57=_0x1943bf['body'][0x0]['type'];return db[_0x6f4c('0xc4')][_0x6f4c('0x5d')]({'where':{'messageId':_0x1943bf[_0x6f4c('0x5f')][0x0][_0x6f4c('0x2b')]['id']}});}break;case _0x6f4c('0xcd'):if(_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0xce')]&&_0x1943bf['body'][_0x6f4c('0x2f')]){_0x506b57=_0x1943bf['body']['status'];return db['SmsMessage'][_0x6f4c('0x5d')]({'where':{'messageId':_0x1943bf['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x5ab716,null))[_0x6f4c('0x23')](function(_0x122af1){if(_0x122af1){_0x1ba911=_0x122af1;switch(_0x4ba404[_0x6f4c('0x55')]){case _0x6f4c('0x84'):if(_0x506b57===_0x6f4c('0xcb')){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger[_0x6f4c('0x29')](_0x6f4c('0xad'),_0x6f4c('0x2f'),'skebby',util[_0x6f4c('0xc6')](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x506b57==='1'){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger[_0x6f4c('0x29')](_0x6f4c('0xad'),_0x6f4c('0x2f'),_0x6f4c('0x84'),util['inspect'](_0x1943bf['body'],{'showHidden':![],'depth':null}));}break;case _0x6f4c('0x89'):if(!_0x1943bf[_0x6f4c('0x5f')][_0x6f4c('0xcf')]&&_0x506b57>=0xc8&&_0x506b57<=0xce){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger[_0x6f4c('0x29')](_0x6f4c('0xad'),_0x6f4c('0x2f'),_0x6f4c('0x89'),util['inspect'](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x6f4c('0x8d'):var _0x5c7396=_0x1943bf[_0x6f4c('0x5f')]['results'][0x0];if(_0x5c7396['status'][_0x6f4c('0xca')]===_0x6f4c('0xcb')){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger[_0x6f4c('0x29')](_0x6f4c('0xad'),_0x6f4c('0x2f'),'infobip',util[_0x6f4c('0xc6')](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x6f4c('0xcc'):if(_0x506b57==_0x6f4c('0xd0')||_0x506b57==_0x6f4c('0xd1')){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6f4c('0x2f'),_0x6f4c('0xcc'),util[_0x6f4c('0xc6')](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x6f4c('0x92'):if(_0x506b57=='message-delivered'){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger[_0x6f4c('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6f4c('0x2f'),_0x6f4c('0x92'),util['inspect'](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x6f4c('0xcd'):if(_0x506b57===_0x6f4c('0xd2')||_0x506b57===_0x6f4c('0xd3')){return _0x1ba911[_0x6f4c('0x39')]({'read':!![]});}else{logger[_0x6f4c('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6f4c('0x2f'),_0x6f4c('0xcd'),util[_0x6f4c('0xc6')](_0x1943bf[_0x6f4c('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x1ba911;}})['then'](respondWithResult(_0x5ab716,null))[_0x6f4c('0x2d')](handleError(_0x5ab716,null));};exports[_0x6f4c('0xd4')]=function(_0x447fcf,_0x48f216,_0x48bebb){var _0x2c64fc,_0x3eb396,_0x3e77f6;return db['SmsAccount'][_0x6f4c('0x5d')]({'where':{'id':_0x447fcf[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x48f216,null))[_0x6f4c('0x23')](function(_0x4cb28c){if(_0x4cb28c){_0x3e77f6=_0x4cb28c;logger[_0x6f4c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6f4c('0x2f'),'received\x20delivery\x20report\x20from',_0x4cb28c['type'],util[_0x6f4c('0xc6')](_0x447fcf[_0x6f4c('0x47')],{'showHidden':![],'depth':null}));switch(_0x4cb28c[_0x6f4c('0x55')]){case'csc':if(_0x447fcf['query']['message-id']&&_0x447fcf[_0x6f4c('0x47')][_0x6f4c('0xd5')]){_0x3eb396=_0x447fcf['query']['state'];return db[_0x6f4c('0xc4')][_0x6f4c('0x5d')]({'where':{'messageId':_0x447fcf['query']['message-id']}});}break;}}})[_0x6f4c('0x23')](handleEntityNotFound(_0x48f216,null))[_0x6f4c('0x23')](function(_0x1f87ce){if(_0x1f87ce){_0x2c64fc=_0x1f87ce;switch(_0x3e77f6[_0x6f4c('0x55')]){case _0x6f4c('0x8f'):if(_0x3eb396==='2'||_0x3eb396==='6'){return _0x2c64fc['update']({'read':!![]});}else{logger[_0x6f4c('0x29')](_0x6f4c('0xad'),_0x6f4c('0x2f'),_0x6f4c('0x8f'),util[_0x6f4c('0xc6')](_0x447fcf[_0x6f4c('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x2c64fc;}})[_0x6f4c('0x23')](respondWithResult(_0x48f216,null))[_0x6f4c('0x2d')](handleError(_0x48f216,null));};exports[_0x6f4c('0xd6')]=function(_0x47f1f9,_0x5de303,_0x2773ce){return db[_0x6f4c('0x43')][_0x6f4c('0x5d')]({'where':{'id':_0x47f1f9[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x5de303,null))[_0x6f4c('0x23')](function(_0x2d93b4){if(_0x2d93b4){return _0x2d93b4[_0x6f4c('0xd6')](_0x47f1f9[_0x6f4c('0x5f')]['ids'],_[_0x6f4c('0x9a')](_0x47f1f9['body'],[_0x6f4c('0x6c'),'id'])||{})[_0x6f4c('0x9d')](function(_0xb3e9dc){for(var _0x4b60ed=0x0;_0x4b60ed<_0x47f1f9['body'][_0x6f4c('0x6c')][_0x6f4c('0x4e')];_0x4b60ed+=0x1){socket[_0x6f4c('0xd7')](_0x6f4c('0xd8'),{'UserId':Number(_0x47f1f9[_0x6f4c('0x5f')][_0x6f4c('0x6c')][_0x4b60ed]),'SmsAccountId':Number(_0x47f1f9[_0x6f4c('0x64')]['id'])});}return _0xb3e9dc;});}})['then'](respondWithResult(_0x5de303,null))['catch'](handleError(_0x5de303,null));};exports[_0x6f4c('0xd9')]=function(_0x3c15cd,_0x5893a0,_0x3dff7a){return db[_0x6f4c('0x43')]['find']({'where':{'id':_0x3c15cd[_0x6f4c('0x64')]['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x5893a0,null))[_0x6f4c('0x23')](function(_0x3f9083){if(_0x3f9083){return _0x3f9083[_0x6f4c('0xd9')](_0x3c15cd['query']['ids'])[_0x6f4c('0x23')](function(){if(_[_0x6f4c('0xda')](_0x3c15cd['query'][_0x6f4c('0x6c')])){for(var _0x440a64=0x0;_0x440a64<_0x3c15cd['query']['ids'][_0x6f4c('0x4e')];_0x440a64+=0x1){socket[_0x6f4c('0xd7')](_0x6f4c('0xdb'),{'UserId':Number(_0x3c15cd[_0x6f4c('0x47')][_0x6f4c('0x6c')][_0x440a64]),'SmsAccountId':Number(_0x3c15cd[_0x6f4c('0x64')]['id'])});}}else{socket[_0x6f4c('0xd7')](_0x6f4c('0xdb'),{'UserId':Number(_0x3c15cd[_0x6f4c('0x47')][_0x6f4c('0x6c')]),'SmsAccountId':Number(_0x3c15cd[_0x6f4c('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x5893a0,null))[_0x6f4c('0x2d')](handleError(_0x5893a0,null));};exports['getAgents']=function(_0x5e31e4,_0x3f9b15,_0x553ecc){var _0x328734={};var _0x52abef={};var _0x1d3d47;var _0xe73d22;return db[_0x6f4c('0x43')][_0x6f4c('0x67')]({'where':{'id':_0x5e31e4['params']['id']}})[_0x6f4c('0x23')](handleEntityNotFound(_0x3f9b15,null))[_0x6f4c('0x23')](function(_0x1a0594){if(_0x1a0594){_0x1d3d47=_0x1a0594;_0x52abef['model']=_[_0x6f4c('0x48')](db[_0x6f4c('0xa6')][_0x6f4c('0x44')]);_0x52abef[_0x6f4c('0x47')]=_[_0x6f4c('0x48')](_0x5e31e4[_0x6f4c('0x47')]);_0x52abef[_0x6f4c('0x49')]=_[_0x6f4c('0x4a')](_0x52abef['model'],_0x52abef[_0x6f4c('0x47')]);_0x328734[_0x6f4c('0x4c')]=_[_0x6f4c('0x4a')](_0x52abef[_0x6f4c('0x4b')],qs[_0x6f4c('0x4d')](_0x5e31e4[_0x6f4c('0x47')]['fields']));_0x328734[_0x6f4c('0x4c')]=_0x328734['attributes'][_0x6f4c('0x4e')]?_0x328734[_0x6f4c('0x4c')]:_0x52abef[_0x6f4c('0x4b')];_0x328734[_0x6f4c('0x51')]=qs[_0x6f4c('0x52')](_0x5e31e4['query'][_0x6f4c('0x52')]);_0x328734[_0x6f4c('0x53')]=qs[_0x6f4c('0x49')](_[_0x6f4c('0x69')](_0x5e31e4['query'],_0x52abef[_0x6f4c('0x49')]));if(_0x5e31e4[_0x6f4c('0x47')]['filter']){_0x328734[_0x6f4c('0x53')]=_[_0x6f4c('0x57')](_0x328734[_0x6f4c('0x53')],{'$or':_['map'](_0x328734['attributes'],function(_0x224eca){var _0x533945={};_0x533945[_0x224eca]={'$like':'%'+_0x5e31e4[_0x6f4c('0x47')]['filter']+'%'};return _0x533945;})});}_0x328734=_[_0x6f4c('0x57')]({},_0x328734,_0x5e31e4[_0x6f4c('0x58')]);return _0x1d3d47['getAgents'](_0x328734);}})[_0x6f4c('0x23')](function(_0x29f5a0){if(_0x29f5a0){_0xe73d22=_0x29f5a0['length'];if(!_0x5e31e4['query'][_0x6f4c('0x4f')](_0x6f4c('0x50'))){_0x328734[_0x6f4c('0x33')]=qs[_0x6f4c('0x33')](_0x5e31e4[_0x6f4c('0x47')][_0x6f4c('0x33')]);_0x328734['offset']=qs[_0x6f4c('0x32')](_0x5e31e4[_0x6f4c('0x47')][_0x6f4c('0x32')]);}return _0x1d3d47[_0x6f4c('0xdc')](_0x328734);}})[_0x6f4c('0x23')](function(_0x2819e2){if(_0x2819e2){return _0x2819e2?{'count':_0xe73d22,'rows':_0x2819e2}:null;}})['then'](respondWithResult(_0x3f9b15,null))['catch'](handleError(_0x3f9b15,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 3bf661d..7907bca 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 _0xe496=['hasOwnProperty','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x4ee044,_0x518282){var _0x3070c4=function(_0x1f5fdb){while(--_0x1f5fdb){_0x4ee044['push'](_0x4ee044['shift']());}};_0x3070c4(++_0x518282);}(_0xe496,0x17b));var _0x6e49=function(_0x2baf11,_0x5ad7f2){_0x2baf11=_0x2baf11-0x0;var _0x55c4ad=_0xe496[_0x2baf11];return _0x55c4ad;};'use strict';var EventEmitter=require(_0x6e49('0x0'));var SmsAccount=require(_0x6e49('0x1'))['db'][_0x6e49('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6e49('0x3')](0x0);var events={'afterCreate':_0x6e49('0x4'),'afterUpdate':_0x6e49('0x5'),'afterDestroy':_0x6e49('0x6')};function emitEvent(_0xa240cf){return function(_0xc64023,_0x5037be,_0x3d5502){SmsAccountEvents['emit'](_0xa240cf+':'+_0xc64023['id'],_0xc64023);SmsAccountEvents[_0x6e49('0x7')](_0xa240cf,_0xc64023);_0x3d5502(null);};}for(var e in events){if(events[_0x6e49('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x5de8=['update','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3f4b38,_0x2afa50){var _0x3b0a60=function(_0x5c6057){while(--_0x5c6057){_0x3f4b38['push'](_0x3f4b38['shift']());}};_0x3b0a60(++_0x2afa50);}(_0x5de8,0xee));var _0x85de=function(_0x1b5b8a,_0xefa937){_0x1b5b8a=_0x1b5b8a-0x0;var _0x44ef21=_0x5de8[_0x1b5b8a];return _0x44ef21;};'use strict';var EventEmitter=require(_0x85de('0x0'));var SmsAccount=require(_0x85de('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85de('0x2'),'afterDestroy':'remove'};function emitEvent(_0x470d37){return function(_0x7325ea,_0x31a867,_0x1ecad7){SmsAccountEvents['emit'](_0x470d37+':'+_0x7325ea['id'],_0x7325ea);SmsAccountEvents['emit'](_0x470d37,_0x7325ea);_0x1ecad7(null);};}for(var e in events){if(events[_0x85de('0x3')](e)){var event=events[e];SmsAccount[_0x85de('0x4')](e,emitEvent(event));}}module[_0x85de('0x5')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 46ea4ef..6a1db27 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 _0x86a4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0xab4c46,_0x254422){var _0x1a1500=function(_0x4d5e9c){while(--_0x4d5e9c){_0xab4c46['push'](_0xab4c46['shift']());}};_0x1a1500(++_0x254422);}(_0x86a4,0xea));var _0x486a=function(_0x39cbea,_0x2c3492){_0x39cbea=_0x39cbea-0x0;var _0x1bbda5=_0x86a4[_0x39cbea];return _0x1bbda5;};'use strict';var _=require(_0x486a('0x0'));var util=require(_0x486a('0x1'));var logger=require(_0x486a('0x2'))(_0x486a('0x3'));var moment=require(_0x486a('0x4'));var BPromise=require(_0x486a('0x5'));var rp=require(_0x486a('0x6'));var fs=require('fs');var path=require(_0x486a('0x7'));var rimraf=require(_0x486a('0x8'));var config=require('../../config/environment');var attributes=require(_0x486a('0x9'));module[_0x486a('0xa')]=function(_0x1a1a76,_0x3ebc91){return _0x1a1a76[_0x486a('0xb')]('SmsAccount',attributes,{'tableName':_0x486a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb89=['define','SmsAccount','sms_accounts','lodash','util','path','../../config/environment','exports'];(function(_0x17a815,_0x22704e){var _0x1908ed=function(_0x504bf8){while(--_0x504bf8){_0x17a815['push'](_0x17a815['shift']());}};_0x1908ed(++_0x22704e);}(_0xfb89,0x73));var _0x9fb8=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0xfb89[_0x15d18f];return _0xd12bf7;};'use strict';var _=require(_0x9fb8('0x0'));var util=require(_0x9fb8('0x1'));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(_0x9fb8('0x2'));var rimraf=require('rimraf');var config=require(_0x9fb8('0x3'));var attributes=require('./smsAccount.attributes');module[_0x9fb8('0x4')]=function(_0x2f8294,_0x22053c){return _0x2f8294[_0x9fb8('0x5')](_0x9fb8('0x6'),attributes,{'tableName':_0x9fb8('0x7'),'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 c8451fd..6a296fc 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 _0x57b2=['http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x42fbfb,_0x4e9ac2){var _0x216d34=function(_0x41f0b8){while(--_0x41f0b8){_0x42fbfb['push'](_0x42fbfb['shift']());}};_0x216d34(++_0x4e9ac2);}(_0x57b2,0x1cc));var _0x257b=function(_0x24f672,_0x24e267){_0x24f672=_0x24f672-0x0;var _0x179995=_0x57b2[_0x24f672];return _0x179995;};'use strict';var _=require(_0x257b('0x0'));var util=require(_0x257b('0x1'));var moment=require('moment');var BPromise=require(_0x257b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x257b('0x3'));var logger=require(_0x257b('0x4'))(_0x257b('0x5'));var config=require(_0x257b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x257b('0x7')][_0x257b('0x8')]({'port':0x232a});config[_0x257b('0x9')]=_[_0x257b('0xa')](config['redis'],{'host':_0x257b('0xb'),'port':0x18eb});var socket=require(_0x257b('0xc'))(new Redis(config[_0x257b('0x9')]));require(_0x257b('0xd'))['register'](socket);function respondWithRpcPromise(_0x22a729,_0x4d2eed,_0x69dcb6){return new BPromise(function(_0x3dc659,_0x5f0264){return client['request'](_0x22a729,_0x69dcb6)[_0x257b('0xe')](function(_0x56bc06){logger[_0x257b('0xf')](_0x257b('0x10'),_0x4d2eed,_0x257b('0x11'));logger[_0x257b('0x12')](_0x257b('0x13'),_0x4d2eed,_0x257b('0x11'),JSON['stringify'](_0x56bc06));if(_0x56bc06[_0x257b('0x14')]){if(_0x56bc06[_0x257b('0x14')][_0x257b('0x15')]===0x1f4){logger[_0x257b('0x14')]('SmsAccount,\x20%s,\x20%s',_0x4d2eed,_0x56bc06['error'][_0x257b('0x16')]);return _0x5f0264(_0x56bc06[_0x257b('0x14')][_0x257b('0x16')]);}logger[_0x257b('0x14')]('SmsAccount,\x20%s,\x20%s',_0x4d2eed,_0x56bc06['error'][_0x257b('0x16')]);return _0x3dc659(_0x56bc06['error'][_0x257b('0x16')]);}else{logger['info'](_0x257b('0x10'),_0x4d2eed,_0x257b('0x11'));_0x3dc659(_0x56bc06[_0x257b('0x17')][_0x257b('0x16')]);}})[_0x257b('0x18')](function(_0x2bb860){logger[_0x257b('0x14')](_0x257b('0x10'),_0x4d2eed,_0x2bb860);_0x5f0264(_0x2bb860);});});}exports[_0x257b('0x19')]=function(_0x36f376){var _0x582f9a=this;return new Promise(function(_0xaf20b1,_0x1aa0f3){return db[_0x257b('0x1a')][_0x257b('0x1b')]({'raw':_0x36f376[_0x257b('0x1c')]?_0x36f376[_0x257b('0x1c')][_0x257b('0x1d')]===undefined?!![]:![]:!![],'where':_0x36f376[_0x257b('0x1c')]?_0x36f376['options'][_0x257b('0x1e')]||null:null,'attributes':_0x36f376['options']?_0x36f376[_0x257b('0x1c')][_0x257b('0x1f')]||null:null,'include':_0x36f376[_0x257b('0x1c')]?_0x36f376[_0x257b('0x1c')]['include']?_[_0x257b('0x20')](_0x36f376['options'][_0x257b('0x21')],function(_0x5a3a3a){return{'model':db[_0x5a3a3a['model']],'as':_0x5a3a3a['as'],'attributes':_0x5a3a3a[_0x257b('0x1f')],'include':_0x5a3a3a[_0x257b('0x21')]?_[_0x257b('0x20')](_0x5a3a3a[_0x257b('0x21')],function(_0x3a6704){return{'model':db[_0x3a6704['model']],'as':_0x3a6704['as'],'attributes':_0x3a6704[_0x257b('0x1f')],'include':_0x3a6704['include']?_['map'](_0x3a6704['include'],function(_0x449e0f){return{'model':db[_0x449e0f[_0x257b('0x22')]],'as':_0x449e0f['as'],'attributes':_0x449e0f[_0x257b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x257b('0xe')](function(_0xb0f7e2){logger['info'](_0x257b('0x19'),_0x36f376);logger[_0x257b('0x12')](_0x257b('0x19'),_0x36f376,JSON[_0x257b('0x23')](_0xb0f7e2));_0xaf20b1(_0xb0f7e2);})[_0x257b('0x18')](function(_0x2bf8e9){logger[_0x257b('0x14')](_0x257b('0x19'),_0x2bf8e9['message'],_0x36f376);_0x1aa0f3(_0x582f9a[_0x257b('0x14')](0x1f4,_0x2bf8e9[_0x257b('0x16')]));});});}; \ No newline at end of file +var _0x332f=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4f822e,_0x338550){var _0x494fdd=function(_0xea30b2){while(--_0xea30b2){_0x4f822e['push'](_0x4f822e['shift']());}};_0x494fdd(++_0x338550);}(_0x332f,0x12e));var _0xf332=function(_0x108f1f,_0x49b607){_0x108f1f=_0x108f1f-0x0;var _0x2d91da=_0x332f[_0x108f1f];return _0x2d91da;};'use strict';var _=require(_0xf332('0x0'));var util=require(_0xf332('0x1'));var moment=require(_0xf332('0x2'));var BPromise=require(_0xf332('0x3'));var rs=require(_0xf332('0x4'));var fs=require('fs');var Redis=require(_0xf332('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf332('0x6'));var logger=require(_0xf332('0x7'))(_0xf332('0x8'));var config=require(_0xf332('0x9'));var jayson=require(_0xf332('0xa'));var client=jayson[_0xf332('0xb')]['http']({'port':0x232a});config[_0xf332('0xc')]=_[_0xf332('0xd')](config[_0xf332('0xc')],{'host':_0xf332('0xe'),'port':0x18eb});var socket=require(_0xf332('0xf'))(new Redis(config['redis']));require(_0xf332('0x10'))['register'](socket);function respondWithRpcPromise(_0x83ee52,_0x492df9,_0x242da3){return new BPromise(function(_0x508cd5,_0x5f410e){return client[_0xf332('0x11')](_0x83ee52,_0x242da3)[_0xf332('0x12')](function(_0xfa6c6){logger[_0xf332('0x13')](_0xf332('0x14'),_0x492df9,_0xf332('0x15'));logger[_0xf332('0x16')](_0xf332('0x17'),_0x492df9,'request\x20sent',JSON[_0xf332('0x18')](_0xfa6c6));if(_0xfa6c6['error']){if(_0xfa6c6[_0xf332('0x19')]['code']===0x1f4){logger[_0xf332('0x19')]('SmsAccount,\x20%s,\x20%s',_0x492df9,_0xfa6c6[_0xf332('0x19')][_0xf332('0x1a')]);return _0x5f410e(_0xfa6c6[_0xf332('0x19')][_0xf332('0x1a')]);}logger[_0xf332('0x19')](_0xf332('0x14'),_0x492df9,_0xfa6c6[_0xf332('0x19')][_0xf332('0x1a')]);return _0x508cd5(_0xfa6c6[_0xf332('0x19')][_0xf332('0x1a')]);}else{logger['info'](_0xf332('0x14'),_0x492df9,'request\x20sent');_0x508cd5(_0xfa6c6[_0xf332('0x1b')][_0xf332('0x1a')]);}})['catch'](function(_0x14742d){logger['error'](_0xf332('0x14'),_0x492df9,_0x14742d);_0x5f410e(_0x14742d);});});}exports[_0xf332('0x1c')]=function(_0x393e59){var _0x2a5a22=this;return new Promise(function(_0x1a0250,_0x396af9){return db[_0xf332('0x1d')][_0xf332('0x1e')]({'raw':_0x393e59[_0xf332('0x1f')]?_0x393e59[_0xf332('0x1f')][_0xf332('0x20')]===undefined?!![]:![]:!![],'where':_0x393e59['options']?_0x393e59[_0xf332('0x1f')][_0xf332('0x21')]||null:null,'attributes':_0x393e59['options']?_0x393e59[_0xf332('0x1f')][_0xf332('0x22')]||null:null,'include':_0x393e59[_0xf332('0x1f')]?_0x393e59['options'][_0xf332('0x23')]?_['map'](_0x393e59[_0xf332('0x1f')][_0xf332('0x23')],function(_0x54e5bd){return{'model':db[_0x54e5bd[_0xf332('0x24')]],'as':_0x54e5bd['as'],'attributes':_0x54e5bd['attributes'],'include':_0x54e5bd[_0xf332('0x23')]?_[_0xf332('0x25')](_0x54e5bd[_0xf332('0x23')],function(_0x29410e){return{'model':db[_0x29410e[_0xf332('0x24')]],'as':_0x29410e['as'],'attributes':_0x29410e[_0xf332('0x22')],'include':_0x29410e[_0xf332('0x23')]?_[_0xf332('0x25')](_0x29410e['include'],function(_0x37905e){return{'model':db[_0x37905e[_0xf332('0x24')]],'as':_0x37905e['as'],'attributes':_0x37905e[_0xf332('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf332('0x12')](function(_0x208d52){logger[_0xf332('0x13')]('ShowSmsAccount',_0x393e59);logger['debug'](_0xf332('0x1c'),_0x393e59,JSON[_0xf332('0x18')](_0x208d52));_0x1a0250(_0x208d52);})[_0xf332('0x26')](function(_0x308309){logger['error'](_0xf332('0x1c'),_0x308309[_0xf332('0x1a')],_0x393e59);_0x396af9(_0x2a5a22[_0xf332('0x19')](0x1f4,_0x308309['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index dc541ee..f28fa3b 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(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index f33f61f..5c821a1 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x541f70,_0x5781d0){var _0x1794de=function(_0x128a4f){while(--_0x128a4f){_0x541f70['push'](_0x541f70['shift']());}};_0x1794de(++_0x5781d0);}(_0x3e74,0x175));var _0x43e7=function(_0x2824df,_0xd773fb){_0x2824df=_0x2824df-0x0;var _0x16a462=_0x3e74[_0x2824df];return _0x16a462;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _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(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 5401a09..5301fdd 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 _0x1b12=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x251728,_0x34cfdf){var _0x5bd7a5=function(_0x54697d){while(--_0x54697d){_0x251728['push'](_0x251728['shift']());}};_0x5bd7a5(++_0x34cfdf);}(_0x1b12,0x66));var _0x21b1=function(_0x5e472d,_0x473a0f){_0x5e472d=_0x5e472d-0x0;var _0x1ff49f=_0x1b12[_0x5e472d];return _0x1ff49f;};'use strict';var Sequelize=require(_0x21b1('0x0'));module['exports']={'priority':{'type':Sequelize[_0x21b1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x21b1('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x21b1('0x3')]()},'description':{'type':Sequelize[_0x21b1('0x2')]},'interval':{'type':Sequelize[_0x21b1('0x2')],'defaultValue':_0x21b1('0x4')}}; \ No newline at end of file +var _0x1d20=['STRING','noop','*,*,*,*','sequelize','INTEGER'];(function(_0x1f7097,_0xfcd44a){var _0x1502aa=function(_0x1fe7d5){while(--_0x1fe7d5){_0x1f7097['push'](_0x1f7097['shift']());}};_0x1502aa(++_0xfcd44a);}(_0x1d20,0xb2));var _0x01d2=function(_0x4b427c,_0x5c3124){_0x4b427c=_0x4b427c-0x0;var _0x4bd79d=_0x1d20[_0x4b427c];return _0x4bd79d;};'use strict';var Sequelize=require(_0x01d2('0x0'));module['exports']={'priority':{'type':Sequelize[_0x01d2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x01d2('0x2')],'allowNull':![],'defaultValue':_0x01d2('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x01d2('0x2')],'defaultValue':_0x01d2('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c6ac779..b5f6510 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 _0xdd0f=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','length','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xdd0f,0x64));var _0xfdd0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd0f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfdd0('0x0'));var rimraf=require(_0xfdd0('0x1'));var zipdir=require(_0xfdd0('0x2'));var jsonpatch=require(_0xfdd0('0x3'));var rp=require(_0xfdd0('0x4'));var moment=require(_0xfdd0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfdd0('0x6'));var util=require(_0xfdd0('0x7'));var path=require(_0xfdd0('0x8'));var sox=require('sox');var csv=require(_0xfdd0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdd0('0xa'));var _=require(_0xfdd0('0xb'));var squel=require(_0xfdd0('0xc'));var crypto=require(_0xfdd0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfdd0('0x9'));var querystring=require('querystring');var Papa=require(_0xfdd0('0xe'));var Redis=require(_0xfdd0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfdd0('0x10'));var hardwareService=require(_0xfdd0('0x11'));var logger=require(_0xfdd0('0x12'))(_0xfdd0('0x13'));var utils=require(_0xfdd0('0x14'));var config=require(_0xfdd0('0x15'));var licenseUtil=require(_0xfdd0('0x16'));var db=require(_0xfdd0('0x17'))['db'];function respondWithStatusCode(_0x11567e,_0x3414f4){_0x3414f4=_0x3414f4||0xcc;return function(_0x18baf1){if(_0x18baf1){return _0x11567e[_0xfdd0('0x18')](_0x3414f4);}return _0x11567e[_0xfdd0('0x19')](_0x3414f4)[_0xfdd0('0x1a')]();};}function respondWithResult(_0x3ef6ef,_0x847a85){_0x847a85=_0x847a85||0xc8;return function(_0x10af57){if(_0x10af57){return _0x3ef6ef['status'](_0x847a85)[_0xfdd0('0x1b')](_0x10af57);}};}function respondWithFilteredResult(_0x436dbf,_0x57167c){return function(_0x3b3923){if(_0x3b3923){var _0x5d41b4=typeof _0x57167c[_0xfdd0('0x1c')]===_0xfdd0('0x1d')&&typeof _0x57167c[_0xfdd0('0x1e')]===_0xfdd0('0x1d');var _0x5b6db1=_0x3b3923[_0xfdd0('0x1f')];var _0x1a3aed=_0x5d41b4?0x0:_0x57167c[_0xfdd0('0x1c')];var _0x31fbf3=_0x5d41b4?_0x3b3923['count']:_0x57167c[_0xfdd0('0x1c')]+_0x57167c[_0xfdd0('0x1e')];var _0x1ce5f4;if(_0x31fbf3>=_0x5b6db1){_0x31fbf3=_0x5b6db1;_0x1ce5f4=0xc8;}else{_0x1ce5f4=0xce;}_0x436dbf[_0xfdd0('0x19')](_0x1ce5f4);return _0x436dbf['set'](_0xfdd0('0x20'),_0x1a3aed+'-'+_0x31fbf3+'/'+_0x5b6db1)[_0xfdd0('0x1b')](_0x3b3923);}return null;};}function patchUpdates(_0x201792){return function(_0x3a3bbc){try{jsonpatch[_0xfdd0('0x21')](_0x3a3bbc,_0x201792,!![]);}catch(_0x2b005e){return BPromise[_0xfdd0('0x22')](_0x2b005e);}return _0x3a3bbc[_0xfdd0('0x23')]();};}function saveUpdates(_0x5b6fbc,_0x5d254d){return function(_0x2732f2){if(_0x2732f2){return _0x2732f2[_0xfdd0('0x24')](_0x5b6fbc)[_0xfdd0('0x25')](function(_0x4c9748){return _0x4c9748;});}return null;};}function removeEntity(_0x325344,_0x579da6){return function(_0x211b81){if(_0x211b81){return _0x211b81[_0xfdd0('0x26')]()[_0xfdd0('0x25')](function(){_0x325344['status'](0xcc)[_0xfdd0('0x1a')]();});}};}function handleEntityNotFound(_0x44084c,_0x52aeb0){return function(_0x2ad2ec){if(!_0x2ad2ec){_0x44084c[_0xfdd0('0x18')](0x194);}return _0x2ad2ec;};}function handleError(_0x2afbbd,_0x2468ea){_0x2468ea=_0x2468ea||0x1f4;return function(_0x28a93c){logger['error'](_0x28a93c[_0xfdd0('0x27')]);if(_0x28a93c[_0xfdd0('0x28')]){delete _0x28a93c[_0xfdd0('0x28')];}_0x2afbbd[_0xfdd0('0x19')](_0x2468ea)['send'](_0x28a93c);};}exports[_0xfdd0('0x29')]=function(_0x86cdc3,_0x10d998){var _0x5a0bc5={},_0x46a4f8={},_0x31e7f9={'count':0x0,'rows':[]};var _0xead30f=_[_0xfdd0('0x2a')](db[_0xfdd0('0x2b')][_0xfdd0('0x2c')],function(_0x2458a1){return{'name':_0x2458a1[_0xfdd0('0x2d')],'type':_0x2458a1[_0xfdd0('0x2e')][_0xfdd0('0x2f')]};});_0x46a4f8[_0xfdd0('0x30')]=_[_0xfdd0('0x2a')](_0xead30f,'name');_0x46a4f8[_0xfdd0('0x31')]=_['keys'](_0x86cdc3[_0xfdd0('0x31')]);_0x46a4f8['filters']=_[_0xfdd0('0x32')](_0x46a4f8[_0xfdd0('0x30')],_0x46a4f8[_0xfdd0('0x31')]);_0x5a0bc5[_0xfdd0('0x33')]=_[_0xfdd0('0x32')](_0x46a4f8[_0xfdd0('0x30')],qs[_0xfdd0('0x34')](_0x86cdc3[_0xfdd0('0x31')]['fields']));_0x5a0bc5['attributes']=_0x5a0bc5[_0xfdd0('0x33')]['length']?_0x5a0bc5[_0xfdd0('0x33')]:_0x46a4f8[_0xfdd0('0x30')];if(!_0x86cdc3[_0xfdd0('0x31')][_0xfdd0('0x35')](_0xfdd0('0x36'))){_0x5a0bc5['limit']=qs[_0xfdd0('0x1e')](_0x86cdc3[_0xfdd0('0x31')][_0xfdd0('0x1e')]);_0x5a0bc5[_0xfdd0('0x1c')]=qs[_0xfdd0('0x1c')](_0x86cdc3[_0xfdd0('0x31')][_0xfdd0('0x1c')]);}_0x5a0bc5[_0xfdd0('0x37')]=qs[_0xfdd0('0x38')](_0x86cdc3[_0xfdd0('0x31')][_0xfdd0('0x38')]);_0x5a0bc5[_0xfdd0('0x39')]=qs[_0xfdd0('0x3a')](_[_0xfdd0('0x3b')](_0x86cdc3[_0xfdd0('0x31')],_0x46a4f8[_0xfdd0('0x3a')]),_0xead30f);if(_0x86cdc3['query'][_0xfdd0('0x3c')]){_0x5a0bc5['where']=_[_0xfdd0('0x3d')](_0x5a0bc5[_0xfdd0('0x39')],{'$or':_['map'](_0xead30f,function(_0x41922d){if(_0x41922d[_0xfdd0('0x2e')]!==_0xfdd0('0x3e')){var _0x42f9b5={};_0x42f9b5[_0x41922d['name']]={'$like':'%'+_0x86cdc3[_0xfdd0('0x31')][_0xfdd0('0x3c')]+'%'};return _0x42f9b5;}})});}_0x5a0bc5=_[_0xfdd0('0x3d')]({},_0x5a0bc5,_0x86cdc3[_0xfdd0('0x3f')]);var _0x246993={'where':_0x5a0bc5[_0xfdd0('0x39')]};return db[_0xfdd0('0x2b')][_0xfdd0('0x1f')](_0x246993)[_0xfdd0('0x25')](function(_0x14ea7b){_0x31e7f9['count']=_0x14ea7b;if(_0x86cdc3[_0xfdd0('0x31')]['includeAll']){_0x5a0bc5[_0xfdd0('0x40')]=[{'all':!![]}];}return db[_0xfdd0('0x2b')][_0xfdd0('0x41')](_0x5a0bc5);})[_0xfdd0('0x25')](function(_0x419fbe){_0x31e7f9['rows']=_0x419fbe;return _0x31e7f9;})['then'](respondWithFilteredResult(_0x10d998,_0x5a0bc5))[_0xfdd0('0x42')](handleError(_0x10d998,null));};exports[_0xfdd0('0x43')]=function(_0x48c9fe,_0x2deb5f){var _0x39c8ae={'raw':!![],'where':{'id':_0x48c9fe['params']['id']}},_0x33de27={};_0x33de27['model']=_[_0xfdd0('0x44')](db[_0xfdd0('0x2b')]['rawAttributes']);_0x33de27['query']=_[_0xfdd0('0x44')](_0x48c9fe[_0xfdd0('0x31')]);_0x33de27[_0xfdd0('0x3a')]=_[_0xfdd0('0x32')](_0x33de27[_0xfdd0('0x30')],_0x33de27[_0xfdd0('0x31')]);_0x39c8ae[_0xfdd0('0x33')]=_[_0xfdd0('0x32')](_0x33de27[_0xfdd0('0x30')],qs['fields'](_0x48c9fe['query'][_0xfdd0('0x34')]));_0x39c8ae[_0xfdd0('0x33')]=_0x39c8ae[_0xfdd0('0x33')][_0xfdd0('0x45')]?_0x39c8ae[_0xfdd0('0x33')]:_0x33de27[_0xfdd0('0x30')];if(_0x48c9fe[_0xfdd0('0x31')][_0xfdd0('0x46')]){_0x39c8ae[_0xfdd0('0x40')]=[{'all':!![]}];}_0x39c8ae=_[_0xfdd0('0x3d')]({},_0x39c8ae,_0x48c9fe[_0xfdd0('0x3f')]);return db['SmsApplication'][_0xfdd0('0x47')](_0x39c8ae)[_0xfdd0('0x25')](handleEntityNotFound(_0x2deb5f,null))[_0xfdd0('0x25')](respondWithResult(_0x2deb5f,null))[_0xfdd0('0x42')](handleError(_0x2deb5f,null));};exports[_0xfdd0('0x48')]=function(_0x59dff0,_0x4a835b){return db[_0xfdd0('0x2b')][_0xfdd0('0x48')](_0x59dff0['body'],{})[_0xfdd0('0x25')](respondWithResult(_0x4a835b,0xc9))[_0xfdd0('0x42')](handleError(_0x4a835b,null));};exports[_0xfdd0('0x24')]=function(_0x3e5b01,_0x2134f2){if(_0x3e5b01[_0xfdd0('0x49')]['id']){delete _0x3e5b01['body']['id'];}return db['SmsApplication'][_0xfdd0('0x47')]({'where':{'id':_0x3e5b01[_0xfdd0('0x4a')]['id']}})[_0xfdd0('0x25')](handleEntityNotFound(_0x2134f2,null))[_0xfdd0('0x25')](saveUpdates(_0x3e5b01[_0xfdd0('0x49')],null))['then'](respondWithResult(_0x2134f2,null))[_0xfdd0('0x42')](handleError(_0x2134f2,null));};exports[_0xfdd0('0x26')]=function(_0x308092,_0x48a58e){return db[_0xfdd0('0x2b')]['find']({'where':{'id':_0x308092['params']['id']}})['then'](handleEntityNotFound(_0x48a58e,null))[_0xfdd0('0x25')](removeEntity(_0x48a58e,null))[_0xfdd0('0x42')](handleError(_0x48a58e,null));}; \ No newline at end of file +var _0xc59b=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','map','SmsApplication','type','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js'];(function(_0x208d83,_0x214b5f){var _0x15d0f9=function(_0x32a57c){while(--_0x32a57c){_0x208d83['push'](_0x208d83['shift']());}};_0x15d0f9(++_0x214b5f);}(_0xc59b,0x18b));var _0xbc59=function(_0x415fd9,_0x899e1e){_0x415fd9=_0x415fd9-0x0;var _0x2ad505=_0xc59b[_0x415fd9];return _0x2ad505;};'use strict';var emlformat=require(_0xbc59('0x0'));var rimraf=require(_0xbc59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc59('0x2'));var rp=require(_0xbc59('0x3'));var moment=require(_0xbc59('0x4'));var BPromise=require(_0xbc59('0x5'));var Mustache=require('mustache');var util=require(_0xbc59('0x6'));var path=require(_0xbc59('0x7'));var sox=require('sox');var csv=require(_0xbc59('0x8'));var ejs=require(_0xbc59('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc59('0xa'));var squel=require('squel');var crypto=require(_0xbc59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbc59('0xc'));var toCsv=require(_0xbc59('0x8'));var querystring=require(_0xbc59('0xd'));var Papa=require(_0xbc59('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc59('0xf'));var as=require(_0xbc59('0x10'));var hardwareService=require(_0xbc59('0x11'));var logger=require('../../config/logger')(_0xbc59('0x12'));var utils=require(_0xbc59('0x13'));var config=require(_0xbc59('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc59('0x15'))['db'];function respondWithStatusCode(_0x40ca70,_0x3c64f0){_0x3c64f0=_0x3c64f0||0xcc;return function(_0x2512d5){if(_0x2512d5){return _0x40ca70[_0xbc59('0x16')](_0x3c64f0);}return _0x40ca70[_0xbc59('0x17')](_0x3c64f0)['end']();};}function respondWithResult(_0x37ac24,_0x46fcf4){_0x46fcf4=_0x46fcf4||0xc8;return function(_0x4b77c7){if(_0x4b77c7){return _0x37ac24[_0xbc59('0x17')](_0x46fcf4)[_0xbc59('0x18')](_0x4b77c7);}};}function respondWithFilteredResult(_0x4c4e23,_0x1b712e){return function(_0x598687){if(_0x598687){var _0xe575bc=typeof _0x1b712e[_0xbc59('0x19')]===_0xbc59('0x1a')&&typeof _0x1b712e[_0xbc59('0x1b')]==='undefined';var _0x4a28b3=_0x598687[_0xbc59('0x1c')];var _0x479df7=_0xe575bc?0x0:_0x1b712e[_0xbc59('0x19')];var _0xc3cbd6=_0xe575bc?_0x598687[_0xbc59('0x1c')]:_0x1b712e['offset']+_0x1b712e[_0xbc59('0x1b')];var _0x48a78c;if(_0xc3cbd6>=_0x4a28b3){_0xc3cbd6=_0x4a28b3;_0x48a78c=0xc8;}else{_0x48a78c=0xce;}_0x4c4e23['status'](_0x48a78c);return _0x4c4e23[_0xbc59('0x1d')](_0xbc59('0x1e'),_0x479df7+'-'+_0xc3cbd6+'/'+_0x4a28b3)['json'](_0x598687);}return null;};}function patchUpdates(_0x55762a){return function(_0x5eeaba){try{jsonpatch[_0xbc59('0x1f')](_0x5eeaba,_0x55762a,!![]);}catch(_0x1e196a){return BPromise[_0xbc59('0x20')](_0x1e196a);}return _0x5eeaba['save']();};}function saveUpdates(_0x3e2f1b,_0x4d586c){return function(_0x361b5c){if(_0x361b5c){return _0x361b5c[_0xbc59('0x21')](_0x3e2f1b)[_0xbc59('0x22')](function(_0x224319){return _0x224319;});}return null;};}function removeEntity(_0x38723e,_0x3f5eba){return function(_0x4e9828){if(_0x4e9828){return _0x4e9828[_0xbc59('0x23')]()[_0xbc59('0x22')](function(){_0x38723e[_0xbc59('0x17')](0xcc)[_0xbc59('0x24')]();});}};}function handleEntityNotFound(_0x3b702f,_0x397a81){return function(_0x5c076f){if(!_0x5c076f){_0x3b702f[_0xbc59('0x16')](0x194);}return _0x5c076f;};}function handleError(_0x45c336,_0x421718){_0x421718=_0x421718||0x1f4;return function(_0x55c07e){logger[_0xbc59('0x25')](_0x55c07e['stack']);if(_0x55c07e['name']){delete _0x55c07e[_0xbc59('0x26')];}_0x45c336[_0xbc59('0x17')](_0x421718)[_0xbc59('0x27')](_0x55c07e);};}exports['index']=function(_0x20d551,_0x3f4503){var _0x56ce61={},_0x1ff1fd={},_0x50fb5d={'count':0x0,'rows':[]};var _0x1b8786=_[_0xbc59('0x28')](db[_0xbc59('0x29')]['rawAttributes'],function(_0x1ff984){return{'name':_0x1ff984['fieldName'],'type':_0x1ff984[_0xbc59('0x2a')]['key']};});_0x1ff1fd[_0xbc59('0x2b')]=_[_0xbc59('0x28')](_0x1b8786,_0xbc59('0x26'));_0x1ff1fd['query']=_[_0xbc59('0x2c')](_0x20d551[_0xbc59('0x2d')]);_0x1ff1fd['filters']=_[_0xbc59('0x2e')](_0x1ff1fd[_0xbc59('0x2b')],_0x1ff1fd['query']);_0x56ce61['attributes']=_[_0xbc59('0x2e')](_0x1ff1fd[_0xbc59('0x2b')],qs[_0xbc59('0x2f')](_0x20d551['query'][_0xbc59('0x2f')]));_0x56ce61[_0xbc59('0x30')]=_0x56ce61[_0xbc59('0x30')][_0xbc59('0x31')]?_0x56ce61[_0xbc59('0x30')]:_0x1ff1fd[_0xbc59('0x2b')];if(!_0x20d551[_0xbc59('0x2d')]['hasOwnProperty'](_0xbc59('0x32'))){_0x56ce61[_0xbc59('0x1b')]=qs['limit'](_0x20d551[_0xbc59('0x2d')][_0xbc59('0x1b')]);_0x56ce61[_0xbc59('0x19')]=qs[_0xbc59('0x19')](_0x20d551['query'][_0xbc59('0x19')]);}_0x56ce61[_0xbc59('0x33')]=qs[_0xbc59('0x34')](_0x20d551[_0xbc59('0x2d')][_0xbc59('0x34')]);_0x56ce61[_0xbc59('0x35')]=qs[_0xbc59('0x36')](_[_0xbc59('0x37')](_0x20d551[_0xbc59('0x2d')],_0x1ff1fd[_0xbc59('0x36')]),_0x1b8786);if(_0x20d551[_0xbc59('0x2d')][_0xbc59('0x38')]){_0x56ce61[_0xbc59('0x35')]=_['merge'](_0x56ce61[_0xbc59('0x35')],{'$or':_[_0xbc59('0x28')](_0x1b8786,function(_0x28d320){if(_0x28d320['type']!==_0xbc59('0x39')){var _0x48f9a6={};_0x48f9a6[_0x28d320[_0xbc59('0x26')]]={'$like':'%'+_0x20d551[_0xbc59('0x2d')][_0xbc59('0x38')]+'%'};return _0x48f9a6;}})});}_0x56ce61=_[_0xbc59('0x3a')]({},_0x56ce61,_0x20d551['options']);var _0x8440a0={'where':_0x56ce61['where']};return db[_0xbc59('0x29')][_0xbc59('0x1c')](_0x8440a0)[_0xbc59('0x22')](function(_0x2d7949){_0x50fb5d['count']=_0x2d7949;if(_0x20d551['query']['includeAll']){_0x56ce61['include']=[{'all':!![]}];}return db['SmsApplication'][_0xbc59('0x3b')](_0x56ce61);})[_0xbc59('0x22')](function(_0x11f5e7){_0x50fb5d[_0xbc59('0x3c')]=_0x11f5e7;return _0x50fb5d;})[_0xbc59('0x22')](respondWithFilteredResult(_0x3f4503,_0x56ce61))[_0xbc59('0x3d')](handleError(_0x3f4503,null));};exports[_0xbc59('0x3e')]=function(_0xcd6cd,_0x2a4e8a){var _0xe6495d={'raw':!![],'where':{'id':_0xcd6cd[_0xbc59('0x3f')]['id']}},_0x12cd5d={};_0x12cd5d[_0xbc59('0x2b')]=_[_0xbc59('0x2c')](db['SmsApplication'][_0xbc59('0x40')]);_0x12cd5d[_0xbc59('0x2d')]=_['keys'](_0xcd6cd['query']);_0x12cd5d[_0xbc59('0x36')]=_[_0xbc59('0x2e')](_0x12cd5d['model'],_0x12cd5d['query']);_0xe6495d['attributes']=_[_0xbc59('0x2e')](_0x12cd5d['model'],qs['fields'](_0xcd6cd['query']['fields']));_0xe6495d[_0xbc59('0x30')]=_0xe6495d[_0xbc59('0x30')][_0xbc59('0x31')]?_0xe6495d[_0xbc59('0x30')]:_0x12cd5d[_0xbc59('0x2b')];if(_0xcd6cd[_0xbc59('0x2d')]['includeAll']){_0xe6495d['include']=[{'all':!![]}];}_0xe6495d=_['merge']({},_0xe6495d,_0xcd6cd['options']);return db[_0xbc59('0x29')][_0xbc59('0x41')](_0xe6495d)[_0xbc59('0x22')](handleEntityNotFound(_0x2a4e8a,null))[_0xbc59('0x22')](respondWithResult(_0x2a4e8a,null))[_0xbc59('0x3d')](handleError(_0x2a4e8a,null));};exports[_0xbc59('0x42')]=function(_0x350858,_0x3736a8){return db['SmsApplication'][_0xbc59('0x42')](_0x350858['body'],{})[_0xbc59('0x22')](respondWithResult(_0x3736a8,0xc9))[_0xbc59('0x3d')](handleError(_0x3736a8,null));};exports[_0xbc59('0x21')]=function(_0x42d8fe,_0x26ce78){if(_0x42d8fe['body']['id']){delete _0x42d8fe[_0xbc59('0x43')]['id'];}return db[_0xbc59('0x29')][_0xbc59('0x41')]({'where':{'id':_0x42d8fe[_0xbc59('0x3f')]['id']}})[_0xbc59('0x22')](handleEntityNotFound(_0x26ce78,null))[_0xbc59('0x22')](saveUpdates(_0x42d8fe[_0xbc59('0x43')],null))[_0xbc59('0x22')](respondWithResult(_0x26ce78,null))[_0xbc59('0x3d')](handleError(_0x26ce78,null));};exports[_0xbc59('0x23')]=function(_0x570790,_0x590e02){return db[_0xbc59('0x29')][_0xbc59('0x41')]({'where':{'id':_0x570790[_0xbc59('0x3f')]['id']}})[_0xbc59('0x22')](handleEntityNotFound(_0x590e02,null))[_0xbc59('0x22')](removeEntity(_0x590e02,null))['catch'](handleError(_0x590e02,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ef8b276..9a29c70 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 _0x54ba=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsApplication.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x54ba,0x170));var _0xa54b=function(_0x319366,_0x5f39c6){_0x319366=_0x319366-0x0;var _0x533a36=_0x54ba[_0x319366];return _0x533a36;};'use strict';var _=require(_0xa54b('0x0'));var util=require(_0xa54b('0x1'));var logger=require(_0xa54b('0x2'))(_0xa54b('0x3'));var moment=require(_0xa54b('0x4'));var BPromise=require(_0xa54b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54b('0x6'));var rimraf=require('rimraf');var config=require(_0xa54b('0x7'));var attributes=require(_0xa54b('0x8'));module[_0xa54b('0x9')]=function(_0x3ca5d5,_0x574edb){return _0x3ca5d5['define'](_0xa54b('0xa'),attributes,{'tableName':_0xa54b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa54b('0xc'),'collate':_0xa54b('0xd')});}; \ No newline at end of file +var _0x6cd3=['path','rimraf','./smsApplication.attributes','exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird'];(function(_0x1b374e,_0x5d5c92){var _0x5ab52b=function(_0x5c5dec){while(--_0x5c5dec){_0x1b374e['push'](_0x1b374e['shift']());}};_0x5ab52b(++_0x5d5c92);}(_0x6cd3,0x1a1));var _0x36cd=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x6cd3[_0x1db481];return _0x3db95b;};'use strict';var _=require('lodash');var util=require(_0x36cd('0x0'));var logger=require(_0x36cd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x36cd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36cd('0x3'));var rimraf=require(_0x36cd('0x4'));var config=require('../../config/environment');var attributes=require(_0x36cd('0x5'));module[_0x36cd('0x6')]=function(_0xd97977,_0x3ac55d){return _0xd97977['define'](_0x36cd('0x7'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x36cd('0x8'),'collate':_0x36cd('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0d308ef..e687904 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 _0x3af5=['stringify','error','code','message','info','request\x20sent','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3af5,0x1d3));var _0x53af=function(_0x486008,_0x2b2d05){_0x486008=_0x486008-0x0;var _0x2fefc7=_0x3af5[_0x486008];return _0x2fefc7;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var moment=require('moment');var BPromise=require(_0x53af('0x2'));var rs=require(_0x53af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53af('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x53af('0x5'));var jayson=require(_0x53af('0x6'));var client=jayson['client'][_0x53af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eb461,_0x3aefaf,_0x27eed3){return new BPromise(function(_0x2875ab,_0x22c0cb){return client[_0x53af('0x8')](_0x4eb461,_0x27eed3)[_0x53af('0x9')](function(_0x56751b){logger['info'](_0x53af('0xa'),_0x3aefaf,'request\x20sent');logger[_0x53af('0xb')](_0x53af('0xc'),_0x3aefaf,'request\x20sent',JSON[_0x53af('0xd')](_0x56751b));if(_0x56751b[_0x53af('0xe')]){if(_0x56751b['error'][_0x53af('0xf')]===0x1f4){logger[_0x53af('0xe')](_0x53af('0xa'),_0x3aefaf,_0x56751b['error'][_0x53af('0x10')]);return _0x22c0cb(_0x56751b['error'][_0x53af('0x10')]);}logger[_0x53af('0xe')](_0x53af('0xa'),_0x3aefaf,_0x56751b[_0x53af('0xe')][_0x53af('0x10')]);return _0x2875ab(_0x56751b[_0x53af('0xe')][_0x53af('0x10')]);}else{logger[_0x53af('0x11')](_0x53af('0xa'),_0x3aefaf,_0x53af('0x12'));_0x2875ab(_0x56751b['result'][_0x53af('0x10')]);}})[_0x53af('0x13')](function(_0x29bb86){logger[_0x53af('0xe')](_0x53af('0xa'),_0x3aefaf,_0x29bb86);_0x22c0cb(_0x29bb86);});});} \ No newline at end of file +var _0x11c8=['jayson/promise','client','request\x20sent','debug','stringify','error','code','message','info','SmsApplication,\x20%s,\x20%s','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x11c8,0x19a));var _0x811c=function(_0x50d7c7,_0x3cef1d){_0x50d7c7=_0x50d7c7-0x0;var _0x5cb0f5=_0x11c8[_0x50d7c7];return _0x5cb0f5;};'use strict';var _=require('lodash');var util=require(_0x811c('0x0'));var moment=require(_0x811c('0x1'));var BPromise=require('bluebird');var rs=require(_0x811c('0x2'));var fs=require('fs');var Redis=require(_0x811c('0x3'));var db=require(_0x811c('0x4'))['db'];var utils=require(_0x811c('0x5'));var logger=require(_0x811c('0x6'))(_0x811c('0x7'));var config=require('../../config/environment');var jayson=require(_0x811c('0x8'));var client=jayson[_0x811c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126cc2,_0x8af784,_0x13a95a){return new BPromise(function(_0x3e81ac,_0x57a92d){return client['request'](_0x126cc2,_0x13a95a)['then'](function(_0x5be7fc){logger['info']('SmsApplication,\x20%s,\x20%s',_0x8af784,_0x811c('0xa'));logger[_0x811c('0xb')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x8af784,_0x811c('0xa'),JSON[_0x811c('0xc')](_0x5be7fc));if(_0x5be7fc[_0x811c('0xd')]){if(_0x5be7fc[_0x811c('0xd')][_0x811c('0xe')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x8af784,_0x5be7fc[_0x811c('0xd')]['message']);return _0x57a92d(_0x5be7fc[_0x811c('0xd')][_0x811c('0xf')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x8af784,_0x5be7fc[_0x811c('0xd')][_0x811c('0xf')]);return _0x3e81ac(_0x5be7fc[_0x811c('0xd')][_0x811c('0xf')]);}else{logger[_0x811c('0x10')](_0x811c('0x11'),_0x8af784,'request\x20sent');_0x3e81ac(_0x5be7fc['result'][_0x811c('0xf')]);}})[_0x811c('0x12')](function(_0x3b0895){logger[_0x811c('0xd')](_0x811c('0x11'),_0x8af784,_0x3b0895);_0x57a92d(_0x3b0895);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 68ca30e..d843e30 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 _0x14a0=['/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','/describe','describe','getMessages'];(function(_0x595dc7,_0x272582){var _0x247904=function(_0x66f648){while(--_0x66f648){_0x595dc7['push'](_0x595dc7['shift']());}};_0x247904(++_0x272582);}(_0x14a0,0x8e));var _0x014a=function(_0x422890,_0x434494){_0x422890=_0x422890-0x0;var _0x202cf0=_0x14a0[_0x422890];return _0x202cf0;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['download']);router[_0x014a('0xe')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0xe')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0xe')](_0x014a('0x12'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),'smsinteraction:addtags'),controller[_0x014a('0x15')]);router[_0x014a('0x16')]('/:id',auth[_0x014a('0x9')](),interaction[_0x014a('0x13')]('sms',_0x014a('0x17')),controller[_0x014a('0x18')]);router[_0x014a('0x19')](_0x014a('0x1a'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),_0x014a('0x1b')),controller[_0x014a('0x1c')]);router[_0x014a('0x19')](_0x014a('0x12'),auth[_0x014a('0x9')](),controller[_0x014a('0x1d')]);module[_0x014a('0x1e')]=router; \ No newline at end of file +var _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5c00,0x17e));var _0x05c0=function(_0x18c44d,_0x33976d){_0x18c44d=_0x18c44d-0x0;var _0x71abcf=_0x5c00[_0x18c44d];return _0x71abcf;};'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('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 460efc1..4e8d3ba 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 _0x6f7b=['STRING','ENUM','out','moment','exports','BOOLEAN','DATE'];(function(_0x43f8cc,_0x592b95){var _0x1c8808=function(_0x352bf9){while(--_0x352bf9){_0x43f8cc['push'](_0x43f8cc['shift']());}};_0x1c8808(++_0x592b95);}(_0x6f7b,0x168));var _0xb6f7=function(_0x470bab,_0x342f23){_0x470bab=_0x470bab-0x0;var _0x588151=_0x6f7b[_0x470bab];return _0x588151;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb6f7('0x0'));module[_0xb6f7('0x1')]={'closed':{'type':Sequelize[_0xb6f7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb6f7('0x3')]},'disposition':{'type':Sequelize[_0xb6f7('0x4')]},'secondDisposition':{'type':Sequelize[_0xb6f7('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb6f7('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb6f7('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb6f7('0x5')]('in',_0xb6f7('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb6f7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb6f7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb6f7('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe5e0=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0xe3b862,_0x23f099){var _0x129092=function(_0x1552a5){while(--_0x1552a5){_0xe3b862['push'](_0xe3b862['shift']());}};_0x129092(++_0x23f099);}(_0xe5e0,0x123));var _0x0e5e=function(_0x2f3ac6,_0x183857){_0x2f3ac6=_0x2f3ac6-0x0;var _0x6b9e3=_0xe5e0[_0x2f3ac6];return _0x6b9e3;};'use strict';var Sequelize=require(_0x0e5e('0x0'));var moment=require(_0x0e5e('0x1'));module[_0x0e5e('0x2')]={'closed':{'type':Sequelize[_0x0e5e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0e5e('0x4')]},'disposition':{'type':Sequelize[_0x0e5e('0x5')]},'secondDisposition':{'type':Sequelize[_0x0e5e('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0e5e('0x5')]},'note':{'type':Sequelize[_0x0e5e('0x5')]},'phone':{'type':Sequelize[_0x0e5e('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0e5e('0x6')]('in',_0x0e5e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0e5e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0e5e('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 b4121f1..4a8dfa9 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 _0xa50d=['disposition','map','out','System','value','views','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','update','then','destroy','error','stack','name','send','index','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','catch','show','model','keys','query','attributes','intersection','include','merge','options','find','create','body','params','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','filters','fields','length','hasOwnProperty','nolimit','sort','where','SmsInteractionId','filter','$gte','format','includeAll','rows','addTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa50d,0x86));var _0xda50=function(_0x431526,_0x4c95cc){_0x431526=_0x431526-0x0;var _0x56c3fd=_0xa50d[_0x431526];return _0x56c3fd;};'use strict';var rimraf=require(_0xda50('0x0'));var zipdir=require(_0xda50('0x1'));var moment=require(_0xda50('0x2'));var BPromise=require(_0xda50('0x3'));var util=require(_0xda50('0x4'));var path=require('path');var ejs=require(_0xda50('0x5'));var fs=require('fs');var _=require(_0xda50('0x6'));var Redis=require(_0xda50('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xda50('0x8'));var pdf=require(_0xda50('0x9'));var logger=require(_0xda50('0xa'))('api');var config=require('../../config/environment');var db=require(_0xda50('0xb'))['db'];config[_0xda50('0xc')]=_[_0xda50('0xd')](config[_0xda50('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda50('0xc')]));require(_0xda50('0xe'))[_0xda50('0xf')](socket);function respondWithStatusCode(_0x2174ea,_0x485a1c){_0x485a1c=_0x485a1c||0xcc;return function(_0x1ba75f){if(_0x1ba75f){return _0x2174ea[_0xda50('0x10')](_0x485a1c);}return _0x2174ea['status'](_0x485a1c)[_0xda50('0x11')]();};}function respondWithResult(_0x145d37,_0x547b2c){_0x547b2c=_0x547b2c||0xc8;return function(_0x4a5dde){if(_0x4a5dde){return _0x145d37['status'](_0x547b2c)[_0xda50('0x12')](_0x4a5dde);}};}function respondWithFilteredResult(_0x5ccc00,_0x1a99ca){return function(_0x3ca80b){if(_0x3ca80b){var _0x2b359a=typeof _0x1a99ca[_0xda50('0x13')]===_0xda50('0x14')&&typeof _0x1a99ca['limit']==='undefined';var _0x5853c5=_0x3ca80b[_0xda50('0x15')];var _0x17b91e=_0x2b359a?0x0:_0x1a99ca[_0xda50('0x13')];var _0xd3f720=_0x2b359a?_0x3ca80b[_0xda50('0x15')]:_0x1a99ca[_0xda50('0x13')]+_0x1a99ca[_0xda50('0x16')];var _0x20d66e;if(_0xd3f720>=_0x5853c5){_0xd3f720=_0x5853c5;_0x20d66e=0xc8;}else{_0x20d66e=0xce;}_0x5ccc00[_0xda50('0x17')](_0x20d66e);return _0x5ccc00[_0xda50('0x18')](_0xda50('0x19'),_0x17b91e+'-'+_0xd3f720+'/'+_0x5853c5)['json'](_0x3ca80b);}return null;};}function saveUpdates(_0x1e563e){return function(_0x3fa078){if(_0x3fa078){return _0x3fa078[_0xda50('0x1a')](_0x1e563e)[_0xda50('0x1b')](function(_0x5ec150){return _0x5ec150;});}return null;};}function removeEntity(_0x4a24b8){return function(_0x1a8b04){if(_0x1a8b04){return _0x1a8b04[_0xda50('0x1c')]()['then'](function(){_0x4a24b8[_0xda50('0x17')](0xcc)[_0xda50('0x11')]();});}};}function handleEntityNotFound(_0x4dec5c){return function(_0x1de623){if(!_0x1de623){_0x4dec5c['sendStatus'](0x194);}return _0x1de623;};}function handleError(_0x480071,_0x4c86e7){_0x4c86e7=_0x4c86e7||0x1f4;return function(_0x264a7e){logger[_0xda50('0x1d')](_0x264a7e[_0xda50('0x1e')]);if(_0x264a7e[_0xda50('0x1f')]){delete _0x264a7e[_0xda50('0x1f')];}_0x480071['status'](_0x4c86e7)[_0xda50('0x20')](_0x264a7e);};}exports[_0xda50('0x21')]=function(_0xa2a598,_0x52dec9){var _0x55a3db={};var _0x38b43e=_['map'](db[_0xda50('0x22')][_0xda50('0x23')],function(_0x18e1fd){return{'name':_0x18e1fd[_0xda50('0x24')],'type':_0x18e1fd[_0xda50('0x25')][_0xda50('0x26')]};});_0x55a3db=qs[_0xda50('0x27')](_0x38b43e,_0xa2a598);return interaction[_0xda50('0x28')]('sms',_0xa2a598['query'],_0xa2a598['user'],_0x55a3db,_0x38b43e)['then'](respondWithFilteredResult(_0x52dec9,_0x55a3db))[_0xda50('0x29')](handleError(_0x52dec9,null));};exports[_0xda50('0x2a')]=function(_0x5a9643,_0x13ca46){var _0x54e769={'raw':![],'where':{'id':_0x5a9643['params']['id']}},_0x15a403={};_0x15a403[_0xda50('0x2b')]=_[_0xda50('0x2c')](db[_0xda50('0x22')]['rawAttributes']);_0x15a403[_0xda50('0x2d')]=_[_0xda50('0x2c')](_0x5a9643[_0xda50('0x2d')]);_0x15a403['filters']=_['intersection'](_0x15a403[_0xda50('0x2b')],_0x15a403[_0xda50('0x2d')]);_0x54e769[_0xda50('0x2e')]=_[_0xda50('0x2f')](_0x15a403[_0xda50('0x2b')],qs['fields'](_0x5a9643[_0xda50('0x2d')]['fields']));_0x54e769['attributes']=_0x54e769[_0xda50('0x2e')]['length']?_0x54e769[_0xda50('0x2e')]:_0x15a403[_0xda50('0x2b')];if(_0x5a9643[_0xda50('0x2d')]['includeAll']){_0x54e769[_0xda50('0x30')]=[{'all':!![]}];}_0x54e769=_[_0xda50('0x31')]({},_0x54e769,_0x5a9643[_0xda50('0x32')]);return db[_0xda50('0x22')][_0xda50('0x33')](_0x54e769)[_0xda50('0x1b')](handleEntityNotFound(_0x13ca46,null))['then'](respondWithResult(_0x13ca46,null))[_0xda50('0x29')](handleError(_0x13ca46,null));};exports[_0xda50('0x34')]=function(_0x28e74d,_0x43017f){return db[_0xda50('0x22')][_0xda50('0x34')](_0x28e74d[_0xda50('0x35')],{})['then'](respondWithResult(_0x43017f,0xc9))[_0xda50('0x29')](handleError(_0x43017f,null));};exports['update']=function(_0x318339,_0x4734d6){if(_0x318339[_0xda50('0x35')]['id']){delete _0x318339[_0xda50('0x35')]['id'];}return db[_0xda50('0x22')][_0xda50('0x33')]({'where':{'id':_0x318339[_0xda50('0x36')]['id']}})[_0xda50('0x1b')](handleEntityNotFound(_0x4734d6,null))[_0xda50('0x1b')](saveUpdates(_0x318339[_0xda50('0x35')],null))['then'](respondWithResult(_0x4734d6,null))[_0xda50('0x29')](handleError(_0x4734d6,null));};exports['destroy']=function(_0x431dd4,_0x35f4c5){return db['SmsInteraction'][_0xda50('0x33')]({'where':{'id':_0x431dd4[_0xda50('0x36')]['id']}})['then'](handleEntityNotFound(_0x35f4c5,null))[_0xda50('0x1b')](removeEntity(_0x35f4c5,null))[_0xda50('0x29')](handleError(_0x35f4c5,null));};exports['describe']=function(_0x3a0db7,_0x2c2460){return db[_0xda50('0x22')][_0xda50('0x37')]()[_0xda50('0x1b')](respondWithResult(_0x2c2460,null))[_0xda50('0x29')](handleError(_0x2c2460,null));};exports['addMessage']=function(_0x4396a3,_0x29cdb7){return db[_0xda50('0x38')][_0xda50('0x33')]({'where':{'id':_0x4396a3[_0xda50('0x36')]['id']}})['then'](handleEntityNotFound(_0x29cdb7,null))[_0xda50('0x1b')](function(_0x389594){if(_0x389594){return _0x389594[_0xda50('0x39')](_0x4396a3[_0xda50('0x35')]['ids'],_[_0xda50('0x3a')](_0x4396a3[_0xda50('0x35')],[_0xda50('0x3b'),'id'])||{});}})[_0xda50('0x1b')](respondWithResult(_0x29cdb7,null))[_0xda50('0x29')](handleError(_0x29cdb7,null));};exports[_0xda50('0x3c')]=function(_0x40c2d6,_0xe9ee5b){var _0x303786={'raw':![],'where':{}};var _0x22d1c2={};var _0x52cd33={'count':0x0,'rows':[]};return db[_0xda50('0x22')][_0xda50('0x3d')]({'where':{'id':_0x40c2d6[_0xda50('0x36')]['id']}})[_0xda50('0x1b')](handleEntityNotFound(_0xe9ee5b,null))['then'](function(_0x249da6){if(_0x249da6){_0x22d1c2['model']=_[_0xda50('0x2c')](db['SmsMessage']['rawAttributes']);_0x22d1c2[_0xda50('0x2d')]=_[_0xda50('0x2c')](_0x40c2d6[_0xda50('0x2d')]);_0x22d1c2[_0xda50('0x3e')]=_[_0xda50('0x2f')](_0x22d1c2[_0xda50('0x2b')],_0x22d1c2[_0xda50('0x2d')]);_0x303786[_0xda50('0x2e')]=_['intersection'](_0x22d1c2[_0xda50('0x2b')],qs['fields'](_0x40c2d6[_0xda50('0x2d')][_0xda50('0x3f')]));_0x303786['attributes']=_0x303786[_0xda50('0x2e')][_0xda50('0x40')]?_0x303786[_0xda50('0x2e')]:_0x22d1c2['model'];if(!_0x40c2d6[_0xda50('0x2d')][_0xda50('0x41')](_0xda50('0x42'))){_0x303786[_0xda50('0x16')]=qs[_0xda50('0x16')](_0x40c2d6[_0xda50('0x2d')][_0xda50('0x16')]);_0x303786[_0xda50('0x13')]=qs[_0xda50('0x13')](_0x40c2d6[_0xda50('0x2d')][_0xda50('0x13')]);}_0x303786['order']=qs[_0xda50('0x43')](_0x40c2d6[_0xda50('0x2d')][_0xda50('0x43')]);_0x303786[_0xda50('0x44')]=qs[_0xda50('0x3e')](_['pick'](_0x40c2d6['query'],_0x22d1c2[_0xda50('0x3e')]));_0x303786['where'][_0xda50('0x45')]=_0x249da6['id'];if(_0x40c2d6[_0xda50('0x2d')]['filter']){_0x303786['where']=_[_0xda50('0x31')](_0x303786[_0xda50('0x44')],{'$or':_['map'](_0x303786[_0xda50('0x2e')],function(_0x1bb4d3){var _0x1535db={};_0x1535db[_0x1bb4d3]={'$like':'%'+_0x40c2d6['query'][_0xda50('0x46')]+'%'};return _0x1535db;})});}if(_0x40c2d6[_0xda50('0x2d')][_0xda50('0x47')]){var _0x297c10=_0x40c2d6[_0xda50('0x2d')][_0xda50('0x47')]['split'](',');var _0xb2be57={};_0xb2be57[_0x297c10[0x0]]={'$gte':moment(_0x297c10[0x1])[_0xda50('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x303786[_0xda50('0x44')]=_[_0xda50('0x31')](_0x303786['where'],_0xb2be57);}_0x303786=_[_0xda50('0x31')]({},_0x303786,_0x40c2d6[_0xda50('0x32')]);return db[_0xda50('0x38')]['count']({'where':_0x303786[_0xda50('0x44')]})[_0xda50('0x1b')](function(_0x225f14){_0x52cd33[_0xda50('0x15')]=_0x225f14;if(_0x40c2d6[_0xda50('0x2d')][_0xda50('0x49')]){_0x303786[_0xda50('0x30')]=[{'all':!![]}];}return db['SmsMessage'][_0xda50('0x28')](_0x303786);})[_0xda50('0x1b')](function(_0x2298db){_0x52cd33[_0xda50('0x4a')]=_0x2298db;return _0x52cd33;});}})[_0xda50('0x1b')](respondWithFilteredResult(_0xe9ee5b,_0x303786))[_0xda50('0x29')](handleError(_0xe9ee5b,null));};exports[_0xda50('0x4b')]=function(_0x3ed0fd,_0x581fa7){return db[_0xda50('0x22')][_0xda50('0x33')]({'where':{'id':_0x3ed0fd[_0xda50('0x36')]['id']}})[_0xda50('0x1b')](handleEntityNotFound(_0x581fa7,null))['then'](function(_0x71fbb7){if(_0x71fbb7){return _0x71fbb7['setTags'](_0x3ed0fd['body'][_0xda50('0x3b')],_[_0xda50('0x3a')](_0x3ed0fd[_0xda50('0x35')],['ids','id'])||{})[_0xda50('0x4c')](function(){return db[_0xda50('0x4d')][_0xda50('0x28')]({'attributes':['id',_0xda50('0x1f'),_0xda50('0x4e')],'where':{'id':_0x3ed0fd[_0xda50('0x35')][_0xda50('0x3b')]}});})[_0xda50('0x1b')](function(_0xce8336){socket[_0xda50('0x4f')](_0xda50('0x50'),{'id':Number(_0x3ed0fd[_0xda50('0x36')]['id']),'tags':_0xce8336||[]});return{'id':Number(_0x3ed0fd[_0xda50('0x36')]['id']),'tags':_0xce8336||[]};});}})['then'](respondWithResult(_0x581fa7,null))['catch'](handleError(_0x581fa7,null));};exports[_0xda50('0x51')]=function(_0x461959,_0x813cb1){return db['SmsInteraction'][_0xda50('0x33')]({'where':{'id':_0x461959[_0xda50('0x36')]['id']}})[_0xda50('0x1b')](handleEntityNotFound(_0x813cb1,null))[_0xda50('0x1b')](function(_0x1e311e){if(_0x1e311e){return _0x1e311e[_0xda50('0x51')](_0x461959['query'][_0xda50('0x3b')]);}})[_0xda50('0x1b')](respondWithStatusCode(_0x813cb1,null))['catch'](handleError(_0x813cb1,null));};exports['download']=function(_0x16b9c8,_0x23ada7){var _0x1cc6a1=moment()[_0xda50('0x52')]()[_0xda50('0x53')]();var _0x53b258=path['join'](config[_0xda50('0x54')],_0xda50('0x55'),_0xda50('0x56'),_0xda50('0x57'));var _0x27c9f6=path[_0xda50('0x58')](_0x53b258,_0x1cc6a1);var _0x599bcb=util[_0xda50('0x48')](_0xda50('0x59'),_0x16b9c8[_0xda50('0x36')]['id'],_0x1cc6a1);var _0x122a28=path[_0xda50('0x58')](_0x53b258,_0x599bcb);var _0x47894e=[];_0x47894e[_0xda50('0x5a')]({'model':db[_0xda50('0x5b')],'as':'User','attributes':['id',_0xda50('0x5c')],'raw':!![]});_0x47894e[_0xda50('0x5a')]({'model':db[_0xda50('0x5d')],'as':_0xda50('0x5e'),'attributes':['id',_0xda50('0x5f'),_0xda50('0x60')],'raw':!![]});var _0x501328=[{'model':db['SmsMessage'],'as':_0xda50('0x61'),'attributes':['id',_0xda50('0x35'),_0xda50('0x62'),_0xda50('0x63'),_0xda50('0x64'),_0xda50('0x65')],'include':_0x47894e}];_0x501328[_0xda50('0x5a')]({'model':db[_0xda50('0x66')],'as':_0xda50('0x67'),'attributes':['id',_0xda50('0x1f')]});_0x501328[_0xda50('0x5a')]({'model':db['User'],'as':_0xda50('0x68'),'attributes':['id',_0xda50('0x5c')]});return db[_0xda50('0x22')][_0xda50('0x33')]({'where':{'id':_0x16b9c8[_0xda50('0x36')]['id']},'include':_0x501328})['then'](handleEntityNotFound(_0x23ada7,null))[_0xda50('0x1b')](function(_0x2a526c){if(_0x2a526c){var _0x2a38a0=_0x2a526c[_0xda50('0x69')]({'plain':!![]});fs['mkdirSync'](_0x27c9f6);var _0x5af374={'channel':'Sms','account':_0x2a38a0['Account'][_0xda50('0x1f')],'agent':_0x2a38a0[_0xda50('0x68')]?_0x2a38a0['Owner'][_0xda50('0x5c')]:_0xda50('0x6a'),'createdAt':moment(_0x2a38a0[_0xda50('0x62')])[_0xda50('0x48')](_0xda50('0x6b'))[_0xda50('0x53')](),'closedAt':_0x2a38a0[_0xda50('0x6c')]?moment(_0x2a38a0[_0xda50('0x6d')])[_0xda50('0x48')](_0xda50('0x6b'))[_0xda50('0x53')]():'','disposition':_0x2a38a0[_0xda50('0x6e')],'messages':_(_0x2a38a0['Messages'])[_0xda50('0x46')]({'secret':![]})[_0xda50('0x6f')](function(_0x5514b9){return{'date':moment(_0x5514b9[_0xda50('0x62')])['format'](_0xda50('0x6b'))[_0xda50('0x53')](),'sender':_0x5514b9[_0xda50('0x63')]===_0xda50('0x70')?_0x5514b9[_0xda50('0x5b')]?_0x5514b9[_0xda50('0x5b')][_0xda50('0x5c')]:_0xda50('0x71'):_0x5514b9[_0xda50('0x5e')][_0xda50('0x5f')]+(_0x5514b9[_0xda50('0x5e')][_0xda50('0x60')]?'\x20'+_0x5514b9[_0xda50('0x5e')]['lastName']:''),'body':_0x5514b9[_0xda50('0x35')],'direction':_0x5514b9[_0xda50('0x63')]===_0xda50('0x70')?'A':'C','secret':_0x5514b9[_0xda50('0x64')],'read':_0x5514b9[_0xda50('0x65')]};})[_0xda50('0x72')]()};return ejs['renderFile'](path['join'](config[_0xda50('0x54')],'server',_0xda50('0x73'),_0xda50('0x74')),{'interaction':_0x5af374})[_0xda50('0x1b')](function(_0x1c883e){var _0xa06a26=path[_0xda50('0x58')](_0x27c9f6,_0xda50('0x75')+_0x2a38a0['id']+'-'+_0x1cc6a1+'.pdf');var _0x4836b4={'path':_0xa06a26,'channel':_0xda50('0x76'),'interactionId':_0x2a38a0['id']};return pdf[_0xda50('0x77')](_0x1c883e,_0x4836b4);})[_0xda50('0x1b')](function(){return new BPromise(function(_0x16731,_0x1b159d){zipdir(_0x27c9f6,{'saveTo':_0x122a28},function(_0x3d5f7e,_0x55a2f8){if(_0x3d5f7e)return _0x1b159d(_0x3d5f7e);return _0x16731(_0x55a2f8);});})[_0xda50('0x1b')](function(){return new BPromise(function(_0x4ef795,_0x18175f){rimraf(_0x27c9f6,function(_0x567160){if(_0x567160)_0x18175f(_0x567160);return _0x4ef795();});});})[_0xda50('0x1b')](function(){return _0x23ada7['download'](_0x122a28,_0x599bcb,function(_0x96e673){if(_0x96e673){console[_0xda50('0x78')](_0xda50('0x79'),_0x96e673);}else{fs['unlinkSync'](_0x122a28);}});});});}else{return _0x23ada7[_0xda50('0x10')](0xc8);}})['catch'](handleError(_0x23ada7,null));}; \ No newline at end of file +var _0xa87e=['rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','params','model','keys','SmsInteraction','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','count','addTags','spread','Tag','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','createdAt','direction','secret','read','SmsAccount','Account','mkdirSync','Sms','Owner','N.A.','closed','closedAt','Messages','out','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','../../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','json','offset','undefined','limit','update','then','destroy','error','name','send','index','map'];(function(_0x1a944e,_0x4b94f8){var _0x52cf88=function(_0x36df76){while(--_0x36df76){_0x1a944e['push'](_0x1a944e['shift']());}};_0x52cf88(++_0x4b94f8);}(_0xa87e,0x1c2));var _0xea87=function(_0x38fa6e,_0x3e4d74){_0x38fa6e=_0x38fa6e-0x0;var _0x2fc1f6=_0xa87e[_0x38fa6e];return _0x2fc1f6;};'use strict';var rimraf=require(_0xea87('0x0'));var zipdir=require(_0xea87('0x1'));var moment=require(_0xea87('0x2'));var BPromise=require(_0xea87('0x3'));var util=require('util');var path=require(_0xea87('0x4'));var ejs=require(_0xea87('0x5'));var fs=require('fs');var _=require(_0xea87('0x6'));var Redis=require('ioredis');var interaction=require(_0xea87('0x7'));var qs=require(_0xea87('0x8'));var pdf=require(_0xea87('0x9'));var logger=require(_0xea87('0xa'))('api');var config=require(_0xea87('0xb'));var db=require(_0xea87('0xc'))['db'];config[_0xea87('0xd')]=_[_0xea87('0xe')](config[_0xea87('0xd')],{'host':_0xea87('0xf'),'port':0x18eb});var socket=require(_0xea87('0x10'))(new Redis(config[_0xea87('0xd')]));require(_0xea87('0x11'))[_0xea87('0x12')](socket);function respondWithStatusCode(_0x269540,_0x3f287c){_0x3f287c=_0x3f287c||0xcc;return function(_0x558ea3){if(_0x558ea3){return _0x269540[_0xea87('0x13')](_0x3f287c);}return _0x269540[_0xea87('0x14')](_0x3f287c)[_0xea87('0x15')]();};}function respondWithResult(_0x5d4731,_0x140800){_0x140800=_0x140800||0xc8;return function(_0x47dc78){if(_0x47dc78){return _0x5d4731[_0xea87('0x14')](_0x140800)[_0xea87('0x16')](_0x47dc78);}};}function respondWithFilteredResult(_0x15c163,_0x5dd556){return function(_0x33cf42){if(_0x33cf42){var _0xc259cf=typeof _0x5dd556[_0xea87('0x17')]===_0xea87('0x18')&&typeof _0x5dd556[_0xea87('0x19')]===_0xea87('0x18');var _0x36998c=_0x33cf42['count'];var _0x2f170f=_0xc259cf?0x0:_0x5dd556['offset'];var _0x58622e=_0xc259cf?_0x33cf42['count']:_0x5dd556['offset']+_0x5dd556[_0xea87('0x19')];var _0x5c92a9;if(_0x58622e>=_0x36998c){_0x58622e=_0x36998c;_0x5c92a9=0xc8;}else{_0x5c92a9=0xce;}_0x15c163[_0xea87('0x14')](_0x5c92a9);return _0x15c163['set']('Content-Range',_0x2f170f+'-'+_0x58622e+'/'+_0x36998c)['json'](_0x33cf42);}return null;};}function saveUpdates(_0x1ef58e){return function(_0x303c65){if(_0x303c65){return _0x303c65[_0xea87('0x1a')](_0x1ef58e)[_0xea87('0x1b')](function(_0x4b42a1){return _0x4b42a1;});}return null;};}function removeEntity(_0x15f94b){return function(_0x1e9767){if(_0x1e9767){return _0x1e9767[_0xea87('0x1c')]()['then'](function(){_0x15f94b['status'](0xcc)[_0xea87('0x15')]();});}};}function handleEntityNotFound(_0x472455){return function(_0x1f449f){if(!_0x1f449f){_0x472455[_0xea87('0x13')](0x194);}return _0x1f449f;};}function handleError(_0x282a07,_0x41cf0c){_0x41cf0c=_0x41cf0c||0x1f4;return function(_0x2280f8){logger[_0xea87('0x1d')](_0x2280f8['stack']);if(_0x2280f8[_0xea87('0x1e')]){delete _0x2280f8[_0xea87('0x1e')];}_0x282a07['status'](_0x41cf0c)[_0xea87('0x1f')](_0x2280f8);};}exports[_0xea87('0x20')]=function(_0x246652,_0x356267){var _0x5edc4f={};var _0x22c150=_[_0xea87('0x21')](db['SmsInteraction'][_0xea87('0x22')],function(_0x4b22a4){return{'name':_0x4b22a4[_0xea87('0x23')],'type':_0x4b22a4[_0xea87('0x24')][_0xea87('0x25')]};});_0x5edc4f=qs[_0xea87('0x26')](_0x22c150,_0x246652);return interaction[_0xea87('0x27')](_0xea87('0x28'),_0x246652[_0xea87('0x29')],_0x246652[_0xea87('0x2a')],_0x5edc4f,_0x22c150)[_0xea87('0x1b')](respondWithFilteredResult(_0x356267,_0x5edc4f))['catch'](handleError(_0x356267,null));};exports['show']=function(_0x475734,_0x453bc3){var _0x97db5c={'raw':![],'where':{'id':_0x475734[_0xea87('0x2b')]['id']}},_0x155ee1={};_0x155ee1[_0xea87('0x2c')]=_[_0xea87('0x2d')](db[_0xea87('0x2e')]['rawAttributes']);_0x155ee1['query']=_[_0xea87('0x2d')](_0x475734[_0xea87('0x29')]);_0x155ee1['filters']=_[_0xea87('0x2f')](_0x155ee1[_0xea87('0x2c')],_0x155ee1[_0xea87('0x29')]);_0x97db5c[_0xea87('0x30')]=_['intersection'](_0x155ee1[_0xea87('0x2c')],qs[_0xea87('0x31')](_0x475734[_0xea87('0x29')]['fields']));_0x97db5c['attributes']=_0x97db5c[_0xea87('0x30')][_0xea87('0x32')]?_0x97db5c[_0xea87('0x30')]:_0x155ee1['model'];if(_0x475734[_0xea87('0x29')][_0xea87('0x33')]){_0x97db5c[_0xea87('0x34')]=[{'all':!![]}];}_0x97db5c=_[_0xea87('0x35')]({},_0x97db5c,_0x475734[_0xea87('0x36')]);return db[_0xea87('0x2e')][_0xea87('0x37')](_0x97db5c)['then'](handleEntityNotFound(_0x453bc3,null))[_0xea87('0x1b')](respondWithResult(_0x453bc3,null))[_0xea87('0x38')](handleError(_0x453bc3,null));};exports[_0xea87('0x39')]=function(_0x1b9daf,_0x1b3151){return db[_0xea87('0x2e')][_0xea87('0x39')](_0x1b9daf[_0xea87('0x3a')],{})[_0xea87('0x1b')](respondWithResult(_0x1b3151,0xc9))['catch'](handleError(_0x1b3151,null));};exports[_0xea87('0x1a')]=function(_0x494c53,_0x3c5aaa){if(_0x494c53[_0xea87('0x3a')]['id']){delete _0x494c53['body']['id'];}return db['SmsInteraction'][_0xea87('0x37')]({'where':{'id':_0x494c53[_0xea87('0x2b')]['id']}})[_0xea87('0x1b')](handleEntityNotFound(_0x3c5aaa,null))[_0xea87('0x1b')](saveUpdates(_0x494c53[_0xea87('0x3a')],null))[_0xea87('0x1b')](respondWithResult(_0x3c5aaa,null))['catch'](handleError(_0x3c5aaa,null));};exports['destroy']=function(_0x533869,_0x4eda02){return db['SmsInteraction']['find']({'where':{'id':_0x533869['params']['id']}})[_0xea87('0x1b')](handleEntityNotFound(_0x4eda02,null))['then'](removeEntity(_0x4eda02,null))[_0xea87('0x38')](handleError(_0x4eda02,null));};exports[_0xea87('0x3b')]=function(_0x4071dd,_0x1271a4){return db['SmsInteraction'][_0xea87('0x3b')]()[_0xea87('0x1b')](respondWithResult(_0x1271a4,null))['catch'](handleError(_0x1271a4,null));};exports['addMessage']=function(_0x59e7f0,_0x3f8a01){return db[_0xea87('0x3c')]['find']({'where':{'id':_0x59e7f0['params']['id']}})['then'](handleEntityNotFound(_0x3f8a01,null))[_0xea87('0x1b')](function(_0x491f00){if(_0x491f00){return _0x491f00[_0xea87('0x3d')](_0x59e7f0['body'][_0xea87('0x3e')],_[_0xea87('0x3f')](_0x59e7f0[_0xea87('0x3a')],[_0xea87('0x3e'),'id'])||{});}})[_0xea87('0x1b')](respondWithResult(_0x3f8a01,null))[_0xea87('0x38')](handleError(_0x3f8a01,null));};exports[_0xea87('0x40')]=function(_0x5a7552,_0x7e8145){var _0x1738c5={'raw':![],'where':{}};var _0x2eb6f3={};var _0x2cd028={'count':0x0,'rows':[]};return db[_0xea87('0x2e')][_0xea87('0x41')]({'where':{'id':_0x5a7552[_0xea87('0x2b')]['id']}})[_0xea87('0x1b')](handleEntityNotFound(_0x7e8145,null))[_0xea87('0x1b')](function(_0x2f291e){if(_0x2f291e){_0x2eb6f3[_0xea87('0x2c')]=_['keys'](db[_0xea87('0x3c')][_0xea87('0x22')]);_0x2eb6f3[_0xea87('0x29')]=_[_0xea87('0x2d')](_0x5a7552['query']);_0x2eb6f3[_0xea87('0x42')]=_[_0xea87('0x2f')](_0x2eb6f3[_0xea87('0x2c')],_0x2eb6f3[_0xea87('0x29')]);_0x1738c5[_0xea87('0x30')]=_[_0xea87('0x2f')](_0x2eb6f3[_0xea87('0x2c')],qs[_0xea87('0x31')](_0x5a7552[_0xea87('0x29')][_0xea87('0x31')]));_0x1738c5[_0xea87('0x30')]=_0x1738c5[_0xea87('0x30')][_0xea87('0x32')]?_0x1738c5[_0xea87('0x30')]:_0x2eb6f3[_0xea87('0x2c')];if(!_0x5a7552['query'][_0xea87('0x43')](_0xea87('0x44'))){_0x1738c5[_0xea87('0x19')]=qs[_0xea87('0x19')](_0x5a7552[_0xea87('0x29')][_0xea87('0x19')]);_0x1738c5[_0xea87('0x17')]=qs['offset'](_0x5a7552[_0xea87('0x29')][_0xea87('0x17')]);}_0x1738c5[_0xea87('0x45')]=qs['sort'](_0x5a7552[_0xea87('0x29')][_0xea87('0x46')]);_0x1738c5[_0xea87('0x47')]=qs[_0xea87('0x42')](_['pick'](_0x5a7552['query'],_0x2eb6f3[_0xea87('0x42')]));_0x1738c5[_0xea87('0x47')]['SmsInteractionId']=_0x2f291e['id'];if(_0x5a7552[_0xea87('0x29')][_0xea87('0x48')]){_0x1738c5[_0xea87('0x47')]=_['merge'](_0x1738c5['where'],{'$or':_[_0xea87('0x21')](_0x1738c5[_0xea87('0x30')],function(_0x72766a){var _0x9011be={};_0x9011be[_0x72766a]={'$like':'%'+_0x5a7552[_0xea87('0x29')][_0xea87('0x48')]+'%'};return _0x9011be;})});}if(_0x5a7552[_0xea87('0x29')][_0xea87('0x49')]){var _0x2f5444=_0x5a7552[_0xea87('0x29')][_0xea87('0x49')]['split'](',');var _0x26b30b={};_0x26b30b[_0x2f5444[0x0]]={'$gte':moment(_0x2f5444[0x1])[_0xea87('0x4a')](_0xea87('0x4b'))};_0x1738c5[_0xea87('0x47')]=_[_0xea87('0x35')](_0x1738c5[_0xea87('0x47')],_0x26b30b);}_0x1738c5=_[_0xea87('0x35')]({},_0x1738c5,_0x5a7552[_0xea87('0x36')]);return db['SmsMessage']['count']({'where':_0x1738c5[_0xea87('0x47')]})[_0xea87('0x1b')](function(_0x12f59f){_0x2cd028[_0xea87('0x4c')]=_0x12f59f;if(_0x5a7552[_0xea87('0x29')][_0xea87('0x33')]){_0x1738c5[_0xea87('0x34')]=[{'all':!![]}];}return db[_0xea87('0x3c')][_0xea87('0x27')](_0x1738c5);})[_0xea87('0x1b')](function(_0x4f5226){_0x2cd028['rows']=_0x4f5226;return _0x2cd028;});}})[_0xea87('0x1b')](respondWithFilteredResult(_0x7e8145,_0x1738c5))[_0xea87('0x38')](handleError(_0x7e8145,null));};exports[_0xea87('0x4d')]=function(_0x56bc73,_0x2ed2df){return db[_0xea87('0x2e')]['find']({'where':{'id':_0x56bc73[_0xea87('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2ed2df,null))[_0xea87('0x1b')](function(_0x4d631b){if(_0x4d631b){return _0x4d631b['setTags'](_0x56bc73['body'][_0xea87('0x3e')],_['omit'](_0x56bc73[_0xea87('0x3a')],[_0xea87('0x3e'),'id'])||{})[_0xea87('0x4e')](function(){return db[_0xea87('0x4f')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x56bc73[_0xea87('0x3a')]['ids']}});})[_0xea87('0x1b')](function(_0x19da1a){socket[_0xea87('0x50')](_0xea87('0x51'),{'id':Number(_0x56bc73[_0xea87('0x2b')]['id']),'tags':_0x19da1a||[]});return{'id':Number(_0x56bc73['params']['id']),'tags':_0x19da1a||[]};});}})['then'](respondWithResult(_0x2ed2df,null))['catch'](handleError(_0x2ed2df,null));};exports[_0xea87('0x52')]=function(_0x5c381f,_0x3afa4){return db['SmsInteraction'][_0xea87('0x37')]({'where':{'id':_0x5c381f['params']['id']}})[_0xea87('0x1b')](handleEntityNotFound(_0x3afa4,null))['then'](function(_0x52ceba){if(_0x52ceba){return _0x52ceba[_0xea87('0x52')](_0x5c381f['query'][_0xea87('0x3e')]);}})[_0xea87('0x1b')](respondWithStatusCode(_0x3afa4,null))[_0xea87('0x38')](handleError(_0x3afa4,null));};exports['download']=function(_0x464bb8,_0x445f6b){var _0xf3f89a=moment()[_0xea87('0x53')]()[_0xea87('0x54')]();var _0x42081f=path[_0xea87('0x55')](config[_0xea87('0x56')],_0xea87('0x57'),'files',_0xea87('0x58'));var _0x365b61=path[_0xea87('0x55')](_0x42081f,_0xf3f89a);var _0x1da72e=util[_0xea87('0x4a')](_0xea87('0x59'),_0x464bb8['params']['id'],_0xf3f89a);var _0x27c06c=path[_0xea87('0x55')](_0x42081f,_0x1da72e);var _0x550c28=[];_0x550c28[_0xea87('0x5a')]({'model':db[_0xea87('0x5b')],'as':_0xea87('0x5b'),'attributes':['id',_0xea87('0x5c')],'raw':!![]});_0x550c28[_0xea87('0x5a')]({'model':db[_0xea87('0x5d')],'as':_0xea87('0x5e'),'attributes':['id',_0xea87('0x5f'),'lastName'],'raw':!![]});var _0x264071=[{'model':db[_0xea87('0x3c')],'as':'Messages','attributes':['id','body',_0xea87('0x60'),_0xea87('0x61'),_0xea87('0x62'),_0xea87('0x63')],'include':_0x550c28}];_0x264071[_0xea87('0x5a')]({'model':db[_0xea87('0x64')],'as':_0xea87('0x65'),'attributes':['id',_0xea87('0x1e')]});_0x264071[_0xea87('0x5a')]({'model':db[_0xea87('0x5b')],'as':'Owner','attributes':['id',_0xea87('0x5c')]});return db[_0xea87('0x2e')]['find']({'where':{'id':_0x464bb8[_0xea87('0x2b')]['id']},'include':_0x264071})[_0xea87('0x1b')](handleEntityNotFound(_0x445f6b,null))[_0xea87('0x1b')](function(_0x10f9eb){if(_0x10f9eb){var _0x3ca469=_0x10f9eb['get']({'plain':!![]});fs[_0xea87('0x66')](_0x365b61);var _0xc44a8f={'channel':_0xea87('0x67'),'account':_0x3ca469[_0xea87('0x65')][_0xea87('0x1e')],'agent':_0x3ca469[_0xea87('0x68')]?_0x3ca469[_0xea87('0x68')][_0xea87('0x5c')]:_0xea87('0x69'),'createdAt':moment(_0x3ca469[_0xea87('0x60')])[_0xea87('0x4a')](_0xea87('0x4b'))[_0xea87('0x54')](),'closedAt':_0x3ca469[_0xea87('0x6a')]?moment(_0x3ca469[_0xea87('0x6b')])[_0xea87('0x4a')](_0xea87('0x4b'))['toString']():'','disposition':_0x3ca469['disposition'],'messages':_(_0x3ca469[_0xea87('0x6c')])[_0xea87('0x48')]({'secret':![]})[_0xea87('0x21')](function(_0x12bea1){return{'date':moment(_0x12bea1['createdAt'])[_0xea87('0x4a')](_0xea87('0x4b'))[_0xea87('0x54')](),'sender':_0x12bea1[_0xea87('0x61')]===_0xea87('0x6d')?_0x12bea1['User']?_0x12bea1[_0xea87('0x5b')][_0xea87('0x5c')]:'System':_0x12bea1['Contact'][_0xea87('0x5f')]+(_0x12bea1[_0xea87('0x5e')][_0xea87('0x6e')]?'\x20'+_0x12bea1[_0xea87('0x5e')][_0xea87('0x6e')]:''),'body':_0x12bea1['body'],'direction':_0x12bea1[_0xea87('0x61')]===_0xea87('0x6d')?'A':'C','secret':_0x12bea1[_0xea87('0x62')],'read':_0x12bea1['read']};})[_0xea87('0x6f')]()};return ejs['renderFile'](path[_0xea87('0x55')](config[_0xea87('0x56')],_0xea87('0x57'),_0xea87('0x70'),_0xea87('0x71')),{'interaction':_0xc44a8f})[_0xea87('0x1b')](function(_0x59977f){var _0x2e2ff3=path['join'](_0x365b61,_0xea87('0x72')+_0x3ca469['id']+'-'+_0xf3f89a+_0xea87('0x73'));var _0x4a2d54={'path':_0x2e2ff3,'channel':'Sms','interactionId':_0x3ca469['id']};return pdf[_0xea87('0x74')](_0x59977f,_0x4a2d54);})[_0xea87('0x1b')](function(){return new BPromise(function(_0x31b400,_0x53a4aa){zipdir(_0x365b61,{'saveTo':_0x27c06c},function(_0x57c750,_0x319baa){if(_0x57c750)return _0x53a4aa(_0x57c750);return _0x31b400(_0x319baa);});})['then'](function(){return new BPromise(function(_0x39c1b1,_0x38c127){rimraf(_0x365b61,function(_0x5f1c07){if(_0x5f1c07)_0x38c127(_0x5f1c07);return _0x39c1b1();});});})[_0xea87('0x1b')](function(){return _0x445f6b[_0xea87('0x75')](_0x27c06c,_0x1da72e,function(_0x3af003){if(_0x3af003){console[_0xea87('0x76')](_0xea87('0x77'),_0x3af003);}else{fs[_0xea87('0x78')](_0x27c06c);}});});});}else{return _0x445f6b[_0xea87('0x13')](0xc8);}})[_0xea87('0x38')](handleError(_0x445f6b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 0bbcbcb..75d900e 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 _0x4888=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x216af2,_0x8635a9){var _0x8c9171=function(_0x1f4921){while(--_0x1f4921){_0x216af2['push'](_0x216af2['shift']());}};_0x8c9171(++_0x8635a9);}(_0x4888,0x198));var _0x8488=function(_0x1e2f5b,_0x60bf47){_0x1e2f5b=_0x1e2f5b-0x0;var _0x2bb7bc=_0x4888[_0x1e2f5b];return _0x2bb7bc;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var SmsMessage=require(_0x8488('0x0'))['db'][_0x8488('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8488('0x3')](0x0);var events={'afterCreate':_0x8488('0x4'),'afterUpdate':_0x8488('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267093){return function(_0xf45c3f,_0x1a97f4,_0x421292){_0xf45c3f[_0x8488('0x6')]({'attributes':['id'],'raw':!![]})[_0x8488('0x7')](function(_0x5250a1){_0xf45c3f['setDataValue']('Users',_0x5250a1['map'](function(_0x151528){return{'id':_0x151528['id']};}));return SmsMessage[_0x8488('0x8')]({'where':{'SmsInteractionId':_0xf45c3f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c994){_0xf45c3f[_0x8488('0x9')](_0x8488('0xa'),_0x19c994[_0x8488('0xb')]);SmsInteractionEvents['emit'](_0x267093+':'+_0xf45c3f['id'],_0xf45c3f);SmsInteractionEvents[_0x8488('0xc')](_0x267093,_0xf45c3f);_0x421292(null);})[_0x8488('0xd')](_0x421292(null));};}for(var e in events){if(events[_0x8488('0xe')](e)){var event=events[e];SmsInteraction[_0x8488('0xf')](e,emitEvent(event));}}module[_0x8488('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x1775=['map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x196edc,_0x24a173){var _0x681650=function(_0x5aa6bf){while(--_0x5aa6bf){_0x196edc['push'](_0x196edc['shift']());}};_0x681650(++_0x24a173);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var SmsMessage=require(_0x5177('0x0'))['db'][_0x5177('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5177('0x3')](0x0);var events={'afterCreate':_0x5177('0x4'),'afterUpdate':_0x5177('0x5'),'afterDestroy':_0x5177('0x6')};function emitEvent(_0x359401){return function(_0x51275f,_0x159a20,_0x2c5c42){_0x51275f[_0x5177('0x7')]({'attributes':['id'],'raw':!![]})[_0x5177('0x8')](function(_0x300b43){_0x51275f[_0x5177('0x9')](_0x5177('0xa'),_0x300b43[_0x5177('0xb')](function(_0x16e7a7){return{'id':_0x16e7a7['id']};}));return SmsMessage[_0x5177('0xc')]({'where':{'SmsInteractionId':_0x51275f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5177('0x8')](function(_0x206035){_0x51275f['setDataValue']('unreadMessages',_0x206035[_0x5177('0xd')]);SmsInteractionEvents[_0x5177('0xe')](_0x359401+':'+_0x51275f['id'],_0x51275f);SmsInteractionEvents[_0x5177('0xe')](_0x359401,_0x51275f);_0x2c5c42(null);})[_0x5177('0xf')](_0x2c5c42(null));};}for(var e in events){if(events[_0x5177('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5177('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 343fdc0..0648882 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 _0x3c4c=['lodash','api','moment','request-promise','rimraf','./smsInteraction.attributes','exports','sms_interactions','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f4bf8,_0x4621c3){var _0x496144=function(_0x1c2d3a){while(--_0x1c2d3a){_0x3f4bf8['push'](_0x3f4bf8['shift']());}};_0x496144(++_0x4621c3);}(_0x3c4c,0xfa));var _0xc3c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3c4c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xc3c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3c4('0x1'));var moment=require(_0xc3c4('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3c4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3c4('0x4'));var config=require('../../config/environment');var attributes=require(_0xc3c4('0x5'));module[_0xc3c4('0x6')]=function(_0x247da2,_0x45ec20){return _0x247da2['define']('SmsInteraction',attributes,{'tableName':_0xc3c4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42042b,_0x1a5890,_0x52eb36){if(_0x42042b['changed']('closed')){_0x42042b['closedAt']=moment()[_0xc3c4('0x8')](_0xc3c4('0x9'));}_0x52eb36(null,_0x42042b);}}});}; \ No newline at end of file +var _0x39fa=['moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','changed','closed','closedAt','format','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x39fa,0xa8));var _0xa39f=function(_0x47e7a2,_0x1ffe44){_0x47e7a2=_0x47e7a2-0x0;var _0x73c23f=_0x39fa[_0x47e7a2];return _0x73c23f;};'use strict';var _=require('lodash');var util=require(_0xa39f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa39f('0x1'));var BPromise=require('bluebird');var rp=require(_0xa39f('0x2'));var fs=require('fs');var path=require(_0xa39f('0x3'));var rimraf=require(_0xa39f('0x4'));var config=require(_0xa39f('0x5'));var attributes=require(_0xa39f('0x6'));module['exports']=function(_0x159c4e,_0x4180cd){return _0x159c4e[_0xa39f('0x7')](_0xa39f('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd591d8,_0x3c4169,_0x53f94e){if(_0xd591d8[_0xa39f('0x9')](_0xa39f('0xa'))){_0xd591d8[_0xa39f('0xb')]=moment()[_0xa39f('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x53f94e(null,_0xd591d8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 39e2c39..06cbe05 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 _0x06ce=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./smsInteraction.socket','register','then','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','find','addTags','omit','ids','spread','AddTags','util','moment','bluebird','ioredis'];(function(_0xeef495,_0x414c5b){var _0x1ba11e=function(_0x3c2ad8){while(--_0x3c2ad8){_0xeef495['push'](_0xeef495['shift']());}};_0x1ba11e(++_0x414c5b);}(_0x06ce,0xbf));var _0xe06c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x06ce[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xe06c('0x0'));var moment=require(_0xe06c('0x1'));var BPromise=require(_0xe06c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe06c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe06c('0x4'));var logger=require(_0xe06c('0x5'))(_0xe06c('0x6'));var config=require(_0xe06c('0x7'));var jayson=require(_0xe06c('0x8'));var client=jayson['client'][_0xe06c('0x9')]({'port':0x232a});config[_0xe06c('0xa')]=_[_0xe06c('0xb')](config[_0xe06c('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe06c('0xa')]));require(_0xe06c('0xc'))[_0xe06c('0xd')](socket);function respondWithRpcPromise(_0xefbad8,_0x36bd2e,_0x33a9f7){return new BPromise(function(_0x5618e5,_0x12898c){return client['request'](_0xefbad8,_0x33a9f7)[_0xe06c('0xe')](function(_0xae2303){logger['info'](_0xe06c('0xf'),_0x36bd2e,'request\x20sent');logger[_0xe06c('0x10')](_0xe06c('0x11'),_0x36bd2e,_0xe06c('0x12'),JSON[_0xe06c('0x13')](_0xae2303));if(_0xae2303[_0xe06c('0x14')]){if(_0xae2303['error']['code']===0x1f4){logger['error'](_0xe06c('0xf'),_0x36bd2e,_0xae2303[_0xe06c('0x14')]['message']);return _0x12898c(_0xae2303[_0xe06c('0x14')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x36bd2e,_0xae2303[_0xe06c('0x14')]['message']);return _0x5618e5(_0xae2303[_0xe06c('0x14')][_0xe06c('0x15')]);}else{logger[_0xe06c('0x16')](_0xe06c('0xf'),_0x36bd2e,_0xe06c('0x12'));_0x5618e5(_0xae2303[_0xe06c('0x17')][_0xe06c('0x15')]);}})[_0xe06c('0x18')](function(_0xe45b){logger[_0xe06c('0x14')](_0xe06c('0xf'),_0x36bd2e,_0xe45b);_0x12898c(_0xe45b);});});}exports[_0xe06c('0x19')]=function(_0x12d2ed){var _0x12b938=this;return new Promise(function(_0x33b56e,_0x5cf1d2){return db[_0xe06c('0x1a')][_0xe06c('0x1b')](_0x12d2ed[_0xe06c('0x1c')],{'raw':_0x12d2ed['options']?_0x12d2ed[_0xe06c('0x1d')][_0xe06c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12d2ed[_0xe06c('0x1d')]?_0x12d2ed[_0xe06c('0x1d')][_0xe06c('0x1f')]||null:null,'attributes':_0x12d2ed[_0xe06c('0x1d')]?_0x12d2ed[_0xe06c('0x1d')]['attributes']||null:null,'limit':_0x12d2ed[_0xe06c('0x1d')]?_0x12d2ed[_0xe06c('0x1d')][_0xe06c('0x20')]||null:null})[_0xe06c('0xe')](function(_0x1bd046){logger['info']('UpdateSmsInteraction',_0x12d2ed);logger[_0xe06c('0x10')]('UpdateSmsInteraction',_0x12d2ed,JSON[_0xe06c('0x13')](_0x1bd046));_0x33b56e(_0x1bd046);})['catch'](function(_0x2e31ee){logger['error'](_0xe06c('0x19'),_0x2e31ee['message'],_0x12d2ed);_0x5cf1d2(_0x12b938[_0xe06c('0x14')](0x1f4,_0x2e31ee[_0xe06c('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0x585e15){return new Promise(function(_0x5e6c7,_0x30ffb8){return db[_0xe06c('0x1a')][_0xe06c('0x21')]({'where':_0x585e15['options']?_0x585e15['options'][_0xe06c('0x1f')]||null:null})[_0xe06c('0xe')](function(_0x4f3ba3){if(_0x4f3ba3){return _0x4f3ba3[_0xe06c('0x22')](_0x585e15[_0xe06c('0x1c')]['ids'],_[_0xe06c('0x23')](_0x585e15['body'],[_0xe06c('0x24'),'id'])||{});}})[_0xe06c('0x25')](function(_0x199c16){logger['info'](_0xe06c('0x26'),_0x585e15);logger[_0xe06c('0x10')](_0xe06c('0x26'),_0x585e15,JSON[_0xe06c('0x13')](_0x199c16));_0x5e6c7(_0x199c16);})[_0xe06c('0x18')](function(_0x2ebdde){logger[_0xe06c('0x14')](_0xe06c('0x26'),_0x2ebdde[_0xe06c('0x15')],_0x585e15);_0x30ffb8(_this[_0xe06c('0x14')](0x1f4,_0x2ebdde[_0xe06c('0x15')]));});});}; \ No newline at end of file +var _0xff28=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsInteraction','body','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x4d7708,_0x13cf18){var _0x409575=function(_0x2f38a1){while(--_0x2f38a1){_0x4d7708['push'](_0x4d7708['shift']());}};_0x409575(++_0x13cf18);}(_0xff28,0x107));var _0x8ff2=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0xff28[_0x456a4b];return _0x42957c;};'use strict';var _=require(_0x8ff2('0x0'));var util=require(_0x8ff2('0x1'));var moment=require(_0x8ff2('0x2'));var BPromise=require(_0x8ff2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ff2('0x4'));var db=require(_0x8ff2('0x5'))['db'];var utils=require(_0x8ff2('0x6'));var logger=require(_0x8ff2('0x7'))(_0x8ff2('0x8'));var config=require(_0x8ff2('0x9'));var jayson=require(_0x8ff2('0xa'));var client=jayson[_0x8ff2('0xb')][_0x8ff2('0xc')]({'port':0x232a});config[_0x8ff2('0xd')]=_[_0x8ff2('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ff2('0xd')]));require(_0x8ff2('0xf'))[_0x8ff2('0x10')](socket);function respondWithRpcPromise(_0x54c107,_0x3e58fa,_0x396e88){return new BPromise(function(_0x53a55f,_0x1afbda){return client[_0x8ff2('0x11')](_0x54c107,_0x396e88)[_0x8ff2('0x12')](function(_0xe92be4){logger[_0x8ff2('0x13')](_0x8ff2('0x14'),_0x3e58fa,'request\x20sent');logger[_0x8ff2('0x15')](_0x8ff2('0x16'),_0x3e58fa,_0x8ff2('0x17'),JSON[_0x8ff2('0x18')](_0xe92be4));if(_0xe92be4['error']){if(_0xe92be4[_0x8ff2('0x19')][_0x8ff2('0x1a')]===0x1f4){logger[_0x8ff2('0x19')](_0x8ff2('0x14'),_0x3e58fa,_0xe92be4[_0x8ff2('0x19')][_0x8ff2('0x1b')]);return _0x1afbda(_0xe92be4['error'][_0x8ff2('0x1b')]);}logger[_0x8ff2('0x19')](_0x8ff2('0x14'),_0x3e58fa,_0xe92be4[_0x8ff2('0x19')][_0x8ff2('0x1b')]);return _0x53a55f(_0xe92be4['error']['message']);}else{logger['info'](_0x8ff2('0x14'),_0x3e58fa,_0x8ff2('0x17'));_0x53a55f(_0xe92be4[_0x8ff2('0x1c')][_0x8ff2('0x1b')]);}})[_0x8ff2('0x1d')](function(_0x4635ed){logger[_0x8ff2('0x19')](_0x8ff2('0x14'),_0x3e58fa,_0x4635ed);_0x1afbda(_0x4635ed);});});}exports['UpdateSmsInteraction']=function(_0x15f3f){var _0x286365=this;return new Promise(function(_0x10fa65,_0x36a95c){return db[_0x8ff2('0x1e')]['update'](_0x15f3f[_0x8ff2('0x1f')],{'raw':_0x15f3f[_0x8ff2('0x20')]?_0x15f3f['options'][_0x8ff2('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15f3f['options']?_0x15f3f[_0x8ff2('0x20')][_0x8ff2('0x22')]||null:null,'attributes':_0x15f3f['options']?_0x15f3f[_0x8ff2('0x20')][_0x8ff2('0x23')]||null:null,'limit':_0x15f3f['options']?_0x15f3f['options'][_0x8ff2('0x24')]||null:null})['then'](function(_0x199dd9){logger[_0x8ff2('0x13')](_0x8ff2('0x25'),_0x15f3f);logger['debug'](_0x8ff2('0x25'),_0x15f3f,JSON[_0x8ff2('0x18')](_0x199dd9));_0x10fa65(_0x199dd9);})['catch'](function(_0x2219d2){logger[_0x8ff2('0x19')](_0x8ff2('0x25'),_0x2219d2[_0x8ff2('0x1b')],_0x15f3f);_0x36a95c(_0x286365[_0x8ff2('0x19')](0x1f4,_0x2219d2[_0x8ff2('0x1b')]));});});};exports[_0x8ff2('0x26')]=function(_0x39eff6){return new Promise(function(_0x3e28d7,_0xa7bf77){return db[_0x8ff2('0x1e')]['find']({'where':_0x39eff6['options']?_0x39eff6[_0x8ff2('0x20')][_0x8ff2('0x22')]||null:null})['then'](function(_0x235af5){if(_0x235af5){return _0x235af5[_0x8ff2('0x27')](_0x39eff6[_0x8ff2('0x1f')][_0x8ff2('0x28')],_[_0x8ff2('0x29')](_0x39eff6[_0x8ff2('0x1f')],['ids','id'])||{});}})[_0x8ff2('0x2a')](function(_0x4b4e7e){logger['info']('AddTags',_0x39eff6);logger[_0x8ff2('0x15')](_0x8ff2('0x2b'),_0x39eff6,JSON['stringify'](_0x4b4e7e));_0x3e28d7(_0x4b4e7e);})['catch'](function(_0x120a57){logger[_0x8ff2('0x19')]('AddTags',_0x120a57[_0x8ff2('0x1b')],_0x39eff6);_0xa7bf77(_this['error'](0x1f4,_0x120a57['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index fdf9c48..23108c3 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 _0xe588=['./smsInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0xffdec4,_0x322bec){var _0x479138=function(_0x49b019){while(--_0x49b019){_0xffdec4['push'](_0xffdec4['shift']());}};_0x479138(++_0x322bec);}(_0xe588,0xc4));var _0x8e58=function(_0x490db0,_0x3492c7){_0x490db0=_0x490db0-0x0;var _0x5db0ed=_0xe588[_0x490db0];return _0x5db0ed;};'use strict';var SmsInteractionEvents=require(_0x8e58('0x0'));var events=['save',_0x8e58('0x1'),_0x8e58('0x2')];function createListener(_0x48683a,_0x21dad6){return function(_0x4d6ed2){_0x21dad6[_0x8e58('0x3')](_0x48683a,_0x4d6ed2);};}function removeListener(_0x1de225,_0x30001b){return function(){SmsInteractionEvents[_0x8e58('0x4')](_0x1de225,_0x30001b);};}exports[_0x8e58('0x5')]=function(_0x25de47){for(var _0x52e495=0x0,_0x42c24e=events[_0x8e58('0x6')];_0x52e495<_0x42c24e;_0x52e495++){var _0x4c5027=events[_0x52e495];var _0x5166bc=createListener('smsInteraction:'+_0x4c5027,_0x25de47);SmsInteractionEvents['on'](_0x4c5027,_0x5166bc);}}; \ No newline at end of file +var _0x8255=['register','remove','update','removeListener'];(function(_0x568835,_0x2eb3f8){var _0x13cf7c=function(_0x46cf8e){while(--_0x46cf8e){_0x568835['push'](_0x568835['shift']());}};_0x13cf7c(++_0x2eb3f8);}(_0x8255,0xa9));var _0x5825=function(_0x18223d,_0x150660){_0x18223d=_0x18223d-0x0;var _0x35dd2f=_0x8255[_0x18223d];return _0x35dd2f;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0x5825('0x0'),_0x5825('0x1')];function createListener(_0xb88167,_0x155e57){return function(_0x1f5782){_0x155e57['emit'](_0xb88167,_0x1f5782);};}function removeListener(_0x52650c,_0xa01971){return function(){SmsInteractionEvents[_0x5825('0x2')](_0x52650c,_0xa01971);};}exports[_0x5825('0x3')]=function(_0x3ec69b){for(var _0x293d7f=0x0,_0x11b353=events['length'];_0x293d7f<_0x11b353;_0x293d7f++){var _0x2858f0=events[_0x293d7f];var _0x4ba964=createListener('smsInteraction:'+_0x2858f0,_0x3ec69b);SmsInteractionEvents['on'](_0x2858f0,_0x4ba964);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9b8b282..4f4c78d 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 _0x2bdb=['describe','/:id','post','tracked','sms','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','isAuthenticated','get'];(function(_0x431796,_0xe746e0){var _0x83316e=function(_0x5acd06){while(--_0x5acd06){_0x431796['push'](_0x431796['shift']());}};_0x83316e(++_0xe746e0);}(_0x2bdb,0x1e3));var _0xb2bd=function(_0x4424c7,_0x38afdd){_0x4424c7=_0x4424c7-0x0;var _0x3741bf=_0x2bdb[_0x4424c7];return _0x3741bf;};'use strict';var multer=require(_0xb2bd('0x0'));var util=require(_0xb2bd('0x1'));var path=require(_0xb2bd('0x2'));var timeout=require('connect-timeout');var express=require(_0xb2bd('0x3'));var router=express[_0xb2bd('0x4')]();var fs_extra=require(_0xb2bd('0x5'));var auth=require(_0xb2bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb2bd('0x7'));var controller=require(_0xb2bd('0x8'));router['get']('/',auth[_0xb2bd('0x9')](),controller['index']);router[_0xb2bd('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xb2bd('0xb')]);router[_0xb2bd('0xa')](_0xb2bd('0xc'),auth[_0xb2bd('0x9')](),controller['show']);router[_0xb2bd('0xd')]('/',auth[_0xb2bd('0x9')](),interaction[_0xb2bd('0xe')](_0xb2bd('0xf'),'smsmessage:create'),controller[_0xb2bd('0x10')]);router[_0xb2bd('0xd')]('/:id/status',controller[_0xb2bd('0x11')]);router[_0xb2bd('0x12')]('/:id',auth[_0xb2bd('0x9')](),controller[_0xb2bd('0x13')]);router['put'](_0xb2bd('0x14'),auth[_0xb2bd('0x9')](),controller[_0xb2bd('0x15')]);router[_0xb2bd('0x12')](_0xb2bd('0x16'),auth[_0xb2bd('0x9')](),controller[_0xb2bd('0x17')]);router[_0xb2bd('0x18')]('/:id',auth[_0xb2bd('0x9')](),controller['destroy']);module[_0xb2bd('0x19')]=router; \ No newline at end of file +var _0x7509=['accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','tracked','sms','create','post','/:id/status','put','/:id/accept'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0x7509,0xf0));var _0x9750=function(_0x3c8ca1,_0x1698b4){_0x3c8ca1=_0x3c8ca1-0x0;var _0x1be0dc=_0x7509[_0x3c8ca1];return _0x1be0dc;};'use strict';var multer=require(_0x9750('0x0'));var util=require(_0x9750('0x1'));var path=require(_0x9750('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9750('0x3'));var auth=require(_0x9750('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9750('0x5'));var controller=require(_0x9750('0x6'));router[_0x9750('0x7')]('/',auth[_0x9750('0x8')](),controller['index']);router[_0x9750('0x7')](_0x9750('0x9'),auth[_0x9750('0x8')](),controller[_0x9750('0xa')]);router[_0x9750('0x7')](_0x9750('0xb'),auth[_0x9750('0x8')](),controller[_0x9750('0xc')]);router['post']('/',auth[_0x9750('0x8')](),interaction[_0x9750('0xd')](_0x9750('0xe'),'smsmessage:create'),controller[_0x9750('0xf')]);router[_0x9750('0x10')](_0x9750('0x11'),controller['status']);router[_0x9750('0x12')](_0x9750('0xb'),auth[_0x9750('0x8')](),controller['update']);router['put'](_0x9750('0x13'),auth['isAuthenticated'](),controller[_0x9750('0x14')]);router[_0x9750('0x12')](_0x9750('0x15'),auth[_0x9750('0x8')](),controller[_0x9750('0x16')]);router[_0x9750('0x17')](_0x9750('0xb'),auth[_0x9750('0x8')](),controller[_0x9750('0x18')]);module[_0x9750('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 08833cf..1b3f198 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 _0x5aae=['DATE','sequelize','exports','TEXT','out','STRING'];(function(_0xff6bbd,_0x34e0b6){var _0x2a2697=function(_0x2d5d9c){while(--_0x2d5d9c){_0xff6bbd['push'](_0xff6bbd['shift']());}};_0x2a2697(++_0x34e0b6);}(_0x5aae,0xe5));var _0xe5aa=function(_0xc41594,_0x3ff4a4){_0xc41594=_0xc41594-0x0;var _0x2b803b=_0x5aae[_0xc41594];return _0x2b803b;};'use strict';var Sequelize=require(_0xe5aa('0x0'));module[_0xe5aa('0x1')]={'body':{'type':Sequelize[_0xe5aa('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe5aa('0x3')),'defaultValue':_0xe5aa('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe5aa('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe5aa('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe5aa('0x4')]},'providerResponse':{'type':Sequelize[_0xe5aa('0x2')]}}; \ No newline at end of file +var _0xcc20=['STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x481ff0,_0xa84ac1){var _0x5f3b6c=function(_0x3ec758){while(--_0x3ec758){_0x481ff0['push'](_0x481ff0['shift']());}};_0x5f3b6c(++_0xa84ac1);}(_0xcc20,0x108));var _0x0cc2=function(_0x2f3d05,_0x3564f4){_0x2f3d05=_0x2f3d05-0x0;var _0x240658=_0xcc20[_0x2f3d05];return _0x240658;};'use strict';var Sequelize=require(_0x0cc2('0x0'));module[_0x0cc2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0cc2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0cc2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0cc2('0x4')]('in','out'),'defaultValue':_0x0cc2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0cc2('0x6')](0xbe)},'phone':{'type':Sequelize[_0x0cc2('0x6')]},'readAt':{'type':Sequelize[_0x0cc2('0x7')]},'secret':{'type':Sequelize[_0x0cc2('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0cc2('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 025d32e..023d5e6 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 _0x5bd4=['includeAll','findAll','show','params','include','create','update','body','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','find','get','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','SELECT','contact','email','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','undefined','offset','set','Content-Range','apply','save','destroy','stack','name','send','map','SmsMessage','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x5630db,_0x176962){var _0x2c40a6=function(_0x3c6fe4){while(--_0x3c6fe4){_0x5630db['push'](_0x5630db['shift']());}};_0x2c40a6(++_0x176962);}(_0x5bd4,0x163));var _0x45bd=function(_0xa1eb5f,_0x35a54f){_0xa1eb5f=_0xa1eb5f-0x0;var _0x5388eb=_0x5bd4[_0xa1eb5f];return _0x5388eb;};'use strict';var emlformat=require(_0x45bd('0x0'));var rimraf=require(_0x45bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x45bd('0x2'));var moment=require('moment');var BPromise=require(_0x45bd('0x3'));var Mustache=require(_0x45bd('0x4'));var util=require(_0x45bd('0x5'));var path=require('path');var sox=require(_0x45bd('0x6'));var csv=require('to-csv');var ejs=require(_0x45bd('0x7'));var fs=require('fs');var fs_extra=require(_0x45bd('0x8'));var _=require('lodash');var squel=require(_0x45bd('0x9'));var crypto=require(_0x45bd('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x45bd('0xb'));var Papa=require(_0x45bd('0xc'));var Redis=require(_0x45bd('0xd'));var authService=require(_0x45bd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x45bd('0xf'));var hardwareService=require(_0x45bd('0x10'));var logger=require(_0x45bd('0x11'))(_0x45bd('0x12'));var utils=require(_0x45bd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x45bd('0x14'));var db=require(_0x45bd('0x15'))['db'];config['redis']=_['defaults'](config[_0x45bd('0x16')],{'host':_0x45bd('0x17'),'port':0x18eb});var socket=require(_0x45bd('0x18'))(new Redis(config[_0x45bd('0x16')]));require('./smsMessage.socket')[_0x45bd('0x19')](socket);var jayson=require(_0x45bd('0x1a'));var client=jayson[_0x45bd('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x45bd('0x1b')][_0x45bd('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x259a5e,_0x5e112b,_0x1dfd73,_0x52fb54){return new BPromise(function(_0x477a6c,_0x7dbc16){var _0x48f064=_0x52fb54||client;return _0x48f064[_0x45bd('0x1d')](_0x259a5e,_0x1dfd73)[_0x45bd('0x1e')](function(_0x5a638e){logger[_0x45bd('0x1f')](_0x45bd('0x20'),_0x5e112b,_0x45bd('0x21'));logger[_0x45bd('0x22')](_0x45bd('0x23'),_0x5e112b,'request\x20sent',JSON['stringify'](_0x5a638e));if(_0x5a638e[_0x45bd('0x24')]){if(_0x5a638e[_0x45bd('0x24')][_0x45bd('0x25')]===0x1f4){logger[_0x45bd('0x24')](_0x45bd('0x20'),_0x5e112b,_0x5a638e[_0x45bd('0x24')]['message']);return _0x7dbc16(_0x5a638e['error'][_0x45bd('0x26')]);}logger[_0x45bd('0x24')](_0x45bd('0x20'),_0x5e112b,_0x5a638e['error'][_0x45bd('0x26')]);return _0x477a6c(_0x5a638e['error'][_0x45bd('0x26')]);}else{logger[_0x45bd('0x1f')](_0x45bd('0x20'),_0x5e112b,'request\x20sent');_0x477a6c(_0x5a638e[_0x45bd('0x27')][_0x45bd('0x26')]);}})[_0x45bd('0x28')](function(_0x23756c){logger['error'](_0x45bd('0x20'),_0x5e112b,_0x23756c);_0x7dbc16(_0x23756c);});});}function respondWithStatusCode(_0x21d491,_0x1a9478){_0x1a9478=_0x1a9478||0xcc;return function(_0x5ac12b){if(_0x5ac12b){return _0x21d491[_0x45bd('0x29')](_0x1a9478);}return _0x21d491['status'](_0x1a9478)[_0x45bd('0x2a')]();};}function respondWithResult(_0x3d8a5c,_0x6d194f){_0x6d194f=_0x6d194f||0xc8;return function(_0x11d7bb){if(_0x11d7bb){return _0x3d8a5c[_0x45bd('0x2b')](_0x6d194f)[_0x45bd('0x2c')](_0x11d7bb);}};}function respondWithFilteredResult(_0x3436e3,_0x38a81d){return function(_0x457e0a){if(_0x457e0a){var _0x48fcee=typeof _0x38a81d['offset']===_0x45bd('0x2d')&&typeof _0x38a81d['limit']==='undefined';var _0x2a12ba=_0x457e0a['count'];var _0x356f8c=_0x48fcee?0x0:_0x38a81d['offset'];var _0x148568=_0x48fcee?_0x457e0a['count']:_0x38a81d[_0x45bd('0x2e')]+_0x38a81d['limit'];var _0x1742f2;if(_0x148568>=_0x2a12ba){_0x148568=_0x2a12ba;_0x1742f2=0xc8;}else{_0x1742f2=0xce;}_0x3436e3['status'](_0x1742f2);return _0x3436e3[_0x45bd('0x2f')](_0x45bd('0x30'),_0x356f8c+'-'+_0x148568+'/'+_0x2a12ba)[_0x45bd('0x2c')](_0x457e0a);}return null;};}function patchUpdates(_0x55a348){return function(_0x246d46){try{jsonpatch[_0x45bd('0x31')](_0x246d46,_0x55a348,!![]);}catch(_0x5205ad){return BPromise['reject'](_0x5205ad);}return _0x246d46[_0x45bd('0x32')]();};}function saveUpdates(_0xf4ec7f,_0x1b5881){return function(_0x141c89){if(_0x141c89){return _0x141c89['update'](_0xf4ec7f)['then'](function(_0x4ea70e){return _0x4ea70e;});}return null;};}function removeEntity(_0x87764b,_0x1103c7){return function(_0x189abd){if(_0x189abd){return _0x189abd[_0x45bd('0x33')]()['then'](function(){_0x87764b['status'](0xcc)[_0x45bd('0x2a')]();});}};}function handleEntityNotFound(_0x2e443a,_0xcfd2f9){return function(_0x3dc02c){if(!_0x3dc02c){_0x2e443a[_0x45bd('0x29')](0x194);}return _0x3dc02c;};}function handleError(_0x5f65aa,_0x4b744a){_0x4b744a=_0x4b744a||0x1f4;return function(_0x2a5ea7){logger['error'](_0x2a5ea7[_0x45bd('0x34')]);if(_0x2a5ea7[_0x45bd('0x35')]){delete _0x2a5ea7[_0x45bd('0x35')];}_0x5f65aa[_0x45bd('0x2b')](_0x4b744a)[_0x45bd('0x36')](_0x2a5ea7);};}exports['index']=function(_0x573790,_0x130d68){var _0x3e214c={},_0x52bb21={},_0x2c767e={'count':0x0,'rows':[]};var _0x365a12=_[_0x45bd('0x37')](db[_0x45bd('0x38')]['rawAttributes'],function(_0x283e7f){return{'name':_0x283e7f[_0x45bd('0x39')],'type':_0x283e7f[_0x45bd('0x3a')][_0x45bd('0x3b')]};});_0x52bb21[_0x45bd('0x3c')]=_[_0x45bd('0x37')](_0x365a12,_0x45bd('0x35'));_0x52bb21['query']=_[_0x45bd('0x3d')](_0x573790[_0x45bd('0x3e')]);_0x52bb21[_0x45bd('0x3f')]=_['intersection'](_0x52bb21['model'],_0x52bb21[_0x45bd('0x3e')]);_0x3e214c[_0x45bd('0x40')]=_[_0x45bd('0x41')](_0x52bb21[_0x45bd('0x3c')],qs[_0x45bd('0x42')](_0x573790['query'][_0x45bd('0x42')]));_0x3e214c[_0x45bd('0x40')]=_0x3e214c[_0x45bd('0x40')][_0x45bd('0x43')]?_0x3e214c['attributes']:_0x52bb21['model'];if(!_0x573790[_0x45bd('0x3e')]['hasOwnProperty'](_0x45bd('0x44'))){_0x3e214c['limit']=qs[_0x45bd('0x45')](_0x573790[_0x45bd('0x3e')][_0x45bd('0x45')]);_0x3e214c[_0x45bd('0x2e')]=qs[_0x45bd('0x2e')](_0x573790[_0x45bd('0x3e')][_0x45bd('0x2e')]);}_0x3e214c[_0x45bd('0x46')]=qs[_0x45bd('0x47')](_0x573790[_0x45bd('0x3e')]['sort']);_0x3e214c[_0x45bd('0x48')]=qs[_0x45bd('0x3f')](_['pick'](_0x573790[_0x45bd('0x3e')],_0x52bb21[_0x45bd('0x3f')]),_0x365a12);if(_0x573790[_0x45bd('0x3e')][_0x45bd('0x49')]){_0x3e214c[_0x45bd('0x48')]=_[_0x45bd('0x4a')](_0x3e214c['where'],{'$or':_[_0x45bd('0x37')](_0x365a12,function(_0x3db2e5){if(_0x3db2e5[_0x45bd('0x3a')]!==_0x45bd('0x4b')){var _0x2d3812={};_0x2d3812[_0x3db2e5['name']]={'$like':'%'+_0x573790[_0x45bd('0x3e')][_0x45bd('0x49')]+'%'};return _0x2d3812;}})});}_0x3e214c=_[_0x45bd('0x4a')]({},_0x3e214c,_0x573790[_0x45bd('0x4c')]);var _0x160dbd={'where':_0x3e214c[_0x45bd('0x48')]};return db[_0x45bd('0x38')]['count'](_0x160dbd)[_0x45bd('0x1e')](function(_0x3256c4){_0x2c767e['count']=_0x3256c4;if(_0x573790[_0x45bd('0x3e')][_0x45bd('0x4d')]){_0x3e214c['include']=[{'all':!![]}];}return db[_0x45bd('0x38')][_0x45bd('0x4e')](_0x3e214c);})['then'](function(_0x1e787b){_0x2c767e['rows']=_0x1e787b;return _0x2c767e;})[_0x45bd('0x1e')](respondWithFilteredResult(_0x130d68,_0x3e214c))[_0x45bd('0x28')](handleError(_0x130d68,null));};exports[_0x45bd('0x4f')]=function(_0x3690c8,_0x16d726){var _0x5dc4ee={'raw':!![],'where':{'id':_0x3690c8[_0x45bd('0x50')]['id']}},_0x596a54={};_0x596a54[_0x45bd('0x3c')]=_['keys'](db[_0x45bd('0x38')]['rawAttributes']);_0x596a54[_0x45bd('0x3e')]=_[_0x45bd('0x3d')](_0x3690c8[_0x45bd('0x3e')]);_0x596a54[_0x45bd('0x3f')]=_[_0x45bd('0x41')](_0x596a54[_0x45bd('0x3c')],_0x596a54[_0x45bd('0x3e')]);_0x5dc4ee[_0x45bd('0x40')]=_[_0x45bd('0x41')](_0x596a54[_0x45bd('0x3c')],qs[_0x45bd('0x42')](_0x3690c8[_0x45bd('0x3e')]['fields']));_0x5dc4ee[_0x45bd('0x40')]=_0x5dc4ee[_0x45bd('0x40')]['length']?_0x5dc4ee[_0x45bd('0x40')]:_0x596a54[_0x45bd('0x3c')];if(_0x3690c8['query'][_0x45bd('0x4d')]){_0x5dc4ee[_0x45bd('0x51')]=[{'all':!![]}];}_0x5dc4ee=_[_0x45bd('0x4a')]({},_0x5dc4ee,_0x3690c8[_0x45bd('0x4c')]);return db[_0x45bd('0x38')]['find'](_0x5dc4ee)[_0x45bd('0x1e')](handleEntityNotFound(_0x16d726,null))['then'](respondWithResult(_0x16d726,null))['catch'](handleError(_0x16d726,null));};exports[_0x45bd('0x52')]=function(_0x5657ec,_0x2f8818){return db[_0x45bd('0x38')][_0x45bd('0x52')](_0x5657ec['body'],{})['then'](respondWithResult(_0x2f8818,0xc9))[_0x45bd('0x28')](handleError(_0x2f8818,null));};exports[_0x45bd('0x53')]=function(_0x10ca79,_0x30d099){if(_0x10ca79['body']['id']){delete _0x10ca79['body']['id'];}return db[_0x45bd('0x38')]['find']({'where':{'id':_0x10ca79[_0x45bd('0x50')]['id']}})[_0x45bd('0x1e')](handleEntityNotFound(_0x30d099,null))[_0x45bd('0x1e')](saveUpdates(_0x10ca79[_0x45bd('0x54')],null))[_0x45bd('0x1e')](respondWithResult(_0x30d099,null))[_0x45bd('0x28')](handleError(_0x30d099,null));};exports['destroy']=function(_0x304d4a,_0x3df967){return db[_0x45bd('0x38')]['find']({'where':{'id':_0x304d4a[_0x45bd('0x50')]['id']}})['then'](handleEntityNotFound(_0x3df967,null))[_0x45bd('0x1e')](removeEntity(_0x3df967,null))['catch'](handleError(_0x3df967,null));};exports[_0x45bd('0x55')]=function(_0x15bd5f,_0x2718e6){return db[_0x45bd('0x38')][_0x45bd('0x55')]()[_0x45bd('0x1e')](respondWithResult(_0x2718e6,null))[_0x45bd('0x28')](handleError(_0x2718e6,null));};var interaction_log=require(_0x45bd('0x11'))(_0x45bd('0x56'));exports[_0x45bd('0x57')]=function(_0x3d7162,_0x33adc3,_0x56dafa){var _0x20cab2={'agent':{},'channel':_0x45bd('0x58')};if(_0x3d7162['body']['id']){delete _0x3d7162[_0x45bd('0x54')]['id'];}_0x3d7162[_0x45bd('0x54')][_0x45bd('0x59')]=!![];_0x3d7162[_0x45bd('0x54')][_0x45bd('0x5a')]=moment()[_0x45bd('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d7162['body'][_0x45bd('0x5c')]=_0x3d7162[_0x45bd('0x54')][_0x45bd('0x5c')]||_0x3d7162[_0x45bd('0x5d')]['id'];_0x20cab2['agent']['id']=_0x3d7162[_0x45bd('0x54')][_0x45bd('0x5c')];return db[_0x45bd('0x38')][_0x45bd('0x5e')]({'where':{'id':_0x3d7162[_0x45bd('0x50')]['id'],'UserId':null}})[_0x45bd('0x1e')](handleEntityNotFound(_0x33adc3,null))[_0x45bd('0x1e')](saveUpdates(_0x3d7162['body'],null))['then'](function(_0x38c1ae){if(_0x38c1ae){_0x20cab2[_0x45bd('0x26')]=_0x38c1ae[_0x45bd('0x5f')]({'plain':!![]});return db[_0x45bd('0x60')][_0x45bd('0x5e')]({'where':{'id':_0x38c1ae['SmsInteractionId']}});}return null;})[_0x45bd('0x1e')](handleEntityNotFound(_0x33adc3,null))[_0x45bd('0x1e')](function(_0x472381){if(_0x472381){return _0x472381[_0x45bd('0x53')]({'UserId':_0x3d7162[_0x45bd('0x54')][_0x45bd('0x5c')],'read1stAt':_['isNil'](_0x472381[_0x45bd('0x61')])?moment()[_0x45bd('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x45bd('0x1e')](function(_0x2ab122){if(_0x2ab122){_0x20cab2[_0x45bd('0x62')]=_0x2ab122['get']({'plain':!![]});interaction_log['info'](_0x45bd('0x63'),_0x3d7162['user']['id'],_0x3d7162[_0x45bd('0x5d')][_0x45bd('0x35')],_0x3d7162['user'][_0x45bd('0x64')],_0x20cab2[_0x45bd('0x62')]['id'],_0x3d7162[_0x45bd('0x54')]?JSON[_0x45bd('0x65')](_0x3d7162['body']):'null');return respondWithRpcPromise(_0x45bd('0x66'),_0x45bd('0x67'),_0x20cab2);}return null;})[_0x45bd('0x1e')](function(_0x149628){var _0x27af95=_0x45bd('0x68')+_0x149628[_0x45bd('0x26')][_0x45bd('0x69')];return db['sequelize']['query'](_0x27af95,{'type':db[_0x45bd('0x6a')][_0x45bd('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x351131){return _0x351131;});})['then'](function(_0x3b0779){if(_0x3b0779){_0x20cab2[_0x45bd('0x26')]['contact']=_0x3b0779[0x0];if(!_0x3d7162[_0x45bd('0x54')]['UserId'])return;return db[_0x45bd('0x6c')][_0x45bd('0x5e')]({'where':{'id':_0x3d7162['body'][_0x45bd('0x5c')],'role':_0x45bd('0x6d')},'attributes':['id','name',_0x45bd('0x6e'),'email',_0x45bd('0x6f')],'raw':!![]});}return null;})[_0x45bd('0x1e')](function(_0x4c28a2){if(!_0x4c28a2)return null;_0x20cab2[_0x45bd('0x26')][_0x45bd('0x6d')]=_0x4c28a2;return _0x20cab2;})[_0x45bd('0x1e')](function(_0x436aa5){if(_0x436aa5){if(_0x3d7162[_0x45bd('0x54')][_0x45bd('0x70')]){_0x20cab2[_0x45bd('0x26')][_0x45bd('0x71')]=util[_0x45bd('0x5b')](_0x45bd('0x72'),_0x3d7162[_0x45bd('0x5d')][_0x45bd('0x35')]);_0x20cab2[_0x45bd('0x26')]['channel']=_0x20cab2[_0x45bd('0x73')];_0x20cab2[_0x45bd('0x26')][_0x45bd('0x74')]=_0x20cab2['channel'];_0x20cab2[_0x45bd('0x26')][_0x45bd('0x75')]=_0x45bd('0x57');return respondWithRpcPromise(_0x45bd('0x76'),_0x45bd('0x76'),{'event':_0x45bd('0x77'),'message':_0x20cab2[_0x45bd('0x26')]},client9002)[_0x45bd('0x1e')](function(){return _0x20cab2;});}return _0x20cab2;}return null;})[_0x45bd('0x1e')](respondWithResult(_0x33adc3,null))[_0x45bd('0x28')](handleError(_0x33adc3,null));};var interaction_log=require(_0x45bd('0x11'))(_0x45bd('0x56'));exports[_0x45bd('0x78')]=function(_0x3674d9,_0x334f5b,_0x20a4d3){var _0x1dceaa={'agent':{},'channel':_0x45bd('0x58')};if(_0x3674d9[_0x45bd('0x54')]['id']){delete _0x3674d9[_0x45bd('0x54')]['id'];}_0x3674d9['body'][_0x45bd('0x5c')]=_0x3674d9[_0x45bd('0x54')]['UserId']||_0x3674d9[_0x45bd('0x5d')]['id'];_0x1dceaa[_0x45bd('0x6d')]['id']=_0x3674d9[_0x45bd('0x54')][_0x45bd('0x5c')];return db['SmsMessage'][_0x45bd('0x5e')]({'where':{'id':_0x3674d9[_0x45bd('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x334f5b,null))[_0x45bd('0x1e')](function(_0x5a84e3){if(_0x5a84e3){_0x1dceaa[_0x45bd('0x26')]=_0x5a84e3[_0x45bd('0x5f')]({'plain':!![]});return db[_0x45bd('0x60')][_0x45bd('0x5e')]({'where':{'id':_0x5a84e3['SmsInteractionId']}});}return null;})[_0x45bd('0x1e')](handleEntityNotFound(_0x334f5b,null))[_0x45bd('0x1e')](function(_0x2b5c6b){if(_0x2b5c6b){_0x1dceaa['interaction']=_0x2b5c6b[_0x45bd('0x5f')]({'plain':!![]});interaction_log[_0x45bd('0x1f')](_0x45bd('0x79'),_0x3674d9[_0x45bd('0x5d')]['id'],_0x3674d9[_0x45bd('0x5d')][_0x45bd('0x35')],_0x3674d9['user']['role'],_0x1dceaa[_0x45bd('0x62')]['id'],_0x3674d9[_0x45bd('0x54')]?JSON[_0x45bd('0x65')](_0x3674d9[_0x45bd('0x54')]):'null');return respondWithRpcPromise(_0x45bd('0x7a'),_0x45bd('0x7b'),_0x1dceaa);}return null;})[_0x45bd('0x1e')](function(_0x5b50e6){var _0xec0509='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b50e6[_0x45bd('0x26')][_0x45bd('0x69')];return db[_0x45bd('0x7c')][_0x45bd('0x3e')](_0xec0509,{'type':db[_0x45bd('0x6a')]['QueryTypes'][_0x45bd('0x7d')],'raw':!![]})[_0x45bd('0x1e')](function(_0x321732){return _0x321732;});})[_0x45bd('0x1e')](function(_0x16762f){if(_0x16762f){_0x1dceaa[_0x45bd('0x26')][_0x45bd('0x7e')]=_0x16762f[0x0];if(!_0x3674d9['body'][_0x45bd('0x5c')])return;return db[_0x45bd('0x6c')][_0x45bd('0x5e')]({'where':{'id':_0x3674d9[_0x45bd('0x54')]['UserId'],'role':_0x45bd('0x6d')},'attributes':['id',_0x45bd('0x35'),_0x45bd('0x6e'),_0x45bd('0x7f'),_0x45bd('0x6f')],'raw':!![]});}return null;})['then'](function(_0x74adbe){if(!_0x74adbe)return null;_0x1dceaa['message'][_0x45bd('0x6d')]=_0x74adbe;return _0x1dceaa;})[_0x45bd('0x1e')](function(_0x88069a){if(_0x88069a){_0x88069a[_0x45bd('0x26')][_0x45bd('0x71')]=util[_0x45bd('0x5b')](_0x45bd('0x72'),_0x3674d9['user'][_0x45bd('0x35')]);_0x88069a[_0x45bd('0x26')][_0x45bd('0x73')]=_0x1dceaa[_0x45bd('0x73')];_0x88069a['message'][_0x45bd('0x74')]=_0x1dceaa[_0x45bd('0x73')];_0x88069a['message'][_0x45bd('0x75')]=_0x45bd('0x78');respondWithRpcPromise(_0x45bd('0x76'),_0x45bd('0x76'),{'event':'rejectmessage','message':_0x88069a[_0x45bd('0x26')]},client9002);return _0x1dceaa;}return null;})[_0x45bd('0x1e')](respondWithResult(_0x334f5b,null))['catch'](handleError(_0x334f5b,null));};exports[_0x45bd('0x2b')]=function(_0x5216c7,_0x410a5f,_0x4cc4e4){if(_0x5216c7[_0x45bd('0x54')]['id']){delete _0x5216c7[_0x45bd('0x54')]['id'];}var _0x36eda5;return db['SmsMessage']['find']({'where':{'id':_0x5216c7[_0x45bd('0x50')]['id']}})[_0x45bd('0x1e')](handleEntityNotFound(_0x410a5f,null))['then'](function(_0x59c54e){if(_0x59c54e){_0x36eda5=_0x59c54e;return db[_0x45bd('0x80')][_0x45bd('0x5e')]({'where':{'id':_0x59c54e[_0x45bd('0x81')]}});}})[_0x45bd('0x1e')](handleEntityNotFound(_0x410a5f,null))[_0x45bd('0x1e')](function(_0x2f50d0){if(_0x2f50d0){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x45bd('0x2b'),'received\x20delivery\x20report\x20from',_0x2f50d0['type'],util[_0x45bd('0x82')](_0x5216c7[_0x45bd('0x54')],{'showHidden':![],'depth':null}));switch(_0x2f50d0[_0x45bd('0x3a')]){case _0x45bd('0x83'):if(_0x5216c7[_0x45bd('0x54')]['MessageSid']&&_0x5216c7[_0x45bd('0x54')][_0x45bd('0x84')]===_0x36eda5[_0x45bd('0x85')]){return _0x36eda5[_0x45bd('0x53')]({'read':!![]});}else{logger[_0x45bd('0x24')](_0x45bd('0x86'),_0x45bd('0x2b'),_0x45bd('0x83'),util[_0x45bd('0x82')](_0x5216c7['body'],{'showHidden':![],'depth':null}));}break;case _0x45bd('0x87'):if(_0x5216c7[_0x45bd('0x54')]['MessageUUID']&&_0x5216c7[_0x45bd('0x54')]['MessageUUID']===_0x36eda5[_0x45bd('0x85')]&&_['indexOf']([_0x45bd('0x88'),_0x45bd('0x89')],_0x5216c7[_0x45bd('0x54')][_0x45bd('0x8a')])>=0x0){return _0x36eda5[_0x45bd('0x53')]({'read':!![]});}else{logger[_0x45bd('0x24')](_0x45bd('0x86'),'status',_0x45bd('0x8b'),util[_0x45bd('0x82')](_0x5216c7[_0x45bd('0x54')],{'showHidden':![],'depth':null}));}break;case _0x45bd('0x8c'):var _0x36aedb=_0x5216c7[_0x45bd('0x54')][_0x45bd('0x8d')][0x0];if(_0x36aedb[_0x45bd('0x2b')][_0x45bd('0x8e')]===_0x45bd('0x8f')){return _0x36eda5[_0x45bd('0x53')]({'read':!![]});}else{logger[_0x45bd('0x24')](_0x45bd('0x86'),_0x45bd('0x2b'),_0x45bd('0x8c'),util[_0x45bd('0x82')](_0x5216c7[_0x45bd('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x36eda5;}})[_0x45bd('0x1e')](respondWithResult(_0x410a5f,null))[_0x45bd('0x28')](handleError(_0x410a5f,null));}; \ No newline at end of file +var _0x9416=['keys','model','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','includeAll','findAll','params','rawAttributes','filters','length','include','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','find','SmsInteractionId','isNil','read1stAt','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','EventManager','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','json','limit','undefined','count','offset','status','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','fieldName','key','query'];(function(_0x2e9bd2,_0x3d5ae0){var _0x453345=function(_0x496818){while(--_0x496818){_0x2e9bd2['push'](_0x2e9bd2['shift']());}};_0x453345(++_0x3d5ae0);}(_0x9416,0xde));var _0x6941=function(_0x4247a4,_0x8c1a71){_0x4247a4=_0x4247a4-0x0;var _0xf62f3d=_0x9416[_0x4247a4];return _0xf62f3d;};'use strict';var emlformat=require(_0x6941('0x0'));var rimraf=require(_0x6941('0x1'));var zipdir=require(_0x6941('0x2'));var jsonpatch=require(_0x6941('0x3'));var rp=require(_0x6941('0x4'));var moment=require(_0x6941('0x5'));var BPromise=require(_0x6941('0x6'));var Mustache=require(_0x6941('0x7'));var util=require(_0x6941('0x8'));var path=require(_0x6941('0x9'));var sox=require(_0x6941('0xa'));var csv=require(_0x6941('0xb'));var ejs=require(_0x6941('0xc'));var fs=require('fs');var fs_extra=require(_0x6941('0xd'));var _=require(_0x6941('0xe'));var squel=require(_0x6941('0xf'));var crypto=require(_0x6941('0x10'));var jsforce=require(_0x6941('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x6941('0xb'));var querystring=require(_0x6941('0x12'));var Papa=require(_0x6941('0x13'));var Redis=require(_0x6941('0x14'));var authService=require(_0x6941('0x15'));var qs=require(_0x6941('0x16'));var as=require(_0x6941('0x17'));var hardwareService=require(_0x6941('0x18'));var logger=require(_0x6941('0x19'))('api');var utils=require(_0x6941('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6941('0x1b')]=_[_0x6941('0x1c')](config[_0x6941('0x1b')],{'host':_0x6941('0x1d'),'port':0x18eb});var socket=require(_0x6941('0x1e'))(new Redis(config[_0x6941('0x1b')]));require(_0x6941('0x1f'))[_0x6941('0x20')](socket);var jayson=require(_0x6941('0x21'));var client=jayson[_0x6941('0x22')][_0x6941('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37bc45,_0x116e04,_0x20ec9c,_0x3cb288){return new BPromise(function(_0x9d5c38,_0x41f8d0){var _0xf9784e=_0x3cb288||client;return _0xf9784e['request'](_0x37bc45,_0x20ec9c)[_0x6941('0x24')](function(_0x159985){logger[_0x6941('0x25')](_0x6941('0x26'),_0x116e04,'request\x20sent');logger[_0x6941('0x27')](_0x6941('0x28'),_0x116e04,_0x6941('0x29'),JSON[_0x6941('0x2a')](_0x159985));if(_0x159985[_0x6941('0x2b')]){if(_0x159985[_0x6941('0x2b')]['code']===0x1f4){logger[_0x6941('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x116e04,_0x159985['error'][_0x6941('0x2c')]);return _0x41f8d0(_0x159985[_0x6941('0x2b')]['message']);}logger[_0x6941('0x2b')](_0x6941('0x26'),_0x116e04,_0x159985['error']['message']);return _0x9d5c38(_0x159985[_0x6941('0x2b')]['message']);}else{logger[_0x6941('0x25')](_0x6941('0x26'),_0x116e04,_0x6941('0x29'));_0x9d5c38(_0x159985[_0x6941('0x2d')][_0x6941('0x2c')]);}})[_0x6941('0x2e')](function(_0x1370f4){logger['error'](_0x6941('0x26'),_0x116e04,_0x1370f4);_0x41f8d0(_0x1370f4);});});}function respondWithStatusCode(_0xf66a50,_0x352a3f){_0x352a3f=_0x352a3f||0xcc;return function(_0x3750f5){if(_0x3750f5){return _0xf66a50['sendStatus'](_0x352a3f);}return _0xf66a50['status'](_0x352a3f)[_0x6941('0x2f')]();};}function respondWithResult(_0x4727c0,_0x11a85a){_0x11a85a=_0x11a85a||0xc8;return function(_0x3059bc){if(_0x3059bc){return _0x4727c0['status'](_0x11a85a)[_0x6941('0x30')](_0x3059bc);}};}function respondWithFilteredResult(_0xfa39c4,_0x2895d6){return function(_0x60e67){if(_0x60e67){var _0x5a1a15=typeof _0x2895d6['offset']==='undefined'&&typeof _0x2895d6[_0x6941('0x31')]===_0x6941('0x32');var _0x43e88a=_0x60e67[_0x6941('0x33')];var _0x4780b5=_0x5a1a15?0x0:_0x2895d6[_0x6941('0x34')];var _0x46a14d=_0x5a1a15?_0x60e67[_0x6941('0x33')]:_0x2895d6[_0x6941('0x34')]+_0x2895d6['limit'];var _0x18ed8c;if(_0x46a14d>=_0x43e88a){_0x46a14d=_0x43e88a;_0x18ed8c=0xc8;}else{_0x18ed8c=0xce;}_0xfa39c4[_0x6941('0x35')](_0x18ed8c);return _0xfa39c4[_0x6941('0x36')]('Content-Range',_0x4780b5+'-'+_0x46a14d+'/'+_0x43e88a)[_0x6941('0x30')](_0x60e67);}return null;};}function patchUpdates(_0xa1abfc){return function(_0x2685ea){try{jsonpatch[_0x6941('0x37')](_0x2685ea,_0xa1abfc,!![]);}catch(_0x1b1fd9){return BPromise[_0x6941('0x38')](_0x1b1fd9);}return _0x2685ea[_0x6941('0x39')]();};}function saveUpdates(_0x3b4c55,_0x2badf4){return function(_0x107e04){if(_0x107e04){return _0x107e04[_0x6941('0x3a')](_0x3b4c55)[_0x6941('0x24')](function(_0x2890bc){return _0x2890bc;});}return null;};}function removeEntity(_0x264300,_0x4fd3f3){return function(_0xb8f9e4){if(_0xb8f9e4){return _0xb8f9e4[_0x6941('0x3b')]()[_0x6941('0x24')](function(){_0x264300[_0x6941('0x35')](0xcc)[_0x6941('0x2f')]();});}};}function handleEntityNotFound(_0x2be2b1,_0x4b61ba){return function(_0x5ebcc5){if(!_0x5ebcc5){_0x2be2b1[_0x6941('0x3c')](0x194);}return _0x5ebcc5;};}function handleError(_0x22d56b,_0xfb2918){_0xfb2918=_0xfb2918||0x1f4;return function(_0x69e137){logger[_0x6941('0x2b')](_0x69e137[_0x6941('0x3d')]);if(_0x69e137[_0x6941('0x3e')]){delete _0x69e137[_0x6941('0x3e')];}_0x22d56b[_0x6941('0x35')](_0xfb2918)[_0x6941('0x3f')](_0x69e137);};}exports[_0x6941('0x40')]=function(_0x131c74,_0x1d029a){var _0x4dceab={},_0xd4eb6a={},_0x5dc128={'count':0x0,'rows':[]};var _0x1e6827=_[_0x6941('0x41')](db[_0x6941('0x42')]['rawAttributes'],function(_0x39d859){return{'name':_0x39d859[_0x6941('0x43')],'type':_0x39d859['type'][_0x6941('0x44')]};});_0xd4eb6a['model']=_['map'](_0x1e6827,'name');_0xd4eb6a[_0x6941('0x45')]=_[_0x6941('0x46')](_0x131c74[_0x6941('0x45')]);_0xd4eb6a['filters']=_['intersection'](_0xd4eb6a[_0x6941('0x47')],_0xd4eb6a[_0x6941('0x45')]);_0x4dceab['attributes']=_[_0x6941('0x48')](_0xd4eb6a[_0x6941('0x47')],qs[_0x6941('0x49')](_0x131c74['query'][_0x6941('0x49')]));_0x4dceab['attributes']=_0x4dceab[_0x6941('0x4a')]['length']?_0x4dceab[_0x6941('0x4a')]:_0xd4eb6a[_0x6941('0x47')];if(!_0x131c74[_0x6941('0x45')]['hasOwnProperty'](_0x6941('0x4b'))){_0x4dceab['limit']=qs['limit'](_0x131c74[_0x6941('0x45')]['limit']);_0x4dceab['offset']=qs[_0x6941('0x34')](_0x131c74[_0x6941('0x45')][_0x6941('0x34')]);}_0x4dceab[_0x6941('0x4c')]=qs['sort'](_0x131c74[_0x6941('0x45')][_0x6941('0x4d')]);_0x4dceab[_0x6941('0x4e')]=qs['filters'](_[_0x6941('0x4f')](_0x131c74['query'],_0xd4eb6a['filters']),_0x1e6827);if(_0x131c74[_0x6941('0x45')][_0x6941('0x50')]){_0x4dceab[_0x6941('0x4e')]=_[_0x6941('0x51')](_0x4dceab[_0x6941('0x4e')],{'$or':_['map'](_0x1e6827,function(_0x1e86b1){if(_0x1e86b1[_0x6941('0x52')]!=='VIRTUAL'){var _0x4c79a5={};_0x4c79a5[_0x1e86b1[_0x6941('0x3e')]]={'$like':'%'+_0x131c74[_0x6941('0x45')][_0x6941('0x50')]+'%'};return _0x4c79a5;}})});}_0x4dceab=_[_0x6941('0x51')]({},_0x4dceab,_0x131c74['options']);var _0x3fe693={'where':_0x4dceab[_0x6941('0x4e')]};return db[_0x6941('0x42')][_0x6941('0x33')](_0x3fe693)['then'](function(_0x1beb1e){_0x5dc128['count']=_0x1beb1e;if(_0x131c74[_0x6941('0x45')][_0x6941('0x53')]){_0x4dceab['include']=[{'all':!![]}];}return db[_0x6941('0x42')][_0x6941('0x54')](_0x4dceab);})[_0x6941('0x24')](function(_0x3b8394){_0x5dc128['rows']=_0x3b8394;return _0x5dc128;})[_0x6941('0x24')](respondWithFilteredResult(_0x1d029a,_0x4dceab))[_0x6941('0x2e')](handleError(_0x1d029a,null));};exports['show']=function(_0x982db8,_0x4cfc7e){var _0x530547={'raw':!![],'where':{'id':_0x982db8[_0x6941('0x55')]['id']}},_0x3526ec={};_0x3526ec[_0x6941('0x47')]=_[_0x6941('0x46')](db[_0x6941('0x42')][_0x6941('0x56')]);_0x3526ec['query']=_[_0x6941('0x46')](_0x982db8[_0x6941('0x45')]);_0x3526ec[_0x6941('0x57')]=_[_0x6941('0x48')](_0x3526ec[_0x6941('0x47')],_0x3526ec[_0x6941('0x45')]);_0x530547[_0x6941('0x4a')]=_[_0x6941('0x48')](_0x3526ec['model'],qs[_0x6941('0x49')](_0x982db8[_0x6941('0x45')][_0x6941('0x49')]));_0x530547['attributes']=_0x530547[_0x6941('0x4a')][_0x6941('0x58')]?_0x530547['attributes']:_0x3526ec[_0x6941('0x47')];if(_0x982db8[_0x6941('0x45')][_0x6941('0x53')]){_0x530547[_0x6941('0x59')]=[{'all':!![]}];}_0x530547=_[_0x6941('0x51')]({},_0x530547,_0x982db8['options']);return db[_0x6941('0x42')]['find'](_0x530547)[_0x6941('0x24')](handleEntityNotFound(_0x4cfc7e,null))[_0x6941('0x24')](respondWithResult(_0x4cfc7e,null))[_0x6941('0x2e')](handleError(_0x4cfc7e,null));};exports['create']=function(_0xf3c198,_0x4f33dc){return db[_0x6941('0x42')]['create'](_0xf3c198[_0x6941('0x5a')],{})[_0x6941('0x24')](respondWithResult(_0x4f33dc,0xc9))['catch'](handleError(_0x4f33dc,null));};exports[_0x6941('0x3a')]=function(_0x2fd495,_0x406aa1){if(_0x2fd495[_0x6941('0x5a')]['id']){delete _0x2fd495[_0x6941('0x5a')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x2fd495[_0x6941('0x55')]['id']}})['then'](handleEntityNotFound(_0x406aa1,null))[_0x6941('0x24')](saveUpdates(_0x2fd495[_0x6941('0x5a')],null))[_0x6941('0x24')](respondWithResult(_0x406aa1,null))[_0x6941('0x2e')](handleError(_0x406aa1,null));};exports['destroy']=function(_0x211126,_0x2cb62c){return db[_0x6941('0x42')]['find']({'where':{'id':_0x211126[_0x6941('0x55')]['id']}})[_0x6941('0x24')](handleEntityNotFound(_0x2cb62c,null))[_0x6941('0x24')](removeEntity(_0x2cb62c,null))['catch'](handleError(_0x2cb62c,null));};exports[_0x6941('0x5b')]=function(_0x31a9a0,_0x1e7fec){return db['SmsMessage'][_0x6941('0x5b')]()['then'](respondWithResult(_0x1e7fec,null))['catch'](handleError(_0x1e7fec,null));};var interaction_log=require(_0x6941('0x19'))(_0x6941('0x5c'));exports[_0x6941('0x5d')]=function(_0x1822b8,_0x30b6ad,_0x2348a9){var _0x1eea76={'agent':{},'channel':_0x6941('0x5e')};if(_0x1822b8['body']['id']){delete _0x1822b8[_0x6941('0x5a')]['id'];}_0x1822b8[_0x6941('0x5a')][_0x6941('0x5f')]=!![];_0x1822b8[_0x6941('0x5a')][_0x6941('0x60')]=moment()[_0x6941('0x61')](_0x6941('0x62'));_0x1822b8[_0x6941('0x5a')]['UserId']=_0x1822b8['body'][_0x6941('0x63')]||_0x1822b8[_0x6941('0x64')]['id'];_0x1eea76[_0x6941('0x65')]['id']=_0x1822b8[_0x6941('0x5a')]['UserId'];return db[_0x6941('0x42')]['find']({'where':{'id':_0x1822b8[_0x6941('0x55')]['id'],'UserId':null}})[_0x6941('0x24')](handleEntityNotFound(_0x30b6ad,null))[_0x6941('0x24')](saveUpdates(_0x1822b8[_0x6941('0x5a')],null))['then'](function(_0xd0088){if(_0xd0088){_0x1eea76[_0x6941('0x2c')]=_0xd0088[_0x6941('0x66')]({'plain':!![]});return db[_0x6941('0x67')][_0x6941('0x68')]({'where':{'id':_0xd0088[_0x6941('0x69')]}});}return null;})[_0x6941('0x24')](handleEntityNotFound(_0x30b6ad,null))[_0x6941('0x24')](function(_0xc81afb){if(_0xc81afb){return _0xc81afb['update']({'UserId':_0x1822b8[_0x6941('0x5a')][_0x6941('0x63')],'read1stAt':_[_0x6941('0x6a')](_0xc81afb[_0x6941('0x6b')])?moment()[_0x6941('0x61')](_0x6941('0x62')):undefined});}return null;})[_0x6941('0x24')](function(_0x51e89d){if(_0x51e89d){_0x1eea76[_0x6941('0x6c')]=_0x51e89d[_0x6941('0x66')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1822b8[_0x6941('0x64')]['id'],_0x1822b8['user'][_0x6941('0x3e')],_0x1822b8['user'][_0x6941('0x6d')],_0x1eea76[_0x6941('0x6c')]['id'],_0x1822b8[_0x6941('0x5a')]?JSON[_0x6941('0x2a')](_0x1822b8[_0x6941('0x5a')]):_0x6941('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1eea76);}return null;})[_0x6941('0x24')](function(_0x3a674d){var _0x483c5d=_0x6941('0x6f')+_0x3a674d['message'][_0x6941('0x70')];return db[_0x6941('0x71')]['query'](_0x483c5d,{'type':db[_0x6941('0x72')][_0x6941('0x73')]['SELECT'],'raw':!![]})[_0x6941('0x24')](function(_0x409a81){return _0x409a81;});})['then'](function(_0x185977){if(_0x185977){_0x1eea76[_0x6941('0x2c')][_0x6941('0x74')]=_0x185977[0x0];if(!_0x1822b8[_0x6941('0x5a')][_0x6941('0x63')])return;return db[_0x6941('0x75')][_0x6941('0x68')]({'where':{'id':_0x1822b8[_0x6941('0x5a')][_0x6941('0x63')],'role':_0x6941('0x65')},'attributes':['id','name',_0x6941('0x76'),_0x6941('0x77'),'internal'],'raw':!![]});}return null;})[_0x6941('0x24')](function(_0x346714){if(!_0x346714)return null;_0x1eea76['message'][_0x6941('0x65')]=_0x346714;return _0x1eea76;})[_0x6941('0x24')](function(_0x360203){if(_0x360203){if(_0x1822b8[_0x6941('0x5a')]['manual']){_0x1eea76[_0x6941('0x2c')][_0x6941('0x78')]=util['format'](_0x6941('0x79'),_0x1822b8[_0x6941('0x64')]['name']);_0x1eea76['message'][_0x6941('0x7a')]=_0x1eea76[_0x6941('0x7a')];_0x1eea76[_0x6941('0x2c')][_0x6941('0x7b')]=_0x1eea76[_0x6941('0x7a')];_0x1eea76[_0x6941('0x2c')][_0x6941('0x7c')]=_0x6941('0x5d');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x6941('0x7d'),'message':_0x1eea76['message']},client9002)['then'](function(){return _0x1eea76;});}return _0x1eea76;}return null;})['then'](respondWithResult(_0x30b6ad,null))[_0x6941('0x2e')](handleError(_0x30b6ad,null));};var interaction_log=require(_0x6941('0x19'))(_0x6941('0x5c'));exports['reject']=function(_0x532513,_0x364f49,_0x304d43){var _0x13b3e4={'agent':{},'channel':'sms'};if(_0x532513['body']['id']){delete _0x532513[_0x6941('0x5a')]['id'];}_0x532513[_0x6941('0x5a')][_0x6941('0x63')]=_0x532513['body'][_0x6941('0x63')]||_0x532513[_0x6941('0x64')]['id'];_0x13b3e4[_0x6941('0x65')]['id']=_0x532513[_0x6941('0x5a')][_0x6941('0x63')];return db[_0x6941('0x42')][_0x6941('0x68')]({'where':{'id':_0x532513[_0x6941('0x55')]['id'],'UserId':null}})[_0x6941('0x24')](handleEntityNotFound(_0x364f49,null))[_0x6941('0x24')](function(_0x37ea6b){if(_0x37ea6b){_0x13b3e4[_0x6941('0x2c')]=_0x37ea6b[_0x6941('0x66')]({'plain':!![]});return db[_0x6941('0x67')][_0x6941('0x68')]({'where':{'id':_0x37ea6b[_0x6941('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x364f49,null))[_0x6941('0x24')](function(_0x417ed2){if(_0x417ed2){_0x13b3e4['interaction']=_0x417ed2[_0x6941('0x66')]({'plain':!![]});interaction_log[_0x6941('0x25')](_0x6941('0x7e'),_0x532513[_0x6941('0x64')]['id'],_0x532513['user'][_0x6941('0x3e')],_0x532513['user'][_0x6941('0x6d')],_0x13b3e4[_0x6941('0x6c')]['id'],_0x532513[_0x6941('0x5a')]?JSON[_0x6941('0x2a')](_0x532513[_0x6941('0x5a')]):_0x6941('0x6e'));return respondWithRpcPromise(_0x6941('0x7f'),_0x6941('0x80'),_0x13b3e4);}return null;})[_0x6941('0x24')](function(_0x27c73f){var _0x535b01=_0x6941('0x6f')+_0x27c73f[_0x6941('0x2c')]['ContactId'];return db[_0x6941('0x71')][_0x6941('0x45')](_0x535b01,{'type':db[_0x6941('0x72')][_0x6941('0x73')][_0x6941('0x81')],'raw':!![]})[_0x6941('0x24')](function(_0x5f07f7){return _0x5f07f7;});})[_0x6941('0x24')](function(_0xf07f21){if(_0xf07f21){_0x13b3e4[_0x6941('0x2c')][_0x6941('0x74')]=_0xf07f21[0x0];if(!_0x532513['body'][_0x6941('0x63')])return;return db['User']['find']({'where':{'id':_0x532513['body']['UserId'],'role':'agent'},'attributes':['id',_0x6941('0x3e'),_0x6941('0x76'),'email','internal'],'raw':!![]});}return null;})[_0x6941('0x24')](function(_0x1f3a50){if(!_0x1f3a50)return null;_0x13b3e4[_0x6941('0x2c')][_0x6941('0x65')]=_0x1f3a50;return _0x13b3e4;})['then'](function(_0xa3f093){if(_0xa3f093){_0xa3f093[_0x6941('0x2c')][_0x6941('0x78')]=util[_0x6941('0x61')](_0x6941('0x79'),_0x532513[_0x6941('0x64')][_0x6941('0x3e')]);_0xa3f093[_0x6941('0x2c')]['channel']=_0x13b3e4[_0x6941('0x7a')];_0xa3f093[_0x6941('0x2c')][_0x6941('0x7b')]=_0x13b3e4[_0x6941('0x7a')];_0xa3f093['message'][_0x6941('0x7c')]=_0x6941('0x38');respondWithRpcPromise(_0x6941('0x82'),_0x6941('0x82'),{'event':_0x6941('0x83'),'message':_0xa3f093['message']},client9002);return _0x13b3e4;}return null;})[_0x6941('0x24')](respondWithResult(_0x364f49,null))[_0x6941('0x2e')](handleError(_0x364f49,null));};exports[_0x6941('0x35')]=function(_0x39a7a7,_0xd45c25,_0x4cd687){if(_0x39a7a7[_0x6941('0x5a')]['id']){delete _0x39a7a7[_0x6941('0x5a')]['id'];}var _0xeece2b;return db[_0x6941('0x42')][_0x6941('0x68')]({'where':{'id':_0x39a7a7[_0x6941('0x55')]['id']}})['then'](handleEntityNotFound(_0xd45c25,null))[_0x6941('0x24')](function(_0x44d92e){if(_0x44d92e){_0xeece2b=_0x44d92e;return db['SmsAccount'][_0x6941('0x68')]({'where':{'id':_0x44d92e[_0x6941('0x84')]}});}})[_0x6941('0x24')](handleEntityNotFound(_0xd45c25,null))[_0x6941('0x24')](function(_0x4de038){if(_0x4de038){logger[_0x6941('0x27')](_0x6941('0x28'),_0x6941('0x35'),'received\x20delivery\x20report\x20from',_0x4de038[_0x6941('0x52')],util[_0x6941('0x85')](_0x39a7a7['body'],{'showHidden':![],'depth':null}));switch(_0x4de038[_0x6941('0x52')]){case _0x6941('0x86'):if(_0x39a7a7['body']['MessageSid']&&_0x39a7a7[_0x6941('0x5a')][_0x6941('0x87')]===_0xeece2b[_0x6941('0x88')]){return _0xeece2b['update']({'read':!![]});}else{logger['error'](_0x6941('0x89'),_0x6941('0x35'),_0x6941('0x86'),util[_0x6941('0x85')](_0x39a7a7[_0x6941('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x6941('0x8a'):if(_0x39a7a7['body'][_0x6941('0x8b')]&&_0x39a7a7[_0x6941('0x5a')][_0x6941('0x8b')]===_0xeece2b[_0x6941('0x88')]&&_[_0x6941('0x8c')]([_0x6941('0x8d'),'delivered'],_0x39a7a7[_0x6941('0x5a')]['Status'])>=0x0){return _0xeece2b[_0x6941('0x3a')]({'read':!![]});}else{logger['error'](_0x6941('0x89'),'status','plivio',util['inspect'](_0x39a7a7[_0x6941('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x6941('0x8e'):var _0x2c57b7=_0x39a7a7[_0x6941('0x5a')][_0x6941('0x8f')][0x0];if(_0x2c57b7[_0x6941('0x35')][_0x6941('0x90')]===_0x6941('0x91')){return _0xeece2b[_0x6941('0x3a')]({'read':!![]});}else{logger[_0x6941('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x6941('0x8e'),util[_0x6941('0x85')](_0x39a7a7[_0x6941('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xeece2b;}})[_0x6941('0x24')](respondWithResult(_0xd45c25,null))['catch'](handleError(_0xd45c25,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 12ddc2f..cd621f2 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 _0x4657=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x30f9a1,_0x51865c){var _0x3787f4=function(_0x19bae4){while(--_0x19bae4){_0x30f9a1['push'](_0x30f9a1['shift']());}};_0x3787f4(++_0x51865c);}(_0x4657,0x183));var _0x7465=function(_0x55c307,_0x22b2ce){_0x55c307=_0x55c307-0x0;var _0xcca0a9=_0x4657[_0x55c307];return _0xcca0a9;};'use strict';var EventEmitter=require(_0x7465('0x0'));var SmsMessage=require(_0x7465('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7465('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7465('0x3'),'afterDestroy':_0x7465('0x4')};function emitEvent(_0x22a601){return function(_0xebc9a,_0xbda60d,_0x550ce5){SmsMessageEvents[_0x7465('0x5')](_0x22a601+':'+_0xebc9a['id'],_0xebc9a);SmsMessageEvents[_0x7465('0x5')](_0x22a601,_0xebc9a);_0x550ce5(null);};}for(var e in events){if(events[_0x7465('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x7465('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x13ff=['remove','emit','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5cb467,_0x25cf26){var _0x4f6f66=function(_0x1b31d9){while(--_0x1b31d9){_0x5cb467['push'](_0x5cb467['shift']());}};_0x4f6f66(++_0x25cf26);}(_0x13ff,0xab));var _0xf13f=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x13ff[_0xd09668];return _0x68726;};'use strict';var EventEmitter=require(_0xf13f('0x0'));var SmsMessage=require(_0xf13f('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf13f('0x2')](0x0);var events={'afterCreate':_0xf13f('0x3'),'afterUpdate':_0xf13f('0x4'),'afterDestroy':_0xf13f('0x5')};function emitEvent(_0x104abf){return function(_0x24449d,_0x5b1d43,_0x230e52){SmsMessageEvents[_0xf13f('0x6')](_0x104abf+':'+_0x24449d['id'],_0x24449d);SmsMessageEvents[_0xf13f('0x6')](_0x104abf,_0x24449d);_0x230e52(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xf13f('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index b8bbfe7..a96a820 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 _0xea33=['SmsInteraction','findOne','update','createdAt','catch','then','type','twilio','accountSid','authToken','messages','create','phone','/api/sms/messages/','/status?token=','token','sid','error','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','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','password','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','queued_count','data','message_id','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','remote','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','sort','length','createHash','md5','digest','hex','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Basic\x20%s','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId'];(function(_0x40be44,_0x440a57){var _0x543dc2=function(_0x2ee7a1){while(--_0x2ee7a1){_0x40be44['push'](_0x40be44['shift']());}};_0x543dc2(++_0x440a57);}(_0xea33,0x161));var _0x3ea3=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xea33[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3ea3('0x0'))(_0x3ea3('0x1'));var moment=require(_0x3ea3('0x2'));var BPromise=require(_0x3ea3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ea3('0x4'));var rimraf=require(_0x3ea3('0x5'));var config=require(_0x3ea3('0x6'));var attributes=require(_0x3ea3('0x7'));module[_0x3ea3('0x8')]=function(_0x5a03bb,_0x52b40f){return _0x5a03bb[_0x3ea3('0x9')]('SmsMessage',attributes,{'tableName':_0x3ea3('0xa'),'paranoid':![],'indexes':[{'name':_0x3ea3('0xb'),'fields':['messageId']},{'name':_0x3ea3('0xc'),'fields':[_0x3ea3('0xd')],'type':_0x3ea3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fab42,_0x4b9977,_0x9df71e){var _0x49a420=_0x5a03bb['models'];var _0xc89ad6=_0x1fab42[_0x3ea3('0xf')]({'plain':!![]});if(_0xc89ad6[_0x3ea3('0x10')][_0x3ea3('0x11')]()==='in'||_0xc89ad6[_0x3ea3('0x10')][_0x3ea3('0x11')]()===_0x3ea3('0x12')&&!_0xc89ad6[_0x3ea3('0x13')]&&!_['isNil'](_0xc89ad6['UserId'])&&!_[_0x3ea3('0x14')](_0xc89ad6[_0x3ea3('0x15')])){_0x49a420[_0x3ea3('0x16')][_0x3ea3('0x17')]({'where':{'id':_0xc89ad6['SmsInteractionId']}})['then'](function(_0x1a02c1){if(_0x1a02c1){_0x1a02c1[_0x3ea3('0x18')]({'lastMsgAt':_0xc89ad6[_0x3ea3('0x19')],'lastMsgDirection':_0xc89ad6[_0x3ea3('0x10')][_0x3ea3('0x11')]()});}})[_0x3ea3('0x1a')](function(_0x1635c8){console['error'](_0x1635c8);});}if(_0xc89ad6['direction']===_0x3ea3('0x12')&&!_0xc89ad6[_0x3ea3('0x13')]){var _0xd740d9;_0x49a420['SmsAccount']['find']({'where':{'id':_0xc89ad6['SmsAccountId']},'raw':!![]})[_0x3ea3('0x1b')](function(_0x562b76){_0xd740d9=_0x562b76;if(_0xd740d9&&_0xd740d9[_0x3ea3('0x1c')]){switch(_0xd740d9[_0x3ea3('0x1c')]){case _0x3ea3('0x1d'):var _0x305e65=require(_0x3ea3('0x1d'));if(_0xd740d9[_0x3ea3('0x1e')]&&_0xd740d9['authToken']&&_0xd740d9['phone']){var _0x4b2af7=new _0x305e65(_0xd740d9['accountSid'],_0xd740d9[_0x3ea3('0x1f')]);_0x4b2af7[_0x3ea3('0x20')][_0x3ea3('0x21')]({'body':_0xc89ad6[_0x3ea3('0xd')],'to':_0xc89ad6['phone'],'from':_0xd740d9[_0x3ea3('0x22')],'statusCallback':_0xd740d9['remote']+_0x3ea3('0x23')+_0xc89ad6['id']+_0x3ea3('0x24')+_0xd740d9[_0x3ea3('0x25')]})[_0x3ea3('0x1b')](function(_0x4006cb){if(_0x4006cb[_0x3ea3('0x26')]){return _0x1fab42[_0x3ea3('0x18')]({'messageId':_0x4006cb[_0x3ea3('0x26')]});}})[_0x3ea3('0x1a')](function(_0x3179be){logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),'twilio',util[_0x3ea3('0x2a')](_0x3179be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x1d'),_0x3ea3('0x2b'));}break;case _0x3ea3('0x2c'):var _0x58abc2=_0x3ea3('0x2d');if(_0xd740d9[_0x3ea3('0x2e')]&&_0xd740d9['password']){var _0x1c0399={'recipient':[_0xc89ad6['phone']],'message':_0xc89ad6[_0x3ea3('0xd')],'message_type':_0xd740d9['smsMethod']};if(_0xd740d9[_0x3ea3('0x2f')]&&_0xd740d9[_0x3ea3('0x2f')]!=='SI'){_0x1c0399[_0x3ea3('0x30')]=_0xd740d9[_0x3ea3('0x22')];}var _0x551304={'url':_0x58abc2+_0x3ea3('0x31')+_0xd740d9[_0x3ea3('0x2e')]+_0x3ea3('0x32')+_0xd740d9['password'],'method':_0x3ea3('0x33')};rp(_0x551304)[_0x3ea3('0x1b')](function(_0x5e3d25){var _0x5706cb=_0x5e3d25[_0x3ea3('0x34')](';');var _0x3114f3={'user_key':_0x5706cb[0x0],'session_key':_0x5706cb[0x1]};_0x551304={'url':_0x58abc2+_0x3ea3('0x35'),'method':_0x3ea3('0x36'),'headers':{'user_key':_0x3114f3[_0x3ea3('0x37')],'Session_key':_0x3114f3[_0x3ea3('0x38')]},'json':!![],'body':_0x1c0399};return rp(_0x551304);})[_0x3ea3('0x1b')](function(_0x1d9e3c){if(_0x1d9e3c[_0x3ea3('0x39')]>=0x1){var _0x1255eb={'messageId':_0x1d9e3c[_0x3ea3('0x3a')]};if(_0xd740d9[_0x3ea3('0x2f')]!=='GP'||!_0xd740d9['deliveryReport']){_0x1255eb[_0x3ea3('0x3b')]=!![];}return _0x1fab42[_0x3ea3('0x18')](_0x1255eb);}else{return logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x2c'),util['inspect'](_0x1d9e3c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3e258f){return logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x2c'),util[_0x3ea3('0x2a')](_0x3e258f,{'showHidden':![],'depth':null}));});}else{logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x2c'),_0x3ea3('0x3c'));}break;case _0x3ea3('0x3d'):if(_0xd740d9['authToken']){var _0x2c058b={'recipient':_0xc89ad6[_0x3ea3('0x22')],'message':_0xc89ad6[_0x3ea3('0xd')],'sender':_0xd740d9[_0x3ea3('0x3e')]||_0xd740d9['phone'],'authorization':_0xd740d9[_0x3ea3('0x1f')]};var _0x4b9977={'method':_0x3ea3('0x36'),'uri':_0x3ea3('0x3f'),'body':_0x2c058b,'json':!![]};rp(_0x4b9977)[_0x3ea3('0x1b')](function(_0x3b7836){var _0x4fdd70={'messageId':_0x3b7836[_0x3ea3('0x40')]};if(!_0xd740d9[_0x3ea3('0x41')]){_0x4fdd70['read']=!![];}return _0x1fab42[_0x3ea3('0x18')](_0x4fdd70);})[_0x3ea3('0x1a')](function(_0x5d6705){logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x3d'),util[_0x3ea3('0x2a')](_0x5d6705,{'showHidden':![],'depth':null}));});}else{logger[_0x3ea3('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ea3('0x29'),_0x3ea3('0x3d'),_0x3ea3('0x42'));}break;case _0x3ea3('0x43'):if(_0xd740d9['username']&&_0xd740d9[_0x3ea3('0x44')]){var _0x2c058b={'messages':[{'source':_0x3ea3('0x45'),'to':_0xc89ad6[_0x3ea3('0x22')],'body':_0xc89ad6[_0x3ea3('0xd')],'from':_0xd740d9[_0x3ea3('0x3e')]||_0xd740d9[_0x3ea3('0x22')]}]};var _0x14afa8=util[_0x3ea3('0x46')]('%s:%s',_0xd740d9['username'],_0xd740d9[_0x3ea3('0x44')]);var _0x4b9977={'method':_0x3ea3('0x36'),'uri':_0x3ea3('0x47'),'body':_0x2c058b,'headers':{'Authorization':util[_0x3ea3('0x46')]('Basic\x20%s',new Buffer(_0x14afa8)[_0x3ea3('0x48')](_0x3ea3('0x49')))},'json':!![]};rp(_0x4b9977)['then'](function(_0x26d875){if(_0x26d875[_0x3ea3('0x4a')]>=0xc8&&_0x26d875['http_code']<=0xce){if(_0x26d875['data']&&_0x26d875['data'][_0x3ea3('0x4b')]>0x0){var _0x348072=_['head'](_0x26d875[_0x3ea3('0x4c')]['messages']);var _0x49b66c={'messageId':_0x348072[_0x3ea3('0x4d')]};if(!_0xd740d9['deliveryReport']){_0x49b66c[_0x3ea3('0x3b')]=!![];}return _0x1fab42[_0x3ea3('0x18')](_0x49b66c);}else{logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),'clickSend',util[_0x3ea3('0x2a')](_0x26d875,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x3ea3('0x28'),'afterCreate',_0x3ea3('0x4e'),util[_0x3ea3('0x2a')](_0x26d875,{'showHidden':![],'depth':null}));}})[_0x3ea3('0x1a')](function(_0x5b1588){logger[_0x3ea3('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ea3('0x29'),_0x3ea3('0x4e'),util[_0x3ea3('0x2a')](_0x5b1588,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x4e'),_0x3ea3('0x3c'));}break;case _0x3ea3('0x4f'):if(_0xd740d9[_0x3ea3('0x50')]&&_0xd740d9[_0x3ea3('0x1f')]){var _0x2c058b={'dst':_0xc89ad6['phone'],'text':_0xc89ad6['body'],'src':_0xd740d9[_0x3ea3('0x3e')]||_0xd740d9[_0x3ea3('0x22')],'url':_0xd740d9['remote']+_0x3ea3('0x23')+_0xc89ad6['id']+_0x3ea3('0x24')+_0xd740d9['token']};var _0x14afa8=util[_0x3ea3('0x46')](_0x3ea3('0x51'),_0xd740d9[_0x3ea3('0x50')],_0xd740d9[_0x3ea3('0x1f')]);var _0x4b9977={'method':_0x3ea3('0x36'),'uri':util[_0x3ea3('0x46')](_0x3ea3('0x52'),_0xd740d9[_0x3ea3('0x50')]),'body':_0x2c058b,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x14afa8)[_0x3ea3('0x48')](_0x3ea3('0x49')))},'json':!![]};rp(_0x4b9977)[_0x3ea3('0x1b')](function(_0x51f369){var _0x15cffb={'messageId':_0x51f369[_0x3ea3('0x53')][0x0]};return _0x1fab42['update'](_0x15cffb);})[_0x3ea3('0x1a')](function(_0x4fcaec){logger[_0x3ea3('0x27')](_0x3ea3('0x28'),'afterCreate',_0x3ea3('0x4f'),util[_0x3ea3('0x2a')](_0x4fcaec,{'showHidden':![],'depth':null}));});}else{logger[_0x3ea3('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3ea3('0x4f'),_0x3ea3('0x54'));}break;case'infobip':if(_0xd740d9[_0x3ea3('0x2e')]&&_0xd740d9[_0x3ea3('0x44')]){if(_0xd740d9[_0x3ea3('0x55')]){var _0x31bc7f={'method':_0x3ea3('0x36'),'uri':_0xd740d9[_0x3ea3('0x55')]+_0x3ea3('0x56'),'body':{'username':_0xd740d9[_0x3ea3('0x2e')],'password':_0xd740d9['password']},'json':!![]};return rp(_0x31bc7f)[_0x3ea3('0x1b')](function(_0x102567){var _0x2bbe96={'method':_0x3ea3('0x36'),'uri':_0xd740d9[_0x3ea3('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0xd740d9[_0x3ea3('0x22')],'destinations':[{'to':_0xc89ad6[_0x3ea3('0x22')]}],'text':_0xc89ad6['body'],'notifyUrl':_0xd740d9[_0x3ea3('0x57')]+_0x3ea3('0x23')+_0xc89ad6['id']+_0x3ea3('0x24')+_0xd740d9['token'],'notifyContentType':_0x3ea3('0x58'),'callbackData':_0xd740d9[_0x3ea3('0x22')]+';'+_0xc89ad6[_0x3ea3('0xd')]}]},'headers':{'Authorization':_0x3ea3('0x59')+_0x102567[_0x3ea3('0x25')]},'json':!![]};return rp(_0x2bbe96)[_0x3ea3('0x1b')](function(_0x5ad837){if(_0x5ad837['messages']){var _0x5a152e={'messageId':_0x5ad837[_0x3ea3('0x20')][0x0]['messageId']};if(!_0xd740d9[_0x3ea3('0x41')]){_0x5a152e['read']=!![];}return _0x1fab42[_0x3ea3('0x18')](_0x5a152e);}else{return logger[_0x3ea3('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3ea3('0x5a'),util[_0x3ea3('0x2a')](_0x5ad837,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5c0caf){return logger['error'](_0x3ea3('0x28'),'afterCreate',_0x3ea3('0x5a'),util[_0x3ea3('0x2a')](_0x5c0caf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x5a'),_0x3ea3('0x5b'));}}else{logger[_0x3ea3('0x27')](_0x3ea3('0x28'),'afterCreate','infobip',_0x3ea3('0x3c'));}break;case _0x3ea3('0x5c'):var _0x5110b2=require(_0x3ea3('0x5d'));if(_0xd740d9[_0x3ea3('0x5e')]){var _0x5cca32={};_0x5cca32['login']=_0xd740d9[_0x3ea3('0x2e')];_0x5cca32[_0x3ea3('0x22')]=_0xc89ad6[_0x3ea3('0x22')];_0x5cca32[_0x3ea3('0x30')]=_0xd740d9['phone'];_0x5cca32[_0x3ea3('0x5f')]=_0xc89ad6[_0x3ea3('0xd')];_0x5cca32['timestamp']=+new Date();var _0x24a845='';var _0x18713f='';var _0x118b45=Object['keys'](_0x5cca32);_0x118b45[_0x3ea3('0x60')]();for(var _0x114c1a=0x0;_0x114c1a<_0x118b45[_0x3ea3('0x61')];_0x114c1a++){if(_0x24a845!=''){_0x24a845+='&';}_0x24a845+=_0x118b45[_0x114c1a]+'='+encodeURIComponent(_0x5cca32[_0x118b45[_0x114c1a]]);_0x18713f+=_0x5cca32[_0x118b45[_0x114c1a]];}_0x18713f+=_0xd740d9[_0x3ea3('0x5e')];_0x18713f=_0x5110b2[_0x3ea3('0x62')](_0x3ea3('0x63'))['update'](_0x18713f)[_0x3ea3('0x64')](_0x3ea3('0x65'));if(_0x24a845!==''){_0x24a845+='&';}_0x24a845+='signature='+_0x18713f;var _0x551304={'method':_0x3ea3('0x33'),'uri':_0xd740d9[_0x3ea3('0x55')]+_0x3ea3('0x66')+_0x24a845,'json':!![]};return rp(_0x551304)[_0x3ea3('0x1b')](function(_0x1334d6){var _0x98c2a8=Object[_0x3ea3('0x67')](_0x1334d6);if(_0x1334d6[_0x98c2a8[0x0]][_0x3ea3('0x27')]&&parseInt(_0x1334d6[_0x98c2a8[0x0]][_0x3ea3('0x27')])===0x0){var _0x43f929={'messageId':_0x1334d6[_0x98c2a8[0x0]][_0x3ea3('0x68')]};if(!_0xd740d9[_0x3ea3('0x41')]){_0x43f929[_0x3ea3('0x3b')]=!![];}return _0x1fab42['update'](_0x43f929);}else{return logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x5c'),util[_0x3ea3('0x2a')](_0x1334d6['error'],{'showHidden':![],'depth':null}));}})[_0x3ea3('0x1a')](function(_0x4c54e0){return logger['error'](_0x3ea3('0x28'),'afterCreate',_0x3ea3('0x5c'),util[_0x3ea3('0x2a')](_0x4c54e0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x5c'),_0x3ea3('0x69'));}break;case _0x3ea3('0x6a'):if(_0xd740d9[_0x3ea3('0x5e')]){var _0x2d316f={'method':_0x3ea3('0x36'),'uri':_0x3ea3('0x6b'),'headers':{'Authorization':_0xd740d9[_0x3ea3('0x5e')]},'body':{'content':_0xc89ad6[_0x3ea3('0xd')],'to':[_0xc89ad6[_0x3ea3('0x22')]],'from':_0xd740d9[_0x3ea3('0x22')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x2d316f)[_0x3ea3('0x1b')](function(_0x1a21b3){if(!_0x1a21b3['error']){var _0x34e682={'messageId':_0x1a21b3[_0x3ea3('0x20')][0x0]['apiMessageId']};if(!_0xd740d9[_0x3ea3('0x41')]){_0x34e682['read']=!![];}return _0x1fab42[_0x3ea3('0x18')](_0x34e682);}else{return logger['error'](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x6a'),util['inspect'](_0x1a21b3['error'],{'showHidden':![],'depth':null}));}})[_0x3ea3('0x1a')](function(_0x1a27ef){return logger[_0x3ea3('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ea3('0x29'),_0x3ea3('0x6a'),util[_0x3ea3('0x2a')](_0x1a27ef,{'showHidden':![],'depth':null}));});}else{logger[_0x3ea3('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ea3('0x29'),'clickatell',_0x3ea3('0x69'));}break;case _0x3ea3('0x6c'):if(_0xd740d9[_0x3ea3('0x2e')]&&_0xd740d9[_0x3ea3('0x44')]){var _0x14afa8=util[_0x3ea3('0x46')](_0x3ea3('0x51'),_0xd740d9['username'],_0xd740d9[_0x3ea3('0x44')]);var _0x4b9977={'method':_0x3ea3('0x36'),'uri':_0x3ea3('0x6d')+_0xd740d9[_0x3ea3('0x6e')]+_0x3ea3('0x6f'),'body':{'to':[_0xc89ad6['phone']],'text':_0xc89ad6['body'],'from':_0xd740d9[_0x3ea3('0x22')],'applicationId':_0xd740d9[_0x3ea3('0x70')]},'headers':{'Authorization':util[_0x3ea3('0x46')](_0x3ea3('0x71'),new Buffer(_0x14afa8)[_0x3ea3('0x48')](_0x3ea3('0x49')))},'json':!![]};rp(_0x4b9977)[_0x3ea3('0x1b')](function(_0x15bf87){if(_0x15bf87['id']){var _0x3d58d8={'messageId':_0x15bf87['id']};return _0x1fab42['update'](_0x3d58d8);}else{logger['error'](_0x3ea3('0x28'),_0x3ea3('0x29'),'bandwidth',util[_0x3ea3('0x2a')](_0x15bf87,{'showHidden':![],'depth':null}));}})['catch'](function(_0x82427e){logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x6c'),util[_0x3ea3('0x2a')](_0x82427e,{'showHidden':![],'depth':null}));});}else{logger[_0x3ea3('0x27')](_0x3ea3('0x28'),'afterCreate',_0x3ea3('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0xd740d9[_0x3ea3('0x5e')]){var _0x42d008={};var _0x551304={'method':'POST','uri':_0x3ea3('0x72'),'headers':{'Authorization':'Bearer\x20'+_0xd740d9[_0x3ea3('0x5e')],'Content-Type':'application/json'},'body':{'from':_0xd740d9[_0x3ea3('0x22')],'to':_0xc89ad6[_0x3ea3('0x22')],'text':_0xc89ad6['body']},'json':!![]};return rp(_0x551304)[_0x3ea3('0x1b')](function(_0x4110bd){if(_0x4110bd[_0x3ea3('0x73')]==0xca){_0x42d008['message']=_0x4110bd;var _0x1aed7e={'method':_0x3ea3('0x36'),'uri':_0x3ea3('0x74'),'headers':{'Authorization':_0x3ea3('0x75')+_0xd740d9[_0x3ea3('0x5e')],'Content-Type':'application/json'},'body':{'refid':_0x42d008[_0x3ea3('0x76')][_0x3ea3('0x77')]},'json':!![]};return rp(_0x1aed7e)[_0x3ea3('0x1b')](function(_0x27bbc8){_0x42d008[_0x3ea3('0x78')]=_0x27bbc8;var _0x30e082={'messageId':_0x42d008[_0x3ea3('0x76')]['refid'],'read':!![]};return _0x1fab42[_0x3ea3('0x18')](_0x30e082);});}else{return logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x79'),util[_0x3ea3('0x2a')](_0x4110bd,{'showHidden':![],'depth':null}));}})[_0x3ea3('0x1a')](function(_0x53058c){return logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x79'),util['inspect'](_0x53058c,{'showHidden':![],'depth':null}));});}else{return logger[_0x3ea3('0x27')](_0x3ea3('0x28'),_0x3ea3('0x29'),_0x3ea3('0x79'),_0x3ea3('0x7a'));}break;}}})['finally'](function(){_0x9df71e();});}else{_0x9df71e();}}},'charset':_0x3ea3('0x7b'),'collate':_0x3ea3('0x7c')});}; \ No newline at end of file +var _0x27a8=['phone','/status?token=','token','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','GET','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','POST','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','remote','/api/sms/messages/','format','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','application/json','IBSSO\x20','infobip','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','body','models','get','direction','toLowerCase','secret','UserId','isNil','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','accountSid','authToken','messages','create'];(function(_0x1f8f9a,_0x291e2d){var _0x1ca216=function(_0x328199){while(--_0x328199){_0x1f8f9a['push'](_0x1f8f9a['shift']());}};_0x1ca216(++_0x291e2d);}(_0x27a8,0x1bd));var _0x827a=function(_0x601f4c,_0xb2bcd8){_0x601f4c=_0x601f4c-0x0;var _0x3cd1f4=_0x27a8[_0x601f4c];return _0x3cd1f4;};'use strict';var _=require(_0x827a('0x0'));var util=require('util');var logger=require(_0x827a('0x1'))(_0x827a('0x2'));var moment=require(_0x827a('0x3'));var BPromise=require(_0x827a('0x4'));var rp=require(_0x827a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x827a('0x6'));var config=require(_0x827a('0x7'));var attributes=require(_0x827a('0x8'));module[_0x827a('0x9')]=function(_0x42e079,_0x229c27){return _0x42e079['define']('SmsMessage',attributes,{'tableName':_0x827a('0xa'),'paranoid':![],'indexes':[{'name':_0x827a('0xb'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x827a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b6cf9,_0x1a76a6,_0xf70ae9){var _0x46fcc5=_0x42e079[_0x827a('0xd')];var _0x9918f=_0x3b6cf9[_0x827a('0xe')]({'plain':!![]});if(_0x9918f[_0x827a('0xf')]['toLowerCase']()==='in'||_0x9918f[_0x827a('0xf')][_0x827a('0x10')]()==='out'&&!_0x9918f[_0x827a('0x11')]&&!_['isNil'](_0x9918f[_0x827a('0x12')])&&!_[_0x827a('0x13')](_0x9918f['SmsInteractionId'])){_0x46fcc5[_0x827a('0x14')][_0x827a('0x15')]({'where':{'id':_0x9918f[_0x827a('0x16')]}})[_0x827a('0x17')](function(_0x588c9d){if(_0x588c9d){_0x588c9d['update']({'lastMsgAt':_0x9918f[_0x827a('0x18')],'lastMsgDirection':_0x9918f[_0x827a('0xf')][_0x827a('0x10')]()});}})[_0x827a('0x19')](function(_0x287576){console[_0x827a('0x1a')](_0x287576);});}if(_0x9918f[_0x827a('0xf')]==='out'&&!_0x9918f[_0x827a('0x11')]){var _0x31b4a0;_0x46fcc5[_0x827a('0x1b')][_0x827a('0x1c')]({'where':{'id':_0x9918f[_0x827a('0x1d')]},'raw':!![]})[_0x827a('0x17')](function(_0xc1d3f0){_0x31b4a0=_0xc1d3f0;if(_0x31b4a0&&_0x31b4a0[_0x827a('0x1e')]){switch(_0x31b4a0['type']){case'twilio':var _0x1d5acd=require('twilio');if(_0x31b4a0[_0x827a('0x1f')]&&_0x31b4a0[_0x827a('0x20')]&&_0x31b4a0['phone']){var _0x3cb53a=new _0x1d5acd(_0x31b4a0[_0x827a('0x1f')],_0x31b4a0[_0x827a('0x20')]);_0x3cb53a[_0x827a('0x21')][_0x827a('0x22')]({'body':_0x9918f[_0x827a('0xc')],'to':_0x9918f[_0x827a('0x23')],'from':_0x31b4a0['phone'],'statusCallback':_0x31b4a0['remote']+'/api/sms/messages/'+_0x9918f['id']+_0x827a('0x24')+_0x31b4a0[_0x827a('0x25')]})['then'](function(_0x50f1f9){if(_0x50f1f9['sid']){return _0x3b6cf9[_0x827a('0x26')]({'messageId':_0x50f1f9[_0x827a('0x27')]});}})[_0x827a('0x19')](function(_0x1b43c5){logger[_0x827a('0x1a')](_0x827a('0x28'),'afterCreate','twilio',util['inspect'](_0x1b43c5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x2a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x827a('0x2b'):var _0x341b68=_0x827a('0x2c');if(_0x31b4a0[_0x827a('0x2d')]&&_0x31b4a0['password']){var _0x5930ae={'recipient':[_0x9918f[_0x827a('0x23')]],'message':_0x9918f[_0x827a('0xc')],'message_type':_0x31b4a0['smsMethod']};if(_0x31b4a0[_0x827a('0x2e')]&&_0x31b4a0[_0x827a('0x2e')]!=='SI'){_0x5930ae['sender']=_0x31b4a0[_0x827a('0x23')];}var _0x1c972e={'url':_0x341b68+_0x827a('0x2f')+_0x31b4a0[_0x827a('0x2d')]+_0x827a('0x30')+_0x31b4a0[_0x827a('0x31')],'method':_0x827a('0x32')};rp(_0x1c972e)[_0x827a('0x17')](function(_0x1c7179){var _0xd9e213=_0x1c7179[_0x827a('0x33')](';');var _0x319305={'user_key':_0xd9e213[0x0],'session_key':_0xd9e213[0x1]};_0x1c972e={'url':_0x341b68+_0x827a('0x34'),'method':'POST','headers':{'user_key':_0x319305[_0x827a('0x35')],'Session_key':_0x319305[_0x827a('0x36')]},'json':!![],'body':_0x5930ae};return rp(_0x1c972e);})[_0x827a('0x17')](function(_0x231d43){if(_0x231d43[_0x827a('0x37')]>=0x1){var _0x37b0f0={'messageId':_0x231d43[_0x827a('0x38')]};if(_0x31b4a0[_0x827a('0x2e')]!=='GP'||!_0x31b4a0[_0x827a('0x39')]){_0x37b0f0[_0x827a('0x3a')]=!![];}return _0x3b6cf9[_0x827a('0x26')](_0x37b0f0);}else{return logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'skebby',util[_0x827a('0x3b')](_0x231d43,{'showHidden':![],'depth':null}));}})['catch'](function(_0x395f57){return logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x2b'),util[_0x827a('0x3b')](_0x395f57,{'showHidden':![],'depth':null}));});}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'skebby',_0x827a('0x3c'));}break;case'connectel':if(_0x31b4a0[_0x827a('0x20')]){var _0x36d509={'recipient':_0x9918f[_0x827a('0x23')],'message':_0x9918f['body'],'sender':_0x31b4a0['senderString']||_0x31b4a0[_0x827a('0x23')],'authorization':_0x31b4a0['authToken']};var _0x1a76a6={'method':_0x827a('0x3d'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x36d509,'json':!![]};rp(_0x1a76a6)[_0x827a('0x17')](function(_0x3d2e52){var _0x2988dc={'messageId':_0x3d2e52[_0x827a('0x3e')]};if(!_0x31b4a0['deliveryReport']){_0x2988dc[_0x827a('0x3a')]=!![];}return _0x3b6cf9['update'](_0x2988dc);})[_0x827a('0x19')](function(_0x2cbbbe){logger[_0x827a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x827a('0x3f'),util['inspect'](_0x2cbbbe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x827a('0x28'),_0x827a('0x29'),'connectel',_0x827a('0x40'));}break;case _0x827a('0x41'):if(_0x31b4a0[_0x827a('0x2d')]&&_0x31b4a0[_0x827a('0x31')]){var _0x36d509={'messages':[{'source':_0x827a('0x42'),'to':_0x9918f[_0x827a('0x23')],'body':_0x9918f[_0x827a('0xc')],'from':_0x31b4a0[_0x827a('0x43')]||_0x31b4a0[_0x827a('0x23')]}]};var _0x2bf276=util['format'](_0x827a('0x44'),_0x31b4a0[_0x827a('0x2d')],_0x31b4a0['password']);var _0x1a76a6={'method':_0x827a('0x3d'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x36d509,'headers':{'Authorization':util['format'](_0x827a('0x45'),new Buffer(_0x2bf276)[_0x827a('0x46')](_0x827a('0x47')))},'json':!![]};rp(_0x1a76a6)[_0x827a('0x17')](function(_0x551364){if(_0x551364['http_code']>=0xc8&&_0x551364[_0x827a('0x48')]<=0xce){if(_0x551364[_0x827a('0x49')]&&_0x551364[_0x827a('0x49')][_0x827a('0x4a')]>0x0){var _0x384185=_['head'](_0x551364[_0x827a('0x49')][_0x827a('0x21')]);var _0x1ddbd2={'messageId':_0x384185['message_id']};if(!_0x31b4a0[_0x827a('0x39')]){_0x1ddbd2[_0x827a('0x3a')]=!![];}return _0x3b6cf9['update'](_0x1ddbd2);}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'clickSend',util['inspect'](_0x551364,{'showHidden':![],'depth':null}));}}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'clickSend',util[_0x827a('0x3b')](_0x551364,{'showHidden':![],'depth':null}));}})[_0x827a('0x19')](function(_0x5a2df8){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x827a('0x4b'),util['inspect'](_0x5a2df8,{'showHidden':![],'depth':null}));});}else{logger[_0x827a('0x1a')](_0x827a('0x28'),'afterCreate','clickSend',_0x827a('0x3c'));}break;case _0x827a('0x4c'):if(_0x31b4a0[_0x827a('0x4d')]&&_0x31b4a0[_0x827a('0x20')]){var _0x36d509={'dst':_0x9918f[_0x827a('0x23')],'text':_0x9918f[_0x827a('0xc')],'src':_0x31b4a0[_0x827a('0x43')]||_0x31b4a0['phone'],'url':_0x31b4a0[_0x827a('0x4e')]+_0x827a('0x4f')+_0x9918f['id']+_0x827a('0x24')+_0x31b4a0[_0x827a('0x25')]};var _0x2bf276=util[_0x827a('0x50')]('%s:%s',_0x31b4a0['authId'],_0x31b4a0['authToken']);var _0x1a76a6={'method':_0x827a('0x3d'),'uri':util[_0x827a('0x50')](_0x827a('0x51'),_0x31b4a0[_0x827a('0x4d')]),'body':_0x36d509,'headers':{'Authorization':util[_0x827a('0x50')](_0x827a('0x45'),new Buffer(_0x2bf276)[_0x827a('0x46')](_0x827a('0x47')))},'json':!![]};rp(_0x1a76a6)[_0x827a('0x17')](function(_0x5e39c6){var _0x3c15e9={'messageId':_0x5e39c6['message_uuid'][0x0]};return _0x3b6cf9[_0x827a('0x26')](_0x3c15e9);})['catch'](function(_0x22a21f){logger['error'](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x4c'),util[_0x827a('0x3b')](_0x22a21f,{'showHidden':![],'depth':null}));});}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x4c'),_0x827a('0x52'));}break;case'infobip':if(_0x31b4a0[_0x827a('0x2d')]&&_0x31b4a0[_0x827a('0x31')]){if(_0x31b4a0[_0x827a('0x53')]){var _0x5eb9bb={'method':'POST','uri':_0x31b4a0[_0x827a('0x53')]+'/auth/1/session','body':{'username':_0x31b4a0[_0x827a('0x2d')],'password':_0x31b4a0[_0x827a('0x31')]},'json':!![]};return rp(_0x5eb9bb)['then'](function(_0x203693){var _0x343fb4={'method':_0x827a('0x3d'),'uri':_0x31b4a0[_0x827a('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x31b4a0[_0x827a('0x23')],'destinations':[{'to':_0x9918f[_0x827a('0x23')]}],'text':_0x9918f[_0x827a('0xc')],'notifyUrl':_0x31b4a0[_0x827a('0x4e')]+'/api/sms/messages/'+_0x9918f['id']+_0x827a('0x24')+_0x31b4a0[_0x827a('0x25')],'notifyContentType':_0x827a('0x54'),'callbackData':_0x31b4a0[_0x827a('0x23')]+';'+_0x9918f[_0x827a('0xc')]}]},'headers':{'Authorization':_0x827a('0x55')+_0x203693[_0x827a('0x25')]},'json':!![]};return rp(_0x343fb4)['then'](function(_0x57fa9a){if(_0x57fa9a[_0x827a('0x21')]){var _0x26dc0c={'messageId':_0x57fa9a[_0x827a('0x21')][0x0][_0x827a('0xb')]};if(!_0x31b4a0[_0x827a('0x39')]){_0x26dc0c['read']=!![];}return _0x3b6cf9['update'](_0x26dc0c);}else{return logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'infobip',util[_0x827a('0x3b')](_0x57fa9a,{'showHidden':![],'depth':null}));}});})[_0x827a('0x19')](function(_0x359546){return logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x56'),util[_0x827a('0x3b')](_0x359546,{'showHidden':![],'depth':null}));});}else{logger[_0x827a('0x1a')](_0x827a('0x28'),'afterCreate',_0x827a('0x56'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x426da4=require('crypto');if(_0x31b4a0[_0x827a('0x57')]){var _0x535f29={};_0x535f29[_0x827a('0x58')]=_0x31b4a0[_0x827a('0x2d')];_0x535f29[_0x827a('0x23')]=_0x9918f[_0x827a('0x23')];_0x535f29['sender']=_0x31b4a0[_0x827a('0x23')];_0x535f29[_0x827a('0x59')]=_0x9918f[_0x827a('0xc')];_0x535f29[_0x827a('0x5a')]=+new Date();var _0x1d4037='';var _0x1206ea='';var _0x3a6f52=Object[_0x827a('0x5b')](_0x535f29);_0x3a6f52['sort']();for(var _0x296084=0x0;_0x296084<_0x3a6f52[_0x827a('0x5c')];_0x296084++){if(_0x1d4037!=''){_0x1d4037+='&';}_0x1d4037+=_0x3a6f52[_0x296084]+'='+encodeURIComponent(_0x535f29[_0x3a6f52[_0x296084]]);_0x1206ea+=_0x535f29[_0x3a6f52[_0x296084]];}_0x1206ea+=_0x31b4a0[_0x827a('0x57')];_0x1206ea=_0x426da4[_0x827a('0x5d')](_0x827a('0x5e'))[_0x827a('0x26')](_0x1206ea)[_0x827a('0x5f')](_0x827a('0x60'));if(_0x1d4037!==''){_0x1d4037+='&';}_0x1d4037+=_0x827a('0x61')+_0x1206ea;var _0x1c972e={'method':_0x827a('0x32'),'uri':_0x31b4a0['baseUrl']+_0x827a('0x62')+_0x1d4037,'json':!![]};return rp(_0x1c972e)['then'](function(_0xf1c357){var _0x3ab5ad=Object['keys'](_0xf1c357);if(_0xf1c357[_0x3ab5ad[0x0]]['error']&&parseInt(_0xf1c357[_0x3ab5ad[0x0]][_0x827a('0x1a')])===0x0){var _0x71866c={'messageId':_0xf1c357[_0x3ab5ad[0x0]]['id_sms']};if(!_0x31b4a0['deliveryReport']){_0x71866c[_0x827a('0x3a')]=!![];}return _0x3b6cf9[_0x827a('0x26')](_0x71866c);}else{return logger['error'](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x63'),util[_0x827a('0x3b')](_0xf1c357[_0x827a('0x1a')],{'showHidden':![],'depth':null}));}})[_0x827a('0x19')](function(_0x3bbade){return logger['error'](_0x827a('0x28'),_0x827a('0x29'),'csc',util[_0x827a('0x3b')](_0x3bbade,{'showHidden':![],'depth':null}));});}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x63'),_0x827a('0x64'));}break;case _0x827a('0x65'):if(_0x31b4a0['apiKey']){var _0x4fe0de={'method':_0x827a('0x3d'),'uri':_0x827a('0x66'),'headers':{'Authorization':_0x31b4a0['apiKey']},'body':{'content':_0x9918f[_0x827a('0xc')],'to':[_0x9918f['phone']],'from':_0x31b4a0[_0x827a('0x23')],'binary':![],'clientMessageId':_0x827a('0x67'),'charset':_0x827a('0x68')},'json':!![]};rp(_0x4fe0de)[_0x827a('0x17')](function(_0x283f77){if(!_0x283f77[_0x827a('0x1a')]){var _0x172d46={'messageId':_0x283f77[_0x827a('0x21')][0x0][_0x827a('0x69')]};if(!_0x31b4a0['deliveryReport']){_0x172d46[_0x827a('0x3a')]=!![];}return _0x3b6cf9[_0x827a('0x26')](_0x172d46);}else{return logger[_0x827a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x827a('0x65'),util[_0x827a('0x3b')](_0x283f77[_0x827a('0x1a')],{'showHidden':![],'depth':null}));}})[_0x827a('0x19')](function(_0x47991){return logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),'clickatell',util[_0x827a('0x3b')](_0x47991,{'showHidden':![],'depth':null}));});}else{logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x65'),_0x827a('0x64'));}break;case _0x827a('0x6a'):if(_0x31b4a0[_0x827a('0x2d')]&&_0x31b4a0[_0x827a('0x31')]){var _0x2bf276=util[_0x827a('0x50')](_0x827a('0x44'),_0x31b4a0[_0x827a('0x2d')],_0x31b4a0[_0x827a('0x31')]);var _0x1a76a6={'method':_0x827a('0x3d'),'uri':_0x827a('0x6b')+_0x31b4a0[_0x827a('0x6c')]+'/messages','body':{'to':[_0x9918f['phone']],'text':_0x9918f[_0x827a('0xc')],'from':_0x31b4a0[_0x827a('0x23')],'applicationId':_0x31b4a0[_0x827a('0x6d')]},'headers':{'Authorization':util[_0x827a('0x50')](_0x827a('0x45'),new Buffer(_0x2bf276)[_0x827a('0x46')](_0x827a('0x47')))},'json':!![]};rp(_0x1a76a6)[_0x827a('0x17')](function(_0x5bd621){if(_0x5bd621['id']){var _0x500194={'messageId':_0x5bd621['id']};return _0x3b6cf9[_0x827a('0x26')](_0x500194);}else{logger[_0x827a('0x1a')](_0x827a('0x28'),'afterCreate',_0x827a('0x6a'),util[_0x827a('0x3b')](_0x5bd621,{'showHidden':![],'depth':null}));}})[_0x827a('0x19')](function(_0x1678b0){logger[_0x827a('0x1a')](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x6a'),util[_0x827a('0x3b')](_0x1678b0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x6a'),_0x827a('0x3c'));}break;case'intelepeer':if(_0x31b4a0[_0x827a('0x57')]){var _0x102dd2={};var _0x1c972e={'method':_0x827a('0x3d'),'uri':_0x827a('0x6e'),'headers':{'Authorization':_0x827a('0x6f')+_0x31b4a0[_0x827a('0x57')],'Content-Type':_0x827a('0x54')},'body':{'from':_0x31b4a0['phone'],'to':_0x9918f[_0x827a('0x23')],'text':_0x9918f[_0x827a('0xc')]},'json':!![]};return rp(_0x1c972e)[_0x827a('0x17')](function(_0x430534){if(_0x430534[_0x827a('0x70')]==0xca){_0x102dd2[_0x827a('0x71')]=_0x430534;var _0x4ac749={'method':_0x827a('0x3d'),'uri':_0x827a('0x72'),'headers':{'Authorization':_0x827a('0x6f')+_0x31b4a0[_0x827a('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x102dd2[_0x827a('0x71')][_0x827a('0x73')]},'json':!![]};return rp(_0x4ac749)['then'](function(_0x3360eb){_0x102dd2['status']=_0x3360eb;var _0x5326e1={'messageId':_0x102dd2[_0x827a('0x71')][_0x827a('0x73')],'read':!![]};return _0x3b6cf9['update'](_0x5326e1);});}else{return logger['error'](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x74'),util[_0x827a('0x3b')](_0x430534,{'showHidden':![],'depth':null}));}})[_0x827a('0x19')](function(_0x3c6ec4){return logger[_0x827a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x827a('0x29'),_0x827a('0x74'),util['inspect'](_0x3c6ec4,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x827a('0x28'),_0x827a('0x29'),_0x827a('0x74'),_0x827a('0x75'));}break;}}})[_0x827a('0x76')](function(){_0xf70ae9();});}else{_0xf70ae9();}}},'charset':'utf8mb4','collate':_0x827a('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a10ac2f..0aaea5d 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 _0xb490=['redis','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSmsMessage','SmsMessage','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','socket.io-emitter'];(function(_0x41f6c6,_0x5db1bd){var _0xd74b17=function(_0x2c7837){while(--_0x2c7837){_0x41f6c6['push'](_0x41f6c6['shift']());}};_0xd74b17(++_0x5db1bd);}(_0xb490,0xfa));var _0x0b49=function(_0x1ca7f9,_0x27ca7c){_0x1ca7f9=_0x1ca7f9-0x0;var _0x1c0690=_0xb490[_0x1ca7f9];return _0x1c0690;};'use strict';var _=require(_0x0b49('0x0'));var util=require('util');var moment=require(_0x0b49('0x1'));var BPromise=require(_0x0b49('0x2'));var rs=require(_0x0b49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b49('0x4'))['db'];var utils=require(_0x0b49('0x5'));var logger=require('../../config/logger')(_0x0b49('0x6'));var config=require(_0x0b49('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b49('0x8')]['http']({'port':0x232a});config['redis']=_[_0x0b49('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0b49('0xa'))(new Redis(config[_0x0b49('0xb')]));require(_0x0b49('0xc'))[_0x0b49('0xd')](socket);function respondWithRpcPromise(_0x1f148f,_0x3f22a5,_0x47a31c){return new BPromise(function(_0x273f5a,_0x7b4a1a){return client[_0x0b49('0xe')](_0x1f148f,_0x47a31c)['then'](function(_0x152e50){logger[_0x0b49('0xf')](_0x0b49('0x10'),_0x3f22a5,'request\x20sent');logger[_0x0b49('0x11')](_0x0b49('0x12'),_0x3f22a5,_0x0b49('0x13'),JSON[_0x0b49('0x14')](_0x152e50));if(_0x152e50[_0x0b49('0x15')]){if(_0x152e50[_0x0b49('0x15')][_0x0b49('0x16')]===0x1f4){logger[_0x0b49('0x15')](_0x0b49('0x10'),_0x3f22a5,_0x152e50[_0x0b49('0x15')]['message']);return _0x7b4a1a(_0x152e50[_0x0b49('0x15')][_0x0b49('0x17')]);}logger['error'](_0x0b49('0x10'),_0x3f22a5,_0x152e50['error']['message']);return _0x273f5a(_0x152e50[_0x0b49('0x15')]['message']);}else{logger['info'](_0x0b49('0x10'),_0x3f22a5,_0x0b49('0x13'));_0x273f5a(_0x152e50['result']['message']);}})['catch'](function(_0xa6ab0b){logger[_0x0b49('0x15')]('SmsMessage,\x20%s,\x20%s',_0x3f22a5,_0xa6ab0b);_0x7b4a1a(_0xa6ab0b);});});}exports[_0x0b49('0x18')]=function(_0x605f4e){var _0x2f02dc=this;return new Promise(function(_0x52df40,_0x45e136){return db[_0x0b49('0x19')]['create'](_0x605f4e[_0x0b49('0x1a')],{'raw':_0x605f4e[_0x0b49('0x1b')]?_0x605f4e[_0x0b49('0x1b')][_0x0b49('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x65ceda){logger[_0x0b49('0xf')](_0x0b49('0x18'),_0x605f4e);logger[_0x0b49('0x11')](_0x0b49('0x18'),_0x605f4e,JSON['stringify'](_0x65ceda));_0x52df40(_0x65ceda);})['catch'](function(_0x5bf3ad){logger[_0x0b49('0x15')](_0x0b49('0x18'),_0x5bf3ad[_0x0b49('0x17')],_0x605f4e);_0x45e136(_0x2f02dc[_0x0b49('0x15')](0x1f4,_0x5bf3ad[_0x0b49('0x17')]));});});}; \ No newline at end of file +var _0x8f9d=['then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x100688,_0x1b8750){var _0x943c2d=function(_0x2206f5){while(--_0x2206f5){_0x100688['push'](_0x100688['shift']());}};_0x943c2d(++_0x1b8750);}(_0x8f9d,0x70));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd8f9('0x0'));var util=require(_0xd8f9('0x1'));var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8f9('0x4'));var db=require(_0xd8f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8f9('0x6'))(_0xd8f9('0x7'));var config=require('../../config/environment');var jayson=require(_0xd8f9('0x8'));var client=jayson[_0xd8f9('0x9')][_0xd8f9('0xa')]({'port':0x232a});config[_0xd8f9('0xb')]=_[_0xd8f9('0xc')](config[_0xd8f9('0xb')],{'host':_0xd8f9('0xd'),'port':0x18eb});var socket=require(_0xd8f9('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd8f9('0xf')](socket);function respondWithRpcPromise(_0x2e0d72,_0xd7662b,_0x3e6dc0){return new BPromise(function(_0x260840,_0x22a744){return client['request'](_0x2e0d72,_0x3e6dc0)[_0xd8f9('0x10')](function(_0x5b972c){logger['info'](_0xd8f9('0x11'),_0xd7662b,_0xd8f9('0x12'));logger[_0xd8f9('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd7662b,'request\x20sent',JSON[_0xd8f9('0x14')](_0x5b972c));if(_0x5b972c[_0xd8f9('0x15')]){if(_0x5b972c['error'][_0xd8f9('0x16')]===0x1f4){logger['error'](_0xd8f9('0x11'),_0xd7662b,_0x5b972c[_0xd8f9('0x15')][_0xd8f9('0x17')]);return _0x22a744(_0x5b972c['error']['message']);}logger[_0xd8f9('0x15')](_0xd8f9('0x11'),_0xd7662b,_0x5b972c[_0xd8f9('0x15')][_0xd8f9('0x17')]);return _0x260840(_0x5b972c[_0xd8f9('0x15')][_0xd8f9('0x17')]);}else{logger[_0xd8f9('0x18')](_0xd8f9('0x11'),_0xd7662b,_0xd8f9('0x12'));_0x260840(_0x5b972c['result']['message']);}})[_0xd8f9('0x19')](function(_0x200319){logger[_0xd8f9('0x15')]('SmsMessage,\x20%s,\x20%s',_0xd7662b,_0x200319);_0x22a744(_0x200319);});});}exports[_0xd8f9('0x1a')]=function(_0x5dad9b){var _0x48881b=this;return new Promise(function(_0x23aa6f,_0x5a9476){return db[_0xd8f9('0x1b')][_0xd8f9('0x1c')](_0x5dad9b[_0xd8f9('0x1d')],{'raw':_0x5dad9b[_0xd8f9('0x1e')]?_0x5dad9b[_0xd8f9('0x1e')][_0xd8f9('0x1f')]===undefined?!![]:![]:!![]})[_0xd8f9('0x10')](function(_0x5abb72){logger[_0xd8f9('0x18')](_0xd8f9('0x1a'),_0x5dad9b);logger[_0xd8f9('0x13')](_0xd8f9('0x1a'),_0x5dad9b,JSON[_0xd8f9('0x14')](_0x5abb72));_0x23aa6f(_0x5abb72);})['catch'](function(_0x424d1d){logger['error'](_0xd8f9('0x1a'),_0x424d1d[_0xd8f9('0x17')],_0x5dad9b);_0x5a9476(_0x48881b[_0xd8f9('0x15')](0x1f4,_0x424d1d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 14a8138..ce66eb5 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 _0x5e9d=['removeListener','register','length','./smsMessage.events','update','emit'];(function(_0x353d05,_0x5f32a7){var _0x1653b9=function(_0x45d301){while(--_0x45d301){_0x353d05['push'](_0x353d05['shift']());}};_0x1653b9(++_0x5f32a7);}(_0x5e9d,0xc3));var _0xd5e9=function(_0x3109c5,_0x3eacdf){_0x3109c5=_0x3109c5-0x0;var _0x573be7=_0x5e9d[_0x3109c5];return _0x573be7;};'use strict';var SmsMessageEvents=require(_0xd5e9('0x0'));var events=['save','remove',_0xd5e9('0x1')];function createListener(_0x3594d3,_0x4e12a9){return function(_0x13a896){_0x4e12a9[_0xd5e9('0x2')](_0x3594d3,_0x13a896);};}function removeListener(_0x54e815,_0x47c9bf){return function(){SmsMessageEvents[_0xd5e9('0x3')](_0x54e815,_0x47c9bf);};}exports[_0xd5e9('0x4')]=function(_0x5d7ee4){for(var _0x1bb273=0x0,_0x457cf9=events[_0xd5e9('0x5')];_0x1bb273<_0x457cf9;_0x1bb273++){var _0x1247cc=events[_0x1bb273];var _0x3c8148=createListener('smsMessage:'+_0x1247cc,_0x5d7ee4);SmsMessageEvents['on'](_0x1247cc,_0x3c8148);}}; \ No newline at end of file +var _0x7212=['update','emit','removeListener','smsMessage:','save','remove'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x7212,0x160));var _0x2721=function(_0x3173c0,_0x5d4d5d){_0x3173c0=_0x3173c0-0x0;var _0x3d6402=_0x7212[_0x3173c0];return _0x3d6402;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x2721('0x0'),_0x2721('0x1'),_0x2721('0x2')];function createListener(_0x2b8fcd,_0x41b314){return function(_0x342a06){_0x41b314[_0x2721('0x3')](_0x2b8fcd,_0x342a06);};}function removeListener(_0x4a2d1c,_0x461022){return function(){SmsMessageEvents[_0x2721('0x4')](_0x4a2d1c,_0x461022);};}exports['register']=function(_0x2781be){for(var _0x3b7022=0x0,_0x21131d=events['length'];_0x3b7022<_0x21131d;_0x3b7022++){var _0x43ce6d=events[_0x3b7022];var _0x3ef21d=createListener(_0x2721('0x5')+_0x43ce6d,_0x2781be);SmsMessageEvents['on'](_0x43ce6d,_0x3ef21d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 047e827..7f2f2f4 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 _0x8f3b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x504116,_0x4c6be9){var _0x25d3fe=function(_0x1f44a3){while(--_0x1f44a3){_0x504116['push'](_0x504116['shift']());}};_0x25d3fe(++_0x4c6be9);}(_0x8f3b,0x95));var _0xb8f3=function(_0x1c7cb1,_0x1b0116){_0x1c7cb1=_0x1c7cb1-0x0;var _0x4d4e4c=_0x8f3b[_0x1c7cb1];return _0x4d4e4c;};'use strict';var multer=require(_0xb8f3('0x0'));var util=require('util');var path=require(_0xb8f3('0x1'));var timeout=require('connect-timeout');var express=require(_0xb8f3('0x2'));var router=express[_0xb8f3('0x3')]();var fs_extra=require(_0xb8f3('0x4'));var auth=require(_0xb8f3('0x5'));var interaction=require(_0xb8f3('0x6'));var config=require(_0xb8f3('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0xb8f3('0x8')](),controller['index']);router[_0xb8f3('0x9')](_0xb8f3('0xa'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0xb')]);router[_0xb8f3('0x9')](_0xb8f3('0xc'),auth[_0xb8f3('0x8')](),controller['show']);router[_0xb8f3('0x9')](_0xb8f3('0xd'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0xe')]);router[_0xb8f3('0x9')]('/:id/teams',auth[_0xb8f3('0x8')](),controller[_0xb8f3('0xf')]);router[_0xb8f3('0x9')](_0xb8f3('0x10'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x11')]);router['post']('/',auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x12')]);router[_0xb8f3('0x13')](_0xb8f3('0x14'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x15')]);router[_0xb8f3('0x13')](_0xb8f3('0x10'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x16')]);router[_0xb8f3('0x17')]('/:id',auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x18')]);router[_0xb8f3('0x19')]('/:id',auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x1a')]);router['delete'](_0xb8f3('0x14'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x1b')]);router[_0xb8f3('0x19')](_0xb8f3('0x10'),auth[_0xb8f3('0x8')](),controller[_0xb8f3('0x1c')]);module[_0xb8f3('0x1d')]=router; \ No newline at end of file +var _0xa975=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','/:id','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa975,0x13a));var _0x5a97=function(_0x144da7,_0xad1e22){_0x144da7=_0x144da7-0x0;var _0x3dcfdd=_0xa975[_0x144da7];return _0x3dcfdd;};'use strict';var multer=require(_0x5a97('0x0'));var util=require(_0x5a97('0x1'));var path=require(_0x5a97('0x2'));var timeout=require(_0x5a97('0x3'));var express=require(_0x5a97('0x4'));var router=express[_0x5a97('0x5')]();var fs_extra=require(_0x5a97('0x6'));var auth=require(_0x5a97('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5a97('0x8'));var controller=require(_0x5a97('0x9'));router[_0x5a97('0xa')]('/',auth[_0x5a97('0xb')](),controller[_0x5a97('0xc')]);router[_0x5a97('0xa')](_0x5a97('0xd'),auth[_0x5a97('0xb')](),controller[_0x5a97('0xe')]);router[_0x5a97('0xa')]('/:id',auth[_0x5a97('0xb')](),controller[_0x5a97('0xf')]);router[_0x5a97('0xa')](_0x5a97('0x10'),auth[_0x5a97('0xb')](),controller[_0x5a97('0x11')]);router[_0x5a97('0xa')](_0x5a97('0x12'),auth[_0x5a97('0xb')](),controller[_0x5a97('0x13')]);router[_0x5a97('0xa')](_0x5a97('0x14'),auth[_0x5a97('0xb')](),controller['getAgents']);router[_0x5a97('0x15')]('/',auth[_0x5a97('0xb')](),controller['create']);router[_0x5a97('0x15')]('/:id/teams',auth[_0x5a97('0xb')](),controller[_0x5a97('0x16')]);router[_0x5a97('0x15')]('/:id/users',auth[_0x5a97('0xb')](),controller[_0x5a97('0x17')]);router['put'](_0x5a97('0x18'),auth[_0x5a97('0xb')](),controller[_0x5a97('0x19')]);router[_0x5a97('0x1a')](_0x5a97('0x18'),auth[_0x5a97('0xb')](),controller['destroy']);router[_0x5a97('0x1a')](_0x5a97('0x12'),auth[_0x5a97('0xb')](),controller[_0x5a97('0x1b')]);router['delete'](_0x5a97('0x14'),auth[_0x5a97('0xb')](),controller[_0x5a97('0x1c')]);module[_0x5a97('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index eaa5a5a..7fd0a4a 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 _0xc27d=['name','INTEGER','ENUM','rrmemory','exports','STRING'];(function(_0x1c5c51,_0x524f75){var _0x394162=function(_0x2c9344){while(--_0x2c9344){_0x1c5c51['push'](_0x1c5c51['shift']());}};_0x394162(++_0x524f75);}(_0xc27d,0x166));var _0xdc27=function(_0x1c486b,_0x1b36f8){_0x1c486b=_0x1c486b-0x0;var _0x55fa00=_0xc27d[_0x1c486b];return _0x55fa00;};'use strict';var Sequelize=require('sequelize');module[_0xdc27('0x0')]={'name':{'type':Sequelize[_0xdc27('0x1')],'unique':_0xdc27('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdc27('0x1')]},'timeout':{'type':Sequelize[_0xdc27('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc27('0x4')](_0xdc27('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x830d=['beepall','roundrobin','sequelize','exports','INTEGER','rrmemory'];(function(_0x2c7e12,_0x1cea74){var _0x16bffa=function(_0x473692){while(--_0x473692){_0x2c7e12['push'](_0x2c7e12['shift']());}};_0x16bffa(++_0x1cea74);}(_0x830d,0x134));var _0xd830=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x830d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd830('0x0'));module[_0xd830('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd830('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd830('0x3'),_0xd830('0x4'),_0xd830('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 016321d..3b2e408 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 _0x6302=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','error','name','index','SmsQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','map','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','User','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','Agents','voicePause','interface','flatMap','sequelize','addTeams','findOrCreate','forEach','emit','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv'];(function(_0x36b04a,_0x5087a1){var _0x111bbe=function(_0x48421e){while(--_0x48421e){_0x36b04a['push'](_0x36b04a['shift']());}};_0x111bbe(++_0x5087a1);}(_0x6302,0x109));var _0x2630=function(_0x1dbb4c,_0x31cc52){_0x1dbb4c=_0x1dbb4c-0x0;var _0x445e7d=_0x6302[_0x1dbb4c];return _0x445e7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2630('0x0'));var zipdir=require(_0x2630('0x1'));var jsonpatch=require(_0x2630('0x2'));var rp=require(_0x2630('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2630('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2630('0x5'));var csv=require(_0x2630('0x6'));var ejs=require(_0x2630('0x7'));var fs=require('fs');var fs_extra=require(_0x2630('0x8'));var _=require(_0x2630('0x9'));var squel=require(_0x2630('0xa'));var crypto=require(_0x2630('0xb'));var jsforce=require(_0x2630('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2630('0xd'));var Papa=require(_0x2630('0xe'));var Redis=require('ioredis');var authService=require(_0x2630('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2630('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2630('0x11'))(_0x2630('0x12'));var utils=require(_0x2630('0x13'));var config=require(_0x2630('0x14'));var licenseUtil=require(_0x2630('0x15'));var db=require(_0x2630('0x16'))['db'];config['redis']=_[_0x2630('0x17')](config[_0x2630('0x18')],{'host':_0x2630('0x19'),'port':0x18eb});var socket=require(_0x2630('0x1a'))(new Redis(config['redis']));require(_0x2630('0x1b'))[_0x2630('0x1c')](socket);function respondWithStatusCode(_0x23179e,_0x4dc77f){_0x4dc77f=_0x4dc77f||0xcc;return function(_0x15ada2){if(_0x15ada2){return _0x23179e['sendStatus'](_0x4dc77f);}return _0x23179e[_0x2630('0x1d')](_0x4dc77f)[_0x2630('0x1e')]();};}function respondWithResult(_0x3b1b78,_0x249507){_0x249507=_0x249507||0xc8;return function(_0x157d35){if(_0x157d35){return _0x3b1b78[_0x2630('0x1d')](_0x249507)[_0x2630('0x1f')](_0x157d35);}};}function respondWithFilteredResult(_0x2c7855,_0x528b3a){return function(_0x427b3c){if(_0x427b3c){var _0x4fc0bb=typeof _0x528b3a['offset']==='undefined'&&typeof _0x528b3a[_0x2630('0x20')]===_0x2630('0x21');var _0x1fd31c=_0x427b3c[_0x2630('0x22')];var _0x1c292c=_0x4fc0bb?0x0:_0x528b3a[_0x2630('0x23')];var _0x4364a0=_0x4fc0bb?_0x427b3c[_0x2630('0x22')]:_0x528b3a[_0x2630('0x23')]+_0x528b3a[_0x2630('0x20')];var _0x713af1;if(_0x4364a0>=_0x1fd31c){_0x4364a0=_0x1fd31c;_0x713af1=0xc8;}else{_0x713af1=0xce;}_0x2c7855[_0x2630('0x1d')](_0x713af1);return _0x2c7855['set']('Content-Range',_0x1c292c+'-'+_0x4364a0+'/'+_0x1fd31c)[_0x2630('0x1f')](_0x427b3c);}return null;};}function patchUpdates(_0x42f98a){return function(_0x4f7617){try{jsonpatch[_0x2630('0x24')](_0x4f7617,_0x42f98a,!![]);}catch(_0x5c67b7){return BPromise[_0x2630('0x25')](_0x5c67b7);}return _0x4f7617[_0x2630('0x26')]();};}function saveUpdates(_0xafc7c6,_0x22a617){return function(_0x57f7e6){if(_0x57f7e6){return _0x57f7e6[_0x2630('0x27')](_0xafc7c6)[_0x2630('0x28')](function(_0x126ec3){return _0x126ec3;});}return null;};}function removeEntity(_0x81ced7,_0x3468dc){return function(_0x161248){if(_0x161248){return _0x161248[_0x2630('0x29')]()[_0x2630('0x28')](function(){var _0x4acf70=_0x161248['get']({'plain':!![]});var _0x1e57d6=_0x2630('0x2a');return db[_0x2630('0x2b')]['destroy']({'where':{'type':_0x1e57d6,'resourceId':_0x4acf70['id']}})[_0x2630('0x28')](function(){return _0x161248;});})[_0x2630('0x28')](function(){_0x81ced7[_0x2630('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad356,_0x4ad461){return function(_0x336226){if(!_0x336226){_0x3ad356['sendStatus'](0x194);}return _0x336226;};}function handleError(_0xfc6064,_0x176f1b){_0x176f1b=_0x176f1b||0x1f4;return function(_0x560dd8){logger[_0x2630('0x2c')](_0x560dd8['stack']);if(_0x560dd8['name']){delete _0x560dd8[_0x2630('0x2d')];}_0xfc6064[_0x2630('0x1d')](_0x176f1b)['send'](_0x560dd8);};}exports[_0x2630('0x2e')]=function(_0x19d2fc,_0x37e326){var _0x2ee2b6={},_0x2abe44={},_0x355fe7={'count':0x0,'rows':[]};var _0x357035=_['map'](db[_0x2630('0x2f')][_0x2630('0x30')],function(_0x50b882){return{'name':_0x50b882[_0x2630('0x31')],'type':_0x50b882['type'][_0x2630('0x32')]};});_0x2abe44['model']=_['map'](_0x357035,_0x2630('0x2d'));_0x2abe44[_0x2630('0x33')]=_[_0x2630('0x34')](_0x19d2fc['query']);_0x2abe44[_0x2630('0x35')]=_[_0x2630('0x36')](_0x2abe44['model'],_0x2abe44[_0x2630('0x33')]);_0x2ee2b6[_0x2630('0x37')]=_['intersection'](_0x2abe44[_0x2630('0x38')],qs['fields'](_0x19d2fc[_0x2630('0x33')][_0x2630('0x39')]));_0x2ee2b6['attributes']=_0x2ee2b6[_0x2630('0x37')][_0x2630('0x3a')]?_0x2ee2b6['attributes']:_0x2abe44[_0x2630('0x38')];if(!_0x19d2fc[_0x2630('0x33')][_0x2630('0x3b')](_0x2630('0x3c'))){_0x2ee2b6[_0x2630('0x20')]=qs[_0x2630('0x20')](_0x19d2fc[_0x2630('0x33')][_0x2630('0x20')]);_0x2ee2b6[_0x2630('0x23')]=qs['offset'](_0x19d2fc[_0x2630('0x33')]['offset']);}_0x2ee2b6[_0x2630('0x3d')]=qs[_0x2630('0x3e')](_0x19d2fc[_0x2630('0x33')][_0x2630('0x3e')]);_0x2ee2b6[_0x2630('0x3f')]=qs[_0x2630('0x35')](_['pick'](_0x19d2fc[_0x2630('0x33')],_0x2abe44[_0x2630('0x35')]),_0x357035);if(_0x19d2fc['query']['filter']){_0x2ee2b6[_0x2630('0x3f')]=_['merge'](_0x2ee2b6[_0x2630('0x3f')],{'$or':_[_0x2630('0x40')](_0x357035,function(_0x717a14){if(_0x717a14['type']!==_0x2630('0x41')){var _0x26d88e={};_0x26d88e[_0x717a14['name']]={'$like':'%'+_0x19d2fc['query'][_0x2630('0x42')]+'%'};return _0x26d88e;}})});}_0x2ee2b6=_[_0x2630('0x43')]({},_0x2ee2b6,_0x19d2fc[_0x2630('0x44')]);var _0x527300={'where':_0x2ee2b6['where']};return db[_0x2630('0x2f')][_0x2630('0x22')](_0x527300)[_0x2630('0x28')](function(_0x45f5b0){_0x355fe7[_0x2630('0x22')]=_0x45f5b0;if(_0x19d2fc[_0x2630('0x33')][_0x2630('0x45')]){_0x2ee2b6['include']=[{'all':!![]}];}return db[_0x2630('0x2f')][_0x2630('0x46')](_0x2ee2b6);})[_0x2630('0x28')](function(_0x916fc1){_0x355fe7[_0x2630('0x47')]=_0x916fc1;return _0x355fe7;})[_0x2630('0x28')](respondWithFilteredResult(_0x37e326,_0x2ee2b6))[_0x2630('0x48')](handleError(_0x37e326,null));};exports[_0x2630('0x49')]=function(_0x50fd57,_0x55688c){var _0x1bf379={'raw':!![],'where':{'id':_0x50fd57[_0x2630('0x4a')]['id']}},_0x1683b6={};_0x1683b6[_0x2630('0x38')]=_[_0x2630('0x34')](db['SmsQueue'][_0x2630('0x30')]);_0x1683b6['query']=_[_0x2630('0x34')](_0x50fd57['query']);_0x1683b6[_0x2630('0x35')]=_[_0x2630('0x36')](_0x1683b6[_0x2630('0x38')],_0x1683b6[_0x2630('0x33')]);_0x1bf379[_0x2630('0x37')]=_[_0x2630('0x36')](_0x1683b6[_0x2630('0x38')],qs[_0x2630('0x39')](_0x50fd57['query'][_0x2630('0x39')]));_0x1bf379[_0x2630('0x37')]=_0x1bf379[_0x2630('0x37')][_0x2630('0x3a')]?_0x1bf379['attributes']:_0x1683b6[_0x2630('0x38')];if(_0x50fd57[_0x2630('0x33')]['includeAll']){_0x1bf379['include']=[{'all':!![]}];}_0x1bf379=_[_0x2630('0x43')]({},_0x1bf379,_0x50fd57[_0x2630('0x44')]);return db['SmsQueue'][_0x2630('0x4b')](_0x1bf379)[_0x2630('0x28')](handleEntityNotFound(_0x55688c,null))[_0x2630('0x28')](respondWithResult(_0x55688c,null))['catch'](handleError(_0x55688c,null));};exports[_0x2630('0x4c')]=function(_0x643e1d,_0x4dcbd0){return db['SmsQueue']['create'](_0x643e1d[_0x2630('0x4d')],{})[_0x2630('0x28')](function(_0x524ebd){var _0x5b0bad=_0x643e1d[_0x2630('0x4e')]['get']({'plain':!![]});if(!_0x5b0bad)throw new Error(_0x2630('0x4f'));if(_0x5b0bad[_0x2630('0x50')]===_0x2630('0x4e')){var _0x13ebb7=_0x524ebd[_0x2630('0x51')]({'plain':!![]});var _0x24c41b=_0x2630('0x2a');return db[_0x2630('0x52')][_0x2630('0x4b')]({'where':{'name':_0x24c41b,'userProfileId':_0x5b0bad[_0x2630('0x53')]},'raw':!![]})[_0x2630('0x28')](function(_0x49dcac){if(_0x49dcac&&_0x49dcac['autoAssociation']===0x0){return db[_0x2630('0x2b')][_0x2630('0x4c')]({'name':_0x13ebb7['name'],'resourceId':_0x13ebb7['id'],'type':_0x49dcac[_0x2630('0x2d')],'sectionId':_0x49dcac['id']},{})[_0x2630('0x28')](function(){return _0x524ebd;});}else{return _0x524ebd;}})[_0x2630('0x48')](function(_0xbfc6ee){logger[_0x2630('0x2c')](_0x2630('0x54'),_0xbfc6ee);throw _0xbfc6ee;});}return _0x524ebd;})['then'](respondWithResult(_0x4dcbd0,0xc9))[_0x2630('0x48')](handleError(_0x4dcbd0,null));};exports['update']=function(_0x5cb234,_0x5aa6b7){if(_0x5cb234['body']['id']){delete _0x5cb234[_0x2630('0x4d')]['id'];}return db[_0x2630('0x2f')]['find']({'where':{'id':_0x5cb234[_0x2630('0x4a')]['id']}})[_0x2630('0x28')](handleEntityNotFound(_0x5aa6b7,null))[_0x2630('0x28')](saveUpdates(_0x5cb234[_0x2630('0x4d')],null))[_0x2630('0x28')](respondWithResult(_0x5aa6b7,null))[_0x2630('0x48')](handleError(_0x5aa6b7,null));};exports[_0x2630('0x29')]=function(_0x410c34,_0x1ad4e9){return db[_0x2630('0x2f')][_0x2630('0x4b')]({'where':{'id':_0x410c34['params']['id']}})[_0x2630('0x28')](handleEntityNotFound(_0x1ad4e9,null))[_0x2630('0x28')](removeEntity(_0x1ad4e9,null))[_0x2630('0x48')](handleError(_0x1ad4e9,null));};exports[_0x2630('0x55')]=function(_0x39271d,_0x307612){return db[_0x2630('0x2f')]['describe']()[_0x2630('0x28')](respondWithResult(_0x307612,null))[_0x2630('0x48')](handleError(_0x307612,null));};exports[_0x2630('0x56')]=function(_0x51583e,_0x2b527a,_0x11f8f4){var _0x244a91={'raw':!![],'where':{}},_0x44b364={},_0x275c76;return db[_0x2630('0x2f')][_0x2630('0x57')]({'where':{'id':_0x51583e['params']['id']}})[_0x2630('0x28')](handleEntityNotFound(_0x2b527a,null))[_0x2630('0x28')](function(_0x2b06e9){if(_0x2b06e9){_0x275c76=_0x2b06e9[_0x2630('0x51')]({'plain':!![]});_0x44b364[_0x2630('0x38')]=_['keys'](db[_0x2630('0x58')][_0x2630('0x30')]);_0x44b364[_0x2630('0x33')]=_[_0x2630('0x34')](_0x51583e[_0x2630('0x33')]);_0x44b364[_0x2630('0x35')]=_['intersection'](_0x44b364[_0x2630('0x38')],_0x44b364[_0x2630('0x33')]);_0x244a91['attributes']=_[_0x2630('0x36')](_0x44b364[_0x2630('0x38')],qs[_0x2630('0x39')](_0x51583e[_0x2630('0x33')][_0x2630('0x39')]));_0x244a91[_0x2630('0x37')]=_0x244a91[_0x2630('0x37')][_0x2630('0x3a')]?_0x244a91[_0x2630('0x37')]:_0x44b364['model'];if(!_0x51583e[_0x2630('0x33')][_0x2630('0x3b')](_0x2630('0x3c'))){_0x244a91[_0x2630('0x20')]=qs['limit'](_0x51583e[_0x2630('0x33')][_0x2630('0x20')]);_0x244a91[_0x2630('0x23')]=qs['offset'](_0x51583e[_0x2630('0x33')][_0x2630('0x23')]);}_0x244a91[_0x2630('0x3d')]=qs[_0x2630('0x3e')](_0x51583e['query'][_0x2630('0x3e')]);_0x244a91[_0x2630('0x3f')]=qs[_0x2630('0x35')](_[_0x2630('0x59')](_0x51583e['query'],_0x44b364[_0x2630('0x35')]));_0x244a91[_0x2630('0x3f')][_0x2630('0x5a')]=_0x2b06e9['id'];if(_0x51583e[_0x2630('0x33')]['filter']){_0x244a91[_0x2630('0x3f')]=_[_0x2630('0x43')](_0x244a91[_0x2630('0x3f')],{'$or':_[_0x2630('0x40')](_0x244a91[_0x2630('0x37')],function(_0x19a32c){var _0x4f3ba4={};_0x4f3ba4[_0x19a32c]={'$like':'%'+_0x51583e['query'][_0x2630('0x42')]+'%'};return _0x4f3ba4;})});}_0x244a91=_[_0x2630('0x43')]({},_0x244a91,_0x51583e[_0x2630('0x44')]);return db[_0x2630('0x58')]['findAll'](_0x244a91);}})[_0x2630('0x28')](function(_0x1f6ff0){if(_0x1f6ff0){return db[_0x2630('0x5b')]['findAndCountAll']({'where':{'id':_[_0x2630('0x40')](_0x1f6ff0,_0x2630('0x5c')),'role':'agent'},'attributes':['id','name',_0x2630('0x5d'),_0x2630('0x5e'),_0x2630('0x5f')]});}})['then'](function(_0x2f484f){if(_0x2f484f){return{'count':_0x2f484f[_0x2630('0x22')],'rows':_[_0x2630('0x40')](_0x2f484f[_0x2630('0x47')],function(_0x535c23){return{'membername':_0x535c23[_0x2630('0x2d')],'UserId':_0x535c23['id'],'queue_name':_0x275c76[_0x2630('0x2d')],'SmsQueueId':_0x275c76['id'],'interface':util[_0x2630('0x60')](_0x2630('0x61'),_0x2630('0x62'),_0x535c23[_0x2630('0x2d')]),'penalty':0x0,'paused':_0x535c23[_0x2630('0x5d')],'createdAt':_0x535c23[_0x2630('0x5f')],'updatedAt':_0x535c23[_0x2630('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2630('0x28')](respondWithFilteredResult(_0x2b527a,_0x244a91))[_0x2630('0x48')](handleError(_0x2b527a,null));};exports[_0x2630('0x63')]=function(_0x2cb904,_0x73f155,_0x10b200){var _0x2c004d={};var _0x523e70={};var _0x2dd699;var _0x8b8955;return db['SmsQueue'][_0x2630('0x57')]({'where':{'id':_0x2cb904[_0x2630('0x4a')]['id']}})[_0x2630('0x28')](handleEntityNotFound(_0x73f155,null))[_0x2630('0x28')](function(_0x5b90ad){if(_0x5b90ad){_0x2dd699=_0x5b90ad;_0x523e70['model']=_[_0x2630('0x34')](db[_0x2630('0x64')]['rawAttributes']);_0x523e70['query']=_[_0x2630('0x34')](_0x2cb904['query']);_0x523e70['filters']=_[_0x2630('0x36')](_0x523e70[_0x2630('0x38')],_0x523e70[_0x2630('0x33')]);_0x2c004d[_0x2630('0x37')]=_[_0x2630('0x36')](_0x523e70[_0x2630('0x38')],qs['fields'](_0x2cb904[_0x2630('0x33')][_0x2630('0x39')]));_0x2c004d['attributes']=_0x2c004d[_0x2630('0x37')][_0x2630('0x3a')]?_0x2c004d['attributes']:_0x523e70[_0x2630('0x38')];_0x2c004d[_0x2630('0x3d')]=qs['sort'](_0x2cb904['query'][_0x2630('0x3e')]);_0x2c004d[_0x2630('0x3f')]=qs['filters'](_[_0x2630('0x59')](_0x2cb904[_0x2630('0x33')],_0x523e70['filters']));if(_0x2cb904[_0x2630('0x33')][_0x2630('0x42')]){_0x2c004d[_0x2630('0x3f')]=_[_0x2630('0x43')](_0x2c004d[_0x2630('0x3f')],{'$or':_[_0x2630('0x40')](_0x2c004d[_0x2630('0x37')],function(_0x1b5a06){var _0x54f5d5={};_0x54f5d5[_0x1b5a06]={'$like':'%'+_0x2cb904[_0x2630('0x33')][_0x2630('0x42')]+'%'};return _0x54f5d5;})});}_0x2c004d=_[_0x2630('0x43')]({},_0x2c004d,_0x2cb904[_0x2630('0x44')]);return _0x2dd699[_0x2630('0x63')](_0x2c004d);}})['then'](function(_0x2b2c38){if(_0x2b2c38){_0x8b8955=_0x2b2c38[_0x2630('0x3a')];if(!_0x2cb904[_0x2630('0x33')][_0x2630('0x3b')](_0x2630('0x3c'))){_0x2c004d[_0x2630('0x20')]=qs['limit'](_0x2cb904[_0x2630('0x33')][_0x2630('0x20')]);_0x2c004d[_0x2630('0x23')]=qs[_0x2630('0x23')](_0x2cb904[_0x2630('0x33')][_0x2630('0x23')]);}return _0x2dd699[_0x2630('0x63')](_0x2c004d);}})[_0x2630('0x28')](function(_0x3746e2){if(_0x3746e2){return _0x3746e2?{'count':_0x8b8955,'rows':_0x3746e2}:null;}})[_0x2630('0x28')](respondWithResult(_0x73f155,null))[_0x2630('0x48')](handleError(_0x73f155,null));};exports['addTeams']=function(_0x286a2d,_0x32afb8,_0x2f8aae){var _0x59c418=_0x286a2d[_0x2630('0x4d')]['ids'];return db['Team']['findAll']({'where':{'id':_0x59c418},'attributes':['id'],'include':[{'model':db[_0x2630('0x5b')],'as':_0x2630('0x65'),'attributes':['id','name','online',_0x2630('0x66'),_0x2630('0x67')],'raw':!![]}]})[_0x2630('0x28')](function(_0xbd76c4){if(_0xbd76c4){var _0x3f4f64=_[_0x2630('0x68')](_0xbd76c4,function(_0x2950c7){var _0x4523cb=_0x2950c7[_0x2630('0x51')]({'plain':!![]});return _0x4523cb[_0x2630('0x65')];});return db[_0x2630('0x2f')]['find']({'where':{'id':_0x286a2d[_0x2630('0x4a')]['id']}})[_0x2630('0x28')](function(_0x4fa360){return db[_0x2630('0x69')]['transaction'](function(_0x4223d8){return _0x4fa360[_0x2630('0x6a')](_0x59c418,{'transaction':_0x4223d8})['then'](function(){return BPromise['each'](_0x3f4f64,function(_0x152741){return db[_0x2630('0x58')][_0x2630('0x6b')]({'where':{'UserId':_0x152741['id'],'SmsQueueId':_0x286a2d[_0x2630('0x4a')]['id']},'transaction':_0x4223d8});});})[_0x2630('0x28')](function(){_0x3f4f64[_0x2630('0x6c')](function(_0x526bb2){socket[_0x2630('0x6d')]('userSmsQueue:save',{'UserId':_0x526bb2['id'],'SmsQueueId':_0x4fa360['id']});});});});});}})[_0x2630('0x28')](respondWithStatusCode(_0x32afb8,null))[_0x2630('0x48')](handleError(_0x32afb8,null));};exports['removeTeams']=function(_0x5f40ce,_0x213329,_0x55a7b3){return db[_0x2630('0x64')][_0x2630('0x46')]({'where':{'id':_0x5f40ce[_0x2630('0x33')][_0x2630('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x2630('0x5b')],'as':_0x2630('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x213329,null))[_0x2630('0x28')](function(_0x5685b9){var _0x1dd317=_[_0x2630('0x40')](_0x5685b9,'id');var _0x4a4443=[];var _0x1d3bf4=[];var _0x13852d=squel[_0x2630('0x6f')]();_0x13852d['field'](_0x2630('0x70'))[_0x2630('0x71')]('team_has_sms_queues','tq')[_0x2630('0x72')](_0x2630('0x73'),'ut',_0x2630('0x74'))['where'](_0x2630('0x75'),_0x5f40ce[_0x2630('0x4a')]['id']);for(var _0xc399d=0x0;_0xc399d<_0x5685b9[_0x2630('0x3a')];_0xc399d+=0x1){let _0x28b217=_0x5685b9[_0xc399d];for(var _0x3de7b2=0x0;_0x3de7b2<_0x28b217[_0x2630('0x65')]['length'];_0x3de7b2+=0x1){let _0x4c527e=_0x28b217[_0x2630('0x65')][_0x3de7b2];var _0x564a56=_0x13852d[_0x2630('0x76')]();_0x564a56['where']('ut.UserId\x20=\x20?',_0x4c527e['id']);_0x1d3bf4[_0x2630('0x77')](db[_0x2630('0x69')]['query'](_0x564a56['toString'](),{'type':db['sequelize'][_0x2630('0x78')][_0x2630('0x79')]})[_0x2630('0x28')](function(_0x5d86cd){if(_0x5d86cd['length']===0x1){return _0x4c527e['id'];}else{var _0xc75fa7=_[_0x2630('0x7a')](_[_0x2630('0x40')](_0x5d86cd,_0x2630('0x7b')),function(_0x3b4b77){return _[_0x2630('0x7c')](_0x1dd317,_0x3b4b77);});if(_0xc75fa7){return _0x4c527e['id'];}}}));}}return BPromise[_0x2630('0x7d')](_0x1d3bf4)[_0x2630('0x28')](function(_0x366d3d){_0x4a4443=_(_0x4a4443)['union'](_0x366d3d)[_0x2630('0x7e')]()[_0x2630('0x7f')]();return db['SmsQueue']['find']({'where':{'id':_0x5f40ce['params']['id']}})[_0x2630('0x28')](function(_0x47798b){return db[_0x2630('0x69')][_0x2630('0x80')](function(_0x254a2b){return _0x47798b[_0x2630('0x81')](_0x5f40ce[_0x2630('0x33')][_0x2630('0x6e')],{'transaction':_0x254a2b})[_0x2630('0x28')](function(){if(!_[_0x2630('0x82')](_0x4a4443)){return _0x47798b[_0x2630('0x83')](_0x4a4443,{'transaction':_0x254a2b});}})[_0x2630('0x28')](function(){_0x4a4443['forEach'](function(_0x17f9b3){socket[_0x2630('0x6d')](_0x2630('0x84'),{'UserId':_0x17f9b3,'SmsQueueId':_0x47798b['id']});});});});});});})['then'](respondWithStatusCode(_0x213329,null))[_0x2630('0x48')](handleError(_0x213329,null));};exports[_0x2630('0x85')]=function(_0x33634c,_0x9253d,_0x502363){return db[_0x2630('0x2f')]['find']({'where':{'id':_0x33634c[_0x2630('0x4a')]['id']}})[_0x2630('0x28')](handleEntityNotFound(_0x9253d,null))[_0x2630('0x28')](function(_0x48cc19){if(_0x48cc19){return _0x48cc19[_0x2630('0x85')](_0x33634c[_0x2630('0x4d')][_0x2630('0x6e')],_[_0x2630('0x86')](_0x33634c['body'],['ids','id'])||{})['spread'](function(_0x20c941){for(var _0xff89a3=0x0;_0xff89a3<_0x33634c['body'][_0x2630('0x6e')][_0x2630('0x3a')];_0xff89a3+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x33634c['body'][_0x2630('0x6e')][_0xff89a3]),'SmsQueueId':Number(_0x33634c[_0x2630('0x4a')]['id'])});}return _0x20c941;});}})['then'](respondWithResult(_0x9253d,null))['catch'](handleError(_0x9253d,null));};exports[_0x2630('0x83')]=function(_0x25d339,_0x54547d,_0x5431ed){return db[_0x2630('0x2f')]['find']({'where':{'id':_0x25d339[_0x2630('0x4a')]['id']}})[_0x2630('0x28')](handleEntityNotFound(_0x54547d,null))[_0x2630('0x28')](function(_0x2abb63){if(_0x2abb63){return _0x2abb63[_0x2630('0x83')](_0x25d339[_0x2630('0x33')][_0x2630('0x6e')])[_0x2630('0x28')](function(){if(_['isArray'](_0x25d339[_0x2630('0x33')][_0x2630('0x6e')])){for(var _0x148358=0x0;_0x148358<_0x25d339[_0x2630('0x33')][_0x2630('0x6e')][_0x2630('0x3a')];_0x148358+=0x1){socket[_0x2630('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x25d339['query'][_0x2630('0x6e')][_0x148358]),'SmsQueueId':Number(_0x25d339['params']['id'])});}}else{socket[_0x2630('0x6d')](_0x2630('0x84'),{'UserId':Number(_0x25d339[_0x2630('0x33')]['ids']),'SmsQueueId':Number(_0x25d339[_0x2630('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x54547d,null))['catch'](handleError(_0x54547d,null));};exports['getAgents']=function(_0x2fd8ac,_0xf9c2fb,_0x12f46c){var _0x2e86d8={};var _0x8f4dfe={};var _0x1e92be;var _0x569830;return db[_0x2630('0x2f')][_0x2630('0x57')]({'where':{'id':_0x2fd8ac['params']['id']}})[_0x2630('0x28')](handleEntityNotFound(_0xf9c2fb,null))[_0x2630('0x28')](function(_0x1ef162){if(_0x1ef162){_0x1e92be=_0x1ef162;_0x8f4dfe[_0x2630('0x38')]=_['keys'](db[_0x2630('0x5b')]['rawAttributes']);_0x8f4dfe[_0x2630('0x33')]=_[_0x2630('0x34')](_0x2fd8ac[_0x2630('0x33')]);_0x8f4dfe[_0x2630('0x35')]=_[_0x2630('0x36')](_0x8f4dfe[_0x2630('0x38')],_0x8f4dfe[_0x2630('0x33')]);_0x2e86d8[_0x2630('0x37')]=_[_0x2630('0x36')](_0x8f4dfe[_0x2630('0x38')],qs[_0x2630('0x39')](_0x2fd8ac[_0x2630('0x33')][_0x2630('0x39')]));_0x2e86d8[_0x2630('0x37')]=_0x2e86d8['attributes'][_0x2630('0x3a')]?_0x2e86d8['attributes']:_0x8f4dfe[_0x2630('0x38')];_0x2e86d8[_0x2630('0x3d')]=qs[_0x2630('0x3e')](_0x2fd8ac[_0x2630('0x33')]['sort']);_0x2e86d8[_0x2630('0x3f')]=qs[_0x2630('0x35')](_['pick'](_0x2fd8ac[_0x2630('0x33')],_0x8f4dfe[_0x2630('0x35')]));if(_0x2fd8ac[_0x2630('0x33')]['filter']){_0x2e86d8[_0x2630('0x3f')]=_[_0x2630('0x43')](_0x2e86d8['where'],{'$or':_[_0x2630('0x40')](_0x2e86d8[_0x2630('0x37')],function(_0x50a0b6){var _0x337999={};_0x337999[_0x50a0b6]={'$like':'%'+_0x2fd8ac[_0x2630('0x33')][_0x2630('0x42')]+'%'};return _0x337999;})});}_0x2e86d8=_[_0x2630('0x43')]({},_0x2e86d8,_0x2fd8ac[_0x2630('0x44')]);return _0x1e92be[_0x2630('0x87')](_0x2e86d8);}})['then'](function(_0x4539ff){if(_0x4539ff){_0x569830=_0x4539ff[_0x2630('0x3a')];if(!_0x2fd8ac[_0x2630('0x33')][_0x2630('0x3b')](_0x2630('0x3c'))){_0x2e86d8['limit']=qs[_0x2630('0x20')](_0x2fd8ac['query'][_0x2630('0x20')]);_0x2e86d8[_0x2630('0x23')]=qs[_0x2630('0x23')](_0x2fd8ac['query'][_0x2630('0x23')]);}return _0x1e92be['getAgents'](_0x2e86d8);}})['then'](function(_0xa33516){if(_0xa33516){return _0xa33516?{'count':_0x569830,'rows':_0xa33516}:null;}})[_0x2630('0x28')](respondWithResult(_0xf9c2fb,null))[_0x2630('0x48')](handleError(_0xf9c2fb,null));}; \ No newline at end of file +var _0x9f8d=['SIP','Team','getTeams','ids','Agents','voicePause','sequelize','transaction','each','UserSmsQueue','findOrCreate','forEach','emit','userSmsQueue:save','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','every','TeamId','includes','union','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','SmsQueueId','User','findAndCountAll','smsPause','updatedAt','createdAt','format','%s/%s'];(function(_0x429c0c,_0x560f5b){var _0x45c8a5=function(_0xf23261){while(--_0xf23261){_0x429c0c['push'](_0x429c0c['shift']());}};_0x45c8a5(++_0x560f5b);}(_0x9f8d,0xb0));var _0xd9f8=function(_0x7d0f6c,_0x506122){_0x7d0f6c=_0x7d0f6c-0x0;var _0x872f75=_0x9f8d[_0x7d0f6c];return _0x872f75;};'use strict';var emlformat=require(_0xd9f8('0x0'));var rimraf=require(_0xd9f8('0x1'));var zipdir=require(_0xd9f8('0x2'));var jsonpatch=require(_0xd9f8('0x3'));var rp=require(_0xd9f8('0x4'));var moment=require(_0xd9f8('0x5'));var BPromise=require(_0xd9f8('0x6'));var Mustache=require(_0xd9f8('0x7'));var util=require(_0xd9f8('0x8'));var path=require(_0xd9f8('0x9'));var sox=require(_0xd9f8('0xa'));var csv=require(_0xd9f8('0xb'));var ejs=require(_0xd9f8('0xc'));var fs=require('fs');var fs_extra=require(_0xd9f8('0xd'));var _=require(_0xd9f8('0xe'));var squel=require(_0xd9f8('0xf'));var crypto=require(_0xd9f8('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd9f8('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd9f8('0x12'));var Papa=require(_0xd9f8('0x13'));var Redis=require(_0xd9f8('0x14'));var authService=require(_0xd9f8('0x15'));var qs=require(_0xd9f8('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9f8('0x17'));var logger=require('../../config/logger')(_0xd9f8('0x18'));var utils=require(_0xd9f8('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd9f8('0x1a'))['db'];config[_0xd9f8('0x1b')]=_['defaults'](config[_0xd9f8('0x1b')],{'host':_0xd9f8('0x1c'),'port':0x18eb});var socket=require(_0xd9f8('0x1d'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xd9f8('0x1e')](socket);function respondWithStatusCode(_0x16d094,_0x50d9c4){_0x50d9c4=_0x50d9c4||0xcc;return function(_0x549eae){if(_0x549eae){return _0x16d094['sendStatus'](_0x50d9c4);}return _0x16d094[_0xd9f8('0x1f')](_0x50d9c4)[_0xd9f8('0x20')]();};}function respondWithResult(_0x57f884,_0x5a5f84){_0x5a5f84=_0x5a5f84||0xc8;return function(_0x41773b){if(_0x41773b){return _0x57f884[_0xd9f8('0x1f')](_0x5a5f84)[_0xd9f8('0x21')](_0x41773b);}};}function respondWithFilteredResult(_0x12f90f,_0x54cd93){return function(_0x2ac64a){if(_0x2ac64a){var _0x284a3a=typeof _0x54cd93[_0xd9f8('0x22')]==='undefined'&&typeof _0x54cd93[_0xd9f8('0x23')]===_0xd9f8('0x24');var _0xbedfb3=_0x2ac64a['count'];var _0x17827f=_0x284a3a?0x0:_0x54cd93['offset'];var _0x28dcb5=_0x284a3a?_0x2ac64a['count']:_0x54cd93[_0xd9f8('0x22')]+_0x54cd93[_0xd9f8('0x23')];var _0x2e7858;if(_0x28dcb5>=_0xbedfb3){_0x28dcb5=_0xbedfb3;_0x2e7858=0xc8;}else{_0x2e7858=0xce;}_0x12f90f[_0xd9f8('0x1f')](_0x2e7858);return _0x12f90f[_0xd9f8('0x25')](_0xd9f8('0x26'),_0x17827f+'-'+_0x28dcb5+'/'+_0xbedfb3)[_0xd9f8('0x21')](_0x2ac64a);}return null;};}function patchUpdates(_0x4d42cf){return function(_0x25bd5b){try{jsonpatch['apply'](_0x25bd5b,_0x4d42cf,!![]);}catch(_0x50896e){return BPromise[_0xd9f8('0x27')](_0x50896e);}return _0x25bd5b[_0xd9f8('0x28')]();};}function saveUpdates(_0x6df611,_0x24f9ff){return function(_0xdf2ed5){if(_0xdf2ed5){return _0xdf2ed5[_0xd9f8('0x29')](_0x6df611)[_0xd9f8('0x2a')](function(_0x27b134){return _0x27b134;});}return null;};}function removeEntity(_0x41e4a2,_0x11b7de){return function(_0x59b4b0){if(_0x59b4b0){return _0x59b4b0[_0xd9f8('0x2b')]()[_0xd9f8('0x2a')](function(){var _0x198922=_0x59b4b0['get']({'plain':!![]});var _0x2c402b=_0xd9f8('0x2c');return db[_0xd9f8('0x2d')][_0xd9f8('0x2b')]({'where':{'type':_0x2c402b,'resourceId':_0x198922['id']}})['then'](function(){return _0x59b4b0;});})['then'](function(){_0x41e4a2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x379d68,_0x237cd8){return function(_0xfbccb5){if(!_0xfbccb5){_0x379d68[_0xd9f8('0x2e')](0x194);}return _0xfbccb5;};}function handleError(_0x43bdba,_0xc39e70){_0xc39e70=_0xc39e70||0x1f4;return function(_0x4f980f){logger[_0xd9f8('0x2f')](_0x4f980f[_0xd9f8('0x30')]);if(_0x4f980f['name']){delete _0x4f980f[_0xd9f8('0x31')];}_0x43bdba[_0xd9f8('0x1f')](_0xc39e70)[_0xd9f8('0x32')](_0x4f980f);};}exports[_0xd9f8('0x33')]=function(_0x9f26ee,_0x1484be){var _0x4b0329={},_0x3bc7ff={},_0x5ee077={'count':0x0,'rows':[]};var _0x112740=_['map'](db[_0xd9f8('0x34')][_0xd9f8('0x35')],function(_0x72221){return{'name':_0x72221[_0xd9f8('0x36')],'type':_0x72221[_0xd9f8('0x37')][_0xd9f8('0x38')]};});_0x3bc7ff[_0xd9f8('0x39')]=_['map'](_0x112740,_0xd9f8('0x31'));_0x3bc7ff[_0xd9f8('0x3a')]=_[_0xd9f8('0x3b')](_0x9f26ee[_0xd9f8('0x3a')]);_0x3bc7ff[_0xd9f8('0x3c')]=_['intersection'](_0x3bc7ff[_0xd9f8('0x39')],_0x3bc7ff[_0xd9f8('0x3a')]);_0x4b0329['attributes']=_[_0xd9f8('0x3d')](_0x3bc7ff[_0xd9f8('0x39')],qs[_0xd9f8('0x3e')](_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x3e')]));_0x4b0329[_0xd9f8('0x3f')]=_0x4b0329['attributes'][_0xd9f8('0x40')]?_0x4b0329[_0xd9f8('0x3f')]:_0x3bc7ff[_0xd9f8('0x39')];if(!_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x41')]('nolimit')){_0x4b0329[_0xd9f8('0x23')]=qs[_0xd9f8('0x23')](_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x23')]);_0x4b0329[_0xd9f8('0x22')]=qs['offset'](_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x22')]);}_0x4b0329[_0xd9f8('0x42')]=qs[_0xd9f8('0x43')](_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x43')]);_0x4b0329['where']=qs[_0xd9f8('0x3c')](_[_0xd9f8('0x44')](_0x9f26ee[_0xd9f8('0x3a')],_0x3bc7ff[_0xd9f8('0x3c')]),_0x112740);if(_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x45')]){_0x4b0329[_0xd9f8('0x46')]=_[_0xd9f8('0x47')](_0x4b0329['where'],{'$or':_[_0xd9f8('0x48')](_0x112740,function(_0x12a3ef){if(_0x12a3ef['type']!=='VIRTUAL'){var _0x243efa={};_0x243efa[_0x12a3ef[_0xd9f8('0x31')]]={'$like':'%'+_0x9f26ee['query'][_0xd9f8('0x45')]+'%'};return _0x243efa;}})});}_0x4b0329=_[_0xd9f8('0x47')]({},_0x4b0329,_0x9f26ee[_0xd9f8('0x49')]);var _0x5ab611={'where':_0x4b0329[_0xd9f8('0x46')]};return db[_0xd9f8('0x34')][_0xd9f8('0x4a')](_0x5ab611)['then'](function(_0xf7f1b2){_0x5ee077[_0xd9f8('0x4a')]=_0xf7f1b2;if(_0x9f26ee[_0xd9f8('0x3a')][_0xd9f8('0x4b')]){_0x4b0329[_0xd9f8('0x4c')]=[{'all':!![]}];}return db[_0xd9f8('0x34')][_0xd9f8('0x4d')](_0x4b0329);})[_0xd9f8('0x2a')](function(_0x1c9d87){_0x5ee077[_0xd9f8('0x4e')]=_0x1c9d87;return _0x5ee077;})[_0xd9f8('0x2a')](respondWithFilteredResult(_0x1484be,_0x4b0329))[_0xd9f8('0x4f')](handleError(_0x1484be,null));};exports[_0xd9f8('0x50')]=function(_0x23684b,_0x548b39){var _0x1b24c9={'raw':!![],'where':{'id':_0x23684b[_0xd9f8('0x51')]['id']}},_0x20f023={};_0x20f023['model']=_[_0xd9f8('0x3b')](db[_0xd9f8('0x34')][_0xd9f8('0x35')]);_0x20f023[_0xd9f8('0x3a')]=_[_0xd9f8('0x3b')](_0x23684b[_0xd9f8('0x3a')]);_0x20f023[_0xd9f8('0x3c')]=_[_0xd9f8('0x3d')](_0x20f023[_0xd9f8('0x39')],_0x20f023[_0xd9f8('0x3a')]);_0x1b24c9[_0xd9f8('0x3f')]=_[_0xd9f8('0x3d')](_0x20f023[_0xd9f8('0x39')],qs[_0xd9f8('0x3e')](_0x23684b[_0xd9f8('0x3a')][_0xd9f8('0x3e')]));_0x1b24c9['attributes']=_0x1b24c9[_0xd9f8('0x3f')][_0xd9f8('0x40')]?_0x1b24c9['attributes']:_0x20f023['model'];if(_0x23684b['query'][_0xd9f8('0x4b')]){_0x1b24c9['include']=[{'all':!![]}];}_0x1b24c9=_[_0xd9f8('0x47')]({},_0x1b24c9,_0x23684b[_0xd9f8('0x49')]);return db[_0xd9f8('0x34')][_0xd9f8('0x52')](_0x1b24c9)[_0xd9f8('0x2a')](handleEntityNotFound(_0x548b39,null))['then'](respondWithResult(_0x548b39,null))[_0xd9f8('0x4f')](handleError(_0x548b39,null));};exports[_0xd9f8('0x53')]=function(_0x58e39a,_0x18569c){return db[_0xd9f8('0x34')]['create'](_0x58e39a[_0xd9f8('0x54')],{})['then'](function(_0x3f5df1){var _0x5b2468=_0x58e39a[_0xd9f8('0x55')]['get']({'plain':!![]});if(!_0x5b2468)throw new Error(_0xd9f8('0x56'));if(_0x5b2468[_0xd9f8('0x57')]===_0xd9f8('0x55')){var _0x364d73=_0x3f5df1[_0xd9f8('0x58')]({'plain':!![]});var _0x1cfcce=_0xd9f8('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x1cfcce,'userProfileId':_0x5b2468[_0xd9f8('0x59')]},'raw':!![]})['then'](function(_0x9d81e7){if(_0x9d81e7&&_0x9d81e7[_0xd9f8('0x5a')]===0x0){return db[_0xd9f8('0x2d')][_0xd9f8('0x53')]({'name':_0x364d73[_0xd9f8('0x31')],'resourceId':_0x364d73['id'],'type':_0x9d81e7[_0xd9f8('0x31')],'sectionId':_0x9d81e7['id']},{})[_0xd9f8('0x2a')](function(){return _0x3f5df1;});}else{return _0x3f5df1;}})[_0xd9f8('0x4f')](function(_0x316d46){logger['error'](_0xd9f8('0x5b'),_0x316d46);throw _0x316d46;});}return _0x3f5df1;})[_0xd9f8('0x2a')](respondWithResult(_0x18569c,0xc9))[_0xd9f8('0x4f')](handleError(_0x18569c,null));};exports[_0xd9f8('0x29')]=function(_0x4d63f8,_0x3c235c){if(_0x4d63f8[_0xd9f8('0x54')]['id']){delete _0x4d63f8['body']['id'];}return db[_0xd9f8('0x34')][_0xd9f8('0x52')]({'where':{'id':_0x4d63f8[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](handleEntityNotFound(_0x3c235c,null))['then'](saveUpdates(_0x4d63f8[_0xd9f8('0x54')],null))['then'](respondWithResult(_0x3c235c,null))['catch'](handleError(_0x3c235c,null));};exports['destroy']=function(_0x424a0b,_0x4cdc40){return db[_0xd9f8('0x34')]['find']({'where':{'id':_0x424a0b[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](handleEntityNotFound(_0x4cdc40,null))['then'](removeEntity(_0x4cdc40,null))[_0xd9f8('0x4f')](handleError(_0x4cdc40,null));};exports[_0xd9f8('0x5c')]=function(_0x49ff1e,_0x3e6da8){return db[_0xd9f8('0x34')][_0xd9f8('0x5c')]()[_0xd9f8('0x2a')](respondWithResult(_0x3e6da8,null))[_0xd9f8('0x4f')](handleError(_0x3e6da8,null));};exports[_0xd9f8('0x5d')]=function(_0x1d3bb3,_0x452b03,_0xc6d700){var _0x566692={'raw':!![],'where':{}},_0x56e119={},_0x1b6bfc;return db[_0xd9f8('0x34')][_0xd9f8('0x5e')]({'where':{'id':_0x1d3bb3[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](handleEntityNotFound(_0x452b03,null))[_0xd9f8('0x2a')](function(_0xb94796){if(_0xb94796){_0x1b6bfc=_0xb94796[_0xd9f8('0x58')]({'plain':!![]});_0x56e119[_0xd9f8('0x39')]=_['keys'](db['UserSmsQueue'][_0xd9f8('0x35')]);_0x56e119[_0xd9f8('0x3a')]=_['keys'](_0x1d3bb3[_0xd9f8('0x3a')]);_0x56e119[_0xd9f8('0x3c')]=_['intersection'](_0x56e119[_0xd9f8('0x39')],_0x56e119[_0xd9f8('0x3a')]);_0x566692[_0xd9f8('0x3f')]=_[_0xd9f8('0x3d')](_0x56e119[_0xd9f8('0x39')],qs[_0xd9f8('0x3e')](_0x1d3bb3[_0xd9f8('0x3a')][_0xd9f8('0x3e')]));_0x566692[_0xd9f8('0x3f')]=_0x566692[_0xd9f8('0x3f')][_0xd9f8('0x40')]?_0x566692['attributes']:_0x56e119[_0xd9f8('0x39')];if(!_0x1d3bb3[_0xd9f8('0x3a')][_0xd9f8('0x41')](_0xd9f8('0x5f'))){_0x566692[_0xd9f8('0x23')]=qs[_0xd9f8('0x23')](_0x1d3bb3[_0xd9f8('0x3a')][_0xd9f8('0x23')]);_0x566692[_0xd9f8('0x22')]=qs[_0xd9f8('0x22')](_0x1d3bb3['query'][_0xd9f8('0x22')]);}_0x566692['order']=qs[_0xd9f8('0x43')](_0x1d3bb3[_0xd9f8('0x3a')][_0xd9f8('0x43')]);_0x566692[_0xd9f8('0x46')]=qs[_0xd9f8('0x3c')](_[_0xd9f8('0x44')](_0x1d3bb3[_0xd9f8('0x3a')],_0x56e119['filters']));_0x566692[_0xd9f8('0x46')][_0xd9f8('0x60')]=_0xb94796['id'];if(_0x1d3bb3[_0xd9f8('0x3a')][_0xd9f8('0x45')]){_0x566692[_0xd9f8('0x46')]=_[_0xd9f8('0x47')](_0x566692[_0xd9f8('0x46')],{'$or':_['map'](_0x566692[_0xd9f8('0x3f')],function(_0x506574){var _0xdeddd8={};_0xdeddd8[_0x506574]={'$like':'%'+_0x1d3bb3[_0xd9f8('0x3a')][_0xd9f8('0x45')]+'%'};return _0xdeddd8;})});}_0x566692=_[_0xd9f8('0x47')]({},_0x566692,_0x1d3bb3[_0xd9f8('0x49')]);return db['UserSmsQueue']['findAll'](_0x566692);}})[_0xd9f8('0x2a')](function(_0x7eec70){if(_0x7eec70){return db[_0xd9f8('0x61')][_0xd9f8('0x62')]({'where':{'id':_['map'](_0x7eec70,'UserId'),'role':'agent'},'attributes':['id',_0xd9f8('0x31'),_0xd9f8('0x63'),_0xd9f8('0x64'),_0xd9f8('0x65')]});}})[_0xd9f8('0x2a')](function(_0x533a8b){if(_0x533a8b){return{'count':_0x533a8b[_0xd9f8('0x4a')],'rows':_['map'](_0x533a8b[_0xd9f8('0x4e')],function(_0x843e2b){return{'membername':_0x843e2b[_0xd9f8('0x31')],'UserId':_0x843e2b['id'],'queue_name':_0x1b6bfc[_0xd9f8('0x31')],'SmsQueueId':_0x1b6bfc['id'],'interface':util[_0xd9f8('0x66')](_0xd9f8('0x67'),_0xd9f8('0x68'),_0x843e2b[_0xd9f8('0x31')]),'penalty':0x0,'paused':_0x843e2b[_0xd9f8('0x63')],'createdAt':_0x843e2b['createdAt'],'updatedAt':_0x843e2b[_0xd9f8('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9f8('0x2a')](respondWithFilteredResult(_0x452b03,_0x566692))['catch'](handleError(_0x452b03,null));};exports['getTeams']=function(_0x15bffc,_0x50f357,_0x2dcea4){var _0x315e1f={};var _0x1d81c6={};var _0x198ddd;var _0x4fe01d;return db['SmsQueue'][_0xd9f8('0x5e')]({'where':{'id':_0x15bffc[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](handleEntityNotFound(_0x50f357,null))[_0xd9f8('0x2a')](function(_0x33ef5a){if(_0x33ef5a){_0x198ddd=_0x33ef5a;_0x1d81c6[_0xd9f8('0x39')]=_[_0xd9f8('0x3b')](db[_0xd9f8('0x69')][_0xd9f8('0x35')]);_0x1d81c6[_0xd9f8('0x3a')]=_[_0xd9f8('0x3b')](_0x15bffc[_0xd9f8('0x3a')]);_0x1d81c6[_0xd9f8('0x3c')]=_[_0xd9f8('0x3d')](_0x1d81c6['model'],_0x1d81c6['query']);_0x315e1f[_0xd9f8('0x3f')]=_['intersection'](_0x1d81c6[_0xd9f8('0x39')],qs['fields'](_0x15bffc[_0xd9f8('0x3a')]['fields']));_0x315e1f[_0xd9f8('0x3f')]=_0x315e1f[_0xd9f8('0x3f')][_0xd9f8('0x40')]?_0x315e1f[_0xd9f8('0x3f')]:_0x1d81c6[_0xd9f8('0x39')];_0x315e1f['order']=qs['sort'](_0x15bffc[_0xd9f8('0x3a')][_0xd9f8('0x43')]);_0x315e1f['where']=qs[_0xd9f8('0x3c')](_['pick'](_0x15bffc['query'],_0x1d81c6[_0xd9f8('0x3c')]));if(_0x15bffc[_0xd9f8('0x3a')]['filter']){_0x315e1f[_0xd9f8('0x46')]=_['merge'](_0x315e1f[_0xd9f8('0x46')],{'$or':_[_0xd9f8('0x48')](_0x315e1f[_0xd9f8('0x3f')],function(_0x151614){var _0xb8e342={};_0xb8e342[_0x151614]={'$like':'%'+_0x15bffc['query'][_0xd9f8('0x45')]+'%'};return _0xb8e342;})});}_0x315e1f=_[_0xd9f8('0x47')]({},_0x315e1f,_0x15bffc['options']);return _0x198ddd[_0xd9f8('0x6a')](_0x315e1f);}})[_0xd9f8('0x2a')](function(_0x4f6a44){if(_0x4f6a44){_0x4fe01d=_0x4f6a44[_0xd9f8('0x40')];if(!_0x15bffc[_0xd9f8('0x3a')][_0xd9f8('0x41')](_0xd9f8('0x5f'))){_0x315e1f[_0xd9f8('0x23')]=qs['limit'](_0x15bffc['query'][_0xd9f8('0x23')]);_0x315e1f[_0xd9f8('0x22')]=qs['offset'](_0x15bffc[_0xd9f8('0x3a')][_0xd9f8('0x22')]);}return _0x198ddd[_0xd9f8('0x6a')](_0x315e1f);}})[_0xd9f8('0x2a')](function(_0xca4a1c){if(_0xca4a1c){return _0xca4a1c?{'count':_0x4fe01d,'rows':_0xca4a1c}:null;}})['then'](respondWithResult(_0x50f357,null))[_0xd9f8('0x4f')](handleError(_0x50f357,null));};exports['addTeams']=function(_0x43b7f7,_0x2fc42e,_0x5d337d){var _0x241448=_0x43b7f7[_0xd9f8('0x54')][_0xd9f8('0x6b')];return db[_0xd9f8('0x69')][_0xd9f8('0x4d')]({'where':{'id':_0x241448},'attributes':['id'],'include':[{'model':db[_0xd9f8('0x61')],'as':_0xd9f8('0x6c'),'attributes':['id',_0xd9f8('0x31'),'online',_0xd9f8('0x6d'),'interface'],'raw':!![]}]})[_0xd9f8('0x2a')](function(_0x1344a4){if(_0x1344a4){var _0x543293=_['flatMap'](_0x1344a4,function(_0x3e0058){var _0x3c4bef=_0x3e0058['get']({'plain':!![]});return _0x3c4bef['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x43b7f7[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](function(_0x3e3e92){return db[_0xd9f8('0x6e')][_0xd9f8('0x6f')](function(_0xdcae8f){return _0x3e3e92['addTeams'](_0x241448,{'transaction':_0xdcae8f})['then'](function(){return BPromise[_0xd9f8('0x70')](_0x543293,function(_0x1453e6){return db[_0xd9f8('0x71')][_0xd9f8('0x72')]({'where':{'UserId':_0x1453e6['id'],'SmsQueueId':_0x43b7f7[_0xd9f8('0x51')]['id']},'transaction':_0xdcae8f});});})[_0xd9f8('0x2a')](function(){_0x543293[_0xd9f8('0x73')](function(_0x18d5d9){socket[_0xd9f8('0x74')](_0xd9f8('0x75'),{'UserId':_0x18d5d9['id'],'SmsQueueId':_0x3e3e92['id']});});});});});}})[_0xd9f8('0x2a')](respondWithStatusCode(_0x2fc42e,null))[_0xd9f8('0x4f')](handleError(_0x2fc42e,null));};exports['removeTeams']=function(_0x1da24a,_0x36934f,_0x616ff1){return db[_0xd9f8('0x69')][_0xd9f8('0x4d')]({'where':{'id':_0x1da24a[_0xd9f8('0x3a')][_0xd9f8('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xd9f8('0x61')],'as':_0xd9f8('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xd9f8('0x2a')](handleEntityNotFound(_0x36934f,null))[_0xd9f8('0x2a')](function(_0x5d0f49){var _0x445ede=_['map'](_0x5d0f49,'id');var _0x31ecbb=[];var _0x5437be=[];var _0x2e5e38=squel[_0xd9f8('0x76')]();_0x2e5e38[_0xd9f8('0x77')]('tq.TeamId')['from']('team_has_sms_queues','tq')[_0xd9f8('0x78')](_0xd9f8('0x79'),'ut',_0xd9f8('0x7a'))[_0xd9f8('0x46')](_0xd9f8('0x7b'),_0x1da24a[_0xd9f8('0x51')]['id']);for(var _0x211e0c=0x0;_0x211e0c<_0x5d0f49[_0xd9f8('0x40')];_0x211e0c+=0x1){let _0x4c059e=_0x5d0f49[_0x211e0c];for(var _0x1d5514=0x0;_0x1d5514<_0x4c059e[_0xd9f8('0x6c')][_0xd9f8('0x40')];_0x1d5514+=0x1){let _0x23cc46=_0x4c059e[_0xd9f8('0x6c')][_0x1d5514];var _0x1a8197=_0x2e5e38[_0xd9f8('0x7c')]();_0x1a8197[_0xd9f8('0x46')]('ut.UserId\x20=\x20?',_0x23cc46['id']);_0x5437be[_0xd9f8('0x7d')](db[_0xd9f8('0x6e')][_0xd9f8('0x3a')](_0x1a8197[_0xd9f8('0x7e')](),{'type':db[_0xd9f8('0x6e')]['QueryTypes']['SELECT']})[_0xd9f8('0x2a')](function(_0x3f5115){if(_0x3f5115['length']===0x1){return _0x23cc46['id'];}else{var _0x461408=_[_0xd9f8('0x7f')](_[_0xd9f8('0x48')](_0x3f5115,_0xd9f8('0x80')),function(_0x596bfd){return _[_0xd9f8('0x81')](_0x445ede,_0x596bfd);});if(_0x461408){return _0x23cc46['id'];}}}));}}return BPromise['all'](_0x5437be)['then'](function(_0xfba07b){_0x31ecbb=_(_0x31ecbb)[_0xd9f8('0x82')](_0xfba07b)['compact']()[_0xd9f8('0x83')]();return db[_0xd9f8('0x34')][_0xd9f8('0x52')]({'where':{'id':_0x1da24a['params']['id']}})[_0xd9f8('0x2a')](function(_0x3afd85){return db[_0xd9f8('0x6e')]['transaction'](function(_0x20e0fa){return _0x3afd85['removeTeams'](_0x1da24a['query'][_0xd9f8('0x6b')],{'transaction':_0x20e0fa})['then'](function(){if(!_[_0xd9f8('0x84')](_0x31ecbb)){return _0x3afd85[_0xd9f8('0x85')](_0x31ecbb,{'transaction':_0x20e0fa});}})[_0xd9f8('0x2a')](function(){_0x31ecbb[_0xd9f8('0x73')](function(_0x1af43a){socket[_0xd9f8('0x74')](_0xd9f8('0x86'),{'UserId':_0x1af43a,'SmsQueueId':_0x3afd85['id']});});});});});});})[_0xd9f8('0x2a')](respondWithStatusCode(_0x36934f,null))[_0xd9f8('0x4f')](handleError(_0x36934f,null));};exports[_0xd9f8('0x87')]=function(_0x2ce730,_0x22b25e,_0x427f53){return db['SmsQueue']['find']({'where':{'id':_0x2ce730[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](handleEntityNotFound(_0x22b25e,null))[_0xd9f8('0x2a')](function(_0x43b12d){if(_0x43b12d){return _0x43b12d[_0xd9f8('0x87')](_0x2ce730[_0xd9f8('0x54')][_0xd9f8('0x6b')],_[_0xd9f8('0x88')](_0x2ce730[_0xd9f8('0x54')],[_0xd9f8('0x6b'),'id'])||{})[_0xd9f8('0x89')](function(_0xa23389){for(var _0x4545f6=0x0;_0x4545f6<_0x2ce730['body'][_0xd9f8('0x6b')][_0xd9f8('0x40')];_0x4545f6+=0x1){socket[_0xd9f8('0x74')]('userSmsQueue:save',{'UserId':Number(_0x2ce730[_0xd9f8('0x54')]['ids'][_0x4545f6]),'SmsQueueId':Number(_0x2ce730['params']['id'])});}return _0xa23389;});}})[_0xd9f8('0x2a')](respondWithResult(_0x22b25e,null))['catch'](handleError(_0x22b25e,null));};exports[_0xd9f8('0x85')]=function(_0x39470d,_0x405e6b,_0x34546){return db[_0xd9f8('0x34')][_0xd9f8('0x52')]({'where':{'id':_0x39470d[_0xd9f8('0x51')]['id']}})[_0xd9f8('0x2a')](handleEntityNotFound(_0x405e6b,null))['then'](function(_0x1d230e){if(_0x1d230e){return _0x1d230e[_0xd9f8('0x85')](_0x39470d['query'][_0xd9f8('0x6b')])['then'](function(){if(_[_0xd9f8('0x8a')](_0x39470d[_0xd9f8('0x3a')]['ids'])){for(var _0x3b6d64=0x0;_0x3b6d64<_0x39470d[_0xd9f8('0x3a')][_0xd9f8('0x6b')][_0xd9f8('0x40')];_0x3b6d64+=0x1){socket[_0xd9f8('0x74')](_0xd9f8('0x86'),{'UserId':Number(_0x39470d[_0xd9f8('0x3a')]['ids'][_0x3b6d64]),'SmsQueueId':Number(_0x39470d[_0xd9f8('0x51')]['id'])});}}else{socket[_0xd9f8('0x74')](_0xd9f8('0x86'),{'UserId':Number(_0x39470d[_0xd9f8('0x3a')][_0xd9f8('0x6b')]),'SmsQueueId':Number(_0x39470d[_0xd9f8('0x51')]['id'])});}});}})[_0xd9f8('0x2a')](respondWithStatusCode(_0x405e6b,null))[_0xd9f8('0x4f')](handleError(_0x405e6b,null));};exports[_0xd9f8('0x8b')]=function(_0x3a55d0,_0x158ecd,_0x302ca7){var _0x51a022={};var _0x40f5fa={};var _0x5677db;var _0x1a6540;return db[_0xd9f8('0x34')][_0xd9f8('0x5e')]({'where':{'id':_0x3a55d0[_0xd9f8('0x51')]['id']}})['then'](handleEntityNotFound(_0x158ecd,null))['then'](function(_0x2eb38b){if(_0x2eb38b){_0x5677db=_0x2eb38b;_0x40f5fa[_0xd9f8('0x39')]=_[_0xd9f8('0x3b')](db[_0xd9f8('0x61')][_0xd9f8('0x35')]);_0x40f5fa[_0xd9f8('0x3a')]=_[_0xd9f8('0x3b')](_0x3a55d0[_0xd9f8('0x3a')]);_0x40f5fa[_0xd9f8('0x3c')]=_['intersection'](_0x40f5fa['model'],_0x40f5fa[_0xd9f8('0x3a')]);_0x51a022[_0xd9f8('0x3f')]=_[_0xd9f8('0x3d')](_0x40f5fa[_0xd9f8('0x39')],qs[_0xd9f8('0x3e')](_0x3a55d0[_0xd9f8('0x3a')][_0xd9f8('0x3e')]));_0x51a022[_0xd9f8('0x3f')]=_0x51a022[_0xd9f8('0x3f')]['length']?_0x51a022[_0xd9f8('0x3f')]:_0x40f5fa['model'];_0x51a022[_0xd9f8('0x42')]=qs[_0xd9f8('0x43')](_0x3a55d0['query'][_0xd9f8('0x43')]);_0x51a022[_0xd9f8('0x46')]=qs[_0xd9f8('0x3c')](_[_0xd9f8('0x44')](_0x3a55d0[_0xd9f8('0x3a')],_0x40f5fa[_0xd9f8('0x3c')]));if(_0x3a55d0['query'][_0xd9f8('0x45')]){_0x51a022[_0xd9f8('0x46')]=_[_0xd9f8('0x47')](_0x51a022[_0xd9f8('0x46')],{'$or':_[_0xd9f8('0x48')](_0x51a022[_0xd9f8('0x3f')],function(_0x120412){var _0x5e850b={};_0x5e850b[_0x120412]={'$like':'%'+_0x3a55d0[_0xd9f8('0x3a')][_0xd9f8('0x45')]+'%'};return _0x5e850b;})});}_0x51a022=_[_0xd9f8('0x47')]({},_0x51a022,_0x3a55d0[_0xd9f8('0x49')]);return _0x5677db[_0xd9f8('0x8b')](_0x51a022);}})[_0xd9f8('0x2a')](function(_0x1f852a){if(_0x1f852a){_0x1a6540=_0x1f852a[_0xd9f8('0x40')];if(!_0x3a55d0[_0xd9f8('0x3a')][_0xd9f8('0x41')](_0xd9f8('0x5f'))){_0x51a022[_0xd9f8('0x23')]=qs[_0xd9f8('0x23')](_0x3a55d0[_0xd9f8('0x3a')]['limit']);_0x51a022['offset']=qs['offset'](_0x3a55d0[_0xd9f8('0x3a')][_0xd9f8('0x22')]);}return _0x5677db[_0xd9f8('0x8b')](_0x51a022);}})['then'](function(_0x2efc7c){if(_0x2efc7c){return _0x2efc7c?{'count':_0x1a6540,'rows':_0x2efc7c}:null;}})['then'](respondWithResult(_0x158ecd,null))[_0xd9f8('0x4f')](handleError(_0x158ecd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b344a78..9c8a081 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 _0x8702=['emit','hook','exports','events','SmsQueue','setMaxListeners','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8702,0x81));var _0x2870=function(_0x5de2fb,_0x455242){_0x5de2fb=_0x5de2fb-0x0;var _0x4800b4=_0x8702[_0x5de2fb];return _0x4800b4;};'use strict';var EventEmitter=require(_0x2870('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x2870('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2870('0x2')](0x0);var events={'afterCreate':_0x2870('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c0617){return function(_0x581d71,_0xbdfda1,_0x2234bc){SmsQueueEvents[_0x2870('0x4')](_0x5c0617+':'+_0x581d71['id'],_0x581d71);SmsQueueEvents['emit'](_0x5c0617,_0x581d71);_0x2234bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2870('0x5')](e,emitEvent(event));}}module[_0x2870('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x0dbb=['emit','hasOwnProperty','hook','exports','setMaxListeners','update','remove'];(function(_0x58c2ee,_0x1b14f6){var _0x31f125=function(_0x57778b){while(--_0x57778b){_0x58c2ee['push'](_0x58c2ee['shift']());}};_0x31f125(++_0x1b14f6);}(_0x0dbb,0x1a1));var _0xb0db=function(_0x27bf44,_0x1155bb){_0x27bf44=_0x27bf44-0x0;var _0x13437b=_0x0dbb[_0x27bf44];return _0x13437b;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb0db('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0db('0x1'),'afterDestroy':_0xb0db('0x2')};function emitEvent(_0x4ef48c){return function(_0x36567f,_0x5ba1e5,_0x2f96e6){SmsQueueEvents[_0xb0db('0x3')](_0x4ef48c+':'+_0x36567f['id'],_0x36567f);SmsQueueEvents[_0xb0db('0x3')](_0x4ef48c,_0x36567f);_0x2f96e6(null);};}for(var e in events){if(events[_0xb0db('0x4')](e)){var event=events[e];SmsQueue[_0xb0db('0x5')](e,emitEvent(event));}}module[_0xb0db('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 60f847f..06517d4 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 _0x69e2=['SmsQueue','sms_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x69e2,0x178));var _0x269e=function(_0x25943b,_0x47441d){_0x25943b=_0x25943b-0x0;var _0x4d3268=_0x69e2[_0x25943b];return _0x4d3268;};'use strict';var _=require(_0x269e('0x0'));var util=require(_0x269e('0x1'));var logger=require(_0x269e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x269e('0x3'));var rp=require(_0x269e('0x4'));var fs=require('fs');var path=require(_0x269e('0x5'));var rimraf=require(_0x269e('0x6'));var config=require(_0x269e('0x7'));var attributes=require('./smsQueue.attributes');module[_0x269e('0x8')]=function(_0x1d12fa,_0x279596){return _0x1d12fa['define'](_0x269e('0x9'),attributes,{'tableName':_0x269e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x500b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_queues','util'];(function(_0x1382dc,_0x2d3b80){var _0x50fbe9=function(_0x44c23b){while(--_0x44c23b){_0x1382dc['push'](_0x1382dc['shift']());}};_0x50fbe9(++_0x2d3b80);}(_0x500b,0x18b));var _0xb500=function(_0x681ca3,_0x19e409){_0x681ca3=_0x681ca3-0x0;var _0x42435d=_0x500b[_0x681ca3];return _0x42435d;};'use strict';var _=require('lodash');var util=require(_0xb500('0x0'));var logger=require(_0xb500('0x1'))(_0xb500('0x2'));var moment=require(_0xb500('0x3'));var BPromise=require(_0xb500('0x4'));var rp=require(_0xb500('0x5'));var fs=require('fs');var path=require(_0xb500('0x6'));var rimraf=require(_0xb500('0x7'));var config=require(_0xb500('0x8'));var attributes=require('./smsQueue.attributes');module[_0xb500('0x9')]=function(_0x4f352e,_0x7d0e2b){return _0x4f352e[_0xb500('0xa')]('SmsQueue',attributes,{'tableName':_0xb500('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 5661751..842cb67 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 _0xd874=['redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','GetSmsQueue','ShowSmsQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x2d2e55,_0x5671a3){var _0x392b56=function(_0x481901){while(--_0x481901){_0x2d2e55['push'](_0x2d2e55['shift']());}};_0x392b56(++_0x5671a3);}(_0xd874,0x1cb));var _0x4d87=function(_0x236d0e,_0x249f8c){_0x236d0e=_0x236d0e-0x0;var _0x78a23c=_0xd874[_0x236d0e];return _0x78a23c;};'use strict';var _=require(_0x4d87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d87('0x1'));var rs=require(_0x4d87('0x2'));var fs=require('fs');var Redis=require(_0x4d87('0x3'));var db=require(_0x4d87('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4d87('0x5'));var jayson=require(_0x4d87('0x6'));var client=jayson[_0x4d87('0x7')][_0x4d87('0x8')]({'port':0x232a});config[_0x4d87('0x9')]=_[_0x4d87('0xa')](config['redis'],{'host':_0x4d87('0xb'),'port':0x18eb});var socket=require(_0x4d87('0xc'))(new Redis(config[_0x4d87('0x9')]));require(_0x4d87('0xd'))[_0x4d87('0xe')](socket);function respondWithRpcPromise(_0xaf977f,_0x25a223,_0x2ac9af){return new BPromise(function(_0x2e520e,_0x19d7de){return client[_0x4d87('0xf')](_0xaf977f,_0x2ac9af)[_0x4d87('0x10')](function(_0x1c5e14){logger[_0x4d87('0x11')](_0x4d87('0x12'),_0x25a223,'request\x20sent');logger[_0x4d87('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x25a223,_0x4d87('0x14'),JSON['stringify'](_0x1c5e14));if(_0x1c5e14[_0x4d87('0x15')]){if(_0x1c5e14[_0x4d87('0x15')]['code']===0x1f4){logger[_0x4d87('0x15')]('SmsQueue,\x20%s,\x20%s',_0x25a223,_0x1c5e14[_0x4d87('0x15')][_0x4d87('0x16')]);return _0x19d7de(_0x1c5e14[_0x4d87('0x15')]['message']);}logger[_0x4d87('0x15')](_0x4d87('0x12'),_0x25a223,_0x1c5e14[_0x4d87('0x15')][_0x4d87('0x16')]);return _0x2e520e(_0x1c5e14[_0x4d87('0x15')]['message']);}else{logger[_0x4d87('0x11')](_0x4d87('0x12'),_0x25a223,'request\x20sent');_0x2e520e(_0x1c5e14[_0x4d87('0x17')][_0x4d87('0x16')]);}})[_0x4d87('0x18')](function(_0x4f233b){logger[_0x4d87('0x15')](_0x4d87('0x12'),_0x25a223,_0x4f233b);_0x19d7de(_0x4f233b);});});}exports['GetSmsQueue']=function(_0x39ffe9){var _0x39b74b=this;return new Promise(function(_0x5d54f1,_0x374a31){return db[_0x4d87('0x19')][_0x4d87('0x1a')]({'raw':_0x39ffe9[_0x4d87('0x1b')]?_0x39ffe9['options'][_0x4d87('0x1c')]===undefined?!![]:![]:!![],'where':_0x39ffe9[_0x4d87('0x1b')]?_0x39ffe9['options'][_0x4d87('0x1d')]||null:null,'attributes':_0x39ffe9[_0x4d87('0x1b')]?_0x39ffe9[_0x4d87('0x1b')][_0x4d87('0x1e')]||null:null,'limit':_0x39ffe9[_0x4d87('0x1b')]?_0x39ffe9[_0x4d87('0x1b')][_0x4d87('0x1f')]||null:null,'include':_0x39ffe9['options']?_0x39ffe9['options']['include']?_[_0x4d87('0x20')](_0x39ffe9[_0x4d87('0x1b')][_0x4d87('0x21')],function(_0x5a11eb){return{'model':db[_0x5a11eb[_0x4d87('0x22')]],'as':_0x5a11eb['as'],'attributes':_0x5a11eb[_0x4d87('0x1e')],'include':_0x5a11eb[_0x4d87('0x21')]?_[_0x4d87('0x20')](_0x5a11eb[_0x4d87('0x21')],function(_0x253ac9){return{'model':db[_0x253ac9[_0x4d87('0x22')]],'as':_0x253ac9['as'],'attributes':_0x253ac9[_0x4d87('0x1e')],'include':_0x253ac9['include']?_['map'](_0x253ac9[_0x4d87('0x21')],function(_0x6cc986){return{'model':db[_0x6cc986[_0x4d87('0x22')]],'as':_0x6cc986['as'],'attributes':_0x6cc986[_0x4d87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x257641){logger[_0x4d87('0x11')]('GetSmsQueue',_0x39ffe9);logger[_0x4d87('0x13')]('GetSmsQueue',_0x39ffe9,JSON[_0x4d87('0x23')](_0x257641));_0x5d54f1(_0x257641);})[_0x4d87('0x18')](function(_0x5757a2){logger['error'](_0x4d87('0x24'),_0x5757a2['message'],_0x39ffe9);_0x374a31(_0x39b74b[_0x4d87('0x15')](0x1f4,_0x5757a2['message']));});});};exports[_0x4d87('0x25')]=function(_0x3139ec){var _0x2b8ceb=this;return new Promise(function(_0x24733e,_0x4edcc3){return db[_0x4d87('0x19')][_0x4d87('0x26')]({'raw':_0x3139ec['options']?_0x3139ec[_0x4d87('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3139ec[_0x4d87('0x1b')]?_0x3139ec[_0x4d87('0x1b')][_0x4d87('0x1d')]||null:null,'attributes':_0x3139ec['options']?_0x3139ec[_0x4d87('0x1b')]['attributes']||null:null,'include':_0x3139ec[_0x4d87('0x1b')]?_0x3139ec[_0x4d87('0x1b')][_0x4d87('0x21')]?_[_0x4d87('0x20')](_0x3139ec['options']['include'],function(_0x4930d4){return{'model':db[_0x4930d4[_0x4d87('0x22')]],'as':_0x4930d4['as'],'attributes':_0x4930d4[_0x4d87('0x1e')],'include':_0x4930d4[_0x4d87('0x21')]?_['map'](_0x4930d4[_0x4d87('0x21')],function(_0x1ecf30){return{'model':db[_0x1ecf30[_0x4d87('0x22')]],'as':_0x1ecf30['as'],'attributes':_0x1ecf30[_0x4d87('0x1e')],'include':_0x1ecf30[_0x4d87('0x21')]?_[_0x4d87('0x20')](_0x1ecf30[_0x4d87('0x21')],function(_0x414e7a){return{'model':db[_0x414e7a[_0x4d87('0x22')]],'as':_0x414e7a['as'],'attributes':_0x414e7a[_0x4d87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4d87('0x10')](function(_0x1a8c26){logger[_0x4d87('0x11')](_0x4d87('0x25'),_0x3139ec);logger[_0x4d87('0x13')](_0x4d87('0x25'),_0x3139ec,JSON[_0x4d87('0x23')](_0x1a8c26));_0x24733e(_0x1a8c26);})[_0x4d87('0x18')](function(_0x3607f5){logger[_0x4d87('0x15')]('ShowSmsQueue',_0x3607f5[_0x4d87('0x16')],_0x3139ec);_0x4edcc3(_0x2b8ceb[_0x4d87('0x15')](0x1f4,_0x3607f5[_0x4d87('0x16')]));});});}; \ No newline at end of file +var _0x22f9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','model','map','debug','catch','ShowSmsQueue','find'];(function(_0x2fc230,_0x1e89d8){var _0x2b2936=function(_0x3b0745){while(--_0x3b0745){_0x2fc230['push'](_0x2fc230['shift']());}};_0x2b2936(++_0x1e89d8);}(_0x22f9,0x1e0));var _0x922f=function(_0x1f64b5,_0x547255){_0x1f64b5=_0x1f64b5-0x0;var _0x1fd769=_0x22f9[_0x1f64b5];return _0x1fd769;};'use strict';var _=require(_0x922f('0x0'));var util=require(_0x922f('0x1'));var moment=require(_0x922f('0x2'));var BPromise=require(_0x922f('0x3'));var rs=require(_0x922f('0x4'));var fs=require('fs');var Redis=require(_0x922f('0x5'));var db=require(_0x922f('0x6'))['db'];var utils=require(_0x922f('0x7'));var logger=require('../../config/logger')(_0x922f('0x8'));var config=require(_0x922f('0x9'));var jayson=require(_0x922f('0xa'));var client=jayson[_0x922f('0xb')][_0x922f('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x922f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x922f('0xd')]));require(_0x922f('0xe'))[_0x922f('0xf')](socket);function respondWithRpcPromise(_0x33ddb5,_0x20356a,_0x3df6cc){return new BPromise(function(_0x320782,_0x3de89b){return client[_0x922f('0x10')](_0x33ddb5,_0x3df6cc)[_0x922f('0x11')](function(_0x439bbd){logger['info'](_0x922f('0x12'),_0x20356a,_0x922f('0x13'));logger['debug'](_0x922f('0x14'),_0x20356a,'request\x20sent',JSON[_0x922f('0x15')](_0x439bbd));if(_0x439bbd[_0x922f('0x16')]){if(_0x439bbd[_0x922f('0x16')][_0x922f('0x17')]===0x1f4){logger['error'](_0x922f('0x12'),_0x20356a,_0x439bbd[_0x922f('0x16')][_0x922f('0x18')]);return _0x3de89b(_0x439bbd[_0x922f('0x16')][_0x922f('0x18')]);}logger[_0x922f('0x16')](_0x922f('0x12'),_0x20356a,_0x439bbd[_0x922f('0x16')][_0x922f('0x18')]);return _0x320782(_0x439bbd[_0x922f('0x16')][_0x922f('0x18')]);}else{logger[_0x922f('0x19')](_0x922f('0x12'),_0x20356a,_0x922f('0x13'));_0x320782(_0x439bbd['result']['message']);}})['catch'](function(_0x3d7cc2){logger[_0x922f('0x16')](_0x922f('0x12'),_0x20356a,_0x3d7cc2);_0x3de89b(_0x3d7cc2);});});}exports[_0x922f('0x1a')]=function(_0x55fa09){var _0x59bae1=this;return new Promise(function(_0x51960e,_0x5c3e09){return db[_0x922f('0x1b')]['findAll']({'raw':_0x55fa09[_0x922f('0x1c')]?_0x55fa09['options'][_0x922f('0x1d')]===undefined?!![]:![]:!![],'where':_0x55fa09[_0x922f('0x1c')]?_0x55fa09[_0x922f('0x1c')][_0x922f('0x1e')]||null:null,'attributes':_0x55fa09[_0x922f('0x1c')]?_0x55fa09['options'][_0x922f('0x1f')]||null:null,'limit':_0x55fa09[_0x922f('0x1c')]?_0x55fa09[_0x922f('0x1c')][_0x922f('0x20')]||null:null,'include':_0x55fa09[_0x922f('0x1c')]?_0x55fa09[_0x922f('0x1c')]['include']?_['map'](_0x55fa09[_0x922f('0x1c')][_0x922f('0x21')],function(_0x5ca0a8){return{'model':db[_0x5ca0a8[_0x922f('0x22')]],'as':_0x5ca0a8['as'],'attributes':_0x5ca0a8[_0x922f('0x1f')],'include':_0x5ca0a8[_0x922f('0x21')]?_[_0x922f('0x23')](_0x5ca0a8['include'],function(_0x359cfb){return{'model':db[_0x359cfb[_0x922f('0x22')]],'as':_0x359cfb['as'],'attributes':_0x359cfb[_0x922f('0x1f')],'include':_0x359cfb[_0x922f('0x21')]?_[_0x922f('0x23')](_0x359cfb[_0x922f('0x21')],function(_0x5cad47){return{'model':db[_0x5cad47[_0x922f('0x22')]],'as':_0x5cad47['as'],'attributes':_0x5cad47[_0x922f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x922f('0x11')](function(_0x11f738){logger[_0x922f('0x19')](_0x922f('0x1a'),_0x55fa09);logger[_0x922f('0x24')](_0x922f('0x1a'),_0x55fa09,JSON['stringify'](_0x11f738));_0x51960e(_0x11f738);})[_0x922f('0x25')](function(_0x361163){logger['error'](_0x922f('0x1a'),_0x361163[_0x922f('0x18')],_0x55fa09);_0x5c3e09(_0x59bae1[_0x922f('0x16')](0x1f4,_0x361163['message']));});});};exports[_0x922f('0x26')]=function(_0x267137){var _0x44bda6=this;return new Promise(function(_0x3c196f,_0x345cf3){return db['SmsQueue'][_0x922f('0x27')]({'raw':_0x267137[_0x922f('0x1c')]?_0x267137[_0x922f('0x1c')][_0x922f('0x1d')]===undefined?!![]:![]:!![],'where':_0x267137[_0x922f('0x1c')]?_0x267137[_0x922f('0x1c')]['where']||null:null,'attributes':_0x267137[_0x922f('0x1c')]?_0x267137[_0x922f('0x1c')][_0x922f('0x1f')]||null:null,'include':_0x267137[_0x922f('0x1c')]?_0x267137[_0x922f('0x1c')][_0x922f('0x21')]?_[_0x922f('0x23')](_0x267137[_0x922f('0x1c')][_0x922f('0x21')],function(_0x3cf790){return{'model':db[_0x3cf790[_0x922f('0x22')]],'as':_0x3cf790['as'],'attributes':_0x3cf790[_0x922f('0x1f')],'include':_0x3cf790[_0x922f('0x21')]?_[_0x922f('0x23')](_0x3cf790[_0x922f('0x21')],function(_0x185c40){return{'model':db[_0x185c40[_0x922f('0x22')]],'as':_0x185c40['as'],'attributes':_0x185c40[_0x922f('0x1f')],'include':_0x185c40[_0x922f('0x21')]?_['map'](_0x185c40[_0x922f('0x21')],function(_0x546f48){return{'model':db[_0x546f48[_0x922f('0x22')]],'as':_0x546f48['as'],'attributes':_0x546f48[_0x922f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4da006){logger['info'](_0x922f('0x26'),_0x267137);logger[_0x922f('0x24')](_0x922f('0x26'),_0x267137,JSON[_0x922f('0x15')](_0x4da006));_0x3c196f(_0x4da006);})[_0x922f('0x25')](function(_0x381bba){logger[_0x922f('0x16')](_0x922f('0x26'),_0x381bba[_0x922f('0x18')],_0x267137);_0x345cf3(_0x44bda6[_0x922f('0x16')](0x1f4,_0x381bba[_0x922f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d1464a0..3a9e7ed 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 _0x8f85=['remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x358d62,_0x34cda5){var _0x2f7801=function(_0x3190a3){while(--_0x3190a3){_0x358d62['push'](_0x358d62['shift']());}};_0x2f7801(++_0x34cda5);}(_0x8f85,0x85));var _0x58f8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f85[_0x2641f9];return _0x585741;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x58f8('0x0'),_0x58f8('0x1')];function createListener(_0x4d67c5,_0x482fd1){return function(_0x49206f){_0x482fd1[_0x58f8('0x2')](_0x4d67c5,_0x49206f);};}function removeListener(_0x45bc37,_0x117c30){return function(){SmsQueueEvents[_0x58f8('0x3')](_0x45bc37,_0x117c30);};}exports[_0x58f8('0x4')]=function(_0x5e2b4d){for(var _0x1a6f18=0x0,_0xa6aaa7=events[_0x58f8('0x5')];_0x1a6f18<_0xa6aaa7;_0x1a6f18++){var _0xeadf23=events[_0x1a6f18];var _0x39a580=createListener(_0x58f8('0x6')+_0xeadf23,_0x5e2b4d);SmsQueueEvents['on'](_0xeadf23,_0x39a580);}}; \ No newline at end of file +var _0xea9f=['remove','update','removeListener','register','length','smsQueue:','save'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xea9f,0x1b1));var _0xfea9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xea9f[_0xa148b7];return _0x51efd3;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xfea9('0x0'),_0xfea9('0x1'),_0xfea9('0x2')];function createListener(_0x22248c,_0x419e07){return function(_0x4313fa){_0x419e07['emit'](_0x22248c,_0x4313fa);};}function removeListener(_0x1e0988,_0x134c57){return function(){SmsQueueEvents[_0xfea9('0x3')](_0x1e0988,_0x134c57);};}exports[_0xfea9('0x4')]=function(_0x5da101){for(var _0x5468d8=0x0,_0x220a23=events[_0xfea9('0x5')];_0x5468d8<_0x220a23;_0x5468d8++){var _0x59002e=events[_0x5468d8];var _0x3f0fad=createListener(_0xfea9('0x6')+_0x59002e,_0x5da101);SmsQueueEvents['on'](_0x59002e,_0x3f0fad);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ecdda82..f3d2cdd 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 _0x0fc5=['put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0fc5,0x6c));var _0x50fc=function(_0x33e210,_0x956c83){_0x33e210=_0x33e210-0x0;var _0x2d3bc1=_0x0fc5[_0x33e210];return _0x2d3bc1;};'use strict';var multer=require(_0x50fc('0x0'));var util=require(_0x50fc('0x1'));var path=require(_0x50fc('0x2'));var timeout=require(_0x50fc('0x3'));var express=require(_0x50fc('0x4'));var router=express[_0x50fc('0x5')]();var fs_extra=require(_0x50fc('0x6'));var auth=require(_0x50fc('0x7'));var interaction=require(_0x50fc('0x8'));var config=require(_0x50fc('0x9'));var controller=require(_0x50fc('0xa'));router[_0x50fc('0xb')]('/',auth['isAuthenticated'](),controller[_0x50fc('0xc')]);router[_0x50fc('0xb')](_0x50fc('0xd'),auth[_0x50fc('0xe')](),controller[_0x50fc('0xf')]);router['get'](_0x50fc('0x10'),auth[_0x50fc('0xe')](),controller['show']);router[_0x50fc('0x11')]('/',auth[_0x50fc('0xe')](),controller['create']);router[_0x50fc('0x12')](_0x50fc('0x10'),auth[_0x50fc('0xe')](),controller['update']);router[_0x50fc('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x50fc('0x14')]=router; \ No newline at end of file +var _0x1e6c=['describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x962edb,_0x5dd356){var _0x359dcf=function(_0x978f40){while(--_0x978f40){_0x962edb['push'](_0x962edb['shift']());}};_0x359dcf(++_0x5dd356);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x158ab3,_0x4b5908){_0x158ab3=_0x158ab3-0x0;var _0x302830=_0x1e6c[_0x158ab3];return _0x302830;};'use strict';var multer=require(_0xc1e6('0x0'));var util=require('util');var path=require(_0xc1e6('0x1'));var timeout=require(_0xc1e6('0x2'));var express=require(_0xc1e6('0x3'));var router=express[_0xc1e6('0x4')]();var fs_extra=require(_0xc1e6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc1e6('0x6'));var controller=require(_0xc1e6('0x7'));router[_0xc1e6('0x8')]('/',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0xa')]);router[_0xc1e6('0x8')](_0xc1e6('0xb'),auth['isAuthenticated'](),controller[_0xc1e6('0xc')]);router['get'](_0xc1e6('0xd'),auth['isAuthenticated'](),controller[_0xc1e6('0xe')]);router[_0xc1e6('0xf')]('/',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0x10')]);router['put']('/:id',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0x11')]);router[_0xc1e6('0x12')]('/:id',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0x13')]);module[_0xc1e6('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 44b98de..cdf430f 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 _0x4fb3=['DATE','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4fb3,0xbd));var _0x34fb=function(_0x47b612,_0x442548){_0x47b612=_0x47b612-0x0;var _0x50c486=_0x4fb3[_0x47b612];return _0x50c486;};'use strict';var moment=require('moment');var Sequelize=require(_0x34fb('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x34fb('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa0dd=['moment','sequelize','STRING','DATE'];(function(_0xc0b7f7,_0x3eb5e5){var _0x48ab14=function(_0x51d6a0){while(--_0x51d6a0){_0xc0b7f7['push'](_0xc0b7f7['shift']());}};_0x48ab14(++_0x3eb5e5);}(_0xa0dd,0xc0));var _0xda0d=function(_0x332193,_0x13605a){_0x332193=_0x332193-0x0;var _0x16b8ab=_0xa0dd[_0x332193];return _0x16b8ab;};'use strict';var moment=require(_0xda0d('0x0'));var Sequelize=require(_0xda0d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xda0d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xda0d('0x2')]},'joinAt':{'type':Sequelize[_0xda0d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xda0d('0x3')]},'reason':{'type':Sequelize[_0xda0d('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 9cb3862..e08a710 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 _0xf45c=['fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','SmsQueueReport','include','rows','catch','show','params','keys','fields','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xf45c,0x131));var _0xcf45=function(_0x101d65,_0x2e9ffc){_0x101d65=_0x101d65-0x0;var _0x12de09=_0xf45c[_0x101d65];return _0x12de09;};'use strict';var emlformat=require(_0xcf45('0x0'));var rimraf=require(_0xcf45('0x1'));var zipdir=require(_0xcf45('0x2'));var jsonpatch=require(_0xcf45('0x3'));var rp=require('request-promise');var moment=require(_0xcf45('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf45('0x5'));var util=require(_0xcf45('0x6'));var path=require(_0xcf45('0x7'));var sox=require(_0xcf45('0x8'));var csv=require(_0xcf45('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf45('0xa'));var _=require('lodash');var squel=require(_0xcf45('0xb'));var crypto=require(_0xcf45('0xc'));var jsforce=require(_0xcf45('0xd'));var deskjs=require(_0xcf45('0xe'));var toCsv=require(_0xcf45('0x9'));var querystring=require(_0xcf45('0xf'));var Papa=require(_0xcf45('0x10'));var Redis=require(_0xcf45('0x11'));var authService=require(_0xcf45('0x12'));var qs=require(_0xcf45('0x13'));var as=require(_0xcf45('0x14'));var hardwareService=require(_0xcf45('0x15'));var logger=require(_0xcf45('0x16'))(_0xcf45('0x17'));var utils=require(_0xcf45('0x18'));var config=require(_0xcf45('0x19'));var licenseUtil=require(_0xcf45('0x1a'));var db=require(_0xcf45('0x1b'))['db'];function respondWithStatusCode(_0x299561,_0x202131){_0x202131=_0x202131||0xcc;return function(_0x2c993c){if(_0x2c993c){return _0x299561[_0xcf45('0x1c')](_0x202131);}return _0x299561['status'](_0x202131)[_0xcf45('0x1d')]();};}function respondWithResult(_0x2f8b3f,_0x505fd0){_0x505fd0=_0x505fd0||0xc8;return function(_0x5447a2){if(_0x5447a2){return _0x2f8b3f['status'](_0x505fd0)[_0xcf45('0x1e')](_0x5447a2);}};}function respondWithFilteredResult(_0x458f3d,_0xc664f9){return function(_0x59143f){if(_0x59143f){var _0x2d1300=typeof _0xc664f9[_0xcf45('0x1f')]===_0xcf45('0x20')&&typeof _0xc664f9[_0xcf45('0x21')]===_0xcf45('0x20');var _0x20b561=_0x59143f[_0xcf45('0x22')];var _0x20efde=_0x2d1300?0x0:_0xc664f9['offset'];var _0x2418cf=_0x2d1300?_0x59143f['count']:_0xc664f9['offset']+_0xc664f9[_0xcf45('0x21')];var _0x3c55ce;if(_0x2418cf>=_0x20b561){_0x2418cf=_0x20b561;_0x3c55ce=0xc8;}else{_0x3c55ce=0xce;}_0x458f3d[_0xcf45('0x23')](_0x3c55ce);return _0x458f3d['set'](_0xcf45('0x24'),_0x20efde+'-'+_0x2418cf+'/'+_0x20b561)[_0xcf45('0x1e')](_0x59143f);}return null;};}function patchUpdates(_0x4eea10){return function(_0x1111f9){try{jsonpatch[_0xcf45('0x25')](_0x1111f9,_0x4eea10,!![]);}catch(_0x145c9d){return BPromise[_0xcf45('0x26')](_0x145c9d);}return _0x1111f9['save']();};}function saveUpdates(_0x1d988a,_0x160b05){return function(_0x550dcc){if(_0x550dcc){return _0x550dcc[_0xcf45('0x27')](_0x1d988a)[_0xcf45('0x28')](function(_0x53f47f){return _0x53f47f;});}return null;};}function removeEntity(_0x402bac,_0x2e688f){return function(_0x9c9360){if(_0x9c9360){return _0x9c9360[_0xcf45('0x29')]()[_0xcf45('0x28')](function(){_0x402bac[_0xcf45('0x23')](0xcc)[_0xcf45('0x1d')]();});}};}function handleEntityNotFound(_0x82358,_0x4b573b){return function(_0x557ae9){if(!_0x557ae9){_0x82358[_0xcf45('0x1c')](0x194);}return _0x557ae9;};}function handleError(_0x5a998a,_0x34c4f2){_0x34c4f2=_0x34c4f2||0x1f4;return function(_0x29668a){logger['error'](_0x29668a[_0xcf45('0x2a')]);if(_0x29668a[_0xcf45('0x2b')]){delete _0x29668a[_0xcf45('0x2b')];}_0x5a998a[_0xcf45('0x23')](_0x34c4f2)[_0xcf45('0x2c')](_0x29668a);};}exports['index']=function(_0x121a89,_0x23801f){var _0xf83179={},_0x2b55db={},_0xefbe27={'count':0x0,'rows':[]};var _0x3d91a3=_[_0xcf45('0x2d')](db['SmsQueueReport'][_0xcf45('0x2e')],function(_0x1b9d26){return{'name':_0x1b9d26[_0xcf45('0x2f')],'type':_0x1b9d26[_0xcf45('0x30')][_0xcf45('0x31')]};});_0x2b55db[_0xcf45('0x32')]=_[_0xcf45('0x2d')](_0x3d91a3,_0xcf45('0x2b'));_0x2b55db[_0xcf45('0x33')]=_['keys'](_0x121a89['query']);_0x2b55db[_0xcf45('0x34')]=_[_0xcf45('0x35')](_0x2b55db[_0xcf45('0x32')],_0x2b55db[_0xcf45('0x33')]);_0xf83179['attributes']=_['intersection'](_0x2b55db[_0xcf45('0x32')],qs['fields'](_0x121a89['query']['fields']));_0xf83179[_0xcf45('0x36')]=_0xf83179[_0xcf45('0x36')][_0xcf45('0x37')]?_0xf83179[_0xcf45('0x36')]:_0x2b55db[_0xcf45('0x32')];if(!_0x121a89[_0xcf45('0x33')][_0xcf45('0x38')](_0xcf45('0x39'))){_0xf83179[_0xcf45('0x21')]=qs['limit'](_0x121a89[_0xcf45('0x33')][_0xcf45('0x21')]);_0xf83179[_0xcf45('0x1f')]=qs['offset'](_0x121a89['query']['offset']);}_0xf83179[_0xcf45('0x3a')]=qs[_0xcf45('0x3b')](_0x121a89['query'][_0xcf45('0x3b')]);_0xf83179['where']=qs[_0xcf45('0x34')](_['pick'](_0x121a89[_0xcf45('0x33')],_0x2b55db[_0xcf45('0x34')]),_0x3d91a3);if(_0x121a89[_0xcf45('0x33')][_0xcf45('0x3c')]){_0xf83179[_0xcf45('0x3d')]=_[_0xcf45('0x3e')](_0xf83179['where'],{'$or':_[_0xcf45('0x2d')](_0x3d91a3,function(_0x18fc30){if(_0x18fc30[_0xcf45('0x30')]!=='VIRTUAL'){var _0x424f6a={};_0x424f6a[_0x18fc30[_0xcf45('0x2b')]]={'$like':'%'+_0x121a89[_0xcf45('0x33')]['filter']+'%'};return _0x424f6a;}})});}_0xf83179=_[_0xcf45('0x3e')]({},_0xf83179,_0x121a89[_0xcf45('0x3f')]);var _0x466acc={'where':_0xf83179[_0xcf45('0x3d')]};return db[_0xcf45('0x40')]['count'](_0x466acc)['then'](function(_0x4297ee){_0xefbe27[_0xcf45('0x22')]=_0x4297ee;if(_0x121a89[_0xcf45('0x33')]['includeAll']){_0xf83179[_0xcf45('0x41')]=[{'all':!![]}];}return db[_0xcf45('0x40')]['findAll'](_0xf83179);})[_0xcf45('0x28')](function(_0x44b995){_0xefbe27[_0xcf45('0x42')]=_0x44b995;return _0xefbe27;})[_0xcf45('0x28')](respondWithFilteredResult(_0x23801f,_0xf83179))[_0xcf45('0x43')](handleError(_0x23801f,null));};exports[_0xcf45('0x44')]=function(_0x4d507b,_0x4e4172){var _0x45f6a9={'raw':!![],'where':{'id':_0x4d507b[_0xcf45('0x45')]['id']}},_0x57d175={};_0x57d175[_0xcf45('0x32')]=_[_0xcf45('0x46')](db[_0xcf45('0x40')][_0xcf45('0x2e')]);_0x57d175[_0xcf45('0x33')]=_[_0xcf45('0x46')](_0x4d507b[_0xcf45('0x33')]);_0x57d175[_0xcf45('0x34')]=_[_0xcf45('0x35')](_0x57d175[_0xcf45('0x32')],_0x57d175[_0xcf45('0x33')]);_0x45f6a9[_0xcf45('0x36')]=_['intersection'](_0x57d175[_0xcf45('0x32')],qs[_0xcf45('0x47')](_0x4d507b[_0xcf45('0x33')]['fields']));_0x45f6a9[_0xcf45('0x36')]=_0x45f6a9[_0xcf45('0x36')][_0xcf45('0x37')]?_0x45f6a9[_0xcf45('0x36')]:_0x57d175[_0xcf45('0x32')];if(_0x4d507b[_0xcf45('0x33')][_0xcf45('0x48')]){_0x45f6a9[_0xcf45('0x41')]=[{'all':!![]}];}_0x45f6a9=_[_0xcf45('0x3e')]({},_0x45f6a9,_0x4d507b['options']);return db[_0xcf45('0x40')][_0xcf45('0x49')](_0x45f6a9)[_0xcf45('0x28')](handleEntityNotFound(_0x4e4172,null))[_0xcf45('0x28')](respondWithResult(_0x4e4172,null))[_0xcf45('0x43')](handleError(_0x4e4172,null));};exports[_0xcf45('0x4a')]=function(_0xec86a8,_0x1220f1){return db[_0xcf45('0x40')]['create'](_0xec86a8[_0xcf45('0x4b')],{})[_0xcf45('0x28')](respondWithResult(_0x1220f1,0xc9))['catch'](handleError(_0x1220f1,null));};exports[_0xcf45('0x27')]=function(_0x54f292,_0x25a8f1){if(_0x54f292[_0xcf45('0x4b')]['id']){delete _0x54f292[_0xcf45('0x4b')]['id'];}return db[_0xcf45('0x40')][_0xcf45('0x49')]({'where':{'id':_0x54f292[_0xcf45('0x45')]['id']}})[_0xcf45('0x28')](handleEntityNotFound(_0x25a8f1,null))['then'](saveUpdates(_0x54f292[_0xcf45('0x4b')],null))['then'](respondWithResult(_0x25a8f1,null))['catch'](handleError(_0x25a8f1,null));};exports[_0xcf45('0x29')]=function(_0x493dd0,_0x3e6de9){return db[_0xcf45('0x40')]['find']({'where':{'id':_0x493dd0[_0xcf45('0x45')]['id']}})[_0xcf45('0x28')](handleEntityNotFound(_0x3e6de9,null))[_0xcf45('0x28')](removeEntity(_0x3e6de9,null))[_0xcf45('0x43')](handleError(_0x3e6de9,null));};exports[_0xcf45('0x4c')]=function(_0x51f857,_0x47930b){return db[_0xcf45('0x40')][_0xcf45('0x4c')]()[_0xcf45('0x28')](respondWithResult(_0x47930b,null))[_0xcf45('0x43')](handleError(_0x47930b,null));}; \ No newline at end of file +var _0x825e=['query','filters','attributes','fields','length','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','intersection','find','create','body','catch','describe','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','index','map','SmsQueueReport','model','keys'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x825e,0xa6));var _0xe825=function(_0x3768fc,_0x382fe6){_0x3768fc=_0x3768fc-0x0;var _0x175a45=_0x825e[_0x3768fc];return _0x175a45;};'use strict';var emlformat=require(_0xe825('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe825('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe825('0x2'));var BPromise=require(_0xe825('0x3'));var Mustache=require(_0xe825('0x4'));var util=require(_0xe825('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe825('0x6'));var ejs=require(_0xe825('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe825('0x8'));var squel=require(_0xe825('0x9'));var crypto=require(_0xe825('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe825('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe825('0xc'));var Redis=require(_0xe825('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe825('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe825('0xf'));var logger=require(_0xe825('0x10'))(_0xe825('0x11'));var utils=require(_0xe825('0x12'));var config=require(_0xe825('0x13'));var licenseUtil=require(_0xe825('0x14'));var db=require(_0xe825('0x15'))['db'];function respondWithStatusCode(_0x1540e4,_0x2be5be){_0x2be5be=_0x2be5be||0xcc;return function(_0x255e61){if(_0x255e61){return _0x1540e4[_0xe825('0x16')](_0x2be5be);}return _0x1540e4['status'](_0x2be5be)[_0xe825('0x17')]();};}function respondWithResult(_0x4940f4,_0x672b01){_0x672b01=_0x672b01||0xc8;return function(_0x7b205c){if(_0x7b205c){return _0x4940f4[_0xe825('0x18')](_0x672b01)[_0xe825('0x19')](_0x7b205c);}};}function respondWithFilteredResult(_0x9e402b,_0x10124d){return function(_0x96d0ee){if(_0x96d0ee){var _0x245a29=typeof _0x10124d[_0xe825('0x1a')]===_0xe825('0x1b')&&typeof _0x10124d['limit']===_0xe825('0x1b');var _0x2e0097=_0x96d0ee[_0xe825('0x1c')];var _0x2a86a1=_0x245a29?0x0:_0x10124d[_0xe825('0x1a')];var _0x3aa272=_0x245a29?_0x96d0ee[_0xe825('0x1c')]:_0x10124d[_0xe825('0x1a')]+_0x10124d[_0xe825('0x1d')];var _0x78fe67;if(_0x3aa272>=_0x2e0097){_0x3aa272=_0x2e0097;_0x78fe67=0xc8;}else{_0x78fe67=0xce;}_0x9e402b[_0xe825('0x18')](_0x78fe67);return _0x9e402b[_0xe825('0x1e')]('Content-Range',_0x2a86a1+'-'+_0x3aa272+'/'+_0x2e0097)[_0xe825('0x19')](_0x96d0ee);}return null;};}function patchUpdates(_0x5745ce){return function(_0xf8175f){try{jsonpatch['apply'](_0xf8175f,_0x5745ce,!![]);}catch(_0x1a2116){return BPromise[_0xe825('0x1f')](_0x1a2116);}return _0xf8175f[_0xe825('0x20')]();};}function saveUpdates(_0x5d0d02,_0x8ab494){return function(_0x316063){if(_0x316063){return _0x316063[_0xe825('0x21')](_0x5d0d02)[_0xe825('0x22')](function(_0x5513a7){return _0x5513a7;});}return null;};}function removeEntity(_0x19728c,_0x3f7384){return function(_0x2b25db){if(_0x2b25db){return _0x2b25db[_0xe825('0x23')]()['then'](function(){_0x19728c[_0xe825('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3088cb,_0x5d30f8){return function(_0x36aad1){if(!_0x36aad1){_0x3088cb[_0xe825('0x16')](0x194);}return _0x36aad1;};}function handleError(_0x4e0066,_0x209361){_0x209361=_0x209361||0x1f4;return function(_0x9cec3b){logger[_0xe825('0x24')](_0x9cec3b[_0xe825('0x25')]);if(_0x9cec3b[_0xe825('0x26')]){delete _0x9cec3b[_0xe825('0x26')];}_0x4e0066['status'](_0x209361)['send'](_0x9cec3b);};}exports[_0xe825('0x27')]=function(_0x5d493d,_0x263a02){var _0x43f4bd={},_0x135045={},_0x33bed3={'count':0x0,'rows':[]};var _0x8abc4f=_[_0xe825('0x28')](db[_0xe825('0x29')]['rawAttributes'],function(_0x11c6a1){return{'name':_0x11c6a1['fieldName'],'type':_0x11c6a1['type']['key']};});_0x135045[_0xe825('0x2a')]=_[_0xe825('0x28')](_0x8abc4f,'name');_0x135045['query']=_[_0xe825('0x2b')](_0x5d493d[_0xe825('0x2c')]);_0x135045[_0xe825('0x2d')]=_['intersection'](_0x135045['model'],_0x135045[_0xe825('0x2c')]);_0x43f4bd[_0xe825('0x2e')]=_['intersection'](_0x135045[_0xe825('0x2a')],qs[_0xe825('0x2f')](_0x5d493d['query'][_0xe825('0x2f')]));_0x43f4bd[_0xe825('0x2e')]=_0x43f4bd[_0xe825('0x2e')][_0xe825('0x30')]?_0x43f4bd['attributes']:_0x135045[_0xe825('0x2a')];if(!_0x5d493d['query']['hasOwnProperty'](_0xe825('0x31'))){_0x43f4bd['limit']=qs['limit'](_0x5d493d[_0xe825('0x2c')][_0xe825('0x1d')]);_0x43f4bd[_0xe825('0x1a')]=qs['offset'](_0x5d493d[_0xe825('0x2c')][_0xe825('0x1a')]);}_0x43f4bd[_0xe825('0x32')]=qs[_0xe825('0x33')](_0x5d493d[_0xe825('0x2c')][_0xe825('0x33')]);_0x43f4bd[_0xe825('0x34')]=qs[_0xe825('0x2d')](_[_0xe825('0x35')](_0x5d493d[_0xe825('0x2c')],_0x135045[_0xe825('0x2d')]),_0x8abc4f);if(_0x5d493d[_0xe825('0x2c')]['filter']){_0x43f4bd[_0xe825('0x34')]=_['merge'](_0x43f4bd[_0xe825('0x34')],{'$or':_[_0xe825('0x28')](_0x8abc4f,function(_0x71ee79){if(_0x71ee79[_0xe825('0x36')]!=='VIRTUAL'){var _0x2e0559={};_0x2e0559[_0x71ee79['name']]={'$like':'%'+_0x5d493d[_0xe825('0x2c')][_0xe825('0x37')]+'%'};return _0x2e0559;}})});}_0x43f4bd=_[_0xe825('0x38')]({},_0x43f4bd,_0x5d493d[_0xe825('0x39')]);var _0x5cf615={'where':_0x43f4bd[_0xe825('0x34')]};return db[_0xe825('0x29')][_0xe825('0x1c')](_0x5cf615)['then'](function(_0x52ea81){_0x33bed3[_0xe825('0x1c')]=_0x52ea81;if(_0x5d493d[_0xe825('0x2c')][_0xe825('0x3a')]){_0x43f4bd[_0xe825('0x3b')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xe825('0x3c')](_0x43f4bd);})[_0xe825('0x22')](function(_0x2cbad4){_0x33bed3['rows']=_0x2cbad4;return _0x33bed3;})[_0xe825('0x22')](respondWithFilteredResult(_0x263a02,_0x43f4bd))['catch'](handleError(_0x263a02,null));};exports[_0xe825('0x3d')]=function(_0x101397,_0x268232){var _0x1a7c90={'raw':!![],'where':{'id':_0x101397[_0xe825('0x3e')]['id']}},_0x5293b7={};_0x5293b7[_0xe825('0x2a')]=_[_0xe825('0x2b')](db[_0xe825('0x29')][_0xe825('0x3f')]);_0x5293b7[_0xe825('0x2c')]=_[_0xe825('0x2b')](_0x101397[_0xe825('0x2c')]);_0x5293b7[_0xe825('0x2d')]=_[_0xe825('0x40')](_0x5293b7[_0xe825('0x2a')],_0x5293b7['query']);_0x1a7c90[_0xe825('0x2e')]=_[_0xe825('0x40')](_0x5293b7[_0xe825('0x2a')],qs['fields'](_0x101397[_0xe825('0x2c')][_0xe825('0x2f')]));_0x1a7c90[_0xe825('0x2e')]=_0x1a7c90['attributes'][_0xe825('0x30')]?_0x1a7c90[_0xe825('0x2e')]:_0x5293b7[_0xe825('0x2a')];if(_0x101397[_0xe825('0x2c')][_0xe825('0x3a')]){_0x1a7c90[_0xe825('0x3b')]=[{'all':!![]}];}_0x1a7c90=_[_0xe825('0x38')]({},_0x1a7c90,_0x101397[_0xe825('0x39')]);return db[_0xe825('0x29')][_0xe825('0x41')](_0x1a7c90)[_0xe825('0x22')](handleEntityNotFound(_0x268232,null))[_0xe825('0x22')](respondWithResult(_0x268232,null))['catch'](handleError(_0x268232,null));};exports[_0xe825('0x42')]=function(_0x4f5b1e,_0x2d4ccc){return db['SmsQueueReport'][_0xe825('0x42')](_0x4f5b1e[_0xe825('0x43')],{})[_0xe825('0x22')](respondWithResult(_0x2d4ccc,0xc9))['catch'](handleError(_0x2d4ccc,null));};exports[_0xe825('0x21')]=function(_0x49355e,_0x1a6a05){if(_0x49355e[_0xe825('0x43')]['id']){delete _0x49355e[_0xe825('0x43')]['id'];}return db[_0xe825('0x29')]['find']({'where':{'id':_0x49355e[_0xe825('0x3e')]['id']}})[_0xe825('0x22')](handleEntityNotFound(_0x1a6a05,null))[_0xe825('0x22')](saveUpdates(_0x49355e[_0xe825('0x43')],null))[_0xe825('0x22')](respondWithResult(_0x1a6a05,null))[_0xe825('0x44')](handleError(_0x1a6a05,null));};exports[_0xe825('0x23')]=function(_0x2b2799,_0x29f358){return db[_0xe825('0x29')][_0xe825('0x41')]({'where':{'id':_0x2b2799[_0xe825('0x3e')]['id']}})[_0xe825('0x22')](handleEntityNotFound(_0x29f358,null))['then'](removeEntity(_0x29f358,null))[_0xe825('0x44')](handleError(_0x29f358,null));};exports[_0xe825('0x45')]=function(_0x557835,_0x1a8f36){return db[_0xe825('0x29')][_0xe825('0x45')]()[_0xe825('0x22')](respondWithResult(_0x1a8f36,null))[_0xe825('0x44')](handleError(_0x1a8f36,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9a31366..03ae962 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x518c4a,_0x2916e1){var _0x4d803f=function(_0x169bbe){while(--_0x169bbe){_0x518c4a['push'](_0x518c4a['shift']());}};_0x4d803f(++_0x2916e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xcb91[_0x1b64dd];return _0xeb464c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x4b418f,_0x3b6a96){var _0x2ed208=function(_0x5bb29b){while(--_0x5bb29b){_0x4b418f['push'](_0x4b418f['shift']());}};_0x2ed208(++_0x3b6a96);}(_0xe706,0xa3));var _0x6e70=function(_0x23dda5,_0x221860){_0x23dda5=_0x23dda5-0x0;var _0x32c24e=_0xe706[_0x23dda5];return _0x32c24e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index d80994f..96ce733 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 _0x1f2d=['options','raw','SmsQueueReport','body','attributes','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','create'];(function(_0x4aed48,_0x13449b){var _0x5152cc=function(_0x10cc76){while(--_0x10cc76){_0x4aed48['push'](_0x4aed48['shift']());}};_0x5152cc(++_0x13449b);}(_0x1f2d,0xed));var _0xd1f2=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x1f2d[_0x373dee];return _0x46798f;};'use strict';var _=require(_0xd1f2('0x0'));var util=require(_0xd1f2('0x1'));var moment=require(_0xd1f2('0x2'));var BPromise=require('bluebird');var rs=require(_0xd1f2('0x3'));var fs=require('fs');var Redis=require(_0xd1f2('0x4'));var db=require(_0xd1f2('0x5'))['db'];var utils=require(_0xd1f2('0x6'));var logger=require(_0xd1f2('0x7'))(_0xd1f2('0x8'));var config=require(_0xd1f2('0x9'));var jayson=require(_0xd1f2('0xa'));var client=jayson[_0xd1f2('0xb')][_0xd1f2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8d2e22,_0x508292,_0x17f619){return new BPromise(function(_0x1df05e,_0x579d9b){return client[_0xd1f2('0xd')](_0x8d2e22,_0x17f619)[_0xd1f2('0xe')](function(_0x3ce2b4){logger[_0xd1f2('0xf')](_0xd1f2('0x10'),_0x508292,_0xd1f2('0x11'));logger[_0xd1f2('0x12')](_0xd1f2('0x13'),_0x508292,'request\x20sent',JSON[_0xd1f2('0x14')](_0x3ce2b4));if(_0x3ce2b4['error']){if(_0x3ce2b4[_0xd1f2('0x15')]['code']===0x1f4){logger[_0xd1f2('0x15')](_0xd1f2('0x10'),_0x508292,_0x3ce2b4[_0xd1f2('0x15')][_0xd1f2('0x16')]);return _0x579d9b(_0x3ce2b4[_0xd1f2('0x15')][_0xd1f2('0x16')]);}logger[_0xd1f2('0x15')](_0xd1f2('0x10'),_0x508292,_0x3ce2b4[_0xd1f2('0x15')][_0xd1f2('0x16')]);return _0x1df05e(_0x3ce2b4[_0xd1f2('0x15')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x508292,'request\x20sent');_0x1df05e(_0x3ce2b4[_0xd1f2('0x17')]['message']);}})[_0xd1f2('0x18')](function(_0x474f45){logger[_0xd1f2('0x15')](_0xd1f2('0x10'),_0x508292,_0x474f45);_0x579d9b(_0x474f45);});});}exports[_0xd1f2('0x19')]=function(_0x3b3de6){var _0x27ca30=this;return new Promise(function(_0x2a9c07,_0x171dd3){return db['SmsQueueReport'][_0xd1f2('0x1a')](_0x3b3de6['body'],{'raw':_0x3b3de6[_0xd1f2('0x1b')]?_0x3b3de6[_0xd1f2('0x1b')][_0xd1f2('0x1c')]===undefined?!![]:![]:!![]})[_0xd1f2('0xe')](function(_0x57aa15){logger[_0xd1f2('0xf')](_0xd1f2('0x19'),_0x3b3de6);logger[_0xd1f2('0x12')](_0xd1f2('0x19'),_0x3b3de6,JSON['stringify'](_0x57aa15));_0x2a9c07(_0x57aa15);})[_0xd1f2('0x18')](function(_0xe82eec){logger[_0xd1f2('0x15')](_0xd1f2('0x19'),_0xe82eec[_0xd1f2('0x16')],_0x3b3de6);_0x171dd3(_0x27ca30[_0xd1f2('0x15')](0x1f4,_0xe82eec[_0xd1f2('0x16')]));});});};exports['UpdateSmsQueueReport']=function(_0x5666de){var _0xe38a2=this;return new Promise(function(_0x4556bd,_0x19ed51){return db[_0xd1f2('0x1d')]['update'](_0x5666de[_0xd1f2('0x1e')],{'raw':_0x5666de[_0xd1f2('0x1b')]?_0x5666de[_0xd1f2('0x1b')][_0xd1f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5666de[_0xd1f2('0x1b')]?_0x5666de[_0xd1f2('0x1b')]['where']||null:null,'attributes':_0x5666de[_0xd1f2('0x1b')]?_0x5666de[_0xd1f2('0x1b')][_0xd1f2('0x1f')]||null:null,'limit':_0x5666de[_0xd1f2('0x1b')]?_0x5666de[_0xd1f2('0x1b')]['limit']||null:null})[_0xd1f2('0xe')](function(_0x4fe607){logger[_0xd1f2('0xf')](_0xd1f2('0x20'),_0x5666de);logger[_0xd1f2('0x12')](_0xd1f2('0x20'),_0x5666de,JSON[_0xd1f2('0x14')](_0x4fe607));_0x4556bd(_0x4fe607);})[_0xd1f2('0x18')](function(_0x9bbeeb){logger[_0xd1f2('0x15')]('UpdateSmsQueueReport',_0x9bbeeb['message'],_0x5666de);_0x19ed51(_0xe38a2[_0xd1f2('0x15')](0x1f4,_0x9bbeeb[_0xd1f2('0x16')]));});});}; \ No newline at end of file +var _0x8b9e=['SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsQueueReport','SmsQueueReport','create','options','raw','catch','update','body','where','attributes','limit','UpdateSmsQueueReport','debug','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x5a7d16,_0x3f2515){var _0x59f66c=function(_0xe001b6){while(--_0xe001b6){_0x5a7d16['push'](_0x5a7d16['shift']());}};_0x59f66c(++_0x3f2515);}(_0x8b9e,0x1a0));var _0xe8b9=function(_0xd58e21,_0x36311f){_0xd58e21=_0xd58e21-0x0;var _0x2c4a40=_0x8b9e[_0xd58e21];return _0x2c4a40;};'use strict';var _=require(_0xe8b9('0x0'));var util=require('util');var moment=require(_0xe8b9('0x1'));var BPromise=require('bluebird');var rs=require(_0xe8b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8b9('0x3'))['db'];var utils=require(_0xe8b9('0x4'));var logger=require(_0xe8b9('0x5'))(_0xe8b9('0x6'));var config=require('../../config/environment');var jayson=require(_0xe8b9('0x7'));var client=jayson[_0xe8b9('0x8')][_0xe8b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2356cf,_0x31307e,_0x1329f9){return new BPromise(function(_0x576f2c,_0xa40cdb){return client[_0xe8b9('0xa')](_0x2356cf,_0x1329f9)[_0xe8b9('0xb')](function(_0x470717){logger[_0xe8b9('0xc')](_0xe8b9('0xd'),_0x31307e,_0xe8b9('0xe'));logger['debug'](_0xe8b9('0xf'),_0x31307e,_0xe8b9('0xe'),JSON[_0xe8b9('0x10')](_0x470717));if(_0x470717['error']){if(_0x470717[_0xe8b9('0x11')][_0xe8b9('0x12')]===0x1f4){logger[_0xe8b9('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x31307e,_0x470717[_0xe8b9('0x11')]['message']);return _0xa40cdb(_0x470717[_0xe8b9('0x11')][_0xe8b9('0x13')]);}logger[_0xe8b9('0x11')](_0xe8b9('0xd'),_0x31307e,_0x470717[_0xe8b9('0x11')]['message']);return _0x576f2c(_0x470717['error'][_0xe8b9('0x13')]);}else{logger['info'](_0xe8b9('0xd'),_0x31307e,'request\x20sent');_0x576f2c(_0x470717['result']['message']);}})['catch'](function(_0x374e3b){logger[_0xe8b9('0x11')](_0xe8b9('0xd'),_0x31307e,_0x374e3b);_0xa40cdb(_0x374e3b);});});}exports[_0xe8b9('0x14')]=function(_0xf7862d){var _0xd216b5=this;return new Promise(function(_0x31454b,_0x27545e){return db[_0xe8b9('0x15')][_0xe8b9('0x16')](_0xf7862d['body'],{'raw':_0xf7862d[_0xe8b9('0x17')]?_0xf7862d[_0xe8b9('0x17')][_0xe8b9('0x18')]===undefined?!![]:![]:!![]})[_0xe8b9('0xb')](function(_0x111127){logger[_0xe8b9('0xc')]('CreateSmsQueueReport',_0xf7862d);logger['debug']('CreateSmsQueueReport',_0xf7862d,JSON['stringify'](_0x111127));_0x31454b(_0x111127);})[_0xe8b9('0x19')](function(_0x8a06e2){logger['error'](_0xe8b9('0x14'),_0x8a06e2[_0xe8b9('0x13')],_0xf7862d);_0x27545e(_0xd216b5[_0xe8b9('0x11')](0x1f4,_0x8a06e2[_0xe8b9('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x43f4d9){var _0x9f6f7e=this;return new Promise(function(_0x55edac,_0x5c931a){return db['SmsQueueReport'][_0xe8b9('0x1a')](_0x43f4d9[_0xe8b9('0x1b')],{'raw':_0x43f4d9[_0xe8b9('0x17')]?_0x43f4d9[_0xe8b9('0x17')][_0xe8b9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f4d9[_0xe8b9('0x17')]?_0x43f4d9[_0xe8b9('0x17')][_0xe8b9('0x1c')]||null:null,'attributes':_0x43f4d9[_0xe8b9('0x17')]?_0x43f4d9[_0xe8b9('0x17')][_0xe8b9('0x1d')]||null:null,'limit':_0x43f4d9[_0xe8b9('0x17')]?_0x43f4d9[_0xe8b9('0x17')][_0xe8b9('0x1e')]||null:null})[_0xe8b9('0xb')](function(_0x391bb1){logger[_0xe8b9('0xc')](_0xe8b9('0x1f'),_0x43f4d9);logger[_0xe8b9('0x20')](_0xe8b9('0x1f'),_0x43f4d9,JSON[_0xe8b9('0x10')](_0x391bb1));_0x55edac(_0x391bb1);})[_0xe8b9('0x19')](function(_0x3ffac2){logger[_0xe8b9('0x11')](_0xe8b9('0x1f'),_0x3ffac2[_0xe8b9('0x13')],_0x43f4d9);_0x5c931a(_0x9f6f7e['error'](0x1f4,_0x3ffac2[_0xe8b9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 95c548c..5f71dc4 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 _0xd6d6=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x1e5065,_0x2c3088){var _0x4f63b1=function(_0x4e3b33){while(--_0x4e3b33){_0x1e5065['push'](_0x1e5065['shift']());}};_0x4f63b1(++_0x2c3088);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5f0316,_0x5dfba6){_0x5f0316=_0x5f0316-0x0;var _0x39a726=_0xd6d6[_0x5f0316];return _0x39a726;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),auth[_0x6d6d('0xd')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xa')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xd')](),controller[_0x6d6d('0x11')]);router[_0x6d6d('0x12')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6d6d('0x15')]);module[_0x6d6d('0x16')]=router; \ No newline at end of file +var _0x90b5=['/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x26be24,_0xed90c7){var _0x5a1ae5=function(_0x50843c){while(--_0x50843c){_0x26be24['push'](_0x26be24['shift']());}};_0x5a1ae5(++_0xed90c7);}(_0x90b5,0x139));var _0x590b=function(_0x1d4321,_0x4b6283){_0x1d4321=_0x1d4321-0x0;var _0x46d033=_0x90b5[_0x1d4321];return _0x46d033;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./smsTransferReport.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0xe')]('/',auth[_0x590b('0x8')](),controller['create']);router[_0x590b('0xf')](_0x590b('0xc'),auth['isAuthenticated'](),controller[_0x590b('0x10')]);router['delete'](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);module[_0x590b('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 ab88e28..5e59032 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x5be09d,_0x3dcc6c){var _0x528791=function(_0xf92d4){while(--_0xf92d4){_0x5be09d['push'](_0x5be09d['shift']());}};_0x528791(++_0x3dcc6c);}(_0xe706,0xa3));var _0x6e70=function(_0x3bd7c5,_0x272ae9){_0x3bd7c5=_0x3bd7c5-0x0;var _0x423e00=_0xe706[_0x3bd7c5];return _0x423e00;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x23495e,_0x5417e1){var _0xd18e58=function(_0x9e298c){while(--_0x9e298c){_0x23495e['push'](_0x23495e['shift']());}};_0xd18e58(++_0x5417e1);}(_0xf4eb,0xec));var _0xbf4e=function(_0x557757,_0x3bd68e){_0x557757=_0x557757-0x0;var _0x25e4ec=_0xf4eb[_0x557757];return _0x25e4ec;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4f3495f..7bb740e 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 _0xeeb3=['hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','apply','update','then','destroy','error','name','send','index','map','SmsTransferReport','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0xeeb3,0x1a8));var _0x3eeb=function(_0x4fd307,_0x31f3e3){_0x4fd307=_0x4fd307-0x0;var _0x597b51=_0xeeb3[_0x4fd307];return _0x597b51;};'use strict';var emlformat=require(_0x3eeb('0x0'));var rimraf=require(_0x3eeb('0x1'));var zipdir=require(_0x3eeb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3eeb('0x3'));var moment=require(_0x3eeb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3eeb('0x5'));var util=require(_0x3eeb('0x6'));var path=require(_0x3eeb('0x7'));var sox=require(_0x3eeb('0x8'));var csv=require(_0x3eeb('0x9'));var ejs=require(_0x3eeb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3eeb('0xb'));var Papa=require(_0x3eeb('0xc'));var Redis=require('ioredis');var authService=require(_0x3eeb('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3eeb('0xe'));var hardwareService=require(_0x3eeb('0xf'));var logger=require('../../config/logger')(_0x3eeb('0x10'));var utils=require('../../config/utils');var config=require(_0x3eeb('0x11'));var licenseUtil=require(_0x3eeb('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52f390,_0x2279fe){_0x2279fe=_0x2279fe||0xcc;return function(_0x51f6d6){if(_0x51f6d6){return _0x52f390['sendStatus'](_0x2279fe);}return _0x52f390[_0x3eeb('0x13')](_0x2279fe)[_0x3eeb('0x14')]();};}function respondWithResult(_0x25e8e3,_0x4ef4ec){_0x4ef4ec=_0x4ef4ec||0xc8;return function(_0x389fc0){if(_0x389fc0){return _0x25e8e3[_0x3eeb('0x13')](_0x4ef4ec)[_0x3eeb('0x15')](_0x389fc0);}};}function respondWithFilteredResult(_0x5ed7f7,_0x2dba98){return function(_0x205564){if(_0x205564){var _0x3452d5=typeof _0x2dba98[_0x3eeb('0x16')]===_0x3eeb('0x17')&&typeof _0x2dba98['limit']==='undefined';var _0x551879=_0x205564[_0x3eeb('0x18')];var _0x511e90=_0x3452d5?0x0:_0x2dba98[_0x3eeb('0x16')];var _0x286178=_0x3452d5?_0x205564['count']:_0x2dba98[_0x3eeb('0x16')]+_0x2dba98['limit'];var _0x5b58f3;if(_0x286178>=_0x551879){_0x286178=_0x551879;_0x5b58f3=0xc8;}else{_0x5b58f3=0xce;}_0x5ed7f7[_0x3eeb('0x13')](_0x5b58f3);return _0x5ed7f7[_0x3eeb('0x19')]('Content-Range',_0x511e90+'-'+_0x286178+'/'+_0x551879)[_0x3eeb('0x15')](_0x205564);}return null;};}function patchUpdates(_0x3b64c7){return function(_0x131033){try{jsonpatch[_0x3eeb('0x1a')](_0x131033,_0x3b64c7,!![]);}catch(_0x4c041b){return BPromise['reject'](_0x4c041b);}return _0x131033['save']();};}function saveUpdates(_0x328ecd,_0xcf9b7){return function(_0x4bb281){if(_0x4bb281){return _0x4bb281[_0x3eeb('0x1b')](_0x328ecd)[_0x3eeb('0x1c')](function(_0x10babd){return _0x10babd;});}return null;};}function removeEntity(_0x56f1c5,_0x552eab){return function(_0x59c5c7){if(_0x59c5c7){return _0x59c5c7[_0x3eeb('0x1d')]()['then'](function(){_0x56f1c5[_0x3eeb('0x13')](0xcc)[_0x3eeb('0x14')]();});}};}function handleEntityNotFound(_0x472c4c,_0x3fb418){return function(_0x5f571e){if(!_0x5f571e){_0x472c4c['sendStatus'](0x194);}return _0x5f571e;};}function handleError(_0x57a268,_0x5d68a5){_0x5d68a5=_0x5d68a5||0x1f4;return function(_0x747260){logger[_0x3eeb('0x1e')](_0x747260['stack']);if(_0x747260[_0x3eeb('0x1f')]){delete _0x747260['name'];}_0x57a268['status'](_0x5d68a5)[_0x3eeb('0x20')](_0x747260);};}exports[_0x3eeb('0x21')]=function(_0x2ac13f,_0x5e74b6){var _0x4241d0={},_0x275e17={},_0x253b15={'count':0x0,'rows':[]};var _0x3b8f02=_[_0x3eeb('0x22')](db[_0x3eeb('0x23')]['rawAttributes'],function(_0x259d2a){return{'name':_0x259d2a['fieldName'],'type':_0x259d2a['type'][_0x3eeb('0x24')]};});_0x275e17[_0x3eeb('0x25')]=_[_0x3eeb('0x22')](_0x3b8f02,'name');_0x275e17[_0x3eeb('0x26')]=_[_0x3eeb('0x27')](_0x2ac13f[_0x3eeb('0x26')]);_0x275e17[_0x3eeb('0x28')]=_[_0x3eeb('0x29')](_0x275e17[_0x3eeb('0x25')],_0x275e17['query']);_0x4241d0[_0x3eeb('0x2a')]=_[_0x3eeb('0x29')](_0x275e17[_0x3eeb('0x25')],qs['fields'](_0x2ac13f[_0x3eeb('0x26')][_0x3eeb('0x2b')]));_0x4241d0[_0x3eeb('0x2a')]=_0x4241d0['attributes'][_0x3eeb('0x2c')]?_0x4241d0[_0x3eeb('0x2a')]:_0x275e17['model'];if(!_0x2ac13f['query'][_0x3eeb('0x2d')](_0x3eeb('0x2e'))){_0x4241d0[_0x3eeb('0x2f')]=qs[_0x3eeb('0x2f')](_0x2ac13f['query'][_0x3eeb('0x2f')]);_0x4241d0[_0x3eeb('0x16')]=qs[_0x3eeb('0x16')](_0x2ac13f[_0x3eeb('0x26')][_0x3eeb('0x16')]);}_0x4241d0['order']=qs['sort'](_0x2ac13f[_0x3eeb('0x26')][_0x3eeb('0x30')]);_0x4241d0[_0x3eeb('0x31')]=qs['filters'](_[_0x3eeb('0x32')](_0x2ac13f[_0x3eeb('0x26')],_0x275e17[_0x3eeb('0x28')]),_0x3b8f02);if(_0x2ac13f[_0x3eeb('0x26')][_0x3eeb('0x33')]){_0x4241d0[_0x3eeb('0x31')]=_['merge'](_0x4241d0[_0x3eeb('0x31')],{'$or':_[_0x3eeb('0x22')](_0x3b8f02,function(_0x1635c0){if(_0x1635c0[_0x3eeb('0x34')]!==_0x3eeb('0x35')){var _0x238201={};_0x238201[_0x1635c0[_0x3eeb('0x1f')]]={'$like':'%'+_0x2ac13f[_0x3eeb('0x26')][_0x3eeb('0x33')]+'%'};return _0x238201;}})});}_0x4241d0=_[_0x3eeb('0x36')]({},_0x4241d0,_0x2ac13f[_0x3eeb('0x37')]);var _0x265df1={'where':_0x4241d0['where']};return db[_0x3eeb('0x23')][_0x3eeb('0x18')](_0x265df1)['then'](function(_0x1abe30){_0x253b15[_0x3eeb('0x18')]=_0x1abe30;if(_0x2ac13f[_0x3eeb('0x26')][_0x3eeb('0x38')]){_0x4241d0[_0x3eeb('0x39')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x3eeb('0x3a')](_0x4241d0);})[_0x3eeb('0x1c')](function(_0x82adf1){_0x253b15[_0x3eeb('0x3b')]=_0x82adf1;return _0x253b15;})[_0x3eeb('0x1c')](respondWithFilteredResult(_0x5e74b6,_0x4241d0))[_0x3eeb('0x3c')](handleError(_0x5e74b6,null));};exports[_0x3eeb('0x3d')]=function(_0x1bab85,_0xd91215){var _0x34a3d7={'raw':!![],'where':{'id':_0x1bab85[_0x3eeb('0x3e')]['id']}},_0x5a39c9={};_0x5a39c9[_0x3eeb('0x25')]=_[_0x3eeb('0x27')](db[_0x3eeb('0x23')]['rawAttributes']);_0x5a39c9[_0x3eeb('0x26')]=_[_0x3eeb('0x27')](_0x1bab85[_0x3eeb('0x26')]);_0x5a39c9[_0x3eeb('0x28')]=_['intersection'](_0x5a39c9[_0x3eeb('0x25')],_0x5a39c9[_0x3eeb('0x26')]);_0x34a3d7['attributes']=_[_0x3eeb('0x29')](_0x5a39c9[_0x3eeb('0x25')],qs[_0x3eeb('0x2b')](_0x1bab85[_0x3eeb('0x26')]['fields']));_0x34a3d7['attributes']=_0x34a3d7[_0x3eeb('0x2a')][_0x3eeb('0x2c')]?_0x34a3d7['attributes']:_0x5a39c9[_0x3eeb('0x25')];if(_0x1bab85[_0x3eeb('0x26')][_0x3eeb('0x38')]){_0x34a3d7['include']=[{'all':!![]}];}_0x34a3d7=_[_0x3eeb('0x36')]({},_0x34a3d7,_0x1bab85[_0x3eeb('0x37')]);return db[_0x3eeb('0x23')][_0x3eeb('0x3f')](_0x34a3d7)[_0x3eeb('0x1c')](handleEntityNotFound(_0xd91215,null))['then'](respondWithResult(_0xd91215,null))[_0x3eeb('0x3c')](handleError(_0xd91215,null));};exports[_0x3eeb('0x40')]=function(_0x249e8d,_0x3db253){return db['SmsTransferReport']['create'](_0x249e8d[_0x3eeb('0x41')],{})[_0x3eeb('0x1c')](respondWithResult(_0x3db253,0xc9))[_0x3eeb('0x3c')](handleError(_0x3db253,null));};exports[_0x3eeb('0x1b')]=function(_0x5cafb3,_0x546275){if(_0x5cafb3[_0x3eeb('0x41')]['id']){delete _0x5cafb3['body']['id'];}return db[_0x3eeb('0x23')][_0x3eeb('0x3f')]({'where':{'id':_0x5cafb3[_0x3eeb('0x3e')]['id']}})[_0x3eeb('0x1c')](handleEntityNotFound(_0x546275,null))[_0x3eeb('0x1c')](saveUpdates(_0x5cafb3[_0x3eeb('0x41')],null))[_0x3eeb('0x1c')](respondWithResult(_0x546275,null))[_0x3eeb('0x3c')](handleError(_0x546275,null));};exports[_0x3eeb('0x1d')]=function(_0x36c4c6,_0x49666a){return db[_0x3eeb('0x23')][_0x3eeb('0x3f')]({'where':{'id':_0x36c4c6[_0x3eeb('0x3e')]['id']}})[_0x3eeb('0x1c')](handleEntityNotFound(_0x49666a,null))[_0x3eeb('0x1c')](removeEntity(_0x49666a,null))[_0x3eeb('0x3c')](handleError(_0x49666a,null));};exports[_0x3eeb('0x42')]=function(_0x1c17ad,_0x5dce52){return db[_0x3eeb('0x23')]['describe']()[_0x3eeb('0x1c')](respondWithResult(_0x5dce52,null))[_0x3eeb('0x3c')](handleError(_0x5dce52,null));}; \ No newline at end of file +var _0x27f0=['../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','merge','options','SmsTransferReport','includeAll','include','rows','catch','show','params','keys','create','body','update','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5b6ffe,_0x280e9a){var _0x5f2d56=function(_0x534a6e){while(--_0x534a6e){_0x5b6ffe['push'](_0x5b6ffe['shift']());}};_0x5f2d56(++_0x280e9a);}(_0x27f0,0xc6));var _0x027f=function(_0x2d8c90,_0xebac28){_0x2d8c90=_0x2d8c90-0x0;var _0x118c87=_0x27f0[_0x2d8c90];return _0x118c87;};'use strict';var emlformat=require(_0x027f('0x0'));var rimraf=require(_0x027f('0x1'));var zipdir=require(_0x027f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x027f('0x3'));var Mustache=require(_0x027f('0x4'));var util=require(_0x027f('0x5'));var path=require(_0x027f('0x6'));var sox=require('sox');var csv=require(_0x027f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x027f('0x8'));var _=require(_0x027f('0x9'));var squel=require(_0x027f('0xa'));var crypto=require(_0x027f('0xb'));var jsforce=require(_0x027f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x027f('0x7'));var querystring=require(_0x027f('0xd'));var Papa=require(_0x027f('0xe'));var Redis=require('ioredis');var authService=require(_0x027f('0xf'));var qs=require(_0x027f('0x10'));var as=require(_0x027f('0x11'));var hardwareService=require(_0x027f('0x12'));var logger=require(_0x027f('0x13'))(_0x027f('0x14'));var utils=require(_0x027f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x248b9c,_0x5e1189){_0x5e1189=_0x5e1189||0xcc;return function(_0x51c10f){if(_0x51c10f){return _0x248b9c[_0x027f('0x16')](_0x5e1189);}return _0x248b9c['status'](_0x5e1189)[_0x027f('0x17')]();};}function respondWithResult(_0x11a7e7,_0x483d5b){_0x483d5b=_0x483d5b||0xc8;return function(_0x46809f){if(_0x46809f){return _0x11a7e7[_0x027f('0x18')](_0x483d5b)[_0x027f('0x19')](_0x46809f);}};}function respondWithFilteredResult(_0x13b641,_0xfd4a38){return function(_0x175e80){if(_0x175e80){var _0x867b9c=typeof _0xfd4a38[_0x027f('0x1a')]==='undefined'&&typeof _0xfd4a38[_0x027f('0x1b')]==='undefined';var _0x5d3aa6=_0x175e80[_0x027f('0x1c')];var _0x3fbf5d=_0x867b9c?0x0:_0xfd4a38[_0x027f('0x1a')];var _0x2e85be=_0x867b9c?_0x175e80[_0x027f('0x1c')]:_0xfd4a38[_0x027f('0x1a')]+_0xfd4a38['limit'];var _0x2b15fe;if(_0x2e85be>=_0x5d3aa6){_0x2e85be=_0x5d3aa6;_0x2b15fe=0xc8;}else{_0x2b15fe=0xce;}_0x13b641[_0x027f('0x18')](_0x2b15fe);return _0x13b641[_0x027f('0x1d')](_0x027f('0x1e'),_0x3fbf5d+'-'+_0x2e85be+'/'+_0x5d3aa6)[_0x027f('0x19')](_0x175e80);}return null;};}function patchUpdates(_0x51fed3){return function(_0x5b2b13){try{jsonpatch[_0x027f('0x1f')](_0x5b2b13,_0x51fed3,!![]);}catch(_0x3830cb){return BPromise[_0x027f('0x20')](_0x3830cb);}return _0x5b2b13[_0x027f('0x21')]();};}function saveUpdates(_0x2763ac,_0x4ad33d){return function(_0x31ff5c){if(_0x31ff5c){return _0x31ff5c['update'](_0x2763ac)[_0x027f('0x22')](function(_0x5f089c){return _0x5f089c;});}return null;};}function removeEntity(_0x5dc34a,_0x598502){return function(_0x2b8309){if(_0x2b8309){return _0x2b8309[_0x027f('0x23')]()['then'](function(){_0x5dc34a['status'](0xcc)[_0x027f('0x17')]();});}};}function handleEntityNotFound(_0x341230,_0x5be295){return function(_0x3089d2){if(!_0x3089d2){_0x341230[_0x027f('0x16')](0x194);}return _0x3089d2;};}function handleError(_0x4f22a9,_0xe0e810){_0xe0e810=_0xe0e810||0x1f4;return function(_0x30b8e2){logger[_0x027f('0x24')](_0x30b8e2[_0x027f('0x25')]);if(_0x30b8e2[_0x027f('0x26')]){delete _0x30b8e2[_0x027f('0x26')];}_0x4f22a9[_0x027f('0x18')](_0xe0e810)[_0x027f('0x27')](_0x30b8e2);};}exports[_0x027f('0x28')]=function(_0x255bd0,_0x4ac6a2){var _0x71d920={},_0x5a4238={},_0x5a1df0={'count':0x0,'rows':[]};var _0x48f555=_[_0x027f('0x29')](db['SmsTransferReport'][_0x027f('0x2a')],function(_0x2be0df){return{'name':_0x2be0df['fieldName'],'type':_0x2be0df[_0x027f('0x2b')][_0x027f('0x2c')]};});_0x5a4238[_0x027f('0x2d')]=_['map'](_0x48f555,_0x027f('0x26'));_0x5a4238[_0x027f('0x2e')]=_['keys'](_0x255bd0[_0x027f('0x2e')]);_0x5a4238['filters']=_['intersection'](_0x5a4238[_0x027f('0x2d')],_0x5a4238[_0x027f('0x2e')]);_0x71d920['attributes']=_[_0x027f('0x2f')](_0x5a4238[_0x027f('0x2d')],qs[_0x027f('0x30')](_0x255bd0[_0x027f('0x2e')][_0x027f('0x30')]));_0x71d920[_0x027f('0x31')]=_0x71d920[_0x027f('0x31')][_0x027f('0x32')]?_0x71d920[_0x027f('0x31')]:_0x5a4238[_0x027f('0x2d')];if(!_0x255bd0[_0x027f('0x2e')][_0x027f('0x33')]('nolimit')){_0x71d920[_0x027f('0x1b')]=qs[_0x027f('0x1b')](_0x255bd0[_0x027f('0x2e')]['limit']);_0x71d920[_0x027f('0x1a')]=qs['offset'](_0x255bd0[_0x027f('0x2e')][_0x027f('0x1a')]);}_0x71d920[_0x027f('0x34')]=qs['sort'](_0x255bd0['query'][_0x027f('0x35')]);_0x71d920[_0x027f('0x36')]=qs[_0x027f('0x37')](_[_0x027f('0x38')](_0x255bd0[_0x027f('0x2e')],_0x5a4238['filters']),_0x48f555);if(_0x255bd0[_0x027f('0x2e')]['filter']){_0x71d920[_0x027f('0x36')]=_['merge'](_0x71d920['where'],{'$or':_[_0x027f('0x29')](_0x48f555,function(_0x367b73){if(_0x367b73[_0x027f('0x2b')]!==_0x027f('0x39')){var _0x27f6ea={};_0x27f6ea[_0x367b73['name']]={'$like':'%'+_0x255bd0['query']['filter']+'%'};return _0x27f6ea;}})});}_0x71d920=_[_0x027f('0x3a')]({},_0x71d920,_0x255bd0[_0x027f('0x3b')]);var _0x3f2756={'where':_0x71d920[_0x027f('0x36')]};return db[_0x027f('0x3c')][_0x027f('0x1c')](_0x3f2756)['then'](function(_0x2145a4){_0x5a1df0[_0x027f('0x1c')]=_0x2145a4;if(_0x255bd0[_0x027f('0x2e')][_0x027f('0x3d')]){_0x71d920[_0x027f('0x3e')]=[{'all':!![]}];}return db[_0x027f('0x3c')]['findAll'](_0x71d920);})['then'](function(_0x469928){_0x5a1df0[_0x027f('0x3f')]=_0x469928;return _0x5a1df0;})[_0x027f('0x22')](respondWithFilteredResult(_0x4ac6a2,_0x71d920))[_0x027f('0x40')](handleError(_0x4ac6a2,null));};exports[_0x027f('0x41')]=function(_0x3f8d2d,_0x45782c){var _0x3cf54e={'raw':!![],'where':{'id':_0x3f8d2d[_0x027f('0x42')]['id']}},_0x2a7de3={};_0x2a7de3[_0x027f('0x2d')]=_[_0x027f('0x43')](db[_0x027f('0x3c')][_0x027f('0x2a')]);_0x2a7de3[_0x027f('0x2e')]=_['keys'](_0x3f8d2d[_0x027f('0x2e')]);_0x2a7de3['filters']=_[_0x027f('0x2f')](_0x2a7de3[_0x027f('0x2d')],_0x2a7de3[_0x027f('0x2e')]);_0x3cf54e[_0x027f('0x31')]=_[_0x027f('0x2f')](_0x2a7de3['model'],qs['fields'](_0x3f8d2d['query'][_0x027f('0x30')]));_0x3cf54e[_0x027f('0x31')]=_0x3cf54e[_0x027f('0x31')]['length']?_0x3cf54e[_0x027f('0x31')]:_0x2a7de3[_0x027f('0x2d')];if(_0x3f8d2d[_0x027f('0x2e')]['includeAll']){_0x3cf54e[_0x027f('0x3e')]=[{'all':!![]}];}_0x3cf54e=_['merge']({},_0x3cf54e,_0x3f8d2d[_0x027f('0x3b')]);return db['SmsTransferReport']['find'](_0x3cf54e)[_0x027f('0x22')](handleEntityNotFound(_0x45782c,null))[_0x027f('0x22')](respondWithResult(_0x45782c,null))[_0x027f('0x40')](handleError(_0x45782c,null));};exports[_0x027f('0x44')]=function(_0x3e7158,_0x4ff4b9){return db['SmsTransferReport'][_0x027f('0x44')](_0x3e7158[_0x027f('0x45')],{})['then'](respondWithResult(_0x4ff4b9,0xc9))['catch'](handleError(_0x4ff4b9,null));};exports[_0x027f('0x46')]=function(_0x12db93,_0x192845){if(_0x12db93['body']['id']){delete _0x12db93[_0x027f('0x45')]['id'];}return db[_0x027f('0x3c')]['find']({'where':{'id':_0x12db93['params']['id']}})[_0x027f('0x22')](handleEntityNotFound(_0x192845,null))['then'](saveUpdates(_0x12db93['body'],null))[_0x027f('0x22')](respondWithResult(_0x192845,null))[_0x027f('0x40')](handleError(_0x192845,null));};exports[_0x027f('0x23')]=function(_0x30e134,_0x4fca02){return db[_0x027f('0x3c')]['find']({'where':{'id':_0x30e134[_0x027f('0x42')]['id']}})[_0x027f('0x22')](handleEntityNotFound(_0x4fca02,null))[_0x027f('0x22')](removeEntity(_0x4fca02,null))['catch'](handleError(_0x4fca02,null));};exports[_0x027f('0x47')]=function(_0x3983da,_0x243bc2){return db[_0x027f('0x3c')][_0x027f('0x47')]()[_0x027f('0x22')](respondWithResult(_0x243bc2,null))[_0x027f('0x40')](handleError(_0x243bc2,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 06b89d6..c0d6a06 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 _0x3805=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define'];(function(_0x4e3d92,_0x3c012e){var _0x117feb=function(_0x2fe7c1){while(--_0x2fe7c1){_0x4e3d92['push'](_0x4e3d92['shift']());}};_0x117feb(++_0x3c012e);}(_0x3805,0x111));var _0x5380=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x3805[_0x14476b];return _0x24e2e8;};'use strict';var _=require(_0x5380('0x0'));var util=require(_0x5380('0x1'));var logger=require(_0x5380('0x2'))(_0x5380('0x3'));var moment=require(_0x5380('0x4'));var BPromise=require(_0x5380('0x5'));var rp=require(_0x5380('0x6'));var fs=require('fs');var path=require(_0x5380('0x7'));var rimraf=require(_0x5380('0x8'));var config=require(_0x5380('0x9'));var attributes=require(_0x5380('0xa'));module['exports']=function(_0x35f2c4,_0x2ed1d8){return _0x35f2c4[_0x5380('0xb')](_0x5380('0xc'),attributes,{'tableName':_0x5380('0xd'),'paranoid':![],'indexes':[{'name':_0x5380('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x77f2=['../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','api','moment','rimraf'];(function(_0xc14fd2,_0x303b9b){var _0x34a077=function(_0x3d6600){while(--_0x3d6600){_0xc14fd2['push'](_0xc14fd2['shift']());}};_0x34a077(++_0x303b9b);}(_0x77f2,0x188));var _0x277f=function(_0x3f4a8e,_0x507c39){_0x3f4a8e=_0x3f4a8e-0x0;var _0x7f68fd=_0x77f2[_0x3f4a8e];return _0x7f68fd;};'use strict';var _=require('lodash');var util=require(_0x277f('0x0'));var logger=require('../../config/logger')(_0x277f('0x1'));var moment=require(_0x277f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x277f('0x3'));var config=require(_0x277f('0x4'));var attributes=require('./smsTransferReport.attributes');module[_0x277f('0x5')]=function(_0x4e3fa5,_0x498f51){return _0x4e3fa5['define'](_0x277f('0x6'),attributes,{'tableName':_0x277f('0x7'),'paranoid':![],'indexes':[{'name':_0x277f('0x8'),'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 3497d56..071c63c 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 _0x0207=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','util','randomstring','ioredis'];(function(_0x37ec96,_0x29bebe){var _0x1186a0=function(_0xbb9b9b){while(--_0xbb9b9b){_0x37ec96['push'](_0x37ec96['shift']());}};_0x1186a0(++_0x29bebe);}(_0x0207,0x162));var _0x7020=function(_0x1c190c,_0x48125d){_0x1c190c=_0x1c190c-0x0;var _0x4fda82=_0x0207[_0x1c190c];return _0x4fda82;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7020('0x1'));var fs=require('fs');var Redis=require(_0x7020('0x2'));var db=require(_0x7020('0x3'))['db'];var utils=require(_0x7020('0x4'));var logger=require(_0x7020('0x5'))(_0x7020('0x6'));var config=require(_0x7020('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7020('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39263c,_0x3c6c11,_0x17deac){return new BPromise(function(_0x42bc79,_0x22ba3e){return client[_0x7020('0x9')](_0x39263c,_0x17deac)['then'](function(_0x5e86b5){logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));logger['debug'](_0x7020('0xd'),_0x3c6c11,_0x7020('0xc'),JSON['stringify'](_0x5e86b5));if(_0x5e86b5[_0x7020('0xe')]){if(_0x5e86b5[_0x7020('0xe')][_0x7020('0xf')]===0x1f4){logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);return _0x22ba3e(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5['error'][_0x7020('0x10')]);return _0x42bc79(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}else{logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));_0x42bc79(_0x5e86b5['result'][_0x7020('0x10')]);}})['catch'](function(_0x2f4db5){logger[_0x7020('0xe')](_0x7020('0xb'),_0x3c6c11,_0x2f4db5);_0x22ba3e(_0x2f4db5);});});} \ No newline at end of file +var _0xfb8f=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x15ac8a,_0x35cdd9){var _0x3b9c61=function(_0x4028ac){while(--_0x4028ac){_0x15ac8a['push'](_0x15ac8a['shift']());}};_0x3b9c61(++_0x35cdd9);}(_0xfb8f,0x18c));var _0xffb8=function(_0x2c3db7,_0x5e803b){_0x2c3db7=_0x2c3db7-0x0;var _0x461116=_0xfb8f[_0x2c3db7];return _0x461116;};'use strict';var _=require('lodash');var util=require(_0xffb8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xffb8('0x1'));var fs=require('fs');var Redis=require(_0xffb8('0x2'));var db=require(_0xffb8('0x3'))['db'];var utils=require(_0xffb8('0x4'));var logger=require(_0xffb8('0x5'))('rpc');var config=require(_0xffb8('0x6'));var jayson=require(_0xffb8('0x7'));var client=jayson[_0xffb8('0x8')][_0xffb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a70ab,_0x57a38f,_0x33495b){return new BPromise(function(_0xb71c21,_0x2b892a){return client[_0xffb8('0xa')](_0x5a70ab,_0x33495b)[_0xffb8('0xb')](function(_0x487759){logger['info'](_0xffb8('0xc'),_0x57a38f,_0xffb8('0xd'));logger[_0xffb8('0xe')](_0xffb8('0xf'),_0x57a38f,_0xffb8('0xd'),JSON['stringify'](_0x487759));if(_0x487759[_0xffb8('0x10')]){if(_0x487759[_0xffb8('0x10')][_0xffb8('0x11')]===0x1f4){logger[_0xffb8('0x10')](_0xffb8('0xc'),_0x57a38f,_0x487759['error'][_0xffb8('0x12')]);return _0x2b892a(_0x487759[_0xffb8('0x10')][_0xffb8('0x12')]);}logger['error'](_0xffb8('0xc'),_0x57a38f,_0x487759['error']['message']);return _0xb71c21(_0x487759[_0xffb8('0x10')][_0xffb8('0x12')]);}else{logger[_0xffb8('0x13')](_0xffb8('0xc'),_0x57a38f,_0xffb8('0xd'));_0xb71c21(_0x487759[_0xffb8('0x14')][_0xffb8('0x12')]);}})[_0xffb8('0x15')](function(_0x1a310e){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x57a38f,_0x1a310e);_0x2b892a(_0x1a310e);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index bc30822..074f598 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 _0x2f86=['index','/:id','isAuthenticated','show','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','single','file','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x2f86,0x18e));var _0x62f8=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x2f86[_0x2aec52];return _0x3b8835;};'use strict';var multer=require('multer');var util=require(_0x62f8('0x0'));var path=require(_0x62f8('0x1'));var timeout=require('connect-timeout');var express=require(_0x62f8('0x2'));var router=express[_0x62f8('0x3')]();var fs_extra=require(_0x62f8('0x4'));var auth=require(_0x62f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x62f8('0x6'));var controller=require('./sound.controller');router[_0x62f8('0x7')]('/',auth['isAuthenticated'](),controller[_0x62f8('0x8')]);router[_0x62f8('0x7')](_0x62f8('0x9'),auth[_0x62f8('0xa')](),controller[_0x62f8('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x62f8('0xc')]({'destination':function(_0x11bacc,_0x59a12a,_0x5c6259){_0x5c6259(null,path[_0x62f8('0xd')](config[_0x62f8('0xe')],_0x62f8('0xf')));},'filename':function(_0x25531b,_0x26ba25,_0x27fe19){_0x26ba25[_0x62f8('0x10')]=_0x26ba25[_0x62f8('0x10')][_0x62f8('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x27fe19(null,util[_0x62f8('0x12')]('%s-%s%s',path[_0x62f8('0x13')](_0x26ba25[_0x62f8('0x10')],path[_0x62f8('0x14')](_0x26ba25[_0x62f8('0x10')])),Date[_0x62f8('0x15')](),path[_0x62f8('0x14')](_0x26ba25[_0x62f8('0x10')])));}})});router['post']('/',upload[_0x62f8('0x16')](_0x62f8('0x17')),controller[_0x62f8('0x18')]);router[_0x62f8('0x19')](_0x62f8('0x9'),auth['isAuthenticated'](),controller[_0x62f8('0x1a')]);router[_0x62f8('0x1b')](_0x62f8('0x9'),auth[_0x62f8('0xa')](),controller['delete']);module[_0x62f8('0x1c')]=router; \ No newline at end of file +var _0xde2a=['delete','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./sound.controller','index','get','/:id','isAuthenticated','show','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','post','single','file','create','put','update'];(function(_0x299453,_0x3a554e){var _0x20bbd4=function(_0x5d86ab){while(--_0x5d86ab){_0x299453['push'](_0x299453['shift']());}};_0x20bbd4(++_0x3a554e);}(_0xde2a,0xd9));var _0xade2=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xde2a[_0x164af1];return _0x5d81a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xade2('0x0'));var timeout=require(_0xade2('0x1'));var express=require(_0xade2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xade2('0x3'));var config=require(_0xade2('0x4'));var controller=require(_0xade2('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xade2('0x6')]);router[_0xade2('0x7')](_0xade2('0x8'),auth[_0xade2('0x9')](),controller[_0xade2('0xa')]);router[_0xade2('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xade2('0xb')]({'destination':function(_0x281074,_0x383211,_0x552ab0){_0x552ab0(null,path[_0xade2('0xc')](config[_0xade2('0xd')],_0xade2('0xe')));},'filename':function(_0x3b1619,_0xbe6f5e,_0x404cbb){_0xbe6f5e[_0xade2('0xf')]=_0xbe6f5e[_0xade2('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x404cbb(null,util[_0xade2('0x10')](_0xade2('0x11'),path[_0xade2('0x12')](_0xbe6f5e['originalname'],path[_0xade2('0x13')](_0xbe6f5e[_0xade2('0xf')])),Date['now'](),path[_0xade2('0x13')](_0xbe6f5e[_0xade2('0xf')])));}})});router[_0xade2('0x14')]('/',upload[_0xade2('0x15')](_0xade2('0x16')),controller[_0xade2('0x17')]);router[_0xade2('0x18')](_0xade2('0x8'),auth[_0xade2('0x9')](),controller[_0xade2('0x19')]);router[_0xade2('0x1a')](_0xade2('0x8'),auth[_0xade2('0x9')](),controller[_0xade2('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3414be9..a0169f0 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 _0xd300=['INTEGER','sequelize','exports','STRING','FLOAT','BIGINT'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0xd300,0x157));var _0x0d30=function(_0x3d0e15,_0xdb46ae){_0x3d0e15=_0x3d0e15-0x0;var _0x4723bc=_0xd300[_0x3d0e15];return _0x4723bc;};'use strict';var Sequelize=require(_0x0d30('0x0'));module[_0x0d30('0x1')]={'name':{'type':Sequelize[_0x0d30('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x0d30('0x2')]},'display_name':{'type':Sequelize[_0x0d30('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x0d30('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x0d30('0x3')]},'original_sampleCount':{'type':Sequelize[_0x0d30('0x4')]},'original_channelCount':{'type':Sequelize[_0x0d30('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x0d30('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x0d30('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x0d30('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2812=['exports','STRING','BIGINT','INTEGER','FLOAT','sequelize'];(function(_0x57298d,_0x4a3161){var _0x267111=function(_0x247c2a){while(--_0x247c2a){_0x57298d['push'](_0x57298d['shift']());}};_0x267111(++_0x4a3161);}(_0x2812,0x167));var _0x2281=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x2812[_0x38c652];return _0x218a37;};'use strict';var Sequelize=require(_0x2281('0x0'));module[_0x2281('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x2281('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x2281('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x2281('0x3')]},'original_channelCount':{'type':Sequelize[_0x2281('0x4')]},'original_bitRate':{'type':Sequelize[_0x2281('0x3')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x2281('0x2')]},'converted_duration':{'type':Sequelize[_0x2281('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x2281('0x4')]},'converted_bitRate':{'type':Sequelize[_0x2281('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x2281('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 00d792c..de14962 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 _0xfad4=['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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','Sound','includeAll','include','show','params','catch','download','find','converted_format','existsSync','join','server/files/sounds/converted','ValidationError','format','%s.%s','save_name','create','basename','extname','originalname','file','filename','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','body','role','userProfileId','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0xfad4,0x79));var _0x4fad=function(_0x4869ce,_0x275972){_0x4869ce=_0x4869ce-0x0;var _0x16aa1a=_0xfad4[_0x4869ce];return _0x16aa1a;};'use strict';var emlformat=require(_0x4fad('0x0'));var rimraf=require(_0x4fad('0x1'));var zipdir=require(_0x4fad('0x2'));var jsonpatch=require(_0x4fad('0x3'));var rp=require(_0x4fad('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4fad('0x5'));var path=require(_0x4fad('0x6'));var sox=require(_0x4fad('0x7'));var csv=require(_0x4fad('0x8'));var ejs=require(_0x4fad('0x9'));var fs=require('fs');var fs_extra=require(_0x4fad('0xa'));var _=require(_0x4fad('0xb'));var squel=require(_0x4fad('0xc'));var crypto=require(_0x4fad('0xd'));var jsforce=require(_0x4fad('0xe'));var deskjs=require(_0x4fad('0xf'));var toCsv=require(_0x4fad('0x8'));var querystring=require(_0x4fad('0x10'));var Papa=require(_0x4fad('0x11'));var Redis=require(_0x4fad('0x12'));var authService=require(_0x4fad('0x13'));var qs=require(_0x4fad('0x14'));var as=require(_0x4fad('0x15'));var hardwareService=require(_0x4fad('0x16'));var logger=require(_0x4fad('0x17'))(_0x4fad('0x18'));var utils=require(_0x4fad('0x19'));var config=require(_0x4fad('0x1a'));var licenseUtil=require(_0x4fad('0x1b'));var db=require(_0x4fad('0x1c'))['db'];function respondWithStatusCode(_0x498cdc,_0x331eee){_0x331eee=_0x331eee||0xcc;return function(_0x183a91){if(_0x183a91){return _0x498cdc[_0x4fad('0x1d')](_0x331eee);}return _0x498cdc[_0x4fad('0x1e')](_0x331eee)[_0x4fad('0x1f')]();};}function respondWithResult(_0x2cbf74,_0x40e1e8){_0x40e1e8=_0x40e1e8||0xc8;return function(_0x44d9e5){if(_0x44d9e5){return _0x2cbf74[_0x4fad('0x1e')](_0x40e1e8)[_0x4fad('0x20')](_0x44d9e5);}};}function respondWithFilteredResult(_0x23c722,_0x43d8f7){return function(_0x4830fa){if(_0x4830fa){var _0xcda7d4=typeof _0x43d8f7[_0x4fad('0x21')]==='undefined'&&typeof _0x43d8f7[_0x4fad('0x22')]==='undefined';var _0x23fd50=_0x4830fa[_0x4fad('0x23')];var _0x3c3d20=_0xcda7d4?0x0:_0x43d8f7[_0x4fad('0x21')];var _0x5ce441=_0xcda7d4?_0x4830fa[_0x4fad('0x23')]:_0x43d8f7[_0x4fad('0x21')]+_0x43d8f7[_0x4fad('0x22')];var _0x4d1793;if(_0x5ce441>=_0x23fd50){_0x5ce441=_0x23fd50;_0x4d1793=0xc8;}else{_0x4d1793=0xce;}_0x23c722['status'](_0x4d1793);return _0x23c722[_0x4fad('0x24')](_0x4fad('0x25'),_0x3c3d20+'-'+_0x5ce441+'/'+_0x23fd50)[_0x4fad('0x20')](_0x4830fa);}return null;};}function patchUpdates(_0x37791b){return function(_0x54b405){try{jsonpatch['apply'](_0x54b405,_0x37791b,!![]);}catch(_0x41bf31){return BPromise[_0x4fad('0x26')](_0x41bf31);}return _0x54b405[_0x4fad('0x27')]();};}function saveUpdates(_0x4ddae3,_0xb70335){return function(_0x55942b){if(_0x55942b){return _0x55942b[_0x4fad('0x28')](_0x4ddae3)[_0x4fad('0x29')](function(_0x3b9f16){return _0x3b9f16;});}return null;};}function removeEntity(_0x25868d,_0x1c4f81){return function(_0x1839c1){if(_0x1839c1){return _0x1839c1[_0x4fad('0x2a')]()['then'](function(){var _0x3f4799=_0x1839c1[_0x4fad('0x2b')]({'plain':!![]});var _0x367cc5='Sounds';return db[_0x4fad('0x2c')][_0x4fad('0x2a')]({'where':{'type':_0x367cc5,'resourceId':_0x3f4799['id']}})[_0x4fad('0x29')](function(){return _0x1839c1;});})['then'](function(){_0x25868d[_0x4fad('0x1e')](0xcc)[_0x4fad('0x1f')]();});}};}function handleEntityNotFound(_0x1b7e03,_0x40b801){return function(_0x20d2b4){if(!_0x20d2b4){_0x1b7e03['sendStatus'](0x194);}return _0x20d2b4;};}function handleError(_0x4b1e9a,_0x5ef0e5){_0x5ef0e5=_0x5ef0e5||0x1f4;return function(_0x5a00fb){logger[_0x4fad('0x2d')](_0x5a00fb['stack']);if(_0x5a00fb['name']){delete _0x5a00fb[_0x4fad('0x2e')];}_0x4b1e9a[_0x4fad('0x1e')](_0x5ef0e5)[_0x4fad('0x2f')](_0x5a00fb);};}exports[_0x4fad('0x30')]=function(_0x2bb9cf,_0x5e52ec){var _0x1b65e4={},_0x1bac99={},_0x228651={'count':0x0,'rows':[]};var _0x102bac=_[_0x4fad('0x31')](db['Sound'][_0x4fad('0x32')],function(_0x2addc7){return{'name':_0x2addc7[_0x4fad('0x33')],'type':_0x2addc7[_0x4fad('0x34')][_0x4fad('0x35')]};});_0x1bac99[_0x4fad('0x36')]=_[_0x4fad('0x31')](_0x102bac,'name');_0x1bac99[_0x4fad('0x37')]=_[_0x4fad('0x38')](_0x2bb9cf['query']);_0x1bac99[_0x4fad('0x39')]=_[_0x4fad('0x3a')](_0x1bac99[_0x4fad('0x36')],_0x1bac99['query']);_0x1b65e4[_0x4fad('0x3b')]=_[_0x4fad('0x3a')](_0x1bac99['model'],qs['fields'](_0x2bb9cf['query'][_0x4fad('0x3c')]));_0x1b65e4['attributes']=_0x1b65e4['attributes'][_0x4fad('0x3d')]?_0x1b65e4['attributes']:_0x1bac99[_0x4fad('0x36')];if(!_0x2bb9cf[_0x4fad('0x37')][_0x4fad('0x3e')](_0x4fad('0x3f'))){_0x1b65e4[_0x4fad('0x22')]=qs[_0x4fad('0x22')](_0x2bb9cf[_0x4fad('0x37')][_0x4fad('0x22')]);_0x1b65e4[_0x4fad('0x21')]=qs[_0x4fad('0x21')](_0x2bb9cf[_0x4fad('0x37')]['offset']);}_0x1b65e4[_0x4fad('0x40')]=qs[_0x4fad('0x41')](_0x2bb9cf[_0x4fad('0x37')][_0x4fad('0x41')]);_0x1b65e4['where']=qs['filters'](_['pick'](_0x2bb9cf['query'],_0x1bac99[_0x4fad('0x39')]),_0x102bac);if(_0x2bb9cf[_0x4fad('0x37')][_0x4fad('0x42')]){_0x1b65e4[_0x4fad('0x43')]=_[_0x4fad('0x44')](_0x1b65e4['where'],{'$or':_['map'](_0x102bac,function(_0x2c94ab){if(_0x2c94ab['type']!=='VIRTUAL'){var _0x404162={};_0x404162[_0x2c94ab['name']]={'$like':'%'+_0x2bb9cf[_0x4fad('0x37')][_0x4fad('0x42')]+'%'};return _0x404162;}})});}_0x1b65e4=_['merge']({},_0x1b65e4,_0x2bb9cf[_0x4fad('0x45')]);var _0x5f3f50={'where':_0x1b65e4[_0x4fad('0x43')]};return db[_0x4fad('0x46')][_0x4fad('0x23')](_0x5f3f50)[_0x4fad('0x29')](function(_0x5c89b0){_0x228651['count']=_0x5c89b0;if(_0x2bb9cf[_0x4fad('0x37')][_0x4fad('0x47')]){_0x1b65e4[_0x4fad('0x48')]=[{'all':!![]}];}return db[_0x4fad('0x46')]['findAll'](_0x1b65e4);})['then'](function(_0x445b75){_0x228651['rows']=_0x445b75;return _0x228651;})[_0x4fad('0x29')](respondWithFilteredResult(_0x5e52ec,_0x1b65e4))['catch'](handleError(_0x5e52ec,null));};exports[_0x4fad('0x49')]=function(_0x1482e8,_0x1b5356){var _0x267c19={'raw':!![],'where':{'id':_0x1482e8[_0x4fad('0x4a')]['id']}},_0x5abc55={};_0x5abc55[_0x4fad('0x36')]=_[_0x4fad('0x38')](db[_0x4fad('0x46')][_0x4fad('0x32')]);_0x5abc55[_0x4fad('0x37')]=_[_0x4fad('0x38')](_0x1482e8[_0x4fad('0x37')]);_0x5abc55[_0x4fad('0x39')]=_[_0x4fad('0x3a')](_0x5abc55[_0x4fad('0x36')],_0x5abc55['query']);_0x267c19[_0x4fad('0x3b')]=_[_0x4fad('0x3a')](_0x5abc55[_0x4fad('0x36')],qs[_0x4fad('0x3c')](_0x1482e8[_0x4fad('0x37')][_0x4fad('0x3c')]));_0x267c19[_0x4fad('0x3b')]=_0x267c19[_0x4fad('0x3b')][_0x4fad('0x3d')]?_0x267c19[_0x4fad('0x3b')]:_0x5abc55[_0x4fad('0x36')];if(_0x1482e8[_0x4fad('0x37')][_0x4fad('0x47')]){_0x267c19[_0x4fad('0x48')]=[{'all':!![]}];}_0x267c19=_[_0x4fad('0x44')]({},_0x267c19,_0x1482e8['options']);return db[_0x4fad('0x46')]['find'](_0x267c19)[_0x4fad('0x29')](handleEntityNotFound(_0x1b5356,null))[_0x4fad('0x29')](respondWithResult(_0x1b5356,null))[_0x4fad('0x4b')](handleError(_0x1b5356,null));};exports[_0x4fad('0x4c')]=function(_0x36d161,_0x26d7d5,_0x38ab5b){return db[_0x4fad('0x46')][_0x4fad('0x4d')]({'where':{'id':_0x36d161['params']['id']},'attributes':['name','save_name',_0x4fad('0x4e')],'raw':!![]})[_0x4fad('0x29')](handleEntityNotFound(_0x26d7d5,null))['then'](function(_0x579ba2){if(_0x579ba2){if(!fs[_0x4fad('0x4f')](path[_0x4fad('0x50')](config['root'],_0x4fad('0x51'),_0x579ba2['save_name']+'.'+_0x579ba2[_0x4fad('0x4e')]))){throw new db['Sequelize'][(_0x4fad('0x52'))]('Sound\x20not\x20found');}return _0x26d7d5[_0x4fad('0x4c')](path[_0x4fad('0x50')](config['root'],_0x4fad('0x51'),util[_0x4fad('0x53')](_0x4fad('0x54'),_0x579ba2[_0x4fad('0x55')],_0x579ba2[_0x4fad('0x4e')])),util[_0x4fad('0x53')]('%s.%s',_0x579ba2[_0x4fad('0x2e')],_0x579ba2[_0x4fad('0x4e')]));}return null;})[_0x4fad('0x4b')](handleError(_0x26d7d5,null));};exports[_0x4fad('0x56')]=function(_0x1bc19a,_0x725931,_0x2ee979){var _0x4bbd8={'name':path[_0x4fad('0x57')](_0x1bc19a['file']['originalname'],path[_0x4fad('0x58')](_0x1bc19a['file'][_0x4fad('0x59')])),'save_name':path[_0x4fad('0x57')](_0x1bc19a[_0x4fad('0x5a')][_0x4fad('0x5b')],path[_0x4fad('0x58')](_0x1bc19a['file'][_0x4fad('0x5b')])),'original_format':path['extname'](_0x1bc19a[_0x4fad('0x5a')][_0x4fad('0x59')])['substring'](0x1),'converted_format':'wav'};var _0x3989f7=path['join'](config[_0x4fad('0x5c')],_0x4fad('0x5d'),_0x1bc19a[_0x4fad('0x5a')][_0x4fad('0x5b')]);var _0x5210ad=path[_0x4fad('0x50')](config['root'],_0x4fad('0x51'),util[_0x4fad('0x53')](_0x4fad('0x54'),path['basename'](_0x1bc19a['file'][_0x4fad('0x5b')],path['extname'](_0x1bc19a[_0x4fad('0x5a')][_0x4fad('0x5b')])),_0x4bbd8[_0x4fad('0x4e')]));logger[_0x4fad('0x5e')](_0x4fad('0x5f'),_0x3989f7);logger[_0x4fad('0x5e')](_0x4fad('0x60'),_0x5210ad);try{fs[_0x4fad('0x61')](_0x3989f7,parseInt(_0x4fad('0x62'),0x8));var _0x175e73=sox[_0x4fad('0x63')](_0x3989f7,_0x5210ad,{'sampleRate':0x1f40,'format':_0x4fad('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x175e73['on'](_0x4fad('0x2d'),function(_0x8fc2d3){fs[_0x4fad('0x65')](_0x3989f7);_0x725931['status'](0x1f4)[_0x4fad('0x2f')](_0x8fc2d3);});_0x175e73['on'](_0x4fad('0x66'),function(_0x4cde9e){_0x4bbd8[_0x4fad('0x67')]=isNaN(_0x4cde9e[_0x4fad('0x68')])?null:_0x4cde9e['duration']*0x3e8;_0x4bbd8[_0x4fad('0x69')]=isNaN(_0x4cde9e[_0x4fad('0x6a')])?null:_0x4cde9e[_0x4fad('0x6a')];_0x4bbd8['original_channelCount']=isNaN(_0x4cde9e[_0x4fad('0x6b')])?null:_0x4cde9e['channelCount'];_0x4bbd8[_0x4fad('0x6c')]=isNaN(_0x4cde9e['bitRate'])?null:_0x4cde9e['bitRate'];_0x4bbd8['original_sampleRate']=isNaN(_0x4cde9e[_0x4fad('0x6d')])?null:_0x4cde9e[_0x4fad('0x6d')];});_0x175e73['on'](_0x4fad('0x6e'),function(_0x414dc4){_0x4bbd8[_0x4fad('0x6f')]=isNaN(_0x414dc4[_0x4fad('0x68')])?null:_0x414dc4['duration']*0x3e8;_0x4bbd8[_0x4fad('0x70')]=isNaN(_0x414dc4[_0x4fad('0x6a')])?null:_0x414dc4[_0x4fad('0x6a')];_0x4bbd8[_0x4fad('0x71')]=isNaN(_0x414dc4[_0x4fad('0x6b')])?null:_0x414dc4['channelCount'];_0x4bbd8[_0x4fad('0x72')]=isNaN(_0x414dc4[_0x4fad('0x73')])?null:_0x414dc4[_0x4fad('0x73')];_0x4bbd8[_0x4fad('0x74')]=isNaN(_0x414dc4['sampleRate'])?null:_0x414dc4[_0x4fad('0x6d')];});_0x175e73['on']('end',function(){fs['chmodSync'](_0x5210ad,parseInt(_0x4fad('0x62'),0x8));return db[_0x4fad('0x46')][_0x4fad('0x56')](_0x4bbd8)['then'](function(_0x4abb86){var _0x265bbd={'role':_0x1bc19a[_0x4fad('0x75')][_0x4fad('0x76')],'userProfileId':_0x1bc19a['body'][_0x4fad('0x77')]};if(!_0x265bbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x265bbd[_0x4fad('0x76')]===_0x4fad('0x78')){var _0x56dadb=_0x4abb86[_0x4fad('0x2b')]({'plain':!![]});return db[_0x4fad('0x79')]['find']({'where':{'name':_0x4fad('0x7a'),'userProfileId':_0x265bbd[_0x4fad('0x77')]},'raw':!![]})['then'](function(_0x8937bc){if(_0x8937bc&&_0x8937bc[_0x4fad('0x7b')]===0x0){return db[_0x4fad('0x2c')][_0x4fad('0x56')]({'name':_0x56dadb[_0x4fad('0x2e')],'resourceId':_0x56dadb['id'],'type':_0x8937bc[_0x4fad('0x2e')],'sectionId':_0x8937bc['id']},{})[_0x4fad('0x29')](function(){return _0x4abb86;});}else{return _0x4abb86;}})['catch'](function(_0x1747f3){logger[_0x4fad('0x2d')](_0x4fad('0x7c'),_0x1747f3);throw _0x1747f3;});}return _0x4abb86;})['then'](respondWithResult(_0x725931,null))[_0x4fad('0x4b')](handleError(_0x725931,null));});_0x175e73[_0x4fad('0x7d')]();}catch(_0x2d7e7a){_0x725931[_0x4fad('0x1e')](0x1f4)[_0x4fad('0x2f')](_0x2d7e7a);}};exports[_0x4fad('0x28')]=function(_0x748ecb,_0x2f58f8,_0x2dcfec){return db[_0x4fad('0x46')][_0x4fad('0x4d')]({'where':{'id':_0x748ecb['params']['id']}})[_0x4fad('0x29')](handleEntityNotFound(_0x2f58f8,null))[_0x4fad('0x29')](saveUpdates(_[_0x4fad('0x7e')](_0x748ecb[_0x4fad('0x75')],[_0x4fad('0x2e'),'description']),null))[_0x4fad('0x29')](respondWithResult(_0x2f58f8,null))['catch'](handleError(_0x2f58f8,null));};exports['delete']=function(_0x507514,_0x36ff07,_0x2d1104){return db[_0x4fad('0x46')][_0x4fad('0x4d')]({'where':{'id':_0x507514['params']['id']}})[_0x4fad('0x29')](function(_0x3b49e1){if(_0x3b49e1){return _0x3b49e1[_0x4fad('0x2a')]();}})[_0x4fad('0x29')](function(_0x2692d5){var _0x2b5584=path[_0x4fad('0x50')](config[_0x4fad('0x5c')],_0x4fad('0x5d'),util[_0x4fad('0x53')](_0x4fad('0x54'),_0x2692d5['save_name'],_0x2692d5[_0x4fad('0x7f')]));var _0x166220=path[_0x4fad('0x50')](config[_0x4fad('0x5c')],_0x4fad('0x51'),util[_0x4fad('0x53')](_0x4fad('0x54'),_0x2692d5[_0x4fad('0x55')],_0x2692d5[_0x4fad('0x4e')]));fs[_0x4fad('0x65')](_0x2b5584);fs[_0x4fad('0x65')](_0x166220);return _0x2692d5;})['then'](function(_0x1625cf){if(_0x1625cf){return _0x36ff07[_0x4fad('0x1e')](0xcc)['end']();}})[_0x4fad('0x29')](handleEntityNotFound(_0x36ff07,null))[_0x4fad('0x4b')](handleError(_0x36ff07,null));}; \ No newline at end of file +var _0x73a4=['sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_bitRate','bitRate','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','start','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','end','error','stack','name','send','map','Sound','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','catch','params','rawAttributes','options','find','download','save_name','converted_format','existsSync','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','extname','originalname','file','substring','wav','join','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x73a4,0x191));var _0x473a=function(_0x35b0e4,_0x44054b){_0x35b0e4=_0x35b0e4-0x0;var _0xc26e26=_0x73a4[_0x35b0e4];return _0xc26e26;};'use strict';var emlformat=require(_0x473a('0x0'));var rimraf=require(_0x473a('0x1'));var zipdir=require(_0x473a('0x2'));var jsonpatch=require(_0x473a('0x3'));var rp=require(_0x473a('0x4'));var moment=require(_0x473a('0x5'));var BPromise=require(_0x473a('0x6'));var Mustache=require(_0x473a('0x7'));var util=require(_0x473a('0x8'));var path=require(_0x473a('0x9'));var sox=require('sox');var csv=require(_0x473a('0xa'));var ejs=require(_0x473a('0xb'));var fs=require('fs');var fs_extra=require(_0x473a('0xc'));var _=require(_0x473a('0xd'));var squel=require(_0x473a('0xe'));var crypto=require(_0x473a('0xf'));var jsforce=require(_0x473a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x473a('0xa'));var querystring=require(_0x473a('0x11'));var Papa=require(_0x473a('0x12'));var Redis=require('ioredis');var authService=require(_0x473a('0x13'));var qs=require(_0x473a('0x14'));var as=require(_0x473a('0x15'));var hardwareService=require(_0x473a('0x16'));var logger=require(_0x473a('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x473a('0x18'));var licenseUtil=require(_0x473a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10c4da,_0x21424d){_0x21424d=_0x21424d||0xcc;return function(_0x23ba51){if(_0x23ba51){return _0x10c4da[_0x473a('0x1a')](_0x21424d);}return _0x10c4da[_0x473a('0x1b')](_0x21424d)['end']();};}function respondWithResult(_0x428bb7,_0x7b77c3){_0x7b77c3=_0x7b77c3||0xc8;return function(_0x106fab){if(_0x106fab){return _0x428bb7[_0x473a('0x1b')](_0x7b77c3)['json'](_0x106fab);}};}function respondWithFilteredResult(_0x10ab5c,_0x256bb7){return function(_0x24bd9b){if(_0x24bd9b){var _0x5764e4=typeof _0x256bb7[_0x473a('0x1c')]==='undefined'&&typeof _0x256bb7[_0x473a('0x1d')]===_0x473a('0x1e');var _0x1d3e9e=_0x24bd9b[_0x473a('0x1f')];var _0x572398=_0x5764e4?0x0:_0x256bb7[_0x473a('0x1c')];var _0x3cc9d9=_0x5764e4?_0x24bd9b[_0x473a('0x1f')]:_0x256bb7[_0x473a('0x1c')]+_0x256bb7[_0x473a('0x1d')];var _0x15bc19;if(_0x3cc9d9>=_0x1d3e9e){_0x3cc9d9=_0x1d3e9e;_0x15bc19=0xc8;}else{_0x15bc19=0xce;}_0x10ab5c[_0x473a('0x1b')](_0x15bc19);return _0x10ab5c[_0x473a('0x20')](_0x473a('0x21'),_0x572398+'-'+_0x3cc9d9+'/'+_0x1d3e9e)[_0x473a('0x22')](_0x24bd9b);}return null;};}function patchUpdates(_0x235459){return function(_0x3f7d8b){try{jsonpatch[_0x473a('0x23')](_0x3f7d8b,_0x235459,!![]);}catch(_0x3418c9){return BPromise[_0x473a('0x24')](_0x3418c9);}return _0x3f7d8b[_0x473a('0x25')]();};}function saveUpdates(_0x5f52e5,_0xececeb){return function(_0x41d982){if(_0x41d982){return _0x41d982[_0x473a('0x26')](_0x5f52e5)[_0x473a('0x27')](function(_0x597fda){return _0x597fda;});}return null;};}function removeEntity(_0x429467,_0x3110e4){return function(_0x9aadc5){if(_0x9aadc5){return _0x9aadc5['destroy']()[_0x473a('0x27')](function(){var _0x283a02=_0x9aadc5[_0x473a('0x28')]({'plain':!![]});var _0x50c02e=_0x473a('0x29');return db[_0x473a('0x2a')][_0x473a('0x2b')]({'where':{'type':_0x50c02e,'resourceId':_0x283a02['id']}})[_0x473a('0x27')](function(){return _0x9aadc5;});})[_0x473a('0x27')](function(){_0x429467['status'](0xcc)[_0x473a('0x2c')]();});}};}function handleEntityNotFound(_0xcff90,_0x2c1342){return function(_0x53dd79){if(!_0x53dd79){_0xcff90['sendStatus'](0x194);}return _0x53dd79;};}function handleError(_0x37ad82,_0x1f79d1){_0x1f79d1=_0x1f79d1||0x1f4;return function(_0x15b517){logger[_0x473a('0x2d')](_0x15b517[_0x473a('0x2e')]);if(_0x15b517[_0x473a('0x2f')]){delete _0x15b517['name'];}_0x37ad82['status'](_0x1f79d1)[_0x473a('0x30')](_0x15b517);};}exports['index']=function(_0x427154,_0x4641c6){var _0x51d35b={},_0x481683={},_0x15960a={'count':0x0,'rows':[]};var _0x528f20=_[_0x473a('0x31')](db[_0x473a('0x32')]['rawAttributes'],function(_0x236e53){return{'name':_0x236e53[_0x473a('0x33')],'type':_0x236e53[_0x473a('0x34')][_0x473a('0x35')]};});_0x481683[_0x473a('0x36')]=_[_0x473a('0x31')](_0x528f20,_0x473a('0x2f'));_0x481683[_0x473a('0x37')]=_[_0x473a('0x38')](_0x427154['query']);_0x481683[_0x473a('0x39')]=_[_0x473a('0x3a')](_0x481683['model'],_0x481683['query']);_0x51d35b[_0x473a('0x3b')]=_[_0x473a('0x3a')](_0x481683[_0x473a('0x36')],qs[_0x473a('0x3c')](_0x427154[_0x473a('0x37')][_0x473a('0x3c')]));_0x51d35b['attributes']=_0x51d35b[_0x473a('0x3b')][_0x473a('0x3d')]?_0x51d35b[_0x473a('0x3b')]:_0x481683[_0x473a('0x36')];if(!_0x427154[_0x473a('0x37')][_0x473a('0x3e')](_0x473a('0x3f'))){_0x51d35b[_0x473a('0x1d')]=qs[_0x473a('0x1d')](_0x427154[_0x473a('0x37')]['limit']);_0x51d35b[_0x473a('0x1c')]=qs[_0x473a('0x1c')](_0x427154[_0x473a('0x37')][_0x473a('0x1c')]);}_0x51d35b[_0x473a('0x40')]=qs[_0x473a('0x41')](_0x427154[_0x473a('0x37')][_0x473a('0x41')]);_0x51d35b['where']=qs[_0x473a('0x39')](_[_0x473a('0x42')](_0x427154[_0x473a('0x37')],_0x481683[_0x473a('0x39')]),_0x528f20);if(_0x427154['query'][_0x473a('0x43')]){_0x51d35b[_0x473a('0x44')]=_[_0x473a('0x45')](_0x51d35b[_0x473a('0x44')],{'$or':_[_0x473a('0x31')](_0x528f20,function(_0x31b6f3){if(_0x31b6f3[_0x473a('0x34')]!==_0x473a('0x46')){var _0x4d9af0={};_0x4d9af0[_0x31b6f3['name']]={'$like':'%'+_0x427154[_0x473a('0x37')]['filter']+'%'};return _0x4d9af0;}})});}_0x51d35b=_['merge']({},_0x51d35b,_0x427154['options']);var _0x68886a={'where':_0x51d35b['where']};return db['Sound'][_0x473a('0x1f')](_0x68886a)['then'](function(_0x3b735d){_0x15960a[_0x473a('0x1f')]=_0x3b735d;if(_0x427154[_0x473a('0x37')][_0x473a('0x47')]){_0x51d35b['include']=[{'all':!![]}];}return db[_0x473a('0x32')]['findAll'](_0x51d35b);})[_0x473a('0x27')](function(_0x406a3b){_0x15960a['rows']=_0x406a3b;return _0x15960a;})[_0x473a('0x27')](respondWithFilteredResult(_0x4641c6,_0x51d35b))[_0x473a('0x48')](handleError(_0x4641c6,null));};exports['show']=function(_0x2a4e50,_0x2efb79){var _0x2db2f6={'raw':!![],'where':{'id':_0x2a4e50[_0x473a('0x49')]['id']}},_0x4d41aa={};_0x4d41aa[_0x473a('0x36')]=_['keys'](db[_0x473a('0x32')][_0x473a('0x4a')]);_0x4d41aa[_0x473a('0x37')]=_[_0x473a('0x38')](_0x2a4e50[_0x473a('0x37')]);_0x4d41aa[_0x473a('0x39')]=_[_0x473a('0x3a')](_0x4d41aa[_0x473a('0x36')],_0x4d41aa[_0x473a('0x37')]);_0x2db2f6[_0x473a('0x3b')]=_[_0x473a('0x3a')](_0x4d41aa[_0x473a('0x36')],qs['fields'](_0x2a4e50[_0x473a('0x37')]['fields']));_0x2db2f6['attributes']=_0x2db2f6[_0x473a('0x3b')][_0x473a('0x3d')]?_0x2db2f6[_0x473a('0x3b')]:_0x4d41aa[_0x473a('0x36')];if(_0x2a4e50[_0x473a('0x37')][_0x473a('0x47')]){_0x2db2f6['include']=[{'all':!![]}];}_0x2db2f6=_[_0x473a('0x45')]({},_0x2db2f6,_0x2a4e50[_0x473a('0x4b')]);return db[_0x473a('0x32')][_0x473a('0x4c')](_0x2db2f6)[_0x473a('0x27')](handleEntityNotFound(_0x2efb79,null))[_0x473a('0x27')](respondWithResult(_0x2efb79,null))[_0x473a('0x48')](handleError(_0x2efb79,null));};exports[_0x473a('0x4d')]=function(_0x1f9a9a,_0x58806a,_0x1fb3fe){return db[_0x473a('0x32')][_0x473a('0x4c')]({'where':{'id':_0x1f9a9a['params']['id']},'attributes':[_0x473a('0x2f'),_0x473a('0x4e'),_0x473a('0x4f')],'raw':!![]})[_0x473a('0x27')](handleEntityNotFound(_0x58806a,null))[_0x473a('0x27')](function(_0x55e4aa){if(_0x55e4aa){if(!fs[_0x473a('0x50')](path['join'](config[_0x473a('0x51')],'server/files/sounds/converted',_0x55e4aa['save_name']+'.'+_0x55e4aa['converted_format']))){throw new db[(_0x473a('0x52'))][(_0x473a('0x53'))](_0x473a('0x54'));}return _0x58806a['download'](path['join'](config['root'],_0x473a('0x55'),util[_0x473a('0x56')](_0x473a('0x57'),_0x55e4aa[_0x473a('0x4e')],_0x55e4aa['converted_format'])),util['format'](_0x473a('0x57'),_0x55e4aa[_0x473a('0x2f')],_0x55e4aa[_0x473a('0x4f')]));}return null;})[_0x473a('0x48')](handleError(_0x58806a,null));};exports[_0x473a('0x58')]=function(_0x2654f7,_0x164afc,_0xff1c30){var _0x54089c={'name':path[_0x473a('0x59')](_0x2654f7['file']['originalname'],path[_0x473a('0x5a')](_0x2654f7['file'][_0x473a('0x5b')])),'save_name':path['basename'](_0x2654f7[_0x473a('0x5c')]['filename'],path[_0x473a('0x5a')](_0x2654f7[_0x473a('0x5c')]['filename'])),'original_format':path[_0x473a('0x5a')](_0x2654f7[_0x473a('0x5c')][_0x473a('0x5b')])[_0x473a('0x5d')](0x1),'converted_format':_0x473a('0x5e')};var _0x31f994=path[_0x473a('0x5f')](config[_0x473a('0x51')],_0x473a('0x60'),_0x2654f7[_0x473a('0x5c')][_0x473a('0x61')]);var _0x586165=path[_0x473a('0x5f')](config['root'],'server/files/sounds/converted',util[_0x473a('0x56')](_0x473a('0x57'),path[_0x473a('0x59')](_0x2654f7[_0x473a('0x5c')]['filename'],path[_0x473a('0x5a')](_0x2654f7[_0x473a('0x5c')][_0x473a('0x61')])),_0x54089c[_0x473a('0x4f')]));logger[_0x473a('0x62')](_0x473a('0x63'),_0x31f994);logger[_0x473a('0x62')](_0x473a('0x64'),_0x586165);try{fs[_0x473a('0x65')](_0x31f994,parseInt('0777',0x8));var _0x5dd925=sox[_0x473a('0x66')](_0x31f994,_0x586165,{'sampleRate':0x1f40,'format':_0x473a('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5dd925['on'](_0x473a('0x2d'),function(_0x5994b5){fs[_0x473a('0x67')](_0x31f994);_0x164afc[_0x473a('0x1b')](0x1f4)['send'](_0x5994b5);});_0x5dd925['on'](_0x473a('0x68'),function(_0x351b00){_0x54089c[_0x473a('0x69')]=isNaN(_0x351b00['duration'])?null:_0x351b00['duration']*0x3e8;_0x54089c['original_sampleCount']=isNaN(_0x351b00[_0x473a('0x6a')])?null:_0x351b00[_0x473a('0x6a')];_0x54089c[_0x473a('0x6b')]=isNaN(_0x351b00[_0x473a('0x6c')])?null:_0x351b00[_0x473a('0x6c')];_0x54089c[_0x473a('0x6d')]=isNaN(_0x351b00['bitRate'])?null:_0x351b00['bitRate'];_0x54089c[_0x473a('0x6e')]=isNaN(_0x351b00[_0x473a('0x6f')])?null:_0x351b00['sampleRate'];});_0x5dd925['on'](_0x473a('0x70'),function(_0x3544c5){_0x54089c[_0x473a('0x71')]=isNaN(_0x3544c5[_0x473a('0x72')])?null:_0x3544c5[_0x473a('0x72')]*0x3e8;_0x54089c[_0x473a('0x73')]=isNaN(_0x3544c5[_0x473a('0x6a')])?null:_0x3544c5['sampleCount'];_0x54089c['converted_channelCount']=isNaN(_0x3544c5[_0x473a('0x6c')])?null:_0x3544c5['channelCount'];_0x54089c[_0x473a('0x74')]=isNaN(_0x3544c5[_0x473a('0x75')])?null:_0x3544c5[_0x473a('0x75')];_0x54089c['converted_sampleRate']=isNaN(_0x3544c5[_0x473a('0x6f')])?null:_0x3544c5[_0x473a('0x6f')];});_0x5dd925['on'](_0x473a('0x2c'),function(){fs['chmodSync'](_0x586165,parseInt(_0x473a('0x76'),0x8));return db[_0x473a('0x32')][_0x473a('0x58')](_0x54089c)['then'](function(_0x2d54a8){var _0x5959ef={'role':_0x2654f7[_0x473a('0x77')]['role'],'userProfileId':_0x2654f7[_0x473a('0x77')][_0x473a('0x78')]};if(!_0x5959ef)throw new Error(_0x473a('0x79'));if(_0x5959ef['role']===_0x473a('0x7a')){var _0x1ce876=_0x2d54a8['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Sounds','userProfileId':_0x5959ef[_0x473a('0x78')]},'raw':!![]})['then'](function(_0x1b246f){if(_0x1b246f&&_0x1b246f[_0x473a('0x7b')]===0x0){return db[_0x473a('0x2a')]['create']({'name':_0x1ce876[_0x473a('0x2f')],'resourceId':_0x1ce876['id'],'type':_0x1b246f['name'],'sectionId':_0x1b246f['id']},{})[_0x473a('0x27')](function(){return _0x2d54a8;});}else{return _0x2d54a8;}})[_0x473a('0x48')](function(_0x4f89ae){logger[_0x473a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f89ae);throw _0x4f89ae;});}return _0x2d54a8;})[_0x473a('0x27')](respondWithResult(_0x164afc,null))[_0x473a('0x48')](handleError(_0x164afc,null));});_0x5dd925[_0x473a('0x7c')]();}catch(_0x1d6c9c){_0x164afc[_0x473a('0x1b')](0x1f4)[_0x473a('0x30')](_0x1d6c9c);}};exports[_0x473a('0x26')]=function(_0x7383ac,_0x240377,_0x1cf2cf){return db[_0x473a('0x32')][_0x473a('0x4c')]({'where':{'id':_0x7383ac[_0x473a('0x49')]['id']}})[_0x473a('0x27')](handleEntityNotFound(_0x240377,null))[_0x473a('0x27')](saveUpdates(_[_0x473a('0x42')](_0x7383ac[_0x473a('0x77')],[_0x473a('0x2f'),_0x473a('0x7d')]),null))[_0x473a('0x27')](respondWithResult(_0x240377,null))['catch'](handleError(_0x240377,null));};exports[_0x473a('0x7e')]=function(_0x160e77,_0x2203e6,_0x3bb538){return db['Sound'][_0x473a('0x4c')]({'where':{'id':_0x160e77[_0x473a('0x49')]['id']}})[_0x473a('0x27')](function(_0x519ea9){if(_0x519ea9){return _0x519ea9[_0x473a('0x2b')]();}})[_0x473a('0x27')](function(_0x14146e){var _0x5b0133=path['join'](config['root'],_0x473a('0x60'),util[_0x473a('0x56')](_0x473a('0x57'),_0x14146e['save_name'],_0x14146e[_0x473a('0x7f')]));var _0x24cf4f=path[_0x473a('0x5f')](config[_0x473a('0x51')],_0x473a('0x55'),util[_0x473a('0x56')](_0x473a('0x57'),_0x14146e['save_name'],_0x14146e[_0x473a('0x4f')]));fs[_0x473a('0x67')](_0x5b0133);fs[_0x473a('0x67')](_0x24cf4f);return _0x14146e;})[_0x473a('0x27')](function(_0xd67c18){if(_0xd67c18){return _0x2203e6['status'](0xcc)[_0x473a('0x2c')]();}})[_0x473a('0x27')](handleEntityNotFound(_0x2203e6,null))['catch'](handleError(_0x2203e6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 9881161..de624c8 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 _0xfe35=['./sound.attributes','exports','Sound','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfe35,0x6b));var _0x5fe3=function(_0x332889,_0x4464f2){_0x332889=_0x332889-0x0;var _0x2130b9=_0xfe35[_0x332889];return _0x2130b9;};'use strict';var _=require(_0x5fe3('0x0'));var util=require(_0x5fe3('0x1'));var logger=require(_0x5fe3('0x2'))(_0x5fe3('0x3'));var moment=require(_0x5fe3('0x4'));var BPromise=require(_0x5fe3('0x5'));var rp=require(_0x5fe3('0x6'));var fs=require('fs');var path=require(_0x5fe3('0x7'));var rimraf=require(_0x5fe3('0x8'));var config=require(_0x5fe3('0x9'));var attributes=require(_0x5fe3('0xa'));module[_0x5fe3('0xb')]=function(_0x22c7a8,_0x526996){return _0x22c7a8['define'](_0x5fe3('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2757=['bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api'];(function(_0x12287a,_0x22f00c){var _0x2141a0=function(_0xeb3b07){while(--_0xeb3b07){_0x12287a['push'](_0x12287a['shift']());}};_0x2141a0(++_0x22f00c);}(_0x2757,0xf4));var _0x7275=function(_0x183b18,_0x243de5){_0x183b18=_0x183b18-0x0;var _0xad9a35=_0x2757[_0x183b18];return _0xad9a35;};'use strict';var _=require(_0x7275('0x0'));var util=require('util');var logger=require(_0x7275('0x1'))(_0x7275('0x2'));var moment=require('moment');var BPromise=require(_0x7275('0x3'));var rp=require(_0x7275('0x4'));var fs=require('fs');var path=require(_0x7275('0x5'));var rimraf=require(_0x7275('0x6'));var config=require(_0x7275('0x7'));var attributes=require(_0x7275('0x8'));module[_0x7275('0x9')]=function(_0x134226,_0x53befb){return _0x134226[_0x7275('0xa')](_0x7275('0xb'),attributes,{'tableName':_0x7275('0xc'),'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 fe15379..95dbf94 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 _0xe342=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','find','options','raw','include','model','map','attributes','stringify','lodash','moment','randomstring'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe342,0x129));var _0x2e34=function(_0x2685b2,_0x513f32){_0x2685b2=_0x2685b2-0x0;var _0x54b54e=_0xe342[_0x2685b2];return _0x54b54e;};'use strict';var _=require(_0x2e34('0x0'));var util=require('util');var moment=require(_0x2e34('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e34('0x2'));var fs=require('fs');var Redis=require(_0x2e34('0x3'));var db=require(_0x2e34('0x4'))['db'];var utils=require(_0x2e34('0x5'));var logger=require(_0x2e34('0x6'))('rpc');var config=require(_0x2e34('0x7'));var jayson=require(_0x2e34('0x8'));var client=jayson['client'][_0x2e34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a799,_0x3cd3e0,_0x354d0c){return new BPromise(function(_0xacce9b,_0xf6bfa2){return client[_0x2e34('0xa')](_0x14a799,_0x354d0c)[_0x2e34('0xb')](function(_0x1a70fe){logger[_0x2e34('0xc')](_0x2e34('0xd'),_0x3cd3e0,'request\x20sent');logger[_0x2e34('0xe')](_0x2e34('0xf'),_0x3cd3e0,'request\x20sent',JSON['stringify'](_0x1a70fe));if(_0x1a70fe[_0x2e34('0x10')]){if(_0x1a70fe[_0x2e34('0x10')][_0x2e34('0x11')]===0x1f4){logger[_0x2e34('0x10')](_0x2e34('0xd'),_0x3cd3e0,_0x1a70fe[_0x2e34('0x10')][_0x2e34('0x12')]);return _0xf6bfa2(_0x1a70fe[_0x2e34('0x10')][_0x2e34('0x12')]);}logger['error'](_0x2e34('0xd'),_0x3cd3e0,_0x1a70fe['error'][_0x2e34('0x12')]);return _0xacce9b(_0x1a70fe[_0x2e34('0x10')]['message']);}else{logger[_0x2e34('0xc')](_0x2e34('0xd'),_0x3cd3e0,'request\x20sent');_0xacce9b(_0x1a70fe[_0x2e34('0x13')][_0x2e34('0x12')]);}})[_0x2e34('0x14')](function(_0x472afc){logger[_0x2e34('0x10')](_0x2e34('0xd'),_0x3cd3e0,_0x472afc);_0xf6bfa2(_0x472afc);});});}exports[_0x2e34('0x15')]=function(_0x393807){var _0x195637=this;return new Promise(function(_0x3d0eb8,_0x35259d){return db['Sound'][_0x2e34('0x16')]({'raw':_0x393807['options']?_0x393807[_0x2e34('0x17')][_0x2e34('0x18')]===undefined?!![]:![]:!![],'where':_0x393807['options']?_0x393807[_0x2e34('0x17')]['where']||null:null,'attributes':_0x393807[_0x2e34('0x17')]?_0x393807[_0x2e34('0x17')]['attributes']||null:null,'include':_0x393807[_0x2e34('0x17')]?_0x393807['options'][_0x2e34('0x19')]?_['map'](_0x393807['options'][_0x2e34('0x19')],function(_0x3ac8fe){return{'model':db[_0x3ac8fe[_0x2e34('0x1a')]],'as':_0x3ac8fe['as'],'attributes':_0x3ac8fe['attributes'],'include':_0x3ac8fe[_0x2e34('0x19')]?_[_0x2e34('0x1b')](_0x3ac8fe[_0x2e34('0x19')],function(_0x3819f2){return{'model':db[_0x3819f2[_0x2e34('0x1a')]],'as':_0x3819f2['as'],'attributes':_0x3819f2['attributes'],'include':_0x3819f2[_0x2e34('0x19')]?_['map'](_0x3819f2[_0x2e34('0x19')],function(_0x55582c){return{'model':db[_0x55582c[_0x2e34('0x1a')]],'as':_0x55582c['as'],'attributes':_0x55582c[_0x2e34('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f4a97){logger[_0x2e34('0xc')]('ShowSound',_0x393807);logger['debug'](_0x2e34('0x15'),_0x393807,JSON[_0x2e34('0x1d')](_0x2f4a97));_0x3d0eb8(_0x2f4a97);})[_0x2e34('0x14')](function(_0x295f4a){logger['error'](_0x2e34('0x15'),_0x295f4a['message'],_0x393807);_0x35259d(_0x195637[_0x2e34('0x10')](0x1f4,_0x295f4a[_0x2e34('0x12')]));});});}; \ No newline at end of file +var _0xd1d0=['jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xecdd9b,_0x3f2836){var _0x17237d=function(_0x37430b){while(--_0x37430b){_0xecdd9b['push'](_0xecdd9b['shift']());}};_0x17237d(++_0x3f2836);}(_0xd1d0,0x118));var _0x0d1d=function(_0x4e2697,_0x5e860d){_0x4e2697=_0x4e2697-0x0;var _0x46fe39=_0xd1d0[_0x4e2697];return _0x46fe39;};'use strict';var _=require('lodash');var util=require(_0x0d1d('0x0'));var moment=require('moment');var BPromise=require(_0x0d1d('0x1'));var rs=require(_0x0d1d('0x2'));var fs=require('fs');var Redis=require(_0x0d1d('0x3'));var db=require(_0x0d1d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d1d('0x5'))(_0x0d1d('0x6'));var config=require(_0x0d1d('0x7'));var jayson=require(_0x0d1d('0x8'));var client=jayson['client'][_0x0d1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x196d14,_0x9ec677,_0x28f376){return new BPromise(function(_0x490d81,_0x3c8a59){return client[_0x0d1d('0xa')](_0x196d14,_0x28f376)[_0x0d1d('0xb')](function(_0x139c54){logger[_0x0d1d('0xc')](_0x0d1d('0xd'),_0x9ec677,_0x0d1d('0xe'));logger[_0x0d1d('0xf')](_0x0d1d('0x10'),_0x9ec677,'request\x20sent',JSON[_0x0d1d('0x11')](_0x139c54));if(_0x139c54[_0x0d1d('0x12')]){if(_0x139c54[_0x0d1d('0x12')][_0x0d1d('0x13')]===0x1f4){logger['error'](_0x0d1d('0xd'),_0x9ec677,_0x139c54['error'][_0x0d1d('0x14')]);return _0x3c8a59(_0x139c54[_0x0d1d('0x12')][_0x0d1d('0x14')]);}logger[_0x0d1d('0x12')](_0x0d1d('0xd'),_0x9ec677,_0x139c54[_0x0d1d('0x12')][_0x0d1d('0x14')]);return _0x490d81(_0x139c54[_0x0d1d('0x12')][_0x0d1d('0x14')]);}else{logger[_0x0d1d('0xc')](_0x0d1d('0xd'),_0x9ec677,'request\x20sent');_0x490d81(_0x139c54[_0x0d1d('0x15')][_0x0d1d('0x14')]);}})[_0x0d1d('0x16')](function(_0x7490a0){logger['error'](_0x0d1d('0xd'),_0x9ec677,_0x7490a0);_0x3c8a59(_0x7490a0);});});}exports[_0x0d1d('0x17')]=function(_0x3c6c92){var _0x41c801=this;return new Promise(function(_0x4444c9,_0x66c6c5){return db[_0x0d1d('0x18')][_0x0d1d('0x19')]({'raw':_0x3c6c92[_0x0d1d('0x1a')]?_0x3c6c92['options'][_0x0d1d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c6c92[_0x0d1d('0x1a')]?_0x3c6c92['options']['where']||null:null,'attributes':_0x3c6c92['options']?_0x3c6c92[_0x0d1d('0x1a')][_0x0d1d('0x1c')]||null:null,'include':_0x3c6c92[_0x0d1d('0x1a')]?_0x3c6c92[_0x0d1d('0x1a')][_0x0d1d('0x1d')]?_[_0x0d1d('0x1e')](_0x3c6c92[_0x0d1d('0x1a')][_0x0d1d('0x1d')],function(_0x274ba5){return{'model':db[_0x274ba5[_0x0d1d('0x1f')]],'as':_0x274ba5['as'],'attributes':_0x274ba5['attributes'],'include':_0x274ba5[_0x0d1d('0x1d')]?_['map'](_0x274ba5[_0x0d1d('0x1d')],function(_0x5a4e1b){return{'model':db[_0x5a4e1b[_0x0d1d('0x1f')]],'as':_0x5a4e1b['as'],'attributes':_0x5a4e1b['attributes'],'include':_0x5a4e1b['include']?_[_0x0d1d('0x1e')](_0x5a4e1b[_0x0d1d('0x1d')],function(_0x5a8825){return{'model':db[_0x5a8825[_0x0d1d('0x1f')]],'as':_0x5a8825['as'],'attributes':_0x5a8825[_0x0d1d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0d1d('0xb')](function(_0x26ac5c){logger[_0x0d1d('0xc')]('ShowSound',_0x3c6c92);logger['debug'](_0x0d1d('0x17'),_0x3c6c92,JSON[_0x0d1d('0x11')](_0x26ac5c));_0x4444c9(_0x26ac5c);})[_0x0d1d('0x16')](function(_0x39426a){logger[_0x0d1d('0x12')](_0x0d1d('0x17'),_0x39426a[_0x0d1d('0x14')],_0x3c6c92);_0x66c6c5(_0x41c801['error'](0x1f4,_0x39426a[_0x0d1d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a3f96e8..cae5b06 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1bb368,_0x1155b3){var _0x282a87=function(_0x550b05){while(--_0x550b05){_0x1bb368['push'](_0x1bb368['shift']());}};_0x282a87(++_0x1155b3);}(_0xb10b,0x12a));var _0xbb10=function(_0xdee7ec,_0x29d552){_0xdee7ec=_0xdee7ec-0x0;var _0x1879b6=_0xb10b[_0xdee7ec];return _0x1879b6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x471898,_0x8354a9){_0x471898=_0x471898-0x0;var _0x566793=_0x9ffd[_0x471898];return _0x566793;};'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('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 8dadc6a..a4b9967 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 _0x9c8d=['out','TEXT'];(function(_0x51f5c8,_0x2aa90d){var _0x30789e=function(_0x3c5640){while(--_0x3c5640){_0x51f5c8['push'](_0x51f5c8['shift']());}};_0x30789e(++_0x2aa90d);}(_0x9c8d,0x19f));var _0xd9c8=function(_0x1be899,_0x2ca1b3){_0x1be899=_0x1be899-0x0;var _0xb8881b=_0x9c8d[_0x1be899];return _0xb8881b;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xd9c8('0x0')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd9c8('0x1')),'defaultValue':_0xd9c8('0x1'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd9c8('0x0')]}}; \ No newline at end of file +var _0xa116=['exports','STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x5966d3,_0x47f9a6){var _0x342a1c=function(_0x2309cf){while(--_0x2309cf){_0x5966d3['push'](_0x5966d3['shift']());}};_0x342a1c(++_0x47f9a6);}(_0xa116,0xd1));var _0x6a11=function(_0x443125,_0x427648){_0x443125=_0x443125-0x0;var _0x30ffaf=_0xa116[_0x443125];return _0x30ffaf;};'use strict';var Sequelize=require(_0x6a11('0x0'));module[_0x6a11('0x1')]={'uniqueid':{'type':Sequelize[_0x6a11('0x2')]},'body':{'type':Sequelize[_0x6a11('0x3')](_0x6a11('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x6a11('0x5')]('in',_0x6a11('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x6a11('0x2')]},'providerResponse':{'type':Sequelize[_0x6a11('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 6e61219..9121505 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 _0x27f3=['querystring','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','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','SquareMessage','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','VIRTUAL','merge','include','findAll','catch','show','params','options','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x537239,_0xb22eac){var _0xf787ce=function(_0x3021f6){while(--_0x3021f6){_0x537239['push'](_0x537239['shift']());}};_0xf787ce(++_0xb22eac);}(_0x27f3,0x1e9));var _0x327f=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x27f3[_0x21f9c2];return _0x3da17f;};'use strict';var emlformat=require(_0x327f('0x0'));var rimraf=require(_0x327f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x327f('0x2'));var rp=require(_0x327f('0x3'));var moment=require('moment');var BPromise=require(_0x327f('0x4'));var Mustache=require('mustache');var util=require(_0x327f('0x5'));var path=require(_0x327f('0x6'));var sox=require(_0x327f('0x7'));var csv=require(_0x327f('0x8'));var ejs=require(_0x327f('0x9'));var fs=require('fs');var fs_extra=require(_0x327f('0xa'));var _=require(_0x327f('0xb'));var squel=require(_0x327f('0xc'));var crypto=require('crypto');var jsforce=require(_0x327f('0xd'));var deskjs=require(_0x327f('0xe'));var toCsv=require(_0x327f('0x8'));var querystring=require(_0x327f('0xf'));var Papa=require(_0x327f('0x10'));var Redis=require(_0x327f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x327f('0x12'));var as=require(_0x327f('0x13'));var hardwareService=require(_0x327f('0x14'));var logger=require(_0x327f('0x15'))(_0x327f('0x16'));var utils=require(_0x327f('0x17'));var config=require(_0x327f('0x18'));var licenseUtil=require(_0x327f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30bdf6,_0x2d44ea){_0x2d44ea=_0x2d44ea||0xcc;return function(_0x22cf14){if(_0x22cf14){return _0x30bdf6[_0x327f('0x1a')](_0x2d44ea);}return _0x30bdf6[_0x327f('0x1b')](_0x2d44ea)[_0x327f('0x1c')]();};}function respondWithResult(_0x3dd9bb,_0x2a1c25){_0x2a1c25=_0x2a1c25||0xc8;return function(_0x4d72c3){if(_0x4d72c3){return _0x3dd9bb['status'](_0x2a1c25)[_0x327f('0x1d')](_0x4d72c3);}};}function respondWithFilteredResult(_0x378ed8,_0x40ae4f){return function(_0x67e1f4){if(_0x67e1f4){var _0x36731f=typeof _0x40ae4f[_0x327f('0x1e')]===_0x327f('0x1f')&&typeof _0x40ae4f[_0x327f('0x20')]===_0x327f('0x1f');var _0x38d11b=_0x67e1f4[_0x327f('0x21')];var _0x56e60c=_0x36731f?0x0:_0x40ae4f[_0x327f('0x1e')];var _0x19c63a=_0x36731f?_0x67e1f4[_0x327f('0x21')]:_0x40ae4f[_0x327f('0x1e')]+_0x40ae4f[_0x327f('0x20')];var _0x329e17;if(_0x19c63a>=_0x38d11b){_0x19c63a=_0x38d11b;_0x329e17=0xc8;}else{_0x329e17=0xce;}_0x378ed8[_0x327f('0x1b')](_0x329e17);return _0x378ed8[_0x327f('0x22')](_0x327f('0x23'),_0x56e60c+'-'+_0x19c63a+'/'+_0x38d11b)[_0x327f('0x1d')](_0x67e1f4);}return null;};}function patchUpdates(_0x57b1e5){return function(_0x2c18e8){try{jsonpatch[_0x327f('0x24')](_0x2c18e8,_0x57b1e5,!![]);}catch(_0x55b2a0){return BPromise[_0x327f('0x25')](_0x55b2a0);}return _0x2c18e8[_0x327f('0x26')]();};}function saveUpdates(_0x2737c4,_0x4742ab){return function(_0x37e959){if(_0x37e959){return _0x37e959['update'](_0x2737c4)[_0x327f('0x27')](function(_0x173cd2){return _0x173cd2;});}return null;};}function removeEntity(_0x321bef,_0x4eb966){return function(_0x1f1d98){if(_0x1f1d98){return _0x1f1d98[_0x327f('0x28')]()[_0x327f('0x27')](function(){_0x321bef[_0x327f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa8a89b,_0x372a4e){return function(_0x222601){if(!_0x222601){_0xa8a89b[_0x327f('0x1a')](0x194);}return _0x222601;};}function handleError(_0x4664d3,_0x661ca0){_0x661ca0=_0x661ca0||0x1f4;return function(_0x1c22e4){logger['error'](_0x1c22e4[_0x327f('0x29')]);if(_0x1c22e4[_0x327f('0x2a')]){delete _0x1c22e4[_0x327f('0x2a')];}_0x4664d3['status'](_0x661ca0)[_0x327f('0x2b')](_0x1c22e4);};}exports[_0x327f('0x2c')]=function(_0x44598d,_0xc0489e){var _0x12587d={},_0x123c42={},_0x45b5a2={'count':0x0,'rows':[]};var _0x4d0621=_['map'](db[_0x327f('0x2d')]['rawAttributes'],function(_0x1a6e22){return{'name':_0x1a6e22['fieldName'],'type':_0x1a6e22[_0x327f('0x2e')]['key']};});_0x123c42['model']=_[_0x327f('0x2f')](_0x4d0621,_0x327f('0x2a'));_0x123c42[_0x327f('0x30')]=_[_0x327f('0x31')](_0x44598d['query']);_0x123c42[_0x327f('0x32')]=_[_0x327f('0x33')](_0x123c42[_0x327f('0x34')],_0x123c42[_0x327f('0x30')]);_0x12587d[_0x327f('0x35')]=_[_0x327f('0x33')](_0x123c42[_0x327f('0x34')],qs['fields'](_0x44598d[_0x327f('0x30')][_0x327f('0x36')]));_0x12587d[_0x327f('0x35')]=_0x12587d[_0x327f('0x35')][_0x327f('0x37')]?_0x12587d['attributes']:_0x123c42[_0x327f('0x34')];if(!_0x44598d[_0x327f('0x30')]['hasOwnProperty']('nolimit')){_0x12587d[_0x327f('0x20')]=qs[_0x327f('0x20')](_0x44598d[_0x327f('0x30')][_0x327f('0x20')]);_0x12587d[_0x327f('0x1e')]=qs['offset'](_0x44598d[_0x327f('0x30')]['offset']);}_0x12587d[_0x327f('0x38')]=qs[_0x327f('0x39')](_0x44598d[_0x327f('0x30')][_0x327f('0x39')]);_0x12587d[_0x327f('0x3a')]=qs[_0x327f('0x32')](_['pick'](_0x44598d[_0x327f('0x30')],_0x123c42['filters']),_0x4d0621);if(_0x44598d['query'][_0x327f('0x3b')]){_0x12587d['where']=_['merge'](_0x12587d[_0x327f('0x3a')],{'$or':_[_0x327f('0x2f')](_0x4d0621,function(_0x177c5e){if(_0x177c5e['type']!==_0x327f('0x3c')){var _0xce3980={};_0xce3980[_0x177c5e[_0x327f('0x2a')]]={'$like':'%'+_0x44598d[_0x327f('0x30')][_0x327f('0x3b')]+'%'};return _0xce3980;}})});}_0x12587d=_[_0x327f('0x3d')]({},_0x12587d,_0x44598d['options']);var _0x3ed04b={'where':_0x12587d[_0x327f('0x3a')]};return db[_0x327f('0x2d')]['count'](_0x3ed04b)[_0x327f('0x27')](function(_0x152e3a){_0x45b5a2['count']=_0x152e3a;if(_0x44598d['query']['includeAll']){_0x12587d[_0x327f('0x3e')]=[{'all':!![]}];}return db[_0x327f('0x2d')][_0x327f('0x3f')](_0x12587d);})[_0x327f('0x27')](function(_0x206509){_0x45b5a2['rows']=_0x206509;return _0x45b5a2;})[_0x327f('0x27')](respondWithFilteredResult(_0xc0489e,_0x12587d))[_0x327f('0x40')](handleError(_0xc0489e,null));};exports[_0x327f('0x41')]=function(_0x246e0c,_0x59bc55){var _0x59a4f8={'raw':!![],'where':{'id':_0x246e0c[_0x327f('0x42')]['id']}},_0x38cd2d={};_0x38cd2d['model']=_['keys'](db[_0x327f('0x2d')]['rawAttributes']);_0x38cd2d[_0x327f('0x30')]=_[_0x327f('0x31')](_0x246e0c['query']);_0x38cd2d[_0x327f('0x32')]=_[_0x327f('0x33')](_0x38cd2d['model'],_0x38cd2d['query']);_0x59a4f8[_0x327f('0x35')]=_[_0x327f('0x33')](_0x38cd2d[_0x327f('0x34')],qs[_0x327f('0x36')](_0x246e0c['query'][_0x327f('0x36')]));_0x59a4f8['attributes']=_0x59a4f8[_0x327f('0x35')][_0x327f('0x37')]?_0x59a4f8[_0x327f('0x35')]:_0x38cd2d[_0x327f('0x34')];if(_0x246e0c[_0x327f('0x30')]['includeAll']){_0x59a4f8[_0x327f('0x3e')]=[{'all':!![]}];}_0x59a4f8=_[_0x327f('0x3d')]({},_0x59a4f8,_0x246e0c[_0x327f('0x43')]);return db[_0x327f('0x2d')]['find'](_0x59a4f8)[_0x327f('0x27')](handleEntityNotFound(_0x59bc55,null))[_0x327f('0x27')](respondWithResult(_0x59bc55,null))[_0x327f('0x40')](handleError(_0x59bc55,null));};exports[_0x327f('0x44')]=function(_0x378f05,_0x5686d6){return db['SquareMessage'][_0x327f('0x44')](_0x378f05[_0x327f('0x45')],{})['then'](respondWithResult(_0x5686d6,0xc9))[_0x327f('0x40')](handleError(_0x5686d6,null));};exports[_0x327f('0x46')]=function(_0x3b4dee,_0x510093){if(_0x3b4dee[_0x327f('0x45')]['id']){delete _0x3b4dee[_0x327f('0x45')]['id'];}return db[_0x327f('0x2d')][_0x327f('0x47')]({'where':{'id':_0x3b4dee[_0x327f('0x42')]['id']}})[_0x327f('0x27')](handleEntityNotFound(_0x510093,null))[_0x327f('0x27')](saveUpdates(_0x3b4dee['body'],null))[_0x327f('0x27')](respondWithResult(_0x510093,null))['catch'](handleError(_0x510093,null));};exports[_0x327f('0x28')]=function(_0x3baf5c,_0x2004b7){return db[_0x327f('0x2d')]['find']({'where':{'id':_0x3baf5c['params']['id']}})[_0x327f('0x27')](handleEntityNotFound(_0x2004b7,null))[_0x327f('0x27')](removeEntity(_0x2004b7,null))['catch'](handleError(_0x2004b7,null));}; \ No newline at end of file +var _0x4bd3=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','SquareMessage','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','map','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x4bd3,0x10f));var _0x34bd=function(_0x56b50e,_0x51dd71){_0x56b50e=_0x56b50e-0x0;var _0x4a6cb8=_0x4bd3[_0x56b50e];return _0x4a6cb8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x34bd('0x0'));var rp=require(_0x34bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x34bd('0x2'));var util=require(_0x34bd('0x3'));var path=require(_0x34bd('0x4'));var sox=require('sox');var csv=require(_0x34bd('0x5'));var ejs=require(_0x34bd('0x6'));var fs=require('fs');var fs_extra=require(_0x34bd('0x7'));var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require(_0x34bd('0xa'));var jsforce=require(_0x34bd('0xb'));var deskjs=require(_0x34bd('0xc'));var toCsv=require(_0x34bd('0x5'));var querystring=require(_0x34bd('0xd'));var Papa=require('papaparse');var Redis=require(_0x34bd('0xe'));var authService=require(_0x34bd('0xf'));var qs=require(_0x34bd('0x10'));var as=require(_0x34bd('0x11'));var hardwareService=require(_0x34bd('0x12'));var logger=require(_0x34bd('0x13'))(_0x34bd('0x14'));var utils=require(_0x34bd('0x15'));var config=require(_0x34bd('0x16'));var licenseUtil=require(_0x34bd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cfd86,_0x7a8ec6){_0x7a8ec6=_0x7a8ec6||0xcc;return function(_0x26a515){if(_0x26a515){return _0x2cfd86['sendStatus'](_0x7a8ec6);}return _0x2cfd86[_0x34bd('0x18')](_0x7a8ec6)[_0x34bd('0x19')]();};}function respondWithResult(_0x3af1d1,_0x3f6130){_0x3f6130=_0x3f6130||0xc8;return function(_0x320bc9){if(_0x320bc9){return _0x3af1d1[_0x34bd('0x18')](_0x3f6130)[_0x34bd('0x1a')](_0x320bc9);}};}function respondWithFilteredResult(_0x1ee4eb,_0x423a90){return function(_0x58425a){if(_0x58425a){var _0xf33ca0=typeof _0x423a90[_0x34bd('0x1b')]===_0x34bd('0x1c')&&typeof _0x423a90['limit']===_0x34bd('0x1c');var _0x257402=_0x58425a[_0x34bd('0x1d')];var _0x492144=_0xf33ca0?0x0:_0x423a90[_0x34bd('0x1b')];var _0x2f4c7b=_0xf33ca0?_0x58425a['count']:_0x423a90[_0x34bd('0x1b')]+_0x423a90[_0x34bd('0x1e')];var _0x963ebc;if(_0x2f4c7b>=_0x257402){_0x2f4c7b=_0x257402;_0x963ebc=0xc8;}else{_0x963ebc=0xce;}_0x1ee4eb[_0x34bd('0x18')](_0x963ebc);return _0x1ee4eb[_0x34bd('0x1f')](_0x34bd('0x20'),_0x492144+'-'+_0x2f4c7b+'/'+_0x257402)[_0x34bd('0x1a')](_0x58425a);}return null;};}function patchUpdates(_0x293426){return function(_0x36613e){try{jsonpatch[_0x34bd('0x21')](_0x36613e,_0x293426,!![]);}catch(_0x4e80fd){return BPromise[_0x34bd('0x22')](_0x4e80fd);}return _0x36613e[_0x34bd('0x23')]();};}function saveUpdates(_0x4823c7,_0x373ad5){return function(_0x2c341a){if(_0x2c341a){return _0x2c341a[_0x34bd('0x24')](_0x4823c7)[_0x34bd('0x25')](function(_0x500747){return _0x500747;});}return null;};}function removeEntity(_0x444f21,_0x2acdc2){return function(_0x5c1616){if(_0x5c1616){return _0x5c1616[_0x34bd('0x26')]()[_0x34bd('0x25')](function(){_0x444f21[_0x34bd('0x18')](0xcc)[_0x34bd('0x19')]();});}};}function handleEntityNotFound(_0x3556ff,_0x3c1c6e){return function(_0x3095bf){if(!_0x3095bf){_0x3556ff[_0x34bd('0x27')](0x194);}return _0x3095bf;};}function handleError(_0x55815b,_0x57e03a){_0x57e03a=_0x57e03a||0x1f4;return function(_0x170ea6){logger[_0x34bd('0x28')](_0x170ea6['stack']);if(_0x170ea6[_0x34bd('0x29')]){delete _0x170ea6['name'];}_0x55815b[_0x34bd('0x18')](_0x57e03a)[_0x34bd('0x2a')](_0x170ea6);};}exports[_0x34bd('0x2b')]=function(_0x302f77,_0x3c5479){var _0x5d9579={},_0x169786={},_0x545089={'count':0x0,'rows':[]};var _0x300b60=_['map'](db[_0x34bd('0x2c')][_0x34bd('0x2d')],function(_0x28611e){return{'name':_0x28611e['fieldName'],'type':_0x28611e['type'][_0x34bd('0x2e')]};});_0x169786[_0x34bd('0x2f')]=_['map'](_0x300b60,_0x34bd('0x29'));_0x169786['query']=_[_0x34bd('0x30')](_0x302f77[_0x34bd('0x31')]);_0x169786[_0x34bd('0x32')]=_[_0x34bd('0x33')](_0x169786[_0x34bd('0x2f')],_0x169786[_0x34bd('0x31')]);_0x5d9579[_0x34bd('0x34')]=_[_0x34bd('0x33')](_0x169786[_0x34bd('0x2f')],qs[_0x34bd('0x35')](_0x302f77['query'][_0x34bd('0x35')]));_0x5d9579['attributes']=_0x5d9579['attributes']['length']?_0x5d9579[_0x34bd('0x34')]:_0x169786['model'];if(!_0x302f77['query']['hasOwnProperty']('nolimit')){_0x5d9579[_0x34bd('0x1e')]=qs['limit'](_0x302f77[_0x34bd('0x31')][_0x34bd('0x1e')]);_0x5d9579['offset']=qs['offset'](_0x302f77[_0x34bd('0x31')]['offset']);}_0x5d9579[_0x34bd('0x36')]=qs[_0x34bd('0x37')](_0x302f77[_0x34bd('0x31')][_0x34bd('0x37')]);_0x5d9579[_0x34bd('0x38')]=qs[_0x34bd('0x32')](_['pick'](_0x302f77[_0x34bd('0x31')],_0x169786[_0x34bd('0x32')]),_0x300b60);if(_0x302f77[_0x34bd('0x31')][_0x34bd('0x39')]){_0x5d9579[_0x34bd('0x38')]=_[_0x34bd('0x3a')](_0x5d9579[_0x34bd('0x38')],{'$or':_[_0x34bd('0x3b')](_0x300b60,function(_0x25f6ac){if(_0x25f6ac['type']!=='VIRTUAL'){var _0x116f0c={};_0x116f0c[_0x25f6ac['name']]={'$like':'%'+_0x302f77[_0x34bd('0x31')][_0x34bd('0x39')]+'%'};return _0x116f0c;}})});}_0x5d9579=_[_0x34bd('0x3a')]({},_0x5d9579,_0x302f77[_0x34bd('0x3c')]);var _0x200363={'where':_0x5d9579[_0x34bd('0x38')]};return db['SquareMessage'][_0x34bd('0x1d')](_0x200363)[_0x34bd('0x25')](function(_0x3e8705){_0x545089[_0x34bd('0x1d')]=_0x3e8705;if(_0x302f77[_0x34bd('0x31')][_0x34bd('0x3d')]){_0x5d9579['include']=[{'all':!![]}];}return db[_0x34bd('0x2c')][_0x34bd('0x3e')](_0x5d9579);})['then'](function(_0x36ae3e){_0x545089[_0x34bd('0x3f')]=_0x36ae3e;return _0x545089;})[_0x34bd('0x25')](respondWithFilteredResult(_0x3c5479,_0x5d9579))[_0x34bd('0x40')](handleError(_0x3c5479,null));};exports['show']=function(_0x59850e,_0x46d855){var _0x242894={'raw':!![],'where':{'id':_0x59850e[_0x34bd('0x41')]['id']}},_0x1572be={};_0x1572be['model']=_[_0x34bd('0x30')](db['SquareMessage'][_0x34bd('0x2d')]);_0x1572be['query']=_[_0x34bd('0x30')](_0x59850e['query']);_0x1572be[_0x34bd('0x32')]=_[_0x34bd('0x33')](_0x1572be[_0x34bd('0x2f')],_0x1572be[_0x34bd('0x31')]);_0x242894[_0x34bd('0x34')]=_[_0x34bd('0x33')](_0x1572be[_0x34bd('0x2f')],qs[_0x34bd('0x35')](_0x59850e[_0x34bd('0x31')][_0x34bd('0x35')]));_0x242894[_0x34bd('0x34')]=_0x242894['attributes'][_0x34bd('0x42')]?_0x242894[_0x34bd('0x34')]:_0x1572be[_0x34bd('0x2f')];if(_0x59850e['query']['includeAll']){_0x242894[_0x34bd('0x43')]=[{'all':!![]}];}_0x242894=_['merge']({},_0x242894,_0x59850e[_0x34bd('0x3c')]);return db[_0x34bd('0x2c')][_0x34bd('0x44')](_0x242894)[_0x34bd('0x25')](handleEntityNotFound(_0x46d855,null))[_0x34bd('0x25')](respondWithResult(_0x46d855,null))['catch'](handleError(_0x46d855,null));};exports[_0x34bd('0x45')]=function(_0x12d712,_0x407b0c){return db[_0x34bd('0x2c')][_0x34bd('0x45')](_0x12d712[_0x34bd('0x46')],{})[_0x34bd('0x25')](respondWithResult(_0x407b0c,0xc9))[_0x34bd('0x40')](handleError(_0x407b0c,null));};exports[_0x34bd('0x24')]=function(_0x186034,_0x2d01d8){if(_0x186034[_0x34bd('0x46')]['id']){delete _0x186034['body']['id'];}return db['SquareMessage'][_0x34bd('0x44')]({'where':{'id':_0x186034[_0x34bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d01d8,null))[_0x34bd('0x25')](saveUpdates(_0x186034[_0x34bd('0x46')],null))[_0x34bd('0x25')](respondWithResult(_0x2d01d8,null))[_0x34bd('0x40')](handleError(_0x2d01d8,null));};exports[_0x34bd('0x26')]=function(_0x32cbe8,_0x27c1b8){return db[_0x34bd('0x2c')][_0x34bd('0x44')]({'where':{'id':_0x32cbe8[_0x34bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x27c1b8,null))[_0x34bd('0x25')](removeEntity(_0x27c1b8,null))[_0x34bd('0x40')](handleError(_0x27c1b8,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 9e8ac57..6667158 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 _0x3c33=['bluebird','request-promise','path','rimraf','./squareMessage.attributes','exports','define','SquareMessage','lodash','util','api'];(function(_0x2fe033,_0x139466){var _0x268620=function(_0x123909){while(--_0x123909){_0x2fe033['push'](_0x2fe033['shift']());}};_0x268620(++_0x139466);}(_0x3c33,0x194));var _0x33c3=function(_0x4f6436,_0x4b59ac){_0x4f6436=_0x4f6436-0x0;var _0x3756b8=_0x3c33[_0x4f6436];return _0x3756b8;};'use strict';var _=require(_0x33c3('0x0'));var util=require(_0x33c3('0x1'));var logger=require('../../config/logger')(_0x33c3('0x2'));var moment=require('moment');var BPromise=require(_0x33c3('0x3'));var rp=require(_0x33c3('0x4'));var fs=require('fs');var path=require(_0x33c3('0x5'));var rimraf=require(_0x33c3('0x6'));var config=require('../../config/environment');var attributes=require(_0x33c3('0x7'));module[_0x33c3('0x8')]=function(_0x1cf01b,_0x49b410){return _0x1cf01b[_0x33c3('0x9')](_0x33c3('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43e9=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x648f5e,_0x69583c){var _0x3cf5b5=function(_0x4b24fe){while(--_0x4b24fe){_0x648f5e['push'](_0x648f5e['shift']());}};_0x3cf5b5(++_0x69583c);}(_0x43e9,0xca));var _0x943e=function(_0x2d424a,_0x5ec74c){_0x2d424a=_0x2d424a-0x0;var _0x351031=_0x43e9[_0x2d424a];return _0x351031;};'use strict';var _=require('lodash');var util=require(_0x943e('0x0'));var logger=require(_0x943e('0x1'))(_0x943e('0x2'));var moment=require('moment');var BPromise=require(_0x943e('0x3'));var rp=require(_0x943e('0x4'));var fs=require('fs');var path=require(_0x943e('0x5'));var rimraf=require(_0x943e('0x6'));var config=require(_0x943e('0x7'));var attributes=require(_0x943e('0x8'));module[_0x943e('0x9')]=function(_0x5ca7c6,_0x2dc203){return _0x5ca7c6[_0x943e('0xa')](_0x943e('0xb'),attributes,{'tableName':_0x943e('0xc'),'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 3e33153..b9e0625 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 _0x35c1=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','options','raw','CreateSquareMessage','lodash','moment'];(function(_0x40c839,_0x47713e){var _0x37837a=function(_0x1422eb){while(--_0x1422eb){_0x40c839['push'](_0x40c839['shift']());}};_0x37837a(++_0x47713e);}(_0x35c1,0x184));var _0x135c=function(_0x2d80af,_0xfdfd5b){_0x2d80af=_0x2d80af-0x0;var _0x4917c6=_0x35c1[_0x2d80af];return _0x4917c6;};'use strict';var _=require(_0x135c('0x0'));var util=require('util');var moment=require(_0x135c('0x1'));var BPromise=require(_0x135c('0x2'));var rs=require(_0x135c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x135c('0x4'))['db'];var utils=require(_0x135c('0x5'));var logger=require(_0x135c('0x6'))(_0x135c('0x7'));var config=require(_0x135c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x135c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451daf,_0x4ea4f5,_0x152e83){return new BPromise(function(_0x5ea4b,_0x8ecf8e){return client['request'](_0x451daf,_0x152e83)[_0x135c('0xa')](function(_0x36a819){logger[_0x135c('0xb')](_0x135c('0xc'),_0x4ea4f5,_0x135c('0xd'));logger[_0x135c('0xe')](_0x135c('0xf'),_0x4ea4f5,_0x135c('0xd'),JSON[_0x135c('0x10')](_0x36a819));if(_0x36a819['error']){if(_0x36a819[_0x135c('0x11')]['code']===0x1f4){logger[_0x135c('0x11')](_0x135c('0xc'),_0x4ea4f5,_0x36a819['error']['message']);return _0x8ecf8e(_0x36a819[_0x135c('0x11')]['message']);}logger[_0x135c('0x11')]('SquareMessage,\x20%s,\x20%s',_0x4ea4f5,_0x36a819[_0x135c('0x11')]['message']);return _0x5ea4b(_0x36a819[_0x135c('0x11')][_0x135c('0x12')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x4ea4f5,_0x135c('0xd'));_0x5ea4b(_0x36a819[_0x135c('0x13')]['message']);}})[_0x135c('0x14')](function(_0x296cd4){logger['error'](_0x135c('0xc'),_0x4ea4f5,_0x296cd4);_0x8ecf8e(_0x296cd4);});});}exports['CreateSquareMessage']=function(_0x2c79a5){var _0x36a290=this;return new Promise(function(_0x46b97b,_0x2791dd){return db[_0x135c('0x15')][_0x135c('0x16')](_0x2c79a5['body'],{'raw':_0x2c79a5['options']?_0x2c79a5[_0x135c('0x17')][_0x135c('0x18')]===undefined?!![]:![]:!![]})[_0x135c('0xa')](function(_0x3dabd3){logger[_0x135c('0xb')](_0x135c('0x19'),_0x2c79a5);logger[_0x135c('0xe')](_0x135c('0x19'),_0x2c79a5,JSON[_0x135c('0x10')](_0x3dabd3));_0x46b97b(_0x3dabd3);})[_0x135c('0x14')](function(_0x197776){logger[_0x135c('0x11')]('CreateSquareMessage',_0x197776[_0x135c('0x12')],_0x2c79a5);_0x2791dd(_0x36a290['error'](0x1f4,_0x197776[_0x135c('0x12')]));});});}; \ No newline at end of file +var _0x942b=['SquareMessage','create','options','raw','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareMessage'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x942b,0xe6));var _0xb942=function(_0x1e11c4,_0x20fe65){_0x1e11c4=_0x1e11c4-0x0;var _0x1229a0=_0x942b[_0x1e11c4];return _0x1229a0;};'use strict';var _=require(_0xb942('0x0'));var util=require(_0xb942('0x1'));var moment=require('moment');var BPromise=require(_0xb942('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb942('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb942('0x4'))(_0xb942('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb942('0x6')][_0xb942('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56666c,_0x5289ee,_0x189f5c){return new BPromise(function(_0x3344d9,_0x20b0a7){return client[_0xb942('0x8')](_0x56666c,_0x189f5c)[_0xb942('0x9')](function(_0x44eafa){logger[_0xb942('0xa')](_0xb942('0xb'),_0x5289ee,_0xb942('0xc'));logger[_0xb942('0xd')](_0xb942('0xe'),_0x5289ee,_0xb942('0xc'),JSON['stringify'](_0x44eafa));if(_0x44eafa[_0xb942('0xf')]){if(_0x44eafa['error'][_0xb942('0x10')]===0x1f4){logger[_0xb942('0xf')]('SquareMessage,\x20%s,\x20%s',_0x5289ee,_0x44eafa['error'][_0xb942('0x11')]);return _0x20b0a7(_0x44eafa['error']['message']);}logger['error'](_0xb942('0xb'),_0x5289ee,_0x44eafa[_0xb942('0xf')][_0xb942('0x11')]);return _0x3344d9(_0x44eafa[_0xb942('0xf')][_0xb942('0x11')]);}else{logger['info'](_0xb942('0xb'),_0x5289ee,'request\x20sent');_0x3344d9(_0x44eafa[_0xb942('0x12')][_0xb942('0x11')]);}})['catch'](function(_0x5bab04){logger[_0xb942('0xf')]('SquareMessage,\x20%s,\x20%s',_0x5289ee,_0x5bab04);_0x20b0a7(_0x5bab04);});});}exports[_0xb942('0x13')]=function(_0x4b664e){var _0x23f567=this;return new Promise(function(_0x2e4780,_0x2e0d42){return db[_0xb942('0x14')][_0xb942('0x15')](_0x4b664e['body'],{'raw':_0x4b664e[_0xb942('0x16')]?_0x4b664e[_0xb942('0x16')][_0xb942('0x17')]===undefined?!![]:![]:!![]})[_0xb942('0x9')](function(_0x83e5fc){logger['info'](_0xb942('0x13'),_0x4b664e);logger[_0xb942('0xd')](_0xb942('0x13'),_0x4b664e,JSON['stringify'](_0x83e5fc));_0x2e4780(_0x83e5fc);})[_0xb942('0x18')](function(_0x26d2ad){logger[_0xb942('0xf')](_0xb942('0x13'),_0x26d2ad[_0xb942('0x11')],_0x4b664e);_0x2e0d42(_0x23f567[_0xb942('0xf')](0x1f4,_0x26d2ad[_0xb942('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1d750ae..e2eabb0 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 _0x5f2f=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','update','delete'];(function(_0x2dda7b,_0x3364b8){var _0x172693=function(_0x3f81a3){while(--_0x3f81a3){_0x2dda7b['push'](_0x2dda7b['shift']());}};_0x172693(++_0x3364b8);}(_0x5f2f,0x1a4));var _0xf5f2=function(_0x86a652,_0xc7eed7){_0x86a652=_0x86a652-0x0;var _0x32b57b=_0x5f2f[_0x86a652];return _0x32b57b;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require(_0xf5f2('0x8'));var controller=require(_0xf5f2('0x9'));router[_0xf5f2('0xa')]('/',auth[_0xf5f2('0xb')](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xa')](_0xf5f2('0xd'),auth[_0xf5f2('0xb')](),controller[_0xf5f2('0xe')]);router['get']('/:id/test',auth[_0xf5f2('0xb')](),timeout(_0xf5f2('0xf')),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')]('/',auth[_0xf5f2('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')](_0xf5f2('0xd'),auth[_0xf5f2('0xb')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0x60f5=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','create'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x60f5,0x1a9));var _0x560f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x560f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x560f('0x1'));var express=require(_0x560f('0x2'));var router=express[_0x560f('0x3')]();var fs_extra=require(_0x560f('0x4'));var auth=require(_0x560f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x560f('0x6'));router[_0x560f('0x7')]('/',auth[_0x560f('0x8')](),controller[_0x560f('0x9')]);router[_0x560f('0x7')](_0x560f('0xa'),auth[_0x560f('0x8')](),controller[_0x560f('0xb')]);router[_0x560f('0x7')]('/:id/test',auth[_0x560f('0x8')](),timeout('15s'),controller[_0x560f('0xc')]);router[_0x560f('0xd')]('/',auth[_0x560f('0x8')](),controller[_0x560f('0xe')]);router[_0x560f('0xf')](_0x560f('0xa'),auth[_0x560f('0x8')](),controller[_0x560f('0x10')]);router[_0x560f('0x11')](_0x560f('0xa'),auth[_0x560f('0x8')](),controller[_0x560f('0x12')]);module[_0x560f('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8cfc922..2feba21 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 _0x0e73=['sequelize','exports','STRING'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x0e73,0x114));var _0x30e7=function(_0x5694d3,_0x2e3008){_0x5694d3=_0x5694d3-0x0;var _0x1ca96e=_0x0e73[_0x5694d3];return _0x1ca96e;};'use strict';var Sequelize=require(_0x30e7('0x0'));module[_0x30e7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x30e7('0x2')]},'description':{'type':Sequelize[_0x30e7('0x2')]}}; \ No newline at end of file +var _0x805f=['name','sequelize','exports','STRING'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x805f,0xbd));var _0xf805=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x805f[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xf805('0x0'));module[_0xf805('0x1')]={'name':{'type':Sequelize[_0xf805('0x2')],'unique':_0xf805('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf805('0x2')]},'description':{'type':Sequelize[_0xf805('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index d8078c3..21e4a37 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 _0xc21e=['userProfileId','autoAssociation','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','jsforce','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','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','name','index','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0xc21e,0xb1));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xec21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec21('0x1'));var jsonpatch=require(_0xec21('0x2'));var rp=require(_0xec21('0x3'));var moment=require(_0xec21('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec21('0x5'));var path=require(_0xec21('0x6'));var sox=require('sox');var csv=require(_0xec21('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec21('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec21('0x9'));var deskjs=require(_0xec21('0xa'));var toCsv=require(_0xec21('0x7'));var querystring=require(_0xec21('0xb'));var Papa=require(_0xec21('0xc'));var Redis=require(_0xec21('0xd'));var authService=require(_0xec21('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xec21('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec21('0x10'))(_0xec21('0x11'));var utils=require(_0xec21('0x12'));var config=require(_0xec21('0x13'));var licenseUtil=require(_0xec21('0x14'));var db=require(_0xec21('0x15'))['db'];function respondWithStatusCode(_0x30a9d5,_0x13afb2){_0x13afb2=_0x13afb2||0xcc;return function(_0x138126){if(_0x138126){return _0x30a9d5['sendStatus'](_0x13afb2);}return _0x30a9d5[_0xec21('0x16')](_0x13afb2)[_0xec21('0x17')]();};}function respondWithResult(_0x5c2ad6,_0x130e18){_0x130e18=_0x130e18||0xc8;return function(_0x5811ff){if(_0x5811ff){return _0x5c2ad6[_0xec21('0x16')](_0x130e18)[_0xec21('0x18')](_0x5811ff);}};}function respondWithFilteredResult(_0x32d619,_0x41f5fd){return function(_0xbf3296){if(_0xbf3296){var _0x240b3b=typeof _0x41f5fd[_0xec21('0x19')]===_0xec21('0x1a')&&typeof _0x41f5fd[_0xec21('0x1b')]===_0xec21('0x1a');var _0x14c095=_0xbf3296[_0xec21('0x1c')];var _0x160c49=_0x240b3b?0x0:_0x41f5fd[_0xec21('0x19')];var _0x4dc57e=_0x240b3b?_0xbf3296['count']:_0x41f5fd[_0xec21('0x19')]+_0x41f5fd[_0xec21('0x1b')];var _0xdc67d6;if(_0x4dc57e>=_0x14c095){_0x4dc57e=_0x14c095;_0xdc67d6=0xc8;}else{_0xdc67d6=0xce;}_0x32d619[_0xec21('0x16')](_0xdc67d6);return _0x32d619[_0xec21('0x1d')](_0xec21('0x1e'),_0x160c49+'-'+_0x4dc57e+'/'+_0x14c095)[_0xec21('0x18')](_0xbf3296);}return null;};}function patchUpdates(_0x514701){return function(_0x44c8fa){try{jsonpatch['apply'](_0x44c8fa,_0x514701,!![]);}catch(_0x40d1cd){return BPromise[_0xec21('0x1f')](_0x40d1cd);}return _0x44c8fa[_0xec21('0x20')]();};}function saveUpdates(_0x52f93c,_0x5b4757){return function(_0x54402d){if(_0x54402d){return _0x54402d[_0xec21('0x21')](_0x52f93c)[_0xec21('0x22')](function(_0x57a52d){return _0x57a52d;});}return null;};}function removeEntity(_0x24abcb,_0x53d68d){return function(_0x378b5b){if(_0x378b5b){return _0x378b5b[_0xec21('0x23')]()[_0xec21('0x22')](function(){var _0x1aea19=_0x378b5b[_0xec21('0x24')]({'plain':!![]});var _0x13bbed=_0xec21('0x25');return db[_0xec21('0x26')][_0xec21('0x23')]({'where':{'type':_0x13bbed,'resourceId':_0x1aea19['id']}})[_0xec21('0x22')](function(){return _0x378b5b;});})[_0xec21('0x22')](function(){_0x24abcb[_0xec21('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35c432,_0x26452f){return function(_0x5e0c69){if(!_0x5e0c69){_0x35c432[_0xec21('0x27')](0x194);}return _0x5e0c69;};}function handleError(_0x3a3efb,_0x3312ec){_0x3312ec=_0x3312ec||0x1f4;return function(_0xbf8720){logger[_0xec21('0x28')](_0xbf8720['stack']);if(_0xbf8720['name']){delete _0xbf8720[_0xec21('0x29')];}_0x3a3efb[_0xec21('0x16')](_0x3312ec)['send'](_0xbf8720);};}exports[_0xec21('0x2a')]=function(_0x4bb11e,_0x1fa94a){var _0x30cd95={},_0x388139={},_0x1efdb1={'count':0x0,'rows':[]};var _0x3fc985=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x3c2030){return{'name':_0x3c2030[_0xec21('0x2b')],'type':_0x3c2030['type'][_0xec21('0x2c')]};});_0x388139[_0xec21('0x2d')]=_[_0xec21('0x2e')](_0x3fc985,_0xec21('0x29'));_0x388139[_0xec21('0x2f')]=_[_0xec21('0x30')](_0x4bb11e['query']);_0x388139['filters']=_['intersection'](_0x388139['model'],_0x388139[_0xec21('0x2f')]);_0x30cd95[_0xec21('0x31')]=_[_0xec21('0x32')](_0x388139[_0xec21('0x2d')],qs[_0xec21('0x33')](_0x4bb11e[_0xec21('0x2f')]['fields']));_0x30cd95[_0xec21('0x31')]=_0x30cd95[_0xec21('0x31')][_0xec21('0x34')]?_0x30cd95['attributes']:_0x388139[_0xec21('0x2d')];if(!_0x4bb11e[_0xec21('0x2f')]['hasOwnProperty']('nolimit')){_0x30cd95[_0xec21('0x1b')]=qs[_0xec21('0x1b')](_0x4bb11e[_0xec21('0x2f')][_0xec21('0x1b')]);_0x30cd95[_0xec21('0x19')]=qs['offset'](_0x4bb11e['query'][_0xec21('0x19')]);}_0x30cd95['order']=qs[_0xec21('0x35')](_0x4bb11e[_0xec21('0x2f')][_0xec21('0x35')]);_0x30cd95[_0xec21('0x36')]=qs[_0xec21('0x37')](_[_0xec21('0x38')](_0x4bb11e[_0xec21('0x2f')],_0x388139['filters']),_0x3fc985);if(_0x4bb11e[_0xec21('0x2f')][_0xec21('0x39')]){_0x30cd95[_0xec21('0x36')]=_[_0xec21('0x3a')](_0x30cd95['where'],{'$or':_[_0xec21('0x2e')](_0x3fc985,function(_0x42a174){if(_0x42a174[_0xec21('0x3b')]!==_0xec21('0x3c')){var _0x4ac1ed={};_0x4ac1ed[_0x42a174[_0xec21('0x29')]]={'$like':'%'+_0x4bb11e[_0xec21('0x2f')][_0xec21('0x39')]+'%'};return _0x4ac1ed;}})});}_0x30cd95=_['merge']({},_0x30cd95,_0x4bb11e[_0xec21('0x3d')]);var _0xac58a9={'where':_0x30cd95[_0xec21('0x36')]};return db[_0xec21('0x3e')][_0xec21('0x1c')](_0xac58a9)[_0xec21('0x22')](function(_0x1b1941){_0x1efdb1[_0xec21('0x1c')]=_0x1b1941;if(_0x4bb11e['query'][_0xec21('0x3f')]){_0x30cd95[_0xec21('0x40')]=[{'all':!![]}];}return db[_0xec21('0x3e')][_0xec21('0x41')](_0x30cd95);})['then'](function(_0x54bfa4){_0x1efdb1[_0xec21('0x42')]=_0x54bfa4;return _0x1efdb1;})[_0xec21('0x22')](respondWithFilteredResult(_0x1fa94a,_0x30cd95))[_0xec21('0x43')](handleError(_0x1fa94a,null));};exports[_0xec21('0x44')]=function(_0x45bc3b,_0x19f616){var _0xe5d0d8={'raw':!![],'where':{'id':_0x45bc3b[_0xec21('0x45')]['id']}},_0x82711a={};_0x82711a['model']=_['keys'](db[_0xec21('0x3e')][_0xec21('0x46')]);_0x82711a[_0xec21('0x2f')]=_['keys'](_0x45bc3b['query']);_0x82711a[_0xec21('0x37')]=_[_0xec21('0x32')](_0x82711a[_0xec21('0x2d')],_0x82711a[_0xec21('0x2f')]);_0xe5d0d8['attributes']=_[_0xec21('0x32')](_0x82711a[_0xec21('0x2d')],qs[_0xec21('0x33')](_0x45bc3b['query'][_0xec21('0x33')]));_0xe5d0d8[_0xec21('0x31')]=_0xe5d0d8[_0xec21('0x31')][_0xec21('0x34')]?_0xe5d0d8['attributes']:_0x82711a[_0xec21('0x2d')];if(_0x45bc3b[_0xec21('0x2f')][_0xec21('0x3f')]){_0xe5d0d8[_0xec21('0x40')]=[{'all':!![]}];}_0xe5d0d8=_[_0xec21('0x3a')]({},_0xe5d0d8,_0x45bc3b[_0xec21('0x3d')]);return db[_0xec21('0x3e')][_0xec21('0x47')](_0xe5d0d8)['then'](handleEntityNotFound(_0x19f616,null))[_0xec21('0x22')](respondWithResult(_0x19f616,null))[_0xec21('0x43')](handleError(_0x19f616,null));};exports[_0xec21('0x48')]=function(_0xd8e38c,_0x1fe78a){return db['SquareOdbc'][_0xec21('0x48')](_0xd8e38c[_0xec21('0x49')],{})['then'](function(_0x5e2049){var _0x34a6cd=_0xd8e38c[_0xec21('0x4a')][_0xec21('0x24')]({'plain':!![]});if(!_0x34a6cd)throw new Error(_0xec21('0x4b'));if(_0x34a6cd[_0xec21('0x4c')]==='user'){var _0x38af42=_0x5e2049[_0xec21('0x24')]({'plain':!![]});var _0x1e47cc=_0xec21('0x25');return db[_0xec21('0x4d')][_0xec21('0x47')]({'where':{'name':_0x1e47cc,'userProfileId':_0x34a6cd[_0xec21('0x4e')]},'raw':!![]})['then'](function(_0x1f27cc){if(_0x1f27cc&&_0x1f27cc[_0xec21('0x4f')]===0x0){return db[_0xec21('0x26')][_0xec21('0x48')]({'name':_0x38af42['name'],'resourceId':_0x38af42['id'],'type':_0x1f27cc[_0xec21('0x29')],'sectionId':_0x1f27cc['id']},{})['then'](function(){return _0x5e2049;});}else{return _0x5e2049;}})[_0xec21('0x43')](function(_0x4ca915){logger[_0xec21('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ca915);throw _0x4ca915;});}return _0x5e2049;})[_0xec21('0x22')](respondWithResult(_0x1fe78a,0xc9))[_0xec21('0x43')](handleError(_0x1fe78a,null));};exports[_0xec21('0x21')]=function(_0x513701,_0x883229){if(_0x513701[_0xec21('0x49')]['id']){delete _0x513701[_0xec21('0x49')]['id'];}return db[_0xec21('0x3e')][_0xec21('0x47')]({'where':{'id':_0x513701[_0xec21('0x45')]['id']}})['then'](handleEntityNotFound(_0x883229,null))[_0xec21('0x22')](saveUpdates(_0x513701['body'],null))[_0xec21('0x22')](respondWithResult(_0x883229,null))[_0xec21('0x43')](handleError(_0x883229,null));};exports['destroy']=function(_0x481498,_0x8241f5){return db[_0xec21('0x3e')][_0xec21('0x47')]({'where':{'id':_0x481498[_0xec21('0x45')]['id']}})['then'](handleEntityNotFound(_0x8241f5,null))[_0xec21('0x22')](removeEntity(_0x8241f5,null))['catch'](handleError(_0x8241f5,null));};exports[_0xec21('0x50')]=function(_0x311454,_0x5d833d,_0x2d3f7e){var _0x390806;return db[_0xec21('0x3e')][_0xec21('0x47')]({'where':{'id':_0x311454[_0xec21('0x45')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x5d833d,null))[_0xec21('0x22')](function(_0x532f32){if(_0x532f32){var _0x12c8e0=require(_0xec21('0x51'))();_0x12c8e0[_0xec21('0x52')](_0x532f32[_0xec21('0x53')]);_0x12c8e0[_0xec21('0x54')]();return _0x532f32;}})[_0xec21('0x22')](respondWithResult(_0x5d833d,null))[_0xec21('0x43')](handleError(_0x5d833d,null));}; \ No newline at end of file +var _0x4a92=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','includeAll','rows','show','params','keys','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','odbc','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a92,0xeb));var _0x24a9=function(_0x305cc5,_0x317607){_0x305cc5=_0x305cc5-0x0;var _0x3ef26f=_0x4a92[_0x305cc5];return _0x3ef26f;};'use strict';var emlformat=require(_0x24a9('0x0'));var rimraf=require(_0x24a9('0x1'));var zipdir=require(_0x24a9('0x2'));var jsonpatch=require(_0x24a9('0x3'));var rp=require('request-promise');var moment=require(_0x24a9('0x4'));var BPromise=require(_0x24a9('0x5'));var Mustache=require(_0x24a9('0x6'));var util=require(_0x24a9('0x7'));var path=require(_0x24a9('0x8'));var sox=require('sox');var csv=require(_0x24a9('0x9'));var ejs=require(_0x24a9('0xa'));var fs=require('fs');var fs_extra=require(_0x24a9('0xb'));var _=require('lodash');var squel=require(_0x24a9('0xc'));var crypto=require(_0x24a9('0xd'));var jsforce=require(_0x24a9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x24a9('0x9'));var querystring=require(_0x24a9('0xf'));var Papa=require('papaparse');var Redis=require(_0x24a9('0x10'));var authService=require(_0x24a9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x24a9('0x12'));var hardwareService=require(_0x24a9('0x13'));var logger=require(_0x24a9('0x14'))('api');var utils=require(_0x24a9('0x15'));var config=require(_0x24a9('0x16'));var licenseUtil=require(_0x24a9('0x17'));var db=require(_0x24a9('0x18'))['db'];function respondWithStatusCode(_0x318876,_0x3e68f6){_0x3e68f6=_0x3e68f6||0xcc;return function(_0x3cec39){if(_0x3cec39){return _0x318876[_0x24a9('0x19')](_0x3e68f6);}return _0x318876[_0x24a9('0x1a')](_0x3e68f6)['end']();};}function respondWithResult(_0x5c8844,_0x45e63e){_0x45e63e=_0x45e63e||0xc8;return function(_0x4d5e12){if(_0x4d5e12){return _0x5c8844[_0x24a9('0x1a')](_0x45e63e)[_0x24a9('0x1b')](_0x4d5e12);}};}function respondWithFilteredResult(_0x1e5156,_0x5a7104){return function(_0x41ef3f){if(_0x41ef3f){var _0x4e87a5=typeof _0x5a7104[_0x24a9('0x1c')]===_0x24a9('0x1d')&&typeof _0x5a7104['limit']===_0x24a9('0x1d');var _0x20790a=_0x41ef3f[_0x24a9('0x1e')];var _0x3b954b=_0x4e87a5?0x0:_0x5a7104[_0x24a9('0x1c')];var _0x23c6e9=_0x4e87a5?_0x41ef3f[_0x24a9('0x1e')]:_0x5a7104[_0x24a9('0x1c')]+_0x5a7104[_0x24a9('0x1f')];var _0x153cc7;if(_0x23c6e9>=_0x20790a){_0x23c6e9=_0x20790a;_0x153cc7=0xc8;}else{_0x153cc7=0xce;}_0x1e5156[_0x24a9('0x1a')](_0x153cc7);return _0x1e5156[_0x24a9('0x20')](_0x24a9('0x21'),_0x3b954b+'-'+_0x23c6e9+'/'+_0x20790a)['json'](_0x41ef3f);}return null;};}function patchUpdates(_0xd26265){return function(_0x27b2f9){try{jsonpatch[_0x24a9('0x22')](_0x27b2f9,_0xd26265,!![]);}catch(_0x2aca0c){return BPromise[_0x24a9('0x23')](_0x2aca0c);}return _0x27b2f9[_0x24a9('0x24')]();};}function saveUpdates(_0x45a227,_0x1d279b){return function(_0x439149){if(_0x439149){return _0x439149['update'](_0x45a227)[_0x24a9('0x25')](function(_0x4563a9){return _0x4563a9;});}return null;};}function removeEntity(_0x3a2c36,_0x5aa908){return function(_0x5627ef){if(_0x5627ef){return _0x5627ef[_0x24a9('0x26')]()[_0x24a9('0x25')](function(){var _0x50d5db=_0x5627ef[_0x24a9('0x27')]({'plain':!![]});var _0x4a4b3c=_0x24a9('0x28');return db[_0x24a9('0x29')][_0x24a9('0x26')]({'where':{'type':_0x4a4b3c,'resourceId':_0x50d5db['id']}})['then'](function(){return _0x5627ef;});})[_0x24a9('0x25')](function(){_0x3a2c36[_0x24a9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d835e,_0x4cbb56){return function(_0x12021a){if(!_0x12021a){_0x5d835e['sendStatus'](0x194);}return _0x12021a;};}function handleError(_0x1f851f,_0x1ea027){_0x1ea027=_0x1ea027||0x1f4;return function(_0x382bfc){logger[_0x24a9('0x2a')](_0x382bfc['stack']);if(_0x382bfc[_0x24a9('0x2b')]){delete _0x382bfc['name'];}_0x1f851f[_0x24a9('0x1a')](_0x1ea027)[_0x24a9('0x2c')](_0x382bfc);};}exports[_0x24a9('0x2d')]=function(_0x598638,_0x41b2fe){var _0x1bef87={},_0x4d70ce={},_0x1c8ac0={'count':0x0,'rows':[]};var _0x1034f7=_[_0x24a9('0x2e')](db[_0x24a9('0x2f')][_0x24a9('0x30')],function(_0x51e23e){return{'name':_0x51e23e[_0x24a9('0x31')],'type':_0x51e23e['type'][_0x24a9('0x32')]};});_0x4d70ce[_0x24a9('0x33')]=_[_0x24a9('0x2e')](_0x1034f7,'name');_0x4d70ce[_0x24a9('0x34')]=_['keys'](_0x598638[_0x24a9('0x34')]);_0x4d70ce['filters']=_[_0x24a9('0x35')](_0x4d70ce[_0x24a9('0x33')],_0x4d70ce[_0x24a9('0x34')]);_0x1bef87[_0x24a9('0x36')]=_[_0x24a9('0x35')](_0x4d70ce[_0x24a9('0x33')],qs[_0x24a9('0x37')](_0x598638[_0x24a9('0x34')][_0x24a9('0x37')]));_0x1bef87[_0x24a9('0x36')]=_0x1bef87[_0x24a9('0x36')][_0x24a9('0x38')]?_0x1bef87[_0x24a9('0x36')]:_0x4d70ce[_0x24a9('0x33')];if(!_0x598638[_0x24a9('0x34')]['hasOwnProperty'](_0x24a9('0x39'))){_0x1bef87[_0x24a9('0x1f')]=qs[_0x24a9('0x1f')](_0x598638['query']['limit']);_0x1bef87['offset']=qs[_0x24a9('0x1c')](_0x598638[_0x24a9('0x34')][_0x24a9('0x1c')]);}_0x1bef87[_0x24a9('0x3a')]=qs[_0x24a9('0x3b')](_0x598638[_0x24a9('0x34')][_0x24a9('0x3b')]);_0x1bef87[_0x24a9('0x3c')]=qs['filters'](_['pick'](_0x598638[_0x24a9('0x34')],_0x4d70ce[_0x24a9('0x3d')]),_0x1034f7);if(_0x598638[_0x24a9('0x34')]['filter']){_0x1bef87[_0x24a9('0x3c')]=_[_0x24a9('0x3e')](_0x1bef87[_0x24a9('0x3c')],{'$or':_[_0x24a9('0x2e')](_0x1034f7,function(_0x222b5e){if(_0x222b5e[_0x24a9('0x3f')]!==_0x24a9('0x40')){var _0x108fa6={};_0x108fa6[_0x222b5e['name']]={'$like':'%'+_0x598638[_0x24a9('0x34')]['filter']+'%'};return _0x108fa6;}})});}_0x1bef87=_['merge']({},_0x1bef87,_0x598638['options']);var _0x49d82b={'where':_0x1bef87[_0x24a9('0x3c')]};return db[_0x24a9('0x2f')][_0x24a9('0x1e')](_0x49d82b)[_0x24a9('0x25')](function(_0x425130){_0x1c8ac0[_0x24a9('0x1e')]=_0x425130;if(_0x598638[_0x24a9('0x34')][_0x24a9('0x41')]){_0x1bef87['include']=[{'all':!![]}];}return db[_0x24a9('0x2f')]['findAll'](_0x1bef87);})[_0x24a9('0x25')](function(_0x20b3c2){_0x1c8ac0[_0x24a9('0x42')]=_0x20b3c2;return _0x1c8ac0;})[_0x24a9('0x25')](respondWithFilteredResult(_0x41b2fe,_0x1bef87))['catch'](handleError(_0x41b2fe,null));};exports[_0x24a9('0x43')]=function(_0x34a268,_0x23ecc9){var _0x5c9cb2={'raw':!![],'where':{'id':_0x34a268[_0x24a9('0x44')]['id']}},_0x2dd0ea={};_0x2dd0ea[_0x24a9('0x33')]=_['keys'](db[_0x24a9('0x2f')][_0x24a9('0x30')]);_0x2dd0ea[_0x24a9('0x34')]=_[_0x24a9('0x45')](_0x34a268[_0x24a9('0x34')]);_0x2dd0ea[_0x24a9('0x3d')]=_['intersection'](_0x2dd0ea[_0x24a9('0x33')],_0x2dd0ea[_0x24a9('0x34')]);_0x5c9cb2[_0x24a9('0x36')]=_[_0x24a9('0x35')](_0x2dd0ea[_0x24a9('0x33')],qs['fields'](_0x34a268[_0x24a9('0x34')][_0x24a9('0x37')]));_0x5c9cb2[_0x24a9('0x36')]=_0x5c9cb2['attributes'][_0x24a9('0x38')]?_0x5c9cb2[_0x24a9('0x36')]:_0x2dd0ea[_0x24a9('0x33')];if(_0x34a268[_0x24a9('0x34')]['includeAll']){_0x5c9cb2['include']=[{'all':!![]}];}_0x5c9cb2=_[_0x24a9('0x3e')]({},_0x5c9cb2,_0x34a268[_0x24a9('0x46')]);return db[_0x24a9('0x2f')][_0x24a9('0x47')](_0x5c9cb2)[_0x24a9('0x25')](handleEntityNotFound(_0x23ecc9,null))[_0x24a9('0x25')](respondWithResult(_0x23ecc9,null))[_0x24a9('0x48')](handleError(_0x23ecc9,null));};exports[_0x24a9('0x49')]=function(_0x1abbd2,_0x124d52){return db['SquareOdbc'][_0x24a9('0x49')](_0x1abbd2[_0x24a9('0x4a')],{})[_0x24a9('0x25')](function(_0x4c8ead){var _0x25dee1=_0x1abbd2['user'][_0x24a9('0x27')]({'plain':!![]});if(!_0x25dee1)throw new Error(_0x24a9('0x4b'));if(_0x25dee1['role']===_0x24a9('0x4c')){var _0x11d587=_0x4c8ead[_0x24a9('0x27')]({'plain':!![]});var _0x3f8ffa='ODBC';return db['UserProfileSection'][_0x24a9('0x47')]({'where':{'name':_0x3f8ffa,'userProfileId':_0x25dee1[_0x24a9('0x4d')]},'raw':!![]})['then'](function(_0x43f886){if(_0x43f886&&_0x43f886[_0x24a9('0x4e')]===0x0){return db['UserProfileResource'][_0x24a9('0x49')]({'name':_0x11d587[_0x24a9('0x2b')],'resourceId':_0x11d587['id'],'type':_0x43f886[_0x24a9('0x2b')],'sectionId':_0x43f886['id']},{})['then'](function(){return _0x4c8ead;});}else{return _0x4c8ead;}})['catch'](function(_0x44e80d){logger[_0x24a9('0x2a')](_0x24a9('0x4f'),_0x44e80d);throw _0x44e80d;});}return _0x4c8ead;})['then'](respondWithResult(_0x124d52,0xc9))[_0x24a9('0x48')](handleError(_0x124d52,null));};exports[_0x24a9('0x50')]=function(_0x1a5bba,_0x2d8c7b){if(_0x1a5bba[_0x24a9('0x4a')]['id']){delete _0x1a5bba[_0x24a9('0x4a')]['id'];}return db['SquareOdbc'][_0x24a9('0x47')]({'where':{'id':_0x1a5bba[_0x24a9('0x44')]['id']}})[_0x24a9('0x25')](handleEntityNotFound(_0x2d8c7b,null))[_0x24a9('0x25')](saveUpdates(_0x1a5bba[_0x24a9('0x4a')],null))[_0x24a9('0x25')](respondWithResult(_0x2d8c7b,null))['catch'](handleError(_0x2d8c7b,null));};exports['destroy']=function(_0xe57807,_0x1bde32){return db[_0x24a9('0x2f')][_0x24a9('0x47')]({'where':{'id':_0xe57807[_0x24a9('0x44')]['id']}})[_0x24a9('0x25')](handleEntityNotFound(_0x1bde32,null))[_0x24a9('0x25')](removeEntity(_0x1bde32,null))['catch'](handleError(_0x1bde32,null));};exports[_0x24a9('0x51')]=function(_0x4a9a8e,_0xb83642,_0x4c07ee){var _0x8be54d;return db['SquareOdbc'][_0x24a9('0x47')]({'where':{'id':_0x4a9a8e[_0x24a9('0x44')]['id']},'attributes':['id','dsn']})[_0x24a9('0x25')](handleEntityNotFound(_0xb83642,null))[_0x24a9('0x25')](function(_0x5a76cf){if(_0x5a76cf){var _0xd30fab=require(_0x24a9('0x52'))();_0xd30fab['openSync'](_0x5a76cf[_0x24a9('0x53')]);_0xd30fab[_0x24a9('0x54')]();return _0x5a76cf;}})[_0x24a9('0x25')](respondWithResult(_0xb83642,null))[_0x24a9('0x48')](handleError(_0xb83642,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c7d9962..3457225 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 _0x2f28=['define','SquareOdbc','util','../../config/logger','api','path','../../config/environment','./squareOdbc.attributes'];(function(_0x353fa7,_0x5d4798){var _0x11efc8=function(_0x2179da){while(--_0x2179da){_0x353fa7['push'](_0x353fa7['shift']());}};_0x11efc8(++_0x5d4798);}(_0x2f28,0x162));var _0x82f2=function(_0x170fe2,_0x295e91){_0x170fe2=_0x170fe2-0x0;var _0x50d948=_0x2f28[_0x170fe2];return _0x50d948;};'use strict';var _=require('lodash');var util=require(_0x82f2('0x0'));var logger=require(_0x82f2('0x1'))(_0x82f2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x82f2('0x3'));var rimraf=require('rimraf');var config=require(_0x82f2('0x4'));var attributes=require(_0x82f2('0x5'));module['exports']=function(_0x17831e,_0x1e07e8){return _0x17831e[_0x82f2('0x6')](_0x82f2('0x7'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3210=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x5ce5f2,_0x39548b){var _0x5f2c0b=function(_0x697efb){while(--_0x697efb){_0x5ce5f2['push'](_0x5ce5f2['shift']());}};_0x5f2c0b(++_0x39548b);}(_0x3210,0x19e));var _0x0321=function(_0x26d04c,_0x5930f6){_0x26d04c=_0x26d04c-0x0;var _0x2dc062=_0x3210[_0x26d04c];return _0x2dc062;};'use strict';var _=require(_0x0321('0x0'));var util=require('util');var logger=require(_0x0321('0x1'))(_0x0321('0x2'));var moment=require('moment');var BPromise=require(_0x0321('0x3'));var rp=require(_0x0321('0x4'));var fs=require('fs');var path=require(_0x0321('0x5'));var rimraf=require('rimraf');var config=require(_0x0321('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x0321('0x7')]=function(_0x29290e,_0x14ecd8){return _0x29290e[_0x0321('0x8')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index f96d0c6..568beda 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 _0x3d92=['map','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','info','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include'];(function(_0x22b17c,_0x5ba5a3){var _0x55c274=function(_0x4201ef){while(--_0x4201ef){_0x22b17c['push'](_0x22b17c['shift']());}};_0x55c274(++_0x5ba5a3);}(_0x3d92,0x8b));var _0x23d9=function(_0x114c53,_0x2249c6){_0x114c53=_0x114c53-0x0;var _0x4e0c14=_0x3d92[_0x114c53];return _0x4e0c14;};'use strict';var _=require(_0x23d9('0x0'));var util=require(_0x23d9('0x1'));var moment=require(_0x23d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x23d9('0x3'));var fs=require('fs');var Redis=require(_0x23d9('0x4'));var db=require(_0x23d9('0x5'))['db'];var utils=require(_0x23d9('0x6'));var logger=require(_0x23d9('0x7'))('rpc');var config=require(_0x23d9('0x8'));var jayson=require(_0x23d9('0x9'));var client=jayson[_0x23d9('0xa')][_0x23d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13862e,_0x211e42,_0xb49c44){return new BPromise(function(_0x30107f,_0x33a33e){return client[_0x23d9('0xc')](_0x13862e,_0xb49c44)[_0x23d9('0xd')](function(_0x107d8b){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x211e42,'request\x20sent');logger[_0x23d9('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x211e42,_0x23d9('0xf'),JSON[_0x23d9('0x10')](_0x107d8b));if(_0x107d8b['error']){if(_0x107d8b[_0x23d9('0x11')][_0x23d9('0x12')]===0x1f4){logger[_0x23d9('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x211e42,_0x107d8b['error'][_0x23d9('0x13')]);return _0x33a33e(_0x107d8b[_0x23d9('0x11')][_0x23d9('0x13')]);}logger[_0x23d9('0x11')](_0x23d9('0x14'),_0x211e42,_0x107d8b['error'][_0x23d9('0x13')]);return _0x30107f(_0x107d8b[_0x23d9('0x11')]['message']);}else{logger[_0x23d9('0x15')](_0x23d9('0x14'),_0x211e42,'request\x20sent');_0x30107f(_0x107d8b[_0x23d9('0x16')][_0x23d9('0x13')]);}})['catch'](function(_0x4f3b76){logger[_0x23d9('0x11')](_0x23d9('0x14'),_0x211e42,_0x4f3b76);_0x33a33e(_0x4f3b76);});});}exports[_0x23d9('0x17')]=function(_0x24af9d){var _0x8cc17e=this;return new Promise(function(_0x13adc0,_0x201c55){return db[_0x23d9('0x18')][_0x23d9('0x19')]({'raw':_0x24af9d[_0x23d9('0x1a')]?_0x24af9d[_0x23d9('0x1a')][_0x23d9('0x1b')]===undefined?!![]:![]:!![],'where':_0x24af9d['options']?_0x24af9d[_0x23d9('0x1a')][_0x23d9('0x1c')]||null:null,'attributes':_0x24af9d[_0x23d9('0x1a')]?_0x24af9d[_0x23d9('0x1a')][_0x23d9('0x1d')]||null:null,'include':_0x24af9d['options']?_0x24af9d['options'][_0x23d9('0x1e')]?_[_0x23d9('0x1f')](_0x24af9d[_0x23d9('0x1a')]['include'],function(_0xf02e07){return{'model':db[_0xf02e07[_0x23d9('0x20')]],'as':_0xf02e07['as'],'attributes':_0xf02e07[_0x23d9('0x1d')],'include':_0xf02e07[_0x23d9('0x1e')]?_[_0x23d9('0x1f')](_0xf02e07[_0x23d9('0x1e')],function(_0x5a874a){return{'model':db[_0x5a874a[_0x23d9('0x20')]],'as':_0x5a874a['as'],'attributes':_0x5a874a['attributes'],'include':_0x5a874a[_0x23d9('0x1e')]?_[_0x23d9('0x1f')](_0x5a874a[_0x23d9('0x1e')],function(_0x258f12){return{'model':db[_0x258f12[_0x23d9('0x20')]],'as':_0x258f12['as'],'attributes':_0x258f12[_0x23d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x23d9('0xd')](function(_0x166bab){logger['info'](_0x23d9('0x17'),_0x24af9d);logger[_0x23d9('0xe')](_0x23d9('0x17'),_0x24af9d,JSON[_0x23d9('0x10')](_0x166bab));_0x13adc0(_0x166bab);})[_0x23d9('0x21')](function(_0x1741c2){logger[_0x23d9('0x11')]('ShowSquareOdbc',_0x1741c2[_0x23d9('0x13')],_0x24af9d);_0x201c55(_0x8cc17e[_0x23d9('0x11')](0x1f4,_0x1741c2[_0x23d9('0x13')]));});});}; \ No newline at end of file +var _0x91e8=['map','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include'];(function(_0x21ee77,_0x43b0c2){var _0x47ff4f=function(_0x3b27e6){while(--_0x3b27e6){_0x21ee77['push'](_0x21ee77['shift']());}};_0x47ff4f(++_0x43b0c2);}(_0x91e8,0x18f));var _0x891e=function(_0x512243,_0x515f84){_0x512243=_0x512243-0x0;var _0x2f5cae=_0x91e8[_0x512243];return _0x2f5cae;};'use strict';var _=require(_0x891e('0x0'));var util=require(_0x891e('0x1'));var moment=require('moment');var BPromise=require(_0x891e('0x2'));var rs=require(_0x891e('0x3'));var fs=require('fs');var Redis=require(_0x891e('0x4'));var db=require(_0x891e('0x5'))['db'];var utils=require(_0x891e('0x6'));var logger=require(_0x891e('0x7'))(_0x891e('0x8'));var config=require(_0x891e('0x9'));var jayson=require(_0x891e('0xa'));var client=jayson[_0x891e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2642cb,_0x3be112,_0x4ff446){return new BPromise(function(_0x4414b4,_0x2760e2){return client['request'](_0x2642cb,_0x4ff446)[_0x891e('0xc')](function(_0x1bafa3){logger[_0x891e('0xd')](_0x891e('0xe'),_0x3be112,_0x891e('0xf'));logger[_0x891e('0x10')](_0x891e('0x11'),_0x3be112,_0x891e('0xf'),JSON[_0x891e('0x12')](_0x1bafa3));if(_0x1bafa3[_0x891e('0x13')]){if(_0x1bafa3[_0x891e('0x13')][_0x891e('0x14')]===0x1f4){logger[_0x891e('0x13')](_0x891e('0xe'),_0x3be112,_0x1bafa3['error']['message']);return _0x2760e2(_0x1bafa3[_0x891e('0x13')][_0x891e('0x15')]);}logger['error'](_0x891e('0xe'),_0x3be112,_0x1bafa3[_0x891e('0x13')][_0x891e('0x15')]);return _0x4414b4(_0x1bafa3[_0x891e('0x13')][_0x891e('0x15')]);}else{logger[_0x891e('0xd')](_0x891e('0xe'),_0x3be112,_0x891e('0xf'));_0x4414b4(_0x1bafa3[_0x891e('0x16')]['message']);}})['catch'](function(_0x44cfa8){logger['error'](_0x891e('0xe'),_0x3be112,_0x44cfa8);_0x2760e2(_0x44cfa8);});});}exports[_0x891e('0x17')]=function(_0x24261d){var _0x13e124=this;return new Promise(function(_0x3cfb4a,_0x5dc587){return db[_0x891e('0x18')][_0x891e('0x19')]({'raw':_0x24261d['options']?_0x24261d[_0x891e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24261d[_0x891e('0x1a')]?_0x24261d[_0x891e('0x1a')][_0x891e('0x1b')]||null:null,'attributes':_0x24261d[_0x891e('0x1a')]?_0x24261d[_0x891e('0x1a')][_0x891e('0x1c')]||null:null,'include':_0x24261d['options']?_0x24261d[_0x891e('0x1a')][_0x891e('0x1d')]?_[_0x891e('0x1e')](_0x24261d[_0x891e('0x1a')][_0x891e('0x1d')],function(_0xf484b8){return{'model':db[_0xf484b8[_0x891e('0x1f')]],'as':_0xf484b8['as'],'attributes':_0xf484b8[_0x891e('0x1c')],'include':_0xf484b8[_0x891e('0x1d')]?_[_0x891e('0x1e')](_0xf484b8[_0x891e('0x1d')],function(_0x353ddb){return{'model':db[_0x353ddb['model']],'as':_0x353ddb['as'],'attributes':_0x353ddb[_0x891e('0x1c')],'include':_0x353ddb[_0x891e('0x1d')]?_['map'](_0x353ddb[_0x891e('0x1d')],function(_0x17516e){return{'model':db[_0x17516e['model']],'as':_0x17516e['as'],'attributes':_0x17516e[_0x891e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51c993){logger[_0x891e('0xd')](_0x891e('0x17'),_0x24261d);logger['debug'](_0x891e('0x17'),_0x24261d,JSON[_0x891e('0x12')](_0x51c993));_0x3cfb4a(_0x51c993);})[_0x891e('0x20')](function(_0x117f5f){logger[_0x891e('0x13')](_0x891e('0x17'),_0x117f5f[_0x891e('0x15')],_0x24261d);_0x5dc587(_0x13e124[_0x891e('0x13')](0x1f4,_0x117f5f[_0x891e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index d6dec3c..69ac740 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 _0x241f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5eff1b,_0x4eaf26){var _0x2dc878=function(_0x16df8b){while(--_0x16df8b){_0x5eff1b['push'](_0x5eff1b['shift']());}};_0x2dc878(++_0x4eaf26);}(_0x241f,0x15e));var _0xf241=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x241f[_0x258fb0];return _0x4d1afe;};'use strict';var multer=require(_0xf241('0x0'));var util=require(_0xf241('0x1'));var path=require(_0xf241('0x2'));var timeout=require(_0xf241('0x3'));var express=require(_0xf241('0x4'));var router=express[_0xf241('0x5')]();var fs_extra=require(_0xf241('0x6'));var auth=require(_0xf241('0x7'));var interaction=require(_0xf241('0x8'));var config=require(_0xf241('0x9'));var controller=require(_0xf241('0xa'));router[_0xf241('0xb')]('/',auth[_0xf241('0xc')](),controller[_0xf241('0xd')]);router['get'](_0xf241('0xe'),auth[_0xf241('0xc')](),controller['show']);router[_0xf241('0xf')]('/',auth[_0xf241('0xc')](),controller[_0xf241('0x10')]);router[_0xf241('0x11')](_0xf241('0xe'),auth[_0xf241('0xc')](),controller[_0xf241('0x12')]);router['delete'](_0xf241('0xe'),auth[_0xf241('0xc')](),controller[_0xf241('0x13')]);module[_0xf241('0x14')]=router; \ No newline at end of file +var _0x964b=['index','get','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','./squareProject.controller','isAuthenticated'];(function(_0x1d0213,_0x179020){var _0x59527a=function(_0x50786e){while(--_0x50786e){_0x1d0213['push'](_0x1d0213['shift']());}};_0x59527a(++_0x179020);}(_0x964b,0x80));var _0xb964=function(_0xf673bf,_0x130427){_0xf673bf=_0xf673bf-0x0;var _0x403314=_0x964b[_0xf673bf];return _0x403314;};'use strict';var multer=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var path=require(_0xb964('0x2'));var timeout=require(_0xb964('0x3'));var express=require('express');var router=express[_0xb964('0x4')]();var fs_extra=require(_0xb964('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb964('0x6'));router['get']('/',auth[_0xb964('0x7')](),controller[_0xb964('0x8')]);router[_0xb964('0x9')]('/:id',auth[_0xb964('0x7')](),controller['show']);router[_0xb964('0xa')]('/',auth[_0xb964('0x7')](),controller[_0xb964('0xb')]);router[_0xb964('0xc')](_0xb964('0xd'),auth[_0xb964('0x7')](),controller[_0xb964('0xe')]);router[_0xb964('0xf')]('/:id',auth[_0xb964('0x7')](),controller['destroy']);module[_0xb964('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 83ef30f..493d497 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 _0x72c8=['exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72c8,0x8e));var _0x872c=function(_0x41ee04,_0x296042){_0x41ee04=_0x41ee04-0x0;var _0x26f144=_0x72c8[_0x41ee04];return _0x26f144;};'use strict';var Sequelize=require(_0x872c('0x0'));module[_0x872c('0x1')]={'name':{'type':Sequelize[_0x872c('0x2')],'unique':_0x872c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x872c('0x2')]},'notes':{'type':Sequelize[_0x872c('0x4')]},'preproduction':{'type':Sequelize[_0x872c('0x5')]('long'),'get':function(){if(this[_0x872c('0x6')](_0x872c('0x7'))){return this[_0x872c('0x6')](_0x872c('0x7'))[_0x872c('0x8')](_0x872c('0x9'));}}},'production':{'type':Sequelize[_0x872c('0x5')](_0x872c('0xa')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0x872c('0xb'))['toString'](_0x872c('0x9'));}}},'savedAt':{'type':Sequelize[_0x872c('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x0ab3=['BLOB','production','DATE','exports','STRING','name','long','getDataValue','preproduction','toString'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x0ab3,0x111));var _0x30ab=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0ab3[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module[_0x30ab('0x0')]={'name':{'type':Sequelize[_0x30ab('0x1')],'unique':_0x30ab('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x30ab('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x30ab('0x3')),'get':function(){if(this[_0x30ab('0x4')]('preproduction')){return this[_0x30ab('0x4')](_0x30ab('0x5'))[_0x30ab('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x30ab('0x7')](_0x30ab('0x3')),'get':function(){if(this[_0x30ab('0x4')](_0x30ab('0x8'))){return this[_0x30ab('0x4')]('production')[_0x30ab('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0x30ab('0x9')]},'publishedAt':{'type':Sequelize[_0x30ab('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 127179d..e8ad8ee 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 _0x3212=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','set','Content-Range','json','update','then','destroy','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','SquareProject','count','includeAll','include','findAll','catch','show','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','production','lodash','ioredis'];(function(_0x68f872,_0x4f7906){var _0x407135=function(_0x232eed){while(--_0x232eed){_0x68f872['push'](_0x68f872['shift']());}};_0x407135(++_0x4f7906);}(_0x3212,0x16b));var _0x2321=function(_0x2b9c7f,_0x394da1){_0x2b9c7f=_0x2b9c7f-0x0;var _0x5b496e=_0x3212[_0x2b9c7f];return _0x5b496e;};'use strict';var _=require(_0x2321('0x0'));var Redis=require(_0x2321('0x1'));var qs=require(_0x2321('0x2'));var logger=require(_0x2321('0x3'))(_0x2321('0x4'));var config=require(_0x2321('0x5'));var db=require(_0x2321('0x6'))['db'];config[_0x2321('0x7')]=_['defaults'](config[_0x2321('0x7')],{'host':_0x2321('0x8'),'port':0x18eb});var socket=require(_0x2321('0x9'))(new Redis(config['redis']));require(_0x2321('0xa'))[_0x2321('0xb')](socket);function respondWithResult(_0x39e1be,_0x3f7a80){_0x3f7a80=_0x3f7a80||0xc8;return function(_0x53d668){if(_0x53d668){return _0x39e1be[_0x2321('0xc')](_0x3f7a80)['json'](_0x53d668);}};}function respondWithFilteredResult(_0x552fc9,_0x1a60a9){return function(_0x77c271){if(_0x77c271){var _0x43b18f=typeof _0x1a60a9[_0x2321('0xd')]===_0x2321('0xe')&&typeof _0x1a60a9[_0x2321('0xf')]==='undefined';var _0x2bb7b8=_0x77c271['count'];var _0x482b5b=_0x43b18f?0x0:_0x1a60a9[_0x2321('0xd')];var _0x2f0e60=_0x43b18f?_0x77c271['count']:_0x1a60a9[_0x2321('0xd')]+_0x1a60a9[_0x2321('0xf')];var _0xe3c401;if(_0x2f0e60>=_0x2bb7b8){_0x2f0e60=_0x2bb7b8;_0xe3c401=0xc8;}else{_0xe3c401=0xce;}_0x552fc9[_0x2321('0xc')](_0xe3c401);return _0x552fc9[_0x2321('0x10')](_0x2321('0x11'),_0x482b5b+'-'+_0x2f0e60+'/'+_0x2bb7b8)[_0x2321('0x12')](_0x77c271);}return null;};}function saveUpdates(_0x15408f){return function(_0x3b4761){if(_0x3b4761){return _0x3b4761[_0x2321('0x13')](_0x15408f)[_0x2321('0x14')](function(_0x4868e2){return _0x4868e2;});}return null;};}function removeEntity(_0x147aa6){return function(_0x340bde){if(_0x340bde){return _0x340bde[_0x2321('0x15')]()[_0x2321('0x14')](function(){var _0x1ae9ce=_0x340bde['get']({'plain':!![]});var _0x3897ff=_0x2321('0x16');return db[_0x2321('0x17')][_0x2321('0x15')]({'where':{'type':_0x3897ff,'resourceId':_0x1ae9ce['id']}})[_0x2321('0x14')](function(){return _0x340bde;});})['then'](function(){var _0x233a83=new Redis(config[_0x2321('0x7')]);_0x233a83[_0x2321('0x18')](_0x2321('0x19'),JSON[_0x2321('0x1a')]({'id':_0x340bde['id'],'deleted':!![]}));})[_0x2321('0x14')](function(){_0x147aa6[_0x2321('0xc')](0xcc)[_0x2321('0x1b')]();});}};}function handleEntityNotFound(_0x4afc2a){return function(_0x30495f){if(!_0x30495f){_0x4afc2a[_0x2321('0x1c')](0x194);}return _0x30495f;};}function handleError(_0x46746c,_0x2e6798){_0x2e6798=_0x2e6798||0x1f4;return function(_0x4fb6c1){logger['error'](_0x4fb6c1[_0x2321('0x1d')]);if(_0x4fb6c1[_0x2321('0x1e')]){delete _0x4fb6c1['name'];}_0x46746c[_0x2321('0xc')](_0x2e6798)[_0x2321('0x1f')](_0x4fb6c1);};}exports[_0x2321('0x20')]=function(_0x196953,_0x262246){var _0x3996d3={},_0x1731af={},_0x38362e={'count':0x0,'rows':[]};var _0x20c9ed=_[_0x2321('0x21')](db['SquareProject'][_0x2321('0x22')],function(_0x533444){return{'name':_0x533444[_0x2321('0x23')],'type':_0x533444['type'][_0x2321('0x24')]};});_0x1731af[_0x2321('0x25')]=_[_0x2321('0x21')](_0x20c9ed,_0x2321('0x1e'));_0x1731af[_0x2321('0x26')]=_[_0x2321('0x27')](_0x196953[_0x2321('0x26')]);_0x1731af[_0x2321('0x28')]=_['intersection'](_0x1731af[_0x2321('0x25')],_0x1731af[_0x2321('0x26')]);_0x3996d3[_0x2321('0x29')]=_['intersection'](_0x1731af['model'],qs[_0x2321('0x2a')](_0x196953['query'][_0x2321('0x2a')]));_0x3996d3[_0x2321('0x29')]=_0x3996d3[_0x2321('0x29')][_0x2321('0x2b')]?_0x3996d3[_0x2321('0x29')]:_0x1731af[_0x2321('0x25')];if(!_0x196953[_0x2321('0x26')][_0x2321('0x2c')](_0x2321('0x2d'))){_0x3996d3[_0x2321('0xf')]=qs[_0x2321('0xf')](_0x196953[_0x2321('0x26')][_0x2321('0xf')]);_0x3996d3[_0x2321('0xd')]=qs[_0x2321('0xd')](_0x196953[_0x2321('0x26')][_0x2321('0xd')]);}_0x3996d3['order']=qs[_0x2321('0x2e')](_0x196953[_0x2321('0x26')]['sort']);_0x3996d3[_0x2321('0x2f')]=qs[_0x2321('0x28')](_[_0x2321('0x30')](_0x196953['query'],_0x1731af[_0x2321('0x28')]),_0x20c9ed);if(_0x196953[_0x2321('0x26')]['filter']){_0x3996d3['where']=_['merge'](_0x3996d3[_0x2321('0x2f')],{'$or':_[_0x2321('0x21')](_0x20c9ed,function(_0x127d58){if(_0x127d58[_0x2321('0x31')]!==_0x2321('0x32')){var _0x31955e={};_0x31955e[_0x127d58[_0x2321('0x1e')]]={'$like':'%'+_0x196953[_0x2321('0x26')][_0x2321('0x33')]+'%'};return _0x31955e;}})});}_0x3996d3=_[_0x2321('0x34')]({},_0x3996d3,_0x196953[_0x2321('0x35')]);var _0x54049b={'where':_0x3996d3[_0x2321('0x2f')]};return db[_0x2321('0x36')][_0x2321('0x37')](_0x54049b)[_0x2321('0x14')](function(_0x1cc800){_0x38362e[_0x2321('0x37')]=_0x1cc800;if(_0x196953[_0x2321('0x26')][_0x2321('0x38')]){_0x3996d3[_0x2321('0x39')]=[{'all':!![]}];}return db[_0x2321('0x36')][_0x2321('0x3a')](_0x3996d3);})['then'](function(_0x11822a){_0x38362e['rows']=_0x11822a;return _0x38362e;})[_0x2321('0x14')](respondWithFilteredResult(_0x262246,_0x3996d3))[_0x2321('0x3b')](handleError(_0x262246,null));};exports[_0x2321('0x3c')]=function(_0x844d86,_0x6bd680){var _0x19e6bc={'raw':![],'where':{'id':_0x844d86[_0x2321('0x3d')]['id']}},_0x1f90a3={};_0x1f90a3[_0x2321('0x25')]=_[_0x2321('0x27')](db[_0x2321('0x36')][_0x2321('0x22')]);_0x1f90a3[_0x2321('0x26')]=_['keys'](_0x844d86[_0x2321('0x26')]);_0x1f90a3[_0x2321('0x28')]=_[_0x2321('0x3e')](_0x1f90a3['model'],_0x1f90a3[_0x2321('0x26')]);_0x19e6bc['attributes']=_[_0x2321('0x3e')](_0x1f90a3[_0x2321('0x25')],qs[_0x2321('0x2a')](_0x844d86[_0x2321('0x26')][_0x2321('0x2a')]));_0x19e6bc[_0x2321('0x29')]=_0x19e6bc[_0x2321('0x29')][_0x2321('0x2b')]?_0x19e6bc[_0x2321('0x29')]:_0x1f90a3[_0x2321('0x25')];if(_0x844d86[_0x2321('0x26')]['includeAll']){_0x19e6bc[_0x2321('0x39')]=[{'all':!![]}];}_0x19e6bc=_[_0x2321('0x34')]({},_0x19e6bc,_0x844d86['options']);return db['SquareProject'][_0x2321('0x3f')](_0x19e6bc)[_0x2321('0x14')](handleEntityNotFound(_0x6bd680,null))[_0x2321('0x14')](respondWithResult(_0x6bd680,null))[_0x2321('0x3b')](handleError(_0x6bd680,null));};exports[_0x2321('0x40')]=function(_0xc30a16,_0x1c70c9){return db[_0x2321('0x36')]['create'](_0xc30a16[_0x2321('0x41')],{})[_0x2321('0x14')](function(_0x5dc0eb){var _0x42b335=_0xc30a16['user']['get']({'plain':!![]});if(!_0x42b335)throw new Error(_0x2321('0x42'));if(_0x42b335[_0x2321('0x43')]==='user'){var _0x178fc5=_0x5dc0eb[_0x2321('0x44')]({'plain':!![]});var _0x20a421=_0x2321('0x16');return db[_0x2321('0x45')]['find']({'where':{'name':_0x20a421,'userProfileId':_0x42b335[_0x2321('0x46')]},'raw':!![]})['then'](function(_0x56f2dc){if(_0x56f2dc&&_0x56f2dc[_0x2321('0x47')]===0x0){return db['UserProfileResource'][_0x2321('0x40')]({'name':_0x178fc5[_0x2321('0x1e')],'resourceId':_0x178fc5['id'],'type':_0x56f2dc[_0x2321('0x1e')],'sectionId':_0x56f2dc['id']},{})[_0x2321('0x14')](function(){return _0x5dc0eb;});}else{return _0x5dc0eb;}})[_0x2321('0x3b')](function(_0x2de75c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2de75c);throw _0x2de75c;});}return _0x5dc0eb;})[_0x2321('0x14')](respondWithResult(_0x1c70c9,0xc9))['catch'](handleError(_0x1c70c9,null));};exports[_0x2321('0x13')]=function(_0x220088,_0x5afdc9){if(_0x220088['body']['id']){delete _0x220088[_0x2321('0x41')]['id'];}return db[_0x2321('0x36')][_0x2321('0x3f')]({'where':{'id':_0x220088['params']['id']}})[_0x2321('0x14')](handleEntityNotFound(_0x5afdc9,null))[_0x2321('0x14')](saveUpdates(_0x220088[_0x2321('0x41')],null))[_0x2321('0x14')](function(_0x31aaff){if(!_0x31aaff)return;var _0x1de9b0=_0x31aaff['get']({'plain':!![]});return _0x1de9b0;})[_0x2321('0x14')](function(_0x1b25e2){var _0x2a07c3=new Redis(config[_0x2321('0x7')]);_0x2a07c3[_0x2321('0x18')](_0x2321('0x19'),JSON[_0x2321('0x1a')](_[_0x2321('0x30')](_0x1b25e2,['id',_0x2321('0x1e'),_0x2321('0x48')])));return _0x1b25e2;})[_0x2321('0x14')](respondWithResult(_0x5afdc9,null))[_0x2321('0x3b')](handleError(_0x5afdc9,null));};exports[_0x2321('0x15')]=function(_0x406f79,_0x3fe07f){return db[_0x2321('0x36')][_0x2321('0x3f')]({'where':{'id':_0x406f79[_0x2321('0x3d')]['id']}})[_0x2321('0x14')](handleEntityNotFound(_0x3fe07f,null))[_0x2321('0x14')](removeEntity(_0x3fe07f,null))[_0x2321('0x3b')](handleError(_0x3fe07f,null));}; \ No newline at end of file +var _0x3601=['index','map','SquareProject','rawAttributes','fieldName','model','name','keys','intersection','fields','query','attributes','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./squareProject.socket','register','status','offset','limit','undefined','count','Content-Range','json','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','send'];(function(_0x59ff11,_0x12f8bd){var _0x232a60=function(_0x1e0bdb){while(--_0x1e0bdb){_0x59ff11['push'](_0x59ff11['shift']());}};_0x232a60(++_0x12f8bd);}(_0x3601,0x6c));var _0x1360=function(_0x2f992e,_0x2c859d){_0x2f992e=_0x2f992e-0x0;var _0xf4f26=_0x3601[_0x2f992e];return _0xf4f26;};'use strict';var _=require(_0x1360('0x0'));var Redis=require(_0x1360('0x1'));var qs=require(_0x1360('0x2'));var logger=require(_0x1360('0x3'))(_0x1360('0x4'));var config=require(_0x1360('0x5'));var db=require(_0x1360('0x6'))['db'];config['redis']=_[_0x1360('0x7')](config[_0x1360('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x1360('0x9'))(new Redis(config[_0x1360('0x8')]));require(_0x1360('0xa'))[_0x1360('0xb')](socket);function respondWithResult(_0x59d074,_0x5c0af2){_0x5c0af2=_0x5c0af2||0xc8;return function(_0x4b205d){if(_0x4b205d){return _0x59d074[_0x1360('0xc')](_0x5c0af2)['json'](_0x4b205d);}};}function respondWithFilteredResult(_0x26a9d7,_0x3181c1){return function(_0x1c8fdf){if(_0x1c8fdf){var _0x5d954f=typeof _0x3181c1[_0x1360('0xd')]==='undefined'&&typeof _0x3181c1[_0x1360('0xe')]===_0x1360('0xf');var _0x2caac9=_0x1c8fdf['count'];var _0x358163=_0x5d954f?0x0:_0x3181c1[_0x1360('0xd')];var _0x1646ed=_0x5d954f?_0x1c8fdf[_0x1360('0x10')]:_0x3181c1[_0x1360('0xd')]+_0x3181c1[_0x1360('0xe')];var _0x1cdc55;if(_0x1646ed>=_0x2caac9){_0x1646ed=_0x2caac9;_0x1cdc55=0xc8;}else{_0x1cdc55=0xce;}_0x26a9d7['status'](_0x1cdc55);return _0x26a9d7['set'](_0x1360('0x11'),_0x358163+'-'+_0x1646ed+'/'+_0x2caac9)[_0x1360('0x12')](_0x1c8fdf);}return null;};}function saveUpdates(_0x377b8c){return function(_0x4422ba){if(_0x4422ba){return _0x4422ba['update'](_0x377b8c)[_0x1360('0x13')](function(_0x4079ff){return _0x4079ff;});}return null;};}function removeEntity(_0x544503){return function(_0x1137d4){if(_0x1137d4){return _0x1137d4[_0x1360('0x14')]()['then'](function(){var _0x471eb1=_0x1137d4[_0x1360('0x15')]({'plain':!![]});var _0x10a130=_0x1360('0x16');return db[_0x1360('0x17')][_0x1360('0x14')]({'where':{'type':_0x10a130,'resourceId':_0x471eb1['id']}})['then'](function(){return _0x1137d4;});})[_0x1360('0x13')](function(){var _0x405c57=new Redis(config[_0x1360('0x8')]);_0x405c57[_0x1360('0x18')](_0x1360('0x19'),JSON[_0x1360('0x1a')]({'id':_0x1137d4['id'],'deleted':!![]}));})[_0x1360('0x13')](function(){_0x544503[_0x1360('0xc')](0xcc)[_0x1360('0x1b')]();});}};}function handleEntityNotFound(_0x2520a8){return function(_0x363c11){if(!_0x363c11){_0x2520a8[_0x1360('0x1c')](0x194);}return _0x363c11;};}function handleError(_0x627a75,_0x2f0c30){_0x2f0c30=_0x2f0c30||0x1f4;return function(_0x231fc7){logger['error'](_0x231fc7['stack']);if(_0x231fc7['name']){delete _0x231fc7['name'];}_0x627a75[_0x1360('0xc')](_0x2f0c30)[_0x1360('0x1d')](_0x231fc7);};}exports[_0x1360('0x1e')]=function(_0x377177,_0x52ad4c){var _0x523efa={},_0x4317fa={},_0xa83e8d={'count':0x0,'rows':[]};var _0x124f96=_[_0x1360('0x1f')](db[_0x1360('0x20')][_0x1360('0x21')],function(_0x274d23){return{'name':_0x274d23[_0x1360('0x22')],'type':_0x274d23['type']['key']};});_0x4317fa[_0x1360('0x23')]=_['map'](_0x124f96,_0x1360('0x24'));_0x4317fa['query']=_[_0x1360('0x25')](_0x377177['query']);_0x4317fa['filters']=_[_0x1360('0x26')](_0x4317fa[_0x1360('0x23')],_0x4317fa['query']);_0x523efa['attributes']=_[_0x1360('0x26')](_0x4317fa[_0x1360('0x23')],qs[_0x1360('0x27')](_0x377177[_0x1360('0x28')][_0x1360('0x27')]));_0x523efa['attributes']=_0x523efa[_0x1360('0x29')]['length']?_0x523efa[_0x1360('0x29')]:_0x4317fa[_0x1360('0x23')];if(!_0x377177[_0x1360('0x28')][_0x1360('0x2a')]('nolimit')){_0x523efa['limit']=qs[_0x1360('0xe')](_0x377177[_0x1360('0x28')][_0x1360('0xe')]);_0x523efa[_0x1360('0xd')]=qs[_0x1360('0xd')](_0x377177[_0x1360('0x28')][_0x1360('0xd')]);}_0x523efa[_0x1360('0x2b')]=qs[_0x1360('0x2c')](_0x377177[_0x1360('0x28')][_0x1360('0x2c')]);_0x523efa['where']=qs['filters'](_[_0x1360('0x2d')](_0x377177[_0x1360('0x28')],_0x4317fa[_0x1360('0x2e')]),_0x124f96);if(_0x377177[_0x1360('0x28')][_0x1360('0x2f')]){_0x523efa[_0x1360('0x30')]=_[_0x1360('0x31')](_0x523efa[_0x1360('0x30')],{'$or':_['map'](_0x124f96,function(_0x54c6ba){if(_0x54c6ba['type']!==_0x1360('0x32')){var _0x42bb9b={};_0x42bb9b[_0x54c6ba[_0x1360('0x24')]]={'$like':'%'+_0x377177[_0x1360('0x28')][_0x1360('0x2f')]+'%'};return _0x42bb9b;}})});}_0x523efa=_[_0x1360('0x31')]({},_0x523efa,_0x377177['options']);var _0x25371c={'where':_0x523efa['where']};return db[_0x1360('0x20')][_0x1360('0x10')](_0x25371c)[_0x1360('0x13')](function(_0x29ff45){_0xa83e8d['count']=_0x29ff45;if(_0x377177[_0x1360('0x28')][_0x1360('0x33')]){_0x523efa[_0x1360('0x34')]=[{'all':!![]}];}return db[_0x1360('0x20')][_0x1360('0x35')](_0x523efa);})[_0x1360('0x13')](function(_0x2232a3){_0xa83e8d[_0x1360('0x36')]=_0x2232a3;return _0xa83e8d;})[_0x1360('0x13')](respondWithFilteredResult(_0x52ad4c,_0x523efa))[_0x1360('0x37')](handleError(_0x52ad4c,null));};exports[_0x1360('0x38')]=function(_0x3638af,_0x179977){var _0x12fc62={'raw':![],'where':{'id':_0x3638af[_0x1360('0x39')]['id']}},_0x3852f3={};_0x3852f3[_0x1360('0x23')]=_[_0x1360('0x25')](db['SquareProject'][_0x1360('0x21')]);_0x3852f3[_0x1360('0x28')]=_[_0x1360('0x25')](_0x3638af['query']);_0x3852f3[_0x1360('0x2e')]=_[_0x1360('0x26')](_0x3852f3[_0x1360('0x23')],_0x3852f3[_0x1360('0x28')]);_0x12fc62[_0x1360('0x29')]=_[_0x1360('0x26')](_0x3852f3[_0x1360('0x23')],qs['fields'](_0x3638af[_0x1360('0x28')][_0x1360('0x27')]));_0x12fc62[_0x1360('0x29')]=_0x12fc62[_0x1360('0x29')][_0x1360('0x3a')]?_0x12fc62[_0x1360('0x29')]:_0x3852f3[_0x1360('0x23')];if(_0x3638af['query']['includeAll']){_0x12fc62[_0x1360('0x34')]=[{'all':!![]}];}_0x12fc62=_[_0x1360('0x31')]({},_0x12fc62,_0x3638af[_0x1360('0x3b')]);return db[_0x1360('0x20')][_0x1360('0x3c')](_0x12fc62)[_0x1360('0x13')](handleEntityNotFound(_0x179977,null))[_0x1360('0x13')](respondWithResult(_0x179977,null))[_0x1360('0x37')](handleError(_0x179977,null));};exports[_0x1360('0x3d')]=function(_0x393227,_0x4cb5cd){return db[_0x1360('0x20')][_0x1360('0x3d')](_0x393227['body'],{})[_0x1360('0x13')](function(_0x91a242){var _0x7f4ff6=_0x393227[_0x1360('0x3e')]['get']({'plain':!![]});if(!_0x7f4ff6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7f4ff6[_0x1360('0x3f')]===_0x1360('0x3e')){var _0x3227b3=_0x91a242[_0x1360('0x15')]({'plain':!![]});var _0x2fe0f0=_0x1360('0x16');return db['UserProfileSection']['find']({'where':{'name':_0x2fe0f0,'userProfileId':_0x7f4ff6[_0x1360('0x40')]},'raw':!![]})[_0x1360('0x13')](function(_0x3bc37b){if(_0x3bc37b&&_0x3bc37b[_0x1360('0x41')]===0x0){return db[_0x1360('0x17')]['create']({'name':_0x3227b3[_0x1360('0x24')],'resourceId':_0x3227b3['id'],'type':_0x3bc37b[_0x1360('0x24')],'sectionId':_0x3bc37b['id']},{})[_0x1360('0x13')](function(){return _0x91a242;});}else{return _0x91a242;}})['catch'](function(_0xea34cf){logger[_0x1360('0x42')](_0x1360('0x43'),_0xea34cf);throw _0xea34cf;});}return _0x91a242;})[_0x1360('0x13')](respondWithResult(_0x4cb5cd,0xc9))[_0x1360('0x37')](handleError(_0x4cb5cd,null));};exports['update']=function(_0x3569ab,_0x47e977){if(_0x3569ab[_0x1360('0x44')]['id']){delete _0x3569ab[_0x1360('0x44')]['id'];}return db['SquareProject'][_0x1360('0x3c')]({'where':{'id':_0x3569ab[_0x1360('0x39')]['id']}})[_0x1360('0x13')](handleEntityNotFound(_0x47e977,null))[_0x1360('0x13')](saveUpdates(_0x3569ab[_0x1360('0x44')],null))['then'](function(_0x4ccd6e){if(!_0x4ccd6e)return;var _0x5d1de4=_0x4ccd6e[_0x1360('0x15')]({'plain':!![]});return _0x5d1de4;})[_0x1360('0x13')](function(_0x19f6a6){var _0x506175=new Redis(config['redis']);_0x506175[_0x1360('0x18')](_0x1360('0x19'),JSON[_0x1360('0x1a')](_['pick'](_0x19f6a6,['id',_0x1360('0x24'),'production'])));return _0x19f6a6;})[_0x1360('0x13')](respondWithResult(_0x47e977,null))[_0x1360('0x37')](handleError(_0x47e977,null));};exports[_0x1360('0x14')]=function(_0x4da041,_0x43c4af){return db[_0x1360('0x20')][_0x1360('0x3c')]({'where':{'id':_0x4da041['params']['id']}})[_0x1360('0x13')](handleEntityNotFound(_0x43c4af,null))[_0x1360('0x13')](removeEntity(_0x43c4af,null))[_0x1360('0x37')](handleError(_0x43c4af,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 801206f..bc87fdd 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 _0x5aed=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x30ae33,_0x1fe09e){var _0x5b6552=function(_0x12845e){while(--_0x12845e){_0x30ae33['push'](_0x30ae33['shift']());}};_0x5b6552(++_0x1fe09e);}(_0x5aed,0x159));var _0xd5ae=function(_0x37b0d0,_0x2a2c55){_0x37b0d0=_0x37b0d0-0x0;var _0x478631=_0x5aed[_0x37b0d0];return _0x478631;};'use strict';var EventEmitter=require(_0xd5ae('0x0'));var SquareProject=require(_0xd5ae('0x1'))['db'][_0xd5ae('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd5ae('0x3')](0x0);var events={'afterCreate':_0xd5ae('0x4'),'afterUpdate':_0xd5ae('0x5'),'afterDestroy':_0xd5ae('0x6')};function emitEvent(_0x2ffd50){return function(_0x441b75,_0x3ba959,_0x8a00ef){SquareProjectEvents['emit'](_0x2ffd50+':'+_0x441b75['id'],_0x441b75);SquareProjectEvents[_0xd5ae('0x7')](_0x2ffd50,_0x441b75);_0x8a00ef(null);};}for(var e in events){if(events[_0xd5ae('0x8')](e)){var event=events[e];SquareProject[_0xd5ae('0x9')](e,emitEvent(event));}}module[_0xd5ae('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0x6341=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','update','remove','emit'];(function(_0x1e1f4a,_0x15d8c7){var _0x2221c8=function(_0xd9e618){while(--_0xd9e618){_0x1e1f4a['push'](_0x1e1f4a['shift']());}};_0x2221c8(++_0x15d8c7);}(_0x6341,0x125));var _0x1634=function(_0x58512e,_0x2cc279){_0x58512e=_0x58512e-0x0;var _0x225d90=_0x6341[_0x58512e];return _0x225d90;};'use strict';var EventEmitter=require(_0x1634('0x0'));var SquareProject=require(_0x1634('0x1'))['db'][_0x1634('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1634('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1634('0x4'),'afterDestroy':_0x1634('0x5')};function emitEvent(_0x5895a8){return function(_0x20443a,_0x36ab83,_0x1f3174){SquareProjectEvents[_0x1634('0x6')](_0x5895a8+':'+_0x20443a['id'],_0x20443a);SquareProjectEvents[_0x1634('0x6')](_0x5895a8,_0x20443a);_0x1f3174(null);};}for(var e in events){if(events[_0x1634('0x7')](e)){var event=events[e];SquareProject[_0x1634('0x8')](e,emitEvent(event));}}module[_0x1634('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4bf90d8..42070d5 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 _0xc24b=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','format'];(function(_0xf293c7,_0xfd9cda){var _0x274559=function(_0x1b61d9){while(--_0x1b61d9){_0xf293c7['push'](_0xf293c7['shift']());}};_0x274559(++_0xfd9cda);}(_0xc24b,0x135));var _0xbc24=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0xc24b[_0x419e17];return _0x1f2044;};'use strict';var _=require('lodash');var util=require(_0xbc24('0x0'));var logger=require(_0xbc24('0x1'))(_0xbc24('0x2'));var moment=require(_0xbc24('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc24('0x4'));var fs=require('fs');var path=require(_0xbc24('0x5'));var rimraf=require('rimraf');var config=require(_0xbc24('0x6'));var attributes=require(_0xbc24('0x7'));module['exports']=function(_0x5d282c,_0x27543c){return _0x5d282c[_0xbc24('0x8')](_0xbc24('0x9'),attributes,{'tableName':_0xbc24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ec32,_0x3d0d53,_0x428b38){if(_0x3ec32[_0xbc24('0xb')]('preproduction')){_0x3ec32['savedAt']=moment()[_0xbc24('0xc')](_0xbc24('0xd'));}if(_0x3ec32['changed']('production')){_0x3ec32['publishedAt']=moment()[_0xbc24('0xc')](_0xbc24('0xd'));}_0x428b38(null,_0x3ec32);}}});}; \ No newline at end of file +var _0x4f34=['define','square_projects','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','../../config/logger','api','moment','../../config/environment','./squareProject.attributes','exports'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x4f34,0x190));var _0x44f3=function(_0x11eebd,_0x3e2689){_0x11eebd=_0x11eebd-0x0;var _0x33855d=_0x4f34[_0x11eebd];return _0x33855d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44f3('0x0'))(_0x44f3('0x1'));var moment=require(_0x44f3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x44f3('0x3'));var attributes=require(_0x44f3('0x4'));module[_0x44f3('0x5')]=function(_0x3cea32,_0x148b87){return _0x3cea32[_0x44f3('0x6')]('SquareProject',attributes,{'tableName':_0x44f3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d223e,_0x17c37b,_0x4a2ee8){if(_0x2d223e['changed']('preproduction')){_0x2d223e[_0x44f3('0x8')]=moment()[_0x44f3('0x9')](_0x44f3('0xa'));}if(_0x2d223e[_0x44f3('0xb')](_0x44f3('0xc'))){_0x2d223e[_0x44f3('0xd')]=moment()[_0x44f3('0x9')](_0x44f3('0xa'));}_0x4a2ee8(null,_0x2d223e);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 6c6652f..900400a 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 _0xdb1f=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','where','attributes','map','model','include','then','info','stringify','catch','error','message','find','raw','ShowSquareProject','../../mysqldb'];(function(_0xfc6c44,_0x211785){var _0x3536f0=function(_0x16a4ef){while(--_0x16a4ef){_0xfc6c44['push'](_0xfc6c44['shift']());}};_0x3536f0(++_0x211785);}(_0xdb1f,0xa1));var _0xfdb1=function(_0x27102a,_0x432add){_0x27102a=_0x27102a-0x0;var _0x314c90=_0xdb1f[_0x27102a];return _0x314c90;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0xfdb1('0x0'))['db'];var logger=require(_0xfdb1('0x1'))(_0xfdb1('0x2'));var config=require(_0xfdb1('0x3'));config[_0xfdb1('0x4')]=_[_0xfdb1('0x5')](config[_0xfdb1('0x4')],{'host':_0xfdb1('0x6'),'port':0x18eb});var socket=require(_0xfdb1('0x7'))(new Redis(config[_0xfdb1('0x4')]));require(_0xfdb1('0x8'))['register'](socket);exports[_0xfdb1('0x9')]=function(_0x3ed31a){var _0xe0df5=this;return new Promise(function(_0x8c1f6a,_0x20f7f3){return db[_0xfdb1('0xa')][_0xfdb1('0xb')]({'raw':_0x3ed31a[_0xfdb1('0xc')]?_0x3ed31a['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ed31a[_0xfdb1('0xc')]?_0x3ed31a[_0xfdb1('0xc')][_0xfdb1('0xd')]||null:null,'attributes':_0x3ed31a[_0xfdb1('0xc')]?_0x3ed31a[_0xfdb1('0xc')][_0xfdb1('0xe')]||null:null,'limit':_0x3ed31a[_0xfdb1('0xc')]?_0x3ed31a[_0xfdb1('0xc')]['limit']||null:null,'include':_0x3ed31a[_0xfdb1('0xc')]?_0x3ed31a[_0xfdb1('0xc')]['include']?_[_0xfdb1('0xf')](_0x3ed31a['options']['include'],function(_0x5c965f){return{'model':db[_0x5c965f[_0xfdb1('0x10')]],'as':_0x5c965f['as'],'attributes':_0x5c965f['attributes'],'include':_0x5c965f[_0xfdb1('0x11')]?_[_0xfdb1('0xf')](_0x5c965f['include'],function(_0x23edbc){return{'model':db[_0x23edbc[_0xfdb1('0x10')]],'as':_0x23edbc['as'],'attributes':_0x23edbc[_0xfdb1('0xe')],'include':_0x23edbc[_0xfdb1('0x11')]?_[_0xfdb1('0xf')](_0x23edbc[_0xfdb1('0x11')],function(_0x2c652f){return{'model':db[_0x2c652f[_0xfdb1('0x10')]],'as':_0x2c652f['as'],'attributes':_0x2c652f[_0xfdb1('0xe')]};}):[]};}):[]};}):[]:[]})[_0xfdb1('0x12')](function(_0x1e1e3f){logger[_0xfdb1('0x13')](_0xfdb1('0x9'),_0x3ed31a);logger['debug'](_0xfdb1('0x9'),_0x3ed31a,JSON[_0xfdb1('0x14')](_0x1e1e3f));_0x8c1f6a(_0x1e1e3f);})[_0xfdb1('0x15')](function(_0x4c4aa8){logger[_0xfdb1('0x16')](_0xfdb1('0x9'),_0x4c4aa8[_0xfdb1('0x17')],_0x3ed31a);_0x20f7f3(_0xe0df5['error'](0x1f4,_0x4c4aa8[_0xfdb1('0x17')]));});});};exports['ShowSquareProject']=function(_0x205b30){var _0x20e522=this;return new Promise(function(_0x107204,_0x4af2f3){return db[_0xfdb1('0xa')][_0xfdb1('0x18')]({'raw':_0x205b30[_0xfdb1('0xc')]?_0x205b30[_0xfdb1('0xc')][_0xfdb1('0x19')]===undefined?!![]:![]:!![],'where':_0x205b30[_0xfdb1('0xc')]?_0x205b30[_0xfdb1('0xc')][_0xfdb1('0xd')]||null:null,'attributes':_0x205b30[_0xfdb1('0xc')]?_0x205b30[_0xfdb1('0xc')][_0xfdb1('0xe')]||null:null,'include':_0x205b30[_0xfdb1('0xc')]?_0x205b30[_0xfdb1('0xc')][_0xfdb1('0x11')]?_[_0xfdb1('0xf')](_0x205b30[_0xfdb1('0xc')][_0xfdb1('0x11')],function(_0x4c39cd){return{'model':db[_0x4c39cd[_0xfdb1('0x10')]],'as':_0x4c39cd['as'],'attributes':_0x4c39cd['attributes'],'include':_0x4c39cd[_0xfdb1('0x11')]?_[_0xfdb1('0xf')](_0x4c39cd[_0xfdb1('0x11')],function(_0x3bf82c){return{'model':db[_0x3bf82c[_0xfdb1('0x10')]],'as':_0x3bf82c['as'],'attributes':_0x3bf82c[_0xfdb1('0xe')],'include':_0x3bf82c[_0xfdb1('0x11')]?_[_0xfdb1('0xf')](_0x3bf82c[_0xfdb1('0x11')],function(_0x2c2632){return{'model':db[_0x2c2632['model']],'as':_0x2c2632['as'],'attributes':_0x2c2632[_0xfdb1('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x268fe3){logger[_0xfdb1('0x13')](_0xfdb1('0x1a'),_0x205b30);logger['debug'](_0xfdb1('0x1a'),_0x205b30,JSON[_0xfdb1('0x14')](_0x268fe3));_0x107204(_0x268fe3);})[_0xfdb1('0x15')](function(_0x94fa9a){logger[_0xfdb1('0x16')](_0xfdb1('0x1a'),_0x94fa9a[_0xfdb1('0x17')],_0x205b30);_0x4af2f3(_0x20e522[_0xfdb1('0x16')](0x1f4,_0x94fa9a['message']));});});}; \ No newline at end of file +var _0xcd15=['where','debug','catch','lodash','ioredis','rpc','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject','options','raw','attributes','limit','include','model','map','then','info','GetSquareProjects','stringify','error','message','ShowSquareProject','find'];(function(_0x3b4cf3,_0x29472b){var _0x43769d=function(_0x140a47){while(--_0x140a47){_0x3b4cf3['push'](_0x3b4cf3['shift']());}};_0x43769d(++_0x29472b);}(_0xcd15,0xc7));var _0x5cd1=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xcd15[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x5cd1('0x0'));var Redis=require(_0x5cd1('0x1'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x5cd1('0x2'));var config=require(_0x5cd1('0x3'));config[_0x5cd1('0x4')]=_['defaults'](config[_0x5cd1('0x4')],{'host':_0x5cd1('0x5'),'port':0x18eb});var socket=require(_0x5cd1('0x6'))(new Redis(config[_0x5cd1('0x4')]));require(_0x5cd1('0x7'))[_0x5cd1('0x8')](socket);exports['GetSquareProjects']=function(_0x43902e){var _0x433edf=this;return new Promise(function(_0x5e9072,_0x57d034){return db[_0x5cd1('0x9')]['findAll']({'raw':_0x43902e[_0x5cd1('0xa')]?_0x43902e['options'][_0x5cd1('0xb')]===undefined?!![]:![]:!![],'where':_0x43902e[_0x5cd1('0xa')]?_0x43902e[_0x5cd1('0xa')]['where']||null:null,'attributes':_0x43902e['options']?_0x43902e['options'][_0x5cd1('0xc')]||null:null,'limit':_0x43902e['options']?_0x43902e[_0x5cd1('0xa')][_0x5cd1('0xd')]||null:null,'include':_0x43902e['options']?_0x43902e[_0x5cd1('0xa')][_0x5cd1('0xe')]?_['map'](_0x43902e[_0x5cd1('0xa')][_0x5cd1('0xe')],function(_0x52bd62){return{'model':db[_0x52bd62[_0x5cd1('0xf')]],'as':_0x52bd62['as'],'attributes':_0x52bd62['attributes'],'include':_0x52bd62[_0x5cd1('0xe')]?_[_0x5cd1('0x10')](_0x52bd62[_0x5cd1('0xe')],function(_0x242e6c){return{'model':db[_0x242e6c[_0x5cd1('0xf')]],'as':_0x242e6c['as'],'attributes':_0x242e6c[_0x5cd1('0xc')],'include':_0x242e6c['include']?_[_0x5cd1('0x10')](_0x242e6c['include'],function(_0x3f0054){return{'model':db[_0x3f0054[_0x5cd1('0xf')]],'as':_0x3f0054['as'],'attributes':_0x3f0054[_0x5cd1('0xc')]};}):[]};}):[]};}):[]:[]})[_0x5cd1('0x11')](function(_0x588694){logger[_0x5cd1('0x12')]('GetSquareProjects',_0x43902e);logger['debug'](_0x5cd1('0x13'),_0x43902e,JSON[_0x5cd1('0x14')](_0x588694));_0x5e9072(_0x588694);})['catch'](function(_0x470e69){logger[_0x5cd1('0x15')](_0x5cd1('0x13'),_0x470e69[_0x5cd1('0x16')],_0x43902e);_0x57d034(_0x433edf['error'](0x1f4,_0x470e69[_0x5cd1('0x16')]));});});};exports[_0x5cd1('0x17')]=function(_0x2025fd){var _0x1d690e=this;return new Promise(function(_0x44e9fc,_0x59a6d1){return db[_0x5cd1('0x9')][_0x5cd1('0x18')]({'raw':_0x2025fd[_0x5cd1('0xa')]?_0x2025fd[_0x5cd1('0xa')][_0x5cd1('0xb')]===undefined?!![]:![]:!![],'where':_0x2025fd['options']?_0x2025fd['options'][_0x5cd1('0x19')]||null:null,'attributes':_0x2025fd[_0x5cd1('0xa')]?_0x2025fd[_0x5cd1('0xa')]['attributes']||null:null,'include':_0x2025fd['options']?_0x2025fd[_0x5cd1('0xa')][_0x5cd1('0xe')]?_[_0x5cd1('0x10')](_0x2025fd[_0x5cd1('0xa')][_0x5cd1('0xe')],function(_0x4fc746){return{'model':db[_0x4fc746[_0x5cd1('0xf')]],'as':_0x4fc746['as'],'attributes':_0x4fc746[_0x5cd1('0xc')],'include':_0x4fc746[_0x5cd1('0xe')]?_[_0x5cd1('0x10')](_0x4fc746[_0x5cd1('0xe')],function(_0x1cbd6a){return{'model':db[_0x1cbd6a['model']],'as':_0x1cbd6a['as'],'attributes':_0x1cbd6a[_0x5cd1('0xc')],'include':_0x1cbd6a[_0x5cd1('0xe')]?_['map'](_0x1cbd6a[_0x5cd1('0xe')],function(_0x5ac353){return{'model':db[_0x5ac353[_0x5cd1('0xf')]],'as':_0x5ac353['as'],'attributes':_0x5ac353[_0x5cd1('0xc')]};}):[]};}):[]};}):[]:[]})[_0x5cd1('0x11')](function(_0x3d1a95){logger[_0x5cd1('0x12')](_0x5cd1('0x17'),_0x2025fd);logger[_0x5cd1('0x1a')](_0x5cd1('0x17'),_0x2025fd,JSON[_0x5cd1('0x14')](_0x3d1a95));_0x44e9fc(_0x3d1a95);})[_0x5cd1('0x1b')](function(_0x1f85f2){logger[_0x5cd1('0x15')](_0x5cd1('0x17'),_0x1f85f2['message'],_0x2025fd);_0x59a6d1(_0x1d690e[_0x5cd1('0x15')](0x1f4,_0x1f85f2[_0x5cd1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index fef2e10..b079740 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 _0x4783=['length','squareProject:','./squareProject.events','removeListener','register'];(function(_0x26ea61,_0x1b983c){var _0x1b89c4=function(_0xe8554f){while(--_0xe8554f){_0x26ea61['push'](_0x26ea61['shift']());}};_0x1b89c4(++_0x1b983c);}(_0x4783,0x151));var _0x3478=function(_0x409328,_0x34533d){_0x409328=_0x409328-0x0;var _0x3a8e47=_0x4783[_0x409328];return _0x3a8e47;};'use strict';var SquareProjectEvents=require(_0x3478('0x0'));var events=['save','remove','update'];function createListener(_0x508deb,_0x10d8a2){return function(_0x5bab90){_0x10d8a2['emit'](_0x508deb,_0x5bab90);};}function removeListener(_0x20558f,_0x23bb4f){return function(){SquareProjectEvents[_0x3478('0x1')](_0x20558f,_0x23bb4f);};}exports[_0x3478('0x2')]=function(_0x41e41){for(var _0x19f208=0x0,_0xe410ed=events[_0x3478('0x3')];_0x19f208<_0xe410ed;_0x19f208++){var _0x353fbc=events[_0x19f208];var _0x48e95c=createListener(_0x3478('0x4')+_0x353fbc,_0x41e41);SquareProjectEvents['on'](_0x353fbc,_0x48e95c);}}; \ No newline at end of file +var _0x0dd3=['remove','removeListener','register','squareProject:','./squareProject.events','save'];(function(_0x57613b,_0x318d64){var _0x80078d=function(_0x47ce0b){while(--_0x47ce0b){_0x57613b['push'](_0x57613b['shift']());}};_0x80078d(++_0x318d64);}(_0x0dd3,0xd6));var _0x30dd=function(_0x29a6cd,_0x481b0e){_0x29a6cd=_0x29a6cd-0x0;var _0xc1922=_0x0dd3[_0x29a6cd];return _0xc1922;};'use strict';var SquareProjectEvents=require(_0x30dd('0x0'));var events=[_0x30dd('0x1'),_0x30dd('0x2'),'update'];function createListener(_0x4118a8,_0xa30332){return function(_0x5dea03){_0xa30332['emit'](_0x4118a8,_0x5dea03);};}function removeListener(_0x39849c,_0x5721c1){return function(){SquareProjectEvents[_0x30dd('0x3')](_0x39849c,_0x5721c1);};}exports[_0x30dd('0x4')]=function(_0x3d9f2d){for(var _0xfe9cc3=0x0,_0x4fb178=events['length'];_0xfe9cc3<_0x4fb178;_0xfe9cc3++){var _0x4985a9=events[_0xfe9cc3];var _0xa4bd92=createListener(_0x30dd('0x5')+_0x4985a9,_0x3d9f2d);SquareProjectEvents['on'](_0x4985a9,_0xa4bd92);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 474bf00..8fdc106 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1aa890,_0x1f57c9){var _0x120a4f=function(_0x4f1893){while(--_0x4f1893){_0x1aa890['push'](_0x1aa890['shift']());}};_0x120a4f(++_0x1f57c9);}(_0x4975,0x86));var _0x5497=function(_0x29e7ee,_0x3a1dcb){_0x29e7ee=_0x29e7ee-0x0;var _0xbd20ce=_0x4975[_0x29e7ee];return _0xbd20ce;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x56d521,_0x4200f1){var _0x12da6c=function(_0x2ec347){while(--_0x2ec347){_0x56d521['push'](_0x56d521['shift']());}};_0x12da6c(++_0x4200f1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xe75d24,_0x54f93b){_0xe75d24=_0xe75d24-0x0;var _0x4d2587=_0x7fbe[_0xe75d24];return _0x4d2587;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 43c578f..49b272f 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 _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x50c614,_0x3e77a9){var _0x4169bb=function(_0x41875a){while(--_0x41875a){_0x50c614['push'](_0x50c614['shift']());}};_0x4169bb(++_0x3e77a9);}(_0x207c,0x1e8));var _0xc207=function(_0x5dac46,_0x28e9dc){_0x5dac46=_0x5dac46-0x0;var _0x51095c=_0x207c[_0x5dac46];return _0x51095c;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}}; \ No newline at end of file +var _0x9c5a=['getDataValue','savePath','lastIndexOf','sequelize','exports','STRING','VIRTUAL'];(function(_0x5eca9f,_0x1d15d3){var _0x53a05c=function(_0x10bacd){while(--_0x10bacd){_0x5eca9f['push'](_0x5eca9f['shift']());}};_0x53a05c(++_0x1d15d3);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x19cc2c,_0x48fb6c){_0x19cc2c=_0x19cc2c-0x0;var _0x2f23f4=_0x9c5a[_0x19cc2c];return _0x2f23f4;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa9c5('0x2')]},'calleridname':{'type':Sequelize[_0xa9c5('0x2')]},'context':{'type':Sequelize[_0xa9c5('0x2')]},'extension':{'type':Sequelize[_0xa9c5('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa9c5('0x2')]},'dnid':{'type':Sequelize[_0xa9c5('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xa9c5('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xa9c5('0x2')]},'format':{'type':Sequelize[_0xa9c5('0x3')],'get':function(){var _0x4cb597='';var _0x4b6db6=this[_0xa9c5('0x4')](_0xa9c5('0x5'));if(_0x4b6db6){_0x4cb597=_0x4b6db6['substring'](_0x4b6db6[_0xa9c5('0x6')]('.'));}return _0x4cb597;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 9dda672..ac9c128 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 _0x34ba=['isNil','info','existsSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','map','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','type','options','SquareRecording','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','fields','merge','find','create','body','download','uniqueid','savePath','format','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','send','Not\x20found'];(function(_0x5c9869,_0x4bfd2c){var _0x3685d2=function(_0xa1b2a){while(--_0xa1b2a){_0x5c9869['push'](_0x5c9869['shift']());}};_0x3685d2(++_0x4bfd2c);}(_0x34ba,0x120));var _0xa34b=function(_0xe159f4,_0xb9f2ea){_0xe159f4=_0xe159f4-0x0;var _0x3cfc08=_0x34ba[_0xe159f4];return _0x3cfc08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa34b('0x0'));var zipdir=require(_0xa34b('0x1'));var jsonpatch=require(_0xa34b('0x2'));var rp=require(_0xa34b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa34b('0x4'));var util=require(_0xa34b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa34b('0x6'));var ejs=require(_0xa34b('0x7'));var fs=require('fs');var fs_extra=require(_0xa34b('0x8'));var _=require(_0xa34b('0x9'));var squel=require(_0xa34b('0xa'));var crypto=require(_0xa34b('0xb'));var jsforce=require(_0xa34b('0xc'));var deskjs=require(_0xa34b('0xd'));var toCsv=require(_0xa34b('0x6'));var querystring=require('querystring');var Papa=require(_0xa34b('0xe'));var Redis=require(_0xa34b('0xf'));var authService=require(_0xa34b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa34b('0x11'));var hardwareService=require(_0xa34b('0x12'));var logger=require(_0xa34b('0x13'))(_0xa34b('0x14'));var utils=require(_0xa34b('0x15'));var config=require(_0xa34b('0x16'));var licenseUtil=require(_0xa34b('0x17'));var db=require(_0xa34b('0x18'))['db'];function respondWithStatusCode(_0x5988a8,_0x36bd17){_0x36bd17=_0x36bd17||0xcc;return function(_0x362467){if(_0x362467){return _0x5988a8[_0xa34b('0x19')](_0x36bd17);}return _0x5988a8[_0xa34b('0x1a')](_0x36bd17)[_0xa34b('0x1b')]();};}function respondWithResult(_0x6046d4,_0x96f136){_0x96f136=_0x96f136||0xc8;return function(_0x5c8ad0){if(_0x5c8ad0){return _0x6046d4[_0xa34b('0x1a')](_0x96f136)[_0xa34b('0x1c')](_0x5c8ad0);}};}function respondWithFilteredResult(_0x40aafe,_0x58d332){return function(_0x1d3772){if(_0x1d3772){var _0x527f01=typeof _0x58d332['offset']==='undefined'&&typeof _0x58d332[_0xa34b('0x1d')]===_0xa34b('0x1e');var _0x138c81=_0x1d3772[_0xa34b('0x1f')];var _0x517317=_0x527f01?0x0:_0x58d332['offset'];var _0x264e0f=_0x527f01?_0x1d3772['count']:_0x58d332['offset']+_0x58d332['limit'];var _0x58a581;if(_0x264e0f>=_0x138c81){_0x264e0f=_0x138c81;_0x58a581=0xc8;}else{_0x58a581=0xce;}_0x40aafe[_0xa34b('0x1a')](_0x58a581);return _0x40aafe[_0xa34b('0x20')]('Content-Range',_0x517317+'-'+_0x264e0f+'/'+_0x138c81)[_0xa34b('0x1c')](_0x1d3772);}return null;};}function patchUpdates(_0x5e5144){return function(_0x5efa73){try{jsonpatch[_0xa34b('0x21')](_0x5efa73,_0x5e5144,!![]);}catch(_0x212449){return BPromise[_0xa34b('0x22')](_0x212449);}return _0x5efa73['save']();};}function saveUpdates(_0x505c92,_0x4389d4){return function(_0x1a38a2){if(_0x1a38a2){return _0x1a38a2[_0xa34b('0x23')](_0x505c92)[_0xa34b('0x24')](function(_0x1658bb){return _0x1658bb;});}return null;};}function removeEntity(_0x548472,_0x8b460f){return function(_0x218e0d){if(_0x218e0d){return _0x218e0d[_0xa34b('0x25')]()['then'](function(){_0x548472[_0xa34b('0x1a')](0xcc)[_0xa34b('0x1b')]();});}};}function handleEntityNotFound(_0xa5e156,_0x4e94b3){return function(_0x35e26c){if(!_0x35e26c){_0xa5e156[_0xa34b('0x19')](0x194);}return _0x35e26c;};}function handleError(_0x1e5ecc,_0x27c0a5){_0x27c0a5=_0x27c0a5||0x1f4;return function(_0x140724){logger[_0xa34b('0x26')](_0x140724[_0xa34b('0x27')]);if(_0x140724[_0xa34b('0x28')]){delete _0x140724[_0xa34b('0x28')];}_0x1e5ecc[_0xa34b('0x1a')](_0x27c0a5)['send'](_0x140724);};}exports['index']=function(_0x3a4d0e,_0x41d1f7){var _0x34ef58={},_0x4fff6a={},_0x50cb0c={'count':0x0,'rows':[]};var _0x4e033a=_[_0xa34b('0x29')](db['SquareRecording']['rawAttributes'],function(_0x27cda3){return{'name':_0x27cda3[_0xa34b('0x2a')],'type':_0x27cda3['type'][_0xa34b('0x2b')]};});_0x4fff6a[_0xa34b('0x2c')]=_[_0xa34b('0x29')](_0x4e033a,_0xa34b('0x28'));_0x4fff6a[_0xa34b('0x2d')]=_['keys'](_0x3a4d0e[_0xa34b('0x2d')]);_0x4fff6a[_0xa34b('0x2e')]=_[_0xa34b('0x2f')](_0x4fff6a['model'],_0x4fff6a[_0xa34b('0x2d')]);_0x34ef58[_0xa34b('0x30')]=_[_0xa34b('0x2f')](_0x4fff6a[_0xa34b('0x2c')],qs['fields'](_0x3a4d0e[_0xa34b('0x2d')]['fields']));_0x34ef58[_0xa34b('0x30')]=_0x34ef58[_0xa34b('0x30')][_0xa34b('0x31')]?_0x34ef58['attributes']:_0x4fff6a[_0xa34b('0x2c')];if(!_0x3a4d0e[_0xa34b('0x2d')][_0xa34b('0x32')](_0xa34b('0x33'))){_0x34ef58['limit']=qs['limit'](_0x3a4d0e[_0xa34b('0x2d')][_0xa34b('0x1d')]);_0x34ef58['offset']=qs[_0xa34b('0x34')](_0x3a4d0e[_0xa34b('0x2d')]['offset']);}_0x34ef58[_0xa34b('0x35')]=qs['sort'](_0x3a4d0e[_0xa34b('0x2d')][_0xa34b('0x36')]);_0x34ef58[_0xa34b('0x37')]=qs[_0xa34b('0x2e')](_[_0xa34b('0x38')](_0x3a4d0e[_0xa34b('0x2d')],_0x4fff6a[_0xa34b('0x2e')]),_0x4e033a);if(_0x3a4d0e[_0xa34b('0x2d')][_0xa34b('0x39')]){_0x34ef58[_0xa34b('0x37')]=_['merge'](_0x34ef58[_0xa34b('0x37')],{'$or':_['map'](_0x4e033a,function(_0x4df7c5){if(_0x4df7c5[_0xa34b('0x3a')]!=='VIRTUAL'){var _0x3a5296={};_0x3a5296[_0x4df7c5['name']]={'$like':'%'+_0x3a4d0e[_0xa34b('0x2d')][_0xa34b('0x39')]+'%'};return _0x3a5296;}})});}_0x34ef58=_['merge']({},_0x34ef58,_0x3a4d0e[_0xa34b('0x3b')]);var _0x5354cc={'where':_0x34ef58[_0xa34b('0x37')]};return db[_0xa34b('0x3c')][_0xa34b('0x1f')](_0x5354cc)[_0xa34b('0x24')](function(_0x277703){_0x50cb0c['count']=_0x277703;if(_0x3a4d0e['query'][_0xa34b('0x3d')]){_0x34ef58[_0xa34b('0x3e')]=[{'all':!![]}];}return db[_0xa34b('0x3c')][_0xa34b('0x3f')](_0x34ef58);})[_0xa34b('0x24')](function(_0x325d15){_0x50cb0c[_0xa34b('0x40')]=_0x325d15;return _0x50cb0c;})[_0xa34b('0x24')](respondWithFilteredResult(_0x41d1f7,_0x34ef58))[_0xa34b('0x41')](handleError(_0x41d1f7,null));};exports['show']=function(_0x529680,_0x2e561d){var _0x1b7f03={'raw':!![],'where':{'id':_0x529680[_0xa34b('0x42')]['id']}},_0x3a2fe4={};_0x3a2fe4[_0xa34b('0x2c')]=_[_0xa34b('0x43')](db[_0xa34b('0x3c')][_0xa34b('0x44')]);_0x3a2fe4[_0xa34b('0x2d')]=_['keys'](_0x529680[_0xa34b('0x2d')]);_0x3a2fe4[_0xa34b('0x2e')]=_[_0xa34b('0x2f')](_0x3a2fe4['model'],_0x3a2fe4[_0xa34b('0x2d')]);_0x1b7f03['attributes']=_[_0xa34b('0x2f')](_0x3a2fe4['model'],qs[_0xa34b('0x45')](_0x529680[_0xa34b('0x2d')][_0xa34b('0x45')]));_0x1b7f03['attributes']=_0x1b7f03[_0xa34b('0x30')][_0xa34b('0x31')]?_0x1b7f03['attributes']:_0x3a2fe4[_0xa34b('0x2c')];if(_0x529680[_0xa34b('0x2d')][_0xa34b('0x3d')]){_0x1b7f03[_0xa34b('0x3e')]=[{'all':!![]}];}_0x1b7f03=_[_0xa34b('0x46')]({},_0x1b7f03,_0x529680[_0xa34b('0x3b')]);return db[_0xa34b('0x3c')][_0xa34b('0x47')](_0x1b7f03)[_0xa34b('0x24')](handleEntityNotFound(_0x2e561d,null))[_0xa34b('0x24')](respondWithResult(_0x2e561d,null))[_0xa34b('0x41')](handleError(_0x2e561d,null));};exports['create']=function(_0x255678,_0x1aa76a){return db[_0xa34b('0x3c')][_0xa34b('0x48')](_0x255678[_0xa34b('0x49')],{})[_0xa34b('0x24')](respondWithResult(_0x1aa76a,0xc9))[_0xa34b('0x41')](handleError(_0x1aa76a,null));};exports['update']=function(_0xa920f,_0x75877c){if(_0xa920f[_0xa34b('0x49')]['id']){delete _0xa920f[_0xa34b('0x49')]['id'];}return db[_0xa34b('0x3c')][_0xa34b('0x47')]({'where':{'id':_0xa920f[_0xa34b('0x42')]['id']}})[_0xa34b('0x24')](handleEntityNotFound(_0x75877c,null))[_0xa34b('0x24')](saveUpdates(_0xa920f[_0xa34b('0x49')],null))[_0xa34b('0x24')](respondWithResult(_0x75877c,null))[_0xa34b('0x41')](handleError(_0x75877c,null));};exports[_0xa34b('0x4a')]=function(_0x24c955,_0x589d19,_0x2dfda3){var _0x3fbfa5=require('../../components/encryptor');var _0x191489=![];var _0x850186={};if(_0x24c955[_0xa34b('0x2d')]['type']&&_0x24c955[_0xa34b('0x2d')][_0xa34b('0x3a')]===_0xa34b('0x4b')){_0x850186[_0xa34b('0x4b')]=_0x24c955[_0xa34b('0x42')]['id'];}else{_0x850186['id']=_0x24c955[_0xa34b('0x42')]['id'];}return db[_0xa34b('0x3c')][_0xa34b('0x47')]({'where':_0x850186,'attributes':['id',_0xa34b('0x4c'),'filename'],'raw':!![]})[_0xa34b('0x24')](handleEntityNotFound(_0x589d19,null))['then'](function(_0x115328){if(_0x115328){var _0x2fa78c=_0x115328[_0xa34b('0x4c')];var _0x2aaa00=util[_0xa34b('0x4d')](_0xa34b('0x4e'),_0x2fa78c);if(fs['existsSync'](_0x2aaa00)){_0x191489=!![];return _0x3fbfa5[_0xa34b('0x4f')](_0x2aaa00,_0x2fa78c,config[_0xa34b('0x50')]['recording'])[_0xa34b('0x24')](function(){return _0x115328;});}return _0x115328;}})['then'](function(_0x424d18){if(_0x424d18){var _0xf5115e=_0x424d18[_0xa34b('0x4c')];if(!fs['existsSync'](_0xf5115e)){throw new db[(_0xa34b('0x51'))][(_0xa34b('0x52'))]('SquareRecording\x20not\x20found');}if(_0x424d18['filename']){return _0x589d19['download'](_0xf5115e,_0x424d18[_0xa34b('0x53')]+path[_0xa34b('0x54')](_0xf5115e),function(){if(_0x191489){fs[_0xa34b('0x55')](_0xf5115e);}});}else{return _0x589d19[_0xa34b('0x4a')](_0xf5115e,function(_0x85248e){if(_0x191489){fs[_0xa34b('0x55')](_0xf5115e);}});}}})['catch'](function(_0x50f757){if(_0x50f757['message']==='SquareRecording\x20not\x20found'){_0x589d19[_0xa34b('0x1a')](0x194)[_0xa34b('0x56')](_0xa34b('0x57'));}else{return handleError(_0x589d19,null);}});};exports[_0xa34b('0x25')]=function(_0x58ffe1,_0x26eff5){return db[_0xa34b('0x3c')][_0xa34b('0x47')]({'where':{'id':_0x58ffe1[_0xa34b('0x42')]['id']}})[_0xa34b('0x24')](function(_0xae7269){if(_[_0xa34b('0x58')](_0xae7269)){throw new ReferenceError('Entity\x20not\x20found');}return _0xae7269;})[_0xa34b('0x24')](function(_0x3d67d4){var _0x2f1931=_0x3d67d4['savePath'];logger[_0xa34b('0x59')]('cancellazione\x20fisica\x20documento\x20%s',_0x2f1931);if(!_[_0xa34b('0x58')](_0x3d67d4[_0xa34b('0x4c')])&&fs[_0xa34b('0x5a')](_0x2f1931)){logger[_0xa34b('0x59')]('File:\x20\x22'+_0x2f1931+_0xa34b('0x5b'));fs['unlinkSync'](_0x2f1931);}_0x2f1931=_0x2f1931+_0xa34b('0x5c');if(!_[_0xa34b('0x58')](_0x3d67d4[_0xa34b('0x4c')])&&fs['existsSync'](_0x2f1931)){logger[_0xa34b('0x59')](_0xa34b('0x5d')+_0x2f1931+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2f1931);}return _0x3d67d4;})[_0xa34b('0x24')](function(_0x3f1c02){if(!_0x3f1c02)throw new InternalError();return _0x3f1c02[_0xa34b('0x25')]();})['then'](function(){_0x26eff5[_0xa34b('0x1a')](0xcc)[_0xa34b('0x1b')]();})['catch'](handleError(_0x26eff5,null));}; \ No newline at end of file +var _0x4062=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','SquareRecording','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','unlink','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','eml-format','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','index','map','rawAttributes'];(function(_0x595e2b,_0x504290){var _0xce5d7=function(_0x175ed5){while(--_0x175ed5){_0x595e2b['push'](_0x595e2b['shift']());}};_0xce5d7(++_0x504290);}(_0x4062,0x8e));var _0x2406=function(_0xd8f814,_0x341c6c){_0xd8f814=_0xd8f814-0x0;var _0x46dd67=_0x4062[_0xd8f814];return _0x46dd67;};'use strict';var emlformat=require(_0x2406('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2406('0x1'));var rp=require('request-promise');var moment=require(_0x2406('0x2'));var BPromise=require(_0x2406('0x3'));var Mustache=require('mustache');var util=require(_0x2406('0x4'));var path=require('path');var sox=require(_0x2406('0x5'));var csv=require(_0x2406('0x6'));var ejs=require(_0x2406('0x7'));var fs=require('fs');var fs_extra=require(_0x2406('0x8'));var _=require('lodash');var squel=require(_0x2406('0x9'));var crypto=require('crypto');var jsforce=require(_0x2406('0xa'));var deskjs=require(_0x2406('0xb'));var toCsv=require(_0x2406('0x6'));var querystring=require(_0x2406('0xc'));var Papa=require(_0x2406('0xd'));var Redis=require(_0x2406('0xe'));var authService=require(_0x2406('0xf'));var qs=require(_0x2406('0x10'));var as=require(_0x2406('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2406('0x12'))('api');var utils=require(_0x2406('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2406('0x14'))['db'];function respondWithStatusCode(_0x575e98,_0x1853f4){_0x1853f4=_0x1853f4||0xcc;return function(_0x178119){if(_0x178119){return _0x575e98[_0x2406('0x15')](_0x1853f4);}return _0x575e98['status'](_0x1853f4)['end']();};}function respondWithResult(_0x52ac0c,_0x41e3fb){_0x41e3fb=_0x41e3fb||0xc8;return function(_0x9a644b){if(_0x9a644b){return _0x52ac0c[_0x2406('0x16')](_0x41e3fb)[_0x2406('0x17')](_0x9a644b);}};}function respondWithFilteredResult(_0x4e7f33,_0x304427){return function(_0x3e9209){if(_0x3e9209){var _0x1dfd29=typeof _0x304427[_0x2406('0x18')]===_0x2406('0x19')&&typeof _0x304427[_0x2406('0x1a')]==='undefined';var _0x32f082=_0x3e9209[_0x2406('0x1b')];var _0x1ca679=_0x1dfd29?0x0:_0x304427['offset'];var _0x17a207=_0x1dfd29?_0x3e9209['count']:_0x304427[_0x2406('0x18')]+_0x304427[_0x2406('0x1a')];var _0x25a5d0;if(_0x17a207>=_0x32f082){_0x17a207=_0x32f082;_0x25a5d0=0xc8;}else{_0x25a5d0=0xce;}_0x4e7f33[_0x2406('0x16')](_0x25a5d0);return _0x4e7f33[_0x2406('0x1c')](_0x2406('0x1d'),_0x1ca679+'-'+_0x17a207+'/'+_0x32f082)[_0x2406('0x17')](_0x3e9209);}return null;};}function patchUpdates(_0x30c4f1){return function(_0x47bc8b){try{jsonpatch['apply'](_0x47bc8b,_0x30c4f1,!![]);}catch(_0x27e187){return BPromise[_0x2406('0x1e')](_0x27e187);}return _0x47bc8b['save']();};}function saveUpdates(_0x41e1f3,_0x32ad9f){return function(_0x5aec71){if(_0x5aec71){return _0x5aec71[_0x2406('0x1f')](_0x41e1f3)[_0x2406('0x20')](function(_0x1ea025){return _0x1ea025;});}return null;};}function removeEntity(_0x34dadb,_0xe19e6b){return function(_0x282456){if(_0x282456){return _0x282456[_0x2406('0x21')]()['then'](function(){_0x34dadb[_0x2406('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f972,_0x383b02){return function(_0x50c798){if(!_0x50c798){_0x26f972[_0x2406('0x15')](0x194);}return _0x50c798;};}function handleError(_0x543831,_0x1240ad){_0x1240ad=_0x1240ad||0x1f4;return function(_0x5699aa){logger[_0x2406('0x22')](_0x5699aa['stack']);if(_0x5699aa[_0x2406('0x23')]){delete _0x5699aa['name'];}_0x543831['status'](_0x1240ad)[_0x2406('0x24')](_0x5699aa);};}exports[_0x2406('0x25')]=function(_0x162c1b,_0x26a76b){var _0x10babd={},_0x39a833={},_0x2dd4e8={'count':0x0,'rows':[]};var _0x16f60a=_[_0x2406('0x26')](db['SquareRecording'][_0x2406('0x27')],function(_0x236c17){return{'name':_0x236c17['fieldName'],'type':_0x236c17['type'][_0x2406('0x28')]};});_0x39a833[_0x2406('0x29')]=_['map'](_0x16f60a,_0x2406('0x23'));_0x39a833[_0x2406('0x2a')]=_[_0x2406('0x2b')](_0x162c1b[_0x2406('0x2a')]);_0x39a833[_0x2406('0x2c')]=_[_0x2406('0x2d')](_0x39a833[_0x2406('0x29')],_0x39a833[_0x2406('0x2a')]);_0x10babd[_0x2406('0x2e')]=_[_0x2406('0x2d')](_0x39a833[_0x2406('0x29')],qs[_0x2406('0x2f')](_0x162c1b['query'][_0x2406('0x2f')]));_0x10babd[_0x2406('0x2e')]=_0x10babd[_0x2406('0x2e')]['length']?_0x10babd[_0x2406('0x2e')]:_0x39a833[_0x2406('0x29')];if(!_0x162c1b[_0x2406('0x2a')][_0x2406('0x30')](_0x2406('0x31'))){_0x10babd['limit']=qs[_0x2406('0x1a')](_0x162c1b['query'][_0x2406('0x1a')]);_0x10babd[_0x2406('0x18')]=qs['offset'](_0x162c1b[_0x2406('0x2a')][_0x2406('0x18')]);}_0x10babd[_0x2406('0x32')]=qs[_0x2406('0x33')](_0x162c1b[_0x2406('0x2a')][_0x2406('0x33')]);_0x10babd[_0x2406('0x34')]=qs['filters'](_[_0x2406('0x35')](_0x162c1b[_0x2406('0x2a')],_0x39a833[_0x2406('0x2c')]),_0x16f60a);if(_0x162c1b[_0x2406('0x2a')]['filter']){_0x10babd[_0x2406('0x34')]=_[_0x2406('0x36')](_0x10babd['where'],{'$or':_['map'](_0x16f60a,function(_0x247d8e){if(_0x247d8e[_0x2406('0x37')]!=='VIRTUAL'){var _0x443649={};_0x443649[_0x247d8e[_0x2406('0x23')]]={'$like':'%'+_0x162c1b[_0x2406('0x2a')][_0x2406('0x38')]+'%'};return _0x443649;}})});}_0x10babd=_[_0x2406('0x36')]({},_0x10babd,_0x162c1b['options']);var _0xa1b101={'where':_0x10babd[_0x2406('0x34')]};return db[_0x2406('0x39')][_0x2406('0x1b')](_0xa1b101)[_0x2406('0x20')](function(_0x13d539){_0x2dd4e8[_0x2406('0x1b')]=_0x13d539;if(_0x162c1b['query'][_0x2406('0x3a')]){_0x10babd[_0x2406('0x3b')]=[{'all':!![]}];}return db[_0x2406('0x39')][_0x2406('0x3c')](_0x10babd);})['then'](function(_0xc8d231){_0x2dd4e8[_0x2406('0x3d')]=_0xc8d231;return _0x2dd4e8;})[_0x2406('0x20')](respondWithFilteredResult(_0x26a76b,_0x10babd))[_0x2406('0x3e')](handleError(_0x26a76b,null));};exports['show']=function(_0x14ed86,_0x4e3d24){var _0x59e6a7={'raw':!![],'where':{'id':_0x14ed86['params']['id']}},_0x863edf={};_0x863edf[_0x2406('0x29')]=_[_0x2406('0x2b')](db['SquareRecording']['rawAttributes']);_0x863edf[_0x2406('0x2a')]=_[_0x2406('0x2b')](_0x14ed86['query']);_0x863edf[_0x2406('0x2c')]=_[_0x2406('0x2d')](_0x863edf[_0x2406('0x29')],_0x863edf[_0x2406('0x2a')]);_0x59e6a7[_0x2406('0x2e')]=_[_0x2406('0x2d')](_0x863edf[_0x2406('0x29')],qs[_0x2406('0x2f')](_0x14ed86[_0x2406('0x2a')][_0x2406('0x2f')]));_0x59e6a7[_0x2406('0x2e')]=_0x59e6a7[_0x2406('0x2e')][_0x2406('0x3f')]?_0x59e6a7[_0x2406('0x2e')]:_0x863edf[_0x2406('0x29')];if(_0x14ed86['query'][_0x2406('0x3a')]){_0x59e6a7[_0x2406('0x3b')]=[{'all':!![]}];}_0x59e6a7=_[_0x2406('0x36')]({},_0x59e6a7,_0x14ed86[_0x2406('0x40')]);return db['SquareRecording'][_0x2406('0x41')](_0x59e6a7)[_0x2406('0x20')](handleEntityNotFound(_0x4e3d24,null))[_0x2406('0x20')](respondWithResult(_0x4e3d24,null))[_0x2406('0x3e')](handleError(_0x4e3d24,null));};exports[_0x2406('0x42')]=function(_0xfe8456,_0x26c1c2){return db['SquareRecording']['create'](_0xfe8456[_0x2406('0x43')],{})[_0x2406('0x20')](respondWithResult(_0x26c1c2,0xc9))[_0x2406('0x3e')](handleError(_0x26c1c2,null));};exports[_0x2406('0x1f')]=function(_0x27fdaa,_0x2d059a){if(_0x27fdaa[_0x2406('0x43')]['id']){delete _0x27fdaa['body']['id'];}return db[_0x2406('0x39')][_0x2406('0x41')]({'where':{'id':_0x27fdaa[_0x2406('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d059a,null))[_0x2406('0x20')](saveUpdates(_0x27fdaa[_0x2406('0x43')],null))[_0x2406('0x20')](respondWithResult(_0x2d059a,null))[_0x2406('0x3e')](handleError(_0x2d059a,null));};exports['download']=function(_0x122787,_0x2b62da,_0x2dcc4e){var _0xb84487=require(_0x2406('0x45'));var _0x3b018f=![];var _0x21682b={};if(_0x122787[_0x2406('0x2a')][_0x2406('0x37')]&&_0x122787[_0x2406('0x2a')][_0x2406('0x37')]===_0x2406('0x46')){_0x21682b[_0x2406('0x46')]=_0x122787['params']['id'];}else{_0x21682b['id']=_0x122787[_0x2406('0x44')]['id'];}return db['SquareRecording'][_0x2406('0x41')]({'where':_0x21682b,'attributes':['id','savePath',_0x2406('0x47')],'raw':!![]})[_0x2406('0x20')](handleEntityNotFound(_0x2b62da,null))[_0x2406('0x20')](function(_0x3048f9){if(_0x3048f9){var _0x2852d3=_0x3048f9[_0x2406('0x48')];var _0x453480=util[_0x2406('0x49')](_0x2406('0x4a'),_0x2852d3);if(fs[_0x2406('0x4b')](_0x453480)){_0x3b018f=!![];return _0xb84487[_0x2406('0x4c')](_0x453480,_0x2852d3,config['secrets'][_0x2406('0x4d')])[_0x2406('0x20')](function(){return _0x3048f9;});}return _0x3048f9;}})[_0x2406('0x20')](function(_0x5cb2a5){if(_0x5cb2a5){var _0x52f2a0=_0x5cb2a5[_0x2406('0x48')];if(!fs[_0x2406('0x4b')](_0x52f2a0)){throw new db[(_0x2406('0x4e'))][(_0x2406('0x4f'))](_0x2406('0x50'));}if(_0x5cb2a5[_0x2406('0x47')]){return _0x2b62da[_0x2406('0x51')](_0x52f2a0,_0x5cb2a5[_0x2406('0x47')]+path['extname'](_0x52f2a0),function(){if(_0x3b018f){fs['unlink'](_0x52f2a0);}});}else{return _0x2b62da[_0x2406('0x51')](_0x52f2a0,function(_0xbe4caa){if(_0x3b018f){fs[_0x2406('0x52')](_0x52f2a0);}});}}})[_0x2406('0x3e')](function(_0x3883dd){if(_0x3883dd['message']===_0x2406('0x50')){_0x2b62da[_0x2406('0x16')](0x194)[_0x2406('0x24')](_0x2406('0x53'));}else{return handleError(_0x2b62da,null);}});};exports['destroy']=function(_0x2e3d62,_0x406767){return db[_0x2406('0x39')][_0x2406('0x41')]({'where':{'id':_0x2e3d62['params']['id']}})['then'](function(_0x501156){if(_['isNil'](_0x501156)){throw new ReferenceError('Entity\x20not\x20found');}return _0x501156;})[_0x2406('0x20')](function(_0x2d6bbe){var _0x36ddf9=_0x2d6bbe[_0x2406('0x48')];logger[_0x2406('0x54')](_0x2406('0x55'),_0x36ddf9);if(!_['isNil'](_0x2d6bbe[_0x2406('0x48')])&&fs[_0x2406('0x4b')](_0x36ddf9)){logger[_0x2406('0x54')](_0x2406('0x56')+_0x36ddf9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2406('0x57')](_0x36ddf9);}_0x36ddf9=_0x36ddf9+_0x2406('0x58');if(!_['isNil'](_0x2d6bbe[_0x2406('0x48')])&&fs[_0x2406('0x4b')](_0x36ddf9)){logger['info'](_0x2406('0x56')+_0x36ddf9+_0x2406('0x59'));fs[_0x2406('0x57')](_0x36ddf9);}return _0x2d6bbe;})[_0x2406('0x20')](function(_0x316a5a){if(!_0x316a5a)throw new InternalError();return _0x316a5a[_0x2406('0x21')]();})[_0x2406('0x20')](function(){_0x406767[_0x2406('0x16')](0xcc)[_0x2406('0x5a')]();})[_0x2406('0x3e')](handleError(_0x406767,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 5ce949b..abcecf3 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 _0x0a05=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','square_recordings','lodash','util'];(function(_0x1ac1f8,_0x40947a){var _0x4c9b1c=function(_0x236deb){while(--_0x236deb){_0x1ac1f8['push'](_0x1ac1f8['shift']());}};_0x4c9b1c(++_0x40947a);}(_0x0a05,0x9e));var _0x50a0=function(_0x2fbf2c,_0xb5a8f9){_0x2fbf2c=_0x2fbf2c-0x0;var _0x132005=_0x0a05[_0x2fbf2c];return _0x132005;};'use strict';var _=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var logger=require(_0x50a0('0x2'))(_0x50a0('0x3'));var moment=require(_0x50a0('0x4'));var BPromise=require(_0x50a0('0x5'));var rp=require(_0x50a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50a0('0x7'));var config=require('../../config/environment');var attributes=require(_0x50a0('0x8'));module['exports']=function(_0x3546f9,_0x41a18d){return _0x3546f9['define']('SquareRecording',attributes,{'tableName':_0x50a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22b4=['bluebird','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','lodash','util','../../config/logger','api','moment'];(function(_0x16fc9a,_0x31a47c){var _0x477d98=function(_0x58af0){while(--_0x58af0){_0x16fc9a['push'](_0x16fc9a['shift']());}};_0x477d98(++_0x31a47c);}(_0x22b4,0x8b));var _0x422b=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x22b4[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x422b('0x0'));var util=require(_0x422b('0x1'));var logger=require(_0x422b('0x2'))(_0x422b('0x3'));var moment=require(_0x422b('0x4'));var BPromise=require(_0x422b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x422b('0x6'));var rimraf=require(_0x422b('0x7'));var config=require('../../config/environment');var attributes=require(_0x422b('0x8'));module[_0x422b('0x9')]=function(_0x2cde8e,_0x1a758a){return _0x2cde8e[_0x422b('0xa')](_0x422b('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 8d464d2..2329549 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 _0xf1f2=['moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','create','body','options','lodash','util'];(function(_0x35f748,_0x2cd546){var _0x17ae2b=function(_0xec9002){while(--_0xec9002){_0x35f748['push'](_0x35f748['shift']());}};_0x17ae2b(++_0x2cd546);}(_0xf1f2,0x1c0));var _0x2f1f=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xf1f2[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0x2f1f('0x0'));var util=require(_0x2f1f('0x1'));var moment=require(_0x2f1f('0x2'));var BPromise=require(_0x2f1f('0x3'));var rs=require(_0x2f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2f1f('0x5'));var logger=require(_0x2f1f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2f1f('0x7'));var client=jayson['client'][_0x2f1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cbc0,_0x4f8db1,_0x4cd22a){return new BPromise(function(_0x529313,_0x33970c){return client[_0x2f1f('0x9')](_0x26cbc0,_0x4cd22a)[_0x2f1f('0xa')](function(_0x3bd9b4){logger[_0x2f1f('0xb')]('SquareRecording,\x20%s,\x20%s',_0x4f8db1,_0x2f1f('0xc'));logger[_0x2f1f('0xd')](_0x2f1f('0xe'),_0x4f8db1,'request\x20sent',JSON['stringify'](_0x3bd9b4));if(_0x3bd9b4[_0x2f1f('0xf')]){if(_0x3bd9b4[_0x2f1f('0xf')][_0x2f1f('0x10')]===0x1f4){logger[_0x2f1f('0xf')](_0x2f1f('0x11'),_0x4f8db1,_0x3bd9b4['error']['message']);return _0x33970c(_0x3bd9b4['error'][_0x2f1f('0x12')]);}logger[_0x2f1f('0xf')]('SquareRecording,\x20%s,\x20%s',_0x4f8db1,_0x3bd9b4[_0x2f1f('0xf')][_0x2f1f('0x12')]);return _0x529313(_0x3bd9b4[_0x2f1f('0xf')]['message']);}else{logger[_0x2f1f('0xb')](_0x2f1f('0x11'),_0x4f8db1,_0x2f1f('0xc'));_0x529313(_0x3bd9b4[_0x2f1f('0x13')]['message']);}})[_0x2f1f('0x14')](function(_0x75535f){logger[_0x2f1f('0xf')]('SquareRecording,\x20%s,\x20%s',_0x4f8db1,_0x75535f);_0x33970c(_0x75535f);});});}exports[_0x2f1f('0x15')]=function(_0xa79522){var _0x394d68=this;return new Promise(function(_0x18abdb,_0x5287d4){return db['SquareRecording'][_0x2f1f('0x16')](_0xa79522[_0x2f1f('0x17')],{'raw':_0xa79522[_0x2f1f('0x18')]?_0xa79522[_0x2f1f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x2f1f('0xa')](function(_0x175adf){logger['info'](_0x2f1f('0x15'),_0xa79522);logger['debug']('CreateSquareRecording',_0xa79522,JSON['stringify'](_0x175adf));_0x18abdb(_0x175adf);})[_0x2f1f('0x14')](function(_0x14f201){logger['error']('CreateSquareRecording',_0x14f201['message'],_0xa79522);_0x5287d4(_0x394d68[_0x2f1f('0xf')](0x1f4,_0x14f201[_0x2f1f('0x12')]));});});}; \ No newline at end of file +var _0x9920=['jayson/promise','client','http','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareRecording','SquareRecording','options','catch','util','moment','randomstring','rpc'];(function(_0x35447c,_0x45845a){var _0x19f19a=function(_0xe092cf){while(--_0xe092cf){_0x35447c['push'](_0x35447c['shift']());}};_0x19f19a(++_0x45845a);}(_0x9920,0x15c));var _0x0992=function(_0x59fbd3,_0x16f48f){_0x59fbd3=_0x59fbd3-0x0;var _0x21d92d=_0x9920[_0x59fbd3];return _0x21d92d;};'use strict';var _=require('lodash');var util=require(_0x0992('0x0'));var moment=require(_0x0992('0x1'));var BPromise=require('bluebird');var rs=require(_0x0992('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0992('0x3'));var config=require('../../config/environment');var jayson=require(_0x0992('0x4'));var client=jayson[_0x0992('0x5')][_0x0992('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x52a122,_0x167a69,_0x3d241e){return new BPromise(function(_0x4ee6d2,_0x3b63b6){return client['request'](_0x52a122,_0x3d241e)[_0x0992('0x7')](function(_0x362a48){logger['info'](_0x0992('0x8'),_0x167a69,_0x0992('0x9'));logger[_0x0992('0xa')](_0x0992('0xb'),_0x167a69,_0x0992('0x9'),JSON[_0x0992('0xc')](_0x362a48));if(_0x362a48[_0x0992('0xd')]){if(_0x362a48[_0x0992('0xd')][_0x0992('0xe')]===0x1f4){logger[_0x0992('0xd')](_0x0992('0x8'),_0x167a69,_0x362a48[_0x0992('0xd')]['message']);return _0x3b63b6(_0x362a48[_0x0992('0xd')]['message']);}logger[_0x0992('0xd')](_0x0992('0x8'),_0x167a69,_0x362a48[_0x0992('0xd')][_0x0992('0xf')]);return _0x4ee6d2(_0x362a48[_0x0992('0xd')][_0x0992('0xf')]);}else{logger[_0x0992('0x10')](_0x0992('0x8'),_0x167a69,'request\x20sent');_0x4ee6d2(_0x362a48[_0x0992('0x11')][_0x0992('0xf')]);}})['catch'](function(_0xf5947a){logger[_0x0992('0xd')](_0x0992('0x8'),_0x167a69,_0xf5947a);_0x3b63b6(_0xf5947a);});});}exports[_0x0992('0x12')]=function(_0x572d10){var _0x36d9fc=this;return new Promise(function(_0x29e101,_0xad1380){return db[_0x0992('0x13')]['create'](_0x572d10['body'],{'raw':_0x572d10['options']?_0x572d10[_0x0992('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x0992('0x7')](function(_0x53995c){logger[_0x0992('0x10')](_0x0992('0x12'),_0x572d10);logger[_0x0992('0xa')]('CreateSquareRecording',_0x572d10,JSON['stringify'](_0x53995c));_0x29e101(_0x53995c);})[_0x0992('0x15')](function(_0x1b7efd){logger[_0x0992('0xd')](_0x0992('0x12'),_0x1b7efd[_0x0992('0xf')],_0x572d10);_0xad1380(_0x36d9fc[_0x0992('0xd')](0x1f4,_0x1b7efd[_0x0992('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 7c51590..ca6b175 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x25bf38,_0x1ead97){var _0x1c7531=function(_0x27576d){while(--_0x27576d){_0x25bf38['push'](_0x25bf38['shift']());}};_0x1c7531(++_0x1ead97);}(_0xe706,0xa3));var _0x6e70=function(_0x5d8778,_0x3c2f0e){_0x5d8778=_0x5d8778-0x0;var _0x133e42=_0xe706[_0x5d8778];return _0x133e42;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9adce65..c3b2784 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 _0x781b=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x3516cf,_0x1c239d){var _0x595c3c=function(_0xb3b735){while(--_0xb3b735){_0x3516cf['push'](_0x3516cf['shift']());}};_0x595c3c(++_0x1c239d);}(_0x781b,0x1c9));var _0xb781=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x781b[_0x56ba92];return _0x8fe94d;};'use strict';var Sequelize=require(_0xb781('0x0'));module[_0xb781('0x1')]={'network':{'type':Sequelize[_0xb781('0x2')]},'network_script':{'type':Sequelize[_0xb781('0x2')]},'request':{'type':Sequelize[_0xb781('0x2')]},'channel':{'type':Sequelize[_0xb781('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb781('0x2')]},'uniqueid':{'type':Sequelize[_0xb781('0x2')]},'version':{'type':Sequelize[_0xb781('0x2')]},'callerid':{'type':Sequelize[_0xb781('0x2')]},'calleridname':{'type':Sequelize[_0xb781('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xb781('0x2')]},'callingtns':{'type':Sequelize[_0xb781('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xb781('0x2')]},'context':{'type':Sequelize[_0xb781('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb781('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xb781('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb781('0x3')]},'bot':{'type':Sequelize[_0xb781('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xec3c=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x3f01b1,_0x2ac71d){var _0x3fcd1c=function(_0x2ef79f){while(--_0x2ef79f){_0x3f01b1['push'](_0x3f01b1['shift']());}};_0x3fcd1c(++_0x2ac71d);}(_0xec3c,0x1e6));var _0xcec3=function(_0x3995ea,_0x230620){_0x3995ea=_0x3995ea-0x0;var _0x10477f=_0xec3c[_0x3995ea];return _0x10477f;};'use strict';var Sequelize=require(_0xcec3('0x0'));module[_0xcec3('0x1')]={'network':{'type':Sequelize[_0xcec3('0x2')]},'network_script':{'type':Sequelize[_0xcec3('0x2')]},'request':{'type':Sequelize[_0xcec3('0x2')]},'channel':{'type':Sequelize[_0xcec3('0x2')]},'language':{'type':Sequelize[_0xcec3('0x2')]},'type':{'type':Sequelize[_0xcec3('0x2')]},'uniqueid':{'type':Sequelize[_0xcec3('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcec3('0x2')]},'calleridname':{'type':Sequelize[_0xcec3('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xcec3('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xcec3('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xcec3('0x2')]},'priority':{'type':Sequelize[_0xcec3('0x2')]},'enhanced':{'type':Sequelize[_0xcec3('0x2')]},'accountcode':{'type':Sequelize[_0xcec3('0x2')]},'threadid':{'type':Sequelize[_0xcec3('0x2')]},'project_name':{'type':Sequelize[_0xcec3('0x2')]},'joinAt':{'type':Sequelize[_0xcec3('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xcec3('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 6750bc3..8f0304c 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 _0xe5b6=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','pick','merge','type','filter','SquareReport','includeAll','include','findAll','catch','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe5b6,0xc2));var _0x6e5b=function(_0x3e54fa,_0x3a7cf5){_0x3e54fa=_0x3e54fa-0x0;var _0x1a4c26=_0xe5b6[_0x3e54fa];return _0x1a4c26;};'use strict';var emlformat=require(_0x6e5b('0x0'));var rimraf=require(_0x6e5b('0x1'));var zipdir=require(_0x6e5b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e5b('0x3'));var moment=require(_0x6e5b('0x4'));var BPromise=require(_0x6e5b('0x5'));var Mustache=require(_0x6e5b('0x6'));var util=require(_0x6e5b('0x7'));var path=require(_0x6e5b('0x8'));var sox=require(_0x6e5b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e5b('0xa'));var _=require('lodash');var squel=require(_0x6e5b('0xb'));var crypto=require(_0x6e5b('0xc'));var jsforce=require(_0x6e5b('0xd'));var deskjs=require(_0x6e5b('0xe'));var toCsv=require(_0x6e5b('0xf'));var querystring=require(_0x6e5b('0x10'));var Papa=require(_0x6e5b('0x11'));var Redis=require(_0x6e5b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e5b('0x13'));var hardwareService=require(_0x6e5b('0x14'));var logger=require(_0x6e5b('0x15'))(_0x6e5b('0x16'));var utils=require('../../config/utils');var config=require(_0x6e5b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e5b('0x18'))['db'];function respondWithStatusCode(_0x3b0d09,_0x30de00){_0x30de00=_0x30de00||0xcc;return function(_0x450424){if(_0x450424){return _0x3b0d09[_0x6e5b('0x19')](_0x30de00);}return _0x3b0d09[_0x6e5b('0x1a')](_0x30de00)[_0x6e5b('0x1b')]();};}function respondWithResult(_0xab0ccd,_0x5f565f){_0x5f565f=_0x5f565f||0xc8;return function(_0x5c04e6){if(_0x5c04e6){return _0xab0ccd[_0x6e5b('0x1a')](_0x5f565f)[_0x6e5b('0x1c')](_0x5c04e6);}};}function respondWithFilteredResult(_0x37a105,_0x22efa2){return function(_0x3bb1e3){if(_0x3bb1e3){var _0x91341e=typeof _0x22efa2[_0x6e5b('0x1d')]===_0x6e5b('0x1e')&&typeof _0x22efa2[_0x6e5b('0x1f')]===_0x6e5b('0x1e');var _0x37cdac=_0x3bb1e3[_0x6e5b('0x20')];var _0x503092=_0x91341e?0x0:_0x22efa2[_0x6e5b('0x1d')];var _0x2b51f6=_0x91341e?_0x3bb1e3['count']:_0x22efa2[_0x6e5b('0x1d')]+_0x22efa2['limit'];var _0x3f0220;if(_0x2b51f6>=_0x37cdac){_0x2b51f6=_0x37cdac;_0x3f0220=0xc8;}else{_0x3f0220=0xce;}_0x37a105[_0x6e5b('0x1a')](_0x3f0220);return _0x37a105[_0x6e5b('0x21')](_0x6e5b('0x22'),_0x503092+'-'+_0x2b51f6+'/'+_0x37cdac)[_0x6e5b('0x1c')](_0x3bb1e3);}return null;};}function patchUpdates(_0x4ac9cb){return function(_0x50b26d){try{jsonpatch[_0x6e5b('0x23')](_0x50b26d,_0x4ac9cb,!![]);}catch(_0x52e3a6){return BPromise[_0x6e5b('0x24')](_0x52e3a6);}return _0x50b26d[_0x6e5b('0x25')]();};}function saveUpdates(_0x41beb8,_0x288ff6){return function(_0xcb05e9){if(_0xcb05e9){return _0xcb05e9[_0x6e5b('0x26')](_0x41beb8)[_0x6e5b('0x27')](function(_0x29a9e3){return _0x29a9e3;});}return null;};}function removeEntity(_0x5d8092,_0x49645c){return function(_0x5c3cd9){if(_0x5c3cd9){return _0x5c3cd9[_0x6e5b('0x28')]()['then'](function(){_0x5d8092[_0x6e5b('0x1a')](0xcc)[_0x6e5b('0x1b')]();});}};}function handleEntityNotFound(_0x2c71ca,_0x5a5cf5){return function(_0x569c4a){if(!_0x569c4a){_0x2c71ca[_0x6e5b('0x19')](0x194);}return _0x569c4a;};}function handleError(_0xe75014,_0x3b7e11){_0x3b7e11=_0x3b7e11||0x1f4;return function(_0x29157f){logger[_0x6e5b('0x29')](_0x29157f[_0x6e5b('0x2a')]);if(_0x29157f['name']){delete _0x29157f[_0x6e5b('0x2b')];}_0xe75014[_0x6e5b('0x1a')](_0x3b7e11)[_0x6e5b('0x2c')](_0x29157f);};}exports[_0x6e5b('0x2d')]=function(_0x3bd74b,_0x2a96f6){var _0x351159={},_0x2f2290={},_0x5df209={'count':0x0,'rows':[]};var _0x149b9b=_[_0x6e5b('0x2e')](db['SquareReport'][_0x6e5b('0x2f')],function(_0x2b4c40){return{'name':_0x2b4c40[_0x6e5b('0x30')],'type':_0x2b4c40['type'][_0x6e5b('0x31')]};});_0x2f2290[_0x6e5b('0x32')]=_[_0x6e5b('0x2e')](_0x149b9b,_0x6e5b('0x2b'));_0x2f2290[_0x6e5b('0x33')]=_[_0x6e5b('0x34')](_0x3bd74b[_0x6e5b('0x33')]);_0x2f2290[_0x6e5b('0x35')]=_[_0x6e5b('0x36')](_0x2f2290[_0x6e5b('0x32')],_0x2f2290[_0x6e5b('0x33')]);_0x351159['attributes']=_[_0x6e5b('0x36')](_0x2f2290[_0x6e5b('0x32')],qs[_0x6e5b('0x37')](_0x3bd74b[_0x6e5b('0x33')]['fields']));_0x351159['attributes']=_0x351159[_0x6e5b('0x38')]['length']?_0x351159[_0x6e5b('0x38')]:_0x2f2290[_0x6e5b('0x32')];if(!_0x3bd74b['query'][_0x6e5b('0x39')](_0x6e5b('0x3a'))){_0x351159[_0x6e5b('0x1f')]=qs['limit'](_0x3bd74b[_0x6e5b('0x33')][_0x6e5b('0x1f')]);_0x351159[_0x6e5b('0x1d')]=qs[_0x6e5b('0x1d')](_0x3bd74b[_0x6e5b('0x33')][_0x6e5b('0x1d')]);}_0x351159['order']=qs['sort'](_0x3bd74b[_0x6e5b('0x33')]['sort']);_0x351159[_0x6e5b('0x3b')]=qs[_0x6e5b('0x35')](_[_0x6e5b('0x3c')](_0x3bd74b[_0x6e5b('0x33')],_0x2f2290[_0x6e5b('0x35')]),_0x149b9b);if(_0x3bd74b['query']['filter']){_0x351159[_0x6e5b('0x3b')]=_[_0x6e5b('0x3d')](_0x351159[_0x6e5b('0x3b')],{'$or':_[_0x6e5b('0x2e')](_0x149b9b,function(_0x20f91e){if(_0x20f91e[_0x6e5b('0x3e')]!=='VIRTUAL'){var _0x44a2c7={};_0x44a2c7[_0x20f91e[_0x6e5b('0x2b')]]={'$like':'%'+_0x3bd74b['query'][_0x6e5b('0x3f')]+'%'};return _0x44a2c7;}})});}_0x351159=_[_0x6e5b('0x3d')]({},_0x351159,_0x3bd74b['options']);var _0x14f79c={'where':_0x351159[_0x6e5b('0x3b')]};return db[_0x6e5b('0x40')][_0x6e5b('0x20')](_0x14f79c)[_0x6e5b('0x27')](function(_0x36331c){_0x5df209[_0x6e5b('0x20')]=_0x36331c;if(_0x3bd74b[_0x6e5b('0x33')][_0x6e5b('0x41')]){_0x351159[_0x6e5b('0x42')]=[{'all':!![]}];}return db[_0x6e5b('0x40')][_0x6e5b('0x43')](_0x351159);})[_0x6e5b('0x27')](function(_0x584c6b){_0x5df209['rows']=_0x584c6b;return _0x5df209;})['then'](respondWithFilteredResult(_0x2a96f6,_0x351159))[_0x6e5b('0x44')](handleError(_0x2a96f6,null));};exports['show']=function(_0x182161,_0x73d52e){var _0x717c8b={'raw':!![],'where':{'id':_0x182161['params']['id']}},_0x4571db={};_0x4571db[_0x6e5b('0x32')]=_['keys'](db['SquareReport'][_0x6e5b('0x2f')]);_0x4571db[_0x6e5b('0x33')]=_['keys'](_0x182161[_0x6e5b('0x33')]);_0x4571db[_0x6e5b('0x35')]=_[_0x6e5b('0x36')](_0x4571db[_0x6e5b('0x32')],_0x4571db[_0x6e5b('0x33')]);_0x717c8b[_0x6e5b('0x38')]=_['intersection'](_0x4571db['model'],qs[_0x6e5b('0x37')](_0x182161[_0x6e5b('0x33')]['fields']));_0x717c8b['attributes']=_0x717c8b['attributes'][_0x6e5b('0x45')]?_0x717c8b[_0x6e5b('0x38')]:_0x4571db[_0x6e5b('0x32')];if(_0x182161[_0x6e5b('0x33')][_0x6e5b('0x41')]){_0x717c8b[_0x6e5b('0x42')]=[{'all':!![]}];}_0x717c8b=_[_0x6e5b('0x3d')]({},_0x717c8b,_0x182161['options']);return db[_0x6e5b('0x40')][_0x6e5b('0x46')](_0x717c8b)[_0x6e5b('0x27')](handleEntityNotFound(_0x73d52e,null))[_0x6e5b('0x27')](respondWithResult(_0x73d52e,null))[_0x6e5b('0x44')](handleError(_0x73d52e,null));};exports[_0x6e5b('0x47')]=function(_0x475447,_0x6c9fa9){return db[_0x6e5b('0x40')]['create'](_0x475447[_0x6e5b('0x48')],{})[_0x6e5b('0x27')](respondWithResult(_0x6c9fa9,0xc9))[_0x6e5b('0x44')](handleError(_0x6c9fa9,null));};exports[_0x6e5b('0x26')]=function(_0x55e5f0,_0x43ecb7){if(_0x55e5f0[_0x6e5b('0x48')]['id']){delete _0x55e5f0[_0x6e5b('0x48')]['id'];}return db[_0x6e5b('0x40')][_0x6e5b('0x46')]({'where':{'id':_0x55e5f0[_0x6e5b('0x49')]['id']}})['then'](handleEntityNotFound(_0x43ecb7,null))[_0x6e5b('0x27')](saveUpdates(_0x55e5f0[_0x6e5b('0x48')],null))[_0x6e5b('0x27')](respondWithResult(_0x43ecb7,null))[_0x6e5b('0x44')](handleError(_0x43ecb7,null));};exports[_0x6e5b('0x28')]=function(_0x25c071,_0x3feb86){return db[_0x6e5b('0x40')]['find']({'where':{'id':_0x25c071[_0x6e5b('0x49')]['id']}})[_0x6e5b('0x27')](handleEntityNotFound(_0x3feb86,null))[_0x6e5b('0x27')](removeEntity(_0x3feb86,null))['catch'](handleError(_0x3feb86,null));};exports[_0x6e5b('0x4a')]=function(_0x3c57b1,_0x219bd2){return db[_0x6e5b('0x40')]['describe']()['then'](respondWithResult(_0x219bd2,null))[_0x6e5b('0x44')](handleError(_0x219bd2,null));}; \ No newline at end of file +var _0xd3a2=['map','SquareReport','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','end','error','name'];(function(_0x89e536,_0x5ba5a5){var _0x41513c=function(_0x2b8d99){while(--_0x2b8d99){_0x89e536['push'](_0x89e536['shift']());}};_0x41513c(++_0x5ba5a5);}(_0xd3a2,0x66));var _0x2d3a=function(_0x1d6ef1,_0x55a673){_0x1d6ef1=_0x1d6ef1-0x0;var _0x2769b1=_0xd3a2[_0x1d6ef1];return _0x2769b1;};'use strict';var emlformat=require(_0x2d3a('0x0'));var rimraf=require(_0x2d3a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d3a('0x2'));var rp=require(_0x2d3a('0x3'));var moment=require(_0x2d3a('0x4'));var BPromise=require(_0x2d3a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2d3a('0x6'));var csv=require(_0x2d3a('0x7'));var ejs=require(_0x2d3a('0x8'));var fs=require('fs');var fs_extra=require(_0x2d3a('0x9'));var _=require(_0x2d3a('0xa'));var squel=require('squel');var crypto=require(_0x2d3a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2d3a('0xc'));var toCsv=require(_0x2d3a('0x7'));var querystring=require(_0x2d3a('0xd'));var Papa=require(_0x2d3a('0xe'));var Redis=require('ioredis');var authService=require(_0x2d3a('0xf'));var qs=require(_0x2d3a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d3a('0x11'));var logger=require(_0x2d3a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2d3a('0x13'));var licenseUtil=require(_0x2d3a('0x14'));var db=require(_0x2d3a('0x15'))['db'];function respondWithStatusCode(_0x1cc624,_0x309e4b){_0x309e4b=_0x309e4b||0xcc;return function(_0x1aa5a0){if(_0x1aa5a0){return _0x1cc624[_0x2d3a('0x16')](_0x309e4b);}return _0x1cc624[_0x2d3a('0x17')](_0x309e4b)['end']();};}function respondWithResult(_0x4b1bfb,_0x25fb24){_0x25fb24=_0x25fb24||0xc8;return function(_0x82984f){if(_0x82984f){return _0x4b1bfb['status'](_0x25fb24)[_0x2d3a('0x18')](_0x82984f);}};}function respondWithFilteredResult(_0x404755,_0x54bf13){return function(_0x38e36a){if(_0x38e36a){var _0x1c75f0=typeof _0x54bf13[_0x2d3a('0x19')]===_0x2d3a('0x1a')&&typeof _0x54bf13[_0x2d3a('0x1b')]===_0x2d3a('0x1a');var _0x21f2eb=_0x38e36a['count'];var _0x49bc98=_0x1c75f0?0x0:_0x54bf13['offset'];var _0x905974=_0x1c75f0?_0x38e36a[_0x2d3a('0x1c')]:_0x54bf13[_0x2d3a('0x19')]+_0x54bf13[_0x2d3a('0x1b')];var _0x1651d9;if(_0x905974>=_0x21f2eb){_0x905974=_0x21f2eb;_0x1651d9=0xc8;}else{_0x1651d9=0xce;}_0x404755[_0x2d3a('0x17')](_0x1651d9);return _0x404755[_0x2d3a('0x1d')](_0x2d3a('0x1e'),_0x49bc98+'-'+_0x905974+'/'+_0x21f2eb)['json'](_0x38e36a);}return null;};}function patchUpdates(_0x15e105){return function(_0x3b711c){try{jsonpatch['apply'](_0x3b711c,_0x15e105,!![]);}catch(_0x555986){return BPromise[_0x2d3a('0x1f')](_0x555986);}return _0x3b711c['save']();};}function saveUpdates(_0x18aeaa,_0x5c341c){return function(_0x32ca58){if(_0x32ca58){return _0x32ca58[_0x2d3a('0x20')](_0x18aeaa)['then'](function(_0x2d9bde){return _0x2d9bde;});}return null;};}function removeEntity(_0x165c8b,_0x434df0){return function(_0x57b624){if(_0x57b624){return _0x57b624[_0x2d3a('0x21')]()[_0x2d3a('0x22')](function(){_0x165c8b[_0x2d3a('0x17')](0xcc)[_0x2d3a('0x23')]();});}};}function handleEntityNotFound(_0x4e9bb9,_0x417a8b){return function(_0x23f4a7){if(!_0x23f4a7){_0x4e9bb9[_0x2d3a('0x16')](0x194);}return _0x23f4a7;};}function handleError(_0x5cc140,_0x1abad8){_0x1abad8=_0x1abad8||0x1f4;return function(_0x2d7e59){logger[_0x2d3a('0x24')](_0x2d7e59['stack']);if(_0x2d7e59[_0x2d3a('0x25')]){delete _0x2d7e59[_0x2d3a('0x25')];}_0x5cc140[_0x2d3a('0x17')](_0x1abad8)['send'](_0x2d7e59);};}exports['index']=function(_0x3afa9a,_0x21890f){var _0x16466c={},_0x3f0c12={},_0x15a457={'count':0x0,'rows':[]};var _0x24fce8=_[_0x2d3a('0x26')](db[_0x2d3a('0x27')][_0x2d3a('0x28')],function(_0x12d6c7){return{'name':_0x12d6c7['fieldName'],'type':_0x12d6c7[_0x2d3a('0x29')][_0x2d3a('0x2a')]};});_0x3f0c12[_0x2d3a('0x2b')]=_['map'](_0x24fce8,_0x2d3a('0x25'));_0x3f0c12['query']=_[_0x2d3a('0x2c')](_0x3afa9a[_0x2d3a('0x2d')]);_0x3f0c12[_0x2d3a('0x2e')]=_['intersection'](_0x3f0c12[_0x2d3a('0x2b')],_0x3f0c12[_0x2d3a('0x2d')]);_0x16466c[_0x2d3a('0x2f')]=_[_0x2d3a('0x30')](_0x3f0c12[_0x2d3a('0x2b')],qs[_0x2d3a('0x31')](_0x3afa9a[_0x2d3a('0x2d')]['fields']));_0x16466c[_0x2d3a('0x2f')]=_0x16466c[_0x2d3a('0x2f')][_0x2d3a('0x32')]?_0x16466c[_0x2d3a('0x2f')]:_0x3f0c12[_0x2d3a('0x2b')];if(!_0x3afa9a[_0x2d3a('0x2d')]['hasOwnProperty'](_0x2d3a('0x33'))){_0x16466c[_0x2d3a('0x1b')]=qs[_0x2d3a('0x1b')](_0x3afa9a[_0x2d3a('0x2d')]['limit']);_0x16466c[_0x2d3a('0x19')]=qs[_0x2d3a('0x19')](_0x3afa9a[_0x2d3a('0x2d')][_0x2d3a('0x19')]);}_0x16466c[_0x2d3a('0x34')]=qs[_0x2d3a('0x35')](_0x3afa9a['query'][_0x2d3a('0x35')]);_0x16466c[_0x2d3a('0x36')]=qs[_0x2d3a('0x2e')](_[_0x2d3a('0x37')](_0x3afa9a[_0x2d3a('0x2d')],_0x3f0c12['filters']),_0x24fce8);if(_0x3afa9a[_0x2d3a('0x2d')][_0x2d3a('0x38')]){_0x16466c['where']=_[_0x2d3a('0x39')](_0x16466c['where'],{'$or':_[_0x2d3a('0x26')](_0x24fce8,function(_0x43f8b3){if(_0x43f8b3[_0x2d3a('0x29')]!==_0x2d3a('0x3a')){var _0x488975={};_0x488975[_0x43f8b3[_0x2d3a('0x25')]]={'$like':'%'+_0x3afa9a[_0x2d3a('0x2d')][_0x2d3a('0x38')]+'%'};return _0x488975;}})});}_0x16466c=_['merge']({},_0x16466c,_0x3afa9a[_0x2d3a('0x3b')]);var _0x1513e4={'where':_0x16466c[_0x2d3a('0x36')]};return db[_0x2d3a('0x27')][_0x2d3a('0x1c')](_0x1513e4)[_0x2d3a('0x22')](function(_0x1560c2){_0x15a457[_0x2d3a('0x1c')]=_0x1560c2;if(_0x3afa9a[_0x2d3a('0x2d')][_0x2d3a('0x3c')]){_0x16466c[_0x2d3a('0x3d')]=[{'all':!![]}];}return db[_0x2d3a('0x27')][_0x2d3a('0x3e')](_0x16466c);})['then'](function(_0x5d1cd1){_0x15a457['rows']=_0x5d1cd1;return _0x15a457;})[_0x2d3a('0x22')](respondWithFilteredResult(_0x21890f,_0x16466c))[_0x2d3a('0x3f')](handleError(_0x21890f,null));};exports[_0x2d3a('0x40')]=function(_0x4b4b06,_0x3d29f0){var _0x5c6ac0={'raw':!![],'where':{'id':_0x4b4b06[_0x2d3a('0x41')]['id']}},_0x457be8={};_0x457be8['model']=_['keys'](db['SquareReport'][_0x2d3a('0x28')]);_0x457be8[_0x2d3a('0x2d')]=_[_0x2d3a('0x2c')](_0x4b4b06[_0x2d3a('0x2d')]);_0x457be8[_0x2d3a('0x2e')]=_['intersection'](_0x457be8[_0x2d3a('0x2b')],_0x457be8[_0x2d3a('0x2d')]);_0x5c6ac0['attributes']=_[_0x2d3a('0x30')](_0x457be8['model'],qs[_0x2d3a('0x31')](_0x4b4b06[_0x2d3a('0x2d')][_0x2d3a('0x31')]));_0x5c6ac0['attributes']=_0x5c6ac0['attributes'][_0x2d3a('0x32')]?_0x5c6ac0[_0x2d3a('0x2f')]:_0x457be8[_0x2d3a('0x2b')];if(_0x4b4b06[_0x2d3a('0x2d')][_0x2d3a('0x3c')]){_0x5c6ac0[_0x2d3a('0x3d')]=[{'all':!![]}];}_0x5c6ac0=_['merge']({},_0x5c6ac0,_0x4b4b06[_0x2d3a('0x3b')]);return db['SquareReport'][_0x2d3a('0x42')](_0x5c6ac0)[_0x2d3a('0x22')](handleEntityNotFound(_0x3d29f0,null))[_0x2d3a('0x22')](respondWithResult(_0x3d29f0,null))[_0x2d3a('0x3f')](handleError(_0x3d29f0,null));};exports['create']=function(_0x2aca52,_0x518126){return db[_0x2d3a('0x27')][_0x2d3a('0x43')](_0x2aca52[_0x2d3a('0x44')],{})['then'](respondWithResult(_0x518126,0xc9))['catch'](handleError(_0x518126,null));};exports[_0x2d3a('0x20')]=function(_0x3723c1,_0x43af83){if(_0x3723c1[_0x2d3a('0x44')]['id']){delete _0x3723c1[_0x2d3a('0x44')]['id'];}return db[_0x2d3a('0x27')][_0x2d3a('0x42')]({'where':{'id':_0x3723c1[_0x2d3a('0x41')]['id']}})[_0x2d3a('0x22')](handleEntityNotFound(_0x43af83,null))[_0x2d3a('0x22')](saveUpdates(_0x3723c1[_0x2d3a('0x44')],null))[_0x2d3a('0x22')](respondWithResult(_0x43af83,null))['catch'](handleError(_0x43af83,null));};exports['destroy']=function(_0x4277a0,_0x186bb0){return db[_0x2d3a('0x27')]['find']({'where':{'id':_0x4277a0[_0x2d3a('0x41')]['id']}})[_0x2d3a('0x22')](handleEntityNotFound(_0x186bb0,null))[_0x2d3a('0x22')](removeEntity(_0x186bb0,null))['catch'](handleError(_0x186bb0,null));};exports[_0x2d3a('0x45')]=function(_0x23fcd8,_0x516868){return db[_0x2d3a('0x27')][_0x2d3a('0x45')]()[_0x2d3a('0x22')](respondWithResult(_0x516868,null))[_0x2d3a('0x3f')](handleError(_0x516868,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 7cfd96d..968824c 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 _0x2792=['leaveAt','api','moment','request-promise','rimraf','../../config/environment','define','uid_pname','uniqueid'];(function(_0x3c3e72,_0x3e1858){var _0x48a7e5=function(_0x3d1c72){while(--_0x3d1c72){_0x3c3e72['push'](_0x3c3e72['shift']());}};_0x48a7e5(++_0x3e1858);}(_0x2792,0x184));var _0x2279=function(_0x151935,_0x58df29){_0x151935=_0x151935-0x0;var _0x3c8f56=_0x2792[_0x151935];return _0x3c8f56;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2279('0x0'));var moment=require(_0x2279('0x1'));var BPromise=require('bluebird');var rp=require(_0x2279('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2279('0x3'));var config=require(_0x2279('0x4'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x41ab4d,_0x564510){return _0x41ab4d[_0x2279('0x5')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x2279('0x6'),'fields':[_0x2279('0x7'),'project_name']},{'name':'leaveAt','fields':[_0x2279('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7519=['leaveAt','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uniqueid','project_name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7519,0x160));var _0x9751=function(_0x383125,_0x176638){_0x383125=_0x383125-0x0;var _0x37d1b6=_0x7519[_0x383125];return _0x37d1b6;};'use strict';var _=require('lodash');var util=require(_0x9751('0x0'));var logger=require(_0x9751('0x1'))('api');var moment=require(_0x9751('0x2'));var BPromise=require(_0x9751('0x3'));var rp=require(_0x9751('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9751('0x5'));var attributes=require(_0x9751('0x6'));module['exports']=function(_0x5ef94d,_0x4568){return _0x5ef94d[_0x9751('0x7')](_0x9751('0x8'),attributes,{'tableName':_0x9751('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x9751('0xa'),_0x9751('0xb')]},{'name':_0x9751('0xc'),'fields':[_0x9751('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 6c7c4ca..5d142d1 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 _0x1867=['UpdateSquareReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw'];(function(_0x349668,_0x23b58d){var _0x19782f=function(_0x184837){while(--_0x184837){_0x349668['push'](_0x349668['shift']());}};_0x19782f(++_0x23b58d);}(_0x1867,0x64));var _0x7186=function(_0x42baeb,_0x446581){_0x42baeb=_0x42baeb-0x0;var _0x32fc77=_0x1867[_0x42baeb];return _0x32fc77;};'use strict';var _=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var moment=require(_0x7186('0x2'));var BPromise=require(_0x7186('0x3'));var rs=require(_0x7186('0x4'));var fs=require('fs');var Redis=require(_0x7186('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7186('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7186('0x7')][_0x7186('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a3a4e,_0x2b963f,_0x24e26){return new BPromise(function(_0x1e83b1,_0x4eb199){return client[_0x7186('0x9')](_0x3a3a4e,_0x24e26)[_0x7186('0xa')](function(_0x2cb644){logger[_0x7186('0xb')](_0x7186('0xc'),_0x2b963f,'request\x20sent');logger[_0x7186('0xd')](_0x7186('0xe'),_0x2b963f,_0x7186('0xf'),JSON[_0x7186('0x10')](_0x2cb644));if(_0x2cb644[_0x7186('0x11')]){if(_0x2cb644[_0x7186('0x11')][_0x7186('0x12')]===0x1f4){logger[_0x7186('0x11')](_0x7186('0xc'),_0x2b963f,_0x2cb644[_0x7186('0x11')][_0x7186('0x13')]);return _0x4eb199(_0x2cb644[_0x7186('0x11')][_0x7186('0x13')]);}logger[_0x7186('0x11')](_0x7186('0xc'),_0x2b963f,_0x2cb644[_0x7186('0x11')]['message']);return _0x1e83b1(_0x2cb644['error'][_0x7186('0x13')]);}else{logger[_0x7186('0xb')]('SquareReport,\x20%s,\x20%s',_0x2b963f,_0x7186('0xf'));_0x1e83b1(_0x2cb644[_0x7186('0x14')][_0x7186('0x13')]);}})[_0x7186('0x15')](function(_0x5d9433){logger[_0x7186('0x11')](_0x7186('0xc'),_0x2b963f,_0x5d9433);_0x4eb199(_0x5d9433);});});}exports[_0x7186('0x16')]=function(_0x412c24){var _0x37a172=this;return new Promise(function(_0x51d09e,_0x574c62){return db[_0x7186('0x17')][_0x7186('0x18')](_0x412c24[_0x7186('0x19')],{'raw':_0x412c24[_0x7186('0x1a')]?_0x412c24[_0x7186('0x1a')][_0x7186('0x1b')]===undefined?!![]:![]:!![]})[_0x7186('0xa')](function(_0x3419c0){logger[_0x7186('0xb')](_0x7186('0x16'),_0x412c24);logger[_0x7186('0xd')]('CreateSquareReport',_0x412c24,JSON['stringify'](_0x3419c0));_0x51d09e(_0x3419c0);})[_0x7186('0x15')](function(_0x463a26){logger[_0x7186('0x11')](_0x7186('0x16'),_0x463a26[_0x7186('0x13')],_0x412c24);_0x574c62(_0x37a172[_0x7186('0x11')](0x1f4,_0x463a26[_0x7186('0x13')]));});});};exports[_0x7186('0x1c')]=function(_0x2990bb){var _0x1465ee=this;return new Promise(function(_0x5ea64c,_0x30cb21){return db[_0x7186('0x17')][_0x7186('0x1d')](_0x2990bb[_0x7186('0x19')],{'raw':_0x2990bb[_0x7186('0x1a')]?_0x2990bb[_0x7186('0x1a')][_0x7186('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2990bb[_0x7186('0x1a')]?_0x2990bb['options'][_0x7186('0x1e')]||null:null,'attributes':_0x2990bb[_0x7186('0x1a')]?_0x2990bb['options'][_0x7186('0x1f')]||null:null,'limit':_0x2990bb['options']?_0x2990bb[_0x7186('0x1a')]['limit']||null:null})[_0x7186('0xa')](function(_0x560b6e){logger['info']('UpdateSquareReport',_0x2990bb);logger[_0x7186('0xd')](_0x7186('0x1c'),_0x2990bb,JSON[_0x7186('0x10')](_0x560b6e));_0x5ea64c(_0x560b6e);})[_0x7186('0x15')](function(_0x4cd8b2){logger[_0x7186('0x11')]('UpdateSquareReport',_0x4cd8b2[_0x7186('0x13')],_0x2990bb);_0x30cb21(_0x1465ee[_0x7186('0x11')](0x1f4,_0x4cd8b2['message']));});});}; \ No newline at end of file +var _0xecfd=['../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xecfd,0x7f));var _0xdecf=function(_0x344972,_0x39ba31){_0x344972=_0x344972-0x0;var _0x5a6ca1=_0xecfd[_0x344972];return _0x5a6ca1;};'use strict';var _=require(_0xdecf('0x0'));var util=require('util');var moment=require(_0xdecf('0x1'));var BPromise=require(_0xdecf('0x2'));var rs=require(_0xdecf('0x3'));var fs=require('fs');var Redis=require(_0xdecf('0x4'));var db=require(_0xdecf('0x5'))['db'];var utils=require(_0xdecf('0x6'));var logger=require(_0xdecf('0x7'))(_0xdecf('0x8'));var config=require(_0xdecf('0x9'));var jayson=require(_0xdecf('0xa'));var client=jayson[_0xdecf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x295eff,_0x37eac6,_0x375b19){return new BPromise(function(_0x1a1583,_0xff1424){return client[_0xdecf('0xc')](_0x295eff,_0x375b19)[_0xdecf('0xd')](function(_0x37d75d){logger[_0xdecf('0xe')](_0xdecf('0xf'),_0x37eac6,_0xdecf('0x10'));logger[_0xdecf('0x11')](_0xdecf('0x12'),_0x37eac6,_0xdecf('0x10'),JSON[_0xdecf('0x13')](_0x37d75d));if(_0x37d75d[_0xdecf('0x14')]){if(_0x37d75d[_0xdecf('0x14')][_0xdecf('0x15')]===0x1f4){logger['error'](_0xdecf('0xf'),_0x37eac6,_0x37d75d['error'][_0xdecf('0x16')]);return _0xff1424(_0x37d75d[_0xdecf('0x14')][_0xdecf('0x16')]);}logger[_0xdecf('0x14')](_0xdecf('0xf'),_0x37eac6,_0x37d75d[_0xdecf('0x14')][_0xdecf('0x16')]);return _0x1a1583(_0x37d75d[_0xdecf('0x14')]['message']);}else{logger[_0xdecf('0xe')](_0xdecf('0xf'),_0x37eac6,_0xdecf('0x10'));_0x1a1583(_0x37d75d['result'][_0xdecf('0x16')]);}})[_0xdecf('0x17')](function(_0x1e5c1a){logger[_0xdecf('0x14')](_0xdecf('0xf'),_0x37eac6,_0x1e5c1a);_0xff1424(_0x1e5c1a);});});}exports[_0xdecf('0x18')]=function(_0x3be85b){var _0x27e8dd=this;return new Promise(function(_0x490b2d,_0x3adb4){return db['SquareReport'][_0xdecf('0x19')](_0x3be85b[_0xdecf('0x1a')],{'raw':_0x3be85b[_0xdecf('0x1b')]?_0x3be85b['options'][_0xdecf('0x1c')]===undefined?!![]:![]:!![]})[_0xdecf('0xd')](function(_0x100ee8){logger[_0xdecf('0xe')](_0xdecf('0x18'),_0x3be85b);logger['debug'](_0xdecf('0x18'),_0x3be85b,JSON[_0xdecf('0x13')](_0x100ee8));_0x490b2d(_0x100ee8);})[_0xdecf('0x17')](function(_0x603592){logger[_0xdecf('0x14')](_0xdecf('0x18'),_0x603592[_0xdecf('0x16')],_0x3be85b);_0x3adb4(_0x27e8dd[_0xdecf('0x14')](0x1f4,_0x603592[_0xdecf('0x16')]));});});};exports[_0xdecf('0x1d')]=function(_0x1d6ff7){var _0x458729=this;return new Promise(function(_0x259f9a,_0x40b8ce){return db[_0xdecf('0x1e')][_0xdecf('0x1f')](_0x1d6ff7[_0xdecf('0x1a')],{'raw':_0x1d6ff7[_0xdecf('0x1b')]?_0x1d6ff7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d6ff7[_0xdecf('0x1b')]?_0x1d6ff7[_0xdecf('0x1b')][_0xdecf('0x20')]||null:null,'attributes':_0x1d6ff7[_0xdecf('0x1b')]?_0x1d6ff7[_0xdecf('0x1b')]['attributes']||null:null,'limit':_0x1d6ff7[_0xdecf('0x1b')]?_0x1d6ff7['options'][_0xdecf('0x21')]||null:null})[_0xdecf('0xd')](function(_0xfeca18){logger[_0xdecf('0xe')](_0xdecf('0x1d'),_0x1d6ff7);logger[_0xdecf('0x11')](_0xdecf('0x1d'),_0x1d6ff7,JSON[_0xdecf('0x13')](_0xfeca18));_0x259f9a(_0xfeca18);})[_0xdecf('0x17')](function(_0x3b8676){logger[_0xdecf('0x14')]('UpdateSquareReport',_0x3b8676[_0xdecf('0x16')],_0x1d6ff7);_0x40b8ce(_0x458729['error'](0x1f4,_0x3b8676[_0xdecf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0d4ee9d..c6b211f 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 _0x0d37=['Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','describe','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x12ddd8,_0x3ab8cf){var _0x5e1c30=function(_0x1ce2af){while(--_0x1ce2af){_0x12ddd8['push'](_0x12ddd8['shift']());}};_0x5e1c30(++_0x3ab8cf);}(_0x0d37,0xdf));var _0x70d3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0d37[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x70d3('0x0'));var util=require(_0x70d3('0x1'));var path=require(_0x70d3('0x2'));var timeout=require(_0x70d3('0x3'));var express=require(_0x70d3('0x4'));var router=express[_0x70d3('0x5')]();var fs_extra=require(_0x70d3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x70d3('0x7'));var config=require(_0x70d3('0x8'));var controller=require(_0x70d3('0x9'));router['get']('/',auth[_0x70d3('0xa')](),controller['index']);router[_0x70d3('0xb')](_0x70d3('0xc'),auth[_0x70d3('0xa')](),controller[_0x70d3('0xd')]);router[_0x70d3('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x70d3('0xe')]('/',auth[_0x70d3('0xa')](),controller[_0x70d3('0xf')]);router['put'](_0x70d3('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x70d3('0x11')](_0x70d3('0x10'),auth[_0x70d3('0xa')](),controller[_0x70d3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x88d2=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','show','post','create','put'];(function(_0x1852b9,_0x2dde2f){var _0x4b6a84=function(_0x1ef71e){while(--_0x1ef71e){_0x1852b9['push'](_0x1852b9['shift']());}};_0x4b6a84(++_0x2dde2f);}(_0x88d2,0x193));var _0x288d=function(_0x44b75a,_0xd3888d){_0x44b75a=_0x44b75a-0x0;var _0x1c0928=_0x88d2[_0x44b75a];return _0x1c0928;};'use strict';var multer=require(_0x288d('0x0'));var util=require(_0x288d('0x1'));var path=require(_0x288d('0x2'));var timeout=require(_0x288d('0x3'));var express=require(_0x288d('0x4'));var router=express[_0x288d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x288d('0x6'));var interaction=require(_0x288d('0x7'));var config=require('../../config/environment');var controller=require(_0x288d('0x8'));router[_0x288d('0x9')]('/',auth[_0x288d('0xa')](),controller['index']);router[_0x288d('0x9')](_0x288d('0xb'),auth[_0x288d('0xa')](),controller[_0x288d('0xc')]);router['get']('/:id',auth[_0x288d('0xa')](),controller[_0x288d('0xd')]);router[_0x288d('0xe')]('/',auth[_0x288d('0xa')](),controller[_0x288d('0xf')]);router[_0x288d('0x10')](_0x288d('0x11'),auth['isAuthenticated'](),controller[_0x288d('0x12')]);router['delete'](_0x288d('0x11'),auth[_0x288d('0xa')](),controller[_0x288d('0x13')]);module[_0x288d('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ae49f6a..993fc6a 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 _0x896b=['TEXT','sequelize','exports','STRING'];(function(_0xb3dc6,_0x17e769){var _0x1e111f=function(_0x1f4774){while(--_0x1f4774){_0xb3dc6['push'](_0xb3dc6['shift']());}};_0x1e111f(++_0x17e769);}(_0x896b,0xad));var _0xb896=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x896b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb896('0x0'));module[_0xb896('0x1')]={'uniqueid':{'type':Sequelize[_0xb896('0x2')]},'node':{'type':Sequelize[_0xb896('0x2')]},'application':{'type':Sequelize[_0xb896('0x2')]},'data':{'type':Sequelize[_0xb896('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb896('0x2')]}}; \ No newline at end of file +var _0x9fe6=['sequelize','exports','STRING','TEXT'];(function(_0x2b0ae7,_0x2f9405){var _0x92a676=function(_0x3154b4){while(--_0x3154b4){_0x2b0ae7['push'](_0x2b0ae7['shift']());}};_0x92a676(++_0x2f9405);}(_0x9fe6,0xb4));var _0x69fe=function(_0x2d5297,_0xb5220f){_0x2d5297=_0x2d5297-0x0;var _0x4cce94=_0x9fe6[_0x2d5297];return _0x4cce94;};'use strict';var Sequelize=require(_0x69fe('0x0'));module[_0x69fe('0x1')]={'uniqueid':{'type':Sequelize[_0x69fe('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x69fe('0x2')]},'data':{'type':Sequelize[_0x69fe('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x69fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 1a921e6..2c0db56 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 _0xd920=['query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','merge','where','SquareDetailsReport','includeAll','findAll','params','rawAttributes','length','options','find','catch','create','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','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','fieldName','type','key','model'];(function(_0x1a1e23,_0x3c2f9b){var _0x39d845=function(_0x226db2){while(--_0x226db2){_0x1a1e23['push'](_0x1a1e23['shift']());}};_0x39d845(++_0x3c2f9b);}(_0xd920,0x190));var _0x0d92=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0xd920[_0x48326a];return _0x466709;};'use strict';var emlformat=require(_0x0d92('0x0'));var rimraf=require(_0x0d92('0x1'));var zipdir=require(_0x0d92('0x2'));var jsonpatch=require(_0x0d92('0x3'));var rp=require(_0x0d92('0x4'));var moment=require(_0x0d92('0x5'));var BPromise=require(_0x0d92('0x6'));var Mustache=require(_0x0d92('0x7'));var util=require(_0x0d92('0x8'));var path=require(_0x0d92('0x9'));var sox=require(_0x0d92('0xa'));var csv=require(_0x0d92('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d92('0xc'));var _=require(_0x0d92('0xd'));var squel=require(_0x0d92('0xe'));var crypto=require(_0x0d92('0xf'));var jsforce=require(_0x0d92('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0d92('0xb'));var querystring=require(_0x0d92('0x11'));var Papa=require(_0x0d92('0x12'));var Redis=require('ioredis');var authService=require(_0x0d92('0x13'));var qs=require(_0x0d92('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d92('0x15'));var logger=require(_0x0d92('0x16'))(_0x0d92('0x17'));var utils=require(_0x0d92('0x18'));var config=require(_0x0d92('0x19'));var licenseUtil=require(_0x0d92('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10f868,_0x39007a){_0x39007a=_0x39007a||0xcc;return function(_0x13aed3){if(_0x13aed3){return _0x10f868[_0x0d92('0x1b')](_0x39007a);}return _0x10f868['status'](_0x39007a)[_0x0d92('0x1c')]();};}function respondWithResult(_0x191441,_0x5e7f79){_0x5e7f79=_0x5e7f79||0xc8;return function(_0x42b52d){if(_0x42b52d){return _0x191441[_0x0d92('0x1d')](_0x5e7f79)['json'](_0x42b52d);}};}function respondWithFilteredResult(_0x317f0a,_0x4bef90){return function(_0x1c681c){if(_0x1c681c){var _0x3a5673=typeof _0x4bef90['offset']===_0x0d92('0x1e')&&typeof _0x4bef90[_0x0d92('0x1f')]===_0x0d92('0x1e');var _0x4138d1=_0x1c681c[_0x0d92('0x20')];var _0x112790=_0x3a5673?0x0:_0x4bef90[_0x0d92('0x21')];var _0x2b96cf=_0x3a5673?_0x1c681c[_0x0d92('0x20')]:_0x4bef90['offset']+_0x4bef90[_0x0d92('0x1f')];var _0x5facab;if(_0x2b96cf>=_0x4138d1){_0x2b96cf=_0x4138d1;_0x5facab=0xc8;}else{_0x5facab=0xce;}_0x317f0a[_0x0d92('0x1d')](_0x5facab);return _0x317f0a[_0x0d92('0x22')]('Content-Range',_0x112790+'-'+_0x2b96cf+'/'+_0x4138d1)['json'](_0x1c681c);}return null;};}function patchUpdates(_0x4f735a){return function(_0x2e1df9){try{jsonpatch[_0x0d92('0x23')](_0x2e1df9,_0x4f735a,!![]);}catch(_0x1a1f75){return BPromise[_0x0d92('0x24')](_0x1a1f75);}return _0x2e1df9[_0x0d92('0x25')]();};}function saveUpdates(_0xad428e,_0x4c8bed){return function(_0x893a0b){if(_0x893a0b){return _0x893a0b[_0x0d92('0x26')](_0xad428e)['then'](function(_0x2ce64f){return _0x2ce64f;});}return null;};}function removeEntity(_0x20d4ba,_0x141b93){return function(_0x28d3ee){if(_0x28d3ee){return _0x28d3ee[_0x0d92('0x27')]()[_0x0d92('0x28')](function(){_0x20d4ba[_0x0d92('0x1d')](0xcc)[_0x0d92('0x1c')]();});}};}function handleEntityNotFound(_0x5c3174,_0x2cd904){return function(_0x1f7a4d){if(!_0x1f7a4d){_0x5c3174[_0x0d92('0x1b')](0x194);}return _0x1f7a4d;};}function handleError(_0x4788b5,_0x13752d){_0x13752d=_0x13752d||0x1f4;return function(_0x13e56a){logger['error'](_0x13e56a[_0x0d92('0x29')]);if(_0x13e56a[_0x0d92('0x2a')]){delete _0x13e56a[_0x0d92('0x2a')];}_0x4788b5[_0x0d92('0x1d')](_0x13752d)[_0x0d92('0x2b')](_0x13e56a);};}exports[_0x0d92('0x2c')]=function(_0x30db2f,_0x35bd3e){var _0x5a3f7c={},_0x38ca6={},_0x1a1d52={'count':0x0,'rows':[]};var _0xec45bb=_[_0x0d92('0x2d')](db['SquareDetailsReport']['rawAttributes'],function(_0x5461fc){return{'name':_0x5461fc[_0x0d92('0x2e')],'type':_0x5461fc[_0x0d92('0x2f')][_0x0d92('0x30')]};});_0x38ca6[_0x0d92('0x31')]=_['map'](_0xec45bb,_0x0d92('0x2a'));_0x38ca6[_0x0d92('0x32')]=_[_0x0d92('0x33')](_0x30db2f[_0x0d92('0x32')]);_0x38ca6[_0x0d92('0x34')]=_['intersection'](_0x38ca6[_0x0d92('0x31')],_0x38ca6[_0x0d92('0x32')]);_0x5a3f7c[_0x0d92('0x35')]=_[_0x0d92('0x36')](_0x38ca6['model'],qs['fields'](_0x30db2f[_0x0d92('0x32')][_0x0d92('0x37')]));_0x5a3f7c[_0x0d92('0x35')]=_0x5a3f7c[_0x0d92('0x35')]['length']?_0x5a3f7c['attributes']:_0x38ca6['model'];if(!_0x30db2f['query']['hasOwnProperty'](_0x0d92('0x38'))){_0x5a3f7c[_0x0d92('0x1f')]=qs['limit'](_0x30db2f['query']['limit']);_0x5a3f7c[_0x0d92('0x21')]=qs[_0x0d92('0x21')](_0x30db2f['query'][_0x0d92('0x21')]);}_0x5a3f7c[_0x0d92('0x39')]=qs[_0x0d92('0x3a')](_0x30db2f[_0x0d92('0x32')][_0x0d92('0x3a')]);_0x5a3f7c['where']=qs[_0x0d92('0x34')](_[_0x0d92('0x3b')](_0x30db2f[_0x0d92('0x32')],_0x38ca6[_0x0d92('0x34')]),_0xec45bb);if(_0x30db2f['query'][_0x0d92('0x3c')]){_0x5a3f7c['where']=_[_0x0d92('0x3d')](_0x5a3f7c['where'],{'$or':_[_0x0d92('0x2d')](_0xec45bb,function(_0x5e3abb){if(_0x5e3abb['type']!=='VIRTUAL'){var _0x2e9b11={};_0x2e9b11[_0x5e3abb[_0x0d92('0x2a')]]={'$like':'%'+_0x30db2f[_0x0d92('0x32')]['filter']+'%'};return _0x2e9b11;}})});}_0x5a3f7c=_[_0x0d92('0x3d')]({},_0x5a3f7c,_0x30db2f['options']);var _0x2fad23={'where':_0x5a3f7c[_0x0d92('0x3e')]};return db[_0x0d92('0x3f')][_0x0d92('0x20')](_0x2fad23)[_0x0d92('0x28')](function(_0x460557){_0x1a1d52[_0x0d92('0x20')]=_0x460557;if(_0x30db2f['query'][_0x0d92('0x40')]){_0x5a3f7c['include']=[{'all':!![]}];}return db[_0x0d92('0x3f')][_0x0d92('0x41')](_0x5a3f7c);})[_0x0d92('0x28')](function(_0x3ad308){_0x1a1d52['rows']=_0x3ad308;return _0x1a1d52;})[_0x0d92('0x28')](respondWithFilteredResult(_0x35bd3e,_0x5a3f7c))['catch'](handleError(_0x35bd3e,null));};exports['show']=function(_0x3ecb12,_0xb7bc93){var _0xe5728f={'raw':!![],'where':{'id':_0x3ecb12[_0x0d92('0x42')]['id']}},_0x1edc5d={};_0x1edc5d[_0x0d92('0x31')]=_[_0x0d92('0x33')](db[_0x0d92('0x3f')][_0x0d92('0x43')]);_0x1edc5d[_0x0d92('0x32')]=_[_0x0d92('0x33')](_0x3ecb12[_0x0d92('0x32')]);_0x1edc5d[_0x0d92('0x34')]=_[_0x0d92('0x36')](_0x1edc5d[_0x0d92('0x31')],_0x1edc5d[_0x0d92('0x32')]);_0xe5728f[_0x0d92('0x35')]=_[_0x0d92('0x36')](_0x1edc5d[_0x0d92('0x31')],qs['fields'](_0x3ecb12[_0x0d92('0x32')][_0x0d92('0x37')]));_0xe5728f[_0x0d92('0x35')]=_0xe5728f['attributes'][_0x0d92('0x44')]?_0xe5728f[_0x0d92('0x35')]:_0x1edc5d[_0x0d92('0x31')];if(_0x3ecb12[_0x0d92('0x32')]['includeAll']){_0xe5728f['include']=[{'all':!![]}];}_0xe5728f=_[_0x0d92('0x3d')]({},_0xe5728f,_0x3ecb12[_0x0d92('0x45')]);return db[_0x0d92('0x3f')][_0x0d92('0x46')](_0xe5728f)['then'](handleEntityNotFound(_0xb7bc93,null))[_0x0d92('0x28')](respondWithResult(_0xb7bc93,null))[_0x0d92('0x47')](handleError(_0xb7bc93,null));};exports[_0x0d92('0x48')]=function(_0x46f9c0,_0x426918){return db[_0x0d92('0x3f')][_0x0d92('0x48')](_0x46f9c0[_0x0d92('0x49')],{})[_0x0d92('0x28')](respondWithResult(_0x426918,0xc9))[_0x0d92('0x47')](handleError(_0x426918,null));};exports[_0x0d92('0x26')]=function(_0x51b986,_0x4c4027){if(_0x51b986['body']['id']){delete _0x51b986[_0x0d92('0x49')]['id'];}return db[_0x0d92('0x3f')][_0x0d92('0x46')]({'where':{'id':_0x51b986['params']['id']}})[_0x0d92('0x28')](handleEntityNotFound(_0x4c4027,null))[_0x0d92('0x28')](saveUpdates(_0x51b986[_0x0d92('0x49')],null))[_0x0d92('0x28')](respondWithResult(_0x4c4027,null))[_0x0d92('0x47')](handleError(_0x4c4027,null));};exports[_0x0d92('0x27')]=function(_0x4096ac,_0x324bf0){return db[_0x0d92('0x3f')][_0x0d92('0x46')]({'where':{'id':_0x4096ac[_0x0d92('0x42')]['id']}})[_0x0d92('0x28')](handleEntityNotFound(_0x324bf0,null))['then'](removeEntity(_0x324bf0,null))['catch'](handleError(_0x324bf0,null));};exports['describe']=function(_0x1158db,_0x5caff0){return db[_0x0d92('0x3f')][_0x0d92('0x4a')]()[_0x0d92('0x28')](respondWithResult(_0x5caff0,null))[_0x0d92('0x47')](handleError(_0x5caff0,null));}; \ No newline at end of file +var _0x6baa=['count','limit','Content-Range','apply','reject','save','update','then','name','send','index','map','SquareDetailsReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4e163c,_0x26e42c){var _0x15f2e7=function(_0x27dc5e){while(--_0x27dc5e){_0x4e163c['push'](_0x4e163c['shift']());}};_0x15f2e7(++_0x26e42c);}(_0x6baa,0x1e2));var _0xa6ba=function(_0x215662,_0x462187){_0x215662=_0x215662-0x0;var _0x24d40b=_0x6baa[_0x215662];return _0x24d40b;};'use strict';var emlformat=require(_0xa6ba('0x0'));var rimraf=require(_0xa6ba('0x1'));var zipdir=require(_0xa6ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6ba('0x3'));var moment=require(_0xa6ba('0x4'));var BPromise=require(_0xa6ba('0x5'));var Mustache=require('mustache');var util=require(_0xa6ba('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6ba('0x7'));var fs=require('fs');var fs_extra=require(_0xa6ba('0x8'));var _=require('lodash');var squel=require(_0xa6ba('0x9'));var crypto=require(_0xa6ba('0xa'));var jsforce=require(_0xa6ba('0xb'));var deskjs=require(_0xa6ba('0xc'));var toCsv=require(_0xa6ba('0xd'));var querystring=require(_0xa6ba('0xe'));var Papa=require(_0xa6ba('0xf'));var Redis=require(_0xa6ba('0x10'));var authService=require(_0xa6ba('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6ba('0x12'));var logger=require(_0xa6ba('0x13'))(_0xa6ba('0x14'));var utils=require(_0xa6ba('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6ba('0x16'))['db'];function respondWithStatusCode(_0xdedbd7,_0x503dd1){_0x503dd1=_0x503dd1||0xcc;return function(_0x5a0659){if(_0x5a0659){return _0xdedbd7[_0xa6ba('0x17')](_0x503dd1);}return _0xdedbd7[_0xa6ba('0x18')](_0x503dd1)[_0xa6ba('0x19')]();};}function respondWithResult(_0xf26832,_0x436d47){_0x436d47=_0x436d47||0xc8;return function(_0x528a6e){if(_0x528a6e){return _0xf26832[_0xa6ba('0x18')](_0x436d47)[_0xa6ba('0x1a')](_0x528a6e);}};}function respondWithFilteredResult(_0x34f453,_0x176b77){return function(_0x2a56fd){if(_0x2a56fd){var _0x570387=typeof _0x176b77[_0xa6ba('0x1b')]===_0xa6ba('0x1c')&&typeof _0x176b77['limit']==='undefined';var _0x24c040=_0x2a56fd['count'];var _0x350064=_0x570387?0x0:_0x176b77[_0xa6ba('0x1b')];var _0x37020f=_0x570387?_0x2a56fd[_0xa6ba('0x1d')]:_0x176b77[_0xa6ba('0x1b')]+_0x176b77[_0xa6ba('0x1e')];var _0x51698e;if(_0x37020f>=_0x24c040){_0x37020f=_0x24c040;_0x51698e=0xc8;}else{_0x51698e=0xce;}_0x34f453['status'](_0x51698e);return _0x34f453['set'](_0xa6ba('0x1f'),_0x350064+'-'+_0x37020f+'/'+_0x24c040)[_0xa6ba('0x1a')](_0x2a56fd);}return null;};}function patchUpdates(_0x3c5de9){return function(_0x5f3da8){try{jsonpatch[_0xa6ba('0x20')](_0x5f3da8,_0x3c5de9,!![]);}catch(_0x2ec14b){return BPromise[_0xa6ba('0x21')](_0x2ec14b);}return _0x5f3da8[_0xa6ba('0x22')]();};}function saveUpdates(_0x13ebff,_0x4a1a30){return function(_0x30013b){if(_0x30013b){return _0x30013b[_0xa6ba('0x23')](_0x13ebff)[_0xa6ba('0x24')](function(_0x156ddd){return _0x156ddd;});}return null;};}function removeEntity(_0x38bbcd,_0x2a5aca){return function(_0x16f90d){if(_0x16f90d){return _0x16f90d['destroy']()[_0xa6ba('0x24')](function(){_0x38bbcd[_0xa6ba('0x18')](0xcc)[_0xa6ba('0x19')]();});}};}function handleEntityNotFound(_0x3edb48,_0x2dbfa2){return function(_0x492135){if(!_0x492135){_0x3edb48['sendStatus'](0x194);}return _0x492135;};}function handleError(_0x23bd03,_0x26c956){_0x26c956=_0x26c956||0x1f4;return function(_0x148fcd){logger['error'](_0x148fcd['stack']);if(_0x148fcd[_0xa6ba('0x25')]){delete _0x148fcd[_0xa6ba('0x25')];}_0x23bd03[_0xa6ba('0x18')](_0x26c956)[_0xa6ba('0x26')](_0x148fcd);};}exports[_0xa6ba('0x27')]=function(_0x162d76,_0x2098df){var _0x5bf853={},_0x1dfc99={},_0x37e22e={'count':0x0,'rows':[]};var _0x808320=_[_0xa6ba('0x28')](db[_0xa6ba('0x29')][_0xa6ba('0x2a')],function(_0x105773){return{'name':_0x105773['fieldName'],'type':_0x105773['type'][_0xa6ba('0x2b')]};});_0x1dfc99[_0xa6ba('0x2c')]=_[_0xa6ba('0x28')](_0x808320,'name');_0x1dfc99[_0xa6ba('0x2d')]=_[_0xa6ba('0x2e')](_0x162d76[_0xa6ba('0x2d')]);_0x1dfc99[_0xa6ba('0x2f')]=_[_0xa6ba('0x30')](_0x1dfc99[_0xa6ba('0x2c')],_0x1dfc99['query']);_0x5bf853[_0xa6ba('0x31')]=_['intersection'](_0x1dfc99['model'],qs[_0xa6ba('0x32')](_0x162d76['query'][_0xa6ba('0x32')]));_0x5bf853['attributes']=_0x5bf853['attributes'][_0xa6ba('0x33')]?_0x5bf853[_0xa6ba('0x31')]:_0x1dfc99[_0xa6ba('0x2c')];if(!_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x34')](_0xa6ba('0x35'))){_0x5bf853[_0xa6ba('0x1e')]=qs[_0xa6ba('0x1e')](_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x1e')]);_0x5bf853[_0xa6ba('0x1b')]=qs[_0xa6ba('0x1b')](_0x162d76['query']['offset']);}_0x5bf853[_0xa6ba('0x36')]=qs[_0xa6ba('0x37')](_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x37')]);_0x5bf853[_0xa6ba('0x38')]=qs[_0xa6ba('0x2f')](_[_0xa6ba('0x39')](_0x162d76[_0xa6ba('0x2d')],_0x1dfc99[_0xa6ba('0x2f')]),_0x808320);if(_0x162d76['query'][_0xa6ba('0x3a')]){_0x5bf853[_0xa6ba('0x38')]=_[_0xa6ba('0x3b')](_0x5bf853[_0xa6ba('0x38')],{'$or':_['map'](_0x808320,function(_0x212654){if(_0x212654[_0xa6ba('0x3c')]!==_0xa6ba('0x3d')){var _0x43b1dc={};_0x43b1dc[_0x212654[_0xa6ba('0x25')]]={'$like':'%'+_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x3a')]+'%'};return _0x43b1dc;}})});}_0x5bf853=_[_0xa6ba('0x3b')]({},_0x5bf853,_0x162d76['options']);var _0x2d11d7={'where':_0x5bf853['where']};return db[_0xa6ba('0x29')][_0xa6ba('0x1d')](_0x2d11d7)[_0xa6ba('0x24')](function(_0x24f95a){_0x37e22e['count']=_0x24f95a;if(_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x3e')]){_0x5bf853[_0xa6ba('0x3f')]=[{'all':!![]}];}return db[_0xa6ba('0x29')][_0xa6ba('0x40')](_0x5bf853);})[_0xa6ba('0x24')](function(_0x30cbf1){_0x37e22e[_0xa6ba('0x41')]=_0x30cbf1;return _0x37e22e;})['then'](respondWithFilteredResult(_0x2098df,_0x5bf853))['catch'](handleError(_0x2098df,null));};exports[_0xa6ba('0x42')]=function(_0x1b21c2,_0x4a8734){var _0x1dc3ae={'raw':!![],'where':{'id':_0x1b21c2['params']['id']}},_0x410b9f={};_0x410b9f[_0xa6ba('0x2c')]=_[_0xa6ba('0x2e')](db[_0xa6ba('0x29')][_0xa6ba('0x2a')]);_0x410b9f[_0xa6ba('0x2d')]=_[_0xa6ba('0x2e')](_0x1b21c2['query']);_0x410b9f['filters']=_[_0xa6ba('0x30')](_0x410b9f[_0xa6ba('0x2c')],_0x410b9f['query']);_0x1dc3ae[_0xa6ba('0x31')]=_[_0xa6ba('0x30')](_0x410b9f[_0xa6ba('0x2c')],qs['fields'](_0x1b21c2[_0xa6ba('0x2d')][_0xa6ba('0x32')]));_0x1dc3ae[_0xa6ba('0x31')]=_0x1dc3ae[_0xa6ba('0x31')]['length']?_0x1dc3ae[_0xa6ba('0x31')]:_0x410b9f[_0xa6ba('0x2c')];if(_0x1b21c2[_0xa6ba('0x2d')][_0xa6ba('0x3e')]){_0x1dc3ae['include']=[{'all':!![]}];}_0x1dc3ae=_[_0xa6ba('0x3b')]({},_0x1dc3ae,_0x1b21c2[_0xa6ba('0x43')]);return db[_0xa6ba('0x29')][_0xa6ba('0x44')](_0x1dc3ae)['then'](handleEntityNotFound(_0x4a8734,null))['then'](respondWithResult(_0x4a8734,null))['catch'](handleError(_0x4a8734,null));};exports[_0xa6ba('0x45')]=function(_0x921dfa,_0xe8642d){return db[_0xa6ba('0x29')][_0xa6ba('0x45')](_0x921dfa[_0xa6ba('0x46')],{})[_0xa6ba('0x24')](respondWithResult(_0xe8642d,0xc9))[_0xa6ba('0x47')](handleError(_0xe8642d,null));};exports[_0xa6ba('0x23')]=function(_0x34aefc,_0x398f82){if(_0x34aefc[_0xa6ba('0x46')]['id']){delete _0x34aefc[_0xa6ba('0x46')]['id'];}return db[_0xa6ba('0x29')][_0xa6ba('0x44')]({'where':{'id':_0x34aefc[_0xa6ba('0x48')]['id']}})[_0xa6ba('0x24')](handleEntityNotFound(_0x398f82,null))[_0xa6ba('0x24')](saveUpdates(_0x34aefc[_0xa6ba('0x46')],null))['then'](respondWithResult(_0x398f82,null))[_0xa6ba('0x47')](handleError(_0x398f82,null));};exports['destroy']=function(_0x4d9d8e,_0x1d7129){return db['SquareDetailsReport'][_0xa6ba('0x44')]({'where':{'id':_0x4d9d8e['params']['id']}})[_0xa6ba('0x24')](handleEntityNotFound(_0x1d7129,null))[_0xa6ba('0x24')](removeEntity(_0x1d7129,null))['catch'](handleError(_0x1d7129,null));};exports['describe']=function(_0x368a0a,_0xec41dd){return db['SquareDetailsReport']['describe']()[_0xa6ba('0x24')](respondWithResult(_0xec41dd,null))['catch'](handleError(_0xec41dd,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b62a7e6..e8ac03b 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 _0x1fa1=['SquareDetailsReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x28f037,_0x5097f1){var _0x5897cd=function(_0x2d3647){while(--_0x2d3647){_0x28f037['push'](_0x28f037['shift']());}};_0x5897cd(++_0x5097f1);}(_0x1fa1,0x12a));var _0x11fa=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x1fa1[_0x59bcb1];return _0x4a737f;};'use strict';var _=require(_0x11fa('0x0'));var util=require('util');var logger=require(_0x11fa('0x1'))(_0x11fa('0x2'));var moment=require(_0x11fa('0x3'));var BPromise=require(_0x11fa('0x4'));var rp=require(_0x11fa('0x5'));var fs=require('fs');var path=require(_0x11fa('0x6'));var rimraf=require(_0x11fa('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x11fa('0x8')]=function(_0x1b5c6f,_0x1a6562){return _0x1b5c6f[_0x11fa('0x9')](_0x11fa('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98c5=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird'];(function(_0x579520,_0x180667){var _0x2d71a4=function(_0x13729f){while(--_0x13729f){_0x579520['push'](_0x579520['shift']());}};_0x2d71a4(++_0x180667);}(_0x98c5,0xe5));var _0x598c=function(_0x4c8feb,_0x43f151){_0x4c8feb=_0x4c8feb-0x0;var _0x257757=_0x98c5[_0x4c8feb];return _0x257757;};'use strict';var _=require(_0x598c('0x0'));var util=require('util');var logger=require(_0x598c('0x1'))(_0x598c('0x2'));var moment=require(_0x598c('0x3'));var BPromise=require(_0x598c('0x4'));var rp=require(_0x598c('0x5'));var fs=require('fs');var path=require(_0x598c('0x6'));var rimraf=require(_0x598c('0x7'));var config=require(_0x598c('0x8'));var attributes=require(_0x598c('0x9'));module['exports']=function(_0x2f3100,_0x214257){return _0x2f3100[_0x598c('0xa')](_0x598c('0xb'),attributes,{'tableName':_0x598c('0xc'),'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 7a6d846..8486833 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 _0x9861=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','bluebird','randomstring','ioredis'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x9861,0x176));var _0x1986=function(_0x7b48f1,_0x55b015){_0x7b48f1=_0x7b48f1-0x0;var _0xe64efd=_0x9861[_0x7b48f1];return _0xe64efd;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1986('0x1'));var rs=require(_0x1986('0x2'));var fs=require('fs');var Redis=require(_0x1986('0x3'));var db=require(_0x1986('0x4'))['db'];var utils=require(_0x1986('0x5'));var logger=require(_0x1986('0x6'))('rpc');var config=require(_0x1986('0x7'));var jayson=require(_0x1986('0x8'));var client=jayson[_0x1986('0x9')][_0x1986('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40a16f,_0xc5e066,_0x412444){return new BPromise(function(_0x4150da,_0x2bd40f){return client[_0x1986('0xb')](_0x40a16f,_0x412444)['then'](function(_0x14f7b4){logger[_0x1986('0xc')](_0x1986('0xd'),_0xc5e066,_0x1986('0xe'));logger['debug'](_0x1986('0xf'),_0xc5e066,_0x1986('0xe'),JSON['stringify'](_0x14f7b4));if(_0x14f7b4[_0x1986('0x10')]){if(_0x14f7b4['error']['code']===0x1f4){logger[_0x1986('0x10')](_0x1986('0xd'),_0xc5e066,_0x14f7b4[_0x1986('0x10')][_0x1986('0x11')]);return _0x2bd40f(_0x14f7b4[_0x1986('0x10')][_0x1986('0x11')]);}logger[_0x1986('0x10')](_0x1986('0xd'),_0xc5e066,_0x14f7b4[_0x1986('0x10')][_0x1986('0x11')]);return _0x4150da(_0x14f7b4['error']['message']);}else{logger[_0x1986('0xc')](_0x1986('0xd'),_0xc5e066,'request\x20sent');_0x4150da(_0x14f7b4[_0x1986('0x12')][_0x1986('0x11')]);}})[_0x1986('0x13')](function(_0x462f14){logger[_0x1986('0x10')](_0x1986('0xd'),_0xc5e066,_0x462f14);_0x2bd40f(_0x462f14);});});}exports[_0x1986('0x14')]=function(_0x15f7b9){var _0x3b2715=this;return new Promise(function(_0x7dec68,_0x257ab1){return db[_0x1986('0x15')][_0x1986('0x16')](_0x15f7b9[_0x1986('0x17')],{'raw':_0x15f7b9['options']?_0x15f7b9[_0x1986('0x18')][_0x1986('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ab28e){logger[_0x1986('0xc')]('CreateSquareDetailsReport',_0x15f7b9);logger['debug'](_0x1986('0x14'),_0x15f7b9,JSON[_0x1986('0x1a')](_0x3ab28e));_0x7dec68(_0x3ab28e);})[_0x1986('0x13')](function(_0x530aa1){logger[_0x1986('0x10')](_0x1986('0x14'),_0x530aa1[_0x1986('0x11')],_0x15f7b9);_0x257ab1(_0x3b2715['error'](0x1f4,_0x530aa1[_0x1986('0x11')]));});});}; \ No newline at end of file +var _0x8d05=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch'];(function(_0x38a39b,_0x42847b){var _0x4e15f8=function(_0x569e17){while(--_0x569e17){_0x38a39b['push'](_0x38a39b['shift']());}};_0x4e15f8(++_0x42847b);}(_0x8d05,0xe8));var _0x58d0=function(_0x16bad2,_0x198185){_0x16bad2=_0x16bad2-0x0;var _0x240717=_0x8d05[_0x16bad2];return _0x240717;};'use strict';var _=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var moment=require(_0x58d0('0x2'));var BPromise=require(_0x58d0('0x3'));var rs=require(_0x58d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58d0('0x5'));var logger=require(_0x58d0('0x6'))(_0x58d0('0x7'));var config=require(_0x58d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x58d0('0x9')][_0x58d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528303,_0x66aef1,_0x4e44e2){return new BPromise(function(_0xe744f4,_0x34ab60){return client[_0x58d0('0xb')](_0x528303,_0x4e44e2)[_0x58d0('0xc')](function(_0x1d070a){logger['info'](_0x58d0('0xd'),_0x66aef1,_0x58d0('0xe'));logger['debug'](_0x58d0('0xf'),_0x66aef1,_0x58d0('0xe'),JSON['stringify'](_0x1d070a));if(_0x1d070a['error']){if(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x11')]===0x1f4){logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);return _0x34ab60(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);}logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);return _0xe744f4(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);}else{logger[_0x58d0('0x13')](_0x58d0('0xd'),_0x66aef1,_0x58d0('0xe'));_0xe744f4(_0x1d070a[_0x58d0('0x14')][_0x58d0('0x12')]);}})['catch'](function(_0x10874e){logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x10874e);_0x34ab60(_0x10874e);});});}exports[_0x58d0('0x15')]=function(_0xb8dd5f){var _0x2c7db6=this;return new Promise(function(_0x23dcfb,_0x41d221){return db[_0x58d0('0x16')][_0x58d0('0x17')](_0xb8dd5f[_0x58d0('0x18')],{'raw':_0xb8dd5f[_0x58d0('0x19')]?_0xb8dd5f[_0x58d0('0x19')][_0x58d0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3072f9){logger[_0x58d0('0x13')](_0x58d0('0x15'),_0xb8dd5f);logger['debug'](_0x58d0('0x15'),_0xb8dd5f,JSON[_0x58d0('0x1b')](_0x3072f9));_0x23dcfb(_0x3072f9);})[_0x58d0('0x1c')](function(_0x575b34){logger[_0x58d0('0x10')]('CreateSquareDetailsReport',_0x575b34['message'],_0xb8dd5f);_0x41d221(_0x2c7db6[_0x58d0('0x10')](0x1f4,_0x575b34[_0x58d0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 15e90ff..d6234d4 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 _0x47f9=['isAuthenticated','index','get','./system.controller'];(function(_0x4b509d,_0x33c462){var _0x448b13=function(_0x35dc40){while(--_0x35dc40){_0x4b509d['push'](_0x4b509d['shift']());}};_0x448b13(++_0x33c462);}(_0x47f9,0x8b));var _0x947f=function(_0x303310,_0x3d6211){_0x303310=_0x303310-0x0;var _0x1e4370=_0x47f9[_0x303310];return _0x1e4370;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x947f('0x0'));router['get']('/',auth[_0x947f('0x1')](),controller[_0x947f('0x2')]);router[_0x947f('0x3')]('/process/:pid/kill',auth[_0x947f('0x1')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0x35d2=['exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill'];(function(_0x30eb5,_0x59349f){var _0x5d9c48=function(_0x544f45){while(--_0x544f45){_0x30eb5['push'](_0x30eb5['shift']());}};_0x5d9c48(++_0x59349f);}(_0x35d2,0x161));var _0x235d=function(_0x204193,_0x5b075e){_0x204193=_0x204193-0x0;var _0x3bae7e=_0x35d2[_0x204193];return _0x3bae7e;};'use strict';var express=require(_0x235d('0x0'));var router=express[_0x235d('0x1')]();var auth=require(_0x235d('0x2'));var controller=require(_0x235d('0x3'));router[_0x235d('0x4')]('/',auth[_0x235d('0x5')](),controller['index']);router['get'](_0x235d('0x6'),auth[_0x235d('0x5')](),controller['killProcess']);module[_0x235d('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 57511c1..d8df1b4 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 _0xf7f7=['../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7f7,0xf0));var _0x7f7f=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xf7f7[_0x4aac5a];return _0x42e7bc;};'use strict';var info=require(_0x7f7f('0x0'));var exec=require(_0x7f7f('0x1'))[_0x7f7f('0x2')];var logger=require(_0x7f7f('0x3'))(_0x7f7f('0x4'));var util=require(_0x7f7f('0x5'));var BPromise=require(_0x7f7f('0x6'));var _=require(_0x7f7f('0x7'));function handleError(_0x5ead66,_0x2d9710,_0x141c08){_0x2d9710=_0x2d9710||0x1f4;return function(_0x4c5bc7){logger[_0x7f7f('0x8')](_0x7f7f('0x9'),_0x141c08,_0x2d9710,util[_0x7f7f('0xa')](_0x4c5bc7,{'showHidden':![],'depth':null}));delete _0x4c5bc7[_0x7f7f('0xb')];_0x5ead66[_0x7f7f('0xc')](_0x2d9710)[_0x7f7f('0xd')](_0x4c5bc7);};}exports[_0x7f7f('0xe')]=function(_0x5db245,_0x34c86f){return info[_0x7f7f('0xf')]()[_0x7f7f('0x10')](function(_0x3a4c1a){return _0x34c86f['status'](0xc8)[_0x7f7f('0x11')](_0x3a4c1a);})[_0x7f7f('0x12')](function(_0x53d121){return _0x34c86f[_0x7f7f('0xc')](0x1f4)[_0x7f7f('0x11')](_0x53d121);});};exports[_0x7f7f('0x13')]=function(_0x4b1c4b,_0x4b8a00){var _0x2b180a=[_0x7f7f('0x14')];return new BPromise(function(_0x4b2439,_0x33e664){return exec(util[_0x7f7f('0x15')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x4b1c4b[_0x7f7f('0x16')][_0x7f7f('0x17')]),function(_0x25596d,_0x39b7a6,_0x247dbe){if(_0x25596d){return _0x33e664(_0x25596d);}return _0x4b2439(_0x39b7a6);});})['then'](function(_0x3adeae){var _0x58270c=![];var _0x490974=_0x3adeae['split'](/\n/);for(var _0x283d81=0x0,_0x56e79f=_0x2b180a['length'];_0x283d81<_0x56e79f,_0x58270c===![];_0x283d81+=0x1){if(_0x3adeae['indexOf'](_0x2b180a[_0x283d81])>=0x0){_0x58270c=!![];}}if(!_0x58270c){throw new Error(util[_0x7f7f('0x15')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4b1c4b['params']['pid']));}process[_0x7f7f('0x18')](_0x4b1c4b[_0x7f7f('0x16')][_0x7f7f('0x17')],_0x7f7f('0x19'));return _0x4b8a00['status'](0xc8)[_0x7f7f('0x11')]({'message':util[_0x7f7f('0x15')](_0x7f7f('0x1a'),_0x4b1c4b[_0x7f7f('0x16')][_0x7f7f('0x17')])});})[_0x7f7f('0x12')](handleError(_0x4b8a00,null,_0x7f7f('0x13')));}; \ No newline at end of file +var _0x4351=['components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','params','killProcess','systeminformation','child_process','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','json','catch'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0x4351,0x15e));var _0x1435=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4351[_0x21549c];return _0x426cbd;};'use strict';var info=require(_0x1435('0x0'));var exec=require(_0x1435('0x1'))['exec'];var logger=require(_0x1435('0x2'))(_0x1435('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x1435('0x4'));function handleError(_0x37509b,_0xf89d,_0x221cda){_0xf89d=_0xf89d||0x1f4;return function(_0x143dda){logger[_0x1435('0x5')](_0x1435('0x6'),_0x221cda,_0xf89d,util[_0x1435('0x7')](_0x143dda,{'showHidden':![],'depth':null}));delete _0x143dda[_0x1435('0x8')];_0x37509b[_0x1435('0x9')](_0xf89d)['send'](_0x143dda);};}exports[_0x1435('0xa')]=function(_0x2a09e7,_0x1b2c5a){return info[_0x1435('0xb')]()['then'](function(_0x184f32){return _0x1b2c5a[_0x1435('0x9')](0xc8)[_0x1435('0xc')](_0x184f32);})[_0x1435('0xd')](function(_0x3bf3c6){return _0x1b2c5a[_0x1435('0x9')](0x1f4)[_0x1435('0xc')](_0x3bf3c6);});};exports['killProcess']=function(_0x4b0a26,_0x51294d){var _0x4e4125=[_0x1435('0xe')];return new BPromise(function(_0x34da3b,_0x48ab52){return exec(util[_0x1435('0xf')](_0x1435('0x10'),_0x4b0a26['params'][_0x1435('0x11')]),function(_0x17bee9,_0x3855e7,_0x89e482){if(_0x17bee9){return _0x48ab52(_0x17bee9);}return _0x34da3b(_0x3855e7);});})['then'](function(_0x2ab3c4){var _0x22f3ad=![];var _0x89009=_0x2ab3c4[_0x1435('0x12')](/\n/);for(var _0x3c85b0=0x0,_0x436702=_0x4e4125[_0x1435('0x13')];_0x3c85b0<_0x436702,_0x22f3ad===![];_0x3c85b0+=0x1){if(_0x2ab3c4[_0x1435('0x14')](_0x4e4125[_0x3c85b0])>=0x0){_0x22f3ad=!![];}}if(!_0x22f3ad){throw new Error(util[_0x1435('0xf')](_0x1435('0x15'),_0x4b0a26['params'][_0x1435('0x11')]));}process['kill'](_0x4b0a26['params'][_0x1435('0x11')],_0x1435('0x16'));return _0x51294d[_0x1435('0x9')](0xc8)[_0x1435('0xc')]({'message':util['format'](_0x1435('0x17'),_0x4b0a26[_0x1435('0x18')][_0x1435('0x11')])});})['catch'](handleError(_0x51294d,null,_0x1435('0x19')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d36c4c7..af3ebc3 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 _0x41a6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0x41a6,0x1c8));var _0x641a=function(_0x5e66a3,_0x473531){_0x5e66a3=_0x5e66a3-0x0;var _0x13d7e6=_0x41a6[_0x5e66a3];return _0x13d7e6;};'use strict';var multer=require(_0x641a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x641a('0x1'));var express=require('express');var router=express[_0x641a('0x2')]();var fs_extra=require(_0x641a('0x3'));var auth=require(_0x641a('0x4'));var interaction=require(_0x641a('0x5'));var config=require(_0x641a('0x6'));var controller=require('./tag.controller');router[_0x641a('0x7')]('/',auth[_0x641a('0x8')](),controller[_0x641a('0x9')]);router[_0x641a('0x7')](_0x641a('0xa'),auth[_0x641a('0x8')](),controller['show']);router[_0x641a('0xb')]('/',auth['isAuthenticated'](),controller[_0x641a('0xc')]);router[_0x641a('0xd')](_0x641a('0xa'),auth[_0x641a('0x8')](),controller[_0x641a('0xe')]);router[_0x641a('0xf')](_0x641a('0xa'),auth[_0x641a('0x8')](),controller['destroy']);module[_0x641a('0x10')]=router; \ No newline at end of file +var _0xbcff=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x2c5282,_0xd3c53a){var _0x4fc235=function(_0x3b0724){while(--_0x3b0724){_0x2c5282['push'](_0x2c5282['shift']());}};_0x4fc235(++_0xd3c53a);}(_0xbcff,0x108));var _0xfbcf=function(_0x200fad,_0x21454e){_0x200fad=_0x200fad-0x0;var _0x4a10fe=_0xbcff[_0x200fad];return _0x4a10fe;};'use strict';var multer=require(_0xfbcf('0x0'));var util=require('util');var path=require(_0xfbcf('0x1'));var timeout=require(_0xfbcf('0x2'));var express=require(_0xfbcf('0x3'));var router=express[_0xfbcf('0x4')]();var fs_extra=require(_0xfbcf('0x5'));var auth=require(_0xfbcf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfbcf('0x7'));var controller=require(_0xfbcf('0x8'));router[_0xfbcf('0x9')]('/',auth[_0xfbcf('0xa')](),controller[_0xfbcf('0xb')]);router['get'](_0xfbcf('0xc'),auth[_0xfbcf('0xa')](),controller[_0xfbcf('0xd')]);router[_0xfbcf('0xe')]('/',auth['isAuthenticated'](),controller[_0xfbcf('0xf')]);router[_0xfbcf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfbcf('0x11')]);router[_0xfbcf('0x12')](_0xfbcf('0xc'),auth[_0xfbcf('0xa')](),controller[_0xfbcf('0x13')]);module[_0xfbcf('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index afc5b1a..f8c2b9d 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 _0x80cd=['name','#0091EA','exports','STRING'];(function(_0x541cbd,_0x3d7ad6){var _0x434812=function(_0xb8b32b){while(--_0xb8b32b){_0x541cbd['push'](_0x541cbd['shift']());}};_0x434812(++_0x3d7ad6);}(_0x80cd,0x146));var _0xd80c=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0x80cd[_0xd93b26];return _0x25f668;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'name':{'type':Sequelize[_0xd80c('0x1')],'unique':_0xd80c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd80c('0x1')],'defaultValue':_0xd80c('0x3')},'description':{'type':Sequelize[_0xd80c('0x1')]}}; \ No newline at end of file +var _0x3f8c=['name','#0091EA','STRING'];(function(_0x189ed5,_0xae2ff7){var _0x2b7f44=function(_0x103b58){while(--_0x103b58){_0x189ed5['push'](_0x189ed5['shift']());}};_0x2b7f44(++_0xae2ff7);}(_0x3f8c,0x104));var _0xc3f8=function(_0x55694d,_0x18073a){_0x55694d=_0x55694d-0x0;var _0x50ca26=_0x3f8c[_0x55694d];return _0x50ca26;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc3f8('0x0')],'unique':_0xc3f8('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc3f8('0x0')],'defaultValue':_0xc3f8('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d3e2d50..a97e15c 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(_0x159263,_0xa791b3){var _0x1188bc=function(_0x44761f){while(--_0x44761f){_0x159263['push'](_0x159263['shift']());}};_0x1188bc(++_0xa791b3);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1f2dd1,_0xc06e17){_0x1f2dd1=_0x1f2dd1-0x0;var _0xb71659=_0x4fdb[_0x1f2dd1];return _0xb71659;};'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 _0x1b73=['map','Tag','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index'];(function(_0xc6272f,_0x5e0597){var _0x4e1d57=function(_0xb33511){while(--_0xb33511){_0xc6272f['push'](_0xc6272f['shift']());}};_0x4e1d57(++_0x5e0597);}(_0x1b73,0x1d5));var _0x31b7=function(_0x269539,_0x50faab){_0x269539=_0x269539-0x0;var _0x558c07=_0x1b73[_0x269539];return _0x558c07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){var _0x35a51f=_0x3b0eff[_0x31b7('0x28')]({'plain':!![]});var _0x2c993b='Tags';return db[_0x31b7('0x29')]['destroy']({'where':{'type':_0x2c993b,'resourceId':_0x35a51f['id']}})[_0x31b7('0x27')](function(){return _0x3b0eff;});})[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0xffacb,_0x128865){return function(_0x21ab03){if(!_0x21ab03){_0xffacb[_0x31b7('0x1a')](0x194);}return _0x21ab03;};}function handleError(_0x4e58e5,_0x47ef33){_0x47ef33=_0x47ef33||0x1f4;return function(_0x503549){logger[_0x31b7('0x2a')](_0x503549[_0x31b7('0x2b')]);if(_0x503549[_0x31b7('0x2c')]){delete _0x503549['name'];}_0x4e58e5[_0x31b7('0x1b')](_0x47ef33)[_0x31b7('0x2d')](_0x503549);};}exports[_0x31b7('0x2e')]=function(_0x277273,_0x58a87e){var _0x5b0ed2={},_0x34c62a={},_0x4b5cf9={'count':0x0,'rows':[]};var _0x574dfe=_[_0x31b7('0x2f')](db[_0x31b7('0x30')][_0x31b7('0x31')],function(_0x35f83c){return{'name':_0x35f83c['fieldName'],'type':_0x35f83c['type'][_0x31b7('0x32')]};});_0x34c62a[_0x31b7('0x33')]=_[_0x31b7('0x2f')](_0x574dfe,_0x31b7('0x2c'));_0x34c62a[_0x31b7('0x34')]=_['keys'](_0x277273['query']);_0x34c62a[_0x31b7('0x35')]=_[_0x31b7('0x36')](_0x34c62a['model'],_0x34c62a[_0x31b7('0x34')]);_0x5b0ed2[_0x31b7('0x37')]=_['intersection'](_0x34c62a[_0x31b7('0x33')],qs[_0x31b7('0x38')](_0x277273[_0x31b7('0x34')][_0x31b7('0x38')]));_0x5b0ed2[_0x31b7('0x37')]=_0x5b0ed2[_0x31b7('0x37')][_0x31b7('0x39')]?_0x5b0ed2[_0x31b7('0x37')]:_0x34c62a[_0x31b7('0x33')];if(!_0x277273[_0x31b7('0x34')][_0x31b7('0x3a')](_0x31b7('0x3b'))){_0x5b0ed2[_0x31b7('0x1e')]=qs['limit'](_0x277273['query'][_0x31b7('0x1e')]);_0x5b0ed2[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x277273[_0x31b7('0x34')][_0x31b7('0x20')]);}_0x5b0ed2[_0x31b7('0x3c')]=qs[_0x31b7('0x3d')](_0x277273[_0x31b7('0x34')][_0x31b7('0x3d')]);_0x5b0ed2[_0x31b7('0x3e')]=qs['filters'](_[_0x31b7('0x3f')](_0x277273[_0x31b7('0x34')],_0x34c62a[_0x31b7('0x35')]),_0x574dfe);if(_0x277273[_0x31b7('0x34')]['filter']){_0x5b0ed2[_0x31b7('0x3e')]=_[_0x31b7('0x40')](_0x5b0ed2['where'],{'$or':_[_0x31b7('0x2f')](_0x574dfe,function(_0x5724fa){if(_0x5724fa['type']!==_0x31b7('0x41')){var _0x10e82c={};_0x10e82c[_0x5724fa[_0x31b7('0x2c')]]={'$like':'%'+_0x277273[_0x31b7('0x34')][_0x31b7('0x42')]+'%'};return _0x10e82c;}})});}_0x5b0ed2=_['merge']({},_0x5b0ed2,_0x277273[_0x31b7('0x43')]);var _0x5d01ee={'where':_0x5b0ed2['where']};return db['Tag'][_0x31b7('0x1f')](_0x5d01ee)[_0x31b7('0x27')](function(_0x1527b3){_0x4b5cf9[_0x31b7('0x1f')]=_0x1527b3;if(_0x277273[_0x31b7('0x34')]['includeAll']){_0x5b0ed2[_0x31b7('0x44')]=[{'all':!![]}];}return db['Tag'][_0x31b7('0x45')](_0x5b0ed2);})[_0x31b7('0x27')](function(_0x41c92e){_0x4b5cf9[_0x31b7('0x46')]=_0x41c92e;return _0x4b5cf9;})['then'](respondWithFilteredResult(_0x58a87e,_0x5b0ed2))[_0x31b7('0x47')](handleError(_0x58a87e,null));};exports[_0x31b7('0x48')]=function(_0x1046fb,_0x4b3d24){var _0x31fd89={'raw':!![],'where':{'id':_0x1046fb[_0x31b7('0x49')]['id']}},_0x51918d={};_0x51918d[_0x31b7('0x33')]=_['keys'](db[_0x31b7('0x30')][_0x31b7('0x31')]);_0x51918d[_0x31b7('0x34')]=_[_0x31b7('0x4a')](_0x1046fb['query']);_0x51918d[_0x31b7('0x35')]=_['intersection'](_0x51918d['model'],_0x51918d[_0x31b7('0x34')]);_0x31fd89[_0x31b7('0x37')]=_[_0x31b7('0x36')](_0x51918d[_0x31b7('0x33')],qs['fields'](_0x1046fb[_0x31b7('0x34')][_0x31b7('0x38')]));_0x31fd89['attributes']=_0x31fd89[_0x31b7('0x37')][_0x31b7('0x39')]?_0x31fd89[_0x31b7('0x37')]:_0x51918d['model'];if(_0x1046fb[_0x31b7('0x34')][_0x31b7('0x4b')]){_0x31fd89[_0x31b7('0x44')]=[{'all':!![]}];}_0x31fd89=_[_0x31b7('0x40')]({},_0x31fd89,_0x1046fb[_0x31b7('0x43')]);return db[_0x31b7('0x30')][_0x31b7('0x4c')](_0x31fd89)[_0x31b7('0x27')](handleEntityNotFound(_0x4b3d24,null))['then'](respondWithResult(_0x4b3d24,null))[_0x31b7('0x47')](handleError(_0x4b3d24,null));};exports['create']=function(_0x5a72ee,_0x22cc77){return db[_0x31b7('0x30')][_0x31b7('0x4d')](_0x5a72ee[_0x31b7('0x4e')],{})['then'](function(_0x322798){var _0x18556b=_0x5a72ee[_0x31b7('0x4f')]['get']({'plain':!![]});if(!_0x18556b)throw new Error(_0x31b7('0x50'));if(_0x18556b[_0x31b7('0x51')]===_0x31b7('0x4f')){var _0x3b5868=_0x322798[_0x31b7('0x28')]({'plain':!![]});var _0x309077=_0x31b7('0x52');return db[_0x31b7('0x53')]['find']({'where':{'name':_0x309077,'userProfileId':_0x18556b['userProfileId']},'raw':!![]})[_0x31b7('0x27')](function(_0x1d55e6){if(_0x1d55e6&&_0x1d55e6[_0x31b7('0x54')]===0x0){return db[_0x31b7('0x29')]['create']({'name':_0x3b5868['name'],'resourceId':_0x3b5868['id'],'type':_0x1d55e6[_0x31b7('0x2c')],'sectionId':_0x1d55e6['id']},{})[_0x31b7('0x27')](function(){return _0x322798;});}else{return _0x322798;}})[_0x31b7('0x47')](function(_0x5ea605){logger[_0x31b7('0x2a')](_0x31b7('0x55'),_0x5ea605);throw _0x5ea605;});}return _0x322798;})[_0x31b7('0x27')](respondWithResult(_0x22cc77,0xc9))[_0x31b7('0x47')](handleError(_0x22cc77,null));};exports['update']=function(_0x535a3c,_0x43c1ee){if(_0x535a3c[_0x31b7('0x4e')]['id']){delete _0x535a3c[_0x31b7('0x4e')]['id'];}return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x535a3c[_0x31b7('0x49')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x43c1ee,null))[_0x31b7('0x27')](saveUpdates(_0x535a3c[_0x31b7('0x4e')],null))[_0x31b7('0x27')](respondWithResult(_0x43c1ee,null))['catch'](handleError(_0x43c1ee,null));};exports['destroy']=function(_0x4bd00d,_0x954c){return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x4bd00d['params']['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x954c,null))[_0x31b7('0x27')](removeEntity(_0x954c,null))[_0x31b7('0x47')](handleError(_0x954c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index cf3bb67..0074b5f 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 _0x064a=['lodash','util','../../config/logger','moment','rimraf','./tag.attributes','define','Tag','tools_tags'];(function(_0x5b9d64,_0x3fdb6a){var _0x3f402b=function(_0x31d9f7){while(--_0x31d9f7){_0x5b9d64['push'](_0x5b9d64['shift']());}};_0x3f402b(++_0x3fdb6a);}(_0x064a,0x168));var _0xa064=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x064a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa064('0x0'));var util=require(_0xa064('0x1'));var logger=require(_0xa064('0x2'))('api');var moment=require(_0xa064('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa064('0x4'));var config=require('../../config/environment');var attributes=require(_0xa064('0x5'));module['exports']=function(_0x17ac46,_0x5a59ad){return _0x17ac46[_0xa064('0x6')](_0xa064('0x7'),attributes,{'tableName':_0xa064('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc400=['tools_tags','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','Tag'];(function(_0x138ac9,_0x597a20){var _0xe99ea3=function(_0x1ff42f){while(--_0x1ff42f){_0x138ac9['push'](_0x138ac9['shift']());}};_0xe99ea3(++_0x597a20);}(_0xc400,0x105));var _0x0c40=function(_0x1cb6f4,_0x4ec026){_0x1cb6f4=_0x1cb6f4-0x0;var _0x1064c2=_0xc400[_0x1cb6f4];return _0x1064c2;};'use strict';var _=require(_0x0c40('0x0'));var util=require('util');var logger=require(_0x0c40('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0c40('0x2'));var rp=require(_0x0c40('0x3'));var fs=require('fs');var path=require(_0x0c40('0x4'));var rimraf=require(_0x0c40('0x5'));var config=require(_0x0c40('0x6'));var attributes=require(_0x0c40('0x7'));module['exports']=function(_0x3497eb,_0x5d898a){return _0x3497eb['define'](_0x0c40('0x8'),attributes,{'tableName':_0x0c40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index f1aa91d..04e7c0f 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 _0xe13a=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bf91e,_0x5a2f34){var _0x181ca6=function(_0x398f4b){while(--_0x398f4b){_0x2bf91e['push'](_0x2bf91e['shift']());}};_0x181ca6(++_0x5a2f34);}(_0xe13a,0x178));var _0xae13=function(_0x2534d8,_0x37da95){_0x2534d8=_0x2534d8-0x0;var _0x322237=_0xe13a[_0x2534d8];return _0x322237;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});} \ No newline at end of file +var _0x0b78=['request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x34bb7e,_0x2e1af5){var _0x475bd6=function(_0x385214){while(--_0x385214){_0x34bb7e['push'](_0x34bb7e['shift']());}};_0x475bd6(++_0x2e1af5);}(_0x0b78,0x1ad));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x584401,_0x5e19ef,_0x122ebe){return new BPromise(function(_0x3c248d,_0x445c23){return client['request'](_0x584401,_0x122ebe)[_0x80b7('0x9')](function(_0x25a015){logger[_0x80b7('0xa')]('Tag,\x20%s,\x20%s',_0x5e19ef,_0x80b7('0xb'));logger['debug'](_0x80b7('0xc'),_0x5e19ef,_0x80b7('0xb'),JSON[_0x80b7('0xd')](_0x25a015));if(_0x25a015[_0x80b7('0xe')]){if(_0x25a015[_0x80b7('0xe')][_0x80b7('0xf')]===0x1f4){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015[_0x80b7('0xe')][_0x80b7('0x11')]);return _0x445c23(_0x25a015[_0x80b7('0xe')]['message']);}logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015['error'][_0x80b7('0x11')]);return _0x3c248d(_0x25a015[_0x80b7('0xe')]['message']);}else{logger[_0x80b7('0xa')](_0x80b7('0x10'),_0x5e19ef,_0x80b7('0xb'));_0x3c248d(_0x25a015[_0x80b7('0x12')][_0x80b7('0x11')]);}})[_0x80b7('0x13')](function(_0x1e3d1c){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x1e3d1c);_0x445c23(_0x1e3d1c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 2946258..6227a8b 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 526e002..a0df3a9 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(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2e49393..1c579ed 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 _0x71af=['sendStatus','error','stack','name','send','index','map','Team','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','sequelize','transaction','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','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','UserSmsQueue','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','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','rawAttributes','pick','Queues','addQueues','body','Unknown\x20channel','add','ids','removeQueues','addAgents','isArray','Voice','Chat','Sms','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','user','Queue:save','online','UserVoiceQueueRt','upsert','isNil','interface','format','voicePause','all','VoicePrefixId','spread','removeAgents','Mail','Fax','Queue:remove','getAgents','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then'];(function(_0x6d6863,_0x501834){var _0x5dfe69=function(_0x5393c5){while(--_0x5393c5){_0x6d6863['push'](_0x6d6863['shift']());}};_0x5dfe69(++_0x501834);}(_0x71af,0x1b9));var _0xf71a=function(_0x1e01b4,_0x45bb7e){_0x1e01b4=_0x1e01b4-0x0;var _0x3a5931=_0x71af[_0x1e01b4];return _0x3a5931;};'use strict';var emlformat=require(_0xf71a('0x0'));var rimraf=require(_0xf71a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf71a('0x2'));var rp=require(_0xf71a('0x3'));var moment=require(_0xf71a('0x4'));var BPromise=require(_0xf71a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf71a('0x6'));var sox=require(_0xf71a('0x7'));var csv=require(_0xf71a('0x8'));var ejs=require(_0xf71a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf71a('0xa'));var squel=require(_0xf71a('0xb'));var crypto=require(_0xf71a('0xc'));var jsforce=require(_0xf71a('0xd'));var deskjs=require(_0xf71a('0xe'));var toCsv=require(_0xf71a('0x8'));var querystring=require(_0xf71a('0xf'));var Papa=require(_0xf71a('0x10'));var Redis=require(_0xf71a('0x11'));var authService=require(_0xf71a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf71a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf71a('0x14'))(_0xf71a('0x15'));var utils=require(_0xf71a('0x16'));var config=require(_0xf71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf71a('0x18'))['db'];config[_0xf71a('0x19')]=_[_0xf71a('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf71a('0x1b'))(new Redis(config[_0xf71a('0x19')]));require(_0xf71a('0x1c'))[_0xf71a('0x1d')](socket);function respondWithStatusCode(_0x3eca9a,_0x3d5dcb){_0x3d5dcb=_0x3d5dcb||0xcc;return function(_0x1a43c3){if(_0x1a43c3){return _0x3eca9a['sendStatus'](_0x3d5dcb);}return _0x3eca9a[_0xf71a('0x1e')](_0x3d5dcb)[_0xf71a('0x1f')]();};}function respondWithResult(_0x3c9296,_0x501166){_0x501166=_0x501166||0xc8;return function(_0x4e33be){if(_0x4e33be){return _0x3c9296[_0xf71a('0x1e')](_0x501166)['json'](_0x4e33be);}};}function respondWithFilteredResult(_0x2d11db,_0x5f01a1){return function(_0x5467ae){if(_0x5467ae){var _0x3688e3=typeof _0x5f01a1['offset']===_0xf71a('0x20')&&typeof _0x5f01a1['limit']===_0xf71a('0x20');var _0x4068a6=_0x5467ae[_0xf71a('0x21')];var _0x32039f=_0x3688e3?0x0:_0x5f01a1[_0xf71a('0x22')];var _0x5c5349=_0x3688e3?_0x5467ae['count']:_0x5f01a1[_0xf71a('0x22')]+_0x5f01a1[_0xf71a('0x23')];var _0x2e38c7;if(_0x5c5349>=_0x4068a6){_0x5c5349=_0x4068a6;_0x2e38c7=0xc8;}else{_0x2e38c7=0xce;}_0x2d11db[_0xf71a('0x1e')](_0x2e38c7);return _0x2d11db[_0xf71a('0x24')](_0xf71a('0x25'),_0x32039f+'-'+_0x5c5349+'/'+_0x4068a6)['json'](_0x5467ae);}return null;};}function patchUpdates(_0x42e70a){return function(_0x1a555a){try{jsonpatch[_0xf71a('0x26')](_0x1a555a,_0x42e70a,!![]);}catch(_0xc73a3b){return BPromise[_0xf71a('0x27')](_0xc73a3b);}return _0x1a555a[_0xf71a('0x28')]();};}function saveUpdates(_0x381fa7,_0x16f9db){return function(_0x3a17f1){if(_0x3a17f1){return _0x3a17f1['update'](_0x381fa7)[_0xf71a('0x29')](function(_0x6da624){return _0x6da624;});}return null;};}function handleEntityNotFound(_0x4d2f32,_0x595472){return function(_0x106cef){if(!_0x106cef){_0x4d2f32[_0xf71a('0x2a')](0x194);}return _0x106cef;};}function handleError(_0x231770,_0x3edbc4){_0x3edbc4=_0x3edbc4||0x1f4;return function(_0xe17183){logger[_0xf71a('0x2b')](_0xe17183[_0xf71a('0x2c')]);if(_0xe17183[_0xf71a('0x2d')]){delete _0xe17183['name'];}_0x231770[_0xf71a('0x1e')](_0x3edbc4)[_0xf71a('0x2e')](_0xe17183);};}exports[_0xf71a('0x2f')]=function(_0x1795b2,_0x418653){var _0x326d10={},_0x5f1cde={},_0x1ec2fb={'count':0x0,'rows':[]};var _0x3ae35f=_[_0xf71a('0x30')](db[_0xf71a('0x31')]['rawAttributes'],function(_0x4809f7){return{'name':_0x4809f7['fieldName'],'type':_0x4809f7['type'][_0xf71a('0x32')]};});_0x5f1cde[_0xf71a('0x33')]=_[_0xf71a('0x30')](_0x3ae35f,_0xf71a('0x2d'));_0x5f1cde[_0xf71a('0x34')]=_[_0xf71a('0x35')](_0x1795b2['query']);_0x5f1cde[_0xf71a('0x36')]=_[_0xf71a('0x37')](_0x5f1cde['model'],_0x5f1cde[_0xf71a('0x34')]);_0x326d10['attributes']=_[_0xf71a('0x37')](_0x5f1cde[_0xf71a('0x33')],qs['fields'](_0x1795b2[_0xf71a('0x34')][_0xf71a('0x38')]));_0x326d10['attributes']=_0x326d10[_0xf71a('0x39')]['length']?_0x326d10[_0xf71a('0x39')]:_0x5f1cde[_0xf71a('0x33')];if(!_0x1795b2[_0xf71a('0x34')]['hasOwnProperty']('nolimit')){_0x326d10[_0xf71a('0x23')]=qs['limit'](_0x1795b2[_0xf71a('0x34')][_0xf71a('0x23')]);_0x326d10['offset']=qs[_0xf71a('0x22')](_0x1795b2[_0xf71a('0x34')][_0xf71a('0x22')]);}_0x326d10[_0xf71a('0x3a')]=qs[_0xf71a('0x3b')](_0x1795b2['query'][_0xf71a('0x3b')]);_0x326d10[_0xf71a('0x3c')]=qs[_0xf71a('0x36')](_['pick'](_0x1795b2['query'],_0x5f1cde[_0xf71a('0x36')]),_0x3ae35f);if(_0x1795b2['query']['filter']){_0x326d10[_0xf71a('0x3c')]=_[_0xf71a('0x3d')](_0x326d10['where'],{'$or':_[_0xf71a('0x30')](_0x3ae35f,function(_0x4cbc8e){if(_0x4cbc8e[_0xf71a('0x3e')]!==_0xf71a('0x3f')){var _0x3f8fec={};_0x3f8fec[_0x4cbc8e['name']]={'$like':'%'+_0x1795b2[_0xf71a('0x34')][_0xf71a('0x40')]+'%'};return _0x3f8fec;}})});}_0x326d10=_[_0xf71a('0x3d')]({},_0x326d10,_0x1795b2[_0xf71a('0x41')]);var _0x800da5={'where':_0x326d10['where']};return db[_0xf71a('0x31')][_0xf71a('0x21')](_0x800da5)[_0xf71a('0x29')](function(_0x8854c4){_0x1ec2fb[_0xf71a('0x21')]=_0x8854c4;if(_0x1795b2[_0xf71a('0x34')][_0xf71a('0x42')]){_0x326d10['include']=[{'all':!![]}];}return db[_0xf71a('0x31')][_0xf71a('0x43')](_0x326d10);})[_0xf71a('0x29')](function(_0x296048){_0x1ec2fb[_0xf71a('0x44')]=_0x296048;return _0x1ec2fb;})[_0xf71a('0x29')](respondWithFilteredResult(_0x418653,_0x326d10))[_0xf71a('0x45')](handleError(_0x418653,null));};exports[_0xf71a('0x46')]=function(_0x206155,_0x4e0da4){var _0x2a4a23={'raw':![],'where':{'id':_0x206155[_0xf71a('0x47')]['id']}},_0x1c0bf5={};_0x1c0bf5[_0xf71a('0x33')]=_['keys'](db[_0xf71a('0x31')]['rawAttributes']);_0x1c0bf5['query']=_[_0xf71a('0x35')](_0x206155[_0xf71a('0x34')]);_0x1c0bf5['filters']=_['intersection'](_0x1c0bf5[_0xf71a('0x33')],_0x1c0bf5[_0xf71a('0x34')]);_0x2a4a23[_0xf71a('0x39')]=_[_0xf71a('0x37')](_0x1c0bf5[_0xf71a('0x33')],qs[_0xf71a('0x38')](_0x206155[_0xf71a('0x34')][_0xf71a('0x38')]));_0x2a4a23[_0xf71a('0x39')]=_0x2a4a23[_0xf71a('0x39')][_0xf71a('0x48')]?_0x2a4a23['attributes']:_0x1c0bf5[_0xf71a('0x33')];if(_0x206155['query'][_0xf71a('0x42')]){_0x2a4a23[_0xf71a('0x49')]=[{'all':!![]}];}_0x2a4a23=_[_0xf71a('0x3d')]({},_0x2a4a23,_0x206155[_0xf71a('0x41')]);return db[_0xf71a('0x31')][_0xf71a('0x4a')](_0x2a4a23)['then'](handleEntityNotFound(_0x4e0da4,null))[_0xf71a('0x29')](respondWithResult(_0x4e0da4,null))['catch'](handleError(_0x4e0da4,null));};exports['create']=function(_0x20dfc7,_0x45d0f6){return db[_0xf71a('0x31')]['create'](_0x20dfc7['body'],{})[_0xf71a('0x29')](function(_0x136983){var _0x1612fe=_0x20dfc7['user'][_0xf71a('0x4b')]({'plain':!![]});if(!_0x1612fe)throw new Error(_0xf71a('0x4c'));if(_0x1612fe[_0xf71a('0x4d')]==='user'){var _0x44fdf2=_0x136983['get']({'plain':!![]});var _0x657a38=_0xf71a('0x4e');return db[_0xf71a('0x4f')][_0xf71a('0x4a')]({'where':{'name':_0x657a38,'userProfileId':_0x1612fe[_0xf71a('0x50')]},'raw':!![]})['then'](function(_0x2dc71b){if(_0x2dc71b&&_0x2dc71b[_0xf71a('0x51')]===0x0){return db[_0xf71a('0x52')][_0xf71a('0x53')]({'name':_0x44fdf2[_0xf71a('0x2d')],'resourceId':_0x44fdf2['id'],'type':_0x2dc71b[_0xf71a('0x2d')],'sectionId':_0x2dc71b['id']},{})['then'](function(){return _0x136983;});}else{return _0x136983;}})['catch'](function(_0x216de0){logger[_0xf71a('0x2b')](_0xf71a('0x54'),_0x216de0);throw _0x216de0;});}return _0x136983;})[_0xf71a('0x29')](respondWithResult(_0x45d0f6,0xc9))[_0xf71a('0x45')](handleError(_0x45d0f6,null));};exports[_0xf71a('0x55')]=function(_0x1d79b7,_0x22904d){if(_0x1d79b7['body']['id']){delete _0x1d79b7['body']['id'];}return db[_0xf71a('0x31')][_0xf71a('0x4a')]({'where':{'id':_0x1d79b7['params']['id']}})[_0xf71a('0x29')](handleEntityNotFound(_0x22904d,null))[_0xf71a('0x29')](saveUpdates(_0x1d79b7['body'],null))[_0xf71a('0x29')](respondWithResult(_0x22904d,null))[_0xf71a('0x45')](handleError(_0x22904d,null));};exports['destroy']=function(_0x34cde0,_0x465157){var _0x41afa7=_0x34cde0[_0xf71a('0x47')]['id'];var _0x127ef3=[];return db[_0xf71a('0x56')][_0xf71a('0x57')](function(_0x1baee5){var _0x2f2bb8=_0xf71a('0x58')+_0x41afa7;return db[_0xf71a('0x56')][_0xf71a('0x34')](_0x2f2bb8,{'type':db[_0xf71a('0x59')][_0xf71a('0x5a')][_0xf71a('0x5b')],'raw':!![],'transaction':_0x1baee5})[_0xf71a('0x29')](function(_0x5e928b){_0x127ef3=_[_0xf71a('0x30')](_0x5e928b,function(_0x5727e4){return Number(_0x5727e4[_0xf71a('0x5c')]);});})[_0xf71a('0x29')](function(){var _0xb86d52=_0xf71a('0x5d')+_0x41afa7;return db['sequelize'][_0xf71a('0x34')](_0xb86d52,{'type':db[_0xf71a('0x59')][_0xf71a('0x5a')][_0xf71a('0x5b')],'raw':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x39d2fb){var _0x3cc20a=_[_0xf71a('0x30')](_0x39d2fb,function(_0x7c243e){return Number(_0x7c243e['VoiceQueueId']);});return db[_0xf71a('0x5e')][_0xf71a('0x5f')]({'where':{'UserId':{'$in':_0x127ef3},'VoiceQueueId':{'$in':_0x3cc20a}},'transaction':_0x1baee5});})[_0xf71a('0x29')](function(){var _0x23960c=_0xf71a('0x60')+_0x41afa7;return db[_0xf71a('0x56')][_0xf71a('0x34')](_0x23960c,{'type':db['Sequelize']['QueryTypes'][_0xf71a('0x5b')],'raw':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x3a2988){var _0x257e0f=_['map'](_0x3a2988,function(_0x376d9e){return Number(_0x376d9e['MailQueueId']);});return db[_0xf71a('0x61')][_0xf71a('0x5f')]({'where':{'UserId':{'$in':_0x127ef3},'MailQueueId':{'$in':_0x257e0f}},'transaction':_0x1baee5});})[_0xf71a('0x29')](function(){var _0x3e3b2a='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x41afa7;return db['sequelize'][_0xf71a('0x34')](_0x3e3b2a,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x357fa3){var _0x4565b5=_[_0xf71a('0x30')](_0x357fa3,function(_0x534fa6){return Number(_0x534fa6['SmsQueueId']);});return db[_0xf71a('0x62')][_0xf71a('0x5f')]({'where':{'UserId':{'$in':_0x127ef3},'SmsQueueId':{'$in':_0x4565b5}},'transaction':_0x1baee5});})['then'](function(){var _0x4a2337='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x41afa7;return db['sequelize'][_0xf71a('0x34')](_0x4a2337,{'type':db['Sequelize'][_0xf71a('0x5a')][_0xf71a('0x5b')],'raw':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x21ad7a){var _0x405bda=_[_0xf71a('0x30')](_0x21ad7a,function(_0xffe11){return Number(_0xffe11[_0xf71a('0x63')]);});return db[_0xf71a('0x64')][_0xf71a('0x5f')]({'where':{'UserId':{'$in':_0x127ef3},'ChatQueueId':{'$in':_0x405bda}},'transaction':_0x1baee5});})[_0xf71a('0x29')](function(){var _0x40d821=_0xf71a('0x65')+_0x41afa7;return db['sequelize'][_0xf71a('0x34')](_0x40d821,{'type':db[_0xf71a('0x59')][_0xf71a('0x5a')][_0xf71a('0x5b')],'raw':!![],'transaction':_0x1baee5});})['then'](function(_0x5c9de6){var _0x4c4b85=_[_0xf71a('0x30')](_0x5c9de6,function(_0x55d9f5){return Number(_0x55d9f5[_0xf71a('0x66')]);});return db[_0xf71a('0x67')]['destroy']({'where':{'UserId':{'$in':_0x127ef3},'FaxQueueId':{'$in':_0x4c4b85}},'transaction':_0x1baee5});})['then'](function(){var _0x2d8e9e=_0xf71a('0x68')+_0x41afa7;return db[_0xf71a('0x56')][_0xf71a('0x34')](_0x2d8e9e,{'type':db[_0xf71a('0x59')][_0xf71a('0x5a')]['SELECT'],'raw':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x1182a5){var _0x21f825=_[_0xf71a('0x30')](_0x1182a5,function(_0x190b42){return Number(_0x190b42[_0xf71a('0x69')]);});return db[_0xf71a('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x127ef3},'OpenchannelQueueId':{'$in':_0x21f825}},'transaction':_0x1baee5});})[_0xf71a('0x29')](function(){var _0x547c12='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x41afa7;return db['sequelize'][_0xf71a('0x34')](_0x547c12,{'type':db[_0xf71a('0x59')][_0xf71a('0x5a')][_0xf71a('0x5b')],'raw':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x1d2a1e){var _0x389cd5=_[_0xf71a('0x30')](_0x1d2a1e,function(_0x34e53c){return Number(_0x34e53c[_0xf71a('0x6b')]);});return db[_0xf71a('0x6c')][_0xf71a('0x5f')]({'where':{'UserId':{'$in':_0x127ef3},'WhatsappQueueId':{'$in':_0x389cd5}},'transaction':_0x1baee5});})['then'](function(){return db[_0xf71a('0x6d')][_0xf71a('0x4a')]({'where':{'TeamId':_0x41afa7}});})[_0xf71a('0x29')](function(_0x811f13){if(_0x811f13===null){return;}return db[_0xf71a('0x6e')][_0xf71a('0x5f')]({'where':{'UserId':{'$in':_0x127ef3},'VoicePrefixId':_0x811f13['VoicePrefixId']},'transaction':_0x1baee5});})[_0xf71a('0x29')](function(){return db['Team'][_0xf71a('0x5f')]({'where':{'id':_0x41afa7},'cascade':!![],'transaction':_0x1baee5});})[_0xf71a('0x29')](function(_0x2a15e8){if(_0x2a15e8===0x0){_0x465157['sendStatus'](0x194);}else{return db[_0xf71a('0x52')]['destroy']({'where':{'type':_0xf71a('0x4e'),'resourceId':_0x41afa7},'cascade':!![],'transaction':_0x1baee5})['then'](function(){_0x465157[_0xf71a('0x1e')](0xcc)[_0xf71a('0x1f')]();});}})['catch'](function(_0x41ad82){_0x465157[_0xf71a('0x1e')](0x1f4)['send'](_0x41ad82);});});};exports[_0xf71a('0x6f')]=function(_0x11a09a,_0x553370,_0x29d412){return db[_0xf71a('0x31')][_0xf71a('0x70')]({'where':{'id':_0x11a09a['params']['id']}})[_0xf71a('0x29')](handleEntityNotFound(_0x553370,null))['then'](function(_0x311d96){if(!_0x11a09a['query'][_0xf71a('0x71')]||!utils[_0xf71a('0x72')](_0x11a09a[_0xf71a('0x34')]['channel'])){throw new db[(_0xf71a('0x59'))][(_0xf71a('0x73'))]('Unknown\x20channel');}var _0x4e2385={};var _0x1eefdd={};_0x1eefdd['model']=_[_0xf71a('0x35')](db[_[_0xf71a('0x74')](_0x11a09a['query'][_0xf71a('0x71')][_0xf71a('0x75')]())+_0xf71a('0x76')][_0xf71a('0x77')]);_0x1eefdd[_0xf71a('0x34')]=_['keys'](_0x11a09a[_0xf71a('0x34')]);_0x1eefdd[_0xf71a('0x36')]=_[_0xf71a('0x37')](_0x1eefdd['model'],_0x1eefdd[_0xf71a('0x34')]);_0x4e2385[_0xf71a('0x39')]=_[_0xf71a('0x37')](_0x1eefdd[_0xf71a('0x33')],qs[_0xf71a('0x38')](_0x11a09a[_0xf71a('0x34')]['fields']));_0x4e2385[_0xf71a('0x39')]=_0x4e2385['attributes'][_0xf71a('0x48')]?_0x4e2385[_0xf71a('0x39')]:_0x1eefdd[_0xf71a('0x33')];_0x4e2385[_0xf71a('0x23')]=qs[_0xf71a('0x23')](_0x11a09a[_0xf71a('0x34')][_0xf71a('0x23')]);_0x4e2385[_0xf71a('0x22')]=qs[_0xf71a('0x22')](_0x11a09a[_0xf71a('0x34')]['offset']);_0x4e2385[_0xf71a('0x3a')]=qs[_0xf71a('0x3b')](_0x11a09a[_0xf71a('0x34')][_0xf71a('0x3b')]);_0x4e2385[_0xf71a('0x3c')]=qs[_0xf71a('0x36')](_[_0xf71a('0x78')](_0x11a09a['query'],_0x1eefdd[_0xf71a('0x36')]));_0x4e2385=_['merge']({},_0x4e2385,_0x11a09a[_0xf71a('0x41')]);return _0x311d96[_0xf71a('0x4b')+_[_0xf71a('0x74')](_0x11a09a[_0xf71a('0x34')]['channel']['toLowerCase']())+_0xf71a('0x79')](_0x4e2385);})[_0xf71a('0x29')](respondWithResult(_0x553370,null))[_0xf71a('0x45')](handleError(_0x553370,null));};exports[_0xf71a('0x7a')]=function(_0x4b2698,_0x5bbfbf,_0x51fef8){return db['Team']['findOne']({'where':{'id':_0x4b2698[_0xf71a('0x47')]['id']}})[_0xf71a('0x29')](function(_0x4e545b){if(_0x4e545b){if(!_0x4b2698[_0xf71a('0x7b')][_0xf71a('0x71')]||!utils[_0xf71a('0x72')](_0x4b2698[_0xf71a('0x7b')][_0xf71a('0x71')])){throw new db['Sequelize']['ValidationError'](_0xf71a('0x7c'));}return _0x4e545b[_0xf71a('0x7d')+_['capitalize'](_0x4b2698[_0xf71a('0x7b')][_0xf71a('0x71')][_0xf71a('0x75')]())+_0xf71a('0x79')](_0x4b2698[_0xf71a('0x7b')][_0xf71a('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x5bbfbf,null))[_0xf71a('0x29')](respondWithStatusCode(_0x5bbfbf,null))[_0xf71a('0x45')](handleError(_0x5bbfbf,null));};exports[_0xf71a('0x7f')]=function(_0x3a5117,_0x56edd2,_0x71ea2f){return db[_0xf71a('0x31')]['findOne']({'where':{'id':_0x3a5117['params']['id']}})[_0xf71a('0x29')](function(_0x1a52d7){if(_0x1a52d7){if(!_0x3a5117[_0xf71a('0x34')][_0xf71a('0x71')]||!utils[_0xf71a('0x72')](_0x3a5117[_0xf71a('0x34')]['channel'])){throw new db['Sequelize'][(_0xf71a('0x73'))]('Unknown\x20channel');}return _0x1a52d7['remove'+_[_0xf71a('0x74')](_0x3a5117[_0xf71a('0x34')][_0xf71a('0x71')][_0xf71a('0x75')]())+_0xf71a('0x79')](_0x3a5117[_0xf71a('0x34')][_0xf71a('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x56edd2,null))[_0xf71a('0x29')](respondWithStatusCode(_0x56edd2,null))[_0xf71a('0x45')](handleError(_0x56edd2,null));};exports[_0xf71a('0x80')]=function(_0x4ec4cf,_0x2e0f72){var _0x475f87=_[_0xf71a('0x81')](_0x4ec4cf['body'][_0xf71a('0x7e')])?_0x4ec4cf[_0xf71a('0x7b')][_0xf71a('0x7e')]:[_0x4ec4cf['body'][_0xf71a('0x7e')]];var _0x5d061a=_0x4ec4cf[_0xf71a('0x47')]['id'];return db[_0xf71a('0x31')]['find']({'where':{'id':_0x5d061a}})[_0xf71a('0x29')](handleEntityNotFound(_0x2e0f72,null))[_0xf71a('0x29')](function(_0x4af0bf){if(_0x4af0bf){var _0x4c7a0e=[_0xf71a('0x82'),_0xf71a('0x83'),'Mail',_0xf71a('0x84'),'Fax',_0xf71a('0x85'),_0xf71a('0x86')];return db[_0xf71a('0x56')]['transaction'](function(_0x22056d){var _0x21b109=_['map'](_0x4c7a0e,function(_0x2dec4d){var _0x1e4277={'attributes':['id',_0xf71a('0x2d')]};if(_0x2dec4d===_0xf71a('0x82')){_0x1e4277[_0xf71a('0x87')]={'attributes':[_0xf71a('0x88')]};}return _0x4af0bf['get'+_0x2dec4d+_0xf71a('0x79')](_0x1e4277)['then'](function(_0x2ffba2){var _0x178a58=_[_0xf71a('0x30')](_0x2ffba2,function(_0x490b0e){var _0x4bad81=_['map'](_0x475f87,function(_0x9bdd){var _0xd8f518={'where':{'UserId':_0x9bdd,[_0x2dec4d+_0xf71a('0x89')]:_0x490b0e['id']},'transaction':_0x22056d};if(_0x2dec4d===_0xf71a('0x82')){_0xd8f518[_0xf71a('0x1a')]={'penalty':_0x490b0e[_0xf71a('0x8a')][_0xf71a('0x88')]};}return db[_0xf71a('0x8b')+_0x2dec4d+'Queue'][_0xf71a('0x8c')](_0xd8f518)['then'](function(){socket[_0xf71a('0x8d')](_0xf71a('0x8e')+_0x2dec4d+_0xf71a('0x8f'),{'UserId':_0x9bdd,[_0x2dec4d+_0xf71a('0x89')]:_0x490b0e['id']});if(_0x2dec4d!==_0xf71a('0x82')){return;}return db['User'][_0xf71a('0x43')]({'where':{'id':_0x475f87,'online':0x1},'attributes':['id',_0xf71a('0x2d'),_0xf71a('0x90'),'voicePause','interface'],'raw':!![]})['then'](function(_0x41264f){var _0x5b0cf0=_[_0xf71a('0x30')](_0x41264f,function(_0x1c0ad2){return db[_0xf71a('0x91')][_0xf71a('0x92')]({'membername':_0x1c0ad2[_0xf71a('0x2d')],'UserId':_0x1c0ad2['id'],'queue_name':_0x490b0e[_0xf71a('0x2d')],'VoiceQueueId':_0x490b0e['id'],'interface':_[_0xf71a('0x93')](_0x1c0ad2[_0xf71a('0x94')])?util[_0xf71a('0x95')]('SIP/%s',_0x1c0ad2[_0xf71a('0x2d')]):_0x1c0ad2[_0xf71a('0x94')],'paused':_0x1c0ad2[_0xf71a('0x96')]||![],'penalty':_0x490b0e[_0xf71a('0x8a')][_0xf71a('0x88')]},{'transaction':_0x22056d});});return Promise[_0xf71a('0x97')](_0x5b0cf0);});});});return Promise['all'](_0x4bad81);});return Promise[_0xf71a('0x97')](_0x178a58);})[_0xf71a('0x29')](function(){return db[_0xf71a('0x6d')][_0xf71a('0x70')]({'where':{'teamId':_0x5d061a}})[_0xf71a('0x29')](function(_0x209882){if(_0x209882){var _0x2b29b9=_[_0xf71a('0x30')](_0x475f87,function(_0x341fe2){db[_0xf71a('0x6e')][_0xf71a('0x92')]({'UserId':_0x341fe2,'VoicePrefixId':_0x209882[_0xf71a('0x98')]});});return Promise['all'](_0x2b29b9);}});});});return Promise[_0xf71a('0x97')](_0x21b109)[_0xf71a('0x29')](function(){return _0x4af0bf[_0xf71a('0x80')](_0x475f87,{'transaction':_0x22056d})[_0xf71a('0x99')](function(_0x3d45dc){return _0x3d45dc;});});});}})[_0xf71a('0x29')](respondWithResult(_0x2e0f72,null))[_0xf71a('0x45')](handleError(_0x2e0f72,null));};exports[_0xf71a('0x9a')]=function(_0x5220ce,_0x3110d8){var _0x40db19=_[_0xf71a('0x81')](_0x5220ce['query'][_0xf71a('0x7e')])?_0x5220ce[_0xf71a('0x34')]['ids']:[_0x5220ce[_0xf71a('0x34')][_0xf71a('0x7e')]];var _0x4351d6=_0x5220ce[_0xf71a('0x47')]['id'];return db['Team'][_0xf71a('0x4a')]({'where':{'id':_0x4351d6}})[_0xf71a('0x29')](handleEntityNotFound(_0x3110d8,null))['then'](function(_0xb923e8){if(_0xb923e8){var _0x232265=[_0xf71a('0x82'),_0xf71a('0x83'),_0xf71a('0x9b'),_0xf71a('0x84'),_0xf71a('0x9c'),_0xf71a('0x85'),_0xf71a('0x86')];return db[_0xf71a('0x56')][_0xf71a('0x57')](function(_0x430182){var _0x151726=_['map'](_0x232265,function(_0x2b69d4){var _0x1ea759={'attributes':['id','name']};return _0xb923e8[_0xf71a('0x4b')+_0x2b69d4+_0xf71a('0x79')](_0x1ea759)['then'](function(_0x4ac307){var _0x6e602c=_[_0xf71a('0x30')](_0x4ac307,function(_0x1945ee){return _0x1945ee[_0xf71a('0x9a')](_0x40db19,{'transaction':_0x430182})['then'](function(){var _0x9983ea=_['map'](_0x40db19,function(_0x571b67){socket['emit']('user'+_0x2b69d4+_0xf71a('0x9d'),{'UserId':Number(_0x571b67),[_0x2b69d4+'QueueId']:_0x1945ee['id']});if(_0x2b69d4!==_0xf71a('0x82')){return;}return db[_0xf71a('0x91')]['destroy']({'where':{'VoiceQueueId':_0x1945ee['id'],'UserId':_0x571b67},'transaction':_0x430182});});return Promise[_0xf71a('0x97')](_0x9983ea);});});return Promise['all'](_0x6e602c);});});return Promise[_0xf71a('0x97')](_0x151726)[_0xf71a('0x29')](function(){return _0xb923e8['removeAgents'](_0x40db19,{'transaction':_0x430182});})[_0xf71a('0x29')](function(){return db[_0xf71a('0x6d')][_0xf71a('0x70')]({'where':{'teamId':_0x4351d6}})['then'](function(_0x143e41){if(_0x143e41){var _0x2e939c=_[_0xf71a('0x30')](_0x40db19,function(_0x5c5a14){db[_0xf71a('0x6e')][_0xf71a('0x5f')]({'where':{'UserId':_0x5c5a14,'VoicePrefixId':_0x143e41['VoicePrefixId']}});});return Promise[_0xf71a('0x97')](_0x2e939c);}});});});}})['then'](respondWithStatusCode(_0x3110d8,null))['catch'](handleError(_0x3110d8,null));};exports[_0xf71a('0x9e')]=function(_0x12e174,_0x393ab8,_0x30ffd4){var _0x13daaa={};var _0x26733f={};var _0x42531b;var _0x4e7d3b;return db['Team']['findOne']({'where':{'id':_0x12e174[_0xf71a('0x47')]['id']}})['then'](handleEntityNotFound(_0x393ab8,null))[_0xf71a('0x29')](function(_0x145c59){if(_0x145c59){_0x42531b=_0x145c59;_0x26733f[_0xf71a('0x33')]=_[_0xf71a('0x35')](db['User'][_0xf71a('0x77')]);_0x26733f[_0xf71a('0x34')]=_[_0xf71a('0x35')](_0x12e174['query']);_0x26733f[_0xf71a('0x36')]=_[_0xf71a('0x37')](_0x26733f[_0xf71a('0x33')],_0x26733f[_0xf71a('0x34')]);_0x13daaa[_0xf71a('0x39')]=_[_0xf71a('0x37')](_0x26733f[_0xf71a('0x33')],qs['fields'](_0x12e174['query']['fields']));_0x13daaa[_0xf71a('0x39')]=_0x13daaa[_0xf71a('0x39')]['length']?_0x13daaa[_0xf71a('0x39')]:_0x26733f[_0xf71a('0x33')];_0x13daaa[_0xf71a('0x3a')]=qs[_0xf71a('0x3b')](_0x12e174[_0xf71a('0x34')]['sort']);_0x13daaa[_0xf71a('0x3c')]=qs[_0xf71a('0x36')](_[_0xf71a('0x78')](_0x12e174['query'],_0x26733f['filters']));if(_0x12e174[_0xf71a('0x34')][_0xf71a('0x40')]){_0x13daaa[_0xf71a('0x3c')]=_['merge'](_0x13daaa[_0xf71a('0x3c')],{'$or':_[_0xf71a('0x30')](_0x13daaa[_0xf71a('0x39')],function(_0x57f1c6){var _0x1db77a={};_0x1db77a[_0x57f1c6]={'$like':'%'+_0x12e174[_0xf71a('0x34')][_0xf71a('0x40')]+'%'};return _0x1db77a;})});}_0x13daaa=_['merge']({},_0x13daaa,_0x12e174[_0xf71a('0x41')]);return _0x42531b[_0xf71a('0x9e')](_0x13daaa);}})['then'](function(_0x597658){if(_0x597658){_0x4e7d3b=_0x597658[_0xf71a('0x48')];if(!_0x12e174[_0xf71a('0x34')][_0xf71a('0x9f')](_0xf71a('0xa0'))){_0x13daaa[_0xf71a('0x23')]=qs[_0xf71a('0x23')](_0x12e174['query'][_0xf71a('0x23')]);_0x13daaa[_0xf71a('0x22')]=qs[_0xf71a('0x22')](_0x12e174[_0xf71a('0x34')][_0xf71a('0x22')]);}return _0x42531b[_0xf71a('0x9e')](_0x13daaa);}})[_0xf71a('0x29')](function(_0x1b2ead){if(_0x1b2ead){return _0x1b2ead?{'count':_0x4e7d3b,'rows':_0x1b2ead}:null;}})[_0xf71a('0x29')](respondWithResult(_0x393ab8,null))[_0xf71a('0x45')](handleError(_0x393ab8,null));}; \ No newline at end of file +var _0x4bea=['remove','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','Voice','through','penalty','TeamVoiceQueue','User','findOrCreate','Queue:save','QueueId','interface','isNil','format','SIP/%s','voicePause','all','removeAgents','Whatsapp','emit','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','show','params','keys','catch','create','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','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','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','find','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','ValidationError','capitalize','Queue','Queues','Unknown\x20channel','add','toLowerCase','ids','removeQueues','isValidChannel'];(function(_0x293fa4,_0x3ee6cc){var _0x58d190=function(_0x7aea40){while(--_0x7aea40){_0x293fa4['push'](_0x293fa4['shift']());}};_0x58d190(++_0x3ee6cc);}(_0x4bea,0x14e));var _0xa4be=function(_0x372915,_0x2dbd58){_0x372915=_0x372915-0x0;var _0x42ea51=_0x4bea[_0x372915];return _0x42ea51;};'use strict';var emlformat=require(_0xa4be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4be('0x1'));var jsonpatch=require(_0xa4be('0x2'));var rp=require(_0xa4be('0x3'));var moment=require(_0xa4be('0x4'));var BPromise=require(_0xa4be('0x5'));var Mustache=require(_0xa4be('0x6'));var util=require(_0xa4be('0x7'));var path=require('path');var sox=require(_0xa4be('0x8'));var csv=require(_0xa4be('0x9'));var ejs=require(_0xa4be('0xa'));var fs=require('fs');var fs_extra=require(_0xa4be('0xb'));var _=require(_0xa4be('0xc'));var squel=require(_0xa4be('0xd'));var crypto=require('crypto');var jsforce=require(_0xa4be('0xe'));var deskjs=require(_0xa4be('0xf'));var toCsv=require(_0xa4be('0x9'));var querystring=require(_0xa4be('0x10'));var Papa=require(_0xa4be('0x11'));var Redis=require(_0xa4be('0x12'));var authService=require(_0xa4be('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa4be('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4be('0x15'))(_0xa4be('0x16'));var utils=require('../../config/utils');var config=require(_0xa4be('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4be('0x18'))['db'];config[_0xa4be('0x19')]=_[_0xa4be('0x1a')](config['redis'],{'host':_0xa4be('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4be('0x19')]));require(_0xa4be('0x1c'))[_0xa4be('0x1d')](socket);function respondWithStatusCode(_0x17b46a,_0x44732b){_0x44732b=_0x44732b||0xcc;return function(_0x30e150){if(_0x30e150){return _0x17b46a[_0xa4be('0x1e')](_0x44732b);}return _0x17b46a[_0xa4be('0x1f')](_0x44732b)[_0xa4be('0x20')]();};}function respondWithResult(_0x1ef9d9,_0x521843){_0x521843=_0x521843||0xc8;return function(_0x2e32fc){if(_0x2e32fc){return _0x1ef9d9[_0xa4be('0x1f')](_0x521843)[_0xa4be('0x21')](_0x2e32fc);}};}function respondWithFilteredResult(_0x3f9d54,_0x7e16cb){return function(_0x3c5804){if(_0x3c5804){var _0x23231b=typeof _0x7e16cb[_0xa4be('0x22')]==='undefined'&&typeof _0x7e16cb[_0xa4be('0x23')]===_0xa4be('0x24');var _0x4aa365=_0x3c5804[_0xa4be('0x25')];var _0x5d5115=_0x23231b?0x0:_0x7e16cb[_0xa4be('0x22')];var _0x777fd=_0x23231b?_0x3c5804[_0xa4be('0x25')]:_0x7e16cb[_0xa4be('0x22')]+_0x7e16cb['limit'];var _0xde2ad2;if(_0x777fd>=_0x4aa365){_0x777fd=_0x4aa365;_0xde2ad2=0xc8;}else{_0xde2ad2=0xce;}_0x3f9d54[_0xa4be('0x1f')](_0xde2ad2);return _0x3f9d54['set'](_0xa4be('0x26'),_0x5d5115+'-'+_0x777fd+'/'+_0x4aa365)[_0xa4be('0x21')](_0x3c5804);}return null;};}function patchUpdates(_0x3f624e){return function(_0x4b6826){try{jsonpatch['apply'](_0x4b6826,_0x3f624e,!![]);}catch(_0x5db7de){return BPromise['reject'](_0x5db7de);}return _0x4b6826['save']();};}function saveUpdates(_0x433427,_0x4eef6c){return function(_0x2102ae){if(_0x2102ae){return _0x2102ae[_0xa4be('0x27')](_0x433427)[_0xa4be('0x28')](function(_0x945539){return _0x945539;});}return null;};}function handleEntityNotFound(_0x44eecb,_0x18ec41){return function(_0x453f2e){if(!_0x453f2e){_0x44eecb[_0xa4be('0x1e')](0x194);}return _0x453f2e;};}function handleError(_0x3f6cfe,_0x35bf32){_0x35bf32=_0x35bf32||0x1f4;return function(_0x2baaa7){logger[_0xa4be('0x29')](_0x2baaa7[_0xa4be('0x2a')]);if(_0x2baaa7[_0xa4be('0x2b')]){delete _0x2baaa7[_0xa4be('0x2b')];}_0x3f6cfe[_0xa4be('0x1f')](_0x35bf32)[_0xa4be('0x2c')](_0x2baaa7);};}exports['index']=function(_0x22895c,_0x36352f){var _0x30797e={},_0x2900e8={},_0x53e112={'count':0x0,'rows':[]};var _0x11d64=_[_0xa4be('0x2d')](db['Team'][_0xa4be('0x2e')],function(_0x19b267){return{'name':_0x19b267['fieldName'],'type':_0x19b267[_0xa4be('0x2f')][_0xa4be('0x30')]};});_0x2900e8[_0xa4be('0x31')]=_['map'](_0x11d64,_0xa4be('0x2b'));_0x2900e8[_0xa4be('0x32')]=_['keys'](_0x22895c['query']);_0x2900e8[_0xa4be('0x33')]=_[_0xa4be('0x34')](_0x2900e8[_0xa4be('0x31')],_0x2900e8['query']);_0x30797e[_0xa4be('0x35')]=_['intersection'](_0x2900e8[_0xa4be('0x31')],qs[_0xa4be('0x36')](_0x22895c[_0xa4be('0x32')][_0xa4be('0x36')]));_0x30797e[_0xa4be('0x35')]=_0x30797e[_0xa4be('0x35')][_0xa4be('0x37')]?_0x30797e['attributes']:_0x2900e8[_0xa4be('0x31')];if(!_0x22895c[_0xa4be('0x32')][_0xa4be('0x38')](_0xa4be('0x39'))){_0x30797e[_0xa4be('0x23')]=qs[_0xa4be('0x23')](_0x22895c[_0xa4be('0x32')][_0xa4be('0x23')]);_0x30797e[_0xa4be('0x22')]=qs[_0xa4be('0x22')](_0x22895c[_0xa4be('0x32')]['offset']);}_0x30797e[_0xa4be('0x3a')]=qs['sort'](_0x22895c[_0xa4be('0x32')][_0xa4be('0x3b')]);_0x30797e[_0xa4be('0x3c')]=qs[_0xa4be('0x33')](_[_0xa4be('0x3d')](_0x22895c[_0xa4be('0x32')],_0x2900e8[_0xa4be('0x33')]),_0x11d64);if(_0x22895c[_0xa4be('0x32')][_0xa4be('0x3e')]){_0x30797e[_0xa4be('0x3c')]=_[_0xa4be('0x3f')](_0x30797e[_0xa4be('0x3c')],{'$or':_['map'](_0x11d64,function(_0x401e27){if(_0x401e27[_0xa4be('0x2f')]!==_0xa4be('0x40')){var _0xcaba9d={};_0xcaba9d[_0x401e27[_0xa4be('0x2b')]]={'$like':'%'+_0x22895c['query']['filter']+'%'};return _0xcaba9d;}})});}_0x30797e=_[_0xa4be('0x3f')]({},_0x30797e,_0x22895c[_0xa4be('0x41')]);var _0x3d686d={'where':_0x30797e[_0xa4be('0x3c')]};return db[_0xa4be('0x42')]['count'](_0x3d686d)[_0xa4be('0x28')](function(_0x2c4e41){_0x53e112[_0xa4be('0x25')]=_0x2c4e41;if(_0x22895c['query'][_0xa4be('0x43')]){_0x30797e[_0xa4be('0x44')]=[{'all':!![]}];}return db[_0xa4be('0x42')][_0xa4be('0x45')](_0x30797e);})[_0xa4be('0x28')](function(_0x1bb3ae){_0x53e112[_0xa4be('0x46')]=_0x1bb3ae;return _0x53e112;})[_0xa4be('0x28')](respondWithFilteredResult(_0x36352f,_0x30797e))['catch'](handleError(_0x36352f,null));};exports[_0xa4be('0x47')]=function(_0x4a71e3,_0x22c82a){var _0x494721={'raw':![],'where':{'id':_0x4a71e3[_0xa4be('0x48')]['id']}},_0x18da10={};_0x18da10[_0xa4be('0x31')]=_[_0xa4be('0x49')](db[_0xa4be('0x42')][_0xa4be('0x2e')]);_0x18da10['query']=_['keys'](_0x4a71e3[_0xa4be('0x32')]);_0x18da10[_0xa4be('0x33')]=_[_0xa4be('0x34')](_0x18da10[_0xa4be('0x31')],_0x18da10[_0xa4be('0x32')]);_0x494721[_0xa4be('0x35')]=_[_0xa4be('0x34')](_0x18da10[_0xa4be('0x31')],qs[_0xa4be('0x36')](_0x4a71e3[_0xa4be('0x32')]['fields']));_0x494721[_0xa4be('0x35')]=_0x494721[_0xa4be('0x35')][_0xa4be('0x37')]?_0x494721[_0xa4be('0x35')]:_0x18da10[_0xa4be('0x31')];if(_0x4a71e3['query'][_0xa4be('0x43')]){_0x494721[_0xa4be('0x44')]=[{'all':!![]}];}_0x494721=_[_0xa4be('0x3f')]({},_0x494721,_0x4a71e3['options']);return db['Team']['find'](_0x494721)[_0xa4be('0x28')](handleEntityNotFound(_0x22c82a,null))[_0xa4be('0x28')](respondWithResult(_0x22c82a,null))[_0xa4be('0x4a')](handleError(_0x22c82a,null));};exports[_0xa4be('0x4b')]=function(_0x1578d5,_0x513761){return db['Team']['create'](_0x1578d5['body'],{})[_0xa4be('0x28')](function(_0x41734c){var _0x4129c9=_0x1578d5[_0xa4be('0x4c')][_0xa4be('0x4d')]({'plain':!![]});if(!_0x4129c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4129c9['role']===_0xa4be('0x4c')){var _0x2ba309=_0x41734c[_0xa4be('0x4d')]({'plain':!![]});var _0x5bb1b8='Teams';return db[_0xa4be('0x4e')]['find']({'where':{'name':_0x5bb1b8,'userProfileId':_0x4129c9['userProfileId']},'raw':!![]})[_0xa4be('0x28')](function(_0x5a5513){if(_0x5a5513&&_0x5a5513[_0xa4be('0x4f')]===0x0){return db['UserProfileResource'][_0xa4be('0x4b')]({'name':_0x2ba309[_0xa4be('0x2b')],'resourceId':_0x2ba309['id'],'type':_0x5a5513[_0xa4be('0x2b')],'sectionId':_0x5a5513['id']},{})[_0xa4be('0x28')](function(){return _0x41734c;});}else{return _0x41734c;}})[_0xa4be('0x4a')](function(_0x5e68d2){logger['error'](_0xa4be('0x50'),_0x5e68d2);throw _0x5e68d2;});}return _0x41734c;})['then'](respondWithResult(_0x513761,0xc9))[_0xa4be('0x4a')](handleError(_0x513761,null));};exports['update']=function(_0x2a78ed,_0x262882){if(_0x2a78ed[_0xa4be('0x51')]['id']){delete _0x2a78ed[_0xa4be('0x51')]['id'];}return db[_0xa4be('0x42')]['find']({'where':{'id':_0x2a78ed['params']['id']}})[_0xa4be('0x28')](handleEntityNotFound(_0x262882,null))['then'](saveUpdates(_0x2a78ed[_0xa4be('0x51')],null))['then'](respondWithResult(_0x262882,null))['catch'](handleError(_0x262882,null));};exports[_0xa4be('0x52')]=function(_0x3029cd,_0x1cee2c){var _0x2401aa=_0x3029cd[_0xa4be('0x48')]['id'];var _0x206b12=[];return db[_0xa4be('0x53')][_0xa4be('0x54')](function(_0x28d2b1){var _0x33fe74=_0xa4be('0x55')+_0x2401aa;return db[_0xa4be('0x53')][_0xa4be('0x32')](_0x33fe74,{'type':db['Sequelize'][_0xa4be('0x56')][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1})['then'](function(_0x3387b6){_0x206b12=_['map'](_0x3387b6,function(_0x382d82){return Number(_0x382d82[_0xa4be('0x58')]);});})[_0xa4be('0x28')](function(){var _0x38f4ac=_0xa4be('0x59')+_0x2401aa;return db[_0xa4be('0x53')][_0xa4be('0x32')](_0x38f4ac,{'type':db['Sequelize']['QueryTypes'][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(_0x3c5117){var _0x57ad77=_[_0xa4be('0x2d')](_0x3c5117,function(_0x4ec61c){return Number(_0x4ec61c[_0xa4be('0x5a')]);});return db[_0xa4be('0x5b')][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'VoiceQueueId':{'$in':_0x57ad77}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){var _0x18e1a7=_0xa4be('0x5c')+_0x2401aa;return db['sequelize'][_0xa4be('0x32')](_0x18e1a7,{'type':db[_0xa4be('0x5d')][_0xa4be('0x56')]['SELECT'],'raw':!![],'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(_0x250030){var _0x1c617b=_[_0xa4be('0x2d')](_0x250030,function(_0x4bef28){return Number(_0x4bef28[_0xa4be('0x5e')]);});return db['UserMailQueue'][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'MailQueueId':{'$in':_0x1c617b}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){var _0x18f1d6=_0xa4be('0x5f')+_0x2401aa;return db['sequelize'][_0xa4be('0x32')](_0x18f1d6,{'type':db['Sequelize'][_0xa4be('0x56')][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1});})['then'](function(_0x2ac61b){var _0x5cba73=_[_0xa4be('0x2d')](_0x2ac61b,function(_0x4d8adc){return Number(_0x4d8adc['SmsQueueId']);});return db['UserSmsQueue'][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'SmsQueueId':{'$in':_0x5cba73}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){var _0x453de9=_0xa4be('0x60')+_0x2401aa;return db[_0xa4be('0x53')]['query'](_0x453de9,{'type':db[_0xa4be('0x5d')][_0xa4be('0x56')][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1});})['then'](function(_0x433c98){var _0x5da250=_[_0xa4be('0x2d')](_0x433c98,function(_0x74a1d9){return Number(_0x74a1d9[_0xa4be('0x61')]);});return db[_0xa4be('0x62')][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'ChatQueueId':{'$in':_0x5da250}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){var _0x1a292d=_0xa4be('0x63')+_0x2401aa;return db[_0xa4be('0x53')][_0xa4be('0x32')](_0x1a292d,{'type':db[_0xa4be('0x5d')][_0xa4be('0x56')][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(_0x7ec08e){var _0x432b19=_[_0xa4be('0x2d')](_0x7ec08e,function(_0x5ad337){return Number(_0x5ad337[_0xa4be('0x64')]);});return db[_0xa4be('0x65')][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'FaxQueueId':{'$in':_0x432b19}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){var _0x1ecb06=_0xa4be('0x66')+_0x2401aa;return db[_0xa4be('0x53')][_0xa4be('0x32')](_0x1ecb06,{'type':db[_0xa4be('0x5d')][_0xa4be('0x56')][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(_0xf6d270){var _0x4d3163=_[_0xa4be('0x2d')](_0xf6d270,function(_0x6c0b10){return Number(_0x6c0b10[_0xa4be('0x67')]);});return db['UserOpenchannelQueue'][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'OpenchannelQueueId':{'$in':_0x4d3163}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){var _0x33f5f0=_0xa4be('0x68')+_0x2401aa;return db[_0xa4be('0x53')][_0xa4be('0x32')](_0x33f5f0,{'type':db[_0xa4be('0x5d')]['QueryTypes'][_0xa4be('0x57')],'raw':!![],'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(_0x5d84c6){var _0x4fe667=_[_0xa4be('0x2d')](_0x5d84c6,function(_0x23d8b2){return Number(_0x23d8b2[_0xa4be('0x69')]);});return db[_0xa4be('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x206b12},'WhatsappQueueId':{'$in':_0x4fe667}},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){return db[_0xa4be('0x6b')][_0xa4be('0x6c')]({'where':{'TeamId':_0x2401aa}});})['then'](function(_0x3ee191){if(_0x3ee191===null){return;}return db[_0xa4be('0x6d')][_0xa4be('0x52')]({'where':{'UserId':{'$in':_0x206b12},'VoicePrefixId':_0x3ee191[_0xa4be('0x6e')]},'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(){return db[_0xa4be('0x42')][_0xa4be('0x52')]({'where':{'id':_0x2401aa},'cascade':!![],'transaction':_0x28d2b1});})[_0xa4be('0x28')](function(_0x158004){if(_0x158004===0x0){_0x1cee2c[_0xa4be('0x1e')](0x194);}else{return db[_0xa4be('0x6f')][_0xa4be('0x52')]({'where':{'type':'Teams','resourceId':_0x2401aa},'cascade':!![],'transaction':_0x28d2b1})[_0xa4be('0x28')](function(){_0x1cee2c['status'](0xcc)[_0xa4be('0x20')]();});}})['catch'](function(_0x5df4bf){_0x1cee2c['status'](0x1f4)['send'](_0x5df4bf);});});};exports[_0xa4be('0x70')]=function(_0xfad60b,_0x43430e,_0x1bd085){return db[_0xa4be('0x42')][_0xa4be('0x71')]({'where':{'id':_0xfad60b[_0xa4be('0x48')]['id']}})['then'](handleEntityNotFound(_0x43430e,null))[_0xa4be('0x28')](function(_0x2a9ae9){if(!_0xfad60b[_0xa4be('0x32')][_0xa4be('0x72')]||!utils['isValidChannel'](_0xfad60b[_0xa4be('0x32')][_0xa4be('0x72')])){throw new db[(_0xa4be('0x5d'))][(_0xa4be('0x73'))]('Unknown\x20channel');}var _0x533f31={};var _0x180009={};_0x180009[_0xa4be('0x31')]=_[_0xa4be('0x49')](db[_[_0xa4be('0x74')](_0xfad60b[_0xa4be('0x32')][_0xa4be('0x72')]['toLowerCase']())+_0xa4be('0x75')][_0xa4be('0x2e')]);_0x180009[_0xa4be('0x32')]=_['keys'](_0xfad60b[_0xa4be('0x32')]);_0x180009[_0xa4be('0x33')]=_[_0xa4be('0x34')](_0x180009['model'],_0x180009[_0xa4be('0x32')]);_0x533f31[_0xa4be('0x35')]=_[_0xa4be('0x34')](_0x180009[_0xa4be('0x31')],qs[_0xa4be('0x36')](_0xfad60b[_0xa4be('0x32')][_0xa4be('0x36')]));_0x533f31[_0xa4be('0x35')]=_0x533f31[_0xa4be('0x35')][_0xa4be('0x37')]?_0x533f31['attributes']:_0x180009[_0xa4be('0x31')];_0x533f31[_0xa4be('0x23')]=qs['limit'](_0xfad60b[_0xa4be('0x32')]['limit']);_0x533f31[_0xa4be('0x22')]=qs[_0xa4be('0x22')](_0xfad60b[_0xa4be('0x32')][_0xa4be('0x22')]);_0x533f31[_0xa4be('0x3a')]=qs['sort'](_0xfad60b[_0xa4be('0x32')][_0xa4be('0x3b')]);_0x533f31[_0xa4be('0x3c')]=qs[_0xa4be('0x33')](_['pick'](_0xfad60b[_0xa4be('0x32')],_0x180009[_0xa4be('0x33')]));_0x533f31=_[_0xa4be('0x3f')]({},_0x533f31,_0xfad60b[_0xa4be('0x41')]);return _0x2a9ae9[_0xa4be('0x4d')+_['capitalize'](_0xfad60b[_0xa4be('0x32')]['channel']['toLowerCase']())+_0xa4be('0x76')](_0x533f31);})[_0xa4be('0x28')](respondWithResult(_0x43430e,null))[_0xa4be('0x4a')](handleError(_0x43430e,null));};exports['addQueues']=function(_0x221d97,_0x1d58e5,_0x23261b){return db[_0xa4be('0x42')][_0xa4be('0x71')]({'where':{'id':_0x221d97[_0xa4be('0x48')]['id']}})[_0xa4be('0x28')](function(_0x1cd6a9){if(_0x1cd6a9){if(!_0x221d97[_0xa4be('0x51')][_0xa4be('0x72')]||!utils['isValidChannel'](_0x221d97['body'][_0xa4be('0x72')])){throw new db[(_0xa4be('0x5d'))]['ValidationError'](_0xa4be('0x77'));}return _0x1cd6a9[_0xa4be('0x78')+_[_0xa4be('0x74')](_0x221d97[_0xa4be('0x51')]['channel'][_0xa4be('0x79')]())+_0xa4be('0x76')](_0x221d97['body'][_0xa4be('0x7a')]);}return null;})[_0xa4be('0x28')](handleEntityNotFound(_0x1d58e5,null))[_0xa4be('0x28')](respondWithStatusCode(_0x1d58e5,null))['catch'](handleError(_0x1d58e5,null));};exports[_0xa4be('0x7b')]=function(_0x11a4e9,_0x3392aa,_0x9c05bd){return db[_0xa4be('0x42')][_0xa4be('0x71')]({'where':{'id':_0x11a4e9[_0xa4be('0x48')]['id']}})[_0xa4be('0x28')](function(_0x33fc26){if(_0x33fc26){if(!_0x11a4e9[_0xa4be('0x32')][_0xa4be('0x72')]||!utils[_0xa4be('0x7c')](_0x11a4e9[_0xa4be('0x32')]['channel'])){throw new db[(_0xa4be('0x5d'))][(_0xa4be('0x73'))](_0xa4be('0x77'));}return _0x33fc26[_0xa4be('0x7d')+_[_0xa4be('0x74')](_0x11a4e9[_0xa4be('0x32')][_0xa4be('0x72')][_0xa4be('0x79')]())+_0xa4be('0x76')](_0x11a4e9[_0xa4be('0x32')]['ids']);}return null;})[_0xa4be('0x28')](handleEntityNotFound(_0x3392aa,null))[_0xa4be('0x28')](respondWithStatusCode(_0x3392aa,null))[_0xa4be('0x4a')](handleError(_0x3392aa,null));};exports[_0xa4be('0x7e')]=function(_0x158bbb,_0x226ff7){var _0x502351=_[_0xa4be('0x7f')](_0x158bbb[_0xa4be('0x51')]['ids'])?_0x158bbb[_0xa4be('0x51')][_0xa4be('0x7a')]:[_0x158bbb[_0xa4be('0x51')][_0xa4be('0x7a')]];var _0x291387=_0x158bbb['params']['id'];return db[_0xa4be('0x42')][_0xa4be('0x6c')]({'where':{'id':_0x291387}})[_0xa4be('0x28')](handleEntityNotFound(_0x226ff7,null))['then'](function(_0x465709){if(_0x465709){var _0x1a3a4c=['Voice',_0xa4be('0x80'),_0xa4be('0x81'),_0xa4be('0x82'),_0xa4be('0x83'),_0xa4be('0x84'),'Whatsapp'];return db['sequelize'][_0xa4be('0x54')](function(_0x48ef36){var _0x37999b=_[_0xa4be('0x2d')](_0x1a3a4c,function(_0x4ed290){var _0x420714={'attributes':['id',_0xa4be('0x2b')]};if(_0x4ed290===_0xa4be('0x85')){_0x420714[_0xa4be('0x86')]={'attributes':[_0xa4be('0x87')]};}return _0x465709[_0xa4be('0x4d')+_0x4ed290+_0xa4be('0x76')](_0x420714)[_0xa4be('0x28')](function(_0x34573c){var _0x11d867=_[_0xa4be('0x2d')](_0x34573c,function(_0x3eebee){var _0xcca16c=_[_0xa4be('0x2d')](_0x502351,function(_0x4d048d){var _0x37f8fd={'where':{'UserId':_0x4d048d,[_0x4ed290+'QueueId']:_0x3eebee['id']},'transaction':_0x48ef36};if(_0x4ed290==='Voice'){_0x37f8fd[_0xa4be('0x1a')]={'penalty':_0x3eebee[_0xa4be('0x88')][_0xa4be('0x87')]};}return db[_0xa4be('0x89')+_0x4ed290+_0xa4be('0x75')][_0xa4be('0x8a')](_0x37f8fd)[_0xa4be('0x28')](function(){socket['emit']('user'+_0x4ed290+_0xa4be('0x8b'),{'UserId':_0x4d048d,[_0x4ed290+_0xa4be('0x8c')]:_0x3eebee['id']});if(_0x4ed290!==_0xa4be('0x85')){return;}return db[_0xa4be('0x89')][_0xa4be('0x45')]({'where':{'id':_0x502351,'online':0x1},'attributes':['id',_0xa4be('0x2b'),'online','voicePause',_0xa4be('0x8d')],'raw':!![]})['then'](function(_0x203049){var _0x1f2e22=_[_0xa4be('0x2d')](_0x203049,function(_0x193f8a){return db['UserVoiceQueueRt']['upsert']({'membername':_0x193f8a[_0xa4be('0x2b')],'UserId':_0x193f8a['id'],'queue_name':_0x3eebee[_0xa4be('0x2b')],'VoiceQueueId':_0x3eebee['id'],'interface':_[_0xa4be('0x8e')](_0x193f8a[_0xa4be('0x8d')])?util[_0xa4be('0x8f')](_0xa4be('0x90'),_0x193f8a[_0xa4be('0x2b')]):_0x193f8a[_0xa4be('0x8d')],'paused':_0x193f8a[_0xa4be('0x91')]||![],'penalty':_0x3eebee[_0xa4be('0x88')]['penalty']},{'transaction':_0x48ef36});});return Promise[_0xa4be('0x92')](_0x1f2e22);});});});return Promise[_0xa4be('0x92')](_0xcca16c);});return Promise[_0xa4be('0x92')](_0x11d867);})[_0xa4be('0x28')](function(){return db[_0xa4be('0x6b')]['findOne']({'where':{'teamId':_0x291387}})[_0xa4be('0x28')](function(_0x2c50b3){if(_0x2c50b3){var _0x13d28b=_[_0xa4be('0x2d')](_0x502351,function(_0x3e91a4){db[_0xa4be('0x6d')]['upsert']({'UserId':_0x3e91a4,'VoicePrefixId':_0x2c50b3[_0xa4be('0x6e')]});});return Promise[_0xa4be('0x92')](_0x13d28b);}});});});return Promise['all'](_0x37999b)['then'](function(){return _0x465709[_0xa4be('0x7e')](_0x502351,{'transaction':_0x48ef36})['spread'](function(_0x4acf9e){return _0x4acf9e;});});});}})['then'](respondWithResult(_0x226ff7,null))[_0xa4be('0x4a')](handleError(_0x226ff7,null));};exports[_0xa4be('0x93')]=function(_0x224479,_0x4f8ada){var _0x5828af=_[_0xa4be('0x7f')](_0x224479[_0xa4be('0x32')][_0xa4be('0x7a')])?_0x224479[_0xa4be('0x32')][_0xa4be('0x7a')]:[_0x224479['query'][_0xa4be('0x7a')]];var _0x5106b3=_0x224479[_0xa4be('0x48')]['id'];return db[_0xa4be('0x42')][_0xa4be('0x6c')]({'where':{'id':_0x5106b3}})[_0xa4be('0x28')](handleEntityNotFound(_0x4f8ada,null))[_0xa4be('0x28')](function(_0x44bdae){if(_0x44bdae){var _0x2decaa=[_0xa4be('0x85'),'Chat',_0xa4be('0x81'),_0xa4be('0x82'),_0xa4be('0x83'),_0xa4be('0x84'),_0xa4be('0x94')];return db[_0xa4be('0x53')]['transaction'](function(_0x42c6b7){var _0x19ba1c=_[_0xa4be('0x2d')](_0x2decaa,function(_0x19676d){var _0xeae1ea={'attributes':['id',_0xa4be('0x2b')]};return _0x44bdae[_0xa4be('0x4d')+_0x19676d+_0xa4be('0x76')](_0xeae1ea)['then'](function(_0x8171c8){var _0x399db1=_[_0xa4be('0x2d')](_0x8171c8,function(_0x1bdd5a){return _0x1bdd5a[_0xa4be('0x93')](_0x5828af,{'transaction':_0x42c6b7})[_0xa4be('0x28')](function(){var _0xf0de78=_['map'](_0x5828af,function(_0x1cbbb1){socket[_0xa4be('0x95')]('user'+_0x19676d+_0xa4be('0x96'),{'UserId':Number(_0x1cbbb1),[_0x19676d+_0xa4be('0x8c')]:_0x1bdd5a['id']});if(_0x19676d!=='Voice'){return;}return db[_0xa4be('0x97')][_0xa4be('0x52')]({'where':{'VoiceQueueId':_0x1bdd5a['id'],'UserId':_0x1cbbb1},'transaction':_0x42c6b7});});return Promise[_0xa4be('0x92')](_0xf0de78);});});return Promise[_0xa4be('0x92')](_0x399db1);});});return Promise['all'](_0x19ba1c)[_0xa4be('0x28')](function(){return _0x44bdae[_0xa4be('0x93')](_0x5828af,{'transaction':_0x42c6b7});})[_0xa4be('0x28')](function(){return db[_0xa4be('0x6b')][_0xa4be('0x71')]({'where':{'teamId':_0x5106b3}})[_0xa4be('0x28')](function(_0xdeb507){if(_0xdeb507){var _0x39bf28=_['map'](_0x5828af,function(_0x4496c9){db[_0xa4be('0x6d')][_0xa4be('0x52')]({'where':{'UserId':_0x4496c9,'VoicePrefixId':_0xdeb507[_0xa4be('0x6e')]}});});return Promise[_0xa4be('0x92')](_0x39bf28);}});});});}})[_0xa4be('0x28')](respondWithStatusCode(_0x4f8ada,null))['catch'](handleError(_0x4f8ada,null));};exports[_0xa4be('0x98')]=function(_0x3c473d,_0x265391,_0x25d51e){var _0xd363ea={};var _0x562253={};var _0x27843a;var _0xa25c39;return db[_0xa4be('0x42')][_0xa4be('0x71')]({'where':{'id':_0x3c473d[_0xa4be('0x48')]['id']}})['then'](handleEntityNotFound(_0x265391,null))[_0xa4be('0x28')](function(_0x45f1d8){if(_0x45f1d8){_0x27843a=_0x45f1d8;_0x562253['model']=_['keys'](db[_0xa4be('0x89')][_0xa4be('0x2e')]);_0x562253[_0xa4be('0x32')]=_['keys'](_0x3c473d[_0xa4be('0x32')]);_0x562253['filters']=_[_0xa4be('0x34')](_0x562253['model'],_0x562253['query']);_0xd363ea[_0xa4be('0x35')]=_['intersection'](_0x562253[_0xa4be('0x31')],qs[_0xa4be('0x36')](_0x3c473d[_0xa4be('0x32')][_0xa4be('0x36')]));_0xd363ea[_0xa4be('0x35')]=_0xd363ea[_0xa4be('0x35')][_0xa4be('0x37')]?_0xd363ea[_0xa4be('0x35')]:_0x562253[_0xa4be('0x31')];_0xd363ea[_0xa4be('0x3a')]=qs[_0xa4be('0x3b')](_0x3c473d[_0xa4be('0x32')][_0xa4be('0x3b')]);_0xd363ea[_0xa4be('0x3c')]=qs[_0xa4be('0x33')](_['pick'](_0x3c473d[_0xa4be('0x32')],_0x562253[_0xa4be('0x33')]));if(_0x3c473d[_0xa4be('0x32')][_0xa4be('0x3e')]){_0xd363ea[_0xa4be('0x3c')]=_[_0xa4be('0x3f')](_0xd363ea['where'],{'$or':_[_0xa4be('0x2d')](_0xd363ea[_0xa4be('0x35')],function(_0x14522d){var _0x36506c={};_0x36506c[_0x14522d]={'$like':'%'+_0x3c473d['query'][_0xa4be('0x3e')]+'%'};return _0x36506c;})});}_0xd363ea=_[_0xa4be('0x3f')]({},_0xd363ea,_0x3c473d[_0xa4be('0x41')]);return _0x27843a[_0xa4be('0x98')](_0xd363ea);}})[_0xa4be('0x28')](function(_0x124d0b){if(_0x124d0b){_0xa25c39=_0x124d0b[_0xa4be('0x37')];if(!_0x3c473d[_0xa4be('0x32')][_0xa4be('0x38')](_0xa4be('0x39'))){_0xd363ea[_0xa4be('0x23')]=qs['limit'](_0x3c473d[_0xa4be('0x32')][_0xa4be('0x23')]);_0xd363ea['offset']=qs[_0xa4be('0x22')](_0x3c473d[_0xa4be('0x32')][_0xa4be('0x22')]);}return _0x27843a[_0xa4be('0x98')](_0xd363ea);}})[_0xa4be('0x28')](function(_0x3294eb){if(_0x3294eb){return _0x3294eb?{'count':_0xa25c39,'rows':_0x3294eb}:null;}})[_0xa4be('0x28')](respondWithResult(_0x265391,null))[_0xa4be('0x4a')](handleError(_0x265391,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 3b4a0da..377eb9d 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 _0xb390=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x5d4e57,_0x122d59){var _0x5b975f=function(_0xfe9dd9){while(--_0xfe9dd9){_0x5d4e57['push'](_0x5d4e57['shift']());}};_0x5b975f(++_0x122d59);}(_0xb390,0x12d));var _0x0b39=function(_0xc8c6db,_0x380473){_0xc8c6db=_0xc8c6db-0x0;var _0x20d0f8=_0xb390[_0xc8c6db];return _0x20d0f8;};'use strict';var EventEmitter=require(_0x0b39('0x0'));var Team=require(_0x0b39('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b39('0x2'),'afterUpdate':'update','afterDestroy':_0x0b39('0x3')};function emitEvent(_0x418b03){return function(_0x369538,_0xd43ae1,_0x33901f){TeamEvents[_0x0b39('0x4')](_0x418b03+':'+_0x369538['id'],_0x369538);TeamEvents['emit'](_0x418b03,_0x369538);_0x33901f(null);};}for(var e in events){if(events[_0x0b39('0x5')](e)){var event=events[e];Team[_0x0b39('0x6')](e,emitEvent(event));}}module[_0x0b39('0x7')]=TeamEvents; \ No newline at end of file +var _0xaf2a=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners','update'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xaf2a,0xca));var _0xaaf2=function(_0xf456d5,_0x2350a5){_0xf456d5=_0xf456d5-0x0;var _0x158bfe=_0xaf2a[_0xf456d5];return _0x158bfe;};'use strict';var EventEmitter=require(_0xaaf2('0x0'));var Team=require(_0xaaf2('0x1'))['db'][_0xaaf2('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xaaf2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaaf2('0x4'),'afterDestroy':_0xaaf2('0x5')};function emitEvent(_0x57a6a9){return function(_0x29657e,_0x2885cc,_0x240f3c){TeamEvents[_0xaaf2('0x6')](_0x57a6a9+':'+_0x29657e['id'],_0x29657e);TeamEvents[_0xaaf2('0x6')](_0x57a6a9,_0x29657e);_0x240f3c(null);};}for(var e in events){if(events[_0xaaf2('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xaaf2('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d5a9899..d5180f4 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 _0xeda5=['teams','Chat','Fax','Mail','Sms','Voice','Whatsapp','all','catch','lodash','./team.attributes','Queues','then','map','setDataValue','channel','exports','Team'];(function(_0x2dff35,_0x3d7600){var _0x1279ae=function(_0x365b42){while(--_0x365b42){_0x2dff35['push'](_0x2dff35['shift']());}};_0x1279ae(++_0x3d7600);}(_0xeda5,0x15f));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5eda('0x0'));var attributes=require(_0x5eda('0x1'));function getQueuesByChannel(_0x4b718c,_0x3e95ee){var _0xfa0534='get'+_0x3e95ee+_0x5eda('0x2');return _0x4b718c[_0xfa0534]()[_0x5eda('0x3')](function(_0x5c523e){return _[_0x5eda('0x4')](_0x5c523e,function(_0x1e698f){_0x1e698f[_0x5eda('0x5')](_0x5eda('0x6'),_0x3e95ee);return _0x1e698f;});})['catch'](function(_0x32676f){throw _0x32676f;});}module[_0x5eda('0x7')]=function(_0xe390b6){return _0xe390b6['define'](_0x5eda('0x8'),attributes,{'tableName':_0x5eda('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5dcb46=this;var _0x8dafa6=[_0x5eda('0xa'),_0x5eda('0xb'),_0x5eda('0xc'),'Openchannel',_0x5eda('0xd'),_0x5eda('0xe'),_0x5eda('0xf')];return Promise['resolve']()[_0x5eda('0x3')](function(){var _0x4b8744=_[_0x5eda('0x4')](_0x8dafa6,function(_0x56028c){return getQueuesByChannel(_0x5dcb46,_0x56028c);});return Promise[_0x5eda('0x10')](_0x4b8744);})[_0x5eda('0x11')](function(_0x7f88fb){throw _0x7f88fb;});}}});}; \ No newline at end of file +var _0xbc7f=['Mail','Openchannel','Sms','Voice','Whatsapp','resolve','lodash','./team.attributes','get','Queues','map','setDataValue','channel','exports','define','Team','teams','Chat','Fax'];(function(_0x24994d,_0x5dd114){var _0x1a3545=function(_0x49c6c9){while(--_0x49c6c9){_0x24994d['push'](_0x24994d['shift']());}};_0x1a3545(++_0x5dd114);}(_0xbc7f,0x1a8));var _0xfbc7=function(_0x2b15f6,_0x52fff5){_0x2b15f6=_0x2b15f6-0x0;var _0x22f5b0=_0xbc7f[_0x2b15f6];return _0x22f5b0;};'use strict';var _=require(_0xfbc7('0x0'));var attributes=require(_0xfbc7('0x1'));function getQueuesByChannel(_0x1d8b60,_0xe184d1){var _0x33cc5d=_0xfbc7('0x2')+_0xe184d1+_0xfbc7('0x3');return _0x1d8b60[_0x33cc5d]()['then'](function(_0xc1f734){return _[_0xfbc7('0x4')](_0xc1f734,function(_0x388b03){_0x388b03[_0xfbc7('0x5')](_0xfbc7('0x6'),_0xe184d1);return _0x388b03;});})['catch'](function(_0x21503a){throw _0x21503a;});}module[_0xfbc7('0x7')]=function(_0x307d52){return _0x307d52[_0xfbc7('0x8')](_0xfbc7('0x9'),attributes,{'tableName':_0xfbc7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2b6027=this;var _0x571d93=[_0xfbc7('0xb'),_0xfbc7('0xc'),_0xfbc7('0xd'),_0xfbc7('0xe'),_0xfbc7('0xf'),_0xfbc7('0x10'),_0xfbc7('0x11')];return Promise[_0xfbc7('0x12')]()['then'](function(){var _0x2578eb=_[_0xfbc7('0x4')](_0x571d93,function(_0x421a94){return getQueuesByChannel(_0x2b6027,_0x421a94);});return Promise['all'](_0x2578eb);})['catch'](function(_0x13a7c6){throw _0x13a7c6;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 7cba602..432ca75 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 _0x6e56=['localhost','socket.io-emitter','./team.socket','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x6e56,0x17d));var _0x66e5=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x6e56[_0x1fc18b];return _0x16a351;};'use strict';var _=require('lodash');var util=require(_0x66e5('0x0'));var moment=require('moment');var BPromise=require(_0x66e5('0x1'));var rs=require(_0x66e5('0x2'));var fs=require('fs');var Redis=require(_0x66e5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x66e5('0x4'));var logger=require(_0x66e5('0x5'))('rpc');var config=require(_0x66e5('0x6'));var jayson=require(_0x66e5('0x7'));var client=jayson['client'][_0x66e5('0x8')]({'port':0x232a});config[_0x66e5('0x9')]=_['defaults'](config['redis'],{'host':_0x66e5('0xa'),'port':0x18eb});var socket=require(_0x66e5('0xb'))(new Redis(config[_0x66e5('0x9')]));require(_0x66e5('0xc'))['register'](socket);function respondWithRpcPromise(_0x45f82a,_0x55a5c7,_0x52600d){return new BPromise(function(_0x38beaa,_0xfd2a0c){return client['request'](_0x45f82a,_0x52600d)['then'](function(_0x37df57){logger[_0x66e5('0xd')](_0x66e5('0xe'),_0x55a5c7,_0x66e5('0xf'));logger[_0x66e5('0x10')](_0x66e5('0x11'),_0x55a5c7,_0x66e5('0xf'),JSON['stringify'](_0x37df57));if(_0x37df57[_0x66e5('0x12')]){if(_0x37df57[_0x66e5('0x12')][_0x66e5('0x13')]===0x1f4){logger[_0x66e5('0x12')]('Team,\x20%s,\x20%s',_0x55a5c7,_0x37df57[_0x66e5('0x12')][_0x66e5('0x14')]);return _0xfd2a0c(_0x37df57[_0x66e5('0x12')][_0x66e5('0x14')]);}logger[_0x66e5('0x12')](_0x66e5('0xe'),_0x55a5c7,_0x37df57['error'][_0x66e5('0x14')]);return _0x38beaa(_0x37df57[_0x66e5('0x12')][_0x66e5('0x14')]);}else{logger[_0x66e5('0xd')](_0x66e5('0xe'),_0x55a5c7,_0x66e5('0xf'));_0x38beaa(_0x37df57[_0x66e5('0x15')]['message']);}})[_0x66e5('0x16')](function(_0x37ddde){logger[_0x66e5('0x12')](_0x66e5('0xe'),_0x55a5c7,_0x37ddde);_0xfd2a0c(_0x37ddde);});});} \ No newline at end of file +var _0x641f=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket','then','info','Team,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x641f,0x83));var _0xf641=function(_0x24a40b,_0x587494){_0x24a40b=_0x24a40b-0x0;var _0x4b4ab8=_0x641f[_0x24a40b];return _0x4b4ab8;};'use strict';var _=require(_0xf641('0x0'));var util=require(_0xf641('0x1'));var moment=require(_0xf641('0x2'));var BPromise=require(_0xf641('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf641('0x4'));var db=require(_0xf641('0x5'))['db'];var utils=require(_0xf641('0x6'));var logger=require(_0xf641('0x7'))(_0xf641('0x8'));var config=require(_0xf641('0x9'));var jayson=require(_0xf641('0xa'));var client=jayson[_0xf641('0xb')][_0xf641('0xc')]({'port':0x232a});config[_0xf641('0xd')]=_[_0xf641('0xe')](config[_0xf641('0xd')],{'host':_0xf641('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf641('0x10'))['register'](socket);function respondWithRpcPromise(_0x31d203,_0x40f7d3,_0x481da8){return new BPromise(function(_0x34b556,_0x3ebb71){return client['request'](_0x31d203,_0x481da8)[_0xf641('0x11')](function(_0x4abbc1){logger[_0xf641('0x12')](_0xf641('0x13'),_0x40f7d3,'request\x20sent');logger[_0xf641('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x40f7d3,_0xf641('0x15'),JSON[_0xf641('0x16')](_0x4abbc1));if(_0x4abbc1[_0xf641('0x17')]){if(_0x4abbc1[_0xf641('0x17')][_0xf641('0x18')]===0x1f4){logger[_0xf641('0x17')]('Team,\x20%s,\x20%s',_0x40f7d3,_0x4abbc1[_0xf641('0x17')][_0xf641('0x19')]);return _0x3ebb71(_0x4abbc1[_0xf641('0x17')]['message']);}logger[_0xf641('0x17')](_0xf641('0x13'),_0x40f7d3,_0x4abbc1[_0xf641('0x17')][_0xf641('0x19')]);return _0x34b556(_0x4abbc1[_0xf641('0x17')][_0xf641('0x19')]);}else{logger['info'](_0xf641('0x13'),_0x40f7d3,'request\x20sent');_0x34b556(_0x4abbc1[_0xf641('0x1a')][_0xf641('0x19')]);}})[_0xf641('0x1b')](function(_0x483aa4){logger['error'](_0xf641('0x13'),_0x40f7d3,_0x483aa4);_0x3ebb71(_0x483aa4);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4135bb9..e75e431 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 _0x7be1=['emit','length','team:','./team.events','save','remove'];(function(_0x145912,_0x2a7df5){var _0x5c8d6b=function(_0x477308){while(--_0x477308){_0x145912['push'](_0x145912['shift']());}};_0x5c8d6b(++_0x2a7df5);}(_0x7be1,0x165));var _0x17be=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0x7be1[_0x4f3e33];return _0x1a070c;};'use strict';var TeamEvents=require(_0x17be('0x0'));var events=[_0x17be('0x1'),_0x17be('0x2'),'update'];function createListener(_0x295843,_0x343ec5){return function(_0x740a8){_0x343ec5[_0x17be('0x3')](_0x295843,_0x740a8);};}function removeListener(_0x2bc9ed,_0x4b46fd){return function(){TeamEvents['removeListener'](_0x2bc9ed,_0x4b46fd);};}exports['register']=function(_0x2fed12){for(var _0x40f3f9=0x0,_0x4f5b0c=events[_0x17be('0x4')];_0x40f3f9<_0x4f5b0c;_0x40f3f9++){var _0x23f19f=events[_0x40f3f9];var _0x2c74b2=createListener(_0x17be('0x5')+_0x23f19f,_0x2fed12);TeamEvents['on'](_0x23f19f,_0x2c74b2);}}; \ No newline at end of file +var _0xdcb9=['remove','update','removeListener','register','team:','./team.events'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0xdcb9,0xa7));var _0x9dcb=function(_0x45e8b4,_0x4c4e9a){_0x45e8b4=_0x45e8b4-0x0;var _0x1566f4=_0xdcb9[_0x45e8b4];return _0x1566f4;};'use strict';var TeamEvents=require(_0x9dcb('0x0'));var events=['save',_0x9dcb('0x1'),_0x9dcb('0x2')];function createListener(_0x54d7af,_0x396477){return function(_0x556d03){_0x396477['emit'](_0x54d7af,_0x556d03);};}function removeListener(_0x5b842e,_0x35841a){return function(){TeamEvents[_0x9dcb('0x3')](_0x5b842e,_0x35841a);};}exports[_0x9dcb('0x4')]=function(_0x15ee97){for(var _0x4f9b4c=0x0,_0x1a364f=events['length'];_0x4f9b4c<_0x1a364f;_0x4f9b4c++){var _0x25f844=events[_0x4f9b4c];var _0x578700=createListener(_0x9dcb('0x5')+_0x25f844,_0x15ee97);TeamEvents['on'](_0x25f844,_0x578700);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index d9e5398..065437c 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 _0x5455=['INTEGER','exports'];(function(_0x855b81,_0x12af5c){var _0x288aaa=function(_0xfa648){while(--_0xfa648){_0x855b81['push'](_0x855b81['shift']());}};_0x288aaa(++_0x12af5c);}(_0x5455,0x17b));var _0x5545=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5455[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0x5545('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x5545('0x1')]}}; \ No newline at end of file +var _0x82b0=['sequelize','exports','INTEGER'];(function(_0x271a21,_0x40555e){var _0x825d3e=function(_0xe0100){while(--_0xe0100){_0x271a21['push'](_0x271a21['shift']());}};_0x825d3e(++_0x40555e);}(_0x82b0,0x81));var _0x082b=function(_0x304bd5,_0xea943d){_0x304bd5=_0x304bd5-0x0;var _0x2bcd87=_0x82b0[_0x304bd5];return _0x2bcd87;};'use strict';var Sequelize=require(_0x082b('0x0'));module[_0x082b('0x1')]={'TeamId':{'type':Sequelize[_0x082b('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 0f71d2b..6a5d2d9 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 _0x2deb=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','team_has_voice_prefixes','lodash'];(function(_0x5b31a2,_0x595d2a){var _0x405580=function(_0x38fa35){while(--_0x38fa35){_0x5b31a2['push'](_0x5b31a2['shift']());}};_0x405580(++_0x595d2a);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x201fcc,_0x2ed8ec){return _0x201fcc[_0xb2de('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0xb2de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3276=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','team_has_voice_prefixes','lodash'];(function(_0x5bf465,_0x261834){var _0x2fa4e1=function(_0x4453ea){while(--_0x4453ea){_0x5bf465['push'](_0x5bf465['shift']());}};_0x2fa4e1(++_0x261834);}(_0x3276,0xc7));var _0x6327=function(_0xec4477,_0x22a4ed){_0xec4477=_0xec4477-0x0;var _0x58ed11=_0x3276[_0xec4477];return _0x58ed11;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0x6327('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5d25960..cc50222 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2bea17,_0x21fa58){var _0x4dba93=function(_0x36662d){while(--_0x36662d){_0x2bea17['push'](_0x2bea17['shift']());}};_0x4dba93(++_0x21fa58);}(_0xe706,0xa3));var _0x6e70=function(_0x345a1b,_0x189c9e){_0x345a1b=_0x345a1b-0x0;var _0x1b24ec=_0xe706[_0x345a1b];return _0x1b24ec;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x8234f,_0x46f87a){var _0x4592ba=function(_0x5784b6){while(--_0x5784b6){_0x8234f['push'](_0x8234f['shift']());}};_0x4592ba(++_0x46f87a);}(_0x70e0,0x17b));var _0x070e=function(_0x348f5d,_0x4e81b7){_0x348f5d=_0x348f5d-0x0;var _0x3d8d88=_0x70e0[_0x348f5d];return _0x3d8d88;};'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 43b9eb8..5b49b6c 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 _0x04b1=['exports','INTEGER','sequelize'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x04b1,0x98));var _0x104b=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x04b1[_0x503ffd];return _0x160437;};'use strict';var Sequelize=require(_0x104b('0x0'));module[_0x104b('0x1')]={'penalty':{'type':Sequelize[_0x104b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa182=['INTEGER','exports'];(function(_0x24edc0,_0xfe9038){var _0x9d03e5=function(_0x8a2368){while(--_0x8a2368){_0x24edc0['push'](_0x24edc0['shift']());}};_0x9d03e5(++_0xfe9038);}(_0xa182,0x1d5));var _0x2a18=function(_0x183cd5,_0x59c3bb){_0x183cd5=_0x183cd5-0x0;var _0x55fa87=_0xa182[_0x183cd5];return _0x55fa87;};'use strict';var Sequelize=require('sequelize');module[_0x2a18('0x0')]={'penalty':{'type':Sequelize[_0x2a18('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 0526486..889ed94 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 _0xd847=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x4989fe,_0x201e34){var _0x4afd24=function(_0x3bb870){while(--_0x3bb870){_0x4989fe['push'](_0x4989fe['shift']());}};_0x4afd24(++_0x201e34);}(_0xd847,0x18a));var _0x7d84=function(_0x198a7c,_0x2a5d76){_0x198a7c=_0x198a7c-0x0;var _0x11f926=_0xd847[_0x198a7c];return _0x11f926;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var logger=require(_0x7d84('0x2'))(_0x7d84('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d84('0x4'));var fs=require('fs');var path=require(_0x7d84('0x5'));var rimraf=require(_0x7d84('0x6'));var config=require(_0x7d84('0x7'));var attributes=require(_0x7d84('0x8'));module['exports']=function(_0x1544e7,_0x5d8f76){return _0x1544e7[_0x7d84('0x9')](_0x7d84('0xa'),attributes,{'tableName':_0x7d84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea1a=['path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x276009,_0x37624b){var _0x9ebe29=function(_0x1ed661){while(--_0x1ed661){_0x276009['push'](_0x276009['shift']());}};_0x9ebe29(++_0x37624b);}(_0xea1a,0x158));var _0xaea1=function(_0x86761c,_0x205187){_0x86761c=_0x86761c-0x0;var _0x763ca0=_0xea1a[_0x86761c];return _0x763ca0;};'use strict';var _=require(_0xaea1('0x0'));var util=require(_0xaea1('0x1'));var logger=require(_0xaea1('0x2'))(_0xaea1('0x3'));var moment=require('moment');var BPromise=require(_0xaea1('0x4'));var rp=require(_0xaea1('0x5'));var fs=require('fs');var path=require(_0xaea1('0x6'));var rimraf=require(_0xaea1('0x7'));var config=require(_0xaea1('0x8'));var attributes=require(_0xaea1('0x9'));module[_0xaea1('0xa')]=function(_0x246ebc,_0x5208c7){return _0x246ebc[_0xaea1('0xb')](_0xaea1('0xc'),attributes,{'tableName':_0xaea1('0xd'),'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 022ff38..15870cb 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 _0xd976=['moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','info','result','catch','lodash'];(function(_0x1082f6,_0x58fe4d){var _0x38a227=function(_0x1e99d2){while(--_0x1e99d2){_0x1082f6['push'](_0x1082f6['shift']());}};_0x38a227(++_0x58fe4d);}(_0xd976,0x179));var _0x6d97=function(_0x4b1231,_0x2cbbf8){_0x4b1231=_0x4b1231-0x0;var _0x4ad463=_0xd976[_0x4b1231];return _0x4ad463;};'use strict';var _=require(_0x6d97('0x0'));var util=require('util');var moment=require(_0x6d97('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d97('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d97('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d97('0x4'))('rpc');var config=require(_0x6d97('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6d97('0x6')][_0x6d97('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x42d3d6,_0x86d252,_0x59674a){return new BPromise(function(_0x278b96,_0x10e4c9){return client[_0x6d97('0x8')](_0x42d3d6,_0x59674a)[_0x6d97('0x9')](function(_0x4fc19a){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x86d252,_0x6d97('0xa'));logger[_0x6d97('0xb')](_0x6d97('0xc'),_0x86d252,_0x6d97('0xa'),JSON[_0x6d97('0xd')](_0x4fc19a));if(_0x4fc19a[_0x6d97('0xe')]){if(_0x4fc19a[_0x6d97('0xe')][_0x6d97('0xf')]===0x1f4){logger[_0x6d97('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x86d252,_0x4fc19a[_0x6d97('0xe')][_0x6d97('0x10')]);return _0x10e4c9(_0x4fc19a[_0x6d97('0xe')]['message']);}logger[_0x6d97('0xe')](_0x6d97('0x11'),_0x86d252,_0x4fc19a['error'][_0x6d97('0x10')]);return _0x278b96(_0x4fc19a[_0x6d97('0xe')]['message']);}else{logger[_0x6d97('0x12')](_0x6d97('0x11'),_0x86d252,_0x6d97('0xa'));_0x278b96(_0x4fc19a[_0x6d97('0x13')][_0x6d97('0x10')]);}})[_0x6d97('0x14')](function(_0x47bcdd){logger[_0x6d97('0xe')](_0x6d97('0x11'),_0x86d252,_0x47bcdd);_0x10e4c9(_0x47bcdd);});});} \ No newline at end of file +var _0xd5e4=['info','debug','request\x20sent','stringify','code','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x414806,_0x12a8c2){var _0x14e039=function(_0x40fb9c){while(--_0x40fb9c){_0x414806['push'](_0x414806['shift']());}};_0x14e039(++_0x12a8c2);}(_0xd5e4,0x8e));var _0x4d5e=function(_0x4577ce,_0x2b6616){_0x4577ce=_0x4577ce-0x0;var _0x3213e5=_0xd5e4[_0x4577ce];return _0x3213e5;};'use strict';var _=require(_0x4d5e('0x0'));var util=require(_0x4d5e('0x1'));var moment=require('moment');var BPromise=require(_0x4d5e('0x2'));var rs=require(_0x4d5e('0x3'));var fs=require('fs');var Redis=require(_0x4d5e('0x4'));var db=require(_0x4d5e('0x5'))['db'];var utils=require(_0x4d5e('0x6'));var logger=require('../../config/logger')(_0x4d5e('0x7'));var config=require(_0x4d5e('0x8'));var jayson=require(_0x4d5e('0x9'));var client=jayson[_0x4d5e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x408d51,_0x1a73fe,_0x28e2ca){return new BPromise(function(_0x583a3a,_0x7cacd1){return client['request'](_0x408d51,_0x28e2ca)[_0x4d5e('0xb')](function(_0x5a8186){logger[_0x4d5e('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1a73fe,'request\x20sent');logger[_0x4d5e('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1a73fe,_0x4d5e('0xe'),JSON[_0x4d5e('0xf')](_0x5a8186));if(_0x5a8186['error']){if(_0x5a8186['error'][_0x4d5e('0x10')]===0x1f4){logger[_0x4d5e('0x11')](_0x4d5e('0x12'),_0x1a73fe,_0x5a8186[_0x4d5e('0x11')]['message']);return _0x7cacd1(_0x5a8186[_0x4d5e('0x11')][_0x4d5e('0x13')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x1a73fe,_0x5a8186[_0x4d5e('0x11')][_0x4d5e('0x13')]);return _0x583a3a(_0x5a8186[_0x4d5e('0x11')][_0x4d5e('0x13')]);}else{logger[_0x4d5e('0xc')](_0x4d5e('0x12'),_0x1a73fe,_0x4d5e('0xe'));_0x583a3a(_0x5a8186[_0x4d5e('0x14')]['message']);}})[_0x4d5e('0x15')](function(_0x4b03e1){logger[_0x4d5e('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1a73fe,_0x4b03e1);_0x7cacd1(_0x4b03e1);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 64a9e72..2e55989 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 _0x0760=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','multer'];(function(_0xcc3225,_0x3798b8){var _0x3c2db7=function(_0x1a88d7){while(--_0x1a88d7){_0xcc3225['push'](_0xcc3225['shift']());}};_0x3c2db7(++_0x3798b8);}(_0x0760,0xa9));var _0x0076=function(_0x4f9acb,_0x2d9b1d){_0x4f9acb=_0x4f9acb-0x0;var _0x363dcd=_0x0760[_0x4f9acb];return _0x363dcd;};'use strict';var multer=require(_0x0076('0x0'));var util=require('util');var path=require(_0x0076('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0076('0x2'));var auth=require(_0x0076('0x3'));var interaction=require(_0x0076('0x4'));var config=require(_0x0076('0x5'));var controller=require(_0x0076('0x6'));router['get']('/',auth[_0x0076('0x7')](),controller[_0x0076('0x8')]);router[_0x0076('0x9')](_0x0076('0xa'),auth[_0x0076('0x7')](),controller['show']);router[_0x0076('0xb')]('/',auth['isAuthenticated'](),controller[_0x0076('0xc')]);router[_0x0076('0xd')]('/:id',auth[_0x0076('0x7')](),controller[_0x0076('0xe')]);router[_0x0076('0xf')](_0x0076('0xa'),auth[_0x0076('0x7')](),controller[_0x0076('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd916=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./template.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd916,0x18a));var _0x6d91=function(_0x450479,_0x212b3a){_0x450479=_0x450479-0x0;var _0x332be8=_0xd916[_0x450479];return _0x332be8;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var fs_extra=require(_0x6d91('0x5'));var auth=require(_0x6d91('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d91('0x7'));router[_0x6d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d91('0x9')]);router[_0x6d91('0x8')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0xc')]);router[_0x6d91('0xd')]('/',auth[_0x6d91('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6d91('0xe')]);router[_0x6d91('0xf')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index d95a8f3..71a81e2 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 _0x18d1=['STRING'];(function(_0x565b5d,_0x4af4db){var _0x525efe=function(_0x14cbba){while(--_0x14cbba){_0x565b5d['push'](_0x565b5d['shift']());}};_0x525efe(++_0x4af4db);}(_0x18d1,0x184));var _0x118d=function(_0x2c17cf,_0x59d779){_0x2c17cf=_0x2c17cf-0x0;var _0x511869=_0x18d1[_0x2c17cf];return _0x511869;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x118d('0x0')]},'description':{'type':Sequelize[_0x118d('0x0')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xceac=['STRING','TEXT','exports'];(function(_0x49b5e8,_0x49f37a){var _0x54c5e3=function(_0x21c235){while(--_0x21c235){_0x49b5e8['push'](_0x49b5e8['shift']());}};_0x54c5e3(++_0x49f37a);}(_0xceac,0x1cd));var _0xccea=function(_0x5a0f5d,_0x3ecc15){_0x5a0f5d=_0x5a0f5d-0x0;var _0x702e=_0xceac[_0x5a0f5d];return _0x702e;};'use strict';var Sequelize=require('sequelize');module[_0xccea('0x0')]={'name':{'type':Sequelize[_0xccea('0x1')]},'description':{'type':Sequelize[_0xccea('0x1')]},'html':{'type':Sequelize[_0xccea('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b2889c4..ed5555d 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 _0xe10d=['Template','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','Templates','UserProfileResource','error','stack','name','index'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0xe10d,0x81));var _0xde10=function(_0x3566d5,_0x566a39){_0x3566d5=_0x3566d5-0x0;var _0x5ea0ce=_0xe10d[_0x3566d5];return _0x5ea0ce;};'use strict';var emlformat=require(_0xde10('0x0'));var rimraf=require(_0xde10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde10('0x2'));var moment=require('moment');var BPromise=require(_0xde10('0x3'));var Mustache=require(_0xde10('0x4'));var util=require(_0xde10('0x5'));var path=require(_0xde10('0x6'));var sox=require(_0xde10('0x7'));var csv=require('to-csv');var ejs=require(_0xde10('0x8'));var fs=require('fs');var fs_extra=require(_0xde10('0x9'));var _=require(_0xde10('0xa'));var squel=require(_0xde10('0xb'));var crypto=require(_0xde10('0xc'));var jsforce=require(_0xde10('0xd'));var deskjs=require(_0xde10('0xe'));var toCsv=require(_0xde10('0xf'));var querystring=require(_0xde10('0x10'));var Papa=require(_0xde10('0x11'));var Redis=require(_0xde10('0x12'));var authService=require(_0xde10('0x13'));var qs=require(_0xde10('0x14'));var as=require(_0xde10('0x15'));var hardwareService=require(_0xde10('0x16'));var logger=require(_0xde10('0x17'))(_0xde10('0x18'));var utils=require(_0xde10('0x19'));var config=require(_0xde10('0x1a'));var licenseUtil=require(_0xde10('0x1b'));var db=require(_0xde10('0x1c'))['db'];function respondWithStatusCode(_0x4bde85,_0x199064){_0x199064=_0x199064||0xcc;return function(_0x33cb25){if(_0x33cb25){return _0x4bde85[_0xde10('0x1d')](_0x199064);}return _0x4bde85[_0xde10('0x1e')](_0x199064)[_0xde10('0x1f')]();};}function respondWithResult(_0x3bcb02,_0x4bf1fc){_0x4bf1fc=_0x4bf1fc||0xc8;return function(_0x754373){if(_0x754373){return _0x3bcb02[_0xde10('0x1e')](_0x4bf1fc)[_0xde10('0x20')](_0x754373);}};}function respondWithFilteredResult(_0x145655,_0x32b14c){return function(_0x3d25a3){if(_0x3d25a3){var _0x357d72=typeof _0x32b14c[_0xde10('0x21')]===_0xde10('0x22')&&typeof _0x32b14c[_0xde10('0x23')]==='undefined';var _0x3eaaa3=_0x3d25a3[_0xde10('0x24')];var _0x5ef2c4=_0x357d72?0x0:_0x32b14c[_0xde10('0x21')];var _0x183f1b=_0x357d72?_0x3d25a3[_0xde10('0x24')]:_0x32b14c[_0xde10('0x21')]+_0x32b14c[_0xde10('0x23')];var _0x3b36af;if(_0x183f1b>=_0x3eaaa3){_0x183f1b=_0x3eaaa3;_0x3b36af=0xc8;}else{_0x3b36af=0xce;}_0x145655[_0xde10('0x1e')](_0x3b36af);return _0x145655[_0xde10('0x25')]('Content-Range',_0x5ef2c4+'-'+_0x183f1b+'/'+_0x3eaaa3)[_0xde10('0x20')](_0x3d25a3);}return null;};}function patchUpdates(_0x3fe6a6){return function(_0x287042){try{jsonpatch[_0xde10('0x26')](_0x287042,_0x3fe6a6,!![]);}catch(_0x1fe85d){return BPromise[_0xde10('0x27')](_0x1fe85d);}return _0x287042['save']();};}function saveUpdates(_0x52e477,_0x74ffca){return function(_0x29177f){if(_0x29177f){return _0x29177f[_0xde10('0x28')](_0x52e477)[_0xde10('0x29')](function(_0x2a0c62){return _0x2a0c62;});}return null;};}function removeEntity(_0x1a61ba,_0x2b3d4c){return function(_0x416a02){if(_0x416a02){return _0x416a02[_0xde10('0x2a')]()[_0xde10('0x29')](function(){var _0x1bee61=_0x416a02['get']({'plain':!![]});var _0x1cfe63=_0xde10('0x2b');return db[_0xde10('0x2c')][_0xde10('0x2a')]({'where':{'type':_0x1cfe63,'resourceId':_0x1bee61['id']}})['then'](function(){return _0x416a02;});})['then'](function(){_0x1a61ba[_0xde10('0x1e')](0xcc)[_0xde10('0x1f')]();});}};}function handleEntityNotFound(_0x441e77,_0x197883){return function(_0x38e0dd){if(!_0x38e0dd){_0x441e77[_0xde10('0x1d')](0x194);}return _0x38e0dd;};}function handleError(_0xd5cd2c,_0x550ed2){_0x550ed2=_0x550ed2||0x1f4;return function(_0x3b3048){logger[_0xde10('0x2d')](_0x3b3048[_0xde10('0x2e')]);if(_0x3b3048[_0xde10('0x2f')]){delete _0x3b3048[_0xde10('0x2f')];}_0xd5cd2c[_0xde10('0x1e')](_0x550ed2)['send'](_0x3b3048);};}exports[_0xde10('0x30')]=function(_0x2261a7,_0x52b189){var _0x121bdb={},_0x1734da={},_0x30a771={'count':0x0,'rows':[]};var _0x7317e7=_['map'](db[_0xde10('0x31')][_0xde10('0x32')],function(_0x1c6a92){return{'name':_0x1c6a92[_0xde10('0x33')],'type':_0x1c6a92[_0xde10('0x34')][_0xde10('0x35')]};});_0x1734da[_0xde10('0x36')]=_[_0xde10('0x37')](_0x7317e7,_0xde10('0x2f'));_0x1734da[_0xde10('0x38')]=_[_0xde10('0x39')](_0x2261a7[_0xde10('0x38')]);_0x1734da[_0xde10('0x3a')]=_[_0xde10('0x3b')](_0x1734da['model'],_0x1734da['query']);_0x121bdb[_0xde10('0x3c')]=_[_0xde10('0x3b')](_0x1734da[_0xde10('0x36')],qs[_0xde10('0x3d')](_0x2261a7['query'][_0xde10('0x3d')]));_0x121bdb[_0xde10('0x3c')]=_0x121bdb[_0xde10('0x3c')][_0xde10('0x3e')]?_0x121bdb[_0xde10('0x3c')]:_0x1734da[_0xde10('0x36')];if(!_0x2261a7[_0xde10('0x38')][_0xde10('0x3f')](_0xde10('0x40'))){_0x121bdb[_0xde10('0x23')]=qs[_0xde10('0x23')](_0x2261a7[_0xde10('0x38')][_0xde10('0x23')]);_0x121bdb[_0xde10('0x21')]=qs[_0xde10('0x21')](_0x2261a7['query'][_0xde10('0x21')]);}_0x121bdb[_0xde10('0x41')]=qs[_0xde10('0x42')](_0x2261a7[_0xde10('0x38')][_0xde10('0x42')]);_0x121bdb[_0xde10('0x43')]=qs[_0xde10('0x3a')](_[_0xde10('0x44')](_0x2261a7[_0xde10('0x38')],_0x1734da['filters']),_0x7317e7);if(_0x2261a7[_0xde10('0x38')]['filter']){_0x121bdb['where']=_[_0xde10('0x45')](_0x121bdb[_0xde10('0x43')],{'$or':_[_0xde10('0x37')](_0x7317e7,function(_0xf7f63){if(_0xf7f63[_0xde10('0x34')]!==_0xde10('0x46')){var _0x1d5bb6={};_0x1d5bb6[_0xf7f63[_0xde10('0x2f')]]={'$like':'%'+_0x2261a7[_0xde10('0x38')][_0xde10('0x47')]+'%'};return _0x1d5bb6;}})});}_0x121bdb=_['merge']({},_0x121bdb,_0x2261a7[_0xde10('0x48')]);var _0x2ce2a0={'where':_0x121bdb[_0xde10('0x43')]};return db[_0xde10('0x31')][_0xde10('0x24')](_0x2ce2a0)[_0xde10('0x29')](function(_0x141e5c){_0x30a771[_0xde10('0x24')]=_0x141e5c;if(_0x2261a7[_0xde10('0x38')][_0xde10('0x49')]){_0x121bdb[_0xde10('0x4a')]=[{'all':!![]}];}return db[_0xde10('0x31')][_0xde10('0x4b')](_0x121bdb);})[_0xde10('0x29')](function(_0x5b9e53){_0x30a771['rows']=_0x5b9e53;return _0x30a771;})[_0xde10('0x29')](respondWithFilteredResult(_0x52b189,_0x121bdb))[_0xde10('0x4c')](handleError(_0x52b189,null));};exports[_0xde10('0x4d')]=function(_0x18f21a,_0x59882b){var _0x39bbee={'raw':!![],'where':{'id':_0x18f21a['params']['id']}},_0x339156={};_0x339156[_0xde10('0x36')]=_[_0xde10('0x39')](db['Template'][_0xde10('0x32')]);_0x339156[_0xde10('0x38')]=_[_0xde10('0x39')](_0x18f21a[_0xde10('0x38')]);_0x339156[_0xde10('0x3a')]=_[_0xde10('0x3b')](_0x339156[_0xde10('0x36')],_0x339156[_0xde10('0x38')]);_0x39bbee[_0xde10('0x3c')]=_[_0xde10('0x3b')](_0x339156['model'],qs[_0xde10('0x3d')](_0x18f21a[_0xde10('0x38')][_0xde10('0x3d')]));_0x39bbee['attributes']=_0x39bbee[_0xde10('0x3c')][_0xde10('0x3e')]?_0x39bbee[_0xde10('0x3c')]:_0x339156[_0xde10('0x36')];if(_0x18f21a['query']['includeAll']){_0x39bbee[_0xde10('0x4a')]=[{'all':!![]}];}_0x39bbee=_[_0xde10('0x45')]({},_0x39bbee,_0x18f21a[_0xde10('0x48')]);return db[_0xde10('0x31')][_0xde10('0x4e')](_0x39bbee)[_0xde10('0x29')](handleEntityNotFound(_0x59882b,null))[_0xde10('0x29')](respondWithResult(_0x59882b,null))[_0xde10('0x4c')](handleError(_0x59882b,null));};exports[_0xde10('0x4f')]=function(_0x2b26f3,_0x397149){return db[_0xde10('0x31')][_0xde10('0x4f')](_0x2b26f3[_0xde10('0x50')],{})['then'](function(_0x2e491b){var _0x5b79c0=_0x2b26f3[_0xde10('0x51')][_0xde10('0x52')]({'plain':!![]});if(!_0x5b79c0)throw new Error(_0xde10('0x53'));if(_0x5b79c0[_0xde10('0x54')]===_0xde10('0x51')){var _0xc78e3d=_0x2e491b[_0xde10('0x52')]({'plain':!![]});var _0x514bb1=_0xde10('0x2b');return db[_0xde10('0x55')]['find']({'where':{'name':_0x514bb1,'userProfileId':_0x5b79c0['userProfileId']},'raw':!![]})[_0xde10('0x29')](function(_0x59237f){if(_0x59237f&&_0x59237f[_0xde10('0x56')]===0x0){return db[_0xde10('0x2c')][_0xde10('0x4f')]({'name':_0xc78e3d['name'],'resourceId':_0xc78e3d['id'],'type':_0x59237f[_0xde10('0x2f')],'sectionId':_0x59237f['id']},{})[_0xde10('0x29')](function(){return _0x2e491b;});}else{return _0x2e491b;}})[_0xde10('0x4c')](function(_0x3edc10){logger[_0xde10('0x2d')](_0xde10('0x57'),_0x3edc10);throw _0x3edc10;});}return _0x2e491b;})['then'](respondWithResult(_0x397149,0xc9))[_0xde10('0x4c')](handleError(_0x397149,null));};exports[_0xde10('0x28')]=function(_0x528bdc,_0x1f53d1){if(_0x528bdc[_0xde10('0x50')]['id']){delete _0x528bdc[_0xde10('0x50')]['id'];}return db[_0xde10('0x31')][_0xde10('0x4e')]({'where':{'id':_0x528bdc[_0xde10('0x58')]['id']}})[_0xde10('0x29')](handleEntityNotFound(_0x1f53d1,null))[_0xde10('0x29')](saveUpdates(_0x528bdc[_0xde10('0x50')],null))['then'](respondWithResult(_0x1f53d1,null))[_0xde10('0x4c')](handleError(_0x1f53d1,null));};exports[_0xde10('0x2a')]=function(_0x4d0c36,_0x1e6cc4){return db[_0xde10('0x31')][_0xde10('0x4e')]({'where':{'id':_0x4d0c36[_0xde10('0x58')]['id']}})[_0xde10('0x29')](handleEntityNotFound(_0x1e6cc4,null))[_0xde10('0x29')](removeEntity(_0x1e6cc4,null))[_0xde10('0x4c')](handleError(_0x1e6cc4,null));}; \ No newline at end of file +var _0x2727=['UserProfileResource','destroy','error','stack','name','index','map','Template','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','options','includeAll','findAll','catch','show','params','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Templates'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2727,0x11a));var _0x7272=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2727[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7272('0x0'));var zipdir=require(_0x7272('0x1'));var jsonpatch=require(_0x7272('0x2'));var rp=require(_0x7272('0x3'));var moment=require(_0x7272('0x4'));var BPromise=require(_0x7272('0x5'));var Mustache=require(_0x7272('0x6'));var util=require(_0x7272('0x7'));var path=require(_0x7272('0x8'));var sox=require(_0x7272('0x9'));var csv=require(_0x7272('0xa'));var ejs=require(_0x7272('0xb'));var fs=require('fs');var fs_extra=require(_0x7272('0xc'));var _=require(_0x7272('0xd'));var squel=require(_0x7272('0xe'));var crypto=require(_0x7272('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7272('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7272('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7272('0x11'));var hardwareService=require(_0x7272('0x12'));var logger=require(_0x7272('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7272('0x14'));var db=require(_0x7272('0x15'))['db'];function respondWithStatusCode(_0x51a20e,_0x548000){_0x548000=_0x548000||0xcc;return function(_0x4247cf){if(_0x4247cf){return _0x51a20e[_0x7272('0x16')](_0x548000);}return _0x51a20e[_0x7272('0x17')](_0x548000)[_0x7272('0x18')]();};}function respondWithResult(_0x5374f5,_0x34ace7){_0x34ace7=_0x34ace7||0xc8;return function(_0x3c78ba){if(_0x3c78ba){return _0x5374f5[_0x7272('0x17')](_0x34ace7)[_0x7272('0x19')](_0x3c78ba);}};}function respondWithFilteredResult(_0x1f6c98,_0x2727f0){return function(_0x1e8343){if(_0x1e8343){var _0x18a691=typeof _0x2727f0['offset']===_0x7272('0x1a')&&typeof _0x2727f0['limit']===_0x7272('0x1a');var _0x14559c=_0x1e8343[_0x7272('0x1b')];var _0x1bf2a0=_0x18a691?0x0:_0x2727f0[_0x7272('0x1c')];var _0x474014=_0x18a691?_0x1e8343[_0x7272('0x1b')]:_0x2727f0[_0x7272('0x1c')]+_0x2727f0['limit'];var _0x28088a;if(_0x474014>=_0x14559c){_0x474014=_0x14559c;_0x28088a=0xc8;}else{_0x28088a=0xce;}_0x1f6c98[_0x7272('0x17')](_0x28088a);return _0x1f6c98[_0x7272('0x1d')](_0x7272('0x1e'),_0x1bf2a0+'-'+_0x474014+'/'+_0x14559c)[_0x7272('0x19')](_0x1e8343);}return null;};}function patchUpdates(_0x26c4d9){return function(_0x5aaf30){try{jsonpatch[_0x7272('0x1f')](_0x5aaf30,_0x26c4d9,!![]);}catch(_0x912527){return BPromise[_0x7272('0x20')](_0x912527);}return _0x5aaf30[_0x7272('0x21')]();};}function saveUpdates(_0x4c9aad,_0x3b4d97){return function(_0x8d04a0){if(_0x8d04a0){return _0x8d04a0[_0x7272('0x22')](_0x4c9aad)[_0x7272('0x23')](function(_0x13d18c){return _0x13d18c;});}return null;};}function removeEntity(_0x16f256,_0x4434f5){return function(_0x1911de){if(_0x1911de){return _0x1911de['destroy']()[_0x7272('0x23')](function(){var _0x16342b=_0x1911de[_0x7272('0x24')]({'plain':!![]});var _0x267b1d=_0x7272('0x25');return db[_0x7272('0x26')][_0x7272('0x27')]({'where':{'type':_0x267b1d,'resourceId':_0x16342b['id']}})[_0x7272('0x23')](function(){return _0x1911de;});})[_0x7272('0x23')](function(){_0x16f256['status'](0xcc)[_0x7272('0x18')]();});}};}function handleEntityNotFound(_0x1d7264,_0x2daf5d){return function(_0x27a250){if(!_0x27a250){_0x1d7264['sendStatus'](0x194);}return _0x27a250;};}function handleError(_0xd6d759,_0xa9023c){_0xa9023c=_0xa9023c||0x1f4;return function(_0x3d1233){logger[_0x7272('0x28')](_0x3d1233[_0x7272('0x29')]);if(_0x3d1233[_0x7272('0x2a')]){delete _0x3d1233[_0x7272('0x2a')];}_0xd6d759['status'](_0xa9023c)['send'](_0x3d1233);};}exports[_0x7272('0x2b')]=function(_0x2fc117,_0x5629d8){var _0x5295bf={},_0x3481d4={},_0x427b4f={'count':0x0,'rows':[]};var _0x4e3860=_[_0x7272('0x2c')](db[_0x7272('0x2d')][_0x7272('0x2e')],function(_0x26c061){return{'name':_0x26c061[_0x7272('0x2f')],'type':_0x26c061['type']['key']};});_0x3481d4[_0x7272('0x30')]=_[_0x7272('0x2c')](_0x4e3860,'name');_0x3481d4['query']=_[_0x7272('0x31')](_0x2fc117['query']);_0x3481d4[_0x7272('0x32')]=_[_0x7272('0x33')](_0x3481d4[_0x7272('0x30')],_0x3481d4[_0x7272('0x34')]);_0x5295bf[_0x7272('0x35')]=_[_0x7272('0x33')](_0x3481d4[_0x7272('0x30')],qs[_0x7272('0x36')](_0x2fc117['query'][_0x7272('0x36')]));_0x5295bf[_0x7272('0x35')]=_0x5295bf[_0x7272('0x35')][_0x7272('0x37')]?_0x5295bf[_0x7272('0x35')]:_0x3481d4['model'];if(!_0x2fc117[_0x7272('0x34')][_0x7272('0x38')](_0x7272('0x39'))){_0x5295bf[_0x7272('0x3a')]=qs[_0x7272('0x3a')](_0x2fc117[_0x7272('0x34')][_0x7272('0x3a')]);_0x5295bf[_0x7272('0x1c')]=qs[_0x7272('0x1c')](_0x2fc117[_0x7272('0x34')][_0x7272('0x1c')]);}_0x5295bf[_0x7272('0x3b')]=qs[_0x7272('0x3c')](_0x2fc117[_0x7272('0x34')][_0x7272('0x3c')]);_0x5295bf['where']=qs['filters'](_['pick'](_0x2fc117['query'],_0x3481d4[_0x7272('0x32')]),_0x4e3860);if(_0x2fc117[_0x7272('0x34')][_0x7272('0x3d')]){_0x5295bf[_0x7272('0x3e')]=_[_0x7272('0x3f')](_0x5295bf[_0x7272('0x3e')],{'$or':_['map'](_0x4e3860,function(_0xbb9120){if(_0xbb9120[_0x7272('0x40')]!=='VIRTUAL'){var _0x22b5fb={};_0x22b5fb[_0xbb9120[_0x7272('0x2a')]]={'$like':'%'+_0x2fc117['query']['filter']+'%'};return _0x22b5fb;}})});}_0x5295bf=_[_0x7272('0x3f')]({},_0x5295bf,_0x2fc117[_0x7272('0x41')]);var _0x43cc74={'where':_0x5295bf[_0x7272('0x3e')]};return db[_0x7272('0x2d')][_0x7272('0x1b')](_0x43cc74)[_0x7272('0x23')](function(_0x32f1bd){_0x427b4f[_0x7272('0x1b')]=_0x32f1bd;if(_0x2fc117[_0x7272('0x34')][_0x7272('0x42')]){_0x5295bf['include']=[{'all':!![]}];}return db[_0x7272('0x2d')][_0x7272('0x43')](_0x5295bf);})[_0x7272('0x23')](function(_0x3ddefb){_0x427b4f['rows']=_0x3ddefb;return _0x427b4f;})[_0x7272('0x23')](respondWithFilteredResult(_0x5629d8,_0x5295bf))[_0x7272('0x44')](handleError(_0x5629d8,null));};exports[_0x7272('0x45')]=function(_0x53e76b,_0x3f29ae){var _0x2a3080={'raw':!![],'where':{'id':_0x53e76b[_0x7272('0x46')]['id']}},_0x5e9042={};_0x5e9042[_0x7272('0x30')]=_[_0x7272('0x31')](db[_0x7272('0x2d')][_0x7272('0x2e')]);_0x5e9042[_0x7272('0x34')]=_[_0x7272('0x31')](_0x53e76b['query']);_0x5e9042[_0x7272('0x32')]=_['intersection'](_0x5e9042[_0x7272('0x30')],_0x5e9042[_0x7272('0x34')]);_0x2a3080[_0x7272('0x35')]=_[_0x7272('0x33')](_0x5e9042[_0x7272('0x30')],qs[_0x7272('0x36')](_0x53e76b[_0x7272('0x34')][_0x7272('0x36')]));_0x2a3080[_0x7272('0x35')]=_0x2a3080['attributes']['length']?_0x2a3080[_0x7272('0x35')]:_0x5e9042['model'];if(_0x53e76b[_0x7272('0x34')][_0x7272('0x42')]){_0x2a3080[_0x7272('0x47')]=[{'all':!![]}];}_0x2a3080=_[_0x7272('0x3f')]({},_0x2a3080,_0x53e76b[_0x7272('0x41')]);return db[_0x7272('0x2d')][_0x7272('0x48')](_0x2a3080)['then'](handleEntityNotFound(_0x3f29ae,null))['then'](respondWithResult(_0x3f29ae,null))['catch'](handleError(_0x3f29ae,null));};exports[_0x7272('0x49')]=function(_0x2ff594,_0x21b305){return db[_0x7272('0x2d')]['create'](_0x2ff594[_0x7272('0x4a')],{})[_0x7272('0x23')](function(_0x3bbcbd){var _0x3e8062=_0x2ff594[_0x7272('0x4b')][_0x7272('0x24')]({'plain':!![]});if(!_0x3e8062)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e8062['role']===_0x7272('0x4b')){var _0x12e6ac=_0x3bbcbd[_0x7272('0x24')]({'plain':!![]});var _0x2c85e3='Templates';return db[_0x7272('0x4c')]['find']({'where':{'name':_0x2c85e3,'userProfileId':_0x3e8062[_0x7272('0x4d')]},'raw':!![]})[_0x7272('0x23')](function(_0x71d947){if(_0x71d947&&_0x71d947[_0x7272('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x12e6ac[_0x7272('0x2a')],'resourceId':_0x12e6ac['id'],'type':_0x71d947[_0x7272('0x2a')],'sectionId':_0x71d947['id']},{})[_0x7272('0x23')](function(){return _0x3bbcbd;});}else{return _0x3bbcbd;}})[_0x7272('0x44')](function(_0x30f4c7){logger['error'](_0x7272('0x4f'),_0x30f4c7);throw _0x30f4c7;});}return _0x3bbcbd;})[_0x7272('0x23')](respondWithResult(_0x21b305,0xc9))[_0x7272('0x44')](handleError(_0x21b305,null));};exports[_0x7272('0x22')]=function(_0x380bee,_0xa8c632){if(_0x380bee[_0x7272('0x4a')]['id']){delete _0x380bee[_0x7272('0x4a')]['id'];}return db['Template'][_0x7272('0x48')]({'where':{'id':_0x380bee[_0x7272('0x46')]['id']}})[_0x7272('0x23')](handleEntityNotFound(_0xa8c632,null))[_0x7272('0x23')](saveUpdates(_0x380bee[_0x7272('0x4a')],null))[_0x7272('0x23')](respondWithResult(_0xa8c632,null))[_0x7272('0x44')](handleError(_0xa8c632,null));};exports[_0x7272('0x27')]=function(_0x24d2ad,_0x222869){return db[_0x7272('0x2d')][_0x7272('0x48')]({'where':{'id':_0x24d2ad[_0x7272('0x46')]['id']}})[_0x7272('0x23')](handleEntityNotFound(_0x222869,null))[_0x7272('0x23')](removeEntity(_0x222869,null))[_0x7272('0x44')](handleError(_0x222869,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 945c66f..d265983 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 _0x0a2c=['Template','tools_templates','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x17141f,_0x4d7c4b){var _0x3ee900=function(_0x5ec0f4){while(--_0x5ec0f4){_0x17141f['push'](_0x17141f['shift']());}};_0x3ee900(++_0x4d7c4b);}(_0x0a2c,0xb6));var _0xc0a2=function(_0x433dc6,_0x576727){_0x433dc6=_0x433dc6-0x0;var _0x246077=_0x0a2c[_0x433dc6];return _0x246077;};'use strict';var _=require(_0xc0a2('0x0'));var util=require(_0xc0a2('0x1'));var logger=require('../../config/logger')(_0xc0a2('0x2'));var moment=require(_0xc0a2('0x3'));var BPromise=require(_0xc0a2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0a2('0x5'));var rimraf=require(_0xc0a2('0x6'));var config=require(_0xc0a2('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x293c3b,_0x2ffe9f){return _0x293c3b['define'](_0xc0a2('0x8'),attributes,{'tableName':_0xc0a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd90e=['path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x298642,_0x46ab91){var _0x4216d6=function(_0x10e81d){while(--_0x10e81d){_0x298642['push'](_0x298642['shift']());}};_0x4216d6(++_0x46ab91);}(_0xd90e,0x1f1));var _0xed90=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd90e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xed90('0x0'));var util=require(_0xed90('0x1'));var logger=require(_0xed90('0x2'))(_0xed90('0x3'));var moment=require(_0xed90('0x4'));var BPromise=require(_0xed90('0x5'));var rp=require(_0xed90('0x6'));var fs=require('fs');var path=require(_0xed90('0x7'));var rimraf=require(_0xed90('0x8'));var config=require('../../config/environment');var attributes=require(_0xed90('0x9'));module[_0xed90('0xa')]=function(_0x44e050,_0xe88eb1){return _0x44e050[_0xed90('0xb')](_0xed90('0xc'),attributes,{'tableName':_0xed90('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index aabd048..e9df71a 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 _0xf077=['options','raw','where','attributes','limit','model','include','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetTemplate','Template','findAll'];(function(_0x2fa32e,_0x58dc3e){var _0xaf8068=function(_0x18284d){while(--_0x18284d){_0x2fa32e['push'](_0x2fa32e['shift']());}};_0xaf8068(++_0x58dc3e);}(_0xf077,0x17f));var _0x7f07=function(_0x315618,_0x19b729){_0x315618=_0x315618-0x0;var _0x15412a=_0xf077[_0x315618];return _0x15412a;};'use strict';var _=require(_0x7f07('0x0'));var util=require('util');var moment=require(_0x7f07('0x1'));var BPromise=require(_0x7f07('0x2'));var rs=require(_0x7f07('0x3'));var fs=require('fs');var Redis=require(_0x7f07('0x4'));var db=require(_0x7f07('0x5'))['db'];var utils=require(_0x7f07('0x6'));var logger=require(_0x7f07('0x7'))('rpc');var config=require(_0x7f07('0x8'));var jayson=require(_0x7f07('0x9'));var client=jayson[_0x7f07('0xa')][_0x7f07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34234f,_0x58da4d,_0x398408){return new BPromise(function(_0x18c2d7,_0x2ec859){return client['request'](_0x34234f,_0x398408)[_0x7f07('0xc')](function(_0x2723e8){logger[_0x7f07('0xd')](_0x7f07('0xe'),_0x58da4d,_0x7f07('0xf'));logger[_0x7f07('0x10')](_0x7f07('0x11'),_0x58da4d,_0x7f07('0xf'),JSON[_0x7f07('0x12')](_0x2723e8));if(_0x2723e8[_0x7f07('0x13')]){if(_0x2723e8['error']['code']===0x1f4){logger[_0x7f07('0x13')](_0x7f07('0xe'),_0x58da4d,_0x2723e8[_0x7f07('0x13')]['message']);return _0x2ec859(_0x2723e8[_0x7f07('0x13')]['message']);}logger[_0x7f07('0x13')](_0x7f07('0xe'),_0x58da4d,_0x2723e8[_0x7f07('0x13')]['message']);return _0x18c2d7(_0x2723e8[_0x7f07('0x13')][_0x7f07('0x14')]);}else{logger[_0x7f07('0xd')](_0x7f07('0xe'),_0x58da4d,'request\x20sent');_0x18c2d7(_0x2723e8[_0x7f07('0x15')][_0x7f07('0x14')]);}})['catch'](function(_0x5f0174){logger['error']('Template,\x20%s,\x20%s',_0x58da4d,_0x5f0174);_0x2ec859(_0x5f0174);});});}exports[_0x7f07('0x16')]=function(_0x1be86c){var _0xbb0d90=this;return new Promise(function(_0x3b3047,_0x45a644){return db[_0x7f07('0x17')][_0x7f07('0x18')]({'raw':_0x1be86c[_0x7f07('0x19')]?_0x1be86c[_0x7f07('0x19')][_0x7f07('0x1a')]===undefined?!![]:![]:!![],'where':_0x1be86c['options']?_0x1be86c[_0x7f07('0x19')][_0x7f07('0x1b')]||null:null,'attributes':_0x1be86c[_0x7f07('0x19')]?_0x1be86c[_0x7f07('0x19')][_0x7f07('0x1c')]||null:null,'limit':_0x1be86c['options']?_0x1be86c[_0x7f07('0x19')][_0x7f07('0x1d')]||null:null,'include':_0x1be86c[_0x7f07('0x19')]?_0x1be86c['options']['include']?_['map'](_0x1be86c['options']['include'],function(_0x4d812e){return{'model':db[_0x4d812e[_0x7f07('0x1e')]],'as':_0x4d812e['as'],'attributes':_0x4d812e[_0x7f07('0x1c')],'include':_0x4d812e[_0x7f07('0x1f')]?_[_0x7f07('0x20')](_0x4d812e[_0x7f07('0x1f')],function(_0x1a7ade){return{'model':db[_0x1a7ade['model']],'as':_0x1a7ade['as'],'attributes':_0x1a7ade[_0x7f07('0x1c')],'include':_0x1a7ade[_0x7f07('0x1f')]?_[_0x7f07('0x20')](_0x1a7ade['include'],function(_0x5b70c1){return{'model':db[_0x5b70c1[_0x7f07('0x1e')]],'as':_0x5b70c1['as'],'attributes':_0x5b70c1[_0x7f07('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37be83){logger[_0x7f07('0xd')](_0x7f07('0x16'),_0x1be86c);logger[_0x7f07('0x10')](_0x7f07('0x16'),_0x1be86c,JSON[_0x7f07('0x12')](_0x37be83));_0x3b3047(_0x37be83);})[_0x7f07('0x21')](function(_0x21ccb6){logger[_0x7f07('0x13')](_0x7f07('0x16'),_0x21ccb6[_0x7f07('0x14')],_0x1be86c);_0x45a644(_0xbb0d90[_0x7f07('0x13')](0x1f4,_0x21ccb6[_0x7f07('0x14')]));});});}; \ No newline at end of file +var _0x64a4=['include','attributes','model','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','raw','options','where','limit','map'];(function(_0xeb442a,_0x3949c5){var _0x1b2bd8=function(_0x3beb31){while(--_0x3beb31){_0xeb442a['push'](_0xeb442a['shift']());}};_0x1b2bd8(++_0x3949c5);}(_0x64a4,0x1d2));var _0x464a=function(_0x573b76,_0x3fcca8){_0x573b76=_0x573b76-0x0;var _0x22e32c=_0x64a4[_0x573b76];return _0x22e32c;};'use strict';var _=require(_0x464a('0x0'));var util=require(_0x464a('0x1'));var moment=require('moment');var BPromise=require(_0x464a('0x2'));var rs=require(_0x464a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x464a('0x4'))['db'];var utils=require(_0x464a('0x5'));var logger=require(_0x464a('0x6'))(_0x464a('0x7'));var config=require(_0x464a('0x8'));var jayson=require(_0x464a('0x9'));var client=jayson['client'][_0x464a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b3f51,_0xa4e3a1,_0x265dee){return new BPromise(function(_0x4a9757,_0x127582){return client[_0x464a('0xb')](_0x5b3f51,_0x265dee)[_0x464a('0xc')](function(_0x41cbd6){logger[_0x464a('0xd')](_0x464a('0xe'),_0xa4e3a1,_0x464a('0xf'));logger['debug'](_0x464a('0x10'),_0xa4e3a1,_0x464a('0xf'),JSON[_0x464a('0x11')](_0x41cbd6));if(_0x41cbd6[_0x464a('0x12')]){if(_0x41cbd6['error'][_0x464a('0x13')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0xa4e3a1,_0x41cbd6[_0x464a('0x12')][_0x464a('0x14')]);return _0x127582(_0x41cbd6['error']['message']);}logger['error'](_0x464a('0xe'),_0xa4e3a1,_0x41cbd6['error'][_0x464a('0x14')]);return _0x4a9757(_0x41cbd6[_0x464a('0x12')][_0x464a('0x14')]);}else{logger[_0x464a('0xd')]('Template,\x20%s,\x20%s',_0xa4e3a1,'request\x20sent');_0x4a9757(_0x41cbd6['result']['message']);}})[_0x464a('0x15')](function(_0x1fe58a){logger[_0x464a('0x12')](_0x464a('0xe'),_0xa4e3a1,_0x1fe58a);_0x127582(_0x1fe58a);});});}exports[_0x464a('0x16')]=function(_0x3d86d1){var _0x567051=this;return new Promise(function(_0x495a1b,_0x4468ca){return db[_0x464a('0x17')]['findAll']({'raw':_0x3d86d1['options']?_0x3d86d1['options'][_0x464a('0x18')]===undefined?!![]:![]:!![],'where':_0x3d86d1[_0x464a('0x19')]?_0x3d86d1['options'][_0x464a('0x1a')]||null:null,'attributes':_0x3d86d1['options']?_0x3d86d1[_0x464a('0x19')]['attributes']||null:null,'limit':_0x3d86d1['options']?_0x3d86d1['options'][_0x464a('0x1b')]||null:null,'include':_0x3d86d1[_0x464a('0x19')]?_0x3d86d1[_0x464a('0x19')]['include']?_[_0x464a('0x1c')](_0x3d86d1[_0x464a('0x19')][_0x464a('0x1d')],function(_0x243788){return{'model':db[_0x243788['model']],'as':_0x243788['as'],'attributes':_0x243788['attributes'],'include':_0x243788['include']?_['map'](_0x243788[_0x464a('0x1d')],function(_0x2bef5e){return{'model':db[_0x2bef5e['model']],'as':_0x2bef5e['as'],'attributes':_0x2bef5e[_0x464a('0x1e')],'include':_0x2bef5e[_0x464a('0x1d')]?_[_0x464a('0x1c')](_0x2bef5e[_0x464a('0x1d')],function(_0x4b8d71){return{'model':db[_0x4b8d71[_0x464a('0x1f')]],'as':_0x4b8d71['as'],'attributes':_0x4b8d71['attributes']};}):[]};}):[]};}):[]:[]})[_0x464a('0xc')](function(_0x415a0f){logger['info'](_0x464a('0x16'),_0x3d86d1);logger[_0x464a('0x20')](_0x464a('0x16'),_0x3d86d1,JSON[_0x464a('0x11')](_0x415a0f));_0x495a1b(_0x415a0f);})[_0x464a('0x15')](function(_0x1a8fb4){logger[_0x464a('0x12')](_0x464a('0x16'),_0x1a8fb4[_0x464a('0x14')],_0x3d86d1);_0x4468ca(_0x567051['error'](0x1f4,_0x1a8fb4['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index c4078b7..381beba 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 _0x4bb0=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/any_conditions','addAction','put'];(function(_0x3720a6,_0x1439b6){var _0x6ff0f4=function(_0x432941){while(--_0x432941){_0x3720a6['push'](_0x3720a6['shift']());}};_0x6ff0f4(++_0x1439b6);}(_0x4bb0,0x73));var _0x04bb=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x4bb0[_0x236c89];return _0x3b2a15;};'use strict';var multer=require(_0x04bb('0x0'));var util=require(_0x04bb('0x1'));var path=require(_0x04bb('0x2'));var timeout=require(_0x04bb('0x3'));var express=require(_0x04bb('0x4'));var router=express[_0x04bb('0x5')]();var fs_extra=require(_0x04bb('0x6'));var auth=require(_0x04bb('0x7'));var interaction=require(_0x04bb('0x8'));var config=require(_0x04bb('0x9'));var controller=require(_0x04bb('0xa'));router['get']('/',auth[_0x04bb('0xb')](),controller[_0x04bb('0xc')]);router[_0x04bb('0xd')](_0x04bb('0xe'),auth[_0x04bb('0xb')](),controller[_0x04bb('0xf')]);router[_0x04bb('0xd')](_0x04bb('0x10'),auth[_0x04bb('0xb')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0x04bb('0xb')](),controller[_0x04bb('0x11')]);router[_0x04bb('0xd')](_0x04bb('0x12'),auth['isAuthenticated'](),controller[_0x04bb('0x13')]);router[_0x04bb('0x14')]('/',auth['isAuthenticated'](),controller[_0x04bb('0x15')]);router[_0x04bb('0x14')](_0x04bb('0x10'),auth[_0x04bb('0xb')](),controller['addAllCondition']);router[_0x04bb('0x14')](_0x04bb('0x16'),auth[_0x04bb('0xb')](),controller['addAnyCondition']);router['post'](_0x04bb('0x12'),auth[_0x04bb('0xb')](),controller[_0x04bb('0x17')]);router[_0x04bb('0x18')](_0x04bb('0xe'),auth['isAuthenticated'](),controller[_0x04bb('0x19')]);router[_0x04bb('0x1a')](_0x04bb('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x04bb('0x1b')]=router; \ No newline at end of file +var _0x047f=['get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','post','addAllCondition','addAnyCondition','/:id/actions','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x253095,_0x33ca26){var _0x1b08f1=function(_0x1a940a){while(--_0x1a940a){_0x253095['push'](_0x253095['shift']());}};_0x1b08f1(++_0x33ca26);}(_0x047f,0xfc));var _0xf047=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x047f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf047('0x0'));var util=require(_0xf047('0x1'));var path=require(_0xf047('0x2'));var timeout=require(_0xf047('0x3'));var express=require('express');var router=express[_0xf047('0x4')]();var fs_extra=require(_0xf047('0x5'));var auth=require(_0xf047('0x6'));var interaction=require(_0xf047('0x7'));var config=require(_0xf047('0x8'));var controller=require('./trigger.controller');router[_0xf047('0x9')]('/',auth['isAuthenticated'](),controller[_0xf047('0xa')]);router[_0xf047('0x9')](_0xf047('0xb'),auth[_0xf047('0xc')](),controller[_0xf047('0xd')]);router[_0xf047('0x9')](_0xf047('0xe'),auth['isAuthenticated'](),controller[_0xf047('0xf')]);router['get'](_0xf047('0x10'),auth[_0xf047('0xc')](),controller[_0xf047('0x11')]);router[_0xf047('0x9')]('/:id/actions',auth[_0xf047('0xc')](),controller[_0xf047('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf047('0x13')]);router[_0xf047('0x14')]('/:id/all_conditions',auth[_0xf047('0xc')](),controller[_0xf047('0x15')]);router['post'](_0xf047('0x10'),auth[_0xf047('0xc')](),controller[_0xf047('0x16')]);router[_0xf047('0x14')](_0xf047('0x17'),auth[_0xf047('0xc')](),controller[_0xf047('0x18')]);router[_0xf047('0x19')](_0xf047('0xb'),auth[_0xf047('0xc')](),controller['update']);router[_0xf047('0x1a')](_0xf047('0xb'),auth[_0xf047('0xc')](),controller[_0xf047('0x1b')]);module[_0xf047('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e93060d..e7c78bb 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 _0x8349=['exports','STRING','BOOLEAN','sequelize'];(function(_0x77afe6,_0x4953f4){var _0xdc9c4a=function(_0x50ec7b){while(--_0x50ec7b){_0x77afe6['push'](_0x77afe6['shift']());}};_0xdc9c4a(++_0x4953f4);}(_0x8349,0x1ef));var _0x9834=function(_0x314f95,_0x33f646){_0x314f95=_0x314f95-0x0;var _0x397feb=_0x8349[_0x314f95];return _0x397feb;};'use strict';var Sequelize=require(_0x9834('0x0'));module[_0x9834('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9834('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9834('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8ef=['sequelize','exports','STRING'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0xf8ef,0x114));var _0xff8e=function(_0x2f1904,_0x22646f){_0x2f1904=_0x2f1904-0x0;var _0x3e6354=_0xf8ef[_0x2f1904];return _0x3e6354;};'use strict';var Sequelize=require(_0xff8e('0x0'));module[_0xff8e('0x1')]={'name':{'type':Sequelize[_0xff8e('0x2')]},'channel':{'type':Sequelize[_0xff8e('0x2')]},'description':{'type':Sequelize['STRING']},'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 19a13b5..6b5171a 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 _0x3c17=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','findOne','keys','pick','getAllConditions','getAnyConditions','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','Trigger','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create'];(function(_0x523e5c,_0x263fab){var _0x994f68=function(_0x2f5ecd){while(--_0x2f5ecd){_0x523e5c['push'](_0x523e5c['shift']());}};_0x994f68(++_0x263fab);}(_0x3c17,0x18c));var _0x73c1=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x3c17[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0x73c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73c1('0x1'));var jsonpatch=require(_0x73c1('0x2'));var rp=require(_0x73c1('0x3'));var moment=require(_0x73c1('0x4'));var BPromise=require(_0x73c1('0x5'));var Mustache=require(_0x73c1('0x6'));var util=require(_0x73c1('0x7'));var path=require('path');var sox=require(_0x73c1('0x8'));var csv=require(_0x73c1('0x9'));var ejs=require(_0x73c1('0xa'));var fs=require('fs');var fs_extra=require(_0x73c1('0xb'));var _=require(_0x73c1('0xc'));var squel=require('squel');var crypto=require(_0x73c1('0xd'));var jsforce=require(_0x73c1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x73c1('0x9'));var querystring=require(_0x73c1('0xf'));var Papa=require(_0x73c1('0x10'));var Redis=require(_0x73c1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x73c1('0x12'));var as=require(_0x73c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73c1('0x14'))(_0x73c1('0x15'));var utils=require(_0x73c1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x73c1('0x17'))['db'];function respondWithStatusCode(_0x388fa9,_0x4212b4){_0x4212b4=_0x4212b4||0xcc;return function(_0x459a29){if(_0x459a29){return _0x388fa9[_0x73c1('0x18')](_0x4212b4);}return _0x388fa9[_0x73c1('0x19')](_0x4212b4)[_0x73c1('0x1a')]();};}function respondWithResult(_0x490ee2,_0x4a1b5c){_0x4a1b5c=_0x4a1b5c||0xc8;return function(_0x55a623){if(_0x55a623){return _0x490ee2['status'](_0x4a1b5c)[_0x73c1('0x1b')](_0x55a623);}};}function respondWithFilteredResult(_0x12e114,_0x327197){return function(_0x100afa){if(_0x100afa){var _0x212a43=typeof _0x327197[_0x73c1('0x1c')]===_0x73c1('0x1d')&&typeof _0x327197[_0x73c1('0x1e')]===_0x73c1('0x1d');var _0x47a5be=_0x100afa[_0x73c1('0x1f')];var _0x7c3871=_0x212a43?0x0:_0x327197['offset'];var _0x5c8016=_0x212a43?_0x100afa['count']:_0x327197['offset']+_0x327197[_0x73c1('0x1e')];var _0x470120;if(_0x5c8016>=_0x47a5be){_0x5c8016=_0x47a5be;_0x470120=0xc8;}else{_0x470120=0xce;}_0x12e114[_0x73c1('0x19')](_0x470120);return _0x12e114[_0x73c1('0x20')](_0x73c1('0x21'),_0x7c3871+'-'+_0x5c8016+'/'+_0x47a5be)[_0x73c1('0x1b')](_0x100afa);}return null;};}function patchUpdates(_0x1a4ca2){return function(_0x219e03){try{jsonpatch['apply'](_0x219e03,_0x1a4ca2,!![]);}catch(_0x415fad){return BPromise[_0x73c1('0x22')](_0x415fad);}return _0x219e03[_0x73c1('0x23')]();};}function saveUpdates(_0x1c7eaa,_0x3b0b49){return function(_0x3040b3){if(_0x3040b3){return _0x3040b3[_0x73c1('0x24')](_0x1c7eaa)[_0x73c1('0x25')](function(_0x37f65a){return _0x37f65a;});}return null;};}function removeEntity(_0x2dd52c,_0x407ca2){return function(_0x4b8ee4){if(_0x4b8ee4){return _0x4b8ee4[_0x73c1('0x26')]()[_0x73c1('0x25')](function(){var _0x56ede0=_0x4b8ee4['get']({'plain':!![]});var _0x444db1='Triggers';return db[_0x73c1('0x27')][_0x73c1('0x26')]({'where':{'type':_0x444db1,'resourceId':_0x56ede0['id']}})['then'](function(){return _0x4b8ee4;});})[_0x73c1('0x25')](function(){_0x2dd52c['status'](0xcc)[_0x73c1('0x1a')]();});}};}function handleEntityNotFound(_0x47bd0c,_0x1a876c){return function(_0x42d0fe){if(!_0x42d0fe){_0x47bd0c[_0x73c1('0x18')](0x194);}return _0x42d0fe;};}function handleError(_0x22ed84,_0x3f1e49){_0x3f1e49=_0x3f1e49||0x1f4;return function(_0x1a96a4){logger[_0x73c1('0x28')](_0x1a96a4[_0x73c1('0x29')]);if(_0x1a96a4[_0x73c1('0x2a')]){delete _0x1a96a4[_0x73c1('0x2a')];}_0x22ed84[_0x73c1('0x19')](_0x3f1e49)[_0x73c1('0x2b')](_0x1a96a4);};}exports['index']=function(_0x53092b,_0x4a6015){var _0x4d7331={},_0x58497b={},_0xefcf62={'count':0x0,'rows':[]};var _0x3d5cb2=_['map'](db[_0x73c1('0x2c')]['rawAttributes'],function(_0x67ea08){return{'name':_0x67ea08[_0x73c1('0x2d')],'type':_0x67ea08[_0x73c1('0x2e')][_0x73c1('0x2f')]};});_0x58497b['model']=_[_0x73c1('0x30')](_0x3d5cb2,'name');_0x58497b[_0x73c1('0x31')]=_['keys'](_0x53092b[_0x73c1('0x31')]);_0x58497b[_0x73c1('0x32')]=_[_0x73c1('0x33')](_0x58497b[_0x73c1('0x34')],_0x58497b[_0x73c1('0x31')]);_0x4d7331[_0x73c1('0x35')]=_[_0x73c1('0x33')](_0x58497b['model'],qs[_0x73c1('0x36')](_0x53092b['query'][_0x73c1('0x36')]));_0x4d7331[_0x73c1('0x35')]=_0x4d7331[_0x73c1('0x35')][_0x73c1('0x37')]?_0x4d7331[_0x73c1('0x35')]:_0x58497b['model'];if(!_0x53092b[_0x73c1('0x31')][_0x73c1('0x38')](_0x73c1('0x39'))){_0x4d7331[_0x73c1('0x1e')]=qs[_0x73c1('0x1e')](_0x53092b['query'][_0x73c1('0x1e')]);_0x4d7331[_0x73c1('0x1c')]=qs['offset'](_0x53092b[_0x73c1('0x31')][_0x73c1('0x1c')]);}_0x4d7331[_0x73c1('0x3a')]=qs[_0x73c1('0x3b')](_0x53092b[_0x73c1('0x31')]['sort']);_0x4d7331[_0x73c1('0x3c')]=qs[_0x73c1('0x32')](_['pick'](_0x53092b[_0x73c1('0x31')],_0x58497b[_0x73c1('0x32')]),_0x3d5cb2);if(_0x53092b['query'][_0x73c1('0x3d')]){_0x4d7331[_0x73c1('0x3c')]=_['merge'](_0x4d7331['where'],{'$or':_[_0x73c1('0x30')](_0x3d5cb2,function(_0x6abe38){if(_0x6abe38['type']!==_0x73c1('0x3e')){var _0x169cc1={};_0x169cc1[_0x6abe38[_0x73c1('0x2a')]]={'$like':'%'+_0x53092b[_0x73c1('0x31')]['filter']+'%'};return _0x169cc1;}})});}_0x4d7331=_[_0x73c1('0x3f')]({},_0x4d7331,_0x53092b[_0x73c1('0x40')]);var _0x1cde37={'where':_0x4d7331['where']};return db[_0x73c1('0x2c')][_0x73c1('0x1f')](_0x1cde37)[_0x73c1('0x25')](function(_0x59695a){_0xefcf62[_0x73c1('0x1f')]=_0x59695a;if(_0x53092b[_0x73c1('0x31')][_0x73c1('0x41')]){_0x4d7331[_0x73c1('0x42')]=[{'all':!![]}];}return db[_0x73c1('0x2c')][_0x73c1('0x43')](_0x4d7331);})['then'](function(_0x5e0860){_0xefcf62[_0x73c1('0x44')]=_0x5e0860;return _0xefcf62;})[_0x73c1('0x25')](respondWithFilteredResult(_0x4a6015,_0x4d7331))[_0x73c1('0x45')](handleError(_0x4a6015,null));};exports[_0x73c1('0x46')]=function(_0x3bbc7a,_0x33ab73){var _0x302d7a={'raw':![],'where':{'id':_0x3bbc7a['params']['id']}},_0x1c523a={};_0x1c523a[_0x73c1('0x34')]=_['keys'](db[_0x73c1('0x2c')][_0x73c1('0x47')]);_0x1c523a[_0x73c1('0x31')]=_['keys'](_0x3bbc7a[_0x73c1('0x31')]);_0x1c523a[_0x73c1('0x32')]=_[_0x73c1('0x33')](_0x1c523a[_0x73c1('0x34')],_0x1c523a[_0x73c1('0x31')]);_0x302d7a[_0x73c1('0x35')]=_[_0x73c1('0x33')](_0x1c523a[_0x73c1('0x34')],qs[_0x73c1('0x36')](_0x3bbc7a['query']['fields']));_0x302d7a['attributes']=_0x302d7a[_0x73c1('0x35')][_0x73c1('0x37')]?_0x302d7a[_0x73c1('0x35')]:_0x1c523a[_0x73c1('0x34')];if(_0x3bbc7a['query'][_0x73c1('0x41')]){_0x302d7a['include']=[{'all':!![]}];}_0x302d7a=_[_0x73c1('0x3f')]({},_0x302d7a,_0x3bbc7a[_0x73c1('0x40')]);return db['Trigger'][_0x73c1('0x48')](_0x302d7a)[_0x73c1('0x25')](handleEntityNotFound(_0x33ab73,null))['then'](respondWithResult(_0x33ab73,null))[_0x73c1('0x45')](handleError(_0x33ab73,null));};exports[_0x73c1('0x49')]=function(_0x4f40f1,_0x45f733){return db['Trigger'][_0x73c1('0x49')](_0x4f40f1[_0x73c1('0x4a')],{})['then'](function(_0x441acf){var _0x19e21f=_0x4f40f1[_0x73c1('0x4b')][_0x73c1('0x4c')]({'plain':!![]});if(!_0x19e21f)throw new Error(_0x73c1('0x4d'));if(_0x19e21f[_0x73c1('0x4e')]==='user'){var _0x290f52=_0x441acf[_0x73c1('0x4c')]({'plain':!![]});var _0x1a6727='Triggers';return db[_0x73c1('0x4f')][_0x73c1('0x48')]({'where':{'name':_0x1a6727,'userProfileId':_0x19e21f[_0x73c1('0x50')]},'raw':!![]})[_0x73c1('0x25')](function(_0x29ab3d){if(_0x29ab3d&&_0x29ab3d['autoAssociation']===0x0){return db[_0x73c1('0x27')]['create']({'name':_0x290f52[_0x73c1('0x2a')],'resourceId':_0x290f52['id'],'type':_0x29ab3d[_0x73c1('0x2a')],'sectionId':_0x29ab3d['id']},{})[_0x73c1('0x25')](function(){return _0x441acf;});}else{return _0x441acf;}})[_0x73c1('0x45')](function(_0x14295d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14295d);throw _0x14295d;});}return _0x441acf;})['then'](respondWithResult(_0x45f733,0xc9))[_0x73c1('0x45')](handleError(_0x45f733,null));};exports['update']=function(_0x438aa8,_0x1d4ce5){if(_0x438aa8[_0x73c1('0x4a')]['id']){delete _0x438aa8[_0x73c1('0x4a')]['id'];}return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x438aa8[_0x73c1('0x51')]['id']}})[_0x73c1('0x25')](handleEntityNotFound(_0x1d4ce5,null))['then'](saveUpdates(_0x438aa8['body'],null))[_0x73c1('0x25')](respondWithResult(_0x1d4ce5,null))[_0x73c1('0x45')](handleError(_0x1d4ce5,null));};exports[_0x73c1('0x26')]=function(_0x1d3c67,_0xafb694){return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x1d3c67['params']['id']}})[_0x73c1('0x25')](handleEntityNotFound(_0xafb694,null))[_0x73c1('0x25')](removeEntity(_0xafb694,null))[_0x73c1('0x45')](handleError(_0xafb694,null));};exports[_0x73c1('0x52')]=function(_0x1b297,_0x3973d0,_0x4306e4){if(_0x1b297[_0x73c1('0x4a')]['id']){delete _0x1b297[_0x73c1('0x4a')]['id'];}return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x1b297[_0x73c1('0x51')]['id']}})[_0x73c1('0x25')](handleEntityNotFound(_0x3973d0,null))[_0x73c1('0x25')](function(_0x187d63){if(_0x187d63){_0x1b297['body'][_0x73c1('0x53')]=_0x187d63['id'];return db[_0x73c1('0x54')][_0x73c1('0x49')](_0x1b297[_0x73c1('0x4a')]);}})['then'](respondWithResult(_0x3973d0,null))[_0x73c1('0x45')](handleError(_0x3973d0,null));};exports[_0x73c1('0x55')]=function(_0x29d36d,_0x15f3c3,_0x1774ef){if(_0x29d36d[_0x73c1('0x4a')]['id']){delete _0x29d36d[_0x73c1('0x4a')]['id'];}return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x29d36d[_0x73c1('0x51')]['id']}})['then'](handleEntityNotFound(_0x15f3c3,null))[_0x73c1('0x25')](function(_0x57cf30){if(_0x57cf30){_0x29d36d[_0x73c1('0x4a')]['TriggerAnyId']=_0x57cf30['id'];return db[_0x73c1('0x54')][_0x73c1('0x49')](_0x29d36d[_0x73c1('0x4a')]);}})[_0x73c1('0x25')](respondWithResult(_0x15f3c3,null))[_0x73c1('0x45')](handleError(_0x15f3c3,null));};exports['getAllConditions']=function(_0x358775,_0x21a60f,_0x1cf725){var _0x41c3e9={};var _0x4885b9={};var _0x222ef6;var _0x2c7c3b;return db[_0x73c1('0x2c')][_0x73c1('0x56')]({'where':{'id':_0x358775['params']['id']}})[_0x73c1('0x25')](handleEntityNotFound(_0x21a60f,null))['then'](function(_0x3f6572){if(_0x3f6572){_0x222ef6=_0x3f6572;_0x4885b9['model']=_['keys'](db[_0x73c1('0x54')]['rawAttributes']);_0x4885b9[_0x73c1('0x31')]=_[_0x73c1('0x57')](_0x358775[_0x73c1('0x31')]);_0x4885b9[_0x73c1('0x32')]=_['intersection'](_0x4885b9[_0x73c1('0x34')],_0x4885b9[_0x73c1('0x31')]);_0x41c3e9[_0x73c1('0x35')]=_[_0x73c1('0x33')](_0x4885b9[_0x73c1('0x34')],qs['fields'](_0x358775[_0x73c1('0x31')][_0x73c1('0x36')]));_0x41c3e9[_0x73c1('0x35')]=_0x41c3e9[_0x73c1('0x35')][_0x73c1('0x37')]?_0x41c3e9[_0x73c1('0x35')]:_0x4885b9[_0x73c1('0x34')];_0x41c3e9[_0x73c1('0x3a')]=qs[_0x73c1('0x3b')](_0x358775[_0x73c1('0x31')][_0x73c1('0x3b')]);_0x41c3e9['where']=qs[_0x73c1('0x32')](_[_0x73c1('0x58')](_0x358775[_0x73c1('0x31')],_0x4885b9[_0x73c1('0x32')]));if(_0x358775['query'][_0x73c1('0x3d')]){_0x41c3e9[_0x73c1('0x3c')]=_[_0x73c1('0x3f')](_0x41c3e9[_0x73c1('0x3c')],{'$or':_[_0x73c1('0x30')](_0x41c3e9['attributes'],function(_0x59df41){var _0x547518={};_0x547518[_0x59df41]={'$like':'%'+_0x358775['query'][_0x73c1('0x3d')]+'%'};return _0x547518;})});}_0x41c3e9=_['merge']({},_0x41c3e9,_0x358775[_0x73c1('0x40')]);return _0x222ef6[_0x73c1('0x59')](_0x41c3e9);}})[_0x73c1('0x25')](function(_0x5c5233){if(_0x5c5233){_0x2c7c3b=_0x5c5233[_0x73c1('0x37')];if(!_0x358775[_0x73c1('0x31')][_0x73c1('0x38')](_0x73c1('0x39'))){_0x41c3e9[_0x73c1('0x1e')]=qs[_0x73c1('0x1e')](_0x358775[_0x73c1('0x31')][_0x73c1('0x1e')]);_0x41c3e9[_0x73c1('0x1c')]=qs['offset'](_0x358775[_0x73c1('0x31')][_0x73c1('0x1c')]);}return _0x222ef6[_0x73c1('0x59')](_0x41c3e9);}})[_0x73c1('0x25')](function(_0x15bcaa){if(_0x15bcaa){return _0x15bcaa?{'count':_0x2c7c3b,'rows':_0x15bcaa}:null;}})[_0x73c1('0x25')](respondWithResult(_0x21a60f,null))['catch'](handleError(_0x21a60f,null));};exports[_0x73c1('0x5a')]=function(_0x23dccc,_0x4e62d8,_0x55160d){var _0x45e3ea={};var _0x257fb6={};var _0x4c3207;var _0x59e9a7;return db['Trigger']['findOne']({'where':{'id':_0x23dccc['params']['id']}})[_0x73c1('0x25')](handleEntityNotFound(_0x4e62d8,null))['then'](function(_0x363d0c){if(_0x363d0c){_0x4c3207=_0x363d0c;_0x257fb6['model']=_[_0x73c1('0x57')](db[_0x73c1('0x54')][_0x73c1('0x47')]);_0x257fb6[_0x73c1('0x31')]=_[_0x73c1('0x57')](_0x23dccc['query']);_0x257fb6['filters']=_['intersection'](_0x257fb6[_0x73c1('0x34')],_0x257fb6[_0x73c1('0x31')]);_0x45e3ea[_0x73c1('0x35')]=_[_0x73c1('0x33')](_0x257fb6[_0x73c1('0x34')],qs[_0x73c1('0x36')](_0x23dccc[_0x73c1('0x31')][_0x73c1('0x36')]));_0x45e3ea[_0x73c1('0x35')]=_0x45e3ea[_0x73c1('0x35')][_0x73c1('0x37')]?_0x45e3ea[_0x73c1('0x35')]:_0x257fb6['model'];_0x45e3ea[_0x73c1('0x3a')]=qs[_0x73c1('0x3b')](_0x23dccc['query']['sort']);_0x45e3ea[_0x73c1('0x3c')]=qs['filters'](_[_0x73c1('0x58')](_0x23dccc['query'],_0x257fb6[_0x73c1('0x32')]));if(_0x23dccc[_0x73c1('0x31')][_0x73c1('0x3d')]){_0x45e3ea[_0x73c1('0x3c')]=_[_0x73c1('0x3f')](_0x45e3ea[_0x73c1('0x3c')],{'$or':_[_0x73c1('0x30')](_0x45e3ea['attributes'],function(_0x525765){var _0x53da04={};_0x53da04[_0x525765]={'$like':'%'+_0x23dccc[_0x73c1('0x31')][_0x73c1('0x3d')]+'%'};return _0x53da04;})});}_0x45e3ea=_[_0x73c1('0x3f')]({},_0x45e3ea,_0x23dccc[_0x73c1('0x40')]);return _0x4c3207['getAnyConditions'](_0x45e3ea);}})[_0x73c1('0x25')](function(_0xf73031){if(_0xf73031){_0x59e9a7=_0xf73031[_0x73c1('0x37')];if(!_0x23dccc['query']['hasOwnProperty'](_0x73c1('0x39'))){_0x45e3ea['limit']=qs[_0x73c1('0x1e')](_0x23dccc['query'][_0x73c1('0x1e')]);_0x45e3ea[_0x73c1('0x1c')]=qs[_0x73c1('0x1c')](_0x23dccc[_0x73c1('0x31')][_0x73c1('0x1c')]);}return _0x4c3207['getAnyConditions'](_0x45e3ea);}})[_0x73c1('0x25')](function(_0x5af458){if(_0x5af458){return _0x5af458?{'count':_0x59e9a7,'rows':_0x5af458}:null;}})[_0x73c1('0x25')](respondWithResult(_0x4e62d8,null))[_0x73c1('0x45')](handleError(_0x4e62d8,null));};exports[_0x73c1('0x5b')]=function(_0x982a87,_0x4271d6,_0x1b970e){if(_0x982a87[_0x73c1('0x4a')]['id']){delete _0x982a87[_0x73c1('0x4a')]['id'];}return db['Trigger'][_0x73c1('0x48')]({'where':{'id':_0x982a87[_0x73c1('0x51')]['id']}})['then'](handleEntityNotFound(_0x4271d6,null))[_0x73c1('0x25')](function(_0x4271f5){if(_0x4271f5){_0x982a87['body']['TriggerId']=_0x4271f5['id'];return db[_0x73c1('0x5c')]['create'](_0x982a87['body']);}})[_0x73c1('0x25')](respondWithResult(_0x4271d6,null))[_0x73c1('0x45')](handleError(_0x4271d6,null));};exports['getActions']=function(_0xde3878,_0x2593e3,_0x481bc5){var _0x4972fb={};var _0x3b734a={};var _0x59614e;var _0x605b0c;return db['Trigger']['findOne']({'where':{'id':_0xde3878['params']['id']}})['then'](handleEntityNotFound(_0x2593e3,null))[_0x73c1('0x25')](function(_0x296bda){if(_0x296bda){_0x59614e=_0x296bda;_0x3b734a[_0x73c1('0x34')]=_['keys'](db['Action'][_0x73c1('0x47')]);_0x3b734a[_0x73c1('0x31')]=_[_0x73c1('0x57')](_0xde3878['query']);_0x3b734a[_0x73c1('0x32')]=_[_0x73c1('0x33')](_0x3b734a[_0x73c1('0x34')],_0x3b734a[_0x73c1('0x31')]);_0x4972fb[_0x73c1('0x35')]=_[_0x73c1('0x33')](_0x3b734a[_0x73c1('0x34')],qs[_0x73c1('0x36')](_0xde3878[_0x73c1('0x31')][_0x73c1('0x36')]));_0x4972fb[_0x73c1('0x35')]=_0x4972fb[_0x73c1('0x35')]['length']?_0x4972fb[_0x73c1('0x35')]:_0x3b734a[_0x73c1('0x34')];_0x4972fb[_0x73c1('0x3a')]=qs[_0x73c1('0x3b')](_0xde3878[_0x73c1('0x31')][_0x73c1('0x3b')]);_0x4972fb[_0x73c1('0x3c')]=qs['filters'](_[_0x73c1('0x58')](_0xde3878['query'],_0x3b734a[_0x73c1('0x32')]));if(_0xde3878[_0x73c1('0x31')][_0x73c1('0x3d')]){_0x4972fb[_0x73c1('0x3c')]=_['merge'](_0x4972fb[_0x73c1('0x3c')],{'$or':_[_0x73c1('0x30')](_0x4972fb[_0x73c1('0x35')],function(_0x3cdb89){var _0x4f8f26={};_0x4f8f26[_0x3cdb89]={'$like':'%'+_0xde3878[_0x73c1('0x31')][_0x73c1('0x3d')]+'%'};return _0x4f8f26;})});}_0x4972fb=_[_0x73c1('0x3f')]({},_0x4972fb,_0xde3878['options']);return _0x59614e[_0x73c1('0x5d')](_0x4972fb);}})[_0x73c1('0x25')](function(_0x5ff69){if(_0x5ff69){_0x605b0c=_0x5ff69[_0x73c1('0x37')];if(!_0xde3878[_0x73c1('0x31')][_0x73c1('0x38')](_0x73c1('0x39'))){_0x4972fb[_0x73c1('0x1e')]=qs[_0x73c1('0x1e')](_0xde3878[_0x73c1('0x31')][_0x73c1('0x1e')]);_0x4972fb[_0x73c1('0x1c')]=qs['offset'](_0xde3878['query'][_0x73c1('0x1c')]);}return _0x59614e[_0x73c1('0x5d')](_0x4972fb);}})['then'](function(_0xaa4fbf){if(_0xaa4fbf){return _0xaa4fbf?{'count':_0x605b0c,'rows':_0xaa4fbf}:null;}})[_0x73c1('0x25')](respondWithResult(_0x2593e3,null))[_0x73c1('0x45')](handleError(_0x2593e3,null));}; \ No newline at end of file +var _0x28d5=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','Triggers','UserProfileResource','stack','name','send','map','Trigger','rawAttributes','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','user','role','find','userProfileId','autoAssociation','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','order','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x51b829,_0xb2594c){var _0x12437a=function(_0x480822){while(--_0x480822){_0x51b829['push'](_0x51b829['shift']());}};_0x12437a(++_0xb2594c);}(_0x28d5,0xb8));var _0x528d=function(_0x189dbd,_0x1d3cad){_0x189dbd=_0x189dbd-0x0;var _0x7861fb=_0x28d5[_0x189dbd];return _0x7861fb;};'use strict';var emlformat=require(_0x528d('0x0'));var rimraf=require(_0x528d('0x1'));var zipdir=require(_0x528d('0x2'));var jsonpatch=require(_0x528d('0x3'));var rp=require('request-promise');var moment=require(_0x528d('0x4'));var BPromise=require(_0x528d('0x5'));var Mustache=require(_0x528d('0x6'));var util=require(_0x528d('0x7'));var path=require(_0x528d('0x8'));var sox=require(_0x528d('0x9'));var csv=require(_0x528d('0xa'));var ejs=require(_0x528d('0xb'));var fs=require('fs');var fs_extra=require(_0x528d('0xc'));var _=require(_0x528d('0xd'));var squel=require(_0x528d('0xe'));var crypto=require('crypto');var jsforce=require(_0x528d('0xf'));var deskjs=require(_0x528d('0x10'));var toCsv=require(_0x528d('0xa'));var querystring=require(_0x528d('0x11'));var Papa=require(_0x528d('0x12'));var Redis=require(_0x528d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x528d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x528d('0x15'));var logger=require(_0x528d('0x16'))('api');var utils=require(_0x528d('0x17'));var config=require(_0x528d('0x18'));var licenseUtil=require(_0x528d('0x19'));var db=require(_0x528d('0x1a'))['db'];function respondWithStatusCode(_0x56d55d,_0x11d073){_0x11d073=_0x11d073||0xcc;return function(_0x30cc40){if(_0x30cc40){return _0x56d55d[_0x528d('0x1b')](_0x11d073);}return _0x56d55d[_0x528d('0x1c')](_0x11d073)['end']();};}function respondWithResult(_0x1b78ac,_0x18388d){_0x18388d=_0x18388d||0xc8;return function(_0x39d538){if(_0x39d538){return _0x1b78ac[_0x528d('0x1c')](_0x18388d)[_0x528d('0x1d')](_0x39d538);}};}function respondWithFilteredResult(_0x2d1331,_0xa81c99){return function(_0xa16d13){if(_0xa16d13){var _0xd33a19=typeof _0xa81c99[_0x528d('0x1e')]===_0x528d('0x1f')&&typeof _0xa81c99['limit']===_0x528d('0x1f');var _0x2d90c3=_0xa16d13[_0x528d('0x20')];var _0x401cf1=_0xd33a19?0x0:_0xa81c99[_0x528d('0x1e')];var _0x45ab87=_0xd33a19?_0xa16d13['count']:_0xa81c99['offset']+_0xa81c99[_0x528d('0x21')];var _0x4bbc6e;if(_0x45ab87>=_0x2d90c3){_0x45ab87=_0x2d90c3;_0x4bbc6e=0xc8;}else{_0x4bbc6e=0xce;}_0x2d1331[_0x528d('0x1c')](_0x4bbc6e);return _0x2d1331[_0x528d('0x22')](_0x528d('0x23'),_0x401cf1+'-'+_0x45ab87+'/'+_0x2d90c3)[_0x528d('0x1d')](_0xa16d13);}return null;};}function patchUpdates(_0x5bef34){return function(_0x158803){try{jsonpatch['apply'](_0x158803,_0x5bef34,!![]);}catch(_0x3ac357){return BPromise[_0x528d('0x24')](_0x3ac357);}return _0x158803[_0x528d('0x25')]();};}function saveUpdates(_0xb1165c,_0x1bd4a0){return function(_0x3180ba){if(_0x3180ba){return _0x3180ba['update'](_0xb1165c)[_0x528d('0x26')](function(_0x3caea2){return _0x3caea2;});}return null;};}function removeEntity(_0x420283,_0x440b40){return function(_0x54a040){if(_0x54a040){return _0x54a040[_0x528d('0x27')]()[_0x528d('0x26')](function(){var _0xc37c9b=_0x54a040[_0x528d('0x28')]({'plain':!![]});var _0x33b5c2=_0x528d('0x29');return db[_0x528d('0x2a')][_0x528d('0x27')]({'where':{'type':_0x33b5c2,'resourceId':_0xc37c9b['id']}})['then'](function(){return _0x54a040;});})[_0x528d('0x26')](function(){_0x420283[_0x528d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x561a5a,_0x51ae3c){return function(_0x1a442a){if(!_0x1a442a){_0x561a5a[_0x528d('0x1b')](0x194);}return _0x1a442a;};}function handleError(_0x216162,_0x20453c){_0x20453c=_0x20453c||0x1f4;return function(_0xfeb8d){logger['error'](_0xfeb8d[_0x528d('0x2b')]);if(_0xfeb8d[_0x528d('0x2c')]){delete _0xfeb8d[_0x528d('0x2c')];}_0x216162[_0x528d('0x1c')](_0x20453c)[_0x528d('0x2d')](_0xfeb8d);};}exports['index']=function(_0x3d3cea,_0xb2212e){var _0x5661a2={},_0x1318ce={},_0x286920={'count':0x0,'rows':[]};var _0x3fb2e4=_[_0x528d('0x2e')](db[_0x528d('0x2f')][_0x528d('0x30')],function(_0x15295a){return{'name':_0x15295a['fieldName'],'type':_0x15295a['type'][_0x528d('0x31')]};});_0x1318ce[_0x528d('0x32')]=_['map'](_0x3fb2e4,_0x528d('0x2c'));_0x1318ce['query']=_['keys'](_0x3d3cea['query']);_0x1318ce[_0x528d('0x33')]=_[_0x528d('0x34')](_0x1318ce[_0x528d('0x32')],_0x1318ce['query']);_0x5661a2[_0x528d('0x35')]=_[_0x528d('0x34')](_0x1318ce[_0x528d('0x32')],qs[_0x528d('0x36')](_0x3d3cea[_0x528d('0x37')][_0x528d('0x36')]));_0x5661a2[_0x528d('0x35')]=_0x5661a2[_0x528d('0x35')][_0x528d('0x38')]?_0x5661a2[_0x528d('0x35')]:_0x1318ce[_0x528d('0x32')];if(!_0x3d3cea[_0x528d('0x37')][_0x528d('0x39')](_0x528d('0x3a'))){_0x5661a2['limit']=qs[_0x528d('0x21')](_0x3d3cea[_0x528d('0x37')][_0x528d('0x21')]);_0x5661a2['offset']=qs[_0x528d('0x1e')](_0x3d3cea[_0x528d('0x37')]['offset']);}_0x5661a2['order']=qs[_0x528d('0x3b')](_0x3d3cea[_0x528d('0x37')][_0x528d('0x3b')]);_0x5661a2[_0x528d('0x3c')]=qs[_0x528d('0x33')](_[_0x528d('0x3d')](_0x3d3cea['query'],_0x1318ce[_0x528d('0x33')]),_0x3fb2e4);if(_0x3d3cea[_0x528d('0x37')][_0x528d('0x3e')]){_0x5661a2[_0x528d('0x3c')]=_['merge'](_0x5661a2[_0x528d('0x3c')],{'$or':_['map'](_0x3fb2e4,function(_0x2a2220){if(_0x2a2220[_0x528d('0x3f')]!==_0x528d('0x40')){var _0x2ef810={};_0x2ef810[_0x2a2220[_0x528d('0x2c')]]={'$like':'%'+_0x3d3cea[_0x528d('0x37')]['filter']+'%'};return _0x2ef810;}})});}_0x5661a2=_[_0x528d('0x41')]({},_0x5661a2,_0x3d3cea['options']);var _0x2728f1={'where':_0x5661a2[_0x528d('0x3c')]};return db['Trigger'][_0x528d('0x20')](_0x2728f1)[_0x528d('0x26')](function(_0x42b3ed){_0x286920[_0x528d('0x20')]=_0x42b3ed;if(_0x3d3cea[_0x528d('0x37')]['includeAll']){_0x5661a2[_0x528d('0x42')]=[{'all':!![]}];}return db[_0x528d('0x2f')][_0x528d('0x43')](_0x5661a2);})[_0x528d('0x26')](function(_0x4c08a3){_0x286920[_0x528d('0x44')]=_0x4c08a3;return _0x286920;})['then'](respondWithFilteredResult(_0xb2212e,_0x5661a2))[_0x528d('0x45')](handleError(_0xb2212e,null));};exports[_0x528d('0x46')]=function(_0x3f0bb6,_0x16db59){var _0x11e6bc={'raw':![],'where':{'id':_0x3f0bb6[_0x528d('0x47')]['id']}},_0x20a7da={};_0x20a7da[_0x528d('0x32')]=_['keys'](db[_0x528d('0x2f')]['rawAttributes']);_0x20a7da[_0x528d('0x37')]=_[_0x528d('0x48')](_0x3f0bb6['query']);_0x20a7da[_0x528d('0x33')]=_[_0x528d('0x34')](_0x20a7da['model'],_0x20a7da[_0x528d('0x37')]);_0x11e6bc[_0x528d('0x35')]=_[_0x528d('0x34')](_0x20a7da['model'],qs['fields'](_0x3f0bb6[_0x528d('0x37')][_0x528d('0x36')]));_0x11e6bc['attributes']=_0x11e6bc[_0x528d('0x35')]['length']?_0x11e6bc[_0x528d('0x35')]:_0x20a7da[_0x528d('0x32')];if(_0x3f0bb6['query'][_0x528d('0x49')]){_0x11e6bc[_0x528d('0x42')]=[{'all':!![]}];}_0x11e6bc=_[_0x528d('0x41')]({},_0x11e6bc,_0x3f0bb6[_0x528d('0x4a')]);return db[_0x528d('0x2f')]['find'](_0x11e6bc)[_0x528d('0x26')](handleEntityNotFound(_0x16db59,null))[_0x528d('0x26')](respondWithResult(_0x16db59,null))['catch'](handleError(_0x16db59,null));};exports[_0x528d('0x4b')]=function(_0x544da1,_0x1924cb){return db[_0x528d('0x2f')][_0x528d('0x4b')](_0x544da1[_0x528d('0x4c')],{})[_0x528d('0x26')](function(_0x4e4859){var _0x331d28=_0x544da1[_0x528d('0x4d')][_0x528d('0x28')]({'plain':!![]});if(!_0x331d28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x331d28[_0x528d('0x4e')]===_0x528d('0x4d')){var _0xee4520=_0x4e4859['get']({'plain':!![]});var _0x9e3ea3='Triggers';return db['UserProfileSection'][_0x528d('0x4f')]({'where':{'name':_0x9e3ea3,'userProfileId':_0x331d28[_0x528d('0x50')]},'raw':!![]})[_0x528d('0x26')](function(_0x3a1795){if(_0x3a1795&&_0x3a1795[_0x528d('0x51')]===0x0){return db[_0x528d('0x2a')][_0x528d('0x4b')]({'name':_0xee4520[_0x528d('0x2c')],'resourceId':_0xee4520['id'],'type':_0x3a1795[_0x528d('0x2c')],'sectionId':_0x3a1795['id']},{})[_0x528d('0x26')](function(){return _0x4e4859;});}else{return _0x4e4859;}})[_0x528d('0x45')](function(_0x2727b0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2727b0);throw _0x2727b0;});}return _0x4e4859;})[_0x528d('0x26')](respondWithResult(_0x1924cb,0xc9))[_0x528d('0x45')](handleError(_0x1924cb,null));};exports['update']=function(_0x1f5b79,_0x14ef2f){if(_0x1f5b79['body']['id']){delete _0x1f5b79[_0x528d('0x4c')]['id'];}return db[_0x528d('0x2f')][_0x528d('0x4f')]({'where':{'id':_0x1f5b79[_0x528d('0x47')]['id']}})[_0x528d('0x26')](handleEntityNotFound(_0x14ef2f,null))[_0x528d('0x26')](saveUpdates(_0x1f5b79[_0x528d('0x4c')],null))[_0x528d('0x26')](respondWithResult(_0x14ef2f,null))['catch'](handleError(_0x14ef2f,null));};exports[_0x528d('0x27')]=function(_0x235f35,_0x22c8ec){return db[_0x528d('0x2f')][_0x528d('0x4f')]({'where':{'id':_0x235f35[_0x528d('0x47')]['id']}})['then'](handleEntityNotFound(_0x22c8ec,null))[_0x528d('0x26')](removeEntity(_0x22c8ec,null))[_0x528d('0x45')](handleError(_0x22c8ec,null));};exports['addAllCondition']=function(_0x448d0f,_0x3aa463,_0x2facc0){if(_0x448d0f[_0x528d('0x4c')]['id']){delete _0x448d0f[_0x528d('0x4c')]['id'];}return db['Trigger'][_0x528d('0x4f')]({'where':{'id':_0x448d0f[_0x528d('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa463,null))[_0x528d('0x26')](function(_0x3a06f9){if(_0x3a06f9){_0x448d0f['body'][_0x528d('0x52')]=_0x3a06f9['id'];return db[_0x528d('0x53')][_0x528d('0x4b')](_0x448d0f[_0x528d('0x4c')]);}})[_0x528d('0x26')](respondWithResult(_0x3aa463,null))[_0x528d('0x45')](handleError(_0x3aa463,null));};exports[_0x528d('0x54')]=function(_0x97724b,_0x3550b2,_0x293b55){if(_0x97724b[_0x528d('0x4c')]['id']){delete _0x97724b['body']['id'];}return db[_0x528d('0x2f')][_0x528d('0x4f')]({'where':{'id':_0x97724b[_0x528d('0x47')]['id']}})[_0x528d('0x26')](handleEntityNotFound(_0x3550b2,null))[_0x528d('0x26')](function(_0x407af5){if(_0x407af5){_0x97724b[_0x528d('0x4c')][_0x528d('0x55')]=_0x407af5['id'];return db[_0x528d('0x53')]['create'](_0x97724b['body']);}})[_0x528d('0x26')](respondWithResult(_0x3550b2,null))[_0x528d('0x45')](handleError(_0x3550b2,null));};exports[_0x528d('0x56')]=function(_0x522a63,_0x2a8f75,_0x118884){var _0xaf129c={};var _0x50c1cb={};var _0x3f556c;var _0x2effb9;return db[_0x528d('0x2f')]['findOne']({'where':{'id':_0x522a63['params']['id']}})['then'](handleEntityNotFound(_0x2a8f75,null))['then'](function(_0x4b80c5){if(_0x4b80c5){_0x3f556c=_0x4b80c5;_0x50c1cb['model']=_[_0x528d('0x48')](db[_0x528d('0x53')]['rawAttributes']);_0x50c1cb[_0x528d('0x37')]=_[_0x528d('0x48')](_0x522a63[_0x528d('0x37')]);_0x50c1cb[_0x528d('0x33')]=_[_0x528d('0x34')](_0x50c1cb[_0x528d('0x32')],_0x50c1cb[_0x528d('0x37')]);_0xaf129c[_0x528d('0x35')]=_[_0x528d('0x34')](_0x50c1cb[_0x528d('0x32')],qs[_0x528d('0x36')](_0x522a63[_0x528d('0x37')][_0x528d('0x36')]));_0xaf129c[_0x528d('0x35')]=_0xaf129c[_0x528d('0x35')][_0x528d('0x38')]?_0xaf129c[_0x528d('0x35')]:_0x50c1cb[_0x528d('0x32')];_0xaf129c[_0x528d('0x57')]=qs[_0x528d('0x3b')](_0x522a63[_0x528d('0x37')][_0x528d('0x3b')]);_0xaf129c['where']=qs['filters'](_[_0x528d('0x3d')](_0x522a63['query'],_0x50c1cb['filters']));if(_0x522a63[_0x528d('0x37')]['filter']){_0xaf129c['where']=_[_0x528d('0x41')](_0xaf129c[_0x528d('0x3c')],{'$or':_[_0x528d('0x2e')](_0xaf129c[_0x528d('0x35')],function(_0x1625a2){var _0x559040={};_0x559040[_0x1625a2]={'$like':'%'+_0x522a63['query'][_0x528d('0x3e')]+'%'};return _0x559040;})});}_0xaf129c=_[_0x528d('0x41')]({},_0xaf129c,_0x522a63[_0x528d('0x4a')]);return _0x3f556c[_0x528d('0x56')](_0xaf129c);}})[_0x528d('0x26')](function(_0x3c6f2f){if(_0x3c6f2f){_0x2effb9=_0x3c6f2f[_0x528d('0x38')];if(!_0x522a63[_0x528d('0x37')][_0x528d('0x39')](_0x528d('0x3a'))){_0xaf129c[_0x528d('0x21')]=qs[_0x528d('0x21')](_0x522a63['query']['limit']);_0xaf129c[_0x528d('0x1e')]=qs[_0x528d('0x1e')](_0x522a63['query'][_0x528d('0x1e')]);}return _0x3f556c[_0x528d('0x56')](_0xaf129c);}})[_0x528d('0x26')](function(_0x1a8dbd){if(_0x1a8dbd){return _0x1a8dbd?{'count':_0x2effb9,'rows':_0x1a8dbd}:null;}})[_0x528d('0x26')](respondWithResult(_0x2a8f75,null))[_0x528d('0x45')](handleError(_0x2a8f75,null));};exports[_0x528d('0x58')]=function(_0x509059,_0x3349aa,_0x2c3ebb){var _0x15bed1={};var _0x260c78={};var _0x5b8672;var _0x3587c4;return db[_0x528d('0x2f')][_0x528d('0x59')]({'where':{'id':_0x509059[_0x528d('0x47')]['id']}})[_0x528d('0x26')](handleEntityNotFound(_0x3349aa,null))['then'](function(_0x1db967){if(_0x1db967){_0x5b8672=_0x1db967;_0x260c78[_0x528d('0x32')]=_[_0x528d('0x48')](db[_0x528d('0x53')]['rawAttributes']);_0x260c78[_0x528d('0x37')]=_[_0x528d('0x48')](_0x509059[_0x528d('0x37')]);_0x260c78['filters']=_[_0x528d('0x34')](_0x260c78[_0x528d('0x32')],_0x260c78[_0x528d('0x37')]);_0x15bed1[_0x528d('0x35')]=_[_0x528d('0x34')](_0x260c78[_0x528d('0x32')],qs[_0x528d('0x36')](_0x509059[_0x528d('0x37')][_0x528d('0x36')]));_0x15bed1[_0x528d('0x35')]=_0x15bed1[_0x528d('0x35')][_0x528d('0x38')]?_0x15bed1[_0x528d('0x35')]:_0x260c78[_0x528d('0x32')];_0x15bed1[_0x528d('0x57')]=qs[_0x528d('0x3b')](_0x509059[_0x528d('0x37')][_0x528d('0x3b')]);_0x15bed1[_0x528d('0x3c')]=qs['filters'](_[_0x528d('0x3d')](_0x509059[_0x528d('0x37')],_0x260c78[_0x528d('0x33')]));if(_0x509059[_0x528d('0x37')][_0x528d('0x3e')]){_0x15bed1['where']=_[_0x528d('0x41')](_0x15bed1[_0x528d('0x3c')],{'$or':_['map'](_0x15bed1[_0x528d('0x35')],function(_0x263bf3){var _0x4be506={};_0x4be506[_0x263bf3]={'$like':'%'+_0x509059[_0x528d('0x37')][_0x528d('0x3e')]+'%'};return _0x4be506;})});}_0x15bed1=_[_0x528d('0x41')]({},_0x15bed1,_0x509059['options']);return _0x5b8672[_0x528d('0x58')](_0x15bed1);}})[_0x528d('0x26')](function(_0x534f38){if(_0x534f38){_0x3587c4=_0x534f38[_0x528d('0x38')];if(!_0x509059[_0x528d('0x37')][_0x528d('0x39')](_0x528d('0x3a'))){_0x15bed1[_0x528d('0x21')]=qs[_0x528d('0x21')](_0x509059[_0x528d('0x37')][_0x528d('0x21')]);_0x15bed1[_0x528d('0x1e')]=qs[_0x528d('0x1e')](_0x509059[_0x528d('0x37')][_0x528d('0x1e')]);}return _0x5b8672[_0x528d('0x58')](_0x15bed1);}})['then'](function(_0x47847a){if(_0x47847a){return _0x47847a?{'count':_0x3587c4,'rows':_0x47847a}:null;}})[_0x528d('0x26')](respondWithResult(_0x3349aa,null))['catch'](handleError(_0x3349aa,null));};exports[_0x528d('0x5a')]=function(_0x53f498,_0x5a80c7,_0x550214){if(_0x53f498[_0x528d('0x4c')]['id']){delete _0x53f498['body']['id'];}return db['Trigger'][_0x528d('0x4f')]({'where':{'id':_0x53f498[_0x528d('0x47')]['id']}})[_0x528d('0x26')](handleEntityNotFound(_0x5a80c7,null))[_0x528d('0x26')](function(_0x3e2468){if(_0x3e2468){_0x53f498[_0x528d('0x4c')][_0x528d('0x5b')]=_0x3e2468['id'];return db[_0x528d('0x5c')][_0x528d('0x4b')](_0x53f498[_0x528d('0x4c')]);}})[_0x528d('0x26')](respondWithResult(_0x5a80c7,null))[_0x528d('0x45')](handleError(_0x5a80c7,null));};exports[_0x528d('0x5d')]=function(_0xd8d711,_0x3c8276,_0x17ea3b){var _0x3fc8dc={};var _0x246fdb={};var _0x1269b5;var _0x540983;return db['Trigger']['findOne']({'where':{'id':_0xd8d711[_0x528d('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c8276,null))[_0x528d('0x26')](function(_0x249e15){if(_0x249e15){_0x1269b5=_0x249e15;_0x246fdb['model']=_['keys'](db[_0x528d('0x5c')][_0x528d('0x30')]);_0x246fdb[_0x528d('0x37')]=_['keys'](_0xd8d711['query']);_0x246fdb[_0x528d('0x33')]=_['intersection'](_0x246fdb[_0x528d('0x32')],_0x246fdb[_0x528d('0x37')]);_0x3fc8dc[_0x528d('0x35')]=_[_0x528d('0x34')](_0x246fdb[_0x528d('0x32')],qs['fields'](_0xd8d711['query'][_0x528d('0x36')]));_0x3fc8dc[_0x528d('0x35')]=_0x3fc8dc[_0x528d('0x35')][_0x528d('0x38')]?_0x3fc8dc[_0x528d('0x35')]:_0x246fdb['model'];_0x3fc8dc['order']=qs[_0x528d('0x3b')](_0xd8d711[_0x528d('0x37')]['sort']);_0x3fc8dc[_0x528d('0x3c')]=qs[_0x528d('0x33')](_[_0x528d('0x3d')](_0xd8d711[_0x528d('0x37')],_0x246fdb[_0x528d('0x33')]));if(_0xd8d711[_0x528d('0x37')][_0x528d('0x3e')]){_0x3fc8dc[_0x528d('0x3c')]=_[_0x528d('0x41')](_0x3fc8dc[_0x528d('0x3c')],{'$or':_[_0x528d('0x2e')](_0x3fc8dc[_0x528d('0x35')],function(_0x5b8296){var _0x3fc7f4={};_0x3fc7f4[_0x5b8296]={'$like':'%'+_0xd8d711['query']['filter']+'%'};return _0x3fc7f4;})});}_0x3fc8dc=_[_0x528d('0x41')]({},_0x3fc8dc,_0xd8d711[_0x528d('0x4a')]);return _0x1269b5[_0x528d('0x5d')](_0x3fc8dc);}})[_0x528d('0x26')](function(_0xbda164){if(_0xbda164){_0x540983=_0xbda164[_0x528d('0x38')];if(!_0xd8d711['query']['hasOwnProperty'](_0x528d('0x3a'))){_0x3fc8dc[_0x528d('0x21')]=qs[_0x528d('0x21')](_0xd8d711[_0x528d('0x37')][_0x528d('0x21')]);_0x3fc8dc[_0x528d('0x1e')]=qs['offset'](_0xd8d711[_0x528d('0x37')][_0x528d('0x1e')]);}return _0x1269b5[_0x528d('0x5d')](_0x3fc8dc);}})['then'](function(_0x153fe6){if(_0x153fe6){return _0x153fe6?{'count':_0x540983,'rows':_0x153fe6}:null;}})[_0x528d('0x26')](respondWithResult(_0x3c8276,null))[_0x528d('0x45')](handleError(_0x3c8276,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 137b209..187f1c1 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 _0xac21=['tools_triggers','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','Trigger'];(function(_0x58a231,_0x18523a){var _0x2f5089=function(_0x24e052){while(--_0x24e052){_0x58a231['push'](_0x58a231['shift']());}};_0x2f5089(++_0x18523a);}(_0xac21,0x1af));var _0x1ac2=function(_0x4863df,_0x43a541){_0x4863df=_0x4863df-0x0;var _0x8cf688=_0xac21[_0x4863df];return _0x8cf688;};'use strict';var _=require('lodash');var util=require(_0x1ac2('0x0'));var logger=require(_0x1ac2('0x1'))('api');var moment=require(_0x1ac2('0x2'));var BPromise=require('bluebird');var rp=require(_0x1ac2('0x3'));var fs=require('fs');var path=require(_0x1ac2('0x4'));var rimraf=require('rimraf');var config=require(_0x1ac2('0x5'));var attributes=require('./trigger.attributes');module[_0x1ac2('0x6')]=function(_0x21a183,_0x2c4cf2){return _0x21a183[_0x1ac2('0x7')](_0x1ac2('0x8'),attributes,{'tableName':_0x1ac2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc576=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./trigger.attributes','define','Trigger'];(function(_0x41bab8,_0x2469cf){var _0x541174=function(_0x5da0b4){while(--_0x5da0b4){_0x41bab8['push'](_0x41bab8['shift']());}};_0x541174(++_0x2469cf);}(_0xc576,0x1ea));var _0x6c57=function(_0x289874,_0x1b6752){_0x289874=_0x289874-0x0;var _0x2f8bbb=_0xc576[_0x289874];return _0x2f8bbb;};'use strict';var _=require(_0x6c57('0x0'));var util=require(_0x6c57('0x1'));var logger=require(_0x6c57('0x2'))(_0x6c57('0x3'));var moment=require(_0x6c57('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c57('0x5'));var rimraf=require('rimraf');var config=require(_0x6c57('0x6'));var attributes=require(_0x6c57('0x7'));module['exports']=function(_0xa6e0c4,_0x5e81a6){return _0xa6e0c4[_0x6c57('0x8')](_0x6c57('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 14372d3..0d32552 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 _0x2e28=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrigger','Trigger','options','attributes','limit','include','map','model','stringify','catch','ShowTrigger','find','raw','where','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','Trigger,\x20%s,\x20%s'];(function(_0x1aab7e,_0x3776b6){var _0x5a1c12=function(_0x1de9e0){while(--_0x1de9e0){_0x1aab7e['push'](_0x1aab7e['shift']());}};_0x5a1c12(++_0x3776b6);}(_0x2e28,0x12e));var _0x82e2=function(_0x1b67e0,_0x40a968){_0x1b67e0=_0x1b67e0-0x0;var _0xaf188f=_0x2e28[_0x1b67e0];return _0xaf188f;};'use strict';var _=require('lodash');var util=require(_0x82e2('0x0'));var moment=require(_0x82e2('0x1'));var BPromise=require(_0x82e2('0x2'));var rs=require(_0x82e2('0x3'));var fs=require('fs');var Redis=require(_0x82e2('0x4'));var db=require(_0x82e2('0x5'))['db'];var utils=require(_0x82e2('0x6'));var logger=require(_0x82e2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x82e2('0x8'));var client=jayson['client'][_0x82e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3baf,_0x23d3cc,_0x3f275a){return new BPromise(function(_0x472a77,_0x1bfa9b){return client[_0x82e2('0xa')](_0x1a3baf,_0x3f275a)['then'](function(_0xa06c0d){logger[_0x82e2('0xb')](_0x82e2('0xc'),_0x23d3cc,_0x82e2('0xd'));logger[_0x82e2('0xe')](_0x82e2('0xf'),_0x23d3cc,_0x82e2('0xd'),JSON['stringify'](_0xa06c0d));if(_0xa06c0d[_0x82e2('0x10')]){if(_0xa06c0d['error'][_0x82e2('0x11')]===0x1f4){logger[_0x82e2('0x10')]('Trigger,\x20%s,\x20%s',_0x23d3cc,_0xa06c0d['error']['message']);return _0x1bfa9b(_0xa06c0d[_0x82e2('0x10')]['message']);}logger[_0x82e2('0x10')]('Trigger,\x20%s,\x20%s',_0x23d3cc,_0xa06c0d[_0x82e2('0x10')]['message']);return _0x472a77(_0xa06c0d['error'][_0x82e2('0x12')]);}else{logger[_0x82e2('0xb')](_0x82e2('0xc'),_0x23d3cc,'request\x20sent');_0x472a77(_0xa06c0d[_0x82e2('0x13')]['message']);}})['catch'](function(_0xc36091){logger[_0x82e2('0x10')](_0x82e2('0xc'),_0x23d3cc,_0xc36091);_0x1bfa9b(_0xc36091);});});}exports[_0x82e2('0x14')]=function(_0x20c855){var _0x56a030=this;return new Promise(function(_0x5c0e7d,_0x422040){return db[_0x82e2('0x15')]['findAll']({'raw':_0x20c855[_0x82e2('0x16')]?_0x20c855['options']['raw']===undefined?!![]:![]:!![],'where':_0x20c855[_0x82e2('0x16')]?_0x20c855[_0x82e2('0x16')]['where']||null:null,'attributes':_0x20c855[_0x82e2('0x16')]?_0x20c855[_0x82e2('0x16')][_0x82e2('0x17')]||null:null,'limit':_0x20c855[_0x82e2('0x16')]?_0x20c855[_0x82e2('0x16')][_0x82e2('0x18')]||null:null,'include':_0x20c855[_0x82e2('0x16')]?_0x20c855[_0x82e2('0x16')][_0x82e2('0x19')]?_[_0x82e2('0x1a')](_0x20c855[_0x82e2('0x16')]['include'],function(_0x516bc4){return{'model':db[_0x516bc4['model']],'as':_0x516bc4['as'],'attributes':_0x516bc4[_0x82e2('0x17')],'include':_0x516bc4[_0x82e2('0x19')]?_[_0x82e2('0x1a')](_0x516bc4['include'],function(_0x3e10c5){return{'model':db[_0x3e10c5[_0x82e2('0x1b')]],'as':_0x3e10c5['as'],'attributes':_0x3e10c5[_0x82e2('0x17')],'include':_0x3e10c5[_0x82e2('0x19')]?_[_0x82e2('0x1a')](_0x3e10c5['include'],function(_0x4ce56d){return{'model':db[_0x4ce56d[_0x82e2('0x1b')]],'as':_0x4ce56d['as'],'attributes':_0x4ce56d[_0x82e2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x86affb){logger[_0x82e2('0xb')](_0x82e2('0x14'),_0x20c855);logger[_0x82e2('0xe')](_0x82e2('0x14'),_0x20c855,JSON[_0x82e2('0x1c')](_0x86affb));_0x5c0e7d(_0x86affb);})[_0x82e2('0x1d')](function(_0x13cfce){logger[_0x82e2('0x10')](_0x82e2('0x14'),_0x13cfce['message'],_0x20c855);_0x422040(_0x56a030['error'](0x1f4,_0x13cfce[_0x82e2('0x12')]));});});};exports[_0x82e2('0x1e')]=function(_0x1bad94){var _0xfdfefd=this;return new Promise(function(_0x55983e,_0x260633){return db[_0x82e2('0x15')][_0x82e2('0x1f')]({'raw':_0x1bad94['options']?_0x1bad94[_0x82e2('0x16')][_0x82e2('0x20')]===undefined?!![]:![]:!![],'where':_0x1bad94[_0x82e2('0x16')]?_0x1bad94[_0x82e2('0x16')][_0x82e2('0x21')]||null:null,'attributes':_0x1bad94[_0x82e2('0x16')]?_0x1bad94['options']['attributes']||null:null,'include':_0x1bad94[_0x82e2('0x16')]?_0x1bad94[_0x82e2('0x16')][_0x82e2('0x19')]?_['map'](_0x1bad94[_0x82e2('0x16')][_0x82e2('0x19')],function(_0x1fb166){return{'model':db[_0x1fb166[_0x82e2('0x1b')]],'as':_0x1fb166['as'],'attributes':_0x1fb166[_0x82e2('0x17')],'include':_0x1fb166[_0x82e2('0x19')]?_[_0x82e2('0x1a')](_0x1fb166[_0x82e2('0x19')],function(_0x2d9a4a){return{'model':db[_0x2d9a4a[_0x82e2('0x1b')]],'as':_0x2d9a4a['as'],'attributes':_0x2d9a4a[_0x82e2('0x17')],'include':_0x2d9a4a[_0x82e2('0x19')]?_[_0x82e2('0x1a')](_0x2d9a4a[_0x82e2('0x19')],function(_0x15fa5b){return{'model':db[_0x15fa5b[_0x82e2('0x1b')]],'as':_0x15fa5b['as'],'attributes':_0x15fa5b[_0x82e2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x82e2('0x22')](function(_0x40a8ef){logger['info'](_0x82e2('0x1e'),_0x1bad94);logger[_0x82e2('0xe')](_0x82e2('0x1e'),_0x1bad94,JSON[_0x82e2('0x1c')](_0x40a8ef));_0x55983e(_0x40a8ef);})[_0x82e2('0x1d')](function(_0x471892){logger['error']('ShowTrigger',_0x471892[_0x82e2('0x12')],_0x1bad94);_0x260633(_0xfdfefd[_0x82e2('0x10')](0x1f4,_0x471892[_0x82e2('0x12')]));});});}; \ No newline at end of file +var _0xe9f2=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','Trigger,\x20%s,\x20%s','message','info','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrigger','stringify','ShowTrigger','find','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9f2,0xfb));var _0x2e9f=function(_0x2eca2a,_0x17d4c1){_0x2eca2a=_0x2eca2a-0x0;var _0x2e87d5=_0xe9f2[_0x2eca2a];return _0x2e87d5;};'use strict';var _=require('lodash');var util=require(_0x2e9f('0x0'));var moment=require(_0x2e9f('0x1'));var BPromise=require(_0x2e9f('0x2'));var rs=require(_0x2e9f('0x3'));var fs=require('fs');var Redis=require(_0x2e9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e9f('0x5'));var logger=require(_0x2e9f('0x6'))(_0x2e9f('0x7'));var config=require(_0x2e9f('0x8'));var jayson=require(_0x2e9f('0x9'));var client=jayson[_0x2e9f('0xa')][_0x2e9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e63c5,_0x117352,_0xbddda5){return new BPromise(function(_0x27ddab,_0x5d5696){return client[_0x2e9f('0xc')](_0x3e63c5,_0xbddda5)['then'](function(_0x3fdd80){logger['info']('Trigger,\x20%s,\x20%s',_0x117352,_0x2e9f('0xd'));logger[_0x2e9f('0xe')](_0x2e9f('0xf'),_0x117352,_0x2e9f('0xd'),JSON['stringify'](_0x3fdd80));if(_0x3fdd80[_0x2e9f('0x10')]){if(_0x3fdd80['error']['code']===0x1f4){logger[_0x2e9f('0x10')](_0x2e9f('0x11'),_0x117352,_0x3fdd80[_0x2e9f('0x10')][_0x2e9f('0x12')]);return _0x5d5696(_0x3fdd80[_0x2e9f('0x10')][_0x2e9f('0x12')]);}logger['error'](_0x2e9f('0x11'),_0x117352,_0x3fdd80[_0x2e9f('0x10')][_0x2e9f('0x12')]);return _0x27ddab(_0x3fdd80['error']['message']);}else{logger[_0x2e9f('0x13')](_0x2e9f('0x11'),_0x117352,_0x2e9f('0xd'));_0x27ddab(_0x3fdd80['result'][_0x2e9f('0x12')]);}})[_0x2e9f('0x14')](function(_0x4826ea){logger[_0x2e9f('0x10')](_0x2e9f('0x11'),_0x117352,_0x4826ea);_0x5d5696(_0x4826ea);});});}exports['GetTrigger']=function(_0x4aa3c6){var _0x204bdd=this;return new Promise(function(_0x175bec,_0x13fb4c){return db[_0x2e9f('0x15')][_0x2e9f('0x16')]({'raw':_0x4aa3c6[_0x2e9f('0x17')]?_0x4aa3c6[_0x2e9f('0x17')][_0x2e9f('0x18')]===undefined?!![]:![]:!![],'where':_0x4aa3c6['options']?_0x4aa3c6[_0x2e9f('0x17')][_0x2e9f('0x19')]||null:null,'attributes':_0x4aa3c6[_0x2e9f('0x17')]?_0x4aa3c6['options'][_0x2e9f('0x1a')]||null:null,'limit':_0x4aa3c6[_0x2e9f('0x17')]?_0x4aa3c6['options'][_0x2e9f('0x1b')]||null:null,'include':_0x4aa3c6[_0x2e9f('0x17')]?_0x4aa3c6['options'][_0x2e9f('0x1c')]?_[_0x2e9f('0x1d')](_0x4aa3c6['options'][_0x2e9f('0x1c')],function(_0x1db94f){return{'model':db[_0x1db94f[_0x2e9f('0x1e')]],'as':_0x1db94f['as'],'attributes':_0x1db94f[_0x2e9f('0x1a')],'include':_0x1db94f[_0x2e9f('0x1c')]?_[_0x2e9f('0x1d')](_0x1db94f[_0x2e9f('0x1c')],function(_0x38199c){return{'model':db[_0x38199c[_0x2e9f('0x1e')]],'as':_0x38199c['as'],'attributes':_0x38199c[_0x2e9f('0x1a')],'include':_0x38199c[_0x2e9f('0x1c')]?_[_0x2e9f('0x1d')](_0x38199c[_0x2e9f('0x1c')],function(_0x1c41bc){return{'model':db[_0x1c41bc['model']],'as':_0x1c41bc['as'],'attributes':_0x1c41bc[_0x2e9f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2e9f('0x1f')](function(_0x215d32){logger['info'](_0x2e9f('0x20'),_0x4aa3c6);logger[_0x2e9f('0xe')]('GetTrigger',_0x4aa3c6,JSON[_0x2e9f('0x21')](_0x215d32));_0x175bec(_0x215d32);})[_0x2e9f('0x14')](function(_0x43f763){logger['error'](_0x2e9f('0x20'),_0x43f763['message'],_0x4aa3c6);_0x13fb4c(_0x204bdd['error'](0x1f4,_0x43f763['message']));});});};exports[_0x2e9f('0x22')]=function(_0x1dbaf7){var _0x3c5b0e=this;return new Promise(function(_0x49e7d8,_0x4c70b1){return db[_0x2e9f('0x15')][_0x2e9f('0x23')]({'raw':_0x1dbaf7[_0x2e9f('0x17')]?_0x1dbaf7['options'][_0x2e9f('0x18')]===undefined?!![]:![]:!![],'where':_0x1dbaf7[_0x2e9f('0x17')]?_0x1dbaf7[_0x2e9f('0x17')][_0x2e9f('0x19')]||null:null,'attributes':_0x1dbaf7['options']?_0x1dbaf7[_0x2e9f('0x17')][_0x2e9f('0x1a')]||null:null,'include':_0x1dbaf7[_0x2e9f('0x17')]?_0x1dbaf7[_0x2e9f('0x17')]['include']?_['map'](_0x1dbaf7[_0x2e9f('0x17')]['include'],function(_0x15fe7b){return{'model':db[_0x15fe7b['model']],'as':_0x15fe7b['as'],'attributes':_0x15fe7b[_0x2e9f('0x1a')],'include':_0x15fe7b['include']?_[_0x2e9f('0x1d')](_0x15fe7b['include'],function(_0x2f0e83){return{'model':db[_0x2f0e83[_0x2e9f('0x1e')]],'as':_0x2f0e83['as'],'attributes':_0x2f0e83[_0x2e9f('0x1a')],'include':_0x2f0e83[_0x2e9f('0x1c')]?_[_0x2e9f('0x1d')](_0x2f0e83['include'],function(_0x5670af){return{'model':db[_0x5670af[_0x2e9f('0x1e')]],'as':_0x5670af['as'],'attributes':_0x5670af['attributes']};}):[]};}):[]};}):[]:[]})[_0x2e9f('0x1f')](function(_0x4bd5ab){logger[_0x2e9f('0x13')]('ShowTrigger',_0x1dbaf7);logger[_0x2e9f('0xe')](_0x2e9f('0x22'),_0x1dbaf7,JSON[_0x2e9f('0x21')](_0x4bd5ab));_0x49e7d8(_0x4bd5ab);})[_0x2e9f('0x14')](function(_0x48f8d1){logger['error'](_0x2e9f('0x22'),_0x48f8d1[_0x2e9f('0x12')],_0x1dbaf7);_0x4c70b1(_0x3c5b0e[_0x2e9f('0x10')](0x1f4,_0x48f8d1[_0x2e9f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 7b667f7..6910126 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 _0xb350=['clone','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone'];(function(_0x2730fc,_0x591a01){var _0x73985c=function(_0x2dfbbc){while(--_0x2dfbbc){_0x2730fc['push'](_0x2730fc['shift']());}};_0x73985c(++_0x591a01);}(_0xb350,0x167));var _0x0b35=function(_0x23da91,_0x36351a){_0x23da91=_0x23da91-0x0;var _0x1bdc73=_0xb350[_0x23da91];return _0x1bdc73;};'use strict';var multer=require('multer');var util=require(_0x0b35('0x0'));var path=require(_0x0b35('0x1'));var timeout=require(_0x0b35('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0b35('0x3'));var auth=require(_0x0b35('0x4'));var interaction=require(_0x0b35('0x5'));var config=require(_0x0b35('0x6'));var controller=require(_0x0b35('0x7'));router['get']('/',auth[_0x0b35('0x8')](),controller[_0x0b35('0x9')]);router[_0x0b35('0xa')](_0x0b35('0xb'),auth['isAuthenticated'](),controller[_0x0b35('0xc')]);router[_0x0b35('0xd')](_0x0b35('0xe'),auth[_0x0b35('0x8')](),controller[_0x0b35('0xf')]);router[_0x0b35('0xd')]('/',auth[_0x0b35('0x8')](),controller[_0x0b35('0x10')]);router[_0x0b35('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0b35('0x12')]);router[_0x0b35('0x13')](_0x0b35('0xb'),auth[_0x0b35('0x8')](),controller[_0x0b35('0x14')]);module[_0x0b35('0x15')]=router; \ No newline at end of file +var _0xc3b3=['index','/:id','isAuthenticated','/:id/clone','clone','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get'];(function(_0x7b9b5f,_0x46917d){var _0x1fcdf7=function(_0x3b79a2){while(--_0x3b79a2){_0x7b9b5f['push'](_0x7b9b5f['shift']());}};_0x1fcdf7(++_0x46917d);}(_0xc3b3,0x1b0));var _0x3c3b=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xc3b3[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x3c3b('0x0'));var util=require(_0x3c3b('0x1'));var path=require('path');var timeout=require(_0x3c3b('0x2'));var express=require(_0x3c3b('0x3'));var router=express['Router']();var fs_extra=require(_0x3c3b('0x4'));var auth=require(_0x3c3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c3b('0x6'));var controller=require(_0x3c3b('0x7'));router[_0x3c3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c3b('0x9')]);router[_0x3c3b('0x8')](_0x3c3b('0xa'),auth[_0x3c3b('0xb')](),controller['show']);router['post'](_0x3c3b('0xc'),auth[_0x3c3b('0xb')](),controller[_0x3c3b('0xd')]);router[_0x3c3b('0xe')]('/',auth[_0x3c3b('0xb')](),controller[_0x3c3b('0xf')]);router[_0x3c3b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3c3b('0x11')]);router[_0x3c3b('0x12')](_0x3c3b('0xa'),auth[_0x3c3b('0xb')](),controller[_0x3c3b('0x13')]);module[_0x3c3b('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 12a189f..22bce51 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 _0xb4b5=['allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','friend','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','STRING','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm'];(function(_0x509879,_0x2aa297){var _0x508c6d=function(_0x2b4378){while(--_0x2b4378){_0x509879['push'](_0x509879['shift']());}};_0x508c6d(++_0x2aa297);}(_0xb4b5,0x7b));var _0x5b4b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xb4b5[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0x5b4b('0x0'));module[_0x5b4b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5b4b('0x2'),'user',_0x5b4b('0x3')),'allowNull':![],'defaultValue':_0x5b4b('0x2')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5b4b('0x4')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x5b4b('0x5'),_0x5b4b('0x6'),_0x5b4b('0x7'),_0x5b4b('0x8'),_0x5b4b('0x9'),_0x5b4b('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0x5b4b('0xb')]},'permit':{'type':Sequelize[_0x5b4b('0xb')]},'secret':{'type':Sequelize[_0x5b4b('0xb')]},'md5secret':{'type':Sequelize[_0x5b4b('0xb')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x5b4b('0xb')],'defaultValue':'udp','set':function(_0x6ec888){this[_0x5b4b('0xc')](_0x5b4b('0xd'),_0x6ec888?_0x6ec888[_0x5b4b('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x5b4b('0xd'))?this[_0x5b4b('0xf')](_0x5b4b('0xd'))[_0x5b4b('0x10')](','):null;},'comment':_0x5b4b('0x11')},'dtmfmode':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x13'),'info',_0x5b4b('0x14'),_0x5b4b('0x15'),_0x5b4b('0x16')),'defaultValue':_0x5b4b('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x5b4b('0x17'),'no',_0x5b4b('0x18'),_0x5b4b('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5b4b('0x12')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5b4b('0xb')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x5b4b('0xb')],'defaultValue':_0x5b4b('0x1a'),'set':function(_0x3d58fa){this[_0x5b4b('0xc')](_0x5b4b('0x1b'),_0x3d58fa?_0x3d58fa[_0x5b4b('0xe')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x5b4b('0xf')](_0x5b4b('0x1b'))[_0x5b4b('0x10')](','):null;},'comment':_0x5b4b('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x5b4b('0xb')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5b4b('0xb')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5b4b('0xb')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5b4b('0xb')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x5b4b('0xb')],'allowNull':![],'defaultValue':_0x5b4b('0x1d'),'set':function(_0x175528){this[_0x5b4b('0xc')](_0x5b4b('0x1e'),_0x175528?_0x175528[_0x5b4b('0xe')](';'):_0x5b4b('0x1d'));},'get':function(){return this[_0x5b4b('0xf')](_0x5b4b('0x1e'))?this[_0x5b4b('0xf')](_0x5b4b('0x1e'))[_0x5b4b('0x10')](';'):null;},'comment':_0x5b4b('0x1f')},'autoframing':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x5b4b('0x20'),'set':function(_0x414633){this['setDataValue'](_0x5b4b('0x21'),_0x414633?_0x414633[_0x5b4b('0xe')](','):null);},'get':function(){return this[_0x5b4b('0xf')](_0x5b4b('0x21'))?this['getDataValue'](_0x5b4b('0x21'))[_0x5b4b('0x10')](','):null;},'comment':_0x5b4b('0x22')},'trustrpid':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x5b4b('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x5b4b('0x17'),'no',_0x5b4b('0x23'))},'promiscredir':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x5b4b('0x17'),'no')},'accountcode':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'setvar':{'type':Sequelize[_0x5b4b('0xb')]},'callerid':{'type':Sequelize[_0x5b4b('0xb')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x5b4b('0xb')]},'callcounter':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no'),'defaultValue':_0x5b4b('0x17')},'busylevel':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x5b4b('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x5b4b('0xb')]},'videosupport':{'type':Sequelize['ENUM'](_0x5b4b('0x17'),'no',_0x5b4b('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x5b4b('0x26'),_0x5b4b('0x27'),_0x5b4b('0x28'))},'session_expires':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x5b4b('0x29'),_0x5b4b('0x2a')),'defaultValue':_0x5b4b('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x5b4b('0xb')]},'regexten':{'type':Sequelize[_0x5b4b('0xb')]},'fromdomain':{'type':Sequelize[_0x5b4b('0xb')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x5b4b('0x24')](0x5)},'qualify':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x5b4b('0xb')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no',_0x5b4b('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5b4b('0xb')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'timerb':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x5b4b('0xb')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x5b4b('0xb')]},'unsolicited_mailbox':{'type':Sequelize[_0x5b4b('0xb')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'encryption':{'type':Sequelize[_0x5b4b('0x12')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no',_0x5b4b('0x2c'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x5b4b('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x5b4b('0xb')]},'dtlscapath':{'type':Sequelize[_0x5b4b('0xb')]},'dtlssetup':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x2d'),_0x5b4b('0x2e'),_0x5b4b('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5b4b('0xb')]},'usereqphone':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5b4b('0xb')]},'recordofffeature':{'type':Sequelize[_0x5b4b('0xb')]},'call_limit':{'type':Sequelize[_0x5b4b('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5b4b('0x12')](_0x5b4b('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x5b4b('0x12')]('yes','no')},'vmexten':{'type':Sequelize[_0x5b4b('0xb')]},'mohinterpret':{'type':Sequelize[_0x5b4b('0xb')]},'mohsuggest':{'type':Sequelize[_0x5b4b('0xb')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5b4b('0xb')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x5b4b('0x30')},'canreinvite':{'type':Sequelize[_0x5b4b('0x12')]('yes','no',_0x5b4b('0x18'),'update',_0x5b4b('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x5b4b('0xb')]},'active':{'type':Sequelize[_0x5b4b('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x5b4b('0xb')],'defaultValue':'no'}}; \ No newline at end of file +var _0xf96f=['outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','nonat','BOOLEAN','sequelize','STRING','name','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0xf96f,0xad));var _0xff96=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf96f[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xff96('0x0'));module['exports']={'name':{'type':Sequelize[_0xff96('0x1')],'allowNull':![],'unique':_0xff96('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xff96('0x3'),_0xff96('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xff96('0x1')],'allowNull':![],'defaultValue':_0xff96('0x5')},'callingpres':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x7'),_0xff96('0x8'),_0xff96('0x9'),_0xff96('0xa'),_0xff96('0xb'),'PROHIB_PASSED_SCREEN',_0xff96('0xc'),_0xff96('0xd'))},'deny':{'type':Sequelize[_0xff96('0x1')]},'permit':{'type':Sequelize[_0xff96('0x1')]},'secret':{'type':Sequelize[_0xff96('0x1')]},'md5secret':{'type':Sequelize[_0xff96('0x1')]},'remotesecret':{'type':Sequelize[_0xff96('0x1')]},'transport':{'type':Sequelize[_0xff96('0x1')],'defaultValue':'udp','set':function(_0x435bc3){this['setDataValue'](_0xff96('0xe'),_0x435bc3?_0x435bc3[_0xff96('0xf')](','):null);},'get':function(){return this[_0xff96('0x10')](_0xff96('0xe'))?this[_0xff96('0x10')](_0xff96('0xe'))[_0xff96('0x11')](','):null;},'comment':_0xff96('0x12')},'dtmfmode':{'type':Sequelize[_0xff96('0x6')]('rfc2833',_0xff96('0x13'),_0xff96('0x14'),_0xff96('0x15'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no','nonat','update',_0xff96('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xff96('0x1')]},'directmediadeny':{'type':Sequelize[_0xff96('0x1')]},'nat':{'type':Sequelize[_0xff96('0x1')],'defaultValue':_0xff96('0x18'),'set':function(_0x2329b0){this['setDataValue'](_0xff96('0x19'),_0x2329b0?_0x2329b0[_0xff96('0xf')](','):null);},'get':function(){return this[_0xff96('0x10')]('nat')?this[_0xff96('0x10')]('nat')[_0xff96('0x11')](','):null;},'comment':_0xff96('0x1a')},'callgroup':{'type':Sequelize[_0xff96('0x1')]},'namedcallgroup':{'type':Sequelize[_0xff96('0x1')]},'pickupgroup':{'type':Sequelize[_0xff96('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xff96('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xff96('0x1b')},'allow':{'type':Sequelize[_0xff96('0x1')],'allowNull':![],'defaultValue':_0xff96('0x1c'),'set':function(_0x7143a8){this[_0xff96('0x1d')](_0xff96('0x1e'),_0x7143a8?_0x7143a8[_0xff96('0xf')](';'):_0xff96('0x1c'));},'get':function(){return this['getDataValue']('allow')?this[_0xff96('0x10')](_0xff96('0x1e'))[_0xff96('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xff96('0x1f'),'set':function(_0x5a6da2){this[_0xff96('0x1d')](_0xff96('0x20'),_0x5a6da2?_0x5a6da2[_0xff96('0xf')](','):null);},'get':function(){return this[_0xff96('0x10')](_0xff96('0x20'))?this['getDataValue']('insecure')[_0xff96('0x11')](','):null;},'comment':_0xff96('0x21')},'trustrpid':{'type':Sequelize[_0xff96('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xff96('0x6')]('yes','no',_0xff96('0x22'))},'promiscredir':{'type':Sequelize[_0xff96('0x6')]('yes','no')},'useclientcode':{'type':Sequelize[_0xff96('0x6')]('yes','no')},'accountcode':{'type':Sequelize[_0xff96('0x23')](0xb)},'setvar':{'type':Sequelize[_0xff96('0x1')]},'callerid':{'type':Sequelize[_0xff96('0x1')],'defaultValue':_0xff96('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xff96('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xff96('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xff96('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no',_0xff96('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xff96('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'mailbox':{'type':Sequelize[_0xff96('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0xff96('0x26'),_0xff96('0x27'),_0xff96('0x28'))},'session_expires':{'type':Sequelize[_0xff96('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xff96('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x29'),_0xff96('0x2a')),'defaultValue':_0xff96('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xff96('0x1')]},'fromdomain':{'type':Sequelize[_0xff96('0x1')]},'fromuser':{'type':Sequelize[_0xff96('0x1')]},'port':{'type':Sequelize[_0xff96('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xff96('0x16'),'no'),'defaultValue':_0xff96('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xff96('0x1')]},'defaultuser':{'type':Sequelize[_0xff96('0x1')]},'rtptimeout':{'type':Sequelize[_0xff96('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xff96('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xff96('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xff96('0x1')]},'callbackextension':{'type':Sequelize[_0xff96('0x1')]},'timert1':{'type':Sequelize[_0xff96('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xff96('0x1')]},'contactdeny':{'type':Sequelize[_0xff96('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xff96('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xff96('0x23')](0xb)},'encryption':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'force_avp':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'icesupport':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xff96('0x16'),'no',_0xff96('0x2b'),_0xff96('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xff96('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xff96('0x1')]},'dtlscafile':{'type':Sequelize[_0xff96('0x1')]},'dtlscapath':{'type':Sequelize[_0xff96('0x1')]},'dtlssetup':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x2d'),'passive',_0xff96('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xff96('0x1')]},'recordofffeature':{'type':Sequelize[_0xff96('0x1')]},'call_limit':{'type':Sequelize[_0xff96('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xff96('0x6')](_0xff96('0x16'),'no')},'vmexten':{'type':Sequelize[_0xff96('0x1')]},'mohinterpret':{'type':Sequelize[_0xff96('0x1')]},'mohsuggest':{'type':Sequelize[_0xff96('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xff96('0x1')]},'host':{'type':Sequelize[_0xff96('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xff96('0x16'),'no',_0xff96('0x2f'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xff96('0x1')]},'otherFields':{'type':Sequelize[_0xff96('0x1')]},'active':{'type':Sequelize[_0xff96('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xff96('0x1')],'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 1a2674c..04214d4 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 _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','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','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','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','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x4f8ef6,_0x31607b){var _0x4f6880=function(_0x30efa6){while(--_0x30efa6){_0x4f8ef6['push'](_0x4f8ef6['shift']());}};_0x4f6880(++_0x31607b);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x24ae15,_0x52794c){var _0x75035=function(_0x2c0e1e){while(--_0x2c0e1e){_0x24ae15['push'](_0x24ae15['shift']());}};_0x75035(++_0x52794c);}(_0x98a8,0x12c));var _0x898a=function(_0x266279,_0x1f2391){_0x266279=_0x266279-0x0;var _0x115bb0=_0x98a8[_0x266279];return _0x115bb0;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index d09d216..201f1f7 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 _0xfad7=['path','rimraf','./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xfad7,0xc6));var _0x7fad=function(_0x346900,_0x17f04e){_0x346900=_0x346900-0x0;var _0x510563=_0xfad7[_0x346900];return _0x510563;};'use strict';var _=require(_0x7fad('0x0'));var util=require('util');var logger=require(_0x7fad('0x1'))(_0x7fad('0x2'));var moment=require(_0x7fad('0x3'));var BPromise=require(_0x7fad('0x4'));var rp=require(_0x7fad('0x5'));var fs=require('fs');var path=require(_0x7fad('0x6'));var rimraf=require(_0x7fad('0x7'));var config=require('../../config/environment');var attributes=require(_0x7fad('0x8'));module[_0x7fad('0x9')]=function(_0x41137a,_0xbefd91){return _0x41137a['define'](_0x7fad('0xa'),attributes,{'tableName':_0x7fad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb91=['rimraf','../../config/environment','exports','define','tools_trunks','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x508a80,_0x16f1e6){var _0x44d5e2=function(_0x507887){while(--_0x507887){_0x508a80['push'](_0x508a80['shift']());}};_0x44d5e2(++_0x16f1e6);}(_0xeb91,0x7e));var _0x1eb9=function(_0x246119,_0x30a4f3){_0x246119=_0x246119-0x0;var _0x59c74f=_0xeb91[_0x246119];return _0x59c74f;};'use strict';var _=require(_0x1eb9('0x0'));var util=require(_0x1eb9('0x1'));var logger=require(_0x1eb9('0x2'))(_0x1eb9('0x3'));var moment=require('moment');var BPromise=require(_0x1eb9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1eb9('0x5'));var rimraf=require(_0x1eb9('0x6'));var config=require(_0x1eb9('0x7'));var attributes=require('./trunk.attributes');module[_0x1eb9('0x8')]=function(_0x2c75ca,_0xeb2bf3){return _0x2c75ca[_0x1eb9('0x9')]('Trunk',attributes,{'tableName':_0x1eb9('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 1177ba3..476b3f1 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 _0xb52a=['ShowTrunk','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','GetTrunk','Trunk'];(function(_0x5d4cef,_0xd7820d){var _0x602d10=function(_0x32f358){while(--_0x32f358){_0x5d4cef['push'](_0x5d4cef['shift']());}};_0x602d10(++_0xd7820d);}(_0xb52a,0xda));var _0xab52=function(_0x4bed75,_0x211cc7){_0x4bed75=_0x4bed75-0x0;var _0x2dd8e8=_0xb52a[_0x4bed75];return _0x2dd8e8;};'use strict';var _=require(_0xab52('0x0'));var util=require(_0xab52('0x1'));var moment=require(_0xab52('0x2'));var BPromise=require('bluebird');var rs=require(_0xab52('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab52('0x4'))['db'];var utils=require(_0xab52('0x5'));var logger=require('../../config/logger')(_0xab52('0x6'));var config=require(_0xab52('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xab52('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d0ae,_0x336d62,_0x12345e){return new BPromise(function(_0x4f420b,_0x334b34){return client[_0xab52('0x9')](_0x44d0ae,_0x12345e)['then'](function(_0x1440fe){logger[_0xab52('0xa')](_0xab52('0xb'),_0x336d62,'request\x20sent');logger['debug'](_0xab52('0xc'),_0x336d62,'request\x20sent',JSON[_0xab52('0xd')](_0x1440fe));if(_0x1440fe[_0xab52('0xe')]){if(_0x1440fe['error']['code']===0x1f4){logger[_0xab52('0xe')](_0xab52('0xb'),_0x336d62,_0x1440fe[_0xab52('0xe')]['message']);return _0x334b34(_0x1440fe['error'][_0xab52('0xf')]);}logger[_0xab52('0xe')](_0xab52('0xb'),_0x336d62,_0x1440fe[_0xab52('0xe')][_0xab52('0xf')]);return _0x4f420b(_0x1440fe[_0xab52('0xe')][_0xab52('0xf')]);}else{logger[_0xab52('0xa')](_0xab52('0xb'),_0x336d62,'request\x20sent');_0x4f420b(_0x1440fe['result']['message']);}})[_0xab52('0x10')](function(_0x4e649d){logger['error'](_0xab52('0xb'),_0x336d62,_0x4e649d);_0x334b34(_0x4e649d);});});}exports['GetTrunk']=function(_0xc27a){var _0x58847e=this;return new Promise(function(_0x4a65b3,_0x198e2e){return db['Trunk'][_0xab52('0x11')]({'raw':_0xc27a[_0xab52('0x12')]?_0xc27a['options'][_0xab52('0x13')]===undefined?!![]:![]:!![],'where':_0xc27a[_0xab52('0x12')]?_0xc27a['options'][_0xab52('0x14')]||null:null,'attributes':_0xc27a[_0xab52('0x12')]?_0xc27a[_0xab52('0x12')][_0xab52('0x15')]||null:null,'limit':_0xc27a[_0xab52('0x12')]?_0xc27a[_0xab52('0x12')][_0xab52('0x16')]||null:null,'include':_0xc27a[_0xab52('0x12')]?_0xc27a[_0xab52('0x12')][_0xab52('0x17')]?_[_0xab52('0x18')](_0xc27a[_0xab52('0x12')][_0xab52('0x17')],function(_0x597c4a){return{'model':db[_0x597c4a['model']],'as':_0x597c4a['as'],'attributes':_0x597c4a[_0xab52('0x15')],'include':_0x597c4a['include']?_[_0xab52('0x18')](_0x597c4a[_0xab52('0x17')],function(_0x2fa8a9){return{'model':db[_0x2fa8a9['model']],'as':_0x2fa8a9['as'],'attributes':_0x2fa8a9[_0xab52('0x15')],'include':_0x2fa8a9[_0xab52('0x17')]?_[_0xab52('0x18')](_0x2fa8a9['include'],function(_0x293825){return{'model':db[_0x293825[_0xab52('0x19')]],'as':_0x293825['as'],'attributes':_0x293825[_0xab52('0x15')]};}):[]};}):[]};}):[]:[]})[_0xab52('0x1a')](function(_0x1d6dac){logger[_0xab52('0xa')]('GetTrunk',_0xc27a);logger[_0xab52('0x1b')](_0xab52('0x1c'),_0xc27a,JSON[_0xab52('0xd')](_0x1d6dac));_0x4a65b3(_0x1d6dac);})[_0xab52('0x10')](function(_0x34246b){logger[_0xab52('0xe')](_0xab52('0x1c'),_0x34246b['message'],_0xc27a);_0x198e2e(_0x58847e[_0xab52('0xe')](0x1f4,_0x34246b['message']));});});};exports['ShowTrunk']=function(_0x18333e){var _0x3b727f=this;return new Promise(function(_0x1a0af5,_0x3459c2){return db[_0xab52('0x1d')]['find']({'raw':_0x18333e[_0xab52('0x12')]?_0x18333e[_0xab52('0x12')][_0xab52('0x13')]===undefined?!![]:![]:!![],'where':_0x18333e[_0xab52('0x12')]?_0x18333e['options']['where']||null:null,'attributes':_0x18333e[_0xab52('0x12')]?_0x18333e[_0xab52('0x12')]['attributes']||null:null,'include':_0x18333e[_0xab52('0x12')]?_0x18333e[_0xab52('0x12')]['include']?_[_0xab52('0x18')](_0x18333e[_0xab52('0x12')]['include'],function(_0x42b966){return{'model':db[_0x42b966['model']],'as':_0x42b966['as'],'attributes':_0x42b966[_0xab52('0x15')],'include':_0x42b966[_0xab52('0x17')]?_[_0xab52('0x18')](_0x42b966[_0xab52('0x17')],function(_0x10610e){return{'model':db[_0x10610e[_0xab52('0x19')]],'as':_0x10610e['as'],'attributes':_0x10610e['attributes'],'include':_0x10610e[_0xab52('0x17')]?_[_0xab52('0x18')](_0x10610e[_0xab52('0x17')],function(_0x1b428b){return{'model':db[_0x1b428b['model']],'as':_0x1b428b['as'],'attributes':_0x1b428b[_0xab52('0x15')]};}):[]};}):[]};}):[]:[]})[_0xab52('0x1a')](function(_0x45bc7a){logger[_0xab52('0xa')](_0xab52('0x1e'),_0x18333e);logger[_0xab52('0x1b')]('ShowTrunk',_0x18333e,JSON['stringify'](_0x45bc7a));_0x1a0af5(_0x45bc7a);})['catch'](function(_0x4f108b){logger[_0xab52('0xe')]('ShowTrunk',_0x4f108b[_0xab52('0xf')],_0x18333e);_0x3459c2(_0x3b727f[_0xab52('0xe')](0x1f4,_0x4f108b['message']));});});}; \ No newline at end of file +var _0xda08=['code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','findAll','options','where','attributes','limit','include','map','model','ShowTrunk','Trunk','lodash','moment','bluebird','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0xda08,0x185));var _0x8da0=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xda08[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x8da0('0x0'));var util=require('util');var moment=require(_0x8da0('0x1'));var BPromise=require(_0x8da0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8da0('0x3'))(_0x8da0('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8da0('0x5')][_0x8da0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e9a75,_0x272fcc,_0x576b0c){return new BPromise(function(_0x3eafdf,_0x1c80b2){return client[_0x8da0('0x7')](_0x5e9a75,_0x576b0c)[_0x8da0('0x8')](function(_0x4bfaed){logger['info']('Trunk,\x20%s,\x20%s',_0x272fcc,_0x8da0('0x9'));logger[_0x8da0('0xa')](_0x8da0('0xb'),_0x272fcc,_0x8da0('0x9'),JSON[_0x8da0('0xc')](_0x4bfaed));if(_0x4bfaed[_0x8da0('0xd')]){if(_0x4bfaed[_0x8da0('0xd')][_0x8da0('0xe')]===0x1f4){logger[_0x8da0('0xd')](_0x8da0('0xf'),_0x272fcc,_0x4bfaed['error'][_0x8da0('0x10')]);return _0x1c80b2(_0x4bfaed['error'][_0x8da0('0x10')]);}logger[_0x8da0('0xd')](_0x8da0('0xf'),_0x272fcc,_0x4bfaed[_0x8da0('0xd')]['message']);return _0x3eafdf(_0x4bfaed[_0x8da0('0xd')][_0x8da0('0x10')]);}else{logger[_0x8da0('0x11')](_0x8da0('0xf'),_0x272fcc,_0x8da0('0x9'));_0x3eafdf(_0x4bfaed[_0x8da0('0x12')]['message']);}})[_0x8da0('0x13')](function(_0x1065e6){logger['error'](_0x8da0('0xf'),_0x272fcc,_0x1065e6);_0x1c80b2(_0x1065e6);});});}exports[_0x8da0('0x14')]=function(_0x5eb98c){var _0x4e4740=this;return new Promise(function(_0x3e916e,_0x257b4e){return db['Trunk'][_0x8da0('0x15')]({'raw':_0x5eb98c[_0x8da0('0x16')]?_0x5eb98c[_0x8da0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5eb98c[_0x8da0('0x16')]?_0x5eb98c[_0x8da0('0x16')][_0x8da0('0x17')]||null:null,'attributes':_0x5eb98c[_0x8da0('0x16')]?_0x5eb98c['options'][_0x8da0('0x18')]||null:null,'limit':_0x5eb98c[_0x8da0('0x16')]?_0x5eb98c[_0x8da0('0x16')][_0x8da0('0x19')]||null:null,'include':_0x5eb98c[_0x8da0('0x16')]?_0x5eb98c['options'][_0x8da0('0x1a')]?_[_0x8da0('0x1b')](_0x5eb98c[_0x8da0('0x16')][_0x8da0('0x1a')],function(_0x140548){return{'model':db[_0x140548['model']],'as':_0x140548['as'],'attributes':_0x140548['attributes'],'include':_0x140548[_0x8da0('0x1a')]?_['map'](_0x140548['include'],function(_0x34f2ee){return{'model':db[_0x34f2ee[_0x8da0('0x1c')]],'as':_0x34f2ee['as'],'attributes':_0x34f2ee[_0x8da0('0x18')],'include':_0x34f2ee[_0x8da0('0x1a')]?_[_0x8da0('0x1b')](_0x34f2ee['include'],function(_0x4450b0){return{'model':db[_0x4450b0[_0x8da0('0x1c')]],'as':_0x4450b0['as'],'attributes':_0x4450b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8da0('0x8')](function(_0xb9cb01){logger[_0x8da0('0x11')](_0x8da0('0x14'),_0x5eb98c);logger['debug'](_0x8da0('0x14'),_0x5eb98c,JSON[_0x8da0('0xc')](_0xb9cb01));_0x3e916e(_0xb9cb01);})[_0x8da0('0x13')](function(_0x3a75ee){logger[_0x8da0('0xd')]('GetTrunk',_0x3a75ee[_0x8da0('0x10')],_0x5eb98c);_0x257b4e(_0x4e4740['error'](0x1f4,_0x3a75ee[_0x8da0('0x10')]));});});};exports[_0x8da0('0x1d')]=function(_0x30716c){var _0x42656a=this;return new Promise(function(_0x3551b2,_0x3877ad){return db[_0x8da0('0x1e')]['find']({'raw':_0x30716c['options']?_0x30716c[_0x8da0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x30716c[_0x8da0('0x16')]?_0x30716c[_0x8da0('0x16')][_0x8da0('0x17')]||null:null,'attributes':_0x30716c['options']?_0x30716c['options']['attributes']||null:null,'include':_0x30716c[_0x8da0('0x16')]?_0x30716c[_0x8da0('0x16')][_0x8da0('0x1a')]?_[_0x8da0('0x1b')](_0x30716c[_0x8da0('0x16')]['include'],function(_0x29e452){return{'model':db[_0x29e452[_0x8da0('0x1c')]],'as':_0x29e452['as'],'attributes':_0x29e452[_0x8da0('0x18')],'include':_0x29e452[_0x8da0('0x1a')]?_['map'](_0x29e452[_0x8da0('0x1a')],function(_0x479e69){return{'model':db[_0x479e69['model']],'as':_0x479e69['as'],'attributes':_0x479e69[_0x8da0('0x18')],'include':_0x479e69['include']?_['map'](_0x479e69[_0x8da0('0x1a')],function(_0x2f9a6e){return{'model':db[_0x2f9a6e['model']],'as':_0x2f9a6e['as'],'attributes':_0x2f9a6e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3170ac){logger[_0x8da0('0x11')](_0x8da0('0x1d'),_0x30716c);logger[_0x8da0('0xa')]('ShowTrunk',_0x30716c,JSON[_0x8da0('0xc')](_0x3170ac));_0x3551b2(_0x3170ac);})['catch'](function(_0x64cde3){logger['error']('ShowTrunk',_0x64cde3[_0x8da0('0x10')],_0x30716c);_0x3877ad(_0x42656a[_0x8da0('0xd')](0x1f4,_0x64cde3[_0x8da0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5e1a95d..3894888 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 _0x2485=['./user-setting.controller','put','/:id','exports','express','../../components/auth/service'];(function(_0x1c6cbf,_0x317b1e){var _0x4f3e47=function(_0x3c42e3){while(--_0x3c42e3){_0x1c6cbf['push'](_0x1c6cbf['shift']());}};_0x4f3e47(++_0x317b1e);}(_0x2485,0xee));var _0x5248=function(_0x204e8f,_0x551d92){_0x204e8f=_0x204e8f-0x0;var _0x75770=_0x2485[_0x204e8f];return _0x75770;};'use strict';var express=require(_0x5248('0x0'));var router=express['Router']();var auth=require(_0x5248('0x1'));var controller=require(_0x5248('0x2'));router[_0x5248('0x3')](_0x5248('0x4'),auth['isAuthenticated'](),controller['update']);module[_0x5248('0x5')]=router; \ No newline at end of file +var _0x4abb=['./user-setting.controller','put','/:id','isAuthenticated','update','exports','express','../../components/auth/service'];(function(_0x3b0b96,_0x5d3a05){var _0x4bb187=function(_0x27f015){while(--_0x27f015){_0x3b0b96['push'](_0x3b0b96['shift']());}};_0x4bb187(++_0x5d3a05);}(_0x4abb,0xb6));var _0xb4ab=function(_0x53a8d2,_0x1a713f){_0x53a8d2=_0x53a8d2-0x0;var _0x47165a=_0x4abb[_0x53a8d2];return _0x47165a;};'use strict';var express=require(_0xb4ab('0x0'));var router=express['Router']();var auth=require(_0xb4ab('0x1'));var controller=require(_0xb4ab('0x2'));router[_0xb4ab('0x3')](_0xb4ab('0x4'),auth[_0xb4ab('0x5')](),controller[_0xb4ab('0x6')]);module[_0xb4ab('0x7')]=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 dc08f24..0a1ab04 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 _0xaa4d=['sequelize','warning','info','debug','exports','error','BOOLEAN','TEXT','INTEGER','UserId'];(function(_0x503699,_0x152145){var _0xd66c82=function(_0x48c6e7){while(--_0x48c6e7){_0x503699['push'](_0x503699['shift']());}};_0xd66c82(++_0x152145);}(_0xaa4d,0x1c2));var _0xdaa4=function(_0x24b33c,_0x33cb97){_0x24b33c=_0x24b33c-0x0;var _0x33becf=_0xaa4d[_0x24b33c];return _0x33becf;};'use strict';var Sequelize=require(_0xdaa4('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xdaa4('0x1'),_0xdaa4('0x2'),_0xdaa4('0x3')];module[_0xdaa4('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xdaa4('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xdaa4('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xdaa4('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xdaa4('0x8')],'unique':_0xdaa4('0x9')}}; \ No newline at end of file +var _0x9cd5=['warning','info','debug','exports','ENUM','sequelize'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x9cd5,0x10d));var _0x59cd=function(_0x560215,_0x214783){_0x560215=_0x560215-0x0;var _0x464ad8=_0x9cd5[_0x560215];return _0x464ad8;};'use strict';var Sequelize=require(_0x59cd('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x59cd('0x1'),_0x59cd('0x2'),_0x59cd('0x3')];module[_0x59cd('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x59cd('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 4bb9c4f..68cd0f5 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 _0x43fd=['user','role','Unauthorized','params','UserSetting','find','lodash','ioredis','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','error','name'];(function(_0x4c7717,_0x520a56){var _0x3cd802=function(_0x3f9dfb){while(--_0x3f9dfb){_0x4c7717['push'](_0x4c7717['shift']());}};_0x3cd802(++_0x520a56);}(_0x43fd,0x150));var _0xd43f=function(_0x2bae69,_0x262cd6){_0x2bae69=_0x2bae69-0x0;var _0x28c59c=_0x43fd[_0x2bae69];return _0x28c59c;};'use strict';var _=require(_0xd43f('0x0'));var Redis=require(_0xd43f('0x1'));var logger=require('../../config/logger')(_0xd43f('0x2'));var config=require('../../config/environment');var db=require(_0xd43f('0x3'))['db'];var socket=require(_0xd43f('0x4'))(new Redis(config[_0xd43f('0x5')]));require(_0xd43f('0x6'))[_0xd43f('0x7')](socket);config[_0xd43f('0x5')]=_[_0xd43f('0x8')](config[_0xd43f('0x5')],{'host':_0xd43f('0x9'),'port':0x18eb});function respondWithResult(_0x2296e1,_0x907208){_0x907208=_0x907208||0xc8;return function(_0x2516ee){if(_0x2516ee){return _0x2296e1[_0xd43f('0xa')](_0x907208)[_0xd43f('0xb')](_0x2516ee);}};}function saveUpdates(_0x587add){return function(_0x40d7b5){if(_0x40d7b5){return _0x40d7b5[_0xd43f('0xc')](_0x587add)[_0xd43f('0xd')](function(_0x535d98){return _0x535d98;});}return null;};}function handleEntityNotFound(_0x27b3cc){return function(_0x1815de){if(!_0x1815de){_0x27b3cc['sendStatus'](0x194);}return _0x1815de;};}function handleError(_0x36e63c,_0x40b4e9){_0x40b4e9=_0x40b4e9||0x1f4;return function(_0xf043e5){logger[_0xd43f('0xe')](_0xf043e5['stack']);if(_0xf043e5['name']){delete _0xf043e5[_0xd43f('0xf')];}_0x36e63c[_0xd43f('0xa')](_0x40b4e9)['send'](_0xf043e5);};}exports[_0xd43f('0xc')]=function(_0x4d318f,_0x59c238){if(_0x4d318f[_0xd43f('0x10')][_0xd43f('0x11')]!=='admin')throw new Error(_0xd43f('0x12'));if(isNaN(Number(_0x4d318f[_0xd43f('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xd43f('0x14')][_0xd43f('0x15')]({'where':{'id':_0x4d318f[_0xd43f('0x13')]['id']}})[_0xd43f('0xd')](handleEntityNotFound(_0x59c238,null))[_0xd43f('0xd')](saveUpdates(_0x4d318f['body'],null))['then'](respondWithResult(_0x59c238,null))['catch'](handleError(_0x59c238,null));}; \ No newline at end of file +var _0x544f=['socket.io-emitter','./user-setting.socket','register','defaults','redis','json','then','sendStatus','error','stack','name','send','update','role','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','body','catch','lodash','api','../../config/environment','../../mysqldb'];(function(_0x1f2f06,_0x43b758){var _0x24df35=function(_0x2c4d33){while(--_0x2c4d33){_0x1f2f06['push'](_0x1f2f06['shift']());}};_0x24df35(++_0x43b758);}(_0x544f,0x14c));var _0xf544=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x544f[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xf544('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')(_0xf544('0x1'));var config=require(_0xf544('0x2'));var db=require(_0xf544('0x3'))['db'];var socket=require(_0xf544('0x4'))(new Redis(config['redis']));require(_0xf544('0x5'))[_0xf544('0x6')](socket);config['redis']=_[_0xf544('0x7')](config[_0xf544('0x8')],{'host':'localhost','port':0x18eb});function respondWithResult(_0xdb52e7,_0x2ce041){_0x2ce041=_0x2ce041||0xc8;return function(_0x1749cc){if(_0x1749cc){return _0xdb52e7['status'](_0x2ce041)[_0xf544('0x9')](_0x1749cc);}};}function saveUpdates(_0x5f445c){return function(_0x258808){if(_0x258808){return _0x258808['update'](_0x5f445c)[_0xf544('0xa')](function(_0x4a042d){return _0x4a042d;});}return null;};}function handleEntityNotFound(_0x445fbe){return function(_0x47e00a){if(!_0x47e00a){_0x445fbe[_0xf544('0xb')](0x194);}return _0x47e00a;};}function handleError(_0x166f77,_0x28cac4){_0x28cac4=_0x28cac4||0x1f4;return function(_0x3c23d6){logger[_0xf544('0xc')](_0x3c23d6[_0xf544('0xd')]);if(_0x3c23d6[_0xf544('0xe')]){delete _0x3c23d6[_0xf544('0xe')];}_0x166f77['status'](_0x28cac4)[_0xf544('0xf')](_0x3c23d6);};}exports[_0xf544('0x10')]=function(_0x56c8d4,_0x4903e1){if(_0x56c8d4['user'][_0xf544('0x11')]!=='admin')throw new Error(_0xf544('0x12'));if(isNaN(Number(_0x56c8d4['params']['id'])))throw new Error(_0xf544('0x13'));return db['UserSetting'][_0xf544('0x14')]({'where':{'id':_0x56c8d4[_0xf544('0x15')]['id']}})[_0xf544('0xa')](handleEntityNotFound(_0x4903e1,null))['then'](saveUpdates(_0x56c8d4[_0xf544('0x16')],null))[_0xf544('0xa')](respondWithResult(_0x4903e1,null))[_0xf544('0x17')](handleError(_0x4903e1,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 24db42f..5c56b88 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 _0x65ef=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove'];(function(_0x4c88f2,_0x1a907a){var _0x21998c=function(_0x5b91d8){while(--_0x5b91d8){_0x4c88f2['push'](_0x4c88f2['shift']());}};_0x21998c(++_0x1a907a);}(_0x65ef,0x19b));var _0xf65e=function(_0x5806c3,_0x3ed45e){_0x5806c3=_0x5806c3-0x0;var _0x5e19ca=_0x65ef[_0x5806c3];return _0x5e19ca;};'use strict';var EventEmitter=require(_0xf65e('0x0'));var UserSetting=require(_0xf65e('0x1'))['db'][_0xf65e('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf65e('0x3')](0x0);var events={'afterCreate':_0xf65e('0x4'),'afterUpdate':_0xf65e('0x5'),'afterDestroy':_0xf65e('0x6')};function emitEvent(_0x44dec9){return function(_0x4e21a6,_0x55e0b9,_0x3b9c0a){UserSettingEvents[_0xf65e('0x7')](_0x44dec9+':'+_0x4e21a6['id'],_0x4e21a6);UserSettingEvents['emit'](_0x44dec9,_0x4e21a6);_0x3b9c0a(null);};}for(var e in events){if(events[_0xf65e('0x8')](e)){var event=events[e];UserSetting[_0xf65e('0x9')](e,emitEvent(event));}}module[_0xf65e('0xa')]=UserSettingEvents; \ No newline at end of file +var _0x1523=['UserSetting','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x22efd9,_0x1a8b57){var _0x2c3fcb=function(_0x3de54a){while(--_0x3de54a){_0x22efd9['push'](_0x22efd9['shift']());}};_0x2c3fcb(++_0x1a8b57);}(_0x1523,0x1c8));var _0x3152=function(_0x303f80,_0x27afc5){_0x303f80=_0x303f80-0x0;var _0x30b6d7=_0x1523[_0x303f80];return _0x30b6d7;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0x3152('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3152('0x1'),'afterUpdate':_0x3152('0x2'),'afterDestroy':_0x3152('0x3')};function emitEvent(_0x1b94d7){return function(_0x4d8add,_0x217d3d,_0x11d65e){UserSettingEvents[_0x3152('0x4')](_0x1b94d7+':'+_0x4d8add['id'],_0x4d8add);UserSettingEvents['emit'](_0x1b94d7,_0x4d8add);_0x11d65e(null);};}for(var e in events){if(events[_0x3152('0x5')](e)){var event=events[e];UserSetting[_0x3152('0x6')](e,emitEvent(event));}}module[_0x3152('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 21dcd0b..992c725 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 _0x80df=['define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0xf80d('0x0'));module[_0xf80d('0x1')]=function(_0xf03a7b){return _0xf03a7b[_0xf80d('0x2')]('UserSetting',attributes,{'tableName':_0xf80d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x216488){if(!_0x216488[_0xf80d('0x4')])_0x216488[_0xf80d('0x5')]=null;else if(_0x216488[_0xf80d('0x5')]===null)_0x216488[_0xf80d('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x7462=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting'];(function(_0x133296,_0xe8ff9a){var _0x193517=function(_0x161ffd){while(--_0x161ffd){_0x133296['push'](_0x133296['shift']());}};_0x193517(++_0xe8ff9a);}(_0x7462,0x165));var _0x2746=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x7462[_0x2cc0b3];return _0x1667ef;};'use strict';var attributes=require(_0x2746('0x0'));module[_0x2746('0x1')]=function(_0x5666d5){return _0x5666d5['define'](_0x2746('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x497e67){if(!_0x497e67[_0x2746('0x3')])_0x497e67[_0x2746('0x4')]=null;else if(_0x497e67['clientSideLoggingEnabledSince']===null)_0x497e67[_0x2746('0x4')]=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 3ba7215..e070552 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 _0x115d=['UserId','register','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x4af385,_0x7a35d1){var _0x2565f6=function(_0x478561){while(--_0x478561){_0x4af385['push'](_0x4af385['shift']());}};_0x2565f6(++_0x7a35d1);}(_0x115d,0x159));var _0xd115=function(_0x1d1bb8,_0x59a0ec){_0x1d1bb8=_0x1d1bb8-0x0;var _0x2819c3=_0x115d[_0x1d1bb8];return _0x2819c3;};'use strict';var UserSettingEvents=require(_0xd115('0x0'));var events=[_0xd115('0x1'),_0xd115('0x2'),_0xd115('0x3')];function createListener(_0x505108,_0x574df4){return function(_0x36db3d){_0x574df4[_0xd115('0x4')](_0x505108,_0x36db3d);if(_0x505108===_0xd115('0x5')){_0x574df4[_0xd115('0x4')](_0xd115('0x6')+_0x36db3d[_0xd115('0x7')],_0x36db3d);}};}exports[_0xd115('0x8')]=function(_0x39add4){for(var _0xd3cc5b=0x0,_0x4d9c8c=events[_0xd115('0x9')];_0xd3cc5b<_0x4d9c8c;_0xd3cc5b++){var _0x166182=events[_0xd3cc5b];var _0x354a6d=createListener(_0xd115('0xa')+_0x166182,_0x39add4);UserSettingEvents['on'](_0x166182,_0x354a6d);}}; \ No newline at end of file +var _0x7c07=['UserId','register','user-setting:','save','remove','update','user-setting:update','emit','user-setting:update:user-'];(function(_0x23e5fd,_0x2c6da6){var _0xab592b=function(_0x75559a){while(--_0x75559a){_0x23e5fd['push'](_0x23e5fd['shift']());}};_0xab592b(++_0x2c6da6);}(_0x7c07,0x111));var _0x77c0=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x7c07[_0x1e3c16];return _0x47a0c9;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x77c0('0x0'),_0x77c0('0x1'),_0x77c0('0x2')];function createListener(_0xd84520,_0x521e97){return function(_0x2bf008){_0x521e97['emit'](_0xd84520,_0x2bf008);if(_0xd84520===_0x77c0('0x3')){_0x521e97[_0x77c0('0x4')](_0x77c0('0x5')+_0x2bf008[_0x77c0('0x6')],_0x2bf008);}};}exports[_0x77c0('0x7')]=function(_0x29c08b){for(var _0x1e5c96=0x0,_0x5ba918=events['length'];_0x1e5c96<_0x5ba918;_0x1e5c96++){var _0x5d6be5=events[_0x1e5c96];var _0x38c979=createListener(_0x77c0('0x8')+_0x5d6be5,_0x29c08b);UserSettingEvents['on'](_0x5d6be5,_0x38c979);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 587cc49..1631ec0 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 _0xfdb5=['getQueues','/:id/queues_rt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','multer','util','path','express','Router','fs-extra','../../config/environment','get','index','/whoami','isAuthenticated','whoami','/presence','show','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xfdb5[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0x5fdb('0x0'));var util=require(_0x5fdb('0x1'));var path=require(_0x5fdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x5fdb('0x3'));var router=express[_0x5fdb('0x4')]();var fs_extra=require(_0x5fdb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fdb('0x6'));var controller=require('./user.controller');router[_0x5fdb('0x7')]('/',auth['isAuthenticated'](),controller[_0x5fdb('0x8')]);router[_0x5fdb('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5fdb('0x7')](_0x5fdb('0x9'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0xb')]);router[_0x5fdb('0x7')](_0x5fdb('0xc'),auth[_0x5fdb('0xa')](),controller['getPresence']);router[_0x5fdb('0x7')]('/:id',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0xd')]);router[_0x5fdb('0x7')]('/:id/avatar',controller[_0x5fdb('0xe')]);router['get'](_0x5fdb('0xf'),auth[_0x5fdb('0xa')](),controller['getOpenTabs']);router[_0x5fdb('0x7')](_0x5fdb('0x10'),auth[_0x5fdb('0xa')](),controller['getContacts']);router[_0x5fdb('0x7')](_0x5fdb('0x11'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x12')]);router[_0x5fdb('0x7')](_0x5fdb('0x13'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x5fdb('0x7')]('/:id/groups',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x14')]);router[_0x5fdb('0x7')]('/:id/recordings',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x15')]);router[_0x5fdb('0x7')](_0x5fdb('0x16'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x17')]);router['get'](_0x5fdb('0x18'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x5fdb('0x7')](_0x5fdb('0x19'),auth[_0x5fdb('0xa')](),controller['getOpenchannelInteractions']);router[_0x5fdb('0x7')](_0x5fdb('0x1a'),auth['isAuthenticated'](),controller[_0x5fdb('0x1b')]);router[_0x5fdb('0x7')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0x5fdb('0x1c'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x5fdb('0x7')](_0x5fdb('0x1d'),auth[_0x5fdb('0xa')](),controller['getWhatsappInteractions']);router[_0x5fdb('0x7')](_0x5fdb('0x1e'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x1f')]);router['get'](_0x5fdb('0x20'),auth['isAuthenticated'](),controller[_0x5fdb('0x21')]);router[_0x5fdb('0x7')]('/:id/agents',auth[_0x5fdb('0xa')](),controller['getAgents']);router[_0x5fdb('0x7')](_0x5fdb('0x22'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x5fdb('0x7')](_0x5fdb('0x23'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x24')]);router[_0x5fdb('0x7')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x5fdb('0x25')]);router[_0x5fdb('0x7')](_0x5fdb('0x26'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x27')]);router[_0x5fdb('0x7')](_0x5fdb('0x28'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x29')]);router[_0x5fdb('0x7')](_0x5fdb('0x2a'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x2b')]);router[_0x5fdb('0x7')](_0x5fdb('0x2c'),auth['isAuthenticated'](),controller[_0x5fdb('0x2d')]);router[_0x5fdb('0x7')](_0x5fdb('0x2e'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x2f')]);router[_0x5fdb('0x7')](_0x5fdb('0x30'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x31')]);router[_0x5fdb('0x32')]('/:id/contacts',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x33')]);router[_0x5fdb('0x32')]('/',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x34')]);router[_0x5fdb('0x32')]('/create_many',auth['isAuthenticated'](),controller[_0x5fdb('0x35')]);router[_0x5fdb('0x32')](_0x5fdb('0x11'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x36')]);var upload=multer({'storage':multer[_0x5fdb('0x37')]({'destination':function(_0xbbd7f2,_0x58ed74,_0x1c09f4){_0x1c09f4(null,path[_0x5fdb('0x38')](config[_0x5fdb('0x39')],_0x5fdb('0x3a')));},'filename':function(_0x1108eb,_0x35ba48,_0x2e39d5){_0x2e39d5(null,util[_0x5fdb('0x3b')](_0x5fdb('0x3c'),Date['now'](),_0x35ba48['originalname']));}})});router['post'](_0x5fdb('0x3d'),upload['single'](_0x5fdb('0x3e')),controller[_0x5fdb('0x3f')]);router[_0x5fdb('0x32')](_0x5fdb('0x40'),auth['isAuthenticated'](),controller[_0x5fdb('0x41')]);router['post'](_0x5fdb('0x42'),auth['isAuthenticated'](),controller[_0x5fdb('0x43')]);router[_0x5fdb('0x32')](_0x5fdb('0x44'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x45')]);router['post'](_0x5fdb('0x46'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x47')]);router['post']('/:id/teams',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x48')]);router['post'](_0x5fdb('0x49'),auth[_0x5fdb('0xa')](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5fdb('0x4a')]);router['post'](_0x5fdb('0x4b'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x4c')]);router['post'](_0x5fdb('0x4d'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x4e')]);router['post'](_0x5fdb('0x4f'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x50')]);router[_0x5fdb('0x32')](_0x5fdb('0x51'),auth[_0x5fdb('0xa')](),controller['addWhatsappInteractions']);router[_0x5fdb('0x32')](_0x5fdb('0x23'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x52')]);router['post'](_0x5fdb('0x53'),auth[_0x5fdb('0xa')](),controller['addMailAccounts']);router[_0x5fdb('0x32')]('/:id/openchannel_accounts',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x54')]);router[_0x5fdb('0x32')](_0x5fdb('0x28'),auth[_0x5fdb('0xa')](),controller['addSmsAccounts']);router[_0x5fdb('0x32')](_0x5fdb('0x2a'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x55')]);router[_0x5fdb('0x32')]('/:id/whatsapp_accounts',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x56')]);router[_0x5fdb('0x32')](_0x5fdb('0x30'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x57')]);router[_0x5fdb('0x58')](_0x5fdb('0x59'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x5a')]);router['put'](_0x5fdb('0x5b'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x5c')]);router[_0x5fdb('0x5d')]('/:id/queues',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x5e')]);router[_0x5fdb('0x5d')](_0x5fdb('0x1e'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x5f')]);router['delete']('/:id',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x60')]);router[_0x5fdb('0x5d')](_0x5fdb('0x49'),auth[_0x5fdb('0xa')](),controller['removeChatInteractions']);router['delete'](_0x5fdb('0x61'),auth['isAuthenticated'](),controller[_0x5fdb('0x62')]);router[_0x5fdb('0x5d')](_0x5fdb('0x4b'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x63')]);router['delete'](_0x5fdb('0x4d'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x64')]);router[_0x5fdb('0x5d')](_0x5fdb('0x4f'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x65')]);router['delete'](_0x5fdb('0x51'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x66')]);router['delete'](_0x5fdb('0x23'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x67')]);router[_0x5fdb('0x5d')](_0x5fdb('0x53'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x5fdb('0x5d')]('/:id/openchannel_accounts',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x68')]);router[_0x5fdb('0x5d')](_0x5fdb('0x28'),auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x69')]);router[_0x5fdb('0x5d')](_0x5fdb('0x2a'),auth[_0x5fdb('0xa')](),controller['removeChatWebsites']);router[_0x5fdb('0x5d')](_0x5fdb('0x2c'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x5fdb('0x5d')]('/:id/api_key',auth[_0x5fdb('0xa')](),controller[_0x5fdb('0x6a')]);module['exports']=router; \ No newline at end of file +var _0xd57b=['show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','format','now','originalname','single','file','addAvatar','login','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','removeTeams','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/whoami','whoami','getPresence','/:id'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0xd57b,0x1be));var _0xbd57=function(_0x129954,_0x17b156){_0x129954=_0x129954-0x0;var _0x2b40f2=_0xd57b[_0x129954];return _0x2b40f2;};'use strict';var multer=require(_0xbd57('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbd57('0x1')]();var fs_extra=require(_0xbd57('0x2'));var auth=require(_0xbd57('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbd57('0x4'));var controller=require('./user.controller');router[_0xbd57('0x5')]('/',auth['isAuthenticated'](),controller[_0xbd57('0x6')]);router[_0xbd57('0x5')](_0xbd57('0x7'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x9')]);router[_0xbd57('0x5')](_0xbd57('0xa'),auth[_0xbd57('0x8')](),controller[_0xbd57('0xb')]);router['get']('/presence',auth[_0xbd57('0x8')](),controller[_0xbd57('0xc')]);router[_0xbd57('0x5')](_0xbd57('0xd'),auth[_0xbd57('0x8')](),controller[_0xbd57('0xe')]);router[_0xbd57('0x5')](_0xbd57('0xf'),controller[_0xbd57('0x10')]);router[_0xbd57('0x5')](_0xbd57('0x11'),auth[_0xbd57('0x8')](),controller['getOpenTabs']);router[_0xbd57('0x5')](_0xbd57('0x12'),auth['isAuthenticated'](),controller[_0xbd57('0x13')]);router[_0xbd57('0x5')](_0xbd57('0x14'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x15')]);router[_0xbd57('0x5')](_0xbd57('0x16'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0xbd57('0x5')](_0xbd57('0x17'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x18')]);router['get'](_0xbd57('0x19'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x1a')]);router['get'](_0xbd57('0x1b'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x1c')]);router[_0xbd57('0x5')]('/:id/chat/interactions',auth[_0xbd57('0x8')](),controller[_0xbd57('0x1d')]);router[_0xbd57('0x5')]('/:id/openchannel/interactions',auth[_0xbd57('0x8')](),controller[_0xbd57('0x1e')]);router['get'](_0xbd57('0x1f'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xbd57('0x5')](_0xbd57('0x20'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x21')]);router['get'](_0xbd57('0x22'),auth['isAuthenticated'](),controller[_0xbd57('0x23')]);router['get'](_0xbd57('0x24'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x25')]);router[_0xbd57('0x5')](_0xbd57('0x26'),auth[_0xbd57('0x8')](),controller['getTeams']);router[_0xbd57('0x5')](_0xbd57('0x27'),auth['isAuthenticated'](),controller[_0xbd57('0x28')]);router[_0xbd57('0x5')](_0xbd57('0x29'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x2a')]);router[_0xbd57('0x5')](_0xbd57('0x2b'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x2c')]);router['get'](_0xbd57('0x2d'),auth['isAuthenticated'](),controller['getFaxAccounts']);router['get'](_0xbd57('0x2e'),auth['isAuthenticated'](),controller[_0xbd57('0x2f')]);router[_0xbd57('0x5')](_0xbd57('0x30'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xbd57('0x5')](_0xbd57('0x31'),auth['isAuthenticated'](),controller[_0xbd57('0x32')]);router[_0xbd57('0x5')](_0xbd57('0x33'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x34')]);router[_0xbd57('0x5')](_0xbd57('0x35'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x36')]);router[_0xbd57('0x5')](_0xbd57('0x37'),auth['isAuthenticated'](),controller[_0xbd57('0x38')]);router[_0xbd57('0x5')](_0xbd57('0x39'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x3a')]);router[_0xbd57('0x3b')](_0xbd57('0x12'),auth[_0xbd57('0x8')](),controller['addContacts']);router[_0xbd57('0x3b')]('/',auth[_0xbd57('0x8')](),controller[_0xbd57('0x3c')]);router[_0xbd57('0x3b')](_0xbd57('0x3d'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x3e')]);router[_0xbd57('0x3b')](_0xbd57('0x14'),auth['isAuthenticated'](),controller[_0xbd57('0x3f')]);var upload=multer({'storage':multer[_0xbd57('0x40')]({'destination':function(_0x2f3e9c,_0x3b88f6,_0x5026a1){_0x5026a1(null,path[_0xbd57('0x41')](config['root'],'server/files/images/'));},'filename':function(_0x560d31,_0x2e704d,_0x1392aa){_0x1392aa(null,util[_0xbd57('0x42')]('%s-%s',Date[_0xbd57('0x43')](),_0x2e704d[_0xbd57('0x44')]));}})});router['post'](_0xbd57('0xf'),upload[_0xbd57('0x45')](_0xbd57('0x46')),controller[_0xbd57('0x47')]);router[_0xbd57('0x3b')]('/:id/login',auth[_0xbd57('0x8')](),controller[_0xbd57('0x48')]);router['post']('/:id/logout',auth[_0xbd57('0x8')](),controller['logout']);router[_0xbd57('0x3b')]('/:id/pause',auth[_0xbd57('0x8')](),controller[_0xbd57('0x49')]);router[_0xbd57('0x3b')](_0xbd57('0x4a'),auth['isAuthenticated'](),controller[_0xbd57('0x4b')]);router[_0xbd57('0x3b')](_0xbd57('0x26'),auth['isAuthenticated'](),controller[_0xbd57('0x4c')]);router[_0xbd57('0x3b')](_0xbd57('0x4d'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x4e')]);router[_0xbd57('0x3b')](_0xbd57('0x4f'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x50')]);router[_0xbd57('0x3b')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xbd57('0x51')]);router[_0xbd57('0x3b')](_0xbd57('0x52'),auth['isAuthenticated'](),controller[_0xbd57('0x53')]);router[_0xbd57('0x3b')](_0xbd57('0x54'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x55')]);router[_0xbd57('0x3b')](_0xbd57('0x56'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x57')]);router[_0xbd57('0x3b')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xbd57('0x58')]);router[_0xbd57('0x3b')](_0xbd57('0x2e'),auth[_0xbd57('0x8')](),controller['addMailAccounts']);router[_0xbd57('0x3b')](_0xbd57('0x30'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x59')]);router[_0xbd57('0x3b')](_0xbd57('0x31'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x5a')]);router[_0xbd57('0x3b')](_0xbd57('0x33'),auth['isAuthenticated'](),controller[_0xbd57('0x5b')]);router[_0xbd57('0x3b')](_0xbd57('0x35'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x5c')]);router['post']('/:id/api_key',auth[_0xbd57('0x8')](),controller[_0xbd57('0x5d')]);router[_0xbd57('0x5e')](_0xbd57('0xd'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x5f')]);router['put'](_0xbd57('0x60'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x61')]);router['delete'](_0xbd57('0x14'),auth['isAuthenticated'](),controller[_0xbd57('0x62')]);router[_0xbd57('0x63')]('/:id/teams',auth[_0xbd57('0x8')](),controller[_0xbd57('0x64')]);router[_0xbd57('0x63')]('/:id',auth[_0xbd57('0x8')](),controller['destroy']);router[_0xbd57('0x63')](_0xbd57('0x4d'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x65')]);router[_0xbd57('0x63')](_0xbd57('0x4f'),auth['isAuthenticated'](),controller[_0xbd57('0x66')]);router[_0xbd57('0x63')](_0xbd57('0x67'),auth['isAuthenticated'](),controller[_0xbd57('0x68')]);router[_0xbd57('0x63')](_0xbd57('0x52'),auth['isAuthenticated'](),controller[_0xbd57('0x69')]);router[_0xbd57('0x63')](_0xbd57('0x54'),auth['isAuthenticated'](),controller[_0xbd57('0x6a')]);router['delete'](_0xbd57('0x56'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x6b')]);router['delete'](_0xbd57('0x2d'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x6c')]);router['delete'](_0xbd57('0x2e'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x6d')]);router['delete']('/:id/openchannel_accounts',auth[_0xbd57('0x8')](),controller[_0xbd57('0x6e')]);router[_0xbd57('0x63')](_0xbd57('0x31'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x6f')]);router[_0xbd57('0x63')](_0xbd57('0x33'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x70')]);router[_0xbd57('0x63')](_0xbd57('0x35'),auth[_0xbd57('0x8')](),controller[_0xbd57('0x71')]);router[_0xbd57('0x63')](_0xbd57('0x39'),auth['isAuthenticated'](),controller['removeApiKey']);module[_0xbd57('0x72')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index dcbd889..63684e1 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 _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x3569e7,_0x163809){var _0x15c795=function(_0x105584){while(--_0x105584){_0x3569e7['push'](_0x3569e7['shift']());}};_0x15c795(++_0x163809);}(_0xe706,0xa3));var _0x6e70=function(_0x441eab,_0x583ba5){_0x441eab=_0x441eab-0x0;var _0xe6ff41=_0xe706[_0x441eab];return _0xe6ff41;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'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(_0x20af80,_0x1b12cd){var _0xe5b049=function(_0x4b1379){while(--_0x4b1379){_0x20af80['push'](_0x20af80['shift']());}};_0xe5b049(++_0x1b12cd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xcb91[_0x2e6dbf];return _0x2680e5;};'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 83aada1..67995cb 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 _0xde2c=['moment','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','../../mysqldb','redis','./user.socket','register','localhost','client','http','request','then','info','User,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','role','agent','destroy','get','admin','Users','user','Telephones','filter','ignore','includes','find','value','name','stack','send','User','rawAttributes','map','fieldName','type','key','password','salt','getOptions','query','includeAll','UserSetting','userSetting','attributes','push','findAll','true','rows','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','model','differenceBy','keys','filters','intersection','fields','length','include','merge','options','body','params','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','105','106','108','109','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','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\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','compact','UserProfileResource','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','addQueues','online','voicePause','add','capitalize','Queues','penalty','QueueId','emit','toLowerCase','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','Unknown\x20channel','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','ChatOpenTabs','CHAT','createdAt','FAX','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','order','sort','where','pick','hasOwnProperty','CmList','List','Tags','color','tag','nolimit','limit','getQueues','isValidChannel','Queue','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','openchannelPause','pauseType','getTeams','Team','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','flattenDeep','addAgent','Voice','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','TeamVoicePrefix','getLists','values','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$any','firstName','CmContact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','teams','queues','isEmpty','flatten','getAgents','col','toString','desc','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','ui.','field','_interactions','ui.UserId\x20=\x20?','OpenTabs'];(function(_0x26f5bb,_0x534b4d){var _0x1267d8=function(_0x84dfa7){while(--_0x84dfa7){_0x26f5bb['push'](_0x26f5bb['shift']());}};_0x1267d8(++_0x534b4d);}(_0xde2c,0x18d));var _0xcde2=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0xde2c[_0xc8db6b];return _0x12cb81;};'use strict';var moment=require(_0xcde2('0x0'));var util=require('util');var path=require(_0xcde2('0x1'));var fs=require('fs');var _=require(_0xcde2('0x2'));var squel=require(_0xcde2('0x3'));var jayson=require(_0xcde2('0x4'));var Redis=require(_0xcde2('0x5'));var authService=require(_0xcde2('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xcde2('0x7'))(_0xcde2('0x8'));var utils=require('../../config/utils');var config=require(_0xcde2('0x9'));var licenseUtil=require(_0xcde2('0xa'));var APIBadRequestError=require('../../errors/api')[_0xcde2('0xb')];var APINotFoundError=require(_0xcde2('0xc'))[_0xcde2('0xd')];var APIHandleError=require(_0xcde2('0xc'))['handleError'];var db=require(_0xcde2('0xe'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xcde2('0xf')]));require(_0xcde2('0x10'))[_0xcde2('0x11')](socket);config['redis']=_['defaults'](config[_0xcde2('0xf')],{'host':_0xcde2('0x12'),'port':0x18eb});var amiClient=jayson[_0xcde2('0x13')][_0xcde2('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x7e940c,_0xa486c4,_0x212d95,_0x2e77a7){return new Promise(function(_0x2e2eed,_0xd2d42e){var _0x26ebb1=_0x2e77a7||amiClient;return _0x26ebb1[_0xcde2('0x15')](_0x7e940c,_0x212d95)[_0xcde2('0x16')](function(_0x289bd9){logger[_0xcde2('0x17')](_0xcde2('0x18'),_0xa486c4,'request\x20sent');logger['debug']('User,\x20%s,\x20%s,\x20%s',_0xa486c4,'request\x20sent',JSON[_0xcde2('0x19')](_0x289bd9));if(_0x289bd9[_0xcde2('0x1a')]){if(_0x289bd9[_0xcde2('0x1a')][_0xcde2('0x1b')]===0x1f4){logger[_0xcde2('0x1a')](_0xcde2('0x18'),_0xa486c4,_0x289bd9[_0xcde2('0x1a')][_0xcde2('0x1c')]);return _0xd2d42e(_0x289bd9[_0xcde2('0x1a')][_0xcde2('0x1c')]);}logger[_0xcde2('0x1a')]('User,\x20%s,\x20%s',_0xa486c4,_0x289bd9[_0xcde2('0x1a')][_0xcde2('0x1c')]);return _0x2e2eed(_0x289bd9['error'][_0xcde2('0x1c')]);}else{logger[_0xcde2('0x17')]('User,\x20%s,\x20%s',_0xa486c4,_0xcde2('0x1d'));_0x2e2eed(_0x289bd9['result']['message']);}})['catch'](function(_0x1a6c2f){logger[_0xcde2('0x1a')]('User,\x20%s,\x20%s',_0xa486c4,_0x1a6c2f);_0xd2d42e(_0x1a6c2f);});});}function respondWithStatusCode(_0x6bfb83,_0x4ff0ea){_0x4ff0ea=_0x4ff0ea||0xcc;return function(_0x3e2089){if(_0x3e2089){return _0x6bfb83[_0xcde2('0x1e')](_0x4ff0ea);}return _0x6bfb83[_0xcde2('0x1f')](_0x4ff0ea)[_0xcde2('0x20')]();};}function respondWithResult(_0x4f7fed,_0x28207c){_0x28207c=_0x28207c||0xc8;return function(_0x53b9c6){if(_0x53b9c6){return _0x4f7fed[_0xcde2('0x1f')](_0x28207c)[_0xcde2('0x21')](_0x53b9c6);}};}function respondWithFilteredResult(_0x1c38a6,_0x3120fc){return function(_0x2941f3){if(_0x2941f3){var _0x21c9e2=typeof _0x3120fc[_0xcde2('0x22')]===_0xcde2('0x23')&&typeof _0x3120fc['limit']===_0xcde2('0x23');var _0x4d3a5a=_0x2941f3[_0xcde2('0x24')];var _0x80bb30=_0x21c9e2?0x0:_0x3120fc[_0xcde2('0x22')];var _0xf09d43=_0x21c9e2?_0x2941f3[_0xcde2('0x24')]:_0x3120fc[_0xcde2('0x22')]+_0x3120fc['limit'];var _0x44107c;if(_0xf09d43>=_0x4d3a5a){_0xf09d43=_0x4d3a5a;_0x44107c=0xc8;}else{_0x44107c=0xce;}_0x1c38a6[_0xcde2('0x1f')](_0x44107c);return _0x1c38a6[_0xcde2('0x25')](_0xcde2('0x26'),_0x80bb30+'-'+_0xf09d43+'/'+_0x4d3a5a)['json'](_0x2941f3);}return null;};}function saveUpdates(_0x398b82){return function(_0x19e0a9){if(_0x19e0a9){return _0x19e0a9[_0xcde2('0x27')](_0x398b82)[_0xcde2('0x16')](function(_0x3ea279){if(_0x3ea279[_0xcde2('0x28')]===_0xcde2('0x29')){socket['emit']('userNotification:recalc:'+_0x3ea279['id'],_0x3ea279);}return _0x3ea279;});}return null;};}function removeEntity(_0x4fb756){return function(_0xe012b1){if(_0xe012b1){return _0xe012b1[_0xcde2('0x2a')]()[_0xcde2('0x16')](function(){var _0xd8384c=_0xe012b1[_0xcde2('0x2b')]({'plain':!![]});if(_0xd8384c[_0xcde2('0x28')]===_0xcde2('0x2c'))return;var _0x902191=[{'name':_0xcde2('0x2d'),'value':_0xcde2('0x2e'),'ignore':!![]},{'name':'Agents','value':_0xcde2('0x29'),'ignore':![]},{'name':_0xcde2('0x2f'),'value':'telephone','ignore':![]}];var _0x48a65d=_(_0x902191)[_0xcde2('0x30')](_0xcde2('0x31'))['map']('value')['value']();if(_[_0xcde2('0x32')](_0x48a65d,_0xd8384c[_0xcde2('0x28')])){return;}var _0x7ee27d=_[_0xcde2('0x33')](_0x902191,[_0xcde2('0x34'),_0xd8384c[_0xcde2('0x28')]])[_0xcde2('0x35')];return db['UserProfileResource'][_0xcde2('0x2a')]({'where':{'type':_0x7ee27d,'resourceId':_0xd8384c['id']}})['then'](function(){return _0xe012b1;});})[_0xcde2('0x16')](function(){_0x4fb756['status'](0xcc)[_0xcde2('0x20')]();});}};}function handleEntityNotFound(_0x2ba023){return function(_0x4b074e){if(!_0x4b074e){_0x2ba023['sendStatus'](0x194);}return _0x4b074e;};}function handleError(_0x278903,_0x280f9c){_0x280f9c=_0x280f9c||0x1f4;return function(_0x5017a5){logger[_0xcde2('0x1a')](_0x5017a5[_0xcde2('0x36')]);if(_0x5017a5[_0xcde2('0x35')]){delete _0x5017a5['name'];}_0x278903[_0xcde2('0x1f')](_0x280f9c)[_0xcde2('0x37')](_0x5017a5);};}exports['index']=function(_0x8ca0f1,_0x148aaa){var _0x307637={},_0x16faa1={'count':0x0,'rows':[]};var _0x5428a7=_(db[_0xcde2('0x38')][_0xcde2('0x39')])[_0xcde2('0x3a')](function(_0x753a04){return{'name':_0x753a04[_0xcde2('0x3b')],'type':_0x753a04[_0xcde2('0x3c')][_0xcde2('0x3d')]};})[_0xcde2('0x30')](function(_0xdf19db){return!_[_0xcde2('0x32')]([_0xcde2('0x3e'),_0xcde2('0x3f')],_0xdf19db[_0xcde2('0x35')]);})['value']();_0x307637=qs[_0xcde2('0x40')](_0x5428a7,_0x8ca0f1);var _0x15178d={'where':_0x307637['where']};return db[_0xcde2('0x38')][_0xcde2('0x24')](_0x15178d)[_0xcde2('0x16')](function(_0x3e86d7){_0x16faa1['count']=_0x3e86d7;if(_0x8ca0f1[_0xcde2('0x41')][_0xcde2('0x42')]){_0x307637['include']=[{'all':!![]}];}if(_0x8ca0f1[_0xcde2('0x41')]['userSetting']==='true'){_0x307637['include']=[{'model':db[_0xcde2('0x43')],'as':_0xcde2('0x44')}];}if(!_[_0xcde2('0x32')](_0x307637[_0xcde2('0x45')],'id')){_0x307637['attributes'][_0xcde2('0x46')]('id');}return db[_0xcde2('0x38')][_0xcde2('0x47')](_0x307637);})[_0xcde2('0x16')](function(_0x53a404){_0x16faa1['rows']=_0x53a404;if(_0x8ca0f1[_0xcde2('0x41')]['openTabs']===_0xcde2('0x48')){var _0x822c31=[];for(var _0x4513b4=0x0;_0x4513b4<_0x16faa1[_0xcde2('0x49')]['length'];_0x4513b4++){_0x822c31[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4a'),_0x16faa1[_0xcde2('0x49')][_0x4513b4][_0xcde2('0x4b')]));_0x822c31['push'](get_open_tabs(_0xcde2('0x4c'),_0x16faa1[_0xcde2('0x49')][_0x4513b4]['dataValues']));_0x822c31[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4d'),_0x16faa1['rows'][_0x4513b4]['dataValues']));_0x822c31[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4e'),_0x16faa1[_0xcde2('0x49')][_0x4513b4][_0xcde2('0x4b')]));_0x822c31[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4f'),_0x16faa1['rows'][_0x4513b4][_0xcde2('0x4b')]));_0x822c31[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x50'),_0x16faa1[_0xcde2('0x49')][_0x4513b4][_0xcde2('0x4b')]));}return Promise[_0xcde2('0x51')](_0x822c31)[_0xcde2('0x16')](function(){return _0x16faa1;});}else{return _0x16faa1;}})[_0xcde2('0x16')](respondWithFilteredResult(_0x148aaa,_0x307637))[_0xcde2('0x52')](handleError(_0x148aaa,null));};exports[_0xcde2('0x53')]=function(_0x3038a9,_0x405c00){var _0x14b376={'raw':![],'where':{'id':_0x3038a9['params']['id']}},_0x2117bb={};_0x2117bb[_0xcde2('0x54')]=_[_0xcde2('0x55')](_['keys'](db[_0xcde2('0x38')][_0xcde2('0x39')]),[_0xcde2('0x3e'),_0xcde2('0x3f')]);_0x2117bb[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x3038a9[_0xcde2('0x41')]);_0x2117bb[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x2117bb['model'],_0x2117bb[_0xcde2('0x41')]);_0x14b376[_0xcde2('0x45')]=_['intersection'](_0x2117bb[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x3038a9[_0xcde2('0x41')][_0xcde2('0x59')]));_0x14b376[_0xcde2('0x45')]=_0x14b376[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x14b376[_0xcde2('0x45')]:_0x2117bb[_0xcde2('0x54')];if(_0x3038a9[_0xcde2('0x41')][_0xcde2('0x42')]){_0x14b376[_0xcde2('0x5b')]=[{'all':!![]}];}if(_0x3038a9[_0xcde2('0x41')][_0xcde2('0x44')]===_0xcde2('0x48')){_0x14b376['include']=[{'model':db['UserSetting'],'as':_0xcde2('0x44')}];}_0x14b376=_[_0xcde2('0x5c')]({},_0x14b376,_0x3038a9[_0xcde2('0x5d')]);if(!_[_0xcde2('0x32')](_0x14b376[_0xcde2('0x45')],'id')){_0x14b376[_0xcde2('0x45')][_0xcde2('0x46')]('id');}return db[_0xcde2('0x38')][_0xcde2('0x33')](_0x14b376)['then'](handleEntityNotFound(_0x405c00,null))[_0xcde2('0x16')](function(_0x65be31){var _0x3c0e24=[];values=_0x65be31;if(_0x3038a9[_0xcde2('0x41')]['openTabs']===_0xcde2('0x48')){_0x3c0e24[_0xcde2('0x46')](get_open_tabs('chat',_0x65be31['dataValues']));_0x3c0e24[_0xcde2('0x46')](get_open_tabs('sms',_0x65be31[_0xcde2('0x4b')]));_0x3c0e24[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4f'),_0x65be31[_0xcde2('0x4b')]));_0x3c0e24[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x50'),_0x65be31[_0xcde2('0x4b')]));_0x3c0e24['push'](get_open_tabs('fax',_0x65be31[_0xcde2('0x4b')]));_0x3c0e24[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4e'),_0x65be31[_0xcde2('0x4b')]));return Promise[_0xcde2('0x51')](_0x3c0e24);}else{return values;}})[_0xcde2('0x16')](function(){return values;})[_0xcde2('0x16')](respondWithResult(_0x405c00,null))[_0xcde2('0x52')](handleError(_0x405c00,null));};exports[_0xcde2('0x27')]=function(_0x557476,_0x4be7bb){if(_0x557476[_0xcde2('0x5e')]['id']){delete _0x557476[_0xcde2('0x5e')]['id'];}delete _0x557476[_0xcde2('0x5e')][_0xcde2('0x28')];return db['User'][_0xcde2('0x33')]({'where':{'id':_0x557476[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x4be7bb,null))[_0xcde2('0x16')](saveUpdates(_0x557476[_0xcde2('0x5e')],null))['then'](respondWithResult(_0x4be7bb,null))[_0xcde2('0x52')](handleError(_0x4be7bb,null));};exports[_0xcde2('0x60')]=function(_0x4ddc2d,_0x2b221f){return db['User'][_0xcde2('0x60')]()[_0xcde2('0x16')](respondWithResult(_0x2b221f,null))[_0xcde2('0x52')](handleError(_0x2b221f,null));};exports[_0xcde2('0x61')]=function(_0x58c1b6,_0x125a5a){return db[_0xcde2('0x38')][_0xcde2('0x33')]({'where':{'id':_0x58c1b6[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x125a5a,null))[_0xcde2('0x16')](function(_0x3bcdf6){if(_0x3bcdf6){return _0x3bcdf6[_0xcde2('0x61')](_0x58c1b6['body'][_0xcde2('0x62')],_[_0xcde2('0x63')](_0x58c1b6['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x125a5a,null))[_0xcde2('0x52')](handleError(_0x125a5a,null));};function validateUser(_0x465a47){return new Promise(function(_0x260fc5,_0x400920){if(_0x465a47[_0xcde2('0x64')])return _0x260fc5(_0x465a47);return db[_0xcde2('0x65')][_0xcde2('0x66')](0x1)[_0xcde2('0x16')](function(_0xe63169){if(_0xe63169[_0xcde2('0x67')])authService[_0xcde2('0x68')](_0x465a47[_0xcde2('0x3e')]);db[_0xcde2('0x38')][_0xcde2('0x69')]('internal')[_0xcde2('0x16')](function(_0x39e99a){if(_[_0xcde2('0x6a')](_0x39e99a)){_0x465a47[_0xcde2('0x64')]=_0xe63169[_0xcde2('0x6b')]||0x1;return;}if(_[_0xcde2('0x6a')](_0xe63169[_0xcde2('0x6b')])||_0xe63169[_0xcde2('0x6b')]===_0x39e99a){_0x465a47[_0xcde2('0x64')]=_0x39e99a+0x1;return;}if(_0xe63169[_0xcde2('0x6b')]>_0x39e99a){_0x465a47[_0xcde2('0x64')]=_0xe63169[_0xcde2('0x6b')];return;}return db[_0xcde2('0x6c')]['query']('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[_0xcde2('0x6c')][_0xcde2('0x6d')][_0xcde2('0x6e')]})[_0xcde2('0x16')](function(_0x36884f){if(_0x36884f&&_0x36884f[_0xcde2('0x5a')]){for(var _0x5da83f=0x0,_0x213e4d=_0x36884f[_0xcde2('0x5a')];_0x5da83f<_0x213e4d&&_[_0xcde2('0x6a')](_0x465a47['internal']);_0x5da83f++){if(_0xe63169[_0xcde2('0x6b')]<=_0x36884f[_0x5da83f]['from']){_0x465a47[_0xcde2('0x64')]=_0x36884f[_0x5da83f][_0xcde2('0x6f')];}else if(_0xe63169['min_internal']>_0x36884f[_0x5da83f][_0xcde2('0x6f')]&&_0xe63169['min_internal']<=_0x36884f[_0x5da83f]['to']){_0x465a47[_0xcde2('0x64')]=_0xe63169['min_internal'];}}}if(_[_0xcde2('0x6a')](_0x465a47[_0xcde2('0x64')])){_0x465a47[_0xcde2('0x64')]=_0x39e99a+0x1;}return _0x260fc5(_0x465a47);});});})[_0xcde2('0x52')](function(_0x537ead){_0x400920(_0x537ead);});});}function updateUser(_0x10570d){return new Promise(function(_0x23f976,_0x5e59e0){try{if(_0x10570d['voicemail']){_0x10570d[_0xcde2('0x70')]=_0x10570d[_0xcde2('0x64')];_0x10570d[_0xcde2('0x71')]={'mailbox':_0x10570d[_0xcde2('0x64')],'password':_0x10570d[_0xcde2('0x3e')],'fullname':_0x10570d[_0xcde2('0x72')],'email':_0x10570d[_0xcde2('0x73')]};}if(_0x10570d[_0xcde2('0x28')]===_0xcde2('0x29')){if(!_0x10570d[_0xcde2('0x74')])_0x10570d['permissions']=[_0xcde2('0x75'),_0xcde2('0x76'),_0xcde2('0x77'),'113',_0xcde2('0x78'),_0xcde2('0x79'),_0xcde2('0x7a'),_0xcde2('0x7b'),'107',_0xcde2('0x7c'),_0xcde2('0x7d'),_0xcde2('0x7e'),'111',_0xcde2('0x7f'),_0xcde2('0x80')];}_0x23f976(_0x10570d);}catch(_0x513c81){_0x5e59e0(_0x513c81);}});}exports[_0xcde2('0x81')]=function(_0x4413e7,_0x3a3420){if(_0x4413e7[_0xcde2('0x2e')]['role']===_0xcde2('0x29'))throw new Error(_0xcde2('0x82'));if(_0x4413e7[_0xcde2('0x5e')][_0xcde2('0x28')]===_0xcde2('0x2e')&&_0x4413e7[_0xcde2('0x2e')]['role']!==_0xcde2('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x4413e7[_0xcde2('0x5e')][_0xcde2('0x28')]===_0xcde2('0x2c')&&_0x4413e7[_0xcde2('0x2e')][_0xcde2('0x28')]!==_0xcde2('0x2c')){throw new Error(_0xcde2('0x83'));}return licenseUtil['checkUserLimits']([_0x4413e7[_0xcde2('0x5e')]])[_0xcde2('0x16')](function(){return validateUser(_0x4413e7['body']);})[_0xcde2('0x16')](function(_0x258ab6){return updateUser(_0x258ab6)[_0xcde2('0x16')](function(_0x223e9d){if(_0x223e9d['role']===_0xcde2('0x2c')){_0x223e9d[_0xcde2('0x84')]=_0x4413e7[_0xcde2('0x2e')][_0xcde2('0x84')];delete _0x223e9d['userProfileId'];}return _0x223e9d;});})['then'](function(_0x4e7938){return db['User']['create'](_0x4e7938,{'include':[{'model':db[_0xcde2('0x71')],'as':'VoiceMail'}]});})[_0xcde2('0x16')](function(_0x37ea92){if(_0x4413e7[_0xcde2('0x5e')][_0xcde2('0x28')]===_0xcde2('0x2e'))return _0x37ea92;if(_0x4413e7[_0xcde2('0x2e')][_0xcde2('0x28')]!==_0xcde2('0x2e'))return _0x37ea92;return db[_0xcde2('0x85')]['find']({'where':{'name':_0x37ea92[_0xcde2('0x28')]==='agent'?_0xcde2('0x86'):_0xcde2('0x2f'),'userProfileId':_0x4413e7[_0xcde2('0x2e')]['userProfileId']},'raw':!![]})[_0xcde2('0x16')](function(_0x567fbc){if(!_0x567fbc||_0x567fbc[_0xcde2('0x87')]!=0x0)return _0x37ea92;return db['UserProfileResource'][_0xcde2('0x81')]({'name':_0x37ea92['name'],'resourceId':_0x37ea92['id'],'type':_0x567fbc[_0xcde2('0x35')],'sectionId':_0x567fbc['id']},{})[_0xcde2('0x16')](function(){return _0x37ea92;});})[_0xcde2('0x52')](function(_0x4bce31){logger[_0xcde2('0x1a')](_0xcde2('0x88'),_0x4bce31);throw _0x4bce31;});})[_0xcde2('0x16')](respondWithResult(_0x3a3420,0xc9))[_0xcde2('0x52')](handleError(_0x3a3420,null));};exports[_0xcde2('0x89')]=function(_0x710dfe,_0x3ba875){var _0x3b01bb=_0x710dfe[_0xcde2('0x5e')];var _0x1dee9f=[];if(_0x710dfe[_0xcde2('0x2e')]['role']===_0xcde2('0x29'))throw new Error(_0xcde2('0x82'));if(_[_0xcde2('0x8a')](_0x3b01bb,['role',_0xcde2('0x2e')])&&_0x710dfe[_0xcde2('0x2e')][_0xcde2('0x28')]!=='admin'){throw new Error(_0xcde2('0x8b'));}if(_[_0xcde2('0x8a')](_0x3b01bb,[_0xcde2('0x28'),'admin'])&&_0x710dfe[_0xcde2('0x2e')][_0xcde2('0x28')]!==_0xcde2('0x2c')){throw new Error(_0xcde2('0x8c'));}return licenseUtil['checkUserLimits'](_0x3b01bb)['then'](function(){return validateUser(_0x3b01bb[0x0]);})[_0xcde2('0x16')](function(){for(var _0x4c128c=0x1;_0x4c128c<_0x3b01bb['length'];_0x4c128c++){var _0x215770=_0x3b01bb[_0x4c128c-0x1][_0xcde2('0x64')];if(!_0x3b01bb[_0x4c128c]['internal'])_0x3b01bb[_0x4c128c]['internal']=_0x215770+0x1;_0x1dee9f[_0xcde2('0x46')](validateUser(_0x3b01bb[_0x4c128c]));}return Promise[_0xcde2('0x51')](_0x1dee9f);})['then'](function(){_0x1dee9f=[];for(var _0x153af2=0x0;_0x153af2<_0x3b01bb[_0xcde2('0x5a')];_0x153af2++){_0x1dee9f[_0xcde2('0x46')](updateUser(_0x3b01bb[_0x153af2]));}return Promise[_0xcde2('0x51')](_0x1dee9f);})[_0xcde2('0x16')](function(){_0x1dee9f=_0x3b01bb[_0xcde2('0x3a')](function(_0x294796){return db[_0xcde2('0x38')]['create'](_0x294796,{'include':[{'model':db[_0xcde2('0x71')],'as':_0xcde2('0x71')}]})[_0xcde2('0x16')](function(_0x105f31){_0x294796['id']=_0x105f31['id'];return _0x294796;});});return Promise['all'](_0x1dee9f);})[_0xcde2('0x16')](function(_0x44a054){if(_0x710dfe[_0xcde2('0x5e')][_0xcde2('0x28')]===_0xcde2('0x2e'))return _0x44a054;if(_0x710dfe[_0xcde2('0x2e')][_0xcde2('0x28')]!==_0xcde2('0x2e'))return _0x44a054;var _0x19c635=_['some'](_0x44a054,function(_0x4ea795){return _0x4ea795[_0xcde2('0x28')]===_0xcde2('0x29')||_0x4ea795['role']==='telephone';});if(!_0x19c635)return _0x44a054;return db[_0xcde2('0x85')][_0xcde2('0x47')]({'where':{'name':{'$or':['Agents',_0xcde2('0x2f')]},'userProfileId':_0x710dfe['user']['userProfileId']},'raw':!![]})[_0xcde2('0x16')](function(_0x33bada){if(_['isEmpty'](_0x33bada)||!_[_0xcde2('0x8a')](_0x33bada,['autoAssociation',0x0]))return _0x44a054;_0x1dee9f=[];var _0x93df83=_(_0x33bada)[_0xcde2('0x3a')](function(_0x28e716){if(_0x28e716['autoAssociation']===0x1)return;return _0x28e716['name']===_0xcde2('0x86')?_0xcde2('0x29'):'telephone';})[_0xcde2('0x8d')]()[_0xcde2('0x34')]();for(var _0x6dcf1e=0x0;_0x6dcf1e<_0x44a054[_0xcde2('0x5a')];_0x6dcf1e++){if(!_[_0xcde2('0x32')](_0x93df83,_0x44a054[_0x6dcf1e][_0xcde2('0x28')]))return;var _0x36f3ed=_0x44a054[_0x6dcf1e][_0xcde2('0x28')]===_0xcde2('0x29')?_0xcde2('0x86'):_0xcde2('0x2f');_0x1dee9f[_0xcde2('0x46')](db[_0xcde2('0x8e')]['create']({'name':_0x44a054[_0x6dcf1e]['name'],'resourceId':_0x44a054[_0x6dcf1e]['id'],'type':_0x36f3ed,'sectionId':_[_0xcde2('0x33')](_0x33bada,[_0xcde2('0x35'),_0x36f3ed])['id']},{}));}return Promise[_0xcde2('0x51')](_0x1dee9f);});})['then'](respondWithResult(_0x3ba875,0xc9))[_0xcde2('0x52')](handleError(_0x3ba875,null));};exports[_0xcde2('0x8f')]=function(_0x7e6e79,_0x35ffab){if(_0x7e6e79[_0xcde2('0x5e')]['id']){delete _0x7e6e79[_0xcde2('0x5e')]['id'];}return db['User'][_0xcde2('0x33')]({'where':{'id':_0x7e6e79[_0xcde2('0x5f')]['id']}})['then'](function(_0xaf1562){if(!_0xaf1562)return null;if(_0xaf1562['id']===_0x7e6e79[_0xcde2('0x2e')]['id']){if(!_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x90')]||!_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x91')]){throw new db['Sequelize'][(_0xcde2('0x92'))](_0xcde2('0x93'));}if(!_0xaf1562['authenticate'](_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x90')])){throw new db['Sequelize'][(_0xcde2('0x92'))](_0xcde2('0x94'));}if(_0x7e6e79['body'][_0xcde2('0x90')]===_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x91')]){throw new db[(_0xcde2('0x95'))][(_0xcde2('0x92'))](_0xcde2('0x96'));}}else if(_0x7e6e79['user'][_0xcde2('0x28')]===_0xcde2('0x2c')){if(!_0x7e6e79['body'][_0xcde2('0x91')]){throw new db[(_0xcde2('0x95'))][(_0xcde2('0x92'))](_0xcde2('0x97'));}}else if(_0x7e6e79[_0xcde2('0x2e')][_0xcde2('0x28')]==='user'){if(!_0x7e6e79['body']['newPassword']){throw new db['Sequelize'][(_0xcde2('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0xaf1562[_0xcde2('0x28')]!==_0xcde2('0x29')){throw new db[(_0xcde2('0x95'))][(_0xcde2('0x92'))](_0xcde2('0x82'));}}else{throw new db['Sequelize']['ValidationError']('Unauthorized');}return _0xaf1562;})[_0xcde2('0x16')](handleEntityNotFound(_0x35ffab,null))[_0xcde2('0x16')](function(_0x516254){return db[_0xcde2('0x65')][_0xcde2('0x98')]({'attributes':['id','securePassword',_0xcde2('0x99'),_0xcde2('0x9a')]})[_0xcde2('0x16')](function(_0x558730){if(_0x558730[_0xcde2('0x67')])authService['validatePasswordPattern'](_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x91')]);if(!_0x558730['enforcePasswordHistory']||!_0x516254[_0xcde2('0x9b')])return _0x516254;authService[_0xcde2('0x9c')](_0x7e6e79['body'][_0xcde2('0x91')],_0x516254[_0xcde2('0x9b')],_0x558730['passwordHistoryLimit']);return _0x516254;})[_0xcde2('0x16')](saveUpdates({'password':_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x91')],'passwordResetAt':_0x7e6e79[_0xcde2('0x2e')]['id']==_0x7e6e79['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x7e6e79[_0xcde2('0x5e')][_0xcde2('0x91')],_0x516254[_0xcde2('0x9b')])},null));})[_0xcde2('0x16')](respondWithResult(_0x35ffab,null))[_0xcde2('0x52')](handleError(_0x35ffab,null));};exports[_0xcde2('0x9d')]=function(_0x281f52,_0x35435b){var _0x2e04db=_0x281f52[_0xcde2('0x5e')]['channel'];return db[_0xcde2('0x38')][_0xcde2('0x33')]({'where':{'id':_0x281f52[_0xcde2('0x5f')]['id']},'attributes':['id',_0xcde2('0x35'),_0xcde2('0x28'),_0xcde2('0x9e'),'loginInPause',_0xcde2('0x9f'),'interface']})[_0xcde2('0x16')](handleEntityNotFound(_0x35435b,null))['then'](function(_0x465771){if(_0x465771){if(!utils['isValidChannel'](_0x2e04db)){throw new db['Sequelize'][(_0xcde2('0x92'))]('Unknown\x20channel');}return _0x465771[_0xcde2('0xa0')+_[_0xcde2('0xa1')](_0x2e04db['toLowerCase']())+_0xcde2('0xa2')](_0x281f52[_0xcde2('0x5e')][_0xcde2('0x62')],{'penalty':_0x281f52['body'][_0xcde2('0xa3')]||0x0})['spread'](function(_0x49a2c7){for(var _0x11ed25=0x0;_0x11ed25<_0x281f52['body'][_0xcde2('0x62')]['length'];_0x11ed25+=0x1){var _0x18190e={'UserId':Number(_0x281f52[_0xcde2('0x5f')]['id'])};_0x18190e[_[_0xcde2('0xa1')](_0x2e04db['toLowerCase']())+_0xcde2('0xa4')]=Number(_0x281f52[_0xcde2('0x5e')][_0xcde2('0x62')][_0x11ed25]);socket[_0xcde2('0xa5')]('user'+_[_0xcde2('0xa1')](_0x2e04db[_0xcde2('0xa6')]())+_0xcde2('0xa7'),_0x18190e);}return _0x49a2c7;})[_0xcde2('0x16')](function(){if(_0x2e04db===_0xcde2('0xa8')){return db[_0xcde2('0xa9')][_0xcde2('0x47')]({'where':{'id':_0x281f52[_0xcde2('0x5e')][_0xcde2('0x62')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xcde2('0x16')](function(_0x12cf84){var _0x5d4d2f=_0x465771[_0xcde2('0x2b')]({'plain':!![]});var _0x5973b5=[];if(_0x2e04db==='voice'&&_0x5d4d2f[_0xcde2('0x28')]==='agent'&&_0x5d4d2f[_0xcde2('0x9e')]){for(let _0x2aa6a1=0x0;_0x2aa6a1<_0x12cf84[_0xcde2('0x5a')];_0x2aa6a1+=0x1){_0x5973b5[_0xcde2('0x46')]({'membername':_0x5d4d2f[_0xcde2('0x35')],'UserId':_0x5d4d2f['id'],'queue_name':_0x12cf84[_0x2aa6a1][_0xcde2('0x35')],'VoiceQueueId':_0x12cf84[_0x2aa6a1]['id'],'interface':_[_0xcde2('0x6a')](_0x5d4d2f[_0xcde2('0xaa')])?util[_0xcde2('0xab')](_0xcde2('0xac'),_0x5d4d2f[_0xcde2('0x35')]):_0x5d4d2f[_0xcde2('0xaa')],'paused':_0x5d4d2f[_0xcde2('0x9f')]||![],'penalty':_0x281f52[_0xcde2('0x5e')][_0xcde2('0xa3')]||0x0});}return Promise['all'](_0x5973b5[_0xcde2('0x3a')](function(_0x3cb34d){return db[_0xcde2('0xad')][_0xcde2('0xae')](_0x3cb34d);}));}return _0x465771;});}})[_0xcde2('0x16')](respondWithStatusCode(_0x35435b,null))[_0xcde2('0x52')](handleError(_0x35435b,null));};exports[_0xcde2('0xaf')]=function(_0x2e2aeb,_0x1e58d5){var _0x471396,_0x1752ca;return db['User']['find']({'where':{'id':_0x2e2aeb[_0xcde2('0x5f')]['id']},'attributes':['id','name',_0xcde2('0x28')]})['then'](handleEntityNotFound(_0x1e58d5,null))[_0xcde2('0x16')](function(_0x49505f){if(_0x49505f){_0x471396=_0x49505f;if(!_0x2e2aeb['query'][_0xcde2('0xb0')]||!utils['isValidChannel'](_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0xb0')])){throw new db['Sequelize'][(_0xcde2('0x92'))](_0xcde2('0xb1'));}return _0x49505f['remove'+_[_0xcde2('0xa1')](_0x2e2aeb[_0xcde2('0x41')]['channel'][_0xcde2('0xa6')]())+_0xcde2('0xa2')](_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0x62')]);}})['then'](function(_0x2cc825){if(_[_0xcde2('0xb2')](_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0x62')])){for(var _0x506ed1=0x0;_0x506ed1<_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0x62')]['length'];_0x506ed1+=0x1){_0x1752ca={'UserId':Number(_0x2e2aeb[_0xcde2('0x5f')]['id'])};_0x1752ca[_[_0xcde2('0xa1')](_0x2e2aeb['query']['channel'][_0xcde2('0xa6')]())+'QueueId']=Number(_0x2e2aeb[_0xcde2('0x41')]['ids'][_0x506ed1]);socket['emit']('user'+_[_0xcde2('0xa1')](_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0xb0')][_0xcde2('0xa6')]())+_0xcde2('0xb3'),_0x1752ca);}}else{_0x1752ca={'UserId':Number(_0x2e2aeb[_0xcde2('0x5f')]['id'])};_0x1752ca[_[_0xcde2('0xa1')](_0x2e2aeb['query'][_0xcde2('0xb0')][_0xcde2('0xa6')]())+_0xcde2('0xa4')]=Number(_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0x62')]);socket[_0xcde2('0xa5')](_0xcde2('0x2e')+_['capitalize'](_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0xb0')]['toLowerCase']())+'Queue:remove',_0x1752ca);}return _0x2cc825;})[_0xcde2('0x16')](function(){if(_0x2e2aeb[_0xcde2('0x41')]['channel']===_0xcde2('0xa8')){return db['UserVoiceQueueRt'][_0xcde2('0x2a')]({'where':{'UserId':_0x2e2aeb['params']['id'],'VoiceQueueId':_0x2e2aeb[_0xcde2('0x41')][_0xcde2('0x62')]},'individualHooks':!![]})[_0xcde2('0x16')](function(){return _0x471396;});}return _0x471396;})[_0xcde2('0x16')](respondWithStatusCode(_0x1e58d5,null))[_0xcde2('0x52')](handleError(_0x1e58d5,null));};exports[_0xcde2('0xb4')]=function(_0x276d20,_0x5a89db){_0x276d20[_0xcde2('0x5e')][_0xcde2('0xb5')]=_0x276d20[_0xcde2('0xb6')][_0xcde2('0xb7')];return db[_0xcde2('0x38')]['find']({'where':{'id':_0x276d20[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x5a89db,null))[_0xcde2('0x16')](saveUpdates(_0x276d20[_0xcde2('0x5e')],null))[_0xcde2('0x16')](respondWithResult(_0x5a89db,null))[_0xcde2('0x52')](handleError(_0x5a89db,null));};exports[_0xcde2('0xb8')]=function(_0x429bd3,_0xa425a0){var _0x31d292=path[_0xcde2('0xb9')](config['root'],_0xcde2('0xba'));return db['User'][_0xcde2('0x33')]({'where':{'id':_0x429bd3[_0xcde2('0x5f')]['id']},'attributes':['id',_0xcde2('0xb5')],'raw':!![]})[_0xcde2('0x16')](handleEntityNotFound(_0xa425a0,null))['then'](function(_0x290670){if(_0x290670){if(_['isNil'](_0x290670[_0xcde2('0xb5')])){return _0xa425a0[_0xcde2('0xbb')](_0x31d292);}else{if(!fs[_0xcde2('0xbc')](path[_0xcde2('0xb9')](config[_0xcde2('0xbd')],'server/files/images/',_0x290670[_0xcde2('0xb5')]))){return _0xa425a0['download'](_0x31d292);}return _0xa425a0[_0xcde2('0xbb')](path[_0xcde2('0xb9')](config[_0xcde2('0xbd')],_0xcde2('0xbe'),_0x290670[_0xcde2('0xb5')]));}}})[_0xcde2('0x52')](handleError(_0xa425a0,null));};exports['getOpenTabs']=function(_0x366e24,_0x524010){return db[_0xcde2('0x38')][_0xcde2('0x33')]({'where':{'id':_0x366e24[_0xcde2('0x5f')]['id']},'attributes':['id']})[_0xcde2('0x16')](handleEntityNotFound(_0x524010,null))['then'](function(_0x2d6424){var _0x90cf63=[];values=_0x2d6424[_0xcde2('0x4b')];_0x90cf63['push'](get_open_tabs('chat',_0x2d6424[_0xcde2('0x4b')]));_0x90cf63[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4c'),_0x2d6424[_0xcde2('0x4b')]));_0x90cf63[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4f'),_0x2d6424[_0xcde2('0x4b')]));_0x90cf63[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x50'),_0x2d6424['dataValues']));_0x90cf63['push'](get_open_tabs(_0xcde2('0x4d'),_0x2d6424[_0xcde2('0x4b')]));_0x90cf63[_0xcde2('0x46')](get_open_tabs(_0xcde2('0x4e'),_0x2d6424[_0xcde2('0x4b')]));return Promise[_0xcde2('0x51')](_0x90cf63);})[_0xcde2('0x16')](function(_0x4aa2d6){if(_0x4aa2d6){var _0x15e0a1=_[_0xcde2('0x3a')](values[_0xcde2('0xbf')],function(_0x28b3de){return{'channel':_0xcde2('0xc0'),'id':_0x28b3de['id'],'createdAt':_0x28b3de[_0xcde2('0xc1')]};});var _0x3c36de=_[_0xcde2('0x3a')](values['FaxOpenTabs'],function(_0x4621ae){return{'channel':_0xcde2('0xc2'),'id':_0x4621ae['id'],'createdAt':_0x4621ae[_0xcde2('0xc1')]};});var _0x54a6aa=_[_0xcde2('0x3a')](values['OpenchannelOpenTabs'],function(_0x42312d){return{'channel':'OPENCHANNEL','id':_0x42312d['id'],'createdAt':_0x42312d['createdAt']};});var _0x86fff5=_[_0xcde2('0x3a')](values[_0xcde2('0xc3')],function(_0x2bbd99){return{'channel':_0xcde2('0xc4'),'id':_0x2bbd99['id'],'createdAt':_0x2bbd99[_0xcde2('0xc1')]};});var _0x5b76f6=_[_0xcde2('0x3a')](values[_0xcde2('0xc5')],function(_0x260794){return{'channel':_0xcde2('0xc6'),'id':_0x260794['id'],'createdAt':_0x260794[_0xcde2('0xc1')]};});var _0x314626=_[_0xcde2('0x3a')](values[_0xcde2('0xc7')],function(_0x206ac8){return{'channel':_0xcde2('0xc8'),'id':_0x206ac8['id'],'createdAt':_0x206ac8[_0xcde2('0xc1')]};});var _0x17ce2f=_[_0xcde2('0xc9')](_0x15e0a1,_0x3c36de,_0x54a6aa,_0x86fff5,_0x5b76f6,_0x314626);var _0x2c1164={'count':_0x17ce2f[_0xcde2('0x5a')],'rows':_0x17ce2f};return _0x2c1164;}else return null;})[_0xcde2('0x16')](respondWithResult(_0x524010,null))[_0xcde2('0x52')](handleError(_0x524010,null));};exports[_0xcde2('0xca')]=function(_0x32eefc,_0xcafaba){var _0x366ba7={};var _0x274ace={};var _0x5f45e7;var _0x1f6a79;return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x32eefc[_0xcde2('0x5f')]['id']}})['then'](handleEntityNotFound(_0xcafaba,null))[_0xcde2('0x16')](function(_0x1da8d1){if(_0x1da8d1){_0x5f45e7=_0x1da8d1;_0x274ace[_0xcde2('0x54')]=_[_0xcde2('0x56')](db['CmContact'][_0xcde2('0x39')]);_0x274ace[_0xcde2('0x41')]=_['keys'](_0x32eefc[_0xcde2('0x41')]);_0x274ace[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x274ace[_0xcde2('0x54')],_0x274ace[_0xcde2('0x41')]);_0x366ba7[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x274ace[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x32eefc['query'][_0xcde2('0x59')]));_0x366ba7[_0xcde2('0x45')]=_0x366ba7[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x366ba7[_0xcde2('0x45')]:_0x274ace[_0xcde2('0x54')];_0x366ba7[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x32eefc[_0xcde2('0x41')][_0xcde2('0xcc')]);_0x366ba7[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x32eefc[_0xcde2('0x41')],_0x274ace['filters']));if(_0x32eefc['query'][_0xcde2('0x30')]){_0x366ba7[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x366ba7[_0xcde2('0xcd')],{'$or':_[_0xcde2('0x3a')](_0x366ba7[_0xcde2('0x45')],function(_0x54de36){var _0x166611={};_0x166611[_0x54de36]={'$like':'%'+_0x32eefc[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x166611;})});}_0x366ba7=_['merge']({},_0x366ba7,_0x32eefc[_0xcde2('0x5d')]);return _0x5f45e7[_0xcde2('0xca')](_0x366ba7);}})['then'](function(_0x38bb93){if(_0x38bb93){_0x1f6a79=_0x38bb93[_0xcde2('0x5a')];if(_0x32eefc[_0xcde2('0x41')][_0xcde2('0xcf')](_0xcde2('0x42'))){_0x366ba7[_0xcde2('0x5b')]=[{'model':db[_0xcde2('0xd0')],'as':_0xcde2('0xd1'),'required':![]},{'model':db['Tag'],'as':_0xcde2('0xd2'),'attributes':['id',_0xcde2('0x35'),_0xcde2('0xd3')],'where':_0x32eefc[_0xcde2('0x41')]['tag']?{'id':_0x32eefc[_0xcde2('0x41')][_0xcde2('0xd4')]}:undefined,'required':_0x32eefc['query']['tag']?!![]:![]}];}if(!_0x32eefc[_0xcde2('0x41')]['hasOwnProperty'](_0xcde2('0xd5'))){_0x366ba7[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x32eefc[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x366ba7[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x32eefc[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x5f45e7[_0xcde2('0xca')](_0x366ba7);}})[_0xcde2('0x16')](function(_0x1790d0){if(_0x1790d0){return _0x1790d0?{'count':_0x1f6a79,'rows':_0x1790d0}:null;}})[_0xcde2('0x16')](respondWithResult(_0xcafaba,null))[_0xcde2('0x52')](handleError(_0xcafaba,null));};exports[_0xcde2('0xd7')]=function(_0x54f0d6,_0x30190b){var _0x40aff3;var _0x943c05={};var _0x1822e5;return db[_0xcde2('0x38')]['findOne']({'where':{'id':_0x54f0d6[_0xcde2('0x5f')]['id']},'attributes':['id',_0xcde2('0x35'),_0xcde2('0x28')]})[_0xcde2('0x16')](handleEntityNotFound(_0x30190b,null))[_0xcde2('0x16')](function(_0x3d5fab){if(!utils[_0xcde2('0xd8')](_0x54f0d6[_0xcde2('0x41')][_0xcde2('0xb0')])){throw new db[(_0xcde2('0x95'))][(_0xcde2('0x92'))]('Unknown\x20channel');}_0x40aff3=_0x3d5fab;var _0x5e821b={};_0x5e821b['model']=_[_0xcde2('0x56')](db[_[_0xcde2('0xa1')](_0x54f0d6['query'][_0xcde2('0xb0')])+'Queue'][_0xcde2('0x39')]);_0x5e821b[_0xcde2('0x41')]=_['keys'](_0x54f0d6['query']);_0x5e821b['filters']=_[_0xcde2('0x58')](_0x5e821b['model'],_0x5e821b[_0xcde2('0x41')]);_0x943c05[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x5e821b[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x54f0d6[_0xcde2('0x41')][_0xcde2('0x59')]));_0x943c05[_0xcde2('0x45')]=_0x943c05['attributes'][_0xcde2('0x5a')]?_0x943c05[_0xcde2('0x45')]:_0x5e821b[_0xcde2('0x54')];_0x943c05[_0xcde2('0xcb')]=qs['sort'](_0x54f0d6['query']['sort']);_0x943c05[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_['pick'](_0x54f0d6[_0xcde2('0x41')],_0x5e821b[_0xcde2('0x57')]));if(_0x54f0d6['query'][_0xcde2('0x30')]){_0x943c05['where']=_['merge'](_0x943c05[_0xcde2('0xcd')],{'$or':_[_0xcde2('0x3a')](_0x943c05[_0xcde2('0x45')],function(_0x4fd96e){var _0x4bfc10={};_0x4bfc10[_0x4fd96e]={'$like':'%'+_0x54f0d6[_0xcde2('0x41')]['filter']+'%'};return _0x4bfc10;})});}_0x943c05=_[_0xcde2('0x5c')]({},_0x943c05,_0x54f0d6['options']);switch(_0x40aff3[_0xcde2('0x28')]){case'admin':return db[_[_0xcde2('0xa1')](_0x54f0d6[_0xcde2('0x41')][_0xcde2('0xb0')])+_0xcde2('0xd9')][_0xcde2('0x47')](_0x943c05);case'user':case'agent':return _0x40aff3['get'+_['capitalize'](_0x54f0d6[_0xcde2('0x41')][_0xcde2('0xb0')])+_0xcde2('0xa2')](_0x943c05);default:throw new db[(_0xcde2('0x95'))][(_0xcde2('0x92'))]('Unknown\x20role');}})[_0xcde2('0x16')](function(_0x1a7dd5){_0x1822e5=_0x1a7dd5[_0xcde2('0x5a')];if(!_0x54f0d6[_0xcde2('0x41')][_0xcde2('0xcf')]('nolimit')){_0x943c05[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x54f0d6[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x943c05['offset']=qs[_0xcde2('0x22')](_0x54f0d6[_0xcde2('0x41')]['offset']);}switch(_0x40aff3[_0xcde2('0x28')]){case _0xcde2('0x2c'):return db[_['capitalize'](_0x54f0d6[_0xcde2('0x41')][_0xcde2('0xb0')])+_0xcde2('0xd9')][_0xcde2('0x47')](_0x943c05);case'user':case'agent':return _0x40aff3[_0xcde2('0x2b')+_[_0xcde2('0xa1')](_0x54f0d6['query'][_0xcde2('0xb0')])+_0xcde2('0xa2')](_0x943c05);}})[_0xcde2('0x16')](function(_0x548afe){return{'count':_0x1822e5,'rows':_0x548afe};})['then'](respondWithResult(_0x30190b,null))['catch'](handleError(_0x30190b,null));};exports[_0xcde2('0xda')]=function(_0x26729e,_0x1e70ca){var _0xca1d5d={};var _0x53e189={};var _0x2f4e59;var _0x5c809e;return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x26729e[_0xcde2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1e70ca,null))[_0xcde2('0x16')](function(_0xc3748d){if(_0xc3748d){_0x2f4e59=_0xc3748d;_0x53e189['model']=_[_0xcde2('0x56')](db['UserVoiceQueueRt'][_0xcde2('0x39')]);_0x53e189[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x26729e[_0xcde2('0x41')]);_0x53e189[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x53e189['model'],_0x53e189[_0xcde2('0x41')]);_0xca1d5d[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x53e189[_0xcde2('0x54')],qs['fields'](_0x26729e['query'][_0xcde2('0x59')]));_0xca1d5d[_0xcde2('0x45')]=_0xca1d5d[_0xcde2('0x45')]['length']?_0xca1d5d['attributes']:_0x53e189[_0xcde2('0x54')];_0xca1d5d[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x26729e['query'][_0xcde2('0xcc')]);_0xca1d5d[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x26729e[_0xcde2('0x41')],_0x53e189[_0xcde2('0x57')]));if(_0x26729e[_0xcde2('0x41')][_0xcde2('0x30')]){_0xca1d5d[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0xca1d5d['where'],{'$or':_['map'](_0xca1d5d[_0xcde2('0x45')],function(_0x849333){var _0x215980={};_0x215980[_0x849333]={'$like':'%'+_0x26729e['query'][_0xcde2('0x30')]+'%'};return _0x215980;})});}_0xca1d5d=_['merge']({},_0xca1d5d,_0x26729e[_0xcde2('0x5d')]);return _0x2f4e59['getVoiceQueuesRt'](_0xca1d5d);}})[_0xcde2('0x16')](function(_0x4154cc){if(_0x4154cc){_0x5c809e=_0x4154cc[_0xcde2('0x5a')];if(!_0x26729e[_0xcde2('0x41')][_0xcde2('0xcf')]('nolimit')){_0xca1d5d[_0xcde2('0xd6')]=qs['limit'](_0x26729e[_0xcde2('0x41')]['limit']);_0xca1d5d['offset']=qs[_0xcde2('0x22')](_0x26729e[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x2f4e59['getVoiceQueuesRt'](_0xca1d5d);}})[_0xcde2('0x16')](function(_0x8e00f){if(_0x8e00f){return _0x8e00f?{'count':_0x5c809e,'rows':_0x8e00f}:null;}})[_0xcde2('0x16')](respondWithResult(_0x1e70ca,null))[_0xcde2('0x52')](handleError(_0x1e70ca,null));};exports[_0xcde2('0xdb')]=function(_0x1f528c,_0x3c30ba){var _0x2ff9b6={};var _0x347af2={};var _0x3bd8d2;var _0x1ee935;return db['User'][_0xcde2('0x98')]({'where':{'id':_0x1f528c[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x3c30ba,null))[_0xcde2('0x16')](function(_0xff6a87){if(_0xff6a87){_0x3bd8d2=_0xff6a87;_0x347af2[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0xdc')][_0xcde2('0x39')]);_0x347af2[_0xcde2('0x41')]=_['keys'](_0x1f528c['query']);_0x347af2['filters']=_['intersection'](_0x347af2[_0xcde2('0x54')],_0x347af2[_0xcde2('0x41')]);_0x2ff9b6[_0xcde2('0x45')]=_['intersection'](_0x347af2[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x1f528c[_0xcde2('0x41')][_0xcde2('0x59')]));_0x2ff9b6['attributes']=_0x2ff9b6['attributes'][_0xcde2('0x5a')]?_0x2ff9b6['attributes']:_0x347af2[_0xcde2('0x54')];_0x2ff9b6[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x1f528c[_0xcde2('0x41')][_0xcde2('0xcc')]);_0x2ff9b6[_0xcde2('0xcd')]=qs['filters'](_['pick'](_0x1f528c[_0xcde2('0x41')],_0x347af2[_0xcde2('0x57')]));if(_0x1f528c['query'][_0xcde2('0x30')]){_0x2ff9b6[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x2ff9b6['where'],{'$or':_[_0xcde2('0x3a')](_0x2ff9b6[_0xcde2('0x45')],function(_0x49db39){var _0xfdf834={};_0xfdf834[_0x49db39]={'$like':'%'+_0x1f528c[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0xfdf834;})});}_0x2ff9b6=_[_0xcde2('0x5c')]({},_0x2ff9b6,_0x1f528c[_0xcde2('0x5d')]);return _0x3bd8d2[_0xcde2('0xdb')](_0x2ff9b6);}})[_0xcde2('0x16')](function(_0x3bba5a){if(_0x3bba5a){_0x1ee935=_0x3bba5a[_0xcde2('0x5a')];if(!_0x1f528c[_0xcde2('0x41')][_0xcde2('0xcf')]('nolimit')){_0x2ff9b6['limit']=qs['limit'](_0x1f528c[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x2ff9b6[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x1f528c[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x3bd8d2[_0xcde2('0xdb')](_0x2ff9b6);}})['then'](function(_0x4d0878){if(_0x4d0878){return _0x4d0878?{'count':_0x1ee935,'rows':_0x4d0878}:null;}})['then'](respondWithResult(_0x3c30ba,null))[_0xcde2('0x52')](handleError(_0x3c30ba,null));};exports['getRecordings']=function(_0x4702d0,_0x3a4a80){var _0x328e3d={'raw':!![],'where':{}};var _0x22ac1d={};var _0x512aef={'count':0x0,'rows':[]};return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x4702d0['params']['id']}})['then'](handleEntityNotFound(_0x3a4a80,null))[_0xcde2('0x16')](function(_0x2908b6){if(_0x2908b6){_0x22ac1d[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0xdd')][_0xcde2('0x39')]);_0x22ac1d[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x4702d0[_0xcde2('0x41')]);_0x22ac1d[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x22ac1d['model'],_0x22ac1d['query']);_0x328e3d[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x22ac1d[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x4702d0['query'][_0xcde2('0x59')]));_0x328e3d[_0xcde2('0x45')]=_0x328e3d['attributes'][_0xcde2('0x5a')]?_0x328e3d[_0xcde2('0x45')]:_0x22ac1d['model'];if(!_0x4702d0[_0xcde2('0x41')]['hasOwnProperty'](_0xcde2('0xd5'))){_0x328e3d[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x4702d0['query'][_0xcde2('0xd6')]);_0x328e3d[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x4702d0[_0xcde2('0x41')][_0xcde2('0x22')]);}_0x328e3d[_0xcde2('0xcb')]=qs['sort'](_0x4702d0['query']['sort']);_0x328e3d[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x4702d0[_0xcde2('0x41')],_0x22ac1d[_0xcde2('0x57')]));_0x328e3d['where'][_0xcde2('0xde')]=_0x2908b6['id'];if(_0x4702d0[_0xcde2('0x41')]['filter']){_0x328e3d[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x328e3d[_0xcde2('0xcd')],{'$or':_[_0xcde2('0x3a')](_0x328e3d[_0xcde2('0x45')],function(_0x52373c){var _0xe01af2={};_0xe01af2[_0x52373c]={'$like':'%'+_0x4702d0[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0xe01af2;})});}_0x328e3d=_[_0xcde2('0x5c')]({},_0x328e3d,_0x4702d0[_0xcde2('0x5d')]);return db[_0xcde2('0xdd')][_0xcde2('0x24')]({'where':_0x328e3d[_0xcde2('0xcd')]})[_0xcde2('0x16')](function(_0x1e384f){_0x512aef[_0xcde2('0x24')]=_0x1e384f;if(_0x4702d0[_0xcde2('0x41')]['includeAll']){_0x328e3d[_0xcde2('0x5b')]=[{'all':!![]}];}return db[_0xcde2('0xdd')][_0xcde2('0x47')](_0x328e3d);})[_0xcde2('0x16')](function(_0xee4cf7){_0x512aef[_0xcde2('0x49')]=_0xee4cf7;return _0x512aef;});}})[_0xcde2('0x16')](respondWithFilteredResult(_0x3a4a80,_0x328e3d))[_0xcde2('0x52')](handleError(_0x3a4a80,null));};exports[_0xcde2('0xdf')]=function(_0x4446b4,_0x4be5be){var _0x33a985={'raw':!![],'where':{}};var _0xb278d7={};var _0x277788={'count':0x0,'rows':[]};return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x4446b4['params']['id']}})['then'](handleEntityNotFound(_0x4be5be,null))[_0xcde2('0x16')](function(_0x1a257e){if(_0x1a257e){_0xb278d7[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0xe0')][_0xcde2('0x39')]);_0xb278d7[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x4446b4['query']);_0xb278d7[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0xb278d7[_0xcde2('0x54')],_0xb278d7['query']);_0x33a985[_0xcde2('0x45')]=_['intersection'](_0xb278d7[_0xcde2('0x54')],qs['fields'](_0x4446b4[_0xcde2('0x41')][_0xcde2('0x59')]));_0x33a985['attributes']=_0x33a985[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x33a985[_0xcde2('0x45')]:_0xb278d7['model'];if(!_0x4446b4['query'][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x33a985[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x4446b4['query'][_0xcde2('0xd6')]);_0x33a985[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x4446b4[_0xcde2('0x41')][_0xcde2('0x22')]);}_0x33a985[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x4446b4['query'][_0xcde2('0xcc')]);_0x33a985['where']=qs['filters'](_['pick'](_0x4446b4[_0xcde2('0x41')],_0xb278d7[_0xcde2('0x57')]));_0x33a985[_0xcde2('0xcd')][_0xcde2('0xde')]=_0x1a257e['id'];if(_0x4446b4[_0xcde2('0x41')][_0xcde2('0x30')]){_0x33a985['where']=_[_0xcde2('0x5c')](_0x33a985[_0xcde2('0xcd')],{'$or':_[_0xcde2('0x3a')](_0x33a985['attributes'],function(_0x187dce){var _0x4bbc19={};_0x4bbc19[_0x187dce]={'$like':'%'+_0x4446b4[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x4bbc19;})});}_0x33a985=_[_0xcde2('0x5c')]({},_0x33a985,_0x4446b4[_0xcde2('0x5d')]);return db[_0xcde2('0xe0')][_0xcde2('0x24')]({'where':_0x33a985['where']})[_0xcde2('0x16')](function(_0x27cde6){_0x277788[_0xcde2('0x24')]=_0x27cde6;if(_0x4446b4[_0xcde2('0x41')][_0xcde2('0x42')]){_0x33a985[_0xcde2('0x5b')]=[{'all':!![]}];}return db['ScreenRecording'][_0xcde2('0x47')](_0x33a985);})[_0xcde2('0x16')](function(_0x159d09){_0x277788[_0xcde2('0x49')]=_0x159d09;return _0x277788;});}})[_0xcde2('0x16')](respondWithFilteredResult(_0x4be5be,_0x33a985))[_0xcde2('0x52')](handleError(_0x4be5be,null));};exports[_0xcde2('0xe1')]=function(_0x2ddead,_0x2f7f4b){var _0x417ba2={};var _0x46c161={};var _0x4e25aa;var _0x947033;return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x2ddead[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x2f7f4b,null))[_0xcde2('0x16')](function(_0x1c119f){if(_0x1c119f){_0x4e25aa=_0x1c119f;_0x46c161[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0xe2')][_0xcde2('0x39')]);_0x46c161[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x2ddead['query']);_0x46c161[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x46c161['model'],_0x46c161[_0xcde2('0x41')]);_0x417ba2[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x46c161[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x2ddead[_0xcde2('0x41')][_0xcde2('0x59')]));_0x417ba2[_0xcde2('0x45')]=_0x417ba2[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x417ba2['attributes']:_0x46c161['model'];_0x417ba2['order']=qs['sort'](_0x2ddead[_0xcde2('0x41')][_0xcde2('0xcc')]);_0x417ba2['where']=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x2ddead[_0xcde2('0x41')],_0x46c161['filters']));if(_0x2ddead[_0xcde2('0x41')][_0xcde2('0x30')]){_0x417ba2[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x417ba2[_0xcde2('0xcd')],{'$or':_['map'](_0x417ba2[_0xcde2('0x45')],function(_0x596a87){var _0x3a9031={};_0x3a9031[_0x596a87]={'$like':'%'+_0x2ddead[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x3a9031;})});}_0x417ba2=_[_0xcde2('0x5c')]({},_0x417ba2,_0x2ddead['options']);return _0x4e25aa[_0xcde2('0xe1')](_0x417ba2);}})['then'](function(_0x28ae65){if(_0x28ae65){_0x947033=_0x28ae65[_0xcde2('0x5a')];if(!_0x2ddead['query'][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x417ba2[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x2ddead[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x417ba2['offset']=qs['offset'](_0x2ddead['query'][_0xcde2('0x22')]);}return _0x4e25aa[_0xcde2('0xe1')](_0x417ba2);}})['then'](function(_0x293565){if(_0x293565){return _0x293565?{'count':_0x947033,'rows':_0x293565}:null;}})['then'](respondWithResult(_0x2f7f4b,null))['catch'](handleError(_0x2f7f4b,null));};exports[_0xcde2('0xe3')]=function(_0x23e2b4,_0x5571f2){var _0x3ac911={};var _0x5adfbd={};var _0x278eb9;var _0x2d5093;return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x23e2b4[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x5571f2,null))[_0xcde2('0x16')](function(_0x430360){if(_0x430360){_0x278eb9=_0x430360;_0x5adfbd[_0xcde2('0x54')]=_[_0xcde2('0x56')](db['OpenchannelInteraction'][_0xcde2('0x39')]);_0x5adfbd[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x23e2b4[_0xcde2('0x41')]);_0x5adfbd['filters']=_[_0xcde2('0x58')](_0x5adfbd[_0xcde2('0x54')],_0x5adfbd[_0xcde2('0x41')]);_0x3ac911[_0xcde2('0x45')]=_['intersection'](_0x5adfbd[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x23e2b4[_0xcde2('0x41')]['fields']));_0x3ac911['attributes']=_0x3ac911['attributes'][_0xcde2('0x5a')]?_0x3ac911['attributes']:_0x5adfbd[_0xcde2('0x54')];_0x3ac911[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x23e2b4[_0xcde2('0x41')]['sort']);_0x3ac911[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x23e2b4['query'],_0x5adfbd[_0xcde2('0x57')]));if(_0x23e2b4[_0xcde2('0x41')][_0xcde2('0x30')]){_0x3ac911[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x3ac911['where'],{'$or':_[_0xcde2('0x3a')](_0x3ac911[_0xcde2('0x45')],function(_0x407a87){var _0x218b63={};_0x218b63[_0x407a87]={'$like':'%'+_0x23e2b4[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x218b63;})});}_0x3ac911=_[_0xcde2('0x5c')]({},_0x3ac911,_0x23e2b4[_0xcde2('0x5d')]);return _0x278eb9[_0xcde2('0xe3')](_0x3ac911);}})[_0xcde2('0x16')](function(_0x336c22){if(_0x336c22){_0x2d5093=_0x336c22[_0xcde2('0x5a')];if(!_0x23e2b4['query'][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x3ac911[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x23e2b4[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x3ac911['offset']=qs[_0xcde2('0x22')](_0x23e2b4[_0xcde2('0x41')]['offset']);}return _0x278eb9[_0xcde2('0xe3')](_0x3ac911);}})[_0xcde2('0x16')](function(_0x19dc7a){if(_0x19dc7a){return _0x19dc7a?{'count':_0x2d5093,'rows':_0x19dc7a}:null;}})[_0xcde2('0x16')](respondWithResult(_0x5571f2,null))[_0xcde2('0x52')](handleError(_0x5571f2,null));};exports[_0xcde2('0xe4')]=function(_0x3ae400,_0x6a8bd2){var _0x564e62={'raw':!![],'where':{}};var _0x32742c={};var _0x17871b={'count':0x0,'rows':[]};return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x3ae400[_0xcde2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x6a8bd2,null))[_0xcde2('0x16')](function(_0x219381){if(_0x219381){_0x32742c[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0xe5')]['rawAttributes']);_0x32742c['query']=_[_0xcde2('0x56')](_0x3ae400[_0xcde2('0x41')]);_0x32742c[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x32742c[_0xcde2('0x54')],_0x32742c['query']);_0x564e62[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x32742c[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x3ae400[_0xcde2('0x41')]['fields']));_0x564e62[_0xcde2('0x45')]=_0x564e62['attributes'][_0xcde2('0x5a')]?_0x564e62['attributes']:_0x32742c[_0xcde2('0x54')];if(!_0x3ae400[_0xcde2('0x41')][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x564e62[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x3ae400['query'][_0xcde2('0xd6')]);_0x564e62['offset']=qs['offset'](_0x3ae400['query'][_0xcde2('0x22')]);}_0x564e62[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x3ae400[_0xcde2('0x41')][_0xcde2('0xcc')]);_0x564e62[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_['pick'](_0x3ae400[_0xcde2('0x41')],_0x32742c[_0xcde2('0x57')]));_0x564e62['where']['UserId']=_0x219381['id'];if(_0x3ae400[_0xcde2('0x41')][_0xcde2('0x30')]){_0x564e62['where']=_[_0xcde2('0x5c')](_0x564e62[_0xcde2('0xcd')],{'$or':_[_0xcde2('0x3a')](_0x564e62[_0xcde2('0x45')],function(_0x3bb20e){var _0x3266d7={};_0x3266d7[_0x3bb20e]={'$like':'%'+_0x3ae400[_0xcde2('0x41')]['filter']+'%'};return _0x3266d7;})});}_0x564e62=_[_0xcde2('0x5c')]({},_0x564e62,_0x3ae400[_0xcde2('0x5d')]);return db[_0xcde2('0xe5')][_0xcde2('0x24')]({'where':_0x564e62[_0xcde2('0xcd')]})['then'](function(_0x4d50a1){_0x17871b['count']=_0x4d50a1;if(_0x3ae400[_0xcde2('0x41')][_0xcde2('0x42')]){_0x564e62['include']=[{'all':!![]}];}return db[_0xcde2('0xe5')]['findAll'](_0x564e62);})[_0xcde2('0x16')](function(_0x536c76){_0x17871b['rows']=_0x536c76;return _0x17871b;});}})['then'](respondWithFilteredResult(_0x6a8bd2,_0x564e62))['catch'](handleError(_0x6a8bd2,null));};exports[_0xcde2('0xe6')]=function(_0x149dba,_0x39e883){var _0x2f9cbd={};var _0x234f67={};var _0x36d3ea;var _0x5adde2;return db['User'][_0xcde2('0x98')]({'where':{'id':_0x149dba[_0xcde2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x39e883,null))['then'](function(_0x23d478){if(_0x23d478){_0x36d3ea=_0x23d478;_0x234f67[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0xe7')]['rawAttributes']);_0x234f67[_0xcde2('0x41')]=_['keys'](_0x149dba[_0xcde2('0x41')]);_0x234f67[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x234f67[_0xcde2('0x54')],_0x234f67[_0xcde2('0x41')]);_0x2f9cbd[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x234f67['model'],qs[_0xcde2('0x59')](_0x149dba[_0xcde2('0x41')][_0xcde2('0x59')]));_0x2f9cbd[_0xcde2('0x45')]=_0x2f9cbd[_0xcde2('0x45')]['length']?_0x2f9cbd[_0xcde2('0x45')]:_0x234f67[_0xcde2('0x54')];_0x2f9cbd[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x149dba[_0xcde2('0x41')][_0xcde2('0xcc')]);_0x2f9cbd[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x149dba[_0xcde2('0x41')],_0x234f67[_0xcde2('0x57')]));if(_0x149dba[_0xcde2('0x41')][_0xcde2('0x30')]){_0x2f9cbd[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x2f9cbd[_0xcde2('0xcd')],{'$or':_['map'](_0x2f9cbd[_0xcde2('0x45')],function(_0x4525a7){var _0x558355={};_0x558355[_0x4525a7]={'$like':'%'+_0x149dba[_0xcde2('0x41')]['filter']+'%'};return _0x558355;})});}_0x2f9cbd=_[_0xcde2('0x5c')]({},_0x2f9cbd,_0x149dba[_0xcde2('0x5d')]);return _0x36d3ea[_0xcde2('0xe6')](_0x2f9cbd);}})['then'](function(_0x35cb59){if(_0x35cb59){_0x5adde2=_0x35cb59[_0xcde2('0x5a')];if(!_0x149dba[_0xcde2('0x41')][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x2f9cbd['limit']=qs[_0xcde2('0xd6')](_0x149dba[_0xcde2('0x41')]['limit']);_0x2f9cbd['offset']=qs[_0xcde2('0x22')](_0x149dba[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x36d3ea[_0xcde2('0xe6')](_0x2f9cbd);}})[_0xcde2('0x16')](function(_0x29b8d6){if(_0x29b8d6){return _0x29b8d6?{'count':_0x5adde2,'rows':_0x29b8d6}:null;}})[_0xcde2('0x16')](respondWithResult(_0x39e883,null))[_0xcde2('0x52')](handleError(_0x39e883,null));};exports['getFaxInteractions']=function(_0x5dc7b1,_0x5d2aa1){var _0x4bfac8={};var _0x16da68={};var _0x5ea4ec;var _0x17c5a5;return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x5dc7b1['params']['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x5d2aa1,null))['then'](function(_0x3acca0){if(_0x3acca0){_0x5ea4ec=_0x3acca0;_0x16da68['model']=_[_0xcde2('0x56')](db[_0xcde2('0xe8')]['rawAttributes']);_0x16da68['query']=_['keys'](_0x5dc7b1['query']);_0x16da68[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x16da68[_0xcde2('0x54')],_0x16da68[_0xcde2('0x41')]);_0x4bfac8[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x16da68[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x5dc7b1[_0xcde2('0x41')][_0xcde2('0x59')]));_0x4bfac8['attributes']=_0x4bfac8[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x4bfac8[_0xcde2('0x45')]:_0x16da68[_0xcde2('0x54')];_0x4bfac8[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x5dc7b1['query']['sort']);_0x4bfac8['where']=qs[_0xcde2('0x57')](_['pick'](_0x5dc7b1[_0xcde2('0x41')],_0x16da68[_0xcde2('0x57')]));if(_0x5dc7b1[_0xcde2('0x41')][_0xcde2('0x30')]){_0x4bfac8[_0xcde2('0xcd')]=_['merge'](_0x4bfac8['where'],{'$or':_[_0xcde2('0x3a')](_0x4bfac8[_0xcde2('0x45')],function(_0x221304){var _0x1188e7={};_0x1188e7[_0x221304]={'$like':'%'+_0x5dc7b1[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x1188e7;})});}_0x4bfac8=_['merge']({},_0x4bfac8,_0x5dc7b1[_0xcde2('0x5d')]);return _0x5ea4ec[_0xcde2('0xe9')](_0x4bfac8);}})[_0xcde2('0x16')](function(_0x312a43){if(_0x312a43){_0x17c5a5=_0x312a43[_0xcde2('0x5a')];if(!_0x5dc7b1[_0xcde2('0x41')][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x4bfac8[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x5dc7b1[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x4bfac8[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x5dc7b1[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x5ea4ec[_0xcde2('0xe9')](_0x4bfac8);}})['then'](function(_0x236c2f){if(_0x236c2f){return _0x236c2f?{'count':_0x17c5a5,'rows':_0x236c2f}:null;}})[_0xcde2('0x16')](respondWithResult(_0x5d2aa1,null))[_0xcde2('0x52')](handleError(_0x5d2aa1,null));};exports[_0xcde2('0xea')]=function(_0x4aa656,_0x3210cd){var _0x4abfd0={};var _0x274aa0={};var _0x2bd1ea;var _0x20d5f2;return db[_0xcde2('0x38')]['findOne']({'where':{'id':_0x4aa656[_0xcde2('0x5f')]['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0x3210cd,null))[_0xcde2('0x16')](function(_0x2df96e){if(_0x2df96e){_0x2bd1ea=_0x2df96e;_0x274aa0[_0xcde2('0x54')]=_['keys'](db[_0xcde2('0xeb')]['rawAttributes']);_0x274aa0[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x4aa656[_0xcde2('0x41')]);_0x274aa0[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x274aa0[_0xcde2('0x54')],_0x274aa0[_0xcde2('0x41')]);_0x4abfd0[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x274aa0[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x4aa656[_0xcde2('0x41')][_0xcde2('0x59')]));_0x4abfd0['attributes']=_0x4abfd0[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x4abfd0['attributes']:_0x274aa0[_0xcde2('0x54')];_0x4abfd0[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x4aa656[_0xcde2('0x41')][_0xcde2('0xcc')]);_0x4abfd0['where']=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x4aa656[_0xcde2('0x41')],_0x274aa0[_0xcde2('0x57')]));if(_0x4aa656[_0xcde2('0x41')]['filter']){_0x4abfd0[_0xcde2('0xcd')]=_[_0xcde2('0x5c')](_0x4abfd0['where'],{'$or':_['map'](_0x4abfd0[_0xcde2('0x45')],function(_0x5c8f73){var _0x31dfb2={};_0x31dfb2[_0x5c8f73]={'$like':'%'+_0x4aa656['query'][_0xcde2('0x30')]+'%'};return _0x31dfb2;})});}_0x4abfd0=_[_0xcde2('0x5c')]({},_0x4abfd0,_0x4aa656[_0xcde2('0x5d')]);return _0x2bd1ea[_0xcde2('0xea')](_0x4abfd0);}})[_0xcde2('0x16')](function(_0x47a825){if(_0x47a825){_0x20d5f2=_0x47a825[_0xcde2('0x5a')];if(!_0x4aa656['query']['hasOwnProperty'](_0xcde2('0xd5'))){_0x4abfd0[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x4aa656['query']['limit']);_0x4abfd0['offset']=qs[_0xcde2('0x22')](_0x4aa656[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x2bd1ea[_0xcde2('0xea')](_0x4abfd0);}})['then'](function(_0x20c30c){if(_0x20c30c){return _0x20c30c?{'count':_0x20d5f2,'rows':_0x20c30c}:null;}})[_0xcde2('0x16')](respondWithResult(_0x3210cd,null))[_0xcde2('0x52')](handleError(_0x3210cd,null));};exports[_0xcde2('0xec')]=function(_0x132ce2,_0x23d05c,_0x38c5c5){var _0x28557d;var _0x2fd81f;var _0x304ab2;var _0x592896=!_['isNil'](_0x132ce2['params']['id'])?_0x132ce2[_0xcde2('0x5f')]['id']:!_[_0xcde2('0x6a')](_0x132ce2[_0xcde2('0x2e')]['id'])?_0x132ce2['user']['id']:null;return db[_0xcde2('0x38')]['find']({'where':{'id':_0x592896,'role':{'$or':[_0xcde2('0x2c'),_0xcde2('0x2e'),'agent']}},'attributes':['id','name',_0xcde2('0xed'),_0xcde2('0xee'),_0xcde2('0x28'),_0xcde2('0x64'),'loginInPause']})[_0xcde2('0x16')](function(_0x5d0360){if(_0x5d0360){if(_0x5d0360[_0xcde2('0x28')]===_0xcde2('0x29')){_0x28557d=_0x5d0360;if(_0x132ce2[_0xcde2('0x5e')][_0xcde2('0xaa')]){_0x304ab2=util[_0xcde2('0xab')]('LOCAL/%s@from-sip/n',_0x28557d[_0x132ce2[_0xcde2('0x5e')][_0xcde2('0xaa')]]);}else if(_0x132ce2[_0xcde2('0x5e')]['intrf']){_0x304ab2=util[_0xcde2('0xab')](_0xcde2('0xac'),_0x132ce2[_0xcde2('0x5e')][_0xcde2('0xef')]);}else{_0x304ab2=util[_0xcde2('0xab')](_0xcde2('0xac'),_0x28557d[_0xcde2('0x35')]);}socket['to'](util[_0xcde2('0xab')]('user:%s',_0x28557d['name']))['emit'](_0xcde2('0xf0'),{'user':{'id':_0x28557d['id'],'name':_0x28557d[_0xcde2('0x35')]},'ip':_0x132ce2[_0xcde2('0xf1')][_0xcde2('0xf2')]||_0x132ce2[_0xcde2('0xf3')]['remoteAddress']||_0x132ce2['socket'][_0xcde2('0xf4')]||_0x132ce2['connection']['socket']['remoteAddress']});return db[_0xcde2('0xad')][_0xcde2('0x2a')]({'where':{'membername':_0x28557d[_0xcde2('0x35')]},'individualHooks':!![]});}}else{throw new db[(_0xcde2('0x95'))][(_0xcde2('0x92'))](_0xcde2('0xf5'));}})[_0xcde2('0x16')](function(){if(_0x28557d){return _0x28557d[_0xcde2('0xf6')]({'raw':!![]});}})[_0xcde2('0x16')](function(_0x24b71c){if(_0x28557d){if(_0x24b71c){_0x2fd81f=_0x24b71c;if(_0x2fd81f[_0xcde2('0x5a')]){var _0x340942=_0x2fd81f[_0xcde2('0x3a')](function(_0x40441e){var _0x1ccab0={'membername':_0x28557d[_0xcde2('0x35')],'UserId':_0x28557d['id'],'queue_name':_0x40441e['name'],'VoiceQueueId':_0x40441e['id'],'interface':_0x304ab2,'paused':_0x28557d[_0xcde2('0xf7')]||![],'penalty':_0x40441e[_0xcde2('0xf8')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x1ccab0);});return Promise[_0xcde2('0x51')](_0x340942);}}}})[_0xcde2('0x16')](function(){if(_0x28557d){return db[_0xcde2('0xf9')][_0xcde2('0x47')]({'where':{'membername':_0x28557d[_0xcde2('0x35')],'exitAt':null}});}})[_0xcde2('0x16')](function(_0x501d2d){if(_0x28557d){var _0x42bcff=[];_0x501d2d[_0xcde2('0xfa')](function(_0x2e764e){_0x42bcff[_0xcde2('0x46')](_0x2e764e[_0xcde2('0x27')]({'exitAt':moment()[_0xcde2('0xab')](_0xcde2('0xfb'))}));});return Promise[_0xcde2('0x51')](_0x42bcff);}})['then'](function(){if(_0x28557d){var _0x4cd986=[];var _0x4253d7=[];var _0x2b2b48=utils[_0xcde2('0xfc')]();var _0xe895fb={'membername':_0x28557d[_0xcde2('0x35')],'interface':_0x304ab2,'enterAt':moment()[_0xcde2('0xab')](_0xcde2('0xfb')),'role':_0x28557d[_0xcde2('0x28')],'internal':_0x28557d[_0xcde2('0x64')]};_0x2b2b48['forEach'](function(_0x2ea84b){_0x4cd986[_0xcde2('0x46')](_[_0xcde2('0x5c')]({'channel':_0x2ea84b,'type':'LOGIN','data1':_0x132ce2[_0xcde2('0x5e')][_0xcde2('0xfd')],'data2':_0x304ab2},_0xe895fb));if(_0x28557d[_0xcde2('0xf7')]){_0x4253d7['push'](_['merge']({'channel':_0x2ea84b,'type':'PAUSE','data1':_0xcde2('0xfe')},_0xe895fb));}});return db['MemberReport'][_0xcde2('0x89')](_0x4cd986[_0xcde2('0xc9')](_0x4253d7),{'individualHooks':!![]});}})[_0xcde2('0x16')](function(){if(_0x28557d){return _0x28557d[_0xcde2('0x27')]({'online':!![],'lastLoginAt':moment()[_0xcde2('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x28557d['loginInPause']||![],'mailPause':_0x28557d[_0xcde2('0xf7')]||![],'chatPause':_0x28557d[_0xcde2('0xf7')]||![],'faxPause':_0x28557d[_0xcde2('0xf7')]||![],'smsPause':_0x28557d[_0xcde2('0xf7')]||![],'openchannelPause':_0x28557d[_0xcde2('0xf7')]||![],'whatsappPause':_0x28557d[_0xcde2('0xf7')]||![],'pauseType':_0x28557d[_0xcde2('0xf7')]?_0xcde2('0xfe'):null,'interface':_0x304ab2,'lastPauseAt':moment()[_0xcde2('0xab')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xcde2('0x16')](function(_0x51df16){if(_0x132ce2[_0xcde2('0xff')]){return _0x38c5c5();}else{return Promise[_0xcde2('0x100')](_0x51df16)[_0xcde2('0x16')](respondWithResult(_0x23d05c,null));}})[_0xcde2('0x52')](handleError(_0x23d05c,null));};exports[_0xcde2('0x101')]=function(_0x50c9f5,_0x3cd7e8){var _0x1c7440;return db['User'][_0xcde2('0x33')]({'where':{'id':_0x50c9f5['params']['id'],'role':'agent'},'attributes':['id','name','role']})[_0xcde2('0x16')](handleEntityNotFound(_0x3cd7e8,null))[_0xcde2('0x16')](function(_0x31ac02){if(_0x31ac02){_0x1c7440=_0x31ac02;return db[_0xcde2('0xad')][_0xcde2('0x2a')]({'where':{'membername':_0x1c7440[_0xcde2('0x35')]},'individualHooks':!![]});}})[_0xcde2('0x16')](function(){return db[_0xcde2('0xf9')][_0xcde2('0x47')]({'where':{'membername':_0x1c7440[_0xcde2('0x35')],'exitAt':null}});})[_0xcde2('0x16')](function(_0x4f9ff3){var _0x1b173a=[];_0x4f9ff3[_0xcde2('0xfa')](function(_0x279c43){_0x1b173a['push'](_0x279c43['update']({'exitAt':moment()[_0xcde2('0xab')](_0xcde2('0xfb'))}));});return Promise[_0xcde2('0x51')](_0x1b173a);})[_0xcde2('0x16')](function(){return _0x1c7440[_0xcde2('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xcde2('0x16')](respondWithResult(_0x3cd7e8,null))[_0xcde2('0x52')](handleError(_0x3cd7e8,null));};exports[_0xcde2('0x102')]=function(_0x5b3ef5,_0x509ef3){var _0x58c4df;return db[_0xcde2('0xad')][_0xcde2('0x27')]({'paused':0x1},{'where':{'UserId':_0x5b3ef5[_0xcde2('0x5f')]['id']},'individualHooks':!![]})[_0xcde2('0x16')](function(){return db['User'][_0xcde2('0x33')]({'where':{'id':_0x5b3ef5[_0xcde2('0x5f')]['id'],'role':'agent'},'attributes':['id',_0xcde2('0x35'),'role',_0xcde2('0x64'),_0xcde2('0xaa'),_0xcde2('0x9e')]});})['then'](handleEntityNotFound(_0x509ef3,null))[_0xcde2('0x16')](function(_0x5ad476){if(_0x5ad476){_0x58c4df=_0x5ad476;return respondWithRpcPromise(_0xcde2('0x103'),_0xcde2('0x102'),{'id':_0x58c4df['id'],'name':_0x58c4df[_0xcde2('0x35')],'pause':!![]});}})[_0xcde2('0x16')](function(){if(_0x58c4df){return db[_0xcde2('0xf9')][_0xcde2('0x47')]({'where':{'membername':_0x58c4df[_0xcde2('0x35')],'type':_0xcde2('0x104'),'exitAt':null}});}})[_0xcde2('0x16')](function(_0x5a9c27){if(_0x5a9c27[_0xcde2('0x5a')]){var _0x5887c9=moment()[_0xcde2('0xab')](_0xcde2('0xfb'));for(var _0x138849=0x0,_0x8f5888=_0x5a9c27[_0xcde2('0x5a')];_0x138849<_0x8f5888;_0x138849++){_0x5a9c27[_0x138849][_0xcde2('0x105')]({'exitAt':_0x5887c9});}}})[_0xcde2('0x16')](function(){var _0x3add99=[];var _0x562a1e=utils['getChannels']();_0x562a1e['forEach'](function(_0x58861b){_0x3add99[_0xcde2('0x46')]({'channel':_0x58861b,'membername':_0x58c4df['name'],'interface':_['isNil'](_0x58c4df[_0xcde2('0xaa')])?util[_0xcde2('0xab')](_0xcde2('0xac'),_0x58c4df[_0xcde2('0x35')]):_0x58c4df[_0xcde2('0xaa')],'type':_0xcde2('0x104'),'enterAt':moment()[_0xcde2('0xab')](_0xcde2('0xfb')),'data1':_0x5b3ef5[_0xcde2('0x5e')][_0xcde2('0x3c')]||'DEFAULT\x20PAUSE','role':_0x58c4df[_0xcde2('0x28')],'internal':_0x58c4df['internal']});});return db[_0xcde2('0xf9')]['bulkCreate'](_0x3add99,{'individualHooks':!![]});})[_0xcde2('0x16')](function(){return _0x58c4df[_0xcde2('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5b3ef5['body'][_0xcde2('0x3c')]||_0xcde2('0x106'),'lastPauseAt':moment()[_0xcde2('0xab')](_0xcde2('0xfb'))});})['then'](respondWithResult(_0x509ef3,null))[_0xcde2('0x52')](handleError(_0x509ef3,null));};exports[_0xcde2('0x107')]=function(_0x249f69,_0x1e7803){if(_0x249f69[_0xcde2('0x5e')][_0xcde2('0xb0')]&&!utils[_0xcde2('0xd8')](_0x249f69[_0xcde2('0x5e')][_0xcde2('0xb0')])){throw new APIBadRequestError(util[_0xcde2('0xab')](_0xcde2('0x108'),_0x249f69['body'][_0xcde2('0xb0')]));}return db['User']['find']({'where':{'id':_0x249f69[_0xcde2('0x5f')]['id']},'attributes':['id',_0xcde2('0x35'),'role',_0xcde2('0x64'),'interface',_0xcde2('0x9e'),_0xcde2('0x9f'),_0xcde2('0x109'),_0xcde2('0x10a'),'faxPause',_0xcde2('0x10b'),'smsPause','whatsappPause',_0xcde2('0x10c'),'lastPauseAt']})[_0xcde2('0x16')](function(_0x3ccc93){if(!_0x3ccc93){throw new APINotFoundError(util[_0xcde2('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x249f69['params']['id']));}return _0x3ccc93[_0xcde2('0x107')](_0x249f69[_0xcde2('0x5e')]['channel']);})[_0xcde2('0x16')](respondWithResult(_0x1e7803,null))[_0xcde2('0x52')](APIHandleError(_0x1e7803));};exports[_0xcde2('0x10d')]=function(_0x2032a2,_0x53b94c){var _0x4ac65f={};var _0x88b1b9={};var _0x393a91;var _0x23f2bb;return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x2032a2[_0xcde2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x53b94c,null))[_0xcde2('0x16')](function(_0x2b2986){if(_0x2b2986){_0x393a91=_0x2b2986;_0x88b1b9[_0xcde2('0x54')]=_[_0xcde2('0x56')](db[_0xcde2('0x10e')][_0xcde2('0x39')]);_0x88b1b9[_0xcde2('0x41')]=_['keys'](_0x2032a2[_0xcde2('0x41')]);_0x88b1b9[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x88b1b9[_0xcde2('0x54')],_0x88b1b9['query']);_0x4ac65f[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x88b1b9[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x2032a2[_0xcde2('0x41')][_0xcde2('0x59')]));_0x4ac65f[_0xcde2('0x45')]=_0x4ac65f[_0xcde2('0x45')]['length']?_0x4ac65f[_0xcde2('0x45')]:_0x88b1b9['model'];_0x4ac65f['order']=qs[_0xcde2('0xcc')](_0x2032a2['query']['sort']);_0x4ac65f['where']=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x2032a2[_0xcde2('0x41')],_0x88b1b9[_0xcde2('0x57')]));if(_0x2032a2[_0xcde2('0x41')][_0xcde2('0x30')]){_0x4ac65f['where']=_['merge'](_0x4ac65f['where'],{'$or':_[_0xcde2('0x3a')](_0x4ac65f[_0xcde2('0x45')],function(_0x164f72){var _0x1badf1={};_0x1badf1[_0x164f72]={'$like':'%'+_0x2032a2[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x1badf1;})});}_0x4ac65f=_[_0xcde2('0x5c')]({},_0x4ac65f,_0x2032a2['options']);return _0x393a91[_0xcde2('0x10d')](_0x4ac65f);}})[_0xcde2('0x16')](function(_0x3b583e){if(_0x3b583e){_0x23f2bb=_0x3b583e[_0xcde2('0x5a')];if(!_0x2032a2[_0xcde2('0x41')][_0xcde2('0xcf')]('nolimit')){_0x4ac65f[_0xcde2('0xd6')]=qs['limit'](_0x2032a2[_0xcde2('0x41')][_0xcde2('0xd6')]);_0x4ac65f[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x2032a2[_0xcde2('0x41')][_0xcde2('0x22')]);}return _0x393a91[_0xcde2('0x10d')](_0x4ac65f);}})[_0xcde2('0x16')](function(_0x4a04e5){if(_0x4a04e5){return _0x4a04e5?{'count':_0x23f2bb,'rows':_0x4a04e5}:null;}})[_0xcde2('0x16')](respondWithResult(_0x53b94c,null))[_0xcde2('0x52')](handleError(_0x53b94c,null));};exports['addTeams']=function(_0x246ec8,_0x22a2e1){var _0x3fc425=_0x246ec8[_0xcde2('0x5f')]['id'];var _0x566485=_0x246ec8['body']?_0x246ec8[_0xcde2('0x5e')][_0xcde2('0x62')]:null;var _0x19e616=[];return Promise[_0xcde2('0x100')]()[_0xcde2('0x16')](function(){if(!_0x566485)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xcde2('0x16')](function(){return db['User']['findOne']({'where':{'id':_0x3fc425}});})[_0xcde2('0x16')](function(_0x131218){if(!_0x131218)throw new APINotFoundError(util['format'](_0xcde2('0x10f'),_0x246ec8[_0xcde2('0x5f')]['id']));return db[_0xcde2('0x6c')][_0xcde2('0x110')](function(_0x588a4d){return _0x131218['addTeams'](_0x566485,{'transaction':_0x588a4d})[_0xcde2('0x16')](function(){return db['Team'][_0xcde2('0x47')]({'where':{'id':{'$in':_0x566485}}});})[_0xcde2('0x16')](function(_0x1f8de0){var _0x4d0d76=_['map'](_0x1f8de0,function(_0x5491de){return _0x5491de[_0xcde2('0x111')]();});return Promise[_0xcde2('0x51')](_0x4d0d76);})[_0xcde2('0x16')](function(_0x575559){_0x19e616=_[_0xcde2('0x112')](_0x575559);var _0x2e9853=_[_0xcde2('0x3a')](_0x19e616,function(_0xd74d4a){return _0xd74d4a[_0xcde2('0x113')](_0x131218['id'],{'transaction':_0x588a4d});});return Promise[_0xcde2('0x51')](_0x2e9853);})[_0xcde2('0x16')](function(){if(!_0x131218['online'])return;var _0x1f7cba=_[_0xcde2('0x30')](_0x19e616,function(_0x5370cf){return _0x5370cf['getDataValue'](_0xcde2('0xb0'))===_0xcde2('0x114');});var _0x5b70bd=_['map'](_0x1f7cba,function(_0x28b79f){return db[_0xcde2('0xad')]['upsert']({'membername':_0x131218[_0xcde2('0x35')],'UserId':_0x131218['id'],'queue_name':_0x28b79f['name'],'VoiceQueueId':_0x28b79f['id'],'interface':_[_0xcde2('0x6a')](_0x131218[_0xcde2('0xaa')])?util[_0xcde2('0xab')](_0xcde2('0xac'),_0x131218[_0xcde2('0x35')]):_0x131218['interface'],'paused':_0x131218[_0xcde2('0x9f')]||![],'penalty':_0x131218['penalty']},{'transaction':_0x588a4d});});return Promise[_0xcde2('0x51')](_0x5b70bd);})['then'](function(){return db['TeamVoicePrefix'][_0xcde2('0x47')]({'where':{'teamId':{'$in':_0x566485}}});})[_0xcde2('0x16')](function(_0x277d79){var _0x5f39e3=_[_0xcde2('0x3a')](_0x277d79,function(_0x28a30f){return db[_0xcde2('0x115')][_0xcde2('0x81')]({'UserId':_0x131218['id'],'VoicePrefixId':_0x28a30f[_0xcde2('0x116')]},{'transaction':_0x588a4d});});return Promise[_0xcde2('0x51')](_0x5f39e3);});});})[_0xcde2('0x16')](function(){for(var _0x233485=0x0;_0x233485<_0x19e616[_0xcde2('0x5a')];_0x233485++){var _0x923d9=_0x19e616[_0x233485][_0xcde2('0x117')]('channel');var _0x5ebb99=_0x923d9+'QueueId';socket[_0xcde2('0xa5')](_0xcde2('0x2e')+_0x923d9+_0xcde2('0xa7'),{'UserId':_0x3fc425,['queueField']:_0x19e616[_0x233485]['id']});}})[_0xcde2('0x16')](respondWithStatusCode(_0x22a2e1,null))[_0xcde2('0x52')](APIHandleError(_0x22a2e1));};exports[_0xcde2('0x118')]=function(_0x5e49e2,_0x1a0ac9){var _0x5bb51e=_0x5e49e2['params']['id'];var _0x2b226e=null;if(_0x5e49e2[_0xcde2('0x41')][_0xcde2('0x62')]){_0x2b226e=_[_0xcde2('0xb2')](_0x5e49e2[_0xcde2('0x41')][_0xcde2('0x62')])?_0x5e49e2['query'][_0xcde2('0x62')]:[_0x5e49e2[_0xcde2('0x41')][_0xcde2('0x62')]];}var _0x4c4767=[];return Promise[_0xcde2('0x100')]()[_0xcde2('0x16')](function(){if(!_0x2b226e)throw new APIBadRequestError(_0xcde2('0x119'));})['then'](function(){return db[_0xcde2('0x38')][_0xcde2('0x98')]({'where':{'id':_0x5bb51e}});})[_0xcde2('0x16')](function(_0x412a57){if(!_0x412a57)throw new APINotFoundError(util[_0xcde2('0xab')](_0xcde2('0x10f'),_0x5e49e2[_0xcde2('0x5f')]['id']));return db['sequelize'][_0xcde2('0x110')](function(_0x148424){return _0x412a57[_0xcde2('0x118')](_0x2b226e,{'transaction':_0x148424})[_0xcde2('0x16')](function(){return db[_0xcde2('0x10e')]['findAll']({'where':{'id':{'$in':_0x2b226e}}});})[_0xcde2('0x16')](function(_0xf20bcd){var _0x3a794e=_[_0xcde2('0x3a')](_0xf20bcd,function(_0x3d46a9){return _0x3d46a9[_0xcde2('0x111')]();});return Promise[_0xcde2('0x51')](_0x3a794e);})[_0xcde2('0x16')](function(_0x31504c){_0x4c4767=_[_0xcde2('0x112')](_0x31504c);var _0x4d0f43=_[_0xcde2('0x3a')](_0x4c4767,function(_0xee32f9){return _0xee32f9['removeAgent'](_0x412a57['id'],{'transaction':_0x148424});});return Promise[_0xcde2('0x51')](_0x4d0f43);})[_0xcde2('0x16')](function(){if(!_0x412a57[_0xcde2('0x9e')])return;var _0x287436=_[_0xcde2('0x30')](_0x4c4767,function(_0xb0176a){return _0xb0176a[_0xcde2('0x117')](_0xcde2('0xb0'))===_0xcde2('0x114');});var _0x22ab93=_[_0xcde2('0x3a')](_0x287436,function(_0x2c4d9f){return db[_0xcde2('0xad')]['destroy']({'where':{'VoiceQueueId':_0x2c4d9f['id'],'UserId':_0x412a57['id']},'transaction':_0x148424});});return Promise[_0xcde2('0x51')](_0x22ab93);})[_0xcde2('0x16')](function(){return db[_0xcde2('0x11a')]['findAll']({'where':{'teamId':{'$in':_0x2b226e}}});})['then'](function(_0x20a62a){var _0x289fd8=_[_0xcde2('0x3a')](_0x20a62a,function(_0xa10cef){return db[_0xcde2('0x115')][_0xcde2('0x2a')]({'where':{'UserId':_0x412a57['id'],'VoicePrefixId':_0xa10cef[_0xcde2('0x116')]}},{'transaction':_0x148424});});return Promise[_0xcde2('0x51')](_0x289fd8);});});})['then'](function(){for(var _0xe2a8a9=0x0;_0xe2a8a9<_0x4c4767['length'];_0xe2a8a9++){var _0x29a37d=_0x4c4767[_0xe2a8a9]['getDataValue'](_0xcde2('0xb0'));var _0xe34619=_0x29a37d+'QueueId';socket[_0xcde2('0xa5')]('user'+_0x29a37d+_0xcde2('0xb3'),{'UserId':_0x5bb51e,['queueField']:_0x4c4767[_0xe2a8a9]['id']});}})['then'](respondWithStatusCode(_0x1a0ac9,null))[_0xcde2('0x52')](APIHandleError(_0x1a0ac9));};exports[_0xcde2('0x11b')]=function(_0x8b6237,_0xdafac){var _0x10eec5={};var _0x3c8638={};var _0x458773;var _0x352043;return db['User']['findOne']({'where':{'id':_0x8b6237['params']['id']}})[_0xcde2('0x16')](handleEntityNotFound(_0xdafac,null))[_0xcde2('0x16')](function(_0x3c629a){if(_0x3c629a){_0x458773=_0x3c629a;_0x3c8638['model']=_['keys'](db[_0xcde2('0xd0')][_0xcde2('0x39')]);_0x3c8638[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x8b6237[_0xcde2('0x41')]);_0x3c8638['filters']=_[_0xcde2('0x58')](_0x3c8638[_0xcde2('0x54')],_0x3c8638[_0xcde2('0x41')]);_0x10eec5[_0xcde2('0x45')]=_[_0xcde2('0x58')](_0x3c8638['model'],qs[_0xcde2('0x59')](_0x8b6237['query'][_0xcde2('0x59')]));_0x10eec5[_0xcde2('0x45')]=_0x10eec5[_0xcde2('0x45')][_0xcde2('0x5a')]?_0x10eec5['attributes']:_0x3c8638['model'];_0x10eec5[_0xcde2('0xcb')]=qs[_0xcde2('0xcc')](_0x8b6237['query']['sort']);_0x10eec5[_0xcde2('0xcd')]=qs[_0xcde2('0x57')](_[_0xcde2('0xce')](_0x8b6237[_0xcde2('0x41')],_0x3c8638['filters']));if(_0x8b6237['query']['filter']){_0x10eec5[_0xcde2('0xcd')]=_['merge'](_0x10eec5[_0xcde2('0xcd')],{'$or':_[_0xcde2('0x3a')](_0x10eec5[_0xcde2('0x45')],function(_0x3e42d6){var _0x173b38={};_0x173b38[_0x3e42d6]={'$like':'%'+_0x8b6237[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x173b38;})});}_0x10eec5=_[_0xcde2('0x5c')]({},_0x10eec5,_0x8b6237[_0xcde2('0x5d')]);return _0x458773[_0xcde2('0x11b')](_0x10eec5);}})[_0xcde2('0x16')](function(_0x1cfacd){if(_0x1cfacd){_0x352043=_0x1cfacd[_0xcde2('0x5a')];if(!_0x8b6237[_0xcde2('0x41')][_0xcde2('0xcf')](_0xcde2('0xd5'))){_0x10eec5[_0xcde2('0xd6')]=qs[_0xcde2('0xd6')](_0x8b6237['query']['limit']);_0x10eec5[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x8b6237['query'][_0xcde2('0x22')]);}return _0x458773[_0xcde2('0x11b')](_0x10eec5);}})['then'](function(_0x1731b7){if(_0x1731b7){return _0x1731b7?{'count':_0x352043,'rows':_0x1731b7}:null;}})[_0xcde2('0x16')](respondWithResult(_0xdafac,null))[_0xcde2('0x52')](handleError(_0xdafac,null));};exports['getAgents']=function(_0x26f253,_0x30b157){var _0x33606e={};var _0x4ac5ea={};var _0x3e2f12;return db[_0xcde2('0x38')]['findOne']({'where':{'id':_0x26f253[_0xcde2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x30b157,null))['then'](function(_0x3d3c53){if(_0x3d3c53){_0x3e2f12=_0x3d3c53;_0x4ac5ea[_0xcde2('0x54')]=_[_0xcde2('0x56')](db['User'][_0xcde2('0x39')]);_0x4ac5ea[_0xcde2('0x41')]=_[_0xcde2('0x56')](_0x26f253[_0xcde2('0x41')]);_0x4ac5ea[_0xcde2('0x57')]=_[_0xcde2('0x58')](_0x4ac5ea[_0xcde2('0x54')],_0x4ac5ea[_0xcde2('0x41')]);_0x33606e['attributes']=_[_0xcde2('0x58')](_0x4ac5ea[_0xcde2('0x54')],qs[_0xcde2('0x59')](_0x26f253[_0xcde2('0x41')][_0xcde2('0x59')]));_0x33606e[_0xcde2('0x45')]=_0x33606e[_0xcde2('0x45')]['length']?_0x33606e[_0xcde2('0x45')]:_0x4ac5ea[_0xcde2('0x54')];_0x33606e['order']=qs[_0xcde2('0xcc')](_0x26f253['query'][_0xcde2('0xcc')]);_0x33606e[_0xcde2('0xcd')]=qs['filters'](_['pick'](_0x26f253[_0xcde2('0x41')],_0x4ac5ea[_0xcde2('0x57')]));if(_0x26f253[_0xcde2('0x41')][_0xcde2('0x30')]){_0x33606e['where']=_[_0xcde2('0x5c')](_0x33606e[_0xcde2('0xcd')],{'$or':_['map'](_0x33606e[_0xcde2('0x45')],function(_0x256104){var _0x56ac54={};_0x56ac54[_0x256104]={'$like':'%'+_0x26f253[_0xcde2('0x41')][_0xcde2('0x30')]+'%'};return _0x56ac54;})});}_0x33606e[_0xcde2('0x54')]=db[_0xcde2('0x38')];_0x33606e['as']=_0xcde2('0x86');_0x33606e=_[_0xcde2('0x5c')]({},_0x33606e,_0x26f253[_0xcde2('0x5d')]);return _0x3e2f12['getVoiceQueues']({'include':[_0x33606e]});}})[_0xcde2('0x16')](function(_0x25cb01){if(_0x25cb01){var _0x25ff5d={},_0x34cba4=[];for(var _0x420866=0x0;_0x420866<_0x25cb01['length'];_0x420866+=0x1){for(var _0x7f6ad2=0x0,_0x34a431;_0x7f6ad2<_0x25cb01[_0x420866][_0xcde2('0x86')]['length'];_0x7f6ad2+=0x1){_0x34a431=_0x25cb01[_0x420866][_0xcde2('0x86')][_0x7f6ad2]['get']({'plain':!![]});_0x25ff5d[_0x34a431['id']]=_0x34a431;}}_0x25ff5d=_[_0xcde2('0x11c')](_0x25ff5d);for(var _0xa358c5=qs[_0xcde2('0x22')](_0x26f253['query']['offset']);_0xa358c5<_0x25ff5d[_0xcde2('0x5a')]&&_0x34cba4[_0xcde2('0x5a')]=_0x21c2d0){_0x245744=_0x21c2d0;_0x24fca2=0xc8;}else{_0x24fca2=0xce;}_0x12cde8[_0x8c35('0x20')](_0x24fca2);return _0x12cde8[_0x8c35('0x26')](_0x8c35('0x27'),_0x10be27+'-'+_0x245744+'/'+_0x21c2d0)[_0x8c35('0x21')](_0x3f0155);}return null;};}function saveUpdates(_0x3727e3){return function(_0x4a0f69){if(_0x4a0f69){return _0x4a0f69[_0x8c35('0x28')](_0x3727e3)[_0x8c35('0x29')](function(_0x94ec01){if(_0x94ec01['role']===_0x8c35('0x2a')){socket[_0x8c35('0x2b')]('userNotification:recalc:'+_0x94ec01['id'],_0x94ec01);}return _0x94ec01;});}return null;};}function removeEntity(_0x3fe9d0){return function(_0x7ba8d9){if(_0x7ba8d9){return _0x7ba8d9['destroy']()[_0x8c35('0x29')](function(){var _0x37557d=_0x7ba8d9[_0x8c35('0x2c')]({'plain':!![]});if(_0x37557d[_0x8c35('0x2d')]==='admin')return;var _0x2f5cc6=[{'name':'Users','value':_0x8c35('0x2e'),'ignore':!![]},{'name':_0x8c35('0x2f'),'value':'agent','ignore':![]},{'name':_0x8c35('0x30'),'value':_0x8c35('0x31'),'ignore':![]}];var _0x3ae66d=_(_0x2f5cc6)['filter'](_0x8c35('0x32'))[_0x8c35('0x33')](_0x8c35('0x34'))[_0x8c35('0x34')]();if(_[_0x8c35('0x35')](_0x3ae66d,_0x37557d[_0x8c35('0x2d')])){return;}var _0x42dfa5=_['find'](_0x2f5cc6,[_0x8c35('0x34'),_0x37557d['role']])['name'];return db[_0x8c35('0x36')][_0x8c35('0x37')]({'where':{'type':_0x42dfa5,'resourceId':_0x37557d['id']}})[_0x8c35('0x29')](function(){return _0x7ba8d9;});})[_0x8c35('0x29')](function(){_0x3fe9d0[_0x8c35('0x20')](0xcc)[_0x8c35('0x38')]();});}};}function handleEntityNotFound(_0x15789e){return function(_0x15f332){if(!_0x15f332){_0x15789e['sendStatus'](0x194);}return _0x15f332;};}function handleError(_0x27cf43,_0x598941){_0x598941=_0x598941||0x1f4;return function(_0x44d82d){logger[_0x8c35('0x1b')](_0x44d82d[_0x8c35('0x39')]);if(_0x44d82d[_0x8c35('0x3a')]){delete _0x44d82d['name'];}_0x27cf43[_0x8c35('0x20')](_0x598941)[_0x8c35('0x3b')](_0x44d82d);};}exports[_0x8c35('0x3c')]=function(_0x57415b,_0xd13caa){var _0xa5b43c={},_0x19927d={'count':0x0,'rows':[]};var _0x15570f=_(db[_0x8c35('0x3d')][_0x8c35('0x3e')])[_0x8c35('0x33')](function(_0xfea7d8){return{'name':_0xfea7d8['fieldName'],'type':_0xfea7d8[_0x8c35('0x3f')][_0x8c35('0x40')]};})['filter'](function(_0x1c1c81){return!_[_0x8c35('0x35')](['password',_0x8c35('0x41')],_0x1c1c81[_0x8c35('0x3a')]);})[_0x8c35('0x34')]();_0xa5b43c=qs[_0x8c35('0x42')](_0x15570f,_0x57415b);var _0x29e11d={'where':_0xa5b43c[_0x8c35('0x43')]};return db[_0x8c35('0x3d')][_0x8c35('0x25')](_0x29e11d)[_0x8c35('0x29')](function(_0xb3c99d){_0x19927d[_0x8c35('0x25')]=_0xb3c99d;if(_0x57415b[_0x8c35('0x44')][_0x8c35('0x45')]){_0xa5b43c[_0x8c35('0x46')]=[{'all':!![]}];}if(_0x57415b[_0x8c35('0x44')]['userSetting']==='true'){_0xa5b43c[_0x8c35('0x46')]=[{'model':db[_0x8c35('0x47')],'as':'userSetting'}];}if(!_[_0x8c35('0x35')](_0xa5b43c['attributes'],'id')){_0xa5b43c[_0x8c35('0x48')][_0x8c35('0x49')]('id');}return db[_0x8c35('0x3d')][_0x8c35('0x4a')](_0xa5b43c);})[_0x8c35('0x29')](function(_0x22bf39){_0x19927d[_0x8c35('0x4b')]=_0x22bf39;if(_0x57415b[_0x8c35('0x44')]['openTabs']===_0x8c35('0x4c')){var _0x354db9=[];for(var _0x11acd2=0x0;_0x11acd2<_0x19927d['rows']['length'];_0x11acd2++){_0x354db9[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x4d'),_0x19927d[_0x8c35('0x4b')][_0x11acd2]['dataValues']));_0x354db9['push'](get_open_tabs('sms',_0x19927d['rows'][_0x11acd2][_0x8c35('0x4e')]));_0x354db9['push'](get_open_tabs('fax',_0x19927d[_0x8c35('0x4b')][_0x11acd2][_0x8c35('0x4e')]));_0x354db9[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x4f'),_0x19927d[_0x8c35('0x4b')][_0x11acd2][_0x8c35('0x4e')]));_0x354db9[_0x8c35('0x49')](get_open_tabs('openchannel',_0x19927d[_0x8c35('0x4b')][_0x11acd2][_0x8c35('0x4e')]));_0x354db9[_0x8c35('0x49')](get_open_tabs('whatsapp',_0x19927d[_0x8c35('0x4b')][_0x11acd2][_0x8c35('0x4e')]));}return Promise[_0x8c35('0x50')](_0x354db9)[_0x8c35('0x29')](function(){return _0x19927d;});}else{return _0x19927d;}})[_0x8c35('0x29')](respondWithFilteredResult(_0xd13caa,_0xa5b43c))[_0x8c35('0x1f')](handleError(_0xd13caa,null));};exports[_0x8c35('0x51')]=function(_0x4215f4,_0x442606){var _0xaa9575={'raw':![],'where':{'id':_0x4215f4[_0x8c35('0x52')]['id']}},_0xa80377={};_0xa80377[_0x8c35('0x53')]=_['differenceBy'](_[_0x8c35('0x54')](db[_0x8c35('0x3d')][_0x8c35('0x3e')]),[_0x8c35('0x55'),_0x8c35('0x41')]);_0xa80377[_0x8c35('0x44')]=_[_0x8c35('0x54')](_0x4215f4['query']);_0xa80377[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0xa80377['model'],_0xa80377[_0x8c35('0x44')]);_0xaa9575[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0xa80377['model'],qs['fields'](_0x4215f4[_0x8c35('0x44')][_0x8c35('0x58')]));_0xaa9575[_0x8c35('0x48')]=_0xaa9575[_0x8c35('0x48')]['length']?_0xaa9575[_0x8c35('0x48')]:_0xa80377[_0x8c35('0x53')];if(_0x4215f4['query'][_0x8c35('0x45')]){_0xaa9575[_0x8c35('0x46')]=[{'all':!![]}];}if(_0x4215f4[_0x8c35('0x44')][_0x8c35('0x59')]==='true'){_0xaa9575[_0x8c35('0x46')]=[{'model':db[_0x8c35('0x47')],'as':_0x8c35('0x59')}];}_0xaa9575=_['merge']({},_0xaa9575,_0x4215f4[_0x8c35('0x5a')]);if(!_[_0x8c35('0x35')](_0xaa9575['attributes'],'id')){_0xaa9575['attributes'][_0x8c35('0x49')]('id');}return db[_0x8c35('0x3d')][_0x8c35('0x5b')](_0xaa9575)[_0x8c35('0x29')](handleEntityNotFound(_0x442606,null))['then'](function(_0x589e6c){var _0x164d49=[];values=_0x589e6c;if(_0x4215f4[_0x8c35('0x44')][_0x8c35('0x5c')]===_0x8c35('0x4c')){_0x164d49[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x4d'),_0x589e6c[_0x8c35('0x4e')]));_0x164d49[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x5d'),_0x589e6c[_0x8c35('0x4e')]));_0x164d49['push'](get_open_tabs(_0x8c35('0x5e'),_0x589e6c[_0x8c35('0x4e')]));_0x164d49[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x5f'),_0x589e6c[_0x8c35('0x4e')]));_0x164d49[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x60'),_0x589e6c[_0x8c35('0x4e')]));_0x164d49['push'](get_open_tabs(_0x8c35('0x4f'),_0x589e6c[_0x8c35('0x4e')]));return Promise['all'](_0x164d49);}else{return values;}})['then'](function(){return values;})[_0x8c35('0x29')](respondWithResult(_0x442606,null))[_0x8c35('0x1f')](handleError(_0x442606,null));};exports[_0x8c35('0x28')]=function(_0x581cf6,_0x7f7c59){if(_0x581cf6[_0x8c35('0x61')]['id']){delete _0x581cf6[_0x8c35('0x61')]['id'];}delete _0x581cf6[_0x8c35('0x61')][_0x8c35('0x2d')];return db[_0x8c35('0x3d')]['find']({'where':{'id':_0x581cf6[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x7f7c59,null))['then'](saveUpdates(_0x581cf6[_0x8c35('0x61')],null))['then'](respondWithResult(_0x7f7c59,null))[_0x8c35('0x1f')](handleError(_0x7f7c59,null));};exports[_0x8c35('0x62')]=function(_0x1307ee,_0x34d491){return db[_0x8c35('0x3d')][_0x8c35('0x62')]()['then'](respondWithResult(_0x34d491,null))[_0x8c35('0x1f')](handleError(_0x34d491,null));};exports[_0x8c35('0x63')]=function(_0x33c39f,_0x4a14db){return db['User'][_0x8c35('0x5b')]({'where':{'id':_0x33c39f['params']['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x4a14db,null))[_0x8c35('0x29')](function(_0x4bb96a){if(_0x4bb96a){return _0x4bb96a[_0x8c35('0x63')](_0x33c39f['body'][_0x8c35('0x64')],_[_0x8c35('0x65')](_0x33c39f['body'],[_0x8c35('0x64'),'id'])||{});}})[_0x8c35('0x29')](respondWithResult(_0x4a14db,null))[_0x8c35('0x1f')](handleError(_0x4a14db,null));};function validateUser(_0x4ce9af){return new Promise(function(_0x580b39,_0x56a458){if(_0x4ce9af['internal'])return _0x580b39(_0x4ce9af);return db[_0x8c35('0x66')][_0x8c35('0x67')](0x1)[_0x8c35('0x29')](function(_0x22f8e5){if(_0x22f8e5[_0x8c35('0x68')])authService[_0x8c35('0x69')](_0x4ce9af[_0x8c35('0x55')]);db[_0x8c35('0x3d')][_0x8c35('0x6a')](_0x8c35('0x6b'))[_0x8c35('0x29')](function(_0x7466c1){if(_[_0x8c35('0x6c')](_0x7466c1)){_0x4ce9af[_0x8c35('0x6b')]=_0x22f8e5[_0x8c35('0x6d')]||0x1;return;}if(_[_0x8c35('0x6c')](_0x22f8e5['min_internal'])||_0x22f8e5[_0x8c35('0x6d')]===_0x7466c1){_0x4ce9af[_0x8c35('0x6b')]=_0x7466c1+0x1;return;}if(_0x22f8e5[_0x8c35('0x6d')]>_0x7466c1){_0x4ce9af[_0x8c35('0x6b')]=_0x22f8e5[_0x8c35('0x6d')];return;}return db[_0x8c35('0x6e')]['query'](_0x8c35('0x6f'),{'type':db[_0x8c35('0x6e')][_0x8c35('0x70')]['SELECT']})[_0x8c35('0x29')](function(_0x5e42bb){if(_0x5e42bb&&_0x5e42bb['length']){for(var _0x53b1c9=0x0,_0x49bfd5=_0x5e42bb[_0x8c35('0x71')];_0x53b1c9<_0x49bfd5&&_['isNil'](_0x4ce9af[_0x8c35('0x6b')]);_0x53b1c9++){if(_0x22f8e5[_0x8c35('0x6d')]<=_0x5e42bb[_0x53b1c9][_0x8c35('0x72')]){_0x4ce9af[_0x8c35('0x6b')]=_0x5e42bb[_0x53b1c9][_0x8c35('0x72')];}else if(_0x22f8e5[_0x8c35('0x6d')]>_0x5e42bb[_0x53b1c9][_0x8c35('0x72')]&&_0x22f8e5[_0x8c35('0x6d')]<=_0x5e42bb[_0x53b1c9]['to']){_0x4ce9af[_0x8c35('0x6b')]=_0x22f8e5[_0x8c35('0x6d')];}}}if(_[_0x8c35('0x6c')](_0x4ce9af['internal'])){_0x4ce9af['internal']=_0x7466c1+0x1;}return _0x580b39(_0x4ce9af);});});})[_0x8c35('0x1f')](function(_0x6a4d33){_0x56a458(_0x6a4d33);});});}function updateUser(_0x652ad3){return new Promise(function(_0x364a3b,_0x13e742){try{if(_0x652ad3[_0x8c35('0x73')]){_0x652ad3['mailbox']=_0x652ad3[_0x8c35('0x6b')];_0x652ad3['VoiceMail']={'mailbox':_0x652ad3[_0x8c35('0x6b')],'password':_0x652ad3[_0x8c35('0x55')],'fullname':_0x652ad3['fullname'],'email':_0x652ad3['email']};}if(_0x652ad3[_0x8c35('0x2d')]===_0x8c35('0x2a')){if(!_0x652ad3[_0x8c35('0x74')])_0x652ad3[_0x8c35('0x74')]=['101',_0x8c35('0x75'),'103',_0x8c35('0x76'),_0x8c35('0x77'),'104','105','106','107','108',_0x8c35('0x78'),_0x8c35('0x79'),'111',_0x8c35('0x7a'),_0x8c35('0x7b')];}_0x364a3b(_0x652ad3);}catch(_0x442eb6){_0x13e742(_0x442eb6);}});}exports[_0x8c35('0x7c')]=function(_0x3f23bc,_0x375657){if(_0x3f23bc[_0x8c35('0x2e')]['role']===_0x8c35('0x2a'))throw new Error(_0x8c35('0x7d'));if(_0x3f23bc[_0x8c35('0x61')][_0x8c35('0x2d')]===_0x8c35('0x2e')&&_0x3f23bc[_0x8c35('0x2e')][_0x8c35('0x2d')]!==_0x8c35('0x7e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3f23bc[_0x8c35('0x61')][_0x8c35('0x2d')]===_0x8c35('0x7e')&&_0x3f23bc[_0x8c35('0x2e')][_0x8c35('0x2d')]!==_0x8c35('0x7e')){throw new Error(_0x8c35('0x7f'));}return licenseUtil[_0x8c35('0x80')]([_0x3f23bc[_0x8c35('0x61')]])['then'](function(){return validateUser(_0x3f23bc['body']);})[_0x8c35('0x29')](function(_0x4f3425){return updateUser(_0x4f3425)[_0x8c35('0x29')](function(_0x7e3e53){if(_0x7e3e53['role']===_0x8c35('0x7e')){_0x7e3e53[_0x8c35('0x81')]=_0x3f23bc[_0x8c35('0x2e')][_0x8c35('0x81')];delete _0x7e3e53['userProfileId'];}return _0x7e3e53;});})[_0x8c35('0x29')](function(_0xba3a5c){return db[_0x8c35('0x3d')][_0x8c35('0x7c')](_0xba3a5c,{'include':[{'model':db['VoiceMail'],'as':_0x8c35('0x82')}]});})['then'](function(_0xc9077b){if(_0x3f23bc[_0x8c35('0x61')][_0x8c35('0x2d')]==='user')return _0xc9077b;if(_0x3f23bc['user'][_0x8c35('0x2d')]!=='user')return _0xc9077b;return db[_0x8c35('0x83')]['find']({'where':{'name':_0xc9077b[_0x8c35('0x2d')]===_0x8c35('0x2a')?_0x8c35('0x2f'):_0x8c35('0x30'),'userProfileId':_0x3f23bc[_0x8c35('0x2e')][_0x8c35('0x84')]},'raw':!![]})[_0x8c35('0x29')](function(_0x42b36c){if(!_0x42b36c||_0x42b36c[_0x8c35('0x85')]!=0x0)return _0xc9077b;return db[_0x8c35('0x36')]['create']({'name':_0xc9077b[_0x8c35('0x3a')],'resourceId':_0xc9077b['id'],'type':_0x42b36c['name'],'sectionId':_0x42b36c['id']},{})[_0x8c35('0x29')](function(){return _0xc9077b;});})[_0x8c35('0x1f')](function(_0xb36103){logger[_0x8c35('0x1b')](_0x8c35('0x86'),_0xb36103);throw _0xb36103;});})[_0x8c35('0x29')](respondWithResult(_0x375657,0xc9))['catch'](handleError(_0x375657,null));};exports[_0x8c35('0x87')]=function(_0x46bbc5,_0x428407){var _0x11db7e=_0x46bbc5[_0x8c35('0x61')];var _0x4ee9eb=[];if(_0x46bbc5['user'][_0x8c35('0x2d')]===_0x8c35('0x2a'))throw new Error(_0x8c35('0x7d'));if(_[_0x8c35('0x88')](_0x11db7e,[_0x8c35('0x2d'),_0x8c35('0x2e')])&&_0x46bbc5[_0x8c35('0x2e')][_0x8c35('0x2d')]!==_0x8c35('0x7e')){throw new Error(_0x8c35('0x89'));}if(_[_0x8c35('0x88')](_0x11db7e,[_0x8c35('0x2d'),'admin'])&&_0x46bbc5[_0x8c35('0x2e')]['role']!=='admin'){throw new Error(_0x8c35('0x8a'));}return licenseUtil[_0x8c35('0x80')](_0x11db7e)[_0x8c35('0x29')](function(){return validateUser(_0x11db7e[0x0]);})[_0x8c35('0x29')](function(){for(var _0x29c740=0x1;_0x29c740<_0x11db7e[_0x8c35('0x71')];_0x29c740++){var _0x11bedc=_0x11db7e[_0x29c740-0x1][_0x8c35('0x6b')];if(!_0x11db7e[_0x29c740][_0x8c35('0x6b')])_0x11db7e[_0x29c740][_0x8c35('0x6b')]=_0x11bedc+0x1;_0x4ee9eb['push'](validateUser(_0x11db7e[_0x29c740]));}return Promise[_0x8c35('0x50')](_0x4ee9eb);})[_0x8c35('0x29')](function(){_0x4ee9eb=[];for(var _0x1d2682=0x0;_0x1d2682<_0x11db7e[_0x8c35('0x71')];_0x1d2682++){_0x4ee9eb['push'](updateUser(_0x11db7e[_0x1d2682]));}return Promise[_0x8c35('0x50')](_0x4ee9eb);})['then'](function(){_0x4ee9eb=_0x11db7e['map'](function(_0x2efa49){return db[_0x8c35('0x3d')][_0x8c35('0x7c')](_0x2efa49,{'include':[{'model':db[_0x8c35('0x82')],'as':'VoiceMail'}]})[_0x8c35('0x29')](function(_0x582cba){_0x2efa49['id']=_0x582cba['id'];return _0x2efa49;});});return Promise[_0x8c35('0x50')](_0x4ee9eb);})[_0x8c35('0x29')](function(_0x3cde51){if(_0x46bbc5[_0x8c35('0x61')][_0x8c35('0x2d')]===_0x8c35('0x2e'))return _0x3cde51;if(_0x46bbc5[_0x8c35('0x2e')]['role']!==_0x8c35('0x2e'))return _0x3cde51;var _0x4ab9dd=_[_0x8c35('0x88')](_0x3cde51,function(_0x950743){return _0x950743[_0x8c35('0x2d')]==='agent'||_0x950743[_0x8c35('0x2d')]===_0x8c35('0x31');});if(!_0x4ab9dd)return _0x3cde51;return db[_0x8c35('0x83')]['findAll']({'where':{'name':{'$or':[_0x8c35('0x2f'),_0x8c35('0x30')]},'userProfileId':_0x46bbc5[_0x8c35('0x2e')][_0x8c35('0x84')]},'raw':!![]})[_0x8c35('0x29')](function(_0xd7c76){if(_[_0x8c35('0x8b')](_0xd7c76)||!_[_0x8c35('0x88')](_0xd7c76,['autoAssociation',0x0]))return _0x3cde51;_0x4ee9eb=[];var _0xfde0e0=_(_0xd7c76)[_0x8c35('0x33')](function(_0x18a0c8){if(_0x18a0c8[_0x8c35('0x85')]===0x1)return;return _0x18a0c8[_0x8c35('0x3a')]===_0x8c35('0x2f')?_0x8c35('0x2a'):_0x8c35('0x31');})[_0x8c35('0x8c')]()[_0x8c35('0x34')]();for(var _0x424a13=0x0;_0x424a13<_0x3cde51[_0x8c35('0x71')];_0x424a13++){if(!_[_0x8c35('0x35')](_0xfde0e0,_0x3cde51[_0x424a13]['role']))return;var _0x1a2d72=_0x3cde51[_0x424a13][_0x8c35('0x2d')]===_0x8c35('0x2a')?_0x8c35('0x2f'):_0x8c35('0x30');_0x4ee9eb['push'](db['UserProfileResource']['create']({'name':_0x3cde51[_0x424a13][_0x8c35('0x3a')],'resourceId':_0x3cde51[_0x424a13]['id'],'type':_0x1a2d72,'sectionId':_[_0x8c35('0x5b')](_0xd7c76,[_0x8c35('0x3a'),_0x1a2d72])['id']},{}));}return Promise[_0x8c35('0x50')](_0x4ee9eb);});})[_0x8c35('0x29')](respondWithResult(_0x428407,0xc9))[_0x8c35('0x1f')](handleError(_0x428407,null));};exports[_0x8c35('0x8d')]=function(_0x30a172,_0x1544d1){if(_0x30a172[_0x8c35('0x61')]['id']){delete _0x30a172[_0x8c35('0x61')]['id'];}return db[_0x8c35('0x3d')]['find']({'where':{'id':_0x30a172[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](function(_0x84f77d){if(!_0x84f77d)return null;if(_0x84f77d['id']===_0x30a172['user']['id']){if(!_0x30a172[_0x8c35('0x61')]['oldPassword']||!_0x30a172[_0x8c35('0x61')][_0x8c35('0x8e')]){throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))](_0x8c35('0x91'));}if(!_0x84f77d['authenticate'](_0x30a172[_0x8c35('0x61')][_0x8c35('0x92')])){throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))](_0x8c35('0x93'));}if(_0x30a172['body'][_0x8c35('0x92')]===_0x30a172[_0x8c35('0x61')][_0x8c35('0x8e')]){throw new db[(_0x8c35('0x8f'))]['ValidationError'](_0x8c35('0x94'));}}else if(_0x30a172['user'][_0x8c35('0x2d')]==='admin'){if(!_0x30a172[_0x8c35('0x61')]['newPassword']){throw new db[(_0x8c35('0x8f'))]['ValidationError'](_0x8c35('0x95'));}}else if(_0x30a172[_0x8c35('0x2e')]['role']===_0x8c35('0x2e')){if(!_0x30a172[_0x8c35('0x61')][_0x8c35('0x8e')]){throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))](_0x8c35('0x95'));}if(_0x84f77d[_0x8c35('0x2d')]!==_0x8c35('0x2a')){throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))](_0x8c35('0x7d'));}}else{throw new db['Sequelize'][(_0x8c35('0x90'))](_0x8c35('0x7d'));}return _0x84f77d;})['then'](handleEntityNotFound(_0x1544d1,null))[_0x8c35('0x29')](function(_0x203839){return db[_0x8c35('0x66')][_0x8c35('0x96')]({'attributes':['id','securePassword',_0x8c35('0x97'),_0x8c35('0x98')]})[_0x8c35('0x29')](function(_0x21fba7){if(_0x21fba7['securePassword'])authService[_0x8c35('0x69')](_0x30a172[_0x8c35('0x61')][_0x8c35('0x8e')]);if(!_0x21fba7[_0x8c35('0x97')]||!_0x203839[_0x8c35('0x99')])return _0x203839;authService[_0x8c35('0x9a')](_0x30a172[_0x8c35('0x61')]['newPassword'],_0x203839[_0x8c35('0x99')],_0x21fba7['passwordHistoryLimit']);return _0x203839;})[_0x8c35('0x29')](saveUpdates({'password':_0x30a172[_0x8c35('0x61')][_0x8c35('0x8e')],'passwordResetAt':_0x30a172[_0x8c35('0x2e')]['id']==_0x30a172['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x30a172['body'][_0x8c35('0x8e')],_0x203839[_0x8c35('0x99')])},null));})[_0x8c35('0x29')](respondWithResult(_0x1544d1,null))[_0x8c35('0x1f')](handleError(_0x1544d1,null));};exports[_0x8c35('0x9b')]=function(_0x9165d1,_0x5a1563){var _0x3129c6=_0x9165d1[_0x8c35('0x61')][_0x8c35('0x9c')];return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0x9165d1['params']['id']},'attributes':['id','name',_0x8c35('0x2d'),_0x8c35('0x9d'),_0x8c35('0x9e'),_0x8c35('0x9f'),_0x8c35('0xa0')]})['then'](handleEntityNotFound(_0x5a1563,null))[_0x8c35('0x29')](function(_0x4bafad){if(_0x4bafad){if(!utils[_0x8c35('0xa1')](_0x3129c6)){throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))]('Unknown\x20channel');}return _0x4bafad[_0x8c35('0xa2')+_[_0x8c35('0xa3')](_0x3129c6[_0x8c35('0xa4')]())+_0x8c35('0xa5')](_0x9165d1[_0x8c35('0x61')]['ids'],{'penalty':_0x9165d1[_0x8c35('0x61')]['penalty']||0x0})[_0x8c35('0xa6')](function(_0x66d8f3){for(var _0x9b4e2c=0x0;_0x9b4e2c<_0x9165d1[_0x8c35('0x61')][_0x8c35('0x64')]['length'];_0x9b4e2c+=0x1){var _0x1506d6={'UserId':Number(_0x9165d1[_0x8c35('0x52')]['id'])};_0x1506d6[_['capitalize'](_0x3129c6[_0x8c35('0xa4')]())+_0x8c35('0xa7')]=Number(_0x9165d1['body']['ids'][_0x9b4e2c]);socket['emit']('user'+_['capitalize'](_0x3129c6[_0x8c35('0xa4')]())+'Queue:save',_0x1506d6);}return _0x66d8f3;})['then'](function(){if(_0x3129c6===_0x8c35('0xa8')){return db[_0x8c35('0xa9')][_0x8c35('0x4a')]({'where':{'id':_0x9165d1[_0x8c35('0x61')][_0x8c35('0x64')]||[]},'raw':!![],'attributes':['id',_0x8c35('0x3a')]});}})['then'](function(_0xbdf917){var _0x36a8bc=_0x4bafad['get']({'plain':!![]});var _0x2522d1=[];if(_0x3129c6===_0x8c35('0xa8')&&_0x36a8bc[_0x8c35('0x2d')]===_0x8c35('0x2a')&&_0x36a8bc[_0x8c35('0x9d')]){for(let _0x31aef0=0x0;_0x31aef0<_0xbdf917['length'];_0x31aef0+=0x1){_0x2522d1[_0x8c35('0x49')]({'membername':_0x36a8bc[_0x8c35('0x3a')],'UserId':_0x36a8bc['id'],'queue_name':_0xbdf917[_0x31aef0][_0x8c35('0x3a')],'VoiceQueueId':_0xbdf917[_0x31aef0]['id'],'interface':_[_0x8c35('0x6c')](_0x36a8bc['interface'])?util[_0x8c35('0xaa')](_0x8c35('0xab'),_0x36a8bc['name']):_0x36a8bc['interface'],'paused':_0x36a8bc[_0x8c35('0x9f')]||![],'penalty':_0x9165d1['body'][_0x8c35('0xac')]||0x0});}return Promise[_0x8c35('0x50')](_0x2522d1[_0x8c35('0x33')](function(_0x3d955a){return db['UserVoiceQueueRt'][_0x8c35('0xad')](_0x3d955a);}));}return _0x4bafad;});}})[_0x8c35('0x29')](respondWithStatusCode(_0x5a1563,null))[_0x8c35('0x1f')](handleError(_0x5a1563,null));};exports[_0x8c35('0xae')]=function(_0x59b7d4,_0x5a0667){var _0x5c24e3,_0x32e63c;return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0x59b7d4[_0x8c35('0x52')]['id']},'attributes':['id',_0x8c35('0x3a'),_0x8c35('0x2d')]})['then'](handleEntityNotFound(_0x5a0667,null))[_0x8c35('0x29')](function(_0x158f7f){if(_0x158f7f){_0x5c24e3=_0x158f7f;if(!_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x9c')]||!utils['isValidChannel'](_0x59b7d4[_0x8c35('0x44')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x158f7f[_0x8c35('0xaf')+_[_0x8c35('0xa3')](_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x9c')][_0x8c35('0xa4')]())+_0x8c35('0xa5')](_0x59b7d4['query']['ids']);}})[_0x8c35('0x29')](function(_0x250932){if(_[_0x8c35('0xb0')](_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x64')])){for(var _0x171dd0=0x0;_0x171dd0<_0x59b7d4['query'][_0x8c35('0x64')][_0x8c35('0x71')];_0x171dd0+=0x1){_0x32e63c={'UserId':Number(_0x59b7d4['params']['id'])};_0x32e63c[_[_0x8c35('0xa3')](_0x59b7d4['query'][_0x8c35('0x9c')][_0x8c35('0xa4')]())+_0x8c35('0xa7')]=Number(_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x64')][_0x171dd0]);socket[_0x8c35('0x2b')](_0x8c35('0x2e')+_[_0x8c35('0xa3')](_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x9c')][_0x8c35('0xa4')]())+_0x8c35('0xb1'),_0x32e63c);}}else{_0x32e63c={'UserId':Number(_0x59b7d4['params']['id'])};_0x32e63c[_[_0x8c35('0xa3')](_0x59b7d4['query'][_0x8c35('0x9c')][_0x8c35('0xa4')]())+_0x8c35('0xa7')]=Number(_0x59b7d4['query']['ids']);socket[_0x8c35('0x2b')](_0x8c35('0x2e')+_[_0x8c35('0xa3')](_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x9c')]['toLowerCase']())+_0x8c35('0xb1'),_0x32e63c);}return _0x250932;})['then'](function(){if(_0x59b7d4[_0x8c35('0x44')][_0x8c35('0x9c')]==='voice'){return db[_0x8c35('0xb2')][_0x8c35('0x37')]({'where':{'UserId':_0x59b7d4['params']['id'],'VoiceQueueId':_0x59b7d4['query'][_0x8c35('0x64')]},'individualHooks':!![]})[_0x8c35('0x29')](function(){return _0x5c24e3;});}return _0x5c24e3;})['then'](respondWithStatusCode(_0x5a0667,null))[_0x8c35('0x1f')](handleError(_0x5a0667,null));};exports[_0x8c35('0xb3')]=function(_0x432f26,_0x5399fa){_0x432f26['body'][_0x8c35('0xb4')]=_0x432f26[_0x8c35('0xb5')][_0x8c35('0xb6')];return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0x432f26[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x5399fa,null))['then'](saveUpdates(_0x432f26[_0x8c35('0x61')],null))['then'](respondWithResult(_0x5399fa,null))['catch'](handleError(_0x5399fa,null));};exports[_0x8c35('0xb7')]=function(_0x3cfda8,_0x1fbddc){var _0x3fee96=path['join'](config[_0x8c35('0xb8')],_0x8c35('0xb9'));return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0x3cfda8[_0x8c35('0x52')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x8c35('0x29')](handleEntityNotFound(_0x1fbddc,null))[_0x8c35('0x29')](function(_0x25d90c){if(_0x25d90c){if(_[_0x8c35('0x6c')](_0x25d90c[_0x8c35('0xb4')])){return _0x1fbddc['download'](_0x3fee96);}else{if(!fs[_0x8c35('0xba')](path[_0x8c35('0xbb')](config['root'],_0x8c35('0xbc'),_0x25d90c[_0x8c35('0xb4')]))){return _0x1fbddc[_0x8c35('0xbd')](_0x3fee96);}return _0x1fbddc[_0x8c35('0xbd')](path['join'](config[_0x8c35('0xb8')],_0x8c35('0xbc'),_0x25d90c[_0x8c35('0xb4')]));}}})['catch'](handleError(_0x1fbddc,null));};exports['getOpenTabs']=function(_0xc13b6,_0x504534){return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0xc13b6['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x504534,null))[_0x8c35('0x29')](function(_0x49c144){var _0x37b92f=[];values=_0x49c144['dataValues'];_0x37b92f[_0x8c35('0x49')](get_open_tabs('chat',_0x49c144['dataValues']));_0x37b92f[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x5d'),_0x49c144['dataValues']));_0x37b92f[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x5e'),_0x49c144['dataValues']));_0x37b92f[_0x8c35('0x49')](get_open_tabs(_0x8c35('0x5f'),_0x49c144['dataValues']));_0x37b92f[_0x8c35('0x49')](get_open_tabs('fax',_0x49c144[_0x8c35('0x4e')]));_0x37b92f[_0x8c35('0x49')](get_open_tabs('mail',_0x49c144['dataValues']));return Promise[_0x8c35('0x50')](_0x37b92f);})[_0x8c35('0x29')](function(_0x4a6eb1){if(_0x4a6eb1){var _0x20df40=_['map'](values[_0x8c35('0xbe')],function(_0x307b29){return{'channel':_0x8c35('0xbf'),'id':_0x307b29['id'],'createdAt':_0x307b29[_0x8c35('0xc0')]};});var _0x49ae48=_[_0x8c35('0x33')](values[_0x8c35('0xc1')],function(_0x110043){return{'channel':'FAX','id':_0x110043['id'],'createdAt':_0x110043[_0x8c35('0xc0')]};});var _0x479356=_['map'](values[_0x8c35('0xc2')],function(_0x45e732){return{'channel':_0x8c35('0xc3'),'id':_0x45e732['id'],'createdAt':_0x45e732['createdAt']};});var _0x20b078=_['map'](values[_0x8c35('0xc4')],function(_0x25c385){return{'channel':_0x8c35('0xc5'),'id':_0x25c385['id'],'createdAt':_0x25c385[_0x8c35('0xc0')]};});var _0x3e4186=_[_0x8c35('0x33')](values['SmsOpenTabs'],function(_0x535c86){return{'channel':'SMS','id':_0x535c86['id'],'createdAt':_0x535c86[_0x8c35('0xc0')]};});var _0x4e6fb4=_[_0x8c35('0x33')](values['WhatsappOpenTabs'],function(_0x133874){return{'channel':_0x8c35('0xc6'),'id':_0x133874['id'],'createdAt':_0x133874[_0x8c35('0xc0')]};});var _0x123a35=_['concat'](_0x20df40,_0x49ae48,_0x479356,_0x20b078,_0x3e4186,_0x4e6fb4);var _0x52948e={'count':_0x123a35[_0x8c35('0x71')],'rows':_0x123a35};return _0x52948e;}else return null;})['then'](respondWithResult(_0x504534,null))[_0x8c35('0x1f')](handleError(_0x504534,null));};exports['getContacts']=function(_0x3505fb,_0x241bb0){var _0xb3d8c0={};var _0x25db3d={};var _0x35a7df;var _0x361bd7;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x3505fb[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x241bb0,null))[_0x8c35('0x29')](function(_0x1a0ac2){if(_0x1a0ac2){_0x35a7df=_0x1a0ac2;_0x25db3d[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xc7')][_0x8c35('0x3e')]);_0x25db3d['query']=_[_0x8c35('0x54')](_0x3505fb['query']);_0x25db3d[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x25db3d['model'],_0x25db3d[_0x8c35('0x44')]);_0xb3d8c0[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x25db3d['model'],qs[_0x8c35('0x58')](_0x3505fb['query'][_0x8c35('0x58')]));_0xb3d8c0[_0x8c35('0x48')]=_0xb3d8c0[_0x8c35('0x48')][_0x8c35('0x71')]?_0xb3d8c0[_0x8c35('0x48')]:_0x25db3d['model'];_0xb3d8c0[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x3505fb['query']['sort']);_0xb3d8c0[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x3505fb[_0x8c35('0x44')],_0x25db3d[_0x8c35('0x56')]));if(_0x3505fb[_0x8c35('0x44')]['filter']){_0xb3d8c0[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0xb3d8c0[_0x8c35('0x43')],{'$or':_['map'](_0xb3d8c0[_0x8c35('0x48')],function(_0x573356){var _0x117033={};_0x117033[_0x573356]={'$like':'%'+_0x3505fb[_0x8c35('0x44')]['filter']+'%'};return _0x117033;})});}_0xb3d8c0=_[_0x8c35('0xcb')]({},_0xb3d8c0,_0x3505fb[_0x8c35('0x5a')]);return _0x35a7df['getContacts'](_0xb3d8c0);}})['then'](function(_0x21c3c3){if(_0x21c3c3){_0x361bd7=_0x21c3c3['length'];if(_0x3505fb[_0x8c35('0x44')][_0x8c35('0xcc')](_0x8c35('0x45'))){_0xb3d8c0['include']=[{'model':db[_0x8c35('0xcd')],'as':'List','required':![]},{'model':db[_0x8c35('0xce')],'as':_0x8c35('0xcf'),'attributes':['id',_0x8c35('0x3a'),'color'],'where':_0x3505fb[_0x8c35('0x44')]['tag']?{'id':_0x3505fb[_0x8c35('0x44')][_0x8c35('0xd0')]}:undefined,'required':_0x3505fb['query']['tag']?!![]:![]}];}if(!_0x3505fb[_0x8c35('0x44')]['hasOwnProperty']('nolimit')){_0xb3d8c0['limit']=qs[_0x8c35('0x23')](_0x3505fb[_0x8c35('0x44')][_0x8c35('0x23')]);_0xb3d8c0[_0x8c35('0x22')]=qs['offset'](_0x3505fb['query'][_0x8c35('0x22')]);}return _0x35a7df[_0x8c35('0xd1')](_0xb3d8c0);}})['then'](function(_0x122f75){if(_0x122f75){return _0x122f75?{'count':_0x361bd7,'rows':_0x122f75}:null;}})['then'](respondWithResult(_0x241bb0,null))[_0x8c35('0x1f')](handleError(_0x241bb0,null));};exports[_0x8c35('0xd2')]=function(_0x4b272a,_0x1ef3e9){var _0x18afe0;var _0xbbddc5={};var _0x3934e2;return db[_0x8c35('0x3d')]['findOne']({'where':{'id':_0x4b272a['params']['id']},'attributes':['id',_0x8c35('0x3a'),_0x8c35('0x2d')]})['then'](handleEntityNotFound(_0x1ef3e9,null))[_0x8c35('0x29')](function(_0x172565){if(!utils[_0x8c35('0xa1')](_0x4b272a[_0x8c35('0x44')][_0x8c35('0x9c')])){throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))]('Unknown\x20channel');}_0x18afe0=_0x172565;var _0xa7b682={};_0xa7b682[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_[_0x8c35('0xa3')](_0x4b272a['query'][_0x8c35('0x9c')])+_0x8c35('0xd3')][_0x8c35('0x3e')]);_0xa7b682['query']=_[_0x8c35('0x54')](_0x4b272a['query']);_0xa7b682['filters']=_['intersection'](_0xa7b682[_0x8c35('0x53')],_0xa7b682['query']);_0xbbddc5[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0xa7b682[_0x8c35('0x53')],qs['fields'](_0x4b272a[_0x8c35('0x44')][_0x8c35('0x58')]));_0xbbddc5['attributes']=_0xbbddc5['attributes'][_0x8c35('0x71')]?_0xbbddc5['attributes']:_0xa7b682[_0x8c35('0x53')];_0xbbddc5[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x4b272a[_0x8c35('0x44')]['sort']);_0xbbddc5['where']=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x4b272a[_0x8c35('0x44')],_0xa7b682[_0x8c35('0x56')]));if(_0x4b272a[_0x8c35('0x44')]['filter']){_0xbbddc5[_0x8c35('0x43')]=_['merge'](_0xbbddc5[_0x8c35('0x43')],{'$or':_['map'](_0xbbddc5[_0x8c35('0x48')],function(_0x16f078){var _0x101d8f={};_0x101d8f[_0x16f078]={'$like':'%'+_0x4b272a[_0x8c35('0x44')]['filter']+'%'};return _0x101d8f;})});}_0xbbddc5=_[_0x8c35('0xcb')]({},_0xbbddc5,_0x4b272a['options']);switch(_0x18afe0[_0x8c35('0x2d')]){case'admin':return db[_[_0x8c35('0xa3')](_0x4b272a['query'][_0x8c35('0x9c')])+'Queue'][_0x8c35('0x4a')](_0xbbddc5);case _0x8c35('0x2e'):case _0x8c35('0x2a'):return _0x18afe0[_0x8c35('0x2c')+_[_0x8c35('0xa3')](_0x4b272a[_0x8c35('0x44')][_0x8c35('0x9c')])+_0x8c35('0xa5')](_0xbbddc5);default:throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))](_0x8c35('0xd4'));}})[_0x8c35('0x29')](function(_0x1282df){_0x3934e2=_0x1282df[_0x8c35('0x71')];if(!_0x4b272a['query']['hasOwnProperty'](_0x8c35('0xd5'))){_0xbbddc5[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x4b272a[_0x8c35('0x44')]['limit']);_0xbbddc5[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x4b272a[_0x8c35('0x44')][_0x8c35('0x22')]);}switch(_0x18afe0[_0x8c35('0x2d')]){case _0x8c35('0x7e'):return db[_[_0x8c35('0xa3')](_0x4b272a[_0x8c35('0x44')]['channel'])+_0x8c35('0xd3')][_0x8c35('0x4a')](_0xbbddc5);case _0x8c35('0x2e'):case _0x8c35('0x2a'):return _0x18afe0[_0x8c35('0x2c')+_[_0x8c35('0xa3')](_0x4b272a[_0x8c35('0x44')]['channel'])+_0x8c35('0xa5')](_0xbbddc5);}})[_0x8c35('0x29')](function(_0x1a5d02){return{'count':_0x3934e2,'rows':_0x1a5d02};})[_0x8c35('0x29')](respondWithResult(_0x1ef3e9,null))[_0x8c35('0x1f')](handleError(_0x1ef3e9,null));};exports['getVoiceQueuesRt']=function(_0x30f5d7,_0x59b7dc){var _0x3dccc7={};var _0x304b6b={};var _0x97d16b;var _0x52366a;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x30f5d7[_0x8c35('0x52')]['id']}})['then'](handleEntityNotFound(_0x59b7dc,null))[_0x8c35('0x29')](function(_0x1080d8){if(_0x1080d8){_0x97d16b=_0x1080d8;_0x304b6b[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xb2')][_0x8c35('0x3e')]);_0x304b6b['query']=_[_0x8c35('0x54')](_0x30f5d7[_0x8c35('0x44')]);_0x304b6b[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x304b6b['model'],_0x304b6b['query']);_0x3dccc7[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x304b6b[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x30f5d7[_0x8c35('0x44')][_0x8c35('0x58')]));_0x3dccc7[_0x8c35('0x48')]=_0x3dccc7[_0x8c35('0x48')][_0x8c35('0x71')]?_0x3dccc7['attributes']:_0x304b6b['model'];_0x3dccc7['order']=qs['sort'](_0x30f5d7[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x3dccc7[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_['pick'](_0x30f5d7[_0x8c35('0x44')],_0x304b6b['filters']));if(_0x30f5d7['query'][_0x8c35('0xd6')]){_0x3dccc7['where']=_['merge'](_0x3dccc7[_0x8c35('0x43')],{'$or':_['map'](_0x3dccc7[_0x8c35('0x48')],function(_0x13d942){var _0x109f4c={};_0x109f4c[_0x13d942]={'$like':'%'+_0x30f5d7['query'][_0x8c35('0xd6')]+'%'};return _0x109f4c;})});}_0x3dccc7=_['merge']({},_0x3dccc7,_0x30f5d7['options']);return _0x97d16b[_0x8c35('0xd7')](_0x3dccc7);}})[_0x8c35('0x29')](function(_0x451366){if(_0x451366){_0x52366a=_0x451366[_0x8c35('0x71')];if(!_0x30f5d7[_0x8c35('0x44')][_0x8c35('0xcc')](_0x8c35('0xd5'))){_0x3dccc7[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x30f5d7[_0x8c35('0x44')][_0x8c35('0x23')]);_0x3dccc7['offset']=qs[_0x8c35('0x22')](_0x30f5d7[_0x8c35('0x44')][_0x8c35('0x22')]);}return _0x97d16b['getVoiceQueuesRt'](_0x3dccc7);}})[_0x8c35('0x29')](function(_0x57f35f){if(_0x57f35f){return _0x57f35f?{'count':_0x52366a,'rows':_0x57f35f}:null;}})[_0x8c35('0x29')](respondWithResult(_0x59b7dc,null))[_0x8c35('0x1f')](handleError(_0x59b7dc,null));};exports['getGroups']=function(_0x34d613,_0x503a16){var _0x5c1678={};var _0x14c7f4={};var _0x28b008;var _0x458fdc;return db['User'][_0x8c35('0x96')]({'where':{'id':_0x34d613[_0x8c35('0x52')]['id']}})['then'](handleEntityNotFound(_0x503a16,null))[_0x8c35('0x29')](function(_0x95fa8){if(_0x95fa8){_0x28b008=_0x95fa8;_0x14c7f4[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xd8')][_0x8c35('0x3e')]);_0x14c7f4['query']=_['keys'](_0x34d613['query']);_0x14c7f4[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x14c7f4['model'],_0x14c7f4['query']);_0x5c1678[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x14c7f4[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x34d613['query'][_0x8c35('0x58')]));_0x5c1678[_0x8c35('0x48')]=_0x5c1678['attributes'][_0x8c35('0x71')]?_0x5c1678['attributes']:_0x14c7f4['model'];_0x5c1678['order']=qs[_0x8c35('0xc9')](_0x34d613['query'][_0x8c35('0xc9')]);_0x5c1678[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x34d613['query'],_0x14c7f4[_0x8c35('0x56')]));if(_0x34d613[_0x8c35('0x44')][_0x8c35('0xd6')]){_0x5c1678[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0x5c1678[_0x8c35('0x43')],{'$or':_[_0x8c35('0x33')](_0x5c1678[_0x8c35('0x48')],function(_0x36c834){var _0x243545={};_0x243545[_0x36c834]={'$like':'%'+_0x34d613[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x243545;})});}_0x5c1678=_[_0x8c35('0xcb')]({},_0x5c1678,_0x34d613['options']);return _0x28b008['getGroups'](_0x5c1678);}})[_0x8c35('0x29')](function(_0x3b312a){if(_0x3b312a){_0x458fdc=_0x3b312a[_0x8c35('0x71')];if(!_0x34d613[_0x8c35('0x44')]['hasOwnProperty'](_0x8c35('0xd5'))){_0x5c1678['limit']=qs[_0x8c35('0x23')](_0x34d613[_0x8c35('0x44')][_0x8c35('0x23')]);_0x5c1678['offset']=qs[_0x8c35('0x22')](_0x34d613['query']['offset']);}return _0x28b008['getGroups'](_0x5c1678);}})[_0x8c35('0x29')](function(_0x3947e3){if(_0x3947e3){return _0x3947e3?{'count':_0x458fdc,'rows':_0x3947e3}:null;}})[_0x8c35('0x29')](respondWithResult(_0x503a16,null))[_0x8c35('0x1f')](handleError(_0x503a16,null));};exports[_0x8c35('0xd9')]=function(_0x29dea9,_0x9db7d1){var _0xf62881={'raw':!![],'where':{}};var _0x49eb07={};var _0x5e0911={'count':0x0,'rows':[]};return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x29dea9['params']['id']}})['then'](handleEntityNotFound(_0x9db7d1,null))[_0x8c35('0x29')](function(_0x35fd95){if(_0x35fd95){_0x49eb07[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xda')]['rawAttributes']);_0x49eb07[_0x8c35('0x44')]=_['keys'](_0x29dea9[_0x8c35('0x44')]);_0x49eb07[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x49eb07[_0x8c35('0x53')],_0x49eb07['query']);_0xf62881['attributes']=_[_0x8c35('0x57')](_0x49eb07[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x29dea9['query'][_0x8c35('0x58')]));_0xf62881[_0x8c35('0x48')]=_0xf62881[_0x8c35('0x48')]['length']?_0xf62881[_0x8c35('0x48')]:_0x49eb07[_0x8c35('0x53')];if(!_0x29dea9['query'][_0x8c35('0xcc')](_0x8c35('0xd5'))){_0xf62881[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x29dea9['query'][_0x8c35('0x23')]);_0xf62881[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x29dea9[_0x8c35('0x44')][_0x8c35('0x22')]);}_0xf62881[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x29dea9[_0x8c35('0x44')][_0x8c35('0xc9')]);_0xf62881[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x29dea9['query'],_0x49eb07['filters']));_0xf62881[_0x8c35('0x43')][_0x8c35('0xdb')]=_0x35fd95['id'];if(_0x29dea9[_0x8c35('0x44')][_0x8c35('0xd6')]){_0xf62881[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0xf62881[_0x8c35('0x43')],{'$or':_[_0x8c35('0x33')](_0xf62881[_0x8c35('0x48')],function(_0x147fee){var _0x443fb4={};_0x443fb4[_0x147fee]={'$like':'%'+_0x29dea9[_0x8c35('0x44')]['filter']+'%'};return _0x443fb4;})});}_0xf62881=_['merge']({},_0xf62881,_0x29dea9[_0x8c35('0x5a')]);return db['VoiceRecording'][_0x8c35('0x25')]({'where':_0xf62881[_0x8c35('0x43')]})[_0x8c35('0x29')](function(_0x53f5ca){_0x5e0911[_0x8c35('0x25')]=_0x53f5ca;if(_0x29dea9[_0x8c35('0x44')][_0x8c35('0x45')]){_0xf62881[_0x8c35('0x46')]=[{'all':!![]}];}return db[_0x8c35('0xda')][_0x8c35('0x4a')](_0xf62881);})['then'](function(_0x2f3b53){_0x5e0911[_0x8c35('0x4b')]=_0x2f3b53;return _0x5e0911;});}})[_0x8c35('0x29')](respondWithFilteredResult(_0x9db7d1,_0xf62881))[_0x8c35('0x1f')](handleError(_0x9db7d1,null));};exports[_0x8c35('0xdc')]=function(_0x37eb9f,_0x590bfe){var _0x2bf725={'raw':!![],'where':{}};var _0x528822={};var _0x37f618={'count':0x0,'rows':[]};return db['User'][_0x8c35('0x96')]({'where':{'id':_0x37eb9f[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x590bfe,null))[_0x8c35('0x29')](function(_0x24cd65){if(_0x24cd65){_0x528822['model']=_['keys'](db[_0x8c35('0xdd')]['rawAttributes']);_0x528822[_0x8c35('0x44')]=_['keys'](_0x37eb9f[_0x8c35('0x44')]);_0x528822['filters']=_[_0x8c35('0x57')](_0x528822[_0x8c35('0x53')],_0x528822['query']);_0x2bf725[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x528822[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x37eb9f[_0x8c35('0x44')][_0x8c35('0x58')]));_0x2bf725[_0x8c35('0x48')]=_0x2bf725[_0x8c35('0x48')]['length']?_0x2bf725['attributes']:_0x528822[_0x8c35('0x53')];if(!_0x37eb9f[_0x8c35('0x44')][_0x8c35('0xcc')](_0x8c35('0xd5'))){_0x2bf725[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x37eb9f[_0x8c35('0x44')]['limit']);_0x2bf725[_0x8c35('0x22')]=qs['offset'](_0x37eb9f[_0x8c35('0x44')][_0x8c35('0x22')]);}_0x2bf725['order']=qs['sort'](_0x37eb9f[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x2bf725[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_['pick'](_0x37eb9f[_0x8c35('0x44')],_0x528822[_0x8c35('0x56')]));_0x2bf725[_0x8c35('0x43')]['UserId']=_0x24cd65['id'];if(_0x37eb9f[_0x8c35('0x44')]['filter']){_0x2bf725[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0x2bf725[_0x8c35('0x43')],{'$or':_['map'](_0x2bf725[_0x8c35('0x48')],function(_0x31b90d){var _0x1fb1a1={};_0x1fb1a1[_0x31b90d]={'$like':'%'+_0x37eb9f[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x1fb1a1;})});}_0x2bf725=_[_0x8c35('0xcb')]({},_0x2bf725,_0x37eb9f[_0x8c35('0x5a')]);return db[_0x8c35('0xdd')][_0x8c35('0x25')]({'where':_0x2bf725[_0x8c35('0x43')]})[_0x8c35('0x29')](function(_0xd17a6){_0x37f618[_0x8c35('0x25')]=_0xd17a6;if(_0x37eb9f[_0x8c35('0x44')]['includeAll']){_0x2bf725[_0x8c35('0x46')]=[{'all':!![]}];}return db[_0x8c35('0xdd')][_0x8c35('0x4a')](_0x2bf725);})[_0x8c35('0x29')](function(_0x332ae7){_0x37f618[_0x8c35('0x4b')]=_0x332ae7;return _0x37f618;});}})[_0x8c35('0x29')](respondWithFilteredResult(_0x590bfe,_0x2bf725))[_0x8c35('0x1f')](handleError(_0x590bfe,null));};exports[_0x8c35('0xde')]=function(_0x4a28a5,_0x57b823){var _0x1f0060={};var _0x40cd88={};var _0x4e9b1e;var _0x44b908;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x4a28a5['params']['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x57b823,null))[_0x8c35('0x29')](function(_0x93daa3){if(_0x93daa3){_0x4e9b1e=_0x93daa3;_0x40cd88[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xdf')][_0x8c35('0x3e')]);_0x40cd88['query']=_[_0x8c35('0x54')](_0x4a28a5[_0x8c35('0x44')]);_0x40cd88[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x40cd88[_0x8c35('0x53')],_0x40cd88[_0x8c35('0x44')]);_0x1f0060[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x40cd88[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x4a28a5['query'][_0x8c35('0x58')]));_0x1f0060[_0x8c35('0x48')]=_0x1f0060[_0x8c35('0x48')][_0x8c35('0x71')]?_0x1f0060[_0x8c35('0x48')]:_0x40cd88[_0x8c35('0x53')];_0x1f0060[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x4a28a5['query'][_0x8c35('0xc9')]);_0x1f0060[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x4a28a5[_0x8c35('0x44')],_0x40cd88['filters']));if(_0x4a28a5[_0x8c35('0x44')][_0x8c35('0xd6')]){_0x1f0060[_0x8c35('0x43')]=_['merge'](_0x1f0060[_0x8c35('0x43')],{'$or':_[_0x8c35('0x33')](_0x1f0060[_0x8c35('0x48')],function(_0x1ab0a2){var _0x4781ae={};_0x4781ae[_0x1ab0a2]={'$like':'%'+_0x4a28a5[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x4781ae;})});}_0x1f0060=_[_0x8c35('0xcb')]({},_0x1f0060,_0x4a28a5[_0x8c35('0x5a')]);return _0x4e9b1e[_0x8c35('0xde')](_0x1f0060);}})[_0x8c35('0x29')](function(_0x394196){if(_0x394196){_0x44b908=_0x394196['length'];if(!_0x4a28a5[_0x8c35('0x44')][_0x8c35('0xcc')]('nolimit')){_0x1f0060[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x4a28a5[_0x8c35('0x44')][_0x8c35('0x23')]);_0x1f0060[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x4a28a5[_0x8c35('0x44')]['offset']);}return _0x4e9b1e['getChatInteractions'](_0x1f0060);}})[_0x8c35('0x29')](function(_0x363ed3){if(_0x363ed3){return _0x363ed3?{'count':_0x44b908,'rows':_0x363ed3}:null;}})[_0x8c35('0x29')](respondWithResult(_0x57b823,null))[_0x8c35('0x1f')](handleError(_0x57b823,null));};exports['getOpenchannelInteractions']=function(_0x19e662,_0x2a65b8){var _0x1c326f={};var _0x55d634={};var _0x43d651;var _0x1e90f3;return db[_0x8c35('0x3d')]['findOne']({'where':{'id':_0x19e662['params']['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x2a65b8,null))['then'](function(_0x3f0178){if(_0x3f0178){_0x43d651=_0x3f0178;_0x55d634[_0x8c35('0x53')]=_[_0x8c35('0x54')](db['OpenchannelInteraction'][_0x8c35('0x3e')]);_0x55d634[_0x8c35('0x44')]=_[_0x8c35('0x54')](_0x19e662[_0x8c35('0x44')]);_0x55d634['filters']=_[_0x8c35('0x57')](_0x55d634[_0x8c35('0x53')],_0x55d634['query']);_0x1c326f[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x55d634[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x19e662[_0x8c35('0x44')][_0x8c35('0x58')]));_0x1c326f[_0x8c35('0x48')]=_0x1c326f[_0x8c35('0x48')][_0x8c35('0x71')]?_0x1c326f[_0x8c35('0x48')]:_0x55d634[_0x8c35('0x53')];_0x1c326f[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x19e662[_0x8c35('0x44')]['sort']);_0x1c326f[_0x8c35('0x43')]=qs['filters'](_[_0x8c35('0xca')](_0x19e662[_0x8c35('0x44')],_0x55d634[_0x8c35('0x56')]));if(_0x19e662[_0x8c35('0x44')][_0x8c35('0xd6')]){_0x1c326f[_0x8c35('0x43')]=_['merge'](_0x1c326f['where'],{'$or':_[_0x8c35('0x33')](_0x1c326f['attributes'],function(_0x5caff4){var _0x120e9f={};_0x120e9f[_0x5caff4]={'$like':'%'+_0x19e662['query'][_0x8c35('0xd6')]+'%'};return _0x120e9f;})});}_0x1c326f=_[_0x8c35('0xcb')]({},_0x1c326f,_0x19e662[_0x8c35('0x5a')]);return _0x43d651['getOpenchannelInteractions'](_0x1c326f);}})[_0x8c35('0x29')](function(_0x4691b6){if(_0x4691b6){_0x1e90f3=_0x4691b6['length'];if(!_0x19e662['query'][_0x8c35('0xcc')](_0x8c35('0xd5'))){_0x1c326f[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x19e662[_0x8c35('0x44')][_0x8c35('0x23')]);_0x1c326f[_0x8c35('0x22')]=qs['offset'](_0x19e662[_0x8c35('0x44')][_0x8c35('0x22')]);}return _0x43d651[_0x8c35('0xe0')](_0x1c326f);}})['then'](function(_0x30f44e){if(_0x30f44e){return _0x30f44e?{'count':_0x1e90f3,'rows':_0x30f44e}:null;}})[_0x8c35('0x29')](respondWithResult(_0x2a65b8,null))['catch'](handleError(_0x2a65b8,null));};exports[_0x8c35('0xe1')]=function(_0x962d0a,_0xbd561c){var _0x27014a={'raw':!![],'where':{}};var _0x302486={};var _0x6e4e5e={'count':0x0,'rows':[]};return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x962d0a['params']['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0xbd561c,null))[_0x8c35('0x29')](function(_0x43db96){if(_0x43db96){_0x302486['model']=_[_0x8c35('0x54')](db[_0x8c35('0xe2')][_0x8c35('0x3e')]);_0x302486[_0x8c35('0x44')]=_[_0x8c35('0x54')](_0x962d0a[_0x8c35('0x44')]);_0x302486['filters']=_[_0x8c35('0x57')](_0x302486[_0x8c35('0x53')],_0x302486[_0x8c35('0x44')]);_0x27014a[_0x8c35('0x48')]=_['intersection'](_0x302486[_0x8c35('0x53')],qs['fields'](_0x962d0a[_0x8c35('0x44')][_0x8c35('0x58')]));_0x27014a[_0x8c35('0x48')]=_0x27014a[_0x8c35('0x48')][_0x8c35('0x71')]?_0x27014a['attributes']:_0x302486['model'];if(!_0x962d0a[_0x8c35('0x44')][_0x8c35('0xcc')](_0x8c35('0xd5'))){_0x27014a[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x962d0a[_0x8c35('0x44')][_0x8c35('0x23')]);_0x27014a[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x962d0a['query'][_0x8c35('0x22')]);}_0x27014a['order']=qs['sort'](_0x962d0a[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x27014a['where']=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x962d0a[_0x8c35('0x44')],_0x302486[_0x8c35('0x56')]));_0x27014a[_0x8c35('0x43')][_0x8c35('0xdb')]=_0x43db96['id'];if(_0x962d0a[_0x8c35('0x44')][_0x8c35('0xd6')]){_0x27014a[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0x27014a['where'],{'$or':_[_0x8c35('0x33')](_0x27014a[_0x8c35('0x48')],function(_0x3803b5){var _0x41f146={};_0x41f146[_0x3803b5]={'$like':'%'+_0x962d0a[_0x8c35('0x44')]['filter']+'%'};return _0x41f146;})});}_0x27014a=_[_0x8c35('0xcb')]({},_0x27014a,_0x962d0a[_0x8c35('0x5a')]);return db['MailInteraction'][_0x8c35('0x25')]({'where':_0x27014a[_0x8c35('0x43')]})[_0x8c35('0x29')](function(_0x5d1574){_0x6e4e5e[_0x8c35('0x25')]=_0x5d1574;if(_0x962d0a[_0x8c35('0x44')][_0x8c35('0x45')]){_0x27014a[_0x8c35('0x46')]=[{'all':!![]}];}return db['MailInteraction'][_0x8c35('0x4a')](_0x27014a);})[_0x8c35('0x29')](function(_0x4744a8){_0x6e4e5e[_0x8c35('0x4b')]=_0x4744a8;return _0x6e4e5e;});}})[_0x8c35('0x29')](respondWithFilteredResult(_0xbd561c,_0x27014a))['catch'](handleError(_0xbd561c,null));};exports['getSmsInteractions']=function(_0x24c027,_0xcd1fec){var _0x20915b={};var _0x3e8d36={};var _0x5b95bb;var _0x51fb57;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x24c027[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0xcd1fec,null))['then'](function(_0x57bbd3){if(_0x57bbd3){_0x5b95bb=_0x57bbd3;_0x3e8d36['model']=_['keys'](db[_0x8c35('0xe3')][_0x8c35('0x3e')]);_0x3e8d36[_0x8c35('0x44')]=_['keys'](_0x24c027[_0x8c35('0x44')]);_0x3e8d36[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x3e8d36[_0x8c35('0x53')],_0x3e8d36[_0x8c35('0x44')]);_0x20915b[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x3e8d36['model'],qs[_0x8c35('0x58')](_0x24c027[_0x8c35('0x44')][_0x8c35('0x58')]));_0x20915b[_0x8c35('0x48')]=_0x20915b[_0x8c35('0x48')][_0x8c35('0x71')]?_0x20915b[_0x8c35('0x48')]:_0x3e8d36[_0x8c35('0x53')];_0x20915b[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x24c027[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x20915b['where']=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x24c027[_0x8c35('0x44')],_0x3e8d36[_0x8c35('0x56')]));if(_0x24c027[_0x8c35('0x44')][_0x8c35('0xd6')]){_0x20915b[_0x8c35('0x43')]=_['merge'](_0x20915b['where'],{'$or':_[_0x8c35('0x33')](_0x20915b['attributes'],function(_0x3ec929){var _0x23aafd={};_0x23aafd[_0x3ec929]={'$like':'%'+_0x24c027[_0x8c35('0x44')]['filter']+'%'};return _0x23aafd;})});}_0x20915b=_['merge']({},_0x20915b,_0x24c027['options']);return _0x5b95bb['getSmsInteractions'](_0x20915b);}})['then'](function(_0x4f4a4d){if(_0x4f4a4d){_0x51fb57=_0x4f4a4d[_0x8c35('0x71')];if(!_0x24c027[_0x8c35('0x44')][_0x8c35('0xcc')](_0x8c35('0xd5'))){_0x20915b[_0x8c35('0x23')]=qs['limit'](_0x24c027[_0x8c35('0x44')][_0x8c35('0x23')]);_0x20915b['offset']=qs[_0x8c35('0x22')](_0x24c027[_0x8c35('0x44')]['offset']);}return _0x5b95bb[_0x8c35('0xe4')](_0x20915b);}})[_0x8c35('0x29')](function(_0x58ce9f){if(_0x58ce9f){return _0x58ce9f?{'count':_0x51fb57,'rows':_0x58ce9f}:null;}})['then'](respondWithResult(_0xcd1fec,null))['catch'](handleError(_0xcd1fec,null));};exports['getFaxInteractions']=function(_0x57c045,_0x433778){var _0x9a0d9={};var _0x479d6c={};var _0x3b6288;var _0x43d2ce;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x57c045['params']['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x433778,null))[_0x8c35('0x29')](function(_0x31609e){if(_0x31609e){_0x3b6288=_0x31609e;_0x479d6c[_0x8c35('0x53')]=_['keys'](db[_0x8c35('0xe5')]['rawAttributes']);_0x479d6c['query']=_['keys'](_0x57c045[_0x8c35('0x44')]);_0x479d6c['filters']=_[_0x8c35('0x57')](_0x479d6c['model'],_0x479d6c[_0x8c35('0x44')]);_0x9a0d9[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x479d6c[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x57c045[_0x8c35('0x44')][_0x8c35('0x58')]));_0x9a0d9[_0x8c35('0x48')]=_0x9a0d9[_0x8c35('0x48')]['length']?_0x9a0d9[_0x8c35('0x48')]:_0x479d6c['model'];_0x9a0d9[_0x8c35('0xc8')]=qs['sort'](_0x57c045[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x9a0d9[_0x8c35('0x43')]=qs['filters'](_[_0x8c35('0xca')](_0x57c045[_0x8c35('0x44')],_0x479d6c[_0x8c35('0x56')]));if(_0x57c045[_0x8c35('0x44')]['filter']){_0x9a0d9[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0x9a0d9[_0x8c35('0x43')],{'$or':_['map'](_0x9a0d9[_0x8c35('0x48')],function(_0x47ba47){var _0x14cb8e={};_0x14cb8e[_0x47ba47]={'$like':'%'+_0x57c045[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x14cb8e;})});}_0x9a0d9=_['merge']({},_0x9a0d9,_0x57c045[_0x8c35('0x5a')]);return _0x3b6288[_0x8c35('0xe6')](_0x9a0d9);}})[_0x8c35('0x29')](function(_0x4345da){if(_0x4345da){_0x43d2ce=_0x4345da['length'];if(!_0x57c045[_0x8c35('0x44')]['hasOwnProperty'](_0x8c35('0xd5'))){_0x9a0d9['limit']=qs['limit'](_0x57c045['query'][_0x8c35('0x23')]);_0x9a0d9[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x57c045['query']['offset']);}return _0x3b6288[_0x8c35('0xe6')](_0x9a0d9);}})[_0x8c35('0x29')](function(_0x3e9885){if(_0x3e9885){return _0x3e9885?{'count':_0x43d2ce,'rows':_0x3e9885}:null;}})[_0x8c35('0x29')](respondWithResult(_0x433778,null))['catch'](handleError(_0x433778,null));};exports[_0x8c35('0xe7')]=function(_0xb01197,_0x3e7dfb){var _0x47d160={};var _0x4f6ec0={};var _0x3566e8;var _0x350bc5;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0xb01197[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x3e7dfb,null))['then'](function(_0x27c92f){if(_0x27c92f){_0x3566e8=_0x27c92f;_0x4f6ec0[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xe8')][_0x8c35('0x3e')]);_0x4f6ec0['query']=_['keys'](_0xb01197[_0x8c35('0x44')]);_0x4f6ec0[_0x8c35('0x56')]=_[_0x8c35('0x57')](_0x4f6ec0[_0x8c35('0x53')],_0x4f6ec0['query']);_0x47d160['attributes']=_[_0x8c35('0x57')](_0x4f6ec0[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0xb01197['query'][_0x8c35('0x58')]));_0x47d160[_0x8c35('0x48')]=_0x47d160[_0x8c35('0x48')][_0x8c35('0x71')]?_0x47d160[_0x8c35('0x48')]:_0x4f6ec0[_0x8c35('0x53')];_0x47d160[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0xb01197[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x47d160[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0xb01197[_0x8c35('0x44')],_0x4f6ec0[_0x8c35('0x56')]));if(_0xb01197['query'][_0x8c35('0xd6')]){_0x47d160[_0x8c35('0x43')]=_['merge'](_0x47d160[_0x8c35('0x43')],{'$or':_[_0x8c35('0x33')](_0x47d160[_0x8c35('0x48')],function(_0x2c2158){var _0x2bf2b4={};_0x2bf2b4[_0x2c2158]={'$like':'%'+_0xb01197[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x2bf2b4;})});}_0x47d160=_[_0x8c35('0xcb')]({},_0x47d160,_0xb01197[_0x8c35('0x5a')]);return _0x3566e8[_0x8c35('0xe7')](_0x47d160);}})['then'](function(_0x2b6a76){if(_0x2b6a76){_0x350bc5=_0x2b6a76['length'];if(!_0xb01197['query']['hasOwnProperty'](_0x8c35('0xd5'))){_0x47d160[_0x8c35('0x23')]=qs['limit'](_0xb01197['query'][_0x8c35('0x23')]);_0x47d160['offset']=qs[_0x8c35('0x22')](_0xb01197['query'][_0x8c35('0x22')]);}return _0x3566e8[_0x8c35('0xe7')](_0x47d160);}})['then'](function(_0x62004e){if(_0x62004e){return _0x62004e?{'count':_0x350bc5,'rows':_0x62004e}:null;}})[_0x8c35('0x29')](respondWithResult(_0x3e7dfb,null))[_0x8c35('0x1f')](handleError(_0x3e7dfb,null));};exports['login']=function(_0xe7de52,_0x137f8d,_0x1bbeb7){var _0x5943a8;var _0x224b71;var _0x110404;var _0x36732f=!_[_0x8c35('0x6c')](_0xe7de52['params']['id'])?_0xe7de52[_0x8c35('0x52')]['id']:!_[_0x8c35('0x6c')](_0xe7de52[_0x8c35('0x2e')]['id'])?_0xe7de52[_0x8c35('0x2e')]['id']:null;return db[_0x8c35('0x3d')]['find']({'where':{'id':_0x36732f,'role':{'$or':[_0x8c35('0x7e'),_0x8c35('0x2e'),_0x8c35('0x2a')]}},'attributes':['id',_0x8c35('0x3a'),_0x8c35('0xe9'),_0x8c35('0xea'),_0x8c35('0x2d'),_0x8c35('0x6b'),_0x8c35('0x9e')]})['then'](function(_0x199993){if(_0x199993){if(_0x199993['role']==='agent'){_0x5943a8=_0x199993;if(_0xe7de52[_0x8c35('0x61')]['interface']){_0x110404=util['format'](_0x8c35('0xeb'),_0x5943a8[_0xe7de52[_0x8c35('0x61')]['interface']]);}else if(_0xe7de52[_0x8c35('0x61')][_0x8c35('0xec')]){_0x110404=util[_0x8c35('0xaa')](_0x8c35('0xab'),_0xe7de52['body'][_0x8c35('0xec')]);}else{_0x110404=util[_0x8c35('0xaa')](_0x8c35('0xab'),_0x5943a8[_0x8c35('0x3a')]);}socket['to'](util[_0x8c35('0xaa')](_0x8c35('0xed'),_0x5943a8['name']))[_0x8c35('0x2b')](_0x8c35('0xee'),{'user':{'id':_0x5943a8['id'],'name':_0x5943a8[_0x8c35('0x3a')]},'ip':_0xe7de52['headers'][_0x8c35('0xef')]||_0xe7de52[_0x8c35('0xf0')]['remoteAddress']||_0xe7de52[_0x8c35('0xf1')][_0x8c35('0xf2')]||_0xe7de52[_0x8c35('0xf0')][_0x8c35('0xf1')][_0x8c35('0xf2')]});return db[_0x8c35('0xb2')][_0x8c35('0x37')]({'where':{'membername':_0x5943a8['name']},'individualHooks':!![]});}}else{throw new db[(_0x8c35('0x8f'))][(_0x8c35('0x90'))](_0x8c35('0xf3'));}})[_0x8c35('0x29')](function(){if(_0x5943a8){return _0x5943a8[_0x8c35('0xf4')]({'raw':!![]});}})[_0x8c35('0x29')](function(_0x167255){if(_0x5943a8){if(_0x167255){_0x224b71=_0x167255;if(_0x224b71['length']){var _0xdc31d6=_0x224b71[_0x8c35('0x33')](function(_0x3087e2){var _0x3c2334={'membername':_0x5943a8[_0x8c35('0x3a')],'UserId':_0x5943a8['id'],'queue_name':_0x3087e2[_0x8c35('0x3a')],'VoiceQueueId':_0x3087e2['id'],'interface':_0x110404,'paused':_0x5943a8[_0x8c35('0x9e')]||![],'penalty':_0x3087e2['UserVoiceQueue.penalty']||0x0};return db[_0x8c35('0xb2')][_0x8c35('0xad')](_0x3c2334);});return Promise[_0x8c35('0x50')](_0xdc31d6);}}}})['then'](function(){if(_0x5943a8){return db[_0x8c35('0xf5')]['findAll']({'where':{'membername':_0x5943a8[_0x8c35('0x3a')],'exitAt':null}});}})[_0x8c35('0x29')](function(_0x248959){if(_0x5943a8){var _0x28f2a4=[];_0x248959[_0x8c35('0xf6')](function(_0x23577a){_0x28f2a4['push'](_0x23577a[_0x8c35('0x28')]({'exitAt':moment()[_0x8c35('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x8c35('0x50')](_0x28f2a4);}})[_0x8c35('0x29')](function(){if(_0x5943a8){var _0x1fdac2=[];var _0x3d35f9=[];var _0x55740b=utils['getChannels']();var _0x5184d6={'membername':_0x5943a8['name'],'interface':_0x110404,'enterAt':moment()[_0x8c35('0xaa')](_0x8c35('0xf7')),'role':_0x5943a8[_0x8c35('0x2d')],'internal':_0x5943a8[_0x8c35('0x6b')]};_0x55740b['forEach'](function(_0x2bc8d7){_0x1fdac2['push'](_['merge']({'channel':_0x2bc8d7,'type':_0x8c35('0xf8'),'data1':_0xe7de52[_0x8c35('0x61')][_0x8c35('0xf9')],'data2':_0x110404},_0x5184d6));if(_0x5943a8['loginInPause']){_0x3d35f9['push'](_['merge']({'channel':_0x2bc8d7,'type':'PAUSE','data1':_0x8c35('0xfa')},_0x5184d6));}});return db[_0x8c35('0xf5')][_0x8c35('0x87')](_0x1fdac2[_0x8c35('0xfb')](_0x3d35f9),{'individualHooks':!![]});}})[_0x8c35('0x29')](function(){if(_0x5943a8){return _0x5943a8[_0x8c35('0x28')]({'online':!![],'lastLoginAt':moment()[_0x8c35('0xaa')](_0x8c35('0xf7')),'voicePause':_0x5943a8[_0x8c35('0x9e')]||![],'mailPause':_0x5943a8[_0x8c35('0x9e')]||![],'chatPause':_0x5943a8[_0x8c35('0x9e')]||![],'faxPause':_0x5943a8[_0x8c35('0x9e')]||![],'smsPause':_0x5943a8[_0x8c35('0x9e')]||![],'openchannelPause':_0x5943a8['loginInPause']||![],'whatsappPause':_0x5943a8[_0x8c35('0x9e')]||![],'pauseType':_0x5943a8[_0x8c35('0x9e')]?'LOGININPAUSE':null,'interface':_0x110404,'lastPauseAt':moment()[_0x8c35('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x47ded4){if(_0xe7de52[_0x8c35('0xfc')]){return _0x1bbeb7();}else{return Promise['resolve'](_0x47ded4)[_0x8c35('0x29')](respondWithResult(_0x137f8d,null));}})[_0x8c35('0x1f')](handleError(_0x137f8d,null));};exports[_0x8c35('0xfd')]=function(_0xb3d08b,_0xfae172){var _0x669bc;return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0xb3d08b['params']['id'],'role':_0x8c35('0x2a')},'attributes':['id',_0x8c35('0x3a'),_0x8c35('0x2d')]})[_0x8c35('0x29')](handleEntityNotFound(_0xfae172,null))[_0x8c35('0x29')](function(_0x22c85c){if(_0x22c85c){_0x669bc=_0x22c85c;return db[_0x8c35('0xb2')]['destroy']({'where':{'membername':_0x669bc[_0x8c35('0x3a')]},'individualHooks':!![]});}})[_0x8c35('0x29')](function(){return db[_0x8c35('0xf5')][_0x8c35('0x4a')]({'where':{'membername':_0x669bc[_0x8c35('0x3a')],'exitAt':null}});})[_0x8c35('0x29')](function(_0x2b6c34){var _0x581147=[];_0x2b6c34[_0x8c35('0xf6')](function(_0x385643){_0x581147['push'](_0x385643[_0x8c35('0x28')]({'exitAt':moment()['format'](_0x8c35('0xf7'))}));});return Promise[_0x8c35('0x50')](_0x581147);})[_0x8c35('0x29')](function(){return _0x669bc[_0x8c35('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8c35('0x29')](respondWithResult(_0xfae172,null))[_0x8c35('0x1f')](handleError(_0xfae172,null));};exports[_0x8c35('0xfe')]=function(_0x2ef08c,_0x546104){var _0x2f686d;return db[_0x8c35('0xb2')]['update']({'paused':0x1},{'where':{'UserId':_0x2ef08c[_0x8c35('0x52')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0x2ef08c['params']['id'],'role':'agent'},'attributes':['id',_0x8c35('0x3a'),'role',_0x8c35('0x6b'),_0x8c35('0xa0'),'online']});})[_0x8c35('0x29')](handleEntityNotFound(_0x546104,null))[_0x8c35('0x29')](function(_0x2a4fe6){if(_0x2a4fe6){_0x2f686d=_0x2a4fe6;return respondWithRpcPromise(_0x8c35('0xff'),_0x8c35('0xfe'),{'id':_0x2f686d['id'],'name':_0x2f686d[_0x8c35('0x3a')],'pause':!![]});}})[_0x8c35('0x29')](function(){if(_0x2f686d){return db[_0x8c35('0xf5')][_0x8c35('0x4a')]({'where':{'membername':_0x2f686d[_0x8c35('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x8c35('0x29')](function(_0x53ff9f){if(_0x53ff9f[_0x8c35('0x71')]){var _0x51a6b7=moment()[_0x8c35('0xaa')](_0x8c35('0xf7'));for(var _0x359959=0x0,_0x58e6ca=_0x53ff9f['length'];_0x359959<_0x58e6ca;_0x359959++){_0x53ff9f[_0x359959][_0x8c35('0x100')]({'exitAt':_0x51a6b7});}}})[_0x8c35('0x29')](function(){var _0x110107=[];var _0x326777=utils['getChannels']();_0x326777[_0x8c35('0xf6')](function(_0x28211e){_0x110107['push']({'channel':_0x28211e,'membername':_0x2f686d['name'],'interface':_['isNil'](_0x2f686d['interface'])?util[_0x8c35('0xaa')](_0x8c35('0xab'),_0x2f686d[_0x8c35('0x3a')]):_0x2f686d['interface'],'type':'PAUSE','enterAt':moment()[_0x8c35('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2ef08c[_0x8c35('0x61')][_0x8c35('0x3f')]||'DEFAULT\x20PAUSE','role':_0x2f686d['role'],'internal':_0x2f686d['internal']});});return db[_0x8c35('0xf5')]['bulkCreate'](_0x110107,{'individualHooks':!![]});})[_0x8c35('0x29')](function(){return _0x2f686d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2ef08c['body'][_0x8c35('0x3f')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x8c35('0x29')](respondWithResult(_0x546104,null))[_0x8c35('0x1f')](handleError(_0x546104,null));};exports[_0x8c35('0x101')]=function(_0xb1bd8,_0xcfaff0){if(_0xb1bd8[_0x8c35('0x61')][_0x8c35('0x9c')]&&!utils[_0x8c35('0xa1')](_0xb1bd8['body'][_0x8c35('0x9c')])){throw new APIBadRequestError(util['format'](_0x8c35('0x102'),_0xb1bd8['body'][_0x8c35('0x9c')]));}return db[_0x8c35('0x3d')][_0x8c35('0x5b')]({'where':{'id':_0xb1bd8[_0x8c35('0x52')]['id']},'attributes':['id',_0x8c35('0x3a'),'role',_0x8c35('0x6b'),_0x8c35('0xa0'),_0x8c35('0x9d'),'voicePause',_0x8c35('0x103'),'chatPause',_0x8c35('0x104'),_0x8c35('0x105'),_0x8c35('0x106'),'whatsappPause',_0x8c35('0x107'),'lastPauseAt']})[_0x8c35('0x29')](function(_0x13e4c0){if(!_0x13e4c0){throw new APINotFoundError(util[_0x8c35('0xaa')](_0x8c35('0x108'),_0xb1bd8[_0x8c35('0x52')]['id']));}return _0x13e4c0[_0x8c35('0x101')](_0xb1bd8[_0x8c35('0x61')][_0x8c35('0x9c')]);})[_0x8c35('0x29')](respondWithResult(_0xcfaff0,null))['catch'](APIHandleError(_0xcfaff0));};exports[_0x8c35('0x109')]=function(_0x29f2cb,_0x6f6eeb){var _0x4fa287={};var _0xf0bd14={};var _0x3be31a;var _0x49bab4;return db[_0x8c35('0x3d')]['findOne']({'where':{'id':_0x29f2cb['params']['id']}})['then'](handleEntityNotFound(_0x6f6eeb,null))['then'](function(_0x42ea57){if(_0x42ea57){_0x3be31a=_0x42ea57;_0xf0bd14[_0x8c35('0x53')]=_['keys'](db[_0x8c35('0x10a')][_0x8c35('0x3e')]);_0xf0bd14['query']=_[_0x8c35('0x54')](_0x29f2cb[_0x8c35('0x44')]);_0xf0bd14['filters']=_[_0x8c35('0x57')](_0xf0bd14['model'],_0xf0bd14[_0x8c35('0x44')]);_0x4fa287[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0xf0bd14[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x29f2cb[_0x8c35('0x44')][_0x8c35('0x58')]));_0x4fa287[_0x8c35('0x48')]=_0x4fa287['attributes']['length']?_0x4fa287['attributes']:_0xf0bd14['model'];_0x4fa287[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x29f2cb[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x4fa287[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x29f2cb['query'],_0xf0bd14[_0x8c35('0x56')]));if(_0x29f2cb[_0x8c35('0x44')]['filter']){_0x4fa287[_0x8c35('0x43')]=_['merge'](_0x4fa287['where'],{'$or':_['map'](_0x4fa287[_0x8c35('0x48')],function(_0x70d560){var _0x5db342={};_0x5db342[_0x70d560]={'$like':'%'+_0x29f2cb[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x5db342;})});}_0x4fa287=_[_0x8c35('0xcb')]({},_0x4fa287,_0x29f2cb[_0x8c35('0x5a')]);return _0x3be31a['getTeams'](_0x4fa287);}})[_0x8c35('0x29')](function(_0x536427){if(_0x536427){_0x49bab4=_0x536427[_0x8c35('0x71')];if(!_0x29f2cb[_0x8c35('0x44')][_0x8c35('0xcc')]('nolimit')){_0x4fa287[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x29f2cb['query']['limit']);_0x4fa287[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x29f2cb[_0x8c35('0x44')]['offset']);}return _0x3be31a['getTeams'](_0x4fa287);}})[_0x8c35('0x29')](function(_0xfe34b6){if(_0xfe34b6){return _0xfe34b6?{'count':_0x49bab4,'rows':_0xfe34b6}:null;}})['then'](respondWithResult(_0x6f6eeb,null))['catch'](handleError(_0x6f6eeb,null));};exports['addTeams']=function(_0x14b326,_0xef9144){var _0x17fbcd=_0x14b326[_0x8c35('0x52')]['id'];var _0xf5bbc=_0x14b326[_0x8c35('0x61')]?_0x14b326['body'][_0x8c35('0x64')]:null;var _0x3a68b5=[];return Promise['resolve']()['then'](function(){if(!_0xf5bbc)throw new APIBadRequestError(_0x8c35('0x10b'));})['then'](function(){return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x17fbcd}});})[_0x8c35('0x29')](function(_0xe93dfc){if(!_0xe93dfc)throw new APINotFoundError(util[_0x8c35('0xaa')](_0x8c35('0x108'),_0x14b326[_0x8c35('0x52')]['id']));return db[_0x8c35('0x6e')][_0x8c35('0x10c')](function(_0x93b354){return _0xe93dfc[_0x8c35('0x10d')](_0xf5bbc,{'transaction':_0x93b354})[_0x8c35('0x29')](function(){return db['Team'][_0x8c35('0x4a')]({'where':{'id':{'$in':_0xf5bbc}}});})[_0x8c35('0x29')](function(_0x3c2f04){var _0x3a0efe=_[_0x8c35('0x33')](_0x3c2f04,function(_0xb92319){return _0xb92319['getAssociatedQueues']();});return Promise['all'](_0x3a0efe);})[_0x8c35('0x29')](function(_0x1397b8){_0x3a68b5=_[_0x8c35('0x10e')](_0x1397b8);var _0x471a64=_['map'](_0x3a68b5,function(_0x4eb340){return _0x4eb340[_0x8c35('0x10f')](_0xe93dfc['id'],{'transaction':_0x93b354});});return Promise['all'](_0x471a64);})[_0x8c35('0x29')](function(){if(!_0xe93dfc[_0x8c35('0x9d')])return;var _0x4d56d3=_[_0x8c35('0xd6')](_0x3a68b5,function(_0x7f19d4){return _0x7f19d4[_0x8c35('0x110')](_0x8c35('0x9c'))==='Voice';});var _0x348a63=_[_0x8c35('0x33')](_0x4d56d3,function(_0x2459bc){return db['UserVoiceQueueRt'][_0x8c35('0xad')]({'membername':_0xe93dfc[_0x8c35('0x3a')],'UserId':_0xe93dfc['id'],'queue_name':_0x2459bc[_0x8c35('0x3a')],'VoiceQueueId':_0x2459bc['id'],'interface':_[_0x8c35('0x6c')](_0xe93dfc['interface'])?util[_0x8c35('0xaa')](_0x8c35('0xab'),_0xe93dfc[_0x8c35('0x3a')]):_0xe93dfc['interface'],'paused':_0xe93dfc[_0x8c35('0x9f')]||![],'penalty':_0xe93dfc['penalty']},{'transaction':_0x93b354});});return Promise[_0x8c35('0x50')](_0x348a63);})[_0x8c35('0x29')](function(){return db[_0x8c35('0x111')]['findAll']({'where':{'teamId':{'$in':_0xf5bbc}}});})[_0x8c35('0x29')](function(_0x59c078){var _0xf11703=_[_0x8c35('0x33')](_0x59c078,function(_0x4be075){return db[_0x8c35('0x112')][_0x8c35('0x7c')]({'UserId':_0xe93dfc['id'],'VoicePrefixId':_0x4be075[_0x8c35('0x113')]},{'transaction':_0x93b354});});return Promise['all'](_0xf11703);});});})['then'](function(){for(var _0x3a0a6a=0x0;_0x3a0a6a<_0x3a68b5[_0x8c35('0x71')];_0x3a0a6a++){var _0x16813c=_0x3a68b5[_0x3a0a6a]['getDataValue'](_0x8c35('0x9c'));var _0x2cba5a=_0x16813c+'QueueId';socket[_0x8c35('0x2b')]('user'+_0x16813c+_0x8c35('0x114'),{'UserId':_0x17fbcd,['queueField']:_0x3a68b5[_0x3a0a6a]['id']});}})[_0x8c35('0x29')](respondWithStatusCode(_0xef9144,null))[_0x8c35('0x1f')](APIHandleError(_0xef9144));};exports[_0x8c35('0x115')]=function(_0x49fe57,_0x2053a9){var _0xddc882=_0x49fe57['params']['id'];var _0x41da68=null;if(_0x49fe57[_0x8c35('0x44')]['ids']){_0x41da68=_[_0x8c35('0xb0')](_0x49fe57[_0x8c35('0x44')][_0x8c35('0x64')])?_0x49fe57['query'][_0x8c35('0x64')]:[_0x49fe57[_0x8c35('0x44')][_0x8c35('0x64')]];}var _0x20f206=[];return Promise[_0x8c35('0x116')]()['then'](function(){if(!_0x41da68)throw new APIBadRequestError(_0x8c35('0x117'));})[_0x8c35('0x29')](function(){return db['User'][_0x8c35('0x96')]({'where':{'id':_0xddc882}});})[_0x8c35('0x29')](function(_0x421d92){if(!_0x421d92)throw new APINotFoundError(util[_0x8c35('0xaa')]('User\x20with\x20id\x20%s\x20not\x20found',_0x49fe57[_0x8c35('0x52')]['id']));return db['sequelize'][_0x8c35('0x10c')](function(_0x409270){return _0x421d92[_0x8c35('0x115')](_0x41da68,{'transaction':_0x409270})[_0x8c35('0x29')](function(){return db[_0x8c35('0x10a')][_0x8c35('0x4a')]({'where':{'id':{'$in':_0x41da68}}});})[_0x8c35('0x29')](function(_0x2059ef){var _0x4bc69d=_[_0x8c35('0x33')](_0x2059ef,function(_0x2774b4){return _0x2774b4[_0x8c35('0x118')]();});return Promise[_0x8c35('0x50')](_0x4bc69d);})['then'](function(_0x407976){_0x20f206=_[_0x8c35('0x10e')](_0x407976);var _0x15b284=_[_0x8c35('0x33')](_0x20f206,function(_0xcfad24){return _0xcfad24['removeAgent'](_0x421d92['id'],{'transaction':_0x409270});});return Promise[_0x8c35('0x50')](_0x15b284);})['then'](function(){if(!_0x421d92[_0x8c35('0x9d')])return;var _0x448826=_[_0x8c35('0xd6')](_0x20f206,function(_0xd5ed9d){return _0xd5ed9d[_0x8c35('0x110')](_0x8c35('0x9c'))===_0x8c35('0x119');});var _0x30cbd0=_[_0x8c35('0x33')](_0x448826,function(_0x3ec9f8){return db[_0x8c35('0xb2')][_0x8c35('0x37')]({'where':{'VoiceQueueId':_0x3ec9f8['id'],'UserId':_0x421d92['id']},'transaction':_0x409270});});return Promise['all'](_0x30cbd0);})[_0x8c35('0x29')](function(){return db[_0x8c35('0x111')][_0x8c35('0x4a')]({'where':{'teamId':{'$in':_0x41da68}}});})[_0x8c35('0x29')](function(_0x435cd7){var _0x58fe90=_['map'](_0x435cd7,function(_0x2a2fe0){return db[_0x8c35('0x112')][_0x8c35('0x37')]({'where':{'UserId':_0x421d92['id'],'VoicePrefixId':_0x2a2fe0[_0x8c35('0x113')]}},{'transaction':_0x409270});});return Promise[_0x8c35('0x50')](_0x58fe90);});});})[_0x8c35('0x29')](function(){for(var _0x2fefd9=0x0;_0x2fefd9<_0x20f206['length'];_0x2fefd9++){var _0x5a0822=_0x20f206[_0x2fefd9][_0x8c35('0x110')](_0x8c35('0x9c'));var _0x1afb5a=_0x5a0822+_0x8c35('0xa7');socket[_0x8c35('0x2b')](_0x8c35('0x2e')+_0x5a0822+'Queue:remove',{'UserId':_0xddc882,['queueField']:_0x20f206[_0x2fefd9]['id']});}})[_0x8c35('0x29')](respondWithStatusCode(_0x2053a9,null))['catch'](APIHandleError(_0x2053a9));};exports[_0x8c35('0x11a')]=function(_0x9e6689,_0x4802eb){var _0x5427ff={};var _0xcab585={};var _0x590506;var _0x2ab981;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x9e6689[_0x8c35('0x52')]['id']}})[_0x8c35('0x29')](handleEntityNotFound(_0x4802eb,null))[_0x8c35('0x29')](function(_0xb4066c){if(_0xb4066c){_0x590506=_0xb4066c;_0xcab585[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0xcd')]['rawAttributes']);_0xcab585[_0x8c35('0x44')]=_['keys'](_0x9e6689[_0x8c35('0x44')]);_0xcab585['filters']=_[_0x8c35('0x57')](_0xcab585[_0x8c35('0x53')],_0xcab585['query']);_0x5427ff[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0xcab585[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x9e6689[_0x8c35('0x44')]['fields']));_0x5427ff[_0x8c35('0x48')]=_0x5427ff[_0x8c35('0x48')]['length']?_0x5427ff['attributes']:_0xcab585['model'];_0x5427ff['order']=qs[_0x8c35('0xc9')](_0x9e6689[_0x8c35('0x44')]['sort']);_0x5427ff[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x9e6689[_0x8c35('0x44')],_0xcab585[_0x8c35('0x56')]));if(_0x9e6689['query'][_0x8c35('0xd6')]){_0x5427ff[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0x5427ff[_0x8c35('0x43')],{'$or':_[_0x8c35('0x33')](_0x5427ff[_0x8c35('0x48')],function(_0x221048){var _0x37b28b={};_0x37b28b[_0x221048]={'$like':'%'+_0x9e6689[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x37b28b;})});}_0x5427ff=_[_0x8c35('0xcb')]({},_0x5427ff,_0x9e6689['options']);return _0x590506[_0x8c35('0x11a')](_0x5427ff);}})['then'](function(_0x4e2427){if(_0x4e2427){_0x2ab981=_0x4e2427[_0x8c35('0x71')];if(!_0x9e6689[_0x8c35('0x44')]['hasOwnProperty'](_0x8c35('0xd5'))){_0x5427ff[_0x8c35('0x23')]=qs[_0x8c35('0x23')](_0x9e6689[_0x8c35('0x44')][_0x8c35('0x23')]);_0x5427ff[_0x8c35('0x22')]=qs[_0x8c35('0x22')](_0x9e6689[_0x8c35('0x44')][_0x8c35('0x22')]);}return _0x590506['getLists'](_0x5427ff);}})['then'](function(_0xd055dd){if(_0xd055dd){return _0xd055dd?{'count':_0x2ab981,'rows':_0xd055dd}:null;}})[_0x8c35('0x29')](respondWithResult(_0x4802eb,null))[_0x8c35('0x1f')](handleError(_0x4802eb,null));};exports[_0x8c35('0x11b')]=function(_0x4e58ac,_0x456634){var _0x5f1d22={};var _0x3c2218={};var _0x53ceb7;return db[_0x8c35('0x3d')][_0x8c35('0x96')]({'where':{'id':_0x4e58ac[_0x8c35('0x52')]['id']}})['then'](handleEntityNotFound(_0x456634,null))[_0x8c35('0x29')](function(_0x283c07){if(_0x283c07){_0x53ceb7=_0x283c07;_0x3c2218[_0x8c35('0x53')]=_[_0x8c35('0x54')](db[_0x8c35('0x3d')][_0x8c35('0x3e')]);_0x3c2218['query']=_[_0x8c35('0x54')](_0x4e58ac[_0x8c35('0x44')]);_0x3c2218[_0x8c35('0x56')]=_['intersection'](_0x3c2218['model'],_0x3c2218['query']);_0x5f1d22[_0x8c35('0x48')]=_[_0x8c35('0x57')](_0x3c2218[_0x8c35('0x53')],qs[_0x8c35('0x58')](_0x4e58ac[_0x8c35('0x44')][_0x8c35('0x58')]));_0x5f1d22['attributes']=_0x5f1d22[_0x8c35('0x48')][_0x8c35('0x71')]?_0x5f1d22[_0x8c35('0x48')]:_0x3c2218['model'];_0x5f1d22[_0x8c35('0xc8')]=qs[_0x8c35('0xc9')](_0x4e58ac[_0x8c35('0x44')][_0x8c35('0xc9')]);_0x5f1d22[_0x8c35('0x43')]=qs[_0x8c35('0x56')](_[_0x8c35('0xca')](_0x4e58ac[_0x8c35('0x44')],_0x3c2218['filters']));if(_0x4e58ac[_0x8c35('0x44')][_0x8c35('0xd6')]){_0x5f1d22[_0x8c35('0x43')]=_[_0x8c35('0xcb')](_0x5f1d22[_0x8c35('0x43')],{'$or':_['map'](_0x5f1d22[_0x8c35('0x48')],function(_0x590b8c){var _0x5080a7={};_0x5080a7[_0x590b8c]={'$like':'%'+_0x4e58ac[_0x8c35('0x44')][_0x8c35('0xd6')]+'%'};return _0x5080a7;})});}_0x5f1d22['model']=db[_0x8c35('0x3d')];_0x5f1d22['as']=_0x8c35('0x2f');_0x5f1d22=_[_0x8c35('0xcb')]({},_0x5f1d22,_0x4e58ac[_0x8c35('0x5a')]);return _0x53ceb7[_0x8c35('0xf4')]({'include':[_0x5f1d22]});}})[_0x8c35('0x29')](function(_0x73995b){if(_0x73995b){var _0x168a6d={},_0x332f11=[];for(var _0x470e2e=0x0;_0x470e2e<_0x73995b['length'];_0x470e2e+=0x1){for(var _0x5e9267=0x0,_0x23ee1a;_0x5e9267<_0x73995b[_0x470e2e]['Agents'][_0x8c35('0x71')];_0x5e9267+=0x1){_0x23ee1a=_0x73995b[_0x470e2e][_0x8c35('0x2f')][_0x5e9267][_0x8c35('0x2c')]({'plain':!![]});_0x168a6d[_0x23ee1a['id']]=_0x23ee1a;}}_0x168a6d=_[_0x8c35('0x11c')](_0x168a6d);for(var _0x4bcf5f=qs[_0x8c35('0x22')](_0x4e58ac['query']['offset']);_0x4bcf5f<_0x168a6d[_0x8c35('0x71')]&&_0x332f11[_0x8c35('0x71')]=_0x4220f3[_0x75b8('0x45')]){throw new Error(_0x75b8('0x46'));}})[_0x75b8('0x21')](function(){if(_0x41cf59){return db[_0x75b8('0x23')][_0x75b8('0x3f')]({'where':{'membername':_0x41cf59[_0x75b8('0x26')]},'individualHooks':!![]});}})[_0x75b8('0x21')](function(){if(_0x41cf59){return _0x41cf59[_0x75b8('0x47')]({'raw':!![]});}})[_0x75b8('0x21')](function(_0x318146){if(_0x41cf59){if(_0x318146){var _0x25c1b3=[];_0x462c63=_0x318146;if(_0x462c63[_0x75b8('0x28')]){for(var _0x3175b2=0x0;_0x3175b2<_0x462c63[_0x75b8('0x28')];_0x3175b2++){_0x25c1b3[_0x75b8('0x2e')](db[_0x75b8('0x23')]['upsert']({'membername':_0x41cf59[_0x75b8('0x26')],'UserId':_0x41cf59['id'],'queue_name':_0x462c63[_0x3175b2][_0x75b8('0x26')],'VoiceQueueId':_0x462c63[_0x3175b2]['id'],'interface':_0x571704,'paused':_0x41cf59[_0x75b8('0x48')]||![],'penalty':_0x462c63[_0x3175b2]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x75b8('0x40')](_0x25c1b3);}}}})['then'](function(){if(_0x41cf59){return db[_0x75b8('0x25')][_0x75b8('0xd')]({'where':{'membername':_0x41cf59[_0x75b8('0x26')],'exitAt':null}});}})[_0x75b8('0x21')](function(_0x2ecd36){if(_0x41cf59){if(_0x2ecd36&&_0x2ecd36[_0x75b8('0x28')]){var _0x33606a=[];_0x2ecd36[_0x75b8('0x2d')](function(_0x5430e1){_0x33606a['push'](_0x5430e1['update']({'exitAt':moment()[_0x75b8('0x29')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x75b8('0x40')](_0x33606a);}}})[_0x75b8('0x21')](function(){if(_0x41cf59){var _0x5a15d3=[];var _0x2d367a=[];var _0x297d60=utils[_0x75b8('0x2c')]();var _0x33b3a3={'membername':_0x41cf59[_0x75b8('0x26')],'interface':_0x571704,'enterAt':moment()[_0x75b8('0x29')](_0x75b8('0x2a')),'role':_0x41cf59[_0x75b8('0x1e')],'internal':_0x41cf59[_0x75b8('0x1f')]};_0x297d60[_0x75b8('0x2d')](function(_0x21ae6d){_0x5a15d3[_0x75b8('0x2e')](_[_0x75b8('0x49')]({'channel':_0x21ae6d,'type':_0x75b8('0x4a'),'data1':_0x75b8('0x4b'),'data2':_0x571704},_0x33b3a3));if(_0x41cf59[_0x75b8('0x48')]){_0x2d367a[_0x75b8('0x2e')](_[_0x75b8('0x49')]({'channel':_0x21ae6d,'type':_0x75b8('0x27'),'data1':_0x75b8('0x4c')},_0x33b3a3));}});return db['MemberReport']['bulkCreate'](_0x5a15d3[_0x75b8('0x4d')](_0x2d367a),{'individualHooks':!![]});}})['then'](function(){if(_0x41cf59){return _0x41cf59['update']({'online':!![],'lastLoginAt':moment()[_0x75b8('0x29')](_0x75b8('0x2a')),'voicePause':_0x41cf59['loginInPause']||![],'mailPause':_0x41cf59['loginInPause']||![],'chatPause':_0x41cf59[_0x75b8('0x48')]||![],'faxPause':_0x41cf59[_0x75b8('0x48')]||![],'smsPause':_0x41cf59[_0x75b8('0x48')]||![],'openchannelPause':_0x41cf59[_0x75b8('0x48')]||![],'pauseType':_0x41cf59['loginInPause']?_0x75b8('0x4c'):null,'lastPauseAt':moment()[_0x75b8('0x29')](_0x75b8('0x2a')),'interface':_0x571704});}})[_0x75b8('0x21')](function(_0x88859f){_0x531187(_0x88859f);})[_0x75b8('0x17')](function(_0x1cca49){_0x3d5543(_0x39d3c1[_0x75b8('0x18')](0x1f4,_0x1cca49[_0x75b8('0x19')]));});});}; \ No newline at end of file +var _0xcdba=['where','ShowUser','PauseUser','name','role','internal','interface','format','params','UserVoiceQueueRt','update','findAll','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','uniqueid','MemberReport','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','chatPause','openchannelPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','unpause','system','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetUser','User','options','raw','attributes','limit','model','include','map','then','info','debug','stringify','catch','error','message','find'];(function(_0x177b39,_0x190f0a){var _0x4c0ec7=function(_0x4feb15){while(--_0x4feb15){_0x177b39['push'](_0x177b39['shift']());}};_0x4c0ec7(++_0x190f0a);}(_0xcdba,0x1ad));var _0xacdb=function(_0x9d1af4,_0x472046){_0x9d1af4=_0x9d1af4-0x0;var _0xad779a=_0xcdba[_0x9d1af4];return _0xad779a;};'use strict';var _=require(_0xacdb('0x0'));var util=require('util');var moment=require(_0xacdb('0x1'));var BPromise=require(_0xacdb('0x2'));var Redis=require(_0xacdb('0x3'));var db=require(_0xacdb('0x4'))['db'];var utils=require(_0xacdb('0x5'));var logger=require(_0xacdb('0x6'))(_0xacdb('0x7'));var config=require(_0xacdb('0x8'));config[_0xacdb('0x9')]=_[_0xacdb('0xa')](config[_0xacdb('0x9')],{'host':_0xacdb('0xb'),'port':0x18eb});var socket=require(_0xacdb('0xc'))(new Redis(config[_0xacdb('0x9')]));require('./user.socket')[_0xacdb('0xd')](socket);exports[_0xacdb('0xe')]=function(_0x1bbac8){var _0xf4538e=this;return new Promise(function(_0x210405,_0x36d26c){return db[_0xacdb('0xf')]['findAll']({'raw':_0x1bbac8[_0xacdb('0x10')]?_0x1bbac8[_0xacdb('0x10')][_0xacdb('0x11')]===undefined?!![]:![]:!![],'where':_0x1bbac8[_0xacdb('0x10')]?_0x1bbac8[_0xacdb('0x10')]['where']||null:null,'attributes':_0x1bbac8['options']?_0x1bbac8[_0xacdb('0x10')][_0xacdb('0x12')]||null:null,'limit':_0x1bbac8[_0xacdb('0x10')]?_0x1bbac8[_0xacdb('0x10')][_0xacdb('0x13')]||null:null,'include':_0x1bbac8[_0xacdb('0x10')]?_0x1bbac8['options']['include']?_['map'](_0x1bbac8[_0xacdb('0x10')]['include'],function(_0x3bc3de){return{'model':db[_0x3bc3de[_0xacdb('0x14')]],'as':_0x3bc3de['as'],'attributes':_0x3bc3de[_0xacdb('0x12')],'include':_0x3bc3de[_0xacdb('0x15')]?_[_0xacdb('0x16')](_0x3bc3de[_0xacdb('0x15')],function(_0xc89aea){return{'model':db[_0xc89aea[_0xacdb('0x14')]],'as':_0xc89aea['as'],'attributes':_0xc89aea[_0xacdb('0x12')],'include':_0xc89aea[_0xacdb('0x15')]?_[_0xacdb('0x16')](_0xc89aea['include'],function(_0x26c00d){return{'model':db[_0x26c00d['model']],'as':_0x26c00d['as'],'attributes':_0x26c00d[_0xacdb('0x12')]};}):[]};}):[]};}):[]:[]})[_0xacdb('0x17')](function(_0xdefdd3){logger[_0xacdb('0x18')](_0xacdb('0xe'),_0x1bbac8);logger[_0xacdb('0x19')](_0xacdb('0xe'),_0x1bbac8,JSON[_0xacdb('0x1a')](_0xdefdd3));_0x210405(_0xdefdd3);})[_0xacdb('0x1b')](function(_0x38e897){logger[_0xacdb('0x1c')](_0xacdb('0xe'),_0x38e897[_0xacdb('0x1d')],_0x1bbac8);_0x36d26c(_0xf4538e[_0xacdb('0x1c')](0x1f4,_0x38e897['message']));});});};exports['ShowUser']=function(_0x42c7f3){var _0x1702bf=this;return new Promise(function(_0x5c8326,_0x58da96){return db[_0xacdb('0xf')][_0xacdb('0x1e')]({'raw':_0x42c7f3[_0xacdb('0x10')]?_0x42c7f3[_0xacdb('0x10')][_0xacdb('0x11')]===undefined?!![]:![]:!![],'where':_0x42c7f3[_0xacdb('0x10')]?_0x42c7f3[_0xacdb('0x10')][_0xacdb('0x1f')]||null:null,'attributes':_0x42c7f3[_0xacdb('0x10')]?_0x42c7f3[_0xacdb('0x10')][_0xacdb('0x12')]||null:null,'include':_0x42c7f3['options']?_0x42c7f3[_0xacdb('0x10')][_0xacdb('0x15')]?_[_0xacdb('0x16')](_0x42c7f3['options'][_0xacdb('0x15')],function(_0x3e0573){return{'model':db[_0x3e0573['model']],'as':_0x3e0573['as'],'attributes':_0x3e0573['attributes'],'include':_0x3e0573['include']?_[_0xacdb('0x16')](_0x3e0573['include'],function(_0x5a7342){return{'model':db[_0x5a7342[_0xacdb('0x14')]],'as':_0x5a7342['as'],'attributes':_0x5a7342[_0xacdb('0x12')],'include':_0x5a7342[_0xacdb('0x15')]?_[_0xacdb('0x16')](_0x5a7342[_0xacdb('0x15')],function(_0x533e78){return{'model':db[_0x533e78[_0xacdb('0x14')]],'as':_0x533e78['as'],'attributes':_0x533e78[_0xacdb('0x12')]};}):[]};}):[]};}):[]:[]})[_0xacdb('0x17')](function(_0x13e475){logger[_0xacdb('0x18')](_0xacdb('0x20'),_0x42c7f3);logger[_0xacdb('0x19')]('ShowUser',_0x42c7f3,JSON[_0xacdb('0x1a')](_0x13e475));_0x5c8326(_0x13e475);})[_0xacdb('0x1b')](function(_0x29fe99){logger[_0xacdb('0x1c')](_0xacdb('0x20'),_0x29fe99[_0xacdb('0x1d')],_0x42c7f3);_0x58da96(_0x1702bf['error'](0x1f4,_0x29fe99['message']));});});};exports[_0xacdb('0x21')]=function(_0x5e015d){var _0x2fda3;return db[_0xacdb('0xf')][_0xacdb('0x1e')]({'where':_0x5e015d['options'][_0xacdb('0x1f')]||{},'attributes':['id',_0xacdb('0x22'),_0xacdb('0x23'),_0xacdb('0x24'),_0xacdb('0x25')]})[_0xacdb('0x17')](function(_0x264166){if(!_0x264166){throw new Error(util[_0xacdb('0x26')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5e015d[_0xacdb('0x27')]['id']));}_0x2fda3=_0x264166;return db[_0xacdb('0x28')][_0xacdb('0x29')]({'paused':0x1},{'where':{'UserId':_0x2fda3['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0xacdb('0x2a')]({'where':{'membername':_0x2fda3[_0xacdb('0x22')],'type':'PAUSE','exitAt':null}});})[_0xacdb('0x17')](function(_0x58a375){if(_0x58a375&&_0x58a375[_0xacdb('0x2b')]){var _0x2688b3=moment()[_0xacdb('0x26')](_0xacdb('0x2c'));for(var _0x1aec36=0x0,_0x50e1a6=_0x58a375[_0xacdb('0x2b')];_0x1aec36<_0x50e1a6;_0x1aec36++){_0x58a375[_0x1aec36]['updateAttributes']({'exitAt':_0x2688b3});}}})[_0xacdb('0x17')](function(){var _0x573713=[];var _0x2c4566=utils[_0xacdb('0x2d')]();_0x2c4566[_0xacdb('0x2e')](function(_0x4c4954){_0x573713[_0xacdb('0x2f')]({'channel':_0x4c4954,'membername':_0x2fda3[_0xacdb('0x22')],'interface':_[_0xacdb('0x30')](_0x2fda3[_0xacdb('0x25')])?util[_0xacdb('0x26')](_0xacdb('0x31'),_0x2fda3[_0xacdb('0x22')]):_0x2fda3[_0xacdb('0x25')],'type':_0xacdb('0x32'),'enterAt':moment()[_0xacdb('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x5e015d[_0xacdb('0x33')][_0xacdb('0x34')]||_0xacdb('0x35'),'role':_0x2fda3[_0xacdb('0x23')],'internal':_0x2fda3[_0xacdb('0x24')],'uniqueid':_0x5e015d['body'][_0xacdb('0x36')]||null});});return db[_0xacdb('0x37')][_0xacdb('0x38')](_0x573713,{'individualHooks':!![]});})[_0xacdb('0x17')](function(){return _0x2fda3['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5e015d[_0xacdb('0x33')]['type']||_0xacdb('0x35'),'lastPauseAt':moment()['format'](_0xacdb('0x2c'))});})['catch'](function(_0x248877){throw _0x248877;});};exports[_0xacdb('0x39')]=function(_0x5ef125){return Promise[_0xacdb('0x3a')]()[_0xacdb('0x17')](function(){if(_0x5ef125[_0xacdb('0x33')][_0xacdb('0x3b')]&&!utils[_0xacdb('0x3c')](_0x5ef125[_0xacdb('0x33')][_0xacdb('0x3b')])){throw new Error(util['format'](_0xacdb('0x3d'),_0x5ef125['body'][_0xacdb('0x3b')]));}return db[_0xacdb('0xf')][_0xacdb('0x3e')]({'where':_0x5ef125[_0xacdb('0x10')]['where']||{},'attributes':['id',_0xacdb('0x22'),_0xacdb('0x23'),'internal',_0xacdb('0x25'),_0xacdb('0x3f'),_0xacdb('0x40'),'mailPause',_0xacdb('0x41'),'faxPause',_0xacdb('0x42'),'smsPause',_0xacdb('0x43'),_0xacdb('0x44'),'lastPauseAt']});})[_0xacdb('0x17')](function(_0x37767c){if(!_0x37767c){throw new Error(util[_0xacdb('0x26')](_0xacdb('0x45'),_0x5ef125[_0xacdb('0x27')]['id']));}return _0x37767c[_0xacdb('0x46')](_0x5ef125['body']['channel'],_0xacdb('0x47'));})['catch'](function(_0x40fbaf){throw _0x40fbaf;});};exports[_0xacdb('0x48')]=function(_0x435165){var _0x3e6245=this;return new Promise(function(_0x54d25b,_0x3f5d6e){var _0x3201de;return db[_0xacdb('0xf')][_0xacdb('0x3e')]({'where':_0x435165[_0xacdb('0x10')]['where']||{},'attributes':['id','name']})['then'](function(_0x257dd9){if(_0x257dd9){_0x3201de=_0x257dd9;return db['UserVoiceQueueRt'][_0xacdb('0x49')]({'where':{'membername':_0x3201de[_0xacdb('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x3201de){return db[_0xacdb('0x37')][_0xacdb('0x2a')]({'where':{'membername':_0x3201de[_0xacdb('0x22')],'exitAt':null}});}})[_0xacdb('0x17')](function(_0x2b4912){if(_0x3201de){if(_0x2b4912&&_0x2b4912[_0xacdb('0x2b')]){var _0x40e4f3=[];_0x2b4912[_0xacdb('0x2e')](function(_0x28fe56){_0x40e4f3[_0xacdb('0x2f')](_0x28fe56[_0xacdb('0x29')]({'exitAt':moment()['format'](_0xacdb('0x2c'))}));});return BPromise['all'](_0x40e4f3);}}})[_0xacdb('0x17')](function(){if(_0x3201de){return _0x3201de[_0xacdb('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xacdb('0x17')](function(_0x5850e3){_0x54d25b(_0x5850e3);})[_0xacdb('0x1b')](function(_0x24512b){_0x3f5d6e(_0x3e6245[_0xacdb('0x1c')](0x1f4,_0x24512b[_0xacdb('0x1d')]));});});};exports[_0xacdb('0x4a')]=function(_0x3faee6){var _0x5d1fe7=this;return new Promise(function(_0x37af64,_0x3cd5d8){var _0xa65da2;var _0x987dde;var _0x125773;var _0x4562a6;return db[_0xacdb('0xf')][_0xacdb('0x3e')]({'where':_0x3faee6[_0xacdb('0x10')][_0xacdb('0x1f')]||{},'attributes':['id',_0xacdb('0x22'),_0xacdb('0x23'),_0xacdb('0x4b'),_0xacdb('0x4c'),_0xacdb('0x24'),_0xacdb('0x4d'),_0xacdb('0x25')]})[_0xacdb('0x17')](function(_0x3c5da4){if(_0x3c5da4){_0xa65da2=_0x3c5da4;_0x4562a6=_0x3faee6[_0xacdb('0x33')]['interface']?_0x3faee6[_0xacdb('0x33')][_0xacdb('0x25')]:util[_0xacdb('0x26')]('SIP/%s',_0xa65da2[_0xacdb('0x22')]);return db['User'][_0xacdb('0x4e')]({'where':{'role':_0xacdb('0x4f'),'online':!![],'id':{'$ne':_0xa65da2['id']}}});}})[_0xacdb('0x17')](function(_0x393e9f){if(_0x393e9f){_0x125773=_0x393e9f;return require(_0xacdb('0x50'))[_0xacdb('0x51')]();}})['then'](function(_0x215b9e){if(_0x215b9e&&_0x215b9e[_0xacdb('0x52')]&&_0x125773>=_0x215b9e['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xacdb('0x17')](function(){if(_0xa65da2){return db[_0xacdb('0x28')][_0xacdb('0x49')]({'where':{'membername':_0xa65da2[_0xacdb('0x22')]},'individualHooks':!![]});}})[_0xacdb('0x17')](function(){if(_0xa65da2){return _0xa65da2[_0xacdb('0x53')]({'raw':!![]});}})[_0xacdb('0x17')](function(_0x30be97){if(_0xa65da2){if(_0x30be97){var _0x12c259=[];_0x987dde=_0x30be97;if(_0x987dde['length']){for(var _0x23a49a=0x0;_0x23a49a<_0x987dde['length'];_0x23a49a++){_0x12c259[_0xacdb('0x2f')](db[_0xacdb('0x28')][_0xacdb('0x54')]({'membername':_0xa65da2[_0xacdb('0x22')],'UserId':_0xa65da2['id'],'queue_name':_0x987dde[_0x23a49a]['name'],'VoiceQueueId':_0x987dde[_0x23a49a]['id'],'interface':_0x4562a6,'paused':_0xa65da2['loginInPause']||![],'penalty':_0x987dde[_0x23a49a][_0xacdb('0x55')]||0x0}));}return BPromise[_0xacdb('0x56')](_0x12c259);}}}})[_0xacdb('0x17')](function(){if(_0xa65da2){return db[_0xacdb('0x37')][_0xacdb('0x2a')]({'where':{'membername':_0xa65da2[_0xacdb('0x22')],'exitAt':null}});}})[_0xacdb('0x17')](function(_0x221286){if(_0xa65da2){if(_0x221286&&_0x221286['length']){var _0x593f69=[];_0x221286[_0xacdb('0x2e')](function(_0x930db4){_0x593f69['push'](_0x930db4['update']({'exitAt':moment()[_0xacdb('0x26')](_0xacdb('0x2c'))}));});return BPromise['all'](_0x593f69);}}})['then'](function(){if(_0xa65da2){var _0x2bd3b6=[];var _0x56b9c0=[];var _0x3d07f4=utils[_0xacdb('0x2d')]();var _0x501887={'membername':_0xa65da2[_0xacdb('0x22')],'interface':_0x4562a6,'enterAt':moment()['format'](_0xacdb('0x2c')),'role':_0xa65da2['role'],'internal':_0xa65da2[_0xacdb('0x24')]};_0x3d07f4[_0xacdb('0x2e')](function(_0x5df47c){_0x2bd3b6[_0xacdb('0x2f')](_[_0xacdb('0x57')]({'channel':_0x5df47c,'type':_0xacdb('0x58'),'data1':_0xacdb('0x59'),'data2':_0x4562a6},_0x501887));if(_0xa65da2[_0xacdb('0x4d')]){_0x56b9c0[_0xacdb('0x2f')](_[_0xacdb('0x57')]({'channel':_0x5df47c,'type':_0xacdb('0x32'),'data1':_0xacdb('0x5a')},_0x501887));}});return db[_0xacdb('0x37')]['bulkCreate'](_0x2bd3b6[_0xacdb('0x5b')](_0x56b9c0),{'individualHooks':!![]});}})[_0xacdb('0x17')](function(){if(_0xa65da2){return _0xa65da2[_0xacdb('0x29')]({'online':!![],'lastLoginAt':moment()['format'](_0xacdb('0x2c')),'voicePause':_0xa65da2['loginInPause']||![],'mailPause':_0xa65da2['loginInPause']||![],'chatPause':_0xa65da2['loginInPause']||![],'faxPause':_0xa65da2['loginInPause']||![],'smsPause':_0xa65da2['loginInPause']||![],'openchannelPause':_0xa65da2[_0xacdb('0x4d')]||![],'pauseType':_0xa65da2[_0xacdb('0x4d')]?_0xacdb('0x5a'):null,'lastPauseAt':moment()[_0xacdb('0x26')](_0xacdb('0x2c')),'interface':_0x4562a6});}})['then'](function(_0x2111bf){_0x37af64(_0x2111bf);})['catch'](function(_0x770225){_0x3cd5d8(_0x5d1fe7[_0xacdb('0x1c')](0x1f4,_0x770225['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 8d260ff..614a426 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 _0xc023=['update','user:','./user.events','save','remove'];(function(_0x2291b7,_0x5cfdaf){var _0x34d9a9=function(_0x3c4fc0){while(--_0x3c4fc0){_0x2291b7['push'](_0x2291b7['shift']());}};_0x34d9a9(++_0x5cfdaf);}(_0xc023,0x1bf));var _0x3c02=function(_0x2100a8,_0x306120){_0x2100a8=_0x2100a8-0x0;var _0x34119b=_0xc023[_0x2100a8];return _0x34119b;};'use strict';var UserEvents=require(_0x3c02('0x0'));var events=[_0x3c02('0x1'),_0x3c02('0x2'),_0x3c02('0x3')];function createListener(_0x43395c,_0xce8c6b){return function(_0x190d2e){_0xce8c6b['emit'](_0x43395c,_0x190d2e);};}function removeListener(_0x27fecd,_0x4c4610){return function(){UserEvents['removeListener'](_0x27fecd,_0x4c4610);};}exports['register']=function(_0x58fd87){for(var _0x4d4e6=0x0,_0x413098=events['length'];_0x4d4e6<_0x413098;_0x4d4e6++){var _0x5bb492=events[_0x4d4e6];var _0x397bdc=createListener(_0x3c02('0x4')+_0x5bb492,_0x58fd87);UserEvents['on'](_0x5bb492,_0x397bdc);}}; \ No newline at end of file +var _0x1b4a=['./user.events','save','remove','removeListener','register','length','user:'];(function(_0x4e58c8,_0xf8c145){var _0x5dc892=function(_0x5225eb){while(--_0x5225eb){_0x4e58c8['push'](_0x4e58c8['shift']());}};_0x5dc892(++_0xf8c145);}(_0x1b4a,0x13b));var _0xa1b4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1b4a[_0x19e35c];return _0x3e1fe8;};'use strict';var UserEvents=require(_0xa1b4('0x0'));var events=[_0xa1b4('0x1'),_0xa1b4('0x2'),'update'];function createListener(_0x56176b,_0x479a6e){return function(_0x26cfde){_0x479a6e['emit'](_0x56176b,_0x26cfde);};}function removeListener(_0x267116,_0x505bf0){return function(){UserEvents[_0xa1b4('0x3')](_0x267116,_0x505bf0);};}exports[_0xa1b4('0x4')]=function(_0xcb3351){for(var _0x4fce5a=0x0,_0x1a5d83=events[_0xa1b4('0x5')];_0x4fce5a<_0x1a5d83;_0x4fce5a++){var _0x5b3f1c=events[_0x4fce5a];var _0x317409=createListener(_0xa1b4('0x6')+_0x5b3f1c,_0xcb3351);UserEvents['on'](_0x5b3f1c,_0x317409);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 73ee2d5..05ba021 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'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(_0x109f6b,_0x2a164c){var _0x22c967=function(_0x854889){while(--_0x854889){_0x109f6b['push'](_0x109f6b['shift']());}};_0x22c967(++_0x2a164c);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ffdf2d6..8f5fc2d 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 _0x6ede=['exports'];(function(_0x4a834c,_0x17f3a6){var _0x1d9108=function(_0x1d1707){while(--_0x1d1707){_0x4a834c['push'](_0x4a834c['shift']());}};_0x1d9108(++_0x17f3a6);}(_0x6ede,0x140));var _0xe6ed=function(_0x57eb2d,_0x5e4918){_0x57eb2d=_0x57eb2d-0x0;var _0xd8e18=_0x6ede[_0x57eb2d];return _0xd8e18;};'use strict';var Sequelize=require('sequelize');module[_0xe6ed('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1603=['exports','INTEGER'];(function(_0x1b531e,_0x26eea2){var _0x51ebf9=function(_0x59ea53){while(--_0x59ea53){_0x1b531e['push'](_0x1b531e['shift']());}};_0x51ebf9(++_0x26eea2);}(_0x1603,0x1b4));var _0x3160=function(_0x42087f,_0x59d2c1){_0x42087f=_0x42087f-0x0;var _0x5dce5d=_0x1603[_0x42087f];return _0x5dce5d;};'use strict';var Sequelize=require('sequelize');module[_0x3160('0x0')]={'penalty':{'type':Sequelize[_0x3160('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 5435e38..64a5c8f 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 _0xb7c3=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x54cba6,_0x5b42b8){var _0x51efeb=function(_0x15d101){while(--_0x15d101){_0x54cba6['push'](_0x54cba6['shift']());}};_0x51efeb(++_0x5b42b8);}(_0xb7c3,0x1da));var _0x3b7c=function(_0x23beac,_0x15437a){_0x23beac=_0x23beac-0x0;var _0x4faad9=_0xb7c3[_0x23beac];return _0x4faad9;};'use strict';var _=require(_0x3b7c('0x0'));var util=require('util');var logger=require(_0x3b7c('0x1'))('api');var moment=require(_0x3b7c('0x2'));var BPromise=require(_0x3b7c('0x3'));var rp=require(_0x3b7c('0x4'));var fs=require('fs');var path=require(_0x3b7c('0x5'));var rimraf=require('rimraf');var config=require(_0x3b7c('0x6'));var attributes=require(_0x3b7c('0x7'));module[_0x3b7c('0x8')]=function(_0x3cf0f8,_0x56c103){return _0x3cf0f8[_0x3b7c('0x9')](_0x3b7c('0xa'),attributes,{'tableName':_0x3b7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cd2=['user_has_chat_queues','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x3794a0,_0x1a9cfc){var _0x5bdaba=function(_0x14a764){while(--_0x14a764){_0x3794a0['push'](_0x3794a0['shift']());}};_0x5bdaba(++_0x1a9cfc);}(_0x1cd2,0x199));var _0x21cd=function(_0x5700d5,_0x14eaa7){_0x5700d5=_0x5700d5-0x0;var _0x3ed378=_0x1cd2[_0x5700d5];return _0x3ed378;};'use strict';var _=require(_0x21cd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x21cd('0x1'));var moment=require(_0x21cd('0x2'));var BPromise=require('bluebird');var rp=require(_0x21cd('0x3'));var fs=require('fs');var path=require(_0x21cd('0x4'));var rimraf=require(_0x21cd('0x5'));var config=require(_0x21cd('0x6'));var attributes=require(_0x21cd('0x7'));module[_0x21cd('0x8')]=function(_0xef3e2e,_0xa63485){return _0xef3e2e[_0x21cd('0x9')](_0x21cd('0xa'),attributes,{'tableName':_0x21cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index c30e37c..f8c1cea 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 _0xbfbb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x3cb371,_0x39a094){var _0x1bb54a=function(_0x4ce5bb){while(--_0x4ce5bb){_0x3cb371['push'](_0x3cb371['shift']());}};_0x1bb54a(++_0x39a094);}(_0xbfbb,0x88));var _0xbbfb=function(_0x500840,_0x162ec4){_0x500840=_0x500840-0x0;var _0x3928df=_0xbfbb[_0x500840];return _0x3928df;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var moment=require(_0xbbfb('0x2'));var BPromise=require(_0xbbfb('0x3'));var rs=require(_0xbbfb('0x4'));var fs=require('fs');var Redis=require(_0xbbfb('0x5'));var db=require(_0xbbfb('0x6'))['db'];var utils=require(_0xbbfb('0x7'));var logger=require(_0xbbfb('0x8'))('rpc');var config=require(_0xbbfb('0x9'));var jayson=require(_0xbbfb('0xa'));var client=jayson[_0xbbfb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46ac87,_0x52a814,_0x2b1be4){return new BPromise(function(_0x12bae6,_0x1f76a1){return client[_0xbbfb('0xc')](_0x46ac87,_0x2b1be4)[_0xbbfb('0xd')](function(_0x1a98b4){logger[_0xbbfb('0xe')](_0xbbfb('0xf'),_0x52a814,_0xbbfb('0x10'));logger['debug'](_0xbbfb('0x11'),_0x52a814,_0xbbfb('0x10'),JSON['stringify'](_0x1a98b4));if(_0x1a98b4[_0xbbfb('0x12')]){if(_0x1a98b4['error'][_0xbbfb('0x13')]===0x1f4){logger[_0xbbfb('0x12')](_0xbbfb('0xf'),_0x52a814,_0x1a98b4[_0xbbfb('0x12')][_0xbbfb('0x14')]);return _0x1f76a1(_0x1a98b4[_0xbbfb('0x12')][_0xbbfb('0x14')]);}logger[_0xbbfb('0x12')](_0xbbfb('0xf'),_0x52a814,_0x1a98b4['error'][_0xbbfb('0x14')]);return _0x12bae6(_0x1a98b4['error']['message']);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x52a814,'request\x20sent');_0x12bae6(_0x1a98b4[_0xbbfb('0x15')][_0xbbfb('0x14')]);}})[_0xbbfb('0x16')](function(_0x4999c7){logger['error'](_0xbbfb('0xf'),_0x52a814,_0x4999c7);_0x1f76a1(_0x4999c7);});});} \ No newline at end of file +var _0x8f74=['UserChatQueue,\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','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e9c70,_0x368b6b){var _0x517ec3=function(_0x4d6e29){while(--_0x4d6e29){_0x1e9c70['push'](_0x1e9c70['shift']());}};_0x517ec3(++_0x368b6b);}(_0x8f74,0x126));var _0x48f7=function(_0x4d8b94,_0x2621c8){_0x4d8b94=_0x4d8b94-0x0;var _0x32696f=_0x8f74[_0x4d8b94];return _0x32696f;};'use strict';var _=require(_0x48f7('0x0'));var util=require(_0x48f7('0x1'));var moment=require(_0x48f7('0x2'));var BPromise=require('bluebird');var rs=require(_0x48f7('0x3'));var fs=require('fs');var Redis=require(_0x48f7('0x4'));var db=require(_0x48f7('0x5'))['db'];var utils=require(_0x48f7('0x6'));var logger=require(_0x48f7('0x7'))(_0x48f7('0x8'));var config=require(_0x48f7('0x9'));var jayson=require(_0x48f7('0xa'));var client=jayson[_0x48f7('0xb')][_0x48f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x635c64,_0x52406b,_0x55b5a3){return new BPromise(function(_0x409454,_0x3790f9){return client[_0x48f7('0xd')](_0x635c64,_0x55b5a3)[_0x48f7('0xe')](function(_0x1ce256){logger['info'](_0x48f7('0xf'),_0x52406b,_0x48f7('0x10'));logger[_0x48f7('0x11')](_0x48f7('0x12'),_0x52406b,_0x48f7('0x10'),JSON[_0x48f7('0x13')](_0x1ce256));if(_0x1ce256[_0x48f7('0x14')]){if(_0x1ce256[_0x48f7('0x14')][_0x48f7('0x15')]===0x1f4){logger[_0x48f7('0x14')](_0x48f7('0xf'),_0x52406b,_0x1ce256[_0x48f7('0x14')][_0x48f7('0x16')]);return _0x3790f9(_0x1ce256[_0x48f7('0x14')][_0x48f7('0x16')]);}logger['error'](_0x48f7('0xf'),_0x52406b,_0x1ce256[_0x48f7('0x14')][_0x48f7('0x16')]);return _0x409454(_0x1ce256['error'][_0x48f7('0x16')]);}else{logger[_0x48f7('0x17')](_0x48f7('0xf'),_0x52406b,_0x48f7('0x10'));_0x409454(_0x1ce256[_0x48f7('0x18')][_0x48f7('0x16')]);}})[_0x48f7('0x19')](function(_0x4cfdd5){logger['error'](_0x48f7('0xf'),_0x52406b,_0x4cfdd5);_0x3790f9(_0x4cfdd5);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7111a96..8d9e2a5 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1edddd,_0x41df40){var _0x4d91c1=function(_0x5e193e){while(--_0x5e193e){_0x1edddd['push'](_0x1edddd['shift']());}};_0x4d91c1(++_0x41df40);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xcb91[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x31f581,_0x1467e8){var _0x1349c5=function(_0x3cd4eb){while(--_0x3cd4eb){_0x31f581['push'](_0x31f581['shift']());}};_0x1349c5(++_0x1467e8);}(_0x70e0,0x17b));var _0x070e=function(_0x4e7642,_0x401ae8){_0x4e7642=_0x4e7642-0x0;var _0x330cd2=_0x70e0[_0x4e7642];return _0x330cd2;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 8fd5bc0..932969e 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 _0x57e6=['sequelize','exports','INTEGER','STRING'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0x57e6,0x1d8));var _0x657e=function(_0x3f553b,_0x49a9c2){_0x3f553b=_0x3f553b-0x0;var _0x183c4e=_0x57e6[_0x3f553b];return _0x183c4e;};'use strict';var Sequelize=require(_0x657e('0x0'));module[_0x657e('0x1')]={'penalty':{'type':Sequelize[_0x657e('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x657e('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x657e('0x3')]}}; \ No newline at end of file +var _0xf772=['sequelize','INTEGER','STRING'];(function(_0x5be7a8,_0x136921){var _0x58ebee=function(_0x50737e){while(--_0x50737e){_0x5be7a8['push'](_0x5be7a8['shift']());}};_0x58ebee(++_0x136921);}(_0xf772,0x18c));var _0x2f77=function(_0x138bea,_0x4d86d8){_0x138bea=_0x138bea-0x0;var _0x2c139d=_0xf772[_0x138bea];return _0x2c139d;};'use strict';var Sequelize=require(_0x2f77('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2f77('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2f77('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2856d0d..658a073 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 _0x464d=['lodash','../../config/logger','moment','bluebird','request-promise','path','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x229be,_0x5cb1a3){var _0x41f2a4=function(_0x3f8a81){while(--_0x3f8a81){_0x229be['push'](_0x229be['shift']());}};_0x41f2a4(++_0x5cb1a3);}(_0x464d,0x15f));var _0xd464=function(_0x25c8d6,_0x43c68c){_0x25c8d6=_0x25c8d6-0x0;var _0x410921=_0x464d[_0x25c8d6];return _0x410921;};'use strict';var _=require(_0xd464('0x0'));var util=require('util');var logger=require(_0xd464('0x1'))('api');var moment=require(_0xd464('0x2'));var BPromise=require(_0xd464('0x3'));var rp=require(_0xd464('0x4'));var fs=require('fs');var path=require(_0xd464('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd464('0x6'));module['exports']=function(_0x255a69,_0x453fac){return _0x255a69[_0xd464('0x7')](_0xd464('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f12=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util'];(function(_0x32c5b1,_0x56c82a){var _0x581b03=function(_0x18ab53){while(--_0x18ab53){_0x32c5b1['push'](_0x32c5b1['shift']());}};_0x581b03(++_0x56c82a);}(_0x4f12,0x102));var _0x24f1=function(_0x26cab7,_0x1ccfca){_0x26cab7=_0x26cab7-0x0;var _0x31ba06=_0x4f12[_0x26cab7];return _0x31ba06;};'use strict';var _=require(_0x24f1('0x0'));var util=require(_0x24f1('0x1'));var logger=require(_0x24f1('0x2'))(_0x24f1('0x3'));var moment=require(_0x24f1('0x4'));var BPromise=require('bluebird');var rp=require(_0x24f1('0x5'));var fs=require('fs');var path=require(_0x24f1('0x6'));var rimraf=require(_0x24f1('0x7'));var config=require(_0x24f1('0x8'));var attributes=require(_0x24f1('0x9'));module[_0x24f1('0xa')]=function(_0x4c5af1,_0x267914){return _0x4c5af1[_0x24f1('0xb')]('UserFaxQueue',attributes,{'tableName':_0x24f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index e682f37..6451425 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 _0x9f6c=['message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x206498,_0x2fe953){var _0x54a0d0=function(_0x7e0d71){while(--_0x7e0d71){_0x206498['push'](_0x206498['shift']());}};_0x54a0d0(++_0x2fe953);}(_0x9f6c,0xf2));var _0xc9f6=function(_0x258d88,_0x361f24){_0x258d88=_0x258d88-0x0;var _0x219256=_0x9f6c[_0x258d88];return _0x219256;};'use strict';var _=require(_0xc9f6('0x0'));var util=require('util');var moment=require(_0xc9f6('0x1'));var BPromise=require(_0xc9f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9f6('0x3'));var db=require(_0xc9f6('0x4'))['db'];var utils=require(_0xc9f6('0x5'));var logger=require(_0xc9f6('0x6'))(_0xc9f6('0x7'));var config=require(_0xc9f6('0x8'));var jayson=require(_0xc9f6('0x9'));var client=jayson[_0xc9f6('0xa')][_0xc9f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x243739,_0xd8e4d0,_0x251351){return new BPromise(function(_0x25553c,_0x5ca839){return client[_0xc9f6('0xc')](_0x243739,_0x251351)[_0xc9f6('0xd')](function(_0x25ec5b){logger[_0xc9f6('0xe')](_0xc9f6('0xf'),_0xd8e4d0,_0xc9f6('0x10'));logger[_0xc9f6('0x11')](_0xc9f6('0x12'),_0xd8e4d0,_0xc9f6('0x10'),JSON[_0xc9f6('0x13')](_0x25ec5b));if(_0x25ec5b[_0xc9f6('0x14')]){if(_0x25ec5b[_0xc9f6('0x14')][_0xc9f6('0x15')]===0x1f4){logger[_0xc9f6('0x14')](_0xc9f6('0xf'),_0xd8e4d0,_0x25ec5b[_0xc9f6('0x14')][_0xc9f6('0x16')]);return _0x5ca839(_0x25ec5b[_0xc9f6('0x14')][_0xc9f6('0x16')]);}logger['error'](_0xc9f6('0xf'),_0xd8e4d0,_0x25ec5b[_0xc9f6('0x14')][_0xc9f6('0x16')]);return _0x25553c(_0x25ec5b[_0xc9f6('0x14')][_0xc9f6('0x16')]);}else{logger['info'](_0xc9f6('0xf'),_0xd8e4d0,_0xc9f6('0x10'));_0x25553c(_0x25ec5b['result']['message']);}})[_0xc9f6('0x17')](function(_0x50cf41){logger[_0xc9f6('0x14')](_0xc9f6('0xf'),_0xd8e4d0,_0x50cf41);_0x5ca839(_0x50cf41);});});} \ No newline at end of file +var _0x4f02=['error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0x4f02,0x82));var _0x24f0=function(_0x15010c,_0x109be0){_0x15010c=_0x15010c-0x0;var _0x481c3b=_0x4f02[_0x15010c];return _0x481c3b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x24f0('0x0'));var rs=require(_0x24f0('0x1'));var fs=require('fs');var Redis=require(_0x24f0('0x2'));var db=require(_0x24f0('0x3'))['db'];var utils=require(_0x24f0('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x24f0('0x5'));var jayson=require(_0x24f0('0x6'));var client=jayson['client'][_0x24f0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b1091,_0x3a52f5,_0x8645){return new BPromise(function(_0x22c332,_0x3132e6){return client[_0x24f0('0x8')](_0x2b1091,_0x8645)['then'](function(_0x5da72d){logger[_0x24f0('0x9')](_0x24f0('0xa'),_0x3a52f5,_0x24f0('0xb'));logger[_0x24f0('0xc')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x3a52f5,'request\x20sent',JSON[_0x24f0('0xd')](_0x5da72d));if(_0x5da72d[_0x24f0('0xe')]){if(_0x5da72d['error'][_0x24f0('0xf')]===0x1f4){logger[_0x24f0('0xe')](_0x24f0('0xa'),_0x3a52f5,_0x5da72d['error'][_0x24f0('0x10')]);return _0x3132e6(_0x5da72d[_0x24f0('0xe')][_0x24f0('0x10')]);}logger[_0x24f0('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x3a52f5,_0x5da72d[_0x24f0('0xe')][_0x24f0('0x10')]);return _0x22c332(_0x5da72d[_0x24f0('0xe')][_0x24f0('0x10')]);}else{logger['info'](_0x24f0('0xa'),_0x3a52f5,_0x24f0('0xb'));_0x22c332(_0x5da72d['result']['message']);}})[_0x24f0('0x11')](function(_0xe03d0d){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x3a52f5,_0xe03d0d);_0x3132e6(_0xe03d0d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index a9e4495..cd636b6 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1967de,_0x5b7be2){var _0x50c88c=function(_0xe1f47c){while(--_0xe1f47c){_0x1967de['push'](_0x1967de['shift']());}};_0x50c88c(++_0x5b7be2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0xcb91[_0x305c31];return _0x17f39f;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 6bc11a9..eb52235 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 _0x6cf2=['exports','INTEGER'];(function(_0x5eac2a,_0x49477d){var _0x50a1e4=function(_0x19d965){while(--_0x19d965){_0x5eac2a['push'](_0x5eac2a['shift']());}};_0x50a1e4(++_0x49477d);}(_0x6cf2,0x7c));var _0x26cf=function(_0x42cca2,_0x2b33cc){_0x42cca2=_0x42cca2-0x0;var _0x171c28=_0x6cf2[_0x42cca2];return _0x171c28;};'use strict';var Sequelize=require('sequelize');module[_0x26cf('0x0')]={'penalty':{'type':Sequelize[_0x26cf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f1c=['sequelize'];(function(_0xf96d8f,_0x2cc4c3){var _0x237b6b=function(_0xf1386c){while(--_0xf1386c){_0xf96d8f['push'](_0xf96d8f['shift']());}};_0x237b6b(++_0x2cc4c3);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x120dd0,_0x523230){_0x120dd0=_0x120dd0-0x0;var _0x22bf27=_0x3f1c[_0x120dd0];return _0x22bf27;};'use strict';var Sequelize=require(_0xc3f1('0x0'));module['exports']={'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 3693735..8dfe113 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 _0x8f8e=['exports','define','lodash','util','../../config/logger','api','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x2f05a2,_0x3e9ce4){var _0x25512d=function(_0x4a7d3e){while(--_0x4a7d3e){_0x2f05a2['push'](_0x2f05a2['shift']());}};_0x25512d(++_0x3e9ce4);}(_0x8f8e,0x65));var _0xe8f8=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x8f8e[_0x5de532];return _0x4e9192;};'use strict';var _=require(_0xe8f8('0x0'));var util=require(_0xe8f8('0x1'));var logger=require(_0xe8f8('0x2'))(_0xe8f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8f8('0x4'));var config=require(_0xe8f8('0x5'));var attributes=require(_0xe8f8('0x6'));module[_0xe8f8('0x7')]=function(_0xc57717,_0x49b2fe){return _0xc57717[_0xe8f8('0x8')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4524=['bluebird','request-promise','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x2a0c97,_0x3e0a91){var _0x56e5e2=function(_0x249e08){while(--_0x249e08){_0x2a0c97['push'](_0x2a0c97['shift']());}};_0x56e5e2(++_0x3e0a91);}(_0x4524,0xef));var _0x4452=function(_0x33a9aa,_0x6e72f5){_0x33a9aa=_0x33a9aa-0x0;var _0xc0a26f=_0x4524[_0x33a9aa];return _0xc0a26f;};'use strict';var _=require(_0x4452('0x0'));var util=require(_0x4452('0x1'));var logger=require(_0x4452('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4452('0x3'));var rp=require(_0x4452('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4452('0x5'));var config=require('../../config/environment');var attributes=require(_0x4452('0x6'));module[_0x4452('0x7')]=function(_0x218d40,_0x53a9d9){return _0x218d40[_0x4452('0x8')](_0x4452('0x9'),attributes,{'tableName':_0x4452('0xa'),'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 3a3451b..49f49e0 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x40e1cc,_0x2409ed){var _0x329141=function(_0x58603b){while(--_0x58603b){_0x40e1cc['push'](_0x40e1cc['shift']());}};_0x329141(++_0x2409ed);}(_0x3e74,0x175));var _0x43e7=function(_0x374fb1,_0x351d65){_0x374fb1=_0x374fb1-0x0;var _0x38d234=_0x3e74[_0x374fb1];return _0x38d234;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ 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','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb2946c,_0x1dce74){var _0x3ed01c=function(_0x3b244e){while(--_0x3b244e){_0xb2946c['push'](_0xb2946c['shift']());}};_0x3ed01c(++_0x1dce74);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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']('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index c4f24c9..2c35971 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 _0x572c=['../../config/environment','./userNotification.controller','post','isAuthenticated','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46fa79,_0x3664f9){var _0x2cffb9=function(_0x56812e){while(--_0x56812e){_0x46fa79['push'](_0x46fa79['shift']());}};_0x2cffb9(++_0x3664f9);}(_0x572c,0x1cd));var _0xc572=function(_0x337b42,_0x54c55d){_0x337b42=_0x337b42-0x0;var _0x1c1598=_0x572c[_0x337b42];return _0x1c1598;};'use strict';var multer=require('multer');var util=require(_0xc572('0x0'));var path=require(_0xc572('0x1'));var timeout=require(_0xc572('0x2'));var express=require(_0xc572('0x3'));var router=express[_0xc572('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc572('0x5'));var interaction=require(_0xc572('0x6'));var config=require(_0xc572('0x7'));var controller=require(_0xc572('0x8'));router[_0xc572('0x9')]('/',auth[_0xc572('0xa')](),controller['sendUserNotification']);module[_0xc572('0xb')]=router; \ No newline at end of file +var _0x14a1=['isAuthenticated','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post'];(function(_0x50653b,_0x565ab3){var _0x446b45=function(_0x280f9f){while(--_0x280f9f){_0x50653b['push'](_0x50653b['shift']());}};_0x446b45(++_0x565ab3);}(_0x14a1,0x18e));var _0x114a=function(_0x50f84a,_0x4623ba){_0x50f84a=_0x50f84a-0x0;var _0x43088c=_0x14a1[_0x50f84a];return _0x43088c;};'use strict';var multer=require(_0x114a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x114a('0x1')]();var fs_extra=require(_0x114a('0x2'));var auth=require(_0x114a('0x3'));var interaction=require(_0x114a('0x4'));var config=require(_0x114a('0x5'));var controller=require('./userNotification.controller');router[_0x114a('0x6')]('/',auth[_0x114a('0x7')](),controller['sendUserNotification']);module[_0x114a('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 263b887..3dac6c2 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 _0xa11c=['exports','TEXT','STRING'];(function(_0x440716,_0xe312f8){var _0x1153f1=function(_0x2d545f){while(--_0x2d545f){_0x440716['push'](_0x440716['shift']());}};_0x1153f1(++_0xe312f8);}(_0xa11c,0x1da));var _0xca11=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa11c[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0xca11('0x0')]={'body':{'type':Sequelize[_0xca11('0x1')]},'senderName':{'type':Sequelize[_0xca11('0x2')]},'recipientsId':{'type':Sequelize[_0xca11('0x1')]},'recipientsDescription':{'type':Sequelize[_0xca11('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xda43=['STRING','sequelize','exports','TEXT'];(function(_0x321533,_0x43fb8f){var _0x33a656=function(_0xcad470){while(--_0xcad470){_0x321533['push'](_0x321533['shift']());}};_0x33a656(++_0x43fb8f);}(_0xda43,0xd9));var _0x3da4=function(_0x1c4b44,_0x2377de){_0x1c4b44=_0x1c4b44-0x0;var _0x10d72b=_0xda43[_0x1c4b44];return _0x10d72b;};'use strict';var Sequelize=require(_0x3da4('0x0'));module[_0x3da4('0x1')]={'body':{'type':Sequelize[_0x3da4('0x2')]},'senderName':{'type':Sequelize[_0x3da4('0x3')]},'recipientsId':{'type':Sequelize[_0x3da4('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index eb2f528..aa9f81f 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 _0xfa73=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','count','set','reject','update','then','destroy','error','name','send','sendUserNotification','body','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','forEach','recipient','emit','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','model','union','ids','queue','Queue','push','flatten','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5a51c1,_0x394c67){var _0x38f5fb=function(_0xa5d3d0){while(--_0xa5d3d0){_0x5a51c1['push'](_0x5a51c1['shift']());}};_0x38f5fb(++_0x394c67);}(_0xfa73,0x171));var _0x3fa7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfa73[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fa7('0x0'));var zipdir=require(_0x3fa7('0x1'));var jsonpatch=require(_0x3fa7('0x2'));var rp=require(_0x3fa7('0x3'));var moment=require(_0x3fa7('0x4'));var BPromise=require(_0x3fa7('0x5'));var Mustache=require(_0x3fa7('0x6'));var util=require(_0x3fa7('0x7'));var path=require(_0x3fa7('0x8'));var sox=require(_0x3fa7('0x9'));var csv=require(_0x3fa7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fa7('0xb'));var _=require(_0x3fa7('0xc'));var squel=require(_0x3fa7('0xd'));var crypto=require(_0x3fa7('0xe'));var jsforce=require(_0x3fa7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3fa7('0xa'));var querystring=require(_0x3fa7('0x10'));var Papa=require(_0x3fa7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3fa7('0x12'));var as=require(_0x3fa7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fa7('0x14'))(_0x3fa7('0x15'));var utils=require(_0x3fa7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3fa7('0x17'));var db=require(_0x3fa7('0x18'))['db'];config[_0x3fa7('0x19')]=_[_0x3fa7('0x1a')](config[_0x3fa7('0x19')],{'host':_0x3fa7('0x1b'),'port':0x18eb});var socket=require(_0x3fa7('0x1c'))(new Redis(config[_0x3fa7('0x19')]));require(_0x3fa7('0x1d'))[_0x3fa7('0x1e')](socket);function respondWithStatusCode(_0x275fb1,_0x1d896c){_0x1d896c=_0x1d896c||0xcc;return function(_0x5ad90b){if(_0x5ad90b){return _0x275fb1[_0x3fa7('0x1f')](_0x1d896c);}return _0x275fb1['status'](_0x1d896c)[_0x3fa7('0x20')]();};}function respondWithResult(_0x241a72,_0xb80932){_0xb80932=_0xb80932||0xc8;return function(_0x3b2f9d){if(_0x3b2f9d){return _0x241a72[_0x3fa7('0x21')](_0xb80932)[_0x3fa7('0x22')](_0x3b2f9d);}};}function respondWithFilteredResult(_0x5c7ae2,_0x316a4e){return function(_0x146f8a){if(_0x146f8a){var _0x1406e0=typeof _0x316a4e[_0x3fa7('0x23')]===_0x3fa7('0x24')&&typeof _0x316a4e['limit']==='undefined';var _0x349cae=_0x146f8a[_0x3fa7('0x25')];var _0x585858=_0x1406e0?0x0:_0x316a4e['offset'];var _0x2839ac=_0x1406e0?_0x146f8a[_0x3fa7('0x25')]:_0x316a4e[_0x3fa7('0x23')]+_0x316a4e['limit'];var _0x2232e2;if(_0x2839ac>=_0x349cae){_0x2839ac=_0x349cae;_0x2232e2=0xc8;}else{_0x2232e2=0xce;}_0x5c7ae2[_0x3fa7('0x21')](_0x2232e2);return _0x5c7ae2[_0x3fa7('0x26')]('Content-Range',_0x585858+'-'+_0x2839ac+'/'+_0x349cae)[_0x3fa7('0x22')](_0x146f8a);}return null;};}function patchUpdates(_0x505c14){return function(_0x17eb36){try{jsonpatch['apply'](_0x17eb36,_0x505c14,!![]);}catch(_0x3c6ee4){return BPromise[_0x3fa7('0x27')](_0x3c6ee4);}return _0x17eb36['save']();};}function saveUpdates(_0x131b8b,_0x2881af){return function(_0xd10298){if(_0xd10298){return _0xd10298[_0x3fa7('0x28')](_0x131b8b)[_0x3fa7('0x29')](function(_0x877edd){return _0x877edd;});}return null;};}function removeEntity(_0x4726e3,_0x5e164e){return function(_0x1cb3e5){if(_0x1cb3e5){return _0x1cb3e5[_0x3fa7('0x2a')]()[_0x3fa7('0x29')](function(){_0x4726e3[_0x3fa7('0x21')](0xcc)[_0x3fa7('0x20')]();});}};}function handleEntityNotFound(_0x19a871,_0x11ef42){return function(_0x3b2d2e){if(!_0x3b2d2e){_0x19a871[_0x3fa7('0x1f')](0x194);}return _0x3b2d2e;};}function handleError(_0x393a0b,_0x2c6ac7){_0x2c6ac7=_0x2c6ac7||0x1f4;return function(_0x3d7a40){logger[_0x3fa7('0x2b')](_0x3d7a40['stack']);if(_0x3d7a40['name']){delete _0x3d7a40[_0x3fa7('0x2c')];}_0x393a0b[_0x3fa7('0x21')](_0x2c6ac7)[_0x3fa7('0x2d')](_0x3d7a40);};}exports[_0x3fa7('0x2e')]=function(_0x2aa476,_0x4306cb,_0x514980){if(!_0x2aa476[_0x3fa7('0x2f')]['hasOwnProperty'](_0x3fa7('0x30'))&&!_0x2aa476['body']['hasOwnProperty']('TemplateId')){throw new db[(_0x3fa7('0x31'))][(_0x3fa7('0x32'))](_0x3fa7('0x33'));}else{if(_0x2aa476[_0x3fa7('0x2f')][_0x3fa7('0x34')](_0x3fa7('0x35'))&&!_0x2aa476[_0x3fa7('0x2f')][_0x3fa7('0x34')](_0x3fa7('0x36'))){throw new db[(_0x3fa7('0x31'))][(_0x3fa7('0x32'))](_0x3fa7('0x37'));}if(!_0x2aa476[_0x3fa7('0x2f')]['hasOwnProperty'](_0x3fa7('0x38'))){throw new db[(_0x3fa7('0x31'))][(_0x3fa7('0x32'))](_0x3fa7('0x39'));}else{try{var _0x15f766=JSON[_0x3fa7('0x3a')](_0x2aa476[_0x3fa7('0x2f')]['recipients']);}catch(_0x49e9b0){logger['error'](_0x49e9b0);throw new db[(_0x3fa7('0x31'))][(_0x3fa7('0x32'))](_0x3fa7('0x3b'));}var _0x6540a8=[_0x3fa7('0x3c'),'faxqueue',_0x3fa7('0x3d'),'openchannelqueue',_0x3fa7('0x3e'),_0x3fa7('0x3f'),_0x3fa7('0x40'),_0x3fa7('0x41'),_0x3fa7('0x42')];if(_[_0x3fa7('0x43')](_0x15f766,function(_0x228f83){return!_[_0x3fa7('0x44')](_0x6540a8,_0x228f83['model'][_0x3fa7('0x45')]());})){throw new db[(_0x3fa7('0x31'))][(_0x3fa7('0x32'))](_0x3fa7('0x46'));}}}var _0x348d2a={};_0x348d2a[_0x3fa7('0x47')]=_0x2aa476['body'][_0x3fa7('0x34')](_0x3fa7('0x47'))?_0x2aa476[_0x3fa7('0x2f')]['senderName']:_0x2aa476['user']['fullname'];_0x348d2a[_0x3fa7('0x48')]=_['isEmpty'](_0x2aa476[_0x3fa7('0x2f')][_0x3fa7('0x48')])?null:_0x2aa476['body'][_0x3fa7('0x48')];_0x348d2a['beep']=_0x2aa476['body'][_0x3fa7('0x49')]||![];_0x348d2a[_0x3fa7('0x4a')]=_0x2aa476[_0x3fa7('0x42')]['id'];return getContent(_0x2aa476[_0x3fa7('0x2f')])[_0x3fa7('0x29')](function(_0x59524d){_0x348d2a[_0x3fa7('0x2f')]=_0x59524d;return getRecipients(_0x15f766);})[_0x3fa7('0x29')](function(_0x310229){_0x348d2a[_0x3fa7('0x4b')]=_[_0x3fa7('0x4c')](_0x310229)[_0x3fa7('0x4d')](',');return db['sequelize']['transaction'](function(_0x3283b8){return db[_0x3fa7('0x4e')][_0x3fa7('0x4f')](_0x348d2a,{'raw':!![],'transaction':_0x3283b8})['then'](function(_0xe847bc){var _0x51560a={'sender':_0x348d2a[_0x3fa7('0x47')],'description':_0x348d2a[_0x3fa7('0x48')],'content':_0x348d2a[_0x3fa7('0x2f')],'beep':_0x348d2a[_0x3fa7('0x49')]};_0x310229[_0x3fa7('0x50')](function(_0x58f7c2){_0x51560a[_0x3fa7('0x51')]=_0x58f7c2;socket[_0x3fa7('0x52')]('userNotification:send',_0x51560a);});return _0xe847bc;});});})[_0x3fa7('0x29')](respondWithResult(_0x4306cb,0xc9))[_0x3fa7('0x53')](handleError(_0x4306cb,null));};function getContent(_0x56cb0f){return new BPromise(function(_0x5409a1,_0x52ed38){if(_0x56cb0f[_0x3fa7('0x30')]){_0x5409a1(_0x56cb0f[_0x3fa7('0x30')]);return;}return db[_0x3fa7('0x54')]['findOne']({'attributes':[_0x3fa7('0x55')],'where':{'id':_0x56cb0f[_0x3fa7('0x35')]},'raw':!![]})[_0x3fa7('0x29')](function(_0x337851){if(!_0x337851)throw new db[(_0x3fa7('0x31'))][(_0x3fa7('0x32'))](_0x3fa7('0x56'));var _0x25fe15=Mustache['render'](_0x337851[_0x3fa7('0x55')],_0x56cb0f[_0x3fa7('0x36')]);_0x5409a1(_0x25fe15);})[_0x3fa7('0x53')](function(_0x8bb0d3){_0x52ed38(_0x8bb0d3);});});}function getRecipients(_0x333625){return new BPromise(function(_0x3a043e,_0x4e8ca0){var _0x5679cd=[];var _0x5a1f30=[];_0x333625[_0x3fa7('0x50')](function(_0x2d2a5f){var _0x165df5=_['startCase'](_0x2d2a5f[_0x3fa7('0x57')][_0x3fa7('0x45')]());if(_0x165df5==='User'){_0x5679cd=_[_0x3fa7('0x58')](_0x5679cd,_0x2d2a5f[_0x3fa7('0x59')]);}else{if(_[_0x3fa7('0x44')](_0x165df5,_0x3fa7('0x5a')))_0x165df5=_0x165df5['replace'](_0x3fa7('0x5a'),_0x3fa7('0x5b'));_0x2d2a5f[_0x3fa7('0x59')][_0x3fa7('0x50')](function(_0x136987){_0x5a1f30[_0x3fa7('0x5c')](getAgents(_0x165df5,_0x136987));});}});return BPromise['all'](_0x5a1f30)[_0x3fa7('0x29')](function(_0xff0615){_0x5679cd=_[_0x3fa7('0x58')](_0x5679cd,_[_0x3fa7('0x5d')](_0xff0615));_0x3a043e(_0x5679cd);})['catch'](function(_0xc69164){_0x4e8ca0(_0xc69164);});});}function getAgents(_0x2d7af7,_0x495ac4){return new BPromise(function(_0x52a460,_0x5bdecf){return db[_0x2d7af7]['findOne']({'where':{'id':_0x495ac4}})[_0x3fa7('0x29')](function(_0x38864b){return _0x38864b['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0xbee402){var _0x51f9d0=_[_0x3fa7('0x5e')](_0xbee402,'id');_0x52a460(_0x51f9d0);});})['catch'](function(_0x59dc81){_0x5bdecf(_0x59dc81);});});} \ No newline at end of file +var _0xa923=['hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','recipient','emit','userNotification:send','catch','Template','findOne','html','forEach','User','ids','queue','replace','push','all','union','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','end','status','json','undefined','offset','set','save','then','destroy','error','name','sendUserNotification','body'];(function(_0x449b6b,_0x1201c2){var _0x21d8c3=function(_0x311f46){while(--_0x311f46){_0x449b6b['push'](_0x449b6b['shift']());}};_0x21d8c3(++_0x1201c2);}(_0xa923,0x148));var _0x3a92=function(_0x530ec8,_0x12ae7f){_0x530ec8=_0x530ec8-0x0;var _0x3edc09=_0xa923[_0x530ec8];return _0x3edc09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a92('0x0'));var zipdir=require(_0x3a92('0x1'));var jsonpatch=require(_0x3a92('0x2'));var rp=require('request-promise');var moment=require(_0x3a92('0x3'));var BPromise=require(_0x3a92('0x4'));var Mustache=require(_0x3a92('0x5'));var util=require(_0x3a92('0x6'));var path=require(_0x3a92('0x7'));var sox=require(_0x3a92('0x8'));var csv=require(_0x3a92('0x9'));var ejs=require(_0x3a92('0xa'));var fs=require('fs');var fs_extra=require(_0x3a92('0xb'));var _=require('lodash');var squel=require(_0x3a92('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a92('0xd'));var deskjs=require(_0x3a92('0xe'));var toCsv=require(_0x3a92('0x9'));var querystring=require(_0x3a92('0xf'));var Papa=require(_0x3a92('0x10'));var Redis=require(_0x3a92('0x11'));var authService=require(_0x3a92('0x12'));var qs=require(_0x3a92('0x13'));var as=require(_0x3a92('0x14'));var hardwareService=require(_0x3a92('0x15'));var logger=require(_0x3a92('0x16'))(_0x3a92('0x17'));var utils=require('../../config/utils');var config=require(_0x3a92('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a92('0x19'))['db'];config[_0x3a92('0x1a')]=_[_0x3a92('0x1b')](config[_0x3a92('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a92('0x1a')]));require(_0x3a92('0x1c'))[_0x3a92('0x1d')](socket);function respondWithStatusCode(_0x32b6c0,_0x525456){_0x525456=_0x525456||0xcc;return function(_0x48f555){if(_0x48f555){return _0x32b6c0[_0x3a92('0x1e')](_0x525456);}return _0x32b6c0['status'](_0x525456)[_0x3a92('0x1f')]();};}function respondWithResult(_0x2b0871,_0x2135ae){_0x2135ae=_0x2135ae||0xc8;return function(_0x44f740){if(_0x44f740){return _0x2b0871[_0x3a92('0x20')](_0x2135ae)[_0x3a92('0x21')](_0x44f740);}};}function respondWithFilteredResult(_0x4b8ca9,_0x48ea11){return function(_0x5a07da){if(_0x5a07da){var _0x5e565e=typeof _0x48ea11['offset']===_0x3a92('0x22')&&typeof _0x48ea11['limit']==='undefined';var _0x595751=_0x5a07da['count'];var _0x344ee0=_0x5e565e?0x0:_0x48ea11[_0x3a92('0x23')];var _0x334ad1=_0x5e565e?_0x5a07da['count']:_0x48ea11[_0x3a92('0x23')]+_0x48ea11['limit'];var _0xa22bf5;if(_0x334ad1>=_0x595751){_0x334ad1=_0x595751;_0xa22bf5=0xc8;}else{_0xa22bf5=0xce;}_0x4b8ca9[_0x3a92('0x20')](_0xa22bf5);return _0x4b8ca9[_0x3a92('0x24')]('Content-Range',_0x344ee0+'-'+_0x334ad1+'/'+_0x595751)['json'](_0x5a07da);}return null;};}function patchUpdates(_0x506c7a){return function(_0x301c0e){try{jsonpatch['apply'](_0x301c0e,_0x506c7a,!![]);}catch(_0x82c158){return BPromise['reject'](_0x82c158);}return _0x301c0e[_0x3a92('0x25')]();};}function saveUpdates(_0x1c2efe,_0x54ec54){return function(_0xa8819d){if(_0xa8819d){return _0xa8819d['update'](_0x1c2efe)[_0x3a92('0x26')](function(_0x18030c){return _0x18030c;});}return null;};}function removeEntity(_0x1de8a4,_0x4dcf23){return function(_0x24c6fd){if(_0x24c6fd){return _0x24c6fd[_0x3a92('0x27')]()[_0x3a92('0x26')](function(){_0x1de8a4[_0x3a92('0x20')](0xcc)[_0x3a92('0x1f')]();});}};}function handleEntityNotFound(_0x21efb8,_0x3f4144){return function(_0x5a0365){if(!_0x5a0365){_0x21efb8[_0x3a92('0x1e')](0x194);}return _0x5a0365;};}function handleError(_0xc22728,_0x9e9b7b){_0x9e9b7b=_0x9e9b7b||0x1f4;return function(_0x2f12e0){logger[_0x3a92('0x28')](_0x2f12e0['stack']);if(_0x2f12e0[_0x3a92('0x29')]){delete _0x2f12e0[_0x3a92('0x29')];}_0xc22728[_0x3a92('0x20')](_0x9e9b7b)['send'](_0x2f12e0);};}exports[_0x3a92('0x2a')]=function(_0x339ce4,_0x252cdf,_0x1ef009){if(!_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x2c')](_0x3a92('0x2d'))&&!_0x339ce4[_0x3a92('0x2b')]['hasOwnProperty'](_0x3a92('0x2e'))){throw new db[(_0x3a92('0x2f'))][(_0x3a92('0x30'))](_0x3a92('0x31'));}else{if(_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x2c')](_0x3a92('0x2e'))&&!_0x339ce4['body'][_0x3a92('0x2c')](_0x3a92('0x32'))){throw new db[(_0x3a92('0x2f'))][(_0x3a92('0x30'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x339ce4['body'][_0x3a92('0x2c')](_0x3a92('0x33'))){throw new db[(_0x3a92('0x2f'))][(_0x3a92('0x30'))](_0x3a92('0x34'));}else{try{var _0x860f5d=JSON[_0x3a92('0x35')](_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x33')]);}catch(_0x35f98e){logger[_0x3a92('0x28')](_0x35f98e);throw new db[(_0x3a92('0x2f'))][(_0x3a92('0x30'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xb58db=[_0x3a92('0x36'),_0x3a92('0x37'),'mailqueue',_0x3a92('0x38'),_0x3a92('0x39'),'voicequeue',_0x3a92('0x3a'),'team',_0x3a92('0x3b')];if(_[_0x3a92('0x3c')](_0x860f5d,function(_0x3f18cc){return!_[_0x3a92('0x3d')](_0xb58db,_0x3f18cc[_0x3a92('0x3e')][_0x3a92('0x3f')]());})){throw new db['Sequelize'][(_0x3a92('0x30'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x28daca={};_0x28daca[_0x3a92('0x40')]=_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x2c')]('senderName')?_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x40')]:_0x339ce4[_0x3a92('0x3b')][_0x3a92('0x41')];_0x28daca[_0x3a92('0x42')]=_[_0x3a92('0x43')](_0x339ce4['body']['recipientsDescription'])?null:_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x42')];_0x28daca[_0x3a92('0x44')]=_0x339ce4[_0x3a92('0x2b')][_0x3a92('0x44')]||![];_0x28daca[_0x3a92('0x45')]=_0x339ce4[_0x3a92('0x3b')]['id'];return getContent(_0x339ce4[_0x3a92('0x2b')])[_0x3a92('0x26')](function(_0x2571ad){_0x28daca[_0x3a92('0x2b')]=_0x2571ad;return getRecipients(_0x860f5d);})['then'](function(_0x1a63ac){_0x28daca[_0x3a92('0x46')]=_[_0x3a92('0x47')](_0x1a63ac)['join'](',');return db[_0x3a92('0x48')][_0x3a92('0x49')](function(_0x49f607){return db[_0x3a92('0x4a')]['create'](_0x28daca,{'raw':!![],'transaction':_0x49f607})[_0x3a92('0x26')](function(_0x3361f6){var _0x187fe4={'sender':_0x28daca[_0x3a92('0x40')],'description':_0x28daca['recipientsDescription'],'content':_0x28daca[_0x3a92('0x2b')],'beep':_0x28daca[_0x3a92('0x44')]};_0x1a63ac['forEach'](function(_0x18b7c9){_0x187fe4[_0x3a92('0x4b')]=_0x18b7c9;socket[_0x3a92('0x4c')](_0x3a92('0x4d'),_0x187fe4);});return _0x3361f6;});});})['then'](respondWithResult(_0x252cdf,0xc9))[_0x3a92('0x4e')](handleError(_0x252cdf,null));};function getContent(_0x2e92bb){return new BPromise(function(_0x4bdf5d,_0x53b7df){if(_0x2e92bb[_0x3a92('0x2d')]){_0x4bdf5d(_0x2e92bb[_0x3a92('0x2d')]);return;}return db[_0x3a92('0x4f')][_0x3a92('0x50')]({'attributes':[_0x3a92('0x51')],'where':{'id':_0x2e92bb[_0x3a92('0x2e')]},'raw':!![]})[_0x3a92('0x26')](function(_0x4b9d1e){if(!_0x4b9d1e)throw new db[(_0x3a92('0x2f'))][(_0x3a92('0x30'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x8f4995=Mustache['render'](_0x4b9d1e[_0x3a92('0x51')],_0x2e92bb['view']);_0x4bdf5d(_0x8f4995);})[_0x3a92('0x4e')](function(_0x3e5662){_0x53b7df(_0x3e5662);});});}function getRecipients(_0x546933){return new BPromise(function(_0x54b124,_0x11d42c){var _0x24f67a=[];var _0x5650d1=[];_0x546933[_0x3a92('0x52')](function(_0x5549d2){var _0x3368c9=_['startCase'](_0x5549d2[_0x3a92('0x3e')]['toLowerCase']());if(_0x3368c9===_0x3a92('0x53')){_0x24f67a=_['union'](_0x24f67a,_0x5549d2[_0x3a92('0x54')]);}else{if(_['includes'](_0x3368c9,_0x3a92('0x55')))_0x3368c9=_0x3368c9[_0x3a92('0x56')](_0x3a92('0x55'),'Queue');_0x5549d2[_0x3a92('0x54')][_0x3a92('0x52')](function(_0x20ad19){_0x5650d1[_0x3a92('0x57')](getAgents(_0x3368c9,_0x20ad19));});}});return BPromise[_0x3a92('0x58')](_0x5650d1)['then'](function(_0x5ce032){_0x24f67a=_[_0x3a92('0x59')](_0x24f67a,_[_0x3a92('0x5a')](_0x5ce032));_0x54b124(_0x24f67a);})['catch'](function(_0x40b982){_0x11d42c(_0x40b982);});});}function getAgents(_0x3add9a,_0x542263){return new BPromise(function(_0x49063c,_0x2d67f2){return db[_0x3add9a]['findOne']({'where':{'id':_0x542263}})[_0x3a92('0x26')](function(_0x1c9a58){return _0x1c9a58[_0x3a92('0x5b')]({'attributes':['id'],'raw':!![]})[_0x3a92('0x26')](function(_0x2d6a41){var _0x4accdb=_[_0x3a92('0x5c')](_0x2d6a41,'id');_0x49063c(_0x4accdb);});})[_0x3a92('0x4e')](function(_0x24452a){_0x2d67f2(_0x24452a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 83a8adf..e9e65d9 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 _0x2415=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2415,0xb1));var _0x5241=function(_0x28aab3,_0x5b3604){_0x28aab3=_0x28aab3-0x0;var _0x54bf54=_0x2415[_0x28aab3];return _0x54bf54;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x5241('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5241('0x1')](0x0);var events={'afterCreate':_0x5241('0x2'),'afterUpdate':'update','afterDestroy':_0x5241('0x3')};function emitEvent(_0x8acb1d){return function(_0x925315,_0x507120,_0x38e23b){UserNotificationEvents[_0x5241('0x4')](_0x8acb1d+':'+_0x925315['id'],_0x925315);UserNotificationEvents[_0x5241('0x4')](_0x8acb1d,_0x925315);_0x38e23b(null);};}for(var e in events){if(events[_0x5241('0x5')](e)){var event=events[e];UserNotification[_0x5241('0x6')](e,emitEvent(event));}}module[_0x5241('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xf3c8=['update','emit','hasOwnProperty','hook','setMaxListeners','save'];(function(_0x100a3c,_0x56f6b9){var _0x27f991=function(_0x5a7dbf){while(--_0x5a7dbf){_0x100a3c['push'](_0x100a3c['shift']());}};_0x27f991(++_0x56f6b9);}(_0xf3c8,0x76));var _0x8f3c=function(_0x5f3525,_0x1f613f){_0x5f3525=_0x5f3525-0x0;var _0x203efd=_0xf3c8[_0x5f3525];return _0x203efd;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8f3c('0x0')](0x0);var events={'afterCreate':_0x8f3c('0x1'),'afterUpdate':_0x8f3c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4d4848){return function(_0xb54cab,_0x312469,_0x1a000d){UserNotificationEvents[_0x8f3c('0x3')](_0x4d4848+':'+_0xb54cab['id'],_0xb54cab);UserNotificationEvents[_0x8f3c('0x3')](_0x4d4848,_0xb54cab);_0x1a000d(null);};}for(var e in events){if(events[_0x8f3c('0x4')](e)){var event=events[e];UserNotification[_0x8f3c('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 9174e6b..974e3e3 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 _0x7af2=['utf8mb4','util','../../config/logger','moment','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7af2,0x169));var _0x27af=function(_0xf8baeb,_0x4c83e8){_0xf8baeb=_0xf8baeb-0x0;var _0x5997a4=_0x7af2[_0xf8baeb];return _0x5997a4;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))('api');var moment=require(_0x27af('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x27af('0x3'));var config=require(_0x27af('0x4'));var attributes=require(_0x27af('0x5'));module[_0x27af('0x6')]=function(_0x5561d4,_0x20a3df){return _0x5561d4['define'](_0x27af('0x7'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27af('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5cc1=['./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x172feb,_0x4bb62f){var _0x5341af=function(_0x33392e){while(--_0x33392e){_0x172feb['push'](_0x172feb['shift']());}};_0x5341af(++_0x4bb62f);}(_0x5cc1,0xf5));var _0x15cc=function(_0x3c4adf,_0x958338){_0x3c4adf=_0x3c4adf-0x0;var _0x165a3b=_0x5cc1[_0x3c4adf];return _0x165a3b;};'use strict';var _=require('lodash');var util=require(_0x15cc('0x0'));var logger=require(_0x15cc('0x1'))(_0x15cc('0x2'));var moment=require(_0x15cc('0x3'));var BPromise=require(_0x15cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15cc('0x5'));var rimraf=require(_0x15cc('0x6'));var config=require('../../config/environment');var attributes=require(_0x15cc('0x7'));module[_0x15cc('0x8')]=function(_0x16f49c,_0x581c95){return _0x16f49c[_0x15cc('0x9')](_0x15cc('0xa'),attributes,{'tableName':_0x15cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x15cc('0xc'),'collate':_0x15cc('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index c463324..1c98b5a 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 _0x67ab=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','UserNotification,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x451014,_0x286211){var _0x1a4e45=function(_0x4fdc59){while(--_0x4fdc59){_0x451014['push'](_0x451014['shift']());}};_0x1a4e45(++_0x286211);}(_0x67ab,0xd3));var _0xb67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ab[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb67a('0x0'));var util=require(_0xb67a('0x1'));var moment=require(_0xb67a('0x2'));var BPromise=require('bluebird');var rs=require(_0xb67a('0x3'));var fs=require('fs');var Redis=require(_0xb67a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb67a('0x5'));var logger=require(_0xb67a('0x6'))(_0xb67a('0x7'));var config=require(_0xb67a('0x8'));var jayson=require(_0xb67a('0x9'));var client=jayson[_0xb67a('0xa')][_0xb67a('0xb')]({'port':0x232a});config[_0xb67a('0xc')]=_[_0xb67a('0xd')](config[_0xb67a('0xc')],{'host':_0xb67a('0xe'),'port':0x18eb});var socket=require(_0xb67a('0xf'))(new Redis(config[_0xb67a('0xc')]));require(_0xb67a('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e1920,_0x4775fa,_0x365160){return new BPromise(function(_0x2b1e4c,_0x5960a8){return client[_0xb67a('0x11')](_0x3e1920,_0x365160)[_0xb67a('0x12')](function(_0x249ed6){logger[_0xb67a('0x13')]('UserNotification,\x20%s,\x20%s',_0x4775fa,_0xb67a('0x14'));logger[_0xb67a('0x15')](_0xb67a('0x16'),_0x4775fa,_0xb67a('0x14'),JSON['stringify'](_0x249ed6));if(_0x249ed6[_0xb67a('0x17')]){if(_0x249ed6[_0xb67a('0x17')]['code']===0x1f4){logger[_0xb67a('0x17')](_0xb67a('0x18'),_0x4775fa,_0x249ed6[_0xb67a('0x17')][_0xb67a('0x19')]);return _0x5960a8(_0x249ed6['error'][_0xb67a('0x19')]);}logger[_0xb67a('0x17')](_0xb67a('0x18'),_0x4775fa,_0x249ed6[_0xb67a('0x17')][_0xb67a('0x19')]);return _0x2b1e4c(_0x249ed6[_0xb67a('0x17')][_0xb67a('0x19')]);}else{logger[_0xb67a('0x13')]('UserNotification,\x20%s,\x20%s',_0x4775fa,_0xb67a('0x14'));_0x2b1e4c(_0x249ed6[_0xb67a('0x1a')][_0xb67a('0x19')]);}})['catch'](function(_0x258a61){logger[_0xb67a('0x17')](_0xb67a('0x18'),_0x4775fa,_0x258a61);_0x5960a8(_0x258a61);});});} \ No newline at end of file +var _0x1702=['info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then'];(function(_0x597646,_0x3b7fa5){var _0x3d2ee8=function(_0x8fe622){while(--_0x8fe622){_0x597646['push'](_0x597646['shift']());}};_0x3d2ee8(++_0x3b7fa5);}(_0x1702,0x8a));var _0x2170=function(_0x25b2ff,_0x3d6e20){_0x25b2ff=_0x25b2ff-0x0;var _0x2c4b56=_0x1702[_0x25b2ff];return _0x2c4b56;};'use strict';var _=require(_0x2170('0x0'));var util=require(_0x2170('0x1'));var moment=require('moment');var BPromise=require(_0x2170('0x2'));var rs=require(_0x2170('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2170('0x4'))['db'];var utils=require(_0x2170('0x5'));var logger=require('../../config/logger')(_0x2170('0x6'));var config=require(_0x2170('0x7'));var jayson=require(_0x2170('0x8'));var client=jayson[_0x2170('0x9')][_0x2170('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2170('0xb')],{'host':_0x2170('0xc'),'port':0x18eb});var socket=require(_0x2170('0xd'))(new Redis(config[_0x2170('0xb')]));require(_0x2170('0xe'))[_0x2170('0xf')](socket);function respondWithRpcPromise(_0x446601,_0x4e8f08,_0x948308){return new BPromise(function(_0x246f60,_0x59b79c){return client[_0x2170('0x10')](_0x446601,_0x948308)[_0x2170('0x11')](function(_0x1e9ba8){logger[_0x2170('0x12')](_0x2170('0x13'),_0x4e8f08,_0x2170('0x14'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x4e8f08,_0x2170('0x14'),JSON[_0x2170('0x15')](_0x1e9ba8));if(_0x1e9ba8[_0x2170('0x16')]){if(_0x1e9ba8[_0x2170('0x16')]['code']===0x1f4){logger[_0x2170('0x16')]('UserNotification,\x20%s,\x20%s',_0x4e8f08,_0x1e9ba8[_0x2170('0x16')][_0x2170('0x17')]);return _0x59b79c(_0x1e9ba8[_0x2170('0x16')][_0x2170('0x17')]);}logger[_0x2170('0x16')](_0x2170('0x13'),_0x4e8f08,_0x1e9ba8[_0x2170('0x16')][_0x2170('0x17')]);return _0x246f60(_0x1e9ba8['error'][_0x2170('0x17')]);}else{logger[_0x2170('0x12')](_0x2170('0x13'),_0x4e8f08,_0x2170('0x14'));_0x246f60(_0x1e9ba8[_0x2170('0x18')]['message']);}})[_0x2170('0x19')](function(_0x1fb736){logger[_0x2170('0x16')](_0x2170('0x13'),_0x4e8f08,_0x1fb736);_0x59b79c(_0x1fb736);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 054c184..a60f70a 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 _0x5caf=['save','remove','emit','register','userNotification:','./userNotification.events'];(function(_0x1458a8,_0x55e7a8){var _0x54ddf8=function(_0x2bdd12){while(--_0x2bdd12){_0x1458a8['push'](_0x1458a8['shift']());}};_0x54ddf8(++_0x55e7a8);}(_0x5caf,0x149));var _0xf5ca=function(_0x4560ed,_0x13e906){_0x4560ed=_0x4560ed-0x0;var _0xd768d9=_0x5caf[_0x4560ed];return _0xd768d9;};'use strict';var UserNotificationEvents=require(_0xf5ca('0x0'));var events=[_0xf5ca('0x1'),_0xf5ca('0x2'),'update'];function createListener(_0x35cc53,_0xbce715){return function(_0x21b1c9){_0xbce715[_0xf5ca('0x3')](_0x35cc53,_0x21b1c9);};}function removeListener(_0x42cb7e,_0x521e9b){return function(){UserNotificationEvents['removeListener'](_0x42cb7e,_0x521e9b);};}exports[_0xf5ca('0x4')]=function(_0x4c0da8){for(var _0xaf6258=0x0,_0x5a38c9=events['length'];_0xaf6258<_0x5a38c9;_0xaf6258++){var _0x163ab3=events[_0xaf6258];var _0x3921e7=createListener(_0xf5ca('0x5')+_0x163ab3,_0x4c0da8);UserNotificationEvents['on'](_0x163ab3,_0x3921e7);}}; \ No newline at end of file +var _0x559b=['length','save','remove','update'];(function(_0x515e2b,_0xb4a2b5){var _0xc74bef=function(_0x43d02b){while(--_0x43d02b){_0x515e2b['push'](_0x515e2b['shift']());}};_0xc74bef(++_0xb4a2b5);}(_0x559b,0x17d));var _0xb559=function(_0x3f4600,_0x4845eb){_0x3f4600=_0x3f4600-0x0;var _0x34cf20=_0x559b[_0x3f4600];return _0x34cf20;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xb559('0x0'),_0xb559('0x1'),_0xb559('0x2')];function createListener(_0x309fe8,_0xaf07fc){return function(_0x43a254){_0xaf07fc['emit'](_0x309fe8,_0x43a254);};}function removeListener(_0x542d0c,_0x31fa5d){return function(){UserNotificationEvents['removeListener'](_0x542d0c,_0x31fa5d);};}exports['register']=function(_0xd3a0e){for(var _0x2e3aad=0x0,_0x3f9e59=events[_0xb559('0x3')];_0x2e3aad<_0x3f9e59;_0x2e3aad++){var _0x2f6d44=events[_0x2e3aad];var _0x519ec0=createListener('userNotification:'+_0x2f6d44,_0xd3a0e);UserNotificationEvents['on'](_0x2f6d44,_0x519ec0);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 4838073..cd1fc17 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2c37d7,_0x30cf12){var _0x27f9ac=function(_0x2b9a08){while(--_0x2b9a08){_0x2c37d7['push'](_0x2c37d7['shift']());}};_0x27f9ac(++_0x30cf12);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xcb91[_0x3f2d02];return _0x54092b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x34c6be,_0x5648bc){var _0x22006f=function(_0x3a0282){while(--_0x3a0282){_0x34c6be['push'](_0x34c6be['shift']());}};_0x22006f(++_0x5648bc);}(_0x70e0,0x17b));var _0x070e=function(_0x3843c5,_0xd1aff1){_0x3843c5=_0x3843c5-0x0;var _0x2bba6f=_0x70e0[_0x3843c5];return _0x2bba6f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 7d54d89..8b685e4 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 _0xb9b3=['sequelize','exports'];(function(_0x439791,_0x3390da){var _0x22fb04=function(_0x1a7c82){while(--_0x1a7c82){_0x439791['push'](_0x439791['shift']());}};_0x22fb04(++_0x3390da);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x17df1b,_0x4cf1d7){_0x17df1b=_0x17df1b-0x0;var _0x297263=_0xb9b3[_0x17df1b];return _0x297263;};'use strict';var Sequelize=require(_0x3b9b('0x0'));module[_0x3b9b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ad5=['INTEGER','sequelize'];(function(_0x2e3ec2,_0x10a7cf){var _0x1e4363=function(_0x4cf5fb){while(--_0x4cf5fb){_0x2e3ec2['push'](_0x2e3ec2['shift']());}};_0x1e4363(++_0x10a7cf);}(_0x3ad5,0x151));var _0x53ad=function(_0x4118ab,_0x25759d){_0x4118ab=_0x4118ab-0x0;var _0x5a0c8c=_0x3ad5[_0x4118ab];return _0x5a0c8c;};'use strict';var Sequelize=require(_0x53ad('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x53ad('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 ec2605d..a9d81e9 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 _0xfeb4=['util','moment','request-promise','path','rimraf','../../config/environment','exports','define','user_has_openchannel_queues','lodash'];(function(_0x314bab,_0x25ff79){var _0x438936=function(_0x27c261){while(--_0x27c261){_0x314bab['push'](_0x314bab['shift']());}};_0x438936(++_0x25ff79);}(_0xfeb4,0x18f));var _0x4feb=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xfeb4[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x4feb('0x0'));var util=require(_0x4feb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4feb('0x2'));var BPromise=require('bluebird');var rp=require(_0x4feb('0x3'));var fs=require('fs');var path=require(_0x4feb('0x4'));var rimraf=require(_0x4feb('0x5'));var config=require(_0x4feb('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x4feb('0x7')]=function(_0x4872d1,_0x3cf316){return _0x4872d1[_0x4feb('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0x4feb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35c2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x42b4b4,_0x145ed9){var _0xc3d5ff=function(_0x2e0ea7){while(--_0x2e0ea7){_0x42b4b4['push'](_0x42b4b4['shift']());}};_0xc3d5ff(++_0x145ed9);}(_0x35c2,0x1ad));var _0x235c=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x35c2[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x235c('0x0'));var util=require(_0x235c('0x1'));var logger=require(_0x235c('0x2'))(_0x235c('0x3'));var moment=require('moment');var BPromise=require(_0x235c('0x4'));var rp=require(_0x235c('0x5'));var fs=require('fs');var path=require(_0x235c('0x6'));var rimraf=require(_0x235c('0x7'));var config=require('../../config/environment');var attributes=require(_0x235c('0x8'));module['exports']=function(_0x4aefac,_0x75edaf){return _0x4aefac['define'](_0x235c('0x9'),attributes,{'tableName':_0x235c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index d2e65f4..34c052c 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 _0x47ef=['../../config/utils','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x47ef,0x6e));var _0xf47e=function(_0x26510d,_0x268ca8){_0x26510d=_0x26510d-0x0;var _0x316d42=_0x47ef[_0x26510d];return _0x316d42;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf47e('0x0'));var BPromise=require(_0xf47e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf47e('0x2'));var db=require(_0xf47e('0x3'))['db'];var utils=require(_0xf47e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf47e('0x5'));var jayson=require(_0xf47e('0x6'));var client=jayson[_0xf47e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x285cec,_0x4b6722,_0xf37f1){return new BPromise(function(_0x303fa0,_0x3d99fb){return client[_0xf47e('0x8')](_0x285cec,_0xf37f1)['then'](function(_0x2aba14){logger[_0xf47e('0x9')](_0xf47e('0xa'),_0x4b6722,_0xf47e('0xb'));logger[_0xf47e('0xc')](_0xf47e('0xd'),_0x4b6722,_0xf47e('0xb'),JSON[_0xf47e('0xe')](_0x2aba14));if(_0x2aba14[_0xf47e('0xf')]){if(_0x2aba14['error'][_0xf47e('0x10')]===0x1f4){logger['error'](_0xf47e('0xa'),_0x4b6722,_0x2aba14[_0xf47e('0xf')][_0xf47e('0x11')]);return _0x3d99fb(_0x2aba14[_0xf47e('0xf')]['message']);}logger[_0xf47e('0xf')](_0xf47e('0xa'),_0x4b6722,_0x2aba14[_0xf47e('0xf')]['message']);return _0x303fa0(_0x2aba14[_0xf47e('0xf')][_0xf47e('0x11')]);}else{logger[_0xf47e('0x9')](_0xf47e('0xa'),_0x4b6722,_0xf47e('0xb'));_0x303fa0(_0x2aba14['result'][_0xf47e('0x11')]);}})[_0xf47e('0x12')](function(_0x53f23a){logger[_0xf47e('0xf')](_0xf47e('0xa'),_0x4b6722,_0x53f23a);_0x3d99fb(_0x53f23a);});});} \ No newline at end of file +var _0xb718=['http','info','request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x124325,_0x40d0c7){var _0x2d0006=function(_0x137af9){while(--_0x137af9){_0x124325['push'](_0x124325['shift']());}};_0x2d0006(++_0x40d0c7);}(_0xb718,0x1ee));var _0x8b71=function(_0x5c2f5c,_0x2632d7){_0x5c2f5c=_0x5c2f5c-0x0;var _0x230e26=_0xb718[_0x5c2f5c];return _0x230e26;};'use strict';var _=require(_0x8b71('0x0'));var util=require(_0x8b71('0x1'));var moment=require(_0x8b71('0x2'));var BPromise=require(_0x8b71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b71('0x4'));var db=require(_0x8b71('0x5'))['db'];var utils=require(_0x8b71('0x6'));var logger=require(_0x8b71('0x7'))('rpc');var config=require(_0x8b71('0x8'));var jayson=require(_0x8b71('0x9'));var client=jayson['client'][_0x8b71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31dd76,_0x28ceb5,_0x1849b6){return new BPromise(function(_0x3e0f18,_0x27f57a){return client['request'](_0x31dd76,_0x1849b6)['then'](function(_0x21a25f){logger[_0x8b71('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x28ceb5,_0x8b71('0xc'));logger[_0x8b71('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x28ceb5,'request\x20sent',JSON[_0x8b71('0xe')](_0x21a25f));if(_0x21a25f[_0x8b71('0xf')]){if(_0x21a25f[_0x8b71('0xf')][_0x8b71('0x10')]===0x1f4){logger[_0x8b71('0xf')](_0x8b71('0x11'),_0x28ceb5,_0x21a25f[_0x8b71('0xf')][_0x8b71('0x12')]);return _0x27f57a(_0x21a25f[_0x8b71('0xf')][_0x8b71('0x12')]);}logger[_0x8b71('0xf')](_0x8b71('0x11'),_0x28ceb5,_0x21a25f[_0x8b71('0xf')][_0x8b71('0x12')]);return _0x3e0f18(_0x21a25f[_0x8b71('0xf')][_0x8b71('0x12')]);}else{logger[_0x8b71('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x28ceb5,'request\x20sent');_0x3e0f18(_0x21a25f[_0x8b71('0x13')][_0x8b71('0x12')]);}})[_0x8b71('0x14')](function(_0x144130){logger[_0x8b71('0xf')](_0x8b71('0x11'),_0x28ceb5,_0x144130);_0x27f57a(_0x144130);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 2e77d22..ebbbe08 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 _0x49d4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','index','get','describe','/:id','getSections','/:id/resources','getResources','isAuthenticated','post','/:id/clone','addSections','addResources','put','delete','destroy','/:id/sections'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x49d4,0x6d));var _0x449d=function(_0x5546ed,_0x3138c3){_0x5546ed=_0x5546ed-0x0;var _0x79d93f=_0x49d4[_0x5546ed];return _0x79d93f;};'use strict';var multer=require(_0x449d('0x0'));var util=require(_0x449d('0x1'));var path=require(_0x449d('0x2'));var timeout=require(_0x449d('0x3'));var express=require(_0x449d('0x4'));var router=express[_0x449d('0x5')]();var fs_extra=require(_0x449d('0x6'));var auth=require(_0x449d('0x7'));var interaction=require(_0x449d('0x8'));var config=require('../../config/environment');var controller=require(_0x449d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x449d('0xa')]);router[_0x449d('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x449d('0xc')]);router[_0x449d('0xb')](_0x449d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x449d('0xb')]('/:id/sections',auth['isAuthenticated'](),controller[_0x449d('0xe')]);router[_0x449d('0xb')](_0x449d('0xf'),auth['isAuthenticated'](),controller[_0x449d('0x10')]);router['post']('/',auth[_0x449d('0x11')](),controller['create']);router[_0x449d('0x12')](_0x449d('0x13'),auth['isAuthenticated'](),controller['clone']);router[_0x449d('0x12')]('/:id/sections',auth[_0x449d('0x11')](),controller[_0x449d('0x14')]);router['post'](_0x449d('0xf'),auth['isAuthenticated'](),controller[_0x449d('0x15')]);router[_0x449d('0x16')](_0x449d('0xd'),auth[_0x449d('0x11')](),controller['update']);router[_0x449d('0x17')](_0x449d('0xd'),auth[_0x449d('0x11')](),controller[_0x449d('0x18')]);router[_0x449d('0x17')](_0x449d('0x19'),auth[_0x449d('0x11')](),controller['removeSections']);router[_0x449d('0x17')](_0x449d('0xf'),auth[_0x449d('0x11')](),controller['removeResources']);module[_0x449d('0x1a')]=router; \ No newline at end of file +var _0x5296=['isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','post','/:id/clone','clone','addSections','put','update','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get'];(function(_0x58073,_0x5d320d){var _0x37d3f7=function(_0x2a7651){while(--_0x2a7651){_0x58073['push'](_0x58073['shift']());}};_0x37d3f7(++_0x5d320d);}(_0x5296,0x17d));var _0x6529=function(_0x19ec18,_0x19fa22){_0x19ec18=_0x19ec18-0x0;var _0x13ceca=_0x5296[_0x19ec18];return _0x13ceca;};'use strict';var multer=require(_0x6529('0x0'));var util=require(_0x6529('0x1'));var path=require(_0x6529('0x2'));var timeout=require(_0x6529('0x3'));var express=require(_0x6529('0x4'));var router=express['Router']();var fs_extra=require(_0x6529('0x5'));var auth=require(_0x6529('0x6'));var interaction=require(_0x6529('0x7'));var config=require(_0x6529('0x8'));var controller=require(_0x6529('0x9'));router[_0x6529('0xa')]('/',auth[_0x6529('0xb')](),controller[_0x6529('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6529('0xd')]);router['get'](_0x6529('0xe'),auth[_0x6529('0xb')](),controller[_0x6529('0xf')]);router[_0x6529('0xa')](_0x6529('0x10'),auth[_0x6529('0xb')](),controller[_0x6529('0x11')]);router[_0x6529('0xa')](_0x6529('0x12'),auth['isAuthenticated'](),controller['getResources']);router[_0x6529('0x13')]('/',auth[_0x6529('0xb')](),controller['create']);router[_0x6529('0x13')](_0x6529('0x14'),auth['isAuthenticated'](),controller[_0x6529('0x15')]);router[_0x6529('0x13')](_0x6529('0x10'),auth[_0x6529('0xb')](),controller[_0x6529('0x16')]);router[_0x6529('0x13')](_0x6529('0x12'),auth[_0x6529('0xb')](),controller['addResources']);router[_0x6529('0x17')](_0x6529('0xe'),auth[_0x6529('0xb')](),controller[_0x6529('0x18')]);router[_0x6529('0x19')](_0x6529('0xe'),auth[_0x6529('0xb')](),controller['destroy']);router[_0x6529('0x19')](_0x6529('0x10'),auth[_0x6529('0xb')](),controller[_0x6529('0x1a')]);router[_0x6529('0x19')](_0x6529('0x12'),auth[_0x6529('0xb')](),controller[_0x6529('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e4e79ee..bb6858b 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 _0xc2aa=['BOOLEAN','sequelize','STRING','name','join','getDataValue','crudPermissions','split'];(function(_0x25f496,_0x1393ee){var _0x28f292=function(_0x2b8712){while(--_0x2b8712){_0x25f496['push'](_0x25f496['shift']());}};_0x28f292(++_0x1393ee);}(_0xc2aa,0x91));var _0xac2a=function(_0x34750e,_0x3c3d3b){_0x34750e=_0x34750e-0x0;var _0x36760a=_0xc2aa[_0x34750e];return _0x36760a;};'use strict';var Sequelize=require(_0xac2a('0x0'));module['exports']={'name':{'type':Sequelize[_0xac2a('0x1')],'allowNull':![],'unique':_0xac2a('0x2')},'crudPermissions':{'type':Sequelize[_0xac2a('0x1')],'set':function(_0x4d3cd1){this['setDataValue']('crudPermissions',_0x4d3cd1?_0x4d3cd1[_0xac2a('0x3')](''):[]);},'get':function(){return this[_0xac2a('0x4')]('crudPermissions')?this[_0xac2a('0x4')](_0xac2a('0x5'))[_0xac2a('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xac2a('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xac2a('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xac2a('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xac2a('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xac2a('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xac2a('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x05d1=['crudPermissions','join','getDataValue','BOOLEAN','sequelize','exports','name','STRING'];(function(_0x593e2c,_0x4858de){var _0x2e7cb2=function(_0xeb0a19){while(--_0xeb0a19){_0x593e2c['push'](_0x593e2c['shift']());}};_0x2e7cb2(++_0x4858de);}(_0x05d1,0x14c));var _0x105d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x05d1[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x105d('0x0'));module[_0x105d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x105d('0x2')},'crudPermissions':{'type':Sequelize[_0x105d('0x3')],'set':function(_0x22e0b6){this['setDataValue'](_0x105d('0x4'),_0x22e0b6?_0x22e0b6[_0x105d('0x5')](''):[]);},'get':function(){return this[_0x105d('0x6')](_0x105d('0x4'))?this[_0x105d('0x6')](_0x105d('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x105d('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x105d('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x105d('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x105d('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x105d('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x105d('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 271a0a0..086c4d4 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 _0x71cf=['fieldName','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','clone','length','get','omit','updatedAt','crudPermissions','createdAt','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','destroy','addSections','sequelize','transaction','push','removeSections','ids','getSections','enabled','includes','sectionId','isEmpty','subsections','concat','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes'];(function(_0x589002,_0x1c9c42){var _0x1ebe5a=function(_0x7f9547){while(--_0x7f9547){_0x589002['push'](_0x589002['shift']());}};_0x1ebe5a(++_0x1c9c42);}(_0x71cf,0xb6));var _0xf71c=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x71cf[_0x1ebb10];return _0x20d709;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf71c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf71c('0x1'));var rp=require(_0xf71c('0x2'));var moment=require(_0xf71c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf71c('0x4'));var util=require(_0xf71c('0x5'));var path=require(_0xf71c('0x6'));var sox=require(_0xf71c('0x7'));var csv=require(_0xf71c('0x8'));var ejs=require(_0xf71c('0x9'));var fs=require('fs');var fs_extra=require(_0xf71c('0xa'));var _=require(_0xf71c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf71c('0xc'));var deskjs=require(_0xf71c('0xd'));var toCsv=require(_0xf71c('0x8'));var querystring=require(_0xf71c('0xe'));var Papa=require(_0xf71c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf71c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf71c('0x11'));var logger=require(_0xf71c('0x12'))(_0xf71c('0x13'));var utils=require(_0xf71c('0x14'));var config=require(_0xf71c('0x15'));var licenseUtil=require(_0xf71c('0x16'));var db=require(_0xf71c('0x17'))['db'];config['redis']=_[_0xf71c('0x18')](config[_0xf71c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf71c('0x1a'))(new Redis(config[_0xf71c('0x19')]));require(_0xf71c('0x1b'))[_0xf71c('0x1c')](socket);function respondWithStatusCode(_0x4d962d,_0x5db4ca){_0x5db4ca=_0x5db4ca||0xcc;return function(_0x3a86f6){if(_0x3a86f6){return _0x4d962d[_0xf71c('0x1d')](_0x5db4ca);}return _0x4d962d[_0xf71c('0x1e')](_0x5db4ca)[_0xf71c('0x1f')]();};}function respondWithResult(_0x36148e,_0x4dc9b){_0x4dc9b=_0x4dc9b||0xc8;return function(_0x26ef17){if(_0x26ef17){return _0x36148e[_0xf71c('0x1e')](_0x4dc9b)[_0xf71c('0x20')](_0x26ef17);}};}function respondWithFilteredResult(_0x2662dd,_0x57649f){return function(_0x36b41f){if(_0x36b41f){var _0x13f016=typeof _0x57649f['offset']==='undefined'&&typeof _0x57649f[_0xf71c('0x21')]===_0xf71c('0x22');var _0x264a50=_0x36b41f['count'];var _0x1777c2=_0x13f016?0x0:_0x57649f[_0xf71c('0x23')];var _0x84d2e0=_0x13f016?_0x36b41f[_0xf71c('0x24')]:_0x57649f[_0xf71c('0x23')]+_0x57649f[_0xf71c('0x21')];var _0x84a01c;if(_0x84d2e0>=_0x264a50){_0x84d2e0=_0x264a50;_0x84a01c=0xc8;}else{_0x84a01c=0xce;}_0x2662dd[_0xf71c('0x1e')](_0x84a01c);return _0x2662dd[_0xf71c('0x25')](_0xf71c('0x26'),_0x1777c2+'-'+_0x84d2e0+'/'+_0x264a50)[_0xf71c('0x20')](_0x36b41f);}return null;};}function patchUpdates(_0x474c99){return function(_0x4d55ca){try{jsonpatch['apply'](_0x4d55ca,_0x474c99,!![]);}catch(_0x4578b5){return BPromise[_0xf71c('0x27')](_0x4578b5);}return _0x4d55ca['save']();};}function saveUpdates(_0x22423a,_0x3b9d46){return function(_0x354e01){if(_0x354e01){return _0x354e01[_0xf71c('0x28')](_0x22423a)[_0xf71c('0x29')](function(_0x4fcc2a){return _0x4fcc2a;});}return null;};}function removeEntity(_0x251006,_0x2a39e6){return function(_0x1eb545){if(_0x1eb545){return _0x1eb545['destroy']()['then'](function(){_0x251006[_0xf71c('0x1e')](0xcc)[_0xf71c('0x1f')]();});}};}function handleEntityNotFound(_0xac2d68,_0x3c954a){return function(_0x5e0367){if(!_0x5e0367){_0xac2d68[_0xf71c('0x1d')](0x194);}return _0x5e0367;};}function handleError(_0x1804c6,_0x1de789){_0x1de789=_0x1de789||0x1f4;return function(_0x3c8435){logger[_0xf71c('0x2a')](_0x3c8435[_0xf71c('0x2b')]);if(_0x3c8435[_0xf71c('0x2c')]){delete _0x3c8435[_0xf71c('0x2c')];}_0x1804c6['status'](_0x1de789)[_0xf71c('0x2d')](_0x3c8435);};}exports[_0xf71c('0x2e')]=function(_0x6018b1,_0x5505aa){var _0x3ef53a={},_0x1ba3c6={},_0x5d9924={'count':0x0,'rows':[]};var _0x5f2622=_[_0xf71c('0x2f')](db[_0xf71c('0x30')][_0xf71c('0x31')],function(_0x1d7935){return{'name':_0x1d7935[_0xf71c('0x32')],'type':_0x1d7935['type']['key']};});_0x1ba3c6['model']=_[_0xf71c('0x2f')](_0x5f2622,'name');_0x1ba3c6[_0xf71c('0x33')]=_['keys'](_0x6018b1[_0xf71c('0x33')]);_0x1ba3c6[_0xf71c('0x34')]=_[_0xf71c('0x35')](_0x1ba3c6[_0xf71c('0x36')],_0x1ba3c6[_0xf71c('0x33')]);_0x3ef53a[_0xf71c('0x37')]=_['intersection'](_0x1ba3c6[_0xf71c('0x36')],qs['fields'](_0x6018b1['query'][_0xf71c('0x38')]));_0x3ef53a['attributes']=_0x3ef53a[_0xf71c('0x37')]['length']?_0x3ef53a[_0xf71c('0x37')]:_0x1ba3c6[_0xf71c('0x36')];if(!_0x6018b1[_0xf71c('0x33')][_0xf71c('0x39')](_0xf71c('0x3a'))){_0x3ef53a[_0xf71c('0x21')]=qs[_0xf71c('0x21')](_0x6018b1[_0xf71c('0x33')][_0xf71c('0x21')]);_0x3ef53a['offset']=qs['offset'](_0x6018b1[_0xf71c('0x33')][_0xf71c('0x23')]);}_0x3ef53a[_0xf71c('0x3b')]=qs['sort'](_0x6018b1[_0xf71c('0x33')][_0xf71c('0x3c')]);_0x3ef53a['where']=qs['filters'](_[_0xf71c('0x3d')](_0x6018b1[_0xf71c('0x33')],_0x1ba3c6[_0xf71c('0x34')]),_0x5f2622);if(_0x6018b1[_0xf71c('0x33')][_0xf71c('0x3e')]){_0x3ef53a[_0xf71c('0x3f')]=_[_0xf71c('0x40')](_0x3ef53a['where'],{'$or':_[_0xf71c('0x2f')](_0x5f2622,function(_0x12e07f){if(_0x12e07f[_0xf71c('0x41')]!==_0xf71c('0x42')){var _0x3e1d58={};_0x3e1d58[_0x12e07f['name']]={'$like':'%'+_0x6018b1[_0xf71c('0x33')][_0xf71c('0x3e')]+'%'};return _0x3e1d58;}})});}_0x3ef53a=_[_0xf71c('0x40')]({},_0x3ef53a,_0x6018b1[_0xf71c('0x43')]);var _0x51d5d6={'where':_0x3ef53a[_0xf71c('0x3f')]};return db[_0xf71c('0x30')][_0xf71c('0x24')](_0x51d5d6)[_0xf71c('0x29')](function(_0x24346b){_0x5d9924[_0xf71c('0x24')]=_0x24346b;if(_0x6018b1[_0xf71c('0x33')][_0xf71c('0x44')]){_0x3ef53a[_0xf71c('0x45')]=[{'all':!![]}];}return db[_0xf71c('0x30')][_0xf71c('0x46')](_0x3ef53a);})[_0xf71c('0x29')](function(_0x57a9b2){_0x5d9924[_0xf71c('0x47')]=_0x57a9b2;return _0x5d9924;})[_0xf71c('0x29')](respondWithFilteredResult(_0x5505aa,_0x3ef53a))['catch'](handleError(_0x5505aa,null));};exports[_0xf71c('0x48')]=function(_0x356f10,_0x3b5530){var _0x371b65={'raw':![],'where':{'id':_0x356f10[_0xf71c('0x49')]['id']}},_0x5bf022={};_0x5bf022['model']=_['keys'](db['UserProfile'][_0xf71c('0x31')]);_0x5bf022[_0xf71c('0x33')]=_[_0xf71c('0x4a')](_0x356f10[_0xf71c('0x33')]);_0x5bf022[_0xf71c('0x34')]=_['intersection'](_0x5bf022[_0xf71c('0x36')],_0x5bf022[_0xf71c('0x33')]);_0x371b65[_0xf71c('0x37')]=_[_0xf71c('0x35')](_0x5bf022[_0xf71c('0x36')],qs[_0xf71c('0x38')](_0x356f10[_0xf71c('0x33')]['fields']));_0x371b65['attributes']=_0x371b65[_0xf71c('0x37')]['length']?_0x371b65[_0xf71c('0x37')]:_0x5bf022[_0xf71c('0x36')];if(_0x356f10[_0xf71c('0x33')][_0xf71c('0x44')]){_0x371b65[_0xf71c('0x45')]=[{'all':!![]}];}_0x371b65=_['merge']({},_0x371b65,_0x356f10['options']);return db[_0xf71c('0x30')][_0xf71c('0x4b')](_0x371b65)['then'](handleEntityNotFound(_0x3b5530,null))[_0xf71c('0x29')](respondWithResult(_0x3b5530,null))[_0xf71c('0x4c')](handleError(_0x3b5530,null));};exports[_0xf71c('0x4d')]=function(_0x3cf9d9,_0x3a824e){return db['UserProfile'][_0xf71c('0x4d')](_0x3cf9d9[_0xf71c('0x4e')],{})['then'](respondWithResult(_0x3a824e,0xc9))['catch'](handleError(_0x3a824e,null));};exports[_0xf71c('0x4f')]=function(_0x16c749,_0x53b3a3){var _0x5d0d2b={'where':{'id':_0x16c749['params']['id']}},_0x574635={};_0x574635['model']=_['keys'](db[_0xf71c('0x30')][_0xf71c('0x31')]);_0x5d0d2b['attributes']=_[_0xf71c('0x35')](_0x574635[_0xf71c('0x36')],qs['fields'](_0x16c749[_0xf71c('0x33')][_0xf71c('0x38')]));_0x5d0d2b['attributes']=_0x5d0d2b['attributes'][_0xf71c('0x50')]?_0x5d0d2b[_0xf71c('0x37')]:_0x574635['model'];if(_0x16c749[_0xf71c('0x33')][_0xf71c('0x44')]){_0x5d0d2b[_0xf71c('0x45')]=[{'all':!![]}];}_0x5d0d2b=_['merge']({},_0x5d0d2b,_0x16c749['options']);return db[_0xf71c('0x30')][_0xf71c('0x4b')](_0x5d0d2b)[_0xf71c('0x29')](handleEntityNotFound(_0x53b3a3,null))[_0xf71c('0x29')](function(_0x14a7d0){if(_0x14a7d0){var _0x179e24=_0x14a7d0[_0xf71c('0x51')]({'plain':!![]});_0x179e24=qs[_0xf71c('0x52')](_0x179e24,['id','createdAt',_0xf71c('0x53'),_0xf71c('0x54')]);_0x16c749[_0xf71c('0x4e')]=_[_0xf71c('0x52')](_0x16c749[_0xf71c('0x4e')],['id',_0xf71c('0x55'),_0xf71c('0x53')]);return db['sequelize']['transaction'](function(_0x450228){return db[_0xf71c('0x30')][_0xf71c('0x4d')](_[_0xf71c('0x40')](_0x179e24,_0x16c749[_0xf71c('0x4e')]),{'include':_0x16c749['query'][_0xf71c('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x450228})[_0xf71c('0x29')](function(_0x25f222){var _0x47f750=_0x25f222['get']({'plain':!![]});return db[_0xf71c('0x56')][_0xf71c('0x46')]({'where':{'userProfileId':_0x16c749['params']['id']},'raw':!![]})[_0xf71c('0x29')](function(_0x3a1c94){if(_0x3a1c94){return BPromise[_0xf71c('0x57')](_0x3a1c94,function(_0x4b318a){return new BPromise(function(_0x151bae,_0x2c7ced){if(_0x4b318a[_0xf71c('0x58')]===null||_0x4b318a[_0xf71c('0x58')]===0x1)_0x151bae(null);return db[_0xf71c('0x59')][_0xf71c('0x46')]({'where':{'sectionId':_0x4b318a['id']},'raw':!![]})['then'](function(_0xe4c66d){var _0x1fe3e2=_[_0xf71c('0x2f')](_0xe4c66d,function(_0x20f674){return qs[_0xf71c('0x52')](_0x20f674,['id',_0xf71c('0x55'),_0xf71c('0x53'),'sectionId']);});_0x151bae(_0x1fe3e2);})[_0xf71c('0x4c')](function(_0x5d1ed5){_0x2c7ced(_0x5d1ed5);});})[_0xf71c('0x29')](function(_0x20cc22){var _0x396fcc=qs['omit'](_0x4b318a,['id',_0xf71c('0x55'),_0xf71c('0x53')]);_0x396fcc[_0xf71c('0x5a')]=_0x47f750['id'];if(_0x20cc22)_0x396fcc[_0xf71c('0x5b')]=_0x20cc22;return _0x396fcc;})[_0xf71c('0x29')](function(_0xdeb216){return db['UserProfileSection'][_0xf71c('0x4d')](_0xdeb216,{'include':[{'model':db[_0xf71c('0x59')],'as':_0xf71c('0x5b')}],'raw':!![],'transaction':_0x450228});});})[_0xf71c('0x29')](function(){return _0x47f750;});}});});});}})[_0xf71c('0x29')](respondWithResult(_0x53b3a3,0xc9))[_0xf71c('0x4c')](handleError(_0x53b3a3,null));};exports[_0xf71c('0x28')]=function(_0x31d929,_0x1ca3c9){if(_0x31d929['body']['id']){delete _0x31d929[_0xf71c('0x4e')]['id'];}return db[_0xf71c('0x30')][_0xf71c('0x4b')]({'where':{'id':_0x31d929[_0xf71c('0x49')]['id']}})[_0xf71c('0x29')](handleEntityNotFound(_0x1ca3c9,null))[_0xf71c('0x29')](saveUpdates(_0x31d929[_0xf71c('0x4e')],null))[_0xf71c('0x29')](respondWithResult(_0x1ca3c9,null))[_0xf71c('0x4c')](handleError(_0x1ca3c9,null));};exports[_0xf71c('0x5c')]=function(_0x1b4de5,_0xf79507){return db['UserProfile'][_0xf71c('0x4b')]({'where':{'id':_0x1b4de5[_0xf71c('0x49')]['id']}})[_0xf71c('0x29')](handleEntityNotFound(_0xf79507,null))[_0xf71c('0x29')](removeEntity(_0xf79507,null))['catch'](handleError(_0xf79507,null));};exports['describe']=function(_0x3c0136,_0x483778){return db[_0xf71c('0x30')]['describe']()['then'](respondWithResult(_0x483778,null))[_0xf71c('0x4c')](handleError(_0x483778,null));};exports[_0xf71c('0x5d')]=function(_0x3c79c8,_0x55d933){var _0x7f2c28=_0x3c79c8[_0xf71c('0x4e')];return db['UserProfile']['find']({'where':{'id':_0x3c79c8[_0xf71c('0x49')]['id']}})['then'](handleEntityNotFound(_0x55d933,null))[_0xf71c('0x29')](function(_0x2aa8c8){if(_0x2aa8c8){return db[_0xf71c('0x5e')][_0xf71c('0x5f')](function(_0x105a23){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3c79c8['params']['id'],'sectionId':_['map'](_0x7f2c28,function(_0x4a20e3){return _0x4a20e3['sectionId'];})},'transaction':_0x105a23})[_0xf71c('0x29')](function(){var _0x12f5d0=_[_0xf71c('0x2f')](_0x7f2c28,function(_0x3dfdb4){_0x3dfdb4[_0xf71c('0x5a')]=_0x3c79c8[_0xf71c('0x49')]['id'];return _0x3dfdb4;});var _0x3cd723=[];return BPromise[_0xf71c('0x57')](_0x12f5d0,function(_0x565e53){return db[_0xf71c('0x56')]['create'](_0x565e53,{'include':[{'model':db[_0xf71c('0x59')],'as':_0xf71c('0x5b')}],'raw':!![],'transaction':_0x105a23})[_0xf71c('0x29')](function(_0xb6ce8d){_0x3cd723[_0xf71c('0x60')](_0xb6ce8d[_0xf71c('0x51')]({'plain':!![]}));});})[_0xf71c('0x29')](function(){return _0x3cd723;});});});}})[_0xf71c('0x29')](function(_0x17dd01){return _0x17dd01;})['then'](respondWithResult(_0x55d933,null))[_0xf71c('0x4c')](handleError(_0x55d933,null));};exports[_0xf71c('0x61')]=function(_0x2a6278,_0x4bc876){var _0x1bbc77;return db[_0xf71c('0x30')][_0xf71c('0x4b')]({'where':{'id':_0x2a6278[_0xf71c('0x49')]['id']},'attributes':['id',_0xf71c('0x2c')]})['then'](handleEntityNotFound(_0x4bc876,null))[_0xf71c('0x29')](function(_0x1caf98){if(_0x1caf98){_0x1bbc77=_0x1caf98;return db['UserProfileSection'][_0xf71c('0x5c')]({'where':{'userProfileId':_0x2a6278['params']['id'],'sectionId':_0x2a6278[_0xf71c('0x33')][_0xf71c('0x62')]}});}})['then'](function(){return _0x1bbc77;})[_0xf71c('0x29')](respondWithStatusCode(_0x4bc876,null))[_0xf71c('0x4c')](handleError(_0x4bc876,null));};exports[_0xf71c('0x63')]=function(_0x521a88,_0x24ef11){var _0x4bdcea=[];var _0x242829=[];return db[_0xf71c('0x56')][_0xf71c('0x46')]({'where':{'userProfileId':_0x521a88[_0xf71c('0x49')]['id']},'raw':!![]})['then'](function(_0x1412dd){_0x4bdcea=_['filter'](_0x1412dd,function(_0x210228){return _0x210228[_0xf71c('0x64')]===0x1||_[_0xf71c('0x65')]([0x3eb,0x709],_0x210228[_0xf71c('0x66')]);});if(!_[_0xf71c('0x67')](_0x4bdcea)){return _[_0xf71c('0x2f')](_0x4bdcea,function(_0x3b0225){return _0x3b0225[_0xf71c('0x66')];});}else{return;}})[_0xf71c('0x29')](function(_0x3bcfad){if(_0x3bcfad)_0x242829=_0x3bcfad;if(_[_0xf71c('0x65')](_0x242829,0x64)){var _0x119b44=_['find'](_0x4bdcea,{'sectionId':0x64});return hasDefaultDashboard(_0x119b44)[_0xf71c('0x29')](function(_0x3b328b){return _['map'](_0x4bdcea,function(_0x33a366){if(_0x33a366[_0xf71c('0x66')]===0x64){_0x33a366['subsections']=_0x3b328b;}return _0x33a366;});});}else{return;}})[_0xf71c('0x29')](function(_0xb685ed){if(_0xb685ed)_0x4bdcea=_0xb685ed;if(_[_0xf71c('0x65')](_0x242829,0x3eb)){var _0x125b84=_[_0xf71c('0x4b')](_0x4bdcea,{'sectionId':0x3eb});return getCustomDashboards(_0x125b84)['then'](function(_0x12a239){return _[_0xf71c('0x2f')](_0x4bdcea,function(_0x47a354){if(_0x125b84[_0xf71c('0x64')]){if(_0x47a354[_0xf71c('0x66')]===0x3eb){_0x47a354[_0xf71c('0x68')]=_0x12a239;}}else{if(_0x47a354[_0xf71c('0x66')]===0x64){if(!_0x47a354['subsections']){_0x47a354['subsections']=[];}_0x47a354[_0xf71c('0x68')]=_0x47a354[_0xf71c('0x68')][_0xf71c('0x69')](_0x12a239);}}return _0x47a354;});});}else{return;}})[_0xf71c('0x29')](function(_0x554e75){if(_0x554e75)_0x4bdcea=_0x554e75;if(_[_0xf71c('0x65')](_0x242829,0x709)){var _0x4d49b7=_[_0xf71c('0x4b')](_0x4bdcea,{'sectionId':0x709});return getPlugins(_0x4d49b7)[_0xf71c('0x29')](function(_0x4d2fcb){if(_0x4d49b7[_0xf71c('0x64')]){return _[_0xf71c('0x2f')](_0x4bdcea,function(_0x5bc060){if(_0x5bc060[_0xf71c('0x66')]===0x709){_0x5bc060[_0xf71c('0x68')]=_0x4d2fcb;}return _0x5bc060;});}else{var _0x4b1722={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4d2fcb};var _0x38ccc0=_[_0xf71c('0x2f')](_0x4bdcea);_0x38ccc0[_0xf71c('0x60')](_0x4b1722);return _0x38ccc0;}});}else{return;}})['then'](function(_0x1af353){if(_0x1af353)_0x4bdcea=_0x1af353;return _[_0xf71c('0x3e')](_0x4bdcea,[_0xf71c('0x64'),0x1]);})['then'](respondWithResult(_0x24ef11,null))[_0xf71c('0x4c')](handleError(_0x24ef11,null));};function hasDefaultDashboard(_0x5b921e){var _0x524b81=[0x65];return new BPromise(function(_0x2b60eb,_0x22033d){try{if(_0x5b921e[_0xf71c('0x58')]){_0x2b60eb(_0x524b81);}else{return db['UserProfileResource'][_0xf71c('0x6a')]({'where':{'sectionId':_0x5b921e['id']},'raw':!![]})[_0xf71c('0x29')](function(_0x38ad29){_0x38ad29?_0x2b60eb(_0x524b81):_0x2b60eb();});}}catch(_0xbb8186){_0x22033d(_0xbb8186);}});}function getCustomDashboards(_0x3f9e6d){var _0x70fb07=[];return new BPromise(function(_0x27a04b,_0x51fc78){try{if(_0x3f9e6d[_0xf71c('0x58')]){return db['Dashboard'][_0xf71c('0x46')]({'raw':!![]})[_0xf71c('0x29')](function(_0x5b517c){_0x5b517c[_0xf71c('0x6b')](function(_0x3bca77){_0x70fb07[_0xf71c('0x60')](_0x3bca77['id']+0x1869f);});_0x27a04b(_0x70fb07);});}else{return db[_0xf71c('0x59')][_0xf71c('0x46')]({'where':{'sectionId':_0x3f9e6d['id']},'raw':!![]})[_0xf71c('0x29')](function(_0x235b70){_0x235b70[_0xf71c('0x6b')](function(_0x55bf2d){_0x70fb07['push'](_0x55bf2d[_0xf71c('0x6c')]+0x1869f);});_0x27a04b(_0x70fb07);});}}catch(_0x2a0ef9){_0x51fc78(_0x2a0ef9);}});}function getPlugins(_0x5a83e3){var _0x38e11a=[];return new BPromise(function(_0x349ef9,_0x3f9b42){try{if(_0x5a83e3[_0xf71c('0x58')]){return db[_0xf71c('0x6d')][_0xf71c('0x46')]({'raw':!![]})[_0xf71c('0x29')](function(_0x5ec040){_0x5ec040[_0xf71c('0x6b')](function(_0x467914){_0x38e11a[_0xf71c('0x60')](_0x467914['id']+0x15b38);});_0x349ef9(_0x38e11a);});}else{return db['UserProfileResource'][_0xf71c('0x46')]({'where':{'sectionId':_0x5a83e3['id']},'raw':!![]})[_0xf71c('0x29')](function(_0x1fbfad){_0x1fbfad[_0xf71c('0x6b')](function(_0xf0cf0){_0x38e11a[_0xf71c('0x60')](_0xf0cf0['resourceId']+0x15b38);});_0x349ef9(_0x38e11a);});}}catch(_0x5cc145){_0x3f9b42(_0x5cc145);}});}exports['addResources']=function(_0x4d35b4,_0x1cda96){return db[_0xf71c('0x30')][_0xf71c('0x4b')]({'where':{'id':_0x4d35b4[_0xf71c('0x49')]['id']}})[_0xf71c('0x29')](handleEntityNotFound(_0x1cda96,null))[_0xf71c('0x29')](function(_0x4671c){if(_0x4671c){return db[_0xf71c('0x5e')]['transaction'](function(_0x38eb1e){return db[_0xf71c('0x56')][_0xf71c('0x46')]({'where':{'userProfileId':_0x4d35b4[_0xf71c('0x49')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x14685f){if(_0x14685f){return db[_0xf71c('0x56')]['destroy']({'where':{'userProfileId':_0x4d35b4[_0xf71c('0x49')]['id'],'id':_[_0xf71c('0x2f')](_0x14685f,function(_0x55424b){return _0x55424b['id'];})},'transaction':_0x38eb1e});}})[_0xf71c('0x29')](function(_0x170b10){var _0x86d956=_['map'](_0x4d35b4[_0xf71c('0x4e')],function(_0x12121a){_0x12121a['userProfileId']=_0x4d35b4[_0xf71c('0x49')]['id'];return _0x12121a;});return db[_0xf71c('0x56')][_0xf71c('0x6e')](_0x86d956,{'raw':!![],'transaction':_0x38eb1e});})[_0xf71c('0x29')](function(_0x1d0a29){var _0x1c234f=_[_0xf71c('0x3e')](_[_0xf71c('0x2f')](_0x1d0a29,function(_0x443b8e){return _0x443b8e[_0xf71c('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x1c234f){return db[_0xf71c('0x56')]['findAll']({'where':{'userProfileId':_0x4d35b4[_0xf71c('0x49')]['id'],'sectionId':_[_0xf71c('0x2f')](_0x1c234f,function(_0x50da68){return _0x50da68[_0xf71c('0x66')];})},'attributes':['id',_0xf71c('0x66')],'raw':!![]})[_0xf71c('0x29')](function(_0x1f0b41){var _0x5429a5=_[_0xf71c('0x2f')](_0x4d35b4[_0xf71c('0x4e')],function(_0xa23ea5){_0xa23ea5[_0xf71c('0x5a')]=_0x4d35b4['params']['id'];return _0xa23ea5;});return db[_0xf71c('0x59')][_0xf71c('0x6e')](_0x5429a5,{'raw':!![],'transaction':_0x38eb1e});});}})[_0xf71c('0x4c')](handleError(_0x1cda96,null));});}})[_0xf71c('0x29')](function(_0x48a5f5){var _0x587e39=_[_0xf71c('0x2f')](_0x48a5f5,function(_0x42de9e){return _0x42de9e[_0xf71c('0x51')]({'plain':!![]});});})[_0xf71c('0x29')](respondWithResult(_0x1cda96,null))[_0xf71c('0x4c')](handleError(_0x1cda96,null));};exports[_0xf71c('0x6f')]=function(_0x20b96d,_0x4ab6c3,_0x4d22c4){return db[_0xf71c('0x30')][_0xf71c('0x4b')]({'where':{'id':_0x20b96d[_0xf71c('0x49')]['id']}})[_0xf71c('0x29')](handleEntityNotFound(_0x4ab6c3,null))[_0xf71c('0x29')](function(_0x3546fc){if(_0x3546fc){return _0x3546fc[_0xf71c('0x6f')](_0x20b96d['query'][_0xf71c('0x62')]);}})[_0xf71c('0x29')](respondWithStatusCode(_0x4ab6c3,null))['catch'](handleError(_0x4ab6c3,null));};exports[_0xf71c('0x70')]=function(_0x380efa,_0x5c4a35){var _0x2c307b={};if(!_0x380efa['query'][_0xf71c('0x71')])throw new Error(_0xf71c('0x72'));if(!_0x380efa[_0xf71c('0x33')]['hasOwnProperty'](_0xf71c('0x3a'))){_0x2c307b[_0xf71c('0x21')]=qs['limit'](_0x380efa[_0xf71c('0x33')]['limit']);_0x2c307b[_0xf71c('0x23')]=qs['offset'](_0x380efa['query'][_0xf71c('0x23')]);}return db[_0xf71c('0x30')][_0xf71c('0x4b')]({'where':{'id':_0x380efa['params']['id']}})[_0xf71c('0x29')](function(_0x3e176b){if(!_0x3e176b)throw new Error(_0xf71c('0x73')+_0x380efa['params']['id']);return db['UserProfile'][_0xf71c('0x70')](_0x380efa);})[_0xf71c('0x29')](respondWithFilteredResult(_0x5c4a35,_0x2c307b))[_0xf71c('0x4c')](handleError(_0x5c4a35,null));}; \ No newline at end of file +var _0x1b32=['../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./userProfile.socket','register','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','params','find','create','body','catch','get','updatedAt','omit','createdAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','push','removeSections','ids','getSections','enabled','includes','subsections','concat','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x1b32,0x1a6));var _0x21b3=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x1b32[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x21b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21b3('0x1'));var jsonpatch=require(_0x21b3('0x2'));var rp=require('request-promise');var moment=require(_0x21b3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x21b3('0x4'));var util=require('util');var path=require(_0x21b3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x21b3('0x6'));var fs=require('fs');var fs_extra=require(_0x21b3('0x7'));var _=require(_0x21b3('0x8'));var squel=require(_0x21b3('0x9'));var crypto=require('crypto');var jsforce=require(_0x21b3('0xa'));var deskjs=require(_0x21b3('0xb'));var toCsv=require(_0x21b3('0xc'));var querystring=require(_0x21b3('0xd'));var Papa=require(_0x21b3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x21b3('0xf'));var as=require(_0x21b3('0x10'));var hardwareService=require(_0x21b3('0x11'));var logger=require(_0x21b3('0x12'))(_0x21b3('0x13'));var utils=require(_0x21b3('0x14'));var config=require(_0x21b3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x21b3('0x16')]=_['defaults'](config['redis'],{'host':_0x21b3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x21b3('0x18'))[_0x21b3('0x19')](socket);function respondWithStatusCode(_0xee1787,_0x263d2f){_0x263d2f=_0x263d2f||0xcc;return function(_0x241035){if(_0x241035){return _0xee1787['sendStatus'](_0x263d2f);}return _0xee1787['status'](_0x263d2f)[_0x21b3('0x1a')]();};}function respondWithResult(_0x12221b,_0x30b9be){_0x30b9be=_0x30b9be||0xc8;return function(_0x385e0a){if(_0x385e0a){return _0x12221b['status'](_0x30b9be)[_0x21b3('0x1b')](_0x385e0a);}};}function respondWithFilteredResult(_0x1ff0f0,_0x197969){return function(_0x5c072a){if(_0x5c072a){var _0x12985b=typeof _0x197969[_0x21b3('0x1c')]===_0x21b3('0x1d')&&typeof _0x197969[_0x21b3('0x1e')]==='undefined';var _0x3d61f1=_0x5c072a[_0x21b3('0x1f')];var _0x40f51c=_0x12985b?0x0:_0x197969[_0x21b3('0x1c')];var _0x49b51a=_0x12985b?_0x5c072a[_0x21b3('0x1f')]:_0x197969[_0x21b3('0x1c')]+_0x197969[_0x21b3('0x1e')];var _0x3cda83;if(_0x49b51a>=_0x3d61f1){_0x49b51a=_0x3d61f1;_0x3cda83=0xc8;}else{_0x3cda83=0xce;}_0x1ff0f0[_0x21b3('0x20')](_0x3cda83);return _0x1ff0f0[_0x21b3('0x21')](_0x21b3('0x22'),_0x40f51c+'-'+_0x49b51a+'/'+_0x3d61f1)[_0x21b3('0x1b')](_0x5c072a);}return null;};}function patchUpdates(_0x1fe03b){return function(_0x47b95d){try{jsonpatch[_0x21b3('0x23')](_0x47b95d,_0x1fe03b,!![]);}catch(_0x4d0970){return BPromise[_0x21b3('0x24')](_0x4d0970);}return _0x47b95d[_0x21b3('0x25')]();};}function saveUpdates(_0x32d85b,_0x341208){return function(_0x124bf2){if(_0x124bf2){return _0x124bf2['update'](_0x32d85b)[_0x21b3('0x26')](function(_0x444249){return _0x444249;});}return null;};}function removeEntity(_0x394359,_0x52ef32){return function(_0x54198e){if(_0x54198e){return _0x54198e[_0x21b3('0x27')]()[_0x21b3('0x26')](function(){_0x394359['status'](0xcc)[_0x21b3('0x1a')]();});}};}function handleEntityNotFound(_0x15d317,_0x1e9b9c){return function(_0x35e8d5){if(!_0x35e8d5){_0x15d317[_0x21b3('0x28')](0x194);}return _0x35e8d5;};}function handleError(_0xf01b3a,_0x36724f){_0x36724f=_0x36724f||0x1f4;return function(_0x36c325){logger['error'](_0x36c325[_0x21b3('0x29')]);if(_0x36c325[_0x21b3('0x2a')]){delete _0x36c325[_0x21b3('0x2a')];}_0xf01b3a['status'](_0x36724f)[_0x21b3('0x2b')](_0x36c325);};}exports[_0x21b3('0x2c')]=function(_0x4c312b,_0xdb59bc){var _0x398dd2={},_0x8250dc={},_0x4a9d43={'count':0x0,'rows':[]};var _0x4d77c8=_['map'](db[_0x21b3('0x2d')][_0x21b3('0x2e')],function(_0x1e9999){return{'name':_0x1e9999[_0x21b3('0x2f')],'type':_0x1e9999[_0x21b3('0x30')][_0x21b3('0x31')]};});_0x8250dc[_0x21b3('0x32')]=_['map'](_0x4d77c8,_0x21b3('0x2a'));_0x8250dc[_0x21b3('0x33')]=_[_0x21b3('0x34')](_0x4c312b[_0x21b3('0x33')]);_0x8250dc[_0x21b3('0x35')]=_[_0x21b3('0x36')](_0x8250dc[_0x21b3('0x32')],_0x8250dc[_0x21b3('0x33')]);_0x398dd2[_0x21b3('0x37')]=_['intersection'](_0x8250dc[_0x21b3('0x32')],qs[_0x21b3('0x38')](_0x4c312b[_0x21b3('0x33')]['fields']));_0x398dd2[_0x21b3('0x37')]=_0x398dd2[_0x21b3('0x37')][_0x21b3('0x39')]?_0x398dd2[_0x21b3('0x37')]:_0x8250dc[_0x21b3('0x32')];if(!_0x4c312b['query'][_0x21b3('0x3a')](_0x21b3('0x3b'))){_0x398dd2['limit']=qs[_0x21b3('0x1e')](_0x4c312b['query'][_0x21b3('0x1e')]);_0x398dd2[_0x21b3('0x1c')]=qs['offset'](_0x4c312b[_0x21b3('0x33')][_0x21b3('0x1c')]);}_0x398dd2[_0x21b3('0x3c')]=qs[_0x21b3('0x3d')](_0x4c312b['query'][_0x21b3('0x3d')]);_0x398dd2[_0x21b3('0x3e')]=qs[_0x21b3('0x35')](_[_0x21b3('0x3f')](_0x4c312b[_0x21b3('0x33')],_0x8250dc[_0x21b3('0x35')]),_0x4d77c8);if(_0x4c312b[_0x21b3('0x33')][_0x21b3('0x40')]){_0x398dd2[_0x21b3('0x3e')]=_[_0x21b3('0x41')](_0x398dd2[_0x21b3('0x3e')],{'$or':_[_0x21b3('0x42')](_0x4d77c8,function(_0x139a27){if(_0x139a27[_0x21b3('0x30')]!==_0x21b3('0x43')){var _0xaa65f2={};_0xaa65f2[_0x139a27[_0x21b3('0x2a')]]={'$like':'%'+_0x4c312b[_0x21b3('0x33')][_0x21b3('0x40')]+'%'};return _0xaa65f2;}})});}_0x398dd2=_[_0x21b3('0x41')]({},_0x398dd2,_0x4c312b[_0x21b3('0x44')]);var _0x47b4ba={'where':_0x398dd2[_0x21b3('0x3e')]};return db[_0x21b3('0x2d')][_0x21b3('0x1f')](_0x47b4ba)[_0x21b3('0x26')](function(_0x535e0e){_0x4a9d43[_0x21b3('0x1f')]=_0x535e0e;if(_0x4c312b[_0x21b3('0x33')][_0x21b3('0x45')]){_0x398dd2[_0x21b3('0x46')]=[{'all':!![]}];}return db[_0x21b3('0x2d')][_0x21b3('0x47')](_0x398dd2);})[_0x21b3('0x26')](function(_0xed7a52){_0x4a9d43['rows']=_0xed7a52;return _0x4a9d43;})[_0x21b3('0x26')](respondWithFilteredResult(_0xdb59bc,_0x398dd2))['catch'](handleError(_0xdb59bc,null));};exports['show']=function(_0x45380e,_0x414a7b){var _0x394203={'raw':![],'where':{'id':_0x45380e[_0x21b3('0x48')]['id']}},_0xff61d4={};_0xff61d4[_0x21b3('0x32')]=_[_0x21b3('0x34')](db[_0x21b3('0x2d')][_0x21b3('0x2e')]);_0xff61d4['query']=_[_0x21b3('0x34')](_0x45380e[_0x21b3('0x33')]);_0xff61d4['filters']=_[_0x21b3('0x36')](_0xff61d4[_0x21b3('0x32')],_0xff61d4[_0x21b3('0x33')]);_0x394203[_0x21b3('0x37')]=_[_0x21b3('0x36')](_0xff61d4[_0x21b3('0x32')],qs[_0x21b3('0x38')](_0x45380e[_0x21b3('0x33')][_0x21b3('0x38')]));_0x394203['attributes']=_0x394203[_0x21b3('0x37')][_0x21b3('0x39')]?_0x394203['attributes']:_0xff61d4['model'];if(_0x45380e['query'][_0x21b3('0x45')]){_0x394203[_0x21b3('0x46')]=[{'all':!![]}];}_0x394203=_[_0x21b3('0x41')]({},_0x394203,_0x45380e[_0x21b3('0x44')]);return db[_0x21b3('0x2d')][_0x21b3('0x49')](_0x394203)[_0x21b3('0x26')](handleEntityNotFound(_0x414a7b,null))[_0x21b3('0x26')](respondWithResult(_0x414a7b,null))['catch'](handleError(_0x414a7b,null));};exports[_0x21b3('0x4a')]=function(_0x401162,_0x336d6b){return db[_0x21b3('0x2d')][_0x21b3('0x4a')](_0x401162[_0x21b3('0x4b')],{})[_0x21b3('0x26')](respondWithResult(_0x336d6b,0xc9))[_0x21b3('0x4c')](handleError(_0x336d6b,null));};exports['clone']=function(_0xa07276,_0x54cdcf){var _0xc6714d={'where':{'id':_0xa07276[_0x21b3('0x48')]['id']}},_0x2a66f3={};_0x2a66f3[_0x21b3('0x32')]=_[_0x21b3('0x34')](db[_0x21b3('0x2d')][_0x21b3('0x2e')]);_0xc6714d[_0x21b3('0x37')]=_[_0x21b3('0x36')](_0x2a66f3[_0x21b3('0x32')],qs['fields'](_0xa07276[_0x21b3('0x33')][_0x21b3('0x38')]));_0xc6714d[_0x21b3('0x37')]=_0xc6714d[_0x21b3('0x37')][_0x21b3('0x39')]?_0xc6714d[_0x21b3('0x37')]:_0x2a66f3[_0x21b3('0x32')];if(_0xa07276[_0x21b3('0x33')][_0x21b3('0x45')]){_0xc6714d[_0x21b3('0x46')]=[{'all':!![]}];}_0xc6714d=_['merge']({},_0xc6714d,_0xa07276[_0x21b3('0x44')]);return db[_0x21b3('0x2d')][_0x21b3('0x49')](_0xc6714d)[_0x21b3('0x26')](handleEntityNotFound(_0x54cdcf,null))[_0x21b3('0x26')](function(_0x22a982){if(_0x22a982){var _0x412c1d=_0x22a982[_0x21b3('0x4d')]({'plain':!![]});_0x412c1d=qs['omit'](_0x412c1d,['id','createdAt',_0x21b3('0x4e'),'crudPermissions']);_0xa07276[_0x21b3('0x4b')]=_[_0x21b3('0x4f')](_0xa07276['body'],['id',_0x21b3('0x50'),_0x21b3('0x4e')]);return db[_0x21b3('0x51')][_0x21b3('0x52')](function(_0x45b0cc){return db[_0x21b3('0x2d')]['create'](_[_0x21b3('0x41')](_0x412c1d,_0xa07276[_0x21b3('0x4b')]),{'include':_0xa07276[_0x21b3('0x33')][_0x21b3('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x45b0cc})['then'](function(_0x5ba2e2){var _0x210961=_0x5ba2e2[_0x21b3('0x4d')]({'plain':!![]});return db[_0x21b3('0x53')][_0x21b3('0x47')]({'where':{'userProfileId':_0xa07276['params']['id']},'raw':!![]})['then'](function(_0xc6ec17){if(_0xc6ec17){return BPromise[_0x21b3('0x54')](_0xc6ec17,function(_0x54d676){return new BPromise(function(_0x5f0834,_0x272ab8){if(_0x54d676[_0x21b3('0x55')]===null||_0x54d676[_0x21b3('0x55')]===0x1)_0x5f0834(null);return db[_0x21b3('0x56')][_0x21b3('0x47')]({'where':{'sectionId':_0x54d676['id']},'raw':!![]})[_0x21b3('0x26')](function(_0x84ff6a){var _0x49dd00=_[_0x21b3('0x42')](_0x84ff6a,function(_0x21e788){return qs[_0x21b3('0x4f')](_0x21e788,['id','createdAt',_0x21b3('0x4e'),_0x21b3('0x57')]);});_0x5f0834(_0x49dd00);})[_0x21b3('0x4c')](function(_0x1beca9){_0x272ab8(_0x1beca9);});})[_0x21b3('0x26')](function(_0x3b01aa){var _0x44a819=qs[_0x21b3('0x4f')](_0x54d676,['id',_0x21b3('0x50'),_0x21b3('0x4e')]);_0x44a819[_0x21b3('0x58')]=_0x210961['id'];if(_0x3b01aa)_0x44a819['Resources']=_0x3b01aa;return _0x44a819;})['then'](function(_0x3244a0){return db[_0x21b3('0x53')]['create'](_0x3244a0,{'include':[{'model':db[_0x21b3('0x56')],'as':_0x21b3('0x59')}],'raw':!![],'transaction':_0x45b0cc});});})[_0x21b3('0x26')](function(){return _0x210961;});}});});});}})[_0x21b3('0x26')](respondWithResult(_0x54cdcf,0xc9))[_0x21b3('0x4c')](handleError(_0x54cdcf,null));};exports[_0x21b3('0x5a')]=function(_0x1daed7,_0x557e2b){if(_0x1daed7[_0x21b3('0x4b')]['id']){delete _0x1daed7[_0x21b3('0x4b')]['id'];}return db[_0x21b3('0x2d')]['find']({'where':{'id':_0x1daed7[_0x21b3('0x48')]['id']}})[_0x21b3('0x26')](handleEntityNotFound(_0x557e2b,null))[_0x21b3('0x26')](saveUpdates(_0x1daed7[_0x21b3('0x4b')],null))[_0x21b3('0x26')](respondWithResult(_0x557e2b,null))[_0x21b3('0x4c')](handleError(_0x557e2b,null));};exports[_0x21b3('0x27')]=function(_0x208881,_0x4b89a0){return db['UserProfile'][_0x21b3('0x49')]({'where':{'id':_0x208881[_0x21b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b89a0,null))[_0x21b3('0x26')](removeEntity(_0x4b89a0,null))[_0x21b3('0x4c')](handleError(_0x4b89a0,null));};exports[_0x21b3('0x5b')]=function(_0x5c2de9,_0x292f26){return db[_0x21b3('0x2d')]['describe']()[_0x21b3('0x26')](respondWithResult(_0x292f26,null))['catch'](handleError(_0x292f26,null));};exports[_0x21b3('0x5c')]=function(_0x944939,_0x254624){var _0x459a67=_0x944939[_0x21b3('0x4b')];return db[_0x21b3('0x2d')]['find']({'where':{'id':_0x944939['params']['id']}})[_0x21b3('0x26')](handleEntityNotFound(_0x254624,null))[_0x21b3('0x26')](function(_0x32d0b2){if(_0x32d0b2){return db[_0x21b3('0x51')][_0x21b3('0x52')](function(_0x12d6d8){return db[_0x21b3('0x53')]['destroy']({'where':{'userProfileId':_0x944939[_0x21b3('0x48')]['id'],'sectionId':_[_0x21b3('0x42')](_0x459a67,function(_0x440702){return _0x440702[_0x21b3('0x57')];})},'transaction':_0x12d6d8})['then'](function(){var _0x299dfe=_[_0x21b3('0x42')](_0x459a67,function(_0x2ea818){_0x2ea818['userProfileId']=_0x944939[_0x21b3('0x48')]['id'];return _0x2ea818;});var _0x30c318=[];return BPromise[_0x21b3('0x54')](_0x299dfe,function(_0x230d36){return db[_0x21b3('0x53')]['create'](_0x230d36,{'include':[{'model':db[_0x21b3('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x12d6d8})[_0x21b3('0x26')](function(_0x10d701){_0x30c318[_0x21b3('0x5d')](_0x10d701['get']({'plain':!![]}));});})['then'](function(){return _0x30c318;});});});}})[_0x21b3('0x26')](function(_0x44c4c1){return _0x44c4c1;})['then'](respondWithResult(_0x254624,null))['catch'](handleError(_0x254624,null));};exports[_0x21b3('0x5e')]=function(_0x3506f4,_0x3894da){var _0x30972f;return db['UserProfile'][_0x21b3('0x49')]({'where':{'id':_0x3506f4[_0x21b3('0x48')]['id']},'attributes':['id',_0x21b3('0x2a')]})[_0x21b3('0x26')](handleEntityNotFound(_0x3894da,null))['then'](function(_0x333553){if(_0x333553){_0x30972f=_0x333553;return db['UserProfileSection'][_0x21b3('0x27')]({'where':{'userProfileId':_0x3506f4[_0x21b3('0x48')]['id'],'sectionId':_0x3506f4['query'][_0x21b3('0x5f')]}});}})['then'](function(){return _0x30972f;})['then'](respondWithStatusCode(_0x3894da,null))['catch'](handleError(_0x3894da,null));};exports[_0x21b3('0x60')]=function(_0x4f9c19,_0x431c3d){var _0xf6f83d=[];var _0x4d30ca=[];return db[_0x21b3('0x53')][_0x21b3('0x47')]({'where':{'userProfileId':_0x4f9c19[_0x21b3('0x48')]['id']},'raw':!![]})['then'](function(_0x33766b){_0xf6f83d=_[_0x21b3('0x40')](_0x33766b,function(_0x43f003){return _0x43f003[_0x21b3('0x61')]===0x1||_[_0x21b3('0x62')]([0x3eb,0x709],_0x43f003[_0x21b3('0x57')]);});if(!_['isEmpty'](_0xf6f83d)){return _[_0x21b3('0x42')](_0xf6f83d,function(_0x26cee2){return _0x26cee2[_0x21b3('0x57')];});}else{return;}})[_0x21b3('0x26')](function(_0xd567b8){if(_0xd567b8)_0x4d30ca=_0xd567b8;if(_[_0x21b3('0x62')](_0x4d30ca,0x64)){var _0x54f0c3=_[_0x21b3('0x49')](_0xf6f83d,{'sectionId':0x64});return hasDefaultDashboard(_0x54f0c3)[_0x21b3('0x26')](function(_0x305f0d){return _[_0x21b3('0x42')](_0xf6f83d,function(_0x112a3c){if(_0x112a3c[_0x21b3('0x57')]===0x64){_0x112a3c[_0x21b3('0x63')]=_0x305f0d;}return _0x112a3c;});});}else{return;}})[_0x21b3('0x26')](function(_0x528860){if(_0x528860)_0xf6f83d=_0x528860;if(_['includes'](_0x4d30ca,0x3eb)){var _0x2115e9=_['find'](_0xf6f83d,{'sectionId':0x3eb});return getCustomDashboards(_0x2115e9)[_0x21b3('0x26')](function(_0x3d770a){return _[_0x21b3('0x42')](_0xf6f83d,function(_0x16b1f1){if(_0x2115e9['enabled']){if(_0x16b1f1['sectionId']===0x3eb){_0x16b1f1[_0x21b3('0x63')]=_0x3d770a;}}else{if(_0x16b1f1[_0x21b3('0x57')]===0x64){if(!_0x16b1f1['subsections']){_0x16b1f1[_0x21b3('0x63')]=[];}_0x16b1f1[_0x21b3('0x63')]=_0x16b1f1[_0x21b3('0x63')][_0x21b3('0x64')](_0x3d770a);}}return _0x16b1f1;});});}else{return;}})['then'](function(_0x1e9df6){if(_0x1e9df6)_0xf6f83d=_0x1e9df6;if(_[_0x21b3('0x62')](_0x4d30ca,0x709)){var _0x452715=_[_0x21b3('0x49')](_0xf6f83d,{'sectionId':0x709});return getPlugins(_0x452715)[_0x21b3('0x26')](function(_0x12d143){if(_0x452715[_0x21b3('0x61')]){return _[_0x21b3('0x42')](_0xf6f83d,function(_0x203b12){if(_0x203b12[_0x21b3('0x57')]===0x709){_0x203b12['subsections']=_0x12d143;}return _0x203b12;});}else{var _0x464396={'sectionId':0x76c,'enabled':0x1,'subsections':_0x12d143};var _0x1dbfc3=_[_0x21b3('0x42')](_0xf6f83d);_0x1dbfc3[_0x21b3('0x5d')](_0x464396);return _0x1dbfc3;}});}else{return;}})[_0x21b3('0x26')](function(_0x2b943c){if(_0x2b943c)_0xf6f83d=_0x2b943c;return _['filter'](_0xf6f83d,['enabled',0x1]);})[_0x21b3('0x26')](respondWithResult(_0x431c3d,null))['catch'](handleError(_0x431c3d,null));};function hasDefaultDashboard(_0x40cd08){var _0x46a4e7=[0x65];return new BPromise(function(_0x20dada,_0x3553d7){try{if(_0x40cd08[_0x21b3('0x55')]){_0x20dada(_0x46a4e7);}else{return db[_0x21b3('0x56')]['findOne']({'where':{'sectionId':_0x40cd08['id']},'raw':!![]})['then'](function(_0x49b690){_0x49b690?_0x20dada(_0x46a4e7):_0x20dada();});}}catch(_0x3ea847){_0x3553d7(_0x3ea847);}});}function getCustomDashboards(_0x2b1cda){var _0x2677fe=[];return new BPromise(function(_0xac1d0e,_0x49cf18){try{if(_0x2b1cda[_0x21b3('0x55')]){return db['Dashboard']['findAll']({'raw':!![]})[_0x21b3('0x26')](function(_0x3317f4){_0x3317f4['forEach'](function(_0x48c661){_0x2677fe[_0x21b3('0x5d')](_0x48c661['id']+0x1869f);});_0xac1d0e(_0x2677fe);});}else{return db[_0x21b3('0x56')][_0x21b3('0x47')]({'where':{'sectionId':_0x2b1cda['id']},'raw':!![]})['then'](function(_0x389e0d){_0x389e0d[_0x21b3('0x65')](function(_0x2cd24d){_0x2677fe[_0x21b3('0x5d')](_0x2cd24d['resourceId']+0x1869f);});_0xac1d0e(_0x2677fe);});}}catch(_0x29f7ec){_0x49cf18(_0x29f7ec);}});}function getPlugins(_0x27e5ba){var _0x3247e5=[];return new BPromise(function(_0x4a6fce,_0xa6d738){try{if(_0x27e5ba[_0x21b3('0x55')]){return db[_0x21b3('0x66')]['findAll']({'raw':!![]})[_0x21b3('0x26')](function(_0x5f3147){_0x5f3147[_0x21b3('0x65')](function(_0x5dbb1b){_0x3247e5[_0x21b3('0x5d')](_0x5dbb1b['id']+0x15b38);});_0x4a6fce(_0x3247e5);});}else{return db[_0x21b3('0x56')][_0x21b3('0x47')]({'where':{'sectionId':_0x27e5ba['id']},'raw':!![]})[_0x21b3('0x26')](function(_0x9cc4f9){_0x9cc4f9[_0x21b3('0x65')](function(_0x8b7c5d){_0x3247e5[_0x21b3('0x5d')](_0x8b7c5d[_0x21b3('0x67')]+0x15b38);});_0x4a6fce(_0x3247e5);});}}catch(_0x4d48c8){_0xa6d738(_0x4d48c8);}});}exports[_0x21b3('0x68')]=function(_0x177463,_0x102e1a){return db[_0x21b3('0x2d')][_0x21b3('0x49')]({'where':{'id':_0x177463[_0x21b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x102e1a,null))[_0x21b3('0x26')](function(_0x3efcc5){if(_0x3efcc5){return db[_0x21b3('0x51')][_0x21b3('0x52')](function(_0x2c00ea){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x177463[_0x21b3('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x3b46ae){if(_0x3b46ae){return db['UserProfileSection'][_0x21b3('0x27')]({'where':{'userProfileId':_0x177463[_0x21b3('0x48')]['id'],'id':_['map'](_0x3b46ae,function(_0x56ffdf){return _0x56ffdf['id'];})},'transaction':_0x2c00ea});}})[_0x21b3('0x26')](function(_0xbf2a6a){var _0x53ada9=_['map'](_0x177463[_0x21b3('0x4b')],function(_0x272c6c){_0x272c6c[_0x21b3('0x58')]=_0x177463['params']['id'];return _0x272c6c;});return db[_0x21b3('0x53')][_0x21b3('0x69')](_0x53ada9,{'raw':!![],'transaction':_0x2c00ea});})['then'](function(_0x58c55d){var _0x52916e=_[_0x21b3('0x40')](_[_0x21b3('0x42')](_0x58c55d,function(_0x59f599){return _0x59f599[_0x21b3('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x52916e){return db[_0x21b3('0x53')][_0x21b3('0x47')]({'where':{'userProfileId':_0x177463['params']['id'],'sectionId':_[_0x21b3('0x42')](_0x52916e,function(_0x386eef){return _0x386eef[_0x21b3('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x21b3('0x26')](function(_0x4ad083){var _0xd87906=_[_0x21b3('0x42')](_0x177463[_0x21b3('0x4b')],function(_0x3abd59){_0x3abd59[_0x21b3('0x58')]=_0x177463[_0x21b3('0x48')]['id'];return _0x3abd59;});return db['UserProfileResource'][_0x21b3('0x69')](_0xd87906,{'raw':!![],'transaction':_0x2c00ea});});}})[_0x21b3('0x4c')](handleError(_0x102e1a,null));});}})['then'](function(_0x3d1818){var _0x30c6bd=_[_0x21b3('0x42')](_0x3d1818,function(_0x3b9b45){return _0x3b9b45[_0x21b3('0x4d')]({'plain':!![]});});})[_0x21b3('0x26')](respondWithResult(_0x102e1a,null))[_0x21b3('0x4c')](handleError(_0x102e1a,null));};exports[_0x21b3('0x6a')]=function(_0x44d998,_0x51c10a,_0x550eff){return db[_0x21b3('0x2d')][_0x21b3('0x49')]({'where':{'id':_0x44d998[_0x21b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x51c10a,null))[_0x21b3('0x26')](function(_0x13d0d7){if(_0x13d0d7){return _0x13d0d7[_0x21b3('0x6a')](_0x44d998[_0x21b3('0x33')][_0x21b3('0x5f')]);}})['then'](respondWithStatusCode(_0x51c10a,null))[_0x21b3('0x4c')](handleError(_0x51c10a,null));};exports[_0x21b3('0x6b')]=function(_0x4eb5b3,_0x1833bb){var _0x1a8f9e={};if(!_0x4eb5b3[_0x21b3('0x33')]['section'])throw new Error(_0x21b3('0x6c'));if(!_0x4eb5b3[_0x21b3('0x33')][_0x21b3('0x3a')](_0x21b3('0x3b'))){_0x1a8f9e[_0x21b3('0x1e')]=qs[_0x21b3('0x1e')](_0x4eb5b3['query'][_0x21b3('0x1e')]);_0x1a8f9e[_0x21b3('0x1c')]=qs[_0x21b3('0x1c')](_0x4eb5b3[_0x21b3('0x33')][_0x21b3('0x1c')]);}return db[_0x21b3('0x2d')][_0x21b3('0x49')]({'where':{'id':_0x4eb5b3['params']['id']}})['then'](function(_0x586201){if(!_0x586201)throw new Error(_0x21b3('0x6d')+_0x4eb5b3[_0x21b3('0x48')]['id']);return db[_0x21b3('0x2d')]['getResources'](_0x4eb5b3);})[_0x21b3('0x26')](respondWithFilteredResult(_0x1833bb,_0x1a8f9e))[_0x21b3('0x4c')](handleError(_0x1833bb,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8b8847f..ffda6ff 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 _0x38b2=['UserProfile','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x26e402,_0x3e1631){var _0x1bb4cc=function(_0x33de90){while(--_0x33de90){_0x26e402['push'](_0x26e402['shift']());}};_0x1bb4cc(++_0x3e1631);}(_0x38b2,0xf6));var _0x238b=function(_0x2a305d,_0x225fa9){_0x2a305d=_0x2a305d-0x0;var _0x518112=_0x38b2[_0x2a305d];return _0x518112;};'use strict';var EventEmitter=require(_0x238b('0x0'));var UserProfile=require(_0x238b('0x1'))['db'][_0x238b('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x238b('0x3'),'afterDestroy':_0x238b('0x4')};function emitEvent(_0x4df021){return function(_0x44251b,_0x4c4f0e,_0x44ddd2){UserProfileEvents[_0x238b('0x5')](_0x4df021+':'+_0x44251b['id'],_0x44251b);UserProfileEvents[_0x238b('0x5')](_0x4df021,_0x44251b);_0x44ddd2(null);};}for(var e in events){if(events[_0x238b('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x238b('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1267=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x1267,0xb5));var _0x7126=function(_0xac51fb,_0x198ed5){_0xac51fb=_0xac51fb-0x0;var _0x1f42ff=_0x1267[_0xac51fb];return _0x1f42ff;};'use strict';var EventEmitter=require(_0x7126('0x0'));var UserProfile=require(_0x7126('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7126('0x2'),'afterUpdate':_0x7126('0x3'),'afterDestroy':_0x7126('0x4')};function emitEvent(_0x3587d0){return function(_0x35f8e5,_0x403ed4,_0x4346f7){UserProfileEvents['emit'](_0x3587d0+':'+_0x35f8e5['id'],_0x35f8e5);UserProfileEvents[_0x7126('0x5')](_0x3587d0,_0x35f8e5);_0x4346f7(null);};}for(var e in events){if(events[_0x7126('0x6')](e)){var event=events[e];UserProfile[_0x7126('0x7')](e,emitEvent(event));}}module[_0x7126('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 4d8895a..c943cf2 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 _0x3140=['freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','metrics','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','params','all','ignore','union','find','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','Tags','tag','ThroughTags','openTabs','true','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','value','findAll','associatedResources','map','field','model','then','UserProfileResource','AnalyticExtractedReport','resourceId','catch','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','Agents','membername','User','agent','Telephones','role','queue','VoiceQueue','QueueCampaigns','type','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsaccounts','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount'];(function(_0x348206,_0x166737){var _0x1b39e7=function(_0x17408f){while(--_0x17408f){_0x348206['push'](_0x348206['shift']());}};_0x1b39e7(++_0x166737);}(_0x3140,0x1f2));var _0x0314=function(_0x109b6e,_0xbf489f){_0x109b6e=_0x109b6e-0x0;var _0x1e8595=_0x3140[_0x109b6e];return _0x1e8595;};'use strict';var _=require(_0x0314('0x0'));var attributes=require(_0x0314('0x1'));var qs=require(_0x0314('0x2'));var squel=require(_0x0314('0x3'));module[_0x0314('0x4')]=function(_0x16f84b){var _0x1fa79d=_0x16f84b['models'];function _0x349db1(_0x4b5a6e,_0x3f1124){return new Promise(function(_0x323b30,_0xa3ebab){if(!_0x3f1124)return _0x323b30(null);var _0x385cff=_0x3f1124[_0x0314('0x5')]?{[_0x3f1124[_0x0314('0x5')]['field']]:_0x3f1124[_0x0314('0x5')][_0x0314('0x6')]}:undefined;return _0x1fa79d[_0x4b5a6e][_0x0314('0x7')]({'where':_0x385cff,'raw':!![]})['then'](function(_0x440983){_0x3f1124[_0x0314('0x8')]=_[_0x0314('0x9')](_0x440983,'id');_0x323b30(_0x3f1124);})['catch'](function(_0x1b298d){_0xa3ebab(_0x1b298d);});});}function _0x3f18cd(_0x5e0be8,_0x4caef9){return new Promise(function(_0x408417,_0x542703){var _0x314e17=_0x5e0be8[_0x0314('0x5')]?{[_0x5e0be8[_0x0314('0x5')][_0x0314('0xa')]]:_0x5e0be8[_0x0314('0x5')][_0x0314('0x6')]}:undefined;return _0x1fa79d[_0x5e0be8[_0x0314('0xb')]][_0x0314('0x7')]({'where':_0x314e17,'raw':!![]})[_0x0314('0xc')](function(_0x13c948){_0x4caef9[_0x0314('0x8')]=_[_0x0314('0x9')](_0x13c948,function(_0x262b23){return _0x262b23['name'];});_0x408417(_0x4caef9);})['catch'](function(_0x3cb199){_0x542703(_0x3cb199);});});}function _0xcb9e98(_0x5b4e01,_0x2f321c,_0x431344){if(!_0x2f321c)return Promise['resolve'](null);return new Promise(function(_0x57c678,_0x422f7b){return _0x1fa79d[_0x0314('0xd')][_0x0314('0x7')]({'where':{'sectionId':_0x2f321c['id']},'raw':!![]})[_0x0314('0xc')](function(_0x4d35c7){if(_0x5b4e01[_0x0314('0xa')]&&_0x5b4e01[_0x0314('0xa')]!=='id'){_0x2f321c[_0x0314('0x8')]=_['map'](_0x4d35c7,function(_0x221f18){return _0x221f18[_0x5b4e01[_0x0314('0xa')]];});}else{if(_0x431344===_0x0314('0xe')){_0x2f321c['associatedResources']=_[_0x0314('0x9')](_0x4d35c7,function(_0x3c2b6c){return{'id':_0x3c2b6c[_0x0314('0xf')],'type':_0x3c2b6c['type']};});}else{_0x2f321c[_0x0314('0x8')]=_[_0x0314('0x9')](_0x4d35c7,function(_0x584520){return _0x584520[_0x0314('0xf')];});}}_0x57c678(_0x2f321c);})[_0x0314('0x10')](function(_0x518d21){_0x422f7b(_0x518d21);});});}function _0x3a2a09(_0xda8725,_0x5ade57){var _0x274193={'parentSections':[]};switch(_0xda8725[_0x0314('0x11')]()){case _0x0314('0x12'):_0x274193[_0x0314('0x13')]=_0x0314('0x14');break;case _0x0314('0x15'):_0x274193[_0x0314('0x13')]=_0x0314('0x16');break;case _0x0314('0x17'):_0x274193['childModel']=_0x0314('0x18');_0x274193[_0x0314('0x19')]=[{'name':'SquareProjects','field':_0x0314('0x1a'),'foreignKey':_0x0314('0x1b')}];break;case _0x0314('0x1c'):_0x274193['childModel']=_0x0314('0x1d');break;case _0x0314('0x1e'):_0x274193[_0x0314('0x13')]=_0x0314('0x1f');_0x274193[_0x0314('0x19')]=[{'name':_0x0314('0x20'),'field':'id','foreignKey':_0x0314('0x21')}];break;case'lists':_0x274193[_0x0314('0x13')]=_0x0314('0x22');break;case _0x0314('0x23'):_0x274193[_0x0314('0x13')]=_0x0314('0x24');break;case _0x0314('0x25'):_0x274193[_0x0314('0x13')]='CmCustomField';break;case _0x0314('0x26'):_0x274193[_0x0314('0x13')]=_0x0314('0x27');break;case _0x0314('0x28'):_0x274193[_0x0314('0x13')]='ChatWebsite';break;case _0x0314('0x29'):_0x274193[_0x0314('0x13')]=_0x0314('0x2a');break;case _0x0314('0x2b'):_0x274193[_0x0314('0x13')]=_0x0314('0x2c');break;case _0x0314('0x2d'):case _0x0314('0x2e'):case _0x0314('0x2f'):_0x274193[_0x0314('0x13')]=_0x0314('0x30');break;case'contexts':_0x274193[_0x0314('0x13')]=_0x0314('0x31');break;case'voicemails':_0x274193[_0x0314('0x13')]=_0x0314('0x32');break;case _0x0314('0x33'):_0x274193['childModel']='VoiceRecording';_0x274193[_0x0314('0x19')]=[{'name':_0x0314('0x34'),'field':_0x0314('0x1a'),'foreignKey':_0x0314('0x35'),'model':_0x0314('0x36'),'filter':{'field':'role','value':[_0x0314('0x37')]}},{'name':_0x0314('0x38'),'field':_0x0314('0x1a'),'foreignKey':_0x0314('0x35'),'model':_0x0314('0x36'),'filter':{'field':_0x0314('0x39'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x0314('0x1a'),'foreignKey':_0x0314('0x3a'),'model':_0x0314('0x3b'),'filter':{'field':'type','value':['inbound']}},{'name':_0x0314('0x3c'),'field':_0x0314('0x1a'),'foreignKey':_0x0314('0x3a'),'model':_0x0314('0x3b'),'filter':{'field':_0x0314('0x3d'),'value':[_0x0314('0x3e')]}}];break;case'musiconholds':_0x274193[_0x0314('0x13')]=_0x0314('0x3f');break;case _0x0314('0x40'):_0x274193[_0x0314('0x13')]=_0x0314('0x41');break;case'voiceprefixes':_0x274193[_0x0314('0x13')]=_0x0314('0x42');break;case _0x0314('0x43'):_0x274193[_0x0314('0x13')]='Campaign';break;case'mailqueues':_0x274193[_0x0314('0x13')]=_0x0314('0x44');break;case _0x0314('0x45'):_0x274193[_0x0314('0x13')]=_0x0314('0x46');break;case _0x0314('0x47'):_0x274193[_0x0314('0x13')]=_0x0314('0x48');break;case _0x0314('0x49'):_0x274193['childModel']=_0x0314('0x4a');break;case _0x0314('0x4b'):_0x274193[_0x0314('0x13')]='OpenchannelAccount';break;case'smsqueues':_0x274193[_0x0314('0x13')]='SmsQueue';break;case _0x0314('0x4c'):_0x274193['childModel']='SmsAccount';break;case _0x0314('0x4d'):_0x274193[_0x0314('0x13')]=_0x0314('0x4e');break;case'whatsappaccounts':_0x274193[_0x0314('0x13')]=_0x0314('0x4f');break;case _0x0314('0x50'):_0x274193[_0x0314('0x13')]=_0x0314('0x51');break;case _0x0314('0x52'):case _0x0314('0x53'):_0x274193[_0x0314('0x13')]=_0x0314('0x3b');if(_0x5ade57){_0x274193['parentSections']=[{'name':'VoiceQueues'},{'name':_0x0314('0x3c')}];}break;case _0x0314('0x54'):case _0x0314('0x55'):case'telephones':_0x274193[_0x0314('0x13')]=_0x0314('0x36');if(_0x5ade57){_0x274193[_0x0314('0x19')]=[{'name':_0x0314('0x56'),'filter':{'field':'role','value':[_0x0314('0x57'),_0x0314('0x58')]},'ignore':!![]},{'name':_0x0314('0x34')},{'name':_0x0314('0x38')}];}break;case _0x0314('0x59'):_0x274193['childModel']=_0x0314('0x5a');break;case _0x0314('0x5b'):_0x274193[_0x0314('0x13')]=_0x0314('0x5c');break;case _0x0314('0x5d'):_0x274193[_0x0314('0x13')]='FreshdeskAccount';break;case _0x0314('0x5e'):_0x274193[_0x0314('0x13')]=_0x0314('0x5f');break;case _0x0314('0x60'):_0x274193[_0x0314('0x13')]=_0x0314('0x61');break;case'zohoaccounts':_0x274193[_0x0314('0x13')]=_0x0314('0x62');break;case _0x0314('0x63'):_0x274193['childModel']=_0x0314('0x36');break;case _0x0314('0x64'):_0x274193[_0x0314('0x13')]=_0x0314('0x65');break;case'dispositions':_0x274193[_0x0314('0x13')]='Disposition';break;case _0x0314('0x66'):_0x274193[_0x0314('0x13')]=_0x0314('0x67');break;case _0x0314('0x68'):_0x274193[_0x0314('0x13')]=_0x0314('0x69');break;case _0x0314('0x6a'):_0x274193['childModel']=_0x0314('0x6b');break;case _0x0314('0x6c'):_0x274193[_0x0314('0x13')]=_0x0314('0x6d');break;case'sounds':_0x274193[_0x0314('0x13')]=_0x0314('0x6e');break;case _0x0314('0x6f'):_0x274193[_0x0314('0x13')]=_0x0314('0x70');break;case _0x0314('0x71'):_0x274193[_0x0314('0x13')]=_0x0314('0x72');break;case _0x0314('0x73'):_0x274193[_0x0314('0x13')]='Trigger';break;case _0x0314('0x74'):_0x274193[_0x0314('0x13')]=_0x0314('0x75');break;case'variables':_0x274193[_0x0314('0x13')]=_0x0314('0x76');break;case _0x0314('0x77'):_0x274193[_0x0314('0x13')]=_0x0314('0x78');break;case _0x0314('0x79'):_0x274193[_0x0314('0x13')]=_0x0314('0xe');_0x274193[_0x0314('0x19')]=[{'name':_0x0314('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x0314('0x7b'):_0x274193[_0x0314('0x13')]='AnalyticMetric';break;}return _0x274193;}function _0x33df23(_0x116c9b,_0x3c8218){var _0x5d8c48=_0x116c9b[_0x0314('0x7c')](0x0)[_0x0314('0x7d')]()+_0x116c9b[_0x0314('0x7e')](0x1);var _0x324046={'type':_0x1fa79d['Sequelize']['QueryTypes'][_0x0314('0x7f')],'raw':!![]};return new Promise(function(_0x3f5fb5,_0x2eedd2){var _0x34ddda=squel[_0x0314('0x80')]()['field'](_0x0314('0x81')+_0x5d8c48+_0x0314('0x82'),'id')[_0x0314('0xa')](_0x0314('0x83'))['from'](_0x0314('0x84')+_0x116c9b+_0x0314('0x85'),'ui')[_0x0314('0x86')](_0x0314('0x87'),_0x3c8218['id']);return _0x1fa79d[_0x0314('0x88')]['query'](_0x34ddda[_0x0314('0x89')](),_0x324046)[_0x0314('0xc')](function(_0x457c11){_0x3c8218[_0x5d8c48+_0x0314('0x8a')]=_0x457c11;_0x3f5fb5(_0x457c11);})[_0x0314('0x10')](function(_0x4d3f8c){_0x2eedd2(_0x4d3f8c);});});}return _0x16f84b[_0x0314('0x8b')](_0x0314('0x8c'),attributes,{'tableName':_0x0314('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x53c136){var _0x286582={'raw':_0x53c136[_0x0314('0x8e')][_0x0314('0x8f')],'where':{}};var _0x2c8203={};var _0x5c1773={'count':0x0,'rows':[]};var _0x15d4c8=_0x53c136[_0x0314('0x8e')][_0x0314('0x90')];var _0x30d2af=_0x53c136['query'][_0x0314('0x91')]||![];var _0x22d0bc=_0x3a2a09(_0x15d4c8,_0x30d2af);if(!_0x22d0bc['childModel'])throw new Error(_0x0314('0x92')+_0x15d4c8+'\x27');var _0x2086d1=[{'name':_0x15d4c8}];if(!_[_0x0314('0x93')](_0x22d0bc[_0x0314('0x19')]))_0x2086d1=_0x22d0bc[_0x0314('0x19')];var _0x2488bb=[];for(var _0x2207d8=0x0;_0x2207d8<_0x2086d1[_0x0314('0x94')];_0x2207d8++){_0x2488bb[_0x0314('0x95')](_0x1fa79d[_0x0314('0x96')]['find']({'where':{'userProfileId':_0x53c136[_0x0314('0x97')]['id'],'name':_0x2086d1[_0x2207d8][_0x0314('0x1a')]},'raw':!![]}));}return Promise[_0x0314('0x98')](_0x2488bb)['then'](function(_0x9b4b3f){var _0x1ab063=_['filter'](_0x9b4b3f,function(_0x5d2062){return _0x5d2062?_0x5d2062:undefined;});var _0x5ce420=_[_0x0314('0x5')](_0x2086d1,[_0x0314('0x99'),!![]]);var _0x2c65de=_[_0x0314('0x93')](_0x1ab063)&&_[_0x0314('0x93')](_0x5ce420)?null:_[_0x0314('0x9a')](_0x5ce420,_0x1ab063);if(!_0x2c65de)return null;var _0x4a5d32=[];for(var _0x21fc36=0x0;_0x21fc36<_0x2c65de[_0x0314('0x94')];_0x21fc36++){var _0x50e10d=_[_0x0314('0x9b')](_0x2086d1,function(_0xe5303b){return _0x2c65de[_0x21fc36]?_0xe5303b[_0x0314('0x1a')]===_0x2c65de[_0x21fc36]['name']:null;});if(_0x50e10d){if(_0x2c65de[_0x21fc36][_0x0314('0x99')]){_0x4a5d32[_0x0314('0x95')](_0x349db1(_0x22d0bc[_0x0314('0x13')],_0x2c65de[_0x21fc36]));}else{if(!_0x2c65de[_0x21fc36]['autoAssociation']){_0x4a5d32[_0x0314('0x95')](_0xcb9e98(_0x50e10d,_0x2c65de[_0x21fc36],_0x22d0bc[_0x0314('0x13')]));}else{if(_0x50e10d['model']){_0x4a5d32[_0x0314('0x95')](_0x3f18cd(_0x50e10d,_0x2c65de[_0x21fc36]));}}}}}return Promise[_0x0314('0x98')](_0x4a5d32);})[_0x0314('0xc')](function(_0x2c64b6){var _0x5282dc=_0x2c64b6;var _0x4fbd62=null;if(_0x5282dc){_0x4fbd62=_0x5282dc[_0x0314('0x94')]===0x1?_0x5282dc[0x0]:null;}if(!_0x4fbd62&&!_0x5282dc)return _0x5c1773;var _0x28e7cc=_0x1fa79d[_0x22d0bc[_0x0314('0x13')]][_0x0314('0x9c')];_0x2c8203['model']=_[_0x0314('0x9d')](_0x28e7cc);_0x2c8203['query']=_[_0x0314('0x9d')](_0x53c136[_0x0314('0x8e')]);_0x2c8203['filters']=_[_0x0314('0x9e')](_0x2c8203[_0x0314('0xb')],_0x2c8203[_0x0314('0x8e')]);_0x286582[_0x0314('0x9f')]=_['intersection'](_0x2c8203[_0x0314('0xb')],qs[_0x0314('0xa0')](_0x53c136['query'][_0x0314('0xa0')]));_0x286582[_0x0314('0x9f')]=_0x286582['attributes']['length']?_0x286582[_0x0314('0x9f')]:_0x2c8203[_0x0314('0xb')];if(!_0x53c136[_0x0314('0x8e')][_0x0314('0xa1')](_0x0314('0xa2'))){_0x286582[_0x0314('0xa3')]=qs[_0x0314('0xa3')](_0x53c136[_0x0314('0x8e')][_0x0314('0xa3')]);_0x286582['offset']=qs['offset'](_0x53c136['query'][_0x0314('0xa4')]);}_0x286582[_0x0314('0xa5')]=qs['sort'](_0x53c136[_0x0314('0x8e')][_0x0314('0xa6')]);_0x286582['where']=qs[_0x0314('0xa7')](_['pick'](_0x53c136[_0x0314('0x8e')],_0x2c8203[_0x0314('0xa7')]));if(_0x53c136['query']['filter']){_0x286582[_0x0314('0x86')]=_[_0x0314('0xa8')](_0x286582[_0x0314('0x86')],{'$or':_[_0x0314('0x9')](_0x28e7cc,function(_0xf3a329){if(_0xf3a329[_0x0314('0x3d')][_0x0314('0xa9')]!==_0x0314('0xaa')){var _0x37d6d7={};_0x37d6d7[_0xf3a329[_0x0314('0xa')]]={'$like':'%'+_0x53c136['query'][_0x0314('0x5')]+'%'};return _0x37d6d7;}})});}var _0x5bb22d=[];var _0x4cbabc=null;var _0x498f35={};if(_0x4fbd62){_0x4cbabc=_['find'](_0x2086d1,['name',_0x4fbd62[_0x0314('0x1a')]]);if(_0x4cbabc[_0x0314('0xa')]){_0x498f35={};if(_0x22d0bc[_0x0314('0x13')]==='AnalyticExtractedReport'){_0x498f35[_0x4cbabc[_0x0314('0xab')]]=_[_0x0314('0x9')](_0x4fbd62[_0x0314('0x8')],'id');}else{_0x498f35[_0x4cbabc['foreignKey']]=_0x4fbd62[_0x0314('0x8')];}_0x5bb22d['push'](_0x498f35);}else{_0x286582[_0x0314('0x86')]['id']=_0x4fbd62[_0x0314('0x8')];}}else{for(var _0x6eb3a4=0x0;_0x6eb3a4<_0x5282dc[_0x0314('0x94')];_0x6eb3a4++){_0x4cbabc=_[_0x0314('0x9b')](_0x2086d1,[_0x0314('0x1a'),_0x5282dc[_0x6eb3a4][_0x0314('0x1a')]]);if(_0x4cbabc['field']){_0x498f35={};_0x498f35[_0x4cbabc[_0x0314('0xab')]]=_0x5282dc[_0x6eb3a4][_0x0314('0x8')];_0x5bb22d[_0x0314('0x95')](_0x498f35);}else{if(!_0x286582[_0x0314('0x86')]['id'])_0x286582[_0x0314('0x86')]['id']=[];_0x5282dc[_0x6eb3a4][_0x0314('0x8')][_0x0314('0xac')](function(_0x19a192){_0x286582['where']['id'][_0x0314('0x95')](_0x19a192);});}}}if(!_[_0x0314('0x93')](_0x5bb22d)){_0x286582['where']=_['merge'](_0x286582[_0x0314('0x86')],{'$and':{'$or':_0x5bb22d}});}_0x286582=_[_0x0314('0xa8')]({},_0x286582,_0x53c136[_0x0314('0xad')]);if(_0x4fbd62&&!_0x4fbd62[_0x0314('0xae')]&&_0x22d0bc['childModel']===_0x0314('0xe')){if(_0x53c136['query'][_0x0314('0xaf')]){_0x286582[_0x0314('0xb0')]=[{'all':!![]}];}return _0x1fa79d[_0x22d0bc['childModel']][_0x0314('0x7')](_0x286582)[_0x0314('0xc')](function(_0x5178e4){var _0xad3536=[];_0x5178e4[_0x0314('0xac')](function(_0x2d7e0){var _0x41de6d;switch(_0x2d7e0[_0x0314('0xb1')]){case _0x0314('0xb2'):_0x41de6d=_[_0x0314('0x9b')](_0x4fbd62['associatedResources'],function(_0x2d3954){return _0x2d3954['id']===_0x2d7e0[_0x0314('0xb3')]&&_0x2d3954[_0x0314('0x3d')]===_0x0314('0xb4');});break;case _0x0314('0xb5'):_0x41de6d=_['find'](_0x4fbd62['associatedResources'],function(_0x5d105a){return _0x5d105a['id']===_0x2d7e0[_0x0314('0xb3')]&&_0x5d105a[_0x0314('0x3d')]==='CustomReports';});break;}if(_0x41de6d)_0xad3536['push'](_0x2d7e0);});_0x5c1773['count']=_0xad3536[_0x0314('0x94')];_0x5c1773[_0x0314('0xb6')]=_0xad3536;return _0x5c1773;});}else{if(!_['isEmpty'](_0x53c136[_0x0314('0x8e')]['ids'])){_0x286582['where']['id']=_0x286582['where']['id']?_[_0x0314('0x9e')](_0x286582[_0x0314('0x86')]['id'],_0x53c136[_0x0314('0x8e')]['ids']):_0x53c136[_0x0314('0x8e')][_0x0314('0xb7')];if(_0x53c136[_0x0314('0x8e')][_0x0314('0xb8')]){_0x286582[_0x0314('0xa5')]=_0x53c136['query'][_0x0314('0xb8')];}}if(_0x53c136[_0x0314('0x8e')][_0x0314('0xb9')]){_0x286582['where']=_[_0x0314('0xa8')](_0x286582[_0x0314('0x86')],{'$and':_0x53c136['query'][_0x0314('0xb9')]});}return _0x1fa79d[_0x22d0bc[_0x0314('0x13')]][_0x0314('0xba')]({'where':_0x286582[_0x0314('0x86')]})['then'](function(_0x4559f2){_0x5c1773[_0x0314('0xba')]=_0x4559f2;if(_0x53c136[_0x0314('0x8e')][_0x0314('0xaf')]){if(_0x22d0bc[_0x0314('0x13')]===_0x0314('0x1f')){_0x286582[_0x0314('0xb0')]=[{'model':_0x1fa79d[_0x0314('0x70')],'as':_0x0314('0xbb'),'attributes':['id',_0x0314('0x1a'),'color'],'required':_0x53c136[_0x0314('0x8e')][_0x0314('0xbc')]?!![]:![]},{'model':_0x1fa79d[_0x0314('0x70')],'as':_0x0314('0xbd'),'attributes':['id','name','color'],'through':_0x53c136['query']['tag']?{'attributes':[],'where':{'TagId':_0x53c136[_0x0314('0x8e')]['tag']||undefined}}:{},'required':_0x53c136[_0x0314('0x8e')][_0x0314('0xbc')]?!![]:![]}];}else{_0x286582[_0x0314('0xb0')]=[{'all':!![]}];}}return _0x1fa79d[_0x22d0bc[_0x0314('0x13')]][_0x0314('0x7')](_0x286582);})[_0x0314('0xc')](function(_0x43ae83){_0x5c1773[_0x0314('0xb6')]=_0x43ae83;if(_0x15d4c8==='Agents'&&_0x53c136[_0x0314('0x8e')][_0x0314('0xbe')]===_0x0314('0xbf')){var _0x13bf7b=[];for(var _0x157da6=0x0;_0x157da6<_0x5c1773['rows'][_0x0314('0x94')];_0x157da6++){_0x13bf7b['push'](_0x33df23('chat',_0x5c1773[_0x0314('0xb6')][_0x157da6][_0x0314('0xc0')]));_0x13bf7b[_0x0314('0x95')](_0x33df23('sms',_0x5c1773[_0x0314('0xb6')][_0x157da6][_0x0314('0xc0')]));_0x13bf7b[_0x0314('0x95')](_0x33df23(_0x0314('0xc1'),_0x5c1773[_0x0314('0xb6')][_0x157da6][_0x0314('0xc0')]));_0x13bf7b[_0x0314('0x95')](_0x33df23(_0x0314('0xc2'),_0x5c1773['rows'][_0x157da6][_0x0314('0xc0')]));_0x13bf7b[_0x0314('0x95')](_0x33df23(_0x0314('0xc3'),_0x5c1773[_0x0314('0xb6')][_0x157da6][_0x0314('0xc0')]));_0x13bf7b['push'](_0x33df23(_0x0314('0xc4'),_0x5c1773[_0x0314('0xb6')][_0x157da6][_0x0314('0xc0')]));}return Promise[_0x0314('0x98')](_0x13bf7b)[_0x0314('0xc')](function(){return _0x5c1773;});}return _0x5c1773;});}});}}});}; \ No newline at end of file +var _0xed4e=['OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','queuecampaigns','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','templates','Trigger','trunks','Trunk','variables','Plugin','extractedreports','Reports','metrics','charAt','toUpperCase','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','UserProfile','raw','section','mergeResources','isEmpty','length','push','find','params','all','ignore','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','../../components/parsers/qs','exports','models','filter','value','findAll','associatedResources','catch','field','model','then','name','resolve','UserProfileResource','AnalyticExtractedReport','map','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','VoiceContext','voicerecordings','Agents','User','agent','Telephones','membername','role','telephone','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues'];(function(_0x989b4c,_0x967c63){var _0x301398=function(_0x441986){while(--_0x441986){_0x989b4c['push'](_0x989b4c['shift']());}};_0x301398(++_0x967c63);}(_0xed4e,0x134));var _0xeed4=function(_0x3af4de,_0x40af7a){_0x3af4de=_0x3af4de-0x0;var _0xa55809=_0xed4e[_0x3af4de];return _0xa55809;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0xeed4('0x0'));var squel=require('squel');module[_0xeed4('0x1')]=function(_0x56ec16){var _0x2f64fa=_0x56ec16[_0xeed4('0x2')];function _0x20521e(_0x453647,_0x11536e){return new Promise(function(_0xbb8974,_0x27ac75){if(!_0x11536e)return _0xbb8974(null);var _0x41a061=_0x11536e[_0xeed4('0x3')]?{[_0x11536e[_0xeed4('0x3')]['field']]:_0x11536e[_0xeed4('0x3')][_0xeed4('0x4')]}:undefined;return _0x2f64fa[_0x453647][_0xeed4('0x5')]({'where':_0x41a061,'raw':!![]})['then'](function(_0x1c4d98){_0x11536e[_0xeed4('0x6')]=_['map'](_0x1c4d98,'id');_0xbb8974(_0x11536e);})[_0xeed4('0x7')](function(_0x117453){_0x27ac75(_0x117453);});});}function _0x7a6dc8(_0x5a22bf,_0xeafd32){return new Promise(function(_0x125961,_0xc0e55){var _0x425b3d=_0x5a22bf[_0xeed4('0x3')]?{[_0x5a22bf[_0xeed4('0x3')][_0xeed4('0x8')]]:_0x5a22bf['filter'][_0xeed4('0x4')]}:undefined;return _0x2f64fa[_0x5a22bf[_0xeed4('0x9')]][_0xeed4('0x5')]({'where':_0x425b3d,'raw':!![]})[_0xeed4('0xa')](function(_0xba0f63){_0xeafd32[_0xeed4('0x6')]=_['map'](_0xba0f63,function(_0x5164a4){return _0x5164a4[_0xeed4('0xb')];});_0x125961(_0xeafd32);})[_0xeed4('0x7')](function(_0x5485f7){_0xc0e55(_0x5485f7);});});}function _0x10fda7(_0xaa1469,_0x52a18c,_0x43bdb7){if(!_0x52a18c)return Promise[_0xeed4('0xc')](null);return new Promise(function(_0x3b61bb,_0x2f6b7e){return _0x2f64fa[_0xeed4('0xd')][_0xeed4('0x5')]({'where':{'sectionId':_0x52a18c['id']},'raw':!![]})[_0xeed4('0xa')](function(_0x3f5213){if(_0xaa1469[_0xeed4('0x8')]&&_0xaa1469[_0xeed4('0x8')]!=='id'){_0x52a18c[_0xeed4('0x6')]=_['map'](_0x3f5213,function(_0x45a35e){return _0x45a35e[_0xaa1469[_0xeed4('0x8')]];});}else{if(_0x43bdb7===_0xeed4('0xe')){_0x52a18c[_0xeed4('0x6')]=_[_0xeed4('0xf')](_0x3f5213,function(_0x638be2){return{'id':_0x638be2[_0xeed4('0x10')],'type':_0x638be2[_0xeed4('0x11')]};});}else{_0x52a18c[_0xeed4('0x6')]=_[_0xeed4('0xf')](_0x3f5213,function(_0x5b602d){return _0x5b602d['resourceId'];});}}_0x3b61bb(_0x52a18c);})['catch'](function(_0x471bfc){_0x2f6b7e(_0x471bfc);});});}function _0x270894(_0x1232ca,_0x5b7859){var _0x2fc4f4={'parentSections':[]};switch(_0x1232ca['toLowerCase']()){case _0xeed4('0x12'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x14');break;case _0xeed4('0x15'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x16');break;case'squarerecordings':_0x2fc4f4['childModel']='SquareRecording';_0x2fc4f4[_0xeed4('0x17')]=[{'name':_0xeed4('0x18'),'field':'name','foreignKey':_0xeed4('0x19')}];break;case _0xeed4('0x1a'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x1b');break;case _0xeed4('0x1c'):_0x2fc4f4['childModel']='CmContact';_0x2fc4f4[_0xeed4('0x17')]=[{'name':_0xeed4('0x1d'),'field':'id','foreignKey':_0xeed4('0x1e')}];break;case _0xeed4('0x1f'):_0x2fc4f4[_0xeed4('0x13')]='CmList';break;case _0xeed4('0x20'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x21');break;case'globalcustomfields':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x22');break;case _0xeed4('0x23'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x24');break;case _0xeed4('0x25'):_0x2fc4f4['childModel']=_0xeed4('0x26');break;case'faxqueues':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x27');break;case _0xeed4('0x28'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x29');break;case _0xeed4('0x2a'):case _0xeed4('0x2b'):case'outboundroutes':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x2c');break;case'contexts':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x2d');break;case'voicemails':_0x2fc4f4[_0xeed4('0x13')]='VoiceMail';break;case _0xeed4('0x2e'):_0x2fc4f4[_0xeed4('0x13')]='VoiceRecording';_0x2fc4f4[_0xeed4('0x17')]=[{'name':_0xeed4('0x2f'),'field':_0xeed4('0xb'),'foreignKey':'membername','model':_0xeed4('0x30'),'filter':{'field':'role','value':[_0xeed4('0x31')]}},{'name':_0xeed4('0x32'),'field':_0xeed4('0xb'),'foreignKey':_0xeed4('0x33'),'model':_0xeed4('0x30'),'filter':{'field':_0xeed4('0x34'),'value':[_0xeed4('0x35')]}},{'name':_0xeed4('0x36'),'field':'name','foreignKey':_0xeed4('0x37'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0xeed4('0x38'),'field':_0xeed4('0xb'),'foreignKey':'queue','model':_0xeed4('0x39'),'filter':{'field':_0xeed4('0x11'),'value':[_0xeed4('0x3a')]}}];break;case _0xeed4('0x3b'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x3c');break;case _0xeed4('0x3d'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x3e');break;case _0xeed4('0x3f'):_0x2fc4f4['childModel']='VoicePrefix';break;case _0xeed4('0x40'):_0x2fc4f4[_0xeed4('0x13')]='Campaign';break;case _0xeed4('0x41'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x42');break;case _0xeed4('0x43'):_0x2fc4f4['childModel']=_0xeed4('0x44');break;case _0xeed4('0x45'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x46');break;case _0xeed4('0x47'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x48');break;case'openchannelaccounts':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x49');break;case _0xeed4('0x4a'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x4b');break;case'smsaccounts':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x4c');break;case _0xeed4('0x4d'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x4e');break;case _0xeed4('0x4f'):_0x2fc4f4['childModel']='WhatsappAccount';break;case _0xeed4('0x50'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x51');break;case'voicequeues':case _0xeed4('0x52'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x39');if(_0x5b7859){_0x2fc4f4[_0xeed4('0x17')]=[{'name':_0xeed4('0x36')},{'name':_0xeed4('0x38')}];}break;case'users':case'agents':case'telephones':_0x2fc4f4['childModel']=_0xeed4('0x30');if(_0x5b7859){_0x2fc4f4['parentSections']=[{'name':_0xeed4('0x53'),'filter':{'field':_0xeed4('0x34'),'value':[_0xeed4('0x54'),_0xeed4('0x55')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xeed4('0x56'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x57');break;case _0xeed4('0x58'):_0x2fc4f4['childModel']=_0xeed4('0x59');break;case _0xeed4('0x5a'):_0x2fc4f4['childModel']=_0xeed4('0x5b');break;case _0xeed4('0x5c'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x5d');break;case _0xeed4('0x5e'):_0x2fc4f4[_0xeed4('0x13')]='DeskAccount';break;case'zohoaccounts':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x5f');break;case _0xeed4('0x60'):_0x2fc4f4[_0xeed4('0x13')]='User';break;case _0xeed4('0x61'):_0x2fc4f4['childModel']=_0xeed4('0x62');break;case'dispositions':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x63');break;case _0xeed4('0x64'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x65');break;case _0xeed4('0x66'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x67');break;case _0xeed4('0x68'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x69');break;case'scheduler':_0x2fc4f4['childModel']=_0xeed4('0x6a');break;case _0xeed4('0x6b'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x6c');break;case'tags':_0x2fc4f4[_0xeed4('0x13')]='Tag';break;case _0xeed4('0x6d'):_0x2fc4f4[_0xeed4('0x13')]='Template';break;case'triggers':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x6e');break;case _0xeed4('0x6f'):_0x2fc4f4['childModel']=_0xeed4('0x70');break;case _0xeed4('0x71'):_0x2fc4f4[_0xeed4('0x13')]='Variable';break;case'plugins':_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0x72');break;case _0xeed4('0x73'):_0x2fc4f4[_0xeed4('0x13')]=_0xeed4('0xe');_0x2fc4f4[_0xeed4('0x17')]=[{'name':_0xeed4('0x74'),'field':'id','foreignKey':'reportId'}];break;case _0xeed4('0x75'):_0x2fc4f4['childModel']='AnalyticMetric';break;}return _0x2fc4f4;}function _0x1ba261(_0x419543,_0xeed50d){var _0x99ff45=_0x419543[_0xeed4('0x76')](0x0)[_0xeed4('0x77')]()+_0x419543['slice'](0x1);var _0x1fa02a={'type':_0x2f64fa['Sequelize'][_0xeed4('0x78')][_0xeed4('0x79')],'raw':!![]};return new Promise(function(_0x392365,_0xecd5fb){var _0x3a59a3=squel[_0xeed4('0x7a')]()['field']('ui.'+_0x99ff45+_0xeed4('0x7b'),'id')[_0xeed4('0x8')](_0xeed4('0x7c'))[_0xeed4('0x7d')](_0xeed4('0x7e')+_0x419543+_0xeed4('0x7f'),'ui')[_0xeed4('0x80')](_0xeed4('0x81'),_0xeed50d['id']);return _0x2f64fa['sequelize'][_0xeed4('0x82')](_0x3a59a3[_0xeed4('0x83')](),_0x1fa02a)[_0xeed4('0xa')](function(_0x2f6732){_0xeed50d[_0x99ff45+'OpenTabs']=_0x2f6732;_0x392365(_0x2f6732);})[_0xeed4('0x7')](function(_0xe37a0e){_0xecd5fb(_0xe37a0e);});});}return _0x56ec16['define'](_0xeed4('0x84'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x355564){var _0xf95c2f={'raw':_0x355564[_0xeed4('0x82')][_0xeed4('0x85')],'where':{}};var _0x354bf0={};var _0x389563={'count':0x0,'rows':[]};var _0x294b2d=_0x355564[_0xeed4('0x82')][_0xeed4('0x86')];var _0x508d16=_0x355564['query'][_0xeed4('0x87')]||![];var _0x23afbb=_0x270894(_0x294b2d,_0x508d16);if(!_0x23afbb[_0xeed4('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x294b2d+'\x27');var _0x880993=[{'name':_0x294b2d}];if(!_[_0xeed4('0x88')](_0x23afbb[_0xeed4('0x17')]))_0x880993=_0x23afbb['parentSections'];var _0x5df02b=[];for(var _0x593b22=0x0;_0x593b22<_0x880993[_0xeed4('0x89')];_0x593b22++){_0x5df02b[_0xeed4('0x8a')](_0x2f64fa['UserProfileSection'][_0xeed4('0x8b')]({'where':{'userProfileId':_0x355564[_0xeed4('0x8c')]['id'],'name':_0x880993[_0x593b22][_0xeed4('0xb')]},'raw':!![]}));}return Promise[_0xeed4('0x8d')](_0x5df02b)[_0xeed4('0xa')](function(_0x3c9b6a){var _0x4dc0d0=_[_0xeed4('0x3')](_0x3c9b6a,function(_0x543e63){return _0x543e63?_0x543e63:undefined;});var _0x72f9b5=_['filter'](_0x880993,[_0xeed4('0x8e'),!![]]);var _0x4a28fc=_['isEmpty'](_0x4dc0d0)&&_['isEmpty'](_0x72f9b5)?null:_['union'](_0x72f9b5,_0x4dc0d0);if(!_0x4a28fc)return null;var _0x2ac160=[];for(var _0xa5897e=0x0;_0xa5897e<_0x4a28fc[_0xeed4('0x89')];_0xa5897e++){var _0x63afef=_[_0xeed4('0x8b')](_0x880993,function(_0x183e93){return _0x4a28fc[_0xa5897e]?_0x183e93[_0xeed4('0xb')]===_0x4a28fc[_0xa5897e][_0xeed4('0xb')]:null;});if(_0x63afef){if(_0x4a28fc[_0xa5897e]['ignore']){_0x2ac160['push'](_0x20521e(_0x23afbb[_0xeed4('0x13')],_0x4a28fc[_0xa5897e]));}else{if(!_0x4a28fc[_0xa5897e][_0xeed4('0x8f')]){_0x2ac160[_0xeed4('0x8a')](_0x10fda7(_0x63afef,_0x4a28fc[_0xa5897e],_0x23afbb[_0xeed4('0x13')]));}else{if(_0x63afef[_0xeed4('0x9')]){_0x2ac160[_0xeed4('0x8a')](_0x7a6dc8(_0x63afef,_0x4a28fc[_0xa5897e]));}}}}}return Promise[_0xeed4('0x8d')](_0x2ac160);})[_0xeed4('0xa')](function(_0x43aa41){var _0x2bdf6c=_0x43aa41;var _0x544c15=null;if(_0x2bdf6c){_0x544c15=_0x2bdf6c['length']===0x1?_0x2bdf6c[0x0]:null;}if(!_0x544c15&&!_0x2bdf6c)return _0x389563;var _0x35e115=_0x2f64fa[_0x23afbb[_0xeed4('0x13')]][_0xeed4('0x90')];_0x354bf0[_0xeed4('0x9')]=_[_0xeed4('0x91')](_0x35e115);_0x354bf0[_0xeed4('0x82')]=_[_0xeed4('0x91')](_0x355564['query']);_0x354bf0['filters']=_[_0xeed4('0x92')](_0x354bf0['model'],_0x354bf0['query']);_0xf95c2f[_0xeed4('0x93')]=_['intersection'](_0x354bf0['model'],qs[_0xeed4('0x94')](_0x355564[_0xeed4('0x82')][_0xeed4('0x94')]));_0xf95c2f[_0xeed4('0x93')]=_0xf95c2f['attributes']['length']?_0xf95c2f['attributes']:_0x354bf0[_0xeed4('0x9')];if(!_0x355564[_0xeed4('0x82')][_0xeed4('0x95')](_0xeed4('0x96'))){_0xf95c2f[_0xeed4('0x97')]=qs['limit'](_0x355564[_0xeed4('0x82')][_0xeed4('0x97')]);_0xf95c2f['offset']=qs[_0xeed4('0x98')](_0x355564[_0xeed4('0x82')][_0xeed4('0x98')]);}_0xf95c2f[_0xeed4('0x99')]=qs[_0xeed4('0x9a')](_0x355564['query'][_0xeed4('0x9a')]);_0xf95c2f['where']=qs[_0xeed4('0x9b')](_[_0xeed4('0x9c')](_0x355564['query'],_0x354bf0[_0xeed4('0x9b')]));if(_0x355564[_0xeed4('0x82')][_0xeed4('0x3')]){_0xf95c2f[_0xeed4('0x80')]=_[_0xeed4('0x9d')](_0xf95c2f[_0xeed4('0x80')],{'$or':_[_0xeed4('0xf')](_0x35e115,function(_0x520028){if(_0x520028[_0xeed4('0x11')][_0xeed4('0x9e')]!==_0xeed4('0x9f')){var _0x2c9ff8={};_0x2c9ff8[_0x520028[_0xeed4('0x8')]]={'$like':'%'+_0x355564[_0xeed4('0x82')][_0xeed4('0x3')]+'%'};return _0x2c9ff8;}})});}var _0x926da0=[];var _0x24fc5d=null;var _0x250abc={};if(_0x544c15){_0x24fc5d=_[_0xeed4('0x8b')](_0x880993,['name',_0x544c15[_0xeed4('0xb')]]);if(_0x24fc5d[_0xeed4('0x8')]){_0x250abc={};if(_0x23afbb[_0xeed4('0x13')]===_0xeed4('0xe')){_0x250abc[_0x24fc5d[_0xeed4('0xa0')]]=_[_0xeed4('0xf')](_0x544c15[_0xeed4('0x6')],'id');}else{_0x250abc[_0x24fc5d['foreignKey']]=_0x544c15[_0xeed4('0x6')];}_0x926da0[_0xeed4('0x8a')](_0x250abc);}else{_0xf95c2f[_0xeed4('0x80')]['id']=_0x544c15[_0xeed4('0x6')];}}else{for(var _0x474697=0x0;_0x474697<_0x2bdf6c[_0xeed4('0x89')];_0x474697++){_0x24fc5d=_[_0xeed4('0x8b')](_0x880993,[_0xeed4('0xb'),_0x2bdf6c[_0x474697][_0xeed4('0xb')]]);if(_0x24fc5d[_0xeed4('0x8')]){_0x250abc={};_0x250abc[_0x24fc5d['foreignKey']]=_0x2bdf6c[_0x474697][_0xeed4('0x6')];_0x926da0[_0xeed4('0x8a')](_0x250abc);}else{if(!_0xf95c2f[_0xeed4('0x80')]['id'])_0xf95c2f[_0xeed4('0x80')]['id']=[];_0x2bdf6c[_0x474697][_0xeed4('0x6')][_0xeed4('0xa1')](function(_0x33bef5){_0xf95c2f[_0xeed4('0x80')]['id'][_0xeed4('0x8a')](_0x33bef5);});}}}if(!_[_0xeed4('0x88')](_0x926da0)){_0xf95c2f[_0xeed4('0x80')]=_[_0xeed4('0x9d')](_0xf95c2f[_0xeed4('0x80')],{'$and':{'$or':_0x926da0}});}_0xf95c2f=_['merge']({},_0xf95c2f,_0x355564['options']);if(_0x544c15&&!_0x544c15[_0xeed4('0x8f')]&&_0x23afbb[_0xeed4('0x13')]==='AnalyticExtractedReport'){if(_0x355564[_0xeed4('0x82')][_0xeed4('0xa2')]){_0xf95c2f[_0xeed4('0xa3')]=[{'all':!![]}];}return _0x2f64fa[_0x23afbb[_0xeed4('0x13')]][_0xeed4('0x5')](_0xf95c2f)[_0xeed4('0xa')](function(_0x55586b){var _0x40a909=[];_0x55586b[_0xeed4('0xa1')](function(_0x11d157){var _0x4801e7;switch(_0x11d157[_0xeed4('0xa4')]){case _0xeed4('0xa5'):_0x4801e7=_['find'](_0x544c15[_0xeed4('0x6')],function(_0x3f7055){return _0x3f7055['id']===_0x11d157[_0xeed4('0xa6')]&&_0x3f7055['type']===_0xeed4('0xa7');});break;case _0xeed4('0xa8'):_0x4801e7=_['find'](_0x544c15[_0xeed4('0x6')],function(_0x38dac9){return _0x38dac9['id']===_0x11d157[_0xeed4('0xa6')]&&_0x38dac9[_0xeed4('0x11')]===_0xeed4('0xa9');});break;}if(_0x4801e7)_0x40a909[_0xeed4('0x8a')](_0x11d157);});_0x389563[_0xeed4('0xaa')]=_0x40a909[_0xeed4('0x89')];_0x389563[_0xeed4('0xab')]=_0x40a909;return _0x389563;});}else{if(!_[_0xeed4('0x88')](_0x355564[_0xeed4('0x82')][_0xeed4('0xac')])){_0xf95c2f[_0xeed4('0x80')]['id']=_0xf95c2f[_0xeed4('0x80')]['id']?_['intersection'](_0xf95c2f[_0xeed4('0x80')]['id'],_0x355564[_0xeed4('0x82')][_0xeed4('0xac')]):_0x355564['query']['ids'];if(_0x355564[_0xeed4('0x82')]['customSorting']){_0xf95c2f[_0xeed4('0x99')]=_0x355564['query'][_0xeed4('0xad')];}}if(_0x355564[_0xeed4('0x82')][_0xeed4('0xae')]){_0xf95c2f[_0xeed4('0x80')]=_[_0xeed4('0x9d')](_0xf95c2f['where'],{'$and':_0x355564[_0xeed4('0x82')][_0xeed4('0xae')]});}return _0x2f64fa[_0x23afbb[_0xeed4('0x13')]][_0xeed4('0xaa')]({'where':_0xf95c2f['where']})['then'](function(_0xbfc457){_0x389563[_0xeed4('0xaa')]=_0xbfc457;if(_0x355564['query']['includeAll']){if(_0x23afbb[_0xeed4('0x13')]===_0xeed4('0xaf')){_0xf95c2f[_0xeed4('0xa3')]=[{'model':_0x2f64fa[_0xeed4('0xb0')],'as':_0xeed4('0xb1'),'attributes':['id','name',_0xeed4('0xb2')],'required':_0x355564[_0xeed4('0x82')][_0xeed4('0xb3')]?!![]:![]},{'model':_0x2f64fa[_0xeed4('0xb0')],'as':_0xeed4('0xb4'),'attributes':['id',_0xeed4('0xb'),_0xeed4('0xb2')],'through':_0x355564[_0xeed4('0x82')][_0xeed4('0xb3')]?{'attributes':[],'where':{'TagId':_0x355564[_0xeed4('0x82')][_0xeed4('0xb3')]||undefined}}:{},'required':_0x355564[_0xeed4('0x82')][_0xeed4('0xb3')]?!![]:![]}];}else{_0xf95c2f['include']=[{'all':!![]}];}}return _0x2f64fa[_0x23afbb[_0xeed4('0x13')]][_0xeed4('0x5')](_0xf95c2f);})[_0xeed4('0xa')](function(_0x55819f){_0x389563[_0xeed4('0xab')]=_0x55819f;if(_0x294b2d==='Agents'&&_0x355564['query'][_0xeed4('0xb5')]===_0xeed4('0xb6')){var _0x175b4d=[];for(var _0x380fca=0x0;_0x380fca<_0x389563[_0xeed4('0xab')][_0xeed4('0x89')];_0x380fca++){_0x175b4d[_0xeed4('0x8a')](_0x1ba261(_0xeed4('0xb7'),_0x389563[_0xeed4('0xab')][_0x380fca]['dataValues']));_0x175b4d['push'](_0x1ba261(_0xeed4('0xb8'),_0x389563[_0xeed4('0xab')][_0x380fca][_0xeed4('0xb9')]));_0x175b4d[_0xeed4('0x8a')](_0x1ba261(_0xeed4('0xba'),_0x389563['rows'][_0x380fca][_0xeed4('0xb9')]));_0x175b4d['push'](_0x1ba261(_0xeed4('0xbb'),_0x389563[_0xeed4('0xab')][_0x380fca][_0xeed4('0xb9')]));_0x175b4d['push'](_0x1ba261(_0xeed4('0xbc'),_0x389563[_0xeed4('0xab')][_0x380fca]['dataValues']));_0x175b4d[_0xeed4('0x8a')](_0x1ba261(_0xeed4('0xbd'),_0x389563[_0xeed4('0xab')][_0x380fca][_0xeed4('0xb9')]));}return Promise[_0xeed4('0x8d')](_0x175b4d)[_0xeed4('0xa')](function(){return _0x389563;});}return _0x389563;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 4b4ebbe..35a8f64 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 _0x01d9=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c4be4,_0x521f92){var _0x440257=function(_0x84e57c){while(--_0x84e57c){_0x2c4be4['push'](_0x2c4be4['shift']());}};_0x440257(++_0x521f92);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});config[_0x901d('0xc')]=_[_0x901d('0xd')](config[_0x901d('0xc')],{'host':_0x901d('0xe'),'port':0x18eb});var socket=require(_0x901d('0xf'))(new Redis(config[_0x901d('0xc')]));require(_0x901d('0x10'))[_0x901d('0x11')](socket);function respondWithRpcPromise(_0xacff40,_0x440fb0,_0xd819f0){return new BPromise(function(_0x1d3137,_0x5d74e2){return client[_0x901d('0x12')](_0xacff40,_0xd819f0)['then'](function(_0x220153){logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));logger[_0x901d('0x16')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x440fb0,_0x901d('0x15'),JSON[_0x901d('0x17')](_0x220153));if(_0x220153[_0x901d('0x18')]){if(_0x220153[_0x901d('0x18')][_0x901d('0x19')]===0x1f4){logger[_0x901d('0x18')]('UserProfile,\x20%s,\x20%s',_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x5d74e2(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}logger[_0x901d('0x18')](_0x901d('0x14'),_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x1d3137(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}else{logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));_0x1d3137(_0x220153[_0x901d('0x1b')][_0x901d('0x1a')]);}})[_0x901d('0x1c')](function(_0xf3c66a){logger[_0x901d('0x18')]('UserProfile,\x20%s,\x20%s',_0x440fb0,_0xf3c66a);_0x5d74e2(_0xf3c66a);});});} \ No newline at end of file +var _0x6144=['register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x1290cd,_0x3491b3){var _0x23d83d=function(_0x14550a){while(--_0x14550a){_0x1290cd['push'](_0x1290cd['shift']());}};_0x23d83d(++_0x3491b3);}(_0x6144,0x99));var _0x4614=function(_0x325d92,_0x5ec05f){_0x325d92=_0x325d92-0x0;var _0x268284=_0x6144[_0x325d92];return _0x268284;};'use strict';var _=require(_0x4614('0x0'));var util=require(_0x4614('0x1'));var moment=require(_0x4614('0x2'));var BPromise=require(_0x4614('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4614('0x4'));var db=require(_0x4614('0x5'))['db'];var utils=require(_0x4614('0x6'));var logger=require(_0x4614('0x7'))('rpc');var config=require(_0x4614('0x8'));var jayson=require(_0x4614('0x9'));var client=jayson[_0x4614('0xa')][_0x4614('0xb')]({'port':0x232a});config[_0x4614('0xc')]=_['defaults'](config[_0x4614('0xc')],{'host':_0x4614('0xd'),'port':0x18eb});var socket=require(_0x4614('0xe'))(new Redis(config[_0x4614('0xc')]));require('./userProfile.socket')[_0x4614('0xf')](socket);function respondWithRpcPromise(_0x3953bd,_0x7df8c,_0x3c339c){return new BPromise(function(_0x270e8d,_0x2b0439){return client[_0x4614('0x10')](_0x3953bd,_0x3c339c)['then'](function(_0x3f4202){logger[_0x4614('0x11')](_0x4614('0x12'),_0x7df8c,_0x4614('0x13'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x7df8c,_0x4614('0x13'),JSON[_0x4614('0x14')](_0x3f4202));if(_0x3f4202[_0x4614('0x15')]){if(_0x3f4202['error']['code']===0x1f4){logger['error'](_0x4614('0x12'),_0x7df8c,_0x3f4202[_0x4614('0x15')]['message']);return _0x2b0439(_0x3f4202[_0x4614('0x15')][_0x4614('0x16')]);}logger[_0x4614('0x15')]('UserProfile,\x20%s,\x20%s',_0x7df8c,_0x3f4202[_0x4614('0x15')][_0x4614('0x16')]);return _0x270e8d(_0x3f4202[_0x4614('0x15')][_0x4614('0x16')]);}else{logger[_0x4614('0x11')](_0x4614('0x12'),_0x7df8c,'request\x20sent');_0x270e8d(_0x3f4202[_0x4614('0x17')][_0x4614('0x16')]);}})['catch'](function(_0xb8c6fd){logger[_0x4614('0x15')](_0x4614('0x12'),_0x7df8c,_0xb8c6fd);_0x2b0439(_0xb8c6fd);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 890501f..2a7c731 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 _0x61e4=['save','remove','update','removeListener','length','userProfile:','./userProfile.events'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0x61e4,0x117));var _0x461e=function(_0x54c42d,_0x23975d){_0x54c42d=_0x54c42d-0x0;var _0x16d161=_0x61e4[_0x54c42d];return _0x16d161;};'use strict';var UserProfileEvents=require(_0x461e('0x0'));var events=[_0x461e('0x1'),_0x461e('0x2'),_0x461e('0x3')];function createListener(_0x29bb32,_0x49de40){return function(_0x284ca5){_0x49de40['emit'](_0x29bb32,_0x284ca5);};}function removeListener(_0x5761db,_0x1b748f){return function(){UserProfileEvents[_0x461e('0x4')](_0x5761db,_0x1b748f);};}exports['register']=function(_0x171dbc){for(var _0x18e748=0x0,_0x48ae33=events[_0x461e('0x5')];_0x18e748<_0x48ae33;_0x18e748++){var _0x596325=events[_0x18e748];var _0x2558a8=createListener(_0x461e('0x6')+_0x596325,_0x171dbc);UserProfileEvents['on'](_0x596325,_0x2558a8);}}; \ No newline at end of file +var _0x8813=['emit','removeListener','userProfile:','remove','update'];(function(_0x18b940,_0x9644de){var _0x538f1c=function(_0x4c888f){while(--_0x4c888f){_0x18b940['push'](_0x18b940['shift']());}};_0x538f1c(++_0x9644de);}(_0x8813,0x139));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x3881('0x0'),_0x3881('0x1')];function createListener(_0x4a17d5,_0x31f1e2){return function(_0x5b8a8c){_0x31f1e2[_0x3881('0x2')](_0x4a17d5,_0x5b8a8c);};}function removeListener(_0x50abbb,_0xa12c34){return function(){UserProfileEvents[_0x3881('0x3')](_0x50abbb,_0xa12c34);};}exports['register']=function(_0x1cebc8){for(var _0x3a71af=0x0,_0x2fc6b7=events['length'];_0x3a71af<_0x2fc6b7;_0x3a71af++){var _0x10c8cc=events[_0x3a71af];var _0x53295a=createListener(_0x3881('0x4')+_0x10c8cc,_0x1cebc8);UserProfileEvents['on'](_0x10c8cc,_0x53295a);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2ee8a2d..ff112ed 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 _0x288b=['../../config/environment','./userProfileResource.controller','get','index','isAuthenticated','describe','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x4265f4,_0x44b225){var _0x4048a4=function(_0x33a761){while(--_0x33a761){_0x4265f4['push'](_0x4265f4['shift']());}};_0x4048a4(++_0x44b225);}(_0x288b,0x129));var _0xb288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x288b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb288('0x0'));var util=require(_0xb288('0x1'));var path=require(_0xb288('0x2'));var timeout=require(_0xb288('0x3'));var express=require(_0xb288('0x4'));var router=express['Router']();var fs_extra=require(_0xb288('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb288('0x6'));var config=require(_0xb288('0x7'));var controller=require(_0xb288('0x8'));router[_0xb288('0x9')]('/',auth['isAuthenticated'](),controller[_0xb288('0xa')]);router[_0xb288('0x9')]('/describe',auth[_0xb288('0xb')](),controller[_0xb288('0xc')]);router[_0xb288('0x9')](_0xb288('0xd'),auth[_0xb288('0xb')](),controller[_0xb288('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb288('0xf')]);router[_0xb288('0x10')](_0xb288('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb288('0x11')](_0xb288('0xd'),auth[_0xb288('0xb')](),controller[_0xb288('0x12')]);module['exports']=router; \ No newline at end of file +var _0x159c=['delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x159c,0x10c));var _0xc159=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x159c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc159('0x0'));var util=require(_0xc159('0x1'));var path=require(_0xc159('0x2'));var timeout=require(_0xc159('0x3'));var express=require(_0xc159('0x4'));var router=express[_0xc159('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc159('0x6'));var controller=require(_0xc159('0x7'));router[_0xc159('0x8')]('/',auth[_0xc159('0x9')](),controller[_0xc159('0xa')]);router['get'](_0xc159('0xb'),auth[_0xc159('0x9')](),controller[_0xc159('0xc')]);router[_0xc159('0x8')](_0xc159('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc159('0xe')]('/',auth[_0xc159('0x9')](),controller[_0xc159('0xf')]);router['put']('/:id',auth[_0xc159('0x9')](),controller[_0xc159('0x10')]);router[_0xc159('0x11')]('/:id',auth[_0xc159('0x9')](),controller['destroy']);module[_0xc159('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index eed5584..be7597f 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 _0xb41c=['INTEGER','sequelize','exports','STRING'];(function(_0x4726fd,_0x3a9f5f){var _0x50def0=function(_0x284e6e){while(--_0x284e6e){_0x4726fd['push'](_0x4726fd['shift']());}};_0x50def0(++_0x3a9f5f);}(_0xb41c,0x105));var _0xcb41=function(_0x4cf960,_0x31bdde){_0x4cf960=_0x4cf960-0x0;var _0x3c3d00=_0xb41c[_0x4cf960];return _0x3c3d00;};'use strict';var Sequelize=require(_0xcb41('0x0'));module[_0xcb41('0x1')]={'name':{'type':Sequelize[_0xcb41('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcb41('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xcb41('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa6bc=['sequelize','exports','STRING','INTEGER'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa6bc,0x16c));var _0xca6b=function(_0x148bd2,_0x3338c6){_0x148bd2=_0x148bd2-0x0;var _0x38c56f=_0xa6bc[_0x148bd2];return _0x38c56f;};'use strict';var Sequelize=require(_0xca6b('0x0'));module[_0xca6b('0x1')]={'name':{'type':Sequelize[_0xca6b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xca6b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xca6b('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 21524f3..2edc633 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 _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','UserProfileResource','includeAll','rows','catch','show'];(function(_0xc45596,_0x5c410e){var _0x425ffe=function(_0x3c327d){while(--_0x3c327d){_0xc45596['push'](_0xc45596['shift']());}};_0x425ffe(++_0x5c410e);}(_0x0295,0x1f0));var _0x5029=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x0295[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['UserProfileResource'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['UserProfileResource'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file +var _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1c860c,_0x1cf6b1){_0x1c860c=_0x1c860c-0x0;var _0x563247=_0x9f0e[_0x1c860c];return _0x563247;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['UserProfileResource'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['UserProfileResource'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['UserProfileResource'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index dde5d36..991e25a 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 _0xff7b=['../../config/environment','./userProfileResource.attributes','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1e3cb9,_0x3c697d){var _0xc3c95d=function(_0x32a9c3){while(--_0x32a9c3){_0x1e3cb9['push'](_0x1e3cb9['shift']());}};_0xc3c95d(++_0x3c697d);}(_0xff7b,0x72));var _0xbff7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xff7b[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xbff7('0x0'));var util=require(_0xbff7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbff7('0x2'));var BPromise=require(_0xbff7('0x3'));var rp=require(_0xbff7('0x4'));var fs=require('fs');var path=require(_0xbff7('0x5'));var rimraf=require('rimraf');var config=require(_0xbff7('0x6'));var attributes=require(_0xbff7('0x7'));module['exports']=function(_0x3744ae,_0x110fd3){return _0x3744ae['define']('UserProfileResource',attributes,{'tableName':_0xbff7('0x8'),'paranoid':![],'indexes':[{'name':_0xbff7('0x9'),'fields':[_0xbff7('0xa'),_0xbff7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6630=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource'];(function(_0x47294a,_0x210b57){var _0x108840=function(_0xf14bc1){while(--_0xf14bc1){_0x47294a['push'](_0x47294a['shift']());}};_0x108840(++_0x210b57);}(_0x6630,0x84));var _0x0663=function(_0x3ce46b,_0x15f404){_0x3ce46b=_0x3ce46b-0x0;var _0x4c49fe=_0x6630[_0x3ce46b];return _0x4c49fe;};'use strict';var _=require(_0x0663('0x0'));var util=require(_0x0663('0x1'));var logger=require(_0x0663('0x2'))(_0x0663('0x3'));var moment=require(_0x0663('0x4'));var BPromise=require('bluebird');var rp=require(_0x0663('0x5'));var fs=require('fs');var path=require(_0x0663('0x6'));var rimraf=require(_0x0663('0x7'));var config=require(_0x0663('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x0663('0x9')]=function(_0x1b5b4b,_0x5d8b83){return _0x1b5b4b[_0x0663('0xa')](_0x0663('0xb'),attributes,{'tableName':_0x0663('0xc'),'paranoid':![],'indexes':[{'name':_0x0663('0xd'),'fields':[_0x0663('0xe'),_0x0663('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e53d51f..3f87e0b 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 _0x4d08=['http','request','then','request\x20sent','debug','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35c6d5,_0x41842a){var _0x3d8f3a=function(_0xce78be){while(--_0xce78be){_0x35c6d5['push'](_0x35c6d5['shift']());}};_0x3d8f3a(++_0x41842a);}(_0x4d08,0x1a5));var _0x84d0=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x4d08[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0x84d0('0x0'));var util=require('util');var moment=require(_0x84d0('0x1'));var BPromise=require(_0x84d0('0x2'));var rs=require(_0x84d0('0x3'));var fs=require('fs');var Redis=require(_0x84d0('0x4'));var db=require(_0x84d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x84d0('0x6'))(_0x84d0('0x7'));var config=require(_0x84d0('0x8'));var jayson=require(_0x84d0('0x9'));var client=jayson[_0x84d0('0xa')][_0x84d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a4698,_0x832446,_0x306e3b){return new BPromise(function(_0x3d8b60,_0x1b2ac0){return client[_0x84d0('0xc')](_0x2a4698,_0x306e3b)[_0x84d0('0xd')](function(_0x5b83fd){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x832446,_0x84d0('0xe'));logger[_0x84d0('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x832446,'request\x20sent',JSON[_0x84d0('0x10')](_0x5b83fd));if(_0x5b83fd[_0x84d0('0x11')]){if(_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x12')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x832446,_0x5b83fd['error'][_0x84d0('0x13')]);return _0x1b2ac0(_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x13')]);}logger[_0x84d0('0x11')](_0x84d0('0x14'),_0x832446,_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x13')]);return _0x3d8b60(_0x5b83fd[_0x84d0('0x11')][_0x84d0('0x13')]);}else{logger[_0x84d0('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x832446,'request\x20sent');_0x3d8b60(_0x5b83fd[_0x84d0('0x16')][_0x84d0('0x13')]);}})[_0x84d0('0x17')](function(_0x4ff3bc){logger['error'](_0x84d0('0x14'),_0x832446,_0x4ff3bc);_0x1b2ac0(_0x4ff3bc);});});} \ No newline at end of file +var _0x67bb=['jayson/promise','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x52c5b4,_0x16defe){var _0xbd75b9=function(_0x194670){while(--_0x194670){_0x52c5b4['push'](_0x52c5b4['shift']());}};_0xbd75b9(++_0x16defe);}(_0x67bb,0xc6));var _0xb67b=function(_0x21328f,_0x6c0824){_0x21328f=_0x21328f-0x0;var _0x326291=_0x67bb[_0x21328f];return _0x326291;};'use strict';var _=require(_0xb67b('0x0'));var util=require('util');var moment=require(_0xb67b('0x1'));var BPromise=require(_0xb67b('0x2'));var rs=require(_0xb67b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb67b('0x4'))['db'];var utils=require(_0xb67b('0x5'));var logger=require(_0xb67b('0x6'))(_0xb67b('0x7'));var config=require(_0xb67b('0x8'));var jayson=require(_0xb67b('0x9'));var client=jayson['client'][_0xb67b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45c328,_0x139118,_0x5394ad){return new BPromise(function(_0x4cc39d,_0x5e4cd7){return client['request'](_0x45c328,_0x5394ad)[_0xb67b('0xb')](function(_0x1b3688){logger[_0xb67b('0xc')](_0xb67b('0xd'),_0x139118,_0xb67b('0xe'));logger[_0xb67b('0xf')](_0xb67b('0x10'),_0x139118,'request\x20sent',JSON[_0xb67b('0x11')](_0x1b3688));if(_0x1b3688[_0xb67b('0x12')]){if(_0x1b3688[_0xb67b('0x12')][_0xb67b('0x13')]===0x1f4){logger[_0xb67b('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x139118,_0x1b3688[_0xb67b('0x12')][_0xb67b('0x14')]);return _0x5e4cd7(_0x1b3688[_0xb67b('0x12')][_0xb67b('0x14')]);}logger[_0xb67b('0x12')](_0xb67b('0xd'),_0x139118,_0x1b3688[_0xb67b('0x12')]['message']);return _0x4cc39d(_0x1b3688['error']['message']);}else{logger[_0xb67b('0xc')](_0xb67b('0xd'),_0x139118,'request\x20sent');_0x4cc39d(_0x1b3688[_0xb67b('0x15')][_0xb67b('0x14')]);}})[_0xb67b('0x16')](function(_0xca1d63){logger[_0xb67b('0x12')](_0xb67b('0xd'),_0x139118,_0xca1d63);_0x5e4cd7(_0xca1d63);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 56f6228..642ad7f 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 _0xd6b4=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x5a4826,_0x17aa01){var _0x59d9b9=function(_0x63ba6f){while(--_0x63ba6f){_0x5a4826['push'](_0x5a4826['shift']());}};_0x59d9b9(++_0x17aa01);}(_0xd6b4,0x1cc));var _0x4d6b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd6b4[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x4d6b('0x0'));var util=require('util');var path=require(_0x4d6b('0x1'));var timeout=require(_0x4d6b('0x2'));var express=require(_0x4d6b('0x3'));var router=express[_0x4d6b('0x4')]();var fs_extra=require(_0x4d6b('0x5'));var auth=require(_0x4d6b('0x6'));var interaction=require(_0x4d6b('0x7'));var config=require(_0x4d6b('0x8'));var controller=require(_0x4d6b('0x9'));router['get']('/',auth[_0x4d6b('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4d6b('0xb')]('/:id',auth[_0x4d6b('0xa')](),controller[_0x4d6b('0xc')]);router[_0x4d6b('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d6b('0xe')]);router[_0x4d6b('0xf')](_0x4d6b('0x10'),auth[_0x4d6b('0xa')](),controller[_0x4d6b('0x11')]);router[_0x4d6b('0x12')](_0x4d6b('0x10'),auth[_0x4d6b('0xa')](),controller[_0x4d6b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8d10=['put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x19775d,_0x1a6776){var _0xdb2e24=function(_0x45a12e){while(--_0x45a12e){_0x19775d['push'](_0x19775d['shift']());}};_0xdb2e24(++_0x1a6776);}(_0x8d10,0xd0));var _0x08d1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8d10[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x08d1('0x0'));var timeout=require(_0x08d1('0x1'));var express=require(_0x08d1('0x2'));var router=express[_0x08d1('0x3')]();var fs_extra=require(_0x08d1('0x4'));var auth=require(_0x08d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x08d1('0x6'));var controller=require('./userProfileSection.controller');router[_0x08d1('0x7')]('/',auth[_0x08d1('0x8')](),controller['index']);router[_0x08d1('0x7')](_0x08d1('0x9'),auth[_0x08d1('0x8')](),controller['describe']);router[_0x08d1('0x7')](_0x08d1('0xa'),auth[_0x08d1('0x8')](),controller['show']);router[_0x08d1('0xb')]('/',auth['isAuthenticated'](),controller[_0x08d1('0xc')]);router[_0x08d1('0xd')](_0x08d1('0xa'),auth[_0x08d1('0x8')](),controller[_0x08d1('0xe')]);router[_0x08d1('0xf')](_0x08d1('0xa'),auth[_0x08d1('0x8')](),controller[_0x08d1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index b714467..eb1c6e3 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 _0x3c81=['join','getDataValue','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x2637b4,_0x1189b4){var _0x462487=function(_0x5b5800){while(--_0x5b5800){_0x2637b4['push'](_0x2637b4['shift']());}};_0x462487(++_0x1189b4);}(_0x3c81,0x102));var _0x13c8=function(_0x3898ba,_0x2def52){_0x3898ba=_0x3898ba-0x0;var _0x134ea3=_0x3c81[_0x3898ba];return _0x134ea3;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x13c8('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x548599){this[_0x13c8('0x4')](_0x13c8('0x5'),_0x548599?_0x548599[_0x13c8('0x6')](''):[]);},'get':function(){return this[_0x13c8('0x7')](_0x13c8('0x5'))?this[_0x13c8('0x7')](_0x13c8('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x0abf=['sequelize','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x5a7d39,_0x5e5668){var _0x4bcf8d=function(_0x1063d5){while(--_0x1063d5){_0x5a7d39['push'](_0x5a7d39['shift']());}};_0x4bcf8d(++_0x5e5668);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0ab('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xf0ab('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xf0ab('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x7ea4e0){this[_0xf0ab('0x3')](_0xf0ab('0x4'),_0x7ea4e0?_0x7ea4e0[_0xf0ab('0x5')](''):[]);},'get':function(){return this[_0xf0ab('0x6')](_0xf0ab('0x4'))?this[_0xf0ab('0x6')]('crudPermissions')[_0xf0ab('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6af30ef..49b709a 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 _0x63a6=['status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileSection','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4420fb,_0x357fdd){var _0xdd9f36=function(_0x38d456){while(--_0x38d456){_0x4420fb['push'](_0x4420fb['shift']());}};_0xdd9f36(++_0x357fdd);}(_0x63a6,0x7f));var _0x663a=function(_0x480f4a,_0x2ea3f8){_0x480f4a=_0x480f4a-0x0;var _0xdccb7d=_0x63a6[_0x480f4a];return _0xdccb7d;};'use strict';var emlformat=require(_0x663a('0x0'));var rimraf=require(_0x663a('0x1'));var zipdir=require(_0x663a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x663a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x663a('0x4'));var util=require(_0x663a('0x5'));var path=require('path');var sox=require(_0x663a('0x6'));var csv=require(_0x663a('0x7'));var ejs=require(_0x663a('0x8'));var fs=require('fs');var fs_extra=require(_0x663a('0x9'));var _=require('lodash');var squel=require(_0x663a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x663a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x663a('0xc'));var Papa=require(_0x663a('0xd'));var Redis=require(_0x663a('0xe'));var authService=require(_0x663a('0xf'));var qs=require(_0x663a('0x10'));var as=require(_0x663a('0x11'));var hardwareService=require(_0x663a('0x12'));var logger=require(_0x663a('0x13'))(_0x663a('0x14'));var utils=require(_0x663a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x663a('0x16'));var db=require(_0x663a('0x17'))['db'];function respondWithStatusCode(_0x125924,_0xb0f904){_0xb0f904=_0xb0f904||0xcc;return function(_0x3d3a47){if(_0x3d3a47){return _0x125924[_0x663a('0x18')](_0xb0f904);}return _0x125924[_0x663a('0x19')](_0xb0f904)[_0x663a('0x1a')]();};}function respondWithResult(_0x559fc5,_0x28d7a3){_0x28d7a3=_0x28d7a3||0xc8;return function(_0x2959e0){if(_0x2959e0){return _0x559fc5[_0x663a('0x19')](_0x28d7a3)[_0x663a('0x1b')](_0x2959e0);}};}function respondWithFilteredResult(_0x25c978,_0x16bbbb){return function(_0x2e6e90){if(_0x2e6e90){var _0x47559a=typeof _0x16bbbb[_0x663a('0x1c')]===_0x663a('0x1d')&&typeof _0x16bbbb[_0x663a('0x1e')]===_0x663a('0x1d');var _0x1f42a1=_0x2e6e90[_0x663a('0x1f')];var _0x51f5dc=_0x47559a?0x0:_0x16bbbb[_0x663a('0x1c')];var _0x27d678=_0x47559a?_0x2e6e90['count']:_0x16bbbb[_0x663a('0x1c')]+_0x16bbbb[_0x663a('0x1e')];var _0x30b178;if(_0x27d678>=_0x1f42a1){_0x27d678=_0x1f42a1;_0x30b178=0xc8;}else{_0x30b178=0xce;}_0x25c978[_0x663a('0x19')](_0x30b178);return _0x25c978['set'](_0x663a('0x20'),_0x51f5dc+'-'+_0x27d678+'/'+_0x1f42a1)[_0x663a('0x1b')](_0x2e6e90);}return null;};}function patchUpdates(_0x505fb0){return function(_0x35a4b4){try{jsonpatch[_0x663a('0x21')](_0x35a4b4,_0x505fb0,!![]);}catch(_0xf27a68){return BPromise[_0x663a('0x22')](_0xf27a68);}return _0x35a4b4[_0x663a('0x23')]();};}function saveUpdates(_0x5eac75,_0xaa6482){return function(_0x1b68b1){if(_0x1b68b1){return _0x1b68b1[_0x663a('0x24')](_0x5eac75)[_0x663a('0x25')](function(_0x5e58a2){return _0x5e58a2;});}return null;};}function removeEntity(_0x325938,_0xf658c2){return function(_0x1e9157){if(_0x1e9157){return _0x1e9157[_0x663a('0x26')]()[_0x663a('0x25')](function(){_0x325938[_0x663a('0x19')](0xcc)[_0x663a('0x1a')]();});}};}function handleEntityNotFound(_0x5a1b30,_0x2108d0){return function(_0x5dbaea){if(!_0x5dbaea){_0x5a1b30[_0x663a('0x18')](0x194);}return _0x5dbaea;};}function handleError(_0x5f2f26,_0x1663be){_0x1663be=_0x1663be||0x1f4;return function(_0x22181c){logger[_0x663a('0x27')](_0x22181c[_0x663a('0x28')]);if(_0x22181c['name']){delete _0x22181c[_0x663a('0x29')];}_0x5f2f26[_0x663a('0x19')](_0x1663be)[_0x663a('0x2a')](_0x22181c);};}exports[_0x663a('0x2b')]=function(_0x316322,_0x5a5371){var _0x28fd6c={},_0x6e911b={},_0x442789={'count':0x0,'rows':[]};var _0x9e802e=_['map'](db[_0x663a('0x2c')]['rawAttributes'],function(_0x237408){return{'name':_0x237408[_0x663a('0x2d')],'type':_0x237408[_0x663a('0x2e')][_0x663a('0x2f')]};});_0x6e911b[_0x663a('0x30')]=_[_0x663a('0x31')](_0x9e802e,_0x663a('0x29'));_0x6e911b['query']=_['keys'](_0x316322[_0x663a('0x32')]);_0x6e911b[_0x663a('0x33')]=_[_0x663a('0x34')](_0x6e911b[_0x663a('0x30')],_0x6e911b['query']);_0x28fd6c[_0x663a('0x35')]=_['intersection'](_0x6e911b[_0x663a('0x30')],qs[_0x663a('0x36')](_0x316322[_0x663a('0x32')][_0x663a('0x36')]));_0x28fd6c[_0x663a('0x35')]=_0x28fd6c[_0x663a('0x35')][_0x663a('0x37')]?_0x28fd6c['attributes']:_0x6e911b[_0x663a('0x30')];if(!_0x316322['query'][_0x663a('0x38')](_0x663a('0x39'))){_0x28fd6c[_0x663a('0x1e')]=qs[_0x663a('0x1e')](_0x316322[_0x663a('0x32')][_0x663a('0x1e')]);_0x28fd6c[_0x663a('0x1c')]=qs['offset'](_0x316322[_0x663a('0x32')]['offset']);}_0x28fd6c[_0x663a('0x3a')]=qs['sort'](_0x316322[_0x663a('0x32')][_0x663a('0x3b')]);_0x28fd6c[_0x663a('0x3c')]=qs[_0x663a('0x33')](_[_0x663a('0x3d')](_0x316322[_0x663a('0x32')],_0x6e911b[_0x663a('0x33')]),_0x9e802e);if(_0x316322['query'][_0x663a('0x3e')]){_0x28fd6c['where']=_[_0x663a('0x3f')](_0x28fd6c['where'],{'$or':_[_0x663a('0x31')](_0x9e802e,function(_0x532777){if(_0x532777[_0x663a('0x2e')]!=='VIRTUAL'){var _0x2a8f42={};_0x2a8f42[_0x532777[_0x663a('0x29')]]={'$like':'%'+_0x316322[_0x663a('0x32')][_0x663a('0x3e')]+'%'};return _0x2a8f42;}})});}_0x28fd6c=_[_0x663a('0x3f')]({},_0x28fd6c,_0x316322['options']);var _0x95f781={'where':_0x28fd6c[_0x663a('0x3c')]};return db[_0x663a('0x2c')][_0x663a('0x1f')](_0x95f781)[_0x663a('0x25')](function(_0x17e660){_0x442789[_0x663a('0x1f')]=_0x17e660;if(_0x316322[_0x663a('0x32')][_0x663a('0x40')]){_0x28fd6c['include']=[{'all':!![]}];}return db[_0x663a('0x2c')][_0x663a('0x41')](_0x28fd6c);})['then'](function(_0x39dd8c){_0x442789[_0x663a('0x42')]=_0x39dd8c;return _0x442789;})[_0x663a('0x25')](respondWithFilteredResult(_0x5a5371,_0x28fd6c))[_0x663a('0x43')](handleError(_0x5a5371,null));};exports[_0x663a('0x44')]=function(_0x1247ce,_0x575791){var _0x32ec5b={'raw':![],'where':{'id':_0x1247ce[_0x663a('0x45')]['id']}},_0x3e75f4={};_0x3e75f4[_0x663a('0x30')]=_[_0x663a('0x46')](db[_0x663a('0x2c')]['rawAttributes']);_0x3e75f4['query']=_['keys'](_0x1247ce[_0x663a('0x32')]);_0x3e75f4[_0x663a('0x33')]=_[_0x663a('0x34')](_0x3e75f4[_0x663a('0x30')],_0x3e75f4[_0x663a('0x32')]);_0x32ec5b[_0x663a('0x35')]=_['intersection'](_0x3e75f4[_0x663a('0x30')],qs[_0x663a('0x36')](_0x1247ce[_0x663a('0x32')][_0x663a('0x36')]));_0x32ec5b[_0x663a('0x35')]=_0x32ec5b[_0x663a('0x35')]['length']?_0x32ec5b[_0x663a('0x35')]:_0x3e75f4[_0x663a('0x30')];if(_0x1247ce['query'][_0x663a('0x40')]){_0x32ec5b[_0x663a('0x47')]=[{'all':!![]}];}_0x32ec5b=_[_0x663a('0x3f')]({},_0x32ec5b,_0x1247ce['options']);return db[_0x663a('0x2c')][_0x663a('0x48')](_0x32ec5b)[_0x663a('0x25')](handleEntityNotFound(_0x575791,null))[_0x663a('0x25')](respondWithResult(_0x575791,null))[_0x663a('0x43')](handleError(_0x575791,null));};exports[_0x663a('0x49')]=function(_0x1bf4e5,_0x189ca8){return db[_0x663a('0x2c')][_0x663a('0x49')](_0x1bf4e5['body'],{})['then'](respondWithResult(_0x189ca8,0xc9))[_0x663a('0x43')](handleError(_0x189ca8,null));};exports['update']=function(_0x2304d4,_0x8c019a){if(_0x2304d4['body']['id']){delete _0x2304d4[_0x663a('0x4a')]['id'];}return db[_0x663a('0x2c')][_0x663a('0x48')]({'where':{'id':_0x2304d4[_0x663a('0x45')]['id']}})['then'](handleEntityNotFound(_0x8c019a,null))['then'](saveUpdates(_0x2304d4[_0x663a('0x4a')],null))[_0x663a('0x25')](respondWithResult(_0x8c019a,null))[_0x663a('0x43')](handleError(_0x8c019a,null));};exports[_0x663a('0x26')]=function(_0x5a8f2f,_0x2fde09){return db['UserProfileSection'][_0x663a('0x48')]({'where':{'id':_0x5a8f2f[_0x663a('0x45')]['id']}})[_0x663a('0x25')](handleEntityNotFound(_0x2fde09,null))[_0x663a('0x25')](removeEntity(_0x2fde09,null))[_0x663a('0x43')](handleError(_0x2fde09,null));};exports[_0x663a('0x4b')]=function(_0x2d1335,_0x1c1a8e){return db[_0x663a('0x2c')][_0x663a('0x4b')]()[_0x663a('0x25')](respondWithResult(_0x1c1a8e,null))[_0x663a('0x43')](handleError(_0x1c1a8e,null));}; \ No newline at end of file +var _0xd133=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','type','key','keys','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','UserProfileSection','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2c5ec9,_0x497868){var _0x2ce268=function(_0x14cd42){while(--_0x14cd42){_0x2c5ec9['push'](_0x2c5ec9['shift']());}};_0x2ce268(++_0x497868);}(_0xd133,0x92));var _0x3d13=function(_0x2b72ef,_0x574981){_0x2b72ef=_0x2b72ef-0x0;var _0x56a161=_0xd133[_0x2b72ef];return _0x56a161;};'use strict';var emlformat=require(_0x3d13('0x0'));var rimraf=require(_0x3d13('0x1'));var zipdir=require(_0x3d13('0x2'));var jsonpatch=require(_0x3d13('0x3'));var rp=require('request-promise');var moment=require(_0x3d13('0x4'));var BPromise=require(_0x3d13('0x5'));var Mustache=require(_0x3d13('0x6'));var util=require(_0x3d13('0x7'));var path=require(_0x3d13('0x8'));var sox=require(_0x3d13('0x9'));var csv=require(_0x3d13('0xa'));var ejs=require(_0x3d13('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d13('0xc'));var squel=require('squel');var crypto=require(_0x3d13('0xd'));var jsforce=require(_0x3d13('0xe'));var deskjs=require(_0x3d13('0xf'));var toCsv=require(_0x3d13('0xa'));var querystring=require('querystring');var Papa=require(_0x3d13('0x10'));var Redis=require('ioredis');var authService=require(_0x3d13('0x11'));var qs=require(_0x3d13('0x12'));var as=require(_0x3d13('0x13'));var hardwareService=require(_0x3d13('0x14'));var logger=require('../../config/logger')(_0x3d13('0x15'));var utils=require(_0x3d13('0x16'));var config=require(_0x3d13('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d13('0x18'))['db'];function respondWithStatusCode(_0xde405c,_0x41b533){_0x41b533=_0x41b533||0xcc;return function(_0x2d0a02){if(_0x2d0a02){return _0xde405c['sendStatus'](_0x41b533);}return _0xde405c['status'](_0x41b533)[_0x3d13('0x19')]();};}function respondWithResult(_0xbef0bd,_0x50a903){_0x50a903=_0x50a903||0xc8;return function(_0x3128ad){if(_0x3128ad){return _0xbef0bd[_0x3d13('0x1a')](_0x50a903)[_0x3d13('0x1b')](_0x3128ad);}};}function respondWithFilteredResult(_0x418237,_0x3c64c2){return function(_0x34f766){if(_0x34f766){var _0x5e7a8e=typeof _0x3c64c2[_0x3d13('0x1c')]==='undefined'&&typeof _0x3c64c2[_0x3d13('0x1d')]===_0x3d13('0x1e');var _0x1d6812=_0x34f766[_0x3d13('0x1f')];var _0x2e8592=_0x5e7a8e?0x0:_0x3c64c2[_0x3d13('0x1c')];var _0x3f6a74=_0x5e7a8e?_0x34f766[_0x3d13('0x1f')]:_0x3c64c2[_0x3d13('0x1c')]+_0x3c64c2[_0x3d13('0x1d')];var _0x1b39a9;if(_0x3f6a74>=_0x1d6812){_0x3f6a74=_0x1d6812;_0x1b39a9=0xc8;}else{_0x1b39a9=0xce;}_0x418237['status'](_0x1b39a9);return _0x418237[_0x3d13('0x20')](_0x3d13('0x21'),_0x2e8592+'-'+_0x3f6a74+'/'+_0x1d6812)[_0x3d13('0x1b')](_0x34f766);}return null;};}function patchUpdates(_0x431028){return function(_0x2918db){try{jsonpatch[_0x3d13('0x22')](_0x2918db,_0x431028,!![]);}catch(_0x6f4acb){return BPromise[_0x3d13('0x23')](_0x6f4acb);}return _0x2918db['save']();};}function saveUpdates(_0x59cc57,_0x4af203){return function(_0x3e2332){if(_0x3e2332){return _0x3e2332[_0x3d13('0x24')](_0x59cc57)['then'](function(_0x163e97){return _0x163e97;});}return null;};}function removeEntity(_0x577c15,_0x10c9a0){return function(_0x810c45){if(_0x810c45){return _0x810c45[_0x3d13('0x25')]()[_0x3d13('0x26')](function(){_0x577c15[_0x3d13('0x1a')](0xcc)[_0x3d13('0x19')]();});}};}function handleEntityNotFound(_0x5a7b05,_0x352f8c){return function(_0x3f1f03){if(!_0x3f1f03){_0x5a7b05['sendStatus'](0x194);}return _0x3f1f03;};}function handleError(_0x4f3970,_0x65d868){_0x65d868=_0x65d868||0x1f4;return function(_0x46b305){logger[_0x3d13('0x27')](_0x46b305['stack']);if(_0x46b305[_0x3d13('0x28')]){delete _0x46b305[_0x3d13('0x28')];}_0x4f3970['status'](_0x65d868)[_0x3d13('0x29')](_0x46b305);};}exports[_0x3d13('0x2a')]=function(_0x2500c5,_0x1125c4){var _0x57aa3d={},_0x4d8f3e={},_0xc3f467={'count':0x0,'rows':[]};var _0x21af02=_[_0x3d13('0x2b')](db['UserProfileSection'][_0x3d13('0x2c')],function(_0x169197){return{'name':_0x169197['fieldName'],'type':_0x169197[_0x3d13('0x2d')][_0x3d13('0x2e')]};});_0x4d8f3e['model']=_[_0x3d13('0x2b')](_0x21af02,_0x3d13('0x28'));_0x4d8f3e['query']=_[_0x3d13('0x2f')](_0x2500c5[_0x3d13('0x30')]);_0x4d8f3e['filters']=_[_0x3d13('0x31')](_0x4d8f3e['model'],_0x4d8f3e[_0x3d13('0x30')]);_0x57aa3d[_0x3d13('0x32')]=_[_0x3d13('0x31')](_0x4d8f3e[_0x3d13('0x33')],qs[_0x3d13('0x34')](_0x2500c5[_0x3d13('0x30')][_0x3d13('0x34')]));_0x57aa3d[_0x3d13('0x32')]=_0x57aa3d['attributes']['length']?_0x57aa3d[_0x3d13('0x32')]:_0x4d8f3e[_0x3d13('0x33')];if(!_0x2500c5[_0x3d13('0x30')][_0x3d13('0x35')](_0x3d13('0x36'))){_0x57aa3d['limit']=qs['limit'](_0x2500c5[_0x3d13('0x30')][_0x3d13('0x1d')]);_0x57aa3d[_0x3d13('0x1c')]=qs[_0x3d13('0x1c')](_0x2500c5[_0x3d13('0x30')][_0x3d13('0x1c')]);}_0x57aa3d['order']=qs[_0x3d13('0x37')](_0x2500c5['query'][_0x3d13('0x37')]);_0x57aa3d['where']=qs[_0x3d13('0x38')](_[_0x3d13('0x39')](_0x2500c5[_0x3d13('0x30')],_0x4d8f3e['filters']),_0x21af02);if(_0x2500c5[_0x3d13('0x30')][_0x3d13('0x3a')]){_0x57aa3d[_0x3d13('0x3b')]=_['merge'](_0x57aa3d['where'],{'$or':_[_0x3d13('0x2b')](_0x21af02,function(_0x2426d2){if(_0x2426d2[_0x3d13('0x2d')]!==_0x3d13('0x3c')){var _0x25505a={};_0x25505a[_0x2426d2['name']]={'$like':'%'+_0x2500c5[_0x3d13('0x30')][_0x3d13('0x3a')]+'%'};return _0x25505a;}})});}_0x57aa3d=_[_0x3d13('0x3d')]({},_0x57aa3d,_0x2500c5[_0x3d13('0x3e')]);var _0x52f69a={'where':_0x57aa3d[_0x3d13('0x3b')]};return db[_0x3d13('0x3f')]['count'](_0x52f69a)['then'](function(_0x10eff7){_0xc3f467[_0x3d13('0x1f')]=_0x10eff7;if(_0x2500c5['query'][_0x3d13('0x40')]){_0x57aa3d[_0x3d13('0x41')]=[{'all':!![]}];}return db[_0x3d13('0x3f')][_0x3d13('0x42')](_0x57aa3d);})['then'](function(_0x3ee2e7){_0xc3f467['rows']=_0x3ee2e7;return _0xc3f467;})['then'](respondWithFilteredResult(_0x1125c4,_0x57aa3d))[_0x3d13('0x43')](handleError(_0x1125c4,null));};exports[_0x3d13('0x44')]=function(_0x42e353,_0x3ad342){var _0x2842fe={'raw':![],'where':{'id':_0x42e353[_0x3d13('0x45')]['id']}},_0x2bdea0={};_0x2bdea0[_0x3d13('0x33')]=_['keys'](db[_0x3d13('0x3f')]['rawAttributes']);_0x2bdea0['query']=_[_0x3d13('0x2f')](_0x42e353[_0x3d13('0x30')]);_0x2bdea0['filters']=_[_0x3d13('0x31')](_0x2bdea0['model'],_0x2bdea0[_0x3d13('0x30')]);_0x2842fe[_0x3d13('0x32')]=_['intersection'](_0x2bdea0[_0x3d13('0x33')],qs['fields'](_0x42e353['query'][_0x3d13('0x34')]));_0x2842fe[_0x3d13('0x32')]=_0x2842fe[_0x3d13('0x32')][_0x3d13('0x46')]?_0x2842fe[_0x3d13('0x32')]:_0x2bdea0['model'];if(_0x42e353[_0x3d13('0x30')][_0x3d13('0x40')]){_0x2842fe[_0x3d13('0x41')]=[{'all':!![]}];}_0x2842fe=_[_0x3d13('0x3d')]({},_0x2842fe,_0x42e353['options']);return db[_0x3d13('0x3f')][_0x3d13('0x47')](_0x2842fe)[_0x3d13('0x26')](handleEntityNotFound(_0x3ad342,null))[_0x3d13('0x26')](respondWithResult(_0x3ad342,null))['catch'](handleError(_0x3ad342,null));};exports[_0x3d13('0x48')]=function(_0x4930dd,_0x28fb85){return db['UserProfileSection'][_0x3d13('0x48')](_0x4930dd['body'],{})['then'](respondWithResult(_0x28fb85,0xc9))[_0x3d13('0x43')](handleError(_0x28fb85,null));};exports[_0x3d13('0x24')]=function(_0x186f80,_0x4561f){if(_0x186f80['body']['id']){delete _0x186f80[_0x3d13('0x49')]['id'];}return db[_0x3d13('0x3f')]['find']({'where':{'id':_0x186f80[_0x3d13('0x45')]['id']}})[_0x3d13('0x26')](handleEntityNotFound(_0x4561f,null))[_0x3d13('0x26')](saveUpdates(_0x186f80[_0x3d13('0x49')],null))[_0x3d13('0x26')](respondWithResult(_0x4561f,null))[_0x3d13('0x43')](handleError(_0x4561f,null));};exports[_0x3d13('0x25')]=function(_0x4510d8,_0x53b908){return db['UserProfileSection']['find']({'where':{'id':_0x4510d8[_0x3d13('0x45')]['id']}})[_0x3d13('0x26')](handleEntityNotFound(_0x53b908,null))['then'](removeEntity(_0x53b908,null))[_0x3d13('0x43')](handleError(_0x53b908,null));};exports[_0x3d13('0x4a')]=function(_0x3fa7ba,_0x2ce179){return db[_0x3d13('0x3f')]['describe']()['then'](respondWithResult(_0x2ce179,null))[_0x3d13('0x43')](handleError(_0x2ce179,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9046945..e874c84 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 _0x8ad3=['sectionId','userProfileId','lodash','../../config/logger','api','moment','./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x49c5b0,_0xca8692){var _0x4efb64=function(_0x292e79){while(--_0x292e79){_0x49c5b0['push'](_0x49c5b0['shift']());}};_0x4efb64(++_0xca8692);}(_0x8ad3,0xe8));var _0x38ad=function(_0x329f7d,_0x1a05ec){_0x329f7d=_0x329f7d-0x0;var _0x8dd063=_0x8ad3[_0x329f7d];return _0x8dd063;};'use strict';var _=require(_0x38ad('0x0'));var util=require('util');var logger=require(_0x38ad('0x1'))(_0x38ad('0x2'));var moment=require(_0x38ad('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x38ad('0x4'));module['exports']=function(_0x2d3d70,_0x4c3ac8){return _0x2d3d70['define'](_0x38ad('0x5'),attributes,{'tableName':_0x38ad('0x6'),'paranoid':![],'indexes':[{'name':_0x38ad('0x7'),'fields':[_0x38ad('0x8'),_0x38ad('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x366c=['../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x11cef1,_0x1ad3ef){var _0x31e3e8=function(_0x2056b9){while(--_0x2056b9){_0x11cef1['push'](_0x11cef1['shift']());}};_0x31e3e8(++_0x1ad3ef);}(_0x366c,0x189));var _0xc366=function(_0x23b4ad,_0x248517){_0x23b4ad=_0x23b4ad-0x0;var _0x4fa166=_0x366c[_0x23b4ad];return _0x4fa166;};'use strict';var _=require(_0xc366('0x0'));var util=require(_0xc366('0x1'));var logger=require('../../config/logger')(_0xc366('0x2'));var moment=require('moment');var BPromise=require(_0xc366('0x3'));var rp=require(_0xc366('0x4'));var fs=require('fs');var path=require(_0xc366('0x5'));var rimraf=require(_0xc366('0x6'));var config=require(_0xc366('0x7'));var attributes=require(_0xc366('0x8'));module[_0xc366('0x9')]=function(_0x45b753,_0xcbff9a){return _0x45b753[_0xc366('0xa')](_0xc366('0xb'),attributes,{'tableName':_0xc366('0xc'),'paranoid':![],'indexes':[{'name':_0xc366('0xd'),'fields':[_0xc366('0xe'),_0xc366('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 53aa4f4..ec26ae2 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 _0x7cf6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5946be,_0x1f65b5){var _0x3184b0=function(_0x60b1b6){while(--_0x60b1b6){_0x5946be['push'](_0x5946be['shift']());}};_0x3184b0(++_0x1f65b5);}(_0x7cf6,0x143));var _0x67cf=function(_0x1bd91c,_0x285e72){_0x1bd91c=_0x1bd91c-0x0;var _0x3bc43c=_0x7cf6[_0x1bd91c];return _0x3bc43c;};'use strict';var _=require('lodash');var util=require(_0x67cf('0x0'));var moment=require(_0x67cf('0x1'));var BPromise=require(_0x67cf('0x2'));var rs=require(_0x67cf('0x3'));var fs=require('fs');var Redis=require(_0x67cf('0x4'));var db=require(_0x67cf('0x5'))['db'];var utils=require(_0x67cf('0x6'));var logger=require(_0x67cf('0x7'))(_0x67cf('0x8'));var config=require(_0x67cf('0x9'));var jayson=require(_0x67cf('0xa'));var client=jayson[_0x67cf('0xb')][_0x67cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e0d72,_0x15ffd0,_0x4c5006){return new BPromise(function(_0x26900a,_0xb46df4){return client[_0x67cf('0xd')](_0x1e0d72,_0x4c5006)[_0x67cf('0xe')](function(_0x29c6b5){logger['info'](_0x67cf('0xf'),_0x15ffd0,_0x67cf('0x10'));logger[_0x67cf('0x11')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x15ffd0,_0x67cf('0x10'),JSON[_0x67cf('0x12')](_0x29c6b5));if(_0x29c6b5[_0x67cf('0x13')]){if(_0x29c6b5[_0x67cf('0x13')]['code']===0x1f4){logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x29c6b5['error']['message']);return _0xb46df4(_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);}logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);return _0x26900a(_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);}else{logger['info'](_0x67cf('0xf'),_0x15ffd0,_0x67cf('0x10'));_0x26900a(_0x29c6b5['result'][_0x67cf('0x14')]);}})[_0x67cf('0x15')](function(_0x1d90ad){logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x1d90ad);_0xb46df4(_0x1d90ad);});});} \ No newline at end of file +var _0x13a6=['http','request','then','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2518bf,_0x2c94ba){var _0x3d3a69=function(_0x470666){while(--_0x470666){_0x2518bf['push'](_0x2518bf['shift']());}};_0x3d3a69(++_0x2c94ba);}(_0x13a6,0x9c));var _0x613a=function(_0x3d4d91,_0x577d8a){_0x3d4d91=_0x3d4d91-0x0;var _0xa30755=_0x13a6[_0x3d4d91];return _0xa30755;};'use strict';var _=require(_0x613a('0x0'));var util=require('util');var moment=require(_0x613a('0x1'));var BPromise=require(_0x613a('0x2'));var rs=require(_0x613a('0x3'));var fs=require('fs');var Redis=require(_0x613a('0x4'));var db=require(_0x613a('0x5'))['db'];var utils=require(_0x613a('0x6'));var logger=require(_0x613a('0x7'))(_0x613a('0x8'));var config=require(_0x613a('0x9'));var jayson=require(_0x613a('0xa'));var client=jayson[_0x613a('0xb')][_0x613a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa7a33f,_0x3aa6ec,_0x5f0f73){return new BPromise(function(_0x47b356,_0x40c09b){return client[_0x613a('0xd')](_0xa7a33f,_0x5f0f73)[_0x613a('0xe')](function(_0x2e3f41){logger['info'](_0x613a('0xf'),_0x3aa6ec,'request\x20sent');logger['debug'](_0x613a('0x10'),_0x3aa6ec,_0x613a('0x11'),JSON['stringify'](_0x2e3f41));if(_0x2e3f41[_0x613a('0x12')]){if(_0x2e3f41[_0x613a('0x12')]['code']===0x1f4){logger[_0x613a('0x12')](_0x613a('0xf'),_0x3aa6ec,_0x2e3f41['error'][_0x613a('0x13')]);return _0x40c09b(_0x2e3f41['error']['message']);}logger[_0x613a('0x12')](_0x613a('0xf'),_0x3aa6ec,_0x2e3f41[_0x613a('0x12')][_0x613a('0x13')]);return _0x47b356(_0x2e3f41[_0x613a('0x12')][_0x613a('0x13')]);}else{logger['info'](_0x613a('0xf'),_0x3aa6ec,_0x613a('0x11'));_0x47b356(_0x2e3f41[_0x613a('0x14')][_0x613a('0x13')]);}})['catch'](function(_0x24c215){logger[_0x613a('0x12')](_0x613a('0xf'),_0x3aa6ec,_0x24c215);_0x40c09b(_0x24c215);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index f22ef28..fdd7b0d 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x12d44c,_0xf11296){var _0x4fde20=function(_0x3c1ad6){while(--_0x3c1ad6){_0x12d44c['push'](_0x12d44c['shift']());}};_0x4fde20(++_0xf11296);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x16ca56,_0x199c36){var _0x289c68=function(_0x2903e3){while(--_0x2903e3){_0x16ca56['push'](_0x16ca56['shift']());}};_0x289c68(++_0x199c36);}(_0xedd9,0xfc));var _0x9edd=function(_0x3d1fdc,_0x28b2bc){_0x3d1fdc=_0x3d1fdc-0x0;var _0xffbd83=_0xedd9[_0x3d1fdc];return _0xffbd83;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 0b5c2a2..fb89bae 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 _0xf505=['INTEGER'];(function(_0x1ee74c,_0x54bb4c){var _0x588396=function(_0x4aa7e1){while(--_0x4aa7e1){_0x1ee74c['push'](_0x1ee74c['shift']());}};_0x588396(++_0x54bb4c);}(_0xf505,0x14b));var _0x5f50=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0xf505[_0x37c8ef];return _0x5eaee9;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5f50('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f7b=['exports','INTEGER'];(function(_0x1ee739,_0x29ae9e){var _0xee5173=function(_0x9078bc){while(--_0x9078bc){_0x1ee739['push'](_0x1ee739['shift']());}};_0xee5173(++_0x29ae9e);}(_0x5f7b,0x19c));var _0xb5f7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5f7b[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require('sequelize');module[_0xb5f7('0x0')]={'penalty':{'type':Sequelize[_0xb5f7('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 b91f553..13e14d1 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 _0x1967=['path','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x166e33,_0x127e77){var _0x1a2409=function(_0x48edd3){while(--_0x48edd3){_0x166e33['push'](_0x166e33['shift']());}};_0x1a2409(++_0x127e77);}(_0x1967,0x173));var _0x7196=function(_0x3885bf,_0x25234f){_0x3885bf=_0x3885bf-0x0;var _0x255986=_0x1967[_0x3885bf];return _0x255986;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cad=['UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0xf65783,_0x50c29f){var _0x221b4b=function(_0x27855c){while(--_0x27855c){_0xf65783['push'](_0xf65783['shift']());}};_0x221b4b(++_0x50c29f);}(_0x8cad,0xfe));var _0xd8ca=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x8cad[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var logger=require(_0xd8ca('0x2'))(_0xd8ca('0x3'));var moment=require(_0xd8ca('0x4'));var BPromise=require(_0xd8ca('0x5'));var rp=require(_0xd8ca('0x6'));var fs=require('fs');var path=require(_0xd8ca('0x7'));var rimraf=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var attributes=require(_0xd8ca('0xa'));module[_0xd8ca('0xb')]=function(_0x14c73e,_0x6d5070){return _0x14c73e['define'](_0xd8ca('0xc'),attributes,{'tableName':_0xd8ca('0xd'),'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 8100f27..aa997da 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 _0xc52a=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x73ab0e,_0x394982){var _0x33e25a=function(_0x351701){while(--_0x351701){_0x73ab0e['push'](_0x73ab0e['shift']());}};_0x33e25a(++_0x394982);}(_0xc52a,0xbd));var _0xac52=function(_0x10e956,_0xd5fcf0){_0x10e956=_0x10e956-0x0;var _0x3312a0=_0xc52a[_0x10e956];return _0x3312a0;};'use strict';var _=require(_0xac52('0x0'));var util=require('util');var moment=require(_0xac52('0x1'));var BPromise=require('bluebird');var rs=require(_0xac52('0x2'));var fs=require('fs');var Redis=require(_0xac52('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac52('0x4'));var config=require(_0xac52('0x5'));var jayson=require(_0xac52('0x6'));var client=jayson[_0xac52('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2004b4,_0x2e68e0,_0x1e1df1){return new BPromise(function(_0x5df752,_0x2da884){return client[_0xac52('0x8')](_0x2004b4,_0x1e1df1)[_0xac52('0x9')](function(_0x28bc85){logger[_0xac52('0xa')](_0xac52('0xb'),_0x2e68e0,_0xac52('0xc'));logger[_0xac52('0xd')](_0xac52('0xe'),_0x2e68e0,'request\x20sent',JSON[_0xac52('0xf')](_0x28bc85));if(_0x28bc85[_0xac52('0x10')]){if(_0x28bc85[_0xac52('0x10')]['code']===0x1f4){logger[_0xac52('0x10')](_0xac52('0xb'),_0x2e68e0,_0x28bc85['error'][_0xac52('0x11')]);return _0x2da884(_0x28bc85[_0xac52('0x10')][_0xac52('0x11')]);}logger[_0xac52('0x10')](_0xac52('0xb'),_0x2e68e0,_0x28bc85[_0xac52('0x10')][_0xac52('0x11')]);return _0x5df752(_0x28bc85[_0xac52('0x10')]['message']);}else{logger[_0xac52('0xa')](_0xac52('0xb'),_0x2e68e0,'request\x20sent');_0x5df752(_0x28bc85['result'][_0xac52('0x11')]);}})['catch'](function(_0x127bf5){logger[_0xac52('0x10')](_0xac52('0xb'),_0x2e68e0,_0x127bf5);_0x2da884(_0x127bf5);});});} \ No newline at end of file +var _0x1c13=['../../config/logger','rpc','../../config/environment','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0x1c13,0x1b3));var _0x31c1=function(_0x427904,_0x50f281){_0x427904=_0x427904-0x0;var _0x3c46fc=_0x1c13[_0x427904];return _0x3c46fc;};'use strict';var _=require('lodash');var util=require(_0x31c1('0x0'));var moment=require(_0x31c1('0x1'));var BPromise=require(_0x31c1('0x2'));var rs=require(_0x31c1('0x3'));var fs=require('fs');var Redis=require(_0x31c1('0x4'));var db=require(_0x31c1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x31c1('0x6'))(_0x31c1('0x7'));var config=require(_0x31c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x31c1('0x9')][_0x31c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x341663,_0xb921a5,_0x11ec78){return new BPromise(function(_0x19b54a,_0x4a4da8){return client[_0x31c1('0xb')](_0x341663,_0x11ec78)['then'](function(_0x3ec0b5){logger['info'](_0x31c1('0xc'),_0xb921a5,_0x31c1('0xd'));logger[_0x31c1('0xe')](_0x31c1('0xf'),_0xb921a5,_0x31c1('0xd'),JSON[_0x31c1('0x10')](_0x3ec0b5));if(_0x3ec0b5[_0x31c1('0x11')]){if(_0x3ec0b5[_0x31c1('0x11')][_0x31c1('0x12')]===0x1f4){logger[_0x31c1('0x11')](_0x31c1('0xc'),_0xb921a5,_0x3ec0b5[_0x31c1('0x11')][_0x31c1('0x13')]);return _0x4a4da8(_0x3ec0b5['error'][_0x31c1('0x13')]);}logger[_0x31c1('0x11')](_0x31c1('0xc'),_0xb921a5,_0x3ec0b5[_0x31c1('0x11')][_0x31c1('0x13')]);return _0x19b54a(_0x3ec0b5['error'][_0x31c1('0x13')]);}else{logger['info'](_0x31c1('0xc'),_0xb921a5,_0x31c1('0xd'));_0x19b54a(_0x3ec0b5[_0x31c1('0x14')]['message']);}})['catch'](function(_0x5a2554){logger[_0x31c1('0x11')](_0x31c1('0xc'),_0xb921a5,_0x5a2554);_0x4a4da8(_0x5a2554);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 570e3ee..58878e1 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 _0xf04a=['exports','INTEGER','sequelize'];(function(_0x717b4f,_0x57d4b9){var _0x1db135=function(_0x2c6c61){while(--_0x2c6c61){_0x717b4f['push'](_0x717b4f['shift']());}};_0x1db135(++_0x57d4b9);}(_0xf04a,0x161));var _0xaf04=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf04a[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xaf04('0x0'));module[_0xaf04('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xaf04('0x2')]}}; \ No newline at end of file +var _0xaca5=['sequelize','exports','INTEGER'];(function(_0x4aaa3b,_0x2730fe){var _0x3f6749=function(_0x1f2f9a){while(--_0x1f2f9a){_0x4aaa3b['push'](_0x4aaa3b['shift']());}};_0x3f6749(++_0x2730fe);}(_0xaca5,0xa2));var _0x5aca=function(_0x50c2f0,_0x36f947){_0x50c2f0=_0x50c2f0-0x0;var _0x42aa7a=_0xaca5[_0x50c2f0];return _0x42aa7a;};'use strict';var Sequelize=require(_0x5aca('0x0'));module[_0x5aca('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x5aca('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 35469d5..5ad87b2 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(_0x438d85,_0x904786){var _0x2dd5f9=function(_0x2e2b86){while(--_0x2e2b86){_0x438d85['push'](_0x438d85['shift']());}};_0x2dd5f9(++_0x904786);}(_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(_0x28c3f0,_0x2cfa4e){var _0x466daf=function(_0x4e6071){while(--_0x4e6071){_0x28c3f0['push'](_0x28c3f0['shift']());}};_0x466daf(++_0x2cfa4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 6394a94..4b99528 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x588e3a,_0x427e88){var _0x1d3406=function(_0x3c87cf){while(--_0x3c87cf){_0x588e3a['push'](_0x588e3a['shift']());}};_0x1d3406(++_0x427e88);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0xcb91[_0x375325];return _0x228f57;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1972f4,_0x1231ff){var _0x42159b=function(_0x1f9d6f){while(--_0x1f9d6f){_0x1972f4['push'](_0x1972f4['shift']());}};_0x42159b(++_0x1231ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e135939..c6a5a9d 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 _0xf66d=['exports','INTEGER','sequelize'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0xf66d,0x152));var _0xdf66=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xf66d[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0xdf66('0x0'));module[_0xdf66('0x1')]={'penalty':{'type':Sequelize[_0xdf66('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7076=['INTEGER','sequelize'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x7076,0x1b9));var _0x6707=function(_0x4c54c3,_0x1558c3){_0x4c54c3=_0x4c54c3-0x0;var _0x2d9345=_0x7076[_0x4c54c3];return _0x2d9345;};'use strict';var Sequelize=require(_0x6707('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6707('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 d9b5dee..e51951f 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 _0x3bf5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue','util','../../config/logger','api'];(function(_0x5039c9,_0x3e289a){var _0x41d993=function(_0x3ec88a){while(--_0x3ec88a){_0x5039c9['push'](_0x5039c9['shift']());}};_0x41d993(++_0x3e289a);}(_0x3bf5,0x189));var _0x53bf=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0x3bf5[_0x387dc1];return _0x17567c;};'use strict';var _=require('lodash');var util=require(_0x53bf('0x0'));var logger=require(_0x53bf('0x1'))(_0x53bf('0x2'));var moment=require(_0x53bf('0x3'));var BPromise=require(_0x53bf('0x4'));var rp=require(_0x53bf('0x5'));var fs=require('fs');var path=require(_0x53bf('0x6'));var rimraf=require(_0x53bf('0x7'));var config=require(_0x53bf('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x53bf('0x9')]=function(_0x519b2a,_0x58cea1){return _0x519b2a[_0x53bf('0xa')](_0x53bf('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b67=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util'];(function(_0x54bbbd,_0x54cb23){var _0x177c4d=function(_0x5ef6cd){while(--_0x5ef6cd){_0x54bbbd['push'](_0x54bbbd['shift']());}};_0x177c4d(++_0x54cb23);}(_0x9b67,0x8d));var _0x79b6=function(_0x4b1b2a,_0x2c556f){_0x4b1b2a=_0x4b1b2a-0x0;var _0x46b969=_0x9b67[_0x4b1b2a];return _0x46b969;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require('moment');var BPromise=require(_0x79b6('0x4'));var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require(_0x79b6('0x7'));var config=require(_0x79b6('0x8'));var attributes=require(_0x79b6('0x9'));module[_0x79b6('0xa')]=function(_0xb3888,_0x5b2afb){return _0xb3888[_0x79b6('0xb')](_0x79b6('0xc'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 36ede24..c0df53f 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 _0x2390=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xbcee10,_0x5000a9){var _0x441d04=function(_0x550a58){while(--_0x550a58){_0xbcee10['push'](_0xbcee10['shift']());}};_0x441d04(++_0x5000a9);}(_0x2390,0xf6));var _0x0239=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x2390[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0239('0x0'));var util=require(_0x0239('0x1'));var moment=require(_0x0239('0x2'));var BPromise=require('bluebird');var rs=require(_0x0239('0x3'));var fs=require('fs');var Redis=require(_0x0239('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0239('0x5'));var logger=require(_0x0239('0x6'))(_0x0239('0x7'));var config=require(_0x0239('0x8'));var jayson=require(_0x0239('0x9'));var client=jayson[_0x0239('0xa')][_0x0239('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e64fc,_0x1ed697,_0x5e8670){return new BPromise(function(_0x29c76b,_0xca47c1){return client[_0x0239('0xc')](_0x3e64fc,_0x5e8670)[_0x0239('0xd')](function(_0x21d398){logger['info'](_0x0239('0xe'),_0x1ed697,_0x0239('0xf'));logger[_0x0239('0x10')](_0x0239('0x11'),_0x1ed697,_0x0239('0xf'),JSON['stringify'](_0x21d398));if(_0x21d398['error']){if(_0x21d398['error'][_0x0239('0x12')]===0x1f4){logger[_0x0239('0x13')](_0x0239('0xe'),_0x1ed697,_0x21d398[_0x0239('0x13')][_0x0239('0x14')]);return _0xca47c1(_0x21d398[_0x0239('0x13')][_0x0239('0x14')]);}logger[_0x0239('0x13')](_0x0239('0xe'),_0x1ed697,_0x21d398[_0x0239('0x13')][_0x0239('0x14')]);return _0x29c76b(_0x21d398[_0x0239('0x13')][_0x0239('0x14')]);}else{logger['info'](_0x0239('0xe'),_0x1ed697,_0x0239('0xf'));_0x29c76b(_0x21d398[_0x0239('0x15')][_0x0239('0x14')]);}})[_0x0239('0x16')](function(_0x68658c){logger[_0x0239('0x13')](_0x0239('0xe'),_0x1ed697,_0x68658c);_0xca47c1(_0x68658c);});});} \ No newline at end of file +var _0xa7d2=['request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5b2859,_0x4f5083){var _0x4ee253=function(_0x1a36ca){while(--_0x1a36ca){_0x5b2859['push'](_0x5b2859['shift']());}};_0x4ee253(++_0x4f5083);}(_0xa7d2,0x138));var _0x2a7d=function(_0x55d688,_0x3f058c){_0x55d688=_0x55d688-0x0;var _0x1327e8=_0xa7d2[_0x55d688];return _0x1327e8;};'use strict';var _=require(_0x2a7d('0x0'));var util=require('util');var moment=require(_0x2a7d('0x1'));var BPromise=require('bluebird');var rs=require(_0x2a7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a7d('0x3'))['db'];var utils=require(_0x2a7d('0x4'));var logger=require(_0x2a7d('0x5'))('rpc');var config=require(_0x2a7d('0x6'));var jayson=require(_0x2a7d('0x7'));var client=jayson[_0x2a7d('0x8')][_0x2a7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a79f8,_0x270259,_0x2691e7){return new BPromise(function(_0x6eb634,_0x52ab6d){return client[_0x2a7d('0xa')](_0x4a79f8,_0x2691e7)[_0x2a7d('0xb')](function(_0x1cdcd7){logger[_0x2a7d('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x270259,'request\x20sent');logger[_0x2a7d('0xd')](_0x2a7d('0xe'),_0x270259,_0x2a7d('0xf'),JSON[_0x2a7d('0x10')](_0x1cdcd7));if(_0x1cdcd7[_0x2a7d('0x11')]){if(_0x1cdcd7[_0x2a7d('0x11')][_0x2a7d('0x12')]===0x1f4){logger['error'](_0x2a7d('0x13'),_0x270259,_0x1cdcd7[_0x2a7d('0x11')][_0x2a7d('0x14')]);return _0x52ab6d(_0x1cdcd7[_0x2a7d('0x11')][_0x2a7d('0x14')]);}logger['error'](_0x2a7d('0x13'),_0x270259,_0x1cdcd7[_0x2a7d('0x11')][_0x2a7d('0x14')]);return _0x6eb634(_0x1cdcd7['error'][_0x2a7d('0x14')]);}else{logger[_0x2a7d('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x270259,_0x2a7d('0xf'));_0x6eb634(_0x1cdcd7[_0x2a7d('0x15')][_0x2a7d('0x14')]);}})[_0x2a7d('0x16')](function(_0x494023){logger[_0x2a7d('0x11')](_0x2a7d('0x13'),_0x270259,_0x494023);_0x52ab6d(_0x494023);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 98aa684..aa43869 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(_0x1119c8,_0x87303e){var _0x3f3071=function(_0x27a847){while(--_0x27a847){_0x1119c8['push'](_0x1119c8['shift']());}};_0x3f3071(++_0x87303e);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x242a46,_0x46d41d){var _0x1fb3bc=function(_0x55730b){while(--_0x55730b){_0x242a46['push'](_0x242a46['shift']());}};_0x1fb3bc(++_0x46d41d);}(_0xe706,0xa3));var _0x6e70=function(_0x184a95,_0x500731){_0x184a95=_0x184a95-0x0;var _0x55eadf=_0xe706[_0x184a95];return _0x55eadf;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 471a12a..0edcac4 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 _0xd064=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize','exports'];(function(_0x59283a,_0x3efeb5){var _0x2b70a8=function(_0x2d2490){while(--_0x2d2490){_0x59283a['push'](_0x59283a['shift']());}};_0x2b70a8(++_0x3efeb5);}(_0xd064,0xe8));var _0x4d06=function(_0x546c68,_0x5c0116){_0x546c68=_0x546c68-0x0;var _0x4a2389=_0xd064[_0x546c68];return _0x4a2389;};'use strict';var Sequelize=require(_0x4d06('0x0'));module[_0x4d06('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4d06('0x2')},'membername':{'type':Sequelize[_0x4d06('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x4d06('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4d06('0x3')],'allowNull':![],'unique':_0x4d06('0x5'),'comment':_0x4d06('0x2')},'VoiceQueueId':{'type':Sequelize[_0x4d06('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x4d06('0x3')],'allowNull':![],'unique':_0x4d06('0x5'),'comment':_0x4d06('0x2')},'penalty':{'type':Sequelize[_0x4d06('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4d06('0x4')](0xb),'defaultValue':0x0,'comment':_0x4d06('0x2')}}; \ No newline at end of file +var _0x1177=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x3b5450,_0x3b7706){var _0xf5b86d=function(_0xf64038){while(--_0xf64038){_0x3b5450['push'](_0x3b5450['shift']());}};_0xf5b86d(++_0x3b7706);}(_0x1177,0x1ab));var _0x7117=function(_0x3069a4,_0x424754){_0x3069a4=_0x3069a4-0x0;var _0x1ee18d=_0x1177[_0x3069a4];return _0x1ee18d;};'use strict';var Sequelize=require(_0x7117('0x0'));module[_0x7117('0x1')]={'uniqueid':{'type':Sequelize[_0x7117('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7117('0x3')},'membername':{'type':Sequelize[_0x7117('0x4')],'allowNull':![],'comment':_0x7117('0x3')},'UserId':{'type':Sequelize[_0x7117('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7117('0x4')],'allowNull':![],'unique':_0x7117('0x5'),'comment':_0x7117('0x3')},'VoiceQueueId':{'type':Sequelize[_0x7117('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7117('0x5'),'comment':_0x7117('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7117('0x3')},'paused':{'type':Sequelize[_0x7117('0x2')](0xb),'defaultValue':0x0,'comment':_0x7117('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ce4c1e6..9b1e7af 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 _0x9599=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x4e0281,_0x1da618){var _0x256be6=function(_0x1aa682){while(--_0x1aa682){_0x4e0281['push'](_0x4e0281['shift']());}};_0x256be6(++_0x1da618);}(_0x9599,0x155));var _0x9959=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x9599[_0x3e6d5d];return _0x238923;};'use strict';var EventEmitter=require(_0x9959('0x0'));var UserVoiceQueueRt=require(_0x9959('0x1'))['db'][_0x9959('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9959('0x3')](0x0);var events={'afterCreate':_0x9959('0x4'),'afterUpdate':_0x9959('0x5'),'afterDestroy':_0x9959('0x6')};function emitEvent(_0xadb42f){return function(_0x792fac,_0x452d51,_0x27f9fa){UserVoiceQueueRtEvents['emit'](_0xadb42f+':'+_0x792fac['id'],_0x792fac);UserVoiceQueueRtEvents['emit'](_0xadb42f,_0x792fac);_0x27f9fa(null);};}for(var e in events){if(events[_0x9959('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x9959('0x8')](e,emitEvent(event));}}module[_0x9959('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa1d7=['update','remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','save'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa1d7,0x8c));var _0x7a1d=function(_0x28f922,_0x1302f8){_0x28f922=_0x28f922-0x0;var _0x4eceac=_0xa1d7[_0x28f922];return _0x4eceac;};'use strict';var EventEmitter=require(_0x7a1d('0x0'));var UserVoiceQueueRt=require(_0x7a1d('0x1'))['db'][_0x7a1d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7a1d('0x3'),'afterUpdate':_0x7a1d('0x4'),'afterDestroy':_0x7a1d('0x5')};function emitEvent(_0xf8ba1){return function(_0x570ea7,_0x46f165,_0x329cfb){UserVoiceQueueRtEvents['emit'](_0xf8ba1+':'+_0x570ea7['id'],_0x570ea7);UserVoiceQueueRtEvents[_0x7a1d('0x6')](_0xf8ba1,_0x570ea7);_0x329cfb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x7a1d('0x7')](e,emitEvent(event));}}module[_0x7a1d('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 52fdd02..5826672 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 _0xb30c=['define','UserVoiceQueueRt','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x54616f,_0x307293){var _0x18ce56=function(_0x150a04){while(--_0x150a04){_0x54616f['push'](_0x54616f['shift']());}};_0x18ce56(++_0x307293);}(_0xb30c,0xbd));var _0xcb30=function(_0x39155c,_0xd27ccb){_0x39155c=_0x39155c-0x0;var _0x1397e3=_0xb30c[_0x39155c];return _0x1397e3;};'use strict';var _=require(_0xcb30('0x0'));var util=require(_0xcb30('0x1'));var logger=require(_0xcb30('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcb30('0x3'));var rp=require(_0xcb30('0x4'));var fs=require('fs');var path=require(_0xcb30('0x5'));var rimraf=require(_0xcb30('0x6'));var config=require(_0xcb30('0x7'));var attributes=require(_0xcb30('0x8'));module['exports']=function(_0x8331ca,_0x294478){return _0x8331ca[_0xcb30('0x9')](_0xcb30('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e83=['api','bluebird','path','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e83,0xc3));var _0x37e8=function(_0x1a381e,_0x3030ab){_0x1a381e=_0x1a381e-0x0;var _0x4d0482=_0x7e83[_0x1a381e];return _0x4d0482;};'use strict';var _=require(_0x37e8('0x0'));var util=require(_0x37e8('0x1'));var logger=require(_0x37e8('0x2'))(_0x37e8('0x3'));var moment=require('moment');var BPromise=require(_0x37e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37e8('0x5'));var rimraf=require('rimraf');var config=require(_0x37e8('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x37e8('0x7')]=function(_0x494cee,_0x1aa8ae){return _0x494cee[_0x37e8('0x8')](_0x37e8('0x9'),attributes,{'tableName':_0x37e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 74542fe..cb28b7a 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 _0xca32=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses'];(function(_0x3ad54a,_0x33f0e2){var _0x18f50f=function(_0x342bbc){while(--_0x342bbc){_0x3ad54a['push'](_0x3ad54a['shift']());}};_0x18f50f(++_0x33f0e2);}(_0xca32,0x18c));var _0x2ca3=function(_0x4322f4,_0x34937d){_0x4322f4=_0x4322f4-0x0;var _0x41d35e=_0xca32[_0x4322f4];return _0x41d35e;};'use strict';var _=require(_0x2ca3('0x0'));var util=require(_0x2ca3('0x1'));var moment=require(_0x2ca3('0x2'));var BPromise=require(_0x2ca3('0x3'));var rs=require(_0x2ca3('0x4'));var fs=require('fs');var Redis=require(_0x2ca3('0x5'));var db=require(_0x2ca3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ca3('0x7'))(_0x2ca3('0x8'));var config=require('../../config/environment');var jayson=require(_0x2ca3('0x9'));var client=jayson[_0x2ca3('0xa')][_0x2ca3('0xb')]({'port':0x232a});config[_0x2ca3('0xc')]=_[_0x2ca3('0xd')](config[_0x2ca3('0xc')],{'host':_0x2ca3('0xe'),'port':0x18eb});var socket=require(_0x2ca3('0xf'))(new Redis(config['redis']));require(_0x2ca3('0x10'))[_0x2ca3('0x11')](socket);function respondWithRpcPromise(_0x51a1f0,_0x19a26a,_0x1b13cc){return new BPromise(function(_0x103e9e,_0x202016){return client[_0x2ca3('0x12')](_0x51a1f0,_0x1b13cc)[_0x2ca3('0x13')](function(_0x2edc63){logger[_0x2ca3('0x14')](_0x2ca3('0x15'),_0x19a26a,_0x2ca3('0x16'));logger[_0x2ca3('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x19a26a,_0x2ca3('0x16'),JSON[_0x2ca3('0x18')](_0x2edc63));if(_0x2edc63[_0x2ca3('0x19')]){if(_0x2edc63[_0x2ca3('0x19')][_0x2ca3('0x1a')]===0x1f4){logger['error'](_0x2ca3('0x15'),_0x19a26a,_0x2edc63[_0x2ca3('0x19')][_0x2ca3('0x1b')]);return _0x202016(_0x2edc63['error']['message']);}logger[_0x2ca3('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x19a26a,_0x2edc63[_0x2ca3('0x19')]['message']);return _0x103e9e(_0x2edc63[_0x2ca3('0x19')]['message']);}else{logger[_0x2ca3('0x14')](_0x2ca3('0x15'),_0x19a26a,_0x2ca3('0x16'));_0x103e9e(_0x2edc63[_0x2ca3('0x1c')][_0x2ca3('0x1b')]);}})[_0x2ca3('0x1d')](function(_0x248519){logger['error'](_0x2ca3('0x15'),_0x19a26a,_0x248519);_0x202016(_0x248519);});});}exports['GetVoiceQueueRtPauses']=function(_0x36415e){var _0x1ce9e4=this;return new Promise(function(_0x542047,_0x64f7e1){return db['UserVoiceQueueRt']['findAll']({'raw':_0x36415e['options']?_0x36415e[_0x2ca3('0x1e')][_0x2ca3('0x1f')]===undefined?!![]:![]:!![],'where':_0x36415e[_0x2ca3('0x1e')]?_0x36415e[_0x2ca3('0x1e')]['where']||null:null,'attributes':[[db[_0x2ca3('0x20')]['fn']('COUNT',db[_0x2ca3('0x20')]['fn']('IF',db[_0x2ca3('0x20')][_0x2ca3('0x21')](_0x2ca3('0x22')))),'outboundQueuePauses']]})[_0x2ca3('0x13')](function(_0x4f0240){logger[_0x2ca3('0x14')](_0x2ca3('0x23'),_0x36415e);logger[_0x2ca3('0x17')](_0x2ca3('0x23'),_0x36415e,JSON[_0x2ca3('0x18')](_0x4f0240));_0x542047(_0x4f0240);})[_0x2ca3('0x1d')](function(_0x4471a7){logger['error'](_0x2ca3('0x23'),_0x4471a7['message'],_0x36415e);_0x64f7e1(_0x1ce9e4['error'](0x1f4,_0x4471a7[_0x2ca3('0x1b')]));});});}; \ No newline at end of file +var _0x5409=['client','http','redis','defaults','socket.io-emitter','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','COUNT','sequelize','literal','outboundQueuePauses','stringify','lodash','util','moment','randomstring','ioredis','jayson/promise'];(function(_0x73e588,_0x2c82b4){var _0x20ef8b=function(_0x708003){while(--_0x708003){_0x73e588['push'](_0x73e588['shift']());}};_0x20ef8b(++_0x2c82b4);}(_0x5409,0x156));var _0x9540=function(_0x3792f4,_0x139d6f){_0x3792f4=_0x3792f4-0x0;var _0x1f630b=_0x5409[_0x3792f4];return _0x1f630b;};'use strict';var _=require(_0x9540('0x0'));var util=require(_0x9540('0x1'));var moment=require(_0x9540('0x2'));var BPromise=require('bluebird');var rs=require(_0x9540('0x3'));var fs=require('fs');var Redis=require(_0x9540('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9540('0x5'));var client=jayson[_0x9540('0x6')][_0x9540('0x7')]({'port':0x232a});config[_0x9540('0x8')]=_[_0x9540('0x9')](config[_0x9540('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9540('0xa'))(new Redis(config[_0x9540('0x8')]));require('./userVoiceQueueRt.socket')[_0x9540('0xb')](socket);function respondWithRpcPromise(_0x393cfb,_0x49b1b9,_0x55c9d2){return new BPromise(function(_0x4810a5,_0xfdf903){return client['request'](_0x393cfb,_0x55c9d2)[_0x9540('0xc')](function(_0x1fef42){logger['info'](_0x9540('0xd'),_0x49b1b9,_0x9540('0xe'));logger[_0x9540('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x49b1b9,_0x9540('0xe'),JSON['stringify'](_0x1fef42));if(_0x1fef42[_0x9540('0x10')]){if(_0x1fef42[_0x9540('0x10')][_0x9540('0x11')]===0x1f4){logger[_0x9540('0x10')](_0x9540('0xd'),_0x49b1b9,_0x1fef42['error']['message']);return _0xfdf903(_0x1fef42['error'][_0x9540('0x12')]);}logger[_0x9540('0x10')](_0x9540('0xd'),_0x49b1b9,_0x1fef42['error'][_0x9540('0x12')]);return _0x4810a5(_0x1fef42[_0x9540('0x10')]['message']);}else{logger['info'](_0x9540('0xd'),_0x49b1b9,_0x9540('0xe'));_0x4810a5(_0x1fef42['result'][_0x9540('0x12')]);}})[_0x9540('0x13')](function(_0x95d633){logger[_0x9540('0x10')](_0x9540('0xd'),_0x49b1b9,_0x95d633);_0xfdf903(_0x95d633);});});}exports[_0x9540('0x14')]=function(_0x1f824f){var _0x2d6a6e=this;return new Promise(function(_0x1e9415,_0x495574){return db[_0x9540('0x15')]['findAll']({'raw':_0x1f824f[_0x9540('0x16')]?_0x1f824f['options'][_0x9540('0x17')]===undefined?!![]:![]:!![],'where':_0x1f824f[_0x9540('0x16')]?_0x1f824f[_0x9540('0x16')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x9540('0x18'),db[_0x9540('0x19')]['fn']('IF',db[_0x9540('0x19')][_0x9540('0x1a')]('`paused`\x20=\x201,\x201,\x20null'))),_0x9540('0x1b')]]})['then'](function(_0x3b5f5d){logger['info']('GetVoiceQueueRtPauses',_0x1f824f);logger[_0x9540('0xf')](_0x9540('0x14'),_0x1f824f,JSON[_0x9540('0x1c')](_0x3b5f5d));_0x1e9415(_0x3b5f5d);})[_0x9540('0x13')](function(_0x396d0e){logger['error'](_0x9540('0x14'),_0x396d0e['message'],_0x1f824f);_0x495574(_0x2d6a6e[_0x9540('0x10')](0x1f4,_0x396d0e[_0x9540('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 3e417bc..281b758 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 _0x99fb=['length','./userVoiceQueueRt.events','remove','update','register'];(function(_0x5dd0f3,_0x2292b5){var _0x54358a=function(_0x5be174){while(--_0x5be174){_0x5dd0f3['push'](_0x5dd0f3['shift']());}};_0x54358a(++_0x2292b5);}(_0x99fb,0x92));var _0xb99f=function(_0x44d64f,_0x13d152){_0x44d64f=_0x44d64f-0x0;var _0x7f7fd6=_0x99fb[_0x44d64f];return _0x7f7fd6;};'use strict';var UserVoiceQueueRtEvents=require(_0xb99f('0x0'));var events=['save',_0xb99f('0x1'),_0xb99f('0x2')];function createListener(_0x4345f0,_0x18e6ad){return function(_0x2899eb){_0x18e6ad['emit'](_0x4345f0,_0x2899eb);};}function removeListener(_0x23a1ef,_0x3e0d06){return function(){UserVoiceQueueRtEvents['removeListener'](_0x23a1ef,_0x3e0d06);};}exports[_0xb99f('0x3')]=function(_0x1f4c29){for(var _0xd9eac9=0x0,_0x5f264e=events[_0xb99f('0x4')];_0xd9eac9<_0x5f264e;_0xd9eac9++){var _0x479d65=events[_0xd9eac9];var _0xe317ff=createListener('userVoiceQueueRt:'+_0x479d65,_0x1f4c29);UserVoiceQueueRtEvents['on'](_0x479d65,_0xe317ff);}}; \ No newline at end of file +var _0x14f5=['update','emit','removeListener','register','length','userVoiceQueueRt:','save'];(function(_0x414bb3,_0x3eeca4){var _0x31b0cc=function(_0x286392){while(--_0x286392){_0x414bb3['push'](_0x414bb3['shift']());}};_0x31b0cc(++_0x3eeca4);}(_0x14f5,0xae));var _0x514f=function(_0x4fcfda,_0x45099a){_0x4fcfda=_0x4fcfda-0x0;var _0x12c8a5=_0x14f5[_0x4fcfda];return _0x12c8a5;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x514f('0x0'),'remove',_0x514f('0x1')];function createListener(_0x2e8eb2,_0x12d5e2){return function(_0x5281a3){_0x12d5e2[_0x514f('0x2')](_0x2e8eb2,_0x5281a3);};}function removeListener(_0x2443e8,_0x483c2a){return function(){UserVoiceQueueRtEvents[_0x514f('0x3')](_0x2443e8,_0x483c2a);};}exports[_0x514f('0x4')]=function(_0xc2ca56){for(var _0x434452=0x0,_0x463985=events[_0x514f('0x5')];_0x434452<_0x463985;_0x434452++){var _0xdb9614=events[_0x434452];var _0x4a5497=createListener(_0x514f('0x6')+_0xdb9614,_0xc2ca56);UserVoiceQueueRtEvents['on'](_0xdb9614,_0x4a5497);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index a691b6e..faac0d6 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x23d903,_0x140151){var _0x55ce97=function(_0x26a45b){while(--_0x26a45b){_0x23d903['push'](_0x23d903['shift']());}};_0x55ce97(++_0x140151);}(_0x70e0,0x17b));var _0x070e=function(_0x434390,_0x3e370b){_0x434390=_0x434390-0x0;var _0x53f373=_0x70e0[_0x434390];return _0x53f373;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 0b19a9f..3075827 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 _0x4ef8=['sequelize','INTEGER'];(function(_0x24d67c,_0x3cd775){var _0x20d4cc=function(_0x38fd5f){while(--_0x38fd5f){_0x24d67c['push'](_0x24d67c['shift']());}};_0x20d4cc(++_0x3cd775);}(_0x4ef8,0x148));var _0x84ef=function(_0x278d0c,_0x1daba4){_0x278d0c=_0x278d0c-0x0;var _0x6c0a27=_0x4ef8[_0x278d0c];return _0x6c0a27;};'use strict';var Sequelize=require(_0x84ef('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x84ef('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7bae=['INTEGER'];(function(_0x5707d2,_0x280c70){var _0x4e358d=function(_0x4a741e){while(--_0x4a741e){_0x5707d2['push'](_0x5707d2['shift']());}};_0x4e358d(++_0x280c70);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7bae[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xe7ba('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 528fe59..a46e33f 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 _0x54b8=['rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','path'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x54b8,0x13b));var _0x854b=function(_0x3685bc,_0x573e64){_0x3685bc=_0x3685bc-0x0;var _0x1b6cb2=_0x54b8[_0x3685bc];return _0x1b6cb2;};'use strict';var _=require(_0x854b('0x0'));var util=require(_0x854b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x854b('0x2'));var BPromise=require(_0x854b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x854b('0x4'));var rimraf=require(_0x854b('0x5'));var config=require(_0x854b('0x6'));var attributes=require(_0x854b('0x7'));module['exports']=function(_0x37c155,_0x49cf6e){return _0x37c155['define'](_0x854b('0x8'),attributes,{'tableName':_0x854b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4b1=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','util','../../config/logger','api','moment','bluebird'];(function(_0x3192c1,_0x2c82ad){var _0x5418c5=function(_0x289ea9){while(--_0x289ea9){_0x3192c1['push'](_0x3192c1['shift']());}};_0x5418c5(++_0x2c82ad);}(_0xf4b1,0x74));var _0x1f4b=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xf4b1[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x1f4b('0x0'));var logger=require(_0x1f4b('0x1'))(_0x1f4b('0x2'));var moment=require(_0x1f4b('0x3'));var BPromise=require(_0x1f4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1f4b('0x5'));var config=require(_0x1f4b('0x6'));var attributes=require(_0x1f4b('0x7'));module[_0x1f4b('0x8')]=function(_0x1678d1,_0xb3597b){return _0x1678d1[_0x1f4b('0x9')](_0x1f4b('0xa'),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 db86e3e..a3fbf1b 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 _0xfd7f=['http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0xfd7f,0x86));var _0xffd7=function(_0x1b3251,_0x58f958){_0x1b3251=_0x1b3251-0x0;var _0x370769=_0xfd7f[_0x1b3251];return _0x370769;};'use strict';var _=require(_0xffd7('0x0'));var util=require('util');var moment=require(_0xffd7('0x1'));var BPromise=require(_0xffd7('0x2'));var rs=require(_0xffd7('0x3'));var fs=require('fs');var Redis=require(_0xffd7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xffd7('0x5'))(_0xffd7('0x6'));var config=require(_0xffd7('0x7'));var jayson=require(_0xffd7('0x8'));var client=jayson[_0xffd7('0x9')][_0xffd7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17f3b9,_0x22edf2,_0x36adcf){return new BPromise(function(_0x31e7da,_0x1daa86){return client[_0xffd7('0xb')](_0x17f3b9,_0x36adcf)[_0xffd7('0xc')](function(_0x350625){logger[_0xffd7('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x22edf2,_0xffd7('0xe'));logger[_0xffd7('0xf')](_0xffd7('0x10'),_0x22edf2,'request\x20sent',JSON[_0xffd7('0x11')](_0x350625));if(_0x350625[_0xffd7('0x12')]){if(_0x350625[_0xffd7('0x12')][_0xffd7('0x13')]===0x1f4){logger[_0xffd7('0x12')](_0xffd7('0x14'),_0x22edf2,_0x350625[_0xffd7('0x12')][_0xffd7('0x15')]);return _0x1daa86(_0x350625[_0xffd7('0x12')][_0xffd7('0x15')]);}logger[_0xffd7('0x12')](_0xffd7('0x14'),_0x22edf2,_0x350625[_0xffd7('0x12')][_0xffd7('0x15')]);return _0x31e7da(_0x350625[_0xffd7('0x12')]['message']);}else{logger['info'](_0xffd7('0x14'),_0x22edf2,_0xffd7('0xe'));_0x31e7da(_0x350625[_0xffd7('0x16')][_0xffd7('0x15')]);}})[_0xffd7('0x17')](function(_0x22ec3b){logger[_0xffd7('0x12')](_0xffd7('0x14'),_0x22edf2,_0x22ec3b);_0x1daa86(_0x22ec3b);});});} \ No newline at end of file +var _0xfe37=['error','code','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xfe37,0xf4));var _0x7fe3=function(_0x2aad76,_0x52d456){_0x2aad76=_0x2aad76-0x0;var _0x465c40=_0xfe37[_0x2aad76];return _0x465c40;};'use strict';var _=require(_0x7fe3('0x0'));var util=require(_0x7fe3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fe3('0x2'));var db=require(_0x7fe3('0x3'))['db'];var utils=require(_0x7fe3('0x4'));var logger=require(_0x7fe3('0x5'))('rpc');var config=require(_0x7fe3('0x6'));var jayson=require(_0x7fe3('0x7'));var client=jayson[_0x7fe3('0x8')][_0x7fe3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x509c86,_0x15d088,_0x343978){return new BPromise(function(_0x828c89,_0x62774b){return client[_0x7fe3('0xa')](_0x509c86,_0x343978)['then'](function(_0x412335){logger[_0x7fe3('0xb')](_0x7fe3('0xc'),_0x15d088,_0x7fe3('0xd'));logger['debug'](_0x7fe3('0xe'),_0x15d088,'request\x20sent',JSON[_0x7fe3('0xf')](_0x412335));if(_0x412335[_0x7fe3('0x10')]){if(_0x412335['error'][_0x7fe3('0x11')]===0x1f4){logger[_0x7fe3('0x10')](_0x7fe3('0xc'),_0x15d088,_0x412335[_0x7fe3('0x10')][_0x7fe3('0x12')]);return _0x62774b(_0x412335[_0x7fe3('0x10')][_0x7fe3('0x12')]);}logger[_0x7fe3('0x10')](_0x7fe3('0xc'),_0x15d088,_0x412335[_0x7fe3('0x10')][_0x7fe3('0x12')]);return _0x828c89(_0x412335[_0x7fe3('0x10')]['message']);}else{logger[_0x7fe3('0xb')](_0x7fe3('0xc'),_0x15d088,_0x7fe3('0xd'));_0x828c89(_0x412335[_0x7fe3('0x13')][_0x7fe3('0x12')]);}})['catch'](function(_0xa05e0){logger[_0x7fe3('0x10')](_0x7fe3('0xc'),_0x15d088,_0xa05e0);_0x62774b(_0xa05e0);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 7a317a3..2fcac69 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 _0x7266=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x7266,0xec));var _0x6726=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7266[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var path=require(_0x6726('0x2'));var timeout=require(_0x6726('0x3'));var express=require(_0x6726('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6726('0x5'));var interaction=require(_0x6726('0x6'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x6726('0x7')]('/',auth[_0x6726('0x8')](),controller[_0x6726('0x9')]);router[_0x6726('0x7')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller[_0x6726('0xb')]);router[_0x6726('0xc')]('/',auth[_0x6726('0x8')](),controller[_0x6726('0xd')]);router[_0x6726('0xe')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller['update']);router[_0x6726('0xf')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller[_0x6726('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1c4d=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','/:id','show','create','update'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x3c8a35,_0x196fa5){_0x3c8a35=_0x3c8a35-0x0;var _0x1d4bbe=_0x1c4d[_0x3c8a35];return _0x1d4bbe;};'use strict';var multer=require('multer');var util=require(_0xd1c4('0x0'));var path=require(_0xd1c4('0x1'));var timeout=require(_0xd1c4('0x2'));var express=require('express');var router=express[_0xd1c4('0x3')]();var fs_extra=require(_0xd1c4('0x4'));var auth=require(_0xd1c4('0x5'));var interaction=require(_0xd1c4('0x6'));var config=require('../../config/environment');var controller=require(_0xd1c4('0x7'));router['get']('/',auth[_0xd1c4('0x8')](),controller[_0xd1c4('0x9')]);router[_0xd1c4('0xa')](_0xd1c4('0xb'),auth[_0xd1c4('0x8')](),controller[_0xd1c4('0xc')]);router['post']('/',auth[_0xd1c4('0x8')](),controller[_0xd1c4('0xd')]);router['put'](_0xd1c4('0xb'),auth['isAuthenticated'](),controller[_0xd1c4('0xe')]);router[_0xd1c4('0xf')](_0xd1c4('0xb'),auth[_0xd1c4('0x8')](),controller[_0xd1c4('0x10')]);module[_0xd1c4('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 5340702..910cb31 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 _0x56d8=['sequelize','name','STRING'];(function(_0x11af6c,_0xf0fc16){var _0x2b043f=function(_0x2e5e87){while(--_0x2e5e87){_0x11af6c['push'](_0x11af6c['shift']());}};_0x2b043f(++_0xf0fc16);}(_0x56d8,0x1a1));var _0x856d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x56d8[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x856d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x856d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x856d('0x2')]}}; \ No newline at end of file +var _0x2c54=['STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2c54,0x181));var _0x42c5=function(_0x370449,_0x5dbfc3){_0x370449=_0x370449-0x0;var _0x340356=_0x2c54[_0x370449];return _0x340356;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x42c5('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x42c5('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c27d0bf..0b9d82e 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 _0xe80c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','get','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','role','user','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xe80c,0x98));var _0xce80=function(_0x32e024,_0x53a11a){_0x32e024=_0x32e024-0x0;var _0x1d8063=_0xe80c[_0x32e024];return _0x1d8063;};'use strict';var emlformat=require(_0xce80('0x0'));var rimraf=require(_0xce80('0x1'));var zipdir=require(_0xce80('0x2'));var jsonpatch=require(_0xce80('0x3'));var rp=require('request-promise');var moment=require(_0xce80('0x4'));var BPromise=require(_0xce80('0x5'));var Mustache=require('mustache');var util=require(_0xce80('0x6'));var path=require(_0xce80('0x7'));var sox=require(_0xce80('0x8'));var csv=require(_0xce80('0x9'));var ejs=require(_0xce80('0xa'));var fs=require('fs');var fs_extra=require(_0xce80('0xb'));var _=require(_0xce80('0xc'));var squel=require('squel');var crypto=require(_0xce80('0xd'));var jsforce=require(_0xce80('0xe'));var deskjs=require(_0xce80('0xf'));var toCsv=require(_0xce80('0x9'));var querystring=require(_0xce80('0x10'));var Papa=require(_0xce80('0x11'));var Redis=require(_0xce80('0x12'));var authService=require(_0xce80('0x13'));var qs=require(_0xce80('0x14'));var as=require(_0xce80('0x15'));var hardwareService=require(_0xce80('0x16'));var logger=require(_0xce80('0x17'))(_0xce80('0x18'));var utils=require('../../config/utils');var config=require(_0xce80('0x19'));var licenseUtil=require(_0xce80('0x1a'));var db=require(_0xce80('0x1b'))['db'];function respondWithStatusCode(_0x3e9bbb,_0x3d0469){_0x3d0469=_0x3d0469||0xcc;return function(_0xfc5c05){if(_0xfc5c05){return _0x3e9bbb[_0xce80('0x1c')](_0x3d0469);}return _0x3e9bbb[_0xce80('0x1d')](_0x3d0469)[_0xce80('0x1e')]();};}function respondWithResult(_0x1a514c,_0x245521){_0x245521=_0x245521||0xc8;return function(_0x7c6bf8){if(_0x7c6bf8){return _0x1a514c[_0xce80('0x1d')](_0x245521)[_0xce80('0x1f')](_0x7c6bf8);}};}function respondWithFilteredResult(_0x4c887e,_0x5498ac){return function(_0x46a5de){if(_0x46a5de){var _0x4a0fc5=typeof _0x5498ac[_0xce80('0x20')]==='undefined'&&typeof _0x5498ac[_0xce80('0x21')]===_0xce80('0x22');var _0x50d6e6=_0x46a5de['count'];var _0x23e031=_0x4a0fc5?0x0:_0x5498ac[_0xce80('0x20')];var _0x5e686f=_0x4a0fc5?_0x46a5de[_0xce80('0x23')]:_0x5498ac[_0xce80('0x20')]+_0x5498ac[_0xce80('0x21')];var _0x213dd4;if(_0x5e686f>=_0x50d6e6){_0x5e686f=_0x50d6e6;_0x213dd4=0xc8;}else{_0x213dd4=0xce;}_0x4c887e[_0xce80('0x1d')](_0x213dd4);return _0x4c887e['set'](_0xce80('0x24'),_0x23e031+'-'+_0x5e686f+'/'+_0x50d6e6)[_0xce80('0x1f')](_0x46a5de);}return null;};}function patchUpdates(_0x4637da){return function(_0xbc60d2){try{jsonpatch['apply'](_0xbc60d2,_0x4637da,!![]);}catch(_0x4b68b4){return BPromise['reject'](_0x4b68b4);}return _0xbc60d2[_0xce80('0x25')]();};}function saveUpdates(_0x116ced,_0x3e0ad1){return function(_0x3d11fd){if(_0x3d11fd){return _0x3d11fd[_0xce80('0x26')](_0x116ced)[_0xce80('0x27')](function(_0x35e1f6){return _0x35e1f6;});}return null;};}function removeEntity(_0x500da3,_0x5aee19){return function(_0x590fc9){if(_0x590fc9){return _0x590fc9[_0xce80('0x28')]()[_0xce80('0x27')](function(){var _0x34b824=_0x590fc9[_0xce80('0x29')]({'plain':!![]});var _0x48fd91='Variables';return db['UserProfileResource'][_0xce80('0x28')]({'where':{'type':_0x48fd91,'resourceId':_0x34b824['id']}})[_0xce80('0x27')](function(){return _0x590fc9;});})[_0xce80('0x27')](function(){_0x500da3[_0xce80('0x1d')](0xcc)[_0xce80('0x1e')]();});}};}function handleEntityNotFound(_0x32a7c2,_0x45d958){return function(_0x3700dd){if(!_0x3700dd){_0x32a7c2[_0xce80('0x1c')](0x194);}return _0x3700dd;};}function handleError(_0x424650,_0x2c8970){_0x2c8970=_0x2c8970||0x1f4;return function(_0x544ff6){logger[_0xce80('0x2a')](_0x544ff6[_0xce80('0x2b')]);if(_0x544ff6[_0xce80('0x2c')]){delete _0x544ff6['name'];}_0x424650[_0xce80('0x1d')](_0x2c8970)[_0xce80('0x2d')](_0x544ff6);};}exports[_0xce80('0x2e')]=function(_0x1f3aed,_0x39e3a2){var _0x4e3fa8={},_0x35ffe9={},_0x4d2fe4={'count':0x0,'rows':[]};var _0x5bba7b=_[_0xce80('0x2f')](db[_0xce80('0x30')][_0xce80('0x31')],function(_0x20ba9a){return{'name':_0x20ba9a[_0xce80('0x32')],'type':_0x20ba9a[_0xce80('0x33')][_0xce80('0x34')]};});_0x35ffe9[_0xce80('0x35')]=_[_0xce80('0x2f')](_0x5bba7b,_0xce80('0x2c'));_0x35ffe9['query']=_[_0xce80('0x36')](_0x1f3aed[_0xce80('0x37')]);_0x35ffe9['filters']=_['intersection'](_0x35ffe9[_0xce80('0x35')],_0x35ffe9[_0xce80('0x37')]);_0x4e3fa8[_0xce80('0x38')]=_[_0xce80('0x39')](_0x35ffe9[_0xce80('0x35')],qs['fields'](_0x1f3aed[_0xce80('0x37')]['fields']));_0x4e3fa8[_0xce80('0x38')]=_0x4e3fa8[_0xce80('0x38')][_0xce80('0x3a')]?_0x4e3fa8[_0xce80('0x38')]:_0x35ffe9[_0xce80('0x35')];if(!_0x1f3aed[_0xce80('0x37')][_0xce80('0x3b')](_0xce80('0x3c'))){_0x4e3fa8['limit']=qs[_0xce80('0x21')](_0x1f3aed[_0xce80('0x37')][_0xce80('0x21')]);_0x4e3fa8[_0xce80('0x20')]=qs['offset'](_0x1f3aed[_0xce80('0x37')][_0xce80('0x20')]);}_0x4e3fa8[_0xce80('0x3d')]=qs['sort'](_0x1f3aed['query'][_0xce80('0x3e')]);_0x4e3fa8[_0xce80('0x3f')]=qs[_0xce80('0x40')](_[_0xce80('0x41')](_0x1f3aed[_0xce80('0x37')],_0x35ffe9[_0xce80('0x40')]),_0x5bba7b);if(_0x1f3aed[_0xce80('0x37')]['filter']){_0x4e3fa8[_0xce80('0x3f')]=_[_0xce80('0x42')](_0x4e3fa8[_0xce80('0x3f')],{'$or':_[_0xce80('0x2f')](_0x5bba7b,function(_0xbff5ad){if(_0xbff5ad[_0xce80('0x33')]!==_0xce80('0x43')){var _0x25fb9a={};_0x25fb9a[_0xbff5ad[_0xce80('0x2c')]]={'$like':'%'+_0x1f3aed['query'][_0xce80('0x44')]+'%'};return _0x25fb9a;}})});}_0x4e3fa8=_[_0xce80('0x42')]({},_0x4e3fa8,_0x1f3aed[_0xce80('0x45')]);var _0x4f53ab={'where':_0x4e3fa8[_0xce80('0x3f')]};return db[_0xce80('0x30')][_0xce80('0x23')](_0x4f53ab)['then'](function(_0x43fe66){_0x4d2fe4[_0xce80('0x23')]=_0x43fe66;if(_0x1f3aed[_0xce80('0x37')]['includeAll']){_0x4e3fa8['include']=[{'all':!![]}];}return db[_0xce80('0x30')][_0xce80('0x46')](_0x4e3fa8);})[_0xce80('0x27')](function(_0x5d85b1){_0x4d2fe4[_0xce80('0x47')]=_0x5d85b1;return _0x4d2fe4;})[_0xce80('0x27')](respondWithFilteredResult(_0x39e3a2,_0x4e3fa8))[_0xce80('0x48')](handleError(_0x39e3a2,null));};exports[_0xce80('0x49')]=function(_0x2aaa46,_0x29cc97){var _0x20ddeb={'raw':!![],'where':{'id':_0x2aaa46[_0xce80('0x4a')]['id']}},_0x449d84={};_0x449d84['model']=_['keys'](db['Variable'][_0xce80('0x31')]);_0x449d84[_0xce80('0x37')]=_[_0xce80('0x36')](_0x2aaa46['query']);_0x449d84['filters']=_[_0xce80('0x39')](_0x449d84[_0xce80('0x35')],_0x449d84[_0xce80('0x37')]);_0x20ddeb[_0xce80('0x38')]=_[_0xce80('0x39')](_0x449d84[_0xce80('0x35')],qs['fields'](_0x2aaa46['query'][_0xce80('0x4b')]));_0x20ddeb['attributes']=_0x20ddeb['attributes'][_0xce80('0x3a')]?_0x20ddeb[_0xce80('0x38')]:_0x449d84[_0xce80('0x35')];if(_0x2aaa46[_0xce80('0x37')][_0xce80('0x4c')]){_0x20ddeb[_0xce80('0x4d')]=[{'all':!![]}];}_0x20ddeb=_[_0xce80('0x42')]({},_0x20ddeb,_0x2aaa46['options']);return db['Variable'][_0xce80('0x4e')](_0x20ddeb)[_0xce80('0x27')](handleEntityNotFound(_0x29cc97,null))['then'](respondWithResult(_0x29cc97,null))['catch'](handleError(_0x29cc97,null));};exports[_0xce80('0x4f')]=function(_0x232dc6,_0x408bd6){return db[_0xce80('0x30')][_0xce80('0x4f')](_0x232dc6['body'],{})[_0xce80('0x27')](function(_0x270cc6){var _0x33aebc=_0x232dc6['user'][_0xce80('0x29')]({'plain':!![]});if(!_0x33aebc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33aebc[_0xce80('0x50')]===_0xce80('0x51')){var _0x20f10f=_0x270cc6['get']({'plain':!![]});var _0x145c05=_0xce80('0x52');return db[_0xce80('0x53')]['find']({'where':{'name':_0x145c05,'userProfileId':_0x33aebc[_0xce80('0x54')]},'raw':!![]})[_0xce80('0x27')](function(_0x364db4){if(_0x364db4&&_0x364db4[_0xce80('0x55')]===0x0){return db[_0xce80('0x56')][_0xce80('0x4f')]({'name':_0x20f10f[_0xce80('0x2c')],'resourceId':_0x20f10f['id'],'type':_0x364db4[_0xce80('0x2c')],'sectionId':_0x364db4['id']},{})['then'](function(){return _0x270cc6;});}else{return _0x270cc6;}})['catch'](function(_0x4670df){logger[_0xce80('0x2a')](_0xce80('0x57'),_0x4670df);throw _0x4670df;});}return _0x270cc6;})[_0xce80('0x27')](respondWithResult(_0x408bd6,0xc9))[_0xce80('0x48')](handleError(_0x408bd6,null));};exports[_0xce80('0x26')]=function(_0x40170f,_0x35837a){if(_0x40170f[_0xce80('0x58')]['id']){delete _0x40170f['body']['id'];}return db[_0xce80('0x30')][_0xce80('0x4e')]({'where':{'id':_0x40170f[_0xce80('0x4a')]['id']}})[_0xce80('0x27')](handleEntityNotFound(_0x35837a,null))[_0xce80('0x27')](saveUpdates(_0x40170f['body'],null))['then'](respondWithResult(_0x35837a,null))[_0xce80('0x48')](handleError(_0x35837a,null));};exports[_0xce80('0x28')]=function(_0x428f1d,_0x542c12){return db['Variable'][_0xce80('0x4e')]({'where':{'id':_0x428f1d[_0xce80('0x4a')]['id']}})['then'](handleEntityNotFound(_0x542c12,null))[_0xce80('0x27')](removeEntity(_0x542c12,null))['catch'](handleError(_0x542c12,null));}; \ No newline at end of file +var _0xf1f5=['catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','map','Variable','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x11518f,_0x367253){var _0x34153f=function(_0x458e6c){while(--_0x458e6c){_0x11518f['push'](_0x11518f['shift']());}};_0x34153f(++_0x367253);}(_0xf1f5,0xb4));var _0x5f1f=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xf1f5[_0x251d9c];return _0x16ae64;};'use strict';var emlformat=require(_0x5f1f('0x0'));var rimraf=require(_0x5f1f('0x1'));var zipdir=require(_0x5f1f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f1f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f1f('0x4'));var util=require(_0x5f1f('0x5'));var path=require('path');var sox=require(_0x5f1f('0x6'));var csv=require(_0x5f1f('0x7'));var ejs=require(_0x5f1f('0x8'));var fs=require('fs');var fs_extra=require(_0x5f1f('0x9'));var _=require(_0x5f1f('0xa'));var squel=require(_0x5f1f('0xb'));var crypto=require(_0x5f1f('0xc'));var jsforce=require(_0x5f1f('0xd'));var deskjs=require(_0x5f1f('0xe'));var toCsv=require(_0x5f1f('0x7'));var querystring=require(_0x5f1f('0xf'));var Papa=require(_0x5f1f('0x10'));var Redis=require(_0x5f1f('0x11'));var authService=require(_0x5f1f('0x12'));var qs=require(_0x5f1f('0x13'));var as=require(_0x5f1f('0x14'));var hardwareService=require(_0x5f1f('0x15'));var logger=require(_0x5f1f('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5f1f('0x17'));var licenseUtil=require(_0x5f1f('0x18'));var db=require(_0x5f1f('0x19'))['db'];function respondWithStatusCode(_0x41fbe2,_0xf6eede){_0xf6eede=_0xf6eede||0xcc;return function(_0x2df8e9){if(_0x2df8e9){return _0x41fbe2[_0x5f1f('0x1a')](_0xf6eede);}return _0x41fbe2[_0x5f1f('0x1b')](_0xf6eede)[_0x5f1f('0x1c')]();};}function respondWithResult(_0x392886,_0x110b02){_0x110b02=_0x110b02||0xc8;return function(_0x385632){if(_0x385632){return _0x392886[_0x5f1f('0x1b')](_0x110b02)[_0x5f1f('0x1d')](_0x385632);}};}function respondWithFilteredResult(_0x3c0edb,_0x580118){return function(_0x51cf2f){if(_0x51cf2f){var _0x4b2aeb=typeof _0x580118[_0x5f1f('0x1e')]===_0x5f1f('0x1f')&&typeof _0x580118['limit']===_0x5f1f('0x1f');var _0x2809c4=_0x51cf2f['count'];var _0x24b22e=_0x4b2aeb?0x0:_0x580118[_0x5f1f('0x1e')];var _0x3129fc=_0x4b2aeb?_0x51cf2f[_0x5f1f('0x20')]:_0x580118[_0x5f1f('0x1e')]+_0x580118['limit'];var _0x2e64a6;if(_0x3129fc>=_0x2809c4){_0x3129fc=_0x2809c4;_0x2e64a6=0xc8;}else{_0x2e64a6=0xce;}_0x3c0edb['status'](_0x2e64a6);return _0x3c0edb['set'](_0x5f1f('0x21'),_0x24b22e+'-'+_0x3129fc+'/'+_0x2809c4)[_0x5f1f('0x1d')](_0x51cf2f);}return null;};}function patchUpdates(_0x4fd27b){return function(_0x215a7a){try{jsonpatch['apply'](_0x215a7a,_0x4fd27b,!![]);}catch(_0xa814cb){return BPromise['reject'](_0xa814cb);}return _0x215a7a[_0x5f1f('0x22')]();};}function saveUpdates(_0x1b91d1,_0x1d4b45){return function(_0x5681c1){if(_0x5681c1){return _0x5681c1[_0x5f1f('0x23')](_0x1b91d1)[_0x5f1f('0x24')](function(_0x378313){return _0x378313;});}return null;};}function removeEntity(_0x4bba14,_0x470661){return function(_0x348ac6){if(_0x348ac6){return _0x348ac6[_0x5f1f('0x25')]()[_0x5f1f('0x24')](function(){var _0x56a6fc=_0x348ac6['get']({'plain':!![]});var _0x89eb72=_0x5f1f('0x26');return db[_0x5f1f('0x27')][_0x5f1f('0x25')]({'where':{'type':_0x89eb72,'resourceId':_0x56a6fc['id']}})[_0x5f1f('0x24')](function(){return _0x348ac6;});})['then'](function(){_0x4bba14['status'](0xcc)[_0x5f1f('0x1c')]();});}};}function handleEntityNotFound(_0x29c040,_0x91822b){return function(_0xfa6886){if(!_0xfa6886){_0x29c040[_0x5f1f('0x1a')](0x194);}return _0xfa6886;};}function handleError(_0x2c3bf6,_0x1a0a1e){_0x1a0a1e=_0x1a0a1e||0x1f4;return function(_0x3985b8){logger[_0x5f1f('0x28')](_0x3985b8[_0x5f1f('0x29')]);if(_0x3985b8[_0x5f1f('0x2a')]){delete _0x3985b8[_0x5f1f('0x2a')];}_0x2c3bf6[_0x5f1f('0x1b')](_0x1a0a1e)[_0x5f1f('0x2b')](_0x3985b8);};}exports['index']=function(_0x2a5e34,_0x4748f2){var _0x5a0a35={},_0x171613={},_0x2060f9={'count':0x0,'rows':[]};var _0x5380a5=_[_0x5f1f('0x2c')](db[_0x5f1f('0x2d')][_0x5f1f('0x2e')],function(_0x437a3d){return{'name':_0x437a3d['fieldName'],'type':_0x437a3d[_0x5f1f('0x2f')]['key']};});_0x171613['model']=_[_0x5f1f('0x2c')](_0x5380a5,_0x5f1f('0x2a'));_0x171613[_0x5f1f('0x30')]=_[_0x5f1f('0x31')](_0x2a5e34[_0x5f1f('0x30')]);_0x171613[_0x5f1f('0x32')]=_[_0x5f1f('0x33')](_0x171613[_0x5f1f('0x34')],_0x171613[_0x5f1f('0x30')]);_0x5a0a35['attributes']=_[_0x5f1f('0x33')](_0x171613[_0x5f1f('0x34')],qs[_0x5f1f('0x35')](_0x2a5e34[_0x5f1f('0x30')][_0x5f1f('0x35')]));_0x5a0a35[_0x5f1f('0x36')]=_0x5a0a35[_0x5f1f('0x36')][_0x5f1f('0x37')]?_0x5a0a35[_0x5f1f('0x36')]:_0x171613[_0x5f1f('0x34')];if(!_0x2a5e34[_0x5f1f('0x30')][_0x5f1f('0x38')]('nolimit')){_0x5a0a35[_0x5f1f('0x39')]=qs[_0x5f1f('0x39')](_0x2a5e34['query'][_0x5f1f('0x39')]);_0x5a0a35[_0x5f1f('0x1e')]=qs[_0x5f1f('0x1e')](_0x2a5e34[_0x5f1f('0x30')]['offset']);}_0x5a0a35['order']=qs[_0x5f1f('0x3a')](_0x2a5e34[_0x5f1f('0x30')][_0x5f1f('0x3a')]);_0x5a0a35['where']=qs[_0x5f1f('0x32')](_[_0x5f1f('0x3b')](_0x2a5e34['query'],_0x171613['filters']),_0x5380a5);if(_0x2a5e34[_0x5f1f('0x30')][_0x5f1f('0x3c')]){_0x5a0a35[_0x5f1f('0x3d')]=_[_0x5f1f('0x3e')](_0x5a0a35[_0x5f1f('0x3d')],{'$or':_['map'](_0x5380a5,function(_0x44f004){if(_0x44f004[_0x5f1f('0x2f')]!==_0x5f1f('0x3f')){var _0x3753ec={};_0x3753ec[_0x44f004['name']]={'$like':'%'+_0x2a5e34[_0x5f1f('0x30')]['filter']+'%'};return _0x3753ec;}})});}_0x5a0a35=_['merge']({},_0x5a0a35,_0x2a5e34[_0x5f1f('0x40')]);var _0x2275b1={'where':_0x5a0a35[_0x5f1f('0x3d')]};return db[_0x5f1f('0x2d')]['count'](_0x2275b1)[_0x5f1f('0x24')](function(_0x56cc3b){_0x2060f9['count']=_0x56cc3b;if(_0x2a5e34[_0x5f1f('0x30')][_0x5f1f('0x41')]){_0x5a0a35[_0x5f1f('0x42')]=[{'all':!![]}];}return db['Variable'][_0x5f1f('0x43')](_0x5a0a35);})['then'](function(_0x1ce259){_0x2060f9[_0x5f1f('0x44')]=_0x1ce259;return _0x2060f9;})[_0x5f1f('0x24')](respondWithFilteredResult(_0x4748f2,_0x5a0a35))[_0x5f1f('0x45')](handleError(_0x4748f2,null));};exports[_0x5f1f('0x46')]=function(_0x2296f8,_0x1c6c32){var _0x4bdc40={'raw':!![],'where':{'id':_0x2296f8[_0x5f1f('0x47')]['id']}},_0x3483e2={};_0x3483e2[_0x5f1f('0x34')]=_[_0x5f1f('0x31')](db[_0x5f1f('0x2d')][_0x5f1f('0x2e')]);_0x3483e2[_0x5f1f('0x30')]=_[_0x5f1f('0x31')](_0x2296f8[_0x5f1f('0x30')]);_0x3483e2['filters']=_[_0x5f1f('0x33')](_0x3483e2[_0x5f1f('0x34')],_0x3483e2[_0x5f1f('0x30')]);_0x4bdc40[_0x5f1f('0x36')]=_['intersection'](_0x3483e2['model'],qs[_0x5f1f('0x35')](_0x2296f8['query'][_0x5f1f('0x35')]));_0x4bdc40['attributes']=_0x4bdc40[_0x5f1f('0x36')][_0x5f1f('0x37')]?_0x4bdc40[_0x5f1f('0x36')]:_0x3483e2[_0x5f1f('0x34')];if(_0x2296f8['query'][_0x5f1f('0x41')]){_0x4bdc40[_0x5f1f('0x42')]=[{'all':!![]}];}_0x4bdc40=_[_0x5f1f('0x3e')]({},_0x4bdc40,_0x2296f8['options']);return db[_0x5f1f('0x2d')]['find'](_0x4bdc40)[_0x5f1f('0x24')](handleEntityNotFound(_0x1c6c32,null))[_0x5f1f('0x24')](respondWithResult(_0x1c6c32,null))[_0x5f1f('0x45')](handleError(_0x1c6c32,null));};exports[_0x5f1f('0x48')]=function(_0x57a40e,_0x23c46e){return db['Variable'][_0x5f1f('0x48')](_0x57a40e[_0x5f1f('0x49')],{})[_0x5f1f('0x24')](function(_0x25eef9){var _0xb08089=_0x57a40e[_0x5f1f('0x4a')]['get']({'plain':!![]});if(!_0xb08089)throw new Error(_0x5f1f('0x4b'));if(_0xb08089[_0x5f1f('0x4c')]===_0x5f1f('0x4a')){var _0x477110=_0x25eef9[_0x5f1f('0x4d')]({'plain':!![]});var _0x353fdf=_0x5f1f('0x26');return db[_0x5f1f('0x4e')][_0x5f1f('0x4f')]({'where':{'name':_0x353fdf,'userProfileId':_0xb08089[_0x5f1f('0x50')]},'raw':!![]})[_0x5f1f('0x24')](function(_0x4d90e6){if(_0x4d90e6&&_0x4d90e6[_0x5f1f('0x51')]===0x0){return db[_0x5f1f('0x27')][_0x5f1f('0x48')]({'name':_0x477110[_0x5f1f('0x2a')],'resourceId':_0x477110['id'],'type':_0x4d90e6[_0x5f1f('0x2a')],'sectionId':_0x4d90e6['id']},{})[_0x5f1f('0x24')](function(){return _0x25eef9;});}else{return _0x25eef9;}})[_0x5f1f('0x45')](function(_0x598439){logger[_0x5f1f('0x28')](_0x5f1f('0x52'),_0x598439);throw _0x598439;});}return _0x25eef9;})[_0x5f1f('0x24')](respondWithResult(_0x23c46e,0xc9))['catch'](handleError(_0x23c46e,null));};exports[_0x5f1f('0x23')]=function(_0x591707,_0x9f60b6){if(_0x591707[_0x5f1f('0x49')]['id']){delete _0x591707['body']['id'];}return db[_0x5f1f('0x2d')]['find']({'where':{'id':_0x591707[_0x5f1f('0x47')]['id']}})[_0x5f1f('0x24')](handleEntityNotFound(_0x9f60b6,null))[_0x5f1f('0x24')](saveUpdates(_0x591707[_0x5f1f('0x49')],null))[_0x5f1f('0x24')](respondWithResult(_0x9f60b6,null))[_0x5f1f('0x45')](handleError(_0x9f60b6,null));};exports['destroy']=function(_0x1f4b56,_0x580ab2){return db[_0x5f1f('0x2d')][_0x5f1f('0x4f')]({'where':{'id':_0x1f4b56[_0x5f1f('0x47')]['id']}})[_0x5f1f('0x24')](handleEntityNotFound(_0x580ab2,null))[_0x5f1f('0x24')](removeEntity(_0x580ab2,null))['catch'](handleError(_0x580ab2,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 09f31b0..42131e7 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 _0x4371=['lodash','util','api','request-promise','path','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x265623,_0x540038){var _0xb75c77=function(_0x107ea4){while(--_0x107ea4){_0x265623['push'](_0x265623['shift']());}};_0xb75c77(++_0x540038);}(_0x4371,0x154));var _0x1437=function(_0x1b25d4,_0x2e9817){_0x1b25d4=_0x1b25d4-0x0;var _0x1e8324=_0x4371[_0x1b25d4];return _0x1e8324;};'use strict';var _=require(_0x1437('0x0'));var util=require(_0x1437('0x1'));var logger=require('../../config/logger')(_0x1437('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1437('0x3'));var fs=require('fs');var path=require(_0x1437('0x4'));var rimraf=require('rimraf');var config=require(_0x1437('0x5'));var attributes=require(_0x1437('0x6'));module[_0x1437('0x7')]=function(_0x371b5e,_0x47f729){return _0x371b5e[_0x1437('0x8')](_0x1437('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0497=['../../config/logger','api','bluebird','request-promise','path','rimraf','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x53bedc,_0x553614){var _0x5a12e6=function(_0x3ce490){while(--_0x3ce490){_0x53bedc['push'](_0x53bedc['shift']());}};_0x5a12e6(++_0x553614);}(_0x0497,0x1e4));var _0x7049=function(_0x1458e2,_0x1b45c2){_0x1458e2=_0x1458e2-0x0;var _0x4d191c=_0x0497[_0x1458e2];return _0x4d191c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7049('0x0'))(_0x7049('0x1'));var moment=require('moment');var BPromise=require(_0x7049('0x2'));var rp=require(_0x7049('0x3'));var fs=require('fs');var path=require(_0x7049('0x4'));var rimraf=require(_0x7049('0x5'));var config=require('../../config/environment');var attributes=require(_0x7049('0x6'));module[_0x7049('0x7')]=function(_0x47ad90,_0x9476bd){return _0x47ad90[_0x7049('0x8')](_0x7049('0x9'),attributes,{'tableName':_0x7049('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index f4f7f46..4478919 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0xa8a57e,_0x27295c){var _0x53244c=function(_0x1b333d){while(--_0x1b333d){_0xa8a57e['push'](_0xa8a57e['shift']());}};_0x53244c(++_0x27295c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x822e01,_0x2b2281){_0x822e01=_0x822e01-0x0;var _0x18d95b=_0x1cb9[_0x822e01];return _0x18d95b;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0x5fc3,0xa8));var _0x35fc=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x5fc3[_0x8ae98b];return _0xc30bd4;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 9bde408..d686b51 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 _0x471b=['exports','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','restart','/migrations'];(function(_0x531331,_0x355057){var _0x80237=function(_0x5539dd){while(--_0x5539dd){_0x531331['push'](_0x531331['shift']());}};_0x80237(++_0x355057);}(_0x471b,0x79));var _0xb471=function(_0x6bc873,_0x191eac){_0x6bc873=_0x6bc873-0x0;var _0x123bd1=_0x471b[_0x6bc873];return _0x123bd1;};'use strict';var express=require('express');var router=express[_0xb471('0x0')]();var auth=require(_0xb471('0x1'));var controller=require(_0xb471('0x2'));router['get']('/',controller[_0xb471('0x3')]);router[_0xb471('0x4')](_0xb471('0x5'),auth[_0xb471('0x6')](),auth[_0xb471('0x7')](),controller[_0xb471('0x8')]);router[_0xb471('0x4')]('/reset',auth[_0xb471('0x6')](),auth[_0xb471('0x7')](),controller[_0xb471('0x9')]);router[_0xb471('0x4')](_0xb471('0xa'),auth[_0xb471('0x6')](),auth[_0xb471('0x7')](),controller[_0xb471('0xb')]);router[_0xb471('0x4')]('/restart',auth['isAuthenticated'](),controller[_0xb471('0xc')]);router[_0xb471('0x4')](_0xb471('0xd'),controller['migrations']);module[_0xb471('0xe')]=router; \ No newline at end of file +var _0x998b=['exports','Router','./version.controller','get','/fetch','isAuthenticated','canUpdate','/pull','/restart','restart','/migrations','migrations'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x998b,0x12d));var _0xb998=function(_0x4a9818,_0x4e60d6){_0x4a9818=_0x4a9818-0x0;var _0xccc713=_0x998b[_0x4a9818];return _0xccc713;};'use strict';var express=require('express');var router=express[_0xb998('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xb998('0x1'));router[_0xb998('0x2')]('/',controller['index']);router[_0xb998('0x2')](_0xb998('0x3'),auth[_0xb998('0x4')](),auth[_0xb998('0x5')](),controller['fetch']);router[_0xb998('0x2')]('/reset',auth[_0xb998('0x4')](),auth[_0xb998('0x5')](),controller['reset']);router[_0xb998('0x2')](_0xb998('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router['get'](_0xb998('0x7'),auth[_0xb998('0x4')](),controller[_0xb998('0x8')]);router[_0xb998('0x2')](_0xb998('0x9'),controller[_0xb998('0xa')]);module[_0xb998('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a69352f..292f1ad 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 _0xe94f=['exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','child_process'];(function(_0x4012d2,_0x50355c){var _0x8ac729=function(_0x30ee61){while(--_0x30ee61){_0x4012d2['push'](_0x4012d2['shift']());}};_0x8ac729(++_0x50355c);}(_0xe94f,0x104));var _0xfe94=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0xe94f[_0x83af7f];return _0x32d85c;};'use strict';var Umzug=require(_0xfe94('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xfe94('0x1'))(module,_0xfe94('0x2'));var compareVersions=require(_0xfe94('0x3'));var exec=require(_0xfe94('0x4'))[_0xfe94('0x5')];var db=require(_0xfe94('0x6'))['db'];var config=require(_0xfe94('0x7'));var pm2=require(_0xfe94('0x8'));var logger=require('../../config/logger')('update');var git=require(_0xfe94('0x9'))(config[_0xfe94('0xa')]);exports[_0xfe94('0xb')]=function(_0x162ac9,_0x50d97e){var _0x352285={'current':module[_0xfe94('0xc')]['version'],'phonebar':0x2};if(_0x162ac9[_0xfe94('0xd')]&&_0x162ac9[_0xfe94('0xd')][_0xfe94('0xe')]){return git[_0xfe94('0xf')]()[_0xfe94('0x10')](function(_0x392e42,_0x50c21c){_0x352285[_0xfe94('0xe')]=(_0x392e42?module[_0xfe94('0xc')]['version']:_0x50c21c[_0xfe94('0xe')])||_0xfe94('0x11');return _0x50d97e[_0xfe94('0x12')](0xc8)['json'](_0x352285);});}else{return _0x50d97e[_0xfe94('0x12')](0xc8)[_0xfe94('0x13')](_0x352285);}};exports[_0xfe94('0xf')]=function(_0x50d0ba,_0x225779){return git[_0xfe94('0xf')]([_0xfe94('0x14'),_0xfe94('0x15')],function(_0x14718e){if(_0x14718e){logger[_0xfe94('0x16')](_0x14718e);return _0x225779[_0xfe94('0x12')](0x1f4)['json'](_0x14718e);}logger[_0xfe94('0x17')](_0xfe94('0x18'));return _0x225779[_0xfe94('0x12')](0xc8)[_0xfe94('0x13')]({'output':_0xfe94('0x19')});});};exports[_0xfe94('0x1a')]=function(_0x54bc2a,_0x2e122a){return git[_0xfe94('0x1a')]([_0xfe94('0x1b'),_0xfe94('0x1c')],function(_0x3835c8){if(_0x3835c8){logger[_0xfe94('0x16')](_0x3835c8);return _0x2e122a[_0xfe94('0x12')](0x1f4)[_0xfe94('0x13')](_0x3835c8);}logger[_0xfe94('0x17')](_0xfe94('0x1d'));return _0x2e122a[_0xfe94('0x12')](0xc8)['json']({'output':_0xfe94('0x1e')});});};exports[_0xfe94('0x1f')]=function(_0x2ee9de,_0x1d6c5c){exec(_0xfe94('0x20'),function(_0x1a78f6,_0x358345,_0x1cf5b5){logger['info'](_0x358345);logger[_0xfe94('0x17')](_0x1cf5b5);if(_0x1a78f6){logger[_0xfe94('0x16')](_0x1a78f6);return _0x1d6c5c[_0xfe94('0x12')](0x1f4)[_0xfe94('0x13')](_0x1a78f6);}return _0x1d6c5c['status'](0xc8)[_0xfe94('0x13')]({'output':_0x358345});});};exports[_0xfe94('0x21')]=function(_0x555307,_0x1217fa){return pm2[_0xfe94('0x21')](_0xfe94('0x22'))[_0xfe94('0x23')](function(_0x2ae68f){logger[_0xfe94('0x17')]('pm2\x20restart\x20motion\x20%s',_0x2ae68f);return _0x1217fa['status'](0xc8)[_0xfe94('0x13')]({'output':_0xfe94('0x24')});})[_0xfe94('0x25')](function(_0x5a25ce){logger['error'](_0x5a25ce);return _0x1217fa['status'](0x1f4)[_0xfe94('0x13')](_0x5a25ce);});};exports[_0xfe94('0x26')]=function(_0x3bc368,_0xb9d2ac){var _0x27b247=fs[_0xfe94('0x27')](path[_0xfe94('0x28')](config[_0xfe94('0xa')],_0xfe94('0x29'),_0xfe94('0x26')));var _0x273737=[];for(var _0x5572c5=0x0;_0x5572c5<_0x27b247[_0xfe94('0x2a')];_0x5572c5++){var _0x3f6d8c=_0x27b247[_0x5572c5]['replace']('.js','');if(compareVersions(module[_0xfe94('0xc')][_0xfe94('0x2')],_0x3f6d8c)===-0x1){_0x273737[_0xfe94('0x2b')](_0x3f6d8c);}}if(_0x273737[_0xfe94('0x2a')]){var _0x3fff5b=_0x273737[_0xfe94('0x2c')](compareVersions);var _0x4fe067=new Umzug({'storage':_0xfe94('0x2d'),'storageOptions':{'model':db[_0xfe94('0x2e')],'modelName':_0xfe94('0x2e'),'columnName':_0xfe94('0x2')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xfe94('0x2d')]['constructor'],function(){throw new Error(_0xfe94('0x2f'));}],'path':path[_0xfe94('0x28')](config[_0xfe94('0xa')],_0xfe94('0x29'),_0xfe94('0x26')),'pattern':/\.js$/}});_0x4fe067['up']({'migrations':_[_0xfe94('0x30')](_0x3fff5b,function(_0x3f3bf0){return _0x3f3bf0+_0xfe94('0x31');})})['then'](function(){return _0xb9d2ac[_0xfe94('0x12')](0xc8)[_0xfe94('0x13')]({'output':_0xfe94('0x32')+module[_0xfe94('0xc')][_0xfe94('0x2')]+'\x20to\x20'+_['last'](_0x3fff5b),'migrations':_[_0xfe94('0x28')](_0x3fff5b)});})['catch'](function(_0x55220d){if(_0x55220d instanceof db[_0xfe94('0x2d')][_0xfe94('0x33')]){return _0xb9d2ac[_0xfe94('0x12')](0xc8)[_0xfe94('0x13')]({'output':_0xfe94('0x34')});}else{return _0xb9d2ac[_0xfe94('0x12')](0x1f4)[_0xfe94('0x13')](_0x55220d);}});}else{return _0xb9d2ac['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x2aee=['lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','exports','query','latest','tags','2.0.0','status','json','fetch','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0x4e877e,_0x2fb483){var _0x1cd509=function(_0x4ae36a){while(--_0x4ae36a){_0x4e877e['push'](_0x4e877e['shift']());}};_0x1cd509(++_0x2fb483);}(_0x2aee,0xfe));var _0xe2ae=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0x2aee[_0x185d2a];return _0x4dea27;};'use strict';var Umzug=require(_0xe2ae('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xe2ae('0x1'));var pkginfo=require(_0xe2ae('0x2'))(module,_0xe2ae('0x3'));var compareVersions=require(_0xe2ae('0x4'));var exec=require(_0xe2ae('0x5'))[_0xe2ae('0x6')];var db=require(_0xe2ae('0x7'))['db'];var config=require(_0xe2ae('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xe2ae('0x9'))('update');var git=require(_0xe2ae('0xa'))(config[_0xe2ae('0xb')]);exports['index']=function(_0x49b7bf,_0x439815){var _0x21c0f1={'current':module[_0xe2ae('0xc')]['version'],'phonebar':0x2};if(_0x49b7bf[_0xe2ae('0xd')]&&_0x49b7bf[_0xe2ae('0xd')][_0xe2ae('0xe')]){return git['fetch']()[_0xe2ae('0xf')](function(_0x64d8d2,_0x5d5250){_0x21c0f1[_0xe2ae('0xe')]=(_0x64d8d2?module[_0xe2ae('0xc')][_0xe2ae('0x3')]:_0x5d5250[_0xe2ae('0xe')])||_0xe2ae('0x10');return _0x439815[_0xe2ae('0x11')](0xc8)[_0xe2ae('0x12')](_0x21c0f1);});}else{return _0x439815[_0xe2ae('0x11')](0xc8)['json'](_0x21c0f1);}};exports['fetch']=function(_0x292d0d,_0x23296f){return git[_0xe2ae('0x13')](['origin','master'],function(_0x784823){if(_0x784823){logger[_0xe2ae('0x14')](_0x784823);return _0x23296f['status'](0x1f4)[_0xe2ae('0x12')](_0x784823);}logger[_0xe2ae('0x15')](_0xe2ae('0x16'));return _0x23296f[_0xe2ae('0x11')](0xc8)[_0xe2ae('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xe2ae('0x17')]=function(_0x5de894,_0x2829c4){return git[_0xe2ae('0x17')]([_0xe2ae('0x18'),_0xe2ae('0x19')],function(_0x430a6b){if(_0x430a6b){logger[_0xe2ae('0x14')](_0x430a6b);return _0x2829c4[_0xe2ae('0x11')](0x1f4)[_0xe2ae('0x12')](_0x430a6b);}logger[_0xe2ae('0x15')](_0xe2ae('0x1a'));return _0x2829c4[_0xe2ae('0x11')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xe2ae('0x1b')]=function(_0x36cd74,_0x3c97ba){exec(_0xe2ae('0x1c'),function(_0x5be0ce,_0x15c09a,_0x4fb9ab){logger['info'](_0x15c09a);logger[_0xe2ae('0x15')](_0x4fb9ab);if(_0x5be0ce){logger['error'](_0x5be0ce);return _0x3c97ba[_0xe2ae('0x11')](0x1f4)[_0xe2ae('0x12')](_0x5be0ce);}return _0x3c97ba[_0xe2ae('0x11')](0xc8)[_0xe2ae('0x12')]({'output':_0x15c09a});});};exports[_0xe2ae('0x1d')]=function(_0x3fa6af,_0x441c08){return pm2[_0xe2ae('0x1d')](_0xe2ae('0x1e'))['then'](function(_0x538996){logger[_0xe2ae('0x15')]('pm2\x20restart\x20motion\x20%s',_0x538996);return _0x441c08['status'](0xc8)[_0xe2ae('0x12')]({'output':_0xe2ae('0x1f')});})[_0xe2ae('0x20')](function(_0xbb6d2d){logger[_0xe2ae('0x14')](_0xbb6d2d);return _0x441c08[_0xe2ae('0x11')](0x1f4)[_0xe2ae('0x12')](_0xbb6d2d);});};exports[_0xe2ae('0x21')]=function(_0x54b71e,_0x4d9ece){var _0x2af4d5=fs[_0xe2ae('0x22')](path['join'](config[_0xe2ae('0xb')],_0xe2ae('0x23'),_0xe2ae('0x21')));var _0x296c01=[];for(var _0x284205=0x0;_0x284205<_0x2af4d5[_0xe2ae('0x24')];_0x284205++){var _0x1cf5c0=_0x2af4d5[_0x284205][_0xe2ae('0x25')](_0xe2ae('0x26'),'');if(compareVersions(module[_0xe2ae('0xc')]['version'],_0x1cf5c0)===-0x1){_0x296c01[_0xe2ae('0x27')](_0x1cf5c0);}}if(_0x296c01['length']){var _0x74e1b6=_0x296c01[_0xe2ae('0x28')](compareVersions);var _0x3420ae=new Umzug({'storage':_0xe2ae('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0xe2ae('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0xe2ae('0x29')]['getQueryInterface'](),db[_0xe2ae('0x29')][_0xe2ae('0x2b')],function(){throw new Error(_0xe2ae('0x2c'));}],'path':path[_0xe2ae('0x2d')](config[_0xe2ae('0xb')],_0xe2ae('0x23'),_0xe2ae('0x21')),'pattern':/\.js$/}});_0x3420ae['up']({'migrations':_['map'](_0x74e1b6,function(_0x224d4e){return _0x224d4e+_0xe2ae('0x26');})})[_0xe2ae('0x2e')](function(){return _0x4d9ece[_0xe2ae('0x11')](0xc8)[_0xe2ae('0x12')]({'output':_0xe2ae('0x2f')+module[_0xe2ae('0xc')][_0xe2ae('0x3')]+_0xe2ae('0x30')+_['last'](_0x74e1b6),'migrations':_['join'](_0x74e1b6)});})['catch'](function(_0x7a3b57){if(_0x7a3b57 instanceof db[_0xe2ae('0x29')][_0xe2ae('0x31')]){return _0x4d9ece[_0xe2ae('0x11')](0xc8)['json']({'output':_0xe2ae('0x32')});}else{return _0x4d9ece[_0xe2ae('0x11')](0x1f4)[_0xe2ae('0x12')](_0x7a3b57);}});}else{return _0x4d9ece[_0xe2ae('0x11')](0xc8)[_0xe2ae('0x12')]({'output':_0xe2ae('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d6c8a17..58fc365 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 _0xc790=['util','path','connect-timeout','Router','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x1b8b69,_0x3d18a8){var _0x585581=function(_0x192b69){while(--_0x192b69){_0x1b8b69['push'](_0x1b8b69['shift']());}};_0x585581(++_0x3d18a8);}(_0xc790,0x18e));var _0x0c79=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xc790[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x0c79('0x0'));var util=require(_0x0c79('0x1'));var path=require(_0x0c79('0x2'));var timeout=require(_0x0c79('0x3'));var express=require('express');var router=express[_0x0c79('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0c79('0x5'));var config=require('../../config/environment');var controller=require(_0x0c79('0x6'));router[_0x0c79('0x7')]('/',auth[_0x0c79('0x8')](),controller[_0x0c79('0x9')]);router[_0x0c79('0x7')](_0x0c79('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0c79('0x7')](_0x0c79('0xb'),auth['isAuthenticated'](),controller[_0x0c79('0xc')]);router[_0x0c79('0xd')]('/',auth[_0x0c79('0x8')](),controller[_0x0c79('0xe')]);router['put'](_0x0c79('0xb'),auth[_0x0c79('0x8')](),controller[_0x0c79('0xf')]);router[_0x0c79('0x10')](_0x0c79('0xb'),auth['isAuthenticated'](),controller[_0x0c79('0x11')]);module[_0x0c79('0x12')]=router; \ No newline at end of file +var _0x9f84=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports','util','path'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x9f84,0xbb));var _0x49f8=function(_0x1ec3fa,_0x3e9940){_0x1ec3fa=_0x1ec3fa-0x0;var _0x349bee=_0x9f84[_0x1ec3fa];return _0x349bee;};'use strict';var multer=require('multer');var util=require(_0x49f8('0x0'));var path=require(_0x49f8('0x1'));var timeout=require(_0x49f8('0x2'));var express=require(_0x49f8('0x3'));var router=express[_0x49f8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x49f8('0x5'));var config=require(_0x49f8('0x6'));var controller=require(_0x49f8('0x7'));router[_0x49f8('0x8')]('/',auth[_0x49f8('0x9')](),controller[_0x49f8('0xa')]);router[_0x49f8('0x8')](_0x49f8('0xb'),auth[_0x49f8('0x9')](),controller[_0x49f8('0xc')]);router[_0x49f8('0x8')]('/:id',auth[_0x49f8('0x9')](),controller[_0x49f8('0xd')]);router[_0x49f8('0xe')]('/',auth[_0x49f8('0x9')](),controller[_0x49f8('0xf')]);router[_0x49f8('0x10')](_0x49f8('0x11'),auth[_0x49f8('0x9')](),controller[_0x49f8('0x12')]);router[_0x49f8('0x13')](_0x49f8('0x11'),auth[_0x49f8('0x9')](),controller['destroy']);module[_0x49f8('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 7c5f864..bb65189 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 _0x349e=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1df41a,_0x5729e6){var _0xe21af5=function(_0x2b8c3f){while(--_0x2b8c3f){_0x1df41a['push'](_0x1df41a['shift']());}};_0xe21af5(++_0x5729e6);}(_0x349e,0xcb));var _0xe349=function(_0x5b192d,_0x1241f1){_0x5b192d=_0x5b192d-0x0;var _0x352f33=_0x349e[_0x5b192d];return _0x352f33;};'use strict';var Sequelize=require(_0xe349('0x0'));module[_0xe349('0x1')]={'type':{'type':Sequelize[_0xe349('0x2')]},'uniqueid':{'type':Sequelize[_0xe349('0x2')]},'calleridnum':{'type':Sequelize[_0xe349('0x2')]},'calleridname':{'type':Sequelize[_0xe349('0x2')]},'queue':{'type':Sequelize[_0xe349('0x2')]},'interface':{'type':Sequelize[_0xe349('0x2')]},'membername':{'type':Sequelize[_0xe349('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe349('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe349('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe349('0x5')]},'agentacw':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe349('0x5')]},'reason':{'type':Sequelize[_0xe349('0x2')]},'lastevent':{'type':Sequelize[_0xe349('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe349('0x5')]},'channelstatedesc':{'type':Sequelize[_0xe349('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe349('0x2')]},'connectedlinename':{'type':Sequelize[_0xe349('0x2')]},'language':{'type':Sequelize[_0xe349('0x2')]},'accountcode':{'type':Sequelize[_0xe349('0x2')]},'context':{'type':Sequelize[_0xe349('0x2')]},'exten':{'type':Sequelize[_0xe349('0x2')]},'priority':{'type':Sequelize[_0xe349('0x2')]},'destchannel':{'type':Sequelize[_0xe349('0x2')]},'destchannelstate':{'type':Sequelize[_0xe349('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xe349('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe349('0x2')]},'destcalleridname':{'type':Sequelize[_0xe349('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xe349('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe349('0x2')]},'destlanguage':{'type':Sequelize[_0xe349('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe349('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe349('0x2')]},'destuniqueid':{'type':Sequelize[_0xe349('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe349('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe349('0x2')],'comment':_0xe349('0x6')},'transferexten':{'type':Sequelize[_0xe349('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe349('0x2')]},'agententerreason':{'type':Sequelize[_0xe349('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdaa8=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xdaa8,0xe4));var _0x8daa=function(_0x24b948,_0x1b2ddc){_0x24b948=_0x24b948-0x0;var _0x2d38ec=_0xdaa8[_0x24b948];return _0x2d38ec;};'use strict';var Sequelize=require(_0x8daa('0x0'));module[_0x8daa('0x1')]={'type':{'type':Sequelize[_0x8daa('0x2')]},'uniqueid':{'type':Sequelize[_0x8daa('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8daa('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8daa('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8daa('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8daa('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8daa('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8daa('0x5')]},'agentacw':{'type':Sequelize[_0x8daa('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8daa('0x5')]},'reason':{'type':Sequelize[_0x8daa('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8daa('0x2')]},'channelstate':{'type':Sequelize[_0x8daa('0x5')]},'channelstatedesc':{'type':Sequelize[_0x8daa('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8daa('0x2')]},'connectedlinename':{'type':Sequelize[_0x8daa('0x2')]},'language':{'type':Sequelize[_0x8daa('0x2')]},'accountcode':{'type':Sequelize[_0x8daa('0x2')]},'context':{'type':Sequelize[_0x8daa('0x2')]},'exten':{'type':Sequelize[_0x8daa('0x2')]},'priority':{'type':Sequelize[_0x8daa('0x2')]},'destchannel':{'type':Sequelize[_0x8daa('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8daa('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8daa('0x2')]},'destcalleridname':{'type':Sequelize[_0x8daa('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x8daa('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8daa('0x2')]},'destcontext':{'type':Sequelize[_0x8daa('0x2')]},'destexten':{'type':Sequelize[_0x8daa('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8daa('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8daa('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8daa('0x2')],'comment':_0x8daa('0x6')},'transferexten':{'type':Sequelize[_0x8daa('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8daa('0x2')]},'agententerreason':{'type':Sequelize[_0x8daa('0x5')],'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 3319495..1bb291f 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(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 c24dac2..6e45186 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 _0x093a=['api','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger'];(function(_0x471653,_0x3d1f42){var _0x58d1ca=function(_0x292096){while(--_0x292096){_0x471653['push'](_0x471653['shift']());}};_0x58d1ca(++_0x3d1f42);}(_0x093a,0x16a));var _0xa093=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x093a[_0x2bda14];return _0xb5dd49;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'paranoid':![],'indexes':[{'fields':[_0xa093('0xc'),_0xa093('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2bb=['util','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x116912,_0x5b23d3){var _0x46a7ce=function(_0xde6fa6){while(--_0xde6fa6){_0x116912['push'](_0x116912['shift']());}};_0x46a7ce(++_0x5b23d3);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x2a99ad,_0x398e91){_0x2a99ad=_0x2a99ad-0x0;var _0x2454ad=_0xd2bb[_0x2a99ad];return _0x2454ad;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var logger=require('../../config/logger')(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var rp=require(_0xbd2b('0x4'));var fs=require('fs');var path=require(_0xbd2b('0x5'));var rimraf=require(_0xbd2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd2b('0x7'));module[_0xbd2b('0x8')]=function(_0xdcd8bd,_0x2f64a8){return _0xdcd8bd[_0xbd2b('0x9')](_0xbd2b('0xa'),attributes,{'tableName':_0xbd2b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbd2b('0xc'),_0xbd2b('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 082dbe5..306739b 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 _0x682e=['update','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','options','UpdateVoiceAgentReport'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0x682e,0x13a));var _0xe682=function(_0x3edb08,_0x4c7c09){_0x3edb08=_0x3edb08-0x0;var _0x4cc852=_0x682e[_0x3edb08];return _0x4cc852;};'use strict';var _=require(_0xe682('0x0'));var util=require('util');var moment=require(_0xe682('0x1'));var BPromise=require('bluebird');var rs=require(_0xe682('0x2'));var fs=require('fs');var Redis=require(_0xe682('0x3'));var db=require(_0xe682('0x4'))['db'];var utils=require(_0xe682('0x5'));var logger=require(_0xe682('0x6'))(_0xe682('0x7'));var config=require(_0xe682('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe682('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x825123,_0x5c7818,_0x51f735){return new BPromise(function(_0x524008,_0x3fc019){return client[_0xe682('0xa')](_0x825123,_0x51f735)[_0xe682('0xb')](function(_0x5c6ab0){logger[_0xe682('0xc')](_0xe682('0xd'),_0x5c7818,'request\x20sent');logger[_0xe682('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x5c7818,'request\x20sent',JSON[_0xe682('0xf')](_0x5c6ab0));if(_0x5c6ab0['error']){if(_0x5c6ab0[_0xe682('0x10')]['code']===0x1f4){logger['error'](_0xe682('0xd'),_0x5c7818,_0x5c6ab0[_0xe682('0x10')][_0xe682('0x11')]);return _0x3fc019(_0x5c6ab0[_0xe682('0x10')][_0xe682('0x11')]);}logger[_0xe682('0x10')](_0xe682('0xd'),_0x5c7818,_0x5c6ab0[_0xe682('0x10')][_0xe682('0x11')]);return _0x524008(_0x5c6ab0[_0xe682('0x10')][_0xe682('0x11')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x5c7818,'request\x20sent');_0x524008(_0x5c6ab0[_0xe682('0x12')]['message']);}})['catch'](function(_0x180733){logger[_0xe682('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x5c7818,_0x180733);_0x3fc019(_0x180733);});});}exports[_0xe682('0x13')]=function(_0xfef50d){var _0x221b79=this;return new Promise(function(_0x478e9d,_0x2d344f){return db[_0xe682('0x14')]['create'](_0xfef50d[_0xe682('0x15')],{'raw':_0xfef50d[_0xe682('0x16')]?_0xfef50d[_0xe682('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4cbe13){logger[_0xe682('0xc')](_0xe682('0x13'),_0xfef50d);logger['debug']('CreateVoiceAgentReport',_0xfef50d,JSON[_0xe682('0xf')](_0x4cbe13));_0x478e9d(_0x4cbe13);})['catch'](function(_0x4f0dbd){logger['error'](_0xe682('0x13'),_0x4f0dbd[_0xe682('0x11')],_0xfef50d);_0x2d344f(_0x221b79['error'](0x1f4,_0x4f0dbd[_0xe682('0x11')]));});});};exports[_0xe682('0x17')]=function(_0x4cc04a){var _0x55747f=this;return new Promise(function(_0xd81dab,_0xc0c1d6){return db[_0xe682('0x14')][_0xe682('0x18')](_0x4cc04a[_0xe682('0x15')],{'raw':_0x4cc04a[_0xe682('0x16')]?_0x4cc04a[_0xe682('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cc04a['options']?_0x4cc04a[_0xe682('0x16')]['where']||null:null,'attributes':_0x4cc04a[_0xe682('0x16')]?_0x4cc04a[_0xe682('0x16')][_0xe682('0x19')]||null:null,'limit':_0x4cc04a[_0xe682('0x16')]?_0x4cc04a[_0xe682('0x16')]['limit']||null:null})['then'](function(_0x588e1a){logger[_0xe682('0xc')]('UpdateVoiceAgentReport',_0x4cc04a);logger[_0xe682('0xe')](_0xe682('0x17'),_0x4cc04a,JSON[_0xe682('0xf')](_0x588e1a));_0xd81dab(_0x588e1a);})['catch'](function(_0x2d36d6){logger['error'](_0xe682('0x17'),_0x2d36d6[_0xe682('0x11')],_0x4cc04a);_0xc0c1d6(_0x55747f[_0xe682('0x10')](0x1f4,_0x2d36d6[_0xe682('0x11')]));});});}; \ No newline at end of file +var _0x14d0=['create','options','raw','update','body','where','attributes','UpdateVoiceAgentReport','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x926f57,_0x147709){var _0x502cf8=function(_0xf21a4f){while(--_0xf21a4f){_0x926f57['push'](_0x926f57['shift']());}};_0x502cf8(++_0x147709);}(_0x14d0,0x13e));var _0x014d=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x14d0[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0x014d('0x0'));var util=require(_0x014d('0x1'));var moment=require('moment');var BPromise=require(_0x014d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x014d('0x3'))['db'];var utils=require(_0x014d('0x4'));var logger=require(_0x014d('0x5'))(_0x014d('0x6'));var config=require('../../config/environment');var jayson=require(_0x014d('0x7'));var client=jayson[_0x014d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a242d,_0x19b4dc,_0x2ba5c1){return new BPromise(function(_0x2de843,_0x4ac47a){return client[_0x014d('0x9')](_0x2a242d,_0x2ba5c1)[_0x014d('0xa')](function(_0x57ab23){logger[_0x014d('0xb')](_0x014d('0xc'),_0x19b4dc,_0x014d('0xd'));logger[_0x014d('0xe')](_0x014d('0xf'),_0x19b4dc,'request\x20sent',JSON[_0x014d('0x10')](_0x57ab23));if(_0x57ab23[_0x014d('0x11')]){if(_0x57ab23[_0x014d('0x11')][_0x014d('0x12')]===0x1f4){logger[_0x014d('0x11')](_0x014d('0xc'),_0x19b4dc,_0x57ab23[_0x014d('0x11')]['message']);return _0x4ac47a(_0x57ab23[_0x014d('0x11')]['message']);}logger[_0x014d('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x19b4dc,_0x57ab23[_0x014d('0x11')][_0x014d('0x13')]);return _0x2de843(_0x57ab23[_0x014d('0x11')][_0x014d('0x13')]);}else{logger[_0x014d('0xb')](_0x014d('0xc'),_0x19b4dc,_0x014d('0xd'));_0x2de843(_0x57ab23['result'][_0x014d('0x13')]);}})[_0x014d('0x14')](function(_0xa85962){logger[_0x014d('0x11')](_0x014d('0xc'),_0x19b4dc,_0xa85962);_0x4ac47a(_0xa85962);});});}exports[_0x014d('0x15')]=function(_0x485c0f){var _0x46044f=this;return new Promise(function(_0x4fd37c,_0x2e10d5){return db[_0x014d('0x16')][_0x014d('0x17')](_0x485c0f['body'],{'raw':_0x485c0f[_0x014d('0x18')]?_0x485c0f['options'][_0x014d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x21a84e){logger[_0x014d('0xb')](_0x014d('0x15'),_0x485c0f);logger[_0x014d('0xe')](_0x014d('0x15'),_0x485c0f,JSON[_0x014d('0x10')](_0x21a84e));_0x4fd37c(_0x21a84e);})[_0x014d('0x14')](function(_0xa880fe){logger[_0x014d('0x11')](_0x014d('0x15'),_0xa880fe[_0x014d('0x13')],_0x485c0f);_0x2e10d5(_0x46044f[_0x014d('0x11')](0x1f4,_0xa880fe[_0x014d('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4943c6){var _0x586e82=this;return new Promise(function(_0x56da5d,_0x2c4659){return db[_0x014d('0x16')][_0x014d('0x1a')](_0x4943c6[_0x014d('0x1b')],{'raw':_0x4943c6[_0x014d('0x18')]?_0x4943c6[_0x014d('0x18')][_0x014d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4943c6['options']?_0x4943c6['options'][_0x014d('0x1c')]||null:null,'attributes':_0x4943c6[_0x014d('0x18')]?_0x4943c6[_0x014d('0x18')][_0x014d('0x1d')]||null:null,'limit':_0x4943c6[_0x014d('0x18')]?_0x4943c6['options']['limit']||null:null})['then'](function(_0xf5298d){logger[_0x014d('0xb')]('UpdateVoiceAgentReport',_0x4943c6);logger['debug']('UpdateVoiceAgentReport',_0x4943c6,JSON['stringify'](_0xf5298d));_0x56da5d(_0xf5298d);})['catch'](function(_0x20587b){logger[_0x014d('0x11')](_0x014d('0x1e'),_0x20587b['message'],_0x4943c6);_0x2c4659(_0x586e82[_0x014d('0x11')](0x1f4,_0x20587b[_0x014d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d0103ab..fb5555d 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 _0x00bb=['express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x3cb40d,_0xf25989){var _0x2ef1eb=function(_0x14da8b){while(--_0x14da8b){_0x3cb40d['push'](_0x3cb40d['shift']());}};_0x2ef1eb(++_0xf25989);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),auth[_0xb00b('0xa')](),controller[_0xb00b('0xb')]);router[_0xb00b('0x8')](_0xb00b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb00b('0xd')]('/',auth[_0xb00b('0xa')](),controller[_0xb00b('0xe')]);router[_0xb00b('0xf')](_0xb00b('0xc'),auth['isAuthenticated'](),controller[_0xb00b('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb00b('0x11')]);module[_0xb00b('0x12')]=router; \ No newline at end of file +var _0x7bae=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x272d8a,_0x45184b){var _0x26286e=function(_0x93beaa){while(--_0x93beaa){_0x272d8a['push'](_0x272d8a['shift']());}};_0x26286e(++_0x45184b);}(_0x7bae,0x13b));var _0xe7ba=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7bae[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ba('0x3'));var interaction=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var controller=require(_0xe7ba('0x6'));router[_0xe7ba('0x7')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x9')]);router[_0xe7ba('0x7')](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xb')]);router[_0xe7ba('0x7')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller['show']);router[_0xe7ba('0xd')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x11')](_0xe7ba('0xc'),auth['isAuthenticated'](),controller[_0xe7ba('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 78421ca..cf2517a 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 _0xd23d=['sequelize','exports','STRING','ENUM','inbound','internal','outbound','TEXT','DATE','INTEGER'];(function(_0x412c83,_0x5cb9a0){var _0xf8b6a2=function(_0x1db31f){while(--_0x1db31f){_0x412c83['push'](_0x412c83['shift']());}};_0xf8b6a2(++_0x5cb9a0);}(_0xd23d,0xa0));var _0xdd23=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0xd23d[_0x4eaa4c];return _0x15aec6;};'use strict';var Sequelize=require(_0xdd23('0x0'));module[_0xdd23('0x1')]={'uniqueid':{'type':Sequelize[_0xdd23('0x2')]},'type':{'type':Sequelize[_0xdd23('0x3')](_0xdd23('0x4'),_0xdd23('0x5'),_0xdd23('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xdd23('0x2')]},'accountcode':{'type':Sequelize[_0xdd23('0x2')]},'source':{'type':Sequelize[_0xdd23('0x2')]},'destination':{'type':Sequelize[_0xdd23('0x2')]},'destinationcontext':{'type':Sequelize[_0xdd23('0x2')]},'callerid':{'type':Sequelize[_0xdd23('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xdd23('0x2')]},'lastdata':{'type':Sequelize[_0xdd23('0x7')]},'starttime':{'type':Sequelize[_0xdd23('0x8')]},'systemanswertime':{'type':Sequelize[_0xdd23('0x8')]},'answertime':{'type':Sequelize[_0xdd23('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xdd23('0x9')]},'billableseconds':{'type':Sequelize[_0xdd23('0x9')]},'mohtime':{'type':Sequelize[_0xdd23('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xdd23('0x2')]},'userfield':{'type':Sequelize[_0xdd23('0x2')]},'userDisposition':{'type':Sequelize[_0xdd23('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xdd23('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xdd23('0x2')]},'note':{'type':Sequelize[_0xdd23('0x2')]},'prefix':{'type':Sequelize[_0xdd23('0x2')]},'routeid':{'type':Sequelize[_0xdd23('0x9')]},'sipcallid':{'type':Sequelize[_0xdd23('0x2')]}}; \ No newline at end of file +var _0xe707=['outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xe707,0x17a));var _0x7e70=function(_0x405d93,_0x514615){_0x405d93=_0x405d93-0x0;var _0x2da30b=_0xe707[_0x405d93];return _0x2da30b;};'use strict';var Sequelize=require(_0x7e70('0x0'));module[_0x7e70('0x1')]={'uniqueid':{'type':Sequelize[_0x7e70('0x2')]},'type':{'type':Sequelize[_0x7e70('0x3')](_0x7e70('0x4'),_0x7e70('0x5'),_0x7e70('0x6'),_0x7e70('0x7'),'outbound-fax',_0x7e70('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7e70('0x2')]},'source':{'type':Sequelize[_0x7e70('0x2')]},'destination':{'type':Sequelize[_0x7e70('0x2')]},'destinationcontext':{'type':Sequelize[_0x7e70('0x2')]},'callerid':{'type':Sequelize[_0x7e70('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7e70('0x2')]},'lastdata':{'type':Sequelize[_0x7e70('0x9')]},'starttime':{'type':Sequelize[_0x7e70('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x7e70('0xa')]},'endtime':{'type':Sequelize[_0x7e70('0xa')]},'duration':{'type':Sequelize[_0x7e70('0xb')]},'billableseconds':{'type':Sequelize[_0x7e70('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7e70('0x2')]},'amaflags':{'type':Sequelize[_0x7e70('0x2')]},'userfield':{'type':Sequelize[_0x7e70('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x7e70('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x7e70('0x2')]},'note':{'type':Sequelize[_0x7e70('0x2')]},'prefix':{'type':Sequelize[_0x7e70('0x2')]},'routeid':{'type':Sequelize[_0x7e70('0xb')]},'sipcallid':{'type':Sequelize[_0x7e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 4c8292c..2f112ef 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3f0cf6,_0x5911f7){_0x3f0cf6=_0x3f0cf6-0x0;var _0x5e229e=_0x5f2f[_0x3f0cf6];return _0x5e229e;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e70a6d4..fd09cff 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 _0x9fb2=['request-promise','path','rimraf','./voiceCallReport.attributes','exports','report_call','util','../../config/logger','api','moment','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9fb2,0x1df));var _0x29fb=function(_0x59c479,_0x2e1545){_0x59c479=_0x59c479-0x0;var _0x681d72=_0x9fb2[_0x59c479];return _0x681d72;};'use strict';var _=require('lodash');var util=require(_0x29fb('0x0'));var logger=require(_0x29fb('0x1'))(_0x29fb('0x2'));var moment=require(_0x29fb('0x3'));var BPromise=require(_0x29fb('0x4'));var rp=require(_0x29fb('0x5'));var fs=require('fs');var path=require(_0x29fb('0x6'));var rimraf=require(_0x29fb('0x7'));var config=require('../../config/environment');var attributes=require(_0x29fb('0x8'));module[_0x29fb('0x9')]=function(_0x560b1d,_0x58307a){return _0x560b1d['define']('VoiceCallReport',attributes,{'tableName':_0x29fb('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc00c=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','api','path'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xc00c,0x97));var _0xcc00=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xc00c[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc00('0x0'))(_0xcc00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc00('0x2'));var rimraf=require(_0xcc00('0x3'));var config=require(_0xcc00('0x4'));var attributes=require(_0xcc00('0x5'));module[_0xcc00('0x6')]=function(_0x13df32,_0x482f73){return _0x13df32[_0xcc00('0x7')](_0xcc00('0x8'),attributes,{'tableName':_0xcc00('0x9'),'paranoid':![],'indexes':[{'fields':[_0xcc00('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index a7ba1ff..e383477 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 _0xc414=['code','message','result','catch','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceCallReport','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0xc414,0x111));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4c41('0x0'));var moment=require(_0x4c41('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c41('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c41('0x3'))['db'];var utils=require(_0x4c41('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c41('0x5'));var jayson=require(_0x4c41('0x6'));var client=jayson['client'][_0x4c41('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x277485,_0x515b0a,_0x34f706){return new BPromise(function(_0x194008,_0xdf57a5){return client['request'](_0x277485,_0x34f706)[_0x4c41('0x8')](function(_0x500476){logger[_0x4c41('0x9')](_0x4c41('0xa'),_0x515b0a,'request\x20sent');logger['debug'](_0x4c41('0xb'),_0x515b0a,_0x4c41('0xc'),JSON[_0x4c41('0xd')](_0x500476));if(_0x500476[_0x4c41('0xe')]){if(_0x500476[_0x4c41('0xe')][_0x4c41('0xf')]===0x1f4){logger['error'](_0x4c41('0xa'),_0x515b0a,_0x500476[_0x4c41('0xe')][_0x4c41('0x10')]);return _0xdf57a5(_0x500476['error'][_0x4c41('0x10')]);}logger[_0x4c41('0xe')](_0x4c41('0xa'),_0x515b0a,_0x500476[_0x4c41('0xe')]['message']);return _0x194008(_0x500476[_0x4c41('0xe')][_0x4c41('0x10')]);}else{logger[_0x4c41('0x9')](_0x4c41('0xa'),_0x515b0a,_0x4c41('0xc'));_0x194008(_0x500476[_0x4c41('0x11')][_0x4c41('0x10')]);}})[_0x4c41('0x12')](function(_0x284b21){logger['error'](_0x4c41('0xa'),_0x515b0a,_0x284b21);_0xdf57a5(_0x284b21);});});}exports['GetVoiceCallReport']=function(_0xaa5028){var _0x3f3156=this;return new Promise(function(_0x4564ed,_0xb5491){return db[_0x4c41('0x13')][_0x4c41('0x14')]({'raw':_0xaa5028[_0x4c41('0x15')]?_0xaa5028[_0x4c41('0x15')][_0x4c41('0x16')]===undefined?!![]:![]:!![],'where':_0xaa5028[_0x4c41('0x15')]?_0xaa5028[_0x4c41('0x15')][_0x4c41('0x17')]||null:null,'attributes':_0xaa5028[_0x4c41('0x15')]?_0xaa5028[_0x4c41('0x15')]['attributes']||null:null,'limit':_0xaa5028[_0x4c41('0x15')]?_0xaa5028['options'][_0x4c41('0x18')]||null:null,'include':_0xaa5028['options']?_0xaa5028[_0x4c41('0x15')][_0x4c41('0x19')]?_[_0x4c41('0x1a')](_0xaa5028[_0x4c41('0x15')][_0x4c41('0x19')],function(_0x2b6180){return{'model':db[_0x2b6180[_0x4c41('0x1b')]],'as':_0x2b6180['as'],'attributes':_0x2b6180[_0x4c41('0x1c')],'include':_0x2b6180[_0x4c41('0x19')]?_[_0x4c41('0x1a')](_0x2b6180['include'],function(_0x42c457){return{'model':db[_0x42c457['model']],'as':_0x42c457['as'],'attributes':_0x42c457[_0x4c41('0x1c')],'include':_0x42c457[_0x4c41('0x19')]?_['map'](_0x42c457[_0x4c41('0x19')],function(_0x5e4327){return{'model':db[_0x5e4327['model']],'as':_0x5e4327['as'],'attributes':_0x5e4327[_0x4c41('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4c41('0x8')](function(_0x2bbd88){logger['info'](_0x4c41('0x1d'),_0xaa5028);logger[_0x4c41('0x1e')](_0x4c41('0x1d'),_0xaa5028,JSON[_0x4c41('0xd')](_0x2bbd88));_0x4564ed(_0x2bbd88);})[_0x4c41('0x12')](function(_0x24ad10){logger[_0x4c41('0xe')](_0x4c41('0x1d'),_0x24ad10['message'],_0xaa5028);_0xb5491(_0x3f3156[_0x4c41('0xe')](0x1f4,_0x24ad10[_0x4c41('0x10')]));});});};exports[_0x4c41('0x1f')]=function(_0x1bec9e){var _0x3e2304=this;return new Promise(function(_0xbfbf7,_0x25b02b){return db[_0x4c41('0x13')][_0x4c41('0x20')](_0x1bec9e[_0x4c41('0x21')],{'raw':_0x1bec9e[_0x4c41('0x15')]?_0x1bec9e['options']['raw']===undefined?!![]:![]:!![]})[_0x4c41('0x8')](function(_0x4924a2){logger[_0x4c41('0x9')](_0x4c41('0x1f'),_0x1bec9e);logger[_0x4c41('0x1e')](_0x4c41('0x1f'),_0x1bec9e,JSON[_0x4c41('0xd')](_0x4924a2));_0xbfbf7(_0x4924a2);})[_0x4c41('0x12')](function(_0x1e0bbd){logger[_0x4c41('0xe')](_0x4c41('0x1f'),_0x1e0bbd[_0x4c41('0x10')],_0x1bec9e);_0x25b02b(_0x3e2304[_0x4c41('0xe')](0x1f4,_0x1e0bbd[_0x4c41('0x10')]));});});};exports[_0x4c41('0x22')]=function(_0x1c38c2){var _0x27f09f=this;return new Promise(function(_0x99a25,_0x14a3c5){return db[_0x4c41('0x13')][_0x4c41('0x23')](_0x1c38c2[_0x4c41('0x21')],{'raw':_0x1c38c2[_0x4c41('0x15')]?_0x1c38c2[_0x4c41('0x15')][_0x4c41('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c38c2['options']?_0x1c38c2['options'][_0x4c41('0x17')]||null:null,'attributes':_0x1c38c2['options']?_0x1c38c2['options']['attributes']||null:null,'limit':_0x1c38c2[_0x4c41('0x15')]?_0x1c38c2['options']['limit']||null:null})[_0x4c41('0x8')](function(_0x41e648){logger[_0x4c41('0x9')](_0x4c41('0x22'),_0x1c38c2);logger[_0x4c41('0x1e')](_0x4c41('0x22'),_0x1c38c2,JSON[_0x4c41('0xd')](_0x41e648));_0x99a25(_0x41e648);})[_0x4c41('0x12')](function(_0x3d46cc){logger[_0x4c41('0xe')](_0x4c41('0x22'),_0x3d46cc['message'],_0x1c38c2);_0x14a3c5(_0x27f09f[_0x4c41('0xe')](0x1f4,_0x3d46cc['message']));});});}; \ No newline at end of file +var _0x6e0e=['CreateVoiceCallReport','create','body','then','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1068ce,_0x45ba6b){var _0x16d54f=function(_0x248078){while(--_0x248078){_0x1068ce['push'](_0x1068ce['shift']());}};_0x16d54f(++_0x45ba6b);}(_0x6e0e,0x7e));var _0xe6e0=function(_0x1d6482,_0x12f1e7){_0x1d6482=_0x1d6482-0x0;var _0x1c265c=_0x6e0e[_0x1d6482];return _0x1c265c;};'use strict';var _=require(_0xe6e0('0x0'));var util=require(_0xe6e0('0x1'));var moment=require(_0xe6e0('0x2'));var BPromise=require(_0xe6e0('0x3'));var rs=require(_0xe6e0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6e0('0x6'))(_0xe6e0('0x7'));var config=require(_0xe6e0('0x8'));var jayson=require(_0xe6e0('0x9'));var client=jayson[_0xe6e0('0xa')][_0xe6e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1186d2,_0x1f61e8,_0x415741){return new BPromise(function(_0x250e4f,_0x32f16a){return client['request'](_0x1186d2,_0x415741)['then'](function(_0x135b1b){logger[_0xe6e0('0xc')](_0xe6e0('0xd'),_0x1f61e8,'request\x20sent');logger[_0xe6e0('0xe')](_0xe6e0('0xf'),_0x1f61e8,_0xe6e0('0x10'),JSON[_0xe6e0('0x11')](_0x135b1b));if(_0x135b1b['error']){if(_0x135b1b[_0xe6e0('0x12')][_0xe6e0('0x13')]===0x1f4){logger[_0xe6e0('0x12')](_0xe6e0('0xd'),_0x1f61e8,_0x135b1b['error']['message']);return _0x32f16a(_0x135b1b['error'][_0xe6e0('0x14')]);}logger['error'](_0xe6e0('0xd'),_0x1f61e8,_0x135b1b[_0xe6e0('0x12')][_0xe6e0('0x14')]);return _0x250e4f(_0x135b1b['error'][_0xe6e0('0x14')]);}else{logger[_0xe6e0('0xc')](_0xe6e0('0xd'),_0x1f61e8,_0xe6e0('0x10'));_0x250e4f(_0x135b1b[_0xe6e0('0x15')][_0xe6e0('0x14')]);}})[_0xe6e0('0x16')](function(_0x3a7286){logger[_0xe6e0('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1f61e8,_0x3a7286);_0x32f16a(_0x3a7286);});});}exports[_0xe6e0('0x17')]=function(_0x303371){var _0x256038=this;return new Promise(function(_0x4104bc,_0x1a1df7){return db[_0xe6e0('0x18')][_0xe6e0('0x19')]({'raw':_0x303371[_0xe6e0('0x1a')]?_0x303371[_0xe6e0('0x1a')][_0xe6e0('0x1b')]===undefined?!![]:![]:!![],'where':_0x303371[_0xe6e0('0x1a')]?_0x303371[_0xe6e0('0x1a')][_0xe6e0('0x1c')]||null:null,'attributes':_0x303371[_0xe6e0('0x1a')]?_0x303371[_0xe6e0('0x1a')][_0xe6e0('0x1d')]||null:null,'limit':_0x303371[_0xe6e0('0x1a')]?_0x303371[_0xe6e0('0x1a')][_0xe6e0('0x1e')]||null:null,'include':_0x303371[_0xe6e0('0x1a')]?_0x303371[_0xe6e0('0x1a')][_0xe6e0('0x1f')]?_[_0xe6e0('0x20')](_0x303371[_0xe6e0('0x1a')][_0xe6e0('0x1f')],function(_0x14606d){return{'model':db[_0x14606d[_0xe6e0('0x21')]],'as':_0x14606d['as'],'attributes':_0x14606d['attributes'],'include':_0x14606d[_0xe6e0('0x1f')]?_[_0xe6e0('0x20')](_0x14606d[_0xe6e0('0x1f')],function(_0xe84799){return{'model':db[_0xe84799[_0xe6e0('0x21')]],'as':_0xe84799['as'],'attributes':_0xe84799[_0xe6e0('0x1d')],'include':_0xe84799[_0xe6e0('0x1f')]?_[_0xe6e0('0x20')](_0xe84799[_0xe6e0('0x1f')],function(_0x30990b){return{'model':db[_0x30990b[_0xe6e0('0x21')]],'as':_0x30990b['as'],'attributes':_0x30990b[_0xe6e0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ac1a1){logger['info'](_0xe6e0('0x17'),_0x303371);logger[_0xe6e0('0xe')](_0xe6e0('0x17'),_0x303371,JSON['stringify'](_0x5ac1a1));_0x4104bc(_0x5ac1a1);})[_0xe6e0('0x16')](function(_0xeffa14){logger[_0xe6e0('0x12')](_0xe6e0('0x17'),_0xeffa14[_0xe6e0('0x14')],_0x303371);_0x1a1df7(_0x256038['error'](0x1f4,_0xeffa14[_0xe6e0('0x14')]));});});};exports[_0xe6e0('0x22')]=function(_0x18f44e){var _0x110d69=this;return new Promise(function(_0x2b175b,_0x1fa668){return db['VoiceCallReport'][_0xe6e0('0x23')](_0x18f44e[_0xe6e0('0x24')],{'raw':_0x18f44e[_0xe6e0('0x1a')]?_0x18f44e[_0xe6e0('0x1a')][_0xe6e0('0x1b')]===undefined?!![]:![]:!![]})[_0xe6e0('0x25')](function(_0xffebfe){logger[_0xe6e0('0xc')](_0xe6e0('0x22'),_0x18f44e);logger[_0xe6e0('0xe')](_0xe6e0('0x22'),_0x18f44e,JSON['stringify'](_0xffebfe));_0x2b175b(_0xffebfe);})['catch'](function(_0x3bddbb){logger[_0xe6e0('0x12')](_0xe6e0('0x22'),_0x3bddbb['message'],_0x18f44e);_0x1fa668(_0x110d69[_0xe6e0('0x12')](0x1f4,_0x3bddbb['message']));});});};exports[_0xe6e0('0x26')]=function(_0x592a62){var _0x5f0964=this;return new Promise(function(_0x59993e,_0x421478){return db[_0xe6e0('0x18')][_0xe6e0('0x27')](_0x592a62[_0xe6e0('0x24')],{'raw':_0x592a62['options']?_0x592a62[_0xe6e0('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592a62[_0xe6e0('0x1a')]?_0x592a62[_0xe6e0('0x1a')][_0xe6e0('0x1c')]||null:null,'attributes':_0x592a62[_0xe6e0('0x1a')]?_0x592a62[_0xe6e0('0x1a')][_0xe6e0('0x1d')]||null:null,'limit':_0x592a62[_0xe6e0('0x1a')]?_0x592a62[_0xe6e0('0x1a')][_0xe6e0('0x1e')]||null:null})[_0xe6e0('0x25')](function(_0x5c41fd){logger[_0xe6e0('0xc')]('UpdateVoiceCallReport',_0x592a62);logger['debug'](_0xe6e0('0x26'),_0x592a62,JSON[_0xe6e0('0x11')](_0x5c41fd));_0x59993e(_0x5c41fd);})[_0xe6e0('0x16')](function(_0xdfa36a){logger[_0xe6e0('0x12')](_0xe6e0('0x26'),_0xdfa36a[_0xe6e0('0x14')],_0x592a62);_0x421478(_0x5f0964[_0xe6e0('0x12')](0x1f4,_0xdfa36a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9794362..bf94b5c 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 _0x73c4=['index','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0x3d2ba6,_0x157485){var _0x113ef5=function(_0x2954d7){while(--_0x2954d7){_0x3d2ba6['push'](_0x3d2ba6['shift']());}};_0x113ef5(++_0x157485);}(_0x73c4,0x8e));var _0x473c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x73c4[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x473c('0x0'));var util=require(_0x473c('0x1'));var path=require(_0x473c('0x2'));var timeout=require(_0x473c('0x3'));var express=require(_0x473c('0x4'));var router=express[_0x473c('0x5')]();var fs_extra=require(_0x473c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x473c('0x7'));router[_0x473c('0x8')]('/',auth[_0x473c('0x9')](),controller[_0x473c('0xa')]);router[_0x473c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x473c('0xb')]);router[_0x473c('0xc')]('/',auth[_0x473c('0x9')](),controller[_0x473c('0xd')]);router[_0x473c('0xe')](_0x473c('0xf'),auth[_0x473c('0x9')](),controller[_0x473c('0x10')]);router[_0x473c('0x11')](_0x473c('0xf'),auth[_0x473c('0x9')](),controller['destroy']);module[_0x473c('0x12')]=router; \ No newline at end of file +var _0x52ca=['get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x52ca,0x95));var _0xa52c=function(_0x5b9e04,_0x4f3dcd){_0x5b9e04=_0x5b9e04-0x0;var _0x5b8484=_0x52ca[_0x5b9e04];return _0x5b8484;};'use strict';var multer=require(_0xa52c('0x0'));var util=require(_0xa52c('0x1'));var path=require(_0xa52c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa52c('0x3'));var router=express[_0xa52c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa52c('0x5'));var interaction=require(_0xa52c('0x6'));var config=require(_0xa52c('0x7'));var controller=require(_0xa52c('0x8'));router['get']('/',auth[_0xa52c('0x9')](),controller[_0xa52c('0xa')]);router[_0xa52c('0xb')](_0xa52c('0xc'),auth[_0xa52c('0x9')](),controller[_0xa52c('0xd')]);router[_0xa52c('0xe')]('/',auth[_0xa52c('0x9')](),controller[_0xa52c('0xf')]);router[_0xa52c('0x10')](_0xa52c('0xc'),auth[_0xa52c('0x9')](),controller[_0xa52c('0x11')]);router['delete'](_0xa52c('0xc'),auth[_0xa52c('0x9')](),controller[_0xa52c('0x12')]);module[_0xa52c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 5637502..73c97a1 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 _0xe8f5=['setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0xe8f5,0x1ec));var _0x5e8f=function(_0x36b2cf,_0x2a70cd){_0x36b2cf=_0x36b2cf-0x0;var _0x3e5bff=_0xe8f5[_0x36b2cf];return _0x3e5bff;};'use strict';var Sequelize=require('sequelize');module[_0x5e8f('0x0')]={'name':{'type':Sequelize[_0x5e8f('0x1')]},'prefix':{'type':Sequelize[_0x5e8f('0x1')],'unique':_0x5e8f('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x4aae11){this[_0x5e8f('0x3')](_0x5e8f('0x4'),_0x4aae11?_0x4aae11[_0x5e8f('0x5')](''):[]);},'get':function(){return this[_0x5e8f('0x6')]('options')?this[_0x5e8f('0x6')](_0x5e8f('0x4'))[_0x5e8f('0x7')](''):[];}},'auth':{'type':Sequelize[_0x5e8f('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x5e8f('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5e8f('0x1')]},'description':{'type':Sequelize[_0x5e8f('0x1')]}}; \ No newline at end of file +var _0x786b=['BOOLEAN','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x1f2fbf,_0xfe8bcc){var _0xef8cfa=function(_0x4de263){while(--_0x4de263){_0x1f2fbf['push'](_0x1f2fbf['shift']());}};_0xef8cfa(++_0xfe8bcc);}(_0x786b,0x1a8));var _0xb786=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x786b[_0x648163];return _0x199d4d;};'use strict';var Sequelize=require('sequelize');module[_0xb786('0x0')]={'name':{'type':Sequelize[_0xb786('0x1')]},'prefix':{'type':Sequelize[_0xb786('0x1')],'unique':_0xb786('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xb786('0x1')],'set':function(_0x1da57a){this[_0xb786('0x3')](_0xb786('0x4'),_0x1da57a?_0x1da57a[_0xb786('0x5')](''):[]);},'get':function(){return this[_0xb786('0x6')]('options')?this['getDataValue']('options')[_0xb786('0x7')](''):[];}},'auth':{'type':Sequelize[_0xb786('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xb786('0x1')]},'record':{'type':Sequelize[_0xb786('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb786('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 068c3ee..c0a7b46 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 _0x6364=['sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','error','stack','send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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'];(function(_0x200afa,_0x339020){var _0x14538c=function(_0xbb63c7){while(--_0xbb63c7){_0x200afa['push'](_0x200afa['shift']());}};_0x14538c(++_0x339020);}(_0x6364,0x8f));var _0x4636=function(_0x5b6e49,_0x4d2257){_0x5b6e49=_0x5b6e49-0x0;var _0xfcfdfe=_0x6364[_0x5b6e49];return _0xfcfdfe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4636('0x0'));var jsonpatch=require(_0x4636('0x1'));var rp=require(_0x4636('0x2'));var moment=require(_0x4636('0x3'));var BPromise=require(_0x4636('0x4'));var Mustache=require(_0x4636('0x5'));var util=require(_0x4636('0x6'));var path=require(_0x4636('0x7'));var sox=require('sox');var csv=require(_0x4636('0x8'));var ejs=require(_0x4636('0x9'));var fs=require('fs');var fs_extra=require(_0x4636('0xa'));var _=require(_0x4636('0xb'));var squel=require(_0x4636('0xc'));var crypto=require('crypto');var jsforce=require(_0x4636('0xd'));var deskjs=require(_0x4636('0xe'));var toCsv=require(_0x4636('0x8'));var querystring=require(_0x4636('0xf'));var Papa=require('papaparse');var Redis=require(_0x4636('0x10'));var authService=require(_0x4636('0x11'));var qs=require(_0x4636('0x12'));var as=require(_0x4636('0x13'));var hardwareService=require(_0x4636('0x14'));var logger=require('../../config/logger')(_0x4636('0x15'));var utils=require(_0x4636('0x16'));var config=require(_0x4636('0x17'));var licenseUtil=require(_0x4636('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ee0e,_0xa30deb){_0xa30deb=_0xa30deb||0xcc;return function(_0x26a363){if(_0x26a363){return _0x13ee0e[_0x4636('0x19')](_0xa30deb);}return _0x13ee0e[_0x4636('0x1a')](_0xa30deb)['end']();};}function respondWithResult(_0x5d59c8,_0x1b0436){_0x1b0436=_0x1b0436||0xc8;return function(_0x3eaf7a){if(_0x3eaf7a){return _0x5d59c8[_0x4636('0x1a')](_0x1b0436)[_0x4636('0x1b')](_0x3eaf7a);}};}function respondWithFilteredResult(_0x495fb9,_0x1e432f){return function(_0x2abb29){if(_0x2abb29){var _0x20859a=typeof _0x1e432f[_0x4636('0x1c')]===_0x4636('0x1d')&&typeof _0x1e432f[_0x4636('0x1e')]==='undefined';var _0xc04acf=_0x2abb29[_0x4636('0x1f')];var _0x3362ca=_0x20859a?0x0:_0x1e432f[_0x4636('0x1c')];var _0x5495dc=_0x20859a?_0x2abb29[_0x4636('0x1f')]:_0x1e432f['offset']+_0x1e432f['limit'];var _0x30f410;if(_0x5495dc>=_0xc04acf){_0x5495dc=_0xc04acf;_0x30f410=0xc8;}else{_0x30f410=0xce;}_0x495fb9[_0x4636('0x1a')](_0x30f410);return _0x495fb9['set'](_0x4636('0x20'),_0x3362ca+'-'+_0x5495dc+'/'+_0xc04acf)[_0x4636('0x1b')](_0x2abb29);}return null;};}function patchUpdates(_0x5a014c){return function(_0x34afd3){try{jsonpatch[_0x4636('0x21')](_0x34afd3,_0x5a014c,!![]);}catch(_0x51a2ec){return BPromise[_0x4636('0x22')](_0x51a2ec);}return _0x34afd3[_0x4636('0x23')]();};}function saveUpdates(_0x3dc87e,_0x5ae7c8){return function(_0x441a89){if(_0x441a89){return _0x441a89['update'](_0x3dc87e)[_0x4636('0x24')](function(_0x469027){return _0x469027;});}return null;};}function removeEntity(_0x3cd3d7,_0x9b2338){return function(_0x281223){if(_0x281223){return _0x281223[_0x4636('0x25')]()[_0x4636('0x24')](function(){var _0x428098=_0x281223[_0x4636('0x26')]({'plain':!![]});var _0x3d74d5=_0x4636('0x27');return db[_0x4636('0x28')][_0x4636('0x25')]({'where':{'type':_0x3d74d5,'resourceId':_0x428098['id']}})[_0x4636('0x24')](function(){return _0x281223;});})[_0x4636('0x24')](function(){_0x3cd3d7[_0x4636('0x1a')](0xcc)[_0x4636('0x29')]();});}};}function handleEntityNotFound(_0x3a7f91,_0x2d4df5){return function(_0x378a45){if(!_0x378a45){_0x3a7f91['sendStatus'](0x194);}return _0x378a45;};}function handleError(_0x3f51aa,_0x4bd69a){_0x4bd69a=_0x4bd69a||0x1f4;return function(_0x8dd8cf){logger[_0x4636('0x2a')](_0x8dd8cf[_0x4636('0x2b')]);if(_0x8dd8cf['name']){delete _0x8dd8cf['name'];}_0x3f51aa['status'](_0x4bd69a)[_0x4636('0x2c')](_0x8dd8cf);};}exports['index']=function(_0x4e0bc0,_0x4e893d){var _0x272b59={},_0x5f0260={},_0x5a7701={'count':0x0,'rows':[]};var _0x247551=_['map'](db[_0x4636('0x2d')][_0x4636('0x2e')],function(_0x64a49){return{'name':_0x64a49[_0x4636('0x2f')],'type':_0x64a49[_0x4636('0x30')][_0x4636('0x31')]};});_0x5f0260[_0x4636('0x32')]=_['map'](_0x247551,_0x4636('0x33'));_0x5f0260[_0x4636('0x34')]=_['keys'](_0x4e0bc0[_0x4636('0x34')]);_0x5f0260['filters']=_[_0x4636('0x35')](_0x5f0260[_0x4636('0x32')],_0x5f0260['query']);_0x272b59[_0x4636('0x36')]=_[_0x4636('0x35')](_0x5f0260[_0x4636('0x32')],qs['fields'](_0x4e0bc0[_0x4636('0x34')][_0x4636('0x37')]));_0x272b59[_0x4636('0x36')]=_0x272b59[_0x4636('0x36')][_0x4636('0x38')]?_0x272b59['attributes']:_0x5f0260[_0x4636('0x32')];if(!_0x4e0bc0[_0x4636('0x34')][_0x4636('0x39')]('nolimit')){_0x272b59['limit']=qs[_0x4636('0x1e')](_0x4e0bc0[_0x4636('0x34')]['limit']);_0x272b59[_0x4636('0x1c')]=qs[_0x4636('0x1c')](_0x4e0bc0[_0x4636('0x34')]['offset']);}_0x272b59[_0x4636('0x3a')]=qs['sort'](_0x4e0bc0[_0x4636('0x34')][_0x4636('0x3b')]);_0x272b59[_0x4636('0x3c')]=qs[_0x4636('0x3d')](_[_0x4636('0x3e')](_0x4e0bc0[_0x4636('0x34')],_0x5f0260[_0x4636('0x3d')]),_0x247551);if(_0x4e0bc0[_0x4636('0x34')]['filter']){_0x272b59['where']=_[_0x4636('0x3f')](_0x272b59['where'],{'$or':_[_0x4636('0x40')](_0x247551,function(_0x5f29c0){if(_0x5f29c0[_0x4636('0x30')]!=='VIRTUAL'){var _0x4ade78={};_0x4ade78[_0x5f29c0[_0x4636('0x33')]]={'$like':'%'+_0x4e0bc0[_0x4636('0x34')][_0x4636('0x41')]+'%'};return _0x4ade78;}})});}_0x272b59=_[_0x4636('0x3f')]({},_0x272b59,_0x4e0bc0[_0x4636('0x42')]);var _0x1c2c0b={'where':_0x272b59['where']};return db['VoiceChanSpy'][_0x4636('0x1f')](_0x1c2c0b)[_0x4636('0x24')](function(_0xbf5ef1){_0x5a7701['count']=_0xbf5ef1;if(_0x4e0bc0[_0x4636('0x34')]['includeAll']){_0x272b59[_0x4636('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x4636('0x44')](_0x272b59);})['then'](function(_0x17176c){_0x5a7701[_0x4636('0x45')]=_0x17176c;return _0x5a7701;})[_0x4636('0x24')](respondWithFilteredResult(_0x4e893d,_0x272b59))[_0x4636('0x46')](handleError(_0x4e893d,null));};exports[_0x4636('0x47')]=function(_0x1768fb,_0x573447){var _0x47344a={'raw':![],'where':{'id':_0x1768fb[_0x4636('0x48')]['id']}},_0x34be34={};_0x34be34[_0x4636('0x32')]=_['keys'](db[_0x4636('0x2d')]['rawAttributes']);_0x34be34['query']=_[_0x4636('0x49')](_0x1768fb['query']);_0x34be34[_0x4636('0x3d')]=_[_0x4636('0x35')](_0x34be34[_0x4636('0x32')],_0x34be34[_0x4636('0x34')]);_0x47344a['attributes']=_[_0x4636('0x35')](_0x34be34[_0x4636('0x32')],qs[_0x4636('0x37')](_0x1768fb[_0x4636('0x34')]['fields']));_0x47344a[_0x4636('0x36')]=_0x47344a[_0x4636('0x36')][_0x4636('0x38')]?_0x47344a[_0x4636('0x36')]:_0x34be34['model'];if(_0x1768fb[_0x4636('0x34')][_0x4636('0x4a')]){_0x47344a[_0x4636('0x43')]=[{'all':!![]}];}_0x47344a=_[_0x4636('0x3f')]({},_0x47344a,_0x1768fb['options']);return db[_0x4636('0x2d')][_0x4636('0x4b')](_0x47344a)[_0x4636('0x24')](handleEntityNotFound(_0x573447,null))['then'](respondWithResult(_0x573447,null))[_0x4636('0x46')](handleError(_0x573447,null));};exports[_0x4636('0x4c')]=function(_0x29acb1,_0x193bc8){return db[_0x4636('0x2d')][_0x4636('0x4c')](_0x29acb1[_0x4636('0x4d')],{})[_0x4636('0x24')](function(_0x3d979e){var _0x865cf0=_0x29acb1[_0x4636('0x4e')][_0x4636('0x26')]({'plain':!![]});if(!_0x865cf0)throw new Error(_0x4636('0x4f'));if(_0x865cf0[_0x4636('0x50')]===_0x4636('0x4e')){var _0x1864d0=_0x3d979e[_0x4636('0x26')]({'plain':!![]});var _0x18f28a=_0x4636('0x27');return db[_0x4636('0x51')][_0x4636('0x4b')]({'where':{'name':_0x18f28a,'userProfileId':_0x865cf0[_0x4636('0x52')]},'raw':!![]})[_0x4636('0x24')](function(_0x50bd5d){if(_0x50bd5d&&_0x50bd5d[_0x4636('0x53')]===0x0){return db['UserProfileResource'][_0x4636('0x4c')]({'name':_0x1864d0['name'],'resourceId':_0x1864d0['id'],'type':_0x50bd5d[_0x4636('0x33')],'sectionId':_0x50bd5d['id']},{})[_0x4636('0x24')](function(){return _0x3d979e;});}else{return _0x3d979e;}})[_0x4636('0x46')](function(_0x65cf2){logger[_0x4636('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x65cf2);throw _0x65cf2;});}return _0x3d979e;})[_0x4636('0x24')](respondWithResult(_0x193bc8,0xc9))[_0x4636('0x46')](handleError(_0x193bc8,null));};exports['update']=function(_0x2cfc5e,_0x237ff9){if(_0x2cfc5e['body']['id']){delete _0x2cfc5e[_0x4636('0x4d')]['id'];}return db[_0x4636('0x2d')][_0x4636('0x4b')]({'where':{'id':_0x2cfc5e[_0x4636('0x48')]['id']}})[_0x4636('0x24')](handleEntityNotFound(_0x237ff9,null))['then'](saveUpdates(_0x2cfc5e['body'],null))[_0x4636('0x24')](respondWithResult(_0x237ff9,null))[_0x4636('0x46')](handleError(_0x237ff9,null));};exports[_0x4636('0x25')]=function(_0x30c2ac,_0x14ee0e){return db['VoiceChanSpy'][_0x4636('0x4b')]({'where':{'id':_0x30c2ac[_0x4636('0x48')]['id']}})[_0x4636('0x24')](handleEntityNotFound(_0x14ee0e,null))['then'](removeEntity(_0x14ee0e,null))[_0x4636('0x46')](handleError(_0x14ee0e,null));}; \ No newline at end of file +var _0x477a=['role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','include','rows','catch','show','options','find','create','body','user'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa477('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa477('0x1'));var jsonpatch=require(_0xa477('0x2'));var rp=require('request-promise');var moment=require(_0xa477('0x3'));var BPromise=require(_0xa477('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa477('0x5'));var sox=require(_0xa477('0x6'));var csv=require('to-csv');var ejs=require(_0xa477('0x7'));var fs=require('fs');var fs_extra=require(_0xa477('0x8'));var _=require(_0xa477('0x9'));var squel=require(_0xa477('0xa'));var crypto=require(_0xa477('0xb'));var jsforce=require(_0xa477('0xc'));var deskjs=require(_0xa477('0xd'));var toCsv=require(_0xa477('0xe'));var querystring=require(_0xa477('0xf'));var Papa=require('papaparse');var Redis=require(_0xa477('0x10'));var authService=require(_0xa477('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa477('0x12'));var config=require(_0xa477('0x13'));var licenseUtil=require(_0xa477('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x280b97,_0x3d2a17){_0x3d2a17=_0x3d2a17||0xcc;return function(_0x70e1c1){if(_0x70e1c1){return _0x280b97['sendStatus'](_0x3d2a17);}return _0x280b97[_0xa477('0x15')](_0x3d2a17)[_0xa477('0x16')]();};}function respondWithResult(_0xbb21a7,_0x185c76){_0x185c76=_0x185c76||0xc8;return function(_0xe878a){if(_0xe878a){return _0xbb21a7['status'](_0x185c76)[_0xa477('0x17')](_0xe878a);}};}function respondWithFilteredResult(_0x2336fe,_0xa607d0){return function(_0x45ecc1){if(_0x45ecc1){var _0x22a156=typeof _0xa607d0[_0xa477('0x18')]===_0xa477('0x19')&&typeof _0xa607d0[_0xa477('0x1a')]===_0xa477('0x19');var _0x22a71c=_0x45ecc1[_0xa477('0x1b')];var _0x33db41=_0x22a156?0x0:_0xa607d0[_0xa477('0x18')];var _0x4a413c=_0x22a156?_0x45ecc1[_0xa477('0x1b')]:_0xa607d0[_0xa477('0x18')]+_0xa607d0[_0xa477('0x1a')];var _0x21cd60;if(_0x4a413c>=_0x22a71c){_0x4a413c=_0x22a71c;_0x21cd60=0xc8;}else{_0x21cd60=0xce;}_0x2336fe[_0xa477('0x15')](_0x21cd60);return _0x2336fe[_0xa477('0x1c')](_0xa477('0x1d'),_0x33db41+'-'+_0x4a413c+'/'+_0x22a71c)[_0xa477('0x17')](_0x45ecc1);}return null;};}function patchUpdates(_0x5af670){return function(_0x434ef1){try{jsonpatch[_0xa477('0x1e')](_0x434ef1,_0x5af670,!![]);}catch(_0x4a8c94){return BPromise['reject'](_0x4a8c94);}return _0x434ef1['save']();};}function saveUpdates(_0x4b7f69,_0x14d01e){return function(_0x2debae){if(_0x2debae){return _0x2debae['update'](_0x4b7f69)[_0xa477('0x1f')](function(_0x4faebd){return _0x4faebd;});}return null;};}function removeEntity(_0x5b6e98,_0x7aa4ac){return function(_0x166694){if(_0x166694){return _0x166694[_0xa477('0x20')]()[_0xa477('0x1f')](function(){var _0x472ed1=_0x166694[_0xa477('0x21')]({'plain':!![]});var _0x2b5c7f='ChanSpies';return db[_0xa477('0x22')][_0xa477('0x20')]({'where':{'type':_0x2b5c7f,'resourceId':_0x472ed1['id']}})[_0xa477('0x1f')](function(){return _0x166694;});})[_0xa477('0x1f')](function(){_0x5b6e98[_0xa477('0x15')](0xcc)[_0xa477('0x16')]();});}};}function handleEntityNotFound(_0x75f779,_0x47a86c){return function(_0x46c831){if(!_0x46c831){_0x75f779[_0xa477('0x23')](0x194);}return _0x46c831;};}function handleError(_0x287c83,_0x25acee){_0x25acee=_0x25acee||0x1f4;return function(_0x18d6a1){logger[_0xa477('0x24')](_0x18d6a1[_0xa477('0x25')]);if(_0x18d6a1['name']){delete _0x18d6a1[_0xa477('0x26')];}_0x287c83['status'](_0x25acee)['send'](_0x18d6a1);};}exports[_0xa477('0x27')]=function(_0x1fa6a5,_0x4c27e7){var _0x15e476={},_0x15c0ea={},_0x3dd666={'count':0x0,'rows':[]};var _0x3ec631=_[_0xa477('0x28')](db[_0xa477('0x29')][_0xa477('0x2a')],function(_0x91f9bf){return{'name':_0x91f9bf[_0xa477('0x2b')],'type':_0x91f9bf[_0xa477('0x2c')][_0xa477('0x2d')]};});_0x15c0ea[_0xa477('0x2e')]=_[_0xa477('0x28')](_0x3ec631,'name');_0x15c0ea[_0xa477('0x2f')]=_[_0xa477('0x30')](_0x1fa6a5[_0xa477('0x2f')]);_0x15c0ea[_0xa477('0x31')]=_[_0xa477('0x32')](_0x15c0ea[_0xa477('0x2e')],_0x15c0ea[_0xa477('0x2f')]);_0x15e476[_0xa477('0x33')]=_['intersection'](_0x15c0ea[_0xa477('0x2e')],qs[_0xa477('0x34')](_0x1fa6a5[_0xa477('0x2f')][_0xa477('0x34')]));_0x15e476[_0xa477('0x33')]=_0x15e476[_0xa477('0x33')][_0xa477('0x35')]?_0x15e476[_0xa477('0x33')]:_0x15c0ea[_0xa477('0x2e')];if(!_0x1fa6a5[_0xa477('0x2f')][_0xa477('0x36')](_0xa477('0x37'))){_0x15e476[_0xa477('0x1a')]=qs[_0xa477('0x1a')](_0x1fa6a5[_0xa477('0x2f')][_0xa477('0x1a')]);_0x15e476[_0xa477('0x18')]=qs[_0xa477('0x18')](_0x1fa6a5[_0xa477('0x2f')]['offset']);}_0x15e476[_0xa477('0x38')]=qs[_0xa477('0x39')](_0x1fa6a5[_0xa477('0x2f')][_0xa477('0x39')]);_0x15e476[_0xa477('0x3a')]=qs[_0xa477('0x31')](_['pick'](_0x1fa6a5['query'],_0x15c0ea[_0xa477('0x31')]),_0x3ec631);if(_0x1fa6a5[_0xa477('0x2f')][_0xa477('0x3b')]){_0x15e476[_0xa477('0x3a')]=_['merge'](_0x15e476['where'],{'$or':_[_0xa477('0x28')](_0x3ec631,function(_0x318086){if(_0x318086[_0xa477('0x2c')]!==_0xa477('0x3c')){var _0x326962={};_0x326962[_0x318086[_0xa477('0x26')]]={'$like':'%'+_0x1fa6a5[_0xa477('0x2f')][_0xa477('0x3b')]+'%'};return _0x326962;}})});}_0x15e476=_[_0xa477('0x3d')]({},_0x15e476,_0x1fa6a5['options']);var _0x2406ff={'where':_0x15e476[_0xa477('0x3a')]};return db[_0xa477('0x29')]['count'](_0x2406ff)[_0xa477('0x1f')](function(_0x4be8cb){_0x3dd666[_0xa477('0x1b')]=_0x4be8cb;if(_0x1fa6a5[_0xa477('0x2f')]['includeAll']){_0x15e476[_0xa477('0x3e')]=[{'all':!![]}];}return db[_0xa477('0x29')]['findAll'](_0x15e476);})[_0xa477('0x1f')](function(_0x37f18c){_0x3dd666[_0xa477('0x3f')]=_0x37f18c;return _0x3dd666;})[_0xa477('0x1f')](respondWithFilteredResult(_0x4c27e7,_0x15e476))[_0xa477('0x40')](handleError(_0x4c27e7,null));};exports[_0xa477('0x41')]=function(_0x2ecc11,_0xb1480a){var _0x983c11={'raw':![],'where':{'id':_0x2ecc11['params']['id']}},_0x476746={};_0x476746[_0xa477('0x2e')]=_[_0xa477('0x30')](db[_0xa477('0x29')][_0xa477('0x2a')]);_0x476746[_0xa477('0x2f')]=_['keys'](_0x2ecc11[_0xa477('0x2f')]);_0x476746['filters']=_[_0xa477('0x32')](_0x476746[_0xa477('0x2e')],_0x476746[_0xa477('0x2f')]);_0x983c11['attributes']=_[_0xa477('0x32')](_0x476746[_0xa477('0x2e')],qs[_0xa477('0x34')](_0x2ecc11[_0xa477('0x2f')][_0xa477('0x34')]));_0x983c11[_0xa477('0x33')]=_0x983c11[_0xa477('0x33')][_0xa477('0x35')]?_0x983c11[_0xa477('0x33')]:_0x476746[_0xa477('0x2e')];if(_0x2ecc11[_0xa477('0x2f')]['includeAll']){_0x983c11[_0xa477('0x3e')]=[{'all':!![]}];}_0x983c11=_[_0xa477('0x3d')]({},_0x983c11,_0x2ecc11[_0xa477('0x42')]);return db['VoiceChanSpy'][_0xa477('0x43')](_0x983c11)[_0xa477('0x1f')](handleEntityNotFound(_0xb1480a,null))['then'](respondWithResult(_0xb1480a,null))[_0xa477('0x40')](handleError(_0xb1480a,null));};exports[_0xa477('0x44')]=function(_0x404b00,_0x543a19){return db[_0xa477('0x29')]['create'](_0x404b00[_0xa477('0x45')],{})['then'](function(_0xd74d50){var _0x271831=_0x404b00[_0xa477('0x46')][_0xa477('0x21')]({'plain':!![]});if(!_0x271831)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x271831[_0xa477('0x47')]===_0xa477('0x46')){var _0xa30b74=_0xd74d50['get']({'plain':!![]});var _0x4fb38b=_0xa477('0x48');return db[_0xa477('0x49')][_0xa477('0x43')]({'where':{'name':_0x4fb38b,'userProfileId':_0x271831[_0xa477('0x4a')]},'raw':!![]})[_0xa477('0x1f')](function(_0x1dfcbd){if(_0x1dfcbd&&_0x1dfcbd[_0xa477('0x4b')]===0x0){return db[_0xa477('0x22')]['create']({'name':_0xa30b74['name'],'resourceId':_0xa30b74['id'],'type':_0x1dfcbd[_0xa477('0x26')],'sectionId':_0x1dfcbd['id']},{})[_0xa477('0x1f')](function(){return _0xd74d50;});}else{return _0xd74d50;}})[_0xa477('0x40')](function(_0xadf7b9){logger[_0xa477('0x24')](_0xa477('0x4c'),_0xadf7b9);throw _0xadf7b9;});}return _0xd74d50;})['then'](respondWithResult(_0x543a19,0xc9))[_0xa477('0x40')](handleError(_0x543a19,null));};exports[_0xa477('0x4d')]=function(_0x219417,_0x2d4b29){if(_0x219417[_0xa477('0x45')]['id']){delete _0x219417[_0xa477('0x45')]['id'];}return db[_0xa477('0x29')]['find']({'where':{'id':_0x219417['params']['id']}})[_0xa477('0x1f')](handleEntityNotFound(_0x2d4b29,null))[_0xa477('0x1f')](saveUpdates(_0x219417[_0xa477('0x45')],null))['then'](respondWithResult(_0x2d4b29,null))[_0xa477('0x40')](handleError(_0x2d4b29,null));};exports[_0xa477('0x20')]=function(_0x12b028,_0x504722){return db[_0xa477('0x29')][_0xa477('0x43')]({'where':{'id':_0x12b028[_0xa477('0x4e')]['id']}})[_0xa477('0x1f')](handleEntityNotFound(_0x504722,null))[_0xa477('0x1f')](removeEntity(_0x504722,null))[_0xa477('0x40')](handleError(_0x504722,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 7d9b860..f7272e3 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 _0x1884=['internal','name','User','findAll','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','push','merge','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat'];(function(_0x495566,_0x58f9a5){var _0xd5823d=function(_0x1047f9){while(--_0x1047f9){_0x495566['push'](_0x495566['shift']());}};_0xd5823d(++_0x58f9a5);}(_0x1884,0x118));var _0x4188=function(_0x2f9a38,_0x5f0ad2){_0x2f9a38=_0x2f9a38-0x0;var _0x2a6c1d=_0x1884[_0x2f9a38];return _0x2a6c1d;};'use strict';var _=require('lodash');var util=require(_0x4188('0x0'));var BPromise=require(_0x4188('0x1'));var attributes=require(_0x4188('0x2'));var getUserApplications=function(_0x203ef0,_0x55fcc1,_0x5750e6){var _0x3319f2=0x1;var _0x4681b4=[];var _0x35e05c={'context':_0x55fcc1[_0x4188('0x3')]||_0x4188('0x4'),'exten':util[_0x4188('0x5')](_0x4188('0x6'),_0x203ef0[_0x4188('0x7')],_0x5750e6),'type':'system','isApp':![],'ChanSpyId':_0x203ef0['id'],'UserId':_0x55fcc1['id']};_0x4681b4[_0x4188('0x8')](_[_0x4188('0x9')]({'app':'Set','appdata':util[_0x4188('0x5')](_0x4188('0xa'),'chanspy'),'priority':_0x3319f2++},_0x35e05c));if(_0x203ef0['record']){_0x4681b4[_0x4188('0x8')](_[_0x4188('0x9')]({'app':_0x4188('0xb'),'appdata':util['format'](_0x4188('0xc'),_0x203ef0[_0x4188('0xd')]),'priority':_0x3319f2++},_0x35e05c));}if(_0x203ef0[_0x4188('0xe')]){_0x4681b4[_0x4188('0x8')](_['merge']({'app':_0x4188('0xf'),'appdata':_0x203ef0[_0x4188('0x10')],'priority':_0x3319f2++},_0x35e05c));}_0x4681b4['push'](_[_0x4188('0x9')]({'app':_0x4188('0x11'),'appdata':util['format'](_0x4188('0x12'),_0x55fcc1['name'],_0x203ef0['options']?_0x203ef0[_0x4188('0x13')][_0x4188('0x14')](''):''),'priority':_0x3319f2++},_0x35e05c));if(_0x203ef0['record']){_0x4681b4['push'](_[_0x4188('0x9')]({'app':_0x4188('0x15'),'priority':_0x3319f2++},_0x35e05c));}return _0x4681b4;};var getChanSpyApplications=function(_0x2d49d0,_0x269c77){var _0x168f1d=[];for(var _0x5109b0=0x0,_0x473f69=0x1;_0x5109b0<_0x269c77[_0x4188('0x16')];_0x5109b0++,_0x473f69=0x1){_0x168f1d=_0x168f1d[_0x4188('0x17')](getUserApplications(_0x2d49d0,_0x269c77[_0x5109b0],_0x269c77[_0x5109b0][_0x4188('0x18')]));if(_0x269c77[_0x5109b0]['internal']!=_0x269c77[_0x5109b0][_0x4188('0x19')]){_0x168f1d=_0x168f1d['concat'](getUserApplications(_0x2d49d0,_0x269c77[_0x5109b0],_0x269c77[_0x5109b0][_0x4188('0x19')]));}}return _0x168f1d;};var getChanSpyPromise=function(_0xcdeb5,_0x302110){return new BPromise(function(_0x5e5e3d,_0x27da4c){return _0xcdeb5[_0x4188('0x1a')][_0x4188('0x1b')]({'attributes':['id',_0x4188('0x19'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x5c88e1){if(_0x5c88e1){return _0x5e5e3d(getChanSpyApplications(_0x302110,_0x5c88e1));}return _0x5e5e3d([]);})[_0x4188('0x1c')](function(_0xf64b55){_0x27da4c(_0xf64b55);});});};module[_0x4188('0x1d')]=function(_0xbabc91,_0x480c80){var _0x53da16=_0xbabc91[_0x4188('0x1e')];return _0xbabc91[_0x4188('0x1f')](_0x4188('0x20'),attributes,{'tableName':_0x4188('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31aac6,_0xed0a67,_0x2861e8){return getChanSpyPromise(_0x53da16,_0x31aac6)[_0x4188('0x22')](function(_0x26e750){if(_0x26e750&&_0x26e750[_0x4188('0x16')]){return _0x53da16[_0x4188('0x23')][_0x4188('0x24')](_0x26e750);}})[_0x4188('0x22')](function(){_0x2861e8();})[_0x4188('0x1c')](function(_0x5d8f03){_0x2861e8(_0x5d8f03);});},'afterUpdate':function(_0x37ff80,_0xc14af2,_0x3ff6a8){return _0x53da16['VoiceExtension'][_0x4188('0x25')]({'where':{'ChanSpyId':_0x37ff80['id']}})['then'](function(){return getChanSpyPromise(_0x53da16,_0x37ff80);})[_0x4188('0x22')](function(_0x437662){if(_0x437662&&_0x437662['length']){return _0x53da16[_0x4188('0x23')][_0x4188('0x24')](_0x437662);}})[_0x4188('0x22')](function(){_0x3ff6a8();})[_0x4188('0x1c')](function(_0x2af27a){_0x3ff6a8(_0x2af27a);});},'afterDestroy':function(_0x29acf5,_0x47f0b6,_0x4c6a2d){return _0x53da16[_0x4188('0x23')]['destroy']({'where':{'ChanSpyId':_0x29acf5['id']}})[_0x4188('0x22')](function(){_0x4c6a2d();})[_0x4188('0x1c')](function(_0x1dda32){_0x4c6a2d(_0x1dda32);});}}});}; \ No newline at end of file +var _0x1103=['CDR(type)=%s','chanspy','push','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','merge','Set'];(function(_0x37396d,_0x1218bd){var _0x21f61a=function(_0x3dd8fe){while(--_0x3dd8fe){_0x37396d['push'](_0x37396d['shift']());}};_0x21f61a(++_0x1218bd);}(_0x1103,0x18f));var _0x3110=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1103[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x3110('0x0'));var attributes=require(_0x3110('0x1'));var getUserApplications=function(_0xc620d3,_0x320ebd,_0x4db596){var _0x15d41d=0x1;var _0x120460=[];var _0x560cfd={'context':_0x320ebd[_0x3110('0x2')]||_0x3110('0x3'),'exten':util[_0x3110('0x4')](_0x3110('0x5'),_0xc620d3['prefix'],_0x4db596),'type':_0x3110('0x6'),'isApp':![],'ChanSpyId':_0xc620d3['id'],'UserId':_0x320ebd['id']};_0x120460['push'](_[_0x3110('0x7')]({'app':_0x3110('0x8'),'appdata':util['format'](_0x3110('0x9'),_0x3110('0xa')),'priority':_0x15d41d++},_0x560cfd));if(_0xc620d3['record']){_0x120460[_0x3110('0xb')](_['merge']({'app':'MixMonitor','appdata':util[_0x3110('0x4')]('${UNIQUEID}.%s,a',_0xc620d3[_0x3110('0xc')]),'priority':_0x15d41d++},_0x560cfd));}if(_0xc620d3['auth']){_0x120460[_0x3110('0xb')](_[_0x3110('0x7')]({'app':_0x3110('0xd'),'appdata':_0xc620d3['password'],'priority':_0x15d41d++},_0x560cfd));}_0x120460['push'](_[_0x3110('0x7')]({'app':_0x3110('0xe'),'appdata':util['format'](_0x3110('0xf'),_0x320ebd[_0x3110('0x10')],_0xc620d3[_0x3110('0x11')]?_0xc620d3[_0x3110('0x11')][_0x3110('0x12')](''):''),'priority':_0x15d41d++},_0x560cfd));if(_0xc620d3['record']){_0x120460[_0x3110('0xb')](_['merge']({'app':'StopMixMonitor','priority':_0x15d41d++},_0x560cfd));}return _0x120460;};var getChanSpyApplications=function(_0xd51086,_0xba24a6){var _0x5ea164=[];for(var _0x14554a=0x0,_0x5b6409=0x1;_0x14554a<_0xba24a6[_0x3110('0x13')];_0x14554a++,_0x5b6409=0x1){_0x5ea164=_0x5ea164[_0x3110('0x14')](getUserApplications(_0xd51086,_0xba24a6[_0x14554a],_0xba24a6[_0x14554a][_0x3110('0x15')]));if(_0xba24a6[_0x14554a][_0x3110('0x15')]!=_0xba24a6[_0x14554a][_0x3110('0x10')]){_0x5ea164=_0x5ea164['concat'](getUserApplications(_0xd51086,_0xba24a6[_0x14554a],_0xba24a6[_0x14554a][_0x3110('0x10')]));}}return _0x5ea164;};var getChanSpyPromise=function(_0x488c4b,_0x3f7a32){return new BPromise(function(_0x280fd9,_0x1f32b7){return _0x488c4b[_0x3110('0x16')][_0x3110('0x17')]({'attributes':['id','name',_0x3110('0x15')],'where':{'role':_0x3110('0x18'),'chanspy':!![]},'raw':!![]})[_0x3110('0x19')](function(_0x34e70e){if(_0x34e70e){return _0x280fd9(getChanSpyApplications(_0x3f7a32,_0x34e70e));}return _0x280fd9([]);})[_0x3110('0x1a')](function(_0x27e7ee){_0x1f32b7(_0x27e7ee);});});};module['exports']=function(_0x27a116,_0x4b5ebb){var _0xe37c96=_0x27a116[_0x3110('0x1b')];return _0x27a116[_0x3110('0x1c')](_0x3110('0x1d'),attributes,{'tableName':_0x3110('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3432c1,_0x33bffc,_0x487f8a){return getChanSpyPromise(_0xe37c96,_0x3432c1)['then'](function(_0x125518){if(_0x125518&&_0x125518[_0x3110('0x13')]){return _0xe37c96['VoiceExtension'][_0x3110('0x1f')](_0x125518);}})[_0x3110('0x19')](function(){_0x487f8a();})[_0x3110('0x1a')](function(_0x19e894){_0x487f8a(_0x19e894);});},'afterUpdate':function(_0xe26c2d,_0x531fbc,_0x515b34){return _0xe37c96[_0x3110('0x20')][_0x3110('0x21')]({'where':{'ChanSpyId':_0xe26c2d['id']}})[_0x3110('0x19')](function(){return getChanSpyPromise(_0xe37c96,_0xe26c2d);})[_0x3110('0x19')](function(_0x258480){if(_0x258480&&_0x258480[_0x3110('0x13')]){return _0xe37c96['VoiceExtension'][_0x3110('0x1f')](_0x258480);}})[_0x3110('0x19')](function(){_0x515b34();})[_0x3110('0x1a')](function(_0x55ef49){_0x515b34(_0x55ef49);});},'afterDestroy':function(_0x1b25d9,_0x1fc5be,_0x5dd2a0){return _0xe37c96[_0x3110('0x20')]['destroy']({'where':{'ChanSpyId':_0x1b25d9['id']}})['then'](function(){_0x5dd2a0();})[_0x3110('0x1a')](function(_0x2b578d){_0x5dd2a0(_0x2b578d);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index e73de8a..c1223d6 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 _0x3c81=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x44bb96,_0x1eb410){var _0x496357=function(_0x449f35){while(--_0x449f35){_0x44bb96['push'](_0x44bb96['shift']());}};_0x496357(++_0x1eb410);}(_0x3c81,0x102));var _0x13c8=function(_0x5b9da6,_0x446dd5){_0x5b9da6=_0x5b9da6-0x0;var _0x42e4bc=_0x3c81[_0x5b9da6];return _0x42e4bc;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});} \ No newline at end of file +var _0x5ff3=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x23a3aa,_0x5a7353){var _0x3b4d00=function(_0x5135c4){while(--_0x5135c4){_0x23a3aa['push'](_0x23a3aa['shift']());}};_0x3b4d00(++_0x5a7353);}(_0x5ff3,0x17d));var _0x35ff=function(_0x1e8287,_0x592fed){_0x1e8287=_0x1e8287-0x0;var _0x44bea5=_0x5ff3[_0x1e8287];return _0x44bea5;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 01ad53b..1ccceac 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 _0xd580=['./voiceContext.controller','index','get','/:id','show','post','isAuthenticated','create','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0xd580,0xb6));var _0x0d58=function(_0x1ce951,_0xd20197){_0x1ce951=_0x1ce951-0x0;var _0x7c4efe=_0xd580[_0x1ce951];return _0x7c4efe;};'use strict';var multer=require(_0x0d58('0x0'));var util=require(_0x0d58('0x1'));var path=require(_0x0d58('0x2'));var timeout=require(_0x0d58('0x3'));var express=require('express');var router=express[_0x0d58('0x4')]();var fs_extra=require(_0x0d58('0x5'));var auth=require(_0x0d58('0x6'));var interaction=require(_0x0d58('0x7'));var config=require('../../config/environment');var controller=require(_0x0d58('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d58('0x9')]);router[_0x0d58('0xa')](_0x0d58('0xb'),auth['isAuthenticated'](),controller[_0x0d58('0xc')]);router[_0x0d58('0xd')]('/',auth[_0x0d58('0xe')](),controller[_0x0d58('0xf')]);router[_0x0d58('0x10')](_0x0d58('0xb'),auth[_0x0d58('0xe')](),controller['update']);router['delete'](_0x0d58('0xb'),auth[_0x0d58('0xe')](),controller[_0x0d58('0x11')]);module[_0x0d58('0x12')]=router; \ No newline at end of file +var _0x97fe=['multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0xaadfc3,_0x3732d6){var _0x5e34a2=function(_0x1ad0e5){while(--_0x1ad0e5){_0xaadfc3['push'](_0xaadfc3['shift']());}};_0x5e34a2(++_0x3732d6);}(_0x97fe,0x110));var _0xe97f=function(_0x655d14,_0x391bd5){_0x655d14=_0x655d14-0x0;var _0x499204=_0x97fe[_0x655d14];return _0x499204;};'use strict';var multer=require(_0xe97f('0x0'));var util=require('util');var path=require(_0xe97f('0x1'));var timeout=require('connect-timeout');var express=require(_0xe97f('0x2'));var router=express['Router']();var fs_extra=require(_0xe97f('0x3'));var auth=require(_0xe97f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe97f('0x5'));var controller=require(_0xe97f('0x6'));router[_0xe97f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe97f('0x7')](_0xe97f('0x8'),auth[_0xe97f('0x9')](),controller[_0xe97f('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe97f('0xb')]);router[_0xe97f('0xc')](_0xe97f('0x8'),auth['isAuthenticated'](),controller[_0xe97f('0xd')]);router[_0xe97f('0xe')](_0xe97f('0x8'),auth[_0xe97f('0x9')](),controller[_0xe97f('0xf')]);module[_0xe97f('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7bdc401..bfd6137 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 _0xd995=['name','STRING','BOOLEAN','sequelize'];(function(_0xfbc92e,_0x3a4701){var _0x11261=function(_0x4adb66){while(--_0x4adb66){_0xfbc92e['push'](_0xfbc92e['shift']());}};_0x11261(++_0x3a4701);}(_0xd995,0x18b));var _0x5d99=function(_0x52c45e,_0x48905c){_0x52c45e=_0x52c45e-0x0;var _0x19ce43=_0xd995[_0x52c45e];return _0x19ce43;};'use strict';var Sequelize=require(_0x5d99('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5d99('0x1')},'description':{'type':Sequelize[_0x5d99('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5d99('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb93f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x54f060,_0x1de751){var _0xb2b587=function(_0x3d3bd5){while(--_0x3d3bd5){_0x54f060['push'](_0x54f060['shift']());}};_0xb2b587(++_0x1de751);}(_0xb93f,0x17f));var _0xfb93=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0xb93f[_0x83af7f];return _0x32d85c;};'use strict';var Sequelize=require(_0xfb93('0x0'));module[_0xfb93('0x1')]={'name':{'type':Sequelize[_0xfb93('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xfb93('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xfb93('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 46f7883..1b84fab 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 _0xa07d=['where','VIRTUAL','includeAll','include','findAll','rows','show','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','client','http','request','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge'];(function(_0x45e51c,_0x101620){var _0x5602cc=function(_0x5816fa){while(--_0x5816fa){_0x45e51c['push'](_0x45e51c['shift']());}};_0x5602cc(++_0x101620);}(_0xa07d,0x163));var _0xda07=function(_0x5c1515,_0x5ddc28){_0x5c1515=_0x5c1515-0x0;var _0x31cbf4=_0xa07d[_0x5c1515];return _0x31cbf4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda07('0x0'));var zipdir=require(_0xda07('0x1'));var jsonpatch=require(_0xda07('0x2'));var rp=require('request-promise');var moment=require(_0xda07('0x3'));var BPromise=require(_0xda07('0x4'));var Mustache=require('mustache');var util=require(_0xda07('0x5'));var path=require(_0xda07('0x6'));var sox=require(_0xda07('0x7'));var csv=require(_0xda07('0x8'));var ejs=require(_0xda07('0x9'));var fs=require('fs');var fs_extra=require(_0xda07('0xa'));var _=require(_0xda07('0xb'));var squel=require(_0xda07('0xc'));var crypto=require(_0xda07('0xd'));var jsforce=require(_0xda07('0xe'));var deskjs=require(_0xda07('0xf'));var toCsv=require(_0xda07('0x8'));var querystring=require(_0xda07('0x10'));var Papa=require(_0xda07('0x11'));var Redis=require(_0xda07('0x12'));var authService=require(_0xda07('0x13'));var qs=require(_0xda07('0x14'));var as=require(_0xda07('0x15'));var hardwareService=require(_0xda07('0x16'));var logger=require(_0xda07('0x17'))(_0xda07('0x18'));var utils=require(_0xda07('0x19'));var config=require(_0xda07('0x1a'));var licenseUtil=require(_0xda07('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xda07('0x1c')][_0xda07('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x55a807,_0x113de1,_0x260ed4,_0x25b549){return new BPromise(function(_0x5a1f77,_0x4ccefc){var _0x2fb9c4=_0x25b549||client;return _0x2fb9c4[_0xda07('0x1e')](_0x55a807,_0x260ed4)['then'](function(_0x3c956b){logger['info']('VoiceContext,\x20%s,\x20%s',_0x113de1,_0xda07('0x1f'));logger[_0xda07('0x20')](_0xda07('0x21'),_0x113de1,'request\x20sent',JSON[_0xda07('0x22')](_0x3c956b));if(_0x3c956b[_0xda07('0x23')]){if(_0x3c956b[_0xda07('0x23')]['code']===0x1f4){logger[_0xda07('0x23')](_0xda07('0x24'),_0x113de1,_0x3c956b[_0xda07('0x23')][_0xda07('0x25')]);return _0x4ccefc(_0x3c956b[_0xda07('0x23')][_0xda07('0x25')]);}logger[_0xda07('0x23')](_0xda07('0x24'),_0x113de1,_0x3c956b['error']['message']);return _0x5a1f77(_0x3c956b[_0xda07('0x23')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x113de1,'request\x20sent');_0x5a1f77(_0x3c956b[_0xda07('0x26')][_0xda07('0x25')]);}})[_0xda07('0x27')](function(_0x54dd11){logger[_0xda07('0x23')](_0xda07('0x24'),_0x113de1,_0x54dd11);_0x4ccefc(_0x54dd11);});});}function respondWithStatusCode(_0x44d7be,_0x1f0edb){_0x1f0edb=_0x1f0edb||0xcc;return function(_0x86a8a1){if(_0x86a8a1){return _0x44d7be[_0xda07('0x28')](_0x1f0edb);}return _0x44d7be[_0xda07('0x29')](_0x1f0edb)[_0xda07('0x2a')]();};}function respondWithResult(_0x223597,_0x591fa5){_0x591fa5=_0x591fa5||0xc8;return function(_0x56deff){if(_0x56deff){return _0x223597[_0xda07('0x29')](_0x591fa5)[_0xda07('0x2b')](_0x56deff);}};}function respondWithFilteredResult(_0x14db25,_0x25dbae){return function(_0xc9cde3){if(_0xc9cde3){var _0x4598ae=typeof _0x25dbae[_0xda07('0x2c')]===_0xda07('0x2d')&&typeof _0x25dbae[_0xda07('0x2e')]===_0xda07('0x2d');var _0x2d4804=_0xc9cde3[_0xda07('0x2f')];var _0x41440d=_0x4598ae?0x0:_0x25dbae['offset'];var _0x293f43=_0x4598ae?_0xc9cde3[_0xda07('0x2f')]:_0x25dbae['offset']+_0x25dbae[_0xda07('0x2e')];var _0x1986b2;if(_0x293f43>=_0x2d4804){_0x293f43=_0x2d4804;_0x1986b2=0xc8;}else{_0x1986b2=0xce;}_0x14db25[_0xda07('0x29')](_0x1986b2);return _0x14db25[_0xda07('0x30')](_0xda07('0x31'),_0x41440d+'-'+_0x293f43+'/'+_0x2d4804)[_0xda07('0x2b')](_0xc9cde3);}return null;};}function patchUpdates(_0x31c4e0){return function(_0x381c61){try{jsonpatch[_0xda07('0x32')](_0x381c61,_0x31c4e0,!![]);}catch(_0x3303e9){return BPromise['reject'](_0x3303e9);}return _0x381c61['save']();};}function saveUpdates(_0x4d3940,_0x3c8c9a){return function(_0x2440af){if(_0x2440af){return _0x2440af[_0xda07('0x33')](_0x4d3940)[_0xda07('0x34')](function(_0x43220d){return _0x43220d;});}return null;};}function removeEntity(_0x43b51f,_0x4ad323){return function(_0xb1f977){if(_0xb1f977){return _0xb1f977[_0xda07('0x35')]()[_0xda07('0x34')](function(){var _0x18d471=_0xb1f977[_0xda07('0x36')]({'plain':!![]});var _0x563f68=_0xda07('0x37');return db[_0xda07('0x38')][_0xda07('0x35')]({'where':{'type':_0x563f68,'resourceId':_0x18d471['id']}})[_0xda07('0x34')](function(){return _0xb1f977;});})[_0xda07('0x34')](function(){_0x43b51f[_0xda07('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ed5d2,_0x351c61){return function(_0x353f78){if(!_0x353f78){_0x5ed5d2[_0xda07('0x28')](0x194);}return _0x353f78;};}function handleError(_0x399d5e,_0x3f3cf4){_0x3f3cf4=_0x3f3cf4||0x1f4;return function(_0x1127e6){logger[_0xda07('0x23')](_0x1127e6[_0xda07('0x39')]);if(_0x1127e6['name']){delete _0x1127e6[_0xda07('0x3a')];}_0x399d5e[_0xda07('0x29')](_0x3f3cf4)[_0xda07('0x3b')](_0x1127e6);};}exports['index']=function(_0xfbf2ec,_0x4280b6){var _0x3a5ed1={},_0x4959ab={},_0x574f18={'count':0x0,'rows':[]};var _0x543d64=_[_0xda07('0x3c')](db[_0xda07('0x3d')][_0xda07('0x3e')],function(_0x1e6fa2){return{'name':_0x1e6fa2[_0xda07('0x3f')],'type':_0x1e6fa2[_0xda07('0x40')][_0xda07('0x41')]};});_0x4959ab[_0xda07('0x42')]=_[_0xda07('0x3c')](_0x543d64,'name');_0x4959ab[_0xda07('0x43')]=_[_0xda07('0x44')](_0xfbf2ec[_0xda07('0x43')]);_0x4959ab['filters']=_[_0xda07('0x45')](_0x4959ab[_0xda07('0x42')],_0x4959ab['query']);_0x3a5ed1[_0xda07('0x46')]=_[_0xda07('0x45')](_0x4959ab[_0xda07('0x42')],qs[_0xda07('0x47')](_0xfbf2ec['query'][_0xda07('0x47')]));_0x3a5ed1[_0xda07('0x46')]=_0x3a5ed1['attributes'][_0xda07('0x48')]?_0x3a5ed1[_0xda07('0x46')]:_0x4959ab[_0xda07('0x42')];if(!_0xfbf2ec[_0xda07('0x43')][_0xda07('0x49')](_0xda07('0x4a'))){_0x3a5ed1[_0xda07('0x2e')]=qs[_0xda07('0x2e')](_0xfbf2ec['query'][_0xda07('0x2e')]);_0x3a5ed1[_0xda07('0x2c')]=qs['offset'](_0xfbf2ec[_0xda07('0x43')]['offset']);}_0x3a5ed1[_0xda07('0x4b')]=qs[_0xda07('0x4c')](_0xfbf2ec[_0xda07('0x43')][_0xda07('0x4c')]);_0x3a5ed1['where']=qs[_0xda07('0x4d')](_[_0xda07('0x4e')](_0xfbf2ec['query'],_0x4959ab['filters']),_0x543d64);if(_0xfbf2ec[_0xda07('0x43')][_0xda07('0x4f')]){_0x3a5ed1['where']=_[_0xda07('0x50')](_0x3a5ed1[_0xda07('0x51')],{'$or':_['map'](_0x543d64,function(_0x68f9e2){if(_0x68f9e2['type']!==_0xda07('0x52')){var _0x4bb837={};_0x4bb837[_0x68f9e2['name']]={'$like':'%'+_0xfbf2ec[_0xda07('0x43')][_0xda07('0x4f')]+'%'};return _0x4bb837;}})});}_0x3a5ed1=_[_0xda07('0x50')]({},_0x3a5ed1,_0xfbf2ec['options']);var _0x2b57b2={'where':_0x3a5ed1[_0xda07('0x51')]};return db[_0xda07('0x3d')]['count'](_0x2b57b2)['then'](function(_0x53b0d0){_0x574f18['count']=_0x53b0d0;if(_0xfbf2ec['query'][_0xda07('0x53')]){_0x3a5ed1[_0xda07('0x54')]=[{'all':!![]}];}return db[_0xda07('0x3d')][_0xda07('0x55')](_0x3a5ed1);})[_0xda07('0x34')](function(_0x572024){_0x574f18[_0xda07('0x56')]=_0x572024;return _0x574f18;})[_0xda07('0x34')](respondWithFilteredResult(_0x4280b6,_0x3a5ed1))[_0xda07('0x27')](handleError(_0x4280b6,null));};exports[_0xda07('0x57')]=function(_0x704eea,_0xb13d){var _0x294629={'raw':![],'where':{'id':_0x704eea['params']['id']}},_0x283de7={};_0x283de7['model']=_[_0xda07('0x44')](db[_0xda07('0x3d')][_0xda07('0x3e')]);_0x283de7[_0xda07('0x43')]=_['keys'](_0x704eea[_0xda07('0x43')]);_0x283de7[_0xda07('0x4d')]=_[_0xda07('0x45')](_0x283de7[_0xda07('0x42')],_0x283de7[_0xda07('0x43')]);_0x294629[_0xda07('0x46')]=_[_0xda07('0x45')](_0x283de7[_0xda07('0x42')],qs[_0xda07('0x47')](_0x704eea[_0xda07('0x43')]['fields']));_0x294629[_0xda07('0x46')]=_0x294629[_0xda07('0x46')][_0xda07('0x48')]?_0x294629[_0xda07('0x46')]:_0x283de7[_0xda07('0x42')];if(_0x704eea[_0xda07('0x43')][_0xda07('0x53')]){_0x294629['include']=[{'all':!![]}];}_0x294629=_[_0xda07('0x50')]({},_0x294629,_0x704eea[_0xda07('0x58')]);return db[_0xda07('0x3d')][_0xda07('0x59')](_0x294629)[_0xda07('0x34')](handleEntityNotFound(_0xb13d,null))[_0xda07('0x34')](respondWithResult(_0xb13d,null))[_0xda07('0x27')](handleError(_0xb13d,null));};exports[_0xda07('0x5a')]=function(_0x31767c,_0x48ce9f,_0x34af03){var _0x1adc2a;return db['VoiceContext']['create'](_0x31767c[_0xda07('0x5b')],{'raw':!![]})[_0xda07('0x34')](function(_0x561590){_0x1adc2a=_0x561590;return db[_0xda07('0x3d')][_0xda07('0x55')]({'raw':!![]});})[_0xda07('0x34')](function(_0x1bc20e){var _0x346f52=fs[_0xda07('0x5c')](path[_0xda07('0x5d')](config[_0xda07('0x5e')],_0xda07('0x5f')),'utf8');var _0x2fa7f9=ejs[_0xda07('0x60')](_0x346f52,{'contexts':_0x1bc20e||[]});fs[_0xda07('0x61')](_0xda07('0x62'),_0x2fa7f9);})['then'](function(){return respondWithRpcPromise(_0xda07('0x63'),'create',{'module':_0xda07('0x64')});})[_0xda07('0x34')](function(){var _0x3fa278=_0x31767c[_0xda07('0x65')]['get']({'plain':!![]});if(!_0x3fa278)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fa278[_0xda07('0x66')]===_0xda07('0x65')){var _0x2d49ab=_0x1adc2a[_0xda07('0x36')]({'plain':!![]});return db[_0xda07('0x67')][_0xda07('0x59')]({'where':{'name':'Contexts','userProfileId':_0x3fa278[_0xda07('0x68')]},'raw':!![]})[_0xda07('0x34')](function(_0x1fde00){if(_0x1fde00&&_0x1fde00[_0xda07('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d49ab[_0xda07('0x3a')],'resourceId':_0x2d49ab['id'],'type':_0x1fde00[_0xda07('0x3a')],'sectionId':_0x1fde00['id']},{})[_0xda07('0x34')](function(){return _0x1adc2a;});}else{return _0x1adc2a;}})[_0xda07('0x27')](function(_0x2519eb){logger[_0xda07('0x23')](_0xda07('0x6a'),_0x2519eb);throw _0x2519eb;});}return _0x1adc2a;})['then'](respondWithResult(_0x48ce9f,0xc9))[_0xda07('0x27')](handleError(_0x48ce9f,null));};exports[_0xda07('0x33')]=function(_0x559b9b,_0xb6c71a,_0x30f28b){var _0x57123a;return db[_0xda07('0x3d')][_0xda07('0x59')]({'where':{'id':_0x559b9b['params']['id']}})[_0xda07('0x34')](handleEntityNotFound(_0xb6c71a,null))[_0xda07('0x34')](saveUpdates(_0x559b9b[_0xda07('0x5b')],null))['then'](function(_0x48065d){if(_0x48065d){_0x57123a=_0x48065d;return db[_0xda07('0x3d')][_0xda07('0x55')]({'raw':!![]});}})['then'](function(_0x2ee813){var _0x4d4c09=fs[_0xda07('0x5c')](path[_0xda07('0x5d')](config[_0xda07('0x5e')],_0xda07('0x5f')),_0xda07('0x6b'));var _0x3fe05c=ejs[_0xda07('0x60')](_0x4d4c09,{'contexts':_0x2ee813||[]});fs[_0xda07('0x61')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3fe05c);})[_0xda07('0x34')](function(){return respondWithRpcPromise(_0xda07('0x63'),'update',{'module':_0xda07('0x64')});})['then'](function(){return _0x57123a;})[_0xda07('0x34')](respondWithResult(_0xb6c71a,null))['catch'](handleError(_0xb6c71a,null));};exports[_0xda07('0x35')]=function(_0xabfb70,_0x34fdc2,_0x5defeb){var _0x4b9869;return db[_0xda07('0x3d')]['find']({'where':{'id':_0xabfb70[_0xda07('0x6c')]['id']}})['then'](handleEntityNotFound(_0x34fdc2,null))[_0xda07('0x34')](removeEntity(_0x34fdc2,null))[_0xda07('0x34')](function(){return db[_0xda07('0x3d')][_0xda07('0x55')]({'raw':!![]});})['then'](function(_0x1cd6f2){var _0x59760e=fs['readFileSync'](path[_0xda07('0x5d')](config[_0xda07('0x5e')],_0xda07('0x5f')),_0xda07('0x6b'));var _0x362b20=ejs[_0xda07('0x60')](_0x59760e,{'contexts':_0x1cd6f2});fs[_0xda07('0x61')](_0xda07('0x62'),_0x362b20);return respondWithRpcPromise(_0xda07('0x63'),_0xda07('0x35'),{'module':_0xda07('0x64')});})['catch'](handleError(_0x34fdc2,null));}; \ No newline at end of file +var _0xa73a=['show','include','create','body','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','role','UserProfileSection','find','Contexts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','readFileSync','join','render','chan_sip.so','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','sendStatus','status','end','json','undefined','offset','set','Content-Range','apply','save','destroy','get','stack','name','send','index','map','VoiceContext','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','catch'];(function(_0x4eb6e8,_0x247ce5){var _0x444f69=function(_0x23aa4d){while(--_0x23aa4d){_0x4eb6e8['push'](_0x4eb6e8['shift']());}};_0x444f69(++_0x247ce5);}(_0xa73a,0x82));var _0xaa73=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0xa73a[_0x34b6aa];return _0x3ead29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa73('0x0'));var zipdir=require(_0xaa73('0x1'));var jsonpatch=require(_0xaa73('0x2'));var rp=require(_0xaa73('0x3'));var moment=require(_0xaa73('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xaa73('0x5'));var sox=require(_0xaa73('0x6'));var csv=require(_0xaa73('0x7'));var ejs=require(_0xaa73('0x8'));var fs=require('fs');var fs_extra=require(_0xaa73('0x9'));var _=require(_0xaa73('0xa'));var squel=require(_0xaa73('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa73('0xc'));var toCsv=require(_0xaa73('0x7'));var querystring=require(_0xaa73('0xd'));var Papa=require(_0xaa73('0xe'));var Redis=require(_0xaa73('0xf'));var authService=require(_0xaa73('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa73('0x11'));var logger=require('../../config/logger')(_0xaa73('0x12'));var utils=require('../../config/utils');var config=require(_0xaa73('0x13'));var licenseUtil=require(_0xaa73('0x14'));var db=require(_0xaa73('0x15'))['db'];var jayson=require(_0xaa73('0x16'));var client=jayson[_0xaa73('0x17')][_0xaa73('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5e3bba,_0x2d1c07,_0x167db5,_0x29128f){return new BPromise(function(_0x457922,_0xc4a8e){var _0x319e55=_0x29128f||client;return _0x319e55[_0xaa73('0x19')](_0x5e3bba,_0x167db5)[_0xaa73('0x1a')](function(_0x339c82){logger['info'](_0xaa73('0x1b'),_0x2d1c07,'request\x20sent');logger[_0xaa73('0x1c')](_0xaa73('0x1d'),_0x2d1c07,_0xaa73('0x1e'),JSON['stringify'](_0x339c82));if(_0x339c82['error']){if(_0x339c82[_0xaa73('0x1f')]['code']===0x1f4){logger[_0xaa73('0x1f')](_0xaa73('0x1b'),_0x2d1c07,_0x339c82['error'][_0xaa73('0x20')]);return _0xc4a8e(_0x339c82[_0xaa73('0x1f')][_0xaa73('0x20')]);}logger[_0xaa73('0x1f')](_0xaa73('0x1b'),_0x2d1c07,_0x339c82[_0xaa73('0x1f')]['message']);return _0x457922(_0x339c82[_0xaa73('0x1f')]['message']);}else{logger[_0xaa73('0x21')](_0xaa73('0x1b'),_0x2d1c07,_0xaa73('0x1e'));_0x457922(_0x339c82[_0xaa73('0x22')]['message']);}})['catch'](function(_0x5303eb){logger[_0xaa73('0x1f')](_0xaa73('0x1b'),_0x2d1c07,_0x5303eb);_0xc4a8e(_0x5303eb);});});}function respondWithStatusCode(_0x2d7798,_0x346d57){_0x346d57=_0x346d57||0xcc;return function(_0x482795){if(_0x482795){return _0x2d7798[_0xaa73('0x23')](_0x346d57);}return _0x2d7798[_0xaa73('0x24')](_0x346d57)[_0xaa73('0x25')]();};}function respondWithResult(_0x4bdd4e,_0x3cae16){_0x3cae16=_0x3cae16||0xc8;return function(_0x88731){if(_0x88731){return _0x4bdd4e[_0xaa73('0x24')](_0x3cae16)[_0xaa73('0x26')](_0x88731);}};}function respondWithFilteredResult(_0x3af228,_0x1253aa){return function(_0x1ed112){if(_0x1ed112){var _0x3ab19f=typeof _0x1253aa['offset']==='undefined'&&typeof _0x1253aa['limit']===_0xaa73('0x27');var _0x562f01=_0x1ed112['count'];var _0x5617da=_0x3ab19f?0x0:_0x1253aa[_0xaa73('0x28')];var _0x344e31=_0x3ab19f?_0x1ed112['count']:_0x1253aa['offset']+_0x1253aa['limit'];var _0x35e714;if(_0x344e31>=_0x562f01){_0x344e31=_0x562f01;_0x35e714=0xc8;}else{_0x35e714=0xce;}_0x3af228[_0xaa73('0x24')](_0x35e714);return _0x3af228[_0xaa73('0x29')](_0xaa73('0x2a'),_0x5617da+'-'+_0x344e31+'/'+_0x562f01)['json'](_0x1ed112);}return null;};}function patchUpdates(_0x33d0a9){return function(_0x56b782){try{jsonpatch[_0xaa73('0x2b')](_0x56b782,_0x33d0a9,!![]);}catch(_0x5abf26){return BPromise['reject'](_0x5abf26);}return _0x56b782[_0xaa73('0x2c')]();};}function saveUpdates(_0x4e3e15,_0x71f997){return function(_0x99fac7){if(_0x99fac7){return _0x99fac7['update'](_0x4e3e15)[_0xaa73('0x1a')](function(_0x10deee){return _0x10deee;});}return null;};}function removeEntity(_0x30c22f,_0xa005dd){return function(_0xd6e953){if(_0xd6e953){return _0xd6e953[_0xaa73('0x2d')]()[_0xaa73('0x1a')](function(){var _0xd24899=_0xd6e953[_0xaa73('0x2e')]({'plain':!![]});var _0x54089f='Contexts';return db['UserProfileResource'][_0xaa73('0x2d')]({'where':{'type':_0x54089f,'resourceId':_0xd24899['id']}})[_0xaa73('0x1a')](function(){return _0xd6e953;});})[_0xaa73('0x1a')](function(){_0x30c22f[_0xaa73('0x24')](0xcc)[_0xaa73('0x25')]();});}};}function handleEntityNotFound(_0x3423bd,_0x418a54){return function(_0x3bc667){if(!_0x3bc667){_0x3423bd[_0xaa73('0x23')](0x194);}return _0x3bc667;};}function handleError(_0x317c9e,_0x582ee7){_0x582ee7=_0x582ee7||0x1f4;return function(_0x562e90){logger[_0xaa73('0x1f')](_0x562e90[_0xaa73('0x2f')]);if(_0x562e90[_0xaa73('0x30')]){delete _0x562e90[_0xaa73('0x30')];}_0x317c9e[_0xaa73('0x24')](_0x582ee7)[_0xaa73('0x31')](_0x562e90);};}exports[_0xaa73('0x32')]=function(_0x183992,_0x490417){var _0x25cb02={},_0x3099d0={},_0x1199b6={'count':0x0,'rows':[]};var _0x32e4d0=_[_0xaa73('0x33')](db[_0xaa73('0x34')]['rawAttributes'],function(_0x448f8c){return{'name':_0x448f8c[_0xaa73('0x35')],'type':_0x448f8c[_0xaa73('0x36')][_0xaa73('0x37')]};});_0x3099d0['model']=_[_0xaa73('0x33')](_0x32e4d0,'name');_0x3099d0['query']=_[_0xaa73('0x38')](_0x183992[_0xaa73('0x39')]);_0x3099d0['filters']=_['intersection'](_0x3099d0['model'],_0x3099d0['query']);_0x25cb02[_0xaa73('0x3a')]=_[_0xaa73('0x3b')](_0x3099d0[_0xaa73('0x3c')],qs[_0xaa73('0x3d')](_0x183992['query'][_0xaa73('0x3d')]));_0x25cb02[_0xaa73('0x3a')]=_0x25cb02[_0xaa73('0x3a')][_0xaa73('0x3e')]?_0x25cb02[_0xaa73('0x3a')]:_0x3099d0['model'];if(!_0x183992[_0xaa73('0x39')][_0xaa73('0x3f')](_0xaa73('0x40'))){_0x25cb02['limit']=qs[_0xaa73('0x41')](_0x183992[_0xaa73('0x39')][_0xaa73('0x41')]);_0x25cb02[_0xaa73('0x28')]=qs[_0xaa73('0x28')](_0x183992[_0xaa73('0x39')][_0xaa73('0x28')]);}_0x25cb02[_0xaa73('0x42')]=qs['sort'](_0x183992[_0xaa73('0x39')][_0xaa73('0x43')]);_0x25cb02[_0xaa73('0x44')]=qs[_0xaa73('0x45')](_[_0xaa73('0x46')](_0x183992[_0xaa73('0x39')],_0x3099d0[_0xaa73('0x45')]),_0x32e4d0);if(_0x183992['query']['filter']){_0x25cb02[_0xaa73('0x44')]=_[_0xaa73('0x47')](_0x25cb02[_0xaa73('0x44')],{'$or':_[_0xaa73('0x33')](_0x32e4d0,function(_0x726844){if(_0x726844['type']!==_0xaa73('0x48')){var _0x33b5d7={};_0x33b5d7[_0x726844[_0xaa73('0x30')]]={'$like':'%'+_0x183992[_0xaa73('0x39')][_0xaa73('0x49')]+'%'};return _0x33b5d7;}})});}_0x25cb02=_[_0xaa73('0x47')]({},_0x25cb02,_0x183992[_0xaa73('0x4a')]);var _0x31841f={'where':_0x25cb02['where']};return db[_0xaa73('0x34')][_0xaa73('0x4b')](_0x31841f)['then'](function(_0x5d9a5b){_0x1199b6[_0xaa73('0x4b')]=_0x5d9a5b;if(_0x183992['query'][_0xaa73('0x4c')]){_0x25cb02['include']=[{'all':!![]}];}return db['VoiceContext'][_0xaa73('0x4d')](_0x25cb02);})[_0xaa73('0x1a')](function(_0x2dd8e0){_0x1199b6[_0xaa73('0x4e')]=_0x2dd8e0;return _0x1199b6;})[_0xaa73('0x1a')](respondWithFilteredResult(_0x490417,_0x25cb02))[_0xaa73('0x4f')](handleError(_0x490417,null));};exports[_0xaa73('0x50')]=function(_0x443c4a,_0x58edd5){var _0x40ba57={'raw':![],'where':{'id':_0x443c4a['params']['id']}},_0xff5109={};_0xff5109[_0xaa73('0x3c')]=_[_0xaa73('0x38')](db[_0xaa73('0x34')]['rawAttributes']);_0xff5109['query']=_['keys'](_0x443c4a[_0xaa73('0x39')]);_0xff5109['filters']=_['intersection'](_0xff5109[_0xaa73('0x3c')],_0xff5109['query']);_0x40ba57[_0xaa73('0x3a')]=_['intersection'](_0xff5109['model'],qs[_0xaa73('0x3d')](_0x443c4a['query'][_0xaa73('0x3d')]));_0x40ba57[_0xaa73('0x3a')]=_0x40ba57[_0xaa73('0x3a')][_0xaa73('0x3e')]?_0x40ba57['attributes']:_0xff5109[_0xaa73('0x3c')];if(_0x443c4a[_0xaa73('0x39')]['includeAll']){_0x40ba57[_0xaa73('0x51')]=[{'all':!![]}];}_0x40ba57=_[_0xaa73('0x47')]({},_0x40ba57,_0x443c4a[_0xaa73('0x4a')]);return db[_0xaa73('0x34')]['find'](_0x40ba57)[_0xaa73('0x1a')](handleEntityNotFound(_0x58edd5,null))[_0xaa73('0x1a')](respondWithResult(_0x58edd5,null))['catch'](handleError(_0x58edd5,null));};exports['create']=function(_0x33258c,_0x28c65d,_0x3433fc){var _0x2b2fa2;return db[_0xaa73('0x34')][_0xaa73('0x52')](_0x33258c[_0xaa73('0x53')],{'raw':!![]})[_0xaa73('0x1a')](function(_0x512617){_0x2b2fa2=_0x512617;return db[_0xaa73('0x34')][_0xaa73('0x4d')]({'raw':!![]});})[_0xaa73('0x1a')](function(_0x2965ac){var _0x47b46b=fs['readFileSync'](path['join'](config[_0xaa73('0x54')],_0xaa73('0x55')),_0xaa73('0x56'));var _0x2aef71=ejs['render'](_0x47b46b,{'contexts':_0x2965ac||[]});fs[_0xaa73('0x57')](_0xaa73('0x58'),_0x2aef71);})[_0xaa73('0x1a')](function(){return respondWithRpcPromise(_0xaa73('0x59'),'create',{'module':'chan_sip.so'});})[_0xaa73('0x1a')](function(){var _0x314c5e=_0x33258c[_0xaa73('0x5a')][_0xaa73('0x2e')]({'plain':!![]});if(!_0x314c5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x314c5e[_0xaa73('0x5b')]===_0xaa73('0x5a')){var _0x1ba8b8=_0x2b2fa2[_0xaa73('0x2e')]({'plain':!![]});return db[_0xaa73('0x5c')][_0xaa73('0x5d')]({'where':{'name':_0xaa73('0x5e'),'userProfileId':_0x314c5e[_0xaa73('0x5f')]},'raw':!![]})[_0xaa73('0x1a')](function(_0xfbd4a1){if(_0xfbd4a1&&_0xfbd4a1[_0xaa73('0x60')]===0x0){return db[_0xaa73('0x61')][_0xaa73('0x52')]({'name':_0x1ba8b8[_0xaa73('0x30')],'resourceId':_0x1ba8b8['id'],'type':_0xfbd4a1[_0xaa73('0x30')],'sectionId':_0xfbd4a1['id']},{})[_0xaa73('0x1a')](function(){return _0x2b2fa2;});}else{return _0x2b2fa2;}})[_0xaa73('0x4f')](function(_0x4fdebf){logger[_0xaa73('0x1f')](_0xaa73('0x62'),_0x4fdebf);throw _0x4fdebf;});}return _0x2b2fa2;})[_0xaa73('0x1a')](respondWithResult(_0x28c65d,0xc9))['catch'](handleError(_0x28c65d,null));};exports[_0xaa73('0x63')]=function(_0x5e84d5,_0x58c65e,_0x6a7bd6){var _0x545342;return db[_0xaa73('0x34')][_0xaa73('0x5d')]({'where':{'id':_0x5e84d5[_0xaa73('0x64')]['id']}})['then'](handleEntityNotFound(_0x58c65e,null))[_0xaa73('0x1a')](saveUpdates(_0x5e84d5[_0xaa73('0x53')],null))[_0xaa73('0x1a')](function(_0x2f139f){if(_0x2f139f){_0x545342=_0x2f139f;return db[_0xaa73('0x34')][_0xaa73('0x4d')]({'raw':!![]});}})[_0xaa73('0x1a')](function(_0x313cc7){var _0xe0e414=fs[_0xaa73('0x65')](path[_0xaa73('0x66')](config[_0xaa73('0x54')],_0xaa73('0x55')),'utf8');var _0x418d04=ejs[_0xaa73('0x67')](_0xe0e414,{'contexts':_0x313cc7||[]});fs[_0xaa73('0x57')](_0xaa73('0x58'),_0x418d04);})[_0xaa73('0x1a')](function(){return respondWithRpcPromise('Reload',_0xaa73('0x63'),{'module':_0xaa73('0x68')});})[_0xaa73('0x1a')](function(){return _0x545342;})[_0xaa73('0x1a')](respondWithResult(_0x58c65e,null))[_0xaa73('0x4f')](handleError(_0x58c65e,null));};exports['destroy']=function(_0x2237c2,_0x2a54cc,_0x524eb7){var _0x39c12f;return db[_0xaa73('0x34')][_0xaa73('0x5d')]({'where':{'id':_0x2237c2[_0xaa73('0x64')]['id']}})['then'](handleEntityNotFound(_0x2a54cc,null))[_0xaa73('0x1a')](removeEntity(_0x2a54cc,null))[_0xaa73('0x1a')](function(){return db[_0xaa73('0x34')][_0xaa73('0x4d')]({'raw':!![]});})[_0xaa73('0x1a')](function(_0x3c686e){var _0x54b4ad=fs[_0xaa73('0x65')](path[_0xaa73('0x66')](config['root'],'server/files/templates/context.ejs'),_0xaa73('0x56'));var _0x548266=ejs[_0xaa73('0x67')](_0x54b4ad,{'contexts':_0x3c686e});fs[_0xaa73('0x57')](_0xaa73('0x58'),_0x548266);return respondWithRpcPromise('Reload',_0xaa73('0x2d'),{'module':_0xaa73('0x68')});})['catch'](handleError(_0x2a54cc,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 99b464d..aa9455d 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 _0x46b7=['./voiceContext.attributes','exports','define','VoiceContext','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x46b7,0xa9));var _0x746b=function(_0x44979a,_0x1a272f){_0x44979a=_0x44979a-0x0;var _0x3043c8=_0x46b7[_0x44979a];return _0x3043c8;};'use strict';var _=require('lodash');var util=require(_0x746b('0x0'));var logger=require(_0x746b('0x1'))(_0x746b('0x2'));var moment=require(_0x746b('0x3'));var BPromise=require('bluebird');var rp=require(_0x746b('0x4'));var fs=require('fs');var path=require(_0x746b('0x5'));var rimraf=require(_0x746b('0x6'));var config=require('../../config/environment');var attributes=require(_0x746b('0x7'));module[_0x746b('0x8')]=function(_0x167839,_0x50b09e){return _0x167839[_0x746b('0x9')](_0x746b('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3264=['voice_contexts','util','../../config/logger','api','moment','path','./voiceContext.attributes','exports','VoiceContext'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x3264,0x7f));var _0x4326=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3264[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x4326('0x0'));var logger=require(_0x4326('0x1'))(_0x4326('0x2'));var moment=require(_0x4326('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4326('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4326('0x5'));module[_0x4326('0x6')]=function(_0xed0465,_0x3f8d4e){return _0xed0465['define'](_0x4326('0x7'),attributes,{'tableName':_0x4326('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 5437825..0f7b47a 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 _0x32e7=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x32e7,0xc3));var _0x732e=function(_0x248522,_0x3469f6){_0x248522=_0x248522-0x0;var _0x86cd6c=_0x32e7[_0x248522];return _0x86cd6c;};'use strict';var _=require(_0x732e('0x0'));var util=require('util');var moment=require(_0x732e('0x1'));var BPromise=require(_0x732e('0x2'));var rs=require(_0x732e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x732e('0x4'))['db'];var utils=require(_0x732e('0x5'));var logger=require(_0x732e('0x6'))(_0x732e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x732e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a36ff,_0x31b795,_0x540cdd){return new BPromise(function(_0x18a450,_0x404613){return client[_0x732e('0x9')](_0x1a36ff,_0x540cdd)['then'](function(_0x3f2748){logger['info'](_0x732e('0xa'),_0x31b795,_0x732e('0xb'));logger[_0x732e('0xc')](_0x732e('0xd'),_0x31b795,_0x732e('0xb'),JSON['stringify'](_0x3f2748));if(_0x3f2748[_0x732e('0xe')]){if(_0x3f2748[_0x732e('0xe')][_0x732e('0xf')]===0x1f4){logger[_0x732e('0xe')]('VoiceContext,\x20%s,\x20%s',_0x31b795,_0x3f2748[_0x732e('0xe')][_0x732e('0x10')]);return _0x404613(_0x3f2748[_0x732e('0xe')]['message']);}logger[_0x732e('0xe')]('VoiceContext,\x20%s,\x20%s',_0x31b795,_0x3f2748[_0x732e('0xe')]['message']);return _0x18a450(_0x3f2748[_0x732e('0xe')]['message']);}else{logger['info'](_0x732e('0xa'),_0x31b795,_0x732e('0xb'));_0x18a450(_0x3f2748[_0x732e('0x11')][_0x732e('0x10')]);}})[_0x732e('0x12')](function(_0x21ea0d){logger[_0x732e('0xe')](_0x732e('0xa'),_0x31b795,_0x21ea0d);_0x404613(_0x21ea0d);});});} \ No newline at end of file +var _0xdca3=['code','message','VoiceContext,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e457c,_0x407259){var _0x3d07e6=function(_0x246a41){while(--_0x246a41){_0x1e457c['push'](_0x1e457c['shift']());}};_0x3d07e6(++_0x407259);}(_0xdca3,0x64));var _0x3dca=function(_0x3de558,_0x428d3a){_0x3de558=_0x3de558-0x0;var _0x18a2cc=_0xdca3[_0x3de558];return _0x18a2cc;};'use strict';var _=require(_0x3dca('0x0'));var util=require('util');var moment=require(_0x3dca('0x1'));var BPromise=require(_0x3dca('0x2'));var rs=require(_0x3dca('0x3'));var fs=require('fs');var Redis=require(_0x3dca('0x4'));var db=require(_0x3dca('0x5'))['db'];var utils=require(_0x3dca('0x6'));var logger=require(_0x3dca('0x7'))(_0x3dca('0x8'));var config=require(_0x3dca('0x9'));var jayson=require(_0x3dca('0xa'));var client=jayson[_0x3dca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4234a1,_0x5d52c3,_0x57264a){return new BPromise(function(_0xdea879,_0x576218){return client[_0x3dca('0xc')](_0x4234a1,_0x57264a)[_0x3dca('0xd')](function(_0x123b66){logger[_0x3dca('0xe')]('VoiceContext,\x20%s,\x20%s',_0x5d52c3,_0x3dca('0xf'));logger[_0x3dca('0x10')](_0x3dca('0x11'),_0x5d52c3,_0x3dca('0xf'),JSON[_0x3dca('0x12')](_0x123b66));if(_0x123b66[_0x3dca('0x13')]){if(_0x123b66['error'][_0x3dca('0x14')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5d52c3,_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);return _0x576218(_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);}logger[_0x3dca('0x13')](_0x3dca('0x16'),_0x5d52c3,_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);return _0xdea879(_0x123b66[_0x3dca('0x13')][_0x3dca('0x15')]);}else{logger[_0x3dca('0xe')](_0x3dca('0x16'),_0x5d52c3,_0x3dca('0xf'));_0xdea879(_0x123b66['result']['message']);}})[_0x3dca('0x17')](function(_0xb5b508){logger[_0x3dca('0x13')](_0x3dca('0x16'),_0x5d52c3,_0xb5b508);_0x576218(_0xb5b508);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5820d15..b1a34ba 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 _0x927d=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x10373b,_0x2652e2){var _0x14e483=function(_0x5bbccf){while(--_0x5bbccf){_0x10373b['push'](_0x10373b['shift']());}};_0x14e483(++_0x2652e2);}(_0x927d,0x115));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd927('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd927('0x1'));var router=express[_0xd927('0x2')]();var fs_extra=require(_0xd927('0x3'));var auth=require(_0xd927('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd927('0x5'));var controller=require(_0xd927('0x6'));router[_0xd927('0x7')]('/',auth[_0xd927('0x8')](),controller[_0xd927('0x9')]);router[_0xd927('0x7')](_0xd927('0xa'),auth[_0xd927('0x8')](),controller[_0xd927('0xb')]);router[_0xd927('0x7')](_0xd927('0xc'),auth['isAuthenticated'](),controller[_0xd927('0xd')]);router['post']('/',auth[_0xd927('0x8')](),controller[_0xd927('0xe')]);router[_0xd927('0xf')]('/:id',auth[_0xd927('0x8')](),controller[_0xd927('0x10')]);router['delete'](_0xd927('0xc'),auth[_0xd927('0x8')](),controller[_0xd927('0x11')]);module[_0xd927('0x12')]=router; \ No newline at end of file +var _0xda65=['/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xda65,0x1d0));var _0x5da6=function(_0x487aa0,_0x116e9a){_0x487aa0=_0x487aa0-0x0;var _0x14f931=_0xda65[_0x487aa0];return _0x14f931;};'use strict';var multer=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var path=require(_0x5da6('0x2'));var timeout=require('connect-timeout');var express=require(_0x5da6('0x3'));var router=express[_0x5da6('0x4')]();var fs_extra=require(_0x5da6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5da6('0x6'));var controller=require(_0x5da6('0x7'));router[_0x5da6('0x8')]('/',auth[_0x5da6('0x9')](),controller[_0x5da6('0xa')]);router['get'](_0x5da6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x5da6('0x8')]('/:id',auth[_0x5da6('0x9')](),controller[_0x5da6('0xc')]);router[_0x5da6('0xd')]('/',auth[_0x5da6('0x9')](),controller[_0x5da6('0xe')]);router[_0x5da6('0xf')](_0x5da6('0x10'),auth[_0x5da6('0x9')](),controller['update']);router[_0x5da6('0x11')](_0x5da6('0x10'),auth[_0x5da6('0x9')](),controller[_0x5da6('0x12')]);module[_0x5da6('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a356380..8e5ce39 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 _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x4b9a62,_0x528ba3){var _0x45c582=function(_0x596041){while(--_0x596041){_0x4b9a62['push'](_0x4b9a62['shift']());}};_0x45c582(++_0x528ba3);}(_0x81bd,0x7c));var _0xd81b=function(_0x4c207b,_0x59f530){_0x4c207b=_0x4c207b-0x0;var _0x560c4f=_0x81bd[_0x4c207b];return _0x560c4f;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x27ece,_0x5dd680){var _0x33320a=function(_0x54a088){while(--_0x54a088){_0x27ece['push'](_0x27ece['shift']());}};_0x33320a(++_0x5dd680);}(_0x425d,0x1e0));var _0xd425=function(_0x1a42bc,_0x34a88c){_0x1a42bc=_0x1a42bc-0x0;var _0x33fd2b=_0x425d[_0x1a42bc];return _0x33fd2b;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x2')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize[_0xd425('0x1')]},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x2')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'destlinkedid':{'type':Sequelize[_0xd425('0x1')]},'dialstring':{'type':Sequelize[_0xd425('0x1')]},'dialstatus':{'type':Sequelize[_0xd425('0x1')]},'starttime':{'type':Sequelize[_0xd425('0x3')]},'answertime':{'type':Sequelize[_0xd425('0x3')]},'endtime':{'type':Sequelize[_0xd425('0x3')]},'lastevent':{'type':Sequelize[_0xd425('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd425('0x2')]},'duration':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x2')]},'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 eff3896..5d584ee 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 _0x5ac2=['status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end'];(function(_0x4c5f1d,_0x5218bd){var _0x2087f9=function(_0x3d4b73){while(--_0x3d4b73){_0x4c5f1d['push'](_0x4c5f1d['shift']());}};_0x2087f9(++_0x5218bd);}(_0x5ac2,0x78));var _0x25ac=function(_0x980b33,_0x5112ad){_0x980b33=_0x980b33-0x0;var _0xb872d0=_0x5ac2[_0x980b33];return _0xb872d0;};'use strict';var emlformat=require(_0x25ac('0x0'));var rimraf=require(_0x25ac('0x1'));var zipdir=require(_0x25ac('0x2'));var jsonpatch=require(_0x25ac('0x3'));var rp=require('request-promise');var moment=require(_0x25ac('0x4'));var BPromise=require(_0x25ac('0x5'));var Mustache=require(_0x25ac('0x6'));var util=require(_0x25ac('0x7'));var path=require(_0x25ac('0x8'));var sox=require(_0x25ac('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25ac('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x25ac('0xb'));var jsforce=require(_0x25ac('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x25ac('0xd'));var querystring=require(_0x25ac('0xe'));var Papa=require(_0x25ac('0xf'));var Redis=require(_0x25ac('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x25ac('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x25ac('0x12'))(_0x25ac('0x13'));var utils=require(_0x25ac('0x14'));var config=require(_0x25ac('0x15'));var licenseUtil=require(_0x25ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1323eb,_0x461237){_0x461237=_0x461237||0xcc;return function(_0x5fe9b9){if(_0x5fe9b9){return _0x1323eb['sendStatus'](_0x461237);}return _0x1323eb['status'](_0x461237)[_0x25ac('0x17')]();};}function respondWithResult(_0x7b7991,_0x4b19ff){_0x4b19ff=_0x4b19ff||0xc8;return function(_0x4bb6cf){if(_0x4bb6cf){return _0x7b7991[_0x25ac('0x18')](_0x4b19ff)[_0x25ac('0x19')](_0x4bb6cf);}};}function respondWithFilteredResult(_0x16cf2b,_0x151084){return function(_0x19ad31){if(_0x19ad31){var _0x5b3fd9=typeof _0x151084['offset']===_0x25ac('0x1a')&&typeof _0x151084[_0x25ac('0x1b')]==='undefined';var _0xc1aed6=_0x19ad31['count'];var _0x2162fd=_0x5b3fd9?0x0:_0x151084[_0x25ac('0x1c')];var _0x5314b8=_0x5b3fd9?_0x19ad31[_0x25ac('0x1d')]:_0x151084[_0x25ac('0x1c')]+_0x151084[_0x25ac('0x1b')];var _0x5958aa;if(_0x5314b8>=_0xc1aed6){_0x5314b8=_0xc1aed6;_0x5958aa=0xc8;}else{_0x5958aa=0xce;}_0x16cf2b[_0x25ac('0x18')](_0x5958aa);return _0x16cf2b[_0x25ac('0x1e')](_0x25ac('0x1f'),_0x2162fd+'-'+_0x5314b8+'/'+_0xc1aed6)['json'](_0x19ad31);}return null;};}function patchUpdates(_0x279b2c){return function(_0x436827){try{jsonpatch[_0x25ac('0x20')](_0x436827,_0x279b2c,!![]);}catch(_0x31b017){return BPromise[_0x25ac('0x21')](_0x31b017);}return _0x436827['save']();};}function saveUpdates(_0x547d7b,_0x105e05){return function(_0x2c7fcd){if(_0x2c7fcd){return _0x2c7fcd[_0x25ac('0x22')](_0x547d7b)['then'](function(_0x5af34a){return _0x5af34a;});}return null;};}function removeEntity(_0x496573,_0x2b8fb9){return function(_0x5d8a48){if(_0x5d8a48){return _0x5d8a48[_0x25ac('0x23')]()[_0x25ac('0x24')](function(){_0x496573[_0x25ac('0x18')](0xcc)[_0x25ac('0x17')]();});}};}function handleEntityNotFound(_0x138f75,_0x3db6ee){return function(_0x18813b){if(!_0x18813b){_0x138f75[_0x25ac('0x25')](0x194);}return _0x18813b;};}function handleError(_0x483b2a,_0x5b316b){_0x5b316b=_0x5b316b||0x1f4;return function(_0x2ca656){logger[_0x25ac('0x26')](_0x2ca656[_0x25ac('0x27')]);if(_0x2ca656[_0x25ac('0x28')]){delete _0x2ca656['name'];}_0x483b2a[_0x25ac('0x18')](_0x5b316b)[_0x25ac('0x29')](_0x2ca656);};}exports['index']=function(_0x3b418e,_0x3e72db){var _0x17b854={},_0xda57b3={},_0x152645={'count':0x0,'rows':[]};var _0x390278=_['map'](db[_0x25ac('0x2a')][_0x25ac('0x2b')],function(_0x399c22){return{'name':_0x399c22[_0x25ac('0x2c')],'type':_0x399c22[_0x25ac('0x2d')][_0x25ac('0x2e')]};});_0xda57b3[_0x25ac('0x2f')]=_[_0x25ac('0x30')](_0x390278,'name');_0xda57b3['query']=_[_0x25ac('0x31')](_0x3b418e[_0x25ac('0x32')]);_0xda57b3[_0x25ac('0x33')]=_[_0x25ac('0x34')](_0xda57b3[_0x25ac('0x2f')],_0xda57b3[_0x25ac('0x32')]);_0x17b854[_0x25ac('0x35')]=_[_0x25ac('0x34')](_0xda57b3[_0x25ac('0x2f')],qs[_0x25ac('0x36')](_0x3b418e[_0x25ac('0x32')][_0x25ac('0x36')]));_0x17b854[_0x25ac('0x35')]=_0x17b854[_0x25ac('0x35')][_0x25ac('0x37')]?_0x17b854[_0x25ac('0x35')]:_0xda57b3[_0x25ac('0x2f')];if(!_0x3b418e[_0x25ac('0x32')][_0x25ac('0x38')](_0x25ac('0x39'))){_0x17b854[_0x25ac('0x1b')]=qs[_0x25ac('0x1b')](_0x3b418e[_0x25ac('0x32')][_0x25ac('0x1b')]);_0x17b854[_0x25ac('0x1c')]=qs[_0x25ac('0x1c')](_0x3b418e['query'][_0x25ac('0x1c')]);}_0x17b854[_0x25ac('0x3a')]=qs['sort'](_0x3b418e[_0x25ac('0x32')][_0x25ac('0x3b')]);_0x17b854[_0x25ac('0x3c')]=qs[_0x25ac('0x33')](_[_0x25ac('0x3d')](_0x3b418e[_0x25ac('0x32')],_0xda57b3[_0x25ac('0x33')]),_0x390278);if(_0x3b418e[_0x25ac('0x32')][_0x25ac('0x3e')]){_0x17b854[_0x25ac('0x3c')]=_[_0x25ac('0x3f')](_0x17b854[_0x25ac('0x3c')],{'$or':_['map'](_0x390278,function(_0x2407b2){if(_0x2407b2['type']!==_0x25ac('0x40')){var _0x17f8b0={};_0x17f8b0[_0x2407b2[_0x25ac('0x28')]]={'$like':'%'+_0x3b418e[_0x25ac('0x32')][_0x25ac('0x3e')]+'%'};return _0x17f8b0;}})});}_0x17b854=_['merge']({},_0x17b854,_0x3b418e[_0x25ac('0x41')]);var _0x10dfdb={'where':_0x17b854[_0x25ac('0x3c')]};return db[_0x25ac('0x2a')][_0x25ac('0x1d')](_0x10dfdb)[_0x25ac('0x24')](function(_0x50ecae){_0x152645[_0x25ac('0x1d')]=_0x50ecae;if(_0x3b418e['query'][_0x25ac('0x42')]){_0x17b854[_0x25ac('0x43')]=[{'all':!![]}];}return db[_0x25ac('0x2a')]['findAll'](_0x17b854);})[_0x25ac('0x24')](function(_0x8fecfd){_0x152645['rows']=_0x8fecfd;return _0x152645;})['then'](respondWithFilteredResult(_0x3e72db,_0x17b854))[_0x25ac('0x44')](handleError(_0x3e72db,null));};exports['show']=function(_0x3de235,_0x5e5de6){var _0x7fe343={'raw':!![],'where':{'id':_0x3de235[_0x25ac('0x45')]['id']}},_0x4997ac={};_0x4997ac[_0x25ac('0x2f')]=_[_0x25ac('0x31')](db[_0x25ac('0x2a')][_0x25ac('0x2b')]);_0x4997ac[_0x25ac('0x32')]=_['keys'](_0x3de235[_0x25ac('0x32')]);_0x4997ac[_0x25ac('0x33')]=_[_0x25ac('0x34')](_0x4997ac['model'],_0x4997ac['query']);_0x7fe343[_0x25ac('0x35')]=_[_0x25ac('0x34')](_0x4997ac['model'],qs['fields'](_0x3de235['query']['fields']));_0x7fe343['attributes']=_0x7fe343[_0x25ac('0x35')][_0x25ac('0x37')]?_0x7fe343[_0x25ac('0x35')]:_0x4997ac[_0x25ac('0x2f')];if(_0x3de235[_0x25ac('0x32')][_0x25ac('0x42')]){_0x7fe343['include']=[{'all':!![]}];}_0x7fe343=_['merge']({},_0x7fe343,_0x3de235[_0x25ac('0x41')]);return db[_0x25ac('0x2a')]['find'](_0x7fe343)[_0x25ac('0x24')](handleEntityNotFound(_0x5e5de6,null))[_0x25ac('0x24')](respondWithResult(_0x5e5de6,null))[_0x25ac('0x44')](handleError(_0x5e5de6,null));};exports[_0x25ac('0x46')]=function(_0x22a21b,_0x967624){return db[_0x25ac('0x2a')][_0x25ac('0x46')](_0x22a21b[_0x25ac('0x47')],{})[_0x25ac('0x24')](respondWithResult(_0x967624,0xc9))['catch'](handleError(_0x967624,null));};exports['update']=function(_0x47f881,_0x8ca0ef){if(_0x47f881[_0x25ac('0x47')]['id']){delete _0x47f881['body']['id'];}return db[_0x25ac('0x2a')]['find']({'where':{'id':_0x47f881[_0x25ac('0x45')]['id']}})[_0x25ac('0x24')](handleEntityNotFound(_0x8ca0ef,null))[_0x25ac('0x24')](saveUpdates(_0x47f881['body'],null))['then'](respondWithResult(_0x8ca0ef,null))[_0x25ac('0x44')](handleError(_0x8ca0ef,null));};exports[_0x25ac('0x23')]=function(_0x311581,_0x2c376a){return db['VoiceDialReport']['find']({'where':{'id':_0x311581[_0x25ac('0x45')]['id']}})[_0x25ac('0x24')](handleEntityNotFound(_0x2c376a,null))[_0x25ac('0x24')](removeEntity(_0x2c376a,null))[_0x25ac('0x44')](handleError(_0x2c376a,null));};exports['describe']=function(_0x453c8a,_0x206379){return db[_0x25ac('0x2a')]['describe']()[_0x25ac('0x24')](respondWithResult(_0x206379,null))['catch'](handleError(_0x206379,null));}; \ No newline at end of file +var _0xc73a=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2f7636,_0x3c7201){var _0x226919=function(_0x32ca70){while(--_0x32ca70){_0x2f7636['push'](_0x2f7636['shift']());}};_0x226919(++_0x3c7201);}(_0xc73a,0x7f));var _0xac73=function(_0x41aefa,_0x5eed6f){_0x41aefa=_0x41aefa-0x0;var _0x3aa2c7=_0xc73a[_0x41aefa];return _0x3aa2c7;};'use strict';var emlformat=require(_0xac73('0x0'));var rimraf=require(_0xac73('0x1'));var zipdir=require(_0xac73('0x2'));var jsonpatch=require(_0xac73('0x3'));var rp=require(_0xac73('0x4'));var moment=require(_0xac73('0x5'));var BPromise=require(_0xac73('0x6'));var Mustache=require(_0xac73('0x7'));var util=require(_0xac73('0x8'));var path=require('path');var sox=require(_0xac73('0x9'));var csv=require(_0xac73('0xa'));var ejs=require(_0xac73('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac73('0xc'));var squel=require('squel');var crypto=require(_0xac73('0xd'));var jsforce=require(_0xac73('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xac73('0xa'));var querystring=require(_0xac73('0xf'));var Papa=require(_0xac73('0x10'));var Redis=require(_0xac73('0x11'));var authService=require(_0xac73('0x12'));var qs=require(_0xac73('0x13'));var as=require(_0xac73('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac73('0x15'))(_0xac73('0x16'));var utils=require(_0xac73('0x17'));var config=require(_0xac73('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xac73('0x19'))['db'];function respondWithStatusCode(_0x40a605,_0x2cdd15){_0x2cdd15=_0x2cdd15||0xcc;return function(_0x456f98){if(_0x456f98){return _0x40a605['sendStatus'](_0x2cdd15);}return _0x40a605['status'](_0x2cdd15)[_0xac73('0x1a')]();};}function respondWithResult(_0x2b4345,_0x569f6d){_0x569f6d=_0x569f6d||0xc8;return function(_0x4723a1){if(_0x4723a1){return _0x2b4345[_0xac73('0x1b')](_0x569f6d)[_0xac73('0x1c')](_0x4723a1);}};}function respondWithFilteredResult(_0x68fabe,_0x198b2c){return function(_0x2d5bb7){if(_0x2d5bb7){var _0x3ee3f7=typeof _0x198b2c[_0xac73('0x1d')]===_0xac73('0x1e')&&typeof _0x198b2c[_0xac73('0x1f')]==='undefined';var _0x374f05=_0x2d5bb7[_0xac73('0x20')];var _0x254b7d=_0x3ee3f7?0x0:_0x198b2c[_0xac73('0x1d')];var _0xa9346c=_0x3ee3f7?_0x2d5bb7[_0xac73('0x20')]:_0x198b2c[_0xac73('0x1d')]+_0x198b2c[_0xac73('0x1f')];var _0x522025;if(_0xa9346c>=_0x374f05){_0xa9346c=_0x374f05;_0x522025=0xc8;}else{_0x522025=0xce;}_0x68fabe['status'](_0x522025);return _0x68fabe[_0xac73('0x21')](_0xac73('0x22'),_0x254b7d+'-'+_0xa9346c+'/'+_0x374f05)[_0xac73('0x1c')](_0x2d5bb7);}return null;};}function patchUpdates(_0x575159){return function(_0x4f905e){try{jsonpatch[_0xac73('0x23')](_0x4f905e,_0x575159,!![]);}catch(_0x28d935){return BPromise[_0xac73('0x24')](_0x28d935);}return _0x4f905e['save']();};}function saveUpdates(_0x3e1008,_0x33a326){return function(_0x56aab0){if(_0x56aab0){return _0x56aab0[_0xac73('0x25')](_0x3e1008)['then'](function(_0x4c0f38){return _0x4c0f38;});}return null;};}function removeEntity(_0x109b67,_0x3f900f){return function(_0x29b294){if(_0x29b294){return _0x29b294[_0xac73('0x26')]()[_0xac73('0x27')](function(){_0x109b67['status'](0xcc)[_0xac73('0x1a')]();});}};}function handleEntityNotFound(_0x346e7c,_0x26854b){return function(_0x1fc4a6){if(!_0x1fc4a6){_0x346e7c['sendStatus'](0x194);}return _0x1fc4a6;};}function handleError(_0x18806e,_0x208ed4){_0x208ed4=_0x208ed4||0x1f4;return function(_0x735ca7){logger[_0xac73('0x28')](_0x735ca7[_0xac73('0x29')]);if(_0x735ca7[_0xac73('0x2a')]){delete _0x735ca7[_0xac73('0x2a')];}_0x18806e[_0xac73('0x1b')](_0x208ed4)[_0xac73('0x2b')](_0x735ca7);};}exports[_0xac73('0x2c')]=function(_0xdc608a,_0x2bb8ec){var _0x4b18dc={},_0x47b3d7={},_0x5680bf={'count':0x0,'rows':[]};var _0x4cbb8d=_[_0xac73('0x2d')](db[_0xac73('0x2e')][_0xac73('0x2f')],function(_0x1ac1a8){return{'name':_0x1ac1a8[_0xac73('0x30')],'type':_0x1ac1a8['type']['key']};});_0x47b3d7[_0xac73('0x31')]=_[_0xac73('0x2d')](_0x4cbb8d,_0xac73('0x2a'));_0x47b3d7[_0xac73('0x32')]=_[_0xac73('0x33')](_0xdc608a[_0xac73('0x32')]);_0x47b3d7[_0xac73('0x34')]=_[_0xac73('0x35')](_0x47b3d7[_0xac73('0x31')],_0x47b3d7['query']);_0x4b18dc[_0xac73('0x36')]=_['intersection'](_0x47b3d7['model'],qs[_0xac73('0x37')](_0xdc608a['query']['fields']));_0x4b18dc[_0xac73('0x36')]=_0x4b18dc['attributes'][_0xac73('0x38')]?_0x4b18dc[_0xac73('0x36')]:_0x47b3d7[_0xac73('0x31')];if(!_0xdc608a['query']['hasOwnProperty'](_0xac73('0x39'))){_0x4b18dc['limit']=qs[_0xac73('0x1f')](_0xdc608a[_0xac73('0x32')]['limit']);_0x4b18dc['offset']=qs['offset'](_0xdc608a['query'][_0xac73('0x1d')]);}_0x4b18dc[_0xac73('0x3a')]=qs[_0xac73('0x3b')](_0xdc608a[_0xac73('0x32')]['sort']);_0x4b18dc[_0xac73('0x3c')]=qs[_0xac73('0x34')](_[_0xac73('0x3d')](_0xdc608a[_0xac73('0x32')],_0x47b3d7[_0xac73('0x34')]),_0x4cbb8d);if(_0xdc608a[_0xac73('0x32')][_0xac73('0x3e')]){_0x4b18dc[_0xac73('0x3c')]=_['merge'](_0x4b18dc[_0xac73('0x3c')],{'$or':_['map'](_0x4cbb8d,function(_0x5dcb92){if(_0x5dcb92[_0xac73('0x3f')]!==_0xac73('0x40')){var _0x1cd25b={};_0x1cd25b[_0x5dcb92[_0xac73('0x2a')]]={'$like':'%'+_0xdc608a[_0xac73('0x32')]['filter']+'%'};return _0x1cd25b;}})});}_0x4b18dc=_[_0xac73('0x41')]({},_0x4b18dc,_0xdc608a[_0xac73('0x42')]);var _0x3e0845={'where':_0x4b18dc[_0xac73('0x3c')]};return db[_0xac73('0x2e')][_0xac73('0x20')](_0x3e0845)[_0xac73('0x27')](function(_0x37b248){_0x5680bf[_0xac73('0x20')]=_0x37b248;if(_0xdc608a[_0xac73('0x32')][_0xac73('0x43')]){_0x4b18dc['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x4b18dc);})[_0xac73('0x27')](function(_0x4338f1){_0x5680bf[_0xac73('0x44')]=_0x4338f1;return _0x5680bf;})[_0xac73('0x27')](respondWithFilteredResult(_0x2bb8ec,_0x4b18dc))[_0xac73('0x45')](handleError(_0x2bb8ec,null));};exports[_0xac73('0x46')]=function(_0x10c270,_0x5ebbaa){var _0x3e52ac={'raw':!![],'where':{'id':_0x10c270[_0xac73('0x47')]['id']}},_0x55b0fc={};_0x55b0fc[_0xac73('0x31')]=_['keys'](db[_0xac73('0x2e')][_0xac73('0x2f')]);_0x55b0fc['query']=_[_0xac73('0x33')](_0x10c270[_0xac73('0x32')]);_0x55b0fc[_0xac73('0x34')]=_[_0xac73('0x35')](_0x55b0fc[_0xac73('0x31')],_0x55b0fc[_0xac73('0x32')]);_0x3e52ac[_0xac73('0x36')]=_[_0xac73('0x35')](_0x55b0fc[_0xac73('0x31')],qs[_0xac73('0x37')](_0x10c270[_0xac73('0x32')][_0xac73('0x37')]));_0x3e52ac[_0xac73('0x36')]=_0x3e52ac[_0xac73('0x36')][_0xac73('0x38')]?_0x3e52ac[_0xac73('0x36')]:_0x55b0fc[_0xac73('0x31')];if(_0x10c270[_0xac73('0x32')][_0xac73('0x43')]){_0x3e52ac['include']=[{'all':!![]}];}_0x3e52ac=_[_0xac73('0x41')]({},_0x3e52ac,_0x10c270['options']);return db['VoiceDialReport']['find'](_0x3e52ac)['then'](handleEntityNotFound(_0x5ebbaa,null))[_0xac73('0x27')](respondWithResult(_0x5ebbaa,null))[_0xac73('0x45')](handleError(_0x5ebbaa,null));};exports[_0xac73('0x48')]=function(_0x5046d6,_0x228be2){return db['VoiceDialReport'][_0xac73('0x48')](_0x5046d6[_0xac73('0x49')],{})[_0xac73('0x27')](respondWithResult(_0x228be2,0xc9))[_0xac73('0x45')](handleError(_0x228be2,null));};exports[_0xac73('0x25')]=function(_0xcbfad8,_0xdce454){if(_0xcbfad8[_0xac73('0x49')]['id']){delete _0xcbfad8[_0xac73('0x49')]['id'];}return db['VoiceDialReport'][_0xac73('0x4a')]({'where':{'id':_0xcbfad8[_0xac73('0x47')]['id']}})['then'](handleEntityNotFound(_0xdce454,null))['then'](saveUpdates(_0xcbfad8[_0xac73('0x49')],null))['then'](respondWithResult(_0xdce454,null))[_0xac73('0x45')](handleError(_0xdce454,null));};exports['destroy']=function(_0x1fac28,_0x2fca53){return db[_0xac73('0x2e')][_0xac73('0x4a')]({'where':{'id':_0x1fac28[_0xac73('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fca53,null))[_0xac73('0x27')](removeEntity(_0x2fca53,null))[_0xac73('0x45')](handleError(_0x2fca53,null));};exports[_0xac73('0x4b')]=function(_0x4ddf13,_0x55a535){return db[_0xac73('0x2e')][_0xac73('0x4b')]()[_0xac73('0x27')](respondWithResult(_0x55a535,null))['catch'](handleError(_0x55a535,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index a63a8ea..26ff39c 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 _0xb555=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x3480c6,_0xd0c489){var _0x58260e=function(_0x5ae675){while(--_0x5ae675){_0x3480c6['push'](_0x3480c6['shift']());}};_0x58260e(++_0xd0c489);}(_0xb555,0xe5));var _0x5b55=function(_0x3065d5,_0x4eae8a){_0x3065d5=_0x3065d5-0x0;var _0x2056a5=_0xb555[_0x3065d5];return _0x2056a5;};'use strict';var _=require(_0x5b55('0x0'));var util=require(_0x5b55('0x1'));var logger=require(_0x5b55('0x2'))(_0x5b55('0x3'));var moment=require('moment');var BPromise=require(_0x5b55('0x4'));var rp=require(_0x5b55('0x5'));var fs=require('fs');var path=require(_0x5b55('0x6'));var rimraf=require(_0x5b55('0x7'));var config=require(_0x5b55('0x8'));var attributes=require(_0x5b55('0x9'));module[_0x5b55('0xa')]=function(_0x4f5e7e,_0xd91c38){return _0x4f5e7e[_0x5b55('0xb')](_0x5b55('0xc'),attributes,{'tableName':_0x5b55('0xd'),'paranoid':![],'indexes':[{'fields':[_0x5b55('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5887=['request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x316889,_0x1ed910){var _0x3f9a5f=function(_0xaffd61){while(--_0xaffd61){_0x316889['push'](_0x316889['shift']());}};_0x3f9a5f(++_0x1ed910);}(_0x5887,0x12e));var _0x7588=function(_0x4dbc5d,_0x2d0a51){_0x4dbc5d=_0x4dbc5d-0x0;var _0x45b461=_0x5887[_0x4dbc5d];return _0x45b461;};'use strict';var _=require(_0x7588('0x0'));var util=require(_0x7588('0x1'));var logger=require(_0x7588('0x2'))(_0x7588('0x3'));var moment=require(_0x7588('0x4'));var BPromise=require(_0x7588('0x5'));var rp=require(_0x7588('0x6'));var fs=require('fs');var path=require(_0x7588('0x7'));var rimraf=require('rimraf');var config=require(_0x7588('0x8'));var attributes=require(_0x7588('0x9'));module['exports']=function(_0x2bb028,_0x3c359d){return _0x2bb028[_0x7588('0xa')](_0x7588('0xb'),attributes,{'tableName':_0x7588('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7588('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index fcab637..a180f08 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 _0xbb62=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','update','body','attributes'];(function(_0x55591c,_0x1e3d34){var _0x9dbed5=function(_0x340b1f){while(--_0x340b1f){_0x55591c['push'](_0x55591c['shift']());}};_0x9dbed5(++_0x1e3d34);}(_0xbb62,0xd3));var _0x2bb6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbb62[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x2bb6('0x0'));var util=require(_0x2bb6('0x1'));var moment=require(_0x2bb6('0x2'));var BPromise=require(_0x2bb6('0x3'));var rs=require(_0x2bb6('0x4'));var fs=require('fs');var Redis=require(_0x2bb6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bb6('0x6'));var logger=require(_0x2bb6('0x7'))(_0x2bb6('0x8'));var config=require(_0x2bb6('0x9'));var jayson=require(_0x2bb6('0xa'));var client=jayson[_0x2bb6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x480582,_0x19e225,_0x1ef2d4){return new BPromise(function(_0x312302,_0x2f0897){return client[_0x2bb6('0xc')](_0x480582,_0x1ef2d4)[_0x2bb6('0xd')](function(_0x257ab9){logger[_0x2bb6('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x19e225,'request\x20sent');logger[_0x2bb6('0xf')](_0x2bb6('0x10'),_0x19e225,_0x2bb6('0x11'),JSON[_0x2bb6('0x12')](_0x257ab9));if(_0x257ab9[_0x2bb6('0x13')]){if(_0x257ab9['error'][_0x2bb6('0x14')]===0x1f4){logger[_0x2bb6('0x13')](_0x2bb6('0x15'),_0x19e225,_0x257ab9[_0x2bb6('0x13')][_0x2bb6('0x16')]);return _0x2f0897(_0x257ab9[_0x2bb6('0x13')]['message']);}logger[_0x2bb6('0x13')](_0x2bb6('0x15'),_0x19e225,_0x257ab9[_0x2bb6('0x13')]['message']);return _0x312302(_0x257ab9['error'][_0x2bb6('0x16')]);}else{logger['info'](_0x2bb6('0x15'),_0x19e225,'request\x20sent');_0x312302(_0x257ab9[_0x2bb6('0x17')]['message']);}})[_0x2bb6('0x18')](function(_0x9b7b35){logger[_0x2bb6('0x13')](_0x2bb6('0x15'),_0x19e225,_0x9b7b35);_0x2f0897(_0x9b7b35);});});}exports[_0x2bb6('0x19')]=function(_0x367b09){var _0x5b9446=this;return new Promise(function(_0x12b1fb,_0xe4d662){return db[_0x2bb6('0x1a')][_0x2bb6('0x1b')](_0x367b09['body'],{'raw':_0x367b09[_0x2bb6('0x1c')]?_0x367b09[_0x2bb6('0x1c')][_0x2bb6('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x33d2e1){logger[_0x2bb6('0xe')](_0x2bb6('0x19'),_0x367b09);logger[_0x2bb6('0xf')](_0x2bb6('0x19'),_0x367b09,JSON[_0x2bb6('0x12')](_0x33d2e1));_0x12b1fb(_0x33d2e1);})[_0x2bb6('0x18')](function(_0x42d26e){logger['error'](_0x2bb6('0x19'),_0x42d26e['message'],_0x367b09);_0xe4d662(_0x5b9446[_0x2bb6('0x13')](0x1f4,_0x42d26e[_0x2bb6('0x16')]));});});};exports[_0x2bb6('0x1e')]=function(_0x19b0cc){var _0x4aac53=this;return new Promise(function(_0x4d665f,_0x57f7d1){return db[_0x2bb6('0x1a')][_0x2bb6('0x1f')](_0x19b0cc[_0x2bb6('0x20')],{'raw':_0x19b0cc['options']?_0x19b0cc[_0x2bb6('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19b0cc[_0x2bb6('0x1c')]?_0x19b0cc[_0x2bb6('0x1c')]['where']||null:null,'attributes':_0x19b0cc[_0x2bb6('0x1c')]?_0x19b0cc[_0x2bb6('0x1c')][_0x2bb6('0x21')]||null:null,'limit':_0x19b0cc[_0x2bb6('0x1c')]?_0x19b0cc['options'][_0x2bb6('0x22')]||null:null})[_0x2bb6('0xd')](function(_0x5a9d53){logger['info'](_0x2bb6('0x1e'),_0x19b0cc);logger[_0x2bb6('0xf')](_0x2bb6('0x1e'),_0x19b0cc,JSON[_0x2bb6('0x12')](_0x5a9d53));_0x4d665f(_0x5a9d53);})[_0x2bb6('0x18')](function(_0x195d4e){logger['error']('UpdateVoiceDialReport',_0x195d4e['message'],_0x19b0cc);_0x57f7d1(_0x4aac53['error'](0x1f4,_0x195d4e[_0x2bb6('0x16')]));});});}; \ No newline at end of file +var _0xe348=['VoiceDialReport','create','body','options','raw','debug','UpdateVoiceDialReport','where','limit','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport'];(function(_0x5a11b1,_0xd7d141){var _0x57996d=function(_0x41ab10){while(--_0x41ab10){_0x5a11b1['push'](_0x5a11b1['shift']());}};_0x57996d(++_0xd7d141);}(_0xe348,0xbe));var _0x8e34=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xe348[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var moment=require(_0x8e34('0x2'));var BPromise=require(_0x8e34('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e34('0x4'));var logger=require(_0x8e34('0x5'))(_0x8e34('0x6'));var config=require(_0x8e34('0x7'));var jayson=require(_0x8e34('0x8'));var client=jayson[_0x8e34('0x9')][_0x8e34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f9792,_0x4cf24f,_0x13d292){return new BPromise(function(_0x52224f,_0x3c23e3){return client['request'](_0x4f9792,_0x13d292)['then'](function(_0x326a26){logger[_0x8e34('0xb')](_0x8e34('0xc'),_0x4cf24f,_0x8e34('0xd'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4cf24f,_0x8e34('0xd'),JSON[_0x8e34('0xe')](_0x326a26));if(_0x326a26['error']){if(_0x326a26['error']['code']===0x1f4){logger[_0x8e34('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x4cf24f,_0x326a26['error'][_0x8e34('0x10')]);return _0x3c23e3(_0x326a26['error'][_0x8e34('0x10')]);}logger[_0x8e34('0xf')](_0x8e34('0xc'),_0x4cf24f,_0x326a26[_0x8e34('0xf')][_0x8e34('0x10')]);return _0x52224f(_0x326a26[_0x8e34('0xf')][_0x8e34('0x10')]);}else{logger[_0x8e34('0xb')](_0x8e34('0xc'),_0x4cf24f,_0x8e34('0xd'));_0x52224f(_0x326a26[_0x8e34('0x11')][_0x8e34('0x10')]);}})[_0x8e34('0x12')](function(_0x2e1a12){logger[_0x8e34('0xf')](_0x8e34('0xc'),_0x4cf24f,_0x2e1a12);_0x3c23e3(_0x2e1a12);});});}exports[_0x8e34('0x13')]=function(_0x5136ed){var _0x21bb9f=this;return new Promise(function(_0x98c578,_0x5b54eb){return db[_0x8e34('0x14')][_0x8e34('0x15')](_0x5136ed[_0x8e34('0x16')],{'raw':_0x5136ed[_0x8e34('0x17')]?_0x5136ed[_0x8e34('0x17')][_0x8e34('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x551633){logger[_0x8e34('0xb')](_0x8e34('0x13'),_0x5136ed);logger[_0x8e34('0x19')]('CreateVoiceDialReport',_0x5136ed,JSON[_0x8e34('0xe')](_0x551633));_0x98c578(_0x551633);})['catch'](function(_0x2fbc3a){logger[_0x8e34('0xf')](_0x8e34('0x13'),_0x2fbc3a['message'],_0x5136ed);_0x5b54eb(_0x21bb9f[_0x8e34('0xf')](0x1f4,_0x2fbc3a['message']));});});};exports[_0x8e34('0x1a')]=function(_0x43e92c){var _0x3004a2=this;return new Promise(function(_0x189324,_0x42d396){return db[_0x8e34('0x14')]['update'](_0x43e92c[_0x8e34('0x16')],{'raw':_0x43e92c[_0x8e34('0x17')]?_0x43e92c[_0x8e34('0x17')][_0x8e34('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e92c[_0x8e34('0x17')]?_0x43e92c[_0x8e34('0x17')][_0x8e34('0x1b')]||null:null,'attributes':_0x43e92c[_0x8e34('0x17')]?_0x43e92c[_0x8e34('0x17')]['attributes']||null:null,'limit':_0x43e92c['options']?_0x43e92c[_0x8e34('0x17')][_0x8e34('0x1c')]||null:null})[_0x8e34('0x1d')](function(_0x6dde45){logger[_0x8e34('0xb')]('UpdateVoiceDialReport',_0x43e92c);logger[_0x8e34('0x19')](_0x8e34('0x1a'),_0x43e92c,JSON['stringify'](_0x6dde45));_0x189324(_0x6dde45);})[_0x8e34('0x12')](function(_0x2a8a79){logger[_0x8e34('0xf')](_0x8e34('0x1a'),_0x2a8a79[_0x8e34('0x10')],_0x43e92c);_0x42d396(_0x3004a2['error'](0x1f4,_0x2a8a79[_0x8e34('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 6d405e8..f305133 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 _0xe374=['/:id/applications','addApplications','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../config/environment','get','isAuthenticated','show','post','create'];(function(_0x270030,_0x464fea){var _0x17918f=function(_0x4fa819){while(--_0x4fa819){_0x270030['push'](_0x270030['shift']());}};_0x17918f(++_0x464fea);}(_0xe374,0x1ca));var _0x4e37=function(_0x3462e2,_0x1c8060){_0x3462e2=_0x3462e2-0x0;var _0x3cc675=_0xe374[_0x3462e2];return _0x3cc675;};'use strict';var multer=require(_0x4e37('0x0'));var util=require(_0x4e37('0x1'));var path=require('path');var timeout=require(_0x4e37('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4e37('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e37('0x4'));var controller=require('./voiceExtension.controller');router[_0x4e37('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4e37('0x5')]('/:id',auth[_0x4e37('0x6')](),controller[_0x4e37('0x7')]);router[_0x4e37('0x8')]('/',auth[_0x4e37('0x6')](),controller[_0x4e37('0x9')]);router['post'](_0x4e37('0xa'),auth[_0x4e37('0x6')](),controller[_0x4e37('0xb')]);router[_0x4e37('0xc')](_0x4e37('0xd'),auth['isAuthenticated'](),controller[_0x4e37('0xe')]);router[_0x4e37('0xf')](_0x4e37('0xd'),auth[_0x4e37('0x6')](),controller[_0x4e37('0x10')]);module[_0x4e37('0x11')]=router; \ No newline at end of file +var _0x2484=['/:id/applications','addApplications','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x2484,0x75));var _0x4248=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x2484[_0x3e961c];return _0x474f9c;};'use strict';var multer=require('multer');var util=require(_0x4248('0x0'));var path=require(_0x4248('0x1'));var timeout=require(_0x4248('0x2'));var express=require(_0x4248('0x3'));var router=express[_0x4248('0x4')]();var fs_extra=require(_0x4248('0x5'));var auth=require(_0x4248('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4248('0x7'));var controller=require('./voiceExtension.controller');router[_0x4248('0x8')]('/',auth['isAuthenticated'](),controller[_0x4248('0x9')]);router['get'](_0x4248('0xa'),auth[_0x4248('0xb')](),controller[_0x4248('0xc')]);router[_0x4248('0xd')]('/',auth[_0x4248('0xb')](),controller[_0x4248('0xe')]);router[_0x4248('0xd')](_0x4248('0xf'),auth[_0x4248('0xb')](),controller[_0x4248('0x10')]);router[_0x4248('0x11')]('/:id',auth[_0x4248('0xb')](),controller[_0x4248('0x12')]);router[_0x4248('0x13')](_0x4248('0xa'),auth[_0x4248('0xb')](),controller[_0x4248('0x14')]);module[_0x4248('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c13aa05..d00fd94 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 _0x8015=['BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8015,0x16c));var _0x5801=function(_0x1592e9,_0x5f1b71){_0x1592e9=_0x1592e9-0x0;var _0x23402e=_0x8015[_0x1592e9];return _0x23402e;};'use strict';var Sequelize=require(_0x5801('0x0'));module[_0x5801('0x1')]={'context':{'type':Sequelize[_0x5801('0x2')],'allowNull':![],'unique':_0x5801('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5801('0x3')},'priority':{'type':Sequelize[_0x5801('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x5801('0x3')},'tag':{'type':Sequelize[_0x5801('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5801('0x4')](_0x5801('0x5'),_0x5801('0x6'),_0x5801('0x7'),_0x5801('0x8'),_0x5801('0x9'),_0x5801('0xa'),_0x5801('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x5801('0x2')]},'interval':{'type':Sequelize[_0x5801('0x2')],'allowNull':![],'defaultValue':_0x5801('0xc')},'IntervalId':{'type':Sequelize[_0x5801('0xd')]},'isApp':{'type':Sequelize[_0x5801('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5801('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x5801('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5801('0xd')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x5801('0xf')},'answer':{'type':Sequelize[_0x5801('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5801('0x10')],'get':function(_0x3c2e14){return this['getDataValue'](_0x5801('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xcd4b=['outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0xcd4b,0x185));var _0xbcd4=function(_0x21afd5,_0x57b9ba){_0x21afd5=_0x21afd5-0x0;var _0x59b71d=_0xcd4b[_0x21afd5];return _0x59b71d;};'use strict';var Sequelize=require(_0xbcd4('0x0'));module[_0xbcd4('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbcd4('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbcd4('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xbcd4('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbcd4('0x4')},'appdata':{'type':Sequelize[_0xbcd4('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbcd4('0x5')](_0xbcd4('0x6'),_0xbcd4('0x7'),_0xbcd4('0x8'),_0xbcd4('0x9'),_0xbcd4('0xa'),_0xbcd4('0xb'),_0xbcd4('0xc')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbcd4('0x3')],'allowNull':![],'defaultValue':_0xbcd4('0xd')},'IntervalId':{'type':Sequelize[_0xbcd4('0xe')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xbcd4('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbcd4('0xe')]},'recordingFormat':{'type':Sequelize[_0xbcd4('0x3')],'defaultValue':_0xbcd4('0x10')},'answer':{'type':Sequelize[_0xbcd4('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbcd4('0x11')],'get':function(_0x218e2a){return this['getDataValue'](_0xbcd4('0x12'));}},'alias':{'type':Sequelize[_0xbcd4('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d08a064..e6c5a56 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 _0x1f8a=['map','value','includes','type','UserProfileResource','error','stack','send','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','keys','find','startsWith','body','exten','concat','create','user','get','role','OutboundRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','finally','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','InboundRoutes','inbound','outbound','InternalRoutes','filter','ignore'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x1f8a,0xfc));var _0xa1f8=function(_0x485aae,_0x1ad817){_0x485aae=_0x485aae-0x0;var _0x5c4c1a=_0x1f8a[_0x485aae];return _0x5c4c1a;};'use strict';var _=require(_0xa1f8('0x0'));var Redis=require(_0xa1f8('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xa1f8('0x2'))(_0xa1f8('0x3'));var config=require('../../config/environment');var db=require(_0xa1f8('0x4'))['db'];config[_0xa1f8('0x5')]=_['defaults'](config[_0xa1f8('0x5')],{'host':_0xa1f8('0x6'),'port':0x18eb});var socket=require(_0xa1f8('0x7'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xa1f8('0x8')](socket);function respondWithStatusCode(_0xac1b0e,_0xf182f7){_0xf182f7=_0xf182f7||0xcc;return function(_0x540094){if(_0x540094){return _0xac1b0e[_0xa1f8('0x9')](_0xf182f7);}return _0xac1b0e[_0xa1f8('0xa')](_0xf182f7)[_0xa1f8('0xb')]();};}function respondWithResult(_0x3ff0fc,_0x55415a){_0x55415a=_0x55415a||0xc8;return function(_0x36742e){if(_0x36742e){return _0x3ff0fc[_0xa1f8('0xa')](_0x55415a)[_0xa1f8('0xc')](_0x36742e);}};}function respondWithFilteredResult(_0x438bb4,_0x778550){return function(_0x51bd7a){if(_0x51bd7a){var _0x3e684b=typeof _0x778550[_0xa1f8('0xd')]===_0xa1f8('0xe')&&typeof _0x778550[_0xa1f8('0xf')]===_0xa1f8('0xe');var _0x52c009=_0x51bd7a[_0xa1f8('0x10')];var _0x380bc4=_0x3e684b?0x0:_0x778550['offset'];var _0x2553f7=_0x3e684b?_0x51bd7a[_0xa1f8('0x10')]:_0x778550[_0xa1f8('0xd')]+_0x778550[_0xa1f8('0xf')];var _0x30c88f;if(_0x2553f7>=_0x52c009){_0x2553f7=_0x52c009;_0x30c88f=0xc8;}else{_0x30c88f=0xce;}_0x438bb4['status'](_0x30c88f);return _0x438bb4[_0xa1f8('0x11')](_0xa1f8('0x12'),_0x380bc4+'-'+_0x2553f7+'/'+_0x52c009)[_0xa1f8('0xc')](_0x51bd7a);}return null;};}function removeEntity(_0x37e13b){return function(_0x4939e6){if(_0x4939e6){return _0x4939e6[_0xa1f8('0x13')]()[_0xa1f8('0x14')](function(){var _0x25b066=_0x4939e6['get']({'plain':!![]});var _0x3b74cd=[{'name':_0xa1f8('0x15'),'value':_0xa1f8('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0xa1f8('0x17'),'ignore':![]},{'name':_0xa1f8('0x18'),'value':'internal','ignore':![]}];var _0x52ccea=_(_0x3b74cd)[_0xa1f8('0x19')](_0xa1f8('0x1a'))[_0xa1f8('0x1b')]('value')[_0xa1f8('0x1c')]();if(_[_0xa1f8('0x1d')](_0x52ccea,_0x25b066[_0xa1f8('0x1e')])){return;}var _0x3991a9=_['find'](_0x3b74cd,[_0xa1f8('0x1c'),_0x25b066[_0xa1f8('0x1e')]])['name'];return db[_0xa1f8('0x1f')][_0xa1f8('0x13')]({'where':{'type':_0x3991a9,'resourceId':_0x25b066['id']}})[_0xa1f8('0x14')](function(){return _0x4939e6;});})[_0xa1f8('0x14')](function(){_0x37e13b[_0xa1f8('0xa')](0xcc)[_0xa1f8('0xb')]();});}};}function handleEntityNotFound(_0x363576){return function(_0x1e6139){if(!_0x1e6139){_0x363576[_0xa1f8('0x9')](0x194);}return _0x1e6139;};}function handleError(_0x42d381,_0x1feaed){_0x1feaed=_0x1feaed||0x1f4;return function(_0x4fe0ed){logger[_0xa1f8('0x20')](_0x4fe0ed[_0xa1f8('0x21')]);if(_0x4fe0ed['name']){delete _0x4fe0ed['name'];}_0x42d381[_0xa1f8('0xa')](_0x1feaed)[_0xa1f8('0x22')](_0x4fe0ed);};}exports['index']=function(_0x5f057c,_0x239b4c){var _0x28926e={},_0x1a592c={},_0x2b9251={'count':0x0,'rows':[]};var _0x8c05ea=_['map'](db[_0xa1f8('0x23')][_0xa1f8('0x24')],function(_0x493745){return{'name':_0x493745[_0xa1f8('0x25')],'type':_0x493745[_0xa1f8('0x1e')]['key']};});_0x1a592c[_0xa1f8('0x26')]=_[_0xa1f8('0x1b')](_0x8c05ea,'name');_0x1a592c[_0xa1f8('0x27')]=_['keys'](_0x5f057c['query']);_0x1a592c[_0xa1f8('0x28')]=_[_0xa1f8('0x29')](_0x1a592c[_0xa1f8('0x26')],_0x1a592c[_0xa1f8('0x27')]);_0x28926e[_0xa1f8('0x2a')]=_[_0xa1f8('0x29')](_0x1a592c[_0xa1f8('0x26')],qs[_0xa1f8('0x2b')](_0x5f057c[_0xa1f8('0x27')][_0xa1f8('0x2b')]));_0x28926e[_0xa1f8('0x2a')]=_0x28926e[_0xa1f8('0x2a')][_0xa1f8('0x2c')]?_0x28926e[_0xa1f8('0x2a')]:_0x1a592c[_0xa1f8('0x26')];if(!_0x5f057c[_0xa1f8('0x27')][_0xa1f8('0x2d')](_0xa1f8('0x2e'))){_0x28926e[_0xa1f8('0xf')]=qs['limit'](_0x5f057c[_0xa1f8('0x27')][_0xa1f8('0xf')]);_0x28926e[_0xa1f8('0xd')]=qs[_0xa1f8('0xd')](_0x5f057c['query'][_0xa1f8('0xd')]);}_0x28926e[_0xa1f8('0x2f')]=qs[_0xa1f8('0x30')](_0x5f057c[_0xa1f8('0x27')]['sort']);_0x28926e['where']=qs[_0xa1f8('0x28')](_[_0xa1f8('0x31')](_0x5f057c['query'],_0x1a592c[_0xa1f8('0x28')]),_0x8c05ea);if(_0x5f057c[_0xa1f8('0x27')][_0xa1f8('0x19')]){_0x28926e[_0xa1f8('0x32')]=_[_0xa1f8('0x33')](_0x28926e[_0xa1f8('0x32')],{'$or':_[_0xa1f8('0x1b')](_0x8c05ea,function(_0x174343){if(_0x174343[_0xa1f8('0x1e')]!==_0xa1f8('0x34')){var _0xe1fc71={};_0xe1fc71[_0x174343[_0xa1f8('0x35')]]={'$like':'%'+_0x5f057c[_0xa1f8('0x27')][_0xa1f8('0x19')]+'%'};return _0xe1fc71;}})});}_0x28926e=_[_0xa1f8('0x33')]({},_0x28926e,_0x5f057c[_0xa1f8('0x36')]);var _0x5e63f6={'where':_0x28926e['where']};return db[_0xa1f8('0x23')]['count'](_0x5e63f6)[_0xa1f8('0x14')](function(_0x3b6e20){_0x2b9251[_0xa1f8('0x10')]=_0x3b6e20;if(_0x5f057c[_0xa1f8('0x27')][_0xa1f8('0x37')]){_0x28926e[_0xa1f8('0x38')]=[{'all':!![]}];}return db['VoiceExtension'][_0xa1f8('0x39')](_0x28926e);})[_0xa1f8('0x14')](function(_0x34a336){_0x2b9251[_0xa1f8('0x3a')]=_0x34a336;return _0x2b9251;})[_0xa1f8('0x14')](respondWithFilteredResult(_0x239b4c,_0x28926e))[_0xa1f8('0x3b')](handleError(_0x239b4c,null));};exports[_0xa1f8('0x3c')]=function(_0x1c7fa7,_0x5dc3fd){var _0x4a631b={'raw':![],'where':{'id':_0x1c7fa7['params']['id']}},_0x5d5df5={};_0x5d5df5[_0xa1f8('0x26')]=_[_0xa1f8('0x3d')](db['VoiceExtension'][_0xa1f8('0x24')]);_0x5d5df5[_0xa1f8('0x27')]=_[_0xa1f8('0x3d')](_0x1c7fa7[_0xa1f8('0x27')]);_0x5d5df5['filters']=_['intersection'](_0x5d5df5[_0xa1f8('0x26')],_0x5d5df5[_0xa1f8('0x27')]);_0x4a631b['attributes']=_['intersection'](_0x5d5df5[_0xa1f8('0x26')],qs[_0xa1f8('0x2b')](_0x1c7fa7[_0xa1f8('0x27')]['fields']));_0x4a631b[_0xa1f8('0x2a')]=_0x4a631b[_0xa1f8('0x2a')][_0xa1f8('0x2c')]?_0x4a631b[_0xa1f8('0x2a')]:_0x5d5df5[_0xa1f8('0x26')];if(_0x1c7fa7[_0xa1f8('0x27')][_0xa1f8('0x37')]){_0x4a631b[_0xa1f8('0x38')]=[{'all':!![]}];}_0x4a631b=_[_0xa1f8('0x33')]({},_0x4a631b,_0x1c7fa7[_0xa1f8('0x36')]);return db[_0xa1f8('0x23')]['find'](_0x4a631b)['then'](handleEntityNotFound(_0x5dc3fd,null))['then'](respondWithResult(_0x5dc3fd,null))['catch'](handleError(_0x5dc3fd,null));};exports[_0xa1f8('0x13')]=function(_0x24df19,_0xa37538){return db['VoiceExtension'][_0xa1f8('0x3e')]({'where':{'id':_0x24df19['params']['id']}})[_0xa1f8('0x14')](handleEntityNotFound(_0xa37538,null))[_0xa1f8('0x14')](removeEntity(_0xa37538,null))[_0xa1f8('0x3b')](handleError(_0xa37538,null));};exports['create']=function(_0x288bff,_0x3765fa){if(_0x288bff['body'][_0xa1f8('0x1e')]===_0xa1f8('0x17')&&!_[_0xa1f8('0x3f')](_0x288bff[_0xa1f8('0x40')]['exten'],'_')){_0x288bff['body'][_0xa1f8('0x41')]='_'[_0xa1f8('0x42')](_0x288bff[_0xa1f8('0x40')]['exten']);}return db['VoiceExtension'][_0xa1f8('0x43')](_0x288bff['body'],{'raw':![]})['then'](function(_0x421015){var _0x4067d8=_0x288bff[_0xa1f8('0x44')][_0xa1f8('0x45')]({'plain':!![]});if(!_0x4067d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4067d8[_0xa1f8('0x46')]==='user'){var _0x2eae63=_0x421015['get']({'plain':!![]});var _0x3969ed=[{'name':_0xa1f8('0x15'),'value':_0xa1f8('0x16')},{'name':_0xa1f8('0x47'),'value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x24f76e=_[_0xa1f8('0x3e')](_0x3969ed,['value',_0x2eae63['type']])[_0xa1f8('0x35')];return db[_0xa1f8('0x48')][_0xa1f8('0x3e')]({'where':{'name':_0x24f76e,'userProfileId':_0x4067d8['userProfileId']},'raw':!![]})[_0xa1f8('0x14')](function(_0x1890fb){if(_0x1890fb&&_0x1890fb[_0xa1f8('0x49')]===0x0){return db[_0xa1f8('0x1f')][_0xa1f8('0x43')]({'name':_0x2eae63[_0xa1f8('0x35')],'resourceId':_0x2eae63['id'],'type':_0x1890fb[_0xa1f8('0x35')],'sectionId':_0x1890fb['id']},{})['then'](function(){return _0x421015;});}else{return _0x421015;}})[_0xa1f8('0x3b')](function(_0x514abf){logger['error'](_0xa1f8('0x4a'),_0x514abf);throw _0x514abf;});}return _0x421015;})['then'](respondWithResult(_0x3765fa,0xc9))['catch'](handleError(_0x3765fa,null));};exports['update']=function(_0x4691da,_0x134f09){if(_0x4691da[_0xa1f8('0x40')]['id']){delete _0x4691da['body']['id'];}return db[_0xa1f8('0x23')][_0xa1f8('0x3e')]({'where':{'id':_0x4691da['params']['id']}})[_0xa1f8('0x14')](handleEntityNotFound(_0x134f09,null))[_0xa1f8('0x14')](function(_0x253528){if(_0x253528){return db[_0xa1f8('0x23')][_0xa1f8('0x4b')](_[_0xa1f8('0x31')](_0x4691da['body'],[_0xa1f8('0x41'),_0xa1f8('0x4c'),_0xa1f8('0x4d'),_0xa1f8('0x4e'),_0xa1f8('0x4f'),_0xa1f8('0x50'),_0xa1f8('0x51')]),{'where':{'context':_0x253528['context'],'exten':_0x253528[_0xa1f8('0x41')]},'individualHooks':!![]})['then'](function(_0x931481){return _0x931481;});}return null;})['then'](respondWithStatusCode(_0x134f09,null))[_0xa1f8('0x3b')](handleError(_0x134f09,null));};exports[_0xa1f8('0x52')]=function(_0x276119,_0x3cc592){var _0x554b84=_0x276119['params']['id'];var _0x4eaef0=_0x276119['body'];var _0x40ad7a=0xc8;var _0x202cbd=null;return db[_0xa1f8('0x53')][_0xa1f8('0x54')]({'isolationLevel':db['sequelize'][_0xa1f8('0x55')][_0xa1f8('0x56')][_0xa1f8('0x57')]},function(_0x52ff81){return db[_0xa1f8('0x23')][_0xa1f8('0x58')]({'where':{'id':_0x554b84},'transaction':_0x52ff81})[_0xa1f8('0x14')](function(_0x244415){if(_0x244415){return db['VoiceExtension'][_0xa1f8('0x13')]({'where':{'VoiceExtensionId':_0x554b84},'transaction':_0x52ff81})['then'](function(){var _0x103bce=_[_0xa1f8('0x1b')](_0x4eaef0,function(_0x3ab02b){_0x3ab02b[_0xa1f8('0x59')]=_0x554b84;_0x3ab02b[_0xa1f8('0x5a')]=!![];return _0x3ab02b;});return _0x244415['createRouting'](_0x103bce);})[_0xa1f8('0x14')](function(_0x43486f){return db['VoiceExtension'][_0xa1f8('0x5b')](_0x43486f,{'transaction':_0x52ff81});});}else{_0x40ad7a=0x194;_0x202cbd=[];}});})[_0xa1f8('0x14')](function(){if(_0x40ad7a!==0x194){return db[_0xa1f8('0x23')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x554b84},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x4f5fc4){_0x202cbd=_0x4f5fc4;});}})['catch'](function(_0x1af936){_0x40ad7a=0x1f4;logger[_0xa1f8('0x20')](_0x1af936['stack']);if(_0x1af936[_0xa1f8('0x35')]){delete _0x1af936[_0xa1f8('0x35')];}_0x202cbd=_0x1af936;})[_0xa1f8('0x5c')](function(){if(_0x202cbd===null){_0x3cc592['sendStatus'](_0x40ad7a);}else{if(_0x40ad7a===0x1f4){_0x3cc592[_0xa1f8('0xa')](_0x40ad7a)[_0xa1f8('0x22')](_0x202cbd);}else{_0x3cc592['status'](_0x40ad7a)['json'](_0x202cbd);}}});}; \ No newline at end of file +var _0x03fa=['bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','type','find','name','UserProfileResource','end','stack','send','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','show','keys','length','catch','params','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting'];(function(_0x35797e,_0x4c6baf){var _0x433741=function(_0x2f4954){while(--_0x2f4954){_0x35797e['push'](_0x35797e['shift']());}};_0x433741(++_0x4c6baf);}(_0x03fa,0xc4));var _0xa03f=function(_0xaccc0d,_0xb2eed5){_0xaccc0d=_0xaccc0d-0x0;var _0x646e25=_0x03fa[_0xaccc0d];return _0x646e25;};'use strict';var _=require(_0xa03f('0x0'));var Redis=require(_0xa03f('0x1'));var qs=require(_0xa03f('0x2'));var logger=require(_0xa03f('0x3'))(_0xa03f('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa03f('0x5')]=_[_0xa03f('0x6')](config[_0xa03f('0x5')],{'host':_0xa03f('0x7'),'port':0x18eb});var socket=require(_0xa03f('0x8'))(new Redis(config[_0xa03f('0x5')]));require(_0xa03f('0x9'))[_0xa03f('0xa')](socket);function respondWithStatusCode(_0x4e4a4c,_0x27ecd9){_0x27ecd9=_0x27ecd9||0xcc;return function(_0x409bcd){if(_0x409bcd){return _0x4e4a4c[_0xa03f('0xb')](_0x27ecd9);}return _0x4e4a4c[_0xa03f('0xc')](_0x27ecd9)['end']();};}function respondWithResult(_0x98378b,_0x1428f5){_0x1428f5=_0x1428f5||0xc8;return function(_0x140aa9){if(_0x140aa9){return _0x98378b[_0xa03f('0xc')](_0x1428f5)[_0xa03f('0xd')](_0x140aa9);}};}function respondWithFilteredResult(_0x40a415,_0x205c11){return function(_0x7e8651){if(_0x7e8651){var _0x49e4a3=typeof _0x205c11[_0xa03f('0xe')]==='undefined'&&typeof _0x205c11['limit']===_0xa03f('0xf');var _0x2dd160=_0x7e8651[_0xa03f('0x10')];var _0x5c2b5a=_0x49e4a3?0x0:_0x205c11[_0xa03f('0xe')];var _0x206934=_0x49e4a3?_0x7e8651[_0xa03f('0x10')]:_0x205c11['offset']+_0x205c11[_0xa03f('0x11')];var _0x3e420b;if(_0x206934>=_0x2dd160){_0x206934=_0x2dd160;_0x3e420b=0xc8;}else{_0x3e420b=0xce;}_0x40a415['status'](_0x3e420b);return _0x40a415[_0xa03f('0x12')](_0xa03f('0x13'),_0x5c2b5a+'-'+_0x206934+'/'+_0x2dd160)[_0xa03f('0xd')](_0x7e8651);}return null;};}function removeEntity(_0x5c438e){return function(_0x2889bf){if(_0x2889bf){return _0x2889bf[_0xa03f('0x14')]()[_0xa03f('0x15')](function(){var _0x291099=_0x2889bf[_0xa03f('0x16')]({'plain':!![]});var _0x400382=[{'name':_0xa03f('0x17'),'value':_0xa03f('0x18'),'ignore':![]},{'name':_0xa03f('0x19'),'value':_0xa03f('0x1a'),'ignore':![]},{'name':_0xa03f('0x1b'),'value':_0xa03f('0x1c'),'ignore':![]}];var _0x18d9a4=_(_0x400382)['filter']('ignore')[_0xa03f('0x1d')]('value')[_0xa03f('0x1e')]();if(_['includes'](_0x18d9a4,_0x291099[_0xa03f('0x1f')])){return;}var _0x459afe=_[_0xa03f('0x20')](_0x400382,[_0xa03f('0x1e'),_0x291099[_0xa03f('0x1f')]])[_0xa03f('0x21')];return db[_0xa03f('0x22')][_0xa03f('0x14')]({'where':{'type':_0x459afe,'resourceId':_0x291099['id']}})[_0xa03f('0x15')](function(){return _0x2889bf;});})[_0xa03f('0x15')](function(){_0x5c438e[_0xa03f('0xc')](0xcc)[_0xa03f('0x23')]();});}};}function handleEntityNotFound(_0x39065c){return function(_0x4f5046){if(!_0x4f5046){_0x39065c[_0xa03f('0xb')](0x194);}return _0x4f5046;};}function handleError(_0x5391a9,_0x4d7aa6){_0x4d7aa6=_0x4d7aa6||0x1f4;return function(_0x529d60){logger['error'](_0x529d60[_0xa03f('0x24')]);if(_0x529d60[_0xa03f('0x21')]){delete _0x529d60['name'];}_0x5391a9[_0xa03f('0xc')](_0x4d7aa6)[_0xa03f('0x25')](_0x529d60);};}exports[_0xa03f('0x26')]=function(_0x12ef12,_0x5d2868){var _0x2a3376={},_0xfb0e3c={},_0x3bed58={'count':0x0,'rows':[]};var _0x33ebb6=_[_0xa03f('0x1d')](db['VoiceExtension'][_0xa03f('0x27')],function(_0x25b19b){return{'name':_0x25b19b[_0xa03f('0x28')],'type':_0x25b19b[_0xa03f('0x1f')]['key']};});_0xfb0e3c[_0xa03f('0x29')]=_[_0xa03f('0x1d')](_0x33ebb6,_0xa03f('0x21'));_0xfb0e3c[_0xa03f('0x2a')]=_['keys'](_0x12ef12['query']);_0xfb0e3c[_0xa03f('0x2b')]=_[_0xa03f('0x2c')](_0xfb0e3c[_0xa03f('0x29')],_0xfb0e3c[_0xa03f('0x2a')]);_0x2a3376[_0xa03f('0x2d')]=_['intersection'](_0xfb0e3c[_0xa03f('0x29')],qs[_0xa03f('0x2e')](_0x12ef12[_0xa03f('0x2a')][_0xa03f('0x2e')]));_0x2a3376[_0xa03f('0x2d')]=_0x2a3376[_0xa03f('0x2d')]['length']?_0x2a3376[_0xa03f('0x2d')]:_0xfb0e3c[_0xa03f('0x29')];if(!_0x12ef12[_0xa03f('0x2a')][_0xa03f('0x2f')](_0xa03f('0x30'))){_0x2a3376[_0xa03f('0x11')]=qs[_0xa03f('0x11')](_0x12ef12[_0xa03f('0x2a')][_0xa03f('0x11')]);_0x2a3376[_0xa03f('0xe')]=qs[_0xa03f('0xe')](_0x12ef12[_0xa03f('0x2a')][_0xa03f('0xe')]);}_0x2a3376['order']=qs[_0xa03f('0x31')](_0x12ef12[_0xa03f('0x2a')][_0xa03f('0x31')]);_0x2a3376[_0xa03f('0x32')]=qs[_0xa03f('0x2b')](_[_0xa03f('0x33')](_0x12ef12[_0xa03f('0x2a')],_0xfb0e3c['filters']),_0x33ebb6);if(_0x12ef12[_0xa03f('0x2a')][_0xa03f('0x34')]){_0x2a3376[_0xa03f('0x32')]=_[_0xa03f('0x35')](_0x2a3376[_0xa03f('0x32')],{'$or':_[_0xa03f('0x1d')](_0x33ebb6,function(_0x3a9eac){if(_0x3a9eac[_0xa03f('0x1f')]!==_0xa03f('0x36')){var _0x135563={};_0x135563[_0x3a9eac[_0xa03f('0x21')]]={'$like':'%'+_0x12ef12['query']['filter']+'%'};return _0x135563;}})});}_0x2a3376=_[_0xa03f('0x35')]({},_0x2a3376,_0x12ef12[_0xa03f('0x37')]);var _0x36633c={'where':_0x2a3376[_0xa03f('0x32')]};return db[_0xa03f('0x38')][_0xa03f('0x10')](_0x36633c)[_0xa03f('0x15')](function(_0x1c8562){_0x3bed58[_0xa03f('0x10')]=_0x1c8562;if(_0x12ef12['query'][_0xa03f('0x39')]){_0x2a3376[_0xa03f('0x3a')]=[{'all':!![]}];}return db[_0xa03f('0x38')][_0xa03f('0x3b')](_0x2a3376);})[_0xa03f('0x15')](function(_0x3d836f){_0x3bed58[_0xa03f('0x3c')]=_0x3d836f;return _0x3bed58;})[_0xa03f('0x15')](respondWithFilteredResult(_0x5d2868,_0x2a3376))['catch'](handleError(_0x5d2868,null));};exports[_0xa03f('0x3d')]=function(_0x3bc5f5,_0x9fed4e){var _0x5ee005={'raw':![],'where':{'id':_0x3bc5f5['params']['id']}},_0x1d7ea9={};_0x1d7ea9[_0xa03f('0x29')]=_[_0xa03f('0x3e')](db[_0xa03f('0x38')][_0xa03f('0x27')]);_0x1d7ea9[_0xa03f('0x2a')]=_[_0xa03f('0x3e')](_0x3bc5f5[_0xa03f('0x2a')]);_0x1d7ea9[_0xa03f('0x2b')]=_['intersection'](_0x1d7ea9[_0xa03f('0x29')],_0x1d7ea9[_0xa03f('0x2a')]);_0x5ee005[_0xa03f('0x2d')]=_[_0xa03f('0x2c')](_0x1d7ea9['model'],qs[_0xa03f('0x2e')](_0x3bc5f5[_0xa03f('0x2a')][_0xa03f('0x2e')]));_0x5ee005[_0xa03f('0x2d')]=_0x5ee005[_0xa03f('0x2d')][_0xa03f('0x3f')]?_0x5ee005['attributes']:_0x1d7ea9[_0xa03f('0x29')];if(_0x3bc5f5[_0xa03f('0x2a')][_0xa03f('0x39')]){_0x5ee005[_0xa03f('0x3a')]=[{'all':!![]}];}_0x5ee005=_[_0xa03f('0x35')]({},_0x5ee005,_0x3bc5f5['options']);return db['VoiceExtension'][_0xa03f('0x20')](_0x5ee005)['then'](handleEntityNotFound(_0x9fed4e,null))[_0xa03f('0x15')](respondWithResult(_0x9fed4e,null))[_0xa03f('0x40')](handleError(_0x9fed4e,null));};exports[_0xa03f('0x14')]=function(_0x133509,_0x4911c2){return db[_0xa03f('0x38')][_0xa03f('0x20')]({'where':{'id':_0x133509[_0xa03f('0x41')]['id']}})[_0xa03f('0x15')](handleEntityNotFound(_0x4911c2,null))['then'](removeEntity(_0x4911c2,null))[_0xa03f('0x40')](handleError(_0x4911c2,null));};exports['create']=function(_0x16a01e,_0x1fb8ab){if(_0x16a01e[_0xa03f('0x42')][_0xa03f('0x1f')]===_0xa03f('0x1a')&&!_[_0xa03f('0x43')](_0x16a01e['body'][_0xa03f('0x44')],'_')){_0x16a01e['body'][_0xa03f('0x44')]='_'[_0xa03f('0x45')](_0x16a01e[_0xa03f('0x42')][_0xa03f('0x44')]);}return db['VoiceExtension'][_0xa03f('0x46')](_0x16a01e['body'],{'raw':![]})['then'](function(_0x3172b2){var _0x3ae29a=_0x16a01e[_0xa03f('0x47')][_0xa03f('0x16')]({'plain':!![]});if(!_0x3ae29a)throw new Error(_0xa03f('0x48'));if(_0x3ae29a['role']===_0xa03f('0x47')){var _0x28e2b6=_0x3172b2[_0xa03f('0x16')]({'plain':!![]});var _0x108101=[{'name':_0xa03f('0x17'),'value':_0xa03f('0x18')},{'name':'OutboundRoutes','value':_0xa03f('0x1a')},{'name':'InternalRoutes','value':_0xa03f('0x1c')}];var _0x1e7c25=_[_0xa03f('0x20')](_0x108101,[_0xa03f('0x1e'),_0x28e2b6[_0xa03f('0x1f')]])[_0xa03f('0x21')];return db[_0xa03f('0x49')][_0xa03f('0x20')]({'where':{'name':_0x1e7c25,'userProfileId':_0x3ae29a['userProfileId']},'raw':!![]})[_0xa03f('0x15')](function(_0x309812){if(_0x309812&&_0x309812[_0xa03f('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x28e2b6[_0xa03f('0x21')],'resourceId':_0x28e2b6['id'],'type':_0x309812[_0xa03f('0x21')],'sectionId':_0x309812['id']},{})[_0xa03f('0x15')](function(){return _0x3172b2;});}else{return _0x3172b2;}})[_0xa03f('0x40')](function(_0x299673){logger[_0xa03f('0x4b')](_0xa03f('0x4c'),_0x299673);throw _0x299673;});}return _0x3172b2;})['then'](respondWithResult(_0x1fb8ab,0xc9))[_0xa03f('0x40')](handleError(_0x1fb8ab,null));};exports[_0xa03f('0x4d')]=function(_0x1bfe1b,_0x5beb15){if(_0x1bfe1b['body']['id']){delete _0x1bfe1b[_0xa03f('0x42')]['id'];}return db[_0xa03f('0x38')][_0xa03f('0x20')]({'where':{'id':_0x1bfe1b[_0xa03f('0x41')]['id']}})['then'](handleEntityNotFound(_0x5beb15,null))[_0xa03f('0x15')](function(_0x459c1f){if(_0x459c1f){return db['VoiceExtension'][_0xa03f('0x4d')](_['pick'](_0x1bfe1b[_0xa03f('0x42')],[_0xa03f('0x44'),'context',_0xa03f('0x4e'),_0xa03f('0x4f'),_0xa03f('0x50'),_0xa03f('0x51'),_0xa03f('0x52')]),{'where':{'context':_0x459c1f[_0xa03f('0x53')],'exten':_0x459c1f['exten']},'individualHooks':!![]})['then'](function(_0x43d4d6){return _0x43d4d6;});}return null;})[_0xa03f('0x15')](respondWithStatusCode(_0x5beb15,null))[_0xa03f('0x40')](handleError(_0x5beb15,null));};exports[_0xa03f('0x54')]=function(_0x404633,_0x2bd92c){var _0x22d7dd=_0x404633[_0xa03f('0x41')]['id'];var _0x559ad9=_0x404633['body'];var _0x4dab77=0xc8;var _0x1d8477=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xa03f('0x55')][_0xa03f('0x56')]['ISOLATION_LEVELS'][_0xa03f('0x57')]},function(_0x5c96da){return db[_0xa03f('0x38')][_0xa03f('0x58')]({'where':{'id':_0x22d7dd},'transaction':_0x5c96da})[_0xa03f('0x15')](function(_0x5298b8){if(_0x5298b8){return db[_0xa03f('0x38')][_0xa03f('0x14')]({'where':{'VoiceExtensionId':_0x22d7dd},'transaction':_0x5c96da})[_0xa03f('0x15')](function(){var _0x303531=_[_0xa03f('0x1d')](_0x559ad9,function(_0xf85ad){_0xf85ad[_0xa03f('0x59')]=_0x22d7dd;_0xf85ad[_0xa03f('0x5a')]=!![];return _0xf85ad;});return _0x5298b8[_0xa03f('0x5b')](_0x303531);})['then'](function(_0x51d62f){return db[_0xa03f('0x38')][_0xa03f('0x5c')](_0x51d62f,{'transaction':_0x5c96da});});}else{_0x4dab77=0x194;_0x1d8477=[];}});})['then'](function(){if(_0x4dab77!==0x194){return db[_0xa03f('0x38')][_0xa03f('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x22d7dd},'order':_0xa03f('0x5e')})[_0xa03f('0x15')](function(_0x411ef5){_0x1d8477=_0x411ef5;});}})[_0xa03f('0x40')](function(_0xfd6701){_0x4dab77=0x1f4;logger[_0xa03f('0x4b')](_0xfd6701[_0xa03f('0x24')]);if(_0xfd6701[_0xa03f('0x21')]){delete _0xfd6701[_0xa03f('0x21')];}_0x1d8477=_0xfd6701;})[_0xa03f('0x5f')](function(){if(_0x1d8477===null){_0x2bd92c[_0xa03f('0xb')](_0x4dab77);}else{if(_0x4dab77===0x1f4){_0x2bd92c[_0xa03f('0xc')](_0x4dab77)[_0xa03f('0x25')](_0x1d8477);}else{_0x2bd92c[_0xa03f('0xc')](_0x4dab77)[_0xa03f('0xd')](_0x1d8477);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d1a09b7..5bd9a86 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 _0xa210=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','VoiceExtension'];(function(_0x537f1e,_0x31a431){var _0x3c1469=function(_0x261aaa){while(--_0x261aaa){_0x537f1e['push'](_0x537f1e['shift']());}};_0x3c1469(++_0x31a431);}(_0xa210,0x69));var _0x0a21=function(_0x256533,_0x1c9f7e){_0x256533=_0x256533-0x0;var _0x48a91d=_0xa210[_0x256533];return _0x48a91d;};'use strict';var EventEmitter=require(_0x0a21('0x0'));var VoiceExtension=require(_0x0a21('0x1'))['db'][_0x0a21('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0a21('0x3')](0x0);var events={'afterCreate':_0x0a21('0x4'),'afterUpdate':_0x0a21('0x5'),'afterDestroy':_0x0a21('0x6')};function emitEvent(_0x82fb18){return function(_0x826b35,_0x362d1c,_0x33ebe8){VoiceExtensionEvents[_0x0a21('0x7')](_0x82fb18+':'+_0x826b35['id'],_0x826b35);VoiceExtensionEvents[_0x0a21('0x7')](_0x82fb18,_0x826b35);_0x33ebe8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x0a21('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x8a35=['emit','hasOwnProperty','hook','events','VoiceExtension','setMaxListeners','update'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0x8a35,0xff));var _0x58a3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8a35[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x58a3('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x58a3('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x58a3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x58a3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1a2063){return function(_0xe18545,_0x8924c2,_0x7103e6){VoiceExtensionEvents[_0x58a3('0x4')](_0x1a2063+':'+_0xe18545['id'],_0xe18545);VoiceExtensionEvents[_0x58a3('0x4')](_0x1a2063,_0xe18545);_0x7103e6(null);};}for(var e in events){if(events[_0x58a3('0x5')](e)){var event=events[e];VoiceExtension[_0x58a3('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index d76da2b..2ef6760 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 _0x1ba8=['callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','models','type','CDR(type)=','alias','Set','No\x20alias\x20set','context','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','NoOp','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','trunk','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','interval','IntervalId','then','*,*,*,*','intervals','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'];(function(_0x716341,_0x5d13e7){var _0x39b3b9=function(_0x25dcb9){while(--_0x25dcb9){_0x716341['push'](_0x716341['shift']());}};_0x39b3b9(++_0x5d13e7);}(_0x1ba8,0x10d));var _0x81ba=function(_0x5c3aa6,_0x565c2c){_0x5c3aa6=_0x5c3aa6-0x0;var _0x41c468=_0x1ba8[_0x5c3aa6];return _0x41c468;};'use strict';var _=require(_0x81ba('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x17f359){var _0x5e070c=_0x17f359[_0x81ba('0x1')];function _0x57305e(_0x4ff388){var _0x5414be=0x2;var _0xb1fff9=[{'type':_0x4ff388[_0x81ba('0x2')],'app':'Set','appdata':_0x81ba('0x3')+_0x4ff388[_0x81ba('0x2')],'context':_0x4ff388['context'],'exten':_0x4ff388['exten'],'priority':_0x5414be++,'VoiceExtensionId':_0x4ff388['id']},{'type':_0x4ff388[_0x81ba('0x2')],'app':_0x4ff388[_0x81ba('0x4')]?_0x81ba('0x5'):'NoOp','appdata':_0x4ff388[_0x81ba('0x4')]?'CDR(routeAlias)='+_0x4ff388[_0x81ba('0x4')]:_0x81ba('0x6'),'context':_0x4ff388[_0x81ba('0x7')],'exten':_0x4ff388[_0x81ba('0x8')],'priority':_0x5414be++,'VoiceExtensionId':_0x4ff388['id']}];if(_0x4ff388['type']===_0x81ba('0x9')){_0xb1fff9['push']({'type':_0x81ba('0x9'),'app':_0x81ba('0x5'),'appdata':_0x81ba('0xa')+_0x4ff388['id'],'context':_0x4ff388[_0x81ba('0x7')],'exten':_0x4ff388['exten'],'priority':_0x5414be++,'VoiceExtensionId':_0x4ff388['id']});}_0xb1fff9[_0x81ba('0xb')]({'type':_0x4ff388['type'],'app':_0x81ba('0x5'),'appdata':_0x81ba('0xc'),'context':_0x4ff388['context'],'exten':_0x4ff388[_0x81ba('0x8')],'priority':_0x5414be++,'VoiceExtensionId':_0x4ff388['id']},{'type':_0x4ff388['type'],'app':_0x81ba('0x5'),'appdata':_0x81ba('0xd'),'context':_0x4ff388[_0x81ba('0x7')],'exten':_0x4ff388[_0x81ba('0x8')],'priority':_0x5414be++,'VoiceExtensionId':_0x4ff388['id']},{'type':_0x4ff388[_0x81ba('0x2')],'app':_0x81ba('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4ff388[_0x81ba('0x7')],'exten':_0x4ff388[_0x81ba('0x8')],'priority':_0x5414be++,'VoiceExtensionId':_0x4ff388['id']});return _0xb1fff9;}function _0x3822ea(_0x261a70){var _0x2a9db5=0x2;var _0x4bf57a=[{'type':_0x81ba('0xe'),'app':_0x81ba('0x5'),'appdata':'CDR(type)=outbound','context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70['exten'],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':_0x261a70['alias']?'Set':_0x81ba('0xf'),'appdata':_0x261a70[_0x81ba('0x4')]?'CDR(routeAlias)='+_0x261a70['alias']:_0x81ba('0x6'),'context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':'outbound','app':_0x81ba('0x5'),'appdata':'CDR(destination)='+(_0x261a70[_0x81ba('0x10')]?_0x81ba('0x11')+_0x261a70[_0x81ba('0x10')]+'}':_0x81ba('0x12')),'context':_0x261a70['context'],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':_0x81ba('0x5'),'appdata':_0x81ba('0xa')+_0x261a70['id'],'context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':_0x81ba('0x13'),'appdata':_0x81ba('0x14')+(_0x2a9db5+0x2)+_0x81ba('0x15')+(_0x2a9db5+0x1)+')','context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':'outbound','app':_0x81ba('0x5'),'appdata':_0x261a70[_0x81ba('0x10')]?_0x81ba('0x16')+_0x261a70['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':_0x81ba('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x261a70['context'],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':'Set','appdata':_0x81ba('0xd'),'context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':_0x81ba('0x5'),'appdata':_0x81ba('0x17'),'context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':'outbound','app':_0x81ba('0x5'),'appdata':'outboundrouteid='+_0x261a70['id'],'context':_0x261a70['context'],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']}];if(_0x261a70['hasOwnProperty'](_0x81ba('0x18'))&&_0x261a70[_0x81ba('0x18')]!==_0x81ba('0x19')){_0x4bf57a[_0x81ba('0xb')]({'type':_0x81ba('0xe'),'app':_0x81ba('0x5'),'appdata':_0x81ba('0x1a'),'context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']},{'type':_0x81ba('0xe'),'app':_0x81ba('0x5'),'appdata':_0x81ba('0x1b')+_0x261a70['recordingFormat']||_0x81ba('0x1c'),'context':_0x261a70[_0x81ba('0x7')],'exten':_0x261a70[_0x81ba('0x8')],'priority':_0x2a9db5++,'VoiceExtensionId':_0x261a70['id']});}return _0x4bf57a;}function _0xa44eff(_0x853839,_0x55d0fd){var _0x3bb5e1=[{'name':'trunk','param':0x0},{'name':_0x81ba('0x1d'),'param':0x1},{'name':_0x81ba('0x1e'),'param':0x2},{'name':_0x81ba('0x1f'),'param':0x3}];var _0x39202c={};var _0x51e469=_0x55d0fd[_0x81ba('0x20')](',');var _0x2eed93=[];for(var _0x2f9ee6=0x0;_0x2f9ee6<_0x3bb5e1[_0x81ba('0x21')];_0x2f9ee6++){switch(_0x3bb5e1[_0x2f9ee6]['name']){case _0x81ba('0x22'):_0x39202c[_0x81ba('0x22')]=_0x51e469[_0x3bb5e1[_0x2f9ee6][_0x81ba('0x23')]]['split']('/')[0x1];_0x39202c[_0x81ba('0x24')]=_0x51e469[_0x3bb5e1[_0x2f9ee6]['param']][_0x81ba('0x20')]('/')[0x2];_0x39202c[_0x81ba('0x25')]=_0x39202c['phone']?_0x39202c[_0x81ba('0x24')][_0x81ba('0x20')]('$')[0x0]:undefined;_0x39202c[_0x81ba('0x24')]=_0x853839[_0x81ba('0x10')]?(_0x39202c['prefix']||'')+_0x81ba('0x11')+_0x853839[_0x81ba('0x10')]+'}':(_0x39202c['prefix']||'')+_0x81ba('0x12');_0x2eed93[_0x3bb5e1[_0x2f9ee6]['param']]=[_0x81ba('0x26'),_0x39202c['trunk'],_0x39202c[_0x81ba('0x24')]]['join']('/');break;case _0x81ba('0x1e'):_0x39202c[_0x81ba('0x1e')]=_0x51e469[_0x3bb5e1[_0x2f9ee6]['param']];if(_0x853839[_0x81ba('0x18')]!==_0x81ba('0x19')){if(_0x39202c[_0x81ba('0x1e')][_0x81ba('0x27')](_0x81ba('0x28'))<0x0){_0x39202c[_0x81ba('0x1e')]+='U(xcally-mixmonitor-context)';}}else{_0x39202c[_0x81ba('0x1e')]=_0x39202c[_0x81ba('0x1e')][_0x81ba('0x29')](_0x81ba('0x28'),'');}_0x2eed93[_0x3bb5e1[_0x2f9ee6]['param']]=_0x39202c['options'];break;default:_0x2eed93[_0x3bb5e1[_0x2f9ee6][_0x81ba('0x23')]]=_0x51e469[_0x3bb5e1[_0x2f9ee6][_0x81ba('0x23')]];}}return _0x2eed93[_0x81ba('0x2a')](',');}function _0x450142(_0x2bf7ff,_0x456d25,_0xa25a9d){return new Promise(function(_0x3b3c38,_0xffeb41){var _0x4eb70a=[];if(_[_0x81ba('0x2b')](_0x456d25))return _0x3b3c38(_0x4eb70a);_0x5e070c['Interval']['findAll']({'attributes':['id',_0x81ba('0x2c'),_0x81ba('0x2d')],'raw':!![]})[_0x81ba('0x2e')](function(_0x95f2d4){for(var _0x43d9d9=0x0,_0x49fad6=0x0;_0x43d9d9<_0x456d25[_0x81ba('0x21')];_0x43d9d9++,_0x49fad6=0x0){var _0x3d88e2=_0x456d25[_0x43d9d9];var _0x59561a=[];var _0x2de5d1=[];delete _0x3d88e2['id'];if(_0x3d88e2[_0x81ba('0x2c')]!==_0x81ba('0x2f')){_0x3d88e2['intervals']=[_0x3d88e2[_0x81ba('0x2c')]];}else{_0x3d88e2[_0x81ba('0x30')]=_0x3d88e2[_0x81ba('0x2d')]?_['map'](_[_0x81ba('0x31')](_0x95f2d4,{'IntervalId':_0x3d88e2[_0x81ba('0x2d')]}),_0x81ba('0x2c')):[];}_0x3d88e2[_0x81ba('0x7')]=_0x2bf7ff[_0x81ba('0x7')];_0x3d88e2['exten']=_0x2bf7ff[_0x81ba('0x8')];if(_0x3d88e2[_0x81ba('0x2')])_0x3d88e2['type']=_0x3d88e2[_0x81ba('0x2')][_0x81ba('0x32')]();if(_0x2bf7ff[_0x81ba('0x2')]===_0x81ba('0xe')){if(_0x3d88e2[_0x81ba('0x33')]('tag')&&_0x3d88e2[_0x81ba('0x34')]&&_0x3d88e2['tag']!=='--'){_0x59561a[_0x81ba('0xb')]({'type':_0x3d88e2[_0x81ba('0x2')][_0x81ba('0x32')](),'app':'Set','appdata':_0x81ba('0x35')+_0x3d88e2[_0x81ba('0x34')],'context':_0x2bf7ff[_0x81ba('0x7')],'exten':_0x2bf7ff[_0x81ba('0x8')],'priority':_0x3d88e2[_0x81ba('0x30')]['length']+_0xa25a9d+_0x49fad6++,'VoiceExtensionId':_0x2bf7ff['id']});}_0x59561a[_0x81ba('0xb')]({'type':_0x3d88e2[_0x81ba('0x2')][_0x81ba('0x32')](),'app':_0x81ba('0x13'),'appdata':_0x81ba('0x36')+(_0x3d88e2[_0x81ba('0x37')]?_0x81ba('0x38')+_0x3d88e2['callerID']+')':_0x81ba('0x39')),'context':_0x2bf7ff['context'],'exten':_0x2bf7ff[_0x81ba('0x8')],'priority':_0x3d88e2[_0x81ba('0x30')]['length']+_0xa25a9d+_0x49fad6++,'VoiceExtensionId':_0x2bf7ff['id']});}else{if(_0x3d88e2[_0x81ba('0x33')](_0x81ba('0x3a'))){if([_0x81ba('0x3b'),_0x81ba('0x3c')][_0x81ba('0x3d')](_0x3d88e2['app'][_0x81ba('0x32')]())&&_0x3d88e2[_0x81ba('0x3e')]!==_0x81ba('0x3f')){if(_0x3d88e2[_0x81ba('0x3a')]){_0x59561a['push']({'type':_0x3d88e2[_0x81ba('0x2')][_0x81ba('0x32')](),'app':_0x81ba('0x13'),'appdata':_0x81ba('0x40'),'context':_0x2bf7ff['context'],'exten':_0x2bf7ff[_0x81ba('0x8')],'priority':_0x3d88e2[_0x81ba('0x30')][_0x81ba('0x21')]+_0xa25a9d+_0x49fad6++,'VoiceExtensionId':_0x2bf7ff['id']});_0x59561a[_0x81ba('0xb')]({'type':_0x3d88e2['type'][_0x81ba('0x32')](),'app':'Set','appdata':_0x81ba('0x41'),'context':_0x2bf7ff[_0x81ba('0x7')],'exten':_0x2bf7ff[_0x81ba('0x8')],'priority':_0x3d88e2[_0x81ba('0x30')][_0x81ba('0x21')]+_0xa25a9d+_0x49fad6++,'VoiceExtensionId':_0x2bf7ff['id']});}else{_0x59561a[_0x81ba('0xb')]({'type':_0x3d88e2[_0x81ba('0x2')][_0x81ba('0x32')](),'app':'ExecIf','appdata':_0x81ba('0x42'),'context':_0x2bf7ff[_0x81ba('0x7')],'exten':_0x2bf7ff[_0x81ba('0x8')],'priority':_0x3d88e2[_0x81ba('0x30')][_0x81ba('0x21')]+_0xa25a9d+_0x49fad6++,'VoiceExtensionId':_0x2bf7ff['id']});_0x59561a[_0x81ba('0xb')]({'type':_0x3d88e2[_0x81ba('0x2')][_0x81ba('0x32')](),'app':'Set','appdata':_0x81ba('0x43'),'context':_0x2bf7ff[_0x81ba('0x7')],'exten':_0x2bf7ff[_0x81ba('0x8')],'priority':_0x3d88e2[_0x81ba('0x30')][_0x81ba('0x21')]+_0xa25a9d+_0x49fad6++,'VoiceExtensionId':_0x2bf7ff['id']});}}}}for(var _0x18c1b4=0x0;_0x18c1b4<_0x3d88e2[_0x81ba('0x30')][_0x81ba('0x21')];_0x18c1b4++){var _0x2dfbe6=_0xa25a9d+_0x3d88e2[_0x81ba('0x30')][_0x81ba('0x21')];var _0x16b052=_0x18c1b4===_0x3d88e2['intervals'][_0x81ba('0x21')]-0x1?_0xa25a9d+_0x59561a[_0x81ba('0x21')]+_0x2de5d1[_0x81ba('0x21')]+0x2:_0xa25a9d+_0x18c1b4+0x1;_0x59561a[_0x81ba('0x44')](_0x18c1b4,0x0,{'type':_0x2bf7ff[_0x81ba('0x2')],'app':_0x81ba('0x45'),'appdata':_0x3d88e2[_0x81ba('0x30')][_0x18c1b4]+'?'+_0x2bf7ff[_0x81ba('0x7')]+_0x81ba('0x46')+_0x2dfbe6+':'+_0x2bf7ff[_0x81ba('0x7')]+_0x81ba('0x46')+_0x16b052,'exten':_0x2bf7ff[_0x81ba('0x8')],'context':_0x2bf7ff[_0x81ba('0x7')],'priority':_0xa25a9d+_0x18c1b4,'VoiceExtensionId':_0x2bf7ff['id']});}if(_0x3d88e2[_0x81ba('0x3e')]===_0x81ba('0x47'))_0x3d88e2[_0x81ba('0x48')]=_0xa44eff(_0x2bf7ff,_0x3d88e2['appdata']);_0x3d88e2[_0x81ba('0x49')]=_0x59561a[_0x81ba('0x21')]?_[_0x81ba('0x4a')](_0x59561a)[_0x81ba('0x49')]+0x1:_0xa25a9d;_0x4eb70a=_['concat'](_0x4eb70a,_0x59561a,[_0x3d88e2],_0x2de5d1);_0xa25a9d=_[_0x81ba('0x4a')](_0x4eb70a)[_0x81ba('0x49')]+0x1;}return _0x3b3c38(_0x4eb70a);})[_0x81ba('0x4b')](function(_0x9afc29){_0xffeb41(_0x9afc29);});});}return _0x17f359[_0x81ba('0x4c')](_0x81ba('0x4d'),attributes,{'tableName':_0x81ba('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x163f28){var _0x2cbc2f=this[_0x81ba('0x4f')]({'plain':!![]});var _0x55a06e=_0x2cbc2f['type']===_0x81ba('0xe')?_0x3822ea(_0x2cbc2f):_0x57305e(_0x2cbc2f);return _0x450142(_0x2cbc2f,_0x163f28,_[_0x81ba('0x4a')](_0x55a06e)['priority']+0x1)['then'](function(_0x2c5ed1){var _0x244005=_['concat'](_0x55a06e,_0x2c5ed1);_0x244005[_0x81ba('0xb')]({'type':_0x2cbc2f[_0x81ba('0x2')],'app':_0x81ba('0x50'),'exten':_0x2cbc2f[_0x81ba('0x8')],'context':_0x2cbc2f[_0x81ba('0x7')],'priority':_[_0x81ba('0x4a')](_0x244005)[_0x81ba('0x49')]+0x1,'VoiceExtensionId':_0x2cbc2f['id']});return _0x244005;});}}});}; \ No newline at end of file +var _0x6c21=['define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','split','phone','prefix','param','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','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-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch'];(function(_0x1e8645,_0x2fff3b){var _0x5f1146=function(_0x3396a8){while(--_0x3396a8){_0x1e8645['push'](_0x1e8645['shift']());}};_0x5f1146(++_0x2fff3b);}(_0x6c21,0x1b2));var _0x16c2=function(_0x5202e8,_0x2446f9){_0x5202e8=_0x5202e8-0x0;var _0x2d9ee9=_0x6c21[_0x5202e8];return _0x2d9ee9;};'use strict';var _=require(_0x16c2('0x0'));var attributes=require(_0x16c2('0x1'));module[_0x16c2('0x2')]=function(_0x2c3d62){var _0x576ea4=_0x2c3d62[_0x16c2('0x3')];function _0x2019f9(_0x32c4cf){var _0x55dcd4=0x2;var _0x26204f=[{'type':_0x32c4cf['type'],'app':_0x16c2('0x4'),'appdata':_0x16c2('0x5')+_0x32c4cf[_0x16c2('0x6')],'context':_0x32c4cf[_0x16c2('0x7')],'exten':_0x32c4cf[_0x16c2('0x8')],'priority':_0x55dcd4++,'VoiceExtensionId':_0x32c4cf['id']},{'type':_0x32c4cf[_0x16c2('0x6')],'app':_0x32c4cf[_0x16c2('0x9')]?_0x16c2('0x4'):_0x16c2('0xa'),'appdata':_0x32c4cf[_0x16c2('0x9')]?_0x16c2('0xb')+_0x32c4cf[_0x16c2('0x9')]:'No\x20alias\x20set','context':_0x32c4cf[_0x16c2('0x7')],'exten':_0x32c4cf[_0x16c2('0x8')],'priority':_0x55dcd4++,'VoiceExtensionId':_0x32c4cf['id']}];if(_0x32c4cf['type']===_0x16c2('0xc')){_0x26204f[_0x16c2('0xd')]({'type':_0x16c2('0xc'),'app':'Set','appdata':_0x16c2('0xe')+_0x32c4cf['id'],'context':_0x32c4cf[_0x16c2('0x7')],'exten':_0x32c4cf['exten'],'priority':_0x55dcd4++,'VoiceExtensionId':_0x32c4cf['id']});}_0x26204f[_0x16c2('0xd')]({'type':_0x32c4cf[_0x16c2('0x6')],'app':_0x16c2('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x32c4cf[_0x16c2('0x7')],'exten':_0x32c4cf[_0x16c2('0x8')],'priority':_0x55dcd4++,'VoiceExtensionId':_0x32c4cf['id']},{'type':_0x32c4cf[_0x16c2('0x6')],'app':'Set','appdata':_0x16c2('0xf'),'context':_0x32c4cf[_0x16c2('0x7')],'exten':_0x32c4cf[_0x16c2('0x8')],'priority':_0x55dcd4++,'VoiceExtensionId':_0x32c4cf['id']},{'type':_0x32c4cf['type'],'app':'Set','appdata':_0x16c2('0x10'),'context':_0x32c4cf[_0x16c2('0x7')],'exten':_0x32c4cf['exten'],'priority':_0x55dcd4++,'VoiceExtensionId':_0x32c4cf['id']});return _0x26204f;}function _0x3a7fd1(_0x5808d3){var _0x387a17=0x2;var _0x1a88e3=[{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':_0x16c2('0x12'),'context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x5808d3[_0x16c2('0x9')]?'Set':_0x16c2('0xa'),'appdata':_0x5808d3['alias']?_0x16c2('0xb')+_0x5808d3['alias']:_0x16c2('0x13'),'context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':_0x16c2('0x14')+(_0x5808d3['cutdigits']?_0x16c2('0x15')+_0x5808d3[_0x16c2('0x16')]+'}':_0x16c2('0x17')),'context':_0x5808d3[_0x16c2('0x7')],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':_0x16c2('0xe')+_0x5808d3['id'],'context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x387a17+0x2)+_0x16c2('0x19')+(_0x387a17+0x1)+')','context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':'Set','appdata':_0x5808d3[_0x16c2('0x16')]?_0x16c2('0x1a')+_0x5808d3[_0x16c2('0x16')]+'}':_0x16c2('0x1b'),'context':_0x5808d3[_0x16c2('0x7')],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':_0x16c2('0x1c'),'context':_0x5808d3[_0x16c2('0x7')],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':_0x16c2('0xf'),'context':_0x5808d3[_0x16c2('0x7')],'exten':_0x5808d3['exten'],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':_0x16c2('0x10'),'context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':_0x16c2('0x4'),'appdata':'outboundrouteid='+_0x5808d3['id'],'context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']}];if(_0x5808d3[_0x16c2('0x1d')](_0x16c2('0x1e'))&&_0x5808d3[_0x16c2('0x1e')]!=='none'){_0x1a88e3['push']({'type':'outbound','app':_0x16c2('0x4'),'appdata':_0x16c2('0x1f'),'context':_0x5808d3['context'],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']},{'type':_0x16c2('0x11'),'app':'Set','appdata':_0x16c2('0x20')+_0x5808d3[_0x16c2('0x1e')]||_0x16c2('0x21'),'context':_0x5808d3[_0x16c2('0x7')],'exten':_0x5808d3[_0x16c2('0x8')],'priority':_0x387a17++,'VoiceExtensionId':_0x5808d3['id']});}return _0x1a88e3;}function _0x515172(_0x492da5,_0x33e0dc){var _0x1fd885=[{'name':_0x16c2('0x22'),'param':0x0},{'name':_0x16c2('0x23'),'param':0x1},{'name':_0x16c2('0x24'),'param':0x2},{'name':_0x16c2('0x25'),'param':0x3}];var _0x426370={};var _0x17e8dc=_0x33e0dc['split'](',');var _0x2a1552=[];for(var _0x5d25b4=0x0;_0x5d25b4<_0x1fd885[_0x16c2('0x26')];_0x5d25b4++){switch(_0x1fd885[_0x5d25b4]['name']){case _0x16c2('0x22'):_0x426370[_0x16c2('0x22')]=_0x17e8dc[_0x1fd885[_0x5d25b4]['param']]['split']('/')[0x1];_0x426370['phone']=_0x17e8dc[_0x1fd885[_0x5d25b4]['param']][_0x16c2('0x27')]('/')[0x2];_0x426370['prefix']=_0x426370[_0x16c2('0x28')]?_0x426370[_0x16c2('0x28')]['split']('$')[0x0]:undefined;_0x426370[_0x16c2('0x28')]=_0x492da5['cutdigits']?(_0x426370[_0x16c2('0x29')]||'')+'${EXTEN:'+_0x492da5['cutdigits']+'}':(_0x426370[_0x16c2('0x29')]||'')+_0x16c2('0x17');_0x2a1552[_0x1fd885[_0x5d25b4][_0x16c2('0x2a')]]=[_0x16c2('0x2b'),_0x426370[_0x16c2('0x22')],_0x426370[_0x16c2('0x28')]][_0x16c2('0x2c')]('/');break;case _0x16c2('0x24'):_0x426370[_0x16c2('0x24')]=_0x17e8dc[_0x1fd885[_0x5d25b4][_0x16c2('0x2a')]];if(_0x492da5[_0x16c2('0x1e')]!==_0x16c2('0x2d')){if(_0x426370[_0x16c2('0x24')][_0x16c2('0x2e')](_0x16c2('0x2f'))<0x0){_0x426370[_0x16c2('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x426370['options']=_0x426370['options'][_0x16c2('0x30')](_0x16c2('0x2f'),'');}_0x2a1552[_0x1fd885[_0x5d25b4][_0x16c2('0x2a')]]=_0x426370[_0x16c2('0x24')];break;default:_0x2a1552[_0x1fd885[_0x5d25b4][_0x16c2('0x2a')]]=_0x17e8dc[_0x1fd885[_0x5d25b4][_0x16c2('0x2a')]];}}return _0x2a1552['join'](',');}function _0x5f2f5c(_0x3a0c74,_0x28a42e,_0x1c3ec9){return new Promise(function(_0x3813fc,_0x112f41){var _0x4e74a8=[];if(_[_0x16c2('0x31')](_0x28a42e))return _0x3813fc(_0x4e74a8);_0x576ea4[_0x16c2('0x32')]['findAll']({'attributes':['id',_0x16c2('0x33'),_0x16c2('0x34')],'raw':!![]})[_0x16c2('0x35')](function(_0x1098b4){for(var _0x23f471=0x0,_0x2be382=0x0;_0x23f471<_0x28a42e['length'];_0x23f471++,_0x2be382=0x0){var _0x1f1977=_0x28a42e[_0x23f471];var _0x201b99=[];var _0x2bcc9b=[];delete _0x1f1977['id'];if(_0x1f1977[_0x16c2('0x33')]!=='*,*,*,*'){_0x1f1977[_0x16c2('0x36')]=[_0x1f1977[_0x16c2('0x33')]];}else{_0x1f1977[_0x16c2('0x36')]=_0x1f1977[_0x16c2('0x34')]?_[_0x16c2('0x37')](_[_0x16c2('0x38')](_0x1098b4,{'IntervalId':_0x1f1977[_0x16c2('0x34')]}),'interval'):[];}_0x1f1977[_0x16c2('0x7')]=_0x3a0c74['context'];_0x1f1977[_0x16c2('0x8')]=_0x3a0c74[_0x16c2('0x8')];if(_0x1f1977[_0x16c2('0x6')])_0x1f1977['type']=_0x1f1977[_0x16c2('0x6')][_0x16c2('0x39')]();if(_0x3a0c74['type']==='outbound'){if(_0x1f1977['hasOwnProperty'](_0x16c2('0x3a'))&&_0x1f1977[_0x16c2('0x3a')]&&_0x1f1977['tag']!=='--'){_0x201b99[_0x16c2('0xd')]({'type':_0x1f1977[_0x16c2('0x6')]['toLowerCase'](),'app':'Set','appdata':_0x16c2('0x3b')+_0x1f1977[_0x16c2('0x3a')],'context':_0x3a0c74[_0x16c2('0x7')],'exten':_0x3a0c74[_0x16c2('0x8')],'priority':_0x1f1977['intervals'][_0x16c2('0x26')]+_0x1c3ec9+_0x2be382++,'VoiceExtensionId':_0x3a0c74['id']});}_0x201b99['push']({'type':_0x1f1977[_0x16c2('0x6')][_0x16c2('0x39')](),'app':_0x16c2('0x18'),'appdata':_0x16c2('0x3c')+(_0x1f1977[_0x16c2('0x3d')]?_0x16c2('0x3e')+_0x1f1977[_0x16c2('0x3d')]+')':_0x16c2('0x3f')),'context':_0x3a0c74[_0x16c2('0x7')],'exten':_0x3a0c74[_0x16c2('0x8')],'priority':_0x1f1977[_0x16c2('0x36')][_0x16c2('0x26')]+_0x1c3ec9+_0x2be382++,'VoiceExtensionId':_0x3a0c74['id']});}else{if(_0x1f1977[_0x16c2('0x1d')](_0x16c2('0x40'))){if([_0x16c2('0x41'),_0x16c2('0x42')][_0x16c2('0x43')](_0x1f1977[_0x16c2('0x44')]['toLowerCase']())&&_0x1f1977['appType']!==_0x16c2('0x45')){if(_0x1f1977[_0x16c2('0x40')]){_0x201b99[_0x16c2('0xd')]({'type':_0x1f1977[_0x16c2('0x6')][_0x16c2('0x39')](),'app':'ExecIf','appdata':_0x16c2('0x46'),'context':_0x3a0c74[_0x16c2('0x7')],'exten':_0x3a0c74[_0x16c2('0x8')],'priority':_0x1f1977['intervals'][_0x16c2('0x26')]+_0x1c3ec9+_0x2be382++,'VoiceExtensionId':_0x3a0c74['id']});_0x201b99['push']({'type':_0x1f1977[_0x16c2('0x6')][_0x16c2('0x39')](),'app':_0x16c2('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3a0c74[_0x16c2('0x7')],'exten':_0x3a0c74[_0x16c2('0x8')],'priority':_0x1f1977[_0x16c2('0x36')]['length']+_0x1c3ec9+_0x2be382++,'VoiceExtensionId':_0x3a0c74['id']});}else{_0x201b99['push']({'type':_0x1f1977[_0x16c2('0x6')][_0x16c2('0x39')](),'app':_0x16c2('0x18'),'appdata':_0x16c2('0x47'),'context':_0x3a0c74[_0x16c2('0x7')],'exten':_0x3a0c74[_0x16c2('0x8')],'priority':_0x1f1977[_0x16c2('0x36')]['length']+_0x1c3ec9+_0x2be382++,'VoiceExtensionId':_0x3a0c74['id']});_0x201b99[_0x16c2('0xd')]({'type':_0x1f1977[_0x16c2('0x6')][_0x16c2('0x39')](),'app':_0x16c2('0x4'),'appdata':_0x16c2('0x48'),'context':_0x3a0c74[_0x16c2('0x7')],'exten':_0x3a0c74['exten'],'priority':_0x1f1977[_0x16c2('0x36')][_0x16c2('0x26')]+_0x1c3ec9+_0x2be382++,'VoiceExtensionId':_0x3a0c74['id']});}}}}for(var _0x450019=0x0;_0x450019<_0x1f1977['intervals']['length'];_0x450019++){var _0x52cac5=_0x1c3ec9+_0x1f1977['intervals'][_0x16c2('0x26')];var _0x5a5f3b=_0x450019===_0x1f1977['intervals'][_0x16c2('0x26')]-0x1?_0x1c3ec9+_0x201b99[_0x16c2('0x26')]+_0x2bcc9b[_0x16c2('0x26')]+0x2:_0x1c3ec9+_0x450019+0x1;_0x201b99['splice'](_0x450019,0x0,{'type':_0x3a0c74[_0x16c2('0x6')],'app':_0x16c2('0x49'),'appdata':_0x1f1977['intervals'][_0x450019]+'?'+_0x3a0c74['context']+_0x16c2('0x4a')+_0x52cac5+':'+_0x3a0c74[_0x16c2('0x7')]+_0x16c2('0x4a')+_0x5a5f3b,'exten':_0x3a0c74[_0x16c2('0x8')],'context':_0x3a0c74['context'],'priority':_0x1c3ec9+_0x450019,'VoiceExtensionId':_0x3a0c74['id']});}if(_0x1f1977[_0x16c2('0x4b')]===_0x16c2('0x4c'))_0x1f1977[_0x16c2('0x4d')]=_0x515172(_0x3a0c74,_0x1f1977[_0x16c2('0x4d')]);_0x1f1977[_0x16c2('0x4e')]=_0x201b99[_0x16c2('0x26')]?_[_0x16c2('0x4f')](_0x201b99)[_0x16c2('0x4e')]+0x1:_0x1c3ec9;_0x4e74a8=_[_0x16c2('0x50')](_0x4e74a8,_0x201b99,[_0x1f1977],_0x2bcc9b);_0x1c3ec9=_['last'](_0x4e74a8)[_0x16c2('0x4e')]+0x1;}return _0x3813fc(_0x4e74a8);})[_0x16c2('0x51')](function(_0x475f3f){_0x112f41(_0x475f3f);});});}return _0x2c3d62[_0x16c2('0x52')](_0x16c2('0x53'),attributes,{'tableName':_0x16c2('0x54'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3f5675){var _0x329769=this['get']({'plain':!![]});var _0xeb24b6=_0x329769[_0x16c2('0x6')]===_0x16c2('0x11')?_0x3a7fd1(_0x329769):_0x2019f9(_0x329769);return _0x5f2f5c(_0x329769,_0x3f5675,_[_0x16c2('0x4f')](_0xeb24b6)[_0x16c2('0x4e')]+0x1)[_0x16c2('0x35')](function(_0xb4d2df){var _0x220582=_[_0x16c2('0x50')](_0xeb24b6,_0xb4d2df);_0x220582[_0x16c2('0xd')]({'type':_0x329769[_0x16c2('0x6')],'app':_0x16c2('0x55'),'exten':_0x329769[_0x16c2('0x8')],'context':_0x329769[_0x16c2('0x7')],'priority':_[_0x16c2('0x4f')](_0x220582)[_0x16c2('0x4e')]+0x1,'VoiceExtensionId':_0x329769['id']});return _0x220582;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 00d3453..ae57abb 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 _0x30bc=['model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x5237b2,_0x4764f4){var _0x4e3b4f=function(_0x5dbd1c){while(--_0x5dbd1c){_0x5237b2['push'](_0x5237b2['shift']());}};_0x4e3b4f(++_0x4764f4);}(_0x30bc,0x149));var _0xc30b=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x30bc[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var moment=require(_0xc30b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc30b('0x3'));var fs=require('fs');var Redis=require(_0xc30b('0x4'));var db=require(_0xc30b('0x5'))['db'];var utils=require(_0xc30b('0x6'));var logger=require(_0xc30b('0x7'))(_0xc30b('0x8'));var config=require(_0xc30b('0x9'));var jayson=require(_0xc30b('0xa'));var client=jayson[_0xc30b('0xb')][_0xc30b('0xc')]({'port':0x232a});config['redis']=_[_0xc30b('0xd')](config[_0xc30b('0xe')],{'host':_0xc30b('0xf'),'port':0x18eb});var socket=require(_0xc30b('0x10'))(new Redis(config['redis']));require(_0xc30b('0x11'))['register'](socket);function respondWithRpcPromise(_0x1a1177,_0x3df4a2,_0x5384a2){return new BPromise(function(_0x5a9807,_0x25186f){return client[_0xc30b('0x12')](_0x1a1177,_0x5384a2)[_0xc30b('0x13')](function(_0x30fd8b){logger[_0xc30b('0x14')](_0xc30b('0x15'),_0x3df4a2,'request\x20sent');logger[_0xc30b('0x16')](_0xc30b('0x17'),_0x3df4a2,'request\x20sent',JSON[_0xc30b('0x18')](_0x30fd8b));if(_0x30fd8b[_0xc30b('0x19')]){if(_0x30fd8b['error'][_0xc30b('0x1a')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x3df4a2,_0x30fd8b['error'][_0xc30b('0x1b')]);return _0x25186f(_0x30fd8b['error'][_0xc30b('0x1b')]);}logger[_0xc30b('0x19')](_0xc30b('0x15'),_0x3df4a2,_0x30fd8b[_0xc30b('0x19')]['message']);return _0x5a9807(_0x30fd8b[_0xc30b('0x19')][_0xc30b('0x1b')]);}else{logger[_0xc30b('0x14')](_0xc30b('0x15'),_0x3df4a2,_0xc30b('0x1c'));_0x5a9807(_0x30fd8b[_0xc30b('0x1d')]['message']);}})[_0xc30b('0x1e')](function(_0x13ba43){logger[_0xc30b('0x19')](_0xc30b('0x15'),_0x3df4a2,_0x13ba43);_0x25186f(_0x13ba43);});});}exports[_0xc30b('0x1f')]=function(_0x3db4eb){var _0x3e9297=this;return new Promise(function(_0x5994be,_0x2172a6){return db['VoiceExtension'][_0xc30b('0x20')]({'raw':_0x3db4eb[_0xc30b('0x21')]?_0x3db4eb[_0xc30b('0x21')][_0xc30b('0x22')]===undefined?!![]:![]:!![],'where':_0x3db4eb['options']?_0x3db4eb[_0xc30b('0x21')][_0xc30b('0x23')]||null:null,'attributes':_0x3db4eb['options']?_0x3db4eb['options'][_0xc30b('0x24')]||null:null,'limit':_0x3db4eb['options']?_0x3db4eb['options'][_0xc30b('0x25')]||null:null,'include':_0x3db4eb[_0xc30b('0x21')]?_0x3db4eb[_0xc30b('0x21')]['include']?_[_0xc30b('0x26')](_0x3db4eb[_0xc30b('0x21')][_0xc30b('0x27')],function(_0x575318){return{'model':db[_0x575318[_0xc30b('0x28')]],'as':_0x575318['as'],'attributes':_0x575318[_0xc30b('0x24')],'include':_0x575318[_0xc30b('0x27')]?_[_0xc30b('0x26')](_0x575318[_0xc30b('0x27')],function(_0x241f30){return{'model':db[_0x241f30['model']],'as':_0x241f30['as'],'attributes':_0x241f30[_0xc30b('0x24')],'include':_0x241f30[_0xc30b('0x27')]?_['map'](_0x241f30['include'],function(_0x37c5ae){return{'model':db[_0x37c5ae['model']],'as':_0x37c5ae['as'],'attributes':_0x37c5ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xc30b('0x13')](function(_0x53f0bc){logger[_0xc30b('0x14')](_0xc30b('0x1f'),_0x3db4eb);logger[_0xc30b('0x16')](_0xc30b('0x1f'),_0x3db4eb,JSON['stringify'](_0x53f0bc));_0x5994be(_0x53f0bc);})[_0xc30b('0x1e')](function(_0x109693){logger[_0xc30b('0x19')](_0xc30b('0x1f'),_0x109693[_0xc30b('0x1b')],_0x3db4eb);_0x2172a6(_0x3e9297['error'](0x1f4,_0x109693[_0xc30b('0x1b')]));});});}; \ No newline at end of file +var _0xff2a=['model','map','GetVoiceExtension','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','include'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xff2a,0x93));var _0xaff2=function(_0x5e410d,_0x4eaf38){_0x5e410d=_0x5e410d-0x0;var _0xa97676=_0xff2a[_0x5e410d];return _0xa97676;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var moment=require(_0xaff2('0x1'));var BPromise=require('bluebird');var rs=require(_0xaff2('0x2'));var fs=require('fs');var Redis=require(_0xaff2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff2('0x4'));var logger=require('../../config/logger')(_0xaff2('0x5'));var config=require(_0xaff2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaff2('0x7')][_0xaff2('0x8')]({'port':0x232a});config[_0xaff2('0x9')]=_[_0xaff2('0xa')](config[_0xaff2('0x9')],{'host':_0xaff2('0xb'),'port':0x18eb});var socket=require(_0xaff2('0xc'))(new Redis(config[_0xaff2('0x9')]));require(_0xaff2('0xd'))[_0xaff2('0xe')](socket);function respondWithRpcPromise(_0x5f2c47,_0x463233,_0x558f67){return new BPromise(function(_0x4e031d,_0x184f5b){return client[_0xaff2('0xf')](_0x5f2c47,_0x558f67)[_0xaff2('0x10')](function(_0x26de0d){logger[_0xaff2('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x463233,_0xaff2('0x12'));logger[_0xaff2('0x13')](_0xaff2('0x14'),_0x463233,'request\x20sent',JSON[_0xaff2('0x15')](_0x26de0d));if(_0x26de0d[_0xaff2('0x16')]){if(_0x26de0d['error'][_0xaff2('0x17')]===0x1f4){logger['error'](_0xaff2('0x18'),_0x463233,_0x26de0d['error']['message']);return _0x184f5b(_0x26de0d[_0xaff2('0x16')]['message']);}logger[_0xaff2('0x16')](_0xaff2('0x18'),_0x463233,_0x26de0d[_0xaff2('0x16')][_0xaff2('0x19')]);return _0x4e031d(_0x26de0d[_0xaff2('0x16')]['message']);}else{logger[_0xaff2('0x11')](_0xaff2('0x18'),_0x463233,_0xaff2('0x12'));_0x4e031d(_0x26de0d[_0xaff2('0x1a')][_0xaff2('0x19')]);}})[_0xaff2('0x1b')](function(_0x227720){logger['error'](_0xaff2('0x18'),_0x463233,_0x227720);_0x184f5b(_0x227720);});});}exports['GetVoiceExtension']=function(_0x1e61d6){var _0x5a393b=this;return new Promise(function(_0x528b15,_0x353ed0){return db['VoiceExtension']['findAll']({'raw':_0x1e61d6[_0xaff2('0x1c')]?_0x1e61d6[_0xaff2('0x1c')][_0xaff2('0x1d')]===undefined?!![]:![]:!![],'where':_0x1e61d6[_0xaff2('0x1c')]?_0x1e61d6[_0xaff2('0x1c')][_0xaff2('0x1e')]||null:null,'attributes':_0x1e61d6['options']?_0x1e61d6['options'][_0xaff2('0x1f')]||null:null,'limit':_0x1e61d6[_0xaff2('0x1c')]?_0x1e61d6['options']['limit']||null:null,'include':_0x1e61d6[_0xaff2('0x1c')]?_0x1e61d6[_0xaff2('0x1c')][_0xaff2('0x20')]?_['map'](_0x1e61d6[_0xaff2('0x1c')][_0xaff2('0x20')],function(_0x3d3d39){return{'model':db[_0x3d3d39[_0xaff2('0x21')]],'as':_0x3d3d39['as'],'attributes':_0x3d3d39[_0xaff2('0x1f')],'include':_0x3d3d39[_0xaff2('0x20')]?_[_0xaff2('0x22')](_0x3d3d39[_0xaff2('0x20')],function(_0x173365){return{'model':db[_0x173365[_0xaff2('0x21')]],'as':_0x173365['as'],'attributes':_0x173365[_0xaff2('0x1f')],'include':_0x173365[_0xaff2('0x20')]?_[_0xaff2('0x22')](_0x173365['include'],function(_0x3ccb90){return{'model':db[_0x3ccb90[_0xaff2('0x21')]],'as':_0x3ccb90['as'],'attributes':_0x3ccb90['attributes']};}):[]};}):[]};}):[]:[]})[_0xaff2('0x10')](function(_0x3e182f){logger['info'](_0xaff2('0x23'),_0x1e61d6);logger[_0xaff2('0x13')](_0xaff2('0x23'),_0x1e61d6,JSON[_0xaff2('0x15')](_0x3e182f));_0x528b15(_0x3e182f);})[_0xaff2('0x1b')](function(_0x18774f){logger[_0xaff2('0x16')](_0xaff2('0x23'),_0x18774f[_0xaff2('0x19')],_0x1e61d6);_0x353ed0(_0x5a393b[_0xaff2('0x16')](0x1f4,_0x18774f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 9409fc3..79cd10d 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 _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x51e61e,_0x3333d7){var _0x20d53a=function(_0x1b376f){while(--_0x1b376f){_0x51e61e['push'](_0x51e61e['shift']());}};_0x20d53a(++_0x3333d7);}(_0xf494,0x1c6));var _0x4f49=function(_0x363bb4,_0x1c6d74){_0x363bb4=_0x363bb4-0x0;var _0x51216a=_0xf494[_0x363bb4];return _0x51216a;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x4991e6,_0x64a838){var _0x141f72=function(_0x30ccd1){while(--_0x30ccd1){_0x4991e6['push'](_0x4991e6['shift']());}};_0x141f72(++_0x64a838);}(_0x326f,0xd1));var _0xf326=function(_0x2c0a74,_0x3f5bb5){_0x2c0a74=_0x2c0a74-0x0;var _0x5dd615=_0x326f[_0x2c0a74];return _0x5dd615;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index bbfdd66..edb30d3 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 _0xbff5=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xbff5,0x1bc));var _0x5bff=function(_0x2d5509,_0x140c44){_0x2d5509=_0x2d5509-0x0;var _0xf20686=_0xbff5[_0x2d5509];return _0xf20686;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['post']('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xf')]);router['put'](_0x5bff('0xb'),auth['isAuthenticated'](),controller[_0x5bff('0x10')]);router['delete'](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller['destroy']);module[_0x5bff('0x11')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5cbf84,_0x28b0f9){_0x5cbf84=_0x5cbf84-0x0;var _0x2cff5e=_0x5f2f[_0x5cbf84];return _0x2cff5e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 2b33dad..a38a369 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 _0x1897=['getDataValue','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1897,0x8b));var _0x7189=function(_0x563458,_0x24ea87){_0x563458=_0x563458-0x0;var _0x3950b3=_0x1897[_0x563458];return _0x3950b3;};'use strict';var Sequelize=require('sequelize');module[_0x7189('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7189('0x1')],'defaultValue':_0x7189('0x2'),'unique':_0x7189('0x3')},'mailbox':{'type':Sequelize[_0x7189('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7189('0x1')]},'fullname':{'type':Sequelize[_0x7189('0x1')]},'email':{'type':Sequelize[_0x7189('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5d5775){this['setDataValue'](_0x7189('0x4'),typeof _0x5d5775===_0x7189('0x5')&&_0x5d5775[_0x7189('0x6')]()?_0x5d5775[_0x7189('0x6')]():null);}},'pager':{'type':Sequelize[_0x7189('0x1')]},'tz':{'type':Sequelize[_0x7189('0x1')],'defaultValue':_0x7189('0x7')},'attach':{'type':Sequelize[_0x7189('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x7189('0x1')]},'callback':{'type':Sequelize[_0x7189('0x1')]},'review':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7189('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x7189('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x7189('0x8')](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x7189('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x7189('0x9'),'no'),'defaultValue':_0x7189('0x9'),'allowNull':![]},'stamp':{'type':_0x7189('0xb')},'emailsubject':{'type':Sequelize[_0x7189('0x1')]},'emailbody':{'type':Sequelize[_0x7189('0x1')]},'maxsecs':{'type':Sequelize[_0x7189('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7189('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7189('0xd')],'get':function(){return this[_0x7189('0xe')]('fullname')+_0x7189('0xf')+this['getDataValue'](_0x7189('0x10'));}}}; \ No newline at end of file +var _0x8a90=['contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x8a90,0x9f));var _0x08a9=function(_0x4584b7,_0x396a41){_0x4584b7=_0x4584b7-0x0;var _0x2bbf5c=_0x8a90[_0x4584b7];return _0x2bbf5c;};'use strict';var Sequelize=require(_0x08a9('0x0'));module[_0x08a9('0x1')]={'customer_id':{'type':Sequelize[_0x08a9('0x2')]},'context':{'type':Sequelize[_0x08a9('0x2')],'defaultValue':'from-voicemail','unique':_0x08a9('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x08a9('0x3')},'password':{'type':Sequelize[_0x08a9('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x08a9('0x2')],'validate':{'isEmail':!![]},'set':function(_0x537412){this[_0x08a9('0x4')](_0x08a9('0x5'),typeof _0x537412==='string'&&_0x537412[_0x08a9('0x6')]()?_0x537412[_0x08a9('0x6')]():null);}},'pager':{'type':Sequelize[_0x08a9('0x2')]},'tz':{'type':Sequelize[_0x08a9('0x2')],'defaultValue':_0x08a9('0x7')},'attach':{'type':Sequelize[_0x08a9('0x8')](_0x08a9('0x9'),'no'),'defaultValue':_0x08a9('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x08a9('0x9'),'no'),'defaultValue':_0x08a9('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x08a9('0x2')]},'review':{'type':Sequelize['ENUM'](_0x08a9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x08a9('0x8')](_0x08a9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x08a9('0x8')](_0x08a9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x08a9('0x8')](_0x08a9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x08a9('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x08a9('0x8')](_0x08a9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x08a9('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x08a9('0x8')]('yes','no'),'defaultValue':_0x08a9('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x08a9('0x8')](_0x08a9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x08a9('0x9'),'no'),'defaultValue':_0x08a9('0x9'),'allowNull':![]},'stamp':{'type':_0x08a9('0xb')},'emailsubject':{'type':Sequelize[_0x08a9('0x2')]},'emailbody':{'type':Sequelize[_0x08a9('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x08a9('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x08a9('0xd')],'get':function(){return this[_0x08a9('0xe')](_0x08a9('0xf'))+_0x08a9('0x10')+this[_0x08a9('0xe')](_0x08a9('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 2b351ae..d3c8d38 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 _0xf290=['UserProfileResource','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getMessages','VoiceMailMessage','hasOwnProperty','nolimit','order','pick','mailbox','findAndCountAll','rimraf','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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','Voicemails'];(function(_0x1beb83,_0x1b1a75){var _0x267710=function(_0x1e8d0b){while(--_0x1e8d0b){_0x1beb83['push'](_0x1beb83['shift']());}};_0x267710(++_0x1b1a75);}(_0xf290,0xde));var _0x0f29=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xf290[_0x260f28];return _0x3aefcc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];function respondWithStatusCode(_0x26bbec,_0x222c42){_0x222c42=_0x222c42||0xcc;return function(_0x195424){if(_0x195424){return _0x26bbec[_0x0f29('0x19')](_0x222c42);}return _0x26bbec['status'](_0x222c42)[_0x0f29('0x1a')]();};}function respondWithResult(_0x39961f,_0x2bb7b8){_0x2bb7b8=_0x2bb7b8||0xc8;return function(_0x368984){if(_0x368984){return _0x39961f[_0x0f29('0x1b')](_0x2bb7b8)[_0x0f29('0x1c')](_0x368984);}};}function respondWithFilteredResult(_0x1c518,_0x69df36){return function(_0x547404){if(_0x547404){var _0x4ac37d=typeof _0x69df36[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x69df36[_0x0f29('0x1f')]===_0x0f29('0x1e');var _0x4b3f0b=_0x547404[_0x0f29('0x20')];var _0x5d72a5=_0x4ac37d?0x0:_0x69df36[_0x0f29('0x1d')];var _0x4ca5e8=_0x4ac37d?_0x547404['count']:_0x69df36['offset']+_0x69df36[_0x0f29('0x1f')];var _0x8fc03f;if(_0x4ca5e8>=_0x4b3f0b){_0x4ca5e8=_0x4b3f0b;_0x8fc03f=0xc8;}else{_0x8fc03f=0xce;}_0x1c518[_0x0f29('0x1b')](_0x8fc03f);return _0x1c518[_0x0f29('0x21')](_0x0f29('0x22'),_0x5d72a5+'-'+_0x4ca5e8+'/'+_0x4b3f0b)[_0x0f29('0x1c')](_0x547404);}return null;};}function patchUpdates(_0x150271){return function(_0x4888b6){try{jsonpatch[_0x0f29('0x23')](_0x4888b6,_0x150271,!![]);}catch(_0x5a5a03){return BPromise['reject'](_0x5a5a03);}return _0x4888b6['save']();};}function saveUpdates(_0x5d94b9,_0x38a1ce){return function(_0x4a9dd8){if(_0x4a9dd8){return _0x4a9dd8['update'](_0x5d94b9)[_0x0f29('0x24')](function(_0x1840e0){return _0x1840e0;});}return null;};}function removeEntity(_0x346db8,_0x3402dc){return function(_0x29ca73){if(_0x29ca73){return _0x29ca73['destroy']()[_0x0f29('0x24')](function(){var _0x5a440f=_0x29ca73[_0x0f29('0x25')]({'plain':!![]});var _0x26f46f=_0x0f29('0x26');return db[_0x0f29('0x27')]['destroy']({'where':{'type':_0x26f46f,'resourceId':_0x5a440f['id']}})[_0x0f29('0x24')](function(){return _0x29ca73;});})['then'](function(){_0x346db8['status'](0xcc)[_0x0f29('0x1a')]();});}};}function handleEntityNotFound(_0x5c0202,_0x5bfcac){return function(_0x57dcc7){if(!_0x57dcc7){_0x5c0202['sendStatus'](0x194);}return _0x57dcc7;};}function handleError(_0x3c6ce9,_0x1f4ad2){_0x1f4ad2=_0x1f4ad2||0x1f4;return function(_0x4cc5a0){logger[_0x0f29('0x28')](_0x4cc5a0[_0x0f29('0x29')]);if(_0x4cc5a0[_0x0f29('0x2a')]){delete _0x4cc5a0['name'];}_0x3c6ce9['status'](_0x1f4ad2)[_0x0f29('0x2b')](_0x4cc5a0);};}exports['index']=function(_0x36b65c,_0x561c31){var _0x526364={},_0x7b10f={},_0x409b19={'count':0x0,'rows':[]};var _0xf59431=_[_0x0f29('0x2c')](db['VoiceMail']['rawAttributes'],function(_0x3bb3c8){return{'name':_0x3bb3c8['fieldName'],'type':_0x3bb3c8['type'][_0x0f29('0x2d')]};});_0x7b10f['model']=_[_0x0f29('0x2c')](_0xf59431,'name');_0x7b10f['query']=_[_0x0f29('0x2e')](_0x36b65c[_0x0f29('0x2f')]);_0x7b10f[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x7b10f[_0x0f29('0x32')],_0x7b10f['query']);_0x526364[_0x0f29('0x33')]=_['intersection'](_0x7b10f[_0x0f29('0x32')],qs[_0x0f29('0x34')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x34')]));_0x526364['attributes']=_0x526364[_0x0f29('0x33')][_0x0f29('0x35')]?_0x526364['attributes']:_0x7b10f[_0x0f29('0x32')];if(!_0x36b65c[_0x0f29('0x2f')]['hasOwnProperty']('nolimit')){_0x526364[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x1f')]);_0x526364[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x36b65c['query'][_0x0f29('0x1d')]);}_0x526364['order']=qs[_0x0f29('0x36')](_0x36b65c['query'][_0x0f29('0x36')]);_0x526364[_0x0f29('0x37')]=qs[_0x0f29('0x30')](_['pick'](_0x36b65c['query'],_0x7b10f[_0x0f29('0x30')]),_0xf59431);if(_0x36b65c['query'][_0x0f29('0x38')]){_0x526364[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x526364[_0x0f29('0x37')],{'$or':_[_0x0f29('0x2c')](_0xf59431,function(_0x5afbb8){if(_0x5afbb8[_0x0f29('0x3a')]!==_0x0f29('0x3b')){var _0x42872b={};_0x42872b[_0x5afbb8[_0x0f29('0x2a')]]={'$like':'%'+_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x38')]+'%'};return _0x42872b;}})});}_0x526364=_[_0x0f29('0x39')]({},_0x526364,_0x36b65c[_0x0f29('0x3c')]);var _0x250b20={'where':_0x526364['where']};return db[_0x0f29('0x3d')][_0x0f29('0x20')](_0x250b20)[_0x0f29('0x24')](function(_0x11b1dc){_0x409b19['count']=_0x11b1dc;if(_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x526364[_0x0f29('0x3f')]=[{'all':!![]}];}return db[_0x0f29('0x3d')][_0x0f29('0x40')](_0x526364);})['then'](function(_0x410c59){_0x409b19[_0x0f29('0x41')]=_0x410c59;return _0x409b19;})[_0x0f29('0x24')](respondWithFilteredResult(_0x561c31,_0x526364))['catch'](handleError(_0x561c31,null));};exports[_0x0f29('0x42')]=function(_0x284279,_0x3a6479){var _0x338412={'raw':!![],'where':{'id':_0x284279[_0x0f29('0x43')]['id']}},_0x35f753={};_0x35f753[_0x0f29('0x32')]=_[_0x0f29('0x2e')](db['VoiceMail']['rawAttributes']);_0x35f753['query']=_[_0x0f29('0x2e')](_0x284279[_0x0f29('0x2f')]);_0x35f753[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x35f753[_0x0f29('0x32')],_0x35f753[_0x0f29('0x2f')]);_0x338412['attributes']=_[_0x0f29('0x31')](_0x35f753['model'],qs[_0x0f29('0x34')](_0x284279['query'][_0x0f29('0x34')]));_0x338412[_0x0f29('0x33')]=_0x338412[_0x0f29('0x33')][_0x0f29('0x35')]?_0x338412[_0x0f29('0x33')]:_0x35f753['model'];if(_0x284279[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x338412[_0x0f29('0x3f')]=[{'all':!![]}];}_0x338412=_['merge']({},_0x338412,_0x284279[_0x0f29('0x3c')]);return db['VoiceMail']['find'](_0x338412)[_0x0f29('0x24')](handleEntityNotFound(_0x3a6479,null))[_0x0f29('0x24')](respondWithResult(_0x3a6479,null))[_0x0f29('0x44')](handleError(_0x3a6479,null));};exports[_0x0f29('0x45')]=function(_0x20aa53,_0x335435){return db['VoiceMail'][_0x0f29('0x45')](_0x20aa53[_0x0f29('0x46')],{})[_0x0f29('0x24')](function(_0x857564){var _0x2455d2=_0x20aa53[_0x0f29('0x47')][_0x0f29('0x25')]({'plain':!![]});if(!_0x2455d2)throw new Error(_0x0f29('0x48'));if(_0x2455d2[_0x0f29('0x49')]===_0x0f29('0x47')){var _0x5cd4a9=_0x857564['get']({'plain':!![]});var _0xa6231e=_0x0f29('0x26');return db[_0x0f29('0x4a')][_0x0f29('0x4b')]({'where':{'name':_0xa6231e,'userProfileId':_0x2455d2['userProfileId']},'raw':!![]})[_0x0f29('0x24')](function(_0xd624ad){if(_0xd624ad&&_0xd624ad[_0x0f29('0x4c')]===0x0){return db[_0x0f29('0x27')][_0x0f29('0x45')]({'name':_0x5cd4a9[_0x0f29('0x2a')],'resourceId':_0x5cd4a9['id'],'type':_0xd624ad[_0x0f29('0x2a')],'sectionId':_0xd624ad['id']},{})['then'](function(){return _0x857564;});}else{return _0x857564;}})[_0x0f29('0x44')](function(_0x6c1800){logger[_0x0f29('0x28')](_0x0f29('0x4d'),_0x6c1800);throw _0x6c1800;});}return _0x857564;})[_0x0f29('0x24')](respondWithResult(_0x335435,0xc9))[_0x0f29('0x44')](handleError(_0x335435,null));};exports['update']=function(_0x8c9780,_0x45d87c){if(_0x8c9780[_0x0f29('0x46')]['id']){delete _0x8c9780['body']['id'];}return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x8c9780[_0x0f29('0x43')]['id']}})['then'](handleEntityNotFound(_0x45d87c,null))[_0x0f29('0x24')](saveUpdates(_0x8c9780[_0x0f29('0x46')],null))['then'](respondWithResult(_0x45d87c,null))[_0x0f29('0x44')](handleError(_0x45d87c,null));};exports[_0x0f29('0x4e')]=function(_0x4ae30,_0x4a2c08){return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x4ae30[_0x0f29('0x43')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x4a2c08,null))['then'](removeEntity(_0x4a2c08,null))[_0x0f29('0x44')](handleError(_0x4a2c08,null));};exports[_0x0f29('0x4f')]=function(_0x4f2da6,_0xbe013b,_0x4fa132){return db[_0x0f29('0x3d')]['findOne']({'where':{'id':_0x4f2da6[_0x0f29('0x43')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0xbe013b,null))[_0x0f29('0x24')](function(_0x4ba5c3){var _0x36e714;var _0x3824f4={},_0x3dc97f={};_0x3dc97f[_0x0f29('0x32')]=_['keys'](db[_0x0f29('0x50')]['rawAttributes']);_0x3dc97f[_0x0f29('0x2f')]=_['keys'](_0x4f2da6[_0x0f29('0x2f')]);_0x3dc97f[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x3dc97f[_0x0f29('0x32')],_0x3dc97f[_0x0f29('0x2f')]);_0x3824f4[_0x0f29('0x33')]=_[_0x0f29('0x31')](_0x3dc97f['model'],qs[_0x0f29('0x34')](_0x4f2da6['query'][_0x0f29('0x34')]));_0x3824f4[_0x0f29('0x33')]=_0x3824f4[_0x0f29('0x33')]['length']?_0x3824f4[_0x0f29('0x33')]:_0x3dc97f[_0x0f29('0x32')];if(!_0x4f2da6[_0x0f29('0x2f')][_0x0f29('0x51')](_0x0f29('0x52'))){_0x3824f4['limit']=qs['limit'](_0x4f2da6[_0x0f29('0x2f')][_0x0f29('0x1f')]);_0x3824f4[_0x0f29('0x1d')]=qs['offset'](_0x4f2da6['query'][_0x0f29('0x1d')]);}_0x3824f4[_0x0f29('0x53')]=qs[_0x0f29('0x36')](_0x4f2da6['query']['sort']);_0x3824f4['where']=qs[_0x0f29('0x30')](_[_0x0f29('0x54')](_0x4f2da6['query'],_0x3dc97f[_0x0f29('0x30')]));if(_0x4f2da6[_0x0f29('0x2f')]['filter']){_0x3824f4[_0x0f29('0x37')]=_['merge'](_0x3824f4[_0x0f29('0x37')],{'$or':_[_0x0f29('0x2c')](_0x3824f4['attributes'],function(_0x2e423a){var _0x83015c={};_0x83015c[_0x2e423a]={'$like':'%'+_0x4f2da6[_0x0f29('0x2f')][_0x0f29('0x38')]+'%'};return _0x83015c;})});}_0x3824f4[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x3824f4['where'],{'mailboxuser':_0x4ba5c3[_0x0f29('0x55')]});_0x3824f4=_[_0x0f29('0x39')]({},_0x3824f4,_0x4f2da6[_0x0f29('0x3c')]);return db['VoiceMailMessage'][_0x0f29('0x56')](_0x3824f4)[_0x0f29('0x24')](respondWithFilteredResult(_0xbe013b,_0x3824f4));})['catch'](handleError(_0xbe013b,null));}; \ No newline at end of file +var _0x750a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceMail','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','body','getMessages','findOne','VoiceMailMessage','length','findAndCountAll','rimraf','request-promise','moment','bluebird'];(function(_0x5d50d7,_0x339501){var _0x4acb68=function(_0x6bd7a8){while(--_0x6bd7a8){_0x5d50d7['push'](_0x5d50d7['shift']());}};_0x4acb68(++_0x339501);}(_0x750a,0x140));var _0xa750=function(_0x5dea7d,_0x23364a){_0x5dea7d=_0x5dea7d-0x0;var _0xd904eb=_0x750a[_0x5dea7d];return _0xd904eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){var _0x1b80a5=_0x2ec6c4[_0xa750('0x1e')]({'plain':!![]});var _0x3001bc=_0xa750('0x1f');return db[_0xa750('0x20')][_0xa750('0x1c')]({'where':{'type':_0x3001bc,'resourceId':_0x1b80a5['id']}})[_0xa750('0x1d')](function(){return _0x2ec6c4;});})[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x310e2d,_0x4ffff4){return function(_0x3d3923){if(!_0x3d3923){_0x310e2d[_0xa750('0x21')](0x194);}return _0x3d3923;};}function handleError(_0x21cd2c,_0x4cceee){_0x4cceee=_0x4cceee||0x1f4;return function(_0x35ab53){logger[_0xa750('0x22')](_0x35ab53[_0xa750('0x23')]);if(_0x35ab53[_0xa750('0x24')]){delete _0x35ab53['name'];}_0x21cd2c[_0xa750('0x15')](_0x4cceee)[_0xa750('0x25')](_0x35ab53);};}exports[_0xa750('0x26')]=function(_0x2aef3a,_0x2c5253){var _0x59ab33={},_0x46cc11={},_0x4c2c9e={'count':0x0,'rows':[]};var _0x2d0e93=_[_0xa750('0x27')](db['VoiceMail'][_0xa750('0x28')],function(_0x6bc25d){return{'name':_0x6bc25d[_0xa750('0x29')],'type':_0x6bc25d[_0xa750('0x2a')][_0xa750('0x2b')]};});_0x46cc11[_0xa750('0x2c')]=_[_0xa750('0x27')](_0x2d0e93,_0xa750('0x24'));_0x46cc11['query']=_[_0xa750('0x2d')](_0x2aef3a['query']);_0x46cc11[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],_0x46cc11[_0xa750('0x30')]);_0x59ab33['attributes']=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],qs['fields'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x31')]));_0x59ab33[_0xa750('0x32')]=_0x59ab33[_0xa750('0x32')]['length']?_0x59ab33[_0xa750('0x32')]:_0x46cc11['model'];if(!_0x2aef3a['query'][_0xa750('0x33')](_0xa750('0x34'))){_0x59ab33[_0xa750('0x35')]=qs['limit'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x35')]);_0x59ab33[_0xa750('0x17')]=qs['offset'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x17')]);}_0x59ab33[_0xa750('0x36')]=qs['sort'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x37')]);_0x59ab33[_0xa750('0x38')]=qs['filters'](_[_0xa750('0x39')](_0x2aef3a[_0xa750('0x30')],_0x46cc11[_0xa750('0x2e')]),_0x2d0e93);if(_0x2aef3a[_0xa750('0x30')]['filter']){_0x59ab33['where']=_[_0xa750('0x3a')](_0x59ab33[_0xa750('0x38')],{'$or':_['map'](_0x2d0e93,function(_0x43dc3a){if(_0x43dc3a[_0xa750('0x2a')]!==_0xa750('0x3b')){var _0x1166ff={};_0x1166ff[_0x43dc3a[_0xa750('0x24')]]={'$like':'%'+_0x2aef3a['query'][_0xa750('0x3c')]+'%'};return _0x1166ff;}})});}_0x59ab33=_[_0xa750('0x3a')]({},_0x59ab33,_0x2aef3a[_0xa750('0x3d')]);var _0x134874={'where':_0x59ab33[_0xa750('0x38')]};return db[_0xa750('0x3e')][_0xa750('0x19')](_0x134874)['then'](function(_0x3daa38){_0x4c2c9e['count']=_0x3daa38;if(_0x2aef3a[_0xa750('0x30')]['includeAll']){_0x59ab33[_0xa750('0x3f')]=[{'all':!![]}];}return db[_0xa750('0x3e')][_0xa750('0x40')](_0x59ab33);})[_0xa750('0x1d')](function(_0x430d60){_0x4c2c9e[_0xa750('0x41')]=_0x430d60;return _0x4c2c9e;})[_0xa750('0x1d')](respondWithFilteredResult(_0x2c5253,_0x59ab33))[_0xa750('0x42')](handleError(_0x2c5253,null));};exports[_0xa750('0x43')]=function(_0x108a1a,_0x36a8d6){var _0x1458f1={'raw':!![],'where':{'id':_0x108a1a[_0xa750('0x44')]['id']}},_0x3ec860={};_0x3ec860[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x3e')][_0xa750('0x28')]);_0x3ec860[_0xa750('0x30')]=_[_0xa750('0x2d')](_0x108a1a['query']);_0x3ec860[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],_0x3ec860[_0xa750('0x30')]);_0x1458f1[_0xa750('0x32')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x108a1a[_0xa750('0x30')]['fields']));_0x1458f1[_0xa750('0x32')]=_0x1458f1[_0xa750('0x32')]['length']?_0x1458f1[_0xa750('0x32')]:_0x3ec860[_0xa750('0x2c')];if(_0x108a1a[_0xa750('0x30')][_0xa750('0x45')]){_0x1458f1[_0xa750('0x3f')]=[{'all':!![]}];}_0x1458f1=_[_0xa750('0x3a')]({},_0x1458f1,_0x108a1a[_0xa750('0x3d')]);return db[_0xa750('0x3e')][_0xa750('0x46')](_0x1458f1)[_0xa750('0x1d')](handleEntityNotFound(_0x36a8d6,null))['then'](respondWithResult(_0x36a8d6,null))[_0xa750('0x42')](handleError(_0x36a8d6,null));};exports[_0xa750('0x47')]=function(_0x58afd2,_0x93e49f){return db[_0xa750('0x3e')][_0xa750('0x47')](_0x58afd2['body'],{})[_0xa750('0x1d')](function(_0x3fc623){var _0x1e5a9a=_0x58afd2[_0xa750('0x48')]['get']({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0xa750('0x49'));if(_0x1e5a9a[_0xa750('0x4a')]===_0xa750('0x48')){var _0xed4f88=_0x3fc623['get']({'plain':!![]});var _0x203f2a=_0xa750('0x1f');return db['UserProfileSection'][_0xa750('0x46')]({'where':{'name':_0x203f2a,'userProfileId':_0x1e5a9a['userProfileId']},'raw':!![]})[_0xa750('0x1d')](function(_0x69995b){if(_0x69995b&&_0x69995b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xed4f88[_0xa750('0x24')],'resourceId':_0xed4f88['id'],'type':_0x69995b[_0xa750('0x24')],'sectionId':_0x69995b['id']},{})['then'](function(){return _0x3fc623;});}else{return _0x3fc623;}})[_0xa750('0x42')](function(_0x1a79a9){logger[_0xa750('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79a9);throw _0x1a79a9;});}return _0x3fc623;})['then'](respondWithResult(_0x93e49f,0xc9))['catch'](handleError(_0x93e49f,null));};exports['update']=function(_0x3c34d4,_0x4a1b5d){if(_0x3c34d4[_0xa750('0x4b')]['id']){delete _0x3c34d4[_0xa750('0x4b')]['id'];}return db['VoiceMail'][_0xa750('0x46')]({'where':{'id':_0x3c34d4['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4a1b5d,null))['then'](saveUpdates(_0x3c34d4['body'],null))['then'](respondWithResult(_0x4a1b5d,null))['catch'](handleError(_0x4a1b5d,null));};exports[_0xa750('0x1c')]=function(_0x40dac2,_0x5f1313){return db['VoiceMail']['find']({'where':{'id':_0x40dac2[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x5f1313,null))[_0xa750('0x1d')](removeEntity(_0x5f1313,null))[_0xa750('0x42')](handleError(_0x5f1313,null));};exports[_0xa750('0x4c')]=function(_0x13528a,_0x599e7e,_0x590b1c){return db[_0xa750('0x3e')][_0xa750('0x4d')]({'where':{'id':_0x13528a[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x599e7e,null))[_0xa750('0x1d')](function(_0x5a3cd5){var _0x4030b3;var _0xaa63be={},_0x2c7dd0={};_0x2c7dd0[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x4e')][_0xa750('0x28')]);_0x2c7dd0[_0xa750('0x30')]=_['keys'](_0x13528a[_0xa750('0x30')]);_0x2c7dd0[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],_0x2c7dd0[_0xa750('0x30')]);_0xaa63be['attributes']=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x13528a[_0xa750('0x30')][_0xa750('0x31')]));_0xaa63be[_0xa750('0x32')]=_0xaa63be[_0xa750('0x32')][_0xa750('0x4f')]?_0xaa63be[_0xa750('0x32')]:_0x2c7dd0[_0xa750('0x2c')];if(!_0x13528a[_0xa750('0x30')][_0xa750('0x33')](_0xa750('0x34'))){_0xaa63be[_0xa750('0x35')]=qs[_0xa750('0x35')](_0x13528a[_0xa750('0x30')]['limit']);_0xaa63be[_0xa750('0x17')]=qs['offset'](_0x13528a[_0xa750('0x30')][_0xa750('0x17')]);}_0xaa63be[_0xa750('0x36')]=qs['sort'](_0x13528a[_0xa750('0x30')][_0xa750('0x37')]);_0xaa63be[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x39')](_0x13528a[_0xa750('0x30')],_0x2c7dd0['filters']));if(_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]){_0xaa63be['where']=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'$or':_[_0xa750('0x27')](_0xaa63be[_0xa750('0x32')],function(_0x3255c7){var _0x1b7597={};_0x1b7597[_0x3255c7]={'$like':'%'+_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]+'%'};return _0x1b7597;})});}_0xaa63be[_0xa750('0x38')]=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'mailboxuser':_0x5a3cd5['mailbox']});_0xaa63be=_['merge']({},_0xaa63be,_0x13528a[_0xa750('0x3d')]);return db[_0xa750('0x4e')][_0xa750('0x50')](_0xaa63be)[_0xa750('0x1d')](respondWithFilteredResult(_0x599e7e,_0xaa63be));})['catch'](handleError(_0x599e7e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index dc3d062..c7d6fab 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 _0x5482=['voice_voicemail','mailbox_context','mailbox','context','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5482,0x1f4));var _0x2548=function(_0x3e186f,_0x2eb7be){_0x3e186f=_0x3e186f-0x0;var _0x3595bf=_0x5482[_0x3e186f];return _0x3595bf;};'use strict';var _=require(_0x2548('0x0'));var util=require(_0x2548('0x1'));var logger=require('../../config/logger')(_0x2548('0x2'));var moment=require(_0x2548('0x3'));var BPromise=require(_0x2548('0x4'));var rp=require(_0x2548('0x5'));var fs=require('fs');var path=require(_0x2548('0x6'));var rimraf=require(_0x2548('0x7'));var config=require(_0x2548('0x8'));var attributes=require('./voiceMail.attributes');module[_0x2548('0x9')]=function(_0x5ac3f4,_0x17273d){return _0x5ac3f4[_0x2548('0xa')](_0x2548('0xb'),attributes,{'tableName':_0x2548('0xc'),'paranoid':![],'indexes':[{'name':_0x2548('0xd'),'fields':[_0x2548('0xe'),_0x2548('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95c4=['bluebird','request-promise','path','rimraf','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','moment'];(function(_0x3208b9,_0x2be1ef){var _0x133c89=function(_0x2f549d){while(--_0x2f549d){_0x3208b9['push'](_0x3208b9['shift']());}};_0x133c89(++_0x2be1ef);}(_0x95c4,0x10d));var _0x495c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x95c4[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x495c('0x0'));var util=require(_0x495c('0x1'));var logger=require(_0x495c('0x2'))('api');var moment=require(_0x495c('0x3'));var BPromise=require(_0x495c('0x4'));var rp=require(_0x495c('0x5'));var fs=require('fs');var path=require(_0x495c('0x6'));var rimraf=require(_0x495c('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x495c('0x8')]=function(_0x2b1179,_0x5df12e){return _0x2b1179['define'](_0x495c('0x9'),attributes,{'tableName':_0x495c('0xa'),'paranoid':![],'indexes':[{'name':_0x495c('0xb'),'fields':[_0x495c('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index ad5478f..89a9a71 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 _0x6259=['http','request','then','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3aba25,_0x3418d0){var _0x246a23=function(_0x5e9921){while(--_0x5e9921){_0x3aba25['push'](_0x3aba25['shift']());}};_0x246a23(++_0x3418d0);}(_0x6259,0xaa));var _0x9625=function(_0x440e9a,_0x2a333e){_0x440e9a=_0x440e9a-0x0;var _0x423be2=_0x6259[_0x440e9a];return _0x423be2;};'use strict';var _=require(_0x9625('0x0'));var util=require('util');var moment=require(_0x9625('0x1'));var BPromise=require(_0x9625('0x2'));var rs=require(_0x9625('0x3'));var fs=require('fs');var Redis=require(_0x9625('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9625('0x5'));var logger=require(_0x9625('0x6'))(_0x9625('0x7'));var config=require(_0x9625('0x8'));var jayson=require(_0x9625('0x9'));var client=jayson['client'][_0x9625('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346561,_0x1b7d1f,_0x25a6a2){return new BPromise(function(_0x111b9b,_0x4cd185){return client[_0x9625('0xb')](_0x346561,_0x25a6a2)[_0x9625('0xc')](function(_0x3d4e64){logger['info'](_0x9625('0xd'),_0x1b7d1f,'request\x20sent');logger['debug'](_0x9625('0xe'),_0x1b7d1f,_0x9625('0xf'),JSON['stringify'](_0x3d4e64));if(_0x3d4e64[_0x9625('0x10')]){if(_0x3d4e64[_0x9625('0x10')]['code']===0x1f4){logger[_0x9625('0x10')](_0x9625('0xd'),_0x1b7d1f,_0x3d4e64[_0x9625('0x10')][_0x9625('0x11')]);return _0x4cd185(_0x3d4e64[_0x9625('0x10')][_0x9625('0x11')]);}logger[_0x9625('0x10')](_0x9625('0xd'),_0x1b7d1f,_0x3d4e64[_0x9625('0x10')][_0x9625('0x11')]);return _0x111b9b(_0x3d4e64[_0x9625('0x10')]['message']);}else{logger[_0x9625('0x12')](_0x9625('0xd'),_0x1b7d1f,'request\x20sent');_0x111b9b(_0x3d4e64[_0x9625('0x13')][_0x9625('0x11')]);}})['catch'](function(_0x265b75){logger[_0x9625('0x10')](_0x9625('0xd'),_0x1b7d1f,_0x265b75);_0x4cd185(_0x265b75);});});} \ No newline at end of file +var _0xa3ba=['jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa3ba,0x7b));var _0xaa3b=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0xa3ba[_0x508685];return _0x976a76;};'use strict';var _=require('lodash');var util=require(_0xaa3b('0x0'));var moment=require(_0xaa3b('0x1'));var BPromise=require(_0xaa3b('0x2'));var rs=require(_0xaa3b('0x3'));var fs=require('fs');var Redis=require(_0xaa3b('0x4'));var db=require(_0xaa3b('0x5'))['db'];var utils=require(_0xaa3b('0x6'));var logger=require(_0xaa3b('0x7'))(_0xaa3b('0x8'));var config=require('../../config/environment');var jayson=require(_0xaa3b('0x9'));var client=jayson[_0xaa3b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x266445,_0x2eb1db,_0x4f6fdb){return new BPromise(function(_0x24ba17,_0x332f54){return client[_0xaa3b('0xb')](_0x266445,_0x4f6fdb)[_0xaa3b('0xc')](function(_0x5e8515){logger['info'](_0xaa3b('0xd'),_0x2eb1db,'request\x20sent');logger[_0xaa3b('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2eb1db,_0xaa3b('0xf'),JSON[_0xaa3b('0x10')](_0x5e8515));if(_0x5e8515[_0xaa3b('0x11')]){if(_0x5e8515[_0xaa3b('0x11')][_0xaa3b('0x12')]===0x1f4){logger[_0xaa3b('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2eb1db,_0x5e8515['error'][_0xaa3b('0x13')]);return _0x332f54(_0x5e8515['error'][_0xaa3b('0x13')]);}logger[_0xaa3b('0x11')](_0xaa3b('0xd'),_0x2eb1db,_0x5e8515[_0xaa3b('0x11')][_0xaa3b('0x13')]);return _0x24ba17(_0x5e8515[_0xaa3b('0x11')][_0xaa3b('0x13')]);}else{logger['info'](_0xaa3b('0xd'),_0x2eb1db,'request\x20sent');_0x24ba17(_0x5e8515[_0xaa3b('0x14')][_0xaa3b('0x13')]);}})[_0xaa3b('0x15')](function(_0x2a3328){logger[_0xaa3b('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2eb1db,_0x2a3328);_0x332f54(_0x2a3328);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f901c80..2267ad6 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 _0x994e=['../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','put','/:id','update','delete','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4419c8,_0x1bd75b){var _0xd82062=function(_0x463656){while(--_0x463656){_0x4419c8['push'](_0x4419c8['shift']());}};_0xd82062(++_0x1bd75b);}(_0x994e,0xfa));var _0xe994=function(_0x1e43f3,_0x842e34){_0x1e43f3=_0x1e43f3-0x0;var _0x56f416=_0x994e[_0x1e43f3];return _0x56f416;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe994('0x0'));var timeout=require(_0xe994('0x1'));var express=require(_0xe994('0x2'));var router=express[_0xe994('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe994('0x4'));var interaction=require(_0xe994('0x5'));var config=require('../../config/environment');var controller=require(_0xe994('0x6'));router[_0xe994('0x7')]('/',auth[_0xe994('0x8')](),controller[_0xe994('0x9')]);router[_0xe994('0x7')]('/:id',auth[_0xe994('0x8')](),controller[_0xe994('0xa')]);router[_0xe994('0x7')]('/:id/download',auth[_0xe994('0x8')](),controller[_0xe994('0xb')]);router[_0xe994('0xc')]('/',auth[_0xe994('0x8')](),controller['create']);router[_0xe994('0xd')](_0xe994('0xe'),auth[_0xe994('0x8')](),controller[_0xe994('0xf')]);router[_0xe994('0x10')]('/:id',auth[_0xe994('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x880f=['connect-timeout','express','Router','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','/:id','show','get','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x880f,0x1b6));var _0xf880=function(_0x232ebb,_0x173163){_0x232ebb=_0x232ebb-0x0;var _0x128109=_0x880f[_0x232ebb];return _0x128109;};'use strict';var multer=require(_0xf880('0x0'));var util=require(_0xf880('0x1'));var path=require(_0xf880('0x2'));var timeout=require(_0xf880('0x3'));var express=require(_0xf880('0x4'));var router=express[_0xf880('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf880('0x6'));var config=require('../../config/environment');var controller=require(_0xf880('0x7'));router['get']('/',auth[_0xf880('0x8')](),controller[_0xf880('0x9')]);router['get'](_0xf880('0xa'),auth[_0xf880('0x8')](),controller[_0xf880('0xb')]);router[_0xf880('0xc')](_0xf880('0xd'),auth[_0xf880('0x8')](),controller[_0xf880('0xe')]);router[_0xf880('0xf')]('/',auth[_0xf880('0x8')](),controller[_0xf880('0x10')]);router['put'](_0xf880('0xa'),auth['isAuthenticated'](),controller[_0xf880('0x11')]);router[_0xf880('0x12')]('/:id',auth[_0xf880('0x8')](),controller[_0xf880('0x13')]);module[_0xf880('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 57a0db2..fab9e9a 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 _0x9de2=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x9de2,0x1d5));var _0x29de=function(_0x130f28,_0x28d3a3){_0x130f28=_0x130f28-0x0;var _0x5390b=_0x9de2[_0x130f28];return _0x5390b;};'use strict';var Sequelize=require('sequelize');module[_0x29de('0x0')]={'name':{'type':Sequelize[_0x29de('0x1')],'get':function(_0x272990){return this[_0x29de('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x29de('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x29de('0x5')](_0x29de('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x29de('0x4')],'defaultValue':''},'stamp':{'type':_0x29de('0x7'),'defaultValue':Sequelize[_0x29de('0x8')](_0x29de('0x9'))}}; \ No newline at end of file +var _0x668c=['long','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x3415d9,_0x225113){var _0x42ff90=function(_0x51fcb6){while(--_0x51fcb6){_0x3415d9['push'](_0x3415d9['shift']());}};_0x42ff90(++_0x225113);}(_0x668c,0x1a0));var _0xc668=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x668c[_0x2675da];return _0x5e6153;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc668('0x0')],'get':function(_0x465c80){return this[_0xc668('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xc668('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xc668('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc668('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9e56633..8d5ddfb 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 _0x1499=['send','map','VoiceMailMessage','type','model','differenceBy','name','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','findAll','catch','show','params','rawAttributes','include','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x775429,_0x3ce5c8){var _0x2d5ce0=function(_0x30f7f7){while(--_0x30f7f7){_0x775429['push'](_0x775429['shift']());}};_0x2d5ce0(++_0x3ce5c8);}(_0x1499,0xd0));var _0x9149=function(_0xe06bf9,_0x3c2c1a){_0xe06bf9=_0xe06bf9-0x0;var _0x301373=_0x1499[_0xe06bf9];return _0x301373;};'use strict';var emlformat=require(_0x9149('0x0'));var rimraf=require(_0x9149('0x1'));var zipdir=require(_0x9149('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9149('0x3'));var moment=require(_0x9149('0x4'));var BPromise=require(_0x9149('0x5'));var Mustache=require(_0x9149('0x6'));var util=require('util');var path=require(_0x9149('0x7'));var sox=require(_0x9149('0x8'));var csv=require('to-csv');var ejs=require(_0x9149('0x9'));var fs=require('fs');var fs_extra=require(_0x9149('0xa'));var _=require(_0x9149('0xb'));var squel=require(_0x9149('0xc'));var crypto=require(_0x9149('0xd'));var jsforce=require(_0x9149('0xe'));var deskjs=require(_0x9149('0xf'));var toCsv=require(_0x9149('0x10'));var querystring=require(_0x9149('0x11'));var Papa=require(_0x9149('0x12'));var Redis=require('ioredis');var authService=require(_0x9149('0x13'));var qs=require(_0x9149('0x14'));var as=require(_0x9149('0x15'));var hardwareService=require(_0x9149('0x16'));var logger=require(_0x9149('0x17'))(_0x9149('0x18'));var utils=require(_0x9149('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9149('0x1a'));var db=require(_0x9149('0x1b'))['db'];function respondWithStatusCode(_0x163353,_0x5dada9){_0x5dada9=_0x5dada9||0xcc;return function(_0x3846fa){if(_0x3846fa){return _0x163353['sendStatus'](_0x5dada9);}return _0x163353[_0x9149('0x1c')](_0x5dada9)['end']();};}function respondWithResult(_0x12c548,_0x57b876){_0x57b876=_0x57b876||0xc8;return function(_0xfd5645){if(_0xfd5645){return _0x12c548[_0x9149('0x1c')](_0x57b876)[_0x9149('0x1d')](_0xfd5645);}};}function respondWithFilteredResult(_0x1f2155,_0x2acbe9){return function(_0x20c518){if(_0x20c518){var _0x11ce26=typeof _0x2acbe9['offset']===_0x9149('0x1e')&&typeof _0x2acbe9[_0x9149('0x1f')]===_0x9149('0x1e');var _0x54fc60=_0x20c518[_0x9149('0x20')];var _0x36fb9d=_0x11ce26?0x0:_0x2acbe9[_0x9149('0x21')];var _0x11b6d3=_0x11ce26?_0x20c518[_0x9149('0x20')]:_0x2acbe9[_0x9149('0x21')]+_0x2acbe9[_0x9149('0x1f')];var _0x5ac48c;if(_0x11b6d3>=_0x54fc60){_0x11b6d3=_0x54fc60;_0x5ac48c=0xc8;}else{_0x5ac48c=0xce;}_0x1f2155[_0x9149('0x1c')](_0x5ac48c);return _0x1f2155[_0x9149('0x22')]('Content-Range',_0x36fb9d+'-'+_0x11b6d3+'/'+_0x54fc60)['json'](_0x20c518);}return null;};}function patchUpdates(_0x8e9e8f){return function(_0x3b5917){try{jsonpatch['apply'](_0x3b5917,_0x8e9e8f,!![]);}catch(_0x55c558){return BPromise[_0x9149('0x23')](_0x55c558);}return _0x3b5917[_0x9149('0x24')]();};}function saveUpdates(_0x3a0551,_0x757b50){return function(_0x17140e){if(_0x17140e){return _0x17140e[_0x9149('0x25')](_0x3a0551)[_0x9149('0x26')](function(_0x2b4c01){return _0x2b4c01;});}return null;};}function removeEntity(_0x4476bb,_0x46b02e){return function(_0x35c370){if(_0x35c370){return _0x35c370[_0x9149('0x27')]()[_0x9149('0x26')](function(){_0x4476bb['status'](0xcc)[_0x9149('0x28')]();});}};}function handleEntityNotFound(_0x5343a2,_0x17992d){return function(_0x18f144){if(!_0x18f144){_0x5343a2[_0x9149('0x29')](0x194);}return _0x18f144;};}function handleError(_0x5eb5da,_0x5e19aa){_0x5e19aa=_0x5e19aa||0x1f4;return function(_0x3a21ff){logger[_0x9149('0x2a')](_0x3a21ff[_0x9149('0x2b')]);if(_0x3a21ff['name']){delete _0x3a21ff['name'];}_0x5eb5da['status'](_0x5e19aa)[_0x9149('0x2c')](_0x3a21ff);};}exports['index']=function(_0x1f916e,_0x2340f3){var _0x2aaf38={},_0x318e63={},_0x571eff={'count':0x0,'rows':[]};var _0x17671d=_[_0x9149('0x2d')](db[_0x9149('0x2e')]['rawAttributes'],function(_0x219aa4){return{'name':_0x219aa4['fieldName'],'type':_0x219aa4[_0x9149('0x2f')]['key']};});_0x318e63[_0x9149('0x30')]=_[_0x9149('0x31')](_[_0x9149('0x2d')](_0x17671d,_0x9149('0x32')),[_0x9149('0x32')]);_0x318e63[_0x9149('0x33')]=_[_0x9149('0x34')](_0x1f916e[_0x9149('0x33')]);_0x318e63['filters']=_['intersection'](_0x318e63[_0x9149('0x30')],_0x318e63[_0x9149('0x33')]);_0x2aaf38[_0x9149('0x35')]=_[_0x9149('0x36')](_0x318e63['model'],qs[_0x9149('0x37')](_0x1f916e[_0x9149('0x33')]['fields']));_0x2aaf38[_0x9149('0x35')]=_0x2aaf38[_0x9149('0x35')][_0x9149('0x38')]?_0x2aaf38[_0x9149('0x35')]:_0x318e63['model'];if(!_0x1f916e[_0x9149('0x33')]['hasOwnProperty'](_0x9149('0x39'))){_0x2aaf38[_0x9149('0x1f')]=qs[_0x9149('0x1f')](_0x1f916e[_0x9149('0x33')][_0x9149('0x1f')]);_0x2aaf38['offset']=qs[_0x9149('0x21')](_0x1f916e['query'][_0x9149('0x21')]);}_0x2aaf38[_0x9149('0x3a')]=qs[_0x9149('0x3b')](_0x1f916e[_0x9149('0x33')][_0x9149('0x3b')]);_0x2aaf38[_0x9149('0x3c')]=qs['filters'](_[_0x9149('0x3d')](_0x1f916e[_0x9149('0x33')],_0x318e63['filters']),_0x17671d);if(_0x1f916e['query']['filter']){_0x2aaf38[_0x9149('0x3c')]=_['merge'](_0x2aaf38['where'],{'$or':_[_0x9149('0x2d')](_0x17671d,function(_0x522203){if(_0x522203['type']!==_0x9149('0x3e')){var _0x29b15d={};_0x29b15d[_0x522203[_0x9149('0x32')]]={'$like':'%'+_0x1f916e[_0x9149('0x33')][_0x9149('0x3f')]+'%'};return _0x29b15d;}})});}_0x2aaf38=_[_0x9149('0x40')]({},_0x2aaf38,_0x1f916e[_0x9149('0x41')]);var _0x579f68={'where':_0x2aaf38[_0x9149('0x3c')]};return db[_0x9149('0x2e')][_0x9149('0x20')](_0x579f68)[_0x9149('0x26')](function(_0x1fdce2){_0x571eff[_0x9149('0x20')]=_0x1fdce2;if(_0x1f916e[_0x9149('0x33')]['includeAll']){_0x2aaf38['include']=[{'all':!![]}];}return db[_0x9149('0x2e')][_0x9149('0x42')](_0x2aaf38);})[_0x9149('0x26')](function(_0x5ecf6a){_0x571eff['rows']=_0x5ecf6a;return _0x571eff;})[_0x9149('0x26')](respondWithFilteredResult(_0x2340f3,_0x2aaf38))[_0x9149('0x43')](handleError(_0x2340f3,null));};exports[_0x9149('0x44')]=function(_0x31a8ba,_0x6b883){var _0x51520f={'raw':!![],'where':{'id':_0x31a8ba[_0x9149('0x45')]['id']}},_0x3b45b8={};_0x3b45b8[_0x9149('0x30')]=_[_0x9149('0x34')](db[_0x9149('0x2e')][_0x9149('0x46')]);_0x3b45b8[_0x9149('0x33')]=_[_0x9149('0x34')](_0x31a8ba['query']);_0x3b45b8['filters']=_[_0x9149('0x36')](_0x3b45b8['model'],_0x3b45b8['query']);_0x51520f[_0x9149('0x35')]=_['intersection'](_0x3b45b8[_0x9149('0x30')],qs[_0x9149('0x37')](_0x31a8ba['query']['fields']));_0x51520f[_0x9149('0x35')]=_0x51520f[_0x9149('0x35')][_0x9149('0x38')]?_0x51520f[_0x9149('0x35')]:_0x3b45b8['model'];if(_0x31a8ba[_0x9149('0x33')]['includeAll']){_0x51520f[_0x9149('0x47')]=[{'all':!![]}];}_0x51520f=_[_0x9149('0x40')]({},_0x51520f,_0x31a8ba[_0x9149('0x41')]);return db[_0x9149('0x2e')][_0x9149('0x48')](_0x51520f)[_0x9149('0x26')](handleEntityNotFound(_0x6b883,null))['then'](respondWithResult(_0x6b883,null))[_0x9149('0x43')](handleError(_0x6b883,null));};exports['create']=function(_0x4febc8,_0x4c95ff){return db['VoiceMailMessage'][_0x9149('0x49')](_0x4febc8[_0x9149('0x4a')],{})[_0x9149('0x26')](respondWithResult(_0x4c95ff,0xc9))[_0x9149('0x43')](handleError(_0x4c95ff,null));};exports[_0x9149('0x25')]=function(_0x327936,_0x502149){if(_0x327936[_0x9149('0x4a')]['id']){delete _0x327936[_0x9149('0x4a')]['id'];}return db[_0x9149('0x2e')][_0x9149('0x48')]({'where':{'id':_0x327936['params']['id']}})[_0x9149('0x26')](handleEntityNotFound(_0x502149,null))[_0x9149('0x26')](saveUpdates(_0x327936['body'],null))[_0x9149('0x26')](respondWithResult(_0x502149,null))['catch'](handleError(_0x502149,null));};exports['destroy']=function(_0x29f57e,_0x525a27){return db[_0x9149('0x2e')]['find']({'where':{'id':_0x29f57e[_0x9149('0x45')]['id']}})['then'](handleEntityNotFound(_0x525a27,null))['then'](removeEntity(_0x525a27,null))['catch'](handleError(_0x525a27,null));};exports[_0x9149('0x4b')]=function(_0x2b395e,_0x23d868,_0x4e5594){return db['VoiceMailMessage'][_0x9149('0x48')]({'where':{'id':_0x2b395e[_0x9149('0x45')]['id']},'attributes':['id',_0x9149('0x4c'),_0x9149('0x4d')]})[_0x9149('0x26')](handleEntityNotFound(_0x23d868,null))[_0x9149('0x26')](function(_0x5c20fb){if(_0x5c20fb){if(!_0x5c20fb[_0x9149('0x4c')]){throw new db[(_0x9149('0x4e'))]['ValidationError'](_0x9149('0x4f'));}var _0x4c86d3={'Content-Type':_0x9149('0x50'),'Content-Disposition':_0x9149('0x51')};if(_0x5c20fb['msg_id']){_0x4c86d3['Content-Disposition']=_0x9149('0x52')+_0x5c20fb[_0x9149('0x4d')]+_0x9149('0x53');}_0x23d868[_0x9149('0x22')](_0x4c86d3);return _0x23d868[_0x9149('0x2c')](new Buffer(_0x5c20fb[_0x9149('0x4c')]));}})['catch'](handleError(_0x23d868,null));}; \ No newline at end of file +var _0xa1bd=['set','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','then','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22'];(function(_0x15b5b7,_0xb40767){var _0x2e67e7=function(_0x7e76a2){while(--_0x7e76a2){_0x15b5b7['push'](_0x15b5b7['shift']());}};_0x2e67e7(++_0xb40767);}(_0xa1bd,0xf7));var _0xda1b=function(_0x15560,_0x576cc1){_0x15560=_0x15560-0x0;var _0x184bd5=_0xa1bd[_0x15560];return _0x184bd5;};'use strict';var emlformat=require(_0xda1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda1b('0x1'));var jsonpatch=require(_0xda1b('0x2'));var rp=require('request-promise');var moment=require(_0xda1b('0x3'));var BPromise=require(_0xda1b('0x4'));var Mustache=require('mustache');var util=require(_0xda1b('0x5'));var path=require(_0xda1b('0x6'));var sox=require(_0xda1b('0x7'));var csv=require(_0xda1b('0x8'));var ejs=require(_0xda1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xda1b('0xa'));var crypto=require(_0xda1b('0xb'));var jsforce=require(_0xda1b('0xc'));var deskjs=require(_0xda1b('0xd'));var toCsv=require(_0xda1b('0x8'));var querystring=require(_0xda1b('0xe'));var Papa=require(_0xda1b('0xf'));var Redis=require(_0xda1b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xda1b('0x11'));var as=require(_0xda1b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xda1b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda1b('0x14'))['db'];function respondWithStatusCode(_0x21d81,_0x4e3c62){_0x4e3c62=_0x4e3c62||0xcc;return function(_0x4d9123){if(_0x4d9123){return _0x21d81[_0xda1b('0x15')](_0x4e3c62);}return _0x21d81[_0xda1b('0x16')](_0x4e3c62)[_0xda1b('0x17')]();};}function respondWithResult(_0x3a8cf1,_0x4ea8ac){_0x4ea8ac=_0x4ea8ac||0xc8;return function(_0x2c62a5){if(_0x2c62a5){return _0x3a8cf1[_0xda1b('0x16')](_0x4ea8ac)[_0xda1b('0x18')](_0x2c62a5);}};}function respondWithFilteredResult(_0x1583b0,_0x3aa11e){return function(_0x3fbe8d){if(_0x3fbe8d){var _0x1b62da=typeof _0x3aa11e['offset']===_0xda1b('0x19')&&typeof _0x3aa11e[_0xda1b('0x1a')]==='undefined';var _0x4570b5=_0x3fbe8d[_0xda1b('0x1b')];var _0x2da723=_0x1b62da?0x0:_0x3aa11e['offset'];var _0x6b9cdf=_0x1b62da?_0x3fbe8d[_0xda1b('0x1b')]:_0x3aa11e[_0xda1b('0x1c')]+_0x3aa11e['limit'];var _0x3bc79d;if(_0x6b9cdf>=_0x4570b5){_0x6b9cdf=_0x4570b5;_0x3bc79d=0xc8;}else{_0x3bc79d=0xce;}_0x1583b0[_0xda1b('0x16')](_0x3bc79d);return _0x1583b0['set'](_0xda1b('0x1d'),_0x2da723+'-'+_0x6b9cdf+'/'+_0x4570b5)['json'](_0x3fbe8d);}return null;};}function patchUpdates(_0x4b1ab4){return function(_0x182f17){try{jsonpatch[_0xda1b('0x1e')](_0x182f17,_0x4b1ab4,!![]);}catch(_0x218c53){return BPromise[_0xda1b('0x1f')](_0x218c53);}return _0x182f17[_0xda1b('0x20')]();};}function saveUpdates(_0x4781cd,_0x57cd6c){return function(_0x2b1891){if(_0x2b1891){return _0x2b1891[_0xda1b('0x21')](_0x4781cd)['then'](function(_0x5d0729){return _0x5d0729;});}return null;};}function removeEntity(_0x1ca385,_0xf9160f){return function(_0x4433e2){if(_0x4433e2){return _0x4433e2[_0xda1b('0x22')]()['then'](function(){_0x1ca385[_0xda1b('0x16')](0xcc)[_0xda1b('0x17')]();});}};}function handleEntityNotFound(_0x57a412,_0x497e9c){return function(_0x4a8a9a){if(!_0x4a8a9a){_0x57a412['sendStatus'](0x194);}return _0x4a8a9a;};}function handleError(_0x176eeb,_0x50c73){_0x50c73=_0x50c73||0x1f4;return function(_0x3b48bc){logger['error'](_0x3b48bc[_0xda1b('0x23')]);if(_0x3b48bc[_0xda1b('0x24')]){delete _0x3b48bc['name'];}_0x176eeb[_0xda1b('0x16')](_0x50c73)[_0xda1b('0x25')](_0x3b48bc);};}exports[_0xda1b('0x26')]=function(_0x72e25f,_0xcec330){var _0x3460ae={},_0x4b9929={},_0x95cdef={'count':0x0,'rows':[]};var _0x436f04=_['map'](db[_0xda1b('0x27')][_0xda1b('0x28')],function(_0x189488){return{'name':_0x189488[_0xda1b('0x29')],'type':_0x189488[_0xda1b('0x2a')][_0xda1b('0x2b')]};});_0x4b9929[_0xda1b('0x2c')]=_['differenceBy'](_[_0xda1b('0x2d')](_0x436f04,_0xda1b('0x24')),[_0xda1b('0x24')]);_0x4b9929[_0xda1b('0x2e')]=_[_0xda1b('0x2f')](_0x72e25f[_0xda1b('0x2e')]);_0x4b9929[_0xda1b('0x30')]=_[_0xda1b('0x31')](_0x4b9929[_0xda1b('0x2c')],_0x4b9929[_0xda1b('0x2e')]);_0x3460ae[_0xda1b('0x32')]=_[_0xda1b('0x31')](_0x4b9929[_0xda1b('0x2c')],qs['fields'](_0x72e25f[_0xda1b('0x2e')][_0xda1b('0x33')]));_0x3460ae[_0xda1b('0x32')]=_0x3460ae[_0xda1b('0x32')][_0xda1b('0x34')]?_0x3460ae[_0xda1b('0x32')]:_0x4b9929[_0xda1b('0x2c')];if(!_0x72e25f[_0xda1b('0x2e')][_0xda1b('0x35')](_0xda1b('0x36'))){_0x3460ae[_0xda1b('0x1a')]=qs['limit'](_0x72e25f['query'][_0xda1b('0x1a')]);_0x3460ae[_0xda1b('0x1c')]=qs[_0xda1b('0x1c')](_0x72e25f[_0xda1b('0x2e')][_0xda1b('0x1c')]);}_0x3460ae[_0xda1b('0x37')]=qs[_0xda1b('0x38')](_0x72e25f[_0xda1b('0x2e')]['sort']);_0x3460ae[_0xda1b('0x39')]=qs['filters'](_[_0xda1b('0x3a')](_0x72e25f[_0xda1b('0x2e')],_0x4b9929['filters']),_0x436f04);if(_0x72e25f['query'][_0xda1b('0x3b')]){_0x3460ae[_0xda1b('0x39')]=_[_0xda1b('0x3c')](_0x3460ae[_0xda1b('0x39')],{'$or':_['map'](_0x436f04,function(_0x2e19e5){if(_0x2e19e5[_0xda1b('0x2a')]!=='VIRTUAL'){var _0x587890={};_0x587890[_0x2e19e5['name']]={'$like':'%'+_0x72e25f[_0xda1b('0x2e')][_0xda1b('0x3b')]+'%'};return _0x587890;}})});}_0x3460ae=_['merge']({},_0x3460ae,_0x72e25f['options']);var _0x40e895={'where':_0x3460ae[_0xda1b('0x39')]};return db[_0xda1b('0x27')][_0xda1b('0x1b')](_0x40e895)[_0xda1b('0x3d')](function(_0x3d5021){_0x95cdef[_0xda1b('0x1b')]=_0x3d5021;if(_0x72e25f[_0xda1b('0x2e')][_0xda1b('0x3e')]){_0x3460ae[_0xda1b('0x3f')]=[{'all':!![]}];}return db[_0xda1b('0x27')][_0xda1b('0x40')](_0x3460ae);})[_0xda1b('0x3d')](function(_0x16331e){_0x95cdef[_0xda1b('0x41')]=_0x16331e;return _0x95cdef;})[_0xda1b('0x3d')](respondWithFilteredResult(_0xcec330,_0x3460ae))[_0xda1b('0x42')](handleError(_0xcec330,null));};exports[_0xda1b('0x43')]=function(_0x59eee9,_0x4cd780){var _0x136f6c={'raw':!![],'where':{'id':_0x59eee9['params']['id']}},_0x329e3a={};_0x329e3a[_0xda1b('0x2c')]=_[_0xda1b('0x2f')](db[_0xda1b('0x27')][_0xda1b('0x28')]);_0x329e3a['query']=_[_0xda1b('0x2f')](_0x59eee9[_0xda1b('0x2e')]);_0x329e3a['filters']=_[_0xda1b('0x31')](_0x329e3a[_0xda1b('0x2c')],_0x329e3a[_0xda1b('0x2e')]);_0x136f6c[_0xda1b('0x32')]=_[_0xda1b('0x31')](_0x329e3a[_0xda1b('0x2c')],qs[_0xda1b('0x33')](_0x59eee9[_0xda1b('0x2e')][_0xda1b('0x33')]));_0x136f6c[_0xda1b('0x32')]=_0x136f6c['attributes']['length']?_0x136f6c[_0xda1b('0x32')]:_0x329e3a[_0xda1b('0x2c')];if(_0x59eee9[_0xda1b('0x2e')][_0xda1b('0x3e')]){_0x136f6c[_0xda1b('0x3f')]=[{'all':!![]}];}_0x136f6c=_[_0xda1b('0x3c')]({},_0x136f6c,_0x59eee9[_0xda1b('0x44')]);return db['VoiceMailMessage']['find'](_0x136f6c)[_0xda1b('0x3d')](handleEntityNotFound(_0x4cd780,null))[_0xda1b('0x3d')](respondWithResult(_0x4cd780,null))[_0xda1b('0x42')](handleError(_0x4cd780,null));};exports[_0xda1b('0x45')]=function(_0x15c0c8,_0x5d0890){return db['VoiceMailMessage']['create'](_0x15c0c8[_0xda1b('0x46')],{})[_0xda1b('0x3d')](respondWithResult(_0x5d0890,0xc9))[_0xda1b('0x42')](handleError(_0x5d0890,null));};exports[_0xda1b('0x21')]=function(_0x1c895f,_0x189fa0){if(_0x1c895f[_0xda1b('0x46')]['id']){delete _0x1c895f[_0xda1b('0x46')]['id'];}return db[_0xda1b('0x27')][_0xda1b('0x47')]({'where':{'id':_0x1c895f[_0xda1b('0x48')]['id']}})[_0xda1b('0x3d')](handleEntityNotFound(_0x189fa0,null))[_0xda1b('0x3d')](saveUpdates(_0x1c895f[_0xda1b('0x46')],null))[_0xda1b('0x3d')](respondWithResult(_0x189fa0,null))[_0xda1b('0x42')](handleError(_0x189fa0,null));};exports['destroy']=function(_0x12d23,_0x4a5594){return db[_0xda1b('0x27')]['find']({'where':{'id':_0x12d23[_0xda1b('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a5594,null))['then'](removeEntity(_0x4a5594,null))[_0xda1b('0x42')](handleError(_0x4a5594,null));};exports[_0xda1b('0x49')]=function(_0x577c2a,_0x511a57,_0x2017de){return db[_0xda1b('0x27')][_0xda1b('0x47')]({'where':{'id':_0x577c2a[_0xda1b('0x48')]['id']},'attributes':['id',_0xda1b('0x4a'),_0xda1b('0x4b')]})[_0xda1b('0x3d')](handleEntityNotFound(_0x511a57,null))['then'](function(_0x52ebc0){if(_0x52ebc0){if(!_0x52ebc0[_0xda1b('0x4a')]){throw new db[(_0xda1b('0x4c'))][(_0xda1b('0x4d'))](_0xda1b('0x4e'));}var _0x373545={'Content-Type':'audio/wav','Content-Disposition':_0xda1b('0x4f')};if(_0x52ebc0[_0xda1b('0x4b')]){_0x373545['Content-Disposition']=_0xda1b('0x50')+_0x52ebc0[_0xda1b('0x4b')]+'.wav\x22';}_0x511a57[_0xda1b('0x51')](_0x373545);return _0x511a57[_0xda1b('0x25')](new Buffer(_0x52ebc0['recording']));}})['catch'](handleError(_0x511a57,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 59a79db..965b7c3 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 _0x7e91=['voice_voicemail_messages','dir','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceMailMessage'];(function(_0x11b897,_0x3875cc){var _0x3d202b=function(_0x319461){while(--_0x319461){_0x11b897['push'](_0x11b897['shift']());}};_0x3d202b(++_0x3875cc);}(_0x7e91,0x12e));var _0x17e9=function(_0x2713c5,_0x49ade1){_0x2713c5=_0x2713c5-0x0;var _0x1b23a7=_0x7e91[_0x2713c5];return _0x1b23a7;};'use strict';var _=require(_0x17e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x17e9('0x1'));var moment=require(_0x17e9('0x2'));var BPromise=require(_0x17e9('0x3'));var rp=require(_0x17e9('0x4'));var fs=require('fs');var path=require(_0x17e9('0x5'));var rimraf=require(_0x17e9('0x6'));var config=require(_0x17e9('0x7'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x2d8007,_0x38cdd5){return _0x2d8007[_0x17e9('0x8')](_0x17e9('0x9'),attributes,{'tableName':_0x17e9('0xa'),'paranoid':![],'indexes':[{'name':_0x17e9('0xb'),'fields':[_0x17e9('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb162=['util','../../config/logger','moment','bluebird','../../config/environment','exports','define','voice_voicemail_messages','dir'];(function(_0x241f74,_0x244cc0){var _0x5b63aa=function(_0x3b680e){while(--_0x3b680e){_0x241f74['push'](_0x241f74['shift']());}};_0x5b63aa(++_0x244cc0);}(_0xb162,0x18c));var _0x2b16=function(_0x3fb5e6,_0x5ba7c2){_0x3fb5e6=_0x3fb5e6-0x0;var _0x48dad1=_0xb162[_0x3fb5e6];return _0x48dad1;};'use strict';var _=require('lodash');var util=require(_0x2b16('0x0'));var logger=require(_0x2b16('0x1'))('api');var moment=require(_0x2b16('0x2'));var BPromise=require(_0x2b16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2b16('0x4'));var attributes=require('./voiceMailMessage.attributes');module[_0x2b16('0x5')]=function(_0x35ffcf,_0x535516){return _0x35ffcf[_0x2b16('0x6')]('VoiceMailMessage',attributes,{'tableName':_0x2b16('0x7'),'paranoid':![],'indexes':[{'name':_0x2b16('0x8'),'fields':[_0x2b16('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 4741768..c81af84 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 _0xc884=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x2c55c2,_0x10d013){var _0x244feb=function(_0x1661a5){while(--_0x1661a5){_0x2c55c2['push'](_0x2c55c2['shift']());}};_0x244feb(++_0x10d013);}(_0xc884,0x143));var _0x4c88=function(_0x149fa7,_0x42be3b){_0x149fa7=_0x149fa7-0x0;var _0x437f51=_0xc884[_0x149fa7];return _0x437f51;};'use strict';var _=require(_0x4c88('0x0'));var util=require('util');var moment=require(_0x4c88('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c88('0x2'));var fs=require('fs');var Redis=require(_0x4c88('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c88('0x4'));var logger=require('../../config/logger')(_0x4c88('0x5'));var config=require(_0x4c88('0x6'));var jayson=require(_0x4c88('0x7'));var client=jayson[_0x4c88('0x8')][_0x4c88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e7600,_0x4ab642,_0x16f1b7){return new BPromise(function(_0x51af6d,_0x5b7eb2){return client[_0x4c88('0xa')](_0x5e7600,_0x16f1b7)['then'](function(_0x56a1ec){logger[_0x4c88('0xb')](_0x4c88('0xc'),_0x4ab642,_0x4c88('0xd'));logger[_0x4c88('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x4ab642,_0x4c88('0xd'),JSON[_0x4c88('0xf')](_0x56a1ec));if(_0x56a1ec[_0x4c88('0x10')]){if(_0x56a1ec[_0x4c88('0x10')][_0x4c88('0x11')]===0x1f4){logger[_0x4c88('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x4ab642,_0x56a1ec[_0x4c88('0x10')]['message']);return _0x5b7eb2(_0x56a1ec[_0x4c88('0x10')][_0x4c88('0x12')]);}logger['error'](_0x4c88('0xc'),_0x4ab642,_0x56a1ec[_0x4c88('0x10')]['message']);return _0x51af6d(_0x56a1ec[_0x4c88('0x10')][_0x4c88('0x12')]);}else{logger[_0x4c88('0xb')](_0x4c88('0xc'),_0x4ab642,'request\x20sent');_0x51af6d(_0x56a1ec[_0x4c88('0x13')][_0x4c88('0x12')]);}})[_0x4c88('0x14')](function(_0x610ff4){logger['error'](_0x4c88('0xc'),_0x4ab642,_0x610ff4);_0x5b7eb2(_0x610ff4);});});} \ No newline at end of file +var _0x163f=['VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','info','request\x20sent','debug','code','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x163f,0x17e));var _0xf163=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x163f[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var moment=require(_0xf163('0x2'));var BPromise=require(_0xf163('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf163('0x4'));var db=require(_0xf163('0x5'))['db'];var utils=require(_0xf163('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf163('0x7'));var client=jayson['client'][_0xf163('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56a026,_0x3cb55c,_0x193c22){return new BPromise(function(_0x12e5fb,_0x3ef717){return client['request'](_0x56a026,_0x193c22)['then'](function(_0x3af931){logger[_0xf163('0x9')]('VoiceMailMessage,\x20%s,\x20%s',_0x3cb55c,_0xf163('0xa'));logger[_0xf163('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3cb55c,_0xf163('0xa'),JSON['stringify'](_0x3af931));if(_0x3af931['error']){if(_0x3af931['error'][_0xf163('0xc')]===0x1f4){logger[_0xf163('0xd')](_0xf163('0xe'),_0x3cb55c,_0x3af931['error']['message']);return _0x3ef717(_0x3af931[_0xf163('0xd')][_0xf163('0xf')]);}logger[_0xf163('0xd')](_0xf163('0xe'),_0x3cb55c,_0x3af931[_0xf163('0xd')]['message']);return _0x12e5fb(_0x3af931['error'][_0xf163('0xf')]);}else{logger[_0xf163('0x9')]('VoiceMailMessage,\x20%s,\x20%s',_0x3cb55c,_0xf163('0xa'));_0x12e5fb(_0x3af931[_0xf163('0x10')]['message']);}})[_0xf163('0x11')](function(_0x28e2c7){logger[_0xf163('0xd')](_0xf163('0xe'),_0x3cb55c,_0x28e2c7);_0x3ef717(_0x28e2c7);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b600336..5d5b2e3 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 _0x5288=['../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','show','/:id/sounds','getSounds','post','create','/:id','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x483606,_0x1e6890){var _0x49c89f=function(_0x17c0f1){while(--_0x17c0f1){_0x483606['push'](_0x483606['shift']());}};_0x49c89f(++_0x1e6890);}(_0x5288,0x197));var _0x8528=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5288[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x8528('0x0'));var util=require(_0x8528('0x1'));var path=require(_0x8528('0x2'));var timeout=require(_0x8528('0x3'));var express=require(_0x8528('0x4'));var router=express[_0x8528('0x5')]();var fs_extra=require(_0x8528('0x6'));var auth=require(_0x8528('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8528('0x8'));var controller=require(_0x8528('0x9'));router['get']('/',auth[_0x8528('0xa')](),controller[_0x8528('0xb')]);router[_0x8528('0xc')]('/:id',auth[_0x8528('0xa')](),controller[_0x8528('0xd')]);router[_0x8528('0xc')](_0x8528('0xe'),auth['isAuthenticated'](),controller[_0x8528('0xf')]);router[_0x8528('0x10')]('/',auth[_0x8528('0xa')](),controller[_0x8528('0x11')]);router['post'](_0x8528('0xe'),auth[_0x8528('0xa')](),controller['addSound']);router['put'](_0x8528('0x12'),auth[_0x8528('0xa')](),controller['update']);router['delete'](_0x8528('0x12'),auth[_0x8528('0xa')](),controller[_0x8528('0x13')]);router['delete'](_0x8528('0x14'),auth[_0x8528('0xa')](),controller[_0x8528('0x15')]);module[_0x8528('0x16')]=router; \ No newline at end of file +var _0xf80a=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSounds','post','create','/:id/sounds','addSound','put','destroy','delete','/:id/sounds/:id2','exports','multer','util'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf80a,0x166));var _0xaf80=function(_0x25fb19,_0x57b960){_0x25fb19=_0x25fb19-0x0;var _0x56a9d2=_0xf80a[_0x25fb19];return _0x56a9d2;};'use strict';var multer=require(_0xaf80('0x0'));var util=require(_0xaf80('0x1'));var path=require(_0xaf80('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf80('0x3'));var router=express[_0xaf80('0x4')]();var fs_extra=require(_0xaf80('0x5'));var auth=require(_0xaf80('0x6'));var interaction=require(_0xaf80('0x7'));var config=require(_0xaf80('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0xaf80('0x9')]('/',auth[_0xaf80('0xa')](),controller[_0xaf80('0xb')]);router[_0xaf80('0x9')](_0xaf80('0xc'),auth[_0xaf80('0xa')](),controller[_0xaf80('0xd')]);router[_0xaf80('0x9')]('/:id/sounds',auth[_0xaf80('0xa')](),controller[_0xaf80('0xe')]);router[_0xaf80('0xf')]('/',auth[_0xaf80('0xa')](),controller[_0xaf80('0x10')]);router[_0xaf80('0xf')](_0xaf80('0x11'),auth[_0xaf80('0xa')](),controller[_0xaf80('0x12')]);router[_0xaf80('0x13')](_0xaf80('0xc'),auth[_0xaf80('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xaf80('0x14')]);router[_0xaf80('0x15')](_0xaf80('0x16'),auth[_0xaf80('0xa')](),controller['removeSound']);module[_0xaf80('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3f73bc1..c616cd9 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 _0x9e9e=['quietmp3nb','quietmp3','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb'];(function(_0x4a3877,_0x2ac976){var _0x190376=function(_0x3cb396){while(--_0x3cb396){_0x4a3877['push'](_0x4a3877['shift']());}};_0x190376(++_0x2ac976);}(_0x9e9e,0x71));var _0xe9e9=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0x9e9e[_0x50c492];return _0x3505a8;};'use strict';var Sequelize=require(_0xe9e9('0x0'));module[_0xe9e9('0x1')]={'name':{'type':Sequelize[_0xe9e9('0x2')],'allowNull':![],'unique':_0xe9e9('0x3')},'mode':{'type':Sequelize[_0xe9e9('0x4')](_0xe9e9('0x5'),_0xe9e9('0x6'),_0xe9e9('0x7'),_0xe9e9('0x8'),_0xe9e9('0x9'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xe9e9('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xe9e9('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xe9e9('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xe9e9('0x2')],'allowNull':!![]},'stamp':{'type':_0xe9e9('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf99=['quietmp3nb','quietmp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','custom','files','mp3nb'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0xaf99,0x13e));var _0x9af9=function(_0x11c275,_0x359c2e){_0x11c275=_0x11c275-0x0;var _0x2bb1ec=_0xaf99[_0x11c275];return _0x2bb1ec;};'use strict';var Sequelize=require(_0x9af9('0x0'));module[_0x9af9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9af9('0x2')},'mode':{'type':Sequelize[_0x9af9('0x3')](_0x9af9('0x4'),_0x9af9('0x5'),_0x9af9('0x6'),_0x9af9('0x7'),_0x9af9('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x9af9('0x5')},'directory':{'type':Sequelize[_0x9af9('0x9')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x9af9('0x9')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9af9('0xa')},'format':{'type':Sequelize[_0x9af9('0x9')],'allowNull':!![]},'stamp':{'type':_0x9af9('0xb')},'defaultEntry':{'type':Sequelize[_0x9af9('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 eb243a5..c769039 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 _0xfe3f=['getSounds','eml-format','request-promise','moment','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','destroy','error','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','create','transaction','mode','files','directory','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','extname','converted_format','format','removeSound','id2'];(function(_0x5489c4,_0x1e7a17){var _0x2c4624=function(_0x42675a){while(--_0x42675a){_0x5489c4['push'](_0x5489c4['shift']());}};_0x2c4624(++_0x1e7a17);}(_0xfe3f,0x6d));var _0xffe3=function(_0x2a05be,_0x56492b){_0x2a05be=_0x2a05be-0x0;var _0x424564=_0xfe3f[_0x2a05be];return _0x424564;};'use strict';var emlformat=require(_0xffe3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xffe3('0x1'));var moment=require(_0xffe3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xffe3('0x3'));var sox=require(_0xffe3('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffe3('0x5'));var _=require('lodash');var squel=require(_0xffe3('0x6'));var crypto=require(_0xffe3('0x7'));var jsforce=require(_0xffe3('0x8'));var deskjs=require(_0xffe3('0x9'));var toCsv=require(_0xffe3('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xffe3('0xb'));var qs=require(_0xffe3('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xffe3('0xd'));var logger=require(_0xffe3('0xe'))(_0xffe3('0xf'));var utils=require('../../config/utils');var config=require(_0xffe3('0x10'));var licenseUtil=require(_0xffe3('0x11'));var db=require(_0xffe3('0x12'))['db'];function respondWithStatusCode(_0xbf6d8d,_0x3539c3){_0x3539c3=_0x3539c3||0xcc;return function(_0x18a237){if(_0x18a237){return _0xbf6d8d[_0xffe3('0x13')](_0x3539c3);}return _0xbf6d8d[_0xffe3('0x14')](_0x3539c3)[_0xffe3('0x15')]();};}function respondWithResult(_0x2cc04c,_0x3a8bbc){_0x3a8bbc=_0x3a8bbc||0xc8;return function(_0xe4631e){if(_0xe4631e){return _0x2cc04c['status'](_0x3a8bbc)['json'](_0xe4631e);}};}function respondWithFilteredResult(_0x3c122d,_0x2ca5b1){return function(_0x12182a){if(_0x12182a){var _0x13186c=typeof _0x2ca5b1['offset']===_0xffe3('0x16')&&typeof _0x2ca5b1['limit']===_0xffe3('0x16');var _0x5061bf=_0x12182a[_0xffe3('0x17')];var _0x501648=_0x13186c?0x0:_0x2ca5b1[_0xffe3('0x18')];var _0x321b83=_0x13186c?_0x12182a[_0xffe3('0x17')]:_0x2ca5b1[_0xffe3('0x18')]+_0x2ca5b1['limit'];var _0x4589cb;if(_0x321b83>=_0x5061bf){_0x321b83=_0x5061bf;_0x4589cb=0xc8;}else{_0x4589cb=0xce;}_0x3c122d[_0xffe3('0x14')](_0x4589cb);return _0x3c122d[_0xffe3('0x19')](_0xffe3('0x1a'),_0x501648+'-'+_0x321b83+'/'+_0x5061bf)[_0xffe3('0x1b')](_0x12182a);}return null;};}function patchUpdates(_0x477f8f){return function(_0x4f4c84){try{jsonpatch[_0xffe3('0x1c')](_0x4f4c84,_0x477f8f,!![]);}catch(_0x424606){return BPromise[_0xffe3('0x1d')](_0x424606);}return _0x4f4c84[_0xffe3('0x1e')]();};}function saveUpdates(_0x1f9c7b,_0x5caab1){return function(_0x37bcb1){if(_0x37bcb1){return _0x37bcb1[_0xffe3('0x1f')](_0x1f9c7b)[_0xffe3('0x20')](function(_0x2fd822){return _0x2fd822;});}return null;};}function removeEntity(_0x188ede,_0x2587d8){return function(_0x2c0a63){if(_0x2c0a63){return _0x2c0a63['destroy']()[_0xffe3('0x20')](function(){var _0x583c25=_0x2c0a63[_0xffe3('0x21')]({'plain':!![]});var _0x3e5405='MusicOnHolds';return db['UserProfileResource'][_0xffe3('0x22')]({'where':{'type':_0x3e5405,'resourceId':_0x583c25['id']}})[_0xffe3('0x20')](function(){return _0x2c0a63;});})[_0xffe3('0x20')](function(){_0x188ede['status'](0xcc)[_0xffe3('0x15')]();});}};}function handleEntityNotFound(_0xe61fd3,_0xa49d13){return function(_0x1bad6a){if(!_0x1bad6a){_0xe61fd3['sendStatus'](0x194);}return _0x1bad6a;};}function handleError(_0x1f4ab0,_0x98d789){_0x98d789=_0x98d789||0x1f4;return function(_0x2c916e){logger[_0xffe3('0x23')](_0x2c916e['stack']);if(_0x2c916e[_0xffe3('0x24')]){delete _0x2c916e['name'];}_0x1f4ab0[_0xffe3('0x14')](_0x98d789)[_0xffe3('0x25')](_0x2c916e);};}exports['index']=function(_0x2f94f4,_0x5368f7){var _0x1a0933={},_0x2dd9ed={},_0x27c81a={'count':0x0,'rows':[]};var _0x5b339f=_[_0xffe3('0x26')](db[_0xffe3('0x27')][_0xffe3('0x28')],function(_0x5c5de4){return{'name':_0x5c5de4[_0xffe3('0x29')],'type':_0x5c5de4[_0xffe3('0x2a')][_0xffe3('0x2b')]};});_0x2dd9ed[_0xffe3('0x2c')]=_['map'](_0x5b339f,_0xffe3('0x24'));_0x2dd9ed[_0xffe3('0x2d')]=_[_0xffe3('0x2e')](_0x2f94f4[_0xffe3('0x2d')]);_0x2dd9ed['filters']=_['intersection'](_0x2dd9ed[_0xffe3('0x2c')],_0x2dd9ed[_0xffe3('0x2d')]);_0x1a0933[_0xffe3('0x2f')]=_[_0xffe3('0x30')](_0x2dd9ed['model'],qs['fields'](_0x2f94f4[_0xffe3('0x2d')][_0xffe3('0x31')]));_0x1a0933['attributes']=_0x1a0933[_0xffe3('0x2f')]['length']?_0x1a0933['attributes']:_0x2dd9ed[_0xffe3('0x2c')];if(!_0x2f94f4[_0xffe3('0x2d')][_0xffe3('0x32')](_0xffe3('0x33'))){_0x1a0933[_0xffe3('0x34')]=qs[_0xffe3('0x34')](_0x2f94f4['query'][_0xffe3('0x34')]);_0x1a0933[_0xffe3('0x18')]=qs[_0xffe3('0x18')](_0x2f94f4['query'][_0xffe3('0x18')]);}_0x1a0933[_0xffe3('0x35')]=qs[_0xffe3('0x36')](_0x2f94f4['query'][_0xffe3('0x36')]);delete _0x2f94f4[_0xffe3('0x2d')][_0xffe3('0x36')];_0x1a0933[_0xffe3('0x37')]=qs[_0xffe3('0x38')](_[_0xffe3('0x39')](_0x2f94f4[_0xffe3('0x2d')],_0x2dd9ed[_0xffe3('0x38')]),_0x5b339f);if(_0x2f94f4[_0xffe3('0x2d')]['filter']){_0x1a0933['where']=_[_0xffe3('0x3a')](_0x1a0933[_0xffe3('0x37')],{'$or':_[_0xffe3('0x26')](_0x5b339f,function(_0x4c78c3){if(_0x4c78c3[_0xffe3('0x2a')]!=='VIRTUAL'){var _0x3a731f={};_0x3a731f[_0x4c78c3['name']]={'$like':'%'+_0x2f94f4[_0xffe3('0x2d')][_0xffe3('0x3b')]+'%'};return _0x3a731f;}})});}_0x1a0933=_[_0xffe3('0x3a')]({},_0x1a0933,_0x2f94f4[_0xffe3('0x3c')]);var _0x3def53={'where':_0x1a0933['where']};return db[_0xffe3('0x27')][_0xffe3('0x17')](_0x3def53)[_0xffe3('0x20')](function(_0x1e8266){_0x27c81a['count']=_0x1e8266;if(_0x2f94f4['query'][_0xffe3('0x3d')]){_0x1a0933[_0xffe3('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xffe3('0x3f')](_0x1a0933);})[_0xffe3('0x20')](function(_0x5acfb7){_0x27c81a[_0xffe3('0x40')]=_0x5acfb7;return _0x27c81a;})[_0xffe3('0x20')](respondWithFilteredResult(_0x5368f7,_0x1a0933))[_0xffe3('0x41')](handleError(_0x5368f7,null));};exports[_0xffe3('0x42')]=function(_0x3ac732,_0x54cfa3){var _0x331fea={'raw':![],'where':{'id':_0x3ac732[_0xffe3('0x43')]['id']}},_0x5a6327={};_0x5a6327[_0xffe3('0x2c')]=_['keys'](db[_0xffe3('0x27')][_0xffe3('0x28')]);_0x5a6327[_0xffe3('0x2d')]=_[_0xffe3('0x2e')](_0x3ac732[_0xffe3('0x2d')]);_0x5a6327[_0xffe3('0x38')]=_[_0xffe3('0x30')](_0x5a6327[_0xffe3('0x2c')],_0x5a6327[_0xffe3('0x2d')]);_0x331fea[_0xffe3('0x2f')]=_[_0xffe3('0x30')](_0x5a6327[_0xffe3('0x2c')],qs[_0xffe3('0x31')](_0x3ac732[_0xffe3('0x2d')][_0xffe3('0x31')]));_0x331fea[_0xffe3('0x2f')]=_0x331fea['attributes'][_0xffe3('0x44')]?_0x331fea[_0xffe3('0x2f')]:_0x5a6327[_0xffe3('0x2c')];if(_0x3ac732['query'][_0xffe3('0x3d')]){_0x331fea['include']=[{'all':!![]}];}_0x331fea=_['merge']({},_0x331fea,_0x3ac732['options']);return db[_0xffe3('0x27')][_0xffe3('0x45')](_0x331fea)['then'](handleEntityNotFound(_0x54cfa3,null))[_0xffe3('0x20')](respondWithResult(_0x54cfa3,null))[_0xffe3('0x41')](handleError(_0x54cfa3,null));};exports[_0xffe3('0x1f')]=function(_0x4dd00f,_0xb3a3d9){if(_0x4dd00f['body']['id']){delete _0x4dd00f[_0xffe3('0x46')]['id'];}return db[_0xffe3('0x27')][_0xffe3('0x45')]({'where':{'id':_0x4dd00f[_0xffe3('0x43')]['id']}})[_0xffe3('0x20')](handleEntityNotFound(_0xb3a3d9,null))['then'](saveUpdates(_0x4dd00f[_0xffe3('0x46')],null))[_0xffe3('0x20')](respondWithResult(_0xb3a3d9,null))[_0xffe3('0x41')](handleError(_0xb3a3d9,null));};exports[_0xffe3('0x47')]=function(_0x41620a,_0x3bfdd2,_0xfb0811){return db['sequelize'][_0xffe3('0x48')](function(_0x29df4a){if(_0x41620a[_0xffe3('0x46')][_0xffe3('0x49')]===_0xffe3('0x4a')){_0x41620a[_0xffe3('0x46')][_0xffe3('0x4b')]=path['join'](config[_0xffe3('0x4c')],_0xffe3('0x4d'),_0x41620a[_0xffe3('0x46')][_0xffe3('0x24')]);}return db['VoiceMusicOnHold'][_0xffe3('0x47')](_0x41620a[_0xffe3('0x46')],{'transaction':_0x29df4a})[_0xffe3('0x20')](function(_0x504c21){if(_0x41620a[_0xffe3('0x46')][_0xffe3('0x49')]===_0xffe3('0x4a')){fs['mkdirSync'](_0x504c21[_0xffe3('0x4b')],parseInt(_0xffe3('0x4e'),0x8));}var _0x1929bb=_0x41620a[_0xffe3('0x4f')][_0xffe3('0x21')]({'plain':!![]});if(!_0x1929bb)throw new Error(_0xffe3('0x50'));if(_0x1929bb[_0xffe3('0x51')]===_0xffe3('0x4f')){var _0x3892dc=_0x504c21[_0xffe3('0x21')]({'plain':!![]});return db['UserProfileSection'][_0xffe3('0x45')]({'where':{'name':_0xffe3('0x52'),'userProfileId':_0x1929bb['userProfileId']},'raw':!![]})[_0xffe3('0x20')](function(_0x3de605){if(_0x3de605&&_0x3de605[_0xffe3('0x53')]===0x0){return db[_0xffe3('0x54')][_0xffe3('0x47')]({'name':_0x3892dc['name'],'resourceId':_0x3892dc['id'],'type':_0x3de605[_0xffe3('0x24')],'sectionId':_0x3de605['id']},{})[_0xffe3('0x20')](function(){return _0x504c21;});}else{return _0x504c21;}})['catch'](function(_0x3ba982){logger[_0xffe3('0x23')](_0xffe3('0x55'),_0x3ba982);});}return _0x504c21;});})['then'](respondWithResult(_0x3bfdd2,0xc9))['catch'](handleError(_0x3bfdd2,null));};exports[_0xffe3('0x22')]=function(_0x2a7230,_0x3277bf,_0x2133a5){var _0x1e24a7;return db[_0xffe3('0x27')][_0xffe3('0x45')]({'where':{'id':_0x2a7230[_0xffe3('0x43')]['id']}})[_0xffe3('0x20')](function(_0x369866){if(_0x369866){return db[_0xffe3('0x56')][_0xffe3('0x48')](function(_0x1113c1){return _0x369866[_0xffe3('0x22')]({'transaction':_0x1113c1,'raw':!![]})['then'](function(_0x36604e){if(_0x36604e['directory']){fs[_0xffe3('0x57')](_0x36604e[_0xffe3('0x4b')])[_0xffe3('0x58')](function(_0x1cbd2d){fs[_0xffe3('0x59')](path[_0xffe3('0x5a')](_0x36604e[_0xffe3('0x4b')],_0x1cbd2d));});fs[_0xffe3('0x5b')](_0x36604e[_0xffe3('0x4b')]);}return _0x36604e;});})['catch'](function(_0x3e89af){throw new db[(_0xffe3('0x5c'))][(_0xffe3('0x5d'))](_0x3e89af[_0xffe3('0x5e')]);});}})[_0xffe3('0x20')](handleEntityNotFound(_0x3277bf,null))['then'](removeEntity(_0x3277bf,null))['catch'](handleError(_0x3277bf,null));};exports[_0xffe3('0x5f')]=function(_0x3af593,_0x2adcb6,_0xbd8cc7){return db[_0xffe3('0x56')][_0xffe3('0x48')](function(_0x24a538){var _0x4fb4d8;return db[_0xffe3('0x27')][_0xffe3('0x45')]({'where':{'id':_0x3af593['params']['id']}})['then'](function(_0x49412c){if(_0x49412c){_0x4fb4d8=_0x49412c;return _0x49412c[_0xffe3('0x5f')](_0x3af593[_0xffe3('0x46')]['id'],{'transaction':_0x24a538});}})[_0xffe3('0x20')](function(_0xfa5793){if(_0xfa5793){return db[_0xffe3('0x60')][_0xffe3('0x61')]({'where':{'id':_0x3af593[_0xffe3('0x46')]['id']},'attributes':['id',_0xffe3('0x24'),_0xffe3('0x62'),'converted_format',_0xffe3('0x63')],'raw':!![]});}})['then'](function(_0x3521a0){if(_0x3521a0){var _0x45a9ec=path['join'](config['root'],_0xffe3('0x64'),util['format'](_0xffe3('0x65'),path['basename'](_0x3521a0[_0xffe3('0x62')],path[_0xffe3('0x66')](_0x3521a0[_0xffe3('0x62')])),_0x3521a0[_0xffe3('0x67')]));var _0x399cec=path['join'](config['root'],_0xffe3('0x4d'),_0x4fb4d8[_0xffe3('0x24')],util[_0xffe3('0x68')](_0xffe3('0x65'),_0x3521a0['name'],_0x3521a0[_0xffe3('0x67')]));fs['symlinkSync'](_0x45a9ec,_0x399cec);return _0x3521a0;}})[_0xffe3('0x41')](function(_0x4c6353){throw new db['Sequelize']['ValidationError'](_0x4c6353[_0xffe3('0x5e')]);});})[_0xffe3('0x20')](handleEntityNotFound(_0x2adcb6,null))[_0xffe3('0x20')](respondWithResult(_0x2adcb6,0xc9))[_0xffe3('0x41')](handleError(_0x2adcb6,null));};exports['removeSound']=function(_0x415fb5,_0x2744f5,_0x2fbab3){return db[_0xffe3('0x56')]['transaction'](function(_0x41be2e){var _0x1fead5;return db['VoiceMusicOnHold'][_0xffe3('0x61')]({'where':{'id':_0x415fb5['params']['id']}})[_0xffe3('0x20')](handleEntityNotFound(_0x2744f5,null))[_0xffe3('0x20')](function(_0x79c956){if(_0x79c956){_0x1fead5=_0x79c956;return _0x79c956[_0xffe3('0x69')](_0x415fb5[_0xffe3('0x43')][_0xffe3('0x6a')]);}})[_0xffe3('0x20')](function(_0x55d1e9){if(_0x55d1e9){return db[_0xffe3('0x60')]['findOne']({'where':{'id':_0x415fb5[_0xffe3('0x43')][_0xffe3('0x6a')]},'attributes':['id',_0xffe3('0x24'),_0xffe3('0x62'),'converted_format',_0xffe3('0x63')],'raw':!![]});}})[_0xffe3('0x20')](function(_0x51494b){if(_0x51494b){fs[_0xffe3('0x59')](path[_0xffe3('0x5a')](_0x1fead5[_0xffe3('0x4b')],util[_0xffe3('0x68')]('%s.%s',_0x51494b[_0xffe3('0x24')],_0x51494b[_0xffe3('0x67')])));return _0x51494b;}})['catch'](function(_0x453ea6){throw new db[(_0xffe3('0x5c'))][(_0xffe3('0x5d'))](_0x453ea6[_0xffe3('0x5e')]);});})[_0xffe3('0x20')](handleEntityNotFound(_0x2744f5,null))['then'](respondWithStatusCode(_0x2744f5,0xcc))[_0xffe3('0x41')](handleError(_0x2744f5,null));};exports['getSounds']=function(_0x32bb0c,_0x5730c4,_0x232200){var _0x515327={};var _0x4a817a={};var _0x339dd0;var _0x1d357e;return db[_0xffe3('0x27')]['findOne']({'where':{'id':_0x32bb0c[_0xffe3('0x43')]['id']}})[_0xffe3('0x20')](handleEntityNotFound(_0x5730c4,null))['then'](function(_0x261740){if(_0x261740){_0x339dd0=_0x261740;_0x4a817a[_0xffe3('0x2c')]=_['keys'](db[_0xffe3('0x60')][_0xffe3('0x28')]);_0x4a817a['query']=_['keys'](_0x32bb0c['query']);_0x4a817a[_0xffe3('0x38')]=_['intersection'](_0x4a817a[_0xffe3('0x2c')],_0x4a817a[_0xffe3('0x2d')]);_0x515327[_0xffe3('0x2f')]=_[_0xffe3('0x30')](_0x4a817a['model'],qs[_0xffe3('0x31')](_0x32bb0c[_0xffe3('0x2d')][_0xffe3('0x31')]));_0x515327['attributes']=_0x515327[_0xffe3('0x2f')][_0xffe3('0x44')]?_0x515327['attributes']:_0x4a817a[_0xffe3('0x2c')];_0x515327['order']=qs['sort'](_0x32bb0c['query'][_0xffe3('0x36')]);_0x515327['where']=qs[_0xffe3('0x38')](_[_0xffe3('0x39')](_0x32bb0c['query'],_0x4a817a[_0xffe3('0x38')]));if(_0x32bb0c[_0xffe3('0x2d')][_0xffe3('0x3b')]){_0x515327[_0xffe3('0x37')]=_[_0xffe3('0x3a')](_0x515327[_0xffe3('0x37')],{'$or':_['map'](_0x515327['attributes'],function(_0xf9b0e8){var _0x19bb32={};_0x19bb32[_0xf9b0e8]={'$like':'%'+_0x32bb0c['query'][_0xffe3('0x3b')]+'%'};return _0x19bb32;})});}_0x515327=_[_0xffe3('0x3a')]({},_0x515327,_0x32bb0c[_0xffe3('0x3c')]);return _0x339dd0[_0xffe3('0x6b')](_0x515327);}})[_0xffe3('0x20')](function(_0x42f92b){if(_0x42f92b){_0x1d357e=_0x42f92b[_0xffe3('0x44')];if(!_0x32bb0c['query'][_0xffe3('0x32')](_0xffe3('0x33'))){_0x515327[_0xffe3('0x34')]=qs[_0xffe3('0x34')](_0x32bb0c[_0xffe3('0x2d')][_0xffe3('0x34')]);_0x515327[_0xffe3('0x18')]=qs['offset'](_0x32bb0c['query']['offset']);}return _0x339dd0[_0xffe3('0x6b')](_0x515327);}})[_0xffe3('0x20')](function(_0x1588d7){if(_0x1588d7){return _0x1588d7?{'count':_0x1d357e,'rows':_0x1588d7}:null;}})[_0xffe3('0x20')](respondWithResult(_0x5730c4,null))[_0xffe3('0x41')](handleError(_0x5730c4,null));}; \ No newline at end of file +var _0x1c06=['server/files/sounds/converted','%s.%s','basename','extname','format','Sequelize','removeSound','id2','order','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','undefined','count','offset','status','set','Content-Range','json','apply','reject','save','then','destroy','get','MusicOnHolds','sendStatus','error','stack','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','body','params','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format'];(function(_0x1d9102,_0x23c2fd){var _0x178f64=function(_0x409144){while(--_0x409144){_0x1d9102['push'](_0x1d9102['shift']());}};_0x178f64(++_0x23c2fd);}(_0x1c06,0x1d7));var _0x61c0=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x1c06[_0x5d72da];return _0x43ebe7;};'use strict';var emlformat=require(_0x61c0('0x0'));var rimraf=require(_0x61c0('0x1'));var zipdir=require(_0x61c0('0x2'));var jsonpatch=require(_0x61c0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x61c0('0x4'));var util=require(_0x61c0('0x5'));var path=require(_0x61c0('0x6'));var sox=require(_0x61c0('0x7'));var csv=require(_0x61c0('0x8'));var ejs=require(_0x61c0('0x9'));var fs=require('fs');var fs_extra=require(_0x61c0('0xa'));var _=require(_0x61c0('0xb'));var squel=require(_0x61c0('0xc'));var crypto=require('crypto');var jsforce=require(_0x61c0('0xd'));var deskjs=require(_0x61c0('0xe'));var toCsv=require(_0x61c0('0x8'));var querystring=require('querystring');var Papa=require(_0x61c0('0xf'));var Redis=require(_0x61c0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x61c0('0x11'));var as=require(_0x61c0('0x12'));var hardwareService=require(_0x61c0('0x13'));var logger=require(_0x61c0('0x14'))(_0x61c0('0x15'));var utils=require(_0x61c0('0x16'));var config=require(_0x61c0('0x17'));var licenseUtil=require(_0x61c0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50549d,_0x47c33f){_0x47c33f=_0x47c33f||0xcc;return function(_0x4aff21){if(_0x4aff21){return _0x50549d['sendStatus'](_0x47c33f);}return _0x50549d['status'](_0x47c33f)[_0x61c0('0x19')]();};}function respondWithResult(_0x456752,_0xaf5ac0){_0xaf5ac0=_0xaf5ac0||0xc8;return function(_0x4d051b){if(_0x4d051b){return _0x456752['status'](_0xaf5ac0)['json'](_0x4d051b);}};}function respondWithFilteredResult(_0xa52be4,_0x4d4012){return function(_0x2e4d32){if(_0x2e4d32){var _0x2760c0=typeof _0x4d4012['offset']===_0x61c0('0x1a')&&typeof _0x4d4012['limit']===_0x61c0('0x1a');var _0xcda9c9=_0x2e4d32[_0x61c0('0x1b')];var _0xff204e=_0x2760c0?0x0:_0x4d4012[_0x61c0('0x1c')];var _0x16b294=_0x2760c0?_0x2e4d32[_0x61c0('0x1b')]:_0x4d4012[_0x61c0('0x1c')]+_0x4d4012['limit'];var _0x508d6b;if(_0x16b294>=_0xcda9c9){_0x16b294=_0xcda9c9;_0x508d6b=0xc8;}else{_0x508d6b=0xce;}_0xa52be4[_0x61c0('0x1d')](_0x508d6b);return _0xa52be4[_0x61c0('0x1e')](_0x61c0('0x1f'),_0xff204e+'-'+_0x16b294+'/'+_0xcda9c9)[_0x61c0('0x20')](_0x2e4d32);}return null;};}function patchUpdates(_0x48ca9e){return function(_0x3064df){try{jsonpatch[_0x61c0('0x21')](_0x3064df,_0x48ca9e,!![]);}catch(_0x25aa27){return BPromise[_0x61c0('0x22')](_0x25aa27);}return _0x3064df[_0x61c0('0x23')]();};}function saveUpdates(_0x301766,_0x5237b5){return function(_0x1f9307){if(_0x1f9307){return _0x1f9307['update'](_0x301766)[_0x61c0('0x24')](function(_0xf48ecb){return _0xf48ecb;});}return null;};}function removeEntity(_0x634324,_0x47e1a){return function(_0x1c9751){if(_0x1c9751){return _0x1c9751[_0x61c0('0x25')]()[_0x61c0('0x24')](function(){var _0x52df5f=_0x1c9751[_0x61c0('0x26')]({'plain':!![]});var _0x43b906=_0x61c0('0x27');return db['UserProfileResource'][_0x61c0('0x25')]({'where':{'type':_0x43b906,'resourceId':_0x52df5f['id']}})[_0x61c0('0x24')](function(){return _0x1c9751;});})[_0x61c0('0x24')](function(){_0x634324[_0x61c0('0x1d')](0xcc)[_0x61c0('0x19')]();});}};}function handleEntityNotFound(_0x58c87f,_0x128b8f){return function(_0xc9e53d){if(!_0xc9e53d){_0x58c87f[_0x61c0('0x28')](0x194);}return _0xc9e53d;};}function handleError(_0x5c9378,_0x560e11){_0x560e11=_0x560e11||0x1f4;return function(_0x58f2ef){logger[_0x61c0('0x29')](_0x58f2ef[_0x61c0('0x2a')]);if(_0x58f2ef['name']){delete _0x58f2ef['name'];}_0x5c9378[_0x61c0('0x1d')](_0x560e11)[_0x61c0('0x2b')](_0x58f2ef);};}exports[_0x61c0('0x2c')]=function(_0x20cdd5,_0x22c424){var _0x52f298={},_0x174d3e={},_0x1f9da0={'count':0x0,'rows':[]};var _0x39ea7b=_[_0x61c0('0x2d')](db[_0x61c0('0x2e')][_0x61c0('0x2f')],function(_0x1f275e){return{'name':_0x1f275e[_0x61c0('0x30')],'type':_0x1f275e['type'][_0x61c0('0x31')]};});_0x174d3e[_0x61c0('0x32')]=_['map'](_0x39ea7b,_0x61c0('0x33'));_0x174d3e[_0x61c0('0x34')]=_['keys'](_0x20cdd5['query']);_0x174d3e['filters']=_[_0x61c0('0x35')](_0x174d3e['model'],_0x174d3e[_0x61c0('0x34')]);_0x52f298[_0x61c0('0x36')]=_['intersection'](_0x174d3e['model'],qs['fields'](_0x20cdd5['query'][_0x61c0('0x37')]));_0x52f298[_0x61c0('0x36')]=_0x52f298['attributes'][_0x61c0('0x38')]?_0x52f298[_0x61c0('0x36')]:_0x174d3e[_0x61c0('0x32')];if(!_0x20cdd5['query'][_0x61c0('0x39')]('nolimit')){_0x52f298[_0x61c0('0x3a')]=qs[_0x61c0('0x3a')](_0x20cdd5[_0x61c0('0x34')][_0x61c0('0x3a')]);_0x52f298[_0x61c0('0x1c')]=qs[_0x61c0('0x1c')](_0x20cdd5[_0x61c0('0x34')]['offset']);}_0x52f298['order']=qs['sort'](_0x20cdd5[_0x61c0('0x34')]['sort']);delete _0x20cdd5[_0x61c0('0x34')][_0x61c0('0x3b')];_0x52f298[_0x61c0('0x3c')]=qs[_0x61c0('0x3d')](_[_0x61c0('0x3e')](_0x20cdd5['query'],_0x174d3e[_0x61c0('0x3d')]),_0x39ea7b);if(_0x20cdd5[_0x61c0('0x34')][_0x61c0('0x3f')]){_0x52f298[_0x61c0('0x3c')]=_[_0x61c0('0x40')](_0x52f298['where'],{'$or':_[_0x61c0('0x2d')](_0x39ea7b,function(_0x4f807c){if(_0x4f807c['type']!==_0x61c0('0x41')){var _0x41dbf1={};_0x41dbf1[_0x4f807c[_0x61c0('0x33')]]={'$like':'%'+_0x20cdd5[_0x61c0('0x34')][_0x61c0('0x3f')]+'%'};return _0x41dbf1;}})});}_0x52f298=_['merge']({},_0x52f298,_0x20cdd5[_0x61c0('0x42')]);var _0x339341={'where':_0x52f298[_0x61c0('0x3c')]};return db['VoiceMusicOnHold']['count'](_0x339341)[_0x61c0('0x24')](function(_0xff050){_0x1f9da0[_0x61c0('0x1b')]=_0xff050;if(_0x20cdd5[_0x61c0('0x34')][_0x61c0('0x43')]){_0x52f298['include']=[{'all':!![]}];}return db[_0x61c0('0x2e')][_0x61c0('0x44')](_0x52f298);})[_0x61c0('0x24')](function(_0x4bcb9c){_0x1f9da0[_0x61c0('0x45')]=_0x4bcb9c;return _0x1f9da0;})[_0x61c0('0x24')](respondWithFilteredResult(_0x22c424,_0x52f298))[_0x61c0('0x46')](handleError(_0x22c424,null));};exports[_0x61c0('0x47')]=function(_0x515293,_0x1fe3f5){var _0x508ee0={'raw':![],'where':{'id':_0x515293['params']['id']}},_0x5bd1f3={};_0x5bd1f3[_0x61c0('0x32')]=_['keys'](db[_0x61c0('0x2e')][_0x61c0('0x2f')]);_0x5bd1f3[_0x61c0('0x34')]=_[_0x61c0('0x48')](_0x515293[_0x61c0('0x34')]);_0x5bd1f3['filters']=_[_0x61c0('0x35')](_0x5bd1f3['model'],_0x5bd1f3['query']);_0x508ee0[_0x61c0('0x36')]=_[_0x61c0('0x35')](_0x5bd1f3[_0x61c0('0x32')],qs[_0x61c0('0x37')](_0x515293[_0x61c0('0x34')][_0x61c0('0x37')]));_0x508ee0[_0x61c0('0x36')]=_0x508ee0[_0x61c0('0x36')]['length']?_0x508ee0[_0x61c0('0x36')]:_0x5bd1f3['model'];if(_0x515293['query'][_0x61c0('0x43')]){_0x508ee0[_0x61c0('0x49')]=[{'all':!![]}];}_0x508ee0=_[_0x61c0('0x40')]({},_0x508ee0,_0x515293[_0x61c0('0x42')]);return db[_0x61c0('0x2e')][_0x61c0('0x4a')](_0x508ee0)[_0x61c0('0x24')](handleEntityNotFound(_0x1fe3f5,null))[_0x61c0('0x24')](respondWithResult(_0x1fe3f5,null))['catch'](handleError(_0x1fe3f5,null));};exports['update']=function(_0x307365,_0x2b3d95){if(_0x307365['body']['id']){delete _0x307365[_0x61c0('0x4b')]['id'];}return db['VoiceMusicOnHold'][_0x61c0('0x4a')]({'where':{'id':_0x307365[_0x61c0('0x4c')]['id']}})[_0x61c0('0x24')](handleEntityNotFound(_0x2b3d95,null))[_0x61c0('0x24')](saveUpdates(_0x307365['body'],null))[_0x61c0('0x24')](respondWithResult(_0x2b3d95,null))['catch'](handleError(_0x2b3d95,null));};exports[_0x61c0('0x4d')]=function(_0x49ed0b,_0x1fd9a5,_0x131dd7){return db[_0x61c0('0x4e')][_0x61c0('0x4f')](function(_0x302f52){if(_0x49ed0b[_0x61c0('0x4b')][_0x61c0('0x50')]==='files'){_0x49ed0b[_0x61c0('0x4b')][_0x61c0('0x51')]=path[_0x61c0('0x52')](config[_0x61c0('0x53')],_0x61c0('0x54'),_0x49ed0b[_0x61c0('0x4b')][_0x61c0('0x33')]);}return db[_0x61c0('0x2e')]['create'](_0x49ed0b[_0x61c0('0x4b')],{'transaction':_0x302f52})[_0x61c0('0x24')](function(_0x1faf09){if(_0x49ed0b[_0x61c0('0x4b')][_0x61c0('0x50')]===_0x61c0('0x55')){fs[_0x61c0('0x56')](_0x1faf09[_0x61c0('0x51')],parseInt(_0x61c0('0x57'),0x8));}var _0x2e35c4=_0x49ed0b[_0x61c0('0x58')][_0x61c0('0x26')]({'plain':!![]});if(!_0x2e35c4)throw new Error(_0x61c0('0x59'));if(_0x2e35c4[_0x61c0('0x5a')]===_0x61c0('0x58')){var _0x6c79c2=_0x1faf09[_0x61c0('0x26')]({'plain':!![]});return db[_0x61c0('0x5b')][_0x61c0('0x4a')]({'where':{'name':_0x61c0('0x27'),'userProfileId':_0x2e35c4['userProfileId']},'raw':!![]})[_0x61c0('0x24')](function(_0x15d671){if(_0x15d671&&_0x15d671['autoAssociation']===0x0){return db[_0x61c0('0x5c')][_0x61c0('0x4d')]({'name':_0x6c79c2[_0x61c0('0x33')],'resourceId':_0x6c79c2['id'],'type':_0x15d671['name'],'sectionId':_0x15d671['id']},{})[_0x61c0('0x24')](function(){return _0x1faf09;});}else{return _0x1faf09;}})[_0x61c0('0x46')](function(_0x5ef7ba){logger['error'](_0x61c0('0x5d'),_0x5ef7ba);});}return _0x1faf09;});})[_0x61c0('0x24')](respondWithResult(_0x1fd9a5,0xc9))[_0x61c0('0x46')](handleError(_0x1fd9a5,null));};exports[_0x61c0('0x25')]=function(_0x47c59a,_0x24f921,_0x12ce55){var _0x54fcad;return db[_0x61c0('0x2e')][_0x61c0('0x4a')]({'where':{'id':_0x47c59a[_0x61c0('0x4c')]['id']}})[_0x61c0('0x24')](function(_0x39ce88){if(_0x39ce88){return db[_0x61c0('0x4e')]['transaction'](function(_0x1512b4){return _0x39ce88[_0x61c0('0x25')]({'transaction':_0x1512b4,'raw':!![]})['then'](function(_0x4b470c){if(_0x4b470c[_0x61c0('0x51')]){fs[_0x61c0('0x5e')](_0x4b470c[_0x61c0('0x51')])['forEach'](function(_0x2defc0){fs[_0x61c0('0x5f')](path[_0x61c0('0x52')](_0x4b470c[_0x61c0('0x51')],_0x2defc0));});fs[_0x61c0('0x60')](_0x4b470c[_0x61c0('0x51')]);}return _0x4b470c;});})[_0x61c0('0x46')](function(_0x2b1c2c){throw new db['Sequelize'][(_0x61c0('0x61'))](_0x2b1c2c[_0x61c0('0x62')]);});}})['then'](handleEntityNotFound(_0x24f921,null))[_0x61c0('0x24')](removeEntity(_0x24f921,null))[_0x61c0('0x46')](handleError(_0x24f921,null));};exports[_0x61c0('0x63')]=function(_0x3c52ba,_0x415572,_0x296e07){return db[_0x61c0('0x4e')][_0x61c0('0x4f')](function(_0x9198f9){var _0x379443;return db[_0x61c0('0x2e')][_0x61c0('0x4a')]({'where':{'id':_0x3c52ba[_0x61c0('0x4c')]['id']}})[_0x61c0('0x24')](function(_0x4d828b){if(_0x4d828b){_0x379443=_0x4d828b;return _0x4d828b['addSound'](_0x3c52ba['body']['id'],{'transaction':_0x9198f9});}})['then'](function(_0x3fbd2b){if(_0x3fbd2b){return db[_0x61c0('0x64')][_0x61c0('0x65')]({'where':{'id':_0x3c52ba[_0x61c0('0x4b')]['id']},'attributes':['id',_0x61c0('0x33'),_0x61c0('0x66'),_0x61c0('0x67'),'createdAt'],'raw':!![]});}})[_0x61c0('0x24')](function(_0x55bc53){if(_0x55bc53){var _0x15eae9=path[_0x61c0('0x52')](config[_0x61c0('0x53')],_0x61c0('0x68'),util['format'](_0x61c0('0x69'),path[_0x61c0('0x6a')](_0x55bc53[_0x61c0('0x66')],path[_0x61c0('0x6b')](_0x55bc53[_0x61c0('0x66')])),_0x55bc53[_0x61c0('0x67')]));var _0x398c55=path[_0x61c0('0x52')](config[_0x61c0('0x53')],'server/files/moh',_0x379443['name'],util[_0x61c0('0x6c')](_0x61c0('0x69'),_0x55bc53[_0x61c0('0x33')],_0x55bc53[_0x61c0('0x67')]));fs['symlinkSync'](_0x15eae9,_0x398c55);return _0x55bc53;}})['catch'](function(_0x1b2d57){throw new db[(_0x61c0('0x6d'))][(_0x61c0('0x61'))](_0x1b2d57[_0x61c0('0x62')]);});})['then'](handleEntityNotFound(_0x415572,null))[_0x61c0('0x24')](respondWithResult(_0x415572,0xc9))[_0x61c0('0x46')](handleError(_0x415572,null));};exports[_0x61c0('0x6e')]=function(_0x1e7945,_0x399103,_0x142de9){return db[_0x61c0('0x4e')][_0x61c0('0x4f')](function(_0x1771f2){var _0x41b943;return db[_0x61c0('0x2e')][_0x61c0('0x65')]({'where':{'id':_0x1e7945[_0x61c0('0x4c')]['id']}})[_0x61c0('0x24')](handleEntityNotFound(_0x399103,null))[_0x61c0('0x24')](function(_0x4324c7){if(_0x4324c7){_0x41b943=_0x4324c7;return _0x4324c7[_0x61c0('0x6e')](_0x1e7945[_0x61c0('0x4c')]['id2']);}})[_0x61c0('0x24')](function(_0x5e69a3){if(_0x5e69a3){return db['Sound'][_0x61c0('0x65')]({'where':{'id':_0x1e7945[_0x61c0('0x4c')][_0x61c0('0x6f')]},'attributes':['id','name',_0x61c0('0x66'),_0x61c0('0x67'),'createdAt'],'raw':!![]});}})[_0x61c0('0x24')](function(_0x56d55d){if(_0x56d55d){fs[_0x61c0('0x5f')](path[_0x61c0('0x52')](_0x41b943[_0x61c0('0x51')],util[_0x61c0('0x6c')](_0x61c0('0x69'),_0x56d55d[_0x61c0('0x33')],_0x56d55d[_0x61c0('0x67')])));return _0x56d55d;}})[_0x61c0('0x46')](function(_0x490ce8){throw new db['Sequelize'][(_0x61c0('0x61'))](_0x490ce8[_0x61c0('0x62')]);});})[_0x61c0('0x24')](handleEntityNotFound(_0x399103,null))[_0x61c0('0x24')](respondWithStatusCode(_0x399103,0xcc))[_0x61c0('0x46')](handleError(_0x399103,null));};exports['getSounds']=function(_0x1a1cab,_0x36ecfd,_0xfecc8c){var _0x17fde1={};var _0x3e134b={};var _0x54d336;var _0x185543;return db[_0x61c0('0x2e')][_0x61c0('0x65')]({'where':{'id':_0x1a1cab[_0x61c0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36ecfd,null))[_0x61c0('0x24')](function(_0x334402){if(_0x334402){_0x54d336=_0x334402;_0x3e134b[_0x61c0('0x32')]=_[_0x61c0('0x48')](db['Sound'][_0x61c0('0x2f')]);_0x3e134b['query']=_['keys'](_0x1a1cab[_0x61c0('0x34')]);_0x3e134b[_0x61c0('0x3d')]=_[_0x61c0('0x35')](_0x3e134b['model'],_0x3e134b[_0x61c0('0x34')]);_0x17fde1[_0x61c0('0x36')]=_['intersection'](_0x3e134b[_0x61c0('0x32')],qs[_0x61c0('0x37')](_0x1a1cab[_0x61c0('0x34')]['fields']));_0x17fde1[_0x61c0('0x36')]=_0x17fde1[_0x61c0('0x36')][_0x61c0('0x38')]?_0x17fde1[_0x61c0('0x36')]:_0x3e134b['model'];_0x17fde1[_0x61c0('0x70')]=qs[_0x61c0('0x3b')](_0x1a1cab[_0x61c0('0x34')][_0x61c0('0x3b')]);_0x17fde1['where']=qs[_0x61c0('0x3d')](_[_0x61c0('0x3e')](_0x1a1cab[_0x61c0('0x34')],_0x3e134b['filters']));if(_0x1a1cab[_0x61c0('0x34')][_0x61c0('0x3f')]){_0x17fde1[_0x61c0('0x3c')]=_[_0x61c0('0x40')](_0x17fde1['where'],{'$or':_['map'](_0x17fde1['attributes'],function(_0x1d5589){var _0x197322={};_0x197322[_0x1d5589]={'$like':'%'+_0x1a1cab[_0x61c0('0x34')][_0x61c0('0x3f')]+'%'};return _0x197322;})});}_0x17fde1=_[_0x61c0('0x40')]({},_0x17fde1,_0x1a1cab[_0x61c0('0x42')]);return _0x54d336[_0x61c0('0x71')](_0x17fde1);}})[_0x61c0('0x24')](function(_0xf37410){if(_0xf37410){_0x185543=_0xf37410[_0x61c0('0x38')];if(!_0x1a1cab['query'][_0x61c0('0x39')](_0x61c0('0x72'))){_0x17fde1[_0x61c0('0x3a')]=qs['limit'](_0x1a1cab[_0x61c0('0x34')][_0x61c0('0x3a')]);_0x17fde1['offset']=qs[_0x61c0('0x1c')](_0x1a1cab['query'][_0x61c0('0x1c')]);}return _0x54d336[_0x61c0('0x71')](_0x17fde1);}})['then'](function(_0x158a0f){if(_0x158a0f){return _0x158a0f?{'count':_0x185543,'rows':_0x158a0f}:null;}})[_0x61c0('0x24')](respondWithResult(_0x36ecfd,null))[_0x61c0('0x46')](handleError(_0x36ecfd,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 9b3abb4..b50e889 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 _0xf865=['api','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger'];(function(_0x55d06c,_0x4e1be){var _0x2e17bc=function(_0x97234d){while(--_0x97234d){_0x55d06c['push'](_0x55d06c['shift']());}};_0x2e17bc(++_0x4e1be);}(_0xf865,0x1ed));var _0x5f86=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf865[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x5f86('0x0'));var logger=require(_0x5f86('0x1'))(_0x5f86('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5f86('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f86('0x4'));var config=require(_0x5f86('0x5'));var attributes=require(_0x5f86('0x6'));module[_0x5f86('0x7')]=function(_0x378455,_0x4bf0c5){return _0x378455[_0x5f86('0x8')](_0x5f86('0x9'),attributes,{'tableName':_0x5f86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60ef=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','bluebird','request-promise','rimraf','./voiceMusicOnHold.attributes'];(function(_0x29cf87,_0x1fc11c){var _0x1585b1=function(_0x4ffb8f){while(--_0x4ffb8f){_0x29cf87['push'](_0x29cf87['shift']());}};_0x1585b1(++_0x1fc11c);}(_0x60ef,0x101));var _0xf60e=function(_0x466bfa,_0x25ea55){_0x466bfa=_0x466bfa-0x0;var _0x37e0b1=_0x60ef[_0x466bfa];return _0x37e0b1;};'use strict';var _=require(_0xf60e('0x0'));var util=require(_0xf60e('0x1'));var logger=require('../../config/logger')(_0xf60e('0x2'));var moment=require('moment');var BPromise=require(_0xf60e('0x3'));var rp=require(_0xf60e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf60e('0x5'));var config=require('../../config/environment');var attributes=require(_0xf60e('0x6'));module[_0xf60e('0x7')]=function(_0x25a8fa,_0x2c99c5){return _0x25a8fa[_0xf60e('0x8')](_0xf60e('0x9'),attributes,{'tableName':_0xf60e('0xa'),'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 3b7ba9b..a0e9ab5 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x482611,_0x33356d){var _0x4aeb3a=function(_0x44feae){while(--_0x44feae){_0x482611['push'](_0x482611['shift']());}};_0x4aeb3a(++_0x33356d);}(_0xedd9,0xfc));var _0x9edd=function(_0x13022e,_0x21b0ec){_0x13022e=_0x13022e-0x0;var _0x635ab0=_0xedd9[_0x13022e];return _0x635ab0;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +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(_0x9bd50,_0x4d66f5){var _0x4c8228=function(_0x4b59a3){while(--_0x4b59a3){_0x9bd50['push'](_0x9bd50['shift']());}};_0x4c8228(++_0x4d66f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 2f659c9..8c1a538 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 _0x2dab=['get','isAuthenticated','index','describe','/:id','show','/:id/users','/:id/teams','getTeams','create','post','addTeams','put','destroy','removeAgents','delete','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller'];(function(_0x5c872f,_0x4476f3){var _0x2f984d=function(_0x2ebd7a){while(--_0x2ebd7a){_0x5c872f['push'](_0x5c872f['shift']());}};_0x2f984d(++_0x4476f3);}(_0x2dab,0x120));var _0xb2da=function(_0xb67d44,_0x5cbeec){_0xb67d44=_0xb67d44-0x0;var _0x56c8f1=_0x2dab[_0xb67d44];return _0x56c8f1;};'use strict';var multer=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var path=require(_0xb2da('0x2'));var timeout=require(_0xb2da('0x3'));var express=require(_0xb2da('0x4'));var router=express['Router']();var fs_extra=require(_0xb2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2da('0x6'));var config=require(_0xb2da('0x7'));var controller=require(_0xb2da('0x8'));router[_0xb2da('0x9')]('/',auth[_0xb2da('0xa')](),controller[_0xb2da('0xb')]);router[_0xb2da('0x9')]('/describe',auth[_0xb2da('0xa')](),controller[_0xb2da('0xc')]);router[_0xb2da('0x9')](_0xb2da('0xd'),auth[_0xb2da('0xa')](),controller[_0xb2da('0xe')]);router[_0xb2da('0x9')](_0xb2da('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0xb2da('0x9')](_0xb2da('0x10'),auth[_0xb2da('0xa')](),controller[_0xb2da('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb2da('0x12')]);router[_0xb2da('0x13')](_0xb2da('0xf'),auth[_0xb2da('0xa')](),controller['addAgents']);router[_0xb2da('0x13')](_0xb2da('0x10'),auth[_0xb2da('0xa')](),controller[_0xb2da('0x14')]);router[_0xb2da('0x15')](_0xb2da('0xd'),auth[_0xb2da('0xa')](),controller['update']);router['delete'](_0xb2da('0xd'),auth['isAuthenticated'](),controller[_0xb2da('0x16')]);router['delete'](_0xb2da('0xf'),auth[_0xb2da('0xa')](),controller[_0xb2da('0x17')]);router[_0xb2da('0x18')](_0xb2da('0x10'),auth[_0xb2da('0xa')](),controller[_0xb2da('0x19')]);module[_0xb2da('0x1a')]=router; \ No newline at end of file +var _0x23fe=['/:id','isAuthenticated','/:id/users','getAgents','/:id/teams','create','post','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','describe'];(function(_0x456f08,_0x150572){var _0x4a10bc=function(_0x3e6b8a){while(--_0x3e6b8a){_0x456f08['push'](_0x456f08['shift']());}};_0x4a10bc(++_0x150572);}(_0x23fe,0x102));var _0xe23f=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x23fe[_0x42f009];return _0x22a1e0;};'use strict';var multer=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var path=require('path');var timeout=require(_0xe23f('0x2'));var express=require(_0xe23f('0x3'));var router=express[_0xe23f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe23f('0x5'));var interaction=require(_0xe23f('0x6'));var config=require(_0xe23f('0x7'));var controller=require(_0xe23f('0x8'));router[_0xe23f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0xb')]);router[_0xe23f('0x9')](_0xe23f('0xc'),auth[_0xe23f('0xd')](),controller['show']);router[_0xe23f('0x9')](_0xe23f('0xe'),auth[_0xe23f('0xd')](),controller[_0xe23f('0xf')]);router[_0xe23f('0x9')](_0xe23f('0x10'),auth[_0xe23f('0xd')](),controller['getTeams']);router['post']('/',auth[_0xe23f('0xd')](),controller[_0xe23f('0x11')]);router[_0xe23f('0x12')]('/:id/users',auth[_0xe23f('0xd')](),controller[_0xe23f('0x13')]);router[_0xe23f('0x12')](_0xe23f('0x10'),auth['isAuthenticated'](),controller[_0xe23f('0x14')]);router[_0xe23f('0x15')](_0xe23f('0xc'),auth['isAuthenticated'](),controller[_0xe23f('0x16')]);router['delete'](_0xe23f('0xc'),auth[_0xe23f('0xd')](),controller['destroy']);router[_0xe23f('0x17')](_0xe23f('0xe'),auth[_0xe23f('0xd')](),controller[_0xe23f('0x18')]);router[_0xe23f('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe23f('0x19')]);module[_0xe23f('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 423129a..e45f707 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 _0x4e9c=['exports','STRING','name','system-','getDataValue'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x4e9c,0x1ef));var _0xc4e9=function(_0x26c48c,_0x4fc8fd){_0x26c48c=_0x26c48c-0x0;var _0x4825a7=_0x4e9c[_0x26c48c];return _0x4825a7;};'use strict';var Sequelize=require('sequelize');module[_0xc4e9('0x0')]={'name':{'type':Sequelize[_0xc4e9('0x1')],'allowNull':![],'unique':_0xc4e9('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x236aab){return _0xc4e9('0x3')+this[_0xc4e9('0x4')](_0xc4e9('0x2'))+'-';}},'description':{'type':Sequelize[_0xc4e9('0x1')]},'callerIdAll':{'type':Sequelize[_0xc4e9('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf4e9=['exports','STRING','name','VIRTUAL','INTEGER','sequelize'];(function(_0x662180,_0xb5dff7){var _0x4a70a9=function(_0x19ead5){while(--_0x19ead5){_0x662180['push'](_0x662180['shift']());}};_0x4a70a9(++_0xb5dff7);}(_0xf4e9,0x11f));var _0x9f4e=function(_0x1c4cf8,_0x3f4de9){_0x1c4cf8=_0x1c4cf8-0x0;var _0x4d8891=_0xf4e9[_0x1c4cf8];return _0x4d8891;};'use strict';var Sequelize=require(_0x9f4e('0x0'));module[_0x9f4e('0x1')]={'name':{'type':Sequelize[_0x9f4e('0x2')],'allowNull':![],'unique':_0x9f4e('0x3')},'prefix':{'type':Sequelize[_0x9f4e('0x4')],'get':function(_0x40f77f){return'system-'+this['getDataValue'](_0x9f4e('0x3'))+'-';}},'description':{'type':Sequelize[_0x9f4e('0x2')]},'callerIdAll':{'type':Sequelize[_0x9f4e('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x9f4e('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d2b6be2..900dcb4 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 _0xfff0=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voicePrefix.socket','register','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','sendStatus','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','find','catch','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','removeTeams','isEmpty','rimraf','zip-dir','fast-json-patch'];(function(_0x308f79,_0x121c42){var _0x71490e=function(_0x311a5f){while(--_0x311a5f){_0x308f79['push'](_0x308f79['shift']());}};_0x71490e(++_0x121c42);}(_0xfff0,0x139));var _0x0fff=function(_0x3a5602,_0x1af0bb){_0x3a5602=_0x3a5602-0x0;var _0x2a1173=_0xfff0[_0x3a5602];return _0x2a1173;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];config[_0x0fff('0x19')]=_['defaults'](config[_0x0fff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0x1a'))(new Redis(config[_0x0fff('0x19')]));require(_0x0fff('0x1b'))[_0x0fff('0x1c')](socket);function respondWithStatusCode(_0x55e5fa,_0x53bde9){_0x53bde9=_0x53bde9||0xcc;return function(_0x1daf30){if(_0x1daf30){return _0x55e5fa['sendStatus'](_0x53bde9);}return _0x55e5fa['status'](_0x53bde9)['end']();};}function respondWithResult(_0x1fb430,_0x41e2e7){_0x41e2e7=_0x41e2e7||0xc8;return function(_0x5eab2e){if(_0x5eab2e){return _0x1fb430[_0x0fff('0x1d')](_0x41e2e7)[_0x0fff('0x1e')](_0x5eab2e);}};}function respondWithFilteredResult(_0x540a67,_0x528071){return function(_0x48f36d){if(_0x48f36d){var _0x2337f=typeof _0x528071[_0x0fff('0x1f')]===_0x0fff('0x20')&&typeof _0x528071[_0x0fff('0x21')]===_0x0fff('0x20');var _0xe89b4a=_0x48f36d['count'];var _0x44a54a=_0x2337f?0x0:_0x528071[_0x0fff('0x1f')];var _0x48e6f9=_0x2337f?_0x48f36d['count']:_0x528071['offset']+_0x528071[_0x0fff('0x21')];var _0x330e29;if(_0x48e6f9>=_0xe89b4a){_0x48e6f9=_0xe89b4a;_0x330e29=0xc8;}else{_0x330e29=0xce;}_0x540a67[_0x0fff('0x1d')](_0x330e29);return _0x540a67[_0x0fff('0x22')]('Content-Range',_0x44a54a+'-'+_0x48e6f9+'/'+_0xe89b4a)[_0x0fff('0x1e')](_0x48f36d);}return null;};}function patchUpdates(_0x2f8665){return function(_0x29d703){try{jsonpatch[_0x0fff('0x23')](_0x29d703,_0x2f8665,!![]);}catch(_0x16e7f4){return BPromise[_0x0fff('0x24')](_0x16e7f4);}return _0x29d703['save']();};}function saveUpdates(_0x6a116c,_0x29f702){return function(_0x37e090){if(_0x37e090){return _0x37e090[_0x0fff('0x25')](_0x6a116c)[_0x0fff('0x26')](function(_0x23d9f8){return _0x23d9f8;});}return null;};}function removeEntity(_0x482e1e,_0x2c9725){return function(_0x87b3a6){if(_0x87b3a6){return _0x87b3a6[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){var _0x36d268=_0x87b3a6[_0x0fff('0x28')]({'plain':!![]});var _0x27bd76=_0x0fff('0x29');return db[_0x0fff('0x2a')][_0x0fff('0x27')]({'where':{'type':_0x27bd76,'resourceId':_0x36d268['id']}})[_0x0fff('0x26')](function(){return _0x87b3a6;});})[_0x0fff('0x26')](function(){_0x482e1e['status'](0xcc)[_0x0fff('0x2b')]();});}};}function handleEntityNotFound(_0x2d1800,_0x17ab6f){return function(_0x42441e){if(!_0x42441e){_0x2d1800[_0x0fff('0x2c')](0x194);}return _0x42441e;};}function handleError(_0x125844,_0x47dde0){_0x47dde0=_0x47dde0||0x1f4;return function(_0x31f9a4){logger[_0x0fff('0x2d')](_0x31f9a4[_0x0fff('0x2e')]);if(_0x31f9a4['name']){delete _0x31f9a4[_0x0fff('0x2f')];}_0x125844[_0x0fff('0x1d')](_0x47dde0)['send'](_0x31f9a4);};}exports[_0x0fff('0x30')]=function(_0x433de6,_0x15bb46){var _0x15ae24={},_0x25ab2a={},_0x263e9e={'count':0x0,'rows':[]};var _0x1da352=_[_0x0fff('0x31')](db[_0x0fff('0x32')][_0x0fff('0x33')],function(_0x58469b){return{'name':_0x58469b[_0x0fff('0x34')],'type':_0x58469b[_0x0fff('0x35')][_0x0fff('0x36')]};});_0x25ab2a[_0x0fff('0x37')]=_[_0x0fff('0x31')](_0x1da352,'name');_0x25ab2a['query']=_[_0x0fff('0x38')](_0x433de6[_0x0fff('0x39')]);_0x25ab2a[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x25ab2a['model'],_0x25ab2a[_0x0fff('0x39')]);_0x15ae24[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x25ab2a[_0x0fff('0x37')],qs['fields'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x15ae24[_0x0fff('0x3c')]=_0x15ae24[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x15ae24[_0x0fff('0x3c')]:_0x25ab2a[_0x0fff('0x37')];if(!_0x433de6[_0x0fff('0x39')][_0x0fff('0x3f')](_0x0fff('0x40'))){_0x15ae24[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x433de6['query'][_0x0fff('0x21')]);_0x15ae24[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x433de6[_0x0fff('0x39')][_0x0fff('0x1f')]);}_0x15ae24[_0x0fff('0x41')]=qs['sort'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x42')]);_0x15ae24[_0x0fff('0x43')]=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x433de6[_0x0fff('0x39')],_0x25ab2a[_0x0fff('0x3a')]),_0x1da352);if(_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]){_0x15ae24['where']=_[_0x0fff('0x46')](_0x15ae24['where'],{'$or':_[_0x0fff('0x31')](_0x1da352,function(_0x30f329){if(_0x30f329[_0x0fff('0x35')]!=='VIRTUAL'){var _0x5d4c24={};_0x5d4c24[_0x30f329[_0x0fff('0x2f')]]={'$like':'%'+_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]+'%'};return _0x5d4c24;}})});}_0x15ae24=_['merge']({},_0x15ae24,_0x433de6['options']);var _0x4668b3={'where':_0x15ae24['where']};return db[_0x0fff('0x32')][_0x0fff('0x47')](_0x4668b3)[_0x0fff('0x26')](function(_0x309d75){_0x263e9e[_0x0fff('0x47')]=_0x309d75;if(_0x433de6[_0x0fff('0x39')]['includeAll']){_0x15ae24[_0x0fff('0x48')]=[{'all':!![]}];}return db[_0x0fff('0x32')][_0x0fff('0x49')](_0x15ae24);})[_0x0fff('0x26')](function(_0x7157e5){_0x263e9e[_0x0fff('0x4a')]=_0x7157e5;return _0x263e9e;})[_0x0fff('0x26')](respondWithFilteredResult(_0x15bb46,_0x15ae24))['catch'](handleError(_0x15bb46,null));};exports[_0x0fff('0x4b')]=function(_0x244a27,_0x101b3a){var _0x56a121={'raw':![],'where':{'id':_0x244a27[_0x0fff('0x4c')]['id']}},_0x2de540={};_0x2de540[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x32')][_0x0fff('0x33')]);_0x2de540[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x244a27[_0x0fff('0x39')]);_0x2de540[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x2de540['model'],_0x2de540[_0x0fff('0x39')]);_0x56a121[_0x0fff('0x3c')]=_['intersection'](_0x2de540[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x244a27[_0x0fff('0x39')]['fields']));_0x56a121['attributes']=_0x56a121[_0x0fff('0x3c')]['length']?_0x56a121['attributes']:_0x2de540[_0x0fff('0x37')];if(_0x244a27[_0x0fff('0x39')][_0x0fff('0x4d')]){_0x56a121[_0x0fff('0x48')]=[{'all':!![]}];}_0x56a121=_[_0x0fff('0x46')]({},_0x56a121,_0x244a27[_0x0fff('0x4e')]);return db['VoicePrefix'][_0x0fff('0x4f')](_0x56a121)[_0x0fff('0x26')](handleEntityNotFound(_0x101b3a,null))[_0x0fff('0x26')](respondWithResult(_0x101b3a,null))[_0x0fff('0x50')](handleError(_0x101b3a,null));};exports[_0x0fff('0x27')]=function(_0x2c725c,_0x5d1739){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x2c725c['params']['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5d1739,null))['then'](removeEntity(_0x5d1739,null))['catch'](handleError(_0x5d1739,null));};exports['describe']=function(_0x218e1c,_0x30967c){return db[_0x0fff('0x32')][_0x0fff('0x51')]()[_0x0fff('0x26')](respondWithResult(_0x30967c,null))['catch'](handleError(_0x30967c,null));};exports[_0x0fff('0x52')]=function(_0x2c765f,_0x2cbe43){var _0x3b6c98;return db[_0x0fff('0x53')]['transaction'](function(_0x3b401c){return db[_0x0fff('0x32')][_0x0fff('0x52')](_0x2c765f[_0x0fff('0x54')],{'transaction':_0x3b401c})[_0x0fff('0x26')](function(_0x2e8242){_0x3b6c98=_0x2e8242[_0x0fff('0x28')]({'plain':!![]});return db[_0x0fff('0x55')][_0x0fff('0x4f')]({'where':{'id':_0x3b6c98[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x38168e){return createVoicePrefixExtensions(_0x3b6c98,_0x38168e,_0x3b401c);});});})[_0x0fff('0x26')](function(){var _0x2608be=_0x2c765f[_0x0fff('0x57')][_0x0fff('0x28')]({'plain':!![]});if(!_0x2608be)throw new Error(_0x0fff('0x58'));if(_0x2608be[_0x0fff('0x59')]===_0x0fff('0x57')){var _0x398513=_0x3b6c98;return db[_0x0fff('0x5a')]['find']({'where':{'name':_0x0fff('0x29'),'userProfileId':_0x2608be[_0x0fff('0x5b')]},'raw':!![]})[_0x0fff('0x26')](function(_0x2744b4){if(_0x2744b4&&_0x2744b4['autoAssociation']===0x0){return db[_0x0fff('0x2a')]['create']({'name':_0x398513[_0x0fff('0x2f')],'resourceId':_0x398513['id'],'type':_0x2744b4[_0x0fff('0x2f')],'sectionId':_0x2744b4['id']},{})[_0x0fff('0x26')](function(){return _0x3b6c98;});}else{return _0x3b6c98;}})[_0x0fff('0x50')](function(_0x4bf865){logger[_0x0fff('0x2d')](_0x0fff('0x5c'),_0x4bf865);throw _0x4bf865;});}return _0x3b6c98;})[_0x0fff('0x26')](respondWithResult(_0x2cbe43,null))[_0x0fff('0x50')](handleError(_0x2cbe43,null));};function Extension(_0x4cf619,_0x5ba7e7,_0x449da4,_0x40b8f0){this[_0x0fff('0x5d')]=_0x0fff('0x5e');this[_0x0fff('0x5f')]=_0x4cf619;this[_0x0fff('0x60')]=_0x449da4;this['type']='system';this[_0x0fff('0x61')]=_0x0fff('0x62');this[_0x0fff('0x63')]=_0x5ba7e7;this[_0x0fff('0x64')]=_0x40b8f0;}function createVoicePrefixExtensions(_0x28403f,_0x6a37c9,_0x33eb07){return new BPromise(function(_0x40e5ec,_0x5f2fcc){var _0x12fe95=new Extension(formatPrefixName(_0x28403f['prefix']),0x1,_0x0fff('0x65'),_0x0fff('0x66'));_0x12fe95[_0x0fff('0x67')]=_0x28403f['id'];return db['VoiceExtension']['create'](_0x12fe95,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x504212){var _0x140a35=_0x504212[_0x0fff('0x28')]({'plain':!![]});var _0x452160=_[_0x0fff('0x31')](addVoicePrefixExtensions(_0x28403f,_0x6a37c9),function(_0x4e3a31){_0x4e3a31[_0x0fff('0x56')]=_0x140a35['id'];_0x4e3a31[_0x0fff('0x67')]=_0x28403f['id'];return _0x4e3a31;});return db['VoiceExtension'][_0x0fff('0x68')](_0x452160,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x1111c8){if(!_0x1111c8){return _0x5f2fcc('Extensions\x20creation\x20failed');}else{return _0x40e5ec(_0x1111c8);}})[_0x0fff('0x50')](function(_0x1dc3d6){return _0x5f2fcc(_0x1dc3d6);});});;});};function addVoicePrefixExtensions(_0x1414af,_0x383d78){var _0x3bb183=[];var _0xf4fb1e=formatPrefixName(_0x1414af[_0x0fff('0x69')]);_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x2,_0x0fff('0x6b'),_0x0fff('0x6c')+_0x1414af[_0x0fff('0x2f')]));if(_0x1414af[_0x0fff('0x6d')]){_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,'Set',_0x0fff('0x6e')+_0x1414af['callerIdAll']));}else{_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,_0x0fff('0x65'),_0x0fff('0x6f')));}_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x4,'goto',_0x383d78['context']+','+_0x0fff('0x70')+(0x8+_0x1414af[_0x0fff('0x2f')][_0x0fff('0x3e')])+'}'+','+0x1));return _0x3bb183;}function formatPrefixName(_0x2586c6){var _0x5af278='_';for(var _0x2f865a=0x0;_0x2f865a<_0x2586c6[_0x0fff('0x3e')];_0x2f865a++){if(_0x2586c6[_0x0fff('0x71')](_0x2f865a)=='-'){_0x5af278+=_0x2586c6[_0x0fff('0x71')](_0x2f865a);}else{_0x5af278+='['+_0x2586c6['charAt'](_0x2f865a)+']';}}_0x5af278+='.';return _0x5af278;}exports[_0x0fff('0x25')]=function(_0x1858fb,_0x4c08c3,_0x51fbf5){var _0x33ed23=_0x1858fb[_0x0fff('0x54')];_0x33ed23[_0x0fff('0x69')]=_0x0fff('0x72')+_0x33ed23[_0x0fff('0x2f')]+'-';return db['sequelize'][_0x0fff('0x73')](function(_0x7b040){return db[_0x0fff('0x32')][_0x0fff('0x25')](_0x33ed23,{'where':{'id':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension'][_0x0fff('0x4f')]({'where':{'id':_0x33ed23[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x712db4){return createVoicePrefixExtensions(_0x33ed23,_0x712db4,_0x7b040);});});});})[_0x0fff('0x26')](function(){return db['VoicePrefix'][_0x0fff('0x74')](_0x33ed23['id']);})[_0x0fff('0x26')](respondWithResult(_0x4c08c3,null))[_0x0fff('0x50')](handleError(_0x4c08c3,null));};exports[_0x0fff('0x75')]=function(_0x31ff4e,_0x15ab8e,_0x38e2e9){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x31ff4e[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x15ab8e,null))['then'](function(_0x134012){if(_0x134012){return _0x134012[_0x0fff('0x75')](_0x31ff4e['body'][_0x0fff('0x76')],_['omit'](_0x31ff4e[_0x0fff('0x54')],[_0x0fff('0x76'),'id'])||{})[_0x0fff('0x77')](function(_0x8799c2){for(var _0x13d90e=0x0;_0x13d90e<_0x31ff4e['body'][_0x0fff('0x76')][_0x0fff('0x3e')];_0x13d90e+=0x1){socket['emit'](_0x0fff('0x78'),{'UserId':Number(_0x31ff4e[_0x0fff('0x54')][_0x0fff('0x76')][_0x13d90e]),'VoicePrefixId':Number(_0x31ff4e['params']['id'])});}return _0x8799c2;});}})[_0x0fff('0x26')](respondWithResult(_0x15ab8e,null))[_0x0fff('0x50')](handleError(_0x15ab8e,null));};exports['removeAgents']=function(_0x567544,_0x404b97,_0x49711a){return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x567544[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x404b97,null))['then'](function(_0x4f7282){if(_0x4f7282){return _0x4f7282[_0x0fff('0x79')](_0x567544['query'][_0x0fff('0x76')])[_0x0fff('0x26')](function(){if(_[_0x0fff('0x7a')](_0x567544[_0x0fff('0x39')][_0x0fff('0x76')])){for(var _0x1e940c=0x0;_0x1e940c<_0x567544[_0x0fff('0x39')]['ids'][_0x0fff('0x3e')];_0x1e940c+=0x1){socket[_0x0fff('0x7b')](_0x0fff('0x7c'),{'UserId':Number(_0x567544[_0x0fff('0x39')][_0x0fff('0x76')][_0x1e940c]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}}else{socket['emit'](_0x0fff('0x7c'),{'UserId':Number(_0x567544['query'][_0x0fff('0x76')]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}});}})[_0x0fff('0x26')](respondWithStatusCode(_0x404b97,null))[_0x0fff('0x50')](handleError(_0x404b97,null));};exports['getAgents']=function(_0x4fc7c7,_0x34dd99,_0x5baf7f){var _0x3d820e={};var _0x125b12={};var _0x5093fc;var _0x5b04f2;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x4fc7c7[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x34dd99,null))['then'](function(_0x407f0a){if(_0x407f0a){_0x5093fc=_0x407f0a;_0x125b12['model']=_[_0x0fff('0x38')](db[_0x0fff('0x7e')][_0x0fff('0x33')]);_0x125b12['query']=_['keys'](_0x4fc7c7['query']);_0x125b12[_0x0fff('0x3a')]=_['intersection'](_0x125b12[_0x0fff('0x37')],_0x125b12[_0x0fff('0x39')]);_0x3d820e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x125b12[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x3d820e[_0x0fff('0x3c')]=_0x3d820e[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x3d820e['attributes']:_0x125b12[_0x0fff('0x37')];_0x3d820e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x42')]);_0x3d820e['where']=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x4fc7c7['query'],_0x125b12[_0x0fff('0x3a')]));if(_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x45')]){_0x3d820e[_0x0fff('0x43')]=_[_0x0fff('0x46')](_0x3d820e[_0x0fff('0x43')],{'$or':_[_0x0fff('0x31')](_0x3d820e[_0x0fff('0x3c')],function(_0x40c4f3){var _0x1c059b={};_0x1c059b[_0x40c4f3]={'$like':'%'+_0x4fc7c7['query'][_0x0fff('0x45')]+'%'};return _0x1c059b;})});}_0x3d820e=_[_0x0fff('0x46')]({},_0x3d820e,_0x4fc7c7[_0x0fff('0x4e')]);return _0x5093fc[_0x0fff('0x7f')](_0x3d820e);}})[_0x0fff('0x26')](function(_0x2fdf96){if(_0x2fdf96){_0x5b04f2=_0x2fdf96[_0x0fff('0x3e')];if(!_0x4fc7c7['query'][_0x0fff('0x3f')]('nolimit')){_0x3d820e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x21')]);_0x3d820e[_0x0fff('0x1f')]=qs['offset'](_0x4fc7c7[_0x0fff('0x39')]['offset']);}return _0x5093fc['getAgents'](_0x3d820e);}})[_0x0fff('0x26')](function(_0x173b44){if(_0x173b44){return _0x173b44?{'count':_0x5b04f2,'rows':_0x173b44}:null;}})[_0x0fff('0x26')](respondWithResult(_0x34dd99,null))[_0x0fff('0x50')](handleError(_0x34dd99,null));};exports[_0x0fff('0x80')]=function(_0x3995b9,_0x5bc4e1,_0x50f95c){var _0x5b637e={};var _0x1bd02a={};var _0x41b755;var _0x4012aa;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x3995b9[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5bc4e1,null))[_0x0fff('0x26')](function(_0xed7e93){if(_0xed7e93){_0x41b755=_0xed7e93;_0x1bd02a[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x81')][_0x0fff('0x33')]);_0x1bd02a[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x3995b9[_0x0fff('0x39')]);_0x1bd02a[_0x0fff('0x3a')]=_['intersection'](_0x1bd02a[_0x0fff('0x37')],_0x1bd02a[_0x0fff('0x39')]);_0x5b637e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x1bd02a[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x3995b9[_0x0fff('0x39')]['fields']));_0x5b637e[_0x0fff('0x3c')]=_0x5b637e[_0x0fff('0x3c')]['length']?_0x5b637e[_0x0fff('0x3c')]:_0x1bd02a['model'];_0x5b637e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x3995b9['query']['sort']);_0x5b637e['where']=qs[_0x0fff('0x3a')](_['pick'](_0x3995b9['query'],_0x1bd02a['filters']));if(_0x3995b9['query'][_0x0fff('0x45')]){_0x5b637e['where']=_[_0x0fff('0x46')](_0x5b637e['where'],{'$or':_[_0x0fff('0x31')](_0x5b637e['attributes'],function(_0x465dde){var _0x9ca531={};_0x9ca531[_0x465dde]={'$like':'%'+_0x3995b9['query']['filter']+'%'};return _0x9ca531;})});}_0x5b637e=_[_0x0fff('0x46')]({},_0x5b637e,_0x3995b9[_0x0fff('0x4e')]);return _0x41b755[_0x0fff('0x80')](_0x5b637e);}})[_0x0fff('0x26')](function(_0x675250){if(_0x675250){_0x4012aa=_0x675250[_0x0fff('0x3e')];if(!_0x3995b9[_0x0fff('0x39')]['hasOwnProperty'](_0x0fff('0x40'))){_0x5b637e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x3995b9[_0x0fff('0x39')]['limit']);_0x5b637e[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x3995b9[_0x0fff('0x39')]['offset']);}return _0x41b755['getTeams'](_0x5b637e);}})[_0x0fff('0x26')](function(_0x37b5b4){if(_0x37b5b4){return _0x37b5b4?{'count':_0x4012aa,'rows':_0x37b5b4}:null;}})['then'](respondWithResult(_0x5bc4e1,null))[_0x0fff('0x50')](handleError(_0x5bc4e1,null));};exports[_0x0fff('0x82')]=function(_0x4ab665,_0x2ab827,_0x2a2af9){var _0x2ca40b=_0x4ab665['body']['ids'];var _0x2eeee9;return db[_0x0fff('0x81')]['findAll']({'where':{'id':_0x2ca40b},'attributes':['id'],'include':[{'model':db[_0x0fff('0x7e')],'as':_0x0fff('0x83'),'attributes':['id',_0x0fff('0x2f'),_0x0fff('0x84'),_0x0fff('0x85'),_0x0fff('0x86')],'raw':!![]}]})[_0x0fff('0x26')](function(_0x1b500a){if(_0x1b500a){_0x2eeee9=_0x1b500a;var _0x327b5=_[_0x0fff('0x87')](_0x1b500a,function(_0x10aa61){var _0xc99224=_0x10aa61['get']({'plain':!![]});return _0xc99224[_0x0fff('0x83')];});return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x4ab665['params']['id']}})[_0x0fff('0x26')](function(_0x5336){return db[_0x0fff('0x53')][_0x0fff('0x73')](function(_0x42fbff){return _0x5336[_0x0fff('0x82')](_0x2ca40b,{'transaction':_0x42fbff})['then'](function(){return BPromise[_0x0fff('0x88')](_0x2eeee9,function(_0x39565f){return db['TeamVoicePrefix'][_0x0fff('0x89')]({'TeamId':_0x39565f['id'],'VoicePrefixId':_0x4ab665['params']['id']},{'transaction':_0x42fbff});});})['then'](function(){return BPromise[_0x0fff('0x88')](_0x327b5,function(_0x2e38c3){return db[_0x0fff('0x8a')][_0x0fff('0x8b')]({'where':{'UserId':_0x2e38c3['id'],'VoicePrefixId':_0x4ab665[_0x0fff('0x4c')]['id']},'transaction':_0x42fbff});});})[_0x0fff('0x26')](function(){_0x327b5['forEach'](function(_0xe02ca6){socket[_0x0fff('0x7b')](_0x0fff('0x78'),{'UserId':_0xe02ca6['id'],'VoicePrefixId':_0x5336['id']});});});});});}})[_0x0fff('0x26')](respondWithStatusCode(_0x2ab827,null))[_0x0fff('0x50')](handleError(_0x2ab827,null));};exports['removeTeams']=function(_0x25e9f2,_0xf73eb6,_0x87df03){return db[_0x0fff('0x81')][_0x0fff('0x49')]({'where':{'id':_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fff('0x26')](handleEntityNotFound(_0xf73eb6,null))['then'](function(_0x2d206c){var _0x5ed120=_['map'](_0x2d206c,'id');var _0x592341=[];var _0x2e1625=[];var _0x128fe1=squel[_0x0fff('0x8c')]();_0x128fe1[_0x0fff('0x8d')](_0x0fff('0x8e'))['from'](_0x0fff('0x8f'),'tq')[_0x0fff('0x90')](_0x0fff('0x91'),'ut',_0x0fff('0x92'))[_0x0fff('0x43')](_0x0fff('0x93'),_0x25e9f2[_0x0fff('0x4c')]['id']);for(var _0x115445=0x0;_0x115445<_0x2d206c['length'];_0x115445+=0x1){let _0x596074=_0x2d206c[_0x115445];for(var _0x1f1946=0x0;_0x1f1946<_0x596074[_0x0fff('0x83')][_0x0fff('0x3e')];_0x1f1946+=0x1){let _0x47ff09=_0x596074[_0x0fff('0x83')][_0x1f1946];var _0x2ae986=_0x128fe1[_0x0fff('0x94')]();_0x2ae986['where'](_0x0fff('0x95'),_0x47ff09['id']);_0x2e1625[_0x0fff('0x6a')](db[_0x0fff('0x53')][_0x0fff('0x39')](_0x2ae986[_0x0fff('0x96')](),{'type':db[_0x0fff('0x53')][_0x0fff('0x97')]['SELECT']})['then'](function(_0x4a70ee){if(_0x4a70ee[_0x0fff('0x3e')]===0x1){return _0x47ff09['id'];}else{var _0x425412=_[_0x0fff('0x98')](_[_0x0fff('0x31')](_0x4a70ee,_0x0fff('0x99')),function(_0x41afce){return _['includes'](_0x5ed120,_0x41afce);});if(_0x425412){return _0x47ff09['id'];}}}));}}return BPromise[_0x0fff('0x9a')](_0x2e1625)[_0x0fff('0x26')](function(_0x7928f7){_0x592341=_(_0x592341)['union'](_0x7928f7)['compact']()[_0x0fff('0x9b')]();return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x25e9f2[_0x0fff('0x4c')]['id']}})['then'](function(_0x1bf39f){return db[_0x0fff('0x53')]['transaction'](function(_0xb6faf){return _0x1bf39f[_0x0fff('0x9c')](_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')],{'transaction':_0xb6faf})[_0x0fff('0x26')](function(){if(!_[_0x0fff('0x9d')](_0x592341)){return _0x1bf39f['removeAgents'](_0x592341,{'transaction':_0xb6faf});}})[_0x0fff('0x26')](function(){_0x592341['forEach'](function(_0xf72b2b){socket['emit'](_0x0fff('0x7c'),{'UserId':_0xf72b2b,'VoicePrefixId':_0x1bf39f['id']});});});});});});})['then'](respondWithStatusCode(_0xf73eb6,null))[_0x0fff('0x50')](handleError(_0xf73eb6,null));}; \ No newline at end of file +var _0x958a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','index','map','VoicePrefix','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','rawAttributes','include','find','describe','sequelize','transaction','create','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','priority','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','getAgents','getTeams','addTeams','Team','User','online','voicePause','flatMap','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','isEmpty','forEach','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x958a,0x128));var _0xa958=function(_0x3cc7bc,_0x5699d6){_0x3cc7bc=_0x3cc7bc-0x0;var _0x478341=_0x958a[_0x3cc7bc];return _0x478341;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa958('0x1c'),'port':0x18eb});var socket=require(_0xa958('0x1d'))(new Redis(config[_0xa958('0x1e')]));require('./voicePrefix.socket')[_0xa958('0x1f')](socket);function respondWithStatusCode(_0x54c439,_0x5194b4){_0x5194b4=_0x5194b4||0xcc;return function(_0x53d5c7){if(_0x53d5c7){return _0x54c439[_0xa958('0x20')](_0x5194b4);}return _0x54c439[_0xa958('0x21')](_0x5194b4)[_0xa958('0x22')]();};}function respondWithResult(_0x6a81c7,_0x2c270c){_0x2c270c=_0x2c270c||0xc8;return function(_0x398931){if(_0x398931){return _0x6a81c7[_0xa958('0x21')](_0x2c270c)[_0xa958('0x23')](_0x398931);}};}function respondWithFilteredResult(_0x4d836f,_0x39af49){return function(_0x4eadc9){if(_0x4eadc9){var _0x3a053f=typeof _0x39af49[_0xa958('0x24')]==='undefined'&&typeof _0x39af49[_0xa958('0x25')]===_0xa958('0x26');var _0x47636f=_0x4eadc9[_0xa958('0x27')];var _0x2759ad=_0x3a053f?0x0:_0x39af49[_0xa958('0x24')];var _0x56314b=_0x3a053f?_0x4eadc9['count']:_0x39af49[_0xa958('0x24')]+_0x39af49[_0xa958('0x25')];var _0x16c0be;if(_0x56314b>=_0x47636f){_0x56314b=_0x47636f;_0x16c0be=0xc8;}else{_0x16c0be=0xce;}_0x4d836f['status'](_0x16c0be);return _0x4d836f[_0xa958('0x28')](_0xa958('0x29'),_0x2759ad+'-'+_0x56314b+'/'+_0x47636f)['json'](_0x4eadc9);}return null;};}function patchUpdates(_0x28cf12){return function(_0x401175){try{jsonpatch['apply'](_0x401175,_0x28cf12,!![]);}catch(_0x5c5a2b){return BPromise[_0xa958('0x2a')](_0x5c5a2b);}return _0x401175[_0xa958('0x2b')]();};}function saveUpdates(_0x50b3c3,_0x25f461){return function(_0x27097a){if(_0x27097a){return _0x27097a[_0xa958('0x2c')](_0x50b3c3)[_0xa958('0x2d')](function(_0x16b04a){return _0x16b04a;});}return null;};}function removeEntity(_0xf1436e,_0x50fdb1){return function(_0x3e3d77){if(_0x3e3d77){return _0x3e3d77['destroy']()[_0xa958('0x2d')](function(){var _0x3c2ea3=_0x3e3d77[_0xa958('0x2e')]({'plain':!![]});var _0x18f600=_0xa958('0x2f');return db[_0xa958('0x30')][_0xa958('0x31')]({'where':{'type':_0x18f600,'resourceId':_0x3c2ea3['id']}})[_0xa958('0x2d')](function(){return _0x3e3d77;});})[_0xa958('0x2d')](function(){_0xf1436e[_0xa958('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47895c,_0xd2fcc9){return function(_0x4ef4f6){if(!_0x4ef4f6){_0x47895c[_0xa958('0x20')](0x194);}return _0x4ef4f6;};}function handleError(_0x1b76de,_0x4b3089){_0x4b3089=_0x4b3089||0x1f4;return function(_0x23bdbf){logger[_0xa958('0x32')](_0x23bdbf[_0xa958('0x33')]);if(_0x23bdbf[_0xa958('0x34')]){delete _0x23bdbf[_0xa958('0x34')];}_0x1b76de['status'](_0x4b3089)['send'](_0x23bdbf);};}exports[_0xa958('0x35')]=function(_0x5d9a3d,_0x51e50b){var _0x30d51f={},_0x3f6de3={},_0x135322={'count':0x0,'rows':[]};var _0x43b912=_[_0xa958('0x36')](db[_0xa958('0x37')]['rawAttributes'],function(_0x32c4e3){return{'name':_0x32c4e3['fieldName'],'type':_0x32c4e3['type'][_0xa958('0x38')]};});_0x3f6de3[_0xa958('0x39')]=_[_0xa958('0x36')](_0x43b912,_0xa958('0x34'));_0x3f6de3[_0xa958('0x3a')]=_[_0xa958('0x3b')](_0x5d9a3d[_0xa958('0x3a')]);_0x3f6de3[_0xa958('0x3c')]=_['intersection'](_0x3f6de3['model'],_0x3f6de3[_0xa958('0x3a')]);_0x30d51f[_0xa958('0x3d')]=_[_0xa958('0x3e')](_0x3f6de3[_0xa958('0x39')],qs[_0xa958('0x3f')](_0x5d9a3d['query'][_0xa958('0x3f')]));_0x30d51f[_0xa958('0x3d')]=_0x30d51f[_0xa958('0x3d')][_0xa958('0x40')]?_0x30d51f['attributes']:_0x3f6de3[_0xa958('0x39')];if(!_0x5d9a3d[_0xa958('0x3a')][_0xa958('0x41')](_0xa958('0x42'))){_0x30d51f[_0xa958('0x25')]=qs['limit'](_0x5d9a3d[_0xa958('0x3a')][_0xa958('0x25')]);_0x30d51f[_0xa958('0x24')]=qs[_0xa958('0x24')](_0x5d9a3d[_0xa958('0x3a')][_0xa958('0x24')]);}_0x30d51f[_0xa958('0x43')]=qs[_0xa958('0x44')](_0x5d9a3d[_0xa958('0x3a')][_0xa958('0x44')]);_0x30d51f['where']=qs[_0xa958('0x3c')](_[_0xa958('0x45')](_0x5d9a3d[_0xa958('0x3a')],_0x3f6de3['filters']),_0x43b912);if(_0x5d9a3d[_0xa958('0x3a')][_0xa958('0x46')]){_0x30d51f['where']=_['merge'](_0x30d51f[_0xa958('0x47')],{'$or':_['map'](_0x43b912,function(_0x3b5e74){if(_0x3b5e74['type']!==_0xa958('0x48')){var _0x59d562={};_0x59d562[_0x3b5e74[_0xa958('0x34')]]={'$like':'%'+_0x5d9a3d[_0xa958('0x3a')][_0xa958('0x46')]+'%'};return _0x59d562;}})});}_0x30d51f=_[_0xa958('0x49')]({},_0x30d51f,_0x5d9a3d[_0xa958('0x4a')]);var _0x45b383={'where':_0x30d51f[_0xa958('0x47')]};return db[_0xa958('0x37')]['count'](_0x45b383)[_0xa958('0x2d')](function(_0x38dfb4){_0x135322[_0xa958('0x27')]=_0x38dfb4;if(_0x5d9a3d['query']['includeAll']){_0x30d51f['include']=[{'all':!![]}];}return db[_0xa958('0x37')][_0xa958('0x4b')](_0x30d51f);})[_0xa958('0x2d')](function(_0x155901){_0x135322[_0xa958('0x4c')]=_0x155901;return _0x135322;})['then'](respondWithFilteredResult(_0x51e50b,_0x30d51f))[_0xa958('0x4d')](handleError(_0x51e50b,null));};exports[_0xa958('0x4e')]=function(_0x2fdf2b,_0x2bfdee){var _0x303331={'raw':![],'where':{'id':_0x2fdf2b[_0xa958('0x4f')]['id']}},_0x1118bb={};_0x1118bb[_0xa958('0x39')]=_[_0xa958('0x3b')](db[_0xa958('0x37')][_0xa958('0x50')]);_0x1118bb[_0xa958('0x3a')]=_[_0xa958('0x3b')](_0x2fdf2b[_0xa958('0x3a')]);_0x1118bb[_0xa958('0x3c')]=_[_0xa958('0x3e')](_0x1118bb[_0xa958('0x39')],_0x1118bb['query']);_0x303331['attributes']=_['intersection'](_0x1118bb[_0xa958('0x39')],qs[_0xa958('0x3f')](_0x2fdf2b[_0xa958('0x3a')][_0xa958('0x3f')]));_0x303331['attributes']=_0x303331[_0xa958('0x3d')][_0xa958('0x40')]?_0x303331[_0xa958('0x3d')]:_0x1118bb[_0xa958('0x39')];if(_0x2fdf2b[_0xa958('0x3a')]['includeAll']){_0x303331[_0xa958('0x51')]=[{'all':!![]}];}_0x303331=_[_0xa958('0x49')]({},_0x303331,_0x2fdf2b[_0xa958('0x4a')]);return db['VoicePrefix'][_0xa958('0x52')](_0x303331)['then'](handleEntityNotFound(_0x2bfdee,null))[_0xa958('0x2d')](respondWithResult(_0x2bfdee,null))[_0xa958('0x4d')](handleError(_0x2bfdee,null));};exports[_0xa958('0x31')]=function(_0x4e0740,_0x35f6bf){return db['VoicePrefix'][_0xa958('0x52')]({'where':{'id':_0x4e0740[_0xa958('0x4f')]['id']}})[_0xa958('0x2d')](handleEntityNotFound(_0x35f6bf,null))[_0xa958('0x2d')](removeEntity(_0x35f6bf,null))[_0xa958('0x4d')](handleError(_0x35f6bf,null));};exports['describe']=function(_0x1e9c64,_0x49f9da){return db[_0xa958('0x37')][_0xa958('0x53')]()['then'](respondWithResult(_0x49f9da,null))[_0xa958('0x4d')](handleError(_0x49f9da,null));};exports['create']=function(_0x317059,_0x39619f){var _0x15c0fe;return db[_0xa958('0x54')][_0xa958('0x55')](function(_0x65f37f){return db[_0xa958('0x37')][_0xa958('0x56')](_0x317059[_0xa958('0x57')],{'transaction':_0x65f37f})['then'](function(_0x37d54f){_0x15c0fe=_0x37d54f['get']({'plain':!![]});return db[_0xa958('0x58')][_0xa958('0x52')]({'where':{'id':_0x15c0fe[_0xa958('0x59')]},'raw':!![]})['then'](function(_0x4f0440){return createVoicePrefixExtensions(_0x15c0fe,_0x4f0440,_0x65f37f);});});})[_0xa958('0x2d')](function(){var _0xab6085=_0x317059[_0xa958('0x5a')][_0xa958('0x2e')]({'plain':!![]});if(!_0xab6085)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xab6085[_0xa958('0x5b')]===_0xa958('0x5a')){var _0x4cf7af=_0x15c0fe;return db[_0xa958('0x5c')][_0xa958('0x52')]({'where':{'name':'VoicePrefixes','userProfileId':_0xab6085[_0xa958('0x5d')]},'raw':!![]})['then'](function(_0x5629c4){if(_0x5629c4&&_0x5629c4['autoAssociation']===0x0){return db[_0xa958('0x30')][_0xa958('0x56')]({'name':_0x4cf7af[_0xa958('0x34')],'resourceId':_0x4cf7af['id'],'type':_0x5629c4[_0xa958('0x34')],'sectionId':_0x5629c4['id']},{})['then'](function(){return _0x15c0fe;});}else{return _0x15c0fe;}})[_0xa958('0x4d')](function(_0x4aaf1a){logger[_0xa958('0x32')](_0xa958('0x5e'),_0x4aaf1a);throw _0x4aaf1a;});}return _0x15c0fe;})[_0xa958('0x2d')](respondWithResult(_0x39619f,null))[_0xa958('0x4d')](handleError(_0x39619f,null));};function Extension(_0x25865d,_0x11cc0b,_0x485e67,_0x4937a5){this[_0xa958('0x5f')]=_0xa958('0x60');this[_0xa958('0x61')]=_0x25865d;this[_0xa958('0x62')]=_0x485e67;this[_0xa958('0x63')]='system';this[_0xa958('0x64')]=_0xa958('0x65');this[_0xa958('0x66')]=_0x11cc0b;this['appdata']=_0x4937a5;}function createVoicePrefixExtensions(_0xf7e817,_0x2496f8,_0x364725){return new BPromise(function(_0x14cbb6,_0x35177a){var _0x2d40b1=new Extension(formatPrefixName(_0xf7e817[_0xa958('0x67')]),0x1,'NoOp','Voice\x20Prefix');_0x2d40b1[_0xa958('0x68')]=_0xf7e817['id'];return db['VoiceExtension'][_0xa958('0x56')](_0x2d40b1,{'transaction':_0x364725})[_0xa958('0x2d')](function(_0x1ea51b){var _0x3f0396=_0x1ea51b[_0xa958('0x2e')]({'plain':!![]});var _0x3859e2=_[_0xa958('0x36')](addVoicePrefixExtensions(_0xf7e817,_0x2496f8),function(_0x358c8b){_0x358c8b[_0xa958('0x59')]=_0x3f0396['id'];_0x358c8b['VoicePrefixId']=_0xf7e817['id'];return _0x358c8b;});return db[_0xa958('0x58')][_0xa958('0x69')](_0x3859e2,{'transaction':_0x364725})['then'](function(_0x53a26d){if(!_0x53a26d){return _0x35177a(_0xa958('0x6a'));}else{return _0x14cbb6(_0x53a26d);}})[_0xa958('0x4d')](function(_0xa769e0){return _0x35177a(_0xa769e0);});});;});};function addVoicePrefixExtensions(_0x36d3cd,_0x3736df){var _0x5625e7=[];var _0x25ca0b=formatPrefixName(_0x36d3cd['prefix']);_0x5625e7[_0xa958('0x6b')](new Extension(_0x25ca0b,0x2,'Set',_0xa958('0x6c')+_0x36d3cd[_0xa958('0x34')]));if(_0x36d3cd['callerIdAll']){_0x5625e7[_0xa958('0x6b')](new Extension(_0x25ca0b,0x3,_0xa958('0x6d'),_0xa958('0x6e')+_0x36d3cd[_0xa958('0x6f')]));}else{_0x5625e7[_0xa958('0x6b')](new Extension(_0x25ca0b,0x3,_0xa958('0x70'),_0xa958('0x71')));}_0x5625e7[_0xa958('0x6b')](new Extension(_0x25ca0b,0x4,'goto',_0x3736df['context']+','+'${EXTEN:'+(0x8+_0x36d3cd[_0xa958('0x34')]['length'])+'}'+','+0x1));return _0x5625e7;}function formatPrefixName(_0x21d139){var _0x739fa1='_';for(var _0x52484f=0x0;_0x52484f<_0x21d139['length'];_0x52484f++){if(_0x21d139[_0xa958('0x72')](_0x52484f)=='-'){_0x739fa1+=_0x21d139[_0xa958('0x72')](_0x52484f);}else{_0x739fa1+='['+_0x21d139[_0xa958('0x72')](_0x52484f)+']';}}_0x739fa1+='.';return _0x739fa1;}exports[_0xa958('0x2c')]=function(_0x2c2e81,_0x58083e,_0x32f9dc){var _0x5379f1=_0x2c2e81[_0xa958('0x57')];_0x5379f1[_0xa958('0x67')]=_0xa958('0x73')+_0x5379f1['name']+'-';return db[_0xa958('0x54')][_0xa958('0x55')](function(_0x4df64f){return db[_0xa958('0x37')][_0xa958('0x2c')](_0x5379f1,{'where':{'id':_0x5379f1['id']},'transaction':_0x4df64f})[_0xa958('0x2d')](function(){return db[_0xa958('0x58')][_0xa958('0x31')]({'where':{'VoicePrefixId':_0x5379f1['id']},'transaction':_0x4df64f})['then'](function(){return db[_0xa958('0x58')]['find']({'where':{'id':_0x5379f1[_0xa958('0x59')]},'raw':!![]})['then'](function(_0x1b2d7e){return createVoicePrefixExtensions(_0x5379f1,_0x1b2d7e,_0x4df64f);});});});})[_0xa958('0x2d')](function(){return db[_0xa958('0x37')][_0xa958('0x74')](_0x5379f1['id']);})[_0xa958('0x2d')](respondWithResult(_0x58083e,null))[_0xa958('0x4d')](handleError(_0x58083e,null));};exports[_0xa958('0x75')]=function(_0x5de628,_0x4a41a8,_0x349bf9){return db['VoicePrefix'][_0xa958('0x52')]({'where':{'id':_0x5de628[_0xa958('0x4f')]['id']}})[_0xa958('0x2d')](handleEntityNotFound(_0x4a41a8,null))[_0xa958('0x2d')](function(_0x3b8dbf){if(_0x3b8dbf){return _0x3b8dbf[_0xa958('0x75')](_0x5de628[_0xa958('0x57')][_0xa958('0x76')],_['omit'](_0x5de628[_0xa958('0x57')],[_0xa958('0x76'),'id'])||{})[_0xa958('0x77')](function(_0x443e97){for(var _0x4eb829=0x0;_0x4eb829<_0x5de628[_0xa958('0x57')][_0xa958('0x76')][_0xa958('0x40')];_0x4eb829+=0x1){socket[_0xa958('0x78')](_0xa958('0x79'),{'UserId':Number(_0x5de628[_0xa958('0x57')]['ids'][_0x4eb829]),'VoicePrefixId':Number(_0x5de628[_0xa958('0x4f')]['id'])});}return _0x443e97;});}})[_0xa958('0x2d')](respondWithResult(_0x4a41a8,null))[_0xa958('0x4d')](handleError(_0x4a41a8,null));};exports[_0xa958('0x7a')]=function(_0x2d54ba,_0x3c87c6,_0x501462){return db['VoicePrefix']['find']({'where':{'id':_0x2d54ba[_0xa958('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3c87c6,null))['then'](function(_0x1c05fa){if(_0x1c05fa){return _0x1c05fa[_0xa958('0x7a')](_0x2d54ba[_0xa958('0x3a')][_0xa958('0x76')])[_0xa958('0x2d')](function(){if(_['isArray'](_0x2d54ba['query'][_0xa958('0x76')])){for(var _0x477402=0x0;_0x477402<_0x2d54ba[_0xa958('0x3a')][_0xa958('0x76')]['length'];_0x477402+=0x1){socket[_0xa958('0x78')](_0xa958('0x7b'),{'UserId':Number(_0x2d54ba[_0xa958('0x3a')][_0xa958('0x76')][_0x477402]),'VoicePrefixId':Number(_0x2d54ba[_0xa958('0x4f')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2d54ba[_0xa958('0x3a')]['ids']),'VoicePrefixId':Number(_0x2d54ba[_0xa958('0x4f')]['id'])});}});}})[_0xa958('0x2d')](respondWithStatusCode(_0x3c87c6,null))[_0xa958('0x4d')](handleError(_0x3c87c6,null));};exports['getAgents']=function(_0x15544d,_0x4e4a98,_0x20a536){var _0xba7442={};var _0x5b32bf={};var _0x484790;var _0x5f2995;return db['VoicePrefix'][_0xa958('0x7c')]({'where':{'id':_0x15544d[_0xa958('0x4f')]['id']}})[_0xa958('0x2d')](handleEntityNotFound(_0x4e4a98,null))[_0xa958('0x2d')](function(_0x2aec5f){if(_0x2aec5f){_0x484790=_0x2aec5f;_0x5b32bf['model']=_[_0xa958('0x3b')](db['User']['rawAttributes']);_0x5b32bf[_0xa958('0x3a')]=_[_0xa958('0x3b')](_0x15544d[_0xa958('0x3a')]);_0x5b32bf['filters']=_[_0xa958('0x3e')](_0x5b32bf['model'],_0x5b32bf[_0xa958('0x3a')]);_0xba7442[_0xa958('0x3d')]=_['intersection'](_0x5b32bf['model'],qs[_0xa958('0x3f')](_0x15544d[_0xa958('0x3a')][_0xa958('0x3f')]));_0xba7442[_0xa958('0x3d')]=_0xba7442['attributes'][_0xa958('0x40')]?_0xba7442[_0xa958('0x3d')]:_0x5b32bf['model'];_0xba7442[_0xa958('0x43')]=qs['sort'](_0x15544d[_0xa958('0x3a')][_0xa958('0x44')]);_0xba7442[_0xa958('0x47')]=qs['filters'](_[_0xa958('0x45')](_0x15544d[_0xa958('0x3a')],_0x5b32bf['filters']));if(_0x15544d[_0xa958('0x3a')][_0xa958('0x46')]){_0xba7442[_0xa958('0x47')]=_[_0xa958('0x49')](_0xba7442[_0xa958('0x47')],{'$or':_[_0xa958('0x36')](_0xba7442[_0xa958('0x3d')],function(_0x1b5d8c){var _0x252300={};_0x252300[_0x1b5d8c]={'$like':'%'+_0x15544d['query'][_0xa958('0x46')]+'%'};return _0x252300;})});}_0xba7442=_[_0xa958('0x49')]({},_0xba7442,_0x15544d['options']);return _0x484790[_0xa958('0x7d')](_0xba7442);}})[_0xa958('0x2d')](function(_0x4fbefb){if(_0x4fbefb){_0x5f2995=_0x4fbefb['length'];if(!_0x15544d[_0xa958('0x3a')]['hasOwnProperty']('nolimit')){_0xba7442[_0xa958('0x25')]=qs[_0xa958('0x25')](_0x15544d['query']['limit']);_0xba7442[_0xa958('0x24')]=qs[_0xa958('0x24')](_0x15544d[_0xa958('0x3a')]['offset']);}return _0x484790[_0xa958('0x7d')](_0xba7442);}})['then'](function(_0x4d6455){if(_0x4d6455){return _0x4d6455?{'count':_0x5f2995,'rows':_0x4d6455}:null;}})[_0xa958('0x2d')](respondWithResult(_0x4e4a98,null))[_0xa958('0x4d')](handleError(_0x4e4a98,null));};exports[_0xa958('0x7e')]=function(_0x58feea,_0x278505,_0x36d9d4){var _0x213ee2={};var _0x4fffd9={};var _0x2b4e65;var _0x9207c3;return db[_0xa958('0x37')][_0xa958('0x7c')]({'where':{'id':_0x58feea['params']['id']}})[_0xa958('0x2d')](handleEntityNotFound(_0x278505,null))[_0xa958('0x2d')](function(_0x71d394){if(_0x71d394){_0x2b4e65=_0x71d394;_0x4fffd9[_0xa958('0x39')]=_['keys'](db['Team']['rawAttributes']);_0x4fffd9['query']=_[_0xa958('0x3b')](_0x58feea[_0xa958('0x3a')]);_0x4fffd9['filters']=_['intersection'](_0x4fffd9[_0xa958('0x39')],_0x4fffd9[_0xa958('0x3a')]);_0x213ee2[_0xa958('0x3d')]=_['intersection'](_0x4fffd9[_0xa958('0x39')],qs[_0xa958('0x3f')](_0x58feea['query'][_0xa958('0x3f')]));_0x213ee2[_0xa958('0x3d')]=_0x213ee2[_0xa958('0x3d')][_0xa958('0x40')]?_0x213ee2[_0xa958('0x3d')]:_0x4fffd9[_0xa958('0x39')];_0x213ee2[_0xa958('0x43')]=qs[_0xa958('0x44')](_0x58feea[_0xa958('0x3a')][_0xa958('0x44')]);_0x213ee2[_0xa958('0x47')]=qs[_0xa958('0x3c')](_['pick'](_0x58feea['query'],_0x4fffd9[_0xa958('0x3c')]));if(_0x58feea[_0xa958('0x3a')][_0xa958('0x46')]){_0x213ee2[_0xa958('0x47')]=_[_0xa958('0x49')](_0x213ee2[_0xa958('0x47')],{'$or':_[_0xa958('0x36')](_0x213ee2['attributes'],function(_0x7a2730){var _0x46ad43={};_0x46ad43[_0x7a2730]={'$like':'%'+_0x58feea['query'][_0xa958('0x46')]+'%'};return _0x46ad43;})});}_0x213ee2=_[_0xa958('0x49')]({},_0x213ee2,_0x58feea['options']);return _0x2b4e65[_0xa958('0x7e')](_0x213ee2);}})['then'](function(_0x57e780){if(_0x57e780){_0x9207c3=_0x57e780[_0xa958('0x40')];if(!_0x58feea[_0xa958('0x3a')][_0xa958('0x41')]('nolimit')){_0x213ee2['limit']=qs[_0xa958('0x25')](_0x58feea['query']['limit']);_0x213ee2[_0xa958('0x24')]=qs['offset'](_0x58feea[_0xa958('0x3a')][_0xa958('0x24')]);}return _0x2b4e65[_0xa958('0x7e')](_0x213ee2);}})[_0xa958('0x2d')](function(_0x3f58a2){if(_0x3f58a2){return _0x3f58a2?{'count':_0x9207c3,'rows':_0x3f58a2}:null;}})[_0xa958('0x2d')](respondWithResult(_0x278505,null))[_0xa958('0x4d')](handleError(_0x278505,null));};exports[_0xa958('0x7f')]=function(_0x22ba2f,_0x429870,_0x4d82b5){var _0x7f6ca5=_0x22ba2f['body'][_0xa958('0x76')];var _0x23823d;return db[_0xa958('0x80')]['findAll']({'where':{'id':_0x7f6ca5},'attributes':['id'],'include':[{'model':db[_0xa958('0x81')],'as':'Agents','attributes':['id','name',_0xa958('0x82'),_0xa958('0x83'),'interface'],'raw':!![]}]})[_0xa958('0x2d')](function(_0x4d907b){if(_0x4d907b){_0x23823d=_0x4d907b;var _0x310918=_[_0xa958('0x84')](_0x4d907b,function(_0x4fe178){var _0x57a1d9=_0x4fe178[_0xa958('0x2e')]({'plain':!![]});return _0x57a1d9[_0xa958('0x85')];});return db[_0xa958('0x37')][_0xa958('0x52')]({'where':{'id':_0x22ba2f[_0xa958('0x4f')]['id']}})[_0xa958('0x2d')](function(_0x162760){return db[_0xa958('0x54')]['transaction'](function(_0x1bdced){return _0x162760[_0xa958('0x7f')](_0x7f6ca5,{'transaction':_0x1bdced})['then'](function(){return BPromise[_0xa958('0x86')](_0x23823d,function(_0x167bb6){return db[_0xa958('0x87')][_0xa958('0x88')]({'TeamId':_0x167bb6['id'],'VoicePrefixId':_0x22ba2f[_0xa958('0x4f')]['id']},{'transaction':_0x1bdced});});})['then'](function(){return BPromise[_0xa958('0x86')](_0x310918,function(_0x2f8f94){return db[_0xa958('0x89')][_0xa958('0x8a')]({'where':{'UserId':_0x2f8f94['id'],'VoicePrefixId':_0x22ba2f[_0xa958('0x4f')]['id']},'transaction':_0x1bdced});});})[_0xa958('0x2d')](function(){_0x310918['forEach'](function(_0x46561b){socket[_0xa958('0x78')]('userVoicePrefix:save',{'UserId':_0x46561b['id'],'VoicePrefixId':_0x162760['id']});});});});});}})['then'](respondWithStatusCode(_0x429870,null))['catch'](handleError(_0x429870,null));};exports[_0xa958('0x8b')]=function(_0x5e31b4,_0x4edc45,_0x22890c){return db[_0xa958('0x80')][_0xa958('0x4b')]({'where':{'id':_0x5e31b4[_0xa958('0x3a')][_0xa958('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa958('0x2d')](handleEntityNotFound(_0x4edc45,null))[_0xa958('0x2d')](function(_0x42e2b4){var _0x24d6a4=_[_0xa958('0x36')](_0x42e2b4,'id');var _0x19a1da=[];var _0x2a29ad=[];var _0x4ecadc=squel['select']();_0x4ecadc[_0xa958('0x8c')](_0xa958('0x8d'))[_0xa958('0x8e')](_0xa958('0x8f'),'tq')[_0xa958('0x90')](_0xa958('0x91'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa958('0x47')](_0xa958('0x92'),_0x5e31b4[_0xa958('0x4f')]['id']);for(var _0x57f1eb=0x0;_0x57f1eb<_0x42e2b4[_0xa958('0x40')];_0x57f1eb+=0x1){let _0x3062c5=_0x42e2b4[_0x57f1eb];for(var _0x3cc980=0x0;_0x3cc980<_0x3062c5[_0xa958('0x85')][_0xa958('0x40')];_0x3cc980+=0x1){let _0x166267=_0x3062c5['Agents'][_0x3cc980];var _0x30133f=_0x4ecadc[_0xa958('0x93')]();_0x30133f['where'](_0xa958('0x94'),_0x166267['id']);_0x2a29ad[_0xa958('0x6b')](db[_0xa958('0x54')][_0xa958('0x3a')](_0x30133f[_0xa958('0x95')](),{'type':db[_0xa958('0x54')][_0xa958('0x96')][_0xa958('0x97')]})[_0xa958('0x2d')](function(_0x4f54a1){if(_0x4f54a1['length']===0x1){return _0x166267['id'];}else{var _0x563f9=_['every'](_[_0xa958('0x36')](_0x4f54a1,_0xa958('0x98')),function(_0x495b6d){return _[_0xa958('0x99')](_0x24d6a4,_0x495b6d);});if(_0x563f9){return _0x166267['id'];}}}));}}return BPromise[_0xa958('0x9a')](_0x2a29ad)[_0xa958('0x2d')](function(_0x48e953){_0x19a1da=_(_0x19a1da)['union'](_0x48e953)[_0xa958('0x9b')]()[_0xa958('0x9c')]();return db[_0xa958('0x37')][_0xa958('0x52')]({'where':{'id':_0x5e31b4[_0xa958('0x4f')]['id']}})['then'](function(_0x5548d1){return db[_0xa958('0x54')][_0xa958('0x55')](function(_0x4a4253){return _0x5548d1[_0xa958('0x8b')](_0x5e31b4['query']['ids'],{'transaction':_0x4a4253})[_0xa958('0x2d')](function(){if(!_[_0xa958('0x9d')](_0x19a1da)){return _0x5548d1[_0xa958('0x7a')](_0x19a1da,{'transaction':_0x4a4253});}})[_0xa958('0x2d')](function(){_0x19a1da[_0xa958('0x9e')](function(_0x5c0653){socket[_0xa958('0x78')]('userVoicePrefix:remove',{'UserId':_0x5c0653,'VoicePrefixId':_0x5548d1['id']});});});});});});})[_0xa958('0x2d')](respondWithStatusCode(_0x4edc45,null))[_0xa958('0x4d')](handleError(_0x4edc45,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5579aba..7740574 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 _0x7959=['emit','hasOwnProperty','hook','exports','events','VoicePrefix','save','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7959,0x174));var _0x9795=function(_0x596966,_0x16731b){_0x596966=_0x596966-0x0;var _0x484ee2=_0x7959[_0x596966];return _0x484ee2;};'use strict';var EventEmitter=require(_0x9795('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x9795('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9795('0x2'),'afterUpdate':'update','afterDestroy':_0x9795('0x3')};function emitEvent(_0x546a34){return function(_0x489269,_0x34f77d,_0x40f8be){VoicePrefixEvents[_0x9795('0x4')](_0x546a34+':'+_0x489269['id'],_0x489269);VoicePrefixEvents[_0x9795('0x4')](_0x546a34,_0x489269);_0x40f8be(null);};}for(var e in events){if(events[_0x9795('0x5')](e)){var event=events[e];VoicePrefix[_0x9795('0x6')](e,emitEvent(event));}}module[_0x9795('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xe60f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x50d788,_0x3d4d71){var _0x242b34=function(_0x45ccda){while(--_0x45ccda){_0x50d788['push'](_0x50d788['shift']());}};_0x242b34(++_0x3d4d71);}(_0xe60f,0x1e8));var _0xfe60=function(_0x46dff2,_0x525d63){_0x46dff2=_0x46dff2-0x0;var _0xa65628=_0xe60f[_0x46dff2];return _0xa65628;};'use strict';var EventEmitter=require(_0xfe60('0x0'));var VoicePrefix=require(_0xfe60('0x1'))['db'][_0xfe60('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfe60('0x3')](0x0);var events={'afterCreate':_0xfe60('0x4'),'afterUpdate':_0xfe60('0x5'),'afterDestroy':_0xfe60('0x6')};function emitEvent(_0x4efce7){return function(_0x2eacbe,_0x34acb3,_0x4d464f){VoicePrefixEvents['emit'](_0x4efce7+':'+_0x2eacbe['id'],_0x2eacbe);VoicePrefixEvents[_0xfe60('0x7')](_0x4efce7,_0x2eacbe);_0x4d464f(null);};}for(var e in events){if(events[_0xfe60('0x8')](e)){var event=events[e];VoicePrefix[_0xfe60('0x9')](e,emitEvent(event));}}module[_0xfe60('0xa')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 3495eab..b2cc2fb 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 _0xc182=['VoicePrefix','voice_prefixes','lodash','util','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc182,0x1d8));var _0x2c18=function(_0x572256,_0x15dd87){_0x572256=_0x572256-0x0;var _0x1808a0=_0xc182[_0x572256];return _0x1808a0;};'use strict';var _=require(_0x2c18('0x0'));var util=require(_0x2c18('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2c18('0x2'));var BPromise=require(_0x2c18('0x3'));var rp=require(_0x2c18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c18('0x5'));var config=require('../../config/environment');var attributes=require(_0x2c18('0x6'));module[_0x2c18('0x7')]=function(_0x311056,_0x312808){return _0x311056['define'](_0x2c18('0x8'),attributes,{'tableName':_0x2c18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21a7=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes'];(function(_0x14647d,_0x20a244){var _0x3a0cae=function(_0x6f6909){while(--_0x6f6909){_0x14647d['push'](_0x14647d['shift']());}};_0x3a0cae(++_0x20a244);}(_0x21a7,0x18c));var _0x721a=function(_0x289689,_0x19a641){_0x289689=_0x289689-0x0;var _0x4f5e29=_0x21a7[_0x289689];return _0x4f5e29;};'use strict';var _=require('lodash');var util=require(_0x721a('0x0'));var logger=require(_0x721a('0x1'))(_0x721a('0x2'));var moment=require('moment');var BPromise=require(_0x721a('0x3'));var rp=require(_0x721a('0x4'));var fs=require('fs');var path=require(_0x721a('0x5'));var rimraf=require(_0x721a('0x6'));var config=require('../../config/environment');var attributes=require(_0x721a('0x7'));module['exports']=function(_0x248c9c,_0x7275d0){return _0x248c9c[_0x721a('0x8')](_0x721a('0x9'),attributes,{'tableName':_0x721a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 85e4ad7..eb7d0e8 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 _0x06ae=['VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','request','then','info','VoicePrefix,\x20%s,\x20%s','debug'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xe06a('0x0'));var moment=require(_0xe06a('0x1'));var BPromise=require(_0xe06a('0x2'));var rs=require(_0xe06a('0x3'));var fs=require('fs');var Redis=require(_0xe06a('0x4'));var db=require(_0xe06a('0x5'))['db'];var utils=require(_0xe06a('0x6'));var logger=require(_0xe06a('0x7'))(_0xe06a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe06a('0x9')]({'port':0x232a});config[_0xe06a('0xa')]=_[_0xe06a('0xb')](config[_0xe06a('0xa')],{'host':_0xe06a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe06a('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x1a9f4e,_0x4eedc5,_0x2212e2){return new BPromise(function(_0x48e52a,_0x521741){return client[_0xe06a('0xd')](_0x1a9f4e,_0x2212e2)[_0xe06a('0xe')](function(_0x574fd0){logger[_0xe06a('0xf')](_0xe06a('0x10'),_0x4eedc5,'request\x20sent');logger[_0xe06a('0x11')](_0xe06a('0x12'),_0x4eedc5,_0xe06a('0x13'),JSON['stringify'](_0x574fd0));if(_0x574fd0[_0xe06a('0x14')]){if(_0x574fd0[_0xe06a('0x14')][_0xe06a('0x15')]===0x1f4){logger[_0xe06a('0x14')](_0xe06a('0x10'),_0x4eedc5,_0x574fd0['error'][_0xe06a('0x16')]);return _0x521741(_0x574fd0[_0xe06a('0x14')][_0xe06a('0x16')]);}logger[_0xe06a('0x14')](_0xe06a('0x10'),_0x4eedc5,_0x574fd0[_0xe06a('0x14')]['message']);return _0x48e52a(_0x574fd0[_0xe06a('0x14')]['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x4eedc5,_0xe06a('0x13'));_0x48e52a(_0x574fd0[_0xe06a('0x17')][_0xe06a('0x16')]);}})['catch'](function(_0x614743){logger[_0xe06a('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x4eedc5,_0x614743);_0x521741(_0x614743);});});} \ No newline at end of file +var _0xba0d=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x4e3e75,_0x409bc0){var _0x5e66c6=function(_0x544777){while(--_0x544777){_0x4e3e75['push'](_0x4e3e75['shift']());}};_0x5e66c6(++_0x409bc0);}(_0xba0d,0x8e));var _0xdba0=function(_0x3be1e6,_0x1953f5){_0x3be1e6=_0x3be1e6-0x0;var _0x5c0be1=_0xba0d[_0x3be1e6];return _0x5c0be1;};'use strict';var _=require(_0xdba0('0x0'));var util=require('util');var moment=require(_0xdba0('0x1'));var BPromise=require(_0xdba0('0x2'));var rs=require(_0xdba0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdba0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdba0('0x5'))(_0xdba0('0x6'));var config=require(_0xdba0('0x7'));var jayson=require(_0xdba0('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xdba0('0x9')]=_[_0xdba0('0xa')](config[_0xdba0('0x9')],{'host':_0xdba0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdba0('0x9')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x21cb20,_0x4d01a9,_0x268cc3){return new BPromise(function(_0x56d368,_0x1b4dec){return client[_0xdba0('0xc')](_0x21cb20,_0x268cc3)[_0xdba0('0xd')](function(_0x193cd6){logger[_0xdba0('0xe')](_0xdba0('0xf'),_0x4d01a9,_0xdba0('0x10'));logger[_0xdba0('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4d01a9,'request\x20sent',JSON[_0xdba0('0x12')](_0x193cd6));if(_0x193cd6[_0xdba0('0x13')]){if(_0x193cd6[_0xdba0('0x13')][_0xdba0('0x14')]===0x1f4){logger[_0xdba0('0x13')](_0xdba0('0xf'),_0x4d01a9,_0x193cd6[_0xdba0('0x13')]['message']);return _0x1b4dec(_0x193cd6[_0xdba0('0x13')][_0xdba0('0x15')]);}logger[_0xdba0('0x13')](_0xdba0('0xf'),_0x4d01a9,_0x193cd6[_0xdba0('0x13')][_0xdba0('0x15')]);return _0x56d368(_0x193cd6[_0xdba0('0x13')][_0xdba0('0x15')]);}else{logger[_0xdba0('0xe')](_0xdba0('0xf'),_0x4d01a9,'request\x20sent');_0x56d368(_0x193cd6[_0xdba0('0x16')]['message']);}})[_0xdba0('0x17')](function(_0x2915e6){logger[_0xdba0('0x13')](_0xdba0('0xf'),_0x4d01a9,_0x2915e6);_0x1b4dec(_0x2915e6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index eb477c1..ee43e9d 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 _0x684c=['register','length','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var VoicePrefixEvents=require(_0xc684('0x0'));var events=[_0xc684('0x1'),'remove',_0xc684('0x2')];function createListener(_0x10c3ca,_0x313548){return function(_0x1a0d37){_0x313548[_0xc684('0x3')](_0x10c3ca,_0x1a0d37);};}function removeListener(_0x4a3536,_0x3519e8){return function(){VoicePrefixEvents[_0xc684('0x4')](_0x4a3536,_0x3519e8);};}exports[_0xc684('0x5')]=function(_0x4487f6){for(var _0x46cb0e=0x0,_0x57a63c=events[_0xc684('0x6')];_0x46cb0e<_0x57a63c;_0x46cb0e++){var _0x1a96ea=events[_0x46cb0e];var _0x146733=createListener(_0xc684('0x7')+_0x1a96ea,_0x4487f6);VoicePrefixEvents['on'](_0x1a96ea,_0x146733);}}; \ No newline at end of file +var _0xc560=['./voicePrefix.events','remove','emit','removeListener','length'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc560,0x82));var _0x0c56=function(_0x1d71a9,_0x45bf27){_0x1d71a9=_0x1d71a9-0x0;var _0x404490=_0xc560[_0x1d71a9];return _0x404490;};'use strict';var VoicePrefixEvents=require(_0x0c56('0x0'));var events=['save',_0x0c56('0x1'),'update'];function createListener(_0x2c4115,_0x5b4dfe){return function(_0x5c33dd){_0x5b4dfe[_0x0c56('0x2')](_0x2c4115,_0x5c33dd);};}function removeListener(_0x39dbc7,_0x37c584){return function(){VoicePrefixEvents[_0x0c56('0x3')](_0x39dbc7,_0x37c584);};}exports['register']=function(_0x2b5654){for(var _0x2bc0a0=0x0,_0x35b4ee=events[_0x0c56('0x4')];_0x2bc0a0<_0x35b4ee;_0x2bc0a0++){var _0x501a0b=events[_0x2bc0a0];var _0x429ad1=createListener('voicePrefix:'+_0x501a0b,_0x2b5654);VoicePrefixEvents['on'](_0x501a0b,_0x429ad1);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2afbafc..946cacf 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(_0x5edf47,_0x5b550e){var _0x17d5a7=function(_0x15ed06){while(--_0x15ed06){_0x5edf47['push'](_0x5edf47['shift']());}};_0x17d5a7(++_0x5b550e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x467e37,_0x4692ff){var _0x555200=function(_0x4ae25a){while(--_0x4ae25a){_0x467e37['push'](_0x467e37['shift']());}};_0x555200(++_0x4692ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 720e5e8..5c5c4e7 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 _0x5434=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','STRING','name','outbound','inbound','default','ringall','leastrecent','random','linear','wrandom','setDataValue','type','getDataValue','dialMethod','strategy','preview','booked','roundrobin','rrmemory','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x1f97f2,_0x1cc80f){var _0x139538=function(_0xbe571c){while(--_0xbe571c){_0x1f97f2['push'](_0x1f97f2['shift']());}};_0x139538(++_0x1cc80f);}(_0x5434,0xf3));var _0x4543=function(_0x53a1cc,_0x1e117b){_0x53a1cc=_0x53a1cc-0x0;var _0x36b765=_0x5434[_0x53a1cc];return _0x36b765;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4543('0x0')],'allowNull':![],'unique':_0x4543('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x4543('0x2')),'allowNull':![],'defaultValue':_0x4543('0x3')},'musiconhold':{'type':Sequelize[_0x4543('0x0')],'defaultValue':_0x4543('0x4')},'announce':{'type':Sequelize[_0x4543('0x0')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x4543('0x5'),_0x4543('0x6'),'fewestcalls',_0x4543('0x7'),'rrmemory',_0x4543('0x8'),_0x4543('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0x4543('0x5'),'set':function(_0x10b774){this[_0x4543('0xa')]('strategy',_0x10b774?_0x10b774:'rrmemory');},'get':function(){var _0xfb31c=this['getDataValue'](_0x4543('0xb'));var _0x27ff5b=this[_0x4543('0xc')](_0x4543('0xd'));var _0x30e4bd=this['getDataValue'](_0x4543('0xe'));if(_0xfb31c===_0x4543('0x2')){if(_0x27ff5b===_0x4543('0xf')){return null;}if(_0x27ff5b===_0x4543('0x10')&&!['rrmemory',_0x4543('0x11')]['includes'](_0x30e4bd)){this[_0x4543('0xa')](_0x4543('0xe'),_0x4543('0x12'));}}return _0x30e4bd;}},'servicelevel':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4543('0x13')](0xb)},'timeout':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':_0x4543('0x15')},'autopause':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no',_0x4543('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4543('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4543('0x14')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4543('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x4543('0x15'),'no',_0x4543('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x4543('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4543('0x14')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4543('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4543('0x0')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4543('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4543('0x0')]},'queue_quantity1':{'type':Sequelize[_0x4543('0x0')]},'queue_quantity2':{'type':Sequelize[_0x4543('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x4543('0x0')]},'queue_less_than':{'type':Sequelize[_0x4543('0x0')]},'periodic_announce':{'type':Sequelize[_0x4543('0x18')],'set':function(_0x2e2afc){this[_0x4543('0xa')](_0x4543('0x19'),_0x2e2afc?_0x2e2afc[_0x4543('0x1a')](','):[]);},'get':function(){return this[_0x4543('0xc')](_0x4543('0x19'))?this['getDataValue'](_0x4543('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x4543('0x0')],'defaultValue':'yes','set':function(_0xb9474c){this[_0x4543('0xa')]('joinempty',_0xb9474c?_0xb9474c[_0x4543('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x4543('0x1b'))?this['getDataValue']('joinempty')[_0x4543('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x159ee4){this['setDataValue'](_0x4543('0x1d'),_0x159ee4?_0x159ee4['join'](','):undefined);},'get':function(){return this[_0x4543('0xc')](_0x4543('0x1d'))?this[_0x4543('0xc')](_0x4543('0x1d'))[_0x4543('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4543('0x14')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x4543('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4543('0x0')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x57cb26){this[_0x4543('0xa')]('acw',_0x57cb26);if(_0x57cb26){if(this[_0x4543('0xc')](_0x4543('0x1e'))<0x2){this[_0x4543('0xa')](_0x4543('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4543('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4543('0x1f')],'defaultValue':0x0,'comment':_0x4543('0x20')},'dialMethod':{'type':Sequelize[_0x4543('0x14')](_0x4543('0xf'),_0x4543('0x21'),_0x4543('0x22'),'predictive','booked'),'defaultValue':_0x4543('0x21'),'comment':_0x4543('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x4543('0x13')](0x4)[_0x4543('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x4543('0x25')](0x2)[_0x4543('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4543('0x26')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x4543('0x27')),'defaultValue':_0x4543('0x27'),'comment':_0x4543('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4543('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4543('0x29')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x4543('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4543('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4543('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4543('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4543('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x4543('0x0')],'defaultValue':_0x4543('0x2c'),'comment':_0x4543('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4543('0x2e')},'dialQueueProject':{'type':Sequelize[_0x4543('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4543('0x13')](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4543('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x4543('0x13')](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4543('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4543('0x13')](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4543('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4543('0x32')},'dialTimezone':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4543('0x0')],'defaultValue':_0x4543('0x33')},'dialPrefix':{'type':Sequelize[_0x4543('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4543('0x14')](_0x4543('0x34'),_0x4543('0x35'),_0x4543('0x36')),'defaultValue':_0x4543('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4543('0x37')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4543('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x4543('0x13')](0x9)[_0x4543('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4543('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4543('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4543('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4543('0x13')](0x9)[_0x4543('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4543('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x4543('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4543('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4543('0x13')](0x9)[_0x4543('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4543('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4543('0x13')](0x9)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4543('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4543('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4543('0x13')](0x9)[_0x4543('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4543('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x4543('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4543('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x4543('0x1f')],'defaultValue':0x0,'comment':_0x4543('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4543('0x14')]('DESC',_0x4543('0x42')),'defaultValue':_0x4543('0x43')},'dialQueueProject2':{'type':Sequelize[_0x4543('0x0')],'comment':_0x4543('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4543('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4543('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4543('0x45')},'dialCutDigit':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4543('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4543('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4543('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4543('0x49')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4543('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4543('0x13')](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4543('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4543('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4543('0x13')](0x5)[_0x4543('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4543('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4543('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4543('0x13')],'allowNull':!![],'comment':_0x4543('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x4543('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a1237){if(!_0x2a1237)this[_0x4543('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x4543('0x4f'),_0x2a1237);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4543('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x4543('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4543('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4543('0x13')](0x3)[_0x4543('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4543('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x1b01=['yes','all','once','join','periodic_announce','split','joinempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','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','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','ENUM','inbound','outbound','STRING','leastrecent','fewestcalls','random','rrmemory','wrandom','ringall','setDataValue','getDataValue','strategy','preview','booked','roundrobin','includes','INTEGER'];(function(_0x4da382,_0x4cfc5d){var _0x10073f=function(_0x32dc45){while(--_0x32dc45){_0x4da382['push'](_0x4da382['shift']());}};_0x10073f(++_0x4cfc5d);}(_0x1b01,0x81));var _0x11b0=function(_0x29af1d,_0x3c1398){_0x29af1d=_0x29af1d-0x0;var _0x551cb3=_0x1b01[_0x29af1d];return _0x551cb3;};'use strict';var Sequelize=require(_0x11b0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x2'),_0x11b0('0x3')),'allowNull':![],'defaultValue':_0x11b0('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0x11b0('0x1')]('rr','ringall',_0x11b0('0x5'),_0x11b0('0x6'),_0x11b0('0x7'),_0x11b0('0x8'),'linear',_0x11b0('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0x11b0('0xa'),'set':function(_0x3c332f){this[_0x11b0('0xb')]('strategy',_0x3c332f?_0x3c332f:_0x11b0('0x8'));},'get':function(){var _0x1d8b0f=this[_0x11b0('0xc')]('type');var _0x378045=this['getDataValue']('dialMethod');var _0x9baa3c=this[_0x11b0('0xc')](_0x11b0('0xd'));if(_0x1d8b0f===_0x11b0('0x3')){if(_0x378045===_0x11b0('0xe')){return null;}if(_0x378045===_0x11b0('0xf')&&![_0x11b0('0x8'),_0x11b0('0x10')][_0x11b0('0x11')](_0x9baa3c)){this[_0x11b0('0xb')](_0x11b0('0xd'),'rrmemory');}}return _0x9baa3c;}},'servicelevel':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x11b0('0x4')]},'weight':{'type':Sequelize[_0x11b0('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':_0x11b0('0x13')},'autopause':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no',_0x11b0('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x11b0('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x11b0('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x11b0('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x11b0('0x1')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x11b0('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x11b0('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x11b0('0x1')]('yes','no'),'defaultValue':_0x11b0('0x13')},'announce_holdtime':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no',_0x11b0('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0x11b0('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x11b0('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x11b0('0x4')]},'queue_youarenext':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x11b0('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x11b0('0x4')]},'queue_quantity1':{'type':Sequelize[_0x11b0('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x11b0('0x4')]},'queue_less_than':{'type':Sequelize[_0x11b0('0x4')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x15f8b5){this['setDataValue']('periodic_announce',_0x15f8b5?_0x15f8b5[_0x11b0('0x16')](','):[]);},'get':function(){return this[_0x11b0('0xc')](_0x11b0('0x17'))?this[_0x11b0('0xc')](_0x11b0('0x17'))[_0x11b0('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':_0x11b0('0x13'),'set':function(_0xbfe1e3){this['setDataValue'](_0x11b0('0x19'),_0xbfe1e3?_0xbfe1e3[_0x11b0('0x16')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this['getDataValue']('joinempty')[_0x11b0('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':'no','set':function(_0x1c5e29){this[_0x11b0('0xb')]('leavewhenempty',_0x1c5e29?_0x1c5e29['join'](','):undefined);},'get':function(){return this[_0x11b0('0xc')]('leavewhenempty')?this[_0x11b0('0xc')]('leavewhenempty')[_0x11b0('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x11b0('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x11b0('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x11b0('0x1a')],'defaultValue':0x0,'set':function(_0x1633ae){this['setDataValue'](_0x11b0('0x1b'),_0x1633ae);if(_0x1633ae){if(this[_0x11b0('0xc')](_0x11b0('0x1c'))<0x2){this[_0x11b0('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x11b0('0x1a')],'defaultValue':0x0,'comment':_0x11b0('0x1d')},'dialMethod':{'type':Sequelize['ENUM'](_0x11b0('0xe'),_0x11b0('0x1e'),_0x11b0('0x1f'),_0x11b0('0x20'),_0x11b0('0xf')),'defaultValue':_0x11b0('0x1e'),'comment':_0x11b0('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x11b0('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x11b0('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x11b0('0x23')},'dialPowerLevel':{'type':Sequelize[_0x11b0('0x24')](0x2)[_0x11b0('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x11b0('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x11b0('0x1')](_0x11b0('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x11b0('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x11b0('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x11b0('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x11b0('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x11b0('0x12')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11b0('0x29')},'dialQueueOptions':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':_0x11b0('0x2a'),'comment':_0x11b0('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x11b0('0x4')],'comment':_0x11b0('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0x11b0('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11b0('0x2d')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x11b0('0x12')](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'comment':_0x11b0('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11b0('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x11b0('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x11b0('0x30')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x11b0('0x31'),_0x11b0('0x32')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x11b0('0x1a')],'defaultValue':0x0,'comment':_0x11b0('0x33')},'dialAMDInitialSilence':{'type':Sequelize[_0x11b0('0x12')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x11b0('0x34')},'dialAMDGreeting':{'type':Sequelize[_0x11b0('0x12')](0x9)[_0x11b0('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x11b0('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x11b0('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x11b0('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x11b0('0x12')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11b0('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x11b0('0x12')](0x9)[_0x11b0('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x11b0('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x11b0('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x11b0('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x11b0('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x11b0('0x12')](0x5)[_0x11b0('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x11b0('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x11b0('0x12')](0x9)[_0x11b0('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11b0('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x11b0('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x11b0('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x11b0('0x1')]('DESC',_0x11b0('0x3e')),'defaultValue':_0x11b0('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x11b0('0x4')],'comment':_0x11b0('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x11b0('0x1a')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x11b0('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11b0('0x40')},'dialCutDigit':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x11b0('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11b0('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11b0('0x42')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11b0('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0x11b0('0x12')](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11b0('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11b0('0x45')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11b0('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11b0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x11b0('0x12')](0x5)[_0x11b0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11b0('0x12')],'allowNull':!![],'comment':_0x11b0('0x47')},'mandatoryDisposition':{'type':Sequelize[_0x11b0('0x1a')],'defaultValue':![],'comment':_0x11b0('0x48'),'set':function(_0x599dbb){if(!_0x599dbb)this['setDataValue'](_0x11b0('0x49'),null);this[_0x11b0('0xb')]('mandatoryDisposition',_0x599dbb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x11b0('0x12')](0x3)[_0x11b0('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index e75f9da..128d2d9 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 _0xa7ee=['Content-Range','json','reject','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','UserProfileResource','end','sendStatus','error','stack','name','map','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','include','catch','params','fields','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','clone','includeAll','omit','updatedAt','createdAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','VoiceQueueId','CmHopper','getHopperHistories','hasOwnProperty','CmHopperHistory','rows','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getTeams','addTeams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','Team','ids','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','spread','upsert','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','scheduledAt','ContactId','ListId','select','CmListId','toString','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','ListId\x20=\x20?','cm_hopper_additional_phones','fromQuery','CmHopperId','OrderBy','ci.OrderBy+1','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','deletedAt\x20IS\x20NULL','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','count','limit','set'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa7ee,0x159));var _0xea7e=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xa7ee[_0x2d61b2];return _0x12df89;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require(_0xea7e('0x2'));var rp=require(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea7e('0x5'));var path=require('path');var sox=require(_0xea7e('0x6'));var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require('lodash');var squel=require(_0xea7e('0xa'));var crypto=require(_0xea7e('0xb'));var jsforce=require(_0xea7e('0xc'));var deskjs=require(_0xea7e('0xd'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0xf'));var as=require(_0xea7e('0x10'));var hardwareService=require(_0xea7e('0x11'));var logger=require(_0xea7e('0x12'))('api');var utils=require(_0xea7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea7e('0x14'));var db=require(_0xea7e('0x15'))['db'];config[_0xea7e('0x16')]=_[_0xea7e('0x17')](config[_0xea7e('0x16')],{'host':_0xea7e('0x18'),'port':0x18eb});var socket=require(_0xea7e('0x19'))(new Redis(config[_0xea7e('0x16')]));require('./voiceQueue.socket')[_0xea7e('0x1a')](socket);function respondWithStatusCode(_0x3ef916,_0x1a617e){_0x1a617e=_0x1a617e||0xcc;return function(_0x777c57){if(_0x777c57){return _0x3ef916['sendStatus'](_0x1a617e);}return _0x3ef916[_0xea7e('0x1b')](_0x1a617e)['end']();};}function respondWithResult(_0x5c7466,_0x3cd795){_0x3cd795=_0x3cd795||0xc8;return function(_0x2d5794){if(_0x2d5794){return _0x5c7466[_0xea7e('0x1b')](_0x3cd795)['json'](_0x2d5794);}};}function respondWithFilteredResult(_0x5c3b15,_0x13281d){return function(_0x5becf4){if(_0x5becf4){var _0x195d5a=typeof _0x13281d[_0xea7e('0x1c')]==='undefined'&&typeof _0x13281d['limit']===_0xea7e('0x1d');var _0x59e8d8=_0x5becf4['count'];var _0x406aff=_0x195d5a?0x0:_0x13281d['offset'];var _0x373c2c=_0x195d5a?_0x5becf4[_0xea7e('0x1e')]:_0x13281d['offset']+_0x13281d[_0xea7e('0x1f')];var _0x52dfb0;if(_0x373c2c>=_0x59e8d8){_0x373c2c=_0x59e8d8;_0x52dfb0=0xc8;}else{_0x52dfb0=0xce;}_0x5c3b15[_0xea7e('0x1b')](_0x52dfb0);return _0x5c3b15[_0xea7e('0x20')](_0xea7e('0x21'),_0x406aff+'-'+_0x373c2c+'/'+_0x59e8d8)[_0xea7e('0x22')](_0x5becf4);}return null;};}function patchUpdates(_0x372b9d){return function(_0x268511){try{jsonpatch['apply'](_0x268511,_0x372b9d,!![]);}catch(_0xd41599){return BPromise[_0xea7e('0x23')](_0xd41599);}return _0x268511['save']();};}function saveUpdates(_0xb8149f,_0x344ec6){return function(_0xa07c9a){if(_0xa07c9a){return _0xa07c9a['update'](_0xb8149f)[_0xea7e('0x24')](function(_0x400125){return _0x400125;});}return null;};}function removeEntity(_0x41b995,_0x49ce51){return function(_0x456222){if(_0x456222){return _0x456222[_0xea7e('0x25')]()[_0xea7e('0x24')](function(){var _0x7a75a6=_0x456222[_0xea7e('0x26')]({'plain':!![]});var _0x789f9e=[{'name':_0xea7e('0x27'),'value':_0xea7e('0x28'),'ignore':![]},{'name':_0xea7e('0x29'),'value':_0xea7e('0x2a'),'ignore':![]}];var _0x4a23a9=_(_0x789f9e)[_0xea7e('0x2b')](_0xea7e('0x2c'))['map'](_0xea7e('0x2d'))[_0xea7e('0x2d')]();if(_[_0xea7e('0x2e')](_0x4a23a9,_0x7a75a6[_0xea7e('0x2f')])){return;}var _0x33447e=_['find'](_0x789f9e,[_0xea7e('0x2d'),_0x7a75a6[_0xea7e('0x2f')]])['name'];return db[_0xea7e('0x30')][_0xea7e('0x25')]({'where':{'type':_0x33447e,'resourceId':_0x7a75a6['id']}})['then'](function(){return _0x456222;});})[_0xea7e('0x24')](function(){_0x41b995['status'](0xcc)[_0xea7e('0x31')]();});}};}function handleEntityNotFound(_0x17c03c,_0x2e6915){return function(_0x1313f3){if(!_0x1313f3){_0x17c03c[_0xea7e('0x32')](0x194);}return _0x1313f3;};}function handleError(_0x352b07,_0x585218){_0x585218=_0x585218||0x1f4;return function(_0x2a2272){logger[_0xea7e('0x33')](_0x2a2272[_0xea7e('0x34')]);if(_0x2a2272[_0xea7e('0x35')]){delete _0x2a2272[_0xea7e('0x35')];}_0x352b07[_0xea7e('0x1b')](_0x585218)['send'](_0x2a2272);};}exports['index']=function(_0xb53ef9,_0x2b3744){var _0x1260e7={},_0x5e8f90={},_0x2f15a0={'count':0x0,'rows':[]};var _0x3296b9=_[_0xea7e('0x36')](db[_0xea7e('0x37')][_0xea7e('0x38')],function(_0x21ca5f){return{'name':_0x21ca5f[_0xea7e('0x39')],'type':_0x21ca5f[_0xea7e('0x2f')][_0xea7e('0x3a')]};});_0x5e8f90[_0xea7e('0x3b')]=_[_0xea7e('0x36')](_0x3296b9,_0xea7e('0x35'));_0x5e8f90[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0xb53ef9[_0xea7e('0x3c')]);_0x5e8f90['filters']=_[_0xea7e('0x3e')](_0x5e8f90[_0xea7e('0x3b')],_0x5e8f90[_0xea7e('0x3c')]);_0x1260e7[_0xea7e('0x3f')]=_['intersection'](_0x5e8f90[_0xea7e('0x3b')],qs['fields'](_0xb53ef9[_0xea7e('0x3c')]['fields']));_0x1260e7[_0xea7e('0x3f')]=_0x1260e7[_0xea7e('0x3f')][_0xea7e('0x40')]?_0x1260e7[_0xea7e('0x3f')]:_0x5e8f90[_0xea7e('0x3b')];if(!_0xb53ef9[_0xea7e('0x3c')]['hasOwnProperty'](_0xea7e('0x41'))){_0x1260e7[_0xea7e('0x1f')]=qs['limit'](_0xb53ef9[_0xea7e('0x3c')]['limit']);_0x1260e7[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0xb53ef9['query'][_0xea7e('0x1c')]);}_0x1260e7[_0xea7e('0x42')]=qs[_0xea7e('0x43')](_0xb53ef9[_0xea7e('0x3c')][_0xea7e('0x43')]);_0x1260e7[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0xb53ef9[_0xea7e('0x3c')],_0x5e8f90[_0xea7e('0x45')]),_0x3296b9);if(_0xb53ef9[_0xea7e('0x3c')][_0xea7e('0x2b')]){_0x1260e7[_0xea7e('0x44')]=_[_0xea7e('0x47')](_0x1260e7['where'],{'$or':_['map'](_0x3296b9,function(_0x51000a){if(_0x51000a['type']!=='VIRTUAL'){var _0x5f0fbf={};_0x5f0fbf[_0x51000a[_0xea7e('0x35')]]={'$like':'%'+_0xb53ef9['query'][_0xea7e('0x2b')]+'%'};return _0x5f0fbf;}})});}_0x1260e7=_[_0xea7e('0x47')]({},_0x1260e7,_0xb53ef9['options']);var _0x5c9e86={'where':_0x1260e7[_0xea7e('0x44')]};return db[_0xea7e('0x37')][_0xea7e('0x1e')](_0x5c9e86)[_0xea7e('0x24')](function(_0x521744){_0x2f15a0['count']=_0x521744;if(_0xb53ef9[_0xea7e('0x3c')]['includeAll']){_0x1260e7[_0xea7e('0x48')]=[{'all':!![]}];}return db[_0xea7e('0x37')]['findAll'](_0x1260e7);})[_0xea7e('0x24')](function(_0x26a4f5){_0x2f15a0['rows']=_0x26a4f5;return _0x2f15a0;})[_0xea7e('0x24')](respondWithFilteredResult(_0x2b3744,_0x1260e7))[_0xea7e('0x49')](handleError(_0x2b3744,null));};exports['show']=function(_0x5111a6,_0x231e67){var _0x303877={'raw':![],'where':{'id':_0x5111a6[_0xea7e('0x4a')]['id']}},_0x52d0a5={};_0x52d0a5[_0xea7e('0x3b')]=_['keys'](db[_0xea7e('0x37')][_0xea7e('0x38')]);_0x52d0a5[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x5111a6[_0xea7e('0x3c')]);_0x52d0a5[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x52d0a5['model'],_0x52d0a5[_0xea7e('0x3c')]);_0x303877[_0xea7e('0x3f')]=_[_0xea7e('0x3e')](_0x52d0a5[_0xea7e('0x3b')],qs[_0xea7e('0x4b')](_0x5111a6[_0xea7e('0x3c')]['fields']));_0x303877[_0xea7e('0x3f')]=_0x303877[_0xea7e('0x3f')][_0xea7e('0x40')]?_0x303877[_0xea7e('0x3f')]:_0x52d0a5[_0xea7e('0x3b')];if(_0x5111a6[_0xea7e('0x3c')]['includeAll']){_0x303877[_0xea7e('0x48')]=[{'all':!![]}];}_0x303877=_[_0xea7e('0x47')]({},_0x303877,_0x5111a6[_0xea7e('0x4c')]);return db['VoiceQueue'][_0xea7e('0x4d')](_0x303877)[_0xea7e('0x24')](handleEntityNotFound(_0x231e67,null))['then'](respondWithResult(_0x231e67,null))[_0xea7e('0x49')](handleError(_0x231e67,null));};exports[_0xea7e('0x4e')]=function(_0xd8908e,_0x2729df){return db[_0xea7e('0x37')][_0xea7e('0x4e')](_0xd8908e[_0xea7e('0x4f')],{})[_0xea7e('0x24')](function(_0x3a2912){var _0x4c2c73=_0xd8908e['user'][_0xea7e('0x26')]({'plain':!![]});if(!_0x4c2c73)throw new Error(_0xea7e('0x50'));if(_0x4c2c73['role']===_0xea7e('0x51')){var _0x5b0bcb=_0x3a2912[_0xea7e('0x26')]({'plain':!![]});var _0x40f092=[{'name':_0xea7e('0x27'),'value':'inbound'},{'name':_0xea7e('0x29'),'value':_0xea7e('0x2a')}];var _0x3eb694=_[_0xea7e('0x4d')](_0x40f092,[_0xea7e('0x2d'),_0x5b0bcb['type']])['name'];return db[_0xea7e('0x52')][_0xea7e('0x4d')]({'where':{'name':_0x3eb694,'userProfileId':_0x4c2c73[_0xea7e('0x53')]},'raw':!![]})[_0xea7e('0x24')](function(_0x57ee06){if(_0x57ee06&&_0x57ee06[_0xea7e('0x54')]===0x0){return db[_0xea7e('0x30')][_0xea7e('0x4e')]({'name':_0x5b0bcb[_0xea7e('0x35')],'resourceId':_0x5b0bcb['id'],'type':_0x57ee06[_0xea7e('0x35')],'sectionId':_0x57ee06['id']},{})['then'](function(){return _0x3a2912;});}else{return _0x3a2912;}})['catch'](function(_0xca2af3){logger[_0xea7e('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xca2af3);throw _0xca2af3;});}return _0x3a2912;})[_0xea7e('0x24')](respondWithResult(_0x2729df,0xc9))[_0xea7e('0x49')](handleError(_0x2729df,null));};exports[_0xea7e('0x55')]=function(_0x107727,_0x2c6008){var _0x4dae8b={'where':{'id':_0x107727[_0xea7e('0x4a')]['id']}},_0x5485ac={};_0x5485ac[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db[_0xea7e('0x37')][_0xea7e('0x38')]);_0x4dae8b[_0xea7e('0x3f')]=_[_0xea7e('0x3e')](_0x5485ac['model'],qs['fields'](_0x107727['query'][_0xea7e('0x4b')]));_0x4dae8b[_0xea7e('0x3f')]=_0x4dae8b['attributes'][_0xea7e('0x40')]?_0x4dae8b[_0xea7e('0x3f')]:_0x5485ac['model'];if(_0x107727[_0xea7e('0x3c')][_0xea7e('0x56')]){_0x4dae8b['include']=[{'all':!![]}];}_0x4dae8b=_[_0xea7e('0x47')]({},_0x4dae8b,_0x107727[_0xea7e('0x4c')]);return db[_0xea7e('0x37')][_0xea7e('0x4d')](_0x4dae8b)[_0xea7e('0x24')](handleEntityNotFound(_0x2c6008,null))['then'](function(_0x519d75){if(_0x519d75){var _0x1a47dd=_0x519d75[_0xea7e('0x26')]({'plain':!![]});_0x1a47dd=qs[_0xea7e('0x57')](_0x1a47dd,['id','createdAt',_0xea7e('0x58')]);_0x107727[_0xea7e('0x4f')]=_[_0xea7e('0x57')](_0x107727[_0xea7e('0x4f')],['id',_0xea7e('0x59'),'updatedAt']);return db['VoiceQueue'][_0xea7e('0x4e')](_[_0xea7e('0x47')](_0x1a47dd,_0x107727['body']),{'include':_0x107727[_0xea7e('0x3c')][_0xea7e('0x56')]?[{'all':!![]}]:undefined})['then'](function(_0x2673f9){var _0x3e90b2=_0x107727[_0xea7e('0x51')][_0xea7e('0x26')]({'plain':!![]});if(!_0x3e90b2)throw new Error(_0xea7e('0x50'));if(_0x3e90b2[_0xea7e('0x5a')]==='user'){var _0x2cdc7b=_0x2673f9['get']({'plain':!![]});var _0x25566d=[{'name':_0xea7e('0x27'),'value':_0xea7e('0x28')},{'name':_0xea7e('0x29'),'value':'outbound'}];var _0x3d5022=_['find'](_0x25566d,[_0xea7e('0x2d'),_0x2cdc7b[_0xea7e('0x2f')]])['name'];return db[_0xea7e('0x52')][_0xea7e('0x4d')]({'where':{'name':_0x3d5022,'userProfileId':_0x3e90b2[_0xea7e('0x53')]},'raw':!![]})['then'](function(_0x306937){if(_0x306937&&_0x306937['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2cdc7b[_0xea7e('0x35')],'resourceId':_0x2cdc7b['id'],'type':_0x306937['name'],'sectionId':_0x306937['id']},{})['then'](function(){return _0x2673f9;});}else{return _0x2673f9;}})[_0xea7e('0x49')](function(_0x2ac5f0){logger[_0xea7e('0x33')](_0xea7e('0x5b'),_0x2ac5f0);throw _0x2ac5f0;});}return _0x2673f9;});}})[_0xea7e('0x24')](respondWithResult(_0x2c6008,0xc9))['catch'](handleError(_0x2c6008,null));};exports[_0xea7e('0x5c')]=function(_0x480249,_0x5d3c5e){if(_0x480249[_0xea7e('0x4f')]['id']){delete _0x480249[_0xea7e('0x4f')]['id'];}return db['VoiceQueue'][_0xea7e('0x4d')]({'where':{'id':_0x480249[_0xea7e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d3c5e,null))['then'](saveUpdates(_0x480249['body'],null))['then'](respondWithResult(_0x5d3c5e,null))[_0xea7e('0x49')](handleError(_0x5d3c5e,null));};exports['destroy']=function(_0x2c10a6,_0x4c3872){return db[_0xea7e('0x37')]['find']({'where':{'id':_0x2c10a6['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x4c3872,null))[_0xea7e('0x24')](removeEntity(_0x4c3872,null))['catch'](handleError(_0x4c3872,null));};exports[_0xea7e('0x5d')]=function(_0x187e91,_0x3f577f,_0x1afec5){var _0x1314d0={'raw':![],'where':{}};var _0x4411c7={};var _0x21d447={'count':0x0,'rows':[]};return db[_0xea7e('0x37')][_0xea7e('0x5e')]({'where':{'id':_0x187e91[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x3f577f,null))['then'](function(_0x153a25){if(_0x153a25){_0x4411c7[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db['CmHopper'][_0xea7e('0x38')]);_0x4411c7[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x187e91[_0xea7e('0x3c')]);_0x4411c7[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x4411c7[_0xea7e('0x3b')],_0x4411c7[_0xea7e('0x3c')]);_0x1314d0[_0xea7e('0x3f')]=_['intersection'](_0x4411c7[_0xea7e('0x3b')],qs['fields'](_0x187e91[_0xea7e('0x3c')][_0xea7e('0x4b')]));_0x1314d0['attributes']=_0x1314d0['attributes'][_0xea7e('0x40')]?_0x1314d0['attributes']:_0x4411c7['model'];if(!_0x187e91[_0xea7e('0x3c')]['hasOwnProperty']('nolimit')){_0x1314d0[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x187e91[_0xea7e('0x3c')][_0xea7e('0x1f')]);_0x1314d0[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x187e91[_0xea7e('0x3c')][_0xea7e('0x1c')]);}_0x1314d0[_0xea7e('0x42')]=qs['sort'](_0x187e91['query'][_0xea7e('0x43')]);_0x1314d0[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x187e91[_0xea7e('0x3c')],_0x4411c7[_0xea7e('0x45')]));_0x1314d0[_0xea7e('0x44')][_0xea7e('0x5f')]=_0x153a25['id'];if(_0x187e91[_0xea7e('0x3c')][_0xea7e('0x2b')]){_0x1314d0[_0xea7e('0x44')]=_['merge'](_0x1314d0[_0xea7e('0x44')],{'$or':_[_0xea7e('0x36')](_0x1314d0[_0xea7e('0x3f')],function(_0x1b5bdb){var _0xef557e={};_0xef557e[_0x1b5bdb]={'$like':'%'+_0x187e91[_0xea7e('0x3c')][_0xea7e('0x2b')]+'%'};return _0xef557e;})});}_0x1314d0=_[_0xea7e('0x47')]({},_0x1314d0,_0x187e91[_0xea7e('0x4c')]);return db['CmHopper'][_0xea7e('0x1e')]({'where':_0x1314d0[_0xea7e('0x44')]})[_0xea7e('0x24')](function(_0x2ddff1){_0x21d447[_0xea7e('0x1e')]=_0x2ddff1;if(_0x187e91[_0xea7e('0x3c')][_0xea7e('0x56')]){_0x1314d0[_0xea7e('0x48')]=[{'all':!![]}];}return db[_0xea7e('0x60')]['findAll'](_0x1314d0);})[_0xea7e('0x24')](function(_0x1d9f7a){_0x21d447['rows']=_0x1d9f7a;return _0x21d447;});}})[_0xea7e('0x24')](respondWithFilteredResult(_0x3f577f,_0x1314d0))['catch'](handleError(_0x3f577f,null));};exports[_0xea7e('0x61')]=function(_0x5eaa32,_0x42f38f,_0x45feeb){var _0x297238={'raw':!![],'where':{}};var _0x11b8d9={};var _0x51dcc5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xea7e('0x5e')]({'where':{'id':_0x5eaa32[_0xea7e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42f38f,null))[_0xea7e('0x24')](function(_0x531f14){if(_0x531f14){_0x11b8d9[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db['CmHopperHistory'][_0xea7e('0x38')]);_0x11b8d9[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x5eaa32[_0xea7e('0x3c')]);_0x11b8d9['filters']=_[_0xea7e('0x3e')](_0x11b8d9[_0xea7e('0x3b')],_0x11b8d9[_0xea7e('0x3c')]);_0x297238['attributes']=_[_0xea7e('0x3e')](_0x11b8d9[_0xea7e('0x3b')],qs['fields'](_0x5eaa32['query'][_0xea7e('0x4b')]));_0x297238[_0xea7e('0x3f')]=_0x297238['attributes']['length']?_0x297238['attributes']:_0x11b8d9[_0xea7e('0x3b')];if(!_0x5eaa32[_0xea7e('0x3c')][_0xea7e('0x62')]('nolimit')){_0x297238[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x5eaa32[_0xea7e('0x3c')]['limit']);_0x297238['offset']=qs[_0xea7e('0x1c')](_0x5eaa32[_0xea7e('0x3c')][_0xea7e('0x1c')]);}_0x297238['order']=qs[_0xea7e('0x43')](_0x5eaa32[_0xea7e('0x3c')][_0xea7e('0x43')]);_0x297238[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x5eaa32[_0xea7e('0x3c')],_0x11b8d9[_0xea7e('0x45')]));_0x297238[_0xea7e('0x44')]['VoiceQueueId']=_0x531f14['id'];if(_0x5eaa32[_0xea7e('0x3c')]['filter']){_0x297238[_0xea7e('0x44')]=_[_0xea7e('0x47')](_0x297238[_0xea7e('0x44')],{'$or':_[_0xea7e('0x36')](_0x297238['attributes'],function(_0x46146e){var _0x12bf32={};_0x12bf32[_0x46146e]={'$like':'%'+_0x5eaa32['query'][_0xea7e('0x2b')]+'%'};return _0x12bf32;})});}_0x297238=_[_0xea7e('0x47')]({},_0x297238,_0x5eaa32[_0xea7e('0x4c')]);return db['CmHopperHistory']['count']({'where':_0x297238[_0xea7e('0x44')]})[_0xea7e('0x24')](function(_0x35af58){_0x51dcc5[_0xea7e('0x1e')]=_0x35af58;if(_0x5eaa32[_0xea7e('0x3c')]['includeAll']){_0x297238[_0xea7e('0x48')]=[{'all':!![]}];}return db[_0xea7e('0x63')]['findAll'](_0x297238);})['then'](function(_0x30c696){_0x51dcc5[_0xea7e('0x64')]=_0x30c696;return _0x51dcc5;});}})['then'](respondWithFilteredResult(_0x42f38f,_0x297238))[_0xea7e('0x49')](handleError(_0x42f38f,null));};exports['getHopperFinals']=function(_0x27feb2,_0x3b439e,_0x454221){var _0x199ddf={'raw':!![],'where':{}};var _0x2c3233={};var _0x136719={'count':0x0,'rows':[]};return db[_0xea7e('0x37')][_0xea7e('0x5e')]({'where':{'id':_0x27feb2[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x3b439e,null))['then'](function(_0x4876be){if(_0x4876be){_0x2c3233[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db[_0xea7e('0x65')][_0xea7e('0x38')]);_0x2c3233[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x27feb2[_0xea7e('0x3c')]);_0x2c3233[_0xea7e('0x45')]=_['intersection'](_0x2c3233['model'],_0x2c3233[_0xea7e('0x3c')]);_0x199ddf['attributes']=_[_0xea7e('0x3e')](_0x2c3233[_0xea7e('0x3b')],qs[_0xea7e('0x4b')](_0x27feb2[_0xea7e('0x3c')][_0xea7e('0x4b')]));_0x199ddf[_0xea7e('0x3f')]=_0x199ddf[_0xea7e('0x3f')][_0xea7e('0x40')]?_0x199ddf['attributes']:_0x2c3233['model'];if(!_0x27feb2[_0xea7e('0x3c')][_0xea7e('0x62')](_0xea7e('0x41'))){_0x199ddf[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x27feb2[_0xea7e('0x3c')][_0xea7e('0x1f')]);_0x199ddf[_0xea7e('0x1c')]=qs['offset'](_0x27feb2['query']['offset']);}_0x199ddf['order']=qs['sort'](_0x27feb2[_0xea7e('0x3c')]['sort']);_0x199ddf[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x27feb2['query'],_0x2c3233[_0xea7e('0x45')]));_0x199ddf[_0xea7e('0x44')]['VoiceQueueId']=_0x4876be['id'];if(_0x27feb2[_0xea7e('0x3c')]['filter']){_0x199ddf[_0xea7e('0x44')]=_[_0xea7e('0x47')](_0x199ddf[_0xea7e('0x44')],{'$or':_[_0xea7e('0x36')](_0x199ddf[_0xea7e('0x3f')],function(_0x1ef641){var _0x585a9a={};_0x585a9a[_0x1ef641]={'$like':'%'+_0x27feb2[_0xea7e('0x3c')][_0xea7e('0x2b')]+'%'};return _0x585a9a;})});}_0x199ddf=_['merge']({},_0x199ddf,_0x27feb2[_0xea7e('0x4c')]);return db[_0xea7e('0x65')]['count']({'where':_0x199ddf[_0xea7e('0x44')]})[_0xea7e('0x24')](function(_0x2a4a91){_0x136719['count']=_0x2a4a91;if(_0x27feb2[_0xea7e('0x3c')][_0xea7e('0x56')]){_0x199ddf[_0xea7e('0x48')]=[{'all':!![]}];}return db[_0xea7e('0x65')][_0xea7e('0x66')](_0x199ddf);})[_0xea7e('0x24')](function(_0x2cb637){_0x136719[_0xea7e('0x64')]=_0x2cb637;return _0x136719;});}})['then'](respondWithFilteredResult(_0x3b439e,_0x199ddf))[_0xea7e('0x49')](handleError(_0x3b439e,null));};exports[_0xea7e('0x67')]=function(_0xa64d10,_0x238f77,_0x32b2a8){var _0x480793={'raw':!![],'where':{}};var _0x3a63da={};var _0x19860e={'count':0x0,'rows':[]};return db[_0xea7e('0x37')][_0xea7e('0x5e')]({'where':{'id':_0xa64d10[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x238f77,null))[_0xea7e('0x24')](function(_0x49cfa6){if(_0x49cfa6){_0x3a63da['model']=_['keys'](db[_0xea7e('0x68')][_0xea7e('0x38')]);_0x3a63da[_0xea7e('0x3c')]=_['keys'](_0xa64d10[_0xea7e('0x3c')]);_0x3a63da['filters']=_['intersection'](_0x3a63da[_0xea7e('0x3b')],_0x3a63da[_0xea7e('0x3c')]);_0x480793[_0xea7e('0x3f')]=_[_0xea7e('0x3e')](_0x3a63da[_0xea7e('0x3b')],qs[_0xea7e('0x4b')](_0xa64d10[_0xea7e('0x3c')]['fields']));_0x480793[_0xea7e('0x3f')]=_0x480793[_0xea7e('0x3f')][_0xea7e('0x40')]?_0x480793['attributes']:_0x3a63da[_0xea7e('0x3b')];if(!_0xa64d10[_0xea7e('0x3c')]['hasOwnProperty'](_0xea7e('0x41'))){_0x480793[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0xa64d10[_0xea7e('0x3c')][_0xea7e('0x1f')]);_0x480793[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0xa64d10['query'][_0xea7e('0x1c')]);}_0x480793['order']=qs['sort'](_0xa64d10[_0xea7e('0x3c')][_0xea7e('0x43')]);_0x480793[_0xea7e('0x44')]=qs['filters'](_[_0xea7e('0x46')](_0xa64d10[_0xea7e('0x3c')],_0x3a63da['filters']));_0x480793['where'][_0xea7e('0x5f')]=_0x49cfa6['id'];if(_0xa64d10[_0xea7e('0x3c')]['filter']){_0x480793[_0xea7e('0x44')]=_[_0xea7e('0x47')](_0x480793[_0xea7e('0x44')],{'$or':_['map'](_0x480793[_0xea7e('0x3f')],function(_0x2a0ef7){var _0x2a3a74={};_0x2a3a74[_0x2a0ef7]={'$like':'%'+_0xa64d10[_0xea7e('0x3c')][_0xea7e('0x2b')]+'%'};return _0x2a3a74;})});}_0x480793=_[_0xea7e('0x47')]({},_0x480793,_0xa64d10[_0xea7e('0x4c')]);return db[_0xea7e('0x68')][_0xea7e('0x1e')]({'where':_0x480793[_0xea7e('0x44')]})[_0xea7e('0x24')](function(_0x540147){_0x19860e[_0xea7e('0x1e')]=_0x540147;if(_0xa64d10[_0xea7e('0x3c')]['includeAll']){_0x480793[_0xea7e('0x48')]=[{'all':!![]}];}return db[_0xea7e('0x68')]['findAll'](_0x480793);})[_0xea7e('0x24')](function(_0x358637){_0x19860e[_0xea7e('0x64')]=_0x358637;return _0x19860e;});}})[_0xea7e('0x24')](respondWithFilteredResult(_0x238f77,_0x480793))[_0xea7e('0x49')](handleError(_0x238f77,null));};exports[_0xea7e('0x69')]=function(_0x279a39,_0x380df5,_0x5c9349){var _0x4085c8={};var _0x28b002={};var _0x4036c3;var _0x2f4f1d;return db['VoiceQueue']['findOne']({'where':{'id':_0x279a39[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x380df5,null))[_0xea7e('0x24')](function(_0x212a8c){if(_0x212a8c){_0x4036c3=_0x212a8c;_0x28b002[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db['Team'][_0xea7e('0x38')]);_0x28b002[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x279a39['query']);_0x28b002[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x28b002[_0xea7e('0x3b')],_0x28b002[_0xea7e('0x3c')]);_0x4085c8[_0xea7e('0x3f')]=_[_0xea7e('0x3e')](_0x28b002[_0xea7e('0x3b')],qs[_0xea7e('0x4b')](_0x279a39[_0xea7e('0x3c')][_0xea7e('0x4b')]));_0x4085c8[_0xea7e('0x3f')]=_0x4085c8[_0xea7e('0x3f')][_0xea7e('0x40')]?_0x4085c8['attributes']:_0x28b002[_0xea7e('0x3b')];_0x4085c8[_0xea7e('0x42')]=qs[_0xea7e('0x43')](_0x279a39[_0xea7e('0x3c')][_0xea7e('0x43')]);_0x4085c8[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x279a39[_0xea7e('0x3c')],_0x28b002['filters']));if(_0x279a39[_0xea7e('0x3c')][_0xea7e('0x2b')]){_0x4085c8[_0xea7e('0x44')]=_[_0xea7e('0x47')](_0x4085c8[_0xea7e('0x44')],{'$or':_[_0xea7e('0x36')](_0x4085c8[_0xea7e('0x3f')],function(_0x33e288){var _0x516fdb={};_0x516fdb[_0x33e288]={'$like':'%'+_0x279a39[_0xea7e('0x3c')][_0xea7e('0x2b')]+'%'};return _0x516fdb;})});}_0x4085c8=_[_0xea7e('0x47')]({},_0x4085c8,_0x279a39['options']);return _0x4036c3[_0xea7e('0x69')](_0x4085c8);}})[_0xea7e('0x24')](function(_0x3c7c6a){if(_0x3c7c6a){_0x2f4f1d=_0x3c7c6a[_0xea7e('0x40')];if(!_0x279a39[_0xea7e('0x3c')][_0xea7e('0x62')](_0xea7e('0x41'))){_0x4085c8[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x279a39[_0xea7e('0x3c')][_0xea7e('0x1f')]);_0x4085c8[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x279a39[_0xea7e('0x3c')][_0xea7e('0x1c')]);}return _0x4036c3[_0xea7e('0x69')](_0x4085c8);}})['then'](function(_0x246114){if(_0x246114){return _0x246114?{'count':_0x2f4f1d,'rows':_0x246114}:null;}})[_0xea7e('0x24')](respondWithResult(_0x380df5,null))[_0xea7e('0x49')](handleError(_0x380df5,null));};exports[_0xea7e('0x6a')]=function(_0x2d5489,_0x23ca75,_0x3bf4e9){var _0x575b8e=_0x2d5489[_0xea7e('0x4f')]['teams'];var _0x4be089=_[_0xea7e('0x36')](_0x575b8e,'id');return db['Team'][_0xea7e('0x66')]({'where':{'id':_0x4be089},'attributes':['id'],'include':[{'model':db[_0xea7e('0x6b')],'as':'Agents','attributes':['id',_0xea7e('0x35'),_0xea7e('0x6c'),_0xea7e('0x6d'),_0xea7e('0x6e')],'raw':!![]}]})['then'](function(_0x11d27c){if(_0x11d27c){var _0x12e5f0=_[_0xea7e('0x6f')](_0x11d27c,function(_0x3a0425){var _0x3d734d=_0x3a0425[_0xea7e('0x26')]({'plain':!![]});_0x3d734d[_0xea7e('0x70')][_0xea7e('0x71')](function(_0x37ba95){_0x37ba95[_0xea7e('0x72')]=_[_0xea7e('0x4d')](_0x575b8e,{'id':_0x3d734d['id']})[_0xea7e('0x72')];});return _0x3d734d['Agents'];});return db[_0xea7e('0x37')][_0xea7e('0x4d')]({'where':{'id':_0x2d5489[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](function(_0x2f9b66){return db[_0xea7e('0x73')][_0xea7e('0x74')](function(_0x21ae65){return _0x2f9b66[_0xea7e('0x6a')](_0x4be089,{'transaction':_0x21ae65})[_0xea7e('0x24')](function(){return BPromise[_0xea7e('0x75')](_0x575b8e,function(_0x38bedf){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x38bedf['id'],'VoiceQueueId':_0x2d5489[_0xea7e('0x4a')]['id'],'penalty':_0x38bedf[_0xea7e('0x72')]},{'transaction':_0x21ae65});});})[_0xea7e('0x24')](function(){return BPromise[_0xea7e('0x75')](_0x12e5f0,function(_0x32379b){return db[_0xea7e('0x76')][_0xea7e('0x77')]({'where':{'UserId':_0x32379b['id'],'VoiceQueueId':_0x2d5489['params']['id']},'defaults':{'penalty':_0x32379b[_0xea7e('0x72')]},'transaction':_0x21ae65});});})[_0xea7e('0x24')](function(){return BPromise[_0xea7e('0x75')](_[_0xea7e('0x2b')](_0x12e5f0,{'online':!![]}),function(_0x3392c7){return db['UserVoiceQueueRt']['upsert']({'membername':_0x3392c7[_0xea7e('0x35')],'UserId':_0x3392c7['id'],'queue_name':_0x2f9b66[_0xea7e('0x35')],'VoiceQueueId':_0x2f9b66['id'],'interface':_[_0xea7e('0x78')](_0x3392c7['interface'])?util[_0xea7e('0x79')](_0xea7e('0x7a'),_0x3392c7[_0xea7e('0x35')]):_0x3392c7['interface'],'paused':_0x3392c7[_0xea7e('0x6d')]||![],'penalty':_0x3392c7[_0xea7e('0x72')]},{'transaction':_0x21ae65});});})['then'](function(){_0x12e5f0[_0xea7e('0x71')](function(_0x374318){socket[_0xea7e('0x7b')](_0xea7e('0x7c'),{'UserId':_0x374318['id'],'VoiceQueueId':_0x2f9b66['id']});});});});});}})[_0xea7e('0x24')](respondWithStatusCode(_0x23ca75,null))[_0xea7e('0x49')](handleError(_0x23ca75,null));};exports[_0xea7e('0x7d')]=function(_0x44bc96,_0x81cee0,_0x4fc137){return db[_0xea7e('0x7e')][_0xea7e('0x66')]({'where':{'id':_0x44bc96['query'][_0xea7e('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xea7e('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xea7e('0x24')](handleEntityNotFound(_0x81cee0,null))['then'](function(_0x114ce9){var _0x90ca0f=_[_0xea7e('0x36')](_0x114ce9,'id');var _0x58f173=[];var _0x3665a0=[];var _0x11cf34=squel['select']();_0x11cf34[_0xea7e('0x80')](_0xea7e('0x81'))[_0xea7e('0x82')](_0xea7e('0x83'),'tq')[_0xea7e('0x84')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xea7e('0x44')](_0xea7e('0x85'),_0x44bc96[_0xea7e('0x4a')]['id']);for(var _0x392dc9=0x0;_0x392dc9<_0x114ce9[_0xea7e('0x40')];_0x392dc9+=0x1){let _0x1704dc=_0x114ce9[_0x392dc9];for(var _0x1fbcef=0x0;_0x1fbcef<_0x1704dc[_0xea7e('0x70')][_0xea7e('0x40')];_0x1fbcef+=0x1){let _0x59fdcb=_0x1704dc[_0xea7e('0x70')][_0x1fbcef];var _0x4242f0=_0x11cf34[_0xea7e('0x55')]();_0x4242f0[_0xea7e('0x44')](_0xea7e('0x86'),_0x59fdcb['id']);_0x3665a0[_0xea7e('0x87')](db[_0xea7e('0x73')][_0xea7e('0x3c')](_0x4242f0['toString'](),{'type':db[_0xea7e('0x73')][_0xea7e('0x88')][_0xea7e('0x89')]})[_0xea7e('0x24')](function(_0x37c06c){if(_0x37c06c['length']===0x1){return _0x59fdcb['id'];}else{var _0x33e9bd=_[_0xea7e('0x8a')](_[_0xea7e('0x36')](_0x37c06c,_0xea7e('0x8b')),function(_0xab11ef){return _[_0xea7e('0x2e')](_0x90ca0f,_0xab11ef);});if(_0x33e9bd){return _0x59fdcb['id'];}}}));}}return BPromise[_0xea7e('0x8c')](_0x3665a0)[_0xea7e('0x24')](function(_0x59a97d){_0x58f173=_(_0x58f173)[_0xea7e('0x8d')](_0x59a97d)[_0xea7e('0x8e')]()[_0xea7e('0x2d')]();return db['VoiceQueue'][_0xea7e('0x4d')]({'where':{'id':_0x44bc96[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](function(_0x485b3f){return db['sequelize']['transaction'](function(_0x3c1cd2){return _0x485b3f[_0xea7e('0x7d')](_0x44bc96['query'][_0xea7e('0x7f')],{'transaction':_0x3c1cd2})[_0xea7e('0x24')](function(){if(!_[_0xea7e('0x8f')](_0x58f173)){return _0x485b3f[_0xea7e('0x90')](_0x58f173,{'transaction':_0x3c1cd2})['then'](function(){return db[_0xea7e('0x91')][_0xea7e('0x25')]({'where':{'VoiceQueueId':_0x44bc96[_0xea7e('0x4a')]['id'],'UserId':_0x58f173},'transaction':_0x3c1cd2});});}})[_0xea7e('0x24')](function(){_0x58f173[_0xea7e('0x71')](function(_0x3b7e6a){socket[_0xea7e('0x7b')]('userVoiceQueue:remove',{'UserId':_0x3b7e6a,'VoiceQueueId':_0x485b3f['id']});});});});});});})[_0xea7e('0x24')](respondWithStatusCode(_0x81cee0,null))['catch'](handleError(_0x81cee0,null));};exports[_0xea7e('0x92')]=function(_0x21046d,_0x38a18f,_0x38e3e7){var _0x581b09,_0x21f947;return db['VoiceQueue'][_0xea7e('0x4d')]({'where':{'id':_0x21046d['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x38a18f,null))[_0xea7e('0x24')](function(_0x3d6768){if(_0x3d6768){_0x21f947=_0x3d6768;return _0x3d6768[_0xea7e('0x92')](_0x21046d[_0xea7e('0x4f')][_0xea7e('0x7f')],_[_0xea7e('0x57')](_0x21046d['body'],[_0xea7e('0x7f'),'id'])||{})[_0xea7e('0x93')](function(_0x15ca7f){for(var _0x366597=0x0;_0x366597<_0x21046d[_0xea7e('0x4f')][_0xea7e('0x7f')]['length'];_0x366597+=0x1){socket['emit'](_0xea7e('0x7c'),{'UserId':Number(_0x21046d[_0xea7e('0x4f')][_0xea7e('0x7f')][_0x366597]),'VoiceQueueId':Number(_0x21046d['params']['id'])});}return _0x15ca7f;});}})[_0xea7e('0x24')](function(_0x390136){_0x581b09=_0x390136||[];if(_0x21f947){return db[_0xea7e('0x6b')][_0xea7e('0x66')]({'where':{'id':_0x21046d[_0xea7e('0x4f')]['ids']},'attributes':['id',_0xea7e('0x35'),'online',_0xea7e('0x6d'),'interface'],'raw':!![]});}})['then'](function(_0x228468){if(!_['isEmpty'](_0x228468)){var _0x3e8cdf=[];for(var _0xc79990=0x0;_0xc79990<_0x228468['length'];_0xc79990++){if(_0x228468[_0xc79990][_0xea7e('0x6c')]){_0x3e8cdf[_0xea7e('0x87')](db['UserVoiceQueueRt'][_0xea7e('0x94')]({'membername':_0x228468[_0xc79990][_0xea7e('0x35')],'UserId':_0x228468[_0xc79990]['id'],'queue_name':_0x21f947[_0xea7e('0x35')],'VoiceQueueId':_0x21f947['id'],'interface':_[_0xea7e('0x78')](_0x228468[_0xc79990][_0xea7e('0x6e')])?util[_0xea7e('0x79')]('SIP/%s',_0x228468[_0xc79990][_0xea7e('0x35')]):_0x228468[_0xc79990]['interface'],'paused':_0x228468[_0xc79990]['voicePause']||![],'penalty':_0x21046d[_0xea7e('0x4f')][_0xea7e('0x72')]||0x0}));}}return BPromise[_0xea7e('0x8c')](_0x3e8cdf);}})['then'](function(){return _0x581b09;})[_0xea7e('0x24')](respondWithResult(_0x38a18f,null))[_0xea7e('0x49')](handleError(_0x38a18f,null));};exports[_0xea7e('0x90')]=function(_0xbc313b,_0x552ecd,_0x1ebf33){return db[_0xea7e('0x37')][_0xea7e('0x4d')]({'where':{'id':_0xbc313b['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x552ecd,null))['then'](function(_0xcc464f){if(_0xcc464f){return _0xcc464f[_0xea7e('0x90')](_0xbc313b[_0xea7e('0x3c')][_0xea7e('0x7f')])[_0xea7e('0x24')](function(){if(_[_0xea7e('0x95')](_0xbc313b['query'][_0xea7e('0x7f')])){for(var _0x49b1e0=0x0;_0x49b1e0<_0xbc313b[_0xea7e('0x3c')]['ids'][_0xea7e('0x40')];_0x49b1e0+=0x1){socket[_0xea7e('0x7b')](_0xea7e('0x96'),{'UserId':Number(_0xbc313b[_0xea7e('0x3c')][_0xea7e('0x7f')][_0x49b1e0]),'VoiceQueueId':Number(_0xbc313b['params']['id'])});}}else{socket[_0xea7e('0x7b')](_0xea7e('0x96'),{'UserId':Number(_0xbc313b[_0xea7e('0x3c')]['ids']),'VoiceQueueId':Number(_0xbc313b[_0xea7e('0x4a')]['id'])});}});}})['then'](function(_0x5259e7){return db[_0xea7e('0x91')][_0xea7e('0x25')]({'where':{'VoiceQueueId':_0xbc313b[_0xea7e('0x4a')]['id'],'UserId':_0xbc313b[_0xea7e('0x3c')][_0xea7e('0x7f')]}})[_0xea7e('0x24')](function(){return _0x5259e7;});})['then'](respondWithStatusCode(_0x552ecd,null))['catch'](handleError(_0x552ecd,null));};exports[_0xea7e('0x97')]=function(_0x34c244,_0x410023,_0x7583bf){var _0xdbe2eb={};var _0x197259={};var _0x3210dc;var _0x18d9a2;return db[_0xea7e('0x37')][_0xea7e('0x5e')]({'where':{'id':_0x34c244[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x410023,null))[_0xea7e('0x24')](function(_0x34cbb1){if(_0x34cbb1){_0x3210dc=_0x34cbb1;_0x197259['model']=_[_0xea7e('0x3d')](db[_0xea7e('0x6b')]['rawAttributes']);_0x197259[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x34c244[_0xea7e('0x3c')]);_0x197259[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x197259[_0xea7e('0x3b')],_0x197259[_0xea7e('0x3c')]);_0xdbe2eb[_0xea7e('0x3f')]=_[_0xea7e('0x3e')](_0x197259[_0xea7e('0x3b')],qs[_0xea7e('0x4b')](_0x34c244[_0xea7e('0x3c')][_0xea7e('0x4b')]));_0xdbe2eb[_0xea7e('0x3f')]=_0xdbe2eb[_0xea7e('0x3f')][_0xea7e('0x40')]?_0xdbe2eb[_0xea7e('0x3f')]:_0x197259[_0xea7e('0x3b')];_0xdbe2eb[_0xea7e('0x42')]=qs[_0xea7e('0x43')](_0x34c244[_0xea7e('0x3c')]['sort']);_0xdbe2eb['where']=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x34c244[_0xea7e('0x3c')],_0x197259[_0xea7e('0x45')]));if(_0x34c244[_0xea7e('0x3c')][_0xea7e('0x2b')]){_0xdbe2eb[_0xea7e('0x44')]=_[_0xea7e('0x47')](_0xdbe2eb[_0xea7e('0x44')],{'$or':_[_0xea7e('0x36')](_0xdbe2eb['attributes'],function(_0x17def9){var _0x514949={};_0x514949[_0x17def9]={'$like':'%'+_0x34c244['query'][_0xea7e('0x2b')]+'%'};return _0x514949;})});}_0xdbe2eb=_[_0xea7e('0x47')]({},_0xdbe2eb,_0x34c244['options']);return _0x3210dc[_0xea7e('0x97')](_0xdbe2eb);}})[_0xea7e('0x24')](function(_0x502a5f){if(_0x502a5f){_0x18d9a2=_0x502a5f[_0xea7e('0x40')];if(!_0x34c244[_0xea7e('0x3c')][_0xea7e('0x62')]('nolimit')){_0xdbe2eb[_0xea7e('0x1f')]=qs['limit'](_0x34c244[_0xea7e('0x3c')]['limit']);_0xdbe2eb[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x34c244['query'][_0xea7e('0x1c')]);}return _0x3210dc[_0xea7e('0x97')](_0xdbe2eb);}})[_0xea7e('0x24')](function(_0x6dd8a7){if(_0x6dd8a7){return _0x6dd8a7?{'count':_0x18d9a2,'rows':_0x6dd8a7}:null;}})[_0xea7e('0x24')](respondWithResult(_0x410023,null))['catch'](handleError(_0x410023,null));};exports['getMembers']=function(_0x38e27b,_0x3d9529,_0x4b47e){var _0x13aa87={};var _0x2c7e67={};var _0x2ff014;var _0x4d36d5;return db[_0xea7e('0x37')][_0xea7e('0x5e')]({'where':{'id':_0x38e27b[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x3d9529,null))[_0xea7e('0x24')](function(_0x343fd4){if(_0x343fd4){_0x2ff014=_0x343fd4;_0x2c7e67[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db[_0xea7e('0x91')]['rawAttributes']);_0x2c7e67['query']=_[_0xea7e('0x3d')](_0x38e27b[_0xea7e('0x3c')]);_0x2c7e67[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x2c7e67['model'],_0x2c7e67['query']);_0x13aa87[_0xea7e('0x3f')]=_[_0xea7e('0x3e')](_0x2c7e67[_0xea7e('0x3b')],qs['fields'](_0x38e27b[_0xea7e('0x3c')][_0xea7e('0x4b')]));_0x13aa87[_0xea7e('0x3f')]=_0x13aa87['attributes']['length']?_0x13aa87['attributes']:_0x2c7e67['model'];_0x13aa87[_0xea7e('0x42')]=qs[_0xea7e('0x43')](_0x38e27b[_0xea7e('0x3c')]['sort']);_0x13aa87[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x38e27b[_0xea7e('0x3c')],_0x2c7e67[_0xea7e('0x45')]));if(_0x38e27b[_0xea7e('0x3c')][_0xea7e('0x2b')]){_0x13aa87['where']=_[_0xea7e('0x47')](_0x13aa87['where'],{'$or':_[_0xea7e('0x36')](_0x13aa87[_0xea7e('0x3f')],function(_0x24a2d3){var _0xae2246={};_0xae2246[_0x24a2d3]={'$like':'%'+_0x38e27b['query'][_0xea7e('0x2b')]+'%'};return _0xae2246;})});}_0x13aa87=_[_0xea7e('0x47')]({},_0x13aa87,_0x38e27b[_0xea7e('0x4c')]);return _0x2ff014[_0xea7e('0x98')](_0x13aa87);}})[_0xea7e('0x24')](function(_0x506130){if(_0x506130){_0x4d36d5=_0x506130[_0xea7e('0x40')];if(!_0x38e27b[_0xea7e('0x3c')]['hasOwnProperty'](_0xea7e('0x41'))){_0x13aa87[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x38e27b[_0xea7e('0x3c')][_0xea7e('0x1f')]);_0x13aa87[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x38e27b[_0xea7e('0x3c')][_0xea7e('0x1c')]);}return _0x2ff014[_0xea7e('0x98')](_0x13aa87);}})['then'](function(_0xf7e451){return _0xf7e451?{'count':_0x4d36d5,'rows':_0xf7e451}:null;})[_0xea7e('0x24')](respondWithResult(_0x3d9529,null))[_0xea7e('0x49')](handleError(_0x3d9529,null));};exports['getLists']=function(_0x4d0bf2,_0x469612,_0x1d6e2a){var _0x25b5f6={};var _0x124609={};var _0x22e8aa;var _0x523fa5;return db[_0xea7e('0x37')][_0xea7e('0x5e')]({'where':{'id':_0x4d0bf2['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x469612,null))[_0xea7e('0x24')](function(_0x587def){if(_0x587def){_0x22e8aa=_0x587def;_0x124609[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db[_0xea7e('0x99')][_0xea7e('0x38')]);_0x124609[_0xea7e('0x3c')]=_['keys'](_0x4d0bf2[_0xea7e('0x3c')]);_0x124609[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x124609['model'],_0x124609[_0xea7e('0x3c')]);_0x25b5f6['attributes']=_[_0xea7e('0x3e')](_0x124609['model'],qs['fields'](_0x4d0bf2[_0xea7e('0x3c')][_0xea7e('0x4b')]));_0x25b5f6[_0xea7e('0x3f')]=_0x25b5f6[_0xea7e('0x3f')][_0xea7e('0x40')]?_0x25b5f6[_0xea7e('0x3f')]:_0x124609[_0xea7e('0x3b')];_0x25b5f6[_0xea7e('0x42')]=qs[_0xea7e('0x43')](_0x4d0bf2[_0xea7e('0x3c')]['sort']);_0x25b5f6[_0xea7e('0x44')]=qs[_0xea7e('0x45')](_['pick'](_0x4d0bf2['query'],_0x124609[_0xea7e('0x45')]));if(_0x4d0bf2[_0xea7e('0x3c')][_0xea7e('0x2b')]){_0x25b5f6['where']=_[_0xea7e('0x47')](_0x25b5f6[_0xea7e('0x44')],{'$or':_[_0xea7e('0x36')](_0x25b5f6[_0xea7e('0x3f')],function(_0x36ae6f){var _0x26c13d={};_0x26c13d[_0x36ae6f]={'$like':'%'+_0x4d0bf2[_0xea7e('0x3c')][_0xea7e('0x2b')]+'%'};return _0x26c13d;})});}_0x25b5f6=_[_0xea7e('0x47')]({},_0x25b5f6,_0x4d0bf2[_0xea7e('0x4c')]);return _0x22e8aa[_0xea7e('0x9a')](_0x25b5f6);}})[_0xea7e('0x24')](function(_0x4881d0){if(_0x4881d0){_0x523fa5=_0x4881d0[_0xea7e('0x40')];if(!_0x4d0bf2[_0xea7e('0x3c')][_0xea7e('0x62')]('nolimit')){_0x25b5f6[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x4d0bf2[_0xea7e('0x3c')][_0xea7e('0x1f')]);_0x25b5f6[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x4d0bf2[_0xea7e('0x3c')][_0xea7e('0x1c')]);}return _0x22e8aa[_0xea7e('0x9a')](_0x25b5f6);}})['then'](function(_0x2ea6de){if(_0x2ea6de){return _0x2ea6de?{'count':_0x523fa5,'rows':_0x2ea6de}:null;}})[_0xea7e('0x24')](respondWithResult(_0x469612,null))['catch'](handleError(_0x469612,null));};exports[_0xea7e('0x9b')]=function(_0x210f3e,_0x448388,_0x24d1c1){var _0x207a7c=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1a1ff8,_0x2764f7;return db[_0xea7e('0x37')][_0xea7e('0x4d')]({'where':{'id':_0x210f3e[_0xea7e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x448388,null))[_0xea7e('0x24')](function(_0x1d9992){if(_0x1d9992){_0x2764f7=_0x1d9992;return _0x1d9992[_0xea7e('0x9b')](_0x210f3e[_0xea7e('0x4f')][_0xea7e('0x7f')],_[_0xea7e('0x57')](_0x210f3e[_0xea7e('0x4f')],[_0xea7e('0x7f'),'id'])||{});}return null;})[_0xea7e('0x93')](function(_0x26a226){var _0x5891fe;_0x1a1ff8=_0x26a226||[];var _0x5d599f=[];if(_0x26a226){for(var _0x20f41f=0x0;_0x20f41f<_0x26a226[_0xea7e('0x40')];_0x20f41f+=0x1){var _0x4c5463=_0x26a226[_0x20f41f][_0xea7e('0x26')]({'plain':!![]});_0x2764f7['dialCheckDuplicateType']=_0x210f3e[_0xea7e('0x4f')][_0xea7e('0x9c')]?_0x210f3e[_0xea7e('0x4f')][_0xea7e('0x9c')]:_0x2764f7[_0xea7e('0x9c')];switch(_0x2764f7['dialCheckDuplicateType']){case'always':_0x5891fe=squel[_0xea7e('0x9d')]()[_0xea7e('0x9e')](_0xea7e('0x9f'))['fromQuery'](['phone',_0xea7e('0xa0'),_0xea7e('0xa1'),_0xea7e('0xa2'),_0xea7e('0x5f'),_0xea7e('0x59'),_0xea7e('0x58')],squel[_0xea7e('0xa3')]()[_0xea7e('0x80')]('phone','phone')[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0xa0'))[_0xea7e('0x80')]('id',_0xea7e('0xa1'))['field'](_0x4c5463[_0xea7e('0xa4')]['toString'](),_0xea7e('0xa2'))[_0xea7e('0x80')](_0x210f3e[_0xea7e('0x4a')]['id'][_0xea7e('0xa5')](),_0xea7e('0x5f'))[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27','createdAt')['field']('\x27'+_0x207a7c+'\x27',_0xea7e('0x58'))['from'](_0xea7e('0xa6'))[_0xea7e('0x44')]('deletedAt\x20IS\x20NULL')[_0xea7e('0x44')]('ListId\x20=\x20?',_0x4c5463[_0xea7e('0xa4')][_0xea7e('0xa5')]())[_0xea7e('0x44')](_0xea7e('0xa7'))[_0xea7e('0x44')](_0xea7e('0xa8'),squel['select']()['field'](_0xea7e('0xa9'))[_0xea7e('0x82')]('cm_hopper_final')[_0xea7e('0x44')](_0xea7e('0x85'),_0x210f3e[_0xea7e('0x4a')]['id']['toString']()))[_0xea7e('0x44')](_0xea7e('0xa8'),squel[_0xea7e('0xa3')]()['field'](_0xea7e('0xaa'))['from']('cm_hopper')[_0xea7e('0x44')](_0xea7e('0x85'),_0x210f3e[_0xea7e('0x4a')]['id'][_0xea7e('0xa5')]())))[_0xea7e('0xa5')]();break;case _0xea7e('0xab'):_0x5891fe=squel[_0xea7e('0x9d')]()[_0xea7e('0x9e')](_0xea7e('0x9f'))['fromQuery']([_0xea7e('0xac'),'scheduledAt',_0xea7e('0xa1'),'ListId',_0xea7e('0x5f'),_0xea7e('0x59'),_0xea7e('0x58')],squel[_0xea7e('0xa3')]()[_0xea7e('0x80')](_0xea7e('0xac'),_0xea7e('0xac'))[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0xa0'))[_0xea7e('0x80')]('id',_0xea7e('0xa1'))[_0xea7e('0x80')](_0x4c5463[_0xea7e('0xa4')]['toString'](),_0xea7e('0xa2'))[_0xea7e('0x80')](_0x210f3e[_0xea7e('0x4a')]['id'][_0xea7e('0xa5')](),_0xea7e('0x5f'))[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0x59'))[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0x58'))[_0xea7e('0x82')]('cm_contacts')[_0xea7e('0x44')]('deletedAt\x20IS\x20NULL')[_0xea7e('0x44')](_0xea7e('0xad'),_0x4c5463['CmListId'][_0xea7e('0xa5')]())[_0xea7e('0x44')](_0xea7e('0xa7'))['where'](_0xea7e('0xa8'),squel[_0xea7e('0xa3')]()[_0xea7e('0x80')](_0xea7e('0xaa'))['from']('cm_hopper')['where'](_0xea7e('0x85'),_0x210f3e[_0xea7e('0x4a')]['id'][_0xea7e('0xa5')]())))[_0xea7e('0xa5')]();break;default:_0x5891fe=squel['insert']()['into'](_0xea7e('0x9f'))['fromQuery']([_0xea7e('0xac'),_0xea7e('0xa0'),'ContactId',_0xea7e('0xa2'),_0xea7e('0x5f'),_0xea7e('0x59'),_0xea7e('0x58')],squel['select']()[_0xea7e('0x80')](_0xea7e('0xac'),_0xea7e('0xac'))[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0xa0'))['field']('id','ContactId')[_0xea7e('0x80')](_0x4c5463[_0xea7e('0xa4')][_0xea7e('0xa5')](),_0xea7e('0xa2'))[_0xea7e('0x80')](_0x210f3e[_0xea7e('0x4a')]['id'][_0xea7e('0xa5')](),'VoiceQueueId')['field']('\x27'+_0x207a7c+'\x27',_0xea7e('0x59'))[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0x58'))['from'](_0xea7e('0xa6'))[_0xea7e('0x44')]('deletedAt\x20IS\x20NULL')[_0xea7e('0x44')](_0xea7e('0xad'),_0x4c5463[_0xea7e('0xa4')][_0xea7e('0xa5')]())[_0xea7e('0x44')](_0xea7e('0xa7')))[_0xea7e('0xa5')]();}_0x5d599f[_0xea7e('0x87')](db['sequelize'][_0xea7e('0x3c')](_0x5891fe));}return BPromise[_0xea7e('0x8c')](_0x5d599f);}})[_0xea7e('0x24')](function(){var _0x2c1e20=[];var _0x5597f1=squel['insert']()[_0xea7e('0x9e')](_0xea7e('0xae'))[_0xea7e('0xaf')]([_0xea7e('0xb0'),_0xea7e('0xac'),_0xea7e('0xb1'),_0xea7e('0x59'),'updatedAt'],squel[_0xea7e('0xa3')]()[_0xea7e('0x80')]('h.id')['field']('ci.item')['field'](_0xea7e('0xb2'))['field']('\x27'+_0x207a7c+'\x27','createdAt')[_0xea7e('0x80')]('\x27'+_0x207a7c+'\x27',_0xea7e('0x58'))[_0xea7e('0x82')]('cm_contact_has_items','ci')['join'](_0xea7e('0x9f'),'h','h.ContactId=ci.CmContactId')[_0xea7e('0x44')](_0xea7e('0xb3'),_0x207a7c)[_0xea7e('0x44')](_0xea7e('0xb4'),_0xea7e('0xb5')))[_0xea7e('0xa5')]();_0x2c1e20[_0xea7e('0x87')](db['sequelize'][_0xea7e('0x3c')](_0x5597f1));return BPromise[_0xea7e('0x8c')](_0x2c1e20);})[_0xea7e('0x24')](function(){return _0x1a1ff8;})[_0xea7e('0x24')](respondWithResult(_0x448388,null))[_0xea7e('0x49')](handleError(_0x448388,null));};exports[_0xea7e('0xb6')]=function(_0x329a3c,_0x2af7ba,_0x3cbc95){return db['VoiceQueue'][_0xea7e('0x4d')]({'where':{'id':_0x329a3c[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x2af7ba,null))[_0xea7e('0x24')](function(_0x4541cd){if(_0x4541cd){return _0x4541cd[_0xea7e('0xb6')](_0x329a3c[_0xea7e('0x3c')]['ids']);}})[_0xea7e('0x24')](function(_0x590a97){if(_0x590a97){return db['CmHopper'][_0xea7e('0x25')]({'where':{'ListId':_0x329a3c[_0xea7e('0x3c')][_0xea7e('0x7f')],'VoiceQueueId':_0x329a3c[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](function(){return _0x590a97;});}})[_0xea7e('0x24')](respondWithStatusCode(_0x2af7ba,null))[_0xea7e('0x49')](handleError(_0x2af7ba,null));};exports['getBlackLists']=function(_0x4d12ff,_0x124173,_0x19aca0){var _0x72b940={};var _0x5ad505={};var _0x10dc38;var _0x36d1cc;return db['VoiceQueue']['findOne']({'where':{'id':_0x4d12ff[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x124173,null))[_0xea7e('0x24')](function(_0x4f21f9){if(_0x4f21f9){_0x10dc38=_0x4f21f9;_0x5ad505[_0xea7e('0x3b')]=_[_0xea7e('0x3d')](db[_0xea7e('0x99')]['rawAttributes']);_0x5ad505[_0xea7e('0x3c')]=_[_0xea7e('0x3d')](_0x4d12ff['query']);_0x5ad505[_0xea7e('0x45')]=_[_0xea7e('0x3e')](_0x5ad505['model'],_0x5ad505['query']);_0x72b940['attributes']=_[_0xea7e('0x3e')](_0x5ad505[_0xea7e('0x3b')],qs['fields'](_0x4d12ff[_0xea7e('0x3c')]['fields']));_0x72b940['attributes']=_0x72b940['attributes'][_0xea7e('0x40')]?_0x72b940[_0xea7e('0x3f')]:_0x5ad505[_0xea7e('0x3b')];_0x72b940[_0xea7e('0x42')]=qs[_0xea7e('0x43')](_0x4d12ff[_0xea7e('0x3c')][_0xea7e('0x43')]);_0x72b940['where']=qs[_0xea7e('0x45')](_[_0xea7e('0x46')](_0x4d12ff[_0xea7e('0x3c')],_0x5ad505[_0xea7e('0x45')]));if(_0x4d12ff[_0xea7e('0x3c')]['filter']){_0x72b940['where']=_['merge'](_0x72b940['where'],{'$or':_[_0xea7e('0x36')](_0x72b940[_0xea7e('0x3f')],function(_0x3e3849){var _0x52bb75={};_0x52bb75[_0x3e3849]={'$like':'%'+_0x4d12ff[_0xea7e('0x3c')][_0xea7e('0x2b')]+'%'};return _0x52bb75;})});}_0x72b940=_['merge']({},_0x72b940,_0x4d12ff[_0xea7e('0x4c')]);return _0x10dc38['getBlackLists'](_0x72b940);}})[_0xea7e('0x24')](function(_0x4988f3){if(_0x4988f3){_0x36d1cc=_0x4988f3[_0xea7e('0x40')];if(!_0x4d12ff[_0xea7e('0x3c')][_0xea7e('0x62')](_0xea7e('0x41'))){_0x72b940[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x4d12ff['query'][_0xea7e('0x1f')]);_0x72b940['offset']=qs[_0xea7e('0x1c')](_0x4d12ff[_0xea7e('0x3c')][_0xea7e('0x1c')]);}return _0x10dc38[_0xea7e('0xb7')](_0x72b940);}})['then'](function(_0x302690){if(_0x302690){return _0x302690?{'count':_0x36d1cc,'rows':_0x302690}:null;}})[_0xea7e('0x24')](respondWithResult(_0x124173,null))[_0xea7e('0x49')](handleError(_0x124173,null));};exports[_0xea7e('0xb8')]=function(_0x503e30,_0x314b04,_0x5e3dc0){var _0x5bf993,_0x2358a1;return db[_0xea7e('0x37')][_0xea7e('0x4d')]({'where':{'id':_0x503e30[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x314b04,null))['then'](function(_0x44f1e1){if(_0x44f1e1){_0x2358a1=_0x44f1e1;return _0x44f1e1[_0xea7e('0xb8')](_0x503e30[_0xea7e('0x4f')]['ids'],_[_0xea7e('0x57')](_0x503e30[_0xea7e('0x4f')],[_0xea7e('0x7f'),'id'])||{});}return null;})[_0xea7e('0x93')](function(_0x15b80e){var _0x32758d;_0x5bf993=_0x15b80e||[];var _0x3595a8=[];if(_0x15b80e){for(var _0x4c08d0=0x0;_0x4c08d0<_0x15b80e[_0xea7e('0x40')];_0x4c08d0+=0x1){var _0x10ba65=_0x15b80e[_0x4c08d0][_0xea7e('0x26')]({'plain':!![]});_0x32758d=squel[_0xea7e('0x9d')]()['into'](_0xea7e('0xb9'))[_0xea7e('0xaf')](['phone',_0xea7e('0xa1'),_0xea7e('0xa2'),'VoiceQueueId',_0xea7e('0x59'),'updatedAt'],squel['select']()[_0xea7e('0x80')](_0xea7e('0xac'),_0xea7e('0xac'))[_0xea7e('0x80')]('id',_0xea7e('0xa1'))[_0xea7e('0x80')](_0x10ba65[_0xea7e('0xa4')]['toString'](),_0xea7e('0xa2'))['field'](_0x503e30[_0xea7e('0x4a')]['id'][_0xea7e('0xa5')](),_0xea7e('0x5f'))['field'](_0xea7e('0xba'),_0xea7e('0x59'))[_0xea7e('0x80')](_0xea7e('0xba'),'updatedAt')[_0xea7e('0x82')](_0xea7e('0xa6'))['where'](_0xea7e('0xbb'))['where'](_0xea7e('0xad'),_0x10ba65[_0xea7e('0xa4')][_0xea7e('0xa5')]())[_0xea7e('0x44')](_0xea7e('0xa7')))['toString']();_0x3595a8['push'](db[_0xea7e('0x73')][_0xea7e('0x3c')](_0x32758d));}return BPromise[_0xea7e('0x8c')](_0x3595a8);}})['then'](function(){return _0x5bf993;})['then'](respondWithResult(_0x314b04,null))[_0xea7e('0x49')](handleError(_0x314b04,null));};exports[_0xea7e('0xbc')]=function(_0xd80c44,_0x2f4321,_0x586f5f){return db[_0xea7e('0x37')][_0xea7e('0x4d')]({'where':{'id':_0xd80c44[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x2f4321,null))[_0xea7e('0x24')](function(_0x529676){if(_0x529676){return _0x529676[_0xea7e('0xbc')](_0xd80c44['query']['ids']);}})['then'](function(_0x48e6cb){if(_0x48e6cb){return db['CmHopperBlack'][_0xea7e('0x25')]({'where':{'ListId':_0xd80c44['query'][_0xea7e('0x7f')],'VoiceQueueId':_0xd80c44[_0xea7e('0x4a')]['id']}})[_0xea7e('0x24')](function(){return _0x48e6cb;});}})['then'](respondWithStatusCode(_0x2f4321,null))[_0xea7e('0x49')](handleError(_0x2f4321,null));}; \ No newline at end of file +var _0x39d2=['userVoiceQueue:remove','addAgents','ids','spread','push','isNil','removeAgents','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','scheduledAt','ContactId','phone','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','VoiceQueues','outbound','ignore','includes','type','find','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceQueue','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','catch','params','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','value','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','omit','QueueCampaigns','getHoppers','findOne','CmHopper','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','flatMap','forEach','penalty','TeamVoiceQueue','findOrCreate','each','UserVoiceQueueRt','upsert','interface','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','sequelize','toString','SELECT','every','all','compact','transaction','isEmpty'];(function(_0x160f00,_0x3d0338){var _0x2cd66a=function(_0x10bf67){while(--_0x10bf67){_0x160f00['push'](_0x160f00['shift']());}};_0x2cd66a(++_0x3d0338);}(_0x39d2,0xf5));var _0x239d=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x39d2[_0x421cf8];return _0x145c48;};'use strict';var emlformat=require(_0x239d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x239d('0x1'));var jsonpatch=require(_0x239d('0x2'));var rp=require(_0x239d('0x3'));var moment=require(_0x239d('0x4'));var BPromise=require(_0x239d('0x5'));var Mustache=require(_0x239d('0x6'));var util=require(_0x239d('0x7'));var path=require(_0x239d('0x8'));var sox=require(_0x239d('0x9'));var csv=require(_0x239d('0xa'));var ejs=require(_0x239d('0xb'));var fs=require('fs');var fs_extra=require(_0x239d('0xc'));var _=require(_0x239d('0xd'));var squel=require('squel');var crypto=require(_0x239d('0xe'));var jsforce=require(_0x239d('0xf'));var deskjs=require(_0x239d('0x10'));var toCsv=require(_0x239d('0xa'));var querystring=require(_0x239d('0x11'));var Papa=require(_0x239d('0x12'));var Redis=require(_0x239d('0x13'));var authService=require(_0x239d('0x14'));var qs=require(_0x239d('0x15'));var as=require(_0x239d('0x16'));var hardwareService=require(_0x239d('0x17'));var logger=require(_0x239d('0x18'))(_0x239d('0x19'));var utils=require(_0x239d('0x1a'));var config=require(_0x239d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x239d('0x1c')]=_[_0x239d('0x1d')](config[_0x239d('0x1c')],{'host':_0x239d('0x1e'),'port':0x18eb});var socket=require(_0x239d('0x1f'))(new Redis(config[_0x239d('0x1c')]));require(_0x239d('0x20'))[_0x239d('0x21')](socket);function respondWithStatusCode(_0x269134,_0x5506b5){_0x5506b5=_0x5506b5||0xcc;return function(_0x27303b){if(_0x27303b){return _0x269134[_0x239d('0x22')](_0x5506b5);}return _0x269134[_0x239d('0x23')](_0x5506b5)[_0x239d('0x24')]();};}function respondWithResult(_0x132915,_0x4d1d18){_0x4d1d18=_0x4d1d18||0xc8;return function(_0x5e9e0e){if(_0x5e9e0e){return _0x132915[_0x239d('0x23')](_0x4d1d18)['json'](_0x5e9e0e);}};}function respondWithFilteredResult(_0x1b62eb,_0x47bec3){return function(_0x33f01d){if(_0x33f01d){var _0x39627f=typeof _0x47bec3[_0x239d('0x25')]===_0x239d('0x26')&&typeof _0x47bec3[_0x239d('0x27')]===_0x239d('0x26');var _0x2b1130=_0x33f01d[_0x239d('0x28')];var _0x49b100=_0x39627f?0x0:_0x47bec3[_0x239d('0x25')];var _0x4ef1a0=_0x39627f?_0x33f01d[_0x239d('0x28')]:_0x47bec3[_0x239d('0x25')]+_0x47bec3[_0x239d('0x27')];var _0x5abe81;if(_0x4ef1a0>=_0x2b1130){_0x4ef1a0=_0x2b1130;_0x5abe81=0xc8;}else{_0x5abe81=0xce;}_0x1b62eb[_0x239d('0x23')](_0x5abe81);return _0x1b62eb[_0x239d('0x29')](_0x239d('0x2a'),_0x49b100+'-'+_0x4ef1a0+'/'+_0x2b1130)[_0x239d('0x2b')](_0x33f01d);}return null;};}function patchUpdates(_0xb77bfe){return function(_0xc2c8da){try{jsonpatch[_0x239d('0x2c')](_0xc2c8da,_0xb77bfe,!![]);}catch(_0x2b8ad0){return BPromise[_0x239d('0x2d')](_0x2b8ad0);}return _0xc2c8da['save']();};}function saveUpdates(_0x13131e,_0x46e66f){return function(_0x1d8be6){if(_0x1d8be6){return _0x1d8be6[_0x239d('0x2e')](_0x13131e)[_0x239d('0x2f')](function(_0x72802){return _0x72802;});}return null;};}function removeEntity(_0xe97415,_0x281f57){return function(_0x44947c){if(_0x44947c){return _0x44947c['destroy']()[_0x239d('0x2f')](function(){var _0x395cc4=_0x44947c['get']({'plain':!![]});var _0x4e3a77=[{'name':_0x239d('0x30'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0x239d('0x31'),'ignore':![]}];var _0x1ba3a0=_(_0x4e3a77)['filter'](_0x239d('0x32'))['map']('value')['value']();if(_[_0x239d('0x33')](_0x1ba3a0,_0x395cc4[_0x239d('0x34')])){return;}var _0x19bd2e=_[_0x239d('0x35')](_0x4e3a77,['value',_0x395cc4['type']])['name'];return db[_0x239d('0x36')][_0x239d('0x37')]({'where':{'type':_0x19bd2e,'resourceId':_0x395cc4['id']}})[_0x239d('0x2f')](function(){return _0x44947c;});})[_0x239d('0x2f')](function(){_0xe97415['status'](0xcc)[_0x239d('0x24')]();});}};}function handleEntityNotFound(_0x17c909,_0x384469){return function(_0x2c3927){if(!_0x2c3927){_0x17c909[_0x239d('0x22')](0x194);}return _0x2c3927;};}function handleError(_0x5bdba6,_0x3ab632){_0x3ab632=_0x3ab632||0x1f4;return function(_0x30e59f){logger[_0x239d('0x38')](_0x30e59f[_0x239d('0x39')]);if(_0x30e59f[_0x239d('0x3a')]){delete _0x30e59f[_0x239d('0x3a')];}_0x5bdba6[_0x239d('0x23')](_0x3ab632)[_0x239d('0x3b')](_0x30e59f);};}exports[_0x239d('0x3c')]=function(_0x6c73fc,_0x2f6c73){var _0x257d21={},_0x4a3725={},_0x162048={'count':0x0,'rows':[]};var _0x260eb2=_[_0x239d('0x3d')](db[_0x239d('0x3e')][_0x239d('0x3f')],function(_0x1b29ed){return{'name':_0x1b29ed['fieldName'],'type':_0x1b29ed[_0x239d('0x34')]['key']};});_0x4a3725[_0x239d('0x40')]=_[_0x239d('0x3d')](_0x260eb2,'name');_0x4a3725[_0x239d('0x41')]=_[_0x239d('0x42')](_0x6c73fc[_0x239d('0x41')]);_0x4a3725[_0x239d('0x43')]=_['intersection'](_0x4a3725['model'],_0x4a3725[_0x239d('0x41')]);_0x257d21[_0x239d('0x44')]=_[_0x239d('0x45')](_0x4a3725[_0x239d('0x40')],qs[_0x239d('0x46')](_0x6c73fc['query']['fields']));_0x257d21[_0x239d('0x44')]=_0x257d21['attributes'][_0x239d('0x47')]?_0x257d21['attributes']:_0x4a3725[_0x239d('0x40')];if(!_0x6c73fc['query'][_0x239d('0x48')](_0x239d('0x49'))){_0x257d21[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x6c73fc['query'][_0x239d('0x27')]);_0x257d21[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x6c73fc[_0x239d('0x41')][_0x239d('0x25')]);}_0x257d21[_0x239d('0x4a')]=qs[_0x239d('0x4b')](_0x6c73fc['query'][_0x239d('0x4b')]);_0x257d21[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x6c73fc[_0x239d('0x41')],_0x4a3725[_0x239d('0x43')]),_0x260eb2);if(_0x6c73fc[_0x239d('0x41')][_0x239d('0x4e')]){_0x257d21[_0x239d('0x4c')]=_[_0x239d('0x4f')](_0x257d21['where'],{'$or':_[_0x239d('0x3d')](_0x260eb2,function(_0x5b9082){if(_0x5b9082[_0x239d('0x34')]!=='VIRTUAL'){var _0x1734c4={};_0x1734c4[_0x5b9082[_0x239d('0x3a')]]={'$like':'%'+_0x6c73fc[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x1734c4;}})});}_0x257d21=_[_0x239d('0x4f')]({},_0x257d21,_0x6c73fc['options']);var _0x495d33={'where':_0x257d21[_0x239d('0x4c')]};return db[_0x239d('0x3e')][_0x239d('0x28')](_0x495d33)[_0x239d('0x2f')](function(_0x4c7d4e){_0x162048[_0x239d('0x28')]=_0x4c7d4e;if(_0x6c73fc[_0x239d('0x41')][_0x239d('0x50')]){_0x257d21['include']=[{'all':!![]}];}return db[_0x239d('0x3e')][_0x239d('0x51')](_0x257d21);})[_0x239d('0x2f')](function(_0x2643ae){_0x162048['rows']=_0x2643ae;return _0x162048;})[_0x239d('0x2f')](respondWithFilteredResult(_0x2f6c73,_0x257d21))[_0x239d('0x52')](handleError(_0x2f6c73,null));};exports['show']=function(_0x4abb23,_0x4e039a){var _0x220723={'raw':![],'where':{'id':_0x4abb23[_0x239d('0x53')]['id']}},_0x2b50c0={};_0x2b50c0[_0x239d('0x40')]=_['keys'](db['VoiceQueue'][_0x239d('0x3f')]);_0x2b50c0[_0x239d('0x41')]=_['keys'](_0x4abb23[_0x239d('0x41')]);_0x2b50c0[_0x239d('0x43')]=_['intersection'](_0x2b50c0[_0x239d('0x40')],_0x2b50c0[_0x239d('0x41')]);_0x220723[_0x239d('0x44')]=_['intersection'](_0x2b50c0[_0x239d('0x40')],qs[_0x239d('0x46')](_0x4abb23['query']['fields']));_0x220723[_0x239d('0x44')]=_0x220723['attributes'][_0x239d('0x47')]?_0x220723[_0x239d('0x44')]:_0x2b50c0[_0x239d('0x40')];if(_0x4abb23[_0x239d('0x41')][_0x239d('0x50')]){_0x220723['include']=[{'all':!![]}];}_0x220723=_['merge']({},_0x220723,_0x4abb23[_0x239d('0x54')]);return db['VoiceQueue'][_0x239d('0x35')](_0x220723)[_0x239d('0x2f')](handleEntityNotFound(_0x4e039a,null))[_0x239d('0x2f')](respondWithResult(_0x4e039a,null))[_0x239d('0x52')](handleError(_0x4e039a,null));};exports[_0x239d('0x55')]=function(_0x431093,_0x528542){return db[_0x239d('0x3e')][_0x239d('0x55')](_0x431093[_0x239d('0x56')],{})[_0x239d('0x2f')](function(_0x3b6477){var _0x559db1=_0x431093['user'][_0x239d('0x57')]({'plain':!![]});if(!_0x559db1)throw new Error(_0x239d('0x58'));if(_0x559db1[_0x239d('0x59')]===_0x239d('0x5a')){var _0x401fd0=_0x3b6477[_0x239d('0x57')]({'plain':!![]});var _0x3d5313=[{'name':_0x239d('0x30'),'value':_0x239d('0x5b')},{'name':'QueueCampaigns','value':_0x239d('0x31')}];var _0x4d762f=_[_0x239d('0x35')](_0x3d5313,[_0x239d('0x5c'),_0x401fd0[_0x239d('0x34')]])[_0x239d('0x3a')];return db[_0x239d('0x5d')][_0x239d('0x35')]({'where':{'name':_0x4d762f,'userProfileId':_0x559db1[_0x239d('0x5e')]},'raw':!![]})['then'](function(_0x46b162){if(_0x46b162&&_0x46b162[_0x239d('0x5f')]===0x0){return db[_0x239d('0x36')][_0x239d('0x55')]({'name':_0x401fd0[_0x239d('0x3a')],'resourceId':_0x401fd0['id'],'type':_0x46b162['name'],'sectionId':_0x46b162['id']},{})[_0x239d('0x2f')](function(){return _0x3b6477;});}else{return _0x3b6477;}})[_0x239d('0x52')](function(_0x2eb35e){logger[_0x239d('0x38')](_0x239d('0x60'),_0x2eb35e);throw _0x2eb35e;});}return _0x3b6477;})[_0x239d('0x2f')](respondWithResult(_0x528542,0xc9))['catch'](handleError(_0x528542,null));};exports[_0x239d('0x61')]=function(_0x1629be,_0x16b0b3){var _0x29890d={'where':{'id':_0x1629be[_0x239d('0x53')]['id']}},_0x119cbb={};_0x119cbb[_0x239d('0x40')]=_[_0x239d('0x42')](db[_0x239d('0x3e')][_0x239d('0x3f')]);_0x29890d['attributes']=_[_0x239d('0x45')](_0x119cbb[_0x239d('0x40')],qs[_0x239d('0x46')](_0x1629be['query'][_0x239d('0x46')]));_0x29890d[_0x239d('0x44')]=_0x29890d[_0x239d('0x44')]['length']?_0x29890d[_0x239d('0x44')]:_0x119cbb[_0x239d('0x40')];if(_0x1629be['query'][_0x239d('0x50')]){_0x29890d[_0x239d('0x62')]=[{'all':!![]}];}_0x29890d=_[_0x239d('0x4f')]({},_0x29890d,_0x1629be[_0x239d('0x54')]);return db[_0x239d('0x3e')][_0x239d('0x35')](_0x29890d)['then'](handleEntityNotFound(_0x16b0b3,null))[_0x239d('0x2f')](function(_0x5b4d11){if(_0x5b4d11){var _0x15a3ef=_0x5b4d11['get']({'plain':!![]});_0x15a3ef=qs['omit'](_0x15a3ef,['id',_0x239d('0x63'),_0x239d('0x64')]);_0x1629be[_0x239d('0x56')]=_[_0x239d('0x65')](_0x1629be[_0x239d('0x56')],['id',_0x239d('0x63'),_0x239d('0x64')]);return db[_0x239d('0x3e')][_0x239d('0x55')](_[_0x239d('0x4f')](_0x15a3ef,_0x1629be['body']),{'include':_0x1629be[_0x239d('0x41')][_0x239d('0x50')]?[{'all':!![]}]:undefined})[_0x239d('0x2f')](function(_0xf0073a){var _0x5331bc=_0x1629be[_0x239d('0x5a')][_0x239d('0x57')]({'plain':!![]});if(!_0x5331bc)throw new Error(_0x239d('0x58'));if(_0x5331bc[_0x239d('0x59')]===_0x239d('0x5a')){var _0x1a3526=_0xf0073a[_0x239d('0x57')]({'plain':!![]});var _0x5a677b=[{'name':_0x239d('0x30'),'value':'inbound'},{'name':_0x239d('0x66'),'value':'outbound'}];var _0x427001=_[_0x239d('0x35')](_0x5a677b,[_0x239d('0x5c'),_0x1a3526[_0x239d('0x34')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x427001,'userProfileId':_0x5331bc[_0x239d('0x5e')]},'raw':!![]})[_0x239d('0x2f')](function(_0x5c818f){if(_0x5c818f&&_0x5c818f['autoAssociation']===0x0){return db[_0x239d('0x36')]['create']({'name':_0x1a3526[_0x239d('0x3a')],'resourceId':_0x1a3526['id'],'type':_0x5c818f['name'],'sectionId':_0x5c818f['id']},{})[_0x239d('0x2f')](function(){return _0xf0073a;});}else{return _0xf0073a;}})['catch'](function(_0x1eb570){logger['error'](_0x239d('0x60'),_0x1eb570);throw _0x1eb570;});}return _0xf0073a;});}})[_0x239d('0x2f')](respondWithResult(_0x16b0b3,0xc9))[_0x239d('0x52')](handleError(_0x16b0b3,null));};exports[_0x239d('0x2e')]=function(_0x495bac,_0x2eb626){if(_0x495bac[_0x239d('0x56')]['id']){delete _0x495bac[_0x239d('0x56')]['id'];}return db[_0x239d('0x3e')][_0x239d('0x35')]({'where':{'id':_0x495bac['params']['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x2eb626,null))[_0x239d('0x2f')](saveUpdates(_0x495bac['body'],null))[_0x239d('0x2f')](respondWithResult(_0x2eb626,null))[_0x239d('0x52')](handleError(_0x2eb626,null));};exports['destroy']=function(_0x19cf97,_0xba8512){return db[_0x239d('0x3e')][_0x239d('0x35')]({'where':{'id':_0x19cf97['params']['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0xba8512,null))['then'](removeEntity(_0xba8512,null))['catch'](handleError(_0xba8512,null));};exports[_0x239d('0x67')]=function(_0x391f9f,_0x5dac81,_0x44de7c){var _0x3c9458={'raw':![],'where':{}};var _0x4d4a05={};var _0x5821ce={'count':0x0,'rows':[]};return db[_0x239d('0x3e')][_0x239d('0x68')]({'where':{'id':_0x391f9f[_0x239d('0x53')]['id']}})['then'](handleEntityNotFound(_0x5dac81,null))[_0x239d('0x2f')](function(_0x3e3bb8){if(_0x3e3bb8){_0x4d4a05[_0x239d('0x40')]=_[_0x239d('0x42')](db[_0x239d('0x69')][_0x239d('0x3f')]);_0x4d4a05[_0x239d('0x41')]=_[_0x239d('0x42')](_0x391f9f[_0x239d('0x41')]);_0x4d4a05[_0x239d('0x43')]=_['intersection'](_0x4d4a05[_0x239d('0x40')],_0x4d4a05[_0x239d('0x41')]);_0x3c9458[_0x239d('0x44')]=_[_0x239d('0x45')](_0x4d4a05[_0x239d('0x40')],qs[_0x239d('0x46')](_0x391f9f[_0x239d('0x41')][_0x239d('0x46')]));_0x3c9458[_0x239d('0x44')]=_0x3c9458[_0x239d('0x44')][_0x239d('0x47')]?_0x3c9458[_0x239d('0x44')]:_0x4d4a05[_0x239d('0x40')];if(!_0x391f9f[_0x239d('0x41')][_0x239d('0x48')]('nolimit')){_0x3c9458['limit']=qs[_0x239d('0x27')](_0x391f9f[_0x239d('0x41')][_0x239d('0x27')]);_0x3c9458[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x391f9f[_0x239d('0x41')][_0x239d('0x25')]);}_0x3c9458['order']=qs[_0x239d('0x4b')](_0x391f9f[_0x239d('0x41')][_0x239d('0x4b')]);_0x3c9458[_0x239d('0x4c')]=qs['filters'](_[_0x239d('0x4d')](_0x391f9f[_0x239d('0x41')],_0x4d4a05['filters']));_0x3c9458[_0x239d('0x4c')]['VoiceQueueId']=_0x3e3bb8['id'];if(_0x391f9f[_0x239d('0x41')][_0x239d('0x4e')]){_0x3c9458[_0x239d('0x4c')]=_[_0x239d('0x4f')](_0x3c9458['where'],{'$or':_[_0x239d('0x3d')](_0x3c9458[_0x239d('0x44')],function(_0x58a4a0){var _0x258499={};_0x258499[_0x58a4a0]={'$like':'%'+_0x391f9f[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x258499;})});}_0x3c9458=_[_0x239d('0x4f')]({},_0x3c9458,_0x391f9f[_0x239d('0x54')]);return db[_0x239d('0x69')][_0x239d('0x28')]({'where':_0x3c9458['where']})[_0x239d('0x2f')](function(_0x55438a){_0x5821ce[_0x239d('0x28')]=_0x55438a;if(_0x391f9f[_0x239d('0x41')]['includeAll']){_0x3c9458[_0x239d('0x62')]=[{'all':!![]}];}return db[_0x239d('0x69')]['findAll'](_0x3c9458);})[_0x239d('0x2f')](function(_0x10f53c){_0x5821ce['rows']=_0x10f53c;return _0x5821ce;});}})[_0x239d('0x2f')](respondWithFilteredResult(_0x5dac81,_0x3c9458))['catch'](handleError(_0x5dac81,null));};exports['getHopperHistories']=function(_0x3a8496,_0x3da31a,_0x10719c){var _0x17fa54={'raw':!![],'where':{}};var _0x1b4e78={};var _0x38c8fb={'count':0x0,'rows':[]};return db[_0x239d('0x3e')]['findOne']({'where':{'id':_0x3a8496[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x3da31a,null))[_0x239d('0x2f')](function(_0x48a735){if(_0x48a735){_0x1b4e78[_0x239d('0x40')]=_[_0x239d('0x42')](db[_0x239d('0x6a')]['rawAttributes']);_0x1b4e78[_0x239d('0x41')]=_['keys'](_0x3a8496[_0x239d('0x41')]);_0x1b4e78[_0x239d('0x43')]=_[_0x239d('0x45')](_0x1b4e78['model'],_0x1b4e78[_0x239d('0x41')]);_0x17fa54[_0x239d('0x44')]=_[_0x239d('0x45')](_0x1b4e78[_0x239d('0x40')],qs[_0x239d('0x46')](_0x3a8496['query'][_0x239d('0x46')]));_0x17fa54['attributes']=_0x17fa54[_0x239d('0x44')][_0x239d('0x47')]?_0x17fa54[_0x239d('0x44')]:_0x1b4e78[_0x239d('0x40')];if(!_0x3a8496[_0x239d('0x41')]['hasOwnProperty'](_0x239d('0x49'))){_0x17fa54[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x3a8496[_0x239d('0x41')][_0x239d('0x27')]);_0x17fa54['offset']=qs['offset'](_0x3a8496[_0x239d('0x41')][_0x239d('0x25')]);}_0x17fa54[_0x239d('0x4a')]=qs['sort'](_0x3a8496[_0x239d('0x41')]['sort']);_0x17fa54[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x3a8496[_0x239d('0x41')],_0x1b4e78[_0x239d('0x43')]));_0x17fa54[_0x239d('0x4c')]['VoiceQueueId']=_0x48a735['id'];if(_0x3a8496[_0x239d('0x41')][_0x239d('0x4e')]){_0x17fa54['where']=_[_0x239d('0x4f')](_0x17fa54[_0x239d('0x4c')],{'$or':_[_0x239d('0x3d')](_0x17fa54[_0x239d('0x44')],function(_0x2bc193){var _0x1a2534={};_0x1a2534[_0x2bc193]={'$like':'%'+_0x3a8496[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x1a2534;})});}_0x17fa54=_[_0x239d('0x4f')]({},_0x17fa54,_0x3a8496[_0x239d('0x54')]);return db[_0x239d('0x6a')][_0x239d('0x28')]({'where':_0x17fa54[_0x239d('0x4c')]})[_0x239d('0x2f')](function(_0x4b6c41){_0x38c8fb[_0x239d('0x28')]=_0x4b6c41;if(_0x3a8496[_0x239d('0x41')]['includeAll']){_0x17fa54[_0x239d('0x62')]=[{'all':!![]}];}return db[_0x239d('0x6a')][_0x239d('0x51')](_0x17fa54);})[_0x239d('0x2f')](function(_0x3484a1){_0x38c8fb[_0x239d('0x6b')]=_0x3484a1;return _0x38c8fb;});}})[_0x239d('0x2f')](respondWithFilteredResult(_0x3da31a,_0x17fa54))[_0x239d('0x52')](handleError(_0x3da31a,null));};exports[_0x239d('0x6c')]=function(_0x3af37f,_0xb351f8,_0x3c554c){var _0x3bbc3b={'raw':!![],'where':{}};var _0x32b87a={};var _0x293b85={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3af37f['params']['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0xb351f8,null))['then'](function(_0x16858e){if(_0x16858e){_0x32b87a[_0x239d('0x40')]=_[_0x239d('0x42')](db[_0x239d('0x6d')][_0x239d('0x3f')]);_0x32b87a[_0x239d('0x41')]=_[_0x239d('0x42')](_0x3af37f[_0x239d('0x41')]);_0x32b87a[_0x239d('0x43')]=_[_0x239d('0x45')](_0x32b87a[_0x239d('0x40')],_0x32b87a[_0x239d('0x41')]);_0x3bbc3b['attributes']=_[_0x239d('0x45')](_0x32b87a[_0x239d('0x40')],qs['fields'](_0x3af37f['query'][_0x239d('0x46')]));_0x3bbc3b[_0x239d('0x44')]=_0x3bbc3b[_0x239d('0x44')]['length']?_0x3bbc3b[_0x239d('0x44')]:_0x32b87a['model'];if(!_0x3af37f[_0x239d('0x41')]['hasOwnProperty']('nolimit')){_0x3bbc3b[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x3af37f['query'][_0x239d('0x27')]);_0x3bbc3b[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x3af37f[_0x239d('0x41')][_0x239d('0x25')]);}_0x3bbc3b['order']=qs['sort'](_0x3af37f['query'][_0x239d('0x4b')]);_0x3bbc3b[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x3af37f[_0x239d('0x41')],_0x32b87a[_0x239d('0x43')]));_0x3bbc3b[_0x239d('0x4c')][_0x239d('0x6e')]=_0x16858e['id'];if(_0x3af37f[_0x239d('0x41')]['filter']){_0x3bbc3b['where']=_[_0x239d('0x4f')](_0x3bbc3b[_0x239d('0x4c')],{'$or':_[_0x239d('0x3d')](_0x3bbc3b[_0x239d('0x44')],function(_0x470e15){var _0x4fbb14={};_0x4fbb14[_0x470e15]={'$like':'%'+_0x3af37f[_0x239d('0x41')]['filter']+'%'};return _0x4fbb14;})});}_0x3bbc3b=_[_0x239d('0x4f')]({},_0x3bbc3b,_0x3af37f['options']);return db['CmHopperFinal'][_0x239d('0x28')]({'where':_0x3bbc3b['where']})[_0x239d('0x2f')](function(_0x57b4e7){_0x293b85['count']=_0x57b4e7;if(_0x3af37f[_0x239d('0x41')][_0x239d('0x50')]){_0x3bbc3b[_0x239d('0x62')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x239d('0x51')](_0x3bbc3b);})[_0x239d('0x2f')](function(_0x44419b){_0x293b85[_0x239d('0x6b')]=_0x44419b;return _0x293b85;});}})['then'](respondWithFilteredResult(_0xb351f8,_0x3bbc3b))[_0x239d('0x52')](handleError(_0xb351f8,null));};exports[_0x239d('0x6f')]=function(_0x497618,_0x2983e8,_0x2d88b8){var _0x8a26c0={'raw':!![],'where':{}};var _0x29219d={};var _0x10a688={'count':0x0,'rows':[]};return db[_0x239d('0x3e')]['findOne']({'where':{'id':_0x497618[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x2983e8,null))[_0x239d('0x2f')](function(_0x32b580){if(_0x32b580){_0x29219d['model']=_[_0x239d('0x42')](db[_0x239d('0x70')][_0x239d('0x3f')]);_0x29219d['query']=_[_0x239d('0x42')](_0x497618[_0x239d('0x41')]);_0x29219d['filters']=_[_0x239d('0x45')](_0x29219d[_0x239d('0x40')],_0x29219d[_0x239d('0x41')]);_0x8a26c0[_0x239d('0x44')]=_[_0x239d('0x45')](_0x29219d[_0x239d('0x40')],qs[_0x239d('0x46')](_0x497618['query'][_0x239d('0x46')]));_0x8a26c0[_0x239d('0x44')]=_0x8a26c0['attributes']['length']?_0x8a26c0[_0x239d('0x44')]:_0x29219d['model'];if(!_0x497618[_0x239d('0x41')]['hasOwnProperty'](_0x239d('0x49'))){_0x8a26c0[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x497618['query']['limit']);_0x8a26c0[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x497618['query'][_0x239d('0x25')]);}_0x8a26c0['order']=qs[_0x239d('0x4b')](_0x497618['query']['sort']);_0x8a26c0[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x497618['query'],_0x29219d[_0x239d('0x43')]));_0x8a26c0[_0x239d('0x4c')]['VoiceQueueId']=_0x32b580['id'];if(_0x497618[_0x239d('0x41')]['filter']){_0x8a26c0[_0x239d('0x4c')]=_['merge'](_0x8a26c0['where'],{'$or':_[_0x239d('0x3d')](_0x8a26c0[_0x239d('0x44')],function(_0x5bfc08){var _0x14ee7d={};_0x14ee7d[_0x5bfc08]={'$like':'%'+_0x497618['query'][_0x239d('0x4e')]+'%'};return _0x14ee7d;})});}_0x8a26c0=_[_0x239d('0x4f')]({},_0x8a26c0,_0x497618[_0x239d('0x54')]);return db[_0x239d('0x70')][_0x239d('0x28')]({'where':_0x8a26c0[_0x239d('0x4c')]})[_0x239d('0x2f')](function(_0x44d1bc){_0x10a688[_0x239d('0x28')]=_0x44d1bc;if(_0x497618[_0x239d('0x41')][_0x239d('0x50')]){_0x8a26c0[_0x239d('0x62')]=[{'all':!![]}];}return db[_0x239d('0x70')][_0x239d('0x51')](_0x8a26c0);})[_0x239d('0x2f')](function(_0x459d5d){_0x10a688[_0x239d('0x6b')]=_0x459d5d;return _0x10a688;});}})[_0x239d('0x2f')](respondWithFilteredResult(_0x2983e8,_0x8a26c0))['catch'](handleError(_0x2983e8,null));};exports['getTeams']=function(_0x92db5e,_0x42648e,_0x3f9b1a){var _0x38a895={};var _0x15cfac={};var _0x475773;var _0x219f20;return db['VoiceQueue'][_0x239d('0x68')]({'where':{'id':_0x92db5e[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x42648e,null))[_0x239d('0x2f')](function(_0x23307f){if(_0x23307f){_0x475773=_0x23307f;_0x15cfac[_0x239d('0x40')]=_[_0x239d('0x42')](db[_0x239d('0x71')][_0x239d('0x3f')]);_0x15cfac['query']=_[_0x239d('0x42')](_0x92db5e[_0x239d('0x41')]);_0x15cfac['filters']=_[_0x239d('0x45')](_0x15cfac[_0x239d('0x40')],_0x15cfac[_0x239d('0x41')]);_0x38a895[_0x239d('0x44')]=_[_0x239d('0x45')](_0x15cfac[_0x239d('0x40')],qs[_0x239d('0x46')](_0x92db5e[_0x239d('0x41')][_0x239d('0x46')]));_0x38a895[_0x239d('0x44')]=_0x38a895[_0x239d('0x44')]['length']?_0x38a895[_0x239d('0x44')]:_0x15cfac[_0x239d('0x40')];_0x38a895[_0x239d('0x4a')]=qs[_0x239d('0x4b')](_0x92db5e[_0x239d('0x41')][_0x239d('0x4b')]);_0x38a895[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x92db5e[_0x239d('0x41')],_0x15cfac[_0x239d('0x43')]));if(_0x92db5e['query'][_0x239d('0x4e')]){_0x38a895[_0x239d('0x4c')]=_[_0x239d('0x4f')](_0x38a895['where'],{'$or':_[_0x239d('0x3d')](_0x38a895['attributes'],function(_0x5aee06){var _0x171bd6={};_0x171bd6[_0x5aee06]={'$like':'%'+_0x92db5e[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x171bd6;})});}_0x38a895=_[_0x239d('0x4f')]({},_0x38a895,_0x92db5e[_0x239d('0x54')]);return _0x475773[_0x239d('0x72')](_0x38a895);}})['then'](function(_0x2b7dbf){if(_0x2b7dbf){_0x219f20=_0x2b7dbf[_0x239d('0x47')];if(!_0x92db5e['query'][_0x239d('0x48')]('nolimit')){_0x38a895[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x92db5e[_0x239d('0x41')][_0x239d('0x27')]);_0x38a895[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x92db5e[_0x239d('0x41')]['offset']);}return _0x475773['getTeams'](_0x38a895);}})[_0x239d('0x2f')](function(_0x4c54b5){if(_0x4c54b5){return _0x4c54b5?{'count':_0x219f20,'rows':_0x4c54b5}:null;}})['then'](respondWithResult(_0x42648e,null))[_0x239d('0x52')](handleError(_0x42648e,null));};exports[_0x239d('0x73')]=function(_0x300d33,_0x374550,_0x3d5bc3){var _0x490c9c=_0x300d33[_0x239d('0x56')][_0x239d('0x74')];var _0x5509cc=_[_0x239d('0x3d')](_0x490c9c,'id');return db[_0x239d('0x71')][_0x239d('0x51')]({'where':{'id':_0x5509cc},'attributes':['id'],'include':[{'model':db[_0x239d('0x75')],'as':_0x239d('0x76'),'attributes':['id',_0x239d('0x3a'),_0x239d('0x77'),'voicePause','interface'],'raw':!![]}]})[_0x239d('0x2f')](function(_0x2ed9b2){if(_0x2ed9b2){var _0x36c1d8=_[_0x239d('0x78')](_0x2ed9b2,function(_0x34dbed){var _0x378466=_0x34dbed[_0x239d('0x57')]({'plain':!![]});_0x378466[_0x239d('0x76')][_0x239d('0x79')](function(_0x2c00db){_0x2c00db[_0x239d('0x7a')]=_['find'](_0x490c9c,{'id':_0x378466['id']})[_0x239d('0x7a')];});return _0x378466[_0x239d('0x76')];});return db[_0x239d('0x3e')][_0x239d('0x35')]({'where':{'id':_0x300d33[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](function(_0x47e205){return db['sequelize']['transaction'](function(_0x1939cf){return _0x47e205['addTeams'](_0x5509cc,{'transaction':_0x1939cf})[_0x239d('0x2f')](function(){return BPromise['each'](_0x490c9c,function(_0x20daea){return db[_0x239d('0x7b')]['upsert']({'TeamId':_0x20daea['id'],'VoiceQueueId':_0x300d33[_0x239d('0x53')]['id'],'penalty':_0x20daea[_0x239d('0x7a')]},{'transaction':_0x1939cf});});})[_0x239d('0x2f')](function(){return BPromise['each'](_0x36c1d8,function(_0x1666f3){return db['UserVoiceQueue'][_0x239d('0x7c')]({'where':{'UserId':_0x1666f3['id'],'VoiceQueueId':_0x300d33[_0x239d('0x53')]['id']},'defaults':{'penalty':_0x1666f3[_0x239d('0x7a')]},'transaction':_0x1939cf});});})[_0x239d('0x2f')](function(){return BPromise[_0x239d('0x7d')](_['filter'](_0x36c1d8,{'online':!![]}),function(_0x37d40e){return db[_0x239d('0x7e')][_0x239d('0x7f')]({'membername':_0x37d40e[_0x239d('0x3a')],'UserId':_0x37d40e['id'],'queue_name':_0x47e205[_0x239d('0x3a')],'VoiceQueueId':_0x47e205['id'],'interface':_['isNil'](_0x37d40e[_0x239d('0x80')])?util[_0x239d('0x81')](_0x239d('0x82'),_0x37d40e[_0x239d('0x3a')]):_0x37d40e['interface'],'paused':_0x37d40e[_0x239d('0x83')]||![],'penalty':_0x37d40e[_0x239d('0x7a')]},{'transaction':_0x1939cf});});})['then'](function(){_0x36c1d8['forEach'](function(_0x310b93){socket[_0x239d('0x84')](_0x239d('0x85'),{'UserId':_0x310b93['id'],'VoiceQueueId':_0x47e205['id']});});});});});}})[_0x239d('0x2f')](respondWithStatusCode(_0x374550,null))[_0x239d('0x52')](handleError(_0x374550,null));};exports[_0x239d('0x86')]=function(_0x486b48,_0x59a340,_0x3577f5){return db[_0x239d('0x71')][_0x239d('0x51')]({'where':{'id':_0x486b48[_0x239d('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x239d('0x75')],'as':_0x239d('0x76'),'attributes':['id'],'raw':!![]}]})[_0x239d('0x2f')](handleEntityNotFound(_0x59a340,null))[_0x239d('0x2f')](function(_0x2ec6db){var _0x55c215=_['map'](_0x2ec6db,'id');var _0x4bd67d=[];var _0x45391e=[];var _0x112720=squel[_0x239d('0x87')]();_0x112720[_0x239d('0x88')](_0x239d('0x89'))[_0x239d('0x8a')](_0x239d('0x8b'),'tq')[_0x239d('0x8c')](_0x239d('0x8d'),'ut',_0x239d('0x8e'))[_0x239d('0x4c')]('VoiceQueueId\x20=\x20?',_0x486b48[_0x239d('0x53')]['id']);for(var _0x5287df=0x0;_0x5287df<_0x2ec6db[_0x239d('0x47')];_0x5287df+=0x1){let _0x288d60=_0x2ec6db[_0x5287df];for(var _0x87d9a7=0x0;_0x87d9a7<_0x288d60[_0x239d('0x76')][_0x239d('0x47')];_0x87d9a7+=0x1){let _0x18d44e=_0x288d60[_0x239d('0x76')][_0x87d9a7];var _0x1c037e=_0x112720[_0x239d('0x61')]();_0x1c037e[_0x239d('0x4c')]('ut.UserId\x20=\x20?',_0x18d44e['id']);_0x45391e['push'](db[_0x239d('0x8f')][_0x239d('0x41')](_0x1c037e[_0x239d('0x90')](),{'type':db['sequelize']['QueryTypes'][_0x239d('0x91')]})[_0x239d('0x2f')](function(_0x2adc34){if(_0x2adc34[_0x239d('0x47')]===0x1){return _0x18d44e['id'];}else{var _0x19ab1b=_[_0x239d('0x92')](_['map'](_0x2adc34,'TeamId'),function(_0x4da5a7){return _['includes'](_0x55c215,_0x4da5a7);});if(_0x19ab1b){return _0x18d44e['id'];}}}));}}return BPromise[_0x239d('0x93')](_0x45391e)[_0x239d('0x2f')](function(_0x3ac3a4){_0x4bd67d=_(_0x4bd67d)['union'](_0x3ac3a4)[_0x239d('0x94')]()[_0x239d('0x5c')]();return db[_0x239d('0x3e')]['find']({'where':{'id':_0x486b48['params']['id']}})['then'](function(_0x4052b7){return db['sequelize'][_0x239d('0x95')](function(_0x2ec725){return _0x4052b7[_0x239d('0x86')](_0x486b48[_0x239d('0x41')]['ids'],{'transaction':_0x2ec725})[_0x239d('0x2f')](function(){if(!_[_0x239d('0x96')](_0x4bd67d)){return _0x4052b7['removeAgents'](_0x4bd67d,{'transaction':_0x2ec725})[_0x239d('0x2f')](function(){return db[_0x239d('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x486b48[_0x239d('0x53')]['id'],'UserId':_0x4bd67d},'transaction':_0x2ec725});});}})['then'](function(){_0x4bd67d['forEach'](function(_0x23f11e){socket[_0x239d('0x84')](_0x239d('0x97'),{'UserId':_0x23f11e,'VoiceQueueId':_0x4052b7['id']});});});});});});})[_0x239d('0x2f')](respondWithStatusCode(_0x59a340,null))[_0x239d('0x52')](handleError(_0x59a340,null));};exports['addAgents']=function(_0x347d65,_0x59b716,_0x32885c){var _0x1c60b6,_0x4911ec;return db[_0x239d('0x3e')][_0x239d('0x35')]({'where':{'id':_0x347d65['params']['id']}})['then'](handleEntityNotFound(_0x59b716,null))['then'](function(_0x1e6e02){if(_0x1e6e02){_0x4911ec=_0x1e6e02;return _0x1e6e02[_0x239d('0x98')](_0x347d65['body'][_0x239d('0x99')],_[_0x239d('0x65')](_0x347d65[_0x239d('0x56')],[_0x239d('0x99'),'id'])||{})[_0x239d('0x9a')](function(_0x85f8da){for(var _0x2bb55e=0x0;_0x2bb55e<_0x347d65['body'][_0x239d('0x99')][_0x239d('0x47')];_0x2bb55e+=0x1){socket[_0x239d('0x84')]('userVoiceQueue:save',{'UserId':Number(_0x347d65[_0x239d('0x56')][_0x239d('0x99')][_0x2bb55e]),'VoiceQueueId':Number(_0x347d65[_0x239d('0x53')]['id'])});}return _0x85f8da;});}})[_0x239d('0x2f')](function(_0x555c9b){_0x1c60b6=_0x555c9b||[];if(_0x4911ec){return db[_0x239d('0x75')][_0x239d('0x51')]({'where':{'id':_0x347d65[_0x239d('0x56')][_0x239d('0x99')]},'attributes':['id',_0x239d('0x3a'),_0x239d('0x77'),_0x239d('0x83'),_0x239d('0x80')],'raw':!![]});}})[_0x239d('0x2f')](function(_0x5a2d2a){if(!_['isEmpty'](_0x5a2d2a)){var _0x4c38ec=[];for(var _0x17d227=0x0;_0x17d227<_0x5a2d2a[_0x239d('0x47')];_0x17d227++){if(_0x5a2d2a[_0x17d227]['online']){_0x4c38ec[_0x239d('0x9b')](db[_0x239d('0x7e')][_0x239d('0x7f')]({'membername':_0x5a2d2a[_0x17d227][_0x239d('0x3a')],'UserId':_0x5a2d2a[_0x17d227]['id'],'queue_name':_0x4911ec[_0x239d('0x3a')],'VoiceQueueId':_0x4911ec['id'],'interface':_[_0x239d('0x9c')](_0x5a2d2a[_0x17d227][_0x239d('0x80')])?util[_0x239d('0x81')](_0x239d('0x82'),_0x5a2d2a[_0x17d227]['name']):_0x5a2d2a[_0x17d227]['interface'],'paused':_0x5a2d2a[_0x17d227][_0x239d('0x83')]||![],'penalty':_0x347d65[_0x239d('0x56')]['penalty']||0x0}));}}return BPromise[_0x239d('0x93')](_0x4c38ec);}})[_0x239d('0x2f')](function(){return _0x1c60b6;})[_0x239d('0x2f')](respondWithResult(_0x59b716,null))[_0x239d('0x52')](handleError(_0x59b716,null));};exports[_0x239d('0x9d')]=function(_0xa04de7,_0x370a0a,_0x3daf92){return db[_0x239d('0x3e')][_0x239d('0x35')]({'where':{'id':_0xa04de7['params']['id']}})['then'](handleEntityNotFound(_0x370a0a,null))[_0x239d('0x2f')](function(_0x375b4b){if(_0x375b4b){return _0x375b4b['removeAgents'](_0xa04de7[_0x239d('0x41')][_0x239d('0x99')])[_0x239d('0x2f')](function(){if(_[_0x239d('0x9e')](_0xa04de7[_0x239d('0x41')]['ids'])){for(var _0x1150fd=0x0;_0x1150fd<_0xa04de7[_0x239d('0x41')]['ids']['length'];_0x1150fd+=0x1){socket[_0x239d('0x84')](_0x239d('0x97'),{'UserId':Number(_0xa04de7['query'][_0x239d('0x99')][_0x1150fd]),'VoiceQueueId':Number(_0xa04de7[_0x239d('0x53')]['id'])});}}else{socket[_0x239d('0x84')](_0x239d('0x97'),{'UserId':Number(_0xa04de7[_0x239d('0x41')]['ids']),'VoiceQueueId':Number(_0xa04de7[_0x239d('0x53')]['id'])});}});}})[_0x239d('0x2f')](function(_0x31c982){return db['UserVoiceQueueRt'][_0x239d('0x37')]({'where':{'VoiceQueueId':_0xa04de7['params']['id'],'UserId':_0xa04de7['query'][_0x239d('0x99')]}})[_0x239d('0x2f')](function(){return _0x31c982;});})[_0x239d('0x2f')](respondWithStatusCode(_0x370a0a,null))[_0x239d('0x52')](handleError(_0x370a0a,null));};exports['getAgents']=function(_0x13fdad,_0x7a2475,_0x5a908c){var _0x60da28={};var _0x3e399a={};var _0x17d60b;var _0x103003;return db[_0x239d('0x3e')][_0x239d('0x68')]({'where':{'id':_0x13fdad[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x7a2475,null))['then'](function(_0x53f60e){if(_0x53f60e){_0x17d60b=_0x53f60e;_0x3e399a[_0x239d('0x40')]=_['keys'](db[_0x239d('0x75')][_0x239d('0x3f')]);_0x3e399a['query']=_[_0x239d('0x42')](_0x13fdad[_0x239d('0x41')]);_0x3e399a['filters']=_[_0x239d('0x45')](_0x3e399a[_0x239d('0x40')],_0x3e399a[_0x239d('0x41')]);_0x60da28[_0x239d('0x44')]=_[_0x239d('0x45')](_0x3e399a[_0x239d('0x40')],qs[_0x239d('0x46')](_0x13fdad[_0x239d('0x41')]['fields']));_0x60da28[_0x239d('0x44')]=_0x60da28[_0x239d('0x44')][_0x239d('0x47')]?_0x60da28[_0x239d('0x44')]:_0x3e399a[_0x239d('0x40')];_0x60da28[_0x239d('0x4a')]=qs['sort'](_0x13fdad[_0x239d('0x41')]['sort']);_0x60da28[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x13fdad[_0x239d('0x41')],_0x3e399a[_0x239d('0x43')]));if(_0x13fdad[_0x239d('0x41')][_0x239d('0x4e')]){_0x60da28[_0x239d('0x4c')]=_[_0x239d('0x4f')](_0x60da28[_0x239d('0x4c')],{'$or':_['map'](_0x60da28[_0x239d('0x44')],function(_0x5b3dcc){var _0x21eb9f={};_0x21eb9f[_0x5b3dcc]={'$like':'%'+_0x13fdad[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x21eb9f;})});}_0x60da28=_['merge']({},_0x60da28,_0x13fdad[_0x239d('0x54')]);return _0x17d60b[_0x239d('0x9f')](_0x60da28);}})[_0x239d('0x2f')](function(_0x22e6a1){if(_0x22e6a1){_0x103003=_0x22e6a1[_0x239d('0x47')];if(!_0x13fdad[_0x239d('0x41')]['hasOwnProperty'](_0x239d('0x49'))){_0x60da28[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x13fdad['query'][_0x239d('0x27')]);_0x60da28[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x13fdad[_0x239d('0x41')][_0x239d('0x25')]);}return _0x17d60b['getAgents'](_0x60da28);}})['then'](function(_0x5e2614){if(_0x5e2614){return _0x5e2614?{'count':_0x103003,'rows':_0x5e2614}:null;}})[_0x239d('0x2f')](respondWithResult(_0x7a2475,null))['catch'](handleError(_0x7a2475,null));};exports['getMembers']=function(_0x4d0311,_0x5b4d92,_0x3ada1d){var _0x5577f2={};var _0x2d6e4={};var _0x194b87;var _0x104f7b;return db['VoiceQueue'][_0x239d('0x68')]({'where':{'id':_0x4d0311[_0x239d('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b4d92,null))['then'](function(_0x2a0b9d){if(_0x2a0b9d){_0x194b87=_0x2a0b9d;_0x2d6e4[_0x239d('0x40')]=_[_0x239d('0x42')](db[_0x239d('0x7e')][_0x239d('0x3f')]);_0x2d6e4[_0x239d('0x41')]=_[_0x239d('0x42')](_0x4d0311['query']);_0x2d6e4['filters']=_[_0x239d('0x45')](_0x2d6e4[_0x239d('0x40')],_0x2d6e4[_0x239d('0x41')]);_0x5577f2['attributes']=_[_0x239d('0x45')](_0x2d6e4[_0x239d('0x40')],qs[_0x239d('0x46')](_0x4d0311[_0x239d('0x41')][_0x239d('0x46')]));_0x5577f2[_0x239d('0x44')]=_0x5577f2[_0x239d('0x44')][_0x239d('0x47')]?_0x5577f2[_0x239d('0x44')]:_0x2d6e4[_0x239d('0x40')];_0x5577f2['order']=qs[_0x239d('0x4b')](_0x4d0311['query'][_0x239d('0x4b')]);_0x5577f2[_0x239d('0x4c')]=qs['filters'](_[_0x239d('0x4d')](_0x4d0311[_0x239d('0x41')],_0x2d6e4[_0x239d('0x43')]));if(_0x4d0311['query'][_0x239d('0x4e')]){_0x5577f2[_0x239d('0x4c')]=_['merge'](_0x5577f2[_0x239d('0x4c')],{'$or':_[_0x239d('0x3d')](_0x5577f2[_0x239d('0x44')],function(_0x389414){var _0x2e2c08={};_0x2e2c08[_0x389414]={'$like':'%'+_0x4d0311[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x2e2c08;})});}_0x5577f2=_['merge']({},_0x5577f2,_0x4d0311[_0x239d('0x54')]);return _0x194b87['getMembers'](_0x5577f2);}})[_0x239d('0x2f')](function(_0x41b1f8){if(_0x41b1f8){_0x104f7b=_0x41b1f8['length'];if(!_0x4d0311[_0x239d('0x41')][_0x239d('0x48')]('nolimit')){_0x5577f2['limit']=qs[_0x239d('0x27')](_0x4d0311[_0x239d('0x41')][_0x239d('0x27')]);_0x5577f2['offset']=qs[_0x239d('0x25')](_0x4d0311['query'][_0x239d('0x25')]);}return _0x194b87[_0x239d('0xa0')](_0x5577f2);}})[_0x239d('0x2f')](function(_0x1c8528){return _0x1c8528?{'count':_0x104f7b,'rows':_0x1c8528}:null;})['then'](respondWithResult(_0x5b4d92,null))[_0x239d('0x52')](handleError(_0x5b4d92,null));};exports['getLists']=function(_0x53042d,_0x473edd,_0x28660a){var _0x9356f8={};var _0x2baa57={};var _0x30d8fb;var _0x5d153e;return db['VoiceQueue'][_0x239d('0x68')]({'where':{'id':_0x53042d[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x473edd,null))[_0x239d('0x2f')](function(_0x544ef8){if(_0x544ef8){_0x30d8fb=_0x544ef8;_0x2baa57[_0x239d('0x40')]=_['keys'](db['CmList'][_0x239d('0x3f')]);_0x2baa57['query']=_['keys'](_0x53042d['query']);_0x2baa57[_0x239d('0x43')]=_[_0x239d('0x45')](_0x2baa57['model'],_0x2baa57[_0x239d('0x41')]);_0x9356f8[_0x239d('0x44')]=_[_0x239d('0x45')](_0x2baa57[_0x239d('0x40')],qs[_0x239d('0x46')](_0x53042d[_0x239d('0x41')]['fields']));_0x9356f8[_0x239d('0x44')]=_0x9356f8['attributes'][_0x239d('0x47')]?_0x9356f8[_0x239d('0x44')]:_0x2baa57[_0x239d('0x40')];_0x9356f8[_0x239d('0x4a')]=qs[_0x239d('0x4b')](_0x53042d[_0x239d('0x41')][_0x239d('0x4b')]);_0x9356f8[_0x239d('0x4c')]=qs['filters'](_[_0x239d('0x4d')](_0x53042d[_0x239d('0x41')],_0x2baa57[_0x239d('0x43')]));if(_0x53042d[_0x239d('0x41')][_0x239d('0x4e')]){_0x9356f8['where']=_[_0x239d('0x4f')](_0x9356f8[_0x239d('0x4c')],{'$or':_[_0x239d('0x3d')](_0x9356f8[_0x239d('0x44')],function(_0x3ca0bf){var _0x50a9ba={};_0x50a9ba[_0x3ca0bf]={'$like':'%'+_0x53042d[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x50a9ba;})});}_0x9356f8=_['merge']({},_0x9356f8,_0x53042d[_0x239d('0x54')]);return _0x30d8fb[_0x239d('0xa1')](_0x9356f8);}})['then'](function(_0x3133af){if(_0x3133af){_0x5d153e=_0x3133af['length'];if(!_0x53042d[_0x239d('0x41')][_0x239d('0x48')]('nolimit')){_0x9356f8[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x53042d[_0x239d('0x41')]['limit']);_0x9356f8['offset']=qs[_0x239d('0x25')](_0x53042d[_0x239d('0x41')][_0x239d('0x25')]);}return _0x30d8fb[_0x239d('0xa1')](_0x9356f8);}})[_0x239d('0x2f')](function(_0x1f3648){if(_0x1f3648){return _0x1f3648?{'count':_0x5d153e,'rows':_0x1f3648}:null;}})[_0x239d('0x2f')](respondWithResult(_0x473edd,null))['catch'](handleError(_0x473edd,null));};exports[_0x239d('0xa2')]=function(_0x1201fe,_0x57e585,_0x1d9717){var _0x234097=moment()[_0x239d('0x81')](_0x239d('0xa3'));var _0xb9f926,_0x1597f5;return db['VoiceQueue'][_0x239d('0x35')]({'where':{'id':_0x1201fe[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x57e585,null))['then'](function(_0x44cb3e){if(_0x44cb3e){_0x1597f5=_0x44cb3e;return _0x44cb3e[_0x239d('0xa2')](_0x1201fe[_0x239d('0x56')]['ids'],_[_0x239d('0x65')](_0x1201fe[_0x239d('0x56')],[_0x239d('0x99'),'id'])||{});}return null;})[_0x239d('0x9a')](function(_0x133f37){var _0x507f35;_0xb9f926=_0x133f37||[];var _0xa1dbde=[];if(_0x133f37){for(var _0x1aefbf=0x0;_0x1aefbf<_0x133f37[_0x239d('0x47')];_0x1aefbf+=0x1){var _0x52b97b=_0x133f37[_0x1aefbf][_0x239d('0x57')]({'plain':!![]});_0x1597f5[_0x239d('0xa4')]=_0x1201fe['body']['dialCheckDuplicateType']?_0x1201fe[_0x239d('0x56')][_0x239d('0xa4')]:_0x1597f5[_0x239d('0xa4')];switch(_0x1597f5[_0x239d('0xa4')]){case _0x239d('0xa5'):_0x507f35=squel[_0x239d('0xa6')]()[_0x239d('0xa7')](_0x239d('0xa8'))['fromQuery'](['phone',_0x239d('0xa9'),_0x239d('0xaa'),'ListId',_0x239d('0x6e'),_0x239d('0x63'),_0x239d('0x64')],squel[_0x239d('0x87')]()[_0x239d('0x88')]('phone',_0x239d('0xab'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27',_0x239d('0xa9'))['field']('id',_0x239d('0xaa'))[_0x239d('0x88')](_0x52b97b['CmListId'][_0x239d('0x90')](),_0x239d('0xac'))[_0x239d('0x88')](_0x1201fe['params']['id'][_0x239d('0x90')](),_0x239d('0x6e'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27',_0x239d('0x63'))['field']('\x27'+_0x234097+'\x27',_0x239d('0x64'))['from'](_0x239d('0xad'))[_0x239d('0x4c')](_0x239d('0xae'))[_0x239d('0x4c')](_0x239d('0xaf'),_0x52b97b['CmListId']['toString']())[_0x239d('0x4c')]('phone\x20IS\x20NOT\x20NULL')[_0x239d('0x4c')](_0x239d('0xb0'),squel[_0x239d('0x87')]()[_0x239d('0x88')]('COALESCE(calleridnum,\x27\x27)')[_0x239d('0x8a')](_0x239d('0xb1'))['where'](_0x239d('0xb2'),_0x1201fe[_0x239d('0x53')]['id'][_0x239d('0x90')]()))[_0x239d('0x4c')](_0x239d('0xb0'),squel[_0x239d('0x87')]()[_0x239d('0x88')](_0x239d('0xb3'))[_0x239d('0x8a')](_0x239d('0xa8'))[_0x239d('0x4c')](_0x239d('0xb2'),_0x1201fe[_0x239d('0x53')]['id']['toString']())))[_0x239d('0x90')]();break;case _0x239d('0xb4'):_0x507f35=squel[_0x239d('0xa6')]()['into']('cm_hopper')[_0x239d('0xb5')]([_0x239d('0xab'),_0x239d('0xa9'),'ContactId',_0x239d('0xac'),'VoiceQueueId',_0x239d('0x63'),_0x239d('0x64')],squel[_0x239d('0x87')]()[_0x239d('0x88')]('phone',_0x239d('0xab'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27','scheduledAt')[_0x239d('0x88')]('id',_0x239d('0xaa'))[_0x239d('0x88')](_0x52b97b[_0x239d('0xb6')]['toString'](),'ListId')[_0x239d('0x88')](_0x1201fe['params']['id'][_0x239d('0x90')](),_0x239d('0x6e'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27',_0x239d('0x63'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27','updatedAt')[_0x239d('0x8a')](_0x239d('0xad'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x239d('0xaf'),_0x52b97b['CmListId'][_0x239d('0x90')]())[_0x239d('0x4c')](_0x239d('0xb7'))['where'](_0x239d('0xb0'),squel['select']()[_0x239d('0x88')](_0x239d('0xb3'))['from'](_0x239d('0xa8'))[_0x239d('0x4c')](_0x239d('0xb2'),_0x1201fe[_0x239d('0x53')]['id'][_0x239d('0x90')]())))['toString']();break;default:_0x507f35=squel[_0x239d('0xa6')]()[_0x239d('0xa7')](_0x239d('0xa8'))[_0x239d('0xb5')](['phone',_0x239d('0xa9'),_0x239d('0xaa'),_0x239d('0xac'),'VoiceQueueId',_0x239d('0x63'),_0x239d('0x64')],squel[_0x239d('0x87')]()[_0x239d('0x88')](_0x239d('0xab'),_0x239d('0xab'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27',_0x239d('0xa9'))['field']('id',_0x239d('0xaa'))[_0x239d('0x88')](_0x52b97b[_0x239d('0xb6')]['toString'](),_0x239d('0xac'))[_0x239d('0x88')](_0x1201fe[_0x239d('0x53')]['id']['toString'](),_0x239d('0x6e'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27','createdAt')[_0x239d('0x88')]('\x27'+_0x234097+'\x27','updatedAt')[_0x239d('0x8a')]('cm_contacts')[_0x239d('0x4c')](_0x239d('0xae'))[_0x239d('0x4c')](_0x239d('0xaf'),_0x52b97b[_0x239d('0xb6')][_0x239d('0x90')]())[_0x239d('0x4c')](_0x239d('0xb7')))[_0x239d('0x90')]();}_0xa1dbde[_0x239d('0x9b')](db[_0x239d('0x8f')][_0x239d('0x41')](_0x507f35));}return BPromise[_0x239d('0x93')](_0xa1dbde);}})[_0x239d('0x2f')](function(){var _0x3f4b12=[];var _0x2d06ef=squel[_0x239d('0xa6')]()[_0x239d('0xa7')](_0x239d('0xb8'))['fromQuery'](['CmHopperId',_0x239d('0xab'),_0x239d('0xb9'),'createdAt',_0x239d('0x64')],squel[_0x239d('0x87')]()[_0x239d('0x88')]('h.id')['field'](_0x239d('0xba'))[_0x239d('0x88')](_0x239d('0xbb'))[_0x239d('0x88')]('\x27'+_0x234097+'\x27','createdAt')['field']('\x27'+_0x234097+'\x27',_0x239d('0x64'))[_0x239d('0x8a')]('cm_contact_has_items','ci')[_0x239d('0x8c')](_0x239d('0xa8'),'h',_0x239d('0xbc'))[_0x239d('0x4c')](_0x239d('0xbd'),_0x234097)[_0x239d('0x4c')](_0x239d('0xbe'),_0x239d('0xbf')))[_0x239d('0x90')]();_0x3f4b12['push'](db[_0x239d('0x8f')][_0x239d('0x41')](_0x2d06ef));return BPromise[_0x239d('0x93')](_0x3f4b12);})[_0x239d('0x2f')](function(){return _0xb9f926;})[_0x239d('0x2f')](respondWithResult(_0x57e585,null))[_0x239d('0x52')](handleError(_0x57e585,null));};exports[_0x239d('0xc0')]=function(_0x4b6b7f,_0x1b1a6c,_0x3e1322){return db[_0x239d('0x3e')][_0x239d('0x35')]({'where':{'id':_0x4b6b7f['params']['id']}})['then'](handleEntityNotFound(_0x1b1a6c,null))['then'](function(_0x4b0f34){if(_0x4b0f34){return _0x4b0f34['removeLists'](_0x4b6b7f[_0x239d('0x41')][_0x239d('0x99')]);}})[_0x239d('0x2f')](function(_0x39054c){if(_0x39054c){return db[_0x239d('0x69')][_0x239d('0x37')]({'where':{'ListId':_0x4b6b7f['query'][_0x239d('0x99')],'VoiceQueueId':_0x4b6b7f['params']['id']}})['then'](function(){return _0x39054c;});}})[_0x239d('0x2f')](respondWithStatusCode(_0x1b1a6c,null))[_0x239d('0x52')](handleError(_0x1b1a6c,null));};exports[_0x239d('0xc1')]=function(_0x46e12d,_0x353b3f,_0x2ea719){var _0x3ada93={};var _0x5902f4={};var _0x1604c2;var _0x2d5584;return db[_0x239d('0x3e')][_0x239d('0x68')]({'where':{'id':_0x46e12d[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x353b3f,null))[_0x239d('0x2f')](function(_0x1970a5){if(_0x1970a5){_0x1604c2=_0x1970a5;_0x5902f4['model']=_[_0x239d('0x42')](db[_0x239d('0xc2')]['rawAttributes']);_0x5902f4[_0x239d('0x41')]=_['keys'](_0x46e12d[_0x239d('0x41')]);_0x5902f4[_0x239d('0x43')]=_[_0x239d('0x45')](_0x5902f4[_0x239d('0x40')],_0x5902f4[_0x239d('0x41')]);_0x3ada93['attributes']=_[_0x239d('0x45')](_0x5902f4[_0x239d('0x40')],qs[_0x239d('0x46')](_0x46e12d[_0x239d('0x41')][_0x239d('0x46')]));_0x3ada93[_0x239d('0x44')]=_0x3ada93[_0x239d('0x44')][_0x239d('0x47')]?_0x3ada93[_0x239d('0x44')]:_0x5902f4[_0x239d('0x40')];_0x3ada93['order']=qs['sort'](_0x46e12d[_0x239d('0x41')][_0x239d('0x4b')]);_0x3ada93[_0x239d('0x4c')]=qs[_0x239d('0x43')](_[_0x239d('0x4d')](_0x46e12d['query'],_0x5902f4[_0x239d('0x43')]));if(_0x46e12d[_0x239d('0x41')]['filter']){_0x3ada93[_0x239d('0x4c')]=_[_0x239d('0x4f')](_0x3ada93['where'],{'$or':_[_0x239d('0x3d')](_0x3ada93[_0x239d('0x44')],function(_0x2a8c87){var _0x2f23dc={};_0x2f23dc[_0x2a8c87]={'$like':'%'+_0x46e12d[_0x239d('0x41')][_0x239d('0x4e')]+'%'};return _0x2f23dc;})});}_0x3ada93=_[_0x239d('0x4f')]({},_0x3ada93,_0x46e12d['options']);return _0x1604c2[_0x239d('0xc1')](_0x3ada93);}})[_0x239d('0x2f')](function(_0x2d3e6c){if(_0x2d3e6c){_0x2d5584=_0x2d3e6c['length'];if(!_0x46e12d['query'][_0x239d('0x48')]('nolimit')){_0x3ada93[_0x239d('0x27')]=qs[_0x239d('0x27')](_0x46e12d[_0x239d('0x41')][_0x239d('0x27')]);_0x3ada93[_0x239d('0x25')]=qs[_0x239d('0x25')](_0x46e12d['query'][_0x239d('0x25')]);}return _0x1604c2[_0x239d('0xc1')](_0x3ada93);}})[_0x239d('0x2f')](function(_0x5c9f10){if(_0x5c9f10){return _0x5c9f10?{'count':_0x2d5584,'rows':_0x5c9f10}:null;}})[_0x239d('0x2f')](respondWithResult(_0x353b3f,null))[_0x239d('0x52')](handleError(_0x353b3f,null));};exports[_0x239d('0xc3')]=function(_0x3b7d1c,_0x359ebd,_0xecd364){var _0x4d3a0d,_0xf895a8;return db['VoiceQueue'][_0x239d('0x35')]({'where':{'id':_0x3b7d1c[_0x239d('0x53')]['id']}})['then'](handleEntityNotFound(_0x359ebd,null))[_0x239d('0x2f')](function(_0x110f7e){if(_0x110f7e){_0xf895a8=_0x110f7e;return _0x110f7e[_0x239d('0xc3')](_0x3b7d1c['body']['ids'],_['omit'](_0x3b7d1c[_0x239d('0x56')],['ids','id'])||{});}return null;})[_0x239d('0x9a')](function(_0x56d4c4){var _0xc19232;_0x4d3a0d=_0x56d4c4||[];var _0x59de68=[];if(_0x56d4c4){for(var _0x5bcecc=0x0;_0x5bcecc<_0x56d4c4[_0x239d('0x47')];_0x5bcecc+=0x1){var _0x5139b1=_0x56d4c4[_0x5bcecc][_0x239d('0x57')]({'plain':!![]});_0xc19232=squel[_0x239d('0xa6')]()[_0x239d('0xa7')]('cm_hopper_black')[_0x239d('0xb5')]([_0x239d('0xab'),_0x239d('0xaa'),_0x239d('0xac'),_0x239d('0x6e'),_0x239d('0x63'),'updatedAt'],squel['select']()[_0x239d('0x88')]('phone',_0x239d('0xab'))[_0x239d('0x88')]('id',_0x239d('0xaa'))[_0x239d('0x88')](_0x5139b1['CmListId']['toString'](),'ListId')[_0x239d('0x88')](_0x3b7d1c[_0x239d('0x53')]['id'][_0x239d('0x90')](),_0x239d('0x6e'))['field'](_0x239d('0xc4'),_0x239d('0x63'))[_0x239d('0x88')](_0x239d('0xc4'),'updatedAt')[_0x239d('0x8a')](_0x239d('0xad'))[_0x239d('0x4c')](_0x239d('0xae'))[_0x239d('0x4c')](_0x239d('0xaf'),_0x5139b1[_0x239d('0xb6')][_0x239d('0x90')]())['where'](_0x239d('0xb7')))[_0x239d('0x90')]();_0x59de68[_0x239d('0x9b')](db[_0x239d('0x8f')][_0x239d('0x41')](_0xc19232));}return BPromise[_0x239d('0x93')](_0x59de68);}})[_0x239d('0x2f')](function(){return _0x4d3a0d;})[_0x239d('0x2f')](respondWithResult(_0x359ebd,null))[_0x239d('0x52')](handleError(_0x359ebd,null));};exports[_0x239d('0xc5')]=function(_0x4d12ed,_0x7611ca,_0x556d60){return db[_0x239d('0x3e')]['find']({'where':{'id':_0x4d12ed[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](handleEntityNotFound(_0x7611ca,null))['then'](function(_0x2463ef){if(_0x2463ef){return _0x2463ef[_0x239d('0xc5')](_0x4d12ed[_0x239d('0x41')][_0x239d('0x99')]);}})['then'](function(_0x2d5624){if(_0x2d5624){return db['CmHopperBlack'][_0x239d('0x37')]({'where':{'ListId':_0x4d12ed[_0x239d('0x41')]['ids'],'VoiceQueueId':_0x4d12ed[_0x239d('0x53')]['id']}})[_0x239d('0x2f')](function(){return _0x2d5624;});}})[_0x239d('0x2f')](respondWithStatusCode(_0x7611ca,null))['catch'](handleError(_0x7611ca,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3f1b119..de18d08 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 _0xdada=['emit','exports','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0xdada,0x10c));var _0xadad=function(_0x3c3428,_0x4c0a9c){_0x3c3428=_0x3c3428-0x0;var _0x3441ba=_0xdada[_0x3c3428];return _0x3441ba;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xadad('0x0'))['db'][_0xadad('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xadad('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xadad('0x3'),'afterDestroy':_0xadad('0x4')};function emitEvent(_0x28b984){return function(_0x57f4ec,_0x1dd9a0,_0x1e165b){VoiceQueueEvents[_0xadad('0x5')](_0x28b984+':'+_0x57f4ec['id'],_0x57f4ec);VoiceQueueEvents[_0xadad('0x5')](_0x28b984,_0x57f4ec);_0x1e165b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xadad('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x0722=['events','../../mysqldb','setMaxListeners','update','remove','hasOwnProperty','hook','exports'];(function(_0xa2ac9,_0xf07f28){var _0x690e9b=function(_0x5b2582){while(--_0x5b2582){_0xa2ac9['push'](_0xa2ac9['shift']());}};_0x690e9b(++_0xf07f28);}(_0x0722,0x1b0));var _0x2072=function(_0x3d0dd5,_0x56279d){_0x3d0dd5=_0x3d0dd5-0x0;var _0x404dc2=_0x0722[_0x3d0dd5];return _0x404dc2;};'use strict';var EventEmitter=require(_0x2072('0x0'));var VoiceQueue=require(_0x2072('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2072('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2072('0x3'),'afterDestroy':_0x2072('0x4')};function emitEvent(_0x3e00d7){return function(_0x5c417e,_0x1f3a4a,_0x13c947){VoiceQueueEvents['emit'](_0x3e00d7+':'+_0x5c417e['id'],_0x5c417e);VoiceQueueEvents['emit'](_0x3e00d7,_0x5c417e);_0x13c947(null);};}for(var e in events){if(events[_0x2072('0x5')](e)){var event=events[e];VoiceQueue[_0x2072('0x6')](e,emitEvent(event));}}module[_0x2072('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 91be239..a8f02f8 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x55ca,0x126));var _0xa55c=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x55ca[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0xbe2952,_0x2b75ce){var _0x24dad4=function(_0x343cb6){while(--_0x343cb6){_0xbe2952['push'](_0xbe2952['shift']());}};_0x24dad4(++_0x2b75ce);}(_0x70e0,0x17b));var _0x070e=function(_0x2a97ad,_0x42ac68){_0x2a97ad=_0x2a97ad-0x0;var _0x12bbe5=_0x70e0[_0x2a97ad];return _0x12bbe5;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 121d3cc..b1cb7ea 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 _0x512d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','error','code','VoiceQueue,\x20%s,\x20%s','message','catch','VoiceQueue','findAll','options','where','attributes','include','map','model','GetVoiceQueue','stringify','ShowVoiceQueue','lodash','util'];(function(_0x450a08,_0x3ed9b7){var _0x15e9c2=function(_0x2e2a0c){while(--_0x2e2a0c){_0x450a08['push'](_0x450a08['shift']());}};_0x15e9c2(++_0x3ed9b7);}(_0x512d,0x1c5));var _0xd512=function(_0x9d6f53,_0x3b4dd6){_0x9d6f53=_0x9d6f53-0x0;var _0x284ea9=_0x512d[_0x9d6f53];return _0x284ea9;};'use strict';var _=require(_0xd512('0x0'));var util=require(_0xd512('0x1'));var moment=require(_0xd512('0x2'));var BPromise=require(_0xd512('0x3'));var rs=require(_0xd512('0x4'));var fs=require('fs');var Redis=require(_0xd512('0x5'));var db=require(_0xd512('0x6'))['db'];var utils=require(_0xd512('0x7'));var logger=require(_0xd512('0x8'))(_0xd512('0x9'));var config=require('../../config/environment');var jayson=require(_0xd512('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd512('0xb')]=_['defaults'](config[_0xd512('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd512('0xb')]));require(_0xd512('0xc'))[_0xd512('0xd')](socket);function respondWithRpcPromise(_0x4a2f9d,_0x6b20de,_0x37cb06){return new BPromise(function(_0x3c1355,_0x527844){return client[_0xd512('0xe')](_0x4a2f9d,_0x37cb06)[_0xd512('0xf')](function(_0x5c87f6){logger[_0xd512('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x6b20de,_0xd512('0x11'));logger[_0xd512('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x6b20de,_0xd512('0x11'),JSON['stringify'](_0x5c87f6));if(_0x5c87f6[_0xd512('0x13')]){if(_0x5c87f6[_0xd512('0x13')][_0xd512('0x14')]===0x1f4){logger[_0xd512('0x13')](_0xd512('0x15'),_0x6b20de,_0x5c87f6[_0xd512('0x13')][_0xd512('0x16')]);return _0x527844(_0x5c87f6['error']['message']);}logger[_0xd512('0x13')](_0xd512('0x15'),_0x6b20de,_0x5c87f6[_0xd512('0x13')]['message']);return _0x3c1355(_0x5c87f6[_0xd512('0x13')][_0xd512('0x16')]);}else{logger[_0xd512('0x10')](_0xd512('0x15'),_0x6b20de,_0xd512('0x11'));_0x3c1355(_0x5c87f6['result'][_0xd512('0x16')]);}})[_0xd512('0x17')](function(_0x388fc1){logger[_0xd512('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x6b20de,_0x388fc1);_0x527844(_0x388fc1);});});}exports['GetVoiceQueue']=function(_0x55691){var _0x45c72c=this;return new Promise(function(_0x4f66dd,_0x29f79d){return db[_0xd512('0x18')][_0xd512('0x19')]({'raw':_0x55691[_0xd512('0x1a')]?_0x55691['options']['raw']===undefined?!![]:![]:!![],'where':_0x55691[_0xd512('0x1a')]?_0x55691[_0xd512('0x1a')][_0xd512('0x1b')]||null:null,'attributes':_0x55691[_0xd512('0x1a')]?_0x55691[_0xd512('0x1a')][_0xd512('0x1c')]||null:null,'limit':_0x55691[_0xd512('0x1a')]?_0x55691['options']['limit']||null:null,'include':_0x55691['options']?_0x55691[_0xd512('0x1a')][_0xd512('0x1d')]?_[_0xd512('0x1e')](_0x55691[_0xd512('0x1a')]['include'],function(_0x2be6d9){return{'model':db[_0x2be6d9[_0xd512('0x1f')]],'as':_0x2be6d9['as'],'attributes':_0x2be6d9[_0xd512('0x1c')],'include':_0x2be6d9['include']?_[_0xd512('0x1e')](_0x2be6d9[_0xd512('0x1d')],function(_0xa926dd){return{'model':db[_0xa926dd[_0xd512('0x1f')]],'as':_0xa926dd['as'],'attributes':_0xa926dd['attributes'],'include':_0xa926dd[_0xd512('0x1d')]?_['map'](_0xa926dd[_0xd512('0x1d')],function(_0x2e9690){return{'model':db[_0x2e9690[_0xd512('0x1f')]],'as':_0x2e9690['as'],'attributes':_0x2e9690[_0xd512('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd512('0xf')](function(_0x143393){logger['info'](_0xd512('0x20'),_0x55691);logger[_0xd512('0x12')](_0xd512('0x20'),_0x55691,JSON[_0xd512('0x21')](_0x143393));_0x4f66dd(_0x143393);})[_0xd512('0x17')](function(_0x1fd6f2){logger[_0xd512('0x13')](_0xd512('0x20'),_0x1fd6f2[_0xd512('0x16')],_0x55691);_0x29f79d(_0x45c72c[_0xd512('0x13')](0x1f4,_0x1fd6f2[_0xd512('0x16')]));});});};exports[_0xd512('0x22')]=function(_0x4463fa){var _0x57c11f=this;return new Promise(function(_0x472db8,_0x171d9d){return db[_0xd512('0x18')]['find']({'raw':_0x4463fa['options']?_0x4463fa['options']['raw']===undefined?!![]:![]:!![],'where':_0x4463fa[_0xd512('0x1a')]?_0x4463fa[_0xd512('0x1a')]['where']||null:null,'attributes':_0x4463fa[_0xd512('0x1a')]?_0x4463fa[_0xd512('0x1a')][_0xd512('0x1c')]||null:null,'include':_0x4463fa[_0xd512('0x1a')]?_0x4463fa[_0xd512('0x1a')][_0xd512('0x1d')]?_['map'](_0x4463fa[_0xd512('0x1a')][_0xd512('0x1d')],function(_0x4bbcb5){return{'model':db[_0x4bbcb5['model']],'as':_0x4bbcb5['as'],'attributes':_0x4bbcb5[_0xd512('0x1c')],'include':_0x4bbcb5[_0xd512('0x1d')]?_[_0xd512('0x1e')](_0x4bbcb5['include'],function(_0x306d4f){return{'model':db[_0x306d4f['model']],'as':_0x306d4f['as'],'attributes':_0x306d4f['attributes'],'include':_0x306d4f['include']?_[_0xd512('0x1e')](_0x306d4f[_0xd512('0x1d')],function(_0x33595e){return{'model':db[_0x33595e['model']],'as':_0x33595e['as'],'attributes':_0x33595e[_0xd512('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bce3b){logger[_0xd512('0x10')](_0xd512('0x22'),_0x4463fa);logger[_0xd512('0x12')]('ShowVoiceQueue',_0x4463fa,JSON[_0xd512('0x21')](_0x5bce3b));_0x472db8(_0x5bce3b);})[_0xd512('0x17')](function(_0xbd77a8){logger[_0xd512('0x13')]('ShowVoiceQueue',_0xbd77a8['message'],_0x4463fa);_0x171d9d(_0x57c11f[_0xd512('0x13')](0x1f4,_0xbd77a8['message']));});});}; \ No newline at end of file +var _0xafbf=['request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','include','model','attributes','map','then','find','raw','ShowVoiceQueue','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0xafbf,0x1cf));var _0xfafb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xafbf[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xfafb('0x0'));var moment=require(_0xfafb('0x1'));var BPromise=require(_0xfafb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfafb('0x3'));var db=require(_0xfafb('0x4'))['db'];var utils=require(_0xfafb('0x5'));var logger=require('../../config/logger')(_0xfafb('0x6'));var config=require(_0xfafb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfafb('0x8')][_0xfafb('0x9')]({'port':0x232a});config[_0xfafb('0xa')]=_[_0xfafb('0xb')](config['redis'],{'host':_0xfafb('0xc'),'port':0x18eb});var socket=require(_0xfafb('0xd'))(new Redis(config[_0xfafb('0xa')]));require('./voiceQueue.socket')[_0xfafb('0xe')](socket);function respondWithRpcPromise(_0x49b9c1,_0x1377da,_0x7e84de){return new BPromise(function(_0x350e7c,_0x55c3d9){return client['request'](_0x49b9c1,_0x7e84de)['then'](function(_0x10bd5c){logger[_0xfafb('0xf')](_0xfafb('0x10'),_0x1377da,_0xfafb('0x11'));logger['debug'](_0xfafb('0x12'),_0x1377da,'request\x20sent',JSON[_0xfafb('0x13')](_0x10bd5c));if(_0x10bd5c['error']){if(_0x10bd5c[_0xfafb('0x14')][_0xfafb('0x15')]===0x1f4){logger[_0xfafb('0x14')](_0xfafb('0x10'),_0x1377da,_0x10bd5c['error'][_0xfafb('0x16')]);return _0x55c3d9(_0x10bd5c[_0xfafb('0x14')][_0xfafb('0x16')]);}logger['error'](_0xfafb('0x10'),_0x1377da,_0x10bd5c[_0xfafb('0x14')][_0xfafb('0x16')]);return _0x350e7c(_0x10bd5c['error'][_0xfafb('0x16')]);}else{logger[_0xfafb('0xf')](_0xfafb('0x10'),_0x1377da,_0xfafb('0x11'));_0x350e7c(_0x10bd5c[_0xfafb('0x17')][_0xfafb('0x16')]);}})[_0xfafb('0x18')](function(_0x58c591){logger[_0xfafb('0x14')](_0xfafb('0x10'),_0x1377da,_0x58c591);_0x55c3d9(_0x58c591);});});}exports[_0xfafb('0x19')]=function(_0xc3ab76){var _0x1609db=this;return new Promise(function(_0x4a4333,_0x5e93e9){return db[_0xfafb('0x1a')][_0xfafb('0x1b')]({'raw':_0xc3ab76[_0xfafb('0x1c')]?_0xc3ab76[_0xfafb('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xc3ab76[_0xfafb('0x1c')]?_0xc3ab76[_0xfafb('0x1c')][_0xfafb('0x1d')]||null:null,'attributes':_0xc3ab76[_0xfafb('0x1c')]?_0xc3ab76[_0xfafb('0x1c')]['attributes']||null:null,'limit':_0xc3ab76[_0xfafb('0x1c')]?_0xc3ab76['options'][_0xfafb('0x1e')]||null:null,'include':_0xc3ab76[_0xfafb('0x1c')]?_0xc3ab76[_0xfafb('0x1c')][_0xfafb('0x1f')]?_['map'](_0xc3ab76[_0xfafb('0x1c')][_0xfafb('0x1f')],function(_0x394005){return{'model':db[_0x394005[_0xfafb('0x20')]],'as':_0x394005['as'],'attributes':_0x394005[_0xfafb('0x21')],'include':_0x394005[_0xfafb('0x1f')]?_['map'](_0x394005[_0xfafb('0x1f')],function(_0x58cd21){return{'model':db[_0x58cd21[_0xfafb('0x20')]],'as':_0x58cd21['as'],'attributes':_0x58cd21[_0xfafb('0x21')],'include':_0x58cd21[_0xfafb('0x1f')]?_[_0xfafb('0x22')](_0x58cd21['include'],function(_0x2f2694){return{'model':db[_0x2f2694[_0xfafb('0x20')]],'as':_0x2f2694['as'],'attributes':_0x2f2694['attributes']};}):[]};}):[]};}):[]:[]})[_0xfafb('0x23')](function(_0x41e1f6){logger[_0xfafb('0xf')](_0xfafb('0x19'),_0xc3ab76);logger['debug'](_0xfafb('0x19'),_0xc3ab76,JSON['stringify'](_0x41e1f6));_0x4a4333(_0x41e1f6);})[_0xfafb('0x18')](function(_0x2651e5){logger[_0xfafb('0x14')](_0xfafb('0x19'),_0x2651e5[_0xfafb('0x16')],_0xc3ab76);_0x5e93e9(_0x1609db[_0xfafb('0x14')](0x1f4,_0x2651e5['message']));});});};exports['ShowVoiceQueue']=function(_0x17c276){var _0x32f0a3=this;return new Promise(function(_0x131fea,_0x32a368){return db[_0xfafb('0x1a')][_0xfafb('0x24')]({'raw':_0x17c276[_0xfafb('0x1c')]?_0x17c276[_0xfafb('0x1c')][_0xfafb('0x25')]===undefined?!![]:![]:!![],'where':_0x17c276['options']?_0x17c276['options']['where']||null:null,'attributes':_0x17c276[_0xfafb('0x1c')]?_0x17c276[_0xfafb('0x1c')][_0xfafb('0x21')]||null:null,'include':_0x17c276['options']?_0x17c276[_0xfafb('0x1c')][_0xfafb('0x1f')]?_[_0xfafb('0x22')](_0x17c276[_0xfafb('0x1c')]['include'],function(_0x4c986e){return{'model':db[_0x4c986e['model']],'as':_0x4c986e['as'],'attributes':_0x4c986e['attributes'],'include':_0x4c986e[_0xfafb('0x1f')]?_[_0xfafb('0x22')](_0x4c986e[_0xfafb('0x1f')],function(_0x5ad1dc){return{'model':db[_0x5ad1dc[_0xfafb('0x20')]],'as':_0x5ad1dc['as'],'attributes':_0x5ad1dc['attributes'],'include':_0x5ad1dc[_0xfafb('0x1f')]?_[_0xfafb('0x22')](_0x5ad1dc[_0xfafb('0x1f')],function(_0x1b61af){return{'model':db[_0x1b61af[_0xfafb('0x20')]],'as':_0x1b61af['as'],'attributes':_0x1b61af['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41bc89){logger[_0xfafb('0xf')](_0xfafb('0x26'),_0x17c276);logger[_0xfafb('0x27')](_0xfafb('0x26'),_0x17c276,JSON[_0xfafb('0x13')](_0x41bc89));_0x131fea(_0x41bc89);})[_0xfafb('0x18')](function(_0x10f200){logger['error'](_0xfafb('0x26'),_0x10f200['message'],_0x17c276);_0x32a368(_0x32f0a3[_0xfafb('0x14')](0x1f4,_0x10f200['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 5a08902..9490dd1 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 _0x7580=['length','voiceQueue:','./voiceQueue.events','remove','emit','removeListener','register'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x7580,0x1d0));var _0x0758=function(_0x463952,_0x3e8283){_0x463952=_0x463952-0x0;var _0x517dba=_0x7580[_0x463952];return _0x517dba;};'use strict';var VoiceQueueEvents=require(_0x0758('0x0'));var events=['save',_0x0758('0x1'),'update'];function createListener(_0xdf948c,_0x92ddf3){return function(_0x3b4cf6){_0x92ddf3[_0x0758('0x2')](_0xdf948c,_0x3b4cf6);};}function removeListener(_0x56cfe2,_0x578830){return function(){VoiceQueueEvents[_0x0758('0x3')](_0x56cfe2,_0x578830);};}exports[_0x0758('0x4')]=function(_0x3a1e99){for(var _0xc4a482=0x0,_0x409baa=events[_0x0758('0x5')];_0xc4a482<_0x409baa;_0xc4a482++){var _0x2c0052=events[_0xc4a482];var _0x1b5a23=createListener(_0x0758('0x6')+_0x2c0052,_0x3a1e99);VoiceQueueEvents['on'](_0x2c0052,_0x1b5a23);}}; \ No newline at end of file +var _0xd441=['remove','emit','length','./voiceQueue.events','save'];(function(_0x417aa6,_0x401f42){var _0x46e3bc=function(_0x361de5){while(--_0x361de5){_0x417aa6['push'](_0x417aa6['shift']());}};_0x46e3bc(++_0x401f42);}(_0xd441,0xfd));var _0x1d44=function(_0x5b8f2d,_0x34b6c9){_0x5b8f2d=_0x5b8f2d-0x0;var _0x4d7747=_0xd441[_0x5b8f2d];return _0x4d7747;};'use strict';var VoiceQueueEvents=require(_0x1d44('0x0'));var events=[_0x1d44('0x1'),_0x1d44('0x2'),'update'];function createListener(_0x1a308f,_0x245a5b){return function(_0x4d6e29){_0x245a5b[_0x1d44('0x3')](_0x1a308f,_0x4d6e29);};}function removeListener(_0x5a9746,_0x48f893){return function(){VoiceQueueEvents['removeListener'](_0x5a9746,_0x48f893);};}exports['register']=function(_0x4004bd){for(var _0x1051b3=0x0,_0x52e933=events[_0x1d44('0x4')];_0x1051b3<_0x52e933;_0x1051b3++){var _0x26431a=events[_0x1051b3];var _0x4958cc=createListener('voiceQueue:'+_0x26431a,_0x4004bd);VoiceQueueEvents['on'](_0x26431a,_0x4958cc);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8cd1ec6..bddc01b 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 _0xadd3=['connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','/index','getVoiceQueuesReport','/:id','post','put','update','destroy','exports','multer','util','path'];(function(_0x350c37,_0x417bc3){var _0x29e32d=function(_0x49e44d){while(--_0x49e44d){_0x350c37['push'](_0x350c37['shift']());}};_0x29e32d(++_0x417bc3);}(_0xadd3,0xe7));var _0x3add=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xadd3[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x3add('0x0'));var util=require(_0x3add('0x1'));var path=require(_0x3add('0x2'));var timeout=require(_0x3add('0x3'));var express=require('express');var router=express[_0x3add('0x4')]();var fs_extra=require(_0x3add('0x5'));var auth=require(_0x3add('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x3add('0x7')]('/',auth[_0x3add('0x8')](),controller['index']);router[_0x3add('0x7')](_0x3add('0x9'),auth[_0x3add('0x8')](),controller['describe']);router[_0x3add('0x7')](_0x3add('0xa'),auth[_0x3add('0x8')](),controller[_0x3add('0xb')]);router[_0x3add('0x7')](_0x3add('0xc'),auth[_0x3add('0x8')](),controller['show']);router[_0x3add('0xd')]('/',auth[_0x3add('0x8')](),controller['create']);router[_0x3add('0xe')](_0x3add('0xc'),auth[_0x3add('0x8')](),controller[_0x3add('0xf')]);router['delete'](_0x3add('0xc'),auth[_0x3add('0x8')](),controller[_0x3add('0x10')]);module[_0x3add('0x11')]=router; \ No newline at end of file +var _0xac9b=['../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','/describe','/index','get','/:id','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac9b,0x8d));var _0xbac9=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xac9b[_0x13606d];return _0x1b85b0;};'use strict';var multer=require('multer');var util=require(_0xbac9('0x0'));var path=require(_0xbac9('0x1'));var timeout=require(_0xbac9('0x2'));var express=require(_0xbac9('0x3'));var router=express[_0xbac9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbac9('0x5'));var interaction=require(_0xbac9('0x6'));var config=require(_0xbac9('0x7'));var controller=require(_0xbac9('0x8'));router['get']('/',auth[_0xbac9('0x9')](),controller[_0xbac9('0xa')]);router['get'](_0xbac9('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbac9('0xc'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xbac9('0xd')](_0xbac9('0xe'),auth[_0xbac9('0x9')](),controller['show']);router[_0xbac9('0xf')]('/',auth[_0xbac9('0x9')](),controller['create']);router[_0xbac9('0x10')](_0xbac9('0xe'),auth[_0xbac9('0x9')](),controller[_0xbac9('0x11')]);router[_0xbac9('0x12')]('/:id',auth[_0xbac9('0x9')](),controller[_0xbac9('0x13')]);module[_0xbac9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d15f547..7cacb11 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 _0xd33f=['sequelize','moment','exports','STRING','DATE','getDataValue','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xd33f,0x1c0));var _0xfd33=function(_0x5ce4e3,_0x42cb9a){_0x5ce4e3=_0x5ce4e3-0x0;var _0x42248f=_0xd33f[_0x5ce4e3];return _0x42248f;};'use strict';var Sequelize=require(_0xfd33('0x0'));var moment=require(_0xfd33('0x1'));module[_0xfd33('0x2')]={'type':{'type':Sequelize[_0xfd33('0x3')]},'uniqueid':{'type':Sequelize[_0xfd33('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfd33('0x3')]},'queue':{'type':Sequelize[_0xfd33('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xfd33('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xfd33('0x4')],'set':function(_0x41ae34){var _0x2637ef=moment(_0x41ae34);var _0x2925d5=moment(this[_0xfd33('0x5')]('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x536b89=_0x2637ef[_0xfd33('0x6')](_0x2925d5,_0xfd33('0x7'));this[_0xfd33('0x8')](_0xfd33('0x9'),_0x41ae34);this[_0xfd33('0x8')](_0xfd33('0xa'),_0x536b89||null);}},'position':{'type':Sequelize[_0xfd33('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xfd33('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xfd33('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xfd33('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xfd33('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xfd33('0x3')],'comment':_0xfd33('0xd')},'originalposition':{'type':Sequelize[_0xfd33('0xb')]},'channel':{'type':Sequelize[_0xfd33('0x3')]},'connectedlinenum':{'type':Sequelize[_0xfd33('0x3')]},'connectedlinename':{'type':Sequelize[_0xfd33('0x3')]},'accountcode':{'type':Sequelize[_0xfd33('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xfd33('0x3')]},'holdtime':{'type':Sequelize[_0xfd33('0xb')]},'mohtime':{'type':Sequelize[_0xfd33('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xfd33('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xfd33('0x3')]},'transferuniqueid':{'type':Sequelize[_0xfd33('0x3')]},'disposition':{'type':Sequelize[_0xfd33('0x3')]},'secondDisposition':{'type':Sequelize[_0xfd33('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfd33('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xfd33('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0xfd33('0x3')]}}; \ No newline at end of file +var _0x1bb8=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','getDataValue','format','seconds','setDataValue','queuecallerleaveAt'];(function(_0x16cfda,_0x229689){var _0xf8836=function(_0x58b062){while(--_0x58b062){_0x16cfda['push'](_0x16cfda['shift']());}};_0xf8836(++_0x229689);}(_0x1bb8,0x86));var _0x81bb=function(_0x15236b,_0x4d8dff){_0x15236b=_0x15236b-0x0;var _0x185546=_0x1bb8[_0x15236b];return _0x185546;};'use strict';var Sequelize=require(_0x81bb('0x0'));var moment=require('moment');module[_0x81bb('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x81bb('0x2')]},'calleridnum':{'type':Sequelize[_0x81bb('0x2')]},'calleridname':{'type':Sequelize[_0x81bb('0x2')]},'queue':{'type':Sequelize[_0x81bb('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x81bb('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x19bcba){var _0x589a9a=moment(_0x19bcba);var _0x414582=moment(this[_0x81bb('0x4')]('queuecallerjoinAt'))[_0x81bb('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x44a27e=_0x589a9a['diff'](_0x414582,_0x81bb('0x6'));this[_0x81bb('0x7')](_0x81bb('0x8'),_0x19bcba);this[_0x81bb('0x7')](_0x81bb('0x9'),_0x44a27e||null);}},'position':{'type':Sequelize[_0x81bb('0xa')]},'count':{'type':Sequelize[_0x81bb('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x81bb('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x81bb('0x3')]},'queuecallerexit':{'type':Sequelize[_0x81bb('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x81bb('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x81bb('0x2')],'comment':_0x81bb('0xc')},'originalposition':{'type':Sequelize[_0x81bb('0xa')]},'channel':{'type':Sequelize[_0x81bb('0x2')]},'connectedlinenum':{'type':Sequelize[_0x81bb('0x2')]},'connectedlinename':{'type':Sequelize[_0x81bb('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x81bb('0x2')]},'priority':{'type':Sequelize[_0x81bb('0x2')]},'holdtime':{'type':Sequelize[_0x81bb('0xa')]},'mohtime':{'type':Sequelize[_0x81bb('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x81bb('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x81bb('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x81bb('0x2')]},'transferuniqueid':{'type':Sequelize[_0x81bb('0x2')]},'disposition':{'type':Sequelize[_0x81bb('0x2')]},'secondDisposition':{'type':Sequelize[_0x81bb('0x2')]},'thirdDisposition':{'type':Sequelize[_0x81bb('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x81bb('0xa')],'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 316f959..2883465 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 _0x2c36=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','filter','options','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model'];(function(_0x3b4689,_0x213058){var _0x59f594=function(_0x467c11){while(--_0x467c11){_0x3b4689['push'](_0x3b4689['shift']());}};_0x59f594(++_0x213058);}(_0x2c36,0x1a8));var _0x62c3=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x2c36[_0x4f0e62];return _0x117ab8;};'use strict';var emlformat=require(_0x62c3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62c3('0x1'));var rp=require(_0x62c3('0x2'));var moment=require(_0x62c3('0x3'));var BPromise=require(_0x62c3('0x4'));var Mustache=require(_0x62c3('0x5'));var util=require(_0x62c3('0x6'));var path=require('path');var sox=require(_0x62c3('0x7'));var csv=require(_0x62c3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62c3('0x9'));var _=require(_0x62c3('0xa'));var squel=require(_0x62c3('0xb'));var crypto=require('crypto');var jsforce=require(_0x62c3('0xc'));var deskjs=require(_0x62c3('0xd'));var toCsv=require(_0x62c3('0x8'));var querystring=require(_0x62c3('0xe'));var Papa=require(_0x62c3('0xf'));var Redis=require('ioredis');var authService=require(_0x62c3('0x10'));var qs=require(_0x62c3('0x11'));var as=require(_0x62c3('0x12'));var hardwareService=require(_0x62c3('0x13'));var logger=require('../../config/logger')(_0x62c3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x62c3('0x15'));var db=require(_0x62c3('0x16'))['db'];config[_0x62c3('0x17')]=_[_0x62c3('0x18')](config[_0x62c3('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62c3('0x17')]));require(_0x62c3('0x19'))[_0x62c3('0x1a')](socket);function respondWithStatusCode(_0x2cd531,_0x2fcf91){_0x2fcf91=_0x2fcf91||0xcc;return function(_0x6cdd3b){if(_0x6cdd3b){return _0x2cd531[_0x62c3('0x1b')](_0x2fcf91);}return _0x2cd531[_0x62c3('0x1c')](_0x2fcf91)[_0x62c3('0x1d')]();};}function respondWithResult(_0x1f8e1c,_0x108026){_0x108026=_0x108026||0xc8;return function(_0x4844d6){if(_0x4844d6){return _0x1f8e1c[_0x62c3('0x1c')](_0x108026)[_0x62c3('0x1e')](_0x4844d6);}};}function respondWithFilteredResult(_0x41d6e2,_0x2a9e77){return function(_0x3441c6){if(_0x3441c6){var _0x59d6c7=typeof _0x2a9e77[_0x62c3('0x1f')]==='undefined'&&typeof _0x2a9e77[_0x62c3('0x20')]==='undefined';var _0xa3c5c9=_0x3441c6[_0x62c3('0x21')];var _0x334153=_0x59d6c7?0x0:_0x2a9e77[_0x62c3('0x1f')];var _0x3a778f=_0x59d6c7?_0x3441c6[_0x62c3('0x21')]:_0x2a9e77['offset']+_0x2a9e77[_0x62c3('0x20')];var _0x8c1d5d;if(_0x3a778f>=_0xa3c5c9){_0x3a778f=_0xa3c5c9;_0x8c1d5d=0xc8;}else{_0x8c1d5d=0xce;}_0x41d6e2['status'](_0x8c1d5d);return _0x41d6e2['set'](_0x62c3('0x22'),_0x334153+'-'+_0x3a778f+'/'+_0xa3c5c9)[_0x62c3('0x1e')](_0x3441c6);}return null;};}function patchUpdates(_0x4cc2b1){return function(_0x117dd0){try{jsonpatch[_0x62c3('0x23')](_0x117dd0,_0x4cc2b1,!![]);}catch(_0x5cdd5d){return BPromise[_0x62c3('0x24')](_0x5cdd5d);}return _0x117dd0['save']();};}function saveUpdates(_0x76dd0d,_0x4b6dd4){return function(_0x348409){if(_0x348409){return _0x348409['update'](_0x76dd0d)['then'](function(_0x3eb975){return _0x3eb975;});}return null;};}function removeEntity(_0x33df25,_0x12b5e9){return function(_0x2e9497){if(_0x2e9497){return _0x2e9497[_0x62c3('0x25')]()[_0x62c3('0x26')](function(){_0x33df25[_0x62c3('0x1c')](0xcc)[_0x62c3('0x1d')]();});}};}function handleEntityNotFound(_0x9536f,_0x16a491){return function(_0x3f3dd3){if(!_0x3f3dd3){_0x9536f[_0x62c3('0x1b')](0x194);}return _0x3f3dd3;};}function handleError(_0x580d12,_0x5357e9){_0x5357e9=_0x5357e9||0x1f4;return function(_0x1d4999){logger[_0x62c3('0x27')](_0x1d4999[_0x62c3('0x28')]);if(_0x1d4999[_0x62c3('0x29')]){delete _0x1d4999[_0x62c3('0x29')];}_0x580d12[_0x62c3('0x1c')](_0x5357e9)[_0x62c3('0x2a')](_0x1d4999);};}exports[_0x62c3('0x2b')]=function(_0xca4854,_0x663062){var _0x12c8a6={},_0xd06923={},_0x27dcab={'count':0x0,'rows':[]};var _0x199bf8=_[_0x62c3('0x2c')](db[_0x62c3('0x2d')][_0x62c3('0x2e')],function(_0x5644d6){return{'name':_0x5644d6['fieldName'],'type':_0x5644d6[_0x62c3('0x2f')][_0x62c3('0x30')]};});_0xd06923[_0x62c3('0x31')]=_[_0x62c3('0x2c')](_0x199bf8,_0x62c3('0x29'));_0xd06923['query']=_['keys'](_0xca4854[_0x62c3('0x32')]);_0xd06923[_0x62c3('0x33')]=_[_0x62c3('0x34')](_0xd06923['model'],_0xd06923[_0x62c3('0x32')]);_0x12c8a6['attributes']=_[_0x62c3('0x34')](_0xd06923[_0x62c3('0x31')],qs['fields'](_0xca4854[_0x62c3('0x32')][_0x62c3('0x35')]));_0x12c8a6[_0x62c3('0x36')]=_0x12c8a6[_0x62c3('0x36')][_0x62c3('0x37')]?_0x12c8a6[_0x62c3('0x36')]:_0xd06923[_0x62c3('0x31')];if(!_0xca4854[_0x62c3('0x32')]['hasOwnProperty'](_0x62c3('0x38'))){_0x12c8a6[_0x62c3('0x20')]=qs[_0x62c3('0x20')](_0xca4854[_0x62c3('0x32')][_0x62c3('0x20')]);_0x12c8a6[_0x62c3('0x1f')]=qs[_0x62c3('0x1f')](_0xca4854[_0x62c3('0x32')][_0x62c3('0x1f')]);}_0x12c8a6[_0x62c3('0x39')]=qs[_0x62c3('0x3a')](_0xca4854['query']['sort']);_0x12c8a6[_0x62c3('0x3b')]=qs[_0x62c3('0x33')](_[_0x62c3('0x3c')](_0xca4854[_0x62c3('0x32')],_0xd06923[_0x62c3('0x33')]),_0x199bf8);if(_0xca4854['query']['filter']){_0x12c8a6[_0x62c3('0x3b')]=_[_0x62c3('0x3d')](_0x12c8a6[_0x62c3('0x3b')],{'$or':_[_0x62c3('0x2c')](_0x199bf8,function(_0x561543){if(_0x561543[_0x62c3('0x2f')]!==_0x62c3('0x3e')){var _0xf30edf={};_0xf30edf[_0x561543[_0x62c3('0x29')]]={'$like':'%'+_0xca4854['query']['filter']+'%'};return _0xf30edf;}})});}_0x12c8a6=_[_0x62c3('0x3d')]({},_0x12c8a6,_0xca4854['options']);var _0x4de93d={'where':_0x12c8a6[_0x62c3('0x3b')]};return db[_0x62c3('0x2d')]['count'](_0x4de93d)[_0x62c3('0x26')](function(_0x3ce2c3){_0x27dcab[_0x62c3('0x21')]=_0x3ce2c3;if(_0xca4854[_0x62c3('0x32')][_0x62c3('0x3f')]){_0x12c8a6[_0x62c3('0x40')]=[{'all':!![]}];}return db[_0x62c3('0x2d')]['findAll'](_0x12c8a6);})[_0x62c3('0x26')](function(_0x593249){_0x27dcab[_0x62c3('0x41')]=_0x593249;return _0x27dcab;})[_0x62c3('0x26')](respondWithFilteredResult(_0x663062,_0x12c8a6))[_0x62c3('0x42')](handleError(_0x663062,null));};exports[_0x62c3('0x43')]=function(_0x5e60cc,_0x49ff94){var _0x5a3577={'raw':![],'where':{'id':_0x5e60cc[_0x62c3('0x44')]['id']}},_0x4e3ada={};_0x4e3ada['model']=_[_0x62c3('0x45')](db[_0x62c3('0x2d')][_0x62c3('0x2e')]);_0x4e3ada[_0x62c3('0x32')]=_[_0x62c3('0x45')](_0x5e60cc[_0x62c3('0x32')]);_0x4e3ada[_0x62c3('0x33')]=_['intersection'](_0x4e3ada[_0x62c3('0x31')],_0x4e3ada['query']);_0x5a3577[_0x62c3('0x36')]=_['intersection'](_0x4e3ada['model'],qs[_0x62c3('0x35')](_0x5e60cc[_0x62c3('0x32')][_0x62c3('0x35')]));_0x5a3577[_0x62c3('0x36')]=_0x5a3577[_0x62c3('0x36')][_0x62c3('0x37')]?_0x5a3577[_0x62c3('0x36')]:_0x4e3ada[_0x62c3('0x31')];if(_0x5e60cc[_0x62c3('0x32')]['includeAll']){_0x5a3577['include']=[{'all':!![]}];}_0x5a3577=_[_0x62c3('0x3d')]({},_0x5a3577,_0x5e60cc['options']);return db[_0x62c3('0x2d')][_0x62c3('0x46')](_0x5a3577)['then'](handleEntityNotFound(_0x49ff94,null))[_0x62c3('0x26')](respondWithResult(_0x49ff94,null))[_0x62c3('0x42')](handleError(_0x49ff94,null));};exports[_0x62c3('0x47')]=function(_0x4e00ad,_0x5da8ce){return db['VoiceQueueReport'][_0x62c3('0x47')](_0x4e00ad[_0x62c3('0x48')],{})['then'](respondWithResult(_0x5da8ce,0xc9))['catch'](handleError(_0x5da8ce,null));};exports['update']=function(_0x355af5,_0x249e6e){if(_0x355af5['body']['id']){delete _0x355af5[_0x62c3('0x48')]['id'];}return db[_0x62c3('0x2d')][_0x62c3('0x46')]({'where':{'id':_0x355af5[_0x62c3('0x44')]['id']}})[_0x62c3('0x26')](handleEntityNotFound(_0x249e6e,null))['then'](saveUpdates(_0x355af5[_0x62c3('0x48')],null))[_0x62c3('0x26')](respondWithResult(_0x249e6e,null))[_0x62c3('0x42')](handleError(_0x249e6e,null));};exports[_0x62c3('0x25')]=function(_0x41966e,_0x2f6a46){return db['VoiceQueueReport'][_0x62c3('0x46')]({'where':{'id':_0x41966e[_0x62c3('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f6a46,null))[_0x62c3('0x26')](removeEntity(_0x2f6a46,null))['catch'](handleError(_0x2f6a46,null));};exports[_0x62c3('0x49')]=function(_0x5c75f5,_0x470311){return db[_0x62c3('0x2d')][_0x62c3('0x49')]()[_0x62c3('0x26')](respondWithResult(_0x470311,null))[_0x62c3('0x42')](handleError(_0x470311,null));};exports[_0x62c3('0x4a')]=function(_0x406d22,_0x3176c8){var _0x4eadf7={},_0x264560={},_0x43d3d1={'count':0x0,'rows':[]};_0x264560[_0x62c3('0x31')]=_['keys'](db[_0x62c3('0x2d')][_0x62c3('0x2e')]);_0x264560[_0x62c3('0x32')]=_[_0x62c3('0x45')](_0x406d22[_0x62c3('0x32')]);_0x264560[_0x62c3('0x33')]=_[_0x62c3('0x34')](_0x264560[_0x62c3('0x31')],_0x264560[_0x62c3('0x32')]);_0x4eadf7[_0x62c3('0x36')]=_[_0x62c3('0x34')](_0x264560[_0x62c3('0x31')],qs['fields'](_0x406d22['query'][_0x62c3('0x35')]));_0x4eadf7[_0x62c3('0x36')]=_0x4eadf7[_0x62c3('0x36')]['length']?_0x4eadf7[_0x62c3('0x36')]:_0x264560['model'];if(!_0x406d22[_0x62c3('0x32')][_0x62c3('0x4b')](_0x62c3('0x38'))){_0x4eadf7[_0x62c3('0x20')]=qs['limit'](_0x406d22[_0x62c3('0x32')]['limit']);_0x4eadf7[_0x62c3('0x1f')]=qs[_0x62c3('0x1f')](_0x406d22[_0x62c3('0x32')][_0x62c3('0x1f')]);}_0x4eadf7['order']=qs['sort'](_0x406d22[_0x62c3('0x32')][_0x62c3('0x3a')]);_0x4eadf7[_0x62c3('0x3b')]=qs[_0x62c3('0x33')](_[_0x62c3('0x3c')](_0x406d22['query'],_0x264560[_0x62c3('0x33')]));if(_0x406d22[_0x62c3('0x32')]['filter']){_0x4eadf7[_0x62c3('0x3b')]=_[_0x62c3('0x3d')](_0x4eadf7['where'],{'$or':_[_0x62c3('0x2c')](_0x4eadf7['attributes'],function(_0x2cb476){var _0x4f8ced={};_0x4f8ced[_0x2cb476]={'$like':'%'+_0x406d22[_0x62c3('0x32')][_0x62c3('0x4c')]+'%'};return _0x4f8ced;})});}_0x4eadf7=_[_0x62c3('0x3d')]({},_0x4eadf7,_0x406d22[_0x62c3('0x4d')]);var _0x12fbb7={'where':_0x4eadf7[_0x62c3('0x3b')]};return db[_0x62c3('0x2d')][_0x62c3('0x21')](_0x12fbb7)[_0x62c3('0x26')](function(_0x3c7d97){_0x43d3d1[_0x62c3('0x21')]=_0x3c7d97;if(_0x406d22[_0x62c3('0x32')]['includeAll']){_0x4eadf7[_0x62c3('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x62c3('0x4e')](_0x4eadf7);})[_0x62c3('0x26')](function(_0x462d7c){_0x43d3d1[_0x62c3('0x41')]=_0x462d7c;return _0x43d3d1;})[_0x62c3('0x26')](respondWithFilteredResult(_0x3176c8,_0x4eadf7,_0x62c3('0x4a')))[_0x62c3('0x42')](handleError(_0x3176c8,null,_0x62c3('0x4a')));}; \ No newline at end of file +var _0xddaf=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','getVoiceQueuesReport','hasOwnProperty','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv'];(function(_0x2b5c7d,_0x21bbc8){var _0xd9cebb=function(_0x535306){while(--_0x535306){_0x2b5c7d['push'](_0x2b5c7d['shift']());}};_0xd9cebb(++_0x21bbc8);}(_0xddaf,0xf3));var _0xfdda=function(_0x58538e,_0xad8164){_0x58538e=_0x58538e-0x0;var _0x396f51=_0xddaf[_0x58538e];return _0x396f51;};'use strict';var emlformat=require(_0xfdda('0x0'));var rimraf=require(_0xfdda('0x1'));var zipdir=require(_0xfdda('0x2'));var jsonpatch=require(_0xfdda('0x3'));var rp=require('request-promise');var moment=require(_0xfdda('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfdda('0x5'));var path=require(_0xfdda('0x6'));var sox=require(_0xfdda('0x7'));var csv=require(_0xfdda('0x8'));var ejs=require(_0xfdda('0x9'));var fs=require('fs');var fs_extra=require(_0xfdda('0xa'));var _=require(_0xfdda('0xb'));var squel=require(_0xfdda('0xc'));var crypto=require(_0xfdda('0xd'));var jsforce=require(_0xfdda('0xe'));var deskjs=require(_0xfdda('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfdda('0x10'));var Redis=require(_0xfdda('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfdda('0x12'));var as=require(_0xfdda('0x13'));var hardwareService=require(_0xfdda('0x14'));var logger=require(_0xfdda('0x15'))(_0xfdda('0x16'));var utils=require('../../config/utils');var config=require(_0xfdda('0x17'));var licenseUtil=require(_0xfdda('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfdda('0x19')](config[_0xfdda('0x1a')],{'host':_0xfdda('0x1b'),'port':0x18eb});var socket=require(_0xfdda('0x1c'))(new Redis(config['redis']));require(_0xfdda('0x1d'))[_0xfdda('0x1e')](socket);function respondWithStatusCode(_0x4a25fc,_0x32da90){_0x32da90=_0x32da90||0xcc;return function(_0x291840){if(_0x291840){return _0x4a25fc['sendStatus'](_0x32da90);}return _0x4a25fc[_0xfdda('0x1f')](_0x32da90)['end']();};}function respondWithResult(_0x380686,_0x246420){_0x246420=_0x246420||0xc8;return function(_0x41ae29){if(_0x41ae29){return _0x380686[_0xfdda('0x1f')](_0x246420)[_0xfdda('0x20')](_0x41ae29);}};}function respondWithFilteredResult(_0x516655,_0x98adac){return function(_0x379aea){if(_0x379aea){var _0x14b360=typeof _0x98adac[_0xfdda('0x21')]===_0xfdda('0x22')&&typeof _0x98adac[_0xfdda('0x23')]===_0xfdda('0x22');var _0x5d8323=_0x379aea[_0xfdda('0x24')];var _0x74b323=_0x14b360?0x0:_0x98adac[_0xfdda('0x21')];var _0x10bd65=_0x14b360?_0x379aea[_0xfdda('0x24')]:_0x98adac['offset']+_0x98adac[_0xfdda('0x23')];var _0x5ae42f;if(_0x10bd65>=_0x5d8323){_0x10bd65=_0x5d8323;_0x5ae42f=0xc8;}else{_0x5ae42f=0xce;}_0x516655['status'](_0x5ae42f);return _0x516655[_0xfdda('0x25')](_0xfdda('0x26'),_0x74b323+'-'+_0x10bd65+'/'+_0x5d8323)[_0xfdda('0x20')](_0x379aea);}return null;};}function patchUpdates(_0x189874){return function(_0x53eef1){try{jsonpatch[_0xfdda('0x27')](_0x53eef1,_0x189874,!![]);}catch(_0x1f7b92){return BPromise[_0xfdda('0x28')](_0x1f7b92);}return _0x53eef1[_0xfdda('0x29')]();};}function saveUpdates(_0x356a09,_0xac1a8c){return function(_0x56ce22){if(_0x56ce22){return _0x56ce22[_0xfdda('0x2a')](_0x356a09)['then'](function(_0x5ea016){return _0x5ea016;});}return null;};}function removeEntity(_0x5bdbc0,_0x33463d){return function(_0x3ccf3c){if(_0x3ccf3c){return _0x3ccf3c[_0xfdda('0x2b')]()[_0xfdda('0x2c')](function(){_0x5bdbc0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20025a,_0x173383){return function(_0x31c859){if(!_0x31c859){_0x20025a[_0xfdda('0x2d')](0x194);}return _0x31c859;};}function handleError(_0x46248b,_0x11a1f5){_0x11a1f5=_0x11a1f5||0x1f4;return function(_0x2282b6){logger[_0xfdda('0x2e')](_0x2282b6['stack']);if(_0x2282b6[_0xfdda('0x2f')]){delete _0x2282b6['name'];}_0x46248b[_0xfdda('0x1f')](_0x11a1f5)[_0xfdda('0x30')](_0x2282b6);};}exports['index']=function(_0x51c612,_0x38019e){var _0x336e80={},_0x1387e6={},_0x1b92ca={'count':0x0,'rows':[]};var _0xe98aa0=_[_0xfdda('0x31')](db[_0xfdda('0x32')][_0xfdda('0x33')],function(_0x2f211b){return{'name':_0x2f211b[_0xfdda('0x34')],'type':_0x2f211b['type'][_0xfdda('0x35')]};});_0x1387e6[_0xfdda('0x36')]=_[_0xfdda('0x31')](_0xe98aa0,_0xfdda('0x2f'));_0x1387e6['query']=_[_0xfdda('0x37')](_0x51c612[_0xfdda('0x38')]);_0x1387e6[_0xfdda('0x39')]=_[_0xfdda('0x3a')](_0x1387e6[_0xfdda('0x36')],_0x1387e6[_0xfdda('0x38')]);_0x336e80[_0xfdda('0x3b')]=_[_0xfdda('0x3a')](_0x1387e6['model'],qs[_0xfdda('0x3c')](_0x51c612[_0xfdda('0x38')][_0xfdda('0x3c')]));_0x336e80['attributes']=_0x336e80[_0xfdda('0x3b')][_0xfdda('0x3d')]?_0x336e80[_0xfdda('0x3b')]:_0x1387e6['model'];if(!_0x51c612['query']['hasOwnProperty'](_0xfdda('0x3e'))){_0x336e80[_0xfdda('0x23')]=qs[_0xfdda('0x23')](_0x51c612[_0xfdda('0x38')][_0xfdda('0x23')]);_0x336e80[_0xfdda('0x21')]=qs[_0xfdda('0x21')](_0x51c612['query'][_0xfdda('0x21')]);}_0x336e80[_0xfdda('0x3f')]=qs[_0xfdda('0x40')](_0x51c612[_0xfdda('0x38')][_0xfdda('0x40')]);_0x336e80[_0xfdda('0x41')]=qs[_0xfdda('0x39')](_['pick'](_0x51c612[_0xfdda('0x38')],_0x1387e6[_0xfdda('0x39')]),_0xe98aa0);if(_0x51c612[_0xfdda('0x38')][_0xfdda('0x42')]){_0x336e80[_0xfdda('0x41')]=_[_0xfdda('0x43')](_0x336e80[_0xfdda('0x41')],{'$or':_[_0xfdda('0x31')](_0xe98aa0,function(_0xea3171){if(_0xea3171[_0xfdda('0x44')]!==_0xfdda('0x45')){var _0x28f4f9={};_0x28f4f9[_0xea3171[_0xfdda('0x2f')]]={'$like':'%'+_0x51c612[_0xfdda('0x38')][_0xfdda('0x42')]+'%'};return _0x28f4f9;}})});}_0x336e80=_[_0xfdda('0x43')]({},_0x336e80,_0x51c612[_0xfdda('0x46')]);var _0x146734={'where':_0x336e80['where']};return db[_0xfdda('0x32')][_0xfdda('0x24')](_0x146734)[_0xfdda('0x2c')](function(_0x117c09){_0x1b92ca[_0xfdda('0x24')]=_0x117c09;if(_0x51c612[_0xfdda('0x38')][_0xfdda('0x47')]){_0x336e80[_0xfdda('0x48')]=[{'all':!![]}];}return db[_0xfdda('0x32')][_0xfdda('0x49')](_0x336e80);})[_0xfdda('0x2c')](function(_0x4d5531){_0x1b92ca['rows']=_0x4d5531;return _0x1b92ca;})[_0xfdda('0x2c')](respondWithFilteredResult(_0x38019e,_0x336e80))['catch'](handleError(_0x38019e,null));};exports[_0xfdda('0x4a')]=function(_0x1c79e3,_0xaa3ec9){var _0x35b608={'raw':![],'where':{'id':_0x1c79e3[_0xfdda('0x4b')]['id']}},_0x456b82={};_0x456b82['model']=_[_0xfdda('0x37')](db['VoiceQueueReport'][_0xfdda('0x33')]);_0x456b82[_0xfdda('0x38')]=_[_0xfdda('0x37')](_0x1c79e3[_0xfdda('0x38')]);_0x456b82['filters']=_[_0xfdda('0x3a')](_0x456b82[_0xfdda('0x36')],_0x456b82[_0xfdda('0x38')]);_0x35b608[_0xfdda('0x3b')]=_['intersection'](_0x456b82[_0xfdda('0x36')],qs[_0xfdda('0x3c')](_0x1c79e3[_0xfdda('0x38')]['fields']));_0x35b608[_0xfdda('0x3b')]=_0x35b608['attributes'][_0xfdda('0x3d')]?_0x35b608[_0xfdda('0x3b')]:_0x456b82['model'];if(_0x1c79e3[_0xfdda('0x38')][_0xfdda('0x47')]){_0x35b608[_0xfdda('0x48')]=[{'all':!![]}];}_0x35b608=_[_0xfdda('0x43')]({},_0x35b608,_0x1c79e3[_0xfdda('0x46')]);return db[_0xfdda('0x32')][_0xfdda('0x4c')](_0x35b608)[_0xfdda('0x2c')](handleEntityNotFound(_0xaa3ec9,null))[_0xfdda('0x2c')](respondWithResult(_0xaa3ec9,null))['catch'](handleError(_0xaa3ec9,null));};exports['create']=function(_0x4963c2,_0x5893db){return db[_0xfdda('0x32')][_0xfdda('0x4d')](_0x4963c2[_0xfdda('0x4e')],{})[_0xfdda('0x2c')](respondWithResult(_0x5893db,0xc9))[_0xfdda('0x4f')](handleError(_0x5893db,null));};exports['update']=function(_0x5813cb,_0x4695f0){if(_0x5813cb[_0xfdda('0x4e')]['id']){delete _0x5813cb[_0xfdda('0x4e')]['id'];}return db['VoiceQueueReport'][_0xfdda('0x4c')]({'where':{'id':_0x5813cb['params']['id']}})['then'](handleEntityNotFound(_0x4695f0,null))[_0xfdda('0x2c')](saveUpdates(_0x5813cb[_0xfdda('0x4e')],null))['then'](respondWithResult(_0x4695f0,null))['catch'](handleError(_0x4695f0,null));};exports['destroy']=function(_0x1c1b99,_0x1a7342){return db[_0xfdda('0x32')][_0xfdda('0x4c')]({'where':{'id':_0x1c1b99['params']['id']}})[_0xfdda('0x2c')](handleEntityNotFound(_0x1a7342,null))[_0xfdda('0x2c')](removeEntity(_0x1a7342,null))[_0xfdda('0x4f')](handleError(_0x1a7342,null));};exports[_0xfdda('0x50')]=function(_0x40d811,_0x36d88a){return db['VoiceQueueReport'][_0xfdda('0x50')]()['then'](respondWithResult(_0x36d88a,null))[_0xfdda('0x4f')](handleError(_0x36d88a,null));};exports[_0xfdda('0x51')]=function(_0x187634,_0x4e10e7){var _0x46f9f6={},_0x2dd3d1={},_0x2f4a54={'count':0x0,'rows':[]};_0x2dd3d1['model']=_[_0xfdda('0x37')](db[_0xfdda('0x32')][_0xfdda('0x33')]);_0x2dd3d1[_0xfdda('0x38')]=_[_0xfdda('0x37')](_0x187634[_0xfdda('0x38')]);_0x2dd3d1[_0xfdda('0x39')]=_['intersection'](_0x2dd3d1['model'],_0x2dd3d1[_0xfdda('0x38')]);_0x46f9f6[_0xfdda('0x3b')]=_[_0xfdda('0x3a')](_0x2dd3d1[_0xfdda('0x36')],qs['fields'](_0x187634[_0xfdda('0x38')]['fields']));_0x46f9f6['attributes']=_0x46f9f6[_0xfdda('0x3b')][_0xfdda('0x3d')]?_0x46f9f6['attributes']:_0x2dd3d1[_0xfdda('0x36')];if(!_0x187634[_0xfdda('0x38')][_0xfdda('0x52')](_0xfdda('0x3e'))){_0x46f9f6[_0xfdda('0x23')]=qs[_0xfdda('0x23')](_0x187634[_0xfdda('0x38')]['limit']);_0x46f9f6['offset']=qs[_0xfdda('0x21')](_0x187634['query']['offset']);}_0x46f9f6[_0xfdda('0x3f')]=qs['sort'](_0x187634[_0xfdda('0x38')][_0xfdda('0x40')]);_0x46f9f6[_0xfdda('0x41')]=qs[_0xfdda('0x39')](_[_0xfdda('0x53')](_0x187634[_0xfdda('0x38')],_0x2dd3d1['filters']));if(_0x187634[_0xfdda('0x38')][_0xfdda('0x42')]){_0x46f9f6[_0xfdda('0x41')]=_['merge'](_0x46f9f6[_0xfdda('0x41')],{'$or':_[_0xfdda('0x31')](_0x46f9f6[_0xfdda('0x3b')],function(_0x5b1afd){var _0x23a8c2={};_0x23a8c2[_0x5b1afd]={'$like':'%'+_0x187634[_0xfdda('0x38')]['filter']+'%'};return _0x23a8c2;})});}_0x46f9f6=_['merge']({},_0x46f9f6,_0x187634[_0xfdda('0x46')]);var _0x314158={'where':_0x46f9f6[_0xfdda('0x41')]};return db[_0xfdda('0x32')][_0xfdda('0x24')](_0x314158)[_0xfdda('0x2c')](function(_0x590254){_0x2f4a54[_0xfdda('0x24')]=_0x590254;if(_0x187634[_0xfdda('0x38')][_0xfdda('0x47')]){_0x46f9f6[_0xfdda('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xfdda('0x49')](_0x46f9f6);})[_0xfdda('0x2c')](function(_0x30ee76){_0x2f4a54['rows']=_0x30ee76;return _0x2f4a54;})[_0xfdda('0x2c')](respondWithFilteredResult(_0x4e10e7,_0x46f9f6,'getVoiceQueuesReport'))[_0xfdda('0x4f')](handleError(_0x4e10e7,null,_0xfdda('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6b5baa9..25c3300 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 _0x347f=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x3d19e,_0x34d230){var _0x3987d4=function(_0x33565f){while(--_0x33565f){_0x3d19e['push'](_0x3d19e['shift']());}};_0x3987d4(++_0x34d230);}(_0x347f,0x71));var _0xf347=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x347f[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xf347('0x0'));var VoiceQueueReport=require(_0xf347('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf347('0x2')](0x0);var events={'afterCreate':_0xf347('0x3'),'afterUpdate':_0xf347('0x4'),'afterDestroy':_0xf347('0x5')};function emitEvent(_0x356ea9){return function(_0x18b534,_0x2c5b07,_0x169bb4){VoiceQueueReportEvents['emit'](_0x356ea9+':'+_0x18b534['id'],_0x18b534);VoiceQueueReportEvents['emit'](_0x356ea9,_0x18b534);_0x169bb4(null);};}for(var e in events){if(events[_0xf347('0x6')](e)){var event=events[e];VoiceQueueReport[_0xf347('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xd6ed=['emit','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x516aa5,_0x3931df){var _0x28c07a=function(_0x168908){while(--_0x168908){_0x516aa5['push'](_0x516aa5['shift']());}};_0x28c07a(++_0x3931df);}(_0xd6ed,0x1aa));var _0xdd6e=function(_0x1a0cbb,_0x159f6){_0x1a0cbb=_0x1a0cbb-0x0;var _0x32640f=_0xd6ed[_0x1a0cbb];return _0x32640f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xdd6e('0x0'))['db'][_0xdd6e('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdd6e('0x2')](0x0);var events={'afterCreate':_0xdd6e('0x3'),'afterUpdate':_0xdd6e('0x4'),'afterDestroy':_0xdd6e('0x5')};function emitEvent(_0x23c0ab){return function(_0xca297a,_0x2e62af,_0x2a80fb){VoiceQueueReportEvents[_0xdd6e('0x6')](_0x23c0ab+':'+_0xca297a['id'],_0xca297a);VoiceQueueReportEvents[_0xdd6e('0x6')](_0x23c0ab,_0xca297a);_0x2a80fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xdd6e('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 468dc93..da4a02d 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 _0x1a11=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','calleridnum','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4ff1e9,_0x321637){var _0x53b815=function(_0xdd679d){while(--_0xdd679d){_0x4ff1e9['push'](_0x4ff1e9['shift']());}};_0x53b815(++_0x321637);}(_0x1a11,0x120));var _0x11a1=function(_0x5a0abb,_0x740a88){_0x5a0abb=_0x5a0abb-0x0;var _0x2d69c9=_0x1a11[_0x5a0abb];return _0x2d69c9;};'use strict';var _=require(_0x11a1('0x0'));var util=require(_0x11a1('0x1'));var logger=require(_0x11a1('0x2'))('api');var moment=require(_0x11a1('0x3'));var BPromise=require(_0x11a1('0x4'));var rp=require(_0x11a1('0x5'));var fs=require('fs');var path=require(_0x11a1('0x6'));var rimraf=require(_0x11a1('0x7'));var config=require(_0x11a1('0x8'));var attributes=require(_0x11a1('0x9'));module[_0x11a1('0xa')]=function(_0x1333f7,_0x70c9b5){return _0x1333f7[_0x11a1('0xb')](_0x11a1('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x11a1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9ab=['report_queue','calleridnum','lodash','moment','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','define'];(function(_0x7f9ef5,_0x427cf5){var _0x572f9f=function(_0x53103f){while(--_0x53103f){_0x7f9ef5['push'](_0x7f9ef5['shift']());}};_0x572f9f(++_0x427cf5);}(_0xa9ab,0x1f1));var _0xba9a=function(_0x1f6c90,_0x3b9c8c){_0x1f6c90=_0x1f6c90-0x0;var _0x147a1a=_0xa9ab[_0x1f6c90];return _0x147a1a;};'use strict';var _=require(_0xba9a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xba9a('0x1'));var BPromise=require('bluebird');var rp=require(_0xba9a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba9a('0x3'));var attributes=require(_0xba9a('0x4'));module[_0xba9a('0x5')]=function(_0x391c11,_0x1fbe24){return _0x391c11[_0xba9a('0x6')]('VoiceQueueReport',attributes,{'tableName':_0xba9a('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xba9a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 0be40c6..88e258f 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 _0xfa19=['error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5685b3,_0x2f3adb){var _0x381680=function(_0x411cd2){while(--_0x411cd2){_0x5685b3['push'](_0x5685b3['shift']());}};_0x381680(++_0x2f3adb);}(_0xfa19,0x6b));var _0x9fa1=function(_0x225261,_0x441cff){_0x225261=_0x225261-0x0;var _0x4868bf=_0xfa19[_0x225261];return _0x4868bf;};'use strict';var _=require('lodash');var util=require(_0x9fa1('0x0'));var moment=require(_0x9fa1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9fa1('0x2'));var fs=require('fs');var Redis=require(_0x9fa1('0x3'));var db=require(_0x9fa1('0x4'))['db'];var utils=require(_0x9fa1('0x5'));var logger=require(_0x9fa1('0x6'))(_0x9fa1('0x7'));var config=require(_0x9fa1('0x8'));var jayson=require(_0x9fa1('0x9'));var client=jayson[_0x9fa1('0xa')][_0x9fa1('0xb')]({'port':0x232a});config['redis']=_[_0x9fa1('0xc')](config['redis'],{'host':_0x9fa1('0xd'),'port':0x18eb});var socket=require(_0x9fa1('0xe'))(new Redis(config[_0x9fa1('0xf')]));require('./voiceQueueReport.socket')[_0x9fa1('0x10')](socket);function respondWithRpcPromise(_0x25365e,_0xeab9c4,_0x48bb31){return new BPromise(function(_0x268dad,_0x4fd64f){return client[_0x9fa1('0x11')](_0x25365e,_0x48bb31)[_0x9fa1('0x12')](function(_0xe3acd6){logger[_0x9fa1('0x13')](_0x9fa1('0x14'),_0xeab9c4,_0x9fa1('0x15'));logger[_0x9fa1('0x16')](_0x9fa1('0x17'),_0xeab9c4,'request\x20sent',JSON[_0x9fa1('0x18')](_0xe3acd6));if(_0xe3acd6['error']){if(_0xe3acd6[_0x9fa1('0x19')][_0x9fa1('0x1a')]===0x1f4){logger[_0x9fa1('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0xeab9c4,_0xe3acd6[_0x9fa1('0x19')][_0x9fa1('0x1b')]);return _0x4fd64f(_0xe3acd6['error'][_0x9fa1('0x1b')]);}logger[_0x9fa1('0x19')](_0x9fa1('0x14'),_0xeab9c4,_0xe3acd6[_0x9fa1('0x19')][_0x9fa1('0x1b')]);return _0x268dad(_0xe3acd6[_0x9fa1('0x19')]['message']);}else{logger['info'](_0x9fa1('0x14'),_0xeab9c4,_0x9fa1('0x15'));_0x268dad(_0xe3acd6[_0x9fa1('0x1c')]['message']);}})[_0x9fa1('0x1d')](function(_0x262829){logger[_0x9fa1('0x19')](_0x9fa1('0x14'),_0xeab9c4,_0x262829);_0x4fd64f(_0x262829);});});}exports[_0x9fa1('0x1e')]=function(_0x5c5bf6){var _0x4f2798=this;return new Promise(function(_0xc4fc8e,_0x1cf225){return db[_0x9fa1('0x1f')][_0x9fa1('0x20')]({'raw':_0x5c5bf6[_0x9fa1('0x21')]?_0x5c5bf6['options'][_0x9fa1('0x22')]===undefined?!![]:![]:!![],'where':_0x5c5bf6[_0x9fa1('0x21')]?_0x5c5bf6[_0x9fa1('0x21')][_0x9fa1('0x23')]||null:null,'attributes':_0x5c5bf6[_0x9fa1('0x21')]?_0x5c5bf6[_0x9fa1('0x21')][_0x9fa1('0x24')]||null:null,'limit':_0x5c5bf6[_0x9fa1('0x21')]?_0x5c5bf6[_0x9fa1('0x21')][_0x9fa1('0x25')]||null:null,'include':_0x5c5bf6[_0x9fa1('0x21')]?_0x5c5bf6['options'][_0x9fa1('0x26')]?_[_0x9fa1('0x27')](_0x5c5bf6[_0x9fa1('0x21')]['include'],function(_0x4e8f2b){return{'model':db[_0x4e8f2b[_0x9fa1('0x28')]],'as':_0x4e8f2b['as'],'attributes':_0x4e8f2b[_0x9fa1('0x24')],'include':_0x4e8f2b['include']?_[_0x9fa1('0x27')](_0x4e8f2b[_0x9fa1('0x26')],function(_0x1c176a){return{'model':db[_0x1c176a[_0x9fa1('0x28')]],'as':_0x1c176a['as'],'attributes':_0x1c176a[_0x9fa1('0x24')],'include':_0x1c176a['include']?_[_0x9fa1('0x27')](_0x1c176a[_0x9fa1('0x26')],function(_0x485345){return{'model':db[_0x485345[_0x9fa1('0x28')]],'as':_0x485345['as'],'attributes':_0x485345[_0x9fa1('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9fa1('0x12')](function(_0x38b9bc){logger[_0x9fa1('0x13')]('GetVoiceQueueReport',_0x5c5bf6);logger[_0x9fa1('0x16')](_0x9fa1('0x1e'),_0x5c5bf6,JSON[_0x9fa1('0x18')](_0x38b9bc));_0xc4fc8e(_0x38b9bc);})['catch'](function(_0x570054){logger[_0x9fa1('0x19')](_0x9fa1('0x1e'),_0x570054[_0x9fa1('0x1b')],_0x5c5bf6);_0x1cf225(_0x4f2798[_0x9fa1('0x19')](0x1f4,_0x570054[_0x9fa1('0x1b')]));});});};exports[_0x9fa1('0x29')]=function(_0x56d10d){var _0x475ad5=this;return new Promise(function(_0x4f4609,_0x23acea){return db[_0x9fa1('0x1f')]['create'](_0x56d10d[_0x9fa1('0x2a')],{'raw':_0x56d10d['options']?_0x56d10d['options'][_0x9fa1('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x585cc2){logger['info'](_0x9fa1('0x29'),_0x56d10d);logger[_0x9fa1('0x16')](_0x9fa1('0x29'),_0x56d10d,JSON[_0x9fa1('0x18')](_0x585cc2));_0x4f4609(_0x585cc2);})['catch'](function(_0xeafec8){logger[_0x9fa1('0x19')](_0x9fa1('0x29'),_0xeafec8['message'],_0x56d10d);_0x23acea(_0x475ad5[_0x9fa1('0x19')](0x1f4,_0xeafec8[_0x9fa1('0x1b')]));});});};exports[_0x9fa1('0x2b')]=function(_0x459fc9){var _0x4935dd=this;return new Promise(function(_0x4db8d3,_0x3cc89b){return db[_0x9fa1('0x1f')]['update'](_0x459fc9['body'],{'raw':_0x459fc9[_0x9fa1('0x21')]?_0x459fc9[_0x9fa1('0x21')][_0x9fa1('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459fc9[_0x9fa1('0x21')]?_0x459fc9['options'][_0x9fa1('0x23')]||null:null,'attributes':_0x459fc9[_0x9fa1('0x21')]?_0x459fc9[_0x9fa1('0x21')]['attributes']||null:null,'limit':_0x459fc9[_0x9fa1('0x21')]?_0x459fc9[_0x9fa1('0x21')][_0x9fa1('0x25')]||null:null})[_0x9fa1('0x12')](function(_0x31e996){logger[_0x9fa1('0x13')](_0x9fa1('0x2b'),_0x459fc9);logger[_0x9fa1('0x16')](_0x9fa1('0x2b'),_0x459fc9,JSON['stringify'](_0x31e996));_0x4db8d3(_0x31e996);})[_0x9fa1('0x1d')](function(_0x22c9d6){logger['error']('UpdateVoiceQueueReport',_0x22c9d6[_0x9fa1('0x1b')],_0x459fc9);_0x3cc89b(_0x4935dd[_0x9fa1('0x19')](0x1f4,_0x22c9d6[_0x9fa1('0x1b')]));});});}; \ No newline at end of file +var _0xebf8=['register','request','then','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','include','map','model','attributes','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x39694b,_0x50befc){var _0x195907=function(_0x3bb7d2){while(--_0x3bb7d2){_0x39694b['push'](_0x39694b['shift']());}};_0x195907(++_0x50befc);}(_0xebf8,0x159));var _0x8ebf=function(_0x1a740e,_0x1449d8){_0x1a740e=_0x1a740e-0x0;var _0x1e201c=_0xebf8[_0x1a740e];return _0x1e201c;};'use strict';var _=require(_0x8ebf('0x0'));var util=require(_0x8ebf('0x1'));var moment=require(_0x8ebf('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ebf('0x3'));var fs=require('fs');var Redis=require(_0x8ebf('0x4'));var db=require(_0x8ebf('0x5'))['db'];var utils=require(_0x8ebf('0x6'));var logger=require(_0x8ebf('0x7'))('rpc');var config=require(_0x8ebf('0x8'));var jayson=require(_0x8ebf('0x9'));var client=jayson[_0x8ebf('0xa')][_0x8ebf('0xb')]({'port':0x232a});config[_0x8ebf('0xc')]=_[_0x8ebf('0xd')](config[_0x8ebf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ebf('0xe'))(new Redis(config[_0x8ebf('0xc')]));require('./voiceQueueReport.socket')[_0x8ebf('0xf')](socket);function respondWithRpcPromise(_0xb23321,_0x56dd3a,_0x1a0a6a){return new BPromise(function(_0x151029,_0x24adba){return client[_0x8ebf('0x10')](_0xb23321,_0x1a0a6a)[_0x8ebf('0x11')](function(_0x57a20d){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x56dd3a,_0x8ebf('0x12'));logger[_0x8ebf('0x13')](_0x8ebf('0x14'),_0x56dd3a,'request\x20sent',JSON[_0x8ebf('0x15')](_0x57a20d));if(_0x57a20d[_0x8ebf('0x16')]){if(_0x57a20d[_0x8ebf('0x16')][_0x8ebf('0x17')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x56dd3a,_0x57a20d[_0x8ebf('0x16')]['message']);return _0x24adba(_0x57a20d[_0x8ebf('0x16')][_0x8ebf('0x18')]);}logger['error'](_0x8ebf('0x19'),_0x56dd3a,_0x57a20d[_0x8ebf('0x16')][_0x8ebf('0x18')]);return _0x151029(_0x57a20d[_0x8ebf('0x16')][_0x8ebf('0x18')]);}else{logger[_0x8ebf('0x1a')]('VoiceQueueReport,\x20%s,\x20%s',_0x56dd3a,_0x8ebf('0x12'));_0x151029(_0x57a20d[_0x8ebf('0x1b')][_0x8ebf('0x18')]);}})[_0x8ebf('0x1c')](function(_0x5bb04e){logger[_0x8ebf('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x56dd3a,_0x5bb04e);_0x24adba(_0x5bb04e);});});}exports[_0x8ebf('0x1d')]=function(_0x4538a5){var _0x536c06=this;return new Promise(function(_0x2b8e00,_0x88a1e5){return db[_0x8ebf('0x1e')][_0x8ebf('0x1f')]({'raw':_0x4538a5['options']?_0x4538a5[_0x8ebf('0x20')][_0x8ebf('0x21')]===undefined?!![]:![]:!![],'where':_0x4538a5[_0x8ebf('0x20')]?_0x4538a5[_0x8ebf('0x20')][_0x8ebf('0x22')]||null:null,'attributes':_0x4538a5[_0x8ebf('0x20')]?_0x4538a5[_0x8ebf('0x20')]['attributes']||null:null,'limit':_0x4538a5['options']?_0x4538a5['options']['limit']||null:null,'include':_0x4538a5[_0x8ebf('0x20')]?_0x4538a5[_0x8ebf('0x20')][_0x8ebf('0x23')]?_[_0x8ebf('0x24')](_0x4538a5[_0x8ebf('0x20')]['include'],function(_0x310da9){return{'model':db[_0x310da9['model']],'as':_0x310da9['as'],'attributes':_0x310da9['attributes'],'include':_0x310da9['include']?_['map'](_0x310da9[_0x8ebf('0x23')],function(_0x39558c){return{'model':db[_0x39558c[_0x8ebf('0x25')]],'as':_0x39558c['as'],'attributes':_0x39558c[_0x8ebf('0x26')],'include':_0x39558c[_0x8ebf('0x23')]?_[_0x8ebf('0x24')](_0x39558c[_0x8ebf('0x23')],function(_0x45703d){return{'model':db[_0x45703d[_0x8ebf('0x25')]],'as':_0x45703d['as'],'attributes':_0x45703d[_0x8ebf('0x26')]};}):[]};}):[]};}):[]:[]})[_0x8ebf('0x11')](function(_0x1607e3){logger[_0x8ebf('0x1a')](_0x8ebf('0x1d'),_0x4538a5);logger[_0x8ebf('0x13')](_0x8ebf('0x1d'),_0x4538a5,JSON['stringify'](_0x1607e3));_0x2b8e00(_0x1607e3);})[_0x8ebf('0x1c')](function(_0x5c521b){logger[_0x8ebf('0x16')](_0x8ebf('0x1d'),_0x5c521b[_0x8ebf('0x18')],_0x4538a5);_0x88a1e5(_0x536c06[_0x8ebf('0x16')](0x1f4,_0x5c521b[_0x8ebf('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x362c64){var _0x2f2c07=this;return new Promise(function(_0x36be75,_0x27b62f){return db['VoiceQueueReport'][_0x8ebf('0x27')](_0x362c64[_0x8ebf('0x28')],{'raw':_0x362c64[_0x8ebf('0x20')]?_0x362c64[_0x8ebf('0x20')][_0x8ebf('0x21')]===undefined?!![]:![]:!![]})[_0x8ebf('0x11')](function(_0x395831){logger[_0x8ebf('0x1a')]('CreateVoiceQueueReport',_0x362c64);logger[_0x8ebf('0x13')](_0x8ebf('0x29'),_0x362c64,JSON['stringify'](_0x395831));_0x36be75(_0x395831);})[_0x8ebf('0x1c')](function(_0x229bb1){logger['error']('CreateVoiceQueueReport',_0x229bb1[_0x8ebf('0x18')],_0x362c64);_0x27b62f(_0x2f2c07[_0x8ebf('0x16')](0x1f4,_0x229bb1[_0x8ebf('0x18')]));});});};exports[_0x8ebf('0x2a')]=function(_0x346ae9){var _0x34d339=this;return new Promise(function(_0x1371a4,_0x293f8a){return db['VoiceQueueReport'][_0x8ebf('0x2b')](_0x346ae9[_0x8ebf('0x28')],{'raw':_0x346ae9['options']?_0x346ae9[_0x8ebf('0x20')][_0x8ebf('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x346ae9[_0x8ebf('0x20')]?_0x346ae9[_0x8ebf('0x20')]['where']||null:null,'attributes':_0x346ae9[_0x8ebf('0x20')]?_0x346ae9[_0x8ebf('0x20')][_0x8ebf('0x26')]||null:null,'limit':_0x346ae9[_0x8ebf('0x20')]?_0x346ae9['options'][_0x8ebf('0x2c')]||null:null})[_0x8ebf('0x11')](function(_0xfab1fc){logger[_0x8ebf('0x1a')]('UpdateVoiceQueueReport',_0x346ae9);logger[_0x8ebf('0x13')](_0x8ebf('0x2a'),_0x346ae9,JSON[_0x8ebf('0x15')](_0xfab1fc));_0x1371a4(_0xfab1fc);})[_0x8ebf('0x1c')](function(_0x2cc089){logger[_0x8ebf('0x16')](_0x8ebf('0x2a'),_0x2cc089[_0x8ebf('0x18')],_0x346ae9);_0x293f8a(_0x34d339[_0x8ebf('0x16')](0x1f4,_0x2cc089[_0x8ebf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e97716c..c1a1b96 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 _0xdc0d=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit','removeListener'];(function(_0x43a23d,_0x4ed87c){var _0xe4ff0e=function(_0x5ad9ba){while(--_0x5ad9ba){_0x43a23d['push'](_0x43a23d['shift']());}};_0xe4ff0e(++_0x4ed87c);}(_0xdc0d,0x1db));var _0xddc0=function(_0xec5b7e,_0x293677){_0xec5b7e=_0xec5b7e-0x0;var _0x3c6557=_0xdc0d[_0xec5b7e];return _0x3c6557;};'use strict';var VoiceQueueReportEvents=require(_0xddc0('0x0'));var events=[_0xddc0('0x1'),'remove',_0xddc0('0x2')];function createListener(_0x558a1a,_0x223e0f){return function(_0xac8cc5){_0x223e0f[_0xddc0('0x3')](_0x558a1a,_0xac8cc5);};}function removeListener(_0x32ad85,_0xb4e3f){return function(){VoiceQueueReportEvents[_0xddc0('0x4')](_0x32ad85,_0xb4e3f);};}exports[_0xddc0('0x5')]=function(_0x39a8da){for(var _0x20f5a9=0x0,_0x5dca02=events[_0xddc0('0x6')];_0x20f5a9<_0x5dca02;_0x20f5a9++){var _0x36760a=events[_0x20f5a9];var _0x3fde68=createListener(_0xddc0('0x7')+_0x36760a,_0x39a8da);VoiceQueueReportEvents['on'](_0x36760a,_0x3fde68);}}; \ No newline at end of file +var _0x92e0=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit'];(function(_0xbe2c1b,_0x15f55e){var _0x1adc30=function(_0x373f3c){while(--_0x373f3c){_0xbe2c1b['push'](_0xbe2c1b['shift']());}};_0x1adc30(++_0x15f55e);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0x092e('0x0'));var events=['save',_0x092e('0x1'),_0x092e('0x2')];function createListener(_0x2e3997,_0x116cd1){return function(_0x10ccfe){_0x116cd1[_0x092e('0x3')](_0x2e3997,_0x10ccfe);};}function removeListener(_0x3756db,_0x416760){return function(){VoiceQueueReportEvents[_0x092e('0x4')](_0x3756db,_0x416760);};}exports[_0x092e('0x5')]=function(_0x51779f){for(var _0x48af76=0x0,_0x2f1f0b=events[_0x092e('0x6')];_0x48af76<_0x2f1f0b;_0x48af76++){var _0x1af53d=events[_0x48af76];var _0x4c73a9=createListener(_0x092e('0x7')+_0x1af53d,_0x51779f);VoiceQueueReportEvents['on'](_0x1af53d,_0x4c73a9);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 89eb3f8..0cc72b8 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 _0xae1a=['Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0xae1a,0x19f));var _0xaae1=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xae1a[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0xaae1('0x0'));var util=require(_0xaae1('0x1'));var path=require(_0xaae1('0x2'));var timeout=require(_0xaae1('0x3'));var express=require(_0xaae1('0x4'));var router=express[_0xaae1('0x5')]();var fs_extra=require(_0xaae1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaae1('0x7'));var config=require('../../config/environment');var controller=require(_0xaae1('0x8'));router[_0xaae1('0x9')]('/',auth[_0xaae1('0xa')](),controller[_0xaae1('0xb')]);router[_0xaae1('0x9')](_0xaae1('0xc'),auth[_0xaae1('0xa')](),controller['show']);router[_0xaae1('0xd')]('/',auth['isAuthenticated'](),controller[_0xaae1('0xe')]);router[_0xaae1('0xf')]('/:id',auth[_0xaae1('0xa')](),controller[_0xaae1('0x10')]);router[_0xaae1('0x11')](_0xaae1('0xc'),auth['isAuthenticated'](),controller[_0xaae1('0x12')]);module[_0xaae1('0x13')]=router; \ No newline at end of file +var _0x92e1=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','multer','util','path'];(function(_0x39b4e6,_0x2eaa1e){var _0x2f75c8=function(_0x5c23db){while(--_0x5c23db){_0x39b4e6['push'](_0x39b4e6['shift']());}};_0x2f75c8(++_0x2eaa1e);}(_0x92e1,0xa8));var _0x192e=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x92e1[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x192e('0x0'));var util=require(_0x192e('0x1'));var path=require(_0x192e('0x2'));var timeout=require(_0x192e('0x3'));var express=require('express');var router=express[_0x192e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x192e('0x5'));var interaction=require(_0x192e('0x6'));var config=require('../../config/environment');var controller=require(_0x192e('0x7'));router['get']('/',auth[_0x192e('0x8')](),controller[_0x192e('0x9')]);router[_0x192e('0xa')]('/:id',auth[_0x192e('0x8')](),controller[_0x192e('0xb')]);router[_0x192e('0xc')]('/',auth[_0x192e('0x8')](),controller[_0x192e('0xd')]);router[_0x192e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x192e('0xf')]);router[_0x192e('0x10')](_0x192e('0x11'),auth[_0x192e('0x8')](),controller[_0x192e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b5d8855..ba9cb69 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 _0xed2d=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING'];(function(_0x58b035,_0x169c73){var _0x131667=function(_0x4477e4){while(--_0x4477e4){_0x58b035['push'](_0x58b035['shift']());}};_0x131667(++_0x169c73);}(_0xed2d,0x153));var _0xded2=function(_0x2d056d,_0x53f6c3){_0x2d056d=_0x2d056d-0x0;var _0x430fca=_0xed2d[_0x2d056d];return _0x430fca;};'use strict';var Sequelize=require(_0xded2('0x0'));var moment=require('moment');module[_0xded2('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xded2('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xded2('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xded2('0x4')](_0xded2('0x5'))}}; \ No newline at end of file +var _0x0b97=['STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','exports'];(function(_0x502643,_0x2a2900){var _0xd6c2ad=function(_0x8dd690){while(--_0x8dd690){_0x502643['push'](_0x502643['shift']());}};_0xd6c2ad(++_0x2a2900);}(_0x0b97,0x152));var _0x70b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0b97[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x70b9('0x0'));module[_0x70b9('0x1')]={'time':{'type':Sequelize[_0x70b9('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x70b9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0x70b9('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2bd6115..d034369 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 _0x7d0c=['merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','nolimit','sort','pick','filter','where'];(function(_0x42c126,_0x1fdb0c){var _0x5db17d=function(_0x2cbb7f){while(--_0x2cbb7f){_0x42c126['push'](_0x42c126['shift']());}};_0x5db17d(++_0x1fdb0c);}(_0x7d0c,0x1c2));var _0xc7d0=function(_0x1f55f2,_0x139ba7){_0x1f55f2=_0x1f55f2-0x0;var _0x4d3032=_0x7d0c[_0x1f55f2];return _0x4d3032;};'use strict';var emlformat=require(_0xc7d0('0x0'));var rimraf=require(_0xc7d0('0x1'));var zipdir=require(_0xc7d0('0x2'));var jsonpatch=require(_0xc7d0('0x3'));var rp=require('request-promise');var moment=require(_0xc7d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc7d0('0x5'));var util=require(_0xc7d0('0x6'));var path=require(_0xc7d0('0x7'));var sox=require(_0xc7d0('0x8'));var csv=require(_0xc7d0('0x9'));var ejs=require(_0xc7d0('0xa'));var fs=require('fs');var fs_extra=require(_0xc7d0('0xb'));var _=require(_0xc7d0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc7d0('0xd'));var toCsv=require(_0xc7d0('0x9'));var querystring=require(_0xc7d0('0xe'));var Papa=require(_0xc7d0('0xf'));var Redis=require(_0xc7d0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7d0('0x11'));var logger=require('../../config/logger')(_0xc7d0('0x12'));var utils=require(_0xc7d0('0x13'));var config=require(_0xc7d0('0x14'));var licenseUtil=require(_0xc7d0('0x15'));var db=require(_0xc7d0('0x16'))['db'];function respondWithStatusCode(_0x4d7273,_0x18e1ea){_0x18e1ea=_0x18e1ea||0xcc;return function(_0x31c54c){if(_0x31c54c){return _0x4d7273[_0xc7d0('0x17')](_0x18e1ea);}return _0x4d7273['status'](_0x18e1ea)[_0xc7d0('0x18')]();};}function respondWithResult(_0x121d95,_0x164ae4){_0x164ae4=_0x164ae4||0xc8;return function(_0x44870e){if(_0x44870e){return _0x121d95['status'](_0x164ae4)[_0xc7d0('0x19')](_0x44870e);}};}function respondWithFilteredResult(_0x4ef539,_0x4a202e){return function(_0x55cdf6){if(_0x55cdf6){var _0x264170=typeof _0x4a202e[_0xc7d0('0x1a')]===_0xc7d0('0x1b')&&typeof _0x4a202e[_0xc7d0('0x1c')]===_0xc7d0('0x1b');var _0x13019a=_0x55cdf6[_0xc7d0('0x1d')];var _0x94ccdb=_0x264170?0x0:_0x4a202e[_0xc7d0('0x1a')];var _0x4469b4=_0x264170?_0x55cdf6['count']:_0x4a202e[_0xc7d0('0x1a')]+_0x4a202e[_0xc7d0('0x1c')];var _0x191db1;if(_0x4469b4>=_0x13019a){_0x4469b4=_0x13019a;_0x191db1=0xc8;}else{_0x191db1=0xce;}_0x4ef539[_0xc7d0('0x1e')](_0x191db1);return _0x4ef539[_0xc7d0('0x1f')](_0xc7d0('0x20'),_0x94ccdb+'-'+_0x4469b4+'/'+_0x13019a)[_0xc7d0('0x19')](_0x55cdf6);}return null;};}function patchUpdates(_0x392447){return function(_0x1b44e4){try{jsonpatch[_0xc7d0('0x21')](_0x1b44e4,_0x392447,!![]);}catch(_0x3e8462){return BPromise[_0xc7d0('0x22')](_0x3e8462);}return _0x1b44e4[_0xc7d0('0x23')]();};}function saveUpdates(_0x12a9d0,_0x4e8672){return function(_0x4165bf){if(_0x4165bf){return _0x4165bf[_0xc7d0('0x24')](_0x12a9d0)[_0xc7d0('0x25')](function(_0x2c1983){return _0x2c1983;});}return null;};}function removeEntity(_0x447887,_0x16ffb3){return function(_0xab594e){if(_0xab594e){return _0xab594e[_0xc7d0('0x26')]()[_0xc7d0('0x25')](function(){_0x447887['status'](0xcc)[_0xc7d0('0x18')]();});}};}function handleEntityNotFound(_0xe0ebfb,_0x3568e5){return function(_0x175711){if(!_0x175711){_0xe0ebfb['sendStatus'](0x194);}return _0x175711;};}function handleError(_0x29fe82,_0x3458a6){_0x3458a6=_0x3458a6||0x1f4;return function(_0x227a53){logger[_0xc7d0('0x27')](_0x227a53[_0xc7d0('0x28')]);if(_0x227a53[_0xc7d0('0x29')]){delete _0x227a53[_0xc7d0('0x29')];}_0x29fe82[_0xc7d0('0x1e')](_0x3458a6)[_0xc7d0('0x2a')](_0x227a53);};}exports['index']=function(_0x4bb2ed,_0x139fd7){var _0x3adefe={},_0x23e1f3={},_0xbf0900={'count':0x0,'rows':[]};var _0x32bdb2=_[_0xc7d0('0x2b')](db[_0xc7d0('0x2c')][_0xc7d0('0x2d')],function(_0x125f84){return{'name':_0x125f84['fieldName'],'type':_0x125f84[_0xc7d0('0x2e')][_0xc7d0('0x2f')]};});_0x23e1f3[_0xc7d0('0x30')]=_['map'](_0x32bdb2,_0xc7d0('0x29'));_0x23e1f3['query']=_[_0xc7d0('0x31')](_0x4bb2ed['query']);_0x23e1f3[_0xc7d0('0x32')]=_['intersection'](_0x23e1f3[_0xc7d0('0x30')],_0x23e1f3[_0xc7d0('0x33')]);_0x3adefe[_0xc7d0('0x34')]=_[_0xc7d0('0x35')](_0x23e1f3['model'],qs[_0xc7d0('0x36')](_0x4bb2ed[_0xc7d0('0x33')]['fields']));_0x3adefe[_0xc7d0('0x34')]=_0x3adefe[_0xc7d0('0x34')][_0xc7d0('0x37')]?_0x3adefe[_0xc7d0('0x34')]:_0x23e1f3[_0xc7d0('0x30')];if(!_0x4bb2ed['query']['hasOwnProperty'](_0xc7d0('0x38'))){_0x3adefe['limit']=qs['limit'](_0x4bb2ed[_0xc7d0('0x33')]['limit']);_0x3adefe[_0xc7d0('0x1a')]=qs[_0xc7d0('0x1a')](_0x4bb2ed[_0xc7d0('0x33')][_0xc7d0('0x1a')]);}_0x3adefe['order']=qs[_0xc7d0('0x39')](_0x4bb2ed[_0xc7d0('0x33')][_0xc7d0('0x39')]);_0x3adefe['where']=qs[_0xc7d0('0x32')](_[_0xc7d0('0x3a')](_0x4bb2ed[_0xc7d0('0x33')],_0x23e1f3[_0xc7d0('0x32')]),_0x32bdb2);if(_0x4bb2ed[_0xc7d0('0x33')][_0xc7d0('0x3b')]){_0x3adefe[_0xc7d0('0x3c')]=_[_0xc7d0('0x3d')](_0x3adefe[_0xc7d0('0x3c')],{'$or':_[_0xc7d0('0x2b')](_0x32bdb2,function(_0x323a70){if(_0x323a70[_0xc7d0('0x2e')]!=='VIRTUAL'){var _0x51d4d8={};_0x51d4d8[_0x323a70[_0xc7d0('0x29')]]={'$like':'%'+_0x4bb2ed['query'][_0xc7d0('0x3b')]+'%'};return _0x51d4d8;}})});}_0x3adefe=_[_0xc7d0('0x3d')]({},_0x3adefe,_0x4bb2ed[_0xc7d0('0x3e')]);var _0x1e9f41={'where':_0x3adefe[_0xc7d0('0x3c')]};return db[_0xc7d0('0x2c')][_0xc7d0('0x1d')](_0x1e9f41)['then'](function(_0x5e8a5f){_0xbf0900['count']=_0x5e8a5f;if(_0x4bb2ed[_0xc7d0('0x33')][_0xc7d0('0x3f')]){_0x3adefe[_0xc7d0('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xc7d0('0x41')](_0x3adefe);})[_0xc7d0('0x25')](function(_0x47139b){_0xbf0900[_0xc7d0('0x42')]=_0x47139b;return _0xbf0900;})[_0xc7d0('0x25')](respondWithFilteredResult(_0x139fd7,_0x3adefe))[_0xc7d0('0x43')](handleError(_0x139fd7,null));};exports[_0xc7d0('0x44')]=function(_0xbb2bce,_0x559b24){var _0x48cb61={'raw':!![],'where':{'id':_0xbb2bce[_0xc7d0('0x45')]['id']}},_0x4e6996={};_0x4e6996[_0xc7d0('0x30')]=_['keys'](db['VoiceQueuesLog'][_0xc7d0('0x2d')]);_0x4e6996['query']=_[_0xc7d0('0x31')](_0xbb2bce[_0xc7d0('0x33')]);_0x4e6996[_0xc7d0('0x32')]=_[_0xc7d0('0x35')](_0x4e6996[_0xc7d0('0x30')],_0x4e6996[_0xc7d0('0x33')]);_0x48cb61[_0xc7d0('0x34')]=_[_0xc7d0('0x35')](_0x4e6996[_0xc7d0('0x30')],qs[_0xc7d0('0x36')](_0xbb2bce[_0xc7d0('0x33')][_0xc7d0('0x36')]));_0x48cb61[_0xc7d0('0x34')]=_0x48cb61[_0xc7d0('0x34')]['length']?_0x48cb61[_0xc7d0('0x34')]:_0x4e6996['model'];if(_0xbb2bce['query'][_0xc7d0('0x3f')]){_0x48cb61[_0xc7d0('0x40')]=[{'all':!![]}];}_0x48cb61=_[_0xc7d0('0x3d')]({},_0x48cb61,_0xbb2bce['options']);return db[_0xc7d0('0x2c')][_0xc7d0('0x46')](_0x48cb61)[_0xc7d0('0x25')](handleEntityNotFound(_0x559b24,null))[_0xc7d0('0x25')](respondWithResult(_0x559b24,null))[_0xc7d0('0x43')](handleError(_0x559b24,null));};exports['create']=function(_0x34f17a,_0x4fd1cd){return db[_0xc7d0('0x2c')][_0xc7d0('0x47')](_0x34f17a[_0xc7d0('0x48')],{})[_0xc7d0('0x25')](respondWithResult(_0x4fd1cd,0xc9))[_0xc7d0('0x43')](handleError(_0x4fd1cd,null));};exports[_0xc7d0('0x24')]=function(_0x3fd5c2,_0x40cf1c){if(_0x3fd5c2[_0xc7d0('0x48')]['id']){delete _0x3fd5c2[_0xc7d0('0x48')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x3fd5c2[_0xc7d0('0x45')]['id']}})['then'](handleEntityNotFound(_0x40cf1c,null))['then'](saveUpdates(_0x3fd5c2['body'],null))['then'](respondWithResult(_0x40cf1c,null))[_0xc7d0('0x43')](handleError(_0x40cf1c,null));};exports[_0xc7d0('0x26')]=function(_0x4800b0,_0x37fbe0){return db[_0xc7d0('0x2c')][_0xc7d0('0x46')]({'where':{'id':_0x4800b0[_0xc7d0('0x45')]['id']}})['then'](handleEntityNotFound(_0x37fbe0,null))[_0xc7d0('0x25')](removeEntity(_0x37fbe0,null))[_0xc7d0('0x43')](handleError(_0x37fbe0,null));}; \ No newline at end of file +var _0x3f71=['apply','save','update','then','destroy','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','limit','sort','where','merge','type','filter','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json'];(function(_0x479f17,_0x3ddb13){var _0xba4508=function(_0x21eb51){while(--_0x21eb51){_0x479f17['push'](_0x479f17['shift']());}};_0xba4508(++_0x3ddb13);}(_0x3f71,0x1bc));var _0x13f7=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x3f71[_0x355ce8];return _0x1db8b8;};'use strict';var emlformat=require(_0x13f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13f7('0x1'));var jsonpatch=require(_0x13f7('0x2'));var rp=require('request-promise');var moment=require(_0x13f7('0x3'));var BPromise=require(_0x13f7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x13f7('0x5'));var sox=require('sox');var csv=require(_0x13f7('0x6'));var ejs=require(_0x13f7('0x7'));var fs=require('fs');var fs_extra=require(_0x13f7('0x8'));var _=require('lodash');var squel=require(_0x13f7('0x9'));var crypto=require(_0x13f7('0xa'));var jsforce=require(_0x13f7('0xb'));var deskjs=require(_0x13f7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x13f7('0xd'));var Papa=require(_0x13f7('0xe'));var Redis=require(_0x13f7('0xf'));var authService=require(_0x13f7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13f7('0x11'));var logger=require(_0x13f7('0x12'))(_0x13f7('0x13'));var utils=require('../../config/utils');var config=require(_0x13f7('0x14'));var licenseUtil=require(_0x13f7('0x15'));var db=require(_0x13f7('0x16'))['db'];function respondWithStatusCode(_0x326185,_0x2b085c){_0x2b085c=_0x2b085c||0xcc;return function(_0x2cba0e){if(_0x2cba0e){return _0x326185[_0x13f7('0x17')](_0x2b085c);}return _0x326185[_0x13f7('0x18')](_0x2b085c)[_0x13f7('0x19')]();};}function respondWithResult(_0x578724,_0x257ef2){_0x257ef2=_0x257ef2||0xc8;return function(_0x5a7bc7){if(_0x5a7bc7){return _0x578724[_0x13f7('0x18')](_0x257ef2)['json'](_0x5a7bc7);}};}function respondWithFilteredResult(_0x193ded,_0x2f11cb){return function(_0x240f8f){if(_0x240f8f){var _0x375f19=typeof _0x2f11cb[_0x13f7('0x1a')]===_0x13f7('0x1b')&&typeof _0x2f11cb['limit']==='undefined';var _0x37f44f=_0x240f8f[_0x13f7('0x1c')];var _0x4b8d8b=_0x375f19?0x0:_0x2f11cb['offset'];var _0x202462=_0x375f19?_0x240f8f[_0x13f7('0x1c')]:_0x2f11cb[_0x13f7('0x1a')]+_0x2f11cb['limit'];var _0x470ee4;if(_0x202462>=_0x37f44f){_0x202462=_0x37f44f;_0x470ee4=0xc8;}else{_0x470ee4=0xce;}_0x193ded['status'](_0x470ee4);return _0x193ded[_0x13f7('0x1d')](_0x13f7('0x1e'),_0x4b8d8b+'-'+_0x202462+'/'+_0x37f44f)[_0x13f7('0x1f')](_0x240f8f);}return null;};}function patchUpdates(_0x24b2aa){return function(_0x1150dc){try{jsonpatch[_0x13f7('0x20')](_0x1150dc,_0x24b2aa,!![]);}catch(_0x7799a3){return BPromise['reject'](_0x7799a3);}return _0x1150dc[_0x13f7('0x21')]();};}function saveUpdates(_0x50a5f7,_0x549823){return function(_0x418e79){if(_0x418e79){return _0x418e79[_0x13f7('0x22')](_0x50a5f7)[_0x13f7('0x23')](function(_0x26f0aa){return _0x26f0aa;});}return null;};}function removeEntity(_0xce0d2c,_0x493c4d){return function(_0x59cd78){if(_0x59cd78){return _0x59cd78[_0x13f7('0x24')]()[_0x13f7('0x23')](function(){_0xce0d2c[_0x13f7('0x18')](0xcc)[_0x13f7('0x19')]();});}};}function handleEntityNotFound(_0x2b358c,_0x5bd994){return function(_0xdf994b){if(!_0xdf994b){_0x2b358c[_0x13f7('0x17')](0x194);}return _0xdf994b;};}function handleError(_0xc9d5a6,_0x41b0b3){_0x41b0b3=_0x41b0b3||0x1f4;return function(_0x3e537a){logger['error'](_0x3e537a[_0x13f7('0x25')]);if(_0x3e537a[_0x13f7('0x26')]){delete _0x3e537a['name'];}_0xc9d5a6['status'](_0x41b0b3)[_0x13f7('0x27')](_0x3e537a);};}exports[_0x13f7('0x28')]=function(_0x2650ad,_0x771eb1){var _0x1ac8c4={},_0x5e9b2d={},_0x1245a5={'count':0x0,'rows':[]};var _0x3b2801=_['map'](db[_0x13f7('0x29')][_0x13f7('0x2a')],function(_0x1e5fce){return{'name':_0x1e5fce[_0x13f7('0x2b')],'type':_0x1e5fce['type'][_0x13f7('0x2c')]};});_0x5e9b2d['model']=_[_0x13f7('0x2d')](_0x3b2801,'name');_0x5e9b2d[_0x13f7('0x2e')]=_[_0x13f7('0x2f')](_0x2650ad[_0x13f7('0x2e')]);_0x5e9b2d[_0x13f7('0x30')]=_[_0x13f7('0x31')](_0x5e9b2d['model'],_0x5e9b2d[_0x13f7('0x2e')]);_0x1ac8c4[_0x13f7('0x32')]=_[_0x13f7('0x31')](_0x5e9b2d[_0x13f7('0x33')],qs[_0x13f7('0x34')](_0x2650ad[_0x13f7('0x2e')]['fields']));_0x1ac8c4['attributes']=_0x1ac8c4[_0x13f7('0x32')]['length']?_0x1ac8c4[_0x13f7('0x32')]:_0x5e9b2d[_0x13f7('0x33')];if(!_0x2650ad[_0x13f7('0x2e')]['hasOwnProperty']('nolimit')){_0x1ac8c4[_0x13f7('0x35')]=qs[_0x13f7('0x35')](_0x2650ad[_0x13f7('0x2e')]['limit']);_0x1ac8c4[_0x13f7('0x1a')]=qs[_0x13f7('0x1a')](_0x2650ad[_0x13f7('0x2e')][_0x13f7('0x1a')]);}_0x1ac8c4['order']=qs[_0x13f7('0x36')](_0x2650ad['query'][_0x13f7('0x36')]);_0x1ac8c4[_0x13f7('0x37')]=qs['filters'](_['pick'](_0x2650ad[_0x13f7('0x2e')],_0x5e9b2d[_0x13f7('0x30')]),_0x3b2801);if(_0x2650ad['query']['filter']){_0x1ac8c4['where']=_[_0x13f7('0x38')](_0x1ac8c4[_0x13f7('0x37')],{'$or':_['map'](_0x3b2801,function(_0x3eafc1){if(_0x3eafc1[_0x13f7('0x39')]!=='VIRTUAL'){var _0x2e86a4={};_0x2e86a4[_0x3eafc1[_0x13f7('0x26')]]={'$like':'%'+_0x2650ad[_0x13f7('0x2e')][_0x13f7('0x3a')]+'%'};return _0x2e86a4;}})});}_0x1ac8c4=_[_0x13f7('0x38')]({},_0x1ac8c4,_0x2650ad['options']);var _0x31dd65={'where':_0x1ac8c4[_0x13f7('0x37')]};return db['VoiceQueuesLog'][_0x13f7('0x1c')](_0x31dd65)[_0x13f7('0x23')](function(_0x2569fe){_0x1245a5[_0x13f7('0x1c')]=_0x2569fe;if(_0x2650ad['query'][_0x13f7('0x3b')]){_0x1ac8c4[_0x13f7('0x3c')]=[{'all':!![]}];}return db[_0x13f7('0x29')][_0x13f7('0x3d')](_0x1ac8c4);})['then'](function(_0x455e61){_0x1245a5['rows']=_0x455e61;return _0x1245a5;})[_0x13f7('0x23')](respondWithFilteredResult(_0x771eb1,_0x1ac8c4))[_0x13f7('0x3e')](handleError(_0x771eb1,null));};exports[_0x13f7('0x3f')]=function(_0x233317,_0x2e8b7d){var _0x4a7856={'raw':!![],'where':{'id':_0x233317['params']['id']}},_0x141622={};_0x141622[_0x13f7('0x33')]=_[_0x13f7('0x2f')](db[_0x13f7('0x29')]['rawAttributes']);_0x141622[_0x13f7('0x2e')]=_['keys'](_0x233317[_0x13f7('0x2e')]);_0x141622[_0x13f7('0x30')]=_['intersection'](_0x141622['model'],_0x141622[_0x13f7('0x2e')]);_0x4a7856[_0x13f7('0x32')]=_['intersection'](_0x141622['model'],qs[_0x13f7('0x34')](_0x233317['query']['fields']));_0x4a7856[_0x13f7('0x32')]=_0x4a7856[_0x13f7('0x32')]['length']?_0x4a7856[_0x13f7('0x32')]:_0x141622[_0x13f7('0x33')];if(_0x233317[_0x13f7('0x2e')][_0x13f7('0x3b')]){_0x4a7856[_0x13f7('0x3c')]=[{'all':!![]}];}_0x4a7856=_[_0x13f7('0x38')]({},_0x4a7856,_0x233317['options']);return db[_0x13f7('0x29')][_0x13f7('0x40')](_0x4a7856)[_0x13f7('0x23')](handleEntityNotFound(_0x2e8b7d,null))[_0x13f7('0x23')](respondWithResult(_0x2e8b7d,null))['catch'](handleError(_0x2e8b7d,null));};exports[_0x13f7('0x41')]=function(_0x493e5c,_0x58b695){return db['VoiceQueuesLog']['create'](_0x493e5c['body'],{})[_0x13f7('0x23')](respondWithResult(_0x58b695,0xc9))[_0x13f7('0x3e')](handleError(_0x58b695,null));};exports[_0x13f7('0x22')]=function(_0x4b025d,_0x4a2005){if(_0x4b025d[_0x13f7('0x42')]['id']){delete _0x4b025d[_0x13f7('0x42')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x4b025d[_0x13f7('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a2005,null))[_0x13f7('0x23')](saveUpdates(_0x4b025d[_0x13f7('0x42')],null))[_0x13f7('0x23')](respondWithResult(_0x4a2005,null))['catch'](handleError(_0x4a2005,null));};exports['destroy']=function(_0x2d317f,_0x2a1475){return db[_0x13f7('0x29')]['find']({'where':{'id':_0x2d317f[_0x13f7('0x43')]['id']}})[_0x13f7('0x23')](handleEntityNotFound(_0x2a1475,null))[_0x13f7('0x23')](removeEntity(_0x2a1475,null))[_0x13f7('0x3e')](handleError(_0x2a1475,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a54e7e2..b660f7d 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 _0xbb4b=['bluebird','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','moment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xbb4b,0x13e));var _0xbbb4=function(_0x795d04,_0x16cefe){_0x795d04=_0x795d04-0x0;var _0x21b82f=_0xbb4b[_0x795d04];return _0x21b82f;};'use strict';var _=require(_0xbbb4('0x0'));var util=require(_0xbbb4('0x1'));var logger=require(_0xbbb4('0x2'))('api');var moment=require(_0xbbb4('0x3'));var BPromise=require(_0xbbb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbb4('0x5'));var rimraf=require(_0xbbb4('0x6'));var config=require(_0xbbb4('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0xbbb4('0x8')]=function(_0x41f0e9,_0xac6972){return _0x41f0e9[_0xbbb4('0x9')](_0xbbb4('0xa'),attributes,{'tableName':_0xbbb4('0xb'),'paranoid':![],'indexes':[{'name':_0xbbb4('0xc'),'fields':['event',_0xbbb4('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf296=['define','voice_queues_log','event_dtm','event','dtm','lodash','util','api','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x16d24f,_0x1ae308){var _0x36986a=function(_0x2fb420){while(--_0x2fb420){_0x16d24f['push'](_0x16d24f['shift']());}};_0x36986a(++_0x1ae308);}(_0xf296,0x94));var _0x6f29=function(_0x245307,_0x12cbb9){_0x245307=_0x245307-0x0;var _0x4cf712=_0xf296[_0x245307];return _0x4cf712;};'use strict';var _=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var logger=require('../../config/logger')(_0x6f29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f29('0x3'));var fs=require('fs');var path=require(_0x6f29('0x4'));var rimraf=require('rimraf');var config=require(_0x6f29('0x5'));var attributes=require(_0x6f29('0x6'));module[_0x6f29('0x7')]=function(_0x4f0712,_0x1d9c3f){return _0x4f0712[_0x6f29('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x6f29('0x9'),'paranoid':![],'indexes':[{'name':_0x6f29('0xa'),'fields':[_0x6f29('0xb'),_0x6f29('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 633c057..ee5e382 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 _0xb469=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x41ba41,_0x145412){var _0x22d385=function(_0x571d2a){while(--_0x571d2a){_0x41ba41['push'](_0x41ba41['shift']());}};_0x22d385(++_0x145412);}(_0xb469,0x13b));var _0x9b46=function(_0xe5abb4,_0x5dbf1d){_0xe5abb4=_0xe5abb4-0x0;var _0x30da39=_0xb469[_0xe5abb4];return _0x30da39;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});} \ No newline at end of file +var _0x2efa=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2efa,0x141));var _0xa2ef=function(_0x2e70af,_0x472b9c){_0x2e70af=_0x2e70af-0x0;var _0x3c5a4d=_0x2efa[_0x2e70af];return _0x3c5a4d;};'use strict';var _=require(_0xa2ef('0x0'));var util=require('util');var moment=require(_0xa2ef('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2ef('0x2'));var fs=require('fs');var Redis=require(_0xa2ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2ef('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa2ef('0x5'));var jayson=require(_0xa2ef('0x6'));var client=jayson[_0xa2ef('0x7')][_0xa2ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15475e,_0x3352e2,_0x3a14be){return new BPromise(function(_0x2a0778,_0x125f37){return client[_0xa2ef('0x9')](_0x15475e,_0x3a14be)[_0xa2ef('0xa')](function(_0x3f3613){logger[_0xa2ef('0xb')](_0xa2ef('0xc'),_0x3352e2,_0xa2ef('0xd'));logger[_0xa2ef('0xe')](_0xa2ef('0xf'),_0x3352e2,'request\x20sent',JSON[_0xa2ef('0x10')](_0x3f3613));if(_0x3f3613[_0xa2ef('0x11')]){if(_0x3f3613[_0xa2ef('0x11')][_0xa2ef('0x12')]===0x1f4){logger[_0xa2ef('0x11')](_0xa2ef('0xc'),_0x3352e2,_0x3f3613[_0xa2ef('0x11')][_0xa2ef('0x13')]);return _0x125f37(_0x3f3613[_0xa2ef('0x11')]['message']);}logger['error'](_0xa2ef('0xc'),_0x3352e2,_0x3f3613[_0xa2ef('0x11')][_0xa2ef('0x13')]);return _0x2a0778(_0x3f3613[_0xa2ef('0x11')]['message']);}else{logger['info'](_0xa2ef('0xc'),_0x3352e2,'request\x20sent');_0x2a0778(_0x3f3613[_0xa2ef('0x14')][_0xa2ef('0x13')]);}})['catch'](function(_0x4596ea){logger[_0xa2ef('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3352e2,_0x4596ea);_0x125f37(_0x4596ea);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1210335..2e15d1a 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 _0x1566=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','download','/:id/downloads','downloads','downloadTranscribe','post','create','delete','exports','multer','util','path','connect-timeout'];(function(_0x3c4b68,_0xc3987e){var _0x5dfadd=function(_0x1532e3){while(--_0x1532e3){_0x3c4b68['push'](_0x3c4b68['shift']());}};_0x5dfadd(++_0xc3987e);}(_0x1566,0xb4));var _0x6156=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0x1566[_0x5bd4f6];return _0x33a165;};'use strict';var multer=require(_0x6156('0x0'));var util=require(_0x6156('0x1'));var path=require(_0x6156('0x2'));var timeout=require(_0x6156('0x3'));var express=require(_0x6156('0x4'));var router=express[_0x6156('0x5')]();var fs_extra=require(_0x6156('0x6'));var auth=require(_0x6156('0x7'));var interaction=require(_0x6156('0x8'));var config=require(_0x6156('0x9'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x6156('0xa')](),controller['index']);router[_0x6156('0xb')](_0x6156('0xc'),auth[_0x6156('0xa')](),controller[_0x6156('0xd')]);router[_0x6156('0xb')](_0x6156('0xe'),auth[_0x6156('0xa')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x6156('0xf')]);router['get'](_0x6156('0x10'),controller[_0x6156('0x11')]);router[_0x6156('0xb')]('/:id/transcribe',auth[_0x6156('0xa')](),controller[_0x6156('0x12')]);router[_0x6156('0x13')]('/',auth[_0x6156('0xa')](),controller[_0x6156('0x14')]);router[_0x6156('0x13')]('/:id/transcribe',auth[_0x6156('0xa')](),controller['runTranscribe']);router['put']('/:id',auth[_0x6156('0xa')](),controller['update']);router[_0x6156('0x15')](_0x6156('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x6156('0x16')]=router; \ No newline at end of file +var _0xc875=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2539b7,_0x4f9f50){var _0x1a2456=function(_0x228683){while(--_0x228683){_0x2539b7['push'](_0x2539b7['shift']());}};_0x1a2456(++_0x4f9f50);}(_0xc875,0x82));var _0x5c87=function(_0x5457ec,_0x1ddf31){_0x5457ec=_0x5457ec-0x0;var _0x3f04a7=_0xc875[_0x5457ec];return _0x3f04a7;};'use strict';var multer=require(_0x5c87('0x0'));var util=require(_0x5c87('0x1'));var path=require('path');var timeout=require(_0x5c87('0x2'));var express=require('express');var router=express[_0x5c87('0x3')]();var fs_extra=require(_0x5c87('0x4'));var auth=require(_0x5c87('0x5'));var interaction=require(_0x5c87('0x6'));var config=require(_0x5c87('0x7'));var controller=require('./voiceRecording.controller');router[_0x5c87('0x8')]('/',auth[_0x5c87('0x9')](),controller['index']);router[_0x5c87('0x8')](_0x5c87('0xa'),auth[_0x5c87('0x9')](),controller['describe']);router[_0x5c87('0x8')](_0x5c87('0xb'),auth[_0x5c87('0x9')](),controller[_0x5c87('0xc')]);router[_0x5c87('0x8')](_0x5c87('0xd'),auth['isAuthenticated'](),controller[_0x5c87('0xe')]);router[_0x5c87('0x8')](_0x5c87('0xf'),controller[_0x5c87('0x10')]);router['get'](_0x5c87('0x11'),auth[_0x5c87('0x9')](),controller[_0x5c87('0x12')]);router[_0x5c87('0x13')]('/',auth['isAuthenticated'](),controller[_0x5c87('0x14')]);router[_0x5c87('0x13')](_0x5c87('0x11'),auth[_0x5c87('0x9')](),controller[_0x5c87('0x15')]);router[_0x5c87('0x16')](_0x5c87('0xb'),auth[_0x5c87('0x9')](),controller[_0x5c87('0x17')]);router[_0x5c87('0x18')](_0x5c87('0xb'),auth[_0x5c87('0x9')](),controller[_0x5c87('0x19')]);module[_0x5c87('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 0da5465..436d8ff 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(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 a80a9ce..10e6c7d 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 _0x74d5=['upload','TranscribeService','startTranscriptionJob','format','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','.txt','Transcript\x20not\x20available','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','../../components/encryptor','uniqueid','value','existsSync','secrets','recording','Sequelize','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','%s.cypher','decryptFile','download','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket'];(function(_0x39d518,_0x32b600){var _0x2feade=function(_0x272839){while(--_0x272839){_0x39d518['push'](_0x39d518['shift']());}};_0x2feade(++_0x32b600);}(_0x74d5,0x1ee));var _0x574d=function(_0x1360c0,_0x50da6d){_0x1360c0=_0x1360c0-0x0;var _0x2777af=_0x74d5[_0x1360c0];return _0x2777af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x574d('0x0'));var rp=require(_0x574d('0x1'));var moment=require(_0x574d('0x2'));var BPromise=require(_0x574d('0x3'));var Mustache=require(_0x574d('0x4'));var util=require(_0x574d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x574d('0x6'));var ejs=require(_0x574d('0x7'));var fs=require('fs');var fs_extra=require(_0x574d('0x8'));var _=require(_0x574d('0x9'));var squel=require(_0x574d('0xa'));var crypto=require(_0x574d('0xb'));var jsforce=require(_0x574d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x574d('0x6'));var querystring=require(_0x574d('0xd'));var Papa=require(_0x574d('0xe'));var AWS=require(_0x574d('0xf'));var uuidv4=require(_0x574d('0x10'));var Redis=require(_0x574d('0x11'));var authService=require(_0x574d('0x12'));var qs=require(_0x574d('0x13'));var as=require(_0x574d('0x14'));var hardwareService=require(_0x574d('0x15'));var logger=require(_0x574d('0x16'))('api');var utils=require(_0x574d('0x17'));var config=require(_0x574d('0x18'));var licenseUtil=require(_0x574d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x427241,_0x5c9677){_0x5c9677=_0x5c9677||0xcc;return function(_0x5b34b7){if(_0x5b34b7){return _0x427241['sendStatus'](_0x5c9677);}return _0x427241['status'](_0x5c9677)[_0x574d('0x1a')]();};}function respondWithResult(_0x419b21,_0x2a0ab2){_0x2a0ab2=_0x2a0ab2||0xc8;return function(_0x8ea1af){if(_0x8ea1af){return _0x419b21['status'](_0x2a0ab2)[_0x574d('0x1b')](_0x8ea1af);}};}function respondWithFilteredResult(_0x541eab,_0x209434){return function(_0x2f3452){if(_0x2f3452){var _0x409f50=typeof _0x209434['offset']===_0x574d('0x1c')&&typeof _0x209434[_0x574d('0x1d')]===_0x574d('0x1c');var _0x25c109=_0x2f3452[_0x574d('0x1e')];var _0x5c52c4=_0x409f50?0x0:_0x209434[_0x574d('0x1f')];var _0x292013=_0x409f50?_0x2f3452[_0x574d('0x1e')]:_0x209434[_0x574d('0x1f')]+_0x209434[_0x574d('0x1d')];var _0x42b359;if(_0x292013>=_0x25c109){_0x292013=_0x25c109;_0x42b359=0xc8;}else{_0x42b359=0xce;}_0x541eab[_0x574d('0x20')](_0x42b359);return _0x541eab[_0x574d('0x21')](_0x574d('0x22'),_0x5c52c4+'-'+_0x292013+'/'+_0x25c109)[_0x574d('0x1b')](_0x2f3452);}return null;};}function patchUpdates(_0x4da46f){return function(_0x2b5c96){try{jsonpatch[_0x574d('0x23')](_0x2b5c96,_0x4da46f,!![]);}catch(_0x530f93){return BPromise['reject'](_0x530f93);}return _0x2b5c96[_0x574d('0x24')]();};}function saveUpdates(_0x1a5804,_0x5b0925){return function(_0x27dcd2){if(_0x27dcd2){return _0x27dcd2[_0x574d('0x25')](_0x1a5804)[_0x574d('0x26')](function(_0x3351fc){return _0x3351fc;});}return null;};}function removeEntity(_0x2a52be,_0x1a63ab){return function(_0x58e15e){if(_0x58e15e){return _0x58e15e[_0x574d('0x27')]()[_0x574d('0x26')](function(){_0x2a52be[_0x574d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9339d7,_0xb8d168){return function(_0x4f6622){if(!_0x4f6622){_0x9339d7['sendStatus'](0x194);}return _0x4f6622;};}function handleError(_0x53fad9,_0x4170cf){_0x4170cf=_0x4170cf||0x1f4;return function(_0x329bf3){logger[_0x574d('0x28')](_0x329bf3[_0x574d('0x29')]);if(_0x329bf3[_0x574d('0x2a')]){delete _0x329bf3[_0x574d('0x2a')];}_0x53fad9[_0x574d('0x20')](_0x4170cf)[_0x574d('0x2b')](_0x329bf3);};}exports[_0x574d('0x2c')]=function(_0x2b2b97,_0x2dbb39){var _0x1409d5={},_0x1c7f65={},_0x1c3fbd={'count':0x0,'rows':[]};var _0x1ced21=_[_0x574d('0x2d')](db[_0x574d('0x2e')]['rawAttributes'],function(_0x43453e){return{'name':_0x43453e[_0x574d('0x2f')],'type':_0x43453e[_0x574d('0x30')][_0x574d('0x31')]};});_0x1c7f65[_0x574d('0x32')]=_[_0x574d('0x33')](_[_0x574d('0x2d')](_0x1ced21,_0x574d('0x2a')),['format']);_0x1c7f65[_0x574d('0x34')]=_['keys'](_0x2b2b97['query']);_0x1c7f65[_0x574d('0x35')]=_[_0x574d('0x36')](_0x1c7f65['model'],_0x1c7f65[_0x574d('0x34')]);_0x1409d5[_0x574d('0x37')]=_[_0x574d('0x36')](_0x1c7f65[_0x574d('0x32')],qs['fields'](_0x2b2b97[_0x574d('0x34')][_0x574d('0x38')]));_0x1409d5[_0x574d('0x37')]=_0x1409d5[_0x574d('0x37')][_0x574d('0x39')]?_0x1409d5[_0x574d('0x37')]:_0x1c7f65[_0x574d('0x32')];if(!_0x2b2b97[_0x574d('0x34')]['hasOwnProperty'](_0x574d('0x3a'))){_0x1409d5['limit']=qs[_0x574d('0x1d')](_0x2b2b97['query'][_0x574d('0x1d')]);_0x1409d5[_0x574d('0x1f')]=qs['offset'](_0x2b2b97['query'][_0x574d('0x1f')]);}_0x1409d5['order']=qs[_0x574d('0x3b')](_0x2b2b97[_0x574d('0x34')][_0x574d('0x3b')]);_0x1409d5['where']=qs['filters'](_[_0x574d('0x3c')](_0x2b2b97[_0x574d('0x34')],_0x1c7f65[_0x574d('0x35')]),_0x1ced21);if(_0x2b2b97['query'][_0x574d('0x3d')]){_0x1409d5[_0x574d('0x3e')]=_[_0x574d('0x3f')](_0x1409d5[_0x574d('0x3e')],{'$or':_[_0x574d('0x2d')](_0x1ced21,function(_0x52e357){if(_0x52e357['type']!==_0x574d('0x40')){var _0x2560a0={};_0x2560a0[_0x52e357[_0x574d('0x2a')]]={'$like':'%'+_0x2b2b97[_0x574d('0x34')]['filter']+'%'};return _0x2560a0;}})});}_0x1409d5=_[_0x574d('0x3f')]({},_0x1409d5,_0x2b2b97[_0x574d('0x41')]);var _0x359192={'where':_0x1409d5[_0x574d('0x3e')]};return db[_0x574d('0x2e')][_0x574d('0x1e')](_0x359192)[_0x574d('0x26')](function(_0x2902a7){_0x1c3fbd[_0x574d('0x1e')]=_0x2902a7;if(_0x2b2b97[_0x574d('0x34')]['includeAll']){_0x1409d5[_0x574d('0x42')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x1409d5);})[_0x574d('0x26')](function(_0x40505e){_0x1c3fbd[_0x574d('0x43')]=_0x40505e;return _0x1c3fbd;})[_0x574d('0x26')](respondWithFilteredResult(_0x2dbb39,_0x1409d5))[_0x574d('0x44')](handleError(_0x2dbb39,null));};exports[_0x574d('0x45')]=function(_0x531213,_0x25b037){var _0x2d5d35={'raw':![],'where':{'id':_0x531213[_0x574d('0x46')]['id']}},_0x569173={};_0x569173[_0x574d('0x32')]=_[_0x574d('0x47')](db[_0x574d('0x2e')]['rawAttributes']);_0x569173['query']=_[_0x574d('0x47')](_0x531213[_0x574d('0x34')]);_0x569173[_0x574d('0x35')]=_[_0x574d('0x36')](_0x569173[_0x574d('0x32')],_0x569173[_0x574d('0x34')]);_0x2d5d35[_0x574d('0x37')]=_[_0x574d('0x36')](_0x569173['model'],qs[_0x574d('0x38')](_0x531213['query'][_0x574d('0x38')]));_0x2d5d35[_0x574d('0x37')]=_0x2d5d35[_0x574d('0x37')][_0x574d('0x39')]?_0x2d5d35[_0x574d('0x37')]:_0x569173[_0x574d('0x32')];if(_0x531213[_0x574d('0x34')][_0x574d('0x48')]){_0x2d5d35[_0x574d('0x42')]=[{'all':!![]}];}_0x2d5d35=_[_0x574d('0x3f')]({},_0x2d5d35,_0x531213[_0x574d('0x41')]);return db[_0x574d('0x2e')][_0x574d('0x49')](_0x2d5d35)['then'](handleEntityNotFound(_0x25b037,null))['then'](respondWithResult(_0x25b037,null))[_0x574d('0x44')](handleError(_0x25b037,null));};exports[_0x574d('0x4a')]=function(_0x23ce36,_0x2b5815){return db[_0x574d('0x2e')]['create'](_0x23ce36['body'],{})[_0x574d('0x26')](respondWithResult(_0x2b5815,0xc9))[_0x574d('0x44')](handleError(_0x2b5815,null));};exports['update']=function(_0x26164f,_0x488714){if(_0x26164f[_0x574d('0x4b')]['id']){delete _0x26164f[_0x574d('0x4b')]['id'];}return db[_0x574d('0x2e')][_0x574d('0x49')]({'where':{'id':_0x26164f[_0x574d('0x46')]['id']}})[_0x574d('0x26')](handleEntityNotFound(_0x488714,null))[_0x574d('0x26')](saveUpdates(_0x26164f[_0x574d('0x4b')],null))[_0x574d('0x26')](respondWithResult(_0x488714,null))[_0x574d('0x44')](handleError(_0x488714,null));};exports['describe']=function(_0x507e9a,_0xff7bc9){return db[_0x574d('0x2e')][_0x574d('0x4c')]()[_0x574d('0x26')](respondWithResult(_0xff7bc9,null))['catch'](handleError(_0xff7bc9,null));};exports['download']=function(_0x497733,_0x1068cd,_0x3629e4){var _0x98599a=require(_0x574d('0x4d'));var _0x5c5417=![];var _0x471a21={};if(_0x497733[_0x574d('0x34')][_0x574d('0x30')]&&_0x497733[_0x574d('0x34')][_0x574d('0x30')]===_0x574d('0x4e')){_0x471a21[_0x574d('0x4e')]=_0x497733[_0x574d('0x46')]['id'];}else{_0x471a21['id']=_0x497733[_0x574d('0x46')]['id'];}return db['VoiceRecording']['find']({'where':_0x471a21,'attributes':['id',_0x574d('0x4f')],'raw':!![]})[_0x574d('0x26')](handleEntityNotFound(_0x1068cd,null))[_0x574d('0x26')](function(_0x542693){if(_0x542693){var _0x1d61cd=_0x542693[_0x574d('0x4f')];var _0x3d869d=util['format']('%s.cypher',_0x1d61cd);if(fs[_0x574d('0x50')](_0x3d869d)){_0x5c5417=!![];return _0x98599a['decryptFile'](_0x3d869d,_0x1d61cd,config[_0x574d('0x51')][_0x574d('0x52')])[_0x574d('0x26')](function(){return _0x542693;});}return _0x542693;}})[_0x574d('0x26')](function(_0x2951db){if(_0x2951db){var _0x368701=_0x2951db[_0x574d('0x4f')];if(!fs[_0x574d('0x50')](_0x368701)){throw new db[(_0x574d('0x53'))][(_0x574d('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x2951db[_0x574d('0x55')]){return _0x1068cd['download'](_0x368701,_0x2951db['filename']+path['extname'](_0x368701),function(){if(_0x5c5417){fs[_0x574d('0x56')](_0x368701);}});}else{return _0x1068cd['download'](_0x368701,function(_0xe913f0){if(_0x5c5417){fs['unlink'](_0x368701);}});}}})[_0x574d('0x44')](function(_0x56b9f4){if(_0x56b9f4[_0x574d('0x57')]===_0x574d('0x58')){_0x1068cd[_0x574d('0x20')](0x194)[_0x574d('0x2b')](_0x574d('0x59'));}else{return handleError(_0x1068cd,null);}});};exports[_0x574d('0x5a')]=function(_0x56e150,_0x5a9670,_0x405a56){var _0x3e1060=require(_0x574d('0x4d'));var _0x269d5b=![];var _0x5edb49={'$and':[db[_0x574d('0x5b')][_0x574d('0x3e')](db[_0x574d('0x5b')]['fn'](_0x574d('0x5c'),db[_0x574d('0x5b')][_0x574d('0x5d')]('uniqueid')),_0x56e150[_0x574d('0x34')][_0x574d('0x5e')])]};if(_0x56e150[_0x574d('0x34')][_0x574d('0x30')]&&_0x56e150[_0x574d('0x34')][_0x574d('0x30')]===_0x574d('0x4e')){_0x5edb49[_0x574d('0x5f')][_0x574d('0x60')]({'uniqueid':_0x56e150['params']['id']});}else{_0x5edb49[_0x574d('0x5f')][_0x574d('0x60')]({'id':_0x56e150[_0x574d('0x46')]['id']});}return db[_0x574d('0x2e')]['find']({'where':_0x5edb49,'attributes':['id',_0x574d('0x4f')],'raw':!![]})[_0x574d('0x26')](handleEntityNotFound(_0x5a9670,null))[_0x574d('0x26')](function(_0x761afe){if(_0x761afe){var _0x48f8b2=util['format'](_0x574d('0x61'),_0x761afe[_0x574d('0x4f')]);if(fs[_0x574d('0x50')](_0x48f8b2)){_0x269d5b=!![];return _0x3e1060[_0x574d('0x62')](_0x48f8b2,_0x761afe[_0x574d('0x4f')],config[_0x574d('0x51')][_0x574d('0x52')])[_0x574d('0x26')](function(){return _0x761afe;});}return _0x761afe;}})[_0x574d('0x26')](function(_0x377e24){if(_0x377e24){if(!fs[_0x574d('0x50')](_0x377e24[_0x574d('0x4f')])){throw new db[(_0x574d('0x53'))][(_0x574d('0x54'))](_0x574d('0x58'));}if(_0x377e24[_0x574d('0x55')]){return _0x5a9670['download'](_0x377e24['value'],_0x377e24[_0x574d('0x55')]+path['extname'](_0x377e24[_0x574d('0x4f')]),function(){if(_0x269d5b){fs[_0x574d('0x56')](_0x377e24[_0x574d('0x4f')]);}});}else{return _0x5a9670[_0x574d('0x63')](_0x377e24['value'],function(_0x346f27){if(_0x269d5b){fs[_0x574d('0x56')](_0x377e24[_0x574d('0x4f')]);}});}}})[_0x574d('0x44')](handleError(_0x5a9670,null));};exports['destroy']=function(_0x70a1a2,_0x7672c3){return db['VoiceRecording']['find']({'where':{'id':_0x70a1a2[_0x574d('0x46')]['id']}})['then'](function(_0x28d163){if(_[_0x574d('0x64')](_0x28d163)){throw new ReferenceError(_0x574d('0x65'));}return _0x28d163;})[_0x574d('0x26')](function(_0x17ab77){var _0x114c91=_0x17ab77[_0x574d('0x4f')];logger[_0x574d('0x66')](_0x574d('0x67'),_0x114c91);if(!_['isNil'](_0x17ab77['value'])&&fs[_0x574d('0x50')](_0x114c91)){logger['info'](_0x574d('0x68')+_0x114c91+_0x574d('0x69'));fs[_0x574d('0x6a')](_0x114c91);}_0x114c91=_0x114c91+_0x574d('0x6b');if(!_['isNil'](_0x17ab77['value'])&&fs[_0x574d('0x50')](_0x114c91)){logger[_0x574d('0x66')](_0x574d('0x68')+_0x114c91+_0x574d('0x69'));fs[_0x574d('0x6a')](_0x114c91);}return _0x17ab77;})['then'](function(_0x4f64d9){if(!_0x4f64d9)throw new InternalError();return _0x4f64d9[_0x574d('0x27')]();})['then'](function(){_0x7672c3[_0x574d('0x20')](0xcc)['end']();})[_0x574d('0x44')](handleError(_0x7672c3,null));};function getBucketslist(_0x5cf9c7,_0x3befae,_0x3707b6){return new Promise(function(_0x3e92ce,_0x560ab9){var _0x16efe5=new AWS['S3']({'accessKeyId':_0x3befae,'secretAccessKey':_0x5cf9c7,'region':_0x3707b6});_0x16efe5[_0x574d('0x6c')]({},function(_0x14f52e,_0x1100a9){if(_0x14f52e){return _0x560ab9(_0x14f52e);}else{return _0x3e92ce(_0x1100a9);}});});}function createBucket(_0x6d8ebf,_0x13a724,_0x1da12f,_0x21935f){return new Promise(function(_0x3b080c,_0x35c7c3){var _0x54d171=new AWS['S3']({'accessKeyId':_0x13a724,'secretAccessKey':_0x6d8ebf,'region':_0x1da12f});_0x54d171[_0x574d('0x6d')]({'Bucket':_0x21935f},function(_0x5ec9e6,_0x220199){if(_0x5ec9e6){return _0x35c7c3(_0x5ec9e6);}else{return _0x3b080c(_0x220199);}});});}function uploadFile(_0x5dce8c,_0x5c6e61,_0x423eb1,_0x2a5ab7,_0x457e1f,_0x36c94d){return new Promise(function(_0x4307c1,_0x43c76d){var _0x221128=new AWS['S3']({'accessKeyId':_0x5c6e61,'secretAccessKey':_0x5dce8c,'region':_0x423eb1});_0x221128[_0x574d('0x6e')]({'Bucket':_0x2a5ab7,'Key':_0x457e1f,'Body':_0x36c94d},function(_0x567e4c,_0x35aff4){if(_0x567e4c){return _0x43c76d(_0x567e4c);}else{return _0x4307c1(_0x35aff4);}});});}function startTranscribe(_0x50f488,_0x75954d,_0x2996cf,_0x4c2d32,_0x42ee9a,_0x1929a9){return new Promise(function(_0x5a2ec1,_0x5166c4){var _0x4b9029=new AWS[(_0x574d('0x6f'))]({'accessKeyId':_0x75954d,'secretAccessKey':_0x50f488,'region':_0x2996cf});_0x4b9029[_0x574d('0x70')]({'TranscriptionJobName':_0x4c2d32,'LanguageCode':_0x42ee9a,'Media':{'MediaFileUri':_0x1929a9}},function(_0x74717c,_0x52832d){if(_0x74717c){return _0x5166c4(_0x74717c);}else{return _0x5a2ec1(_0x52832d);}});});}function transcribe(_0x27a9e1,_0x1bdd73,_0x218d40,_0x631a4,_0xe4e7ba,_0x2aaa2b,_0x269d1c){return new Promise(function(_0x327b74,_0x281a35){var _0x3dfe12={};logger['info'](util[_0x574d('0x71')](_0x574d('0x72'),_0x27a9e1,_0xe4e7ba));return uploadFile(_0x1bdd73,_0x218d40,_0x631a4,_0xe4e7ba,path[_0x574d('0x73')](_0x2aaa2b),fs['readFileSync'](_0x2aaa2b))['then'](function(_0x3545fc){logger[_0x574d('0x66')](util[_0x574d('0x71')](_0x574d('0x74'),_0x27a9e1,_0xe4e7ba,_0x3545fc[_0x574d('0x75')]));_0x3dfe12[_0x574d('0x76')]=_0x3545fc[_0x574d('0x77')];_0x3dfe12[_0x574d('0x78')]=_0x3545fc['Location'];logger[_0x574d('0x66')](util[_0x574d('0x71')](_0x574d('0x79'),_0x27a9e1));return startTranscribe(_0x1bdd73,_0x218d40,_0x631a4,uuidv4(),_0x269d1c,_0x3545fc['Location']);})[_0x574d('0x26')](function(_0x5a37e7){logger[_0x574d('0x66')](util['format'](_0x574d('0x7a'),_0x27a9e1,_0x5a37e7[_0x574d('0x7b')][_0x574d('0x7c')]));_0x3dfe12['transcribeName']=_0x5a37e7[_0x574d('0x7b')][_0x574d('0x7c')];_0x3dfe12['transcribeStatus']=_0x5a37e7[_0x574d('0x7b')]['TranscriptionJobStatus'];return _0x327b74(_0x3dfe12);})[_0x574d('0x44')](function(_0x1d9cf1){return _0x281a35(_0x1d9cf1);});});}exports['runTranscribe']=function(_0x3cb2f6,_0x2b84f5,_0x2adecf){var _0x58b406;var _0x5ceb51;var _0x54d550;var _0x1d82ae=require(_0x574d('0x4d'));return db[_0x574d('0x2e')][_0x574d('0x7d')]({'where':{'id':_0x3cb2f6[_0x574d('0x46')]['id']}})[_0x574d('0x26')](function(_0x3f652c){if(_0x3f652c){var _0x48d3bf=util[_0x574d('0x71')](_0x574d('0x61'),_0x3f652c['value']);if(fs['existsSync'](_0x48d3bf)){cypher=!![];return _0x1d82ae[_0x574d('0x62')](_0x48d3bf,_0x3f652c[_0x574d('0x4f')],config[_0x574d('0x51')][_0x574d('0x52')])['then'](function(){return _0x3f652c;});}return _0x3f652c;}})[_0x574d('0x26')](function(_0x9916c2){if(!_0x9916c2){throw new db['Sequelize'][(_0x574d('0x54'))](_0x574d('0x7e'));}_0x5ceb51=_0x9916c2;return db[_0x574d('0x7f')][_0x574d('0x7d')]({'where':{'id':0x1}});})[_0x574d('0x26')](handleEntityNotFound(_0x2b84f5,null))[_0x574d('0x26')](function(_0x129e1b){if(_0x129e1b){_0x58b406=_0x129e1b;if(!_0x58b406['transcribe']||!_0x58b406[_0x574d('0x80')]||!_0x58b406[_0x574d('0x81')]||!_0x58b406[_0x574d('0x82')]||!_0x58b406[_0x574d('0x76')]){throw new db[(_0x574d('0x53'))][(_0x574d('0x54'))]('Transcribe\x20not\x20configured');}if(_0x3cb2f6['body'][_0x574d('0x83')]&&(!_0x58b406[_0x574d('0x84')]||!_0x58b406[_0x574d('0x85')]||!_0x58b406[_0x574d('0x86')]||!_0x58b406['language']||!_0x58b406['bucket'])){throw new db[(_0x574d('0x53'))][(_0x574d('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x574d('0x7d')]({'where':{'id':_0x58b406[_0x574d('0x80')]}});}})[_0x574d('0x26')](function(_0x7b5869){if(!_0x7b5869){throw new db['Sequelize'][(_0x574d('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x7b5869[_0x574d('0x87')]||!_0x7b5869[_0x574d('0x88')]){throw new db[(_0x574d('0x53'))][(_0x574d('0x54'))](_0x574d('0x89'));}_0x54d550=_0x7b5869;return getBucketslist(_0x54d550[_0x574d('0x87')],_0x54d550[_0x574d('0x88')],_0x58b406[_0x574d('0x81')]);})[_0x574d('0x26')](function(_0x26cc92){if(_0x26cc92&&_0x26cc92['Buckets']){var _0x2c8565=_[_0x574d('0x49')](_0x26cc92[_0x574d('0x8a')],function(_0x4661e3){return _0x4661e3[_0x574d('0x8b')]===_0x58b406[_0x574d('0x76')];});if(!_0x2c8565){logger[_0x574d('0x66')](util[_0x574d('0x71')](_0x574d('0x8c'),_0x3cb2f6[_0x574d('0x46')]['id'],_0x58b406[_0x574d('0x76')]));return createBucket(_0x54d550['data1'],_0x54d550['data2'],_0x58b406[_0x574d('0x81')],_0x58b406['bucket']);}logger[_0x574d('0x66')](util[_0x574d('0x71')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3cb2f6[_0x574d('0x46')]['id'],_0x58b406[_0x574d('0x76')]));return;}})['then'](function(_0x558cd4){if(_0x5ceb51['transcribeStatus']===_0x574d('0x8d')){return transcribe(_0x3cb2f6[_0x574d('0x46')]['id'],_0x54d550[_0x574d('0x87')],_0x54d550[_0x574d('0x88')],_0x58b406[_0x574d('0x81')],_0x58b406[_0x574d('0x76')],_0x5ceb51['value'],_0x58b406[_0x574d('0x82')]);}else{logger[_0x574d('0x66')](util[_0x574d('0x71')](_0x574d('0x8e'),_0x3cb2f6[_0x574d('0x46')]['id']));return{'transcribeStatus':_0x574d('0x8f')};}})['then'](function(_0x21bd17){if(_0x21bd17){_0x21bd17[_0x574d('0x90')]=_0x3cb2f6[_0x574d('0x4b')][_0x574d('0x83')];return _0x5ceb51[_0x574d('0x91')](_0x21bd17);}})[_0x574d('0x26')](respondWithResult(_0x2b84f5,null))[_0x574d('0x44')](handleError(_0x2b84f5,null));};function writeFile(_0x28237a,_0x4ac935){return new Promise(function(_0x22c021,_0x1b128e){fs[_0x574d('0x92')](_0x4ac935,_0x28237a,function(_0x969fb1,_0x47a564){if(_0x969fb1){return _0x1b128e(_0x969fb1);}else{return _0x22c021(_0x47a564);}});});}exports[_0x574d('0x93')]=function(_0x5dfee0,_0x911b8f,_0x504fae){return db[_0x574d('0x2e')][_0x574d('0x7d')]({'where':{'id':_0x5dfee0[_0x574d('0x46')]['id']}})[_0x574d('0x26')](handleEntityNotFound(_0x911b8f))[_0x574d('0x26')](function(_0x44814b){if(_0x44814b&&_0x44814b[_0x574d('0x94')]){var _0x2b70e9=_0x44814b[_0x574d('0x94')];var _0x1529a1=config['root']+'/server/files/transcribes/transcribe_'+_0x44814b['id']+_0x574d('0x95');if(fs['existsSync'](_0x1529a1)){return _0x1529a1;}return writeFile(_0x2b70e9,_0x1529a1)['then'](function(){return _0x1529a1;});}else{throw new db['Sequelize'][(_0x574d('0x54'))](_0x574d('0x96'));}})[_0x574d('0x26')](function(_0x35de23){return _0x911b8f['download'](_0x35de23);})[_0x574d('0x44')](handleError(_0x911b8f));}; \ No newline at end of file +var _0xe2d8=['findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','VoiceRecording','fieldName','type','key','model','differenceBy','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','catch','find','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','secrets','recording','existsSync','Sequelize','filename','unlink','message','downloads','sequelize','MD5','col','token','$and','push','ValidationError','VoiceRecording\x20not\x20found','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','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]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe'];(function(_0x428e44,_0x5caca9){var _0x29263e=function(_0x59a9a7){while(--_0x59a9a7){_0x428e44['push'](_0x428e44['shift']());}};_0x29263e(++_0x5caca9);}(_0xe2d8,0x1cf));var _0x8e2d=function(_0x421d0f,_0x14954c){_0x421d0f=_0x421d0f-0x0;var _0x1e520c=_0xe2d8[_0x421d0f];return _0x1e520c;};'use strict';var emlformat=require(_0x8e2d('0x0'));var rimraf=require(_0x8e2d('0x1'));var zipdir=require(_0x8e2d('0x2'));var jsonpatch=require(_0x8e2d('0x3'));var rp=require(_0x8e2d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e2d('0x5'));var path=require('path');var sox=require(_0x8e2d('0x6'));var csv=require(_0x8e2d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e2d('0x8'));var _=require(_0x8e2d('0x9'));var squel=require(_0x8e2d('0xa'));var crypto=require(_0x8e2d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8e2d('0x7'));var querystring=require(_0x8e2d('0xc'));var Papa=require(_0x8e2d('0xd'));var AWS=require(_0x8e2d('0xe'));var uuidv4=require(_0x8e2d('0xf'));var Redis=require(_0x8e2d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8e2d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e2d('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8e2d('0x13'));var licenseUtil=require(_0x8e2d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58be8d,_0x139d1e){_0x139d1e=_0x139d1e||0xcc;return function(_0x3d21f9){if(_0x3d21f9){return _0x58be8d[_0x8e2d('0x15')](_0x139d1e);}return _0x58be8d[_0x8e2d('0x16')](_0x139d1e)[_0x8e2d('0x17')]();};}function respondWithResult(_0x2a9731,_0x23984d){_0x23984d=_0x23984d||0xc8;return function(_0x806b03){if(_0x806b03){return _0x2a9731['status'](_0x23984d)['json'](_0x806b03);}};}function respondWithFilteredResult(_0x331aca,_0x19069e){return function(_0x3d9e4c){if(_0x3d9e4c){var _0xd8df50=typeof _0x19069e[_0x8e2d('0x18')]==='undefined'&&typeof _0x19069e[_0x8e2d('0x19')]===_0x8e2d('0x1a');var _0xb82081=_0x3d9e4c[_0x8e2d('0x1b')];var _0x2c17b0=_0xd8df50?0x0:_0x19069e[_0x8e2d('0x18')];var _0x3c3443=_0xd8df50?_0x3d9e4c[_0x8e2d('0x1b')]:_0x19069e[_0x8e2d('0x18')]+_0x19069e['limit'];var _0x8c4f1f;if(_0x3c3443>=_0xb82081){_0x3c3443=_0xb82081;_0x8c4f1f=0xc8;}else{_0x8c4f1f=0xce;}_0x331aca[_0x8e2d('0x16')](_0x8c4f1f);return _0x331aca[_0x8e2d('0x1c')]('Content-Range',_0x2c17b0+'-'+_0x3c3443+'/'+_0xb82081)[_0x8e2d('0x1d')](_0x3d9e4c);}return null;};}function patchUpdates(_0x20bae9){return function(_0x3bee7c){try{jsonpatch[_0x8e2d('0x1e')](_0x3bee7c,_0x20bae9,!![]);}catch(_0x360a70){return BPromise[_0x8e2d('0x1f')](_0x360a70);}return _0x3bee7c[_0x8e2d('0x20')]();};}function saveUpdates(_0x430c90,_0x231c50){return function(_0x3672b4){if(_0x3672b4){return _0x3672b4[_0x8e2d('0x21')](_0x430c90)[_0x8e2d('0x22')](function(_0x4b72d8){return _0x4b72d8;});}return null;};}function removeEntity(_0x3f4801,_0x50cd88){return function(_0x2d8968){if(_0x2d8968){return _0x2d8968[_0x8e2d('0x23')]()[_0x8e2d('0x22')](function(){_0x3f4801[_0x8e2d('0x16')](0xcc)[_0x8e2d('0x17')]();});}};}function handleEntityNotFound(_0x949eec,_0x4a7ac2){return function(_0x29383f){if(!_0x29383f){_0x949eec['sendStatus'](0x194);}return _0x29383f;};}function handleError(_0x5dadb9,_0x39a13a){_0x39a13a=_0x39a13a||0x1f4;return function(_0x23c396){logger['error'](_0x23c396[_0x8e2d('0x24')]);if(_0x23c396[_0x8e2d('0x25')]){delete _0x23c396[_0x8e2d('0x25')];}_0x5dadb9['status'](_0x39a13a)[_0x8e2d('0x26')](_0x23c396);};}exports[_0x8e2d('0x27')]=function(_0x4ad8f4,_0x3c5578){var _0x3e6eae={},_0x1d16ea={},_0x3180ef={'count':0x0,'rows':[]};var _0x5ab41e=_['map'](db[_0x8e2d('0x28')]['rawAttributes'],function(_0x852b75){return{'name':_0x852b75[_0x8e2d('0x29')],'type':_0x852b75[_0x8e2d('0x2a')][_0x8e2d('0x2b')]};});_0x1d16ea[_0x8e2d('0x2c')]=_[_0x8e2d('0x2d')](_[_0x8e2d('0x2e')](_0x5ab41e,_0x8e2d('0x25')),['format']);_0x1d16ea[_0x8e2d('0x2f')]=_[_0x8e2d('0x30')](_0x4ad8f4['query']);_0x1d16ea['filters']=_['intersection'](_0x1d16ea[_0x8e2d('0x2c')],_0x1d16ea[_0x8e2d('0x2f')]);_0x3e6eae[_0x8e2d('0x31')]=_[_0x8e2d('0x32')](_0x1d16ea[_0x8e2d('0x2c')],qs[_0x8e2d('0x33')](_0x4ad8f4[_0x8e2d('0x2f')][_0x8e2d('0x33')]));_0x3e6eae[_0x8e2d('0x31')]=_0x3e6eae[_0x8e2d('0x31')][_0x8e2d('0x34')]?_0x3e6eae[_0x8e2d('0x31')]:_0x1d16ea[_0x8e2d('0x2c')];if(!_0x4ad8f4[_0x8e2d('0x2f')][_0x8e2d('0x35')]('nolimit')){_0x3e6eae[_0x8e2d('0x19')]=qs['limit'](_0x4ad8f4['query'][_0x8e2d('0x19')]);_0x3e6eae[_0x8e2d('0x18')]=qs[_0x8e2d('0x18')](_0x4ad8f4[_0x8e2d('0x2f')]['offset']);}_0x3e6eae['order']=qs['sort'](_0x4ad8f4[_0x8e2d('0x2f')]['sort']);_0x3e6eae[_0x8e2d('0x36')]=qs['filters'](_[_0x8e2d('0x37')](_0x4ad8f4['query'],_0x1d16ea[_0x8e2d('0x38')]),_0x5ab41e);if(_0x4ad8f4[_0x8e2d('0x2f')][_0x8e2d('0x39')]){_0x3e6eae[_0x8e2d('0x36')]=_['merge'](_0x3e6eae[_0x8e2d('0x36')],{'$or':_[_0x8e2d('0x2e')](_0x5ab41e,function(_0x4d1dfc){if(_0x4d1dfc['type']!==_0x8e2d('0x3a')){var _0x4dd3e5={};_0x4dd3e5[_0x4d1dfc[_0x8e2d('0x25')]]={'$like':'%'+_0x4ad8f4['query'][_0x8e2d('0x39')]+'%'};return _0x4dd3e5;}})});}_0x3e6eae=_[_0x8e2d('0x3b')]({},_0x3e6eae,_0x4ad8f4[_0x8e2d('0x3c')]);var _0xe1d193={'where':_0x3e6eae[_0x8e2d('0x36')]};return db['VoiceRecording'][_0x8e2d('0x1b')](_0xe1d193)[_0x8e2d('0x22')](function(_0x52c025){_0x3180ef[_0x8e2d('0x1b')]=_0x52c025;if(_0x4ad8f4[_0x8e2d('0x2f')][_0x8e2d('0x3d')]){_0x3e6eae[_0x8e2d('0x3e')]=[{'all':!![]}];}return db[_0x8e2d('0x28')][_0x8e2d('0x3f')](_0x3e6eae);})['then'](function(_0x104153){_0x3180ef[_0x8e2d('0x40')]=_0x104153;return _0x3180ef;})[_0x8e2d('0x22')](respondWithFilteredResult(_0x3c5578,_0x3e6eae))['catch'](handleError(_0x3c5578,null));};exports[_0x8e2d('0x41')]=function(_0x15d12c,_0x2d412d){var _0x2fb5b7={'raw':![],'where':{'id':_0x15d12c[_0x8e2d('0x42')]['id']}},_0x3dd225={};_0x3dd225['model']=_[_0x8e2d('0x30')](db[_0x8e2d('0x28')][_0x8e2d('0x43')]);_0x3dd225[_0x8e2d('0x2f')]=_[_0x8e2d('0x30')](_0x15d12c['query']);_0x3dd225[_0x8e2d('0x38')]=_[_0x8e2d('0x32')](_0x3dd225[_0x8e2d('0x2c')],_0x3dd225['query']);_0x2fb5b7[_0x8e2d('0x31')]=_[_0x8e2d('0x32')](_0x3dd225[_0x8e2d('0x2c')],qs[_0x8e2d('0x33')](_0x15d12c[_0x8e2d('0x2f')][_0x8e2d('0x33')]));_0x2fb5b7[_0x8e2d('0x31')]=_0x2fb5b7[_0x8e2d('0x31')][_0x8e2d('0x34')]?_0x2fb5b7[_0x8e2d('0x31')]:_0x3dd225['model'];if(_0x15d12c['query'][_0x8e2d('0x3d')]){_0x2fb5b7['include']=[{'all':!![]}];}_0x2fb5b7=_[_0x8e2d('0x3b')]({},_0x2fb5b7,_0x15d12c[_0x8e2d('0x3c')]);return db['VoiceRecording']['find'](_0x2fb5b7)[_0x8e2d('0x22')](handleEntityNotFound(_0x2d412d,null))[_0x8e2d('0x22')](respondWithResult(_0x2d412d,null))['catch'](handleError(_0x2d412d,null));};exports['create']=function(_0x30d1ce,_0x537db9){return db['VoiceRecording'][_0x8e2d('0x44')](_0x30d1ce[_0x8e2d('0x45')],{})[_0x8e2d('0x22')](respondWithResult(_0x537db9,0xc9))[_0x8e2d('0x46')](handleError(_0x537db9,null));};exports[_0x8e2d('0x21')]=function(_0x27658b,_0x7389af){if(_0x27658b[_0x8e2d('0x45')]['id']){delete _0x27658b['body']['id'];}return db[_0x8e2d('0x28')][_0x8e2d('0x47')]({'where':{'id':_0x27658b[_0x8e2d('0x42')]['id']}})[_0x8e2d('0x22')](handleEntityNotFound(_0x7389af,null))[_0x8e2d('0x22')](saveUpdates(_0x27658b[_0x8e2d('0x45')],null))['then'](respondWithResult(_0x7389af,null))['catch'](handleError(_0x7389af,null));};exports[_0x8e2d('0x48')]=function(_0x4334ae,_0x44f3ef){return db[_0x8e2d('0x28')][_0x8e2d('0x48')]()[_0x8e2d('0x22')](respondWithResult(_0x44f3ef,null))['catch'](handleError(_0x44f3ef,null));};exports[_0x8e2d('0x49')]=function(_0x327c56,_0x310c16,_0x42e4b0){var _0x524300=require(_0x8e2d('0x4a'));var _0x4c4a0f=![];var _0xdd089d={};if(_0x327c56[_0x8e2d('0x2f')][_0x8e2d('0x2a')]&&_0x327c56[_0x8e2d('0x2f')][_0x8e2d('0x2a')]===_0x8e2d('0x4b')){_0xdd089d[_0x8e2d('0x4b')]=_0x327c56['params']['id'];}else{_0xdd089d['id']=_0x327c56[_0x8e2d('0x42')]['id'];}return db[_0x8e2d('0x28')][_0x8e2d('0x47')]({'where':_0xdd089d,'attributes':['id','value'],'raw':!![]})[_0x8e2d('0x22')](handleEntityNotFound(_0x310c16,null))['then'](function(_0x4e4ef6){if(_0x4e4ef6){var _0x2cdffc=_0x4e4ef6[_0x8e2d('0x4c')];var _0x4b5681=util[_0x8e2d('0x4d')](_0x8e2d('0x4e'),_0x2cdffc);if(fs['existsSync'](_0x4b5681)){_0x4c4a0f=!![];return _0x524300['decryptFile'](_0x4b5681,_0x2cdffc,config[_0x8e2d('0x4f')][_0x8e2d('0x50')])['then'](function(){return _0x4e4ef6;});}return _0x4e4ef6;}})['then'](function(_0x53b206){if(_0x53b206){var _0x3c9a8c=_0x53b206[_0x8e2d('0x4c')];if(!fs[_0x8e2d('0x51')](_0x3c9a8c)){throw new db[(_0x8e2d('0x52'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x53b206['filename']){return _0x310c16[_0x8e2d('0x49')](_0x3c9a8c,_0x53b206[_0x8e2d('0x53')]+path['extname'](_0x3c9a8c),function(){if(_0x4c4a0f){fs[_0x8e2d('0x54')](_0x3c9a8c);}});}else{return _0x310c16[_0x8e2d('0x49')](_0x3c9a8c,function(_0x228bd2){if(_0x4c4a0f){fs[_0x8e2d('0x54')](_0x3c9a8c);}});}}})[_0x8e2d('0x46')](function(_0x4257aa){if(_0x4257aa[_0x8e2d('0x55')]==='VoiceRecording\x20not\x20found'){_0x310c16['status'](0x194)[_0x8e2d('0x26')]('Not\x20found');}else{return handleError(_0x310c16,null);}});};exports[_0x8e2d('0x56')]=function(_0x16366a,_0x921b3a,_0x225af0){var _0x137f3d=require(_0x8e2d('0x4a'));var _0xeea12f=![];var _0x1a2b60={'$and':[db[_0x8e2d('0x57')][_0x8e2d('0x36')](db[_0x8e2d('0x57')]['fn'](_0x8e2d('0x58'),db[_0x8e2d('0x57')][_0x8e2d('0x59')](_0x8e2d('0x4b'))),_0x16366a['query'][_0x8e2d('0x5a')])]};if(_0x16366a[_0x8e2d('0x2f')][_0x8e2d('0x2a')]&&_0x16366a[_0x8e2d('0x2f')]['type']===_0x8e2d('0x4b')){_0x1a2b60[_0x8e2d('0x5b')][_0x8e2d('0x5c')]({'uniqueid':_0x16366a['params']['id']});}else{_0x1a2b60[_0x8e2d('0x5b')][_0x8e2d('0x5c')]({'id':_0x16366a[_0x8e2d('0x42')]['id']});}return db[_0x8e2d('0x28')][_0x8e2d('0x47')]({'where':_0x1a2b60,'attributes':['id',_0x8e2d('0x4c')],'raw':!![]})[_0x8e2d('0x22')](handleEntityNotFound(_0x921b3a,null))[_0x8e2d('0x22')](function(_0x1c9c2b){if(_0x1c9c2b){var _0x1d35cd=util['format'](_0x8e2d('0x4e'),_0x1c9c2b[_0x8e2d('0x4c')]);if(fs[_0x8e2d('0x51')](_0x1d35cd)){_0xeea12f=!![];return _0x137f3d['decryptFile'](_0x1d35cd,_0x1c9c2b[_0x8e2d('0x4c')],config[_0x8e2d('0x4f')][_0x8e2d('0x50')])[_0x8e2d('0x22')](function(){return _0x1c9c2b;});}return _0x1c9c2b;}})[_0x8e2d('0x22')](function(_0x19716d){if(_0x19716d){if(!fs[_0x8e2d('0x51')](_0x19716d['value'])){throw new db[(_0x8e2d('0x52'))][(_0x8e2d('0x5d'))](_0x8e2d('0x5e'));}if(_0x19716d[_0x8e2d('0x53')]){return _0x921b3a['download'](_0x19716d[_0x8e2d('0x4c')],_0x19716d['filename']+path[_0x8e2d('0x5f')](_0x19716d[_0x8e2d('0x4c')]),function(){if(_0xeea12f){fs[_0x8e2d('0x54')](_0x19716d[_0x8e2d('0x4c')]);}});}else{return _0x921b3a[_0x8e2d('0x49')](_0x19716d[_0x8e2d('0x4c')],function(_0x44555d){if(_0xeea12f){fs[_0x8e2d('0x54')](_0x19716d[_0x8e2d('0x4c')]);}});}}})[_0x8e2d('0x46')](handleError(_0x921b3a,null));};exports[_0x8e2d('0x23')]=function(_0x45f95c,_0x42f4f1){return db[_0x8e2d('0x28')][_0x8e2d('0x47')]({'where':{'id':_0x45f95c[_0x8e2d('0x42')]['id']}})[_0x8e2d('0x22')](function(_0x1f95c9){if(_[_0x8e2d('0x60')](_0x1f95c9)){throw new ReferenceError(_0x8e2d('0x61'));}return _0x1f95c9;})[_0x8e2d('0x22')](function(_0x712d6d){var _0x3369f6=_0x712d6d[_0x8e2d('0x4c')];logger[_0x8e2d('0x62')](_0x8e2d('0x63'),_0x3369f6);if(!_[_0x8e2d('0x60')](_0x712d6d[_0x8e2d('0x4c')])&&fs[_0x8e2d('0x51')](_0x3369f6)){logger[_0x8e2d('0x62')](_0x8e2d('0x64')+_0x3369f6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3369f6);}_0x3369f6=_0x3369f6+_0x8e2d('0x65');if(!_[_0x8e2d('0x60')](_0x712d6d['value'])&&fs[_0x8e2d('0x51')](_0x3369f6)){logger['info'](_0x8e2d('0x64')+_0x3369f6+_0x8e2d('0x66'));fs['unlinkSync'](_0x3369f6);}return _0x712d6d;})[_0x8e2d('0x22')](function(_0x4e9c80){if(!_0x4e9c80)throw new InternalError();return _0x4e9c80[_0x8e2d('0x23')]();})['then'](function(){_0x42f4f1[_0x8e2d('0x16')](0xcc)[_0x8e2d('0x17')]();})[_0x8e2d('0x46')](handleError(_0x42f4f1,null));};function getBucketslist(_0x219c54,_0x5f3826,_0x168d72){return new Promise(function(_0x37cea9,_0x5512bf){var _0x22a10b=new AWS['S3']({'accessKeyId':_0x5f3826,'secretAccessKey':_0x219c54,'region':_0x168d72});_0x22a10b['listBuckets']({},function(_0x487420,_0x584442){if(_0x487420){return _0x5512bf(_0x487420);}else{return _0x37cea9(_0x584442);}});});}function createBucket(_0x3a42bb,_0x5b83a7,_0x44d971,_0x8e4144){return new Promise(function(_0x5419ec,_0xb5b74c){var _0x4c1be6=new AWS['S3']({'accessKeyId':_0x5b83a7,'secretAccessKey':_0x3a42bb,'region':_0x44d971});_0x4c1be6[_0x8e2d('0x67')]({'Bucket':_0x8e4144},function(_0x28c201,_0x5b8efb){if(_0x28c201){return _0xb5b74c(_0x28c201);}else{return _0x5419ec(_0x5b8efb);}});});}function uploadFile(_0x5eccf7,_0x3ff62e,_0x8b49f1,_0x542ccd,_0x569413,_0x52a0c8){return new Promise(function(_0x23962c,_0x655fbd){var _0x3b433b=new AWS['S3']({'accessKeyId':_0x3ff62e,'secretAccessKey':_0x5eccf7,'region':_0x8b49f1});_0x3b433b['upload']({'Bucket':_0x542ccd,'Key':_0x569413,'Body':_0x52a0c8},function(_0xab4331,_0x34bb65){if(_0xab4331){return _0x655fbd(_0xab4331);}else{return _0x23962c(_0x34bb65);}});});}function startTranscribe(_0x26796b,_0x334722,_0x21afb9,_0x373ba8,_0x4cd2e0,_0x5020ab){return new Promise(function(_0x284532,_0xa0135f){var _0x4ce123=new AWS['TranscribeService']({'accessKeyId':_0x334722,'secretAccessKey':_0x26796b,'region':_0x21afb9});_0x4ce123[_0x8e2d('0x68')]({'TranscriptionJobName':_0x373ba8,'LanguageCode':_0x4cd2e0,'Media':{'MediaFileUri':_0x5020ab}},function(_0x2293ba,_0x206c7b){if(_0x2293ba){return _0xa0135f(_0x2293ba);}else{return _0x284532(_0x206c7b);}});});}function transcribe(_0x149e10,_0x2ec5ee,_0x3f87f3,_0x2989c1,_0x4a7278,_0x416115,_0x3d61f3){return new Promise(function(_0x38bd49,_0x415c1e){var _0x589fd6={};logger[_0x8e2d('0x62')](util['format'](_0x8e2d('0x69'),_0x149e10,_0x4a7278));return uploadFile(_0x2ec5ee,_0x3f87f3,_0x2989c1,_0x4a7278,path[_0x8e2d('0x6a')](_0x416115),fs[_0x8e2d('0x6b')](_0x416115))['then'](function(_0x372cf7){logger[_0x8e2d('0x62')](util[_0x8e2d('0x4d')](_0x8e2d('0x6c'),_0x149e10,_0x4a7278,_0x372cf7[_0x8e2d('0x6d')]));_0x589fd6['bucket']=_0x372cf7[_0x8e2d('0x6e')];_0x589fd6['location']=_0x372cf7[_0x8e2d('0x6d')];logger['info'](util[_0x8e2d('0x4d')](_0x8e2d('0x6f'),_0x149e10));return startTranscribe(_0x2ec5ee,_0x3f87f3,_0x2989c1,uuidv4(),_0x3d61f3,_0x372cf7[_0x8e2d('0x6d')]);})[_0x8e2d('0x22')](function(_0x479bb1){logger[_0x8e2d('0x62')](util[_0x8e2d('0x4d')](_0x8e2d('0x70'),_0x149e10,_0x479bb1[_0x8e2d('0x71')]['TranscriptionJobName']));_0x589fd6['transcribeName']=_0x479bb1[_0x8e2d('0x71')][_0x8e2d('0x72')];_0x589fd6[_0x8e2d('0x73')]=_0x479bb1[_0x8e2d('0x71')]['TranscriptionJobStatus'];return _0x38bd49(_0x589fd6);})[_0x8e2d('0x46')](function(_0xb772ca){return _0x415c1e(_0xb772ca);});});}exports[_0x8e2d('0x74')]=function(_0x2fcb46,_0x1a0146,_0x351b66){var _0x1159b7;var _0x527d74;var _0x3dbb70;var _0x308712=require(_0x8e2d('0x4a'));return db['VoiceRecording'][_0x8e2d('0x75')]({'where':{'id':_0x2fcb46[_0x8e2d('0x42')]['id']}})[_0x8e2d('0x22')](function(_0x599aa5){if(_0x599aa5){var _0x56adcf=util['format'](_0x8e2d('0x4e'),_0x599aa5[_0x8e2d('0x4c')]);if(fs['existsSync'](_0x56adcf)){cypher=!![];return _0x308712['decryptFile'](_0x56adcf,_0x599aa5[_0x8e2d('0x4c')],config['secrets'][_0x8e2d('0x50')])[_0x8e2d('0x22')](function(){return _0x599aa5;});}return _0x599aa5;}})[_0x8e2d('0x22')](function(_0x364e1b){if(!_0x364e1b){throw new db['Sequelize'][(_0x8e2d('0x5d'))](_0x8e2d('0x76'));}_0x527d74=_0x364e1b;return db['Setting'][_0x8e2d('0x75')]({'where':{'id':0x1}});})[_0x8e2d('0x22')](handleEntityNotFound(_0x1a0146,null))[_0x8e2d('0x22')](function(_0x16551d){if(_0x16551d){_0x1159b7=_0x16551d;if(!_0x1159b7[_0x8e2d('0x77')]||!_0x1159b7[_0x8e2d('0x78')]||!_0x1159b7['transcribeRegion']||!_0x1159b7['language']||!_0x1159b7[_0x8e2d('0x79')]){throw new db[(_0x8e2d('0x52'))][(_0x8e2d('0x5d'))]('Transcribe\x20not\x20configured');}if(_0x2fcb46[_0x8e2d('0x45')][_0x8e2d('0x7a')]&&(!_0x1159b7[_0x8e2d('0x7b')]||!_0x1159b7[_0x8e2d('0x7c')]||!_0x1159b7[_0x8e2d('0x7d')]||!_0x1159b7['language']||!_0x1159b7[_0x8e2d('0x79')])){throw new db[(_0x8e2d('0x52'))][(_0x8e2d('0x5d'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x8e2d('0x75')]({'where':{'id':_0x1159b7[_0x8e2d('0x78')]}});}})[_0x8e2d('0x22')](function(_0x43abd3){if(!_0x43abd3){throw new db[(_0x8e2d('0x52'))][(_0x8e2d('0x5d'))](_0x8e2d('0x7e'));}if(!_0x43abd3[_0x8e2d('0x7f')]||!_0x43abd3['data2']){throw new db[(_0x8e2d('0x52'))]['ValidationError'](_0x8e2d('0x80'));}_0x3dbb70=_0x43abd3;return getBucketslist(_0x3dbb70[_0x8e2d('0x7f')],_0x3dbb70[_0x8e2d('0x81')],_0x1159b7['transcribeRegion']);})[_0x8e2d('0x22')](function(_0x1de11c){if(_0x1de11c&&_0x1de11c[_0x8e2d('0x82')]){var _0x2b5129=_[_0x8e2d('0x47')](_0x1de11c['Buckets'],function(_0x175ece){return _0x175ece[_0x8e2d('0x83')]===_0x1159b7['bucket'];});if(!_0x2b5129){logger[_0x8e2d('0x62')](util[_0x8e2d('0x4d')](_0x8e2d('0x84'),_0x2fcb46[_0x8e2d('0x42')]['id'],_0x1159b7[_0x8e2d('0x79')]));return createBucket(_0x3dbb70[_0x8e2d('0x7f')],_0x3dbb70[_0x8e2d('0x81')],_0x1159b7[_0x8e2d('0x85')],_0x1159b7[_0x8e2d('0x79')]);}logger[_0x8e2d('0x62')](util[_0x8e2d('0x4d')](_0x8e2d('0x86'),_0x2fcb46[_0x8e2d('0x42')]['id'],_0x1159b7[_0x8e2d('0x79')]));return;}})[_0x8e2d('0x22')](function(_0x561445){if(_0x527d74[_0x8e2d('0x73')]===_0x8e2d('0x87')){return transcribe(_0x2fcb46[_0x8e2d('0x42')]['id'],_0x3dbb70[_0x8e2d('0x7f')],_0x3dbb70[_0x8e2d('0x81')],_0x1159b7[_0x8e2d('0x85')],_0x1159b7[_0x8e2d('0x79')],_0x527d74[_0x8e2d('0x4c')],_0x1159b7['language']);}else{logger['info'](util[_0x8e2d('0x4d')](_0x8e2d('0x88'),_0x2fcb46[_0x8e2d('0x42')]['id']));return{'transcribeStatus':_0x8e2d('0x89')};}})[_0x8e2d('0x22')](function(_0x58b0ab){if(_0x58b0ab){_0x58b0ab[_0x8e2d('0x8a')]=_0x2fcb46[_0x8e2d('0x45')]['runSentiment'];return _0x527d74[_0x8e2d('0x8b')](_0x58b0ab);}})[_0x8e2d('0x22')](respondWithResult(_0x1a0146,null))[_0x8e2d('0x46')](handleError(_0x1a0146,null));};function writeFile(_0x358629,_0x1451e0){return new Promise(function(_0x4db639,_0x15aa4d){fs[_0x8e2d('0x8c')](_0x1451e0,_0x358629,function(_0x9bbc,_0x1194eb){if(_0x9bbc){return _0x15aa4d(_0x9bbc);}else{return _0x4db639(_0x1194eb);}});});}exports['downloadTranscribe']=function(_0x2c1970,_0x2a63be,_0x1b2fa4){return db['VoiceRecording'][_0x8e2d('0x75')]({'where':{'id':_0x2c1970['params']['id']}})[_0x8e2d('0x22')](handleEntityNotFound(_0x2a63be))[_0x8e2d('0x22')](function(_0x547801){if(_0x547801&&_0x547801[_0x8e2d('0x8d')]){var _0x4283f4=_0x547801['fileText'];var _0x5195e0=config[_0x8e2d('0x8e')]+'/server/files/transcribes/transcribe_'+_0x547801['id']+_0x8e2d('0x8f');if(fs['existsSync'](_0x5195e0)){return _0x5195e0;}return writeFile(_0x4283f4,_0x5195e0)['then'](function(){return _0x5195e0;});}else{throw new db['Sequelize']['ValidationError'](_0x8e2d('0x90'));}})[_0x8e2d('0x22')](function(_0x206ff8){return _0x2a63be[_0x8e2d('0x49')](_0x206ff8);})[_0x8e2d('0x46')](handleError(_0x2a63be));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 09bcbc2..3d56d64 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 _0x6d0b=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6d0b,0x71));var _0xb6d0=function(_0x36d744,_0x2f9636){_0x36d744=_0x36d744-0x0;var _0x59922b=_0x6d0b[_0x36d744];return _0x59922b;};'use strict';var attributes=require(_0xb6d0('0x0'));module['exports']=function(_0x3466a7,_0x5eae9a){return _0x3466a7[_0xb6d0('0x1')](_0xb6d0('0x2'),attributes,{'tableName':_0xb6d0('0x3'),'paranoid':![],'indexes':[{'name':_0xb6d0('0x4'),'fields':[_0xb6d0('0x4')]},{'name':_0xb6d0('0x5'),'fields':[_0xb6d0('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7c8=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','exports'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xb7c8,0x119));var _0x8b7c=function(_0xf87bbf,_0x3180af){_0xf87bbf=_0xf87bbf-0x0;var _0x322140=_0xb7c8[_0xf87bbf];return _0x322140;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x8b7c('0x0')]=function(_0x150db2,_0x15b7a3){return _0x150db2[_0x8b7c('0x1')](_0x8b7c('0x2'),attributes,{'tableName':_0x8b7c('0x3'),'paranoid':![],'indexes':[{'name':_0x8b7c('0x4'),'fields':['uniqueid']},{'name':_0x8b7c('0x5'),'fields':[_0x8b7c('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 3850a0a..afb5a6d 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 _0xe5af=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','where','limit','debug','../../components/encryptor','Setting','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe5af,0x9c));var _0xfe5a=function(_0x71611c,_0x1a0078){_0x71611c=_0x71611c-0x0;var _0x3d87c4=_0xe5af[_0x71611c];return _0x3d87c4;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});}exports[_0xfe5a('0x12')]=function(_0x5bf597){var _0x20620b=this;return new Promise(function(_0x456707,_0x54d5fb){return db[_0xfe5a('0x13')][_0xfe5a('0x14')](_0x5bf597[_0xfe5a('0x15')],{'raw':_0x5bf597['options']?_0x5bf597['options'][_0xfe5a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597[_0xfe5a('0x17')][_0xfe5a('0x18')]||null:null,'attributes':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597[_0xfe5a('0x17')]['attributes']||null:null,'limit':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597['options'][_0xfe5a('0x19')]||null:null})[_0xfe5a('0x8')](function(_0x1fbde5){logger['info']('UpdateVoiceRecording',_0x5bf597);logger[_0xfe5a('0x1a')](_0xfe5a('0x12'),_0x5bf597,JSON['stringify'](_0x1fbde5));_0x456707(_0x1fbde5);})[_0xfe5a('0x11')](function(_0x26f744){logger['error'](_0xfe5a('0x12'),_0x26f744[_0xfe5a('0xe')],_0x5bf597);_0x54d5fb(_0x20620b[_0xfe5a('0xd')](0x1f4,_0x26f744[_0xfe5a('0xe')]));});});};exports['CreateVoiceRecording']=function(_0x42136e){var _0x2f5d04=this;return new Promise(function(_0x24481f,_0x1cd531){var _0x36bf20=require(_0xfe5a('0x1b'));var _0xdbf1e0;return db[_0xfe5a('0x1c')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xfe5a('0x8')](function(_0x485f9d){_0xdbf1e0=_0x485f9d;return db[_0xfe5a('0x13')][_0xfe5a('0x1d')](_0x42136e[_0xfe5a('0x15')]);})['then'](function(_0x48a061){if(_0xdbf1e0['callRecordingEncryption']&&fs[_0xfe5a('0x1e')](_0x48a061['value'])){var _0x51d1f4=util['format'](_0xfe5a('0x1f'),_0x48a061[_0xfe5a('0x20')]);return _0x36bf20[_0xfe5a('0x21')](_0x48a061[_0xfe5a('0x20')],_0x51d1f4,config[_0xfe5a('0x22')][_0xfe5a('0x23')])[_0xfe5a('0x8')](function(){fs[_0xfe5a('0x24')](_0x48a061[_0xfe5a('0x20')]);logger[_0xfe5a('0xf')](_0xfe5a('0x25'));return _0x48a061;});}return _0x48a061;})['then'](function(_0x1f0c86){logger[_0xfe5a('0xf')]('CreateVoiceRecording',_0x42136e);logger[_0xfe5a('0x1a')](_0xfe5a('0x26'),_0x42136e,JSON[_0xfe5a('0xc')](_0x1f0c86));_0x24481f(_0x1f0c86);})[_0xfe5a('0x11')](function(_0xe5a992){logger['error']('CreateVoiceRecording',_0xe5a992[_0xfe5a('0xe')],_0x42136e);_0x1cd531(_0x2f5d04['error'](0x1f4,_0xe5a992[_0xfe5a('0xe')]));});});}; \ No newline at end of file +var _0x32f4=['unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','recording'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x32f4,0x154));var _0x432f=function(_0x2deff0,_0x162995){_0x2deff0=_0x2deff0-0x0;var _0x55fcac=_0x32f4[_0x2deff0];return _0x55fcac;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['update'](_0x243cf[_0x432f('0x18')],{'raw':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1b')]||null:null,'attributes':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1c')]||null:null,'limit':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')]['limit']||null:null})['then'](function(_0x343d13){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON[_0x432f('0x10')](_0x343d13));_0x129582(_0x343d13);})[_0x432f('0x15')](function(_0x89ea50){logger[_0x432f('0x11')](_0x432f('0x16'),_0x89ea50['message'],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x89ea50[_0x432f('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2cbde9){var _0x3e37ec=this;return new Promise(function(_0x2bcbb4,_0x23347e){var _0x44839=require(_0x432f('0x1d'));var _0x138a6a;return db['Setting'][_0x432f('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x432f('0xb')](function(_0x573cc5){_0x138a6a=_0x573cc5;return db[_0x432f('0x17')]['create'](_0x2cbde9[_0x432f('0x18')]);})['then'](function(_0x325a9c){if(_0x138a6a[_0x432f('0x1f')]&&fs[_0x432f('0x20')](_0x325a9c['value'])){var _0x6a116e=util[_0x432f('0x21')]('%s.cypher',_0x325a9c['value']);return _0x44839[_0x432f('0x22')](_0x325a9c[_0x432f('0x23')],_0x6a116e,config[_0x432f('0x24')][_0x432f('0x25')])[_0x432f('0xb')](function(){fs[_0x432f('0x26')](_0x325a9c['value']);logger['info'](_0x432f('0x27'));return _0x325a9c;});}return _0x325a9c;})[_0x432f('0xb')](function(_0x184203){logger['info'](_0x432f('0x28'),_0x2cbde9);logger[_0x432f('0x29')](_0x432f('0x28'),_0x2cbde9,JSON[_0x432f('0x10')](_0x184203));_0x2bcbb4(_0x184203);})[_0x432f('0x15')](function(_0x3ad632){logger[_0x432f('0x11')](_0x432f('0x28'),_0x3ad632['message'],_0x2cbde9);_0x23347e(_0x3e37ec['error'](0x1f4,_0x3ad632[_0x432f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 910b60a..dbcb4ce 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 _0xf1f9=['show','create','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x460fb7,_0x415cc5){var _0xc97213=function(_0x6a8193){while(--_0x6a8193){_0x460fb7['push'](_0x460fb7['shift']());}};_0xc97213(++_0x415cc5);}(_0xf1f9,0x10e));var _0x9f1f=function(_0x55e744,_0x449b39){_0x55e744=_0x55e744-0x0;var _0x1c3c02=_0xf1f9[_0x55e744];return _0x1c3c02;};'use strict';var multer=require(_0x9f1f('0x0'));var util=require('util');var path=require(_0x9f1f('0x1'));var timeout=require(_0x9f1f('0x2'));var express=require(_0x9f1f('0x3'));var router=express[_0x9f1f('0x4')]();var fs_extra=require(_0x9f1f('0x5'));var auth=require(_0x9f1f('0x6'));var interaction=require(_0x9f1f('0x7'));var config=require(_0x9f1f('0x8'));var controller=require(_0x9f1f('0x9'));router['get']('/',auth[_0x9f1f('0xa')](),controller[_0x9f1f('0xb')]);router[_0x9f1f('0xc')]('/describe',auth[_0x9f1f('0xa')](),controller[_0x9f1f('0xd')]);router[_0x9f1f('0xc')](_0x9f1f('0xe'),auth[_0x9f1f('0xa')](),controller[_0x9f1f('0xf')]);router['post']('/',auth[_0x9f1f('0xa')](),controller[_0x9f1f('0x10')]);router['put'](_0x9f1f('0xe'),auth[_0x9f1f('0xa')](),controller[_0x9f1f('0x11')]);router[_0x9f1f('0x12')](_0x9f1f('0xe'),auth[_0x9f1f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4982=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x37c076,_0x20d356){var _0x252ac2=function(_0x4246bb){while(--_0x4246bb){_0x37c076['push'](_0x37c076['shift']());}};_0x252ac2(++_0x20d356);}(_0x4982,0x188));var _0x2498=function(_0x5d90b8,_0x528b3a){_0x5d90b8=_0x5d90b8-0x0;var _0x5712b3=_0x4982[_0x5d90b8];return _0x5712b3;};'use strict';var multer=require(_0x2498('0x0'));var util=require(_0x2498('0x1'));var path=require(_0x2498('0x2'));var timeout=require('connect-timeout');var express=require(_0x2498('0x3'));var router=express[_0x2498('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2498('0x5'));var interaction=require(_0x2498('0x6'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x2498('0x7')](),controller[_0x2498('0x8')]);router[_0x2498('0x9')](_0x2498('0xa'),auth[_0x2498('0x7')](),controller['describe']);router['get'](_0x2498('0xb'),auth[_0x2498('0x7')](),controller['show']);router[_0x2498('0xc')]('/',auth[_0x2498('0x7')](),controller['create']);router[_0x2498('0xd')](_0x2498('0xb'),auth['isAuthenticated'](),controller[_0x2498('0xe')]);router[_0x2498('0xf')](_0x2498('0xb'),auth[_0x2498('0x7')](),controller[_0x2498('0x10')]);module[_0x2498('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1cabc9b..4202e3d 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 _0xae9f=['moment','ENUM','attended','STRING','Yes'];(function(_0x13e758,_0x317d23){var _0x5b53c3=function(_0x103e80){while(--_0x103e80){_0x13e758['push'](_0x13e758['shift']());}};_0x5b53c3(++_0x317d23);}(_0xae9f,0x1b8));var _0xfae9=function(_0x5145d5,_0x24a1eb){_0x5145d5=_0x5145d5-0x0;var _0x373f49=_0xae9f[_0x5145d5];return _0x373f49;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfae9('0x0'));module['exports']={'type':{'type':Sequelize[_0xfae9('0x1')]('blind',_0xfae9('0x2'))},'result':{'type':Sequelize[_0xfae9('0x3')]},'transfererchannel':{'type':Sequelize[_0xfae9('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xfae9('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xfae9('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xfae9('0x3')]},'transferercontext':{'type':Sequelize[_0xfae9('0x3')]},'transfererexten':{'type':Sequelize[_0xfae9('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xfae9('0x3')]},'transfereechannel':{'type':Sequelize[_0xfae9('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xfae9('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xfae9('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfae9('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xfae9('0x3')]},'transfereecontext':{'type':Sequelize[_0xfae9('0x3')]},'transfereeexten':{'type':Sequelize[_0xfae9('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xfae9('0x3')]},'isexternal':{'type':Sequelize[_0xfae9('0x1')](_0xfae9('0x4'),'No')},'context':{'type':Sequelize[_0xfae9('0x3')]},'extension':{'type':Sequelize[_0xfae9('0x3')]}}; \ No newline at end of file +var _0xb88f=['exports','blind','attended','STRING','ENUM','sequelize','moment'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xb88f,0x18d));var _0xfb88=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0xb88f[_0xbc346f];return _0x9f9260;};'use strict';var Sequelize=require(_0xfb88('0x0'));var moment=require(_0xfb88('0x1'));module[_0xfb88('0x2')]={'type':{'type':Sequelize['ENUM'](_0xfb88('0x3'),_0xfb88('0x4'))},'result':{'type':Sequelize[_0xfb88('0x5')]},'transfererchannel':{'type':Sequelize[_0xfb88('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xfb88('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xfb88('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xfb88('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xfb88('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xfb88('0x5')]},'transfereechannel':{'type':Sequelize[_0xfb88('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xfb88('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xfb88('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xfb88('0x5')]},'transfereecontext':{'type':Sequelize[_0xfb88('0x5')]},'transfereeexten':{'type':Sequelize[_0xfb88('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xfb88('0x5')]},'isexternal':{'type':Sequelize[_0xfb88('0x6')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index dc8319c..0df1e8b 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 _0xeff9=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','map','VoiceTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters'];(function(_0xc4d469,_0x5f0d30){var _0x199faf=function(_0x3d28ec){while(--_0x3d28ec){_0xc4d469['push'](_0xc4d469['shift']());}};_0x199faf(++_0x5f0d30);}(_0xeff9,0x130));var _0x9eff=function(_0x2f3c2d,_0x29d408){_0x2f3c2d=_0x2f3c2d-0x0;var _0x274e16=_0xeff9[_0x2f3c2d];return _0x274e16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9eff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9eff('0x1'));var rp=require(_0x9eff('0x2'));var moment=require(_0x9eff('0x3'));var BPromise=require(_0x9eff('0x4'));var Mustache=require(_0x9eff('0x5'));var util=require(_0x9eff('0x6'));var path=require('path');var sox=require(_0x9eff('0x7'));var csv=require('to-csv');var ejs=require(_0x9eff('0x8'));var fs=require('fs');var fs_extra=require(_0x9eff('0x9'));var _=require(_0x9eff('0xa'));var squel=require('squel');var crypto=require(_0x9eff('0xb'));var jsforce=require(_0x9eff('0xc'));var deskjs=require(_0x9eff('0xd'));var toCsv=require(_0x9eff('0xe'));var querystring=require('querystring');var Papa=require(_0x9eff('0xf'));var Redis=require('ioredis');var authService=require(_0x9eff('0x10'));var qs=require(_0x9eff('0x11'));var as=require(_0x9eff('0x12'));var hardwareService=require(_0x9eff('0x13'));var logger=require('../../config/logger')(_0x9eff('0x14'));var utils=require('../../config/utils');var config=require(_0x9eff('0x15'));var licenseUtil=require(_0x9eff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x149828,_0x34baeb){_0x34baeb=_0x34baeb||0xcc;return function(_0x3a1eab){if(_0x3a1eab){return _0x149828[_0x9eff('0x17')](_0x34baeb);}return _0x149828['status'](_0x34baeb)['end']();};}function respondWithResult(_0x2b8d48,_0x4ec104){_0x4ec104=_0x4ec104||0xc8;return function(_0x16df21){if(_0x16df21){return _0x2b8d48[_0x9eff('0x18')](_0x4ec104)[_0x9eff('0x19')](_0x16df21);}};}function respondWithFilteredResult(_0x2fb026,_0x2249e7){return function(_0x40f588){if(_0x40f588){var _0x50a920=typeof _0x2249e7[_0x9eff('0x1a')]===_0x9eff('0x1b')&&typeof _0x2249e7[_0x9eff('0x1c')]===_0x9eff('0x1b');var _0x37c519=_0x40f588[_0x9eff('0x1d')];var _0x2051c9=_0x50a920?0x0:_0x2249e7[_0x9eff('0x1a')];var _0x3df9f6=_0x50a920?_0x40f588[_0x9eff('0x1d')]:_0x2249e7[_0x9eff('0x1a')]+_0x2249e7['limit'];var _0x4f02e4;if(_0x3df9f6>=_0x37c519){_0x3df9f6=_0x37c519;_0x4f02e4=0xc8;}else{_0x4f02e4=0xce;}_0x2fb026['status'](_0x4f02e4);return _0x2fb026['set'](_0x9eff('0x1e'),_0x2051c9+'-'+_0x3df9f6+'/'+_0x37c519)['json'](_0x40f588);}return null;};}function patchUpdates(_0x20f580){return function(_0x4f9369){try{jsonpatch['apply'](_0x4f9369,_0x20f580,!![]);}catch(_0x35e163){return BPromise[_0x9eff('0x1f')](_0x35e163);}return _0x4f9369[_0x9eff('0x20')]();};}function saveUpdates(_0x1e3bc7,_0x242e67){return function(_0x391def){if(_0x391def){return _0x391def[_0x9eff('0x21')](_0x1e3bc7)['then'](function(_0x2178db){return _0x2178db;});}return null;};}function removeEntity(_0x51567e,_0x180788){return function(_0xb85fe1){if(_0xb85fe1){return _0xb85fe1[_0x9eff('0x22')]()[_0x9eff('0x23')](function(){_0x51567e['status'](0xcc)[_0x9eff('0x24')]();});}};}function handleEntityNotFound(_0x4b8d9a,_0x52e3f8){return function(_0x35b124){if(!_0x35b124){_0x4b8d9a[_0x9eff('0x17')](0x194);}return _0x35b124;};}function handleError(_0x1c58fc,_0x140dfc){_0x140dfc=_0x140dfc||0x1f4;return function(_0xb2be67){logger[_0x9eff('0x25')](_0xb2be67['stack']);if(_0xb2be67['name']){delete _0xb2be67[_0x9eff('0x26')];}_0x1c58fc['status'](_0x140dfc)['send'](_0xb2be67);};}exports['index']=function(_0x2b849d,_0x5bb13f){var _0x132452={},_0x357f63={},_0xdfe04c={'count':0x0,'rows':[]};var _0x58d946=_[_0x9eff('0x27')](db[_0x9eff('0x28')]['rawAttributes'],function(_0x37caab){return{'name':_0x37caab[_0x9eff('0x29')],'type':_0x37caab[_0x9eff('0x2a')][_0x9eff('0x2b')]};});_0x357f63[_0x9eff('0x2c')]=_[_0x9eff('0x27')](_0x58d946,_0x9eff('0x26'));_0x357f63[_0x9eff('0x2d')]=_[_0x9eff('0x2e')](_0x2b849d[_0x9eff('0x2d')]);_0x357f63['filters']=_[_0x9eff('0x2f')](_0x357f63[_0x9eff('0x2c')],_0x357f63['query']);_0x132452[_0x9eff('0x30')]=_['intersection'](_0x357f63[_0x9eff('0x2c')],qs[_0x9eff('0x31')](_0x2b849d['query'][_0x9eff('0x31')]));_0x132452[_0x9eff('0x30')]=_0x132452[_0x9eff('0x30')][_0x9eff('0x32')]?_0x132452[_0x9eff('0x30')]:_0x357f63[_0x9eff('0x2c')];if(!_0x2b849d['query'][_0x9eff('0x33')](_0x9eff('0x34'))){_0x132452[_0x9eff('0x1c')]=qs[_0x9eff('0x1c')](_0x2b849d[_0x9eff('0x2d')][_0x9eff('0x1c')]);_0x132452['offset']=qs[_0x9eff('0x1a')](_0x2b849d['query'][_0x9eff('0x1a')]);}_0x132452['order']=qs[_0x9eff('0x35')](_0x2b849d[_0x9eff('0x2d')]['sort']);_0x132452[_0x9eff('0x36')]=qs[_0x9eff('0x37')](_[_0x9eff('0x38')](_0x2b849d[_0x9eff('0x2d')],_0x357f63[_0x9eff('0x37')]),_0x58d946);if(_0x2b849d['query'][_0x9eff('0x39')]){_0x132452[_0x9eff('0x36')]=_[_0x9eff('0x3a')](_0x132452[_0x9eff('0x36')],{'$or':_[_0x9eff('0x27')](_0x58d946,function(_0x5c9b4f){if(_0x5c9b4f[_0x9eff('0x2a')]!==_0x9eff('0x3b')){var _0x16fd8d={};_0x16fd8d[_0x5c9b4f[_0x9eff('0x26')]]={'$like':'%'+_0x2b849d[_0x9eff('0x2d')][_0x9eff('0x39')]+'%'};return _0x16fd8d;}})});}_0x132452=_['merge']({},_0x132452,_0x2b849d['options']);var _0x50ef1c={'where':_0x132452[_0x9eff('0x36')]};return db['VoiceTransferReport'][_0x9eff('0x1d')](_0x50ef1c)[_0x9eff('0x23')](function(_0x54bd21){_0xdfe04c[_0x9eff('0x1d')]=_0x54bd21;if(_0x2b849d[_0x9eff('0x2d')][_0x9eff('0x3c')]){_0x132452[_0x9eff('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x9eff('0x3e')](_0x132452);})[_0x9eff('0x23')](function(_0x400664){_0xdfe04c[_0x9eff('0x3f')]=_0x400664;return _0xdfe04c;})[_0x9eff('0x23')](respondWithFilteredResult(_0x5bb13f,_0x132452))[_0x9eff('0x40')](handleError(_0x5bb13f,null));};exports['show']=function(_0x5dc5e9,_0x5ba105){var _0x4d688f={'raw':!![],'where':{'id':_0x5dc5e9[_0x9eff('0x41')]['id']}},_0x1cd532={};_0x1cd532['model']=_[_0x9eff('0x2e')](db[_0x9eff('0x28')][_0x9eff('0x42')]);_0x1cd532[_0x9eff('0x2d')]=_['keys'](_0x5dc5e9[_0x9eff('0x2d')]);_0x1cd532[_0x9eff('0x37')]=_[_0x9eff('0x2f')](_0x1cd532[_0x9eff('0x2c')],_0x1cd532[_0x9eff('0x2d')]);_0x4d688f[_0x9eff('0x30')]=_[_0x9eff('0x2f')](_0x1cd532[_0x9eff('0x2c')],qs[_0x9eff('0x31')](_0x5dc5e9['query'][_0x9eff('0x31')]));_0x4d688f['attributes']=_0x4d688f[_0x9eff('0x30')]['length']?_0x4d688f[_0x9eff('0x30')]:_0x1cd532[_0x9eff('0x2c')];if(_0x5dc5e9['query'][_0x9eff('0x3c')]){_0x4d688f[_0x9eff('0x3d')]=[{'all':!![]}];}_0x4d688f=_[_0x9eff('0x3a')]({},_0x4d688f,_0x5dc5e9[_0x9eff('0x43')]);return db[_0x9eff('0x28')][_0x9eff('0x44')](_0x4d688f)['then'](handleEntityNotFound(_0x5ba105,null))[_0x9eff('0x23')](respondWithResult(_0x5ba105,null))[_0x9eff('0x40')](handleError(_0x5ba105,null));};exports[_0x9eff('0x45')]=function(_0xab7c64,_0x35752b){return db[_0x9eff('0x28')]['create'](_0xab7c64[_0x9eff('0x46')],{})[_0x9eff('0x23')](respondWithResult(_0x35752b,0xc9))['catch'](handleError(_0x35752b,null));};exports[_0x9eff('0x21')]=function(_0x25a8a0,_0x5101b5){if(_0x25a8a0['body']['id']){delete _0x25a8a0[_0x9eff('0x46')]['id'];}return db[_0x9eff('0x28')][_0x9eff('0x44')]({'where':{'id':_0x25a8a0[_0x9eff('0x41')]['id']}})['then'](handleEntityNotFound(_0x5101b5,null))[_0x9eff('0x23')](saveUpdates(_0x25a8a0[_0x9eff('0x46')],null))[_0x9eff('0x23')](respondWithResult(_0x5101b5,null))[_0x9eff('0x40')](handleError(_0x5101b5,null));};exports['destroy']=function(_0x141ff4,_0x13c3e3){return db['VoiceTransferReport'][_0x9eff('0x44')]({'where':{'id':_0x141ff4[_0x9eff('0x41')]['id']}})['then'](handleEntityNotFound(_0x13c3e3,null))['then'](removeEntity(_0x13c3e3,null))[_0x9eff('0x40')](handleError(_0x13c3e3,null));};exports[_0x9eff('0x47')]=function(_0x5ebc17,_0x2ec3db){return db[_0x9eff('0x28')][_0x9eff('0x47')]()[_0x9eff('0x23')](respondWithResult(_0x2ec3db,null))[_0x9eff('0x40')](handleError(_0x2ec3db,null));}; \ No newline at end of file +var _0x5fbf=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x5fbf,0x82));var _0xf5fb=function(_0x46acc1,_0x2cecc7){_0x46acc1=_0x46acc1-0x0;var _0x55b49b=_0x5fbf[_0x46acc1];return _0x55b49b;};'use strict';var emlformat=require(_0xf5fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5fb('0x1'));var jsonpatch=require(_0xf5fb('0x2'));var rp=require('request-promise');var moment=require(_0xf5fb('0x3'));var BPromise=require(_0xf5fb('0x4'));var Mustache=require('mustache');var util=require(_0xf5fb('0x5'));var path=require(_0xf5fb('0x6'));var sox=require('sox');var csv=require(_0xf5fb('0x7'));var ejs=require(_0xf5fb('0x8'));var fs=require('fs');var fs_extra=require(_0xf5fb('0x9'));var _=require('lodash');var squel=require(_0xf5fb('0xa'));var crypto=require(_0xf5fb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf5fb('0xc'));var toCsv=require(_0xf5fb('0x7'));var querystring=require(_0xf5fb('0xd'));var Papa=require(_0xf5fb('0xe'));var Redis=require(_0xf5fb('0xf'));var authService=require(_0xf5fb('0x10'));var qs=require(_0xf5fb('0x11'));var as=require(_0xf5fb('0x12'));var hardwareService=require(_0xf5fb('0x13'));var logger=require(_0xf5fb('0x14'))(_0xf5fb('0x15'));var utils=require(_0xf5fb('0x16'));var config=require(_0xf5fb('0x17'));var licenseUtil=require(_0xf5fb('0x18'));var db=require(_0xf5fb('0x19'))['db'];function respondWithStatusCode(_0x2dfeaf,_0xa6a732){_0xa6a732=_0xa6a732||0xcc;return function(_0x76341b){if(_0x76341b){return _0x2dfeaf[_0xf5fb('0x1a')](_0xa6a732);}return _0x2dfeaf[_0xf5fb('0x1b')](_0xa6a732)[_0xf5fb('0x1c')]();};}function respondWithResult(_0x214a58,_0xc1653a){_0xc1653a=_0xc1653a||0xc8;return function(_0x5d1bab){if(_0x5d1bab){return _0x214a58['status'](_0xc1653a)[_0xf5fb('0x1d')](_0x5d1bab);}};}function respondWithFilteredResult(_0x98107d,_0x4d567b){return function(_0x424ada){if(_0x424ada){var _0xa40c62=typeof _0x4d567b[_0xf5fb('0x1e')]===_0xf5fb('0x1f')&&typeof _0x4d567b[_0xf5fb('0x20')]===_0xf5fb('0x1f');var _0x4b46b0=_0x424ada['count'];var _0x60c6cd=_0xa40c62?0x0:_0x4d567b['offset'];var _0xdf30ad=_0xa40c62?_0x424ada[_0xf5fb('0x21')]:_0x4d567b['offset']+_0x4d567b['limit'];var _0x322dbd;if(_0xdf30ad>=_0x4b46b0){_0xdf30ad=_0x4b46b0;_0x322dbd=0xc8;}else{_0x322dbd=0xce;}_0x98107d[_0xf5fb('0x1b')](_0x322dbd);return _0x98107d[_0xf5fb('0x22')]('Content-Range',_0x60c6cd+'-'+_0xdf30ad+'/'+_0x4b46b0)[_0xf5fb('0x1d')](_0x424ada);}return null;};}function patchUpdates(_0xc1e30f){return function(_0x5e5b57){try{jsonpatch[_0xf5fb('0x23')](_0x5e5b57,_0xc1e30f,!![]);}catch(_0x40cb8e){return BPromise[_0xf5fb('0x24')](_0x40cb8e);}return _0x5e5b57[_0xf5fb('0x25')]();};}function saveUpdates(_0x18cbc4,_0x7e7c56){return function(_0x4e75d1){if(_0x4e75d1){return _0x4e75d1[_0xf5fb('0x26')](_0x18cbc4)[_0xf5fb('0x27')](function(_0x75accf){return _0x75accf;});}return null;};}function removeEntity(_0x32be50,_0x145db7){return function(_0x47e678){if(_0x47e678){return _0x47e678[_0xf5fb('0x28')]()[_0xf5fb('0x27')](function(){_0x32be50['status'](0xcc)[_0xf5fb('0x1c')]();});}};}function handleEntityNotFound(_0x43900e,_0x190844){return function(_0x11703f){if(!_0x11703f){_0x43900e[_0xf5fb('0x1a')](0x194);}return _0x11703f;};}function handleError(_0x64f711,_0x5edd8f){_0x5edd8f=_0x5edd8f||0x1f4;return function(_0x1d41e2){logger[_0xf5fb('0x29')](_0x1d41e2['stack']);if(_0x1d41e2[_0xf5fb('0x2a')]){delete _0x1d41e2[_0xf5fb('0x2a')];}_0x64f711[_0xf5fb('0x1b')](_0x5edd8f)[_0xf5fb('0x2b')](_0x1d41e2);};}exports[_0xf5fb('0x2c')]=function(_0x158d49,_0x398ff9){var _0x2f3857={},_0x50bd36={},_0x128dad={'count':0x0,'rows':[]};var _0x2544f3=_[_0xf5fb('0x2d')](db['VoiceTransferReport'][_0xf5fb('0x2e')],function(_0x6f167){return{'name':_0x6f167[_0xf5fb('0x2f')],'type':_0x6f167[_0xf5fb('0x30')][_0xf5fb('0x31')]};});_0x50bd36[_0xf5fb('0x32')]=_[_0xf5fb('0x2d')](_0x2544f3,_0xf5fb('0x2a'));_0x50bd36[_0xf5fb('0x33')]=_[_0xf5fb('0x34')](_0x158d49[_0xf5fb('0x33')]);_0x50bd36[_0xf5fb('0x35')]=_[_0xf5fb('0x36')](_0x50bd36[_0xf5fb('0x32')],_0x50bd36[_0xf5fb('0x33')]);_0x2f3857[_0xf5fb('0x37')]=_[_0xf5fb('0x36')](_0x50bd36[_0xf5fb('0x32')],qs[_0xf5fb('0x38')](_0x158d49[_0xf5fb('0x33')]['fields']));_0x2f3857['attributes']=_0x2f3857[_0xf5fb('0x37')][_0xf5fb('0x39')]?_0x2f3857[_0xf5fb('0x37')]:_0x50bd36['model'];if(!_0x158d49[_0xf5fb('0x33')]['hasOwnProperty']('nolimit')){_0x2f3857[_0xf5fb('0x20')]=qs[_0xf5fb('0x20')](_0x158d49[_0xf5fb('0x33')]['limit']);_0x2f3857['offset']=qs['offset'](_0x158d49[_0xf5fb('0x33')][_0xf5fb('0x1e')]);}_0x2f3857['order']=qs[_0xf5fb('0x3a')](_0x158d49[_0xf5fb('0x33')][_0xf5fb('0x3a')]);_0x2f3857[_0xf5fb('0x3b')]=qs[_0xf5fb('0x35')](_[_0xf5fb('0x3c')](_0x158d49[_0xf5fb('0x33')],_0x50bd36[_0xf5fb('0x35')]),_0x2544f3);if(_0x158d49[_0xf5fb('0x33')][_0xf5fb('0x3d')]){_0x2f3857[_0xf5fb('0x3b')]=_[_0xf5fb('0x3e')](_0x2f3857[_0xf5fb('0x3b')],{'$or':_[_0xf5fb('0x2d')](_0x2544f3,function(_0x26e83c){if(_0x26e83c[_0xf5fb('0x30')]!==_0xf5fb('0x3f')){var _0x357733={};_0x357733[_0x26e83c[_0xf5fb('0x2a')]]={'$like':'%'+_0x158d49['query']['filter']+'%'};return _0x357733;}})});}_0x2f3857=_['merge']({},_0x2f3857,_0x158d49[_0xf5fb('0x40')]);var _0x5e5dc6={'where':_0x2f3857[_0xf5fb('0x3b')]};return db[_0xf5fb('0x41')][_0xf5fb('0x21')](_0x5e5dc6)['then'](function(_0x1d7db2){_0x128dad[_0xf5fb('0x21')]=_0x1d7db2;if(_0x158d49[_0xf5fb('0x33')][_0xf5fb('0x42')]){_0x2f3857[_0xf5fb('0x43')]=[{'all':!![]}];}return db[_0xf5fb('0x41')][_0xf5fb('0x44')](_0x2f3857);})[_0xf5fb('0x27')](function(_0x17784e){_0x128dad['rows']=_0x17784e;return _0x128dad;})[_0xf5fb('0x27')](respondWithFilteredResult(_0x398ff9,_0x2f3857))['catch'](handleError(_0x398ff9,null));};exports[_0xf5fb('0x45')]=function(_0x564b99,_0x2a6ba2){var _0x5a8c38={'raw':!![],'where':{'id':_0x564b99[_0xf5fb('0x46')]['id']}},_0x525d3f={};_0x525d3f[_0xf5fb('0x32')]=_[_0xf5fb('0x34')](db[_0xf5fb('0x41')][_0xf5fb('0x2e')]);_0x525d3f[_0xf5fb('0x33')]=_['keys'](_0x564b99[_0xf5fb('0x33')]);_0x525d3f[_0xf5fb('0x35')]=_[_0xf5fb('0x36')](_0x525d3f[_0xf5fb('0x32')],_0x525d3f[_0xf5fb('0x33')]);_0x5a8c38[_0xf5fb('0x37')]=_['intersection'](_0x525d3f[_0xf5fb('0x32')],qs[_0xf5fb('0x38')](_0x564b99['query'][_0xf5fb('0x38')]));_0x5a8c38[_0xf5fb('0x37')]=_0x5a8c38[_0xf5fb('0x37')][_0xf5fb('0x39')]?_0x5a8c38[_0xf5fb('0x37')]:_0x525d3f[_0xf5fb('0x32')];if(_0x564b99[_0xf5fb('0x33')][_0xf5fb('0x42')]){_0x5a8c38[_0xf5fb('0x43')]=[{'all':!![]}];}_0x5a8c38=_[_0xf5fb('0x3e')]({},_0x5a8c38,_0x564b99['options']);return db[_0xf5fb('0x41')][_0xf5fb('0x47')](_0x5a8c38)[_0xf5fb('0x27')](handleEntityNotFound(_0x2a6ba2,null))[_0xf5fb('0x27')](respondWithResult(_0x2a6ba2,null))[_0xf5fb('0x48')](handleError(_0x2a6ba2,null));};exports[_0xf5fb('0x49')]=function(_0x3811c6,_0x4f5ca5){return db[_0xf5fb('0x41')]['create'](_0x3811c6[_0xf5fb('0x4a')],{})[_0xf5fb('0x27')](respondWithResult(_0x4f5ca5,0xc9))['catch'](handleError(_0x4f5ca5,null));};exports[_0xf5fb('0x26')]=function(_0x449e93,_0x333956){if(_0x449e93[_0xf5fb('0x4a')]['id']){delete _0x449e93[_0xf5fb('0x4a')]['id'];}return db['VoiceTransferReport'][_0xf5fb('0x47')]({'where':{'id':_0x449e93[_0xf5fb('0x46')]['id']}})[_0xf5fb('0x27')](handleEntityNotFound(_0x333956,null))[_0xf5fb('0x27')](saveUpdates(_0x449e93[_0xf5fb('0x4a')],null))[_0xf5fb('0x27')](respondWithResult(_0x333956,null))[_0xf5fb('0x48')](handleError(_0x333956,null));};exports[_0xf5fb('0x28')]=function(_0x169166,_0x14a0fc){return db[_0xf5fb('0x41')][_0xf5fb('0x47')]({'where':{'id':_0x169166[_0xf5fb('0x46')]['id']}})[_0xf5fb('0x27')](handleEntityNotFound(_0x14a0fc,null))[_0xf5fb('0x27')](removeEntity(_0x14a0fc,null))[_0xf5fb('0x48')](handleError(_0x14a0fc,null));};exports[_0xf5fb('0x4b')]=function(_0x4cc7f3,_0x2c5bb0){return db[_0xf5fb('0x41')][_0xf5fb('0x4b')]()['then'](respondWithResult(_0x2c5bb0,null))[_0xf5fb('0x48')](handleError(_0x2c5bb0,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 5754bf1..1b34b6b 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 _0xd449=['../../config/environment','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36b507,_0x3e0e58){var _0x489041=function(_0x34df70){while(--_0x34df70){_0x36b507['push'](_0x36b507['shift']());}};_0x489041(++_0x3e0e58);}(_0xd449,0xe8));var _0x9d44=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xd449[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0x9d44('0x0'));var util=require(_0x9d44('0x1'));var logger=require(_0x9d44('0x2'))(_0x9d44('0x3'));var moment=require(_0x9d44('0x4'));var BPromise=require(_0x9d44('0x5'));var rp=require(_0x9d44('0x6'));var fs=require('fs');var path=require(_0x9d44('0x7'));var rimraf=require('rimraf');var config=require(_0x9d44('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x9d44('0x9')]=function(_0x334756,_0x13184a){return _0x334756[_0x9d44('0xa')](_0x9d44('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd847=['bluebird','request-promise','rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment'];(function(_0x131ce,_0x540f85){var _0x56a158=function(_0x57d816){while(--_0x57d816){_0x131ce['push'](_0x131ce['shift']());}};_0x56a158(++_0x540f85);}(_0xd847,0x8c));var _0x7d84=function(_0x7418fa,_0x238bc5){_0x7418fa=_0x7418fa-0x0;var _0x47bb0e=_0xd847[_0x7418fa];return _0x47bb0e;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var logger=require('../../config/logger')(_0x7d84('0x2'));var moment=require(_0x7d84('0x3'));var BPromise=require(_0x7d84('0x4'));var rp=require(_0x7d84('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d84('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d84('0x7'));module[_0x7d84('0x8')]=function(_0x27bcde,_0x5adfba){return _0x27bcde[_0x7d84('0x9')](_0x7d84('0xa'),attributes,{'tableName':_0x7d84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index c6b70ab..a90bed6 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 _0xb14a=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xb14a,0xfc));var _0xab14=function(_0x39fe94,_0x56f2f9){_0x39fe94=_0x39fe94-0x0;var _0x2360a7=_0xb14a[_0x39fe94];return _0x2360a7;};'use strict';var _=require(_0xab14('0x0'));var util=require(_0xab14('0x1'));var moment=require(_0xab14('0x2'));var BPromise=require(_0xab14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab14('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab14('0x5'))(_0xab14('0x6'));var config=require('../../config/environment');var jayson=require(_0xab14('0x7'));var client=jayson[_0xab14('0x8')][_0xab14('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45db6e,_0x408365,_0x42b71a){return new BPromise(function(_0x46ab93,_0x43f447){return client[_0xab14('0xa')](_0x45db6e,_0x42b71a)[_0xab14('0xb')](function(_0x56c036){logger[_0xab14('0xc')](_0xab14('0xd'),_0x408365,_0xab14('0xe'));logger[_0xab14('0xf')](_0xab14('0x10'),_0x408365,_0xab14('0xe'),JSON[_0xab14('0x11')](_0x56c036));if(_0x56c036[_0xab14('0x12')]){if(_0x56c036[_0xab14('0x12')][_0xab14('0x13')]===0x1f4){logger[_0xab14('0x12')](_0xab14('0xd'),_0x408365,_0x56c036['error'][_0xab14('0x14')]);return _0x43f447(_0x56c036[_0xab14('0x12')][_0xab14('0x14')]);}logger[_0xab14('0x12')](_0xab14('0xd'),_0x408365,_0x56c036[_0xab14('0x12')][_0xab14('0x14')]);return _0x46ab93(_0x56c036['error'][_0xab14('0x14')]);}else{logger[_0xab14('0xc')](_0xab14('0xd'),_0x408365,_0xab14('0xe'));_0x46ab93(_0x56c036[_0xab14('0x15')][_0xab14('0x14')]);}})[_0xab14('0x16')](function(_0x2d2756){logger['error'](_0xab14('0xd'),_0x408365,_0x2d2756);_0x43f447(_0x2d2756);});});}exports[_0xab14('0x17')]=function(_0x331013){var _0x5b8a5e=this;return new Promise(function(_0x541c00,_0x5111d0){return db[_0xab14('0x18')][_0xab14('0x19')](_0x331013['body'],{'raw':_0x331013[_0xab14('0x1a')]?_0x331013['options'][_0xab14('0x1b')]===undefined?!![]:![]:!![]})[_0xab14('0xb')](function(_0x205bb2){logger[_0xab14('0xc')](_0xab14('0x17'),_0x331013);logger[_0xab14('0xf')](_0xab14('0x17'),_0x331013,JSON['stringify'](_0x205bb2));_0x541c00(_0x205bb2);})[_0xab14('0x16')](function(_0x387f79){logger[_0xab14('0x12')](_0xab14('0x17'),_0x387f79[_0xab14('0x14')],_0x331013);_0x5111d0(_0x5b8a5e[_0xab14('0x12')](0x1f4,_0x387f79[_0xab14('0x14')]));});});}; \ No newline at end of file +var _0x79ed=['request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceTransferReport','create','options','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3840b2,_0x36c09b){var _0x43b7fe=function(_0x2acdf8){while(--_0x2acdf8){_0x3840b2['push'](_0x3840b2['shift']());}};_0x43b7fe(++_0x36c09b);}(_0x79ed,0xb7));var _0xd79e=function(_0x31ab4f,_0x1f7ecc){_0x31ab4f=_0x31ab4f-0x0;var _0x37ece2=_0x79ed[_0x31ab4f];return _0x37ece2;};'use strict';var _=require('lodash');var util=require(_0xd79e('0x0'));var moment=require(_0xd79e('0x1'));var BPromise=require(_0xd79e('0x2'));var rs=require(_0xd79e('0x3'));var fs=require('fs');var Redis=require(_0xd79e('0x4'));var db=require(_0xd79e('0x5'))['db'];var utils=require(_0xd79e('0x6'));var logger=require(_0xd79e('0x7'))(_0xd79e('0x8'));var config=require(_0xd79e('0x9'));var jayson=require(_0xd79e('0xa'));var client=jayson[_0xd79e('0xb')][_0xd79e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f8a7a,_0x572a02,_0x40a56d){return new BPromise(function(_0x579d3a,_0x50cd5f){return client[_0xd79e('0xd')](_0x3f8a7a,_0x40a56d)['then'](function(_0x24af1f){logger[_0xd79e('0xe')](_0xd79e('0xf'),_0x572a02,_0xd79e('0x10'));logger[_0xd79e('0x11')](_0xd79e('0x12'),_0x572a02,'request\x20sent',JSON[_0xd79e('0x13')](_0x24af1f));if(_0x24af1f[_0xd79e('0x14')]){if(_0x24af1f[_0xd79e('0x14')]['code']===0x1f4){logger[_0xd79e('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x572a02,_0x24af1f[_0xd79e('0x14')]['message']);return _0x50cd5f(_0x24af1f[_0xd79e('0x14')]['message']);}logger[_0xd79e('0x14')](_0xd79e('0xf'),_0x572a02,_0x24af1f[_0xd79e('0x14')][_0xd79e('0x15')]);return _0x579d3a(_0x24af1f[_0xd79e('0x14')][_0xd79e('0x15')]);}else{logger[_0xd79e('0xe')](_0xd79e('0xf'),_0x572a02,_0xd79e('0x10'));_0x579d3a(_0x24af1f[_0xd79e('0x16')][_0xd79e('0x15')]);}})[_0xd79e('0x17')](function(_0x26868a){logger[_0xd79e('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x572a02,_0x26868a);_0x50cd5f(_0x26868a);});});}exports['CreateVoiceTransferReport']=function(_0x3fc349){var _0x3fe225=this;return new Promise(function(_0x5ad39d,_0x44551b){return db[_0xd79e('0x18')][_0xd79e('0x19')](_0x3fc349['body'],{'raw':_0x3fc349[_0xd79e('0x1a')]?_0x3fc349[_0xd79e('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x494b99){logger[_0xd79e('0xe')]('CreateVoiceTransferReport',_0x3fc349);logger[_0xd79e('0x11')](_0xd79e('0x1b'),_0x3fc349,JSON['stringify'](_0x494b99));_0x5ad39d(_0x494b99);})['catch'](function(_0x3a0674){logger[_0xd79e('0x14')](_0xd79e('0x1b'),_0x3a0674['message'],_0x3fc349);_0x44551b(_0x3fe225[_0xd79e('0x14')](0x1f4,_0x3a0674['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c3e0d09..3a998b3 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 _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0x183959,_0xd8fbdc){var _0x3bdc40=function(_0x2c0fd0){while(--_0x2c0fd0){_0x183959['push'](_0x183959['shift']());}};_0x3bdc40(++_0xd8fbdc);}(_0x0bb5,0x148));var _0x50bb=function(_0x2005be,_0x2da705){_0x2005be=_0x2005be-0x0;var _0x13cb0e=_0x0bb5[_0x2005be];return _0x13cb0e;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file +var _0xb821=['/unhold','unhold','/calls','calls','/transfer','Router','../../components/auth/service','/originate','originate','post','/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','answer','/hold','hold'];(function(_0x5ffa4b,_0x23f3e6){var _0x3af11c=function(_0x43c488){while(--_0x43c488){_0x5ffa4b['push'](_0x5ffa4b['shift']());}};_0x3af11c(++_0x23f3e6);}(_0xb821,0xa7));var _0x1b82=function(_0x4dcd34,_0xabecd0){_0x4dcd34=_0x4dcd34-0x0;var _0x3df6d9=_0xb821[_0x4dcd34];return _0x3df6d9;};'use strict';var express=require('express');var router=express[_0x1b82('0x0')]();var auth=require(_0x1b82('0x1'));var controller=require('./webbar.controller');router['post'](_0x1b82('0x2'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x1b82('0x3')]);router[_0x1b82('0x4')](_0x1b82('0x5'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x4')](_0x1b82('0x8'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x4')](_0x1b82('0xb'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0xc')]);router[_0x1b82('0x4')](_0x1b82('0xd'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0x4')](_0x1b82('0xf'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);router[_0x1b82('0x4')](_0x1b82('0x11'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller['transfer']);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0c7bac1..2b69256 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 _0x0624=['result','catch','findOne','agent','filter','rows','sessionId\x20','\x20not\x20found!','body','length','json','userId','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','answer','hold','webbar:hold','hold\x20executed!','webbar:unhold','calls','VoiceChannels','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','util','bluebird','jayson/promise','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','send','status','NotFound','then','message'];(function(_0x4415d0,_0x3063f2){var _0x12d6dc=function(_0x231cf2){while(--_0x231cf2){_0x4415d0['push'](_0x4415d0['shift']());}};_0x12d6dc(++_0x3063f2);}(_0x0624,0x132));var _0x4062=function(_0x2380b1,_0x2d1886){_0x2380b1=_0x2380b1-0x0;var _0x56fcef=_0x0624[_0x2380b1];return _0x56fcef;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x4062('0x0'));var BPromise=require(_0x4062('0x1'));var jayson=require(_0x4062('0x2'));var amiClient=jayson[_0x4062('0x3')][_0x4062('0x4')]({'port':0x232a});var logger=require(_0x4062('0x5'))('webbarapi');var Redis=require('ioredis');config[_0x4062('0x6')]=_[_0x4062('0x7')](config[_0x4062('0x6')],{'host':_0x4062('0x8'),'port':0x18eb});var io=require(_0x4062('0x9'))(new Redis(config['redis']));var Schema=require(_0x4062('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4062('0xb')]},'callNumber':{'type':_0x4062('0xc'),'required':[!![],_0x4062('0xd')]},'callerId':{'type':_0x4062('0xc')},'callbackUrl':{'type':_0x4062('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],_0x4062('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4062('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],_0x4062('0xb')]},'sessionId':{'type':_0x4062('0xc'),'required':[!![],_0x4062('0xf')]},'transferNumber':{'type':'string','required':[!![],_0x4062('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4062('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],_0x4062('0xb')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4062('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x4d7166,_0x5458a1,_0x4cb54e){logger[_0x4062('0x11')](_0x4d7166,_0x5458a1,JSON['stringify'](_0x4cb54e));io['to'](_0x4d7166)[_0x4062('0x12')](_0x5458a1,_0x4cb54e);}function handleError(_0x278f51){return function(_0x3d14bb){console[_0x4062('0x13')](_0x4062('0x14'),_0x3d14bb,_0x3d14bb instanceof RangeError);logger[_0x4062('0x15')](_0x3d14bb[_0x4062('0x16')]);if(_0x3d14bb instanceof RangeError){if(_0x3d14bb['name']){delete _0x3d14bb[_0x4062('0x17')];}_0x278f51['status'](0x194)[_0x4062('0x18')](_0x3d14bb);}else{if(_0x3d14bb['name']){delete _0x3d14bb[_0x4062('0x17')];}_0x278f51[_0x4062('0x19')](0x1f4)[_0x4062('0x18')](_0x3d14bb);}};}function checkError(){return function(_0x18b2e6){if(!_0x18b2e6){throw new RangeError(_0x4062('0x1a'));}return _0x18b2e6;};}function respondWithRpcPromise(_0x78d507,_0xae1bbd){return new BPromise(function(_0x341310,_0xc6c0ba){var _0x53648a=amiClient;return _0x53648a['request'](_0x78d507,_0xae1bbd)[_0x4062('0x1b')](function(_0xc5e4a0){if(_0xc5e4a0[_0x4062('0x15')]){if(_0xc5e4a0[_0x4062('0x15')]['code']===0x1f4){return _0xc6c0ba(_0xc5e4a0['error']['message']);}return _0x341310(_0xc5e4a0[_0x4062('0x15')][_0x4062('0x1c')]);}else{_0x341310(_0xc5e4a0[_0x4062('0x1d')]);}})[_0x4062('0x1e')](function(_0x3c1ee0){_0xc6c0ba(_0x3c1ee0);});});}function getAgent(_0x10cb31){return db['User'][_0x4062('0x1f')]({'where':{'id':_0x10cb31,'role':_0x4062('0x20')}})[_0x4062('0x1b')](checkError());}function getAgentCheckSession(_0x28e9e4,_0xb7f7c7){return new BPromise(function(_0x5934d2,_0x5b6659){var _0x4a0312=respondWithRpcPromise('VoiceChannels');var _0x391065=getAgent(_0x28e9e4);Promise['all']([_0x4a0312,_0x391065])[_0x4062('0x1b')](function(_0x169c12){var _0x9c9fc3=_0x169c12[0x0];var _0xc1c540=_0x169c12[0x1];var _0x2ca2cd=_[_0x4062('0x21')](_0x9c9fc3[_0x4062('0x22')],function(_0x253bcf){return _0x253bcf['UserId']==_0xc1c540['id']&&_0x253bcf['sessionId']==_0xb7f7c7;});if(_0x2ca2cd['length']==0x1){_0x5934d2(_0xc1c540);}else{_0x5b6659(new RangeError(_0x4062('0x23')+_0xb7f7c7+_0x4062('0x24')));}});});}exports['originate']=function(_0x26c63a,_0x5ad1a3){logger['info']('originate\x20fired:',_0x26c63a[_0x4062('0x25')]);var _0x1792d0=originateValidation[_0x4062('0xa')](_0x26c63a[_0x4062('0x25')]);if(_0x1792d0[_0x4062('0x26')]>0x0){return _0x5ad1a3[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x1792d0);}var _0x126aab=_0x26c63a[_0x4062('0x25')][_0x4062('0x28')];var _0xf3c438=_0x26c63a[_0x4062('0x25')]['callNumber'];var _0x2a9d01=_0x26c63a['body'][_0x4062('0x29')];var _0x20068d=_0x26c63a[_0x4062('0x25')]['callbackUrl'];return getAgent(_0x126aab)[_0x4062('0x1b')](function(_0x2393e5){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x2393e5[_0x4062('0x17')]);emit(util[_0x4062('0x2b')](_0x4062('0x2c'),_0x2393e5[_0x4062('0x17')]),_0x4062('0x2d'),{'callNumber':_0xf3c438,'callerId':_0x2a9d01,'callbackUrl':_0x20068d});return _0x5ad1a3['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x2e')});})[_0x4062('0x1e')](handleError(_0x5ad1a3));};exports[_0x4062('0x2f')]=function(_0x13ee2d,_0x40d961){logger['info'](_0x4062('0x30'),_0x13ee2d[_0x4062('0x25')]);var _0x472b21=hangupValidation[_0x4062('0xa')](_0x13ee2d[_0x4062('0x25')]);if(_0x472b21['length']>0x0){return _0x40d961['status'](0x190)[_0x4062('0x27')](_0x472b21);}var _0x27fe83=_0x13ee2d['body'][_0x4062('0x28')];var _0x146463=_0x13ee2d[_0x4062('0x25')][_0x4062('0x31')];return getAgent(_0x27fe83)[_0x4062('0x1b')](function(_0x218864){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x218864[_0x4062('0x17')]);emit(util[_0x4062('0x2b')]('user:%s',_0x218864[_0x4062('0x17')]),_0x4062('0x32'),{'sessionId':_0x146463});return _0x40d961['status'](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0x4062('0x1e')](handleError(_0x40d961));};exports[_0x4062('0x33')]=function(_0x157e60,_0x43a82c){logger['info']('answer\x20fired:',_0x157e60[_0x4062('0x25')]);var _0x42d0d3=answerValidation[_0x4062('0xa')](_0x157e60[_0x4062('0x25')]);if(_0x42d0d3['length']>0x0){return _0x43a82c['status'](0x190)[_0x4062('0x27')](_0x42d0d3);}var _0x2ac3b5=_0x157e60[_0x4062('0x25')][_0x4062('0x28')];var _0x9ab8ac=_0x157e60[_0x4062('0x25')][_0x4062('0x31')];return getAgent(_0x2ac3b5)[_0x4062('0x1b')](function(_0x48d9a3){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x48d9a3[_0x4062('0x17')]);emit(util['format'](_0x4062('0x2c'),_0x48d9a3['name']),'webbar:answer',{'sessionId':_0x9ab8ac});return _0x43a82c[_0x4062('0x19')](0xc8)[_0x4062('0x27')]({'error':![],'message':'answer\x20executed!'});})[_0x4062('0x1e')](handleError(_0x43a82c));};exports[_0x4062('0x34')]=function(_0x356ae0,_0x182b7f){logger[_0x4062('0x11')]('hold\x20fired:',_0x356ae0['body']);var _0x339337=holdValidation[_0x4062('0xa')](_0x356ae0[_0x4062('0x25')]);if(_0x339337['length']>0x0){return _0x182b7f[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x339337);}var _0x58a141=_0x356ae0[_0x4062('0x25')][_0x4062('0x28')];var _0x5e1c4f=_0x356ae0['body']['sessionId'];return getAgent(_0x58a141)[_0x4062('0x1b')](function(_0x560b20){logger['info'](_0x4062('0x2a'),_0x560b20['name']);emit(util['format'](_0x4062('0x2c'),_0x560b20[_0x4062('0x17')]),_0x4062('0x35'),{'sessionId':_0x5e1c4f});return _0x182b7f['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x36')});})[_0x4062('0x1e')](handleError(_0x182b7f));};exports['unhold']=function(_0x5c75b6,_0x36b58e){logger[_0x4062('0x11')]('unhold\x20fired:',_0x5c75b6[_0x4062('0x25')]);var _0x1b9ccf=unholdValidation[_0x4062('0xa')](_0x5c75b6['body']);if(_0x1b9ccf['length']>0x0){return _0x36b58e[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x1b9ccf);}var _0x6c5253=_0x5c75b6[_0x4062('0x25')][_0x4062('0x28')];var _0x5b975f=_0x5c75b6['body'][_0x4062('0x31')];return getAgent(_0x6c5253)[_0x4062('0x1b')](function(_0x2293c4){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x2293c4[_0x4062('0x17')]);emit(util[_0x4062('0x2b')](_0x4062('0x2c'),_0x2293c4[_0x4062('0x17')]),_0x4062('0x37'),{'sessionId':_0x5b975f});return _0x36b58e[_0x4062('0x19')](0xc8)[_0x4062('0x27')]({'error':![],'message':'unhold\x20executed!'});})[_0x4062('0x1e')](handleError(_0x36b58e));};exports[_0x4062('0x38')]=function(_0x567fdb,_0x36bba8){logger[_0x4062('0x11')]('calls\x20fired:',_0x36bba8[_0x4062('0x25')]);var _0x5c76e7=callsValidation['validate'](_0x567fdb[_0x4062('0x25')]);if(_0x5c76e7[_0x4062('0x26')]>0x0){return _0x36bba8[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x5c76e7);}var _0x24ccc2=_0x567fdb['body'][_0x4062('0x28')];var _0x487e77=respondWithRpcPromise(_0x4062('0x39'));var _0x2ab230=getAgent(_0x24ccc2);return Promise['all']([_0x487e77,_0x2ab230])[_0x4062('0x1b')](function(_0x7767ab){var _0x4c0811=_0x7767ab[0x0];var _0x4fa347=_0x7767ab[0x1];var _0x4d2d75=_[_0x4062('0x21')](_0x4c0811['rows'],function(_0x5c5190){return _0x5c5190[_0x4062('0x3a')]==_0x4fa347['id'];});return _0x36bba8[_0x4062('0x19')](0xc8)[_0x4062('0x27')]({'count':_0x4d2d75[_0x4062('0x26')],'rows':_0x4d2d75});})['catch'](handleError(_0x36bba8));};exports[_0x4062('0x3b')]=function(_0x3d5e74,_0x28aec1){logger[_0x4062('0x11')](_0x4062('0x3c'),_0x3d5e74['body']);var _0x45e832=conferenceValidation[_0x4062('0xa')](_0x3d5e74[_0x4062('0x25')]);if(_0x45e832[_0x4062('0x26')]>0x0){return _0x28aec1['status'](0x190)[_0x4062('0x27')](_0x45e832);}var _0x3fcc05=_0x3d5e74['body'][_0x4062('0x28')];return getAgent(_0x3fcc05)['then'](function(_0x1a488c){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x1a488c[_0x4062('0x17')]);emit(util['format']('user:%s',_0x1a488c[_0x4062('0x17')]),_0x4062('0x3d'));return _0x28aec1['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x3e')});})[_0x4062('0x1e')](handleError(_0x28aec1));};exports[_0x4062('0x3f')]=function(_0x48bf59,_0x4d06c7){logger[_0x4062('0x11')](_0x4062('0x40'),_0x48bf59[_0x4062('0x25')]);var _0x322b0f=transferValidation['validate'](_0x48bf59[_0x4062('0x25')]);if(_0x322b0f[_0x4062('0x26')]>0x0){return _0x4d06c7[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x322b0f);}var _0x557bd4=_0x48bf59[_0x4062('0x25')][_0x4062('0x28')];var _0xdba734=_0x48bf59[_0x4062('0x25')][_0x4062('0x31')];var _0x3ee7cc=_0x48bf59[_0x4062('0x25')][_0x4062('0x41')];return getAgent(_0x557bd4)['then'](function(_0x342836){logger['info'](_0x4062('0x2a'),_0x342836[_0x4062('0x17')]);emit(util[_0x4062('0x2b')]('user:%s',_0x342836['name']),'webbar:transfer',{'sessionId':_0xdba734,'transferNumber':_0x3ee7cc});return _0x4d06c7['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x42')});})[_0x4062('0x1e')](handleError(_0x4d06c7));}; \ No newline at end of file +var _0x049e=['ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','name','status','send','request','error','message','result','catch','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','validate','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger'];(function(_0x59c51c,_0x1472ac){var _0xd79a84=function(_0x4fc6ed){while(--_0x4fc6ed){_0x59c51c['push'](_0x59c51c['shift']());}};_0xd79a84(++_0x1472ac);}(_0x049e,0x16a));var _0xe049=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x049e[_0x330723];return _0x60c546;};'use strict';var path=require(_0xe049('0x0'));var fs=require('fs');var _=require(_0xe049('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xe049('0x2'));var util=require('util');var BPromise=require(_0xe049('0x3'));var jayson=require(_0xe049('0x4'));var amiClient=jayson[_0xe049('0x5')][_0xe049('0x6')]({'port':0x232a});var logger=require(_0xe049('0x7'))('webbarapi');var Redis=require(_0xe049('0x8'));config[_0xe049('0x9')]=_[_0xe049('0xa')](config[_0xe049('0x9')],{'host':_0xe049('0xb'),'port':0x18eb});var io=require(_0xe049('0xc'))(new Redis(config[_0xe049('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'callNumber':{'type':_0xe049('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe049('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe049('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'sessionId':{'type':_0xe049('0xf'),'required':[!![],_0xe049('0x10')]},'transferNumber':{'type':_0xe049('0xf'),'required':[!![],_0xe049('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe049('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],_0xe049('0xe')]},'sessionId':{'type':_0xe049('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe049('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe049('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x388be0,_0x26b40c,_0x526d25){logger[_0xe049('0x12')](_0x388be0,_0x26b40c,JSON[_0xe049('0x13')](_0x526d25));io['to'](_0x388be0)['emit'](_0x26b40c,_0x526d25);}function handleError(_0x400a88){return function(_0x54c303){console['log'](_0xe049('0x14'),_0x54c303,_0x54c303 instanceof RangeError);logger['error'](_0x54c303['stack']);if(_0x54c303 instanceof RangeError){if(_0x54c303[_0xe049('0x15')]){delete _0x54c303[_0xe049('0x15')];}_0x400a88['status'](0x194)['send'](_0x54c303);}else{if(_0x54c303[_0xe049('0x15')]){delete _0x54c303[_0xe049('0x15')];}_0x400a88[_0xe049('0x16')](0x1f4)[_0xe049('0x17')](_0x54c303);}};}function checkError(){return function(_0x517aea){if(!_0x517aea){throw new RangeError('NotFound');}return _0x517aea;};}function respondWithRpcPromise(_0x11ceaa,_0x154fde){return new BPromise(function(_0x572a80,_0x36a03b){var _0x3f14eb=amiClient;return _0x3f14eb[_0xe049('0x18')](_0x11ceaa,_0x154fde)['then'](function(_0x197358){if(_0x197358[_0xe049('0x19')]){if(_0x197358['error']['code']===0x1f4){return _0x36a03b(_0x197358['error'][_0xe049('0x1a')]);}return _0x572a80(_0x197358['error']['message']);}else{_0x572a80(_0x197358[_0xe049('0x1b')]);}})[_0xe049('0x1c')](function(_0x53620b){_0x36a03b(_0x53620b);});});}function getAgent(_0x1f5233){return db[_0xe049('0x1d')][_0xe049('0x1e')]({'where':{'id':_0x1f5233,'role':_0xe049('0x1f')}})[_0xe049('0x20')](checkError());}function getAgentCheckSession(_0x1843b8,_0x5b0e64){return new BPromise(function(_0x50552d,_0x7f5538){var _0x542c7c=respondWithRpcPromise(_0xe049('0x21'));var _0x495d33=getAgent(_0x1843b8);Promise[_0xe049('0x22')]([_0x542c7c,_0x495d33])[_0xe049('0x20')](function(_0x5adcd6){var _0x432a6e=_0x5adcd6[0x0];var _0x364630=_0x5adcd6[0x1];var _0xb64700=_[_0xe049('0x23')](_0x432a6e[_0xe049('0x24')],function(_0x4055fc){return _0x4055fc[_0xe049('0x25')]==_0x364630['id']&&_0x4055fc[_0xe049('0x26')]==_0x5b0e64;});if(_0xb64700[_0xe049('0x27')]==0x1){_0x50552d(_0x364630);}else{_0x7f5538(new RangeError(_0xe049('0x28')+_0x5b0e64+_0xe049('0x29')));}});});}exports['originate']=function(_0x397dc3,_0x1e99c8){logger['info']('originate\x20fired:',_0x397dc3['body']);var _0x4c1499=originateValidation[_0xe049('0x2a')](_0x397dc3[_0xe049('0x2b')]);if(_0x4c1499[_0xe049('0x27')]>0x0){return _0x1e99c8[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x4c1499);}var _0x5e2a91=_0x397dc3[_0xe049('0x2b')][_0xe049('0x2d')];var _0x2fd840=_0x397dc3[_0xe049('0x2b')][_0xe049('0x2e')];var _0x493844=_0x397dc3[_0xe049('0x2b')]['callerId'];var _0x1fc008=_0x397dc3['body'][_0xe049('0x2f')];return getAgent(_0x5e2a91)[_0xe049('0x20')](function(_0x2f8834){logger[_0xe049('0x12')](_0xe049('0x30'),_0x2f8834[_0xe049('0x15')]);emit(util[_0xe049('0x31')](_0xe049('0x32'),_0x2f8834[_0xe049('0x15')]),_0xe049('0x33'),{'callNumber':_0x2fd840,'callerId':_0x493844,'callbackUrl':_0x1fc008});return _0x1e99c8[_0xe049('0x16')](0xc8)['json']({'error':![],'message':_0xe049('0x34')});})[_0xe049('0x1c')](handleError(_0x1e99c8));};exports[_0xe049('0x35')]=function(_0x2abc8d,_0x3e042e){logger[_0xe049('0x12')](_0xe049('0x36'),_0x2abc8d[_0xe049('0x2b')]);var _0x54df1a=hangupValidation[_0xe049('0x2a')](_0x2abc8d[_0xe049('0x2b')]);if(_0x54df1a[_0xe049('0x27')]>0x0){return _0x3e042e[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x54df1a);}var _0xe17673=_0x2abc8d[_0xe049('0x2b')][_0xe049('0x2d')];var _0x2a840f=_0x2abc8d[_0xe049('0x2b')]['sessionId'];return getAgent(_0xe17673)[_0xe049('0x20')](function(_0x176374){logger[_0xe049('0x12')]('entityFound:',_0x176374[_0xe049('0x15')]);emit(util['format']('user:%s',_0x176374[_0xe049('0x15')]),'webbar:hangup',{'sessionId':_0x2a840f});return _0x3e042e[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':_0xe049('0x37')});})[_0xe049('0x1c')](handleError(_0x3e042e));};exports[_0xe049('0x38')]=function(_0x587ea9,_0x4261da){logger[_0xe049('0x12')]('answer\x20fired:',_0x587ea9['body']);var _0x29915f=answerValidation[_0xe049('0x2a')](_0x587ea9[_0xe049('0x2b')]);if(_0x29915f[_0xe049('0x27')]>0x0){return _0x4261da[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x29915f);}var _0x56a309=_0x587ea9[_0xe049('0x2b')][_0xe049('0x2d')];var _0x5c04f6=_0x587ea9[_0xe049('0x2b')][_0xe049('0x26')];return getAgent(_0x56a309)[_0xe049('0x20')](function(_0x2f5258){logger[_0xe049('0x12')]('entityFound:',_0x2f5258['name']);emit(util[_0xe049('0x31')](_0xe049('0x32'),_0x2f5258[_0xe049('0x15')]),_0xe049('0x39'),{'sessionId':_0x5c04f6});return _0x4261da[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xe049('0x1c')](handleError(_0x4261da));};exports[_0xe049('0x3a')]=function(_0x5dadbf,_0x374ce2){logger['info'](_0xe049('0x3b'),_0x5dadbf['body']);var _0x1112bf=holdValidation['validate'](_0x5dadbf[_0xe049('0x2b')]);if(_0x1112bf[_0xe049('0x27')]>0x0){return _0x374ce2[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x1112bf);}var _0x22eeb1=_0x5dadbf['body'][_0xe049('0x2d')];var _0x2310ff=_0x5dadbf[_0xe049('0x2b')][_0xe049('0x26')];return getAgent(_0x22eeb1)[_0xe049('0x20')](function(_0x3c15a2){logger[_0xe049('0x12')](_0xe049('0x30'),_0x3c15a2[_0xe049('0x15')]);emit(util['format']('user:%s',_0x3c15a2[_0xe049('0x15')]),_0xe049('0x3c'),{'sessionId':_0x2310ff});return _0x374ce2[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':_0xe049('0x3d')});})[_0xe049('0x1c')](handleError(_0x374ce2));};exports[_0xe049('0x3e')]=function(_0x2e4dce,_0x23692f){logger[_0xe049('0x12')](_0xe049('0x3f'),_0x2e4dce['body']);var _0x36346a=unholdValidation[_0xe049('0x2a')](_0x2e4dce[_0xe049('0x2b')]);if(_0x36346a[_0xe049('0x27')]>0x0){return _0x23692f[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x36346a);}var _0x373a49=_0x2e4dce['body']['userId'];var _0x57b3ff=_0x2e4dce[_0xe049('0x2b')][_0xe049('0x26')];return getAgent(_0x373a49)['then'](function(_0x2e361b){logger[_0xe049('0x12')](_0xe049('0x30'),_0x2e361b[_0xe049('0x15')]);emit(util['format']('user:%s',_0x2e361b[_0xe049('0x15')]),_0xe049('0x40'),{'sessionId':_0x57b3ff});return _0x23692f['status'](0xc8)['json']({'error':![],'message':_0xe049('0x41')});})['catch'](handleError(_0x23692f));};exports[_0xe049('0x42')]=function(_0x2a1e06,_0x567c52){logger[_0xe049('0x12')]('calls\x20fired:',_0x567c52[_0xe049('0x2b')]);var _0x3ec963=callsValidation['validate'](_0x2a1e06[_0xe049('0x2b')]);if(_0x3ec963[_0xe049('0x27')]>0x0){return _0x567c52[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x3ec963);}var _0x421d54=_0x2a1e06[_0xe049('0x2b')][_0xe049('0x2d')];var _0x1be891=respondWithRpcPromise(_0xe049('0x21'));var _0x35f367=getAgent(_0x421d54);return Promise['all']([_0x1be891,_0x35f367])[_0xe049('0x20')](function(_0x47390a){var _0xa2a8e4=_0x47390a[0x0];var _0x4d2b67=_0x47390a[0x1];var _0x1434eb=_[_0xe049('0x23')](_0xa2a8e4[_0xe049('0x24')],function(_0x156f71){return _0x156f71[_0xe049('0x25')]==_0x4d2b67['id'];});return _0x567c52[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'count':_0x1434eb['length'],'rows':_0x1434eb});})[_0xe049('0x1c')](handleError(_0x567c52));};exports['conference']=function(_0x440b63,_0x51f90a){logger[_0xe049('0x12')](_0xe049('0x43'),_0x440b63[_0xe049('0x2b')]);var _0x3646e9=conferenceValidation[_0xe049('0x2a')](_0x440b63['body']);if(_0x3646e9[_0xe049('0x27')]>0x0){return _0x51f90a[_0xe049('0x16')](0x190)[_0xe049('0x2c')](_0x3646e9);}var _0xad43b0=_0x440b63[_0xe049('0x2b')][_0xe049('0x2d')];return getAgent(_0xad43b0)[_0xe049('0x20')](function(_0x2e4e9f){logger['info']('entityFound:',_0x2e4e9f[_0xe049('0x15')]);emit(util[_0xe049('0x31')]('user:%s',_0x2e4e9f[_0xe049('0x15')]),_0xe049('0x44'));return _0x51f90a[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x51f90a));};exports[_0xe049('0x45')]=function(_0x57290e,_0x4386c5){logger[_0xe049('0x12')](_0xe049('0x46'),_0x57290e[_0xe049('0x2b')]);var _0x1ffabc=transferValidation[_0xe049('0x2a')](_0x57290e[_0xe049('0x2b')]);if(_0x1ffabc[_0xe049('0x27')]>0x0){return _0x4386c5['status'](0x190)[_0xe049('0x2c')](_0x1ffabc);}var _0x371b78=_0x57290e[_0xe049('0x2b')][_0xe049('0x2d')];var _0x3b002e=_0x57290e['body'][_0xe049('0x26')];var _0x236f0b=_0x57290e[_0xe049('0x2b')][_0xe049('0x47')];return getAgent(_0x371b78)['then'](function(_0x5511ac){logger[_0xe049('0x12')](_0xe049('0x30'),_0x5511ac[_0xe049('0x15')]);emit(util[_0xe049('0x31')](_0xe049('0x32'),_0x5511ac[_0xe049('0x15')]),_0xe049('0x48'),{'sessionId':_0x3b002e,'transferNumber':_0x236f0b});return _0x4386c5[_0xe049('0x16')](0xc8)[_0xe049('0x2c')]({'error':![],'message':_0xe049('0x49')});})[_0xe049('0x1c')](handleError(_0x4386c5));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index b3d9d77..6471550 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 _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','post','/:id/canned_answers','/:id/users','addAgents','/:id/notify','notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x54447d,_0x22b5de){var _0x2b65a0=function(_0x37dc38){while(--_0x37dc38){_0x54447d['push'](_0x54447d['shift']());}};_0x2b65a0(++_0x22b5de);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5af6ad,_0x5b7bf8){_0x5af6ad=_0x5af6ad-0x0;var _0x1313e8=_0x9f0e[_0x5af6ad];return _0x1313e8;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x9')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x9')]('/:id/canned_answers',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x10')]);router[_0xe9f0('0x9')]('/:id/users',auth[_0xe9f0('0xb')](),controller['getAgents']);router[_0xe9f0('0x9')](_0xe9f0('0x11'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x12')]);router['post']('/',auth[_0xe9f0('0xb')](),controller['create']);router[_0xe9f0('0x13')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller['addDisposition']);router[_0xe9f0('0x13')](_0xe9f0('0x14'),auth[_0xe9f0('0xb')](),controller['addAnswer']);router[_0xe9f0('0x13')](_0xe9f0('0x15'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x16')]);router[_0xe9f0('0x13')](_0xe9f0('0x11'),auth[_0xe9f0('0xb')](),controller['addApplications']);router[_0xe9f0('0x13')](_0xe9f0('0x17'),controller[_0xe9f0('0x18')]);router['post'](_0xe9f0('0x19'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1a')]);router[_0xe9f0('0x1b')]('/:id',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe9f0('0x1d')]);router[_0xe9f0('0x1e')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x1f')]);router['delete'](_0xe9f0('0x14'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x20')]);router[_0xe9f0('0x1e')](_0xe9f0('0x15'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x21')]);module[_0xe9f0('0x22')]=router; \ No newline at end of file +var _0x9582=['destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','/:id/notify','/:id/send','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9582,0x95));var _0x2958=function(_0x47c5e6,_0x5b1c19){_0x47c5e6=_0x47c5e6-0x0;var _0x4cf794=_0x9582[_0x47c5e6];return _0x4cf794;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0xa')](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x18')]('/',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2958('0x1a')]);router[_0x2958('0x18')]('/:id/canned_answers',auth[_0x2958('0xb')](),controller['addAnswer']);router['post'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller['addAgents']);router['post'](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x18')](_0x2958('0x1c'),controller['notify']);router[_0x2958('0x18')](_0x2958('0x1d'),auth[_0x2958('0xb')](),controller['send']);router[_0x2958('0x1e')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller[_0x2958('0x1f')]);router[_0x2958('0x20')](_0x2958('0x10'),auth[_0x2958('0xb')](),controller[_0x2958('0x21')]);router[_0x2958('0x20')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x22')]);router[_0x2958('0x20')](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 5723156..8004bf2 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 _0xab2f=['STRING','name','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition'];(function(_0x4e6406,_0x50a51d){var _0x4e6e0e=function(_0x3e83a1){while(--_0x3e83a1){_0x4e6406['push'](_0x4e6406['shift']());}};_0x4e6e0e(++_0x50a51d);}(_0xab2f,0xa2));var _0xfab2=function(_0x479847,_0x1c9bb5){_0x479847=_0x479847-0x0;var _0x12b3f6=_0xab2f[_0x479847];return _0x12b3f6;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xfab2('0x0')],'unique':_0xfab2('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xfab2('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0xfab2('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0xfab2('0x0')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xfab2('0x0')]},'type':{'type':Sequelize['ENUM']('twilio',_0xfab2('0x2'))},'accountSid':{'type':Sequelize[_0xfab2('0x0')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xfab2('0x0')]},'notificationTemplate':{'type':Sequelize[_0xfab2('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfab2('0x4')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xfab2('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfab2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfab2('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfab2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfab2('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfab2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfab2('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xfab2('0x4')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d16cd){if(!_0x3d16cd){this[_0xfab2('0x7')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0xfab2('0x8'),_0x3d16cd);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5ddf=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM'];(function(_0x44073b,_0x53116c){var _0x3757d4=function(_0x1a7263){while(--_0x1a7263){_0x44073b['push'](_0x44073b['shift']());}};_0x3757d4(++_0x53116c);}(_0x5ddf,0x6a));var _0xf5dd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5ddf[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xf5dd('0x0'));var rs=require(_0xf5dd('0x1'));module[_0xf5dd('0x2')]={'name':{'type':Sequelize[_0xf5dd('0x3')],'unique':_0xf5dd('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xf5dd('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xf5dd('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xf5dd('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xf5dd('0x3')]},'type':{'type':Sequelize[_0xf5dd('0x5')]('twilio',_0xf5dd('0x6'))},'accountSid':{'type':Sequelize[_0xf5dd('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xf5dd('0x3')]},'notificationTemplate':{'type':Sequelize[_0xf5dd('0x7')],'defaultValue':function(){return _0xf5dd('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xf5dd('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf5dd('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf5dd('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf5dd('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xf5dd('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf5dd('0xc'),'set':function(_0x45f909){if(!_0x45f909){this[_0xf5dd('0xd')](_0xf5dd('0xe'),null);}this[_0xf5dd('0xd')](_0xf5dd('0xf'),_0x45f909);}},'description':{'type':Sequelize[_0xf5dd('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 9313bb4..8774696 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 _0x6bb7=['Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','update','get','WhatsappAccounts','destroy','stack','send','mandatoryDispositionPause','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','options','WhatsappAccount','includeAll','findAll','show','Pause','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','Body','MessageSid','notifications','messageId','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','WhatsappInteraction','spread','interaction','autoclose','applications','push','close','unmanaged','created','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x6bb7,0x18b));var _0x76bb=function(_0x4217f9,_0x468c28){_0x4217f9=_0x4217f9-0x0;var _0x462a7c=_0x6bb7[_0x4217f9];return _0x462a7c;};'use strict';var emlformat=require(_0x76bb('0x0'));var rimraf=require(_0x76bb('0x1'));var zipdir=require(_0x76bb('0x2'));var jsonpatch=require(_0x76bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x76bb('0x4'));var Mustache=require(_0x76bb('0x5'));var util=require(_0x76bb('0x6'));var path=require(_0x76bb('0x7'));var sox=require('sox');var csv=require(_0x76bb('0x8'));var ejs=require(_0x76bb('0x9'));var fs=require('fs');var fs_extra=require(_0x76bb('0xa'));var _=require(_0x76bb('0xb'));var squel=require('squel');var crypto=require(_0x76bb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76bb('0x8'));var querystring=require('querystring');var Papa=require(_0x76bb('0xd'));var Redis=require(_0x76bb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x76bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76bb('0x10'));var logger=require(_0x76bb('0x11'))('api');var utils=require(_0x76bb('0x12'));var config=require(_0x76bb('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x76bb('0x14'))['db'];config[_0x76bb('0x15')]=_[_0x76bb('0x16')](config[_0x76bb('0x15')],{'host':_0x76bb('0x17'),'port':0x18eb});var socket=require(_0x76bb('0x18'))(new Redis(config[_0x76bb('0x15')]));require('./whatsappAccount.socket')[_0x76bb('0x19')](socket);var jayson=require(_0x76bb('0x1a'));var client=jayson[_0x76bb('0x1b')][_0x76bb('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x1c6912,_0x135499,_0x2fc0ba,_0xc2da13){return new BPromise(function(_0x3986fb,_0x1e94d4){var _0x27c754=_0xc2da13||client;return _0x27c754[_0x76bb('0x1d')](_0x1c6912,_0x2fc0ba)[_0x76bb('0x1e')](function(_0x1bcab8){logger[_0x76bb('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x135499,'request\x20sent');logger[_0x76bb('0x20')](_0x76bb('0x21'),_0x135499,_0x76bb('0x22'),JSON[_0x76bb('0x23')](_0x1bcab8));if(_0x1bcab8[_0x76bb('0x24')]){if(_0x1bcab8['error'][_0x76bb('0x25')]===0x1f4){logger[_0x76bb('0x24')](_0x76bb('0x26'),_0x135499,_0x1bcab8[_0x76bb('0x24')][_0x76bb('0x27')]);return _0x1e94d4(_0x1bcab8[_0x76bb('0x24')][_0x76bb('0x27')]);}logger[_0x76bb('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x135499,_0x1bcab8[_0x76bb('0x24')]['message']);return _0x3986fb(_0x1bcab8[_0x76bb('0x24')][_0x76bb('0x27')]);}else{logger[_0x76bb('0x1f')](_0x76bb('0x26'),_0x135499,_0x76bb('0x22'));_0x3986fb(_0x1bcab8[_0x76bb('0x28')][_0x76bb('0x27')]);}})[_0x76bb('0x29')](function(_0x3d6dd4){logger[_0x76bb('0x24')](_0x76bb('0x26'),_0x135499,_0x3d6dd4);_0x1e94d4(_0x3d6dd4);});});}function respondWithStatusCode(_0x37bd39,_0x2a9f62){_0x2a9f62=_0x2a9f62||0xcc;return function(_0x43f58a){if(_0x43f58a){return _0x37bd39[_0x76bb('0x2a')](_0x2a9f62);}return _0x37bd39[_0x76bb('0x2b')](_0x2a9f62)[_0x76bb('0x2c')]();};}function respondWithResult(_0x3c77f7,_0x2a7578){_0x2a7578=_0x2a7578||0xc8;return function(_0x9a8324){if(_0x9a8324){return _0x3c77f7[_0x76bb('0x2b')](_0x2a7578)[_0x76bb('0x2d')](_0x9a8324);}};}function respondWithFilteredResult(_0x4d5054,_0x10a2c1){return function(_0x45b749){if(_0x45b749){var _0x215e37=typeof _0x10a2c1['offset']===_0x76bb('0x2e')&&typeof _0x10a2c1[_0x76bb('0x2f')]==='undefined';var _0xa80277=_0x45b749['count'];var _0x18707a=_0x215e37?0x0:_0x10a2c1[_0x76bb('0x30')];var _0x20ab87=_0x215e37?_0x45b749[_0x76bb('0x31')]:_0x10a2c1['offset']+_0x10a2c1['limit'];var _0x54cba4;if(_0x20ab87>=_0xa80277){_0x20ab87=_0xa80277;_0x54cba4=0xc8;}else{_0x54cba4=0xce;}_0x4d5054[_0x76bb('0x2b')](_0x54cba4);return _0x4d5054[_0x76bb('0x32')]('Content-Range',_0x18707a+'-'+_0x20ab87+'/'+_0xa80277)[_0x76bb('0x2d')](_0x45b749);}return null;};}function patchUpdates(_0xd97c3b){return function(_0x59b86a){try{jsonpatch[_0x76bb('0x33')](_0x59b86a,_0xd97c3b,!![]);}catch(_0xc57c00){return BPromise[_0x76bb('0x34')](_0xc57c00);}return _0x59b86a['save']();};}function saveUpdates(_0x330218,_0x1de1ae){return function(_0x1ac5c6){if(_0x1ac5c6){return _0x1ac5c6[_0x76bb('0x35')](_0x330218)[_0x76bb('0x1e')](function(_0x29fce5){return _0x29fce5;});}return null;};}function removeEntity(_0x5a2796,_0x2de995){return function(_0x30350f){if(_0x30350f){return _0x30350f['destroy']()[_0x76bb('0x1e')](function(){var _0xa6d7d4=_0x30350f[_0x76bb('0x36')]({'plain':!![]});var _0xf9b247=_0x76bb('0x37');return db['UserProfileResource'][_0x76bb('0x38')]({'where':{'type':_0xf9b247,'resourceId':_0xa6d7d4['id']}})[_0x76bb('0x1e')](function(){return _0x30350f;});})[_0x76bb('0x1e')](function(){_0x5a2796['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x72ace5,_0x43cc1c){return function(_0x56e1e5){if(!_0x56e1e5){_0x72ace5['sendStatus'](0x194);}return _0x56e1e5;};}function handleError(_0x30a10f,_0x2ff07a){_0x2ff07a=_0x2ff07a||0x1f4;return function(_0x554822){logger['error'](_0x554822[_0x76bb('0x39')]);if(_0x554822['name']){delete _0x554822['name'];}_0x30a10f['status'](_0x2ff07a)[_0x76bb('0x3a')](_0x554822);};}exports['index']=function(_0x4aa5dd,_0x417db4){var _0x98af7f={'include':[{'model':db['Pause'],'as':_0x76bb('0x3b')}]},_0x234858={},_0x5c839b={'count':0x0,'rows':[]};var _0x495f76=_[_0x76bb('0x3c')](db['WhatsappAccount'][_0x76bb('0x3d')],function(_0x21c311){return{'name':_0x21c311['fieldName'],'type':_0x21c311[_0x76bb('0x3e')]['key']};});_0x234858[_0x76bb('0x3f')]=_[_0x76bb('0x3c')](_0x495f76,'name');_0x234858['query']=_[_0x76bb('0x40')](_0x4aa5dd[_0x76bb('0x41')]);_0x234858[_0x76bb('0x42')]=_[_0x76bb('0x43')](_0x234858[_0x76bb('0x3f')],_0x234858['query']);_0x98af7f[_0x76bb('0x44')]=_[_0x76bb('0x43')](_0x234858['model'],qs[_0x76bb('0x45')](_0x4aa5dd[_0x76bb('0x41')][_0x76bb('0x45')]));_0x98af7f[_0x76bb('0x44')]=_0x98af7f[_0x76bb('0x44')][_0x76bb('0x46')]?_0x98af7f[_0x76bb('0x44')]:_0x234858['model'];if(!_0x4aa5dd[_0x76bb('0x41')]['hasOwnProperty']('nolimit')){_0x98af7f['limit']=qs[_0x76bb('0x2f')](_0x4aa5dd['query'][_0x76bb('0x2f')]);_0x98af7f[_0x76bb('0x30')]=qs[_0x76bb('0x30')](_0x4aa5dd[_0x76bb('0x41')]['offset']);}_0x98af7f[_0x76bb('0x47')]=qs['sort'](_0x4aa5dd['query'][_0x76bb('0x48')]);_0x98af7f['where']=qs['filters'](_[_0x76bb('0x49')](_0x4aa5dd[_0x76bb('0x41')],_0x234858[_0x76bb('0x42')]),_0x495f76);if(_0x4aa5dd[_0x76bb('0x41')]['filter']){_0x98af7f[_0x76bb('0x4a')]=_[_0x76bb('0x4b')](_0x98af7f[_0x76bb('0x4a')],{'$or':_[_0x76bb('0x3c')](_0x495f76,function(_0x1d318b){if(_0x1d318b[_0x76bb('0x3e')]!==_0x76bb('0x4c')){var _0x512832={};_0x512832[_0x1d318b['name']]={'$like':'%'+_0x4aa5dd['query'][_0x76bb('0x4d')]+'%'};return _0x512832;}})});}_0x98af7f=_[_0x76bb('0x4b')]({},_0x98af7f,_0x4aa5dd[_0x76bb('0x4e')]);var _0x5532d2={'where':_0x98af7f[_0x76bb('0x4a')]};return db[_0x76bb('0x4f')]['count'](_0x5532d2)[_0x76bb('0x1e')](function(_0x122033){_0x5c839b['count']=_0x122033;if(_0x4aa5dd[_0x76bb('0x41')][_0x76bb('0x50')]){_0x98af7f['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x76bb('0x51')](_0x98af7f);})[_0x76bb('0x1e')](function(_0x102c9b){_0x5c839b['rows']=_0x102c9b;return _0x5c839b;})[_0x76bb('0x1e')](respondWithFilteredResult(_0x417db4,_0x98af7f))[_0x76bb('0x29')](handleError(_0x417db4,null));};exports[_0x76bb('0x52')]=function(_0x42c4e4,_0x325d87){var _0x10c717={'raw':![],'where':{'id':_0x42c4e4['params']['id']},'include':[{'model':db[_0x76bb('0x53')],'as':_0x76bb('0x3b')}]},_0x505754={};_0x505754[_0x76bb('0x3f')]=_[_0x76bb('0x40')](db[_0x76bb('0x4f')][_0x76bb('0x3d')]);_0x505754[_0x76bb('0x41')]=_['keys'](_0x42c4e4['query']);_0x505754[_0x76bb('0x42')]=_[_0x76bb('0x43')](_0x505754[_0x76bb('0x3f')],_0x505754[_0x76bb('0x41')]);_0x10c717['attributes']=_[_0x76bb('0x43')](_0x505754[_0x76bb('0x3f')],qs[_0x76bb('0x45')](_0x42c4e4[_0x76bb('0x41')][_0x76bb('0x45')]));_0x10c717[_0x76bb('0x44')]=_0x10c717[_0x76bb('0x44')][_0x76bb('0x46')]?_0x10c717[_0x76bb('0x44')]:_0x505754[_0x76bb('0x3f')];if(_0x42c4e4[_0x76bb('0x41')][_0x76bb('0x50')]){_0x10c717[_0x76bb('0x54')]=[{'all':!![]}];}_0x10c717=_[_0x76bb('0x4b')]({},_0x10c717,_0x42c4e4[_0x76bb('0x4e')]);return db['WhatsappAccount'][_0x76bb('0x55')](_0x10c717)[_0x76bb('0x1e')](handleEntityNotFound(_0x325d87,null))[_0x76bb('0x1e')](respondWithResult(_0x325d87,null))[_0x76bb('0x29')](handleError(_0x325d87,null));};exports[_0x76bb('0x56')]=function(_0x4cb7f9,_0x5d0fb3){return db[_0x76bb('0x4f')][_0x76bb('0x56')](_0x4cb7f9[_0x76bb('0x57')],{})[_0x76bb('0x1e')](function(_0x2d1d40){var _0x14174e=_0x4cb7f9['user']['get']({'plain':!![]});if(!_0x14174e)throw new Error(_0x76bb('0x58'));if(_0x14174e[_0x76bb('0x59')]===_0x76bb('0x5a')){var _0x116b80=_0x2d1d40[_0x76bb('0x36')]({'plain':!![]});var _0x1a5ae1=_0x76bb('0x37');return db['UserProfileSection'][_0x76bb('0x55')]({'where':{'name':_0x1a5ae1,'userProfileId':_0x14174e[_0x76bb('0x5b')]},'raw':!![]})[_0x76bb('0x1e')](function(_0x58facb){if(_0x58facb&&_0x58facb[_0x76bb('0x5c')]===0x0){return db[_0x76bb('0x5d')][_0x76bb('0x56')]({'name':_0x116b80[_0x76bb('0x5e')],'resourceId':_0x116b80['id'],'type':_0x58facb[_0x76bb('0x5e')],'sectionId':_0x58facb['id']},{})[_0x76bb('0x1e')](function(){return _0x2d1d40;});}else{return _0x2d1d40;}})['catch'](function(_0x461a4a){logger[_0x76bb('0x24')](_0x76bb('0x5f'),_0x461a4a);throw _0x461a4a;});}return _0x2d1d40;})[_0x76bb('0x1e')](respondWithResult(_0x5d0fb3,0xc9))[_0x76bb('0x29')](handleError(_0x5d0fb3,null));};exports['update']=function(_0x40243d,_0x10564b){if(_0x40243d[_0x76bb('0x57')]['id']){delete _0x40243d[_0x76bb('0x57')]['id'];}return db[_0x76bb('0x4f')][_0x76bb('0x55')]({'where':{'id':_0x40243d[_0x76bb('0x60')]['id']},'include':[{'model':db[_0x76bb('0x53')],'as':'mandatoryDispositionPause'}]})[_0x76bb('0x1e')](handleEntityNotFound(_0x10564b,null))[_0x76bb('0x1e')](saveUpdates(_0x40243d[_0x76bb('0x57')],null))[_0x76bb('0x1e')](respondWithResult(_0x10564b,null))['catch'](handleError(_0x10564b,null));};exports['destroy']=function(_0x28365b,_0x23ba12){return db['WhatsappAccount'][_0x76bb('0x55')]({'where':{'id':_0x28365b['params']['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x23ba12,null))[_0x76bb('0x1e')](removeEntity(_0x23ba12,null))[_0x76bb('0x29')](handleError(_0x23ba12,null));};exports[_0x76bb('0x61')]=function(_0x5084e6,_0x258ba7){return db[_0x76bb('0x4f')]['describe']()['then'](respondWithResult(_0x258ba7,null))[_0x76bb('0x29')](handleError(_0x258ba7,null));};exports[_0x76bb('0x62')]=function(_0x1086b1,_0x327fe2,_0xf610e1){if(_0x1086b1[_0x76bb('0x57')]['id']){delete _0x1086b1[_0x76bb('0x57')]['id'];}return db[_0x76bb('0x4f')][_0x76bb('0x55')]({'where':{'id':_0x1086b1['params']['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x327fe2,null))[_0x76bb('0x1e')](function(_0x222ae7){if(_0x222ae7){_0x1086b1[_0x76bb('0x57')][_0x76bb('0x63')]=_0x222ae7['id'];return db[_0x76bb('0x64')]['create'](_0x1086b1[_0x76bb('0x57')]);}})[_0x76bb('0x1e')](respondWithResult(_0x327fe2,null))['catch'](handleError(_0x327fe2,null));};exports[_0x76bb('0x65')]=function(_0x2bb8f4,_0x2d68c0,_0x208ac4){var _0x4ae1e0={'raw':![],'where':{}};var _0x38485e={};var _0x1735b3={'count':0x0,'rows':[]};return db[_0x76bb('0x4f')][_0x76bb('0x66')]({'where':{'id':_0x2bb8f4['params']['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x2d68c0,null))['then'](function(_0x522a04){if(_0x522a04){_0x38485e[_0x76bb('0x3f')]=_[_0x76bb('0x40')](db[_0x76bb('0x64')][_0x76bb('0x3d')]);_0x38485e[_0x76bb('0x41')]=_[_0x76bb('0x40')](_0x2bb8f4[_0x76bb('0x41')]);_0x38485e[_0x76bb('0x42')]=_[_0x76bb('0x43')](_0x38485e['model'],_0x38485e[_0x76bb('0x41')]);_0x4ae1e0[_0x76bb('0x44')]=_[_0x76bb('0x43')](_0x38485e[_0x76bb('0x3f')],qs['fields'](_0x2bb8f4['query'][_0x76bb('0x45')]));_0x4ae1e0['attributes']=_0x4ae1e0[_0x76bb('0x44')][_0x76bb('0x46')]?_0x4ae1e0[_0x76bb('0x44')]:_0x38485e[_0x76bb('0x3f')];if(!_0x2bb8f4[_0x76bb('0x41')][_0x76bb('0x67')](_0x76bb('0x68'))){_0x4ae1e0[_0x76bb('0x2f')]=qs[_0x76bb('0x2f')](_0x2bb8f4[_0x76bb('0x41')][_0x76bb('0x2f')]);_0x4ae1e0[_0x76bb('0x30')]=qs[_0x76bb('0x30')](_0x2bb8f4[_0x76bb('0x41')][_0x76bb('0x30')]);}_0x4ae1e0[_0x76bb('0x47')]=qs[_0x76bb('0x48')](_0x2bb8f4[_0x76bb('0x41')][_0x76bb('0x48')]);_0x4ae1e0['where']=qs[_0x76bb('0x42')](_[_0x76bb('0x49')](_0x2bb8f4[_0x76bb('0x41')],_0x38485e[_0x76bb('0x42')]));_0x4ae1e0['where']['WhatsappAccountId']=_0x522a04['id'];if(_0x2bb8f4['query'][_0x76bb('0x4d')]){_0x4ae1e0[_0x76bb('0x4a')]=_[_0x76bb('0x4b')](_0x4ae1e0['where'],{'$or':_[_0x76bb('0x3c')](_0x4ae1e0['attributes'],function(_0x4abe89){var _0x199239={};_0x199239[_0x4abe89]={'$like':'%'+_0x2bb8f4[_0x76bb('0x41')][_0x76bb('0x4d')]+'%'};return _0x199239;})});}_0x4ae1e0=_['merge']({},_0x4ae1e0,_0x2bb8f4[_0x76bb('0x4e')]);return db['Disposition'][_0x76bb('0x31')]({'where':_0x4ae1e0[_0x76bb('0x4a')]})[_0x76bb('0x1e')](function(_0x544ec9){_0x1735b3[_0x76bb('0x31')]=_0x544ec9;if(_0x2bb8f4[_0x76bb('0x41')][_0x76bb('0x50')]){_0x4ae1e0[_0x76bb('0x54')]=[{'all':!![]}];}return db[_0x76bb('0x64')][_0x76bb('0x51')](_0x4ae1e0);})[_0x76bb('0x1e')](function(_0x13b344){_0x1735b3[_0x76bb('0x69')]=_0x13b344;return _0x1735b3;});}})[_0x76bb('0x1e')](respondWithFilteredResult(_0x2d68c0,_0x4ae1e0))[_0x76bb('0x29')](handleError(_0x2d68c0,null));};exports[_0x76bb('0x6a')]=function(_0x448f8a,_0x4041b7,_0x5ce0e2){return db[_0x76bb('0x4f')]['find']({'where':{'id':_0x448f8a['params']['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x4041b7,null))[_0x76bb('0x1e')](function(_0x4a0e05){if(_0x4a0e05){return _0x4a0e05[_0x76bb('0x6a')](_0x448f8a[_0x76bb('0x41')][_0x76bb('0x6b')]);}})[_0x76bb('0x1e')](respondWithStatusCode(_0x4041b7,null))['catch'](handleError(_0x4041b7,null));};exports[_0x76bb('0x6c')]=function(_0xfe0891,_0x39b099,_0x22a8a0){if(_0xfe0891[_0x76bb('0x57')]['id']){delete _0xfe0891[_0x76bb('0x57')]['id'];}return db[_0x76bb('0x4f')][_0x76bb('0x55')]({'where':{'id':_0xfe0891[_0x76bb('0x60')]['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x39b099,null))[_0x76bb('0x1e')](function(_0x3adf99){if(_0x3adf99){_0xfe0891[_0x76bb('0x57')][_0x76bb('0x63')]=_0x3adf99['id'];return db[_0x76bb('0x6d')]['create'](_0xfe0891[_0x76bb('0x57')]);}})['then'](respondWithResult(_0x39b099,null))[_0x76bb('0x29')](handleError(_0x39b099,null));};exports[_0x76bb('0x6e')]=function(_0x14710a,_0x1f1b5a,_0x1c1877){var _0x5e17d5={'raw':![],'where':{}};var _0x53087d={};var _0x2f65dc={'count':0x0,'rows':[]};return db[_0x76bb('0x4f')][_0x76bb('0x66')]({'where':{'id':_0x14710a[_0x76bb('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f1b5a,null))[_0x76bb('0x1e')](function(_0x4679bc){if(_0x4679bc){_0x53087d[_0x76bb('0x3f')]=_['keys'](db[_0x76bb('0x6d')]['rawAttributes']);_0x53087d[_0x76bb('0x41')]=_['keys'](_0x14710a['query']);_0x53087d[_0x76bb('0x42')]=_[_0x76bb('0x43')](_0x53087d[_0x76bb('0x3f')],_0x53087d[_0x76bb('0x41')]);_0x5e17d5[_0x76bb('0x44')]=_[_0x76bb('0x43')](_0x53087d[_0x76bb('0x3f')],qs['fields'](_0x14710a[_0x76bb('0x41')][_0x76bb('0x45')]));_0x5e17d5[_0x76bb('0x44')]=_0x5e17d5[_0x76bb('0x44')]['length']?_0x5e17d5['attributes']:_0x53087d[_0x76bb('0x3f')];if(!_0x14710a[_0x76bb('0x41')][_0x76bb('0x67')](_0x76bb('0x68'))){_0x5e17d5['limit']=qs[_0x76bb('0x2f')](_0x14710a[_0x76bb('0x41')][_0x76bb('0x2f')]);_0x5e17d5[_0x76bb('0x30')]=qs[_0x76bb('0x30')](_0x14710a['query'][_0x76bb('0x30')]);}_0x5e17d5[_0x76bb('0x47')]=qs[_0x76bb('0x48')](_0x14710a[_0x76bb('0x41')]['sort']);_0x5e17d5['where']=qs[_0x76bb('0x42')](_['pick'](_0x14710a[_0x76bb('0x41')],_0x53087d['filters']));_0x5e17d5[_0x76bb('0x4a')][_0x76bb('0x63')]=_0x4679bc['id'];if(_0x14710a[_0x76bb('0x41')][_0x76bb('0x4d')]){_0x5e17d5[_0x76bb('0x4a')]=_['merge'](_0x5e17d5['where'],{'$or':_[_0x76bb('0x3c')](_0x5e17d5[_0x76bb('0x44')],function(_0x2da364){var _0x4f4c43={};_0x4f4c43[_0x2da364]={'$like':'%'+_0x14710a[_0x76bb('0x41')][_0x76bb('0x4d')]+'%'};return _0x4f4c43;})});}_0x5e17d5=_['merge']({},_0x5e17d5,_0x14710a[_0x76bb('0x4e')]);return db['CannedAnswer'][_0x76bb('0x31')]({'where':_0x5e17d5['where']})[_0x76bb('0x1e')](function(_0x8fd17c){_0x2f65dc['count']=_0x8fd17c;if(_0x14710a['query'][_0x76bb('0x50')]){_0x5e17d5['include']=[{'all':!![]}];}return db[_0x76bb('0x6d')][_0x76bb('0x51')](_0x5e17d5);})[_0x76bb('0x1e')](function(_0x4e240c){_0x2f65dc['rows']=_0x4e240c;return _0x2f65dc;});}})[_0x76bb('0x1e')](respondWithFilteredResult(_0x1f1b5a,_0x5e17d5))['catch'](handleError(_0x1f1b5a,null));};exports[_0x76bb('0x6f')]=function(_0x5ab28d,_0x361ced,_0x2a8ecf){return db[_0x76bb('0x4f')][_0x76bb('0x55')]({'where':{'id':_0x5ab28d['params']['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x361ced,null))['then'](function(_0x440f0b){if(_0x440f0b){return _0x440f0b[_0x76bb('0x6f')](_0x5ab28d[_0x76bb('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x361ced,null))['catch'](handleError(_0x361ced,null));};exports['addAgents']=function(_0x341cc1,_0x40fe4d,_0x2532a1){return db[_0x76bb('0x4f')][_0x76bb('0x55')]({'where':{'id':_0x341cc1[_0x76bb('0x60')]['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x40fe4d,null))[_0x76bb('0x1e')](function(_0x1b30d7){if(_0x1b30d7){return _0x1b30d7[_0x76bb('0x70')](_0x341cc1['body'][_0x76bb('0x6b')],_[_0x76bb('0x71')](_0x341cc1['body'],['ids','id'])||{})['spread'](function(_0x4a5620){for(var _0x559319=0x0;_0x559319<_0x341cc1['body']['ids'][_0x76bb('0x46')];_0x559319+=0x1){socket[_0x76bb('0x72')]('userWhatsappAccount:save',{'UserId':Number(_0x341cc1['body']['ids'][_0x559319]),'WhatsappAccountId':Number(_0x341cc1[_0x76bb('0x60')]['id'])});}return _0x4a5620;});}})[_0x76bb('0x1e')](respondWithResult(_0x40fe4d,null))[_0x76bb('0x29')](handleError(_0x40fe4d,null));};exports[_0x76bb('0x73')]=function(_0x109429,_0x37f3cb,_0x45f8f3){return db['WhatsappAccount'][_0x76bb('0x55')]({'where':{'id':_0x109429['params']['id']}})['then'](handleEntityNotFound(_0x37f3cb,null))[_0x76bb('0x1e')](function(_0x5b01c2){if(_0x5b01c2){return _0x5b01c2[_0x76bb('0x73')](_0x109429[_0x76bb('0x41')][_0x76bb('0x6b')])['then'](function(){if(_[_0x76bb('0x74')](_0x109429[_0x76bb('0x41')][_0x76bb('0x6b')])){for(var _0x2fbd4f=0x0;_0x2fbd4f<_0x109429['query'][_0x76bb('0x6b')][_0x76bb('0x46')];_0x2fbd4f+=0x1){socket[_0x76bb('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x109429[_0x76bb('0x41')][_0x76bb('0x6b')][_0x2fbd4f]),'WhatsappAccountId':Number(_0x109429[_0x76bb('0x60')]['id'])});}}else{socket['emit'](_0x76bb('0x75'),{'UserId':Number(_0x109429[_0x76bb('0x41')][_0x76bb('0x6b')]),'WhatsappAccountId':Number(_0x109429[_0x76bb('0x60')]['id'])});}});}})[_0x76bb('0x1e')](respondWithStatusCode(_0x37f3cb,null))[_0x76bb('0x29')](handleError(_0x37f3cb,null));};exports[_0x76bb('0x76')]=function(_0x2b7280,_0x47ecb4,_0x2c3465){var _0x5ee7f3={};var _0x591940={};var _0x4fd76e;var _0x368f26;return db[_0x76bb('0x4f')][_0x76bb('0x66')]({'where':{'id':_0x2b7280[_0x76bb('0x60')]['id']}})['then'](handleEntityNotFound(_0x47ecb4,null))[_0x76bb('0x1e')](function(_0x552e78){if(_0x552e78){_0x4fd76e=_0x552e78;_0x591940[_0x76bb('0x3f')]=_[_0x76bb('0x40')](db[_0x76bb('0x77')][_0x76bb('0x3d')]);_0x591940[_0x76bb('0x41')]=_[_0x76bb('0x40')](_0x2b7280['query']);_0x591940[_0x76bb('0x42')]=_[_0x76bb('0x43')](_0x591940[_0x76bb('0x3f')],_0x591940[_0x76bb('0x41')]);_0x5ee7f3[_0x76bb('0x44')]=_[_0x76bb('0x43')](_0x591940[_0x76bb('0x3f')],qs[_0x76bb('0x45')](_0x2b7280['query']['fields']));_0x5ee7f3[_0x76bb('0x44')]=_0x5ee7f3[_0x76bb('0x44')][_0x76bb('0x46')]?_0x5ee7f3[_0x76bb('0x44')]:_0x591940[_0x76bb('0x3f')];_0x5ee7f3['order']=qs[_0x76bb('0x48')](_0x2b7280['query']['sort']);_0x5ee7f3[_0x76bb('0x4a')]=qs['filters'](_[_0x76bb('0x49')](_0x2b7280[_0x76bb('0x41')],_0x591940[_0x76bb('0x42')]));if(_0x2b7280[_0x76bb('0x41')][_0x76bb('0x4d')]){_0x5ee7f3[_0x76bb('0x4a')]=_[_0x76bb('0x4b')](_0x5ee7f3[_0x76bb('0x4a')],{'$or':_[_0x76bb('0x3c')](_0x5ee7f3[_0x76bb('0x44')],function(_0x18b135){var _0x582faa={};_0x582faa[_0x18b135]={'$like':'%'+_0x2b7280['query'][_0x76bb('0x4d')]+'%'};return _0x582faa;})});}_0x5ee7f3=_[_0x76bb('0x4b')]({},_0x5ee7f3,_0x2b7280[_0x76bb('0x4e')]);return _0x4fd76e[_0x76bb('0x76')](_0x5ee7f3);}})[_0x76bb('0x1e')](function(_0xaeab86){if(_0xaeab86){_0x368f26=_0xaeab86[_0x76bb('0x46')];if(!_0x2b7280[_0x76bb('0x41')][_0x76bb('0x67')](_0x76bb('0x68'))){_0x5ee7f3[_0x76bb('0x2f')]=qs[_0x76bb('0x2f')](_0x2b7280[_0x76bb('0x41')][_0x76bb('0x2f')]);_0x5ee7f3['offset']=qs[_0x76bb('0x30')](_0x2b7280['query'][_0x76bb('0x30')]);}return _0x4fd76e['getAgents'](_0x5ee7f3);}})[_0x76bb('0x1e')](function(_0x2508f9){if(_0x2508f9){return _0x2508f9?{'count':_0x368f26,'rows':_0x2508f9}:null;}})[_0x76bb('0x1e')](respondWithResult(_0x47ecb4,null))[_0x76bb('0x29')](handleError(_0x47ecb4,null));};exports[_0x76bb('0x78')]=function(_0x35ed47,_0x45b9c3){var _0x17a7da=_0x35ed47['params']['id'];var _0x5a9cbe=_0x35ed47[_0x76bb('0x57')];var _0x138b6f=0xc8;var _0x1f140f=null;return db[_0x76bb('0x79')][_0x76bb('0x7a')]({'isolationLevel':db[_0x76bb('0x79')][_0x76bb('0x7b')][_0x76bb('0x7c')][_0x76bb('0x7d')]},function(_0x427b05){return db['WhatsappAccount']['findOne']({'where':{'id':_0x17a7da},'transaction':_0x427b05})[_0x76bb('0x1e')](function(_0x3fce3d){if(_0x3fce3d){return db[_0x76bb('0x7e')][_0x76bb('0x38')]({'where':{'WhatsappAccountId':_0x17a7da},'transaction':_0x427b05})['then'](function(){var _0x1b1ac2=_['map'](_0x5a9cbe,function(_0x419c69){_0x419c69[_0x76bb('0x63')]=_0x17a7da;return _0x419c69;});return db[_0x76bb('0x7e')]['bulkCreate'](_0x1b1ac2,{'transaction':_0x427b05});});}else{_0x138b6f=0x194;_0x1f140f=[];}});})['then'](function(){if(_0x138b6f!==0x194){return db[_0x76bb('0x7e')][_0x76bb('0x7f')]({'where':{'WhatsappAccountId':_0x17a7da},'order':'priority'})[_0x76bb('0x1e')](function(_0x42d7e2){_0x1f140f=_0x42d7e2;});}})[_0x76bb('0x29')](function(_0x2a30eb){_0x138b6f=0x1f4;logger[_0x76bb('0x24')](_0x2a30eb[_0x76bb('0x39')]);if(_0x2a30eb[_0x76bb('0x5e')]){delete _0x2a30eb['name'];}_0x1f140f=_0x2a30eb;})[_0x76bb('0x80')](function(){if(_0x1f140f===null){_0x45b9c3[_0x76bb('0x2a')](_0x138b6f);}else{if(_0x138b6f===0x1f4){_0x45b9c3['status'](_0x138b6f)['send'](_0x1f140f);}else{_0x45b9c3[_0x76bb('0x2b')](_0x138b6f)[_0x76bb('0x2d')](_0x1f140f);}}});};exports[_0x76bb('0x81')]=function(_0x405037,_0x2854d5,_0x48d51c){var _0xec827f={};var _0x4a6c14={};var _0x417d71;var _0x404396;return db[_0x76bb('0x4f')]['findOne']({'where':{'id':_0x405037[_0x76bb('0x60')]['id']}})[_0x76bb('0x1e')](handleEntityNotFound(_0x2854d5,null))['then'](function(_0x2695e5){if(_0x2695e5){_0x417d71=_0x2695e5;_0x4a6c14[_0x76bb('0x3f')]=_[_0x76bb('0x40')](db[_0x76bb('0x7e')][_0x76bb('0x3d')]);_0x4a6c14[_0x76bb('0x41')]=_[_0x76bb('0x40')](_0x405037[_0x76bb('0x41')]);_0x4a6c14[_0x76bb('0x42')]=_[_0x76bb('0x43')](_0x4a6c14['model'],_0x4a6c14[_0x76bb('0x41')]);_0xec827f[_0x76bb('0x44')]=_[_0x76bb('0x43')](_0x4a6c14[_0x76bb('0x3f')],qs['fields'](_0x405037[_0x76bb('0x41')][_0x76bb('0x45')]));_0xec827f['attributes']=_0xec827f[_0x76bb('0x44')][_0x76bb('0x46')]?_0xec827f[_0x76bb('0x44')]:_0x4a6c14[_0x76bb('0x3f')];_0xec827f['order']=qs[_0x76bb('0x48')](_0x405037[_0x76bb('0x41')]['sort']);_0xec827f[_0x76bb('0x4a')]=qs[_0x76bb('0x42')](_['pick'](_0x405037['query'],_0x4a6c14[_0x76bb('0x42')]));if(_0x405037[_0x76bb('0x41')][_0x76bb('0x4d')]){_0xec827f[_0x76bb('0x4a')]=_[_0x76bb('0x4b')](_0xec827f[_0x76bb('0x4a')],{'$or':_[_0x76bb('0x3c')](_0xec827f[_0x76bb('0x44')],function(_0xc6405b){var _0x1e4229={};_0x1e4229[_0xc6405b]={'$like':'%'+_0x405037[_0x76bb('0x41')][_0x76bb('0x4d')]+'%'};return _0x1e4229;})});}_0xec827f=_[_0x76bb('0x4b')]({},_0xec827f,_0x405037[_0x76bb('0x4e')]);return _0x417d71[_0x76bb('0x81')](_0xec827f);}})[_0x76bb('0x1e')](function(_0x2589bc){if(_0x2589bc){_0x404396=_0x2589bc[_0x76bb('0x46')];if(!_0x405037[_0x76bb('0x41')][_0x76bb('0x67')](_0x76bb('0x68'))){_0xec827f[_0x76bb('0x2f')]=qs[_0x76bb('0x2f')](_0x405037[_0x76bb('0x41')][_0x76bb('0x2f')]);_0xec827f[_0x76bb('0x30')]=qs[_0x76bb('0x30')](_0x405037[_0x76bb('0x41')][_0x76bb('0x30')]);}return _0x417d71[_0x76bb('0x81')](_0xec827f);}})[_0x76bb('0x1e')](function(_0x3b9b54){if(_0x3b9b54){return _0x3b9b54?{'count':_0x404396,'rows':_0x3b9b54}:null;}})[_0x76bb('0x1e')](respondWithResult(_0x2854d5,null))[_0x76bb('0x29')](handleError(_0x2854d5,null));};exports[_0x76bb('0x82')]=function(_0x3818d8,_0x1108cf,_0xf408c){var _0x4a89e1={'channel':_0x76bb('0x83')};var _0x1f41c0=[];var _0x54141c=[];var _0x574ae4={};return db['WhatsappAccount'][_0x76bb('0x55')]({'where':{'id':_0x3818d8[_0x76bb('0x60')]['id']},'include':[{'model':db[_0x76bb('0x7e')],'as':_0x76bb('0x84')}]})[_0x76bb('0x1e')](handleEntityNotFound(_0x1108cf,null))[_0x76bb('0x1e')](function(_0xa082ad){_0x4a89e1['account']=_0xa082ad;if(_0x4a89e1[_0x76bb('0x85')]&&_0x4a89e1[_0x76bb('0x85')]['type']===_0x76bb('0x86')&&_0x3818d8[_0x76bb('0x57')][_0x76bb('0x87')]){if(_0x3818d8[_0x76bb('0x57')][_0x76bb('0x87')]['length']===0x0)return;if(_0x3818d8[_0x76bb('0x57')][_0x76bb('0x87')][0x0]['state']!==_0x76bb('0x88'))return;return db[_0x76bb('0x89')][_0x76bb('0x35')]({'read':!![],'readAt':_0x3818d8[_0x76bb('0x57')][_0x76bb('0x87')][0x0][_0x76bb('0x8a')]},{'where':{'messageId':_0x3818d8[_0x76bb('0x57')][_0x76bb('0x87')][0x0][_0x76bb('0x8b')]},'individualHooks':!![]})[_0x76bb('0x1e')](function(_0x703aea){return _0x1108cf[_0x76bb('0x2b')](0xc8)[_0x76bb('0x2d')](_0x703aea);});}_0x4a89e1['applications']=_[_0x76bb('0x8c')](_0xa082ad[_0x76bb('0x84')],['priority'],[_0x76bb('0x8d')]);if(_0x4a89e1[_0x76bb('0x85')][_0x76bb('0x84')]){delete _0x4a89e1[_0x76bb('0x85')][_0x76bb('0x84')];}return db[_0x76bb('0x8e')][_0x76bb('0x61')]()[_0x76bb('0x1e')](function(_0x350912){if(!_0x350912){throw new db[(_0x76bb('0x8f'))][(_0x76bb('0x90'))](_0x76bb('0x91'));}_0x1f41c0=_[_0x76bb('0x92')](_[_0x76bb('0x40')](_0x350912),[_0x76bb('0x93'),_0x76bb('0x94')]);_0x54141c=_['difference'](_['keys'](_0x350912),[_0x76bb('0x93'),_0x76bb('0x94'),_0x76bb('0x95'),_0x76bb('0x96')]);_0x4a89e1['body']={'mapKey':_0x76bb('0x97')};if(_0x4a89e1[_0x76bb('0x85')]&&_0x4a89e1[_0x76bb('0x85')][_0x76bb('0x3e')]===_0x76bb('0x98')){_0x4a89e1[_0x76bb('0x57')][_0x76bb('0x99')]=_0x3818d8[_0x76bb('0x57')]['From'][_0x76bb('0x9a')]('whatsapp:','');_0x4a89e1[_0x76bb('0x57')][_0x76bb('0x57')]=_0x3818d8[_0x76bb('0x57')][_0x76bb('0x9b')];_0x4a89e1[_0x76bb('0x57')]['messageId']=_0x3818d8[_0x76bb('0x57')][_0x76bb('0x9c')];}if(_0x4a89e1[_0x76bb('0x85')]&&_0x4a89e1['account'][_0x76bb('0x3e')]==='sinch'){_0x4a89e1['body']['from']=_0x3818d8['body'][_0x76bb('0x9d')][0x0][_0x76bb('0x99')];_0x4a89e1[_0x76bb('0x57')]['body']=_0x3818d8[_0x76bb('0x57')][_0x76bb('0x9d')][0x0][_0x76bb('0x27')][_0x76bb('0x57')];_0x4a89e1[_0x76bb('0x57')][_0x76bb('0x9e')]=_0x3818d8['body']['notifications'][0x0][_0x76bb('0x8b')];}if(_0x4a89e1[_0x76bb('0x57')]['id']){delete _0x4a89e1[_0x76bb('0x57')]['id'];}if(_[_0x76bb('0x9f')](_0x4a89e1[_0x76bb('0x57')]['from'])){throw new db[(_0x76bb('0x8f'))][(_0x76bb('0x90'))]('from\x20is\x20mandatory');}if(_[_0x76bb('0x9f')](_0x4a89e1[_0x76bb('0x57')]['body'])||_0x4a89e1[_0x76bb('0x57')][_0x76bb('0x57')]===''){throw new db[(_0x76bb('0x8f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4a89e1[_0x76bb('0x57')][_0x76bb('0xa0')])){throw new db[(_0x76bb('0x8f'))][(_0x76bb('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54141c);}if(!_[_0x76bb('0xa1')](_0x54141c,_0x4a89e1['body'][_0x76bb('0xa0')])){throw new db['Sequelize'][(_0x76bb('0x90'))](_0x76bb('0xa2')+_0x54141c);}_0x574ae4[_0x4a89e1[_0x76bb('0x57')][_0x76bb('0xa0')]]=_0x4a89e1[_0x76bb('0x57')]['from'];return db[_0x76bb('0xa3')][_0x76bb('0x55')]({'where':{'id':_0x4a89e1[_0x76bb('0x85')][_0x76bb('0x96')]},'include':[{'model':db[_0x76bb('0x8e')],'as':_0x76bb('0xa4'),'where':_0x574ae4,'limit':0x1,'order':[[_0x76bb('0x94'),_0x76bb('0xa5')]]}]});})['then'](handleEntityNotFound(_0x1108cf,null))[_0x76bb('0x1e')](function(_0x4079ba){if(_0x4079ba){_0x4a89e1[_0x76bb('0xa6')]=_[_0x76bb('0x71')](_0x4079ba,[_0x76bb('0xa4')]);if(_0x4079ba['Contacts'][_0x76bb('0x46')]){return _0x4079ba[_0x76bb('0xa4')][0x0];}var _0x1c7dc3=_[_0x76bb('0x16')](_0x4a89e1[_0x76bb('0x57')],{'firstName':_0x4a89e1[_0x76bb('0x57')]['from'],'ListId':_0x4079ba['id']});_0x1c7dc3[_0x4a89e1[_0x76bb('0x57')][_0x76bb('0xa0')]]=_0x4a89e1[_0x76bb('0x57')]['from'];return db['CmContact'][_0x76bb('0x56')](_0x1c7dc3,{'fields':_0x1f41c0,'raw':!![]});}})[_0x76bb('0x1e')](handleEntityNotFound(_0x1108cf,null))['then'](function(_0x4fe3b5){if(_0x4fe3b5){_0x4a89e1['contact']=_0x4fe3b5;var _0x20117d={'ContactId':_0x4fe3b5['id'],'phone':_0x4a89e1[_0x76bb('0x57')][_0x76bb('0x99')],'WhatsappAccountId':_0x3818d8[_0x76bb('0x60')]['id']};var _0x520446={'ContactId':_0x4fe3b5['id'],'WhatsappAccountId':_0x3818d8[_0x76bb('0x60')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x520446})[_0x76bb('0x1e')](function(_0xc48179){if(_0xc48179){return[_0xc48179,![]];}return db[_0x76bb('0xa7')][_0x76bb('0x56')](_0x20117d)[_0x76bb('0x1e')](function(_0x576902){return[_0x576902,!![]];});});}})[_0x76bb('0xa8')](function(_0xb303de,_0x478e99){_0x4a89e1['interaction']=_0xb303de[_0x76bb('0x36')]({'plain':!![]});_0x4a89e1[_0x76bb('0xa9')]['created']=![];if(_0x478e99){if(_0x4a89e1['account'][_0x76bb('0xaa')]){_0x4a89e1[_0x76bb('0xab')][_0x76bb('0xac')]({'id':0x0,'priority':_0x4a89e1['applications'][_0x76bb('0x46')]+0x1,'app':_0x76bb('0xad'),'appdata':_0x76bb('0xae'),'interval':'*,*,*,*'});}_0x4a89e1[_0x76bb('0xa9')][_0x76bb('0xaf')]=!![];}return db['WhatsappMessage'][_0x76bb('0x56')]({'phone':_0x4a89e1['body'][_0x76bb('0x99')],'messageId':_0x4a89e1['body'][_0x76bb('0x9e')],'body':_0x4a89e1['body']['body'],'WhatsappAccountId':_0x3818d8[_0x76bb('0x60')]['id'],'WhatsappInteractionId':_0xb303de['id'],'direction':'in','ContactId':_0xb303de[_0x76bb('0xb0')],'AttachmentId':_0x4a89e1[_0x76bb('0x57')][_0x76bb('0xb1')]});})['then'](function(_0x467239){_0x4a89e1[_0x76bb('0x27')]=_0x467239;if(_0x4a89e1[_0x76bb('0xa9')][_0x76bb('0xb2')]){return db[_0x76bb('0x77')][_0x76bb('0x55')]({'attributes':['id','name'],'where':{'id':_0x4a89e1[_0x76bb('0xa9')][_0x76bb('0xb2')]}})[_0x76bb('0x1e')](function(_0x2074f2){if(_0x2074f2){_0x4a89e1[_0x76bb('0xab')][_0x76bb('0xb3')]({'id':0x0,'priority':0x0,'app':_0x76bb('0xb4'),'appdata':_0x2074f2['name']+','+(_0x4a89e1['account'][_0x76bb('0xb5')]||0xa),'interval':_0x76bb('0xb6')});}return respondWithRpcPromise(_0x76bb('0xb7'),_0x76bb('0xb8'),_0x4a89e1);});}return respondWithRpcPromise('Start','startRouting',_0x4a89e1);})[_0x76bb('0x1e')](function(_0x1b2b0f){if(_0x1b2b0f){var _0x2b7f9f=0xc8;var _0x5b4d01=_0x76bb('0xb9');logger[_0x76bb('0x1f')](_0x76bb('0x21'),_0x5b4d01,_0x2b7f9f,_0x76bb('0xba'));logger[_0x76bb('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x5b4d01,_0x2b7f9f,_0x76bb('0xba'),JSON['stringify'](_0x1b2b0f));if(_0x4a89e1[_0x76bb('0x85')][_0x76bb('0x3e')]===_0x76bb('0x98')){return _0x1108cf[_0x76bb('0x2b')](_0x2b7f9f)[_0x76bb('0x32')](_0x76bb('0xbb'),_0x76bb('0xbc'))[_0x76bb('0x3a')](_0x76bb('0xbd'));}else{return _0x1108cf[_0x76bb('0x2b')](_0x2b7f9f)[_0x76bb('0x2d')](_0x1b2b0f);}}});})[_0x76bb('0x29')](handleError(_0x1108cf,null));};exports['send']=function(_0x1dbe1c,_0x57f17f,_0x3fe0f3){var _0x426045,_0xfea112,_0x38400a;if(_['isNil'](_0x1dbe1c[_0x76bb('0x57')][_0x76bb('0x57')])||_0x1dbe1c[_0x76bb('0x57')][_0x76bb('0x57')]===''){throw new db[(_0x76bb('0x8f'))][(_0x76bb('0x90'))](_0x76bb('0xbe'));}if(_['isNil'](_0x1dbe1c[_0x76bb('0x57')]['to'])){throw new db[(_0x76bb('0x8f'))]['ValidationError']('to\x20is\x20mandatory');}_0x426045=_0x1dbe1c['body']['to'];return db[_0x76bb('0x4f')][_0x76bb('0x55')]({'where':{'id':_0x1dbe1c[_0x76bb('0x60')]['id']},'include':[{'model':db[_0x76bb('0xa3')],'as':'List','include':[{'model':db[_0x76bb('0x8e')],'as':_0x76bb('0xa4'),'where':{'mobile':_0x426045},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x76bb('0x1e')](handleEntityNotFound(_0x57f17f,null))[_0x76bb('0x1e')](function(_0x4fe426){if(_0x4fe426&&_0x4fe426['List']){_0xfea112=_0x4fe426[_0x76bb('0x36')]({'plain':!![]});if(_0xfea112[_0x76bb('0xbf')]&&_0xfea112['List'][_0x76bb('0xa4')]['length']){return _0xfea112[_0x76bb('0xbf')][_0x76bb('0xa4')][0x0];}return db[_0x76bb('0x8e')][_0x76bb('0x56')](_[_0x76bb('0x16')](_0x1dbe1c[_0x76bb('0x57')],{'firstName':_0x426045,'mobile':_0x426045,'phone':_0x426045,'ListId':_0xfea112['ListId']}));}})['then'](handleEntityNotFound(_0x57f17f,null))[_0x76bb('0x1e')](function(_0x22969a){if(_0x22969a){_0x38400a=_0x22969a;return db[_0x76bb('0xa7')][_0x76bb('0x55')]({'where':{'ContactId':_0x38400a['id'],'closed':![],'WhatsappAccountId':_0xfea112['id']}})[_0x76bb('0x1e')](function(_0x4034a4){if(_0x4034a4){return[_0x4034a4,![]];}return db[_0x76bb('0xa7')][_0x76bb('0x56')]({'UserId':_0x1dbe1c[_0x76bb('0x5a')]['id'],'ContactId':_0x38400a['id'],'WhatsappAccountId':_0xfea112['id'],'phone':_0x426045,'firstMsgDirection':'out','Messages':[_[_0x76bb('0x4b')](_0x1dbe1c['body'],{'read':![],'body':_0x1dbe1c['body'][_0x76bb('0x57')],'phone':_0x426045,'WhatsappAccountId':_0xfea112['id'],'UserId':_0x1dbe1c[_0x76bb('0x5a')]['id'],'ContactId':_0x38400a['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x267221){return[_0x267221,!![]];});});}})[_0x76bb('0xa8')](function(_0x4000b3,_0x1fc991){if(_0x1fc991){return _0x4000b3;}return db[_0x76bb('0x89')][_0x76bb('0x56')](_['merge'](_0x1dbe1c[_0x76bb('0x57')],{'read':![],'body':_0x1dbe1c['body'][_0x76bb('0x57')],'phone':_0x426045,'WhatsappAccountId':_0xfea112['id'],'WhatsappInteractionId':_0x4000b3['id'],'UserId':_0x1dbe1c['user']['id'],'ContactId':_0x38400a['id']}))[_0x76bb('0x1e')](function(_0xa93b54){_0x4000b3['dataValues']['Messages']=[];_0x4000b3[_0x76bb('0xc0')][_0x76bb('0xc1')][_0x76bb('0xac')](_0xa93b54['dataValues']);return _0x4000b3;});})[_0x76bb('0x1e')](respondWithResult(_0x57f17f,null))[_0x76bb('0x29')](handleError(_0x57f17f,null));}; \ No newline at end of file +var _0xbaf9=['include','rows','show','params','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','Applications','account','statuses','read','WhatsappMessage','message_id','orderBy','priority','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','messageId','MessageSid','sinch','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','out','Messages','dataValues','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','rawAttributes','fieldName','type','model','map','query','keys','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','WhatsappAccount','includeAll'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbaf9,0x6d));var _0x9baf=function(_0x4abbeb,_0x24cb71){_0x4abbeb=_0x4abbeb-0x0;var _0x3970c4=_0xbaf9[_0x4abbeb];return _0x3970c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9baf('0x0'));var jsonpatch=require(_0x9baf('0x1'));var rp=require(_0x9baf('0x2'));var moment=require(_0x9baf('0x3'));var BPromise=require(_0x9baf('0x4'));var Mustache=require('mustache');var util=require(_0x9baf('0x5'));var path=require(_0x9baf('0x6'));var sox=require('sox');var csv=require(_0x9baf('0x7'));var ejs=require(_0x9baf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9baf('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9baf('0xa'));var deskjs=require(_0x9baf('0xb'));var toCsv=require(_0x9baf('0x7'));var querystring=require(_0x9baf('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9baf('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9baf('0xe'));var hardwareService=require(_0x9baf('0xf'));var logger=require(_0x9baf('0x10'))('api');var utils=require(_0x9baf('0x11'));var config=require(_0x9baf('0x12'));var licenseUtil=require(_0x9baf('0x13'));var db=require('../../mysqldb')['db'];config[_0x9baf('0x14')]=_[_0x9baf('0x15')](config['redis'],{'host':_0x9baf('0x16'),'port':0x18eb});var socket=require(_0x9baf('0x17'))(new Redis(config[_0x9baf('0x14')]));require(_0x9baf('0x18'))[_0x9baf('0x19')](socket);var jayson=require(_0x9baf('0x1a'));var client=jayson[_0x9baf('0x1b')][_0x9baf('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x4741c6,_0xd3dbc1,_0x3375e7,_0x2ae39a){return new BPromise(function(_0x1d12fb,_0x4b2b42){var _0x36e025=_0x2ae39a||client;return _0x36e025[_0x9baf('0x1d')](_0x4741c6,_0x3375e7)[_0x9baf('0x1e')](function(_0x428dc9){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0xd3dbc1,_0x9baf('0x1f'));logger[_0x9baf('0x20')](_0x9baf('0x21'),_0xd3dbc1,'request\x20sent',JSON[_0x9baf('0x22')](_0x428dc9));if(_0x428dc9['error']){if(_0x428dc9[_0x9baf('0x23')]['code']===0x1f4){logger[_0x9baf('0x23')](_0x9baf('0x24'),_0xd3dbc1,_0x428dc9[_0x9baf('0x23')][_0x9baf('0x25')]);return _0x4b2b42(_0x428dc9[_0x9baf('0x23')][_0x9baf('0x25')]);}logger['error'](_0x9baf('0x24'),_0xd3dbc1,_0x428dc9['error'][_0x9baf('0x25')]);return _0x1d12fb(_0x428dc9[_0x9baf('0x23')]['message']);}else{logger['info'](_0x9baf('0x24'),_0xd3dbc1,_0x9baf('0x1f'));_0x1d12fb(_0x428dc9[_0x9baf('0x26')]['message']);}})[_0x9baf('0x27')](function(_0x130ebf){logger[_0x9baf('0x23')](_0x9baf('0x24'),_0xd3dbc1,_0x130ebf);_0x4b2b42(_0x130ebf);});});}function respondWithStatusCode(_0x1ca191,_0x19cb2a){_0x19cb2a=_0x19cb2a||0xcc;return function(_0x399f2c){if(_0x399f2c){return _0x1ca191[_0x9baf('0x28')](_0x19cb2a);}return _0x1ca191[_0x9baf('0x29')](_0x19cb2a)['end']();};}function respondWithResult(_0x2186b5,_0x267793){_0x267793=_0x267793||0xc8;return function(_0x10611c){if(_0x10611c){return _0x2186b5['status'](_0x267793)[_0x9baf('0x2a')](_0x10611c);}};}function respondWithFilteredResult(_0x22fba9,_0x5da014){return function(_0x419c3f){if(_0x419c3f){var _0x514904=typeof _0x5da014[_0x9baf('0x2b')]===_0x9baf('0x2c')&&typeof _0x5da014['limit']===_0x9baf('0x2c');var _0xf9d9a2=_0x419c3f[_0x9baf('0x2d')];var _0x21c6f6=_0x514904?0x0:_0x5da014['offset'];var _0x3558cf=_0x514904?_0x419c3f['count']:_0x5da014[_0x9baf('0x2b')]+_0x5da014[_0x9baf('0x2e')];var _0x27f6fb;if(_0x3558cf>=_0xf9d9a2){_0x3558cf=_0xf9d9a2;_0x27f6fb=0xc8;}else{_0x27f6fb=0xce;}_0x22fba9[_0x9baf('0x29')](_0x27f6fb);return _0x22fba9[_0x9baf('0x2f')](_0x9baf('0x30'),_0x21c6f6+'-'+_0x3558cf+'/'+_0xf9d9a2)['json'](_0x419c3f);}return null;};}function patchUpdates(_0x2d5522){return function(_0x4b3d32){try{jsonpatch[_0x9baf('0x31')](_0x4b3d32,_0x2d5522,!![]);}catch(_0x2ee0a2){return BPromise[_0x9baf('0x32')](_0x2ee0a2);}return _0x4b3d32[_0x9baf('0x33')]();};}function saveUpdates(_0xc5c6bd,_0x117d86){return function(_0x1cc82c){if(_0x1cc82c){return _0x1cc82c[_0x9baf('0x34')](_0xc5c6bd)[_0x9baf('0x1e')](function(_0x2580fa){return _0x2580fa;});}return null;};}function removeEntity(_0x8a5f29,_0x540655){return function(_0x2df43a){if(_0x2df43a){return _0x2df43a[_0x9baf('0x35')]()[_0x9baf('0x1e')](function(){var _0x4fed8c=_0x2df43a[_0x9baf('0x36')]({'plain':!![]});var _0x1195c1='WhatsappAccounts';return db[_0x9baf('0x37')][_0x9baf('0x35')]({'where':{'type':_0x1195c1,'resourceId':_0x4fed8c['id']}})[_0x9baf('0x1e')](function(){return _0x2df43a;});})[_0x9baf('0x1e')](function(){_0x8a5f29[_0x9baf('0x29')](0xcc)[_0x9baf('0x38')]();});}};}function handleEntityNotFound(_0x158cd6,_0x961580){return function(_0x1ad6a7){if(!_0x1ad6a7){_0x158cd6[_0x9baf('0x28')](0x194);}return _0x1ad6a7;};}function handleError(_0x53b665,_0xe8c9c6){_0xe8c9c6=_0xe8c9c6||0x1f4;return function(_0x2537f3){logger[_0x9baf('0x23')](_0x2537f3[_0x9baf('0x39')]);if(_0x2537f3[_0x9baf('0x3a')]){delete _0x2537f3[_0x9baf('0x3a')];}_0x53b665[_0x9baf('0x29')](_0xe8c9c6)[_0x9baf('0x3b')](_0x2537f3);};}exports[_0x9baf('0x3c')]=function(_0x2bbf12,_0x30f48f){var _0x114b81={'include':[{'model':db[_0x9baf('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5d7a6b={},_0x5d2b7f={'count':0x0,'rows':[]};var _0x5f4acb=_['map'](db['WhatsappAccount'][_0x9baf('0x3e')],function(_0x164d7c){return{'name':_0x164d7c[_0x9baf('0x3f')],'type':_0x164d7c[_0x9baf('0x40')]['key']};});_0x5d7a6b[_0x9baf('0x41')]=_[_0x9baf('0x42')](_0x5f4acb,_0x9baf('0x3a'));_0x5d7a6b[_0x9baf('0x43')]=_[_0x9baf('0x44')](_0x2bbf12[_0x9baf('0x43')]);_0x5d7a6b['filters']=_['intersection'](_0x5d7a6b[_0x9baf('0x41')],_0x5d7a6b[_0x9baf('0x43')]);_0x114b81['attributes']=_['intersection'](_0x5d7a6b['model'],qs[_0x9baf('0x45')](_0x2bbf12[_0x9baf('0x43')][_0x9baf('0x45')]));_0x114b81[_0x9baf('0x46')]=_0x114b81['attributes'][_0x9baf('0x47')]?_0x114b81['attributes']:_0x5d7a6b[_0x9baf('0x41')];if(!_0x2bbf12[_0x9baf('0x43')]['hasOwnProperty'](_0x9baf('0x48'))){_0x114b81[_0x9baf('0x2e')]=qs[_0x9baf('0x2e')](_0x2bbf12[_0x9baf('0x43')][_0x9baf('0x2e')]);_0x114b81[_0x9baf('0x2b')]=qs[_0x9baf('0x2b')](_0x2bbf12[_0x9baf('0x43')][_0x9baf('0x2b')]);}_0x114b81[_0x9baf('0x49')]=qs[_0x9baf('0x4a')](_0x2bbf12['query']['sort']);_0x114b81[_0x9baf('0x4b')]=qs[_0x9baf('0x4c')](_[_0x9baf('0x4d')](_0x2bbf12[_0x9baf('0x43')],_0x5d7a6b['filters']),_0x5f4acb);if(_0x2bbf12[_0x9baf('0x43')][_0x9baf('0x4e')]){_0x114b81[_0x9baf('0x4b')]=_[_0x9baf('0x4f')](_0x114b81[_0x9baf('0x4b')],{'$or':_[_0x9baf('0x42')](_0x5f4acb,function(_0x123865){if(_0x123865[_0x9baf('0x40')]!==_0x9baf('0x50')){var _0xd810d1={};_0xd810d1[_0x123865[_0x9baf('0x3a')]]={'$like':'%'+_0x2bbf12['query'][_0x9baf('0x4e')]+'%'};return _0xd810d1;}})});}_0x114b81=_[_0x9baf('0x4f')]({},_0x114b81,_0x2bbf12['options']);var _0x34f816={'where':_0x114b81['where']};return db[_0x9baf('0x51')][_0x9baf('0x2d')](_0x34f816)[_0x9baf('0x1e')](function(_0xb56e4b){_0x5d2b7f['count']=_0xb56e4b;if(_0x2bbf12[_0x9baf('0x43')][_0x9baf('0x52')]){_0x114b81[_0x9baf('0x53')]=[{'all':!![]}];}return db[_0x9baf('0x51')]['findAll'](_0x114b81);})[_0x9baf('0x1e')](function(_0xac25e4){_0x5d2b7f[_0x9baf('0x54')]=_0xac25e4;return _0x5d2b7f;})['then'](respondWithFilteredResult(_0x30f48f,_0x114b81))['catch'](handleError(_0x30f48f,null));};exports[_0x9baf('0x55')]=function(_0xdb31ad,_0x1011b9){var _0x392df8={'raw':![],'where':{'id':_0xdb31ad[_0x9baf('0x56')]['id']},'include':[{'model':db[_0x9baf('0x3d')],'as':'mandatoryDispositionPause'}]},_0xc6a8f6={};_0xc6a8f6[_0x9baf('0x41')]=_['keys'](db[_0x9baf('0x51')][_0x9baf('0x3e')]);_0xc6a8f6[_0x9baf('0x43')]=_['keys'](_0xdb31ad[_0x9baf('0x43')]);_0xc6a8f6['filters']=_[_0x9baf('0x57')](_0xc6a8f6[_0x9baf('0x41')],_0xc6a8f6[_0x9baf('0x43')]);_0x392df8[_0x9baf('0x46')]=_[_0x9baf('0x57')](_0xc6a8f6['model'],qs[_0x9baf('0x45')](_0xdb31ad[_0x9baf('0x43')]['fields']));_0x392df8[_0x9baf('0x46')]=_0x392df8[_0x9baf('0x46')][_0x9baf('0x47')]?_0x392df8[_0x9baf('0x46')]:_0xc6a8f6[_0x9baf('0x41')];if(_0xdb31ad[_0x9baf('0x43')]['includeAll']){_0x392df8['include']=[{'all':!![]}];}_0x392df8=_[_0x9baf('0x4f')]({},_0x392df8,_0xdb31ad[_0x9baf('0x58')]);return db[_0x9baf('0x51')][_0x9baf('0x59')](_0x392df8)['then'](handleEntityNotFound(_0x1011b9,null))[_0x9baf('0x1e')](respondWithResult(_0x1011b9,null))[_0x9baf('0x27')](handleError(_0x1011b9,null));};exports[_0x9baf('0x5a')]=function(_0x2a4c94,_0x39cbbf){return db[_0x9baf('0x51')][_0x9baf('0x5a')](_0x2a4c94[_0x9baf('0x5b')],{})[_0x9baf('0x1e')](function(_0x2a2227){var _0x5a1884=_0x2a4c94[_0x9baf('0x5c')][_0x9baf('0x36')]({'plain':!![]});if(!_0x5a1884)throw new Error(_0x9baf('0x5d'));if(_0x5a1884[_0x9baf('0x5e')]===_0x9baf('0x5c')){var _0x1ad4f0=_0x2a2227[_0x9baf('0x36')]({'plain':!![]});var _0x15ae4e='WhatsappAccounts';return db[_0x9baf('0x5f')][_0x9baf('0x59')]({'where':{'name':_0x15ae4e,'userProfileId':_0x5a1884[_0x9baf('0x60')]},'raw':!![]})['then'](function(_0x253200){if(_0x253200&&_0x253200[_0x9baf('0x61')]===0x0){return db[_0x9baf('0x37')][_0x9baf('0x5a')]({'name':_0x1ad4f0[_0x9baf('0x3a')],'resourceId':_0x1ad4f0['id'],'type':_0x253200[_0x9baf('0x3a')],'sectionId':_0x253200['id']},{})[_0x9baf('0x1e')](function(){return _0x2a2227;});}else{return _0x2a2227;}})[_0x9baf('0x27')](function(_0x437a77){logger[_0x9baf('0x23')](_0x9baf('0x62'),_0x437a77);throw _0x437a77;});}return _0x2a2227;})['then'](respondWithResult(_0x39cbbf,0xc9))[_0x9baf('0x27')](handleError(_0x39cbbf,null));};exports[_0x9baf('0x34')]=function(_0x251a22,_0x2285a7){if(_0x251a22[_0x9baf('0x5b')]['id']){delete _0x251a22['body']['id'];}return db[_0x9baf('0x51')][_0x9baf('0x59')]({'where':{'id':_0x251a22[_0x9baf('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x9baf('0x63')}]})['then'](handleEntityNotFound(_0x2285a7,null))[_0x9baf('0x1e')](saveUpdates(_0x251a22[_0x9baf('0x5b')],null))['then'](respondWithResult(_0x2285a7,null))[_0x9baf('0x27')](handleError(_0x2285a7,null));};exports[_0x9baf('0x35')]=function(_0x26de8d,_0x5364ac){return db[_0x9baf('0x51')][_0x9baf('0x59')]({'where':{'id':_0x26de8d[_0x9baf('0x56')]['id']}})['then'](handleEntityNotFound(_0x5364ac,null))[_0x9baf('0x1e')](removeEntity(_0x5364ac,null))[_0x9baf('0x27')](handleError(_0x5364ac,null));};exports[_0x9baf('0x64')]=function(_0x2d6227,_0x31fb52){return db[_0x9baf('0x51')][_0x9baf('0x64')]()['then'](respondWithResult(_0x31fb52,null))[_0x9baf('0x27')](handleError(_0x31fb52,null));};exports[_0x9baf('0x65')]=function(_0x2b2653,_0x44607f,_0x270d48){if(_0x2b2653[_0x9baf('0x5b')]['id']){delete _0x2b2653[_0x9baf('0x5b')]['id'];}return db[_0x9baf('0x51')]['find']({'where':{'id':_0x2b2653[_0x9baf('0x56')]['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x44607f,null))[_0x9baf('0x1e')](function(_0x34d935){if(_0x34d935){_0x2b2653['body'][_0x9baf('0x66')]=_0x34d935['id'];return db[_0x9baf('0x67')][_0x9baf('0x5a')](_0x2b2653[_0x9baf('0x5b')]);}})[_0x9baf('0x1e')](respondWithResult(_0x44607f,null))[_0x9baf('0x27')](handleError(_0x44607f,null));};exports[_0x9baf('0x68')]=function(_0x5f4d88,_0x267c9,_0x582238){var _0x32a2cc={'raw':![],'where':{}};var _0x193e3c={};var _0x12561d={'count':0x0,'rows':[]};return db[_0x9baf('0x51')][_0x9baf('0x69')]({'where':{'id':_0x5f4d88[_0x9baf('0x56')]['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x267c9,null))[_0x9baf('0x1e')](function(_0x9f32b6){if(_0x9f32b6){_0x193e3c[_0x9baf('0x41')]=_['keys'](db[_0x9baf('0x67')][_0x9baf('0x3e')]);_0x193e3c[_0x9baf('0x43')]=_[_0x9baf('0x44')](_0x5f4d88['query']);_0x193e3c['filters']=_[_0x9baf('0x57')](_0x193e3c[_0x9baf('0x41')],_0x193e3c[_0x9baf('0x43')]);_0x32a2cc[_0x9baf('0x46')]=_[_0x9baf('0x57')](_0x193e3c[_0x9baf('0x41')],qs[_0x9baf('0x45')](_0x5f4d88[_0x9baf('0x43')][_0x9baf('0x45')]));_0x32a2cc[_0x9baf('0x46')]=_0x32a2cc[_0x9baf('0x46')]['length']?_0x32a2cc[_0x9baf('0x46')]:_0x193e3c[_0x9baf('0x41')];if(!_0x5f4d88[_0x9baf('0x43')]['hasOwnProperty'](_0x9baf('0x48'))){_0x32a2cc[_0x9baf('0x2e')]=qs['limit'](_0x5f4d88[_0x9baf('0x43')][_0x9baf('0x2e')]);_0x32a2cc[_0x9baf('0x2b')]=qs[_0x9baf('0x2b')](_0x5f4d88[_0x9baf('0x43')]['offset']);}_0x32a2cc['order']=qs[_0x9baf('0x4a')](_0x5f4d88['query'][_0x9baf('0x4a')]);_0x32a2cc[_0x9baf('0x4b')]=qs[_0x9baf('0x4c')](_[_0x9baf('0x4d')](_0x5f4d88[_0x9baf('0x43')],_0x193e3c['filters']));_0x32a2cc[_0x9baf('0x4b')][_0x9baf('0x66')]=_0x9f32b6['id'];if(_0x5f4d88[_0x9baf('0x43')]['filter']){_0x32a2cc[_0x9baf('0x4b')]=_['merge'](_0x32a2cc[_0x9baf('0x4b')],{'$or':_[_0x9baf('0x42')](_0x32a2cc['attributes'],function(_0x1da48e){var _0x19e06a={};_0x19e06a[_0x1da48e]={'$like':'%'+_0x5f4d88['query'][_0x9baf('0x4e')]+'%'};return _0x19e06a;})});}_0x32a2cc=_[_0x9baf('0x4f')]({},_0x32a2cc,_0x5f4d88[_0x9baf('0x58')]);return db[_0x9baf('0x67')][_0x9baf('0x2d')]({'where':_0x32a2cc['where']})['then'](function(_0x1a0870){_0x12561d[_0x9baf('0x2d')]=_0x1a0870;if(_0x5f4d88[_0x9baf('0x43')]['includeAll']){_0x32a2cc[_0x9baf('0x53')]=[{'all':!![]}];}return db[_0x9baf('0x67')]['findAll'](_0x32a2cc);})[_0x9baf('0x1e')](function(_0x216b5d){_0x12561d['rows']=_0x216b5d;return _0x12561d;});}})[_0x9baf('0x1e')](respondWithFilteredResult(_0x267c9,_0x32a2cc))[_0x9baf('0x27')](handleError(_0x267c9,null));};exports[_0x9baf('0x6a')]=function(_0x4c3127,_0x309447,_0x54f793){return db[_0x9baf('0x51')]['find']({'where':{'id':_0x4c3127[_0x9baf('0x56')]['id']}})['then'](handleEntityNotFound(_0x309447,null))[_0x9baf('0x1e')](function(_0x3ff2e7){if(_0x3ff2e7){return _0x3ff2e7[_0x9baf('0x6a')](_0x4c3127[_0x9baf('0x43')]['ids']);}})[_0x9baf('0x1e')](respondWithStatusCode(_0x309447,null))['catch'](handleError(_0x309447,null));};exports[_0x9baf('0x6b')]=function(_0x5f44c2,_0x59a245,_0x33de19){if(_0x5f44c2[_0x9baf('0x5b')]['id']){delete _0x5f44c2['body']['id'];}return db[_0x9baf('0x51')][_0x9baf('0x59')]({'where':{'id':_0x5f44c2[_0x9baf('0x56')]['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x59a245,null))[_0x9baf('0x1e')](function(_0x50112d){if(_0x50112d){_0x5f44c2['body'][_0x9baf('0x66')]=_0x50112d['id'];return db[_0x9baf('0x6c')][_0x9baf('0x5a')](_0x5f44c2['body']);}})['then'](respondWithResult(_0x59a245,null))[_0x9baf('0x27')](handleError(_0x59a245,null));};exports[_0x9baf('0x6d')]=function(_0x385bfc,_0x58a17d,_0x184c7b){var _0x6c715b={'raw':![],'where':{}};var _0x38eb7c={};var _0x9e48a3={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x9baf('0x69')]({'where':{'id':_0x385bfc['params']['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x58a17d,null))[_0x9baf('0x1e')](function(_0x4b9adf){if(_0x4b9adf){_0x38eb7c[_0x9baf('0x41')]=_[_0x9baf('0x44')](db[_0x9baf('0x6c')][_0x9baf('0x3e')]);_0x38eb7c[_0x9baf('0x43')]=_[_0x9baf('0x44')](_0x385bfc[_0x9baf('0x43')]);_0x38eb7c[_0x9baf('0x4c')]=_[_0x9baf('0x57')](_0x38eb7c[_0x9baf('0x41')],_0x38eb7c[_0x9baf('0x43')]);_0x6c715b[_0x9baf('0x46')]=_[_0x9baf('0x57')](_0x38eb7c['model'],qs[_0x9baf('0x45')](_0x385bfc[_0x9baf('0x43')]['fields']));_0x6c715b['attributes']=_0x6c715b[_0x9baf('0x46')][_0x9baf('0x47')]?_0x6c715b['attributes']:_0x38eb7c[_0x9baf('0x41')];if(!_0x385bfc[_0x9baf('0x43')][_0x9baf('0x6e')](_0x9baf('0x48'))){_0x6c715b['limit']=qs['limit'](_0x385bfc['query'][_0x9baf('0x2e')]);_0x6c715b[_0x9baf('0x2b')]=qs[_0x9baf('0x2b')](_0x385bfc[_0x9baf('0x43')][_0x9baf('0x2b')]);}_0x6c715b[_0x9baf('0x49')]=qs[_0x9baf('0x4a')](_0x385bfc[_0x9baf('0x43')][_0x9baf('0x4a')]);_0x6c715b[_0x9baf('0x4b')]=qs[_0x9baf('0x4c')](_['pick'](_0x385bfc[_0x9baf('0x43')],_0x38eb7c['filters']));_0x6c715b['where'][_0x9baf('0x66')]=_0x4b9adf['id'];if(_0x385bfc[_0x9baf('0x43')]['filter']){_0x6c715b[_0x9baf('0x4b')]=_[_0x9baf('0x4f')](_0x6c715b[_0x9baf('0x4b')],{'$or':_[_0x9baf('0x42')](_0x6c715b[_0x9baf('0x46')],function(_0x1bac09){var _0x33c8fc={};_0x33c8fc[_0x1bac09]={'$like':'%'+_0x385bfc[_0x9baf('0x43')][_0x9baf('0x4e')]+'%'};return _0x33c8fc;})});}_0x6c715b=_['merge']({},_0x6c715b,_0x385bfc[_0x9baf('0x58')]);return db[_0x9baf('0x6c')]['count']({'where':_0x6c715b[_0x9baf('0x4b')]})[_0x9baf('0x1e')](function(_0x3f5656){_0x9e48a3[_0x9baf('0x2d')]=_0x3f5656;if(_0x385bfc[_0x9baf('0x43')][_0x9baf('0x52')]){_0x6c715b[_0x9baf('0x53')]=[{'all':!![]}];}return db[_0x9baf('0x6c')]['findAll'](_0x6c715b);})['then'](function(_0x1d14e2){_0x9e48a3[_0x9baf('0x54')]=_0x1d14e2;return _0x9e48a3;});}})[_0x9baf('0x1e')](respondWithFilteredResult(_0x58a17d,_0x6c715b))[_0x9baf('0x27')](handleError(_0x58a17d,null));};exports[_0x9baf('0x6f')]=function(_0xf3de2f,_0x2eb0e3,_0x45dc6a){return db['WhatsappAccount'][_0x9baf('0x59')]({'where':{'id':_0xf3de2f[_0x9baf('0x56')]['id']}})['then'](handleEntityNotFound(_0x2eb0e3,null))['then'](function(_0x167736){if(_0x167736){return _0x167736['removeAnswers'](_0xf3de2f['query'][_0x9baf('0x70')]);}})[_0x9baf('0x1e')](respondWithStatusCode(_0x2eb0e3,null))[_0x9baf('0x27')](handleError(_0x2eb0e3,null));};exports['addAgents']=function(_0x33a6ee,_0x54c914,_0x4ffddc){return db['WhatsappAccount'][_0x9baf('0x59')]({'where':{'id':_0x33a6ee[_0x9baf('0x56')]['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x54c914,null))['then'](function(_0x528ff7){if(_0x528ff7){return _0x528ff7[_0x9baf('0x71')](_0x33a6ee[_0x9baf('0x5b')][_0x9baf('0x70')],_[_0x9baf('0x72')](_0x33a6ee[_0x9baf('0x5b')],[_0x9baf('0x70'),'id'])||{})[_0x9baf('0x73')](function(_0x4437f5){for(var _0x165d78=0x0;_0x165d78<_0x33a6ee[_0x9baf('0x5b')]['ids'][_0x9baf('0x47')];_0x165d78+=0x1){socket[_0x9baf('0x74')](_0x9baf('0x75'),{'UserId':Number(_0x33a6ee['body'][_0x9baf('0x70')][_0x165d78]),'WhatsappAccountId':Number(_0x33a6ee[_0x9baf('0x56')]['id'])});}return _0x4437f5;});}})[_0x9baf('0x1e')](respondWithResult(_0x54c914,null))[_0x9baf('0x27')](handleError(_0x54c914,null));};exports['removeAgents']=function(_0x502100,_0x82bf,_0x16c8eb){return db[_0x9baf('0x51')][_0x9baf('0x59')]({'where':{'id':_0x502100['params']['id']}})['then'](handleEntityNotFound(_0x82bf,null))[_0x9baf('0x1e')](function(_0x4db056){if(_0x4db056){return _0x4db056[_0x9baf('0x76')](_0x502100[_0x9baf('0x43')]['ids'])[_0x9baf('0x1e')](function(){if(_[_0x9baf('0x77')](_0x502100['query']['ids'])){for(var _0x509a93=0x0;_0x509a93<_0x502100[_0x9baf('0x43')][_0x9baf('0x70')][_0x9baf('0x47')];_0x509a93+=0x1){socket[_0x9baf('0x74')](_0x9baf('0x78'),{'UserId':Number(_0x502100[_0x9baf('0x43')][_0x9baf('0x70')][_0x509a93]),'WhatsappAccountId':Number(_0x502100[_0x9baf('0x56')]['id'])});}}else{socket[_0x9baf('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x502100[_0x9baf('0x43')][_0x9baf('0x70')]),'WhatsappAccountId':Number(_0x502100[_0x9baf('0x56')]['id'])});}});}})[_0x9baf('0x1e')](respondWithStatusCode(_0x82bf,null))[_0x9baf('0x27')](handleError(_0x82bf,null));};exports['getAgents']=function(_0x2aedf7,_0x1062af,_0x2dad01){var _0x3fd2ec={};var _0x64f028={};var _0x16bc02;var _0x1866f7;return db[_0x9baf('0x51')]['findOne']({'where':{'id':_0x2aedf7[_0x9baf('0x56')]['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x1062af,null))[_0x9baf('0x1e')](function(_0x4c5135){if(_0x4c5135){_0x16bc02=_0x4c5135;_0x64f028[_0x9baf('0x41')]=_[_0x9baf('0x44')](db[_0x9baf('0x79')][_0x9baf('0x3e')]);_0x64f028[_0x9baf('0x43')]=_[_0x9baf('0x44')](_0x2aedf7[_0x9baf('0x43')]);_0x64f028[_0x9baf('0x4c')]=_[_0x9baf('0x57')](_0x64f028[_0x9baf('0x41')],_0x64f028[_0x9baf('0x43')]);_0x3fd2ec[_0x9baf('0x46')]=_[_0x9baf('0x57')](_0x64f028[_0x9baf('0x41')],qs[_0x9baf('0x45')](_0x2aedf7[_0x9baf('0x43')][_0x9baf('0x45')]));_0x3fd2ec[_0x9baf('0x46')]=_0x3fd2ec[_0x9baf('0x46')][_0x9baf('0x47')]?_0x3fd2ec[_0x9baf('0x46')]:_0x64f028[_0x9baf('0x41')];_0x3fd2ec['order']=qs['sort'](_0x2aedf7[_0x9baf('0x43')][_0x9baf('0x4a')]);_0x3fd2ec[_0x9baf('0x4b')]=qs[_0x9baf('0x4c')](_['pick'](_0x2aedf7[_0x9baf('0x43')],_0x64f028[_0x9baf('0x4c')]));if(_0x2aedf7[_0x9baf('0x43')][_0x9baf('0x4e')]){_0x3fd2ec[_0x9baf('0x4b')]=_[_0x9baf('0x4f')](_0x3fd2ec[_0x9baf('0x4b')],{'$or':_['map'](_0x3fd2ec[_0x9baf('0x46')],function(_0x57ede2){var _0x3e1c7d={};_0x3e1c7d[_0x57ede2]={'$like':'%'+_0x2aedf7['query'][_0x9baf('0x4e')]+'%'};return _0x3e1c7d;})});}_0x3fd2ec=_[_0x9baf('0x4f')]({},_0x3fd2ec,_0x2aedf7[_0x9baf('0x58')]);return _0x16bc02['getAgents'](_0x3fd2ec);}})[_0x9baf('0x1e')](function(_0x271be1){if(_0x271be1){_0x1866f7=_0x271be1['length'];if(!_0x2aedf7[_0x9baf('0x43')][_0x9baf('0x6e')](_0x9baf('0x48'))){_0x3fd2ec[_0x9baf('0x2e')]=qs['limit'](_0x2aedf7[_0x9baf('0x43')][_0x9baf('0x2e')]);_0x3fd2ec[_0x9baf('0x2b')]=qs[_0x9baf('0x2b')](_0x2aedf7[_0x9baf('0x43')][_0x9baf('0x2b')]);}return _0x16bc02[_0x9baf('0x7a')](_0x3fd2ec);}})[_0x9baf('0x1e')](function(_0x4cef63){if(_0x4cef63){return _0x4cef63?{'count':_0x1866f7,'rows':_0x4cef63}:null;}})[_0x9baf('0x1e')](respondWithResult(_0x1062af,null))[_0x9baf('0x27')](handleError(_0x1062af,null));};exports[_0x9baf('0x7b')]=function(_0x4f8dc1,_0xd17322){var _0x328d1c=_0x4f8dc1[_0x9baf('0x56')]['id'];var _0x5e3d9f=_0x4f8dc1[_0x9baf('0x5b')];var _0x414171=0xc8;var _0x1ffe02=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x9baf('0x7c')][_0x9baf('0x7d')][_0x9baf('0x7e')][_0x9baf('0x7f')]},function(_0x20c732){return db[_0x9baf('0x51')][_0x9baf('0x69')]({'where':{'id':_0x328d1c},'transaction':_0x20c732})['then'](function(_0x2a87fb){if(_0x2a87fb){return db[_0x9baf('0x80')][_0x9baf('0x35')]({'where':{'WhatsappAccountId':_0x328d1c},'transaction':_0x20c732})['then'](function(){var _0x257ac5=_[_0x9baf('0x42')](_0x5e3d9f,function(_0x1d8bb7){_0x1d8bb7[_0x9baf('0x66')]=_0x328d1c;return _0x1d8bb7;});return db[_0x9baf('0x80')][_0x9baf('0x81')](_0x257ac5,{'transaction':_0x20c732});});}else{_0x414171=0x194;_0x1ffe02=[];}});})[_0x9baf('0x1e')](function(){if(_0x414171!==0x194){return db[_0x9baf('0x80')][_0x9baf('0x82')]({'where':{'WhatsappAccountId':_0x328d1c},'order':'priority'})[_0x9baf('0x1e')](function(_0x50ac1f){_0x1ffe02=_0x50ac1f;});}})[_0x9baf('0x27')](function(_0x27b0bb){_0x414171=0x1f4;logger[_0x9baf('0x23')](_0x27b0bb[_0x9baf('0x39')]);if(_0x27b0bb[_0x9baf('0x3a')]){delete _0x27b0bb[_0x9baf('0x3a')];}_0x1ffe02=_0x27b0bb;})['finally'](function(){if(_0x1ffe02===null){_0xd17322[_0x9baf('0x28')](_0x414171);}else{if(_0x414171===0x1f4){_0xd17322['status'](_0x414171)[_0x9baf('0x3b')](_0x1ffe02);}else{_0xd17322[_0x9baf('0x29')](_0x414171)[_0x9baf('0x2a')](_0x1ffe02);}}});};exports[_0x9baf('0x83')]=function(_0x517ef6,_0x5c0930,_0x27549f){var _0x5ea070={};var _0x37449a={};var _0x4fcf9b;var _0x5604e5;return db[_0x9baf('0x51')][_0x9baf('0x69')]({'where':{'id':_0x517ef6['params']['id']}})[_0x9baf('0x1e')](handleEntityNotFound(_0x5c0930,null))[_0x9baf('0x1e')](function(_0xf1864b){if(_0xf1864b){_0x4fcf9b=_0xf1864b;_0x37449a[_0x9baf('0x41')]=_['keys'](db[_0x9baf('0x80')][_0x9baf('0x3e')]);_0x37449a['query']=_[_0x9baf('0x44')](_0x517ef6[_0x9baf('0x43')]);_0x37449a[_0x9baf('0x4c')]=_[_0x9baf('0x57')](_0x37449a[_0x9baf('0x41')],_0x37449a[_0x9baf('0x43')]);_0x5ea070['attributes']=_[_0x9baf('0x57')](_0x37449a[_0x9baf('0x41')],qs[_0x9baf('0x45')](_0x517ef6[_0x9baf('0x43')][_0x9baf('0x45')]));_0x5ea070[_0x9baf('0x46')]=_0x5ea070['attributes']['length']?_0x5ea070[_0x9baf('0x46')]:_0x37449a[_0x9baf('0x41')];_0x5ea070[_0x9baf('0x49')]=qs[_0x9baf('0x4a')](_0x517ef6['query'][_0x9baf('0x4a')]);_0x5ea070['where']=qs[_0x9baf('0x4c')](_[_0x9baf('0x4d')](_0x517ef6[_0x9baf('0x43')],_0x37449a[_0x9baf('0x4c')]));if(_0x517ef6[_0x9baf('0x43')][_0x9baf('0x4e')]){_0x5ea070[_0x9baf('0x4b')]=_['merge'](_0x5ea070[_0x9baf('0x4b')],{'$or':_[_0x9baf('0x42')](_0x5ea070[_0x9baf('0x46')],function(_0x41f365){var _0x12dc61={};_0x12dc61[_0x41f365]={'$like':'%'+_0x517ef6[_0x9baf('0x43')]['filter']+'%'};return _0x12dc61;})});}_0x5ea070=_['merge']({},_0x5ea070,_0x517ef6[_0x9baf('0x58')]);return _0x4fcf9b[_0x9baf('0x83')](_0x5ea070);}})[_0x9baf('0x1e')](function(_0x525448){if(_0x525448){_0x5604e5=_0x525448[_0x9baf('0x47')];if(!_0x517ef6[_0x9baf('0x43')]['hasOwnProperty']('nolimit')){_0x5ea070['limit']=qs[_0x9baf('0x2e')](_0x517ef6[_0x9baf('0x43')][_0x9baf('0x2e')]);_0x5ea070[_0x9baf('0x2b')]=qs['offset'](_0x517ef6[_0x9baf('0x43')][_0x9baf('0x2b')]);}return _0x4fcf9b[_0x9baf('0x83')](_0x5ea070);}})[_0x9baf('0x1e')](function(_0x10b7f3){if(_0x10b7f3){return _0x10b7f3?{'count':_0x5604e5,'rows':_0x10b7f3}:null;}})[_0x9baf('0x1e')](respondWithResult(_0x5c0930,null))['catch'](handleError(_0x5c0930,null));};exports[_0x9baf('0x84')]=function(_0x549d98,_0x16c9b8,_0x507817){var _0x6c4474={'channel':'whatsapp'};var _0x54bab1=[];var _0x32c9ef=[];var _0x3cb6d4={};return db['WhatsappAccount'][_0x9baf('0x59')]({'where':{'id':_0x549d98[_0x9baf('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9baf('0x85')}]})[_0x9baf('0x1e')](handleEntityNotFound(_0x16c9b8,null))['then'](function(_0x1341e7){_0x6c4474[_0x9baf('0x86')]=_0x1341e7;if(_0x6c4474[_0x9baf('0x86')]&&_0x6c4474['account']['type']==='sinch'&&_0x549d98[_0x9baf('0x5b')][_0x9baf('0x87')]){if(_0x549d98['body'][_0x9baf('0x87')][_0x9baf('0x47')]===0x0)return;if(_0x549d98['body']['statuses'][0x0]['state']!==_0x9baf('0x88'))return;return db[_0x9baf('0x89')][_0x9baf('0x34')]({'read':!![],'readAt':_0x549d98[_0x9baf('0x5b')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x549d98[_0x9baf('0x5b')][_0x9baf('0x87')][0x0][_0x9baf('0x8a')]},'individualHooks':!![]})[_0x9baf('0x1e')](function(_0x56df7b){return _0x16c9b8['status'](0xc8)['json'](_0x56df7b);});}_0x6c4474['applications']=_[_0x9baf('0x8b')](_0x1341e7['Applications'],[_0x9baf('0x8c')],['asc']);if(_0x6c4474[_0x9baf('0x86')][_0x9baf('0x85')]){delete _0x6c4474[_0x9baf('0x86')]['Applications'];}return db[_0x9baf('0x8d')][_0x9baf('0x64')]()['then'](function(_0x1c1024){if(!_0x1c1024){throw new db['Sequelize'][(_0x9baf('0x8e'))](_0x9baf('0x8f'));}_0x54bab1=_['difference'](_['keys'](_0x1c1024),[_0x9baf('0x90'),_0x9baf('0x91')]);_0x32c9ef=_[_0x9baf('0x92')](_[_0x9baf('0x44')](_0x1c1024),[_0x9baf('0x90'),'updatedAt',_0x9baf('0x93'),'ListId']);_0x6c4474['body']={'mapKey':_0x9baf('0x94')};if(_0x6c4474[_0x9baf('0x86')]&&_0x6c4474[_0x9baf('0x86')][_0x9baf('0x40')]===_0x9baf('0x95')){_0x6c4474['body'][_0x9baf('0x96')]=_0x549d98[_0x9baf('0x5b')][_0x9baf('0x97')]['replace']('whatsapp:','');_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x5b')]=_0x549d98[_0x9baf('0x5b')]['Body'];_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x98')]=_0x549d98[_0x9baf('0x5b')][_0x9baf('0x99')];}if(_0x6c4474[_0x9baf('0x86')]&&_0x6c4474[_0x9baf('0x86')][_0x9baf('0x40')]===_0x9baf('0x9a')){_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x96')]=_0x549d98['body']['notifications'][0x0][_0x9baf('0x96')];_0x6c4474['body'][_0x9baf('0x5b')]=_0x549d98[_0x9baf('0x5b')][_0x9baf('0x9b')][0x0][_0x9baf('0x25')][_0x9baf('0x5b')];_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x98')]=_0x549d98[_0x9baf('0x5b')][_0x9baf('0x9b')][0x0]['message_id'];}if(_0x6c4474[_0x9baf('0x5b')]['id']){delete _0x6c4474['body']['id'];}if(_[_0x9baf('0x9c')](_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x96')])){throw new db[(_0x9baf('0x9d'))][(_0x9baf('0x8e'))](_0x9baf('0x9e'));}if(_['isNil'](_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x5b')])||_0x6c4474['body'][_0x9baf('0x5b')]===''){throw new db['Sequelize'][(_0x9baf('0x8e'))](_0x9baf('0x9f'));}if(_[_0x9baf('0x9c')](_0x6c4474[_0x9baf('0x5b')][_0x9baf('0xa0')])){throw new db['Sequelize']['ValidationError'](_0x9baf('0xa1')+_0x32c9ef);}if(!_['includes'](_0x32c9ef,_0x6c4474['body'][_0x9baf('0xa0')])){throw new db[(_0x9baf('0x9d'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32c9ef);}_0x3cb6d4[_0x6c4474[_0x9baf('0x5b')][_0x9baf('0xa0')]]=_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x96')];return db[_0x9baf('0xa2')][_0x9baf('0x59')]({'where':{'id':_0x6c4474[_0x9baf('0x86')][_0x9baf('0xa3')]},'include':[{'model':db[_0x9baf('0x8d')],'as':'Contacts','where':_0x3cb6d4,'limit':0x1,'order':[[_0x9baf('0x91'),_0x9baf('0xa4')]]}]});})['then'](handleEntityNotFound(_0x16c9b8,null))[_0x9baf('0x1e')](function(_0x591f38){if(_0x591f38){_0x6c4474['list']=_[_0x9baf('0x72')](_0x591f38,['Contacts']);if(_0x591f38[_0x9baf('0xa5')][_0x9baf('0x47')]){return _0x591f38['Contacts'][0x0];}var _0x1859ef=_['defaults'](_0x6c4474['body'],{'firstName':_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x96')],'ListId':_0x591f38['id']});_0x1859ef[_0x6c4474[_0x9baf('0x5b')][_0x9baf('0xa0')]]=_0x6c4474['body'][_0x9baf('0x96')];return db['CmContact'][_0x9baf('0x5a')](_0x1859ef,{'fields':_0x54bab1,'raw':!![]});}})['then'](handleEntityNotFound(_0x16c9b8,null))[_0x9baf('0x1e')](function(_0x183c02){if(_0x183c02){_0x6c4474[_0x9baf('0xa6')]=_0x183c02;var _0x4e706c={'ContactId':_0x183c02['id'],'phone':_0x6c4474[_0x9baf('0x5b')]['from'],'WhatsappAccountId':_0x549d98['params']['id']};var _0x148a5c={'ContactId':_0x183c02['id'],'WhatsappAccountId':_0x549d98['params']['id'],'closed':![]};return db[_0x9baf('0xa7')][_0x9baf('0x59')]({'where':_0x148a5c})['then'](function(_0x3bdea1){if(_0x3bdea1){return[_0x3bdea1,![]];}return db[_0x9baf('0xa7')][_0x9baf('0x5a')](_0x4e706c)['then'](function(_0x348962){return[_0x348962,!![]];});});}})['spread'](function(_0x97116b,_0xca69a2){_0x6c4474[_0x9baf('0xa8')]=_0x97116b[_0x9baf('0x36')]({'plain':!![]});_0x6c4474[_0x9baf('0xa8')][_0x9baf('0xa9')]=![];if(_0xca69a2){if(_0x6c4474[_0x9baf('0x86')][_0x9baf('0xaa')]){_0x6c4474[_0x9baf('0xab')][_0x9baf('0xac')]({'id':0x0,'priority':_0x6c4474[_0x9baf('0xab')][_0x9baf('0x47')]+0x1,'app':_0x9baf('0xad'),'appdata':_0x9baf('0xae'),'interval':_0x9baf('0xaf')});}_0x6c4474[_0x9baf('0xa8')][_0x9baf('0xa9')]=!![];}return db[_0x9baf('0x89')][_0x9baf('0x5a')]({'phone':_0x6c4474['body'][_0x9baf('0x96')],'messageId':_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x98')],'body':_0x6c4474[_0x9baf('0x5b')][_0x9baf('0x5b')],'WhatsappAccountId':_0x549d98[_0x9baf('0x56')]['id'],'WhatsappInteractionId':_0x97116b['id'],'direction':'in','ContactId':_0x97116b[_0x9baf('0xb0')],'AttachmentId':_0x6c4474[_0x9baf('0x5b')][_0x9baf('0xb1')]});})['then'](function(_0x10373d){_0x6c4474[_0x9baf('0x25')]=_0x10373d;if(_0x6c4474[_0x9baf('0xa8')][_0x9baf('0xb2')]){return db[_0x9baf('0x79')]['find']({'attributes':['id',_0x9baf('0x3a')],'where':{'id':_0x6c4474[_0x9baf('0xa8')][_0x9baf('0xb2')]}})[_0x9baf('0x1e')](function(_0x331c3e){if(_0x331c3e){_0x6c4474[_0x9baf('0xab')][_0x9baf('0xb3')]({'id':0x0,'priority':0x0,'app':_0x9baf('0xb4'),'appdata':_0x331c3e['name']+','+(_0x6c4474[_0x9baf('0x86')][_0x9baf('0xb5')]||0xa),'interval':_0x9baf('0xaf')});}return respondWithRpcPromise(_0x9baf('0xb6'),_0x9baf('0xb7'),_0x6c4474);});}return respondWithRpcPromise('Start',_0x9baf('0xb7'),_0x6c4474);})['then'](function(_0x488811){if(_0x488811){var _0x2dedd8=0xc8;var _0x4f3309='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4f3309,_0x2dedd8,_0x9baf('0xb8'));logger[_0x9baf('0x20')](_0x9baf('0xb9'),_0x4f3309,_0x2dedd8,_0x9baf('0xb8'),JSON[_0x9baf('0x22')](_0x488811));if(_0x6c4474[_0x9baf('0x86')][_0x9baf('0x40')]===_0x9baf('0x95')){return _0x16c9b8['status'](_0x2dedd8)['set'](_0x9baf('0xba'),'text/xml')[_0x9baf('0x3b')]('\x0a');}else{return _0x16c9b8[_0x9baf('0x29')](_0x2dedd8)[_0x9baf('0x2a')](_0x488811);}}});})['catch'](handleError(_0x16c9b8,null));};exports[_0x9baf('0x3b')]=function(_0xf61a4,_0x47cab6,_0x23eccd){var _0x55e195,_0x5a4bda,_0x352f9f;if(_[_0x9baf('0x9c')](_0xf61a4[_0x9baf('0x5b')]['body'])||_0xf61a4[_0x9baf('0x5b')][_0x9baf('0x5b')]===''){throw new db[(_0x9baf('0x9d'))][(_0x9baf('0x8e'))](_0x9baf('0x9f'));}if(_['isNil'](_0xf61a4['body']['to'])){throw new db[(_0x9baf('0x9d'))][(_0x9baf('0x8e'))](_0x9baf('0xbb'));}_0x55e195=_0xf61a4[_0x9baf('0x5b')]['to'];return db[_0x9baf('0x51')][_0x9baf('0x59')]({'where':{'id':_0xf61a4['params']['id']},'include':[{'model':db[_0x9baf('0xa2')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9baf('0xa5'),'where':{'mobile':_0x55e195},'limit':0x1,'order':[[_0x9baf('0x91'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x47cab6,null))[_0x9baf('0x1e')](function(_0x1012b6){if(_0x1012b6&&_0x1012b6['List']){_0x5a4bda=_0x1012b6[_0x9baf('0x36')]({'plain':!![]});if(_0x5a4bda[_0x9baf('0xbc')]&&_0x5a4bda['List'][_0x9baf('0xa5')][_0x9baf('0x47')]){return _0x5a4bda[_0x9baf('0xbc')]['Contacts'][0x0];}return db[_0x9baf('0x8d')]['create'](_['defaults'](_0xf61a4[_0x9baf('0x5b')],{'firstName':_0x55e195,'mobile':_0x55e195,'phone':_0x55e195,'ListId':_0x5a4bda[_0x9baf('0xa3')]}));}})[_0x9baf('0x1e')](handleEntityNotFound(_0x47cab6,null))[_0x9baf('0x1e')](function(_0x4c144f){if(_0x4c144f){_0x352f9f=_0x4c144f;return db[_0x9baf('0xa7')][_0x9baf('0x59')]({'where':{'ContactId':_0x352f9f['id'],'closed':![],'WhatsappAccountId':_0x5a4bda['id']}})[_0x9baf('0x1e')](function(_0x33dbab){if(_0x33dbab){return[_0x33dbab,![]];}return db[_0x9baf('0xa7')][_0x9baf('0x5a')]({'UserId':_0xf61a4[_0x9baf('0x5c')]['id'],'ContactId':_0x352f9f['id'],'WhatsappAccountId':_0x5a4bda['id'],'phone':_0x55e195,'firstMsgDirection':_0x9baf('0xbd'),'Messages':[_[_0x9baf('0x4f')](_0xf61a4[_0x9baf('0x5b')],{'read':![],'body':_0xf61a4[_0x9baf('0x5b')][_0x9baf('0x5b')],'phone':_0x55e195,'WhatsappAccountId':_0x5a4bda['id'],'UserId':_0xf61a4['user']['id'],'ContactId':_0x352f9f['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x9baf('0xbe')}]})['then'](function(_0x18d283){return[_0x18d283,!![]];});});}})[_0x9baf('0x73')](function(_0x30c157,_0x11883e){if(_0x11883e){return _0x30c157;}return db[_0x9baf('0x89')][_0x9baf('0x5a')](_[_0x9baf('0x4f')](_0xf61a4[_0x9baf('0x5b')],{'read':![],'body':_0xf61a4[_0x9baf('0x5b')][_0x9baf('0x5b')],'phone':_0x55e195,'WhatsappAccountId':_0x5a4bda['id'],'WhatsappInteractionId':_0x30c157['id'],'UserId':_0xf61a4['user']['id'],'ContactId':_0x352f9f['id']}))[_0x9baf('0x1e')](function(_0x117705){_0x30c157[_0x9baf('0xbf')][_0x9baf('0xbe')]=[];_0x30c157[_0x9baf('0xbf')][_0x9baf('0xbe')][_0x9baf('0xac')](_0x117705['dataValues']);return _0x30c157;});})[_0x9baf('0x1e')](respondWithResult(_0x47cab6,null))[_0x9baf('0x27')](handleError(_0x47cab6,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 7c5b68a..e150d97 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 _0x5848=['hook','exports','events','../../mysqldb','WhatsappAccount','save','update','emit','hasOwnProperty'];(function(_0x5371a6,_0x36c2fd){var _0x4b0ba9=function(_0x581404){while(--_0x581404){_0x5371a6['push'](_0x5371a6['shift']());}};_0x4b0ba9(++_0x36c2fd);}(_0x5848,0x12b));var _0x8584=function(_0x9456d8,_0x26de9c){_0x9456d8=_0x9456d8-0x0;var _0x4f8156=_0x5848[_0x9456d8];return _0x4f8156;};'use strict';var EventEmitter=require(_0x8584('0x0'));var WhatsappAccount=require(_0x8584('0x1'))['db'][_0x8584('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8584('0x3'),'afterUpdate':_0x8584('0x4'),'afterDestroy':'remove'};function emitEvent(_0x405d7c){return function(_0x3c6aa1,_0x446b77,_0x51a952){WhatsappAccountEvents[_0x8584('0x5')](_0x405d7c+':'+_0x3c6aa1['id'],_0x3c6aa1);WhatsappAccountEvents['emit'](_0x405d7c,_0x3c6aa1);_0x51a952(null);};}for(var e in events){if(events[_0x8584('0x6')](e)){var event=events[e];WhatsappAccount[_0x8584('0x7')](e,emitEvent(event));}}module[_0x8584('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xcb4b=['emit','hasOwnProperty','hook','exports','WhatsappAccount','save','update','remove'];(function(_0x407b07,_0x525c69){var _0x2c9b12=function(_0x54b368){while(--_0x54b368){_0x407b07['push'](_0x407b07['shift']());}};_0x2c9b12(++_0x525c69);}(_0xcb4b,0x15c));var _0xbcb4=function(_0x21555b,_0x395b17){_0x21555b=_0x21555b-0x0;var _0x38b245=_0xcb4b[_0x21555b];return _0x38b245;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xbcb4('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbcb4('0x1'),'afterUpdate':_0xbcb4('0x2'),'afterDestroy':_0xbcb4('0x3')};function emitEvent(_0x37944e){return function(_0x949cde,_0x238cb3,_0x82eee4){WhatsappAccountEvents[_0xbcb4('0x4')](_0x37944e+':'+_0x949cde['id'],_0x949cde);WhatsappAccountEvents['emit'](_0x37944e,_0x949cde);_0x82eee4(null);};}for(var e in events){if(events[_0xbcb4('0x5')](e)){var event=events[e];WhatsappAccount[_0xbcb4('0x6')](e,emitEvent(event));}}module[_0xbcb4('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 2d9e874..c9e360c 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 _0x8f2c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8f2c,0x9a));var _0xc8f2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8f2c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc8f2('0x0'));var util=require(_0xc8f2('0x1'));var logger=require(_0xc8f2('0x2'))(_0xc8f2('0x3'));var moment=require(_0xc8f2('0x4'));var BPromise=require(_0xc8f2('0x5'));var rp=require(_0xc8f2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8f2('0x7'));var config=require(_0xc8f2('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0xc8f2('0x9')]=function(_0x19db2c,_0x3f521c){return _0x19db2c[_0xc8f2('0xa')](_0xc8f2('0xb'),attributes,{'tableName':_0xc8f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8fc=['./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4f56e9,_0x3b6f07){var _0x4a0927=function(_0x41a210){while(--_0x41a210){_0x4f56e9['push'](_0x4f56e9['shift']());}};_0x4a0927(++_0x3b6f07);}(_0xb8fc,0x133));var _0xcb8f=function(_0x3c95e5,_0x31bfb7){_0x3c95e5=_0x3c95e5-0x0;var _0x161528=_0xb8fc[_0x3c95e5];return _0x161528;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcb8f('0x0'))(_0xcb8f('0x1'));var moment=require(_0xcb8f('0x2'));var BPromise=require(_0xcb8f('0x3'));var rp=require(_0xcb8f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb8f('0x5'));module['exports']=function(_0x300d7b,_0x4d69d3){return _0x300d7b['define'](_0xcb8f('0x6'),attributes,{'tableName':_0xcb8f('0x7'),'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 6d46e85..69f967f 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 _0x5ba6=['register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','map','model','attributes','lodash','util','ioredis','../../config/logger','rpc','redis','localhost','socket.io-emitter'];(function(_0x1af32b,_0xc52507){var _0x5d505e=function(_0x1e670b){while(--_0x1e670b){_0x1af32b['push'](_0x1af32b['shift']());}};_0x5d505e(++_0xc52507);}(_0x5ba6,0x17e));var _0x65ba=function(_0x393a6a,_0x2c9220){_0x393a6a=_0x393a6a-0x0;var _0x53a06c=_0x5ba6[_0x393a6a];return _0x53a06c;};'use strict';var _=require(_0x65ba('0x0'));var util=require(_0x65ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x65ba('0x3'))(_0x65ba('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x65ba('0x5')],{'host':_0x65ba('0x6'),'port':0x18eb});var socket=require(_0x65ba('0x7'))(new Redis(config[_0x65ba('0x5')]));require('./whatsappAccount.socket')[_0x65ba('0x8')](socket);function respondWithRpcPromise(_0x361fde,_0x2bf475,_0x27f122){return new BPromise(function(_0x5a97de,_0x44f1b3){return client[_0x65ba('0x9')](_0x361fde,_0x27f122)[_0x65ba('0xa')](function(_0x5062d5){logger[_0x65ba('0xb')](_0x65ba('0xc'),_0x2bf475,'request\x20sent');logger[_0x65ba('0xd')](_0x65ba('0xe'),_0x2bf475,_0x65ba('0xf'),JSON[_0x65ba('0x10')](_0x5062d5));if(_0x5062d5[_0x65ba('0x11')]){if(_0x5062d5['error'][_0x65ba('0x12')]===0x1f4){logger[_0x65ba('0x11')](_0x65ba('0xc'),_0x2bf475,_0x5062d5['error'][_0x65ba('0x13')]);return _0x44f1b3(_0x5062d5['error']['message']);}logger['error'](_0x65ba('0xc'),_0x2bf475,_0x5062d5[_0x65ba('0x11')][_0x65ba('0x13')]);return _0x5a97de(_0x5062d5['error'][_0x65ba('0x13')]);}else{logger[_0x65ba('0xb')](_0x65ba('0xc'),_0x2bf475,_0x65ba('0xf'));_0x5a97de(_0x5062d5['result'][_0x65ba('0x13')]);}})[_0x65ba('0x14')](function(_0x24eee7){logger[_0x65ba('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x2bf475,_0x24eee7);_0x44f1b3(_0x24eee7);});});}exports[_0x65ba('0x15')]=function(_0x13bbbb){var _0x3c2663=this;return new Promise(function(_0x460ca3,_0x10692c){return db[_0x65ba('0x16')]['find']({'raw':_0x13bbbb[_0x65ba('0x17')]?_0x13bbbb[_0x65ba('0x17')][_0x65ba('0x18')]===undefined?!![]:![]:!![],'where':_0x13bbbb[_0x65ba('0x17')]?_0x13bbbb[_0x65ba('0x17')][_0x65ba('0x19')]||null:null,'attributes':_0x13bbbb[_0x65ba('0x17')]?_0x13bbbb['options']['attributes']||null:null,'include':_0x13bbbb[_0x65ba('0x17')]?_0x13bbbb['options'][_0x65ba('0x1a')]?_['map'](_0x13bbbb[_0x65ba('0x17')][_0x65ba('0x1a')],function(_0x1e3f07){return{'model':db[_0x1e3f07['model']],'as':_0x1e3f07['as'],'attributes':_0x1e3f07['attributes'],'include':_0x1e3f07['include']?_[_0x65ba('0x1b')](_0x1e3f07[_0x65ba('0x1a')],function(_0x5df0ef){return{'model':db[_0x5df0ef[_0x65ba('0x1c')]],'as':_0x5df0ef['as'],'attributes':_0x5df0ef['attributes'],'include':_0x5df0ef[_0x65ba('0x1a')]?_[_0x65ba('0x1b')](_0x5df0ef[_0x65ba('0x1a')],function(_0x5ebc61){return{'model':db[_0x5ebc61[_0x65ba('0x1c')]],'as':_0x5ebc61['as'],'attributes':_0x5ebc61[_0x65ba('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x65ba('0xa')](function(_0x70821){logger[_0x65ba('0xb')](_0x65ba('0x15'),_0x13bbbb);logger['debug'](_0x65ba('0x15'),_0x13bbbb,JSON[_0x65ba('0x10')](_0x70821));_0x460ca3(_0x70821);})[_0x65ba('0x14')](function(_0x6d99b){logger[_0x65ba('0x11')]('ShowWhatsappAccount',_0x6d99b[_0x65ba('0x13')],_0x13bbbb);_0x10692c(_0x3c2663[_0x65ba('0x11')](0x1f4,_0x6d99b['message']));});});}; \ No newline at end of file +var _0x560e=['redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','find','options','raw','where','include','map','model','attributes','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x502e15,_0x49ff8f){var _0xadd0c4=function(_0xa1776){while(--_0xa1776){_0x502e15['push'](_0x502e15['shift']());}};_0xadd0c4(++_0x49ff8f);}(_0x560e,0x1ee));var _0xe560=function(_0x42457c,_0x5a3e3c){_0x42457c=_0x42457c-0x0;var _0xbef868=_0x560e[_0x42457c];return _0xbef868;};'use strict';var _=require(_0xe560('0x0'));var util=require(_0xe560('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe560('0x2'))['db'];var utils=require(_0xe560('0x3'));var logger=require(_0xe560('0x4'))(_0xe560('0x5'));var config=require(_0xe560('0x6'));var jayson=require(_0xe560('0x7'));var client=jayson['client'][_0xe560('0x8')]({'port':0x232a});config['redis']=_[_0xe560('0x9')](config[_0xe560('0xa')],{'host':_0xe560('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe560('0xa')]));require(_0xe560('0xc'))[_0xe560('0xd')](socket);function respondWithRpcPromise(_0x4bd420,_0x3c324b,_0x290f5f){return new BPromise(function(_0xf1979d,_0x6e52b2){return client[_0xe560('0xe')](_0x4bd420,_0x290f5f)[_0xe560('0xf')](function(_0x58ea8c){logger[_0xe560('0x10')](_0xe560('0x11'),_0x3c324b,_0xe560('0x12'));logger[_0xe560('0x13')](_0xe560('0x14'),_0x3c324b,'request\x20sent',JSON[_0xe560('0x15')](_0x58ea8c));if(_0x58ea8c[_0xe560('0x16')]){if(_0x58ea8c[_0xe560('0x16')][_0xe560('0x17')]===0x1f4){logger[_0xe560('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x3c324b,_0x58ea8c['error'][_0xe560('0x18')]);return _0x6e52b2(_0x58ea8c['error'][_0xe560('0x18')]);}logger[_0xe560('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x3c324b,_0x58ea8c[_0xe560('0x16')][_0xe560('0x18')]);return _0xf1979d(_0x58ea8c['error'][_0xe560('0x18')]);}else{logger[_0xe560('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3c324b,_0xe560('0x12'));_0xf1979d(_0x58ea8c[_0xe560('0x19')][_0xe560('0x18')]);}})['catch'](function(_0x9f83fe){logger[_0xe560('0x16')](_0xe560('0x11'),_0x3c324b,_0x9f83fe);_0x6e52b2(_0x9f83fe);});});}exports[_0xe560('0x1a')]=function(_0x24819e){var _0x12dde6=this;return new Promise(function(_0x2d0cea,_0x5e3832){return db['WhatsappAccount'][_0xe560('0x1b')]({'raw':_0x24819e['options']?_0x24819e[_0xe560('0x1c')][_0xe560('0x1d')]===undefined?!![]:![]:!![],'where':_0x24819e[_0xe560('0x1c')]?_0x24819e[_0xe560('0x1c')][_0xe560('0x1e')]||null:null,'attributes':_0x24819e[_0xe560('0x1c')]?_0x24819e[_0xe560('0x1c')]['attributes']||null:null,'include':_0x24819e[_0xe560('0x1c')]?_0x24819e[_0xe560('0x1c')][_0xe560('0x1f')]?_[_0xe560('0x20')](_0x24819e[_0xe560('0x1c')][_0xe560('0x1f')],function(_0x52b91e){return{'model':db[_0x52b91e[_0xe560('0x21')]],'as':_0x52b91e['as'],'attributes':_0x52b91e[_0xe560('0x22')],'include':_0x52b91e['include']?_[_0xe560('0x20')](_0x52b91e['include'],function(_0x1dd675){return{'model':db[_0x1dd675[_0xe560('0x21')]],'as':_0x1dd675['as'],'attributes':_0x1dd675['attributes'],'include':_0x1dd675[_0xe560('0x1f')]?_[_0xe560('0x20')](_0x1dd675[_0xe560('0x1f')],function(_0x4908ca){return{'model':db[_0x4908ca[_0xe560('0x21')]],'as':_0x4908ca['as'],'attributes':_0x4908ca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x346c35){logger[_0xe560('0x10')]('ShowWhatsappAccount',_0x24819e);logger[_0xe560('0x13')](_0xe560('0x1a'),_0x24819e,JSON[_0xe560('0x15')](_0x346c35));_0x2d0cea(_0x346c35);})[_0xe560('0x23')](function(_0x3c5123){logger[_0xe560('0x16')]('ShowWhatsappAccount',_0x3c5123[_0xe560('0x18')],_0x24819e);_0x5e3832(_0x12dde6['error'](0x1f4,_0x3c5123[_0xe560('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 24ff247..9b6ab67 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 _0xcc63=['save','remove','update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0xb41d14,_0x1c8e65){var _0x37f43f=function(_0x4cdb2e){while(--_0x4cdb2e){_0xb41d14['push'](_0xb41d14['shift']());}};_0x37f43f(++_0x1c8e65);}(_0xcc63,0xe7));var _0x3cc6=function(_0x299fa8,_0x3a09ee){_0x299fa8=_0x299fa8-0x0;var _0x32619d=_0xcc63[_0x299fa8];return _0x32619d;};'use strict';var WhatsappAccountEvents=require(_0x3cc6('0x0'));var events=[_0x3cc6('0x1'),_0x3cc6('0x2'),_0x3cc6('0x3')];function createListener(_0x3a24de,_0x3e663a){return function(_0x59e5c7){_0x3e663a['emit'](_0x3a24de,_0x59e5c7);};}function removeListener(_0x237e07,_0x4e4b3c){return function(){WhatsappAccountEvents[_0x3cc6('0x4')](_0x237e07,_0x4e4b3c);};}exports[_0x3cc6('0x5')]=function(_0x567dc4){for(var _0x61677b=0x0,_0x59e2dd=events[_0x3cc6('0x6')];_0x61677b<_0x59e2dd;_0x61677b++){var _0x3f3961=events[_0x61677b];var _0x4ca222=createListener(_0x3cc6('0x7')+_0x3f3961,_0x567dc4);WhatsappAccountEvents['on'](_0x3f3961,_0x4ca222);}}; \ No newline at end of file +var _0xed27=['emit','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x104d11,_0x5021ef){var _0x589063=function(_0x42d576){while(--_0x42d576){_0x104d11['push'](_0x104d11['shift']());}};_0x589063(++_0x5021ef);}(_0xed27,0x160));var _0x7ed2=function(_0x4cfbba,_0x43955d){_0x4cfbba=_0x4cfbba-0x0;var _0x597047=_0xed27[_0x4cfbba];return _0x597047;};'use strict';var WhatsappAccountEvents=require(_0x7ed2('0x0'));var events=[_0x7ed2('0x1'),'remove','update'];function createListener(_0x3e4455,_0x152d43){return function(_0x3452b6){_0x152d43[_0x7ed2('0x2')](_0x3e4455,_0x3452b6);};}function removeListener(_0xefba4a,_0x44ea9c){return function(){WhatsappAccountEvents['removeListener'](_0xefba4a,_0x44ea9c);};}exports[_0x7ed2('0x3')]=function(_0x162fb6){for(var _0x3ddca2=0x0,_0x1f24ef=events[_0x7ed2('0x4')];_0x3ddca2<_0x1f24ef;_0x3ddca2++){var _0x252ca0=events[_0x3ddca2];var _0x1c11ff=createListener(_0x7ed2('0x5')+_0x252ca0,_0x162fb6);WhatsappAccountEvents['on'](_0x252ca0,_0x1c11ff);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e2ca1c8..05f50f6 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 _0x72b4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x568bde,_0x11c1f9){var _0x47f444=function(_0x20edf4){while(--_0x20edf4){_0x568bde['push'](_0x568bde['shift']());}};_0x47f444(++_0x11c1f9);}(_0x72b4,0xe1));var _0x472b=function(_0x11c06e,_0x1cb9c7){_0x11c06e=_0x11c06e-0x0;var _0x20a7dc=_0x72b4[_0x11c06e];return _0x20a7dc;};'use strict';var multer=require('multer');var util=require(_0x472b('0x0'));var path=require(_0x472b('0x1'));var timeout=require(_0x472b('0x2'));var express=require(_0x472b('0x3'));var router=express[_0x472b('0x4')]();var fs_extra=require(_0x472b('0x5'));var auth=require(_0x472b('0x6'));var interaction=require(_0x472b('0x7'));var config=require('../../config/environment');var controller=require(_0x472b('0x8'));router[_0x472b('0x9')]('/',auth['isAuthenticated'](),controller[_0x472b('0xa')]);router[_0x472b('0x9')](_0x472b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x472b('0xc')]('/',auth[_0x472b('0xd')](),controller[_0x472b('0xe')]);router[_0x472b('0xf')](_0x472b('0xb'),auth[_0x472b('0xd')](),controller[_0x472b('0x10')]);router[_0x472b('0x11')](_0x472b('0xb'),auth['isAuthenticated'](),controller[_0x472b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7e47=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x3cdd83,_0x4c9216){var _0x139a73=function(_0x26b975){while(--_0x26b975){_0x3cdd83['push'](_0x3cdd83['shift']());}};_0x139a73(++_0x4c9216);}(_0x7e47,0x1b9));var _0x77e4=function(_0x18bf12,_0x13f065){_0x18bf12=_0x18bf12-0x0;var _0x4b96a7=_0x7e47[_0x18bf12];return _0x4b96a7;};'use strict';var multer=require(_0x77e4('0x0'));var util=require('util');var path=require(_0x77e4('0x1'));var timeout=require(_0x77e4('0x2'));var express=require(_0x77e4('0x3'));var router=express[_0x77e4('0x4')]();var fs_extra=require(_0x77e4('0x5'));var auth=require(_0x77e4('0x6'));var interaction=require(_0x77e4('0x7'));var config=require(_0x77e4('0x8'));var controller=require('./whatsappApplication.controller');router[_0x77e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x77e4('0xa')]);router[_0x77e4('0x9')](_0x77e4('0xb'),auth[_0x77e4('0xc')](),controller[_0x77e4('0xd')]);router[_0x77e4('0xe')]('/',auth[_0x77e4('0xc')](),controller[_0x77e4('0xf')]);router[_0x77e4('0x10')]('/:id',auth[_0x77e4('0xc')](),controller[_0x77e4('0x11')]);router[_0x77e4('0x12')]('/:id',auth[_0x77e4('0xc')](),controller[_0x77e4('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3620e28..662db4a 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 _0x0618=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x8eff8e,_0x240bf1){var _0x347a47=function(_0x44035d){while(--_0x44035d){_0x8eff8e['push'](_0x8eff8e['shift']());}};_0x347a47(++_0x240bf1);}(_0x0618,0xf2));var _0x8061=function(_0xb42ec7,_0x4a0132){_0xb42ec7=_0xb42ec7-0x0;var _0x5824d5=_0x0618[_0xb42ec7];return _0x5824d5;};'use strict';var Sequelize=require('sequelize');module[_0x8061('0x0')]={'priority':{'type':Sequelize[_0x8061('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8061('0x2')],'allowNull':![],'defaultValue':_0x8061('0x3')},'appdata':{'type':Sequelize[_0x8061('0x4')]()},'description':{'type':Sequelize[_0x8061('0x2')]},'interval':{'type':Sequelize[_0x8061('0x2')],'defaultValue':_0x8061('0x5')}}; \ No newline at end of file +var _0x8091=['INTEGER','TEXT','STRING','*,*,*,*','exports'];(function(_0x13c359,_0xa60cee){var _0x16b7c2=function(_0x548077){while(--_0x548077){_0x13c359['push'](_0x13c359['shift']());}};_0x16b7c2(++_0xa60cee);}(_0x8091,0x16c));var _0x1809=function(_0x20995b,_0x594b67){_0x20995b=_0x20995b-0x0;var _0x27fcb1=_0x8091[_0x20995b];return _0x27fcb1;};'use strict';var Sequelize=require('sequelize');module[_0x1809('0x0')]={'priority':{'type':Sequelize[_0x1809('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1809('0x2')]()},'description':{'type':Sequelize[_0x1809('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1809('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 8a9ab9f..16a02ad 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 _0x7ebb=['destroy','error','stack','name','send','index','WhatsappApplication','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x5a13e1,_0x437c63){var _0x2046f5=function(_0x55de17){while(--_0x55de17){_0x5a13e1['push'](_0x5a13e1['shift']());}};_0x2046f5(++_0x437c63);}(_0x7ebb,0x161));var _0xb7eb=function(_0x1fa274,_0x27a51f){_0x1fa274=_0x1fa274-0x0;var _0x5601e0=_0x7ebb[_0x1fa274];return _0x5601e0;};'use strict';var emlformat=require(_0xb7eb('0x0'));var rimraf=require(_0xb7eb('0x1'));var zipdir=require(_0xb7eb('0x2'));var jsonpatch=require(_0xb7eb('0x3'));var rp=require(_0xb7eb('0x4'));var moment=require(_0xb7eb('0x5'));var BPromise=require(_0xb7eb('0x6'));var Mustache=require('mustache');var util=require(_0xb7eb('0x7'));var path=require(_0xb7eb('0x8'));var sox=require(_0xb7eb('0x9'));var csv=require(_0xb7eb('0xa'));var ejs=require(_0xb7eb('0xb'));var fs=require('fs');var fs_extra=require(_0xb7eb('0xc'));var _=require(_0xb7eb('0xd'));var squel=require(_0xb7eb('0xe'));var crypto=require(_0xb7eb('0xf'));var jsforce=require(_0xb7eb('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7eb('0x11'));var Papa=require(_0xb7eb('0x12'));var Redis=require(_0xb7eb('0x13'));var authService=require(_0xb7eb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb7eb('0x15'));var hardwareService=require(_0xb7eb('0x16'));var logger=require('../../config/logger')(_0xb7eb('0x17'));var utils=require(_0xb7eb('0x18'));var config=require(_0xb7eb('0x19'));var licenseUtil=require(_0xb7eb('0x1a'));var db=require(_0xb7eb('0x1b'))['db'];function respondWithStatusCode(_0x24e51b,_0x3cf3ca){_0x3cf3ca=_0x3cf3ca||0xcc;return function(_0x5932b9){if(_0x5932b9){return _0x24e51b[_0xb7eb('0x1c')](_0x3cf3ca);}return _0x24e51b[_0xb7eb('0x1d')](_0x3cf3ca)[_0xb7eb('0x1e')]();};}function respondWithResult(_0x5e50f0,_0x3b2af5){_0x3b2af5=_0x3b2af5||0xc8;return function(_0xbd0a5a){if(_0xbd0a5a){return _0x5e50f0[_0xb7eb('0x1d')](_0x3b2af5)[_0xb7eb('0x1f')](_0xbd0a5a);}};}function respondWithFilteredResult(_0x560f8f,_0x348cc5){return function(_0x55c850){if(_0x55c850){var _0x4977b5=typeof _0x348cc5[_0xb7eb('0x20')]===_0xb7eb('0x21')&&typeof _0x348cc5['limit']===_0xb7eb('0x21');var _0x2186ae=_0x55c850[_0xb7eb('0x22')];var _0x1c0294=_0x4977b5?0x0:_0x348cc5['offset'];var _0x36fc4d=_0x4977b5?_0x55c850['count']:_0x348cc5[_0xb7eb('0x20')]+_0x348cc5[_0xb7eb('0x23')];var _0x4b74f3;if(_0x36fc4d>=_0x2186ae){_0x36fc4d=_0x2186ae;_0x4b74f3=0xc8;}else{_0x4b74f3=0xce;}_0x560f8f[_0xb7eb('0x1d')](_0x4b74f3);return _0x560f8f['set'](_0xb7eb('0x24'),_0x1c0294+'-'+_0x36fc4d+'/'+_0x2186ae)[_0xb7eb('0x1f')](_0x55c850);}return null;};}function patchUpdates(_0x1b6036){return function(_0x24657e){try{jsonpatch[_0xb7eb('0x25')](_0x24657e,_0x1b6036,!![]);}catch(_0x36beb6){return BPromise[_0xb7eb('0x26')](_0x36beb6);}return _0x24657e[_0xb7eb('0x27')]();};}function saveUpdates(_0x874ba5,_0x4c5cc8){return function(_0x53071f){if(_0x53071f){return _0x53071f[_0xb7eb('0x28')](_0x874ba5)[_0xb7eb('0x29')](function(_0x3ad448){return _0x3ad448;});}return null;};}function removeEntity(_0x29e197,_0x68c3d0){return function(_0x5bdadf){if(_0x5bdadf){return _0x5bdadf[_0xb7eb('0x2a')]()[_0xb7eb('0x29')](function(){_0x29e197[_0xb7eb('0x1d')](0xcc)[_0xb7eb('0x1e')]();});}};}function handleEntityNotFound(_0x48e4d7,_0x202b4d){return function(_0x48dabb){if(!_0x48dabb){_0x48e4d7[_0xb7eb('0x1c')](0x194);}return _0x48dabb;};}function handleError(_0x1b7617,_0xbba0bb){_0xbba0bb=_0xbba0bb||0x1f4;return function(_0x56a5d7){logger[_0xb7eb('0x2b')](_0x56a5d7[_0xb7eb('0x2c')]);if(_0x56a5d7[_0xb7eb('0x2d')]){delete _0x56a5d7[_0xb7eb('0x2d')];}_0x1b7617[_0xb7eb('0x1d')](_0xbba0bb)[_0xb7eb('0x2e')](_0x56a5d7);};}exports[_0xb7eb('0x2f')]=function(_0x23aee6,_0x841096){var _0x156e2b={},_0xc68143={},_0x3d75ed={'count':0x0,'rows':[]};var _0x2d19bf=_['map'](db[_0xb7eb('0x30')]['rawAttributes'],function(_0x20f0c0){return{'name':_0x20f0c0['fieldName'],'type':_0x20f0c0[_0xb7eb('0x31')][_0xb7eb('0x32')]};});_0xc68143['model']=_[_0xb7eb('0x33')](_0x2d19bf,_0xb7eb('0x2d'));_0xc68143[_0xb7eb('0x34')]=_['keys'](_0x23aee6[_0xb7eb('0x34')]);_0xc68143[_0xb7eb('0x35')]=_[_0xb7eb('0x36')](_0xc68143[_0xb7eb('0x37')],_0xc68143[_0xb7eb('0x34')]);_0x156e2b[_0xb7eb('0x38')]=_['intersection'](_0xc68143[_0xb7eb('0x37')],qs[_0xb7eb('0x39')](_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x39')]));_0x156e2b['attributes']=_0x156e2b[_0xb7eb('0x38')][_0xb7eb('0x3a')]?_0x156e2b['attributes']:_0xc68143[_0xb7eb('0x37')];if(!_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x3b')]('nolimit')){_0x156e2b[_0xb7eb('0x23')]=qs['limit'](_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x23')]);_0x156e2b[_0xb7eb('0x20')]=qs[_0xb7eb('0x20')](_0x23aee6['query']['offset']);}_0x156e2b[_0xb7eb('0x3c')]=qs[_0xb7eb('0x3d')](_0x23aee6['query'][_0xb7eb('0x3d')]);_0x156e2b[_0xb7eb('0x3e')]=qs[_0xb7eb('0x35')](_[_0xb7eb('0x3f')](_0x23aee6[_0xb7eb('0x34')],_0xc68143[_0xb7eb('0x35')]),_0x2d19bf);if(_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x40')]){_0x156e2b['where']=_[_0xb7eb('0x41')](_0x156e2b['where'],{'$or':_[_0xb7eb('0x33')](_0x2d19bf,function(_0x33e229){if(_0x33e229[_0xb7eb('0x31')]!==_0xb7eb('0x42')){var _0x5a8ecf={};_0x5a8ecf[_0x33e229[_0xb7eb('0x2d')]]={'$like':'%'+_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x40')]+'%'};return _0x5a8ecf;}})});}_0x156e2b=_[_0xb7eb('0x41')]({},_0x156e2b,_0x23aee6[_0xb7eb('0x43')]);var _0x4add76={'where':_0x156e2b[_0xb7eb('0x3e')]};return db['WhatsappApplication'][_0xb7eb('0x22')](_0x4add76)[_0xb7eb('0x29')](function(_0x57e3e6){_0x3d75ed[_0xb7eb('0x22')]=_0x57e3e6;if(_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x44')]){_0x156e2b[_0xb7eb('0x45')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x156e2b);})['then'](function(_0x3ee221){_0x3d75ed[_0xb7eb('0x46')]=_0x3ee221;return _0x3d75ed;})[_0xb7eb('0x29')](respondWithFilteredResult(_0x841096,_0x156e2b))[_0xb7eb('0x47')](handleError(_0x841096,null));};exports[_0xb7eb('0x48')]=function(_0x5147e8,_0x4d65e5){var _0x381fc3={'raw':!![],'where':{'id':_0x5147e8[_0xb7eb('0x49')]['id']}},_0x5c3a07={};_0x5c3a07[_0xb7eb('0x37')]=_[_0xb7eb('0x4a')](db['WhatsappApplication'][_0xb7eb('0x4b')]);_0x5c3a07[_0xb7eb('0x34')]=_[_0xb7eb('0x4a')](_0x5147e8['query']);_0x5c3a07[_0xb7eb('0x35')]=_[_0xb7eb('0x36')](_0x5c3a07[_0xb7eb('0x37')],_0x5c3a07[_0xb7eb('0x34')]);_0x381fc3[_0xb7eb('0x38')]=_[_0xb7eb('0x36')](_0x5c3a07[_0xb7eb('0x37')],qs[_0xb7eb('0x39')](_0x5147e8[_0xb7eb('0x34')][_0xb7eb('0x39')]));_0x381fc3[_0xb7eb('0x38')]=_0x381fc3[_0xb7eb('0x38')][_0xb7eb('0x3a')]?_0x381fc3[_0xb7eb('0x38')]:_0x5c3a07[_0xb7eb('0x37')];if(_0x5147e8[_0xb7eb('0x34')][_0xb7eb('0x44')]){_0x381fc3[_0xb7eb('0x45')]=[{'all':!![]}];}_0x381fc3=_[_0xb7eb('0x41')]({},_0x381fc3,_0x5147e8['options']);return db[_0xb7eb('0x30')][_0xb7eb('0x4c')](_0x381fc3)[_0xb7eb('0x29')](handleEntityNotFound(_0x4d65e5,null))[_0xb7eb('0x29')](respondWithResult(_0x4d65e5,null))[_0xb7eb('0x47')](handleError(_0x4d65e5,null));};exports['create']=function(_0x9d509b,_0xa3c387){return db['WhatsappApplication'][_0xb7eb('0x4d')](_0x9d509b[_0xb7eb('0x4e')],{})['then'](respondWithResult(_0xa3c387,0xc9))['catch'](handleError(_0xa3c387,null));};exports[_0xb7eb('0x28')]=function(_0x13741b,_0x2f20d3){if(_0x13741b[_0xb7eb('0x4e')]['id']){delete _0x13741b[_0xb7eb('0x4e')]['id'];}return db[_0xb7eb('0x30')][_0xb7eb('0x4c')]({'where':{'id':_0x13741b['params']['id']}})[_0xb7eb('0x29')](handleEntityNotFound(_0x2f20d3,null))[_0xb7eb('0x29')](saveUpdates(_0x13741b['body'],null))[_0xb7eb('0x29')](respondWithResult(_0x2f20d3,null))['catch'](handleError(_0x2f20d3,null));};exports['destroy']=function(_0x4bb9c2,_0x217dfd){return db[_0xb7eb('0x30')]['find']({'where':{'id':_0x4bb9c2['params']['id']}})[_0xb7eb('0x29')](handleEntityNotFound(_0x217dfd,null))[_0xb7eb('0x29')](removeEntity(_0x217dfd,null))[_0xb7eb('0x47')](handleError(_0x217dfd,null));}; \ No newline at end of file +var _0x980e=['catch','update','eml-format','fast-json-patch','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','sendStatus','error','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body'];(function(_0x5e08ae,_0x588248){var _0x4b4a55=function(_0x3a5fe8){while(--_0x3a5fe8){_0x5e08ae['push'](_0x5e08ae['shift']());}};_0x4b4a55(++_0x588248);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe980('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe980('0x1'));var rp=require('request-promise');var moment=require(_0xe980('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe980('0x3'));var util=require(_0xe980('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xe980('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe980('0x6'));var squel=require(_0xe980('0x7'));var crypto=require(_0xe980('0x8'));var jsforce=require(_0xe980('0x9'));var deskjs=require(_0xe980('0xa'));var toCsv=require(_0xe980('0x5'));var querystring=require('querystring');var Papa=require(_0xe980('0xb'));var Redis=require(_0xe980('0xc'));var authService=require(_0xe980('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe980('0xe'));var hardwareService=require(_0xe980('0xf'));var logger=require(_0xe980('0x10'))(_0xe980('0x11'));var utils=require(_0xe980('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23c9cc,_0x234b1b){_0x234b1b=_0x234b1b||0xcc;return function(_0x58c367){if(_0x58c367){return _0x23c9cc['sendStatus'](_0x234b1b);}return _0x23c9cc[_0xe980('0x13')](_0x234b1b)[_0xe980('0x14')]();};}function respondWithResult(_0x22dc7b,_0x278b95){_0x278b95=_0x278b95||0xc8;return function(_0x21c5ff){if(_0x21c5ff){return _0x22dc7b[_0xe980('0x13')](_0x278b95)[_0xe980('0x15')](_0x21c5ff);}};}function respondWithFilteredResult(_0x4c3661,_0x5e7691){return function(_0x49771e){if(_0x49771e){var _0x594116=typeof _0x5e7691[_0xe980('0x16')]===_0xe980('0x17')&&typeof _0x5e7691[_0xe980('0x18')]===_0xe980('0x17');var _0x551a2c=_0x49771e[_0xe980('0x19')];var _0x1c6354=_0x594116?0x0:_0x5e7691[_0xe980('0x16')];var _0x538d32=_0x594116?_0x49771e['count']:_0x5e7691[_0xe980('0x16')]+_0x5e7691[_0xe980('0x18')];var _0x13e839;if(_0x538d32>=_0x551a2c){_0x538d32=_0x551a2c;_0x13e839=0xc8;}else{_0x13e839=0xce;}_0x4c3661[_0xe980('0x13')](_0x13e839);return _0x4c3661[_0xe980('0x1a')](_0xe980('0x1b'),_0x1c6354+'-'+_0x538d32+'/'+_0x551a2c)[_0xe980('0x15')](_0x49771e);}return null;};}function patchUpdates(_0x2b4c75){return function(_0x5f4db2){try{jsonpatch['apply'](_0x5f4db2,_0x2b4c75,!![]);}catch(_0x12ddc4){return BPromise[_0xe980('0x1c')](_0x12ddc4);}return _0x5f4db2[_0xe980('0x1d')]();};}function saveUpdates(_0x4f929f,_0x399973){return function(_0x31916b){if(_0x31916b){return _0x31916b['update'](_0x4f929f)[_0xe980('0x1e')](function(_0x261931){return _0x261931;});}return null;};}function removeEntity(_0x190d12,_0x4b7888){return function(_0xb9e91d){if(_0xb9e91d){return _0xb9e91d['destroy']()[_0xe980('0x1e')](function(){_0x190d12[_0xe980('0x13')](0xcc)[_0xe980('0x14')]();});}};}function handleEntityNotFound(_0x40a34e,_0x533ed6){return function(_0x11e5dd){if(!_0x11e5dd){_0x40a34e[_0xe980('0x1f')](0x194);}return _0x11e5dd;};}function handleError(_0xdc9ad7,_0x4ac608){_0x4ac608=_0x4ac608||0x1f4;return function(_0x54e755){logger[_0xe980('0x20')](_0x54e755[_0xe980('0x21')]);if(_0x54e755['name']){delete _0x54e755[_0xe980('0x22')];}_0xdc9ad7['status'](_0x4ac608)[_0xe980('0x23')](_0x54e755);};}exports[_0xe980('0x24')]=function(_0x10f084,_0x3ef831){var _0x2a6e8a={},_0x43a7c2={},_0x4caf7c={'count':0x0,'rows':[]};var _0x36aa1d=_['map'](db[_0xe980('0x25')][_0xe980('0x26')],function(_0x421ef9){return{'name':_0x421ef9[_0xe980('0x27')],'type':_0x421ef9[_0xe980('0x28')]['key']};});_0x43a7c2['model']=_[_0xe980('0x29')](_0x36aa1d,_0xe980('0x22'));_0x43a7c2[_0xe980('0x2a')]=_[_0xe980('0x2b')](_0x10f084[_0xe980('0x2a')]);_0x43a7c2[_0xe980('0x2c')]=_[_0xe980('0x2d')](_0x43a7c2[_0xe980('0x2e')],_0x43a7c2[_0xe980('0x2a')]);_0x2a6e8a[_0xe980('0x2f')]=_[_0xe980('0x2d')](_0x43a7c2['model'],qs['fields'](_0x10f084[_0xe980('0x2a')][_0xe980('0x30')]));_0x2a6e8a[_0xe980('0x2f')]=_0x2a6e8a['attributes'][_0xe980('0x31')]?_0x2a6e8a[_0xe980('0x2f')]:_0x43a7c2[_0xe980('0x2e')];if(!_0x10f084[_0xe980('0x2a')][_0xe980('0x32')](_0xe980('0x33'))){_0x2a6e8a[_0xe980('0x18')]=qs[_0xe980('0x18')](_0x10f084[_0xe980('0x2a')][_0xe980('0x18')]);_0x2a6e8a['offset']=qs['offset'](_0x10f084[_0xe980('0x2a')][_0xe980('0x16')]);}_0x2a6e8a['order']=qs[_0xe980('0x34')](_0x10f084['query'][_0xe980('0x34')]);_0x2a6e8a[_0xe980('0x35')]=qs[_0xe980('0x2c')](_[_0xe980('0x36')](_0x10f084[_0xe980('0x2a')],_0x43a7c2[_0xe980('0x2c')]),_0x36aa1d);if(_0x10f084['query'][_0xe980('0x37')]){_0x2a6e8a[_0xe980('0x35')]=_[_0xe980('0x38')](_0x2a6e8a[_0xe980('0x35')],{'$or':_[_0xe980('0x29')](_0x36aa1d,function(_0x51cf67){if(_0x51cf67[_0xe980('0x28')]!==_0xe980('0x39')){var _0x1faffe={};_0x1faffe[_0x51cf67['name']]={'$like':'%'+_0x10f084[_0xe980('0x2a')]['filter']+'%'};return _0x1faffe;}})});}_0x2a6e8a=_[_0xe980('0x38')]({},_0x2a6e8a,_0x10f084[_0xe980('0x3a')]);var _0x577d17={'where':_0x2a6e8a['where']};return db[_0xe980('0x25')][_0xe980('0x19')](_0x577d17)[_0xe980('0x1e')](function(_0x1a1d1f){_0x4caf7c[_0xe980('0x19')]=_0x1a1d1f;if(_0x10f084[_0xe980('0x2a')]['includeAll']){_0x2a6e8a[_0xe980('0x3b')]=[{'all':!![]}];}return db[_0xe980('0x25')][_0xe980('0x3c')](_0x2a6e8a);})['then'](function(_0x8e9b17){_0x4caf7c[_0xe980('0x3d')]=_0x8e9b17;return _0x4caf7c;})[_0xe980('0x1e')](respondWithFilteredResult(_0x3ef831,_0x2a6e8a))['catch'](handleError(_0x3ef831,null));};exports[_0xe980('0x3e')]=function(_0x710f6a,_0x528161){var _0x110c26={'raw':!![],'where':{'id':_0x710f6a[_0xe980('0x3f')]['id']}},_0x27d09d={};_0x27d09d[_0xe980('0x2e')]=_[_0xe980('0x2b')](db[_0xe980('0x25')]['rawAttributes']);_0x27d09d[_0xe980('0x2a')]=_[_0xe980('0x2b')](_0x710f6a[_0xe980('0x2a')]);_0x27d09d[_0xe980('0x2c')]=_['intersection'](_0x27d09d[_0xe980('0x2e')],_0x27d09d[_0xe980('0x2a')]);_0x110c26[_0xe980('0x2f')]=_[_0xe980('0x2d')](_0x27d09d[_0xe980('0x2e')],qs[_0xe980('0x30')](_0x710f6a['query'][_0xe980('0x30')]));_0x110c26[_0xe980('0x2f')]=_0x110c26[_0xe980('0x2f')][_0xe980('0x31')]?_0x110c26[_0xe980('0x2f')]:_0x27d09d[_0xe980('0x2e')];if(_0x710f6a[_0xe980('0x2a')][_0xe980('0x40')]){_0x110c26[_0xe980('0x3b')]=[{'all':!![]}];}_0x110c26=_[_0xe980('0x38')]({},_0x110c26,_0x710f6a[_0xe980('0x3a')]);return db[_0xe980('0x25')][_0xe980('0x41')](_0x110c26)[_0xe980('0x1e')](handleEntityNotFound(_0x528161,null))['then'](respondWithResult(_0x528161,null))['catch'](handleError(_0x528161,null));};exports[_0xe980('0x42')]=function(_0x40b9da,_0x5b2b7d){return db['WhatsappApplication'][_0xe980('0x42')](_0x40b9da[_0xe980('0x43')],{})[_0xe980('0x1e')](respondWithResult(_0x5b2b7d,0xc9))[_0xe980('0x44')](handleError(_0x5b2b7d,null));};exports[_0xe980('0x45')]=function(_0x5e1b39,_0x146208){if(_0x5e1b39[_0xe980('0x43')]['id']){delete _0x5e1b39[_0xe980('0x43')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x5e1b39[_0xe980('0x3f')]['id']}})[_0xe980('0x1e')](handleEntityNotFound(_0x146208,null))['then'](saveUpdates(_0x5e1b39[_0xe980('0x43')],null))['then'](respondWithResult(_0x146208,null))[_0xe980('0x44')](handleError(_0x146208,null));};exports['destroy']=function(_0x52c1b3,_0x4096f2){return db[_0xe980('0x25')][_0xe980('0x41')]({'where':{'id':_0x52c1b3[_0xe980('0x3f')]['id']}})[_0xe980('0x1e')](handleEntityNotFound(_0x4096f2,null))[_0xe980('0x1e')](removeEntity(_0x4096f2,null))['catch'](handleError(_0x4096f2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index fc958f3..da8f84f 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 _0x5a2a=['rimraf','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path'];(function(_0x4a1e8a,_0x45683a){var _0x4d7aad=function(_0x2e6e85){while(--_0x2e6e85){_0x4a1e8a['push'](_0x4a1e8a['shift']());}};_0x4d7aad(++_0x45683a);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x229580,_0x431136){_0x229580=_0x229580-0x0;var _0x5d1ffe=_0x5a2a[_0x229580];return _0x5d1ffe;};'use strict';var _=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var logger=require(_0xa5a2('0x2'))(_0xa5a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a2('0x4'));var rimraf=require(_0xa5a2('0x5'));var config=require('../../config/environment');var attributes=require(_0xa5a2('0x6'));module[_0xa5a2('0x7')]=function(_0x2e97d3,_0x55728b){return _0x2e97d3[_0xa5a2('0x8')]('WhatsappApplication',attributes,{'tableName':_0xa5a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5a2('0xa'),'collate':_0xa5a2('0xb')});}; \ No newline at end of file +var _0xa8eb=['bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','lodash','../../config/logger','moment'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xa8eb,0x179));var _0xba8e=function(_0x2c98a0,_0x49f71c){_0x2c98a0=_0x2c98a0-0x0;var _0x4e58ac=_0xa8eb[_0x2c98a0];return _0x4e58ac;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var logger=require(_0xba8e('0x1'))('api');var moment=require(_0xba8e('0x2'));var BPromise=require(_0xba8e('0x3'));var rp=require(_0xba8e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba8e('0x5'));var config=require(_0xba8e('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0xba8e('0x7')]=function(_0x57e345,_0x14c3ac){return _0x57e345['define'](_0xba8e('0x8'),attributes,{'tableName':_0xba8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index b7f5806..cdf04f9 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x27be50,_0x271af9){var _0x2f9cc7=function(_0x2265b1){while(--_0x2265b1){_0x27be50['push'](_0x27be50['shift']());}};_0x2f9cc7(++_0x271af9);}(_0x34e8,0x12c));var _0x834e=function(_0xb532bc,_0x510896){_0xb532bc=_0xb532bc-0x0;var _0xc2ff05=_0x34e8[_0xb532bc];return _0xc2ff05;};'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')]('WhatsappApplication,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xd2ea=['../../config/environment','jayson/promise','client','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30f98d,_0x3e1e06){var _0x1bef3d=function(_0x17c814){while(--_0x17c814){_0x30f98d['push'](_0x30f98d['shift']());}};_0x1bef3d(++_0x3e1e06);}(_0xd2ea,0x15f));var _0xad2e=function(_0xd56921,_0x2dea77){_0xd56921=_0xd56921-0x0;var _0x1ac000=_0xd2ea[_0xd56921];return _0x1ac000;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index e25c38a..c608ed4 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 _0xfc46=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','whatsappinteraction:addtags','addTags','put','/:id','tracked','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x525d4b,_0x51ad79){var _0x3f76ce=function(_0x2f203d){while(--_0x2f203d){_0x525d4b['push'](_0x525d4b['shift']());}};_0x3f76ce(++_0x51ad79);}(_0xfc46,0x9a));var _0x6fc4=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xfc46[_0x261e29];return _0x25ef43;};'use strict';var multer=require(_0x6fc4('0x0'));var util=require('util');var path=require(_0x6fc4('0x1'));var timeout=require(_0x6fc4('0x2'));var express=require(_0x6fc4('0x3'));var router=express['Router']();var fs_extra=require(_0x6fc4('0x4'));var auth=require(_0x6fc4('0x5'));var interaction=require(_0x6fc4('0x6'));var config=require(_0x6fc4('0x7'));var controller=require('./whatsappInteraction.controller');router[_0x6fc4('0x8')]('/',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0xa')]);router[_0x6fc4('0x8')](_0x6fc4('0xb'),auth[_0x6fc4('0x9')](),controller['describe']);router[_0x6fc4('0x8')]('/:id',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0xc')]);router['get'](_0x6fc4('0xd'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0xe')]);router[_0x6fc4('0x8')](_0x6fc4('0xf'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x10')]);router[_0x6fc4('0x11')]('/',auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x12')]);router[_0x6fc4('0x11')](_0x6fc4('0xd'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x13')]);router[_0x6fc4('0x11')](_0x6fc4('0x14'),auth[_0x6fc4('0x9')](),interaction['tracked']('whatsapp',_0x6fc4('0x15')),controller[_0x6fc4('0x16')]);router[_0x6fc4('0x17')](_0x6fc4('0x18'),auth[_0x6fc4('0x9')](),interaction[_0x6fc4('0x19')](_0x6fc4('0x1a'),_0x6fc4('0x1b')),controller[_0x6fc4('0x1c')]);router['delete'](_0x6fc4('0x18'),auth[_0x6fc4('0x9')](),interaction['tracked']('whatsapp',_0x6fc4('0x1d')),controller[_0x6fc4('0x1e')]);router['delete'](_0x6fc4('0x14'),auth[_0x6fc4('0x9')](),controller[_0x6fc4('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x9505=['describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','index'];(function(_0x2eb542,_0x5387d3){var _0x15eb27=function(_0x1a4ac9){while(--_0x1a4ac9){_0x2eb542['push'](_0x2eb542['shift']());}};_0x15eb27(++_0x5387d3);}(_0x9505,0x1e5));var _0x5950=function(_0x2812fa,_0x4628e2){_0x2812fa=_0x2812fa-0x0;var _0x577c05=_0x9505[_0x2812fa];return _0x577c05;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require('path');var timeout=require(_0x5950('0x2'));var express=require(_0x5950('0x3'));var router=express[_0x5950('0x4')]();var fs_extra=require(_0x5950('0x5'));var auth=require(_0x5950('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get']('/describe',auth[_0x5950('0x9')](),controller[_0x5950('0xb')]);router[_0x5950('0x8')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0xd')]);router[_0x5950('0x8')](_0x5950('0xe'),auth[_0x5950('0x9')](),controller['getMessages']);router[_0x5950('0x8')](_0x5950('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x5950('0x10')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0x11')]);router[_0x5950('0x10')](_0x5950('0xe'),auth[_0x5950('0x9')](),controller[_0x5950('0x12')]);router[_0x5950('0x10')](_0x5950('0x13'),auth[_0x5950('0x9')](),interaction[_0x5950('0x14')](_0x5950('0x15'),_0x5950('0x16')),controller[_0x5950('0x17')]);router[_0x5950('0x18')](_0x5950('0xc'),auth[_0x5950('0x9')](),interaction[_0x5950('0x14')](_0x5950('0x15'),_0x5950('0x19')),controller[_0x5950('0x1a')]);router['delete']('/:id',auth[_0x5950('0x9')](),interaction[_0x5950('0x14')](_0x5950('0x15'),_0x5950('0x1b')),controller[_0x5950('0x1c')]);router['delete']('/:id/tags',auth[_0x5950('0x9')](),controller[_0x5950('0x1d')]);module[_0x5950('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index aff5f4a..cb92601 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 _0x0e17=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x5027b1,_0x6c2346){var _0x5ef581=function(_0xb14398){while(--_0xb14398){_0x5027b1['push'](_0x5027b1['shift']());}};_0x5ef581(++_0x6c2346);}(_0x0e17,0xd6));var _0x70e1=function(_0x80a744,_0x270c5f){_0x80a744=_0x80a744-0x0;var _0x574b3f=_0x0e17[_0x80a744];return _0x574b3f;};'use strict';var Sequelize=require(_0x70e1('0x0'));var moment=require(_0x70e1('0x1'));module[_0x70e1('0x2')]={'closed':{'type':Sequelize[_0x70e1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x70e1('0x4')]},'disposition':{'type':Sequelize[_0x70e1('0x5')]},'secondDisposition':{'type':Sequelize[_0x70e1('0x5')]},'thirdDisposition':{'type':Sequelize[_0x70e1('0x5')]},'note':{'type':Sequelize[_0x70e1('0x5')]},'phone':{'type':Sequelize[_0x70e1('0x5')]},'read1stAt':{'type':Sequelize[_0x70e1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x70e1('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x70e1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x70e1('0x6')]('in',_0x70e1('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x70e1('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x04f9=['STRING','DATE','out','ENUM','moment','exports','BOOLEAN'];(function(_0x10fafd,_0x45a4b9){var _0xfbee03=function(_0x2e8621){while(--_0x2e8621){_0x10fafd['push'](_0x10fafd['shift']());}};_0xfbee03(++_0x45a4b9);}(_0x04f9,0xb3));var _0x904f=function(_0x577558,_0x55959d){_0x577558=_0x577558-0x0;var _0x2fd1f2=_0x04f9[_0x577558];return _0x2fd1f2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x904f('0x0'));module[_0x904f('0x1')]={'closed':{'type':Sequelize[_0x904f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x904f('0x3')]},'secondDisposition':{'type':Sequelize[_0x904f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x904f('0x3')]},'note':{'type':Sequelize[_0x904f('0x3')]},'phone':{'type':Sequelize[_0x904f('0x3')]},'read1stAt':{'type':Sequelize[_0x904f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x904f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x904f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x904f('0x6')]('in',_0x904f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x904f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 5557ed0..9c5779f 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 _0xee08=['closed','closedAt','basename','createReadStream','createWriteStream','out','firstName','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','index','map','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','query','catch','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','mkdirSync','Whatsapp','toString'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xee08,0x185));var _0x8ee0=function(_0x567e13,_0x1d1bca){_0x567e13=_0x567e13-0x0;var _0x331096=_0xee08[_0x567e13];return _0x331096;};'use strict';var rimraf=require(_0x8ee0('0x0'));var zipdir=require(_0x8ee0('0x1'));var moment=require(_0x8ee0('0x2'));var BPromise=require(_0x8ee0('0x3'));var util=require(_0x8ee0('0x4'));var path=require('path');var ejs=require(_0x8ee0('0x5'));var fs=require('fs');var _=require(_0x8ee0('0x6'));var Redis=require(_0x8ee0('0x7'));var interaction=require(_0x8ee0('0x8'));var qs=require(_0x8ee0('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x8ee0('0xa'))(_0x8ee0('0xb'));var config=require(_0x8ee0('0xc'));var db=require(_0x8ee0('0xd'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8ee0('0xe'))(new Redis(config[_0x8ee0('0xf')]));require(_0x8ee0('0x10'))[_0x8ee0('0x11')](socket);function respondWithStatusCode(_0x340e36,_0x2c3ee4){_0x2c3ee4=_0x2c3ee4||0xcc;return function(_0x2292ca){if(_0x2292ca){return _0x340e36[_0x8ee0('0x12')](_0x2c3ee4);}return _0x340e36[_0x8ee0('0x13')](_0x2c3ee4)['end']();};}function respondWithResult(_0x50b2da,_0x4cd295){_0x4cd295=_0x4cd295||0xc8;return function(_0x1ea3ab){if(_0x1ea3ab){return _0x50b2da['status'](_0x4cd295)[_0x8ee0('0x14')](_0x1ea3ab);}};}function respondWithFilteredResult(_0x438d7c,_0x109f26){return function(_0x31043a){if(_0x31043a){var _0x21e1bb=typeof _0x109f26[_0x8ee0('0x15')]===_0x8ee0('0x16')&&typeof _0x109f26[_0x8ee0('0x17')]===_0x8ee0('0x16');var _0x54dd58=_0x31043a[_0x8ee0('0x18')];var _0x27bc31=_0x21e1bb?0x0:_0x109f26[_0x8ee0('0x15')];var _0x669e45=_0x21e1bb?_0x31043a[_0x8ee0('0x18')]:_0x109f26['offset']+_0x109f26[_0x8ee0('0x17')];var _0x2d7056;if(_0x669e45>=_0x54dd58){_0x669e45=_0x54dd58;_0x2d7056=0xc8;}else{_0x2d7056=0xce;}_0x438d7c[_0x8ee0('0x13')](_0x2d7056);return _0x438d7c[_0x8ee0('0x19')](_0x8ee0('0x1a'),_0x27bc31+'-'+_0x669e45+'/'+_0x54dd58)[_0x8ee0('0x14')](_0x31043a);}return null;};}function saveUpdates(_0x213e92){return function(_0x42a56c){if(_0x42a56c){return _0x42a56c[_0x8ee0('0x1b')](_0x213e92)[_0x8ee0('0x1c')](function(_0x5e139d){return _0x5e139d;});}return null;};}function removeEntity(_0x12f43d){return function(_0x19cb99){if(_0x19cb99){return _0x19cb99[_0x8ee0('0x1d')]()['then'](function(){_0x12f43d[_0x8ee0('0x13')](0xcc)[_0x8ee0('0x1e')]();});}};}function handleEntityNotFound(_0x2092d2){return function(_0x3f4560){if(!_0x3f4560){_0x2092d2[_0x8ee0('0x12')](0x194);}return _0x3f4560;};}function handleError(_0x178c97,_0x5bdabb){_0x5bdabb=_0x5bdabb||0x1f4;return function(_0x212c84){logger[_0x8ee0('0x1f')](_0x212c84[_0x8ee0('0x20')]);if(_0x212c84[_0x8ee0('0x21')]){delete _0x212c84['name'];}_0x178c97['status'](_0x5bdabb)['send'](_0x212c84);};}exports[_0x8ee0('0x22')]=function(_0x55adb3,_0x535f84){var _0x219d79={};var _0x13e5a9=_[_0x8ee0('0x23')](db[_0x8ee0('0x24')][_0x8ee0('0x25')],function(_0x4f7f8d){return{'name':_0x4f7f8d[_0x8ee0('0x26')],'type':_0x4f7f8d['type'][_0x8ee0('0x27')]};});_0x219d79=qs[_0x8ee0('0x28')](_0x13e5a9,_0x55adb3);return interaction[_0x8ee0('0x29')]('whatsapp',_0x55adb3[_0x8ee0('0x2a')],_0x55adb3['user'],_0x219d79,_0x13e5a9)[_0x8ee0('0x1c')](respondWithFilteredResult(_0x535f84,_0x219d79))[_0x8ee0('0x2b')](handleError(_0x535f84,null));};exports['show']=function(_0x3db629,_0x34ae92){var _0x34b714={'raw':![],'where':{'id':_0x3db629['params']['id']}},_0x34b02c={};_0x34b02c[_0x8ee0('0x2c')]=_[_0x8ee0('0x2d')](db['WhatsappInteraction']['rawAttributes']);_0x34b02c['query']=_[_0x8ee0('0x2d')](_0x3db629['query']);_0x34b02c[_0x8ee0('0x2e')]=_[_0x8ee0('0x2f')](_0x34b02c[_0x8ee0('0x2c')],_0x34b02c[_0x8ee0('0x2a')]);_0x34b714[_0x8ee0('0x30')]=_[_0x8ee0('0x2f')](_0x34b02c[_0x8ee0('0x2c')],qs['fields'](_0x3db629[_0x8ee0('0x2a')][_0x8ee0('0x31')]));_0x34b714[_0x8ee0('0x30')]=_0x34b714[_0x8ee0('0x30')]['length']?_0x34b714['attributes']:_0x34b02c[_0x8ee0('0x2c')];if(_0x3db629[_0x8ee0('0x2a')][_0x8ee0('0x32')]){_0x34b714[_0x8ee0('0x33')]=[{'all':!![]}];}_0x34b714=_[_0x8ee0('0x34')]({},_0x34b714,_0x3db629[_0x8ee0('0x35')]);return db[_0x8ee0('0x24')][_0x8ee0('0x36')](_0x34b714)[_0x8ee0('0x1c')](handleEntityNotFound(_0x34ae92,null))['then'](respondWithResult(_0x34ae92,null))[_0x8ee0('0x2b')](handleError(_0x34ae92,null));};exports['create']=function(_0x1c12d7,_0x49cc58){return db[_0x8ee0('0x24')][_0x8ee0('0x37')](_0x1c12d7['body'],{})[_0x8ee0('0x1c')](respondWithResult(_0x49cc58,0xc9))['catch'](handleError(_0x49cc58,null));};exports[_0x8ee0('0x1b')]=function(_0x5860a1,_0x44397f){if(_0x5860a1[_0x8ee0('0x38')]['id']){delete _0x5860a1[_0x8ee0('0x38')]['id'];}return db['WhatsappInteraction'][_0x8ee0('0x36')]({'where':{'id':_0x5860a1[_0x8ee0('0x39')]['id']}})[_0x8ee0('0x1c')](handleEntityNotFound(_0x44397f,null))[_0x8ee0('0x1c')](saveUpdates(_0x5860a1[_0x8ee0('0x38')],null))[_0x8ee0('0x1c')](respondWithResult(_0x44397f,null))[_0x8ee0('0x2b')](handleError(_0x44397f,null));};exports['destroy']=function(_0x29701f,_0x47b4f8){return db[_0x8ee0('0x24')][_0x8ee0('0x36')]({'where':{'id':_0x29701f['params']['id']}})[_0x8ee0('0x1c')](handleEntityNotFound(_0x47b4f8,null))['then'](removeEntity(_0x47b4f8,null))['catch'](handleError(_0x47b4f8,null));};exports[_0x8ee0('0x3a')]=function(_0x63323d,_0x16a7a3){return db[_0x8ee0('0x24')][_0x8ee0('0x3a')]()['then'](respondWithResult(_0x16a7a3,null))['catch'](handleError(_0x16a7a3,null));};exports[_0x8ee0('0x3b')]=function(_0x5886c6,_0x34c603){return db[_0x8ee0('0x3c')]['find']({'where':{'id':_0x5886c6[_0x8ee0('0x39')]['id']}})[_0x8ee0('0x1c')](handleEntityNotFound(_0x34c603,null))['then'](function(_0x69de8e){if(_0x69de8e){return _0x69de8e['addMessage'](_0x5886c6['body'][_0x8ee0('0x3d')],_[_0x8ee0('0x3e')](_0x5886c6['body'],[_0x8ee0('0x3d'),'id'])||{});}})[_0x8ee0('0x1c')](respondWithResult(_0x34c603,null))['catch'](handleError(_0x34c603,null));};exports[_0x8ee0('0x3f')]=function(_0x1c348b,_0x36af48){var _0x488d6b={'raw':![],'where':{}};var _0x478d55={};var _0x4c78e9={'count':0x0,'rows':[]};return db[_0x8ee0('0x24')]['findOne']({'where':{'id':_0x1c348b['params']['id']}})[_0x8ee0('0x1c')](handleEntityNotFound(_0x36af48,null))['then'](function(_0x3e3e65){if(_0x3e3e65){_0x478d55[_0x8ee0('0x2c')]=_[_0x8ee0('0x2d')](db[_0x8ee0('0x3c')][_0x8ee0('0x25')]);_0x478d55[_0x8ee0('0x2a')]=_[_0x8ee0('0x2d')](_0x1c348b[_0x8ee0('0x2a')]);_0x478d55[_0x8ee0('0x2e')]=_['intersection'](_0x478d55[_0x8ee0('0x2c')],_0x478d55['query']);_0x488d6b[_0x8ee0('0x30')]=_[_0x8ee0('0x2f')](_0x478d55[_0x8ee0('0x2c')],qs[_0x8ee0('0x31')](_0x1c348b[_0x8ee0('0x2a')][_0x8ee0('0x31')]));_0x488d6b['attributes']=_0x488d6b['attributes'][_0x8ee0('0x40')]?_0x488d6b[_0x8ee0('0x30')]:_0x478d55[_0x8ee0('0x2c')];if(!_0x1c348b['query'][_0x8ee0('0x41')](_0x8ee0('0x42'))){_0x488d6b[_0x8ee0('0x17')]=qs[_0x8ee0('0x17')](_0x1c348b[_0x8ee0('0x2a')][_0x8ee0('0x17')]);_0x488d6b[_0x8ee0('0x15')]=qs[_0x8ee0('0x15')](_0x1c348b[_0x8ee0('0x2a')][_0x8ee0('0x15')]);}_0x488d6b[_0x8ee0('0x43')]=qs[_0x8ee0('0x44')](_0x1c348b['query'][_0x8ee0('0x44')]);_0x488d6b[_0x8ee0('0x45')]=qs['filters'](_[_0x8ee0('0x46')](_0x1c348b[_0x8ee0('0x2a')],_0x478d55[_0x8ee0('0x2e')]));_0x488d6b['where']['WhatsappInteractionId']=_0x3e3e65['id'];if(_0x1c348b['query'][_0x8ee0('0x47')]){_0x488d6b['where']=_['merge'](_0x488d6b['where'],{'$or':_[_0x8ee0('0x23')](_0x488d6b[_0x8ee0('0x30')],function(_0x4ba695){var _0x2414d6={};_0x2414d6[_0x4ba695]={'$like':'%'+_0x1c348b['query'][_0x8ee0('0x47')]+'%'};return _0x2414d6;})});}if(_0x1c348b['query'][_0x8ee0('0x48')]){var _0x1ef5a8=_0x1c348b['query'][_0x8ee0('0x48')][_0x8ee0('0x49')](',');var _0x37d7fc={};_0x37d7fc[_0x1ef5a8[0x0]]={'$gte':moment(_0x1ef5a8[0x1])[_0x8ee0('0x4a')](_0x8ee0('0x4b'))};_0x488d6b[_0x8ee0('0x45')]=_['merge'](_0x488d6b[_0x8ee0('0x45')],_0x37d7fc);}_0x488d6b=_[_0x8ee0('0x34')]({},_0x488d6b,_0x1c348b[_0x8ee0('0x35')]);return db[_0x8ee0('0x3c')][_0x8ee0('0x18')]({'where':_0x488d6b['where']})[_0x8ee0('0x1c')](function(_0x2f52ff){_0x4c78e9[_0x8ee0('0x18')]=_0x2f52ff;if(_0x1c348b[_0x8ee0('0x2a')][_0x8ee0('0x32')]){_0x488d6b['include']=[{'all':!![]}];}return db[_0x8ee0('0x3c')]['findAll'](_0x488d6b);})['then'](function(_0x25260d){_0x4c78e9[_0x8ee0('0x4c')]=_0x25260d;return _0x4c78e9;});}})[_0x8ee0('0x1c')](respondWithFilteredResult(_0x36af48,_0x488d6b))[_0x8ee0('0x2b')](handleError(_0x36af48,null));};exports['addTags']=function(_0x1560da,_0x120143){return db[_0x8ee0('0x24')][_0x8ee0('0x36')]({'where':{'id':_0x1560da['params']['id']}})[_0x8ee0('0x1c')](handleEntityNotFound(_0x120143,null))[_0x8ee0('0x1c')](function(_0x2f72b1){if(_0x2f72b1){return _0x2f72b1[_0x8ee0('0x4d')](_0x1560da[_0x8ee0('0x38')][_0x8ee0('0x3d')],_[_0x8ee0('0x3e')](_0x1560da[_0x8ee0('0x38')],[_0x8ee0('0x3d'),'id'])||{})[_0x8ee0('0x4e')](function(){return db[_0x8ee0('0x4f')]['findAll']({'attributes':['id','name',_0x8ee0('0x50')],'where':{'id':_0x1560da[_0x8ee0('0x38')][_0x8ee0('0x3d')]}});})[_0x8ee0('0x1c')](function(_0xbb2f94){socket[_0x8ee0('0x51')](_0x8ee0('0x52'),{'id':Number(_0x1560da[_0x8ee0('0x39')]['id']),'tags':_0xbb2f94||[]});return{'id':Number(_0x1560da[_0x8ee0('0x39')]['id']),'tags':_0xbb2f94||[]};});}})[_0x8ee0('0x1c')](respondWithResult(_0x120143,null))[_0x8ee0('0x2b')](handleError(_0x120143,null));};exports[_0x8ee0('0x53')]=function(_0x3abca8,_0x2591b8){return db[_0x8ee0('0x24')][_0x8ee0('0x36')]({'where':{'id':_0x3abca8[_0x8ee0('0x39')]['id']}})['then'](handleEntityNotFound(_0x2591b8,null))['then'](function(_0x58c42d){if(_0x58c42d){return _0x58c42d[_0x8ee0('0x53')](_0x3abca8[_0x8ee0('0x2a')][_0x8ee0('0x3d')]);}})['then'](respondWithStatusCode(_0x2591b8,null))[_0x8ee0('0x2b')](handleError(_0x2591b8,null));};exports[_0x8ee0('0x54')]=function(_0x3a683f,_0x3a2145){var _0x32c1d9=moment()['unix']()['toString']();var _0x3c9de3=path[_0x8ee0('0x55')](config[_0x8ee0('0x56')],_0x8ee0('0x57'),_0x8ee0('0x58'),'tmp');var _0x3b755b=path['join'](config[_0x8ee0('0x56')],_0x8ee0('0x57'),_0x8ee0('0x58'),_0x8ee0('0x59'));var _0x1885c1=path[_0x8ee0('0x55')](_0x3c9de3,_0x32c1d9);var _0x5ee892=util[_0x8ee0('0x4a')](_0x8ee0('0x5a'),_0x3a683f[_0x8ee0('0x39')]['id'],_0x32c1d9);var _0x523e90=path[_0x8ee0('0x55')](_0x3c9de3,_0x5ee892);var _0x5b2bdf=[];_0x5b2bdf[_0x8ee0('0x5b')]({'model':db[_0x8ee0('0x5c')],'as':_0x8ee0('0x5c'),'attributes':['id',_0x8ee0('0x5d')],'raw':!![]});_0x5b2bdf[_0x8ee0('0x5b')]({'model':db[_0x8ee0('0x5e')],'as':_0x8ee0('0x5f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x3a683f['query'][_0x8ee0('0x59')]){_0x5b2bdf[_0x8ee0('0x5b')]({'model':db[_0x8ee0('0x60')],'as':_0x8ee0('0x60'),'raw':!![]});}var _0x39f6d1=[{'model':db[_0x8ee0('0x3c')],'as':_0x8ee0('0x61'),'attributes':['id',_0x8ee0('0x38'),_0x8ee0('0x62'),_0x8ee0('0x63'),_0x8ee0('0x64'),_0x8ee0('0x65')],'include':_0x5b2bdf}];_0x39f6d1[_0x8ee0('0x5b')]({'model':db[_0x8ee0('0x66')],'as':_0x8ee0('0x67'),'attributes':['id','name']});_0x39f6d1[_0x8ee0('0x5b')]({'model':db['User'],'as':'Owner','attributes':['id',_0x8ee0('0x5d')]});return db[_0x8ee0('0x24')]['find']({'where':{'id':_0x3a683f[_0x8ee0('0x39')]['id']},'include':_0x39f6d1})[_0x8ee0('0x1c')](handleEntityNotFound(_0x3a2145,null))[_0x8ee0('0x1c')](function(_0xd49dee){if(_0xd49dee){var _0x12c01b=_0xd49dee['get']({'plain':!![]});fs[_0x8ee0('0x68')](_0x1885c1);var _0x4c8813={'channel':_0x8ee0('0x69'),'account':_0x12c01b[_0x8ee0('0x67')]['name'],'agent':_0x12c01b['Owner']?_0x12c01b['Owner'][_0x8ee0('0x5d')]:'N.A.','createdAt':moment(_0x12c01b[_0x8ee0('0x62')])['format'](_0x8ee0('0x4b'))[_0x8ee0('0x6a')](),'closedAt':_0x12c01b[_0x8ee0('0x6b')]?moment(_0x12c01b[_0x8ee0('0x6c')])[_0x8ee0('0x4a')](_0x8ee0('0x4b'))[_0x8ee0('0x6a')]():'','disposition':_0x12c01b['disposition'],'messages':_(_0x12c01b[_0x8ee0('0x61')])[_0x8ee0('0x47')]({'secret':![]})['map'](function(_0x34d879){if(_0x34d879[_0x8ee0('0x60')]){var _0x5b5d43=path[_0x8ee0('0x55')](_0x3b755b,_0x34d879[_0x8ee0('0x60')][_0x8ee0('0x6d')]);if(fs['existsSync'](_0x5b5d43)){fs[_0x8ee0('0x6e')](_0x5b5d43)['pipe'](fs[_0x8ee0('0x6f')](path[_0x8ee0('0x55')](_0x1885c1,_0x34d879[_0x8ee0('0x60')]['basename'])));}}return{'date':moment(_0x34d879['createdAt'])[_0x8ee0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8ee0('0x6a')](),'sender':_0x34d879[_0x8ee0('0x63')]===_0x8ee0('0x70')?_0x34d879[_0x8ee0('0x5c')]?_0x34d879['User'][_0x8ee0('0x5d')]:'System':_0x34d879[_0x8ee0('0x5f')][_0x8ee0('0x71')]+(_0x34d879[_0x8ee0('0x5f')]['lastName']?'\x20'+_0x34d879['Contact'][_0x8ee0('0x72')]:''),'body':_0x34d879[_0x8ee0('0x60')]?_0x34d879['Attachment']['basename']:_0x34d879[_0x8ee0('0x38')],'direction':_0x34d879[_0x8ee0('0x63')]===_0x8ee0('0x70')?'A':'C','secret':_0x34d879[_0x8ee0('0x64')],'read':_0x34d879['read'],'attachment':_0x34d879[_0x8ee0('0x60')]};})[_0x8ee0('0x73')]()};return ejs[_0x8ee0('0x74')](path[_0x8ee0('0x55')](config['root'],_0x8ee0('0x57'),_0x8ee0('0x75'),_0x8ee0('0x76')),{'interaction':_0x4c8813})[_0x8ee0('0x1c')](function(_0x526995){var _0x261a67=path[_0x8ee0('0x55')](_0x1885c1,_0x8ee0('0x77')+_0x12c01b['id']+'-'+_0x32c1d9+_0x8ee0('0x78'));var _0x17394d={'path':_0x261a67,'channel':_0x8ee0('0x69'),'interactionId':_0x12c01b['id']};return pdf[_0x8ee0('0x79')](_0x526995,_0x17394d);})[_0x8ee0('0x1c')](function(){return new BPromise(function(_0x4bd71b,_0x1fe655){zipdir(_0x1885c1,{'saveTo':_0x523e90},function(_0x353520,_0x19fc7b){if(_0x353520)return _0x1fe655(_0x353520);return _0x4bd71b(_0x19fc7b);});})[_0x8ee0('0x1c')](function(){return new BPromise(function(_0x38a291,_0x4e2284){rimraf(_0x1885c1,function(_0x44d9a2){if(_0x44d9a2)_0x4e2284(_0x44d9a2);return _0x38a291();});});})[_0x8ee0('0x1c')](function(){return _0x3a2145['download'](_0x523e90,_0x5ee892,function(_0x2dd964){if(_0x2dd964){console[_0x8ee0('0x7a')]('err',_0x2dd964);}else{fs[_0x8ee0('0x7b')](_0x523e90);}});});});}else{return _0x3a2145['sendStatus'](0xc8);}})[_0x8ee0('0x2b')](handleError(_0x3a2145,null));}; \ No newline at end of file +var _0x0037=['addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','fullname','CmContact','firstName','Attachment','Messages','createdAt','secret','read','Account','User','Owner','get','N.A.','closed','toString','disposition','basename','createReadStream','createWriteStream','out','System','Contact','lastName','renderFile','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','undefined','limit','set','update','then','sendStatus','error','stack','name','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','catch','show','params','model','filters','attributes','intersection','fields','length','include','merge','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','hasOwnProperty','nolimit','offset','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','count','includeAll'];(function(_0x24ed26,_0x90a05a){var _0x563455=function(_0x3489a7){while(--_0x3489a7){_0x24ed26['push'](_0x24ed26['shift']());}};_0x563455(++_0x90a05a);}(_0x0037,0x127));var _0x7003=function(_0x217892,_0x5ef80a){_0x217892=_0x217892-0x0;var _0x17a0ab=_0x0037[_0x217892];return _0x17a0ab;};'use strict';var rimraf=require(_0x7003('0x0'));var zipdir=require(_0x7003('0x1'));var moment=require(_0x7003('0x2'));var BPromise=require(_0x7003('0x3'));var util=require(_0x7003('0x4'));var path=require(_0x7003('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x7003('0x6'));var interaction=require(_0x7003('0x7'));var qs=require(_0x7003('0x8'));var pdf=require(_0x7003('0x9'));var logger=require(_0x7003('0xa'))(_0x7003('0xb'));var config=require(_0x7003('0xc'));var db=require(_0x7003('0xd'))['db'];config[_0x7003('0xe')]=_[_0x7003('0xf')](config[_0x7003('0xe')],{'host':_0x7003('0x10'),'port':0x18eb});var socket=require(_0x7003('0x11'))(new Redis(config[_0x7003('0xe')]));require(_0x7003('0x12'))[_0x7003('0x13')](socket);function respondWithStatusCode(_0x5d7db6,_0x2d1f76){_0x2d1f76=_0x2d1f76||0xcc;return function(_0x43b8d5){if(_0x43b8d5){return _0x5d7db6['sendStatus'](_0x2d1f76);}return _0x5d7db6[_0x7003('0x14')](_0x2d1f76)[_0x7003('0x15')]();};}function respondWithResult(_0x110580,_0x5d4ad9){_0x5d4ad9=_0x5d4ad9||0xc8;return function(_0xdc3547){if(_0xdc3547){return _0x110580['status'](_0x5d4ad9)['json'](_0xdc3547);}};}function respondWithFilteredResult(_0x53bce6,_0x316c88){return function(_0x566b5d){if(_0x566b5d){var _0x90e1ec=typeof _0x316c88['offset']===_0x7003('0x16')&&typeof _0x316c88[_0x7003('0x17')]===_0x7003('0x16');var _0x5d2c81=_0x566b5d['count'];var _0x36dd6b=_0x90e1ec?0x0:_0x316c88['offset'];var _0x170ea3=_0x90e1ec?_0x566b5d['count']:_0x316c88['offset']+_0x316c88[_0x7003('0x17')];var _0x5e00d1;if(_0x170ea3>=_0x5d2c81){_0x170ea3=_0x5d2c81;_0x5e00d1=0xc8;}else{_0x5e00d1=0xce;}_0x53bce6['status'](_0x5e00d1);return _0x53bce6[_0x7003('0x18')]('Content-Range',_0x36dd6b+'-'+_0x170ea3+'/'+_0x5d2c81)['json'](_0x566b5d);}return null;};}function saveUpdates(_0x12ef04){return function(_0x48333c){if(_0x48333c){return _0x48333c[_0x7003('0x19')](_0x12ef04)[_0x7003('0x1a')](function(_0x250aad){return _0x250aad;});}return null;};}function removeEntity(_0xf419af){return function(_0x42af42){if(_0x42af42){return _0x42af42['destroy']()[_0x7003('0x1a')](function(){_0xf419af[_0x7003('0x14')](0xcc)[_0x7003('0x15')]();});}};}function handleEntityNotFound(_0x16303){return function(_0x30a5d5){if(!_0x30a5d5){_0x16303[_0x7003('0x1b')](0x194);}return _0x30a5d5;};}function handleError(_0x25fb69,_0x2c2fe0){_0x2c2fe0=_0x2c2fe0||0x1f4;return function(_0x44971a){logger[_0x7003('0x1c')](_0x44971a[_0x7003('0x1d')]);if(_0x44971a[_0x7003('0x1e')]){delete _0x44971a[_0x7003('0x1e')];}_0x25fb69[_0x7003('0x14')](_0x2c2fe0)['send'](_0x44971a);};}exports[_0x7003('0x1f')]=function(_0x1c6c98,_0x5c5009){var _0x253569={};var _0x3a3dcd=_[_0x7003('0x20')](db[_0x7003('0x21')][_0x7003('0x22')],function(_0x1493d0){return{'name':_0x1493d0[_0x7003('0x23')],'type':_0x1493d0[_0x7003('0x24')][_0x7003('0x25')]};});_0x253569=qs[_0x7003('0x26')](_0x3a3dcd,_0x1c6c98);return interaction[_0x7003('0x27')](_0x7003('0x28'),_0x1c6c98[_0x7003('0x29')],_0x1c6c98[_0x7003('0x2a')],_0x253569,_0x3a3dcd)[_0x7003('0x1a')](respondWithFilteredResult(_0x5c5009,_0x253569))[_0x7003('0x2b')](handleError(_0x5c5009,null));};exports[_0x7003('0x2c')]=function(_0x4fc188,_0x4f1fa7){var _0x2a2ea7={'raw':![],'where':{'id':_0x4fc188[_0x7003('0x2d')]['id']}},_0x40aeca={};_0x40aeca[_0x7003('0x2e')]=_['keys'](db['WhatsappInteraction'][_0x7003('0x22')]);_0x40aeca['query']=_['keys'](_0x4fc188['query']);_0x40aeca[_0x7003('0x2f')]=_['intersection'](_0x40aeca['model'],_0x40aeca[_0x7003('0x29')]);_0x2a2ea7[_0x7003('0x30')]=_[_0x7003('0x31')](_0x40aeca[_0x7003('0x2e')],qs['fields'](_0x4fc188[_0x7003('0x29')][_0x7003('0x32')]));_0x2a2ea7['attributes']=_0x2a2ea7['attributes'][_0x7003('0x33')]?_0x2a2ea7[_0x7003('0x30')]:_0x40aeca[_0x7003('0x2e')];if(_0x4fc188[_0x7003('0x29')]['includeAll']){_0x2a2ea7[_0x7003('0x34')]=[{'all':!![]}];}_0x2a2ea7=_[_0x7003('0x35')]({},_0x2a2ea7,_0x4fc188['options']);return db[_0x7003('0x21')][_0x7003('0x36')](_0x2a2ea7)['then'](handleEntityNotFound(_0x4f1fa7,null))[_0x7003('0x1a')](respondWithResult(_0x4f1fa7,null))[_0x7003('0x2b')](handleError(_0x4f1fa7,null));};exports[_0x7003('0x37')]=function(_0x14c2de,_0xc1da33){return db[_0x7003('0x21')][_0x7003('0x37')](_0x14c2de['body'],{})[_0x7003('0x1a')](respondWithResult(_0xc1da33,0xc9))[_0x7003('0x2b')](handleError(_0xc1da33,null));};exports[_0x7003('0x19')]=function(_0x217da8,_0x1ff0ee){if(_0x217da8[_0x7003('0x38')]['id']){delete _0x217da8['body']['id'];}return db[_0x7003('0x21')][_0x7003('0x36')]({'where':{'id':_0x217da8[_0x7003('0x2d')]['id']}})[_0x7003('0x1a')](handleEntityNotFound(_0x1ff0ee,null))['then'](saveUpdates(_0x217da8['body'],null))[_0x7003('0x1a')](respondWithResult(_0x1ff0ee,null))[_0x7003('0x2b')](handleError(_0x1ff0ee,null));};exports[_0x7003('0x39')]=function(_0x3ae51d,_0xa1c992){return db[_0x7003('0x21')][_0x7003('0x36')]({'where':{'id':_0x3ae51d[_0x7003('0x2d')]['id']}})['then'](handleEntityNotFound(_0xa1c992,null))['then'](removeEntity(_0xa1c992,null))[_0x7003('0x2b')](handleError(_0xa1c992,null));};exports[_0x7003('0x3a')]=function(_0x3bf481,_0x3c7889){return db[_0x7003('0x21')][_0x7003('0x3a')]()[_0x7003('0x1a')](respondWithResult(_0x3c7889,null))['catch'](handleError(_0x3c7889,null));};exports[_0x7003('0x3b')]=function(_0x4aa7c7,_0x514f0a){return db[_0x7003('0x3c')][_0x7003('0x36')]({'where':{'id':_0x4aa7c7[_0x7003('0x2d')]['id']}})[_0x7003('0x1a')](handleEntityNotFound(_0x514f0a,null))[_0x7003('0x1a')](function(_0x5d1253){if(_0x5d1253){return _0x5d1253[_0x7003('0x3b')](_0x4aa7c7[_0x7003('0x38')][_0x7003('0x3d')],_['omit'](_0x4aa7c7[_0x7003('0x38')],[_0x7003('0x3d'),'id'])||{});}})[_0x7003('0x1a')](respondWithResult(_0x514f0a,null))[_0x7003('0x2b')](handleError(_0x514f0a,null));};exports['getMessages']=function(_0x932725,_0x4efc31){var _0x3df75b={'raw':![],'where':{}};var _0x5273c1={};var _0x5b9f7d={'count':0x0,'rows':[]};return db[_0x7003('0x21')]['findOne']({'where':{'id':_0x932725[_0x7003('0x2d')]['id']}})[_0x7003('0x1a')](handleEntityNotFound(_0x4efc31,null))[_0x7003('0x1a')](function(_0x36be46){if(_0x36be46){_0x5273c1[_0x7003('0x2e')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x5273c1[_0x7003('0x29')]=_['keys'](_0x932725[_0x7003('0x29')]);_0x5273c1['filters']=_[_0x7003('0x31')](_0x5273c1['model'],_0x5273c1['query']);_0x3df75b[_0x7003('0x30')]=_[_0x7003('0x31')](_0x5273c1['model'],qs[_0x7003('0x32')](_0x932725[_0x7003('0x29')][_0x7003('0x32')]));_0x3df75b['attributes']=_0x3df75b[_0x7003('0x30')][_0x7003('0x33')]?_0x3df75b[_0x7003('0x30')]:_0x5273c1['model'];if(!_0x932725[_0x7003('0x29')][_0x7003('0x3e')](_0x7003('0x3f'))){_0x3df75b[_0x7003('0x17')]=qs[_0x7003('0x17')](_0x932725[_0x7003('0x29')][_0x7003('0x17')]);_0x3df75b[_0x7003('0x40')]=qs[_0x7003('0x40')](_0x932725['query'][_0x7003('0x40')]);}_0x3df75b['order']=qs[_0x7003('0x41')](_0x932725['query'][_0x7003('0x41')]);_0x3df75b[_0x7003('0x42')]=qs[_0x7003('0x2f')](_[_0x7003('0x43')](_0x932725[_0x7003('0x29')],_0x5273c1['filters']));_0x3df75b[_0x7003('0x42')][_0x7003('0x44')]=_0x36be46['id'];if(_0x932725[_0x7003('0x29')][_0x7003('0x45')]){_0x3df75b['where']=_['merge'](_0x3df75b[_0x7003('0x42')],{'$or':_[_0x7003('0x20')](_0x3df75b[_0x7003('0x30')],function(_0xcee90c){var _0x5ad34a={};_0x5ad34a[_0xcee90c]={'$like':'%'+_0x932725[_0x7003('0x29')]['filter']+'%'};return _0x5ad34a;})});}if(_0x932725[_0x7003('0x29')]['$gte']){var _0x9f6067=_0x932725[_0x7003('0x29')][_0x7003('0x46')][_0x7003('0x47')](',');var _0x514aa3={};_0x514aa3[_0x9f6067[0x0]]={'$gte':moment(_0x9f6067[0x1])[_0x7003('0x48')](_0x7003('0x49'))};_0x3df75b[_0x7003('0x42')]=_[_0x7003('0x35')](_0x3df75b[_0x7003('0x42')],_0x514aa3);}_0x3df75b=_['merge']({},_0x3df75b,_0x932725[_0x7003('0x4a')]);return db[_0x7003('0x3c')][_0x7003('0x4b')]({'where':_0x3df75b[_0x7003('0x42')]})[_0x7003('0x1a')](function(_0x15aaf5){_0x5b9f7d[_0x7003('0x4b')]=_0x15aaf5;if(_0x932725[_0x7003('0x29')][_0x7003('0x4c')]){_0x3df75b[_0x7003('0x34')]=[{'all':!![]}];}return db[_0x7003('0x3c')][_0x7003('0x27')](_0x3df75b);})[_0x7003('0x1a')](function(_0x2f5b03){_0x5b9f7d['rows']=_0x2f5b03;return _0x5b9f7d;});}})['then'](respondWithFilteredResult(_0x4efc31,_0x3df75b))[_0x7003('0x2b')](handleError(_0x4efc31,null));};exports[_0x7003('0x4d')]=function(_0x4ccbef,_0x35af9a){return db[_0x7003('0x21')][_0x7003('0x36')]({'where':{'id':_0x4ccbef[_0x7003('0x2d')]['id']}})[_0x7003('0x1a')](handleEntityNotFound(_0x35af9a,null))[_0x7003('0x1a')](function(_0x4af23c){if(_0x4af23c){return _0x4af23c[_0x7003('0x4e')](_0x4ccbef[_0x7003('0x38')][_0x7003('0x3d')],_['omit'](_0x4ccbef[_0x7003('0x38')],[_0x7003('0x3d'),'id'])||{})[_0x7003('0x4f')](function(){return db[_0x7003('0x50')][_0x7003('0x27')]({'attributes':['id',_0x7003('0x1e'),'color'],'where':{'id':_0x4ccbef['body'][_0x7003('0x3d')]}});})[_0x7003('0x1a')](function(_0x45b981){socket[_0x7003('0x51')](_0x7003('0x52'),{'id':Number(_0x4ccbef['params']['id']),'tags':_0x45b981||[]});return{'id':Number(_0x4ccbef[_0x7003('0x2d')]['id']),'tags':_0x45b981||[]};});}})[_0x7003('0x1a')](respondWithResult(_0x35af9a,null))[_0x7003('0x2b')](handleError(_0x35af9a,null));};exports[_0x7003('0x53')]=function(_0x5c822a,_0x1c7a06){return db[_0x7003('0x21')][_0x7003('0x36')]({'where':{'id':_0x5c822a[_0x7003('0x2d')]['id']}})[_0x7003('0x1a')](handleEntityNotFound(_0x1c7a06,null))[_0x7003('0x1a')](function(_0x330211){if(_0x330211){return _0x330211['removeTags'](_0x5c822a['query'][_0x7003('0x3d')]);}})[_0x7003('0x1a')](respondWithStatusCode(_0x1c7a06,null))[_0x7003('0x2b')](handleError(_0x1c7a06,null));};exports[_0x7003('0x54')]=function(_0x548a19,_0x180f50){var _0x153250=moment()[_0x7003('0x55')]()['toString']();var _0x288f7e=path[_0x7003('0x56')](config[_0x7003('0x57')],_0x7003('0x58'),_0x7003('0x59'),_0x7003('0x5a'));var _0x2f1d59=path[_0x7003('0x56')](config[_0x7003('0x57')],'server',_0x7003('0x59'),_0x7003('0x5b'));var _0x19c9b9=path['join'](_0x288f7e,_0x153250);var _0x19a595=util['format'](_0x7003('0x5c'),_0x548a19[_0x7003('0x2d')]['id'],_0x153250);var _0x1c1071=path['join'](_0x288f7e,_0x19a595);var _0x3a7c0c=[];_0x3a7c0c[_0x7003('0x5d')]({'model':db['User'],'as':'User','attributes':['id',_0x7003('0x5e')],'raw':!![]});_0x3a7c0c[_0x7003('0x5d')]({'model':db[_0x7003('0x5f')],'as':'Contact','attributes':['id',_0x7003('0x60'),'lastName'],'raw':!![]});if(_0x548a19[_0x7003('0x29')]['attachments']){_0x3a7c0c[_0x7003('0x5d')]({'model':db[_0x7003('0x61')],'as':_0x7003('0x61'),'raw':!![]});}var _0x52bf54=[{'model':db[_0x7003('0x3c')],'as':_0x7003('0x62'),'attributes':['id',_0x7003('0x38'),_0x7003('0x63'),'direction',_0x7003('0x64'),_0x7003('0x65')],'include':_0x3a7c0c}];_0x52bf54['push']({'model':db['WhatsappAccount'],'as':_0x7003('0x66'),'attributes':['id',_0x7003('0x1e')]});_0x52bf54[_0x7003('0x5d')]({'model':db[_0x7003('0x67')],'as':_0x7003('0x68'),'attributes':['id','fullname']});return db['WhatsappInteraction']['find']({'where':{'id':_0x548a19[_0x7003('0x2d')]['id']},'include':_0x52bf54})[_0x7003('0x1a')](handleEntityNotFound(_0x180f50,null))[_0x7003('0x1a')](function(_0x4aecd7){if(_0x4aecd7){var _0x323334=_0x4aecd7[_0x7003('0x69')]({'plain':!![]});fs['mkdirSync'](_0x19c9b9);var _0x1ca5e4={'channel':'Whatsapp','account':_0x323334['Account']['name'],'agent':_0x323334[_0x7003('0x68')]?_0x323334[_0x7003('0x68')][_0x7003('0x5e')]:_0x7003('0x6a'),'createdAt':moment(_0x323334[_0x7003('0x63')])[_0x7003('0x48')](_0x7003('0x49'))['toString'](),'closedAt':_0x323334[_0x7003('0x6b')]?moment(_0x323334['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7003('0x6c')]():'','disposition':_0x323334[_0x7003('0x6d')],'messages':_(_0x323334[_0x7003('0x62')])[_0x7003('0x45')]({'secret':![]})[_0x7003('0x20')](function(_0x3a9cc8){if(_0x3a9cc8[_0x7003('0x61')]){var _0x2f867d=path[_0x7003('0x56')](_0x2f1d59,_0x3a9cc8[_0x7003('0x61')][_0x7003('0x6e')]);if(fs['existsSync'](_0x2f867d)){fs[_0x7003('0x6f')](_0x2f867d)['pipe'](fs[_0x7003('0x70')](path[_0x7003('0x56')](_0x19c9b9,_0x3a9cc8[_0x7003('0x61')][_0x7003('0x6e')])));}}return{'date':moment(_0x3a9cc8['createdAt'])['format'](_0x7003('0x49'))[_0x7003('0x6c')](),'sender':_0x3a9cc8['direction']===_0x7003('0x71')?_0x3a9cc8[_0x7003('0x67')]?_0x3a9cc8[_0x7003('0x67')]['fullname']:_0x7003('0x72'):_0x3a9cc8[_0x7003('0x73')]['firstName']+(_0x3a9cc8[_0x7003('0x73')]['lastName']?'\x20'+_0x3a9cc8[_0x7003('0x73')][_0x7003('0x74')]:''),'body':_0x3a9cc8[_0x7003('0x61')]?_0x3a9cc8[_0x7003('0x61')][_0x7003('0x6e')]:_0x3a9cc8[_0x7003('0x38')],'direction':_0x3a9cc8['direction']===_0x7003('0x71')?'A':'C','secret':_0x3a9cc8['secret'],'read':_0x3a9cc8['read'],'attachment':_0x3a9cc8['Attachment']};})['value']()};return ejs[_0x7003('0x75')](path[_0x7003('0x56')](config[_0x7003('0x57')],_0x7003('0x58'),'views','downloadInteraction.ejs'),{'interaction':_0x1ca5e4})[_0x7003('0x1a')](function(_0x357b2d){var _0x58b146=path[_0x7003('0x56')](_0x19c9b9,_0x7003('0x76')+_0x323334['id']+'-'+_0x153250+_0x7003('0x77'));var _0xc68d5c={'path':_0x58b146,'channel':_0x7003('0x78'),'interactionId':_0x323334['id']};return pdf[_0x7003('0x79')](_0x357b2d,_0xc68d5c);})[_0x7003('0x1a')](function(){return new BPromise(function(_0x5b281f,_0x150003){zipdir(_0x19c9b9,{'saveTo':_0x1c1071},function(_0x4da6f8,_0xc5ed78){if(_0x4da6f8)return _0x150003(_0x4da6f8);return _0x5b281f(_0xc5ed78);});})[_0x7003('0x1a')](function(){return new BPromise(function(_0x2c3ada,_0x2b2baf){rimraf(_0x19c9b9,function(_0x5b134a){if(_0x5b134a)_0x2b2baf(_0x5b134a);return _0x2c3ada();});});})[_0x7003('0x1a')](function(){return _0x180f50['download'](_0x1c1071,_0x19a595,function(_0x379413){if(_0x379413){console[_0x7003('0x7a')](_0x7003('0x7b'),_0x379413);}else{fs['unlinkSync'](_0x1c1071);}});});});}else{return _0x180f50[_0x7003('0x1b')](0xc8);}})[_0x7003('0x2b')](handleError(_0x180f50,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 55073f0..c640b64 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 _0x402f=['then','map','findAll','setDataValue','unreadMessages','length','emit','events','WhatsappInteraction','setMaxListeners','save','update','getUsers'];(function(_0x207a6a,_0x5ae3b3){var _0x3b924f=function(_0xda0fd){while(--_0xda0fd){_0x207a6a['push'](_0x207a6a['shift']());}};_0x3b924f(++_0x5ae3b3);}(_0x402f,0x6f));var _0xf402=function(_0x595e76,_0x31dd86){_0x595e76=_0x595e76-0x0;var _0x33f91a=_0x402f[_0x595e76];return _0x33f91a;};'use strict';var EventEmitter=require(_0xf402('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xf402('0x1')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xf402('0x2')](0x0);var events={'afterCreate':_0xf402('0x3'),'afterUpdate':_0xf402('0x4'),'afterDestroy':'remove'};function emitEvent(_0x246c5f){return function(_0x48771a,_0x20c2cc,_0x270766){_0x48771a[_0xf402('0x5')]({'attributes':['id'],'raw':!![]})[_0xf402('0x6')](function(_0xa1b27d){_0x48771a['setDataValue']('Users',_0xa1b27d[_0xf402('0x7')](function(_0x154bd3){return{'id':_0x154bd3['id']};}));return WhatsappMessage[_0xf402('0x8')]({'where':{'WhatsappInteractionId':_0x48771a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf402('0x6')](function(_0x18c918){_0x48771a[_0xf402('0x9')](_0xf402('0xa'),_0x18c918[_0xf402('0xb')]);WhatsappInteractionEvents['emit'](_0x246c5f+':'+_0x48771a['id'],_0x48771a);WhatsappInteractionEvents[_0xf402('0xc')](_0x246c5f,_0x48771a);_0x270766(null);})['catch'](_0x270766(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xfdb5=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfdb5[_0x4c445a];return _0x2f611c;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var WhatsappInteraction=require(_0x5fdb('0x1'))['db'][_0x5fdb('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x5fdb('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5fdb('0x4')](0x0);var events={'afterCreate':_0x5fdb('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff059){return function(_0x4e6ad9,_0xc837cf,_0x4a2149){_0x4e6ad9[_0x5fdb('0x6')]({'attributes':['id'],'raw':!![]})[_0x5fdb('0x7')](function(_0x4b6fe0){_0x4e6ad9['setDataValue']('Users',_0x4b6fe0[_0x5fdb('0x8')](function(_0x28ad92){return{'id':_0x28ad92['id']};}));return WhatsappMessage[_0x5fdb('0x9')]({'where':{'WhatsappInteractionId':_0x4e6ad9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5fdb('0x7')](function(_0x4034fd){_0x4e6ad9[_0x5fdb('0xa')](_0x5fdb('0xb'),_0x4034fd['length']);WhatsappInteractionEvents[_0x5fdb('0xc')](_0x3ff059+':'+_0x4e6ad9['id'],_0x4e6ad9);WhatsappInteractionEvents['emit'](_0x3ff059,_0x4e6ad9);_0x4a2149(null);})[_0x5fdb('0xd')](_0x4a2149(null));};}for(var e in events){if(events[_0x5fdb('0xe')](e)){var event=events[e];WhatsappInteraction[_0x5fdb('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index aa9f724..c3771bb 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 _0x8226=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x8226,0xe7));var _0x6822=function(_0x1c6ceb,_0x19956c){_0x1c6ceb=_0x1c6ceb-0x0;var _0x5c8a17=_0x8226[_0x1c6ceb];return _0x5c8a17;};'use strict';var _=require(_0x6822('0x0'));var util=require('util');var logger=require(_0x6822('0x1'))(_0x6822('0x2'));var moment=require(_0x6822('0x3'));var BPromise=require(_0x6822('0x4'));var rp=require(_0x6822('0x5'));var fs=require('fs');var path=require(_0x6822('0x6'));var rimraf=require(_0x6822('0x7'));var config=require(_0x6822('0x8'));var attributes=require(_0x6822('0x9'));module[_0x6822('0xa')]=function(_0x33bf21,_0x2d7930){return _0x33bf21['define'](_0x6822('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56a7fe,_0x2c94cf,_0x3eb25b){if(_0x56a7fe[_0x6822('0xc')](_0x6822('0xd'))){_0x56a7fe[_0x6822('0xe')]=moment()[_0x6822('0xf')](_0x6822('0x10'));}_0x3eb25b(null,_0x56a7fe);}}});}; \ No newline at end of file +var _0xf54e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','WhatsappInteraction','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x3884ee,_0x6664ce){var _0x5c7eea=function(_0x234fd5){while(--_0x234fd5){_0x3884ee['push'](_0x3884ee['shift']());}};_0x5c7eea(++_0x6664ce);}(_0xf54e,0xec));var _0xef54=function(_0x58de4a,_0x564dbc){_0x58de4a=_0x58de4a-0x0;var _0x178820=_0xf54e[_0x58de4a];return _0x178820;};'use strict';var _=require(_0xef54('0x0'));var util=require(_0xef54('0x1'));var logger=require(_0xef54('0x2'))(_0xef54('0x3'));var moment=require(_0xef54('0x4'));var BPromise=require(_0xef54('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef54('0x6'));var rimraf=require(_0xef54('0x7'));var config=require(_0xef54('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0xef54('0x9')]=function(_0x184f33,_0x547c78){return _0x184f33['define'](_0xef54('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eb729,_0x3fe6c9,_0xdbc634){if(_0x5eb729['changed']('closed')){_0x5eb729[_0xef54('0xb')]=moment()[_0xef54('0xc')](_0xef54('0xd'));}_0xdbc634(null,_0x5eb729);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 9a00128..44944da 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 _0x8582=['redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','then','find','addTags','omit','spread','AddTags','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x491429,_0x953011){var _0x12a136=function(_0x21ee9e){while(--_0x21ee9e){_0x491429['push'](_0x491429['shift']());}};_0x12a136(++_0x953011);}(_0x8582,0xe7));var _0x2858=function(_0x2e8ea0,_0x5d0e07){_0x2e8ea0=_0x2e8ea0-0x0;var _0x3ad251=_0x8582[_0x2e8ea0];return _0x3ad251;};'use strict';var _=require(_0x2858('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2858('0x1'));var rs=require(_0x2858('0x2'));var fs=require('fs');var Redis=require(_0x2858('0x3'));var db=require(_0x2858('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2858('0x5'))(_0x2858('0x6'));var config=require(_0x2858('0x7'));var jayson=require(_0x2858('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x2858('0x9')]=_[_0x2858('0xa')](config[_0x2858('0x9')],{'host':_0x2858('0xb'),'port':0x18eb});var socket=require(_0x2858('0xc'))(new Redis(config[_0x2858('0x9')]));require(_0x2858('0xd'))[_0x2858('0xe')](socket);function respondWithRpcPromise(_0xfefa78,_0x524e78,_0x2a6a4a){return new BPromise(function(_0x11b0bc,_0x3497c1){return client[_0x2858('0xf')](_0xfefa78,_0x2a6a4a)['then'](function(_0x380999){logger[_0x2858('0x10')](_0x2858('0x11'),_0x524e78,_0x2858('0x12'));logger['debug'](_0x2858('0x13'),_0x524e78,_0x2858('0x12'),JSON[_0x2858('0x14')](_0x380999));if(_0x380999[_0x2858('0x15')]){if(_0x380999[_0x2858('0x15')][_0x2858('0x16')]===0x1f4){logger[_0x2858('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x524e78,_0x380999[_0x2858('0x15')][_0x2858('0x17')]);return _0x3497c1(_0x380999[_0x2858('0x15')][_0x2858('0x17')]);}logger[_0x2858('0x15')](_0x2858('0x11'),_0x524e78,_0x380999[_0x2858('0x15')][_0x2858('0x17')]);return _0x11b0bc(_0x380999['error'][_0x2858('0x17')]);}else{logger[_0x2858('0x10')](_0x2858('0x11'),_0x524e78,_0x2858('0x12'));_0x11b0bc(_0x380999[_0x2858('0x18')]['message']);}})[_0x2858('0x19')](function(_0x2dd159){logger[_0x2858('0x15')](_0x2858('0x11'),_0x524e78,_0x2dd159);_0x3497c1(_0x2dd159);});});}exports[_0x2858('0x1a')]=function(_0x42cff8){var _0x3f167c=this;return new Promise(function(_0x43fc53,_0x540442){return db[_0x2858('0x1b')][_0x2858('0x1c')](_0x42cff8[_0x2858('0x1d')],{'raw':_0x42cff8[_0x2858('0x1e')]?_0x42cff8[_0x2858('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42cff8[_0x2858('0x1e')]?_0x42cff8['options'][_0x2858('0x1f')]||null:null,'attributes':_0x42cff8['options']?_0x42cff8['options'][_0x2858('0x20')]||null:null,'limit':_0x42cff8[_0x2858('0x1e')]?_0x42cff8[_0x2858('0x1e')]['limit']||null:null})[_0x2858('0x21')](function(_0x17af48){logger[_0x2858('0x10')](_0x2858('0x1a'),_0x42cff8);logger['debug'](_0x2858('0x1a'),_0x42cff8,JSON[_0x2858('0x14')](_0x17af48));_0x43fc53(_0x17af48);})[_0x2858('0x19')](function(_0x3ca44c){logger[_0x2858('0x15')](_0x2858('0x1a'),_0x3ca44c[_0x2858('0x17')],_0x42cff8);_0x540442(_0x3f167c[_0x2858('0x15')](0x1f4,_0x3ca44c[_0x2858('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x121be2){return new Promise(function(_0x2d5338,_0x242b21){return db['WhatsappInteraction'][_0x2858('0x22')]({'where':_0x121be2[_0x2858('0x1e')]?_0x121be2[_0x2858('0x1e')][_0x2858('0x1f')]||null:null})[_0x2858('0x21')](function(_0x6d7e6d){if(_0x6d7e6d){return _0x6d7e6d[_0x2858('0x23')](_0x121be2['body']['ids'],_[_0x2858('0x24')](_0x121be2['body'],['ids','id'])||{});}})[_0x2858('0x25')](function(_0x2eb3ec){logger[_0x2858('0x10')](_0x2858('0x26'),_0x121be2);logger[_0x2858('0x27')](_0x2858('0x26'),_0x121be2,JSON['stringify'](_0x2eb3ec));_0x2d5338(_0x2eb3ec);})[_0x2858('0x19')](function(_0xbc00f2){logger[_0x2858('0x15')]('AddTags',_0xbc00f2[_0x2858('0x17')],_0x121be2);_0x242b21(_this[_0x2858('0x15')](0x1f4,_0xbc00f2['message']));});});}; \ No newline at end of file +var _0xa311=['jayson/promise','client','http','defaults','redis','localhost','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','then','stringify','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x4f3a6a,_0x3fc1c2){var _0x1d2458=function(_0x3db9ad){while(--_0x3db9ad){_0x4f3a6a['push'](_0x4f3a6a['shift']());}};_0x1d2458(++_0x3fc1c2);}(_0xa311,0x193));var _0x1a31=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa311[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var util=require(_0x1a31('0x0'));var moment=require(_0x1a31('0x1'));var BPromise=require(_0x1a31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a31('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a31('0x4'));var logger=require('../../config/logger')(_0x1a31('0x5'));var config=require(_0x1a31('0x6'));var jayson=require(_0x1a31('0x7'));var client=jayson[_0x1a31('0x8')][_0x1a31('0x9')]({'port':0x232a});config['redis']=_[_0x1a31('0xa')](config[_0x1a31('0xb')],{'host':_0x1a31('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a31('0xb')]));require(_0x1a31('0xd'))[_0x1a31('0xe')](socket);function respondWithRpcPromise(_0x3e88ef,_0x4cc173,_0x226f2e){return new BPromise(function(_0x5bb589,_0x1bdd73){return client[_0x1a31('0xf')](_0x3e88ef,_0x226f2e)['then'](function(_0x21305a){logger[_0x1a31('0x10')](_0x1a31('0x11'),_0x4cc173,_0x1a31('0x12'));logger[_0x1a31('0x13')](_0x1a31('0x14'),_0x4cc173,_0x1a31('0x12'),JSON['stringify'](_0x21305a));if(_0x21305a[_0x1a31('0x15')]){if(_0x21305a[_0x1a31('0x15')][_0x1a31('0x16')]===0x1f4){logger[_0x1a31('0x15')](_0x1a31('0x11'),_0x4cc173,_0x21305a['error'][_0x1a31('0x17')]);return _0x1bdd73(_0x21305a[_0x1a31('0x15')][_0x1a31('0x17')]);}logger['error'](_0x1a31('0x11'),_0x4cc173,_0x21305a[_0x1a31('0x15')][_0x1a31('0x17')]);return _0x5bb589(_0x21305a[_0x1a31('0x15')][_0x1a31('0x17')]);}else{logger[_0x1a31('0x10')](_0x1a31('0x11'),_0x4cc173,'request\x20sent');_0x5bb589(_0x21305a[_0x1a31('0x18')][_0x1a31('0x17')]);}})['catch'](function(_0x48694f){logger[_0x1a31('0x15')](_0x1a31('0x11'),_0x4cc173,_0x48694f);_0x1bdd73(_0x48694f);});});}exports[_0x1a31('0x19')]=function(_0x3d9681){var _0x211be1=this;return new Promise(function(_0x570331,_0x2143ba){return db['WhatsappInteraction'][_0x1a31('0x1a')](_0x3d9681[_0x1a31('0x1b')],{'raw':_0x3d9681['options']?_0x3d9681[_0x1a31('0x1c')][_0x1a31('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d9681['options']?_0x3d9681[_0x1a31('0x1c')][_0x1a31('0x1e')]||null:null,'attributes':_0x3d9681[_0x1a31('0x1c')]?_0x3d9681[_0x1a31('0x1c')][_0x1a31('0x1f')]||null:null,'limit':_0x3d9681['options']?_0x3d9681[_0x1a31('0x1c')]['limit']||null:null})[_0x1a31('0x20')](function(_0x5b3abc){logger[_0x1a31('0x10')]('UpdateWhatsappInteraction',_0x3d9681);logger[_0x1a31('0x13')](_0x1a31('0x19'),_0x3d9681,JSON[_0x1a31('0x21')](_0x5b3abc));_0x570331(_0x5b3abc);})['catch'](function(_0x5cc610){logger[_0x1a31('0x15')](_0x1a31('0x19'),_0x5cc610['message'],_0x3d9681);_0x2143ba(_0x211be1[_0x1a31('0x15')](0x1f4,_0x5cc610['message']));});});};exports[_0x1a31('0x22')]=function(_0x107f18){return new Promise(function(_0x14ad84,_0x421cff){return db[_0x1a31('0x23')][_0x1a31('0x24')]({'where':_0x107f18[_0x1a31('0x1c')]?_0x107f18[_0x1a31('0x1c')]['where']||null:null})[_0x1a31('0x20')](function(_0x55b9f9){if(_0x55b9f9){return _0x55b9f9[_0x1a31('0x25')](_0x107f18[_0x1a31('0x1b')][_0x1a31('0x26')],_['omit'](_0x107f18[_0x1a31('0x1b')],[_0x1a31('0x26'),'id'])||{});}})[_0x1a31('0x27')](function(_0xf12cc3){logger['info'](_0x1a31('0x28'),_0x107f18);logger['debug'](_0x1a31('0x28'),_0x107f18,JSON[_0x1a31('0x21')](_0xf12cc3));_0x14ad84(_0xf12cc3);})['catch'](function(_0x5d80d9){logger['error'](_0x1a31('0x28'),_0x5d80d9[_0x1a31('0x17')],_0x107f18);_0x421cff(_this[_0x1a31('0x15')](0x1f4,_0x5d80d9[_0x1a31('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 16a5f78..6512930 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 _0x3b5f=['register','length','./whatsappInteraction.events','save','remove','emit','removeListener'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0x3b5f,0x191));var _0xf3b5=function(_0x82dcba,_0x4e1a63){_0x82dcba=_0x82dcba-0x0;var _0x61952c=_0x3b5f[_0x82dcba];return _0x61952c;};'use strict';var WhatsappInteractionEvents=require(_0xf3b5('0x0'));var events=[_0xf3b5('0x1'),_0xf3b5('0x2'),'update'];function createListener(_0x5512ce,_0x122e37){return function(_0x28ec81){_0x122e37[_0xf3b5('0x3')](_0x5512ce,_0x28ec81);};}function removeListener(_0x249af6,_0x502bd3){return function(){WhatsappInteractionEvents[_0xf3b5('0x4')](_0x249af6,_0x502bd3);};}exports[_0xf3b5('0x5')]=function(_0x3fe754){for(var _0x35a66f=0x0,_0x1c4030=events[_0xf3b5('0x6')];_0x35a66f<_0x1c4030;_0x35a66f++){var _0x543b59=events[_0x35a66f];var _0x41c418=createListener('whatsappInteraction:'+_0x543b59,_0x3fe754);WhatsappInteractionEvents['on'](_0x543b59,_0x41c418);}}; \ No newline at end of file +var _0xfae1=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x3651eb,_0xa10cb8){var _0x230cae=function(_0xf5e800){while(--_0xf5e800){_0x3651eb['push'](_0x3651eb['shift']());}};_0x230cae(++_0xa10cb8);}(_0xfae1,0xd5));var _0x1fae=function(_0x515219,_0x25a9db){_0x515219=_0x515219-0x0;var _0x1205ca=_0xfae1[_0x515219];return _0x1205ca;};'use strict';var WhatsappInteractionEvents=require(_0x1fae('0x0'));var events=[_0x1fae('0x1'),_0x1fae('0x2'),_0x1fae('0x3')];function createListener(_0x4ecca2,_0x80a854){return function(_0x236e9){_0x80a854[_0x1fae('0x4')](_0x4ecca2,_0x236e9);};}function removeListener(_0x1fd686,_0x6090c5){return function(){WhatsappInteractionEvents[_0x1fae('0x5')](_0x1fd686,_0x6090c5);};}exports[_0x1fae('0x6')]=function(_0x504255){for(var _0x31bf44=0x0,_0x4a05b0=events[_0x1fae('0x7')];_0x31bf44<_0x4a05b0;_0x31bf44++){var _0x520c60=events[_0x31bf44];var _0x14889f=createListener(_0x1fae('0x8')+_0x520c60,_0x504255);WhatsappInteractionEvents['on'](_0x520c60,_0x14889f);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 38a7c74..c910f01 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 _0x240b=['update','/:id/accept','accept','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','status','put'];(function(_0x10593a,_0x535c2f){var _0x37e796=function(_0x3a9890){while(--_0x3a9890){_0x10593a['push'](_0x10593a['shift']());}};_0x37e796(++_0x535c2f);}(_0x240b,0x72));var _0xb240=function(_0xe67e61,_0x7c7fa3){_0xe67e61=_0xe67e61-0x0;var _0x4fcef8=_0x240b[_0xe67e61];return _0x4fcef8;};'use strict';var multer=require('multer');var util=require(_0xb240('0x0'));var path=require(_0xb240('0x1'));var timeout=require(_0xb240('0x2'));var express=require('express');var router=express[_0xb240('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb240('0x4'));var interaction=require(_0xb240('0x5'));var config=require(_0xb240('0x6'));var controller=require(_0xb240('0x7'));router['get']('/',auth[_0xb240('0x8')](),controller[_0xb240('0x9')]);router[_0xb240('0xa')](_0xb240('0xb'),auth[_0xb240('0x8')](),controller[_0xb240('0xc')]);router[_0xb240('0xa')](_0xb240('0xd'),auth[_0xb240('0x8')](),controller['show']);router[_0xb240('0xe')]('/',auth[_0xb240('0x8')](),interaction[_0xb240('0xf')](_0xb240('0x10'),_0xb240('0x11')),controller[_0xb240('0x12')]);router['post']('/:id/status',controller[_0xb240('0x13')]);router[_0xb240('0x14')](_0xb240('0xd'),auth[_0xb240('0x8')](),controller[_0xb240('0x15')]);router['put'](_0xb240('0x16'),auth[_0xb240('0x8')](),controller[_0xb240('0x17')]);router['put']('/:id/reject',auth[_0xb240('0x8')](),controller['reject']);router[_0xb240('0x18')]('/:id',auth[_0xb240('0x8')](),controller[_0xb240('0x19')]);module[_0xb240('0x1a')]=router; \ No newline at end of file +var _0x6ea0=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','whatsapp','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports'];(function(_0x466b62,_0x3f9384){var _0x5dd5ad=function(_0x3a892d){while(--_0x3a892d){_0x466b62['push'](_0x466b62['shift']());}};_0x5dd5ad(++_0x3f9384);}(_0x6ea0,0x1c0));var _0x06ea=function(_0x3203ed,_0xb3a578){_0x3203ed=_0x3203ed-0x0;var _0x346e12=_0x6ea0[_0x3203ed];return _0x346e12;};'use strict';var multer=require(_0x06ea('0x0'));var util=require(_0x06ea('0x1'));var path=require(_0x06ea('0x2'));var timeout=require(_0x06ea('0x3'));var express=require(_0x06ea('0x4'));var router=express['Router']();var fs_extra=require(_0x06ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x06ea('0x6'));var config=require('../../config/environment');var controller=require(_0x06ea('0x7'));router[_0x06ea('0x8')]('/',auth[_0x06ea('0x9')](),controller[_0x06ea('0xa')]);router[_0x06ea('0x8')](_0x06ea('0xb'),auth['isAuthenticated'](),controller[_0x06ea('0xc')]);router[_0x06ea('0x8')](_0x06ea('0xd'),auth[_0x06ea('0x9')](),controller[_0x06ea('0xe')]);router[_0x06ea('0xf')]('/',auth[_0x06ea('0x9')](),interaction['tracked'](_0x06ea('0x10'),'whatsappmessage:create'),controller[_0x06ea('0x11')]);router[_0x06ea('0xf')](_0x06ea('0x12'),controller[_0x06ea('0x13')]);router[_0x06ea('0x14')](_0x06ea('0xd'),auth['isAuthenticated'](),controller[_0x06ea('0x15')]);router[_0x06ea('0x14')](_0x06ea('0x16'),auth[_0x06ea('0x9')](),controller[_0x06ea('0x17')]);router[_0x06ea('0x14')](_0x06ea('0x18'),auth[_0x06ea('0x9')](),controller[_0x06ea('0x19')]);router['delete']('/:id',auth[_0x06ea('0x9')](),controller[_0x06ea('0x1a')]);module[_0x06ea('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index b5f3f08..309610a 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 _0x96b2=['TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN','exports'];(function(_0x293130,_0x5da862){var _0x30de42=function(_0x3e38ce){while(--_0x3e38ce){_0x293130['push'](_0x293130['shift']());}};_0x30de42(++_0x5da862);}(_0x96b2,0x1cf));var _0x296b=function(_0x1c258b,_0xd3a213){_0x1c258b=_0x1c258b-0x0;var _0x1dd679=_0x96b2[_0x1c258b];return _0x1dd679;};'use strict';var Sequelize=require('sequelize');module[_0x296b('0x0')]={'body':{'type':Sequelize[_0x296b('0x1')](_0x296b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x296b('0x3')]('in',_0x296b('0x4')),'defaultValue':_0x296b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x296b('0x5')]},'readAt':{'type':Sequelize[_0x296b('0x6')]},'secret':{'type':Sequelize[_0x296b('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x296b('0x5')]},'providerResponse':{'type':Sequelize[_0x296b('0x1')]}}; \ No newline at end of file +var _0x5f79=['out','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x27399f,_0x1076de){var _0x46aeb7=function(_0x2de2a1){while(--_0x2de2a1){_0x27399f['push'](_0x27399f['shift']());}};_0x46aeb7(++_0x1076de);}(_0x5f79,0x92));var _0x95f7=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x5f79[_0xd336fa];return _0x3370b1;};'use strict';var Sequelize=require('sequelize');module[_0x95f7('0x0')]={'body':{'type':Sequelize[_0x95f7('0x1')](_0x95f7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x95f7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x95f7('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x95f7('0x5')](0xbe)},'phone':{'type':Sequelize[_0x95f7('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x95f7('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x95f7('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 0bbc168..08d4b35 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 _0x2693=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','whatsapp-interactions','reject','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','WhatsappMessage','fieldName','type','key','map','query','keys','intersection','model','fields'];(function(_0x269787,_0x5014c1){var _0x103ab7=function(_0x342db2){while(--_0x342db2){_0x269787['push'](_0x269787['shift']());}};_0x103ab7(++_0x5014c1);}(_0x2693,0x171));var _0x3269=function(_0xdb6e6c,_0x1da7cb){_0xdb6e6c=_0xdb6e6c-0x0;var _0x49d282=_0x2693[_0xdb6e6c];return _0x49d282;};'use strict';var emlformat=require(_0x3269('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3269('0x1'));var jsonpatch=require(_0x3269('0x2'));var rp=require(_0x3269('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3269('0x4'));var util=require(_0x3269('0x5'));var path=require(_0x3269('0x6'));var sox=require(_0x3269('0x7'));var csv=require(_0x3269('0x8'));var ejs=require(_0x3269('0x9'));var fs=require('fs');var fs_extra=require(_0x3269('0xa'));var _=require(_0x3269('0xb'));var squel=require(_0x3269('0xc'));var crypto=require('crypto');var jsforce=require(_0x3269('0xd'));var deskjs=require(_0x3269('0xe'));var toCsv=require(_0x3269('0x8'));var querystring=require(_0x3269('0xf'));var Papa=require(_0x3269('0x10'));var Redis=require('ioredis');var authService=require(_0x3269('0x11'));var qs=require(_0x3269('0x12'));var as=require(_0x3269('0x13'));var hardwareService=require(_0x3269('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3269('0x15'));var licenseUtil=require(_0x3269('0x16'));var db=require(_0x3269('0x17'))['db'];config[_0x3269('0x18')]=_[_0x3269('0x19')](config[_0x3269('0x18')],{'host':_0x3269('0x1a'),'port':0x18eb});var socket=require(_0x3269('0x1b'))(new Redis(config[_0x3269('0x18')]));require(_0x3269('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3269('0x1d')]({'port':0x232c});var client9002=jayson[_0x3269('0x1e')][_0x3269('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x48512f,_0x1da307,_0x5560f1,_0x5d6f0b){return new BPromise(function(_0x13bc05,_0x28bee8){var _0x4bef64=_0x5d6f0b||client;return _0x4bef64[_0x3269('0x1f')](_0x48512f,_0x5560f1)[_0x3269('0x20')](function(_0x4337e3){logger[_0x3269('0x21')](_0x3269('0x22'),_0x1da307,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1da307,_0x3269('0x23'),JSON[_0x3269('0x24')](_0x4337e3));if(_0x4337e3[_0x3269('0x25')]){if(_0x4337e3[_0x3269('0x25')][_0x3269('0x26')]===0x1f4){logger[_0x3269('0x25')](_0x3269('0x22'),_0x1da307,_0x4337e3[_0x3269('0x25')][_0x3269('0x27')]);return _0x28bee8(_0x4337e3[_0x3269('0x25')]['message']);}logger['error'](_0x3269('0x22'),_0x1da307,_0x4337e3[_0x3269('0x25')]['message']);return _0x13bc05(_0x4337e3[_0x3269('0x25')][_0x3269('0x27')]);}else{logger[_0x3269('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x1da307,_0x3269('0x23'));_0x13bc05(_0x4337e3[_0x3269('0x28')]['message']);}})[_0x3269('0x29')](function(_0x5d0b4e){logger['error'](_0x3269('0x22'),_0x1da307,_0x5d0b4e);_0x28bee8(_0x5d0b4e);});});}function respondWithStatusCode(_0x37164b,_0x7ae104){_0x7ae104=_0x7ae104||0xcc;return function(_0x44c6ff){if(_0x44c6ff){return _0x37164b['sendStatus'](_0x7ae104);}return _0x37164b['status'](_0x7ae104)[_0x3269('0x2a')]();};}function respondWithResult(_0x18e1ee,_0x20ef16){_0x20ef16=_0x20ef16||0xc8;return function(_0x3d196e){if(_0x3d196e){return _0x18e1ee[_0x3269('0x2b')](_0x20ef16)['json'](_0x3d196e);}};}function respondWithFilteredResult(_0x454568,_0x50c090){return function(_0x1a56ba){if(_0x1a56ba){var _0x590574=typeof _0x50c090[_0x3269('0x2c')]===_0x3269('0x2d')&&typeof _0x50c090[_0x3269('0x2e')]===_0x3269('0x2d');var _0x1170fb=_0x1a56ba[_0x3269('0x2f')];var _0x161896=_0x590574?0x0:_0x50c090[_0x3269('0x2c')];var _0x2aab59=_0x590574?_0x1a56ba['count']:_0x50c090[_0x3269('0x2c')]+_0x50c090[_0x3269('0x2e')];var _0x95a555;if(_0x2aab59>=_0x1170fb){_0x2aab59=_0x1170fb;_0x95a555=0xc8;}else{_0x95a555=0xce;}_0x454568[_0x3269('0x2b')](_0x95a555);return _0x454568[_0x3269('0x30')](_0x3269('0x31'),_0x161896+'-'+_0x2aab59+'/'+_0x1170fb)['json'](_0x1a56ba);}return null;};}function patchUpdates(_0x58d265){return function(_0x2e1678){try{jsonpatch[_0x3269('0x32')](_0x2e1678,_0x58d265,!![]);}catch(_0x5de957){return BPromise['reject'](_0x5de957);}return _0x2e1678[_0x3269('0x33')]();};}function saveUpdates(_0x2f58c8,_0x558693){return function(_0xd4637b){if(_0xd4637b){return _0xd4637b[_0x3269('0x34')](_0x2f58c8)['then'](function(_0x12236a){return _0x12236a;});}return null;};}function removeEntity(_0x2ab573,_0x3ca727){return function(_0xb7b3dc){if(_0xb7b3dc){return _0xb7b3dc[_0x3269('0x35')]()['then'](function(){_0x2ab573[_0x3269('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fb0f,_0x4c14ad){return function(_0x8ec9ee){if(!_0x8ec9ee){_0x39fb0f[_0x3269('0x36')](0x194);}return _0x8ec9ee;};}function handleError(_0x20419d,_0x39bcd9){_0x39bcd9=_0x39bcd9||0x1f4;return function(_0x4449fa){logger['error'](_0x4449fa[_0x3269('0x37')]);if(_0x4449fa[_0x3269('0x38')]){delete _0x4449fa[_0x3269('0x38')];}_0x20419d[_0x3269('0x2b')](_0x39bcd9)[_0x3269('0x39')](_0x4449fa);};}exports[_0x3269('0x3a')]=function(_0x30e3b5,_0x2771a5){var _0x5d4194={},_0x531455={},_0x3ab4ac={'count':0x0,'rows':[]};var _0x21b339=_['map'](db[_0x3269('0x3b')]['rawAttributes'],function(_0x21f9b4){return{'name':_0x21f9b4[_0x3269('0x3c')],'type':_0x21f9b4[_0x3269('0x3d')][_0x3269('0x3e')]};});_0x531455['model']=_[_0x3269('0x3f')](_0x21b339,'name');_0x531455[_0x3269('0x40')]=_[_0x3269('0x41')](_0x30e3b5[_0x3269('0x40')]);_0x531455['filters']=_[_0x3269('0x42')](_0x531455[_0x3269('0x43')],_0x531455['query']);_0x5d4194['attributes']=_[_0x3269('0x42')](_0x531455['model'],qs[_0x3269('0x44')](_0x30e3b5[_0x3269('0x40')][_0x3269('0x44')]));_0x5d4194[_0x3269('0x45')]=_0x5d4194['attributes'][_0x3269('0x46')]?_0x5d4194[_0x3269('0x45')]:_0x531455['model'];if(!_0x30e3b5[_0x3269('0x40')][_0x3269('0x47')](_0x3269('0x48'))){_0x5d4194[_0x3269('0x2e')]=qs[_0x3269('0x2e')](_0x30e3b5[_0x3269('0x40')][_0x3269('0x2e')]);_0x5d4194['offset']=qs[_0x3269('0x2c')](_0x30e3b5[_0x3269('0x40')][_0x3269('0x2c')]);}_0x5d4194[_0x3269('0x49')]=qs[_0x3269('0x4a')](_0x30e3b5[_0x3269('0x40')][_0x3269('0x4a')]);_0x5d4194[_0x3269('0x4b')]=qs[_0x3269('0x4c')](_['pick'](_0x30e3b5[_0x3269('0x40')],_0x531455['filters']),_0x21b339);if(_0x30e3b5[_0x3269('0x40')][_0x3269('0x4d')]){_0x5d4194['where']=_[_0x3269('0x4e')](_0x5d4194[_0x3269('0x4b')],{'$or':_[_0x3269('0x3f')](_0x21b339,function(_0x56d849){if(_0x56d849[_0x3269('0x3d')]!==_0x3269('0x4f')){var _0x21cba2={};_0x21cba2[_0x56d849[_0x3269('0x38')]]={'$like':'%'+_0x30e3b5[_0x3269('0x40')][_0x3269('0x4d')]+'%'};return _0x21cba2;}})});}_0x5d4194=_[_0x3269('0x4e')]({},_0x5d4194,_0x30e3b5[_0x3269('0x50')]);var _0x43167b={'where':_0x5d4194['where']};return db[_0x3269('0x3b')][_0x3269('0x2f')](_0x43167b)[_0x3269('0x20')](function(_0x38e8e6){_0x3ab4ac['count']=_0x38e8e6;if(_0x30e3b5[_0x3269('0x40')][_0x3269('0x51')]){_0x5d4194[_0x3269('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x3269('0x53')](_0x5d4194);})[_0x3269('0x20')](function(_0x31136d){_0x3ab4ac[_0x3269('0x54')]=_0x31136d;return _0x3ab4ac;})[_0x3269('0x20')](respondWithFilteredResult(_0x2771a5,_0x5d4194))[_0x3269('0x29')](handleError(_0x2771a5,null));};exports[_0x3269('0x55')]=function(_0x4f9947,_0x5890ae){var _0x1982b2={'raw':!![],'where':{'id':_0x4f9947[_0x3269('0x56')]['id']}},_0x6f91d9={};_0x6f91d9[_0x3269('0x43')]=_[_0x3269('0x41')](db[_0x3269('0x3b')][_0x3269('0x57')]);_0x6f91d9[_0x3269('0x40')]=_[_0x3269('0x41')](_0x4f9947[_0x3269('0x40')]);_0x6f91d9[_0x3269('0x4c')]=_[_0x3269('0x42')](_0x6f91d9['model'],_0x6f91d9[_0x3269('0x40')]);_0x1982b2[_0x3269('0x45')]=_[_0x3269('0x42')](_0x6f91d9['model'],qs[_0x3269('0x44')](_0x4f9947[_0x3269('0x40')][_0x3269('0x44')]));_0x1982b2[_0x3269('0x45')]=_0x1982b2[_0x3269('0x45')][_0x3269('0x46')]?_0x1982b2[_0x3269('0x45')]:_0x6f91d9['model'];if(_0x4f9947[_0x3269('0x40')][_0x3269('0x51')]){_0x1982b2[_0x3269('0x52')]=[{'all':!![]}];}_0x1982b2=_[_0x3269('0x4e')]({},_0x1982b2,_0x4f9947[_0x3269('0x50')]);return db[_0x3269('0x3b')]['find'](_0x1982b2)[_0x3269('0x20')](handleEntityNotFound(_0x5890ae,null))[_0x3269('0x20')](respondWithResult(_0x5890ae,null))['catch'](handleError(_0x5890ae,null));};exports['create']=function(_0x3e0c98,_0x12ebb0){return db[_0x3269('0x3b')][_0x3269('0x58')](_0x3e0c98[_0x3269('0x59')],{})[_0x3269('0x20')](respondWithResult(_0x12ebb0,0xc9))[_0x3269('0x29')](handleError(_0x12ebb0,null));};exports['update']=function(_0x1db65e,_0x191f34){if(_0x1db65e[_0x3269('0x59')]['id']){delete _0x1db65e['body']['id'];}return db[_0x3269('0x3b')][_0x3269('0x5a')]({'where':{'id':_0x1db65e['params']['id']}})[_0x3269('0x20')](handleEntityNotFound(_0x191f34,null))[_0x3269('0x20')](saveUpdates(_0x1db65e['body'],null))[_0x3269('0x20')](respondWithResult(_0x191f34,null))[_0x3269('0x29')](handleError(_0x191f34,null));};exports[_0x3269('0x35')]=function(_0x574590,_0x3ce604){return db['WhatsappMessage'][_0x3269('0x5a')]({'where':{'id':_0x574590[_0x3269('0x56')]['id']}})[_0x3269('0x20')](handleEntityNotFound(_0x3ce604,null))['then'](removeEntity(_0x3ce604,null))['catch'](handleError(_0x3ce604,null));};exports[_0x3269('0x5b')]=function(_0x3b03b2,_0x447989){return db[_0x3269('0x3b')][_0x3269('0x5b')]()['then'](respondWithResult(_0x447989,null))[_0x3269('0x29')](handleError(_0x447989,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x3269('0x5c')]=function(_0x57a15f,_0x116c26,_0x4ffc41){var _0x268cc7={'agent':{},'channel':'whatsapp'};if(_0x57a15f[_0x3269('0x59')]['id']){delete _0x57a15f[_0x3269('0x59')]['id'];}_0x57a15f[_0x3269('0x59')][_0x3269('0x5d')]=!![];_0x57a15f['body']['readAt']=moment()[_0x3269('0x5e')](_0x3269('0x5f'));_0x57a15f[_0x3269('0x59')][_0x3269('0x60')]=_0x57a15f[_0x3269('0x59')][_0x3269('0x60')]||_0x57a15f[_0x3269('0x61')]['id'];_0x268cc7['agent']['id']=_0x57a15f['body'][_0x3269('0x60')];return db[_0x3269('0x3b')][_0x3269('0x5a')]({'where':{'id':_0x57a15f[_0x3269('0x56')]['id'],'UserId':null}})[_0x3269('0x20')](handleEntityNotFound(_0x116c26,null))['then'](saveUpdates(_0x57a15f[_0x3269('0x59')],null))['then'](function(_0xc98a3a){if(_0xc98a3a){_0x268cc7['message']=_0xc98a3a[_0x3269('0x62')]({'plain':!![]});return db[_0x3269('0x63')][_0x3269('0x5a')]({'where':{'id':_0xc98a3a[_0x3269('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x116c26,null))['then'](function(_0x1b3f6a){if(_0x1b3f6a){return _0x1b3f6a[_0x3269('0x34')]({'UserId':_0x57a15f['body'][_0x3269('0x60')],'read1stAt':_[_0x3269('0x65')](_0x1b3f6a[_0x3269('0x66')])?moment()[_0x3269('0x5e')](_0x3269('0x5f')):undefined});}return null;})[_0x3269('0x20')](function(_0x2229fc){if(_0x2229fc){_0x268cc7[_0x3269('0x67')]=_0x2229fc[_0x3269('0x62')]({'plain':!![]});interaction_log['info'](_0x3269('0x68'),_0x57a15f[_0x3269('0x61')]['id'],_0x57a15f[_0x3269('0x61')][_0x3269('0x38')],_0x57a15f[_0x3269('0x61')][_0x3269('0x69')],_0x268cc7[_0x3269('0x67')]['id'],_0x57a15f[_0x3269('0x59')]?JSON[_0x3269('0x24')](_0x57a15f[_0x3269('0x59')]):_0x3269('0x6a'));return respondWithRpcPromise(_0x3269('0x6b'),_0x3269('0x6c'),_0x268cc7);}return null;})[_0x3269('0x20')](function(_0x2968e1){var _0x285acf=_0x3269('0x6d')+_0x2968e1['message'][_0x3269('0x6e')];return db[_0x3269('0x6f')]['query'](_0x285acf,{'type':db[_0x3269('0x70')][_0x3269('0x71')][_0x3269('0x72')],'raw':!![]})[_0x3269('0x20')](function(_0x3fbffa){return _0x3fbffa;});})[_0x3269('0x20')](function(_0x5fd64c){if(_0x5fd64c){_0x268cc7['message'][_0x3269('0x73')]=_0x5fd64c[0x0];if(!_0x57a15f[_0x3269('0x59')][_0x3269('0x60')])return;return db[_0x3269('0x74')][_0x3269('0x5a')]({'where':{'id':_0x57a15f['body'][_0x3269('0x60')],'role':_0x3269('0x75')},'attributes':['id',_0x3269('0x38'),_0x3269('0x76'),_0x3269('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x29da1e){if(!_0x29da1e)return null;_0x268cc7['message']['agent']=_0x29da1e;return _0x268cc7;})[_0x3269('0x20')](function(_0x47669a){if(_0x47669a){if(_0x57a15f[_0x3269('0x59')][_0x3269('0x78')]){_0x268cc7[_0x3269('0x27')]['interface']=util['format'](_0x3269('0x79'),_0x57a15f[_0x3269('0x61')][_0x3269('0x38')]);_0x268cc7['message'][_0x3269('0x7a')]=_0x268cc7[_0x3269('0x7a')];_0x268cc7[_0x3269('0x27')][_0x3269('0x7b')]=_0x268cc7[_0x3269('0x7a')];_0x268cc7[_0x3269('0x27')][_0x3269('0x7c')]=_0x3269('0x5c');return respondWithRpcPromise('EventManager',_0x3269('0x7d'),{'event':'acceptmessage','message':_0x268cc7[_0x3269('0x27')]},client9002)[_0x3269('0x20')](function(){return _0x268cc7;});}return _0x268cc7;}return null;})[_0x3269('0x20')](respondWithResult(_0x116c26,null))['catch'](handleError(_0x116c26,null));};var interaction_log=require(_0x3269('0x7e'))(_0x3269('0x7f'));exports[_0x3269('0x80')]=function(_0x379c90,_0x4c8fa0,_0x23d629){var _0x126fa5={'agent':{},'channel':_0x3269('0x81')};if(_0x379c90[_0x3269('0x59')]['id']){delete _0x379c90['body']['id'];}_0x379c90[_0x3269('0x59')][_0x3269('0x60')]=_0x379c90[_0x3269('0x59')]['UserId']||_0x379c90[_0x3269('0x61')]['id'];_0x126fa5[_0x3269('0x75')]['id']=_0x379c90[_0x3269('0x59')]['UserId'];return db[_0x3269('0x3b')][_0x3269('0x5a')]({'where':{'id':_0x379c90[_0x3269('0x56')]['id'],'UserId':null}})[_0x3269('0x20')](handleEntityNotFound(_0x4c8fa0,null))[_0x3269('0x20')](function(_0x307c63){if(_0x307c63){_0x126fa5[_0x3269('0x27')]=_0x307c63['get']({'plain':!![]});return db[_0x3269('0x63')][_0x3269('0x5a')]({'where':{'id':_0x307c63[_0x3269('0x64')]}});}return null;})[_0x3269('0x20')](handleEntityNotFound(_0x4c8fa0,null))[_0x3269('0x20')](function(_0x5bb61b){if(_0x5bb61b){_0x126fa5['interaction']=_0x5bb61b[_0x3269('0x62')]({'plain':!![]});interaction_log['info'](_0x3269('0x82'),_0x379c90[_0x3269('0x61')]['id'],_0x379c90[_0x3269('0x61')]['name'],_0x379c90['user']['role'],_0x126fa5[_0x3269('0x67')]['id'],_0x379c90[_0x3269('0x59')]?JSON[_0x3269('0x24')](_0x379c90[_0x3269('0x59')]):_0x3269('0x6a'));return respondWithRpcPromise(_0x3269('0x83'),_0x3269('0x84'),_0x126fa5);}return null;})['then'](function(_0x22066c){var _0x1e1c25=_0x3269('0x6d')+_0x22066c[_0x3269('0x27')][_0x3269('0x6e')];return db[_0x3269('0x6f')]['query'](_0x1e1c25,{'type':db[_0x3269('0x70')][_0x3269('0x71')][_0x3269('0x72')],'raw':!![]})[_0x3269('0x20')](function(_0x734b89){return _0x734b89;});})[_0x3269('0x20')](function(_0x1150a1){if(_0x1150a1){_0x126fa5[_0x3269('0x27')][_0x3269('0x73')]=_0x1150a1[0x0];if(!_0x379c90[_0x3269('0x59')][_0x3269('0x60')])return;return db[_0x3269('0x74')][_0x3269('0x5a')]({'where':{'id':_0x379c90[_0x3269('0x59')]['UserId'],'role':_0x3269('0x75')},'attributes':['id',_0x3269('0x38'),_0x3269('0x76'),_0x3269('0x77'),_0x3269('0x85')],'raw':!![]});}return null;})[_0x3269('0x20')](function(_0x1a8ee8){if(!_0x1a8ee8)return null;_0x126fa5['message'][_0x3269('0x75')]=_0x1a8ee8;return _0x126fa5;})[_0x3269('0x20')](function(_0x3c5c02){if(_0x3c5c02){_0x3c5c02[_0x3269('0x27')][_0x3269('0x86')]=util[_0x3269('0x5e')](_0x3269('0x79'),_0x379c90['user'][_0x3269('0x38')]);_0x3c5c02[_0x3269('0x27')][_0x3269('0x7a')]=_0x126fa5[_0x3269('0x7a')];_0x3c5c02['message']['motionChannel']=_0x126fa5[_0x3269('0x7a')];_0x3c5c02[_0x3269('0x27')][_0x3269('0x7c')]=_0x3269('0x80');respondWithRpcPromise(_0x3269('0x7d'),_0x3269('0x7d'),{'event':_0x3269('0x87'),'message':_0x3c5c02['message']},client9002);return _0x126fa5;}return null;})[_0x3269('0x20')](respondWithResult(_0x4c8fa0,null))['catch'](handleError(_0x4c8fa0,null));};exports[_0x3269('0x2b')]=function(_0x191177,_0x548137,_0x54dbba){if(_0x191177[_0x3269('0x59')]['id']){delete _0x191177[_0x3269('0x59')]['id'];}var _0xb3d55f;return db[_0x3269('0x3b')]['find']({'where':{'id':_0x191177[_0x3269('0x56')]['id']}})[_0x3269('0x20')](handleEntityNotFound(_0x548137,null))['then'](function(_0x3b3200){if(_0x3b3200){_0xb3d55f=_0x3b3200;return db['WhatsappAccount'][_0x3269('0x5a')]({'where':{'id':_0x3b3200[_0x3269('0x88')]}});}})['then'](handleEntityNotFound(_0x548137,null))[_0x3269('0x20')](function(_0x4ab59a){if(_0x4ab59a){logger[_0x3269('0x89')](_0x3269('0x8a'),'status',_0x3269('0x8b'),_0x4ab59a[_0x3269('0x3d')],util['inspect'](_0x191177[_0x3269('0x59')],{'showHidden':![],'depth':null}));switch(_0x4ab59a[_0x3269('0x3d')]){case'twilio':if(_0x191177[_0x3269('0x59')][_0x3269('0x8c')]&&_0x191177[_0x3269('0x59')][_0x3269('0x8c')]===_0xb3d55f[_0x3269('0x8d')]&&_0x191177['body'][_0x3269('0x8e')]&&_0x191177['body'][_0x3269('0x8e')]==='read'){return _0xb3d55f[_0x3269('0x34')]({'read':!![]});}else{logger['error'](_0x3269('0x8f'),'status',_0x3269('0x90'),util[_0x3269('0x91')](_0x191177[_0x3269('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xb3d55f;}})[_0x3269('0x20')](respondWithResult(_0x548137,null))[_0x3269('0x29')](handleError(_0x548137,null));}; \ No newline at end of file +var _0x177b=['EventManager','acceptmessage','whatsapp-interactions','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','fullname','motionChannel','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','findAll','show','params','keys','include','create','body','find','describe','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','channel'];(function(_0x20cb8c,_0x3ad47c){var _0x25fae6=function(_0x1b504a){while(--_0x1b504a){_0x20cb8c['push'](_0x20cb8c['shift']());}};_0x25fae6(++_0x3ad47c);}(_0x177b,0xa1));var _0xb177=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x177b[_0x4849f6];return _0x1a3dcd;};'use strict';var emlformat=require(_0xb177('0x0'));var rimraf=require(_0xb177('0x1'));var zipdir=require(_0xb177('0x2'));var jsonpatch=require(_0xb177('0x3'));var rp=require(_0xb177('0x4'));var moment=require(_0xb177('0x5'));var BPromise=require(_0xb177('0x6'));var Mustache=require(_0xb177('0x7'));var util=require(_0xb177('0x8'));var path=require(_0xb177('0x9'));var sox=require(_0xb177('0xa'));var csv=require(_0xb177('0xb'));var ejs=require(_0xb177('0xc'));var fs=require('fs');var fs_extra=require(_0xb177('0xd'));var _=require(_0xb177('0xe'));var squel=require(_0xb177('0xf'));var crypto=require('crypto');var jsforce=require(_0xb177('0x10'));var deskjs=require(_0xb177('0x11'));var toCsv=require(_0xb177('0xb'));var querystring=require(_0xb177('0x12'));var Papa=require(_0xb177('0x13'));var Redis=require(_0xb177('0x14'));var authService=require(_0xb177('0x15'));var qs=require(_0xb177('0x16'));var as=require(_0xb177('0x17'));var hardwareService=require(_0xb177('0x18'));var logger=require(_0xb177('0x19'))('api');var utils=require('../../config/utils');var config=require(_0xb177('0x1a'));var licenseUtil=require(_0xb177('0x1b'));var db=require('../../mysqldb')['db'];config[_0xb177('0x1c')]=_[_0xb177('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb177('0x1e'))(new Redis(config[_0xb177('0x1c')]));require('./whatsappMessage.socket')[_0xb177('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb177('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0cde,_0x273066,_0x447533,_0x45d5ff){return new BPromise(function(_0x2c7c6d,_0x22115a){var _0x33990a=_0x45d5ff||client;return _0x33990a['request'](_0x5a0cde,_0x447533)[_0xb177('0x21')](function(_0x952c23){logger['info'](_0xb177('0x22'),_0x273066,_0xb177('0x23'));logger[_0xb177('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x273066,_0xb177('0x23'),JSON[_0xb177('0x25')](_0x952c23));if(_0x952c23[_0xb177('0x26')]){if(_0x952c23[_0xb177('0x26')][_0xb177('0x27')]===0x1f4){logger[_0xb177('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x273066,_0x952c23['error'][_0xb177('0x28')]);return _0x22115a(_0x952c23[_0xb177('0x26')][_0xb177('0x28')]);}logger[_0xb177('0x26')](_0xb177('0x22'),_0x273066,_0x952c23[_0xb177('0x26')][_0xb177('0x28')]);return _0x2c7c6d(_0x952c23[_0xb177('0x26')][_0xb177('0x28')]);}else{logger[_0xb177('0x29')](_0xb177('0x22'),_0x273066,_0xb177('0x23'));_0x2c7c6d(_0x952c23[_0xb177('0x2a')][_0xb177('0x28')]);}})[_0xb177('0x2b')](function(_0x322c7b){logger[_0xb177('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x273066,_0x322c7b);_0x22115a(_0x322c7b);});});}function respondWithStatusCode(_0x46d921,_0x22bf85){_0x22bf85=_0x22bf85||0xcc;return function(_0x29cd0d){if(_0x29cd0d){return _0x46d921[_0xb177('0x2c')](_0x22bf85);}return _0x46d921[_0xb177('0x2d')](_0x22bf85)[_0xb177('0x2e')]();};}function respondWithResult(_0x10ffcc,_0x4c5df5){_0x4c5df5=_0x4c5df5||0xc8;return function(_0x19573b){if(_0x19573b){return _0x10ffcc[_0xb177('0x2d')](_0x4c5df5)[_0xb177('0x2f')](_0x19573b);}};}function respondWithFilteredResult(_0xc12a6f,_0x8db455){return function(_0x1a1ac6){if(_0x1a1ac6){var _0x4a9605=typeof _0x8db455['offset']===_0xb177('0x30')&&typeof _0x8db455[_0xb177('0x31')]==='undefined';var _0xabfca1=_0x1a1ac6[_0xb177('0x32')];var _0x1036c7=_0x4a9605?0x0:_0x8db455[_0xb177('0x33')];var _0x554ef5=_0x4a9605?_0x1a1ac6['count']:_0x8db455[_0xb177('0x33')]+_0x8db455[_0xb177('0x31')];var _0x2d4571;if(_0x554ef5>=_0xabfca1){_0x554ef5=_0xabfca1;_0x2d4571=0xc8;}else{_0x2d4571=0xce;}_0xc12a6f[_0xb177('0x2d')](_0x2d4571);return _0xc12a6f[_0xb177('0x34')](_0xb177('0x35'),_0x1036c7+'-'+_0x554ef5+'/'+_0xabfca1)[_0xb177('0x2f')](_0x1a1ac6);}return null;};}function patchUpdates(_0x42b334){return function(_0x39adc5){try{jsonpatch[_0xb177('0x36')](_0x39adc5,_0x42b334,!![]);}catch(_0x51f886){return BPromise[_0xb177('0x37')](_0x51f886);}return _0x39adc5[_0xb177('0x38')]();};}function saveUpdates(_0x56a6db,_0x335d2c){return function(_0xf8664e){if(_0xf8664e){return _0xf8664e[_0xb177('0x39')](_0x56a6db)[_0xb177('0x21')](function(_0x45ab6d){return _0x45ab6d;});}return null;};}function removeEntity(_0x1cf00e,_0x350f67){return function(_0x6f335a){if(_0x6f335a){return _0x6f335a[_0xb177('0x3a')]()[_0xb177('0x21')](function(){_0x1cf00e['status'](0xcc)[_0xb177('0x2e')]();});}};}function handleEntityNotFound(_0x407248,_0x1e844d){return function(_0x2e33d6){if(!_0x2e33d6){_0x407248[_0xb177('0x2c')](0x194);}return _0x2e33d6;};}function handleError(_0x3e57c7,_0x2d0f85){_0x2d0f85=_0x2d0f85||0x1f4;return function(_0x4c4e37){logger['error'](_0x4c4e37[_0xb177('0x3b')]);if(_0x4c4e37[_0xb177('0x3c')]){delete _0x4c4e37['name'];}_0x3e57c7[_0xb177('0x2d')](_0x2d0f85)['send'](_0x4c4e37);};}exports[_0xb177('0x3d')]=function(_0x516974,_0x248a3d){var _0x15898b={},_0x5bd3af={},_0x39dbaa={'count':0x0,'rows':[]};var _0x4d5e09=_[_0xb177('0x3e')](db['WhatsappMessage'][_0xb177('0x3f')],function(_0x50903d){return{'name':_0x50903d[_0xb177('0x40')],'type':_0x50903d[_0xb177('0x41')][_0xb177('0x42')]};});_0x5bd3af[_0xb177('0x43')]=_['map'](_0x4d5e09,'name');_0x5bd3af[_0xb177('0x44')]=_['keys'](_0x516974[_0xb177('0x44')]);_0x5bd3af[_0xb177('0x45')]=_['intersection'](_0x5bd3af['model'],_0x5bd3af['query']);_0x15898b[_0xb177('0x46')]=_[_0xb177('0x47')](_0x5bd3af[_0xb177('0x43')],qs[_0xb177('0x48')](_0x516974[_0xb177('0x44')][_0xb177('0x48')]));_0x15898b[_0xb177('0x46')]=_0x15898b[_0xb177('0x46')][_0xb177('0x49')]?_0x15898b[_0xb177('0x46')]:_0x5bd3af[_0xb177('0x43')];if(!_0x516974[_0xb177('0x44')][_0xb177('0x4a')](_0xb177('0x4b'))){_0x15898b[_0xb177('0x31')]=qs[_0xb177('0x31')](_0x516974[_0xb177('0x44')]['limit']);_0x15898b[_0xb177('0x33')]=qs['offset'](_0x516974['query'][_0xb177('0x33')]);}_0x15898b[_0xb177('0x4c')]=qs[_0xb177('0x4d')](_0x516974['query'][_0xb177('0x4d')]);_0x15898b[_0xb177('0x4e')]=qs[_0xb177('0x45')](_[_0xb177('0x4f')](_0x516974['query'],_0x5bd3af[_0xb177('0x45')]),_0x4d5e09);if(_0x516974['query'][_0xb177('0x50')]){_0x15898b[_0xb177('0x4e')]=_[_0xb177('0x51')](_0x15898b[_0xb177('0x4e')],{'$or':_['map'](_0x4d5e09,function(_0x5c446c){if(_0x5c446c['type']!==_0xb177('0x52')){var _0x398d79={};_0x398d79[_0x5c446c[_0xb177('0x3c')]]={'$like':'%'+_0x516974['query']['filter']+'%'};return _0x398d79;}})});}_0x15898b=_[_0xb177('0x51')]({},_0x15898b,_0x516974[_0xb177('0x53')]);var _0x247cff={'where':_0x15898b[_0xb177('0x4e')]};return db[_0xb177('0x54')][_0xb177('0x32')](_0x247cff)['then'](function(_0x2ce6f8){_0x39dbaa[_0xb177('0x32')]=_0x2ce6f8;if(_0x516974[_0xb177('0x44')][_0xb177('0x55')]){_0x15898b['include']=[{'all':!![]}];}return db[_0xb177('0x54')][_0xb177('0x56')](_0x15898b);})[_0xb177('0x21')](function(_0x15033b){_0x39dbaa['rows']=_0x15033b;return _0x39dbaa;})[_0xb177('0x21')](respondWithFilteredResult(_0x248a3d,_0x15898b))[_0xb177('0x2b')](handleError(_0x248a3d,null));};exports[_0xb177('0x57')]=function(_0x53bae8,_0x3edbac){var _0x480677={'raw':!![],'where':{'id':_0x53bae8[_0xb177('0x58')]['id']}},_0x5ddf97={};_0x5ddf97[_0xb177('0x43')]=_[_0xb177('0x59')](db[_0xb177('0x54')][_0xb177('0x3f')]);_0x5ddf97[_0xb177('0x44')]=_[_0xb177('0x59')](_0x53bae8[_0xb177('0x44')]);_0x5ddf97[_0xb177('0x45')]=_[_0xb177('0x47')](_0x5ddf97['model'],_0x5ddf97['query']);_0x480677[_0xb177('0x46')]=_[_0xb177('0x47')](_0x5ddf97[_0xb177('0x43')],qs[_0xb177('0x48')](_0x53bae8['query']['fields']));_0x480677[_0xb177('0x46')]=_0x480677[_0xb177('0x46')]['length']?_0x480677[_0xb177('0x46')]:_0x5ddf97[_0xb177('0x43')];if(_0x53bae8[_0xb177('0x44')][_0xb177('0x55')]){_0x480677[_0xb177('0x5a')]=[{'all':!![]}];}_0x480677=_[_0xb177('0x51')]({},_0x480677,_0x53bae8['options']);return db[_0xb177('0x54')]['find'](_0x480677)[_0xb177('0x21')](handleEntityNotFound(_0x3edbac,null))['then'](respondWithResult(_0x3edbac,null))['catch'](handleError(_0x3edbac,null));};exports[_0xb177('0x5b')]=function(_0x3b0f1a,_0x4d3001){return db[_0xb177('0x54')][_0xb177('0x5b')](_0x3b0f1a[_0xb177('0x5c')],{})[_0xb177('0x21')](respondWithResult(_0x4d3001,0xc9))[_0xb177('0x2b')](handleError(_0x4d3001,null));};exports[_0xb177('0x39')]=function(_0x26bc7d,_0x3b9ec3){if(_0x26bc7d[_0xb177('0x5c')]['id']){delete _0x26bc7d[_0xb177('0x5c')]['id'];}return db[_0xb177('0x54')][_0xb177('0x5d')]({'where':{'id':_0x26bc7d[_0xb177('0x58')]['id']}})[_0xb177('0x21')](handleEntityNotFound(_0x3b9ec3,null))[_0xb177('0x21')](saveUpdates(_0x26bc7d['body'],null))[_0xb177('0x21')](respondWithResult(_0x3b9ec3,null))[_0xb177('0x2b')](handleError(_0x3b9ec3,null));};exports[_0xb177('0x3a')]=function(_0x3c203d,_0x5e9c0d){return db['WhatsappMessage']['find']({'where':{'id':_0x3c203d['params']['id']}})[_0xb177('0x21')](handleEntityNotFound(_0x5e9c0d,null))[_0xb177('0x21')](removeEntity(_0x5e9c0d,null))[_0xb177('0x2b')](handleError(_0x5e9c0d,null));};exports['describe']=function(_0x312b64,_0x549bca){return db[_0xb177('0x54')][_0xb177('0x5e')]()[_0xb177('0x21')](respondWithResult(_0x549bca,null))[_0xb177('0x2b')](handleError(_0x549bca,null));};var interaction_log=require(_0xb177('0x19'))('whatsapp-interactions');exports[_0xb177('0x5f')]=function(_0x505d50,_0x33e4b4,_0x14747e){var _0x1f304e={'agent':{},'channel':_0xb177('0x60')};if(_0x505d50[_0xb177('0x5c')]['id']){delete _0x505d50['body']['id'];}_0x505d50[_0xb177('0x5c')][_0xb177('0x61')]=!![];_0x505d50[_0xb177('0x5c')]['readAt']=moment()[_0xb177('0x62')](_0xb177('0x63'));_0x505d50[_0xb177('0x5c')]['UserId']=_0x505d50['body'][_0xb177('0x64')]||_0x505d50['user']['id'];_0x1f304e['agent']['id']=_0x505d50[_0xb177('0x5c')]['UserId'];return db[_0xb177('0x54')][_0xb177('0x5d')]({'where':{'id':_0x505d50[_0xb177('0x58')]['id'],'UserId':null}})[_0xb177('0x21')](handleEntityNotFound(_0x33e4b4,null))[_0xb177('0x21')](saveUpdates(_0x505d50[_0xb177('0x5c')],null))[_0xb177('0x21')](function(_0xbcd6f2){if(_0xbcd6f2){_0x1f304e[_0xb177('0x28')]=_0xbcd6f2[_0xb177('0x65')]({'plain':!![]});return db[_0xb177('0x66')][_0xb177('0x5d')]({'where':{'id':_0xbcd6f2[_0xb177('0x67')]}});}return null;})[_0xb177('0x21')](handleEntityNotFound(_0x33e4b4,null))[_0xb177('0x21')](function(_0x151078){if(_0x151078){return _0x151078[_0xb177('0x39')]({'UserId':_0x505d50['body']['UserId'],'read1stAt':_[_0xb177('0x68')](_0x151078[_0xb177('0x69')])?moment()[_0xb177('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb177('0x21')](function(_0x486974){if(_0x486974){_0x1f304e['interaction']=_0x486974[_0xb177('0x65')]({'plain':!![]});interaction_log[_0xb177('0x29')](_0xb177('0x6a'),_0x505d50[_0xb177('0x6b')]['id'],_0x505d50[_0xb177('0x6b')][_0xb177('0x3c')],_0x505d50[_0xb177('0x6b')][_0xb177('0x6c')],_0x1f304e['interaction']['id'],_0x505d50[_0xb177('0x5c')]?JSON[_0xb177('0x25')](_0x505d50[_0xb177('0x5c')]):_0xb177('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xb177('0x6e'),_0x1f304e);}return null;})[_0xb177('0x21')](function(_0xf8a754){var _0xd3ae53=_0xb177('0x6f')+_0xf8a754[_0xb177('0x28')]['ContactId'];return db[_0xb177('0x70')][_0xb177('0x44')](_0xd3ae53,{'type':db[_0xb177('0x71')][_0xb177('0x72')][_0xb177('0x73')],'raw':!![]})['then'](function(_0x365d00){return _0x365d00;});})[_0xb177('0x21')](function(_0x2196b6){if(_0x2196b6){_0x1f304e[_0xb177('0x28')][_0xb177('0x74')]=_0x2196b6[0x0];if(!_0x505d50['body'][_0xb177('0x64')])return;return db[_0xb177('0x75')]['find']({'where':{'id':_0x505d50[_0xb177('0x5c')][_0xb177('0x64')],'role':_0xb177('0x76')},'attributes':['id','name','fullname',_0xb177('0x77'),_0xb177('0x78')],'raw':!![]});}return null;})[_0xb177('0x21')](function(_0x3ff98a){if(!_0x3ff98a)return null;_0x1f304e[_0xb177('0x28')][_0xb177('0x76')]=_0x3ff98a;return _0x1f304e;})[_0xb177('0x21')](function(_0x43f12c){if(_0x43f12c){if(_0x505d50[_0xb177('0x5c')][_0xb177('0x79')]){_0x1f304e[_0xb177('0x28')][_0xb177('0x7a')]=util[_0xb177('0x62')](_0xb177('0x7b'),_0x505d50[_0xb177('0x6b')][_0xb177('0x3c')]);_0x1f304e[_0xb177('0x28')][_0xb177('0x7c')]=_0x1f304e[_0xb177('0x7c')];_0x1f304e[_0xb177('0x28')]['motionChannel']=_0x1f304e[_0xb177('0x7c')];_0x1f304e[_0xb177('0x28')]['event']=_0xb177('0x5f');return respondWithRpcPromise(_0xb177('0x7d'),_0xb177('0x7d'),{'event':_0xb177('0x7e'),'message':_0x1f304e[_0xb177('0x28')]},client9002)[_0xb177('0x21')](function(){return _0x1f304e;});}return _0x1f304e;}return null;})['then'](respondWithResult(_0x33e4b4,null))[_0xb177('0x2b')](handleError(_0x33e4b4,null));};var interaction_log=require(_0xb177('0x19'))(_0xb177('0x7f'));exports['reject']=function(_0xa506b1,_0x3c52fe,_0x4c91f5){var _0x424634={'agent':{},'channel':_0xb177('0x60')};if(_0xa506b1[_0xb177('0x5c')]['id']){delete _0xa506b1['body']['id'];}_0xa506b1[_0xb177('0x5c')][_0xb177('0x64')]=_0xa506b1[_0xb177('0x5c')][_0xb177('0x64')]||_0xa506b1[_0xb177('0x6b')]['id'];_0x424634[_0xb177('0x76')]['id']=_0xa506b1['body'][_0xb177('0x64')];return db['WhatsappMessage'][_0xb177('0x5d')]({'where':{'id':_0xa506b1[_0xb177('0x58')]['id'],'UserId':null}})[_0xb177('0x21')](handleEntityNotFound(_0x3c52fe,null))[_0xb177('0x21')](function(_0x545d56){if(_0x545d56){_0x424634[_0xb177('0x28')]=_0x545d56['get']({'plain':!![]});return db[_0xb177('0x66')][_0xb177('0x5d')]({'where':{'id':_0x545d56[_0xb177('0x67')]}});}return null;})[_0xb177('0x21')](handleEntityNotFound(_0x3c52fe,null))['then'](function(_0x5c831a){if(_0x5c831a){_0x424634[_0xb177('0x80')]=_0x5c831a[_0xb177('0x65')]({'plain':!![]});interaction_log[_0xb177('0x29')](_0xb177('0x81'),_0xa506b1[_0xb177('0x6b')]['id'],_0xa506b1[_0xb177('0x6b')][_0xb177('0x3c')],_0xa506b1[_0xb177('0x6b')][_0xb177('0x6c')],_0x424634['interaction']['id'],_0xa506b1['body']?JSON[_0xb177('0x25')](_0xa506b1[_0xb177('0x5c')]):_0xb177('0x6d'));return respondWithRpcPromise(_0xb177('0x82'),'rejectMessage',_0x424634);}return null;})['then'](function(_0x5ab63a){var _0x164ec2=_0xb177('0x6f')+_0x5ab63a[_0xb177('0x28')]['ContactId'];return db[_0xb177('0x70')][_0xb177('0x44')](_0x164ec2,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xb177('0x21')](function(_0x5b7751){return _0x5b7751;});})[_0xb177('0x21')](function(_0x403808){if(_0x403808){_0x424634[_0xb177('0x28')][_0xb177('0x74')]=_0x403808[0x0];if(!_0xa506b1[_0xb177('0x5c')]['UserId'])return;return db[_0xb177('0x75')]['find']({'where':{'id':_0xa506b1['body'][_0xb177('0x64')],'role':'agent'},'attributes':['id',_0xb177('0x3c'),_0xb177('0x83'),_0xb177('0x77'),_0xb177('0x78')],'raw':!![]});}return null;})['then'](function(_0x2ff1cd){if(!_0x2ff1cd)return null;_0x424634[_0xb177('0x28')][_0xb177('0x76')]=_0x2ff1cd;return _0x424634;})[_0xb177('0x21')](function(_0x481c73){if(_0x481c73){_0x481c73[_0xb177('0x28')][_0xb177('0x7a')]=util['format'](_0xb177('0x7b'),_0xa506b1[_0xb177('0x6b')]['name']);_0x481c73[_0xb177('0x28')]['channel']=_0x424634['channel'];_0x481c73[_0xb177('0x28')][_0xb177('0x84')]=_0x424634[_0xb177('0x7c')];_0x481c73[_0xb177('0x28')]['event']=_0xb177('0x37');respondWithRpcPromise('EventManager',_0xb177('0x7d'),{'event':'rejectmessage','message':_0x481c73['message']},client9002);return _0x424634;}return null;})[_0xb177('0x21')](respondWithResult(_0x3c52fe,null))[_0xb177('0x2b')](handleError(_0x3c52fe,null));};exports[_0xb177('0x2d')]=function(_0x43de38,_0x553cde,_0x4eccd0){if(_0x43de38[_0xb177('0x5c')]['id']){delete _0x43de38[_0xb177('0x5c')]['id'];}var _0x2364b5;return db[_0xb177('0x54')][_0xb177('0x5d')]({'where':{'id':_0x43de38[_0xb177('0x58')]['id']}})['then'](handleEntityNotFound(_0x553cde,null))[_0xb177('0x21')](function(_0x287e31){if(_0x287e31){_0x2364b5=_0x287e31;return db[_0xb177('0x85')]['find']({'where':{'id':_0x287e31[_0xb177('0x86')]}});}})['then'](handleEntityNotFound(_0x553cde,null))['then'](function(_0x4a7589){if(_0x4a7589){logger[_0xb177('0x24')](_0xb177('0x87'),'status',_0xb177('0x88'),_0x4a7589['type'],util[_0xb177('0x89')](_0x43de38[_0xb177('0x5c')],{'showHidden':![],'depth':null}));switch(_0x4a7589[_0xb177('0x41')]){case _0xb177('0x8a'):if(_0x43de38[_0xb177('0x5c')][_0xb177('0x8b')]&&_0x43de38[_0xb177('0x5c')][_0xb177('0x8b')]===_0x2364b5[_0xb177('0x8c')]&&_0x43de38['body']['MessageStatus']&&_0x43de38['body'][_0xb177('0x8d')]===_0xb177('0x61')){return _0x2364b5[_0xb177('0x39')]({'read':!![]});}else{logger[_0xb177('0x26')](_0xb177('0x8e'),_0xb177('0x2d'),_0xb177('0x8a'),util[_0xb177('0x89')](_0x43de38[_0xb177('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x2364b5;}})['then'](respondWithResult(_0x553cde,null))[_0xb177('0x2b')](handleError(_0x553cde,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4ab94ad..8b17a18 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 _0x4ded=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit'];(function(_0x239bd9,_0x3339b6){var _0xbb920a=function(_0x284dd1){while(--_0x284dd1){_0x239bd9['push'](_0x239bd9['shift']());}};_0xbb920a(++_0x3339b6);}(_0x4ded,0x116));var _0xd4de=function(_0x81dbc,_0x1afc92){_0x81dbc=_0x81dbc-0x0;var _0x3218ef=_0x4ded[_0x81dbc];return _0x3218ef;};'use strict';var EventEmitter=require(_0xd4de('0x0'));var WhatsappMessage=require(_0xd4de('0x1'))['db'][_0xd4de('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd4de('0x3')](0x0);var events={'afterCreate':_0xd4de('0x4'),'afterUpdate':_0xd4de('0x5'),'afterDestroy':_0xd4de('0x6')};function emitEvent(_0x42f90f){return function(_0x20930f,_0x36d4dd,_0x2e8d86){WhatsappMessageEvents[_0xd4de('0x7')](_0x42f90f+':'+_0x20930f['id'],_0x20930f);WhatsappMessageEvents['emit'](_0x42f90f,_0x20930f);_0x2e8d86(null);};}for(var e in events){if(events[_0xd4de('0x8')](e)){var event=events[e];WhatsappMessage[_0xd4de('0x9')](e,emitEvent(event));}}module[_0xd4de('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x6c76=['update','emit','hook','events','../../mysqldb','WhatsappMessage','save'];(function(_0x2dde07,_0x590b49){var _0xa4a1f8=function(_0x337f30){while(--_0x337f30){_0x2dde07['push'](_0x2dde07['shift']());}};_0xa4a1f8(++_0x590b49);}(_0x6c76,0x184));var _0x66c7=function(_0x4b67c0,_0x535c00){_0x4b67c0=_0x4b67c0-0x0;var _0x3cdf05=_0x6c76[_0x4b67c0];return _0x3cdf05;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var WhatsappMessage=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){WhatsappMessageEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);WhatsappMessageEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index af327bf..dcb19af 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 _0xc59d=['FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','sinch','baseUrl','/whatsapp/v1/','/messages/','text','body','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xc59d,0x11f));var _0xdc59=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc59d[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xdc59('0x0'));var util=require(_0xdc59('0x1'));var logger=require(_0xdc59('0x2'))(_0xdc59('0x3'));var moment=require('moment');var BPromise=require(_0xdc59('0x4'));var rp=require('request-promise');var fetch=require(_0xdc59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc59('0x6'));var config=require(_0xdc59('0x7'));var attributes=require(_0xdc59('0x8'));module[_0xdc59('0x9')]=function(_0x172039,_0x1a23db){return _0x172039['define'](_0xdc59('0xa'),attributes,{'tableName':_0xdc59('0xb'),'paranoid':![],'indexes':[{'name':_0xdc59('0xc'),'fields':[_0xdc59('0xc')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0xdc59('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d15dc,_0x45fb60,_0x51e9d9){var _0x13888d=_0x172039['models'];var _0x23b2f1=_0x1d15dc[_0xdc59('0xe')]({'plain':!![]});if(_0x23b2f1[_0xdc59('0xf')][_0xdc59('0x10')]()==='in'||_0x23b2f1[_0xdc59('0xf')][_0xdc59('0x10')]()===_0xdc59('0x11')&&!_0x23b2f1[_0xdc59('0x12')]&&!_[_0xdc59('0x13')](_0x23b2f1[_0xdc59('0x14')])){_0x13888d[_0xdc59('0x15')][_0xdc59('0x16')]({'where':{'id':_0x23b2f1[_0xdc59('0x17')]}})['then'](function(_0x32d737){if(_0x32d737){_0x32d737['update']({'lastMsgAt':_0x23b2f1[_0xdc59('0x18')],'lastMsgDirection':_0x23b2f1['direction']['toLowerCase']()});}})[_0xdc59('0x19')](function(_0x4a20c3){console[_0xdc59('0x1a')](_0x4a20c3);});}if(_0x23b2f1[_0xdc59('0xf')]===_0xdc59('0x11')&&!_0x23b2f1[_0xdc59('0x12')]){var _0x34388a;_0x13888d[_0xdc59('0x1b')][_0xdc59('0x1c')]({'where':{'id':_0x23b2f1[_0xdc59('0x1d')]},'raw':!![]})[_0xdc59('0x1e')](function(_0x2f7b19){_0x34388a=_0x2f7b19;if(_0x34388a&&_0x34388a[_0xdc59('0x1f')]){switch(_0x34388a[_0xdc59('0x1f')]){case _0xdc59('0x20'):var _0x3a2393=require(_0xdc59('0x20'));if(_0x34388a[_0xdc59('0x21')]&&_0x34388a[_0xdc59('0x22')]&&_0x34388a[_0xdc59('0x23')]){var _0x5a8fce=new _0x3a2393(_0x34388a['accountSid'],_0x34388a['authToken']);_0x5a8fce['messages'][_0xdc59('0x24')]({'body':_0x23b2f1['body'],'to':'whatsapp:'+_0x23b2f1[_0xdc59('0x23')],'from':_0xdc59('0x25')+_0x34388a[_0xdc59('0x23')],'statusCallback':_0x34388a[_0xdc59('0x26')]+_0xdc59('0x27')+_0x23b2f1['id']+_0xdc59('0x28')+_0x34388a[_0xdc59('0x29')]})[_0xdc59('0x1e')](function(_0x3fffab){if(_0x3fffab[_0xdc59('0x2a')]){return _0x1d15dc[_0xdc59('0x2b')]({'messageId':_0x3fffab['sid']});}})[_0xdc59('0x19')](function(_0x2b24fb){logger[_0xdc59('0x1a')](_0xdc59('0x2c'),_0xdc59('0x2d'),_0xdc59('0x20'),util['inspect'](_0x2b24fb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc59('0x2c'),_0xdc59('0x2d'),_0xdc59('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xdc59('0x2e'):var _0x4c9026=_0x34388a[_0xdc59('0x21')];var _0x392e1b=_0x34388a['authToken'];var _0x5aea76=_0x34388a[_0xdc59('0x2f')]+_0xdc59('0x30')+_0x4c9026+_0xdc59('0x31');var _0x1ed1fa={'to':[_0x23b2f1[_0xdc59('0x23')]],'message':{'type':_0xdc59('0x32'),'text':_0x23b2f1[_0xdc59('0x33')]}};var _0xaff8be={'method':'POST','uri':_0x5aea76,'headers':{'Authorization':_0xdc59('0x34')+_0x392e1b,'Content-Type':_0xdc59('0x35')},'body':_0x1ed1fa,'json':!![]};rp(_0xaff8be)[_0xdc59('0x1e')](function(_0x38fd5a){if(_0x38fd5a['statuses'][0x0][_0xdc59('0x36')]){return _0x1d15dc['update']({'messageId':_0x38fd5a[_0xdc59('0x37')][0x0][_0xdc59('0x36')]});}})['catch'](function(_0x5c4f57){logger[_0xdc59('0x38')](_0xdc59('0x39'),_0x5c4f57);});break;}}})['finally'](function(){_0x51e9d9();});}else{_0x51e9d9();}}},'charset':_0xdc59('0x3a'),'collate':_0xdc59('0x3b')});}; \ No newline at end of file +var _0xe26c=['out','secret','findOne','WhatsappInteractionId','then','update','catch','WhatsappAccount','find','WhatsappAccountId','type','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction'];(function(_0x3f17eb,_0xb66d06){var _0x4ed3b8=function(_0x4915ce){while(--_0x4915ce){_0x3f17eb['push'](_0x3f17eb['shift']());}};_0x4ed3b8(++_0xb66d06);}(_0xe26c,0x1b2));var _0xce26=function(_0x4fb401,_0x2af0b2){_0x4fb401=_0x4fb401-0x0;var _0x45e901=_0xe26c[_0x4fb401];return _0x45e901;};'use strict';var _=require(_0xce26('0x0'));var util=require(_0xce26('0x1'));var logger=require(_0xce26('0x2'))(_0xce26('0x3'));var moment=require(_0xce26('0x4'));var BPromise=require(_0xce26('0x5'));var rp=require(_0xce26('0x6'));var fetch=require(_0xce26('0x7'));var fs=require('fs');var path=require(_0xce26('0x8'));var rimraf=require('rimraf');var config=require(_0xce26('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0xce26('0xa')]=function(_0x51ca1a,_0x41d037){return _0x51ca1a[_0xce26('0xb')](_0xce26('0xc'),attributes,{'tableName':_0xce26('0xd'),'paranoid':![],'indexes':[{'name':_0xce26('0xe'),'fields':[_0xce26('0xe')]},{'name':_0xce26('0xf'),'fields':[_0xce26('0x10')],'type':_0xce26('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1dc892,_0x3f0a13,_0x4e6afb){var _0x222c6a=_0x51ca1a[_0xce26('0x12')];var _0x874c59=_0x1dc892[_0xce26('0x13')]({'plain':!![]});if(_0x874c59['direction'][_0xce26('0x14')]()==='in'||_0x874c59[_0xce26('0x15')]['toLowerCase']()===_0xce26('0x16')&&!_0x874c59[_0xce26('0x17')]&&!_['isNil'](_0x874c59['UserId'])){_0x222c6a['WhatsappInteraction'][_0xce26('0x18')]({'where':{'id':_0x874c59[_0xce26('0x19')]}})[_0xce26('0x1a')](function(_0x4defe1){if(_0x4defe1){_0x4defe1[_0xce26('0x1b')]({'lastMsgAt':_0x874c59['createdAt'],'lastMsgDirection':_0x874c59[_0xce26('0x15')][_0xce26('0x14')]()});}})[_0xce26('0x1c')](function(_0x2ef3d6){console['error'](_0x2ef3d6);});}if(_0x874c59[_0xce26('0x15')]===_0xce26('0x16')&&!_0x874c59[_0xce26('0x17')]){var _0x328542;_0x222c6a[_0xce26('0x1d')][_0xce26('0x1e')]({'where':{'id':_0x874c59[_0xce26('0x1f')]},'raw':!![]})[_0xce26('0x1a')](function(_0x262145){_0x328542=_0x262145;if(_0x328542&&_0x328542[_0xce26('0x20')]){switch(_0x328542[_0xce26('0x20')]){case'twilio':var _0xcbca82=require('twilio');if(_0x328542['accountSid']&&_0x328542[_0xce26('0x21')]&&_0x328542[_0xce26('0x22')]){var _0x4d7195=new _0xcbca82(_0x328542[_0xce26('0x23')],_0x328542[_0xce26('0x21')]);_0x4d7195[_0xce26('0x24')][_0xce26('0x25')]({'body':_0x874c59['body'],'to':_0xce26('0x26')+_0x874c59[_0xce26('0x22')],'from':_0xce26('0x26')+_0x328542[_0xce26('0x22')],'statusCallback':_0x328542[_0xce26('0x27')]+_0xce26('0x28')+_0x874c59['id']+_0xce26('0x29')+_0x328542[_0xce26('0x2a')]})[_0xce26('0x1a')](function(_0x245b60){if(_0x245b60[_0xce26('0x2b')]){return _0x1dc892[_0xce26('0x1b')]({'messageId':_0x245b60['sid']});}})[_0xce26('0x1c')](function(_0xcdc293){logger[_0xce26('0x2c')](_0xce26('0x2d'),_0xce26('0x2e'),'twilio',util[_0xce26('0x2f')](_0xcdc293,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xce26('0x2d'),_0xce26('0x2e'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x2ffb02=_0x328542[_0xce26('0x23')];var _0x4a282d=_0x328542[_0xce26('0x21')];var _0x106321=_0x328542['baseUrl']+_0xce26('0x30')+_0x2ffb02+'/messages/';var _0x5b2705={'to':[_0x874c59[_0xce26('0x22')]],'message':{'type':_0xce26('0x31'),'text':_0x874c59['body']}};var _0x28c020={'method':'POST','uri':_0x106321,'headers':{'Authorization':_0xce26('0x32')+_0x4a282d,'Content-Type':_0xce26('0x33')},'body':_0x5b2705,'json':!![]};rp(_0x28c020)[_0xce26('0x1a')](function(_0x231682){if(_0x231682[_0xce26('0x34')][0x0][_0xce26('0x35')]){return _0x1dc892[_0xce26('0x1b')]({'messageId':_0x231682['statuses'][0x0]['message_id']});}})[_0xce26('0x1c')](function(_0x24a8d2){logger[_0xce26('0x36')]('WhatsappMessage,\x20%s',_0x24a8d2);});break;}}})[_0xce26('0x37')](function(){_0x4e6afb();});}else{_0x4e6afb();}}},'charset':'utf8mb4','collate':_0xce26('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 123ed92..21a1438 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 _0xf799=['defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x564bd8,_0xcb6c5d){var _0x10aab4=function(_0x16b513){while(--_0x16b513){_0x564bd8['push'](_0x564bd8['shift']());}};_0x10aab4(++_0xcb6c5d);}(_0xf799,0x106));var _0x9f79=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0xf799[_0x20aadb];return _0x520018;};'use strict';var _=require(_0x9f79('0x0'));var util=require(_0x9f79('0x1'));var moment=require(_0x9f79('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f79('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9f79('0x4'))(_0x9f79('0x5'));var config=require(_0x9f79('0x6'));var jayson=require(_0x9f79('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9f79('0x8')](config[_0x9f79('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f79('0xa'))(new Redis(config[_0x9f79('0x9')]));require(_0x9f79('0xb'))[_0x9f79('0xc')](socket);function respondWithRpcPromise(_0x36a1ea,_0x4d8469,_0xb5cab7){return new BPromise(function(_0xb3e7e5,_0x43b071){return client[_0x9f79('0xd')](_0x36a1ea,_0xb5cab7)[_0x9f79('0xe')](function(_0x5d5d3d){logger[_0x9f79('0xf')](_0x9f79('0x10'),_0x4d8469,_0x9f79('0x11'));logger[_0x9f79('0x12')](_0x9f79('0x13'),_0x4d8469,_0x9f79('0x11'),JSON['stringify'](_0x5d5d3d));if(_0x5d5d3d[_0x9f79('0x14')]){if(_0x5d5d3d[_0x9f79('0x14')][_0x9f79('0x15')]===0x1f4){logger[_0x9f79('0x14')](_0x9f79('0x10'),_0x4d8469,_0x5d5d3d[_0x9f79('0x14')][_0x9f79('0x16')]);return _0x43b071(_0x5d5d3d[_0x9f79('0x14')]['message']);}logger[_0x9f79('0x14')](_0x9f79('0x10'),_0x4d8469,_0x5d5d3d[_0x9f79('0x14')][_0x9f79('0x16')]);return _0xb3e7e5(_0x5d5d3d[_0x9f79('0x14')][_0x9f79('0x16')]);}else{logger[_0x9f79('0xf')](_0x9f79('0x10'),_0x4d8469,_0x9f79('0x11'));_0xb3e7e5(_0x5d5d3d['result'][_0x9f79('0x16')]);}})[_0x9f79('0x17')](function(_0xe4ff33){logger[_0x9f79('0x14')](_0x9f79('0x10'),_0x4d8469,_0xe4ff33);_0x43b071(_0xe4ff33);});});}exports[_0x9f79('0x18')]=function(_0x2ce82b){var _0x79e050=this;return new Promise(function(_0x2d0fc3,_0x19053b){return db[_0x9f79('0x19')][_0x9f79('0x1a')](_0x2ce82b['body'],{'raw':_0x2ce82b[_0x9f79('0x1b')]?_0x2ce82b[_0x9f79('0x1b')][_0x9f79('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4519bb){logger[_0x9f79('0xf')](_0x9f79('0x18'),_0x2ce82b);logger[_0x9f79('0x12')](_0x9f79('0x18'),_0x2ce82b,JSON[_0x9f79('0x1d')](_0x4519bb));_0x2d0fc3(_0x4519bb);})[_0x9f79('0x17')](function(_0x1e8654){logger[_0x9f79('0x14')](_0x9f79('0x18'),_0x1e8654['message'],_0x2ce82b);_0x19053b(_0x79e050[_0x9f79('0x14')](0x1f4,_0x1e8654['message']));});});}; \ No newline at end of file +var _0x42fd=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','create','body','options','then','lodash','util'];(function(_0x390020,_0x3f8042){var _0x50f7d0=function(_0xe3b96e){while(--_0xe3b96e){_0x390020['push'](_0x390020['shift']());}};_0x50f7d0(++_0x3f8042);}(_0x42fd,0x134));var _0xd42f=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x42fd[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xd42f('0x0'));var util=require(_0xd42f('0x1'));var moment=require(_0xd42f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd42f('0x3'));var db=require(_0xd42f('0x4'))['db'];var utils=require(_0xd42f('0x5'));var logger=require(_0xd42f('0x6'))(_0xd42f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd42f('0x8'));var client=jayson[_0xd42f('0x9')][_0xd42f('0xa')]({'port':0x232a});config[_0xd42f('0xb')]=_[_0xd42f('0xc')](config[_0xd42f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd42f('0xd'))(new Redis(config['redis']));require(_0xd42f('0xe'))[_0xd42f('0xf')](socket);function respondWithRpcPromise(_0x14364a,_0x17938c,_0x4283a2){return new BPromise(function(_0x595d66,_0x37b0d9){return client['request'](_0x14364a,_0x4283a2)['then'](function(_0x204273){logger[_0xd42f('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x17938c,_0xd42f('0x11'));logger[_0xd42f('0x12')](_0xd42f('0x13'),_0x17938c,_0xd42f('0x11'),JSON[_0xd42f('0x14')](_0x204273));if(_0x204273[_0xd42f('0x15')]){if(_0x204273['error'][_0xd42f('0x16')]===0x1f4){logger[_0xd42f('0x15')](_0xd42f('0x17'),_0x17938c,_0x204273[_0xd42f('0x15')][_0xd42f('0x18')]);return _0x37b0d9(_0x204273[_0xd42f('0x15')][_0xd42f('0x18')]);}logger[_0xd42f('0x15')](_0xd42f('0x17'),_0x17938c,_0x204273[_0xd42f('0x15')][_0xd42f('0x18')]);return _0x595d66(_0x204273[_0xd42f('0x15')]['message']);}else{logger[_0xd42f('0x10')](_0xd42f('0x17'),_0x17938c,'request\x20sent');_0x595d66(_0x204273['result'][_0xd42f('0x18')]);}})[_0xd42f('0x19')](function(_0x20baa3){logger[_0xd42f('0x15')](_0xd42f('0x17'),_0x17938c,_0x20baa3);_0x37b0d9(_0x20baa3);});});}exports[_0xd42f('0x1a')]=function(_0x19a9a0){var _0x59da13=this;return new Promise(function(_0x357ced,_0x4f7b9f){return db['WhatsappMessage'][_0xd42f('0x1b')](_0x19a9a0[_0xd42f('0x1c')],{'raw':_0x19a9a0[_0xd42f('0x1d')]?_0x19a9a0['options']['raw']===undefined?!![]:![]:!![]})[_0xd42f('0x1e')](function(_0x1b6cd8){logger[_0xd42f('0x10')]('CreateWhatsappMessage',_0x19a9a0);logger[_0xd42f('0x12')]('CreateWhatsappMessage',_0x19a9a0,JSON['stringify'](_0x1b6cd8));_0x357ced(_0x1b6cd8);})[_0xd42f('0x19')](function(_0x49940e){logger[_0xd42f('0x15')](_0xd42f('0x1a'),_0x49940e['message'],_0x19a9a0);_0x4f7b9f(_0x59da13[_0xd42f('0x15')](0x1f4,_0x49940e[_0xd42f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index e8a4c93..b4c856c 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 _0x1542=['remove','update','length','./whatsappMessage.events','save'];(function(_0x101935,_0x1d404d){var _0x3b60d0=function(_0x1f7976){while(--_0x1f7976){_0x101935['push'](_0x101935['shift']());}};_0x3b60d0(++_0x1d404d);}(_0x1542,0x99));var _0x2154=function(_0x3b2c1e,_0x3bb7ed){_0x3b2c1e=_0x3b2c1e-0x0;var _0x27aad9=_0x1542[_0x3b2c1e];return _0x27aad9;};'use strict';var WhatsappMessageEvents=require(_0x2154('0x0'));var events=[_0x2154('0x1'),_0x2154('0x2'),_0x2154('0x3')];function createListener(_0x98b224,_0x416a76){return function(_0x5e96e3){_0x416a76['emit'](_0x98b224,_0x5e96e3);};}function removeListener(_0xcf4bde,_0x5a0512){return function(){WhatsappMessageEvents['removeListener'](_0xcf4bde,_0x5a0512);};}exports['register']=function(_0x2f19dd){for(var _0xc5d28b=0x0,_0x4b5a4b=events[_0x2154('0x4')];_0xc5d28b<_0x4b5a4b;_0xc5d28b++){var _0x30d8e5=events[_0xc5d28b];var _0xa3a1e=createListener('whatsappMessage:'+_0x30d8e5,_0x2f19dd);WhatsappMessageEvents['on'](_0x30d8e5,_0xa3a1e);}}; \ No newline at end of file +var _0x6d22=['whatsappMessage:','save','update','emit','removeListener','register','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d22,0x16d));var _0x26d2=function(_0x12d3cf,_0xfd1e86){_0x12d3cf=_0x12d3cf-0x0;var _0x340a3c=_0x6d22[_0x12d3cf];return _0x340a3c;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x26d2('0x0'),'remove',_0x26d2('0x1')];function createListener(_0x986354,_0x1cc7ed){return function(_0x74a56c){_0x1cc7ed[_0x26d2('0x2')](_0x986354,_0x74a56c);};}function removeListener(_0x3352c5,_0x2554be){return function(){WhatsappMessageEvents[_0x26d2('0x3')](_0x3352c5,_0x2554be);};}exports[_0x26d2('0x4')]=function(_0x3b95d5){for(var _0xe9dfe5=0x0,_0x3dbd18=events[_0x26d2('0x5')];_0xe9dfe5<_0x3dbd18;_0xe9dfe5++){var _0x30798d=events[_0xe9dfe5];var _0x14d60d=createListener(_0x26d2('0x6')+_0x30798d,_0x3b95d5);WhatsappMessageEvents['on'](_0x30798d,_0x14d60d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index ab340af..69f6f14 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 _0xbd23=['index','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0xedfbda,_0x1523fd){var _0x2b06fd=function(_0x4e32a9){while(--_0x4e32a9){_0xedfbda['push'](_0xedfbda['shift']());}};_0x2b06fd(++_0x1523fd);}(_0xbd23,0x9d));var _0x3bd2=function(_0x52a858,_0x1df8ea){_0x52a858=_0x52a858-0x0;var _0x247399=_0xbd23[_0x52a858];return _0x247399;};'use strict';var multer=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var path=require('path');var timeout=require(_0x3bd2('0x2'));var express=require('express');var router=express[_0x3bd2('0x3')]();var fs_extra=require(_0x3bd2('0x4'));var auth=require(_0x3bd2('0x5'));var interaction=require(_0x3bd2('0x6'));var config=require(_0x3bd2('0x7'));var controller=require(_0x3bd2('0x8'));router[_0x3bd2('0x9')]('/',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xb')]);router[_0x3bd2('0x9')]('/describe',auth[_0x3bd2('0xa')](),controller['describe']);router[_0x3bd2('0x9')](_0x3bd2('0xc'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xd')]);router[_0x3bd2('0x9')](_0x3bd2('0xe'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xf')]);router[_0x3bd2('0x9')](_0x3bd2('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3bd2('0x9')]('/:id/users',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x11')]);router[_0x3bd2('0x12')]('/',auth['isAuthenticated'](),controller[_0x3bd2('0x13')]);router['post']('/:id/teams',auth[_0x3bd2('0xa')](),controller['addTeams']);router[_0x3bd2('0x12')](_0x3bd2('0x14'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x15')]);router[_0x3bd2('0x16')]('/:id',auth[_0x3bd2('0xa')](),controller['update']);router[_0x3bd2('0x17')](_0x3bd2('0xc'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x18')]);router['delete'](_0x3bd2('0x10'),auth['isAuthenticated'](),controller[_0x3bd2('0x19')]);router['delete']('/:id/users',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x1a')]);module[_0x3bd2('0x1b')]=router; \ No newline at end of file +var _0x2d34=['isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x2d34,0x156));var _0x42d3=function(_0x5ef0c9,_0x5e3370){_0x5ef0c9=_0x5ef0c9-0x0;var _0x5658d8=_0x2d34[_0x5ef0c9];return _0x5658d8;};'use strict';var multer=require('multer');var util=require(_0x42d3('0x0'));var path=require(_0x42d3('0x1'));var timeout=require(_0x42d3('0x2'));var express=require(_0x42d3('0x3'));var router=express[_0x42d3('0x4')]();var fs_extra=require(_0x42d3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x42d3('0x6'));var controller=require('./whatsappQueue.controller');router[_0x42d3('0x7')]('/',auth['isAuthenticated'](),controller[_0x42d3('0x8')]);router['get']('/describe',auth[_0x42d3('0x9')](),controller[_0x42d3('0xa')]);router[_0x42d3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x42d3('0xb')]);router[_0x42d3('0x7')](_0x42d3('0xc'),auth['isAuthenticated'](),controller[_0x42d3('0xd')]);router[_0x42d3('0x7')](_0x42d3('0xe'),auth[_0x42d3('0x9')](),controller[_0x42d3('0xf')]);router[_0x42d3('0x7')](_0x42d3('0x10'),auth[_0x42d3('0x9')](),controller[_0x42d3('0x11')]);router[_0x42d3('0x12')]('/',auth[_0x42d3('0x9')](),controller['create']);router[_0x42d3('0x12')](_0x42d3('0xe'),auth[_0x42d3('0x9')](),controller['addTeams']);router['post'](_0x42d3('0x10'),auth[_0x42d3('0x9')](),controller['addAgents']);router[_0x42d3('0x13')](_0x42d3('0x14'),auth[_0x42d3('0x9')](),controller[_0x42d3('0x15')]);router[_0x42d3('0x16')]('/:id',auth[_0x42d3('0x9')](),controller[_0x42d3('0x17')]);router[_0x42d3('0x16')](_0x42d3('0xe'),auth[_0x42d3('0x9')](),controller[_0x42d3('0x18')]);router[_0x42d3('0x16')](_0x42d3('0x10'),auth[_0x42d3('0x9')](),controller[_0x42d3('0x19')]);module[_0x42d3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index cb3eac6..63c06d0 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 _0x057a=['rrmemory','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x057a,0x1a6));var _0xa057=function(_0x554290,_0x27c675){_0x554290=_0x554290-0x0;var _0x423400=_0x057a[_0x554290];return _0x423400;};'use strict';var Sequelize=require(_0xa057('0x0'));module[_0xa057('0x1')]={'name':{'type':Sequelize[_0xa057('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa057('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa057('0x4'),_0xa057('0x5'),'roundrobin')},'description':{'type':Sequelize[_0xa057('0x2')]}}; \ No newline at end of file +var _0x9099=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x9099,0x1ac));var _0x9909=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x9099[_0x1dfa63];return _0x26f2a9;};'use strict';var Sequelize=require(_0x9909('0x0'));module['exports']={'name':{'type':Sequelize[_0x9909('0x1')],'unique':_0x9909('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9909('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9909('0x4')](_0x9909('0x5'),_0x9909('0x6'),_0x9909('0x7'))},'description':{'type':Sequelize[_0x9909('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index c63e677..577b7e8 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 _0x1bd4=['../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','WhatsappQueues','UserProfileResource','end','error','stack','name','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','WhatsappQueue','findAll','rows','show','rawAttributes','options','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','SIP','getTeams','Team','ids','online','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x1bd4,0x189));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x41bd('0x0'));var rimraf=require(_0x41bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x41bd('0x2'));var moment=require(_0x41bd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x41bd('0x4'));var util=require(_0x41bd('0x5'));var path=require(_0x41bd('0x6'));var sox=require(_0x41bd('0x7'));var csv=require('to-csv');var ejs=require(_0x41bd('0x8'));var fs=require('fs');var fs_extra=require(_0x41bd('0x9'));var _=require(_0x41bd('0xa'));var squel=require(_0x41bd('0xb'));var crypto=require(_0x41bd('0xc'));var jsforce=require(_0x41bd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x41bd('0xe'));var querystring=require(_0x41bd('0xf'));var Papa=require(_0x41bd('0x10'));var Redis=require(_0x41bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x41bd('0x12'));var hardwareService=require(_0x41bd('0x13'));var logger=require(_0x41bd('0x14'))(_0x41bd('0x15'));var utils=require('../../config/utils');var config=require(_0x41bd('0x16'));var licenseUtil=require(_0x41bd('0x17'));var db=require(_0x41bd('0x18'))['db'];config[_0x41bd('0x19')]=_['defaults'](config[_0x41bd('0x19')],{'host':_0x41bd('0x1a'),'port':0x18eb});var socket=require(_0x41bd('0x1b'))(new Redis(config[_0x41bd('0x19')]));require(_0x41bd('0x1c'))['register'](socket);function respondWithStatusCode(_0x39ed0d,_0x2cffa1){_0x2cffa1=_0x2cffa1||0xcc;return function(_0x4a3bef){if(_0x4a3bef){return _0x39ed0d[_0x41bd('0x1d')](_0x2cffa1);}return _0x39ed0d['status'](_0x2cffa1)['end']();};}function respondWithResult(_0x4e4583,_0x59ddc3){_0x59ddc3=_0x59ddc3||0xc8;return function(_0x1c247a){if(_0x1c247a){return _0x4e4583[_0x41bd('0x1e')](_0x59ddc3)[_0x41bd('0x1f')](_0x1c247a);}};}function respondWithFilteredResult(_0x19925d,_0x35e28a){return function(_0x58c119){if(_0x58c119){var _0x1773e8=typeof _0x35e28a[_0x41bd('0x20')]===_0x41bd('0x21')&&typeof _0x35e28a[_0x41bd('0x22')]===_0x41bd('0x21');var _0x42eca4=_0x58c119[_0x41bd('0x23')];var _0x763073=_0x1773e8?0x0:_0x35e28a[_0x41bd('0x20')];var _0x3c59ca=_0x1773e8?_0x58c119[_0x41bd('0x23')]:_0x35e28a[_0x41bd('0x20')]+_0x35e28a['limit'];var _0x27f015;if(_0x3c59ca>=_0x42eca4){_0x3c59ca=_0x42eca4;_0x27f015=0xc8;}else{_0x27f015=0xce;}_0x19925d[_0x41bd('0x1e')](_0x27f015);return _0x19925d[_0x41bd('0x24')](_0x41bd('0x25'),_0x763073+'-'+_0x3c59ca+'/'+_0x42eca4)[_0x41bd('0x1f')](_0x58c119);}return null;};}function patchUpdates(_0x20e1de){return function(_0x4fc1eb){try{jsonpatch[_0x41bd('0x26')](_0x4fc1eb,_0x20e1de,!![]);}catch(_0x5543a9){return BPromise[_0x41bd('0x27')](_0x5543a9);}return _0x4fc1eb['save']();};}function saveUpdates(_0x569c24,_0x1ba0e7){return function(_0x459f20){if(_0x459f20){return _0x459f20[_0x41bd('0x28')](_0x569c24)['then'](function(_0x63695){return _0x63695;});}return null;};}function removeEntity(_0x17a8aa,_0x56566f){return function(_0x692f91){if(_0x692f91){return _0x692f91[_0x41bd('0x29')]()[_0x41bd('0x2a')](function(){var _0x4d77b=_0x692f91['get']({'plain':!![]});var _0x516426=_0x41bd('0x2b');return db[_0x41bd('0x2c')][_0x41bd('0x29')]({'where':{'type':_0x516426,'resourceId':_0x4d77b['id']}})['then'](function(){return _0x692f91;});})['then'](function(){_0x17a8aa[_0x41bd('0x1e')](0xcc)[_0x41bd('0x2d')]();});}};}function handleEntityNotFound(_0x8d644e,_0x16873f){return function(_0x4066ef){if(!_0x4066ef){_0x8d644e[_0x41bd('0x1d')](0x194);}return _0x4066ef;};}function handleError(_0x332a24,_0xb49a06){_0xb49a06=_0xb49a06||0x1f4;return function(_0xee0fd9){logger[_0x41bd('0x2e')](_0xee0fd9[_0x41bd('0x2f')]);if(_0xee0fd9[_0x41bd('0x30')]){delete _0xee0fd9['name'];}_0x332a24['status'](_0xb49a06)['send'](_0xee0fd9);};}exports['index']=function(_0x3f8f66,_0x438130){var _0x20cb5e={},_0x28a663={},_0x3e2499={'count':0x0,'rows':[]};var _0xfe6927=_[_0x41bd('0x31')](db['WhatsappQueue']['rawAttributes'],function(_0x3c5204){return{'name':_0x3c5204['fieldName'],'type':_0x3c5204[_0x41bd('0x32')][_0x41bd('0x33')]};});_0x28a663[_0x41bd('0x34')]=_['map'](_0xfe6927,_0x41bd('0x30'));_0x28a663[_0x41bd('0x35')]=_[_0x41bd('0x36')](_0x3f8f66[_0x41bd('0x35')]);_0x28a663[_0x41bd('0x37')]=_[_0x41bd('0x38')](_0x28a663[_0x41bd('0x34')],_0x28a663['query']);_0x20cb5e[_0x41bd('0x39')]=_['intersection'](_0x28a663[_0x41bd('0x34')],qs[_0x41bd('0x3a')](_0x3f8f66[_0x41bd('0x35')]['fields']));_0x20cb5e['attributes']=_0x20cb5e['attributes'][_0x41bd('0x3b')]?_0x20cb5e['attributes']:_0x28a663[_0x41bd('0x34')];if(!_0x3f8f66[_0x41bd('0x35')][_0x41bd('0x3c')](_0x41bd('0x3d'))){_0x20cb5e[_0x41bd('0x22')]=qs['limit'](_0x3f8f66[_0x41bd('0x35')][_0x41bd('0x22')]);_0x20cb5e['offset']=qs[_0x41bd('0x20')](_0x3f8f66['query']['offset']);}_0x20cb5e[_0x41bd('0x3e')]=qs[_0x41bd('0x3f')](_0x3f8f66[_0x41bd('0x35')][_0x41bd('0x3f')]);_0x20cb5e['where']=qs[_0x41bd('0x37')](_[_0x41bd('0x40')](_0x3f8f66['query'],_0x28a663[_0x41bd('0x37')]),_0xfe6927);if(_0x3f8f66[_0x41bd('0x35')][_0x41bd('0x41')]){_0x20cb5e[_0x41bd('0x42')]=_[_0x41bd('0x43')](_0x20cb5e[_0x41bd('0x42')],{'$or':_[_0x41bd('0x31')](_0xfe6927,function(_0x51413e){if(_0x51413e['type']!=='VIRTUAL'){var _0x3d46e1={};_0x3d46e1[_0x51413e[_0x41bd('0x30')]]={'$like':'%'+_0x3f8f66[_0x41bd('0x35')][_0x41bd('0x41')]+'%'};return _0x3d46e1;}})});}_0x20cb5e=_[_0x41bd('0x43')]({},_0x20cb5e,_0x3f8f66['options']);var _0x5ce60d={'where':_0x20cb5e[_0x41bd('0x42')]};return db['WhatsappQueue'][_0x41bd('0x23')](_0x5ce60d)['then'](function(_0x133c72){_0x3e2499[_0x41bd('0x23')]=_0x133c72;if(_0x3f8f66['query'][_0x41bd('0x44')]){_0x20cb5e[_0x41bd('0x45')]=[{'all':!![]}];}return db[_0x41bd('0x46')][_0x41bd('0x47')](_0x20cb5e);})[_0x41bd('0x2a')](function(_0x36ae65){_0x3e2499[_0x41bd('0x48')]=_0x36ae65;return _0x3e2499;})['then'](respondWithFilteredResult(_0x438130,_0x20cb5e))['catch'](handleError(_0x438130,null));};exports[_0x41bd('0x49')]=function(_0x44be85,_0x483d91){var _0x2f3b0b={'raw':!![],'where':{'id':_0x44be85['params']['id']}},_0x1935f4={};_0x1935f4[_0x41bd('0x34')]=_[_0x41bd('0x36')](db['WhatsappQueue'][_0x41bd('0x4a')]);_0x1935f4[_0x41bd('0x35')]=_[_0x41bd('0x36')](_0x44be85[_0x41bd('0x35')]);_0x1935f4[_0x41bd('0x37')]=_[_0x41bd('0x38')](_0x1935f4['model'],_0x1935f4[_0x41bd('0x35')]);_0x2f3b0b['attributes']=_['intersection'](_0x1935f4['model'],qs[_0x41bd('0x3a')](_0x44be85[_0x41bd('0x35')][_0x41bd('0x3a')]));_0x2f3b0b[_0x41bd('0x39')]=_0x2f3b0b[_0x41bd('0x39')]['length']?_0x2f3b0b[_0x41bd('0x39')]:_0x1935f4[_0x41bd('0x34')];if(_0x44be85[_0x41bd('0x35')][_0x41bd('0x44')]){_0x2f3b0b[_0x41bd('0x45')]=[{'all':!![]}];}_0x2f3b0b=_['merge']({},_0x2f3b0b,_0x44be85[_0x41bd('0x4b')]);return db[_0x41bd('0x46')][_0x41bd('0x4c')](_0x2f3b0b)[_0x41bd('0x2a')](handleEntityNotFound(_0x483d91,null))['then'](respondWithResult(_0x483d91,null))[_0x41bd('0x4d')](handleError(_0x483d91,null));};exports[_0x41bd('0x4e')]=function(_0x3b310f,_0x2f6582){return db[_0x41bd('0x46')][_0x41bd('0x4e')](_0x3b310f[_0x41bd('0x4f')],{})[_0x41bd('0x2a')](function(_0x35896d){var _0x5e1b16=_0x3b310f['user'][_0x41bd('0x50')]({'plain':!![]});if(!_0x5e1b16)throw new Error(_0x41bd('0x51'));if(_0x5e1b16['role']===_0x41bd('0x52')){var _0x188689=_0x35896d[_0x41bd('0x50')]({'plain':!![]});var _0x285d00='WhatsappQueues';return db[_0x41bd('0x53')][_0x41bd('0x4c')]({'where':{'name':_0x285d00,'userProfileId':_0x5e1b16[_0x41bd('0x54')]},'raw':!![]})[_0x41bd('0x2a')](function(_0x14fbfa){if(_0x14fbfa&&_0x14fbfa[_0x41bd('0x55')]===0x0){return db[_0x41bd('0x2c')][_0x41bd('0x4e')]({'name':_0x188689['name'],'resourceId':_0x188689['id'],'type':_0x14fbfa[_0x41bd('0x30')],'sectionId':_0x14fbfa['id']},{})[_0x41bd('0x2a')](function(){return _0x35896d;});}else{return _0x35896d;}})['catch'](function(_0x503919){logger['error'](_0x41bd('0x56'),_0x503919);throw _0x503919;});}return _0x35896d;})[_0x41bd('0x2a')](respondWithResult(_0x2f6582,0xc9))['catch'](handleError(_0x2f6582,null));};exports['update']=function(_0x385746,_0x433ec9){if(_0x385746[_0x41bd('0x4f')]['id']){delete _0x385746[_0x41bd('0x4f')]['id'];}return db[_0x41bd('0x46')][_0x41bd('0x4c')]({'where':{'id':_0x385746[_0x41bd('0x57')]['id']}})['then'](handleEntityNotFound(_0x433ec9,null))[_0x41bd('0x2a')](saveUpdates(_0x385746[_0x41bd('0x4f')],null))[_0x41bd('0x2a')](respondWithResult(_0x433ec9,null))['catch'](handleError(_0x433ec9,null));};exports['destroy']=function(_0x5175ee,_0x1c82a6){return db[_0x41bd('0x46')]['find']({'where':{'id':_0x5175ee[_0x41bd('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c82a6,null))[_0x41bd('0x2a')](removeEntity(_0x1c82a6,null))[_0x41bd('0x4d')](handleError(_0x1c82a6,null));};exports[_0x41bd('0x58')]=function(_0x30dded,_0x2fe64b){return db['WhatsappQueue'][_0x41bd('0x58')]()[_0x41bd('0x2a')](respondWithResult(_0x2fe64b,null))[_0x41bd('0x4d')](handleError(_0x2fe64b,null));};exports[_0x41bd('0x59')]=function(_0x403eba,_0x3b21e9,_0x1507fb){var _0x9710fc={'raw':!![],'where':{}},_0x6d772f={},_0x16248b;return db[_0x41bd('0x46')][_0x41bd('0x5a')]({'where':{'id':_0x403eba[_0x41bd('0x57')]['id']}})[_0x41bd('0x2a')](handleEntityNotFound(_0x3b21e9,null))[_0x41bd('0x2a')](function(_0x13467e){if(_0x13467e){_0x16248b=_0x13467e[_0x41bd('0x50')]({'plain':!![]});_0x6d772f[_0x41bd('0x34')]=_[_0x41bd('0x36')](db[_0x41bd('0x5b')][_0x41bd('0x4a')]);_0x6d772f[_0x41bd('0x35')]=_[_0x41bd('0x36')](_0x403eba['query']);_0x6d772f[_0x41bd('0x37')]=_[_0x41bd('0x38')](_0x6d772f[_0x41bd('0x34')],_0x6d772f[_0x41bd('0x35')]);_0x9710fc[_0x41bd('0x39')]=_['intersection'](_0x6d772f[_0x41bd('0x34')],qs[_0x41bd('0x3a')](_0x403eba[_0x41bd('0x35')]['fields']));_0x9710fc['attributes']=_0x9710fc[_0x41bd('0x39')]['length']?_0x9710fc['attributes']:_0x6d772f[_0x41bd('0x34')];if(!_0x403eba[_0x41bd('0x35')][_0x41bd('0x3c')](_0x41bd('0x3d'))){_0x9710fc[_0x41bd('0x22')]=qs[_0x41bd('0x22')](_0x403eba[_0x41bd('0x35')][_0x41bd('0x22')]);_0x9710fc['offset']=qs['offset'](_0x403eba['query']['offset']);}_0x9710fc[_0x41bd('0x3e')]=qs[_0x41bd('0x3f')](_0x403eba[_0x41bd('0x35')][_0x41bd('0x3f')]);_0x9710fc[_0x41bd('0x42')]=qs[_0x41bd('0x37')](_[_0x41bd('0x40')](_0x403eba[_0x41bd('0x35')],_0x6d772f[_0x41bd('0x37')]));_0x9710fc[_0x41bd('0x42')][_0x41bd('0x5c')]=_0x13467e['id'];if(_0x403eba[_0x41bd('0x35')][_0x41bd('0x41')]){_0x9710fc['where']=_['merge'](_0x9710fc['where'],{'$or':_[_0x41bd('0x31')](_0x9710fc[_0x41bd('0x39')],function(_0x83dad2){var _0x43c839={};_0x43c839[_0x83dad2]={'$like':'%'+_0x403eba[_0x41bd('0x35')]['filter']+'%'};return _0x43c839;})});}_0x9710fc=_['merge']({},_0x9710fc,_0x403eba['options']);return db[_0x41bd('0x5b')][_0x41bd('0x47')](_0x9710fc);}})[_0x41bd('0x2a')](function(_0x2b3a35){if(_0x2b3a35){return db[_0x41bd('0x5d')][_0x41bd('0x5e')]({'where':{'id':_[_0x41bd('0x31')](_0x2b3a35,'UserId'),'role':_0x41bd('0x5f')},'attributes':['id',_0x41bd('0x30'),_0x41bd('0x60'),_0x41bd('0x61'),'createdAt']});}})[_0x41bd('0x2a')](function(_0x12dce1){if(_0x12dce1){return{'count':_0x12dce1[_0x41bd('0x23')],'rows':_[_0x41bd('0x31')](_0x12dce1[_0x41bd('0x48')],function(_0x4e1dc6){return{'membername':_0x4e1dc6[_0x41bd('0x30')],'UserId':_0x4e1dc6['id'],'queue_name':_0x16248b[_0x41bd('0x30')],'WhatsappQueueId':_0x16248b['id'],'interface':util['format']('%s/%s',_0x41bd('0x62'),_0x4e1dc6[_0x41bd('0x30')]),'penalty':0x0,'paused':_0x4e1dc6[_0x41bd('0x60')],'createdAt':_0x4e1dc6['createdAt'],'updatedAt':_0x4e1dc6[_0x41bd('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3b21e9,_0x9710fc))['catch'](handleError(_0x3b21e9,null));};exports[_0x41bd('0x63')]=function(_0x51e230,_0x2623fd,_0x291d10){var _0x874bca={};var _0x24085f={};var _0x1a57e9;var _0x69c87e;return db[_0x41bd('0x46')]['findOne']({'where':{'id':_0x51e230[_0x41bd('0x57')]['id']}})[_0x41bd('0x2a')](handleEntityNotFound(_0x2623fd,null))[_0x41bd('0x2a')](function(_0x5c63d3){if(_0x5c63d3){_0x1a57e9=_0x5c63d3;_0x24085f[_0x41bd('0x34')]=_[_0x41bd('0x36')](db[_0x41bd('0x64')][_0x41bd('0x4a')]);_0x24085f[_0x41bd('0x35')]=_[_0x41bd('0x36')](_0x51e230[_0x41bd('0x35')]);_0x24085f[_0x41bd('0x37')]=_[_0x41bd('0x38')](_0x24085f[_0x41bd('0x34')],_0x24085f[_0x41bd('0x35')]);_0x874bca[_0x41bd('0x39')]=_['intersection'](_0x24085f['model'],qs[_0x41bd('0x3a')](_0x51e230['query'][_0x41bd('0x3a')]));_0x874bca[_0x41bd('0x39')]=_0x874bca[_0x41bd('0x39')][_0x41bd('0x3b')]?_0x874bca['attributes']:_0x24085f[_0x41bd('0x34')];_0x874bca[_0x41bd('0x3e')]=qs['sort'](_0x51e230[_0x41bd('0x35')][_0x41bd('0x3f')]);_0x874bca[_0x41bd('0x42')]=qs[_0x41bd('0x37')](_[_0x41bd('0x40')](_0x51e230[_0x41bd('0x35')],_0x24085f[_0x41bd('0x37')]));if(_0x51e230[_0x41bd('0x35')]['filter']){_0x874bca['where']=_[_0x41bd('0x43')](_0x874bca[_0x41bd('0x42')],{'$or':_[_0x41bd('0x31')](_0x874bca[_0x41bd('0x39')],function(_0x1c9442){var _0x44d5ff={};_0x44d5ff[_0x1c9442]={'$like':'%'+_0x51e230[_0x41bd('0x35')][_0x41bd('0x41')]+'%'};return _0x44d5ff;})});}_0x874bca=_['merge']({},_0x874bca,_0x51e230[_0x41bd('0x4b')]);return _0x1a57e9['getTeams'](_0x874bca);}})[_0x41bd('0x2a')](function(_0x585cef){if(_0x585cef){_0x69c87e=_0x585cef[_0x41bd('0x3b')];if(!_0x51e230[_0x41bd('0x35')][_0x41bd('0x3c')](_0x41bd('0x3d'))){_0x874bca[_0x41bd('0x22')]=qs['limit'](_0x51e230['query'][_0x41bd('0x22')]);_0x874bca['offset']=qs[_0x41bd('0x20')](_0x51e230[_0x41bd('0x35')]['offset']);}return _0x1a57e9[_0x41bd('0x63')](_0x874bca);}})[_0x41bd('0x2a')](function(_0x434f0d){if(_0x434f0d){return _0x434f0d?{'count':_0x69c87e,'rows':_0x434f0d}:null;}})[_0x41bd('0x2a')](respondWithResult(_0x2623fd,null))[_0x41bd('0x4d')](handleError(_0x2623fd,null));};exports['addTeams']=function(_0x5f0439,_0x4f9d42,_0x5c788b){var _0x50b61c=_0x5f0439[_0x41bd('0x4f')][_0x41bd('0x65')];return db['Team'][_0x41bd('0x47')]({'where':{'id':_0x50b61c},'attributes':['id'],'include':[{'model':db[_0x41bd('0x5d')],'as':'Agents','attributes':['id','name',_0x41bd('0x66'),'voicePause',_0x41bd('0x67')],'raw':!![]}]})['then'](function(_0xa980d1){if(_0xa980d1){var _0x53fda7=_[_0x41bd('0x68')](_0xa980d1,function(_0x804c3d){var _0x135245=_0x804c3d['get']({'plain':!![]});return _0x135245[_0x41bd('0x69')];});return db[_0x41bd('0x46')]['find']({'where':{'id':_0x5f0439[_0x41bd('0x57')]['id']}})[_0x41bd('0x2a')](function(_0x4ce6a3){return db[_0x41bd('0x6a')][_0x41bd('0x6b')](function(_0x3bf1ce){return _0x4ce6a3[_0x41bd('0x6c')](_0x50b61c,{'transaction':_0x3bf1ce})['then'](function(){return BPromise[_0x41bd('0x6d')](_0x53fda7,function(_0x268c8b){return db[_0x41bd('0x5b')][_0x41bd('0x6e')]({'where':{'UserId':_0x268c8b['id'],'WhatsappQueueId':_0x5f0439[_0x41bd('0x57')]['id']},'transaction':_0x3bf1ce});});})['then'](function(){_0x53fda7[_0x41bd('0x6f')](function(_0x2d4bad){socket[_0x41bd('0x70')](_0x41bd('0x71'),{'UserId':_0x2d4bad['id'],'WhatsappQueueId':_0x4ce6a3['id']});});});});});}})[_0x41bd('0x2a')](respondWithStatusCode(_0x4f9d42,null))[_0x41bd('0x4d')](handleError(_0x4f9d42,null));};exports[_0x41bd('0x72')]=function(_0x573a11,_0x18f39a,_0x4b9209){return db[_0x41bd('0x64')][_0x41bd('0x47')]({'where':{'id':_0x573a11['query'][_0x41bd('0x65')]},'attributes':['id'],'include':[{'model':db[_0x41bd('0x5d')],'as':_0x41bd('0x69'),'attributes':['id'],'raw':!![]}]})[_0x41bd('0x2a')](handleEntityNotFound(_0x18f39a,null))[_0x41bd('0x2a')](function(_0x2d0bdb){var _0x2275b5=_[_0x41bd('0x31')](_0x2d0bdb,'id');var _0x55417c=[];var _0x547b91=[];var _0x22a364=squel[_0x41bd('0x73')]();_0x22a364[_0x41bd('0x74')](_0x41bd('0x75'))[_0x41bd('0x76')]('team_has_whatsapp_queues','tq')['join'](_0x41bd('0x77'),'ut',_0x41bd('0x78'))['where'](_0x41bd('0x79'),_0x573a11[_0x41bd('0x57')]['id']);for(var _0x55e87d=0x0;_0x55e87d<_0x2d0bdb[_0x41bd('0x3b')];_0x55e87d+=0x1){let _0x386c09=_0x2d0bdb[_0x55e87d];for(var _0x55ed31=0x0;_0x55ed31<_0x386c09['Agents'][_0x41bd('0x3b')];_0x55ed31+=0x1){let _0x59ffa9=_0x386c09[_0x41bd('0x69')][_0x55ed31];var _0x29314a=_0x22a364[_0x41bd('0x7a')]();_0x29314a[_0x41bd('0x42')](_0x41bd('0x7b'),_0x59ffa9['id']);_0x547b91[_0x41bd('0x7c')](db[_0x41bd('0x6a')][_0x41bd('0x35')](_0x29314a[_0x41bd('0x7d')](),{'type':db[_0x41bd('0x6a')][_0x41bd('0x7e')]['SELECT']})[_0x41bd('0x2a')](function(_0x1a4b98){if(_0x1a4b98[_0x41bd('0x3b')]===0x1){return _0x59ffa9['id'];}else{var _0x2fd030=_['every'](_[_0x41bd('0x31')](_0x1a4b98,'TeamId'),function(_0x11dd5d){return _[_0x41bd('0x7f')](_0x2275b5,_0x11dd5d);});if(_0x2fd030){return _0x59ffa9['id'];}}}));}}return BPromise[_0x41bd('0x80')](_0x547b91)[_0x41bd('0x2a')](function(_0x352fa1){_0x55417c=_(_0x55417c)[_0x41bd('0x81')](_0x352fa1)[_0x41bd('0x82')]()['value']();return db[_0x41bd('0x46')]['find']({'where':{'id':_0x573a11['params']['id']}})[_0x41bd('0x2a')](function(_0x4e2181){return db[_0x41bd('0x6a')][_0x41bd('0x6b')](function(_0x420c43){return _0x4e2181[_0x41bd('0x72')](_0x573a11[_0x41bd('0x35')]['ids'],{'transaction':_0x420c43})[_0x41bd('0x2a')](function(){if(!_[_0x41bd('0x83')](_0x55417c)){return _0x4e2181[_0x41bd('0x84')](_0x55417c,{'transaction':_0x420c43});}})[_0x41bd('0x2a')](function(){_0x55417c[_0x41bd('0x6f')](function(_0x4bb248){socket[_0x41bd('0x70')](_0x41bd('0x85'),{'UserId':_0x4bb248,'WhatsappQueueId':_0x4e2181['id']});});});});});});})[_0x41bd('0x2a')](respondWithStatusCode(_0x18f39a,null))[_0x41bd('0x4d')](handleError(_0x18f39a,null));};exports['addAgents']=function(_0x13ff18,_0x8cc27c,_0x29a9a7){return db[_0x41bd('0x46')][_0x41bd('0x4c')]({'where':{'id':_0x13ff18[_0x41bd('0x57')]['id']}})['then'](handleEntityNotFound(_0x8cc27c,null))['then'](function(_0x5b087b){if(_0x5b087b){return _0x5b087b[_0x41bd('0x86')](_0x13ff18[_0x41bd('0x4f')][_0x41bd('0x65')],_[_0x41bd('0x87')](_0x13ff18['body'],[_0x41bd('0x65'),'id'])||{})[_0x41bd('0x88')](function(_0x1fed59){for(var _0x689b37=0x0;_0x689b37<_0x13ff18['body']['ids']['length'];_0x689b37+=0x1){socket[_0x41bd('0x70')]('userWhatsappQueue:save',{'UserId':Number(_0x13ff18[_0x41bd('0x4f')][_0x41bd('0x65')][_0x689b37]),'WhatsappQueueId':Number(_0x13ff18[_0x41bd('0x57')]['id'])});}return _0x1fed59;});}})[_0x41bd('0x2a')](respondWithResult(_0x8cc27c,null))[_0x41bd('0x4d')](handleError(_0x8cc27c,null));};exports[_0x41bd('0x84')]=function(_0x31df49,_0x59958a,_0x58ba0a){return db[_0x41bd('0x46')][_0x41bd('0x4c')]({'where':{'id':_0x31df49['params']['id']}})[_0x41bd('0x2a')](handleEntityNotFound(_0x59958a,null))['then'](function(_0x56dd42){if(_0x56dd42){return _0x56dd42[_0x41bd('0x84')](_0x31df49['query'][_0x41bd('0x65')])['then'](function(){if(_[_0x41bd('0x89')](_0x31df49[_0x41bd('0x35')][_0x41bd('0x65')])){for(var _0x345a2c=0x0;_0x345a2c<_0x31df49[_0x41bd('0x35')][_0x41bd('0x65')][_0x41bd('0x3b')];_0x345a2c+=0x1){socket['emit'](_0x41bd('0x85'),{'UserId':Number(_0x31df49[_0x41bd('0x35')][_0x41bd('0x65')][_0x345a2c]),'WhatsappQueueId':Number(_0x31df49['params']['id'])});}}else{socket[_0x41bd('0x70')]('userWhatsappQueue:remove',{'UserId':Number(_0x31df49[_0x41bd('0x35')][_0x41bd('0x65')]),'WhatsappQueueId':Number(_0x31df49[_0x41bd('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x59958a,null))[_0x41bd('0x4d')](handleError(_0x59958a,null));};exports[_0x41bd('0x8a')]=function(_0x2c12da,_0x2b0b7c,_0x480ad9){var _0x294e9d={};var _0x47a019={};var _0x55809e;var _0x34cc68;return db[_0x41bd('0x46')][_0x41bd('0x5a')]({'where':{'id':_0x2c12da[_0x41bd('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b0b7c,null))['then'](function(_0x3bbdb4){if(_0x3bbdb4){_0x55809e=_0x3bbdb4;_0x47a019[_0x41bd('0x34')]=_['keys'](db[_0x41bd('0x5d')][_0x41bd('0x4a')]);_0x47a019['query']=_[_0x41bd('0x36')](_0x2c12da[_0x41bd('0x35')]);_0x47a019[_0x41bd('0x37')]=_[_0x41bd('0x38')](_0x47a019[_0x41bd('0x34')],_0x47a019['query']);_0x294e9d[_0x41bd('0x39')]=_[_0x41bd('0x38')](_0x47a019['model'],qs[_0x41bd('0x3a')](_0x2c12da['query'][_0x41bd('0x3a')]));_0x294e9d[_0x41bd('0x39')]=_0x294e9d[_0x41bd('0x39')][_0x41bd('0x3b')]?_0x294e9d[_0x41bd('0x39')]:_0x47a019[_0x41bd('0x34')];_0x294e9d['order']=qs[_0x41bd('0x3f')](_0x2c12da[_0x41bd('0x35')][_0x41bd('0x3f')]);_0x294e9d['where']=qs['filters'](_['pick'](_0x2c12da['query'],_0x47a019['filters']));if(_0x2c12da[_0x41bd('0x35')][_0x41bd('0x41')]){_0x294e9d[_0x41bd('0x42')]=_['merge'](_0x294e9d['where'],{'$or':_['map'](_0x294e9d[_0x41bd('0x39')],function(_0xc507c){var _0x5f2609={};_0x5f2609[_0xc507c]={'$like':'%'+_0x2c12da['query'][_0x41bd('0x41')]+'%'};return _0x5f2609;})});}_0x294e9d=_[_0x41bd('0x43')]({},_0x294e9d,_0x2c12da[_0x41bd('0x4b')]);return _0x55809e['getAgents'](_0x294e9d);}})['then'](function(_0x3baef2){if(_0x3baef2){_0x34cc68=_0x3baef2['length'];if(!_0x2c12da['query'][_0x41bd('0x3c')]('nolimit')){_0x294e9d[_0x41bd('0x22')]=qs['limit'](_0x2c12da[_0x41bd('0x35')][_0x41bd('0x22')]);_0x294e9d[_0x41bd('0x20')]=qs[_0x41bd('0x20')](_0x2c12da[_0x41bd('0x35')][_0x41bd('0x20')]);}return _0x55809e[_0x41bd('0x8a')](_0x294e9d);}})[_0x41bd('0x2a')](function(_0x8d0f95){if(_0x8d0f95){return _0x8d0f95?{'count':_0x34cc68,'rows':_0x8d0f95}:null;}})[_0x41bd('0x2a')](respondWithResult(_0x2b0b7c,null))[_0x41bd('0x4d')](handleError(_0x2b0b7c,null));}; \ No newline at end of file +var _0x70ca=['WhatsappQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','name','send','index','map','type','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','include','WhatsappQueue','findAll','show','params','rawAttributes','merge','options','catch','create','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','createdAt','rows','format','%s/%s','SIP','whatsappPause','getTeams','Team','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x70ca,0x12e));var _0xa70c=function(_0x5b6499,_0x121d1c){_0x5b6499=_0x5b6499-0x0;var _0x2e5b49=_0x70ca[_0x5b6499];return _0x2e5b49;};'use strict';var emlformat=require(_0xa70c('0x0'));var rimraf=require(_0xa70c('0x1'));var zipdir=require(_0xa70c('0x2'));var jsonpatch=require(_0xa70c('0x3'));var rp=require(_0xa70c('0x4'));var moment=require(_0xa70c('0x5'));var BPromise=require(_0xa70c('0x6'));var Mustache=require('mustache');var util=require(_0xa70c('0x7'));var path=require(_0xa70c('0x8'));var sox=require(_0xa70c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa70c('0xa'));var _=require(_0xa70c('0xb'));var squel=require(_0xa70c('0xc'));var crypto=require(_0xa70c('0xd'));var jsforce=require(_0xa70c('0xe'));var deskjs=require(_0xa70c('0xf'));var toCsv=require(_0xa70c('0x10'));var querystring=require(_0xa70c('0x11'));var Papa=require('papaparse');var Redis=require(_0xa70c('0x12'));var authService=require(_0xa70c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa70c('0x14'));var hardwareService=require(_0xa70c('0x15'));var logger=require(_0xa70c('0x16'))(_0xa70c('0x17'));var utils=require('../../config/utils');var config=require(_0xa70c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa70c('0x19'))['db'];config['redis']=_[_0xa70c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa70c('0x1b'))(new Redis(config['redis']));require(_0xa70c('0x1c'))['register'](socket);function respondWithStatusCode(_0x30d4d7,_0x5d5d38){_0x5d5d38=_0x5d5d38||0xcc;return function(_0x508432){if(_0x508432){return _0x30d4d7[_0xa70c('0x1d')](_0x5d5d38);}return _0x30d4d7['status'](_0x5d5d38)[_0xa70c('0x1e')]();};}function respondWithResult(_0x2f639f,_0x274055){_0x274055=_0x274055||0xc8;return function(_0x2579ec){if(_0x2579ec){return _0x2f639f[_0xa70c('0x1f')](_0x274055)['json'](_0x2579ec);}};}function respondWithFilteredResult(_0x517ced,_0x40d877){return function(_0x1361c3){if(_0x1361c3){var _0x35021a=typeof _0x40d877[_0xa70c('0x20')]===_0xa70c('0x21')&&typeof _0x40d877[_0xa70c('0x22')]===_0xa70c('0x21');var _0x57cc6b=_0x1361c3[_0xa70c('0x23')];var _0xd01d74=_0x35021a?0x0:_0x40d877[_0xa70c('0x20')];var _0x5d839d=_0x35021a?_0x1361c3[_0xa70c('0x23')]:_0x40d877[_0xa70c('0x20')]+_0x40d877[_0xa70c('0x22')];var _0x409f80;if(_0x5d839d>=_0x57cc6b){_0x5d839d=_0x57cc6b;_0x409f80=0xc8;}else{_0x409f80=0xce;}_0x517ced[_0xa70c('0x1f')](_0x409f80);return _0x517ced[_0xa70c('0x24')]('Content-Range',_0xd01d74+'-'+_0x5d839d+'/'+_0x57cc6b)[_0xa70c('0x25')](_0x1361c3);}return null;};}function patchUpdates(_0x48dd93){return function(_0x28e2a5){try{jsonpatch[_0xa70c('0x26')](_0x28e2a5,_0x48dd93,!![]);}catch(_0x2693b4){return BPromise[_0xa70c('0x27')](_0x2693b4);}return _0x28e2a5[_0xa70c('0x28')]();};}function saveUpdates(_0x4bfa8c,_0x4d5a6e){return function(_0x35e471){if(_0x35e471){return _0x35e471[_0xa70c('0x29')](_0x4bfa8c)[_0xa70c('0x2a')](function(_0x30bf92){return _0x30bf92;});}return null;};}function removeEntity(_0x42b55e,_0x40e427){return function(_0x41e98f){if(_0x41e98f){return _0x41e98f['destroy']()['then'](function(){var _0x241b4d=_0x41e98f[_0xa70c('0x2b')]({'plain':!![]});var _0x44eb84=_0xa70c('0x2c');return db[_0xa70c('0x2d')][_0xa70c('0x2e')]({'where':{'type':_0x44eb84,'resourceId':_0x241b4d['id']}})[_0xa70c('0x2a')](function(){return _0x41e98f;});})[_0xa70c('0x2a')](function(){_0x42b55e[_0xa70c('0x1f')](0xcc)[_0xa70c('0x1e')]();});}};}function handleEntityNotFound(_0x3b9191,_0xde35e4){return function(_0x37fc57){if(!_0x37fc57){_0x3b9191[_0xa70c('0x1d')](0x194);}return _0x37fc57;};}function handleError(_0x42cd88,_0x451d3a){_0x451d3a=_0x451d3a||0x1f4;return function(_0x341c22){logger[_0xa70c('0x2f')](_0x341c22['stack']);if(_0x341c22[_0xa70c('0x30')]){delete _0x341c22[_0xa70c('0x30')];}_0x42cd88[_0xa70c('0x1f')](_0x451d3a)[_0xa70c('0x31')](_0x341c22);};}exports[_0xa70c('0x32')]=function(_0x3bb6a7,_0x10ac36){var _0x3e5cb3={},_0x15382d={},_0x464ce1={'count':0x0,'rows':[]};var _0x3d309c=_[_0xa70c('0x33')](db['WhatsappQueue']['rawAttributes'],function(_0x3194cb){return{'name':_0x3194cb['fieldName'],'type':_0x3194cb[_0xa70c('0x34')]['key']};});_0x15382d[_0xa70c('0x35')]=_[_0xa70c('0x33')](_0x3d309c,_0xa70c('0x30'));_0x15382d['query']=_[_0xa70c('0x36')](_0x3bb6a7['query']);_0x15382d[_0xa70c('0x37')]=_[_0xa70c('0x38')](_0x15382d[_0xa70c('0x35')],_0x15382d['query']);_0x3e5cb3[_0xa70c('0x39')]=_[_0xa70c('0x38')](_0x15382d[_0xa70c('0x35')],qs['fields'](_0x3bb6a7['query'][_0xa70c('0x3a')]));_0x3e5cb3[_0xa70c('0x39')]=_0x3e5cb3[_0xa70c('0x39')][_0xa70c('0x3b')]?_0x3e5cb3[_0xa70c('0x39')]:_0x15382d[_0xa70c('0x35')];if(!_0x3bb6a7[_0xa70c('0x3c')][_0xa70c('0x3d')]('nolimit')){_0x3e5cb3['limit']=qs[_0xa70c('0x22')](_0x3bb6a7[_0xa70c('0x3c')][_0xa70c('0x22')]);_0x3e5cb3[_0xa70c('0x20')]=qs[_0xa70c('0x20')](_0x3bb6a7[_0xa70c('0x3c')]['offset']);}_0x3e5cb3[_0xa70c('0x3e')]=qs[_0xa70c('0x3f')](_0x3bb6a7[_0xa70c('0x3c')][_0xa70c('0x3f')]);_0x3e5cb3[_0xa70c('0x40')]=qs['filters'](_[_0xa70c('0x41')](_0x3bb6a7[_0xa70c('0x3c')],_0x15382d[_0xa70c('0x37')]),_0x3d309c);if(_0x3bb6a7[_0xa70c('0x3c')]['filter']){_0x3e5cb3[_0xa70c('0x40')]=_['merge'](_0x3e5cb3[_0xa70c('0x40')],{'$or':_[_0xa70c('0x33')](_0x3d309c,function(_0x413862){if(_0x413862['type']!==_0xa70c('0x42')){var _0x4b3bac={};_0x4b3bac[_0x413862[_0xa70c('0x30')]]={'$like':'%'+_0x3bb6a7[_0xa70c('0x3c')][_0xa70c('0x43')]+'%'};return _0x4b3bac;}})});}_0x3e5cb3=_['merge']({},_0x3e5cb3,_0x3bb6a7['options']);var _0x1e6a1f={'where':_0x3e5cb3[_0xa70c('0x40')]};return db['WhatsappQueue'][_0xa70c('0x23')](_0x1e6a1f)[_0xa70c('0x2a')](function(_0x15119){_0x464ce1[_0xa70c('0x23')]=_0x15119;if(_0x3bb6a7[_0xa70c('0x3c')][_0xa70c('0x44')]){_0x3e5cb3[_0xa70c('0x45')]=[{'all':!![]}];}return db[_0xa70c('0x46')][_0xa70c('0x47')](_0x3e5cb3);})['then'](function(_0xf051b1){_0x464ce1['rows']=_0xf051b1;return _0x464ce1;})[_0xa70c('0x2a')](respondWithFilteredResult(_0x10ac36,_0x3e5cb3))['catch'](handleError(_0x10ac36,null));};exports[_0xa70c('0x48')]=function(_0x3aa3a4,_0x334676){var _0x43d976={'raw':!![],'where':{'id':_0x3aa3a4[_0xa70c('0x49')]['id']}},_0x4c5a5a={};_0x4c5a5a[_0xa70c('0x35')]=_[_0xa70c('0x36')](db['WhatsappQueue'][_0xa70c('0x4a')]);_0x4c5a5a[_0xa70c('0x3c')]=_[_0xa70c('0x36')](_0x3aa3a4[_0xa70c('0x3c')]);_0x4c5a5a[_0xa70c('0x37')]=_['intersection'](_0x4c5a5a[_0xa70c('0x35')],_0x4c5a5a[_0xa70c('0x3c')]);_0x43d976[_0xa70c('0x39')]=_[_0xa70c('0x38')](_0x4c5a5a[_0xa70c('0x35')],qs[_0xa70c('0x3a')](_0x3aa3a4[_0xa70c('0x3c')][_0xa70c('0x3a')]));_0x43d976[_0xa70c('0x39')]=_0x43d976['attributes'][_0xa70c('0x3b')]?_0x43d976[_0xa70c('0x39')]:_0x4c5a5a[_0xa70c('0x35')];if(_0x3aa3a4[_0xa70c('0x3c')][_0xa70c('0x44')]){_0x43d976[_0xa70c('0x45')]=[{'all':!![]}];}_0x43d976=_[_0xa70c('0x4b')]({},_0x43d976,_0x3aa3a4[_0xa70c('0x4c')]);return db[_0xa70c('0x46')]['find'](_0x43d976)['then'](handleEntityNotFound(_0x334676,null))[_0xa70c('0x2a')](respondWithResult(_0x334676,null))[_0xa70c('0x4d')](handleError(_0x334676,null));};exports[_0xa70c('0x4e')]=function(_0x4f48fc,_0xf42e64){return db['WhatsappQueue'][_0xa70c('0x4e')](_0x4f48fc['body'],{})[_0xa70c('0x2a')](function(_0x1d3f0e){var _0x2cb728=_0x4f48fc[_0xa70c('0x4f')]['get']({'plain':!![]});if(!_0x2cb728)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cb728[_0xa70c('0x50')]===_0xa70c('0x4f')){var _0x11148d=_0x1d3f0e[_0xa70c('0x2b')]({'plain':!![]});var _0x1e15df=_0xa70c('0x2c');return db[_0xa70c('0x51')][_0xa70c('0x52')]({'where':{'name':_0x1e15df,'userProfileId':_0x2cb728['userProfileId']},'raw':!![]})['then'](function(_0x1f5c77){if(_0x1f5c77&&_0x1f5c77[_0xa70c('0x53')]===0x0){return db[_0xa70c('0x2d')][_0xa70c('0x4e')]({'name':_0x11148d[_0xa70c('0x30')],'resourceId':_0x11148d['id'],'type':_0x1f5c77['name'],'sectionId':_0x1f5c77['id']},{})[_0xa70c('0x2a')](function(){return _0x1d3f0e;});}else{return _0x1d3f0e;}})['catch'](function(_0x3071df){logger[_0xa70c('0x2f')](_0xa70c('0x54'),_0x3071df);throw _0x3071df;});}return _0x1d3f0e;})[_0xa70c('0x2a')](respondWithResult(_0xf42e64,0xc9))[_0xa70c('0x4d')](handleError(_0xf42e64,null));};exports[_0xa70c('0x29')]=function(_0x22b752,_0x633974){if(_0x22b752[_0xa70c('0x55')]['id']){delete _0x22b752[_0xa70c('0x55')]['id'];}return db[_0xa70c('0x46')][_0xa70c('0x52')]({'where':{'id':_0x22b752['params']['id']}})[_0xa70c('0x2a')](handleEntityNotFound(_0x633974,null))[_0xa70c('0x2a')](saveUpdates(_0x22b752[_0xa70c('0x55')],null))[_0xa70c('0x2a')](respondWithResult(_0x633974,null))[_0xa70c('0x4d')](handleError(_0x633974,null));};exports[_0xa70c('0x2e')]=function(_0x57037e,_0x24563f){return db[_0xa70c('0x46')][_0xa70c('0x52')]({'where':{'id':_0x57037e[_0xa70c('0x49')]['id']}})['then'](handleEntityNotFound(_0x24563f,null))[_0xa70c('0x2a')](removeEntity(_0x24563f,null))['catch'](handleError(_0x24563f,null));};exports[_0xa70c('0x56')]=function(_0x3c2805,_0x50b656){return db[_0xa70c('0x46')][_0xa70c('0x56')]()[_0xa70c('0x2a')](respondWithResult(_0x50b656,null))[_0xa70c('0x4d')](handleError(_0x50b656,null));};exports['getMembers']=function(_0x810284,_0x3ce678,_0x56f3ed){var _0x306f34={'raw':!![],'where':{}},_0x127a20={},_0x14d03;return db[_0xa70c('0x46')][_0xa70c('0x57')]({'where':{'id':_0x810284[_0xa70c('0x49')]['id']}})[_0xa70c('0x2a')](handleEntityNotFound(_0x3ce678,null))[_0xa70c('0x2a')](function(_0x5f3ce6){if(_0x5f3ce6){_0x14d03=_0x5f3ce6[_0xa70c('0x2b')]({'plain':!![]});_0x127a20[_0xa70c('0x35')]=_[_0xa70c('0x36')](db['UserWhatsappQueue'][_0xa70c('0x4a')]);_0x127a20['query']=_[_0xa70c('0x36')](_0x810284[_0xa70c('0x3c')]);_0x127a20[_0xa70c('0x37')]=_['intersection'](_0x127a20[_0xa70c('0x35')],_0x127a20[_0xa70c('0x3c')]);_0x306f34['attributes']=_[_0xa70c('0x38')](_0x127a20[_0xa70c('0x35')],qs[_0xa70c('0x3a')](_0x810284[_0xa70c('0x3c')]['fields']));_0x306f34['attributes']=_0x306f34['attributes'][_0xa70c('0x3b')]?_0x306f34[_0xa70c('0x39')]:_0x127a20[_0xa70c('0x35')];if(!_0x810284['query'][_0xa70c('0x3d')]('nolimit')){_0x306f34['limit']=qs[_0xa70c('0x22')](_0x810284['query'][_0xa70c('0x22')]);_0x306f34[_0xa70c('0x20')]=qs[_0xa70c('0x20')](_0x810284['query'][_0xa70c('0x20')]);}_0x306f34[_0xa70c('0x3e')]=qs[_0xa70c('0x3f')](_0x810284[_0xa70c('0x3c')][_0xa70c('0x3f')]);_0x306f34['where']=qs[_0xa70c('0x37')](_[_0xa70c('0x41')](_0x810284[_0xa70c('0x3c')],_0x127a20['filters']));_0x306f34[_0xa70c('0x40')][_0xa70c('0x58')]=_0x5f3ce6['id'];if(_0x810284['query']['filter']){_0x306f34[_0xa70c('0x40')]=_[_0xa70c('0x4b')](_0x306f34['where'],{'$or':_[_0xa70c('0x33')](_0x306f34[_0xa70c('0x39')],function(_0x239a23){var _0x49d94c={};_0x49d94c[_0x239a23]={'$like':'%'+_0x810284['query'][_0xa70c('0x43')]+'%'};return _0x49d94c;})});}_0x306f34=_[_0xa70c('0x4b')]({},_0x306f34,_0x810284[_0xa70c('0x4c')]);return db[_0xa70c('0x59')]['findAll'](_0x306f34);}})['then'](function(_0x2866dc){if(_0x2866dc){return db['User'][_0xa70c('0x5a')]({'where':{'id':_[_0xa70c('0x33')](_0x2866dc,_0xa70c('0x5b')),'role':'agent'},'attributes':['id',_0xa70c('0x30'),'whatsappPause','updatedAt',_0xa70c('0x5c')]});}})[_0xa70c('0x2a')](function(_0x33eab4){if(_0x33eab4){return{'count':_0x33eab4[_0xa70c('0x23')],'rows':_[_0xa70c('0x33')](_0x33eab4[_0xa70c('0x5d')],function(_0x47f240){return{'membername':_0x47f240[_0xa70c('0x30')],'UserId':_0x47f240['id'],'queue_name':_0x14d03[_0xa70c('0x30')],'WhatsappQueueId':_0x14d03['id'],'interface':util[_0xa70c('0x5e')](_0xa70c('0x5f'),_0xa70c('0x60'),_0x47f240['name']),'penalty':0x0,'paused':_0x47f240[_0xa70c('0x61')],'createdAt':_0x47f240[_0xa70c('0x5c')],'updatedAt':_0x47f240['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa70c('0x2a')](respondWithFilteredResult(_0x3ce678,_0x306f34))[_0xa70c('0x4d')](handleError(_0x3ce678,null));};exports[_0xa70c('0x62')]=function(_0x18dfc6,_0xe596f0,_0xf8248e){var _0x280f3a={};var _0x5ea881={};var _0xa30095;var _0x17e225;return db[_0xa70c('0x46')][_0xa70c('0x57')]({'where':{'id':_0x18dfc6[_0xa70c('0x49')]['id']}})[_0xa70c('0x2a')](handleEntityNotFound(_0xe596f0,null))[_0xa70c('0x2a')](function(_0x54a25d){if(_0x54a25d){_0xa30095=_0x54a25d;_0x5ea881[_0xa70c('0x35')]=_['keys'](db[_0xa70c('0x63')][_0xa70c('0x4a')]);_0x5ea881[_0xa70c('0x3c')]=_[_0xa70c('0x36')](_0x18dfc6[_0xa70c('0x3c')]);_0x5ea881[_0xa70c('0x37')]=_['intersection'](_0x5ea881[_0xa70c('0x35')],_0x5ea881[_0xa70c('0x3c')]);_0x280f3a[_0xa70c('0x39')]=_[_0xa70c('0x38')](_0x5ea881[_0xa70c('0x35')],qs[_0xa70c('0x3a')](_0x18dfc6[_0xa70c('0x3c')][_0xa70c('0x3a')]));_0x280f3a[_0xa70c('0x39')]=_0x280f3a[_0xa70c('0x39')][_0xa70c('0x3b')]?_0x280f3a[_0xa70c('0x39')]:_0x5ea881['model'];_0x280f3a[_0xa70c('0x3e')]=qs['sort'](_0x18dfc6[_0xa70c('0x3c')][_0xa70c('0x3f')]);_0x280f3a[_0xa70c('0x40')]=qs[_0xa70c('0x37')](_[_0xa70c('0x41')](_0x18dfc6[_0xa70c('0x3c')],_0x5ea881[_0xa70c('0x37')]));if(_0x18dfc6[_0xa70c('0x3c')][_0xa70c('0x43')]){_0x280f3a[_0xa70c('0x40')]=_[_0xa70c('0x4b')](_0x280f3a[_0xa70c('0x40')],{'$or':_[_0xa70c('0x33')](_0x280f3a[_0xa70c('0x39')],function(_0x15af9f){var _0x57c643={};_0x57c643[_0x15af9f]={'$like':'%'+_0x18dfc6[_0xa70c('0x3c')][_0xa70c('0x43')]+'%'};return _0x57c643;})});}_0x280f3a=_['merge']({},_0x280f3a,_0x18dfc6['options']);return _0xa30095[_0xa70c('0x62')](_0x280f3a);}})[_0xa70c('0x2a')](function(_0x1b5e8e){if(_0x1b5e8e){_0x17e225=_0x1b5e8e[_0xa70c('0x3b')];if(!_0x18dfc6[_0xa70c('0x3c')][_0xa70c('0x3d')](_0xa70c('0x64'))){_0x280f3a[_0xa70c('0x22')]=qs[_0xa70c('0x22')](_0x18dfc6[_0xa70c('0x3c')][_0xa70c('0x22')]);_0x280f3a[_0xa70c('0x20')]=qs[_0xa70c('0x20')](_0x18dfc6[_0xa70c('0x3c')]['offset']);}return _0xa30095[_0xa70c('0x62')](_0x280f3a);}})['then'](function(_0x4f7e57){if(_0x4f7e57){return _0x4f7e57?{'count':_0x17e225,'rows':_0x4f7e57}:null;}})[_0xa70c('0x2a')](respondWithResult(_0xe596f0,null))[_0xa70c('0x4d')](handleError(_0xe596f0,null));};exports[_0xa70c('0x65')]=function(_0x17ef04,_0x23391f,_0x46585c){var _0x5b4efa=_0x17ef04[_0xa70c('0x55')]['ids'];return db[_0xa70c('0x63')][_0xa70c('0x47')]({'where':{'id':_0x5b4efa},'attributes':['id'],'include':[{'model':db[_0xa70c('0x66')],'as':_0xa70c('0x67'),'attributes':['id',_0xa70c('0x30'),_0xa70c('0x68'),_0xa70c('0x69'),_0xa70c('0x6a')],'raw':!![]}]})[_0xa70c('0x2a')](function(_0x1d39d0){if(_0x1d39d0){var _0x12deef=_[_0xa70c('0x6b')](_0x1d39d0,function(_0x35c599){var _0x1efffc=_0x35c599[_0xa70c('0x2b')]({'plain':!![]});return _0x1efffc['Agents'];});return db[_0xa70c('0x46')][_0xa70c('0x52')]({'where':{'id':_0x17ef04[_0xa70c('0x49')]['id']}})[_0xa70c('0x2a')](function(_0x38eb43){return db['sequelize']['transaction'](function(_0x1ef1b7){return _0x38eb43[_0xa70c('0x65')](_0x5b4efa,{'transaction':_0x1ef1b7})['then'](function(){return BPromise[_0xa70c('0x6c')](_0x12deef,function(_0x3df487){return db[_0xa70c('0x59')][_0xa70c('0x6d')]({'where':{'UserId':_0x3df487['id'],'WhatsappQueueId':_0x17ef04[_0xa70c('0x49')]['id']},'transaction':_0x1ef1b7});});})[_0xa70c('0x2a')](function(){_0x12deef[_0xa70c('0x6e')](function(_0x3dc9b4){socket[_0xa70c('0x6f')](_0xa70c('0x70'),{'UserId':_0x3dc9b4['id'],'WhatsappQueueId':_0x38eb43['id']});});});});});}})[_0xa70c('0x2a')](respondWithStatusCode(_0x23391f,null))['catch'](handleError(_0x23391f,null));};exports[_0xa70c('0x71')]=function(_0x15cbfd,_0x3eb46c,_0x364640){return db[_0xa70c('0x63')]['findAll']({'where':{'id':_0x15cbfd[_0xa70c('0x3c')][_0xa70c('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa70c('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3eb46c,null))[_0xa70c('0x2a')](function(_0x55c591){var _0x1c0f7f=_[_0xa70c('0x33')](_0x55c591,'id');var _0x283627=[];var _0x6d69f5=[];var _0x11ae86=squel[_0xa70c('0x73')]();_0x11ae86[_0xa70c('0x74')]('tq.TeamId')['from'](_0xa70c('0x75'),'tq')[_0xa70c('0x76')](_0xa70c('0x77'),'ut',_0xa70c('0x78'))[_0xa70c('0x40')](_0xa70c('0x79'),_0x15cbfd[_0xa70c('0x49')]['id']);for(var _0x22e119=0x0;_0x22e119<_0x55c591['length'];_0x22e119+=0x1){let _0x4ad1bb=_0x55c591[_0x22e119];for(var _0x3ca96e=0x0;_0x3ca96e<_0x4ad1bb[_0xa70c('0x67')][_0xa70c('0x3b')];_0x3ca96e+=0x1){let _0x26ce36=_0x4ad1bb[_0xa70c('0x67')][_0x3ca96e];var _0x176278=_0x11ae86['clone']();_0x176278[_0xa70c('0x40')]('ut.UserId\x20=\x20?',_0x26ce36['id']);_0x6d69f5[_0xa70c('0x7a')](db[_0xa70c('0x7b')][_0xa70c('0x3c')](_0x176278[_0xa70c('0x7c')](),{'type':db[_0xa70c('0x7b')][_0xa70c('0x7d')][_0xa70c('0x7e')]})[_0xa70c('0x2a')](function(_0x3b4714){if(_0x3b4714['length']===0x1){return _0x26ce36['id'];}else{var _0x161364=_[_0xa70c('0x7f')](_[_0xa70c('0x33')](_0x3b4714,'TeamId'),function(_0x180a6a){return _[_0xa70c('0x80')](_0x1c0f7f,_0x180a6a);});if(_0x161364){return _0x26ce36['id'];}}}));}}return BPromise[_0xa70c('0x81')](_0x6d69f5)[_0xa70c('0x2a')](function(_0x1a4b0f){_0x283627=_(_0x283627)[_0xa70c('0x82')](_0x1a4b0f)[_0xa70c('0x83')]()[_0xa70c('0x84')]();return db['WhatsappQueue'][_0xa70c('0x52')]({'where':{'id':_0x15cbfd[_0xa70c('0x49')]['id']}})['then'](function(_0x441727){return db[_0xa70c('0x7b')][_0xa70c('0x85')](function(_0x5059aa){return _0x441727[_0xa70c('0x71')](_0x15cbfd[_0xa70c('0x3c')][_0xa70c('0x72')],{'transaction':_0x5059aa})['then'](function(){if(!_[_0xa70c('0x86')](_0x283627)){return _0x441727[_0xa70c('0x87')](_0x283627,{'transaction':_0x5059aa});}})[_0xa70c('0x2a')](function(){_0x283627['forEach'](function(_0x440c0e){socket[_0xa70c('0x6f')](_0xa70c('0x88'),{'UserId':_0x440c0e,'WhatsappQueueId':_0x441727['id']});});});});});});})[_0xa70c('0x2a')](respondWithStatusCode(_0x3eb46c,null))[_0xa70c('0x4d')](handleError(_0x3eb46c,null));};exports[_0xa70c('0x89')]=function(_0x42707e,_0x5ee188,_0x4e7f49){return db['WhatsappQueue'][_0xa70c('0x52')]({'where':{'id':_0x42707e[_0xa70c('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ee188,null))[_0xa70c('0x2a')](function(_0x45c8ef){if(_0x45c8ef){return _0x45c8ef[_0xa70c('0x89')](_0x42707e[_0xa70c('0x55')][_0xa70c('0x72')],_['omit'](_0x42707e['body'],[_0xa70c('0x72'),'id'])||{})[_0xa70c('0x8a')](function(_0x14d4fd){for(var _0x4f82ce=0x0;_0x4f82ce<_0x42707e['body']['ids'][_0xa70c('0x3b')];_0x4f82ce+=0x1){socket[_0xa70c('0x6f')](_0xa70c('0x70'),{'UserId':Number(_0x42707e[_0xa70c('0x55')][_0xa70c('0x72')][_0x4f82ce]),'WhatsappQueueId':Number(_0x42707e['params']['id'])});}return _0x14d4fd;});}})['then'](respondWithResult(_0x5ee188,null))[_0xa70c('0x4d')](handleError(_0x5ee188,null));};exports[_0xa70c('0x87')]=function(_0x36994d,_0x1bd58e,_0x14b3cd){return db['WhatsappQueue'][_0xa70c('0x52')]({'where':{'id':_0x36994d[_0xa70c('0x49')]['id']}})[_0xa70c('0x2a')](handleEntityNotFound(_0x1bd58e,null))[_0xa70c('0x2a')](function(_0x585078){if(_0x585078){return _0x585078[_0xa70c('0x87')](_0x36994d[_0xa70c('0x3c')][_0xa70c('0x72')])['then'](function(){if(_[_0xa70c('0x8b')](_0x36994d[_0xa70c('0x3c')][_0xa70c('0x72')])){for(var _0x39656a=0x0;_0x39656a<_0x36994d['query'][_0xa70c('0x72')][_0xa70c('0x3b')];_0x39656a+=0x1){socket[_0xa70c('0x6f')](_0xa70c('0x88'),{'UserId':Number(_0x36994d[_0xa70c('0x3c')][_0xa70c('0x72')][_0x39656a]),'WhatsappQueueId':Number(_0x36994d[_0xa70c('0x49')]['id'])});}}else{socket[_0xa70c('0x6f')](_0xa70c('0x88'),{'UserId':Number(_0x36994d[_0xa70c('0x3c')][_0xa70c('0x72')]),'WhatsappQueueId':Number(_0x36994d[_0xa70c('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bd58e,null))[_0xa70c('0x4d')](handleError(_0x1bd58e,null));};exports[_0xa70c('0x8c')]=function(_0xfe81b4,_0x3448c0,_0x36276b){var _0x15b2d3={};var _0xc4b088={};var _0x5dbfe3;var _0x1ace35;return db[_0xa70c('0x46')][_0xa70c('0x57')]({'where':{'id':_0xfe81b4[_0xa70c('0x49')]['id']}})[_0xa70c('0x2a')](handleEntityNotFound(_0x3448c0,null))[_0xa70c('0x2a')](function(_0x46fef6){if(_0x46fef6){_0x5dbfe3=_0x46fef6;_0xc4b088[_0xa70c('0x35')]=_[_0xa70c('0x36')](db[_0xa70c('0x66')]['rawAttributes']);_0xc4b088[_0xa70c('0x3c')]=_[_0xa70c('0x36')](_0xfe81b4[_0xa70c('0x3c')]);_0xc4b088[_0xa70c('0x37')]=_[_0xa70c('0x38')](_0xc4b088[_0xa70c('0x35')],_0xc4b088[_0xa70c('0x3c')]);_0x15b2d3[_0xa70c('0x39')]=_[_0xa70c('0x38')](_0xc4b088[_0xa70c('0x35')],qs[_0xa70c('0x3a')](_0xfe81b4[_0xa70c('0x3c')][_0xa70c('0x3a')]));_0x15b2d3['attributes']=_0x15b2d3[_0xa70c('0x39')][_0xa70c('0x3b')]?_0x15b2d3[_0xa70c('0x39')]:_0xc4b088[_0xa70c('0x35')];_0x15b2d3[_0xa70c('0x3e')]=qs[_0xa70c('0x3f')](_0xfe81b4['query']['sort']);_0x15b2d3['where']=qs[_0xa70c('0x37')](_[_0xa70c('0x41')](_0xfe81b4['query'],_0xc4b088[_0xa70c('0x37')]));if(_0xfe81b4[_0xa70c('0x3c')][_0xa70c('0x43')]){_0x15b2d3[_0xa70c('0x40')]=_[_0xa70c('0x4b')](_0x15b2d3[_0xa70c('0x40')],{'$or':_[_0xa70c('0x33')](_0x15b2d3[_0xa70c('0x39')],function(_0x4e1f44){var _0x52f3c6={};_0x52f3c6[_0x4e1f44]={'$like':'%'+_0xfe81b4[_0xa70c('0x3c')]['filter']+'%'};return _0x52f3c6;})});}_0x15b2d3=_['merge']({},_0x15b2d3,_0xfe81b4[_0xa70c('0x4c')]);return _0x5dbfe3['getAgents'](_0x15b2d3);}})[_0xa70c('0x2a')](function(_0x271087){if(_0x271087){_0x1ace35=_0x271087['length'];if(!_0xfe81b4[_0xa70c('0x3c')]['hasOwnProperty'](_0xa70c('0x64'))){_0x15b2d3['limit']=qs[_0xa70c('0x22')](_0xfe81b4[_0xa70c('0x3c')]['limit']);_0x15b2d3[_0xa70c('0x20')]=qs['offset'](_0xfe81b4[_0xa70c('0x3c')][_0xa70c('0x20')]);}return _0x5dbfe3['getAgents'](_0x15b2d3);}})[_0xa70c('0x2a')](function(_0x21aae8){if(_0x21aae8){return _0x21aae8?{'count':_0x1ace35,'rows':_0x21aae8}:null;}})['then'](respondWithResult(_0x3448c0,null))[_0xa70c('0x4d')](handleError(_0x3448c0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b184767..fbc00c4 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 _0xa1ad=['WhatsappQueue','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa1ad,0xca));var _0xda1a=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xa1ad[_0x33bc64];return _0x3fdd34;};'use strict';var EventEmitter=require(_0xda1a('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xda1a('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xda1a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xda1a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1a97ef){return function(_0x52ad38,_0x22de2d,_0x252030){WhatsappQueueEvents[_0xda1a('0x4')](_0x1a97ef+':'+_0x52ad38['id'],_0x52ad38);WhatsappQueueEvents['emit'](_0x1a97ef,_0x52ad38);_0x252030(null);};}for(var e in events){if(events[_0xda1a('0x5')](e)){var event=events[e];WhatsappQueue[_0xda1a('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x241f=['../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hook','events'];(function(_0x4d7705,_0x5f3da8){var _0x4e0f51=function(_0x4b6a31){while(--_0x4b6a31){_0x4d7705['push'](_0x4d7705['shift']());}};_0x4e0f51(++_0x5f3da8);}(_0x241f,0x17f));var _0xf241=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0x241f[_0x4d45c1];return _0x244478;};'use strict';var EventEmitter=require(_0xf241('0x0'));var WhatsappQueue=require(_0xf241('0x1'))['db'][_0xf241('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf241('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf241('0x4'),'afterDestroy':_0xf241('0x5')};function emitEvent(_0x3141e0){return function(_0x1b7e39,_0x140582,_0x57ca78){WhatsappQueueEvents[_0xf241('0x6')](_0x3141e0+':'+_0x1b7e39['id'],_0x1b7e39);WhatsappQueueEvents[_0xf241('0x6')](_0x3141e0,_0x1b7e39);_0x57ca78(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xf241('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 5d367e3..df6e508 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 _0xff53=['moment','path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xff53,0x166));var _0x3ff5=function(_0x8761aa,_0x3a4e9d){_0x8761aa=_0x8761aa-0x0;var _0x246b93=_0xff53[_0x8761aa];return _0x246b93;};'use strict';var _=require(_0x3ff5('0x0'));var util=require(_0x3ff5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3ff5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ff5('0x3'));var rimraf=require(_0x3ff5('0x4'));var config=require(_0x3ff5('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x3ff5('0x6')]=function(_0x82ea7,_0x47d8b5){return _0x82ea7[_0x3ff5('0x7')](_0x3ff5('0x8'),attributes,{'tableName':_0x3ff5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22a6=['../../config/environment','exports','WhatsappQueue','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2647dc,_0x5e9a75){var _0x4f7e3e=function(_0x1af0c0){while(--_0x1af0c0){_0x2647dc['push'](_0x2647dc['shift']());}};_0x4f7e3e(++_0x5e9a75);}(_0x22a6,0xe3));var _0x622a=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0x22a6[_0x2a4095];return _0x52eeab;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x622a('0x0'))(_0x622a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x622a('0x2'));var fs=require('fs');var path=require(_0x622a('0x3'));var rimraf=require(_0x622a('0x4'));var config=require(_0x622a('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x622a('0x6')]=function(_0x25e91f,_0xc7a7d3){return _0x25e91f['define'](_0x622a('0x7'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 51ba189..f0b2009 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 _0xdfc2=['where','include','map','model','attributes','stringify','catch','ShowWhatsappQueue','find','lodash','util','moment','bluebird','ioredis','../../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','debug','error','code','message','result','GetWhatsappQueue','WhatsappQueue','options','raw'];(function(_0x47cc74,_0x4598df){var _0xdfe813=function(_0x291ca6){while(--_0x291ca6){_0x47cc74['push'](_0x47cc74['shift']());}};_0xdfe813(++_0x4598df);}(_0xdfc2,0xb1));var _0x2dfc=function(_0x372346,_0x1806ef){_0x372346=_0x372346-0x0;var _0x417bd9=_0xdfc2[_0x372346];return _0x417bd9;};'use strict';var _=require(_0x2dfc('0x0'));var util=require(_0x2dfc('0x1'));var moment=require(_0x2dfc('0x2'));var BPromise=require(_0x2dfc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2dfc('0x4'));var db=require(_0x2dfc('0x5'))['db'];var utils=require(_0x2dfc('0x6'));var logger=require(_0x2dfc('0x7'))(_0x2dfc('0x8'));var config=require(_0x2dfc('0x9'));var jayson=require(_0x2dfc('0xa'));var client=jayson[_0x2dfc('0xb')][_0x2dfc('0xc')]({'port':0x232a});config[_0x2dfc('0xd')]=_[_0x2dfc('0xe')](config[_0x2dfc('0xd')],{'host':_0x2dfc('0xf'),'port':0x18eb});var socket=require(_0x2dfc('0x10'))(new Redis(config[_0x2dfc('0xd')]));require(_0x2dfc('0x11'))[_0x2dfc('0x12')](socket);function respondWithRpcPromise(_0x5be726,_0x19c347,_0x47cb76){return new BPromise(function(_0x13a7b2,_0x500846){return client[_0x2dfc('0x13')](_0x5be726,_0x47cb76)[_0x2dfc('0x14')](function(_0x3fec70){logger[_0x2dfc('0x15')](_0x2dfc('0x16'),_0x19c347,_0x2dfc('0x17'));logger[_0x2dfc('0x18')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x19c347,_0x2dfc('0x17'),JSON['stringify'](_0x3fec70));if(_0x3fec70['error']){if(_0x3fec70[_0x2dfc('0x19')][_0x2dfc('0x1a')]===0x1f4){logger[_0x2dfc('0x19')](_0x2dfc('0x16'),_0x19c347,_0x3fec70[_0x2dfc('0x19')][_0x2dfc('0x1b')]);return _0x500846(_0x3fec70[_0x2dfc('0x19')][_0x2dfc('0x1b')]);}logger[_0x2dfc('0x19')](_0x2dfc('0x16'),_0x19c347,_0x3fec70[_0x2dfc('0x19')][_0x2dfc('0x1b')]);return _0x13a7b2(_0x3fec70['error'][_0x2dfc('0x1b')]);}else{logger[_0x2dfc('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x19c347,_0x2dfc('0x17'));_0x13a7b2(_0x3fec70[_0x2dfc('0x1c')][_0x2dfc('0x1b')]);}})['catch'](function(_0x8f3625){logger['error'](_0x2dfc('0x16'),_0x19c347,_0x8f3625);_0x500846(_0x8f3625);});});}exports[_0x2dfc('0x1d')]=function(_0x11006b){var _0x36e386=this;return new Promise(function(_0x4a74db,_0x51a3ea){return db[_0x2dfc('0x1e')]['findAll']({'raw':_0x11006b[_0x2dfc('0x1f')]?_0x11006b[_0x2dfc('0x1f')][_0x2dfc('0x20')]===undefined?!![]:![]:!![],'where':_0x11006b[_0x2dfc('0x1f')]?_0x11006b[_0x2dfc('0x1f')][_0x2dfc('0x21')]||null:null,'attributes':_0x11006b[_0x2dfc('0x1f')]?_0x11006b['options']['attributes']||null:null,'limit':_0x11006b[_0x2dfc('0x1f')]?_0x11006b['options']['limit']||null:null,'include':_0x11006b[_0x2dfc('0x1f')]?_0x11006b[_0x2dfc('0x1f')][_0x2dfc('0x22')]?_[_0x2dfc('0x23')](_0x11006b['options']['include'],function(_0x4d957){return{'model':db[_0x4d957[_0x2dfc('0x24')]],'as':_0x4d957['as'],'attributes':_0x4d957['attributes'],'include':_0x4d957[_0x2dfc('0x22')]?_['map'](_0x4d957['include'],function(_0x5e6ab6){return{'model':db[_0x5e6ab6['model']],'as':_0x5e6ab6['as'],'attributes':_0x5e6ab6[_0x2dfc('0x25')],'include':_0x5e6ab6['include']?_[_0x2dfc('0x23')](_0x5e6ab6['include'],function(_0x4c8fa1){return{'model':db[_0x4c8fa1[_0x2dfc('0x24')]],'as':_0x4c8fa1['as'],'attributes':_0x4c8fa1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2dfc('0x14')](function(_0x3d30da){logger[_0x2dfc('0x15')](_0x2dfc('0x1d'),_0x11006b);logger[_0x2dfc('0x18')](_0x2dfc('0x1d'),_0x11006b,JSON[_0x2dfc('0x26')](_0x3d30da));_0x4a74db(_0x3d30da);})[_0x2dfc('0x27')](function(_0x3e84c7){logger[_0x2dfc('0x19')](_0x2dfc('0x1d'),_0x3e84c7[_0x2dfc('0x1b')],_0x11006b);_0x51a3ea(_0x36e386[_0x2dfc('0x19')](0x1f4,_0x3e84c7[_0x2dfc('0x1b')]));});});};exports[_0x2dfc('0x28')]=function(_0x1562a2){var _0x39b724=this;return new Promise(function(_0x390291,_0x364397){return db[_0x2dfc('0x1e')][_0x2dfc('0x29')]({'raw':_0x1562a2['options']?_0x1562a2[_0x2dfc('0x1f')][_0x2dfc('0x20')]===undefined?!![]:![]:!![],'where':_0x1562a2[_0x2dfc('0x1f')]?_0x1562a2[_0x2dfc('0x1f')]['where']||null:null,'attributes':_0x1562a2[_0x2dfc('0x1f')]?_0x1562a2[_0x2dfc('0x1f')][_0x2dfc('0x25')]||null:null,'include':_0x1562a2[_0x2dfc('0x1f')]?_0x1562a2[_0x2dfc('0x1f')][_0x2dfc('0x22')]?_[_0x2dfc('0x23')](_0x1562a2['options'][_0x2dfc('0x22')],function(_0x5a9f7e){return{'model':db[_0x5a9f7e[_0x2dfc('0x24')]],'as':_0x5a9f7e['as'],'attributes':_0x5a9f7e['attributes'],'include':_0x5a9f7e[_0x2dfc('0x22')]?_[_0x2dfc('0x23')](_0x5a9f7e[_0x2dfc('0x22')],function(_0x2a14d5){return{'model':db[_0x2a14d5[_0x2dfc('0x24')]],'as':_0x2a14d5['as'],'attributes':_0x2a14d5[_0x2dfc('0x25')],'include':_0x2a14d5[_0x2dfc('0x22')]?_[_0x2dfc('0x23')](_0x2a14d5[_0x2dfc('0x22')],function(_0xa3a895){return{'model':db[_0xa3a895[_0x2dfc('0x24')]],'as':_0xa3a895['as'],'attributes':_0xa3a895[_0x2dfc('0x25')]};}):[]};}):[]};}):[]:[]})[_0x2dfc('0x14')](function(_0xa4c1dc){logger[_0x2dfc('0x15')]('ShowWhatsappQueue',_0x1562a2);logger[_0x2dfc('0x18')]('ShowWhatsappQueue',_0x1562a2,JSON[_0x2dfc('0x26')](_0xa4c1dc));_0x390291(_0xa4c1dc);})[_0x2dfc('0x27')](function(_0x33cf83){logger[_0x2dfc('0x19')](_0x2dfc('0x28'),_0x33cf83[_0x2dfc('0x1b')],_0x1562a2);_0x364397(_0x39b724[_0x2dfc('0x19')](0x1f4,_0x33cf83['message']));});});}; \ No newline at end of file +var _0xfb04=['lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','include','map','model','debug','ShowWhatsappQueue','find','raw','then'];(function(_0xe6f29d,_0x26c220){var _0x19d116=function(_0xb2c9dc){while(--_0xb2c9dc){_0xe6f29d['push'](_0xe6f29d['shift']());}};_0x19d116(++_0x26c220);}(_0xfb04,0x197));var _0x4fb0=function(_0x4080e5,_0x4bf5e3){_0x4080e5=_0x4080e5-0x0;var _0x3f6564=_0xfb04[_0x4080e5];return _0x3f6564;};'use strict';var _=require(_0x4fb0('0x0'));var util=require(_0x4fb0('0x1'));var moment=require('moment');var BPromise=require(_0x4fb0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4fb0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fb0('0x4'));var logger=require('../../config/logger')(_0x4fb0('0x5'));var config=require(_0x4fb0('0x6'));var jayson=require(_0x4fb0('0x7'));var client=jayson[_0x4fb0('0x8')][_0x4fb0('0x9')]({'port':0x232a});config[_0x4fb0('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4fb0('0xb'))[_0x4fb0('0xc')](socket);function respondWithRpcPromise(_0x502fdb,_0xee74ba,_0x1b4fb6){return new BPromise(function(_0x519118,_0xd844d7){return client[_0x4fb0('0xd')](_0x502fdb,_0x1b4fb6)['then'](function(_0x1b6c8){logger[_0x4fb0('0xe')](_0x4fb0('0xf'),_0xee74ba,_0x4fb0('0x10'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0xee74ba,_0x4fb0('0x10'),JSON[_0x4fb0('0x11')](_0x1b6c8));if(_0x1b6c8[_0x4fb0('0x12')]){if(_0x1b6c8[_0x4fb0('0x12')][_0x4fb0('0x13')]===0x1f4){logger[_0x4fb0('0x12')](_0x4fb0('0xf'),_0xee74ba,_0x1b6c8[_0x4fb0('0x12')][_0x4fb0('0x14')]);return _0xd844d7(_0x1b6c8[_0x4fb0('0x12')][_0x4fb0('0x14')]);}logger[_0x4fb0('0x12')](_0x4fb0('0xf'),_0xee74ba,_0x1b6c8[_0x4fb0('0x12')][_0x4fb0('0x14')]);return _0x519118(_0x1b6c8[_0x4fb0('0x12')][_0x4fb0('0x14')]);}else{logger[_0x4fb0('0xe')](_0x4fb0('0xf'),_0xee74ba,_0x4fb0('0x10'));_0x519118(_0x1b6c8[_0x4fb0('0x15')][_0x4fb0('0x14')]);}})[_0x4fb0('0x16')](function(_0x450b67){logger[_0x4fb0('0x12')](_0x4fb0('0xf'),_0xee74ba,_0x450b67);_0xd844d7(_0x450b67);});});}exports[_0x4fb0('0x17')]=function(_0x1d8223){var _0x45c77a=this;return new Promise(function(_0x326685,_0x5117d6){return db[_0x4fb0('0x18')][_0x4fb0('0x19')]({'raw':_0x1d8223[_0x4fb0('0x1a')]?_0x1d8223[_0x4fb0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1d8223[_0x4fb0('0x1a')]?_0x1d8223[_0x4fb0('0x1a')][_0x4fb0('0x1b')]||null:null,'attributes':_0x1d8223['options']?_0x1d8223[_0x4fb0('0x1a')][_0x4fb0('0x1c')]||null:null,'limit':_0x1d8223[_0x4fb0('0x1a')]?_0x1d8223[_0x4fb0('0x1a')]['limit']||null:null,'include':_0x1d8223[_0x4fb0('0x1a')]?_0x1d8223['options'][_0x4fb0('0x1d')]?_[_0x4fb0('0x1e')](_0x1d8223[_0x4fb0('0x1a')][_0x4fb0('0x1d')],function(_0x2f1d15){return{'model':db[_0x2f1d15['model']],'as':_0x2f1d15['as'],'attributes':_0x2f1d15[_0x4fb0('0x1c')],'include':_0x2f1d15[_0x4fb0('0x1d')]?_[_0x4fb0('0x1e')](_0x2f1d15[_0x4fb0('0x1d')],function(_0x57b6ea){return{'model':db[_0x57b6ea[_0x4fb0('0x1f')]],'as':_0x57b6ea['as'],'attributes':_0x57b6ea[_0x4fb0('0x1c')],'include':_0x57b6ea[_0x4fb0('0x1d')]?_['map'](_0x57b6ea[_0x4fb0('0x1d')],function(_0x2f9f0d){return{'model':db[_0x2f9f0d[_0x4fb0('0x1f')]],'as':_0x2f9f0d['as'],'attributes':_0x2f9f0d[_0x4fb0('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4adf7f){logger[_0x4fb0('0xe')](_0x4fb0('0x17'),_0x1d8223);logger[_0x4fb0('0x20')]('GetWhatsappQueue',_0x1d8223,JSON[_0x4fb0('0x11')](_0x4adf7f));_0x326685(_0x4adf7f);})[_0x4fb0('0x16')](function(_0x21cddf){logger[_0x4fb0('0x12')](_0x4fb0('0x17'),_0x21cddf[_0x4fb0('0x14')],_0x1d8223);_0x5117d6(_0x45c77a[_0x4fb0('0x12')](0x1f4,_0x21cddf['message']));});});};exports[_0x4fb0('0x21')]=function(_0x56cad0){var _0x39a9f7=this;return new Promise(function(_0x298d46,_0x4af531){return db[_0x4fb0('0x18')][_0x4fb0('0x22')]({'raw':_0x56cad0[_0x4fb0('0x1a')]?_0x56cad0[_0x4fb0('0x1a')][_0x4fb0('0x23')]===undefined?!![]:![]:!![],'where':_0x56cad0[_0x4fb0('0x1a')]?_0x56cad0[_0x4fb0('0x1a')][_0x4fb0('0x1b')]||null:null,'attributes':_0x56cad0[_0x4fb0('0x1a')]?_0x56cad0[_0x4fb0('0x1a')][_0x4fb0('0x1c')]||null:null,'include':_0x56cad0['options']?_0x56cad0[_0x4fb0('0x1a')]['include']?_[_0x4fb0('0x1e')](_0x56cad0['options']['include'],function(_0x3d127c){return{'model':db[_0x3d127c[_0x4fb0('0x1f')]],'as':_0x3d127c['as'],'attributes':_0x3d127c['attributes'],'include':_0x3d127c[_0x4fb0('0x1d')]?_['map'](_0x3d127c[_0x4fb0('0x1d')],function(_0x183aa8){return{'model':db[_0x183aa8['model']],'as':_0x183aa8['as'],'attributes':_0x183aa8[_0x4fb0('0x1c')],'include':_0x183aa8[_0x4fb0('0x1d')]?_[_0x4fb0('0x1e')](_0x183aa8['include'],function(_0xb1b8c3){return{'model':db[_0xb1b8c3['model']],'as':_0xb1b8c3['as'],'attributes':_0xb1b8c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fb0('0x24')](function(_0x43c4aa){logger[_0x4fb0('0xe')](_0x4fb0('0x21'),_0x56cad0);logger['debug'](_0x4fb0('0x21'),_0x56cad0,JSON[_0x4fb0('0x11')](_0x43c4aa));_0x298d46(_0x43c4aa);})[_0x4fb0('0x16')](function(_0x346ec7){logger['error'](_0x4fb0('0x21'),_0x346ec7[_0x4fb0('0x14')],_0x56cad0);_0x4af531(_0x39a9f7['error'](0x1f4,_0x346ec7[_0x4fb0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 0bd7597..7d42078 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 _0xd047=['removeListener','register','length','./whatsappQueue.events','remove','update','emit'];(function(_0x4e8ba7,_0x3d4041){var _0x100552=function(_0x373e14){while(--_0x373e14){_0x4e8ba7['push'](_0x4e8ba7['shift']());}};_0x100552(++_0x3d4041);}(_0xd047,0x129));var _0x7d04=function(_0x553946,_0x57c772){_0x553946=_0x553946-0x0;var _0x1f51bb=_0xd047[_0x553946];return _0x1f51bb;};'use strict';var WhatsappQueueEvents=require(_0x7d04('0x0'));var events=['save',_0x7d04('0x1'),_0x7d04('0x2')];function createListener(_0xbe1d85,_0x1cf929){return function(_0x5c864d){_0x1cf929[_0x7d04('0x3')](_0xbe1d85,_0x5c864d);};}function removeListener(_0x18dde1,_0x5b5a21){return function(){WhatsappQueueEvents[_0x7d04('0x4')](_0x18dde1,_0x5b5a21);};}exports[_0x7d04('0x5')]=function(_0x24f0f2){for(var _0x5ae2e6=0x0,_0xff28aa=events[_0x7d04('0x6')];_0x5ae2e6<_0xff28aa;_0x5ae2e6++){var _0x387e8b=events[_0x5ae2e6];var _0x553690=createListener('whatsappQueue:'+_0x387e8b,_0x24f0f2);WhatsappQueueEvents['on'](_0x387e8b,_0x553690);}}; \ No newline at end of file +var _0x91f1=['save','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x14dd26,_0x3cc881){var _0x4a7ab0=function(_0x15b151){while(--_0x15b151){_0x14dd26['push'](_0x14dd26['shift']());}};_0x4a7ab0(++_0x3cc881);}(_0x91f1,0x147));var _0x191f=function(_0x159bbd,_0x3fb13b){_0x159bbd=_0x159bbd-0x0;var _0x1093e7=_0x91f1[_0x159bbd];return _0x1093e7;};'use strict';var WhatsappQueueEvents=require(_0x191f('0x0'));var events=[_0x191f('0x1'),'remove',_0x191f('0x2')];function createListener(_0x4b6111,_0x2d6607){return function(_0x56ca49){_0x2d6607[_0x191f('0x3')](_0x4b6111,_0x56ca49);};}function removeListener(_0x5b6a74,_0x308e58){return function(){WhatsappQueueEvents[_0x191f('0x4')](_0x5b6a74,_0x308e58);};}exports[_0x191f('0x5')]=function(_0xf001c6){for(var _0x383d3b=0x0,_0x20f345=events[_0x191f('0x6')];_0x383d3b<_0x20f345;_0x383d3b++){var _0x14c1f6=events[_0x383d3b];var _0x5ad8a0=createListener(_0x191f('0x7')+_0x14c1f6,_0xf001c6);WhatsappQueueEvents['on'](_0x14c1f6,_0x5ad8a0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 87f897f..9d1afb5 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 _0xd961=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x206453,_0x46c9ec){var _0xcde5a9=function(_0x1cd1bc){while(--_0x1cd1bc){_0x206453['push'](_0x206453['shift']());}};_0xcde5a9(++_0x46c9ec);}(_0xd961,0x107));var _0x1d96=function(_0x4d316c,_0xfee14d){_0x4d316c=_0x4d316c-0x0;var _0x59a7a0=_0xd961[_0x4d316c];return _0x59a7a0;};'use strict';var multer=require(_0x1d96('0x0'));var util=require(_0x1d96('0x1'));var path=require('path');var timeout=require(_0x1d96('0x2'));var express=require(_0x1d96('0x3'));var router=express[_0x1d96('0x4')]();var fs_extra=require(_0x1d96('0x5'));var auth=require(_0x1d96('0x6'));var interaction=require(_0x1d96('0x7'));var config=require('../../config/environment');var controller=require(_0x1d96('0x8'));router[_0x1d96('0x9')]('/',auth[_0x1d96('0xa')](),controller[_0x1d96('0xb')]);router['get'](_0x1d96('0xc'),auth[_0x1d96('0xa')](),controller[_0x1d96('0xd')]);router[_0x1d96('0x9')](_0x1d96('0xe'),auth[_0x1d96('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1d96('0xe'),auth['isAuthenticated'](),controller[_0x1d96('0xf')]);router[_0x1d96('0x10')](_0x1d96('0xe'),auth[_0x1d96('0xa')](),controller[_0x1d96('0x11')]);module[_0x1d96('0x12')]=router; \ No newline at end of file +var _0x8fea=['get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','isAuthenticated','index'];(function(_0x25ad73,_0x109fad){var _0x46ade3=function(_0x8cc340){while(--_0x8cc340){_0x25ad73['push'](_0x25ad73['shift']());}};_0x46ade3(++_0x109fad);}(_0x8fea,0x14e));var _0xa8fe=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x8fea[_0x45c981];return _0x4f62c8;};'use strict';var multer=require(_0xa8fe('0x0'));var util=require('util');var path=require(_0xa8fe('0x1'));var timeout=require(_0xa8fe('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa8fe('0x3'));var interaction=require(_0xa8fe('0x4'));var config=require('../../config/environment');var controller=require(_0xa8fe('0x5'));router['get']('/',auth[_0xa8fe('0x6')](),controller[_0xa8fe('0x7')]);router[_0xa8fe('0x8')](_0xa8fe('0x9'),auth['isAuthenticated'](),controller[_0xa8fe('0xa')]);router['get'](_0xa8fe('0xb'),auth[_0xa8fe('0x6')](),controller[_0xa8fe('0xc')]);router[_0xa8fe('0xd')]('/',auth['isAuthenticated'](),controller[_0xa8fe('0xe')]);router[_0xa8fe('0xf')](_0xa8fe('0xb'),auth[_0xa8fe('0x6')](),controller[_0xa8fe('0x10')]);router['delete'](_0xa8fe('0xb'),auth['isAuthenticated'](),controller[_0xa8fe('0x11')]);module[_0xa8fe('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 35bb7b5..e08d1e3 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x1aefca,_0x14c8f8){var _0x3cdec5=function(_0x23c217){while(--_0x23c217){_0x1aefca['push'](_0x1aefca['shift']());}};_0x3cdec5(++_0x14c8f8);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x177e2f,_0x291299){var _0x4f7d1b=function(_0x459f05){while(--_0x459f05){_0x177e2f['push'](_0x177e2f['shift']());}};_0x4f7d1b(++_0x291299);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 89699eb..caf6471 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 _0xe511=['destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','error','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','WhatsappQueueReport','findAll','catch','show','params','rawAttributes','find','create','body'];(function(_0x4621fb,_0x56478c){var _0x15fb75=function(_0x19e4a7){while(--_0x19e4a7){_0x4621fb['push'](_0x4621fb['shift']());}};_0x15fb75(++_0x56478c);}(_0xe511,0x16f));var _0x1e51=function(_0x16b994,_0x22872a){_0x16b994=_0x16b994-0x0;var _0xfc3e0f=_0xe511[_0x16b994];return _0xfc3e0f;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];function respondWithStatusCode(_0x3c5330,_0x5544eb){_0x5544eb=_0x5544eb||0xcc;return function(_0x408a77){if(_0x408a77){return _0x3c5330[_0x1e51('0x18')](_0x5544eb);}return _0x3c5330[_0x1e51('0x19')](_0x5544eb)[_0x1e51('0x1a')]();};}function respondWithResult(_0x21bcbd,_0x32945d){_0x32945d=_0x32945d||0xc8;return function(_0x441c70){if(_0x441c70){return _0x21bcbd[_0x1e51('0x19')](_0x32945d)[_0x1e51('0x1b')](_0x441c70);}};}function respondWithFilteredResult(_0xd76fba,_0x5a5c07){return function(_0x3b01b7){if(_0x3b01b7){var _0x24db4f=typeof _0x5a5c07[_0x1e51('0x1c')]==='undefined'&&typeof _0x5a5c07[_0x1e51('0x1d')]==='undefined';var _0x53d222=_0x3b01b7[_0x1e51('0x1e')];var _0x27dcad=_0x24db4f?0x0:_0x5a5c07[_0x1e51('0x1c')];var _0x4785a5=_0x24db4f?_0x3b01b7[_0x1e51('0x1e')]:_0x5a5c07[_0x1e51('0x1c')]+_0x5a5c07['limit'];var _0x39449b;if(_0x4785a5>=_0x53d222){_0x4785a5=_0x53d222;_0x39449b=0xc8;}else{_0x39449b=0xce;}_0xd76fba['status'](_0x39449b);return _0xd76fba[_0x1e51('0x1f')](_0x1e51('0x20'),_0x27dcad+'-'+_0x4785a5+'/'+_0x53d222)[_0x1e51('0x1b')](_0x3b01b7);}return null;};}function patchUpdates(_0x183a95){return function(_0x506f40){try{jsonpatch['apply'](_0x506f40,_0x183a95,!![]);}catch(_0x4e6a49){return BPromise['reject'](_0x4e6a49);}return _0x506f40[_0x1e51('0x21')]();};}function saveUpdates(_0x4f1f56,_0x3f7340){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0x1e51('0x22')](_0x4f1f56)[_0x1e51('0x23')](function(_0x23c85a){return _0x23c85a;});}return null;};}function removeEntity(_0xf9298,_0x270adf){return function(_0x461d3d){if(_0x461d3d){return _0x461d3d['destroy']()['then'](function(){_0xf9298[_0x1e51('0x19')](0xcc)[_0x1e51('0x1a')]();});}};}function handleEntityNotFound(_0x2e42b1,_0x1386db){return function(_0x505d79){if(!_0x505d79){_0x2e42b1['sendStatus'](0x194);}return _0x505d79;};}function handleError(_0x486ad6,_0x1eb83f){_0x1eb83f=_0x1eb83f||0x1f4;return function(_0x2a1561){logger[_0x1e51('0x24')](_0x2a1561['stack']);if(_0x2a1561[_0x1e51('0x25')]){delete _0x2a1561['name'];}_0x486ad6['status'](_0x1eb83f)[_0x1e51('0x26')](_0x2a1561);};}exports['index']=function(_0x170ec6,_0x1eb79f){var _0x56722f={},_0x3e6ef2={},_0x10ee23={'count':0x0,'rows':[]};var _0x71c7af=_[_0x1e51('0x27')](db['WhatsappQueueReport']['rawAttributes'],function(_0x4f67d3){return{'name':_0x4f67d3[_0x1e51('0x28')],'type':_0x4f67d3[_0x1e51('0x29')][_0x1e51('0x2a')]};});_0x3e6ef2[_0x1e51('0x2b')]=_[_0x1e51('0x27')](_0x71c7af,_0x1e51('0x25'));_0x3e6ef2[_0x1e51('0x2c')]=_[_0x1e51('0x2d')](_0x170ec6[_0x1e51('0x2c')]);_0x3e6ef2[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x3e6ef2['model'],_0x3e6ef2[_0x1e51('0x2c')]);_0x56722f[_0x1e51('0x30')]=_[_0x1e51('0x2f')](_0x3e6ef2[_0x1e51('0x2b')],qs[_0x1e51('0x31')](_0x170ec6['query'][_0x1e51('0x31')]));_0x56722f['attributes']=_0x56722f[_0x1e51('0x30')][_0x1e51('0x32')]?_0x56722f[_0x1e51('0x30')]:_0x3e6ef2['model'];if(!_0x170ec6[_0x1e51('0x2c')]['hasOwnProperty'](_0x1e51('0x33'))){_0x56722f['limit']=qs['limit'](_0x170ec6[_0x1e51('0x2c')][_0x1e51('0x1d')]);_0x56722f[_0x1e51('0x1c')]=qs['offset'](_0x170ec6[_0x1e51('0x2c')]['offset']);}_0x56722f[_0x1e51('0x34')]=qs[_0x1e51('0x35')](_0x170ec6['query'][_0x1e51('0x35')]);_0x56722f[_0x1e51('0x36')]=qs[_0x1e51('0x2e')](_[_0x1e51('0x37')](_0x170ec6[_0x1e51('0x2c')],_0x3e6ef2[_0x1e51('0x2e')]),_0x71c7af);if(_0x170ec6['query']['filter']){_0x56722f[_0x1e51('0x36')]=_['merge'](_0x56722f[_0x1e51('0x36')],{'$or':_[_0x1e51('0x27')](_0x71c7af,function(_0x32c41b){if(_0x32c41b[_0x1e51('0x29')]!==_0x1e51('0x38')){var _0x174a24={};_0x174a24[_0x32c41b[_0x1e51('0x25')]]={'$like':'%'+_0x170ec6[_0x1e51('0x2c')][_0x1e51('0x39')]+'%'};return _0x174a24;}})});}_0x56722f=_[_0x1e51('0x3a')]({},_0x56722f,_0x170ec6[_0x1e51('0x3b')]);var _0x5360b3={'where':_0x56722f[_0x1e51('0x36')]};return db['WhatsappQueueReport'][_0x1e51('0x1e')](_0x5360b3)[_0x1e51('0x23')](function(_0x2b287e){_0x10ee23[_0x1e51('0x1e')]=_0x2b287e;if(_0x170ec6[_0x1e51('0x2c')][_0x1e51('0x3c')]){_0x56722f[_0x1e51('0x3d')]=[{'all':!![]}];}return db[_0x1e51('0x3e')][_0x1e51('0x3f')](_0x56722f);})[_0x1e51('0x23')](function(_0xc40fce){_0x10ee23['rows']=_0xc40fce;return _0x10ee23;})['then'](respondWithFilteredResult(_0x1eb79f,_0x56722f))[_0x1e51('0x40')](handleError(_0x1eb79f,null));};exports[_0x1e51('0x41')]=function(_0x3be495,_0x4650e4){var _0x1ef3d3={'raw':!![],'where':{'id':_0x3be495[_0x1e51('0x42')]['id']}},_0x1a9e0d={};_0x1a9e0d[_0x1e51('0x2b')]=_['keys'](db[_0x1e51('0x3e')][_0x1e51('0x43')]);_0x1a9e0d[_0x1e51('0x2c')]=_[_0x1e51('0x2d')](_0x3be495[_0x1e51('0x2c')]);_0x1a9e0d[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x1a9e0d['model'],_0x1a9e0d[_0x1e51('0x2c')]);_0x1ef3d3[_0x1e51('0x30')]=_['intersection'](_0x1a9e0d[_0x1e51('0x2b')],qs[_0x1e51('0x31')](_0x3be495[_0x1e51('0x2c')]['fields']));_0x1ef3d3[_0x1e51('0x30')]=_0x1ef3d3[_0x1e51('0x30')][_0x1e51('0x32')]?_0x1ef3d3[_0x1e51('0x30')]:_0x1a9e0d[_0x1e51('0x2b')];if(_0x3be495[_0x1e51('0x2c')][_0x1e51('0x3c')]){_0x1ef3d3[_0x1e51('0x3d')]=[{'all':!![]}];}_0x1ef3d3=_[_0x1e51('0x3a')]({},_0x1ef3d3,_0x3be495['options']);return db[_0x1e51('0x3e')][_0x1e51('0x44')](_0x1ef3d3)['then'](handleEntityNotFound(_0x4650e4,null))[_0x1e51('0x23')](respondWithResult(_0x4650e4,null))[_0x1e51('0x40')](handleError(_0x4650e4,null));};exports[_0x1e51('0x45')]=function(_0x4f6405,_0x44468a){return db[_0x1e51('0x3e')][_0x1e51('0x45')](_0x4f6405['body'],{})[_0x1e51('0x23')](respondWithResult(_0x44468a,0xc9))['catch'](handleError(_0x44468a,null));};exports['update']=function(_0x54688b,_0x169e6c){if(_0x54688b[_0x1e51('0x46')]['id']){delete _0x54688b['body']['id'];}return db['WhatsappQueueReport'][_0x1e51('0x44')]({'where':{'id':_0x54688b[_0x1e51('0x42')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x169e6c,null))[_0x1e51('0x23')](saveUpdates(_0x54688b[_0x1e51('0x46')],null))[_0x1e51('0x23')](respondWithResult(_0x169e6c,null))['catch'](handleError(_0x169e6c,null));};exports[_0x1e51('0x47')]=function(_0x48a2d0,_0xf6bd35){return db[_0x1e51('0x3e')]['find']({'where':{'id':_0x48a2d0['params']['id']}})['then'](handleEntityNotFound(_0xf6bd35,null))[_0x1e51('0x23')](removeEntity(_0xf6bd35,null))[_0x1e51('0x40')](handleError(_0xf6bd35,null));};exports[_0x1e51('0x48')]=function(_0x4cdfe3,_0x2fdee1){return db[_0x1e51('0x3e')][_0x1e51('0x48')]()[_0x1e51('0x23')](respondWithResult(_0x2fdee1,null))[_0x1e51('0x40')](handleError(_0x2fdee1,null));}; \ No newline at end of file +var _0x5ec6=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x56d5cf,_0x554f3c){var _0x1e0651=function(_0x3f016c){while(--_0x3f016c){_0x56d5cf['push'](_0x56d5cf['shift']());}};_0x1e0651(++_0x554f3c);}(_0x5ec6,0x7f));var _0x65ec=function(_0x43609d,_0x4d58d3){_0x43609d=_0x43609d-0x0;var _0x46bb59=_0x5ec6[_0x43609d];return _0x46bb59;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x288e66,_0x156793){return function(_0x21426b){if(!_0x21426b){_0x288e66[_0x65ec('0x15')](0x194);}return _0x21426b;};}function handleError(_0x297e09,_0x4c846b){_0x4c846b=_0x4c846b||0x1f4;return function(_0x10baef){logger[_0x65ec('0x25')](_0x10baef[_0x65ec('0x26')]);if(_0x10baef[_0x65ec('0x27')]){delete _0x10baef['name'];}_0x297e09[_0x65ec('0x16')](_0x4c846b)['send'](_0x10baef);};}exports[_0x65ec('0x28')]=function(_0x1ada47,_0x1d0b5c){var _0x30366c={},_0x14431d={},_0x46d4c1={'count':0x0,'rows':[]};var _0x46bf66=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x3c97e2){return{'name':_0x3c97e2['fieldName'],'type':_0x3c97e2['type'][_0x65ec('0x2c')]};});_0x14431d['model']=_[_0x65ec('0x29')](_0x46bf66,_0x65ec('0x27'));_0x14431d['query']=_[_0x65ec('0x2d')](_0x1ada47[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x14431d['model'],_0x14431d[_0x65ec('0x2e')]);_0x30366c[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x14431d[_0x65ec('0x32')],qs[_0x65ec('0x33')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x30366c[_0x65ec('0x31')]=_0x30366c[_0x65ec('0x31')][_0x65ec('0x34')]?_0x30366c['attributes']:_0x14431d[_0x65ec('0x32')];if(!_0x1ada47[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x30366c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x1b')]);_0x30366c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x1ada47['query'][_0x65ec('0x19')]);}_0x30366c[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1ada47[_0x65ec('0x2e')]['sort']);_0x30366c[_0x65ec('0x38')]=qs[_0x65ec('0x2f')](_[_0x65ec('0x39')](_0x1ada47[_0x65ec('0x2e')],_0x14431d['filters']),_0x46bf66);if(_0x1ada47['query'][_0x65ec('0x3a')]){_0x30366c['where']=_[_0x65ec('0x3b')](_0x30366c[_0x65ec('0x38')],{'$or':_['map'](_0x46bf66,function(_0x16ef59){if(_0x16ef59[_0x65ec('0x3c')]!==_0x65ec('0x3d')){var _0x5357bf={};_0x5357bf[_0x16ef59[_0x65ec('0x27')]]={'$like':'%'+_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3a')]+'%'};return _0x5357bf;}})});}_0x30366c=_[_0x65ec('0x3b')]({},_0x30366c,_0x1ada47[_0x65ec('0x3e')]);var _0x2ce56f={'where':_0x30366c[_0x65ec('0x38')]};return db['WhatsappQueueReport'][_0x65ec('0x1c')](_0x2ce56f)['then'](function(_0x2654b2){_0x46d4c1[_0x65ec('0x1c')]=_0x2654b2;if(_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x30366c[_0x65ec('0x40')]=[{'all':!![]}];}return db[_0x65ec('0x2a')]['findAll'](_0x30366c);})[_0x65ec('0x23')](function(_0x4ba7df){_0x46d4c1['rows']=_0x4ba7df;return _0x46d4c1;})[_0x65ec('0x23')](respondWithFilteredResult(_0x1d0b5c,_0x30366c))[_0x65ec('0x41')](handleError(_0x1d0b5c,null));};exports[_0x65ec('0x42')]=function(_0x143a11,_0x1d475e){var _0x524235={'raw':!![],'where':{'id':_0x143a11[_0x65ec('0x43')]['id']}},_0x4843ca={};_0x4843ca[_0x65ec('0x32')]=_[_0x65ec('0x2d')](db[_0x65ec('0x2a')][_0x65ec('0x2b')]);_0x4843ca['query']=_['keys'](_0x143a11[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x4843ca[_0x65ec('0x32')],_0x4843ca[_0x65ec('0x2e')]);_0x524235[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x4843ca['model'],qs[_0x65ec('0x33')](_0x143a11[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x524235['attributes']=_0x524235[_0x65ec('0x31')][_0x65ec('0x34')]?_0x524235['attributes']:_0x4843ca[_0x65ec('0x32')];if(_0x143a11[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x524235[_0x65ec('0x40')]=[{'all':!![]}];}_0x524235=_[_0x65ec('0x3b')]({},_0x524235,_0x143a11['options']);return db[_0x65ec('0x2a')][_0x65ec('0x44')](_0x524235)[_0x65ec('0x23')](handleEntityNotFound(_0x1d475e,null))[_0x65ec('0x23')](respondWithResult(_0x1d475e,null))['catch'](handleError(_0x1d475e,null));};exports[_0x65ec('0x45')]=function(_0x509c28,_0x1ed0f9){return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x509c28['body'],{})['then'](respondWithResult(_0x1ed0f9,0xc9))[_0x65ec('0x41')](handleError(_0x1ed0f9,null));};exports[_0x65ec('0x22')]=function(_0xf5419,_0x2111af){if(_0xf5419[_0x65ec('0x46')]['id']){delete _0xf5419[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x44')]({'where':{'id':_0xf5419[_0x65ec('0x43')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x23')](saveUpdates(_0xf5419[_0x65ec('0x46')],null))[_0x65ec('0x23')](respondWithResult(_0x2111af,null))[_0x65ec('0x41')](handleError(_0x2111af,null));};exports[_0x65ec('0x24')]=function(_0x14eaef,_0x22c28c){return db['WhatsappQueueReport'][_0x65ec('0x44')]({'where':{'id':_0x14eaef[_0x65ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x22c28c,null))[_0x65ec('0x23')](removeEntity(_0x22c28c,null))[_0x65ec('0x41')](handleError(_0x22c28c,null));};exports[_0x65ec('0x47')]=function(_0x528cfa,_0x3eee1e){return db[_0x65ec('0x2a')][_0x65ec('0x47')]()['then'](respondWithResult(_0x3eee1e,null))[_0x65ec('0x41')](handleError(_0x3eee1e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c18a95e..5416dc6 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 _0x1f1f=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x37280f,_0x49b5f2){var _0x4c55fb=function(_0x1e55ec){while(--_0x1e55ec){_0x37280f['push'](_0x37280f['shift']());}};_0x4c55fb(++_0x49b5f2);}(_0x1f1f,0x170));var _0xf1f1=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x1f1f[_0x38841c];return _0x500610;};'use strict';var _=require(_0xf1f1('0x0'));var util=require(_0xf1f1('0x1'));var logger=require('../../config/logger')(_0xf1f1('0x2'));var moment=require(_0xf1f1('0x3'));var BPromise=require(_0xf1f1('0x4'));var rp=require(_0xf1f1('0x5'));var fs=require('fs');var path=require(_0xf1f1('0x6'));var rimraf=require('rimraf');var config=require(_0xf1f1('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0xf1f1('0x8')]=function(_0x166e3a,_0x2db924){return _0x166e3a[_0xf1f1('0x9')](_0xf1f1('0xa'),attributes,{'tableName':_0xf1f1('0xb'),'paranoid':![],'indexes':[{'name':_0xf1f1('0xc'),'fields':[_0xf1f1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcec=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0xd3ad1e,_0x2646c4){var _0x2e6c72=function(_0x34d399){while(--_0x34d399){_0xd3ad1e['push'](_0xd3ad1e['shift']());}};_0x2e6c72(++_0x2646c4);}(_0xdcec,0xfc));var _0xcdce=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0xdcec[_0x1b91c7];return _0xbbe014;};'use strict';var _=require(_0xcdce('0x0'));var util=require(_0xcdce('0x1'));var logger=require(_0xcdce('0x2'))(_0xcdce('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcdce('0x4'));var fs=require('fs');var path=require(_0xcdce('0x5'));var rimraf=require(_0xcdce('0x6'));var config=require(_0xcdce('0x7'));var attributes=require(_0xcdce('0x8'));module['exports']=function(_0x75167d,_0x2dceb6){return _0x75167d['define'](_0xcdce('0x9'),attributes,{'tableName':_0xcdce('0xa'),'paranoid':![],'indexes':[{'name':_0xcdce('0xb'),'fields':[_0xcdce('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 8de5c27..5c95b50 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 _0x863e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','stringify','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14e353,_0x172235){var _0x4a44f2=function(_0x1724d8){while(--_0x1724d8){_0x14e353['push'](_0x14e353['shift']());}};_0x4a44f2(++_0x172235);}(_0x863e,0xbf));var _0xe863=function(_0xef8d0,_0x1ef7c9){_0xef8d0=_0xef8d0-0x0;var _0x13e9f1=_0x863e[_0xef8d0];return _0x13e9f1;};'use strict';var _=require(_0xe863('0x0'));var util=require(_0xe863('0x1'));var moment=require(_0xe863('0x2'));var BPromise=require(_0xe863('0x3'));var rs=require(_0xe863('0x4'));var fs=require('fs');var Redis=require(_0xe863('0x5'));var db=require(_0xe863('0x6'))['db'];var utils=require(_0xe863('0x7'));var logger=require('../../config/logger')(_0xe863('0x8'));var config=require(_0xe863('0x9'));var jayson=require(_0xe863('0xa'));var client=jayson[_0xe863('0xb')][_0xe863('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c92e3,_0x5d017b,_0x3ec14d){return new BPromise(function(_0x1920a9,_0xfb8ad5){return client[_0xe863('0xd')](_0x5c92e3,_0x3ec14d)[_0xe863('0xe')](function(_0x348036){logger['info'](_0xe863('0xf'),_0x5d017b,_0xe863('0x10'));logger[_0xe863('0x11')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5d017b,'request\x20sent',JSON['stringify'](_0x348036));if(_0x348036[_0xe863('0x12')]){if(_0x348036[_0xe863('0x12')]['code']===0x1f4){logger[_0xe863('0x12')](_0xe863('0xf'),_0x5d017b,_0x348036['error'][_0xe863('0x13')]);return _0xfb8ad5(_0x348036[_0xe863('0x12')][_0xe863('0x13')]);}logger['error'](_0xe863('0xf'),_0x5d017b,_0x348036[_0xe863('0x12')][_0xe863('0x13')]);return _0x1920a9(_0x348036[_0xe863('0x12')][_0xe863('0x13')]);}else{logger[_0xe863('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5d017b,_0xe863('0x10'));_0x1920a9(_0x348036[_0xe863('0x15')]['message']);}})[_0xe863('0x16')](function(_0x53d2c2){logger[_0xe863('0x12')](_0xe863('0xf'),_0x5d017b,_0x53d2c2);_0xfb8ad5(_0x53d2c2);});});}exports[_0xe863('0x17')]=function(_0x524292){var _0x47f2d3=this;return new Promise(function(_0x31179c,_0x50fef3){return db[_0xe863('0x18')]['create'](_0x524292[_0xe863('0x19')],{'raw':_0x524292[_0xe863('0x1a')]?_0x524292['options'][_0xe863('0x1b')]===undefined?!![]:![]:!![]})[_0xe863('0xe')](function(_0x36195d){logger['info']('CreateWhatsappQueueReport',_0x524292);logger[_0xe863('0x11')](_0xe863('0x17'),_0x524292,JSON[_0xe863('0x1c')](_0x36195d));_0x31179c(_0x36195d);})[_0xe863('0x16')](function(_0x22d23f){logger['error']('CreateWhatsappQueueReport',_0x22d23f['message'],_0x524292);_0x50fef3(_0x47f2d3[_0xe863('0x12')](0x1f4,_0x22d23f[_0xe863('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x59a40c){var _0x31eb20=this;return new Promise(function(_0x1f04ce,_0xaafe00){return db[_0xe863('0x18')]['update'](_0x59a40c[_0xe863('0x19')],{'raw':_0x59a40c[_0xe863('0x1a')]?_0x59a40c['options'][_0xe863('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59a40c['options']?_0x59a40c[_0xe863('0x1a')][_0xe863('0x1d')]||null:null,'attributes':_0x59a40c['options']?_0x59a40c[_0xe863('0x1a')][_0xe863('0x1e')]||null:null,'limit':_0x59a40c[_0xe863('0x1a')]?_0x59a40c[_0xe863('0x1a')][_0xe863('0x1f')]||null:null})['then'](function(_0x51b6ca){logger[_0xe863('0x14')](_0xe863('0x20'),_0x59a40c);logger[_0xe863('0x11')]('UpdateWhatsappQueueReport',_0x59a40c,JSON['stringify'](_0x51b6ca));_0x1f04ce(_0x51b6ca);})[_0xe863('0x16')](function(_0x459db5){logger[_0xe863('0x12')](_0xe863('0x20'),_0x459db5[_0xe863('0x13')],_0x59a40c);_0xaafe00(_0x31eb20[_0xe863('0x12')](0x1f4,_0x459db5[_0xe863('0x13')]));});});}; \ No newline at end of file +var _0x53e8=['jayson/promise','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5f0f22,_0x4ff4e7){var _0x24b226=function(_0x5c2439){while(--_0x5c2439){_0x5f0f22['push'](_0x5f0f22['shift']());}};_0x24b226(++_0x4ff4e7);}(_0x53e8,0xb7));var _0x853e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x53e8[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x853e('0x0'));var util=require('util');var moment=require(_0x853e('0x1'));var BPromise=require(_0x853e('0x2'));var rs=require(_0x853e('0x3'));var fs=require('fs');var Redis=require(_0x853e('0x4'));var db=require(_0x853e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x853e('0x6'))(_0x853e('0x7'));var config=require(_0x853e('0x8'));var jayson=require(_0x853e('0x9'));var client=jayson['client'][_0x853e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bfe92,_0x346842,_0x342225){return new BPromise(function(_0x133dc5,_0x325731){return client[_0x853e('0xb')](_0x4bfe92,_0x342225)['then'](function(_0x2ac799){logger[_0x853e('0xc')](_0x853e('0xd'),_0x346842,'request\x20sent');logger[_0x853e('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x346842,'request\x20sent',JSON[_0x853e('0xf')](_0x2ac799));if(_0x2ac799[_0x853e('0x10')]){if(_0x2ac799[_0x853e('0x10')][_0x853e('0x11')]===0x1f4){logger[_0x853e('0x10')](_0x853e('0xd'),_0x346842,_0x2ac799[_0x853e('0x10')][_0x853e('0x12')]);return _0x325731(_0x2ac799[_0x853e('0x10')][_0x853e('0x12')]);}logger[_0x853e('0x10')](_0x853e('0xd'),_0x346842,_0x2ac799[_0x853e('0x10')][_0x853e('0x12')]);return _0x133dc5(_0x2ac799[_0x853e('0x10')][_0x853e('0x12')]);}else{logger[_0x853e('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x346842,_0x853e('0x13'));_0x133dc5(_0x2ac799['result'][_0x853e('0x12')]);}})[_0x853e('0x14')](function(_0x2ed43a){logger['error'](_0x853e('0xd'),_0x346842,_0x2ed43a);_0x325731(_0x2ed43a);});});}exports[_0x853e('0x15')]=function(_0x3bffc9){var _0x201d04=this;return new Promise(function(_0xad7174,_0x374e19){return db[_0x853e('0x16')][_0x853e('0x17')](_0x3bffc9[_0x853e('0x18')],{'raw':_0x3bffc9[_0x853e('0x19')]?_0x3bffc9[_0x853e('0x19')][_0x853e('0x1a')]===undefined?!![]:![]:!![]})[_0x853e('0x1b')](function(_0x5836a3){logger['info'](_0x853e('0x15'),_0x3bffc9);logger[_0x853e('0xe')](_0x853e('0x15'),_0x3bffc9,JSON[_0x853e('0xf')](_0x5836a3));_0xad7174(_0x5836a3);})['catch'](function(_0x11b261){logger['error'](_0x853e('0x15'),_0x11b261[_0x853e('0x12')],_0x3bffc9);_0x374e19(_0x201d04[_0x853e('0x10')](0x1f4,_0x11b261[_0x853e('0x12')]));});});};exports[_0x853e('0x1c')]=function(_0x4eb9f6){var _0x4cddc5=this;return new Promise(function(_0x59799d,_0x57bc11){return db[_0x853e('0x16')]['update'](_0x4eb9f6[_0x853e('0x18')],{'raw':_0x4eb9f6[_0x853e('0x19')]?_0x4eb9f6[_0x853e('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eb9f6[_0x853e('0x19')]?_0x4eb9f6['options'][_0x853e('0x1d')]||null:null,'attributes':_0x4eb9f6[_0x853e('0x19')]?_0x4eb9f6['options'][_0x853e('0x1e')]||null:null,'limit':_0x4eb9f6[_0x853e('0x19')]?_0x4eb9f6[_0x853e('0x19')][_0x853e('0x1f')]||null:null})[_0x853e('0x1b')](function(_0x5d4ae0){logger[_0x853e('0xc')]('UpdateWhatsappQueueReport',_0x4eb9f6);logger[_0x853e('0xe')]('UpdateWhatsappQueueReport',_0x4eb9f6,JSON['stringify'](_0x5d4ae0));_0x59799d(_0x5d4ae0);})[_0x853e('0x14')](function(_0x52f230){logger[_0x853e('0x10')]('UpdateWhatsappQueueReport',_0x52f230[_0x853e('0x12')],_0x4eb9f6);_0x57bc11(_0x4cddc5[_0x853e('0x10')](0x1f4,_0x52f230['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index bb29036..37825cb 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 _0xd3d3=['Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0xd3d3,0x15b));var _0x3d3d=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xd3d3[_0x58dc25];return _0x21b0a7;};'use strict';var multer=require(_0x3d3d('0x0'));var util=require(_0x3d3d('0x1'));var path=require(_0x3d3d('0x2'));var timeout=require(_0x3d3d('0x3'));var express=require(_0x3d3d('0x4'));var router=express[_0x3d3d('0x5')]();var fs_extra=require(_0x3d3d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3d3d('0x7'));var controller=require(_0x3d3d('0x8'));router[_0x3d3d('0x9')]('/',auth['isAuthenticated'](),controller[_0x3d3d('0xa')]);router[_0x3d3d('0x9')](_0x3d3d('0xb'),auth[_0x3d3d('0xc')](),controller[_0x3d3d('0xd')]);router[_0x3d3d('0x9')](_0x3d3d('0xe'),auth[_0x3d3d('0xc')](),controller[_0x3d3d('0xf')]);router[_0x3d3d('0x10')]('/',auth[_0x3d3d('0xc')](),controller[_0x3d3d('0x11')]);router[_0x3d3d('0x12')](_0x3d3d('0xe'),auth[_0x3d3d('0xc')](),controller['update']);router[_0x3d3d('0x13')](_0x3d3d('0xe'),auth[_0x3d3d('0xc')](),controller[_0x3d3d('0x14')]);module[_0x3d3d('0x15')]=router; \ No newline at end of file +var _0xa15b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xa15b,0xae));var _0xba15=function(_0x42136b,_0x283400){_0x42136b=_0x42136b-0x0;var _0x59b41f=_0xa15b[_0x42136b];return _0x59b41f;};'use strict';var multer=require('multer');var util=require(_0xba15('0x0'));var path=require(_0xba15('0x1'));var timeout=require(_0xba15('0x2'));var express=require(_0xba15('0x3'));var router=express[_0xba15('0x4')]();var fs_extra=require(_0xba15('0x5'));var auth=require(_0xba15('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xba15('0x7'));var controller=require(_0xba15('0x8'));router[_0xba15('0x9')]('/',auth[_0xba15('0xa')](),controller['index']);router[_0xba15('0x9')](_0xba15('0xb'),auth[_0xba15('0xa')](),controller[_0xba15('0xc')]);router['get']('/:id',auth[_0xba15('0xa')](),controller[_0xba15('0xd')]);router[_0xba15('0xe')]('/',auth[_0xba15('0xa')](),controller[_0xba15('0xf')]);router[_0xba15('0x10')](_0xba15('0x11'),auth[_0xba15('0xa')](),controller[_0xba15('0x12')]);router[_0xba15('0x13')]('/:id',auth[_0xba15('0xa')](),controller[_0xba15('0x14')]);module[_0xba15('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 5cb339b..5d6ee78 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 _0x6c9c=['ENUM','account','agent','queue','sequelize','exports'];(function(_0x119cbb,_0x1aa294){var _0x2ad6a5=function(_0x5059f2){while(--_0x5059f2){_0x119cbb['push'](_0x119cbb['shift']());}};_0x2ad6a5(++_0x1aa294);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x51ce2d,_0x390ec3){_0x51ce2d=_0x51ce2d-0x0;var _0x419c84=_0x6c9c[_0x51ce2d];return _0x419c84;};'use strict';var Sequelize=require(_0xc6c9('0x0'));module[_0xc6c9('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc6c9('0x2')](_0xc6c9('0x3'),_0xc6c9('0x4'),_0xc6c9('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x9a86=['agent','queue','DATE','sequelize','exports','ENUM','account'];(function(_0x5d83e4,_0x220d07){var _0x29faae=function(_0x1721e6){while(--_0x1721e6){_0x5d83e4['push'](_0x5d83e4['shift']());}};_0x29faae(++_0x220d07);}(_0x9a86,0x1ed));var _0x69a8=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0x9a86[_0x36fbef];return _0x45e270;};'use strict';var Sequelize=require(_0x69a8('0x0'));module[_0x69a8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x69a8('0x2')](_0x69a8('0x3'),_0x69a8('0x4'),_0x69a8('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x69a8('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 7865270..9c017c1 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 _0xac60=['nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','destroy','find','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','WhatsappTransferReport','fieldName','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x5283d1,_0x4e6d48){var _0xf7bb8f=function(_0x5f180e){while(--_0x5f180e){_0x5283d1['push'](_0x5283d1['shift']());}};_0xf7bb8f(++_0x4e6d48);}(_0xac60,0x137));var _0x0ac6=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xac60[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ac6('0x0'));var jsonpatch=require(_0x0ac6('0x1'));var rp=require(_0x0ac6('0x2'));var moment=require(_0x0ac6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ac6('0x4'));var path=require(_0x0ac6('0x5'));var sox=require(_0x0ac6('0x6'));var csv=require(_0x0ac6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ac6('0x8'));var _=require(_0x0ac6('0x9'));var squel=require(_0x0ac6('0xa'));var crypto=require('crypto');var jsforce=require(_0x0ac6('0xb'));var deskjs=require(_0x0ac6('0xc'));var toCsv=require(_0x0ac6('0x7'));var querystring=require(_0x0ac6('0xd'));var Papa=require(_0x0ac6('0xe'));var Redis=require('ioredis');var authService=require(_0x0ac6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0ac6('0x10'));var hardwareService=require(_0x0ac6('0x11'));var logger=require(_0x0ac6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x0ac6('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d624f,_0x5ada77){_0x5ada77=_0x5ada77||0xcc;return function(_0x46d535){if(_0x46d535){return _0x3d624f[_0x0ac6('0x14')](_0x5ada77);}return _0x3d624f[_0x0ac6('0x15')](_0x5ada77)[_0x0ac6('0x16')]();};}function respondWithResult(_0x2d5ffa,_0xdc9750){_0xdc9750=_0xdc9750||0xc8;return function(_0x2c2ea2){if(_0x2c2ea2){return _0x2d5ffa[_0x0ac6('0x15')](_0xdc9750)[_0x0ac6('0x17')](_0x2c2ea2);}};}function respondWithFilteredResult(_0x21b2cc,_0x2f2cbc){return function(_0x4bd7de){if(_0x4bd7de){var _0x26eb8a=typeof _0x2f2cbc['offset']===_0x0ac6('0x18')&&typeof _0x2f2cbc['limit']===_0x0ac6('0x18');var _0x300226=_0x4bd7de[_0x0ac6('0x19')];var _0x194a2a=_0x26eb8a?0x0:_0x2f2cbc[_0x0ac6('0x1a')];var _0x1a392e=_0x26eb8a?_0x4bd7de[_0x0ac6('0x19')]:_0x2f2cbc[_0x0ac6('0x1a')]+_0x2f2cbc['limit'];var _0x511f2c;if(_0x1a392e>=_0x300226){_0x1a392e=_0x300226;_0x511f2c=0xc8;}else{_0x511f2c=0xce;}_0x21b2cc[_0x0ac6('0x15')](_0x511f2c);return _0x21b2cc[_0x0ac6('0x1b')](_0x0ac6('0x1c'),_0x194a2a+'-'+_0x1a392e+'/'+_0x300226)[_0x0ac6('0x17')](_0x4bd7de);}return null;};}function patchUpdates(_0x272047){return function(_0x22cccf){try{jsonpatch[_0x0ac6('0x1d')](_0x22cccf,_0x272047,!![]);}catch(_0x2f8481){return BPromise[_0x0ac6('0x1e')](_0x2f8481);}return _0x22cccf[_0x0ac6('0x1f')]();};}function saveUpdates(_0x840692,_0x4d8ad0){return function(_0x59e164){if(_0x59e164){return _0x59e164[_0x0ac6('0x20')](_0x840692)[_0x0ac6('0x21')](function(_0x59b01c){return _0x59b01c;});}return null;};}function removeEntity(_0x42af29,_0x3736f2){return function(_0xd81752){if(_0xd81752){return _0xd81752['destroy']()['then'](function(){_0x42af29[_0x0ac6('0x15')](0xcc)[_0x0ac6('0x16')]();});}};}function handleEntityNotFound(_0x491e33,_0x25c75d){return function(_0x3fff61){if(!_0x3fff61){_0x491e33['sendStatus'](0x194);}return _0x3fff61;};}function handleError(_0x29b258,_0x3c7ba0){_0x3c7ba0=_0x3c7ba0||0x1f4;return function(_0x5f2b1e){logger[_0x0ac6('0x22')](_0x5f2b1e['stack']);if(_0x5f2b1e[_0x0ac6('0x23')]){delete _0x5f2b1e[_0x0ac6('0x23')];}_0x29b258[_0x0ac6('0x15')](_0x3c7ba0)[_0x0ac6('0x24')](_0x5f2b1e);};}exports[_0x0ac6('0x25')]=function(_0x23cd3a,_0x37f9ef){var _0x2e562a={},_0x5a78f5={},_0x1631a2={'count':0x0,'rows':[]};var _0x248c0e=_[_0x0ac6('0x26')](db[_0x0ac6('0x27')]['rawAttributes'],function(_0x47ee17){return{'name':_0x47ee17[_0x0ac6('0x28')],'type':_0x47ee17['type'][_0x0ac6('0x29')]};});_0x5a78f5[_0x0ac6('0x2a')]=_[_0x0ac6('0x26')](_0x248c0e,_0x0ac6('0x23'));_0x5a78f5[_0x0ac6('0x2b')]=_[_0x0ac6('0x2c')](_0x23cd3a[_0x0ac6('0x2b')]);_0x5a78f5['filters']=_[_0x0ac6('0x2d')](_0x5a78f5[_0x0ac6('0x2a')],_0x5a78f5['query']);_0x2e562a[_0x0ac6('0x2e')]=_['intersection'](_0x5a78f5['model'],qs[_0x0ac6('0x2f')](_0x23cd3a['query'][_0x0ac6('0x2f')]));_0x2e562a[_0x0ac6('0x2e')]=_0x2e562a[_0x0ac6('0x2e')][_0x0ac6('0x30')]?_0x2e562a[_0x0ac6('0x2e')]:_0x5a78f5[_0x0ac6('0x2a')];if(!_0x23cd3a['query']['hasOwnProperty'](_0x0ac6('0x31'))){_0x2e562a[_0x0ac6('0x32')]=qs['limit'](_0x23cd3a[_0x0ac6('0x2b')][_0x0ac6('0x32')]);_0x2e562a[_0x0ac6('0x1a')]=qs[_0x0ac6('0x1a')](_0x23cd3a[_0x0ac6('0x2b')][_0x0ac6('0x1a')]);}_0x2e562a[_0x0ac6('0x33')]=qs[_0x0ac6('0x34')](_0x23cd3a['query'][_0x0ac6('0x34')]);_0x2e562a[_0x0ac6('0x35')]=qs[_0x0ac6('0x36')](_['pick'](_0x23cd3a['query'],_0x5a78f5[_0x0ac6('0x36')]),_0x248c0e);if(_0x23cd3a[_0x0ac6('0x2b')][_0x0ac6('0x37')]){_0x2e562a[_0x0ac6('0x35')]=_[_0x0ac6('0x38')](_0x2e562a[_0x0ac6('0x35')],{'$or':_[_0x0ac6('0x26')](_0x248c0e,function(_0x37600d){if(_0x37600d[_0x0ac6('0x39')]!==_0x0ac6('0x3a')){var _0x2d55fb={};_0x2d55fb[_0x37600d['name']]={'$like':'%'+_0x23cd3a[_0x0ac6('0x2b')][_0x0ac6('0x37')]+'%'};return _0x2d55fb;}})});}_0x2e562a=_[_0x0ac6('0x38')]({},_0x2e562a,_0x23cd3a[_0x0ac6('0x3b')]);var _0x582ca9={'where':_0x2e562a[_0x0ac6('0x35')]};return db['WhatsappTransferReport'][_0x0ac6('0x19')](_0x582ca9)['then'](function(_0x3479dd){_0x1631a2[_0x0ac6('0x19')]=_0x3479dd;if(_0x23cd3a[_0x0ac6('0x2b')][_0x0ac6('0x3c')]){_0x2e562a[_0x0ac6('0x3d')]=[{'all':!![]}];}return db[_0x0ac6('0x27')][_0x0ac6('0x3e')](_0x2e562a);})[_0x0ac6('0x21')](function(_0x450906){_0x1631a2['rows']=_0x450906;return _0x1631a2;})[_0x0ac6('0x21')](respondWithFilteredResult(_0x37f9ef,_0x2e562a))[_0x0ac6('0x3f')](handleError(_0x37f9ef,null));};exports[_0x0ac6('0x40')]=function(_0x5c1018,_0xe3cbc){var _0x291a10={'raw':!![],'where':{'id':_0x5c1018[_0x0ac6('0x41')]['id']}},_0x3631b4={};_0x3631b4[_0x0ac6('0x2a')]=_[_0x0ac6('0x2c')](db[_0x0ac6('0x27')][_0x0ac6('0x42')]);_0x3631b4[_0x0ac6('0x2b')]=_[_0x0ac6('0x2c')](_0x5c1018['query']);_0x3631b4[_0x0ac6('0x36')]=_['intersection'](_0x3631b4['model'],_0x3631b4[_0x0ac6('0x2b')]);_0x291a10['attributes']=_[_0x0ac6('0x2d')](_0x3631b4['model'],qs[_0x0ac6('0x2f')](_0x5c1018[_0x0ac6('0x2b')]['fields']));_0x291a10[_0x0ac6('0x2e')]=_0x291a10[_0x0ac6('0x2e')]['length']?_0x291a10[_0x0ac6('0x2e')]:_0x3631b4[_0x0ac6('0x2a')];if(_0x5c1018[_0x0ac6('0x2b')][_0x0ac6('0x3c')]){_0x291a10[_0x0ac6('0x3d')]=[{'all':!![]}];}_0x291a10=_[_0x0ac6('0x38')]({},_0x291a10,_0x5c1018[_0x0ac6('0x3b')]);return db[_0x0ac6('0x27')]['find'](_0x291a10)[_0x0ac6('0x21')](handleEntityNotFound(_0xe3cbc,null))[_0x0ac6('0x21')](respondWithResult(_0xe3cbc,null))[_0x0ac6('0x3f')](handleError(_0xe3cbc,null));};exports['create']=function(_0x62b40b,_0x45046e){return db[_0x0ac6('0x27')][_0x0ac6('0x43')](_0x62b40b['body'],{})[_0x0ac6('0x21')](respondWithResult(_0x45046e,0xc9))[_0x0ac6('0x3f')](handleError(_0x45046e,null));};exports[_0x0ac6('0x20')]=function(_0x58296b,_0x1308c7){if(_0x58296b[_0x0ac6('0x44')]['id']){delete _0x58296b[_0x0ac6('0x44')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x58296b[_0x0ac6('0x41')]['id']}})[_0x0ac6('0x21')](handleEntityNotFound(_0x1308c7,null))[_0x0ac6('0x21')](saveUpdates(_0x58296b[_0x0ac6('0x44')],null))['then'](respondWithResult(_0x1308c7,null))[_0x0ac6('0x3f')](handleError(_0x1308c7,null));};exports[_0x0ac6('0x45')]=function(_0x134416,_0x5a868e){return db[_0x0ac6('0x27')][_0x0ac6('0x46')]({'where':{'id':_0x134416['params']['id']}})[_0x0ac6('0x21')](handleEntityNotFound(_0x5a868e,null))[_0x0ac6('0x21')](removeEntity(_0x5a868e,null))[_0x0ac6('0x3f')](handleError(_0x5a868e,null));};exports[_0x0ac6('0x47')]=function(_0x7c2a7a,_0x5ef6ad){return db[_0x0ac6('0x27')][_0x0ac6('0x47')]()['then'](respondWithResult(_0x5ef6ad,null))[_0x0ac6('0x3f')](handleError(_0x5ef6ad,null));}; \ No newline at end of file +var _0xfc31=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','params','intersection','create','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2574ba,_0x21aeba){var _0x224c6d=function(_0x11a534){while(--_0x11a534){_0x2574ba['push'](_0x2574ba['shift']());}};_0x224c6d(++_0x21aeba);}(_0xfc31,0x121));var _0x1fc3=function(_0x1365bf,_0x3e2106){_0x1365bf=_0x1365bf-0x0;var _0x413881=_0xfc31[_0x1365bf];return _0x413881;};'use strict';var emlformat=require(_0x1fc3('0x0'));var rimraf=require(_0x1fc3('0x1'));var zipdir=require(_0x1fc3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fc3('0x3'));var moment=require('moment');var BPromise=require(_0x1fc3('0x4'));var Mustache=require('mustache');var util=require(_0x1fc3('0x5'));var path=require('path');var sox=require(_0x1fc3('0x6'));var csv=require(_0x1fc3('0x7'));var ejs=require(_0x1fc3('0x8'));var fs=require('fs');var fs_extra=require(_0x1fc3('0x9'));var _=require(_0x1fc3('0xa'));var squel=require(_0x1fc3('0xb'));var crypto=require(_0x1fc3('0xc'));var jsforce=require(_0x1fc3('0xd'));var deskjs=require(_0x1fc3('0xe'));var toCsv=require(_0x1fc3('0x7'));var querystring=require(_0x1fc3('0xf'));var Papa=require(_0x1fc3('0x10'));var Redis=require(_0x1fc3('0x11'));var authService=require(_0x1fc3('0x12'));var qs=require(_0x1fc3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fc3('0x14'));var logger=require(_0x1fc3('0x15'))(_0x1fc3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1fc3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc62b43,_0x3c92d9){_0x3c92d9=_0x3c92d9||0xcc;return function(_0x3571ba){if(_0x3571ba){return _0xc62b43[_0x1fc3('0x18')](_0x3c92d9);}return _0xc62b43['status'](_0x3c92d9)['end']();};}function respondWithResult(_0x4aaf6d,_0x5d4d51){_0x5d4d51=_0x5d4d51||0xc8;return function(_0x46f04d){if(_0x46f04d){return _0x4aaf6d[_0x1fc3('0x19')](_0x5d4d51)[_0x1fc3('0x1a')](_0x46f04d);}};}function respondWithFilteredResult(_0x26349e,_0x95f1c0){return function(_0x51fc07){if(_0x51fc07){var _0x180650=typeof _0x95f1c0[_0x1fc3('0x1b')]===_0x1fc3('0x1c')&&typeof _0x95f1c0['limit']===_0x1fc3('0x1c');var _0x510058=_0x51fc07[_0x1fc3('0x1d')];var _0x27aaec=_0x180650?0x0:_0x95f1c0[_0x1fc3('0x1b')];var _0x79a674=_0x180650?_0x51fc07[_0x1fc3('0x1d')]:_0x95f1c0[_0x1fc3('0x1b')]+_0x95f1c0[_0x1fc3('0x1e')];var _0x3a426d;if(_0x79a674>=_0x510058){_0x79a674=_0x510058;_0x3a426d=0xc8;}else{_0x3a426d=0xce;}_0x26349e['status'](_0x3a426d);return _0x26349e[_0x1fc3('0x1f')](_0x1fc3('0x20'),_0x27aaec+'-'+_0x79a674+'/'+_0x510058)[_0x1fc3('0x1a')](_0x51fc07);}return null;};}function patchUpdates(_0x4107a4){return function(_0x523a22){try{jsonpatch[_0x1fc3('0x21')](_0x523a22,_0x4107a4,!![]);}catch(_0x53cad9){return BPromise[_0x1fc3('0x22')](_0x53cad9);}return _0x523a22[_0x1fc3('0x23')]();};}function saveUpdates(_0x3aa38d,_0x4b4608){return function(_0x208895){if(_0x208895){return _0x208895[_0x1fc3('0x24')](_0x3aa38d)['then'](function(_0x4b9c08){return _0x4b9c08;});}return null;};}function removeEntity(_0x5ae6e9,_0x46d5cb){return function(_0x25cf54){if(_0x25cf54){return _0x25cf54[_0x1fc3('0x25')]()[_0x1fc3('0x26')](function(){_0x5ae6e9[_0x1fc3('0x19')](0xcc)[_0x1fc3('0x27')]();});}};}function handleEntityNotFound(_0x1d1eb9,_0x4ef83e){return function(_0x591b7f){if(!_0x591b7f){_0x1d1eb9[_0x1fc3('0x18')](0x194);}return _0x591b7f;};}function handleError(_0x4cb69d,_0x5c4334){_0x5c4334=_0x5c4334||0x1f4;return function(_0x266aa7){logger[_0x1fc3('0x28')](_0x266aa7[_0x1fc3('0x29')]);if(_0x266aa7[_0x1fc3('0x2a')]){delete _0x266aa7[_0x1fc3('0x2a')];}_0x4cb69d[_0x1fc3('0x19')](_0x5c4334)[_0x1fc3('0x2b')](_0x266aa7);};}exports[_0x1fc3('0x2c')]=function(_0xb6d0bf,_0x1eaf3a){var _0x283788={},_0x31a7c9={},_0x4121df={'count':0x0,'rows':[]};var _0x448b65=_[_0x1fc3('0x2d')](db['WhatsappTransferReport'][_0x1fc3('0x2e')],function(_0x475430){return{'name':_0x475430[_0x1fc3('0x2f')],'type':_0x475430['type'][_0x1fc3('0x30')]};});_0x31a7c9['model']=_['map'](_0x448b65,'name');_0x31a7c9[_0x1fc3('0x31')]=_[_0x1fc3('0x32')](_0xb6d0bf[_0x1fc3('0x31')]);_0x31a7c9[_0x1fc3('0x33')]=_['intersection'](_0x31a7c9[_0x1fc3('0x34')],_0x31a7c9[_0x1fc3('0x31')]);_0x283788[_0x1fc3('0x35')]=_['intersection'](_0x31a7c9[_0x1fc3('0x34')],qs[_0x1fc3('0x36')](_0xb6d0bf[_0x1fc3('0x31')][_0x1fc3('0x36')]));_0x283788[_0x1fc3('0x35')]=_0x283788[_0x1fc3('0x35')][_0x1fc3('0x37')]?_0x283788['attributes']:_0x31a7c9[_0x1fc3('0x34')];if(!_0xb6d0bf[_0x1fc3('0x31')][_0x1fc3('0x38')](_0x1fc3('0x39'))){_0x283788['limit']=qs[_0x1fc3('0x1e')](_0xb6d0bf[_0x1fc3('0x31')]['limit']);_0x283788['offset']=qs[_0x1fc3('0x1b')](_0xb6d0bf['query'][_0x1fc3('0x1b')]);}_0x283788[_0x1fc3('0x3a')]=qs[_0x1fc3('0x3b')](_0xb6d0bf[_0x1fc3('0x31')][_0x1fc3('0x3b')]);_0x283788['where']=qs['filters'](_['pick'](_0xb6d0bf[_0x1fc3('0x31')],_0x31a7c9['filters']),_0x448b65);if(_0xb6d0bf['query'][_0x1fc3('0x3c')]){_0x283788[_0x1fc3('0x3d')]=_[_0x1fc3('0x3e')](_0x283788['where'],{'$or':_[_0x1fc3('0x2d')](_0x448b65,function(_0x23b798){if(_0x23b798[_0x1fc3('0x3f')]!==_0x1fc3('0x40')){var _0x43b704={};_0x43b704[_0x23b798['name']]={'$like':'%'+_0xb6d0bf['query'][_0x1fc3('0x3c')]+'%'};return _0x43b704;}})});}_0x283788=_[_0x1fc3('0x3e')]({},_0x283788,_0xb6d0bf[_0x1fc3('0x41')]);var _0x39c127={'where':_0x283788[_0x1fc3('0x3d')]};return db[_0x1fc3('0x42')][_0x1fc3('0x1d')](_0x39c127)['then'](function(_0x3f180d){_0x4121df[_0x1fc3('0x1d')]=_0x3f180d;if(_0xb6d0bf['query'][_0x1fc3('0x43')]){_0x283788[_0x1fc3('0x44')]=[{'all':!![]}];}return db[_0x1fc3('0x42')][_0x1fc3('0x45')](_0x283788);})['then'](function(_0x53d04b){_0x4121df[_0x1fc3('0x46')]=_0x53d04b;return _0x4121df;})[_0x1fc3('0x26')](respondWithFilteredResult(_0x1eaf3a,_0x283788))['catch'](handleError(_0x1eaf3a,null));};exports[_0x1fc3('0x47')]=function(_0x41edee,_0xf71435){var _0xa778c4={'raw':!![],'where':{'id':_0x41edee[_0x1fc3('0x48')]['id']}},_0x3c997b={};_0x3c997b[_0x1fc3('0x34')]=_['keys'](db['WhatsappTransferReport'][_0x1fc3('0x2e')]);_0x3c997b[_0x1fc3('0x31')]=_[_0x1fc3('0x32')](_0x41edee[_0x1fc3('0x31')]);_0x3c997b[_0x1fc3('0x33')]=_[_0x1fc3('0x49')](_0x3c997b['model'],_0x3c997b[_0x1fc3('0x31')]);_0xa778c4['attributes']=_[_0x1fc3('0x49')](_0x3c997b[_0x1fc3('0x34')],qs['fields'](_0x41edee['query'][_0x1fc3('0x36')]));_0xa778c4[_0x1fc3('0x35')]=_0xa778c4[_0x1fc3('0x35')][_0x1fc3('0x37')]?_0xa778c4[_0x1fc3('0x35')]:_0x3c997b[_0x1fc3('0x34')];if(_0x41edee[_0x1fc3('0x31')][_0x1fc3('0x43')]){_0xa778c4[_0x1fc3('0x44')]=[{'all':!![]}];}_0xa778c4=_[_0x1fc3('0x3e')]({},_0xa778c4,_0x41edee[_0x1fc3('0x41')]);return db[_0x1fc3('0x42')]['find'](_0xa778c4)['then'](handleEntityNotFound(_0xf71435,null))['then'](respondWithResult(_0xf71435,null))['catch'](handleError(_0xf71435,null));};exports['create']=function(_0x180d45,_0x590691){return db[_0x1fc3('0x42')][_0x1fc3('0x4a')](_0x180d45[_0x1fc3('0x4b')],{})['then'](respondWithResult(_0x590691,0xc9))[_0x1fc3('0x4c')](handleError(_0x590691,null));};exports[_0x1fc3('0x24')]=function(_0x5b8dd7,_0x59c615){if(_0x5b8dd7[_0x1fc3('0x4b')]['id']){delete _0x5b8dd7[_0x1fc3('0x4b')]['id'];}return db[_0x1fc3('0x42')]['find']({'where':{'id':_0x5b8dd7[_0x1fc3('0x48')]['id']}})[_0x1fc3('0x26')](handleEntityNotFound(_0x59c615,null))[_0x1fc3('0x26')](saveUpdates(_0x5b8dd7[_0x1fc3('0x4b')],null))['then'](respondWithResult(_0x59c615,null))[_0x1fc3('0x4c')](handleError(_0x59c615,null));};exports[_0x1fc3('0x25')]=function(_0x3255f8,_0x284e9d){return db[_0x1fc3('0x42')]['find']({'where':{'id':_0x3255f8[_0x1fc3('0x48')]['id']}})[_0x1fc3('0x26')](handleEntityNotFound(_0x284e9d,null))['then'](removeEntity(_0x284e9d,null))[_0x1fc3('0x4c')](handleError(_0x284e9d,null));};exports['describe']=function(_0x9baac1,_0x506c55){return db['WhatsappTransferReport']['describe']()[_0x1fc3('0x26')](respondWithResult(_0x506c55,null))['catch'](handleError(_0x506c55,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 8552064..b3a31ea 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 _0x30e9=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0xdc638c,_0x1f0d9d){var _0x1d502e=function(_0x57f44d){while(--_0x57f44d){_0xdc638c['push'](_0xdc638c['shift']());}};_0x1d502e(++_0x1f0d9d);}(_0x30e9,0x194));var _0x930e=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x30e9[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x930e('0x0'));var util=require(_0x930e('0x1'));var logger=require(_0x930e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x930e('0x3'));var rp=require(_0x930e('0x4'));var fs=require('fs');var path=require(_0x930e('0x5'));var rimraf=require(_0x930e('0x6'));var config=require(_0x930e('0x7'));var attributes=require(_0x930e('0x8'));module[_0x930e('0x9')]=function(_0x53e26f,_0x4e4db6){return _0x53e26f[_0x930e('0xa')](_0x930e('0xb'),attributes,{'tableName':_0x930e('0xc'),'paranoid':![],'indexes':[{'name':_0x930e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b64=['uniqueid','lodash','util','api','moment','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x22ec1,_0xf71119){var _0x33a9e2=function(_0x44e100){while(--_0x44e100){_0x22ec1['push'](_0x22ec1['shift']());}};_0x33a9e2(++_0xf71119);}(_0x1b64,0x187));var _0x41b6=function(_0x45a89d,_0x1992d4){_0x45a89d=_0x45a89d-0x0;var _0x3fd181=_0x1b64[_0x45a89d];return _0x3fd181;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var logger=require('../../config/logger')(_0x41b6('0x2'));var moment=require(_0x41b6('0x3'));var BPromise=require('bluebird');var rp=require(_0x41b6('0x4'));var fs=require('fs');var path=require(_0x41b6('0x5'));var rimraf=require('rimraf');var config=require(_0x41b6('0x6'));var attributes=require(_0x41b6('0x7'));module[_0x41b6('0x8')]=function(_0xc5f032,_0x279176){return _0xc5f032[_0x41b6('0x9')](_0x41b6('0xa'),attributes,{'tableName':_0x41b6('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x41b6('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 4bfd5e5..1f2c2b4 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 _0x5aa7=['client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2e93fa,_0x581ce2){var _0x2287b2=function(_0x114d80){while(--_0x114d80){_0x2e93fa['push'](_0x2e93fa['shift']());}};_0x2287b2(++_0x581ce2);}(_0x5aa7,0xcc));var _0x75aa=function(_0x2c9492,_0x6cf357){_0x2c9492=_0x2c9492-0x0;var _0x38dec6=_0x5aa7[_0x2c9492];return _0x38dec6;};'use strict';var _=require('lodash');var util=require(_0x75aa('0x0'));var moment=require('moment');var BPromise=require(_0x75aa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75aa('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x75aa('0x3'));var logger=require(_0x75aa('0x4'))(_0x75aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x75aa('0x6')][_0x75aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2103f7,_0x4a0f2f,_0x167ac4){return new BPromise(function(_0xe5eafc,_0x5e3128){return client[_0x75aa('0x8')](_0x2103f7,_0x167ac4)[_0x75aa('0x9')](function(_0x5506ae){logger[_0x75aa('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4a0f2f,'request\x20sent');logger[_0x75aa('0xb')](_0x75aa('0xc'),_0x4a0f2f,_0x75aa('0xd'),JSON[_0x75aa('0xe')](_0x5506ae));if(_0x5506ae[_0x75aa('0xf')]){if(_0x5506ae['error'][_0x75aa('0x10')]===0x1f4){logger['error'](_0x75aa('0x11'),_0x4a0f2f,_0x5506ae[_0x75aa('0xf')][_0x75aa('0x12')]);return _0x5e3128(_0x5506ae['error'][_0x75aa('0x12')]);}logger[_0x75aa('0xf')](_0x75aa('0x11'),_0x4a0f2f,_0x5506ae[_0x75aa('0xf')][_0x75aa('0x12')]);return _0xe5eafc(_0x5506ae[_0x75aa('0xf')]['message']);}else{logger[_0x75aa('0xa')](_0x75aa('0x11'),_0x4a0f2f,_0x75aa('0xd'));_0xe5eafc(_0x5506ae[_0x75aa('0x13')][_0x75aa('0x12')]);}})[_0x75aa('0x14')](function(_0xf298b0){logger['error'](_0x75aa('0x11'),_0x4a0f2f,_0xf298b0);_0x5e3128(_0xf298b0);});});} \ No newline at end of file +var _0xfd9c=['../../config/logger','../../config/environment','jayson/promise','client','http','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xfd9c,0x18a));var _0xcfd9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xfd9c[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xcfd9('0x0'));var util=require(_0xcfd9('0x1'));var moment=require('moment');var BPromise=require(_0xcfd9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfd9('0x3'))['db'];var utils=require(_0xcfd9('0x4'));var logger=require(_0xcfd9('0x5'))('rpc');var config=require(_0xcfd9('0x6'));var jayson=require(_0xcfd9('0x7'));var client=jayson[_0xcfd9('0x8')][_0xcfd9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5719e2,_0x1923dd,_0x216f15){return new BPromise(function(_0x5274fe,_0x1ee16e){return client['request'](_0x5719e2,_0x216f15)['then'](function(_0x1c9ce6){logger['info'](_0xcfd9('0xa'),_0x1923dd,_0xcfd9('0xb'));logger[_0xcfd9('0xc')](_0xcfd9('0xd'),_0x1923dd,_0xcfd9('0xb'),JSON[_0xcfd9('0xe')](_0x1c9ce6));if(_0x1c9ce6[_0xcfd9('0xf')]){if(_0x1c9ce6['error'][_0xcfd9('0x10')]===0x1f4){logger[_0xcfd9('0xf')](_0xcfd9('0xa'),_0x1923dd,_0x1c9ce6[_0xcfd9('0xf')][_0xcfd9('0x11')]);return _0x1ee16e(_0x1c9ce6[_0xcfd9('0xf')][_0xcfd9('0x11')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x1923dd,_0x1c9ce6['error'][_0xcfd9('0x11')]);return _0x5274fe(_0x1c9ce6[_0xcfd9('0xf')][_0xcfd9('0x11')]);}else{logger[_0xcfd9('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1923dd,'request\x20sent');_0x5274fe(_0x1c9ce6[_0xcfd9('0x13')][_0xcfd9('0x11')]);}})[_0xcfd9('0x14')](function(_0x2465fe){logger[_0xcfd9('0xf')](_0xcfd9('0xa'),_0x1923dd,_0x2465fe);_0x1ee16e(_0x2465fe);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 85ba4a3..83d0d28 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46cb=['./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','online','join','Offline\x20apps:','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/license','./rpc'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0x46cb,0xd6));var _0xb46c=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x46cb[_0x2db12b];return _0x20990b;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xb46c('0x0'));var rpc=require(_0xb46c('0x1'));var config=require(_0xb46c('0x2'));var logger=require(_0xb46c('0x3'))(_0xb46c('0x4'));var pm2=require(_0xb46c('0x5'));var pm2Config=require(_0xb46c('0x6'));var schedule=require(_0xb46c('0x7'));var chat=require(_0xb46c('0x8'));var whatsapp=require(_0xb46c('0x9'));var transcribe=require(_0xb46c('0xa'));var provider=require(_0xb46c('0xb'));function main(){return db[_0xb46c('0xc')][_0xb46c('0xd')]()['then'](function(){if(config[_0xb46c('0xe')]){return seedDb[_0xb46c('0xf')]();}})[_0xb46c('0x10')](function(){return checkLicense[_0xb46c('0xf')]();})[_0xb46c('0x10')](function(){return rpc['listen']();})['then'](function(_0x5ddc29){logger[_0xb46c('0x11')](_0x5ddc29);return chat[_0xb46c('0x12')]();})[_0xb46c('0x10')](function(){return whatsapp[_0xb46c('0x12')]();})[_0xb46c('0x10')](function(){return schedule[_0xb46c('0x12')]();})['then'](function(){return transcribe[_0xb46c('0x12')]();})['then'](function(){return provider[_0xb46c('0x12')]();})[_0xb46c('0x10')](function(_0x5603b1){logger[_0xb46c('0x11')](_0x5603b1);return pm2[_0xb46c('0x12')](pm2Config);})[_0xb46c('0x10')](function(_0x5246b4){var _0xbed789=_0x5246b4[_0xb46c('0x13')](function(_0x4ee554){return typeof _0x4ee554[_0xb46c('0x14')]===_0xb46c('0x15')&&_0x4ee554[_0xb46c('0x14')]>=0x0;});if(_0xbed789[_0xb46c('0x16')]>0x0){throw new Error(_0xbed789[_0xb46c('0x16')]+_0xb46c('0x17')+_[_0xb46c('0x18')](_0xbed789,function(_0x1c8e0b){return'\x22'+_0x1c8e0b['pm2_env'][_0xb46c('0x19')]+'\x22';}));}logger[_0xb46c('0x11')](_0xb46c('0x1a'),_[_0xb46c('0x18')](_['filter'](_0x5246b4,{'status':_0xb46c('0x1b')}),'name')[_0xb46c('0x1c')]());logger[_0xb46c('0x11')](_0xb46c('0x1d'),_['map'](_[_0xb46c('0x13')](_0x5246b4,function(_0x113da5){return _0x113da5['status']!=='online';}),_0xb46c('0x19'))['join']()||'None');console[_0xb46c('0x1e')](_0xb46c('0x1f'));})[_0xb46c('0x20')](function(_0x7a09e6){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x7a09e6);logger[_0xb46c('0x21')](_0xb46c('0x22'),_0x7a09e6);process[_0xb46c('0x23')](0x1);});}main(); \ No newline at end of file +var _0xdbbe=['Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','online','info','Offline\x20apps:','status','join','None','App\x20Ready!','catch'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xdbbe,0x148));var _0xedbb=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0xdbbe[_0xb65e77];return _0x38134b;};'use strict';var _=require('lodash');var db=require(_0xedbb('0x0'))['db'];var seedDb=require(_0xedbb('0x1'));var checkLicense=require(_0xedbb('0x2'));var rpc=require(_0xedbb('0x3'));var config=require(_0xedbb('0x4'));var logger=require(_0xedbb('0x5'))('app');var pm2=require(_0xedbb('0x6'));var pm2Config=require(_0xedbb('0x7'));var schedule=require(_0xedbb('0x8'));var chat=require(_0xedbb('0x9'));var whatsapp=require(_0xedbb('0xa'));var transcribe=require(_0xedbb('0xb'));var provider=require(_0xedbb('0xc'));function main(){return db['sequelize'][_0xedbb('0xd')]()[_0xedbb('0xe')](function(){if(config['seedDB']){return seedDb[_0xedbb('0xf')]();}})['then'](function(){return checkLicense[_0xedbb('0xf')]();})[_0xedbb('0xe')](function(){return rpc[_0xedbb('0x10')]();})['then'](function(_0x7744b1){logger['info'](_0x7744b1);return chat[_0xedbb('0x11')]();})[_0xedbb('0xe')](function(){return whatsapp[_0xedbb('0x11')]();})[_0xedbb('0xe')](function(){return schedule['start']();})[_0xedbb('0xe')](function(){return transcribe[_0xedbb('0x11')]();})[_0xedbb('0xe')](function(){return provider[_0xedbb('0x11')]();})[_0xedbb('0xe')](function(_0x36f274){logger['info'](_0x36f274);return pm2[_0xedbb('0x11')](pm2Config);})[_0xedbb('0xe')](function(_0x22e02b){var _0x1851db=_0x22e02b[_0xedbb('0x12')](function(_0x3612d8){return typeof _0x3612d8['exitCode']==='number'&&_0x3612d8[_0xedbb('0x13')]>=0x0;});if(_0x1851db[_0xedbb('0x14')]>0x0){throw new Error(_0x1851db['length']+_0xedbb('0x15')+_[_0xedbb('0x16')](_0x1851db,function(_0x93dbc7){return'\x22'+_0x93dbc7['pm2_env'][_0xedbb('0x17')]+'\x22';}));}logger['info']('Online\x20apps:',_['map'](_['filter'](_0x22e02b,{'status':_0xedbb('0x18')}),'name')['join']());logger[_0xedbb('0x19')](_0xedbb('0x1a'),_[_0xedbb('0x16')](_[_0xedbb('0x12')](_0x22e02b,function(_0x92851f){return _0x92851f[_0xedbb('0x1b')]!=='online';}),_0xedbb('0x17'))[_0xedbb('0x1c')]()||_0xedbb('0x1d'));console['log'](_0xedbb('0x1e'));})[_0xedbb('0x1f')](function(_0x2c7569){console['log'](_0xedbb('0x20'),_0x2c7569);logger[_0xedbb('0x21')](_0xedbb('0x22'),_0x2c7569);process[_0xedbb('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 02545b7..ff750d0 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 _0x3e74=['util','moment','session','role','fullname','name','internal','userpic','voicePause','chatPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','then','disposition','unmanaged','json','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','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.','length','join','promisify','secret','secrets','payload','options','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','basic-auth','crypto','bluebird'];(function(_0x3e08ee,_0x4492a9){var _0x94cf49=function(_0x57a821){while(--_0x57a821){_0x3e08ee['push'](_0x3e08ee['shift']());}};_0x94cf49(++_0x4492a9);}(_0x3e74,0x175));var _0x43e7=function(_0x14b5e6,_0x50bd05){_0x14b5e6=_0x14b5e6-0x0;var _0x3a8961=_0x3e74[_0x14b5e6];return _0x3a8961;};'use strict';var db=require(_0x43e7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x43e7('0x1'));var licenseUtil=require(_0x43e7('0x2'));var encryptor=require(_0x43e7('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x43e7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x43e7('0x5'));var crypto=require(_0x43e7('0x6'));var BPromise=require(_0x43e7('0x7'));var util=require(_0x43e7('0x8'));var moment=require(_0x43e7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x43e7('0xa')]});var userAttributes=['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd'),_0x43e7('0xe'),'email',_0x43e7('0xf'),'permissions','md5secret',_0x43e7('0x10'),_0x43e7('0x11'),'mailPause',_0x43e7('0x12'),'smsPause',_0x43e7('0x13'),_0x43e7('0x14'),'showWebBar',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),'passwordResetAt','alias',_0x43e7('0x19'),_0x43e7('0x1a'),_0x43e7('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x43e7('0x1c'),_0x43e7('0x1d'),_0x43e7('0x1e'),_0x43e7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x43e7('0x20'),_0x43e7('0x21'),_0x43e7('0x22'),'settingsEnabled','wssPort',_0x43e7('0x23'),_0x43e7('0x24'),_0x43e7('0x25'),_0x43e7('0x26'),_0x43e7('0x27'),_0x43e7('0x28'),_0x43e7('0x29'),_0x43e7('0x2a'),_0x43e7('0x2b'),_0x43e7('0x2c'),_0x43e7('0x2d'),_0x43e7('0x2e'),'openchannelAutoanswerDelay',_0x43e7('0x2f'),_0x43e7('0x30'),'whatsappAutoanswer',_0x43e7('0x31')];exports[_0x43e7('0x32')]=function(){return this[_0x43e7('0x33')](!![])[_0x43e7('0x34')](function(_0x4077fb,_0x2f4cb4,_0x54a9e7){if(_0x4077fb[_0x43e7('0x35')]){_0x54a9e7();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4077fb[_0x43e7('0x36')]['id']},'attributes':['id',_0x43e7('0x37'),'disposition'],'raw':!![]})[_0x43e7('0x38')](function(_0x4ca5cf){if(_0x4ca5cf&&_0x4ca5cf[_0x43e7('0x37')]){return _0x2f4cb4['status'](_0x4ca5cf[_0x43e7('0x39')]===_0x43e7('0x3a')?0x195:0x193)[_0x43e7('0x3b')]({'message':_0x4ca5cf[_0x43e7('0x39')]==='unmanaged'?'Unmanaged.':_0x43e7('0x3c')});}else{_0x54a9e7();}})['catch'](function(_0x2dd5f){_0x54a9e7(_0x2dd5f);});}});};exports[_0x43e7('0x33')]=function isAuthenticated(_0x3565cf){return compose()[_0x43e7('0x34')](function(_0x5087d7,_0x33a1a5,_0x4690a6){var _0x45b675;if(_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')]){if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')][_0x43e7('0x3e')],_0x43e7('0x40'))){var _0x35dbcd=basicAuth(_0x5087d7);db[_0x43e7('0x41')][_0x43e7('0x42')]({'where':{'name':_0x35dbcd[_0x43e7('0xd')]}})[_0x43e7('0x38')](function(_0x4bdb17){if(!_0x4bdb17||!_0x4bdb17[_0x43e7('0x43')](_0x35dbcd[_0x43e7('0x44')])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x46')});}_0x5087d7['user']={'id':_0x4bdb17['id']};_0x4690a6();})[_0x43e7('0x47')](function(_0x49b83d){_0x4690a6(_0x49b83d);});}else if(_[_0x43e7('0x3f')](_0x5087d7[_0x43e7('0x3d')]['authorization'],'Bearer')){validateJwt(_0x5087d7,_0x33a1a5,_0x4690a6);}else{if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5['status'](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x48')});}}}else if(_0x5087d7[_0x43e7('0x49')][_0x43e7('0x4a')]){try{var _0x108313={'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5087d7['query']['apikey'],_0x108313)['then'](function(_0x4e8e86){return db['User']['find']({'where':{'id':_0x4e8e86[_0x43e7('0x4c')]}})['then'](function(_0x2b4bfd){_0x45b675=_0x2b4bfd;return db[_0x43e7('0x4d')][_0x43e7('0x4e')]({'where':{'id':0x1},'attributes':[_0x43e7('0x4f'),_0x43e7('0x50')],'raw':!![]});})[_0x43e7('0x38')](function(_0x101d45){if(!_0x45b675||!_['isEqual'](_0x45b675['apiKeyNonce'],_0x4e8e86['nonce'])){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x51')});}if(_0x45b675[_0x43e7('0x52')]){return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}if(_0x45b675[_0x43e7('0x54')]){if(_0x101d45['blockDuration']>0x0){if(moment(_0x45b675[_0x43e7('0x55')])[_0x43e7('0x56')](_0x101d45['blockDuration'],_0x43e7('0x57'))>moment()){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}else{return _0x33a1a5[_0x43e7('0x45')](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});}}_0x5087d7[_0x43e7('0x35')]={'id':_0x45b675['id']};_0x4690a6();});})['catch'](function(){return _0x33a1a5['status'](0x191)[_0x43e7('0x3b')]({'message':_0x43e7('0x53')});});}catch(_0x44b6ae){_0x4690a6(_0x44b6ae);}}else if(_0x3565cf){_0x4690a6();}else{return _0x33a1a5[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':'Unknown\x20authorization\x20format'});}})[_0x43e7('0x34')](function(_0x4227c4,_0x575439,_0x3628e0){if(_0x4227c4['user']){db[_0x43e7('0x41')]['find']({'where':{'id':_0x4227c4[_0x43e7('0x35')]['id']},'attributes':userAttributes})[_0x43e7('0x38')](function(_0x3a5807){if(!_0x3a5807){return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x4227c4[_0x43e7('0x35')]=_0x3a5807;_0x3628e0();})[_0x43e7('0x47')](function(_0xe979b5){_0x3628e0(_0xe979b5);});}else if(_0x3565cf){_0x3628e0();}else{return _0x575439[_0x43e7('0x45')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x43e7('0x34')](function(_0x57f5d0,_0x2ab022,_0x4b3a59){return licenseUtil['getLicense']()[_0x43e7('0x38')](function(_0x5ee1c5){if(_0x5ee1c5[_0x43e7('0x58')]){_0x4b3a59();}else{return _0x2ab022[_0x43e7('0x45')](0x193)[_0x43e7('0x3b')]({'message':_0x43e7('0x59')});}})['catch'](function(_0x91f1e4){_0x4b3a59(_0x91f1e4);});});};exports[_0x43e7('0x5a')]=function isWebrtcLicence(){return compose()[_0x43e7('0x34')](function(_0x1fd277,_0x296dc8,_0x1efe59){return licenseUtil['getLicense']()['then'](function(_0x3bc9de){if(_0x3bc9de[_0x43e7('0x5b')]){_0x1efe59();}else{return _0x296dc8[_0x43e7('0x45')](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x292ded){_0x1efe59(_0x292ded);});});};exports[_0x43e7('0x5c')]=function(_0x52b098,_0x351ca2,_0x47686e){_0x52b098[_0x43e7('0x5c')]=!![];return _0x47686e();};exports['signToken']=function signToken(_0x593155){return signJwt(_0x593155);};exports['setTokenCookie']=function(_0x4de644,_0x214e7e){if(!_0x4de644[_0x43e7('0x35')]){return _0x214e7e['status'](0x194)[_0x43e7('0x3b')]({'message':_0x43e7('0x5d')});}var _0x426bcb={'payload':{'id':_0x4de644[_0x43e7('0x35')]['id'],'role':_0x4de644['user'][_0x43e7('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x426bcb)['then'](function(_0x4bebd4){_0x214e7e[_0x43e7('0x5e')](_0x43e7('0x5f'),_0x4bebd4);_0x214e7e[_0x43e7('0x60')](_0x43e7('0x61'));})[_0x43e7('0x47')](function(_0x2351cf){return _0x214e7e[_0x43e7('0x45')](0x1f4)[_0x43e7('0x62')](_0x2351cf);});};exports[_0x43e7('0x63')]=function(_0x2b5515){if(_['isNil'](_0x2b5515[_0x43e7('0x64')])||_[_0x43e7('0x65')](_0x2b5515['apiKeyIat'])){return null;}else{return createJwt(_0x2b5515);}};exports[_0x43e7('0x66')]=function(_0x4e6f6d){_0x4e6f6d[_0x43e7('0x64')]=generateNonce();_0x4e6f6d[_0x43e7('0x67')]=generateIssuedAt();return createJwt(_0x4e6f6d);};exports[_0x43e7('0x68')]=function(_0x1f561f,_0xfe13fa){var _0x5e5556=_0x1f561f['query'][_0x43e7('0x4a')];if(_0x5e5556){var _0x2ab7ee={'nonce':_0xfe13fa[_0x43e7('0x64')],'iat':_0xfe13fa[_0x43e7('0x67')],'audience':hardwareConf[_0x43e7('0x4b')](),'issuer':hardwareConf[_0x43e7('0x4b')]()};return verifyJwt(_0x5e5556,_0x2ab7ee)[_0x43e7('0x38')](function(){return generateApiKey(_0xfe13fa);});}else{throw{'message':_0x43e7('0x69')};}};exports[_0x43e7('0x6a')]=function(_0x24e758){var _0x312306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x312306['test'](_0x24e758))throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x43e7('0x6d')]=function(_0x220bf2,_0x2d0052,_0x558d54){var _0x5d63c6=encryptor[_0x43e7('0x6e')](_0x2d0052)[_0x43e7('0x6f')](',');for(var _0x4ebdde=0x0;_0x4ebdde<_0x558d54;_0x4ebdde++){if(!_0x5d63c6[_0x4ebdde])break;if(_0x220bf2[_0x43e7('0x70')]()===_0x5d63c6[_0x4ebdde]['toLowerCase']()){var _0x49a6ce=util[_0x43e7('0x71')](_0x43e7('0x72'),_0x558d54);if(_0x558d54===0x1){_0x49a6ce=_0x43e7('0x73');}throw new db[(_0x43e7('0x6b'))][(_0x43e7('0x6c'))](_0x49a6ce);}}return;};exports['updatePasswordsHistory']=function(_0xc3976,_0xdb9fbe){var _0x4d89bd=_0xdb9fbe?encryptor[_0x43e7('0x6e')](_0xdb9fbe)[_0x43e7('0x6f')](','):[];if(_0x4d89bd[_0x43e7('0x74')]===0x5){_0x4d89bd['splice'](-0x1,0x1);}_0x4d89bd['unshift'](_0xc3976);return encryptor['encryptString'](_0x4d89bd[_0x43e7('0x75')](','));};function signJwt(_0x4058ce){var _0x323cf7=BPromise[_0x43e7('0x76')](jwt['sign'],{'context':jwt});var _0x5a50fc=_0x4058ce[_0x43e7('0x77')]||config[_0x43e7('0x78')][_0x43e7('0xa')];return new BPromise(function(_0x5dd349,_0x5ea0db){_0x323cf7(_0x4058ce[_0x43e7('0x79')],_0x5a50fc,_0x4058ce[_0x43e7('0x7a')])[_0x43e7('0x38')](function(_0x2a194d){_0x5dd349(_0x2a194d);})[_0x43e7('0x47')](function(_0xd41e79){_0x5ea0db(_0xd41e79);});});}function verifyJwt(_0x4665db,_0x46748f,_0x406155){var _0x381208=BPromise[_0x43e7('0x76')](jwt['verify'],{'context':jwt});var _0x5f3824=_0x406155||config[_0x43e7('0x78')]['session'];return new BPromise(function(_0x501616,_0x50edb2){_0x381208(_0x4665db,_0x5f3824,_0x46748f)[_0x43e7('0x38')](function(_0xe666b0){_0x501616(_0xe666b0);})['catch'](function(_0xfe5a8d){_0x50edb2(_0xfe5a8d);});});}function generateNonce(){return crypto[_0x43e7('0x7b')](0x10)[_0x43e7('0x7c')]('hex');}function generateIssuedAt(){return Math[_0x43e7('0x7d')](Date[_0x43e7('0x7e')]()/0x3e8)[_0x43e7('0x7c')]();}function createJwt(_0xc9723){var _0x2f43d7={'payload':{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723[_0x43e7('0x64')]},'options':{'algorithm':'HS512','subject':_0xc9723['id'][_0x43e7('0x7c')](),'issuer':hardwareConf[_0x43e7('0x4b')](),'audience':hardwareConf[_0x43e7('0x4b')]()}};return signJwt(_0x2f43d7)['then'](function(_0x56b06d){return{'iat':_0xc9723[_0x43e7('0x67')],'nonce':_0xc9723['apiKeyNonce'],'token':_0x56b06d};});} \ No newline at end of file +var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','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.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x3a4a06,_0x29d9b1){var _0x1a2f23=function(_0x1eff4e){while(--_0x1eff4e){_0x3a4a06['push'](_0x3a4a06['shift']());}};_0x1a2f23(++_0x29d9b1);}(_0xa41a,0x6b));var _0xaa41=function(_0x30fac3,_0x2c7867){_0x30fac3=_0x30fac3-0x0;var _0x1b46f9=_0xa41a[_0x30fac3];return _0x1b46f9;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 5ffcd32..f289b0e 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 _0x757a=['findOne','slice','fieldType','keys','type','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','clause','rows','catch','describe','startsWith','cf_','map','CmCustomField'];(function(_0x574b7f,_0x5a758e){var _0x3da1af=function(_0x4b382e){while(--_0x4b382e){_0x574b7f['push'](_0x574b7f['shift']());}};_0x3da1af(++_0x5a758e);}(_0x757a,0xde));var _0xa757=function(_0x3743c8,_0x434afe){_0x3743c8=_0x3743c8-0x0;var _0x12b556=_0x757a[_0x3743c8];return _0x12b556;};'use strict';var _=require('lodash');var sqlUtils=require(_0xa757('0x0'));var db=require(_0xa757('0x1'))['db'];exports['findAll']=function(_0x5c03c3,_0x5709ed,_0x32be3b,_0x1721c6){var _0x1c2932={'count':0x0,'rows':[]};var _0x453d07=sqlUtils[_0xa757('0x2')](_0x5709ed,_0x5c03c3);if(_0x453d07){return Promise[_0xa757('0x3')](_0x1c2932);}var _0x5edca8=sqlUtils[_0xa757('0x4')]();var _0x4343b6={};var _0x53be0e=![];var _0x2930fa=![];return Promise[_0xa757('0x3')]()[_0xa757('0x5')](function(){if(_0x5c03c3[_0xa757('0x6')]){return sqlUtils[_0xa757('0x7')](_0x5c03c3['search'],_0x1721c6);}else{return sqlUtils[_0xa757('0x8')](_0x5c03c3,_0x1721c6);}})[_0xa757('0x5')](function(_0x32f0ec){_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xa')]);_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xb')]);_0x5edca8['where'](_0x32f0ec['filter']);_0x5edca8['where'](_0x32f0ec['user']['clause']);_0x4343b6=_0x32f0ec[_0xa757('0xc')];_0x2930fa=_0x32f0ec['user']['skip'];return sqlUtils[_0xa757('0xd')](_0x5709ed,_0x5c03c3,_0x2930fa);})['then'](function(_0x481508){_0x5edca8[_0xa757('0x9')](_0x481508);var _0x1b670e=_0x5c03c3[_0xa757('0x6')]?_0x4343b6[_0xa757('0xe')]:_0x5c03c3[_0xa757('0xf')];_0x53be0e=_0x1b670e?!![]:![];return sqlUtils[_0xa757('0x10')](_0x5edca8,_0x1b670e);})[_0xa757('0x5')](function(_0x2f7947){_0x1c2932[_0xa757('0x11')]=_0x2f7947;if(_0x1c2932[_0xa757('0x11')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x5edca8,_0x5c03c3[_0xa757('0xb')],_0x32be3b,_0x53be0e,_0x4343b6[_0xa757('0x12')],_0x2930fa);})[_0xa757('0x5')](function(_0x4d9f58){if(!_0x4d9f58){return[];}return sqlUtils['getFilteredContacts'](_0x4d9f58,_0x5c03c3,_0x32be3b);})[_0xa757('0x5')](function(_0x468d45){_0x1c2932[_0xa757('0x13')]=_0x468d45;return _0x1c2932;})[_0xa757('0x14')](function(_0x27f4ba){throw _0x27f4ba;});};exports[_0xa757('0x15')]=function(){var _0x4bd137={};var _0x58954=[];return db['CmContact'][_0xa757('0x15')]()[_0xa757('0x5')](function(_0x14014c){_0x4bd137=_0x14014c;var _0x2c9ec6=Object['keys'](_0x4bd137)['filter'](function(_0x40ec48){return _[_0xa757('0x16')](_0x40ec48,_0xa757('0x17'))?_0x40ec48:undefined;});var _0x8d121f=_0x2c9ec6[_0xa757('0x18')](function(_0x40562f){return db[_0xa757('0x19')][_0xa757('0x1a')]({'where':{'id':_0x40562f[_0xa757('0x1b')](0x3)},'raw':!![]});});return Promise['all'](_0x8d121f);})[_0xa757('0x5')](function(_0x59e9d4){for(var _0x422e9e=0x0;_0x422e9e<_0x59e9d4['length'];_0x422e9e++){if(_0x59e9d4[_0x422e9e]){var _0x40551d=_0xa757('0x17')+_0x59e9d4[_0x422e9e]['id'];_0x4bd137[_0x40551d][_0xa757('0x1c')]=_0x59e9d4[_0x422e9e]['type'];}}_0x58954=_[_0xa757('0x18')](Object[_0xa757('0x1d')](_0x4bd137),function(_0x471e84){return{'name':_0x471e84,'type':_0x4bd137[_0x471e84][_0xa757('0x1e')]};});return _0x58954;})['catch'](function(_0x449a7d){throw _0x449a7d;});}; \ No newline at end of file +var _0x757a=['findOne','slice','fieldType','keys','type','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','clause','rows','catch','describe','startsWith','cf_','map','CmCustomField'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x757a,0xde));var _0xa757=function(_0x164bb6,_0xc45c23){_0x164bb6=_0x164bb6-0x0;var _0x5b0b52=_0x757a[_0x164bb6];return _0x5b0b52;};'use strict';var _=require('lodash');var sqlUtils=require(_0xa757('0x0'));var db=require(_0xa757('0x1'))['db'];exports['findAll']=function(_0x5c03c3,_0x5709ed,_0x32be3b,_0x1721c6){var _0x1c2932={'count':0x0,'rows':[]};var _0x453d07=sqlUtils[_0xa757('0x2')](_0x5709ed,_0x5c03c3);if(_0x453d07){return Promise[_0xa757('0x3')](_0x1c2932);}var _0x5edca8=sqlUtils[_0xa757('0x4')]();var _0x4343b6={};var _0x53be0e=![];var _0x2930fa=![];return Promise[_0xa757('0x3')]()[_0xa757('0x5')](function(){if(_0x5c03c3[_0xa757('0x6')]){return sqlUtils[_0xa757('0x7')](_0x5c03c3['search'],_0x1721c6);}else{return sqlUtils[_0xa757('0x8')](_0x5c03c3,_0x1721c6);}})[_0xa757('0x5')](function(_0x32f0ec){_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xa')]);_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xb')]);_0x5edca8['where'](_0x32f0ec['filter']);_0x5edca8['where'](_0x32f0ec['user']['clause']);_0x4343b6=_0x32f0ec[_0xa757('0xc')];_0x2930fa=_0x32f0ec['user']['skip'];return sqlUtils[_0xa757('0xd')](_0x5709ed,_0x5c03c3,_0x2930fa);})['then'](function(_0x481508){_0x5edca8[_0xa757('0x9')](_0x481508);var _0x1b670e=_0x5c03c3[_0xa757('0x6')]?_0x4343b6[_0xa757('0xe')]:_0x5c03c3[_0xa757('0xf')];_0x53be0e=_0x1b670e?!![]:![];return sqlUtils[_0xa757('0x10')](_0x5edca8,_0x1b670e);})[_0xa757('0x5')](function(_0x2f7947){_0x1c2932[_0xa757('0x11')]=_0x2f7947;if(_0x1c2932[_0xa757('0x11')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x5edca8,_0x5c03c3[_0xa757('0xb')],_0x32be3b,_0x53be0e,_0x4343b6[_0xa757('0x12')],_0x2930fa);})[_0xa757('0x5')](function(_0x4d9f58){if(!_0x4d9f58){return[];}return sqlUtils['getFilteredContacts'](_0x4d9f58,_0x5c03c3,_0x32be3b);})[_0xa757('0x5')](function(_0x468d45){_0x1c2932[_0xa757('0x13')]=_0x468d45;return _0x1c2932;})[_0xa757('0x14')](function(_0x27f4ba){throw _0x27f4ba;});};exports[_0xa757('0x15')]=function(){var _0x4bd137={};var _0x58954=[];return db['CmContact'][_0xa757('0x15')]()[_0xa757('0x5')](function(_0x14014c){_0x4bd137=_0x14014c;var _0x2c9ec6=Object['keys'](_0x4bd137)['filter'](function(_0x40ec48){return _[_0xa757('0x16')](_0x40ec48,_0xa757('0x17'))?_0x40ec48:undefined;});var _0x8d121f=_0x2c9ec6[_0xa757('0x18')](function(_0x40562f){return db[_0xa757('0x19')][_0xa757('0x1a')]({'where':{'id':_0x40562f[_0xa757('0x1b')](0x3)},'raw':!![]});});return Promise['all'](_0x8d121f);})[_0xa757('0x5')](function(_0x59e9d4){for(var _0x422e9e=0x0;_0x422e9e<_0x59e9d4['length'];_0x422e9e++){if(_0x59e9d4[_0x422e9e]){var _0x40551d=_0xa757('0x17')+_0x59e9d4[_0x422e9e]['id'];_0x4bd137[_0x40551d][_0xa757('0x1c')]=_0x59e9d4[_0x422e9e]['type'];}}_0x58954=_[_0xa757('0x18')](Object[_0xa757('0x1d')](_0x4bd137),function(_0x471e84){return{'name':_0x471e84,'type':_0x4bd137[_0x471e84][_0xa757('0x1e')]};});return _0x58954;})['catch'](function(_0x449a7d){throw _0x449a7d;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 17369d6..c83659a 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 _0x3721=['castTo','DATE','buildExpression','type','default','text','start','value','end','Tag','split','map','tags','clause','and','User','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','role','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','findAll','color','CmContact','toString','Tags','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','query','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','agent','search','ListId','autocomplete','select','from','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','ct.CmContactId\x20=\x20','.id','firstName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','forEach','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','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?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3721,0xff));var _0x1372=function(_0x1868e2,_0x232b71){_0x1868e2=_0x1868e2-0x0;var _0x22b42e=_0x3721[_0x1868e2];return _0x22b42e;};'use strict';var _=require(_0x1372('0x0'));var squel=require(_0x1372('0x1'));var as=require(_0x1372('0x2'));var qs=require(_0x1372('0x3'));var utils=require(_0x1372('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x110c53,_0x518c4c){var _0x41fb1c=![];if(_0x110c53['role']===_0x1372('0x5')&&!_0x518c4c[_0x1372('0x6')]&&!_0x518c4c[_0x1372('0x7')]&&_0x518c4c[_0x1372('0x8')]!=='true'){_0x41fb1c=!![];}return _0x41fb1c;}function getContactsSubquery(){return squel[_0x1372('0x9')]()[_0x1372('0xa')]('cm_contacts','c')[_0x1372('0xb')](_0x1372('0xc'));}function applyJoinClauses(_0x23aeae,_0x546435){var _0x12c7c0=_0x546435?'c':_0x1372('0xd');_0x23aeae['left_join'](_0x1372('0xe'),'uc',_0x1372('0xf')+_0x12c7c0+'.id')['left_join']('cm_contact_has_tags','ct',_0x1372('0x10')+_0x12c7c0+_0x1372('0x11'))['left_join']('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x23aeae;}function addFieldsToQuery(_0x22fe70,_0x298fbc,_0xca6354,_0x506f9a,_0x34010a){var _0x56853c=_0x34010a?'c':'subqry';if(!_0x298fbc){_0x298fbc=['id',_0x1372('0x12'),'lastName','phone',_0x1372('0x13'),_0x1372('0x14'),_0x1372('0x15'),_0x1372('0x7'),_0x1372('0x16'),_0x1372('0x17'),_0x1372('0x18'),_0x1372('0x19'),_0x1372('0x1a')];}else if(!_0x298fbc['includes']('id')){_0x298fbc[_0x1372('0x1b')]('id');}var _0x44cd32=_0xca6354&&_0x34010a||!_0xca6354&&!_0x34010a;if(_0x506f9a){_0x44cd32=_0x506f9a&&_0x34010a||!_0x506f9a&&!_0x34010a;}_0x298fbc[_0x1372('0x1c')](function(_0xcd46a8){if(_0xcd46a8===_0x1372('0x1a')){if(_0x44cd32){_0x22fe70[_0x1372('0x1d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xcd46a8);}else if(_0xca6354||_0x506f9a){_0x22fe70[_0x1372('0x1d')](_0x56853c+'.'+_0xcd46a8);}}else{_0x22fe70['field'](_0x56853c+'.'+_0xcd46a8);}});return _0x22fe70;}function getSqlClauses(){var _0x1cae25={'default':squel['expr'](),'fields':squel[_0x1372('0x1e')](),'filter':squel[_0x1372('0x1e')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x1372('0x1e')](),'skip':![]}};return _0x1cae25;}function parseTagParameter(_0x4ef36b){var _0x5d6a7f=squel['expr']();if(_0x4ef36b){var _0x2ecb9a=utils['getSelectedTags'](_0x4ef36b);_0x2ecb9a['forEach'](function(_0x31fea6){_0x5d6a7f['or'](_0x1372('0x1f'),'%,'+_0x31fea6+',%');});}return _0x5d6a7f;}function parseSearchFilter(_0x5e6ad2){var _0x30bf96=squel[_0x1372('0x1e')]();if(_0x5e6ad2){var _0x21d847=_0x5e6ad2['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x21d847['split']('\x20')['length']>0x1){_0x30bf96['or'](_0x1372('0x20'),qs[_0x1372('0x21')](_0x21d847),null);}else{if(qs[_0x1372('0x22')](_0x21d847)){_0x30bf96['or'](_0x1372('0x23'),_0x21d847+'%');_0x30bf96['or'](_0x1372('0x24'),_0x21d847+'%');_0x30bf96['or'](_0x1372('0x25'),_0x21d847+'%');_0x30bf96['or']('c.fax\x20LIKE\x20?',_0x21d847+'%');}else if(qs[_0x1372('0x26')](_0x21d847)){_0x30bf96['or'](_0x1372('0x27'),_0x21d847+'%');}else{_0x30bf96['or'](_0x1372('0x28'),'%'+_0x21d847+'%');_0x30bf96['or'](_0x1372('0x29'),'%'+_0x21d847+'%');_0x30bf96['or'](_0x1372('0x27'),'%'+_0x21d847+'%');}}}return _0x30bf96;}function parseAdvancedSearchFilter(_0x2aa5a5,_0x15f97f){var _0xa3b54a=getSqlClauses();var _0x98f40=as[_0x1372('0x2a')](_0x2aa5a5);var _0x5d45c1=_0x98f40[_0x1372('0x2b')];for(var _0x56ebc0=0x0;_0x56ebc0<_0x98f40[_0x1372('0x2c')][_0x1372('0x2d')];_0x56ebc0++){var _0x1990d5=_0x98f40[_0x1372('0x2c')][_0x56ebc0];var _0x1edcf3='c';var _0x249873=_[_0x1372('0x2e')](_0x15f97f,[_0x1372('0x2f'),_0x1990d5['field']]);if(_0x249873){if(_0x1990d5[_0x1372('0x1d')]===_0x1372('0x30')||_0x249873[_0x1372('0x31')]===_0x1372('0x32')){_0x1990d5[_0x1372('0x33')]=_0x1372('0x34');}var _0x5c5613=as[_0x1372('0x35')](_0x1edcf3,_0x249873[_0x1372('0x36')],_0x1990d5);_0xa3b54a[_0x1372('0x37')][_0x5d45c1](_0x5c5613[_0x1372('0x38')],_0x5c5613['value'][_0x1372('0x39')],_0x5c5613[_0x1372('0x3a')][_0x1372('0x3b')]);}else{if(_0x1990d5['field']===_0x1372('0x3c')){var _0x27397c=_0x1990d5[_0x1372('0x3a')][_0x1372('0x3d')](',')[_0x1372('0x3e')](function(_0x47cbc8){return Number(_0x47cbc8);});var _0xa65c69=parseTagParameter(_0x27397c);_0xa3b54a[_0x1372('0x3f')][_0x1372('0x40')][_0x1372('0x41')](_0xa65c69);_0xa3b54a[_0x1372('0x3f')]['ids']=_0x27397c;}else if(_0x1990d5[_0x1372('0x1d')]===_0x1372('0x42')){_0xa3b54a[_0x1372('0x43')][_0x1372('0x40')][_0x1372('0x41')](_0x1372('0x44'),_0x1990d5[_0x1372('0x3a')]);_0xa3b54a[_0x1372('0x43')][_0x1372('0x45')]=!![];}}}return _0xa3b54a;}function parseModelFields(_0x39d161,_0x4c46f3){var _0x48e5f4=squel['expr']();var _0x1049a2=_(_0x39d161)[_0x1372('0x46')]()[_0x1372('0x3e')](function(_0x53ab51){return _[_0x1372('0x47')](_0x4c46f3,[_0x1372('0x2f'),_0x53ab51])?_0x53ab51:undefined;})['compact']()['value']();if(_0x39d161[_0x1372('0x48')]){_0x1049a2[_0x1372('0x1b')](_0x1372('0x48'));}if(_0x1049a2[_0x1372('0x2d')]>0x0){_0x1049a2[_0x1372('0x1c')](function(_0x1ddf7a){if(_0x1ddf7a===_0x1372('0x7')){_0x48e5f4[_0x1372('0x41')](_0x1372('0x49'),[][_0x1372('0x4a')](_0x39d161[_0x1ddf7a]));}else if(_0x1ddf7a===_0x1372('0x48')){var _0x3ebcd2='%'+_0x39d161[_0x1ddf7a]+'%';_0x48e5f4['and'](_0x1372('0x4b'),_0x3ebcd2);}else{_0x48e5f4[_0x1372('0x41')]('c.'+_0x1ddf7a+'\x20=\x20?',_0x39d161[_0x1ddf7a]);}});}return _0x48e5f4;}function parseQueryParameters(_0x450d0f,_0x2b7597){var _0x34dbbc=getSqlClauses();return Promise[_0x1372('0x4c')]()[_0x1372('0x4d')](function(){return parseModelFields(_0x450d0f,_0x2b7597);})[_0x1372('0x4d')](function(_0x3ee431){_0x34dbbc[_0x1372('0x4e')][_0x1372('0x41')](_0x3ee431);return parseTagParameter(_0x450d0f[_0x1372('0x4f')]);})[_0x1372('0x4d')](function(_0x48caca){_0x34dbbc[_0x1372('0x3f')]['clause'][_0x1372('0x41')](_0x48caca);return parseSearchFilter(_0x450d0f['filter']);})['then'](function(_0x573e72){_0x34dbbc['filter']=_0x573e72;return _0x34dbbc;});}function checkListsRestrictions(_0x3e6aff,_0x1403fa,_0x27963d){var _0x43959e=squel[_0x1372('0x1e')]();return Promise[_0x1372('0x4c')]()['then'](function(){if(_0x1403fa[_0x1372('0x6')]&&_0x3e6aff[_0x1372('0x50')]===_0x1372('0x5')&&!_0x27963d){return _0x3e6aff[_0x1372('0x51')]({'attributes':['id'],'raw':!![]});}})[_0x1372('0x4d')](function(_0x478ea4){if(_0x478ea4){if(_0x478ea4[_0x1372('0x2d')]===0x0){_0x43959e[_0x1372('0x41')](_0x1372('0x52'));}else{_0x43959e[_0x1372('0x41')](_0x1372('0x49'),_[_0x1372('0x3e')](_0x478ea4,'id'));}}})['then'](function(){return _0x43959e;});}function buildContactsQuery(_0x1f06fe,_0x1e1c72,_0x39f03d,_0x1cf094,_0x453d11,_0x4702d3){if(_0x1e1c72){_0x1e1c72=_0x39f03d[_0x1372('0x53')];}_0x1f06fe=addFieldsToQuery(_0x1f06fe,_0x1e1c72,_0x1cf094,_0x4702d3,!![]);var _0x24ab07=squel[_0x1372('0x9')]();_0x24ab07=addFieldsToQuery(_0x24ab07,_0x1e1c72,_0x1cf094,_0x4702d3,![]);if(_0x1cf094||_0x4702d3){_0x1f06fe=applyJoinClauses(_0x1f06fe,!![]);_0x1f06fe[_0x1372('0x54')](_0x1372('0x55'));if(_0x39f03d[_0x1372('0x56')]){_0x24ab07[_0x1372('0x56')](_0x39f03d[_0x1372('0x56')]);}if(_0x39f03d[_0x1372('0x57')]){_0x24ab07[_0x1372('0x57')](_0x39f03d['offset']);}}else{_0x24ab07=applyJoinClauses(_0x24ab07,![]);_0x24ab07[_0x1372('0x54')](_0x1372('0x58'));if(_0x39f03d[_0x1372('0x56')]){_0x1f06fe[_0x1372('0x56')](_0x39f03d['limit']);}if(_0x39f03d[_0x1372('0x57')]){_0x1f06fe['offset'](_0x39f03d['offset']);}}_0x24ab07[_0x1372('0x59')](_0x453d11);if(_0x39f03d[_0x1372('0x5a')]){_0x39f03d[_0x1372('0x5a')][_0x1372('0x1c')](function(_0x21b86d){_0x1f06fe[_0x1372('0x5a')]('c.'+_0x21b86d[0x0],_0x21b86d[0x1]===_0x1372('0x5b')?![]:!![]);_0x24ab07[_0x1372('0x5a')]('subqry.'+_0x21b86d[0x0],_0x21b86d[0x1]==='DESC'?![]:!![]);});}_0x24ab07['from'](_0x1f06fe,'subqry');return _0x24ab07;}function getFilteredContacts(_0x4987ce){var _0x49ee0e=[];return db[_0x1372('0x3c')][_0x1372('0x5c')]({'attributes':['id',_0x1372('0x2f'),_0x1372('0x5d')],'raw':!![]})[_0x1372('0x4d')](function(_0x1d4167){_0x49ee0e=_['keyBy'](_0x1d4167,'id');var _0x266a7a={'type':db['Sequelize']['QueryTypes']['SELECT'],'model':db[_0x1372('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x4987ce[_0x1372('0x5f')](),_0x266a7a);})['then'](function(_0x7eda67){_0x7eda67[_0x1372('0x1c')](function(_0x25199e){if(_0x25199e[_0x1372('0x1a')]){_0x25199e[_0x1372('0x60')]=[];_0x25199e['TagIds']['split'](',')[_0x1372('0x1c')](function(_0x5ab18c){_0x25199e[_0x1372('0x60')][_0x1372('0x1b')](_0x49ee0e[_0x5ab18c]);});}delete _0x25199e[_0x1372('0x1a')];});return _0x7eda67;});}function countFilteredContacts(_0x14a75d,_0x4ae5f8){var _0x527fea=_0x14a75d['clone']();_0x527fea[_0x1372('0x1d')](_0x1372('0x61'));_0x527fea=applyJoinClauses(_0x527fea,!![]);_0x14a75d[_0x1372('0x54')](_0x1372('0x55'));var _0x1dd321=utils[_0x1372('0x62')](_0x4ae5f8);if(!_[_0x1372('0x63')](_0x1dd321)){_0x527fea['where'](_0x1372('0x64'),_0x1dd321);}var _0x40e47f={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return db['sequelize'][_0x1372('0x65')](_0x527fea[_0x1372('0x5f')](),_0x40e47f)[_0x1372('0x4d')](function(_0x3243a5){return _0x3243a5[0x0][_0x1372('0x61')];});}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 _0x3a6c=['resolve','role','agent','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','findAll','color','keyBy','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','QueryTypes','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','push','forEach','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','DATE','type','default','text','value','start','end','Tag','map','tags','clause','ids','User','user','uc.UserId\x20=\x20?','keys','some','compact','Contact','and','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter'];(function(_0x1cf36a,_0x3636a7){var _0x439f9c=function(_0x56b794){while(--_0x56b794){_0x1cf36a['push'](_0x1cf36a['shift']());}};_0x439f9c(++_0x3636a7);}(_0x3a6c,0x1ea));var _0xc3a6=function(_0x3d1f72,_0x589c92){_0x3d1f72=_0x3d1f72-0x0;var _0x1a202b=_0x3a6c[_0x3d1f72];return _0x1a202b;};'use strict';var _=require('lodash');var squel=require(_0xc3a6('0x0'));var as=require(_0xc3a6('0x1'));var qs=require(_0xc3a6('0x2'));var utils=require(_0xc3a6('0x3'));var db=require(_0xc3a6('0x4'))['db'];function skipContactsQuery(_0x3bc1d8,_0x2ef92e){var _0x3ea6dc=![];if(_0x3bc1d8['role']==='agent'&&!_0x2ef92e[_0xc3a6('0x5')]&&!_0x2ef92e[_0xc3a6('0x6')]&&_0x2ef92e[_0xc3a6('0x7')]!==_0xc3a6('0x8')){_0x3ea6dc=!![];}return _0x3ea6dc;}function getContactsSubquery(){return squel[_0xc3a6('0x9')]()[_0xc3a6('0xa')](_0xc3a6('0xb'),'c')[_0xc3a6('0xc')](_0xc3a6('0xd'));}function applyJoinClauses(_0x5af542,_0xde8bbc){var _0x2e275d=_0xde8bbc?'c':'subqry';_0x5af542[_0xc3a6('0xe')](_0xc3a6('0xf'),'uc',_0xc3a6('0x10')+_0x2e275d+_0xc3a6('0x11'))[_0xc3a6('0xe')](_0xc3a6('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x2e275d+_0xc3a6('0x11'))[_0xc3a6('0xe')](_0xc3a6('0x13'),'t',_0xc3a6('0x14'));return _0x5af542;}function addFieldsToQuery(_0x543444,_0x5ee8e7,_0x572bfa,_0x370d7b,_0x3f5343){var _0xe5c4ef=_0x3f5343?'c':_0xc3a6('0x15');if(!_0x5ee8e7){_0x5ee8e7=['id',_0xc3a6('0x16'),_0xc3a6('0x17'),_0xc3a6('0x18'),_0xc3a6('0x19'),_0xc3a6('0x1a'),_0xc3a6('0x1b'),'ListId',_0xc3a6('0x1c'),_0xc3a6('0x1d'),'updatedAt',_0xc3a6('0x1e'),'TagIds'];}else if(!_0x5ee8e7['includes']('id')){_0x5ee8e7[_0xc3a6('0x1f')]('id');}var _0x3e52a9=_0x572bfa&&_0x3f5343||!_0x572bfa&&!_0x3f5343;if(_0x370d7b){_0x3e52a9=_0x370d7b&&_0x3f5343||!_0x370d7b&&!_0x3f5343;}_0x5ee8e7[_0xc3a6('0x20')](function(_0x5f3898){if(_0x5f3898===_0xc3a6('0x21')){if(_0x3e52a9){_0x543444['field'](_0xc3a6('0x22'),_0x5f3898);}else if(_0x572bfa||_0x370d7b){_0x543444[_0xc3a6('0x23')](_0xe5c4ef+'.'+_0x5f3898);}}else{_0x543444[_0xc3a6('0x23')](_0xe5c4ef+'.'+_0x5f3898);}});return _0x543444;}function getSqlClauses(){var _0x21c5b0={'default':squel[_0xc3a6('0x24')](),'fields':squel[_0xc3a6('0x24')](),'filter':squel[_0xc3a6('0x24')](),'tags':{'clause':squel[_0xc3a6('0x24')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x21c5b0;}function parseTagParameter(_0x43c99f){var _0x58f305=squel[_0xc3a6('0x24')]();if(_0x43c99f){var _0x30c1d7=utils[_0xc3a6('0x25')](_0x43c99f);_0x30c1d7[_0xc3a6('0x20')](function(_0x1f8521){_0x58f305['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1f8521+',%');});}return _0x58f305;}function parseSearchFilter(_0x321008){var _0x324aa2=squel[_0xc3a6('0x24')]();if(_0x321008){var _0x9eb1a=_0x321008[_0xc3a6('0x26')]('\x5c','\x5c\x5c')[_0xc3a6('0x26')](/'/g,'\x27\x27');if(_0x9eb1a[_0xc3a6('0x27')]('\x20')[_0xc3a6('0x28')]>0x1){_0x324aa2['or'](_0xc3a6('0x29'),qs[_0xc3a6('0x2a')](_0x9eb1a),null);}else{if(qs[_0xc3a6('0x2b')](_0x9eb1a)){_0x324aa2['or'](_0xc3a6('0x2c'),_0x9eb1a+'%');_0x324aa2['or'](_0xc3a6('0x2d'),_0x9eb1a+'%');_0x324aa2['or']('c.mobile\x20LIKE\x20?',_0x9eb1a+'%');_0x324aa2['or'](_0xc3a6('0x2e'),_0x9eb1a+'%');}else if(qs[_0xc3a6('0x2f')](_0x9eb1a)){_0x324aa2['or'](_0xc3a6('0x30'),_0x9eb1a+'%');}else{_0x324aa2['or'](_0xc3a6('0x31'),'%'+_0x9eb1a+'%');_0x324aa2['or'](_0xc3a6('0x32'),'%'+_0x9eb1a+'%');_0x324aa2['or'](_0xc3a6('0x30'),'%'+_0x9eb1a+'%');}}}return _0x324aa2;}function parseAdvancedSearchFilter(_0x1526cb,_0x2e2a3a){var _0x38ebd6=getSqlClauses();var _0x5f4863=as[_0xc3a6('0x33')](_0x1526cb);var _0x28b4d5=_0x5f4863[_0xc3a6('0x34')];for(var _0x586a53=0x0;_0x586a53<_0x5f4863[_0xc3a6('0x35')][_0xc3a6('0x28')];_0x586a53++){var _0x17655e=_0x5f4863[_0xc3a6('0x35')][_0x586a53];var _0x5a296f='c';var _0x1d645e=_[_0xc3a6('0x36')](_0x2e2a3a,[_0xc3a6('0x37'),_0x17655e[_0xc3a6('0x23')]]);if(_0x1d645e){if(_0x17655e[_0xc3a6('0x23')]===_0xc3a6('0x38')||_0x1d645e[_0xc3a6('0x39')]==='datetime'){_0x17655e['castTo']=_0xc3a6('0x3a');}var _0x279e78=as['buildExpression'](_0x5a296f,_0x1d645e[_0xc3a6('0x3b')],_0x17655e);_0x38ebd6[_0xc3a6('0x3c')][_0x28b4d5](_0x279e78[_0xc3a6('0x3d')],_0x279e78[_0xc3a6('0x3e')][_0xc3a6('0x3f')],_0x279e78[_0xc3a6('0x3e')][_0xc3a6('0x40')]);}else{if(_0x17655e[_0xc3a6('0x23')]===_0xc3a6('0x41')){var _0xc26f09=_0x17655e[_0xc3a6('0x3e')][_0xc3a6('0x27')](',')[_0xc3a6('0x42')](function(_0x4b09ac){return Number(_0x4b09ac);});var _0x216dc8=parseTagParameter(_0xc26f09);_0x38ebd6[_0xc3a6('0x43')][_0xc3a6('0x44')]['and'](_0x216dc8);_0x38ebd6[_0xc3a6('0x43')][_0xc3a6('0x45')]=_0xc26f09;}else if(_0x17655e[_0xc3a6('0x23')]===_0xc3a6('0x46')){_0x38ebd6[_0xc3a6('0x47')][_0xc3a6('0x44')]['and'](_0xc3a6('0x48'),_0x17655e[_0xc3a6('0x3e')]);_0x38ebd6[_0xc3a6('0x47')]['skip']=!![];}}}return _0x38ebd6;}function parseModelFields(_0x40bb71,_0x584ebf){var _0x51f833=squel[_0xc3a6('0x24')]();var _0x51b0db=_(_0x40bb71)[_0xc3a6('0x49')]()[_0xc3a6('0x42')](function(_0xa10407){return _[_0xc3a6('0x4a')](_0x584ebf,[_0xc3a6('0x37'),_0xa10407])?_0xa10407:undefined;})[_0xc3a6('0x4b')]()['value']();if(_0x40bb71['Contact']){_0x51b0db['push'](_0xc3a6('0x4c'));}if(_0x51b0db[_0xc3a6('0x28')]>0x0){_0x51b0db[_0xc3a6('0x20')](function(_0xd777e0){if(_0xd777e0===_0xc3a6('0x6')){_0x51f833[_0xc3a6('0x4d')]('c.ListId\x20IN\x20?',[][_0xc3a6('0x4e')](_0x40bb71[_0xd777e0]));}else if(_0xd777e0===_0xc3a6('0x4c')){var _0xc251cf='%'+_0x40bb71[_0xd777e0]+'%';_0x51f833[_0xc3a6('0x4d')](_0xc3a6('0x4f'),_0xc251cf);}else{_0x51f833[_0xc3a6('0x4d')]('c.'+_0xd777e0+_0xc3a6('0x50'),_0x40bb71[_0xd777e0]);}});}return _0x51f833;}function parseQueryParameters(_0x8e682b,_0x3f11ec){var _0x1a1deb=getSqlClauses();return Promise['resolve']()[_0xc3a6('0x51')](function(){return parseModelFields(_0x8e682b,_0x3f11ec);})[_0xc3a6('0x51')](function(_0x3670fb){_0x1a1deb[_0xc3a6('0x52')][_0xc3a6('0x4d')](_0x3670fb);return parseTagParameter(_0x8e682b[_0xc3a6('0x53')]);})[_0xc3a6('0x51')](function(_0x56cb76){_0x1a1deb['tags'][_0xc3a6('0x44')][_0xc3a6('0x4d')](_0x56cb76);return parseSearchFilter(_0x8e682b[_0xc3a6('0x54')]);})[_0xc3a6('0x51')](function(_0x1375d6){_0x1a1deb['filter']=_0x1375d6;return _0x1a1deb;});}function checkListsRestrictions(_0x3a463a,_0x320080,_0x470ec1){var _0x289b83=squel[_0xc3a6('0x24')]();return Promise[_0xc3a6('0x55')]()['then'](function(){if(_0x320080[_0xc3a6('0x5')]&&_0x3a463a[_0xc3a6('0x56')]===_0xc3a6('0x57')&&!_0x470ec1){return _0x3a463a[_0xc3a6('0x58')]({'attributes':['id'],'raw':!![]});}})[_0xc3a6('0x51')](function(_0x5b9963){if(_0x5b9963){if(_0x5b9963[_0xc3a6('0x28')]===0x0){_0x289b83[_0xc3a6('0x4d')](_0xc3a6('0x59'));}else{_0x289b83[_0xc3a6('0x4d')](_0xc3a6('0x5a'),_[_0xc3a6('0x42')](_0x5b9963,'id'));}}})[_0xc3a6('0x51')](function(){return _0x289b83;});}function buildContactsQuery(_0x28964d,_0x5eb55e,_0x127631,_0x33a7e7,_0x3bd6ff,_0x24975a){if(_0x5eb55e){_0x5eb55e=_0x127631[_0xc3a6('0x5b')];}_0x28964d=addFieldsToQuery(_0x28964d,_0x5eb55e,_0x33a7e7,_0x24975a,!![]);var _0x158aa3=squel[_0xc3a6('0x9')]();_0x158aa3=addFieldsToQuery(_0x158aa3,_0x5eb55e,_0x33a7e7,_0x24975a,![]);if(_0x33a7e7||_0x24975a){_0x28964d=applyJoinClauses(_0x28964d,!![]);_0x28964d[_0xc3a6('0x5c')](_0xc3a6('0x5d'));if(_0x127631[_0xc3a6('0x5e')]){_0x158aa3[_0xc3a6('0x5e')](_0x127631[_0xc3a6('0x5e')]);}if(_0x127631['offset']){_0x158aa3[_0xc3a6('0x5f')](_0x127631[_0xc3a6('0x5f')]);}}else{_0x158aa3=applyJoinClauses(_0x158aa3,![]);_0x158aa3['group'](_0xc3a6('0x60'));if(_0x127631[_0xc3a6('0x5e')]){_0x28964d[_0xc3a6('0x5e')](_0x127631[_0xc3a6('0x5e')]);}if(_0x127631[_0xc3a6('0x5f')]){_0x28964d[_0xc3a6('0x5f')](_0x127631[_0xc3a6('0x5f')]);}}_0x158aa3['having'](_0x3bd6ff);if(_0x127631[_0xc3a6('0x61')]){_0x127631['order'][_0xc3a6('0x20')](function(_0x143b55){_0x28964d[_0xc3a6('0x61')]('c.'+_0x143b55[0x0],_0x143b55[0x1]===_0xc3a6('0x62')?![]:!![]);_0x158aa3['order'](_0xc3a6('0x63')+_0x143b55[0x0],_0x143b55[0x1]===_0xc3a6('0x62')?![]:!![]);});}_0x158aa3[_0xc3a6('0xa')](_0x28964d,'subqry');return _0x158aa3;}function getFilteredContacts(_0x4cab09){var _0x5816bf=[];return db['Tag'][_0xc3a6('0x64')]({'attributes':['id',_0xc3a6('0x37'),_0xc3a6('0x65')],'raw':!![]})[_0xc3a6('0x51')](function(_0x30d9da){_0x5816bf=_[_0xc3a6('0x66')](_0x30d9da,'id');var _0x400de6={'type':db['Sequelize']['QueryTypes'][_0xc3a6('0x67')],'model':db[_0xc3a6('0x68')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xc3a6('0x69')][_0xc3a6('0x6a')](_0x4cab09[_0xc3a6('0x6b')](),_0x400de6);})[_0xc3a6('0x51')](function(_0x2bc96b){_0x2bc96b[_0xc3a6('0x20')](function(_0x1a3aea){if(_0x1a3aea[_0xc3a6('0x21')]){_0x1a3aea[_0xc3a6('0x6c')]=[];_0x1a3aea[_0xc3a6('0x21')]['split'](',')['forEach'](function(_0x5aebff){_0x1a3aea['Tags'][_0xc3a6('0x1f')](_0x5816bf[_0x5aebff]);});}delete _0x1a3aea[_0xc3a6('0x21')];});return _0x2bc96b;});}function countFilteredContacts(_0x54b1b6,_0x40594c){var _0x701a80=_0x54b1b6[_0xc3a6('0x6d')]();_0x701a80['field'](_0xc3a6('0x6e'));_0x701a80=applyJoinClauses(_0x701a80,!![]);_0x54b1b6[_0xc3a6('0x5c')]('c.id');var _0x52d999=utils[_0xc3a6('0x25')](_0x40594c);if(!_[_0xc3a6('0x6f')](_0x52d999)){_0x701a80[_0xc3a6('0xc')](_0xc3a6('0x70'),_0x52d999);}var _0x19bb7a={'type':db[_0xc3a6('0x71')][_0xc3a6('0x72')][_0xc3a6('0x67')],'raw':!![]};return db[_0xc3a6('0x69')][_0xc3a6('0x6a')](_0x701a80[_0xc3a6('0x6b')](),_0x19bb7a)[_0xc3a6('0x51')](function(_0x279f0e){return _0x279f0e[0x0][_0xc3a6('0x6e')];});}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 29d2e11..226b397 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 _0xea6d=['../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','binary','write','end','final','close','decryptFile','createWriteStream','createDecipher','unlink','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment'];(function(_0x2d8fba,_0x11950a){var _0x4d44c3=function(_0x2a6626){while(--_0x2a6626){_0x2d8fba['push'](_0x2d8fba['shift']());}};_0x4d44c3(++_0x11950a);}(_0xea6d,0xba));var _0xdea6=function(_0x52b21d,_0x2db2fd){_0x52b21d=_0x52b21d-0x0;var _0x2d0d56=_0xea6d[_0x52b21d];return _0x2d0d56;};'use strict';var crypto=require(_0xdea6('0x0'));var fs=require('fs');var BPromise=require(_0xdea6('0x1'));var _=require(_0xdea6('0x2'));var config=require(_0xdea6('0x3'));var logger=require(_0xdea6('0x4'))(_0xdea6('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xdea6('0x6')][_0xdea6('0x7')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xdea6('0x8')};if(config[_0xdea6('0x9')]&&config[_0xdea6('0x9')][_0xdea6('0xa')]){var isSupported=isAlgorithmSupported(config[_0xdea6('0x9')][_0xdea6('0xa')]);if(isSupported){fileOptions[_0xdea6('0xa')]=config['encrypt'][_0xdea6('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdea6('0xb')](',\x20');logger[_0xdea6('0xc')](config[_0xdea6('0x9')]['algorithm'],_0xdea6('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x979213){return AES_SUPPORTED_RX[_0xdea6('0xe')](_0x979213);}function getSupportedCiphers(){return crypto[_0xdea6('0xf')]()[_0xdea6('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0xf0798){return getSupportedCiphers()[_0xdea6('0x11')](_0xf0798)>-0x1;}function combineOptions(_0x46e152){var _0x575235={};for(var _0xf1d5c3 in fileOptions){if(fileOptions[_0xdea6('0x12')](_0xf1d5c3)){_0x575235[_0xf1d5c3]=fileOptions[_0xf1d5c3];}}if(_0x46e152){for(var _0x30adec in _0x46e152){if(_0x46e152[_0xdea6('0x12')](_0x30adec)){_0x575235[_0x30adec]=_0x46e152[_0x30adec];}}}return _0x575235;}exports[_0xdea6('0x13')]=function(_0x5263ef,_0x622a5d,_0x205c62,_0x5ec977){return new BPromise(function(_0x423171,_0x1eb76d){_0x5ec977=combineOptions(_0x5ec977);var _0x4d93f4=new Buffer(_0x205c62);var _0x41d110=fs[_0xdea6('0x14')](_0x5263ef);var _0x1ea75b=fs['createWriteStream'](_0x622a5d);var _0x46ff53=crypto[_0xdea6('0x15')](_0x5ec977['algorithm'],_0x4d93f4);_0x41d110['on'](_0xdea6('0x16'),function(_0x267434){var _0x25e922=new Buffer(_0x46ff53[_0xdea6('0x17')](_0x267434),_0xdea6('0x18'));_0x1ea75b[_0xdea6('0x19')](_0x25e922);});_0x41d110['on'](_0xdea6('0x1a'),function(){try{var _0x304a74=new Buffer(_0x46ff53[_0xdea6('0x1b')](_0xdea6('0x18')),'binary');_0x1ea75b['write'](_0x304a74);_0x1ea75b[_0xdea6('0x1a')]();_0x1ea75b['on'](_0xdea6('0x1c'),function(){return _0x423171(_0x622a5d);});}catch(_0x1efe4c){fs['unlink'](_0x622a5d);return _0x1eb76d(_0x1efe4c);}});});};exports[_0xdea6('0x1d')]=function(_0x4475a4,_0x2cb035,_0x3bf4d9,_0x25cdb6){return new BPromise(function(_0x6f546d,_0x1dfcb8){_0x25cdb6=combineOptions(_0x25cdb6);var _0xaa2786=new Buffer(_0x3bf4d9);var _0x291188=fs[_0xdea6('0x14')](_0x4475a4);var _0x18df36=fs[_0xdea6('0x1e')](_0x2cb035);var _0x31409c=crypto[_0xdea6('0x1f')](_0x25cdb6[_0xdea6('0xa')],_0xaa2786);_0x291188['on'](_0xdea6('0x16'),function(_0x401242){var _0x4c1397=new Buffer(_0x31409c[_0xdea6('0x17')](_0x401242),'binary');_0x18df36[_0xdea6('0x19')](_0x4c1397);});_0x291188['on']('end',function(){try{var _0x5a2b02=new Buffer(_0x31409c['final']('binary'),_0xdea6('0x18'));_0x18df36[_0xdea6('0x19')](_0x5a2b02);_0x18df36[_0xdea6('0x1a')]();_0x18df36['on'](_0xdea6('0x1c'),function(){return _0x6f546d(_0x2cb035);});}catch(_0x2a453c){fs[_0xdea6('0x20')](_0x2cb035);return _0x1dfcb8(_0x2a453c);}});});};exports[_0xdea6('0x21')]=function(_0x461211,_0x4aeefd,_0xf924d1){var _0x177a6c=_0xf924d1||stringOptions['algorithm'];var _0x4bbefc=_0x4aeefd||stringOptions['secret'];var _0x1792b0=crypto[_0xdea6('0x15')](_0x177a6c,_0x4bbefc);var _0x5d5fd8=_0x1792b0['update'](_0x461211,_0xdea6('0x22'),_0xdea6('0x23'));_0x5d5fd8+=_0x1792b0[_0xdea6('0x1b')]('base64');return _0x5d5fd8;};exports[_0xdea6('0x24')]=function(_0x1ed440,_0x4d78d5,_0x21e9d8){var _0x48cbfe=_0x21e9d8||stringOptions[_0xdea6('0xa')];var _0x50dbbc=_0x4d78d5||stringOptions[_0xdea6('0x25')];var _0x584a6f=crypto[_0xdea6('0x1f')](_0x48cbfe,_0x50dbbc);var _0x5ba7ed=_0x584a6f[_0xdea6('0x17')](_0x1ed440,_0xdea6('0x23'),'utf8');_0x5ba7ed+=_0x584a6f[_0xdea6('0x1b')](_0xdea6('0x22'));return _0x5ba7ed;}; \ No newline at end of file +var _0x34ac=['hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','write','final','binary','close','unlink','decryptFile','createReadStream','createDecipher','end','encryptString','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','secrets','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf'];(function(_0x203794,_0xbe425f){var _0x3b2011=function(_0xd2ca8d){while(--_0xd2ca8d){_0x203794['push'](_0x203794['shift']());}};_0x3b2011(++_0xbe425f);}(_0x34ac,0xe6));var _0xc34a=function(_0x59112e,_0x48a4d6){_0x59112e=_0x59112e-0x0;var _0x56cf0e=_0x34ac[_0x59112e];return _0x56cf0e;};'use strict';var crypto=require(_0xc34a('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xc34a('0x1'));var config=require(_0xc34a('0x2'));var logger=require(_0xc34a('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc34a('0x4')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xc34a('0x5')};if(config[_0xc34a('0x6')]&&config[_0xc34a('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xc34a('0x6')]['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xc34a('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc34a('0x8')](',\x20');logger[_0xc34a('0x9')](config[_0xc34a('0x6')][_0xc34a('0x7')],_0xc34a('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x4f9922){return AES_SUPPORTED_RX[_0xc34a('0xb')](_0x4f9922);}function getSupportedCiphers(){return crypto[_0xc34a('0xc')]()[_0xc34a('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x1167fc){return getSupportedCiphers()[_0xc34a('0xe')](_0x1167fc)>-0x1;}function combineOptions(_0x9ef368){var _0x3c9197={};for(var _0x89bca4 in fileOptions){if(fileOptions[_0xc34a('0xf')](_0x89bca4)){_0x3c9197[_0x89bca4]=fileOptions[_0x89bca4];}}if(_0x9ef368){for(var _0x3be447 in _0x9ef368){if(_0x9ef368['hasOwnProperty'](_0x3be447)){_0x3c9197[_0x3be447]=_0x9ef368[_0x3be447];}}}return _0x3c9197;}exports[_0xc34a('0x10')]=function(_0x35ea40,_0x30cbd4,_0x5b72e4,_0x19c7e2){return new BPromise(function(_0x20af6f,_0x42205d){_0x19c7e2=combineOptions(_0x19c7e2);var _0x3d47d7=new Buffer(_0x5b72e4);var _0x77a78b=fs['createReadStream'](_0x35ea40);var _0x36ce42=fs[_0xc34a('0x11')](_0x30cbd4);var _0x56546e=crypto[_0xc34a('0x12')](_0x19c7e2[_0xc34a('0x7')],_0x3d47d7);_0x77a78b['on'](_0xc34a('0x13'),function(_0x255824){var _0x2a4615=new Buffer(_0x56546e[_0xc34a('0x14')](_0x255824),'binary');_0x36ce42[_0xc34a('0x15')](_0x2a4615);});_0x77a78b['on']('end',function(){try{var _0x4a3ee1=new Buffer(_0x56546e[_0xc34a('0x16')]('binary'),_0xc34a('0x17'));_0x36ce42[_0xc34a('0x15')](_0x4a3ee1);_0x36ce42['end']();_0x36ce42['on'](_0xc34a('0x18'),function(){return _0x20af6f(_0x30cbd4);});}catch(_0x2d558d){fs[_0xc34a('0x19')](_0x30cbd4);return _0x42205d(_0x2d558d);}});});};exports[_0xc34a('0x1a')]=function(_0x51c14e,_0x490085,_0x5ef329,_0x107111){return new BPromise(function(_0x2ae435,_0x48594b){_0x107111=combineOptions(_0x107111);var _0x27ef3d=new Buffer(_0x5ef329);var _0x26f6cb=fs[_0xc34a('0x1b')](_0x51c14e);var _0x318362=fs['createWriteStream'](_0x490085);var _0x441776=crypto[_0xc34a('0x1c')](_0x107111[_0xc34a('0x7')],_0x27ef3d);_0x26f6cb['on'](_0xc34a('0x13'),function(_0x2e461e){var _0x4c7197=new Buffer(_0x441776[_0xc34a('0x14')](_0x2e461e),_0xc34a('0x17'));_0x318362['write'](_0x4c7197);});_0x26f6cb['on'](_0xc34a('0x1d'),function(){try{var _0x1d4e43=new Buffer(_0x441776[_0xc34a('0x16')](_0xc34a('0x17')),_0xc34a('0x17'));_0x318362['write'](_0x1d4e43);_0x318362[_0xc34a('0x1d')]();_0x318362['on'](_0xc34a('0x18'),function(){return _0x2ae435(_0x490085);});}catch(_0x501cb3){fs[_0xc34a('0x19')](_0x490085);return _0x48594b(_0x501cb3);}});});};exports[_0xc34a('0x1e')]=function(_0x4abebe,_0x42144e,_0x1f753e){var _0x50f947=_0x1f753e||stringOptions[_0xc34a('0x7')];var _0x3734c5=_0x42144e||stringOptions[_0xc34a('0x1f')];var _0x2be131=crypto[_0xc34a('0x12')](_0x50f947,_0x3734c5);var _0x3a0a05=_0x2be131[_0xc34a('0x14')](_0x4abebe,_0xc34a('0x20'),_0xc34a('0x21'));_0x3a0a05+=_0x2be131['final'](_0xc34a('0x21'));return _0x3a0a05;};exports[_0xc34a('0x22')]=function(_0x4ba1f6,_0x3fe9ba,_0x3d877f){var _0x406ebd=_0x3d877f||stringOptions['algorithm'];var _0x67878d=_0x3fe9ba||stringOptions[_0xc34a('0x1f')];var _0x2315c3=crypto[_0xc34a('0x1c')](_0x406ebd,_0x67878d);var _0x2255f0=_0x2315c3[_0xc34a('0x14')](_0x4ba1f6,_0xc34a('0x21'),_0xc34a('0x20'));_0x2255f0+=_0x2315c3[_0xc34a('0x16')]('utf8');return _0x2255f0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e79b5f9..d340f54 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 _0xc26b=['finally','util','path','lodash','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','.csv','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','inspect'];(function(_0x18dc34,_0x205f71){var _0x4ab15b=function(_0x50572f){while(--_0x50572f){_0x18dc34['push'](_0x18dc34['shift']());}};_0x4ab15b(++_0x205f71);}(_0xc26b,0x8e));var _0xbc26=function(_0x1cc315,_0x326cd4){_0x1cc315=_0x1cc315-0x0;var _0x503210=_0xc26b[_0x1cc315];return _0x503210;};'use strict';var util=require(_0xbc26('0x0'));var path=require(_0xbc26('0x1'));var _=require(_0xbc26('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xbc26('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xbc26('0x4'));var db=require(_0xbc26('0x5'))['db'];var dbH=require(_0xbc26('0x5'))[_0xbc26('0x6')];var logger=require('../../config/logger')(_0xbc26('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xbc26('0x8')][0x2]);var QUERY=process[_0xbc26('0x8')][0x3];var PATH=process[_0xbc26('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x40ce83,_0x1b45a0){var _0x38b032={'status':_0x40ce83};var _0x1e1a52={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b45a0){_0x38b032[_0xbc26('0x9')]=_0x1b45a0;}return db[_0xbc26('0xa')][_0xbc26('0xb')](_0x38b032,_0x1e1a52);}function main(){var _0x242cd6=0x1388;var _0x460b41;logger[_0xbc26('0xc')](util['format'](_0xbc26('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xbc26('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbc26('0xf'),_0xbc26('0x10')]})['then'](function(_0xdc3c0f){if(_0xdc3c0f){_0x460b41=_0xdc3c0f;_0x242cd6=_0x460b41['splitSizeCsv']||0x1388;}})[_0xbc26('0x11')](function(){return dbH[_0xbc26('0x12')]['query'](util[_0xbc26('0x13')](_0xbc26('0x14'),QUERY),{'type':dbH['sequelize'][_0xbc26('0x15')][_0xbc26('0x16')]});})[_0xbc26('0x11')](function(_0x4387a5){if(!_0x4387a5[0x0][_0xbc26('0x17')]){return analyticExtractedReport('Empty');}var _0x2cfb14=[];var _0x1fd2ea=0x0;if(_0x460b41['split']){if(_0x4387a5&&_0x4387a5[_0xbc26('0x18')]){var _0x267bf4=_[_0xbc26('0x19')](_0x4387a5[0x0][_0xbc26('0x17')]/_0x242cd6);var _0x212c01=Number[_0xbc26('0x1a')](_0x4387a5[0x0][_0xbc26('0x17')]/_0x242cd6)?_0x4387a5[0x0][_0xbc26('0x17')]%_0x242cd6:0x0;_0x267bf4[_0xbc26('0x1b')](function(_0x53d399){if(_0x53d399>0x0){_0x1fd2ea+=_0x242cd6;}_0x2cfb14[_0xbc26('0x1c')](dbH[_0xbc26('0x12')]['query'](util[_0xbc26('0x13')](_0xbc26('0x1d'),QUERY,_0x242cd6,_0x1fd2ea),{'type':dbH[_0xbc26('0x12')][_0xbc26('0x15')][_0xbc26('0x16')]}));});if(_0x212c01>0x0){_0x1fd2ea+=_0x242cd6;_0x2cfb14[_0xbc26('0x1c')](dbH[_0xbc26('0x12')][_0xbc26('0x1e')](util[_0xbc26('0x13')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x212c01,_0x1fd2ea),{'type':dbH[_0xbc26('0x12')]['QueryTypes'][_0xbc26('0x16')]}));}}}else{_0x2cfb14[_0xbc26('0x1c')](dbH[_0xbc26('0x12')][_0xbc26('0x1e')](QUERY,{'type':dbH['sequelize'][_0xbc26('0x15')][_0xbc26('0x16')]}));}var _0x4298a3=path[_0xbc26('0x1f')](PATH);var _0x2768ef=path[_0xbc26('0x20')](PATH,_0xbc26('0x21'));var _0x1ed79e=_0x460b41['split']&&_0x2cfb14[_0xbc26('0x18')]>0x1;var _0xfc7bad=[];if(!fs['existsSync'](path[_0xbc26('0x22')](_0x4298a3,_0x2768ef))&&_0x1ed79e){fs['mkdirSync'](path[_0xbc26('0x22')](_0x4298a3,_0x2768ef));}return BPromise[_0xbc26('0x23')](_0x2cfb14,function(_0x2f1e7d){_0xfc7bad[_0xbc26('0x1c')](_0x2f1e7d);})['then'](function(){for(var _0x59c4b5=0x0;_0x59c4b5<_0xfc7bad['length'];_0x59c4b5+=0x1){var _0x20bbee;var _0x417c91=_0xfc7bad[_0x59c4b5];if(_0x1ed79e){_0x20bbee=path[_0xbc26('0x22')](_0x4298a3,_0x2768ef,util[_0xbc26('0x13')](_0xbc26('0x24'),_0x2768ef,_0x59c4b5,_0xbc26('0x25')));}else{_0x20bbee=path[_0xbc26('0x22')](_0x4298a3,util['format'](_0xbc26('0x26'),_0x2768ef,_0xbc26('0x25')));}fs[_0xbc26('0x27')](_0x20bbee,csv(_0x417c91));}})[_0xbc26('0x11')](function(){if(_0x1ed79e){return new Promise(function(_0x3fdc36){zipdir(path[_0xbc26('0x22')](_0x4298a3,_0x2768ef),{'saveTo':path['join'](_0x4298a3,util[_0xbc26('0x13')](_0xbc26('0x26'),_0x2768ef,_0xbc26('0x28')))},function(_0xa405ce,_0x4739a8){rimraf(path['join'](_0x4298a3,_0x2768ef),function(){});_0x3fdc36('zip\x20finished');});});}})['then'](function(){logger[_0xbc26('0xc')](util[_0xbc26('0x13')](_0xbc26('0x29'),EXTRACTED_REPORT_ID,_0xbc26('0x2a')));return analyticExtractedReport(_0xbc26('0x2b'),_0x1ed79e?util['format'](_0xbc26('0x26'),_0x2768ef,_0x1ed79e?_0xbc26('0x28'):_0xbc26('0x25')):null);});})[_0xbc26('0x2c')](function(_0x2e8bb0){logger[_0xbc26('0xc')](util[_0xbc26('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbc26('0x2a')),util[_0xbc26('0x2d')](_0x2e8bb0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xbc26('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x586f=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','range','num','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','zip\x20finished','%s.%s','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0x586f,0x198));var _0xf586=function(_0x4ff24f,_0x5b177e){_0x4ff24f=_0x4ff24f-0x0;var _0x1413ab=_0x586f[_0x4ff24f];return _0x1413ab;};'use strict';var util=require(_0xf586('0x0'));var path=require('path');var _=require(_0xf586('0x1'));var csv=require(_0xf586('0x2'));var fs=require('fs');var BPromise=require(_0xf586('0x3'));var zipdir=require(_0xf586('0x4'));var rimraf=require(_0xf586('0x5'));var db=require(_0xf586('0x6'))['db'];var dbH=require('../../mysqldb')[_0xf586('0x7')];var logger=require(_0xf586('0x8'))(_0xf586('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf586('0xa')][0x3];var PATH=process[_0xf586('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1a071f,_0xdce3fa){var _0x282c84={'status':_0x1a071f};var _0x4c9031={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xdce3fa){_0x282c84[_0xf586('0xb')]=_0xdce3fa;}return db[_0xf586('0xc')][_0xf586('0xd')](_0x282c84,_0x4c9031);}function main(){var _0x154bb5=0x1388;var _0x299a8e;logger[_0xf586('0xe')](util[_0xf586('0xf')](_0xf586('0x10'),EXTRACTED_REPORT_ID,_0xf586('0x11')));return db[_0xf586('0x12')][_0xf586('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf586('0x14'),_0xf586('0x15')]})[_0xf586('0x16')](function(_0x29415d){if(_0x29415d){_0x299a8e=_0x29415d;_0x154bb5=_0x299a8e[_0xf586('0x15')]||0x1388;}})[_0xf586('0x16')](function(){return dbH[_0xf586('0x17')]['query'](util[_0xf586('0xf')](_0xf586('0x18'),QUERY),{'type':dbH[_0xf586('0x17')]['QueryTypes']['SELECT']});})[_0xf586('0x16')](function(_0x2921bc){if(!_0x2921bc[0x0]['num']){return analyticExtractedReport('Empty');}var _0x16bcce=[];var _0x21f6bd=0x0;if(_0x299a8e['split']){if(_0x2921bc&&_0x2921bc['length']){var _0x371932=_[_0xf586('0x19')](_0x2921bc[0x0][_0xf586('0x1a')]/_0x154bb5);var _0x463c96=Number[_0xf586('0x1b')](_0x2921bc[0x0][_0xf586('0x1a')]/_0x154bb5)?_0x2921bc[0x0][_0xf586('0x1a')]%_0x154bb5:0x0;_0x371932['forEach'](function(_0x2ff360){if(_0x2ff360>0x0){_0x21f6bd+=_0x154bb5;}_0x16bcce['push'](dbH[_0xf586('0x17')][_0xf586('0x1c')](util['format'](_0xf586('0x1d'),QUERY,_0x154bb5,_0x21f6bd),{'type':dbH[_0xf586('0x17')][_0xf586('0x1e')]['SELECT']}));});if(_0x463c96>0x0){_0x21f6bd+=_0x154bb5;_0x16bcce[_0xf586('0x1f')](dbH[_0xf586('0x17')][_0xf586('0x1c')](util['format'](_0xf586('0x1d'),QUERY,_0x463c96,_0x21f6bd),{'type':dbH[_0xf586('0x17')][_0xf586('0x1e')][_0xf586('0x20')]}));}}}else{_0x16bcce[_0xf586('0x1f')](dbH[_0xf586('0x17')]['query'](QUERY,{'type':dbH[_0xf586('0x17')][_0xf586('0x1e')][_0xf586('0x20')]}));}var _0x50bf3b=path[_0xf586('0x21')](PATH);var _0x305532=path[_0xf586('0x22')](PATH,_0xf586('0x23'));var _0x1da901=_0x299a8e[_0xf586('0x14')]&&_0x16bcce[_0xf586('0x24')]>0x1;var _0x431fc1=[];if(!fs[_0xf586('0x25')](path[_0xf586('0x26')](_0x50bf3b,_0x305532))&&_0x1da901){fs[_0xf586('0x27')](path['join'](_0x50bf3b,_0x305532));}return BPromise[_0xf586('0x28')](_0x16bcce,function(_0x2db8a1){_0x431fc1[_0xf586('0x1f')](_0x2db8a1);})[_0xf586('0x16')](function(){for(var _0x171c8d=0x0;_0x171c8d<_0x431fc1[_0xf586('0x24')];_0x171c8d+=0x1){var _0x345429;var _0x15220d=_0x431fc1[_0x171c8d];if(_0x1da901){_0x345429=path[_0xf586('0x26')](_0x50bf3b,_0x305532,util['format'](_0xf586('0x29'),_0x305532,_0x171c8d,_0xf586('0x2a')));}else{_0x345429=path[_0xf586('0x26')](_0x50bf3b,util['format']('%s.%s',_0x305532,'csv'));}fs[_0xf586('0x2b')](_0x345429,csv(_0x15220d));}})[_0xf586('0x16')](function(){if(_0x1da901){return new Promise(function(_0x14e252){zipdir(path['join'](_0x50bf3b,_0x305532),{'saveTo':path[_0xf586('0x26')](_0x50bf3b,util[_0xf586('0xf')]('%s.%s',_0x305532,'zip'))},function(_0x431110,_0x2f5beb){rimraf(path[_0xf586('0x26')](_0x50bf3b,_0x305532),function(){});_0x14e252(_0xf586('0x2c'));});});}})['then'](function(){logger[_0xf586('0xe')](util[_0xf586('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf586('0x11')));return analyticExtractedReport('Completed',_0x1da901?util[_0xf586('0xf')](_0xf586('0x2d'),_0x305532,_0x1da901?_0xf586('0x2e'):_0xf586('0x2a')):null);});})[_0xf586('0x2f')](function(_0x3be26c){logger['info'](util[_0xf586('0xf')](_0xf586('0x30'),EXTRACTED_REPORT_ID,'CSV'),util[_0xf586('0x31')](_0x3be26c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf586('0x32'));})['finally'](function(){process[_0xf586('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 19e14d3..622f14d 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 _0x08fd=['html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','push','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','right','Empty','Setting','find','then','split','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','findOne','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','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','path','moment'];(function(_0x2d5037,_0x3e4ff6){var _0x19fcfb=function(_0x1e115b){while(--_0x1e115b){_0x2d5037['push'](_0x2d5037['shift']());}};_0x19fcfb(++_0x3e4ff6);}(_0x08fd,0xb9));var _0xd08f=function(_0x3b0b46,_0x3cfbed){_0x3b0b46=_0x3b0b46-0x0;var _0x210cc8=_0x08fd[_0x3b0b46];return _0x210cc8;};'use strict';var _=require(_0xd08f('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xd08f('0x1'));var moment=require(_0xd08f('0x2'));var htmlToPdfmake=require(_0xd08f('0x3'));var PdfPrinter=require(_0xd08f('0x4'));var zipdir=require(_0xd08f('0x5'));var rimraf=require(_0xd08f('0x6'));var JSDOM=require(_0xd08f('0x7'))[_0xd08f('0x8')];var window=new JSDOM('')[_0xd08f('0x9')];var BPromise=require(_0xd08f('0xa'));var db=require(_0xd08f('0xb'))['db'];var dbH=require(_0xd08f('0xb'))['dbH'];var logger=require(_0xd08f('0xc'))(_0xd08f('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xd08f('0xe')][0x2]);var QUERY=process[_0xd08f('0xe')][0x3];var PATH=process[_0xd08f('0xe')][0x4];var NAME=process[_0xd08f('0xe')][0x5];var FORMAT=_0xd08f('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1e76e7,_0xad2318){var _0x31c37b={'status':_0x1e76e7};var _0x1083c4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xad2318){_0x31c37b[_0xd08f('0x10')]=_0xad2318;}return db[_0xd08f('0x11')][_0xd08f('0x12')](_0x31c37b,_0x1083c4);}function getHeaders(_0x46ef07){return _[_0xd08f('0x13')](_0x46ef07,function(_0x6bd10a){return{'text':_0x6bd10a,'style':_0xd08f('0x14')};});}function getRows(_0x1e935d,_0x1ee147){return _[_0xd08f('0x13')](_0x1ee147,function(_0x5ab01d){return _(_0x5ab01d)[_0xd08f('0x15')](_0x1e935d)[_0xd08f('0x13')](function(_0x19e499){return _0x19e499?_[_0xd08f('0x16')](_0x19e499):'';})[_0xd08f('0x17')]();});}function createTable(_0x2d92f2,_0x5cd91e){var _0x3202c7={'widths':_[_0xd08f('0x18')](Array(_0x2d92f2[_0xd08f('0x19')]),0x91),'heights':function(_0x44f846){return _0x44f846===0x0?_0xd08f('0x1a'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x19d999=getHeaders(_0x2d92f2);_0x3202c7['body'][_0xd08f('0x1b')](_0x19d999);var _0x4692fb=getRows(_0x2d92f2,_0x5cd91e);_0x3202c7[_0xd08f('0x1c')]=_0x3202c7[_0xd08f('0x1c')]['concat'](_0x4692fb);return _0x3202c7;}function createTables(_0xb90648){var _0x151987=[];var _0x31d541=_['chunk'](Object[_0xd08f('0x1d')](_0xb90648[0x0]),0x5);_0x31d541[_0xd08f('0x1e')](function(_0x4d1fdb){_0x151987['push'](createTable(_0x4d1fdb,_0xb90648));});return _0x151987;}function getPDFDocDefinition(_0x13056a){var _0x1aa89f=util[_0xd08f('0x1f')](_0xd08f('0x20'),NAME,EXTRACTED_REPORT[_0xd08f('0x21')],moment(EXTRACTED_REPORT[_0xd08f('0x22')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xd08f('0x23')])['format'](FORMAT));var _0x1ef03e=[];for(var _0x213cc5=0x0;_0x213cc5<_0x13056a[_0xd08f('0x19')];_0x213cc5++){var _0x5e4ae4=[];if(_0x213cc5===0x0){_0x5e4ae4['push']({'text':_0x1aa89f,'style':_0xd08f('0x24')});}var _0x5997b0={'table':_0x13056a[_0x213cc5]};if(_0x213cc5>0x0){_0x5997b0[_0xd08f('0x25')]=_0xd08f('0x26');_0x5997b0[_0xd08f('0x27')]=[0x0,0x46,0x0,0x0];}_0x5e4ae4[_0xd08f('0x1b')](_0x5997b0);_0x1ef03e[_0xd08f('0x1b')](_0x5e4ae4);}return{'pageSize':'A4','pageOrientation':_0xd08f('0x28'),'content':_0x1ef03e,'footer':function(_0x3d79c7,_0x125abd){return{'text':_0x3d79c7[_0xd08f('0x16')]()+_0xd08f('0x29')+_0x125abd,'style':_0xd08f('0x2a')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xd08f('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2f3596){var _0x38d97a=0x1388;var _0x48264f;if(!_0x2f3596[0x0]['num']){return analyticExtractedReport(_0xd08f('0x2c'));}return db[_0xd08f('0x2d')][_0xd08f('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xd08f('0x2f')](function(_0x9aa26d){if(_0x9aa26d){_0x48264f=_0x9aa26d;_0x38d97a=_0x48264f['splitSizePdf']||0x3e8;}})[_0xd08f('0x2f')](function(){var _0x13cdef=[];var _0x4b866b=0x0;if(_0x48264f[_0xd08f('0x30')]){if(_0x2f3596&&_0x2f3596[_0xd08f('0x19')]){var _0x2f3ed1=_['range'](_0x2f3596[0x0][_0xd08f('0x31')]/_0x38d97a);var _0x3d73de=Number[_0xd08f('0x32')](_0x2f3596[0x0][_0xd08f('0x31')]/_0x38d97a)?_0x2f3596[0x0]['num']%_0x38d97a:0x0;_0x2f3ed1[_0xd08f('0x1e')](function(_0x261392){if(_0x261392>0x0){_0x4b866b+=_0x38d97a;}_0x13cdef[_0xd08f('0x1b')](dbH[_0xd08f('0x33')][_0xd08f('0x34')](util[_0xd08f('0x1f')](_0xd08f('0x35'),QUERY,_0x38d97a,_0x4b866b),{'type':dbH[_0xd08f('0x33')]['QueryTypes'][_0xd08f('0x36')]}));});if(_0x3d73de>0x0){_0x4b866b+=_0x38d97a;_0x13cdef[_0xd08f('0x1b')](dbH[_0xd08f('0x33')][_0xd08f('0x34')](util[_0xd08f('0x1f')](_0xd08f('0x35'),QUERY,_0x3d73de,_0x4b866b),{'type':dbH[_0xd08f('0x33')][_0xd08f('0x37')][_0xd08f('0x36')]}));}}}else{_0x13cdef[_0xd08f('0x1b')](dbH[_0xd08f('0x33')][_0xd08f('0x34')](QUERY,{'type':dbH[_0xd08f('0x33')][_0xd08f('0x37')][_0xd08f('0x36')]}));}var _0x577e42=path[_0xd08f('0x38')](PATH);var _0x3e79e7=path[_0xd08f('0x39')](PATH,_0xd08f('0x3a'));var _0x40fa5b=_0x48264f[_0xd08f('0x30')]&&_0x13cdef[_0xd08f('0x19')]>0x1;var _0x2ee6d7=[];if(!fs[_0xd08f('0x3b')](path['join'](_0x577e42,_0x3e79e7))&&_0x40fa5b){fs[_0xd08f('0x3c')](path[_0xd08f('0x3d')](_0x577e42,_0x3e79e7));}return BPromise[_0xd08f('0x3e')](_0x13cdef,function(_0x569048){_0x2ee6d7[_0xd08f('0x1b')](_0x569048);})['then'](function(){var _0x2f462c=[];for(var _0x810b63=0x0;_0x810b63<_0x2ee6d7[_0xd08f('0x19')];_0x810b63+=0x1){var _0x140d70=_0x2ee6d7[_0x810b63];var _0x21d25a=createTables(_[_0xd08f('0x3f')](_0x140d70));var _0x301447;var _0x5dce9a=getPDFDocDefinition(_0x21d25a);var _0x1d8725=getPDFPrinter();var _0x2d0c0b=_0x1d8725[_0xd08f('0x40')](_0x5dce9a);if(_0x40fa5b){_0x301447=path[_0xd08f('0x3d')](_0x577e42,_0x3e79e7,util['format'](_0xd08f('0x41'),_0x3e79e7,_0x810b63,_0xd08f('0x42')));}else{_0x301447=path[_0xd08f('0x3d')](_0x577e42,util['format'](_0xd08f('0x43'),_0x3e79e7,_0xd08f('0x42')));}_0x2f462c[_0xd08f('0x1b')](writePDFDocument(_0x2d0c0b,_0x301447));}return Promise[_0xd08f('0x44')](_0x2f462c);})[_0xd08f('0x2f')](function(){if(_0x40fa5b){return new Promise(function(_0xfd7bba){zipdir(path['join'](_0x577e42,_0x3e79e7),{'saveTo':path[_0xd08f('0x3d')](_0x577e42,util[_0xd08f('0x1f')](_0xd08f('0x43'),_0x3e79e7,_0xd08f('0x45')))},function(){rimraf(path[_0xd08f('0x3d')](_0x577e42,_0x3e79e7),function(){});_0xfd7bba('zip\x20finished');});});}})[_0xd08f('0x2f')](function(){if(!_0x40fa5b)return;rimraf(path['join'](_0x577e42,_0x3e79e7),function(){});})[_0xd08f('0x2f')](function(){logger[_0xd08f('0x46')](util[_0xd08f('0x1f')](_0xd08f('0x47'),EXTRACTED_REPORT_ID,_0xd08f('0x48')));return analyticExtractedReport('Completed',_0x40fa5b?util[_0xd08f('0x1f')]('%s.%s',_0x3e79e7,_0x40fa5b?'zip':_0xd08f('0x42')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xd08f('0x1f')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd08f('0x48')));return db[_0xd08f('0x11')][_0xd08f('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd08f('0x2f')](function(_0x68c39){EXTRACTED_REPORT=_0x68c39;return dbH[_0xd08f('0x33')][_0xd08f('0x34')](util[_0xd08f('0x1f')](_0xd08f('0x4a'),QUERY),{'type':dbH[_0xd08f('0x33')]['QueryTypes'][_0xd08f('0x36')]});})[_0xd08f('0x2f')](extractReport)[_0xd08f('0x4b')](function(_0xdaf41){logger[_0xd08f('0x46')](util[_0xd08f('0x1f')](_0xd08f('0x4c'),EXTRACTED_REPORT_ID,_0xd08f('0x48')),util[_0xd08f('0x4d')](_0xdaf41,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd08f('0x4e'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0xd34b27=new PdfPrinter({'Arial':{'normal':__dirname+_0xd08f('0x4f'),'bold':__dirname+_0xd08f('0x50'),'italics':__dirname+_0xd08f('0x51'),'bolditalics':__dirname+_0xd08f('0x52')}});return _0xd34b27;}function getPDFDocDefinitionFromHTML(_0x20e99f,_0x395b59){var _0xdbf8ba=util[_0xd08f('0x1f')](_0xd08f('0x53'),_0x395b59['channel'],_0x395b59['interactionId']);var _0x828d33=moment()[_0xd08f('0x1f')](_0xd08f('0x54'))[_0xd08f('0x16')]();var _0x4ea7d8=htmlToPdfmake(_0x20e99f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4ea7d8],'defaultStyle':{'font':_0xd08f('0x55')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd08f('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd08f('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd08f('0x56')}},'header':function(){return[{'text':_0xd08f('0x57'),'style':_0xd08f('0x24')}];},'footer':function(_0x540ffa,_0x299066){return[{'text':util[_0xd08f('0x1f')](_0xd08f('0x58'),_0xdbf8ba,_0x540ffa,_0x299066,_0x828d33),'style':'footer'}];}};}function writePDFDocument(_0x5dedae,_0xaf82f1){return new Promise(function(_0x3f3504,_0x1a9ce3){var _0x44e015=_0x5dedae[_0xd08f('0x59')](fs[_0xd08f('0x5a')](_0xaf82f1));_0x44e015['on'](_0xd08f('0x5b'),function(){_0x3f3504('finish');});_0x44e015['on'](_0xd08f('0x5c'),function(_0x314c68){_0x1a9ce3(_0x314c68);});_0x5dedae[_0xd08f('0x5d')]();});}exports['createPdfFromHTML']=function(_0x24b959,_0x34a1f2){var _0x286517=getPDFPrinter();var _0x58d888=getPDFDocDefinitionFromHTML(_0x24b959,_0x34a1f2);var _0x19e07a=_0x286517[_0xd08f('0x40')](_0x58d888);return writePDFDocument(_0x19e07a,_0x34a1f2[_0xd08f('0x1')])['catch'](function(_0x324b61){throw _0x324b61;});}; \ No newline at end of file +var _0x5b0f=['sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','basename','.pdf','split','existsSync','join','then','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','toString','center','Interaction\x20Transcript','pipe','createWriteStream','finish','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','body','push','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','pageBreak','before','margin','landscape','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','range','isInteger','forEach'];(function(_0x2321b9,_0x5071a2){var _0x15897f=function(_0x49e4d6){while(--_0x49e4d6){_0x2321b9['push'](_0x2321b9['shift']());}};_0x15897f(++_0x5071a2);}(_0x5b0f,0x1e2));var _0xf5b0=function(_0x3bcda9,_0x277f01){_0x3bcda9=_0x3bcda9-0x0;var _0x54991f=_0x5b0f[_0x3bcda9];return _0x54991f;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xf5b0('0x0'));var moment=require(_0xf5b0('0x1'));var htmlToPdfmake=require(_0xf5b0('0x2'));var PdfPrinter=require(_0xf5b0('0x3'));var zipdir=require(_0xf5b0('0x4'));var rimraf=require(_0xf5b0('0x5'));var JSDOM=require(_0xf5b0('0x6'))[_0xf5b0('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0xf5b0('0x8'));var db=require(_0xf5b0('0x9'))['db'];var dbH=require('../../mysqldb')[_0xf5b0('0xa')];var logger=require(_0xf5b0('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf5b0('0xc')][0x3];var PATH=process[_0xf5b0('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5b0('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x360f29,_0x1518f3){var _0x9f7496={'status':_0x360f29};var _0x207c6b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1518f3){_0x9f7496[_0xf5b0('0xe')]=_0x1518f3;}return db[_0xf5b0('0xf')][_0xf5b0('0x10')](_0x9f7496,_0x207c6b);}function getHeaders(_0x20519b){return _[_0xf5b0('0x11')](_0x20519b,function(_0x3eaf60){return{'text':_0x3eaf60,'style':_0xf5b0('0x12')};});}function getRows(_0x10c6a3,_0x5c3484){return _[_0xf5b0('0x11')](_0x5c3484,function(_0x3c88b4){return _(_0x3c88b4)['pick'](_0x10c6a3)['map'](function(_0x358700){return _0x358700?_['toString'](_0x358700):'';})['value']();});}function createTable(_0x38c2e0,_0x336478){var _0x52911c={'widths':_['fill'](Array(_0x38c2e0['length']),0x91),'heights':function(_0x53551e){return _0x53551e===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x579f49=getHeaders(_0x38c2e0);_0x52911c[_0xf5b0('0x13')][_0xf5b0('0x14')](_0x579f49);var _0x45023f=getRows(_0x38c2e0,_0x336478);_0x52911c[_0xf5b0('0x13')]=_0x52911c[_0xf5b0('0x13')]['concat'](_0x45023f);return _0x52911c;}function createTables(_0x1dc581){var _0x55128f=[];var _0x2812e3=_[_0xf5b0('0x15')](Object[_0xf5b0('0x16')](_0x1dc581[0x0]),0x5);_0x2812e3['forEach'](function(_0x293258){_0x55128f[_0xf5b0('0x14')](createTable(_0x293258,_0x1dc581));});return _0x55128f;}function getPDFDocDefinition(_0x581db6){var _0x54f8c1=util[_0xf5b0('0x17')](_0xf5b0('0x18'),NAME,EXTRACTED_REPORT[_0xf5b0('0x19')],moment(EXTRACTED_REPORT[_0xf5b0('0x1a')])[_0xf5b0('0x17')](FORMAT),moment(EXTRACTED_REPORT[_0xf5b0('0x1b')])['format'](FORMAT));var _0x4523fc=[];for(var _0x4ed050=0x0;_0x4ed050<_0x581db6[_0xf5b0('0x1c')];_0x4ed050++){var _0x520601=[];if(_0x4ed050===0x0){_0x520601[_0xf5b0('0x14')]({'text':_0x54f8c1,'style':_0xf5b0('0x1d')});}var _0x103e18={'table':_0x581db6[_0x4ed050]};if(_0x4ed050>0x0){_0x103e18[_0xf5b0('0x1e')]=_0xf5b0('0x1f');_0x103e18[_0xf5b0('0x20')]=[0x0,0x46,0x0,0x0];}_0x520601[_0xf5b0('0x14')](_0x103e18);_0x4523fc[_0xf5b0('0x14')](_0x520601);}return{'pageSize':'A4','pageOrientation':_0xf5b0('0x21'),'content':_0x4523fc,'footer':function(_0x3377f9,_0x18d28e){return{'text':_0x3377f9['toString']()+'\x20/\x20'+_0x18d28e,'style':_0xf5b0('0x22')};},'defaultStyle':{'font':_0xf5b0('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf5b0('0x24')},'footer':{'alignment':_0xf5b0('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3bb376){var _0x5cafaa=0x1388;var _0x421b5f;if(!_0x3bb376[0x0][_0xf5b0('0x26')]){return analyticExtractedReport(_0xf5b0('0x27'));}return db[_0xf5b0('0x28')][_0xf5b0('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf5b0('0x2a')]})['then'](function(_0x121389){if(_0x121389){_0x421b5f=_0x121389;_0x5cafaa=_0x421b5f[_0xf5b0('0x2a')]||0x3e8;}})['then'](function(){var _0x30ffa1=[];var _0x344463=0x0;if(_0x421b5f['split']){if(_0x3bb376&&_0x3bb376[_0xf5b0('0x1c')]){var _0x6ede56=_[_0xf5b0('0x2b')](_0x3bb376[0x0][_0xf5b0('0x26')]/_0x5cafaa);var _0x23f3fe=Number[_0xf5b0('0x2c')](_0x3bb376[0x0][_0xf5b0('0x26')]/_0x5cafaa)?_0x3bb376[0x0][_0xf5b0('0x26')]%_0x5cafaa:0x0;_0x6ede56[_0xf5b0('0x2d')](function(_0x4baf03){if(_0x4baf03>0x0){_0x344463+=_0x5cafaa;}_0x30ffa1['push'](dbH[_0xf5b0('0x2e')]['query'](util['format'](_0xf5b0('0x2f'),QUERY,_0x5cafaa,_0x344463),{'type':dbH['sequelize'][_0xf5b0('0x30')]['SELECT']}));});if(_0x23f3fe>0x0){_0x344463+=_0x5cafaa;_0x30ffa1['push'](dbH['sequelize']['query'](util[_0xf5b0('0x17')](_0xf5b0('0x2f'),QUERY,_0x23f3fe,_0x344463),{'type':dbH[_0xf5b0('0x2e')][_0xf5b0('0x30')][_0xf5b0('0x31')]}));}}}else{_0x30ffa1[_0xf5b0('0x14')](dbH[_0xf5b0('0x2e')][_0xf5b0('0x32')](QUERY,{'type':dbH[_0xf5b0('0x2e')][_0xf5b0('0x30')]['SELECT']}));}var _0x27e8f8=path['dirname'](PATH);var _0x347d82=path[_0xf5b0('0x33')](PATH,_0xf5b0('0x34'));var _0x5df7bd=_0x421b5f[_0xf5b0('0x35')]&&_0x30ffa1[_0xf5b0('0x1c')]>0x1;var _0x300198=[];if(!fs[_0xf5b0('0x36')](path[_0xf5b0('0x37')](_0x27e8f8,_0x347d82))&&_0x5df7bd){fs['mkdirSync'](path[_0xf5b0('0x37')](_0x27e8f8,_0x347d82));}return BPromise['each'](_0x30ffa1,function(_0x56257d){_0x300198['push'](_0x56257d);})[_0xf5b0('0x38')](function(){var _0x3bf362=[];for(var _0x3925c2=0x0;_0x3925c2<_0x300198['length'];_0x3925c2+=0x1){var _0x41118e=_0x300198[_0x3925c2];var _0x3ff6aa=createTables(_[_0xf5b0('0x39')](_0x41118e));var _0x53faf7;var _0x22a065=getPDFDocDefinition(_0x3ff6aa);var _0xeb18e2=getPDFPrinter();var _0x286faa=_0xeb18e2[_0xf5b0('0x3a')](_0x22a065);if(_0x5df7bd){_0x53faf7=path[_0xf5b0('0x37')](_0x27e8f8,_0x347d82,util[_0xf5b0('0x17')](_0xf5b0('0x3b'),_0x347d82,_0x3925c2,_0xf5b0('0x3c')));}else{_0x53faf7=path[_0xf5b0('0x37')](_0x27e8f8,util[_0xf5b0('0x17')](_0xf5b0('0x3d'),_0x347d82,_0xf5b0('0x3c')));}_0x3bf362[_0xf5b0('0x14')](writePDFDocument(_0x286faa,_0x53faf7));}return Promise['all'](_0x3bf362);})[_0xf5b0('0x38')](function(){if(_0x5df7bd){return new Promise(function(_0x472380){zipdir(path['join'](_0x27e8f8,_0x347d82),{'saveTo':path[_0xf5b0('0x37')](_0x27e8f8,util['format']('%s.%s',_0x347d82,_0xf5b0('0x3e')))},function(){rimraf(path['join'](_0x27e8f8,_0x347d82),function(){});_0x472380(_0xf5b0('0x3f'));});});}})[_0xf5b0('0x38')](function(){if(!_0x5df7bd)return;rimraf(path[_0xf5b0('0x37')](_0x27e8f8,_0x347d82),function(){});})[_0xf5b0('0x38')](function(){logger[_0xf5b0('0x40')](util[_0xf5b0('0x17')](_0xf5b0('0x41'),EXTRACTED_REPORT_ID,_0xf5b0('0x42')));return analyticExtractedReport(_0xf5b0('0x43'),_0x5df7bd?util[_0xf5b0('0x17')](_0xf5b0('0x3d'),_0x347d82,_0x5df7bd?_0xf5b0('0x3e'):_0xf5b0('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xf5b0('0x17')](_0xf5b0('0x44'),EXTRACTED_REPORT_ID,_0xf5b0('0x42')));return db[_0xf5b0('0xf')][_0xf5b0('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5b0('0x38')](function(_0x1ba98b){EXTRACTED_REPORT=_0x1ba98b;return dbH['sequelize'][_0xf5b0('0x32')](util[_0xf5b0('0x17')](_0xf5b0('0x46'),QUERY),{'type':dbH[_0xf5b0('0x2e')]['QueryTypes'][_0xf5b0('0x31')]});})[_0xf5b0('0x38')](extractReport)[_0xf5b0('0x47')](function(_0x35e780){logger[_0xf5b0('0x40')](util[_0xf5b0('0x17')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf5b0('0x42')),util[_0xf5b0('0x48')](_0x35e780,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf5b0('0x49'));})[_0xf5b0('0x4a')](function(){process[_0xf5b0('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2b3a99=new PdfPrinter({'Arial':{'normal':__dirname+_0xf5b0('0x4c'),'bold':__dirname+_0xf5b0('0x4d'),'italics':__dirname+_0xf5b0('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x2b3a99;}function getPDFDocDefinitionFromHTML(_0x9138f9,_0x29294b){var _0x4d6d78=util[_0xf5b0('0x17')](_0xf5b0('0x4f'),_0x29294b[_0xf5b0('0x50')],_0x29294b['interactionId']);var _0x1ea938=moment()[_0xf5b0('0x17')](_0xf5b0('0x51'))[_0xf5b0('0x52')]();var _0x321a4d=htmlToPdfmake(_0x9138f9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x321a4d],'defaultStyle':{'font':_0xf5b0('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf5b0('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf5b0('0x53')}},'header':function(){return[{'text':_0xf5b0('0x54'),'style':_0xf5b0('0x1d')}];},'footer':function(_0x4a079c,_0x15931a){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x4d6d78,_0x4a079c,_0x15931a,_0x1ea938),'style':_0xf5b0('0x22')}];}};}function writePDFDocument(_0x52cef0,_0x30bdb7){return new Promise(function(_0x493184,_0x100916){var _0x4c9382=_0x52cef0[_0xf5b0('0x55')](fs[_0xf5b0('0x56')](_0x30bdb7));_0x4c9382['on'](_0xf5b0('0x57'),function(){_0x493184('finish');});_0x4c9382['on']('error',function(_0x1e1eed){_0x100916(_0x1e1eed);});_0x52cef0['end']();});}exports['createPdfFromHTML']=function(_0x59ff39,_0x54381f){var _0x15afa8=getPDFPrinter();var _0x4c93f3=getPDFDocDefinitionFromHTML(_0x59ff39,_0x54381f);var _0x44a963=_0x15afa8[_0xf5b0('0x3a')](_0x4c93f3);return writePDFDocument(_0x44a963,_0x54381f[_0xf5b0('0x0')])[_0xf5b0('0x47')](function(_0x158e26){throw _0x158e26;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 92da872..7c094fd 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 _0x6d1d=['Empty','length','range','forEach','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','each','xlsx','binary','%s.%s','zip','zip\x20finished','Completed','inspect','finally','exit','path','lodash','json2xls','rimraf','../../mysqldb','../../config/logger','analytics','argv','update','info','format','XLSX','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num'];(function(_0x35dac8,_0x326a1d){var _0x4e29ca=function(_0x535781){while(--_0x535781){_0x35dac8['push'](_0x35dac8['shift']());}};_0x4e29ca(++_0x326a1d);}(_0x6d1d,0x19a));var _0xd6d1=function(_0x33b731,_0x59f6ab){_0x33b731=_0x33b731-0x0;var _0x285490=_0x6d1d[_0x33b731];return _0x285490;};'use strict';var util=require('util');var path=require(_0xd6d1('0x0'));var _=require(_0xd6d1('0x1'));var fs=require('fs');var json2xls=require(_0xd6d1('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xd6d1('0x3'));var db=require(_0xd6d1('0x4'))['db'];var dbH=require(_0xd6d1('0x4'))['dbH'];var logger=require(_0xd6d1('0x5'))(_0xd6d1('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd6d1('0x7')][0x3];var PATH=process[_0xd6d1('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x49368f,_0x3cd502){var _0xabfac7={'status':_0x49368f};var _0x4ccbbf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3cd502){_0xabfac7['savename']=_0x3cd502;}return db['AnalyticExtractedReport'][_0xd6d1('0x8')](_0xabfac7,_0x4ccbbf);}function main(){var _0x42cb25=0x1388;var _0x44b6c3;logger[_0xd6d1('0x9')](util[_0xd6d1('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd6d1('0xb')));return db['Setting'][_0xd6d1('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd6d1('0xd'),_0xd6d1('0xe')]})[_0xd6d1('0xf')](function(_0x889e41){if(_0x889e41){_0x44b6c3=_0x889e41;_0x42cb25=_0x44b6c3[_0xd6d1('0xe')]||0x1388;}})[_0xd6d1('0xf')](function(){return dbH['sequelize'][_0xd6d1('0x10')](util[_0xd6d1('0xa')](_0xd6d1('0x11'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xd6d1('0x12')]});})[_0xd6d1('0xf')](function(_0x348b64){if(!_0x348b64[0x0][_0xd6d1('0x13')]){return analyticExtractedReport(_0xd6d1('0x14'));}var _0x1ebfd3=[];var _0x4de81e=0x0;if(_0x44b6c3[_0xd6d1('0xd')]){if(_0x348b64&&_0x348b64[_0xd6d1('0x15')]){var _0xe18368=_[_0xd6d1('0x16')](_0x348b64[0x0][_0xd6d1('0x13')]/_0x42cb25);var _0x2b8c17=Number['isInteger'](_0x348b64[0x0]['num']/_0x42cb25)?_0x348b64[0x0][_0xd6d1('0x13')]%_0x42cb25:0x0;_0xe18368[_0xd6d1('0x17')](function(_0x197367){if(_0x197367>0x0){_0x4de81e+=_0x42cb25;}_0x1ebfd3[_0xd6d1('0x18')](dbH[_0xd6d1('0x19')][_0xd6d1('0x10')](util[_0xd6d1('0xa')](_0xd6d1('0x1a'),QUERY,_0x42cb25,_0x4de81e),{'type':dbH[_0xd6d1('0x19')][_0xd6d1('0x1b')][_0xd6d1('0x12')]}));});if(_0x2b8c17>0x0){_0x4de81e+=_0x42cb25;_0x1ebfd3[_0xd6d1('0x18')](dbH[_0xd6d1('0x19')][_0xd6d1('0x10')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2b8c17,_0x4de81e),{'type':dbH[_0xd6d1('0x19')][_0xd6d1('0x1b')][_0xd6d1('0x12')]}));}}}else{_0x1ebfd3[_0xd6d1('0x18')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xd6d1('0x19')][_0xd6d1('0x1b')]['SELECT']}));}var _0x323e2e=path[_0xd6d1('0x1c')](PATH);var _0x966c2e=path[_0xd6d1('0x1d')](PATH,_0xd6d1('0x1e'));var _0x1a0476=_0x44b6c3[_0xd6d1('0xd')]&&_0x1ebfd3[_0xd6d1('0x15')]>0x1;var _0x321ce7=[];if(!fs[_0xd6d1('0x1f')](path[_0xd6d1('0x20')](_0x323e2e,_0x966c2e))&&_0x1a0476){fs['mkdirSync'](path[_0xd6d1('0x20')](_0x323e2e,_0x966c2e));}return BPromise[_0xd6d1('0x21')](_0x1ebfd3,function(_0x142b84){_0x321ce7[_0xd6d1('0x18')](_0x142b84);})[_0xd6d1('0xf')](function(){for(var _0x1a00ab=0x0;_0x1a00ab<_0x321ce7['length'];_0x1a00ab+=0x1){var _0x126087;var _0x46013b=_0x321ce7[_0x1a00ab];if(_0x1a0476){_0x126087=path['join'](_0x323e2e,_0x966c2e,util['format']('%s%d.%s',_0x966c2e,_0x1a00ab,_0xd6d1('0x22')));}else{_0x126087=path['join'](_0x323e2e,util[_0xd6d1('0xa')]('%s.%s',_0x966c2e,_0xd6d1('0x22')));}fs['writeFileSync'](_0x126087,json2xls(_0x46013b),_0xd6d1('0x23'));}})[_0xd6d1('0xf')](function(){if(_0x1a0476){return new Promise(function(_0x4e0f16){zipdir(path[_0xd6d1('0x20')](_0x323e2e,_0x966c2e),{'saveTo':path[_0xd6d1('0x20')](_0x323e2e,util['format'](_0xd6d1('0x24'),_0x966c2e,_0xd6d1('0x25')))},function(_0x46b8b9,_0x469a09){rimraf(path[_0xd6d1('0x20')](_0x323e2e,_0x966c2e),function(){});_0x4e0f16(_0xd6d1('0x26'));});});}})[_0xd6d1('0xf')](function(){logger[_0xd6d1('0x9')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd6d1('0xb')));return analyticExtractedReport(_0xd6d1('0x27'),_0x1a0476?util[_0xd6d1('0xa')](_0xd6d1('0x24'),_0x966c2e,_0x1a0476?_0xd6d1('0x25'):'xlsx'):null);});})['catch'](function(_0x44e475){logger[_0xd6d1('0x9')](util[_0xd6d1('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd6d1('0xb')),util[_0xd6d1('0x28')](_0x44e475,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xd6d1('0x29')](function(){process[_0xd6d1('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6738=['argv','savename','update','info','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','mkdirSync','length','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x27c94b,_0x337503){var _0x150d1b=function(_0x51e04d){while(--_0x51e04d){_0x27c94b['push'](_0x27c94b['shift']());}};_0x150d1b(++_0x337503);}(_0x6738,0x16f));var _0x8673=function(_0x42ec2f,_0x3fb472){_0x42ec2f=_0x42ec2f-0x0;var _0x2beb90=_0x6738[_0x42ec2f];return _0x2beb90;};'use strict';var util=require(_0x8673('0x0'));var path=require('path');var _=require(_0x8673('0x1'));var fs=require('fs');var json2xls=require(_0x8673('0x2'));var BPromise=require(_0x8673('0x3'));var zipdir=require(_0x8673('0x4'));var rimraf=require(_0x8673('0x5'));var db=require(_0x8673('0x6'))['db'];var dbH=require(_0x8673('0x6'))[_0x8673('0x7')];var logger=require(_0x8673('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8673('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8673('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x28c699,_0xb0dd89){var _0xa06381={'status':_0x28c699};var _0x584593={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb0dd89){_0xa06381[_0x8673('0xa')]=_0xb0dd89;}return db['AnalyticExtractedReport'][_0x8673('0xb')](_0xa06381,_0x584593);}function main(){var _0x435099=0x1388;var _0x1e28df;logger[_0x8673('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8673('0xd')));return db[_0x8673('0xe')][_0x8673('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8673('0x10'),_0x8673('0x11')]})[_0x8673('0x12')](function(_0x3aea98){if(_0x3aea98){_0x1e28df=_0x3aea98;_0x435099=_0x1e28df[_0x8673('0x11')]||0x1388;}})['then'](function(){return dbH[_0x8673('0x13')][_0x8673('0x14')](util[_0x8673('0x15')](_0x8673('0x16'),QUERY),{'type':dbH[_0x8673('0x13')][_0x8673('0x17')]['SELECT']});})['then'](function(_0xf3794e){if(!_0xf3794e[0x0][_0x8673('0x18')]){return analyticExtractedReport('Empty');}var _0x1f61af=[];var _0x5324bf=0x0;if(_0x1e28df[_0x8673('0x10')]){if(_0xf3794e&&_0xf3794e['length']){var _0x27e82c=_['range'](_0xf3794e[0x0][_0x8673('0x18')]/_0x435099);var _0x2fe9ad=Number[_0x8673('0x19')](_0xf3794e[0x0][_0x8673('0x18')]/_0x435099)?_0xf3794e[0x0][_0x8673('0x18')]%_0x435099:0x0;_0x27e82c[_0x8673('0x1a')](function(_0x46e30a){if(_0x46e30a>0x0){_0x5324bf+=_0x435099;}_0x1f61af[_0x8673('0x1b')](dbH[_0x8673('0x13')]['query'](util['format'](_0x8673('0x1c'),QUERY,_0x435099,_0x5324bf),{'type':dbH[_0x8673('0x13')][_0x8673('0x17')]['SELECT']}));});if(_0x2fe9ad>0x0){_0x5324bf+=_0x435099;_0x1f61af[_0x8673('0x1b')](dbH[_0x8673('0x13')][_0x8673('0x14')](util[_0x8673('0x15')](_0x8673('0x1c'),QUERY,_0x2fe9ad,_0x5324bf),{'type':dbH[_0x8673('0x13')][_0x8673('0x17')][_0x8673('0x1d')]}));}}}else{_0x1f61af[_0x8673('0x1b')](dbH[_0x8673('0x13')]['query'](QUERY,{'type':dbH[_0x8673('0x13')][_0x8673('0x17')]['SELECT']}));}var _0x44e003=path[_0x8673('0x1e')](PATH);var _0x2ded3d=path[_0x8673('0x1f')](PATH,'.xlsx');var _0x3c0c48=_0x1e28df[_0x8673('0x10')]&&_0x1f61af['length']>0x1;var _0x23c581=[];if(!fs[_0x8673('0x20')](path[_0x8673('0x21')](_0x44e003,_0x2ded3d))&&_0x3c0c48){fs[_0x8673('0x22')](path[_0x8673('0x21')](_0x44e003,_0x2ded3d));}return BPromise['each'](_0x1f61af,function(_0x90ec4c){_0x23c581[_0x8673('0x1b')](_0x90ec4c);})[_0x8673('0x12')](function(){for(var _0x33cda1=0x0;_0x33cda1<_0x23c581[_0x8673('0x23')];_0x33cda1+=0x1){var _0x37a201;var _0x2485a8=_0x23c581[_0x33cda1];if(_0x3c0c48){_0x37a201=path[_0x8673('0x21')](_0x44e003,_0x2ded3d,util[_0x8673('0x15')](_0x8673('0x24'),_0x2ded3d,_0x33cda1,_0x8673('0x25')));}else{_0x37a201=path['join'](_0x44e003,util['format'](_0x8673('0x26'),_0x2ded3d,_0x8673('0x25')));}fs[_0x8673('0x27')](_0x37a201,json2xls(_0x2485a8),_0x8673('0x28'));}})[_0x8673('0x12')](function(){if(_0x3c0c48){return new Promise(function(_0x45ae86){zipdir(path[_0x8673('0x21')](_0x44e003,_0x2ded3d),{'saveTo':path[_0x8673('0x21')](_0x44e003,util[_0x8673('0x15')](_0x8673('0x26'),_0x2ded3d,_0x8673('0x29')))},function(_0x38f153,_0x5e8b03){rimraf(path[_0x8673('0x21')](_0x44e003,_0x2ded3d),function(){});_0x45ae86('zip\x20finished');});});}})[_0x8673('0x12')](function(){logger[_0x8673('0xc')](util[_0x8673('0x15')](_0x8673('0x2a'),EXTRACTED_REPORT_ID,_0x8673('0xd')));return analyticExtractedReport('Completed',_0x3c0c48?util['format']('%s.%s',_0x2ded3d,_0x3c0c48?_0x8673('0x29'):_0x8673('0x25')):null);});})[_0x8673('0x2b')](function(_0x3e8ede){logger['info'](util[_0x8673('0x15')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8673('0xd')),util[_0x8673('0x2c')](_0x3e8ede,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8673('0x2d')](function(){process[_0x8673('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 137c7a5..9e8b8ae 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 _0x2cf1=['filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','CDR(routeid)=','outbound','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','map','interval','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime','last','concat','transaction','sortBy','catch','rewrite','lodash','findAll','then','intervals','VoiceExtension','IntervalId','models','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x3c40f9,_0x4de5ff){var _0x43ca76=function(_0x3abdfa){while(--_0x3abdfa){_0x3c40f9['push'](_0x3c40f9['shift']());}};_0x43ca76(++_0x4de5ff);}(_0x2cf1,0x194));var _0x12cf=function(_0x256edf,_0x3925a5){_0x256edf=_0x256edf-0x0;var _0x451190=_0x2cf1[_0x256edf];return _0x451190;};'use strict';var _=require(_0x12cf('0x0'));var util=require('util');function rewrite(_0xcd7fce,_0x3b2c6d){var _0x2b2f63=this;return _0xcd7fce['models']['Interval'][_0x12cf('0x1')]({'raw':!![]})[_0x12cf('0x2')](function(_0x49098b){_0x2b2f63[_0x12cf('0x3')]=_0x49098b;return _0xcd7fce['models'][_0x12cf('0x4')][_0x12cf('0x1')]({'where':{'IntervalId':_0x3b2c6d[_0x12cf('0x5')]},'raw':!![]});})[_0x12cf('0x2')](function(_0x349db4){return _0xcd7fce[_0x12cf('0x6')][_0x12cf('0x4')]['findAll']({'where':{'exten':{'$in':_[_0x12cf('0x7')](_['map'](_0x349db4,_0x12cf('0x8')))}},'order':[{'raw':_0x12cf('0x9')}],'raw':!![]});})[_0x12cf('0x2')](function(_0x136e76){var _0xbc8e7c=_[_0x12cf('0xa')](_0x136e76,{'priority':'1'});var _0x899575=_[_0x12cf('0xa')](_0x136e76,{'isApp':0x1});var _0xd93f8a=_[_0x12cf('0xb')](_0x899575,_0x12cf('0x8'));var _0x3bcb26=[_0x12cf('0xc'),_0x12cf('0xd')];var _0x36d4b4=[];var _0x13d62b=[];for(var _0x3b889d in _0xd93f8a){if(_0xd93f8a[_0x12cf('0xe')](_0x3b889d)){_0x2b2f63[_0x12cf('0xf')]=0x2;_0x2b2f63[_0x12cf('0x10')]=[];_0x2b2f63[_0x12cf('0x11')]=_[_0x12cf('0x12')](_0xbc8e7c,{'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')]});_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':util[_0x12cf('0x16')]('CDR(type)=%s',_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')]),'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0]['exten'],'priority':_0x2b2f63['priority']++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});if(_0xd93f8a[_0x3b889d][0x0]['type']==='inbound'){_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x19')+_0xd93f8a[_0x3b889d][0x0]['VoiceExtensionId'],'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});}else if(_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')]===_0x12cf('0x1a')){if(_0x2b2f63[_0x12cf('0x11')]){_0x2b2f63[_0x12cf('0x10')]['push']({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':'CDR(destination)='+(_0x2b2f63['extension']['cutdigits']?_0x12cf('0x1b')+_0x2b2f63[_0x12cf('0x11')][_0x12cf('0x1c')]+'}':_0x12cf('0x1d')),'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63['priority']++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});}_0x2b2f63[_0x12cf('0x10')]['push']({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x19')+_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')],'context':_0xd93f8a[_0x3b889d][0x0]['context'],'exten':_0xd93f8a[_0x3b889d][0x0]['exten'],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});var _0x4ade05=_0x2b2f63[_0x12cf('0xf')]++;_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x1e'),'appdata':_0x12cf('0x1f')+(_0x4ade05+0x2)+_0x12cf('0x20')+(_0x4ade05+0x1)+')','context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0]['exten'],'priority':_0x4ade05,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});if(_0x2b2f63[_0x12cf('0x11')]){_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':'Set','appdata':_0x2b2f63[_0x12cf('0x11')]['cutdigits']?_0x12cf('0x21')+_0x2b2f63[_0x12cf('0x11')][_0x12cf('0x1c')]+'}':_0x12cf('0x22'),'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0]['exten'],'priority':_0x2b2f63['priority']++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0]['VoiceExtensionId']});}_0x2b2f63['extensions'][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':'outboundrouteid='+_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')],'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63['priority']++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});if(_0x2b2f63[_0x12cf('0x11')]&&_0x2b2f63[_0x12cf('0x11')][_0x12cf('0xe')](_0x12cf('0x23'))&&_0x2b2f63[_0x12cf('0x11')][_0x12cf('0x23')]!==_0x12cf('0x24')){_0x2b2f63['extensions'][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x25'),'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});_0x2b2f63['extensions'][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x26')+_0x2b2f63[_0x12cf('0x11')][_0x12cf('0x23')]||_0x12cf('0x27'),'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});}}_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x28'),'context':_0xd93f8a[_0x3b889d][0x0]['context'],'exten':_0xd93f8a[_0x3b889d][0x0]['exten'],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x29'),'context':_0xd93f8a[_0x3b889d][0x0]['context'],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0]['VoiceExtensionId']});_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x2a'),'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'priority':_0x2b2f63[_0x12cf('0xf')]++,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});for(var _0x3beef7=0x0,_0x565f90=0x0;_0x3beef7<_0xd93f8a[_0x3b889d][_0x12cf('0x2b')];_0x3beef7+=0x1,_0x565f90=0x0){var _0x3a4d5f=_0xd93f8a[_0x3b889d][_0x3beef7];if(_0x3a4d5f[_0x12cf('0x14')]){_0x3a4d5f[_0x12cf('0x14')]=_0x3a4d5f[_0x12cf('0x14')]['toLowerCase']();}var _0x231397=[];var _0x26c22e=[];delete _0x3a4d5f['id'];delete _0x3a4d5f[_0x12cf('0x2c')];delete _0x3a4d5f[_0x12cf('0x2d')];var _0x46b289=_0x3a4d5f['interval']!==_0x12cf('0x2e')?[_0x3a4d5f['interval']]:_0x3a4d5f[_0x12cf('0x5')]?_[_0x12cf('0x2f')](_[_0x12cf('0xa')](_0x2b2f63[_0x12cf('0x3')],{'IntervalId':_0x3a4d5f['IntervalId']}),_0x12cf('0x30')):[];if(_0x3a4d5f['hasOwnProperty']('tag')){if(_0x3a4d5f[_0x12cf('0x31')]&&_0x3a4d5f[_0x12cf('0x31')]!=='--'){_0x231397['push']({'type':_0x3a4d5f[_0x12cf('0x14')],'app':_0x12cf('0x15'),'appdata':'CDR(tag)='+_0x3a4d5f['tag'],'context':_0x3a4d5f[_0x12cf('0x17')],'exten':_0x3a4d5f[_0x12cf('0x8')],'priority':_0x46b289[_0x12cf('0x2b')]+_0x2b2f63[_0x12cf('0xf')]+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});}}if(_0x3a4d5f['type']==='outbound'&&_0x3a4d5f['hasOwnProperty'](_0x12cf('0x32'))){if(_0x3a4d5f[_0x12cf('0x32')]){_0x231397[_0x12cf('0x13')]({'type':_0x3a4d5f[_0x12cf('0x14')],'app':_0x12cf('0x1e'),'appdata':_0x12cf('0x33')+_0x3a4d5f[_0x12cf('0x32')]+')','context':_0x3a4d5f[_0x12cf('0x17')],'exten':_0x3a4d5f[_0x12cf('0x8')],'priority':_0x46b289[_0x12cf('0x2b')]+_0x2b2f63['priority']+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});}else{_0x231397[_0x12cf('0x13')]({'type':_0x3a4d5f[_0x12cf('0x14')],'app':_0x12cf('0x1e'),'appdata':_0x12cf('0x34'),'context':_0x3a4d5f['context'],'exten':_0x3a4d5f['exten'],'priority':_0x46b289[_0x12cf('0x2b')]+_0x2b2f63[_0x12cf('0xf')]+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});}}if(_0x3a4d5f[_0x12cf('0xe')](_0x12cf('0x35'))){if(_0x3bcb26[_0x12cf('0x36')](_0x3a4d5f['app'][_0x12cf('0x37')]())>=0x0&&_0x3a4d5f[_0x12cf('0x38')]!==_0x12cf('0x39')){if(_0x3a4d5f['answer']){_0x231397['push']({'type':_0x3a4d5f[_0x12cf('0x14')],'app':_0x12cf('0x1e'),'appdata':_0x12cf('0x3a'),'context':_0x3a4d5f['context'],'exten':_0x3a4d5f[_0x12cf('0x8')],'priority':_0x46b289['length']+_0x2b2f63['priority']+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});_0x231397[_0x12cf('0x13')]({'type':_0x3a4d5f['type'],'app':'Set','appdata':_0x12cf('0x3b'),'context':_0x3a4d5f[_0x12cf('0x17')],'exten':_0x3a4d5f['exten'],'priority':_0x46b289[_0x12cf('0x2b')]+_0x2b2f63[_0x12cf('0xf')]+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});}else{_0x231397[_0x12cf('0x13')]({'type':_0x3a4d5f['type'],'app':_0x12cf('0x1e'),'appdata':_0x12cf('0x3c'),'context':_0x3a4d5f[_0x12cf('0x17')],'exten':_0x3a4d5f[_0x12cf('0x8')],'priority':_0x46b289['length']+_0x2b2f63[_0x12cf('0xf')]+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});_0x231397[_0x12cf('0x13')]({'type':_0x3a4d5f['type'],'app':_0x12cf('0x15'),'appdata':_0x12cf('0x3d'),'context':_0x3a4d5f[_0x12cf('0x17')],'exten':_0x3a4d5f[_0x12cf('0x8')],'priority':_0x46b289[_0x12cf('0x2b')]+_0x2b2f63[_0x12cf('0xf')]+_0x565f90++,'VoiceExtensionId':_0x3a4d5f[_0x12cf('0x18')]});}}}for(var _0x5a0542=0x0;_0x5a0542<_0x46b289[_0x12cf('0x2b')];_0x5a0542+=0x1){var _0x26cfcb=_0x2b2f63[_0x12cf('0xf')]+_0x46b289[_0x12cf('0x2b')];var _0x3942c2=_0x5a0542===_0x46b289[_0x12cf('0x2b')]-0x1?_0x2b2f63[_0x12cf('0xf')]+_0x231397[_0x12cf('0x2b')]+_0x26c22e[_0x12cf('0x2b')]+0x2:_0x2b2f63[_0x12cf('0xf')]+_0x5a0542+0x1;_0x231397['splice'](_0x5a0542,0x0,{'type':_0x3a4d5f[_0x12cf('0x14')],'app':_0x12cf('0x3e'),'appdata':_0x46b289[_0x5a0542]+'?'+_0x3a4d5f[_0x12cf('0x17')]+',${EXTEN},'+_0x26cfcb+':'+_0x3a4d5f[_0x12cf('0x17')]+',${EXTEN},'+_0x3942c2,'exten':_0x3a4d5f[_0x12cf('0x8')],'context':_0x3a4d5f[_0x12cf('0x17')],'priority':_0x2b2f63[_0x12cf('0xf')]+_0x5a0542,'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});}_0x3a4d5f[_0x12cf('0xf')]=_0x231397[_0x12cf('0x2b')]?_[_0x12cf('0x3f')](_0x231397)['priority']+0x1:_0x2b2f63[_0x12cf('0xf')];_0x2b2f63['priority']=(_0x26c22e['length']?_[_0x12cf('0x3f')](_0x26c22e)[_0x12cf('0xf')]:_0x3a4d5f[_0x12cf('0xf')])+0x1;_0x2b2f63['extensions']=_[_0x12cf('0x40')](_0x2b2f63['extensions'],_0x231397,[_0x3a4d5f],_0x26c22e);}_0x2b2f63[_0x12cf('0x10')][_0x12cf('0x13')]({'type':_0xd93f8a[_0x3b889d][0x0]['type'],'app':'Hangup','exten':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x8')],'context':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x17')],'priority':_0x2b2f63['priority'],'VoiceExtensionId':_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]});_0x36d4b4[_0x12cf('0x13')](_0xd93f8a[_0x3b889d][0x0][_0x12cf('0x18')]);_0x13d62b=_[_0x12cf('0x40')](_0x13d62b,_0x2b2f63[_0x12cf('0x10')]);}}return _0xcd7fce[_0x12cf('0x41')](function(_0x1d418e){return _0xcd7fce[_0x12cf('0x6')][_0x12cf('0x4')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x36d4b4}},'transaction':_0x1d418e})[_0x12cf('0x2')](function(_0x5d4913){return _0xcd7fce[_0x12cf('0x6')][_0x12cf('0x4')]['bulkCreate'](_[_0x12cf('0x42')](_0x13d62b,_0x12cf('0xf')),{'transaction':_0x1d418e});});});})[_0x12cf('0x43')](function(_0x32843b){console['error'](_0x32843b);});}exports[_0x12cf('0x44')]=rewrite; \ No newline at end of file +var _0xc52d=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','context','outbound','CDR(destination)=','${EXTEN:','cutdigits'];(function(_0x3df15c,_0x4a36cc){var _0x545db6=function(_0x518212){while(--_0x518212){_0x3df15c['push'](_0x3df15c['shift']());}};_0x545db6(++_0x4a36cc);}(_0xc52d,0xfc));var _0xdc52=function(_0x2baf72,_0x2c32be){_0x2baf72=_0x2baf72-0x0;var _0x56cb44=_0xc52d[_0x2baf72];return _0x56cb44;};'use strict';var _=require(_0xdc52('0x0'));var util=require(_0xdc52('0x1'));function rewrite(_0x5dfe91,_0x314ea4){var _0x46cbbf=this;return _0x5dfe91[_0xdc52('0x2')][_0xdc52('0x3')][_0xdc52('0x4')]({'raw':!![]})[_0xdc52('0x5')](function(_0x2ea378){_0x46cbbf['intervals']=_0x2ea378;return _0x5dfe91['models'][_0xdc52('0x6')][_0xdc52('0x4')]({'where':{'IntervalId':_0x314ea4[_0xdc52('0x7')]},'raw':!![]});})[_0xdc52('0x5')](function(_0x439c1d){return _0x5dfe91[_0xdc52('0x2')][_0xdc52('0x6')][_0xdc52('0x4')]({'where':{'exten':{'$in':_[_0xdc52('0x8')](_[_0xdc52('0x9')](_0x439c1d,'exten'))}},'order':[{'raw':_0xdc52('0xa')}],'raw':!![]});})['then'](function(_0xccba8b){var _0x2497c9=_['filter'](_0xccba8b,{'priority':'1'});var _0xea9058=_[_0xdc52('0xb')](_0xccba8b,{'isApp':0x1});var _0x4987bb=_[_0xdc52('0xc')](_0xea9058,_0xdc52('0xd'));var _0x6b1282=[_0xdc52('0xe'),_0xdc52('0xf')];var _0x1c90b2=[];var _0x12d3ef=[];for(var _0x53a029 in _0x4987bb){if(_0x4987bb[_0xdc52('0x10')](_0x53a029)){_0x46cbbf[_0xdc52('0x11')]=0x2;_0x46cbbf['extensions']=[];_0x46cbbf[_0xdc52('0x12')]=_[_0xdc52('0x13')](_0x2497c9,{'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')]});_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':util[_0xdc52('0x18')](_0xdc52('0x19'),_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')]),'context':_0x4987bb[_0x53a029][0x0]['context'],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0]['VoiceExtensionId']});if(_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')]==='inbound'){_0x46cbbf[_0xdc52('0x14')]['push']({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':'CDR(routeid)='+_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')],'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});}else if(_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')]===_0xdc52('0x1c')){if(_0x46cbbf[_0xdc52('0x12')]){_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':_0xdc52('0x1d')+(_0x46cbbf[_0xdc52('0x12')]['cutdigits']?_0xdc52('0x1e')+_0x46cbbf[_0xdc52('0x12')][_0xdc52('0x1f')]+'}':'${EXTEN}'),'context':_0x4987bb[_0x53a029][0x0]['context'],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});}_0x46cbbf['extensions'][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':'Set','appdata':'CDR(routeid)='+_0x4987bb[_0x53a029][0x0]['VoiceExtensionId'],'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});var _0x55bffb=_0x46cbbf['priority']++;_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0]['type'],'app':_0xdc52('0x20'),'appdata':_0xdc52('0x21')+(_0x55bffb+0x2)+_0xdc52('0x22')+(_0x55bffb+0x1)+')','context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0]['exten'],'priority':_0x55bffb,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});if(_0x46cbbf['extension']){_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0]['type'],'app':_0xdc52('0x17'),'appdata':_0x46cbbf['extension']['cutdigits']?_0xdc52('0x23')+_0x46cbbf[_0xdc52('0x12')][_0xdc52('0x1f')]+'}':_0xdc52('0x24'),'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});}_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0]['type'],'app':_0xdc52('0x17'),'appdata':_0xdc52('0x25')+_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')],'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});if(_0x46cbbf[_0xdc52('0x12')]&&_0x46cbbf[_0xdc52('0x12')][_0xdc52('0x10')](_0xdc52('0x26'))&&_0x46cbbf['extension'][_0xdc52('0x26')]!=='none'){_0x46cbbf[_0xdc52('0x14')]['push']({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4987bb[_0x53a029][0x0]['context'],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':'Set','appdata':_0xdc52('0x27')+_0x46cbbf['extension']['recordingFormat']||_0xdc52('0x28'),'context':_0x4987bb[_0x53a029][0x0]['context'],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});}}_0x46cbbf['extensions'][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':_0xdc52('0x29'),'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf['priority']++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});_0x46cbbf[_0xdc52('0x14')]['push']({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':'Set','appdata':_0xdc52('0x2a'),'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf[_0xdc52('0x11')]++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});_0x46cbbf[_0xdc52('0x14')][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0][_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':_0xdc52('0x2b'),'context':_0x4987bb[_0x53a029][0x0]['context'],'exten':_0x4987bb[_0x53a029][0x0][_0xdc52('0xd')],'priority':_0x46cbbf['priority']++,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});for(var _0xe89a1d=0x0,_0x28bae8=0x0;_0xe89a1d<_0x4987bb[_0x53a029][_0xdc52('0x2c')];_0xe89a1d+=0x1,_0x28bae8=0x0){var _0x493fb4=_0x4987bb[_0x53a029][_0xe89a1d];if(_0x493fb4[_0xdc52('0x16')]){_0x493fb4[_0xdc52('0x16')]=_0x493fb4[_0xdc52('0x16')]['toLowerCase']();}var _0x587d1b=[];var _0x6e226c=[];delete _0x493fb4['id'];delete _0x493fb4[_0xdc52('0x2d')];delete _0x493fb4[_0xdc52('0x2e')];var _0x192f6f=_0x493fb4[_0xdc52('0x2f')]!==_0xdc52('0x30')?[_0x493fb4['interval']]:_0x493fb4[_0xdc52('0x7')]?_['map'](_[_0xdc52('0xb')](_0x46cbbf[_0xdc52('0x31')],{'IntervalId':_0x493fb4[_0xdc52('0x7')]}),_0xdc52('0x2f')):[];if(_0x493fb4['hasOwnProperty'](_0xdc52('0x32'))){if(_0x493fb4[_0xdc52('0x32')]&&_0x493fb4['tag']!=='--'){_0x587d1b[_0xdc52('0x15')]({'type':_0x493fb4['type'],'app':'Set','appdata':_0xdc52('0x33')+_0x493fb4['tag'],'context':_0x493fb4['context'],'exten':_0x493fb4[_0xdc52('0xd')],'priority':_0x192f6f[_0xdc52('0x2c')]+_0x46cbbf['priority']+_0x28bae8++,'VoiceExtensionId':_0x493fb4['VoiceExtensionId']});}}if(_0x493fb4[_0xdc52('0x16')]===_0xdc52('0x1c')&&_0x493fb4[_0xdc52('0x10')](_0xdc52('0x34'))){if(_0x493fb4[_0xdc52('0x34')]){_0x587d1b[_0xdc52('0x15')]({'type':_0x493fb4['type'],'app':_0xdc52('0x20'),'appdata':_0xdc52('0x35')+_0x493fb4['callerID']+')','context':_0x493fb4['context'],'exten':_0x493fb4[_0xdc52('0xd')],'priority':_0x192f6f['length']+_0x46cbbf[_0xdc52('0x11')]+_0x28bae8++,'VoiceExtensionId':_0x493fb4[_0xdc52('0x1a')]});}else{_0x587d1b['push']({'type':_0x493fb4['type'],'app':_0xdc52('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x493fb4[_0xdc52('0x1b')],'exten':_0x493fb4['exten'],'priority':_0x192f6f['length']+_0x46cbbf[_0xdc52('0x11')]+_0x28bae8++,'VoiceExtensionId':_0x493fb4['VoiceExtensionId']});}}if(_0x493fb4['hasOwnProperty']('answer')){if(_0x6b1282[_0xdc52('0x36')](_0x493fb4['app'][_0xdc52('0x37')]())>=0x0&&_0x493fb4[_0xdc52('0x38')]!==_0xdc52('0x39')){if(_0x493fb4['answer']){_0x587d1b['push']({'type':_0x493fb4['type'],'app':_0xdc52('0x20'),'appdata':_0xdc52('0x3a'),'context':_0x493fb4['context'],'exten':_0x493fb4[_0xdc52('0xd')],'priority':_0x192f6f[_0xdc52('0x2c')]+_0x46cbbf[_0xdc52('0x11')]+_0x28bae8++,'VoiceExtensionId':_0x493fb4['VoiceExtensionId']});_0x587d1b[_0xdc52('0x15')]({'type':_0x493fb4[_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':_0xdc52('0x3b'),'context':_0x493fb4[_0xdc52('0x1b')],'exten':_0x493fb4[_0xdc52('0xd')],'priority':_0x192f6f[_0xdc52('0x2c')]+_0x46cbbf['priority']+_0x28bae8++,'VoiceExtensionId':_0x493fb4[_0xdc52('0x1a')]});}else{_0x587d1b[_0xdc52('0x15')]({'type':_0x493fb4['type'],'app':'ExecIf','appdata':_0xdc52('0x3c'),'context':_0x493fb4['context'],'exten':_0x493fb4[_0xdc52('0xd')],'priority':_0x192f6f['length']+_0x46cbbf['priority']+_0x28bae8++,'VoiceExtensionId':_0x493fb4['VoiceExtensionId']});_0x587d1b[_0xdc52('0x15')]({'type':_0x493fb4[_0xdc52('0x16')],'app':_0xdc52('0x17'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x493fb4[_0xdc52('0x1b')],'exten':_0x493fb4['exten'],'priority':_0x192f6f[_0xdc52('0x2c')]+_0x46cbbf['priority']+_0x28bae8++,'VoiceExtensionId':_0x493fb4[_0xdc52('0x1a')]});}}}for(var _0x1f91ae=0x0;_0x1f91ae<_0x192f6f[_0xdc52('0x2c')];_0x1f91ae+=0x1){var _0xfae308=_0x46cbbf[_0xdc52('0x11')]+_0x192f6f[_0xdc52('0x2c')];var _0x3837a0=_0x1f91ae===_0x192f6f[_0xdc52('0x2c')]-0x1?_0x46cbbf[_0xdc52('0x11')]+_0x587d1b[_0xdc52('0x2c')]+_0x6e226c['length']+0x2:_0x46cbbf[_0xdc52('0x11')]+_0x1f91ae+0x1;_0x587d1b[_0xdc52('0x3d')](_0x1f91ae,0x0,{'type':_0x493fb4['type'],'app':'GotoIfTime','appdata':_0x192f6f[_0x1f91ae]+'?'+_0x493fb4[_0xdc52('0x1b')]+_0xdc52('0x3e')+_0xfae308+':'+_0x493fb4[_0xdc52('0x1b')]+_0xdc52('0x3e')+_0x3837a0,'exten':_0x493fb4['exten'],'context':_0x493fb4[_0xdc52('0x1b')],'priority':_0x46cbbf['priority']+_0x1f91ae,'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});}_0x493fb4['priority']=_0x587d1b[_0xdc52('0x2c')]?_['last'](_0x587d1b)['priority']+0x1:_0x46cbbf[_0xdc52('0x11')];_0x46cbbf[_0xdc52('0x11')]=(_0x6e226c['length']?_[_0xdc52('0x3f')](_0x6e226c)[_0xdc52('0x11')]:_0x493fb4[_0xdc52('0x11')])+0x1;_0x46cbbf[_0xdc52('0x14')]=_[_0xdc52('0x40')](_0x46cbbf[_0xdc52('0x14')],_0x587d1b,[_0x493fb4],_0x6e226c);}_0x46cbbf['extensions'][_0xdc52('0x15')]({'type':_0x4987bb[_0x53a029][0x0]['type'],'app':_0xdc52('0x41'),'exten':_0x4987bb[_0x53a029][0x0]['exten'],'context':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1b')],'priority':_0x46cbbf['priority'],'VoiceExtensionId':_0x4987bb[_0x53a029][0x0][_0xdc52('0x1a')]});_0x1c90b2[_0xdc52('0x15')](_0x4987bb[_0x53a029][0x0]['VoiceExtensionId']);_0x12d3ef=_['concat'](_0x12d3ef,_0x46cbbf[_0xdc52('0x14')]);}}return _0x5dfe91[_0xdc52('0x42')](function(_0x43858e){return _0x5dfe91['models'][_0xdc52('0x6')][_0xdc52('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x1c90b2}},'transaction':_0x43858e})[_0xdc52('0x5')](function(_0x4dcb52){return _0x5dfe91[_0xdc52('0x2')][_0xdc52('0x6')]['bulkCreate'](_[_0xdc52('0x44')](_0x12d3ef,_0xdc52('0x11')),{'transaction':_0x43858e});});});})[_0xdc52('0x45')](function(_0x5de7d8){console['error'](_0x5de7d8);});}exports[_0xdc52('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 411f9bf..9fd744a 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 _0x2ce5=['from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','\x20=\x20?','fromQuery','cm_contacts','phone\x20NOT\x20IN\x20(?)','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','emit','contact:csv_','resume','resolve','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','cmContact','inspect','insert','into','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','toString','updatedAt'];(function(_0xc91a9e,_0x5b29f5){var _0x11d0de=function(_0x47520b){while(--_0x47520b){_0xc91a9e['push'](_0xc91a9e['shift']());}};_0x11d0de(++_0x5b29f5);}(_0x2ce5,0x1d4));var _0x52ce=function(_0x4b7581,_0x1195fa){_0x4b7581=_0x4b7581-0x0;var _0x474434=_0x2ce5[_0x4b7581];return _0x474434;};'use strict';var BPromise=require('bluebird');var util=require(_0x52ce('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0x52ce('0x1'));var Papa=require(_0x52ce('0x2'));var Redis=require(_0x52ce('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x52ce('0x4'));var logger=require(_0x52ce('0x5'))('api');config[_0x52ce('0x6')]=_[_0x52ce('0x7')](config[_0x52ce('0x6')],{'host':_0x52ce('0x8'),'port':0x18eb});var socket=require(_0x52ce('0x9'))(new Redis(config[_0x52ce('0x6')]));require(_0x52ce('0xa'))[_0x52ce('0xb')](socket);try{if(!process[_0x52ce('0xc')][0x2]||process[_0x52ce('0xc')][0x2]===_0x52ce('0xd')||process[_0x52ce('0xc')][0x2]===_0x52ce('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x52ce('0xc')][0x2];if(!process[_0x52ce('0xc')][0x3]||process[_0x52ce('0xc')][0x3]===_0x52ce('0xd')||process['argv'][0x3]===_0x52ce('0xe')||!process['argv'][0x4]||process[_0x52ce('0xc')][0x4]===_0x52ce('0xd')||process[_0x52ce('0xc')][0x4]===_0x52ce('0xe')){throw new Error(_0x52ce('0xf'));}var FIELDS=_[_0x52ce('0x10')](process[_0x52ce('0xc')][0x3][_0x52ce('0x11')](','),process[_0x52ce('0xc')][0x4][_0x52ce('0x11')](','));if(!process['argv'][0x5]||process[_0x52ce('0xc')][0x5]===_0x52ce('0xd')||process[_0x52ce('0xc')][0x5]===_0x52ce('0xe')){throw new Error(_0x52ce('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x52ce('0xc')][0x6]&&process['argv'][0x6]!==_0x52ce('0xd')&&process[_0x52ce('0xc')][0x6]!==_0x52ce('0xe')?process[_0x52ce('0xc')][0x6]:null;var DUPLICATES=process[_0x52ce('0xc')][0x7]&&process[_0x52ce('0xc')][0x7]!==_0x52ce('0xd')&&process[_0x52ce('0xc')][0x7]!==_0x52ce('0xe')?process[_0x52ce('0xc')][0x7]:null;if(!process[_0x52ce('0xc')][0x8]||process[_0x52ce('0xc')][0x8]===_0x52ce('0xd')||process[_0x52ce('0xc')][0x8]===_0x52ce('0xe')){throw new Error(_0x52ce('0x13'));}var SOCKET_TIMESTAMP=process[_0x52ce('0xc')][0x8];}catch(_0x4e1c97){logger[_0x52ce('0x14')](_0x4e1c97);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(_0x11c45e,_0x73d696,_0x3b30d9,_0x353297){var _0x48d929={'message':_0x73d696};_0x48d929[_0x11c45e]=!![];if(_0x3b30d9){_0x48d929['contact']=_0x3b30d9;}if(_0x353297){_0x48d929[_0x52ce('0x15')]=_0x353297;}return _0x48d929;}function isEmail(_0x374c86){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))*$/[_0x52ce('0x16')](_0x374c86);}function checkRow(_0x1c617f,_0xdd23aa,_0x14619b){return new BPromise(function(_0x480715,_0x53367e){if(_[_0x52ce('0x17')](_0x1c617f)){return _0x53367e(handleCheckRowError(_0x52ce('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x14619b));}if(_0x1c617f['errors']&&_0x1c617f[_0x52ce('0x18')][_0x52ce('0x19')]){var _0x529eb3=_[_0x52ce('0x1a')](_0x1c617f[_0x52ce('0x18')],_0x52ce('0x1b'))[_0x52ce('0x1c')](';');return _0x53367e(handleCheckRowError('error',_0x529eb3,null,_0x14619b));}var _0x37b285={};for(var _0xd40fac in FIELDS){if(FIELDS[_0x52ce('0x1d')](_0xd40fac)&&FIELDS[_0xd40fac]){_0x37b285[_0xd40fac]=_0x1c617f[_0x52ce('0x1e')][0x0][FIELDS[_0xd40fac]]||_0x1c617f['data'][0x0]['\ufeff'+FIELDS[_0xd40fac]];}}if(!_0x37b285[_0x52ce('0x1f')]){return _0x53367e(handleCheckRowError(_0x52ce('0x14'),_0x52ce('0x20'),null,_0x14619b));}if(!_0x37b285[_0x52ce('0x21')]){return _0x53367e(handleCheckRowError(_0x52ce('0x14'),_0x52ce('0x22'),null,_0x14619b));}if(_0x37b285[_0x52ce('0x23')]){var _0x19004d=moment(_0x37b285[_0x52ce('0x23')],'YYYY-MM-DD');if(!_0x19004d[_0x52ce('0x24')]()){return _0x53367e(handleCheckRowError('error',_0x52ce('0x25'),null,_0x14619b));}}if(_0x37b285[_0x52ce('0x26')]){if(!isEmail(_0x37b285[_0x52ce('0x26')])){return _0x53367e(handleCheckRowError(_0x52ce('0x14'),_0x52ce('0x27'),null,_0x14619b));}}_0x37b285['ListId']=LISTID;_0x37b285['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x52ce('0x19')]&&_0xdd23aa){var _0x178042={};for(var _0x139f12=0x0,_0x20ac4c=DUPLICATES['length'];_0x139f12<_0x20ac4c;_0x139f12+=0x1){_0x178042[DUPLICATES[_0x139f12]]=_0x37b285[DUPLICATES[_0x139f12]];}var _0x2d17ae=_['find'](_0xdd23aa,_0x178042);if(_0x2d17ae){return _0x53367e(handleCheckRowError(_0x52ce('0x28'),_0x52ce('0x29'),_0x2d17ae,_0x14619b));}}return db[_0x52ce('0x2a')][_0x52ce('0x2b')](_0x37b285,{'raw':!![],'hooks':![],'fields':_[_0x52ce('0x2c')](_0x37b285)})[_0x52ce('0x2d')](function(_0x5bd82f){if(DUPLICATES&&DUPLICATES[_0x52ce('0x19')]&&_0xdd23aa){_0xdd23aa[_0x52ce('0x2e')](_[_0x52ce('0x2f')](_0x37b285,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5bd82f['id'];return _0x480715();})[_0x52ce('0x30')](function(_0x6c494d){return _0x53367e(handleCheckRowError(_0x52ce('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x6c494d[_0x52ce('0x1b')]||JSON['stringify'](_0x6c494d)),null,_0x14619b));});});}function checkHopper(){function _0x24ad47(){return function(_0x319714){logger[_0x52ce('0x14')](_0x52ce('0x31'),'checkHopper',util[_0x52ce('0x32')](_0x319714,{'showHidden':![],'depth':null}));};}var _0x210fd0=function(_0x21ee67,_0x122b44){var _0x10232d=squel[_0x52ce('0x33')]()[_0x52ce('0x34')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x52ce('0x35'),_0x52ce('0x36'),_0x122b44,_0x52ce('0x37'),'updatedAt'],squel[_0x52ce('0x38')]()[_0x52ce('0x39')](_0x52ce('0x21'),_0x52ce('0x21'))[_0x52ce('0x39')](_0x52ce('0x3a'),_0x52ce('0x3b'))['field']('id',_0x52ce('0x35'))[_0x52ce('0x39')](LISTID[_0x52ce('0x3c')](),'ListId')[_0x52ce('0x39')](_0x21ee67['id']['toString'](),_0x122b44)[_0x52ce('0x39')](_0x52ce('0x3a'),_0x52ce('0x37'))[_0x52ce('0x39')](_0x52ce('0x3a'),_0x52ce('0x3d'))[_0x52ce('0x3e')]('cm_contacts')[_0x52ce('0x3f')]('deletedAt\x20IS\x20NULL')[_0x52ce('0x3f')](_0x52ce('0x40'),LISTID[_0x52ce('0x3c')]())[_0x52ce('0x3f')](_0x52ce('0x41'))[_0x52ce('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x52ce('0x38')]()[_0x52ce('0x39')](_0x52ce('0x21'))[_0x52ce('0x3e')](_0x52ce('0x42'))[_0x52ce('0x3f')](_0x122b44+_0x52ce('0x43'),_0x21ee67['id']['toString']())))[_0x52ce('0x3c')]();return _0x10232d;};var _0x207189=function(_0x2d7d27,_0x16a09a){var _0x1d6ace=squel[_0x52ce('0x33')]()[_0x52ce('0x34')](_0x52ce('0x42'))[_0x52ce('0x44')]([_0x52ce('0x21'),_0x52ce('0x3b'),_0x52ce('0x35'),'ListId',_0x16a09a,_0x52ce('0x37'),_0x52ce('0x3d')],squel['select']()[_0x52ce('0x39')](_0x52ce('0x21'),_0x52ce('0x21'))[_0x52ce('0x39')](_0x52ce('0x3a'),_0x52ce('0x3b'))['field']('id','ContactId')[_0x52ce('0x39')](LISTID[_0x52ce('0x3c')](),_0x52ce('0x36'))[_0x52ce('0x39')](_0x2d7d27['id']['toString'](),_0x16a09a)[_0x52ce('0x39')]('NOW()','createdAt')[_0x52ce('0x39')](_0x52ce('0x3a'),_0x52ce('0x3d'))[_0x52ce('0x3e')](_0x52ce('0x45'))[_0x52ce('0x3f')]('deletedAt\x20IS\x20NULL')[_0x52ce('0x3f')](_0x52ce('0x40'),LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x52ce('0x3f')](_0x52ce('0x41'))[_0x52ce('0x3f')](_0x52ce('0x46'),squel['select']()['field']('calleridnum')['from']('cm_hopper_final')[_0x52ce('0x3f')](_0x16a09a+_0x52ce('0x43'),_0x2d7d27['id'][_0x52ce('0x3c')]()))['where'](_0x52ce('0x46'),squel[_0x52ce('0x38')]()[_0x52ce('0x39')](_0x52ce('0x21'))['from']('cm_hopper')[_0x52ce('0x3f')](_0x16a09a+'\x20=\x20?',_0x2d7d27['id']['toString']())))['toString']();return _0x1d6ace;};function _0x208322(_0x44b65a,_0x373c1e){var _0x4ac55c=squel['insert']()[_0x52ce('0x34')](_0x52ce('0x42'))[_0x52ce('0x44')]([_0x52ce('0x21'),_0x52ce('0x3b'),_0x52ce('0x35'),'ListId',_0x373c1e,_0x52ce('0x37'),'updatedAt'],squel[_0x52ce('0x38')]()[_0x52ce('0x39')](_0x52ce('0x21'),_0x52ce('0x21'))[_0x52ce('0x39')](_0x52ce('0x3a'),_0x52ce('0x3b'))['field']('id',_0x52ce('0x35'))[_0x52ce('0x39')](LISTID['toString'](),'ListId')['field'](_0x44b65a['id'][_0x52ce('0x3c')](),_0x373c1e)['field']('NOW()',_0x52ce('0x37'))['field'](_0x52ce('0x3a'),_0x52ce('0x3d'))['from'](_0x52ce('0x45'))[_0x52ce('0x3f')](_0x52ce('0x47'))[_0x52ce('0x3f')](_0x52ce('0x40'),LISTID[_0x52ce('0x3c')]())['where'](_0x52ce('0x48'),squel[_0x52ce('0x49')](hopperContacts))[_0x52ce('0x3f')](_0x52ce('0x41')))[_0x52ce('0x3c')]();return _0x4ac55c;}function _0x3c2691(_0x101298,_0x3839e4){var _0x470c84=squel['insert']()['into'](_0x52ce('0x4a'))['fromQuery']([_0x52ce('0x21'),_0x52ce('0x35'),_0x52ce('0x36'),_0x3839e4,_0x52ce('0x37'),_0x52ce('0x3d')],squel[_0x52ce('0x38')]()[_0x52ce('0x39')](_0x52ce('0x21'),_0x52ce('0x21'))['field']('id',_0x52ce('0x35'))['field'](LISTID['toString'](),_0x52ce('0x36'))[_0x52ce('0x39')](_0x101298['id'][_0x52ce('0x3c')](),_0x3839e4)[_0x52ce('0x39')](_0x52ce('0x3a'),'createdAt')['field']('NOW()','updatedAt')[_0x52ce('0x3e')](_0x52ce('0x45'))[_0x52ce('0x3f')](_0x52ce('0x47'))[_0x52ce('0x3f')](_0x52ce('0x40'),LISTID[_0x52ce('0x3c')]())['where'](_0x52ce('0x48'),squel['str'](hopperContacts))[_0x52ce('0x3f')](_0x52ce('0x41')))[_0x52ce('0x3c')]();return _0x470c84;}return db['VoiceQueue'][_0x52ce('0x4b')]({'where':{'type':_0x52ce('0x4c')},'attributes':['id',_0x52ce('0x4d')],'include':[{'model':db[_0x52ce('0x4e')],'as':_0x52ce('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0xf0eca6){var _0x48dec1=[];if(_0xf0eca6){var _0x375e4d;for(var _0x477f65=0x0,_0x3c4b7d;_0x477f65<_0xf0eca6[_0x52ce('0x19')];_0x477f65+=0x1){_0x3c4b7d=_0xf0eca6[_0x477f65][_0x52ce('0x50')]({'plain':!![]});switch(_0x3c4b7d[_0x52ce('0x4d')]){case'always':_0x48dec1[_0x52ce('0x2e')](db[_0x52ce('0x51')][_0x52ce('0x52')](_0x207189(_0x3c4b7d,_0x52ce('0x53')))[_0x52ce('0x2d')](function(){})[_0x52ce('0x30')](_0x24ad47()));break;case _0x52ce('0x54'):_0x48dec1['push'](db[_0x52ce('0x51')][_0x52ce('0x52')](_0x210fd0(_0x3c4b7d,_0x52ce('0x53')))[_0x52ce('0x2d')](function(){})[_0x52ce('0x30')](_0x24ad47()));break;default:_0x48dec1[_0x52ce('0x2e')](db[_0x52ce('0x51')][_0x52ce('0x52')](_0x208322(_0x3c4b7d,_0x52ce('0x53')))['then'](function(){})[_0x52ce('0x30')](_0x24ad47()));}}}return _0x48dec1;})[_0x52ce('0x55')]()[_0x52ce('0x2d')](function(){return db[_0x52ce('0x56')][_0x52ce('0x4b')]({'where':{'type':_0x52ce('0x4c')},'attributes':['id'],'include':[{'model':db[_0x52ce('0x4e')],'as':_0x52ce('0x57'),'where':{'id':LISTID}}]})[_0x52ce('0x2d')](function(_0x49cb9e){var _0x5b51ba=[];if(_0x49cb9e){var _0xae4fc8;for(var _0x208b7c=0x0,_0xd3b46;_0x208b7c<_0x49cb9e['length'];_0x208b7c+=0x1){_0xd3b46=_0x49cb9e[_0x208b7c][_0x52ce('0x50')]({'plain':!![]});_0x5b51ba[_0x52ce('0x2e')](db[_0x52ce('0x51')]['query'](_0x3c2691(_0xd3b46,_0x52ce('0x53')))[_0x52ce('0x2d')](function(){})[_0x52ce('0x30')](_0x24ad47()));}}return _0x5b51ba;})[_0x52ce('0x55')]();})[_0x52ce('0x2d')](function(){return db[_0x52ce('0x58')][_0x52ce('0x4b')]({'attributes':['id',_0x52ce('0x4d')],'include':[{'model':db[_0x52ce('0x4e')],'as':_0x52ce('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x3cdbad){var _0x29e543=[];if(_0x3cdbad){for(var _0xcada7=0x0,_0x5879b9;_0xcada7<_0x3cdbad[_0x52ce('0x19')];_0xcada7+=0x1){_0x5879b9=_0x3cdbad[_0xcada7][_0x52ce('0x50')]({'plain':!![]});switch(_0x5879b9[_0x52ce('0x4d')]){case'always':_0x29e543[_0x52ce('0x2e')](db['sequelize']['query'](_0x207189(_0x5879b9,_0x52ce('0x59')))['then'](function(){})['catch'](_0x24ad47()));break;case _0x52ce('0x54'):_0x29e543[_0x52ce('0x2e')](db[_0x52ce('0x51')][_0x52ce('0x52')](_0x210fd0(_0x5879b9,_0x52ce('0x59')))[_0x52ce('0x2d')](function(){})[_0x52ce('0x30')](_0x24ad47()));break;default:_0x29e543[_0x52ce('0x2e')](db['sequelize'][_0x52ce('0x52')](_0x208322(_0x5879b9,_0x52ce('0x59')))[_0x52ce('0x2d')](function(){})[_0x52ce('0x30')](_0x24ad47()));}}}return _0x29e543;})['all']();})[_0x52ce('0x2d')](function(){return db[_0x52ce('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x52ce('0x4e')],'as':_0x52ce('0x57'),'where':{'id':LISTID}}]})[_0x52ce('0x2d')](function(_0x1ca207){var _0x15c7dc=[];if(_0x1ca207){for(var _0x54d37c=0x0,_0x11c17d;_0x54d37c<_0x1ca207['length'];_0x54d37c+=0x1){_0x11c17d=_0x1ca207[_0x54d37c][_0x52ce('0x50')]({'plain':!![]});_0x15c7dc[_0x52ce('0x2e')](db[_0x52ce('0x51')][_0x52ce('0x52')](_0x3c2691(_0x11c17d,_0x52ce('0x59')))[_0x52ce('0x2d')](function(){})[_0x52ce('0x30')](_0x24ad47()));}}return _0x15c7dc;})[_0x52ce('0x55')]();})[_0x52ce('0x30')](function(_0x115a5a){logger[_0x52ce('0x14')](_0x52ce('0x5a'),_0x52ce('0x5b'),_0x115a5a['message']);});}var processPromises=function(_0x35c652){return BPromise[_0x52ce('0x55')](promises)['then'](function(_0x27bde6){})[_0x52ce('0x30')](function(_0x5f227d){logger[_0x52ce('0x14')](_0x52ce('0x5c'),JSON[_0x52ce('0x5d')](_0x5f227d));})['finally'](function(){socket[_0x52ce('0x5e')](_0x52ce('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x35c652){return _0x35c652[_0x52ce('0x60')]();}});};var endCsv=function(){return BPromise[_0x52ce('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x52ce('0x2d')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x52ce('0x62')](FILEPATH);}catch(_0xc00b88){logger[_0x52ce('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x52ce('0x5d')](_0xc00b88));}finally{process['exit'](0x0);}});};process['on'](_0x52ce('0x63'),function(){logger[_0x52ce('0x64')](_0x52ce('0x65'));endCsv();});function main(){return BPromise[_0x52ce('0x61')]()[_0x52ce('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x52ce('0x2a')][_0x52ce('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x52ce('0x2d')](function(_0x53d350){var _0x44d360=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x52ce('0x66')](_0x44d360,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1567f5,_0x521ac5){total+=0x1;var _0x26e514=total;promises[_0x52ce('0x2e')](checkRow(_0x1567f5,_0x53d350,_0x26e514)[_0x52ce('0x2d')](function(){success+=0x1;})['catch'](function(_0x5b2385){if(_0x5b2385['error']){errors+=0x1;delete _0x5b2385[_0x52ce('0x14')];}else if(_0x5b2385[_0x52ce('0x28')]){duplicates+=0x1;delete _0x5b2385[_0x52ce('0x28')];}rows[_0x52ce('0x2e')](_0x5b2385);}));if(total%0xc8===0x0){_0x521ac5['pause']();return processPromises(_0x521ac5);}},'complete':function(){return processPromises()[_0x52ce('0x2d')](function(){logger[_0x52ce('0x64')](_0x52ce('0x67'));endCsv();});},'error':function(_0x14bb9b,_0x3930c6){logger[_0x52ce('0x64')](_0x52ce('0x68'),JSON[_0x52ce('0x5d')](_0x14bb9b));endCsv();}});})[_0x52ce('0x30')](function(_0x1054a3){logger[_0x52ce('0x14')](_0x52ce('0x69'),JSON[_0x52ce('0x5d')](_0x1054a3));});}main(); \ No newline at end of file +var _0x97a5=['cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','exit','SIGINT','info','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','join','hasOwnProperty','data','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','inspect','insert','into','fromQuery','phone','scheduledAt','createdAt','field','toString','NOW()','updatedAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','ContactId','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_contacts','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','CmList','Campaign','get','CampaignId','BlackLists'];(function(_0x3490a8,_0x164729){var _0x14dc7a=function(_0x46cbdc){while(--_0x46cbdc){_0x3490a8['push'](_0x3490a8['shift']());}};_0x14dc7a(++_0x164729);}(_0x97a5,0xf0));var _0x597a=function(_0x2a9ccc,_0xb277e3){_0x2a9ccc=_0x2a9ccc-0x0;var _0x24344e=_0x97a5[_0x2a9ccc];return _0x24344e;};'use strict';var BPromise=require(_0x597a('0x0'));var util=require(_0x597a('0x1'));var _=require(_0x597a('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x597a('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x597a('0x4'))(_0x597a('0x5'));config[_0x597a('0x6')]=_['defaults'](config[_0x597a('0x6')],{'host':_0x597a('0x7'),'port':0x18eb});var socket=require(_0x597a('0x8'))(new Redis(config['redis']));require(_0x597a('0x9'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x597a('0xa')][0x2]===_0x597a('0xb')||process[_0x597a('0xa')][0x2]===_0x597a('0xc')){throw new Error(_0x597a('0xd'));}var FILEPATH=process[_0x597a('0xa')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x597a('0xb')||process[_0x597a('0xa')][0x3]===_0x597a('0xc')||!process['argv'][0x4]||process[_0x597a('0xa')][0x4]===_0x597a('0xb')||process[_0x597a('0xa')][0x4]===_0x597a('0xc')){throw new Error(_0x597a('0xe'));}var FIELDS=_[_0x597a('0xf')](process[_0x597a('0xa')][0x3]['split'](','),process['argv'][0x4][_0x597a('0x10')](','));if(!process['argv'][0x5]||process[_0x597a('0xa')][0x5]==='undefined'||process[_0x597a('0xa')][0x5]===_0x597a('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x597a('0xa')][0x6]&&process[_0x597a('0xa')][0x6]!==_0x597a('0xb')&&process['argv'][0x6]!=='null'?process[_0x597a('0xa')][0x6]:null;var DUPLICATES=process[_0x597a('0xa')][0x7]&&process[_0x597a('0xa')][0x7]!==_0x597a('0xb')&&process['argv'][0x7]!==_0x597a('0xc')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x597a('0xa')][0x8]===_0x597a('0xb')||process[_0x597a('0xa')][0x8]==='null'){throw new Error(_0x597a('0x11'));}var SOCKET_TIMESTAMP=process[_0x597a('0xa')][0x8];}catch(_0x2ad3f5){logger[_0x597a('0x12')](_0x2ad3f5);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(_0x7c13c4,_0x331295,_0x11628d,_0x22d866){var _0x11c0c3={'message':_0x331295};_0x11c0c3[_0x7c13c4]=!![];if(_0x11628d){_0x11c0c3[_0x597a('0x13')]=_0x11628d;}if(_0x22d866){_0x11c0c3[_0x597a('0x14')]=_0x22d866;}return _0x11c0c3;}function isEmail(_0x39713e){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))*$/[_0x597a('0x15')](_0x39713e);}function checkRow(_0x2c8381,_0x56d8f4,_0x418536){return new BPromise(function(_0x32d686,_0x4974a0){if(_[_0x597a('0x16')](_0x2c8381)){return _0x4974a0(handleCheckRowError('error',_0x597a('0x17'),null,_0x418536));}if(_0x2c8381[_0x597a('0x18')]&&_0x2c8381[_0x597a('0x18')]['length']){var _0x41ada6=_['map'](_0x2c8381[_0x597a('0x18')],_0x597a('0x19'))[_0x597a('0x1a')](';');return _0x4974a0(handleCheckRowError(_0x597a('0x12'),_0x41ada6,null,_0x418536));}var _0x41f6b2={};for(var _0x46c5d9 in FIELDS){if(FIELDS[_0x597a('0x1b')](_0x46c5d9)&&FIELDS[_0x46c5d9]){_0x41f6b2[_0x46c5d9]=_0x2c8381['data'][0x0][FIELDS[_0x46c5d9]]||_0x2c8381[_0x597a('0x1c')][0x0]['\ufeff'+FIELDS[_0x46c5d9]];}}if(!_0x41f6b2['firstName']){return _0x4974a0(handleCheckRowError(_0x597a('0x12'),'firstName\x20not\x20specified!',null,_0x418536));}if(!_0x41f6b2['phone']){return _0x4974a0(handleCheckRowError(_0x597a('0x12'),_0x597a('0x1d'),null,_0x418536));}if(_0x41f6b2[_0x597a('0x1e')]){var _0x24d317=moment(_0x41f6b2[_0x597a('0x1e')],_0x597a('0x1f'));if(!_0x24d317[_0x597a('0x20')]()){return _0x4974a0(handleCheckRowError(_0x597a('0x12'),_0x597a('0x21'),null,_0x418536));}}if(_0x41f6b2[_0x597a('0x22')]){if(!isEmail(_0x41f6b2['email'])){return _0x4974a0(handleCheckRowError(_0x597a('0x12'),_0x597a('0x23'),null,_0x418536));}}_0x41f6b2[_0x597a('0x24')]=LISTID;_0x41f6b2[_0x597a('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x597a('0x26')]&&_0x56d8f4){var _0x5cf5d0={};for(var _0x8a725c=0x0,_0x328210=DUPLICATES['length'];_0x8a725c<_0x328210;_0x8a725c+=0x1){_0x5cf5d0[DUPLICATES[_0x8a725c]]=_0x41f6b2[DUPLICATES[_0x8a725c]];}var _0x2c3f20=_['find'](_0x56d8f4,_0x5cf5d0);if(_0x2c3f20){return _0x4974a0(handleCheckRowError('duplicate',_0x597a('0x27'),_0x2c3f20,_0x418536));}}return db[_0x597a('0x28')][_0x597a('0x29')](_0x41f6b2,{'raw':!![],'hooks':![],'fields':_[_0x597a('0x2a')](_0x41f6b2)})[_0x597a('0x2b')](function(_0x4dc42b){if(DUPLICATES&&DUPLICATES['length']&&_0x56d8f4){_0x56d8f4[_0x597a('0x2c')](_['pick'](_0x41f6b2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4dc42b['id'];return _0x32d686();})[_0x597a('0x2d')](function(_0x30f2eb){return _0x4974a0(handleCheckRowError('error',_0x597a('0x2e')+(_0x30f2eb[_0x597a('0x19')]||JSON['stringify'](_0x30f2eb)),null,_0x418536));});});}function checkHopper(){function _0x595d13(){return function(_0x296c5c){logger[_0x597a('0x12')]('cmContact','checkHopper',util[_0x597a('0x2f')](_0x296c5c,{'showHidden':![],'depth':null}));};}var _0x196aed=function(_0x30a851,_0x5bffc4){var _0x17b332=squel[_0x597a('0x30')]()[_0x597a('0x31')]('cm_hopper')[_0x597a('0x32')]([_0x597a('0x33'),_0x597a('0x34'),'ContactId',_0x597a('0x24'),_0x5bffc4,_0x597a('0x35'),'updatedAt'],squel['select']()[_0x597a('0x36')]('phone',_0x597a('0x33'))[_0x597a('0x36')]('NOW()',_0x597a('0x34'))['field']('id','ContactId')[_0x597a('0x36')](LISTID['toString'](),'ListId')[_0x597a('0x36')](_0x30a851['id'][_0x597a('0x37')](),_0x5bffc4)[_0x597a('0x36')]('NOW()','createdAt')[_0x597a('0x36')](_0x597a('0x38'),_0x597a('0x39'))[_0x597a('0x3a')]('cm_contacts')[_0x597a('0x3b')](_0x597a('0x3c'))[_0x597a('0x3b')](_0x597a('0x3d'),LISTID[_0x597a('0x37')]())['where'](_0x597a('0x3e'))['where'](_0x597a('0x3f'),squel[_0x597a('0x40')]()[_0x597a('0x36')](_0x597a('0x33'))['from'](_0x597a('0x41'))[_0x597a('0x3b')](_0x5bffc4+'\x20=\x20?',_0x30a851['id'][_0x597a('0x37')]())))[_0x597a('0x37')]();return _0x17b332;};var _0x1db8d2=function(_0x2b10d4,_0xfa8da1){var _0x360283=squel[_0x597a('0x30')]()[_0x597a('0x31')](_0x597a('0x41'))['fromQuery']([_0x597a('0x33'),_0x597a('0x34'),_0x597a('0x42'),_0x597a('0x24'),_0xfa8da1,'createdAt',_0x597a('0x39')],squel['select']()[_0x597a('0x36')](_0x597a('0x33'),_0x597a('0x33'))['field'](_0x597a('0x38'),_0x597a('0x34'))[_0x597a('0x36')]('id',_0x597a('0x42'))['field'](LISTID['toString'](),_0x597a('0x24'))[_0x597a('0x36')](_0x2b10d4['id']['toString'](),_0xfa8da1)[_0x597a('0x36')]('NOW()',_0x597a('0x35'))[_0x597a('0x36')](_0x597a('0x38'),'updatedAt')['from']('cm_contacts')[_0x597a('0x3b')](_0x597a('0x3c'))['where'](_0x597a('0x3d'),LISTID[_0x597a('0x37')]())[_0x597a('0x3b')](_0x597a('0x43'),squel[_0x597a('0x44')](hopperContacts))[_0x597a('0x3b')](_0x597a('0x3e'))[_0x597a('0x3b')](_0x597a('0x3f'),squel['select']()['field'](_0x597a('0x45'))[_0x597a('0x3a')](_0x597a('0x46'))[_0x597a('0x3b')](_0xfa8da1+_0x597a('0x47'),_0x2b10d4['id']['toString']()))[_0x597a('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x597a('0x40')]()['field'](_0x597a('0x33'))[_0x597a('0x3a')]('cm_hopper')['where'](_0xfa8da1+_0x597a('0x47'),_0x2b10d4['id'][_0x597a('0x37')]())))[_0x597a('0x37')]();return _0x360283;};function _0x65953e(_0x17e43d,_0x19487f){var _0x5bd0b7=squel[_0x597a('0x30')]()[_0x597a('0x31')](_0x597a('0x41'))[_0x597a('0x32')]([_0x597a('0x33'),_0x597a('0x34'),_0x597a('0x42'),_0x597a('0x24'),_0x19487f,_0x597a('0x35'),_0x597a('0x39')],squel['select']()['field']('phone','phone')[_0x597a('0x36')](_0x597a('0x38'),'scheduledAt')['field']('id',_0x597a('0x42'))[_0x597a('0x36')](LISTID['toString'](),_0x597a('0x24'))[_0x597a('0x36')](_0x17e43d['id'][_0x597a('0x37')](),_0x19487f)[_0x597a('0x36')](_0x597a('0x38'),_0x597a('0x35'))[_0x597a('0x36')](_0x597a('0x38'),_0x597a('0x39'))[_0x597a('0x3a')](_0x597a('0x48'))['where']('deletedAt\x20IS\x20NULL')[_0x597a('0x3b')](_0x597a('0x3d'),LISTID['toString']())[_0x597a('0x3b')]('id\x20IN\x20?',squel[_0x597a('0x44')](hopperContacts))[_0x597a('0x3b')](_0x597a('0x3e')))[_0x597a('0x37')]();return _0x5bd0b7;}function _0xa00331(_0x2214e8,_0x394210){var _0x3a3b43=squel[_0x597a('0x30')]()['into'](_0x597a('0x49'))[_0x597a('0x32')]([_0x597a('0x33'),_0x597a('0x42'),'ListId',_0x394210,_0x597a('0x35'),_0x597a('0x39')],squel[_0x597a('0x40')]()[_0x597a('0x36')](_0x597a('0x33'),'phone')[_0x597a('0x36')]('id','ContactId')['field'](LISTID['toString'](),_0x597a('0x24'))[_0x597a('0x36')](_0x2214e8['id'][_0x597a('0x37')](),_0x394210)[_0x597a('0x36')](_0x597a('0x38'),_0x597a('0x35'))[_0x597a('0x36')]('NOW()',_0x597a('0x39'))[_0x597a('0x3a')]('cm_contacts')[_0x597a('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x597a('0x3d'),LISTID[_0x597a('0x37')]())[_0x597a('0x3b')]('id\x20IN\x20?',squel[_0x597a('0x44')](hopperContacts))[_0x597a('0x3b')](_0x597a('0x3e')))[_0x597a('0x37')]();return _0x3a3b43;}return db[_0x597a('0x4a')][_0x597a('0x4b')]({'where':{'type':_0x597a('0x4c')},'attributes':['id',_0x597a('0x4d')],'include':[{'model':db['CmList'],'as':_0x597a('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0xb3158d){var _0x15ec7c=[];if(_0xb3158d){var _0x2a78d2;for(var _0x2b40ac=0x0,_0x4d4fec;_0x2b40ac<_0xb3158d[_0x597a('0x26')];_0x2b40ac+=0x1){_0x4d4fec=_0xb3158d[_0x2b40ac]['get']({'plain':!![]});switch(_0x4d4fec['dialCheckDuplicateType']){case _0x597a('0x4f'):_0x15ec7c[_0x597a('0x2c')](db[_0x597a('0x50')][_0x597a('0x51')](_0x1db8d2(_0x4d4fec,'VoiceQueueId'))[_0x597a('0x2b')](function(){})[_0x597a('0x2d')](_0x595d13()));break;case _0x597a('0x52'):_0x15ec7c[_0x597a('0x2c')](db[_0x597a('0x50')][_0x597a('0x51')](_0x196aed(_0x4d4fec,_0x597a('0x53')))[_0x597a('0x2b')](function(){})[_0x597a('0x2d')](_0x595d13()));break;default:_0x15ec7c['push'](db[_0x597a('0x50')]['query'](_0x65953e(_0x4d4fec,_0x597a('0x53')))['then'](function(){})[_0x597a('0x2d')](_0x595d13()));}}}return _0x15ec7c;})[_0x597a('0x54')]()[_0x597a('0x2b')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x597a('0x4c')},'attributes':['id'],'include':[{'model':db[_0x597a('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x597a('0x2b')](function(_0x37e2ec){var _0x86b158=[];if(_0x37e2ec){var _0x5437f5;for(var _0x286681=0x0,_0x5b7a2d;_0x286681<_0x37e2ec[_0x597a('0x26')];_0x286681+=0x1){_0x5b7a2d=_0x37e2ec[_0x286681]['get']({'plain':!![]});_0x86b158['push'](db[_0x597a('0x50')][_0x597a('0x51')](_0xa00331(_0x5b7a2d,_0x597a('0x53')))[_0x597a('0x2b')](function(){})['catch'](_0x595d13()));}}return _0x86b158;})['all']();})[_0x597a('0x2b')](function(){return db[_0x597a('0x56')][_0x597a('0x4b')]({'attributes':['id',_0x597a('0x4d')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x3da572){var _0x5e8702=[];if(_0x3da572){for(var _0x14a205=0x0,_0x5d1a69;_0x14a205<_0x3da572[_0x597a('0x26')];_0x14a205+=0x1){_0x5d1a69=_0x3da572[_0x14a205][_0x597a('0x57')]({'plain':!![]});switch(_0x5d1a69[_0x597a('0x4d')]){case'always':_0x5e8702[_0x597a('0x2c')](db[_0x597a('0x50')][_0x597a('0x51')](_0x1db8d2(_0x5d1a69,_0x597a('0x58')))[_0x597a('0x2b')](function(){})[_0x597a('0x2d')](_0x595d13()));break;case _0x597a('0x52'):_0x5e8702[_0x597a('0x2c')](db[_0x597a('0x50')][_0x597a('0x51')](_0x196aed(_0x5d1a69,_0x597a('0x58')))[_0x597a('0x2b')](function(){})[_0x597a('0x2d')](_0x595d13()));break;default:_0x5e8702[_0x597a('0x2c')](db[_0x597a('0x50')][_0x597a('0x51')](_0x65953e(_0x5d1a69,_0x597a('0x58')))[_0x597a('0x2b')](function(){})[_0x597a('0x2d')](_0x595d13()));}}}return _0x5e8702;})[_0x597a('0x54')]();})[_0x597a('0x2b')](function(){return db[_0x597a('0x56')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x597a('0x55')],'as':_0x597a('0x59'),'where':{'id':LISTID}}]})[_0x597a('0x2b')](function(_0x4958ca){var _0x14556a=[];if(_0x4958ca){for(var _0x370fb0=0x0,_0x1fa527;_0x370fb0<_0x4958ca[_0x597a('0x26')];_0x370fb0+=0x1){_0x1fa527=_0x4958ca[_0x370fb0][_0x597a('0x57')]({'plain':!![]});_0x14556a['push'](db[_0x597a('0x50')][_0x597a('0x51')](_0xa00331(_0x1fa527,_0x597a('0x58')))[_0x597a('0x2b')](function(){})['catch'](_0x595d13()));}}return _0x14556a;})[_0x597a('0x54')]();})['catch'](function(_0x18605c){logger['error'](_0x597a('0x5a'),_0x597a('0x5b'),_0x18605c['message']);});}var processPromises=function(_0x251bde){return BPromise[_0x597a('0x54')](promises)['then'](function(_0x138e41){})[_0x597a('0x2d')](function(_0x31b429){logger[_0x597a('0x12')](_0x597a('0x5c'),JSON['stringify'](_0x31b429));})[_0x597a('0x5d')](function(){socket['emit'](_0x597a('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x251bde){return _0x251bde[_0x597a('0x5f')]();}});};var endCsv=function(){return BPromise[_0x597a('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x597a('0x2b')](function(){socket['emit'](_0x597a('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x597a('0x61')](FILEPATH);}catch(_0x4a1816){logger[_0x597a('0x12')](_0x597a('0x62'),JSON[_0x597a('0x63')](_0x4a1816));}finally{process[_0x597a('0x64')](0x0);}});};process['on'](_0x597a('0x65'),function(){logger[_0x597a('0x66')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x597a('0x60')]()[_0x597a('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x597a('0x10')](',');return db[_0x597a('0x28')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x127439){var _0x269538=fs[_0x597a('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x597a('0x68')](_0x269538,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5b57db,_0x38d04f){total+=0x1;var _0x54aa9b=total;promises[_0x597a('0x2c')](checkRow(_0x5b57db,_0x127439,_0x54aa9b)[_0x597a('0x2b')](function(){success+=0x1;})[_0x597a('0x2d')](function(_0x1c06be){if(_0x1c06be['error']){errors+=0x1;delete _0x1c06be[_0x597a('0x12')];}else if(_0x1c06be[_0x597a('0x69')]){duplicates+=0x1;delete _0x1c06be[_0x597a('0x69')];}rows[_0x597a('0x2c')](_0x1c06be);}));if(total%0xc8===0x0){_0x38d04f[_0x597a('0x6a')]();return processPromises(_0x38d04f);}},'complete':function(){return processPromises()[_0x597a('0x2b')](function(){logger[_0x597a('0x66')](_0x597a('0x6b'));endCsv();});},'error':function(_0x1a6b13,_0x55d30e){logger[_0x597a('0x66')](_0x597a('0x6c'),JSON[_0x597a('0x63')](_0x1a6b13));endCsv();}});})[_0x597a('0x2d')](function(_0x436f44){logger['error'](_0x597a('0x6d'),JSON[_0x597a('0x63')](_0x436f44));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b3fde69..67ba49e 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 _0x98bb=['info','error','exit','errors','message','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','catch','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','dialTimezone','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','data','find','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','SystemRow','appendFileSync','rows','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(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','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','push','all','then','split','isNil','filter','CmContactHasItem','findOne','updated','create','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ContactId','ListId','updatedAt','priority','recallme','fields','join','cm_contacts','.CmListId','.id\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','select','.CmListId\x20=\x20?','\x20=\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','createdAt','UserId','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x98bb,0x1d5));var _0xb98b=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x98bb[_0x5ddb1c];return _0x354adc;};'use strict';var fs=require('fs');var path=require(_0xb98b('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xb98b('0x1'));var BPromise=require(_0xb98b('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require(_0xb98b('0x3'));var db=require(_0xb98b('0x4'))['db'];var config=require(_0xb98b('0x5'));var shared=require(_0xb98b('0x6'));var logger=require(_0xb98b('0x7'))(_0xb98b('0x8'));config[_0xb98b('0x9')]=_[_0xb98b('0xa')](config[_0xb98b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb98b('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb98b('0xc')](_0xb98b('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xb98b('0xd'));function isEmail(_0x2c737a){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'](_0x2c737a);}function selectNotIn(_0x551c60,_0x4c671,_0x5145fb,_0x4206a2,_0x1a3b4b){return squel['select']()[_0xb98b('0xe')](_0xb98b('0xf'))[_0xb98b('0x10')](_0x4206a2)['join'](_0x4c671,null,_0x4c671+'.id\x20=\x20'+_0x4206a2+'.'+_0x5145fb)[_0xb98b('0x11')](_0x4206a2+'.'+_0x5145fb+'\x20=\x20'+_0x551c60+'.'+_0x5145fb)[_0xb98b('0x11')](_0x4c671+_0xb98b('0x12')+_0x1a3b4b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x359102,_0x1e93a4){promisesAdditionalPhones=[];return db[_0xb98b('0x13')][_0xb98b('0x14')]({'raw':!![],'attributes':['id',_0xb98b('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x81b571){if(_0x81b571!==null){var _0x992870=[];for(var _0x4c75b0=0x0;_0x4c75b0<_0x81b571[_0xb98b('0x16')];_0x4c75b0++){var _0x34b057=_0x81b571[_0x4c75b0];_0x992870[_0xb98b('0x17')](insertAdditionalPhones(_0x34b057));}}Promise[_0xb98b('0x18')](_0x992870)[_0xb98b('0x19')](function(){_0x359102({'val':0x1});});});});}function insertAdditionalPhones(_0xb75ba6){return new Promise(function(_0x327758,_0x4771f4){var _0x7698bc=_0xb75ba6[_0xb98b('0x15')];var _0x313db8=_0x7698bc[_0xb98b('0x1a')](';');var _0x21f3ea=[];orderBy=0x0;for(var _0x29e46e=0x0;_0x29e46e<_0x313db8[_0xb98b('0x16')];_0x29e46e++){_0x21f3ea[_0xb98b('0x17')](splitAdditionalPhone(_0xb75ba6['id'],_0x313db8[_0x29e46e]));}Promise[_0xb98b('0x18')](_0x21f3ea)['then'](function(){_0x327758({'val':_0x313db8['length']});});});}function splitAdditionalPhone(_0xd96681,_0x45d1e5){return new Promise(function(_0xabba7,_0xe7a511){var _0x39d34b=_0x45d1e5[_0xb98b('0x1a')](':');var _0x540e6e=_0x39d34b[0x0];var _0x1c6dea=_0x39d34b[0x1];if(!_[_0xb98b('0x1b')](_0x1c6dea)){var _0x28db2c=_0x1c6dea[_0xb98b('0x1a')]('|');var _0x151e0f=[];for(var _0x18bb38=0x0;_0x18bb38<_0x28db2c[_0xb98b('0x16')];_0x18bb38++){if(_0x28db2c[_0x18bb38]!==''){var _0xc7015e=_[_0xb98b('0x1c')](promisesAdditionalPhones,{'contactId':_0xd96681,'phone':_0x28db2c[_0x18bb38]});if(_0xc7015e[_0xb98b('0x16')]==0x0){orderBy++;promisesAdditionalPhones[_0xb98b('0x17')]({'contactId':_0xd96681,'contactTypeId':_0x540e6e,'phone':_0x28db2c[_0x18bb38],'orderBy':orderBy});}}}_0xabba7({'ok':0x1});}else _0xabba7({'res':0x0});});}function createAdditionalPhone(_0x3e56e0,_0x56592e,_0x572bc6,_0x192d2c){var _0xe3b665='';var _0x66befa='';var _0x28a7c8=_0x572bc6['split']('§');_0xe3b665=_0x28a7c8[0x0];if(_0x28a7c8[_0xb98b('0x16')]==0x2)_0x66befa=_0x28a7c8[0x1];return new Promise(function(_0x38aed2,_0x4179eb){return db[_0xb98b('0x1d')][_0xb98b('0x1e')]({'where':{'CmContactId':_0x3e56e0,'item':_0xe3b665}})[_0xb98b('0x19')](function(_0x281d55){if(_0x281d55){return db[_0xb98b('0x1d')]['update']({'ItemTypeId':_0x56592e,'description':_0x66befa,'OrderBy':_0x192d2c},{'where':{'CmContactId':_0x3e56e0,'item':_0xe3b665}})[_0xb98b('0x19')](function(_0x357450){_0x38aed2({'res':_0xb98b('0x1f')});});}else{return db['CmContactHasItem'][_0xb98b('0x20')]({'CmContactId':_0x3e56e0,'item':_0xe3b665,'description':_0x66befa,'ItemTypeId':_0x56592e,'OrderBy':_0x192d2c,'ItemClass':'PHONE'})['then'](function(_0x591cee){_0x38aed2({'res':_0xb98b('0x21')});});}});});}function insertCmHopper(_0x135e04,_0x1e788c,_0x522bff,_0x1f0907,_0x70b108){var _0x5e5f79=[_0xb98b('0x22'),'cm_contacts.scheduledat',_0xb98b('0x23'),_0xb98b('0x24'),_0x1e788c+'.'+_0x1f0907,'cm_contacts.createdAt',_0xb98b('0x25'),_0xb98b('0x26'),'cm_contacts.UserId','\x22'+_0x70b108+'\x22'];return squel[_0xb98b('0x27')]()[_0xb98b('0x28')](_0xb98b('0x29'))[_0xb98b('0x2a')]([_0xb98b('0xf'),'scheduledat',_0xb98b('0x2b'),_0xb98b('0x2c'),_0x1f0907,'createdAt',_0xb98b('0x2d'),_0xb98b('0x2e'),'UserId',_0xb98b('0x2f')],squel['select']()[_0xb98b('0x30')](_0x5e5f79)[_0xb98b('0x10')](_0x1e788c)[_0xb98b('0x31')](_0xb98b('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x1e788c+_0xb98b('0x33'))[_0xb98b('0x31')](_0x522bff,null,_0x522bff+_0xb98b('0x34')+_0x1e788c+'.'+_0x1f0907)[_0xb98b('0x11')](_0x1e788c+'.CmListId\x20=\x20?',_0x135e04)[_0xb98b('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb98b('0x11')](_0xb98b('0x35'),selectNotIn(_0x1e788c,_0x522bff,_0x1f0907,_0xb98b('0x29'),['\x22always\x22',_0xb98b('0x36')]))[_0xb98b('0x11')](_0xb98b('0x35'),selectNotIn(_0x1e788c,_0x522bff,_0x1f0907,_0xb98b('0x29'),['\x22always\x22'])))[_0xb98b('0x37')]();}function insertCmHopperBlack(_0xfb3250,_0x54ccbe,_0x353511,_0x5b5084){var _0x4c2cbc=[_0xb98b('0x22'),_0xb98b('0x23'),'cm_contacts.ListId',_0x54ccbe+'.'+_0x5b5084,_0xb98b('0x38'),_0xb98b('0x25')];return squel['insert']()['into'](_0xb98b('0x39'))['fromQuery']([_0xb98b('0xf'),_0xb98b('0x2b'),_0xb98b('0x2c'),_0x5b5084,'createdAt',_0xb98b('0x2d')],squel[_0xb98b('0x3a')]()['fields'](_0x4c2cbc)['from'](_0x54ccbe)[_0xb98b('0x31')](_0xb98b('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x54ccbe+'.CmListId')[_0xb98b('0x31')](_0x353511,null,_0x353511+'.id\x20=\x20'+_0x54ccbe+'.'+_0x5b5084)[_0xb98b('0x11')](_0x54ccbe+_0xb98b('0x3b'),_0xfb3250)[_0xb98b('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb98b('0x11')](_0xb98b('0x35'),squel[_0xb98b('0x3a')]()[_0xb98b('0xe')](_0xb98b('0xf'))[_0xb98b('0x10')](_0xb98b('0x39'))[_0xb98b('0x11')]('ListId\x20=\x20?',_0xfb3250)[_0xb98b('0x11')](_0x5b5084+_0xb98b('0x3c')+_0x54ccbe+'.'+_0x5b5084)))[_0xb98b('0x37')]();}function insertTzCmHopper(_0x2ba7d7,_0x4a9d83,_0x8cfea2,_0x30f184,_0x185ac7,_0x432de4){var _0x1fb907=[_0xb98b('0x22'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x432de4+_0xb98b('0x3d'),_0xb98b('0x23'),'cm_contacts.ListId',_0x4a9d83+'.'+_0x30f184,'cm_contacts.createdAt',_0xb98b('0x25'),_0xb98b('0x26'),_0xb98b('0x3e'),'\x22'+_0x185ac7+'\x22'];var _0x152013=squel[_0xb98b('0x27')]()[_0xb98b('0x28')](_0xb98b('0x29'))[_0xb98b('0x2a')]([_0xb98b('0xf'),'scheduledat',_0xb98b('0x2b'),_0xb98b('0x2c'),_0x30f184,_0xb98b('0x3f'),_0xb98b('0x2d'),_0xb98b('0x2e'),_0xb98b('0x40'),_0xb98b('0x2f')],squel[_0xb98b('0x3a')]()['fields'](_0x1fb907)['from'](_0x4a9d83)['join'](_0xb98b('0x32'),null,_0xb98b('0x41')+_0x4a9d83+'.CmListId')[_0xb98b('0x31')](_0x8cfea2,null,_0x8cfea2+_0xb98b('0x34')+_0x4a9d83+'.'+_0x30f184)[_0xb98b('0x31')](_0x432de4,null,_0x432de4+'.id\x20=\x20'+_0x4a9d83+'.'+_0x30f184)[_0xb98b('0x11')](_0x4a9d83+'.CmListId\x20=\x20?',_0x2ba7d7)['where'](_0xb98b('0x42'),NOW)[_0xb98b('0x11')](_0xb98b('0x35'),selectNotIn(_0x4a9d83,_0x8cfea2,_0x30f184,_0xb98b('0x29'),['\x22always\x22',_0xb98b('0x36')]))[_0xb98b('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4a9d83,_0x8cfea2,_0x30f184,_0xb98b('0x29'),[_0xb98b('0x43')])))['toString']();return _0x152013;}function insertTzCmHopperBlack(_0x4e74a6,_0x29efd7,_0x1f34e7,_0x2c7e35){var _0x17c23e=[_0xb98b('0x22'),_0xb98b('0x23'),_0xb98b('0x24'),_0x29efd7+'.'+_0x2c7e35,_0xb98b('0x38'),_0xb98b('0x25')];return squel[_0xb98b('0x27')]()['into'](_0xb98b('0x39'))[_0xb98b('0x2a')]([_0xb98b('0xf'),_0xb98b('0x2b'),_0xb98b('0x2c'),_0x2c7e35,_0xb98b('0x3f'),_0xb98b('0x2d')],squel[_0xb98b('0x3a')]()['fields'](_0x17c23e)[_0xb98b('0x10')](_0x29efd7)['join'](_0xb98b('0x32'),null,_0xb98b('0x41')+_0x29efd7+_0xb98b('0x33'))[_0xb98b('0x31')](_0x1f34e7,null,_0x1f34e7+_0xb98b('0x34')+_0x29efd7+'.'+_0x2c7e35)['where'](_0x29efd7+'.CmListId\x20=\x20?',_0x4e74a6)[_0xb98b('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb98b('0x35'),squel[_0xb98b('0x3a')]()[_0xb98b('0xe')]('phone')[_0xb98b('0x10')](_0xb98b('0x39'))[_0xb98b('0x11')]('ListId\x20=\x20?',_0x4e74a6)[_0xb98b('0x11')](_0x2c7e35+'\x20=\x20'+_0x29efd7+'.'+_0x2c7e35)))['toString']();}function insertCmHopperAdditionalPhones(_0x5bef69){var _0x560f18=[_0xb98b('0x44'),_0xb98b('0x45'),_0xb98b('0x46'),'cm_contact_has_items.createdAt',_0xb98b('0x47')];return squel[_0xb98b('0x27')]()[_0xb98b('0x28')](_0xb98b('0x48'))[_0xb98b('0x2a')]([_0xb98b('0x49'),_0xb98b('0xf'),_0xb98b('0x4a'),_0xb98b('0x3f'),_0xb98b('0x2d')],squel[_0xb98b('0x3a')]()['fields'](_0x560f18)[_0xb98b('0x10')](_0xb98b('0x29'))[_0xb98b('0x31')](_0xb98b('0x32'),null,_0xb98b('0x4b'))[_0xb98b('0x31')](_0xb98b('0x4c'),null,_0xb98b('0x4d'))[_0xb98b('0x11')](_0xb98b('0x4e'),_0x5bef69)[_0xb98b('0x11')](_0xb98b('0x42'),NOW))[_0xb98b('0x37')]();}function insertCmContact(_0x4a81ce,_0x479dd6,_0x49d052,_0x269d9e){var _0x7b582a=_[_0xb98b('0x4f')](_[_0xb98b('0x50')](_0x269d9e),[_0xb98b('0x2c'),_0xb98b('0x51'),_0xb98b('0x3f'),_0xb98b('0x2d')]);return squel[_0xb98b('0x27')]()[_0xb98b('0x28')](_0xb98b('0x32'))[_0xb98b('0x2a')](_0x7b582a,squel[_0xb98b('0x3a')]()[_0xb98b('0x30')](_0x7b582a)[_0xb98b('0x10')](_0x479dd6)[_0xb98b('0x11')]('('+_0x49d052['join'](',')+_0xb98b('0x52'),squel[_0xb98b('0x3a')]()['fields'](_0x49d052)[_0xb98b('0x10')]('cm_contacts')[_0xb98b('0x11')](_0xb98b('0x53'),_0x4a81ce)['where'](_0xb98b('0x54')))[_0xb98b('0x11')](_0xb98b('0x55'),squel[_0xb98b('0x3a')]()[_0xb98b('0xe')](_0xb98b('0x56'),_0xb98b('0x57'))[_0xb98b('0x10')](_0x479dd6)[_0xb98b('0x58')](_0x49d052[_0xb98b('0x31')](','))))[_0xb98b('0x37')]();}function handleStop(){logger[_0xb98b('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x30152e){logger[_0xb98b('0x5a')](_0x30152e['message']);process[_0xb98b('0x5b')](0x1);}function handleError(_0x103a3a,_0x39a1a8){stats[_0xb98b('0x5c')][_0xb98b('0x17')]({'name':_0x39a1a8['code'],'message':_0x39a1a8[_0xb98b('0x5d')],'row':_0x103a3a});}function handleQuery(_0x1c623f){logger[_0xb98b('0x59')](_0x1c623f);return db[_0xb98b('0x5e')][_0xb98b('0x5f')](_0x1c623f)[_0xb98b('0x60')](function(_0x24da65){results[_0xb98b('0x17')](_0x24da65);})['catch'](function(_0xdd8aef){logger[_0xb98b('0x5a')](_0xdd8aef['message']);});}function updateTzCampaigns(_0x2bf79f){return new Promise(function(_0x5e98b3,_0x1a02a9){var _0x588fcb=squel[_0xb98b('0x3a')]()[_0xb98b('0x30')]([_0xb98b('0x61'),_0xb98b('0x62')])[_0xb98b('0x10')](_0xb98b('0x63'))['join'](_0xb98b('0x64'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xb98b('0x11')](_0xb98b('0x65')+_0x2bf79f);db[_0xb98b('0x5e')][_0xb98b('0x5f')](_0x588fcb['toString']())[_0xb98b('0x60')](function(_0x593b09){var _0x210c16=[];for(var _0x3fc3a4=0x0;_0x3fc3a4<_0x593b09[_0xb98b('0x16')];_0x3fc3a4++){_0x210c16['push'](getTimezoneData(_0x593b09[_0x3fc3a4],tmp_campaigns));}BPromise[_0xb98b('0x18')](_0x210c16)['then'](function(){_0x5e98b3({'val':0x1});});})[_0xb98b('0x66')](function(_0x1466e5){logger[_0xb98b('0x5a')](_0x1466e5[_0xb98b('0x5d')]);_0x5e98b3({'val':0x0});});});}function updateTzVoiceQueues(_0x1a113c){return new Promise(function(_0x46094b,_0x36935e){var _0xb718f7=squel['select']()[_0xb98b('0x30')](['voice_queues.id',_0xb98b('0x67')])[_0xb98b('0x10')](_0xb98b('0x68'))[_0xb98b('0x31')](_0xb98b('0x69'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xb98b('0x11')](_0xb98b('0x6a')+_0x1a113c);db[_0xb98b('0x5e')][_0xb98b('0x5f')](_0xb718f7[_0xb98b('0x37')]())[_0xb98b('0x60')](function(_0x2f1fc9){var _0x342a3c=[];for(var _0x2c0804=0x0;_0x2c0804<_0x2f1fc9[_0xb98b('0x16')];_0x2c0804++){_0x342a3c[_0xb98b('0x17')](getTimezoneData(_0x2f1fc9[_0x2c0804],tmp_voice_queues));}BPromise[_0xb98b('0x18')](_0x342a3c)[_0xb98b('0x19')](function(){_0x46094b({'val':0x1});});})[_0xb98b('0x66')](function(_0x17d8bc){logger[_0xb98b('0x5a')](_0x17d8bc[_0xb98b('0x5d')]);_0x46094b({'val':0x0});});});}function getTimezoneData(_0x356371,_0x5d8170){return new Promise(function(_0x12fb04,_0x4d6cb4){var _0x17172f=shared[_0xb98b('0x6b')];var _0x3ceca4=_0x17172f[_0x356371['dialTimezone']];if(_[_0xb98b('0x1b')](_0x3ceca4)){_0x12fb04({'ret':0x1});}else{var _0x50f886=_0x3ceca4[_0xb98b('0x6c')];var _0x2e3f2f=squel[_0xb98b('0x27')]()[_0xb98b('0x28')](_0x5d8170)[_0xb98b('0x6d')]('id',_0x356371['id'])[_0xb98b('0x6d')]('offset',_0x50f886)[_0xb98b('0x6d')](_0xb98b('0x6e'),_0x356371[_0xb98b('0x6e')])[_0xb98b('0x37')]();return db['sequelize'][_0xb98b('0x5f')](_0x2e3f2f)[_0xb98b('0x60')](function(_0x1abd26){_0x12fb04({'ret':0x1});})[_0xb98b('0x66')](function(_0x490750){logger[_0xb98b('0x5a')](_0x490750[_0xb98b('0x5d')]);_0x4d6cb4({'ret':0x1});});}});}function handleTZQuery(_0x40761f){logger[_0xb98b('0x59')](_0x40761f);return db[_0xb98b('0x5e')][_0xb98b('0x5f')](_0x40761f)[_0xb98b('0x60')](function(_0x16d4d1){})[_0xb98b('0x66')](function(_0x5918f6){logger[_0xb98b('0x5a')](_0x5918f6[_0xb98b('0x5d')]);});}function main(_0x21fbbf,_0x2c4b0a,_0x3ea985,_0x541275){logger[_0xb98b('0x59')](_0xb98b('0x6f'),_0x21fbbf,JSON['stringify'](_0x2c4b0a));process[_0xb98b('0x70')](_0xb98b('0x71'));var _0x8fbe60=_0x2c4b0a[_0xb98b('0x72')];var _0x202081=_[_0xb98b('0x73')](_0x8fbe60);var _0x373ad0=_0x2c4b0a[_0xb98b('0x74')];var _0xfdce10=path['join'](config[_0xb98b('0x75')],_0xb98b('0x76'),_0x373ad0+_0xb98b('0x77'));hasTZ=_[_0xb98b('0x50')](_0x8fbe60)[_0xb98b('0x78')](_0xb98b('0x6e'));var _0x50d982=_[_0xb98b('0x50')](_0x8fbe60)[_0xb98b('0x31')]();logger[_0xb98b('0x59')](_0xb98b('0x79'),_0x50d982);db[_0xb98b('0x7a')][_0xb98b('0x14')]({'raw':!![],'attributes':['id','name']})[_0xb98b('0x19')](function(_0x329615){for(var _0x390618=0x0;_0x390618<_0x329615[_0xb98b('0x16')];_0x390618++){if(_0x329615[_0x390618][_0xb98b('0x7b')]in _0x8fbe60){contactItemTypes[_0xb98b('0x17')](_0x329615[_0x390618]);delete _0x202081[_0x329615[_0x390618]['name']];hasAdditionalPhones=!![];}for(var _0x11bb4b in _0x8fbe60){if(_0x329615[_0x390618]['name']+_0xb98b('0x7c')===_0x11bb4b){phoneDescriptions[_0xb98b('0x17')]({'itemTypeId':_0x329615[_0x390618]['id'],'description':_0x11bb4b});delete _0x202081[_0x11bb4b];}}}if(hasAdditionalPhones)_0x202081[_0xb98b('0x15')]='';var _0x4ca59b=_[_0xb98b('0x50')](_0x202081)[_0xb98b('0x31')]();logger[_0xb98b('0x59')](_0xb98b('0x79'),_0x4ca59b);fs[_0xb98b('0x7d')](_0xfdce10,_0x4ca59b+'\x0a');Papa[_0xb98b('0x7e')](fs['createReadStream'](_0x21fbbf),{'header':!![],'skipEmptyLines':!![],'step':function(_0x9c5c82,_0x35fd7b){try{for(var _0x5c16de=0x0,_0x11d424=[];_0x5c16de<_0x9c5c82[_0xb98b('0x7f')][_0xb98b('0x16')];_0x5c16de++){stats['rows']+=0x1;if(_0x9c5c82[_0xb98b('0x5c')][_0x5c16de]){handleError(_0x9c5c82[_0xb98b('0x7f')][_0x5c16de],_0x9c5c82[_0xb98b('0x5c')][_0x5c16de]);}else{var _0x546627=[];var _0x4dbe37=[];var _0x99c07b={};for(var _0x5150f8 in _0x8fbe60){let _0xfb67bc=contactItemTypes[_0xb98b('0x80')](_0x5b61fd=>_0x5b61fd[_0xb98b('0x7b')]===_0x5150f8);let _0xa5c353=contactItemTypes[_0xb98b('0x80')](_0x21bec3=>_0x21bec3['name']+_0xb98b('0x7c')===_0x5150f8);if(_[_0xb98b('0x1b')](_0xfb67bc)&&_[_0xb98b('0x1b')](_0xa5c353)){if(_0x8fbe60[_0xb98b('0x81')](_0x5150f8)){if(_0x9c5c82['data'][_0x5c16de][_0x8fbe60[_0x5150f8]]){var _0x5e1363=_[_0xb98b('0x82')](_0x9c5c82[_0xb98b('0x7f')][_0x5c16de][_0x8fbe60[_0x5150f8]][_0xb98b('0x83')](/"/g,'\x27'));switch(_0x5150f8){case _0xb98b('0x84'):var _0x803e09=moment(_0x5e1363,_0xb98b('0xd'),!![]);if(_0x803e09[_0xb98b('0x85')]()){_0x11d424[_0xb98b('0x17')]('\x22'+_0x5e1363+'\x22');}else{_0x546627[_0xb98b('0x17')](_0xb98b('0x86'));}break;case'priority':var _0x2a0712=parseInt(_0x5e1363);_0x5e1363=_[_0xb98b('0x87')](_0x2a0712)||_0x2a0712<0x0||_0x2a0712>0x4?_0x541275?0x3:0x2:_0x2a0712;_0x11d424[_0xb98b('0x17')]('\x22'+_0x5e1363+'\x22');break;case _0xb98b('0x40'):var _0x72c6ec=parseInt(_0x5e1363);if(_[_0xb98b('0x88')](_0x72c6ec)&&_[_0xb98b('0x78')](_0x3ea985,_0x72c6ec)){_0x11d424[_0xb98b('0x17')]('\x22'+_0x72c6ec+'\x22');}else{_0x546627[_0xb98b('0x17')]('agent\x20not\x20exists');}break;case _0xb98b('0x89'):if(isEmail(_0x5e1363)){_0x11d424[_0xb98b('0x17')]('\x22'+_0x5e1363+'\x22');}else{_0x546627[_0xb98b('0x17')]('email\x20wrong\x20format');}break;case _0xb98b('0x8a'):var _0x2c2774=moment(_0x5e1363,_0xb98b('0x8b'),!![]);if(_0x2c2774[_0xb98b('0x85')]()){_0x11d424[_0xb98b('0x17')]('\x22'+_0x5e1363+'\x22');}else{_0x546627['push'](_0xb98b('0x8c'));}break;case _0xb98b('0x6e'):var _0x2e50ac=shared[_0xb98b('0x6b')];var _0x120e66=_0x2e50ac[_0x5e1363];if(!_[_0xb98b('0x1b')](_0x120e66)){var _0x33a30d=_0x120e66['utcOffset'];_0x11d424[_0xb98b('0x17')]('\x22'+_0x5e1363+'\x22');_0x11d424['push']('\x22'+_0x33a30d+'\x22');}break;default:_0x11d424[_0xb98b('0x17')]('\x22'+_0x5e1363+'\x22');}}else{switch(_0x5150f8){case _0xb98b('0x8d'):case _0xb98b('0xf'):_0x546627['push'](_0x5150f8+_0xb98b('0x8e'));break;default:_0x11d424[_0xb98b('0x17')]('\x22\x22');}}}}else{var _0x22df90='';if(!_[_0xb98b('0x1b')](_0xfb67bc)){if(!_0x99c07b[_0xb98b('0x81')](_0xfb67bc['id'])){if(!_[_0xb98b('0x1b')](_0x9c5c82['data'][_0x5c16de][_0x8fbe60[_0x5150f8]])){var _0x5e1363=_[_0xb98b('0x82')](_0x9c5c82[_0xb98b('0x7f')][_0x5c16de][_0x8fbe60[_0x5150f8]][_0xb98b('0x83')](/"/g,'\x27'));var _0x56362a=phoneDescriptions[_0xb98b('0x80')](_0x409314=>_0x409314[_0xb98b('0x8f')]===_0xfb67bc['id']);if(!_[_0xb98b('0x1b')](_0x56362a)){var _0x171c23=_[_0xb98b('0x82')](_0x9c5c82[_0xb98b('0x7f')][_0x5c16de][_0x8fbe60[_0x56362a['description']]][_0xb98b('0x83')](/"/g,'\x27'));if(!_['isNil'](_0x171c23))_0x5e1363=_0x5e1363+'§'+_0x171c23;}if(_0x22df90=='')_0x22df90=_0x5e1363;else _0x22df90+='|'+_0x5e1363;}_0x4dbe37[_0xb98b('0x17')](_0xfb67bc['id']+':'+_0x22df90);_0x99c07b[_0xfb67bc['id']]=0x1;}}}}if(hasAdditionalPhones){_0x11d424[_0xb98b('0x17')]('\x22'+_0x4dbe37[_0xb98b('0x31')](';')+'\x22');}if(_0x546627[_0xb98b('0x16')]){handleError(_0x9c5c82[_0xb98b('0x7f')][_0x5c16de],{'code':_0xb98b('0x90'),'message':_0x546627[_0xb98b('0x31')]()});}else{fs[_0xb98b('0x91')](_0xfdce10,_0x11d424[_0xb98b('0x31')]()+'\x0a');}_0x11d424=[];}if(!(stats[_0xb98b('0x92')]%0xc8)){socket['emit'](_0xb98b('0x93')+_0x373ad0,stats);stats['errors']=[];}}if(stopped){logger[_0xb98b('0x59')](_0xb98b('0x94'));_0x35fd7b[_0xb98b('0x95')]();}}catch(_0x90ad04){handleError(_0x9c5c82[_0xb98b('0x7f')][_0x5c16de],{'code':_0xb98b('0x96'),'message':_0x90ad04[_0xb98b('0x5d')]});logger[_0xb98b('0x5a')](_0xb98b('0x97'),_0x90ad04[_0xb98b('0x5d')]);}},'complete':function(){try{var _0x3df6ae=[];var _0x12d453=[];var _0x486d9c=_0xb98b('0x32');if(_0x2c4b0a[_0xb98b('0x98')]&&_0x2c4b0a[_0xb98b('0x98')][_0xb98b('0x16')]){_0x486d9c=_0xb98b('0x99')+_0x373ad0;_0x3df6ae[_0xb98b('0x17')](_0xb98b('0x9a')+_0x486d9c+_0xb98b('0x9b'));}tmp_campaigns=_0xb98b('0x9c')+_0x373ad0;tmp_voice_queues=_0xb98b('0x9d')+_0x373ad0;_0x12d453[_0xb98b('0x17')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xb98b('0x9e'));_0x12d453['push'](_0xb98b('0x9a')+tmp_voice_queues+_0xb98b('0x9e'));BPromise[_0xb98b('0x9f')](_0x12d453,handleTZQuery)['then'](function(_0x354f13){updateTzCampaigns(_0x2c4b0a[_0xb98b('0x2c')])[_0xb98b('0x19')](function(_0x31adbc){updateTzVoiceQueues(_0x2c4b0a[_0xb98b('0x2c')])[_0xb98b('0x19')](function(_0x87d597){if(hasTZ)_0x4ca59b=_0x4ca59b[_0xb98b('0x83')](_0xb98b('0x6e'),_0xb98b('0xa0'));var _0x20bfb1=util['format'](_0xb98b('0xa1'),_0xfdce10,_0x486d9c,_0x4ca59b,_0x2c4b0a['ListId'],_0x2c4b0a[_0xb98b('0x51')]||null,NOW,NOW);if(_[_0xb98b('0x1b')](_0x8fbe60[_0xb98b('0x84')])){_0x20bfb1+=_0xb98b('0xa2');}_0x3df6ae['push'](_0x20bfb1);if(_0x2c4b0a[_0xb98b('0x98')]&&_0x2c4b0a[_0xb98b('0x98')][_0xb98b('0x16')]){_0x3df6ae[_0xb98b('0x17')](insertCmContact(_0x2c4b0a[_0xb98b('0x2c')],_0x486d9c,_0x2c4b0a[_0xb98b('0x98')],_0x8fbe60));_0x3df6ae[_0xb98b('0x17')](_0xb98b('0xa3')+_0x486d9c+';');}BPromise[_0xb98b('0x9f')](_0x3df6ae,handleQuery)[_0xb98b('0x19')](function(_0x2488e5){BPromise[_0xb98b('0x18')]([handleAdditionalPhones()])['then'](function(){_0x3df6ae=[];for(var _0x509715=0x0;_0x509715_0x4886eb['name']===_0x551a2d);let _0x4e7ae2=contactItemTypes[_0xab0c('0x81')](_0x54d5ef=>_0x54d5ef[_0xab0c('0x7c')]+_0xab0c('0x82')===_0x551a2d);if(_[_0xab0c('0x1b')](_0x5e71de)&&_[_0xab0c('0x1b')](_0x4e7ae2)){if(_0x4960ef[_0xab0c('0x83')](_0x551a2d)){if(_0x5799f0[_0xab0c('0x7e')][_0x2362ed][_0x4960ef[_0x551a2d]]){var _0x1e7132=_[_0xab0c('0x84')](_0x5799f0[_0xab0c('0x7e')][_0x2362ed][_0x4960ef[_0x551a2d]][_0xab0c('0x85')](/"/g,'\x27'));switch(_0x551a2d){case'scheduledat':var _0x1861f9=moment(_0x1e7132,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1861f9['isValid']()){_0x4f1087['push']('\x22'+_0x1e7132+'\x22');}else{_0x14a8d1[_0xab0c('0x19')](_0xab0c('0x86'));}break;case _0xab0c('0x34'):var _0x3ac03c=parseInt(_0x1e7132);_0x1e7132=_[_0xab0c('0x87')](_0x3ac03c)||_0x3ac03c<0x0||_0x3ac03c>0x4?_0x5544e2?0x3:0x2:_0x3ac03c;_0x4f1087[_0xab0c('0x19')]('\x22'+_0x1e7132+'\x22');break;case _0xab0c('0x35'):var _0x290ed3=parseInt(_0x1e7132);if(_[_0xab0c('0x88')](_0x290ed3)&&_[_0xab0c('0x79')](_0x579ea6,_0x290ed3)){_0x4f1087[_0xab0c('0x19')]('\x22'+_0x290ed3+'\x22');}else{_0x14a8d1[_0xab0c('0x19')](_0xab0c('0x89'));}break;case _0xab0c('0x8a'):if(isEmail(_0x1e7132)){_0x4f1087['push']('\x22'+_0x1e7132+'\x22');}else{_0x14a8d1['push'](_0xab0c('0x8b'));}break;case _0xab0c('0x8c'):var _0x3559d3=moment(_0x1e7132,_0xab0c('0x8d'),!![]);if(_0x3559d3['isValid']()){_0x4f1087[_0xab0c('0x19')]('\x22'+_0x1e7132+'\x22');}else{_0x14a8d1['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xab0c('0x6e'):var _0x44d8fc=shared[_0xab0c('0x6a')];var _0x47a871=_0x44d8fc[_0x1e7132];if(!_[_0xab0c('0x1b')](_0x47a871)){var _0x34fdf8=_0x47a871[_0xab0c('0x6b')];_0x4f1087[_0xab0c('0x19')]('\x22'+_0x1e7132+'\x22');_0x4f1087[_0xab0c('0x19')]('\x22'+_0x34fdf8+'\x22');}break;default:_0x4f1087[_0xab0c('0x19')]('\x22'+_0x1e7132+'\x22');}}else{switch(_0x551a2d){case _0xab0c('0x8e'):case'phone':_0x14a8d1[_0xab0c('0x19')](_0x551a2d+'\x20not\x20specified');break;default:_0x4f1087['push']('\x22\x22');}}}}else{var _0x13a0d3='';if(!_[_0xab0c('0x1b')](_0x5e71de)){if(!_0x460cf1['hasOwnProperty'](_0x5e71de['id'])){if(!_['isNil'](_0x5799f0[_0xab0c('0x7e')][_0x2362ed][_0x4960ef[_0x551a2d]])){var _0x1e7132=_[_0xab0c('0x84')](_0x5799f0[_0xab0c('0x7e')][_0x2362ed][_0x4960ef[_0x551a2d]][_0xab0c('0x85')](/"/g,'\x27'));var _0x4daa05=phoneDescriptions[_0xab0c('0x81')](_0x3f369c=>_0x3f369c['itemTypeId']===_0x5e71de['id']);if(!_['isNil'](_0x4daa05)){var _0x5ecd2b=_[_0xab0c('0x84')](_0x5799f0[_0xab0c('0x7e')][_0x2362ed][_0x4960ef[_0x4daa05['description']]][_0xab0c('0x85')](/"/g,'\x27'));if(!_['isNil'](_0x5ecd2b))_0x1e7132=_0x1e7132+'§'+_0x5ecd2b;}if(_0x13a0d3=='')_0x13a0d3=_0x1e7132;else _0x13a0d3+='|'+_0x1e7132;}_0x16c993[_0xab0c('0x19')](_0x5e71de['id']+':'+_0x13a0d3);_0x460cf1[_0x5e71de['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4f1087['push']('\x22'+_0x16c993[_0xab0c('0x10')](';')+'\x22');}if(_0x14a8d1[_0xab0c('0x18')]){handleError(_0x5799f0[_0xab0c('0x7e')][_0x2362ed],{'code':_0xab0c('0x8f'),'message':_0x14a8d1[_0xab0c('0x10')]()});}else{fs[_0xab0c('0x90')](_0x19a408,_0x4f1087[_0xab0c('0x10')]()+'\x0a');}_0x4f1087=[];}if(!(stats[_0xab0c('0x7f')]%0xc8)){socket[_0xab0c('0x91')]('contact:import:'+_0x4d6821,stats);stats[_0xab0c('0x80')]=[];}}if(stopped){logger[_0xab0c('0x57')](_0xab0c('0x92'));_0x5b6571[_0xab0c('0x93')]();}}catch(_0x255b43){handleError(_0x5799f0[_0xab0c('0x7e')][_0x2362ed],{'code':_0xab0c('0x94'),'message':_0x255b43[_0xab0c('0x58')]});logger[_0xab0c('0x5d')](_0xab0c('0x95'),_0x255b43[_0xab0c('0x58')]);}},'complete':function(){try{var _0x5e276b=[];var _0x175d20=[];var _0x40d110='cm_contacts';if(_0x4f45fb[_0xab0c('0x96')]&&_0x4f45fb['duplicates'][_0xab0c('0x18')]){_0x40d110=_0xab0c('0x97')+_0x4d6821;_0x5e276b['push']('CREATE\x20TABLE\x20'+_0x40d110+_0xab0c('0x98'));}tmp_campaigns=_0xab0c('0x99')+_0x4d6821;tmp_voice_queues=_0xab0c('0x9a')+_0x4d6821;_0x175d20[_0xab0c('0x19')](_0xab0c('0x9b')+tmp_campaigns+_0xab0c('0x9c'));_0x175d20[_0xab0c('0x19')](_0xab0c('0x9b')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x175d20,handleTZQuery)[_0xab0c('0x17')](function(_0x2d3390){updateTzCampaigns(_0x4f45fb['ListId'])['then'](function(_0x2e454d){updateTzVoiceQueues(_0x4f45fb['ListId'])['then'](function(_0x21ae09){if(hasTZ)_0x547083=_0x547083[_0xab0c('0x85')]('dialTimezone','dialTimezone,utcOffset');var _0x2f28dc=util[_0xab0c('0xc')](_0xab0c('0x9d'),_0x19a408,_0x40d110,_0x547083,_0x4f45fb['ListId'],_0x4f45fb['CompanyId']||null,NOW,NOW);if(_[_0xab0c('0x1b')](_0x4960ef[_0xab0c('0x31')])){_0x2f28dc+=_0xab0c('0x9e');}_0x5e276b[_0xab0c('0x19')](_0x2f28dc);if(_0x4f45fb[_0xab0c('0x96')]&&_0x4f45fb['duplicates']['length']){_0x5e276b['push'](insertCmContact(_0x4f45fb['ListId'],_0x40d110,_0x4f45fb[_0xab0c('0x96')],_0x4960ef));_0x5e276b[_0xab0c('0x19')]('DROP\x20TABLE\x20'+_0x40d110+';');}BPromise[_0xab0c('0x9f')](_0x5e276b,handleQuery)['then'](function(_0x465486){BPromise[_0xab0c('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x5e276b=[];for(var _0x1e6dca=0x0;_0x1e6dca\x20\x20');}var _0x29997b=path[_0xab0c('0x10')](config[_0xab0c('0x76')],_0xab0c('0x77'),process[_0xab0c('0xab')][0x2]);if(!fs[_0xab0c('0xac')](_0x29997b)){throw new Error(_0xab0c('0xad'));}var _0x4a2ea9={};try{_0x4a2ea9=JSON[_0xab0c('0xae')](process[_0xab0c('0xab')][0x3]);if(!_0x4a2ea9[_0xab0c('0x73')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x4a2ea9[_0xab0c('0x73')][_0xab0c('0x30')]){throw new Error(_0xab0c('0xaf'));}if(!_0x4a2ea9[_0xab0c('0x73')]['firstName']){throw new Error(_0xab0c('0xb0'));}var _0x1f5430=0x0;if(_0x4a2ea9[_0xab0c('0x73')][_0xab0c('0x35')]){_0x1f5430=0x1;}if(!_0x4a2ea9[_0xab0c('0x46')]){throw new Error(_0xab0c('0xb1'));}}catch(_0x45aca2){throw new Error(_0xab0c('0xb2'));}var _0x4a64a9=[];try{_0x4a64a9=_[_0xab0c('0xb3')](JSON[_0xab0c('0xae')](process['argv'][0x4]),'id');}catch(_0x2c964d){logger[_0xab0c('0x57')](_0xab0c('0xb4'));}main(_0x29997b,_0x4a2ea9,_0x4a64a9,_0x1f5430);}validate();process['on'](_0xab0c('0xb5'),handleStop);process['on'](_0xab0c('0xb6'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 08e0a66..4b4db92 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 _0xb6fa=['select\x20*\x20from\x20','isNil','AdditionalPhones','push','all','then','error','message','length','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','createdAt','updatedAt','priority','UserId','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.updatedAt','cm_hopper_black','fromQuery','ContactId','ListId','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','exit','errors','code','sequelize','query','spread','catch','main','stringify','start','clone','socket_timestamp','root','.csv','ContactItemType','name','header','writeFileSync','parse','createReadStream','rows','data','find','_description','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','affectedRows','unlink','argv','arguments\x20\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','util','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20('];(function(_0x1ac0dd,_0x5a1e5f){var _0x31fc81=function(_0x5a6f8f){while(--_0x5a6f8f){_0x1ac0dd['push'](_0x1ac0dd['shift']());}};_0x31fc81(++_0x5a1e5f);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0xb6fa[_0x506d2f];return _0x101255;};'use strict';var fs=require('fs');var path=require(_0xab6f('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xab6f('0x1'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xab6f('0x2'));var Redis=require(_0xab6f('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xab6f('0x4'));var logger=require(_0xab6f('0x5'))(_0xab6f('0x6'));config[_0xab6f('0x7')]=_[_0xab6f('0x8')](config[_0xab6f('0x7')],{'host':_0xab6f('0x9'),'port':0x18eb});var socket=require(_0xab6f('0xa'))(new Redis(config[_0xab6f('0x7')]));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()[_0xab6f('0xb')](_0xab6f('0xc'));var tempTableName=_0xab6f('0xd')+moment()[_0xab6f('0xb')](_0xab6f('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x85d4c1){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))*$/[_0xab6f('0xf')](_0x85d4c1);}function selectNotIn(_0x4838a8,_0x599560,_0x20ada3,_0x2a7588,_0x48c542){return squel[_0xab6f('0x10')]()[_0xab6f('0x11')](_0xab6f('0x12'))[_0xab6f('0x13')](_0x2a7588)[_0xab6f('0x14')](_0x599560,null,_0x599560+_0xab6f('0x15')+_0x2a7588+'.'+_0x20ada3)[_0xab6f('0x16')](_0x2a7588+'.'+_0x20ada3+'\x20=\x20'+_0x4838a8+'.'+_0x20ada3)[_0xab6f('0x16')](_0x599560+_0xab6f('0x17')+_0x48c542[_0xab6f('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4df7a8,_0x3fa542){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0xab6f('0x18')+tempTableName)['spread'](function(_0x422850){if(_0x422850!==null){var _0x3653f0=[];for(var _0x14447f=0x0;_0x14447f<_0x422850['length'];_0x14447f++){var _0x255021=_0x422850[_0x14447f];if(!_['isNil'](_0x255021[_0xab6f('0x12')])){if(!_[_0xab6f('0x19')](_0x255021[_0xab6f('0x1a')]))_0x3653f0[_0xab6f('0x1b')](insertAdditionalPhones(_0x255021));promisesContact[_0xab6f('0x1b')]({'contact':_0x255021});}}}Promise[_0xab6f('0x1c')](_0x3653f0)[_0xab6f('0x1d')](function(){_0x4df7a8({'val':0x1});});})['catch'](function(_0x1f7322){logger[_0xab6f('0x1e')](_0x1f7322[_0xab6f('0x1f')]);});});}function insertAdditionalPhones(_0x485200){return new Promise(function(_0x43eda0,_0x375e68){var _0xe3ca2f=_0x485200[_0xab6f('0x1a')];if(_[_0xab6f('0x19')](_0xe3ca2f))_0x375e68({'val':0x0});else{var _0x210d19=_0xe3ca2f['split'](';');var _0x4dc7c1=[];orderBy=0x0;for(var _0x21194b=0x0;_0x21194b<_0x210d19[_0xab6f('0x20')];_0x21194b++){_0x4dc7c1[_0xab6f('0x1b')](splitAdditionalPhone(_0x485200['id'],_0x210d19[_0x21194b]));}Promise[_0xab6f('0x1c')](_0x4dc7c1)[_0xab6f('0x1d')](function(){_0x43eda0({'val':_0x210d19[_0xab6f('0x20')]});});}});}function splitAdditionalPhone(_0xb1ef77,_0x5634c5){return new Promise(function(_0x1294d3,_0xf849b5){var _0x4f6659=_0x5634c5[_0xab6f('0x21')](':');var _0x4290f=_0x4f6659[0x0];var _0x159f29=_0x4f6659[0x1];if(_0x159f29!==''){var _0x2e10a7=_0x159f29[_0xab6f('0x21')]('|');var _0x4c2d80=[];for(var _0x8d2357=0x0;_0x8d2357<_0x2e10a7[_0xab6f('0x20')];_0x8d2357++){if(_0x2e10a7[_0x8d2357]!==''){var _0x4bcedd=_[_0xab6f('0x22')](promisesAdditionalPhones,{'contactId':_0xb1ef77,'phone':_0x2e10a7[_0x8d2357]});if(_0x4bcedd[_0xab6f('0x20')]==0x0){orderBy++;promisesAdditionalPhones[_0xab6f('0x1b')]({'contactId':_0xb1ef77,'contactTypeId':_0x4290f,'phone':_0x2e10a7[_0x8d2357],'orderBy':orderBy});}}}_0x1294d3({'ok':0x1});}else _0x1294d3({'res':0x0});});}function createAdditionalPhone(_0x2f8ebc,_0x475703,_0x181bab,_0x4952f9){var _0x3f95e8='';var _0x526d95='';var _0x4ab3b2=_0x181bab['split']('§');_0x3f95e8=_0x4ab3b2[0x0];if(_0x4ab3b2['length']==0x2)_0x526d95=_0x4ab3b2[0x1];return new Promise(function(_0x55b5a2,_0x14af68){return db[_0xab6f('0x23')][_0xab6f('0x24')]({'where':{'CmContactId':_0x2f8ebc,'item':_0x3f95e8}})[_0xab6f('0x1d')](function(_0x39b6b5){if(_0x39b6b5){return db['CmContactHasItem'][_0xab6f('0x25')]({'ItemTypeId':_0x475703,'description':_0x526d95,'OrderBy':_0x4952f9},{'where':{'CmContactId':_0x2f8ebc,'item':_0x3f95e8}})[_0xab6f('0x1d')](function(_0x86ed70){_0x55b5a2({'res':_0xab6f('0x26')});});}else{return db[_0xab6f('0x23')][_0xab6f('0x27')]({'CmContactId':_0x2f8ebc,'item':_0x3f95e8,'ItemTypeId':_0x475703,'description':_0x526d95,'OrderBy':_0x4952f9,'ItemClass':_0xab6f('0x28')})['then'](function(_0x19b056){_0x55b5a2({'res':_0xab6f('0x29')});});}});});}function updateContact(_0x513c5c){return new Promise(function(_0x5479db,_0x330f6d){var _0x56988a=_0x513c5c['id'];delete _0x513c5c['id'];return db[_0xab6f('0x2a')][_0xab6f('0x25')](_0x513c5c,{'where':{'id':_0x56988a}})[_0xab6f('0x1d')](function(_0x37d187){updatedRows+=0x1;return db[_0xab6f('0x2b')][_0xab6f('0x25')]({'phone':_0x513c5c[_0xab6f('0x12')]},{'where':{'ContactId':_0x56988a}})[_0xab6f('0x1d')](function(_0x679c47){_0x5479db({'ret':'OK'});});});});}function insertCmHopper(_0x543750,_0x13a534,_0x5c7a72,_0x5d848b,_0x44d14d){var _0x413412=[_0xab6f('0x2c'),_0xab6f('0x2d'),_0xab6f('0x2e'),_0xab6f('0x2f'),_0x13a534+'.'+_0x5d848b,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xab6f('0x30'),'\x22'+_0x44d14d+'\x22'];return squel[_0xab6f('0x31')]()[_0xab6f('0x32')](_0xab6f('0x33'))['fromQuery']([_0xab6f('0x12'),_0xab6f('0x34'),'ContactId','ListId',_0x5d848b,_0xab6f('0x35'),_0xab6f('0x36'),_0xab6f('0x37'),_0xab6f('0x38'),'recallme'],squel['select']()[_0xab6f('0x39')](_0x413412)[_0xab6f('0x13')](_0x13a534)[_0xab6f('0x14')](_0xab6f('0x3a'),null,_0xab6f('0x3b')+_0x13a534+_0xab6f('0x3c'))['join'](_0x5c7a72,null,_0x5c7a72+_0xab6f('0x15')+_0x13a534+'.'+_0x5d848b)[_0xab6f('0x16')](_0x13a534+_0xab6f('0x3d'),_0x543750)[_0xab6f('0x16')](_0xab6f('0x3e'),NOW)[_0xab6f('0x16')](_0xab6f('0x3f'),selectNotIn(_0x13a534,_0x5c7a72,_0x5d848b,_0xab6f('0x33'),[_0xab6f('0x40'),_0xab6f('0x41')]))[_0xab6f('0x16')](_0xab6f('0x3f'),selectNotIn(_0x13a534,_0x5c7a72,_0x5d848b,_0xab6f('0x33'),[_0xab6f('0x40')])))[_0xab6f('0x42')]();}function insertCmHopperBlack(_0x40d67e,_0x552ba0,_0x3cf3af,_0x44ca1b){var _0x39780a=[_0xab6f('0x2c'),_0xab6f('0x2e'),'cm_contacts.ListId',_0x552ba0+'.'+_0x44ca1b,'cm_contacts.createdAt',_0xab6f('0x43')];return squel[_0xab6f('0x31')]()[_0xab6f('0x32')](_0xab6f('0x44'))[_0xab6f('0x45')](['phone',_0xab6f('0x46'),_0xab6f('0x47'),_0x44ca1b,'createdAt','updatedAt'],squel[_0xab6f('0x10')]()[_0xab6f('0x39')](_0x39780a)['from'](_0x552ba0)[_0xab6f('0x14')](_0xab6f('0x3a'),null,_0xab6f('0x3b')+_0x552ba0+_0xab6f('0x3c'))[_0xab6f('0x14')](_0x3cf3af,null,_0x3cf3af+_0xab6f('0x15')+_0x552ba0+'.'+_0x44ca1b)['where'](_0x552ba0+_0xab6f('0x3d'),_0x40d67e)[_0xab6f('0x16')](_0xab6f('0x3e'),NOW)[_0xab6f('0x16')](_0xab6f('0x3f'),squel[_0xab6f('0x10')]()[_0xab6f('0x11')](_0xab6f('0x12'))[_0xab6f('0x13')](_0xab6f('0x44'))[_0xab6f('0x16')](_0xab6f('0x48'),_0x40d67e)[_0xab6f('0x16')](_0x44ca1b+'\x20=\x20?',_0x552ba0+'.'+_0x44ca1b)))[_0xab6f('0x42')]();}function insertCmHopperAdditionalPhones(_0x33e6eb){var _0x55388c=[_0xab6f('0x49'),_0xab6f('0x4a'),_0xab6f('0x4b'),_0xab6f('0x4c'),_0xab6f('0x4d')];return squel[_0xab6f('0x31')]()[_0xab6f('0x32')](_0xab6f('0x4e'))[_0xab6f('0x45')]([_0xab6f('0x4f'),_0xab6f('0x12'),_0xab6f('0x50'),_0xab6f('0x35'),_0xab6f('0x36')],squel['select']()[_0xab6f('0x39')](_0x55388c)['from']('cm_hopper')[_0xab6f('0x14')](_0xab6f('0x3a'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xab6f('0x14')](_0xab6f('0x51'),null,_0xab6f('0x52'))[_0xab6f('0x16')]('cm_hopper.ListId\x20=\x20?',_0x33e6eb)[_0xab6f('0x16')](_0xab6f('0x3e'),NOW))['toString']();}function insertCmContact(_0x5ee28d,_0x35f71a,_0xab8704,_0x4fd71d){var _0x9cbe3c=_[_0xab6f('0x53')](_[_0xab6f('0x54')](_0x4fd71d),[_0xab6f('0x47'),'CompanyId',_0xab6f('0x35'),_0xab6f('0x36')]);return squel[_0xab6f('0x31')]()['into'](_0xab6f('0x3a'))[_0xab6f('0x45')](_0x9cbe3c,squel['select']()[_0xab6f('0x39')](_0x9cbe3c)['from'](_0x35f71a)[_0xab6f('0x16')]('('+_0xab8704[_0xab6f('0x14')](',')+_0xab6f('0x55'),squel[_0xab6f('0x10')]()[_0xab6f('0x39')](_0xab8704)[_0xab6f('0x13')](_0xab6f('0x3a'))[_0xab6f('0x16')](_0xab6f('0x48'),_0x5ee28d))['where'](_0xab6f('0x56'),squel[_0xab6f('0x10')]()[_0xab6f('0x11')](_0xab6f('0x57'),_0xab6f('0x58'))[_0xab6f('0x13')](_0x35f71a)['group'](_0xab8704[_0xab6f('0x14')](','))))[_0xab6f('0x42')]();}function handleStop(){logger[_0xab6f('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3bd96e){logger[_0xab6f('0x1e')](_0x3bd96e[_0xab6f('0x1f')]);process[_0xab6f('0x5a')](0x1);}function handleError(_0x34c031,_0x4556a5){stats[_0xab6f('0x5b')][_0xab6f('0x1b')]({'name':_0x4556a5[_0xab6f('0x5c')],'message':_0x4556a5[_0xab6f('0x1f')],'row':_0x34c031});}function handleQuery(_0x51019e){logger[_0xab6f('0x59')](_0x51019e);return db[_0xab6f('0x5d')][_0xab6f('0x5e')](_0x51019e)[_0xab6f('0x5f')](function(_0x22b4c9){results[_0xab6f('0x1b')](_0x22b4c9);})[_0xab6f('0x60')](function(_0x3f21da){logger['error'](_0x3f21da['message']);});}function main(_0x5afe88,_0x2f48b1,_0x28d3d8,_0x4547b7){logger[_0xab6f('0x59')](_0xab6f('0x61'),_0x5afe88,JSON[_0xab6f('0x62')](_0x2f48b1));process['send'](_0xab6f('0x63'));var _0x3b9219=_0x2f48b1['binding'];var _0x17cdb4=_[_0xab6f('0x64')](_0x3b9219);var _0x3d4903=_0x2f48b1[_0xab6f('0x65')];var _0x1c8bb0=path['join'](config[_0xab6f('0x66')],'server/files/tmp',_0x3d4903+_0xab6f('0x67'));logger[_0xab6f('0x59')]('body',_0x2f48b1);db[_0xab6f('0x68')]['findAll']({'raw':!![],'attributes':['id',_0xab6f('0x69')]})[_0xab6f('0x1d')](function(_0x9a5fd5){for(var _0x19afee=0x0;_0x19afee<_0x9a5fd5[_0xab6f('0x20')];_0x19afee++){if(_0x9a5fd5[_0x19afee][_0xab6f('0x69')]in _0x3b9219){contactItemTypes[_0xab6f('0x1b')](_0x9a5fd5[_0x19afee]);delete _0x17cdb4[_0x9a5fd5[_0x19afee]['name']];hasAdditionalPhones=!![];}for(var _0x50385b in _0x3b9219){if(_0x9a5fd5[_0x19afee][_0xab6f('0x69')]+'_description'===_0x50385b){phoneDescriptions[_0xab6f('0x1b')]({'itemTypeId':_0x9a5fd5[_0x19afee]['id'],'description':_0x50385b});delete _0x17cdb4[_0x50385b];}}}if(hasAdditionalPhones)_0x17cdb4[_0xab6f('0x1a')]='';var _0x41d9de=_['keys'](_0x17cdb4)[_0xab6f('0x14')]();logger[_0xab6f('0x59')](_0xab6f('0x6a'),_0x41d9de);fs[_0xab6f('0x6b')](_0x1c8bb0,_0x41d9de+'\x0a');Papa[_0xab6f('0x6c')](fs[_0xab6f('0x6d')](_0x5afe88),{'header':!![],'skipEmptyLines':!![],'step':function(_0x250843,_0x7b221a){try{for(var _0x1eeb37=0x0,_0x5bc140=[];_0x1eeb37<_0x250843['data']['length'];_0x1eeb37++){stats[_0xab6f('0x6e')]+=0x1;if(_0x250843[_0xab6f('0x5b')][_0x1eeb37]){handleError(_0x250843[_0xab6f('0x6f')][_0x1eeb37],_0x250843[_0xab6f('0x5b')][_0x1eeb37]);}else{var _0x391038=[];var _0x1e0d3e=[];var _0x4cc14e={};for(var _0x6b1474 in _0x3b9219){let _0x36a2f3=contactItemTypes[_0xab6f('0x70')](_0x4ba68b=>_0x4ba68b[_0xab6f('0x69')]===_0x6b1474);let _0x401ec7=contactItemTypes[_0xab6f('0x70')](_0x567341=>_0x567341[_0xab6f('0x69')]+_0xab6f('0x71')===_0x6b1474);if(_[_0xab6f('0x19')](_0x36a2f3)&&_[_0xab6f('0x19')](_0x401ec7)){if(_0x3b9219[_0xab6f('0x72')](_0x6b1474)){if(_0x250843[_0xab6f('0x6f')][_0x1eeb37][_0x3b9219[_0x6b1474]]){var _0x4fcc1f=_[_0xab6f('0x73')](_0x250843['data'][_0x1eeb37][_0x3b9219[_0x6b1474]][_0xab6f('0x74')](/"/g,'\x27'));switch(_0x6b1474){case _0xab6f('0x34'):var _0x5e8fd1=moment(_0x4fcc1f,_0xab6f('0xc'),!![]);if(_0x5e8fd1[_0xab6f('0x75')]()){_0x5bc140[_0xab6f('0x1b')]('\x22'+_0x4fcc1f+'\x22');}else{_0x391038[_0xab6f('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xab6f('0x37'):var _0x491389=parseInt(_0x4fcc1f);_0x4fcc1f=_[_0xab6f('0x76')](_0x491389)||_0x491389<0x0||_0x491389>0x4?_0x4547b7?0x3:0x2:_0x491389;_0x5bc140[_0xab6f('0x1b')]('\x22'+_0x4fcc1f+'\x22');break;case _0xab6f('0x38'):var _0x27a4bf=parseInt(_0x4fcc1f);if(_[_0xab6f('0x77')](_0x27a4bf)&&_['includes'](_0x28d3d8,_0x27a4bf)){_0x5bc140['push']('\x22'+_0x27a4bf+'\x22');}else{_0x391038[_0xab6f('0x1b')](_0xab6f('0x78'));}break;case _0xab6f('0x79'):if(isEmail(_0x4fcc1f)){_0x5bc140[_0xab6f('0x1b')]('\x22'+_0x4fcc1f+'\x22');}else{_0x391038[_0xab6f('0x1b')](_0xab6f('0x7a'));}break;case'dateOfBirth':var _0xa82406=moment(_0x4fcc1f,_0xab6f('0x7b'),!![]);if(_0xa82406[_0xab6f('0x75')]()){_0x5bc140[_0xab6f('0x1b')]('\x22'+_0x4fcc1f+'\x22');}else{_0x391038[_0xab6f('0x1b')](_0xab6f('0x7c'));}break;default:_0x5bc140['push']('\x22'+_0x4fcc1f+'\x22');}}else{switch(_0x6b1474){case'firstName':case'phone':_0x391038[_0xab6f('0x1b')](_0x6b1474+_0xab6f('0x7d'));break;default:_0x5bc140[_0xab6f('0x1b')]('\x22\x22');}}}}else{var _0x3218c4='';if(!_[_0xab6f('0x19')](_0x36a2f3)){if(!_0x4cc14e[_0xab6f('0x72')](_0x36a2f3['id'])){for(var _0xef36e7=0x0;_0xef36e7<_0x3b9219[_0x6b1474][_0xab6f('0x20')];_0xef36e7++){var _0x4fcc1f=_[_0xab6f('0x73')](_0x250843[_0xab6f('0x6f')][_0x1eeb37][_0x3b9219[_0x6b1474][_0xef36e7]][_0xab6f('0x74')](/"/g,'\x27'));var _0x1b9049=phoneDescriptions[_0xab6f('0x70')](_0x3f505c=>_0x3f505c[_0xab6f('0x7e')]===_0x36a2f3['id']);if(!_[_0xab6f('0x19')](_0x1b9049)){var _0x39f950=_[_0xab6f('0x73')](_0x250843[_0xab6f('0x6f')][_0x1eeb37][_0x3b9219[_0x1b9049[_0xab6f('0x7f')]][0x0]][_0xab6f('0x74')](/"/g,'\x27'));if(!_['isNil'](_0x39f950))_0x4fcc1f=_0x4fcc1f+'§'+_0x39f950;}if(_0x3218c4=='')_0x3218c4=_0x4fcc1f;else _0x3218c4+='|'+_0x4fcc1f;}_0x1e0d3e[_0xab6f('0x1b')](_0x36a2f3['id']+':'+_0x3218c4);_0x4cc14e[_0x36a2f3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5bc140[_0xab6f('0x1b')]('\x22'+_0x1e0d3e[_0xab6f('0x14')](';')+'\x22');}if(_0x391038[_0xab6f('0x20')]){handleError(_0x250843[_0xab6f('0x6f')][_0x1eeb37],{'code':_0xab6f('0x80'),'message':_0x391038[_0xab6f('0x14')]()});}else{fs[_0xab6f('0x81')](_0x1c8bb0,_0x5bc140['join']()+'\x0a');}_0x5bc140=[];}if(!(stats[_0xab6f('0x6e')]%0xc8)){socket[_0xab6f('0x82')](_0xab6f('0x83')+_0x3d4903,stats);stats[_0xab6f('0x5b')]=[];}}if(stopped){logger[_0xab6f('0x59')](_0xab6f('0x84'));_0x7b221a[_0xab6f('0x85')]();}}catch(_0x5f368f){handleError(_0x250843['data'][_0x1eeb37],{'code':_0xab6f('0x86'),'message':_0x5f368f[_0xab6f('0x1f')]});logger[_0xab6f('0x1e')](_0xab6f('0x87'),_0x5f368f[_0xab6f('0x1f')]);}},'complete':function(){try{var _0x25132d=[];var _0x47857e=tempTableName;_0x25132d[_0xab6f('0x1b')](_0xab6f('0x88')+_0x47857e+_0xab6f('0x89'));logger['info'](_0xab6f('0x8a'),contactItemTypes[_0xab6f('0x20')]);var _0x204455=util[_0xab6f('0xb')](_0xab6f('0x8b'),_0x1c8bb0,_0x47857e,_0x41d9de,_0x2f48b1[_0xab6f('0x47')],_0x2f48b1[_0xab6f('0x8c')]||null,NOW,NOW);if(_[_0xab6f('0x19')](_0x3b9219['scheduledat'])){_0x204455+=_0xab6f('0x8d');}_0x25132d[_0xab6f('0x1b')](_0x204455);BPromise[_0xab6f('0x8e')](_0x25132d,handleQuery)[_0xab6f('0x1d')](function(_0x27b641){BPromise[_0xab6f('0x1c')]([handleAdditionalPhones()])[_0xab6f('0x1d')](function(){_0x25132d=[];for(var _0x5e7277=0x0;_0x5e7277\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','ioredis'];(function(_0x47e946,_0x19d63b){var _0x480bc1=function(_0x52b261){while(--_0x52b261){_0x47e946['push'](_0x47e946['shift']());}};_0x480bc1(++_0x19d63b);}(_0xd6dc,0x1d7));var _0xcd6d=function(_0x57468c,_0x12f5c4){_0x57468c=_0x57468c-0x0;var _0x462533=_0xd6dc[_0x57468c];return _0x462533;};'use strict';var fs=require('fs');var path=require(_0xcd6d('0x0'));var _=require('lodash');var Papa=require(_0xcd6d('0x1'));var util=require(_0xcd6d('0x2'));var BPromise=require(_0xcd6d('0x3'));var moment=require(_0xcd6d('0x4'));var squel=require('squel');var Redis=require(_0xcd6d('0x5'));var db=require(_0xcd6d('0x6'))['db'];var config=require(_0xcd6d('0x7'));var logger=require(_0xcd6d('0x8'))(_0xcd6d('0x9'));config[_0xcd6d('0xa')]=_[_0xcd6d('0xb')](config[_0xcd6d('0xa')],{'host':_0xcd6d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd6d('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()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0xcd6d('0xd')](_0xcd6d('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x566380){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))*$/[_0xcd6d('0xf')](_0x566380);}function selectNotIn(_0x3ae3fb,_0x5097be,_0x2541b4,_0x31a8cc,_0x147b1a){return squel['select']()[_0xcd6d('0x10')]('phone')['from'](_0x31a8cc)[_0xcd6d('0x11')](_0x5097be,null,_0x5097be+_0xcd6d('0x12')+_0x31a8cc+'.'+_0x2541b4)[_0xcd6d('0x13')](_0x31a8cc+'.'+_0x2541b4+_0xcd6d('0x14')+_0x3ae3fb+'.'+_0x2541b4)[_0xcd6d('0x13')](_0x5097be+_0xcd6d('0x15')+_0x147b1a[_0xcd6d('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1d2f8b,_0x2328f6){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0xcd6d('0x16')](_0xcd6d('0x17')+tempTableName)[_0xcd6d('0x18')](function(_0x4afafb){if(_0x4afafb!==null){var _0x107354=[];for(var _0x5aabbe=0x0;_0x5aabbe<_0x4afafb[_0xcd6d('0x19')];_0x5aabbe++){var _0x55fccd=_0x4afafb[_0x5aabbe];if(!_[_0xcd6d('0x1a')](_0x55fccd['phone'])){if(!_['isNil'](_0x55fccd[_0xcd6d('0x1b')]))_0x107354[_0xcd6d('0x1c')](insertAdditionalPhones(_0x55fccd));promisesContact[_0xcd6d('0x1c')]({'contact':_0x55fccd});}}}Promise[_0xcd6d('0x1d')](_0x107354)[_0xcd6d('0x1e')](function(){_0x1d2f8b({'val':0x1});});})['catch'](function(_0x5de23c){logger[_0xcd6d('0x1f')](_0x5de23c[_0xcd6d('0x20')]);});});}function insertAdditionalPhones(_0x5d959a){return new Promise(function(_0xb88ec1,_0x22e7e0){var _0x40d02a=_0x5d959a['AdditionalPhones'];if(_['isNil'](_0x40d02a))_0x22e7e0({'val':0x0});else{var _0xda5b8=_0x40d02a[_0xcd6d('0x21')](';');var _0x3bde73=[];orderBy=0x0;for(var _0x4001fb=0x0;_0x4001fb<_0xda5b8[_0xcd6d('0x19')];_0x4001fb++){_0x3bde73[_0xcd6d('0x1c')](splitAdditionalPhone(_0x5d959a['id'],_0xda5b8[_0x4001fb]));}Promise[_0xcd6d('0x1d')](_0x3bde73)['then'](function(){_0xb88ec1({'val':_0xda5b8['length']});});}});}function splitAdditionalPhone(_0x234ae3,_0x45eb2d){return new Promise(function(_0x38ee46,_0x220152){var _0x25d0fe=_0x45eb2d[_0xcd6d('0x21')](':');var _0x223681=_0x25d0fe[0x0];var _0x323587=_0x25d0fe[0x1];if(_0x323587!==''){var _0x157c6c=_0x323587[_0xcd6d('0x21')]('|');var _0xf9b6ee=[];for(var _0x26fdca=0x0;_0x26fdca<_0x157c6c[_0xcd6d('0x19')];_0x26fdca++){if(_0x157c6c[_0x26fdca]!==''){var _0x4d0595=_[_0xcd6d('0x22')](promisesAdditionalPhones,{'contactId':_0x234ae3,'phone':_0x157c6c[_0x26fdca]});if(_0x4d0595[_0xcd6d('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xcd6d('0x1c')]({'contactId':_0x234ae3,'contactTypeId':_0x223681,'phone':_0x157c6c[_0x26fdca],'orderBy':orderBy});}}}_0x38ee46({'ok':0x1});}else _0x38ee46({'res':0x0});});}function createAdditionalPhone(_0x4b0b17,_0x37e0dd,_0x5a30ba,_0x507490){var _0x30730a='';var _0x1939e9='';var _0x485663=_0x5a30ba[_0xcd6d('0x21')]('§');_0x30730a=_0x485663[0x0];if(_0x485663[_0xcd6d('0x19')]==0x2)_0x1939e9=_0x485663[0x1];return new Promise(function(_0x410765,_0x45db3a){return db[_0xcd6d('0x23')]['findOne']({'where':{'CmContactId':_0x4b0b17,'item':_0x30730a}})[_0xcd6d('0x1e')](function(_0x423141){if(_0x423141){return db[_0xcd6d('0x23')][_0xcd6d('0x24')]({'ItemTypeId':_0x37e0dd,'description':_0x1939e9,'OrderBy':_0x507490},{'where':{'CmContactId':_0x4b0b17,'item':_0x30730a}})[_0xcd6d('0x1e')](function(_0x27b52d){_0x410765({'res':_0xcd6d('0x25')});});}else{return db[_0xcd6d('0x23')][_0xcd6d('0x26')]({'CmContactId':_0x4b0b17,'item':_0x30730a,'ItemTypeId':_0x37e0dd,'description':_0x1939e9,'OrderBy':_0x507490,'ItemClass':_0xcd6d('0x27')})[_0xcd6d('0x1e')](function(_0x3b752b){_0x410765({'res':'inserted'});});}});});}function updateContact(_0x25d04b){return new Promise(function(_0x5e9c9e,_0x37375b){var _0x237629=_0x25d04b['id'];delete _0x25d04b['id'];return db[_0xcd6d('0x28')][_0xcd6d('0x24')](_0x25d04b,{'where':{'id':_0x237629}})[_0xcd6d('0x1e')](function(_0x10c7bd){updatedRows+=0x1;return db[_0xcd6d('0x29')][_0xcd6d('0x24')]({'phone':_0x25d04b['phone']},{'where':{'ContactId':_0x237629}})[_0xcd6d('0x1e')](function(_0x101b44){_0x5e9c9e({'ret':'OK'});});});});}function insertCmHopper(_0x59f9a5,_0x5412eb,_0x51654d,_0x5af0c5,_0x6f5e6b){var _0x4c0ce7=['cm_contacts.phone',_0xcd6d('0x2a'),_0xcd6d('0x2b'),_0xcd6d('0x2c'),_0x5412eb+'.'+_0x5af0c5,_0xcd6d('0x2d'),_0xcd6d('0x2e'),_0xcd6d('0x2f'),_0xcd6d('0x30'),'\x22'+_0x6f5e6b+'\x22'];return squel[_0xcd6d('0x31')]()['into']('cm_hopper')[_0xcd6d('0x32')]([_0xcd6d('0x33'),_0xcd6d('0x34'),_0xcd6d('0x35'),_0xcd6d('0x36'),_0x5af0c5,_0xcd6d('0x37'),_0xcd6d('0x38'),_0xcd6d('0x39'),_0xcd6d('0x3a'),_0xcd6d('0x3b')],squel['select']()[_0xcd6d('0x3c')](_0x4c0ce7)[_0xcd6d('0x3d')](_0x5412eb)['join'](_0xcd6d('0x3e'),null,_0xcd6d('0x3f')+_0x5412eb+'.CmListId')[_0xcd6d('0x11')](_0x51654d,null,_0x51654d+_0xcd6d('0x12')+_0x5412eb+'.'+_0x5af0c5)[_0xcd6d('0x13')](_0x5412eb+_0xcd6d('0x40'),_0x59f9a5)[_0xcd6d('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcd6d('0x13')](_0xcd6d('0x41'),selectNotIn(_0x5412eb,_0x51654d,_0x5af0c5,_0xcd6d('0x42'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xcd6d('0x13')](_0xcd6d('0x41'),selectNotIn(_0x5412eb,_0x51654d,_0x5af0c5,_0xcd6d('0x42'),[_0xcd6d('0x43')])))[_0xcd6d('0x44')]();}function insertCmHopperBlack(_0x836924,_0x5e8d35,_0x1e0493,_0x392ea2){var _0x2a7829=[_0xcd6d('0x45'),_0xcd6d('0x2b'),_0xcd6d('0x2c'),_0x5e8d35+'.'+_0x392ea2,_0xcd6d('0x2d'),_0xcd6d('0x2e')];return squel[_0xcd6d('0x31')]()['into'](_0xcd6d('0x46'))[_0xcd6d('0x32')](['phone','ContactId',_0xcd6d('0x36'),_0x392ea2,_0xcd6d('0x37'),'updatedAt'],squel[_0xcd6d('0x47')]()[_0xcd6d('0x3c')](_0x2a7829)['from'](_0x5e8d35)[_0xcd6d('0x11')](_0xcd6d('0x3e'),null,'cm_contacts.ListId\x20=\x20'+_0x5e8d35+_0xcd6d('0x48'))[_0xcd6d('0x11')](_0x1e0493,null,_0x1e0493+_0xcd6d('0x12')+_0x5e8d35+'.'+_0x392ea2)[_0xcd6d('0x13')](_0x5e8d35+'.CmListId\x20=\x20?',_0x836924)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcd6d('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xcd6d('0x47')]()[_0xcd6d('0x10')](_0xcd6d('0x33'))[_0xcd6d('0x3d')](_0xcd6d('0x46'))[_0xcd6d('0x13')](_0xcd6d('0x49'),_0x836924)[_0xcd6d('0x13')](_0x392ea2+_0xcd6d('0x4a'),_0x5e8d35+'.'+_0x392ea2)))[_0xcd6d('0x44')]();}function insertCmHopperAdditionalPhones(_0xe50fe1){var _0x4ebd1c=[_0xcd6d('0x4b'),'cm_contact_has_items.item',_0xcd6d('0x4c'),_0xcd6d('0x4d'),_0xcd6d('0x4e')];return squel[_0xcd6d('0x31')]()[_0xcd6d('0x4f')](_0xcd6d('0x50'))[_0xcd6d('0x32')]([_0xcd6d('0x51'),_0xcd6d('0x33'),_0xcd6d('0x52'),_0xcd6d('0x37'),_0xcd6d('0x38')],squel[_0xcd6d('0x47')]()[_0xcd6d('0x3c')](_0x4ebd1c)[_0xcd6d('0x3d')](_0xcd6d('0x42'))['join'](_0xcd6d('0x3e'),null,_0xcd6d('0x53'))[_0xcd6d('0x11')](_0xcd6d('0x54'),null,_0xcd6d('0x55'))[_0xcd6d('0x13')](_0xcd6d('0x56'),_0xe50fe1)[_0xcd6d('0x13')](_0xcd6d('0x57'),NOW))[_0xcd6d('0x44')]();}function insertCmContact(_0x193295,_0x14ccc6,_0x230e35,_0x50d749){var _0xea18e8=_[_0xcd6d('0x58')](_[_0xcd6d('0x59')](_0x50d749),[_0xcd6d('0x36'),'CompanyId',_0xcd6d('0x37'),_0xcd6d('0x38')]);return squel['insert']()[_0xcd6d('0x4f')]('cm_contacts')['fromQuery'](_0xea18e8,squel['select']()[_0xcd6d('0x3c')](_0xea18e8)[_0xcd6d('0x3d')](_0x14ccc6)[_0xcd6d('0x13')]('('+_0x230e35[_0xcd6d('0x11')](',')+_0xcd6d('0x5a'),squel[_0xcd6d('0x47')]()[_0xcd6d('0x3c')](_0x230e35)['from']('cm_contacts')[_0xcd6d('0x13')](_0xcd6d('0x49'),_0x193295))[_0xcd6d('0x13')]('id\x20IN\x20?',squel['select']()[_0xcd6d('0x10')](_0xcd6d('0x5b'),'min_id')['from'](_0x14ccc6)[_0xcd6d('0x5c')](_0x230e35[_0xcd6d('0x11')](','))))['toString']();}function handleStop(){logger['info'](_0xcd6d('0x5d'));stopped=!![];}function handleUncaughtException(_0x5ea7a3){logger[_0xcd6d('0x1f')](_0x5ea7a3['message']);process[_0xcd6d('0x5e')](0x1);}function handleError(_0x21a7e7,_0x466033){stats[_0xcd6d('0x5f')][_0xcd6d('0x1c')]({'name':_0x466033[_0xcd6d('0x60')],'message':_0x466033[_0xcd6d('0x20')],'row':_0x21a7e7});}function handleQuery(_0x4a5d15){logger['info'](_0x4a5d15);return db[_0xcd6d('0x61')]['query'](_0x4a5d15)[_0xcd6d('0x18')](function(_0x70f704){results[_0xcd6d('0x1c')](_0x70f704);})[_0xcd6d('0x62')](function(_0x549b72){logger[_0xcd6d('0x1f')](_0x549b72['message']);});}function main(_0x2f089b,_0xabb96f,_0x5e9f7f,_0x6a97dd){logger[_0xcd6d('0x63')](_0xcd6d('0x64'),_0x2f089b,JSON[_0xcd6d('0x65')](_0xabb96f));process[_0xcd6d('0x66')](_0xcd6d('0x67'));var _0xc6ae53=_0xabb96f[_0xcd6d('0x68')];var _0x4a4e66=_[_0xcd6d('0x69')](_0xc6ae53);var _0x20d2c1=_0xabb96f[_0xcd6d('0x6a')];var _0x36734c=path[_0xcd6d('0x11')](config['root'],_0xcd6d('0x6b'),_0x20d2c1+'.csv');logger[_0xcd6d('0x63')]('body',_0xabb96f);db['ContactItemType'][_0xcd6d('0x6c')]({'raw':!![],'attributes':['id',_0xcd6d('0x6d')]})[_0xcd6d('0x1e')](function(_0x37edb4){for(var _0x4387cb=0x0;_0x4387cb<_0x37edb4['length'];_0x4387cb++){if(_0x37edb4[_0x4387cb][_0xcd6d('0x6d')]in _0xc6ae53){contactItemTypes[_0xcd6d('0x1c')](_0x37edb4[_0x4387cb]);delete _0x4a4e66[_0x37edb4[_0x4387cb][_0xcd6d('0x6d')]];hasAdditionalPhones=!![];}for(var _0x170c20 in _0xc6ae53){if(_0x37edb4[_0x4387cb][_0xcd6d('0x6d')]+_0xcd6d('0x6e')===_0x170c20){phoneDescriptions['push']({'itemTypeId':_0x37edb4[_0x4387cb]['id'],'description':_0x170c20});delete _0x4a4e66[_0x170c20];}}}if(hasAdditionalPhones)_0x4a4e66[_0xcd6d('0x1b')]='';var _0x3f8a75=_[_0xcd6d('0x59')](_0x4a4e66)[_0xcd6d('0x11')]();logger[_0xcd6d('0x63')]('header',_0x3f8a75);fs['writeFileSync'](_0x36734c,_0x3f8a75+'\x0a');Papa[_0xcd6d('0x6f')](fs[_0xcd6d('0x70')](_0x2f089b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x12fe1,_0x1143d0){try{for(var _0x5e69cb=0x0,_0x49a9ee=[];_0x5e69cb<_0x12fe1[_0xcd6d('0x71')][_0xcd6d('0x19')];_0x5e69cb++){stats[_0xcd6d('0x72')]+=0x1;if(_0x12fe1[_0xcd6d('0x5f')][_0x5e69cb]){handleError(_0x12fe1[_0xcd6d('0x71')][_0x5e69cb],_0x12fe1[_0xcd6d('0x5f')][_0x5e69cb]);}else{var _0x42e115=[];var _0x5a225e=[];var _0x3cfa85={};for(var _0x3e6279 in _0xc6ae53){let _0x5d74e7=contactItemTypes['find'](_0x187d58=>_0x187d58[_0xcd6d('0x6d')]===_0x3e6279);let _0xea5fd1=contactItemTypes['find'](_0x5ce476=>_0x5ce476[_0xcd6d('0x6d')]+_0xcd6d('0x6e')===_0x3e6279);if(_[_0xcd6d('0x1a')](_0x5d74e7)&&_[_0xcd6d('0x1a')](_0xea5fd1)){if(_0xc6ae53[_0xcd6d('0x73')](_0x3e6279)){if(_0x12fe1[_0xcd6d('0x71')][_0x5e69cb][_0xc6ae53[_0x3e6279]]){var _0x2990a6=_[_0xcd6d('0x74')](_0x12fe1[_0xcd6d('0x71')][_0x5e69cb][_0xc6ae53[_0x3e6279]][_0xcd6d('0x75')](/"/g,'\x27'));switch(_0x3e6279){case _0xcd6d('0x34'):var _0x3e8efb=moment(_0x2990a6,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3e8efb['isValid']()){_0x49a9ee[_0xcd6d('0x1c')]('\x22'+_0x2990a6+'\x22');}else{_0x42e115[_0xcd6d('0x1c')](_0xcd6d('0x76'));}break;case'priority':var _0x593fdd=parseInt(_0x2990a6);_0x2990a6=_[_0xcd6d('0x77')](_0x593fdd)||_0x593fdd<0x0||_0x593fdd>0x4?_0x6a97dd?0x3:0x2:_0x593fdd;_0x49a9ee[_0xcd6d('0x1c')]('\x22'+_0x2990a6+'\x22');break;case _0xcd6d('0x3a'):var _0x181b66=parseInt(_0x2990a6);if(_['isNumber'](_0x181b66)&&_[_0xcd6d('0x78')](_0x5e9f7f,_0x181b66)){_0x49a9ee[_0xcd6d('0x1c')]('\x22'+_0x181b66+'\x22');}else{_0x42e115['push'](_0xcd6d('0x79'));}break;case _0xcd6d('0x7a'):if(isEmail(_0x2990a6)){_0x49a9ee['push']('\x22'+_0x2990a6+'\x22');}else{_0x42e115[_0xcd6d('0x1c')]('email\x20wrong\x20format');}break;case _0xcd6d('0x7b'):var _0x4d17d9=moment(_0x2990a6,'YYYY-MM-DD',!![]);if(_0x4d17d9[_0xcd6d('0x7c')]()){_0x49a9ee[_0xcd6d('0x1c')]('\x22'+_0x2990a6+'\x22');}else{_0x42e115['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x49a9ee['push']('\x22'+_0x2990a6+'\x22');}}else{switch(_0x3e6279){case _0xcd6d('0x7d'):case _0xcd6d('0x33'):_0x42e115[_0xcd6d('0x1c')](_0x3e6279+_0xcd6d('0x7e'));break;default:_0x49a9ee[_0xcd6d('0x1c')]('\x22\x22');}}}}else{var _0xe43ee4='';if(!_[_0xcd6d('0x1a')](_0x5d74e7)){if(!_0x3cfa85[_0xcd6d('0x73')](_0x5d74e7['id'])){for(var _0x3a8f88=0x0;_0x3a8f88<_0xc6ae53[_0x3e6279][_0xcd6d('0x19')];_0x3a8f88++){var _0x2990a6=_[_0xcd6d('0x74')](_0x12fe1[_0xcd6d('0x71')][_0x5e69cb][_0xc6ae53[_0x3e6279][_0x3a8f88]][_0xcd6d('0x75')](/"/g,'\x27'));var _0x24a419=phoneDescriptions[_0xcd6d('0x7f')](_0x5b208b=>_0x5b208b['itemTypeId']===_0x5d74e7['id']);if(!_['isNil'](_0x24a419)){var _0x45177a=_[_0xcd6d('0x74')](_0x12fe1[_0xcd6d('0x71')][_0x5e69cb][_0xc6ae53[_0x24a419[_0xcd6d('0x80')]][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x45177a))_0x2990a6=_0x2990a6+'§'+_0x45177a;}if(_0xe43ee4=='')_0xe43ee4=_0x2990a6;else _0xe43ee4+='|'+_0x2990a6;}_0x5a225e[_0xcd6d('0x1c')](_0x5d74e7['id']+':'+_0xe43ee4);_0x3cfa85[_0x5d74e7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x49a9ee['push']('\x22'+_0x5a225e[_0xcd6d('0x11')](';')+'\x22');}if(_0x42e115[_0xcd6d('0x19')]){handleError(_0x12fe1[_0xcd6d('0x71')][_0x5e69cb],{'code':_0xcd6d('0x81'),'message':_0x42e115[_0xcd6d('0x11')]()});}else{fs[_0xcd6d('0x82')](_0x36734c,_0x49a9ee['join']()+'\x0a');}_0x49a9ee=[];}if(!(stats[_0xcd6d('0x72')]%0xc8)){socket[_0xcd6d('0x83')](_0xcd6d('0x84')+_0x20d2c1,stats);stats[_0xcd6d('0x5f')]=[];}}if(stopped){logger[_0xcd6d('0x63')](_0xcd6d('0x85'));_0x1143d0[_0xcd6d('0x86')]();}}catch(_0x594816){handleError(_0x12fe1[_0xcd6d('0x71')][_0x5e69cb],{'code':_0xcd6d('0x87'),'message':_0x594816[_0xcd6d('0x20')]});logger[_0xcd6d('0x1f')](_0xcd6d('0x88'),_0x594816[_0xcd6d('0x20')]);}},'complete':function(){try{var _0x2a1ea3=[];var _0xcf42a3=tempTableName;_0x2a1ea3['push']('CREATE\x20TABLE\x20'+_0xcf42a3+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes[_0xcd6d('0x19')]);var _0x14e0c3=util[_0xcd6d('0xd')](_0xcd6d('0x89'),_0x36734c,_0xcf42a3,_0x3f8a75,_0xabb96f[_0xcd6d('0x36')],_0xabb96f[_0xcd6d('0x8a')]||null,NOW,NOW);if(_[_0xcd6d('0x1a')](_0xc6ae53[_0xcd6d('0x34')])){_0x14e0c3+=_0xcd6d('0x8b');}_0x2a1ea3['push'](_0x14e0c3);BPromise[_0xcd6d('0x8c')](_0x2a1ea3,handleQuery)[_0xcd6d('0x1e')](function(_0x3d6f7d){BPromise[_0xcd6d('0x1d')]([handleAdditionalPhones()])[_0xcd6d('0x1e')](function(){_0x2a1ea3=[];for(var _0x4c9ef5=0x0;_0x4c9ef5\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','findOne','enableEmailPreview','all','getSelectedTags','isEmpty','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','agent','field','name','color','from','getInteractionFK','user_has_','select','u.id'];(function(_0x3fec22,_0x2b4645){var _0x402df5=function(_0xd9129f){while(--_0xd9129f){_0x3fec22['push'](_0x3fec22['shift']());}};_0x402df5(++_0x2b4645);}(_0x2f68,0x9a));var _0x82f6=function(_0x3f9299,_0x49a537){_0x3f9299=_0x3f9299-0x0;var _0xc6d93a=_0x2f68[_0x3f9299];return _0xc6d93a;};'use strict';var _=require('lodash');var squel=require(_0x82f6('0x0'));var as=require(_0x82f6('0x1'));var qs=require(_0x82f6('0x2'));var updateInteraction=require(_0x82f6('0x3'))['updateInteraction'];var utils=require(_0x82f6('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x2a06dc,_0x2ab73d,_0x5dad09){var _0x3ad120=![];var _0x2c4302=utils['getAccountFK'](_0x2a06dc);if(_0x2ab73d['role']===_0x82f6('0x5')&&!_0x5dad09['search']&&!_0x5dad09[_0x2c4302]){_0x3ad120=!![];}return _0x3ad120;}function getTagsQuery(){return squel['select']()[_0x82f6('0x6')]('id')[_0x82f6('0x6')](_0x82f6('0x7'))['field'](_0x82f6('0x8'))[_0x82f6('0x9')]('tools_tags');}function getUsersQuery(_0x1cf88e,_0x1eec2f){var _0x3f8320=utils[_0x82f6('0xa')](_0x1cf88e);var _0x1a68c4=_0x82f6('0xb')+_0x1cf88e+'_interactions';var _0x12c5bc=squel[_0x82f6('0xc')]()['field'](_0x82f6('0xd'))[_0x82f6('0x6')](_0x82f6('0xe'))[_0x82f6('0x6')](_0x82f6('0xf')+_0x3f8320)[_0x82f6('0x9')](_0x1a68c4,'ui')[_0x82f6('0x10')](_0x82f6('0x11'),'u',_0x82f6('0x12'));if(_0x1eec2f['length']>0x0){_0x12c5bc[_0x82f6('0x13')]('ui.'+_0x3f8320+_0x82f6('0x14'),_[_0x82f6('0x15')](_0x1eec2f,'id'));}return _0x12c5bc;}function getInteractionsQuery(_0x31b4fb){var _0x1033d3=utils[_0x82f6('0x16')](_0x31b4fb);var _0x2326ae=utils[_0x82f6('0x17')](_0x31b4fb);var _0xcbc95f=utils[_0x82f6('0xa')](_0x31b4fb);return squel[_0x82f6('0xc')]()[_0x82f6('0x9')](_0x1033d3[_0x82f6('0x18')],'i')[_0x82f6('0x10')](_0x82f6('0x19'),'c',_0x82f6('0x1a'))['left_join'](_0x82f6('0x11'),'o',_0x82f6('0x1b'))['left_join'](_0x1033d3[_0x82f6('0x1c')],'a',_0x82f6('0x1d')+_0x2326ae)[_0x82f6('0x10')](_0x1033d3[_0x82f6('0x1e')],'me','me.'+_0xcbc95f+_0x82f6('0x1f'))['left_join'](_0x1033d3[_0x82f6('0x20')],'it',_0x82f6('0x21')+_0xcbc95f+'\x20=\x20i.id')['left_join'](_0x82f6('0x22'),'t',_0x82f6('0x23'));}function getSqlClauses(){var _0x4c57c5={'body':squel['expr'](),'contact':squel[_0x82f6('0x24')](),'default':squel[_0x82f6('0x24')](),'fields':squel['expr'](),'filter':squel[_0x82f6('0x24')](),'read':squel[_0x82f6('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x4c57c5;}function parseTagParameter(_0x1c165b){var _0x5187d0=squel[_0x82f6('0x24')]();if(_0x1c165b){var _0x5a6d69=utils['getSelectedTags'](_0x1c165b);_0x5a6d69[_0x82f6('0x25')](function(_0x15c9b7){_0x5187d0['or'](_0x82f6('0x26'),'%,'+_0x15c9b7+',%');});}return _0x5187d0;}function parseReadParameter(_0x1125a0){var _0x4f9fa4='';if(_0x1125a0){_0x4f9fa4=_0x82f6('0x27');if(_0x1125a0==='1'){_0x4f9fa4=_0x4f9fa4[_0x82f6('0x28')](_0x82f6('0x29'),'=');}else{_0x4f9fa4=_0x4f9fa4[_0x82f6('0x28')](_0x82f6('0x29'),'>');}}return _0x4f9fa4;}function parseSearchFilter(_0x328707,_0x27e473){var _0x475d91=squel[_0x82f6('0x24')]();if(_0x27e473){var _0x402449=_0x27e473[_0x82f6('0x28')]('\x5c','\x5c\x5c')[_0x82f6('0x28')](/'/g,'\x27\x27');if(qs[_0x82f6('0x2a')](_0x402449)){_0x475d91['or'](_0x82f6('0x2b'),_0x402449+'%');if(['sms',_0x82f6('0x2c')][_0x82f6('0x2d')](_0x328707)){_0x475d91['or'](_0x82f6('0x2e'),_0x402449+'%');}else if(_0x328707==='fax'){_0x475d91['or'](_0x82f6('0x2f'),_0x402449+'%');}else if(_0x328707===_0x82f6('0x30')){_0x475d91['or'](_0x82f6('0x31'),_0x402449+'%');}}else if(_0x328707===_0x82f6('0x32')&&qs[_0x82f6('0x33')](_0x402449)){_0x475d91['or'](_0x82f6('0x34'),_0x402449+'%');}else{if(_0x328707===_0x82f6('0x32')){_0x475d91['or'](_0x82f6('0x35'),qs[_0x82f6('0x36')](_0x402449))['or'](_0x82f6('0x37'),qs[_0x82f6('0x36')](_0x402449));}else{if(_0x328707!==_0x82f6('0x38')){_0x475d91['or'](_0x82f6('0x39'),qs[_0x82f6('0x36')](_0x402449));}_0x475d91['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x402449+'%');}}}return _0x475d91;}function parseAdvancedSearchFilter(_0x13a409,_0x3238b9){var _0x1c6ce4=getSqlClauses();var _0x276451=as[_0x82f6('0x3a')](_0x13a409);var _0x4390a9=_0x276451[_0x82f6('0x3b')];for(var _0x383987=0x0;_0x383987<_0x276451[_0x82f6('0x3c')][_0x82f6('0x3d')];_0x383987++){var _0x458041=_0x276451[_0x82f6('0x3c')][_0x383987];var _0xe5024f='i';var _0x34665a=_['find'](_0x3238b9,[_0x82f6('0x7'),_0x458041['field']]);if(_0x34665a){var _0x4dd445=as[_0x82f6('0x3e')](_0xe5024f,_0x34665a[_0x82f6('0x3f')],_0x458041);_0x1c6ce4['default'][_0x4390a9](_0x4dd445[_0x82f6('0x40')],_0x4dd445[_0x82f6('0x41')][_0x82f6('0x42')],_0x4dd445['value'][_0x82f6('0x43')]);}else{switch(_0x458041['field']){case _0x82f6('0x44'):var _0x5f48cf=parseReadParameter(_0x458041[_0x82f6('0x41')]);_0x1c6ce4['read'][_0x82f6('0x45')](_0x5f48cf);break;case _0x82f6('0x46'):if(_0x458041['operator']===_0x82f6('0x47')){if(_0x458041[_0x82f6('0x41')][_0x82f6('0x48')]('\x20')[_0x82f6('0x3d')]>0x1){_0x1c6ce4['contact'][_0x4390a9](_0x82f6('0x49'),qs[_0x82f6('0x36')](_0x458041[_0x82f6('0x41')]),null);}else{var _0x725b33='%'+_0x458041['value']+'%';_0x1c6ce4[_0x82f6('0x4a')][_0x4390a9](_0x82f6('0x4b'),_0x725b33,_0x725b33,_0x725b33);}}else{_0x34665a=_['find'](_0x3238b9,[_0x82f6('0x7'),_0x82f6('0x4c')]);_0x458041[_0x82f6('0x6')]=_0x82f6('0x4c');_0x4dd445=as[_0x82f6('0x3e')](_0xe5024f,_0x34665a['type'],_0x458041);_0x1c6ce4[_0x82f6('0x4a')][_0x4390a9](_0x4dd445['text'],_0x4dd445[_0x82f6('0x41')][_0x82f6('0x42')],_0x4dd445[_0x82f6('0x41')][_0x82f6('0x43')]);}break;case _0x82f6('0x4d'):var _0x293002=_0x458041[_0x82f6('0x41')]['split'](',')[_0x82f6('0x15')](function(_0x297cda){return Number(_0x297cda);});var _0x274736=parseTagParameter(_0x293002);_0x1c6ce4[_0x82f6('0x4e')]['clause'][_0x82f6('0x45')](_0x274736);_0x1c6ce4['tags'][_0x82f6('0x4f')]=_0x293002;break;case _0x82f6('0x50'):if(_0x458041[_0x82f6('0x51')]===_0x82f6('0x47')){_0x1c6ce4[_0x82f6('0x52')][_0x4390a9](_0x82f6('0x53'),'%'+_0x458041['value']+'%',null);}else{_0x34665a=_[_0x82f6('0x54')](_0x3238b9,[_0x82f6('0x7'),_0x82f6('0x55')]);_0x458041[_0x82f6('0x6')]=_0x82f6('0x55');_0x4dd445=as[_0x82f6('0x3e')](_0xe5024f,_0x34665a[_0x82f6('0x3f')],_0x458041);_0x1c6ce4[_0x82f6('0x52')][_0x4390a9](_0x4dd445['text'],_0x4dd445[_0x82f6('0x41')][_0x82f6('0x42')],_0x4dd445['value'][_0x82f6('0x43')]);}break;case'body':case _0x82f6('0x56'):_0x4dd445=as['buildExpression']('me',null,_0x458041);_0x1c6ce4[_0x82f6('0x57')][_0x4390a9](_0x4dd445[_0x82f6('0x40')],_0x4dd445[_0x82f6('0x41')][_0x82f6('0x42')],_0x4dd445[_0x82f6('0x41')][_0x82f6('0x43')]);break;}}}return _0x1c6ce4;}function parseModelFields(_0x53f7d4,_0x3cb1f0,_0xdc77ca){var _0x4dabbc=utils['getAccountFK'](_0x53f7d4);var _0x3868cc=squel[_0x82f6('0x24')]();var _0x2c2b64=_(_0x3cb1f0)['keys']()[_0x82f6('0x15')](function(_0x7614da){return _[_0x82f6('0x58')](_0xdc77ca,[_0x82f6('0x7'),_0x7614da])?_0x7614da:undefined;})['compact']()['value']();if(_0x2c2b64[_0x82f6('0x3d')]>0x0){_0x2c2b64[_0x82f6('0x25')](function(_0x12430b){if(_0x12430b===_0x4dabbc){_0x3868cc['and']('i.'+_0x4dabbc+_0x82f6('0x14'),[][_0x82f6('0x59')](_0x3cb1f0[_0x12430b]));}else if(_0x12430b==='createdAt'){var _0x4f0ef7=JSON['parse'](_0x3cb1f0[_0x12430b])[_0x82f6('0x5a')];var _0x4a63a6=JSON[_0x82f6('0x5b')](_0x3cb1f0[_0x12430b])['$lte'];_0x3868cc[_0x82f6('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f0ef7,_0x4a63a6);}else{if(_0x3cb1f0[_0x12430b]===_0x82f6('0x5c')){_0x3868cc['and']('i.'+_0x12430b+_0x82f6('0x5d'));}else{_0x3868cc[_0x82f6('0x45')]('i.'+_0x12430b+_0x82f6('0x5e'),_0x3cb1f0[_0x12430b]);}}});}return _0x3868cc;}function parseQueryParameters(_0x1633cf,_0xb8d7d8,_0x45f2f9){var _0x597844=getSqlClauses();return Promise[_0x82f6('0x5f')]()[_0x82f6('0x60')](function(){return parseModelFields(_0x1633cf,_0xb8d7d8,_0x45f2f9);})[_0x82f6('0x60')](function(_0x5bd7c4){_0x597844['fields'][_0x82f6('0x45')](_0x5bd7c4);return parseReadParameter(_0xb8d7d8[_0x82f6('0x61')]);})[_0x82f6('0x60')](function(_0x6932b1){_0x597844['read'][_0x82f6('0x45')](_0x6932b1);return parseTagParameter(_0xb8d7d8[_0x82f6('0x62')]);})[_0x82f6('0x60')](function(_0x5d1a00){_0x597844['tags']['clause'][_0x82f6('0x45')](_0x5d1a00);return parseSearchFilter(_0x1633cf,_0xb8d7d8[_0x82f6('0x63')]);})[_0x82f6('0x60')](function(_0x59176d){_0x597844[_0x82f6('0x63')]=_0x59176d;return _0x597844;});}function checkAccountsRestrictions(_0x26c1d8,_0x3e7d9b,_0x2c07ad){var _0x51791c=utils[_0x82f6('0x17')](_0x26c1d8);var _0x94aed4=_0x82f6('0x64')+_[_0x82f6('0x65')](_0x26c1d8)+(_0x26c1d8==='chat'?'Websites':_0x82f6('0x66'));var _0x630e5c=squel['expr']();return Promise[_0x82f6('0x5f')]()[_0x82f6('0x60')](function(){if(_0x2c07ad[_0x82f6('0x67')]&&_0x3e7d9b['role']===_0x82f6('0x5')){return _0x3e7d9b[_0x94aed4]({'attributes':['id'],'raw':!![]});}})[_0x82f6('0x60')](function(_0x219fe2){if(_0x219fe2){if(_0x219fe2[_0x82f6('0x3d')]===0x0){_0x630e5c[_0x82f6('0x45')]('i.'+_0x51791c+_0x82f6('0x5d'));}else{_0x630e5c['and']('i.'+_0x51791c+_0x82f6('0x14'),_[_0x82f6('0x15')](_0x219fe2,'id'));}}else if(!_0x2c07ad[_0x51791c]){_0x630e5c[_0x82f6('0x45')]('i.'+_0x51791c+_0x82f6('0x68'));}})[_0x82f6('0x60')](function(){return _0x630e5c;});}function getClosedOrderClause(_0x4e3b7b,_0x28ad92){var _0x3cc579='';var _0x182ad8=[_0x82f6('0x69'),_0x82f6('0x6a'),_0x82f6('0x6b')];if(_0x4e3b7b===_0x82f6('0x32')){_0x182ad8[_0x82f6('0x6c')]('i.substatus');}if(_0x28ad92[_0x82f6('0x6d')]==='0'&&_0x4e3b7b==='mail'){_0x3cc579=_0x82f6('0x6e');}else{if(_0x28ad92[_0x82f6('0x6d')]==='1'){_0x182ad8['shift']();}_0x3cc579=_0x82f6('0x6f')+_0x182ad8[_0x82f6('0x70')](',\x20')+')';}return _0x3cc579;}function getFilteredInteractions(_0x2296bb,_0x5705f2,_0x5c96e8,_0x140dcd){var _0x31f3cc=utils['getInteractionFK'](_0x2296bb);var _0x4fdbdf=_[_0x82f6('0x65')](_0x2296bb)+_0x82f6('0x71');var _0x1c37d2=[];var _0x3b3712=getTagsQuery();var _0x4589e1={'type':db[_0x82f6('0x72')][_0x82f6('0x73')][_0x82f6('0x74')],'raw':!![]};var _0x2d0d7c=[];var _0x353508=[];return db[_0x82f6('0x75')][_0x82f6('0x76')](_0x3b3712['toString'](),_0x4589e1)[_0x82f6('0x60')](function(_0x16776e){_0x1c37d2=_[_0x82f6('0x77')](_0x16776e,'id');_0x4589e1=_[_0x82f6('0x78')](_0x4589e1,{'model':db[_0x4fdbdf],'mapToModel':!![],'nest':!![]});if(_0x5c96e8[_0x82f6('0x79')]){_0x140dcd['attributes'][_0x82f6('0x25')](function(_0x46d5af){_0x5705f2[_0x82f6('0x6')]('i.'+_0x46d5af);});}else{_0x5705f2['field'](_0x82f6('0x7a'),_0x82f6('0x44'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x7b'),_0x82f6('0x7c'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x7d'),'Account.mandatoryDisposition');if(_0x2296bb===_0x82f6('0x32')){_0x5705f2['field'](_0x82f6('0x7e'),_0x82f6('0x7f'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x80'),_0x82f6('0x81'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x82'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x83'));_0x5705f2['field'](_0x82f6('0x84'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x85'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x86'));_0x5705f2[_0x82f6('0x6')]('i.attach');_0x5705f2[_0x82f6('0x6')](_0x82f6('0x87'));_0x5705f2['field']('i.lastMsgDirection');_0x5705f2[_0x82f6('0x6')](_0x82f6('0x88'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x6b'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x6a'));_0x5705f2['field'](_0x82f6('0x69'));_0x5705f2['field'](_0x82f6('0x6e'));_0x5705f2['field'](_0x82f6('0x89'));_0x5705f2['field'](_0x82f6('0x8a'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x8b'));_0x5705f2['field'](_0x82f6('0x8c'));}else if(_0x2296bb==='openchannel'){_0x5705f2[_0x82f6('0x6')](_0x82f6('0x8d'),_0x82f6('0x81'));}else{_0x5705f2['field'](_0x82f6('0x8e'),_0x82f6('0x81'));}if(_0x2296bb!==_0x82f6('0x32')){_0x5705f2['field']('i.*');}_0x5705f2[_0x82f6('0x6')](_0x82f6('0x8f'),_0x82f6('0x90'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x91'),_0x82f6('0x92'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x93'),'Contact.email');_0x5705f2[_0x82f6('0x6')](_0x82f6('0x94'),'Contact.phone');_0x5705f2[_0x82f6('0x6')](_0x82f6('0x95'),_0x82f6('0x96'));_0x5705f2['field'](_0x82f6('0x97'),_0x82f6('0x98'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x99'),'Owner.fullname');_0x5705f2[_0x82f6('0x6')](_0x82f6('0x9a'),_0x82f6('0x9b'));_0x5705f2[_0x82f6('0x6')](_0x82f6('0x9c'),_0x82f6('0x9d'));}if(_0x140dcd['limit']){_0x5705f2[_0x82f6('0x9e')](_0x140dcd[_0x82f6('0x9e')]);}if(_0x140dcd[_0x82f6('0x9f')]){_0x5705f2[_0x82f6('0x9f')](_0x140dcd[_0x82f6('0x9f')]);}return db['sequelize'][_0x82f6('0x76')](_0x5705f2['toString'](),_0x4589e1);})[_0x82f6('0x60')](function(_0x1d545a){_0x2d0d7c=_0x1d545a;var _0x425e33=getUsersQuery(_0x2296bb,_0x2d0d7c);return db[_0x82f6('0x75')][_0x82f6('0x76')](_0x425e33[_0x82f6('0xa0')](),_0x4589e1);})[_0x82f6('0x60')](function(_0x4d7198){_0x353508=_[_0x82f6('0xa1')](_0x4d7198,_0x31f3cc);if(_0x2296bb===_0x82f6('0x32')){return db['Setting'][_0x82f6('0xa2')]({'attributes':[_0x82f6('0xa3')],'raw':!![]});}})[_0x82f6('0x60')](function(_0x5c65c7){var _0x4006d1=_0x5c65c7?_0x5c65c7['enableEmailPreview']:undefined;var _0x191d30=_0x2d0d7c[_0x82f6('0x15')](function(_0x57387c){return updateInteraction(_0x57387c,_0x1c37d2,_0x353508,_0x4006d1);});return Promise[_0x82f6('0xa4')](_0x191d30);});}function countFilteredInteractions(_0x195141,_0x43d544){var _0x7998e1=_0x195141['clone']();_0x7998e1[_0x82f6('0x6')]('COUNT(*)');_0x7998e1['field'](_0x82f6('0x7a'),_0x82f6('0x44'));var _0x426c85=utils[_0x82f6('0xa5')](_0x43d544);if(!_[_0x82f6('0xa6')](_0x426c85)){_0x7998e1['where']('t.id\x20IN\x20?',_0x426c85);}var _0x470b2c={'type':db['Sequelize'][_0x82f6('0x73')][_0x82f6('0x74')],'raw':!![]};return db[_0x82f6('0x75')]['query'](_0x7998e1[_0x82f6('0xa0')](),_0x470b2c);}module[_0x82f6('0xa7')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x24cd=['\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','whatsapp','includes','i.phone\x20LIKE\x20?','fax','openchannel','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.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','conditions','find','name','buildExpression','default','text','start','value','end','read','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','Tag','tags','clause','User','user','UserId','body','keys','some','compact','forEach','concat','$gte','parse','$lte','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','Sequelize','QueryTypes','SELECT','sequelize','toString','keyBy','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','map','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.'];(function(_0x54ba26,_0x301c1f){var _0x36ce4e=function(_0x227ccb){while(--_0x227ccb){_0x54ba26['push'](_0x54ba26['shift']());}};_0x36ce4e(++_0x301c1f);}(_0x24cd,0x83));var _0xd24c=function(_0x359520,_0x48ebad){_0x359520=_0x359520-0x0;var _0x4651dd=_0x24cd[_0x359520];return _0x4651dd;};'use strict';var _=require(_0xd24c('0x0'));var squel=require(_0xd24c('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xd24c('0x2'));var updateInteraction=require('./update-interaction')[_0xd24c('0x3')];var utils=require(_0xd24c('0x4'));var db=require(_0xd24c('0x5'))['db'];function skipInteractionsQuery(_0x4d515c,_0x21a58c,_0x32001a){var _0x47c9ea=![];var _0x1c30fc=utils[_0xd24c('0x6')](_0x4d515c);if(_0x21a58c[_0xd24c('0x7')]===_0xd24c('0x8')&&!_0x32001a[_0xd24c('0x9')]&&!_0x32001a[_0x1c30fc]){_0x47c9ea=!![];}return _0x47c9ea;}function getTagsQuery(){return squel[_0xd24c('0xa')]()[_0xd24c('0xb')]('id')[_0xd24c('0xb')]('name')['field'](_0xd24c('0xc'))[_0xd24c('0xd')](_0xd24c('0xe'));}function getUsersQuery(_0x43ab46,_0x225c20){var _0x1aa701=utils[_0xd24c('0xf')](_0x43ab46);var _0x453907='user_has_'+_0x43ab46+_0xd24c('0x10');var _0x5a7556=squel['select']()[_0xd24c('0xb')](_0xd24c('0x11'))[_0xd24c('0xb')](_0xd24c('0x12'))[_0xd24c('0xb')](_0xd24c('0x13')+_0x1aa701)[_0xd24c('0xd')](_0x453907,'ui')[_0xd24c('0x14')]('users','u',_0xd24c('0x15'));if(_0x225c20[_0xd24c('0x16')]>0x0){_0x5a7556['where'](_0xd24c('0x13')+_0x1aa701+_0xd24c('0x17'),_[_0xd24c('0x18')](_0x225c20,'id'));}return _0x5a7556;}function getInteractionsQuery(_0x3221a8){var _0x509992=utils['getInteractionsTables'](_0x3221a8);var _0xc87bb7=utils[_0xd24c('0x6')](_0x3221a8);var _0x170d59=utils['getInteractionFK'](_0x3221a8);return squel[_0xd24c('0xa')]()[_0xd24c('0xd')](_0x509992[_0xd24c('0x19')],'i')[_0xd24c('0x14')]('cm_contacts','c',_0xd24c('0x1a'))['left_join'](_0xd24c('0x1b'),'o',_0xd24c('0x1c'))[_0xd24c('0x14')](_0x509992[_0xd24c('0x1d')],'a',_0xd24c('0x1e')+_0xc87bb7)[_0xd24c('0x14')](_0x509992[_0xd24c('0x1f')],'me',_0xd24c('0x20')+_0x170d59+_0xd24c('0x21'))[_0xd24c('0x14')](_0x509992['interactionsTags'],'it',_0xd24c('0x22')+_0x170d59+_0xd24c('0x21'))[_0xd24c('0x14')]('tools_tags','t',_0xd24c('0x23'));}function getSqlClauses(){var _0x2c3328={'body':squel[_0xd24c('0x24')](),'contact':squel['expr'](),'default':squel[_0xd24c('0x24')](),'fields':squel[_0xd24c('0x24')](),'filter':squel[_0xd24c('0x24')](),'read':squel[_0xd24c('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x2c3328;}function parseTagParameter(_0x32d310){var _0x4d56f4=squel[_0xd24c('0x24')]();if(_0x32d310){var _0xaf8b16=utils[_0xd24c('0x25')](_0x32d310);_0xaf8b16['forEach'](function(_0x4cb1b3){_0x4d56f4['or'](_0xd24c('0x26'),'%,'+_0x4cb1b3+',%');});}return _0x4d56f4;}function parseReadParameter(_0x14d44a){var _0x1a18b7='';if(_0x14d44a){_0x1a18b7=_0xd24c('0x27');if(_0x14d44a==='1'){_0x1a18b7=_0x1a18b7[_0xd24c('0x28')](_0xd24c('0x29'),'=');}else{_0x1a18b7=_0x1a18b7[_0xd24c('0x28')](_0xd24c('0x29'),'>');}}return _0x1a18b7;}function parseSearchFilter(_0x1c48d6,_0x3b14c7){var _0x2586d7=squel['expr']();if(_0x3b14c7){var _0x4e128b=_0x3b14c7[_0xd24c('0x28')]('\x5c','\x5c\x5c')[_0xd24c('0x28')](/'/g,'\x27\x27');if(qs[_0xd24c('0x2a')](_0x4e128b)){_0x2586d7['or']('i.id\x20LIKE\x20?',_0x4e128b+'%');if(['sms',_0xd24c('0x2b')][_0xd24c('0x2c')](_0x1c48d6)){_0x2586d7['or'](_0xd24c('0x2d'),_0x4e128b+'%');}else if(_0x1c48d6===_0xd24c('0x2e')){_0x2586d7['or']('i.fax\x20LIKE\x20?',_0x4e128b+'%');}else if(_0x1c48d6===_0xd24c('0x2f')){_0x2586d7['or'](_0xd24c('0x30'),_0x4e128b+'%');}}else if(_0x1c48d6===_0xd24c('0x31')&&qs[_0xd24c('0x32')](_0x4e128b)){_0x2586d7['or'](_0xd24c('0x33'),_0x4e128b+'%');}else{if(_0x1c48d6===_0xd24c('0x31')){_0x2586d7['or'](_0xd24c('0x34'),qs[_0xd24c('0x35')](_0x4e128b))['or'](_0xd24c('0x36'),qs['getFullTextValue'](_0x4e128b));}else{if(_0x1c48d6!==_0xd24c('0x2e')){_0x2586d7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4e128b));}_0x2586d7['or'](_0xd24c('0x37'),_0x4e128b+'%');}}}return _0x2586d7;}function parseAdvancedSearchFilter(_0x44fab7,_0x24f1a9){var _0x1113a6=getSqlClauses();var _0x7d11e5=as[_0xd24c('0x38')](_0x44fab7);var _0x4526e3=_0x7d11e5['sqlOperator'];for(var _0x3a0043=0x0;_0x3a0043<_0x7d11e5[_0xd24c('0x39')][_0xd24c('0x16')];_0x3a0043++){var _0x241102=_0x7d11e5[_0xd24c('0x39')][_0x3a0043];var _0x356557='i';var _0x54cce4=_[_0xd24c('0x3a')](_0x24f1a9,[_0xd24c('0x3b'),_0x241102['field']]);if(_0x54cce4){var _0x100553=as[_0xd24c('0x3c')](_0x356557,_0x54cce4['type'],_0x241102);_0x1113a6[_0xd24c('0x3d')][_0x4526e3](_0x100553[_0xd24c('0x3e')],_0x100553['value'][_0xd24c('0x3f')],_0x100553[_0xd24c('0x40')][_0xd24c('0x41')]);}else{switch(_0x241102[_0xd24c('0xb')]){case'unreadMessages':var _0x11ab7b=parseReadParameter(_0x241102['value']);_0x1113a6[_0xd24c('0x42')]['and'](_0x11ab7b);break;case'Contact':if(_0x241102['operator']===_0xd24c('0x43')){if(_0x241102['value']['split']('\x20')[_0xd24c('0x16')]>0x1){_0x1113a6[_0xd24c('0x44')][_0x4526e3](_0xd24c('0x45'),qs[_0xd24c('0x35')](_0x241102['value']),null);}else{var _0xe5fe3a='%'+_0x241102['value']+'%';_0x1113a6[_0xd24c('0x44')][_0x4526e3](_0xd24c('0x46'),_0xe5fe3a,_0xe5fe3a,_0xe5fe3a);}}else{_0x54cce4=_[_0xd24c('0x3a')](_0x24f1a9,[_0xd24c('0x3b'),_0xd24c('0x47')]);_0x241102[_0xd24c('0xb')]=_0xd24c('0x47');_0x100553=as[_0xd24c('0x3c')](_0x356557,_0x54cce4[_0xd24c('0x48')],_0x241102);_0x1113a6[_0xd24c('0x44')][_0x4526e3](_0x100553['text'],_0x100553[_0xd24c('0x40')][_0xd24c('0x3f')],_0x100553['value'][_0xd24c('0x41')]);}break;case _0xd24c('0x49'):var _0x49053b=_0x241102[_0xd24c('0x40')]['split'](',')[_0xd24c('0x18')](function(_0x2d46b8){return Number(_0x2d46b8);});var _0x969fa0=parseTagParameter(_0x49053b);_0x1113a6[_0xd24c('0x4a')][_0xd24c('0x4b')]['and'](_0x969fa0);_0x1113a6[_0xd24c('0x4a')]['ids']=_0x49053b;break;case _0xd24c('0x4c'):if(_0x241102['operator']===_0xd24c('0x43')){_0x1113a6[_0xd24c('0x4d')][_0x4526e3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x241102[_0xd24c('0x40')]+'%',null);}else{_0x54cce4=_[_0xd24c('0x3a')](_0x24f1a9,['name',_0xd24c('0x4e')]);_0x241102['field']='UserId';_0x100553=as['buildExpression'](_0x356557,_0x54cce4[_0xd24c('0x48')],_0x241102);_0x1113a6[_0xd24c('0x4d')][_0x4526e3](_0x100553['text'],_0x100553['value'][_0xd24c('0x3f')],_0x100553[_0xd24c('0x40')][_0xd24c('0x41')]);}break;case _0xd24c('0x4f'):case'plainBody':_0x100553=as[_0xd24c('0x3c')]('me',null,_0x241102);_0x1113a6[_0xd24c('0x4f')][_0x4526e3](_0x100553['text'],_0x100553[_0xd24c('0x40')][_0xd24c('0x3f')],_0x100553[_0xd24c('0x40')]['end']);break;}}}return _0x1113a6;}function parseModelFields(_0x3039aa,_0x4b10c6,_0x26c1d0){var _0x33cb6f=utils[_0xd24c('0x6')](_0x3039aa);var _0x1c594d=squel['expr']();var _0x14684c=_(_0x4b10c6)[_0xd24c('0x50')]()[_0xd24c('0x18')](function(_0x1a4549){return _[_0xd24c('0x51')](_0x26c1d0,[_0xd24c('0x3b'),_0x1a4549])?_0x1a4549:undefined;})[_0xd24c('0x52')]()[_0xd24c('0x40')]();if(_0x14684c[_0xd24c('0x16')]>0x0){_0x14684c[_0xd24c('0x53')](function(_0x131e14){if(_0x131e14===_0x33cb6f){_0x1c594d['and']('i.'+_0x33cb6f+_0xd24c('0x17'),[][_0xd24c('0x54')](_0x4b10c6[_0x131e14]));}else if(_0x131e14==='createdAt'){var _0x5bb14f=JSON['parse'](_0x4b10c6[_0x131e14])[_0xd24c('0x55')];var _0x4273d2=JSON[_0xd24c('0x56')](_0x4b10c6[_0x131e14])[_0xd24c('0x57')];_0x1c594d[_0xd24c('0x58')](_0xd24c('0x59'),_0x5bb14f,_0x4273d2);}else{if(_0x4b10c6[_0x131e14]===_0xd24c('0x5a')){_0x1c594d[_0xd24c('0x58')]('i.'+_0x131e14+_0xd24c('0x5b'));}else{_0x1c594d[_0xd24c('0x58')]('i.'+_0x131e14+_0xd24c('0x5c'),_0x4b10c6[_0x131e14]);}}});}return _0x1c594d;}function parseQueryParameters(_0x4fbb0b,_0x3a8e76,_0x3ac5ca){var _0x49eee7=getSqlClauses();return Promise[_0xd24c('0x5d')]()[_0xd24c('0x5e')](function(){return parseModelFields(_0x4fbb0b,_0x3a8e76,_0x3ac5ca);})[_0xd24c('0x5e')](function(_0x5d525d){_0x49eee7['fields'][_0xd24c('0x58')](_0x5d525d);return parseReadParameter(_0x3a8e76[_0xd24c('0x42')]);})[_0xd24c('0x5e')](function(_0x1be98f){_0x49eee7[_0xd24c('0x42')][_0xd24c('0x58')](_0x1be98f);return parseTagParameter(_0x3a8e76[_0xd24c('0x5f')]);})[_0xd24c('0x5e')](function(_0x5ba7ab){_0x49eee7[_0xd24c('0x4a')]['clause']['and'](_0x5ba7ab);return parseSearchFilter(_0x4fbb0b,_0x3a8e76[_0xd24c('0x60')]);})['then'](function(_0x4f6b11){_0x49eee7[_0xd24c('0x60')]=_0x4f6b11;return _0x49eee7;});}function checkAccountsRestrictions(_0x1b649e,_0x1b1b0e,_0x7e4f1){var _0x4890d6=utils[_0xd24c('0x6')](_0x1b649e);var _0x1e99e7=_0xd24c('0x61')+_[_0xd24c('0x62')](_0x1b649e)+(_0x1b649e===_0xd24c('0x63')?_0xd24c('0x64'):_0xd24c('0x65'));var _0x5f17e3=squel['expr']();return Promise['resolve']()[_0xd24c('0x5e')](function(){if(_0x7e4f1[_0xd24c('0x9')]&&_0x1b1b0e[_0xd24c('0x7')]===_0xd24c('0x8')){return _0x1b1b0e[_0x1e99e7]({'attributes':['id'],'raw':!![]});}})[_0xd24c('0x5e')](function(_0x39f5eb){if(_0x39f5eb){if(_0x39f5eb['length']===0x0){_0x5f17e3[_0xd24c('0x58')]('i.'+_0x4890d6+_0xd24c('0x5b'));}else{_0x5f17e3['and']('i.'+_0x4890d6+_0xd24c('0x17'),_[_0xd24c('0x18')](_0x39f5eb,'id'));}}else if(!_0x7e4f1[_0x4890d6]){_0x5f17e3[_0xd24c('0x58')]('i.'+_0x4890d6+_0xd24c('0x66'));}})[_0xd24c('0x5e')](function(){return _0x5f17e3;});}function getClosedOrderClause(_0x50ef46,_0x59bfe0){var _0x2a6d13='';var _0x22c469=['i.thirdDisposition',_0xd24c('0x67'),_0xd24c('0x68')];if(_0x50ef46==='mail'){_0x22c469[_0xd24c('0x69')](_0xd24c('0x6a'));}if(_0x59bfe0[_0xd24c('0x6b')]==='0'&&_0x50ef46===_0xd24c('0x31')){_0x2a6d13=_0xd24c('0x6a');}else{if(_0x59bfe0[_0xd24c('0x6b')]==='1'){_0x22c469[_0xd24c('0x6c')]();}_0x2a6d13='CONCAT_WS(\x27\x27,\x20'+_0x22c469['join'](',\x20')+')';}return _0x2a6d13;}function getFilteredInteractions(_0x5a45db,_0x1f0b87,_0x492f5c,_0x5293b4){var _0x55fb1d=utils[_0xd24c('0xf')](_0x5a45db);var _0x29ace6=_[_0xd24c('0x62')](_0x5a45db)+'Interaction';var _0x312c4c=[];var _0xef4950=getTagsQuery();var _0x424680={'type':db[_0xd24c('0x6d')][_0xd24c('0x6e')][_0xd24c('0x6f')],'raw':!![]};var _0x52567d=[];var _0x8a7fa8=[];return db[_0xd24c('0x70')]['query'](_0xef4950[_0xd24c('0x71')](),_0x424680)[_0xd24c('0x5e')](function(_0x30ca13){_0x312c4c=_[_0xd24c('0x72')](_0x30ca13,'id');_0x424680=_[_0xd24c('0x73')](_0x424680,{'model':db[_0x29ace6],'mapToModel':!![],'nest':!![]});if(_0x492f5c[_0xd24c('0x74')]){_0x5293b4[_0xd24c('0x75')][_0xd24c('0x53')](function(_0x4628aa){_0x1f0b87[_0xd24c('0xb')]('i.'+_0x4628aa);});}else{_0x1f0b87['field'](_0xd24c('0x76'),_0xd24c('0x77'));_0x1f0b87['field']('a.key',_0xd24c('0x78'));_0x1f0b87['field'](_0xd24c('0x79'),_0xd24c('0x7a'));if(_0x5a45db===_0xd24c('0x31')){_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x7b'),_0xd24c('0x7c'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x7d'),_0xd24c('0x7e'));_0x1f0b87[_0xd24c('0xb')]('i.id');_0x1f0b87[_0xd24c('0xb')]('i.createdAt');_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x7f'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x80'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x81'));_0x1f0b87[_0xd24c('0xb')]('i.attach');_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x82'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x83'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x84'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x68'));_0x1f0b87[_0xd24c('0xb')]('i.secondDisposition');_0x1f0b87[_0xd24c('0xb')]('i.thirdDisposition');_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x6a'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x85'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x86'));_0x1f0b87[_0xd24c('0xb')]('i.MailAccountId');_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x87'));}else if(_0x5a45db===_0xd24c('0x2f')){_0x1f0b87['field'](_0xd24c('0x88'),_0xd24c('0x7e'));}else{_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x89'),_0xd24c('0x7e'));}if(_0x5a45db!==_0xd24c('0x31')){_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x8a'));}_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x8b'),_0xd24c('0x8c'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x8d'),_0xd24c('0x8e'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x8f'),_0xd24c('0x90'));_0x1f0b87[_0xd24c('0xb')]('c.phone','Contact.phone');_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x91'),_0xd24c('0x92'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x93'),_0xd24c('0x94'));_0x1f0b87[_0xd24c('0xb')](_0xd24c('0x95'),'Owner.fullname');_0x1f0b87[_0xd24c('0xb')]('o.internal','Owner.internal');_0x1f0b87['field'](_0xd24c('0x96'),_0xd24c('0x97'));}if(_0x5293b4['limit']){_0x1f0b87['limit'](_0x5293b4[_0xd24c('0x98')]);}if(_0x5293b4[_0xd24c('0x99')]){_0x1f0b87[_0xd24c('0x99')](_0x5293b4[_0xd24c('0x99')]);}return db['sequelize']['query'](_0x1f0b87[_0xd24c('0x71')](),_0x424680);})['then'](function(_0x3a00a0){_0x52567d=_0x3a00a0;var _0x2cdc42=getUsersQuery(_0x5a45db,_0x52567d);return db[_0xd24c('0x70')][_0xd24c('0x9a')](_0x2cdc42[_0xd24c('0x71')](),_0x424680);})[_0xd24c('0x5e')](function(_0xdee697){_0x8a7fa8=_['groupBy'](_0xdee697,_0x55fb1d);if(_0x5a45db==='mail'){return db['Setting'][_0xd24c('0x9b')]({'attributes':[_0xd24c('0x9c')],'raw':!![]});}})[_0xd24c('0x5e')](function(_0x18cf30){var _0x320a2b=_0x18cf30?_0x18cf30[_0xd24c('0x9c')]:undefined;var _0x4843ed=_0x52567d[_0xd24c('0x18')](function(_0x1d75a9){return updateInteraction(_0x1d75a9,_0x312c4c,_0x8a7fa8,_0x320a2b);});return Promise[_0xd24c('0x9d')](_0x4843ed);});}function countFilteredInteractions(_0x3eae0c,_0x37329f){var _0x39c952=_0x3eae0c[_0xd24c('0x9e')]();_0x39c952[_0xd24c('0xb')](_0xd24c('0x9f'));_0x39c952[_0xd24c('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd24c('0x77'));var _0x496929=utils[_0xd24c('0x25')](_0x37329f);if(!_[_0xd24c('0xa0')](_0x496929)){_0x39c952[_0xd24c('0xa1')](_0xd24c('0xa2'),_0x496929);}var _0x52e4a9={'type':db[_0xd24c('0x6d')]['QueryTypes'][_0xd24c('0x6f')],'raw':!![]};return db[_0xd24c('0x70')][_0xd24c('0x9a')](_0x39c952[_0xd24c('0x71')](),_0x52e4a9);}module[_0xd24c('0xa3')]={'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 0fa0c5c..d72acc4 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 _0x4a6d=['fullname','forEach','waiting','talking','answered','unmanaged','abandoned','total','disposition','UserId','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','Users','TagIds','Tags','lodash','map'];(function(_0x194907,_0x12176b){var _0x20995b=function(_0x72a72c){while(--_0x72a72c){_0x194907['push'](_0x194907['shift']());}};_0x20995b(++_0x12176b);}(_0x4a6d,0x1b3));var _0xd4a6=function(_0x5ef8c7,_0x3e0456){_0x5ef8c7=_0x5ef8c7-0x0;var _0x495979=_0x4a6d[_0x5ef8c7];return _0x495979;};'use strict';var _=require(_0xd4a6('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x5e6f1c,_0x450dd2){return new Promise(function(_0x3d912d,_0x2dfda3){try{var _0x585440=[];if(_0x450dd2[_0x5e6f1c]){_0x585440=_0x450dd2[_0x5e6f1c][_0xd4a6('0x1')](function(_0x261ac6){return{'id':_0x261ac6['id'],'fullname':_0x261ac6[_0xd4a6('0x2')]};});}return _0x3d912d(_0x585440);}catch(_0x2fa964){_0x2dfda3(_0x2fa964);}});}function getInteractionTags(_0x54dc20,_0xd274e2){var _0x4a56fb=[];if(_0x54dc20){_0x54dc20['split'](',')[_0xd4a6('0x3')](function(_0x1df5a8){_0x4a56fb['push'](_0xd274e2[_0x1df5a8]);});}return _0x4a56fb;}function updateWaitingCounter(_0x20ce68){if(_0x20ce68[_0xd4a6('0x4')]){_0x20ce68[_0xd4a6('0x4')]-=0x1;}}function updateInteractionCounters(_0x27be2a){_0x27be2a[_0xd4a6('0x4')]=0x0;_0x27be2a[_0xd4a6('0x5')]=0x0;_0x27be2a[_0xd4a6('0x6')]=0x0;_0x27be2a[_0xd4a6('0x7')]=0x0;_0x27be2a[_0xd4a6('0x8')]=0x0;_0x27be2a[_0xd4a6('0x9')]=0x0;if(_0x27be2a['closed']){if(_0x27be2a[_0xd4a6('0xa')]===_0xd4a6('0x8')){_0x27be2a[_0xd4a6('0x8')]+=0x1;updateWaitingCounter(_0x27be2a);}if(_0x27be2a[_0xd4a6('0xb')]){_0x27be2a[_0xd4a6('0x6')]+=0x1;if(_0x27be2a[_0xd4a6('0x5')]){_0x27be2a[_0xd4a6('0x5')]-=0x1;}}else{if(_0x27be2a['disposition']){_0x27be2a[_0xd4a6('0x7')]+=0x1;updateWaitingCounter(_0x27be2a);}}}else{if(!_0x27be2a[_0xd4a6('0xb')]){_0x27be2a['waiting']+=0x1;}if(_0x27be2a[_0xd4a6('0xb')]){_0x27be2a[_0xd4a6('0x5')]+=0x1;updateWaitingCounter(_0x27be2a);}}_0x27be2a['total']+=0x1;return _0x27be2a;}function getLastMessageText(_0x3d26a8){return db['MailMessage'][_0xd4a6('0xc')]({'where':{'$and':[{'MailInteractionId':_0x3d26a8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd4a6('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd4a6('0xe')],'order':_0xd4a6('0xf'),'raw':!![]})[_0xd4a6('0x10')](function(_0x1c08ea){if(_0x1c08ea&&_0x1c08ea[_0xd4a6('0xe')]){_0x3d26a8[_0xd4a6('0x11')]=_[_0xd4a6('0x12')](_0x1c08ea['plainBody']);}return _0x3d26a8;})[_0xd4a6('0x13')](function(_0x42758f){throw _0x42758f;});}exports['updateInteraction']=function(_0x6bd8da,_0x41145b,_0x27d5b5,_0x249c58){return new Promise(function(_0x2cb8d4,_0x49623a){return getInteractionUsers(_0x6bd8da['id'],_0x27d5b5)[_0xd4a6('0x10')](function(_0x441a29){_0x6bd8da[_0xd4a6('0x14')]=_0x441a29;return getInteractionTags(_0x6bd8da[_0xd4a6('0x15')],_0x41145b);})['then'](function(_0x1634e6){_0x6bd8da[_0xd4a6('0x16')]=_0x1634e6;delete _0x6bd8da[_0xd4a6('0x15')];return updateInteractionCounters(_0x6bd8da);})['then'](function(_0x4e11d7){if(_0x249c58){return getLastMessageText(_0x4e11d7);}else{return _0x4e11d7;}})[_0xd4a6('0x10')](function(_0x5005ae){_0x2cb8d4(_0x5005ae);})[_0xd4a6('0x13')](function(_0x2bd664){_0x49623a(_0x2bd664);});});}; \ No newline at end of file +var _0x0de0=['TagIds','Tags','lodash','../../mysqldb','map','split','forEach','push','waiting','talking','unmanaged','abandoned','total','closed','answered','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x0de0,0xe2));var _0x00de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0de0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x00de('0x0'));var db=require(_0x00de('0x1'))['db'];function getInteractionUsers(_0x2302da,_0x552a9e){return new Promise(function(_0x4112ad,_0x1c70f3){try{var _0x16bbdc=[];if(_0x552a9e[_0x2302da]){_0x16bbdc=_0x552a9e[_0x2302da][_0x00de('0x2')](function(_0x3812ce){return{'id':_0x3812ce['id'],'fullname':_0x3812ce['fullname']};});}return _0x4112ad(_0x16bbdc);}catch(_0x4c483d){_0x1c70f3(_0x4c483d);}});}function getInteractionTags(_0xc3b306,_0x18a9ff){var _0x3d1c2d=[];if(_0xc3b306){_0xc3b306[_0x00de('0x3')](',')[_0x00de('0x4')](function(_0x29d441){_0x3d1c2d[_0x00de('0x5')](_0x18a9ff[_0x29d441]);});}return _0x3d1c2d;}function updateWaitingCounter(_0x41ef14){if(_0x41ef14[_0x00de('0x6')]){_0x41ef14[_0x00de('0x6')]-=0x1;}}function updateInteractionCounters(_0x2085d6){_0x2085d6[_0x00de('0x6')]=0x0;_0x2085d6[_0x00de('0x7')]=0x0;_0x2085d6['answered']=0x0;_0x2085d6[_0x00de('0x8')]=0x0;_0x2085d6[_0x00de('0x9')]=0x0;_0x2085d6[_0x00de('0xa')]=0x0;if(_0x2085d6[_0x00de('0xb')]){if(_0x2085d6['disposition']===_0x00de('0x9')){_0x2085d6[_0x00de('0x9')]+=0x1;updateWaitingCounter(_0x2085d6);}if(_0x2085d6['UserId']){_0x2085d6[_0x00de('0xc')]+=0x1;if(_0x2085d6[_0x00de('0x7')]){_0x2085d6[_0x00de('0x7')]-=0x1;}}else{if(_0x2085d6[_0x00de('0xd')]){_0x2085d6['unmanaged']+=0x1;updateWaitingCounter(_0x2085d6);}}}else{if(!_0x2085d6[_0x00de('0xe')]){_0x2085d6[_0x00de('0x6')]+=0x1;}if(_0x2085d6[_0x00de('0xe')]){_0x2085d6[_0x00de('0x7')]+=0x1;updateWaitingCounter(_0x2085d6);}}_0x2085d6[_0x00de('0xa')]+=0x1;return _0x2085d6;}function getLastMessageText(_0x909248){return db[_0x00de('0xf')][_0x00de('0x10')]({'where':{'$and':[{'MailInteractionId':_0x909248['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x00de('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x00de('0x12')],'order':_0x00de('0x13'),'raw':!![]})[_0x00de('0x14')](function(_0x57e653){if(_0x57e653&&_0x57e653[_0x00de('0x12')]){_0x909248[_0x00de('0x15')]=_[_0x00de('0x16')](_0x57e653[_0x00de('0x12')]);}return _0x909248;})[_0x00de('0x17')](function(_0x47de75){throw _0x47de75;});}exports[_0x00de('0x18')]=function(_0x557de1,_0x4f901c,_0x135fc9,_0x4f8f01){return new Promise(function(_0x15bdf0,_0x1f6b99){return getInteractionUsers(_0x557de1['id'],_0x135fc9)[_0x00de('0x14')](function(_0x55ee58){_0x557de1[_0x00de('0x19')]=_0x55ee58;return getInteractionTags(_0x557de1[_0x00de('0x1a')],_0x4f901c);})['then'](function(_0x4e3dab){_0x557de1[_0x00de('0x1b')]=_0x4e3dab;delete _0x557de1[_0x00de('0x1a')];return updateInteractionCounters(_0x557de1);})[_0x00de('0x14')](function(_0x5ad76a){if(_0x4f8f01){return getLastMessageText(_0x5ad76a);}else{return _0x5ad76a;}})[_0x00de('0x14')](function(_0x42deaa){_0x15bdf0(_0x42deaa);})['catch'](function(_0x123cd7){_0x1f6b99(_0x123cd7);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index adb1811..2ac559f 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 _0x4395=['sms-interactions','chat','Website','capitalize','InteractionId','upperFirst','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','catch','error','exports','lodash','../../config/logger','mail-interactions','fax-interactions'];(function(_0x294d96,_0x2a7812){var _0x5ceb37=function(_0x420697){while(--_0x420697){_0x294d96['push'](_0x294d96['shift']());}};_0x5ceb37(++_0x2a7812);}(_0x4395,0xaa));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5439('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x5439('0x1'))('openchannel-interactions'),'mail':require(_0x5439('0x1'))(_0x5439('0x2')),'fax':require(_0x5439('0x1'))(_0x5439('0x3')),'sms':require(_0x5439('0x1'))(_0x5439('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x2268eb){return _['capitalize'](_0x2268eb)+(_0x2268eb===_0x5439('0x5')?_0x5439('0x6'):'Account')+'Id';}function getInteractionFK(_0x33ce30){return _[_0x5439('0x7')](_0x33ce30)+_0x5439('0x8');}function getInteractionId(_0x2795a8,_0x12f44a,_0x31c6aa){if(_0x2795a8&&_0x2795a8[_['upperFirst'](_0x31c6aa)+_0x5439('0x8')]){return _0x2795a8[_[_0x5439('0x9')](_0x31c6aa)+_0x5439('0x8')];}else if(_0x2795a8&&_0x2795a8['id']){return _0x2795a8['id'];}else if(_0x12f44a&&_0x12f44a['id']){return _0x12f44a['id'];}else{return'unknown';}}function getInteractionsTables(_0x1e0a15){return{'accounts':_0x1e0a15+'_'+(_0x1e0a15==='chat'?_0x5439('0xa'):_0x5439('0xb')),'interactions':_0x1e0a15+'_interactions','interactionsTags':_0x1e0a15+_0x5439('0xc'),'messages':_0x1e0a15+_0x5439('0xd'),'userInteractions':_0x5439('0xe')+_0x1e0a15+_0x5439('0xf')};}function getSelectedTags(_0x2e6728){var _0x558024=[];if(_0x2e6728){_0x558024=Array['isArray'](_0x2e6728)?_0x2e6728:[_0x2e6728];}return _0x558024;}function log(_0x1ee53f,_0x32dd75,_0x3a8f34,_0x3a16b4,_0x4f3f4a,_0x11d4a1){loggers[_0x4f3f4a['toLowerCase']()][_0x1ee53f](_0x5439('0x10'),_0x11d4a1[_0x5439('0x11')](),_0x32dd75?_0x32dd75['id']:null,_0x32dd75?_0x32dd75[_0x5439('0x12')]:null,_0x32dd75?_0x32dd75[_0x5439('0x13')]:null,getInteractionId(_0x3a8f34,_0x3a16b4,_0x4f3f4a),_0x3a8f34?JSON[_0x5439('0x14')](_0x3a8f34):_0x5439('0x15'));}function updateUser(_0x5d6b3c,_0x2226a3,_0x308a68,_0x45fc21,_0x15c69d){db[_['upperFirst'](_0x45fc21)+_0x5439('0x16')][_0x5439('0x17')]({'where':{'id':getInteractionId(_0x2226a3,_0x308a68,_0x45fc21)}})[_0x5439('0x18')](function(_0x471c27){if(_0x471c27){return _0x471c27['update']({'UserId':_0x5d6b3c?_0x5d6b3c['id']:null});}})['then'](function(_0x5139de){if(_0x5139de){log(_0x5439('0x19'),_0x5d6b3c,_0x2226a3,_0x308a68,_0x45fc21,_0x15c69d);}})[_0x5439('0x1a')](function(){log(_0x5439('0x1b'),_0x5d6b3c,_0x2226a3,_0x308a68,_0x45fc21,_0x15c69d);});}module[_0x5439('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x74f9=['InteractionId','unknown','chat','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','upperFirst'];(function(_0x4b1a71,_0x34910e){var _0x57fa7b=function(_0x377421){while(--_0x377421){_0x4b1a71['push'](_0x4b1a71['shift']());}};_0x57fa7b(++_0x34910e);}(_0x74f9,0x11e));var _0x974f=function(_0x59eeaf,_0x56e107){_0x59eeaf=_0x59eeaf-0x0;var _0x119d61=_0x74f9[_0x59eeaf];return _0x119d61;};'use strict';var _=require(_0x974f('0x0'));var db=require(_0x974f('0x1'))['db'];var loggers={'openchannel':require(_0x974f('0x2'))('openchannel-interactions'),'mail':require(_0x974f('0x2'))(_0x974f('0x3')),'fax':require(_0x974f('0x2'))(_0x974f('0x4')),'sms':require(_0x974f('0x2'))('sms-interactions'),'chat':require(_0x974f('0x2'))(_0x974f('0x5')),'whatsapp':require('../../config/logger')(_0x974f('0x6'))};function getAccountFK(_0x5ee536){return _[_0x974f('0x7')](_0x5ee536)+(_0x5ee536==='chat'?_0x974f('0x8'):_0x974f('0x9'))+'Id';}function getInteractionFK(_0x55f285){return _['capitalize'](_0x55f285)+'InteractionId';}function getInteractionId(_0x4653a7,_0x49096d,_0x4c5fc6){if(_0x4653a7&&_0x4653a7[_[_0x974f('0xa')](_0x4c5fc6)+_0x974f('0xb')]){return _0x4653a7[_[_0x974f('0xa')](_0x4c5fc6)+_0x974f('0xb')];}else if(_0x4653a7&&_0x4653a7['id']){return _0x4653a7['id'];}else if(_0x49096d&&_0x49096d['id']){return _0x49096d['id'];}else{return _0x974f('0xc');}}function getInteractionsTables(_0x2d7dac){return{'accounts':_0x2d7dac+'_'+(_0x2d7dac===_0x974f('0xd')?_0x974f('0xe'):_0x974f('0xf')),'interactions':_0x2d7dac+_0x974f('0x10'),'interactionsTags':_0x2d7dac+_0x974f('0x11'),'messages':_0x2d7dac+_0x974f('0x12'),'userInteractions':_0x974f('0x13')+_0x2d7dac+_0x974f('0x10')};}function getSelectedTags(_0x456c1d){var _0x342843=[];if(_0x456c1d){_0x342843=Array[_0x974f('0x14')](_0x456c1d)?_0x456c1d:[_0x456c1d];}return _0x342843;}function log(_0x55ec91,_0x1fa23c,_0x1a4998,_0x1fe257,_0x1d29e3,_0x1f1b14){loggers[_0x1d29e3['toLowerCase']()][_0x55ec91]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1f1b14[_0x974f('0x15')](),_0x1fa23c?_0x1fa23c['id']:null,_0x1fa23c?_0x1fa23c[_0x974f('0x16')]:null,_0x1fa23c?_0x1fa23c[_0x974f('0x17')]:null,getInteractionId(_0x1a4998,_0x1fe257,_0x1d29e3),_0x1a4998?JSON[_0x974f('0x18')](_0x1a4998):_0x974f('0x19'));}function updateUser(_0x5e8439,_0x478a2e,_0x45bc80,_0x4ee622,_0x206331){db[_[_0x974f('0xa')](_0x4ee622)+_0x974f('0x1a')][_0x974f('0x1b')]({'where':{'id':getInteractionId(_0x478a2e,_0x45bc80,_0x4ee622)}})[_0x974f('0x1c')](function(_0x45d056){if(_0x45d056){return _0x45d056[_0x974f('0x1d')]({'UserId':_0x5e8439?_0x5e8439['id']:null});}})['then'](function(_0x1f76e8){if(_0x1f76e8){log(_0x974f('0x1e'),_0x5e8439,_0x478a2e,_0x45bc80,_0x4ee622,_0x206331);}})[_0x974f('0x1f')](function(){log(_0x974f('0x20'),_0x5e8439,_0x478a2e,_0x45bc80,_0x4ee622,_0x206331);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 7724f69..0179a5f 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 _0x72c8=['aes-256-ctr','%s:%s:%s','utf8','final','hasOwnProperty','use','License','findOne','then','count','status','json','format','catch','users','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x72c8,0x8e));var _0x872c=function(_0x2ee6e3,_0x24fed7){_0x2ee6e3=_0x2ee6e3-0x0;var _0x1c9b79=_0x72c8[_0x2ee6e3];return _0x1c9b79;};'use strict';var crypto=require(_0x872c('0x0'));var util=require(_0x872c('0x1'));var compose=require(_0x872c('0x2'));var db=require(_0x872c('0x3'))['db'];var config=require(_0x872c('0x4'));function getValueFromLicense(_0x62daf6,_0x62d479){if(_0x62daf6&&_0x62d479){if(_0x62d479['data1']&&_0x62d479[_0x872c('0x5')]){var _0x12df5f=_0x62d479[_0x872c('0x6')];var _0x3f4109=_0x62d479[_0x872c('0x5')];var _0xedc533=_0x12df5f[_0x872c('0x7')]('-')[0x4];var _0x28ba0a=_0x12df5f['split']('-')[0x0];var _0x57c278=crypto['createDecipher'](_0x872c('0x8'),util['format'](_0x872c('0x9'),_0xedc533,_0x12df5f,_0x28ba0a));var _0x230efa=_0x57c278['update'](_0x3f4109,'base64',_0x872c('0xa'));_0x230efa+=_0x57c278[_0x872c('0xb')](_0x872c('0xa'));var _0x210db0=JSON['parse'](_0x230efa);return _0x210db0[_0x872c('0xc')](_0x62daf6)?_0x210db0[_0x62daf6]:null;}}return null;}function isLimit(_0x44a41a,_0x2623eb,_0x2b6240,_0x5582cc){var _0x528497=_0x2623eb;return compose()[_0x872c('0xd')](function(_0x53c805,_0x58ae33,_0x1c8174){return db[_0x872c('0xe')][_0x872c('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x872c('0x10')](function(_0x4e0069){var _0x1f9575=getValueFromLicense(_0x44a41a,_0x4e0069);return _0x1f9575?_0x1f9575:_0x528497;})['then'](function(_0x3d4e46){_0x528497=_0x3d4e46;return _0x2b6240[_0x872c('0x11')](_0x5582cc);})[_0x872c('0x10')](function(_0x17069a){if(_0x17069a>=_0x528497){return _0x58ae33[_0x872c('0x12')](0x193)[_0x872c('0x13')]({'message':util[_0x872c('0x14')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x44a41a)});}_0x1c8174();})[_0x872c('0x15')](function(_0x1c447c){_0x1c8174(_0x1c447c);});});}function isUserLimit(){return isLimit(_0x872c('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x872c('0x17')},{'role':_0x872c('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xf641=['User','admin','user','crypto','data1','license','%s:%s:%s','utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x223147,_0x363953){var _0x16471d=function(_0xabf6c5){while(--_0xabf6c5){_0x223147['push'](_0x223147['shift']());}};_0x16471d(++_0x363953);}(_0xf641,0x193));var _0x1f64=function(_0x9d2d2,_0x1c1c2c){_0x9d2d2=_0x9d2d2-0x0;var _0x488242=_0xf641[_0x9d2d2];return _0x488242;};'use strict';var crypto=require(_0x1f64('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x415b2d,_0x5e1573){if(_0x415b2d&&_0x5e1573){if(_0x5e1573['data1']&&_0x5e1573['license']){var _0x1fa9d8=_0x5e1573[_0x1f64('0x1')];var _0x35dfba=_0x5e1573[_0x1f64('0x2')];var _0x4d87b1=_0x1fa9d8['split']('-')[0x4];var _0xac1e0=_0x1fa9d8['split']('-')[0x0];var _0x5c3d66=crypto['createDecipher']('aes-256-ctr',util['format'](_0x1f64('0x3'),_0x4d87b1,_0x1fa9d8,_0xac1e0));var _0xfe1cc1=_0x5c3d66['update'](_0x35dfba,'base64',_0x1f64('0x4'));_0xfe1cc1+=_0x5c3d66[_0x1f64('0x5')]('utf8');var _0x7a1933=JSON[_0x1f64('0x6')](_0xfe1cc1);return _0x7a1933['hasOwnProperty'](_0x415b2d)?_0x7a1933[_0x415b2d]:null;}}return null;}function isLimit(_0x1c29e5,_0x121d38,_0x19f2e0,_0x30486b){var _0x9ced6f=_0x121d38;return compose()[_0x1f64('0x7')](function(_0x27c7b6,_0x55e5f3,_0x33a99b){return db[_0x1f64('0x8')][_0x1f64('0x9')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x19bb01){var _0x9ee14d=getValueFromLicense(_0x1c29e5,_0x19bb01);return _0x9ee14d?_0x9ee14d:_0x9ced6f;})[_0x1f64('0xa')](function(_0x23a61b){_0x9ced6f=_0x23a61b;return _0x19f2e0[_0x1f64('0xb')](_0x30486b);})[_0x1f64('0xa')](function(_0x1f9d59){if(_0x1f9d59>=_0x9ced6f){return _0x55e5f3[_0x1f64('0xc')](0x193)[_0x1f64('0xd')]({'message':util['format'](_0x1f64('0xe'),_0x1c29e5)});}_0x33a99b();})[_0x1f64('0xf')](function(_0x10b23f){_0x33a99b(_0x10b23f);});});}function isUserLimit(){return isLimit(_0x1f64('0x10'),0x1,db[_0x1f64('0x11')],{'where':{'$or':[{'role':_0x1f64('0x12')},{'role':_0x1f64('0x13')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f4b05ea..7962c8c 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 _0x5c0e=['$eq','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','add','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','slice','shift','match','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','$gt','$lte','value','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','includes','$ne','$notIn','\x20IS\x20NULL)','NOT\x20IN\x20?'];(function(_0x4fc8dd,_0x3f9517){var _0x59e0fd=function(_0x5c58ca){while(--_0x5c58ca){_0x4fc8dd['push'](_0x4fc8dd['shift']());}};_0x59e0fd(++_0x3f9517);}(_0x5c0e,0xfb));var _0xe5c0=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5c0e[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var moment=require(_0xe5c0('0x0'));exports[_0xe5c0('0x1')]=function(_0xbcc119){var _0x471004={'conditions':[]};_0x471004[_0xe5c0('0x2')]=_[_0xe5c0('0x3')](_0xbcc119,'[$or]')?'or':_0xe5c0('0x4');var _0xe45df5=_0xbcc119[_0xe5c0('0x5')](_0xe5c0('0x6'),'')['replace'](_0xe5c0('0x7'),'')[_0xe5c0('0x8')]('||');for(var _0x43146f=0x0;_0x43146f<_0xe45df5[_0xe5c0('0x9')];_0x43146f++){var _0x5b459c=_0xe45df5[_0x43146f][_0xe5c0('0x8')](':=');var _0x401e3b=_0x5b459c[0x0];var _0x5f100b=_0x5b459c[_0xe5c0('0xa')](0x1);_0x5f100b['forEach'](function(_0x50a305){var _0xf72ff3=_0x50a305['split']('[')[_0xe5c0('0xb')]();var _0x135134=_0x50a305[_0xe5c0('0xc')](/\[(.*?)\]/g);_0x135134[_0xe5c0('0xd')](function(_0x16fff9){var _0x25c41f=_0x16fff9['split']('[')[_0xe5c0('0xe')](function(_0x4b10b5){return _0x4b10b5[_0xe5c0('0xf')](']')>-0x1;})[_0xe5c0('0x10')](function(_0x1ab4fb){return _0x1ab4fb[_0xe5c0('0x8')](']')[0x0];})[0x0];_0x471004[_0xe5c0('0x11')][_0xe5c0('0x12')]({'field':_0x401e3b,'operator':_0xf72ff3,'value':_0x25c41f});});});}return _0x471004;};exports[_0xe5c0('0x13')]=function(_0x3bb512,_0x22f0e5,_0xa651c4){var _0x1789d={};if(_0x22f0e5===_0xe5c0('0x14')){if(_0xa651c4[_0xe5c0('0x15')]==='$eq'){_0xa651c4[_0xe5c0('0x15')]=_0xe5c0('0x16');_0xa651c4['value']+=','+_0xa651c4['value'];}else if(_['includes']([_0xe5c0('0x17'),_0xe5c0('0x18')],_0xa651c4[_0xe5c0('0x15')])){_0xa651c4[_0xe5c0('0x19')]=moment(_0xa651c4[_0xe5c0('0x19')])['add'](0x1,_0xe5c0('0x1a'))[_0xe5c0('0x1b')](_0xe5c0('0x1c'));}}if(_0xa651c4['castTo']){_0x22f0e5=_0xa651c4[_0xe5c0('0x1d')];_0x1789d[_0xe5c0('0x1e')]=_0xe5c0('0x1f')+_0x3bb512+'.'+_0xa651c4['field']+_0xe5c0('0x20')+_0xa651c4[_0xe5c0('0x1d')]+')\x20'+parseOperator(_0xa651c4['operator']);}else{_0x1789d['text']=_0x3bb512+'.'+_0xa651c4[_0xe5c0('0x21')]+'\x20'+parseOperator(_0xa651c4[_0xe5c0('0x15')]);}if(_[_0xe5c0('0x22')]([_0xe5c0('0x23'),_0xe5c0('0x24')],_0xa651c4['operator']))_0x1789d[_0xe5c0('0x1e')]='('+_0x1789d[_0xe5c0('0x1e')]+'\x20OR\x20'+_0x3bb512+'.'+_0xa651c4['field']+_0xe5c0('0x25');_0x1789d['value']=parseValue(_0x22f0e5,_0xa651c4[_0xe5c0('0x15')],_0xa651c4['value']);return _0x1789d;};function parseOperator(_0x551c8b){var _0x48b79e;switch(_0x551c8b){case'$in':_0x48b79e='IN\x20?';break;case _0xe5c0('0x24'):_0x48b79e=_0xe5c0('0x26');break;case _0xe5c0('0x27'):_0x48b79e=_0xe5c0('0x28');break;case _0xe5c0('0x23'):_0x48b79e='<>\x20?';break;case _0xe5c0('0x29'):case _0xe5c0('0x2a'):case _0xe5c0('0x2b'):_0x48b79e=_0xe5c0('0x2c');break;case'$lt':_0x48b79e=_0xe5c0('0x2d');break;case _0xe5c0('0x17'):_0x48b79e=_0xe5c0('0x2e');break;case _0xe5c0('0x18'):_0x48b79e=_0xe5c0('0x2f');break;case _0xe5c0('0x30'):_0x48b79e='>=\x20?';break;case _0xe5c0('0x16'):_0x48b79e=_0xe5c0('0x31');break;}return _0x48b79e;}function parseValue(_0x1436e5,_0x27bc7d,_0x52e9aa){var _0x31260c={'start':undefined,'end':undefined};switch(_0x27bc7d){case _0xe5c0('0x32'):case _0xe5c0('0x24'):_0x31260c['start']=_0x52e9aa[_0xe5c0('0x8')](',');break;case _0xe5c0('0x29'):_0x31260c[_0xe5c0('0x33')]='%'+_0x52e9aa+'%';break;case _0xe5c0('0x2a'):_0x31260c[_0xe5c0('0x33')]=_0x52e9aa+'%';break;case'$endsWith':_0x31260c[_0xe5c0('0x33')]='%'+_0x52e9aa;break;case _0xe5c0('0x16'):var _0x42ef46=_0x52e9aa[_0xe5c0('0x8')](',');var _0x52e9aa=_0x42ef46[_0xe5c0('0xb')]();var _0x432a25=_0x42ef46[_0xe5c0('0x34')]();if(_0x1436e5===_0xe5c0('0x14')){_0x52e9aa=moment(_0x52e9aa)['utcOffset'](0x0,!![])['format']();_0x432a25=moment(_0x432a25)[_0xe5c0('0x35')](0x0,!![])[_0xe5c0('0x36')](0x17,_0xe5c0('0x37'))[_0xe5c0('0x36')](0x3b,_0xe5c0('0x38'))[_0xe5c0('0x36')](0x3b,_0xe5c0('0x39'))[_0xe5c0('0x1b')]();}_0x31260c={'start':_0x52e9aa,'end':_0x432a25};break;default:_0x31260c[_0xe5c0('0x33')]=_0x52e9aa;break;}return _0x31260c;} \ No newline at end of file +var _0x6130=['DATE','utcOffset','add','hours','minutes','seconds','lodash','parseSearch','startsWith','[$or]','[$and]','replace','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','operator','$eq','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','$startsWith'];(function(_0x293caa,_0x10c8a3){var _0x5ec971=function(_0x3b3bc7){while(--_0x3b3bc7){_0x293caa['push'](_0x293caa['shift']());}};_0x5ec971(++_0x10c8a3);}(_0x6130,0x156));var _0x0613=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x6130[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x0613('0x0'));var moment=require('moment');exports[_0x0613('0x1')]=function(_0x528a5e){var _0x56a27c={'conditions':[]};_0x56a27c['sqlOperator']=_[_0x0613('0x2')](_0x528a5e,_0x0613('0x3'))?'or':'and';var _0x8a64d4=_0x528a5e['replace'](_0x0613('0x4'),'')[_0x0613('0x5')](_0x0613('0x3'),'')[_0x0613('0x6')]('||');for(var _0xe876fa=0x0;_0xe876fa<_0x8a64d4[_0x0613('0x7')];_0xe876fa++){var _0x157329=_0x8a64d4[_0xe876fa]['split'](':=');var _0x543060=_0x157329[0x0];var _0x3c8e2c=_0x157329[_0x0613('0x8')](0x1);_0x3c8e2c[_0x0613('0x9')](function(_0x3121d5){var _0xaf32f2=_0x3121d5[_0x0613('0x6')]('[')[_0x0613('0xa')]();var _0x234644=_0x3121d5[_0x0613('0xb')](/\[(.*?)\]/g);_0x234644['forEach'](function(_0x55b466){var _0x5911a3=_0x55b466[_0x0613('0x6')]('[')['filter'](function(_0x49c622){return _0x49c622[_0x0613('0xc')](']')>-0x1;})[_0x0613('0xd')](function(_0x120d0a){return _0x120d0a['split'](']')[0x0];})[0x0];_0x56a27c[_0x0613('0xe')][_0x0613('0xf')]({'field':_0x543060,'operator':_0xaf32f2,'value':_0x5911a3});});});}return _0x56a27c;};exports[_0x0613('0x10')]=function(_0x30b0eb,_0x540c68,_0x1d2952){var _0x3fd236={};if(_0x540c68==='DATE'){if(_0x1d2952[_0x0613('0x11')]===_0x0613('0x12')){_0x1d2952['operator']='$between';_0x1d2952[_0x0613('0x13')]+=','+_0x1d2952['value'];}else if(_[_0x0613('0x14')]([_0x0613('0x15'),_0x0613('0x16')],_0x1d2952[_0x0613('0x11')])){_0x1d2952[_0x0613('0x13')]=moment(_0x1d2952[_0x0613('0x13')])['add'](0x1,_0x0613('0x17'))[_0x0613('0x18')](_0x0613('0x19'));}}if(_0x1d2952[_0x0613('0x1a')]){_0x540c68=_0x1d2952[_0x0613('0x1a')];_0x3fd236[_0x0613('0x1b')]=_0x0613('0x1c')+_0x30b0eb+'.'+_0x1d2952[_0x0613('0x1d')]+_0x0613('0x1e')+_0x1d2952[_0x0613('0x1a')]+')\x20'+parseOperator(_0x1d2952[_0x0613('0x11')]);}else{_0x3fd236[_0x0613('0x1b')]=_0x30b0eb+'.'+_0x1d2952[_0x0613('0x1d')]+'\x20'+parseOperator(_0x1d2952['operator']);}if(_['includes']([_0x0613('0x1f'),_0x0613('0x20')],_0x1d2952[_0x0613('0x11')]))_0x3fd236[_0x0613('0x1b')]='('+_0x3fd236[_0x0613('0x1b')]+_0x0613('0x21')+_0x30b0eb+'.'+_0x1d2952[_0x0613('0x1d')]+_0x0613('0x22');_0x3fd236[_0x0613('0x13')]=parseValue(_0x540c68,_0x1d2952[_0x0613('0x11')],_0x1d2952['value']);return _0x3fd236;};function parseOperator(_0x328a0d){var _0x502a92;switch(_0x328a0d){case _0x0613('0x23'):_0x502a92=_0x0613('0x24');break;case _0x0613('0x20'):_0x502a92='NOT\x20IN\x20?';break;case _0x0613('0x12'):_0x502a92=_0x0613('0x25');break;case _0x0613('0x1f'):_0x502a92=_0x0613('0x26');break;case _0x0613('0x27'):case'$startsWith':case _0x0613('0x28'):_0x502a92='LIKE\x20?';break;case _0x0613('0x29'):_0x502a92=_0x0613('0x2a');break;case _0x0613('0x15'):_0x502a92=_0x0613('0x2b');break;case _0x0613('0x16'):_0x502a92=_0x0613('0x2c');break;case _0x0613('0x2d'):_0x502a92='>=\x20?';break;case _0x0613('0x2e'):_0x502a92=_0x0613('0x2f');break;}return _0x502a92;}function parseValue(_0x4cda5a,_0x3d9ebd,_0x4fe7a6){var _0x3ade4a={'start':undefined,'end':undefined};switch(_0x3d9ebd){case _0x0613('0x23'):case'$notIn':_0x3ade4a[_0x0613('0x30')]=_0x4fe7a6[_0x0613('0x6')](',');break;case _0x0613('0x27'):_0x3ade4a[_0x0613('0x30')]='%'+_0x4fe7a6+'%';break;case _0x0613('0x31'):_0x3ade4a[_0x0613('0x30')]=_0x4fe7a6+'%';break;case _0x0613('0x28'):_0x3ade4a[_0x0613('0x30')]='%'+_0x4fe7a6;break;case _0x0613('0x2e'):var _0x270c35=_0x4fe7a6[_0x0613('0x6')](',');var _0x4fe7a6=_0x270c35[_0x0613('0xa')]();var _0x6e78be=_0x270c35['pop']();if(_0x4cda5a===_0x0613('0x32')){_0x4fe7a6=moment(_0x4fe7a6)['utcOffset'](0x0,!![])['format']();_0x6e78be=moment(_0x6e78be)[_0x0613('0x33')](0x0,!![])[_0x0613('0x34')](0x17,_0x0613('0x35'))[_0x0613('0x34')](0x3b,_0x0613('0x36'))['add'](0x3b,_0x0613('0x37'))[_0x0613('0x18')]();}_0x3ade4a={'start':_0x4fe7a6,'end':_0x6e78be};break;default:_0x3ade4a[_0x0613('0x30')]=_0x4fe7a6;break;}return _0x3ade4a;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bb9d511..9c631a6 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 _0x4b19=['subtract','name','uniqueid','isArray','limit','sort','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isObject','length','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','push','join','query','$id','model','map','intersection','attributes','nolimit','offset','order','where','filters','pick','filter','object','includes','columns','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','utc','format'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0x4b19,0x195));var _0x94b1=function(_0x245745,_0x5437c0){_0x245745=_0x245745-0x0;var _0x40c39b=_0x4b19[_0x245745];return _0x40c39b;};'use strict';var _=require(_0x94b1('0x0'));var sequelize=require('sequelize');var moment=require(_0x94b1('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x32f392){var _0x221ab3=['ne'];try{var _0x577f52=JSON[_0x94b1('0x2')](_0x32f392);var _0x3648ad=Object[_0x94b1('0x3')](_0x577f52)[0x0];return _0x221ab3['includes'](_0x3648ad);}catch(_0x1310cd){return![];}}function getOperatorValue(_0x11e23c){var _0x52d6c1=JSON[_0x94b1('0x2')](_0x11e23c);var _0x110a52=Object['keys'](_0x52d6c1)[0x0];var _0x40c69c=_0x52d6c1[_0x110a52];return{['$'+_0x110a52]:_0x40c69c};}exports[_0x94b1('0x4')]=function(_0xad0a85){var _0x5aee5f=null;if(_0xad0a85){_0x5aee5f=_0xad0a85[_0x94b1('0x5')](',');}return _0x5aee5f;};exports['filters']=function(_0x4aafcc,_0x3c2080){var _0x126424={};if(!_[_0x94b1('0x6')](_0x4aafcc)){_[_0x94b1('0x7')](_0x4aafcc,function(_0x162995,_0x3aeb91){try{if(_0x3c2080){var _0x4a8ea2=_[_0x94b1('0x8')](_0x3c2080,{'name':_0x3aeb91})||{};if(hasSequelizeOperator(_0x162995)){_0x126424[_0x3aeb91]=getOperatorValue(_0x162995);}else if(_0x4a8ea2[_0x94b1('0x9')]===_0x94b1('0xa')&&_[_0x94b1('0xb')](_0x162995)){var _0x5cbf96=JSON['parse'](_0x162995);var _0x26484b={'$gte':moment(moment(_0x5cbf96[_0x94b1('0xc')])['format']('YYYY-MM-DD'))[_0x94b1('0xd')]()[_0x94b1('0xe')](),'$lte':moment(moment(_0x5cbf96['$lte'])[_0x94b1('0xe')]('YYYY-MM-DD'))['utc']()[_0x94b1('0xf')](0x1,'s')[_0x94b1('0xe')]()};_0x126424[_0x3aeb91]=_0x26484b;}else if(_0x4a8ea2[_0x94b1('0x10')]===_0x94b1('0x11')){_0x126424[_0x3aeb91]=_0x162995;}else{_0x126424[_0x3aeb91]=_['isArray'](_0x162995)?_0x162995:JSON[_0x94b1('0x2')](_0x162995);}}else{_0x126424[_0x3aeb91]=_[_0x94b1('0x12')](_0x162995)?_0x162995:JSON[_0x94b1('0x2')](_0x162995);}}catch(_0x224099){_0x126424[_0x3aeb91]=_0x162995[_0x94b1('0x5')](',');}});}return _0x126424;};exports[_0x94b1('0x13')]=function(_0x2d33dc){_0x2d33dc=parseInt(_0x2d33dc,0xa);if(!_0x2d33dc||_0x2d33dc<0x0){_0x2d33dc=LIMIT_VALUE;}return _0x2d33dc;};exports['offset']=function(_0x30f969){_0x30f969=parseInt(_0x30f969,0xa);if(!_0x30f969||_0x30f969<0x0){_0x30f969=0x0;}return _0x30f969;};exports[_0x94b1('0x14')]=function(_0x1fcb91){var _0x5deb20,_0x4490c9=null;if(_0x1fcb91){_0x5deb20=_0x1fcb91[_0x94b1('0x5')](',');_0x4490c9=_['map'](_0x5deb20,function(_0x602c3b){if(_0x602c3b[_0x94b1('0x15')]('-')===0x0){return[_0x602c3b===_0x94b1('0x16')?sequelize[_0x94b1('0x17')](sequelize[_0x94b1('0x18')](_0x94b1('0x16')),_0x94b1('0x19')):_0x602c3b[_0x94b1('0x1a')](0x1),_0x94b1('0x1b')];}else{return[_0x602c3b===_0x94b1('0x16')?sequelize['cast'](sequelize[_0x94b1('0x18')](_0x94b1('0x16')),_0x94b1('0x19')):_0x602c3b,'ASC'];}});}return _0x4490c9;};exports[_0x94b1('0x1c')]=function(_0x5af4f5,_0x269925){if(_[_0x94b1('0x6')](_0x5af4f5)){return _0x5af4f5;}if(_[_0x94b1('0x12')](_0x5af4f5)){for(var _0x109a81=0x0;_0x109a81<_0x5af4f5['length'];_0x109a81+=0x1){_0x5af4f5[_0x109a81]=this['omit'](_0x5af4f5[_0x109a81],_0x269925);}return _0x5af4f5;}if(!_[_0x94b1('0x1d')](_0x5af4f5)){return _0x5af4f5;}if(_['isString'](_0x269925)){_0x269925=[_0x269925];}if(!_[_0x94b1('0x12')](_0x269925)){return _0x5af4f5;}for(var _0x5c3a9a=0x0;_0x5c3a9a<_0x269925[_0x94b1('0x1e')];_0x5c3a9a+=0x1){_[_0x94b1('0x1f')](_0x5af4f5,_0x269925[_0x5c3a9a]);}for(var _0x1eda8c in _0x5af4f5){if(_0x5af4f5['hasOwnProperty'](_0x1eda8c)){_0x5af4f5[_0x1eda8c]=this[_0x94b1('0x1c')](_0x5af4f5[_0x1eda8c],_0x269925);}}return _0x5af4f5;};exports[_0x94b1('0x20')]=function(_0x467c42){return _0x467c42[_0x94b1('0x21')](RegExp(_0x94b1('0x22')))?!![]:![];};exports[_0x94b1('0x23')]=function(_0x2661ca){return _0x2661ca[_0x94b1('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x94b1('0x24')]=function(_0x597af3){var _0x2eb1fa=[];_0x597af3[_0x94b1('0x5')](/[ ,]+/)['forEach'](function(_0x42630a){_0x42630a=_0x42630a[_0x94b1('0x25')](/([^:]")"+/g,'$1');_0x42630a='+'+_0x42630a+'*';var _0xab9ac5=/[ `!@#$%^&*()_\-?~]/;if(_0x42630a[_0x94b1('0x21')](_0xab9ac5))_0x42630a='\x22'+_0x42630a+'\x22';_0x2eb1fa[_0x94b1('0x26')](_0x42630a);});return _0x2eb1fa[_0x94b1('0x27')]('\x20');};exports['getOptions']=function(_0x1a26eb,_0x5d765b,_0x2def34){var _0x51d67c={},_0x57e497={};if(_0x5d765b[_0x94b1('0x28')][_0x94b1('0x29')]){_0x5d765b[_0x94b1('0x28')]['id']=_0x5d765b[_0x94b1('0x28')][_0x94b1('0x29')];delete _0x5d765b[_0x94b1('0x28')][_0x94b1('0x29')];}_0x51d67c[_0x94b1('0x2a')]=_[_0x94b1('0x2b')](_0x1a26eb,_0x94b1('0x10'));_0x51d67c[_0x94b1('0x28')]=_[_0x94b1('0x3')](_0x5d765b['query']);_0x51d67c['filters']=_[_0x94b1('0x2c')](_0x51d67c[_0x94b1('0x2a')],_0x51d67c[_0x94b1('0x28')]);_0x57e497[_0x94b1('0x2d')]=_[_0x94b1('0x2c')](_0x51d67c[_0x94b1('0x2a')],this[_0x94b1('0x4')](_0x5d765b[_0x94b1('0x28')][_0x94b1('0x4')]));_0x57e497['attributes']=_0x57e497[_0x94b1('0x2d')]['length']?_0x57e497[_0x94b1('0x2d')]:_0x51d67c[_0x94b1('0x2a')];if(!_0x5d765b[_0x94b1('0x28')]['hasOwnProperty'](_0x94b1('0x2e'))){_0x57e497[_0x94b1('0x13')]=this[_0x94b1('0x13')](_0x5d765b['query'][_0x94b1('0x13')]);_0x57e497[_0x94b1('0x2f')]=this[_0x94b1('0x2f')](_0x5d765b[_0x94b1('0x28')][_0x94b1('0x2f')]);}_0x57e497[_0x94b1('0x30')]=this[_0x94b1('0x14')](_0x5d765b[_0x94b1('0x28')][_0x94b1('0x14')]);_0x57e497[_0x94b1('0x31')]=this[_0x94b1('0x32')](_[_0x94b1('0x33')](_0x5d765b[_0x94b1('0x28')],_0x51d67c['filters']),_0x1a26eb);if(_0x5d765b[_0x94b1('0x28')][_0x94b1('0x34')]){var _0xf29a10=_0x1a26eb;var _0x44d53d=_0x5d765b[_0x94b1('0x28')]['filter'];if(typeof _0x44d53d===_0x94b1('0x35')){_0xf29a10=_[_0x94b1('0x34')](_0x1a26eb,function(_0x186575){return _[_0x94b1('0x36')](_0x44d53d[_0x94b1('0x37')],_0x186575[_0x94b1('0x10')]);});_0x44d53d=_0x44d53d['value'];}_0x57e497[_0x94b1('0x31')]=_[_0x94b1('0x38')](_0x57e497['where'],{'$or':_[_0x94b1('0x2b')](_0xf29a10,function(_0x19d4e4){if(_0x19d4e4['type']!==_0x94b1('0x39')){if(_0x2def34){return sequelize[_0x94b1('0x31')](sequelize['fn'](_0x94b1('0x3a'),sequelize['col'](_0x19d4e4[_0x94b1('0x10')])),{'$like':sequelize['fn'](_0x94b1('0x3a'),'%'+_0x5d765b[_0x94b1('0x28')][_0x94b1('0x34')]+'%')});}else{var _0x3f56a9={};_0x3f56a9[_0x19d4e4[_0x94b1('0x10')]]={'$like':'%'+_0x5d765b[_0x94b1('0x28')]['filter']+'%'};return _0x3f56a9;}}})});}_0x57e497=_[_0x94b1('0x38')]({},_0x57e497,_0x5d765b[_0x94b1('0x3b')]);return _0x57e497;}; \ No newline at end of file +var _0xb4c7=['unsigned','substr','DESC','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','join','getOptions','$id','query','map','intersection','model','attributes','nolimit','where','pick','object','filter','columns','value','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col'];(function(_0x42004d,_0x127961){var _0xb47cd4=function(_0x5a3b8d){while(--_0x5a3b8d){_0x42004d['push'](_0x42004d['shift']());}};_0xb47cd4(++_0x127961);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x3b3735,_0x22b63b){_0x3b3735=_0x3b3735-0x0;var _0x114c8e=_0xb4c7[_0x3b3735];return _0x114c8e;};'use strict';var _=require(_0x7b4c('0x0'));var sequelize=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xa0d9f1){var _0x286a79=['ne'];try{var _0x4bef48=JSON[_0x7b4c('0x3')](_0xa0d9f1);var _0x149d55=Object[_0x7b4c('0x4')](_0x4bef48)[0x0];return _0x286a79[_0x7b4c('0x5')](_0x149d55);}catch(_0x2d9945){return![];}}function getOperatorValue(_0x5adec9){var _0x1b0f57=JSON[_0x7b4c('0x3')](_0x5adec9);var _0x2dd5c7=Object['keys'](_0x1b0f57)[0x0];var _0x2d7b7e=_0x1b0f57[_0x2dd5c7];return{['$'+_0x2dd5c7]:_0x2d7b7e};}exports[_0x7b4c('0x6')]=function(_0x570daa){var _0x433aa2=null;if(_0x570daa){_0x433aa2=_0x570daa[_0x7b4c('0x7')](',');}return _0x433aa2;};exports[_0x7b4c('0x8')]=function(_0x237e28,_0x365225){var _0x93d013={};if(!_[_0x7b4c('0x9')](_0x237e28)){_[_0x7b4c('0xa')](_0x237e28,function(_0xa9814e,_0x2adb51){try{if(_0x365225){var _0x5d5bc3=_['find'](_0x365225,{'name':_0x2adb51})||{};if(hasSequelizeOperator(_0xa9814e)){_0x93d013[_0x2adb51]=getOperatorValue(_0xa9814e);}else if(_0x5d5bc3[_0x7b4c('0xb')]===_0x7b4c('0xc')&&_[_0x7b4c('0xd')](_0xa9814e)){var _0x1722ad=JSON[_0x7b4c('0x3')](_0xa9814e);var _0x341d36={'$gte':moment(moment(_0x1722ad[_0x7b4c('0xe')])[_0x7b4c('0xf')](_0x7b4c('0x10')))[_0x7b4c('0x11')]()['format'](),'$lte':moment(moment(_0x1722ad[_0x7b4c('0x12')])[_0x7b4c('0xf')](_0x7b4c('0x10')))[_0x7b4c('0x11')]()[_0x7b4c('0x13')](0x1,'s')[_0x7b4c('0xf')]()};_0x93d013[_0x2adb51]=_0x341d36;}else if(_0x5d5bc3[_0x7b4c('0x14')]===_0x7b4c('0x15')){_0x93d013[_0x2adb51]=_0xa9814e;}else{_0x93d013[_0x2adb51]=_['isArray'](_0xa9814e)?_0xa9814e:JSON[_0x7b4c('0x3')](_0xa9814e);}}else{_0x93d013[_0x2adb51]=_[_0x7b4c('0x16')](_0xa9814e)?_0xa9814e:JSON[_0x7b4c('0x3')](_0xa9814e);}}catch(_0x36c02a){_0x93d013[_0x2adb51]=_0xa9814e['split'](',');}});}return _0x93d013;};exports[_0x7b4c('0x17')]=function(_0x3d314d){_0x3d314d=parseInt(_0x3d314d,0xa);if(!_0x3d314d||_0x3d314d<0x0){_0x3d314d=LIMIT_VALUE;}return _0x3d314d;};exports[_0x7b4c('0x18')]=function(_0x380b79){_0x380b79=parseInt(_0x380b79,0xa);if(!_0x380b79||_0x380b79<0x0){_0x380b79=0x0;}return _0x380b79;};exports[_0x7b4c('0x19')]=function(_0x1363b4){var _0x237110,_0x445281=null;if(_0x1363b4){_0x237110=_0x1363b4[_0x7b4c('0x7')](',');_0x445281=_['map'](_0x237110,function(_0x1f06ec){if(_0x1f06ec[_0x7b4c('0x1a')]('-')===0x0){return[_0x1f06ec===_0x7b4c('0x1b')?sequelize[_0x7b4c('0x1c')](sequelize[_0x7b4c('0x1d')](_0x7b4c('0x1b')),_0x7b4c('0x1e')):_0x1f06ec[_0x7b4c('0x1f')](0x1),_0x7b4c('0x20')];}else{return[_0x1f06ec===_0x7b4c('0x1b')?sequelize['cast'](sequelize[_0x7b4c('0x1d')](_0x7b4c('0x1b')),_0x7b4c('0x1e')):_0x1f06ec,_0x7b4c('0x21')];}});}return _0x445281;};exports[_0x7b4c('0x22')]=function(_0x2bdc4d,_0x37c059){if(_[_0x7b4c('0x9')](_0x2bdc4d)){return _0x2bdc4d;}if(_[_0x7b4c('0x16')](_0x2bdc4d)){for(var _0x1a69db=0x0;_0x1a69db<_0x2bdc4d[_0x7b4c('0x23')];_0x1a69db+=0x1){_0x2bdc4d[_0x1a69db]=this[_0x7b4c('0x22')](_0x2bdc4d[_0x1a69db],_0x37c059);}return _0x2bdc4d;}if(!_[_0x7b4c('0x24')](_0x2bdc4d)){return _0x2bdc4d;}if(_['isString'](_0x37c059)){_0x37c059=[_0x37c059];}if(!_[_0x7b4c('0x16')](_0x37c059)){return _0x2bdc4d;}for(var _0x3ab614=0x0;_0x3ab614<_0x37c059[_0x7b4c('0x23')];_0x3ab614+=0x1){_[_0x7b4c('0x25')](_0x2bdc4d,_0x37c059[_0x3ab614]);}for(var _0x207c2f in _0x2bdc4d){if(_0x2bdc4d[_0x7b4c('0x26')](_0x207c2f)){_0x2bdc4d[_0x207c2f]=this[_0x7b4c('0x22')](_0x2bdc4d[_0x207c2f],_0x37c059);}}return _0x2bdc4d;};exports[_0x7b4c('0x27')]=function(_0x3e4a46){return _0x3e4a46[_0x7b4c('0x28')](RegExp(_0x7b4c('0x29')))?!![]:![];};exports[_0x7b4c('0x2a')]=function(_0x3544bc){return _0x3544bc[_0x7b4c('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x7b4c('0x2b')]=function(_0x3e5bdd){var _0x1d0724=[];_0x3e5bdd[_0x7b4c('0x7')](/[ ,]+/)[_0x7b4c('0x2c')](function(_0x4f0d33){_0x4f0d33=_0x4f0d33['replace'](/([^:]")"+/g,'$1');_0x4f0d33='+'+_0x4f0d33+'*';var _0x511f21=/[ `!@#$%^&*()_\-?~]/;if(_0x4f0d33[_0x7b4c('0x28')](_0x511f21))_0x4f0d33='\x22'+_0x4f0d33+'\x22';_0x1d0724[_0x7b4c('0x2d')](_0x4f0d33);});return _0x1d0724[_0x7b4c('0x2e')]('\x20');};exports[_0x7b4c('0x2f')]=function(_0x498391,_0x6e66e3,_0x344325){var _0x5d728b={},_0x647978={};if(_0x6e66e3['query'][_0x7b4c('0x30')]){_0x6e66e3[_0x7b4c('0x31')]['id']=_0x6e66e3[_0x7b4c('0x31')]['$id'];delete _0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x30')];}_0x5d728b['model']=_[_0x7b4c('0x32')](_0x498391,_0x7b4c('0x14'));_0x5d728b[_0x7b4c('0x31')]=_[_0x7b4c('0x4')](_0x6e66e3['query']);_0x5d728b['filters']=_[_0x7b4c('0x33')](_0x5d728b[_0x7b4c('0x34')],_0x5d728b['query']);_0x647978[_0x7b4c('0x35')]=_['intersection'](_0x5d728b['model'],this[_0x7b4c('0x6')](_0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x6')]));_0x647978[_0x7b4c('0x35')]=_0x647978['attributes'][_0x7b4c('0x23')]?_0x647978[_0x7b4c('0x35')]:_0x5d728b[_0x7b4c('0x34')];if(!_0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x26')](_0x7b4c('0x36'))){_0x647978[_0x7b4c('0x17')]=this['limit'](_0x6e66e3['query'][_0x7b4c('0x17')]);_0x647978[_0x7b4c('0x18')]=this[_0x7b4c('0x18')](_0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x18')]);}_0x647978['order']=this[_0x7b4c('0x19')](_0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x19')]);_0x647978[_0x7b4c('0x37')]=this[_0x7b4c('0x8')](_[_0x7b4c('0x38')](_0x6e66e3[_0x7b4c('0x31')],_0x5d728b[_0x7b4c('0x8')]),_0x498391);if(_0x6e66e3[_0x7b4c('0x31')]['filter']){var _0x2a4085=_0x498391;var _0x562838=_0x6e66e3[_0x7b4c('0x31')]['filter'];if(typeof _0x562838===_0x7b4c('0x39')){_0x2a4085=_[_0x7b4c('0x3a')](_0x498391,function(_0x5bb6d0){return _['includes'](_0x562838[_0x7b4c('0x3b')],_0x5bb6d0[_0x7b4c('0x14')]);});_0x562838=_0x562838[_0x7b4c('0x3c')];}_0x647978[_0x7b4c('0x37')]=_['merge'](_0x647978[_0x7b4c('0x37')],{'$or':_[_0x7b4c('0x32')](_0x2a4085,function(_0x100774){if(_0x100774['type']!==_0x7b4c('0x3d')){if(_0x344325){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x7b4c('0x1d')](_0x100774['name'])),{'$like':sequelize['fn'](_0x7b4c('0x3e'),'%'+_0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x3a')]+'%')});}else{var _0x301935={};_0x301935[_0x100774[_0x7b4c('0x14')]]={'$like':'%'+_0x6e66e3[_0x7b4c('0x31')][_0x7b4c('0x3a')]+'%'};return _0x301935;}}})});}_0x647978=_[_0x7b4c('0x3f')]({},_0x647978,_0x6e66e3[_0x7b4c('0x40')]);return _0x647978;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 4e73bdb..2f5ad6a 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 _0xd6c9=['resolve','findAll','name','fullname','mailPause','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','internal','substring','indexOf','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','pick','filterAgentAttributes','lodash','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','findOne','getAgents','all','flatten','map','uniq','getAgentIdsByQueues','includes','getAgentIdsByStatus'];(function(_0x377380,_0x2dd475){var _0x19f3c3=function(_0x5c3b0b){while(--_0x5c3b0b){_0x377380['push'](_0x377380['shift']());}};_0x19f3c3(++_0x2dd475);}(_0xd6c9,0xda));var _0x9d6c=function(_0x14d19b,_0x5de038){_0x14d19b=_0x14d19b-0x0;var _0x455d60=_0xd6c9[_0x14d19b];return _0x455d60;};'use strict';var _=require(_0x9d6c('0x0'));var jayson=require('jayson/promise');var db=require(_0x9d6c('0x1'))['db'];var amiClient=jayson[_0x9d6c('0x2')][_0x9d6c('0x3')]({'port':0x232a});var routingClient=jayson[_0x9d6c('0x2')][_0x9d6c('0x3')]({'port':0x232c});function isAgentPaused(_0x3ec690,_0x2b673d){var _0x366e1b=[_0x3ec690[_0x9d6c('0x4')],_0x3ec690[_0x9d6c('0x5')],_0x3ec690['mailPause'],_0x3ec690[_0x9d6c('0x6')],_0x3ec690[_0x9d6c('0x7')],_0x3ec690['voicePause'],_0x3ec690[_0x9d6c('0x8')]];if(!_0x2b673d)return _[_0x9d6c('0x9')](_0x366e1b);var _0xf55f17=_[_0x9d6c('0xa')](_0x366e1b);return _0xf55f17[_0x9d6c('0xb')]>0x0&&_0xf55f17[_0x9d6c('0xb')]<_0x366e1b[_0x9d6c('0xb')]?!![]:![];}function isIdle(_0x1d5420){return _0x1d5420===_0x9d6c('0xc')||_0x1d5420===_0x9d6c('0xd')||_0x1d5420===_0x9d6c('0xe')||_0x1d5420===_0x9d6c('0xf')||_['isNil'](_0x1d5420);}function isAgentIdle(_0x399548){if(_0x399548[_0x9d6c('0x10')]!==_0x9d6c('0xc')&&_0x399548[_0x9d6c('0x11')]){_0x399548[_0x9d6c('0x10')]=_0x9d6c('0x12');return![];}return _['every']([_0x399548[_0x9d6c('0x13')],_0x399548[_0x9d6c('0x14')],_0x399548[_0x9d6c('0x15')],_0x399548[_0x9d6c('0x16')],_0x399548[_0x9d6c('0x17')],_0x399548[_0x9d6c('0x10')],_0x399548[_0x9d6c('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x9d6c('0x19')](_0x9d6c('0x1a'),{})['then'](function(_0x462ae9){if(_0x462ae9['error']){throw new Error(_0x9d6c('0x1b'));}var _0x3358ed=_0x462ae9[_0x9d6c('0x1c')];return routingClient['request']('Agents',{})[_0x9d6c('0x1d')](function(_0x26a34c){if(_0x26a34c[_0x9d6c('0x1e')]){throw new Error(_0x9d6c('0x1f'));}var _0x22aa01=_0x26a34c[_0x9d6c('0x1c')];return _[_0x9d6c('0x20')]({},_0x3358ed,_0x22aa01);});})[_0x9d6c('0x21')](function(_0x417992){throw _0x417992;});}exports[_0x9d6c('0x22')]=getRealtimeAgents;function getAgentStatus(_0x3a9ce1){var _0x5c7b69=_0x9d6c('0xd');if(isAgentPaused(_0x3a9ce1))_0x5c7b69='pause';else if(isAgentPaused(_0x3a9ce1,!![]))_0x5c7b69=_0x9d6c('0x23');else if(isAgentIdle(_0x3a9ce1))_0x5c7b69=_0x9d6c('0xc');else _0x5c7b69=_0x9d6c('0x24');return _0x5c7b69;}exports[_0x9d6c('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0x10137b,_0x3072ea){var _0x568c73=_[_0x9d6c('0x26')](_0x10137b)?_0x10137b:[_0x10137b];var _0x1d28b8=_[_0x9d6c('0x27')](_0x3072ea)+'Queue';var _0x46116d=_['map'](_0x568c73,function(_0x3dc0e8){return db[_0x1d28b8][_0x9d6c('0x28')]({'where':{'id':_0x3dc0e8}})['then'](function(_0x574df5){if(!_0x574df5)return[];return _0x574df5[_0x9d6c('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x9d6c('0x2a')](_0x46116d)['then'](function(_0x28872b){var _0x384f23=_(_0x28872b)[_0x9d6c('0x2b')]()[_0x9d6c('0x2c')]('id')[_0x9d6c('0x2d')]()['value']();return _0x384f23;});}exports[_0x9d6c('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x987bc0,_0x3f3e75,_0x370c6e){try{if(_0x3f3e75[_0x9d6c('0xb')]>0x0){_0x987bc0=_0x987bc0[_0x9d6c('0xa')](function(_0x52c6f9){return _0x3f3e75[_0x9d6c('0x2f')](_0x52c6f9['id']);});}var _0x484a9e=_0x987bc0['filter'](function(_0x3d48e6){var _0x18db2e=_0x9d6c('0x24');if(isAgentIdle(_0x3d48e6)){_0x18db2e=_0x9d6c('0xc');}return _0x18db2e===_0x370c6e;});return _['map'](_0x484a9e,'id');}catch(_0x5e175b){throw _0x5e175b;}}exports[_0x9d6c('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x87b7e5,_0x4bfc82,_0x44f739){return Promise[_0x9d6c('0x31')]()[_0x9d6c('0x1d')](function(){if(_0x4bfc82[_0x9d6c('0xb')]>0x0){_0x87b7e5=_0x87b7e5['filter'](function(_0x4f187b){return _0x4bfc82[_0x9d6c('0x2f')](_0x4f187b['id']);});}return _0x87b7e5;})['then'](function(){return db['User'][_0x9d6c('0x32')]({'attributes':['id',_0x9d6c('0x33'),_0x9d6c('0x34'),'chatPause',_0x9d6c('0x5'),_0x9d6c('0x35'),_0x9d6c('0x6'),_0x9d6c('0x7'),_0x9d6c('0x11'),_0x9d6c('0x8'),'pauseType'],'where':{'id':{'$in':_[_0x9d6c('0x2c')](_0x87b7e5,'id')}},'raw':!![]});})[_0x9d6c('0x1d')](function(_0x44c2de){return _0x44c2de[_0x9d6c('0x2c')](function(_0x57932d){var _0x3efd67=_[_0x9d6c('0x36')](_0x87b7e5,['id',_0x57932d['id']]);var _0x436ef3=filterAgentAttributes(_0x3efd67);_[_0x9d6c('0x20')](_0x57932d,_0x436ef3);_0x57932d[_0x9d6c('0x37')]=getAgentStatus(_0x57932d);return _0x57932d;});})[_0x9d6c('0x1d')](function(_0x23b3c6){var _0x5e2508=sortAgentsByStatus(_0x23b3c6,_0x44f739);return _[_0x9d6c('0x2c')](_0x5e2508,'id');})[_0x9d6c('0x21')](function(_0x34ac11){throw _0x34ac11;});}exports[_0x9d6c('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2ee65a){var _0x19b522={'fields':[],'order':null};var _0x2d077a=_0x2ee65a['split'](',');_0x19b522[_0x9d6c('0x39')]=_[_0x9d6c('0xa')](_0x2d077a,function(_0x5c0631){if(!_0x5c0631[_0x9d6c('0x2f')]('globalStatus')){return!![];}_0x19b522[_0x9d6c('0x3a')]=_[_0x9d6c('0x3b')](_0x5c0631,'-')?_0x9d6c('0x3c'):'ASC';return![];});return _0x19b522;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x89a42b){if(_0x89a42b[_0x9d6c('0x2f')](_0x9d6c('0x34'))&&!_0x89a42b[_0x9d6c('0x2f')](_0x9d6c('0x3d'))){var _0x1201f4=_0x89a42b[_0x9d6c('0x3e')](0x0,_0x89a42b[_0x9d6c('0x3f')](_0x9d6c('0x34')));_0x89a42b+=','+_0x1201f4+'internal';}return _0x89a42b;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x331909,_0x8843cb){var _0x3bde57=_0x331909[_0x9d6c('0x40')](function(_0x302410,_0xa1625b){if(_0x302410[_0x9d6c('0x37')]===_0xa1625b[_0x9d6c('0x37')]){if(_0x302410[_0x9d6c('0x37')]===_0x9d6c('0x12')){if(_0x8843cb===_0x9d6c('0x3c')){return(_0x302410[_0x9d6c('0x41')]||'')<(_0xa1625b[_0x9d6c('0x41')]||'')||_0x302410['fullname'][_0x9d6c('0x42')]()>_0xa1625b[_0x9d6c('0x34')][_0x9d6c('0x42')]()?0x1:-0x1;}else{return(_0x302410[_0x9d6c('0x41')]||'')<(_0xa1625b[_0x9d6c('0x41')]||'')||_0x302410[_0x9d6c('0x34')][_0x9d6c('0x42')]()>_0xa1625b[_0x9d6c('0x34')][_0x9d6c('0x42')]()?-0x1:0x1;}}else{if(_0x8843cb===_0x9d6c('0x3c')){return _0x302410[_0x9d6c('0x34')][_0x9d6c('0x42')]()<_0xa1625b[_0x9d6c('0x34')]['toLowerCase']()?0x1:-0x1;}else{return _0x302410[_0x9d6c('0x34')][_0x9d6c('0x42')]()<_0xa1625b[_0x9d6c('0x34')][_0x9d6c('0x42')]()?-0x1:0x1;}}}else{if(_0x8843cb===_0x9d6c('0x3c')){return _0x302410[_0x9d6c('0x37')]<_0xa1625b[_0x9d6c('0x37')]?0x1:-0x1;}else{return _0x302410[_0x9d6c('0x37')]<_0xa1625b[_0x9d6c('0x37')]?-0x1:0x1;}}});return _0x3bde57;}exports[_0x9d6c('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x306f5f){var _0xebb4e4=[_0x9d6c('0x44'),_0x9d6c('0x45'),_0x9d6c('0x46'),_0x9d6c('0x47'),_0x9d6c('0x41'),_0x9d6c('0x47'),'internal',_0x9d6c('0x48'),_0x9d6c('0x4'),_0x9d6c('0x6'),_0x9d6c('0x35'),'smsPause',_0x9d6c('0x8'),_0x9d6c('0x5'),'voicePause','chatCapacity',_0x9d6c('0x49'),_0x9d6c('0x4a'),_0x9d6c('0x4b'),'whatsappCapacity','faxCapacity',_0x9d6c('0x4c'),'openchannelCurrentCapacity',_0x9d6c('0x4d'),'smsCurrentCapacity','whatsappCurrentCapacity',_0x9d6c('0x4e'),_0x9d6c('0x13'),_0x9d6c('0x16'),_0x9d6c('0x15'),_0x9d6c('0x17'),_0x9d6c('0x18'),'faxStatus','voiceStatus',_0x9d6c('0x4f'),'openchannelStatusTime',_0x9d6c('0x50'),'smsStatusTime',_0x9d6c('0x51'),'faxStatusTime',_0x9d6c('0x52'),_0x9d6c('0x53'),_0x9d6c('0x54'),'screenrecording',_0x9d6c('0x55'),_0x9d6c('0x56'),'routealias'];var _0x488cf1=[_0x9d6c('0x4'),'openchannelPause',_0x9d6c('0x35'),_0x9d6c('0x7'),_0x9d6c('0x8'),_0x9d6c('0x5'),_0x9d6c('0x11'),_0x9d6c('0x45')];var _0x11701b=_(_0x306f5f)['omit'](_0x488cf1)[_0x9d6c('0x57')](_0xebb4e4)['value']();return _0x11701b;}exports[_0x9d6c('0x58')]=filterAgentAttributes; \ No newline at end of file +var _0x90e1=['every','length','idle','unknown','unavailable','voiceStatus','voicePause','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','*pause','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','uniq','value','getAgentIdsByQueues','filter','includes','busy','getAgentIdsByStatus','resolve','findAll','fullname','pauseType','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','openchannelPause','chatCapacity','openchannelCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','whatsappPause'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0x90e1,0x1c2));var _0x190e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x90e1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x190e('0x0'));var jayson=require(_0x190e('0x1'));var db=require(_0x190e('0x2'))['db'];var amiClient=jayson[_0x190e('0x3')][_0x190e('0x4')]({'port':0x232a});var routingClient=jayson[_0x190e('0x3')][_0x190e('0x4')]({'port':0x232c});function isAgentPaused(_0x9d40c3,_0x28cafb){var _0x83fb06=[_0x9d40c3[_0x190e('0x5')],_0x9d40c3[_0x190e('0x6')],_0x9d40c3[_0x190e('0x7')],_0x9d40c3['openchannelPause'],_0x9d40c3[_0x190e('0x8')],_0x9d40c3['voicePause'],_0x9d40c3[_0x190e('0x9')]];if(!_0x28cafb)return _[_0x190e('0xa')](_0x83fb06);var _0x1f0e4c=_['filter'](_0x83fb06);return _0x1f0e4c[_0x190e('0xb')]>0x0&&_0x1f0e4c[_0x190e('0xb')]<_0x83fb06['length']?!![]:![];}function isIdle(_0x20d6f6){return _0x20d6f6===_0x190e('0xc')||_0x20d6f6===_0x190e('0xd')||_0x20d6f6===_0x190e('0xe')||_0x20d6f6==='ringing'||_['isNil'](_0x20d6f6);}function isAgentIdle(_0xb1ae0d){if(_0xb1ae0d[_0x190e('0xf')]!==_0x190e('0xc')&&_0xb1ae0d[_0x190e('0x10')]){_0xb1ae0d['voiceStatus']=_0x190e('0x11');return![];}return _[_0x190e('0xa')]([_0xb1ae0d[_0x190e('0x12')],_0xb1ae0d[_0x190e('0x13')],_0xb1ae0d['mailStatus'],_0xb1ae0d[_0x190e('0x14')],_0xb1ae0d[_0x190e('0x15')],_0xb1ae0d['voiceStatus'],_0xb1ae0d[_0x190e('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x190e('0x17'),{})[_0x190e('0x18')](function(_0x447bf2){if(_0x447bf2[_0x190e('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x24a4b6=_0x447bf2[_0x190e('0x1a')];return routingClient['request'](_0x190e('0x17'),{})[_0x190e('0x18')](function(_0x57fb3c){if(_0x57fb3c[_0x190e('0x19')]){throw new Error(_0x190e('0x1b'));}var _0x318fb3=_0x57fb3c[_0x190e('0x1a')];return _[_0x190e('0x1c')]({},_0x24a4b6,_0x318fb3);});})[_0x190e('0x1d')](function(_0x2f4333){throw _0x2f4333;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4a6ceb){var _0x2afe8c='unknown';if(isAgentPaused(_0x4a6ceb))_0x2afe8c=_0x190e('0x11');else if(isAgentPaused(_0x4a6ceb,!![]))_0x2afe8c=_0x190e('0x1e');else if(isAgentIdle(_0x4a6ceb))_0x2afe8c=_0x190e('0xc');else _0x2afe8c='busy';return _0x2afe8c;}exports[_0x190e('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x51149f,_0x100c38){var _0xb3534a=_[_0x190e('0x20')](_0x51149f)?_0x51149f:[_0x51149f];var _0x38d96b=_[_0x190e('0x21')](_0x100c38)+_0x190e('0x22');var _0x1e8eba=_[_0x190e('0x23')](_0xb3534a,function(_0x46de73){return db[_0x38d96b][_0x190e('0x24')]({'where':{'id':_0x46de73}})[_0x190e('0x18')](function(_0x35f5d1){if(!_0x35f5d1)return[];return _0x35f5d1[_0x190e('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x190e('0x26')](_0x1e8eba)[_0x190e('0x18')](function(_0x1e19f0){var _0x4e3262=_(_0x1e19f0)['flatten']()[_0x190e('0x23')]('id')[_0x190e('0x27')]()[_0x190e('0x28')]();return _0x4e3262;});}exports[_0x190e('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x445bd7,_0x25f1de,_0x576be2){try{if(_0x25f1de['length']>0x0){_0x445bd7=_0x445bd7[_0x190e('0x2a')](function(_0x5e462c){return _0x25f1de[_0x190e('0x2b')](_0x5e462c['id']);});}var _0x59d9d9=_0x445bd7[_0x190e('0x2a')](function(_0x520c16){var _0x10e516=_0x190e('0x2c');if(isAgentIdle(_0x520c16)){_0x10e516='idle';}return _0x10e516===_0x576be2;});return _[_0x190e('0x23')](_0x59d9d9,'id');}catch(_0xade915){throw _0xade915;}}exports[_0x190e('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x23ea94,_0x249806,_0x5eb90e){return Promise[_0x190e('0x2e')]()[_0x190e('0x18')](function(){if(_0x249806['length']>0x0){_0x23ea94=_0x23ea94['filter'](function(_0x45c5ad){return _0x249806[_0x190e('0x2b')](_0x45c5ad['id']);});}return _0x23ea94;})['then'](function(){return db['User'][_0x190e('0x2f')]({'attributes':['id','name',_0x190e('0x30'),_0x190e('0x5'),_0x190e('0x6'),_0x190e('0x7'),'openchannelPause',_0x190e('0x8'),'voicePause',_0x190e('0x9'),_0x190e('0x31')],'where':{'id':{'$in':_[_0x190e('0x23')](_0x23ea94,'id')}},'raw':!![]});})[_0x190e('0x18')](function(_0x26ffa7){return _0x26ffa7[_0x190e('0x23')](function(_0x58fe54){var _0x1173d1=_['find'](_0x23ea94,['id',_0x58fe54['id']]);var _0x513fd7=filterAgentAttributes(_0x1173d1);_[_0x190e('0x1c')](_0x58fe54,_0x513fd7);_0x58fe54[_0x190e('0x32')]=getAgentStatus(_0x58fe54);return _0x58fe54;});})[_0x190e('0x18')](function(_0x228823){var _0x112559=sortAgentsByStatus(_0x228823,_0x5eb90e);return _[_0x190e('0x23')](_0x112559,'id');})[_0x190e('0x1d')](function(_0x1b41dc){throw _0x1b41dc;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x60fa9b){var _0x2e37fa={'fields':[],'order':null};var _0x3def38=_0x60fa9b[_0x190e('0x33')](',');_0x2e37fa[_0x190e('0x34')]=_[_0x190e('0x2a')](_0x3def38,function(_0xd62fee){if(!_0xd62fee[_0x190e('0x2b')](_0x190e('0x32'))){return!![];}_0x2e37fa[_0x190e('0x35')]=_[_0x190e('0x36')](_0xd62fee,'-')?_0x190e('0x37'):_0x190e('0x38');return![];});return _0x2e37fa;}exports[_0x190e('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x226d72){if(_0x226d72[_0x190e('0x2b')]('fullname')&&!_0x226d72[_0x190e('0x2b')](_0x190e('0x3a'))){var _0x16142b=_0x226d72[_0x190e('0x3b')](0x0,_0x226d72['indexOf'](_0x190e('0x30')));_0x226d72+=','+_0x16142b+_0x190e('0x3a');}return _0x226d72;}exports[_0x190e('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0xca9ef3,_0x21dc7a){var _0x175faa=_0xca9ef3[_0x190e('0x3d')](function(_0x2cd5d3,_0x26f9d1){if(_0x2cd5d3[_0x190e('0x32')]===_0x26f9d1[_0x190e('0x32')]){if(_0x2cd5d3['globalStatus']===_0x190e('0x11')){if(_0x21dc7a==='DESC'){return(_0x2cd5d3['pauseType']||'')<(_0x26f9d1['pauseType']||'')||_0x2cd5d3[_0x190e('0x30')][_0x190e('0x3e')]()>_0x26f9d1['fullname'][_0x190e('0x3e')]()?0x1:-0x1;}else{return(_0x2cd5d3['pauseType']||'')<(_0x26f9d1[_0x190e('0x31')]||'')||_0x2cd5d3[_0x190e('0x30')][_0x190e('0x3e')]()>_0x26f9d1[_0x190e('0x30')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x21dc7a===_0x190e('0x37')){return _0x2cd5d3['fullname'][_0x190e('0x3e')]()<_0x26f9d1[_0x190e('0x30')][_0x190e('0x3e')]()?0x1:-0x1;}else{return _0x2cd5d3[_0x190e('0x30')]['toLowerCase']()<_0x26f9d1[_0x190e('0x30')][_0x190e('0x3e')]()?-0x1:0x1;}}}else{if(_0x21dc7a===_0x190e('0x37')){return _0x2cd5d3['globalStatus']<_0x26f9d1[_0x190e('0x32')]?0x1:-0x1;}else{return _0x2cd5d3[_0x190e('0x32')]<_0x26f9d1[_0x190e('0x32')]?-0x1:0x1;}}});return _0x175faa;}exports[_0x190e('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x23879e){var _0x3bbb27=[_0x190e('0x40'),'online',_0x190e('0x41'),_0x190e('0x42'),_0x190e('0x31'),_0x190e('0x42'),_0x190e('0x3a'),_0x190e('0x43'),_0x190e('0x5'),_0x190e('0x44'),_0x190e('0x7'),_0x190e('0x8'),_0x190e('0x9'),'faxPause',_0x190e('0x10'),_0x190e('0x45'),_0x190e('0x46'),'mailCapacity','smsCapacity',_0x190e('0x47'),_0x190e('0x48'),'chatCurrentCapacity',_0x190e('0x49'),_0x190e('0x4a'),_0x190e('0x4b'),'whatsappCurrentCapacity','faxCurrentCapacity',_0x190e('0x12'),'openchannelStatus',_0x190e('0x4c'),_0x190e('0x15'),_0x190e('0x16'),'faxStatus',_0x190e('0xf'),_0x190e('0x4d'),_0x190e('0x4e'),_0x190e('0x4f'),'smsStatusTime',_0x190e('0x50'),_0x190e('0x51'),_0x190e('0x52'),_0x190e('0x53'),_0x190e('0x54'),_0x190e('0x55'),_0x190e('0x56'),_0x190e('0x57'),_0x190e('0x58')];var _0x475a46=[_0x190e('0x5'),'openchannelPause',_0x190e('0x7'),_0x190e('0x8'),_0x190e('0x9'),_0x190e('0x6'),'voicePause','online'];var _0x475a4a=_(_0x23879e)[_0x190e('0x59')](_0x475a46)[_0x190e('0x5a')](_0x3bbb27)[_0x190e('0x28')]();return _0x475a4a;}exports[_0x190e('0x5b')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 224b7be..0f0c8bd 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 _0x5f16=['jayson/promise','util','client','http','available','loggedIn','waiting','busy','invalid','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','message','statusMessage','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','voice','inbound','concat','outbound','map','paused','loggedInDb','originated','merge','initializeQueues'];(function(_0x3cfac0,_0x34c12a){var _0x468efb=function(_0x13cc66){while(--_0x13cc66){_0x3cfac0['push'](_0x3cfac0['shift']());}};_0x468efb(++_0x34c12a);}(_0x5f16,0xcc));var _0x65f1=function(_0x3f3217,_0x3d3ace){_0x3f3217=_0x3f3217-0x0;var _0x9b187e=_0x5f16[_0x3f3217];return _0x9b187e;};'use strict';var _=require('lodash');var jayson=require(_0x65f1('0x0'));var util=require(_0x65f1('0x1'));var amiClient=jayson[_0x65f1('0x2')][_0x65f1('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x65f1('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x65f1('0x4'),_0x65f1('0x5'),'paused',_0x65f1('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x65f1('0x7'),'inUse',_0x65f1('0x8'),'loggedInDb',_0x65f1('0x9'),_0x65f1('0xa'),'ringing',_0x65f1('0xb'),_0x65f1('0xc'),_0x65f1('0xd'),_0x65f1('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x65f1('0xf'),'originated',_0x65f1('0x10'),_0x65f1('0x11'),_0x65f1('0x12'),'dialMethod',_0x65f1('0x13'),_0x65f1('0x14'),_0x65f1('0x15'),_0x65f1('0x16'),_0x65f1('0x17'),_0x65f1('0x18'),_0x65f1('0x19'),_0x65f1('0x1a'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x65f1('0x1b'),_0x65f1('0x1c'),_0x65f1('0x1d'),_0x65f1('0x1e'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x65f1('0x1f')];function getRealtimeQueues(_0x2d7f24,_0x22db8f){var _0x38e7f2=_0x22db8f==='voice'?amiClient:routingClient;return _0x38e7f2[_0x65f1('0x20')](_[_0x65f1('0x21')](_0x22db8f)+_0x65f1('0x22'),_0x2d7f24)['then'](function(_0x3bcd7c){if(_0x3bcd7c[_0x65f1('0x23')])throw new Error(util[_0x65f1('0x24')](_0x65f1('0x25'),_0x22db8f));return _0x3bcd7c[_0x65f1('0x26')];})[_0x65f1('0x27')](function(_0x3de3a6){throw _0x3de3a6;});}exports[_0x65f1('0x28')]=getRealtimeQueues;function initializeQueues(_0x1d85ee,_0x2983fc,_0x3ca4d0,_0x1015a4){var _0x62fcc8=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3ca4d0===_0x65f1('0x29')){if(_0x1015a4===_0x65f1('0x2a')){_0x62fcc8=_0x62fcc8[_0x65f1('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1015a4===_0x65f1('0x2c')){_0x62fcc8=_0x62fcc8['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1d85ee[_0x65f1('0x2d')](function(_0x4355d2){var _0x29630f=_0x4355d2['get']({'plain':!![]});_0x29630f[_0x65f1('0x2e')]=0x0;_0x29630f[_0x65f1('0x2f')]=0x0;_0x29630f[_0x65f1('0x5')]=0x0;_0x29630f[_0x65f1('0x4')]=0x0;_0x29630f[_0x65f1('0x6')]=0x0;if(_0x3ca4d0===_0x65f1('0x29')){_0x29630f['talking']=0x0;_0x29630f[_0x65f1('0x7')]=0x0;if(_0x1015a4===_0x65f1('0x2c')){_0x29630f['pTalking']=0x0;_0x29630f[_0x65f1('0x30')]=0x0;}}var _0x35a187=_['find'](_0x2983fc,['id',_0x29630f['id']]);if(_0x35a187){_[_0x65f1('0x31')](_0x29630f,_['pick'](_0x35a187,_0x62fcc8));}return _0x29630f;});}exports[_0x65f1('0x32')]=initializeQueues; \ No newline at end of file +var _0x42ec=['map','get','loggedInDb','find','lodash','jayson/promise','util','client','available','loggedIn','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','concat','outbound'];(function(_0xf4add4,_0x5b9cc1){var _0x1c42fb=function(_0x2674c1){while(--_0x2674c1){_0xf4add4['push'](_0xf4add4['shift']());}};_0x1c42fb(++_0x5b9cc1);}(_0x42ec,0x169));var _0xc42e=function(_0x38c9b0,_0x11b555){_0x38c9b0=_0x38c9b0-0x0;var _0x306434=_0x42ec[_0x38c9b0];return _0x306434;};'use strict';var _=require(_0xc42e('0x0'));var jayson=require(_0xc42e('0x1'));var util=require(_0xc42e('0x2'));var amiClient=jayson[_0xc42e('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xc42e('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xc42e('0x4'),_0xc42e('0x5'),_0xc42e('0x6'),_0xc42e('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xc42e('0x8'),_0xc42e('0x9'),_0xc42e('0xa'),'loggedInDb',_0xc42e('0xb'),_0xc42e('0xc'),_0xc42e('0xd'),_0xc42e('0xe'),_0xc42e('0xf'),_0xc42e('0x10'),_0xc42e('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xc42e('0x12'),_0xc42e('0x13'),_0xc42e('0x14'),_0xc42e('0x15'),_0xc42e('0x16'),_0xc42e('0x17'),_0xc42e('0x18'),'startPredictive',_0xc42e('0x19'),_0xc42e('0x1a'),'erlangCallToSecond',_0xc42e('0x1b'),'erlangBusyFactor',_0xc42e('0x1c'),_0xc42e('0x1d'),_0xc42e('0x1e'),_0xc42e('0x1f'),_0xc42e('0x20'),_0xc42e('0x21'),_0xc42e('0x22'),'predictiveIntervalDroppedCallsCallersExit',_0xc42e('0x23'),_0xc42e('0x24')];function getRealtimeQueues(_0x1058d6,_0x218801){var _0x4a1e16=_0x218801===_0xc42e('0x25')?amiClient:routingClient;return _0x4a1e16['request'](_[_0xc42e('0x26')](_0x218801)+_0xc42e('0x27'),_0x1058d6)[_0xc42e('0x28')](function(_0x5033f2){if(_0x5033f2['error'])throw new Error(util['format'](_0xc42e('0x29'),_0x218801));return _0x5033f2[_0xc42e('0x2a')];})[_0xc42e('0x2b')](function(_0x3aa15e){throw _0x3aa15e;});}exports[_0xc42e('0x2c')]=getRealtimeQueues;function initializeQueues(_0x182220,_0x1884de,_0x4d7c9e,_0x137b32){var _0xfb761f=DEFAULT_QUEUE_ATTRIBUTES;if(_0x4d7c9e===_0xc42e('0x25')){if(_0x137b32==='inbound'){_0xfb761f=_0xfb761f[_0xc42e('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x137b32===_0xc42e('0x2e')){_0xfb761f=_0xfb761f[_0xc42e('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x182220[_0xc42e('0x2f')](function(_0x4240d9){var _0x469375=_0x4240d9[_0xc42e('0x30')]({'plain':!![]});_0x469375[_0xc42e('0x6')]=0x0;_0x469375[_0xc42e('0x31')]=0x0;_0x469375[_0xc42e('0x5')]=0x0;_0x469375[_0xc42e('0x4')]=0x0;_0x469375['waiting']=0x0;if(_0x4d7c9e===_0xc42e('0x25')){_0x469375[_0xc42e('0xf')]=0x0;_0x469375[_0xc42e('0x8')]=0x0;if(_0x137b32===_0xc42e('0x2e')){_0x469375[_0xc42e('0x12')]=0x0;_0x469375['originated']=0x0;}}var _0x4dae48=_[_0xc42e('0x32')](_0x1884de,['id',_0x469375['id']]);if(_0x4dae48){_['merge'](_0x469375,_['pick'](_0x4dae48,_0xfb761f));}return _0x469375;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 11076b2..703b144 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(_0x492e32,_0x2e0a93){var _0x4a335e=function(_0x1f4998){while(--_0x1f4998){_0x492e32['push'](_0x492e32['shift']());}};_0x4a335e(++_0x2e0a93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x2ed88f,_0x5bc5ae){var _0x17ca96=function(_0x2be0dc){while(--_0x2be0dc){_0x2ed88f['push'](_0x2ed88f['shift']());}};_0x17ca96(++_0x5bc5ae);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 910a71f..f0d8352 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 _0xa625=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','createHash','md5','digest','hex','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','update','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','keys','length','filter'];(function(_0x5c8256,_0x34ade5){var _0x2a244b=function(_0x4571d4){while(--_0x4571d4){_0x5c8256['push'](_0x5c8256['shift']());}};_0x2a244b(++_0x34ade5);}(_0xa625,0xc9));var _0x5a62=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa625[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x5a62('0x0'));var machine=require(_0x5a62('0x1'));var exec=require(_0x5a62('0x2'))[_0x5a62('0x3')];var config=require(_0x5a62('0x4'));function getInterfaces(){var _0x140b65=[];var _0x1aa2ec=os['networkInterfaces']();var _0x2275a3=_[_0x5a62('0x5')](_[_0x5a62('0x6')](_0x1aa2ec));for(var _0x3c6ccd=0x0;_0x3c6ccd<_0x2275a3[_0x5a62('0x7')];_0x3c6ccd++){var _0x43576f=_0x1aa2ec[_0x2275a3[_0x3c6ccd]][_0x5a62('0x8')](function(_0x541b8c){return _0x541b8c['family']==='IPv4'&&_0x541b8c['internal']===![];});_0x140b65=_0x140b65[_0x5a62('0x9')](_0x43576f);}return _0x140b65;}function getFirstInterface(){var _0x41d79b=_[_0x5a62('0xa')](getInterfaces());return{'macAddress':_0x41d79b&&_0x41d79b[_0x5a62('0xb')]?_0x41d79b[_0x5a62('0xb')]:_0x5a62('0xc'),'ipAddress':_0x41d79b&&_0x41d79b[_0x5a62('0xd')]?_0x41d79b['address']:_0x5a62('0xe')};}exports[_0x5a62('0xf')]=getFirstInterface;function getCPUhash(){var _0x41a6aa=_[_0x5a62('0x5')](os['cpus']()[_0x5a62('0x10')](function(_0x5e9162){return _0x5e9162['model'];}))['join'](':');return crypto[_0x5a62('0x11')](_0x5a62('0x12'))['update'](_0x41a6aa)[_0x5a62('0x13')](_0x5a62('0x14'));}exports['getUuid']=function(){var _0x4e73ba=os['platform']();var _0x71e248=/[0-9a-f-]{36}/;if(config[_0x5a62('0x15')]&&_0x71e248[_0x5a62('0x16')](config[_0x5a62('0x15')])){return config[_0x5a62('0x15')];}else if(_0x4e73ba==='win32'){return exec(_0x5a62('0x17'),{'encoding':_0x5a62('0x18')})[_0x5a62('0x19')]('\x0d\x0a','');}else{var _0x47c046=getFirstInterface();var _0x4ccabf=getCPUhash();var _0xbbeffd=_0x4ccabf+'|'+os[_0x5a62('0x1a')]()+'|'+_0x47c046[_0x5a62('0x1b')]+'|'+_0x47c046['ipAddress'];var _0x3a0933=crypto['createHash'](_0x5a62('0x12'))[_0x5a62('0x1c')](_0xbbeffd)[_0x5a62('0x13')]('hex');return _0x3a0933[_0x5a62('0x1d')](0x0,0x8)+'-'+_0x3a0933[_0x5a62('0x1d')](0x8,0xc)+'-'+_0x3a0933[_0x5a62('0x1d')](0xc,0x10)+'-'+_0x3a0933['substring'](0x10,0x14)+'-'+_0x3a0933[_0x5a62('0x1d')](0x14);}}; \ No newline at end of file +var _0x1966=['family','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','../environment','orderBy','keys','length','filter'];(function(_0x501e6d,_0x43ce8e){var _0x545ff9=function(_0x5e0bf2){while(--_0x5e0bf2){_0x501e6d['push'](_0x501e6d['shift']());}};_0x545ff9(++_0x43ce8e);}(_0x1966,0x100));var _0x6196=function(_0x59275a,_0x2c9075){_0x59275a=_0x59275a-0x0;var _0x518ecd=_0x1966[_0x59275a];return _0x518ecd;};'use strict';var _=require(_0x6196('0x0'));var os=require('os');var crypto=require(_0x6196('0x1'));var machine=require(_0x6196('0x2'));var exec=require('child_process')['execSync'];var config=require(_0x6196('0x3'));function getInterfaces(){var _0x1ae818=[];var _0x1e30c2=os['networkInterfaces']();var _0x319745=_[_0x6196('0x4')](_[_0x6196('0x5')](_0x1e30c2));for(var _0x37c94e=0x0;_0x37c94e<_0x319745[_0x6196('0x6')];_0x37c94e++){var _0x16eadb=_0x1e30c2[_0x319745[_0x37c94e]][_0x6196('0x7')](function(_0x392fcc){return _0x392fcc[_0x6196('0x8')]==='IPv4'&&_0x392fcc[_0x6196('0x9')]===![];});_0x1ae818=_0x1ae818['concat'](_0x16eadb);}return _0x1ae818;}function getFirstInterface(){var _0x2d0044=_['head'](getInterfaces());return{'macAddress':_0x2d0044&&_0x2d0044[_0x6196('0xa')]?_0x2d0044[_0x6196('0xa')]:_0x6196('0xb'),'ipAddress':_0x2d0044&&_0x2d0044[_0x6196('0xc')]?_0x2d0044[_0x6196('0xc')]:_0x6196('0xd')};}exports[_0x6196('0xe')]=getFirstInterface;function getCPUhash(){var _0x1c0604=_[_0x6196('0x4')](os[_0x6196('0xf')]()['map'](function(_0x3a3688){return _0x3a3688[_0x6196('0x10')];}))[_0x6196('0x11')](':');return crypto[_0x6196('0x12')](_0x6196('0x13'))[_0x6196('0x14')](_0x1c0604)[_0x6196('0x15')](_0x6196('0x16'));}exports[_0x6196('0x17')]=function(){var _0x2d4b18=os[_0x6196('0x18')]();var _0x34216f=/[0-9a-f-]{36}/;if(config[_0x6196('0x19')]&&_0x34216f[_0x6196('0x1a')](config[_0x6196('0x19')])){return config['licenseToken'];}else if(_0x2d4b18===_0x6196('0x1b')){return exec(_0x6196('0x1c'),{'encoding':'utf8'})[_0x6196('0x1d')]('\x0d\x0a','');}else{var _0x1580ae=getFirstInterface();var _0x325664=getCPUhash();var _0x3cd8dd=_0x325664+'|'+os[_0x6196('0x1e')]()+'|'+_0x1580ae['macAddress']+'|'+_0x1580ae[_0x6196('0x1f')];var _0x59a1f7=crypto[_0x6196('0x12')](_0x6196('0x13'))[_0x6196('0x14')](_0x3cd8dd)[_0x6196('0x15')](_0x6196('0x16'));return _0x59a1f7['substring'](0x0,0x8)+'-'+_0x59a1f7['substring'](0x8,0xc)+'-'+_0x59a1f7[_0x6196('0x20')](0xc,0x10)+'-'+_0x59a1f7['substring'](0x10,0x14)+'-'+_0x59a1f7['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d481a78..b70c2b1 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 _0x7d7a=['moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','../logger','https://www.xcallymotion.com','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','data2','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','findOrCreate','default','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d7a,0x109));var _0xa7d7=function(_0x5b20b5,_0x4b485e){_0x5b20b5=_0x5b20b5-0x0;var _0x1d8fd8=_0x7d7a[_0x5b20b5];return _0x1d8fd8;};'use strict';var util=require(_0xa7d7('0x0'));var moment=require(_0xa7d7('0x1'));var rp=require(_0xa7d7('0x2'));var BPromise=require(_0xa7d7('0x3'));var pkginfo=require(_0xa7d7('0x4'))(module,_0xa7d7('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xa7d7('0x6'));var hardware=require('./hardware');var logger=require(_0xa7d7('0x7'))('license');var HOST=_0xa7d7('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x43c57b){return new BPromise(function(_0x49998e,_0x2b920c){var _0x776019=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x43c57b,module[_0xa7d7('0x9')]['version']);if(oldToken){_0x776019=util[_0xa7d7('0xa')](_0xa7d7('0xb'),HOST,_0x43c57b,module['exports']['version'],oldToken);}var _0x4daaad={'uri':_0x776019,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4daaad)['then'](function(_0x5b522b){_0x49998e(_0x5b522b);})[_0xa7d7('0xc')](function(_0x2f8b91){_0x2b920c(_0x2f8b91);});});}function manageLicense(_0x485270,_0x2cc37e){var _0x27b31c=_0x2cc37e[_0xa7d7('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x27b31c[_0xa7d7('0xe')]!==_0x485270&&!_0x27b31c[_0xa7d7('0xf')]){oldToken=_0x27b31c[_0xa7d7('0xe')];}httpRequest(_0x485270)['then'](function(_0x433e65){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x433e65['active']){isOldTokenSent=![];if(!_0x27b31c[_0xa7d7('0x10')]&&_0x27b31c[_0xa7d7('0x10')]!=_0x433e65[_0xa7d7('0x10')]||_0x27b31c[_0xa7d7('0x10')]&&_0x27b31c['data2']){logger[_0xa7d7('0x11')](_0xa7d7('0x12'));}if(_0x27b31c[_0xa7d7('0x10')]&&!_0x27b31c[_0xa7d7('0xf')]&&_0x27b31c['license']!=_0x433e65[_0xa7d7('0x10')]){logger[_0xa7d7('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x27b31c['license']&&!_0x27b31c[_0xa7d7('0xf')]&&_0x27b31c[_0xa7d7('0x10')]==_0x433e65['license']){return _0x2cc37e;}return _0x2cc37e[_0xa7d7('0x13')]({'data1':_0x485270,'data2':null,'license':_0x433e65[_0xa7d7('0x10')]});}else{if(_0x433e65[_0xa7d7('0x10')]||_0x27b31c['license']){if(!_0x27b31c[_0xa7d7('0xf')]){if(_0x27b31c['data1']==_0x485270){GRAY_PERIOD_REASON=_0xa7d7('0x14');logger[_0xa7d7('0x11')](_0xa7d7('0x15'));}else{GRAY_PERIOD_REASON=_0xa7d7('0x16');logger[_0xa7d7('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x27b31c[_0xa7d7('0xe')],_0x485270);}logger[_0xa7d7('0x11')](_0xa7d7('0x17'),GRAY_PERIOD_REASON[_0xa7d7('0x18')](),moment()[_0xa7d7('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x2cc37e[_0xa7d7('0x13')]({'data2':encryptor[_0xa7d7('0x19')](moment()[_0xa7d7('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xa7d7('0x1a')](encryptor[_0xa7d7('0x1b')](_0x27b31c[_0xa7d7('0xf')]),_0xa7d7('0x1c'))>DAYS){logger['info'](_0xa7d7('0x1d'),moment()[_0xa7d7('0xa')](_0xa7d7('0x1e')));isOldTokenSent=![];return _0x2cc37e[_0xa7d7('0x13')]({'data1':_0x485270,'data2':null,'license':null});}}}else{if(_0x27b31c[_0xa7d7('0xe')]!=_0x485270){logger[_0xa7d7('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x27b31c[_0xa7d7('0xe')],_0x485270);return _0x2cc37e[_0xa7d7('0x13')]({'data1':_0x485270,'data2':null,'license':null});}}}return _0x2cc37e;})['then'](function(_0x296e36){_0x2cc37e=_0x296e36;})['catch'](function(_0x1bed1a){logger[_0xa7d7('0x1f')](_0x1bed1a[_0xa7d7('0x20')]);})[_0xa7d7('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x2cc37e);},TIME);});}function defaultLicense(){var _0x5cda20=hardware[_0xa7d7('0x22')]();if(_0x5cda20){return db[_0xa7d7('0x23')][_0xa7d7('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x5cda20}})['spread'](function(_0xef9291,_0x4e57a7){logger[_0xa7d7('0x11')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x5cda20);manageLicense(_0x5cda20,_0xef9291);})[_0xa7d7('0xc')](function(_0x1fd29c){logger[_0xa7d7('0x1f')](_0x1fd29c[_0xa7d7('0x20')]);});}}exports[_0xa7d7('0x25')]=defaultLicense; \ No newline at end of file +var _0x830b=['%s/api/servers/%s/check?version=%s','exports','GET','catch','get','data1','data2','then','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','version','../../mysqldb','../../components/encryptor','../logger','https://www.xcallymotion.com','format'];(function(_0x3bebbd,_0x207791){var _0x214caa=function(_0x1b8b55){while(--_0x1b8b55){_0x3bebbd['push'](_0x3bebbd['shift']());}};_0x214caa(++_0x207791);}(_0x830b,0x15f));var _0xb830=function(_0x3a3831,_0x2618a1){_0x3a3831=_0x3a3831-0x0;var _0x43bea7=_0x830b[_0x3a3831];return _0x43bea7;};'use strict';var util=require(_0xb830('0x0'));var moment=require(_0xb830('0x1'));var rp=require(_0xb830('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xb830('0x3'));var db=require(_0xb830('0x4'))['db'];var encryptor=require(_0xb830('0x5'));var hardware=require('./hardware');var logger=require(_0xb830('0x6'))('license');var HOST=_0xb830('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2a01f4){return new BPromise(function(_0x10f689,_0x217d5b){var _0x27c61b=util[_0xb830('0x8')](_0xb830('0x9'),HOST,_0x2a01f4,module['exports'][_0xb830('0x3')]);if(oldToken){_0x27c61b=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2a01f4,module[_0xb830('0xa')][_0xb830('0x3')],oldToken);}var _0x9285fb={'uri':_0x27c61b,'method':_0xb830('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x9285fb)['then'](function(_0x5e9702){_0x10f689(_0x5e9702);})[_0xb830('0xc')](function(_0x222a4d){_0x217d5b(_0x222a4d);});});}function manageLicense(_0x3874d8,_0x5e349e){var _0x7c79ac=_0x5e349e[_0xb830('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x7c79ac[_0xb830('0xe')]!==_0x3874d8&&!_0x7c79ac[_0xb830('0xf')]){oldToken=_0x7c79ac['data1'];}httpRequest(_0x3874d8)[_0xb830('0x10')](function(_0x4bc205){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4bc205['active']){isOldTokenSent=![];if(!_0x7c79ac[_0xb830('0x11')]&&_0x7c79ac['license']!=_0x4bc205[_0xb830('0x11')]||_0x7c79ac[_0xb830('0x11')]&&_0x7c79ac[_0xb830('0xf')]){logger[_0xb830('0x12')](_0xb830('0x13'));}if(_0x7c79ac[_0xb830('0x11')]&&!_0x7c79ac[_0xb830('0xf')]&&_0x7c79ac['license']!=_0x4bc205['license']){logger[_0xb830('0x12')](_0xb830('0x14'));}if(_0x7c79ac[_0xb830('0x11')]&&!_0x7c79ac[_0xb830('0xf')]&&_0x7c79ac[_0xb830('0x11')]==_0x4bc205['license']){return _0x5e349e;}return _0x5e349e[_0xb830('0x15')]({'data1':_0x3874d8,'data2':null,'license':_0x4bc205[_0xb830('0x11')]});}else{if(_0x4bc205[_0xb830('0x11')]||_0x7c79ac[_0xb830('0x11')]){if(!_0x7c79ac[_0xb830('0xf')]){if(_0x7c79ac[_0xb830('0xe')]==_0x3874d8){GRAY_PERIOD_REASON=_0xb830('0x16');logger[_0xb830('0x12')](_0xb830('0x17'));}else{GRAY_PERIOD_REASON=_0xb830('0x18');logger['info'](_0xb830('0x19'),_0x7c79ac['data1'],_0x3874d8);}logger[_0xb830('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xb830('0x1a')](),moment()[_0xb830('0x8')](_0xb830('0x1b')));return _0x5e349e[_0xb830('0x15')]({'data2':encryptor[_0xb830('0x1c')](moment()[_0xb830('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xb830('0x1d')](encryptor[_0xb830('0x1e')](_0x7c79ac[_0xb830('0xf')]),_0xb830('0x1f'))>DAYS){logger['info'](_0xb830('0x20'),moment()[_0xb830('0x8')](_0xb830('0x1b')));isOldTokenSent=![];return _0x5e349e[_0xb830('0x15')]({'data1':_0x3874d8,'data2':null,'license':null});}}}else{if(_0x7c79ac[_0xb830('0xe')]!=_0x3874d8){logger['info'](_0xb830('0x19'),_0x7c79ac[_0xb830('0xe')],_0x3874d8);return _0x5e349e['update']({'data1':_0x3874d8,'data2':null,'license':null});}}}return _0x5e349e;})['then'](function(_0x33cfa8){_0x5e349e=_0x33cfa8;})['catch'](function(_0x384e85){logger[_0xb830('0x21')](_0x384e85['message']);})[_0xb830('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x5e349e);},TIME);});}function defaultLicense(){var _0x1761c9=hardware[_0xb830('0x23')]();if(_0x1761c9){return db['License'][_0xb830('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x1761c9}})[_0xb830('0x25')](function(_0x12b3f4,_0x4afbc7){logger[_0xb830('0x12')](_0xb830('0x26'),_0x1761c9);manageLicense(_0x1761c9,_0x12b3f4);})[_0xb830('0xc')](function(_0x35a204){logger[_0xb830('0x21')](_0x35a204['message']);});}}exports[_0xb830('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9304053..edddad7 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 _0x3b6c=['exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','parse','demo','gray','deadline','add','days','format','grayReason','uuid','machineUuid','disabled','message','User','findAll','sequelize','COUNT','col','role','count','user','forEach','pick','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x252dae,_0x47aedb){var _0x3e97fa=function(_0x279fb0){while(--_0x279fb0){_0x252dae['push'](_0x252dae['shift']());}};_0x3e97fa(++_0x47aedb);}(_0x3b6c,0x127));var _0xc3b6=function(_0x152dfc,_0x248fb6){_0x152dfc=_0x152dfc-0x0;var _0x4de60b=_0x3b6c[_0x152dfc];return _0x4de60b;};'use strict';var util=require(_0xc3b6('0x0'));var _=require(_0xc3b6('0x1'));var moment=require(_0xc3b6('0x2'));var BPromise=require(_0xc3b6('0x3'));var hardware=require(_0xc3b6('0x4'));var encryptor=require(_0xc3b6('0x5'));var db=require(_0xc3b6('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc3b6('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc3b6('0x8'),'machineUuid':hardware[_0xc3b6('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc3b6('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc3b6('0xa'),'machineUuid':hardware[_0xc3b6('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x277e74){return new BPromise(function(_0x25fd77,_0x579332){return db['License'][_0xc3b6('0xb')](_[_0xc3b6('0xc')](_0x277e74,{'raw':!![],'where':{'id':0x1}}))[_0xc3b6('0xd')](function(_0x230f33){return checkLicense(_0x230f33,null);})[_0xc3b6('0xd')](function(_0xbd90b7){_0x25fd77(_0xbd90b7);return;})[_0xc3b6('0xe')](function(_0x3e1e4c){_0x579332(_0x3e1e4c);});});}function checkLicense(_0x399fc6,_0x1bd2cd){if(!_0x399fc6){demoLicense['uuid']=_0x399fc6['data1'];return demoLicense;}try{var _0x570044=_0x1bd2cd||_0x399fc6[_0xc3b6('0xf')];if(_[_0xc3b6('0x10')](_0x570044)){throw new Error(_0xc3b6('0x11'));}var _0x38e510=_0x399fc6[_0xc3b6('0x12')];var _0x120375=_0x399fc6[_0xc3b6('0x13')];var _0x1f13d6=_0x38e510[_0xc3b6('0x14')]('-')[0x4];var _0x1ab3a8=_0x38e510[_0xc3b6('0x14')]('-')[0x0];var _0x27b6d1=encryptor[_0xc3b6('0x15')](_0x570044,util['format']('%s:%s:%s',_0x1f13d6,_0x38e510,_0x1ab3a8));var _0x2dadb7=JSON[_0xc3b6('0x16')](_0x27b6d1);_0x2dadb7[_0xc3b6('0x17')]=![];_0x2dadb7['uuid']=_0x38e510;_0x2dadb7['machineUuid']=hardware[_0xc3b6('0x9')]();if(_0x120375){var _0xb4806b=encryptor[_0xc3b6('0x15')](_0x120375);_0x2dadb7[_0xc3b6('0x18')]=_0xb4806b;_0x2dadb7[_0xc3b6('0x19')]=moment(_0xb4806b)[_0xc3b6('0x1a')](0x7,_0xc3b6('0x1b'))[_0xc3b6('0x1c')]();_0x2dadb7[_0xc3b6('0x1d')]=_0x2dadb7[_0xc3b6('0x1e')]!=_0x2dadb7[_0xc3b6('0x1f')]?'changed':_0xc3b6('0x20');}return _0x2dadb7;}catch(_0x358c3f){breakingLicense['uuid']=_0x399fc6['data1'];breakingLicense[_0xc3b6('0x21')]=_0x358c3f[_0xc3b6('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2b796f,_0x311eff){getLicense()['then'](function(_0x489345){return db[_0xc3b6('0x22')][_0xc3b6('0x23')]({'attributes':['role',[db[_0xc3b6('0x24')]['fn'](_0xc3b6('0x25'),db['sequelize'][_0xc3b6('0x26')](_0xc3b6('0x27'))),_0xc3b6('0x28')]],'group':_0xc3b6('0x27'),'where':{'role':{'$or':['admin',_0xc3b6('0x29'),'telephone']}},'raw':!![]})[_0xc3b6('0xd')](function(_0x1bf96a){var _0x4d2200={'user':_0x489345['users']||0x0,'telephone':_0x489345['telephones']||0x0};_0x1bf96a[_0xc3b6('0x2a')](function(_0x1c1e2a){var _0x16c6fd=_0x1c1e2a[_0xc3b6('0x27')]==='admin'?_0xc3b6('0x29'):_0x1c1e2a[_0xc3b6('0x27')];_0x4d2200[_0x16c6fd]-=_0x1c1e2a[_0xc3b6('0x28')];if(_0x4d2200[_0x16c6fd]<0x0)_0x4d2200[_0x16c6fd]=0x0;});_0x2b796f(_0x4d2200);return;});})[_0xc3b6('0xe')](function(_0x1c91b7){_0x311eff(_0x1c91b7);});});}function checkUserLimits(_0x1e9ed4){return new BPromise(function(_0x257ed8,_0x19bd61){getLimits()[_0xc3b6('0xd')](function(_0x13c401){var _0x50a93b=_[_0xc3b6('0x2b')](_['countBy'](_0x1e9ed4,_0xc3b6('0x27')),[_0xc3b6('0x2c'),'user',_0xc3b6('0x2d')]);var _0xfe04ee=(_0x50a93b['admin']||0x0)+(_0x50a93b[_0xc3b6('0x29')]||0x0);var _0x5c6ab0=_0x50a93b[_0xc3b6('0x2d')]||0x0;if(_0xfe04ee>_0x13c401[_0xc3b6('0x29')])return _0x19bd61(_0xc3b6('0x2e'));if(_0x5c6ab0>_0x13c401[_0xc3b6('0x2d')])return _0x19bd61(_0xc3b6('0x2f'));return _0x257ed8();})[_0xc3b6('0xe')](function(_0x1f1899){_0x19bd61(_0x1f1899);});});}module[_0xc3b6('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xcbfd=['split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','getUuid','gray','deadline','add','grayReason','changed','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','pick','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2'];(function(_0x3c2f1e,_0x1860f9){var _0x5424b1=function(_0x2b7b7b){while(--_0x2b7b7b){_0x3c2f1e['push'](_0x3c2f1e['shift']());}};_0x5424b1(++_0x1860f9);}(_0xcbfd,0xef));var _0xdcbf=function(_0x1b4dd5,_0x3d85ad){_0x1b4dd5=_0x1b4dd5-0x0;var _0x475900=_0xcbfd[_0x1b4dd5];return _0x475900;};'use strict';var util=require(_0xdcbf('0x0'));var _=require(_0xdcbf('0x1'));var moment=require(_0xdcbf('0x2'));var BPromise=require(_0xdcbf('0x3'));var hardware=require(_0xdcbf('0x4'));var encryptor=require(_0xdcbf('0x5'));var db=require(_0xdcbf('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdcbf('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdcbf('0x8'),'machineUuid':hardware['getUuid'](),'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':_0xdcbf('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5571e9){return new BPromise(function(_0x2521e9,_0x5d54b6){return db[_0xdcbf('0xa')][_0xdcbf('0xb')](_[_0xdcbf('0xc')](_0x5571e9,{'raw':!![],'where':{'id':0x1}}))[_0xdcbf('0xd')](function(_0x336c5d){return checkLicense(_0x336c5d,null);})['then'](function(_0x236fab){_0x2521e9(_0x236fab);return;})[_0xdcbf('0xe')](function(_0x47f74f){_0x5d54b6(_0x47f74f);});});}function checkLicense(_0x374541,_0x4c46d2){if(!_0x374541){demoLicense[_0xdcbf('0xf')]=_0x374541[_0xdcbf('0x10')];return demoLicense;}try{var _0x596247=_0x4c46d2||_0x374541[_0xdcbf('0x11')];if(_[_0xdcbf('0x12')](_0x596247)){throw new Error(_0xdcbf('0x13'));}var _0x100da2=_0x374541['data1'];var _0x20bf6a=_0x374541[_0xdcbf('0x14')];var _0x251da9=_0x100da2[_0xdcbf('0x15')]('-')[0x4];var _0x31607f=_0x100da2[_0xdcbf('0x15')]('-')[0x0];var _0x28f711=encryptor[_0xdcbf('0x16')](_0x596247,util[_0xdcbf('0x17')](_0xdcbf('0x18'),_0x251da9,_0x100da2,_0x31607f));var _0x62f26e=JSON[_0xdcbf('0x19')](_0x28f711);_0x62f26e[_0xdcbf('0x1a')]=![];_0x62f26e[_0xdcbf('0xf')]=_0x100da2;_0x62f26e[_0xdcbf('0x1b')]=hardware[_0xdcbf('0x1c')]();if(_0x20bf6a){var _0x133467=encryptor[_0xdcbf('0x16')](_0x20bf6a);_0x62f26e[_0xdcbf('0x1d')]=_0x133467;_0x62f26e[_0xdcbf('0x1e')]=moment(_0x133467)[_0xdcbf('0x1f')](0x7,'days')[_0xdcbf('0x17')]();_0x62f26e[_0xdcbf('0x20')]=_0x62f26e['uuid']!=_0x62f26e[_0xdcbf('0x1b')]?_0xdcbf('0x21'):'disabled';}return _0x62f26e;}catch(_0x4e13c6){breakingLicense[_0xdcbf('0xf')]=_0x374541['data1'];breakingLicense[_0xdcbf('0x22')]=_0x4e13c6['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4346ca,_0x4d1ddd){getLicense()['then'](function(_0x571a12){return db[_0xdcbf('0x23')][_0xdcbf('0x24')]({'attributes':[_0xdcbf('0x25'),[db[_0xdcbf('0x26')]['fn'](_0xdcbf('0x27'),db[_0xdcbf('0x26')][_0xdcbf('0x28')]('role')),_0xdcbf('0x29')]],'group':_0xdcbf('0x25'),'where':{'role':{'$or':[_0xdcbf('0x2a'),'user',_0xdcbf('0x2b')]}},'raw':!![]})['then'](function(_0x35c546){var _0x297773={'user':_0x571a12[_0xdcbf('0x2c')]||0x0,'telephone':_0x571a12[_0xdcbf('0x2d')]||0x0};_0x35c546[_0xdcbf('0x2e')](function(_0x339c43){var _0x16eedf=_0x339c43['role']===_0xdcbf('0x2a')?'user':_0x339c43[_0xdcbf('0x25')];_0x297773[_0x16eedf]-=_0x339c43[_0xdcbf('0x29')];if(_0x297773[_0x16eedf]<0x0)_0x297773[_0x16eedf]=0x0;});_0x4346ca(_0x297773);return;});})[_0xdcbf('0xe')](function(_0x384ed5){_0x4d1ddd(_0x384ed5);});});}function checkUserLimits(_0x2277db){return new BPromise(function(_0x1c696b,_0x3c48eb){getLimits()[_0xdcbf('0xd')](function(_0x354167){var _0x256d8c=_[_0xdcbf('0x2f')](_['countBy'](_0x2277db,_0xdcbf('0x25')),['admin',_0xdcbf('0x30'),_0xdcbf('0x2b')]);var _0x5b5543=(_0x256d8c[_0xdcbf('0x2a')]||0x0)+(_0x256d8c['user']||0x0);var _0x1f5d66=_0x256d8c[_0xdcbf('0x2b')]||0x0;if(_0x5b5543>_0x354167[_0xdcbf('0x30')])return _0x3c48eb(_0xdcbf('0x31'));if(_0x1f5d66>_0x354167[_0xdcbf('0x2b')])return _0x3c48eb(_0xdcbf('0x32'));return _0x1c696b();})['catch'](function(_0x57c2cd){_0x3c48eb(_0x57c2cd);});});}module[_0xdcbf('0x33')]={'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 63c39d2..08a2a42 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 _0xc2c7=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x45c690,_0x33bab0){var _0x103a66=function(_0x47facb){while(--_0x47facb){_0x45c690['push'](_0x45c690['shift']());}};_0x103a66(++_0x33bab0);}(_0xc2c7,0x134));var _0x7c2c=function(_0x51d154,_0x488cc7){_0x51d154=_0x51d154-0x0;var _0x24fbbf=_0xc2c7[_0x51d154];return _0x24fbbf;};'use strict';module['exports']={'DOMAIN':_0x7c2c('0x0'),'SESSION_SECRET':_0x7c2c('0x1'),'GOOGLE_ID':_0x7c2c('0x2'),'GOOGLE_SECRET':_0x7c2c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x0972=['http://localhost:9000','app-id'];(function(_0x2858f9,_0x3a324f){var _0x4e0ab3=function(_0x52beb1){while(--_0x52beb1){_0x2858f9['push'](_0x2858f9['shift']());}};_0x4e0ab3(++_0x3a324f);}(_0x0972,0x64));var _0x2097=function(_0x216386,_0x4e82ff){_0x216386=_0x216386-0x0;var _0x30de65=_0x0972[_0x216386];return _0x30de65;};'use strict';module['exports']={'DOMAIN':_0x2097('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2097('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 6e73e02..37e200b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7214=['../utils/loggers','exports'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x7214,0x1b8));var _0x4721=function(_0x1161ec,_0x3bff99){_0x1161ec=_0x1161ec-0x0;var _0x40dc85=_0x7214[_0x1161ec];return _0x40dc85;};'use strict';var fileLogger=require(_0x4721('0x0'))['fileLogger'];module[_0x4721('0x1')]=fileLogger; \ No newline at end of file +var _0x5a79=['fileLogger','../utils/loggers'];(function(_0x3430d1,_0x5943af){var _0x4296da=function(_0x2d0ed3){while(--_0x2d0ed3){_0x3430d1['push'](_0x3430d1['shift']());}};_0x4296da(++_0x5943af);}(_0x5a79,0xf7));var _0x95a7=function(_0x4d8d34,_0x329802){_0x4d8d34=_0x4d8d34-0x0;var _0x2a97a8=_0x5a79[_0x4d8d34];return _0x2a97a8;};'use strict';var fileLogger=require(_0x95a7('0x0'))[_0x95a7('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index eaecd90..68edc99 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 _0x5ebb=['exports','resolve','join','root','express','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr'];(function(_0x44f8a6,_0x2b3520){var _0x5037d5=function(_0x225e2e){while(--_0x225e2e){_0x44f8a6['push'](_0x44f8a6['shift']());}};_0x5037d5(++_0x2b3520);}(_0x5ebb,0x9b));var _0xb5eb=function(_0x1611f9,_0xddc39c){_0x1611f9=_0x1611f9-0x0;var _0x1d066d=_0x5ebb[_0x1611f9];return _0x1d066d;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0xb5eb('0x0')](path[_0xb5eb('0x1')](cfg[_0xb5eb('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xb5eb('0x3'),'script':path[_0xb5eb('0x1')](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path[_0xb5eb('0x1')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xb5eb('0x4'),'script':path[_0xb5eb('0x1')](__dirname,_0xb5eb('0x5')),'env':env},{'name':_0xb5eb('0x6'),'script':path[_0xb5eb('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xb5eb('0x7'),'script':path[_0xb5eb('0x1')](__dirname,_0xb5eb('0x8')),'env':env},{'name':_0xb5eb('0x9'),'script':path['join'](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0xb5eb('0xa')]=pm2config; \ No newline at end of file +var _0x1295=['join','../../services/express/index.js','ami','agi','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root','legacy-libs'];(function(_0x433a62,_0xc9de1c){var _0x24d5e3=function(_0xe60fee){while(--_0xe60fee){_0x433a62['push'](_0x433a62['shift']());}};_0x24d5e3(++_0xc9de1c);}(_0x1295,0xa0));var _0x5129=function(_0x7f213d,_0x357849){_0x7f213d=_0x7f213d-0x0;var _0x55b32b=_0x1295[_0x7f213d];return _0x55b32b;};'use strict';var path=require(_0x5129('0x0'));var cfg=require(_0x5129('0x1'));var env={'NODE_PATH':path[_0x5129('0x2')](path['join'](cfg[_0x5129('0x3')],_0x5129('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x5129('0x5')](__dirname,_0x5129('0x6')),'env':env},{'name':_0x5129('0x7'),'script':path['join'](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x5129('0x8'),'script':path[_0x5129('0x5')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x5129('0x9'),'script':path[_0x5129('0x5')](__dirname,_0x5129('0xa')),'env':env},{'name':_0x5129('0xb'),'script':path[_0x5129('0x5')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x5129('0xc'),'script':path[_0x5129('0x5')](__dirname,_0x5129('0xd')),'env':env}]};module[_0x5129('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c19f195..31e7a3a 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 _0x7fbe=['list','describe','delete','dump','saved','bluebird','connected','start','then','disconnect','stop','restart'];(function(_0x29dd3c,_0x43c85e){var _0x5cae46=function(_0x36e976){while(--_0x36e976){_0x29dd3c['push'](_0x29dd3c['shift']());}};_0x5cae46(++_0x43c85e);}(_0x7fbe,0x65));var _0xe7fb=function(_0x3ed666,_0x3345f9){_0x3ed666=_0x3ed666-0x0;var _0x1587f5=_0x7fbe[_0x3ed666];return _0x1587f5;};'use strict';var pm2=require('pm2');var BPromise=require(_0xe7fb('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x5306b4,_0x40a9ba){return pm2['connect'](function(_0x2485ed){if(_0x2485ed){return _0x40a9ba(_0x2485ed);}return _0x5306b4(_0xe7fb('0x1'));});});};exports[_0xe7fb('0x2')]=function(_0x162ba1){return connect()[_0xe7fb('0x3')](function(){return new BPromise(function(_0x4a1d9e,_0x4ae82f){return pm2[_0xe7fb('0x2')](_0x162ba1,function(_0x22b86d,_0x192940){if(_0x22b86d){return _0x4ae82f(_0x22b86d);}pm2[_0xe7fb('0x4')]();return _0x4a1d9e(_0x192940);});});});};exports[_0xe7fb('0x5')]=function(_0x21d2f1){return connect()[_0xe7fb('0x3')](function(){return new BPromise(function(_0x2407ec,_0x4e9755){return pm2['stop'](_0x21d2f1,function(_0xaee8be,_0x1e8762){if(_0xaee8be){return _0x4e9755(_0xaee8be);}pm2[_0xe7fb('0x4')]();return _0x2407ec(_0x1e8762);});});});};exports[_0xe7fb('0x6')]=function(_0x56817b){return connect()[_0xe7fb('0x3')](function(){return new BPromise(function(_0x44a8af,_0x482644){return pm2['restart'](_0x56817b,function(_0x4662d9,_0x536a1a){if(_0x4662d9){return _0x482644(_0x4662d9);}pm2[_0xe7fb('0x4')]();return _0x44a8af(_0x536a1a);});});});};exports[_0xe7fb('0x7')]=function(){return connect()[_0xe7fb('0x3')](function(){return new BPromise(function(_0x4d28b1,_0xf87bf2){return pm2[_0xe7fb('0x7')](function(_0x5ecdf0,_0x35fcdc){if(_0x5ecdf0){return _0xf87bf2(_0x5ecdf0);}pm2[_0xe7fb('0x4')]();return _0x4d28b1(_0x35fcdc);});});});};exports[_0xe7fb('0x8')]=function(_0x266411){return connect()['then'](function(){return new BPromise(function(_0x4d97ef,_0x409420){return pm2[_0xe7fb('0x8')](_0x266411,function(_0x5c8012,_0x55ca7c){if(_0x5c8012){return _0x409420(_0x5c8012);}pm2[_0xe7fb('0x4')]();return _0x4d97ef(_0x55ca7c);});});});};exports[_0xe7fb('0x9')]=function(_0x42ad5c){return connect()[_0xe7fb('0x3')](function(){return new BPromise(function(_0x59e531,_0x102b73){return pm2[_0xe7fb('0x9')](_0x42ad5c,function(_0x3bf562,_0x2b663e){if(_0x3bf562){return _0x102b73(_0x3bf562);}pm2[_0xe7fb('0x4')]();return _0x59e531(_0x2b663e);});});});};exports[_0xe7fb('0xa')]=function(){return connect()[_0xe7fb('0x3')](function(){return new BPromise(function(_0xa48ca1,_0xccacd2){return pm2[_0xe7fb('0xa')](function(_0xa28706){if(_0xa28706){return _0xccacd2(_0xa28706);}return _0xa48ca1(_0xe7fb('0xb'));});});});}; \ No newline at end of file +var _0x6477=['list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect','stop','restart'];(function(_0x4938ae,_0xa6036a){var _0xc070e8=function(_0x1fe630){while(--_0x1fe630){_0x4938ae['push'](_0x4938ae['shift']());}};_0xc070e8(++_0xa6036a);}(_0x6477,0x75));var _0x7647=function(_0x33c2af,_0x163198){_0x33c2af=_0x33c2af-0x0;var _0x13c04a=_0x6477[_0x33c2af];return _0x13c04a;};'use strict';var pm2=require(_0x7647('0x0'));var BPromise=require(_0x7647('0x1'));var config=require(_0x7647('0x2'));function connect(){return new BPromise(function(_0x34d133,_0x4b14c1){return pm2['connect'](function(_0x25e6d0){if(_0x25e6d0){return _0x4b14c1(_0x25e6d0);}return _0x34d133(_0x7647('0x3'));});});};exports[_0x7647('0x4')]=function(_0x3bd4bd){return connect()[_0x7647('0x5')](function(){return new BPromise(function(_0x431cdb,_0x7bab7d){return pm2['start'](_0x3bd4bd,function(_0x296f89,_0x367ab9){if(_0x296f89){return _0x7bab7d(_0x296f89);}pm2[_0x7647('0x6')]();return _0x431cdb(_0x367ab9);});});});};exports[_0x7647('0x7')]=function(_0x1e35ec){return connect()[_0x7647('0x5')](function(){return new BPromise(function(_0x1b37d8,_0x520880){return pm2[_0x7647('0x7')](_0x1e35ec,function(_0x1f0640,_0x10d94f){if(_0x1f0640){return _0x520880(_0x1f0640);}pm2['disconnect']();return _0x1b37d8(_0x10d94f);});});});};exports['restart']=function(_0x248061){return connect()[_0x7647('0x5')](function(){return new BPromise(function(_0x12fc03,_0x334d23){return pm2[_0x7647('0x8')](_0x248061,function(_0x18fbf3,_0x5c7894){if(_0x18fbf3){return _0x334d23(_0x18fbf3);}pm2[_0x7647('0x6')]();return _0x12fc03(_0x5c7894);});});});};exports[_0x7647('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5d96f5,_0x476cae){return pm2['list'](function(_0x3e3250,_0xb68084){if(_0x3e3250){return _0x476cae(_0x3e3250);}pm2['disconnect']();return _0x5d96f5(_0xb68084);});});});};exports[_0x7647('0xa')]=function(_0x34a7cb){return connect()[_0x7647('0x5')](function(){return new BPromise(function(_0x2f8143,_0x18e22e){return pm2[_0x7647('0xa')](_0x34a7cb,function(_0x5ac133,_0x53276d){if(_0x5ac133){return _0x18e22e(_0x5ac133);}pm2[_0x7647('0x6')]();return _0x2f8143(_0x53276d);});});});};exports[_0x7647('0xb')]=function(_0x217346){return connect()[_0x7647('0x5')](function(){return new BPromise(function(_0x184591,_0x10823e){return pm2[_0x7647('0xb')](_0x217346,function(_0x430b07,_0x28ed57){if(_0x430b07){return _0x10823e(_0x430b07);}pm2['disconnect']();return _0x184591(_0x28ed57);});});});};exports[_0x7647('0xc')]=function(){return connect()[_0x7647('0x5')](function(){return new BPromise(function(_0x313ff2,_0x5afe62){return pm2[_0x7647('0xc')](function(_0x23c25d){if(_0x23c25d){return _0x5afe62(_0x23c25d);}return _0x313ff2(_0x7647('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 548a0f8..e3d336c 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 _0xd14f=['chatTimeout','ChatInteraction','findAll','length','map','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','Setting','then'];(function(_0x32b4bd,_0x1c7764){var _0x460ef4=function(_0x1a355e){while(--_0x1a355e){_0x32b4bd['push'](_0x32b4bd['shift']());}};_0x460ef4(++_0x1c7764);}(_0xd14f,0x173));var _0xfd14=function(_0x265722,_0x5f0c05){_0x265722=_0x265722-0x0;var _0x31ed02=_0xd14f[_0x265722];return _0x31ed02;};'use strict';var _=require(_0xfd14('0x0'));var moment=require(_0xfd14('0x1'));var Redis=require(_0xfd14('0x2'));var util=require(_0xfd14('0x3'));var config=require(_0xfd14('0x4'));var db=require(_0xfd14('0x5'))['db'];var logger=require('../logger')(_0xfd14('0x6'));config[_0xfd14('0x7')]=_[_0xfd14('0x8')](config[_0xfd14('0x7')],{'host':_0xfd14('0x9'),'port':0x18eb});var io=require(_0xfd14('0xa'))(new Redis(config[_0xfd14('0x7')]));function closeInteractions(){var _0x133f0f=0x0;var _0x59b177=[];return db[_0xfd14('0xb')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xfd14('0xc')](function(_0x1d1175){_0x133f0f=_0x1d1175[_0xfd14('0xd')];if(_0x133f0f){return db[_0xfd14('0xe')][_0xfd14('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1d1175['chatTimeout'],'minutes')}}});}else{return[];}})[_0xfd14('0xc')](function(_0x24bd84){if(_0x24bd84&&_0x24bd84[_0xfd14('0x10')]){_0x59b177=_[_0xfd14('0x11')](_0x24bd84||[],'id');logger['info'](_0xfd14('0x12'),_0x59b177['join']());return db[_0xfd14('0xe')][_0xfd14('0x13')]({'closeReason':_0xfd14('0x14'),'disposition':_0xfd14('0x15'),'closed':!![],'closedAt':moment()['format'](_0xfd14('0x16'))},{'where':{'id':_0x59b177}});}})['then'](function(){if(_0x59b177&&_0x59b177[_0xfd14('0x10')]){logger[_0xfd14('0x17')](_0xfd14('0x18'),_0x59b177[_0xfd14('0x19')]());for(var _0x4ef766=0x0;_0x4ef766<_0x59b177[_0xfd14('0x10')];_0x4ef766++){io[_0xfd14('0x1a')](_0xfd14('0x1b'),{'id':_0x59b177[_0x4ef766],'closed':!![]});}}})[_0xfd14('0x1c')](function(_0x11580a){logger[_0xfd14('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x11580a?util[_0xfd14('0x1e')](_0x11580a,{'showHidden':![],'depth':null}):'');});}exports[_0xfd14('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8fd7=['[CHAT]\x20Interactions\x20to\x20close:','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','find','ChatInteraction','lastMsgAt','chatTimeout','length','info'];(function(_0x54fe39,_0x39224a){var _0x3dfd44=function(_0x3d0ec3){while(--_0x3d0ec3){_0x54fe39['push'](_0x54fe39['shift']());}};_0x3dfd44(++_0x39224a);}(_0x8fd7,0xd9));var _0x78fd=function(_0xbe5782,_0x55fb86){_0xbe5782=_0xbe5782-0x0;var _0x564ae9=_0x8fd7[_0xbe5782];return _0x564ae9;};'use strict';var _=require(_0x78fd('0x0'));var moment=require(_0x78fd('0x1'));var Redis=require(_0x78fd('0x2'));var util=require('util');var config=require(_0x78fd('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x78fd('0x4'))(_0x78fd('0x5'));config['redis']=_['defaults'](config[_0x78fd('0x6')],{'host':_0x78fd('0x7'),'port':0x18eb});var io=require(_0x78fd('0x8'))(new Redis(config[_0x78fd('0x6')]));function closeInteractions(){var _0x5e66ba=0x0;var _0x5e6784=[];return db['Setting'][_0x78fd('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x5ddd70){_0x5e66ba=_0x5ddd70['chatTimeout'];if(_0x5e66ba){return db[_0x78fd('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x78fd('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5ddd70[_0x78fd('0xc')],'minutes')}}});}else{return[];}})['then'](function(_0x244c0c){if(_0x244c0c&&_0x244c0c[_0x78fd('0xd')]){_0x5e6784=_['map'](_0x244c0c||[],'id');logger[_0x78fd('0xe')](_0x78fd('0xf'),_0x5e6784['join']());return db[_0x78fd('0xa')][_0x78fd('0x10')]({'closeReason':'system','disposition':_0x78fd('0x11'),'closed':!![],'closedAt':moment()[_0x78fd('0x12')](_0x78fd('0x13'))},{'where':{'id':_0x5e6784}});}})[_0x78fd('0x14')](function(){if(_0x5e6784&&_0x5e6784[_0x78fd('0xd')]){logger[_0x78fd('0xe')](_0x78fd('0x15'),_0x5e6784[_0x78fd('0x16')]());for(var _0x316e0e=0x0;_0x316e0e<_0x5e6784[_0x78fd('0xd')];_0x316e0e++){io[_0x78fd('0x17')](_0x78fd('0x18'),{'id':_0x5e6784[_0x316e0e],'closed':!![]});}}})[_0x78fd('0x19')](function(_0x5c8d74){logger[_0x78fd('0x1a')]('[CHAT]\x20Error\x20closing\x20interactions',_0x5c8d74?util[_0x78fd('0x1b')](_0x5c8d74,{'showHidden':![],'depth':null}):'');});}exports[_0x78fd('0x1c')]=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 7e3d85a..048d8ee 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 _0x7ad7=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ad7,0xc8));var _0x77ad=function(_0x3d34aa,_0x54847d){_0x3d34aa=_0x3d34aa-0x0;var _0x399693=_0x7ad7[_0x3d34aa];return _0x399693;};'use strict';function start(){var _0x497fc9=require(_0x77ad('0x0'));return _0x497fc9[_0x77ad('0x1')]();}module[_0x77ad('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x073f=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3c0c53,_0x5d62c8){var _0x25877a=function(_0x42a012){while(--_0x42a012){_0x3c0c53['push'](_0x3c0c53['shift']());}};_0x25877a(++_0x5d62c8);}(_0x073f,0x18d));var _0xf073=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x073f[_0x5d80de];return _0x1c7556;};'use strict';function start(){var _0x42c0f8=require(_0xf073('0x0'));return _0x42c0f8['startAllRefreshIntervals']();}module[_0xf073('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e773753..5a9b9c2 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 _0x85b9=['cron','active','isBetween','add','add\x20cron','stop\x20cron','startAt','endAt','update','update\x20cron','start','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','status','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','my\x20id','resolve'];(function(_0xe6164f,_0x47e826){var _0x557c61=function(_0x303455){while(--_0x303455){_0xe6164f['push'](_0xe6164f['shift']());}};_0x557c61(++_0x47e826);}(_0x85b9,0xc1));var _0x985b=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x85b9[_0x2f45ea];return _0x485a84;};'use strict';var fs=require('fs');var util=require(_0x985b('0x0'));var path=require(_0x985b('0x1'));var _=require(_0x985b('0x2'));var moment=require('moment');var CronJobManager=require(_0x985b('0x3'));var jayson=require(_0x985b('0x4'));var BPromise=require(_0x985b('0x5'));var logger=require(_0x985b('0x6'))(_0x985b('0x7'));var db=require(_0x985b('0x8'))['db'];var analyticCustomReportController=require(_0x985b('0x9'));var analyticDefaultReportController=require(_0x985b('0xa'));var client=jayson[_0x985b('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2e7e33,_0xdc48ad){return function(){logger[_0x985b('0xc')](_0x985b('0xd'),_0x2e7e33[_0x985b('0xe')]);var _0x3590b=!![];var _0x38a9b3=_0x2e7e33[_0x985b('0xf')][_0x985b('0x10')]();var _0x1dad7e={'account':_0x38a9b3,'message':{'from':util[_0x985b('0x11')](_0x985b('0x12'),_0x2e7e33[_0x985b('0xf')][_0x985b('0x13')],_0x2e7e33[_0x985b('0xf')][_0x985b('0xe')]||_0x2e7e33[_0x985b('0xf')][_0x985b('0x14')][_0x985b('0x15')]),'to':_0x2e7e33['email'],'cc':_0x2e7e33['cc'],'bcc':_0x2e7e33['bcc'],'subject':util[_0x985b('0x11')](_0x985b('0x16'),_0xdc48ad[_0x985b('0x13')],_0x2e7e33[_0x985b('0x17')],_0x2e7e33[_0x985b('0x18')])}};var _0x49a3f9=path[_0x985b('0x19')](__dirname,_0x985b('0x1a'));var _0x18c65f=_0xdc48ad[_0x985b('0x1b')];var _0x3324db=util['format'](_0x985b('0x1c'),path[_0x985b('0x1d')](_0xdc48ad['savename'],path['extname'](_0xdc48ad[_0x985b('0x1b')])),_0x985b('0x1e'));var _0x1b3201=path[_0x985b('0x19')](_0x49a3f9,_0x18c65f);var _0x26a60f=path[_0x985b('0x19')](_0x49a3f9,_0x3324db);if(fs['existsSync'](_0x1b3201)){_0xdc48ad['status']='Sent';_0x1dad7e[_0x985b('0x1f')][_0x985b('0x20')]=[{'filename':_0x18c65f,'path':_0x1b3201}];_0x1dad7e[_0x985b('0x1f')][_0x985b('0x21')]=util[_0x985b('0x11')](_0x985b('0x22'),JSON[_0x985b('0x23')](_0xdc48ad,null,0x2));}else if(fs[_0x985b('0x24')](_0x26a60f)){_0xdc48ad[_0x985b('0x25')]=_0x985b('0x26');_0x1dad7e[_0x985b('0x1f')]['attachments']=[{'filename':_0x3324db,'path':_0x26a60f}];}else{_0x1dad7e[_0x985b('0x1f')]['text']=_0x985b('0x27');if(!_0x2e7e33['sendIfEmpty']){_0x3590b=![];logger[_0x985b('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3590b){return client[_0x985b('0x28')](_0x985b('0x29'),_0x1dad7e)[_0x985b('0x2a')](function(_0xceaf0c){if(_0xceaf0c[_0x985b('0x2b')]){return logger[_0x985b('0x2b')](_0x985b('0x2c'),JSON[_0x985b('0x23')](_0xceaf0c));}return logger['info'](_0x985b('0x2d'));})['catch'](function(_0x58ff32){return logger[_0x985b('0x2b')](_0x985b('0x2c'),JSON['stringify'](_0x58ff32));});}};}function handleError(){return function(_0x2662ef){return logger[_0x985b('0x2b')](JSON['stringify'](_0x2662ef));};}function handleResult(_0x44b58a){return function(_0x119f5c){logger[_0x985b('0xc')](_0x985b('0x2e'),JSON[_0x985b('0x23')](_0x119f5c));if(_0x44b58a[_0x985b('0xf')]&&_0x44b58a[_0x985b('0xf')][_0x985b('0x14')]&&!_['isNil'](_0x44b58a[_0x985b('0xe')])){setTimeout(handleSendEmail(_0x44b58a,_0x119f5c),0x3c*0x3e8);}};}function handleJob(_0x26b194){return function(){try{if(_[_0x985b('0x2f')](_0x26b194['subtractNumber'])){return logger['info'](_0x985b('0x30'));}if(_['isNil'](_0x26b194[_0x985b('0x18')])){return logger[_0x985b('0xc')](_0x985b('0x31'));}var _0x38dad9={'startDate':moment()[_0x985b('0x32')](_0x26b194[_0x985b('0x17')],_0x26b194['subtractUnit'])['format'](_0x985b('0x33')),'endDate':moment()[_0x985b('0x11')](_0x985b('0x33')),'type':_0x985b('0x34'),'output':_0x26b194[_0x985b('0x35')],'name':_0x26b194[_0x985b('0x13')]};if(!_[_0x985b('0x2f')](_0x26b194[_0x985b('0x36')])){logger[_0x985b('0xc')](_0x985b('0x37'),_0x26b194[_0x985b('0x36')]);return analyticDefaultReportController['runReport']({'id':_0x26b194['DefaultReportId']},_0x38dad9)[_0x985b('0x2a')](handleResult(_0x26b194))[_0x985b('0x38')](handleError());}if(!_[_0x985b('0x2f')](_0x26b194[_0x985b('0x39')])){logger[_0x985b('0xc')](_0x985b('0x3a'),_0x26b194[_0x985b('0x39')]);return analyticCustomReportController[_0x985b('0x3b')]({'id':_0x26b194[_0x985b('0x39')]},_0x38dad9)['then'](handleResult(_0x26b194))['catch'](handleError());}}catch(_0x222b30){logger[_0x985b('0x2b')](JSON[_0x985b('0x23')](_0x222b30));}return logger[_0x985b('0xc')](_0x985b('0x3c'));};}function getJobs(_0x17cc78){var _0x3a5ab0={};if(_0x17cc78){_0x3a5ab0['id']=_0x17cc78;}return db[_0x985b('0x3d')][_0x985b('0x3e')]({'where':_0x3a5ab0,'include':[{'model':db[_0x985b('0xf')],'attributes':['id',_0x985b('0x13'),_0x985b('0xe')],'include':[{'model':db[_0x985b('0x3f')],'as':_0x985b('0x14'),'include':[{'model':db[_0x985b('0x40')],'as':_0x985b('0x40')}]}]}]})[_0x985b('0x2a')](function(_0x2d39dd){var _0x4c73b9=_[_0x985b('0x41')](manager[_0x985b('0x42')]);var _0x4fc4c6=_[_0x985b('0x43')](_0x2d39dd,function(_0x4bba0e){return _0x4bba0e['id'][_0x985b('0x44')]();});var _0x467008=_[_0x985b('0x45')](_0x2d39dd,function(_0x36cbf7){return _0x36cbf7['id'][_0x985b('0x44')]();});var _0x423cf3=_0x17cc78?_0x4fc4c6:_[_0x985b('0x46')](_0x4fc4c6,_0x4c73b9);var _0xdad1df=_[_0x985b('0x47')](_0x4fc4c6,_0x4c73b9);var _0x311db6=_['difference'](_0x4c73b9,_0x4fc4c6);var _0x5e76dd;var _0x5d1c56;for(_0x5e76dd=0x0;_0x5e76dd<_0x311db6['length']&&!_0x17cc78;_0x5e76dd+=0x1){_0x5d1c56=_0x311db6[_0x5e76dd][_0x985b('0x44')]();if(manager[_0x985b('0x48')](_0x5d1c56)){manager[_0x985b('0x49')](_0x5d1c56);manager[_0x985b('0x4a')](_0x5d1c56);logger[_0x985b('0xc')](_0x985b('0x4b'),_0x5d1c56);}}logger[_0x985b('0xc')](_0x985b('0x4c'),JSON['stringify'](_0x423cf3));for(_0x5e76dd=0x0;_0x5e76dd<_0x423cf3[_0x985b('0x4d')];_0x5e76dd+=0x1){_0x5d1c56=_0x423cf3[_0x5e76dd][_0x985b('0x44')]();logger['info']('index',_0x5d1c56);if(_0x17cc78){logger[_0x985b('0xc')](_0x985b('0x4e'),_0x17cc78);logger[_0x985b('0xc')](JSON['stringify'](_0x467008[_0x5d1c56]));BPromise[_0x985b('0x4f')]()[_0x985b('0x2a')](handleJob(_0x467008[_0x5d1c56]));logger[_0x985b('0xc')]('run\x20job',_0x467008[_0x5d1c56][_0x985b('0x13')],_0x467008[_0x5d1c56][_0x985b('0x50')]);}else if(_0x467008[_0x5d1c56]['cron']&&_0x467008[_0x5d1c56][_0x985b('0x51')]&&moment()[_0x985b('0x52')](_0x467008[_0x5d1c56]['startAt'],_0x467008[_0x5d1c56]['endAt'])){manager[_0x985b('0x53')](_0x5d1c56,_0x467008[_0x5d1c56][_0x985b('0x50')],handleJob(_0x467008[_0x5d1c56]));manager['start'](_0x5d1c56);logger['info'](_0x985b('0x54'),_0x467008[_0x5d1c56][_0x985b('0x13')],_0x467008[_0x5d1c56][_0x985b('0x50')]);}else if(manager['exists'](_0x5d1c56)){manager[_0x985b('0x49')](_0x5d1c56);manager[_0x985b('0x4a')](_0x5d1c56);logger['info'](_0x985b('0x55'),_0x467008[_0x5d1c56][_0x985b('0x13')],_0x467008[_0x5d1c56][_0x985b('0x50')]);}}for(_0x5e76dd=0x0,_0x5d1c56;_0x5e76dd<_0xdad1df['length']&&!_0x17cc78;_0x5e76dd+=0x1){_0x5d1c56=_0xdad1df[_0x5e76dd][_0x985b('0x44')]();if(manager[_0x985b('0x48')](_0x5d1c56)){if(_0x467008[_0x5d1c56]['cron']&&_0x467008[_0x5d1c56][_0x985b('0x51')]&&moment()[_0x985b('0x52')](_0x467008[_0x5d1c56][_0x985b('0x56')],_0x467008[_0x5d1c56][_0x985b('0x57')])){manager[_0x985b('0x58')](_0x5d1c56,_0x467008[_0x5d1c56][_0x985b('0x50')],handleJob(_0x467008[_0x5d1c56]));logger[_0x985b('0xc')](_0x985b('0x59'),_0x467008[_0x5d1c56][_0x985b('0x13')],_0x467008[_0x5d1c56][_0x985b('0x50')]);}else{manager[_0x985b('0x49')](_0x5d1c56);manager['deleteJob'](_0x5d1c56);logger[_0x985b('0xc')](_0x985b('0x55'),_0x467008[_0x5d1c56][_0x985b('0x13')],_0x467008[_0x5d1c56][_0x985b('0x50')]);}}}})[_0x985b('0x38')](function(_0x2160cf){logger[_0x985b('0x2b')](JSON[_0x985b('0x23')](_0x2160cf));});}exports['run']=function(_0x4f1f3d){return getJobs(_0x4f1f3d);};exports[_0x985b('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa8d0=['cron-job-manager','jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','user','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','map','toString','keyBy','difference','intersection','length','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','startAt','add','start','isBetween','update','update\x20cron','stop','stop\x20cron','path','lodash','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa8d0,0x1a1));var _0x0a8d=function(_0x535336,_0x910777){_0x535336=_0x535336-0x0;var _0xd9ca7e=_0xa8d0[_0x535336];return _0xd9ca7e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x0a8d('0x0'));var _=require(_0x0a8d('0x1'));var moment=require(_0x0a8d('0x2'));var CronJobManager=require(_0x0a8d('0x3'));var jayson=require(_0x0a8d('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0x0a8d('0x5'));var db=require(_0x0a8d('0x6'))['db'];var analyticCustomReportController=require(_0x0a8d('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x0a8d('0x8')][_0x0a8d('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x448be3,_0x2b7954){return function(){logger['info'](_0x0a8d('0xa'),_0x448be3[_0x0a8d('0xb')]);var _0x109db7=!![];var _0x48b9ed=_0x448be3[_0x0a8d('0xc')][_0x0a8d('0xd')]();var _0x34d7cb={'account':_0x48b9ed,'message':{'from':util[_0x0a8d('0xe')](_0x0a8d('0xf'),_0x448be3[_0x0a8d('0xc')]['name'],_0x448be3['MailAccount'][_0x0a8d('0xb')]||_0x448be3[_0x0a8d('0xc')][_0x0a8d('0x10')][_0x0a8d('0x11')]),'to':_0x448be3['email'],'cc':_0x448be3['cc'],'bcc':_0x448be3[_0x0a8d('0x12')],'subject':util[_0x0a8d('0xe')]('Report\x20%s\x20last\x20%s\x20%s',_0x2b7954[_0x0a8d('0x13')],_0x448be3[_0x0a8d('0x14')],_0x448be3[_0x0a8d('0x15')])}};var _0x477afb=path[_0x0a8d('0x16')](__dirname,_0x0a8d('0x17'));var _0x4e1557=_0x2b7954[_0x0a8d('0x18')];var _0x3373ac=util[_0x0a8d('0xe')](_0x0a8d('0x19'),path[_0x0a8d('0x1a')](_0x2b7954[_0x0a8d('0x18')],path[_0x0a8d('0x1b')](_0x2b7954['savename'])),_0x0a8d('0x1c'));var _0x525961=path['join'](_0x477afb,_0x4e1557);var _0x5567c7=path[_0x0a8d('0x16')](_0x477afb,_0x3373ac);if(fs[_0x0a8d('0x1d')](_0x525961)){_0x2b7954[_0x0a8d('0x1e')]=_0x0a8d('0x1f');_0x34d7cb[_0x0a8d('0x20')][_0x0a8d('0x21')]=[{'filename':_0x4e1557,'path':_0x525961}];_0x34d7cb[_0x0a8d('0x20')][_0x0a8d('0x22')]=util[_0x0a8d('0xe')](_0x0a8d('0x23'),JSON[_0x0a8d('0x24')](_0x2b7954,null,0x2));}else if(fs[_0x0a8d('0x1d')](_0x5567c7)){_0x2b7954[_0x0a8d('0x1e')]=_0x0a8d('0x1f');_0x34d7cb['message']['attachments']=[{'filename':_0x3373ac,'path':_0x5567c7}];}else{_0x34d7cb[_0x0a8d('0x20')]['text']=_0x0a8d('0x25');if(!_0x448be3['sendIfEmpty']){_0x109db7=![];logger[_0x0a8d('0x26')](_0x0a8d('0x27'));}}if(_0x109db7){return client['request'](_0x0a8d('0x28'),_0x34d7cb)[_0x0a8d('0x29')](function(_0x634cbb){if(_0x634cbb[_0x0a8d('0x2a')]){return logger[_0x0a8d('0x2a')]('error\x20mail',JSON[_0x0a8d('0x24')](_0x634cbb));}return logger[_0x0a8d('0x26')](_0x0a8d('0x2b'));})[_0x0a8d('0x2c')](function(_0xf41814){return logger[_0x0a8d('0x2a')](_0x0a8d('0x2d'),JSON['stringify'](_0xf41814));});}};}function handleError(){return function(_0x4fe30b){return logger['error'](JSON['stringify'](_0x4fe30b));};}function handleResult(_0x451765){return function(_0x297247){logger[_0x0a8d('0x26')](_0x0a8d('0x2e'),JSON[_0x0a8d('0x24')](_0x297247));if(_0x451765[_0x0a8d('0xc')]&&_0x451765[_0x0a8d('0xc')]['Smtp']&&!_[_0x0a8d('0x2f')](_0x451765['email'])){setTimeout(handleSendEmail(_0x451765,_0x297247),0x3c*0x3e8);}};}function handleJob(_0xb9bc7){return function(){try{if(_[_0x0a8d('0x2f')](_0xb9bc7[_0x0a8d('0x14')])){return logger[_0x0a8d('0x26')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x0a8d('0x2f')](_0xb9bc7[_0x0a8d('0x15')])){return logger['info'](_0x0a8d('0x30'));}var _0x16b65c={'startDate':moment()[_0x0a8d('0x31')](_0xb9bc7[_0x0a8d('0x14')],_0xb9bc7[_0x0a8d('0x15')])[_0x0a8d('0xe')](_0x0a8d('0x32')),'endDate':moment()[_0x0a8d('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x0a8d('0x33'),'output':_0xb9bc7[_0x0a8d('0x34')],'name':_0xb9bc7['name']};if(!_[_0x0a8d('0x2f')](_0xb9bc7['DefaultReportId'])){logger[_0x0a8d('0x26')](_0x0a8d('0x35'),_0xb9bc7[_0x0a8d('0x36')]);return analyticDefaultReportController[_0x0a8d('0x37')]({'id':_0xb9bc7['DefaultReportId']},_0x16b65c)[_0x0a8d('0x29')](handleResult(_0xb9bc7))[_0x0a8d('0x2c')](handleError());}if(!_['isNil'](_0xb9bc7[_0x0a8d('0x38')])){logger[_0x0a8d('0x26')]('exec\x20custom\x20report\x20id:%s',_0xb9bc7[_0x0a8d('0x38')]);return analyticCustomReportController[_0x0a8d('0x37')]({'id':_0xb9bc7[_0x0a8d('0x38')]},_0x16b65c)[_0x0a8d('0x29')](handleResult(_0xb9bc7))[_0x0a8d('0x2c')](handleError());}}catch(_0x131284){logger[_0x0a8d('0x2a')](JSON[_0x0a8d('0x24')](_0x131284));}return logger['info'](_0x0a8d('0x39'));};}function getJobs(_0x171cfd){var _0xe1d96d={};if(_0x171cfd){_0xe1d96d['id']=_0x171cfd;}return db[_0x0a8d('0x3a')][_0x0a8d('0x3b')]({'where':_0xe1d96d,'include':[{'model':db[_0x0a8d('0xc')],'attributes':['id',_0x0a8d('0x13'),_0x0a8d('0xb')],'include':[{'model':db['MailServerOut'],'as':_0x0a8d('0x10'),'include':[{'model':db[_0x0a8d('0x3c')],'as':_0x0a8d('0x3c')}]}]}]})['then'](function(_0x427b64){var _0x3b14c0=_[_0x0a8d('0x3d')](manager['jobs']);var _0x2c850c=_[_0x0a8d('0x3e')](_0x427b64,function(_0x202351){return _0x202351['id'][_0x0a8d('0x3f')]();});var _0x17cbe5=_[_0x0a8d('0x40')](_0x427b64,function(_0x5aaee0){return _0x5aaee0['id']['toString']();});var _0x77c6de=_0x171cfd?_0x2c850c:_[_0x0a8d('0x41')](_0x2c850c,_0x3b14c0);var _0x357905=_[_0x0a8d('0x42')](_0x2c850c,_0x3b14c0);var _0x410e00=_[_0x0a8d('0x41')](_0x3b14c0,_0x2c850c);var _0x3f0e71;var _0x5acf39;for(_0x3f0e71=0x0;_0x3f0e71<_0x410e00[_0x0a8d('0x43')]&&!_0x171cfd;_0x3f0e71+=0x1){_0x5acf39=_0x410e00[_0x3f0e71][_0x0a8d('0x3f')]();if(manager['exists'](_0x5acf39)){manager['stop'](_0x5acf39);manager[_0x0a8d('0x44')](_0x5acf39);logger[_0x0a8d('0x26')](_0x0a8d('0x45'),_0x5acf39);}}logger['info'](_0x0a8d('0x46'),JSON['stringify'](_0x77c6de));for(_0x3f0e71=0x0;_0x3f0e71<_0x77c6de[_0x0a8d('0x43')];_0x3f0e71+=0x1){_0x5acf39=_0x77c6de[_0x3f0e71]['toString']();logger[_0x0a8d('0x26')](_0x0a8d('0x47'),_0x5acf39);if(_0x171cfd){logger[_0x0a8d('0x26')](_0x0a8d('0x48'),_0x171cfd);logger['info'](JSON[_0x0a8d('0x24')](_0x17cbe5[_0x5acf39]));BPromise['resolve']()[_0x0a8d('0x29')](handleJob(_0x17cbe5[_0x5acf39]));logger[_0x0a8d('0x26')](_0x0a8d('0x49'),_0x17cbe5[_0x5acf39]['name'],_0x17cbe5[_0x5acf39]['cron']);}else if(_0x17cbe5[_0x5acf39][_0x0a8d('0x4a')]&&_0x17cbe5[_0x5acf39][_0x0a8d('0x4b')]&&moment()['isBetween'](_0x17cbe5[_0x5acf39][_0x0a8d('0x4c')],_0x17cbe5[_0x5acf39]['endAt'])){manager[_0x0a8d('0x4d')](_0x5acf39,_0x17cbe5[_0x5acf39][_0x0a8d('0x4a')],handleJob(_0x17cbe5[_0x5acf39]));manager[_0x0a8d('0x4e')](_0x5acf39);logger[_0x0a8d('0x26')]('add\x20cron',_0x17cbe5[_0x5acf39][_0x0a8d('0x13')],_0x17cbe5[_0x5acf39]['cron']);}else if(manager['exists'](_0x5acf39)){manager['stop'](_0x5acf39);manager['deleteJob'](_0x5acf39);logger['info']('stop\x20cron',_0x17cbe5[_0x5acf39][_0x0a8d('0x13')],_0x17cbe5[_0x5acf39]['cron']);}}for(_0x3f0e71=0x0,_0x5acf39;_0x3f0e71<_0x357905[_0x0a8d('0x43')]&&!_0x171cfd;_0x3f0e71+=0x1){_0x5acf39=_0x357905[_0x3f0e71][_0x0a8d('0x3f')]();if(manager['exists'](_0x5acf39)){if(_0x17cbe5[_0x5acf39][_0x0a8d('0x4a')]&&_0x17cbe5[_0x5acf39][_0x0a8d('0x4b')]&&moment()[_0x0a8d('0x4f')](_0x17cbe5[_0x5acf39][_0x0a8d('0x4c')],_0x17cbe5[_0x5acf39]['endAt'])){manager[_0x0a8d('0x50')](_0x5acf39,_0x17cbe5[_0x5acf39][_0x0a8d('0x4a')],handleJob(_0x17cbe5[_0x5acf39]));logger[_0x0a8d('0x26')](_0x0a8d('0x51'),_0x17cbe5[_0x5acf39][_0x0a8d('0x13')],_0x17cbe5[_0x5acf39]['cron']);}else{manager[_0x0a8d('0x52')](_0x5acf39);manager[_0x0a8d('0x44')](_0x5acf39);logger[_0x0a8d('0x26')](_0x0a8d('0x53'),_0x17cbe5[_0x5acf39][_0x0a8d('0x13')],_0x17cbe5[_0x5acf39][_0x0a8d('0x4a')]);}}}})[_0x0a8d('0x2c')](function(_0x32a844){logger[_0x0a8d('0x2a')](JSON[_0x0a8d('0x24')](_0x32a844));});}exports['run']=function(_0x37a637){return getJobs(_0x37a637);};exports[_0x0a8d('0x4e')]=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 b8a185d..ba5bb78 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 _0x0102=['CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','sentimentRegion','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Neutral','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','catch','start','aws-sdk','request-promise','util','bluebird','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','transcripts','results','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','language','bucket','Transcript\x20not\x20available'];(function(_0x3af61c,_0x51db90){var _0x339d71=function(_0x3b9da3){while(--_0x3b9da3){_0x3af61c['push'](_0x3af61c['shift']());}};_0x339d71(++_0x51db90);}(_0x0102,0x186));var _0x2010=function(_0x2233c1,_0x2054f2){_0x2233c1=_0x2233c1-0x0;var _0x25214b=_0x0102[_0x2233c1];return _0x25214b;};var _=require('lodash');var AWS=require(_0x2010('0x0'));var rp=require(_0x2010('0x1'));var util=require(_0x2010('0x2'));var BPromise=require(_0x2010('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x4e30b3,_0x59082d,_0x22e49f,_0x3e25fb){return new Promise(function(_0x130725,_0x304264){var _0x4eeb67=new AWS[(_0x2010('0x4'))]({'accessKeyId':_0x59082d,'secretAccessKey':_0x4e30b3,'region':_0x22e49f});_0x4eeb67['getTranscriptionJob']({'TranscriptionJobName':_0x3e25fb},function(_0x4728c0,_0x160e41){if(_0x4728c0){return _0x304264(_0x4728c0);}else{return _0x130725(_0x160e41);}});});}function sentiment(_0x48dd91,_0x1f94ca,_0x3c2d98,_0x3d34d4,_0x3acdbb){return new Promise(function(_0x1aedbb,_0x2a27b0){var _0x289ad4=new AWS[(_0x2010('0x5'))]({'accessKeyId':_0x1f94ca,'secretAccessKey':_0x48dd91,'region':_0x3c2d98});_0x289ad4[_0x2010('0x6')]({'Text':_0x3d34d4,'LanguageCode':_0x3acdbb[_0x2010('0x7')](0x0,0x2)},function(_0x1d3b39,_0x32fe2e){if(_0x1d3b39){return _0x2a27b0(_0x1d3b39);}else{return _0x1aedbb(_0x32fe2e);}});});}function checkTranscribeJob(_0x2d09c5,_0x3f307c,_0x3e8624){var _0x388991;return new BPromise(function(_0x528a38,_0x579340){logger[_0x2010('0x8')](util[_0x2010('0x9')](_0x2010('0xa'),_0x2d09c5['id'],_0x2d09c5[_0x2010('0xb')]));return getTranscriptionJob(_0x3e8624[_0x2010('0xc')],_0x3e8624[_0x2010('0xd')],_0x3f307c['transcribeRegion'],_0x2d09c5[_0x2010('0xb')])[_0x2010('0xe')](function(_0x5ad412){logger[_0x2010('0x8')](util[_0x2010('0x9')](_0x2010('0xf'),_0x2d09c5['id'],_0x2d09c5[_0x2010('0xb')],_0x5ad412[_0x2010('0x10')][_0x2010('0x11')]));if(!_0x2d09c5[_0x2010('0x12')]){switch(_0x5ad412[_0x2010('0x10')][_0x2010('0x11')]){case'COMPLETED':var _0x559ed6={'transcribeStatus':_0x5ad412[_0x2010('0x10')][_0x2010('0x11')],'fileUri':_0x5ad412[_0x2010('0x10')][_0x2010('0x13')]['TranscriptFileUri']};logger['info'](util[_0x2010('0x9')](_0x2010('0x14'),_0x2d09c5['id']));return rp({'uri':_0x5ad412[_0x2010('0x10')][_0x2010('0x13')][_0x2010('0x15')],'json':!![]})[_0x2010('0xe')](function(_0x4f621c){logger[_0x2010('0x8')](util[_0x2010('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x2d09c5['id']));if(_0x4f621c&&_0x4f621c['results']&&_0x4f621c['results'][_0x2010('0x16')]&&_0x4f621c['results'][_0x2010('0x16')]['length']){_0x559ed6['fileText']='';for(var _0xdb57be=0x0;_0xdb57be<_0x4f621c[_0x2010('0x17')]['transcripts'][_0x2010('0x18')];_0xdb57be++){_0x559ed6['fileText']+=_0x4f621c[_0x2010('0x17')][_0x2010('0x16')][_0xdb57be][_0x2010('0x19')]+'';}}return _0x2d09c5[_0x2010('0x1a')](_0x559ed6);})[_0x2010('0xe')](function(){logger[_0x2010('0x8')](util[_0x2010('0x9')](_0x2010('0x1b'),_0x2d09c5['id']));if(!_0x2d09c5[_0x2010('0x1c')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))](_0x2010('0x1f'));}if(!_0x3f307c['sentiment']||!_0x3f307c[_0x2010('0x20')]||!_0x3f307c['sentimentRegion']||!_0x3f307c[_0x2010('0x21')]||!_0x3f307c[_0x2010('0x22')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x559ed6['fileText']){throw new Error(_0x2010('0x23'));}if(_0x3f307c['sentimentAccountId']===_0x3e8624['id']){return _0x3e8624;}else{return db[_0x2010('0x24')][_0x2010('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2010('0xe')](function(_0x14d1dc){if(!_0x14d1dc){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))](_0x2010('0x26'));}if(!_0x14d1dc['data1']||!_0x14d1dc[_0x2010('0xd')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x388991=_0x14d1dc;logger['info'](util[_0x2010('0x9')](_0x2010('0x27'),_0x2d09c5['id']));return sentiment(_0x388991[_0x2010('0xc')],_0x388991['data2'],_0x3f307c['sentimentRegion'],_0x559ed6[_0x2010('0x12')],_0x3f307c[_0x2010('0x21')]);})[_0x2010('0xe')](function(_0x339fd2){logger[_0x2010('0x8')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2d09c5['id']));return _0x2d09c5['update']({'sentiment':_0x339fd2[_0x2010('0x28')],'sPositive':_0x339fd2[_0x2010('0x29')][_0x2010('0x2a')],'sNegative':_0x339fd2['SentimentScore'][_0x2010('0x2b')],'sMixed':_0x339fd2[_0x2010('0x29')][_0x2010('0x2c')],'sNeutral':_0x339fd2[_0x2010('0x29')]['Neutral']});})[_0x2010('0xe')](function(){logger[_0x2010('0x8')](util[_0x2010('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2d09c5['id']));_0x528a38();});case _0x2010('0x2d'):return _0x2d09c5['update']({'transcribeStatus':_0x2010('0x2d'),'failureReason':_0x5ad412[_0x2010('0x10')][_0x2010('0x2e')]})[_0x2010('0xe')](function(){logger[_0x2010('0x8')](util[_0x2010('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2d09c5['id']));_0x528a38();});default:logger[_0x2010('0x8')](util['format'](_0x2010('0x2f'),_0x2d09c5['id']));break;}}else{return BPromise[_0x2010('0x30')]()[_0x2010('0xe')](function(){if(!_0x2d09c5[_0x2010('0x1c')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))](_0x2010('0x1f'));}if(!_0x3f307c[_0x2010('0x31')]||!_0x3f307c[_0x2010('0x20')]||!_0x3f307c[_0x2010('0x32')]||!_0x3f307c[_0x2010('0x21')]||!_0x3f307c[_0x2010('0x22')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2d09c5['fileText']){throw new Error(_0x2010('0x23'));}if(_0x3f307c[_0x2010('0x20')]===_0x3e8624['id']){return _0x3e8624;}else{return db[_0x2010('0x24')][_0x2010('0x25')]({'where':{'id':_settings[_0x2010('0x20')]}});}})[_0x2010('0xe')](function(_0x2ae88e){if(!_0x2ae88e){throw new db['Sequelize'][(_0x2010('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2ae88e[_0x2010('0xc')]||!_0x2ae88e[_0x2010('0xd')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))](_0x2010('0x33'));}_0x388991=_0x2ae88e;logger['info'](util[_0x2010('0x9')](_0x2010('0x27'),_0x2d09c5['id']));return sentiment(_0x388991[_0x2010('0xc')],_0x388991[_0x2010('0xd')],_0x3f307c['sentimentRegion'],_0x2d09c5[_0x2010('0x12')],_0x3f307c['language']);})['then'](function(_0x550222){logger[_0x2010('0x8')](util[_0x2010('0x9')](_0x2010('0x34'),_0x2d09c5['id']));return _0x2d09c5[_0x2010('0x1a')]({'sentiment':_0x550222[_0x2010('0x28')],'sPositive':_0x550222[_0x2010('0x29')]['Positive'],'sNegative':_0x550222[_0x2010('0x29')][_0x2010('0x2b')],'sMixed':_0x550222[_0x2010('0x29')]['Mixed'],'sNeutral':_0x550222['SentimentScore'][_0x2010('0x35')],'transcribeStatus':'COMPLETED'});})[_0x2010('0xe')](function(){logger[_0x2010('0x8')](util[_0x2010('0x9')](_0x2010('0x1b'),_0x2d09c5['id']));_0x528a38();});}})['catch'](function(_0x36acbe){if(_0x36acbe){if(!_0x36acbe[_0x2010('0x36')]||_0x36acbe[_0x2010('0x36')]!==_0x2010('0x37')){logger[_0x2010('0x38')](util[_0x2010('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2d09c5['id']),util[_0x2010('0x39')](_0x36acbe,{'showHidden':![],'depth':null}));}}_0x528a38();});});}function checkTranscribe(){var _0x6eee92;var _0x3e2fcd;var _0x4dc0cf;return db[_0x2010('0x3a')][_0x2010('0x3b')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x2010('0xe')](function(_0x3fd468){if(!_0x3fd468||!_0x3fd468[_0x2010('0x18')]){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))](_0x2010('0x3c'));}_0x6eee92=_0x3fd468;return db[_0x2010('0x3d')][_0x2010('0x25')]({'where':{'id':0x1}});})['then'](function(_0x5258b9){if(!_0x5258b9){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))]('Settings\x20not\x20available');}_0x3e2fcd=_0x5258b9;if(!_0x3e2fcd[_0x2010('0x3e')]||!_0x3e2fcd[_0x2010('0x3f')]||!_0x3e2fcd[_0x2010('0x40')]||!_0x3e2fcd[_0x2010('0x21')]||!_0x3e2fcd[_0x2010('0x22')]){throw new db['Sequelize']['ValidationError'](_0x2010('0x41'));}return db[_0x2010('0x24')][_0x2010('0x25')]({'where':{'id':_0x3e2fcd[_0x2010('0x3f')]}});})[_0x2010('0xe')](function(_0x2d8164){if(!_0x2d8164){throw new db[(_0x2010('0x1d'))][(_0x2010('0x1e'))](_0x2010('0x26'));}if(!_0x2d8164[_0x2010('0xc')]||!_0x2d8164[_0x2010('0xd')]){throw new db['Sequelize'][(_0x2010('0x1e'))](_0x2010('0x33'));}_0x4dc0cf=_0x2d8164;var _0x56555e=[];_0x6eee92[_0x2010('0x42')](function(_0x43d529){_0x56555e[_0x2010('0x43')](checkTranscribeJob(_0x43d529,_0x3e2fcd,_0x4dc0cf));});return BPromise[_0x2010('0x44')](_0x56555e);})[_0x2010('0x45')](function(_0x7263b9){if(_0x7263b9){if(!_0x7263b9[_0x2010('0x36')]||_0x7263b9[_0x2010('0x36')]!==_0x2010('0x37')){logger[_0x2010('0x38')](util[_0x2010('0x39')](_0x7263b9,{'showHidden':![],'depth':null}));}}});}exports[_0x2010('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x35ff=['CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','findOne','Positive','Negative','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','start','aws-sdk','request-promise','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available'];(function(_0x329fde,_0x2c7da0){var _0x20184c=function(_0x31ae91){while(--_0x31ae91){_0x329fde['push'](_0x329fde['shift']());}};_0x20184c(++_0x2c7da0);}(_0x35ff,0xb3));var _0xf35f=function(_0x4bfa93,_0x33a65f){_0x4bfa93=_0x4bfa93-0x0;var _0x2a6d30=_0x35ff[_0x4bfa93];return _0x2a6d30;};var _=require('lodash');var AWS=require(_0xf35f('0x0'));var rp=require(_0xf35f('0x1'));var util=require('util');var BPromise=require(_0xf35f('0x2'));var db=require(_0xf35f('0x3'))['db'];var logger=require('../../config/logger')(_0xf35f('0x4'));function getTranscriptionJob(_0x481b60,_0x3ce173,_0x211017,_0x18a821){return new Promise(function(_0x1f9847,_0x1821a6){var _0x4321e9=new AWS['TranscribeService']({'accessKeyId':_0x3ce173,'secretAccessKey':_0x481b60,'region':_0x211017});_0x4321e9[_0xf35f('0x5')]({'TranscriptionJobName':_0x18a821},function(_0x1922af,_0x37df94){if(_0x1922af){return _0x1821a6(_0x1922af);}else{return _0x1f9847(_0x37df94);}});});}function sentiment(_0xb3fa13,_0x5ad244,_0x406771,_0x30fa2d,_0x1b9322){return new Promise(function(_0x335fe7,_0x45124e){var _0x179b13=new AWS[(_0xf35f('0x6'))]({'accessKeyId':_0x5ad244,'secretAccessKey':_0xb3fa13,'region':_0x406771});_0x179b13['detectSentiment']({'Text':_0x30fa2d,'LanguageCode':_0x1b9322[_0xf35f('0x7')](0x0,0x2)},function(_0x247d4c,_0x53ace5){if(_0x247d4c){return _0x45124e(_0x247d4c);}else{return _0x335fe7(_0x53ace5);}});});}function checkTranscribeJob(_0x30b231,_0x2a5109,_0xf33700){var _0x26588a;return new BPromise(function(_0x295701,_0x5b38be){logger[_0xf35f('0x8')](util['format'](_0xf35f('0x9'),_0x30b231['id'],_0x30b231[_0xf35f('0xa')]));return getTranscriptionJob(_0xf33700['data1'],_0xf33700[_0xf35f('0xb')],_0x2a5109[_0xf35f('0xc')],_0x30b231[_0xf35f('0xa')])[_0xf35f('0xd')](function(_0x246cc8){logger['info'](util[_0xf35f('0xe')](_0xf35f('0xf'),_0x30b231['id'],_0x30b231[_0xf35f('0xa')],_0x246cc8[_0xf35f('0x10')]['TranscriptionJobStatus']));if(!_0x30b231[_0xf35f('0x11')]){switch(_0x246cc8[_0xf35f('0x10')][_0xf35f('0x12')]){case _0xf35f('0x13'):var _0x26f540={'transcribeStatus':_0x246cc8['TranscriptionJob'][_0xf35f('0x12')],'fileUri':_0x246cc8[_0xf35f('0x10')][_0xf35f('0x14')][_0xf35f('0x15')]};logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x16'),_0x30b231['id']));return rp({'uri':_0x246cc8['TranscriptionJob'][_0xf35f('0x14')][_0xf35f('0x15')],'json':!![]})['then'](function(_0x319a63){logger['info'](util[_0xf35f('0xe')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x30b231['id']));if(_0x319a63&&_0x319a63[_0xf35f('0x17')]&&_0x319a63[_0xf35f('0x17')][_0xf35f('0x18')]&&_0x319a63['results'][_0xf35f('0x18')][_0xf35f('0x19')]){_0x26f540[_0xf35f('0x11')]='';for(var _0x30a846=0x0;_0x30a846<_0x319a63[_0xf35f('0x17')]['transcripts']['length'];_0x30a846++){_0x26f540[_0xf35f('0x11')]+=_0x319a63[_0xf35f('0x17')][_0xf35f('0x18')][_0x30a846][_0xf35f('0x1a')]+'';}}return _0x30b231[_0xf35f('0x1b')](_0x26f540);})['then'](function(){logger[_0xf35f('0x8')](util['format'](_0xf35f('0x1c'),_0x30b231['id']));if(!_0x30b231[_0xf35f('0x1d')]){throw new db['Sequelize'][(_0xf35f('0x1e'))](_0xf35f('0x1f'));}if(!_0x2a5109[_0xf35f('0x20')]||!_0x2a5109[_0xf35f('0x21')]||!_0x2a5109[_0xf35f('0x22')]||!_0x2a5109[_0xf35f('0x23')]||!_0x2a5109[_0xf35f('0x24')]){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x26'));}if(!_0x26f540[_0xf35f('0x11')]){throw new Error(_0xf35f('0x27'));}if(_0x2a5109[_0xf35f('0x21')]===_0xf33700['id']){return _0xf33700;}else{return db[_0xf35f('0x28')]['findOne']({'where':{'id':_settings[_0xf35f('0x21')]}});}})[_0xf35f('0xd')](function(_0x2243f4){if(!_0x2243f4){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x29'));}if(!_0x2243f4[_0xf35f('0x2a')]||!_0x2243f4[_0xf35f('0xb')]){throw new db[(_0xf35f('0x25'))]['ValidationError'](_0xf35f('0x2b'));}_0x26588a=_0x2243f4;logger['info'](util[_0xf35f('0xe')](_0xf35f('0x2c'),_0x30b231['id']));return sentiment(_0x26588a[_0xf35f('0x2a')],_0x26588a['data2'],_0x2a5109[_0xf35f('0x22')],_0x26f540[_0xf35f('0x11')],_0x2a5109[_0xf35f('0x23')]);})[_0xf35f('0xd')](function(_0x1e4c3b){logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x2d'),_0x30b231['id']));return _0x30b231['update']({'sentiment':_0x1e4c3b[_0xf35f('0x2e')],'sPositive':_0x1e4c3b[_0xf35f('0x2f')]['Positive'],'sNegative':_0x1e4c3b['SentimentScore']['Negative'],'sMixed':_0x1e4c3b['SentimentScore'][_0xf35f('0x30')],'sNeutral':_0x1e4c3b['SentimentScore'][_0xf35f('0x31')]});})[_0xf35f('0xd')](function(){logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x1c'),_0x30b231['id']));_0x295701();});case _0xf35f('0x32'):return _0x30b231[_0xf35f('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x246cc8[_0xf35f('0x10')][_0xf35f('0x33')]})['then'](function(){logger['info'](util[_0xf35f('0xe')](_0xf35f('0x1c'),_0x30b231['id']));_0x295701();});default:logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x34'),_0x30b231['id']));break;}}else{return BPromise['resolve']()[_0xf35f('0xd')](function(){if(!_0x30b231['tempSentiment']){throw new db['Sequelize'][(_0xf35f('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2a5109[_0xf35f('0x20')]||!_0x2a5109[_0xf35f('0x21')]||!_0x2a5109[_0xf35f('0x22')]||!_0x2a5109[_0xf35f('0x23')]||!_0x2a5109['bucket']){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x26'));}if(!_0x30b231[_0xf35f('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x2a5109['sentimentAccountId']===_0xf33700['id']){return _0xf33700;}else{return db[_0xf35f('0x28')][_0xf35f('0x35')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf35f('0xd')](function(_0x5e40aa){if(!_0x5e40aa){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x29'));}if(!_0x5e40aa[_0xf35f('0x2a')]||!_0x5e40aa[_0xf35f('0xb')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x26588a=_0x5e40aa;logger['info'](util[_0xf35f('0xe')](_0xf35f('0x2c'),_0x30b231['id']));return sentiment(_0x26588a[_0xf35f('0x2a')],_0x26588a[_0xf35f('0xb')],_0x2a5109[_0xf35f('0x22')],_0x30b231[_0xf35f('0x11')],_0x2a5109[_0xf35f('0x23')]);})[_0xf35f('0xd')](function(_0x459b96){logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x2d'),_0x30b231['id']));return _0x30b231[_0xf35f('0x1b')]({'sentiment':_0x459b96[_0xf35f('0x2e')],'sPositive':_0x459b96['SentimentScore'][_0xf35f('0x36')],'sNegative':_0x459b96[_0xf35f('0x2f')][_0xf35f('0x37')],'sMixed':_0x459b96[_0xf35f('0x2f')][_0xf35f('0x30')],'sNeutral':_0x459b96[_0xf35f('0x2f')][_0xf35f('0x31')],'transcribeStatus':'COMPLETED'});})[_0xf35f('0xd')](function(){logger[_0xf35f('0x8')](util[_0xf35f('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x30b231['id']));_0x295701();});}})['catch'](function(_0x7a9be){if(_0x7a9be){if(!_0x7a9be[_0xf35f('0x38')]||_0x7a9be[_0xf35f('0x38')]!=='SequelizeValidationError'){logger[_0xf35f('0x39')](util[_0xf35f('0xe')](_0xf35f('0x3a'),_0x30b231['id']),util[_0xf35f('0x3b')](_0x7a9be,{'showHidden':![],'depth':null}));}}_0x295701();});});}function checkTranscribe(){var _0x1e65a2;var _0x49a811;var _0x28cd8d;return db['VoiceRecording'][_0xf35f('0x3c')]({'where':{'transcribeStatus':_0xf35f('0x3d')}})['then'](function(_0x39f9c6){if(!_0x39f9c6||!_0x39f9c6['length']){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x3e'));}_0x1e65a2=_0x39f9c6;return db[_0xf35f('0x3f')][_0xf35f('0x35')]({'where':{'id':0x1}});})[_0xf35f('0xd')](function(_0xe835f1){if(!_0xe835f1){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x40'));}_0x49a811=_0xe835f1;if(!_0x49a811[_0xf35f('0x4')]||!_0x49a811[_0xf35f('0x41')]||!_0x49a811['transcribeRegion']||!_0x49a811[_0xf35f('0x23')]||!_0x49a811[_0xf35f('0x24')]){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x42'));}return db[_0xf35f('0x28')][_0xf35f('0x35')]({'where':{'id':_0x49a811[_0xf35f('0x41')]}});})['then'](function(_0x1e687e){if(!_0x1e687e){throw new db[(_0xf35f('0x25'))]['ValidationError'](_0xf35f('0x29'));}if(!_0x1e687e[_0xf35f('0x2a')]||!_0x1e687e[_0xf35f('0xb')]){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x28cd8d=_0x1e687e;var _0x4a1894=[];_0x1e65a2[_0xf35f('0x43')](function(_0x3d8084){_0x4a1894[_0xf35f('0x44')](checkTranscribeJob(_0x3d8084,_0x49a811,_0x28cd8d));});return BPromise[_0xf35f('0x45')](_0x4a1894);})[_0xf35f('0x46')](function(_0x50b152){if(_0x50b152){if(!_0x50b152[_0xf35f('0x38')]||_0x50b152[_0xf35f('0x38')]!==_0xf35f('0x47')){logger[_0xf35f('0x39')](util[_0xf35f('0x3b')](_0x50b152,{'showHidden':![],'depth':null}));}}});}exports[_0xf35f('0x48')]=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 f0d5dc2..8da4a0c 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 _0x6b23=['format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','../logger','defaults','localhost','redis','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout'];(function(_0x21eb96,_0x3046ba){var _0x581c40=function(_0x324c5e){while(--_0x324c5e){_0x21eb96['push'](_0x21eb96['shift']());}};_0x581c40(++_0x3046ba);}(_0x6b23,0x102));var _0x36b2=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x6b23[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x36b2('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x36b2('0x1'));var config=require(_0x36b2('0x2'));var db=require(_0x36b2('0x3'))['db'];var logger=require(_0x36b2('0x4'))('schedule');config['redis']=_[_0x36b2('0x5')](config['redis'],{'host':_0x36b2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x36b2('0x7')]));function closeInteractions(){var _0x4d1c95=[];return db[_0x36b2('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x36b2('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x36b2('0xa')](0x18,_0x36b2('0xb'))}}})[_0x36b2('0xc')](function(_0x4984a2){if(_0x4984a2&&_0x4984a2[_0x36b2('0xd')]){_0x4d1c95=_[_0x36b2('0xe')](_0x4984a2||[],'id');logger[_0x36b2('0xf')](_0x36b2('0x10'),_0x4d1c95[_0x36b2('0x11')]());return db['WhatsappInteraction'][_0x36b2('0x12')]({'closeReason':_0x36b2('0x13'),'disposition':_0x36b2('0x14'),'closed':!![],'closedAt':moment()[_0x36b2('0x15')](_0x36b2('0x16'))},{'where':{'id':_0x4d1c95}});}})[_0x36b2('0xc')](function(){if(_0x4d1c95&&_0x4d1c95[_0x36b2('0xd')]){logger[_0x36b2('0xf')](_0x36b2('0x17'),_0x4d1c95[_0x36b2('0x11')]());for(var _0x56a201=0x0;_0x56a201<_0x4d1c95['length'];_0x56a201++){io[_0x36b2('0x18')](_0x36b2('0x19'),{'id':_0x4d1c95[_0x56a201],'closed':!![]});}}})[_0x36b2('0x1a')](function(_0x4a6cda){logger[_0x36b2('0x1b')](_0x36b2('0x1c'),_0x4a6cda?util[_0x36b2('0x1d')](_0x4a6cda,{'showHidden':![],'depth':null}):'');});}exports[_0x36b2('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x88a3=['subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','WhatsappInteraction','findAll'];(function(_0xc4bda1,_0x15b608){var _0x15828a=function(_0x513c62){while(--_0x513c62){_0xc4bda1['push'](_0xc4bda1['shift']());}};_0x15828a(++_0x15b608);}(_0x88a3,0x1e1));var _0x388a=function(_0x4c3afd,_0x3e7a45){_0x4c3afd=_0x4c3afd-0x0;var _0x4e2ef3=_0x88a3[_0x4c3afd];return _0x4e2ef3;};'use strict';var _=require(_0x388a('0x0'));var moment=require(_0x388a('0x1'));var Redis=require(_0x388a('0x2'));var util=require(_0x388a('0x3'));var config=require(_0x388a('0x4'));var db=require(_0x388a('0x5'))['db'];var logger=require(_0x388a('0x6'))(_0x388a('0x7'));config[_0x388a('0x8')]=_['defaults'](config['redis'],{'host':_0x388a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x2ce7eb=[];return db[_0x388a('0xa')][_0x388a('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x388a('0xc')](0x18,_0x388a('0xd'))}}})[_0x388a('0xe')](function(_0x1b5d65){if(_0x1b5d65&&_0x1b5d65[_0x388a('0xf')]){_0x2ce7eb=_[_0x388a('0x10')](_0x1b5d65||[],'id');logger[_0x388a('0x11')](_0x388a('0x12'),_0x2ce7eb[_0x388a('0x13')]());return db[_0x388a('0xa')][_0x388a('0x14')]({'closeReason':_0x388a('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2ce7eb}});}})[_0x388a('0xe')](function(){if(_0x2ce7eb&&_0x2ce7eb[_0x388a('0xf')]){logger[_0x388a('0x11')](_0x388a('0x16'),_0x2ce7eb[_0x388a('0x13')]());for(var _0x6241d3=0x0;_0x6241d3<_0x2ce7eb['length'];_0x6241d3++){io[_0x388a('0x17')](_0x388a('0x18'),{'id':_0x2ce7eb[_0x6241d3],'closed':!![]});}}})[_0x388a('0x19')](function(_0x1eb797){logger['error'](_0x388a('0x1a'),_0x1eb797?util[_0x388a('0x1b')](_0x1eb797,{'showHidden':![],'depth':null}):'');});}exports[_0x388a('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 94b81d4..d38796a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4be1=['@xcally.com','now','Innocenzo','innocenzo.biondo','destroy','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper2','catch','util','../mysqldb','push','Biondo'];(function(_0x3f02ee,_0x50d556){var _0x36814f=function(_0x2c9a96){while(--_0x2c9a96){_0x3f02ee['push'](_0x3f02ee['shift']());}};_0x36814f(++_0x50d556);}(_0x4be1,0x10a));var _0x14be=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x4be1[_0x42245d];return _0x4b211a;};'use strict';var util=require(_0x14be('0x0'));var db=require(_0x14be('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x14be('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x14be('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x14be('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x14be('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x14be('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x14be('0x2')]({'id':i,'firstName':_0x14be('0x6')+i,'lastName':_0x14be('0x3')+i,'phone':0xf879fb460+i,'email':_0x14be('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x14be('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x14be('0x5')](),'updatedAt':Date[_0x14be('0x5')]()});}db['CmContact'][_0x14be('0x8')]({'where':{}})[_0x14be('0x9')](function(){return db[_0x14be('0xa')][_0x14be('0xb')](contacts);})[_0x14be('0x9')](function(){console[_0x14be('0xc')](_0x14be('0xd'),_0x14be('0xe'));return db['CmHopper']['destroy']({'where':{}});})[_0x14be('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x14be('0x9')](function(){console[_0x14be('0xc')](_0x14be('0xd'),'hopper1');return db[_0x14be('0xa')][_0x14be('0xb')](contacts2);})['then'](function(){console[_0x14be('0xc')](_0x14be('0xd'),'contacts2');return db[_0x14be('0xf')]['bulkCreate'](hopper2);})[_0x14be('0x9')](function(){console[_0x14be('0xc')]('finished\x20populating',_0x14be('0x10'));})[_0x14be('0x11')](function(_0x4ec979){console['log'](_0x4ec979);}); \ No newline at end of file +var _0x709b=['then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy'];(function(_0x387fbf,_0x23a6e7){var _0xcd3df2=function(_0x23e049){while(--_0x23e049){_0x387fbf['push'](_0x387fbf['shift']());}};_0xcd3df2(++_0x23a6e7);}(_0x709b,0xc8));var _0xb709=function(_0x28f537,_0x2299c2){_0x28f537=_0x28f537-0x0;var _0x4f4951=_0x709b[_0x28f537];return _0x4f4951;};'use strict';var util=require('util');var db=require(_0xb709('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb709('0x1')]({'id':i,'firstName':_0xb709('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xb709('0x3')+i+_0xb709('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb709('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb709('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xb709('0x2')+i,'lastName':_0xb709('0x6')+i,'phone':0xf879fb460+i,'email':_0xb709('0x3')+i+_0xb709('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb709('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xb709('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb709('0x5')](),'updatedAt':Date[_0xb709('0x5')]()});}db[_0xb709('0x7')][_0xb709('0x8')]({'where':{}})[_0xb709('0x9')](function(){return db[_0xb709('0x7')][_0xb709('0xa')](contacts);})['then'](function(){console[_0xb709('0xb')](_0xb709('0xc'),_0xb709('0xd'));return db[_0xb709('0xe')][_0xb709('0x8')]({'where':{}});})[_0xb709('0x9')](function(){return db['CmHopper'][_0xb709('0xa')](hopper);})['then'](function(){console[_0xb709('0xb')]('finished\x20populating',_0xb709('0xf'));return db[_0xb709('0x7')]['bulkCreate'](contacts2);})[_0xb709('0x9')](function(){console[_0xb709('0xb')](_0xb709('0xc'),_0xb709('0x10'));return db[_0xb709('0xe')][_0xb709('0xa')](hopper2);})['then'](function(){console[_0xb709('0xb')]('finished\x20populating',_0xb709('0x11'));})[_0xb709('0x12')](function(_0x2d06f2){console['log'](_0x2d06f2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index d999649..5d603e8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcee5=['\x22%s\x22\x20<%s>','User','then','log','add\x20user','util','../mysqldb','push','format','agent','%s%s','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x2c6ecb,_0x298253){var _0x58bbe2=function(_0x1f86bd){while(--_0x1f86bd){_0x2c6ecb['push'](_0x2c6ecb['shift']());}};_0x58bbe2(++_0x298253);}(_0xcee5,0x1cd));var _0x5cee=function(_0x25540d,_0x21acec){_0x25540d=_0x25540d-0x0;var _0x110407=_0xcee5[_0x25540d];return _0x110407;};'use strict';var util=require(_0x5cee('0x0'));var db=require(_0x5cee('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5cee('0x2')]({'name':util[_0x5cee('0x3')]('%s%s',_0x5cee('0x4'),i),'fullname':util[_0x5cee('0x3')](_0x5cee('0x5'),_0x5cee('0x4'),i),'email':util['format']('%s%s@xcally.com',_0x5cee('0x4'),i),'role':_0x5cee('0x4'),'password':_0x5cee('0x6'),'internal':0xfa0+i,'type':_0x5cee('0x7'),'transport':['udp','ws',_0x5cee('0x8')],'disallow':['all'],'allow':[_0x5cee('0x9')],'defaultuser':util['format'](_0x5cee('0x5'),_0x5cee('0x4'),i),'encryption':'yes','avpf':_0x5cee('0xa'),'force_avp':_0x5cee('0xa'),'icesupport':_0x5cee('0xa'),'dtlsenable':_0x5cee('0xa'),'dtlsverify':'no','dtlscertfile':_0x5cee('0xb'),'dtlsprivatekey':_0x5cee('0xc'),'dtlssetup':_0x5cee('0xd'),'callerid':util[_0x5cee('0x3')](_0x5cee('0xe'),util['format'](_0x5cee('0x5'),_0x5cee('0x4'),i),0xfa0+i)});}db[_0x5cee('0xf')]['bulkCreate'](users)[_0x5cee('0x10')](function(){console[_0x5cee('0x11')](_0x5cee('0x12'));})['catch'](function(_0x24a930){console[_0x5cee('0x11')](_0x24a930);}); \ No newline at end of file +var _0x2f0e=['util','push','format','agent','%s%s','wss','all','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log'];(function(_0x4b5b90,_0x25f0f5){var _0x1ad181=function(_0x45d59c){while(--_0x45d59c){_0x4b5b90['push'](_0x4b5b90['shift']());}};_0x1ad181(++_0x25f0f5);}(_0x2f0e,0x69));var _0xe2f0=function(_0x5b3f52,_0x550380){_0x5b3f52=_0x5b3f52-0x0;var _0x976a58=_0x2f0e[_0x5b3f52];return _0x976a58;};'use strict';var util=require(_0xe2f0('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe2f0('0x1')]({'name':util[_0xe2f0('0x2')]('%s%s',_0xe2f0('0x3'),i),'fullname':util[_0xe2f0('0x2')](_0xe2f0('0x4'),_0xe2f0('0x3'),i),'email':util[_0xe2f0('0x2')]('%s%s@xcally.com',_0xe2f0('0x3'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0xe2f0('0x5')],'disallow':[_0xe2f0('0x6')],'allow':[_0xe2f0('0x7')],'defaultuser':util['format'](_0xe2f0('0x4'),'agent',i),'encryption':_0xe2f0('0x8'),'avpf':_0xe2f0('0x8'),'force_avp':_0xe2f0('0x8'),'icesupport':_0xe2f0('0x8'),'dtlsenable':_0xe2f0('0x8'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xe2f0('0x9'),'callerid':util['format'](_0xe2f0('0xa'),util[_0xe2f0('0x2')](_0xe2f0('0x4'),_0xe2f0('0x3'),i),0xfa0+i)});}db[_0xe2f0('0xb')][_0xe2f0('0xc')](users)[_0xe2f0('0xd')](function(){console[_0xe2f0('0xe')]('add\x20user');})['catch'](function(_0x58f7eb){console['log'](_0x58f7eb);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index eb71ddc..3bb2ee1 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe451=['OpenchannelQueues','WhatsappQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','remoteAddress','connection','remotePort','connectedAt','nsp','CONNECTED','bluebird','Agents','User','name','role','telephone','agent','findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','map','resourceId','where','Campaign','type','%s:queue:%s','format','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','VoiceQueues','MailQueue'];(function(_0x567b93,_0x2999ae){var _0x424fa5=function(_0x15150d){while(--_0x15150d){_0x567b93['push'](_0x567b93['shift']());}};_0x424fa5(++_0x2999ae);}(_0xe451,0xec));var _0x1e45=function(_0x3d535a,_0x4e3d1e){_0x3d535a=_0x3d535a-0x0;var _0x106b18=_0xe451[_0x3d535a];return _0x106b18;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x1e45('0x0'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x1e45('0x1'),'model':db[_0x1e45('0x2')],'attributes':['id',_0x1e45('0x3'),_0x1e45('0x4')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1e45('0x3')],'where':{'role':_0x1e45('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1e45('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1e45('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1e45('0x3'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x144168,_0x320ca4,_0xde48d9){return db['UserProfileSection'][_0x1e45('0x7')]({'where':{'name':_0x144168,'userProfileId':_0x320ca4},'raw':!![]})[_0x1e45('0x8')](function(_0xdce498){if(_0xdce498){if(_0xdce498['autoAssociation']){switch(_0x144168){case'VoiceQueues':case _0x1e45('0x9'):case _0x1e45('0xa'):case _0x1e45('0xb'):case _0x1e45('0xc'):case'OpenchannelQueues':case _0x1e45('0xd'):return db[_0xde48d9][_0x1e45('0xe')](queryQueues);case _0x1e45('0xf'):return db[_0xde48d9]['findAll'](queryTelephones);case _0x1e45('0x10'):return db[_0xde48d9][_0x1e45('0xe')](queryTrunks);case _0x1e45('0x11'):return db[_0xde48d9][_0x1e45('0xe')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1e45('0xe')]({'attributes':['resourceId'],'where':{'sectionId':_0xdce498['id']},'raw':!![]})[_0x1e45('0x8')](function(_0x2c7ace){if(_0x2c7ace){var _0x4e1400={'where':{'id':_[_0x1e45('0x12')](_0x2c7ace,_0x1e45('0x13'))},'raw':!![]};switch(_0xde48d9){case _0x1e45('0x2'):_0x4e1400[_0x1e45('0x14')][_0x1e45('0x4')]=_0x1e45('0x5');break;case _0x1e45('0x15'):_0x4e1400[_0x1e45('0x14')][_0x1e45('0x16')]='ivr';break;}return db[_0xde48d9][_0x1e45('0xe')](_0x4e1400);}else{return[];}});}}else{return[];}})['then'](function(_0x5129aa){return _0x5129aa;});}function joinOrLeaveQueues(_0x17c63a,_0x598df4,_0x4e949d,_0x479bfc){_0x17c63a[_0x598df4](util['format'](_0x1e45('0x17'),_0x4e949d,_0x479bfc[_0x1e45('0x3')]));if(_0x479bfc['Agents']){for(var _0xc0deec=0x0;_0xc0deec<_0x479bfc['Agents']['length'];_0xc0deec+=0x1){_0x17c63a[_0x598df4](util[_0x1e45('0x18')]('user:%s',_0x479bfc['Agents'][_0xc0deec][_0x1e45('0x3')]));}}}function joinOrLeave(_0x236726,_0x4ce4c5,_0x48209a){var _0x2fb478;if(_0x236726[_0x1e45('0x19')][_0x1e45('0x1a')]['id']){db[_0x1e45('0x2')][_0x1e45('0x1b')]({'attributes':['id',_0x1e45('0x3'),'role',_0x1e45('0x1c')],'where':{'id':_0x236726[_0x1e45('0x19')][_0x1e45('0x1a')]['id']},'include':[{'model':db[_0x1e45('0x1d')],'as':_0x1e45('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e45('0x1f')],'as':_0x1e45('0x20'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x1e45('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e45('0x22')],'as':_0x1e45('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x1e45('0x24')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1e45('0x25')],'as':_0x1e45('0x26'),'attributes':['id'],'raw':!![]}]})[_0x1e45('0x8')](function(_0x5229e7){if(_0x5229e7){_0x2fb478=_0x5229e7;_0x236726[_0x4ce4c5](util[_0x1e45('0x18')]('user:%s',_0x5229e7[_0x1e45('0x3')]));var _0x55a329=[];switch(_0x5229e7['role']){case _0x1e45('0x27'):_0x236726[_0x4ce4c5](_0x1e45('0x28'));_0x236726[_0x4ce4c5](_0x1e45('0x29'));if(queryQueues[_0x1e45('0x2a')]('include')){delete queryQueues[_0x1e45('0x2b')];}_0x55a329['push'](db[_0x1e45('0x2c')][_0x1e45('0xe')](queryQueues));_0x55a329[_0x1e45('0x2d')](db['ChatQueue'][_0x1e45('0xe')](queryQueues));_0x55a329[_0x1e45('0x2d')](db[_0x1e45('0x2e')]['findAll'](queryQueues));_0x55a329[_0x1e45('0x2d')](db[_0x1e45('0x2f')][_0x1e45('0xe')](queryQueues));_0x55a329[_0x1e45('0x2d')](db['MailQueue'][_0x1e45('0xe')](queryQueues));_0x55a329[_0x1e45('0x2d')](db[_0x1e45('0x30')][_0x1e45('0xe')](queryQueues));_0x55a329[_0x1e45('0x2d')](db['WhatsappQueue']['findAll'](queryQueues));_0x55a329['push'](db['User'][_0x1e45('0xe')](queryTelephones));_0x55a329['push'](db[_0x1e45('0x31')][_0x1e45('0xe')](queryTrunks));_0x55a329['push'](db['Campaign'][_0x1e45('0xe')](queryCampaigns));_0x55a329[_0x1e45('0x2d')](db[_0x1e45('0x2')][_0x1e45('0xe')](queryAgents));break;case'user':_0x236726[_0x4ce4c5](_0x1e45('0x28'));_0x236726[_0x4ce4c5](_0x1e45('0x29'));_0x55a329[_0x1e45('0x2d')](getAssociatedResources(_0x1e45('0x32'),_0x5229e7['userProfileId'],_0x1e45('0x2c')));_0x55a329[_0x1e45('0x2d')](getAssociatedResources(_0x1e45('0x9'),_0x5229e7['userProfileId'],'ChatQueue'));_0x55a329[_0x1e45('0x2d')](getAssociatedResources('FaxQueues',_0x5229e7['userProfileId'],_0x1e45('0x2e')));_0x55a329['push'](getAssociatedResources('SmsQueues',_0x5229e7[_0x1e45('0x1c')],_0x1e45('0x2f')));_0x55a329[_0x1e45('0x2d')](getAssociatedResources(_0x1e45('0xc'),_0x5229e7[_0x1e45('0x1c')],_0x1e45('0x33')));_0x55a329[_0x1e45('0x2d')](getAssociatedResources(_0x1e45('0x34'),_0x5229e7[_0x1e45('0x1c')],'OpenchannelQueue'));_0x55a329[_0x1e45('0x2d')](getAssociatedResources(_0x1e45('0xd'),_0x5229e7[_0x1e45('0x1c')],_0x1e45('0x35')));_0x55a329['push'](getAssociatedResources(_0x1e45('0xf'),_0x5229e7[_0x1e45('0x1c')],_0x1e45('0x2')));_0x55a329[_0x1e45('0x2d')](getAssociatedResources('Trunks',_0x5229e7[_0x1e45('0x1c')],_0x1e45('0x31')));_0x55a329[_0x1e45('0x2d')](getAssociatedResources(_0x1e45('0x11'),_0x5229e7[_0x1e45('0x1c')],_0x1e45('0x15')));_0x55a329[_0x1e45('0x2d')](db[_0x1e45('0x2')][_0x1e45('0xe')](queryAgents));break;case _0x1e45('0x6'):_0x236726[_0x4ce4c5](_0x1e45('0x28'));_0x236726[_0x4ce4c5]('voice:outbound');_0x55a329[_0x1e45('0x2d')](_0x5229e7['getVoiceQueues']({'attributes':['id',_0x1e45('0x3')]}));_0x55a329[_0x1e45('0x2d')](_0x5229e7[_0x1e45('0x36')]({'attributes':['id',_0x1e45('0x3')]}));_0x55a329[_0x1e45('0x2d')](_0x5229e7[_0x1e45('0x37')]({'attributes':['id','name']}));_0x55a329[_0x1e45('0x2d')](_0x5229e7[_0x1e45('0x38')]({'attributes':['id',_0x1e45('0x3')]}));_0x55a329['push'](_0x5229e7[_0x1e45('0x39')]({'attributes':['id',_0x1e45('0x3')]}));_0x55a329[_0x1e45('0x2d')](_0x5229e7['getOpenchannelQueues']({'attributes':['id','name']}));_0x55a329['push'](_0x5229e7[_0x1e45('0x3a')]({'attributes':['id',_0x1e45('0x3')]}));break;}return BPromise[_0x1e45('0x3b')](_0x55a329);}})[_0x1e45('0x8')](function(_0x59c610){if(_0x59c610&&_0x59c610[_0x1e45('0x3c')]){for(var _0x32aeaf=0x0;_0x32aeaf<_0x59c610[_0x1e45('0x3c')];_0x32aeaf+=0x1){for(var _0x32b1b2=0x0;_0x32b1b2<_0x59c610[_0x32aeaf][_0x1e45('0x3c')];_0x32b1b2+=0x1){switch(_0x32aeaf){case 0x0:joinOrLeaveQueues(_0x236726,_0x4ce4c5,'voice',_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x1:joinOrLeaveQueues(_0x236726,_0x4ce4c5,_0x1e45('0x3d'),_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x2:joinOrLeaveQueues(_0x236726,_0x4ce4c5,_0x1e45('0x3e'),_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x3:joinOrLeaveQueues(_0x236726,_0x4ce4c5,_0x1e45('0x3f'),_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x4:joinOrLeaveQueues(_0x236726,_0x4ce4c5,_0x1e45('0x40'),_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x5:joinOrLeaveQueues(_0x236726,_0x4ce4c5,_0x1e45('0x41'),_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x6:joinOrLeaveQueues(_0x236726,_0x4ce4c5,'whatsapp',_0x59c610[_0x32aeaf][_0x32b1b2]);break;case 0x7:if(_0x2fb478[_0x1e45('0x4')]!==_0x1e45('0x6'))_0x236726[_0x4ce4c5](util[_0x1e45('0x18')](_0x1e45('0x42'),_0x59c610[_0x32aeaf][_0x32b1b2][_0x1e45('0x3')]));break;case 0x8:if(_0x2fb478[_0x1e45('0x4')]!=='agent')_0x236726[_0x4ce4c5](util[_0x1e45('0x18')](_0x1e45('0x43'),_0x59c610[_0x32aeaf][_0x32b1b2]['name']));break;case 0x9:if(_0x2fb478[_0x1e45('0x4')]!=='agent')_0x236726[_0x4ce4c5](util[_0x1e45('0x18')](_0x1e45('0x44'),_0x59c610[_0x32aeaf][_0x32b1b2]['type'],_0x59c610[_0x32aeaf][_0x32b1b2][_0x1e45('0x3')]));break;case 0xa:_0x236726[_0x4ce4c5](util[_0x1e45('0x18')](_0x1e45('0x45'),_0x59c610[_0x32aeaf][_0x32b1b2][_0x1e45('0x3')]));break;}}}}})[_0x1e45('0x8')](function(){if(_0x4ce4c5===_0x1e45('0x46')){var _0x263ad1=_['map'](_0x2fb478[_0x1e45('0x1e')],'id');return _0x2fb478[_0x1e45('0x47')](_0x263ad1)['then'](function(){for(var _0x54357f=0x0;_0x54357f<_0x263ad1[_0x1e45('0x3c')];_0x54357f+=0x1){_0x48209a['emit'](_0x1e45('0x48'),{'ChatInteractionId':Number(_0x263ad1[_0x54357f]),'UserId':Number(_0x2fb478['id'])});}});}})[_0x1e45('0x8')](function(){if(_0x4ce4c5==='leave'){var _0x39a8fc=_[_0x1e45('0x12')](_0x2fb478[_0x1e45('0x20')],'id');return _0x2fb478[_0x1e45('0x49')](_0x39a8fc)[_0x1e45('0x8')](function(){for(var _0x1fdab2=0x0;_0x1fdab2<_0x39a8fc[_0x1e45('0x3c')];_0x1fdab2+=0x1){_0x48209a[_0x1e45('0x4a')](_0x1e45('0x4b'),{'MailInteractionId':Number(_0x39a8fc[_0x1fdab2]),'UserId':Number(_0x2fb478['id'])});}});}})[_0x1e45('0x8')](function(){if(_0x4ce4c5===_0x1e45('0x46')){var _0x4e4694=_[_0x1e45('0x12')](_0x2fb478['FaxInteractions'],'id');return _0x2fb478[_0x1e45('0x4c')](_0x4e4694)[_0x1e45('0x8')](function(){for(var _0x7a1b9b=0x0;_0x7a1b9b<_0x4e4694[_0x1e45('0x3c')];_0x7a1b9b+=0x1){_0x48209a[_0x1e45('0x4a')](_0x1e45('0x4d'),{'FaxInteractionId':Number(_0x4e4694[_0x7a1b9b]),'UserId':Number(_0x2fb478['id'])});}});}})[_0x1e45('0x8')](function(){if(_0x4ce4c5===_0x1e45('0x46')){var _0xa857e8=_[_0x1e45('0x12')](_0x2fb478[_0x1e45('0x23')],'id');return _0x2fb478['removeSmsInteractions'](_0xa857e8)[_0x1e45('0x8')](function(){for(var _0x54e579=0x0;_0x54e579<_0xa857e8['length'];_0x54e579+=0x1){_0x48209a[_0x1e45('0x4a')](_0x1e45('0x4e'),{'SmsInteractionId':Number(_0xa857e8[_0x54e579]),'UserId':Number(_0x2fb478['id'])});}});}})[_0x1e45('0x8')](function(){if(_0x4ce4c5===_0x1e45('0x46')){var _0x266f30=_[_0x1e45('0x12')](_0x2fb478[_0x1e45('0x4f')],'id');return _0x2fb478[_0x1e45('0x50')](_0x266f30)['then'](function(){for(var _0x533576=0x0;_0x533576<_0x266f30['length'];_0x533576+=0x1){_0x48209a[_0x1e45('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x266f30[_0x533576]),'UserId':Number(_0x2fb478['id'])});}});}})[_0x1e45('0x8')](function(){if(_0x4ce4c5==='leave'){var _0x243c0b=_['map'](_0x2fb478['WhatsappInteractions'],'id');return _0x2fb478[_0x1e45('0x51')](_0x243c0b)['then'](function(){for(var _0x3d66e1=0x0;_0x3d66e1<_0x243c0b[_0x1e45('0x3c')];_0x3d66e1+=0x1){_0x48209a[_0x1e45('0x4a')](_0x1e45('0x52'),{'WhatsappInteractionId':Number(_0x243c0b[_0x3d66e1]),'UserId':Number(_0x2fb478['id'])});}});}})[_0x1e45('0x53')](function(_0x4a3ea4){_0x236726[_0x1e45('0x54')](_0x4a3ea4);});}}function onDisconnect(_0x48400f,_0xb159de){joinOrLeave(_0x48400f,_0x1e45('0x46'),_0xb159de);}function onConnect(_0x38b174){joinOrLeave(_0x38b174,_0x1e45('0x55'));}exports[_0x1e45('0x56')]=function(_0xf7e056){_0xf7e056['on']('connection',function(_0x438eeb){_0x438eeb[_0x1e45('0x57')](0x0);_0x438eeb[_0x1e45('0x58')]=_0x438eeb[_0x1e45('0x59')]['connection'][_0x1e45('0x5a')]+':'+_0x438eeb['request'][_0x1e45('0x5b')][_0x1e45('0x5c')];_0x438eeb[_0x1e45('0x5d')]=new Date();_0x438eeb['log']=function(_0x4399fc){console['log']('SocketIO\x20'+_0x438eeb[_0x1e45('0x5e')][_0x1e45('0x3')]+'['+_0x438eeb[_0x1e45('0x58')]+']',_0x4399fc);};_0x438eeb['on']('disconnect',function(){onDisconnect(_0x438eeb,_0xf7e056);_0x438eeb[_0x1e45('0x54')]('DISCONNECTED');});onConnect(_0x438eeb);_0x438eeb[_0x1e45('0x54')](_0x1e45('0x5f'));});}; \ No newline at end of file +var _0xce08=['WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','user:%s','find','userProfileId','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','ChatQueue','Trunk','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','emit','removeMailInteractions','length','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xce08,0xb4));var _0x8ce0=function(_0x28e3bd,_0x4f241e){_0x28e3bd=_0x28e3bd-0x0;var _0xec5ecf=_0xce08[_0x28e3bd];return _0xec5ecf;};'use strict';var _=require(_0x8ce0('0x0'));var util=require(_0x8ce0('0x1'));var BPromise=require(_0x8ce0('0x2'));var db=require(_0x8ce0('0x3'))['db'];var config=require(_0x8ce0('0x4'));var queryQueues={'attributes':['id',_0x8ce0('0x5')],'include':[{'as':_0x8ce0('0x6'),'model':db[_0x8ce0('0x7')],'attributes':['id','name',_0x8ce0('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8ce0('0x5')],'where':{'role':_0x8ce0('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x8ce0('0xa')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8ce0('0x5'),_0x8ce0('0xb')],'where':{'type':_0x8ce0('0xc')}};function getAssociatedResources(_0xbd08b6,_0x733de3,_0x2b5fa9){return db[_0x8ce0('0xd')][_0x8ce0('0xe')]({'where':{'name':_0xbd08b6,'userProfileId':_0x733de3},'raw':!![]})[_0x8ce0('0xf')](function(_0x57133f){if(_0x57133f){if(_0x57133f[_0x8ce0('0x10')]){switch(_0xbd08b6){case _0x8ce0('0x11'):case _0x8ce0('0x12'):case _0x8ce0('0x13'):case _0x8ce0('0x14'):case _0x8ce0('0x15'):case'OpenchannelQueues':case _0x8ce0('0x16'):return db[_0x2b5fa9][_0x8ce0('0x17')](queryQueues);case _0x8ce0('0x18'):return db[_0x2b5fa9]['findAll'](queryTelephones);case _0x8ce0('0x19'):return db[_0x2b5fa9]['findAll'](queryTrunks);case _0x8ce0('0x1a'):return db[_0x2b5fa9][_0x8ce0('0x17')](queryCampaigns);}}else{return db['UserProfileResource'][_0x8ce0('0x17')]({'attributes':[_0x8ce0('0x1b')],'where':{'sectionId':_0x57133f['id']},'raw':!![]})[_0x8ce0('0xf')](function(_0x2f961c){if(_0x2f961c){var _0x88994a={'where':{'id':_[_0x8ce0('0x1c')](_0x2f961c,'resourceId')},'raw':!![]};switch(_0x2b5fa9){case _0x8ce0('0x7'):_0x88994a[_0x8ce0('0x1d')][_0x8ce0('0x8')]=_0x8ce0('0x9');break;case _0x8ce0('0x1e'):_0x88994a[_0x8ce0('0x1d')][_0x8ce0('0xb')]=_0x8ce0('0xc');break;}return db[_0x2b5fa9][_0x8ce0('0x17')](_0x88994a);}else{return[];}});}}else{return[];}})[_0x8ce0('0xf')](function(_0x53d980){return _0x53d980;});}function joinOrLeaveQueues(_0x184f6e,_0x353b9f,_0x2ecdb3,_0x3a97b9){_0x184f6e[_0x353b9f](util[_0x8ce0('0x1f')](_0x8ce0('0x20'),_0x2ecdb3,_0x3a97b9[_0x8ce0('0x5')]));if(_0x3a97b9[_0x8ce0('0x6')]){for(var _0x3d3d6a=0x0;_0x3d3d6a<_0x3a97b9[_0x8ce0('0x6')]['length'];_0x3d3d6a+=0x1){_0x184f6e[_0x353b9f](util[_0x8ce0('0x1f')](_0x8ce0('0x21'),_0x3a97b9[_0x8ce0('0x6')][_0x3d3d6a][_0x8ce0('0x5')]));}}}function joinOrLeave(_0x11c68d,_0x521d6a,_0x9d940){var _0x3b8553;if(_0x11c68d['handshake']['query']['id']){db[_0x8ce0('0x7')][_0x8ce0('0x22')]({'attributes':['id',_0x8ce0('0x5'),_0x8ce0('0x8'),_0x8ce0('0x23')],'where':{'id':_0x11c68d[_0x8ce0('0x24')][_0x8ce0('0x25')]['id']},'include':[{'model':db[_0x8ce0('0x26')],'as':_0x8ce0('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x8ce0('0x28')],'as':_0x8ce0('0x29'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x8ce0('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x8ce0('0x2b')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8ce0('0x2c')],'as':_0x8ce0('0x2d'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x8ce0('0x2e'),'attributes':['id'],'raw':!![]}]})[_0x8ce0('0xf')](function(_0x9ac201){if(_0x9ac201){_0x3b8553=_0x9ac201;_0x11c68d[_0x521d6a](util['format'](_0x8ce0('0x21'),_0x9ac201[_0x8ce0('0x5')]));var _0x389138=[];switch(_0x9ac201['role']){case _0x8ce0('0x2f'):_0x11c68d[_0x521d6a](_0x8ce0('0x30'));_0x11c68d[_0x521d6a](_0x8ce0('0x31'));if(queryQueues[_0x8ce0('0x32')](_0x8ce0('0x33'))){delete queryQueues[_0x8ce0('0x33')];}_0x389138['push'](db[_0x8ce0('0x34')][_0x8ce0('0x17')](queryQueues));_0x389138[_0x8ce0('0x35')](db['ChatQueue'][_0x8ce0('0x17')](queryQueues));_0x389138[_0x8ce0('0x35')](db[_0x8ce0('0x36')][_0x8ce0('0x17')](queryQueues));_0x389138[_0x8ce0('0x35')](db[_0x8ce0('0x37')][_0x8ce0('0x17')](queryQueues));_0x389138[_0x8ce0('0x35')](db[_0x8ce0('0x38')][_0x8ce0('0x17')](queryQueues));_0x389138[_0x8ce0('0x35')](db[_0x8ce0('0x39')]['findAll'](queryQueues));_0x389138['push'](db[_0x8ce0('0x3a')][_0x8ce0('0x17')](queryQueues));_0x389138[_0x8ce0('0x35')](db['User'][_0x8ce0('0x17')](queryTelephones));_0x389138[_0x8ce0('0x35')](db['Trunk'][_0x8ce0('0x17')](queryTrunks));_0x389138[_0x8ce0('0x35')](db['Campaign'][_0x8ce0('0x17')](queryCampaigns));_0x389138[_0x8ce0('0x35')](db[_0x8ce0('0x7')][_0x8ce0('0x17')](queryAgents));break;case _0x8ce0('0x3b'):_0x11c68d[_0x521d6a](_0x8ce0('0x30'));_0x11c68d[_0x521d6a](_0x8ce0('0x31'));_0x389138['push'](getAssociatedResources('VoiceQueues',_0x9ac201['userProfileId'],_0x8ce0('0x34')));_0x389138['push'](getAssociatedResources(_0x8ce0('0x12'),_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x3c')));_0x389138['push'](getAssociatedResources(_0x8ce0('0x13'),_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x36')));_0x389138[_0x8ce0('0x35')](getAssociatedResources(_0x8ce0('0x14'),_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x37')));_0x389138[_0x8ce0('0x35')](getAssociatedResources(_0x8ce0('0x15'),_0x9ac201[_0x8ce0('0x23')],'MailQueue'));_0x389138['push'](getAssociatedResources('OpenchannelQueues',_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x39')));_0x389138[_0x8ce0('0x35')](getAssociatedResources(_0x8ce0('0x16'),_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x3a')));_0x389138[_0x8ce0('0x35')](getAssociatedResources(_0x8ce0('0x18'),_0x9ac201[_0x8ce0('0x23')],'User'));_0x389138[_0x8ce0('0x35')](getAssociatedResources(_0x8ce0('0x19'),_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x3d')));_0x389138[_0x8ce0('0x35')](getAssociatedResources(_0x8ce0('0x1a'),_0x9ac201[_0x8ce0('0x23')],_0x8ce0('0x1e')));_0x389138[_0x8ce0('0x35')](db[_0x8ce0('0x7')][_0x8ce0('0x17')](queryAgents));break;case'agent':_0x11c68d[_0x521d6a](_0x8ce0('0x30'));_0x11c68d[_0x521d6a]('voice:outbound');_0x389138['push'](_0x9ac201[_0x8ce0('0x3e')]({'attributes':['id',_0x8ce0('0x5')]}));_0x389138['push'](_0x9ac201[_0x8ce0('0x3f')]({'attributes':['id',_0x8ce0('0x5')]}));_0x389138[_0x8ce0('0x35')](_0x9ac201['getFaxQueues']({'attributes':['id','name']}));_0x389138['push'](_0x9ac201[_0x8ce0('0x40')]({'attributes':['id',_0x8ce0('0x5')]}));_0x389138[_0x8ce0('0x35')](_0x9ac201[_0x8ce0('0x41')]({'attributes':['id',_0x8ce0('0x5')]}));_0x389138[_0x8ce0('0x35')](_0x9ac201[_0x8ce0('0x42')]({'attributes':['id',_0x8ce0('0x5')]}));_0x389138[_0x8ce0('0x35')](_0x9ac201[_0x8ce0('0x43')]({'attributes':['id',_0x8ce0('0x5')]}));break;}return BPromise[_0x8ce0('0x44')](_0x389138);}})[_0x8ce0('0xf')](function(_0x1fe6b9){if(_0x1fe6b9&&_0x1fe6b9['length']){for(var _0x14d95a=0x0;_0x14d95a<_0x1fe6b9['length'];_0x14d95a+=0x1){for(var _0x123b4d=0x0;_0x123b4d<_0x1fe6b9[_0x14d95a]['length'];_0x123b4d+=0x1){switch(_0x14d95a){case 0x0:joinOrLeaveQueues(_0x11c68d,_0x521d6a,_0x8ce0('0x45'),_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x1:joinOrLeaveQueues(_0x11c68d,_0x521d6a,'chat',_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x2:joinOrLeaveQueues(_0x11c68d,_0x521d6a,_0x8ce0('0x46'),_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x3:joinOrLeaveQueues(_0x11c68d,_0x521d6a,_0x8ce0('0x47'),_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x4:joinOrLeaveQueues(_0x11c68d,_0x521d6a,_0x8ce0('0x48'),_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x5:joinOrLeaveQueues(_0x11c68d,_0x521d6a,_0x8ce0('0x49'),_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x6:joinOrLeaveQueues(_0x11c68d,_0x521d6a,_0x8ce0('0x4a'),_0x1fe6b9[_0x14d95a][_0x123b4d]);break;case 0x7:if(_0x3b8553[_0x8ce0('0x8')]!==_0x8ce0('0xa'))_0x11c68d[_0x521d6a](util[_0x8ce0('0x1f')](_0x8ce0('0x4b'),_0x1fe6b9[_0x14d95a][_0x123b4d][_0x8ce0('0x5')]));break;case 0x8:if(_0x3b8553[_0x8ce0('0x8')]!==_0x8ce0('0xa'))_0x11c68d[_0x521d6a](util[_0x8ce0('0x1f')]('trunk:%s',_0x1fe6b9[_0x14d95a][_0x123b4d][_0x8ce0('0x5')]));break;case 0x9:if(_0x3b8553[_0x8ce0('0x8')]!==_0x8ce0('0xa'))_0x11c68d[_0x521d6a](util['format'](_0x8ce0('0x4c'),_0x1fe6b9[_0x14d95a][_0x123b4d][_0x8ce0('0xb')],_0x1fe6b9[_0x14d95a][_0x123b4d][_0x8ce0('0x5')]));break;case 0xa:_0x11c68d[_0x521d6a](util[_0x8ce0('0x1f')](_0x8ce0('0x21'),_0x1fe6b9[_0x14d95a][_0x123b4d][_0x8ce0('0x5')]));break;}}}}})['then'](function(){if(_0x521d6a===_0x8ce0('0x4d')){var _0x53c673=_['map'](_0x3b8553[_0x8ce0('0x27')],'id');return _0x3b8553['removeChatInteractions'](_0x53c673)[_0x8ce0('0xf')](function(){for(var _0x3a1bba=0x0;_0x3a1bba<_0x53c673['length'];_0x3a1bba+=0x1){_0x9d940[_0x8ce0('0x4e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x53c673[_0x3a1bba]),'UserId':Number(_0x3b8553['id'])});}});}})[_0x8ce0('0xf')](function(){if(_0x521d6a===_0x8ce0('0x4d')){var _0x83eb79=_[_0x8ce0('0x1c')](_0x3b8553['MailInteractions'],'id');return _0x3b8553[_0x8ce0('0x4f')](_0x83eb79)['then'](function(){for(var _0x31f73d=0x0;_0x31f73d<_0x83eb79[_0x8ce0('0x50')];_0x31f73d+=0x1){_0x9d940[_0x8ce0('0x4e')](_0x8ce0('0x51'),{'MailInteractionId':Number(_0x83eb79[_0x31f73d]),'UserId':Number(_0x3b8553['id'])});}});}})[_0x8ce0('0xf')](function(){if(_0x521d6a===_0x8ce0('0x4d')){var _0x202226=_[_0x8ce0('0x1c')](_0x3b8553[_0x8ce0('0x2a')],'id');return _0x3b8553[_0x8ce0('0x52')](_0x202226)['then'](function(){for(var _0x451acb=0x0;_0x451acb<_0x202226['length'];_0x451acb+=0x1){_0x9d940[_0x8ce0('0x4e')](_0x8ce0('0x53'),{'FaxInteractionId':Number(_0x202226[_0x451acb]),'UserId':Number(_0x3b8553['id'])});}});}})[_0x8ce0('0xf')](function(){if(_0x521d6a===_0x8ce0('0x4d')){var _0x5b1cec=_[_0x8ce0('0x1c')](_0x3b8553[_0x8ce0('0x54')],'id');return _0x3b8553[_0x8ce0('0x55')](_0x5b1cec)[_0x8ce0('0xf')](function(){for(var _0x3fc49=0x0;_0x3fc49<_0x5b1cec[_0x8ce0('0x50')];_0x3fc49+=0x1){_0x9d940[_0x8ce0('0x4e')](_0x8ce0('0x56'),{'SmsInteractionId':Number(_0x5b1cec[_0x3fc49]),'UserId':Number(_0x3b8553['id'])});}});}})[_0x8ce0('0xf')](function(){if(_0x521d6a===_0x8ce0('0x4d')){var _0x21db0c=_[_0x8ce0('0x1c')](_0x3b8553['OpenchannelInteractions'],'id');return _0x3b8553['removeOpenchannelInteractions'](_0x21db0c)[_0x8ce0('0xf')](function(){for(var _0x271886=0x0;_0x271886<_0x21db0c['length'];_0x271886+=0x1){_0x9d940['emit'](_0x8ce0('0x57'),{'OpenchannelInteractionId':Number(_0x21db0c[_0x271886]),'UserId':Number(_0x3b8553['id'])});}});}})[_0x8ce0('0xf')](function(){if(_0x521d6a===_0x8ce0('0x4d')){var _0x182f63=_['map'](_0x3b8553[_0x8ce0('0x2e')],'id');return _0x3b8553[_0x8ce0('0x58')](_0x182f63)['then'](function(){for(var _0x59f8c2=0x0;_0x59f8c2<_0x182f63[_0x8ce0('0x50')];_0x59f8c2+=0x1){_0x9d940[_0x8ce0('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x182f63[_0x59f8c2]),'UserId':Number(_0x3b8553['id'])});}});}})[_0x8ce0('0x59')](function(_0xf74cc2){_0x11c68d[_0x8ce0('0x5a')](_0xf74cc2);});}}function onDisconnect(_0x16d505,_0x1395b8){joinOrLeave(_0x16d505,_0x8ce0('0x4d'),_0x1395b8);}function onConnect(_0xb00c6f){joinOrLeave(_0xb00c6f,_0x8ce0('0x5b'));}exports[_0x8ce0('0x5c')]=function(_0x5475e6){_0x5475e6['on'](_0x8ce0('0x5d'),function(_0x1c82e9){_0x1c82e9[_0x8ce0('0x5e')](0x0);_0x1c82e9[_0x8ce0('0x5f')]=_0x1c82e9['request'][_0x8ce0('0x5d')][_0x8ce0('0x60')]+':'+_0x1c82e9[_0x8ce0('0x61')][_0x8ce0('0x5d')][_0x8ce0('0x62')];_0x1c82e9[_0x8ce0('0x63')]=new Date();_0x1c82e9[_0x8ce0('0x5a')]=function(_0x32be39){console[_0x8ce0('0x5a')](_0x8ce0('0x64')+_0x1c82e9['nsp'][_0x8ce0('0x5')]+'['+_0x1c82e9[_0x8ce0('0x5f')]+']',_0x32be39);};_0x1c82e9['on']('disconnect',function(){onDisconnect(_0x1c82e9,_0x5475e6);_0x1c82e9[_0x8ce0('0x5a')]('DISCONNECTED');});onConnect(_0x1c82e9);_0x1c82e9[_0x8ce0('0x5a')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4da351d..bdc1ae8 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 _0xa4ee=['WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','EventManager','then','error','catch','Trigger,\x20%s','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','interface','format','name','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','contact','SIP/%s','agent','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','email','internal','length','model','hook','callback','toLowerCase','condition','util','jayson/promise','triggers','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp'];(function(_0x41ce33,_0x34278a){var _0x5119f5=function(_0xbe11fb){while(--_0xbe11fb){_0x41ce33['push'](_0x41ce33['shift']());}};_0x5119f5(++_0x34278a);}(_0xa4ee,0xc2));var _0xea4e=function(_0x236e77,_0x388743){_0x236e77=_0x236e77-0x0;var _0x59e31f=_0xa4ee[_0x236e77];return _0x59e31f;};'use strict';var util=require(_0xea4e('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xea4e('0x1'));var logger=require('../logger')(_0xea4e('0x2'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0xea4e('0x3'),'model':_0xea4e('0x4'),'event':_0xea4e('0x5'),'condition':_0xea4e('0x6'),'callback':afterCreate},{'channel':_0xea4e('0x3'),'model':_0xea4e('0x4'),'event':_0xea4e('0x7'),'condition':_0xea4e('0x8'),'callback':afterUpdate},{'channel':_0xea4e('0x3'),'model':_0xea4e('0x9'),'event':'afterCreate','condition':_0xea4e('0xa'),'callback':afterCreateMessage},{'channel':_0xea4e('0x3'),'model':_0xea4e('0xb'),'event':_0xea4e('0x5'),'condition':_0xea4e('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xea4e('0xc'),'model':_0xea4e('0xd'),'event':'afterCreate','condition':_0xea4e('0x6'),'callback':afterCreate},{'channel':_0xea4e('0xc'),'model':'SmsInteraction','event':_0xea4e('0x7'),'condition':_0xea4e('0x8'),'callback':afterUpdate},{'channel':'Sms','model':_0xea4e('0xe'),'event':_0xea4e('0x5'),'condition':_0xea4e('0xa'),'callback':afterCreateMessage},{'channel':_0xea4e('0xf'),'model':_0xea4e('0x10'),'event':_0xea4e('0x5'),'condition':_0xea4e('0x6'),'callback':afterCreate},{'channel':_0xea4e('0xf'),'model':_0xea4e('0x10'),'event':_0xea4e('0x7'),'condition':_0xea4e('0x8'),'callback':afterUpdate},{'channel':_0xea4e('0xf'),'model':_0xea4e('0x11'),'event':_0xea4e('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xea4e('0x12'),'model':_0xea4e('0x13'),'event':_0xea4e('0x5'),'condition':_0xea4e('0x6'),'callback':afterCreate},{'channel':_0xea4e('0x12'),'model':_0xea4e('0x13'),'event':_0xea4e('0x7'),'condition':_0xea4e('0x8'),'callback':afterUpdate},{'channel':_0xea4e('0x12'),'model':_0xea4e('0x14'),'event':_0xea4e('0x5'),'condition':_0xea4e('0xa'),'callback':afterCreateMessage},{'channel':_0xea4e('0x15'),'model':_0xea4e('0x16'),'event':_0xea4e('0x5'),'condition':_0xea4e('0x6'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0xea4e('0x7'),'condition':_0xea4e('0x8'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':'afterCreate','condition':_0xea4e('0xa'),'callback':afterCreateMessage},{'channel':_0xea4e('0x17'),'model':_0xea4e('0x18'),'event':_0xea4e('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xea4e('0x17'),'model':_0xea4e('0x18'),'event':_0xea4e('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xea4e('0x17'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xea4e('0xa'),'callback':afterCreateMessage}];function request(_0x21e6a7){return client['request'](_0xea4e('0x19'),_0x21e6a7)[_0xea4e('0x1a')](function(_0x16fd9a){logger['info']('Trigger,\x20%s',_0xea4e('0x19'),_0x16fd9a);if(_0x16fd9a[_0xea4e('0x1b')]){if(_0x16fd9a[_0xea4e('0x1b')]['code']===0x1f4){logger[_0xea4e('0x1b')]('Trigger,\x20%s',_0xea4e('0x19'),_0x16fd9a['error']);}}})[_0xea4e('0x1c')](function(_0x350f9b){logger[_0xea4e('0x1b')](_0xea4e('0x1d'),'EventManager',_0x350f9b);});}function afterCreateMessage(_0x560a4a){return function(_0x1aece4){_0x1aece4=_0x1aece4[_0xea4e('0x1e')]({'plain':!![]});_0x1aece4[_0xea4e('0x1f')]=_0x560a4a;_0x1aece4[_0xea4e('0x20')]=_0x560a4a;_0x1aece4[_0xea4e('0x21')]=_0x1aece4[_0xea4e('0x22')];Promise[_0xea4e('0x23')]()['then'](function(){if(typeof _0x1aece4[_0xea4e('0x24')]===_0xea4e('0x25'))return null;var _0x9dd54c=_0xea4e('0x26')+_0x1aece4[_0xea4e('0x24')];return db[_0xea4e('0x27')]['query'](_0x9dd54c,{'type':db[_0xea4e('0x28')][_0xea4e('0x29')][_0xea4e('0x2a')],'raw':!![]});})[_0xea4e('0x1a')](function(_0x57cdd7){if(_0x57cdd7){_0x1aece4['contact']=_0x57cdd7[0x0];}if(typeof _0x1aece4['UserId']==='undefined')return;return getAgent(_0x1aece4[_0xea4e('0x2b')]);})[_0xea4e('0x1a')](function(_0x4a9c64){if(_0x4a9c64){_0x1aece4[_0xea4e('0x2c')]=util[_0xea4e('0x2d')]('SIP/%s',_0x4a9c64[_0xea4e('0x2e')]);_0x1aece4['agent']=_0x4a9c64;_0x1aece4[_0xea4e('0x1f')]=_0x560a4a;return request({'event':_0xea4e('0x2f'),'message':_0x1aece4});}else{return request({'event':_0xea4e('0x30'),'message':_0x1aece4});}})[_0xea4e('0x1c')](function(_0x2ac6e3){logger[_0xea4e('0x1b')](_0xea4e('0x1d'),_0xea4e('0x31'),_0x2ac6e3);});};}function afterCreateOfflineMessage(_0x204588){return function(_0x383998){_0x383998=_0x383998[_0xea4e('0x1e')]({'plain':!![]});_0x383998[_0xea4e('0x1f')]=_0x204588;_0x383998[_0xea4e('0x20')]=_0x204588;_0x383998[_0xea4e('0x21')]=_0xea4e('0x32');return request({'event':_0x383998[_0xea4e('0x21')],'message':_0x383998});};}function afterCreate(_0x5eeb9d,_0x5a87d8){return function(_0x1bdbb6){_0x1bdbb6=_0x1bdbb6[_0xea4e('0x1e')]({'plain':!![]});_0x1bdbb6[_0xea4e('0x1f')]=_0x5eeb9d;_0x1bdbb6[_0xea4e('0x20')]=_0x5eeb9d;_0x1bdbb6['event']=_0xea4e('0x33');Promise[_0xea4e('0x23')]()['then'](function(){var _0x10a47c=_0xea4e('0x26')+_0x1bdbb6['ContactId'];return db[_0xea4e('0x27')]['query'](_0x10a47c,{'type':db['Sequelize'][_0xea4e('0x29')][_0xea4e('0x2a')],'raw':!![]});})['then'](function(_0x3b0d47){if(_0x3b0d47){_0x1bdbb6[_0xea4e('0x34')]=_0x3b0d47[0x0];}if(typeof _0x1bdbb6[_0xea4e('0x2b')]===_0xea4e('0x25'))return;return getAgent(_0x1bdbb6[_0xea4e('0x2b')]);})['then'](function(_0x3ef7db){if(_0x3ef7db){_0x1bdbb6[_0xea4e('0x2c')]=util['format'](_0xea4e('0x35'),_0x3ef7db[_0xea4e('0x2e')]);_0x1bdbb6[_0xea4e('0x36')]=_0x3ef7db;}return request({'event':_0x5a87d8,'message':_0x1bdbb6});})['catch'](function(_0x4d0870){logger[_0xea4e('0x1b')](_0xea4e('0x1d'),_0xea4e('0x37'),_0x4d0870);});};}function afterUpdate(_0x182217){return function(_0x5e0dd4){var _0x3678b0=_0x5e0dd4[_0xea4e('0x38')](_0xea4e('0x39'))&&_0x5e0dd4['closed'];var _0x22dbb9=_0x5e0dd4[_0xea4e('0x38')](_0xea4e('0x3a'));if(_0x3678b0||_0x22dbb9){var _0x51900f=_0x3678b0?_0xea4e('0x8'):'substatus';var _0x5b78b1=_0x5e0dd4[_0xea4e('0x1e')]({'plain':!![]});_0x5b78b1[_0xea4e('0x1f')]=_0x182217;_0x5b78b1[_0xea4e('0x20')]=_0x182217;_0x5b78b1[_0xea4e('0x21')]=_0x3678b0?_0xea4e('0x39'):'substatus';var _0xd9046d=_0xea4e('0x26')+_0x5b78b1[_0xea4e('0x24')];return db[_0xea4e('0x27')]['query'](_0xd9046d,{'type':db[_0xea4e('0x28')][_0xea4e('0x29')][_0xea4e('0x2a')],'raw':!![]})[_0xea4e('0x1a')](function(_0x2c6ebf){if(_0x2c6ebf){_0x5b78b1[_0xea4e('0x34')]=_0x2c6ebf[0x0];}if(typeof _0x5b78b1[_0xea4e('0x2b')]===_0xea4e('0x25'))return;return getAgent(_0x5b78b1[_0xea4e('0x2b')]);})['then'](function(_0x338edf){if(_0x338edf){_0x5b78b1[_0xea4e('0x2c')]=util[_0xea4e('0x2d')](_0xea4e('0x35'),_0x338edf[_0xea4e('0x2e')]);_0x5b78b1[_0xea4e('0x36')]=_0x338edf;}return request({'event':_0x51900f,'message':_0x5b78b1});})[_0xea4e('0x1c')](function(_0x51f7a6){logger[_0xea4e('0x1b')]('Trigger,\x20%s',_0xea4e('0x3b'),_0x51f7a6);});}};}function getAgent(_0x25b476){return db[_0xea4e('0x3c')][_0xea4e('0x3d')]({'where':{'id':_0x25b476},'attributes':['id',_0xea4e('0x2e'),'fullname',_0xea4e('0x3e'),_0xea4e('0x3f')],'raw':!![]})['then'](function(_0x333007){return _0x333007;});}exports['default']=function(){for(var _0x2fbf2a=0x0;_0x2fbf2a=_0x21155c['agents']){throw Error(_0x85c1('0x17'));}_0x2e8e62(_0x60eb5d);})[_0x85c1('0x18')](function(_0x2aa716){_0x1136c4(_0x2aa716);});});}; \ No newline at end of file +var _0x6356=['clearBlockUser','isUndefined','blockedAt','updateAttributes','role','User','count','getLicense','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes'];(function(_0x55ec88,_0xff4d64){var _0x739aad=function(_0x1ceb43){while(--_0x1ceb43){_0x55ec88['push'](_0x55ec88['shift']());}};_0x739aad(++_0xff4d64);}(_0x6356,0x144));var _0x6635=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0x6356[_0x1a89ca];return _0x29cbb2;};'use strict';var _=require(_0x6635('0x0'));var BPromise=require('bluebird');var db=require(_0x6635('0x1'))['db'];var util=require(_0x6635('0x2'));var channels=[_0x6635('0x3'),_0x6635('0x4'),_0x6635('0x5'),_0x6635('0x6'),_0x6635('0x7'),_0x6635('0x8'),_0x6635('0x9')];exports[_0x6635('0xa')]=function(){return channels;};exports[_0x6635('0xb')]=function(_0x3404ce){_0x3404ce=_0x3404ce[_0x6635('0xc')]();return _[_0x6635('0xd')](channels,_0x3404ce);};exports[_0x6635('0xe')]=function(_0x37dbb4,_0x3f309b,_0x3c452a,_0x6a6770){var _0x31b9fd={'loginAttempts':_0x3f309b,'blocked':_0x3c452a};if(!_[_0x6635('0xf')](_0x6a6770)){_0x31b9fd[_0x6635('0x10')]=_0x6a6770;}return _0x37dbb4[_0x6635('0x11')](_0x31b9fd);};exports['getLicense']=function(_0x40786b){return new BPromise(function(_0x2164c2,_0x5b1ecb){var _0x266112=0x0;if(_0x40786b[_0x6635('0x12')]!=='agent'){_0x2164c2(_0x40786b);}db[_0x6635('0x13')][_0x6635('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x40786b['id']}}})['then'](function(_0x2a336e){_0x266112=_0x2a336e;return util[_0x6635('0x15')]();})[_0x6635('0x16')](function(_0x59c909){if(_0x59c909&&_0x59c909[_0x6635('0x17')]&&_0x266112>=_0x59c909[_0x6635('0x17')]){throw Error(_0x6635('0x18'));}_0x2164c2(_0x40786b);})[_0x6635('0x19')](function(_0x37e6b1){_0x5b1ecb(_0x37e6b1);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 314da4d..b8602c2 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['error','status','util','../config/logger','message','name','Error','inherits','Entity\x20not\x20found','Forbidden','OutOfInterval','Not\x20Found'];(function(_0x17125e,_0x29e0ea){var _0x8042d0=function(_0x4bfaa6){while(--_0x4bfaa6){_0x17125e['push'](_0x17125e['shift']());}};_0x8042d0(++_0x29e0ea);}(_0xb43b,0x1b2));var _0xbb43=function(_0xe186c1,_0x2fff86){_0xe186c1=_0xe186c1-0x0;var _0x188a76=_0xb43b[_0xe186c1];return _0x188a76;};'use strict';var util=require(_0xbb43('0x0'));var logger=require(_0xbb43('0x1'))('api');var APIError=function(_0x1bdcfc,_0x1995f8){this[_0xbb43('0x2')]=_0x1bdcfc||'Internal\x20Server\x20Error';this[_0xbb43('0x3')]=_0x1995f8||_0xbb43('0x4');util[_0xbb43('0x5')](APIError,Error);};var APIBadRequestError=function(_0x16432a){this['message']=_0x16432a||'Bad\x20Request';this[_0xbb43('0x3')]='Bad\x20Request';util[_0xbb43('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1ccd49){this[_0xbb43('0x2')]=_0x1ccd49||_0xbb43('0x6');this[_0xbb43('0x3')]='Not\x20Found';util[_0xbb43('0x5')](APINotFoundError,APIError);};function getStatusCode(_0xf54ac5){switch(_0xf54ac5){case'Bad\x20Request':return 0x190;case _0xbb43('0x7'),_0xbb43('0x8'):return 0x193;case _0xbb43('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x5e3611){return function(_0xfac791){logger[_0xbb43('0xa')](_0xfac791['stack']);var _0x36a473=getStatusCode(_0xfac791[_0xbb43('0x3')]);if(_0xfac791['name'])delete _0xfac791['name'];return _0x5e3611[_0xbb43('0xb')](_0x36a473)['send'](_0xfac791);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x9bde=['exports','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','OutOfInterval','error','stack','send'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4873f5,_0x43c409){_0x4873f5=_0x4873f5-0x0;var _0x1402d2=_0x9bde[_0x4873f5];return _0x1402d2;};'use strict';var util=require('util');var logger=require(_0xe9bd('0x0'))('api');var APIError=function(_0xc79e0b,_0x4c63ca){this[_0xe9bd('0x1')]=_0xc79e0b||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x4c63ca||_0xe9bd('0x4');util[_0xe9bd('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1a4d14){this[_0xe9bd('0x1')]=_0x1a4d14||'Bad\x20Request';this[_0xe9bd('0x3')]=_0xe9bd('0x6');util[_0xe9bd('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xa66ae2){this[_0xe9bd('0x1')]=_0xa66ae2||_0xe9bd('0x7');this[_0xe9bd('0x3')]=_0xe9bd('0x8');util[_0xe9bd('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x45c7ba){switch(_0x45c7ba){case'Bad\x20Request':return 0x190;case'Forbidden',_0xe9bd('0x9'):return 0x193;case _0xe9bd('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2601ac){return function(_0x581ab9){logger[_0xe9bd('0xa')](_0x581ab9[_0xe9bd('0xb')]);var _0x3339f9=getStatusCode(_0x581ab9[_0xe9bd('0x3')]);if(_0x581ab9['name'])delete _0x581ab9[_0xe9bd('0x3')];return _0x2601ac['status'](_0x3339f9)[_0xe9bd('0xc')](_0x581ab9);};}module[_0xe9bd('0xd')]={'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 bd65ea7..0dea5a9 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa512=['status','render','404'];(function(_0xeb4c8b,_0x1dc497){var _0x90b0d0=function(_0x332e32){while(--_0x332e32){_0xeb4c8b['push'](_0xeb4c8b['shift']());}};_0x90b0d0(++_0x1dc497);}(_0xa512,0xcb));var _0x2a51=function(_0x5f0c2e,_0x33309f){_0x5f0c2e=_0x5f0c2e-0x0;var _0x1c2dda=_0xa512[_0x5f0c2e];return _0x1c2dda;};'use strict';module['exports'][0x194]=function pageNotFound(_0x10ae19,_0x29f531){var _0x8c6743=_0x2a51('0x0');var _0x1f8cff=0x194;var _0x4425c5={'status':_0x1f8cff};_0x29f531[_0x2a51('0x1')](_0x4425c5[_0x2a51('0x1')]);_0x29f531[_0x2a51('0x2')](_0x8c6743,{},function(_0xf2099b,_0x7cf4b8){if(_0xf2099b){return _0x29f531[_0x2a51('0x1')](_0x4425c5['status'])['json'](_0x4425c5);}_0x29f531['send'](_0x7cf4b8);});}; \ No newline at end of file +var _0xf79b=['404','status','render','json','send'];(function(_0xc2efdb,_0xf7047){var _0x4c98c4=function(_0x16c6a2){while(--_0x16c6a2){_0xc2efdb['push'](_0xc2efdb['shift']());}};_0x4c98c4(++_0xf7047);}(_0xf79b,0xa0));var _0xbf79=function(_0x2da485,_0x45b3f2){_0x2da485=_0x2da485-0x0;var _0x33a0ec=_0xf79b[_0x2da485];return _0x33a0ec;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2ac377,_0x15d780){var _0x5389ed=_0xbf79('0x0');var _0x157ab6=0x194;var _0x1a53e4={'status':_0x157ab6};_0x15d780['status'](_0x1a53e4[_0xbf79('0x1')]);_0x15d780[_0xbf79('0x2')](_0x5389ed,{},function(_0x238ca0,_0x106e28){if(_0x238ca0){return _0x15d780[_0xbf79('0x1')](_0x1a53e4[_0xbf79('0x1')])[_0xbf79('0x3')](_0x1a53e4);}_0x15d780[_0xbf79('0x4')](_0x106e28);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9fd2a86..e9d39b7 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x922a=['password','options','username','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../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','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','userSetting','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','ChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperFinal','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','CmContact','Contact','MailAccountId','MailServerOut','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','Dashboard','Items','FaxAccountId','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatMessage','user_has_chat_websites','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CmContactHasItem','Phones','CmContactId','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Mohs','whatsapp_interaction_has_tags','ItemType','TriggerAnyId','Actions','Fields','DefaultReportId','AnalyticMetric','MetricId','Configurations','AccountId','SalesforceConfiguration','SalesforceField','SubjectId','DescriptionId','FieldId','Description','VariableId','SugarcrmField','Subjects','Descriptions','Field','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','Subject','ZohoField','ZendeskConfiguration','ZendeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Field','FromId','ToId','SessionId','ProjectId','JscriptyProject','ChatQueues','TeamVoicePrefix','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','ToQueueId','team_has_whatsapp_queues','user','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','database'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x922a,0x1ed));var _0xa922=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x922a[_0x1ac595];return _0x455fff;};'use strict';var config=require(_0xa922('0x0'));var Sequelize=require(_0xa922('0x1'));var _=require(_0xa922('0x2'));var jstz=require(_0xa922('0x3'));var timezone=jstz['determine']();config[_0xa922('0x1')]=_[_0xa922('0x4')](config[_0xa922('0x1')],{'database':_0xa922('0x5'),'username':_0xa922('0x6'),'password':_0xa922('0x7'),'options':{'host':_0xa922('0x8'),'port':0xcea,'dialect':_0xa922('0x9'),'dialectOptions':{'charset':_0xa922('0xa')},'logging':![],'timezone':timezone[_0xa922('0xb')](),'define':{'charset':'utf8','collate':_0xa922('0xc')}}});config[_0xa922('0xd')]=_[_0xa922('0x4')](config[_0xa922('0xd')],{'database':_0xa922('0x5'),'username':_0xa922('0x6'),'password':_0xa922('0x7'),'options':{'host':_0xa922('0x8'),'port':0xcea,'dialect':_0xa922('0x9'),'dialectOptions':{'charset':_0xa922('0xa')},'logging':![],'timezone':timezone[_0xa922('0xb')](),'define':{'charset':'utf8','collate':_0xa922('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa922('0x1')][_0xa922('0xe')],config['sequelize']['username'],config[_0xa922('0x1')][_0xa922('0xf')],config[_0xa922('0x1')][_0xa922('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xa922('0xe')],config['sequelizeHistory'][_0xa922('0x11')],config[_0xa922('0xd')][_0xa922('0xf')],config[_0xa922('0xd')][_0xa922('0x10')])};db[_0xa922('0x12')]=db[_0xa922('0x1')]['import'](_0xa922('0x13'));db[_0xa922('0x14')]=db[_0xa922('0x1')]['import'](_0xa922('0x15'));db['VoiceContext']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x17'));db[_0xa922('0x18')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x19'));db['VoiceMusicOnHold']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x1a'));db[_0xa922('0x1b')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x1c'));db[_0xa922('0x1d')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x1e'));db['ScreenRecording']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x1f'));db[_0xa922('0x20')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x21'));db['VoiceMailMessage']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x22'));db[_0xa922('0x23')]=db['sequelize']['import'](_0xa922('0x24'));db[_0xa922('0x25')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x26'));db[_0xa922('0x27')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa922('0x28')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x29'));db['MemberReport']=db[_0xa922('0x1')]['import'](_0xa922('0x2a'));db[_0xa922('0x2b')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x2c'));db['VoiceTransferReport']=db[_0xa922('0x1')][_0xa922('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xa922('0x2d')]=db[_0xa922('0x1')]['import'](_0xa922('0x2e'));db[_0xa922('0x2f')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xa922('0x30')]=db['sequelize']['import'](_0xa922('0x31'));db['UserMailQueue']=db['sequelize'][_0xa922('0x16')](_0xa922('0x32'));db[_0xa922('0x33')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x34'));db[_0xa922('0x35')]=db[_0xa922('0x1')]['import'](_0xa922('0x36'));db[_0xa922('0x37')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x38'));db[_0xa922('0x39')]=db[_0xa922('0x1')]['import'](_0xa922('0x3a'));db[_0xa922('0x3b')]=db['sequelize']['import'](_0xa922('0x3c'));db['MailServerOut']=db['sequelize'][_0xa922('0x16')](_0xa922('0x3d'));db[_0xa922('0x3e')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x3f'));db[_0xa922('0x40')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x41'));db['MailSubstatus']=db['sequelize'][_0xa922('0x16')]('../api/mailSubstatus/mailSubstatus.model');db[_0xa922('0x42')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x43'));db[_0xa922('0x44')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x45'));db[_0xa922('0x46')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/mailApplication/mailApplication.model');db[_0xa922('0x47')]=db[_0xa922('0x1')]['import'](_0xa922('0x48'));db['Dashboard']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x49'));db[_0xa922('0x4a')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x4b'));db[_0xa922('0x4c')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x4d'));db[_0xa922('0x4e')]=db[_0xa922('0x1')]['import'](_0xa922('0x4f'));db['FaxInteraction']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x50'));db[_0xa922('0x51')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x52'));db[_0xa922('0x53')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x54'));db[_0xa922('0x55')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x56'));db[_0xa922('0x57')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x58'));db['SmsApplication']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x59'));db['SmsInteraction']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x5a'));db[_0xa922('0x5b')]=db['sequelize'][_0xa922('0x16')]('../api/smsMessage/smsMessage.model');db[_0xa922('0x5c')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x5d'));db[_0xa922('0x5e')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x5f'));db[_0xa922('0x60')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x61'));db[_0xa922('0x62')]=db[_0xa922('0x1')]['import'](_0xa922('0x63'));db[_0xa922('0x64')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x65'));db[_0xa922('0x66')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x67'));db[_0xa922('0x68')]=db['sequelize'][_0xa922('0x16')]('../api/chatWebsite/chatWebsite.model');db[_0xa922('0x69')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x6a'));db[_0xa922('0x6b')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x6c'));db[_0xa922('0x6d')]=db[_0xa922('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x6e'));db[_0xa922('0x6f')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0xa922('0x1')][_0xa922('0x16')]('../api/chatQueue/chatQueue.model');db[_0xa922('0x70')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/chatGroup/chatGroup.model');db[_0xa922('0x71')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x72'));db[_0xa922('0x73')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x74'));db['CmContact']=db[_0xa922('0x1')]['import'](_0xa922('0x75'));db[_0xa922('0x76')]=db[_0xa922('0x1')]['import'](_0xa922('0x77'));db[_0xa922('0x78')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x79'));db[_0xa922('0x7a')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x7b'));db[_0xa922('0x7c')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x7d'));db['CmCustomField']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x7e'));db[_0xa922('0x7f')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x80'));db[_0xa922('0x81')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x82'));db[_0xa922('0x83')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x84'));db[_0xa922('0x85')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/disposition/disposition.model');db[_0xa922('0x86')]=db['sequelize'][_0xa922('0x16')]('../api/condition/condition.model');db[_0xa922('0x87')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x88'));db['Pause']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x89'));db[_0xa922('0x8a')]=db['sequelize'][_0xa922('0x16')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x8b'));db[_0xa922('0x8c')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x8d'));db[_0xa922('0x8e')]=db[_0xa922('0x1')]['import'](_0xa922('0x8f'));db[_0xa922('0x90')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x91'));db[_0xa922('0x92')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x93'));db['CmContactHasItem']=db['sequelize'][_0xa922('0x16')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xa922('0x94')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x95'));db[_0xa922('0x96')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x97'));db[_0xa922('0x98')]=db[_0xa922('0x1')]['import'](_0xa922('0x99'));db[_0xa922('0x9a')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/variable/variable.model');db[_0xa922('0x9b')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x9c'));db[_0xa922('0x9d')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/integrationReport/integrationReport.model');db[_0xa922('0x9e')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x9f'));db[_0xa922('0xa0')]=db[_0xa922('0x1')]['import'](_0xa922('0xa1'));db[_0xa922('0xa2')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0xa922('0x1')][_0xa922('0x16')]('../api/analyticMetric/analyticMetric.model');db[_0xa922('0xa3')]=db['sequelize'][_0xa922('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xa922('0xa4')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xa5'));db[_0xa922('0xa6')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db['sequelize'][_0xa922('0x16')](_0xa922('0xa7'));db['SalesforceField']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xa8'));db[_0xa922('0xa9')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xa922('0xaa')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db['sequelize']['import'](_0xa922('0xab'));db['DeskAccount']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xac'));db['DeskConfiguration']=db[_0xa922('0x1')][_0xa922('0x16')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xa922('0xad')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xae'));db[_0xa922('0xaf')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xb0'));db[_0xa922('0xb1')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xb2'));db['ZohoField']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xb3'));db[_0xa922('0xb4')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0xa922('0x16')](_0xa922('0xb5'));db['ZendeskField']=db[_0xa922('0x1')][_0xa922('0x16')]('../api/intZendeskField/intZendeskField.model');db[_0xa922('0xb6')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xb7'));db[_0xa922('0xb8')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xb9'));db[_0xa922('0xba')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa922('0xbb')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xbc'));db['VtigerConfiguration']=db[_0xa922('0x1')]['import'](_0xa922('0xbd'));db['VtigerField']=db['sequelize'][_0xa922('0x16')](_0xa922('0xbe'));db[_0xa922('0xbf')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xc0'));db[_0xa922('0xc1')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xc2'));db[_0xa922('0xc3')]=db[_0xa922('0x1')]['import'](_0xa922('0xc4'));db[_0xa922('0xc5')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xc6'));db[_0xa922('0xc7')]=db[_0xa922('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xc8'));db['FreshsalesAccount']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xc9'));db[_0xa922('0xca')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xcb'));db[_0xa922('0xcc')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xcd'));db[_0xa922('0x9b')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x9c'));db['Network']=db['sequelize'][_0xa922('0x16')]('../api/network/network.model');db[_0xa922('0xce')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xcf'));db[_0xa922('0xd0')]=db['sequelize']['import'](_0xa922('0xd1'));db[_0xa922('0xd2')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xa922('0xd3')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xd4'));db[_0xa922('0xd5')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xd6'));db[_0xa922('0xd7')]=db[_0xa922('0x1')]['import'](_0xa922('0xd8'));db[_0xa922('0xd9')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xda'));db[_0xa922('0xdb')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0xa922('0x1')]['import'](_0xa922('0xdc'));db[_0xa922('0xdd')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/setting/setting.model');db[_0xa922('0xde')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xdf'));db[_0xa922('0xe0')]=db['sequelize'][_0xa922('0x16')]('../api/squareProject/squareProject.model');db[_0xa922('0xe1')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xe2'));db['SquareMessage']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xe3'));db[_0xa922('0xe4')]=db[_0xa922('0x1')]['import']('../api/team/team.model');db[_0xa922('0xe5')]=db[_0xa922('0x1')]['import'](_0xa922('0xe6'));db[_0xa922('0xe7')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xe8'));db[_0xa922('0xe9')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xea'));db[_0xa922('0xeb')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xec'));db['Plugin']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xed'));db['MailTransferReport']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xee'));db[_0xa922('0xef')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xf0'));db[_0xa922('0xf1')]=db[_0xa922('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xf2'));db['SmsTransferReport']=db['sequelize']['import'](_0xa922('0xf3'));db[_0xa922('0xf4')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xf5'));db['VoicePrefix']=db['sequelize'][_0xa922('0x16')]('../api/voicePrefix/voicePrefix.model');db[_0xa922('0xf6')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xf7'));db[_0xa922('0xf8')]=db['sequelize'][_0xa922('0x16')](_0xa922('0xf9'));db['UserProfileResource']=db[_0xa922('0x1')]['import'](_0xa922('0xfa'));db[_0xa922('0xfb')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xfc'));db['WhatsappAccount']=db['sequelize']['import'](_0xa922('0xfd'));db[_0xa922('0xfe')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0xff'));db['WhatsappInteraction']=db[_0xa922('0x1')]['import'](_0xa922('0x100'));db['WhatsappMessage']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x101'));db['WhatsappQueueReport']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x102'));db[_0xa922('0x103')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x104'));db[_0xa922('0x105')]=db['sequelize'][_0xa922('0x16')](_0xa922('0x106'));db[_0xa922('0x107')]=db[_0xa922('0x1')]['import'](_0xa922('0x108'));db[_0xa922('0x109')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x10a'));db['TeamVoicePrefix']=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x10b'));db[_0xa922('0x10c')]=db[_0xa922('0x1')][_0xa922('0x16')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xa922('0x10d')]=db[_0xa922('0x1')][_0xa922('0x16')](_0xa922('0x10e'));db[_0xa922('0x12')][_0xa922('0x10f')](db[_0xa922('0x20')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0xa922('0x12')][_0xa922('0x10f')](db[_0xa922('0x10d')],{'as':_0xa922('0x110'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x12')][_0xa922('0x113')](db[_0xa922('0x1d')],{'as':'Recordings','foreignKey':_0xa922('0x112')});db['User'][_0xa922('0x113')](db[_0xa922('0x2d')],{'as':_0xa922('0x114'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x12')][_0xa922('0x113')](db['VoiceExtension'],{'as':_0xa922('0x115'),'onDelete':_0xa922('0x111'),'hooks':!![]});db['User'][_0xa922('0x113')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xa922('0x112')});db[_0xa922('0x12')][_0xa922('0x113')](db[_0xa922('0x7a')],{'as':_0xa922('0x116'),'foreignKey':_0xa922('0x112')});db['User'][_0xa922('0x113')](db['ReportAgentPreview'],{'as':_0xa922('0x7c'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x12')][_0xa922('0x113')](db[_0xa922('0x62')],{'as':_0xa922('0x117'),'foreignKey':_0xa922('0x112')});db['User'][_0xa922('0x113')](db[_0xa922('0x6d')],{'as':_0xa922('0x118'),'foreignKey':_0xa922('0x112')});db['User'][_0xa922('0x113')](db[_0xa922('0x119')],{'as':_0xa922('0x11a'),'foreignKey':'UserId'});db[_0xa922('0x12')][_0xa922('0x113')](db[_0xa922('0x11b')],{'as':_0xa922('0x11c'),'foreignKey':_0xa922('0x112')});db['User'][_0xa922('0x113')](db[_0xa922('0x42')],{'as':_0xa922('0x11d'),'foreignKey':_0xa922('0x112')});db['User']['hasMany'](db['WhatsappInteraction'],{'as':_0xa922('0x11e'),'foreignKey':_0xa922('0x112')});db['User'][_0xa922('0x113')](db[_0xa922('0xfb')],{'as':_0xa922('0x11f'),'foreignKey':'SenderId'});db['User'][_0xa922('0x120')](db[_0xa922('0xf6')],{'as':'UserProfile','foreignKey':_0xa922('0x121')});db['User'][_0xa922('0x122')](db[_0xa922('0x70')],{'as':'Groups','through':_0xa922('0x123')});db[_0xa922('0x12')][_0xa922('0x122')](db['CmContact'],{'as':_0xa922('0x124'),'through':'cm_user_has_contacts'});db[_0xa922('0x12')]['belongsToMany'](db['CmList'],{'as':_0xa922('0x125'),'through':_0xa922('0x126')});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':_0xa922('0x127')});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x42')],{'as':_0xa922('0x11d'),'through':_0xa922('0x128')});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x6d')],{'as':_0xa922('0x118'),'through':_0xa922('0x129')});db[_0xa922('0x12')][_0xa922('0x122')](db['FaxInteraction'],{'as':_0xa922('0x11c'),'through':_0xa922('0x12a')});db[_0xa922('0x12')]['belongsToMany'](db[_0xa922('0x119')],{'as':'SmsInteractions','through':_0xa922('0x12b')});db['User'][_0xa922('0x122')](db['OpenchannelInteraction'],{'as':_0xa922('0x117'),'through':'user_has_openchannel_interactions'});db['User']['belongsToMany'](db[_0xa922('0x12c')],{'as':_0xa922('0x11e'),'through':_0xa922('0x12d')});db[_0xa922('0x12')]['belongsToMany'](db[_0xa922('0x1b')],{'as':_0xa922('0x12e'),'through':_0xa922('0x2f'),'required':![]});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x12f')],{'as':_0xa922('0x130'),'through':_0xa922('0x10c'),'required':![]});db[_0xa922('0x12')][_0xa922('0x122')](db['MailQueue'],{'as':_0xa922('0x131'),'through':_0xa922('0x132'),'required':![]});db[_0xa922('0x12')]['belongsToMany'](db[_0xa922('0x133')],{'as':'ChatQueues','through':_0xa922('0x30'),'required':![],'hooks':!![]});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x53')],{'as':_0xa922('0x134'),'through':'UserFaxQueue','required':![]});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x5c')],{'as':_0xa922('0x135'),'through':_0xa922('0x35'),'required':![]});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x66')],{'as':_0xa922('0x136'),'through':_0xa922('0x37'),'required':![]});db[_0xa922('0x12')]['belongsToMany'](db[_0xa922('0x105')],{'as':_0xa922('0x137'),'through':'UserWhatsappQueue','required':![]});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0xf4')],{'through':_0xa922('0x126')});db['User'][_0xa922('0x122')](db[_0xa922('0x68')],{'as':_0xa922('0x138'),'through':'user_has_chat_websites'});db[_0xa922('0x12')][_0xa922('0x122')](db['FaxAccount'],{'as':_0xa922('0x139'),'through':_0xa922('0x13a')});db[_0xa922('0x12')][_0xa922('0x122')](db['MailAccount'],{'as':_0xa922('0x13b'),'through':_0xa922('0x13c')});db[_0xa922('0x12')]['belongsToMany'](db[_0xa922('0x5e')],{'as':_0xa922('0x13d'),'through':_0xa922('0x13e')});db[_0xa922('0x12')][_0xa922('0x122')](db['SmsAccount'],{'as':'SmsAccounts','through':_0xa922('0x13f')});db[_0xa922('0x12')][_0xa922('0x122')](db[_0xa922('0x140')],{'as':_0xa922('0x141'),'through':_0xa922('0x142')});db[_0xa922('0x14')]['hasMany'](db[_0xa922('0x18')],{'as':_0xa922('0x143'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x144')});db[_0xa922('0x145')][_0xa922('0x113')](db[_0xa922('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xa922('0x113')](db['VoiceExtension'],{'as':_0xa922('0x146'),'onDelete':_0xa922('0x111')});db[_0xa922('0x147')][_0xa922('0x122')](db[_0xa922('0x8e')],{'as':_0xa922('0x148'),'through':_0xa922('0x149')});db[_0xa922('0x1b')][_0xa922('0x113')](db[_0xa922('0x2d')],{'as':_0xa922('0x14a'),'foreignKey':_0xa922('0x14b')});db[_0xa922('0x1b')][_0xa922('0x113')](db[_0xa922('0x76')],{'as':_0xa922('0x14c'),'foreignKey':'VoiceQueueId'});db[_0xa922('0x1b')][_0xa922('0x113')](db[_0xa922('0x14d')],{'as':_0xa922('0x14e'),'foreignKey':_0xa922('0x14b')});db[_0xa922('0x1b')][_0xa922('0x113')](db['CmHopperHistory'],{'as':_0xa922('0x14f'),'foreignKey':_0xa922('0x14b')});db[_0xa922('0x1b')]['hasMany'](db[_0xa922('0x7c')],{'as':'ReportAgentPreview','foreignKey':_0xa922('0x14b')});db[_0xa922('0x1b')][_0xa922('0x113')](db[_0xa922('0x78')],{'as':_0xa922('0x150'),'foreignKey':'VoiceQueueId'});db[_0xa922('0x1b')]['hasMany'](db['JscriptySessionReport'],{'as':_0xa922('0x151'),'foreignKey':_0xa922('0x14b')});db[_0xa922('0x1b')][_0xa922('0x120')](db[_0xa922('0x2b')],{'as':_0xa922('0x2b'),'foreignKey':'TrunkId'});db[_0xa922('0x1b')][_0xa922('0x120')](db[_0xa922('0x2b')],{'as':_0xa922('0x152'),'foreignKey':_0xa922('0x153')});db[_0xa922('0x1b')][_0xa922('0x120')](db['Interval'],{'as':_0xa922('0x87'),'foreignKey':_0xa922('0x154')});db[_0xa922('0x1b')][_0xa922('0x120')](db[_0xa922('0x155')],{'as':'mandatoryDispositionPause','foreignKey':_0xa922('0x156')});db[_0xa922('0x1b')][_0xa922('0x122')](db[_0xa922('0xf4')],{'as':_0xa922('0x125'),'through':_0xa922('0x157')});db['VoiceQueue'][_0xa922('0x122')](db[_0xa922('0x12')],{'as':'Agents','through':_0xa922('0x2f')});db[_0xa922('0x1b')][_0xa922('0x122')](db[_0xa922('0xe4')],{'as':_0xa922('0x158'),'through':_0xa922('0x109')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0xa922('0x159'),'through':_0xa922('0x15a')});db[_0xa922('0x1d')][_0xa922('0x120')](db['User'],{'as':'User','foreignKey':_0xa922('0x112')});db[_0xa922('0x15b')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x12'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x20')][_0xa922('0x113')](db[_0xa922('0x15c')],{'as':_0xa922('0x15d'),'onDelete':_0xa922('0x111'),'foreignKey':'mailboxuser','sourceKey':_0xa922('0x15e')});db[_0xa922('0x15c')][_0xa922('0x120')](db[_0xa922('0x20')],{'foreignKey':_0xa922('0x15f'),'targetKey':_0xa922('0x15e')});db[_0xa922('0x23')]['hasMany'](db[_0xa922('0x28')],{'as':_0xa922('0x160'),'foreignKey':_0xa922('0x161'),'constraints':![]});db['VoiceCallReport'][_0xa922('0x113')](db[_0xa922('0x27')],{'as':_0xa922('0x162'),'foreignKey':_0xa922('0x161'),'constraints':![]});db[_0xa922('0x23')]['belongsTo'](db[_0xa922('0x12')],{'as':'User','foreignKey':'UserId'});db[_0xa922('0x23')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':'ContactId'});db['MailServerIn'][_0xa922('0x120')](db[_0xa922('0x3e')],{'as':_0xa922('0x3e'),'foreignKey':_0xa922('0x165')});db['MailServerIn']['belongsTo'](db[_0xa922('0x107')],{'as':_0xa922('0x107'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xa922('0x166')][_0xa922('0x120')](db[_0xa922('0x3e')],{'as':'MailAccount','foreignKey':_0xa922('0x165')});db[_0xa922('0x166')]['belongsTo'](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xa922('0x167'),'onDelete':_0xa922('0x168')});db[_0xa922('0x3e')]['hasOne'](db[_0xa922('0x3b')],{'as':_0xa922('0x169'),'onDelete':_0xa922('0x111')});db[_0xa922('0x3e')][_0xa922('0x10f')](db[_0xa922('0x166')],{'as':_0xa922('0x16a'),'onDelete':_0xa922('0x111')});db[_0xa922('0x3e')][_0xa922('0x113')](db['Disposition'],{'as':_0xa922('0x16b'),'foreignKey':_0xa922('0x165'),'onDelete':'cascade'});db['MailAccount'][_0xa922('0x113')](db['CannedAnswer'],{'as':_0xa922('0x16c'),'foreignKey':_0xa922('0x165')});db[_0xa922('0x3e')][_0xa922('0x113')](db[_0xa922('0x44')],{'as':_0xa922('0x15d'),'foreignKey':_0xa922('0x165')});db[_0xa922('0x3e')][_0xa922('0x113')](db[_0xa922('0x42')],{'as':_0xa922('0x16d')});db[_0xa922('0x3e')][_0xa922('0x113')](db[_0xa922('0x46')],{'as':_0xa922('0x146')});db[_0xa922('0x3e')]['belongsTo'](db['CmList'],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db['MailAccount']['belongsTo'](db[_0xa922('0x96')],{'as':_0xa922('0x96'),'foreignKey':_0xa922('0x170')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0xa922('0x171'),'foreignKey':_0xa922('0x156')});db[_0xa922('0x3e')]['belongsToMany'](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x13c')});db[_0xa922('0x40')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':'Agents','through':_0xa922('0x132')});db[_0xa922('0x40')][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':_0xa922('0x173'),'as':_0xa922('0x158')});db[_0xa922('0x42')][_0xa922('0x113')](db[_0xa922('0x44')],{'as':_0xa922('0x15d'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x174')});db[_0xa922('0x42')][_0xa922('0x120')](db[_0xa922('0x3e')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x165')});db['MailInteraction'][_0xa922('0x120')](db[_0xa922('0x163')],{'as':'Contact','foreignKey':_0xa922('0x176')});db[_0xa922('0x42')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x177'),'foreignKey':_0xa922('0x112')});db['MailInteraction'][_0xa922('0x122')](db[_0xa922('0x90')],{'through':'mail_interaction_has_tags','as':_0xa922('0x178')});db[_0xa922('0x42')][_0xa922('0x122')](db['Tag'],{'through':_0xa922('0x179'),'as':_0xa922('0x17a')});db[_0xa922('0x42')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x17b'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0xa922('0x44')][_0xa922('0x113')](db[_0xa922('0xeb')],{'as':_0xa922('0x17c'),'onDelete':'cascade'});db[_0xa922('0x44')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x12')});db[_0xa922('0x44')]['belongsTo'](db[_0xa922('0x163')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x164')});db[_0xa922('0x44')]['belongsTo'](db[_0xa922('0x42')],{'as':_0xa922('0x17d'),'foreignKey':_0xa922('0x174')});db[_0xa922('0x44')][_0xa922('0x120')](db[_0xa922('0x3e')],{'as':_0xa922('0x175'),'foreignKey':'MailAccountId'});db[_0xa922('0x44')][_0xa922('0x120')](db[_0xa922('0x68')],{'as':_0xa922('0x68'),'foreignKey':_0xa922('0x17e')});db[_0xa922('0x44')][_0xa922('0x120')](db[_0xa922('0x6f')],{'as':_0xa922('0x6f'),'foreignKey':_0xa922('0x17f')});db[_0xa922('0x46')][_0xa922('0x120')](db[_0xa922('0x12')],{'onDelete':'restrict'});db[_0xa922('0x46')]['belongsTo'](db[_0xa922('0x40')],{'onDelete':'restrict'});db[_0xa922('0x46')][_0xa922('0x120')](db[_0xa922('0x3e')],{'onDelete':_0xa922('0x168')});db[_0xa922('0x46')][_0xa922('0x120')](db[_0xa922('0x87')],{'onDelete':_0xa922('0x168'),'foreignKey':_0xa922('0x154')});db[_0xa922('0x46')][_0xa922('0x120')](db[_0xa922('0x90')],{'onDelete':_0xa922('0x168'),'foreignKey':_0xa922('0x180')});db[_0xa922('0x47')][_0xa922('0x120')](db[_0xa922('0x3e')],{});db[_0xa922('0x47')][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db['MailQueueReport']['belongsTo'](db['CmContact'],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x47')][_0xa922('0x120')](db[_0xa922('0x42')],{});db[_0xa922('0x47')][_0xa922('0x120')](db[_0xa922('0x44')],{});db['MailQueueReport']['belongsTo'](db[_0xa922('0x12')],{});db[_0xa922('0x47')][_0xa922('0x120')](db[_0xa922('0x40')],{});db[_0xa922('0x181')][_0xa922('0x113')](db['DashboardItem'],{'as':_0xa922('0x182'),'onDelete':_0xa922('0x111')});db[_0xa922('0x4c')][_0xa922('0x113')](db[_0xa922('0x85')],{'as':_0xa922('0x16b'),'foreignKey':_0xa922('0x183'),'onDelete':_0xa922('0x111')});db[_0xa922('0x4c')]['hasMany'](db['CannedAnswer'],{'as':_0xa922('0x16c'),'foreignKey':'FaxAccountId'});db[_0xa922('0x4c')][_0xa922('0x113')](db['FaxInteraction'],{'as':_0xa922('0x16d')});db[_0xa922('0x4c')][_0xa922('0x113')](db[_0xa922('0x4e')],{'as':_0xa922('0x146')});db[_0xa922('0x4c')]['hasMany'](db[_0xa922('0x18')],{'as':'Exntensions','onDelete':'cascade'});db[_0xa922('0x4c')][_0xa922('0x113')](db[_0xa922('0x51')],{'as':_0xa922('0x15d')});db[_0xa922('0x4c')][_0xa922('0x120')](db['Trunk'],{'as':_0xa922('0x2b')});db[_0xa922('0x4c')][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0x4c')][_0xa922('0x120')](db[_0xa922('0x155')],{'as':_0xa922('0x171'),'foreignKey':_0xa922('0x156')});db['FaxAccount'][_0xa922('0x122')](db['User'],{'as':_0xa922('0x172'),'through':_0xa922('0x13a')});db[_0xa922('0x4e')][_0xa922('0x120')](db[_0xa922('0x12')],{'onDelete':_0xa922('0x168')});db['FaxApplication'][_0xa922('0x120')](db[_0xa922('0x53')],{'onDelete':'restrict'});db[_0xa922('0x4e')][_0xa922('0x120')](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication'][_0xa922('0x120')](db[_0xa922('0x90')],{'onDelete':_0xa922('0x168'),'foreignKey':_0xa922('0x180')});db['FaxInteraction'][_0xa922('0x113')](db[_0xa922('0x51')],{'as':_0xa922('0x15d'),'onDelete':_0xa922('0x111'),'foreignKey':'FaxInteractionId'});db[_0xa922('0x11b')][_0xa922('0x120')](db['FaxAccount'],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x183')});db[_0xa922('0x11b')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db['FaxInteraction'][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x177'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x11b')]['belongsToMany'](db['Tag'],{'through':_0xa922('0x184'),'as':_0xa922('0x178')});db[_0xa922('0x11b')][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x184'),'as':'ThroughTags'});db['FaxInteraction']['belongsToMany'](db[_0xa922('0x12')],{'as':_0xa922('0x17b'),'through':'user_has_fax_interactions','foreignKey':_0xa922('0x185')});db[_0xa922('0x51')][_0xa922('0x120')](db[_0xa922('0x12')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x12')});db[_0xa922('0x51')]['belongsTo'](db[_0xa922('0x11b')],{'as':_0xa922('0x17d'),'foreignKey':_0xa922('0x185')});db[_0xa922('0x51')]['belongsTo'](db[_0xa922('0x163')],{'onDelete':_0xa922('0x111'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xa922('0xeb')],{'as':_0xa922('0xeb'),'foreignKey':_0xa922('0x186')});db[_0xa922('0x51')][_0xa922('0x120')](db[_0xa922('0x4c')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xa922('0x53')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':'Agents','through':_0xa922('0x33')});db[_0xa922('0x53')][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':_0xa922('0x187'),'as':_0xa922('0x158')});db[_0xa922('0x55')][_0xa922('0x120')](db[_0xa922('0x4c')],{});db[_0xa922('0x55')][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':'List','foreignKey':'ListId'});db[_0xa922('0x55')][_0xa922('0x120')](db['CmContact'],{'as':_0xa922('0x164'),'foreignKey':'ContactId'});db[_0xa922('0x55')][_0xa922('0x120')](db[_0xa922('0x11b')],{});db[_0xa922('0x55')][_0xa922('0x120')](db[_0xa922('0x51')],{});db[_0xa922('0x55')][_0xa922('0x120')](db[_0xa922('0x12')],{});db[_0xa922('0x55')][_0xa922('0x120')](db[_0xa922('0x53')],{});db[_0xa922('0x57')]['hasMany'](db[_0xa922('0x85')],{'as':_0xa922('0x16b'),'foreignKey':_0xa922('0x188'),'onDelete':_0xa922('0x111')});db['SmsAccount'][_0xa922('0x113')](db['CannedAnswer'],{'as':_0xa922('0x16c'),'foreignKey':_0xa922('0x188')});db[_0xa922('0x57')][_0xa922('0x113')](db['SmsMessage'],{'as':_0xa922('0x15d'),'foreignKey':'SmsAccountId'});db[_0xa922('0x57')]['hasMany'](db[_0xa922('0x119')],{'as':_0xa922('0x16d')});db['SmsAccount'][_0xa922('0x113')](db[_0xa922('0x189')],{'as':'Applications'});db[_0xa922('0x57')][_0xa922('0x120')](db['CmList'],{'as':'List','foreignKey':_0xa922('0x16f')});db[_0xa922('0x57')][_0xa922('0x120')](db[_0xa922('0x155')],{'as':_0xa922('0x171'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa922('0x57')][_0xa922('0x122')](db['User'],{'as':_0xa922('0x172'),'through':'user_has_sms_accounts'});db[_0xa922('0x189')][_0xa922('0x120')](db['User'],{'onDelete':_0xa922('0x168')});db[_0xa922('0x189')][_0xa922('0x120')](db[_0xa922('0x5c')],{'onDelete':_0xa922('0x168')});db[_0xa922('0x189')][_0xa922('0x120')](db[_0xa922('0x57')],{'onDelete':_0xa922('0x168')});db['SmsApplication'][_0xa922('0x120')](db['Interval'],{'onDelete':_0xa922('0x168'),'foreignKey':_0xa922('0x154')});db[_0xa922('0x189')][_0xa922('0x120')](db[_0xa922('0x90')],{'onDelete':_0xa922('0x168'),'foreignKey':_0xa922('0x180')});db[_0xa922('0x119')][_0xa922('0x113')](db[_0xa922('0x5b')],{'as':_0xa922('0x15d'),'onDelete':'cascade','foreignKey':_0xa922('0x18a')});db['SmsInteraction'][_0xa922('0x120')](db[_0xa922('0x57')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x188')});db['SmsInteraction'][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x119')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':'Owner','foreignKey':_0xa922('0x112')});db['SmsInteraction'][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x18b'),'as':_0xa922('0x178')});db['SmsInteraction'][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x18b'),'as':_0xa922('0x17a')});db[_0xa922('0x119')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x17b'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0xa922('0x5b')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x12')});db[_0xa922('0x5b')][_0xa922('0x120')](db['CmContact'],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x164')});db['SmsMessage'][_0xa922('0x120')](db[_0xa922('0x119')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x17d'),'foreignKey':'SmsInteractionId'});db[_0xa922('0x5b')][_0xa922('0x120')](db[_0xa922('0x57')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x188')});db[_0xa922('0x5c')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':'Agents','through':_0xa922('0x35'),'foreignKey':_0xa922('0x18c')});db[_0xa922('0x5c')][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':'team_has_sms_queues','as':_0xa922('0x158')});db[_0xa922('0x5e')]['hasMany'](db[_0xa922('0x85')],{'as':'Dispositions','foreignKey':_0xa922('0x18d'),'onDelete':'cascade'});db[_0xa922('0x5e')][_0xa922('0x113')](db[_0xa922('0x83')],{'as':_0xa922('0x16c'),'foreignKey':_0xa922('0x18d')});db[_0xa922('0x5e')]['hasMany'](db[_0xa922('0x62')],{'as':_0xa922('0x16d'),'foreignKey':_0xa922('0x18d')});db[_0xa922('0x5e')][_0xa922('0x113')](db[_0xa922('0x64')],{'as':'Messages','foreignKey':_0xa922('0x18d')});db[_0xa922('0x5e')][_0xa922('0x113')](db[_0xa922('0x60')],{'as':'Applications','foreignKey':_0xa922('0x18d')});db[_0xa922('0x5e')][_0xa922('0x120')](db['CmList'],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0x5e')][_0xa922('0x120')](db[_0xa922('0x155')],{'as':_0xa922('0x171'),'foreignKey':_0xa922('0x156')});db[_0xa922('0x5e')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x13e')});db[_0xa922('0x60')][_0xa922('0x120')](db['User'],{'onDelete':_0xa922('0x168')});db[_0xa922('0x60')][_0xa922('0x120')](db[_0xa922('0x66')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0xa922('0x60')][_0xa922('0x120')](db[_0xa922('0x5e')],{'onDelete':'restrict','foreignKey':_0xa922('0x18d')});db[_0xa922('0x60')][_0xa922('0x120')](db[_0xa922('0x87')],{'onDelete':'restrict','foreignKey':_0xa922('0x154')});db[_0xa922('0x60')][_0xa922('0x120')](db[_0xa922('0x90')],{'onDelete':_0xa922('0x168'),'foreignKey':'TagId'});db[_0xa922('0x62')][_0xa922('0x113')](db['OpenchannelMessage'],{'as':_0xa922('0x15d'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x18e')});db[_0xa922('0x62')][_0xa922('0x120')](db[_0xa922('0x5e')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x18d')});db[_0xa922('0x62')]['belongsTo'](db[_0xa922('0x163')],{'as':'Contact','foreignKey':_0xa922('0x176')});db[_0xa922('0x62')][_0xa922('0x120')](db['User'],{'as':_0xa922('0x177'),'foreignKey':_0xa922('0x112')});db['OpenchannelInteraction']['belongsToMany'](db[_0xa922('0x90')],{'through':_0xa922('0x18f'),'as':_0xa922('0x178')});db[_0xa922('0x62')][_0xa922('0x122')](db['Tag'],{'through':_0xa922('0x18f'),'as':'ThroughTags'});db[_0xa922('0x62')][_0xa922('0x122')](db['User'],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0xa922('0x18e')});db[_0xa922('0x64')]['belongsTo'](db[_0xa922('0x12')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x12')});db[_0xa922('0x64')][_0xa922('0x120')](db[_0xa922('0x163')],{'onDelete':'cascade','as':_0xa922('0x164')});db['OpenchannelMessage'][_0xa922('0x120')](db[_0xa922('0x62')],{'onDelete':_0xa922('0x111'),'as':'Interaction','foreignKey':_0xa922('0x18e')});db[_0xa922('0x64')][_0xa922('0x120')](db['Attachment'],{'as':'Attachment','foreignKey':_0xa922('0x186')});db['OpenchannelMessage'][_0xa922('0x120')](db[_0xa922('0x5e')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xa922('0x66')]['belongsToMany'](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x37'),'foreignKey':_0xa922('0x190')});db['OpenchannelQueue'][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':_0xa922('0x191'),'as':'Teams'});db[_0xa922('0x68')]['hasMany'](db[_0xa922('0x85')],{'as':_0xa922('0x16b'),'foreignKey':_0xa922('0x17e'),'onDelete':_0xa922('0x111')});db['ChatWebsite'][_0xa922('0x113')](db['CannedAnswer'],{'as':_0xa922('0x16c'),'foreignKey':_0xa922('0x17e')});db[_0xa922('0x68')]['hasMany'](db[_0xa922('0x71')],{'as':'ProactiveActions'});db[_0xa922('0x68')]['hasMany'](db[_0xa922('0x6d')],{'as':'Interactions'});db[_0xa922('0x68')][_0xa922('0x113')](db[_0xa922('0x6b')],{'as':'Applications'});db[_0xa922('0x68')][_0xa922('0x113')](db[_0xa922('0x192')],{'as':_0xa922('0x15d')});db[_0xa922('0x68')][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0x68')][_0xa922('0x120')](db[_0xa922('0x87')],{'as':_0xa922('0x87'),'foreignKey':_0xa922('0x154')});db[_0xa922('0x68')]['belongsTo'](db['MailAccount'],{'as':_0xa922('0x3e'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xa922('0x120')](db[_0xa922('0x155')],{'as':_0xa922('0x171'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa922('0x68')]['belongsToMany'](db[_0xa922('0x12')],{'as':'Agents','through':_0xa922('0x193')});db[_0xa922('0x69')][_0xa922('0x120')](db[_0xa922('0x5e')],{});db[_0xa922('0x69')][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':'ListId'});db[_0xa922('0x69')][_0xa922('0x120')](db['CmContact'],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x69')][_0xa922('0x120')](db['OpenchannelInteraction'],{});db[_0xa922('0x69')]['belongsTo'](db[_0xa922('0x64')],{});db[_0xa922('0x69')][_0xa922('0x120')](db['User'],{});db[_0xa922('0x69')][_0xa922('0x120')](db[_0xa922('0x66')],{});db[_0xa922('0x6b')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x194'),'foreignKey':_0xa922('0x112'),'onDelete':_0xa922('0x168')});db[_0xa922('0x6b')][_0xa922('0x120')](db[_0xa922('0x133')],{'as':_0xa922('0x195'),'foreignKey':_0xa922('0x196'),'onDelete':_0xa922('0x168')});db[_0xa922('0x6b')][_0xa922('0x120')](db[_0xa922('0x68')],{'as':'Website','foreignKey':_0xa922('0x17e'),'onDelete':_0xa922('0x168')});db['ChatApplication']['belongsTo'](db[_0xa922('0x90')],{'onDelete':_0xa922('0x168'),'foreignKey':_0xa922('0x180')});db['ChatInteraction'][_0xa922('0x113')](db[_0xa922('0x192')],{'as':_0xa922('0x15d'),'onDelete':'cascade','foreignKey':_0xa922('0x197')});db[_0xa922('0x6d')][_0xa922('0x120')](db[_0xa922('0x68')],{'as':_0xa922('0x175'),'foreignKey':'ChatWebsiteId'});db[_0xa922('0x6d')]['belongsTo'](db[_0xa922('0x163')],{'as':'Contact','foreignKey':_0xa922('0x176')});db['ChatInteraction'][_0xa922('0x120')](db['User'],{'as':_0xa922('0x177'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x6d')]['belongsToMany'](db[_0xa922('0x90')],{'through':_0xa922('0x198'),'as':_0xa922('0x178')});db[_0xa922('0x6d')][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x198'),'as':_0xa922('0x17a')});db[_0xa922('0x6d')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x17b'),'through':_0xa922('0x129'),'foreignKey':_0xa922('0x197')});db[_0xa922('0x192')][_0xa922('0x120')](db[_0xa922('0x12')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x12')});db[_0xa922('0x192')]['belongsTo'](db[_0xa922('0x163')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x164'),'foreignKey':'ContactId'});db[_0xa922('0x192')][_0xa922('0x120')](db['ChatInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa922('0x197')});db[_0xa922('0x192')]['belongsTo'](db[_0xa922('0xeb')],{'as':_0xa922('0xeb'),'foreignKey':_0xa922('0x186')});db[_0xa922('0x192')][_0xa922('0x120')](db[_0xa922('0x68')],{'as':_0xa922('0x175'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage']['hasMany'](db[_0xa922('0xeb')],{'as':_0xa922('0x17c'),'foreignKey':_0xa922('0x17f'),'onDelete':_0xa922('0x111'),'hooks':!![]});db['ChatOfflineMessage'][_0xa922('0x120')](db[_0xa922('0x163')],{'onDelete':'cascade','as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x6f')][_0xa922('0x120')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xa922('0x17e')});db[_0xa922('0x133')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x30'),'hooks':!![]});db[_0xa922('0x133')][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':_0xa922('0x199'),'as':'Teams'});db[_0xa922('0x70')][_0xa922('0x113')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xa922('0x19a'),'onDelete':_0xa922('0x111')});db[_0xa922('0x70')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':'Members','through':_0xa922('0x123')});db[_0xa922('0x71')][_0xa922('0x120')](db[_0xa922('0x68')],{'as':_0xa922('0x19b'),'foreignKey':_0xa922('0x17e')});db[_0xa922('0x73')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xa922('0x163')][_0xa922('0x113')](db[_0xa922('0x19c')],{'as':_0xa922('0x19d'),'foreignKey':_0xa922('0x19e')});db[_0xa922('0x163')][_0xa922('0x113')](db['CmHopper'],{'as':_0xa922('0x14c'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x163')]['hasMany'](db[_0xa922('0x14d')],{'as':_0xa922('0x14e'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x163')][_0xa922('0x113')](db[_0xa922('0x7a')],{'as':'HopperHistories','foreignKey':_0xa922('0x176')});db[_0xa922('0x163')][_0xa922('0x113')](db[_0xa922('0x7c')],{'as':_0xa922('0x7c'),'foreignKey':'ContactId'});db[_0xa922('0x163')][_0xa922('0x113')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0xa922('0x163')][_0xa922('0x113')](db[_0xa922('0x62')],{'as':_0xa922('0x117'),'foreignKey':_0xa922('0x176'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0xa922('0x6d')],{'as':_0xa922('0x118'),'foreignKey':_0xa922('0x176'),'onDelete':_0xa922('0x168')});db[_0xa922('0x163')][_0xa922('0x113')](db[_0xa922('0x119')],{'as':_0xa922('0x11a'),'foreignKey':'ContactId','onDelete':_0xa922('0x168')});db['CmContact'][_0xa922('0x113')](db[_0xa922('0x11b')],{'as':_0xa922('0x11c'),'foreignKey':_0xa922('0x176'),'onDelete':_0xa922('0x168')});db['CmContact'][_0xa922('0x113')](db['MailInteraction'],{'as':_0xa922('0x11d'),'foreignKey':_0xa922('0x176'),'onDelete':_0xa922('0x168')});db[_0xa922('0x163')]['belongsTo'](db['CmCompany'],{'as':_0xa922('0x19f'),'foreignKey':_0xa922('0x1a0')});db[_0xa922('0x163')][_0xa922('0x120')](db['CmList'],{'as':_0xa922('0x16e'),'foreignKey':'ListId','onDelete':_0xa922('0x111')});db[_0xa922('0x163')][_0xa922('0x122')](db['User'],{'as':'Users','through':_0xa922('0x1a1')});db['CmContact']['belongsToMany'](db[_0xa922('0x90')],{'as':'Tags','through':_0xa922('0x1a2')});db[_0xa922('0x163')][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x1a2'),'as':_0xa922('0x17a')});db['CmHopper']['hasMany'](db[_0xa922('0x94')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0xa922('0x76')]['belongsTo'](db[_0xa922('0x163')],{'as':'Contact','foreignKey':_0xa922('0x176'),'onDelete':'cascade'});db['CmHopper'][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':'ListId','onDelete':_0xa922('0x111')});db[_0xa922('0x76')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':'Agent','foreignKey':_0xa922('0x112')});db[_0xa922('0x76')][_0xa922('0x120')](db['VoiceQueue'],{'as':_0xa922('0x195'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0xa922('0x120')](db[_0xa922('0xe7')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xa922('0x111')});db[_0xa922('0x76')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x177'),'foreignKey':'OwnerId'});db[_0xa922('0x78')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176'),'onDelete':_0xa922('0x111')});db['CmHopperBlack'][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f'),'onDelete':'cascade'});db['CmHopperBlack'][_0xa922('0x120')](db[_0xa922('0x1b')],{'as':_0xa922('0x195'),'foreignKey':_0xa922('0x14b'),'onDelete':'cascade'});db['CmHopperBlack'][_0xa922('0x120')](db[_0xa922('0xe7')],{'as':'Campaign','foreignKey':_0xa922('0x1a3'),'onDelete':_0xa922('0x111')});db[_0xa922('0x81')][_0xa922('0x113')](db[_0xa922('0x86')],{'as':{'plural':'All','singular':_0xa922('0x1a4')},'foreignKey':_0xa922('0x1a5'),'onDelete':_0xa922('0x111'),'hooks':!![]});db[_0xa922('0x81')][_0xa922('0x113')](db[_0xa922('0x86')],{'as':{'plural':_0xa922('0x1a6'),'singular':_0xa922('0x1a7')},'foreignKey':_0xa922('0x1a8'),'onDelete':_0xa922('0x111'),'hooks':!![]});db[_0xa922('0x81')][_0xa922('0x113')](db[_0xa922('0x7f')],{'as':'Actions','foreignKey':_0xa922('0x1a9'),'onDelete':_0xa922('0x111'),'hooks':!![]});db[_0xa922('0x85')][_0xa922('0x113')](db[_0xa922('0x85')],{'as':'Dispositions','foreignKey':_0xa922('0x1aa'),'onDelete':_0xa922('0x111')});db[_0xa922('0x87')]['hasMany'](db[_0xa922('0x87')],{'as':_0xa922('0x1ab'),'foreignKey':_0xa922('0x154'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xa922('0x87')][_0xa922('0x113')](db['VoiceExtension'],{'as':_0xa922('0x115'),'foreignKey':_0xa922('0x154'),'onDelete':_0xa922('0x168')});db[_0xa922('0x87')][_0xa922('0x113')](db[_0xa922('0x46')],{'as':_0xa922('0x1ac'),'foreignKey':_0xa922('0x154')});db[_0xa922('0x87')][_0xa922('0x113')](db['ChatApplication'],{'as':_0xa922('0x1ad'),'foreignKey':_0xa922('0x154')});db[_0xa922('0x87')][_0xa922('0x113')](db[_0xa922('0x4e')],{'as':_0xa922('0x1ae'),'foreignKey':'IntervalId'});db[_0xa922('0x87')][_0xa922('0x113')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xa922('0x154')});db[_0xa922('0x8c')][_0xa922('0x120')](db[_0xa922('0x3e')],{});db['Schedule'][_0xa922('0x120')](db[_0xa922('0xa0')],{'foreignKey':'DefaultReportId'});db[_0xa922('0x8c')][_0xa922('0x120')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0xa922('0x8e')][_0xa922('0x122')](db[_0xa922('0x147')],{'as':_0xa922('0x1af'),'through':'moh_has_sounds','onDelete':_0xa922('0x168')});db[_0xa922('0x90')][_0xa922('0x122')](db[_0xa922('0x163')],{'through':_0xa922('0x1a2')});db[_0xa922('0x90')][_0xa922('0x122')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0xa922('0x90')][_0xa922('0x122')](db[_0xa922('0x42')],{'through':'mail_interaction_has_tags'});db[_0xa922('0x90')][_0xa922('0x122')](db[_0xa922('0x119')],{'through':_0xa922('0x18b')});db[_0xa922('0x90')][_0xa922('0x122')](db[_0xa922('0x11b')],{'through':'fax_interaction_has_tags'});db[_0xa922('0x90')][_0xa922('0x122')](db['OpenchannelInteraction'],{'through':_0xa922('0x18f')});db['Tag'][_0xa922('0x122')](db[_0xa922('0x12c')],{'through':_0xa922('0x1b0')});db['CmContactHasItem'][_0xa922('0x120')](db[_0xa922('0x92')],{'as':_0xa922('0x1b1'),'foreignKey':'ItemTypeId'});db[_0xa922('0x94')]['belongsTo'](db[_0xa922('0x76')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0xa922('0x19c')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':'CmContactId'});db[_0xa922('0x98')][_0xa922('0x113')](db[_0xa922('0x86')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0xa922('0x111'),'hooks':!![]});db[_0xa922('0x98')][_0xa922('0x113')](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xa922('0x1b2'),'onDelete':_0xa922('0x111'),'hooks':!![]});db[_0xa922('0x98')][_0xa922('0x113')](db[_0xa922('0x7f')],{'as':_0xa922('0x1b3'),'foreignKey':'TriggerId','onDelete':_0xa922('0x111'),'hooks':!![]});db[_0xa922('0x9e')][_0xa922('0x113')](db[_0xa922('0xa3')],{'as':_0xa922('0x1b4'),'onDelete':_0xa922('0x111'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xa922('0xa0')]['hasMany'](db[_0xa922('0xa3')],{'as':_0xa922('0x1b4'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b5')});db[_0xa922('0x1b6')]['hasMany'](db[_0xa922('0xa3')],{'as':'Fields','onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b7')});db['AnalyticFieldReport']['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0xa922('0x1b7')});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0xa922('0x1b8'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0x1ba')][_0xa922('0x113')](db[_0xa922('0x1bb')],{'as':'Subjects','onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1ba')][_0xa922('0x113')](db[_0xa922('0x1bb')],{'as':'Descriptions','onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0x1ba')][_0xa922('0x113')](db['SalesforceField'],{'as':_0xa922('0x1b4'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1be')});db['SalesforceConfiguration'][_0xa922('0x120')](db['SalesforceAccount'],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0x1bb')]['hasMany'](db[_0xa922('0x1bb')],{'as':'Subject','foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1bb')][_0xa922('0x113')](db['SalesforceField'],{'as':_0xa922('0x1bf'),'foreignKey':_0xa922('0x1bd')});db['SalesforceField'][_0xa922('0x113')](db[_0xa922('0x1bb')],{'as':'Field','foreignKey':_0xa922('0x1be')});db['SalesforceField'][_0xa922('0x120')](db['Variable'],{'as':_0xa922('0x9a'),'foreignKey':_0xa922('0x1c0')});db[_0xa922('0xa9')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xa922('0x1b8'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0xaa')][_0xa922('0x113')](db[_0xa922('0x1c1')],{'as':_0xa922('0x1c2'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0xaa')][_0xa922('0x113')](db['SugarcrmField'],{'as':_0xa922('0x1c3'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0xaa')][_0xa922('0x113')](db[_0xa922('0x1c1')],{'as':_0xa922('0x1b4'),'onDelete':_0xa922('0x111'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xa922('0x120')](db[_0xa922('0xa9')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0x1c1')]['hasMany'](db[_0xa922('0x1c1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa922('0x1c1')][_0xa922('0x113')](db[_0xa922('0x1c1')],{'as':_0xa922('0x1bf'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0x1c1')][_0xa922('0x113')](db[_0xa922('0x1c1')],{'as':_0xa922('0x1c4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0x1c1')][_0xa922('0x120')](db[_0xa922('0x9a')],{'as':_0xa922('0x9a'),'foreignKey':_0xa922('0x1c0')});db[_0xa922('0x1c5')][_0xa922('0x113')](db[_0xa922('0x1c6')],{'as':'Configurations','onDelete':_0xa922('0x111'),'foreignKey':'AccountId'});db[_0xa922('0x1c6')][_0xa922('0x113')](db['DeskField'],{'as':_0xa922('0x1c2'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1c6')][_0xa922('0x113')](db[_0xa922('0xad')],{'as':'Descriptions','onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bd')});db['DeskConfiguration'][_0xa922('0x113')](db[_0xa922('0xad')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xa922('0x1c6')][_0xa922('0x120')](db[_0xa922('0x1c5')],{'as':_0xa922('0x175'),'foreignKey':'AccountId'});db[_0xa922('0x1c6')][_0xa922('0x122')](db['Tag'],{'through':_0xa922('0x1c7')});db[_0xa922('0xad')]['hasMany'](db[_0xa922('0xad')],{'as':_0xa922('0x1c8'),'foreignKey':'SubjectId'});db[_0xa922('0xad')][_0xa922('0x113')](db[_0xa922('0xad')],{'as':_0xa922('0x1bf'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0xad')][_0xa922('0x113')](db[_0xa922('0xad')],{'as':_0xa922('0x1c4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0xad')][_0xa922('0x120')](db[_0xa922('0x9a')],{'as':_0xa922('0x9a'),'foreignKey':_0xa922('0x1c0')});db[_0xa922('0xaf')][_0xa922('0x113')](db[_0xa922('0xb1')],{'as':_0xa922('0x1b8'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0xb1')]['hasMany'](db['ZohoField'],{'as':_0xa922('0x1c2'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0xb1')]['hasMany'](db[_0xa922('0x1c9')],{'as':_0xa922('0x1c3'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0xb1')][_0xa922('0x113')](db['ZohoField'],{'as':'Fields','onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0xb1')]['belongsTo'](db[_0xa922('0xaf')],{'as':_0xa922('0x175'),'foreignKey':'AccountId'});db['ZohoField'][_0xa922('0x113')](db[_0xa922('0x1c9')],{'as':_0xa922('0x1c8'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1c9')]['hasMany'](db[_0xa922('0x1c9')],{'as':_0xa922('0x1bf'),'foreignKey':'DescriptionId'});db[_0xa922('0x1c9')][_0xa922('0x113')](db['ZohoField'],{'as':_0xa922('0x1c4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0x1c9')][_0xa922('0x120')](db['Variable'],{'as':_0xa922('0x9a'),'foreignKey':'VariableId'});db[_0xa922('0xb4')][_0xa922('0x113')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xa922('0x1ca')][_0xa922('0x113')](db[_0xa922('0x1cb')],{'as':_0xa922('0x1c2'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1ca')][_0xa922('0x113')](db[_0xa922('0x1cb')],{'as':_0xa922('0x1c3'),'foreignKey':'DescriptionId'});db[_0xa922('0x1ca')][_0xa922('0x113')](db[_0xa922('0x1cb')],{'as':_0xa922('0x1b4'),'foreignKey':'FieldId'});db[_0xa922('0x1ca')]['belongsTo'](db[_0xa922('0xb4')],{'as':_0xa922('0x175'),'foreignKey':'AccountId'});db[_0xa922('0x1ca')][_0xa922('0x122')](db[_0xa922('0x90')],{'through':'int_zendesk_configuration_has_tags'});db[_0xa922('0x1cb')]['hasMany'](db[_0xa922('0x1cb')],{'as':_0xa922('0x1c8'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1cb')][_0xa922('0x113')](db[_0xa922('0x1cb')],{'as':_0xa922('0x1bf'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0x1cb')][_0xa922('0x113')](db[_0xa922('0x1cb')],{'as':_0xa922('0x1c4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0x1cb')][_0xa922('0x120')](db[_0xa922('0x9a')],{'as':'Variable','foreignKey':_0xa922('0x1c0')});db[_0xa922('0xb6')]['hasMany'](db[_0xa922('0xb8')],{'as':_0xa922('0x1b8'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0xb8')][_0xa922('0x113')](db[_0xa922('0xba')],{'as':_0xa922('0x1c2'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0xb8')][_0xa922('0x113')](db[_0xa922('0xba')],{'as':_0xa922('0x1c3'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1bd')});db['FreshdeskConfiguration'][_0xa922('0x113')](db[_0xa922('0xba')],{'as':_0xa922('0x1b4'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0xb8')][_0xa922('0x120')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xa922('0x1b9')});db[_0xa922('0xb8')][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x1cc')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0xa922('0x1c8'),'foreignKey':_0xa922('0x1bc')});db['FreshdeskField'][_0xa922('0x113')](db[_0xa922('0xba')],{'as':'Description','foreignKey':_0xa922('0x1bd')});db[_0xa922('0xba')]['hasMany'](db[_0xa922('0xba')],{'as':_0xa922('0x1c4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0xba')][_0xa922('0x120')](db[_0xa922('0x9a')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa922('0xbb')]['hasMany'](db[_0xa922('0x1cd')],{'as':'Configurations','onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0x1cd')][_0xa922('0x113')](db[_0xa922('0x1ce')],{'as':_0xa922('0x1c2'),'foreignKey':'SubjectId'});db[_0xa922('0x1cd')][_0xa922('0x113')](db[_0xa922('0x1ce')],{'as':_0xa922('0x1c3'),'foreignKey':'DescriptionId'});db[_0xa922('0x1cd')][_0xa922('0x113')](db[_0xa922('0x1ce')],{'as':_0xa922('0x1b4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0x1cd')][_0xa922('0x120')](db[_0xa922('0xbb')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1b9')});db['VtigerField'][_0xa922('0x113')](db[_0xa922('0x1ce')],{'as':_0xa922('0x1c8'),'foreignKey':_0xa922('0x1bc')});db['VtigerField'][_0xa922('0x113')](db[_0xa922('0x1ce')],{'as':_0xa922('0x1bf'),'foreignKey':'DescriptionId'});db[_0xa922('0x1ce')][_0xa922('0x113')](db[_0xa922('0x1ce')],{'as':'Field','foreignKey':_0xa922('0x1be')});db[_0xa922('0x1ce')][_0xa922('0x120')](db[_0xa922('0x9a')],{'as':_0xa922('0x9a'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xa922('0x113')](db[_0xa922('0xc1')],{'as':_0xa922('0x1b8'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0xc1')][_0xa922('0x113')](db[_0xa922('0xc3')],{'as':_0xa922('0x1c2'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0xc1')][_0xa922('0x113')](db[_0xa922('0xc3')],{'as':_0xa922('0x1c3'),'foreignKey':_0xa922('0x1bd')});db[_0xa922('0xc1')][_0xa922('0x113')](db[_0xa922('0xc3')],{'as':_0xa922('0x1b4'),'foreignKey':_0xa922('0x1be')});db['ServicenowConfiguration'][_0xa922('0x120')](db[_0xa922('0xbf')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0xc3')][_0xa922('0x113')](db[_0xa922('0xc3')],{'as':'Subject','foreignKey':_0xa922('0x1bc')});db['ServicenowField'][_0xa922('0x113')](db[_0xa922('0xc3')],{'as':'Description','foreignKey':_0xa922('0x1bd')});db[_0xa922('0xc3')][_0xa922('0x113')](db[_0xa922('0xc3')],{'as':'Field','foreignKey':_0xa922('0x1be')});db[_0xa922('0xc3')]['belongsTo'](db[_0xa922('0x9a')],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account']['hasMany'](db[_0xa922('0xc7')],{'as':_0xa922('0x1b8'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1b9')});db['Dynamics365Account'][_0xa922('0x120')](db[_0xa922('0x107')],{'as':_0xa922('0x107'),'foreignKey':'CloudProviderId'});db[_0xa922('0xc7')][_0xa922('0x113')](db[_0xa922('0x1cf')],{'as':_0xa922('0x1c2'),'onDelete':'cascade','foreignKey':_0xa922('0x1bc')});db[_0xa922('0xc7')][_0xa922('0x113')](db['Dynamics365Field'],{'as':_0xa922('0x1c3'),'onDelete':_0xa922('0x111'),'foreignKey':'DescriptionId'});db[_0xa922('0xc7')][_0xa922('0x113')](db[_0xa922('0x1cf')],{'as':_0xa922('0x1b4'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0xc7')][_0xa922('0x120')](db[_0xa922('0xc5')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0x1cf')][_0xa922('0x113')](db[_0xa922('0x1cf')],{'as':_0xa922('0x1c8'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0x1cf')][_0xa922('0x113')](db[_0xa922('0x1cf')],{'as':_0xa922('0x1bf'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xa922('0x113')](db[_0xa922('0x1cf')],{'as':_0xa922('0x1c4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0x1cf')][_0xa922('0x120')](db['Variable'],{'as':_0xa922('0x9a'),'foreignKey':_0xa922('0x1c0')});db['FreshsalesAccount'][_0xa922('0x113')](db[_0xa922('0xca')],{'as':_0xa922('0x1b8'),'onDelete':'cascade','foreignKey':_0xa922('0x1b9')});db['FreshsalesConfiguration'][_0xa922('0x113')](db['FreshsalesField'],{'as':_0xa922('0x1c2'),'foreignKey':'SubjectId'});db[_0xa922('0xca')]['hasMany'](db['FreshsalesField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0xa922('0x113')](db[_0xa922('0xcc')],{'as':_0xa922('0x1b4'),'foreignKey':_0xa922('0x1be')});db[_0xa922('0xca')]['belongsTo'](db['FreshsalesAccount'],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1b9')});db[_0xa922('0xcc')]['hasMany'](db[_0xa922('0xcc')],{'as':_0xa922('0x1c8'),'foreignKey':_0xa922('0x1bc')});db[_0xa922('0xcc')]['hasMany'](db['FreshsalesField'],{'as':_0xa922('0x1bf'),'foreignKey':'DescriptionId'});db[_0xa922('0xcc')][_0xa922('0x113')](db[_0xa922('0xcc')],{'as':'Field','foreignKey':_0xa922('0x1be')});db[_0xa922('0xcc')][_0xa922('0x120')](db[_0xa922('0x9a')],{'as':_0xa922('0x9a'),'foreignKey':_0xa922('0x1c0')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0xa922('0xce')][_0xa922('0x120')](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0xce')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':'Contact','foreignKey':_0xa922('0x176')});db[_0xa922('0xce')][_0xa922('0x120')](db[_0xa922('0x6d')],{});db[_0xa922('0xce')][_0xa922('0x120')](db['ChatMessage'],{});db[_0xa922('0xce')][_0xa922('0x120')](db[_0xa922('0x12')],{});db[_0xa922('0xce')][_0xa922('0x120')](db[_0xa922('0x133')],{});db[_0xa922('0xd0')][_0xa922('0x120')](db[_0xa922('0x12')],{'onDelete':'cascade','foreignKey':_0xa922('0x1d0')});db['ChatInternalMessage'][_0xa922('0x120')](db[_0xa922('0x12')],{'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1d1')});db[_0xa922('0xd5')][_0xa922('0x113')](db[_0xa922('0xd3')],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0xa922('0x113')](db[_0xa922('0xd2')],{'foreignKey':_0xa922('0x1d2'),'onDelete':_0xa922('0x111')});db['SmsQueueReport'][_0xa922('0x120')](db[_0xa922('0x57')],{});db[_0xa922('0xd7')][_0xa922('0x120')](db['CmList'],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db['SmsQueueReport'][_0xa922('0x120')](db['CmContact'],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db[_0xa922('0xd7')][_0xa922('0x120')](db[_0xa922('0x119')],{});db[_0xa922('0xd7')]['belongsTo'](db[_0xa922('0x5b')],{});db[_0xa922('0xd7')]['belongsTo'](db[_0xa922('0x12')],{});db[_0xa922('0xd7')][_0xa922('0x120')](db['SmsQueue'],{});db['JscriptyProject'][_0xa922('0x113')](db['JscriptySessionReport'],{'foreignKey':_0xa922('0x1d3')});db[_0xa922('0x1d4')]['hasMany'](db[_0xa922('0xd3')],{'foreignKey':_0xa922('0x1d3')});db[_0xa922('0x1d4')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xa922('0x1d3')});db[_0xa922('0xe4')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':'user_has_teams'});db[_0xa922('0xe4')][_0xa922('0x122')](db[_0xa922('0x1b')],{'through':_0xa922('0x109'),'as':_0xa922('0x12e')});db[_0xa922('0xe4')][_0xa922('0x122')](db[_0xa922('0x40')],{'through':_0xa922('0x173'),'as':_0xa922('0x131')});db[_0xa922('0xe4')][_0xa922('0x122')](db['ChatQueue'],{'through':_0xa922('0x199'),'as':_0xa922('0x1d5')});db[_0xa922('0xe4')][_0xa922('0x122')](db[_0xa922('0x53')],{'through':_0xa922('0x187'),'as':_0xa922('0x134')});db[_0xa922('0xe4')][_0xa922('0x122')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0xa922('0x135')});db[_0xa922('0xe4')][_0xa922('0x122')](db[_0xa922('0x66')],{'through':_0xa922('0x191'),'as':_0xa922('0x136')});db['Team'][_0xa922('0x122')](db[_0xa922('0x105')],{'through':'team_has_whatsapp_queues','as':_0xa922('0x137')});db['Team']['belongsToMany'](db[_0xa922('0x12f')],{'through':_0xa922('0x1d6'),'as':'VoicePrefixes'});db[_0xa922('0xe7')]['hasMany'](db[_0xa922('0x76')],{'as':_0xa922('0x14c'),'foreignKey':_0xa922('0x1a3')});db[_0xa922('0xe7')][_0xa922('0x113')](db[_0xa922('0x14d')],{'as':_0xa922('0x14e'),'foreignKey':_0xa922('0x1a3')});db[_0xa922('0xe7')][_0xa922('0x113')](db[_0xa922('0x7a')],{'as':_0xa922('0x14f'),'foreignKey':_0xa922('0x1a3')});db[_0xa922('0xe7')][_0xa922('0x113')](db[_0xa922('0x78')],{'as':_0xa922('0x150'),'foreignKey':_0xa922('0x1a3')});db[_0xa922('0xe7')]['belongsTo'](db[_0xa922('0x2b')],{'as':'Trunk','foreignKey':_0xa922('0x1d7')});db[_0xa922('0xe7')][_0xa922('0x120')](db[_0xa922('0x2b')],{'as':'TrunkBackup','foreignKey':_0xa922('0x153')});db[_0xa922('0xe7')]['belongsTo'](db[_0xa922('0x87')],{'as':_0xa922('0x87'),'foreignKey':_0xa922('0x154')});db['Campaign'][_0xa922('0x120')](db['SquareProject'],{'as':_0xa922('0xe0'),'foreignKey':_0xa922('0x1d8')});db[_0xa922('0xe7')][_0xa922('0x122')](db['CmList'],{'as':_0xa922('0x125'),'through':_0xa922('0x1d9')});db[_0xa922('0xe7')]['belongsToMany'](db['CmList'],{'as':_0xa922('0x159'),'through':_0xa922('0x1da')});db['Attachment'][_0xa922('0x120')](db['ChatOfflineMessage'],{'as':_0xa922('0x6f'),'foreignKey':_0xa922('0x17f')});db['MailTransferReport'][_0xa922('0x120')](db[_0xa922('0x44')],{});db['MailTransferReport'][_0xa922('0x120')](db[_0xa922('0x42')],{});db[_0xa922('0x1db')]['belongsTo'](db[_0xa922('0x3e')],{'foreignKey':_0xa922('0x1dc'),'as':_0xa922('0x1dd')});db[_0xa922('0x1db')][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1de'),'as':_0xa922('0x1df')});db[_0xa922('0x1db')][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1e0'),'as':_0xa922('0x1e1')});db['MailTransferReport'][_0xa922('0x120')](db[_0xa922('0x40')],{'foreignKey':_0xa922('0x1e2'),'as':_0xa922('0x1e3')});db[_0xa922('0x1db')]['belongsTo'](db[_0xa922('0x3e')],{'foreignKey':_0xa922('0x1e4'),'as':_0xa922('0x1e5')});db[_0xa922('0xef')][_0xa922('0x120')](db[_0xa922('0x192')],{});db['ChatTransferReport']['belongsTo'](db[_0xa922('0x6d')],{});db[_0xa922('0xef')][_0xa922('0x120')](db[_0xa922('0x68')],{'foreignKey':_0xa922('0x1e6'),'as':_0xa922('0x1dd')});db['ChatTransferReport'][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1de'),'as':'FromAgent'});db[_0xa922('0xef')][_0xa922('0x120')](db['User'],{'foreignKey':_0xa922('0x1e0'),'as':_0xa922('0x1e1')});db[_0xa922('0xef')][_0xa922('0x120')](db[_0xa922('0x133')],{'foreignKey':_0xa922('0x1e7'),'as':_0xa922('0x1e3')});db[_0xa922('0xef')]['belongsTo'](db[_0xa922('0x68')],{'foreignKey':'ToChatWebsiteId','as':_0xa922('0x1e5')});db[_0xa922('0xf1')][_0xa922('0x120')](db['FaxMessage'],{});db[_0xa922('0xf1')][_0xa922('0x120')](db[_0xa922('0x11b')],{});db['FaxTransferReport'][_0xa922('0x120')](db[_0xa922('0x4c')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport'][_0xa922('0x120')](db['User'],{'foreignKey':'FromUserId','as':_0xa922('0x1df')});db[_0xa922('0xf1')][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1e0'),'as':_0xa922('0x1e1')});db[_0xa922('0xf1')][_0xa922('0x120')](db[_0xa922('0x53')],{'foreignKey':_0xa922('0x1e8'),'as':'ToQueue'});db[_0xa922('0xf1')][_0xa922('0x120')](db[_0xa922('0x4c')],{'foreignKey':'ToFaxAccountId','as':_0xa922('0x1e5')});db[_0xa922('0x1e9')][_0xa922('0x120')](db[_0xa922('0x64')],{});db[_0xa922('0x1e9')][_0xa922('0x120')](db[_0xa922('0x62')],{});db['OpenchannelTransferReport'][_0xa922('0x120')](db[_0xa922('0x5e')],{'foreignKey':_0xa922('0x1ea'),'as':_0xa922('0x1dd')});db['OpenchannelTransferReport'][_0xa922('0x120')](db['User'],{'foreignKey':_0xa922('0x1de'),'as':'FromAgent'});db[_0xa922('0x1e9')][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1e0'),'as':_0xa922('0x1e1')});db[_0xa922('0x1e9')]['belongsTo'](db[_0xa922('0x66')],{'foreignKey':_0xa922('0x1eb'),'as':_0xa922('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0xa922('0x5e')],{'foreignKey':_0xa922('0x1ec'),'as':_0xa922('0x1e5')});db[_0xa922('0x1ed')][_0xa922('0x120')](db[_0xa922('0x5b')],{});db[_0xa922('0x1ed')][_0xa922('0x120')](db[_0xa922('0x119')],{});db[_0xa922('0x1ed')][_0xa922('0x120')](db[_0xa922('0x57')],{'foreignKey':'FromSmsAccountId','as':_0xa922('0x1dd')});db[_0xa922('0x1ed')][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1de'),'as':_0xa922('0x1df')});db['SmsTransferReport']['belongsTo'](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1e0'),'as':_0xa922('0x1e1')});db[_0xa922('0x1ed')][_0xa922('0x120')](db[_0xa922('0x5c')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xa922('0x1ed')]['belongsTo'](db[_0xa922('0x57')],{'foreignKey':_0xa922('0x1ee'),'as':_0xa922('0x1e5')});db[_0xa922('0xf4')][_0xa922('0x113')](db['Disposition'],{'as':_0xa922('0x16b'),'foreignKey':_0xa922('0x16f'),'onDelete':_0xa922('0x111')});db['CmList']['hasMany'](db['CmCustomField'],{'as':_0xa922('0x1ef'),'foreignKey':_0xa922('0x16f')});db['CmList'][_0xa922('0x113')](db[_0xa922('0x163')],{'as':'Contacts','onDelete':_0xa922('0x111'),'foreignKey':'ListId'});db[_0xa922('0xf4')][_0xa922('0x113')](db[_0xa922('0x14d')],{'as':_0xa922('0x14e'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0xf4')][_0xa922('0x113')](db[_0xa922('0x7a')],{'as':_0xa922('0x116'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0xf4')][_0xa922('0x113')](db[_0xa922('0x7c')],{'as':'ReportAgentPreview','foreignKey':_0xa922('0x16f')});db[_0xa922('0xf4')]['belongsToMany'](db[_0xa922('0x1b')],{'as':_0xa922('0x1f0'),'through':_0xa922('0x157')});db[_0xa922('0xf4')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x126')});db[_0xa922('0x12f')]['hasMany'](db['VoiceExtension'],{'as':_0xa922('0x115'),'onDelete':_0xa922('0x111')});db[_0xa922('0x12f')][_0xa922('0x122')](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x10c')});db[_0xa922('0x12f')][_0xa922('0x122')](db[_0xa922('0xe4')],{'through':_0xa922('0x1d6'),'as':_0xa922('0x158')});db[_0xa922('0xf6')][_0xa922('0x113')](db[_0xa922('0x12')],{'as':'Users','foreignKey':'userProfileId'});db[_0xa922('0xf6')][_0xa922('0x113')](db[_0xa922('0xf8')],{'as':_0xa922('0x1f1'),'foreignKey':_0xa922('0x121'),'onDelete':_0xa922('0x111')});db[_0xa922('0xf8')][_0xa922('0x113')](db['UserProfileResource'],{'as':_0xa922('0x1f2'),'foreignKey':_0xa922('0x1f3'),'onDelete':'cascade'});db['WhatsappAccount'][_0xa922('0x113')](db[_0xa922('0x85')],{'as':'Dispositions','foreignKey':_0xa922('0x1f4'),'onDelete':_0xa922('0x111')});db[_0xa922('0x140')][_0xa922('0x113')](db['CannedAnswer'],{'as':_0xa922('0x16c'),'foreignKey':_0xa922('0x1f4')});db[_0xa922('0x140')][_0xa922('0x113')](db[_0xa922('0x1f5')],{'as':_0xa922('0x15d'),'foreignKey':_0xa922('0x1f4')});db[_0xa922('0x140')][_0xa922('0x113')](db[_0xa922('0x12c')],{'as':'Interactions'});db['WhatsappAccount'][_0xa922('0x113')](db[_0xa922('0xfe')],{'as':_0xa922('0x146')});db[_0xa922('0x140')]['belongsTo'](db[_0xa922('0xf4')],{'as':_0xa922('0x16e'),'foreignKey':_0xa922('0x16f')});db[_0xa922('0x140')][_0xa922('0x120')](db[_0xa922('0x155')],{'as':'mandatoryDispositionPause','foreignKey':_0xa922('0x156')});db[_0xa922('0x140')][_0xa922('0x122')](db['User'],{'as':'Agents','through':_0xa922('0x142')});db[_0xa922('0xfe')][_0xa922('0x120')](db['User'],{'onDelete':_0xa922('0x168')});db[_0xa922('0xfe')][_0xa922('0x120')](db[_0xa922('0x105')],{'onDelete':_0xa922('0x168')});db['WhatsappApplication'][_0xa922('0x120')](db[_0xa922('0x140')],{'onDelete':_0xa922('0x168')});db['WhatsappApplication'][_0xa922('0x120')](db[_0xa922('0x87')],{'onDelete':'restrict','foreignKey':_0xa922('0x154')});db[_0xa922('0xfe')][_0xa922('0x120')](db[_0xa922('0x90')],{'onDelete':'restrict','foreignKey':_0xa922('0x180')});db['WhatsappInteraction'][_0xa922('0x113')](db[_0xa922('0x1f5')],{'as':_0xa922('0x15d'),'onDelete':_0xa922('0x111'),'foreignKey':_0xa922('0x1f6')});db['WhatsappInteraction'][_0xa922('0x120')](db[_0xa922('0x140')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1f4')});db[_0xa922('0x12c')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':_0xa922('0x176')});db[_0xa922('0x12c')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x177'),'foreignKey':_0xa922('0x112')});db[_0xa922('0x12c')]['belongsToMany'](db[_0xa922('0x90')],{'through':_0xa922('0x1b0'),'as':_0xa922('0x178')});db[_0xa922('0x12c')][_0xa922('0x122')](db[_0xa922('0x90')],{'through':_0xa922('0x1b0'),'as':'ThroughTags'});db[_0xa922('0x12c')][_0xa922('0x122')](db['User'],{'as':_0xa922('0x17b'),'through':_0xa922('0x12d'),'foreignKey':'WhatsappInteractionId'});db[_0xa922('0x1f5')][_0xa922('0x120')](db[_0xa922('0x12')],{'as':_0xa922('0x12')});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x164')});db['WhatsappMessage']['belongsTo'](db[_0xa922('0x12c')],{'onDelete':_0xa922('0x111'),'as':_0xa922('0x17d'),'foreignKey':'WhatsappInteractionId'});db[_0xa922('0x1f5')]['belongsTo'](db[_0xa922('0x140')],{'as':_0xa922('0x175'),'foreignKey':_0xa922('0x1f4')});db[_0xa922('0x1f7')][_0xa922('0x120')](db['WhatsappAccount'],{});db[_0xa922('0x1f7')][_0xa922('0x120')](db['CmList'],{'as':'List','foreignKey':_0xa922('0x16f')});db[_0xa922('0x1f7')][_0xa922('0x120')](db[_0xa922('0x163')],{'as':_0xa922('0x164'),'foreignKey':'ContactId'});db[_0xa922('0x1f7')][_0xa922('0x120')](db[_0xa922('0x12c')],{});db[_0xa922('0x1f7')][_0xa922('0x120')](db[_0xa922('0x105')],{});db['WhatsappQueueReport'][_0xa922('0x120')](db[_0xa922('0x1f5')],{});db['WhatsappQueueReport'][_0xa922('0x120')](db[_0xa922('0x12')],{});db[_0xa922('0x103')]['belongsTo'](db[_0xa922('0x1f5')],{});db['WhatsappTransferReport'][_0xa922('0x120')](db['WhatsappInteraction'],{});db[_0xa922('0x103')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xa922('0x120')](db[_0xa922('0x140')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0xa922('0x103')]['belongsTo'](db[_0xa922('0x105')],{'foreignKey':_0xa922('0x1f8'),'as':'ToQueue'});db[_0xa922('0x103')][_0xa922('0x120')](db[_0xa922('0x12')],{'foreignKey':_0xa922('0x1de'),'as':_0xa922('0x1df')});db['WhatsappTransferReport'][_0xa922('0x120')](db['User'],{'foreignKey':_0xa922('0x1e0'),'as':'ToAgent'});db[_0xa922('0x105')]['belongsToMany'](db[_0xa922('0x12')],{'as':_0xa922('0x172'),'through':_0xa922('0x39'),'foreignKey':'WhatsappQueueId'});db[_0xa922('0x105')][_0xa922('0x122')](db['Team'],{'through':_0xa922('0x1f9'),'as':_0xa922('0x158')});db[_0xa922('0x10d')]['belongsTo'](db[_0xa922('0x12')],{'as':_0xa922('0x1fa'),'foreignKey':_0xa922('0x112'),'onDelete':'cascade','hooks':!![]});db['CloudProvider']['hasOne'](db[_0xa922('0xc5')],{'as':_0xa922('0xc5'),'onDelete':_0xa922('0x168')});db[_0xa922('0x107')]['hasOne'](db[_0xa922('0x3b')],{'as':_0xa922('0x169'),'onDelete':_0xa922('0x168')});db[_0xa922('0x107')][_0xa922('0x10f')](db[_0xa922('0x166')],{'as':_0xa922('0x16a'),'onDelete':_0xa922('0x168')});module[_0xa922('0x1fb')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x7dca=['UserFaxQueue','SmsQueues','OpenchannelQueue','UserOpenchannelQueue','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','Imap','Smtp','CannedAnswer','Answers','Interactions','Applications','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','team_has_mail_queues','Contact','Owner','mail_interaction_has_tags','Users','MailInteractionId','Attachments','Account','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','Dashboard','Items','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Interaction','Attachment','AttachmentId','team_has_fax_queues','Dispositions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','ChatApplication','Agent','Queue','Website','chat_interaction_has_tags','ChatInteractionId','ChatMessage','ChatGroupId','Contacts','CompanyId','ChatInteractions','Company','cm_contact_has_tags','CmHopperId','CampaignId','OwnerId','Automation','Condition','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticCustomReport','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','AnalyticMetric','Fields','MetricId','Configurations','AccountId','Subjects','Descriptions','FieldId','Subject','SubjectId','Description','DescriptionId','VariableId','Field','int_desk_configuration_has_tags','ZohoField','ZendeskConfiguration','ZendeskField','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Account','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','team_has_chat_queues','ChatQueues','OpenchannelQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefix','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','exports','../config/environment','sequelize','lodash','jstz','determine','xcall','xC@LL1234','127.0.0.1','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','motion2','mysql','name','database','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','ReportAgentPreview','CmCustomField','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','Team','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','FaxQueue','FaxQueues'];(function(_0x3e1fc4,_0x5dd8e2){var _0x2e4405=function(_0xb15d38){while(--_0xb15d38){_0x3e1fc4['push'](_0x3e1fc4['shift']());}};_0x2e4405(++_0x5dd8e2);}(_0x7dca,0xd2));var _0xa7dc=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x7dca[_0x101e7b];return _0x4995c0;};'use strict';var config=require(_0xa7dc('0x0'));var Sequelize=require(_0xa7dc('0x1'));var _=require(_0xa7dc('0x2'));var jstz=require(_0xa7dc('0x3'));var timezone=jstz[_0xa7dc('0x4')]();config[_0xa7dc('0x1')]=_['defaultsDeep'](config[_0xa7dc('0x1')],{'database':'motion2','username':_0xa7dc('0x5'),'password':_0xa7dc('0x6'),'options':{'host':_0xa7dc('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa7dc('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa7dc('0x9'),'collate':_0xa7dc('0xa')}}});config[_0xa7dc('0xb')]=_[_0xa7dc('0xc')](config[_0xa7dc('0xb')],{'database':_0xa7dc('0xd'),'username':_0xa7dc('0x5'),'password':_0xa7dc('0x6'),'options':{'host':_0xa7dc('0x7'),'port':0xcea,'dialect':_0xa7dc('0xe'),'dialectOptions':{'charset':_0xa7dc('0x8')},'logging':![],'timezone':timezone[_0xa7dc('0xf')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xa7dc('0x10')],config[_0xa7dc('0x1')]['username'],config[_0xa7dc('0x1')][_0xa7dc('0x11')],config[_0xa7dc('0x1')][_0xa7dc('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa7dc('0xb')][_0xa7dc('0x10')],config[_0xa7dc('0xb')]['username'],config[_0xa7dc('0xb')][_0xa7dc('0x11')],config['sequelizeHistory'][_0xa7dc('0x12')])};db[_0xa7dc('0x13')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x14'));db[_0xa7dc('0x15')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x17'));db[_0xa7dc('0x18')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x19'));db['VoiceExtension']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x1a'));db[_0xa7dc('0x1b')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x1c'));db[_0xa7dc('0x1d')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x1e'));db[_0xa7dc('0x1f')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x20'));db[_0xa7dc('0x21')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/screenRecording/screenRecording.model');db[_0xa7dc('0x22')]=db['sequelize']['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x23'));db[_0xa7dc('0x24')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x25'));db[_0xa7dc('0x26')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x27'));db[_0xa7dc('0x28')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x29'));db[_0xa7dc('0x2a')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x2b'));db[_0xa7dc('0x2c')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x2d'));db['Trunk']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x2e'));db[_0xa7dc('0x2f')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0xa7dc('0x16')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xa7dc('0x30')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x31'));db[_0xa7dc('0x32')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x33'));db[_0xa7dc('0x34')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x35'));db['UserFaxQueue']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x36'));db[_0xa7dc('0x37')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x38'));db['UserOpenchannelQueue']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x39'));db[_0xa7dc('0x3a')]=db['sequelize'][_0xa7dc('0x16')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x3b'));db[_0xa7dc('0x3c')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/mailServerOut/mailServerOut.model');db[_0xa7dc('0x3d')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x3e'));db[_0xa7dc('0x3f')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/mailQueue/mailQueue.model');db[_0xa7dc('0x40')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x41'));db[_0xa7dc('0x42')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/mailInteraction/mailInteraction.model');db[_0xa7dc('0x43')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x44'));db[_0xa7dc('0x45')]=db['sequelize']['import'](_0xa7dc('0x46'));db['MailQueueReport']=db['sequelize']['import'](_0xa7dc('0x47'));db['Dashboard']=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/dashboard/dashboard.model');db[_0xa7dc('0x48')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x49'));db['FaxAccount']=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/faxAccount/faxAccount.model');db[_0xa7dc('0x4a')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db[_0xa7dc('0x4b')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x4c'));db['FaxMessage']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x4d'));db['FaxQueue']=db[_0xa7dc('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0xa7dc('0x4e')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x4f'));db[_0xa7dc('0x50')]=db['sequelize']['import'](_0xa7dc('0x51'));db[_0xa7dc('0x52')]=db['sequelize']['import']('../api/smsApplication/smsApplication.model');db[_0xa7dc('0x53')]=db['sequelize'][_0xa7dc('0x16')]('../api/smsInteraction/smsInteraction.model');db[_0xa7dc('0x54')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/smsMessage/smsMessage.model');db[_0xa7dc('0x55')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x56'));db[_0xa7dc('0x57')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x58'));db[_0xa7dc('0x59')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x5a'));db[_0xa7dc('0x5b')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x5c'));db[_0xa7dc('0x5d')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x5e'));db['OpenchannelQueue']=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x5f'));db[_0xa7dc('0x60')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x61'));db['OpenchannelQueueReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x62'));db['ChatApplication']=db['sequelize'][_0xa7dc('0x16')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x63'));db['ChatMessage']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x64'));db[_0xa7dc('0x65')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x66'));db[_0xa7dc('0x67')]=db['sequelize']['import'](_0xa7dc('0x68'));db[_0xa7dc('0x69')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x6a'));db['ChatProactiveAction']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x6b'));db['CmCompany']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x6c'));db[_0xa7dc('0x6d')]=db[_0xa7dc('0x1')]['import']('../api/cmContact/cmContact.model');db[_0xa7dc('0x6e')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x6f'));db['CmHopperBlack']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x70'));db['CmHopperFinal']=db['sequelize'][_0xa7dc('0x16')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xa7dc('0x71')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xa7dc('0x72')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xa7dc('0x73')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/cmCustomField/cmCustomField.model');db[_0xa7dc('0x74')]=db['sequelize']['import'](_0xa7dc('0x75'));db['Automation']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x76'));db['CannedAnswer']=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x77'));db[_0xa7dc('0x78')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x79'));db['Condition']=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x7a'));db[_0xa7dc('0x7b')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x7c'));db[_0xa7dc('0x7d')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x7e'));db[_0xa7dc('0x7f')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x80'));db[_0xa7dc('0x81')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x82'));db[_0xa7dc('0x83')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x84'));db[_0xa7dc('0x85')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x86'));db[_0xa7dc('0x87')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/tag/tag.model');db[_0xa7dc('0x88')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x89'));db[_0xa7dc('0x8a')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x8b'));db[_0xa7dc('0x8c')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x8d'));db[_0xa7dc('0x8e')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x8f'));db[_0xa7dc('0x90')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x91'));db[_0xa7dc('0x92')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x93'));db[_0xa7dc('0x94')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x95'));db['IntegrationReport']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x96'));db['AnalyticCustomReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xa7dc('0x97')]=db['sequelize']['import'](_0xa7dc('0x98'));db['AnalyticExtractedReport']=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x99'));db['AnalyticMetric']=db['sequelize']['import'](_0xa7dc('0x9a'));db['AnalyticFieldReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x9b'));db[_0xa7dc('0x9c')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x9d'));db[_0xa7dc('0x9e')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x9f'));db[_0xa7dc('0xa0')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/intSalesforceField/intSalesforceField.model');db[_0xa7dc('0xa1')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xa2'));db[_0xa7dc('0xa3')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xa4'));db[_0xa7dc('0xa5')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xa7dc('0xa6')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xa7'));db[_0xa7dc('0xa8')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xa9'));db[_0xa7dc('0xaa')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0xab'));db[_0xa7dc('0xac')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xad'));db[_0xa7dc('0xae')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/intZohoField/intZohoField.model');db[_0xa7dc('0xaf')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xb0'));db['ZendeskConfiguration']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xb1'));db['ZendeskField']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xb2'));db[_0xa7dc('0xb3')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xb4'));db['FreshdeskConfiguration']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xb5'));db[_0xa7dc('0xb6')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa7dc('0xb7')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xb8'));db[_0xa7dc('0xb9')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xba'));db[_0xa7dc('0xbb')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0xbc'));db['ServicenowAccount']=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xbd'));db[_0xa7dc('0xbe')]=db[_0xa7dc('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xa7dc('0xbf')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xc0'));db['Dynamics365Account']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xc1'));db[_0xa7dc('0xc2')]=db['sequelize'][_0xa7dc('0x16')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xa7dc('0xc3')]=db['sequelize'][_0xa7dc('0x16')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xa7dc('0xc4')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xa7dc('0xc5')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xc6'));db[_0xa7dc('0xc7')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xc8'));db[_0xa7dc('0x94')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0x95'));db[_0xa7dc('0xc9')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xca'));db[_0xa7dc('0xcb')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xcc'));db[_0xa7dc('0xcd')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0xce'));db['JscriptyAnswerReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xcf'));db[_0xa7dc('0xd0')]=db['sequelize'][_0xa7dc('0x16')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xd1'));db[_0xa7dc('0xd2')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0xd3'));db['SquareReport']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xd4'));db[_0xa7dc('0xd5')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/squareReportDetail/squareReportDetail.model');db[_0xa7dc('0xd6')]=db['sequelize'][_0xa7dc('0x16')]('../api/jscriptyProject/jscriptyProject.model');db[_0xa7dc('0xd7')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xd8'));db[_0xa7dc('0xd9')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xda'));db[_0xa7dc('0xdb')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/squareProject/squareProject.model');db[_0xa7dc('0xdc')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/squareRecording/squareRecording.model');db[_0xa7dc('0xdd')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xde'));db['Team']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xdf'));db[_0xa7dc('0xe0')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xe1'));db[_0xa7dc('0xe2')]=db['sequelize']['import'](_0xa7dc('0xe3'));db[_0xa7dc('0xe4')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0xe5'));db['Attachment']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xe6'));db[_0xa7dc('0xe7')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/plugin/plugin.model');db[_0xa7dc('0xe8')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xe9'));db[_0xa7dc('0xea')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xeb'));db[_0xa7dc('0xec')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xed'));db['OpenchannelTransferReport']=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0xee'));db[_0xa7dc('0xef')]=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xf0'));db[_0xa7dc('0xf1')]=db['sequelize'][_0xa7dc('0x16')]('../api/cmList/cmList.model');db['VoicePrefix']=db['sequelize']['import'](_0xa7dc('0xf2'));db['UserProfile']=db[_0xa7dc('0x1')]['import'](_0xa7dc('0xf3'));db[_0xa7dc('0xf4')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xf5'));db['UserProfileResource']=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xf6'));db[_0xa7dc('0xf7')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xf8'));db[_0xa7dc('0xf9')]=db[_0xa7dc('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0xa7dc('0xfa')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0xfb'));db[_0xa7dc('0xfc')]=db[_0xa7dc('0x1')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xa7dc('0xfd')]=db['sequelize'][_0xa7dc('0x16')]('../api/whatsappMessage/whatsappMessage.model');db[_0xa7dc('0xfe')]=db[_0xa7dc('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xa7dc('0xff')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x100'));db[_0xa7dc('0x101')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x102'));db[_0xa7dc('0x103')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0xa7dc('0x1')][_0xa7dc('0x16')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xa7dc('0x104')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x105'));db[_0xa7dc('0x106')]=db[_0xa7dc('0x1')][_0xa7dc('0x16')](_0xa7dc('0x107'));db[_0xa7dc('0x108')]=db['sequelize'][_0xa7dc('0x16')](_0xa7dc('0x109'));db['User'][_0xa7dc('0x10a')](db[_0xa7dc('0x22')],{'as':'VoiceMail','onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x10c')});db['User'][_0xa7dc('0x10a')](db[_0xa7dc('0x108')],{'as':_0xa7dc('0x10d'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db[_0xa7dc('0x1f')],{'as':_0xa7dc('0x10f'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db['UserVoiceQueueRt'],{'as':_0xa7dc('0x110'),'foreignKey':'UserId'});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db[_0xa7dc('0x111')],{'as':_0xa7dc('0x112'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db['User'][_0xa7dc('0x10e')](db[_0xa7dc('0x113')],{'as':_0xa7dc('0x114'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')]['hasMany'](db[_0xa7dc('0x71')],{'as':'HopperHistory','foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db[_0xa7dc('0x72')],{'as':_0xa7dc('0x72'),'foreignKey':_0xa7dc('0x10c')});db['User'][_0xa7dc('0x10e')](db['OpenchannelInteraction'],{'as':_0xa7dc('0x115'),'foreignKey':_0xa7dc('0x10c')});db['User']['hasMany'](db[_0xa7dc('0x116')],{'as':'ChatInteractions','foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db['SmsInteraction'],{'as':_0xa7dc('0x117'),'foreignKey':'UserId'});db['User'][_0xa7dc('0x10e')](db[_0xa7dc('0x4b')],{'as':_0xa7dc('0x118'),'foreignKey':_0xa7dc('0x10c')});db['User']['hasMany'](db[_0xa7dc('0x42')],{'as':_0xa7dc('0x119'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db[_0xa7dc('0xfc')],{'as':_0xa7dc('0x11a'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x13')][_0xa7dc('0x10e')](db[_0xa7dc('0xf7')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xa7dc('0x13')][_0xa7dc('0x11b')](db[_0xa7dc('0x11c')],{'as':_0xa7dc('0x11c'),'foreignKey':_0xa7dc('0x11d')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x69')],{'as':_0xa7dc('0x11f'),'through':_0xa7dc('0x120')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x6d')],{'as':'Contacts','through':_0xa7dc('0x121')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x122'),'through':'cm_user_has_lists'});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x123')],{'through':'user_has_teams'});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x42')],{'as':'MailInteractions','through':_0xa7dc('0x124')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0xa7dc('0x125')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xa7dc('0x126')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x53')],{'as':_0xa7dc('0x117'),'through':'user_has_sms_interactions'});db['User'][_0xa7dc('0x11e')](db[_0xa7dc('0x5b')],{'as':_0xa7dc('0x115'),'through':_0xa7dc('0x127')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0xfc')],{'as':_0xa7dc('0x11a'),'through':_0xa7dc('0x128')});db['User']['belongsToMany'](db[_0xa7dc('0x1d')],{'as':_0xa7dc('0x129'),'through':'UserVoiceQueue','required':![]});db['User'][_0xa7dc('0x11e')](db['VoicePrefix'],{'as':_0xa7dc('0x12a'),'through':_0xa7dc('0x106'),'required':![]});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x3f')],{'as':_0xa7dc('0x12b'),'through':'UserMailQueue','required':![]});db['User'][_0xa7dc('0x11e')](db[_0xa7dc('0x67')],{'as':'ChatQueues','through':_0xa7dc('0x32'),'required':![],'hooks':!![]});db['User'][_0xa7dc('0x11e')](db[_0xa7dc('0x12c')],{'as':_0xa7dc('0x12d'),'through':_0xa7dc('0x12e'),'required':![]});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x55')],{'as':_0xa7dc('0x12f'),'through':'UserSmsQueue','required':![]});db[_0xa7dc('0x13')]['belongsToMany'](db[_0xa7dc('0x130')],{'as':'OpenchannelQueues','through':_0xa7dc('0x131'),'required':![]});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x101')],{'as':'WhatsappQueues','through':_0xa7dc('0x3a'),'required':![]});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0xf1')],{'through':_0xa7dc('0x132')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x60')],{'as':_0xa7dc('0x133'),'through':_0xa7dc('0x134')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x135')],{'as':_0xa7dc('0x136'),'through':_0xa7dc('0x137')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db[_0xa7dc('0x3d')],{'as':'MailAccounts','through':_0xa7dc('0x138')});db['User'][_0xa7dc('0x11e')](db[_0xa7dc('0x57')],{'as':'OpenchannelAccounts','through':_0xa7dc('0x139')});db['User'][_0xa7dc('0x11e')](db[_0xa7dc('0x50')],{'as':_0xa7dc('0x13a'),'through':_0xa7dc('0x13b')});db[_0xa7dc('0x13')][_0xa7dc('0x11e')](db['WhatsappAccount'],{'as':_0xa7dc('0x13c'),'through':'user_has_whatsapp_accounts'});db['VoiceChanSpy'][_0xa7dc('0x10e')](db[_0xa7dc('0x111')],{'as':_0xa7dc('0x13d'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x13e')});db[_0xa7dc('0x18')][_0xa7dc('0x10e')](db[_0xa7dc('0x111')],{'onDelete':_0xa7dc('0x10b')});db['VoiceExtension'][_0xa7dc('0x10e')](db[_0xa7dc('0x111')],{'as':'Applications','onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x1b')][_0xa7dc('0x11e')](db[_0xa7dc('0x85')],{'as':_0xa7dc('0x13f'),'through':_0xa7dc('0x140')});db[_0xa7dc('0x1d')][_0xa7dc('0x10e')](db[_0xa7dc('0x141')],{'as':_0xa7dc('0x142'),'foreignKey':_0xa7dc('0x143')});db[_0xa7dc('0x1d')][_0xa7dc('0x10e')](db[_0xa7dc('0x6e')],{'as':_0xa7dc('0x144'),'foreignKey':_0xa7dc('0x143')});db[_0xa7dc('0x1d')][_0xa7dc('0x10e')](db['CmHopperFinal'],{'as':_0xa7dc('0x114'),'foreignKey':_0xa7dc('0x143')});db['VoiceQueue']['hasMany'](db['CmHopperHistory'],{'as':_0xa7dc('0x145'),'foreignKey':_0xa7dc('0x143')});db[_0xa7dc('0x1d')][_0xa7dc('0x10e')](db['ReportAgentPreview'],{'as':_0xa7dc('0x72'),'foreignKey':'VoiceQueueId'});db[_0xa7dc('0x1d')][_0xa7dc('0x10e')](db[_0xa7dc('0x146')],{'as':_0xa7dc('0x147'),'foreignKey':_0xa7dc('0x143')});db[_0xa7dc('0x1d')][_0xa7dc('0x10e')](db[_0xa7dc('0x148')],{'as':_0xa7dc('0x149'),'foreignKey':_0xa7dc('0x143')});db[_0xa7dc('0x1d')][_0xa7dc('0x11b')](db[_0xa7dc('0x14a')],{'as':_0xa7dc('0x14a'),'foreignKey':_0xa7dc('0x14b')});db[_0xa7dc('0x1d')][_0xa7dc('0x11b')](db[_0xa7dc('0x14a')],{'as':_0xa7dc('0x14c'),'foreignKey':_0xa7dc('0x14d')});db[_0xa7dc('0x1d')]['belongsTo'](db[_0xa7dc('0x7b')],{'as':'Interval','foreignKey':_0xa7dc('0x14e')});db['VoiceQueue'][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xa7dc('0x11e')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x122'),'through':_0xa7dc('0x14f')});db[_0xa7dc('0x1d')][_0xa7dc('0x11e')](db['User'],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x30')});db[_0xa7dc('0x1d')][_0xa7dc('0x11e')](db[_0xa7dc('0x123')],{'as':_0xa7dc('0x151'),'through':_0xa7dc('0x152')});db[_0xa7dc('0x1d')][_0xa7dc('0x11e')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x153'),'through':_0xa7dc('0x154')});db[_0xa7dc('0x1f')][_0xa7dc('0x11b')](db['User'],{'as':_0xa7dc('0x13'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x21')]['belongsTo'](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x13'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x22')][_0xa7dc('0x10e')](db[_0xa7dc('0x155')],{'as':_0xa7dc('0x156'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x157'),'sourceKey':_0xa7dc('0x158')});db[_0xa7dc('0x155')][_0xa7dc('0x11b')](db[_0xa7dc('0x22')],{'foreignKey':_0xa7dc('0x157'),'targetKey':'mailbox'});db[_0xa7dc('0x24')][_0xa7dc('0x10e')](db[_0xa7dc('0x2a')],{'as':'QueueCalls','foreignKey':_0xa7dc('0x159'),'constraints':![]});db[_0xa7dc('0x24')][_0xa7dc('0x10e')](db[_0xa7dc('0x28')],{'as':'AgentReports','foreignKey':_0xa7dc('0x159'),'constraints':![]});db[_0xa7dc('0x24')][_0xa7dc('0x11b')](db['User'],{'as':'User','foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x24')]['belongsTo'](db[_0xa7dc('0x6d')],{'as':'Contact','foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0x15b')][_0xa7dc('0x11b')](db[_0xa7dc('0x3d')],{'as':_0xa7dc('0x3d'),'foreignKey':_0xa7dc('0x15c')});db[_0xa7dc('0x15b')]['belongsTo'](db[_0xa7dc('0x103')],{'as':'CloudProvider','foreignKey':_0xa7dc('0x15d'),'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x3c')][_0xa7dc('0x11b')](db['MailAccount'],{'as':_0xa7dc('0x3d'),'foreignKey':_0xa7dc('0x15c')});db['MailServerOut']['belongsTo'](db[_0xa7dc('0x103')],{'as':_0xa7dc('0x103'),'foreignKey':'CloudProviderId','onDelete':_0xa7dc('0x15e')});db['MailAccount']['hasOne'](db['MailServerIn'],{'as':_0xa7dc('0x15f'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x3d')][_0xa7dc('0x10a')](db[_0xa7dc('0x3c')],{'as':_0xa7dc('0x160'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x3d')][_0xa7dc('0x10e')](db[_0xa7dc('0x78')],{'as':'Dispositions','foreignKey':_0xa7dc('0x15c'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x3d')][_0xa7dc('0x10e')](db[_0xa7dc('0x161')],{'as':_0xa7dc('0x162'),'foreignKey':'MailAccountId'});db[_0xa7dc('0x3d')][_0xa7dc('0x10e')](db[_0xa7dc('0x43')],{'as':_0xa7dc('0x156'),'foreignKey':_0xa7dc('0x15c')});db[_0xa7dc('0x3d')][_0xa7dc('0x10e')](db['MailInteraction'],{'as':_0xa7dc('0x163')});db[_0xa7dc('0x3d')]['hasMany'](db['MailApplication'],{'as':_0xa7dc('0x164')});db['MailAccount']['belongsTo'](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db['MailAccount'][_0xa7dc('0x11b')](db[_0xa7dc('0x8e')],{'as':_0xa7dc('0x8e'),'foreignKey':_0xa7dc('0x167')});db[_0xa7dc('0x3d')][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':_0xa7dc('0x168'),'foreignKey':_0xa7dc('0x169')});db[_0xa7dc('0x3d')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x138')});db[_0xa7dc('0x3f')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Agents','through':_0xa7dc('0x34')});db[_0xa7dc('0x3f')]['belongsToMany'](db[_0xa7dc('0x123')],{'through':_0xa7dc('0x16a'),'as':_0xa7dc('0x151')});db[_0xa7dc('0x42')][_0xa7dc('0x10e')](db[_0xa7dc('0x43')],{'as':'Messages','onDelete':_0xa7dc('0x10b'),'foreignKey':'MailInteractionId'});db[_0xa7dc('0x42')]['belongsTo'](db[_0xa7dc('0x3d')],{'as':'Account','foreignKey':_0xa7dc('0x15c')});db[_0xa7dc('0x42')]['belongsTo'](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':'ContactId'});db[_0xa7dc('0x42')][_0xa7dc('0x11b')](db['User'],{'as':_0xa7dc('0x16c'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x42')][_0xa7dc('0x11e')](db['Tag'],{'through':_0xa7dc('0x16d'),'as':'Tags'});db['MailInteraction'][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x16d'),'as':'ThroughTags'});db[_0xa7dc('0x42')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16e'),'through':_0xa7dc('0x124'),'foreignKey':_0xa7dc('0x16f')});db[_0xa7dc('0x43')][_0xa7dc('0x10e')](db['Attachment'],{'as':_0xa7dc('0x170'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x43')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':'User'});db[_0xa7dc('0x43')]['belongsTo'](db[_0xa7dc('0x6d')],{'onDelete':_0xa7dc('0x10b'),'as':'Contact'});db[_0xa7dc('0x43')][_0xa7dc('0x11b')](db[_0xa7dc('0x42')],{'as':'Interaction','foreignKey':_0xa7dc('0x16f')});db[_0xa7dc('0x43')][_0xa7dc('0x11b')](db[_0xa7dc('0x3d')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x15c')});db['MailMessage'][_0xa7dc('0x11b')](db[_0xa7dc('0x60')],{'as':_0xa7dc('0x60'),'foreignKey':_0xa7dc('0x172')});db[_0xa7dc('0x43')][_0xa7dc('0x11b')](db['ChatOfflineMessage'],{'as':_0xa7dc('0x65'),'foreignKey':_0xa7dc('0x173')});db['MailApplication'][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'onDelete':'restrict'});db[_0xa7dc('0x45')][_0xa7dc('0x11b')](db['MailQueue'],{'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x45')][_0xa7dc('0x11b')](db[_0xa7dc('0x3d')],{'onDelete':_0xa7dc('0x15e')});db['MailApplication']['belongsTo'](db['Interval'],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x14e')});db['MailApplication'][_0xa7dc('0x11b')](db[_0xa7dc('0x87')],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x174')});db[_0xa7dc('0x175')][_0xa7dc('0x11b')](db[_0xa7dc('0x3d')],{});db[_0xa7dc('0x175')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':'List','foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0x175')]['belongsTo'](db[_0xa7dc('0x6d')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa7dc('0x175')]['belongsTo'](db[_0xa7dc('0x42')],{});db[_0xa7dc('0x175')][_0xa7dc('0x11b')](db[_0xa7dc('0x43')],{});db[_0xa7dc('0x175')]['belongsTo'](db[_0xa7dc('0x13')],{});db[_0xa7dc('0x175')][_0xa7dc('0x11b')](db[_0xa7dc('0x3f')],{});db[_0xa7dc('0x176')][_0xa7dc('0x10e')](db[_0xa7dc('0x48')],{'as':_0xa7dc('0x177'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x135')][_0xa7dc('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa7dc('0x178'),'onDelete':_0xa7dc('0x10b')});db['FaxAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x161')],{'as':'Answers','foreignKey':_0xa7dc('0x178')});db['FaxAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x4b')],{'as':_0xa7dc('0x163')});db['FaxAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x4a')],{'as':_0xa7dc('0x164')});db[_0xa7dc('0x135')][_0xa7dc('0x10e')](db['VoiceExtension'],{'as':_0xa7dc('0x179'),'onDelete':_0xa7dc('0x10b')});db['FaxAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x17a')],{'as':_0xa7dc('0x156')});db['FaxAccount'][_0xa7dc('0x11b')](db[_0xa7dc('0x14a')],{'as':_0xa7dc('0x14a')});db[_0xa7dc('0x135')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0x135')][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':_0xa7dc('0x168'),'foreignKey':_0xa7dc('0x169')});db['FaxAccount'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x137')});db[_0xa7dc('0x4a')][_0xa7dc('0x11b')](db['User'],{'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x4a')][_0xa7dc('0x11b')](db[_0xa7dc('0x12c')],{'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x4a')]['belongsTo'](db[_0xa7dc('0x135')],{'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x4a')][_0xa7dc('0x11b')](db[_0xa7dc('0x87')],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x174')});db['FaxInteraction']['hasMany'](db[_0xa7dc('0x17a')],{'as':_0xa7dc('0x156'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x17b')});db[_0xa7dc('0x4b')][_0xa7dc('0x11b')](db[_0xa7dc('0x135')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xa7dc('0x4b')][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':'ContactId'});db['FaxInteraction'][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16c'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x4b')][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x17c'),'as':'Tags'});db['FaxInteraction'][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':'fax_interaction_has_tags','as':_0xa7dc('0x17d')});db['FaxInteraction'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16e'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xa7dc('0x17a')][_0xa7dc('0x11b')](db['User'],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x13')});db[_0xa7dc('0x17a')]['belongsTo'](db[_0xa7dc('0x4b')],{'as':_0xa7dc('0x17e'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x16b')});db[_0xa7dc('0x17a')][_0xa7dc('0x11b')](db[_0xa7dc('0x17f')],{'as':_0xa7dc('0x17f'),'foreignKey':_0xa7dc('0x180')});db[_0xa7dc('0x17a')][_0xa7dc('0x11b')](db[_0xa7dc('0x135')],{'as':_0xa7dc('0x171'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x12e')});db['FaxQueue']['belongsToMany'](db[_0xa7dc('0x123')],{'through':_0xa7dc('0x181'),'as':_0xa7dc('0x151')});db['FaxQueueReport']['belongsTo'](db[_0xa7dc('0x135')],{});db[_0xa7dc('0x4e')]['belongsTo'](db[_0xa7dc('0xf1')],{'as':'List','foreignKey':_0xa7dc('0x166')});db['FaxQueueReport']['belongsTo'](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':'ContactId'});db[_0xa7dc('0x4e')][_0xa7dc('0x11b')](db[_0xa7dc('0x4b')],{});db[_0xa7dc('0x4e')]['belongsTo'](db[_0xa7dc('0x17a')],{});db[_0xa7dc('0x4e')][_0xa7dc('0x11b')](db['User'],{});db['FaxQueueReport']['belongsTo'](db['FaxQueue'],{});db[_0xa7dc('0x50')]['hasMany'](db['Disposition'],{'as':_0xa7dc('0x182'),'foreignKey':_0xa7dc('0x183'),'onDelete':_0xa7dc('0x10b')});db['SmsAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x161')],{'as':_0xa7dc('0x162'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x54')],{'as':_0xa7dc('0x156'),'foreignKey':'SmsAccountId'});db[_0xa7dc('0x50')]['hasMany'](db[_0xa7dc('0x53')],{'as':'Interactions'});db['SmsAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x52')],{'as':_0xa7dc('0x164')});db[_0xa7dc('0x50')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0x50')][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':_0xa7dc('0x168'),'foreignKey':_0xa7dc('0x169')});db['SmsAccount'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':'user_has_sms_accounts'});db[_0xa7dc('0x52')]['belongsTo'](db[_0xa7dc('0x13')],{'onDelete':_0xa7dc('0x15e')});db['SmsApplication'][_0xa7dc('0x11b')](db[_0xa7dc('0x55')],{'onDelete':'restrict'});db[_0xa7dc('0x52')][_0xa7dc('0x11b')](db[_0xa7dc('0x50')],{'onDelete':_0xa7dc('0x15e')});db['SmsApplication']['belongsTo'](db['Interval'],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x14e')});db[_0xa7dc('0x52')][_0xa7dc('0x11b')](db[_0xa7dc('0x87')],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x174')});db[_0xa7dc('0x53')]['hasMany'](db['SmsMessage'],{'as':_0xa7dc('0x156'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x184')});db[_0xa7dc('0x53')][_0xa7dc('0x11b')](db[_0xa7dc('0x50')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xa7dc('0x53')][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':'Contact','foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0x53')][_0xa7dc('0x11b')](db['User'],{'as':_0xa7dc('0x16c'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x53')]['belongsToMany'](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x185'),'as':_0xa7dc('0x186')});db[_0xa7dc('0x53')][_0xa7dc('0x11e')](db['Tag'],{'through':_0xa7dc('0x185'),'as':_0xa7dc('0x17d')});db[_0xa7dc('0x53')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Users','through':_0xa7dc('0x187'),'foreignKey':_0xa7dc('0x184')});db[_0xa7dc('0x54')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x13')});db[_0xa7dc('0x54')][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x16b')});db[_0xa7dc('0x54')]['belongsTo'](db[_0xa7dc('0x53')],{'onDelete':'cascade','as':_0xa7dc('0x17e'),'foreignKey':_0xa7dc('0x184')});db[_0xa7dc('0x54')][_0xa7dc('0x11b')](db['SmsAccount'],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x183')});db[_0xa7dc('0x55')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x37'),'foreignKey':_0xa7dc('0x188')});db[_0xa7dc('0x55')][_0xa7dc('0x11e')](db['Team'],{'through':_0xa7dc('0x189'),'as':_0xa7dc('0x151')});db[_0xa7dc('0x57')][_0xa7dc('0x10e')](db[_0xa7dc('0x78')],{'as':'Dispositions','foreignKey':_0xa7dc('0x18a'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x57')][_0xa7dc('0x10e')](db['CannedAnswer'],{'as':_0xa7dc('0x162'),'foreignKey':'OpenchannelAccountId'});db[_0xa7dc('0x57')][_0xa7dc('0x10e')](db['OpenchannelInteraction'],{'as':_0xa7dc('0x163'),'foreignKey':_0xa7dc('0x18a')});db[_0xa7dc('0x57')][_0xa7dc('0x10e')](db[_0xa7dc('0x5d')],{'as':_0xa7dc('0x156'),'foreignKey':_0xa7dc('0x18a')});db[_0xa7dc('0x57')]['hasMany'](db[_0xa7dc('0x59')],{'as':'Applications','foreignKey':_0xa7dc('0x18a')});db[_0xa7dc('0x57')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0x57')][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':_0xa7dc('0x168'),'foreignKey':_0xa7dc('0x169')});db[_0xa7dc('0x57')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Agents','through':_0xa7dc('0x139')});db[_0xa7dc('0x59')][_0xa7dc('0x11b')](db['User'],{'onDelete':'restrict'});db[_0xa7dc('0x59')][_0xa7dc('0x11b')](db[_0xa7dc('0x130')],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x18b')});db[_0xa7dc('0x59')][_0xa7dc('0x11b')](db[_0xa7dc('0x57')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xa7dc('0x59')][_0xa7dc('0x11b')](db[_0xa7dc('0x7b')],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x14e')});db[_0xa7dc('0x59')]['belongsTo'](db['Tag'],{'onDelete':_0xa7dc('0x15e'),'foreignKey':'TagId'});db['OpenchannelInteraction']['hasMany'](db[_0xa7dc('0x5d')],{'as':_0xa7dc('0x156'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x18c')});db['OpenchannelInteraction'][_0xa7dc('0x11b')](db['OpenchannelAccount'],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x18a')});db['OpenchannelInteraction'][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x15a')});db['OpenchannelInteraction'][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16c'),'foreignKey':'UserId'});db[_0xa7dc('0x5b')][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x18d'),'as':_0xa7dc('0x186')});db[_0xa7dc('0x5b')]['belongsToMany'](db[_0xa7dc('0x87')],{'through':'openchannel_interaction_has_tags','as':_0xa7dc('0x17d')});db[_0xa7dc('0x5b')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16e'),'through':'user_has_openchannel_interactions','foreignKey':_0xa7dc('0x18c')});db[_0xa7dc('0x5d')][_0xa7dc('0x11b')](db['User'],{'onDelete':_0xa7dc('0x10b'),'as':'User'});db[_0xa7dc('0x5d')][_0xa7dc('0x11b')](db['CmContact'],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x16b')});db[_0xa7dc('0x5d')][_0xa7dc('0x11b')](db['OpenchannelInteraction'],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x17e'),'foreignKey':_0xa7dc('0x18c')});db[_0xa7dc('0x5d')][_0xa7dc('0x11b')](db[_0xa7dc('0x17f')],{'as':'Attachment','foreignKey':_0xa7dc('0x180')});db[_0xa7dc('0x5d')][_0xa7dc('0x11b')](db[_0xa7dc('0x57')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xa7dc('0x130')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Agents','through':_0xa7dc('0x131'),'foreignKey':_0xa7dc('0x18b')});db[_0xa7dc('0x130')][_0xa7dc('0x11e')](db[_0xa7dc('0x123')],{'through':_0xa7dc('0x18e'),'as':'Teams'});db['ChatWebsite'][_0xa7dc('0x10e')](db['Disposition'],{'as':_0xa7dc('0x182'),'foreignKey':_0xa7dc('0x172'),'onDelete':_0xa7dc('0x10b')});db['ChatWebsite'][_0xa7dc('0x10e')](db[_0xa7dc('0x161')],{'as':_0xa7dc('0x162'),'foreignKey':'ChatWebsiteId'});db[_0xa7dc('0x60')][_0xa7dc('0x10e')](db[_0xa7dc('0x18f')],{'as':_0xa7dc('0x190')});db[_0xa7dc('0x60')][_0xa7dc('0x10e')](db[_0xa7dc('0x116')],{'as':_0xa7dc('0x163')});db[_0xa7dc('0x60')][_0xa7dc('0x10e')](db['ChatApplication'],{'as':_0xa7dc('0x164')});db[_0xa7dc('0x60')][_0xa7dc('0x10e')](db['ChatMessage'],{'as':'Messages'});db[_0xa7dc('0x60')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0x60')][_0xa7dc('0x11b')](db['Interval'],{'as':_0xa7dc('0x7b'),'foreignKey':_0xa7dc('0x14e')});db['ChatWebsite']['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xa7dc('0x60')][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':_0xa7dc('0x168'),'foreignKey':_0xa7dc('0x169')});db[_0xa7dc('0x60')][_0xa7dc('0x11e')](db['User'],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x134')});db['OpenchannelQueueReport'][_0xa7dc('0x11b')](db[_0xa7dc('0x57')],{});db[_0xa7dc('0x191')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':'ListId'});db[_0xa7dc('0x191')]['belongsTo'](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0x191')][_0xa7dc('0x11b')](db[_0xa7dc('0x5b')],{});db[_0xa7dc('0x191')][_0xa7dc('0x11b')](db[_0xa7dc('0x5d')],{});db['OpenchannelQueueReport'][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{});db[_0xa7dc('0x191')]['belongsTo'](db[_0xa7dc('0x130')],{});db[_0xa7dc('0x192')]['belongsTo'](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x193'),'foreignKey':_0xa7dc('0x10c'),'onDelete':_0xa7dc('0x15e')});db['ChatApplication'][_0xa7dc('0x11b')](db[_0xa7dc('0x67')],{'as':_0xa7dc('0x194'),'foreignKey':'ChatQueueId','onDelete':_0xa7dc('0x15e')});db['ChatApplication']['belongsTo'](db[_0xa7dc('0x60')],{'as':_0xa7dc('0x195'),'foreignKey':_0xa7dc('0x172'),'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x192')][_0xa7dc('0x11b')](db['Tag'],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x174')});db[_0xa7dc('0x116')][_0xa7dc('0x10e')](db['ChatMessage'],{'as':_0xa7dc('0x156'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0xa7dc('0x116')]['belongsTo'](db[_0xa7dc('0x60')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x172')});db[_0xa7dc('0x116')][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':'ContactId'});db['ChatInteraction'][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':'Owner','foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x116')][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xa7dc('0x116')]['belongsToMany'](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x196'),'as':_0xa7dc('0x17d')});db['ChatInteraction'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xa7dc('0x197')});db[_0xa7dc('0x198')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'onDelete':'cascade','as':_0xa7dc('0x13')});db[_0xa7dc('0x198')]['belongsTo'](db[_0xa7dc('0x6d')],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x16b'),'foreignKey':'ContactId'});db['ChatMessage'][_0xa7dc('0x11b')](db[_0xa7dc('0x116')],{'onDelete':'cascade','as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xa7dc('0x198')][_0xa7dc('0x11b')](db[_0xa7dc('0x17f')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xa7dc('0x198')][_0xa7dc('0x11b')](db[_0xa7dc('0x60')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x172')});db[_0xa7dc('0x65')][_0xa7dc('0x10e')](db['Attachment'],{'as':_0xa7dc('0x170'),'foreignKey':_0xa7dc('0x173'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db[_0xa7dc('0x65')]['belongsTo'](db[_0xa7dc('0x6d')],{'onDelete':_0xa7dc('0x10b'),'as':'Contact','foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0x65')][_0xa7dc('0x11b')](db['ChatWebsite'],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x172')});db['ChatQueue'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x32'),'hooks':!![]});db[_0xa7dc('0x67')]['belongsToMany'](db[_0xa7dc('0x123')],{'through':'team_has_chat_queues','as':_0xa7dc('0x151')});db[_0xa7dc('0x69')][_0xa7dc('0x10e')](db[_0xa7dc('0xcd')],{'as':'Messages','foreignKey':_0xa7dc('0x199'),'onDelete':'cascade'});db[_0xa7dc('0x69')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Members','through':_0xa7dc('0x120')});db[_0xa7dc('0x18f')][_0xa7dc('0x11b')](db['ChatWebsite'],{'as':_0xa7dc('0x195'),'foreignKey':_0xa7dc('0x172')});db['CmCompany'][_0xa7dc('0x10e')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x19a'),'foreignKey':_0xa7dc('0x19b')});db['CmContact'][_0xa7dc('0x10e')](db[_0xa7dc('0x8a')],{'as':'Phones','foreignKey':'CmContactId'});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db[_0xa7dc('0x6e')],{'as':'Hoppers','foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db[_0xa7dc('0x113')],{'as':_0xa7dc('0x114'),'foreignKey':_0xa7dc('0x15a')});db['CmContact'][_0xa7dc('0x10e')](db[_0xa7dc('0x71')],{'as':_0xa7dc('0x145'),'foreignKey':'ContactId'});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db['ReportAgentPreview'],{'as':_0xa7dc('0x72'),'foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db[_0xa7dc('0x148')],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0xa7dc('0x5b')],{'as':_0xa7dc('0x115'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db[_0xa7dc('0x116')],{'as':_0xa7dc('0x19c'),'foreignKey':_0xa7dc('0x15a'),'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db[_0xa7dc('0x53')],{'as':_0xa7dc('0x117'),'foreignKey':'ContactId','onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x6d')][_0xa7dc('0x10e')](db[_0xa7dc('0x4b')],{'as':_0xa7dc('0x118'),'foreignKey':_0xa7dc('0x15a'),'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x6d')]['hasMany'](db[_0xa7dc('0x42')],{'as':_0xa7dc('0x119'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa7dc('0x6d')][_0xa7dc('0x11b')](db['CmCompany'],{'as':_0xa7dc('0x19d'),'foreignKey':_0xa7dc('0x19b')});db[_0xa7dc('0x6d')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166'),'onDelete':'cascade'});db[_0xa7dc('0x6d')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16e'),'through':_0xa7dc('0x121')});db['CmContact'][_0xa7dc('0x11e')](db['Tag'],{'as':'Tags','through':_0xa7dc('0x19e')});db['CmContact'][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x19e'),'as':_0xa7dc('0x17d')});db[_0xa7dc('0x6e')][_0xa7dc('0x10e')](db[_0xa7dc('0x8c')],{'as':'AdditionalPhones','foreignKey':_0xa7dc('0x19f')});db['CmHopper'][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x15a'),'onDelete':_0xa7dc('0x10b')});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x6e')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x193'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0x6e')][_0xa7dc('0x11b')](db[_0xa7dc('0x1d')],{'as':'Queue','foreignKey':_0xa7dc('0x143'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x6e')]['belongsTo'](db['Campaign'],{'as':_0xa7dc('0xe2'),'foreignKey':_0xa7dc('0x1a0'),'onDelete':'cascade'});db[_0xa7dc('0x6e')]['belongsTo'](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16c'),'foreignKey':_0xa7dc('0x1a1')});db[_0xa7dc('0x146')][_0xa7dc('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0xa7dc('0x15a'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x146')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':'List','foreignKey':_0xa7dc('0x166'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x146')]['belongsTo'](db[_0xa7dc('0x1d')],{'as':'Queue','foreignKey':_0xa7dc('0x143'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x146')][_0xa7dc('0x11b')](db[_0xa7dc('0xe2')],{'as':_0xa7dc('0xe2'),'foreignKey':_0xa7dc('0x1a0'),'onDelete':'cascade'});db[_0xa7dc('0x1a2')][_0xa7dc('0x10e')](db[_0xa7dc('0x1a3')],{'as':{'plural':_0xa7dc('0x1a4'),'singular':_0xa7dc('0x1a5')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db['Automation'][_0xa7dc('0x10e')](db['Condition'],{'as':{'plural':_0xa7dc('0x1a6'),'singular':_0xa7dc('0x1a7')},'foreignKey':_0xa7dc('0x1a8'),'onDelete':'cascade','hooks':!![]});db[_0xa7dc('0x1a2')][_0xa7dc('0x10e')](db[_0xa7dc('0x74')],{'as':_0xa7dc('0x1a9'),'foreignKey':_0xa7dc('0x1aa'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db[_0xa7dc('0x78')][_0xa7dc('0x10e')](db[_0xa7dc('0x78')],{'as':_0xa7dc('0x182'),'foreignKey':_0xa7dc('0x1ab'),'onDelete':'cascade'});db[_0xa7dc('0x7b')][_0xa7dc('0x10e')](db[_0xa7dc('0x7b')],{'as':'Intervals','foreignKey':_0xa7dc('0x14e'),'onDelete':_0xa7dc('0x10b'),'hooks':!![],'required':![]});db[_0xa7dc('0x7b')][_0xa7dc('0x10e')](db[_0xa7dc('0x111')],{'as':_0xa7dc('0x112'),'foreignKey':'IntervalId','onDelete':_0xa7dc('0x15e')});db['Interval'][_0xa7dc('0x10e')](db[_0xa7dc('0x45')],{'as':_0xa7dc('0x1ac'),'foreignKey':'IntervalId'});db[_0xa7dc('0x7b')][_0xa7dc('0x10e')](db['ChatApplication'],{'as':_0xa7dc('0x1ad'),'foreignKey':_0xa7dc('0x14e')});db[_0xa7dc('0x7b')][_0xa7dc('0x10e')](db[_0xa7dc('0x4a')],{'as':_0xa7dc('0x1ae'),'foreignKey':_0xa7dc('0x14e')});db[_0xa7dc('0x7b')]['hasMany'](db[_0xa7dc('0x52')],{'as':_0xa7dc('0x1af'),'foreignKey':_0xa7dc('0x14e')});db['Schedule'][_0xa7dc('0x11b')](db[_0xa7dc('0x3d')],{});db['Schedule'][_0xa7dc('0x11b')](db[_0xa7dc('0x97')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xa7dc('0x11b')](db[_0xa7dc('0x1b0')],{'foreignKey':'CustomReportId'});db['Sound'][_0xa7dc('0x11e')](db[_0xa7dc('0x1b')],{'as':_0xa7dc('0x1b1'),'through':_0xa7dc('0x140'),'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x87')][_0xa7dc('0x11e')](db[_0xa7dc('0x6d')],{'through':_0xa7dc('0x19e')});db['Tag'][_0xa7dc('0x11e')](db[_0xa7dc('0x116')],{'through':_0xa7dc('0x196')});db[_0xa7dc('0x87')]['belongsToMany'](db['MailInteraction'],{'through':_0xa7dc('0x16d')});db[_0xa7dc('0x87')][_0xa7dc('0x11e')](db['SmsInteraction'],{'through':_0xa7dc('0x185')});db[_0xa7dc('0x87')][_0xa7dc('0x11e')](db[_0xa7dc('0x4b')],{'through':_0xa7dc('0x17c')});db[_0xa7dc('0x87')][_0xa7dc('0x11e')](db['OpenchannelInteraction'],{'through':_0xa7dc('0x18d')});db['Tag'][_0xa7dc('0x11e')](db[_0xa7dc('0xfc')],{'through':_0xa7dc('0x1b2')});db[_0xa7dc('0x8a')][_0xa7dc('0x11b')](db[_0xa7dc('0x88')],{'as':_0xa7dc('0x1b3'),'foreignKey':_0xa7dc('0x1b4')});db[_0xa7dc('0x8c')][_0xa7dc('0x11b')](db[_0xa7dc('0x6e')],{'as':_0xa7dc('0x1b5'),'foreignKey':'CmHopperId'});db[_0xa7dc('0x8a')][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x1b6')});db[_0xa7dc('0x90')][_0xa7dc('0x10e')](db['Condition'],{'as':{'plural':_0xa7dc('0x1b7'),'singular':_0xa7dc('0x1b8')},'foreignKey':_0xa7dc('0x1b9'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db[_0xa7dc('0x90')]['hasMany'](db[_0xa7dc('0x1a3')],{'as':{'plural':_0xa7dc('0x1ba'),'singular':_0xa7dc('0x1bb')},'foreignKey':_0xa7dc('0x1bc'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db[_0xa7dc('0x90')][_0xa7dc('0x10e')](db[_0xa7dc('0x74')],{'as':'Actions','foreignKey':_0xa7dc('0x1bd'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db['AnalyticCustomReport'][_0xa7dc('0x10e')](db[_0xa7dc('0x1be')],{'as':'Fields','onDelete':_0xa7dc('0x10b'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xa7dc('0x97')][_0xa7dc('0x10e')](db[_0xa7dc('0x1be')],{'as':'Fields','onDelete':_0xa7dc('0x10b'),'foreignKey':'DefaultReportId'});db[_0xa7dc('0x1bf')][_0xa7dc('0x10e')](db[_0xa7dc('0x1be')],{'as':_0xa7dc('0x1c0'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c1')});db[_0xa7dc('0x1be')][_0xa7dc('0x11b')](db[_0xa7dc('0x1bf')],{'foreignKey':'MetricId'});db[_0xa7dc('0x9c')][_0xa7dc('0x10e')](db[_0xa7dc('0x9e')],{'as':_0xa7dc('0x1c2'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0x9e')]['hasMany'](db[_0xa7dc('0xa0')],{'as':_0xa7dc('0x1c4'),'onDelete':_0xa7dc('0x10b'),'foreignKey':'SubjectId'});db[_0xa7dc('0x9e')]['hasMany'](db[_0xa7dc('0xa0')],{'as':_0xa7dc('0x1c5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xa7dc('0x9e')][_0xa7dc('0x10e')](db[_0xa7dc('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xa7dc('0x1c6')});db['SalesforceConfiguration']['belongsTo'](db[_0xa7dc('0x9c')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0xa0')][_0xa7dc('0x10e')](db[_0xa7dc('0xa0')],{'as':_0xa7dc('0x1c7'),'foreignKey':_0xa7dc('0x1c8')});db['SalesforceField'][_0xa7dc('0x10e')](db[_0xa7dc('0xa0')],{'as':_0xa7dc('0x1c9'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xa0')][_0xa7dc('0x10e')](db[_0xa7dc('0xa0')],{'as':'Field','foreignKey':_0xa7dc('0x1c6')});db['SalesforceField'][_0xa7dc('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xa7dc('0x1cb')});db[_0xa7dc('0xa1')][_0xa7dc('0x10e')](db[_0xa7dc('0xa3')],{'as':_0xa7dc('0x1c2'),'onDelete':'cascade','foreignKey':_0xa7dc('0x1c3')});db['SugarcrmConfiguration'][_0xa7dc('0x10e')](db[_0xa7dc('0xa5')],{'as':_0xa7dc('0x1c4'),'onDelete':_0xa7dc('0x10b'),'foreignKey':'SubjectId'});db[_0xa7dc('0xa3')][_0xa7dc('0x10e')](db[_0xa7dc('0xa5')],{'as':_0xa7dc('0x1c5'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xa3')][_0xa7dc('0x10e')](db[_0xa7dc('0xa5')],{'as':_0xa7dc('0x1c0'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0xa3')][_0xa7dc('0x11b')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xa7dc('0x1c3')});db['SugarcrmField'][_0xa7dc('0x10e')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0xa7dc('0x1c8')});db['SugarcrmField'][_0xa7dc('0x10e')](db[_0xa7dc('0xa5')],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0xa7dc('0x10e')](db[_0xa7dc('0xa5')],{'as':_0xa7dc('0x1cc'),'foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0xa5')][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':_0xa7dc('0x1cb')});db[_0xa7dc('0xa6')][_0xa7dc('0x10e')](db[_0xa7dc('0xa8')],{'as':'Configurations','onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c3')});db['DeskConfiguration']['hasMany'](db[_0xa7dc('0xaa')],{'as':_0xa7dc('0x1c4'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xa8')][_0xa7dc('0x10e')](db[_0xa7dc('0xaa')],{'as':_0xa7dc('0x1c5'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xa8')]['hasMany'](db[_0xa7dc('0xaa')],{'as':'Fields','onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c6')});db['DeskConfiguration'][_0xa7dc('0x11b')](db[_0xa7dc('0xa6')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0xa8')]['belongsToMany'](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x1cd')});db['DeskField'][_0xa7dc('0x10e')](db['DeskField'],{'as':'Subject','foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xaa')][_0xa7dc('0x10e')](db[_0xa7dc('0xaa')],{'as':'Description','foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xaa')][_0xa7dc('0x10e')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0xa7dc('0xaa')][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':'VariableId'});db['ZohoAccount']['hasMany'](db[_0xa7dc('0xae')],{'as':'Configurations','onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0xae')]['hasMany'](db[_0xa7dc('0x1ce')],{'as':_0xa7dc('0x1c4'),'onDelete':'cascade','foreignKey':_0xa7dc('0x1c8')});db['ZohoConfiguration'][_0xa7dc('0x10e')](db[_0xa7dc('0x1ce')],{'as':_0xa7dc('0x1c5'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xae')][_0xa7dc('0x10e')](db[_0xa7dc('0x1ce')],{'as':_0xa7dc('0x1c0'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c6')});db['ZohoConfiguration'][_0xa7dc('0x11b')](db[_0xa7dc('0xac')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0x1ce')]['hasMany'](db[_0xa7dc('0x1ce')],{'as':_0xa7dc('0x1c7'),'foreignKey':_0xa7dc('0x1c8')});db['ZohoField'][_0xa7dc('0x10e')](db[_0xa7dc('0x1ce')],{'as':_0xa7dc('0x1c9'),'foreignKey':'DescriptionId'});db[_0xa7dc('0x1ce')]['hasMany'](db[_0xa7dc('0x1ce')],{'as':_0xa7dc('0x1cc'),'foreignKey':_0xa7dc('0x1c6')});db['ZohoField'][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa7dc('0xaf')]['hasMany'](db[_0xa7dc('0x1cf')],{'as':_0xa7dc('0x1c2'),'onDelete':'cascade','foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0x1cf')][_0xa7dc('0x10e')](db[_0xa7dc('0x1d0')],{'as':_0xa7dc('0x1c4'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0x1cf')]['hasMany'](db['ZendeskField'],{'as':_0xa7dc('0x1c5'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0x1cf')][_0xa7dc('0x10e')](db[_0xa7dc('0x1d0')],{'as':_0xa7dc('0x1c0'),'foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0x1cf')][_0xa7dc('0x11b')](db[_0xa7dc('0xaf')],{'as':'Account','foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0x1cf')][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':'int_zendesk_configuration_has_tags'});db[_0xa7dc('0x1d0')]['hasMany'](db[_0xa7dc('0x1d0')],{'as':_0xa7dc('0x1c7'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0x1d0')][_0xa7dc('0x10e')](db[_0xa7dc('0x1d0')],{'as':_0xa7dc('0x1c9'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0xa7dc('0x1d0')],{'as':_0xa7dc('0x1cc'),'foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0x1d0')][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0xa7dc('0x10e')](db[_0xa7dc('0x1d1')],{'as':'Configurations','onDelete':_0xa7dc('0x10b'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xa7dc('0x10e')](db[_0xa7dc('0xb6')],{'as':_0xa7dc('0x1c4'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0x1d1')]['hasMany'](db[_0xa7dc('0xb6')],{'as':_0xa7dc('0x1c5'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0x1d1')][_0xa7dc('0x10e')](db[_0xa7dc('0xb6')],{'as':_0xa7dc('0x1c0'),'onDelete':'cascade','foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0x1d1')][_0xa7dc('0x11b')](db[_0xa7dc('0xb3')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0x1d1')][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x1d2')});db[_0xa7dc('0xb6')]['hasMany'](db[_0xa7dc('0xb6')],{'as':_0xa7dc('0x1c7'),'foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0xa7dc('0xb6')],{'as':'Description','foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xb6')][_0xa7dc('0x10e')](db[_0xa7dc('0xb6')],{'as':_0xa7dc('0x1cc'),'foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0xb6')][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':_0xa7dc('0x1cb')});db[_0xa7dc('0xb7')][_0xa7dc('0x10e')](db['VtigerConfiguration'],{'as':_0xa7dc('0x1c2'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0xb9')][_0xa7dc('0x10e')](db[_0xa7dc('0xbb')],{'as':_0xa7dc('0x1c4'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xb9')]['hasMany'](db[_0xa7dc('0xbb')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xa7dc('0xb9')][_0xa7dc('0x10e')](db[_0xa7dc('0xbb')],{'as':_0xa7dc('0x1c0'),'foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0xb9')][_0xa7dc('0x11b')](db[_0xa7dc('0xb7')],{'as':'Account','foreignKey':'AccountId'});db[_0xa7dc('0xbb')]['hasMany'](db[_0xa7dc('0xbb')],{'as':_0xa7dc('0x1c7'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xbb')][_0xa7dc('0x10e')](db[_0xa7dc('0xbb')],{'as':_0xa7dc('0x1c9'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xbb')][_0xa7dc('0x10e')](db[_0xa7dc('0xbb')],{'as':_0xa7dc('0x1cc'),'foreignKey':'FieldId'});db[_0xa7dc('0xbb')][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':'VariableId'});db[_0xa7dc('0x1d3')][_0xa7dc('0x10e')](db[_0xa7dc('0xbe')],{'as':_0xa7dc('0x1c2'),'onDelete':_0xa7dc('0x10b'),'foreignKey':'AccountId'});db[_0xa7dc('0xbe')][_0xa7dc('0x10e')](db[_0xa7dc('0xbf')],{'as':_0xa7dc('0x1c4'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xbe')]['hasMany'](db[_0xa7dc('0xbf')],{'as':_0xa7dc('0x1c5'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xbe')][_0xa7dc('0x10e')](db[_0xa7dc('0xbf')],{'as':'Fields','foreignKey':'FieldId'});db[_0xa7dc('0xbe')][_0xa7dc('0x11b')](db[_0xa7dc('0x1d3')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0xa7dc('0x10e')](db[_0xa7dc('0xbf')],{'as':_0xa7dc('0x1c7'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xbf')][_0xa7dc('0x10e')](db[_0xa7dc('0xbf')],{'as':_0xa7dc('0x1c9'),'foreignKey':'DescriptionId'});db[_0xa7dc('0xbf')][_0xa7dc('0x10e')](db[_0xa7dc('0xbf')],{'as':_0xa7dc('0x1cc'),'foreignKey':'FieldId'});db[_0xa7dc('0xbf')]['belongsTo'](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':_0xa7dc('0x1cb')});db[_0xa7dc('0x1d4')][_0xa7dc('0x10e')](db[_0xa7dc('0xc2')],{'as':_0xa7dc('0x1c2'),'onDelete':'cascade','foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0x1d4')][_0xa7dc('0x11b')](db[_0xa7dc('0x103')],{'as':_0xa7dc('0x103'),'foreignKey':_0xa7dc('0x15d')});db[_0xa7dc('0xc2')]['hasMany'](db[_0xa7dc('0xc3')],{'as':'Subjects','onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xc2')][_0xa7dc('0x10e')](db[_0xa7dc('0xc3')],{'as':_0xa7dc('0x1c5'),'onDelete':'cascade','foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xc2')]['hasMany'](db[_0xa7dc('0xc3')],{'as':_0xa7dc('0x1c0'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c6')});db['Dynamics365Configuration'][_0xa7dc('0x11b')](db[_0xa7dc('0x1d4')],{'as':'Account','foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0xc3')][_0xa7dc('0x10e')](db[_0xa7dc('0xc3')],{'as':_0xa7dc('0x1c7'),'foreignKey':'SubjectId'});db[_0xa7dc('0xc3')][_0xa7dc('0x10e')](db['Dynamics365Field'],{'as':_0xa7dc('0x1c9'),'foreignKey':_0xa7dc('0x1ca')});db['Dynamics365Field'][_0xa7dc('0x10e')](db[_0xa7dc('0xc3')],{'as':_0xa7dc('0x1cc'),'foreignKey':'FieldId'});db[_0xa7dc('0xc3')][_0xa7dc('0x11b')](db[_0xa7dc('0x92')],{'as':_0xa7dc('0x92'),'foreignKey':'VariableId'});db[_0xa7dc('0xc4')][_0xa7dc('0x10e')](db[_0xa7dc('0xc5')],{'as':_0xa7dc('0x1c2'),'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1c3')});db[_0xa7dc('0xc5')][_0xa7dc('0x10e')](db[_0xa7dc('0xc7')],{'as':_0xa7dc('0x1c4'),'foreignKey':_0xa7dc('0x1c8')});db['FreshsalesConfiguration'][_0xa7dc('0x10e')](db['FreshsalesField'],{'as':_0xa7dc('0x1c5'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xc5')][_0xa7dc('0x10e')](db[_0xa7dc('0xc7')],{'as':'Fields','foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0xc5')][_0xa7dc('0x11b')](db[_0xa7dc('0xc4')],{'as':_0xa7dc('0x171'),'foreignKey':'AccountId'});db[_0xa7dc('0xc7')]['hasMany'](db[_0xa7dc('0xc7')],{'as':_0xa7dc('0x1c7'),'foreignKey':_0xa7dc('0x1c8')});db[_0xa7dc('0xc7')][_0xa7dc('0x10e')](db['FreshsalesField'],{'as':_0xa7dc('0x1c9'),'foreignKey':_0xa7dc('0x1ca')});db[_0xa7dc('0xc7')]['hasMany'](db['FreshsalesField'],{'as':'Field','foreignKey':_0xa7dc('0x1c6')});db[_0xa7dc('0xc7')][_0xa7dc('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xa7dc('0x1cb')});db[_0xa7dc('0xcb')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0xa7dc('0x11b')](db['CmList'],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0xcb')]['belongsTo'](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':'ContactId'});db[_0xa7dc('0xcb')]['belongsTo'](db[_0xa7dc('0x116')],{});db[_0xa7dc('0xcb')][_0xa7dc('0x11b')](db[_0xa7dc('0x198')],{});db[_0xa7dc('0xcb')][_0xa7dc('0x11b')](db['User'],{});db[_0xa7dc('0xcb')][_0xa7dc('0x11b')](db[_0xa7dc('0x67')],{});db[_0xa7dc('0xcd')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1d5')});db['ChatInternalMessage']['belongsTo'](db[_0xa7dc('0x13')],{'onDelete':_0xa7dc('0x10b'),'foreignKey':_0xa7dc('0x1d6')});db[_0xa7dc('0x148')][_0xa7dc('0x10e')](db[_0xa7dc('0xd0')],{'foreignKey':_0xa7dc('0x1d7'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x148')][_0xa7dc('0x10e')](db[_0xa7dc('0x1d8')],{'foreignKey':'SessionId','onDelete':_0xa7dc('0x10b')});db['SmsQueueReport'][_0xa7dc('0x11b')](db['SmsAccount'],{});db[_0xa7dc('0xd2')][_0xa7dc('0x11b')](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':'ListId'});db[_0xa7dc('0xd2')][_0xa7dc('0x11b')](db['CmContact'],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0xd2')][_0xa7dc('0x11b')](db[_0xa7dc('0x53')],{});db[_0xa7dc('0xd2')][_0xa7dc('0x11b')](db[_0xa7dc('0x54')],{});db[_0xa7dc('0xd2')][_0xa7dc('0x11b')](db['User'],{});db[_0xa7dc('0xd2')]['belongsTo'](db[_0xa7dc('0x55')],{});db[_0xa7dc('0xd6')][_0xa7dc('0x10e')](db[_0xa7dc('0x148')],{'foreignKey':_0xa7dc('0x1d9')});db['JscriptyProject']['hasMany'](db[_0xa7dc('0xd0')],{'foreignKey':_0xa7dc('0x1d9')});db[_0xa7dc('0xd6')][_0xa7dc('0x10e')](db[_0xa7dc('0x1d8')],{'foreignKey':_0xa7dc('0x1d9')});db['Team']['belongsToMany'](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':'user_has_teams'});db['Team'][_0xa7dc('0x11e')](db[_0xa7dc('0x1d')],{'through':_0xa7dc('0x152'),'as':_0xa7dc('0x129')});db[_0xa7dc('0x123')]['belongsToMany'](db[_0xa7dc('0x3f')],{'through':_0xa7dc('0x16a'),'as':_0xa7dc('0x12b')});db[_0xa7dc('0x123')][_0xa7dc('0x11e')](db[_0xa7dc('0x67')],{'through':_0xa7dc('0x1da'),'as':_0xa7dc('0x1db')});db['Team']['belongsToMany'](db[_0xa7dc('0x12c')],{'through':_0xa7dc('0x181'),'as':_0xa7dc('0x12d')});db[_0xa7dc('0x123')]['belongsToMany'](db[_0xa7dc('0x55')],{'through':_0xa7dc('0x189'),'as':_0xa7dc('0x12f')});db[_0xa7dc('0x123')]['belongsToMany'](db[_0xa7dc('0x130')],{'through':_0xa7dc('0x18e'),'as':_0xa7dc('0x1dc')});db[_0xa7dc('0x123')][_0xa7dc('0x11e')](db['WhatsappQueue'],{'through':_0xa7dc('0x1dd'),'as':_0xa7dc('0x1de')});db[_0xa7dc('0x123')][_0xa7dc('0x11e')](db[_0xa7dc('0x1df')],{'through':_0xa7dc('0x104'),'as':_0xa7dc('0x12a')});db[_0xa7dc('0xe2')][_0xa7dc('0x10e')](db[_0xa7dc('0x6e')],{'as':_0xa7dc('0x144'),'foreignKey':_0xa7dc('0x1a0')});db[_0xa7dc('0xe2')][_0xa7dc('0x10e')](db['CmHopperFinal'],{'as':_0xa7dc('0x114'),'foreignKey':_0xa7dc('0x1a0')});db[_0xa7dc('0xe2')][_0xa7dc('0x10e')](db[_0xa7dc('0x71')],{'as':_0xa7dc('0x145'),'foreignKey':'CampaignId'});db[_0xa7dc('0xe2')]['hasMany'](db[_0xa7dc('0x146')],{'as':_0xa7dc('0x147'),'foreignKey':_0xa7dc('0x1a0')});db['Campaign'][_0xa7dc('0x11b')](db['Trunk'],{'as':_0xa7dc('0x14a'),'foreignKey':'TrunkId'});db[_0xa7dc('0xe2')][_0xa7dc('0x11b')](db[_0xa7dc('0x14a')],{'as':'TrunkBackup','foreignKey':_0xa7dc('0x14d')});db[_0xa7dc('0xe2')][_0xa7dc('0x11b')](db[_0xa7dc('0x7b')],{'as':_0xa7dc('0x7b'),'foreignKey':_0xa7dc('0x14e')});db[_0xa7dc('0xe2')]['belongsTo'](db['SquareProject'],{'as':_0xa7dc('0xdb'),'foreignKey':'SquareProjectId'});db[_0xa7dc('0xe2')][_0xa7dc('0x11e')](db[_0xa7dc('0xf1')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xa7dc('0xe2')]['belongsToMany'](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x153'),'through':_0xa7dc('0x1e0')});db[_0xa7dc('0x17f')][_0xa7dc('0x11b')](db['ChatOfflineMessage'],{'as':_0xa7dc('0x65'),'foreignKey':_0xa7dc('0x173')});db[_0xa7dc('0xe8')][_0xa7dc('0x11b')](db['MailMessage'],{});db[_0xa7dc('0xe8')]['belongsTo'](db[_0xa7dc('0x42')],{});db[_0xa7dc('0xe8')][_0xa7dc('0x11b')](db[_0xa7dc('0x3d')],{'foreignKey':_0xa7dc('0x1e1'),'as':_0xa7dc('0x1e2')});db[_0xa7dc('0xe8')]['belongsTo'](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e3'),'as':_0xa7dc('0x1e4')});db[_0xa7dc('0xe8')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':_0xa7dc('0x1e5'),'as':'ToQueue'});db[_0xa7dc('0xe8')][_0xa7dc('0x11b')](db['MailAccount'],{'foreignKey':_0xa7dc('0x1e6'),'as':_0xa7dc('0x1e7')});db[_0xa7dc('0xea')]['belongsTo'](db[_0xa7dc('0x198')],{});db['ChatTransferReport'][_0xa7dc('0x11b')](db[_0xa7dc('0x116')],{});db[_0xa7dc('0xea')]['belongsTo'](db[_0xa7dc('0x60')],{'foreignKey':_0xa7dc('0x1e8'),'as':_0xa7dc('0x1e2')});db[_0xa7dc('0xea')]['belongsTo'](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e3'),'as':_0xa7dc('0x1e4')});db[_0xa7dc('0xea')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e9'),'as':_0xa7dc('0x1ea')});db[_0xa7dc('0xea')]['belongsTo'](db[_0xa7dc('0x67')],{'foreignKey':_0xa7dc('0x1eb'),'as':_0xa7dc('0x1ec')});db[_0xa7dc('0xea')][_0xa7dc('0x11b')](db[_0xa7dc('0x60')],{'foreignKey':_0xa7dc('0x1ed'),'as':_0xa7dc('0x1e7')});db['FaxTransferReport'][_0xa7dc('0x11b')](db['FaxMessage'],{});db['FaxTransferReport'][_0xa7dc('0x11b')](db['FaxInteraction'],{});db[_0xa7dc('0xec')]['belongsTo'](db[_0xa7dc('0x135')],{'foreignKey':_0xa7dc('0x1ee'),'as':_0xa7dc('0x1e2')});db[_0xa7dc('0xec')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e3'),'as':_0xa7dc('0x1e4')});db[_0xa7dc('0xec')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e9'),'as':_0xa7dc('0x1ea')});db[_0xa7dc('0xec')][_0xa7dc('0x11b')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0xa7dc('0xec')][_0xa7dc('0x11b')](db[_0xa7dc('0x135')],{'foreignKey':_0xa7dc('0x1ef'),'as':_0xa7dc('0x1e7')});db[_0xa7dc('0x1f0')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xa7dc('0x1f0')][_0xa7dc('0x11b')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xa7dc('0x11b')](db['OpenchannelAccount'],{'foreignKey':_0xa7dc('0x1f1'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e3'),'as':'FromAgent'});db[_0xa7dc('0x1f0')]['belongsTo'](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e9'),'as':_0xa7dc('0x1ea')});db['OpenchannelTransferReport']['belongsTo'](db[_0xa7dc('0x130')],{'foreignKey':_0xa7dc('0x1f2'),'as':_0xa7dc('0x1ec')});db[_0xa7dc('0x1f0')][_0xa7dc('0x11b')](db[_0xa7dc('0x57')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xa7dc('0x11b')](db[_0xa7dc('0x54')],{});db[_0xa7dc('0xef')]['belongsTo'](db['SmsInteraction'],{});db[_0xa7dc('0xef')][_0xa7dc('0x11b')](db[_0xa7dc('0x50')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport'][_0xa7dc('0x11b')](db['User'],{'foreignKey':'FromUserId','as':_0xa7dc('0x1e4')});db[_0xa7dc('0xef')][_0xa7dc('0x11b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db[_0xa7dc('0x55')],{'foreignKey':'ToSmsQueueId','as':_0xa7dc('0x1ec')});db[_0xa7dc('0xef')]['belongsTo'](db[_0xa7dc('0x50')],{'foreignKey':_0xa7dc('0x1f3'),'as':'ToAccount'});db['CmList'][_0xa7dc('0x10e')](db[_0xa7dc('0x78')],{'as':_0xa7dc('0x182'),'foreignKey':_0xa7dc('0x166'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0xf1')]['hasMany'](db[_0xa7dc('0x73')],{'as':_0xa7dc('0x1f4'),'foreignKey':'ListId'});db[_0xa7dc('0xf1')][_0xa7dc('0x10e')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x19a'),'onDelete':'cascade','foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0xf1')][_0xa7dc('0x10e')](db[_0xa7dc('0x113')],{'as':'HopperFinals','foreignKey':'ListId'});db['CmList'][_0xa7dc('0x10e')](db['CmHopperHistory'],{'as':_0xa7dc('0x1f5'),'foreignKey':'ListId'});db['CmList'][_0xa7dc('0x10e')](db[_0xa7dc('0x72')],{'as':'ReportAgentPreview','foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0xf1')][_0xa7dc('0x11e')](db[_0xa7dc('0x1d')],{'as':_0xa7dc('0x1f6'),'through':_0xa7dc('0x14f')});db['CmList'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':'Agents','through':_0xa7dc('0x132')});db['VoicePrefix'][_0xa7dc('0x10e')](db[_0xa7dc('0x111')],{'as':_0xa7dc('0x112'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0x1df')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x106')});db[_0xa7dc('0x1df')][_0xa7dc('0x11e')](db['Team'],{'through':'TeamVoicePrefix','as':_0xa7dc('0x151')});db[_0xa7dc('0x11c')][_0xa7dc('0x10e')](db[_0xa7dc('0x13')],{'as':'Users','foreignKey':'userProfileId'});db[_0xa7dc('0x11c')][_0xa7dc('0x10e')](db[_0xa7dc('0xf4')],{'as':_0xa7dc('0x1f7'),'foreignKey':_0xa7dc('0x11d'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0xf4')][_0xa7dc('0x10e')](db[_0xa7dc('0x1f8')],{'as':_0xa7dc('0x1f9'),'foreignKey':_0xa7dc('0x1fa'),'onDelete':_0xa7dc('0x10b')});db['WhatsappAccount']['hasMany'](db[_0xa7dc('0x78')],{'as':_0xa7dc('0x182'),'foreignKey':_0xa7dc('0x1fb'),'onDelete':_0xa7dc('0x10b')});db[_0xa7dc('0xf9')][_0xa7dc('0x10e')](db['CannedAnswer'],{'as':_0xa7dc('0x162'),'foreignKey':_0xa7dc('0x1fb')});db[_0xa7dc('0xf9')][_0xa7dc('0x10e')](db['WhatsappMessage'],{'as':_0xa7dc('0x156'),'foreignKey':'WhatsappAccountId'});db[_0xa7dc('0xf9')][_0xa7dc('0x10e')](db[_0xa7dc('0xfc')],{'as':_0xa7dc('0x163')});db['WhatsappAccount']['hasMany'](db[_0xa7dc('0xfa')],{'as':_0xa7dc('0x164')});db['WhatsappAccount'][_0xa7dc('0x11b')](db['CmList'],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db[_0xa7dc('0xf9')][_0xa7dc('0x11b')](db[_0xa7dc('0x7d')],{'as':_0xa7dc('0x168'),'foreignKey':_0xa7dc('0x169')});db[_0xa7dc('0xf9')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':'user_has_whatsapp_accounts'});db[_0xa7dc('0xfa')]['belongsTo'](db[_0xa7dc('0x13')],{'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0xfa')][_0xa7dc('0x11b')](db[_0xa7dc('0x101')],{'onDelete':_0xa7dc('0x15e')});db['WhatsappApplication'][_0xa7dc('0x11b')](db[_0xa7dc('0xf9')],{'onDelete':'restrict'});db[_0xa7dc('0xfa')][_0xa7dc('0x11b')](db[_0xa7dc('0x7b')],{'onDelete':_0xa7dc('0x15e'),'foreignKey':_0xa7dc('0x14e')});db['WhatsappApplication'][_0xa7dc('0x11b')](db['Tag'],{'onDelete':_0xa7dc('0x15e'),'foreignKey':'TagId'});db[_0xa7dc('0xfc')][_0xa7dc('0x10e')](db[_0xa7dc('0xfd')],{'as':_0xa7dc('0x156'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0xa7dc('0x11b')](db[_0xa7dc('0xf9')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x1fb')});db['WhatsappInteraction'][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x15a')});db[_0xa7dc('0xfc')][_0xa7dc('0x11b')](db['User'],{'as':_0xa7dc('0x16c'),'foreignKey':_0xa7dc('0x10c')});db[_0xa7dc('0xfc')][_0xa7dc('0x11e')](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x1b2'),'as':_0xa7dc('0x186')});db[_0xa7dc('0xfc')]['belongsToMany'](db[_0xa7dc('0x87')],{'through':_0xa7dc('0x1b2'),'as':_0xa7dc('0x17d')});db[_0xa7dc('0xfc')][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x16e'),'through':_0xa7dc('0x128'),'foreignKey':_0xa7dc('0x1fc')});db[_0xa7dc('0xfd')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x13')});db['WhatsappMessage'][_0xa7dc('0x11b')](db[_0xa7dc('0x6d')],{'onDelete':'cascade','as':_0xa7dc('0x16b')});db[_0xa7dc('0xfd')][_0xa7dc('0x11b')](db[_0xa7dc('0xfc')],{'onDelete':_0xa7dc('0x10b'),'as':_0xa7dc('0x17e'),'foreignKey':_0xa7dc('0x1fc')});db[_0xa7dc('0xfd')][_0xa7dc('0x11b')](db[_0xa7dc('0xf9')],{'as':_0xa7dc('0x171'),'foreignKey':_0xa7dc('0x1fb')});db['WhatsappQueueReport']['belongsTo'](db[_0xa7dc('0xf9')],{});db[_0xa7dc('0xfe')]['belongsTo'](db[_0xa7dc('0xf1')],{'as':_0xa7dc('0x165'),'foreignKey':_0xa7dc('0x166')});db['WhatsappQueueReport']['belongsTo'](db[_0xa7dc('0x6d')],{'as':_0xa7dc('0x16b'),'foreignKey':_0xa7dc('0x15a')});db['WhatsappQueueReport']['belongsTo'](db[_0xa7dc('0xfc')],{});db[_0xa7dc('0xfe')][_0xa7dc('0x11b')](db[_0xa7dc('0x101')],{});db[_0xa7dc('0xfe')][_0xa7dc('0x11b')](db[_0xa7dc('0xfd')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xa7dc('0x13')],{});db[_0xa7dc('0xff')][_0xa7dc('0x11b')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0xa7dc('0x11b')](db[_0xa7dc('0xfc')],{});db[_0xa7dc('0xff')][_0xa7dc('0x11b')](db[_0xa7dc('0xf9')],{'foreignKey':_0xa7dc('0x1fd'),'as':_0xa7dc('0x1e2')});db[_0xa7dc('0xff')]['belongsTo'](db[_0xa7dc('0xf9')],{'foreignKey':_0xa7dc('0x1fe'),'as':_0xa7dc('0x1e7')});db[_0xa7dc('0xff')]['belongsTo'](db[_0xa7dc('0x101')],{'foreignKey':'ToQueueId','as':_0xa7dc('0x1ec')});db[_0xa7dc('0xff')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'foreignKey':_0xa7dc('0x1e3'),'as':'FromAgent'});db[_0xa7dc('0xff')][_0xa7dc('0x11b')](db['User'],{'foreignKey':_0xa7dc('0x1e9'),'as':'ToAgent'});db['WhatsappQueue'][_0xa7dc('0x11e')](db[_0xa7dc('0x13')],{'as':_0xa7dc('0x150'),'through':_0xa7dc('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0xa7dc('0x101')][_0xa7dc('0x11e')](db[_0xa7dc('0x123')],{'through':'team_has_whatsapp_queues','as':_0xa7dc('0x151')});db[_0xa7dc('0x108')][_0xa7dc('0x11b')](db[_0xa7dc('0x13')],{'as':'user','foreignKey':_0xa7dc('0x10c'),'onDelete':_0xa7dc('0x10b'),'hooks':!![]});db[_0xa7dc('0x103')][_0xa7dc('0x10a')](db[_0xa7dc('0x1d4')],{'as':_0xa7dc('0x1d4'),'onDelete':_0xa7dc('0x15e')});db[_0xa7dc('0x103')][_0xa7dc('0x10a')](db[_0xa7dc('0x15b')],{'as':_0xa7dc('0x15f'),'onDelete':_0xa7dc('0x15e')});db['CloudProvider'][_0xa7dc('0x10a')](db['MailServerOut'],{'as':_0xa7dc('0x160'),'onDelete':'restrict'});module[_0xa7dc('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 41ba557..8985527 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d75=['/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','./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/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','join','root','/apidoc','/www','static','/demo','/snippet','snippet','3.1.0','/server/files/plugins','route','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./api/client-side-logs','default','then','use','/api/users','./api/user','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/variable','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount'];(function(_0x3c5924,_0x4d295f){var _0x576958=function(_0x4a3e2d){while(--_0x4a3e2d){_0x3c5924['push'](_0x3c5924['shift']());}};_0x576958(++_0x4d295f);}(_0x7d75,0x7c));var _0x57d7=function(_0x22c718,_0xd75931){_0x22c718=_0x22c718-0x0;var _0x509cfe=_0x7d75[_0x22c718];return _0x509cfe;};'use strict';var path=require(_0x57d7('0x0'));var express=require(_0x57d7('0x1'));var errors=require(_0x57d7('0x2'));var config=require(_0x57d7('0x3'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0x57d7('0x4'));exports[_0x57d7('0x5')]=function(_0x284831){return setupLoggers(_0x284831)[_0x57d7('0x6')](function(){_0x284831[_0x57d7('0x7')](_0x57d7('0x8'),require(_0x57d7('0x9')));_0x284831[_0x57d7('0x7')]('/api/voice/chanspy',require(_0x57d7('0xa')));_0x284831[_0x57d7('0x7')]('/api/voice/contexts',require(_0x57d7('0xb')));_0x284831[_0x57d7('0x7')]('/api/voice/extensions',require(_0x57d7('0xc')));_0x284831[_0x57d7('0x7')](_0x57d7('0xd'),require(_0x57d7('0xe')));_0x284831['use'](_0x57d7('0xf'),require('./api/voiceQueue'));_0x284831[_0x57d7('0x7')]('/api/voice/recordings',require(_0x57d7('0x10')));_0x284831['use']('/api/screen/recordings',require(_0x57d7('0x11')));_0x284831[_0x57d7('0x7')](_0x57d7('0x12'),require(_0x57d7('0x13')));_0x284831['use']('/api/voice/mails/messages',require(_0x57d7('0x14')));_0x284831[_0x57d7('0x7')](_0x57d7('0x15'),require(_0x57d7('0x16')));_0x284831[_0x57d7('0x7')](_0x57d7('0x17'),require('./api/voiceDialReport'));_0x284831[_0x57d7('0x7')](_0x57d7('0x18'),require(_0x57d7('0x19')));_0x284831[_0x57d7('0x7')](_0x57d7('0x1a'),require(_0x57d7('0x1b')));_0x284831['use'](_0x57d7('0x1c'),require(_0x57d7('0x1d')));_0x284831['use'](_0x57d7('0x1e'),require('./api/trunk'));_0x284831[_0x57d7('0x7')](_0x57d7('0x1f'),require(_0x57d7('0x20')));_0x284831[_0x57d7('0x7')](_0x57d7('0x21'),require(_0x57d7('0x22')));_0x284831[_0x57d7('0x7')](_0x57d7('0x23'),require(_0x57d7('0x24')));_0x284831[_0x57d7('0x7')]('/api/mail/queues',require(_0x57d7('0x25')));_0x284831[_0x57d7('0x7')]('/api/mail/substatuses',require(_0x57d7('0x26')));_0x284831[_0x57d7('0x7')](_0x57d7('0x27'),require(_0x57d7('0x28')));_0x284831['use'](_0x57d7('0x29'),require('./api/mailMessage'));_0x284831['use'](_0x57d7('0x2a'),require(_0x57d7('0x2b')));_0x284831[_0x57d7('0x7')](_0x57d7('0x2c'),require('./api/mailQueueReport'));_0x284831[_0x57d7('0x7')](_0x57d7('0x2d'),require(_0x57d7('0x2e')));_0x284831[_0x57d7('0x7')](_0x57d7('0x2f'),require('./api/dashboardItem'));_0x284831['use']('/api/fax/accounts',require(_0x57d7('0x30')));_0x284831[_0x57d7('0x7')]('/api/fax/applications',require(_0x57d7('0x31')));_0x284831['use'](_0x57d7('0x32'),require(_0x57d7('0x33')));_0x284831['use'](_0x57d7('0x34'),require('./api/faxMessage'));_0x284831['use'](_0x57d7('0x35'),require(_0x57d7('0x36')));_0x284831['use'](_0x57d7('0x37'),require('./api/faxQueueReport'));_0x284831[_0x57d7('0x7')](_0x57d7('0x38'),require(_0x57d7('0x39')));_0x284831[_0x57d7('0x7')](_0x57d7('0x3a'),require(_0x57d7('0x3b')));_0x284831[_0x57d7('0x7')](_0x57d7('0x3c'),require(_0x57d7('0x3d')));_0x284831[_0x57d7('0x7')](_0x57d7('0x3e'),require(_0x57d7('0x3f')));_0x284831['use'](_0x57d7('0x40'),require(_0x57d7('0x41')));_0x284831[_0x57d7('0x7')](_0x57d7('0x42'),require(_0x57d7('0x43')));_0x284831[_0x57d7('0x7')](_0x57d7('0x44'),require(_0x57d7('0x45')));_0x284831[_0x57d7('0x7')](_0x57d7('0x46'),require('./api/openchannelInteraction'));_0x284831['use']('/api/openchannel/messages',require(_0x57d7('0x47')));_0x284831['use']('/api/openchannel/queues',require(_0x57d7('0x48')));_0x284831[_0x57d7('0x7')](_0x57d7('0x49'),require(_0x57d7('0x4a')));_0x284831[_0x57d7('0x7')](_0x57d7('0x4b'),require(_0x57d7('0x4c')));_0x284831['use']('/api/chat/applications',require(_0x57d7('0x4d')));_0x284831[_0x57d7('0x7')]('/api/chat/interactions',require(_0x57d7('0x4e')));_0x284831[_0x57d7('0x7')](_0x57d7('0x4f'),require(_0x57d7('0x50')));_0x284831['use']('/api/chat/offline_messages',require(_0x57d7('0x51')));_0x284831['use'](_0x57d7('0x52'),require(_0x57d7('0x53')));_0x284831[_0x57d7('0x7')](_0x57d7('0x54'),require(_0x57d7('0x55')));_0x284831[_0x57d7('0x7')](_0x57d7('0x56'),require('./api/chatProactiveAction'));_0x284831['use'](_0x57d7('0x57'),require(_0x57d7('0x58')));_0x284831[_0x57d7('0x7')]('/api/cm/contacts',require(_0x57d7('0x59')));_0x284831[_0x57d7('0x7')]('/api/cm/hopper',require(_0x57d7('0x5a')));_0x284831['use']('/api/cm/hopper_black',require(_0x57d7('0x5b')));_0x284831[_0x57d7('0x7')](_0x57d7('0x5c'),require(_0x57d7('0x5d')));_0x284831[_0x57d7('0x7')](_0x57d7('0x5e'),require(_0x57d7('0x5f')));_0x284831['use']('/api/cm/custom_fields',require(_0x57d7('0x60')));_0x284831[_0x57d7('0x7')](_0x57d7('0x61'),require(_0x57d7('0x62')));_0x284831[_0x57d7('0x7')](_0x57d7('0x63'),require(_0x57d7('0x64')));_0x284831[_0x57d7('0x7')]('/api/canned_answers',require(_0x57d7('0x65')));_0x284831[_0x57d7('0x7')]('/api/dispositions',require('./api/disposition'));_0x284831[_0x57d7('0x7')](_0x57d7('0x66'),require(_0x57d7('0x67')));_0x284831[_0x57d7('0x7')](_0x57d7('0x68'),require(_0x57d7('0x69')));_0x284831[_0x57d7('0x7')](_0x57d7('0x6a'),require(_0x57d7('0x6b')));_0x284831[_0x57d7('0x7')]('/api/cdr',require(_0x57d7('0x6c')));_0x284831[_0x57d7('0x7')](_0x57d7('0x6d'),require(_0x57d7('0x6e')));_0x284831[_0x57d7('0x7')](_0x57d7('0x6f'),require('./api/schedule'));_0x284831[_0x57d7('0x7')](_0x57d7('0x70'),require('./api/sound'));_0x284831[_0x57d7('0x7')](_0x57d7('0x71'),require(_0x57d7('0x72')));_0x284831[_0x57d7('0x7')](_0x57d7('0x73'),require(_0x57d7('0x74')));_0x284831[_0x57d7('0x7')](_0x57d7('0x75'),require(_0x57d7('0x76')));_0x284831[_0x57d7('0x7')]('/api/cm_hopper_additional_phones',require(_0x57d7('0x77')));_0x284831[_0x57d7('0x7')]('/api/templates',require(_0x57d7('0x78')));_0x284831[_0x57d7('0x7')](_0x57d7('0x79'),require('./api/trigger'));_0x284831[_0x57d7('0x7')]('/api/variables',require(_0x57d7('0x7a')));_0x284831[_0x57d7('0x7')]('/api/integrations',require('./api/integration'));_0x284831[_0x57d7('0x7')](_0x57d7('0x7b'),require(_0x57d7('0x7c')));_0x284831[_0x57d7('0x7')](_0x57d7('0x7d'),require(_0x57d7('0x7e')));_0x284831[_0x57d7('0x7')](_0x57d7('0x7f'),require(_0x57d7('0x80')));_0x284831[_0x57d7('0x7')](_0x57d7('0x81'),require('./api/analyticExtractedReport'));_0x284831[_0x57d7('0x7')](_0x57d7('0x82'),require(_0x57d7('0x83')));_0x284831[_0x57d7('0x7')](_0x57d7('0x84'),require('./api/analyticFieldReport'));_0x284831[_0x57d7('0x7')](_0x57d7('0x85'),require(_0x57d7('0x86')));_0x284831[_0x57d7('0x7')](_0x57d7('0x87'),require(_0x57d7('0x88')));_0x284831[_0x57d7('0x7')](_0x57d7('0x89'),require(_0x57d7('0x8a')));_0x284831['use'](_0x57d7('0x8b'),require(_0x57d7('0x8c')));_0x284831['use']('/api/integrations/sugarcrm/accounts',require(_0x57d7('0x8d')));_0x284831[_0x57d7('0x7')](_0x57d7('0x8e'),require(_0x57d7('0x8f')));_0x284831[_0x57d7('0x7')]('/api/integrations/sugarcrm/fields',require(_0x57d7('0x90')));_0x284831[_0x57d7('0x7')](_0x57d7('0x91'),require(_0x57d7('0x92')));_0x284831[_0x57d7('0x7')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x284831[_0x57d7('0x7')](_0x57d7('0x93'),require(_0x57d7('0x94')));_0x284831[_0x57d7('0x7')](_0x57d7('0x95'),require(_0x57d7('0x96')));_0x284831[_0x57d7('0x7')](_0x57d7('0x97'),require(_0x57d7('0x98')));_0x284831['use']('/api/integrations/zoho/fields',require(_0x57d7('0x99')));_0x284831[_0x57d7('0x7')](_0x57d7('0x9a'),require('./api/intZendeskAccount'));_0x284831[_0x57d7('0x7')](_0x57d7('0x9b'),require(_0x57d7('0x9c')));_0x284831[_0x57d7('0x7')]('/api/integrations/zendesk/fields',require(_0x57d7('0x9d')));_0x284831['use'](_0x57d7('0x9e'),require('./api/intFreshdeskAccount'));_0x284831[_0x57d7('0x7')]('/api/integrations/freshdesk/configurations',require(_0x57d7('0x9f')));_0x284831['use'](_0x57d7('0xa0'),require(_0x57d7('0xa1')));_0x284831[_0x57d7('0x7')]('/api/integrations/vtiger/accounts',require(_0x57d7('0xa2')));_0x284831[_0x57d7('0x7')]('/api/integrations/vtiger/configurations',require(_0x57d7('0xa3')));_0x284831[_0x57d7('0x7')](_0x57d7('0xa4'),require(_0x57d7('0xa5')));_0x284831['use']('/api/integrations/servicenow/accounts',require(_0x57d7('0xa6')));_0x284831['use']('/api/integrations/servicenow/configurations',require(_0x57d7('0xa7')));_0x284831[_0x57d7('0x7')]('/api/integrations/servicenow/fields',require(_0x57d7('0xa8')));_0x284831[_0x57d7('0x7')]('/api/integrations/dynamics365/accounts',require(_0x57d7('0xa9')));_0x284831[_0x57d7('0x7')](_0x57d7('0xaa'),require(_0x57d7('0xab')));_0x284831[_0x57d7('0x7')]('/api/integrations/dynamics365/fields',require(_0x57d7('0xac')));_0x284831[_0x57d7('0x7')](_0x57d7('0xad'),require(_0x57d7('0xae')));_0x284831[_0x57d7('0x7')](_0x57d7('0xaf'),require(_0x57d7('0xb0')));_0x284831[_0x57d7('0x7')]('/api/integrations/freshsales/fields',require(_0x57d7('0xb1')));_0x284831['use'](_0x57d7('0xb2'),require(_0x57d7('0xb3')));_0x284831[_0x57d7('0x7')](_0x57d7('0xb4'),require(_0x57d7('0xb5')));_0x284831[_0x57d7('0x7')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x284831[_0x57d7('0x7')]('/api/jscripty/answers/reports',require(_0x57d7('0xb6')));_0x284831[_0x57d7('0x7')]('/api/jscripty/questions/reports',require(_0x57d7('0xb7')));_0x284831[_0x57d7('0x7')](_0x57d7('0xb8'),require(_0x57d7('0xb9')));_0x284831['use']('/api/sms/reports/queue',require(_0x57d7('0xba')));_0x284831[_0x57d7('0x7')]('/api/square/reports',require(_0x57d7('0xbb')));_0x284831['use'](_0x57d7('0xbc'),require('./api/squareReportDetail'));_0x284831[_0x57d7('0x7')](_0x57d7('0xbd'),require(_0x57d7('0xbe')));_0x284831[_0x57d7('0x7')]('/api/settings',require('./api/setting'));_0x284831[_0x57d7('0x7')](_0x57d7('0xbf'),require(_0x57d7('0xc0')));_0x284831['use'](_0x57d7('0xc1'),require('./api/squareProject'));_0x284831[_0x57d7('0x7')](_0x57d7('0xc2'),require(_0x57d7('0xc3')));_0x284831[_0x57d7('0x7')](_0x57d7('0xc4'),require(_0x57d7('0xc5')));_0x284831[_0x57d7('0x7')](_0x57d7('0xc6'),require(_0x57d7('0xc7')));_0x284831[_0x57d7('0x7')](_0x57d7('0xc8'),require(_0x57d7('0xc9')));_0x284831[_0x57d7('0x7')](_0x57d7('0xca'),require(_0x57d7('0xcb')));_0x284831[_0x57d7('0x7')](_0x57d7('0xcc'),require(_0x57d7('0xcd')));_0x284831[_0x57d7('0x7')](_0x57d7('0xce'),require('./api/attachment'));_0x284831[_0x57d7('0x7')](_0x57d7('0xcf'),require(_0x57d7('0xd0')));_0x284831[_0x57d7('0x7')](_0x57d7('0xd1'),require(_0x57d7('0xd2')));_0x284831[_0x57d7('0x7')]('/api/chat/reports/transfer',require(_0x57d7('0xd3')));_0x284831[_0x57d7('0x7')]('/api/fax/reports/transfer',require(_0x57d7('0xd4')));_0x284831[_0x57d7('0x7')](_0x57d7('0xd5'),require(_0x57d7('0xd6')));_0x284831[_0x57d7('0x7')]('/api/sms/reports/transfer',require(_0x57d7('0xd7')));_0x284831[_0x57d7('0x7')](_0x57d7('0xd8'),require(_0x57d7('0xd9')));_0x284831[_0x57d7('0x7')](_0x57d7('0xda'),require(_0x57d7('0xdb')));_0x284831[_0x57d7('0x7')](_0x57d7('0xdc'),require('./api/userProfile'));_0x284831['use'](_0x57d7('0xdd'),require(_0x57d7('0xde')));_0x284831[_0x57d7('0x7')](_0x57d7('0xdf'),require(_0x57d7('0xe0')));_0x284831[_0x57d7('0x7')](_0x57d7('0xe1'),require(_0x57d7('0xe2')));_0x284831[_0x57d7('0x7')]('/api/whatsapp/accounts',require(_0x57d7('0xe3')));_0x284831[_0x57d7('0x7')]('/api/whatsapp/applications',require(_0x57d7('0xe4')));_0x284831['use'](_0x57d7('0xe5'),require(_0x57d7('0xe6')));_0x284831[_0x57d7('0x7')](_0x57d7('0xe7'),require('./api/whatsappMessage'));_0x284831[_0x57d7('0x7')](_0x57d7('0xe8'),require(_0x57d7('0xe9')));_0x284831['use'](_0x57d7('0xea'),require('./api/whatsappTransferReport'));_0x284831[_0x57d7('0x7')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x284831['use'](_0x57d7('0xeb'),require(_0x57d7('0xec')));_0x284831[_0x57d7('0x7')](_0x57d7('0xed'),require('./api/realtime'));_0x284831['use']('/api/user-settings',require('./api/user-setting'));_0x284831[_0x57d7('0x7')](_0x57d7('0xee'),require('./api/authLocal'));_0x284831[_0x57d7('0x7')]('/api/auth/google',require(_0x57d7('0xef')));_0x284831[_0x57d7('0x7')](_0x57d7('0xf0'),require('./api/authActiveDirectory'));_0x284831[_0x57d7('0x7')](_0x57d7('0xf1'),require(_0x57d7('0xf2')));_0x284831[_0x57d7('0x7')]('/api/rpc',require(_0x57d7('0xf3')));_0x284831[_0x57d7('0x7')](_0x57d7('0xf4'),require(_0x57d7('0xf5')));_0x284831[_0x57d7('0x7')](_0x57d7('0xf6'),require(_0x57d7('0xf7')));_0x284831[_0x57d7('0x7')](_0x57d7('0xf8'),require(_0x57d7('0xf9')));_0x284831[_0x57d7('0x7')](_0x57d7('0xfa'),require('./api/webbar'));_0x284831['use']('/api/logs',clientSideLogs);_0x284831[_0x57d7('0x7')]('/apidoc',express['static'](path[_0x57d7('0xfb')](config[_0x57d7('0xfc')],_0x57d7('0xfd'))));_0x284831[_0x57d7('0x7')](_0x57d7('0xfe'),express[_0x57d7('0xff')](path[_0x57d7('0xfb')](config[_0x57d7('0xfc')],_0x57d7('0xfe'))));_0x284831['use'](_0x57d7('0x100'),express[_0x57d7('0xff')](path[_0x57d7('0xfb')](config[_0x57d7('0xfc')],_0x57d7('0x100'))));_0x284831['use'](_0x57d7('0x101'),express[_0x57d7('0xff')](path['join'](config[_0x57d7('0xfc')],_0x57d7('0x102'),_0x57d7('0x103'))));_0x284831[_0x57d7('0x7')]('/plugins',express[_0x57d7('0xff')](path[_0x57d7('0xfb')](config[_0x57d7('0xfc')],_0x57d7('0x104'))));_0x284831[_0x57d7('0x105')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x57d7('0x106')](errors[0x194]);_0x284831[_0x57d7('0x105')]('/*')['get'](function(_0x2e467b,_0x3610a){_0x3610a[_0x57d7('0x107')](path[_0x57d7('0x108')](_0x284831[_0x57d7('0x106')]('appPath')+_0x57d7('0x109')));});return _0x284831;});}; \ No newline at end of file +var _0xec59=['/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/analyticCustomReport','/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/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/realtime','./api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/version'];(function(_0x28457e,_0x3cb435){var _0x288c29=function(_0x1434e2){while(--_0x1434e2){_0x28457e['push'](_0x28457e['shift']());}};_0x288c29(++_0x3cb435);}(_0xec59,0x121));var _0x9ec5=function(_0x1a212a,_0x64496b){_0x1a212a=_0x1a212a-0x0;var _0x22d075=_0xec59[_0x1a212a];return _0x22d075;};'use strict';var path=require('path');var express=require(_0x9ec5('0x0'));var errors=require(_0x9ec5('0x1'));var config=require(_0x9ec5('0x2'));var setupLoggers=require(_0x9ec5('0x3'))[_0x9ec5('0x4')];var clientSideLogs=require(_0x9ec5('0x5'));exports[_0x9ec5('0x6')]=function(_0x534bdc){return setupLoggers(_0x534bdc)['then'](function(){_0x534bdc[_0x9ec5('0x7')]('/api/users',require(_0x9ec5('0x8')));_0x534bdc['use'](_0x9ec5('0x9'),require(_0x9ec5('0xa')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xb'),require(_0x9ec5('0xc')));_0x534bdc['use'](_0x9ec5('0xd'),require(_0x9ec5('0xe')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xf'),require('./api/voiceMusicOnHold'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x10'),require(_0x9ec5('0x11')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x12'),require('./api/voiceRecording'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x13'),require(_0x9ec5('0x14')));_0x534bdc['use']('/api/voice/mails',require(_0x9ec5('0x15')));_0x534bdc[_0x9ec5('0x7')]('/api/voice/mails/messages',require(_0x9ec5('0x16')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x17'),require(_0x9ec5('0x18')));_0x534bdc[_0x9ec5('0x7')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x19'),require('./api/voiceAgentReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x1a'),require(_0x9ec5('0x1b')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x1c'),require(_0x9ec5('0x1d')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x1e'),require('./api/trunk'));_0x534bdc['use']('/api/voice/transfers/reports',require(_0x9ec5('0x1f')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x20'),require('./api/mailServerOut'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x21'),require(_0x9ec5('0x22')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x23'),require(_0x9ec5('0x24')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x25'),require(_0x9ec5('0x26')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x27'),require('./api/mailInteraction'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x28'),require(_0x9ec5('0x29')));_0x534bdc[_0x9ec5('0x7')]('/api/mail/applications',require('./api/mailApplication'));_0x534bdc['use']('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x534bdc[_0x9ec5('0x7')]('/api/dashboards',require('./api/dashboard'));_0x534bdc['use'](_0x9ec5('0x2a'),require(_0x9ec5('0x2b')));_0x534bdc['use'](_0x9ec5('0x2c'),require(_0x9ec5('0x2d')));_0x534bdc['use'](_0x9ec5('0x2e'),require(_0x9ec5('0x2f')));_0x534bdc[_0x9ec5('0x7')]('/api/fax/interactions',require(_0x9ec5('0x30')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x31'),require(_0x9ec5('0x32')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x33'),require('./api/faxQueue'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x34'),require('./api/faxQueueReport'));_0x534bdc[_0x9ec5('0x7')]('/api/sms/accounts',require(_0x9ec5('0x35')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x36'),require('./api/smsApplication'));_0x534bdc['use'](_0x9ec5('0x37'),require(_0x9ec5('0x38')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x39'),require(_0x9ec5('0x3a')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x3b'),require(_0x9ec5('0x3c')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x3d'),require(_0x9ec5('0x3e')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x3f'),require(_0x9ec5('0x40')));_0x534bdc['use']('/api/openchannel/interactions',require(_0x9ec5('0x41')));_0x534bdc[_0x9ec5('0x7')]('/api/openchannel/messages',require(_0x9ec5('0x42')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x43'),require(_0x9ec5('0x44')));_0x534bdc['use']('/api/chat/websites',require(_0x9ec5('0x45')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x46'),require(_0x9ec5('0x47')));_0x534bdc[_0x9ec5('0x7')]('/api/chat/applications',require(_0x9ec5('0x48')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x49'),require(_0x9ec5('0x4a')));_0x534bdc['use']('/api/chat/messages',require('./api/chatMessage'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x4b'),require('./api/chatOfflineMessage'));_0x534bdc[_0x9ec5('0x7')]('/api/chat/queues',require(_0x9ec5('0x4c')));_0x534bdc['use'](_0x9ec5('0x4d'),require('./api/chatGroup'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x4e'),require(_0x9ec5('0x4f')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x50'),require(_0x9ec5('0x51')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x52'),require(_0x9ec5('0x53')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x54'),require(_0x9ec5('0x55')));_0x534bdc[_0x9ec5('0x7')]('/api/cm/hopper_black',require(_0x9ec5('0x56')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x57'),require('./api/cmHopperFinal'));_0x534bdc[_0x9ec5('0x7')]('/api/cm/hopper_history',require(_0x9ec5('0x58')));_0x534bdc['use'](_0x9ec5('0x59'),require('./api/cmCustomField'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x5a'),require(_0x9ec5('0x5b')));_0x534bdc['use'](_0x9ec5('0x5c'),require(_0x9ec5('0x5d')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x5e'),require(_0x9ec5('0x5f')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x60'),require(_0x9ec5('0x61')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x62'),require(_0x9ec5('0x63')));_0x534bdc[_0x9ec5('0x7')]('/api/intervals',require(_0x9ec5('0x64')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x65'),require('./api/pause'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x66'),require(_0x9ec5('0x67')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x68'),require(_0x9ec5('0x69')));_0x534bdc[_0x9ec5('0x7')]('/api/schedules',require('./api/schedule'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x6a'),require('./api/sound'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x6b'),require(_0x9ec5('0x6c')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x6d'),require(_0x9ec5('0x6e')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x6f'),require(_0x9ec5('0x70')));_0x534bdc[_0x9ec5('0x7')]('/api/cm_hopper_additional_phones',require(_0x9ec5('0x71')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x72'),require(_0x9ec5('0x73')));_0x534bdc[_0x9ec5('0x7')]('/api/triggers',require('./api/trigger'));_0x534bdc['use'](_0x9ec5('0x74'),require(_0x9ec5('0x75')));_0x534bdc['use']('/api/integrations',require(_0x9ec5('0x76')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x77'),require('./api/integrationReport'));_0x534bdc[_0x9ec5('0x7')]('/api/analytics/custom_reports',require(_0x9ec5('0x78')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x79'),require('./api/analyticDefaultReport'));_0x534bdc['use'](_0x9ec5('0x7a'),require(_0x9ec5('0x7b')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x7c'),require(_0x9ec5('0x7d')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x7e'),require('./api/analyticFieldReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x7f'),require(_0x9ec5('0x80')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/salesforce/accounts',require(_0x9ec5('0x81')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x82'),require('./api/intSalesforceConfiguration'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x83'),require(_0x9ec5('0x84')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x9ec5('0x85')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x86'),require(_0x9ec5('0x87')));_0x534bdc['use']('/api/integrations/sugarcrm/fields',require(_0x9ec5('0x88')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x89'),require('./api/intDeskAccount'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x8a'),require(_0x9ec5('0x8b')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x8c'),require(_0x9ec5('0x8d')));_0x534bdc['use'](_0x9ec5('0x8e'),require(_0x9ec5('0x8f')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/zoho/fields',require(_0x9ec5('0x90')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x91'),require(_0x9ec5('0x92')));_0x534bdc['use'](_0x9ec5('0x93'),require(_0x9ec5('0x94')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x95'),require('./api/intZendeskField'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x96'),require(_0x9ec5('0x97')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/freshdesk/configurations',require(_0x9ec5('0x98')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/freshdesk/fields',require(_0x9ec5('0x99')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x9a'),require('./api/intVtigerAccount'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x9b'),require(_0x9ec5('0x9c')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/vtiger/fields',require(_0x9ec5('0x9d')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/servicenow/accounts',require(_0x9ec5('0x9e')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x9f'),require(_0x9ec5('0xa0')));_0x534bdc[_0x9ec5('0x7')]('/api/integrations/servicenow/fields',require(_0x9ec5('0xa1')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xa2'),require(_0x9ec5('0xa3')));_0x534bdc['use'](_0x9ec5('0xa4'),require(_0x9ec5('0xa5')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xa6'),require(_0x9ec5('0xa7')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xa8'),require(_0x9ec5('0xa9')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xaa'),require('./api/intFreshsalesConfiguration'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xab'),require(_0x9ec5('0xac')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xad'),require(_0x9ec5('0xae')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xaf'),require(_0x9ec5('0xb0')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xb1'),require(_0x9ec5('0xb2')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xb3'),require(_0x9ec5('0xb4')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xb5'),require('./api/jscriptyQuestionReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xb6'),require('./api/jscriptySessionReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xb7'),require(_0x9ec5('0xb8')));_0x534bdc[_0x9ec5('0x7')]('/api/square/reports',require(_0x9ec5('0xb9')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xba'),require(_0x9ec5('0xbb')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xbc'),require(_0x9ec5('0xbd')));_0x534bdc['use']('/api/settings',require(_0x9ec5('0xbe')));_0x534bdc['use']('/api/square/odbc',require(_0x9ec5('0xbf')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xc0'),require(_0x9ec5('0xc1')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xc2'),require(_0x9ec5('0xc3')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xc4'),require(_0x9ec5('0xc5')));_0x534bdc['use'](_0x9ec5('0xc6'),require('./api/team'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xc7'),require(_0x9ec5('0xc8')));_0x534bdc[_0x9ec5('0x7')]('/api/campaigns',require(_0x9ec5('0xc9')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xca'),require(_0x9ec5('0xcb')));_0x534bdc['use'](_0x9ec5('0xcc'),require('./api/attachment'));_0x534bdc['use'](_0x9ec5('0xcd'),require(_0x9ec5('0xce')));_0x534bdc['use'](_0x9ec5('0xcf'),require('./api/mailTransferReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xd0'),require(_0x9ec5('0xd1')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xd2'),require(_0x9ec5('0xd3')));_0x534bdc[_0x9ec5('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x534bdc[_0x9ec5('0x7')]('/api/sms/reports/transfer',require(_0x9ec5('0xd4')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xd5'),require(_0x9ec5('0xd6')));_0x534bdc['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xd7'),require(_0x9ec5('0xd8')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xd9'),require(_0x9ec5('0xda')));_0x534bdc[_0x9ec5('0x7')]('/api/userProfile/resources',require(_0x9ec5('0xdb')));_0x534bdc[_0x9ec5('0x7')]('/api/userNotifications',require(_0x9ec5('0xdc')));_0x534bdc[_0x9ec5('0x7')]('/api/whatsapp/accounts',require(_0x9ec5('0xdd')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xde'),require(_0x9ec5('0xdf')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xe0'),require(_0x9ec5('0xe1')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xe2'),require(_0x9ec5('0xe3')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xe4'),require('./api/whatsappQueueReport'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xe5'),require(_0x9ec5('0xe6')));_0x534bdc[_0x9ec5('0x7')]('/api/whatsapp/queues',require(_0x9ec5('0xe7')));_0x534bdc['use']('/api/cloudProviders',require('./api/cloudProvider'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xe8'),require(_0x9ec5('0xe9')));_0x534bdc[_0x9ec5('0x7')]('/api/user-settings',require(_0x9ec5('0xea')));_0x534bdc[_0x9ec5('0x7')]('/api/auth/local',require(_0x9ec5('0xeb')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xec'),require(_0x9ec5('0xed')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xee'),require(_0x9ec5('0xef')));_0x534bdc['use'](_0x9ec5('0xf0'),require(_0x9ec5('0xf1')));_0x534bdc['use']('/api/rpc',require('./api/rpc'));_0x534bdc['use']('/api/version',require(_0x9ec5('0xf2')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xf3'),require(_0x9ec5('0xf4')));_0x534bdc['use']('/api/pm2',require('./api/pm2'));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xf5'),require(_0x9ec5('0xf6')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xf7'),clientSideLogs);_0x534bdc['use'](_0x9ec5('0xf8'),express[_0x9ec5('0xf9')](path[_0x9ec5('0xfa')](config[_0x9ec5('0xfb')],'/apidoc')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xfc'),express[_0x9ec5('0xf9')](path['join'](config[_0x9ec5('0xfb')],'/www')));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xfd'),express['static'](path['join'](config['root'],_0x9ec5('0xfd'))));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0xfe'),express[_0x9ec5('0xf9')](path[_0x9ec5('0xfa')](config['root'],_0x9ec5('0xff'),_0x9ec5('0x100'))));_0x534bdc[_0x9ec5('0x7')](_0x9ec5('0x101'),express[_0x9ec5('0xf9')](path[_0x9ec5('0xfa')](config['root'],_0x9ec5('0x102'))));_0x534bdc[_0x9ec5('0x103')](_0x9ec5('0x104'))[_0x9ec5('0x105')](errors[0x194]);_0x534bdc[_0x9ec5('0x103')]('/*')['get'](function(_0x1f8781,_0x33e268){_0x33e268[_0x9ec5('0x106')](path[_0x9ec5('0x107')](_0x534bdc[_0x9ec5('0x105')](_0x9ec5('0x108'))+_0x9ec5('0x109')));});return _0x534bdc;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 01b228b..b6a0529 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecdc=['../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc'];(function(_0x199a83,_0x223f2a){var _0x3d61c4=function(_0x59db9d){while(--_0x59db9d){_0x199a83['push'](_0x199a83['shift']());}};_0x3d61c4(++_0x223f2a);}(_0xecdc,0x125));var _0xcecd=function(_0x1e24fb,_0x4d78ca){_0x1e24fb=_0x1e24fb-0x0;var _0x2cf430=_0xecdc[_0x1e24fb];return _0x2cf430;};'use strict';var jayson=require(_0xcecd('0x0'));var _=require(_0xcecd('0x1'));var config=require('../config/environment');exports[_0xcecd('0x2')]=function(){return new Promise(function(_0x11fe9d,_0x10dff5){var _0x1d272a={};_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/user/user.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x4')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/voiceQueue/voiceQueue.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x5')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x6')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x7')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x8')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/trunk/trunk.rpc'));_0x1d272a=_['merge'](_0x1d272a,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x9')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0xa')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/mailAccount/mailAccount.rpc'));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0xb')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0xc')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0xd')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/mailApplication/mailApplication.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0xe')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0xf')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x10')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x11')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x12')));_0x1d272a=_['merge'](_0x1d272a,require('../api/faxQueue/faxQueue.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x13')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x14')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x15')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/smsMessage/smsMessage.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/smsQueue/smsQueue.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x16')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x17')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/chatInteraction/chatInteraction.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x18')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/chatQueue/chatQueue.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/cmContact/cmContact.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x19')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x1a')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x1b')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x1c')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x1d')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x1e')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x1f')));_0x1d272a=_['merge'](_0x1d272a,require('../api/sound/sound.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x20')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x21')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x22')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x23')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x24')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x25')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x26')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x27')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x28')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x29')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x2a')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x2b')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x2c')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x2d')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x2e')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x2f')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require('../api/setting/setting.rpc'));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x30')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x31')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x32')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x33')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x34')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x35')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x36')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x37')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x38')));_0x1d272a=_['merge'](_0x1d272a,require(_0xcecd('0x39')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x3a')));_0x1d272a=_[_0xcecd('0x3')](_0x1d272a,require(_0xcecd('0x3b')));var _0x1a15d3=jayson[_0xcecd('0x3c')](_0x1d272a)['http']();var _0x211c13=config[_0xcecd('0x3d')][_0xcecd('0x3e')]||config[_0xcecd('0x3e')]+0x1;var _0x25cac=config[_0xcecd('0x3d')]['ip']||_0xcecd('0x3f');_0x1a15d3['on']('error',function(_0x241c73){return _0x10dff5(_0x241c73);});_0x1a15d3[_0xcecd('0x2')](_0x211c13,_0x25cac,function(){console[_0xcecd('0x40')](_0xcecd('0x41'),_0x25cac,_0x211c13);require(_0xcecd('0x42'))[_0xcecd('0x43')]();return _0x11fe9d(_0xcecd('0x44')+_0x25cac+':'+_0x211c13);});});}; \ No newline at end of file +var _0x889e=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc'];(function(_0x21c068,_0x369d6a){var _0x5cf199=function(_0x2c0159){while(--_0x2c0159){_0x21c068['push'](_0x21c068['shift']());}};_0x5cf199(++_0x369d6a);}(_0x889e,0x77));var _0xe889=function(_0x20b0fb,_0xcba57d){_0x20b0fb=_0x20b0fb-0x0;var _0x14cce6=_0x889e[_0x20b0fb];return _0x14cce6;};'use strict';var jayson=require(_0xe889('0x0'));var _=require(_0xe889('0x1'));var config=require('../config/environment');exports[_0xe889('0x2')]=function(){return new Promise(function(_0x53be95,_0xd27c39){var _0x3f57da={};_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x4')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/voiceExtension/voiceExtension.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x5')));_0x3f57da=_['merge'](_0x3f57da,require('../api/voiceRecording/voiceRecording.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x6')));_0x3f57da=_['merge'](_0x3f57da,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x7')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x8')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x9')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0xa')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0xb')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0xc')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/mailServerIn/mailServerIn.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0xd')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0xe')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0xf')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x10')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x11')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x12')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x13')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x14')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x15')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/faxMessage/faxMessage.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x16')));_0x3f57da=_['merge'](_0x3f57da,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x17')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x18')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x19')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x1a')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x1b')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x1c')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x1d')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x1e')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x1f')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x20')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x21')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x22')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x23')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x24')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x25')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x26')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/interval/interval.rpc'));_0x3f57da=_['merge'](_0x3f57da,require('../api/pause/pause.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x27')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x28')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x29')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x2a')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/variable/variable.rpc'));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x2b')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x2c')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x2d')));_0x3f57da=_['merge'](_0x3f57da,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x2e')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x2f')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x30')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x31')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x32')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x33')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x34')));_0x3f57da=_['merge'](_0x3f57da,require(_0xe889('0x35')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x36')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x37')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x38')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x39')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x3a')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x3b')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x3c')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x3d')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x3e')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x3f')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x40')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require(_0xe889('0x41')));_0x3f57da=_[_0xe889('0x3')](_0x3f57da,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3f7828=jayson[_0xe889('0x42')](_0x3f57da)[_0xe889('0x43')]();var _0x2ee86e=config[_0xe889('0x44')][_0xe889('0x45')]||config[_0xe889('0x45')]+0x1;var _0x78961e=config[_0xe889('0x44')]['ip']||_0xe889('0x46');_0x3f7828['on'](_0xe889('0x47'),function(_0x287e0e){return _0xd27c39(_0x287e0e);});_0x3f7828[_0xe889('0x2')](_0x2ee86e,_0x78961e,function(){console[_0xe889('0x48')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x78961e,_0x2ee86e);require('../config/triggers')['default']();return _0x53be95(_0xe889('0x49')+_0x78961e+':'+_0x2ee86e);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 63782c3..d888f7c 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 _0x7f59=['wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','setTimeout','setEncoding','utf8','headers','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','setVariable','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','recordFile'];(function(_0x74a643,_0x4ed7dc){var _0x360cc6=function(_0x143f60){while(--_0x143f60){_0x74a643['push'](_0x74a643['shift']());}};_0x360cc6(++_0x4ed7dc);}(_0x7f59,0x12e));var _0x97f5=function(_0x3ea437,_0x1f42b1){_0x3ea437=_0x3ea437-0x0;var _0x5aea2d=_0x7f59[_0x3ea437];return _0x5aea2d;};'use strict';var util=require(_0x97f5('0x0'));var _=require(_0x97f5('0x1'));var EventEmitter=require('events')[_0x97f5('0x2')];var AGIReply=require(_0x97f5('0x3'));var AGIError=require(_0x97f5('0x4'));function AGIChannel(_0x179186){var _0x2b37b0=this,_0x18d4c3=new AGIReply(),_0x29af72=![],_0x5e6215={};EventEmitter['call'](_0x2b37b0);_0x179186['setEncoding']('utf8');_0x179186[_0x97f5('0x5')](0x8*0x3c*0x3c*0x3e8);_0x18d4c3[_0x97f5('0x6')](_0x97f5('0x7'));_0x18d4c3['on'](_0x97f5('0x8'),function(_0x3637fd){for(var _0x2d917c in _0x3637fd){_0x2b37b0[_0x2d917c]=_0x3637fd[_0x2d917c];}_0x2b37b0['emit']('ready');});_0x18d4c3['on']('line',function(_0x2344b5){if(_0x2344b5['toLowerCase']()==_0x97f5('0x9')){_0x2b37b0[_0x97f5('0xa')]('hangup');return;}if(_0x2344b5[_0x97f5('0xb')](0x0,0xb)==_0x97f5('0xc')){_0x29af72=!![];}if(_0x29af72){_0x5e6215['rx']+=_0x2344b5+'\x0a';if(_0x2344b5[_0x97f5('0xd')](_0x97f5('0xe'))!=-0x1){_0x29af72=![];}}else{_0x5e6215['rx']=_0x2344b5;}if(_0x29af72){return;}if(typeof _0x5e6215['cb']=='function'){var _0x3e9348=_0x5e6215['rx']['substring'](0x0,0x3),_0x51ecf0=null,_0x52e270=null;_0x3e9348=parseInt(_0x3e9348);if(isNaN(_0x3e9348)){_0x5e6215['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x97f5('0xf')});return;}if(_0x3e9348!=0xc8){_0x5e6215['cb'](null,{'code':_0x3e9348,'result':-0x1,'extra':'KO'});return;}_0x51ecf0=_0x5e6215['rx']['substring'](0x4)[_0x97f5('0x10')]('result=','');if(_0x51ecf0[_0x97f5('0x11')]('\x20')!=-0x1){_0x51ecf0=_0x51ecf0[_0x97f5('0x12')](0x0,_0x51ecf0[_0x97f5('0x11')]('\x20'));}if(_[_0x97f5('0x13')](_0x51ecf0,'-1')){_0x51ecf0=parseInt(_0x51ecf0);}_0x52e270=_0x5e6215['rx'][_0x97f5('0x14')]('\x20');if(_0x52e270[_0x97f5('0x15')]==0x3){_0x52e270=_0x52e270[0x2][_0x97f5('0xb')](0x1,_0x52e270[0x2][_0x97f5('0x15')]-0x1);}else if(_0x52e270['length']>0x3){var _0x4c1392=/\((.+)\)/;var _0x92c6e4=_0x5e6215['rx'][_0x97f5('0x16')](_0x4c1392);if(_0x92c6e4){_0x52e270=_0x92c6e4[0x1];}else{_0x52e270=null;}}else{_0x52e270=null;}_0x5e6215['cb'](null,{'code':_0x3e9348,'result':_0x51ecf0,'extra':_0x52e270});}});_0x179186['on']('error',function(_0x197be7){_0x2b37b0[_0x97f5('0xa')](_0x97f5('0x17'),new AGIError(_0x97f5('0x18'),_0x197be7[_0x97f5('0x19')]));});_0x179186['on']('close',function(){_0x2b37b0[_0x97f5('0xa')](_0x97f5('0x1a'),new AGIError(_0x97f5('0x1b')));});_0x179186['on']('timeout',function(){_0x2b37b0['emit'](_0x97f5('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x179186[_0x97f5('0x1d')]();});_0x179186[_0x97f5('0x1e')](_0x18d4c3);this[_0x97f5('0x1f')]=function(_0x2f3347,_0x47a1f1){var _0x2f3347=_0x2f3347||'',_0x47a1f1=typeof _0x47a1f1=='function'?_0x47a1f1:new Function();_0x5e6215={'tx':_0x2f3347,'rx':'','cb':_0x47a1f1};_0x179186[_0x97f5('0x20')](_0x2f3347+'\x0a');},this['close']=function(){_0x179186[_0x97f5('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x97f5('0x21')][_0x97f5('0x22')]=function(_0x2f85e6){return this['command'][_0x97f5('0x23')](this,_0x2f85e6);};AGIChannel[_0x97f5('0x21')][_0x97f5('0x24')]=function(){return this[_0x97f5('0x22')](_0x97f5('0x25'));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x26')]=function(_0x284265,_0x53a557,_0x4b54dd){_0x284265=_0x284265===undefined?_0x97f5('0x27'):_0x284265;_0x53a557=_0x53a557===undefined?'5':_0x53a557;_0x4b54dd=_0x4b54dd===undefined?'1':_0x4b54dd;return this['sendRequest'](util[_0x97f5('0x28')](_0x97f5('0x29'),_0x284265,_0x53a557*0x3e8,_0x4b54dd));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x2a')]=function(_0x33fa2d){_0x33fa2d=_0x33fa2d||'NO\x20MESSAGE';return this['sendRequest'](util[_0x97f5('0x28')]('VERBOSE\x20\x22%s\x22',_0x33fa2d));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x2b')]=function(_0x42df4a,_0x38cfcc){if(_[_0x97f5('0x2c')](_0x38cfcc)){return this[_0x97f5('0x22')](util[_0x97f5('0x28')](_0x97f5('0x2d'),_0x42df4a,_0x38cfcc[_0x97f5('0x2e')](',')));}return this[_0x97f5('0x22')](util[_0x97f5('0x28')](_0x97f5('0x2d'),_0x42df4a,_0x38cfcc));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x2f')]=function(_0x4e604a){return this[_0x97f5('0x22')](util[_0x97f5('0x28')]('SET\x20CONTEXT\x20%s',_0x4e604a));};AGIChannel['prototype'][_0x97f5('0x30')]=function(_0x17875d){return this[_0x97f5('0x22')](util[_0x97f5('0x28')]('SET\x20EXTENSION\x20%s',_0x17875d));};AGIChannel['prototype'][_0x97f5('0x31')]=function(_0x38be65){return this['sendRequest'](util[_0x97f5('0x28')]('SET\x20PRIORITY\x20%s',_0x38be65));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x9')]=function(){return this['sendRequest']('HANGUP');};AGIChannel['prototype'][_0x97f5('0x32')]=function(_0x508fc7,_0x9ed859){var _0x3061aa=_['isBoolean'](_0x9ed859)||_['isNumber'](_0x9ed859)?_0x9ed859[_0x97f5('0x33')]():_0x9ed859;return this[_0x97f5('0x22')](util['format'](_0x97f5('0x34'),_0x508fc7,_0x3061aa?_0x3061aa[_0x97f5('0x33')]()[_0x97f5('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x35')]=function(_0x44308f,_0x13f947){return this['sendRequest'](util[_0x97f5('0x28')](_0x97f5('0x36'),_0x44308f,_0x13f947));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x37')]=function(_0x38ac88,_0x1e447b){return this[_0x97f5('0x22')](util[_0x97f5('0x28')](_0x97f5('0x38'),_0x38ac88,_0x1e447b));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x39')]=function(_0xdd1c20,_0xe4df86){return this['sendRequest'](util['format'](_0x97f5('0x3a'),_0xdd1c20,_0xe4df86));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x3b')]=function(_0xdea4e7,_0x3b75d8,_0x1b61e0){_0x3b75d8=_0x3b75d8||this[_0x97f5('0x3c')];_0x1b61e0=_0x1b61e0||0x1;this['setContext'](_0xdea4e7);this[_0x97f5('0x30')](_0x3b75d8);this[_0x97f5('0x31')](_0x1b61e0);return this['noop'](util[_0x97f5('0x28')]('GOTO\x20%s\x20%s\x20%s',_0xdea4e7,_0x3b75d8,_0x1b61e0));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x3d')]=function(_0xa444bc){return this[_0x97f5('0x22')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0xa444bc));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x3e')]=function(_0x57377f,_0x21ee5e,_0x3ed31d,_0x3a3ab9,_0x5a1b0e,_0x102036){_0x21ee5e=_0x21ee5e||_0x97f5('0x3f');_0x3ed31d=_0x3ed31d||'';_0x3a3ab9=_0x3a3ab9===undefined?-0x1:_0x3a3ab9==='-1'?-0x1:_0x3a3ab9*0x3e8;_0x5a1b0e=_0x5a1b0e===undefined?'':'s='+_0x5a1b0e;_0x102036=_0x102036?_0x97f5('0x40'):'';return this[_0x97f5('0x22')](util[_0x97f5('0x28')](_0x97f5('0x41'),_0x57377f,_0x21ee5e,_0x3ed31d,_0x3a3ab9,_0x102036,_0x5a1b0e));};AGIChannel[_0x97f5('0x21')]['streamFile']=function(_0x13c2bc,_0x1b4984){_0x1b4984=_0x1b4984||'';return this[_0x97f5('0x22')](util[_0x97f5('0x28')](_0x97f5('0x42'),_0x13c2bc,_0x1b4984));};AGIChannel[_0x97f5('0x21')][_0x97f5('0x43')]=function(_0x16cfaf){return this[_0x97f5('0x2b')](_0x97f5('0x44'),_0x16cfaf);};AGIChannel[_0x97f5('0x21')][_0x97f5('0x45')]=function(_0x388280){return this[_0x97f5('0x2b')]('WAIT',_0x388280);};AGIChannel[_0x97f5('0x21')][_0x97f5('0x17')]=function(_0x5db24c,_0x512a16){this['noop'](util['format'](_0x97f5('0x46'),_0x5db24c['id'],_0x5db24c[_0x97f5('0x47')],_0x512a16));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x97f5('0x48')]=AGIChannel; \ No newline at end of file +var _0xa816=['./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply'];(function(_0x3b2919,_0xe974ed){var _0x4a7dbf=function(_0x2d16c8){while(--_0x2d16c8){_0x3b2919['push'](_0x3b2919['shift']());}};_0x4a7dbf(++_0xe974ed);}(_0xa816,0xd7));var _0x6a81=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0xa816[_0x500c0];return _0xdd146f;};'use strict';var util=require(_0x6a81('0x0'));var _=require(_0x6a81('0x1'));var EventEmitter=require(_0x6a81('0x2'))['EventEmitter'];var AGIReply=require(_0x6a81('0x3'));var AGIError=require(_0x6a81('0x4'));function AGIChannel(_0x21eb62){var _0xda4528=this,_0x5c72cc=new AGIReply(),_0x399baa=![],_0x34267c={};EventEmitter['call'](_0xda4528);_0x21eb62[_0x6a81('0x5')](_0x6a81('0x6'));_0x21eb62[_0x6a81('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5c72cc[_0x6a81('0x5')](_0x6a81('0x6'));_0x5c72cc['on']('headers',function(_0x48b70b){for(var _0x51b34f in _0x48b70b){_0xda4528[_0x51b34f]=_0x48b70b[_0x51b34f];}_0xda4528[_0x6a81('0x8')](_0x6a81('0x9'));});_0x5c72cc['on']('line',function(_0x47ce17){if(_0x47ce17[_0x6a81('0xa')]()==_0x6a81('0xb')){_0xda4528['emit']('hangup');return;}if(_0x47ce17[_0x6a81('0xc')](0x0,0xb)==_0x6a81('0xd')){_0x399baa=!![];}if(_0x399baa){_0x34267c['rx']+=_0x47ce17+'\x0a';if(_0x47ce17[_0x6a81('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x399baa=![];}}else{_0x34267c['rx']=_0x47ce17;}if(_0x399baa){return;}if(typeof _0x34267c['cb']==_0x6a81('0xf')){var _0x1e8a59=_0x34267c['rx']['substring'](0x0,0x3),_0xe09ec5=null,_0x549eff=null;_0x1e8a59=parseInt(_0x1e8a59);if(isNaN(_0x1e8a59)){_0x34267c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6a81('0x10')});return;}if(_0x1e8a59!=0xc8){_0x34267c['cb'](null,{'code':_0x1e8a59,'result':-0x1,'extra':'KO'});return;}_0xe09ec5=_0x34267c['rx'][_0x6a81('0xc')](0x4)[_0x6a81('0x11')](_0x6a81('0x12'),'');if(_0xe09ec5[_0x6a81('0x13')]('\x20')!=-0x1){_0xe09ec5=_0xe09ec5[_0x6a81('0x14')](0x0,_0xe09ec5[_0x6a81('0x13')]('\x20'));}if(_[_0x6a81('0x15')](_0xe09ec5,'-1')){_0xe09ec5=parseInt(_0xe09ec5);}_0x549eff=_0x34267c['rx']['split']('\x20');if(_0x549eff[_0x6a81('0x16')]==0x3){_0x549eff=_0x549eff[0x2][_0x6a81('0xc')](0x1,_0x549eff[0x2][_0x6a81('0x16')]-0x1);}else if(_0x549eff['length']>0x3){var _0x1b1be9=/\((.+)\)/;var _0x2cb692=_0x34267c['rx'][_0x6a81('0x17')](_0x1b1be9);if(_0x2cb692){_0x549eff=_0x2cb692[0x1];}else{_0x549eff=null;}}else{_0x549eff=null;}_0x34267c['cb'](null,{'code':_0x1e8a59,'result':_0xe09ec5,'extra':_0x549eff});}});_0x21eb62['on'](_0x6a81('0x18'),function(_0x337a5c){_0xda4528[_0x6a81('0x8')](_0x6a81('0x18'),new AGIError(_0x6a81('0x19'),_0x337a5c['code']));});_0x21eb62['on'](_0x6a81('0x1a'),function(){_0xda4528[_0x6a81('0x8')](_0x6a81('0x1a'),new AGIError(_0x6a81('0x1b')));});_0x21eb62['on']('timeout',function(){_0xda4528['emit'](_0x6a81('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x21eb62[_0x6a81('0x1d')]();});_0x21eb62['pipe'](_0x5c72cc);this[_0x6a81('0x1e')]=function(_0x9eb1f3,_0x240197){var _0x9eb1f3=_0x9eb1f3||'',_0x240197=typeof _0x240197==_0x6a81('0xf')?_0x240197:new Function();_0x34267c={'tx':_0x9eb1f3,'rx':'','cb':_0x240197};_0x21eb62[_0x6a81('0x1f')](_0x9eb1f3+'\x0a');},this['close']=function(){_0x21eb62[_0x6a81('0x1d')]();};}util[_0x6a81('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x6a81('0x21')][_0x6a81('0x22')]=function(_0x364fe7){return this[_0x6a81('0x1e')][_0x6a81('0x23')](this,_0x364fe7);};AGIChannel[_0x6a81('0x21')][_0x6a81('0x24')]=function(){return this[_0x6a81('0x22')](_0x6a81('0x25'));};AGIChannel[_0x6a81('0x21')]['getData']=function(_0xffd727,_0x46c188,_0x1bc4f1){_0xffd727=_0xffd727===undefined?_0x6a81('0x26'):_0xffd727;_0x46c188=_0x46c188===undefined?'5':_0x46c188;_0x1bc4f1=_0x1bc4f1===undefined?'1':_0x1bc4f1;return this['sendRequest'](util[_0x6a81('0x27')](_0x6a81('0x28'),_0xffd727,_0x46c188*0x3e8,_0x1bc4f1));};AGIChannel['prototype'][_0x6a81('0x29')]=function(_0x20fb95){_0x20fb95=_0x20fb95||_0x6a81('0x2a');return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x2b'),_0x20fb95));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x2c')]=function(_0x5cfd39,_0x5dfb72){if(_[_0x6a81('0x2d')](_0x5dfb72)){return this[_0x6a81('0x22')](util['format'](_0x6a81('0x2e'),_0x5cfd39,_0x5dfb72[_0x6a81('0x2f')](',')));}return this[_0x6a81('0x22')](util[_0x6a81('0x27')]('EXEC\x20%s\x20%s',_0x5cfd39,_0x5dfb72));};AGIChannel[_0x6a81('0x21')]['setContext']=function(_0x1f936b){return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x30'),_0x1f936b));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x31')]=function(_0x1d5cfd){return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x32'),_0x1d5cfd));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x33')]=function(_0x26d46a){return this[_0x6a81('0x22')](util['format']('SET\x20PRIORITY\x20%s',_0x26d46a));};AGIChannel[_0x6a81('0x21')][_0x6a81('0xb')]=function(){return this[_0x6a81('0x22')](_0x6a81('0x34'));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x35')]=function(_0x53945c,_0x24a07f){var _0x2198dc=_['isBoolean'](_0x24a07f)||_[_0x6a81('0x36')](_0x24a07f)?_0x24a07f['toString']():_0x24a07f;return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x37'),_0x53945c,_0x2198dc?_0x2198dc[_0x6a81('0x38')]()[_0x6a81('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x39')]=function(_0x2285bb,_0x52d759){return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x3a'),_0x2285bb,_0x52d759));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x3b')]=function(_0x329226,_0x35896e){return this[_0x6a81('0x22')](util[_0x6a81('0x27')]('SAY\x20DIGITS\x20%s\x20%s',_0x329226,_0x35896e));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x3c')]=function(_0x4bb70e,_0x49a27e){return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x3d'),_0x4bb70e,_0x49a27e));};AGIChannel[_0x6a81('0x21')]['continueAt']=function(_0x31545a,_0x3cb25c,_0x517603){_0x3cb25c=_0x3cb25c||this[_0x6a81('0x3e')];_0x517603=_0x517603||0x1;this[_0x6a81('0x3f')](_0x31545a);this[_0x6a81('0x31')](_0x3cb25c);this[_0x6a81('0x33')](_0x517603);return this[_0x6a81('0x29')](util[_0x6a81('0x27')]('GOTO\x20%s\x20%s\x20%s',_0x31545a,_0x3cb25c,_0x517603));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x40')]=function(_0x3fdb5f){return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x41'),_0x3fdb5f));};AGIChannel[_0x6a81('0x21')]['recordFile']=function(_0x22920d,_0x362f82,_0x7d07b0,_0x523b5d,_0x382e3a,_0x1c7161){_0x362f82=_0x362f82||_0x6a81('0x42');_0x7d07b0=_0x7d07b0||'';_0x523b5d=_0x523b5d===undefined?-0x1:_0x523b5d==='-1'?-0x1:_0x523b5d*0x3e8;_0x382e3a=_0x382e3a===undefined?'':'s='+_0x382e3a;_0x1c7161=_0x1c7161?'BEEP':'';return this[_0x6a81('0x22')](util[_0x6a81('0x27')](_0x6a81('0x43'),_0x22920d,_0x362f82,_0x7d07b0,_0x523b5d,_0x1c7161,_0x382e3a));};AGIChannel[_0x6a81('0x21')][_0x6a81('0x44')]=function(_0x1aba23,_0x1a6fe0){_0x1a6fe0=_0x1a6fe0||'';return this['sendRequest'](util[_0x6a81('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1aba23,_0x1a6fe0));};AGIChannel['prototype'][_0x6a81('0x45')]=function(_0x472d85){return this[_0x6a81('0x2c')]('AGI',_0x472d85);};AGIChannel[_0x6a81('0x21')]['wait']=function(_0x772d7f){return this[_0x6a81('0x2c')]('WAIT',_0x772d7f);};AGIChannel[_0x6a81('0x21')][_0x6a81('0x18')]=function(_0x2befe1,_0x555548){this['noop'](util[_0x6a81('0x27')](_0x6a81('0x46'),_0x2befe1['id'],_0x2befe1[_0x6a81('0x47')],_0x555548));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6a81('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index f403c0d..5076080 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 _0x43aa=['format','message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x43aa,0xec));var _0xa43a=function(_0x4ce123,_0x84799f){_0x4ce123=_0x4ce123-0x0;var _0x25660a=_0x43aa[_0x4ce123];return _0x25660a;};'use strict';var util=require(_0xa43a('0x0'));var error={'E_AGI_UNDEFINED':_0xa43a('0x1'),'E_AGI_ARGUMENT_PORT':_0xa43a('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xa43a('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa43a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa43a('0x5'),'E_AGI_SOCKET_CLOSE':_0xa43a('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xa43a('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xa43a('0x8')};function AGIError(_0x350360){var _0x350360=_0x350360||null,_0x513043=_0x513043||[],_0x341655=0x1,_0x467c9b='';if(!error[_0x350360]){_0x350360=_0xa43a('0x9');}_0x513043['push'](error[_0x350360]);while(arguments[_0x341655]){_0x513043[_0xa43a('0xa')](arguments[_0x341655]);_0x341655++;}_0x467c9b=util[_0xa43a('0xb')]['apply'](util,_0x513043);this[_0xa43a('0xc')]=_0x467c9b;this['name']=_0x350360;}module['exports']=AGIError; \ No newline at end of file +var _0x3d06=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x71ac1a,_0xe9a4b0){var _0x54103c=function(_0x448482){while(--_0x448482){_0x71ac1a['push'](_0x71ac1a['shift']());}};_0x54103c(++_0xe9a4b0);}(_0x3d06,0x13f));var _0x63d0=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x3d06[_0x37a79c];return _0x561d89;};'use strict';var util=require(_0x63d0('0x0'));var error={'E_AGI_UNDEFINED':_0x63d0('0x1'),'E_AGI_ARGUMENT_PORT':_0x63d0('0x2'),'E_AGI_SERVER_ERROR':_0x63d0('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x63d0('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x63d0('0x5'),'E_AGI_SOCKET_CLOSE':_0x63d0('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x63d0('0x7'),'E_AGI_COMMAND_EMPTY':_0x63d0('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x63d0('0x9'),'E_AGI_IVR_ENTRY':_0x63d0('0xa')};function AGIError(_0x57a678){var _0x57a678=_0x57a678||null,_0x12e3df=_0x12e3df||[],_0x7d678d=0x1,_0x57e478='';if(!error[_0x57a678]){_0x57a678=_0x63d0('0xb');}_0x12e3df[_0x63d0('0xc')](error[_0x57a678]);while(arguments[_0x7d678d]){_0x12e3df[_0x63d0('0xc')](arguments[_0x7d678d]);_0x7d678d++;}_0x57e478=util['format'][_0x63d0('0xd')](util,_0x12e3df);this[_0x63d0('0xe')]=_0x57e478;this[_0x63d0('0xf')]=_0x57a678;}module[_0x63d0('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 59557d7..272b4f3 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 _0x17b5=['projectUpdate','exports','lodash','EventEmitter','ioredis','./error','../../config/environment','redis','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi'];(function(_0x90f620,_0x38cf81){var _0x239ddf=function(_0x3c753c){while(--_0x3c753c){_0x90f620['push'](_0x90f620['shift']());}};_0x239ddf(++_0x38cf81);}(_0x17b5,0x89));var _0x517b=function(_0x36284b,_0x2b7436){_0x36284b=_0x36284b-0x0;var _0x23c34a=_0x17b5[_0x36284b];return _0x23c34a;};'use strict';var _=require(_0x517b('0x0'));var EventEmitter=require('events')[_0x517b('0x1')];var Redis=require(_0x517b('0x2'));var AGIError=require(_0x517b('0x3'));var config=require(_0x517b('0x4'));config[_0x517b('0x5')]=_['defaults'](config['redis'],{'host':_0x517b('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x517b('0x7')]('agi',function(_0x314a43){if(_0x314a43)return eventEmitter[_0x517b('0x8')](_0x517b('0x9'),new AGIError(_0x517b('0xa'),_0x314a43));});sub['on'](_0x517b('0xb'),function(_0x343007,_0x56e86b){if(_0x343007!==_0x517b('0xc'))return;try{var _0x4e91b4=JSON['parse'](_0x56e86b);eventEmitter['emit'](_0x517b('0xd'),_0x4e91b4);}catch(_0x515af0){eventEmitter['emit'](_0x517b('0x9'),new AGIError(_0x517b('0xa'),_0x515af0));}});module[_0x517b('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xb826=['redis','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','lodash','events','EventEmitter','ioredis','./error','../../config/environment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xb826,0x72));var _0x6b82=function(_0x246a2c,_0x1b1130){_0x246a2c=_0x246a2c-0x0;var _0x53ec57=_0xb826[_0x246a2c];return _0x53ec57;};'use strict';var _=require(_0x6b82('0x0'));var EventEmitter=require(_0x6b82('0x1'))[_0x6b82('0x2')];var Redis=require(_0x6b82('0x3'));var AGIError=require(_0x6b82('0x4'));var config=require(_0x6b82('0x5'));config[_0x6b82('0x6')]=_['defaults'](config[_0x6b82('0x6')],{'host':_0x6b82('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x6b82('0x8')](_0x6b82('0x9'),function(_0x2c4c66){if(_0x2c4c66)return eventEmitter[_0x6b82('0xa')](_0x6b82('0xb'),new AGIError(_0x6b82('0xc'),_0x2c4c66));});sub['on'](_0x6b82('0xd'),function(_0x2b7469,_0x18ad77){if(_0x2b7469!==_0x6b82('0x9'))return;try{var _0x767b39=JSON['parse'](_0x18ad77);eventEmitter[_0x6b82('0xa')](_0x6b82('0xe'),_0x767b39);}catch(_0x4fe5ff){eventEmitter[_0x6b82('0xa')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x4fe5ff));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 5ccdf5f..98162db 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 _0x1475=['default','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','prototype','addVertex','edges','addEdge','push','size','relations','numberOfEdges','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target'];(function(_0x3310a7,_0x350c39){var _0x2ffcde=function(_0x3b21da){while(--_0x3b21da){_0x3310a7['push'](_0x3310a7['shift']());}};_0x2ffcde(++_0x350c39);}(_0x1475,0x144));var _0x5147=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x1475[_0x166d93];return _0xba708;};'use strict';var _=require(_0x5147('0x0'));var logger=require(_0x5147('0x1'))(_0x5147('0x2'));var verticesWithRetry=[_0x5147('0x3'),'getdigits',_0x5147('0x4')];var Graph=function(){this[_0x5147('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x5147('0x6')][_0x5147('0x7')]=function(_0x1f8f53){this[_0x5147('0x5')][_0x1f8f53['id']]=_0x1f8f53;this[_0x5147('0x8')][_0x1f8f53['id']]=[];};Graph[_0x5147('0x6')][_0x5147('0x9')]=function(_0x431f10,_0x20c262,_0x405024){this[_0x5147('0x8')][_0x431f10][_0x5147('0xa')]({'target':_0x20c262,'condition':_0x405024});this['numberOfEdges']+=0x1;};Graph[_0x5147('0x6')][_0x5147('0xb')]=function(){return _[_0x5147('0xb')](this['vertices']);};Graph['prototype'][_0x5147('0xc')]=function(){return this[_0x5147('0xd')];};Graph[_0x5147('0x6')][_0x5147('0xe')]=function(_0x53a3fd){return this['vertices'][_0x53a3fd];};Graph[_0x5147('0x6')][_0x5147('0xf')]=function(_0x5a3343,_0x13dc99){if(!this['vertices'][_0x5a3343]){return logger[_0x5147('0x10')](_0x5147('0x11'));}var _0x18d387=_0x13dc99(this[_0x5147('0x5')][_0x5a3343]);if(!_0x18d387){return logger[_0x5147('0x10')]('stop\x20traverse');}if(this[_0x5147('0x8')][_0x5a3343][_0x5147('0x12')]===0x0){return logger[_0x5147('0x10')](_0x5147('0x13'));}for(var _0x2bcfde=0x0,_0xc4b7f6=[],_0x578386=![];_0x2bcfde\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','hasOwnProperty','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','find','handleNotFound','production','handleUnpublished','initialize','then','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','push','error','log'];(function(_0x45eb78,_0x222223){var _0x5e7935=function(_0x55d582){while(--_0x55d582){_0x45eb78['push'](_0x45eb78['shift']());}};_0x5e7935(++_0x222223);}(_0xba0b,0x1ca));var _0xbba0=function(_0x3739ee,_0x42fe05){_0x3739ee=_0x3739ee-0x0;var _0x2b92dd=_0xba0b[_0x3739ee];return _0x2b92dd;};'use strict';var _=require(_0xbba0('0x0'));var syncho=require(_0xbba0('0x1'));var util=require(_0xbba0('0x2'));var config=require(_0xbba0('0x3'));var logger=require(_0xbba0('0x4'))(_0xbba0('0x5'));var utilLicense=require(_0xbba0('0x6'));var rpc=require(_0xbba0('0x7'));var Project=require(_0xbba0('0x8'));var AGIEmitter=require(_0xbba0('0x9'))[_0xbba0('0xa')];var projects=[];config['agi']=_[_0xbba0('0xb')](config[_0xbba0('0x5')],{'ip':_0xbba0('0xc'),'port':0x11dd});AGIEmitter['on'](_0xbba0('0xd'),projectUpdateHandler);function connectionHandler(_0x5b1820){process[_0xbba0('0xe')](function(){syncho(function(){try{setChannelVariables(_0x5b1820);agiHandler(_0x5b1820);}catch(_0x50c157){logger['error'](_0x50c157[_0xbba0('0xf')]);}});});}function projectUpdateHandler(_0x3c45b7){try{var _0x41d4b3=_[_0xbba0('0x10')](projects,['id',_0x3c45b7['id']]);if(_0x41d4b3>-0x1){if(_0x3c45b7[_0xbba0('0x11')]===!![]){projects[_0xbba0('0x12')](_0x41d4b3,0x1);}else{projects[_0x41d4b3]=_0x3c45b7;}}else{projects[_0xbba0('0x13')](_0x3c45b7);}}catch(_0x5c5cf8){logger[_0xbba0('0x14')](_0x5c5cf8['stack']);}}function listeningHandler(){console[_0xbba0('0x15')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xbba0('0x5')][_0xbba0('0x16')]);logger[_0xbba0('0x17')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xbba0('0x5')]['ip'],config['agi'][_0xbba0('0x16')]));}function errorHandler(_0x4f9e78){if(_0x4f9e78&&_0x4f9e78['name']&&_0x4f9e78['message']){logger[_0xbba0('0x14')](util[_0xbba0('0x18')](_0xbba0('0x19'),_0x4f9e78[_0xbba0('0x1a')],_0x4f9e78[_0xbba0('0x1b')]));}else{logger[_0xbba0('0x14')](util[_0xbba0('0x18')](_0xbba0('0x1c'),_0x4f9e78[_0xbba0('0xf')]));}}function closeHandler(){logger[_0xbba0('0x17')](util[_0xbba0('0x18')](_0xbba0('0x1d'),this['arg_1'],this['calleridname'],this[_0xbba0('0x1e')],this[_0xbba0('0x1f')],this[_0xbba0('0x20')]));try{createSquareReport(this);}catch(_0x2191b0){logger[_0xbba0('0x14')](_0x2191b0['stack']);}}function timeoutHandler(){logger[_0xbba0('0x17')](util[_0xbba0('0x18')](_0xbba0('0x21'),this[_0xbba0('0x22')],this[_0xbba0('0x23')],this[_0xbba0('0x1e')],this[_0xbba0('0x1f')],this[_0xbba0('0x20')]));}function hangupHandler(){logger[_0xbba0('0x17')](util[_0xbba0('0x18')](_0xbba0('0x24'),this[_0xbba0('0x22')],this[_0xbba0('0x23')],this[_0xbba0('0x1e')],this['dnid'],this[_0xbba0('0x20')]));this[_0xbba0('0x25')]=!![];}function createSquareReport(_0x5094f7,_0x58aa58){rpc[_0xbba0('0x26')](_0x5094f7)['then'](function(_0x112666){if(_0x58aa58){_0x58aa58(null,_0x112666);}})[_0xbba0('0x27')](function(_0x1c7a3a){if(_0x58aa58){_0x58aa58(null,_0x1c7a3a);}});}function setChannelVariables(_0x43e136){for(var _0x29f7c6 in _0x43e136){if(_0x43e136[_0xbba0('0x28')](_0x29f7c6)){if(_0x29f7c6['indexOf'](_0xbba0('0x29'))===0x0){_0x43e136[_0x29f7c6[_0xbba0('0x2a')](0x4)]=_0x43e136[_0x29f7c6];delete _0x43e136[_0x29f7c6];}}}}function agiHandler(_0x3d9dfa){logger[_0xbba0('0x2b')]('variables',JSON[_0xbba0('0x2c')](_0x3d9dfa,null,0x2));logger['info'](util['format'](_0xbba0('0x2d'),_0x3d9dfa[_0xbba0('0x22')],_0x3d9dfa[_0xbba0('0x23')],_0x3d9dfa[_0xbba0('0x1e')],_0x3d9dfa['dnid'],_0x3d9dfa[_0xbba0('0x20')]));_0x3d9dfa['on'](_0xbba0('0x14'),errorHandler);_0x3d9dfa['on'](_0xbba0('0x2e'),closeHandler);_0x3d9dfa['on']('timeout',timeoutHandler);_0x3d9dfa[_0xbba0('0x25')]=![];_0x3d9dfa['on']('hangup',hangupHandler);var _0x59f41d=_[_0xbba0('0x2f')](projects,[_0xbba0('0x1a'),_0x3d9dfa[_0xbba0('0x22')]]);if(!_0x59f41d)return Project[_0xbba0('0x30')](_0x3d9dfa);if(!_0x59f41d[_0xbba0('0x31')])return Project[_0xbba0('0x32')](_0x3d9dfa);return Project[_0xbba0('0x33')](_0x59f41d,_0x3d9dfa);}function main(){var _0x3f0505;return utilLicense['getLicense']()[_0xbba0('0x34')](function(_0xef3ee8){if(!_0xef3ee8)return;if(_0xef3ee8['voice']){if(_0xef3ee8[_0xbba0('0x35')]&&_0xef3ee8[_0xbba0('0x35')]>0x0){logger[_0xbba0('0x17')](util[_0xbba0('0x18')](_0xbba0('0x36'),_0xef3ee8[_0xbba0('0x35')]));_0x3f0505=_0xef3ee8[_0xbba0('0x35')];}else{logger[_0xbba0('0x17')](_0xbba0('0x37'));}}else{logger[_0xbba0('0x17')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3f0505=-0x1;}})[_0xbba0('0x34')](function(){return Project[_0xbba0('0x38')]();})[_0xbba0('0x34')](function(_0x513d37){projects=_0x513d37;return;})[_0xbba0('0x27')](function(_0x147855){logger[_0xbba0('0x14')](_0xbba0('0x39'),_0x147855['stack']);})[_0xbba0('0x3a')](function(){var _0x261f46=require('./server')(config[_0xbba0('0x5')][_0xbba0('0x16')],config[_0xbba0('0x5')]['ip'],_0x3f0505);_0x261f46['on'](_0xbba0('0x14'),errorHandler);_0x261f46['on']('listening',listeningHandler);_0x261f46['on'](_0xbba0('0x3b'),connectionHandler);_0x261f46['on'](_0xbba0('0x2e'),closeHandler);});}main(); \ No newline at end of file +var _0x8ced=['catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','find','handleNotFound','handleUnpublished','initialize','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x8ced,0x192));var _0xd8ce=function(_0xdb01a,_0x54a83a){_0xdb01a=_0xdb01a-0x0;var _0x107ede=_0x8ced[_0xdb01a];return _0x107ede;};'use strict';var _=require(_0xd8ce('0x0'));var syncho=require(_0xd8ce('0x1'));var util=require(_0xd8ce('0x2'));var config=require(_0xd8ce('0x3'));var logger=require(_0xd8ce('0x4'))(_0xd8ce('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0xd8ce('0x6'));var Project=require(_0xd8ce('0x7'));var AGIEmitter=require(_0xd8ce('0x8'))[_0xd8ce('0x9')];var projects=[];config[_0xd8ce('0x5')]=_[_0xd8ce('0xa')](config[_0xd8ce('0x5')],{'ip':_0xd8ce('0xb'),'port':0x11dd});AGIEmitter['on'](_0xd8ce('0xc'),projectUpdateHandler);function connectionHandler(_0x5cf81a){process[_0xd8ce('0xd')](function(){syncho(function(){try{setChannelVariables(_0x5cf81a);agiHandler(_0x5cf81a);}catch(_0x4c745f){logger[_0xd8ce('0xe')](_0x4c745f[_0xd8ce('0xf')]);}});});}function projectUpdateHandler(_0x900b28){try{var _0x4e7b6b=_['findIndex'](projects,['id',_0x900b28['id']]);if(_0x4e7b6b>-0x1){if(_0x900b28[_0xd8ce('0x10')]===!![]){projects[_0xd8ce('0x11')](_0x4e7b6b,0x1);}else{projects[_0x4e7b6b]=_0x900b28;}}else{projects[_0xd8ce('0x12')](_0x900b28);}}catch(_0x578934){logger[_0xd8ce('0xe')](_0x578934['stack']);}}function listeningHandler(){console[_0xd8ce('0x13')](_0xd8ce('0x14'),config['agi'][_0xd8ce('0x15')]);logger[_0xd8ce('0x16')](util['format'](_0xd8ce('0x17'),config[_0xd8ce('0x5')]['ip'],config[_0xd8ce('0x5')]['port']));}function errorHandler(_0x20f4f3){if(_0x20f4f3&&_0x20f4f3[_0xd8ce('0x18')]&&_0x20f4f3['message']){logger[_0xd8ce('0xe')](util[_0xd8ce('0x19')](_0xd8ce('0x1a'),_0x20f4f3[_0xd8ce('0x18')],_0x20f4f3[_0xd8ce('0x1b')]));}else{logger[_0xd8ce('0xe')](util['format']('[ERROR]\x20%s',_0x20f4f3[_0xd8ce('0xf')]));}}function closeHandler(){logger['info'](util[_0xd8ce('0x19')](_0xd8ce('0x1c'),this['arg_1'],this['calleridname'],this[_0xd8ce('0x1d')],this[_0xd8ce('0x1e')],this[_0xd8ce('0x1f')]));try{createSquareReport(this);}catch(_0x474fe7){logger[_0xd8ce('0xe')](_0x474fe7[_0xd8ce('0xf')]);}}function timeoutHandler(){logger[_0xd8ce('0x16')](util[_0xd8ce('0x19')](_0xd8ce('0x20'),this[_0xd8ce('0x21')],this[_0xd8ce('0x22')],this['callerid'],this['dnid'],this[_0xd8ce('0x1f')]));}function hangupHandler(){logger[_0xd8ce('0x16')](util[_0xd8ce('0x19')](_0xd8ce('0x23'),this[_0xd8ce('0x21')],this[_0xd8ce('0x22')],this[_0xd8ce('0x1d')],this['dnid'],this['uniqueid']));this[_0xd8ce('0x24')]=!![];}function createSquareReport(_0x423ccf,_0x4b45f1){rpc[_0xd8ce('0x25')](_0x423ccf)[_0xd8ce('0x26')](function(_0x14549f){if(_0x4b45f1){_0x4b45f1(null,_0x14549f);}})[_0xd8ce('0x27')](function(_0x18efc3){if(_0x4b45f1){_0x4b45f1(null,_0x18efc3);}});}function setChannelVariables(_0x1e9a94){for(var _0x1f033d in _0x1e9a94){if(_0x1e9a94[_0xd8ce('0x28')](_0x1f033d)){if(_0x1f033d[_0xd8ce('0x29')](_0xd8ce('0x2a'))===0x0){_0x1e9a94[_0x1f033d[_0xd8ce('0x2b')](0x4)]=_0x1e9a94[_0x1f033d];delete _0x1e9a94[_0x1f033d];}}}}function agiHandler(_0x928489){logger[_0xd8ce('0x2c')](_0xd8ce('0x2d'),JSON[_0xd8ce('0x2e')](_0x928489,null,0x2));logger[_0xd8ce('0x16')](util[_0xd8ce('0x19')](_0xd8ce('0x2f'),_0x928489[_0xd8ce('0x21')],_0x928489[_0xd8ce('0x22')],_0x928489[_0xd8ce('0x1d')],_0x928489[_0xd8ce('0x1e')],_0x928489['uniqueid']));_0x928489['on'](_0xd8ce('0xe'),errorHandler);_0x928489['on'](_0xd8ce('0x30'),closeHandler);_0x928489['on']('timeout',timeoutHandler);_0x928489['evtHangup']=![];_0x928489['on'](_0xd8ce('0x31'),hangupHandler);var _0x43a74b=_[_0xd8ce('0x32')](projects,[_0xd8ce('0x18'),_0x928489[_0xd8ce('0x21')]]);if(!_0x43a74b)return Project[_0xd8ce('0x33')](_0x928489);if(!_0x43a74b['production'])return Project[_0xd8ce('0x34')](_0x928489);return Project[_0xd8ce('0x35')](_0x43a74b,_0x928489);}function main(){var _0x381dd5;return utilLicense['getLicense']()[_0xd8ce('0x26')](function(_0x3be593){if(!_0x3be593)return;if(_0x3be593['voice']){if(_0x3be593['callysquare']&&_0x3be593['callysquare']>0x0){logger[_0xd8ce('0x16')](util[_0xd8ce('0x19')](_0xd8ce('0x36'),_0x3be593[_0xd8ce('0x37')]));_0x381dd5=_0x3be593[_0xd8ce('0x37')];}else{logger[_0xd8ce('0x16')](_0xd8ce('0x38'));}}else{logger[_0xd8ce('0x16')](_0xd8ce('0x39'));_0x381dd5=-0x1;}})[_0xd8ce('0x26')](function(){return Project[_0xd8ce('0x3a')]();})[_0xd8ce('0x26')](function(_0xb9bb8f){projects=_0xb9bb8f;return;})[_0xd8ce('0x27')](function(_0x3358c4){logger[_0xd8ce('0xe')]('[LICENSE]',_0x3358c4[_0xd8ce('0xf')]);})[_0xd8ce('0x3b')](function(){var _0x1fe568=require(_0xd8ce('0x3c'))(config[_0xd8ce('0x5')]['port'],config['agi']['ip'],_0x381dd5);_0x1fe568['on']('error',errorHandler);_0x1fe568['on'](_0xd8ce('0x3d'),listeningHandler);_0x1fe568['on'](_0xd8ce('0x3e'),connectionHandler);_0x1fe568['on'](_0xd8ce('0x30'),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 8901fb3..0fdfeb1 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 _0xbabf=['jayson/promise','client','http','request','then','error','message','SendMail'];(function(_0x561780,_0x6e4625){var _0x845412=function(_0x1f8cb3){while(--_0x1f8cb3){_0x561780['push'](_0x561780['shift']());}};_0x845412(++_0x6e4625);}(_0xbabf,0xa8));var _0xfbab=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xbabf[_0x341e0f];return _0x59555a;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xfbab('0x0'));var client=jayson[_0xfbab('0x1')][_0xfbab('0x2')]({'port':0x232b});function request(_0x194e8f,_0x3b594e){return new BPromise(function(_0x223846,_0x2f0e68){return client[_0xfbab('0x3')](_0x194e8f,_0x3b594e)[_0xfbab('0x4')](function(_0x1de36c){if(_0x1de36c[_0xfbab('0x5')]){return _0x2f0e68(_0x1de36c[_0xfbab('0x5')][_0xfbab('0x6')]);}else{return _0x223846(_0x1de36c['result']);}})['catch'](function(_0x4aef13){return _0x2f0e68(_0x4aef13);});});}exports['sendMailMessage']=function(_0x114bfa,_0x40f75c){return request(_0xfbab('0x7'),{'account':_0x114bfa,'message':_0x40f75c});}; \ No newline at end of file +var _0x8b8a=['catch','jayson/promise','client','http','request','then','message','result'];(function(_0x4697bc,_0x405144){var _0x514e25=function(_0x380189){while(--_0x380189){_0x4697bc['push'](_0x4697bc['shift']());}};_0x514e25(++_0x405144);}(_0x8b8a,0x1f1));var _0xa8b8=function(_0x3ac054,_0x3607d2){_0x3ac054=_0x3ac054-0x0;var _0x275fde=_0x8b8a[_0x3ac054];return _0x275fde;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa8b8('0x0'));var client=jayson[_0xa8b8('0x1')][_0xa8b8('0x2')]({'port':0x232b});function request(_0x407df8,_0x42cb84){return new BPromise(function(_0x46ca2c,_0x56e741){return client[_0xa8b8('0x3')](_0x407df8,_0x42cb84)[_0xa8b8('0x4')](function(_0x440ae8){if(_0x440ae8['error']){return _0x56e741(_0x440ae8['error'][_0xa8b8('0x5')]);}else{return _0x46ca2c(_0x440ae8[_0xa8b8('0x6')]);}})[_0xa8b8('0x7')](function(_0x4e1518){return _0x56e741(_0x4e1518);});});}exports['sendMailMessage']=function(_0x34fbd0,_0x1acd5a){return request('SendMail',{'account':_0x34fbd0,'message':_0x1acd5a});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 9b8a939..ade4478 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 _0x82eb=['agi','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','start','debug','root','stringify','joinAt','format','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','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','code','result','response','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','traverseBFS','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','extension','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','../../config/logger'];(function(_0x623028,_0x5c3eb7){var _0x5ca7c6=function(_0x3f36cb){while(--_0x3f36cb){_0x623028['push'](_0x623028['shift']());}};_0x5ca7c6(++_0x5c3eb7);}(_0x82eb,0x1a7));var _0xb82e=function(_0x59fa58,_0x413f19){_0x59fa58=_0x59fa58-0x0;var _0x4aca81=_0x82eb[_0x59fa58];return _0x4aca81;};'use strict';var _=require(_0xb82e('0x0'));var moment=require(_0xb82e('0x1'));var parser=require(_0xb82e('0x2'));var util=require('util');var logger=require(_0xb82e('0x3'))(_0xb82e('0x4'));var rpc=require(_0xb82e('0x5'));var mailRpc=require(_0xb82e('0x6'));var Graph=require(_0xb82e('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb82e('0x8')]()[_0xb82e('0x9')](function(_0x162164){logger[_0xb82e('0xa')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x162164['stack']);return[];});}function addVertex(_0x2f84d4,_0x4702b8,_0x3b34f0){_0x4702b8[_0xb82e('0xb')]=_0x3b34f0;if(_0x4702b8[_0xb82e('0xc')](_0xb82e('0xd'))){_0x4702b8[_0xb82e('0xe')]=parseInt(_0x4702b8[_0xb82e('0xd')],0xa);}_0x2f84d4[_0xb82e('0xf')](_[_0xb82e('0x10')](_0x4702b8,_0xb82e('0x11')));}function initGraph(_0x2d8a09,_0x2f149b){var _0x48af4f=new Graph();for(var _0x7294f6 in _0x2d8a09){if(_0x2d8a09[_0xb82e('0xc')](_0x7294f6)){if(_[_0xb82e('0x12')](_0x2d8a09[_0x7294f6])){for(var _0x1673cf=0x0;_0x1673cf<_0x2d8a09[_0x7294f6][_0xb82e('0x13')];_0x1673cf+=0x1){addVertex(_0x48af4f,_0x2d8a09[_0x7294f6][_0x1673cf],_0x7294f6);}}else{addVertex(_0x48af4f,_0x2d8a09[_0x7294f6],_0x7294f6);}}}for(var _0x4629cd=0x0;_0x4629cd<_0x2f149b[_0xb82e('0x13')];_0x4629cd+=0x1){if(_0x2f149b[_0x4629cd][_0xb82e('0x14')]&&_0x2f149b[_0x4629cd][_0xb82e('0x15')]){_0x48af4f[_0xb82e('0x16')](_0x2f149b[_0x4629cd]['source'],_0x2f149b[_0x4629cd][_0xb82e('0x15')],_0x2f149b[_0x4629cd][_0xb82e('0x17')]);}}return _0x48af4f;}function getRoot(_0x39102f){return parser[_0xb82e('0x18')](_0x39102f,{'object':!![]})[_0xb82e('0x19')]['root'];}function inspect(_0x2395d9){return util['inspect'](_0x2395d9,{'showHidden':![],'depth':null});}function initialize(_0x352971,_0x506cc4){var _0x3bf03d=getRoot(_0x352971['production']);if(!_0x3bf03d||!_0x3bf03d[_0xb82e('0x1a')])return;var _0x4d6dd6,_0x132640,_0x221175;logger[_0xb82e('0x1b')](_0xb82e('0x1c'),JSON[_0xb82e('0x1d')](_0x3bf03d,null,0x2));_0x506cc4[_0xb82e('0x1e')]=moment()[_0xb82e('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d6dd6=initGraph(_['omit'](_0x3bf03d,_0xb82e('0x11')),_0x3bf03d[_0xb82e('0x11')]);_0x132640=new Vertices(_0x506cc4,rpc,mailRpc);logger[_0xb82e('0x20')](util[_0xb82e('0x1f')](_0xb82e('0x21'),_0x506cc4[_0xb82e('0x22')],_0x506cc4[_0xb82e('0x23')],_0x506cc4[_0xb82e('0x24')],_0x506cc4[_0xb82e('0x25')],_0x506cc4['uniqueid']));_0x4d6dd6['traverseBFS'](_0x3bf03d[_0xb82e('0x1a')]['id'],function(_0x8c9f3e){try{_0x8c9f3e=_0x132640[_0xb82e('0x26')](_0x8c9f3e);logger[_0xb82e('0x1b')](_0xb82e('0x27'),JSON['stringify'](_0x8c9f3e,null,0x2));if(_0x8c9f3e[_0xb82e('0xb')]===_0xb82e('0x28')){logger[_0xb82e('0x20')](_0xb82e('0x29'));_0x506cc4[_0xb82e('0x2a')]=_0x8c9f3e[_0xb82e('0x2a')]||_0x506cc4[_0xb82e('0x2a')];_0x506cc4['extension']=_0x8c9f3e['extension'];_0x506cc4[_0xb82e('0x2b')]=_0x8c9f3e[_0xb82e('0x2b')]?_0x8c9f3e[_0xb82e('0x2b')]-0x1:0x1;return null;}else if(_0x8c9f3e&&_0x132640[_0x8c9f3e[_0xb82e('0xb')]]){_0x221175=_0x132640[_0x8c9f3e[_0xb82e('0xb')]](_0x8c9f3e);logger[_0xb82e('0x20')]('response',JSON[_0xb82e('0x1d')](_0x221175,null,0x2));if(_0x221175&&_0x221175[_0xb82e('0x2c')]===AGI_CODE_SUCCESS&&_0x221175[_0xb82e('0x2d')]!==AGI_RESULT_ERROR&&!_0x506cc4['evtHangup']){logger[_0xb82e('0x1b')](_0xb82e('0x2e'),inspect(_0x221175));return _['isUndefined'](_0x221175[_0xb82e('0x2d')])?null:_0x221175['result'][_0xb82e('0x2f')]();}else{logger['error'](_0xb82e('0x2e'),inspect(_0x221175));return null;}}else{logger[_0xb82e('0xa')](_0xb82e('0x30'));return null;}}catch(_0x42ee12){logger[_0xb82e('0xa')](_0x42ee12[_0xb82e('0x31')]);return null;}});if(_0x3bf03d[_0xb82e('0x32')]){logger['info'](util[_0xb82e('0x1f')](_0xb82e('0x33'),_0x506cc4[_0xb82e('0x22')],_0x506cc4[_0xb82e('0x23')],_0x506cc4['callerid'],_0x506cc4[_0xb82e('0x25')],_0x506cc4[_0xb82e('0x34')]));_0x4d6dd6[_0xb82e('0x35')](_0x3bf03d[_0xb82e('0x32')]['id'],function(_0xf08379){try{_0xf08379=_0x132640[_0xb82e('0x26')](_0xf08379);logger['debug']('vertex',JSON[_0xb82e('0x1d')](_0xf08379,null,0x2));if(_0xf08379&&_0x132640[_0xf08379[_0xb82e('0xb')]]){_0x221175=_0x132640[_0xf08379[_0xb82e('0xb')]](_0xf08379);if(_0x221175){logger['debug'](_0xb82e('0x2e'),inspect(_0x221175));return _[_0xb82e('0x36')](_0x221175[_0xb82e('0x2d')])?null:_0x221175['result'][_0xb82e('0x2f')]();}else{logger[_0xb82e('0xa')](_0xb82e('0x2e'),inspect(_0x221175));return null;}}else{logger['error'](_0xb82e('0x30'));return null;}}catch(_0x5a02b0){logger[_0xb82e('0xa')](_0x5a02b0['stack']);return null;}});}logger['info'](util[_0xb82e('0x1f')](_0xb82e('0x37'),_0x506cc4[_0xb82e('0x22')],_0x506cc4[_0xb82e('0x23')],_0x506cc4[_0xb82e('0x24')],_0x506cc4['dnid'],_0x506cc4['uniqueid']));logger['info'](util[_0xb82e('0x1f')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x506cc4[_0xb82e('0x2a')],_0x506cc4['extension'],parseInt(_0x506cc4[_0xb82e('0x2b')],0xa)+0x1));_0x506cc4[_0xb82e('0x38')](_0x506cc4[_0xb82e('0x2a')],_0x506cc4[_0xb82e('0x39')],parseInt(_0x506cc4[_0xb82e('0x2b')],0xa)+0x1);_0x506cc4[_0xb82e('0x3a')]();}function handleNotFound(_0x18810a){logger[_0xb82e('0xa')](util[_0xb82e('0x1f')]('Project\x20%s\x20not\x20found',_0x18810a['arg_1']));_0x18810a['continueAt'](_0x18810a[_0xb82e('0x2a')],_0x18810a[_0xb82e('0x39')],parseInt(_0x18810a[_0xb82e('0x2b')],0xa)+0x1);_0x18810a[_0xb82e('0x3a')]();}function handleUnpublished(_0x561807){logger[_0xb82e('0xa')](util['format'](_0xb82e('0x3b'),_0x561807[_0xb82e('0x22')]));_0x561807[_0xb82e('0x38')](_0x561807[_0xb82e('0x2a')],_0x561807[_0xb82e('0x39')],parseInt(_0x561807[_0xb82e('0x2b')],0xa)+0x1);_0x561807[_0xb82e('0x3a')]();}module[_0xb82e('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x78aa=['maxRetry','addVertex','omit','mxCell','length','source','addEdge','value','toJson','mxGraphModel','production','debug','root','stringify','joinAt','format','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','uniqueid','traverseBFS','start','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','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','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','continueAt','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','../../config/logger','./rpc','./mailRpc','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry'];(function(_0x3d14f8,_0x4f3d1b){var _0x5a870f=function(_0x520f01){while(--_0x520f01){_0x3d14f8['push'](_0x3d14f8['shift']());}};_0x5a870f(++_0x4f3d1b);}(_0x78aa,0x9e));var _0xa78a=function(_0x562013,_0x440669){_0x562013=_0x562013-0x0;var _0x25b999=_0x78aa[_0x562013];return _0x25b999;};'use strict';var _=require(_0xa78a('0x0'));var moment=require(_0xa78a('0x1'));var parser=require(_0xa78a('0x2'));var util=require('util');var logger=require(_0xa78a('0x3'))('agi');var rpc=require(_0xa78a('0x4'));var mailRpc=require(_0xa78a('0x5'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xa78a('0x6')]()['catch'](function(_0x30bb41){logger[_0xa78a('0x7')](_0xa78a('0x8'),_0x30bb41[_0xa78a('0x9')]);return[];});}function addVertex(_0x597e61,_0x2d5c60,_0x1ecf02){_0x2d5c60[_0xa78a('0xa')]=_0x1ecf02;if(_0x2d5c60[_0xa78a('0xb')](_0xa78a('0xc'))){_0x2d5c60[_0xa78a('0xd')]=parseInt(_0x2d5c60[_0xa78a('0xc')],0xa);}_0x597e61[_0xa78a('0xe')](_[_0xa78a('0xf')](_0x2d5c60,_0xa78a('0x10')));}function initGraph(_0x39879e,_0x44ee02){var _0x311a9c=new Graph();for(var _0x54b3da in _0x39879e){if(_0x39879e[_0xa78a('0xb')](_0x54b3da)){if(_['isArray'](_0x39879e[_0x54b3da])){for(var _0x2f50fa=0x0;_0x2f50fa<_0x39879e[_0x54b3da][_0xa78a('0x11')];_0x2f50fa+=0x1){addVertex(_0x311a9c,_0x39879e[_0x54b3da][_0x2f50fa],_0x54b3da);}}else{addVertex(_0x311a9c,_0x39879e[_0x54b3da],_0x54b3da);}}}for(var _0x44af07=0x0;_0x44af07<_0x44ee02[_0xa78a('0x11')];_0x44af07+=0x1){if(_0x44ee02[_0x44af07][_0xa78a('0x12')]&&_0x44ee02[_0x44af07]['target']){_0x311a9c[_0xa78a('0x13')](_0x44ee02[_0x44af07][_0xa78a('0x12')],_0x44ee02[_0x44af07]['target'],_0x44ee02[_0x44af07][_0xa78a('0x14')]);}}return _0x311a9c;}function getRoot(_0x1fea62){return parser[_0xa78a('0x15')](_0x1fea62,{'object':!![]})[_0xa78a('0x16')]['root'];}function inspect(_0x615849){return util['inspect'](_0x615849,{'showHidden':![],'depth':null});}function initialize(_0x4b0bae,_0xbc95e7){var _0x3917ea=getRoot(_0x4b0bae[_0xa78a('0x17')]);if(!_0x3917ea||!_0x3917ea['start'])return;var _0x4c3633,_0x4638ca,_0x4079c9;logger[_0xa78a('0x18')](_0xa78a('0x19'),JSON[_0xa78a('0x1a')](_0x3917ea,null,0x2));_0xbc95e7[_0xa78a('0x1b')]=moment()[_0xa78a('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c3633=initGraph(_[_0xa78a('0xf')](_0x3917ea,'mxCell'),_0x3917ea['mxCell']);_0x4638ca=new Vertices(_0xbc95e7,rpc,mailRpc);logger[_0xa78a('0x1d')](util['format'](_0xa78a('0x1e'),_0xbc95e7[_0xa78a('0x1f')],_0xbc95e7[_0xa78a('0x20')],_0xbc95e7[_0xa78a('0x21')],_0xbc95e7[_0xa78a('0x22')],_0xbc95e7[_0xa78a('0x23')]));_0x4c3633[_0xa78a('0x24')](_0x3917ea[_0xa78a('0x25')]['id'],function(_0x4e520a){try{_0x4e520a=_0x4638ca[_0xa78a('0x26')](_0x4e520a);logger[_0xa78a('0x18')](_0xa78a('0x27'),JSON[_0xa78a('0x1a')](_0x4e520a,null,0x2));if(_0x4e520a[_0xa78a('0xa')]==='gotoc'){logger[_0xa78a('0x1d')](_0xa78a('0x28'));_0xbc95e7[_0xa78a('0x29')]=_0x4e520a[_0xa78a('0x29')]||_0xbc95e7[_0xa78a('0x29')];_0xbc95e7[_0xa78a('0x2a')]=_0x4e520a[_0xa78a('0x2a')];_0xbc95e7[_0xa78a('0x2b')]=_0x4e520a['priority']?_0x4e520a['priority']-0x1:0x1;return null;}else if(_0x4e520a&&_0x4638ca[_0x4e520a['agicommand']]){_0x4079c9=_0x4638ca[_0x4e520a['agicommand']](_0x4e520a);logger[_0xa78a('0x1d')]('response',JSON[_0xa78a('0x1a')](_0x4079c9,null,0x2));if(_0x4079c9&&_0x4079c9[_0xa78a('0x2c')]===AGI_CODE_SUCCESS&&_0x4079c9[_0xa78a('0x2d')]!==AGI_RESULT_ERROR&&!_0xbc95e7[_0xa78a('0x2e')]){logger[_0xa78a('0x18')](_0xa78a('0x2f'),inspect(_0x4079c9));return _['isUndefined'](_0x4079c9[_0xa78a('0x2d')])?null:_0x4079c9[_0xa78a('0x2d')][_0xa78a('0x30')]();}else{logger['error'](_0xa78a('0x2f'),inspect(_0x4079c9));return null;}}else{logger[_0xa78a('0x7')](_0xa78a('0x31'));return null;}}catch(_0x5b0567){logger[_0xa78a('0x7')](_0x5b0567['stack']);return null;}});if(_0x3917ea[_0xa78a('0x32')]){logger[_0xa78a('0x1d')](util[_0xa78a('0x1c')](_0xa78a('0x33'),_0xbc95e7[_0xa78a('0x1f')],_0xbc95e7[_0xa78a('0x20')],_0xbc95e7[_0xa78a('0x21')],_0xbc95e7[_0xa78a('0x22')],_0xbc95e7[_0xa78a('0x23')]));_0x4c3633[_0xa78a('0x24')](_0x3917ea[_0xa78a('0x32')]['id'],function(_0x4ea8d9){try{_0x4ea8d9=_0x4638ca[_0xa78a('0x26')](_0x4ea8d9);logger[_0xa78a('0x18')](_0xa78a('0x27'),JSON[_0xa78a('0x1a')](_0x4ea8d9,null,0x2));if(_0x4ea8d9&&_0x4638ca[_0x4ea8d9[_0xa78a('0xa')]]){_0x4079c9=_0x4638ca[_0x4ea8d9['agicommand']](_0x4ea8d9);if(_0x4079c9){logger['debug'](_0xa78a('0x2f'),inspect(_0x4079c9));return _['isUndefined'](_0x4079c9['result'])?null:_0x4079c9[_0xa78a('0x2d')]['toString']();}else{logger['error'](_0xa78a('0x2f'),inspect(_0x4079c9));return null;}}else{logger['error'](_0xa78a('0x31'));return null;}}catch(_0x5e380a){logger[_0xa78a('0x7')](_0x5e380a[_0xa78a('0x9')]);return null;}});}logger['info'](util[_0xa78a('0x1c')](_0xa78a('0x34'),_0xbc95e7[_0xa78a('0x1f')],_0xbc95e7[_0xa78a('0x20')],_0xbc95e7[_0xa78a('0x21')],_0xbc95e7[_0xa78a('0x22')],_0xbc95e7['uniqueid']));logger['info'](util[_0xa78a('0x1c')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xbc95e7[_0xa78a('0x29')],_0xbc95e7[_0xa78a('0x2a')],parseInt(_0xbc95e7['priority'],0xa)+0x1));_0xbc95e7['continueAt'](_0xbc95e7[_0xa78a('0x29')],_0xbc95e7['extension'],parseInt(_0xbc95e7[_0xa78a('0x2b')],0xa)+0x1);_0xbc95e7[_0xa78a('0x35')]();}function handleNotFound(_0x1abf88){logger[_0xa78a('0x7')](util[_0xa78a('0x1c')]('Project\x20%s\x20not\x20found',_0x1abf88[_0xa78a('0x1f')]));_0x1abf88[_0xa78a('0x36')](_0x1abf88[_0xa78a('0x29')],_0x1abf88[_0xa78a('0x2a')],parseInt(_0x1abf88[_0xa78a('0x2b')],0xa)+0x1);_0x1abf88['close']();}function handleUnpublished(_0x141c46){logger[_0xa78a('0x7')](util[_0xa78a('0x1c')](_0xa78a('0x37'),_0x141c46[_0xa78a('0x1f')]));_0x141c46[_0xa78a('0x36')](_0x141c46['context'],_0x141c46[_0xa78a('0x2a')],parseInt(_0x141c46[_0xa78a('0x2b')],0xa)+0x1);_0x141c46['close']();}module[_0xa78a('0x38')]={'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 56e863d..17d74de 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 _0x1d5d=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','call','_localBuffer','_inBody','inherits'];(function(_0x1ea269,_0x36173){var _0x4743ee=function(_0x42b67d){while(--_0x42b67d){_0x1ea269['push'](_0x1ea269['shift']());}};_0x4743ee(++_0x36173);}(_0x1d5d,0x19e));var _0xd1d5=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x1d5d[_0x4c7fb5];return _0x2e10ac;};'use strict';var util=require(_0xd1d5('0x0'));var Transform=require(_0xd1d5('0x1'))['Transform'];function AGIReply(_0x151f03){Transform[_0xd1d5('0x2')](this,_0x151f03);this[_0xd1d5('0x3')]='';this[_0xd1d5('0x4')]=![];}util[_0xd1d5('0x5')](AGIReply,Transform);AGIReply[_0xd1d5('0x6')][_0xd1d5('0x7')]=function(_0x4d39d4,_0xe9f4c8,_0x54c1f9){var _0x2e91d2='\x0a',_0x4c6747=['\x0a\x0a',_0xd1d5('0x8')],_0x31adc3=-0x1,_0x53fd31=-0x1,_0x5767db='',_0x474672=0x0,_0x4df4a1='',_0x2c7960='';this['_localBuffer']+=_0x4d39d4[_0xd1d5('0x9')]();_0x4df4a1=this['_localBuffer'];if(!this['_inBody']){_0x474672=0x0;while(_0x4c6747[_0x474672]){while((_0x53fd31=_0x4df4a1[_0xd1d5('0xa')](_0x4c6747[_0x474672]))!=-0x1){_0x5767db=_0x4c6747[_0x474672];_0x2c7960=_0x4df4a1[_0xd1d5('0xb')](0x0,_0x53fd31);_0x4df4a1=_0x4df4a1['substring'](_0x53fd31+_0x5767db[_0xd1d5('0xc')]);var _0x3cab52=_0x2c7960[_0xd1d5('0xd')](_0x2e91d2),_0xd1efb5=0x0,_0x5ed38d={},_0x32258e='',_0x2383eb='',_0x4c99d1=-0x1;while(_0x3cab52[_0xd1efb5]){_0x4c99d1=_0x3cab52[_0xd1efb5]['indexOf'](':');if(_0x4c99d1!=-0x1){_0x32258e=_0x3cab52[_0xd1efb5][_0xd1d5('0xe')](0x0,_0x4c99d1)[_0xd1d5('0xf')]();_0x2383eb=_0x3cab52[_0xd1efb5][_0xd1d5('0xe')](_0x4c99d1+0x1)[_0xd1d5('0xf')]();if(_0x32258e[_0xd1d5('0xc')]>0x0){_0x5ed38d[_0x32258e]=_0x2383eb;}}else{}_0xd1efb5++;}this[_0xd1d5('0x10')](_0xd1d5('0x11'),_0x5ed38d);this[_0xd1d5('0x4')]=!![];}_0x474672++;}this['_localBuffer']=_0x4df4a1;}else{while((_0x31adc3=_0x4df4a1[_0xd1d5('0xa')](_0x2e91d2))!=-0x1){_0x2c7960=_0x4df4a1[_0xd1d5('0xb')](0x0,_0x31adc3);this[_0xd1d5('0x10')](_0xd1d5('0x12'),_0x2c7960);_0x4df4a1=_0x4df4a1[_0xd1d5('0xb')](_0x31adc3+_0x2e91d2[_0xd1d5('0xc')]);}this[_0xd1d5('0x3')]=_0x4df4a1;}_0x54c1f9();};module[_0xd1d5('0x13')]=AGIReply; \ No newline at end of file +var _0x1b1d=['trim','emit','line','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','toString','substring','length','indexOf','slice'];(function(_0x5a42f3,_0x17b7db){var _0x1085fa=function(_0x169725){while(--_0x169725){_0x5a42f3['push'](_0x5a42f3['shift']());}};_0x1085fa(++_0x17b7db);}(_0x1b1d,0x19c));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd1b1('0x0'));var Transform=require(_0xd1b1('0x1'))[_0xd1b1('0x2')];function AGIReply(_0x6ed995){Transform['call'](this,_0x6ed995);this[_0xd1b1('0x3')]='';this[_0xd1b1('0x4')]=![];}util[_0xd1b1('0x5')](AGIReply,Transform);AGIReply[_0xd1b1('0x6')][_0xd1b1('0x7')]=function(_0x246c9c,_0x546d7e,_0x13eef2){var _0x34e530='\x0a',_0x1d2465=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4ed4d2=-0x1,_0x52f3b9=-0x1,_0x4e4760='',_0x208314=0x0,_0x4c6810='',_0x4121a1='';this[_0xd1b1('0x3')]+=_0x246c9c[_0xd1b1('0x8')]();_0x4c6810=this['_localBuffer'];if(!this[_0xd1b1('0x4')]){_0x208314=0x0;while(_0x1d2465[_0x208314]){while((_0x52f3b9=_0x4c6810['indexOf'](_0x1d2465[_0x208314]))!=-0x1){_0x4e4760=_0x1d2465[_0x208314];_0x4121a1=_0x4c6810[_0xd1b1('0x9')](0x0,_0x52f3b9);_0x4c6810=_0x4c6810['substring'](_0x52f3b9+_0x4e4760[_0xd1b1('0xa')]);var _0x38f8c8=_0x4121a1['split'](_0x34e530),_0x138751=0x0,_0x488af8={},_0x27933d='',_0x462ac8='',_0x4b90a8=-0x1;while(_0x38f8c8[_0x138751]){_0x4b90a8=_0x38f8c8[_0x138751][_0xd1b1('0xb')](':');if(_0x4b90a8!=-0x1){_0x27933d=_0x38f8c8[_0x138751][_0xd1b1('0xc')](0x0,_0x4b90a8)['trim']();_0x462ac8=_0x38f8c8[_0x138751][_0xd1b1('0xc')](_0x4b90a8+0x1)[_0xd1b1('0xd')]();if(_0x27933d[_0xd1b1('0xa')]>0x0){_0x488af8[_0x27933d]=_0x462ac8;}}else{}_0x138751++;}this[_0xd1b1('0xe')]('headers',_0x488af8);this[_0xd1b1('0x4')]=!![];}_0x208314++;}this[_0xd1b1('0x3')]=_0x4c6810;}else{while((_0x4ed4d2=_0x4c6810[_0xd1b1('0xb')](_0x34e530))!=-0x1){_0x4121a1=_0x4c6810[_0xd1b1('0x9')](0x0,_0x4ed4d2);this[_0xd1b1('0xe')](_0xd1b1('0xf'),_0x4121a1);_0x4c6810=_0x4c6810[_0xd1b1('0x9')](_0x4ed4d2+_0x34e530[_0xd1b1('0xa')]);}this[_0xd1b1('0x3')]=_0x4c6810;}_0x13eef2();};module[_0xd1b1('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f3df715..449009e 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 _0xf4d9=['getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','name','production'];(function(_0xb99145,_0x3ecd24){var _0x2350a2=function(_0x589948){while(--_0x589948){_0xb99145['push'](_0xb99145['shift']());}};_0x2350a2(++_0x3ecd24);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x397f28,_0x4368a7){_0x397f28=_0x397f28-0x0;var _0x47659c=_0xf4d9[_0x397f28];return _0x47659c;};'use strict';var _=require(_0x9f4d('0x0'));var moment=require('moment');var jayson=require(_0x9f4d('0x1'));var client=jayson[_0x9f4d('0x2')][_0x9f4d('0x3')]({'port':0x2329});function request(_0x41bd00,_0x22339e){return new Promise(function(_0x47aa76,_0x179d90){return client[_0x9f4d('0x4')](_0x41bd00,_0x22339e)[_0x9f4d('0x5')](function(_0x4e9452){if(_0x4e9452[_0x9f4d('0x6')]){return _0x179d90(_0x4e9452[_0x9f4d('0x6')][_0x9f4d('0x7')]);}else{return _0x47aa76(_0x4e9452['result']);}})[_0x9f4d('0x8')](function(_0x55865b){return _0x179d90(_0x55865b);});});}exports[_0x9f4d('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x9f4d('0xa'),_0x9f4d('0xb')]}});};exports[_0x9f4d('0xc')]=function(_0x4311f4){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4311f4},'attributes':[_0x9f4d('0xb')]}});};exports[_0x9f4d('0xd')]=function(_0x474cc6){return request(_0x9f4d('0xe'),{'options':{'raw':![],'where':{'id':_0x474cc6},'include':[{'model':_0x9f4d('0xf'),'as':_0x9f4d('0x10'),'include':[{'model':_0x9f4d('0x11'),'as':_0x9f4d('0x11')}]}],'attributes':['id',_0x9f4d('0xa'),_0x9f4d('0x12')],'smtp':!![]}});};exports[_0x9f4d('0x13')]=function(_0x479cb4){return request(_0x9f4d('0x14'),{'options':{'where':{'id':_0x479cb4},'attributes':[_0x9f4d('0xa')]}});};exports[_0x9f4d('0x15')]=function(_0x581e17){return request(_0x9f4d('0x16'),{'options':{'where':{'id':_0x581e17},'attributes':[_0x9f4d('0xa')]}});};exports[_0x9f4d('0x17')]=function(_0x178d8e){return request('ShowVariable',{'options':{'where':{'id':_0x178d8e},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x2af958){return request(_0x9f4d('0x18'),{'options':{'where':{'id':_0x2af958},'attributes':[_0x9f4d('0x19')]}});};exports[_0x9f4d('0x1a')]=function(_0x214195){return request(_0x9f4d('0x1b'),{'options':{'where':{'id':_0x214195},'attributes':['name']}});};exports[_0x9f4d('0x1c')]=function(_0x3e0b7d){return request(_0x9f4d('0x1d'),{'options':{'where':{'phone':_0x3e0b7d[_0x9f4d('0x1e')]},'attributes':['id']}});};exports[_0x9f4d('0x1f')]=function(_0x566d56){return request(_0x9f4d('0x20'),{'options':{'where':{'id':_0x566d56},'attributes':[_0x9f4d('0xa')]}});};exports[_0x9f4d('0x21')]=function(_0x2145b7){return request(_0x9f4d('0x22'),{'options':{'where':{'id':_0x2145b7},'attributes':[_0x9f4d('0x23')]}});};exports[_0x9f4d('0x24')]=function(_0x3917ec){return request(_0x9f4d('0x25'),{'options':{'raw':![],'where':{'id':_0x3917ec},'include':[{'model':_0x9f4d('0x26'),'as':'Intervals'}]}});};exports[_0x9f4d('0x27')]=function(_0xc4fd4){return request(_0x9f4d('0x28'),{'options':{'where':{'id':_0xc4fd4},'attributes':['id','name']}});};exports[_0x9f4d('0x29')]=function(_0xa900ce){return request(_0x9f4d('0x2a'),{'body':_0xa900ce});};exports[_0x9f4d('0x2b')]=function(_0xa57a55){return request(_0x9f4d('0x2c'),{'body':_0xa57a55});};exports[_0x9f4d('0x2d')]=function(_0x366908){return request(_0x9f4d('0x2e'),{'body':_[_0x9f4d('0x2f')](_0x366908,{'project_name':_0x366908[_0x9f4d('0x30')],'prev_project_name':_0x366908[_0x9f4d('0x31')]||'','is_subproject':_0x366908[_0x9f4d('0x31')]?!![]:![],'leaveAt':moment()['format'](_0x9f4d('0x32'))})});};exports[_0x9f4d('0x33')]=function(_0x111a87){return request(_0x9f4d('0x34'),{'body':_0x111a87});};exports[_0x9f4d('0x35')]=function(_0x3f27d7){return request(_0x9f4d('0x36'),{'body':_0x3f27d7});};exports['createCmContact']=function(_0x4eb918){return request(_0x9f4d('0x37'),{'options':{'raw':![],'where':{'phone':_0x4eb918['phone'],'ListId':_0x4eb918[_0x9f4d('0x38')]}}})['then'](function(_0x1f0928){if(_0x1f0928){return _0x1f0928;}return request(_0x9f4d('0x39'),{'body':_0x4eb918});});};exports[_0x9f4d('0x3a')]=function(_0x47cdb6){return request(_0x9f4d('0x3b'),{'options':{'where':{'id':_0x47cdb6},'attributes':['name']}});};exports[_0x9f4d('0x3c')]=function(_0x4d66e7,_0x582e9a){return request(_0x9f4d('0x3d'),{'body':{'interface':_0x582e9a},'options':{'where':_0x4d66e7}});};exports[_0x9f4d('0x3e')]=function(_0x2731c5,_0x3f79ca,_0x2a050f){return request(_0x9f4d('0x3f'),{'body':{'type':_0x3f79ca,'uniqueid':_0x2a050f},'options':{'where':_0x2731c5}});};exports[_0x9f4d('0x40')]=function(_0x531577){return request(_0x9f4d('0x41'),{'body':{},'options':{'where':_0x531577}});};exports[_0x9f4d('0x42')]=function(_0xcb4166){return request(_0x9f4d('0x43'),{'body':{},'options':{'where':_0xcb4166}});}; \ No newline at end of file +var _0x4abf=['CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','client','error','message','catch','GetSquareProjects','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','ListId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4abf,0xac));var _0xf4ab=function(_0x4580b0,_0x1f3173){_0x4580b0=_0x4580b0-0x0;var _0x5464f6=_0x4abf[_0x4580b0];return _0x5464f6;};'use strict';var _=require(_0xf4ab('0x0'));var moment=require(_0xf4ab('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xf4ab('0x2')]['http']({'port':0x2329});function request(_0x486ba3,_0x505988){return new Promise(function(_0xd3da82,_0x4599f6){return client['request'](_0x486ba3,_0x505988)['then'](function(_0x1f141a){if(_0x1f141a[_0xf4ab('0x3')]){return _0x4599f6(_0x1f141a[_0xf4ab('0x3')][_0xf4ab('0x4')]);}else{return _0xd3da82(_0x1f141a['result']);}})[_0xf4ab('0x5')](function(_0x3c7b8b){return _0x4599f6(_0x3c7b8b);});});}exports['getSquareProjects']=function(){return request(_0xf4ab('0x6'),{'options':{'raw':![],'attributes':['id','name',_0xf4ab('0x7')]}});};exports[_0xf4ab('0x8')]=function(_0x17a9a3){return request(_0xf4ab('0x9'),{'options':{'raw':![],'where':{'name':_0x17a9a3},'attributes':[_0xf4ab('0x7')]}});};exports[_0xf4ab('0xa')]=function(_0x4516bf){return request(_0xf4ab('0xb'),{'options':{'raw':![],'where':{'id':_0x4516bf},'include':[{'model':_0xf4ab('0xc'),'as':_0xf4ab('0xd'),'include':[{'model':_0xf4ab('0xe'),'as':_0xf4ab('0xe')}]}],'attributes':['id',_0xf4ab('0xf'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x17181a){return request(_0xf4ab('0x9'),{'options':{'where':{'id':_0x17181a},'attributes':[_0xf4ab('0xf')]}});};exports[_0xf4ab('0x10')]=function(_0x141d64){return request(_0xf4ab('0x11'),{'options':{'where':{'id':_0x141d64},'attributes':[_0xf4ab('0xf')]}});};exports[_0xf4ab('0x12')]=function(_0x47abb8){return request(_0xf4ab('0x13'),{'options':{'where':{'id':_0x47abb8},'attributes':[_0xf4ab('0xf')]}});};exports[_0xf4ab('0x14')]=function(_0x5d50cb){return request(_0xf4ab('0x15'),{'options':{'where':{'id':_0x5d50cb},'attributes':[_0xf4ab('0x16')]}});};exports['getUserById']=function(_0x196ea7){return request(_0xf4ab('0x17'),{'options':{'where':{'id':_0x196ea7},'attributes':[_0xf4ab('0xf')]}});};exports[_0xf4ab('0x18')]=function(_0x2d0d4d){return request(_0xf4ab('0x19'),{'options':{'where':{'phone':_0x2d0d4d[_0xf4ab('0x1a')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4d8753){return request(_0xf4ab('0x1b'),{'options':{'where':{'id':_0x4d8753},'attributes':['name']}});};exports[_0xf4ab('0x1c')]=function(_0x1727af){return request(_0xf4ab('0x1d'),{'options':{'where':{'id':_0x1727af},'attributes':['save_name']}});};exports[_0xf4ab('0x1e')]=function(_0x2fb02d){return request(_0xf4ab('0x1f'),{'options':{'raw':![],'where':{'id':_0x2fb02d},'include':[{'model':_0xf4ab('0x20'),'as':_0xf4ab('0x21')}]}});};exports['getSmsAccountById']=function(_0xf1998f){return request(_0xf4ab('0x22'),{'options':{'where':{'id':_0xf1998f},'attributes':['id',_0xf4ab('0xf')]}});};exports[_0xf4ab('0x23')]=function(_0x152d48){return request(_0xf4ab('0x24'),{'body':_0x152d48});};exports[_0xf4ab('0x25')]=function(_0x5e4442){return request(_0xf4ab('0x26'),{'body':_0x5e4442});};exports['createSquareReport']=function(_0x1fc4b2){return request('CreateSquareReport',{'body':_['merge'](_0x1fc4b2,{'project_name':_0x1fc4b2['arg_1'],'prev_project_name':_0x1fc4b2['arg_2']||'','is_subproject':_0x1fc4b2['arg_2']?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xf4ab('0x27')]=function(_0x9863d1){return request(_0xf4ab('0x28'),{'body':_0x9863d1});};exports[_0xf4ab('0x29')]=function(_0x1efb48){return request('CreateSquareMessage',{'body':_0x1efb48});};exports['createCmContact']=function(_0x325b38){return request(_0xf4ab('0x2a'),{'options':{'raw':![],'where':{'phone':_0x325b38['phone'],'ListId':_0x325b38[_0xf4ab('0x2b')]}}})['then'](function(_0x20482c){if(_0x20482c){return _0x20482c;}return request(_0xf4ab('0x2c'),{'body':_0x325b38});});};exports[_0xf4ab('0x2d')]=function(_0x3d195b){return request(_0xf4ab('0x2e'),{'options':{'where':{'id':_0x3d195b},'attributes':[_0xf4ab('0xf')]}});};exports[_0xf4ab('0x2f')]=function(_0x25d68f,_0x3e49f2){return request(_0xf4ab('0x30'),{'body':{'interface':_0x3e49f2},'options':{'where':_0x25d68f}});};exports[_0xf4ab('0x31')]=function(_0x495612,_0x392417,_0x57a2f5){return request(_0xf4ab('0x32'),{'body':{'type':_0x392417,'uniqueid':_0x57a2f5},'options':{'where':_0x495612}});};exports[_0xf4ab('0x33')]=function(_0x4cad6b){return request('UnpauseUser',{'body':{},'options':{'where':_0x4cad6b}});};exports[_0xf4ab('0x34')]=function(_0x3e1bb5){return request(_0xf4ab('0x35'),{'body':{},'options':{'where':_0x3e1bb5}});}; \ 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 27fd929..8463c01 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 _0xbedb=['./polly','exports'];(function(_0x581ade,_0x106bf0){var _0x2077a0=function(_0x3434f1){while(--_0x3434f1){_0x581ade['push'](_0x581ade['shift']());}};_0x2077a0(++_0x106bf0);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};var polly=require(_0xbbed('0x0'));var lex=require('./lex');module[_0xbbed('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x39e6=['./polly','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39e6,0x9e));var _0x639e=function(_0x5c97c1,_0x682ad4){_0x5c97c1=_0x5c97c1-0x0;var _0x4b4f51=_0x39e6[_0x5c97c1];return _0x4b4f51;};var polly=require(_0x639e('0x0'));var lex=require('./lex');module[_0x639e('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 9ee8ebb..22515b4 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 _0xa9e0=['exports','./lib/api'];(function(_0x31b31b,_0x5f044e){var _0x2c8fc2=function(_0x5438aa){while(--_0x5438aa){_0x31b31b['push'](_0x31b31b['shift']());}};_0x2c8fc2(++_0x5f044e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ 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 6a18241..4e82fd8 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(_0x459a55,_0x1a7ba1){var _0x5c60b1=function(_0x2694cb){while(--_0x2694cb){_0x459a55['push'](_0x459a55['shift']());}};_0x5c60b1(++_0x1a7ba1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x15a4cf,_0x50a55a){var _0x465668=function(_0x11d002){while(--_0x11d002){_0x15a4cf['push'](_0x15a4cf['shift']());}};_0x465668(++_0x50a55a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 7f7a215..94cb6a8 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 _0xb7b9=['./lib/api','exports'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0xb7b9,0xd6));var _0x9b7b=function(_0x2613a4,_0x2a4e82){_0x2613a4=_0x2613a4-0x0;var _0x4e38cd=_0xb7b9[_0x2613a4];return _0x4e38cd;};'use strict';var polly=require(_0x9b7b('0x0'));module[_0x9b7b('0x1')]=function(_0x2ac68e,_0x251be8,_0x333b68,_0x2ca7ce,_0x201aad,_0x258247,_0x382a26){return polly(_0x2ac68e,_0x251be8,_0x333b68,_0x2ca7ce,_0x201aad,_0x258247,_0x382a26);}; \ No newline at end of file +var _0x9130=['./lib/api'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x9130,0xef));var _0x0913=function(_0x515b35,_0x49fdd1){_0x515b35=_0x515b35-0x0;var _0x228874=_0x9130[_0x515b35];return _0x228874;};'use strict';var polly=require(_0x0913('0x0'));module['exports']=function(_0x278f1e,_0x5be011,_0x214873,_0x40aef7,_0x5aafb7,_0xa7ae0f,_0x37469b){return polly(_0x278f1e,_0x5be011,_0x214873,_0x40aef7,_0x5aafb7,_0xa7ae0f,_0x37469b);}; \ 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 375985b..3bf3455 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 _0x2970=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2970,0x1de));var _0x0297=function(_0x19f9b4,_0x1798c5){_0x19f9b4=_0x19f9b4-0x0;var _0x2c535b=_0x2970[_0x19f9b4];return _0x2c535b;};'use strict';var fs=require('fs');var path=require(_0x0297('0x0'));var BPromise=require('bluebird');var rs=require(_0x0297('0x1'));var AWS=require(_0x0297('0x2'));function pollyResult(_0x423812,_0x5565e7,_0xa8bcce){return new BPromise(function(_0x47329f,_0x3a6dd7){_0x423812[_0x0297('0x3')](_0x5565e7,function(_0x110151,_0x600acf){if(_0x110151){_0x3a6dd7(_0x110151);}else if(_0x600acf){if(_0x600acf['AudioStream']instanceof Buffer){fs[_0x0297('0x4')](_0xa8bcce,_0x600acf[_0x0297('0x5')],function(_0xb7f718){if(_0xb7f718){_0x3a6dd7(_0xb7f718);}else{_0x47329f();}});}else{_0x3a6dd7(new Error(_0x0297('0x6')));}}else{_0x3a6dd7(new Error(_0x0297('0x7')));}});});}module[_0x0297('0x8')]=function(_0x2e2d56,_0x43c003,_0x41f19b,_0x11a571,_0x1ac6f5,_0x9ecf14,_0x4713ac){var _0xa656bf=new AWS['Polly']({'accessKeyId':_0x2e2d56,'secretAccessKey':_0x43c003,'region':_0x41f19b});var _0x55fb3c={'Text':_0x1ac6f5,'TextType':_0x9ecf14||_0x0297('0x9'),'OutputFormat':_0x0297('0xa'),'VoiceId':_0x11a571};return pollyResult(_0xa656bf,_0x55fb3c,_0x4713ac);}; \ No newline at end of file +var _0x9af6=['bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x16ea0e,_0x2e3a5e){var _0x211292=function(_0x1683dd){while(--_0x1683dd){_0x16ea0e['push'](_0x16ea0e['shift']());}};_0x211292(++_0x2e3a5e);}(_0x9af6,0x18b));var _0x69af=function(_0x457681,_0x263f93){_0x457681=_0x457681-0x0;var _0x5b955a=_0x9af6[_0x457681];return _0x5b955a;};'use strict';var fs=require('fs');var path=require(_0x69af('0x0'));var BPromise=require(_0x69af('0x1'));var rs=require('randomstring');var AWS=require(_0x69af('0x2'));function pollyResult(_0x17574e,_0x5eb311,_0x1489cd){return new BPromise(function(_0x5766f7,_0x2602d1){_0x17574e[_0x69af('0x3')](_0x5eb311,function(_0x413157,_0x3b782a){if(_0x413157){_0x2602d1(_0x413157);}else if(_0x3b782a){if(_0x3b782a['AudioStream']instanceof Buffer){fs[_0x69af('0x4')](_0x1489cd,_0x3b782a[_0x69af('0x5')],function(_0x50366b){if(_0x50366b){_0x2602d1(_0x50366b);}else{_0x5766f7();}});}else{_0x2602d1(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2602d1(new Error(_0x69af('0x6')));}});});}module[_0x69af('0x7')]=function(_0x2a4a5f,_0x460d2d,_0x31ac83,_0x5bbc83,_0x4f7c62,_0x1e3ad5,_0x414e4e){var _0x49db91=new AWS[(_0x69af('0x8'))]({'accessKeyId':_0x2a4a5f,'secretAccessKey':_0x460d2d,'region':_0x31ac83});var _0x45b245={'Text':_0x4f7c62,'TextType':_0x1e3ad5||_0x69af('0x9'),'OutputFormat':_0x69af('0xa'),'VoiceId':_0x5bbc83};return pollyResult(_0x49db91,_0x45b245,_0x414e4e);}; \ 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 be610fa..6dad708 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 _0xa145=['./lib/api','exports'];(function(_0x3a1ad6,_0x52a9de){var _0x3b87c1=function(_0x4b5ec2){while(--_0x4b5ec2){_0x3a1ad6['push'](_0x3a1ad6['shift']());}};_0x3b87c1(++_0x52a9de);}(_0xa145,0x162));var _0x5a14=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xa145[_0x176329];return _0x31997c;};'use strict';var asr=require(_0x5a14('0x0'));module[_0x5a14('0x1')]=function(_0x37e839,_0x45add1,_0x5370f8,_0x406758){return asr(_0x37e839,_0x45add1,_0x5370f8);}; \ No newline at end of file +var _0xe154=['./lib/api'];(function(_0x73e4cf,_0x2a8375){var _0x1e1bf8=function(_0xca0967){while(--_0xca0967){_0x73e4cf['push'](_0x73e4cf['shift']());}};_0x1e1bf8(++_0x2a8375);}(_0xe154,0x8d));var _0x4e15=function(_0x47623f,_0x148f3a){_0x47623f=_0x47623f-0x0;var _0x282ce8=_0xe154[_0x47623f];return _0x282ce8;};'use strict';var asr=require(_0x4e15('0x0'));module['exports']=function(_0x14fa29,_0x592805,_0x1b5761,_0x3a2d5f){return asr(_0x14fa29,_0x592805,_0x1b5761);}; \ 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 de90021..7d569e6 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 _0x22fb=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com'];(function(_0x27c2b1,_0x39a48c){var _0x423cb6=function(_0x4f0e67){while(--_0x4f0e67){_0x27c2b1['push'](_0x27c2b1['shift']());}};_0x423cb6(++_0x39a48c);}(_0x22fb,0x192));var _0xb22f=function(_0x592723,_0x2f0ec3){_0x592723=_0x592723-0x0;var _0x55a637=_0x22fb[_0x592723];return _0x55a637;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xb22f('0x0');module['exports']=function(_0x3f643d,_0x306b6e,_0x2221f1){return new BPromise(function(_0x10d2c4,_0x201512){var _0x50cdab;if(typeof _0x3f643d!==_0xb22f('0x1')||_0x3f643d[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x3'));}if(typeof _0x306b6e!==_0xb22f('0x1')||_0x306b6e[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x4'));}if(typeof _0x2221f1!=='undefined'&&(typeof _0x2221f1!==_0xb22f('0x1')||_0x2221f1[_0xb22f('0x2')]===0x0)){return _0x201512(_0xb22f('0x5'));}try{_0x50cdab=fs[_0xb22f('0x6')](_0x3f643d)[_0xb22f('0x7')](_0xb22f('0x8'));}catch(_0x188cea){return _0x201512(_0x188cea);}return _0x10d2c4({'method':_0xb22f('0x9'),'uri':host+_0xb22f('0xa')+_0x306b6e,'body':{'config':{'encoding':_0xb22f('0xb'),'sampleRateHertz':_0xb22f('0xc'),'languageCode':_0x2221f1},'audio':{'content':_0x50cdab}},'json':!![]});});}; \ No newline at end of file +var _0x851e=['key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0x851e,0x1e8));var _0xe851=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0x851e[_0x5f42f1];return _0x5534ee;};'use strict';var url=require(_0xe851('0x0'));var BPromise=require(_0xe851('0x1'));var fs=require('fs');var host=_0xe851('0x2');module['exports']=function(_0x506932,_0x122708,_0x11f06b){return new BPromise(function(_0x16b38a,_0x326b34){var _0xe50306;if(typeof _0x506932!=='string'||_0x506932[_0xe851('0x3')]===0x0){return _0x326b34(_0xe851('0x4'));}if(typeof _0x122708!==_0xe851('0x5')||_0x122708[_0xe851('0x3')]===0x0){return _0x326b34(_0xe851('0x6'));}if(typeof _0x11f06b!=='undefined'&&(typeof _0x11f06b!==_0xe851('0x5')||_0x11f06b['length']===0x0)){return _0x326b34('lang\x20should\x20be\x20a\x20string');}try{_0xe50306=fs[_0xe851('0x7')](_0x506932)[_0xe851('0x8')](_0xe851('0x9'));}catch(_0xe0cb8d){return _0x326b34(_0xe0cb8d);}return _0x16b38a({'method':'POST','uri':host+_0xe851('0xa')+_0x122708,'body':{'config':{'encoding':_0xe851('0xb'),'sampleRateHertz':_0xe851('0xc'),'languageCode':_0x11f06b},'audio':{'content':_0xe50306}},'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 3ce73ab..7117471 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 _0xa4f8=['./asr'];(function(_0x4c59c6,_0xf02b50){var _0x38ae55=function(_0x34a10e){while(--_0x34a10e){_0x4c59c6['push'](_0x4c59c6['shift']());}};_0x38ae55(++_0xf02b50);}(_0xa4f8,0x195));var _0x8a4f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa4f8[_0x321bb2];return _0x9c12ed;};var asr=require(_0x8a4f('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x766a=['./asr','exports'];(function(_0x2919d0,_0x40f836){var _0x1db86a=function(_0x4d062e){while(--_0x4d062e){_0x2919d0['push'](_0x2919d0['shift']());}};_0x1db86a(++_0x40f836);}(_0x766a,0xaa));var _0xa766=function(_0x51c52b,_0x147712){_0x51c52b=_0x51c52b-0x0;var _0x581ce3=_0x766a[_0x51c52b];return _0x581ce3;};var asr=require(_0xa766('0x0'));module[_0xa766('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index b545ce3..3219192 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 _0xb50c=['audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','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','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','querystring','request-promise','randomstring','google-tts-api','url','util','./aws','./google','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','info','close','unlink','error','download\x20error','pipe','end','protocol','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input'];(function(_0x1698a4,_0x39a64b){var _0x3b0fcf=function(_0x39a301){while(--_0x39a301){_0x1698a4['push'](_0x1698a4['shift']());}};_0x3b0fcf(++_0x39a64b);}(_0xb50c,0x16a));var _0xcb50=function(_0x5db664,_0x31cfdb){_0x5db664=_0x5db664-0x0;var _0x14fb55=_0xb50c[_0x5db664];return _0x14fb55;};'use strict';var apiai=require(_0xcb50('0x0'));var BPromise=require(_0xcb50('0x1'));var dialogflow=require(_0xcb50('0x2'));var fs=require('fs');var http=require(_0xcb50('0x3'));var https=require('https');var md5=require(_0xcb50('0x4'));var path=require(_0xcb50('0x5'));var querystring=require(_0xcb50('0x6'));var rp=require(_0xcb50('0x7'));var rs=require(_0xcb50('0x8'));var sox=require('sox');var tts=require(_0xcb50('0x9'));var urlParse=require(_0xcb50('0xa'))['parse'];var util=require(_0xcb50('0xb'));var aws=require(_0xcb50('0xc'));var google=require(_0xcb50('0xd'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0xcb50('0xe'))('agi');var ISPEECH_API=_0xcb50('0xf');function downloadFile(_0x569fa9,_0x1bdd6c){return new BPromise(function(_0x1a1b24,_0x91d455){var _0xec4f68=urlParse(_0x569fa9);var _0x3458e0=_0xec4f68['protocol']===_0xcb50('0x10')?https:http;var _0xb79efc={'host':_0xec4f68[_0xcb50('0x11')],'path':_0xec4f68[_0xcb50('0x5')],'headers':{'user-agent':_0xcb50('0x12')}};_0x3458e0[_0xcb50('0x13')](_0xb79efc,function(_0x5a1359){if(_0x5a1359[_0xcb50('0x14')]!==0xc8){logger['error'](_0xcb50('0x15')+_0x569fa9+_0xcb50('0x16')+_0x5a1359[_0xcb50('0x14')]+'\x20('+_0x5a1359[_0xcb50('0x17')]+')');_0x91d455(new Error(_0xcb50('0x15')+_0x569fa9+_0xcb50('0x16')+_0x5a1359[_0xcb50('0x14')]+'\x20('+_0x5a1359[_0xcb50('0x17')]+')'));return;}var _0x35b69b=fs['createWriteStream'](_0x1bdd6c);_0x35b69b['on']('finish',function(){logger[_0xcb50('0x18')]('finish\x20download\x20file');_0x35b69b[_0xcb50('0x19')](_0x1a1b24);});_0x35b69b['on']('error',function(_0x216163){fs[_0xcb50('0x1a')](_0x1bdd6c);logger[_0xcb50('0x1b')](_0xcb50('0x1c'),_0x216163);_0x91d455(_0x216163);});_0x5a1359[_0xcb50('0x1d')](_0x35b69b);})['on']('error',function(_0x4e5faf){logger[_0xcb50('0x1b')](_0x4e5faf);_0x91d455(_0x4e5faf);})[_0xcb50('0x1e')]();});}function uploadFile(_0x269a03){return new BPromise(function(_0x3a01b7,_0x448ae5){var _0x5d5c03=urlParse(_0x269a03);var _0x102787=_0x5d5c03[_0xcb50('0x1f')]==='https:'?https:http;var _0x32367c={'host':_0x5d5c03['host'],'path':_0x5d5c03[_0xcb50('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x102787['get'](_0x32367c,function(_0x2dcb8c){if(_0x2dcb8c[_0xcb50('0x14')]!==0xc8){_0x448ae5(new Error(_0xcb50('0x15')+_0x269a03+_0xcb50('0x16')+_0x2dcb8c[_0xcb50('0x14')]+'\x20('+_0x2dcb8c[_0xcb50('0x17')]+')'));return;}var _0xf16e25='';_0x2dcb8c['on']('data',function(_0x1fef6b){_0xf16e25+=_0x1fef6b;});_0x2dcb8c['on'](_0xcb50('0x1e'),function(){_0x3a01b7(_0xf16e25);});})['on'](_0xcb50('0x1b'),function(_0x14046a){_0x448ae5(_0x14046a);})['end']();});}function convertFile(_0x45b3bd,_0x48b851){return new BPromise(function(_0x23c288,_0x38326b){var _0x4a3a94=sox[_0xcb50('0x20')](_0x45b3bd,_0x48b851,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a3a94['on'](_0xcb50('0x1b'),function(_0x1422d5){logger[_0xcb50('0x1b')](_0xcb50('0x21'),_0x1422d5);_0x38326b(_0x1422d5);});_0x4a3a94['on'](_0xcb50('0x1e'),function(){logger[_0xcb50('0x18')](_0xcb50('0x22'));_0x23c288();});_0x4a3a94[_0xcb50('0x23')]();});}function base64Decode(_0x74f2b,_0x3124ee){var _0x3ba867=path[_0xcb50('0x24')](__dirname,_0xcb50('0x25'),rs[_0xcb50('0x26')](0x4)+_0xcb50('0x27'));fs[_0xcb50('0x28')](_0x3ba867,_0x74f2b,_0xcb50('0x29'));return convertFile(_0x3ba867,_0x3124ee)[_0xcb50('0x2a')](function(){try{fs[_0xcb50('0x1a')](_0x3ba867);fs[_0xcb50('0x2b')](_0x3124ee,_0xcb50('0x2c'));}catch(_0x46fd57){logger[_0xcb50('0x1b')](_0x46fd57);}return _0x3124ee[_0xcb50('0x2d')]('.')[0x0];});}function base64Encode(_0x1e8f38){var _0x483076=fs[_0xcb50('0x2e')](_0x1e8f38);return new Buffer(_0x483076)[_0xcb50('0x2f')](_0xcb50('0x29'));}exports['googleCloudTTS']=function(_0x45f740,_0x380d73,_0x5ed500,_0x10d557,_0x4c49d6,_0x5dad8f){var _0x1d4881,_0x4764b5;var _0x2e7e79=_0xcb50('0x30');var _0x3f3ad0=_0xcb50('0x31')+_0x45f740;var _0x8eb8c7={};if(_0x380d73===_0xcb50('0x32')){_0x8eb8c7[_0xcb50('0x33')]={'ssml':_0x5ed500};}else{_0x8eb8c7[_0xcb50('0x33')]={'text':_0x5ed500};};_0x8eb8c7['voice']={'languageCode':_0x10d557,'ssmlGender':_0x4c49d6};_0x8eb8c7[_0xcb50('0x34')]={'audioEncoding':_0xcb50('0x35'),'sampleRateHertz':0x1f40};var _0x78ff6a={'url':_0x2e7e79+_0xcb50('0x36')+_0x3f3ad0,'method':_0xcb50('0x37'),'json':!![],'body':_0x8eb8c7};return rp(_0x78ff6a)[_0xcb50('0x2a')](function(_0x2bde26){return new BPromise(function(_0x3de853,_0x315d9d){_0x1d4881=path[_0xcb50('0x24')](__dirname,_0xcb50('0x25'),rs[_0xcb50('0x26')](0x4)+_0xcb50('0x38'));var _0x38ab36=Buffer['from'](_0x2bde26[_0xcb50('0x39')],_0xcb50('0x29'));return fs[_0xcb50('0x3a')](_0x1d4881,_0x38ab36,function(_0x4f985a){_0x315d9d(_0x4f985a);},function(_0x69c0f6){fs[_0xcb50('0x2b')](_0x1d4881,'777');_0x3de853(_0x69c0f6);});});})[_0xcb50('0x2a')](function(_0x4f7f54){_0x4764b5=path[_0xcb50('0x24')](__dirname,'tmp',rs[_0xcb50('0x26')](0x4)+_0xcb50('0x27'));return convertFile(_0x1d4881,_0x4764b5);})['then'](function(){try{fs[_0xcb50('0x1a')](_0x1d4881);fs['chmodSync'](_0x4764b5,_0xcb50('0x2c'));}catch(_0x1011c6){logger[_0xcb50('0x1b')](_0x1011c6);}logger['info'](_0xcb50('0x3b'),_0x4764b5['split']('.')[0x0]);return _0x4764b5[_0xcb50('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x287496,_0x73893e){var _0x5a5f02=_0xcb50('0x3c');var _0x19dbe8,_0x40cc2a;var _0x433067;var _0x59c184={'encoding':'utf8','method':_0xcb50('0x37'),'timeout':0x2710,'url':_0x5a5f02,'headers':{'Content-Type':_0xcb50('0x3d')},'body':_0xcb50('0x3e')+encodeURIComponent(JSON['stringify']([[[_0xcb50('0x3f'),JSON[_0xcb50('0x40')]([_0x287496,_0x73893e||'en',![],'null']),null,_0xcb50('0x41')]]]))};return rp(_0x59c184)['then'](function(_0x512a35){try{_0x433067=eval(_0x512a35[_0xcb50('0x42')](0x5))[0x0][0x2];}catch(_0x28434f){throw new Error(_0xcb50('0x43')+_0x512a35[_0xcb50('0x44')]);}if(!_0x433067){if(_0x287496[_0xcb50('0x45')]>0xc8){throw new Error(_0xcb50('0x46'));}else{throw new Error(_0xcb50('0x47')+_0x73893e+_0xcb50('0x48'));}}try{_0x433067=eval(_0x433067)[0x0];}catch(_0x126431){throw new Error(_0xcb50('0x43')+res[_0xcb50('0x44')]);}const _0x36e2e1=_0x433067;_0x19dbe8=path[_0xcb50('0x24')](__dirname,_0xcb50('0x25'),rs[_0xcb50('0x26')](0x4)+_0xcb50('0x38'));fs[_0xcb50('0x28')](_0x19dbe8,_0x433067,{'encoding':_0xcb50('0x29')});_0x40cc2a=path[_0xcb50('0x24')](__dirname,_0xcb50('0x25'),rs[_0xcb50('0x26')](0x4)+_0xcb50('0x27'));return convertFile(_0x19dbe8,_0x40cc2a);})[_0xcb50('0x2a')](function(){try{fs[_0xcb50('0x1a')](_0x19dbe8);fs['chmodSync'](_0x40cc2a,'777');}catch(_0x11f98b){logger['error'](_0x11f98b);}logger[_0xcb50('0x18')](_0xcb50('0x49'),_0x40cc2a[_0xcb50('0x2d')]('.')[0x0]);return _0x40cc2a[_0xcb50('0x2d')]('.')[0x0];});};exports['googleASR']=function(_0x287f16,_0x27e65f,_0x2cf57c){return google[_0xcb50('0x4a')](_0x287f16,_0x27e65f,_0x2cf57c)[_0xcb50('0x2a')](function(_0xadf96){logger[_0xcb50('0x18')](_0xadf96[_0xcb50('0x4b')]);return rp(_0xadf96);})[_0xcb50('0x2a')](function(_0x5a206f){var _0x9a6190='';var _0x53a32f=0x0;try{fs[_0xcb50('0x1a')](_0x287f16);}catch(_0x4e38c2){logger['error'](_0x4e38c2);}if(_0x5a206f&&_0x5a206f['results']){_0x9a6190=_0x5a206f[_0xcb50('0x4c')][_0xcb50('0x4d')](function(_0x308376){return _0x308376&&_0x308376[_0xcb50('0x4e')][0x0]&&_0x308376['alternatives'][0x0][_0xcb50('0x4f')]?_0x308376[_0xcb50('0x4e')][0x0][_0xcb50('0x4f')]:'';})[_0xcb50('0x50')]('\x0a');_0x53a32f=_0x5a206f[_0xcb50('0x4c')][_0xcb50('0x4d')](function(_0x5a519a){return _0x5a519a&&_0x5a519a[_0xcb50('0x4e')][0x0]&&_0x5a519a[_0xcb50('0x4e')][0x0][_0xcb50('0x51')]?_0x5a519a['alternatives'][0x0][_0xcb50('0x51')]:0x0;})[_0xcb50('0x50')]('\x0a');}logger['info'](_0xcb50('0x52'),_0x9a6190);logger[_0xcb50('0x18')](_0xcb50('0x53'),_0x53a32f);return{'transcript':_0x9a6190,'confidence':_0x53a32f};})[_0xcb50('0x54')](function(_0x1c535f){logger[_0xcb50('0x1b')](_0xcb50('0x55'),_0x1c535f[_0xcb50('0x14')],_0x1c535f[_0xcb50('0x56')],_0x1c535f['message']);});};exports[_0xcb50('0x57')]=function(_0x47ad8d,_0x5a3a70,_0xf86062,_0x3b60c2){var _0x18bcad=apiai(_0x5a3a70,{'language':_0x3b60c2||'en'});return _0x18bcad[_0xcb50('0x58')](_0xf86062,{'sessionId':md5(_0x47ad8d)})[_0xcb50('0x2a')](function(_0x52d16c){logger['info'](JSON[_0xcb50('0x40')](_0x52d16c));return{'source':_0x52d16c[_0xcb50('0x59')]['source'],'resolvedQuery':_0x52d16c[_0xcb50('0x59')][_0xcb50('0x5a')],'action':_0x52d16c[_0xcb50('0x59')][_0xcb50('0x5b')],'actionIncomplete':_0x52d16c[_0xcb50('0x59')]['actionIncomplete'],'speech':_0x52d16c[_0xcb50('0x59')][_0xcb50('0x5c')][_0xcb50('0x5d')],'score':_0x52d16c[_0xcb50('0x59')][_0xcb50('0x5e')],'statusCode':_0x52d16c[_0xcb50('0x5f')][_0xcb50('0x60')],'endConversation':_0x52d16c['result'][_0xcb50('0x61')][_0xcb50('0x62')]||![],'isFallbackIntent':_0x52d16c[_0xcb50('0x59')][_0xcb50('0x61')][_0xcb50('0x63')]};});};exports['googleDialogflowV2']=function(_0x4eea51,_0x2a8d8f,_0x4f0105,_0x44bdbc,_0x3e529e,_0x11ada0){var _0x2f6bd4=_0x44bdbc['replace'](/\\n/g,'\x0a');var _0x35223d={'credentials':{'private_key':_0x2f6bd4,'client_email':_0x4f0105}};var _0x9203da=new dialogflow[(_0xcb50('0x64'))](_0x35223d);var _0x2ee28d=_0x9203da['sessionPath'](_0x2a8d8f,md5(_0x4eea51));var _0x58daf4={'session':_0x2ee28d,'queryInput':{'text':{'text':_0x3e529e,'languageCode':_0x11ada0}}};return _0x9203da[_0xcb50('0x65')](_0x58daf4)[_0xcb50('0x2a')](function(_0x555a18){if(_0x555a18&&_0x555a18[_0xcb50('0x45')]){logger[_0xcb50('0x18')](_0xcb50('0x66'),JSON[_0xcb50('0x40')](_0x555a18));var _0x5dbc6f=_0x555a18[0x0];if(_0x5dbc6f){var _0x292425={'action':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x5b')],'allRequiredParamsPresent':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x68')],'endConversation':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x69')]&&_0x5dbc6f['queryResult'][_0xcb50('0x69')][_0xcb50('0x6a')]?_0x5dbc6f['queryResult'][_0xcb50('0x69')][_0xcb50('0x6a')][_0xcb50('0x6b')][_0xcb50('0x6c')]:![],'fulfillmentText':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x6d')],'intentName':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x6e')][_0xcb50('0x56')],'intentDisplayName':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x6e')][_0xcb50('0x6f')],'isFallbackIntent':_0x5dbc6f['queryResult'][_0xcb50('0x6e')]['isFallback'],'languageCode':_0x5dbc6f['queryResult'][_0xcb50('0x70')],'queryText':_0x5dbc6f['queryResult'][_0xcb50('0x71')],'responseId':_0x5dbc6f[_0xcb50('0x72')],'score':_0x5dbc6f['queryResult'][_0xcb50('0x73')],'speech':_0x5dbc6f[_0xcb50('0x67')][_0xcb50('0x6d')],'providerResponse':JSON[_0xcb50('0x40')](_0x555a18)};return _0x292425;}}});};exports['tildeASR']=function(_0x28621d,_0x1d676f,_0x5dde70,_0x4bbe3f){return tilde['asr'](_0x28621d,_0x1d676f,_0x5dde70,_0x4bbe3f)['then'](function(_0xb88c5a){try{fs[_0xcb50('0x1a')](_0x28621d);}catch(_0x5cfaa3){logger[_0xcb50('0x1b')](_0x5cfaa3);}logger[_0xcb50('0x18')](_0xcb50('0x74'),_0xb88c5a[_0xcb50('0x4f')]);logger[_0xcb50('0x18')](_0xcb50('0x75'),_0xb88c5a['confidence']);return _0xb88c5a;});};exports[_0xcb50('0x76')]=function(_0x3b797c,_0xdd12da,_0x210631,_0x1f609d,_0x2dbcee,_0x567138){var _0x565705=path['resolve'](__dirname,_0xcb50('0x25'),rs[_0xcb50('0x26')](0x4)+'.mp3');var _0x59d732;return aws[_0xcb50('0x77')](_0x3b797c,_0xdd12da,_0x210631,_0x1f609d,_0x2dbcee,_0x567138,_0x565705)[_0xcb50('0x2a')](function(){_0x59d732=path[_0xcb50('0x24')](__dirname,_0xcb50('0x25'),rs['generate'](0x4)+_0xcb50('0x27'));return convertFile(_0x565705,_0x59d732);})[_0xcb50('0x2a')](function(){try{fs[_0xcb50('0x1a')](_0x565705);fs[_0xcb50('0x2b')](_0x59d732,_0xcb50('0x2c'));}catch(_0x4faa4c){logger[_0xcb50('0x1b')](_0x4faa4c);}return _0x59d732[_0xcb50('0x2d')]('.')[0x0];});};exports[_0xcb50('0x78')]=function(_0x1b4f31,_0x5079e2,_0x295880,_0x39509d,_0x12f9d8,_0x5ebb0d){return aws[_0xcb50('0x79')](_0x1b4f31,_0x5079e2,_0x295880,_0x39509d,_0x12f9d8,_0x5ebb0d)[_0xcb50('0x2a')](function(_0x203fdc){logger['info'](JSON[_0xcb50('0x40')](_0x203fdc));return _0x203fdc;});};exports[_0xcb50('0x7a')]=function(_0x1857da,_0x176ced,_0x28bfd7,_0x32b2e8){var _0x471042=util[_0xcb50('0x7b')](_0xcb50('0x7c'),ISPEECH_API,_0x1857da,encodeURIComponent(_0x176ced),_0x28bfd7,_0x32b2e8);var _0x5e5516=path['resolve'](__dirname,_0xcb50('0x25'),rs['generate'](0x4)+_0xcb50('0x38'));var _0x535fa3;return downloadFile(_0x471042,_0x5e5516)[_0xcb50('0x2a')](function(){_0x535fa3=path['resolve'](__dirname,_0xcb50('0x25'),rs['generate'](0x4)+_0xcb50('0x27'));return convertFile(_0x5e5516,_0x535fa3);})[_0xcb50('0x2a')](function(){try{fs[_0xcb50('0x1a')](_0x5e5516);fs[_0xcb50('0x2b')](_0x535fa3,_0xcb50('0x2c'));}catch(_0x1d5d91){logger['error'](_0x1d5d91);}return _0x535fa3[_0xcb50('0x2d')]('.')[0x0];});};exports[_0xcb50('0x7d')]=function(_0x429955,_0x228a6d,_0x4d1daa,_0xf45288){var _0x33ee6c=util[_0xcb50('0x7b')](_0xcb50('0x7e'),ISPEECH_API,_0x228a6d,_0x4d1daa,base64Encode(_0x429955),_0xf45288?util['format']('model=%s',encodeURIComponent(_0xf45288)):_0xcb50('0x7f'));return uploadFile(_0x33ee6c)[_0xcb50('0x2a')](function(_0x720c94){return querystring[_0xcb50('0x80')](_0x720c94);});};exports[_0xcb50('0x81')]=function(_0x442ce0,_0x4c613b){return sestek[_0xcb50('0x82')](_0x442ce0,_0x4c613b)[_0xcb50('0x2a')](function(_0x485650){logger[_0xcb50('0x18')](JSON['stringify'](_0x485650));var _0x47ae37={'speech':_0x485650[_0xcb50('0x83')],'action':_0x485650['channelData']?_0x485650[_0xcb50('0x84')]['CustomAction']:undefined,'actiondata':_0x485650[_0xcb50('0x84')]?_0x485650[_0xcb50('0x84')][_0xcb50('0x85')]:undefined};if(_0x485650[_0xcb50('0x84')]&&_0x485650[_0xcb50('0x84')][_0xcb50('0x86')]){return base64Decode(_0x485650[_0xcb50('0x84')][_0xcb50('0x86')][_0xcb50('0x87')],path[_0xcb50('0x24')](__dirname,_0xcb50('0x25'),rs[_0xcb50('0x26')](0x4)+_0xcb50('0x27')))[_0xcb50('0x2a')](function(_0x370195){_0x47ae37[_0xcb50('0x88')]=_0x370195;return _0x47ae37;});}return _0x47ae37;});};exports[_0xcb50('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x2d64=['host','path','data','finish\x20to\x20convert','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','info','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','length','Dialogflow\x20V2\x20response:','action','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','https','md5','randomstring','google-tts-api','url','util','./google','./sestek','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish\x20download\x20file','close','unlink','download\x20error','end','protocol'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2d64,0x1e2));var _0x42d6=function(_0x5c1e52,_0x283789){_0x5c1e52=_0x5c1e52-0x0;var _0x11e2c4=_0x2d64[_0x5c1e52];return _0x11e2c4;};'use strict';var apiai=require(_0x42d6('0x0'));var BPromise=require(_0x42d6('0x1'));var dialogflow=require(_0x42d6('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x42d6('0x3'));var md5=require(_0x42d6('0x4'));var path=require('path');var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x42d6('0x5'));var sox=require('sox');var tts=require(_0x42d6('0x6'));var urlParse=require(_0x42d6('0x7'))['parse'];var util=require(_0x42d6('0x8'));var aws=require('./aws');var google=require(_0x42d6('0x9'));var sestek=require(_0x42d6('0xa'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x42d6('0xb'));var ISPEECH_API=_0x42d6('0xc');function downloadFile(_0x3d9967,_0x30c565){return new BPromise(function(_0x5af652,_0x4fe37c){var _0x1128c4=urlParse(_0x3d9967);var _0x5af9f1=_0x1128c4['protocol']===_0x42d6('0xd')?https:http;var _0x5aad40={'host':_0x1128c4['host'],'path':_0x1128c4['path'],'headers':{'user-agent':_0x42d6('0xe')}};_0x5af9f1[_0x42d6('0xf')](_0x5aad40,function(_0x1d84f7){if(_0x1d84f7[_0x42d6('0x10')]!==0xc8){logger[_0x42d6('0x11')]('request\x20to\x20'+_0x3d9967+_0x42d6('0x12')+_0x1d84f7[_0x42d6('0x10')]+'\x20('+_0x1d84f7['statusMessage']+')');_0x4fe37c(new Error('request\x20to\x20'+_0x3d9967+_0x42d6('0x12')+_0x1d84f7[_0x42d6('0x10')]+'\x20('+_0x1d84f7[_0x42d6('0x13')]+')'));return;}var _0x3f8722=fs['createWriteStream'](_0x30c565);_0x3f8722['on']('finish',function(){logger['info'](_0x42d6('0x14'));_0x3f8722[_0x42d6('0x15')](_0x5af652);});_0x3f8722['on'](_0x42d6('0x11'),function(_0x25ee83){fs[_0x42d6('0x16')](_0x30c565);logger[_0x42d6('0x11')](_0x42d6('0x17'),_0x25ee83);_0x4fe37c(_0x25ee83);});_0x1d84f7['pipe'](_0x3f8722);})['on']('error',function(_0x41a47c){logger[_0x42d6('0x11')](_0x41a47c);_0x4fe37c(_0x41a47c);})[_0x42d6('0x18')]();});}function uploadFile(_0x4aa35c){return new BPromise(function(_0x1eb26c,_0x55e906){var _0x3f1e52=urlParse(_0x4aa35c);var _0x9184fd=_0x3f1e52[_0x42d6('0x19')]===_0x42d6('0xd')?https:http;var _0x2814b7={'host':_0x3f1e52[_0x42d6('0x1a')],'path':_0x3f1e52[_0x42d6('0x1b')],'headers':{'user-agent':_0x42d6('0xe')}};_0x9184fd[_0x42d6('0xf')](_0x2814b7,function(_0x5cd931){if(_0x5cd931[_0x42d6('0x10')]!==0xc8){_0x55e906(new Error('request\x20to\x20'+_0x4aa35c+_0x42d6('0x12')+_0x5cd931[_0x42d6('0x10')]+'\x20('+_0x5cd931[_0x42d6('0x13')]+')'));return;}var _0x3e2d64='';_0x5cd931['on'](_0x42d6('0x1c'),function(_0x43b83f){_0x3e2d64+=_0x43b83f;});_0x5cd931['on']('end',function(){_0x1eb26c(_0x3e2d64);});})['on'](_0x42d6('0x11'),function(_0x57664b){_0x55e906(_0x57664b);})[_0x42d6('0x18')]();});}function convertFile(_0x6f3606,_0x12ac26){return new BPromise(function(_0x2aee4e,_0x108c07){var _0x3bb078=sox['transcode'](_0x6f3606,_0x12ac26,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3bb078['on'](_0x42d6('0x11'),function(_0x23a739){logger[_0x42d6('0x11')]('error\x20convert',_0x23a739);_0x108c07(_0x23a739);});_0x3bb078['on'](_0x42d6('0x18'),function(){logger['info'](_0x42d6('0x1d'));_0x2aee4e();});_0x3bb078['start']();});}function base64Decode(_0x33f98f,_0x4781c7){var _0x1e103c=path[_0x42d6('0x1e')](__dirname,'tmp',rs[_0x42d6('0x1f')](0x4)+_0x42d6('0x20'));fs[_0x42d6('0x21')](_0x1e103c,_0x33f98f,_0x42d6('0x22'));return convertFile(_0x1e103c,_0x4781c7)[_0x42d6('0x23')](function(){try{fs[_0x42d6('0x16')](_0x1e103c);fs[_0x42d6('0x24')](_0x4781c7,_0x42d6('0x25'));}catch(_0xd17eeb){logger[_0x42d6('0x11')](_0xd17eeb);}return _0x4781c7[_0x42d6('0x26')]('.')[0x0];});}function base64Encode(_0x2e1d3f){var _0x44e7ec=fs[_0x42d6('0x27')](_0x2e1d3f);return new Buffer(_0x44e7ec)[_0x42d6('0x28')]('base64');}exports['googleCloudTTS']=function(_0x40a419,_0x28029c,_0x42de9b,_0xef573b,_0x51a345,_0x13348b){var _0x4e9b8b,_0xf595e;var _0x5e9704=_0x42d6('0x29');var _0x36afb4=_0x42d6('0x2a')+_0x40a419;var _0x2490ed={};if(_0x28029c===_0x42d6('0x2b')){_0x2490ed[_0x42d6('0x2c')]={'ssml':_0x42de9b};}else{_0x2490ed[_0x42d6('0x2c')]={'text':_0x42de9b};};_0x2490ed[_0x42d6('0x2d')]={'languageCode':_0xef573b,'ssmlGender':_0x51a345};_0x2490ed[_0x42d6('0x2e')]={'audioEncoding':_0x42d6('0x2f'),'sampleRateHertz':0x1f40};var _0x5f5169={'url':_0x5e9704+_0x42d6('0x30')+_0x36afb4,'method':_0x42d6('0x31'),'json':!![],'body':_0x2490ed};return rp(_0x5f5169)[_0x42d6('0x23')](function(_0x3faf4a){return new BPromise(function(_0x586956,_0x2140f0){_0x4e9b8b=path[_0x42d6('0x1e')](__dirname,_0x42d6('0x32'),rs[_0x42d6('0x1f')](0x4)+_0x42d6('0x33'));var _0x32f897=Buffer[_0x42d6('0x34')](_0x3faf4a[_0x42d6('0x35')],_0x42d6('0x22'));return fs['writeFile'](_0x4e9b8b,_0x32f897,function(_0x21b97e){_0x2140f0(_0x21b97e);},function(_0x2d5620){fs[_0x42d6('0x24')](_0x4e9b8b,'777');_0x586956(_0x2d5620);});});})[_0x42d6('0x23')](function(_0x31d1cf){_0xf595e=path[_0x42d6('0x1e')](__dirname,_0x42d6('0x32'),rs[_0x42d6('0x1f')](0x4)+_0x42d6('0x20'));return convertFile(_0x4e9b8b,_0xf595e);})['then'](function(){try{fs['unlink'](_0x4e9b8b);fs[_0x42d6('0x24')](_0xf595e,_0x42d6('0x25'));}catch(_0x293727){logger[_0x42d6('0x11')](_0x293727);}logger['info']('googleCloudTTS\x20path',_0xf595e[_0x42d6('0x26')]('.')[0x0]);return _0xf595e[_0x42d6('0x26')]('.')[0x0];});};exports[_0x42d6('0x36')]=function(_0x5f0eee,_0x298726){var _0x53b1c1=_0x42d6('0x37');var _0x8bd502,_0x3d0a89;var _0x16e046;var _0x2ac953={'encoding':_0x42d6('0x38'),'method':_0x42d6('0x31'),'timeout':0x2710,'url':_0x53b1c1,'headers':{'Content-Type':_0x42d6('0x39')},'body':_0x42d6('0x3a')+encodeURIComponent(JSON[_0x42d6('0x3b')]([[['jQ1olc',JSON[_0x42d6('0x3b')]([_0x5f0eee,_0x298726||'en',![],_0x42d6('0x3c')]),null,'generic']]]))};return rp(_0x2ac953)[_0x42d6('0x23')](function(_0x3c14e1){try{_0x16e046=eval(_0x3c14e1[_0x42d6('0x3d')](0x5))[0x0][0x2];}catch(_0x5bfaf1){throw new Error(_0x42d6('0x3e')+_0x3c14e1[_0x42d6('0x1c')]);}if(!_0x16e046){if(_0x5f0eee['length']>0xc8){throw new Error(_0x42d6('0x3f'));}else{throw new Error(_0x42d6('0x40')+_0x298726+'\x22\x20might\x20not\x20exist');}}try{_0x16e046=eval(_0x16e046)[0x0];}catch(_0x508214){throw new Error(_0x42d6('0x3e')+res[_0x42d6('0x1c')]);}const _0x3dbc19=_0x16e046;_0x8bd502=path[_0x42d6('0x1e')](__dirname,_0x42d6('0x32'),rs[_0x42d6('0x1f')](0x4)+_0x42d6('0x33'));fs[_0x42d6('0x21')](_0x8bd502,_0x16e046,{'encoding':_0x42d6('0x22')});_0x3d0a89=path['resolve'](__dirname,_0x42d6('0x32'),rs['generate'](0x4)+'.wav');return convertFile(_0x8bd502,_0x3d0a89);})[_0x42d6('0x23')](function(){try{fs[_0x42d6('0x16')](_0x8bd502);fs['chmodSync'](_0x3d0a89,_0x42d6('0x25'));}catch(_0x2d6bc8){logger[_0x42d6('0x11')](_0x2d6bc8);}logger[_0x42d6('0x41')]('goggleTTS\x20path',_0x3d0a89[_0x42d6('0x26')]('.')[0x0]);return _0x3d0a89['split']('.')[0x0];});};exports[_0x42d6('0x42')]=function(_0x30e68d,_0x37ab7c,_0x1d9f13){return google[_0x42d6('0x43')](_0x30e68d,_0x37ab7c,_0x1d9f13)[_0x42d6('0x23')](function(_0x22807b){logger[_0x42d6('0x41')](_0x22807b[_0x42d6('0x44')]);return rp(_0x22807b);})['then'](function(_0x1cf8b8){var _0x524268='';var _0x16728c=0x0;try{fs['unlink'](_0x30e68d);}catch(_0x382367){logger[_0x42d6('0x11')](_0x382367);}if(_0x1cf8b8&&_0x1cf8b8['results']){_0x524268=_0x1cf8b8[_0x42d6('0x45')][_0x42d6('0x46')](function(_0x58a272){return _0x58a272&&_0x58a272[_0x42d6('0x47')][0x0]&&_0x58a272[_0x42d6('0x47')][0x0][_0x42d6('0x48')]?_0x58a272[_0x42d6('0x47')][0x0]['transcript']:'';})['join']('\x0a');_0x16728c=_0x1cf8b8[_0x42d6('0x45')]['map'](function(_0x47cda9){return _0x47cda9&&_0x47cda9[_0x42d6('0x47')][0x0]&&_0x47cda9[_0x42d6('0x47')][0x0]['confidence']?_0x47cda9[_0x42d6('0x47')][0x0][_0x42d6('0x49')]:0x0;})[_0x42d6('0x4a')]('\x0a');}logger[_0x42d6('0x41')](_0x42d6('0x4b'),_0x524268);logger['info'](_0x42d6('0x4c'),_0x16728c);return{'transcript':_0x524268,'confidence':_0x16728c};})[_0x42d6('0x4d')](function(_0x457f6f){logger[_0x42d6('0x11')](_0x42d6('0x4e'),_0x457f6f[_0x42d6('0x10')],_0x457f6f[_0x42d6('0x4f')],_0x457f6f['message']);});};exports[_0x42d6('0x50')]=function(_0x1cf4e9,_0xe1d35d,_0x4952c9,_0x59219f){var _0xf3f32e=apiai(_0xe1d35d,{'language':_0x59219f||'en'});return _0xf3f32e[_0x42d6('0x51')](_0x4952c9,{'sessionId':md5(_0x1cf4e9)})[_0x42d6('0x23')](function(_0x31b3ab){logger[_0x42d6('0x41')](JSON['stringify'](_0x31b3ab));return{'source':_0x31b3ab[_0x42d6('0x52')][_0x42d6('0x53')],'resolvedQuery':_0x31b3ab[_0x42d6('0x52')][_0x42d6('0x54')],'action':_0x31b3ab[_0x42d6('0x52')]['action'],'actionIncomplete':_0x31b3ab[_0x42d6('0x52')]['actionIncomplete'],'speech':_0x31b3ab[_0x42d6('0x52')]['fulfillment']['speech'],'score':_0x31b3ab[_0x42d6('0x52')]['score'],'statusCode':_0x31b3ab['status'][_0x42d6('0x55')],'endConversation':_0x31b3ab[_0x42d6('0x52')]['metadata'][_0x42d6('0x56')]||![],'isFallbackIntent':_0x31b3ab['result'][_0x42d6('0x57')][_0x42d6('0x58')]};});};exports[_0x42d6('0x59')]=function(_0x54dbc2,_0x7b242,_0x3310c5,_0x2e060c,_0x1e2090,_0x382e14){var _0xc9c7b3=_0x2e060c[_0x42d6('0x5a')](/\\n/g,'\x0a');var _0x565371={'credentials':{'private_key':_0xc9c7b3,'client_email':_0x3310c5}};var _0x46a12b=new dialogflow[(_0x42d6('0x5b'))](_0x565371);var _0x5827a7=_0x46a12b['sessionPath'](_0x7b242,md5(_0x54dbc2));var _0x25a29f={'session':_0x5827a7,'queryInput':{'text':{'text':_0x1e2090,'languageCode':_0x382e14}}};return _0x46a12b[_0x42d6('0x5c')](_0x25a29f)['then'](function(_0x1d45f3){if(_0x1d45f3&&_0x1d45f3[_0x42d6('0x5d')]){logger['info'](_0x42d6('0x5e'),JSON['stringify'](_0x1d45f3));var _0x2c49b8=_0x1d45f3[0x0];if(_0x2c49b8){var _0x4f9ce0={'action':_0x2c49b8['queryResult'][_0x42d6('0x5f')],'allRequiredParamsPresent':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x61')],'endConversation':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x62')]&&_0x2c49b8['queryResult'][_0x42d6('0x62')][_0x42d6('0x63')]?_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x62')][_0x42d6('0x63')]['end_conversation'][_0x42d6('0x64')]:![],'fulfillmentText':_0x2c49b8['queryResult'][_0x42d6('0x65')],'intentName':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x66')][_0x42d6('0x4f')],'intentDisplayName':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x66')][_0x42d6('0x67')],'isFallbackIntent':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x66')][_0x42d6('0x68')],'languageCode':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x69')],'queryText':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x6a')],'responseId':_0x2c49b8[_0x42d6('0x6b')],'score':_0x2c49b8[_0x42d6('0x60')][_0x42d6('0x6c')],'speech':_0x2c49b8['queryResult'][_0x42d6('0x65')],'providerResponse':JSON['stringify'](_0x1d45f3)};return _0x4f9ce0;}}});};exports['tildeASR']=function(_0x543595,_0x4a00b1,_0x31adcf,_0x3f491e){return tilde['asr'](_0x543595,_0x4a00b1,_0x31adcf,_0x3f491e)[_0x42d6('0x23')](function(_0x16dbcf){try{fs[_0x42d6('0x16')](_0x543595);}catch(_0x1e41f9){logger['error'](_0x1e41f9);}logger[_0x42d6('0x41')]('Tilde\x20ASR\x20transcription',_0x16dbcf['transcript']);logger[_0x42d6('0x41')](_0x42d6('0x6d'),_0x16dbcf[_0x42d6('0x49')]);return _0x16dbcf;});};exports[_0x42d6('0x6e')]=function(_0x3fc6e1,_0x3326db,_0x1b72f8,_0x13b2f,_0x3be34a,_0x31dcd5){var _0xeb0ace=path['resolve'](__dirname,_0x42d6('0x32'),rs['generate'](0x4)+_0x42d6('0x33'));var _0x5bd16c;return aws['polly'](_0x3fc6e1,_0x3326db,_0x1b72f8,_0x13b2f,_0x3be34a,_0x31dcd5,_0xeb0ace)[_0x42d6('0x23')](function(){_0x5bd16c=path['resolve'](__dirname,'tmp',rs[_0x42d6('0x1f')](0x4)+_0x42d6('0x20'));return convertFile(_0xeb0ace,_0x5bd16c);})[_0x42d6('0x23')](function(){try{fs['unlink'](_0xeb0ace);fs['chmodSync'](_0x5bd16c,_0x42d6('0x25'));}catch(_0x5aee9d){logger[_0x42d6('0x11')](_0x5aee9d);}return _0x5bd16c[_0x42d6('0x26')]('.')[0x0];});};exports[_0x42d6('0x6f')]=function(_0x27daa9,_0xe15450,_0x339a5f,_0x10a60e,_0x380711,_0x2c37ba){return aws[_0x42d6('0x70')](_0x27daa9,_0xe15450,_0x339a5f,_0x10a60e,_0x380711,_0x2c37ba)[_0x42d6('0x23')](function(_0x3201ca){logger['info'](JSON[_0x42d6('0x3b')](_0x3201ca));return _0x3201ca;});};exports['ispeechTTS']=function(_0x1e9d85,_0x4313cd,_0x4c60cb,_0x1e8761){var _0x3a7e93=util[_0x42d6('0x71')](_0x42d6('0x72'),ISPEECH_API,_0x1e9d85,encodeURIComponent(_0x4313cd),_0x4c60cb,_0x1e8761);var _0x2255e9=path['resolve'](__dirname,'tmp',rs[_0x42d6('0x1f')](0x4)+_0x42d6('0x33'));var _0x357965;return downloadFile(_0x3a7e93,_0x2255e9)[_0x42d6('0x23')](function(){_0x357965=path['resolve'](__dirname,_0x42d6('0x32'),rs[_0x42d6('0x1f')](0x4)+'.wav');return convertFile(_0x2255e9,_0x357965);})[_0x42d6('0x23')](function(){try{fs['unlink'](_0x2255e9);fs[_0x42d6('0x24')](_0x357965,_0x42d6('0x25'));}catch(_0x361df5){logger['error'](_0x361df5);}return _0x357965[_0x42d6('0x26')]('.')[0x0];});};exports[_0x42d6('0x73')]=function(_0x526478,_0x46883b,_0x32ace9,_0x12813c){var _0x581aca=util[_0x42d6('0x71')](_0x42d6('0x74'),ISPEECH_API,_0x46883b,_0x32ace9,base64Encode(_0x526478),_0x12813c?util[_0x42d6('0x71')](_0x42d6('0x75'),encodeURIComponent(_0x12813c)):_0x42d6('0x76'));return uploadFile(_0x581aca)[_0x42d6('0x23')](function(_0x1e8bc9){return querystring['parse'](_0x1e8bc9);});};exports[_0x42d6('0x77')]=function(_0x144086,_0x97165c){return sestek[_0x42d6('0x78')](_0x144086,_0x97165c)['then'](function(_0x1df082){logger[_0x42d6('0x41')](JSON['stringify'](_0x1df082));var _0x3dca90={'speech':_0x1df082[_0x42d6('0x79')],'action':_0x1df082[_0x42d6('0x7a')]?_0x1df082[_0x42d6('0x7a')]['CustomAction']:undefined,'actiondata':_0x1df082[_0x42d6('0x7a')]?_0x1df082[_0x42d6('0x7a')][_0x42d6('0x7b')]:undefined};if(_0x1df082['channelData']&&_0x1df082[_0x42d6('0x7a')][_0x42d6('0x7c')]){return base64Decode(_0x1df082[_0x42d6('0x7a')]['AudioFromTts'][_0x42d6('0x7d')],path[_0x42d6('0x1e')](__dirname,_0x42d6('0x32'),rs[_0x42d6('0x1f')](0x4)+'.wav'))[_0x42d6('0x23')](function(_0x35c246){_0x3dca90['audiofile']=_0x35c246;return _0x3dca90;});}return _0x3dca90;});};exports[_0x42d6('0x7e')]=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 ab88d39..979d65a 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 _0xf951=['./nda'];(function(_0x386688,_0x29d853){var _0x139544=function(_0x23a70d){while(--_0x23a70d){_0x386688['push'](_0x386688['shift']());}};_0x139544(++_0x29d853);}(_0xf951,0x1b4));var _0x1f95=function(_0x53e55c,_0x40898b){_0x53e55c=_0x53e55c-0x0;var _0x451802=_0xf951[_0x53e55c];return _0x451802;};var nda=require(_0x1f95('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xdc18=['exports'];(function(_0x5a15d7,_0x2f68ae){var _0x2e7101=function(_0xedd477){while(--_0xedd477){_0x5a15d7['push'](_0x5a15d7['shift']());}};_0x2e7101(++_0x2f68ae);}(_0xdc18,0x95));var _0x8dc1=function(_0x2b8a59,_0x4c49c1){_0x2b8a59=_0x2b8a59-0x0;var _0x51ad76=_0xdc18[_0x2b8a59];return _0x51ad76;};var nda=require('./nda');module[_0x8dc1('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 73365cc..68b8cdd 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 _0x4e81=['channelData','ProjectName','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project'];(function(_0x1b25c6,_0x18783f){var _0x1a3393=function(_0x38ee2e){while(--_0x38ee2e){_0x1b25c6['push'](_0x1b25c6['shift']());}};_0x1a3393(++_0x18783f);}(_0x4e81,0x1bc));var _0x14e8=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x4e81[_0x30f07a];return _0xb38461;};'use strict';var rp=require(_0x14e8('0x0'));var url=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('agi');module['exports']=function(_0x4cda11,_0x2184fc){var _0x3a988b={'method':_0x14e8('0x3'),'uri':url[_0x14e8('0x4')](_0x2184fc[_0x14e8('0x5')],_0x14e8('0x6')),'form':{'grant_type':'password','username':_0x2184fc['username'],'password':_0x2184fc[_0x14e8('0x7')]},'json':!![]};return rp(_0x3a988b)[_0x14e8('0x8')](function(_0x21f860){var _0x3c1b93={'method':_0x14e8('0x3'),'uri':url[_0x14e8('0x4')](_0x2184fc[_0x14e8('0x9')],_0x14e8('0xa')),'body':{'type':_0x2184fc[_0x14e8('0xb')]||'message','channelId':_0x14e8('0xc'),'conversation':{'id':_0x4cda11[_0x14e8('0xd')]},'from':{'id':_0x4cda11[_0x14e8('0xe')],'name':_0x4cda11[_0x14e8('0xf')]},'recipient':{'id':_0x4cda11[_0x14e8('0x10')],'name':_0x4cda11[_0x14e8('0x11')]},'text':_0x2184fc[_0x14e8('0x12')],'channelData':{}},'headers':{'Authorization':_0x14e8('0x13')+_0x21f860['access_token']},'json':!![]};if(_0x2184fc[_0x14e8('0x14')]){_0x3c1b93['body'][_0x14e8('0x15')][_0x14e8('0x16')]=_0x2184fc[_0x14e8('0x14')];}if(_0x2184fc['ndagenerate_audio']=='1'){_0x3c1b93[_0x14e8('0x17')]['channelData'][_0x14e8('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2184fc[_0x14e8('0x19')]){_0x3c1b93[_0x14e8('0x17')][_0x14e8('0x15')][_0x14e8('0x1a')]=_0x2184fc['custom_action'];if(_0x2184fc[_0x14e8('0x1b')]){_0x3c1b93[_0x14e8('0x17')][_0x14e8('0x15')][_0x14e8('0x1c')]=_0x2184fc[_0x14e8('0x1b')];}}logger[_0x14e8('0x1d')](JSON[_0x14e8('0x1e')](_0x3c1b93));return rp(_0x3c1b93);});}; \ No newline at end of file +var _0xae60=['request-promise','url','../../../../../config/logger','exports','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify'];(function(_0x37222f,_0x25a5ab){var _0x5c5a6d=function(_0x27218b){while(--_0x27218b){_0x37222f['push'](_0x37222f['shift']());}};_0x5c5a6d(++_0x25a5ab);}(_0xae60,0x1c7));var _0x0ae6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xae60[_0x62c958];return _0x57ec61;};'use strict';var rp=require(_0x0ae6('0x0'));var url=require(_0x0ae6('0x1'));var logger=require(_0x0ae6('0x2'))('agi');module[_0x0ae6('0x3')]=function(_0x46c07f,_0x2d388d){var _0x568a7f={'method':_0x0ae6('0x4'),'uri':url[_0x0ae6('0x5')](_0x2d388d['ndauth_url'],_0x0ae6('0x6')),'form':{'grant_type':_0x0ae6('0x7'),'username':_0x2d388d[_0x0ae6('0x8')],'password':_0x2d388d[_0x0ae6('0x7')]},'json':!![]};return rp(_0x568a7f)[_0x0ae6('0x9')](function(_0x447a1d){var _0x120910={'method':_0x0ae6('0x4'),'uri':url['resolve'](_0x2d388d[_0x0ae6('0xa')],_0x0ae6('0xb')),'body':{'type':_0x2d388d[_0x0ae6('0xc')]||_0x0ae6('0xd'),'channelId':'Nda','conversation':{'id':_0x46c07f[_0x0ae6('0xe')]},'from':{'id':_0x46c07f[_0x0ae6('0xf')],'name':_0x46c07f[_0x0ae6('0x10')]},'recipient':{'id':_0x46c07f[_0x0ae6('0x11')],'name':_0x46c07f[_0x0ae6('0x12')]},'text':_0x2d388d[_0x0ae6('0x13')],'channelData':{}},'headers':{'Authorization':_0x0ae6('0x14')+_0x447a1d[_0x0ae6('0x15')]},'json':!![]};if(_0x2d388d[_0x0ae6('0x16')]){_0x120910[_0x0ae6('0x17')][_0x0ae6('0x18')][_0x0ae6('0x19')]=_0x2d388d[_0x0ae6('0x16')];}if(_0x2d388d[_0x0ae6('0x1a')]=='1'){_0x120910['body'][_0x0ae6('0x18')][_0x0ae6('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0ae6('0x1c')};}if(_0x2d388d[_0x0ae6('0x1d')]){_0x120910[_0x0ae6('0x17')][_0x0ae6('0x18')][_0x0ae6('0x1e')]=_0x2d388d[_0x0ae6('0x1d')];if(_0x2d388d[_0x0ae6('0x1f')]){_0x120910[_0x0ae6('0x17')][_0x0ae6('0x18')][_0x0ae6('0x20')]=_0x2d388d[_0x0ae6('0x1f')];}}logger[_0x0ae6('0x21')](JSON[_0x0ae6('0x22')](_0x120910));return rp(_0x120910);});}; \ 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 b3456de..5652706 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 _0x1794=['./lib/api'];(function(_0x1721e1,_0x39c111){var _0x59d6fe=function(_0xc65ca7){while(--_0xc65ca7){_0x1721e1['push'](_0x1721e1['shift']());}};_0x59d6fe(++_0x39c111);}(_0x1794,0xef));var _0x4179=function(_0x3b4f3f,_0x266eb1){_0x3b4f3f=_0x3b4f3f-0x0;var _0x123491=_0x1794[_0x3b4f3f];return _0x123491;};'use strict';var asr=require(_0x4179('0x0'));module['exports']=function(_0x3d0ba9,_0xb9fea,_0x1a30cc,_0x1738f4){return asr(_0x3d0ba9,_0xb9fea,_0x1a30cc,_0x1738f4);}; \ No newline at end of file +var _0x9830=['./lib/api','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9830,0x19a));var _0x0983=function(_0x223b71,_0x597bfb){_0x223b71=_0x223b71-0x0;var _0x4131e4=_0x9830[_0x223b71];return _0x4131e4;};'use strict';var asr=require(_0x0983('0x0'));module[_0x0983('0x1')]=function(_0x10413f,_0x302a5e,_0x3e44b0,_0xe93843){return asr(_0x10413f,_0x302a5e,_0x3e44b0,_0xe93843);}; \ 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 830bc5f..04c51f9 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 _0x3610=['likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','close','lodash','moment','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','data','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','hypotheses','transcript'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3610,0x1f4));var _0x0361=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x3610[_0x220f3f];return _0x1f170e;};'use strict';var BPromise=require('bluebird');var _=require(_0x0361('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0361('0x1'));var crypto=require('crypto');var logger=require(_0x0361('0x2'))(_0x0361('0x3'));module['exports']=function(_0x4a7535,_0x1104ee,_0xe1ba50,_0x5ddd4e){return new BPromise(function(_0x260623,_0x436e6e){logger[_0x0361('0x4')](_0x0361('0x5'),_0x5ddd4e||_0x0361('0x6'));var _0x299de=new WebSocket(_0x5ddd4e||_0x0361('0x6'),{'perMessageDeflate':![]});var _0x332177='';var _0x4013a2='0';var _0x55a259='1';var _0x4c9c24=_0x0361('0x7');function _0x458363(_0x54e0c7){var _0x4b81c5=crypto[_0x0361('0x8')]('sha1');_0x4b81c5[_0x0361('0x9')](_0x54e0c7);return _0x4b81c5[_0x0361('0xa')](_0x0361('0xb'));}function _0x21c722(){try{logger[_0x0361('0x4')](_0x0361('0xc'));var _0x39c280=moment()['unix']();var _0x1d6450=_0x458363(_0x39c280+_0x1104ee+_0xe1ba50);_0x299de[_0x0361('0xd')](JSON['stringify']({'appID':_0x1104ee,'timestamp':_0x39c280,'appKey':_0x1d6450}));var _0x1d1a78=fs[_0x0361('0xe')](_0x4a7535);_0x1d1a78['on'](_0x0361('0xf'),function(_0x468f70){_0x299de[_0x0361('0xd')](_0x468f70);});_0x1d1a78['on']('close',function(){_0x299de['send']('EOS');});}catch(_0x516c4e){logger[_0x0361('0x10')](_0x0361('0x11'),JSON[_0x0361('0x12')](_0x516c4e));_0x299de[_0x0361('0x13')]();}}function _0x3d456c(_0xbe43d1){try{if(_0xbe43d1){var _0x13e82f=JSON['parse'](_0xbe43d1);switch(_0x13e82f[_0x0361('0x14')]){case 0x0:if(_0x13e82f[_0x0361('0x15')]){if(_0x13e82f[_0x0361('0x15')][_0x0361('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x0361('0x12')](_0x13e82f[_0x0361('0x15')][_0x0361('0x17')]));_0x332177=_0x13e82f[_0x0361('0x15')]['hypotheses'][0x0][_0x0361('0x18')];_0x4013a2=_0x13e82f[_0x0361('0x15')][_0x0361('0x17')][0x0][_0x0361('0x19')];_0x55a259='0';_0x4c9c24=_0x0361('0x1a');_0x299de[_0x0361('0x13')]();}}break;case 0x1:logger[_0x0361('0x4')](_0x0361('0x7'));_0x55a259='1';_0x4c9c24=_0x0361('0x7');break;case 0x2:logger['info'](_0x0361('0x1b'));_0x55a259='2';_0x4c9c24='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x0361('0x1c'));_0x55a259='9';_0x4c9c24=_0x0361('0x1c');break;case 0xa:logger[_0x0361('0x4')](_0x0361('0x1d'));_0x55a259='10';_0x4c9c24=_0x0361('0x1d');break;case 0xb:logger['info'](_0x0361('0x1e'));_0x55a259='11';_0x4c9c24='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xe36d1f){logger[_0x0361('0x10')](_0x0361('0x1f'),JSON['stringify'](_0xe36d1f));_0x299de[_0x0361('0x13')]();}}function _0x57f834(){logger[_0x0361('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x260623({'transcript':_0x332177,'confidence':_0x4013a2,'status':_0x55a259,'status_message':_0x4c9c24});}function _0x5963e1(_0x5057aa){logger[_0x0361('0x10')](_0x0361('0x20'));if(!_['isNil'](_0x5057aa)){logger[_0x0361('0x10')](_[_0x0361('0x21')](_0x5057aa)?JSON[_0x0361('0x12')](_0x5057aa):_0x5057aa);}}_0x299de['on']('open',_0x21c722);_0x299de['on']('message',_0x3d456c);_0x299de['on'](_0x0361('0x22'),_0x57f834);_0x299de['on']('error',_0x5963e1);});}; \ No newline at end of file +var _0x636b=['Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','lodash','moment','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','sha1','update','hex','info'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x636b,0x1b4));var _0xb636=function(_0x34eec8,_0x47ae64){_0x34eec8=_0x34eec8-0x0;var _0x4d2948=_0x636b[_0x34eec8];return _0x4d2948;};'use strict';var BPromise=require(_0xb636('0x0'));var _=require(_0xb636('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb636('0x2'));var crypto=require(_0xb636('0x3'));var logger=require(_0xb636('0x4'))(_0xb636('0x5'));module[_0xb636('0x6')]=function(_0xb7558e,_0x318192,_0xf0c539,_0x16da75){return new BPromise(function(_0x1f2733,_0x4cdf7a){logger['info'](_0xb636('0x7'),_0x16da75||_0xb636('0x8'));var _0x251896=new WebSocket(_0x16da75||_0xb636('0x8'),{'perMessageDeflate':![]});var _0x5ac565='';var _0x1aa434='0';var _0x7fbde4='1';var _0x2a782b=_0xb636('0x9');function _0x5be68e(_0xe26796){var _0x47b03b=crypto[_0xb636('0xa')](_0xb636('0xb'));_0x47b03b[_0xb636('0xc')](_0xe26796);return _0x47b03b['digest'](_0xb636('0xd'));}function _0x38751(){try{logger[_0xb636('0xe')](_0xb636('0xf'));var _0x1c149e=moment()[_0xb636('0x10')]();var _0x4c5dd7=_0x5be68e(_0x1c149e+_0x318192+_0xf0c539);_0x251896['send'](JSON[_0xb636('0x11')]({'appID':_0x318192,'timestamp':_0x1c149e,'appKey':_0x4c5dd7}));var _0x1e98be=fs['createReadStream'](_0xb7558e);_0x1e98be['on'](_0xb636('0x12'),function(_0x17fae8){_0x251896[_0xb636('0x13')](_0x17fae8);});_0x1e98be['on'](_0xb636('0x14'),function(){_0x251896[_0xb636('0x13')](_0xb636('0x15'));});}catch(_0x537d21){logger[_0xb636('0x16')](_0xb636('0x17'),JSON[_0xb636('0x11')](_0x537d21));_0x251896[_0xb636('0x18')]();}}function _0xca86ef(_0x2502c4){try{if(_0x2502c4){var _0x3bbfe9=JSON[_0xb636('0x19')](_0x2502c4);switch(_0x3bbfe9[_0xb636('0x1a')]){case 0x0:if(_0x3bbfe9[_0xb636('0x1b')]){if(_0x3bbfe9[_0xb636('0x1b')][_0xb636('0x1c')]){logger[_0xb636('0xe')](_0xb636('0x1d'),JSON[_0xb636('0x11')](_0x3bbfe9['result'][_0xb636('0x1e')]));_0x5ac565=_0x3bbfe9[_0xb636('0x1b')]['hypotheses'][0x0][_0xb636('0x1f')];_0x1aa434=_0x3bbfe9[_0xb636('0x1b')][_0xb636('0x1e')][0x0]['likelihood'];_0x7fbde4='0';_0x2a782b=_0xb636('0x20');_0x251896[_0xb636('0x18')]();}}break;case 0x1:logger[_0xb636('0xe')](_0xb636('0x9'));_0x7fbde4='1';_0x2a782b=_0xb636('0x9');break;case 0x2:logger[_0xb636('0xe')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x7fbde4='2';_0x2a782b=_0xb636('0x21');break;case 0x9:logger[_0xb636('0xe')](_0xb636('0x22'));_0x7fbde4='9';_0x2a782b='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x7fbde4='10';_0x2a782b=_0xb636('0x23');break;case 0xb:logger[_0xb636('0xe')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x7fbde4='11';_0x2a782b=_0xb636('0x24');}}}catch(_0x4f996e){logger[_0xb636('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xb636('0x11')](_0x4f996e));_0x251896[_0xb636('0x18')]();}}function _0x14e2f2(){logger[_0xb636('0xe')](_0xb636('0x25'));_0x1f2733({'transcript':_0x5ac565,'confidence':_0x1aa434,'status':_0x7fbde4,'status_message':_0x2a782b});}function _0x106fb1(_0x35e404){logger['error'](_0xb636('0x26'));if(!_[_0xb636('0x27')](_0x35e404)){logger['error'](_[_0xb636('0x28')](_0x35e404)?JSON[_0xb636('0x11')](_0x35e404):_0x35e404);}}_0x251896['on']('open',_0x38751);_0x251896['on']('message',_0xca86ef);_0x251896['on'](_0xb636('0x14'),_0x14e2f2);_0x251896['on'](_0xb636('0x16'),_0x106fb1);});}; \ 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 99ca472..3af6e08 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 _0x6169=['exports'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x6169,0x87));var _0x9616=function(_0x325984,_0xf782f3){_0x325984=_0x325984-0x0;var _0x364e73=_0x6169[_0x325984];return _0x364e73;};var asr=require('./asr');module[_0x9616('0x0')]={'asr':asr}; \ No newline at end of file +var _0x312f=['exports'];(function(_0x3c492b,_0x4861e2){var _0x4371cf=function(_0x5dc311){while(--_0x5dc311){_0x3c492b['push'](_0x3c492b['shift']());}};_0x4371cf(++_0x4861e2);}(_0x312f,0x11f));var _0xf312=function(_0x36e4d7,_0x38a9fe){_0x36e4d7=_0x36e4d7-0x0;var _0xbcfd3a=_0x312f[_0x36e4d7];return _0xbcfd3a;};var asr=require('./asr');module[_0xf312('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 3aecf03..32b4133 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x4e6cbb,_0x3450f0){var _0x15ced4=function(_0x248dd2){while(--_0x248dd2){_0x4e6cbb['push'](_0x4e6cbb['shift']());}};_0x15ced4(++_0x3450f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x233dc0,_0x2866ad){var _0x1fc160=function(_0x51e38b){while(--_0x51e38b){_0x233dc0['push'](_0x233dc0['shift']());}};_0x1fc160(++_0x2866ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f4c389f..4c493c8 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 _0x8ce8=['Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','NOBEEP','intKey','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','template_id','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','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\x20on\x20variable:\x20%s','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','calleridname','context','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agent','agentPause','agentLogout','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','MALE','audioEncoding','MP3','google_tts_language','restAPI','url','method','timeout','includes','POST','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','stringify','render','statusMessage','statusCode','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_polly_region','aws_polly_voice','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','agicommand','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','retry','maxRetry','mrcpsynth','isConfigured','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','custom_app','application','lumenvoxtts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured'];(function(_0x442c84,_0x2245b0){var _0x269f2d=function(_0x4c1f3a){while(--_0x4c1f3a){_0x442c84['push'](_0x442c84['shift']());}};_0x269f2d(++_0x2245b0);}(_0x8ce8,0xd3));var _0x88ce=function(_0x46505f,_0x26e394){_0x46505f=_0x46505f-0x0;var _0x2aa7af=_0x8ce8[_0x46505f];return _0x2aa7af;};'use strict';var fs=require('fs');var util=require(_0x88ce('0x0'));var _=require('lodash');var sh=require(_0x88ce('0x1'));var odbc=require(_0x88ce('0x2'))();var rs=require(_0x88ce('0x3'));var moment=require(_0x88ce('0x4'));var Mustache=require(_0x88ce('0x5'));var rp=require(_0x88ce('0x6'));var logger=require(_0x88ce('0x7'))(_0x88ce('0x8'));var config=require(_0x88ce('0x9'));var shared=require(_0x88ce('0xa'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x88ce('0xb'),_0x88ce('0xc')];var verticesWithRetry=[_0x88ce('0xd'),_0x88ce('0xe'),_0x88ce('0xf')];var AGIVertices=function(_0x5eea92,_0x48c190,_0x56d343){this[_0x88ce('0x10')]=_0x5eea92;this[_0x88ce('0x11')]=_0x48c190;this[_0x88ce('0x12')]=_0x56d343;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x14')]=function(_0x3d8ad6,_0x3e0e28){this[_0x88ce('0x11')]['getVariableById'](_0x3d8ad6)[_0x88ce('0x15')](function(_0x4cd1c0){_0x3e0e28(null,_0x4cd1c0?_0x4cd1c0[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x50b088){_0x3e0e28(_0x50b088);});};AGIVertices['prototype'][_0x88ce('0x18')]=function(_0xbc1936,_0x12e8af){this[_0x88ce('0x11')][_0x88ce('0x19')](_0xbc1936)[_0x88ce('0x15')](function(_0x242265){_0x12e8af(null,_0x242265?_0x242265['name']:![]);})[_0x88ce('0x17')](function(_0x5bcd5a){_0x12e8af(_0x5bcd5a);});};AGIVertices[_0x88ce('0x13')]['getSquareProject']=function(_0x429230,_0x2a5a86){this[_0x88ce('0x11')][_0x88ce('0x1a')](_0x429230)['then'](function(_0x50c9df){_0x2a5a86(null,_0x50c9df?_0x50c9df[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x404df9){_0x2a5a86(_0x404df9);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b')]=function(_0x37f31,_0x461a8a){this[_0x88ce('0x11')][_0x88ce('0x1c')](_0x37f31)[_0x88ce('0x15')](function(_0x106e59){_0x461a8a(null,_0x106e59?_0x106e59[_0x88ce('0x1d')]:![]);})[_0x88ce('0x17')](function(_0x397ee5){_0x461a8a(_0x397ee5);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1e')]=function(_0x4daac4,_0x356d7d){this[_0x88ce('0x11')][_0x88ce('0x1f')](_0x4daac4)[_0x88ce('0x15')](function(_0x33711e){_0x356d7d(null,_0x33711e?_0x33711e['name']:![]);})['catch'](function(_0x4dcdc4){_0x356d7d(_0x4dcdc4);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x20')]=function(_0x424b66,_0x51a894){this['rpc'][_0x88ce('0x21')](_0x424b66)[_0x88ce('0x15')](function(_0x1b9d39){_0x51a894(null,_0x1b9d39?_0x1b9d39[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x1efcea){_0x51a894(_0x1efcea);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x22')]=function(_0x19c87f,_0x40aa83){var _0x4209bc=this;this[_0x88ce('0x11')][_0x88ce('0x23')](_0x19c87f)[_0x88ce('0x15')](function(_0x12b9a1){_0x40aa83(null,_0x12b9a1?_0x4209bc[_0x88ce('0x24')](_0x12b9a1['save_name']):![]);})[_0x88ce('0x17')](function(_0x5ceb03){_0x40aa83(_0x5ceb03);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x25')]=function(_0x6ea7e0,_0x2fe609){this['rpc'][_0x88ce('0x26')](_0x6ea7e0)[_0x88ce('0x15')](function(_0x326ebe){_0x2fe609(null,_0x326ebe?_0x326ebe:![]);})[_0x88ce('0x17')](function(_0x400096){_0x2fe609(_0x400096);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x27')]=function(_0x554cff,_0x1280be,_0x34b5c4){this['mailRpc'][_0x88ce('0x27')](_0x554cff,_0x1280be)[_0x88ce('0x15')](function(){_0x34b5c4(null);})[_0x88ce('0x17')](function(_0x24fbbe){_0x34b5c4(_0x24fbbe);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x28')]=function(_0x21e585,_0x12bcfa){this[_0x88ce('0x11')]['getIntervalById'](_0x21e585)[_0x88ce('0x15')](function(_0x1da20a){if(_0x1da20a){if(_0x1da20a[_0x88ce('0x29')]){_0x12bcfa(null,[_0x1da20a['interval']]);}else{_0x12bcfa(null,_[_0x88ce('0x2a')](_0x1da20a[_0x88ce('0x2b')],'interval'));}}else{_0x12bcfa(null,![]);}})['catch'](function(_0x238142){_0x12bcfa(_0x238142);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x24')]=function(_0x1e25ca){return util[_0x88ce('0x2c')](_0x88ce('0x2d'),FILES_PATH,_0x1e25ca);};AGIVertices['prototype'][_0x88ce('0x2e')]=function(_0x94a27,_0x500ed1,_0x35c773){odbc[_0x88ce('0x2f')](_0x94a27,function(_0x55e1c4){if(_0x55e1c4){logger[_0x88ce('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x55e1c4);_0x35c773(_0x55e1c4);}else{logger[_0x88ce('0x31')](_0x88ce('0x32'));odbc[_0x88ce('0x33')](_0x500ed1,function(_0x2c2ec1,_0x378436){if(_0x2c2ec1){logger[_0x88ce('0x31')]('Error\x20executing\x20query\x20%s',_0x500ed1);_0x35c773(_0x2c2ec1);}else{logger[_0x88ce('0x31')](_0x88ce('0x34'),_0x500ed1);odbc[_0x88ce('0x35')](function(_0x24f5fa){if(_0x24f5fa){logger['error'](_0x88ce('0x36'),_0x24f5fa);}_0x35c773(null,_0x378436);});}});}});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x37')]=function(_0x4cc1c2,_0x596d4c){this[_0x88ce('0x11')][_0x88ce('0x38')](_0x4cc1c2)[_0x88ce('0x15')](function(_0x512e49){_0x596d4c(null,_0x512e49?_0x512e49:![]);})[_0x88ce('0x17')](function(_0x3f7dce){_0x596d4c(_0x3f7dce);});};AGIVertices['prototype'][_0x88ce('0x39')]=function(_0x1b99a8,_0x4709c4){this[_0x88ce('0x11')][_0x88ce('0x39')](_0x1b99a8)['then'](function(_0x14e61a){_0x4709c4(null,_0x14e61a);})[_0x88ce('0x17')](function(_0x388926){_0x4709c4(_0x388926);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x3a')]=function(_0x29d440,_0x39bfb8,_0x5ae3f9){this[_0x88ce('0x11')][_0x88ce('0x3a')]({'uniqueid':this['channel'][_0x88ce('0x3b')],'node':_0x29d440[_0x88ce('0x3c')],'application':_0x29d440['agicommand'],'data':_0x39bfb8||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x88ce('0x10')][_0x88ce('0x3d')]})[_0x88ce('0x15')](function(_0x35cbf8){if(_0x5ae3f9){_0x5ae3f9(null,_0x35cbf8);}})[_0x88ce('0x17')](function(_0x20db25){if(_0x5ae3f9){_0x5ae3f9(_0x20db25);}});};AGIVertices[_0x88ce('0x13')]['createSquareRecording']=function(_0x160a6c,_0x535061,_0x2406b2,_0x10c963){this[_0x88ce('0x11')]['createSquareRecording']({'uniqueid':this[_0x88ce('0x10')]['uniqueid'],'callerid':this[_0x88ce('0x10')][_0x88ce('0x3d')],'calleridname':this[_0x88ce('0x10')][_0x88ce('0x3e')],'context':this[_0x88ce('0x10')][_0x88ce('0x3f')],'extension':this[_0x88ce('0x10')]['extension'],'priority':this[_0x88ce('0x10')][_0x88ce('0x40')],'accountcode':this[_0x88ce('0x10')][_0x88ce('0x41')],'dnid':this['channel']['dnid'],'projectName':this[_0x88ce('0x10')][_0x88ce('0x42')],'saveName':_0x535061,'filename':_0x160a6c[_0x88ce('0x43')]||_0x535061,'savePath':_0x2406b2})[_0x88ce('0x15')](function(_0x23967c){_0x10c963(null,_0x23967c);})[_0x88ce('0x17')](function(_0x4e4933){_0x10c963(_0x4e4933);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3471ae,_0x55cd0e,_0x5c2231,_0x47d0c7,_0x13e84f){this['rpc'][_0x88ce('0x44')]({'uniqueid':this[_0x88ce('0x10')][_0x88ce('0x3b')],'body':_0x3471ae,'direction':_0x55cd0e,'providerName':_0x5c2231,'providerResponse':_0x47d0c7})[_0x88ce('0x15')](function(_0x23be64){if(_0x13e84f){_0x13e84f(null,_0x23be64);}})[_0x88ce('0x17')](function(_0x5a598b){if(_0x13e84f){_0x13e84f(_0x5a598b);}});};AGIVertices['prototype'][_0x88ce('0x45')]=function(_0x39a801,_0x1c9e37){this[_0x88ce('0x11')]['createCmContact']({'firstName':_['isEmpty'](_0x39a801[_0x88ce('0x16')])||_[_0x88ce('0x46')](_0x39a801[_0x88ce('0x16')])?_0x88ce('0x47')+Math[_0x88ce('0x48')]():_0x39a801[_0x88ce('0x16')],'lastName':_[_0x88ce('0x49')](_0x39a801[_0x88ce('0x4a')])||_[_0x88ce('0x46')](_0x39a801[_0x88ce('0x4a')])?null:_0x39a801[_0x88ce('0x4a')],'phone':_0x39a801[_0x88ce('0x4b')],'ListId':_0x39a801[_0x88ce('0x4c')],'scheduledat':_0x39a801['scheduledAt'],'callbackUniqueid':this[_0x88ce('0x10')][_0x88ce('0x3b')],'tags':_0x88ce('0x4d'),'description':_0x88ce('0x4e')+_0x39a801[_0x88ce('0x4f')][_0x88ce('0x50')](),'priority':_0x39a801['callback_priority']})[_0x88ce('0x15')](function(_0x564f37){_0x1c9e37(null,_0x564f37);})[_0x88ce('0x17')](function(_0x3ee72d){_0x1c9e37(_0x3ee72d);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x51')]=function(_0x16778f,_0x4ab8da){this[_0x88ce('0x11')][_0x88ce('0x52')](_0x16778f)['then'](function(_0x42963f){_0x4ab8da(null,_0x42963f?_0x42963f['name']:![]);})[_0x88ce('0x17')](function(_0x3d05f3){_0x4ab8da(_0x3d05f3);});};AGIVertices[_0x88ce('0x13')]['agentPause']=function(_0x1e45cc,_0x2cc506,_0x27c25d){var _0x1988ab={'role':_0x88ce('0x53')};_0x1988ab[_0x1e45cc]=this[_0x88ce('0x10')][_0x88ce('0x3d')];this[_0x88ce('0x11')][_0x88ce('0x54')](_0x1988ab,_0x2cc506,this['channel']['uniqueid'])[_0x88ce('0x15')](function(_0x1d213d){_0x27c25d(null,_[_0x88ce('0x46')](_0x1d213d)?![]:!![]);})['catch'](function(_0x232cc1){logger['error'](_0x232cc1);_0x27c25d(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x114888,_0x50b887){var _0xaf4625={'role':_0x88ce('0x53')};_0xaf4625[_0x114888]=this[_0x88ce('0x10')]['callerid'];this[_0x88ce('0x11')]['agentUnpause'](_0xaf4625)[_0x88ce('0x15')](function(_0x1a1af4){_0x50b887(null,_[_0x88ce('0x46')](_0x1a1af4)?![]:!![]);})[_0x88ce('0x17')](function(_0x5c6c24){logger[_0x88ce('0x30')](_0x5c6c24);_0x50b887(null,![]);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x55')]=function(_0x563439,_0x590d79){var _0x5cddfd={'role':_0x88ce('0x53')};_0x5cddfd[_0x563439]=this[_0x88ce('0x10')][_0x88ce('0x3d')];this[_0x88ce('0x11')]['agentLogout'](_0x5cddfd)['then'](function(_0x55570f){_0x590d79(null,_[_0x88ce('0x46')](_0x55570f)?![]:!![]);})[_0x88ce('0x17')](function(_0x13f59a){logger[_0x88ce('0x30')](_0x13f59a);_0x590d79(null,![]);});};AGIVertices[_0x88ce('0x13')]['agentLogin']=function(_0x495ac2,_0x2aafcc){var _0x2d360b={'role':_0x88ce('0x53')};_0x2d360b[_0x495ac2]=this[_0x88ce('0x10')][_0x88ce('0x3d')];var _0x546248=_0x495ac2!='internal'?util[_0x88ce('0x2c')](_0x88ce('0x56'),_0x88ce('0x57'),this[_0x88ce('0x10')]['callerid']):undefined;this[_0x88ce('0x11')]['agentLogin'](_0x2d360b,_0x546248)['then'](function(_0x15df5a){_0x2aafcc(null,_[_0x88ce('0x46')](_0x15df5a)?![]:!![]);})[_0x88ce('0x17')](function(_0x3b4732){logger[_0x88ce('0x30')](_0x3b4732);_0x2aafcc(null,![]);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x58')]=function(_0x1f34d1,_0x41fc76){sh[_0x88ce('0x59')](_[_0x88ce('0x5a')](_0x1f34d1),function(_0x43133b,_0x19c2b2){var _0x21b65e=_0x19c2b2[_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'');_0x41fc76(null,_0x21b65e);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x5c')]=function(_0x458343,_0x13a3f6){scripts['googleCloudTTS'](_0x458343['apiKey'],_0x458343[_0x88ce('0x5d')]||_0x88ce('0x5e'),_0x458343[_0x88ce('0x5e')],_0x458343['languageCode']||_0x88ce('0x5f'),_0x458343['ssmlGender']||_0x88ce('0x60'),_0x458343[_0x88ce('0x61')]||_0x88ce('0x62'))['then'](function(_0x505097){_0x13a3f6(null,_0x505097);})['catch'](function(_0x57c372){_0x13a3f6(_0x57c372);});};AGIVertices['prototype']['googleTTS']=function(_0x3359ea,_0x28826e){scripts['googleTTS'](_0x3359ea[_0x88ce('0x5e')],_0x3359ea[_0x88ce('0x63')]||'en',0x1)[_0x88ce('0x15')](function(_0x13092e){_0x28826e(null,_0x13092e);})[_0x88ce('0x17')](function(_0x363992){_0x28826e(_0x363992);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x64')]=function(_0x1ffa58,_0x140b6e){var _0x168fd9={'uri':_0x1ffa58[_0x88ce('0x65')],'method':_0x1ffa58[_0x88ce('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1ffa58['timeout'])==='number'&&parseInt(_0x1ffa58[_0x88ce('0x67')])>=0x1?parseInt(_0x1ffa58[_0x88ce('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x88ce('0x68')]([_0x88ce('0x69'),'PUT'],_0x168fd9[_0x88ce('0x66')][_0x88ce('0x6a')]())){try{_0x168fd9[_0x88ce('0x6b')]=_0x1ffa58['rawBody']?JSON['parse'](_0x1ffa58[_0x88ce('0xc')]):{};}catch(_0x222480){logger[_0x88ce('0x30')](_0x88ce('0x6c'),_0x222480);}}try{_0x168fd9['headers']=_0x1ffa58[_0x88ce('0xb')]?JSON[_0x88ce('0x6d')](_0x1ffa58[_0x88ce('0xb')]):{};}catch(_0x9f1a8c){logger[_0x88ce('0x30')](_0x88ce('0x6e'),_0x9f1a8c);}if(_0x1ffa58[_0x88ce('0x6f')]){try{var _0x2ed8c9=require(_0x1ffa58[_0x88ce('0x6f')])[_0x88ce('0x70')](this,_0x168fd9);_0x168fd9[_0x88ce('0x71')]=Mustache['render'](_0x1ffa58[_0x88ce('0x65')],_0x2ed8c9,{},['$$','$$']);if(_0x168fd9[_0x88ce('0x72')]){_0x168fd9[_0x88ce('0x72')]=JSON[_0x88ce('0x6d')](Mustache['render'](JSON[_0x88ce('0x73')](_0x168fd9[_0x88ce('0x72')]),_0x2ed8c9,{},['$$','$$']));}if(_0x168fd9['body']){_0x168fd9[_0x88ce('0x6b')]=JSON[_0x88ce('0x6d')](Mustache[_0x88ce('0x74')](JSON[_0x88ce('0x73')](_0x168fd9[_0x88ce('0x6b')]),_0x2ed8c9,{},['$$','$$']));}}catch(_0x38fee5){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x38fee5);}}rp(_0x168fd9)[_0x88ce('0x15')](function(_0x11e364){var _0x49ebf5={'statusCode':_0x11e364['statusCode']||0xc8,'statusMessage':_0x11e364[_0x88ce('0x75')]||'OK','headers':_0x11e364[_0x88ce('0x72')]||{},'body':_0x11e364[_0x88ce('0x6b')]||{}};_0x140b6e(null,_0x49ebf5);})[_0x88ce('0x17')](function(_0x226b7e){var _0x113b25={'statusCode':_0x226b7e[_0x88ce('0x76')]||0x1f4,'statusMessage':_0x226b7e[_0x88ce('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x226b7e[_0x88ce('0x78')][_0x88ce('0x72')]||{},'body':_0x226b7e[_0x88ce('0x78')][_0x88ce('0x6b')]||{}};_0x140b6e(null,_0x113b25);});};AGIVertices[_0x88ce('0x13')]['googleDialogflow']=function(_0x2c471c,_0x305179){scripts[_0x88ce('0x79')](this[_0x88ce('0x10')]['uniqueid'],_0x2c471c['key'],_0x2c471c[_0x88ce('0x5e')],_0x2c471c[_0x88ce('0x7a')]||'en')[_0x88ce('0x15')](function(_0x137505){_0x305179(null,_0x137505);})[_0x88ce('0x17')](function(_0x35f619){_0x305179(_0x35f619);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x7b')]=function(_0x557c55,_0x2e2e71){scripts[_0x88ce('0x7b')](this['channel']['uniqueid'],_0x557c55[_0x88ce('0x7c')],_0x557c55[_0x88ce('0x7d')],_0x557c55['private_key'],_0x557c55['text'],_0x557c55['dialogflowV2_language']||'en')[_0x88ce('0x15')](function(_0x58fdf4){_0x2e2e71(null,_0x58fdf4);})['catch'](function(_0x3e24d5){_0x2e2e71(_0x3e24d5);});};AGIVertices['prototype'][_0x88ce('0x7e')]=function(_0x466e56,_0x3ea030){scripts[_0x88ce('0x7e')](this[_0x88ce('0x10')],_0x466e56)[_0x88ce('0x15')](function(_0x2f2d2e){_0x3ea030(null,_0x2f2d2e);})['catch'](function(_0x46777b){_0x3ea030(_0x46777b);});};AGIVertices[_0x88ce('0x13')]['ispeechTTS']=function(_0xf1a87e,_0x328928){scripts[_0x88ce('0x7f')](_0xf1a87e[_0x88ce('0x80')],_0xf1a87e[_0x88ce('0x5e')],_0xf1a87e[_0x88ce('0x81')]||_0x88ce('0x5f'),_0xf1a87e['speed'])[_0x88ce('0x15')](function(_0x45f901){_0x328928(null,_0x45f901);})[_0x88ce('0x17')](function(_0x2b5f7c){_0x328928(_0x2b5f7c);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x82')]=function(_0x3d653f,_0x41a8e3,_0x567493){scripts[_0x88ce('0x82')](_0x41a8e3,_0x3d653f[_0x88ce('0x80')],_0x3d653f[_0x88ce('0x83')]||_0x88ce('0x5f'),this['isConfigured'](_0x3d653f[_0x88ce('0x84')])?_0x3d653f[_0x88ce('0x84')]:undefined)['then'](function(_0x1a7d38){_0x567493(null,_0x1a7d38);})[_0x88ce('0x17')](function(_0x1f6c73){_0x567493(_0x1f6c73);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x85')]=function(_0x59475e,_0x38a64f){scripts['awsPolly'](_0x59475e['aws_access_key_id'],_0x59475e['aws_secret_access_key'],_0x59475e[_0x88ce('0x86')],_0x59475e[_0x88ce('0x87')]||'Amy',_0x59475e[_0x88ce('0x5e')],_0x59475e['aws_text_type']||_0x88ce('0x5e'))[_0x88ce('0x15')](function(_0x8319ab){_0x38a64f(null,_0x8319ab);})[_0x88ce('0x17')](function(_0x3c4e6a){_0x38a64f(_0x3c4e6a);});};AGIVertices[_0x88ce('0x13')]['awsLex']=function(_0x44b850,_0x360e39){scripts[_0x88ce('0x88')](this['channel'][_0x88ce('0x3b')],_0x44b850['aws_access_key_id'],_0x44b850[_0x88ce('0x89')],_0x44b850[_0x88ce('0x8a')],_0x44b850[_0x88ce('0x5e')],_0x44b850[_0x88ce('0x8b')])['then'](function(_0x54a51e){_0x360e39(null,_0x54a51e);})[_0x88ce('0x17')](function(_0x336e97){_0x360e39(_0x336e97);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x8c')]=function(_0x3bb1b4,_0x5b7155,_0x28152e){scripts[_0x88ce('0x8c')](_0x5b7155,_0x3bb1b4['key'],_0x3bb1b4[_0x88ce('0x8d')]||'en-US')[_0x88ce('0x15')](function(_0x30aa06){_0x28152e(null,_0x30aa06);})['catch'](function(_0x5681){_0x28152e(_0x5681);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x8e')]=function(_0x1704bb,_0xda259b,_0x55d86c){scripts['tildeASR'](_0xda259b,_0x1704bb['appid'],_0x1704bb['appsecret'],_0x1704bb[_0x88ce('0x71')])['then'](function(_0x15bab7){_0x55d86c(null,_0x15bab7);})[_0x88ce('0x17')](function(_0x3911d8){_0x55d86c(_0x3911d8);});};AGIVertices['prototype']['clear']=function(_0x3ea399){var _0x4f9012=_[_0x88ce('0x68')](verticesWithRetry,_0x3ea399[_0x88ce('0x8f')])?_0x3ea399:_[_0x88ce('0x90')](_0x3ea399);for(var _0x50f74e in _0x4f9012){if(_0x4f9012['hasOwnProperty'](_0x50f74e)){if(_0x4f9012[_0x50f74e]&&_[_0x88ce('0x91')](_0x4f9012[_0x50f74e])){if(_['includes'](recursiveMapAttributes,_0x50f74e)){_0x4f9012[_0x50f74e]=this[_0x88ce('0x92')](_0x4f9012[_0x50f74e]);}else{_0x4f9012[_0x50f74e]=this[_0x88ce('0x93')](_0x4f9012[_0x50f74e]);}}}}return _0x4f9012;};AGIVertices['prototype'][_0x88ce('0x94')]=function(_0x14fc54){for(var _0x3b7b4c in _0x14fc54){if(_0x14fc54[_0x88ce('0x95')](_0x3b7b4c)){if(_[_0x88ce('0x96')](_0x14fc54[_0x3b7b4c])){this[_0x88ce('0x94')](_0x14fc54[_0x3b7b4c]);}else if(_[_0x88ce('0x97')](_0x14fc54[_0x3b7b4c])){for(var _0x1c13e3=0x0;_0x1c13e3<_0x14fc54[_0x3b7b4c][_0x88ce('0x98')];_0x1c13e3++){this[_0x88ce('0x94')](_0x14fc54[_0x3b7b4c][_0x1c13e3]);}}else if(_[_0x88ce('0x91')](_0x14fc54[_0x3b7b4c])){_0x14fc54[_0x3b7b4c]=this[_0x88ce('0x93')](_0x14fc54[_0x3b7b4c]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x24e70b,_0x5b1a7b){for(var _0x12de3a in _0x24e70b){if(_0x24e70b[_0x88ce('0x95')](_0x12de3a)){if(_['isPlainObject'](_0x24e70b[_0x12de3a])){if(!_['isEmpty'](_0x24e70b[_0x12de3a])){this[_0x88ce('0x99')](_0x24e70b[_0x12de3a],util[_0x88ce('0x2c')](_0x88ce('0x9a'),_0x5b1a7b,_0x12de3a));}}else if(_[_0x88ce('0x97')](_0x24e70b[_0x12de3a])){for(var _0x17da67=0x0;_0x17da67<_0x24e70b[_0x12de3a][_0x88ce('0x98')];_0x17da67++){this[_0x88ce('0x99')](_0x24e70b[_0x12de3a][_0x17da67],util['format']('%s.%s',_0x5b1a7b,_0x12de3a+'['+_0x17da67+']'));}}else{if(!_['isNil'](_0x24e70b[_0x12de3a])){this[_0x88ce('0x10')]['setVariable'](util['format'](_0x88ce('0x9a'),_0x5b1a7b,_0x12de3a),_0x24e70b[_0x12de3a]);}}}}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x92')]=function(_0x2fe52a){try{var _0x3f5878=JSON[_0x88ce('0x6d')](_0x2fe52a);this[_0x88ce('0x94')](_0x3f5878);return JSON[_0x88ce('0x73')](_0x3f5878);}catch(_0x4d85b1){return this['replaceAllVariables'](_0x2fe52a);}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x93')]=function(_0xdf371b){var _0x25e4f4=_0xdf371b[_0x88ce('0x9b')]('{');for(var _0x25f0f3=0x1;_0x25f0f3<_0x25e4f4[_0x88ce('0x98')];_0x25f0f3+=0x1){var _0x4f86e1=_0x25e4f4[_0x25f0f3][_0x88ce('0x9b')]('}');if(_0x4f86e1[_0x88ce('0x98')]>0x1){_0xdf371b=_0xdf371b[_0x88ce('0x9c')]('{'+_0x4f86e1[0x0]+'}',this['channel'][_0x88ce('0x14')](_0x4f86e1[0x0])[_0x88ce('0x9d')]||_0x4f86e1[0x0]);}}if(_0x25e4f4[_0x88ce('0x98')]===0x1){return _0xdf371b[_0x88ce('0x50')]();}return this[_0x88ce('0x93')](_0xdf371b);};AGIVertices['prototype']['getAndSetVariable']=function(_0x357229,_0x2c4e01){var _0x14abcb=this[_0x88ce('0x10')]['getVariable'](_0x357229);if(_0x14abcb[_0x88ce('0x9e')]===-0x1){return _0x14abcb;}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x9f'),_0x2c4e01,_0x14abcb[_0x88ce('0x9d')]));return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x2c4e01,_0x14abcb[_0x88ce('0x9d')]);};AGIVertices[_0x88ce('0x13')]['isConfigured']=function(_0x3de8dc){return _0x3de8dc&&_0x3de8dc!=='0'&&_0x3de8dc!=='-1'&&_0x3de8dc!=='';};AGIVertices[_0x88ce('0x13')]['maxRetry']=function(_0xa8b8e1){this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0xa8b8e1,'-');_0xa8b8e1[_0x88ce('0xa1')]=_0xa8b8e1[_0x88ce('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x88ce('0xa3')]=function(_0x23564f){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x23564f[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x23564f[_0x88ce('0x5e')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xa5'));}var _0x189a4f='\x22'+_0x23564f[_0x88ce('0x5e')]+'\x22';if(this[_0x88ce('0xa4')](_0x23564f[_0x88ce('0x78')])){_0x189a4f+=','+_0x23564f[_0x88ce('0x78')];}var _0x261a9c=this[_0x88ce('0x10')]['exec'](_0x88ce('0xa6'),_0x189a4f);if(_0x261a9c[_0x88ce('0x9e')]===-0x1){return _0x261a9c;}return this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x189a4f));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xa7')]=function(_0x5dc0bb){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xa8'),_0x5dc0bb[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x5dc0bb[_0x88ce('0xa9')])){return this['channel'][_0x88ce('0xaa')]('no\x20grammar\x20configured');}var _0xb07cef=_0x5dc0bb['grammar'];if(this['isConfigured'](_0x5dc0bb[_0x88ce('0x78')])){_0xb07cef+=','+_0x5dc0bb[_0x88ce('0x78')];}var _0xe30a6b=this[_0x88ce('0x10')][_0x88ce('0x59')]('MRCPRecog',_0xb07cef);if(_0xe30a6b[_0x88ce('0x9e')]===-0x1){return _0xe30a6b;}var _0x3195a5=this[_0x88ce('0xab')]('RECOG_CONFIDENCE()',_0x88ce('0xac'));if(_0x3195a5[_0x88ce('0x9e')]===-0x1){return _0x3195a5;}var _0x3ce8af=this[_0x88ce('0xab')](_0x88ce('0xad'),'MRCP_RECOG_TRANSCRIPT');if(_0x3ce8af[_0x88ce('0x9e')]===-0x1){return _0x3ce8af;}var _0x3612f4=this['getAndSetVariable'](_0x88ce('0xae'),_0x88ce('0xaf'));if(_0x3612f4['result']===-0x1){return _0x3612f4;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0xb07cef));};AGIVertices['prototype'][_0x88ce('0x8')]=function(_0x4f5d25){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb1'),_0x4f5d25['label']));return this[_0x88ce('0x10')]['agi']([_0x4f5d25['command'],_0x4f5d25[_0x88ce('0xb2')]]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0xb3')]=function(_0x4fd795){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb4'),_0x4fd795['label']));if(this[_0x88ce('0xa4')](_0x4fd795[_0x88ce('0x67')])){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb5'),_0x4fd795[_0x88ce('0x67')]));var _0x1cda82=this[_0x88ce('0x10')][_0x88ce('0xb6')](_0x4fd795['timeout']);if(_0x1cda82['result']===-0x1){return _0x1cda82;}}return this[_0x88ce('0x10')][_0x88ce('0xb3')]();};AGIVertices[_0x88ce('0x13')][_0x88ce('0x4d')]=function(_0x38d8a6){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xb7'),_0x38d8a6['label']));if(!this[_0x88ce('0xa4')](_0x38d8a6[_0x88ce('0x4c')])){return this['channel'][_0x88ce('0x30')](_0x38d8a6,'no\x20list\x20selected');}_0x38d8a6['scheduledAt']=moment();if(this[_0x88ce('0xa4')](_0x38d8a6[_0x88ce('0xb8')])){_0x38d8a6[_0x88ce('0x4f')]=moment()[_0x88ce('0xb9')](_0x38d8a6[_0x88ce('0xb8')],_0x88ce('0xba'));}if(!this[_0x88ce('0xa4')](_0x38d8a6['callback_priority'])){_0x38d8a6['callback_priority']=0x2;}this[_0x88ce('0x45')]['sync'](this,_0x38d8a6);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x38d8a6[_0x88ce('0x4b')],_0x38d8a6['list_id'],_0x38d8a6[_0x88ce('0x4f')]));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xbb')]=function(_0x192ea7){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x192ea7[_0x88ce('0x3c')]));var _0xa3b0aa=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x192ea7[_0x88ce('0xbc')],_0x192ea7[_0x88ce('0x78')]);if(_0xa3b0aa[_0x88ce('0x9e')]===-0x1){return _0xa3b0aa;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x192ea7['application'],_0x192ea7['options']));};AGIVertices['prototype'][_0x88ce('0xbd')]=function(_0x1e176d){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1e176d['label']));if(!this[_0x88ce('0xa4')](_0x1e176d[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}var _0xdfc61b='\x22'+_0x1e176d['text']+'\x22';if(this[_0x88ce('0xa4')](_0x1e176d[_0x88ce('0x78')])){_0xdfc61b+=','+_0x1e176d[_0x88ce('0x78')];}var _0x21de38=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xa6'),_0xdfc61b);if(_0x21de38[_0x88ce('0x9e')]===-0x1){return _0x21de38;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0xdfc61b));};AGIVertices[_0x88ce('0x13')]['sestektts']=function(_0x309ab0){logger[_0x88ce('0x31')](util['format'](_0x88ce('0xbe'),_0x309ab0[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x309ab0[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}var _0x44805b='\x22'+_0x309ab0['text']+'\x22';if(this['isConfigured'](_0x309ab0['options'])){_0x44805b+=','+_0x309ab0['options'];}var _0x2cdcc0=this[_0x88ce('0x10')]['exec']('MRCPSynth',_0x44805b);if(_0x2cdcc0[_0x88ce('0x9e')]===-0x1){return _0x2cdcc0;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xbf'),_0x44805b));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xc0')]=function(_0x323018){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xc1'),_0x323018['label']));if(!this[_0x88ce('0xa4')](_0x323018[_0x88ce('0xa9')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xc2'));}var _0x41a612=_0x323018[_0x88ce('0xa9')];if(this['isConfigured'](_0x323018[_0x88ce('0x78')])){_0x41a612+=','+_0x323018[_0x88ce('0x78')];}var _0xd75991=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xc3'),_0x41a612);if(_0xd75991[_0x88ce('0x9e')]===-0x1){return _0xd75991;}var _0x4aaa23=this[_0x88ce('0xab')]('RECOG_CONFIDENCE()',_0x88ce('0xc4'));if(_0x4aaa23[_0x88ce('0x9e')]===-0x1){return _0x4aaa23;}var _0x2e1e5a=this['getAndSetVariable'](_0x88ce('0xad'),_0x88ce('0xc5'));if(_0x2e1e5a[_0x88ce('0x9e')]===-0x1){return _0x2e1e5a;}var _0xb537f3=this[_0x88ce('0xab')](_0x88ce('0xae'),_0x88ce('0xc6'));if(_0xb537f3['result']===-0x1){return _0xb537f3;}return this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0x41a612));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xc7')]=function(_0x1a9c69){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xc8'),_0x1a9c69[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x1a9c69[_0x88ce('0xa9')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xc2'));}var _0x4755bb=_0x1a9c69[_0x88ce('0xa9')];if(this[_0x88ce('0xa4')](_0x1a9c69['options'])){_0x4755bb+=','+_0x1a9c69[_0x88ce('0x78')];}var _0x59e549=this['channel'][_0x88ce('0x59')](_0x88ce('0xc3'),_0x4755bb);if(_0x59e549['result']===-0x1){return _0x59e549;}var _0x31041e=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x88ce('0xc9'));if(_0x31041e['result']===-0x1){return _0x31041e;}var _0x705aa3=this[_0x88ce('0xab')](_0x88ce('0xad'),'SESTEK_ASR_TRANSCRIPT');if(_0x705aa3[_0x88ce('0x9e')]===-0x1){return _0x705aa3;}var _0x330326=this[_0x88ce('0xab')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x330326[_0x88ce('0x9e')]===-0x1){return _0x330326;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0x4755bb));};AGIVertices['prototype']['database']=function(_0x487ec5){logger[_0x88ce('0x31')](util['format'](_0x88ce('0xca'),_0x487ec5[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x487ec5[_0x88ce('0xcb')])){return this['channel'][_0x88ce('0x30')](_0x487ec5,_0x88ce('0xcc'));}var _0x5275da=this[_0x88ce('0x1b')][_0x88ce('0x70')](this,_0x487ec5['odbc_id']);if(!_0x5275da){return this['channel'][_0x88ce('0x30')](_0x487ec5,_0x88ce('0xcd'));}if(!this['isConfigured'](_0x487ec5[_0x88ce('0x33')])){return this['channel']['error'](_0x487ec5,_0x88ce('0xce'));}var _0x502487=_0x487ec5[_0x88ce('0x33')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('query:\x20%s',_0x502487));var _0x1ee1bc=this['getQueryOdbc'][_0x88ce('0x70')](this,_0x5275da,_0x502487);this['createSquareDetailsReport']['sync'](this,_0x487ec5,_0x502487);if(!this[_0x88ce('0xa4')](_0x487ec5['variable_id'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2c1a3f=this['getVariable'][_0x88ce('0x70')](this,_0x487ec5[_0x88ce('0xcf')]);if(!_0x2c1a3f){return this[_0x88ce('0x10')]['error'](_0x487ec5,'no\x20variable\x20found');}var _0x2bce67=this;_0x1ee1bc['forEach'](function(_0x95387d,_0xc06dd0){Object[_0x88ce('0xd0')](_0x95387d)['forEach'](function(_0x1f7194){_0x2bce67[_0x88ce('0x10')]['setVariable'](util['format'](_0x88ce('0xd1'),_0x2c1a3f,_0xc06dd0,_0x1f7194),_0x95387d[_0x1f7194]);});});this['channel'][_0x88ce('0xa0')](util['format']('%s_ROWS_COUNT',_0x2c1a3f),_0x1ee1bc[_0x88ce('0x98')]);return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xd2'),_0x2c1a3f));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xd3')]=function(_0x31f880){logger[_0x88ce('0xd4')](util[_0x88ce('0x2c')](_0x88ce('0xd5'),_0x31f880[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x31f880[_0x88ce('0xd6')])){return this['channel'][_0x88ce('0x30')](_0x31f880,_0x88ce('0xd7'));}var _0x25dee6=this[_0x88ce('0x1e')][_0x88ce('0x70')](this,_0x31f880[_0x88ce('0xd6')]);if(!_0x25dee6){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x31f880,_0x88ce('0xd8'));}var _0x23e1d0=this['channel'][_0x88ce('0x59')](_0x88ce('0xd9'),[util[_0x88ce('0x2c')](_0x88ce('0xda'),_0x25dee6),_0x31f880[_0x88ce('0x67')],_0x31f880[_0x88ce('0xdb')],_0x31f880['url']]);if(_0x23e1d0[_0x88ce('0x9e')]===-0x1){return _0x23e1d0;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xdc'),_0x88ce('0xd9')));};AGIVertices['prototype'][_0x88ce('0xdd')]=function(_0x3bd15e){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xde'),_0x3bd15e[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x3bd15e[_0x88ce('0x80')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xdf'));}if(!this['isConfigured'](_0x3bd15e[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20text\x20configured');}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x3bd15e);this[_0x88ce('0x44')](_0x3bd15e['text'],'in','','');this['channel'][_0x88ce('0xaa')](util['format']('Trying\x20Dialogflow:\x20%s',_0x3bd15e['text']));var _0x4511b0=this[_0x88ce('0x79')][_0x88ce('0x70')](this,_0x3bd15e);if(_0x4511b0){for(var _0xaf561c in _0x4511b0){if(_0x4511b0[_0x88ce('0x95')](_0xaf561c)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format']('DIALOGFLOW_%s',_0xaf561c[_0x88ce('0x6a')]()),_0x4511b0[_0xaf561c]);}}this['createSquareMessage'](_0x4511b0[_0x88ce('0xe1')],'out',_0x88ce('0xdd'),'');return this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xe2'),_0x4511b0['speech']));}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x3bd15e,_0x88ce('0xe3'));};AGIVertices['prototype'][_0x88ce('0xe4')]=function(_0x3623be){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3623be[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x7c')])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x7d')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe5'));}if(!this[_0x88ce('0xa4')](_0x3623be['private_key'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe6'));}if(!this[_0x88ce('0xa4')](_0x3623be['dialogflowV2_language'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe7'));}if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this['channel'][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x3623be);this[_0x88ce('0x44')](_0x3623be[_0x88ce('0x5e')],'in','','');this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xe8'),_0x3623be['text']));var _0x186327=this[_0x88ce('0x7b')][_0x88ce('0x70')](this,_0x3623be);if(_0x186327){for(var _0x2bc003 in _0x186327){if(_0x186327['hasOwnProperty'](_0x2bc003)){if(_0x2bc003!=='providerResponse'){this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')](_0x88ce('0xe9'),_0x2bc003['toUpperCase']()),_0x186327[_0x2bc003]);}}}this[_0x88ce('0x44')](_0x186327[_0x88ce('0xe1')],_0x88ce('0xea'),_0x88ce('0xe4'),_0x186327[_0x88ce('0xeb')]);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xec'),_0x186327[_0x88ce('0xe1')]));}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x3623be,_0x88ce('0xed'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xee')]=function(_0x191d41){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xef'),_0x191d41[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x191d41[_0x88ce('0xf0')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xf1'));}if(!this['isConfigured'](_0x191d41['username'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xf2'));}if(!this[_0x88ce('0xa4')](_0x191d41[_0x88ce('0xf3')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x191d41['ndassistant_url'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x191d41);this[_0x88ce('0x44')](_0x191d41[_0x88ce('0x5e')],'in','','');this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xf4'),_0x191d41[_0x88ce('0x5e')]));var _0x2eaa64=this[_0x88ce('0x7e')][_0x88ce('0x70')](this,_0x191d41);if(_0x2eaa64){for(var _0x45b8e8 in _0x2eaa64){if(_0x2eaa64[_0x88ce('0x95')](_0x45b8e8)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format'](_0x88ce('0xf5'),_0x45b8e8['toUpperCase']()),_0x2eaa64[_0x45b8e8]);}}this[_0x88ce('0x44')](_0x2eaa64[_0x88ce('0xe1')],_0x88ce('0xea'),_0x88ce('0xee'),'');if(_0x2eaa64['audiofile']){this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xf6'),_0x2eaa64[_0x88ce('0xf7')]));var _0x969d32=this[_0x88ce('0x10')][_0x88ce('0xf8')](_0x2eaa64[_0x88ce('0xf7')]);try{fs[_0x88ce('0xf9')](_0x2eaa64[_0x88ce('0xf7')]+_0x88ce('0xfa'));}catch(_0xeecc16){logger[_0x88ce('0x30')](_0xeecc16);}return _0x969d32;}else{return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xfb'),_0x2eaa64['speech']));}}return this['channel'][_0x88ce('0x30')](_0x191d41,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x88ce('0x13')][_0x88ce('0xfc')]=function(_0x40cf93){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x40cf93['label']));return this['channel'][_0x88ce('0xaa')](_0x88ce('0xfc'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xfd')]=function(_0x181d7a){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xfe'),_0x181d7a[_0x88ce('0x3c')]));var _0x2e041b='';if(_0x181d7a[_0x88ce('0xff')]){if(!this['isConfigured'](_0x181d7a['trunk_id'])){return this[_0x88ce('0x10')]['error'](_0x181d7a,_0x88ce('0x100'));}else{var _0x1d5553=parseInt(_0x181d7a[_0x88ce('0xff')],0xa);if(isNaN(_0x1d5553)){_0x2e041b=_0x181d7a[_0x88ce('0xff')];}else{_0x2e041b=this['getTrunk'][_0x88ce('0x70')](this,_0x181d7a[_0x88ce('0xff')]);if(!_0x2e041b){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x181d7a,_0x88ce('0x101'));}}}}else if(_0x181d7a[_0x88ce('0x102')]){_0x2e041b=_0x181d7a[_0x88ce('0x102')];}else{return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x181d7a,_0x88ce('0x100'));}var _0x31e5b2=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xd9'),[util[_0x88ce('0x2c')]('SIP/%s/%s',_0x2e041b,_0x181d7a[_0x88ce('0x4b')]),_0x181d7a[_0x88ce('0x67')],_0x181d7a[_0x88ce('0xdb')],_0x181d7a[_0x88ce('0x65')]]);if(_0x31e5b2[_0x88ce('0x9e')]===-0x1){return _0x31e5b2;}return this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xdc'),'DIAL'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x103')]=function(_0x5b08a6){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x104'),_0x5b08a6[_0x88ce('0x3c')]));return this[_0x88ce('0x10')]['noop'](_0x88ce('0x103'));};AGIVertices['prototype'][_0x88ce('0xe')]=function(_0x258fcf){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x105'),_0x258fcf[_0x88ce('0x3c')]));if(_0x258fcf[_0x88ce('0xa1')]===0x0){return this[_0x88ce('0xa2')](_0x258fcf);}_0x258fcf[_0x88ce('0xa1')]-=0x1;if(!this[_0x88ce('0xa4')](_0x258fcf['file_id'])){return this[_0x88ce('0x10')]['error'](_0x258fcf,_0x88ce('0x106'));}var _0x2e5d2c=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x258fcf[_0x88ce('0x107')]);if(!_0x2e5d2c){return this[_0x88ce('0x10')]['error'](_0x258fcf,'no\x20file\x20audio\x20found');}if(!this[_0x88ce('0xa4')](_0x258fcf[_0x88ce('0xcf')])){return this[_0x88ce('0x10')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2b3edc=this[_0x88ce('0x10')][_0x88ce('0x108')](_0x2e5d2c,_0x258fcf['response'],_0x258fcf[_0x88ce('0x109')]);var _0x1825ea=_0x2b3edc['result']?_0x2b3edc[_0x88ce('0x9e')]['toString']():'';logger['info'](_0x88ce('0x10a'),JSON['stringify'](_0x2b3edc));if(_0x2b3edc[_0x88ce('0x9e')]===-0x1){this[_0x88ce('0x3a')]['sync'](this,_0x258fcf,_0x1825ea);return _0x2b3edc;}else if(_0x2b3edc[_0x88ce('0x9d')]===_0x88ce('0x67')){_0x2b3edc[_0x88ce('0x9e')]=_0x1825ea['length']>=parseInt(_0x258fcf['mindigit'])?'x':'i';}else{_0x2b3edc[_0x88ce('0x9e')]=_0x1825ea[_0x88ce('0x98')]>=parseInt(_0x258fcf[_0x88ce('0x10b')])&&_0x1825ea[_0x88ce('0x98')]<=parseInt(_0x258fcf[_0x88ce('0x109')])?'x':'i';}var _0x2c6d44=this['getVariable'][_0x88ce('0x70')](this,_0x258fcf[_0x88ce('0xcf')]);if(!_0x2c6d44){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x258fcf,_0x88ce('0x10c'));}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x2c6d44,_0x1825ea);if(this['isConfigured'](_0x258fcf[_0x88ce('0x10d')])){var _0x2a9391=parseInt(_0x258fcf[_0x88ce('0x10d')],0xa);var _0x22a46f=rs[_0x88ce('0x10e')]({'charset':'*','length':_0x2a9391});var _0x3ade53=_0x1825ea['length'];if(_0x3ade53>0x0){if(_0x3ade53>_0x2a9391){this['createSquareDetailsReport'][_0x88ce('0x70')](this,_0x258fcf,_0x258fcf['hiddendigitspos']===_0x88ce('0x10f')?_0x22a46f+_0x1825ea[_0x88ce('0x110')](_0x2a9391):_0x1825ea['substr'](0x0,_0x3ade53-_0x2a9391)+_0x22a46f);}else{this[_0x88ce('0x3a')]['sync'](this,_0x258fcf,rs[_0x88ce('0x10e')]({'charset':'*','length':_0x3ade53}));}}else{this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x258fcf,'');}}else{this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x258fcf,_0x1825ea);}return _0x2b3edc;};AGIVertices[_0x88ce('0x13')][_0x88ce('0xf')]=function(_0x1e749e){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x111'),_0x1e749e[_0x88ce('0x3c')]));return this['getdigits'](_0x1e749e);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x112')]=function(_0x576a33){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x576a33['label']));this['createSquareDetailsReport']['sync'](this,_0x576a33,_0x576a33[_0x88ce('0x113')]);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x114'),_0x576a33['goalname']));};AGIVertices['prototype'][_0x88ce('0x115')]=function(_0x5ee649){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5ee649['label']));if(!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x116')])||!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x89')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x117'));}if(!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x118'),_0x5ee649[_0x88ce('0x5e')]));var _0x501a5b=this['awsPolly']['sync'](this,_0x5ee649);if(_0x501a5b){this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x501a5b));var _0x315805=this[_0x88ce('0x10')]['streamFile'](_0x501a5b);try{fs[_0x88ce('0xf9')](_0x501a5b+_0x88ce('0xfa'));}catch(_0x1991ff){logger[_0x88ce('0x30')](_0x1991ff);}return _0x315805;}return this['channel'][_0x88ce('0x30')](_0x5ee649,_0x88ce('0x119'));};AGIVertices[_0x88ce('0x13')]['awslex']=function(_0x59f336){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x11a'),_0x59f336['label']));if(!this['isConfigured'](_0x59f336[_0x88ce('0x116')])||!this[_0x88ce('0xa4')](_0x59f336[_0x88ce('0x89')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0x117'));}if(!this[_0x88ce('0xa4')](_0x59f336['aws_bot_name'])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0x11b'));}if(!this[_0x88ce('0xa4')](_0x59f336[_0x88ce('0x5e')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x59f336);this[_0x88ce('0x44')](_0x59f336['text'],'in','','');this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x11c'),_0x59f336[_0x88ce('0x5e')]));var _0x5b5e08=this['awsLex'][_0x88ce('0x70')](this,_0x59f336);if(_0x5b5e08){for(var _0x34fdce in _0x5b5e08){if(_0x5b5e08[_0x88ce('0x95')](_0x34fdce)&&_[_0x88ce('0x91')](_0x5b5e08[_0x34fdce])){this['channel']['setVariable'](util['format'](_0x88ce('0x11d'),_0x34fdce[_0x88ce('0x6a')]()),_0x5b5e08[_0x34fdce]);}}if(_['isNil'](_0x5b5e08[_0x88ce('0x77')])){return this['channel'][_0x88ce('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x88ce('0x44')](_0x5b5e08['message'],_0x88ce('0xea'),_0x88ce('0x11e'),'');return this[_0x88ce('0x10')]['noop'](util['format'](_0x88ce('0x11f'),_0x5b5e08[_0x88ce('0x77')]));}}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x59f336,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x88ce('0x13')][_0x88ce('0x120')]=function(_0x5ea773){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x121'),_0x5ea773['label'],_0x5ea773[_0x88ce('0x67')]));if(!this[_0x88ce('0xa4')](_0x5ea773[_0x88ce('0x80')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xdf'));}var _0x4b2cde=_0x88ce('0x122');var _0x53e3ee=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0x2ef082=util[_0x88ce('0x2c')]('%s.%s',_0x53e3ee,_0x4b2cde);var _0x4ac48b=!![];if(_0x5ea773['beep']==='NOBEEP'){_0x4ac48b=![];}var _0x2dcf45=this[_0x88ce('0x10')][_0x88ce('0x124')](_0x53e3ee,_0x4b2cde,_0x5ea773['intKey'],_0x5ea773[_0x88ce('0x67')],undefined,_0x4ac48b);if(_0x2dcf45[_0x88ce('0x9e')]!==-0x1){this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x125'),_0x2ef082));var _0x34a5bf=this[_0x88ce('0x8c')]['sync'](this,_0x5ea773,_0x2ef082);if(_0x34a5bf){for(var _0x276ae3 in _0x34a5bf){if(_0x34a5bf[_0x88ce('0x95')](_0x276ae3)){this[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')]('GOOGLE_ASR_%s',_0x276ae3[_0x88ce('0x6a')]()),_0x34a5bf[_0x276ae3]);}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x126'),JSON[_0x88ce('0x73')](_0x34a5bf)));}}return _0x2dcf45;};AGIVertices['prototype'][_0x88ce('0x127')]=function(_0xd309b7){logger['info'](util['format'](_0x88ce('0x128'),_0xd309b7['label']));if(!this[_0x88ce('0xa4')](_0xd309b7[_0x88ce('0x129')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x12a'));}if(!this[_0x88ce('0xa4')](_0xd309b7[_0x88ce('0x12b')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x12c'));}var _0x407843=_0x88ce('0x122');var _0x2253f7=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0x3138cb=util['format'](_0x88ce('0x9a'),_0x2253f7,_0x407843);var _0x49f19a=!![];if(_0xd309b7[_0x88ce('0x12d')]===_0x88ce('0x12e')){_0x49f19a=![];}var _0x3142b0=this['channel'][_0x88ce('0x124')](_0x2253f7,_0x407843,_0xd309b7[_0x88ce('0x12f')],_0xd309b7[_0x88ce('0x67')],undefined,_0x49f19a);if(_0x3142b0[_0x88ce('0x9e')]!==-0x1){this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('tilde\x20%s\x20file\x20created',_0x3138cb));var _0x172225=this[_0x88ce('0x8e')][_0x88ce('0x70')](this,_0xd309b7,_0x3138cb);if(_0x172225){for(var _0x3bf56c in _0x172225){if(_0x172225['hasOwnProperty'](_0x3bf56c)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')]('TILDE_ASR_%s',_0x3bf56c[_0x88ce('0x6a')]()),_0x172225[_0x3bf56c]);}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0x88ce('0x73')](_0x172225)));}}return _0x3142b0;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x130')]=function(_0x10be63){logger['info'](util['format'](_0x88ce('0x131'),_0x10be63['label']));return this['channel'][_0x88ce('0x132')](_0x10be63[_0x88ce('0x3f')],_0x10be63[_0x88ce('0x133')],_0x10be63[_0x88ce('0x40')]);};AGIVertices[_0x88ce('0x13')]['gotoif']=function(_0x55e884){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x134'),_0x55e884['label']));if(!this[_0x88ce('0xa4')](_0x55e884['condition'])){return this['channel']['error'](_0x55e884,_0x88ce('0x135'));}try{var _0x17be65=eval(_0x55e884[_0x88ce('0x136')])?_0x88ce('0x137'):'false';this[_0x88ce('0x10')]['noop'](util['format'](_0x88ce('0x138'),_0x55e884[_0x88ce('0x136')],_0x17be65));return{'code':0xc8,'result':_0x17be65};}catch(_0x15bbde){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x139')]=function(_0x18b256){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x13a'),_0x18b256[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x18b256[_0x88ce('0x13b')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x18b256,_0x88ce('0x13c'));}var _0x1658a5=this[_0x88ce('0x28')]['sync'](this,_0x18b256[_0x88ce('0x13b')]);if(!_0x1658a5){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x18b256,_0x88ce('0x13d'));}for(var _0x38b7fb=0x0;_0x38b7fb<_0x1658a5[_0x88ce('0x98')];_0x38b7fb+=0x1){var _0x61078b=this[_0x88ce('0x10')][_0x88ce('0x14')](util[_0x88ce('0x2c')]('IFTIME(%s?true:false)',_0x1658a5[_0x38b7fb]));if(_0x61078b[_0x88ce('0x9e')]===-0x1){return _0x61078b;}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x61078b[_0x88ce('0x9d')]));if(_0x61078b[_0x88ce('0x9d')]==='true'){logger[_0x88ce('0x31')](util['format']('IFTIME\x20%s\x20%s',_0x1658a5[_0x38b7fb],_0x88ce('0x137')));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x137')));return{'code':0xc8,'result':_0x88ce('0x137')};}else{logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x13f')));this['channel']['noop'](util['format'](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x13f')));}}return{'code':0xc8,'result':_0x88ce('0x13f')};};AGIVertices[_0x88ce('0x13')][_0x88ce('0x140')]=function(_0x56e8be){logger[_0x88ce('0x31')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x56e8be['label']));return this[_0x88ce('0x10')][_0x88ce('0x140')]();};AGIVertices[_0x88ce('0x13')][_0x88ce('0x141')]=function(_0x5b2b86){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x142'),_0x5b2b86['label']));if(!this['isConfigured'](_0x5b2b86[_0x88ce('0x80')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xdf'));}var _0x3d026d=_0x88ce('0x122');var _0x13cfd3=util['format'](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0xd67fd3=util['format']('%s.%s',_0x13cfd3,_0x3d026d);var _0x1a61f7=!![];if(_0x5b2b86['beep']===_0x88ce('0x12e')){_0x1a61f7=![];}var _0xfcc57a=this[_0x88ce('0x10')][_0x88ce('0x124')](_0x13cfd3,_0x3d026d,_0x5b2b86[_0x88ce('0x12f')],_0x5b2b86[_0x88ce('0x67')],undefined,_0x1a61f7);if(_0xfcc57a[_0x88ce('0x9e')]!==-0x1){this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x143'),_0xd67fd3));var _0x2f3a0e=this[_0x88ce('0x82')]['sync'](this,_0x5b2b86,_0xd67fd3);if(_0x2f3a0e){for(var _0xcfa5dc in _0x2f3a0e){if(_0x2f3a0e[_0x88ce('0x95')](_0xcfa5dc)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format'](_0x88ce('0x144'),_0xcfa5dc[_0x88ce('0x6a')]()),_0x2f3a0e[_0xcfa5dc]);}}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x145'),JSON[_0x88ce('0x73')](_0x2f3a0e)));}}return _0xfcc57a;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x146')]=function(_0x5c0861){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x147'),_0x5c0861[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x5c0861[_0x88ce('0x80')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xdf'));}if(!this[_0x88ce('0xa4')](_0x5c0861[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x148'),_0x5c0861[_0x88ce('0x5e')]));var _0x307c7e=this['ispeechTTS'][_0x88ce('0x70')](this,_0x5c0861);if(_0x307c7e){this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x143'),_0x307c7e));var _0x44cb27=this['channel'][_0x88ce('0xf8')](_0x307c7e,_0x5c0861[_0x88ce('0x12f')]);try{fs[_0x88ce('0xf9')](_0x307c7e+_0x88ce('0xfa'));}catch(_0xa4ea0b){logger['error'](_0xa4ea0b);}return _0x44cb27;}return this['channel'][_0x88ce('0x30')](_0x5c0861,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0xcac372){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x149'),_0xcac372[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0xcac372[_0x88ce('0x14a')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0xcac372,_0x88ce('0x14b'));}logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));var _0x5b91a1=this[_0x88ce('0x14d')][_0x88ce('0x70')](this,_0xcac372[_0x88ce('0x14a')]);if(_0x5b91a1){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));this['channel'][_0x88ce('0xaa')](util['format'](_0x88ce('0x14e'),this['channel']['callerid'],_0xcac372[_0x88ce('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14f'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14f'),this[_0x88ce('0x10')]['callerid'],_0xcac372['findBy']));return{'code':0xc8,'result':_0x88ce('0x150')};}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x151')]=function(_0x3cb22a){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x152'),_0x3cb22a[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x3cb22a[_0x88ce('0x14a')])){return this[_0x88ce('0x10')]['error'](_0x3cb22a,_0x88ce('0x14b'));}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x3cb22a[_0x88ce('0x14a')]));var _0x5cff82=this[_0x88ce('0x55')][_0x88ce('0x70')](this,_0x3cb22a['findBy']);if(_0x5cff82){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x3cb22a[_0x88ce('0x14a')]));this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')]['callerid'],_0x3cb22a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14f'),this['channel']['callerid'],_0x3cb22a[_0x88ce('0x14a')]));this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')]['callerid'],_0x3cb22a['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x88ce('0x153')]=function(_0x5ef9f0){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x154'),_0x5ef9f0[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x5ef9f0[_0x88ce('0x155')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x5ef9f0,_0x88ce('0x156'));}this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('math\x20%s',_0x5ef9f0[_0x88ce('0x155')]));var _0x5c18c9=eval(_0x5ef9f0[_0x88ce('0x155')]);if(!this[_0x88ce('0xa4')](_0x5ef9f0[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x157'));}var _0x389614=this['getVariable']['sync'](this,_0x5ef9f0[_0x88ce('0xcf')]);if(!_0x389614){return this['channel']['error'](_0x5ef9f0,_0x88ce('0x10c'));}if(_['isArray'](_0x5c18c9)){var _0x3dd6a7=this;_0x5c18c9['forEach'](function(_0xde52bb,_0x4f35c0){_0x3dd6a7[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')](_0x88ce('0x158'),_0x389614,_0x4f35c0),_0xde52bb);});return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('variable\x20%s[key]\x20set',_0x389614));}else{return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x389614,_0x5c18c9);}};AGIVertices[_0x88ce('0x13')][_0x88ce('0xd')]=function(_0x17b32b){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x159'),_0x17b32b[_0x88ce('0x3c')]));if(_0x17b32b[_0x88ce('0xa1')]===0x0){return this[_0x88ce('0xa2')](_0x17b32b);}_0x17b32b['retry']-=0x1;if(!this['isConfigured'](_0x17b32b[_0x88ce('0x107')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x17b32b,'no\x20file\x20audio\x20selected');}var _0x48c3bd=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x17b32b['file_id']);if(!_0x48c3bd){return this['channel'][_0x88ce('0x30')](_0x17b32b,_0x88ce('0x15a'));}var _0x287b54=this[_0x88ce('0x10')][_0x88ce('0x108')](_0x48c3bd,_0x17b32b[_0x88ce('0x15b')],_0x17b32b[_0x88ce('0x15c')]);var _0x1c4968=_0x287b54[_0x88ce('0x9e')];if(_0x287b54[_0x88ce('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x17b32b,'-1');return _0x287b54;}else if(_0x287b54[_0x88ce('0x9d')]===_0x88ce('0x67')){_0x287b54[_0x88ce('0x9e')]=_0x287b54[_0x88ce('0x9e')][_0x88ce('0x98')]>0x0?_0x287b54['result']:'t';}else if(_[_0x88ce('0x49')](_0x287b54[_0x88ce('0x9e')])){_0x287b54['result']='#';_0x1c4968='#';}if(!this['isConfigured'](_0x17b32b[_0x88ce('0xcf')])){this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x157'));}else{var _0x1d97c5=this['getVariable'][_0x88ce('0x70')](this,_0x17b32b[_0x88ce('0xcf')]);if(!_0x1d97c5){return this[_0x88ce('0x10')]['error'](_0x17b32b,'no\x20variable\x20found');}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x1d97c5,_0x1c4968);}this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x17b32b,_0x1c4968);return _0x287b54;};AGIVertices['prototype'][_0x88ce('0xaa')]=function(_0x1957b8){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x15d'),_0x1957b8[_0x88ce('0x3c')]));return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x1957b8[_0x88ce('0x15e')]||_0x1957b8['label']);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x15f')]=function(_0x28bc1a){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x160'),_0x28bc1a['label']));if(!this[_0x88ce('0xa4')](_0x28bc1a[_0x88ce('0x14a')])){return this[_0x88ce('0x10')]['error'](_0x28bc1a,_0x88ce('0x14b'));}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a[_0x88ce('0x14a')]));var _0x2229c0=this['getPause'][_0x88ce('0x70')](this,_0x28bc1a[_0x88ce('0x161')]);var _0x5b7617=this['agentPause'][_0x88ce('0x70')](this,_0x28bc1a['findBy'],_0x2229c0);if(_0x5b7617){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a['findBy']));this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x162')};}else{logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14f'),this['channel'][_0x88ce('0x3d')],_0x28bc1a['findBy']));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')]['callerid'],_0x28bc1a[_0x88ce('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x88ce('0x163')]=function(_0x1cdc31){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1cdc31[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x1cdc31[_0x88ce('0x107')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x1cdc31,_0x88ce('0x106'));}var _0x4a0b2a=this['getSound'][_0x88ce('0x70')](this,_0x1cdc31[_0x88ce('0x107')]);if(!_0x4a0b2a){return this[_0x88ce('0x10')]['error'](_0x1cdc31,_0x88ce('0x15a'));}var _0x7c3e20=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0x164'),[_0x4a0b2a,_0x1cdc31[_0x88ce('0xdb')]]);if(_0x7c3e20[_0x88ce('0x9e')]===-0x1){return _0x7c3e20;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x165'),_0x88ce('0x164'),_0x4a0b2a));};AGIVertices['prototype'][_0x88ce('0x166')]=function(_0x183354){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x183354[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x183354[_0x88ce('0x167')])){return this[_0x88ce('0x10')]['error'](_0x183354,_0x88ce('0x168'));}var _0x575b0b='';var _0x50c693=parseInt(_0x183354[_0x88ce('0x167')],0xa);if(isNaN(_0x50c693)){_0x575b0b=_0x183354[_0x88ce('0x167')];}else{_0x575b0b=this[_0x88ce('0x18')][_0x88ce('0x70')](this,_0x183354[_0x88ce('0x167')]);if(!_0x575b0b){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x183354,'no\x20queue\x20found');}}var _0x2e409d='';if(this[_0x88ce('0xa4')](_0x183354[_0x88ce('0x107')])){var _0x2b8854=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x183354[_0x88ce('0x107')]);if(_0x2b8854){_0x2e409d=_0x2b8854;}}this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x183354,_0x575b0b);if(_0x183354['opts'][_0x88ce('0x169')]('x')<0x0){_0x183354[_0x88ce('0xdb')]+='x';}if(_0x183354[_0x88ce('0xdb')][_0x88ce('0x169')]('X')<0x0){_0x183354[_0x88ce('0xdb')]+='X';}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x88ce('0x16a'),_0x575b0b?_0x575b0b['toLowerCase']():'');var _0x55ad01=this[_0x88ce('0x10')]['exec'](_0x88ce('0x16b'),[_0x575b0b,_0x183354[_0x88ce('0xdb')],_0x183354['url'],_0x2e409d,_0x183354[_0x88ce('0x67')],_0x183354[_0x88ce('0x8')],_0x183354[_0x88ce('0x16c')],_0x183354[_0x88ce('0x16d')],'',_0x183354['position']]);if(_0x55ad01[_0x88ce('0x9e')]===-0x1){return _0x55ad01;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x88ce('0x16b'),_0x575b0b));};AGIVertices[_0x88ce('0x13')]['record']=function(_0x48ea5d){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x16e'),_0x48ea5d['label']));var _0x4791d1=_0x48ea5d[_0x88ce('0x16f')]||_0x88ce('0x122');var _0xe2a229=util[_0x88ce('0x2c')](_0x88ce('0x170'),this[_0x88ce('0x10')][_0x88ce('0x3b')],rs[_0x88ce('0x10e')](0x5));var _0x2f04c8=util['format'](_0x88ce('0x171'),FILES_PATH,_0xe2a229,_0x4791d1);var _0x7d7c24=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,_0xe2a229);this[_0x88ce('0x172')][_0x88ce('0x70')](this,_0x48ea5d,_0xe2a229,_0x2f04c8);this['channel'][_0x88ce('0xa0')](_0x88ce('0x173'),_0xe2a229);logger[_0x88ce('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x7d7c24,_0x4791d1,_0x48ea5d[_0x88ce('0x174')],_0x48ea5d['timeout']);return this[_0x88ce('0x10')][_0x88ce('0x124')](_0x7d7c24,_0x4791d1,_0x48ea5d['escape_digits'],_0x48ea5d['timeout'],undefined,!![]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x175')]=function(_0x1ec495){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x176'),_0x1ec495['label']));if(!this[_0x88ce('0xa4')](_0x1ec495[_0x88ce('0x65')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0x177'));}var _0x5edea0=this[_0x88ce('0x64')][_0x88ce('0x70')](this,_0x1ec495);logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x178'),util[_0x88ce('0x179')](_0x5edea0,{'showHidden':![],'depth':null})));if(!this[_0x88ce('0xa4')](_0x1ec495[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x17a'));}var _0x313a35=this[_0x88ce('0x14')]['sync'](this,_0x1ec495[_0x88ce('0xcf')]);if(!_0x313a35){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x1ec495,_0x88ce('0x10c'));}this[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')](_0x88ce('0x17b'),_0x313a35),_0x5edea0[_0x88ce('0x76')]?_0x5edea0[_0x88ce('0x76')]:_0x88ce('0x17c'));this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')]('%s_STATUS_MESSAGE',_0x313a35),_0x5edea0[_0x88ce('0x75')]?_0x5edea0['statusMessage']:'OK');if(_0x5edea0[_0x88ce('0x6b')]){try{this[_0x88ce('0x99')](_0x5edea0[_0x88ce('0x6b')],_0x313a35);}catch(_0x582b56){logger[_0x88ce('0x30')](util[_0x88ce('0x2c')](_0x88ce('0x17d'),_0x313a35));}}return this['channel'][_0x88ce('0xaa')](util['format']('variable\x20%s\x20set',_0x313a35));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x17e')]=function(_0x128a56){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x128a56[_0x88ce('0x3c')]));return this['channel'][_0x88ce('0x17f')](_0x128a56[_0x88ce('0x180')][_0x88ce('0x5b')](/\s+/g,''),_0x128a56[_0x88ce('0x174')]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x181')]=function(_0xddac71){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x182'),_0xddac71['label']));return this['channel']['sayNumber'](_0xddac71[_0x88ce('0x183')]['replace'](/\s+/g,''),_0xddac71[_0x88ce('0x174')]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x184')]=function(_0x4b55af){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4b55af[_0x88ce('0x3c')]));return this['channel'][_0x88ce('0x185')](_0x4b55af[_0x88ce('0x5e')],_0x4b55af['escape_digits']);};AGIVertices['prototype'][_0x88ce('0x186')]=function(_0x5c73a0){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x187'),_0x5c73a0[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x5c73a0['account_id'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x188'));}var _0x44af47=this['getMailAccount'][_0x88ce('0x70')](this,_0x5c73a0['account_id']);if(!_0x44af47||!_0x44af47[_0x88ce('0x189')]){return this[_0x88ce('0x10')]['error'](_0x5c73a0,_0x88ce('0x18a'));}var _0x331d0d={'from':util[_0x88ce('0x2c')](_0x88ce('0x18b'),_0x44af47[_0x88ce('0x16')],_0x44af47[_0x88ce('0x18c')]||_0x44af47['Smtp']['user']),'to':_0x5c73a0['to']||'','cc':_0x5c73a0['cc']||'','bcc':_0x5c73a0['bcc']||'','subject':_0x5c73a0['subject'],'html':_0x5c73a0[_0x88ce('0x5e')],'text':_0x5c73a0['text']};if(this[_0x88ce('0xa4')](_0x5c73a0[_0x88ce('0x18d')])){}logger[_0x88ce('0xd4')]('sendMail\x20message',JSON[_0x88ce('0x73')](_0x331d0d));this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x5c73a0,_0x5c73a0['account_id']);this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x44af47[_0x88ce('0x16')]));this[_0x88ce('0x27')][_0x88ce('0x70')](this,_0x44af47[_0x88ce('0x18e')],_0x331d0d);return this['channel'][_0x88ce('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x88ce('0x13')][_0x88ce('0x18f')]=function(_0x26430a){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x26430a['label']));return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x190'));};AGIVertices[_0x88ce('0x13')]['sendSMS']=function(_0x187a27){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x191'),_0x187a27['label']));if(!this[_0x88ce('0xa4')](_0x187a27[_0x88ce('0x192')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x193'));}var _0x12589e=this[_0x88ce('0x37')][_0x88ce('0x70')](this,_0x187a27['sms_account_id']);if(!_0x12589e){return this['channel']['error'](_0x187a27,'no\x20sms\x20account\x20found');}var _0xf8e6d3={'body':_0x187a27['sms_text'],'phone':_0x187a27['to']||'','SmsAccountId':_0x12589e['id']};logger[_0x88ce('0xd4')]('sendSMS\x20message',JSON[_0x88ce('0x73')](_0xf8e6d3));this['createSquareDetailsReport'][_0x88ce('0x70')](this,_0x187a27,_0x187a27[_0x88ce('0x192')]);this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x194'),_0x12589e['name']));this[_0x88ce('0x39')][_0x88ce('0x70')](this,_0xf8e6d3);return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x195'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x196')]=function(_0x112e14){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x197'),_0x112e14[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x112e14[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x112e14,_0x88ce('0x198'));}var _0x15ce28=this[_0x88ce('0x14')]['sync'](this,_0x112e14['variable_id']);if(!_0x15ce28){return this[_0x88ce('0x10')]['error'](_0x112e14,_0x88ce('0x10c'));}return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x15ce28,_0x112e14['variable_value']);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x199')]=function(_0x1a9e50){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x19a'),_0x1a9e50[_0x88ce('0x3c')]));this[_0x88ce('0x10')][_0x88ce('0xaa')]('START\x20CALLY\x20SQUARE');if(_0x1a9e50[_0x88ce('0xb3')]===_0x88ce('0x19b')){this[_0x88ce('0x10')]['noop']('Answer');return this[_0x88ce('0x10')][_0x88ce('0xb3')]();}return this[_0x88ce('0x10')]['noop'](_0x88ce('0x19c'));};AGIVertices[_0x88ce('0x13')]['subproject']=function(_0x274568){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x274568[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x274568[_0x88ce('0x19d')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x274568,_0x88ce('0x19e'));}var _0x245ab6=this[_0x88ce('0x19f')]['sync'](this,_0x274568[_0x88ce('0x19d')]);if(!this[_0x88ce('0xa4')](_0x245ab6)){return this[_0x88ce('0x10')]['error'](_0x274568,util[_0x88ce('0x2c')](_0x88ce('0x1a0'),_0x274568[_0x88ce('0x19d')]));}if(_0x245ab6===this['channel'][_0x88ce('0x42')]){return this['channel'][_0x88ce('0x30')](_0x274568,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x88ce('0x3a')]['sync'](this,_0x274568,_0x245ab6);var _0x937ca8=this[_0x88ce('0x10')]['exec'](_0x88ce('0x1a1'),util[_0x88ce('0x2c')](_0x88ce('0x1a2'),config[_0x88ce('0x8')][_0x88ce('0x1a3')]||_0x88ce('0x1a4'),_0x245ab6,this[_0x88ce('0x10')][_0x88ce('0x42')]));if(_0x937ca8[_0x88ce('0x9e')]===-0x1){return _0x937ca8;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x88ce('0x1a1'),_0x245ab6));};AGIVertices[_0x88ce('0x13')]['system']=function(_0x522655){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x1a5'),_0x522655[_0x88ce('0x3c')]));var _0x88788f=this[_0x88ce('0x58')]['sync'](this,_0x522655['command']);this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x522655,_0x522655['command']);if(this[_0x88ce('0xa4')](_0x522655[_0x88ce('0xcf')])){var _0x663a5a=this[_0x88ce('0x14')]['sync'](this,_0x522655['variable_id']);if(_0x663a5a){this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x663a5a,_0x88788f);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x1a6'),_0x522655[_0x88ce('0x1a7')],_0x663a5a));}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x1a8'),_0x522655['command']));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1a9')]=function(_0x47e183){logger[_0x88ce('0x31')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x47e183[_0x88ce('0x3c')]));_0x47e183['text']=_0x47e183[_0x88ce('0x5e')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x47e183[_0x88ce('0x1aa')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x1ab'));}if(!this[_0x88ce('0xa4')](_0x47e183[_0x88ce('0x5e')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x47e183['text']));var _0x54e2dc=this[_0x88ce('0x5c')][_0x88ce('0x70')](this,_0x47e183);if(_0x54e2dc){this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x54e2dc));var _0x27774c=this['channel']['streamFile'](_0x54e2dc);try{fs['unlink'](_0x54e2dc+_0x88ce('0xfa'));}catch(_0x52cde4){logger[_0x88ce('0x30')](_0x52cde4);}return _0x27774c;}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x47e183,_0x88ce('0x1ac'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1ad')]=function(_0x178ae3){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x178ae3[_0x88ce('0x3c')]));_0x178ae3[_0x88ce('0x5e')]=_0x178ae3[_0x88ce('0x5e')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x88ce('0xa4')](_0x178ae3[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x1ae'),_0x178ae3['text']));var _0x404dba=this[_0x88ce('0x1af')]['sync'](this,_0x178ae3);if(_0x404dba){this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x1b0'),_0x404dba));var _0x48dcef=this[_0x88ce('0x10')]['streamFile'](_0x404dba);try{fs[_0x88ce('0xf9')](_0x404dba+'.wav');}catch(_0x18f2bb){logger[_0x88ce('0x30')](_0x18f2bb);}return _0x48dcef;}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x178ae3,_0x88ce('0x1b1'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b2')]=function(_0x444f24){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x1b3'),_0x444f24[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x444f24[_0x88ce('0x14a')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x444f24,'no\x20find\x20by\x20configured');}logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));var _0x1f9fa1=this['agentUnpause'][_0x88ce('0x70')](this,_0x444f24[_0x88ce('0x14a')]);if(_0x1f9fa1){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this['channel'][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x162')};}else{logger['info'](util[_0x88ce('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')]['callerid'],_0x444f24[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x150')};}};AGIVertices['prototype'][_0x88ce('0x1b4')]=function(_0x3caf95){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x1b5'),_0x3caf95['label']));var _0x6f1b73=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0x1b6'),[_0x3caf95['mailbox'],_0x3caf95[_0x88ce('0x78')]]);if(_0x6f1b73[_0x88ce('0x9e')]===-0x1){return _0x6f1b73;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x165'),'VOICEMAIL',_0x3caf95[_0x88ce('0x1b7')]));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b8')]=function(_0x33382c){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x1b9'),_0x33382c[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x33382c[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x33382c,_0x88ce('0x198'));}var _0x504ee1=this[_0x88ce('0x14')][_0x88ce('0x70')](this,_0x33382c[_0x88ce('0xcf')]);if(!_0x504ee1){return this['channel'][_0x88ce('0x30')](_0x33382c,_0x88ce('0x10c'));}var _0x456973=this[_0x88ce('0x10')][_0x88ce('0x14')](_0x504ee1);return{'code':0xc8,'result':_0x456973[_0x88ce('0x9d')]?_0x456973['extra']:'-'};};String[_0x88ce('0x13')]['replaceAll']=function(_0x3a6788,_0x3f9185){return this[_0x88ce('0x9b')](_0x3a6788)[_0x88ce('0x1ba')](_0x3f9185);};module['exports']=AGIVertices; \ No newline at end of file +var _0x3070=['Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','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','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','email','user','subject','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','googleCloudTTS','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','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','agicommand','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','arg_1','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','callerid','isNil','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','replace','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','isArray','length','%s.%s','stringify','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','mrcpsynth','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','no\x20user\x20selected','getUser','sip_id','no\x20user\x20found','opts','url','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','DIAL','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','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','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block'];(function(_0x41f4e8,_0x55b05a){var _0x8a0693=function(_0x12e7d0){while(--_0x12e7d0){_0x41f4e8['push'](_0x41f4e8['shift']());}};_0x8a0693(++_0x55b05a);}(_0x3070,0x75));var _0x0307=function(_0x26b814,_0x12071e){_0x26b814=_0x26b814-0x0;var _0x4f4b2c=_0x3070[_0x26b814];return _0x4f4b2c;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x0307('0x0'));var sh=require('shelljs');var odbc=require(_0x0307('0x1'))();var rs=require(_0x0307('0x2'));var moment=require(_0x0307('0x3'));var Mustache=require(_0x0307('0x4'));var rp=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('agi');var config=require('../../config/environment');var shared=require(_0x0307('0x7'));var scripts=require(_0x0307('0x8'));var FILES_PATH=_0x0307('0x9');var recursiveMapAttributes=[_0x0307('0xa'),'rawBody'];var verticesWithRetry=[_0x0307('0xb'),_0x0307('0xc'),'getsecretdigits'];var AGIVertices=function(_0x13a24d,_0x4553f4,_0x187fb3){this[_0x0307('0xd')]=_0x13a24d;this[_0x0307('0xe')]=_0x4553f4;this[_0x0307('0xf')]=_0x187fb3;};AGIVertices[_0x0307('0x10')][_0x0307('0x11')]=function(_0x233966,_0x5905cc){this[_0x0307('0xe')]['getVariableById'](_0x233966)[_0x0307('0x12')](function(_0x224226){_0x5905cc(null,_0x224226?_0x224226[_0x0307('0x13')]:![]);})[_0x0307('0x14')](function(_0x161f31){_0x5905cc(_0x161f31);});};AGIVertices[_0x0307('0x10')][_0x0307('0x15')]=function(_0x39af75,_0x42d7c9){this[_0x0307('0xe')][_0x0307('0x16')](_0x39af75)[_0x0307('0x12')](function(_0x131320){_0x42d7c9(null,_0x131320?_0x131320[_0x0307('0x13')]:![]);})[_0x0307('0x14')](function(_0x546c92){_0x42d7c9(_0x546c92);});};AGIVertices[_0x0307('0x10')][_0x0307('0x17')]=function(_0x286f72,_0x5f11a5){this['rpc'][_0x0307('0x18')](_0x286f72)[_0x0307('0x12')](function(_0x38dfd6){_0x5f11a5(null,_0x38dfd6?_0x38dfd6[_0x0307('0x13')]:![]);})[_0x0307('0x14')](function(_0x16433e){_0x5f11a5(_0x16433e);});};AGIVertices[_0x0307('0x10')]['getSquareOdbc']=function(_0x3782a1,_0x53da8f){this[_0x0307('0xe')][_0x0307('0x19')](_0x3782a1)[_0x0307('0x12')](function(_0x31ac5){_0x53da8f(null,_0x31ac5?_0x31ac5['dsn']:![]);})[_0x0307('0x14')](function(_0x20c1c1){_0x53da8f(_0x20c1c1);});};AGIVertices[_0x0307('0x10')]['getUser']=function(_0x57ee29,_0x9c1223){this[_0x0307('0xe')]['getUserById'](_0x57ee29)[_0x0307('0x12')](function(_0x5f17ff){_0x9c1223(null,_0x5f17ff?_0x5f17ff[_0x0307('0x13')]:![]);})[_0x0307('0x14')](function(_0x34c776){_0x9c1223(_0x34c776);});};AGIVertices[_0x0307('0x10')]['getTrunk']=function(_0x49c3d7,_0xd0c3de){this[_0x0307('0xe')][_0x0307('0x1a')](_0x49c3d7)[_0x0307('0x12')](function(_0x3fde2f){_0xd0c3de(null,_0x3fde2f?_0x3fde2f[_0x0307('0x13')]:![]);})['catch'](function(_0x6de0d1){_0xd0c3de(_0x6de0d1);});};AGIVertices['prototype'][_0x0307('0x1b')]=function(_0x438ed4,_0x14e909){var _0x5b2f5f=this;this[_0x0307('0xe')][_0x0307('0x1c')](_0x438ed4)[_0x0307('0x12')](function(_0x46c723){_0x14e909(null,_0x46c723?_0x5b2f5f['getSoundPath'](_0x46c723[_0x0307('0x1d')]):![]);})['catch'](function(_0x319766){_0x14e909(_0x319766);});};AGIVertices[_0x0307('0x10')][_0x0307('0x1e')]=function(_0x57701c,_0x4d6db9){this[_0x0307('0xe')]['getMailAccountById'](_0x57701c)[_0x0307('0x12')](function(_0x1e0d07){_0x4d6db9(null,_0x1e0d07?_0x1e0d07:![]);})['catch'](function(_0x1363b1){_0x4d6db9(_0x1363b1);});};AGIVertices['prototype'][_0x0307('0x1f')]=function(_0x57c259,_0xf4e315,_0x297119){this[_0x0307('0xf')][_0x0307('0x1f')](_0x57c259,_0xf4e315)[_0x0307('0x12')](function(){_0x297119(null);})[_0x0307('0x14')](function(_0x3129ba){_0x297119(_0x3129ba);});};AGIVertices['prototype'][_0x0307('0x20')]=function(_0x798089,_0x5c46c6){this['rpc'][_0x0307('0x21')](_0x798089)['then'](function(_0x365b85){if(_0x365b85){if(_0x365b85[_0x0307('0x22')]){_0x5c46c6(null,[_0x365b85[_0x0307('0x23')]]);}else{_0x5c46c6(null,_[_0x0307('0x24')](_0x365b85[_0x0307('0x25')],_0x0307('0x23')));}}else{_0x5c46c6(null,![]);}})[_0x0307('0x14')](function(_0x5eabf0){_0x5c46c6(_0x5eabf0);});};AGIVertices[_0x0307('0x10')][_0x0307('0x26')]=function(_0x3cfb42){return util[_0x0307('0x27')](_0x0307('0x28'),FILES_PATH,_0x3cfb42);};AGIVertices[_0x0307('0x10')][_0x0307('0x29')]=function(_0x2e65d6,_0x318d95,_0x78873d){odbc[_0x0307('0x2a')](_0x2e65d6,function(_0x127172){if(_0x127172){logger[_0x0307('0x2b')](_0x0307('0x2c'),_0x127172);_0x78873d(_0x127172);}else{logger[_0x0307('0x2d')]('ODBC\x20connection\x20successfully');odbc[_0x0307('0x2e')](_0x318d95,function(_0x3b67c5,_0x5b0a3d){if(_0x3b67c5){logger[_0x0307('0x2d')](_0x0307('0x2f'),_0x318d95);_0x78873d(_0x3b67c5);}else{logger[_0x0307('0x2d')](_0x0307('0x30'),_0x318d95);odbc['close'](function(_0x4eabf2){if(_0x4eabf2){logger[_0x0307('0x2b')](_0x0307('0x31'),_0x4eabf2);}_0x78873d(null,_0x5b0a3d);});}});}});};AGIVertices[_0x0307('0x10')]['getSmsAccount']=function(_0x247eea,_0x5aa127){this[_0x0307('0xe')]['getSmsAccountById'](_0x247eea)[_0x0307('0x12')](function(_0x5c1b91){_0x5aa127(null,_0x5c1b91?_0x5c1b91:![]);})[_0x0307('0x14')](function(_0x504672){_0x5aa127(_0x504672);});};AGIVertices[_0x0307('0x10')][_0x0307('0x32')]=function(_0x1c019c,_0x2937bb){this[_0x0307('0xe')][_0x0307('0x32')](_0x1c019c)[_0x0307('0x12')](function(_0x4be9ac){_0x2937bb(null,_0x4be9ac);})[_0x0307('0x14')](function(_0x1296b8){_0x2937bb(_0x1296b8);});};AGIVertices['prototype'][_0x0307('0x33')]=function(_0x418ebf,_0x40d54c,_0x4ac849){this['rpc'][_0x0307('0x33')]({'uniqueid':this[_0x0307('0xd')]['uniqueid'],'node':_0x418ebf['label'],'application':_0x418ebf[_0x0307('0x34')],'data':_0x40d54c||null,'project_name':this[_0x0307('0xd')]['arg_1'],'callerid':this[_0x0307('0xd')]['callerid']})[_0x0307('0x12')](function(_0x529600){if(_0x4ac849){_0x4ac849(null,_0x529600);}})[_0x0307('0x14')](function(_0x7f6f54){if(_0x4ac849){_0x4ac849(_0x7f6f54);}});};AGIVertices[_0x0307('0x10')][_0x0307('0x35')]=function(_0x2cd252,_0x5a7084,_0xa925ef,_0x22a420){this['rpc'][_0x0307('0x35')]({'uniqueid':this['channel'][_0x0307('0x36')],'callerid':this[_0x0307('0xd')]['callerid'],'calleridname':this[_0x0307('0xd')][_0x0307('0x37')],'context':this[_0x0307('0xd')][_0x0307('0x38')],'extension':this[_0x0307('0xd')]['extension'],'priority':this[_0x0307('0xd')][_0x0307('0x39')],'accountcode':this[_0x0307('0xd')][_0x0307('0x3a')],'dnid':this[_0x0307('0xd')]['dnid'],'projectName':this[_0x0307('0xd')][_0x0307('0x3b')],'saveName':_0x5a7084,'filename':_0x2cd252['file']||_0x5a7084,'savePath':_0xa925ef})[_0x0307('0x12')](function(_0x310a99){_0x22a420(null,_0x310a99);})[_0x0307('0x14')](function(_0xe11ab5){_0x22a420(_0xe11ab5);});};AGIVertices[_0x0307('0x10')][_0x0307('0x3c')]=function(_0x39232a,_0x300d04,_0x4f62b1,_0x5b802d,_0x5567d5){this[_0x0307('0xe')]['createSquareMessage']({'uniqueid':this[_0x0307('0xd')][_0x0307('0x36')],'body':_0x39232a,'direction':_0x300d04,'providerName':_0x4f62b1,'providerResponse':_0x5b802d})['then'](function(_0x463047){if(_0x5567d5){_0x5567d5(null,_0x463047);}})[_0x0307('0x14')](function(_0x4f4e1f){if(_0x5567d5){_0x5567d5(_0x4f4e1f);}});};AGIVertices['prototype'][_0x0307('0x3d')]=function(_0xdb258d,_0x895c88){this[_0x0307('0xe')]['createCmContact']({'firstName':_[_0x0307('0x3e')](_0xdb258d[_0x0307('0x13')])||_['isNil'](_0xdb258d[_0x0307('0x13')])?_0x0307('0x3f')+Math[_0x0307('0x40')]():_0xdb258d[_0x0307('0x13')],'lastName':_[_0x0307('0x3e')](_0xdb258d['lastName'])||_['isNil'](_0xdb258d['lastName'])?null:_0xdb258d[_0x0307('0x41')],'phone':_0xdb258d['phone'],'ListId':_0xdb258d[_0x0307('0x42')],'scheduledat':_0xdb258d[_0x0307('0x43')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x0307('0x44'),'description':_0x0307('0x45')+_0xdb258d[_0x0307('0x43')][_0x0307('0x46')](),'priority':_0xdb258d[_0x0307('0x47')]})['then'](function(_0x3d195a){_0x895c88(null,_0x3d195a);})['catch'](function(_0x55ea23){_0x895c88(_0x55ea23);});};AGIVertices['prototype'][_0x0307('0x48')]=function(_0x2de5c8,_0xb38b24){this[_0x0307('0xe')][_0x0307('0x49')](_0x2de5c8)[_0x0307('0x12')](function(_0x103da3){_0xb38b24(null,_0x103da3?_0x103da3['name']:![]);})[_0x0307('0x14')](function(_0x222a4c){_0xb38b24(_0x222a4c);});};AGIVertices['prototype'][_0x0307('0x4a')]=function(_0xef2b6c,_0x1d3e36,_0xa67646){var _0x4139d4={'role':'agent'};_0x4139d4[_0xef2b6c]=this[_0x0307('0xd')]['callerid'];this[_0x0307('0xe')][_0x0307('0x4a')](_0x4139d4,_0x1d3e36,this[_0x0307('0xd')]['uniqueid'])[_0x0307('0x12')](function(_0x547e1b){_0xa67646(null,_['isNil'](_0x547e1b)?![]:!![]);})[_0x0307('0x14')](function(_0x5f2a0f){logger[_0x0307('0x2b')](_0x5f2a0f);_0xa67646(null,![]);});};AGIVertices[_0x0307('0x10')][_0x0307('0x4b')]=function(_0x1a25f2,_0x284686){var _0x53f7e7={'role':_0x0307('0x4c')};_0x53f7e7[_0x1a25f2]=this[_0x0307('0xd')][_0x0307('0x4d')];this[_0x0307('0xe')][_0x0307('0x4b')](_0x53f7e7)['then'](function(_0x2f0234){_0x284686(null,_[_0x0307('0x4e')](_0x2f0234)?![]:!![]);})[_0x0307('0x14')](function(_0x525dec){logger['error'](_0x525dec);_0x284686(null,![]);});};AGIVertices[_0x0307('0x10')][_0x0307('0x4f')]=function(_0x577670,_0x3e9e37){var _0x51d7a5={'role':_0x0307('0x4c')};_0x51d7a5[_0x577670]=this[_0x0307('0xd')][_0x0307('0x4d')];this['rpc']['agentLogout'](_0x51d7a5)[_0x0307('0x12')](function(_0x57f4b5){_0x3e9e37(null,_[_0x0307('0x4e')](_0x57f4b5)?![]:!![]);})[_0x0307('0x14')](function(_0x46ce1d){logger[_0x0307('0x2b')](_0x46ce1d);_0x3e9e37(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x5bf15b,_0x5e698f){var _0x3bad90={'role':'agent'};_0x3bad90[_0x5bf15b]=this[_0x0307('0xd')][_0x0307('0x4d')];var _0x2918cc=_0x5bf15b!=_0x0307('0x50')?util['format'](_0x0307('0x51'),_0x0307('0x52'),this['channel']['callerid']):undefined;this[_0x0307('0xe')][_0x0307('0x53')](_0x3bad90,_0x2918cc)[_0x0307('0x12')](function(_0x9fe9b5){_0x5e698f(null,_['isNil'](_0x9fe9b5)?![]:!![]);})[_0x0307('0x14')](function(_0x426418){logger[_0x0307('0x2b')](_0x426418);_0x5e698f(null,![]);});};AGIVertices[_0x0307('0x10')][_0x0307('0x54')]=function(_0x4ec703,_0xa9acdb){sh['exec'](_['trim'](_0x4ec703),function(_0xb65b98,_0x5f2152){var _0x102a14=_0x5f2152[_0x0307('0x55')](/(\r\n|\n|\r)/gm,'');_0xa9acdb(null,_0x102a14);});};AGIVertices[_0x0307('0x10')]['googleCloudTTS']=function(_0x29b930,_0x287dec){scripts['googleCloudTTS'](_0x29b930[_0x0307('0x56')],_0x29b930[_0x0307('0x57')]||_0x0307('0x58'),_0x29b930['text'],_0x29b930[_0x0307('0x59')]||_0x0307('0x5a'),_0x29b930[_0x0307('0x5b')]||_0x0307('0x5c'),_0x29b930[_0x0307('0x5d')]||'MP3')['then'](function(_0x36d7a1){_0x287dec(null,_0x36d7a1);})['catch'](function(_0x41d915){_0x287dec(_0x41d915);});};AGIVertices[_0x0307('0x10')][_0x0307('0x5e')]=function(_0x5d8a3b,_0x1eceec){scripts[_0x0307('0x5e')](_0x5d8a3b[_0x0307('0x58')],_0x5d8a3b[_0x0307('0x5f')]||'en',0x1)[_0x0307('0x12')](function(_0x2c7f84){_0x1eceec(null,_0x2c7f84);})['catch'](function(_0xf44895){_0x1eceec(_0xf44895);});};AGIVertices[_0x0307('0x10')][_0x0307('0x60')]=function(_0x37fce5,_0x3ecdaf){var _0x2574dd={'uri':_0x37fce5['url'],'method':_0x37fce5[_0x0307('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37fce5[_0x0307('0x62')])==='number'&&parseInt(_0x37fce5['timeout'])>=0x1?parseInt(_0x37fce5['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0307('0x63')]([_0x0307('0x64'),'PUT'],_0x2574dd[_0x0307('0x61')]['toUpperCase']())){try{_0x2574dd[_0x0307('0x65')]=_0x37fce5[_0x0307('0x66')]?JSON[_0x0307('0x67')](_0x37fce5[_0x0307('0x66')]):{};}catch(_0x5f9fc2){logger['error'](_0x0307('0x68'),_0x5f9fc2);}}try{_0x2574dd[_0x0307('0x69')]=_0x37fce5[_0x0307('0xa')]?JSON[_0x0307('0x67')](_0x37fce5[_0x0307('0xa')]):{};}catch(_0xc49e5e){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0xc49e5e);}if(_0x37fce5[_0x0307('0x6a')]){try{var _0x2ebed5=require(_0x37fce5[_0x0307('0x6a')])[_0x0307('0x6b')](this,_0x2574dd);_0x2574dd[_0x0307('0x6c')]=Mustache[_0x0307('0x6d')](_0x37fce5['url'],_0x2ebed5,{},['$$','$$']);if(_0x2574dd['headers']){_0x2574dd[_0x0307('0x69')]=JSON[_0x0307('0x67')](Mustache[_0x0307('0x6d')](JSON['stringify'](_0x2574dd[_0x0307('0x69')]),_0x2ebed5,{},['$$','$$']));}if(_0x2574dd[_0x0307('0x65')]){_0x2574dd['body']=JSON['parse'](Mustache[_0x0307('0x6d')](JSON['stringify'](_0x2574dd['body']),_0x2ebed5,{},['$$','$$']));}}catch(_0x1134a2){logger[_0x0307('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1134a2);}}rp(_0x2574dd)[_0x0307('0x12')](function(_0x109765){var _0x3ab192={'statusCode':_0x109765['statusCode']||0xc8,'statusMessage':_0x109765['statusMessage']||'OK','headers':_0x109765[_0x0307('0x69')]||{},'body':_0x109765[_0x0307('0x65')]||{}};_0x3ecdaf(null,_0x3ab192);})[_0x0307('0x14')](function(_0x2144f9){var _0x166f32={'statusCode':_0x2144f9[_0x0307('0x6e')]||0x1f4,'statusMessage':_0x2144f9['message']||_0x0307('0x6f'),'headers':_0x2144f9[_0x0307('0x70')][_0x0307('0x69')]||{},'body':_0x2144f9['options'][_0x0307('0x65')]||{}};_0x3ecdaf(null,_0x166f32);});};AGIVertices[_0x0307('0x10')][_0x0307('0x71')]=function(_0xdb2a90,_0x313480){scripts[_0x0307('0x71')](this[_0x0307('0xd')][_0x0307('0x36')],_0xdb2a90[_0x0307('0x72')],_0xdb2a90[_0x0307('0x58')],_0xdb2a90[_0x0307('0x73')]||'en')[_0x0307('0x12')](function(_0x5ce8ae){_0x313480(null,_0x5ce8ae);})['catch'](function(_0x459fa6){_0x313480(_0x459fa6);});};AGIVertices['prototype'][_0x0307('0x74')]=function(_0x22beb6,_0x46e356){scripts[_0x0307('0x74')](this[_0x0307('0xd')][_0x0307('0x36')],_0x22beb6[_0x0307('0x75')],_0x22beb6[_0x0307('0x76')],_0x22beb6['private_key'],_0x22beb6[_0x0307('0x58')],_0x22beb6[_0x0307('0x77')]||'en')[_0x0307('0x12')](function(_0x28a2a4){_0x46e356(null,_0x28a2a4);})[_0x0307('0x14')](function(_0xae1334){_0x46e356(_0xae1334);});};AGIVertices[_0x0307('0x10')]['sestekNDA']=function(_0x5bbab0,_0x263d58){scripts[_0x0307('0x78')](this[_0x0307('0xd')],_0x5bbab0)[_0x0307('0x12')](function(_0xfacd2e){_0x263d58(null,_0xfacd2e);})[_0x0307('0x14')](function(_0x1e0b8c){_0x263d58(_0x1e0b8c);});};AGIVertices[_0x0307('0x10')][_0x0307('0x79')]=function(_0x1eab13,_0x38d543){scripts[_0x0307('0x79')](_0x1eab13[_0x0307('0x72')],_0x1eab13[_0x0307('0x58')],_0x1eab13[_0x0307('0x7a')]||'en-US',_0x1eab13[_0x0307('0x7b')])[_0x0307('0x12')](function(_0x468c18){_0x38d543(null,_0x468c18);})[_0x0307('0x14')](function(_0x2cc9e3){_0x38d543(_0x2cc9e3);});};AGIVertices[_0x0307('0x10')][_0x0307('0x7c')]=function(_0x5bbe17,_0x2e9659,_0x587472){scripts[_0x0307('0x7c')](_0x2e9659,_0x5bbe17[_0x0307('0x72')],_0x5bbe17[_0x0307('0x7d')]||_0x0307('0x5a'),this[_0x0307('0x7e')](_0x5bbe17[_0x0307('0x7f')])?_0x5bbe17[_0x0307('0x7f')]:undefined)[_0x0307('0x12')](function(_0x3ed5de){_0x587472(null,_0x3ed5de);})['catch'](function(_0x17a9e6){_0x587472(_0x17a9e6);});};AGIVertices[_0x0307('0x10')]['awsPolly']=function(_0x1aa6ee,_0x1521a1){scripts[_0x0307('0x80')](_0x1aa6ee['aws_access_key_id'],_0x1aa6ee[_0x0307('0x81')],_0x1aa6ee[_0x0307('0x82')],_0x1aa6ee[_0x0307('0x83')]||_0x0307('0x84'),_0x1aa6ee[_0x0307('0x58')],_0x1aa6ee[_0x0307('0x85')]||_0x0307('0x58'))[_0x0307('0x12')](function(_0x426e77){_0x1521a1(null,_0x426e77);})[_0x0307('0x14')](function(_0xa3c2cb){_0x1521a1(_0xa3c2cb);});};AGIVertices['prototype'][_0x0307('0x86')]=function(_0x3641cd,_0x212384){scripts['awsLex'](this['channel'][_0x0307('0x36')],_0x3641cd[_0x0307('0x87')],_0x3641cd[_0x0307('0x81')],_0x3641cd['aws_lex_region'],_0x3641cd[_0x0307('0x58')],_0x3641cd[_0x0307('0x88')])[_0x0307('0x12')](function(_0x38c64f){_0x212384(null,_0x38c64f);})['catch'](function(_0xce7b7){_0x212384(_0xce7b7);});};AGIVertices[_0x0307('0x10')][_0x0307('0x89')]=function(_0x300673,_0x27db20,_0x57c605){scripts[_0x0307('0x89')](_0x27db20,_0x300673[_0x0307('0x72')],_0x300673[_0x0307('0x8a')]||_0x0307('0x5a'))[_0x0307('0x12')](function(_0x5bbf14){_0x57c605(null,_0x5bbf14);})[_0x0307('0x14')](function(_0x1c0b7b){_0x57c605(_0x1c0b7b);});};AGIVertices[_0x0307('0x10')][_0x0307('0x8b')]=function(_0x9ec3ec,_0x451a89,_0x1512e8){scripts[_0x0307('0x8b')](_0x451a89,_0x9ec3ec[_0x0307('0x8c')],_0x9ec3ec[_0x0307('0x8d')],_0x9ec3ec['uri'])[_0x0307('0x12')](function(_0x43a2be){_0x1512e8(null,_0x43a2be);})[_0x0307('0x14')](function(_0x11be4d){_0x1512e8(_0x11be4d);});};AGIVertices[_0x0307('0x10')][_0x0307('0x8e')]=function(_0x3d739e){var _0x56ba66=_['includes'](verticesWithRetry,_0x3d739e[_0x0307('0x34')])?_0x3d739e:_[_0x0307('0x8f')](_0x3d739e);for(var _0x2e3d12 in _0x56ba66){if(_0x56ba66[_0x0307('0x90')](_0x2e3d12)){if(_0x56ba66[_0x2e3d12]&&_[_0x0307('0x91')](_0x56ba66[_0x2e3d12])){if(_['includes'](recursiveMapAttributes,_0x2e3d12)){_0x56ba66[_0x2e3d12]=this[_0x0307('0x92')](_0x56ba66[_0x2e3d12]);}else{_0x56ba66[_0x2e3d12]=this[_0x0307('0x93')](_0x56ba66[_0x2e3d12]);}}}}return _0x56ba66;};AGIVertices['prototype'][_0x0307('0x94')]=function(_0x2feb52){for(var _0x2f4f7b in _0x2feb52){if(_0x2feb52['hasOwnProperty'](_0x2f4f7b)){if(_['isPlainObject'](_0x2feb52[_0x2f4f7b])){this[_0x0307('0x94')](_0x2feb52[_0x2f4f7b]);}else if(_['isArray'](_0x2feb52[_0x2f4f7b])){for(var _0x229407=0x0;_0x229407<_0x2feb52[_0x2f4f7b]['length'];_0x229407++){this[_0x0307('0x94')](_0x2feb52[_0x2f4f7b][_0x229407]);}}else if(_['isString'](_0x2feb52[_0x2f4f7b])){_0x2feb52[_0x2f4f7b]=this[_0x0307('0x93')](_0x2feb52[_0x2f4f7b]);}}}};AGIVertices[_0x0307('0x10')]['saveRestApiResult']=function(_0x26042d,_0x43fb58){for(var _0x377c27 in _0x26042d){if(_0x26042d[_0x0307('0x90')](_0x377c27)){if(_[_0x0307('0x95')](_0x26042d[_0x377c27])){if(!_[_0x0307('0x3e')](_0x26042d[_0x377c27])){this[_0x0307('0x96')](_0x26042d[_0x377c27],util[_0x0307('0x27')]('%s.%s',_0x43fb58,_0x377c27));}}else if(_[_0x0307('0x97')](_0x26042d[_0x377c27])){for(var _0x38aaf8=0x0;_0x38aaf8<_0x26042d[_0x377c27][_0x0307('0x98')];_0x38aaf8++){this['saveRestApiResult'](_0x26042d[_0x377c27][_0x38aaf8],util['format']('%s.%s',_0x43fb58,_0x377c27+'['+_0x38aaf8+']'));}}else{if(!_[_0x0307('0x4e')](_0x26042d[_0x377c27])){this['channel']['setVariable'](util[_0x0307('0x27')](_0x0307('0x99'),_0x43fb58,_0x377c27),_0x26042d[_0x377c27]);}}}}};AGIVertices[_0x0307('0x10')][_0x0307('0x92')]=function(_0x5cba52){try{var _0x6159b8=JSON['parse'](_0x5cba52);this[_0x0307('0x94')](_0x6159b8);return JSON[_0x0307('0x9a')](_0x6159b8);}catch(_0x4adb3f){return this[_0x0307('0x93')](_0x5cba52);}};AGIVertices['prototype'][_0x0307('0x93')]=function(_0xb3e2de){var _0x7ad89f=_0xb3e2de[_0x0307('0x9b')]('{');for(var _0x52bc02=0x1;_0x52bc02<_0x7ad89f[_0x0307('0x98')];_0x52bc02+=0x1){var _0x2838b3=_0x7ad89f[_0x52bc02][_0x0307('0x9b')]('}');if(_0x2838b3[_0x0307('0x98')]>0x1){_0xb3e2de=_0xb3e2de['replaceAll']('{'+_0x2838b3[0x0]+'}',this['channel'][_0x0307('0x11')](_0x2838b3[0x0])[_0x0307('0x9c')]||_0x2838b3[0x0]);}}if(_0x7ad89f['length']===0x1){return _0xb3e2de[_0x0307('0x46')]();}return this[_0x0307('0x93')](_0xb3e2de);};AGIVertices[_0x0307('0x10')][_0x0307('0x9d')]=function(_0x4355eb,_0x50f648){var _0x35a06c=this[_0x0307('0xd')][_0x0307('0x11')](_0x4355eb);if(_0x35a06c['result']===-0x1){return _0x35a06c;}logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x9e'),_0x50f648,_0x35a06c['extra']));return this[_0x0307('0xd')][_0x0307('0x9f')](_0x50f648,_0x35a06c[_0x0307('0x9c')]);};AGIVertices[_0x0307('0x10')][_0x0307('0x7e')]=function(_0x25899e){return _0x25899e&&_0x25899e!=='0'&&_0x25899e!=='-1'&&_0x25899e!=='';};AGIVertices[_0x0307('0x10')][_0x0307('0xa0')]=function(_0x5629a7){this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x5629a7,'-');_0x5629a7['retry']=_0x5629a7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0307('0x10')][_0x0307('0xa1')]=function(_0x9ea1af){logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x9ea1af['label']));if(!this[_0x0307('0x7e')](_0x9ea1af[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}var _0x5bf919='\x22'+_0x9ea1af[_0x0307('0x58')]+'\x22';if(this['isConfigured'](_0x9ea1af['options'])){_0x5bf919+=','+_0x9ea1af[_0x0307('0x70')];}var _0x116a20=this[_0x0307('0xd')][_0x0307('0xa4')](_0x0307('0xa5'),_0x5bf919);if(_0x116a20['result']===-0x1){return _0x116a20;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0xa6'),_0x5bf919));};AGIVertices[_0x0307('0x10')]['mrcprecog']=function(_0x3c7c13){logger['info'](util[_0x0307('0x27')](_0x0307('0xa7'),_0x3c7c13['label']));if(!this['isConfigured'](_0x3c7c13[_0x0307('0xa8')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa9'));}var _0x434d83=_0x3c7c13[_0x0307('0xa8')];if(this['isConfigured'](_0x3c7c13[_0x0307('0x70')])){_0x434d83+=','+_0x3c7c13['options'];}var _0x5d4724=this[_0x0307('0xd')]['exec']('MRCPRecog',_0x434d83);if(_0x5d4724[_0x0307('0xaa')]===-0x1){return _0x5d4724;}var _0x99a9af=this[_0x0307('0x9d')](_0x0307('0xab'),_0x0307('0xac'));if(_0x99a9af['result']===-0x1){return _0x99a9af;}var _0x3569dd=this[_0x0307('0x9d')](_0x0307('0xad'),_0x0307('0xae'));if(_0x3569dd[_0x0307('0xaa')]===-0x1){return _0x3569dd;}var _0x5cf230=this[_0x0307('0x9d')](_0x0307('0xaf'),'MRCP_RECOG_INSTANCE');if(_0x5cf230[_0x0307('0xaa')]===-0x1){return _0x5cf230;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0xb0'),_0x434d83));};AGIVertices[_0x0307('0x10')][_0x0307('0xb1')]=function(_0x409111){logger[_0x0307('0x2d')](util['format'](_0x0307('0xb2'),_0x409111[_0x0307('0xb3')]));return this[_0x0307('0xd')]['agi']([_0x409111[_0x0307('0xb4')],_0x409111['args']]);};AGIVertices[_0x0307('0x10')]['answer']=function(_0x4bb33c){logger['info'](util[_0x0307('0x27')](_0x0307('0xb5'),_0x4bb33c[_0x0307('0xb3')]));if(this[_0x0307('0x7e')](_0x4bb33c[_0x0307('0x62')])){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0xb6'),_0x4bb33c[_0x0307('0x62')]));var _0x4b3787=this[_0x0307('0xd')]['wait'](_0x4bb33c['timeout']);if(_0x4b3787[_0x0307('0xaa')]===-0x1){return _0x4b3787;}}return this[_0x0307('0xd')][_0x0307('0xb7')]();};AGIVertices[_0x0307('0x10')][_0x0307('0x44')]=function(_0xc8ff65){logger[_0x0307('0x2d')](util['format'](_0x0307('0xb8'),_0xc8ff65[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0xc8ff65[_0x0307('0x42')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0xc8ff65,_0x0307('0xb9'));}_0xc8ff65[_0x0307('0x43')]=moment();if(this[_0x0307('0x7e')](_0xc8ff65[_0x0307('0xba')])){_0xc8ff65[_0x0307('0x43')]=moment()[_0x0307('0xbb')](_0xc8ff65[_0x0307('0xba')],'minutes');}if(!this[_0x0307('0x7e')](_0xc8ff65[_0x0307('0x47')])){_0xc8ff65['callback_priority']=0x2;}this[_0x0307('0x3d')][_0x0307('0x6b')](this,_0xc8ff65);return this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')](_0x0307('0xbc'),_0xc8ff65[_0x0307('0xbd')],_0xc8ff65['list_id'],_0xc8ff65[_0x0307('0x43')]));};AGIVertices[_0x0307('0x10')][_0x0307('0xbe')]=function(_0x9f69e8){logger[_0x0307('0x2d')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x9f69e8[_0x0307('0xb3')]));var _0x3bbd62=this['channel']['exec'](_0x9f69e8[_0x0307('0xbf')],_0x9f69e8[_0x0307('0x70')]);if(_0x3bbd62[_0x0307('0xaa')]===-0x1){return _0x3bbd62;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('Executed\x20command\x20%s\x20%s',_0x9f69e8['application'],_0x9f69e8[_0x0307('0x70')]));};AGIVertices[_0x0307('0x10')][_0x0307('0xc0')]=function(_0x35ebda){logger['info'](util['format'](_0x0307('0xc1'),_0x35ebda[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x35ebda['text'])){return this['channel'][_0x0307('0xa2')](_0x0307('0xa3'));}var _0x3cd2ab='\x22'+_0x35ebda[_0x0307('0x58')]+'\x22';if(this['isConfigured'](_0x35ebda['options'])){_0x3cd2ab+=','+_0x35ebda[_0x0307('0x70')];}var _0x178cae=this[_0x0307('0xd')][_0x0307('0xa4')]('MRCPSynth',_0x3cd2ab);if(_0x178cae[_0x0307('0xaa')]===-0x1){return _0x178cae;}return this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')](_0x0307('0xa6'),_0x3cd2ab));};AGIVertices['prototype'][_0x0307('0xc2')]=function(_0x617809){logger['info'](util[_0x0307('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x617809['label']));if(!this[_0x0307('0x7e')](_0x617809['text'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}var _0x264c08='\x22'+_0x617809[_0x0307('0x58')]+'\x22';if(this[_0x0307('0x7e')](_0x617809[_0x0307('0x70')])){_0x264c08+=','+_0x617809[_0x0307('0x70')];}var _0x4ac891=this[_0x0307('0xd')]['exec'](_0x0307('0xa5'),_0x264c08);if(_0x4ac891[_0x0307('0xaa')]===-0x1){return _0x4ac891;}return this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')](_0x0307('0xa6'),_0x264c08));};AGIVertices[_0x0307('0x10')][_0x0307('0xc3')]=function(_0x55047e){logger['info'](util[_0x0307('0x27')](_0x0307('0xc4'),_0x55047e[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x55047e['grammar'])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20grammar\x20configured');}var _0x36d410=_0x55047e['grammar'];if(this['isConfigured'](_0x55047e[_0x0307('0x70')])){_0x36d410+=','+_0x55047e[_0x0307('0x70')];}var _0x4c07af=this[_0x0307('0xd')]['exec'](_0x0307('0xc5'),_0x36d410);if(_0x4c07af[_0x0307('0xaa')]===-0x1){return _0x4c07af;}var _0x391ae0=this[_0x0307('0x9d')](_0x0307('0xab'),_0x0307('0xc6'));if(_0x391ae0[_0x0307('0xaa')]===-0x1){return _0x391ae0;}var _0x555ff8=this[_0x0307('0x9d')]('RECOG_INPUT()',_0x0307('0xc7'));if(_0x555ff8['result']===-0x1){return _0x555ff8;}var _0x1a16f1=this[_0x0307('0x9d')]('RECOG_INSTANCE()',_0x0307('0xc8'));if(_0x1a16f1[_0x0307('0xaa')]===-0x1){return _0x1a16f1;}return this['channel'][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0xb0'),_0x36d410));};AGIVertices[_0x0307('0x10')][_0x0307('0xc9')]=function(_0x29df95){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0xca'),_0x29df95['label']));if(!this[_0x0307('0x7e')](_0x29df95[_0x0307('0xa8')])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20grammar\x20configured');}var _0x62518f=_0x29df95[_0x0307('0xa8')];if(this[_0x0307('0x7e')](_0x29df95[_0x0307('0x70')])){_0x62518f+=','+_0x29df95[_0x0307('0x70')];}var _0x4a8fe0=this[_0x0307('0xd')][_0x0307('0xa4')](_0x0307('0xc5'),_0x62518f);if(_0x4a8fe0[_0x0307('0xaa')]===-0x1){return _0x4a8fe0;}var _0x58e496=this[_0x0307('0x9d')](_0x0307('0xab'),_0x0307('0xcb'));if(_0x58e496['result']===-0x1){return _0x58e496;}var _0xb79acd=this[_0x0307('0x9d')]('RECOG_INPUT()',_0x0307('0xcc'));if(_0xb79acd['result']===-0x1){return _0xb79acd;}var _0xf36092=this[_0x0307('0x9d')](_0x0307('0xaf'),_0x0307('0xcd'));if(_0xf36092[_0x0307('0xaa')]===-0x1){return _0xf36092;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0xb0'),_0x62518f));};AGIVertices[_0x0307('0x10')]['database']=function(_0x2cba30){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0xce'),_0x2cba30[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x2cba30['odbc_id'])){return this['channel'][_0x0307('0x2b')](_0x2cba30,_0x0307('0xcf'));}var _0x2a0c22=this[_0x0307('0xd0')]['sync'](this,_0x2cba30[_0x0307('0xd1')]);if(!_0x2a0c22){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x2cba30,'no\x20odbc\x20database\x20found');}if(!this[_0x0307('0x7e')](_0x2cba30['query'])){return this[_0x0307('0xd')]['error'](_0x2cba30,_0x0307('0xd2'));}var _0x53538a=_0x2cba30[_0x0307('0x2e')][_0x0307('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0xd3'),_0x53538a));var _0x3342fc=this['getQueryOdbc'][_0x0307('0x6b')](this,_0x2a0c22,_0x53538a);this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x2cba30,_0x53538a);if(!this[_0x0307('0x7e')](_0x2cba30['variable_id'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xd4'));}var _0x5b9cc8=this['getVariable'][_0x0307('0x6b')](this,_0x2cba30[_0x0307('0xd5')]);if(!_0x5b9cc8){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x2cba30,_0x0307('0xd6'));}var _0x4e601f=this;_0x3342fc['forEach'](function(_0x4a4987,_0x5182c0){Object[_0x0307('0xd7')](_0x4a4987)[_0x0307('0xd8')](function(_0x59abba){_0x4e601f[_0x0307('0xd')]['setVariable'](util[_0x0307('0x27')](_0x0307('0xd9'),_0x5b9cc8,_0x5182c0,_0x59abba),_0x4a4987[_0x59abba]);});});this[_0x0307('0xd')][_0x0307('0x9f')](util[_0x0307('0x27')](_0x0307('0xda'),_0x5b9cc8),_0x3342fc[_0x0307('0x98')]);return this[_0x0307('0xd')][_0x0307('0xa2')](util['format']('variable\x20%s\x20set',_0x5b9cc8));};AGIVertices[_0x0307('0x10')][_0x0307('0xdb')]=function(_0x9d2fbc){logger['debug'](util[_0x0307('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x9d2fbc[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x9d2fbc['sip_id'])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x9d2fbc,_0x0307('0xdc'));}var _0xee1597=this[_0x0307('0xdd')]['sync'](this,_0x9d2fbc[_0x0307('0xde')]);if(!_0xee1597){return this[_0x0307('0xd')]['error'](_0x9d2fbc,_0x0307('0xdf'));}var _0x52cf30=this[_0x0307('0xd')][_0x0307('0xa4')]('DIAL',[util[_0x0307('0x27')]('SIP/%s',_0xee1597),_0x9d2fbc[_0x0307('0x62')],_0x9d2fbc[_0x0307('0xe0')],_0x9d2fbc[_0x0307('0xe1')]]);if(_0x52cf30[_0x0307('0xaa')]===-0x1){return _0x52cf30;}return this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0xe2'),'DIAL'));};AGIVertices[_0x0307('0x10')][_0x0307('0xe3')]=function(_0x45577d){logger[_0x0307('0x2d')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x45577d[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x45577d['key'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xe4'));}if(!this[_0x0307('0x7e')](_0x45577d[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20text\x20configured');}this['channel'][_0x0307('0xe5')]=!![];this[_0x0307('0x33')](_0x45577d);this[_0x0307('0x3c')](_0x45577d['text'],'in','','');this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')](_0x0307('0xe6'),_0x45577d[_0x0307('0x58')]));var _0x62ff84=this['googleDialogflow']['sync'](this,_0x45577d);if(_0x62ff84){for(var _0x2d2c26 in _0x62ff84){if(_0x62ff84['hasOwnProperty'](_0x2d2c26)){this[_0x0307('0xd')]['setVariable'](util['format'](_0x0307('0xe7'),_0x2d2c26[_0x0307('0xe8')]()),_0x62ff84[_0x2d2c26]);}}this[_0x0307('0x3c')](_0x62ff84['speech'],_0x0307('0xe9'),'dialogflow','');return this[_0x0307('0xd')][_0x0307('0xa2')](util['format']('Dialogflow\x20Result\x20%s',_0x62ff84[_0x0307('0xea')]));}return this[_0x0307('0xd')][_0x0307('0x2b')](_0x45577d,_0x0307('0xeb'));};AGIVertices['prototype'][_0x0307('0xec')]=function(_0xabd63b){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0xed'),_0xabd63b[_0x0307('0xb3')]));if(!this['isConfigured'](_0xabd63b[_0x0307('0x75')])){return this[_0x0307('0xd')]['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0xabd63b[_0x0307('0x76')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xee'));}if(!this['isConfigured'](_0xabd63b[_0x0307('0xef')])){return this['channel'][_0x0307('0xa2')](_0x0307('0xf0'));}if(!this['isConfigured'](_0xabd63b[_0x0307('0x77')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xf1'));}if(!this[_0x0307('0x7e')](_0xabd63b[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}this[_0x0307('0xd')][_0x0307('0xe5')]=!![];this[_0x0307('0x33')](_0xabd63b);this[_0x0307('0x3c')](_0xabd63b['text'],'in','','');this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('Trying\x20DialogflowV2:\x20%s',_0xabd63b[_0x0307('0x58')]));var _0x385c26=this['googleDialogflowV2'][_0x0307('0x6b')](this,_0xabd63b);if(_0x385c26){for(var _0x510291 in _0x385c26){if(_0x385c26[_0x0307('0x90')](_0x510291)){if(_0x510291!==_0x0307('0xf2')){this['channel'][_0x0307('0x9f')](util[_0x0307('0x27')](_0x0307('0xe7'),_0x510291[_0x0307('0xe8')]()),_0x385c26[_0x510291]);}}}this[_0x0307('0x3c')](_0x385c26[_0x0307('0xea')],_0x0307('0xe9'),_0x0307('0xec'),_0x385c26[_0x0307('0xf2')]);return this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0xf3'),_0x385c26[_0x0307('0xea')]));}return this['channel'][_0x0307('0x2b')](_0xabd63b,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x0307('0x10')][_0x0307('0xf4')]=function(_0x2b8594){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0xf5'),_0x2b8594[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x2b8594[_0x0307('0xf6')])){return this[_0x0307('0xd')]['noop'](_0x0307('0xf7'));}if(!this[_0x0307('0x7e')](_0x2b8594[_0x0307('0xf8')])){return this[_0x0307('0xd')]['noop']('no\x20username\x20configured');}if(!this['isConfigured'](_0x2b8594[_0x0307('0xf9')])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20password\x20configured');}if(!this[_0x0307('0x7e')](_0x2b8594[_0x0307('0xfa')])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20text\x20configured');}this['channel'][_0x0307('0xe5')]=!![];this[_0x0307('0x33')](_0x2b8594);this['createSquareMessage'](_0x2b8594[_0x0307('0x58')],'in','','');this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('Trying\x20SestekNDA:\x20%s',_0x2b8594[_0x0307('0x58')]));var _0x398fcd=this['sestekNDA'][_0x0307('0x6b')](this,_0x2b8594);if(_0x398fcd){for(var _0x3875ce in _0x398fcd){if(_0x398fcd[_0x0307('0x90')](_0x3875ce)){this['channel'][_0x0307('0x9f')](util[_0x0307('0x27')](_0x0307('0xfb'),_0x3875ce[_0x0307('0xe8')]()),_0x398fcd[_0x3875ce]);}}this[_0x0307('0x3c')](_0x398fcd['speech'],_0x0307('0xe9'),_0x0307('0xf4'),'');if(_0x398fcd[_0x0307('0xfc')]){this[_0x0307('0xd')]['noop'](util['format'](_0x0307('0xfd'),_0x398fcd[_0x0307('0xfc')]));var _0x1db99b=this[_0x0307('0xd')][_0x0307('0xfe')](_0x398fcd[_0x0307('0xfc')]);try{fs[_0x0307('0xff')](_0x398fcd[_0x0307('0xfc')]+_0x0307('0x100'));}catch(_0xf02f2f){logger['error'](_0xf02f2f);}return _0x1db99b;}else{return this[_0x0307('0xd')]['noop'](util['format'](_0x0307('0x101'),_0x398fcd['speech']));}}return this[_0x0307('0xd')]['error'](_0x2b8594,_0x0307('0x102'));};AGIVertices['prototype'][_0x0307('0x103')]=function(_0x42fe0e){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x104'),_0x42fe0e[_0x0307('0xb3')]));return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x103'));};AGIVertices['prototype'][_0x0307('0x105')]=function(_0x330b85){logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x330b85[_0x0307('0xb3')]));var _0x23aaf2='';if(_0x330b85['trunk_id']){if(!this[_0x0307('0x7e')](_0x330b85[_0x0307('0x106')])){return this['channel']['error'](_0x330b85,_0x0307('0x107'));}else{var _0x57f6db=parseInt(_0x330b85['trunk_id'],0xa);if(isNaN(_0x57f6db)){_0x23aaf2=_0x330b85[_0x0307('0x106')];}else{_0x23aaf2=this['getTrunk'][_0x0307('0x6b')](this,_0x330b85[_0x0307('0x106')]);if(!_0x23aaf2){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x330b85,_0x0307('0x108'));}}}}else if(_0x330b85[_0x0307('0x109')]){_0x23aaf2=_0x330b85[_0x0307('0x109')];}else{return this[_0x0307('0xd')]['error'](_0x330b85,'no\x20trunk\x20selected');}var _0x33d44d=this[_0x0307('0xd')][_0x0307('0xa4')](_0x0307('0x10a'),[util[_0x0307('0x27')]('SIP/%s/%s',_0x23aaf2,_0x330b85[_0x0307('0xbd')]),_0x330b85['timeout'],_0x330b85['opts'],_0x330b85['url']]);if(_0x33d44d[_0x0307('0xaa')]===-0x1){return _0x33d44d;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0xe2'),'DIAL'));};AGIVertices[_0x0307('0x10')][_0x0307('0x10b')]=function(_0x39b488){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x10c'),_0x39b488['label']));return this['channel'][_0x0307('0xa2')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x16bb1e){logger['info'](util['format'](_0x0307('0x10d'),_0x16bb1e[_0x0307('0xb3')]));if(_0x16bb1e[_0x0307('0x10e')]===0x0){return this[_0x0307('0xa0')](_0x16bb1e);}_0x16bb1e['retry']-=0x1;if(!this[_0x0307('0x7e')](_0x16bb1e[_0x0307('0x10f')])){return this['channel'][_0x0307('0x2b')](_0x16bb1e,_0x0307('0x110'));}var _0x1eb532=this[_0x0307('0x1b')][_0x0307('0x6b')](this,_0x16bb1e[_0x0307('0x10f')]);if(!_0x1eb532){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x16bb1e,_0x0307('0x111'));}if(!this[_0x0307('0x7e')](_0x16bb1e['variable_id'])){return this[_0x0307('0xd')][_0x0307('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x16597d=this[_0x0307('0xd')][_0x0307('0x112')](_0x1eb532,_0x16bb1e['response'],_0x16bb1e['maxdigit']);var _0x55b068=_0x16597d[_0x0307('0xaa')]?_0x16597d[_0x0307('0xaa')][_0x0307('0x46')]():'';logger[_0x0307('0x2d')]('test',JSON['stringify'](_0x16597d));if(_0x16597d['result']===-0x1){this['createSquareDetailsReport'][_0x0307('0x6b')](this,_0x16bb1e,_0x55b068);return _0x16597d;}else if(_0x16597d[_0x0307('0x9c')]==='timeout'){_0x16597d['result']=_0x55b068[_0x0307('0x98')]>=parseInt(_0x16bb1e[_0x0307('0x113')])?'x':'i';}else{_0x16597d[_0x0307('0xaa')]=_0x55b068[_0x0307('0x98')]>=parseInt(_0x16bb1e['mindigit'])&&_0x55b068[_0x0307('0x98')]<=parseInt(_0x16bb1e['maxdigit'])?'x':'i';}var _0x1c553c=this['getVariable']['sync'](this,_0x16bb1e[_0x0307('0xd5')]);if(!_0x1c553c){return this['channel']['error'](_0x16bb1e,_0x0307('0xd6'));}this[_0x0307('0xd')][_0x0307('0x9f')](_0x1c553c,_0x55b068);if(this['isConfigured'](_0x16bb1e[_0x0307('0x114')])){var _0x34cd86=parseInt(_0x16bb1e[_0x0307('0x114')],0xa);var _0x4cdea6=rs[_0x0307('0x115')]({'charset':'*','length':_0x34cd86});var _0x7dfb71=_0x55b068[_0x0307('0x98')];if(_0x7dfb71>0x0){if(_0x7dfb71>_0x34cd86){this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x16bb1e,_0x16bb1e[_0x0307('0x116')]===_0x0307('0x117')?_0x4cdea6+_0x55b068[_0x0307('0x118')](_0x34cd86):_0x55b068[_0x0307('0x118')](0x0,_0x7dfb71-_0x34cd86)+_0x4cdea6);}else{this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x16bb1e,rs[_0x0307('0x115')]({'charset':'*','length':_0x7dfb71}));}}else{this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x16bb1e,'');}}else{this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x16bb1e,_0x55b068);}return _0x16597d;};AGIVertices[_0x0307('0x10')][_0x0307('0x119')]=function(_0x367396){logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x367396[_0x0307('0xb3')]));return this['getdigits'](_0x367396);};AGIVertices['prototype']['goal']=function(_0x17cfe0){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x11a'),_0x17cfe0[_0x0307('0xb3')]));this['createSquareDetailsReport'][_0x0307('0x6b')](this,_0x17cfe0,_0x17cfe0[_0x0307('0x11b')]);return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x11c'),_0x17cfe0[_0x0307('0x11b')]));};AGIVertices[_0x0307('0x10')]['awspolly']=function(_0x521733){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x11d'),_0x521733[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x521733[_0x0307('0x87')])||!this[_0x0307('0x7e')](_0x521733[_0x0307('0x81')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x11e'));}if(!this[_0x0307('0x7e')](_0x521733[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}this[_0x0307('0xd')]['noop'](util['format'](_0x0307('0x11f'),_0x521733[_0x0307('0x58')]));var _0x2565c4=this['awsPolly']['sync'](this,_0x521733);if(_0x2565c4){this['channel'][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x120'),_0x2565c4));var _0x509be5=this[_0x0307('0xd')]['streamFile'](_0x2565c4);try{fs['unlink'](_0x2565c4+_0x0307('0x100'));}catch(_0x3bbdd3){logger[_0x0307('0x2b')](_0x3bbdd3);}return _0x509be5;}return this[_0x0307('0xd')]['error'](_0x521733,_0x0307('0x121'));};AGIVertices[_0x0307('0x10')][_0x0307('0x122')]=function(_0x53e3a8){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x123'),_0x53e3a8[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x53e3a8[_0x0307('0x87')])||!this[_0x0307('0x7e')](_0x53e3a8['aws_secret_access_key'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x11e'));}if(!this[_0x0307('0x7e')](_0x53e3a8['aws_bot_name'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x124'));}if(!this['isConfigured'](_0x53e3a8[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}this[_0x0307('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x53e3a8);this[_0x0307('0x3c')](_0x53e3a8[_0x0307('0x58')],'in','','');this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')](_0x0307('0x125'),_0x53e3a8[_0x0307('0x58')]));var _0x4279f4=this[_0x0307('0x86')][_0x0307('0x6b')](this,_0x53e3a8);if(_0x4279f4){for(var _0x2a9371 in _0x4279f4){if(_0x4279f4[_0x0307('0x90')](_0x2a9371)&&_[_0x0307('0x91')](_0x4279f4[_0x2a9371])){this[_0x0307('0xd')][_0x0307('0x9f')](util['format']('AWS_LEX_%s',_0x2a9371[_0x0307('0xe8')]()),_0x4279f4[_0x2a9371]);}}if(_[_0x0307('0x4e')](_0x4279f4['message'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x126'));}else{this[_0x0307('0x3c')](_0x4279f4['message'],'out',_0x0307('0x127'),'');return this['channel'][_0x0307('0xa2')](util['format'](_0x0307('0x128'),_0x4279f4['message']));}}return this['channel'][_0x0307('0x2b')](_0x53e3a8,_0x0307('0x129'));};AGIVertices[_0x0307('0x10')][_0x0307('0x12a')]=function(_0x58276d){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x12b'),_0x58276d[_0x0307('0xb3')],_0x58276d['timeout']));if(!this[_0x0307('0x7e')](_0x58276d['key'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xe4'));}var _0x1f56f7=_0x0307('0x12c');var _0x589b7f=util['format'](_0x0307('0x12d'),FILES_PATH,rs[_0x0307('0x115')](0x4));var _0x8c86c0=util[_0x0307('0x27')]('%s.%s',_0x589b7f,_0x1f56f7);var _0x14ee94=!![];if(_0x58276d['beep']===_0x0307('0x12e')){_0x14ee94=![];}var _0x993f7=this[_0x0307('0xd')][_0x0307('0x12f')](_0x589b7f,_0x1f56f7,_0x58276d[_0x0307('0x130')],_0x58276d[_0x0307('0x62')],undefined,_0x14ee94);if(_0x993f7['result']!==-0x1){this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x131'),_0x8c86c0));var _0x324744=this['googleASR'][_0x0307('0x6b')](this,_0x58276d,_0x8c86c0);if(_0x324744){for(var _0x4420bc in _0x324744){if(_0x324744[_0x0307('0x90')](_0x4420bc)){this[_0x0307('0xd')][_0x0307('0x9f')](util[_0x0307('0x27')](_0x0307('0x132'),_0x4420bc[_0x0307('0xe8')]()),_0x324744[_0x4420bc]);}}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x324744)));}}return _0x993f7;};AGIVertices[_0x0307('0x10')][_0x0307('0x133')]=function(_0x2b76f0){logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2b76f0[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x2b76f0[_0x0307('0x8c')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x134'));}if(!this[_0x0307('0x7e')](_0x2b76f0['appsecret'])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x135'));}var _0x208aea=_0x0307('0x12c');var _0x4be3de=util[_0x0307('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x0307('0x115')](0x4));var _0x4e0fc2=util[_0x0307('0x27')](_0x0307('0x99'),_0x4be3de,_0x208aea);var _0x5ec8ff=!![];if(_0x2b76f0['beep']===_0x0307('0x12e')){_0x5ec8ff=![];}var _0x2d8faf=this[_0x0307('0xd')][_0x0307('0x12f')](_0x4be3de,_0x208aea,_0x2b76f0['intKey'],_0x2b76f0[_0x0307('0x62')],undefined,_0x5ec8ff);if(_0x2d8faf['result']!==-0x1){this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('tilde\x20%s\x20file\x20created',_0x4e0fc2));var _0x19056e=this[_0x0307('0x8b')][_0x0307('0x6b')](this,_0x2b76f0,_0x4e0fc2);if(_0x19056e){for(var _0x25dde2 in _0x19056e){if(_0x19056e[_0x0307('0x90')](_0x25dde2)){this['channel'][_0x0307('0x9f')](util[_0x0307('0x27')]('TILDE_ASR_%s',_0x25dde2[_0x0307('0xe8')]()),_0x19056e[_0x25dde2]);}}return this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0x136'),JSON['stringify'](_0x19056e)));}}return _0x2d8faf;};AGIVertices[_0x0307('0x10')][_0x0307('0x137')]=function(_0x31b0a0){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x138'),_0x31b0a0['label']));return this['channel'][_0x0307('0x139')](_0x31b0a0[_0x0307('0x38')],_0x31b0a0[_0x0307('0x13a')],_0x31b0a0['priority']);};AGIVertices[_0x0307('0x10')][_0x0307('0x13b')]=function(_0x56f21c){logger['info'](util[_0x0307('0x27')](_0x0307('0x13c'),_0x56f21c[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x56f21c[_0x0307('0x13d')])){return this[_0x0307('0xd')]['error'](_0x56f21c,_0x0307('0x13e'));}try{var _0x2d17df=eval(_0x56f21c[_0x0307('0x13d')])?'true':_0x0307('0x13f');this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x140'),_0x56f21c['condition'],_0x2d17df));return{'code':0xc8,'result':_0x2d17df};}catch(_0x3949e1){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x0307('0x10')]['gotoiftime']=function(_0x4e6100){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x141'),_0x4e6100['label']));if(!this['isConfigured'](_0x4e6100[_0x0307('0x142')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x4e6100,_0x0307('0x143'));}var _0x6453c2=this[_0x0307('0x20')][_0x0307('0x6b')](this,_0x4e6100[_0x0307('0x142')]);if(!_0x6453c2){return this['channel'][_0x0307('0x2b')](_0x4e6100,_0x0307('0x144'));}for(var _0xe564b7=0x0;_0xe564b7<_0x6453c2[_0x0307('0x98')];_0xe564b7+=0x1){var _0x6fd4a8=this[_0x0307('0xd')][_0x0307('0x11')](util[_0x0307('0x27')](_0x0307('0x145'),_0x6453c2[_0xe564b7]));if(_0x6fd4a8[_0x0307('0xaa')]===-0x1){return _0x6fd4a8;}logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x146'),_0x6453c2[_0xe564b7],_0x6fd4a8[_0x0307('0x9c')]));if(_0x6fd4a8[_0x0307('0x9c')]===_0x0307('0x147')){logger['info'](util[_0x0307('0x27')](_0x0307('0x146'),_0x6453c2[_0xe564b7],_0x0307('0x147')));this[_0x0307('0xd')]['noop'](util['format'](_0x0307('0x146'),_0x6453c2[_0xe564b7],_0x0307('0x147')));return{'code':0xc8,'result':_0x0307('0x147')};}else{logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x146'),_0x6453c2[_0xe564b7],_0x0307('0x13f')));this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')](_0x0307('0x146'),_0x6453c2[_0xe564b7],_0x0307('0x13f')));}}return{'code':0xc8,'result':_0x0307('0x13f')};};AGIVertices[_0x0307('0x10')]['hangup']=function(_0x216e27){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x148'),_0x216e27['label']));return this[_0x0307('0xd')][_0x0307('0x149')]();};AGIVertices[_0x0307('0x10')][_0x0307('0x14a')]=function(_0x20dbe2){logger[_0x0307('0x2d')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x20dbe2['label']));if(!this['isConfigured'](_0x20dbe2[_0x0307('0x72')])){return this['channel']['noop'](_0x0307('0xe4'));}var _0x1d7810=_0x0307('0x12c');var _0x5c2e70=util[_0x0307('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x0307('0x115')](0x4));var _0x2e9afc=util[_0x0307('0x27')](_0x0307('0x99'),_0x5c2e70,_0x1d7810);var _0x49cab1=!![];if(_0x20dbe2['beep']===_0x0307('0x12e')){_0x49cab1=![];}var _0x140bdd=this[_0x0307('0xd')][_0x0307('0x12f')](_0x5c2e70,_0x1d7810,_0x20dbe2[_0x0307('0x130')],_0x20dbe2[_0x0307('0x62')],undefined,_0x49cab1);if(_0x140bdd[_0x0307('0xaa')]!==-0x1){this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x14b'),_0x2e9afc));var _0x2ed0c5=this[_0x0307('0x7c')][_0x0307('0x6b')](this,_0x20dbe2,_0x2e9afc);if(_0x2ed0c5){for(var _0x1a4fd8 in _0x2ed0c5){if(_0x2ed0c5[_0x0307('0x90')](_0x1a4fd8)){this[_0x0307('0xd')][_0x0307('0x9f')](util[_0x0307('0x27')](_0x0307('0x14c'),_0x1a4fd8['toUpperCase']()),_0x2ed0c5[_0x1a4fd8]);}}return this[_0x0307('0xd')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x0307('0x9a')](_0x2ed0c5)));}}return _0x140bdd;};AGIVertices['prototype'][_0x0307('0x14d')]=function(_0x52ad78){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x14e'),_0x52ad78[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x52ad78[_0x0307('0x72')])){return this['channel']['noop'](_0x0307('0xe4'));}if(!this[_0x0307('0x7e')](_0x52ad78[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0x14f'),_0x52ad78[_0x0307('0x58')]));var _0x5660c9=this[_0x0307('0x79')]['sync'](this,_0x52ad78);if(_0x5660c9){this[_0x0307('0xd')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x5660c9));var _0x25d00f=this[_0x0307('0xd')][_0x0307('0xfe')](_0x5660c9,_0x52ad78['intKey']);try{fs['unlink'](_0x5660c9+_0x0307('0x100'));}catch(_0x3a73a9){logger[_0x0307('0x2b')](_0x3a73a9);}return _0x25d00f;}return this[_0x0307('0xd')][_0x0307('0x2b')](_0x52ad78,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0307('0x10')]['login']=function(_0xa19011){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x150'),_0xa19011[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0xa19011['findBy'])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0xa19011,_0x0307('0x151'));}logger[_0x0307('0x2d')](util[_0x0307('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0307('0xd')][_0x0307('0x4d')],_0xa19011['findBy']));var _0x4edc66=this[_0x0307('0x53')][_0x0307('0x6b')](this,_0xa19011[_0x0307('0x152')]);if(_0x4edc66){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x153'),this[_0x0307('0xd')][_0x0307('0x4d')],_0xa19011[_0x0307('0x152')]));this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x153'),this[_0x0307('0xd')][_0x0307('0x4d')],_0xa19011['findBy']));return{'code':0xc8,'result':_0x0307('0x154')};}else{logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x155'),this[_0x0307('0xd')][_0x0307('0x4d')],_0xa19011['findBy']));this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0x155'),this['channel']['callerid'],_0xa19011[_0x0307('0x152')]));return{'code':0xc8,'result':_0x0307('0x156')};}};AGIVertices[_0x0307('0x10')][_0x0307('0x157')]=function(_0x2f2fe9){logger['info'](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2f2fe9[_0x0307('0xb3')]));if(!this['isConfigured'](_0x2f2fe9[_0x0307('0x152')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x2f2fe9,'no\x20find\x20by\x20configured');}logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x158'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x2f2fe9[_0x0307('0x152')]));var _0x1e817b=this[_0x0307('0x4f')][_0x0307('0x6b')](this,_0x2f2fe9[_0x0307('0x152')]);if(_0x1e817b){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x153'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x2f2fe9[_0x0307('0x152')]));this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0307('0xd')][_0x0307('0x4d')],_0x2f2fe9[_0x0307('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0307('0x2d')](util['format'](_0x0307('0x155'),this['channel'][_0x0307('0x4d')],_0x2f2fe9[_0x0307('0x152')]));this['channel']['noop'](util[_0x0307('0x27')](_0x0307('0x155'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x2f2fe9['findBy']));return{'code':0xc8,'result':_0x0307('0x156')};}};AGIVertices[_0x0307('0x10')][_0x0307('0x159')]=function(_0x29d171){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x15a'),_0x29d171[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x29d171[_0x0307('0x15b')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x29d171,_0x0307('0x15c'));}this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x15d'),_0x29d171[_0x0307('0x15b')]));var _0x39c7ec=eval(_0x29d171[_0x0307('0x15b')]);if(!this[_0x0307('0x7e')](_0x29d171[_0x0307('0xd5')])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4edd39=this[_0x0307('0x11')][_0x0307('0x6b')](this,_0x29d171[_0x0307('0xd5')]);if(!_0x4edd39){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x29d171,_0x0307('0xd6'));}if(_[_0x0307('0x97')](_0x39c7ec)){var _0x5d1468=this;_0x39c7ec[_0x0307('0xd8')](function(_0x40dced,_0x9dcb28){_0x5d1468[_0x0307('0xd')][_0x0307('0x9f')](util[_0x0307('0x27')](_0x0307('0x15e'),_0x4edd39,_0x9dcb28),_0x40dced);});return this['channel']['noop'](util['format'](_0x0307('0x15f'),_0x4edd39));}else{return this[_0x0307('0xd')][_0x0307('0x9f')](_0x4edd39,_0x39c7ec);}};AGIVertices[_0x0307('0x10')][_0x0307('0xb')]=function(_0x145809){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x160'),_0x145809[_0x0307('0xb3')]));if(_0x145809[_0x0307('0x10e')]===0x0){return this[_0x0307('0xa0')](_0x145809);}_0x145809[_0x0307('0x10e')]-=0x1;if(!this[_0x0307('0x7e')](_0x145809[_0x0307('0x10f')])){return this['channel'][_0x0307('0x2b')](_0x145809,_0x0307('0x110'));}var _0x19da29=this[_0x0307('0x1b')][_0x0307('0x6b')](this,_0x145809[_0x0307('0x10f')]);if(!_0x19da29){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x145809,_0x0307('0x111'));}var _0x3ea0a1=this[_0x0307('0xd')][_0x0307('0x112')](_0x19da29,_0x145809[_0x0307('0x161')],_0x145809[_0x0307('0x162')]);var _0x5e4f24=_0x3ea0a1[_0x0307('0xaa')];if(_0x3ea0a1[_0x0307('0xaa')]===-0x1){this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x145809,'-1');return _0x3ea0a1;}else if(_0x3ea0a1[_0x0307('0x9c')]===_0x0307('0x62')){_0x3ea0a1['result']=_0x3ea0a1[_0x0307('0xaa')][_0x0307('0x98')]>0x0?_0x3ea0a1[_0x0307('0xaa')]:'t';}else if(_[_0x0307('0x3e')](_0x3ea0a1[_0x0307('0xaa')])){_0x3ea0a1[_0x0307('0xaa')]='#';_0x5e4f24='#';}if(!this['isConfigured'](_0x145809[_0x0307('0xd5')])){this[_0x0307('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x18f653=this[_0x0307('0x11')]['sync'](this,_0x145809[_0x0307('0xd5')]);if(!_0x18f653){return this['channel'][_0x0307('0x2b')](_0x145809,_0x0307('0xd6'));}this[_0x0307('0xd')][_0x0307('0x9f')](_0x18f653,_0x5e4f24);}this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x145809,_0x5e4f24);return _0x3ea0a1;};AGIVertices[_0x0307('0x10')]['noop']=function(_0x590944){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x163'),_0x590944[_0x0307('0xb3')]));return this['channel'][_0x0307('0xa2')](_0x590944[_0x0307('0x164')]||_0x590944[_0x0307('0xb3')]);};AGIVertices[_0x0307('0x10')][_0x0307('0x165')]=function(_0x215467){logger[_0x0307('0x2d')](util['format'](_0x0307('0x166'),_0x215467[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x215467[_0x0307('0x152')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x215467,_0x0307('0x151'));}logger['info'](util[_0x0307('0x27')](_0x0307('0x158'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x215467[_0x0307('0x152')]));var _0x1462a4=this[_0x0307('0x48')][_0x0307('0x6b')](this,_0x215467[_0x0307('0x167')]);var _0x246c83=this[_0x0307('0x4a')][_0x0307('0x6b')](this,_0x215467[_0x0307('0x152')],_0x1462a4);if(_0x246c83){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x153'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x215467[_0x0307('0x152')]));this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x153'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x215467[_0x0307('0x152')]));return{'code':0xc8,'result':_0x0307('0x154')};}else{logger[_0x0307('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x215467[_0x0307('0x152')]));this[_0x0307('0xd')]['noop'](util['format'](_0x0307('0x153'),this['channel'][_0x0307('0x4d')],_0x215467[_0x0307('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0307('0x10')]['playback']=function(_0x3cd8f1){logger[_0x0307('0x2d')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3cd8f1[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x3cd8f1['file_id'])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x3cd8f1,_0x0307('0x110'));}var _0x2292bd=this['getSound'][_0x0307('0x6b')](this,_0x3cd8f1[_0x0307('0x10f')]);if(!_0x2292bd){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x3cd8f1,_0x0307('0x111'));}var _0x25d955=this[_0x0307('0xd')][_0x0307('0xa4')](_0x0307('0x168'),[_0x2292bd,_0x3cd8f1[_0x0307('0xe0')]]);if(_0x25d955['result']===-0x1){return _0x25d955;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x169'),'PLAYBACK',_0x2292bd));};AGIVertices[_0x0307('0x10')][_0x0307('0x16a')]=function(_0x45db10){logger['info'](util['format'](_0x0307('0x16b'),_0x45db10['label']));if(!this[_0x0307('0x7e')](_0x45db10[_0x0307('0x16c')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x45db10,_0x0307('0x16d'));}var _0x4d9bc7='';var _0x4609b2=parseInt(_0x45db10[_0x0307('0x16c')],0xa);if(isNaN(_0x4609b2)){_0x4d9bc7=_0x45db10['queue_id'];}else{_0x4d9bc7=this[_0x0307('0x15')][_0x0307('0x6b')](this,_0x45db10[_0x0307('0x16c')]);if(!_0x4d9bc7){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x45db10,'no\x20queue\x20found');}}var _0x2c023a='';if(this[_0x0307('0x7e')](_0x45db10[_0x0307('0x10f')])){var _0x5aaebf=this[_0x0307('0x1b')][_0x0307('0x6b')](this,_0x45db10[_0x0307('0x10f')]);if(_0x5aaebf){_0x2c023a=_0x5aaebf;}}this['createSquareDetailsReport'][_0x0307('0x6b')](this,_0x45db10,_0x4d9bc7);if(_0x45db10[_0x0307('0xe0')][_0x0307('0x16e')]('x')<0x0){_0x45db10[_0x0307('0xe0')]+='x';}if(_0x45db10[_0x0307('0xe0')][_0x0307('0x16e')]('X')<0x0){_0x45db10[_0x0307('0xe0')]+='X';}this[_0x0307('0xd')][_0x0307('0x9f')](_0x0307('0x16f'),_0x4d9bc7?_0x4d9bc7[_0x0307('0x170')]():'');var _0x3fc12f=this[_0x0307('0xd')][_0x0307('0xa4')](_0x0307('0x171'),[_0x4d9bc7,_0x45db10[_0x0307('0xe0')],_0x45db10['url'],_0x2c023a,_0x45db10[_0x0307('0x62')],_0x45db10[_0x0307('0xb1')],_0x45db10['macro'],_0x45db10[_0x0307('0x172')],'',_0x45db10[_0x0307('0x173')]]);if(_0x3fc12f[_0x0307('0xaa')]===-0x1){return _0x3fc12f;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('Executed\x20command\x20%s\x20%s',_0x0307('0x171'),_0x4d9bc7));};AGIVertices['prototype'][_0x0307('0x174')]=function(_0x5f099c){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x175'),_0x5f099c['label']));var _0x3b421a=_0x5f099c[_0x0307('0x176')]||'wav';var _0x2f3fb4=util[_0x0307('0x27')](_0x0307('0x177'),this['channel']['uniqueid'],rs[_0x0307('0x115')](0x5));var _0x75871e=util[_0x0307('0x27')](_0x0307('0x178'),FILES_PATH,_0x2f3fb4,_0x3b421a);var _0x482058=util[_0x0307('0x27')](_0x0307('0x12d'),FILES_PATH,_0x2f3fb4);this['createSquareRecording'][_0x0307('0x6b')](this,_0x5f099c,_0x2f3fb4,_0x75871e);this[_0x0307('0xd')][_0x0307('0x9f')](_0x0307('0x179'),_0x2f3fb4);logger[_0x0307('0x2d')](_0x0307('0x17a'),_0x482058,_0x3b421a,_0x5f099c[_0x0307('0x17b')],_0x5f099c[_0x0307('0x62')]);return this['channel'][_0x0307('0x12f')](_0x482058,_0x3b421a,_0x5f099c[_0x0307('0x17b')],_0x5f099c['timeout'],undefined,!![]);};AGIVertices['prototype'][_0x0307('0x17c')]=function(_0x1c0e99){logger[_0x0307('0x2d')](util['format'](_0x0307('0x17d'),_0x1c0e99['label']));if(!this['isConfigured'](_0x1c0e99[_0x0307('0xe1')])){return this[_0x0307('0xd')][_0x0307('0xa2')]('no\x20url\x20configured');}var _0x10091e=this[_0x0307('0x60')]['sync'](this,_0x1c0e99);logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Response:',util[_0x0307('0x17e')](_0x10091e,{'showHidden':![],'depth':null})));if(!this[_0x0307('0x7e')](_0x1c0e99['variable_id'])){return this[_0x0307('0xd')]['noop'](_0x0307('0x17f'));}var _0x3cf949=this['getVariable'][_0x0307('0x6b')](this,_0x1c0e99[_0x0307('0xd5')]);if(!_0x3cf949){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x1c0e99,'no\x20variable\x20found');}this[_0x0307('0xd')][_0x0307('0x9f')](util['format']('%s_STATUS_CODE',_0x3cf949),_0x10091e[_0x0307('0x6e')]?_0x10091e[_0x0307('0x6e')]:_0x0307('0x180'));this[_0x0307('0xd')][_0x0307('0x9f')](util[_0x0307('0x27')]('%s_STATUS_MESSAGE',_0x3cf949),_0x10091e[_0x0307('0x181')]?_0x10091e['statusMessage']:'OK');if(_0x10091e[_0x0307('0x65')]){try{this[_0x0307('0x96')](_0x10091e[_0x0307('0x65')],_0x3cf949);}catch(_0x1b0e40){logger[_0x0307('0x2b')](util[_0x0307('0x27')](_0x0307('0x182'),_0x3cf949));}}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x183'),_0x3cf949));};AGIVertices[_0x0307('0x10')][_0x0307('0x184')]=function(_0x4db42e){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x185'),_0x4db42e[_0x0307('0xb3')]));return this[_0x0307('0xd')][_0x0307('0x186')](_0x4db42e[_0x0307('0x187')][_0x0307('0x55')](/\s+/g,''),_0x4db42e[_0x0307('0x17b')]);};AGIVertices[_0x0307('0x10')][_0x0307('0x188')]=function(_0x27b63f){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x189'),_0x27b63f[_0x0307('0xb3')]));return this[_0x0307('0xd')][_0x0307('0x18a')](_0x27b63f['number'][_0x0307('0x55')](/\s+/g,''),_0x27b63f[_0x0307('0x17b')]);};AGIVertices[_0x0307('0x10')][_0x0307('0x18b')]=function(_0x273a96){logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x273a96[_0x0307('0xb3')]));return this['channel'][_0x0307('0x18c')](_0x273a96[_0x0307('0x58')],_0x273a96[_0x0307('0x17b')]);};AGIVertices[_0x0307('0x10')][_0x0307('0x18d')]=function(_0x144321){logger['info'](util[_0x0307('0x27')](_0x0307('0x18e'),_0x144321[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x144321['account_id'])){return this[_0x0307('0xd')]['noop']('no\x20mail\x20account\x20configured');}var _0x5f47b3=this[_0x0307('0x1e')]['sync'](this,_0x144321[_0x0307('0x18f')]);if(!_0x5f47b3||!_0x5f47b3[_0x0307('0x190')]){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x144321,_0x0307('0x191'));}var _0x30549a={'from':util[_0x0307('0x27')]('\x22%s\x22\x20<%s>',_0x5f47b3[_0x0307('0x13')],_0x5f47b3[_0x0307('0x192')]||_0x5f47b3[_0x0307('0x190')][_0x0307('0x193')]),'to':_0x144321['to']||'','cc':_0x144321['cc']||'','bcc':_0x144321['bcc']||'','subject':_0x144321[_0x0307('0x194')],'html':_0x144321[_0x0307('0x58')],'text':_0x144321[_0x0307('0x58')]};if(this[_0x0307('0x7e')](_0x144321[_0x0307('0x195')])){}logger[_0x0307('0x196')]('sendMail\x20message',JSON[_0x0307('0x9a')](_0x30549a));this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x144321,_0x144321['account_id']);this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0x197'),_0x5f47b3[_0x0307('0x13')]));this[_0x0307('0x1f')]['sync'](this,_0x5f47b3['smtpOptions'],_0x30549a);return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x198'));};AGIVertices[_0x0307('0x10')]['sendFax']=function(_0x17945f){logger['info'](util['format'](_0x0307('0x199'),_0x17945f[_0x0307('0xb3')]));return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x19a'));};AGIVertices[_0x0307('0x10')][_0x0307('0x19b')]=function(_0x116b8a){logger[_0x0307('0x2d')](util['format'](_0x0307('0x19c'),_0x116b8a[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x116b8a[_0x0307('0x19d')])){return this['channel'][_0x0307('0xa2')](_0x0307('0x19e'));}var _0x2ddc06=this[_0x0307('0x19f')]['sync'](this,_0x116b8a[_0x0307('0x19d')]);if(!_0x2ddc06){return this['channel'][_0x0307('0x2b')](_0x116b8a,'no\x20sms\x20account\x20found');}var _0x5b4cf1={'body':_0x116b8a[_0x0307('0x1a0')],'phone':_0x116b8a['to']||'','SmsAccountId':_0x2ddc06['id']};logger[_0x0307('0x196')](_0x0307('0x1a1'),JSON[_0x0307('0x9a')](_0x5b4cf1));this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x116b8a,_0x116b8a[_0x0307('0x19d')]);this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x1a2'),_0x2ddc06[_0x0307('0x13')]));this[_0x0307('0x32')]['sync'](this,_0x5b4cf1);return this['channel']['noop'](_0x0307('0x1a3'));};AGIVertices[_0x0307('0x10')][_0x0307('0x1a4')]=function(_0x258dd2){logger[_0x0307('0x2d')](util[_0x0307('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x258dd2[_0x0307('0xb3')]));if(!this[_0x0307('0x7e')](_0x258dd2[_0x0307('0xd5')])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x258dd2,_0x0307('0x1a5'));}var _0x352f02=this['getVariable'][_0x0307('0x6b')](this,_0x258dd2[_0x0307('0xd5')]);if(!_0x352f02){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x258dd2,_0x0307('0xd6'));}return this[_0x0307('0xd')][_0x0307('0x9f')](_0x352f02,_0x258dd2[_0x0307('0x1a6')]);};AGIVertices['prototype'][_0x0307('0x1a7')]=function(_0x25e81a){logger['info'](util['format'](_0x0307('0x1a8'),_0x25e81a[_0x0307('0xb3')]));this[_0x0307('0xd')]['noop'](_0x0307('0x1a9'));if(_0x25e81a[_0x0307('0xb7')]===_0x0307('0x1aa')){this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0x1ab'));return this[_0x0307('0xd')][_0x0307('0xb7')]();}return this[_0x0307('0xd')][_0x0307('0xa2')]('Skipped\x20Answer');};AGIVertices[_0x0307('0x10')]['subproject']=function(_0x1c2d69){logger[_0x0307('0x2d')](util['format'](_0x0307('0x1ac'),_0x1c2d69['label']));if(!this[_0x0307('0x7e')](_0x1c2d69[_0x0307('0x1ad')])){return this[_0x0307('0xd')]['error'](_0x1c2d69,_0x0307('0x1ae'));}var _0xb745fd=this[_0x0307('0x17')][_0x0307('0x6b')](this,_0x1c2d69['project_id']);if(!this['isConfigured'](_0xb745fd)){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x1c2d69,util[_0x0307('0x27')](_0x0307('0x1af'),_0x1c2d69[_0x0307('0x1ad')]));}if(_0xb745fd===this['channel'][_0x0307('0x3b')]){return this['channel'][_0x0307('0x2b')](_0x1c2d69,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x0307('0x33')]['sync'](this,_0x1c2d69,_0xb745fd);var _0xc0761d=this[_0x0307('0xd')][_0x0307('0xa4')]('AGI',util[_0x0307('0x27')](_0x0307('0x1b0'),config[_0x0307('0xb1')]['host']||'127.0.0.1',_0xb745fd,this[_0x0307('0xd')][_0x0307('0x3b')]));if(_0xc0761d[_0x0307('0xaa')]===-0x1){return _0xc0761d;}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('Executed\x20command\x20%s\x20%s',_0x0307('0x1b1'),_0xb745fd));};AGIVertices[_0x0307('0x10')]['system']=function(_0x13de35){logger[_0x0307('0x2d')](util['format'](_0x0307('0x1b2'),_0x13de35[_0x0307('0xb3')]));var _0x179286=this[_0x0307('0x54')][_0x0307('0x6b')](this,_0x13de35[_0x0307('0xb4')]);this[_0x0307('0x33')][_0x0307('0x6b')](this,_0x13de35,_0x13de35[_0x0307('0xb4')]);if(this[_0x0307('0x7e')](_0x13de35['variable_id'])){var _0xdd0ec8=this['getVariable'][_0x0307('0x6b')](this,_0x13de35[_0x0307('0xd5')]);if(_0xdd0ec8){this[_0x0307('0xd')][_0x0307('0x9f')](_0xdd0ec8,_0x179286);return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x1b3'),_0x13de35[_0x0307('0xb4')],_0xdd0ec8));}}return this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x13de35[_0x0307('0xb4')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0xa7964d){logger['info'](util[_0x0307('0x27')](_0x0307('0x1b4'),_0xa7964d[_0x0307('0xb3')]));_0xa7964d['text']=_0xa7964d[_0x0307('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0307('0x7e')](_0xa7964d[_0x0307('0x56')])){return this[_0x0307('0xd')]['noop'](_0x0307('0x1b5'));}if(!this[_0x0307('0x7e')](_0xa7964d[_0x0307('0x58')])){return this[_0x0307('0xd')][_0x0307('0xa2')](_0x0307('0xa3'));}this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x1b6'),_0xa7964d[_0x0307('0x58')]));var _0x4b9dcb=this[_0x0307('0x1b7')][_0x0307('0x6b')](this,_0xa7964d);if(_0x4b9dcb){this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0x1b8'),_0x4b9dcb));var _0x458e34=this[_0x0307('0xd')][_0x0307('0xfe')](_0x4b9dcb);try{fs[_0x0307('0xff')](_0x4b9dcb+'.wav');}catch(_0x67b47e){logger['error'](_0x67b47e);}return _0x458e34;}return this[_0x0307('0xd')][_0x0307('0x2b')](_0xa7964d,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x0307('0x1b9')]=function(_0x2c659d){logger[_0x0307('0x2d')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2c659d[_0x0307('0xb3')]));_0x2c659d[_0x0307('0x58')]=_0x2c659d[_0x0307('0x58')][_0x0307('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0307('0x7e')](_0x2c659d['text'])){return this[_0x0307('0xd')]['noop'](_0x0307('0xa3'));}this[_0x0307('0xd')][_0x0307('0xa2')](util[_0x0307('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x2c659d[_0x0307('0x58')]));var _0x48ea80=this[_0x0307('0x5e')][_0x0307('0x6b')](this,_0x2c659d);if(_0x48ea80){this['channel'][_0x0307('0xa2')](util[_0x0307('0x27')](_0x0307('0x1ba'),_0x48ea80));var _0x3ee5c1=this[_0x0307('0xd')][_0x0307('0xfe')](_0x48ea80);try{fs[_0x0307('0xff')](_0x48ea80+'.wav');}catch(_0x441165){logger[_0x0307('0x2b')](_0x441165);}return _0x3ee5c1;}return this[_0x0307('0xd')][_0x0307('0x2b')](_0x2c659d,_0x0307('0x1bb'));};AGIVertices[_0x0307('0x10')][_0x0307('0x1bc')]=function(_0x233e83){logger['info'](util['format'](_0x0307('0x1bd'),_0x233e83['label']));if(!this[_0x0307('0x7e')](_0x233e83[_0x0307('0x152')])){return this['channel'][_0x0307('0x2b')](_0x233e83,_0x0307('0x151'));}logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x158'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x233e83[_0x0307('0x152')]));var _0x36b631=this[_0x0307('0x4b')][_0x0307('0x6b')](this,_0x233e83[_0x0307('0x152')]);if(_0x36b631){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x153'),this[_0x0307('0xd')]['callerid'],_0x233e83[_0x0307('0x152')]));this[_0x0307('0xd')][_0x0307('0xa2')](util['format'](_0x0307('0x153'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x233e83['findBy']));return{'code':0xc8,'result':_0x0307('0x154')};}else{logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x155'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x233e83[_0x0307('0x152')]));this[_0x0307('0xd')]['noop'](util['format'](_0x0307('0x155'),this[_0x0307('0xd')][_0x0307('0x4d')],_0x233e83[_0x0307('0x152')]));return{'code':0xc8,'result':_0x0307('0x156')};}};AGIVertices['prototype']['voicemail']=function(_0x3921d6){logger['info'](util[_0x0307('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3921d6[_0x0307('0xb3')]));var _0x11eb6e=this['channel']['exec'](_0x0307('0x1be'),[_0x3921d6[_0x0307('0x1bf')],_0x3921d6[_0x0307('0x70')]]);if(_0x11eb6e[_0x0307('0xaa')]===-0x1){return _0x11eb6e;}return this[_0x0307('0xd')]['noop'](util[_0x0307('0x27')]('Executed\x20command\x20%s\x20%s',_0x0307('0x1be'),_0x3921d6['mailbox']));};AGIVertices['prototype'][_0x0307('0x1c0')]=function(_0x5179ad){logger[_0x0307('0x2d')](util[_0x0307('0x27')](_0x0307('0x1c1'),_0x5179ad[_0x0307('0xb3')]));if(!this['isConfigured'](_0x5179ad['variable_id'])){return this[_0x0307('0xd')][_0x0307('0x2b')](_0x5179ad,'no\x20variable\x20selected');}var _0x11745b=this['getVariable'][_0x0307('0x6b')](this,_0x5179ad[_0x0307('0xd5')]);if(!_0x11745b){return this['channel']['error'](_0x5179ad,_0x0307('0xd6'));}var _0x153868=this[_0x0307('0xd')][_0x0307('0x11')](_0x11745b);return{'code':0xc8,'result':_0x153868['extra']?_0x153868[_0x0307('0x9c')]:'-'};};String['prototype'][_0x0307('0x1c2')]=function(_0x13b2f8,_0x3c8be5){return this['split'](_0x13b2f8)[_0x0307('0x1c3')](_0x3c8be5);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 84be7fd..56d707a 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 _0xf1dd=['ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','prototype','startAcw','channels','queue'];(function(_0x21c2e4,_0x4411bb){var _0x4f215d=function(_0x558596){while(--_0x558596){_0x21c2e4['push'](_0x21c2e4['shift']());}};_0x4f215d(++_0x4411bb);}(_0xf1dd,0x1da));var _0xdf1d=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0xf1dd[_0x15ec4e];return _0xb5e5dd;};'use strict';var _=require(_0xdf1d('0x0'));var moment=require(_0xdf1d('0x1'));var ami=require(_0xdf1d('0x2'));var logger=require('../../../config/logger')(_0xdf1d('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xdf1d('0x4'));function Acw(_0x2ffcb3){this[_0xdf1d('0x5')]=_0x2ffcb3[_0xdf1d('0x5')];this[_0xdf1d('0x6')]=_0x2ffcb3[_0xdf1d('0x6')];this['timers']=_0x2ffcb3[_0xdf1d('0x7')];this['channels']={};ami['on'](_0xdf1d('0x8'),this[_0xdf1d('0x9')][_0xdf1d('0xa')](this));ami['on']('hanguprequest',this[_0xdf1d('0xb')][_0xdf1d('0xa')](this));ami['on'](_0xdf1d('0xc'),this[_0xdf1d('0xd')][_0xdf1d('0xa')](this));ami['on']('agentringnoanswer',this[_0xdf1d('0xe')][_0xdf1d('0xa')](this));ami['on'](_0xdf1d('0xf'),this['syncAttendedTransfer'][_0xdf1d('0xa')](this));ami['on'](_0xdf1d('0x10'),this[_0xdf1d('0x11')][_0xdf1d('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0xdf1d('0x12')][_0xdf1d('0xa')](this));}function getDiff(_0x5a91a1){var _0xeb7388=moment()[_0xdf1d('0x13')](0x0);var _0x512256=moment(_0x5a91a1)[_0xdf1d('0x13')](0x0);return _0xeb7388['diff'](_0x512256,'seconds');}Acw[_0xdf1d('0x14')][_0xdf1d('0x15')]=function(_0x2a3bc2){try{var _0x38f37f=this;var _0x5ed849=this[_0xdf1d('0x16')][_0x2a3bc2]['interface'];var _0x11ed48=this['channels'][_0x2a3bc2][_0xdf1d('0x17')];var _0x517f6f=this[_0xdf1d('0x5')][_0x11ed48];var _0x391951=![];var _0x1bc81c=_0xdf1d('0x18');if(_0x517f6f[_0xdf1d('0x19')]){if(_0x517f6f['mandatoryDispositionPause'][_0xdf1d('0x1a')]){_0x391951=!![];_0x1bc81c=_0x517f6f[_0xdf1d('0x1b')][_0xdf1d('0x1a')];}}return ami[_0xdf1d('0x1c')]({'action':_0xdf1d('0x1d'),'interface':_0x5ed849,'paused':!![],'reason':_0x1bc81c})[_0xdf1d('0x1e')](function(){if(_0x38f37f[_0xdf1d('0x6')][_0x5ed849]){return RpcUser[_0xdf1d('0x1f')](_0x38f37f[_0xdf1d('0x6')][_0x5ed849]['id'])['then'](function(_0x4ddbdd){if(_0x4ddbdd&&!_0x4ddbdd[_0xdf1d('0x20')]){logger[_0xdf1d('0x21')](_0xdf1d('0x22'),_0x2a3bc2,_0x5ed849,_0x11ed48);var _0x232a5b=_0x38f37f['channels'][_0x2a3bc2][_0xdf1d('0x23')]&&_0x38f37f[_0xdf1d('0x16')][_0x2a3bc2][_0xdf1d('0x24')]?_0x38f37f[_0xdf1d('0x16')][_0x2a3bc2][_0xdf1d('0x24')]:_0x2a3bc2;return RpcUser[_0xdf1d('0x25')](_0x38f37f[_0xdf1d('0x6')][_0x5ed849],_0x1bc81c,_0x232a5b)[_0xdf1d('0x1e')](function(){if(!_0x391951){_0x38f37f[_0xdf1d('0x7')][_0x5ed849]={};logger[_0xdf1d('0x21')](_0xdf1d('0x26'),_0x2a3bc2,_0x38f37f[_0xdf1d('0x5')][_0x11ed48][_0xdf1d('0x27')],_0x5ed849,_0x11ed48);_0x38f37f[_0xdf1d('0x7')][_0x5ed849][_0xdf1d('0x28')]=setTimeout(_0x38f37f[_0xdf1d('0x29')]['bind'](_0x38f37f,_0x5ed849),_0x38f37f['voiceQueues'][_0x11ed48][_0xdf1d('0x27')]*0x3e8);_0x38f37f[_0xdf1d('0x7')][_0x5ed849][_0xdf1d('0x2a')]=moment()['format'](_0xdf1d('0x2b'));_0x38f37f[_0xdf1d('0x7')][_0x5ed849][_0xdf1d('0x2c')]=_0x2a3bc2;_0x38f37f[_0xdf1d('0x7')][_0x5ed849][_0xdf1d('0x17')]=_0x11ed48;_0x38f37f['timers'][_0x5ed849][_0xdf1d('0x2d')]=function(){var _0x21d865=getDiff(_0x38f37f[_0xdf1d('0x7')][_0x5ed849][_0xdf1d('0x2a')]);clearTimeout(_0x38f37f[_0xdf1d('0x7')][_0x5ed849][_0xdf1d('0x28')]);_0x38f37f[_0xdf1d('0x7')][_0x5ed849]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x21d865},_0x38f37f[_0xdf1d('0x7')][_0x5ed849]['uniqueid'],_0x5ed849)[_0xdf1d('0x1e')](function(_0x54b3bc){logger[_0xdf1d('0x21')](_0xdf1d('0x2e'),_0x2a3bc2,_0x21d865,_0x54b3bc);})[_0xdf1d('0x2f')](function(_0x38e68c){logger[_0xdf1d('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x2a3bc2,_0x38e68c);});delete _0x38f37f[_0xdf1d('0x7')][_0x5ed849];};}});}else{logger[_0xdf1d('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2a3bc2,_0x5ed849,_0x11ed48);}});}})[_0xdf1d('0x2f')](function(){logger[_0xdf1d('0x30')](_0xdf1d('0x26'),_0x2a3bc2,_0x38f37f[_0xdf1d('0x5')][_0x11ed48][_0xdf1d('0x27')],_0x5ed849,_0x11ed48);})[_0xdf1d('0x31')](function(){delete _0x38f37f['channels'][_0x2a3bc2];});}catch(_0x63e9f7){logger['error'](_0xdf1d('0x32'),_0x63e9f7[_0xdf1d('0x33')]);}};Acw[_0xdf1d('0x14')][_0xdf1d('0x29')]=function(_0x1800f0){try{var _0x1cf6db=this;if(_0x1cf6db['timers'][_0x1800f0]){_0x1cf6db[_0xdf1d('0x7')][_0x1800f0]['timer']=![];var _0x3b667b=_0x1cf6db[_0xdf1d('0x7')][_0x1800f0][_0xdf1d('0x2c')];var _0x570af2=_0x1cf6db[_0xdf1d('0x7')][_0x1800f0][_0xdf1d('0x17')];var _0x3b170=_0x1cf6db[_0xdf1d('0x5')][_0x570af2]['acwTimeout'];logger[_0xdf1d('0x21')](_0xdf1d('0x34'),_0x3b667b,_0x1800f0);RpcUser[_0xdf1d('0x35')](this['agents'][_0x1800f0]);RpcVoiceAgentReport['update']({'acwtime':_0x3b170,'agentacw':!![]},_0x3b667b,_0x1800f0)[_0xdf1d('0x1e')](function(_0x2769a9){logger[_0xdf1d('0x21')](_0xdf1d('0x2e'),_0x3b667b,_0x3b170,_0x2769a9);})[_0xdf1d('0x2f')](function(_0x52ec8c){logger[_0xdf1d('0x30')](_0xdf1d('0x36'),_0x3b667b,_0x52ec8c);});}else{logger[_0xdf1d('0x30')](_0xdf1d('0x37'),_0x1800f0);if(_0x1cf6db[_0xdf1d('0x7')]){logger[_0xdf1d('0x21')](_0xdf1d('0x38'),JSON[_0xdf1d('0x39')](_0x1cf6db[_0xdf1d('0x7')]));}}}catch(_0x54e3f2){logger[_0xdf1d('0x30')](_0xdf1d('0x3a'),_0x54e3f2[_0xdf1d('0x33')]);}};Acw[_0xdf1d('0x14')][_0xdf1d('0x9')]=function(_0x364cd9){try{if(this[_0xdf1d('0x5')][_0x364cd9[_0xdf1d('0x17')]]&&(this[_0xdf1d('0x5')][_0x364cd9['queue']][_0xdf1d('0x3')]||this[_0xdf1d('0x5')][_0x364cd9[_0xdf1d('0x17')]][_0xdf1d('0x19')])){if(this[_0xdf1d('0x6')][_0x364cd9['interface']]){this[_0xdf1d('0x16')][_0x364cd9[_0xdf1d('0x2c')]]={'queue':_0x364cd9[_0xdf1d('0x17')],'interface':_0x364cd9[_0xdf1d('0x3b')],'destlinkedid':_0x364cd9[_0xdf1d('0x24')]};}}}catch(_0x2cfcc5){logger[_0xdf1d('0x30')](_0xdf1d('0x3c'),_0x2cfcc5[_0xdf1d('0x33')]);}};Acw[_0xdf1d('0x14')][_0xdf1d('0x12')]=function(_0x3ae8c3){try{if(this[_0xdf1d('0x5')][_0x3ae8c3[_0xdf1d('0x17')]]&&(this[_0xdf1d('0x5')][_0x3ae8c3[_0xdf1d('0x17')]][_0xdf1d('0x3')]||this[_0xdf1d('0x5')][_0x3ae8c3[_0xdf1d('0x17')]]['mandatoryDisposition'])){if(this[_0xdf1d('0x6')][_0x3ae8c3[_0xdf1d('0x3b')]]){this['channels'][_0x3ae8c3[_0xdf1d('0x2c')]]={'queue':_0x3ae8c3[_0xdf1d('0x17')],'interface':_0x3ae8c3[_0xdf1d('0x3b')]};}}}catch(_0xe90b77){logger[_0xdf1d('0x30')](_0xdf1d('0x3d'),_0xe90b77['message']);}};Acw[_0xdf1d('0x14')][_0xdf1d('0xb')]=function(_0x42d687){try{if(this[_0xdf1d('0x16')][_0x42d687[_0xdf1d('0x2c')]]&&_['isUndefined'](this['channels'][_0x42d687[_0xdf1d('0x2c')]]['attended'])){logger['info'](_0xdf1d('0x3e'),_0x42d687[_0xdf1d('0x2c')]);this[_0xdf1d('0x15')](_0x42d687['uniqueid']);}else if(this[_0xdf1d('0x16')][_0x42d687['linkedid']]&&_[_0xdf1d('0x3f')](this[_0xdf1d('0x16')][_0x42d687[_0xdf1d('0x40')]][_0xdf1d('0x23')])){logger[_0xdf1d('0x21')](_0xdf1d('0x41'),_0x42d687[_0xdf1d('0x40')]);this[_0xdf1d('0x15')](_0x42d687[_0xdf1d('0x40')]);}}catch(_0x31d5ab){logger[_0xdf1d('0x30')](_0xdf1d('0x42'),_0x31d5ab['message']);}};Acw['prototype'][_0xdf1d('0xd')]=function(_0xa438c4){try{if(this['channels'][_0xa438c4[_0xdf1d('0x2c')]]&&this[_0xdf1d('0x16')][_0xa438c4[_0xdf1d('0x2c')]][_0xdf1d('0x23')]){logger[_0xdf1d('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xa438c4[_0xdf1d('0x2c')]);this[_0xdf1d('0x15')](_0xa438c4[_0xdf1d('0x2c')]);}else if(this[_0xdf1d('0x16')][_0xa438c4[_0xdf1d('0x40')]]&&this[_0xdf1d('0x16')][_0xa438c4[_0xdf1d('0x40')]][_0xdf1d('0x23')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xa438c4[_0xdf1d('0x40')]);this[_0xdf1d('0x15')](_0xa438c4[_0xdf1d('0x40')]);}}catch(_0x4ac9d0){logger[_0xdf1d('0x30')](_0xdf1d('0x43'),_0x4ac9d0[_0xdf1d('0x33')]);}};Acw[_0xdf1d('0x14')][_0xdf1d('0x44')]=function(_0x2cc406){try{if(!_[_0xdf1d('0x45')](this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x46')]])){this['startAcw'](_0x2cc406['transfereeuniqueid']);if(this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x47')]]){this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x47')]][_0xdf1d('0x23')]=!![];this['channels'][_0x2cc406[_0xdf1d('0x48')]]=this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x47')]];delete this[_0xdf1d('0x16')][_0x2cc406['secondtransfereruniqueid']];}}else if(!_[_0xdf1d('0x45')](this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x48')]])){this[_0xdf1d('0x15')](_0x2cc406[_0xdf1d('0x48')]);if(this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x49')]]){this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x49')]][_0xdf1d('0x23')]=!![];this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x46')]]=this['channels'][_0x2cc406['origtransfereruniqueid']];delete this[_0xdf1d('0x16')][_0x2cc406[_0xdf1d('0x49')]];}}}catch(_0x105b9d){logger['error'](_0xdf1d('0x4a'),_0x105b9d[_0xdf1d('0x33')]);}};Acw[_0xdf1d('0x14')]['syncBlindTransfer']=function(_0x17e913){try{if(this[_0xdf1d('0x16')][_0x17e913[_0xdf1d('0x4b')]]){logger['info'](_0xdf1d('0x4c'),JSON[_0xdf1d('0x39')](_0x17e913[_0xdf1d('0x4b')]));this[_0xdf1d('0x15')](_0x17e913[_0xdf1d('0x4b')]);}else if(this[_0xdf1d('0x16')][_0x17e913[_0xdf1d('0x4d')]]){logger[_0xdf1d('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xdf1d('0x39')](_0x17e913[_0xdf1d('0x4d')]));this[_0xdf1d('0x15')](_0x17e913['transfererlinkedid']);}}catch(_0x5d84e4){logger[_0xdf1d('0x30')]('[ACW][syncBlindTransfer]\x20%s',_0x5d84e4[_0xdf1d('0x33')]);}};Acw[_0xdf1d('0x14')][_0xdf1d('0xe')]=function(_0x146c64){try{if(this[_0xdf1d('0x5')][_0x146c64[_0xdf1d('0x17')]]&&this[_0xdf1d('0x5')][_0x146c64['queue']][_0xdf1d('0x4e')]===_0xdf1d('0x4f')){if(this['agents'][_0x146c64[_0xdf1d('0x3b')]]){logger[_0xdf1d('0x21')](_0xdf1d('0x50'),_0x146c64[_0xdf1d('0x2c')],_0x146c64[_0xdf1d('0x3b')],_0x146c64[_0xdf1d('0x17')]);return RpcUser[_0xdf1d('0x25')](this[_0xdf1d('0x6')][_0x146c64[_0xdf1d('0x3b')]],_0xdf1d('0x51'),_0x146c64[_0xdf1d('0x2c')]);}}}catch(_0x34e9df){logger['error'](_0xdf1d('0x52'),_0x34e9df[_0xdf1d('0x33')]);}};module['exports']=Acw; \ No newline at end of file +var _0x10ed=['syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','stopAcw','saveUnpause','[%s][UPDATE][ERRORS:%s]','stringify','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','bind','attendedtransfer','syncAttendedTransfer','blindtransfer'];(function(_0x4de359,_0x29422b){var _0x30dfda=function(_0x895f89){while(--_0x895f89){_0x4de359['push'](_0x4de359['shift']());}};_0x30dfda(++_0x29422b);}(_0x10ed,0x1a2));var _0xd10e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x10ed[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xd10e('0x0'));var moment=require(_0xd10e('0x1'));var ami=require(_0xd10e('0x2'));var logger=require(_0xd10e('0x3'))(_0xd10e('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xd10e('0x5'));function Acw(_0x309982){this[_0xd10e('0x6')]=_0x309982[_0xd10e('0x6')];this[_0xd10e('0x7')]=_0x309982[_0xd10e('0x7')];this[_0xd10e('0x8')]=_0x309982[_0xd10e('0x8')];this[_0xd10e('0x9')]={};ami['on'](_0xd10e('0xa'),this[_0xd10e('0xb')]['bind'](this));ami['on'](_0xd10e('0xc'),this[_0xd10e('0xd')]['bind'](this));ami['on'](_0xd10e('0xe'),this[_0xd10e('0xf')]['bind'](this));ami['on'](_0xd10e('0x10'),this[_0xd10e('0x11')][_0xd10e('0x12')](this));ami['on'](_0xd10e('0x13'),this[_0xd10e('0x14')]['bind'](this));ami['on'](_0xd10e('0x15'),this[_0xd10e('0x16')][_0xd10e('0x12')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xd10e('0x12')](this));}function getDiff(_0xd94194){var _0x3329d9=moment()[_0xd10e('0x17')](0x0);var _0x207d42=moment(_0xd94194)[_0xd10e('0x17')](0x0);return _0x3329d9[_0xd10e('0x18')](_0x207d42,_0xd10e('0x19'));}Acw[_0xd10e('0x1a')][_0xd10e('0x1b')]=function(_0x323d0d){try{var _0xb535a8=this;var _0x1f290a=this['channels'][_0x323d0d]['interface'];var _0x1e362c=this['channels'][_0x323d0d]['queue'];var _0x2459cd=this[_0xd10e('0x6')][_0x1e362c];var _0x499f9e=![];var _0x5a0d0d=_0xd10e('0x1c');if(_0x2459cd[_0xd10e('0x1d')]){if(_0x2459cd[_0xd10e('0x1e')][_0xd10e('0x1f')]){_0x499f9e=!![];_0x5a0d0d=_0x2459cd[_0xd10e('0x1e')][_0xd10e('0x1f')];}}return ami[_0xd10e('0x20')]({'action':_0xd10e('0x21'),'interface':_0x1f290a,'paused':!![],'reason':_0x5a0d0d})['then'](function(){if(_0xb535a8['agents'][_0x1f290a]){return RpcUser[_0xd10e('0x22')](_0xb535a8[_0xd10e('0x7')][_0x1f290a]['id'])[_0xd10e('0x23')](function(_0x4496ed){if(_0x4496ed&&!_0x4496ed[_0xd10e('0x24')]){logger[_0xd10e('0x25')](_0xd10e('0x26'),_0x323d0d,_0x1f290a,_0x1e362c);var _0xbab4ff=_0xb535a8[_0xd10e('0x9')][_0x323d0d][_0xd10e('0x27')]&&_0xb535a8[_0xd10e('0x9')][_0x323d0d]['destlinkedid']?_0xb535a8[_0xd10e('0x9')][_0x323d0d][_0xd10e('0x28')]:_0x323d0d;return RpcUser[_0xd10e('0x29')](_0xb535a8[_0xd10e('0x7')][_0x1f290a],_0x5a0d0d,_0xbab4ff)[_0xd10e('0x23')](function(){if(!_0x499f9e){_0xb535a8[_0xd10e('0x8')][_0x1f290a]={};logger[_0xd10e('0x25')](_0xd10e('0x2a'),_0x323d0d,_0xb535a8[_0xd10e('0x6')][_0x1e362c]['acwTimeout'],_0x1f290a,_0x1e362c);_0xb535a8[_0xd10e('0x8')][_0x1f290a][_0xd10e('0x2b')]=setTimeout(_0xb535a8['stopAcw']['bind'](_0xb535a8,_0x1f290a),_0xb535a8['voiceQueues'][_0x1e362c][_0xd10e('0x2c')]*0x3e8);_0xb535a8[_0xd10e('0x8')][_0x1f290a][_0xd10e('0x2d')]=moment()[_0xd10e('0x2e')](_0xd10e('0x2f'));_0xb535a8[_0xd10e('0x8')][_0x1f290a][_0xd10e('0x30')]=_0x323d0d;_0xb535a8[_0xd10e('0x8')][_0x1f290a][_0xd10e('0x31')]=_0x1e362c;_0xb535a8['timers'][_0x1f290a][_0xd10e('0x32')]=function(){var _0x26f011=getDiff(_0xb535a8[_0xd10e('0x8')][_0x1f290a]['lastPauseAt']);clearTimeout(_0xb535a8[_0xd10e('0x8')][_0x1f290a][_0xd10e('0x2b')]);_0xb535a8[_0xd10e('0x8')][_0x1f290a][_0xd10e('0x2b')]=![];RpcVoiceAgentReport[_0xd10e('0x33')]({'acwtime':_0x26f011},_0xb535a8[_0xd10e('0x8')][_0x1f290a]['uniqueid'],_0x1f290a)[_0xd10e('0x23')](function(_0x52bcda){logger[_0xd10e('0x25')](_0xd10e('0x34'),_0x323d0d,_0x26f011,_0x52bcda);})[_0xd10e('0x35')](function(_0x2340f2){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x323d0d,_0x2340f2);});delete _0xb535a8[_0xd10e('0x8')][_0x1f290a];};}});}else{logger[_0xd10e('0x25')](_0xd10e('0x36'),_0x323d0d,_0x1f290a,_0x1e362c);}});}})[_0xd10e('0x35')](function(){logger[_0xd10e('0x37')](_0xd10e('0x2a'),_0x323d0d,_0xb535a8[_0xd10e('0x6')][_0x1e362c][_0xd10e('0x2c')],_0x1f290a,_0x1e362c);})[_0xd10e('0x38')](function(){delete _0xb535a8['channels'][_0x323d0d];});}catch(_0x3616c2){logger['error'](_0xd10e('0x39'),_0x3616c2[_0xd10e('0x3a')]);}};Acw[_0xd10e('0x1a')][_0xd10e('0x3b')]=function(_0x64f43c){try{var _0x1c90cb=this;if(_0x1c90cb[_0xd10e('0x8')][_0x64f43c]){_0x1c90cb[_0xd10e('0x8')][_0x64f43c][_0xd10e('0x2b')]=![];var _0x307dbc=_0x1c90cb[_0xd10e('0x8')][_0x64f43c][_0xd10e('0x30')];var _0x1e7adf=_0x1c90cb['timers'][_0x64f43c][_0xd10e('0x31')];var _0x57f46b=_0x1c90cb[_0xd10e('0x6')][_0x1e7adf]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x307dbc,_0x64f43c);RpcUser[_0xd10e('0x3c')](this[_0xd10e('0x7')][_0x64f43c]);RpcVoiceAgentReport['update']({'acwtime':_0x57f46b,'agentacw':!![]},_0x307dbc,_0x64f43c)['then'](function(_0x17a907){logger[_0xd10e('0x25')](_0xd10e('0x34'),_0x307dbc,_0x57f46b,_0x17a907);})['catch'](function(_0x1a38e1){logger[_0xd10e('0x37')](_0xd10e('0x3d'),_0x307dbc,_0x1a38e1);});}else{logger[_0xd10e('0x37')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x64f43c);if(_0x1c90cb[_0xd10e('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0xd10e('0x3e')](_0x1c90cb['timers']));}}}catch(_0x5ed6f8){logger[_0xd10e('0x37')]('[ACW][STOP]\x20%s',_0x5ed6f8[_0xd10e('0x3a')]);}};Acw[_0xd10e('0x1a')][_0xd10e('0xb')]=function(_0x14f894){try{if(this[_0xd10e('0x6')][_0x14f894[_0xd10e('0x31')]]&&(this[_0xd10e('0x6')][_0x14f894['queue']][_0xd10e('0x4')]||this[_0xd10e('0x6')][_0x14f894['queue']][_0xd10e('0x1d')])){if(this['agents'][_0x14f894[_0xd10e('0x3f')]]){this[_0xd10e('0x9')][_0x14f894[_0xd10e('0x30')]]={'queue':_0x14f894['queue'],'interface':_0x14f894[_0xd10e('0x3f')],'destlinkedid':_0x14f894[_0xd10e('0x28')]};}}}catch(_0x5698b9){logger[_0xd10e('0x37')](_0xd10e('0x40'),_0x5698b9[_0xd10e('0x3a')]);}};Acw[_0xd10e('0x1a')][_0xd10e('0x41')]=function(_0x751a53){try{if(this['voiceQueues'][_0x751a53[_0xd10e('0x31')]]&&(this[_0xd10e('0x6')][_0x751a53[_0xd10e('0x31')]][_0xd10e('0x4')]||this[_0xd10e('0x6')][_0x751a53[_0xd10e('0x31')]][_0xd10e('0x1d')])){if(this[_0xd10e('0x7')][_0x751a53[_0xd10e('0x3f')]]){this[_0xd10e('0x9')][_0x751a53['uniqueid']]={'queue':_0x751a53['queue'],'interface':_0x751a53['interface']};}}}catch(_0x26244a){logger[_0xd10e('0x37')](_0xd10e('0x42'),_0x26244a[_0xd10e('0x3a')]);}};Acw[_0xd10e('0x1a')][_0xd10e('0xd')]=function(_0x5229d3){try{if(this[_0xd10e('0x9')][_0x5229d3[_0xd10e('0x30')]]&&_[_0xd10e('0x43')](this[_0xd10e('0x9')][_0x5229d3[_0xd10e('0x30')]][_0xd10e('0x27')])){logger[_0xd10e('0x25')](_0xd10e('0x44'),_0x5229d3[_0xd10e('0x30')]);this[_0xd10e('0x1b')](_0x5229d3[_0xd10e('0x30')]);}else if(this[_0xd10e('0x9')][_0x5229d3[_0xd10e('0x45')]]&&_['isUndefined'](this[_0xd10e('0x9')][_0x5229d3[_0xd10e('0x45')]][_0xd10e('0x27')])){logger['info'](_0xd10e('0x46'),_0x5229d3[_0xd10e('0x45')]);this[_0xd10e('0x1b')](_0x5229d3[_0xd10e('0x45')]);}}catch(_0x33b255){logger[_0xd10e('0x37')](_0xd10e('0x47'),_0x33b255[_0xd10e('0x3a')]);}};Acw[_0xd10e('0x1a')][_0xd10e('0xf')]=function(_0x359672){try{if(this['channels'][_0x359672[_0xd10e('0x30')]]&&this[_0xd10e('0x9')][_0x359672[_0xd10e('0x30')]][_0xd10e('0x27')]){logger[_0xd10e('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x359672[_0xd10e('0x30')]);this[_0xd10e('0x1b')](_0x359672[_0xd10e('0x30')]);}else if(this[_0xd10e('0x9')][_0x359672[_0xd10e('0x45')]]&&this[_0xd10e('0x9')][_0x359672[_0xd10e('0x45')]]['attended']){logger[_0xd10e('0x25')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x359672[_0xd10e('0x45')]);this['startAcw'](_0x359672[_0xd10e('0x45')]);}}catch(_0x5d3b39){logger[_0xd10e('0x37')](_0xd10e('0x48'),_0x5d3b39[_0xd10e('0x3a')]);}};Acw[_0xd10e('0x1a')][_0xd10e('0x14')]=function(_0x96d7af){try{if(!_[_0xd10e('0x49')](this[_0xd10e('0x9')][_0x96d7af[_0xd10e('0x4a')]])){this[_0xd10e('0x1b')](_0x96d7af[_0xd10e('0x4a')]);if(this['channels'][_0x96d7af[_0xd10e('0x4b')]]){this['channels'][_0x96d7af[_0xd10e('0x4b')]][_0xd10e('0x27')]=!![];this[_0xd10e('0x9')][_0x96d7af['transfertargetuniqueid']]=this[_0xd10e('0x9')][_0x96d7af['secondtransfereruniqueid']];delete this[_0xd10e('0x9')][_0x96d7af[_0xd10e('0x4b')]];}}else if(!_[_0xd10e('0x49')](this[_0xd10e('0x9')][_0x96d7af['transfertargetuniqueid']])){this[_0xd10e('0x1b')](_0x96d7af['transfertargetuniqueid']);if(this['channels'][_0x96d7af['origtransfereruniqueid']]){this[_0xd10e('0x9')][_0x96d7af[_0xd10e('0x4c')]]['attended']=!![];this['channels'][_0x96d7af['transfereeuniqueid']]=this['channels'][_0x96d7af[_0xd10e('0x4c')]];delete this['channels'][_0x96d7af[_0xd10e('0x4c')]];}}}catch(_0x272ff5){logger[_0xd10e('0x37')](_0xd10e('0x4d'),_0x272ff5['message']);}};Acw[_0xd10e('0x1a')]['syncBlindTransfer']=function(_0x173ae8){try{if(this[_0xd10e('0x9')][_0x173ae8[_0xd10e('0x4e')]]){logger[_0xd10e('0x25')](_0xd10e('0x4f'),JSON[_0xd10e('0x3e')](_0x173ae8['transfereruniqueid']));this[_0xd10e('0x1b')](_0x173ae8[_0xd10e('0x4e')]);}else if(this['channels'][_0x173ae8[_0xd10e('0x50')]]){logger[_0xd10e('0x25')](_0xd10e('0x51'),JSON[_0xd10e('0x3e')](_0x173ae8[_0xd10e('0x50')]));this[_0xd10e('0x1b')](_0x173ae8['transfererlinkedid']);}}catch(_0x291da0){logger[_0xd10e('0x37')](_0xd10e('0x52'),_0x291da0['message']);}};Acw[_0xd10e('0x1a')][_0xd10e('0x11')]=function(_0x3f38f4){try{if(this[_0xd10e('0x6')][_0x3f38f4['queue']]&&this[_0xd10e('0x6')][_0x3f38f4[_0xd10e('0x31')]][_0xd10e('0x53')]===_0xd10e('0x54')){if(this[_0xd10e('0x7')][_0x3f38f4[_0xd10e('0x3f')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3f38f4['uniqueid'],_0x3f38f4[_0xd10e('0x3f')],_0x3f38f4[_0xd10e('0x31')]);return RpcUser[_0xd10e('0x29')](this['agents'][_0x3f38f4[_0xd10e('0x3f')]],_0xd10e('0x55'),_0x3f38f4[_0xd10e('0x30')]);}}}catch(_0x28de45){logger[_0xd10e('0x37')](_0xd10e('0x56'),_0x28de45[_0xd10e('0x3a')]);}};module[_0xd10e('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 77974b3..add60db 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 _0x21e0=['promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','actionQueueSummary','catch','bluebird','util','../../config/environment','port','asterisk','password','keepConnected','Action'];(function(_0x100751,_0x47161d){var _0x94d50a=function(_0x150e5f){while(--_0x150e5f){_0x100751['push'](_0x100751['shift']());}};_0x94d50a(++_0x47161d);}(_0x21e0,0x18f));var _0x021e=function(_0x191df7,_0x1dcd07){_0x191df7=_0x191df7-0x0;var _0x2e18f1=_0x21e0[_0x191df7];return _0x2e18f1;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x021e('0x0'));var util=require(_0x021e('0x1'));var logger=require('../../config/logger')('ami');var config=require(_0x021e('0x2'));var ami=new Manager(config['asterisk'][_0x021e('0x3')],config[_0x021e('0x4')]['ip'],config[_0x021e('0x4')]['username'],config['asterisk'][_0x021e('0x5')],!![]);ami[_0x021e('0x6')]();ami[_0x021e('0x7')]=BPromise[_0x021e('0x8')](ami[_0x021e('0x9')]);function error(_0x50a4da){logger['error'](util[_0x021e('0xa')](_0x021e('0xb'),config['asterisk'][_0x021e('0xc')],config['asterisk']['ip'],config['asterisk']['port'],util['inspect'](_0x50a4da,![],null)));}function close(){logger[_0x021e('0xd')](util[_0x021e('0xa')](_0x021e('0xe'),config[_0x021e('0x4')][_0x021e('0xc')],config[_0x021e('0x4')]['ip'],config[_0x021e('0x4')]['port']));}ami[_0x021e('0xf')]=function(){return function(){return ami[_0x021e('0x7')]({'action':_0x021e('0x10')});};};ami[_0x021e('0x11')]=function(){return function(){return ami[_0x021e('0x7')]({'action':_0x021e('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x021e('0x7')]({'action':_0x021e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x021e('0x14')});};};ami[_0x021e('0x15')]=function(){return function(){return ami[_0x021e('0x7')]({'action':_0x021e('0x16')});};};function connect(){logger['info'](util[_0x021e('0xa')](_0x021e('0x17'),config[_0x021e('0x4')][_0x021e('0xc')],config['asterisk']['ip'],config[_0x021e('0x4')][_0x021e('0x3')]));ami[_0x021e('0x18')](_0x021e('0xd'),error);ami[_0x021e('0x18')](_0x021e('0x19'),close);}ami['on'](_0x021e('0x1a'),connect);ami['on'](_0x021e('0x1b'),function(_0x2d1b75){logger[_0x021e('0x1c')](util[_0x021e('0xa')](_0x021e('0x1d'),config['asterisk']['username'],config[_0x021e('0x4')]['ip'],config['asterisk'][_0x021e('0x3')],util[_0x021e('0x1e')](_0x2d1b75,![],null)));});ami['on']('fullybooted',function(){logger[_0x021e('0x1c')](util[_0x021e('0xa')](_0x021e('0x1f'),config[_0x021e('0x4')][_0x021e('0xc')],config[_0x021e('0x4')]['ip'],config[_0x021e('0x4')][_0x021e('0x3')]));return Promise[_0x021e('0x20')]()[_0x021e('0x21')](ami['actionSipShowRegistry']())['then'](ami[_0x021e('0x11')]())[_0x021e('0x21')](ami[_0x021e('0x22')]())[_0x021e('0x21')](ami[_0x021e('0x23')]())[_0x021e('0x21')](ami['actionCoreShowChannels']())[_0x021e('0x24')](function(_0x156a04){logger[_0x021e('0xd')]('[ami.js][fullybooted]',util[_0x021e('0x1e')](_0x156a04,{'showHidden':![],'depth':null}));});});ami[_0x021e('0x18')](_0x021e('0xd'),error);ami['once'](_0x021e('0x19'),close);module['exports']=ami; \ No newline at end of file +var _0xb0f2=['asterisk-manager','util','../../config/logger','../../config/environment','asterisk','port','username','password','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','actionSipShowRegistry','then','catch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb0f2,0x1ea));var _0x2b0f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb0f2[_0x321bb2];return _0x9c12ed;};'use strict';var Manager=require(_0x2b0f('0x0'));var BPromise=require('bluebird');var util=require(_0x2b0f('0x1'));var logger=require(_0x2b0f('0x2'))('ami');var config=require(_0x2b0f('0x3'));var ami=new Manager(config[_0x2b0f('0x4')][_0x2b0f('0x5')],config[_0x2b0f('0x4')]['ip'],config['asterisk'][_0x2b0f('0x6')],config[_0x2b0f('0x4')][_0x2b0f('0x7')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x2b0f('0x8')](ami[_0x2b0f('0x9')]);function error(_0x5237b0){logger['error'](util[_0x2b0f('0xa')](_0x2b0f('0xb'),config[_0x2b0f('0x4')][_0x2b0f('0x6')],config['asterisk']['ip'],config[_0x2b0f('0x4')]['port'],util['inspect'](_0x5237b0,![],null)));}function close(){logger[_0x2b0f('0xc')](util[_0x2b0f('0xa')](_0x2b0f('0xd'),config['asterisk'][_0x2b0f('0x6')],config[_0x2b0f('0x4')]['ip'],config[_0x2b0f('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x2b0f('0xe')});};};ami[_0x2b0f('0xf')]=function(){return function(){return ami[_0x2b0f('0x10')]({'action':_0x2b0f('0x11')});};};ami[_0x2b0f('0x12')]=function(){return function(){return ami[_0x2b0f('0x10')]({'action':_0x2b0f('0x13')});};};ami[_0x2b0f('0x14')]=function(){return function(){return ami['Action']({'action':_0x2b0f('0x15')});};};ami[_0x2b0f('0x16')]=function(){return function(){return ami[_0x2b0f('0x10')]({'action':'coreshowchannels'});};};function connect(){logger['info'](util[_0x2b0f('0xa')](_0x2b0f('0x17'),config[_0x2b0f('0x4')][_0x2b0f('0x6')],config[_0x2b0f('0x4')]['ip'],config[_0x2b0f('0x4')][_0x2b0f('0x5')]));ami[_0x2b0f('0x18')](_0x2b0f('0xc'),error);ami['once'](_0x2b0f('0x19'),close);}ami['on'](_0x2b0f('0x1a'),connect);ami['on']('shutdown',function(_0x35ef16){logger[_0x2b0f('0x1b')](util[_0x2b0f('0xa')](_0x2b0f('0x1c'),config[_0x2b0f('0x4')][_0x2b0f('0x6')],config[_0x2b0f('0x4')]['ip'],config[_0x2b0f('0x4')][_0x2b0f('0x5')],util[_0x2b0f('0x1d')](_0x35ef16,![],null)));});ami['on'](_0x2b0f('0x1e'),function(){logger[_0x2b0f('0x1b')](util[_0x2b0f('0xa')](_0x2b0f('0x1f'),config[_0x2b0f('0x4')]['username'],config[_0x2b0f('0x4')]['ip'],config['asterisk'][_0x2b0f('0x5')]));return Promise['resolve']()['then'](ami[_0x2b0f('0x20')]())[_0x2b0f('0x21')](ami[_0x2b0f('0xf')]())['then'](ami[_0x2b0f('0x12')]())[_0x2b0f('0x21')](ami['actionQueueSummary']())['then'](ami[_0x2b0f('0x16')]())[_0x2b0f('0x22')](function(_0x3edd9c){logger[_0x2b0f('0xc')]('[ami.js][fullybooted]',util[_0x2b0f('0x1d')](_0x3edd9c,{'showHidden':![],'depth':null}));});});ami[_0x2b0f('0x18')](_0x2b0f('0xc'),error);ami[_0x2b0f('0x18')](_0x2b0f('0x19'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index edc5a10..79d337f 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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x1f311c,_0x590db5){var _0x247f0e=function(_0x570698){while(--_0x570698){_0x1f311c['push'](_0x1f311c['shift']());}};_0x247f0e(++_0x590db5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5a037a,_0x44a3fc){_0x5a037a=_0x5a037a-0x0;var _0x28ff57=_0xbdb7[_0x5a037a];return _0x28ff57;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xcb91[_0x1afabf];return _0x497ff1;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f5feee0..50c3719 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 _0xd0a2=['reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangAbandonmentRate','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalTotalCalls','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','reachable','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','interval\x20=\x20','erlangb','exports','lodash','uuid','moment','ioredis','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/agentComplete','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','getSeconds','debug','startProgressive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','queueStatusComplete','Interval','CAMPAIGN_STATUS','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','Error','prototype','active','format','SIP/%s','status','unmonitored','isTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','isArray','Action','command','interval','content','indexOf','true','catch','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','reason','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actions','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','push','pick','idHopper','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','outboundAnswerAgiCallsDay','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','outboundAnswerCallsDay','Machine','countmachineretry','emit','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','value','HANGUP','HangupInAMD','custom:amd','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','moveContactManagedDialer','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','Unknow','running','INACTIVE','statusMessage','available','inUse','talking','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','throttle','dialPreviewRecallmeReminder','filter','online','length','Agent','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','merge','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','%s%s','XMD-','toUpper','Trunk','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','countbusyretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xd0a2,0x71));var _0x2d0a=function(_0x44784c,_0x4498c1){_0x44784c=_0x44784c-0x0;var _0x4bbfb1=_0xd0a2[_0x44784c];return _0x4bbfb1;};'use strict';var util=require('util');var _=require(_0x2d0a('0x0'));var uuid=require(_0x2d0a('0x1'));var moment=require(_0x2d0a('0x2'));var rr=require('rr');var Redis=require(_0x2d0a('0x3'));var utils=require('./utils');var hopperUtils=require(_0x2d0a('0x4'));var ut=require('../preview/util/util');var config=require(_0x2d0a('0x5'));var logger=require(_0x2d0a('0x6'))(_0x2d0a('0x7'));var loggerBooked=require('../../../config/logger')(_0x2d0a('0x8'));var loggerPredictive=require(_0x2d0a('0x6'))(_0x2d0a('0x9'));var loggerPredictiveCalls=require(_0x2d0a('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x2d0a('0x6'))(_0x2d0a('0xa'));var ami=require(_0x2d0a('0xb'));config[_0x2d0a('0xc')]=_[_0x2d0a('0xd')](config['redis'],{'host':_0x2d0a('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d0a('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x2d0a('0xf'));var Interval=require(_0x2d0a('0x10'));var Action=require(_0x2d0a('0x11'));var History=require(_0x2d0a('0x12'));var Final=require('./models/final');var AgentComplete=require(_0x2d0a('0x13'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0x2d0a('0x14');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x2d0a('0x15')]=function(_0x4ef31a){this[_0x2d0a('0x16')]=this[_0x2d0a('0x16')]?this[_0x2d0a('0x16')][_0x2d0a('0x17')](_0x4ef31a):_0x4ef31a();};function Dialer(_0x353585,_0x3fa097){this[_0x2d0a('0x18')]=new Sequence();this[_0x2d0a('0x19')]=_0x3fa097;this[_0x2d0a('0x1a')]=_0x353585[_0x2d0a('0x1a')];this[_0x2d0a('0x1b')]=_0x353585[_0x2d0a('0x1b')];this[_0x2d0a('0x1c')]=_0x353585[_0x2d0a('0x1c')];this[_0x2d0a('0x1d')]=_0x353585[_0x2d0a('0x1d')];this[_0x2d0a('0x1e')]=config[_0x2d0a('0x1e')]||0x2;this[_0x2d0a('0x1f')]={};this['actions']={};this['contactsId']={};this[_0x2d0a('0x20')]={};this[_0x2d0a('0x21')]={};this[_0x2d0a('0x22')]={};this[_0x2d0a('0x23')]={};this[_0x2d0a('0x24')]={};this[_0x2d0a('0x25')]={};this['queueBookedRR']={};this[_0x2d0a('0x26')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x28'),this[_0x2d0a('0x29')][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x2a'),this[_0x2d0a('0x2b')]['bind'](this));ami['on'](_0x2d0a('0x2c'),this[_0x2d0a('0x2d')]['bind'](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x2e'),this[_0x2d0a('0x2f')][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x30'),this[_0x2d0a('0x31')][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x32'),this[_0x2d0a('0x33')]['bind'](this));ami['on']('varset',this[_0x2d0a('0x34')][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x35'),this[_0x2d0a('0x36')][_0x2d0a('0x27')](this));ami['on'](_0x2d0a('0x37'),this['syncQueueStatusComplete'][_0x2d0a('0x27')](this));this[_0x2d0a('0x38')]();this[_0x2d0a('0x39')]();RpcSetting[_0x2d0a('0x3a')]()[_0x2d0a('0x3b')](function(_0x1d56c5){previewRecallmeReminderInterval=_0x1d56c5['previewRecallmeReminderInterval'];});}function isNotNull(_0x35fc3a){return _0x35fc3a!==null&&!_[_0x2d0a('0x3c')](_0x35fc3a);}function msgResponse(_0x143084,_0x271ac2,_0x4cd278){return{'action':_0x143084,'response':_0x271ac2,'message':_0x4cd278,'stack':_0x4cd278};}function emit(_0x3b6baa,_0x3a77e7,_0x55e288){io['to'](_0x3b6baa)['emit'](_0x3a77e7,_0x55e288);}function emitOutboundVoiceQueueSummary(_0x9393d6){if(_0x9393d6[_0x2d0a('0x3d')]===_0x2d0a('0x3e')){logger['debug'](_0x2d0a('0x3f'),util[_0x2d0a('0x40')](_0x9393d6,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x9393d6[_0x2d0a('0x41')]),_0x2d0a('0x42'),_0x9393d6);}}function checkGetDataPredictive(_0x4a60f4){if(isNotNull(_0x4a60f4)&&!_[_0x2d0a('0x43')](_0x4a60f4)){loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x45'));loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x46'),_0x4a60f4['predictiveIntervalTotalCalls']);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x47'),_0x4a60f4['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x2d0a('0x48'),_0x4a60f4[_0x2d0a('0x49')]);loggerPredictive[_0x2d0a('0x44')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a60f4[_0x2d0a('0x4a')]);loggerPredictive[_0x2d0a('0x44')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a60f4[_0x2d0a('0x4b')]);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x4c'),_0x4a60f4[_0x2d0a('0x4d')]);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x4e'));if(_0x4a60f4['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x4a60f4[_0x2d0a('0x4d')])&&_0x4a60f4[_0x2d0a('0x4d')]>0x0){return!![];}loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x4f'));if(!_[_0x2d0a('0x3c')](_0x4a60f4[_0x2d0a('0x4b')])&&_0x4a60f4[_0x2d0a('0x4b')]>0x0){return!![];}loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x50'));}else{loggerPredictive[_0x2d0a('0x44')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x2d0a('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x18637c){return function(_0x5cf240){loggerPredictive['info'](_0x2d0a('0x51'));loggerPredictive[_0x2d0a('0x44')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5cf240[_0x2d0a('0x52')]);loggerPredictive['info'](_0x2d0a('0x53'),_0x5cf240[_0x2d0a('0x54')]);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x55'),_0x5cf240['erlangAbandonmentRate']);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x56'),_0x5cf240['erlangBusyFactor']);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x55'),_0x5cf240['erlangAbandonmentRate']);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x4e'));_['merge'](_0x18637c,_0x5cf240);};}function ifInterval(_0x1b73d8,_0x282ed8){if(_['isUndefined'](_0x282ed8)){return![];}return utils[_0x2d0a('0x57')](undefined,_0x282ed8)<_0x1b73d8*0x3c;}function clearPredictiveAttributes(_0x2d9583){if(_0x2d9583[_0x2d0a('0x23')]){_0x2d9583[_0x2d0a('0x23')]=undefined;loggerPredictive[_0x2d0a('0x58')](_0x2d9583[_0x2d0a('0x41')],_0x2d0a('0x59'));}if(_0x2d9583['startPredictive']){_0x2d9583[_0x2d0a('0x22')]=undefined;loggerPredictive[_0x2d0a('0x58')](_0x2d9583[_0x2d0a('0x41')],'startPredictive\x20value\x20cleared');}if(_0x2d9583[_0x2d0a('0x5a')]){clearInterval(_0x2d9583[_0x2d0a('0x5a')]);_0x2d9583[_0x2d0a('0x5a')]=undefined;loggerPredictive[_0x2d0a('0x58')](_0x2d9583[_0x2d0a('0x41')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x464f0c,_0xe40e3e){return function(_0x1cd3b0){loggerPredictive[_0x2d0a('0x5b')](_0xe40e3e[_0x2d0a('0x41')],_0x464f0c);loggerPredictive[_0x2d0a('0x5b')](_0x1cd3b0[_0x2d0a('0x5c')]);clearPredictiveAttributes(_0xe40e3e);};}function loggerCatch(_0x1ce09d){return function(_0x5b4521){logger[_0x2d0a('0x5b')](_0x1ce09d,util[_0x2d0a('0x40')](_0x5b4521,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x30807c,_0x58c436,_0x2e7779){return function(_0x552d22){utils[_0x2d0a('0x5d')](_0x58c436,_0x2e7779,0x0);logger[_0x2d0a('0x5b')](_0x30807c,util[_0x2d0a('0x40')](_0x552d22,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5023c5){return function(_0x41bdc5){if(isNotNull(_0x41bdc5)&&isNotNull(_0x41bdc5[0x0])){if(_0x41bdc5[0x0][_0x2d0a('0x5e')]>0x0){_0x5023c5[_0x2d0a('0x5f')]=utils['CAMPAIGN_STATUS'][_0x2d0a('0x60')];logger['info'](_0x2d0a('0x61')+_0x5023c5[_0x2d0a('0x41')],_0x41bdc5[0x0][_0x2d0a('0x5e')],_0x2d0a('0x62'));}else{_0x5023c5[_0x2d0a('0x5f')]=utils['CAMPAIGN_STATUS'][_0x2d0a('0x63')];logger[_0x2d0a('0x44')]('[getContactDialer2][Empty]'+_0x5023c5[_0x2d0a('0x41')]);}}};}function createObjHistory(_0x358bfc,_0x28f4df,_0x24d9b0,_0x5a2da5,_0x462db6){_0x358bfc[_0x2d0a('0x5f')]=_0x24d9b0;var _0x7d946e=new Action(_0x358bfc,_0x28f4df);var _0x241176=new History(_0x7d946e);_0x241176[_0x2d0a('0x64')]=_0x5a2da5;_0x241176[_0x2d0a('0x65')]=_0x462db6;_0x241176[_0x2d0a('0x66')]=_0x7d946e[_0x2d0a('0x67')];return _0x241176;}function unlockQueueStatus(_0x5cfcb2,_0x5dd4d2){setTimeout(function(){if(_[_0x2d0a('0x3c')](_0x5cfcb2['queueStatusComplete'])){loggerBooked['error'](_0x2d0a('0x68'),_0x5dd4d2);}_0x5cfcb2['queueStatusComplete']=!![];loggerBooked['info'](_0x2d0a('0x69'),_0x5dd4d2,JSON[_0x2d0a('0x6a')](_['pick'](_0x5cfcb2,[_0x2d0a('0x41'),_0x2d0a('0x6b')])));},0x1f3);}function checkInterval(_0x56e27e){return function(){if(!isNotNull(_0x56e27e[_0x2d0a('0x6c')])){_0x56e27e[_0x2d0a('0x5f')]=utils[_0x2d0a('0x6d')][_0x2d0a('0x6e')];throw _0x56e27e['name']+_0x2d0a('0x6f');}if(!isNotNull(_0x56e27e[_0x2d0a('0x6c')][_0x2d0a('0x70')])){_0x56e27e[_0x2d0a('0x5f')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x56e27e[_0x2d0a('0x41')]+_0x2d0a('0x6f');}if(!isNotNull(_['isEmpty'](_0x56e27e[_0x2d0a('0x6c')]['Intervals']))){_0x56e27e[_0x2d0a('0x5f')]=utils[_0x2d0a('0x6d')][_0x2d0a('0x6e')];throw _0x56e27e[_0x2d0a('0x41')]+_0x2d0a('0x6f');}};}function checkIsIVRCampaignActive(_0x244450){return function(){if(!utils[_0x2d0a('0x71')](_0x244450)){_0x244450['message']=utils[_0x2d0a('0x6d')]['INACTIVE'];throw _0x244450[_0x2d0a('0x41')]+_0x2d0a('0x72');}};}function emitCampaignSummary(_0x50b831){if(utils[_0x2d0a('0x73')](_0x50b831)){emit(util['format'](_0x2d0a('0x74'),_0x50b831[_0x2d0a('0x41')]),_0x2d0a('0x75'),_0x50b831);}}function loggerCatchQueueSummary(_0x5685f7,_0x5b8093){return function(_0x3ac44c){clearPredictiveAttributes(_0x5b8093);emitCampaignSummary(_0x5b8093);loggerSyncQueueSummary[_0x2d0a('0x58')](_0x5685f7,util[_0x2d0a('0x40')](_0x3ac44c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xd5f1f3){if(_0xd5f1f3[_0x2d0a('0x76')]){if(_0xd5f1f3['originated']===0x0){_0xd5f1f3[_0x2d0a('0x76')]=![];_0xd5f1f3[_0x2d0a('0x5f')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x2d0a('0x58')](_0x2d0a('0x77'),_0xd5f1f3[_0x2d0a('0x41')],_0x2d0a('0x78'));}else{_0xd5f1f3[_0x2d0a('0x5f')]=utils[_0x2d0a('0x6d')][_0x2d0a('0x79')];loggerSyncQueueSummary[_0x2d0a('0x58')](_0x2d0a('0x77'),_0xd5f1f3['name'],'is\x20disactive');}emitCampaignSummary(_0xd5f1f3);}}function myreject(_0x2ed766){return function(_0x45a53e){return _0x2ed766(msgResponse('[ifTime][Action]',_0x2d0a('0x7a'),JSON[_0x2d0a('0x6a')](_0x45a53e)));};}Dialer[_0x2d0a('0x7b')]['isTrunkReachable']=function(_0x5a255f){return!_[_0x2d0a('0x3c')](_0x5a255f)&&_0x5a255f&&!_[_0x2d0a('0x3c')](_0x5a255f[_0x2d0a('0x41')])&&!_[_0x2d0a('0x3c')](_0x5a255f[_0x2d0a('0x7c')])&&_0x5a255f[_0x2d0a('0x7c')]&&(this[_0x2d0a('0x1d')][util[_0x2d0a('0x7d')](_0x2d0a('0x7e'),_0x5a255f['name'])][_0x2d0a('0x7f')]==='reachable'||this[_0x2d0a('0x1d')][util[_0x2d0a('0x7d')](_0x2d0a('0x7e'),_0x5a255f['name'])][_0x2d0a('0x7f')]===_0x2d0a('0x80'));};Dialer[_0x2d0a('0x7b')]['checkIsTrunkReachable']=function(_0x438a69){var _0x4801e7=this;return function(){if(!_0x4801e7[_0x2d0a('0x81')](_0x438a69['Trunk'])){if(!_0x4801e7[_0x2d0a('0x81')](_0x438a69[_0x2d0a('0x82')])){_0x438a69[_0x2d0a('0x5f')]=utils[_0x2d0a('0x6d')][_0x2d0a('0x83')];throw _0x438a69[_0x2d0a('0x41')]+_0x2d0a('0x84');}}};};Dialer['prototype'][_0x2d0a('0x85')]=function(_0x17bebd,_0x98511c,_0x3773e8,_0x2d260e){var _0x1ed354=this;return function(){var _0x4778a=!![];return _0x1ed354[_0x2d0a('0x86')](_0x17bebd,_0x98511c,_0x3773e8,_0x2d260e,_0x4778a);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x244204,_0x1cca65,_0x52789c,_0xef7888){var _0x2249f1=this;return function(){var _0x26a95e=![];return _0x2249f1[_0x2d0a('0x86')](_0x244204[_0x2d0a('0x70')],_0x1cca65,_0x52789c,_0xef7888,_0x26a95e);};};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x86')]=function(_0x469bad,_0xf3e143,_0x1d4137,_0x49435e,_0xbf8e5c){var _0x4b523b=[];return new Promise(function(_0x42855a,_0x913e14){if(!isNotNull(_0x469bad)){_0x49435e[_0x2d0a('0x5f')]=utils['CAMPAIGN_STATUS'][_0x2d0a('0x6e')];return _0x913e14(msgResponse(_0x2d0a('0x87'),_0x2d0a('0x88'),_0x1d4137+_0x2d0a('0x89')));}if(_[_0x2d0a('0x43')](_0x469bad)){_0x49435e[_0x2d0a('0x5f')]=utils['CAMPAIGN_STATUS'][_0x2d0a('0x8a')];return _0x913e14(msgResponse('ifTime',_0x2d0a('0x88'),_0x1d4137+_0x2d0a('0x8b')));}if(_0xf3e143&&_[_0x2d0a('0x3c')](config['timezones'][_0xf3e143])){_0x49435e['message']=utils['CAMPAIGN_STATUS'][_0x2d0a('0x8c')];return _0x913e14(msgResponse(_0x2d0a('0x87'),_0x2d0a('0x88'),_0x1d4137+'\x20Timezone\x20unknow\x20'+_0xf3e143));}if(_[_0x2d0a('0x8d')](_0x469bad)){for(var _0x445feb=0x0;_0x445feb<_0x469bad['length'];_0x445feb+=0x1){_0x4b523b['push'](ami[_0x2d0a('0x8e')]({'action':_0x2d0a('0x8f'),'command':util['format']('iftime\x20%s,%s',_0x469bad[_0x445feb][_0x2d0a('0x90')],!_[_0x2d0a('0x3c')](config['timezones'][_0xf3e143])?_0xf3e143:'')})[_0x2d0a('0x3b')](function(_0x2e636a){return _0x2e636a[_0x2d0a('0x91')][_0x2d0a('0x92')](_0x2d0a('0x93'))>=0x0;})[_0x2d0a('0x94')](myreject(_0x913e14)));}}else{_0x4b523b['push'](ami[_0x2d0a('0x8e')]({'action':_0x2d0a('0x8f'),'command':util[_0x2d0a('0x7d')](_0x2d0a('0x95'),_0x469bad,!_['isUndefined'](config['timezones'][_0xf3e143])?_0xf3e143:'')})[_0x2d0a('0x3b')](function(_0x12dd14){return _0x12dd14[_0x2d0a('0x91')][_0x2d0a('0x92')](_0x2d0a('0x93'))>=0x0;})[_0x2d0a('0x94')](myreject(_0x913e14)));}Promise[_0x2d0a('0x96')](_0x4b523b)[_0x2d0a('0x3b')](function(_0x4d8efe){var _0x1f4730=_[_0x2d0a('0x97')](_0x4d8efe);if(_0x1f4730){return _0x42855a(_0x1f4730);}else{_0x49435e['message']=_0xbf8e5c?utils[_0x2d0a('0x6d')][_0x2d0a('0x98')]:utils[_0x2d0a('0x6d')][_0x2d0a('0x99')];return _0x913e14(msgResponse(_0x2d0a('0x9a'),'Failure',_0x2d0a('0x9b')+_0xbf8e5c+'\x20'+_0x1d4137+_0x2d0a('0x9c')+util[_0x2d0a('0x40')](_0x469bad,{'showHidden':![],'depth':null})+_0x2d0a('0x9d')+_0xf3e143));}})[_0x2d0a('0x94')](function(_0x1057e2){return _0x913e14(msgResponse('ifTime',_0x2d0a('0x88'),JSON[_0x2d0a('0x6a')](_0x1057e2)));});});};Dialer[_0x2d0a('0x7b')]['loopCampaigns']=function(){var _0x4b0ea4=this;return cmHopper[_0x2d0a('0x9e')]({'active':![]},{'where':{'active':!![]}})[_0x2d0a('0x3b')](function(){setInterval(function(){_0x4b0ea4[_0x2d0a('0x9f')]();},0x3e8);});};Dialer[_0x2d0a('0x7b')]['syncCampaigns']=function(){var _0x345a20=this;var _0x28835e;for(var _0x49ecad in this[_0x2d0a('0x1b')]){if(typeof this[_0x2d0a('0x1b')][_0x49ecad]!=='undefined'){_0x28835e=this[_0x2d0a('0x1b')][_0x49ecad];if(utils[_0x2d0a('0x73')](_0x28835e)&&utils['isIVRCampaignActive'](_0x28835e)){_0x28835e[_0x2d0a('0x76')]=!![];Promise[_0x2d0a('0xa0')]()[_0x2d0a('0x3b')](checkIsIVRCampaignActive(_0x28835e))[_0x2d0a('0x3b')](checkInterval(_0x28835e))[_0x2d0a('0x3b')](_0x345a20[_0x2d0a('0xa1')](_0x28835e))[_0x2d0a('0x3b')](_0x345a20[_0x2d0a('0x85')](_0x28835e[_0x2d0a('0xa2')],_0x28835e[_0x2d0a('0xa3')],_0x28835e[_0x2d0a('0x41')],_0x28835e))['then'](_0x345a20[_0x2d0a('0xa4')](_0x28835e['Interval'],_0x28835e[_0x2d0a('0xa3')],_0x28835e['name'],_0x28835e))[_0x2d0a('0x3b')](_0x345a20[_0x2d0a('0xa5')](_0x28835e))[_0x2d0a('0x94')](loggerCatchQueueSummary(_0x2d0a('0xa6'),_0x28835e));}else{notSendMessagesCampaign(_0x28835e);}}}};Dialer[_0x2d0a('0x7b')]['checkDialMethod']=function(_0x840933){if(_0x840933[_0x2d0a('0xa7')]!=='predictive'){clearPredictiveAttributes(_0x840933);}switch(_0x840933[_0x2d0a('0xa7')]){case _0x2d0a('0xa8'):this[_0x2d0a('0xa9')](_0x840933,0x1);break;case'power':this[_0x2d0a('0xa9')](_0x840933,_0x840933[_0x2d0a('0xaa')]);break;case _0x2d0a('0x9'):this[_0x2d0a('0x9')](_0x840933);break;case _0x2d0a('0x8'):this[_0x2d0a('0xa9')](_0x840933,0x1);break;default:logger[_0x2d0a('0x5b')](_0x2d0a('0xab'),_0x840933[_0x2d0a('0x41')],_0x2d0a('0xac'));}};Dialer[_0x2d0a('0x7b')]['ifTime']=function(_0xd2b4a1,_0x11b9b3){var _0x255e3e=_0xd2b4a1[_0x2d0a('0xa3')];var _0x26ba22=_0x11b9b3?_0xd2b4a1[_0x2d0a('0xa2')]:_0xd2b4a1[_0x2d0a('0x6c')]['Intervals'];logger[_0x2d0a('0xad')](_0x2d0a('0xae'),_0x26ba22,_0x255e3e,_0xd2b4a1[_0x2d0a('0x41')],util[_0x2d0a('0x7d')](_0x2d0a('0xaf'),_0xd2b4a1[_0x2d0a('0x41')],_0xd2b4a1['id']));var _0x40a82e=null;return Interval[_0x2d0a('0xb0')](_0x26ba22,_0x255e3e)[_0x2d0a('0x3b')](function(_0x43cb9e){if(_0x43cb9e===!![]){return _0x43cb9e;}else{_0xd2b4a1['message']=_0x11b9b3?utils[_0x2d0a('0x6d')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x2d0a('0x99')];_0x40a82e=msgResponse(_0x2d0a('0x9a'),_0x2d0a('0x88'),_0x2d0a('0x9b')+_0x11b9b3+'\x20'+_0xd2b4a1[_0x2d0a('0x41')]+_0x2d0a('0x9c')+util['inspect'](_0x26ba22,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x255e3e);}if(_0x40a82e!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x40a82e);_0x40a82e[_0x2d0a('0xb1')]=_0x11b9b3;throw _0x40a82e;}})[_0x2d0a('0x94')](function(_0x4ee896){logger[_0x2d0a('0x5b')](_0x2d0a('0xb2'),_0x4ee896);throw msgResponse(_0x2d0a('0xb3'),_0x2d0a('0x7a'),util[_0x2d0a('0x40')](_0x4ee896,{'showHidden':![],'depth':null}));});};Dialer['prototype']['syncAgentConnect']=function(_0x206c51){if(this['voiceQueues'][_0x206c51[_0x2d0a('0xb4')]]){if(this[_0x2d0a('0x20')][_0x206c51[_0x2d0a('0xb5')]]&&this[_0x2d0a('0x20')][_0x206c51[_0x2d0a('0xb5')]]['type']!==_0x2d0a('0xb6')){this[_0x2d0a('0xb7')](this['voiceQueues'][_0x206c51[_0x2d0a('0xb4')]]);this[_0x2d0a('0x20')][_0x206c51[_0x2d0a('0xb5')]]['answertime']=moment()[_0x2d0a('0x7d')](_0x2d0a('0xb8'));}}};Dialer['prototype'][_0x2d0a('0x2d')]=function(_0x4da034){var _0xf1216f=this[_0x2d0a('0x20')][_0x4da034[_0x2d0a('0xb5')]];if(this[_0x2d0a('0x1a')][_0x4da034[_0x2d0a('0xb4')]]){if(_0xf1216f&&_0xf1216f['type']!==_0x2d0a('0xb6')){delete this[_0x2d0a('0x20')][_0x4da034[_0x2d0a('0xb5')]];this[_0x2d0a('0x1a')][_0x4da034[_0x2d0a('0xb4')]]['outboundAnswerCallsDay']+=0x1;var _0x367203=new AgentComplete(_0xf1216f,_0x4da034);if(_0x4da034[_0x2d0a('0xb9')]==='agent'){_0x367203[_0x2d0a('0xba')]=this[_0x2d0a('0x1a')][_0x4da034['queue']]['dialQueueProject2']&&this['voiceQueues'][_0x4da034[_0x2d0a('0xb4')]][_0x2d0a('0xbb')]?moment()['format'](_0x2d0a('0xb8')):undefined;}hopperUtils[_0x2d0a('0xbc')](_0x367203)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0xbd')));hopperUtils['moveContactManagedDialer'](_0x367203)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0xbe')));}}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x29')]=function(_0x242ade){var _0x51732c=this[_0x2d0a('0x20')][_0x242ade[_0x2d0a('0xb5')]];var _0x29b40c=this;var _0xd59299=![];var _0x254ab8;var _0x57cb31;if(this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]]){if(_0x51732c&&_0x51732c['type']!==_0x2d0a('0xb6')){delete this['uniqueId'][_0x242ade[_0x2d0a('0xb5')]];this['updateOriginated'](this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]]);_0x51732c[_0x2d0a('0xbf')]=moment()['format'](_0x2d0a('0xb8'));var _0x4256a6=new QueueCallerAbandon(_0x51732c,_0x242ade);if(utils['getSeconds'](_0x51732c['droptime'],_0x51732c[_0x2d0a('0xc0')])>=_0x51732c[_0x2d0a('0xc1')]){this['voiceQueues'][_0x242ade['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0xc2')]+=0x1;this[_0x2d0a('0x1a')][_0x242ade['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4256a6[_0x2d0a('0x64')]=0xa;_0x4256a6[_0x2d0a('0x65')]='Drop';_0x4256a6[_0x2d0a('0xc3')]='TIMEOUT';_0x4256a6[_0x2d0a('0xba')]=this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]]['dialQueueProject2']?moment()[_0x2d0a('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4256a6[_0x2d0a('0xc4')]+=0x1;_0x4256a6[_0x2d0a('0xc5')]+=0x1;_0x254ab8=this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0xc6')];_0x57cb31=this['voiceQueues'][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0xc7')];hopperUtils[_0x2d0a('0xc8')](_0x4256a6,_0x4256a6[_0x2d0a('0x64')],_0x51732c['voiceQueue'])[_0x2d0a('0x3b')](function(_0x1c11ff){_0xd59299=_0x1c11ff['additional']==0x1;if(_0x4256a6[_0x2d0a('0xc4')]>=_0x29b40c[_0x2d0a('0x1a')][_0x242ade['queue']][_0x2d0a('0xc9')]){_0x29b40c[_0x2d0a('0xca')](_0x4256a6,_0x1c11ff[_0x2d0a('0xcb')]);}else{hopperUtils[_0x2d0a('0xcc')]({'active':![],'countdropretry':_0x4256a6[_0x2d0a('0xc4')],'scheduledat':moment()[_0x2d0a('0xcd')](_0x29b40c[_0x2d0a('0x1a')][_0x242ade['queue']][_0x2d0a('0xc6')],_0x2d0a('0xce'))[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x51732c[_0x2d0a('0xcf')],'ListId':_0x51732c[_0x2d0a('0xd0')],'VoiceQueueId':_0x51732c[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x51732c[_0x2d0a('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x425c43=new History(_0x4256a6);_0x425c43[_0x2d0a('0x64')]=0xa;_0x425c43[_0x2d0a('0x65')]=_0x2d0a('0xd3');_0x425c43[_0x2d0a('0x67')]=moment()[_0x2d0a('0x7d')](_0x2d0a('0xb8'));_0x425c43[_0x2d0a('0x66')]=_0x425c43[_0x2d0a('0x67')];_0x425c43[_0x2d0a('0xd4')]=_0x4256a6['calleridname'];_0x425c43[_0x2d0a('0xd5')]=_0x4256a6['calleridnum'];hopperUtils[_0x2d0a('0xbc')](_0x425c43)['catch'](loggerCatch(_0x2d0a('0xd6')));}})[_0x2d0a('0x3b')](function(){if(_0xd59299)hopperUtils['swapAdditionalPhones'](_0x4256a6,_0x254ab8,_0x57cb31)[_0x2d0a('0x3b')](function(){return 0x1;});});}else{this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0x4a')]+=0x1;this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0xd7')]+=0x1;_0x4256a6[_0x2d0a('0x64')]=0xb;_0x4256a6[_0x2d0a('0x65')]=_0x2d0a('0xd8');_0x4256a6[_0x2d0a('0xc3')]=_0x2d0a('0xd9');_0x4256a6[_0x2d0a('0xda')]+=0x1;_0x4256a6[_0x2d0a('0xc5')]+=0x1;_0x254ab8=this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0xdb')];_0x57cb31=this[_0x2d0a('0x1a')][_0x242ade[_0x2d0a('0xb4')]][_0x2d0a('0xc7')];hopperUtils[_0x2d0a('0xc8')](_0x4256a6,_0x4256a6[_0x2d0a('0x64')],_0x51732c['voiceQueue'])[_0x2d0a('0x3b')](function(_0x51e6db){if(_0x4256a6[_0x2d0a('0xda')]>=_0x29b40c[_0x2d0a('0x1a')][_0x242ade['queue']][_0x2d0a('0xdc')]){_0x29b40c[_0x2d0a('0xca')](_0x4256a6,_0x51e6db[_0x2d0a('0xcb')]);}else{hopperUtils[_0x2d0a('0xcc')]({'active':![],'countabandonedretry':_0x4256a6[_0x2d0a('0xda')],'scheduledat':moment()['add'](_0x29b40c[_0x2d0a('0x1a')][_0x242ade['queue']][_0x2d0a('0xdb')],_0x2d0a('0xce'))[_0x2d0a('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51732c[_0x2d0a('0xcf')],'ListId':_0x51732c['ListId'],'VoiceQueueId':_0x51732c[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x51732c[_0x2d0a('0xd2')]||undefined})['catch'](loggerCatch(_0x2d0a('0xdd')));var _0x289bad=new History(_0x4256a6);_0x289bad['state']=0xb;_0x289bad[_0x2d0a('0x65')]='Abandoned';_0x289bad['starttime']=moment()['format'](_0x2d0a('0xb8'));_0x289bad[_0x2d0a('0x66')]=_0x289bad[_0x2d0a('0x67')];_0x289bad['calleridname']=_0x4256a6['calleridname'];_0x289bad[_0x2d0a('0xd5')]=_0x4256a6['calleridnum'];hopperUtils[_0x2d0a('0xbc')](_0x289bad)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0xde')));}})[_0x2d0a('0x3b')](function(){if(_0xd59299)hopperUtils[_0x2d0a('0xdf')](_0x4256a6,_0x254ab8,_0x57cb31)[_0x2d0a('0x3b')](function(){return 0x1;});});}}}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x33')]=function(_0x3aff01){if(this['actions'][_0x3aff01[_0x2d0a('0xb5')]]){this['actions'][_0x3aff01[_0x2d0a('0xb5')]][_0x2d0a('0xe0')]=_0x3aff01['channel'];}if(this[_0x2d0a('0x20')][_0x3aff01[_0x2d0a('0xb5')]]){this[_0x2d0a('0x20')][_0x3aff01[_0x2d0a('0xb5')]][_0x2d0a('0xe0')]=_0x3aff01[_0x2d0a('0xe0')];}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x36')]=function(_0x3a62e9){if(!this[_0x2d0a('0xe1')][_0x3a62e9[_0x2d0a('0xe2')]]){return;}var _0x57b77b=this[_0x2d0a('0x1a')][this[_0x2d0a('0xe1')][_0x3a62e9[_0x2d0a('0xe2')]]['queue']][_0x2d0a('0xe3')]||_0x2d0a('0xe4');if(_0x57b77b===_0x2d0a('0xe5')){if(this[_0x2d0a('0xe1')][_0x3a62e9[_0x2d0a('0xe2')]]&&_[_0x2d0a('0xe6')](this['actions'][_0x3a62e9[_0x2d0a('0xe2')]][_0x2d0a('0xe7')])&&_0x3a62e9[_0x2d0a('0x7f')]==='1'&&_0x3a62e9[_0x2d0a('0xe8')]==='0'){if(this[_0x2d0a('0x1c')][_0x3a62e9[_0x2d0a('0xe9')]]){if(!this[_0x2d0a('0x1c')][_0x3a62e9[_0x2d0a('0xe9')]][_0x2d0a('0xe7')]){this[_0x2d0a('0x1c')][_0x3a62e9['stateinterface']][_0x2d0a('0xe7')]=!![];this[_0x2d0a('0xe1')][_0x3a62e9['actionid']][_0x2d0a('0xe7')]=!![];this[_0x2d0a('0xe1')][_0x3a62e9['actionid']]['stateinterface']=_0x3a62e9[_0x2d0a('0xe9')];}}}}else if(_0x57b77b===_0x2d0a('0xe4')){if(this[_0x2d0a('0xe1')][_0x3a62e9['actionid']]){if(this[_0x2d0a('0x1c')][_0x3a62e9[_0x2d0a('0xe9')]]){this['actions'][_0x3a62e9[_0x2d0a('0xe2')]][_0x2d0a('0xe9')]=_0x3a62e9[_0x2d0a('0xe9')];if(_['isNil'](this[_0x2d0a('0x25')][this[_0x2d0a('0xe1')][_0x3a62e9[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]])){this[_0x2d0a('0x25')][this[_0x2d0a('0xe1')][_0x3a62e9['actionid']][_0x2d0a('0xb4')]]=[];}this[_0x2d0a('0x25')][this['actions'][_0x3a62e9['actionid']][_0x2d0a('0xb4')]][_0x2d0a('0xea')](_['merge'](_[_0x2d0a('0xeb')](this[_0x2d0a('0xe1')][_0x3a62e9[_0x2d0a('0xe2')]],[_0x2d0a('0xec'),_0x2d0a('0xe9')]),{'status':_0x3a62e9[_0x2d0a('0x7f')],'paused':_0x3a62e9[_0x2d0a('0xe8')]}));}}}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0xed')]=function(_0x18f135){if(!this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]]){return;}var _0x59df55=this;var _0x4e95ca=this[_0x2d0a('0x1a')][this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]];var _0x29702a=_0x4e95ca[_0x2d0a('0xe3')]||_0x2d0a('0xe4');if(_0x29702a===_0x2d0a('0xe5')){if(this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]]&&this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xe9')]){this[_0x2d0a('0x19')][_0x2d0a('0xee')](this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]]['idHopper'],this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xe9')])['catch'](function(_0x16c642){logger[_0x2d0a('0x5b')](_0x2d0a('0xef'),util[_0x2d0a('0x40')](_0x16c642,{'showHidden':![],'depth':null}));})['finally'](function(){_0x59df55[_0x2d0a('0xb7')](_0x59df55['voiceQueues'][_0x59df55['actions'][_0x18f135['actionid']][_0x2d0a('0xb4')]]);_0x59df55[_0x2d0a('0x1c')][_0x59df55[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xe9')]][_0x2d0a('0xe7')]=![];delete _0x59df55[_0x2d0a('0xe1')][_0x18f135['actionid']];unlockQueueStatus(_0x4e95ca);});}else{this['updateOriginated'](this[_0x2d0a('0x1a')][this[_0x2d0a('0xe1')][_0x18f135['actionid']][_0x2d0a('0xb4')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x2d0a('0xe1')][_0x18f135['actionid']][_0x2d0a('0xcf')],'ListId':this['actions'][_0x18f135['actionid']][_0x2d0a('0xd0')],'VoiceQueueId':this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xd1')]||undefined,'CampaignId':this['actions'][_0x18f135['actionid']]['CampaignId']||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0xf0')));delete this[_0x2d0a('0xe1')][_0x18f135['actionid']];unlockQueueStatus(_0x4e95ca);}}else if(_0x29702a===_0x2d0a('0xe4')){var _0x5360b8;if(this[_0x2d0a('0xe1')][_0x18f135['actionid']]&&!_[_0x2d0a('0x43')](this[_0x2d0a('0x25')][this['actions'][_0x18f135[_0x2d0a('0xe2')]]['queue']])){if(this['queueBookedRR'][_0x59df55['actions'][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]]){this[_0x2d0a('0xf1')][_0x59df55['actions'][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]]=this[_0x2d0a('0xf1')][this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]]?this[_0x2d0a('0xf1')][this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]]:this[_0x2d0a('0x25')][this[_0x2d0a('0xe1')][_0x18f135['actionid']][_0x2d0a('0xb4')]]?this[_0x2d0a('0x25')][this['actions'][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]][_0x2d0a('0xf2')]=this[_0x2d0a('0xf1')][this[_0x2d0a('0xe1')][_0x18f135[_0x2d0a('0xe2')]][_0x2d0a('0xb4')]];for(var _0x21adaa=0x0;_0x21adaa=_0x25ede7[_0x2d0a('0x113')]){_0x294166[_0x2d0a('0x114')](_0x33f219,_0x26f719,_0x3ef79d,_0x2d0a('0x115'));}else{if(_0x33f219[_0x2d0a('0x10c')]>=_0x25ede7[_0x2d0a('0x116')]){_0x294166[_0x2d0a('0x117')](_0x33f219,_0x26f719,_0x3ef79d,_0x2d0a('0x118'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x33f219[_0x2d0a('0x10c')],'scheduledat':moment()[_0x2d0a('0xcd')](_0x25ede7[_0x2d0a('0x119')],'minutes')[_0x2d0a('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x33f219[_0x2d0a('0xcf')],'ListId':_0x33f219[_0x2d0a('0xd0')],'VoiceQueueId':_0x33f219[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x33f219[_0x2d0a('0xd2')]||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x11a')));_0x26f719({'reschedule':0x1});}}});}if(_0x2784f2['type']===_0x2d0a('0xb6')&&this['campaigns'][_0x2784f2[_0x2d0a('0xb4')]][_0x2d0a('0x103')]&&_0x3582b2[_0x2d0a('0x11b')]===_0x2d0a('0x11c')){delete this[_0x2d0a('0x20')][_0x3582b2[_0x2d0a('0xb5')]];this[_0x2d0a('0xb7')](this[_0x2d0a('0x1b')][_0x2784f2[_0x2d0a('0xb4')]]);_0x78f645=new Hangup(_0x2784f2,_0x3582b2);_0x78f645[_0x2d0a('0x64')]=0x12;_0x78f645['statedesc']=_0x2d0a('0x11d');_0x78f645[_0x2d0a('0x105')]=_0x2d0a('0x106');ami[_0x2d0a('0x10d')](_0x2d0a('0x11e'),ut[_0x2d0a('0x107')](_0x78f645,_0x2d0a('0x108')));this[_0x2d0a('0x11f')](_0x78f645,_0x2d0a('0x120'),_0x2d0a('0x121'));}if(_0x2784f2[_0x2d0a('0x3d')]===_0x2d0a('0xb6')&&this[_0x2d0a('0x1b')][_0x2784f2['queue']][_0x2d0a('0x103')]&&_0x3582b2[_0x2d0a('0x11b')]===_0x2d0a('0x122')){return new Promise(function(_0x2bbac0,_0x1d7cbe){delete _0x294166[_0x2d0a('0x20')][_0x3582b2['uniqueid']];_0x294166[_0x2d0a('0xb7')](_0x294166[_0x2d0a('0x1b')][_0x2784f2['queue']]);_0x294166['campaigns'][_0x2784f2[_0x2d0a('0xb4')]][_0x2d0a('0x10a')]+=0x1;_0x294166[_0x2d0a('0x1b')][_0x2784f2[_0x2d0a('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5f2dbf=_0x294166['campaigns'][_0x2784f2[_0x2d0a('0xb4')]];var _0xe12812=new Hangup(_0x2784f2,_0x3582b2);_0xe12812[_0x2d0a('0x64')]=0x13;_0xe12812[_0x2d0a('0x65')]='Machine';_0xe12812[_0x2d0a('0x105')]=_0x2d0a('0x106');_0xe12812[_0x2d0a('0x10c')]+=0x1;_0xe12812[_0x2d0a('0xc5')]+=0x1;_0xe12812[_0x2d0a('0x108')]=!![];ami[_0x2d0a('0x10d')]('custom:amd',ut[_0x2d0a('0x107')](_0xe12812,_0x2d0a('0x108')));hopperUtils[_0x2d0a('0xbc')](_0xe12812)['catch'](loggerCatch(_0x2d0a('0x10e')));if(_0xe12812['countbusyretry']+_0xe12812[_0x2d0a('0x10f')]+_0xe12812['countnoanswerretry']+_0xe12812[_0x2d0a('0x111')]+_0xe12812[_0x2d0a('0xc4')]+_0xe12812['countabandonedretry']+_0xe12812['countmachineretry']+_0xe12812[_0x2d0a('0x112')]>=_0x5f2dbf[_0x2d0a('0x113')]){_0x294166[_0x2d0a('0x114')](_0xe12812,_0x2bbac0,_0x1d7cbe,'reason19\x20machine....');}else{if(_0xe12812[_0x2d0a('0x10c')]>=_0x5f2dbf['dialMachineMaxRetry']){_0x294166[_0x2d0a('0x117')](_0xe12812,_0x2bbac0,_0x1d7cbe,_0x2d0a('0x118'));}else{hopperUtils[_0x2d0a('0xcc')]({'active':![],'countmachineretry':_0xe12812[_0x2d0a('0x10c')],'scheduledat':moment()[_0x2d0a('0xcd')](_0x5f2dbf[_0x2d0a('0x119')],_0x2d0a('0xce'))[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0xe12812[_0x2d0a('0xcf')],'ListId':_0xe12812['ListId'],'VoiceQueueId':_0xe12812[_0x2d0a('0xd1')]||undefined,'CampaignId':_0xe12812['CampaignId']||undefined})['catch'](loggerCatch(_0x2d0a('0x11a')));_0x2bbac0({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x2ddcd6){var _0x12b5a0=this[_0x2d0a('0x20')][_0x2ddcd6[_0x2d0a('0xb5')]];var _0x4b02b6;if(_0x12b5a0&&_0x12b5a0[_0x2d0a('0x3d')]===_0x2d0a('0xb6')){delete this[_0x2d0a('0x20')][_0x2ddcd6[_0x2d0a('0xb5')]];this[_0x2d0a('0xb7')](this[_0x2d0a('0x1b')][_0x12b5a0[_0x2d0a('0xb4')]]);this[_0x2d0a('0x1b')][_0x12b5a0[_0x2d0a('0xb4')]][_0x2d0a('0x123')]+=0x1;_0x4b02b6=new Hangup(_0x12b5a0,_0x2ddcd6);hopperUtils[_0x2d0a('0xbc')](_0x4b02b6)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x124')));hopperUtils['moveContactManagedDialer'](_0x4b02b6)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x12b5a0&&_0x12b5a0[_0x2d0a('0x3d')]!==_0x2d0a('0xb6')&&isNotNull(this[_0x2d0a('0x1a')][_0x12b5a0['queue']][_0x2d0a('0x125')])){delete this['uniqueId'][_0x2ddcd6[_0x2d0a('0xb5')]];this['updateOriginated'](this[_0x2d0a('0x1a')][_0x12b5a0['queue']]);this['voiceQueues'][_0x12b5a0[_0x2d0a('0xb4')]][_0x2d0a('0x10a')]+=0x1;this[_0x2d0a('0x1a')][_0x12b5a0[_0x2d0a('0xb4')]][_0x2d0a('0x104')]+=0x1;_0x4b02b6=new Hangup(_0x12b5a0,_0x2ddcd6);_0x4b02b6[_0x2d0a('0x64')]=0x10;_0x4b02b6['statedesc']=_0x2d0a('0x126');_0x4b02b6[_0x2d0a('0x105')]='AGI';hopperUtils['createHistory'](_0x4b02b6)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x124')));hopperUtils[_0x2d0a('0x127')](_0x4b02b6)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x128')));}if(_0x12b5a0&&_0x12b5a0[_0x2d0a('0x3d')]!=='ivr'&&!isNotNull(this[_0x2d0a('0x1a')][_0x12b5a0[_0x2d0a('0xb4')]][_0x2d0a('0x125')])){delete this[_0x2d0a('0x20')][_0x2ddcd6['uniqueid']];this[_0x2d0a('0xb7')](this[_0x2d0a('0x1a')][_0x12b5a0[_0x2d0a('0xb4')]]);this['voiceQueues'][_0x12b5a0[_0x2d0a('0xb4')]][_0x2d0a('0x129')]+=0x1;_0x4b02b6=new Hangup(_0x12b5a0,_0x2ddcd6);_0x4b02b6['state']=0xc;_0x4b02b6[_0x2d0a('0x65')]=_0x2ddcd6[_0x2d0a('0x12a')];_0x4b02b6[_0x2d0a('0x105')]=_0x2d0a('0x12b');hopperUtils['createHistory'](_0x4b02b6)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x124')));hopperUtils[_0x2d0a('0x127')](_0x4b02b6)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x128')));}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0xa')]=function(_0x7a815c){var _0x1b34ae=this;if(!_0x1b34ae[_0x2d0a('0x26')][_0x7a815c[_0x2d0a('0x41')]]){_0x1b34ae[_0x2d0a('0x26')][_0x7a815c[_0x2d0a('0x41')]]={'running':![]};}else if(_0x1b34ae[_0x2d0a('0x26')][_0x7a815c[_0x2d0a('0x41')]][_0x2d0a('0x12c')]===!![]){return;}else if(_0x1b34ae[_0x2d0a('0x26')][_0x7a815c[_0x2d0a('0x41')]]['running']===![]){_0x1b34ae['queuesSummary'][_0x7a815c['name']][_0x2d0a('0x12c')]=!![];}var _0x29aec6=_0x1b34ae[_0x2d0a('0x1a')][_0x7a815c[_0x2d0a('0x41')]];var _0x2968e3=_0x29aec6[_0x2d0a('0x5f')]!==utils[_0x2d0a('0x6d')][_0x2d0a('0x12d')];var _0x5856db=utils['isPreviewCampaign'](_0x29aec6);_0x29aec6['statusMessage']=utils['getQueueCampaignStatusMessage'](_0x29aec6,_0x1b34ae['trunks']);Promise[_0x2d0a('0xa0')]()[_0x2d0a('0x3b')](function(){if(_0x29aec6['statusMessage']===utils[_0x2d0a('0x6d')][_0x2d0a('0x12d')]){if(_0x2968e3){clearPredictiveAttributes(_0x29aec6);_0x7a815c['startPredictive']=undefined;_0x7a815c[_0x2d0a('0x23')]=undefined;}if(_0x29aec6[_0x2d0a('0x12e')]===utils['CAMPAIGN_STATUS'][_0x2d0a('0x12d')]){_0x7a815c[_0x2d0a('0x12f')]=0x0;_0x7a815c[_0x2d0a('0xe8')]=0x0;_0x7a815c[_0x2d0a('0x130')]=0x0;_0x7a815c[_0x2d0a('0x131')]=0x0;_0x7a815c[_0x2d0a('0x132')]=0x0;}}else if(_0x29aec6[_0x2d0a('0x12e')]===utils[_0x2d0a('0x6d')][_0x2d0a('0x133')]&&!_0x5856db){return _0x1b34ae[_0x2d0a('0x87')](_0x29aec6,!![])['then'](function(){return _0x1b34ae['ifTime'](_0x29aec6,![]);})['then'](function(){return _0x1b34ae[_0x2d0a('0x134')](_0x29aec6);})[_0x2d0a('0x94')](function(_0x126526){loggerSyncQueueSummary[_0x2d0a('0x58')](_0x2d0a('0x135'),util['inspect'](_0x126526,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x29aec6);});}else{clearPredictiveAttributes(_0x29aec6);}})[_0x2d0a('0x3b')](function(){var _0x182b47=_0x7a815c[_0x2d0a('0x136')](_0x29aec6);if(_0x182b47||_0x29aec6[_0x2d0a('0x137')]){_0x29aec6['queueSummaryCountersUpdated']=![];_0x7a815c[_0x2d0a('0x138')](_0x29aec6);Object['assign'](_0x29aec6,_0x7a815c);emitOutboundVoiceQueueSummary(_0x7a815c);}_0x1b34ae[_0x2d0a('0x26')][_0x29aec6[_0x2d0a('0x41')]][_0x2d0a('0x12c')]=![];})[_0x2d0a('0x94')](function(_0x31b432){logger['error'](_0x2d0a('0x135'),util['inspect'](_0x31b432,{'showHidden':![],'depth':null}));_0x1b34ae[_0x2d0a('0x26')][_0x29aec6['name']][_0x2d0a('0x12c')]=![];});};Dialer['prototype'][_0x2d0a('0x2f')]=_[_0x2d0a('0x139')](function(){var _0x242498=_['filter'](this[_0x2d0a('0x1a')],function(_0x56ad3b){return _0x56ad3b[_0x2d0a('0x13a')];});var _0x6fc402=_[_0x2d0a('0x13b')](this[_0x2d0a('0x1c')],function(_0x54202d){return _0x54202d[_0x2d0a('0x13c')]&&_0x54202d[_0x2d0a('0x7f')]==='reachable';});if(_0x242498[_0x2d0a('0x13d')]>0x0&&_0x6fc402[_0x2d0a('0x13d')]>0x0){return Promise['resolve']()[_0x2d0a('0x3b')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x242498,'id'),previewRecallmeReminderInterval,_['map'](_0x6fc402,'id')))[_0x2d0a('0x3b')](function(_0x515d24){for(var _0x172cae=0x0;_0x172cae<_0x515d24[_0x2d0a('0x13d')];_0x172cae++){var _0x240138=_0x515d24[_0x172cae][_0x2d0a('0x13e')]['name'];if(_0x240138)io['to'](util['format']('user:%s',_0x240138))['emit'](_0x2d0a('0x13f'),{'hopper':_0x515d24[_0x172cae]});}})['catch'](function(_0x273025){logger['error']('checkPreviewRecallReminder',_0x273025);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x2d0a('0x7b')][_0x2d0a('0x39')]=function(){var _0x1cb525=this;setInterval(function(){_0x1cb525[_0x2d0a('0x140')](_0x1cb525['uniqueId'],_0x2d0a('0x141'));_0x1cb525[_0x2d0a('0x140')](_0x1cb525[_0x2d0a('0xe1')],_0x2d0a('0x142'));},0x32c8);};Dialer['prototype'][_0x2d0a('0x140')]=function(_0xa5500d,_0x517307){var _0x562fe7=this;for(var _0x108278 in _0xa5500d){if(typeof _0xa5500d[_0x108278]!==_0x2d0a('0x143')){this[_0x2d0a('0x18')]['enqueue'](function(){if(!_['isNil'](_0xa5500d[_0x108278])){return ami[_0x2d0a('0x8e')]({'action':_0x2d0a('0x7f'),'channel':_0xa5500d[_0x108278]['channel']})[_0x2d0a('0x94')](function(_0x108c7a){if(_0x108c7a[_0x2d0a('0x5f')]===_0x2d0a('0x144')){setTimeout(function(){if(_0xa5500d[_0x108278]&&_0xa5500d[_0x108278]['type']!=='ivr'){_0x562fe7[_0x2d0a('0xb7')](_0x562fe7[_0x2d0a('0x1a')][_0xa5500d[_0x108278][_0x2d0a('0xb4')]]);logger['error'](_0x2d0a('0x145'),_0x517307,_0x108278,_0xa5500d[_0x108278][_0x2d0a('0xb4')]);delete _0xa5500d[_0x108278];}if(_0xa5500d[_0x108278]&&_0xa5500d[_0x108278][_0x2d0a('0x3d')]===_0x2d0a('0xb6')){_0x562fe7[_0x2d0a('0xb7')](_0x562fe7[_0x2d0a('0x1b')][_0xa5500d[_0x108278]['queue']]);logger[_0x2d0a('0x5b')]('[Dialer][checkChannel][ivr]',_0x517307,_0x108278,_0xa5500d[_0x108278]['queue']);delete _0xa5500d[_0x108278];}},0x2328);}});}});}}};Dialer['prototype'][_0x2d0a('0x146')]=function(_0x537833){return Promise[_0x2d0a('0xa0')]()[_0x2d0a('0x3b')](voiceQueueRt[_0x2d0a('0x146')](_0x537833))[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x147')));};Dialer[_0x2d0a('0x7b')][_0x2d0a('0xb7')]=function(_0xde356b){if(!_[_0x2d0a('0x3c')](_0xde356b)&&_0xde356b!==null){if(typeof _0xde356b[_0x2d0a('0x148')]!==_0x2d0a('0x143')){if(_0xde356b[_0x2d0a('0x148')]>0x0){_0xde356b[_0x2d0a('0x148')]-=0x1;}else{logger[_0x2d0a('0x5b')](_0x2d0a('0x149'));}}}else{logger['error'](_0x2d0a('0x14a'));}};Dialer['prototype'][_0x2d0a('0x14b')]=function(_0x503df1,_0x38e66f){var _0x46dd4c=this;return function(_0x557b6c){_0x46dd4c[_0x2d0a('0xb7')](_0x38e66f);logger[_0x2d0a('0x5b')](_0x503df1,util['inspect'](_0x557b6c,{'showHidden':![],'depth':null}));};};Dialer[_0x2d0a('0x7b')]['emptyContact']=function(_0xa05d32,_0x2e6079,_0xf0d82e){var _0x5ba72c={'state':0x19,'statedesc':_0x2d0a('0x14c')};this['updateOriginated'](_0x2e6079);this[_0x2d0a('0x11f')](_[_0x2d0a('0x14d')](_0x5ba72c,_[_0x2d0a('0xeb')](_0xf0d82e,[_0x2d0a('0xcf'),_0x2d0a('0xd0'),'UserId','VoiceQueueId',_0x2d0a('0xd2')])),_0x2d0a('0x14e'),_0x2d0a('0x14f'));logger[_0x2d0a('0x5b')](_0xa05d32);};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x11f')]=function(_0x9fbc81,_0x533f61,_0x331d01){hopperUtils[_0x2d0a('0xbc')](_0x9fbc81)[_0x2d0a('0x94')](loggerCatch(_0x533f61));hopperUtils[_0x2d0a('0x127')](_0x9fbc81)['catch'](loggerCatch(_0x331d01));};Dialer[_0x2d0a('0x7b')][_0x2d0a('0xca')]=function(_0x401040,_0x1518d5){hopperUtils[_0x2d0a('0xbc')](_0x401040)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0xbd')));if(_0x1518d5==0x0){hopperUtils[_0x2d0a('0x127')](_0x401040)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x150')));}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x151')]=function(_0xee8489){return Promise['resolve']()[_0x2d0a('0x3b')](cmHopper[_0x2d0a('0x152')](_0xee8489['id'],previewRecallmeReminderInterval))[_0x2d0a('0x3b')](function(_0x138875){for(var _0x4913cf=0x0;_0x4913cf<_0x138875[_0x2d0a('0x13d')];_0x4913cf++){var _0x22e876=_0x138875[_0x4913cf][_0x2d0a('0x13e')][_0x2d0a('0x41')];if(_0x22e876)io['to'](util[_0x2d0a('0x7d')](_0x2d0a('0x153'),_0x22e876))[_0x2d0a('0x10d')](_0x2d0a('0x13f'),{'hopper':_0x138875[_0x4913cf]});}})['catch'](function(){});};Dialer[_0x2d0a('0x7b')][_0x2d0a('0xa5')]=function(_0x49e504){var _0x2056ea=this;return function(){_0x2056ea[_0x2d0a('0x154')](_0x49e504);};};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x155')]=function(_0x1de368,_0x9066cd){var _0x16ad9c=this;var _0x4d69e1=uuid['v4']();this[_0x2d0a('0xe1')][_0x4d69e1]=new Action(_0x1de368,_0x9066cd,_0x4d69e1);return new Promise(function(_0x58f7f0,_0x4bb7d2){if(_['isUndefined'](_0x1de368)&&typeof _0x1de368!==_0x2d0a('0x156')){return _0x4bb7d2(msgResponse(_0x2d0a('0x157'),'Failure',_0x2d0a('0x158')));}if(_['isUndefined'](_0x9066cd[_0x2d0a('0x159')])||_0x9066cd[_0x2d0a('0x159')]===null){return _0x4bb7d2(msgResponse(_0x2d0a('0x157'),_0x2d0a('0x88'),'contact\x20is\x20undefine'));}var _0x3b942c={'XMD-CALLERID':_0x16ad9c[_0x2d0a('0xe1')][_0x4d69e1][_0x2d0a('0x15a')](),'XMD-AGI':_0x1de368[_0x2d0a('0x125')]?util[_0x2d0a('0x7d')](_0x2d0a('0x15b'),ipAgi,_0x1de368['dialQueueProject']):_0x2d0a('0x15c'),'XMD-AGIAFTER':_0x1de368['dialQueueProject2']?util[_0x2d0a('0x7d')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1de368[_0x2d0a('0x15d')]):'NONE','XMD-QUEUE':utils[_0x2d0a('0x15e')](_0x1de368)?util['format'](_0x2d0a('0x15f'),_0x1de368['name'],_0x1de368[_0x2d0a('0x160')]||'',_0x1de368[_0x2d0a('0xbb')]?'c':'',_0x1de368[_0x2d0a('0xc1')]||0x3):_0x2d0a('0x15c'),'XMD-CONTACTID':_0x9066cd[_0x2d0a('0xcf')],'XMD-CDRTYPE':_0x2d0a('0x7'),'CALLERID(all)':_0x16ad9c[_0x2d0a('0xe1')][_0x4d69e1]['getCaller'](),'XMD-AMD':_0x1de368['dialAMDActive']?_0x2d0a('0x133'):'NONE','XMD-DESTINATION':_0x2d0a('0x102')};if(_0x1de368[_0x2d0a('0x103')]){_0x3b942c[_0x2d0a('0x161')]=_0x1de368[_0x2d0a('0x162')]||0x9c4;_0x3b942c[_0x2d0a('0x163')]=_0x1de368[_0x2d0a('0x164')]||0x5dc;_0x3b942c[_0x2d0a('0x165')]=_0x1de368['dialAMDAfterGreetingSilence']||0x320;_0x3b942c['XMD-AMDTOTALANALYSISTIME']=_0x1de368[_0x2d0a('0x166')]||0x1388;_0x3b942c['XMD-AMDMINWORDLENGTH']=_0x1de368[_0x2d0a('0x167')]||0x64;_0x3b942c[_0x2d0a('0x168')]=_0x1de368['dialAMDBetweenWordsSilence']||0x32;_0x3b942c[_0x2d0a('0x169')]=_0x1de368[_0x2d0a('0x16a')]||0x3;_0x3b942c[_0x2d0a('0x16b')]=_0x1de368[_0x2d0a('0x16c')]||0x100;_0x3b942c[_0x2d0a('0x16d')]=_0x1de368[_0x2d0a('0x16e')]||0x1388;}if(utils[_0x2d0a('0x15e')](_0x1de368)){_0x3b942c[_0x2d0a('0x16f')]=_0x9066cd[_0x2d0a('0xd1')];}else{_0x3b942c['XMD-CAMPAIGNID']=_0x9066cd[_0x2d0a('0xd2')];}for(var _0x2bd071 in _0x9066cd['Contact']){if(typeof _0x9066cd['Contact'][_0x2bd071]!==_0x2d0a('0x143')){if(isNotNull(_0x9066cd[_0x2d0a('0x170')][_0x2bd071])&&_0x2bd071!=='id'&&_0x2bd071!=='tags'&&_0x2bd071!=='createdAt'&&_0x2bd071!=='updatedAt'){_0x3b942c[util[_0x2d0a('0x7d')](_0x2d0a('0x171'),_0x2d0a('0x172'),_[_0x2d0a('0x173')](_0x2bd071))]=_0x9066cd[_0x2d0a('0x170')][_0x2bd071];}}}var _0x36865b=_0x16ad9c['isTrunkReachable'](_0x1de368[_0x2d0a('0x174')])?utils[_0x2d0a('0x175')](_0x1de368[_0x2d0a('0x174')][_0x2d0a('0x176')],_0x1de368['dialOriginateCallerIdName'],_0x1de368['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x2d0a('0x177')](_0x1de368[_0x2d0a('0x178')],_0x1de368['dialRandomLastDigitCallerIdNumber']):_0x1de368[_0x2d0a('0x178')]):utils[_0x2d0a('0x175')](_[_0x2d0a('0xe6')](_0x1de368['TrunkBackup'])?_0x1de368[_0x2d0a('0x174')][_0x2d0a('0x176')]:_0x1de368[_0x2d0a('0x82')][_0x2d0a('0x176')],_0x1de368[_0x2d0a('0x179')],_0x1de368[_0x2d0a('0x17a')]>0x0?utils['getCallerIdRandom'](_0x1de368[_0x2d0a('0x178')],_0x1de368[_0x2d0a('0x17a')]):_0x1de368['dialOriginateCallerIdNumber']);if(_0x36865b){_0x3b942c[_0x2d0a('0x17b')]=_0x16ad9c[_0x2d0a('0xe1')][_0x4d69e1][_0x2d0a('0x17c')]=utils[_0x2d0a('0x17d')](_0x36865b);_0x3b942c[_0x2d0a('0x17e')]=_0x9066cd['phone'];}_0x1de368[_0x2d0a('0x17f')]=_0x3b942c;return ami['Action']({'actionid':_0x4d69e1,'action':_0x2d0a('0x157'),'channel':_0x16ad9c['isTrunkReachable'](_0x1de368[_0x2d0a('0x174')])?util[_0x2d0a('0x7d')](_0x2d0a('0x180'),_0x1de368[_0x2d0a('0x174')][_0x2d0a('0x41')],isNotNull(_0x1de368[_0x2d0a('0x181')])?_0x1de368[_0x2d0a('0x181')]['trim']()||'':'',_0x1de368[_0x2d0a('0x182')]>0x0?_0x9066cd['phone'][_0x2d0a('0x183')](_0x1de368[_0x2d0a('0x182')]):_0x9066cd[_0x2d0a('0x159')]):util[_0x2d0a('0x7d')](_0x2d0a('0x180'),_[_0x2d0a('0xe6')](_0x1de368[_0x2d0a('0x82')])?_0x1de368[_0x2d0a('0x174')][_0x2d0a('0x41')]:_0x1de368[_0x2d0a('0x82')][_0x2d0a('0x41')],isNotNull(_0x1de368[_0x2d0a('0x181')])?_0x1de368[_0x2d0a('0x181')]['trim']()||'':'',_0x1de368['dialCutDigit']>0x0?_0x9066cd[_0x2d0a('0x159')][_0x2d0a('0x183')](_0x1de368[_0x2d0a('0x182')]):_0x9066cd[_0x2d0a('0x159')]),'callerid':_0x36865b,'Exten':_0x2d0a('0x102'),'Context':_0x2d0a('0x184'),'Priority':'1','variable':_0x3b942c,'timeout':(_0x1de368[_0x2d0a('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d69e1})[_0x2d0a('0x3b')](function(_0x306d59){return _0x58f7f0(_0x306d59);})[_0x2d0a('0x94')](function(_0x265153){_0x1de368['outboundOriginateFailureCallsDay']+=0x1;var _0x3e143a=new History(_0x16ad9c[_0x2d0a('0xe1')][_0x4d69e1]);logger[_0x2d0a('0x5b')](util[_0x2d0a('0x7d')](_0x2d0a('0x186'),JSON[_0x2d0a('0x6a')](_0x265153)));_0x3e143a['state']=0xe;_0x3e143a[_0x2d0a('0x65')]=_0x2d0a('0x187');_0x3e143a['starttime']=moment()[_0x2d0a('0x7d')](_0x2d0a('0xb8'));_0x3e143a[_0x2d0a('0x66')]=_0x3e143a[_0x2d0a('0x67')];hopperUtils[_0x2d0a('0xbc')](_0x3e143a)['catch'](loggerCatch('[originate][error]'));_0x16ad9c['moveContactManagedDialer'](_0x3e143a)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x188')))[_0x2d0a('0x17')](function(){delete _0x16ad9c[_0x2d0a('0xe1')][_0x4d69e1];return _0x4bb7d2(msgResponse(_0x2d0a('0x157'),_0x2d0a('0x7a'),'originate\x20action\x20Error'));});});});};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x189')]=function(_0x26b34a,_0x6221fc,_0x1a0ef8){var _0x310138=new History(_0x6221fc);if(_0x310138[_0x2d0a('0x18a')]+_0x310138[_0x2d0a('0x10f')]+_0x310138[_0x2d0a('0x110')]+_0x310138[_0x2d0a('0x111')]+_0x310138[_0x2d0a('0xc4')]+_0x310138[_0x2d0a('0xda')]+_0x310138[_0x2d0a('0x10c')]+_0x310138[_0x2d0a('0x112')]>=_0x1a0ef8[_0x2d0a('0x113')]-0x1){return!![];}switch(_0x26b34a){case 0x3:if(_0x310138[_0x2d0a('0x110')]>=_0x1a0ef8[_0x2d0a('0x18b')]-0x1){return!![];}hopperUtils[_0x2d0a('0xcc')]({'active':![],'countnoanswerretry':_0x310138['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x2d0a('0xcd')](_0x1a0ef8[_0x2d0a('0x18c')],'minutes')[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})['catch'](loggerCatch(_0x2d0a('0x18d')));break;case 0x5:if(_0x310138['countbusyretry']>=_0x1a0ef8[_0x2d0a('0x18e')]-0x1){return!![];}hopperUtils[_0x2d0a('0xcc')]({'active':![],'countbusyretry':_0x310138['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x1a0ef8[_0x2d0a('0x18f')],'minutes')[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x310138['CampaignId']||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x190')));break;case 0x8:if(_0x310138['countcongestionretry']>=_0x1a0ef8[_0x2d0a('0x191')]-0x1){return!![];}hopperUtils[_0x2d0a('0xcc')]({'active':![],'countcongestionretry':_0x310138[_0x2d0a('0x10f')]+=0x1,'scheduledat':moment()[_0x2d0a('0xcd')](_0x1a0ef8[_0x2d0a('0x192')],'minutes')[_0x2d0a('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})[_0x2d0a('0x94')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x310138[_0x2d0a('0x111')]>=_0x1a0ef8[_0x2d0a('0x193')]-0x1){return!![];}else{hopperUtils[_0x2d0a('0xcc')]({'active':![],'countnosuchnumberretry':_0x310138['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x2d0a('0xcd')](_0x1a0ef8[_0x2d0a('0x194')],'minutes')[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138['VoiceQueueId']||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x195')));}break;case 0xa:if(_0x310138[_0x2d0a('0xc4')]>=_0x1a0ef8[_0x2d0a('0xc9')]-0x1){return!![];}hopperUtils[_0x2d0a('0xcc')]({'active':![],'countdropretry':_0x310138[_0x2d0a('0xc4')]+=0x1,'scheduledat':moment()[_0x2d0a('0xcd')](_0x1a0ef8['dialDropRetryFrequency'],_0x2d0a('0xce'))[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138['VoiceQueueId']||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x196')));break;case 0xb:if(_0x310138[_0x2d0a('0xda')]>=_0x1a0ef8[_0x2d0a('0xdc')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x310138['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x1a0ef8['dialAbandonedRetryFrequency'],'minutes')[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138['VoiceQueueId']||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})['catch'](loggerCatch(_0x2d0a('0xdd')));break;case 0x13:if(_0x310138[_0x2d0a('0x10c')]>=_0x1a0ef8[_0x2d0a('0x116')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x310138[_0x2d0a('0x10c')]+=0x1,'scheduledat':moment()[_0x2d0a('0xcd')](_0x1a0ef8[_0x2d0a('0x119')],'minutes')[_0x2d0a('0x7d')](_0x2d0a('0xb8')),'ContactId':_0x310138['ContactId'],'ListId':_0x310138['ListId'],'VoiceQueueId':_0x310138[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})['catch'](loggerCatch(_0x2d0a('0x11a')));break;case 0x14:if(_0x310138[_0x2d0a('0x112')]>=_0x1a0ef8['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x2d0a('0xcc')]({'active':![],'countagentrejectretry':_0x310138['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x2d0a('0xcd')](_0x1a0ef8[_0x2d0a('0x197')],_0x2d0a('0xce'))['format'](_0x2d0a('0xb8')),'ContactId':_0x310138[_0x2d0a('0xcf')],'ListId':_0x310138[_0x2d0a('0xd0')],'VoiceQueueId':_0x310138['VoiceQueueId']||undefined,'CampaignId':_0x310138[_0x2d0a('0xd2')]||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x198')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x555355,_0x2fc48c,_0x48b4ab){var _0x4c7cff=this;var _0x3e0fa5=new History(_0x555355);var _0x22b123=![];var _0x29761a;var _0x1686ef;return new Promise(function(_0x13afe1,_0x16c738){if(_[_0x2d0a('0x3c')](_0x2fc48c)&&typeof _0x2fc48c!==_0x2d0a('0x156')){return _0x16c738(msgResponse(_0x2d0a('0x199'),_0x2d0a('0x88'),'entity\x20is\x20undefine'));}if(_[_0x2d0a('0x3c')](_0x48b4ab)&&typeof _0x48b4ab!==_0x2d0a('0x156')){return _0x16c738(msgResponse(_0x2d0a('0x199'),_0x2d0a('0x88'),_0x2d0a('0x19a')));}hopperUtils[_0x2d0a('0xc8')](_0x3e0fa5,_0x48b4ab[_0x2d0a('0xb9')],_0x2fc48c)['then'](function(_0xedf9cb){if(_0xedf9cb[_0x2d0a('0xcb')]==0x1)_0x22b123=!![];switch(_0x48b4ab[_0x2d0a('0xb9')]){case'0':_0x2fc48c[_0x2d0a('0x19b')]+=0x1;_0x3e0fa5[_0x2d0a('0x64')]=0x0;_0x3e0fa5[_0x2d0a('0x65')]=_0x2d0a('0x19c');_0x3e0fa5[_0x2d0a('0x111')]+=0x1;_0x3e0fa5[_0x2d0a('0xc5')]+=0x1;ami[_0x2d0a('0x10d')](_0x2d0a('0x19d'),ut[_0x2d0a('0x107')](_0x555355,_0x2d0a('0x19e')));_0x29761a=_0x2fc48c[_0x2d0a('0x194')];_0x1686ef=_0x2fc48c[_0x2d0a('0xc7')];hopperUtils[_0x2d0a('0xbc')](_0x3e0fa5)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x10e')));if(_0x4c7cff[_0x2d0a('0x189')](0x0,_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0x111')]>=_0x2fc48c[_0x2d0a('0x193')]){_0x4c7cff['createStateFinal'](_0x3e0fa5,_0x13afe1,_0x16c738,'reason\x200\x20no\x20such\x20number....');}else{_0x4c7cff[_0x2d0a('0x114')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x19f'));}}break;case'3':_0x2fc48c[_0x2d0a('0x1a0')]+=0x1;_0x3e0fa5['state']=0x3;_0x3e0fa5['statedesc']=_0x2d0a('0x1a1');_0x3e0fa5[_0x2d0a('0x110')]+=0x1;_0x3e0fa5['countglobal']+=0x1;var _0x190c9d=ut[_0x2d0a('0x1a2')](_0x555355,_0x2fc48c);ami['emit'](_0x2d0a('0x1a3'),_0x190c9d);_0x29761a=_0x2fc48c['dialNoAnswerRetryFrequency'];_0x1686ef=_0x2fc48c[_0x2d0a('0xc7')];hopperUtils[_0x2d0a('0xbc')](_0x3e0fa5)[_0x2d0a('0x94')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4c7cff[_0x2d0a('0x189')](0x3,_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0x110')]>=_0x2fc48c['dialNoAnswerMaxRetry']){_0x4c7cff[_0x2d0a('0x117')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1a4'));}else{_0x4c7cff['stateGlobal'](_0x3e0fa5,_0x13afe1,_0x16c738,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2fc48c[_0x2d0a('0x1a5')]+=0x1;_0x3e0fa5['state']=0x5;_0x3e0fa5[_0x2d0a('0x65')]='Busy';_0x3e0fa5['countbusyretry']+=0x1;_0x3e0fa5[_0x2d0a('0xc5')]+=0x1;ami[_0x2d0a('0x10d')](_0x2d0a('0x1a6'),ut[_0x2d0a('0x107')](_0x555355,_0x2d0a('0x1a7')));_0x29761a=_0x2fc48c[_0x2d0a('0x18f')];_0x1686ef=_0x2fc48c[_0x2d0a('0xc7')];hopperUtils['createHistory'](_0x3e0fa5)[_0x2d0a('0x94')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4c7cff[_0x2d0a('0x189')](0x5,_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0x18a')]>=_0x2fc48c[_0x2d0a('0x18e')]){_0x4c7cff[_0x2d0a('0x117')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1a8'));}else{_0x4c7cff[_0x2d0a('0x114')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1a8'));}}break;case'8':_0x2fc48c[_0x2d0a('0x1a9')]+=0x1;_0x3e0fa5[_0x2d0a('0x64')]=0x8;_0x3e0fa5[_0x2d0a('0x65')]='Congestion';_0x3e0fa5[_0x2d0a('0x10f')]+=0x1;_0x3e0fa5[_0x2d0a('0xc5')]+=0x1;_0x29761a=_0x2fc48c['dialCongestionRetryFrequency'];_0x1686ef=_0x2fc48c['callAdditionalPhoneAfterMin'];ami[_0x2d0a('0x10d')](_0x2d0a('0x1aa'),ut['buildObj'](_0x555355,'congestion'));hopperUtils[_0x2d0a('0xbc')](_0x3e0fa5)[_0x2d0a('0x94')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x4c7cff[_0x2d0a('0x189')](0x8,_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0x10f')]>=_0x2fc48c[_0x2d0a('0x191')]){_0x4c7cff[_0x2d0a('0x117')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1ab'));}else{_0x4c7cff['stateGlobal'](_0x3e0fa5,_0x13afe1,_0x16c738,'reason\x208\x20congestion');}}break;case'11':_0x2fc48c[_0x2d0a('0x1ac')]+=0x1;_0x3e0fa5[_0x2d0a('0x64')]=0xb;_0x3e0fa5[_0x2d0a('0x65')]=_0x2d0a('0xd8');_0x3e0fa5['countabandonedretry']+=0x1;_0x3e0fa5[_0x2d0a('0xc5')]+=0x1;_0x29761a=_0x2fc48c[_0x2d0a('0xdb')];_0x1686ef=_0x2fc48c[_0x2d0a('0xc7')];hopperUtils[_0x2d0a('0xbc')](_0x3e0fa5)[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0xde')));if(_0x4c7cff[_0x2d0a('0x189')](0xb,_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0xda')]>=_0x2fc48c['dialAbandonedMaxRetry']){_0x4c7cff[_0x2d0a('0x117')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1ad'));}else{_0x4c7cff['stateGlobal'](_0x3e0fa5,_0x13afe1,_0x16c738,'reason\x2011\x20abandoned');}}break;case'20':_0x2fc48c[_0x2d0a('0x1ae')]+=0x1;_0x3e0fa5[_0x2d0a('0x64')]=0x14;_0x3e0fa5[_0x2d0a('0x65')]=_0x2d0a('0x1af');_0x3e0fa5[_0x2d0a('0x112')]+=0x1;_0x3e0fa5[_0x2d0a('0xc5')]+=0x1;_0x29761a=_0x2fc48c[_0x2d0a('0x197')];_0x1686ef=_0x2fc48c[_0x2d0a('0xc7')];ami[_0x2d0a('0x10d')](_0x2d0a('0x1b0'),ut[_0x2d0a('0x107')](_0x555355,_0x2d0a('0x1b1')));hopperUtils[_0x2d0a('0xbc')](_0x3e0fa5)['catch'](loggerCatch(_0x2d0a('0x1b2')));if(_0x4c7cff[_0x2d0a('0x189')](0x14,_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0x112')]>=_0x2fc48c[_0x2d0a('0x1b3')]){_0x4c7cff['createStateFinal'](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1b4'));}else{_0x4c7cff[_0x2d0a('0x114')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x2d0a('0x1b4'));}}break;default:_0x2fc48c[_0x2d0a('0x129')]+=0x1;_0x3e0fa5[_0x2d0a('0x64')]=0xc;_0x3e0fa5[_0x2d0a('0x65')]=_0x48b4ab[_0x2d0a('0xb9')];_0x29761a=_0x2fc48c[_0x2d0a('0x197')];_0x1686ef=_0x2fc48c[_0x2d0a('0xc7')];hopperUtils[_0x2d0a('0xbc')](_0x3e0fa5)[_0x2d0a('0x94')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4c7cff[_0x2d0a('0x189')](_0x48b4ab['reason'],_0x555355,_0x2fc48c)&&!_0x22b123){if(_0x3e0fa5[_0x2d0a('0x18a')]+_0x3e0fa5['countcongestionretry']+_0x3e0fa5[_0x2d0a('0x110')]+_0x3e0fa5[_0x2d0a('0x111')]+_0x3e0fa5['countdropretry']+_0x3e0fa5[_0x2d0a('0xda')]+_0x3e0fa5[_0x2d0a('0x10c')]+_0x3e0fa5[_0x2d0a('0x112')]>=_0x2fc48c[_0x2d0a('0x113')]){_0x4c7cff[_0x2d0a('0x114')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x48b4ab[_0x2d0a('0xb9')]);}else{_0x4c7cff[_0x2d0a('0x117')](_0x3e0fa5,_0x13afe1,_0x16c738,_0x48b4ab[_0x2d0a('0xb9')]);}}}})[_0x2d0a('0x3b')](function(){if(_0x22b123){hopperUtils[_0x2d0a('0xdf')](_0x3e0fa5,_0x29761a,_0x1686ef)['then'](function(){return _0x13afe1(0x1);});}});});};Dialer['prototype'][_0x2d0a('0x114')]=function(_0x525dfa,_0x490d26,_0x4d8191,_0x2d4c8f){var _0x49e261=new Final(_0x525dfa);_0x49e261[_0x2d0a('0x64')]=0xf;_0x49e261[_0x2d0a('0x65')]=_0x2d0a('0x1b5');this[_0x2d0a('0x117')](_0x49e261,_0x490d26,_0x4d8191,_0x2d4c8f);};Dialer[_0x2d0a('0x7b')]['createStateFinal']=function(_0x413550,_0x1d5610,_0x16dd83,_0x342bbb){hopperUtils[_0x2d0a('0x127')](_0x413550)[_0x2d0a('0x3b')](function(){return _0x1d5610(msgResponse(_0x2d0a('0x199'),'Success',_0x342bbb));})[_0x2d0a('0x94')](function(){return _0x16dd83(msgResponse(_0x2d0a('0x1b6'),_0x2d0a('0x88'),'contact\x20not\x20moved'));});};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x9')]=function(_0x466a4e){var _0x539769=_0x466a4e[_0x2d0a('0x1b7')]/0x64;var _0x25e47e=_0x466a4e[_0x2d0a('0xc2')]/(_0x466a4e[_0x2d0a('0xc2')]+_0x466a4e[_0x2d0a('0x10a')]);var _0x3d208d=Math[_0x2d0a('0x1b8')](_0x466a4e[_0x2d0a('0x1b9')]*(_0x466a4e[_0x2d0a('0x1ba')]/0x64));var _0x66e83a=Math[_0x2d0a('0x1b8')](_0x466a4e[_0x2d0a('0x1b9')]*(_0x466a4e[_0x2d0a('0x1bb')]/0x64));var _0xe37021=_0x466a4e['available']+_0x466a4e[_0x2d0a('0x131')];var _0x5d0438=Math[_0x2d0a('0x1bc')](_0x466a4e[_0x2d0a('0x52')]*_0x466a4e[_0x2d0a('0x1bd')]*_0x466a4e[_0x2d0a('0x1be')]*_0x466a4e[_0x2d0a('0x1bf')]);if(_[_0x2d0a('0x3c')](_0x466a4e[_0x2d0a('0x23')])){if(!_['isUndefined'](_0x466a4e[_0x2d0a('0x22')])){_0x466a4e[_0x2d0a('0x22')]=undefined;loggerPredictive[_0x2d0a('0x5b')](_0x2d0a('0x1c0'),_0x2d0a('0x1c1'));}if(!_[_0x2d0a('0x3c')](_0x466a4e[_0x2d0a('0x5a')])){loggerPredictive[_0x2d0a('0x5b')]('[startMethodPredictive][StartProgressive]',_0x2d0a('0x1c2'));clearInterval(_0x466a4e['handlePredictive']);_0x466a4e[_0x2d0a('0x5a')]=undefined;}_0x466a4e[_0x2d0a('0x23')]=moment()['format'](_0x2d0a('0xb8'));loggerPredictive['info'](_0x466a4e['name'],'collection\x20data\x20in\x20progressive\x20at',_0x466a4e[_0x2d0a('0x23')]);this[_0x2d0a('0xa9')](_0x466a4e,0x1);}else if(ifInterval(_0x466a4e['dialPredictiveInterval'],_0x466a4e[_0x2d0a('0x23')])){this[_0x2d0a('0xa9')](_0x466a4e,0x1);loggerPredictiveCalls[_0x2d0a('0x44')](_0x2d0a('0x1c3'),_0x466a4e[_0x2d0a('0x23')],_0x466a4e[_0x2d0a('0x41')]);_0x466a4e[_0x2d0a('0x52')]=0x0;_0x466a4e[_0x2d0a('0x1c4')]=0x0;}else if(_0x539769<_0x25e47e&&_0x466a4e[_0x2d0a('0x1c5')]===_0x2d0a('0x1c6')){clearPredictiveAttributes(_0x466a4e);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x1c7'),_0x2d0a('0x1c8'),_0x25e47e,_0x2d0a('0x23'),_0x466a4e[_0x2d0a('0x41')]);}else if(_0x5d0438<_0x466a4e[_0x2d0a('0x1c4')]&&_0x466a4e['dialPredictiveOptimization']===_0x2d0a('0x1c6')){clearPredictiveAttributes(_0x466a4e);loggerPredictive[_0x2d0a('0x44')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x5d0438,_0x2d0a('0x1c9'),_0x466a4e[_0x2d0a('0x1c4')],_0x2d0a('0x23'),_0x466a4e[_0x2d0a('0x41')]);}else if(!ifInterval(_0x466a4e['dialPredictiveInterval'],_0x466a4e[_0x2d0a('0x23')])&&_[_0x2d0a('0x3c')](_0x466a4e[_0x2d0a('0x22')])&&!_[_0x2d0a('0x3c')](_0x466a4e[_0x2d0a('0x23')])){_0x466a4e['startPredictive']=moment()[_0x2d0a('0x7d')](_0x2d0a('0xb8'));loggerPredictive[_0x2d0a('0x44')](_0x466a4e['name'],'started\x20in\x20predictive\x20at',_0x466a4e[_0x2d0a('0x22')]);hopperUtils['avgHandleTime'](_0x466a4e[_0x2d0a('0x1ca')])[_0x2d0a('0x3b')](this[_0x2d0a('0x1cb')](_0x466a4e))['then'](mergeDataErlangB(_0x466a4e))['then'](this[_0x2d0a('0x1cc')](_0x466a4e))[_0x2d0a('0x94')](loggerCatchPredictive(_0x2d0a('0x1cd'),_0x466a4e));}else if(!ifInterval(_0x466a4e['dialPredictiveInterval'],_0x466a4e['startPredictive'])){_0x466a4e[_0x2d0a('0x1c4')]=0x0;_0x466a4e[_0x2d0a('0x22')]=moment()['format'](_0x2d0a('0xb8'));loggerPredictive[_0x2d0a('0x44')](_0x466a4e[_0x2d0a('0x41')],_0x2d0a('0x1ce'),_0x466a4e[_0x2d0a('0x22')]);clearInterval(_0x466a4e[_0x2d0a('0x5a')]);_0x466a4e['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x466a4e[_0x2d0a('0x1ca')])[_0x2d0a('0x3b')](this[_0x2d0a('0x1cb')](_0x466a4e))[_0x2d0a('0x3b')](mergeDataErlangB(_0x466a4e))['then'](this[_0x2d0a('0x1cc')](_0x466a4e))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x466a4e));}else if(_0x466a4e[_0x2d0a('0x1b9')]&&_0xe37021<_0x466a4e[_0x2d0a('0x1b9')]-_0x66e83a){clearPredictiveAttributes(_0x466a4e);loggerPredictive[_0x2d0a('0x44')](_0x466a4e[_0x2d0a('0x41')],_0x2d0a('0x1cf'),_0xe37021,')\x20are\x20less\x20than\x20threshold\x20(',_0x466a4e[_0x2d0a('0x1b9')],'-',_0x66e83a,'=',_0x466a4e[_0x2d0a('0x1b9')]-_0x66e83a,')');}else if(_0x466a4e[_0x2d0a('0x1b9')]&&_0xe37021>_0x466a4e[_0x2d0a('0x1b9')]+_0x3d208d){clearPredictiveAttributes(_0x466a4e);loggerPredictive[_0x2d0a('0x44')](_0x466a4e[_0x2d0a('0x41')],_0x2d0a('0x1cf'),_0xe37021,_0x2d0a('0x1d0'),_0x466a4e['predictiveIntervalAvailable'],'+',_0x3d208d,'=',_0x466a4e['predictiveIntervalAvailable']+_0x3d208d,')');}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x1cb')]=function(_0x2ebeda){var _0x24f554=this;return function(_0x80d6f1){return new Promise(function(_0x24666e,_0x20000c){_['merge'](_0x2ebeda,_0x80d6f1[0x0]);if(checkGetDataPredictive(_0x80d6f1[0x0])){var _0x52a7f7=_0x2ebeda[_0x2d0a('0x1b9')]=_0x2ebeda['talking']+_0x2ebeda[_0x2d0a('0x12f')];var _0x51eebc=_0x2ebeda['dialPredictiveInterval']*0x3c;var _0x513fa2=_0x80d6f1[0x0][_0x2d0a('0x4d')]+_0x80d6f1[0x0][_0x2d0a('0x4b')];var _0x5d741d=(_0x80d6f1[0x0][_0x2d0a('0x1d1')]+_0x80d6f1[0x0][_0x2d0a('0x49')]+_0x80d6f1[0x0][_0x2d0a('0x4a')])/_0x80d6f1[0x0][_0x2d0a('0x1d2')];_0x2ebeda[_0x2d0a('0x1be')]=_0x5d741d>0x0?_0x5d741d:0x1;switch(_0x2ebeda[_0x2d0a('0x1c5')]){case _0x2d0a('0x1c6'):var _0x5f280c=_0x2ebeda[_0x2d0a('0x1b7')]/0x64;return _0x24f554['abandonmentRate'](_0x52a7f7,_0x51eebc,_0x513fa2,_0x5d741d,_0x5f280c)[_0x2d0a('0x3b')](function(_0xd052dd){return _0x24666e(_0xd052dd);});case _0x2d0a('0x1d3'):var _0x112655=_0x2ebeda[_0x2d0a('0x1b7')]/0x64;return _0x24f554[_0x2d0a('0x1d4')](_0x52a7f7,_0x51eebc,_0x513fa2,_0x5d741d,_0x112655)[_0x2d0a('0x3b')](function(_0x5b1872){return _0x24666e(_0x5b1872);});default:return _0x20000c(msgResponse(_0x2d0a('0x1d5'),_0x2d0a('0x88'),_0x2d0a('0x1d6')));}}else{return _0x20000c(msgResponse(_0x2d0a('0x1d5'),'Failure',_0x2d0a('0x1d7')));}});};};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x1d8')]=function(_0x6b1bf8){var _0x6065ac=this;return function(_0x31f7c0){return new Promise(function(_0x209df6,_0x184164){_[_0x2d0a('0x14d')](_0x6b1bf8,_0x31f7c0[0x0]);if(checkGetDataPredictive(_0x31f7c0[0x0])){loggerPredictive[_0x2d0a('0x44')](JSON[_0x2d0a('0x6a')](_0x31f7c0[0x0]));if(_0x6b1bf8['dialPredictiveOptimization']===_0x2d0a('0x1c6')){return _0x6065ac['getVoiceQueueRtPauses'](_0x6b1bf8['id'])[_0x2d0a('0x3b')](function(_0x11b71d){var _0x5190be=_0x6b1bf8[_0x2d0a('0x1d9')]-_0x11b71d[0x0]['outboundQueuePauses'];var _0x2a85ee=_0x6b1bf8[_0x2d0a('0x1ca')]*0x3c;var _0x1523ee=_0x31f7c0[0x0][_0x2d0a('0x4d')]+_0x31f7c0[0x0]['predictiveIntervalAvgHoldtime'];var _0x55cc5b=(_0x31f7c0[0x0][_0x2d0a('0x1d1')]+_0x31f7c0[0x0][_0x2d0a('0x49')]+_0x31f7c0[0x0][_0x2d0a('0x4a')])/_0x31f7c0[0x0][_0x2d0a('0x1d2')];var _0x4313e6=_0x6b1bf8[_0x2d0a('0x1b7')]/0x64;_0x6b1bf8[_0x2d0a('0x1da')]=_0x11b71d[0x0][_0x2d0a('0x1db')]||0x0;_0x6b1bf8['predictiveIntervalHitRate']=_0x55cc5b>0x0?_0x55cc5b:0x1;return _0x6065ac['abandonmentRate'](_0x5190be,_0x2a85ee,_0x1523ee,_0x55cc5b,_0x4313e6);})[_0x2d0a('0x3b')](function(_0x528fa0){return _0x209df6(_0x528fa0);})[_0x2d0a('0x94')](function(_0x33ce81){return _0x184164(msgResponse(_0x2d0a('0x1dc'),_0x2d0a('0x88'),JSON[_0x2d0a('0x6a')](_0x33ce81)));});}if(_0x6b1bf8['dialPredictiveOptimization']===_0x2d0a('0x1d3')){return _0x6065ac[_0x2d0a('0x146')](_0x6b1bf8['id'])[_0x2d0a('0x3b')](function(_0x2a7ac3){var _0x5d1948=_0x6b1bf8['loggedIn']-_0x2a7ac3[0x0][_0x2d0a('0x1db')];var _0x1d1d63=_0x6b1bf8[_0x2d0a('0x1ca')]*0x3c;var _0x5e7344=_0x31f7c0[0x0]['predictiveIntervalAvgTalktime']+_0x31f7c0[0x0][_0x2d0a('0x4b')];var _0x15c795=(_0x31f7c0[0x0][_0x2d0a('0x1d1')]+_0x31f7c0[0x0][_0x2d0a('0x49')]+_0x31f7c0[0x0][_0x2d0a('0x4a')])/_0x31f7c0[0x0][_0x2d0a('0x1d2')];var _0x3c2a9d=_0x6b1bf8['dialPredictiveOptimizationPercentage']/0x64;_0x6b1bf8[_0x2d0a('0x1da')]=_0x2a7ac3[0x0][_0x2d0a('0x1db')]||0x0;_0x6b1bf8[_0x2d0a('0x1be')]=_0x15c795>0x0?_0x15c795:0x1;return _0x6065ac[_0x2d0a('0x1d4')](_0x5d1948,_0x1d1d63,_0x5e7344,_0x15c795,_0x3c2a9d);})['then'](function(_0x4f7710){return _0x209df6(_0x4f7710);})[_0x2d0a('0x94')](function(_0x595b83){return _0x184164(msgResponse(_0x2d0a('0x1dc'),_0x2d0a('0x88'),JSON[_0x2d0a('0x6a')](_0x595b83)));});}}else{return _0x184164(msgResponse(_0x2d0a('0x1d5'),_0x2d0a('0x88'),_0x2d0a('0x1d7')));}});};};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x1cc')]=function(_0x114e15){var _0x5e975d=this;return function(){var _0x2cbc3c=0x0;var _0x34606e=Math[_0x2d0a('0x1bc')](_0x114e15[_0x2d0a('0x54')]*0x3e8);if(_0x34606e>0x0){_0x34606e=_0x34606e<0x64?0x64:_0x34606e;loggerPredictive['info'](_0x114e15[_0x2d0a('0x41')],_0x2d0a('0x1dd'),_0x34606e,_0x2d0a('0x1de'));_0x114e15[_0x2d0a('0x5a')]=setInterval(function(){_0x5e975d[_0x2d0a('0x5a')](_0x114e15);loggerPredictiveCalls[_0x2d0a('0x44')](_0x2d0a('0x1df'),_0x2cbc3c+=0x1);},_0x34606e);}else{loggerPredictive[_0x2d0a('0x44')](_0x114e15[_0x2d0a('0x41')],_0x2d0a('0x1e0'));}};};Dialer['prototype'][_0x2d0a('0x1e1')]=function(_0x2d9208,_0x5e0cde){var _0x2686ea=this;return function(_0x1a3284){if(_[_0x2d0a('0x43')](_0x1a3284)){if(_['isNil'](_0x5e0cde['UserId'])||!_0x5e0cde['recallme']){if(_0x2d9208[_0x2d0a('0xa7')]==='booked'){_0x2d9208[_0x2d0a('0x6b')]=_[_0x2d0a('0x3c')](_0x2d9208[_0x2d0a('0x6b')])?!![]:_0x2d9208['queueStatusComplete'];var _0x1b06f9=uuid['v4']();_0x2686ea[_0x2d0a('0xe1')][_0x1b06f9]=new Action(_0x2d9208,_0x5e0cde,_0x1b06f9);loggerBooked[_0x2d0a('0x44')]('[booked][checkContactBlack]',_0x1b06f9,_0x2d0a('0x1e2'),JSON[_0x2d0a('0x6a')](_0x2d9208[_0x2d0a('0x6b')]),_0x2d0a('0x1e3'),_0x2d9208[_0x2d0a('0x41')]);if(_0x2d9208[_0x2d0a('0x6b')]){_0x2d9208['queueStatusComplete']=![];_0x2686ea[_0x2d0a('0x25')][_0x2686ea['actions'][_0x1b06f9][_0x2d0a('0xb4')]]=[];ami['Action']({'actionid':_0x1b06f9,'action':_0x2d0a('0x1e4'),'queue':_0x2d9208[_0x2d0a('0x41')]})[_0x2d0a('0x94')](function(){_0x2686ea[_0x2d0a('0xb7')](_0x2d9208);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x2686ea[_0x2d0a('0xe1')][_0x1b06f9][_0x2d0a('0xcf')],'ListId':_0x2686ea['actions'][_0x1b06f9][_0x2d0a('0xd0')],'VoiceQueueId':_0x2686ea[_0x2d0a('0xe1')][_0x1b06f9][_0x2d0a('0xd1')]||undefined,'CampaignId':_0x2686ea[_0x2d0a('0xe1')][_0x1b06f9]['CampaignId']||undefined})[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x1e5')));delete _0x2686ea[_0x2d0a('0xe1')][_0x1b06f9];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x2d9208['queueStatusComplete']),_0x2d0a('0x1e3'),_0x2d9208[_0x2d0a('0x41')]);_0x2686ea['updateOriginated'](_0x2d9208);hopperUtils[_0x2d0a('0xcc')]({'active':![],'ContactId':_0x2686ea[_0x2d0a('0xe1')][_0x1b06f9][_0x2d0a('0xcf')],'ListId':_0x2686ea['actions'][_0x1b06f9][_0x2d0a('0xd0')],'VoiceQueueId':_0x2686ea[_0x2d0a('0xe1')][_0x1b06f9][_0x2d0a('0xd1')]||undefined,'CampaignId':_0x2686ea['actions'][_0x1b06f9]['CampaignId']||undefined})['catch'](loggerCatch(_0x2d0a('0x1e5')));delete _0x2686ea[_0x2d0a('0xe1')][_0x1b06f9];}}else{return _0x2686ea[_0x2d0a('0x155')](_0x2d9208,_0x5e0cde);}}else{if(utils['getSeconds'](undefined,_0x5e0cde[_0x2d0a('0x1e6')])<_0x2d9208[_0x2d0a('0x1e7')]*0x3c){if(_0x5e0cde['Agent']&&!_0x5e0cde[_0x2d0a('0x13e')]['voicePause']){_0x2686ea[_0x2d0a('0x19')][_0x2d0a('0xee')](_0x5e0cde['id'])[_0x2d0a('0x17')](function(){_0x2686ea['updateOriginated'](_0x2d9208);});}else{hopperUtils[_0x2d0a('0x1e8')]({'active':![]},_0x5e0cde['id'],0x1)[_0x2d0a('0x17')](function(){_0x2686ea[_0x2d0a('0xb7')](_0x2d9208);});}}else{_0x2d9208[_0x2d0a('0x1e9')]+=0x1;_0x2686ea[_0x2d0a('0xb7')](_0x2d9208);if(_0x2d9208[_0x2d0a('0x1ea')]){hopperUtils[_0x2d0a('0xcc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e0cde[_0x2d0a('0xcf')],'ListId':_0x5e0cde['ListId'],'VoiceQueueId':_0x5e0cde[_0x2d0a('0xd1')]||undefined,'CampaignId':_0x5e0cde[_0x2d0a('0xd2')]||undefined})[_0x2d0a('0x94')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils['createHistory'](createObjHistory(_0x2d9208,_0x5e0cde,utils[_0x2d0a('0x6d')][_0x2d0a('0x1eb')],0x17,'RecallInQueue'))[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x1ec')));}else{_0x2686ea['saveInDb'](createObjHistory(_0x2d9208,_0x5e0cde,utils[_0x2d0a('0x6d')]['RECALL_TIMEOUT'],0x16,_0x2d0a('0x1ed')),_0x2d0a('0x1ee'),_0x2d0a('0x1ef'));}}}}else{_0x2d9208[_0x2d0a('0x1f0')]+=0x1;_0x2686ea['saveInDb'](createObjHistory(_0x2d9208,_0x5e0cde,utils[_0x2d0a('0x6d')][_0x2d0a('0x1f1')],0xd,_0x2d0a('0x1f2')),_0x2d0a('0x1f3'),_0x2d0a('0x1f4'));throw _0x2d0a('0x1f5');}};};Dialer[_0x2d0a('0x7b')]['handleIvr']=function(_0x467bd6){var _0x1a274f=this;var _0x4e956d=_0x467bd6[_0x2d0a('0x1f6')]-_0x467bd6[_0x2d0a('0x148')]-_0x467bd6[_0x2d0a('0x1f7')];emitCampaignSummary(_0x467bd6);if(_0x4e956d>0x0){if(_0x4e956d>this[_0x2d0a('0x1e')]){_0x4e956d=this[_0x2d0a('0x1e')];}_0x467bd6['temp']+=_0x4e956d;hopperUtils[_0x2d0a('0x1f8')](_0x467bd6['id'],_0x4e956d,_0x467bd6['dialOrderByScheduledAt'],_0x467bd6)['then'](function(_0x4237c5){_0x467bd6[_0x2d0a('0x1f7')]-=_0x4e956d;_0x467bd6[_0x2d0a('0x1f7')]=_0x467bd6['temp']>0x0?_0x467bd6[_0x2d0a('0x1f7')]:0x0;if(!utils[_0x2d0a('0x1f9')](_0x4237c5)){_0x467bd6['message']=utils[_0x2d0a('0x6d')][_0x2d0a('0x63')];logger[_0x2d0a('0x44')](_0x2d0a('0x1fa')+_0x467bd6[_0x2d0a('0x41')]);}else{_0x467bd6[_0x2d0a('0x148')]+=_0x4237c5['length'];_0x467bd6['message']=utils[_0x2d0a('0x6d')][_0x2d0a('0x1fb')];for(var _0x36341b=0x0;_0x36341b<_0x4237c5[_0x2d0a('0x13d')];_0x36341b+=0x1){_0x467bd6['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x4237c5[_0x36341b])||_['isNil'](_0x4237c5[_0x36341b][_0x2d0a('0x170')])||_['isNil'](_0x4237c5[_0x36341b][_0x2d0a('0x159')])){_0x1a274f[_0x2d0a('0x1fc')](_0x2d0a('0x1fd'),_0x467bd6,_0x4237c5[_0x36341b]);}else{hopperUtils[_0x2d0a('0x1fe')](_[_0x2d0a('0xeb')](_0x4237c5[_0x36341b],[_0x2d0a('0xd2'),_0x2d0a('0x159')]))[_0x2d0a('0x3b')](_0x1a274f[_0x2d0a('0x1e1')](_0x467bd6,_0x4237c5[_0x36341b]))[_0x2d0a('0x94')](_0x1a274f[_0x2d0a('0x14b')](_0x2d0a('0x1ff'),_0x467bd6));}}}})[_0x2d0a('0x94')](loggerGetContactDialer('[getContactCampaign2]',_0x467bd6,_0x4e956d));}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0xa9')]=function(_0x4c688a,_0x53f19e){var _0x5db816=this;var _0xe3bd43=[];if(_0x53f19e<0x1||_0x4c688a[_0x2d0a('0xa7')]==='booked'){_0x53f19e=0x1;}var _0x4b67e5=Math['floor'](_0x4c688a[_0x2d0a('0x12f')]*_0x53f19e)-_0x4c688a['originated']-_0x4c688a['temp'];if(_0x4c688a[_0x2d0a('0x200')]>0x0){var _0x5e0e86=_0x4c688a[_0x2d0a('0x200')]-_0x4c688a['originated']-_0x4c688a[_0x2d0a('0x131')]-_0x4c688a['temp']-_0x4c688a[_0x2d0a('0x132')];if(_0x4b67e5>_0x5e0e86){_0x4b67e5=_0x5e0e86;}}if(_0x4b67e5>0x0){if(_0x4c688a[_0x2d0a('0xa7')]==='booked'){_0x4b67e5=0x1;}if(_0x4b67e5>this['maxNumberOriginate']){_0x4b67e5=this[_0x2d0a('0x1e')];}_0x4c688a[_0x2d0a('0x1f7')]+=_0x4b67e5;for(var _0x27efe7 in this[_0x2d0a('0x1c')]){if(typeof this[_0x2d0a('0x1c')][_0x27efe7]!==_0x2d0a('0x143')){if(this[_0x2d0a('0x1c')][_0x27efe7][_0x2d0a('0x64')]===_0x2d0a('0x201')&&this[_0x2d0a('0x1c')][_0x27efe7]['status']===_0x2d0a('0x202')){_0xe3bd43[_0x2d0a('0xea')](this[_0x2d0a('0x1c')][_0x27efe7]['id']);}}}hopperUtils[_0x2d0a('0x203')](_0x4c688a,_0xe3bd43,_0x4b67e5)[_0x2d0a('0x3b')](function(_0x30d503){_0x4c688a['temp']-=_0x4b67e5;_0x4c688a[_0x2d0a('0x1f7')]=_0x4c688a[_0x2d0a('0x1f7')]>0x0?_0x4c688a[_0x2d0a('0x1f7')]:0x0;if(!utils[_0x2d0a('0x1f9')](_0x30d503)){hopperUtils[_0x2d0a('0x204')](_0x4c688a)[_0x2d0a('0x3b')](sendMessageReschedule(_0x4c688a))[_0x2d0a('0x94')](loggerCatch(_0x2d0a('0x205')));}else{_0x4c688a[_0x2d0a('0x148')]+=_0x30d503[_0x2d0a('0x13d')];_0x4c688a[_0x2d0a('0x5f')]=_0x4c688a[_0x2d0a('0xa7')]===_0x2d0a('0x8')?utils[_0x2d0a('0x6d')]['ACTIVE']:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x1dd68f=0x0;_0x1dd68f<_0x30d503[_0x2d0a('0x13d')];_0x1dd68f+=0x1){if(_[_0x2d0a('0xe6')](_0x30d503[_0x1dd68f])||_[_0x2d0a('0xe6')](_0x30d503[_0x1dd68f][_0x2d0a('0x170')])||_[_0x2d0a('0xe6')](_0x30d503[_0x1dd68f][_0x2d0a('0x159')])){_0x5db816['emptyContact'](_0x2d0a('0x1fd'),_0x4c688a,_0x30d503[_0x1dd68f]);}else{hopperUtils[_0x2d0a('0x206')](_[_0x2d0a('0xeb')](_0x30d503[_0x1dd68f],['VoiceQueueId',_0x2d0a('0x159')]))[_0x2d0a('0x3b')](_0x5db816[_0x2d0a('0x1e1')](_0x4c688a,_0x30d503[_0x1dd68f]))[_0x2d0a('0x94')](_0x5db816[_0x2d0a('0x14b')](_0x2d0a('0x1fd'),_0x4c688a));}}}})[_0x2d0a('0x94')](loggerGetContactDialer(_0x2d0a('0x207'),_0x4c688a,_0x4b67e5));}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x5a')]=function(_0x456585){if(_0x456585['dialLimitQueue']>0x0){var _0x21453b=_0x456585[_0x2d0a('0x200')]-_0x456585[_0x2d0a('0x148')]-_0x456585[_0x2d0a('0x131')];if(_0x21453b>0x0){this[_0x2d0a('0x208')](_0x456585);}else{loggerPredictiveCalls[_0x2d0a('0x44')](_0x2d0a('0x209'));}}else{this[_0x2d0a('0x208')](_0x456585);}};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x208')]=function(_0x47e564){var _0x3807de=this;var _0x4c2092=[];_0x47e564[_0x2d0a('0x148')]+=0x1;for(var _0x21a6f9 in this[_0x2d0a('0x1c')]){if(typeof this[_0x2d0a('0x1c')][_0x21a6f9]!==_0x2d0a('0x143')){if(this[_0x2d0a('0x1c')][_0x21a6f9][_0x2d0a('0x64')]===_0x2d0a('0x201')&&this[_0x2d0a('0x1c')][_0x21a6f9]['status']===_0x2d0a('0x202')){_0x4c2092[_0x2d0a('0xea')](this[_0x2d0a('0x1c')][_0x21a6f9]['id']);}}}return this[_0x2d0a('0x203')](_0x47e564['id'],_0x4c2092,0x1,_0x47e564[_0x2d0a('0x20a')],_0x47e564)['then'](function(_0x3dbfa5){if(!utils[_0x2d0a('0x1f9')](_0x3dbfa5)){utils['checkContactLowerLimitOriginate'](_0x47e564,0x1,0x0);return hopperUtils[_0x2d0a('0x204')](_0x47e564)[_0x2d0a('0x3b')](sendMessageReschedule(_0x47e564))['catch'](loggerCatch(_0x2d0a('0x205')));}else{_0x47e564[_0x2d0a('0x5f')]=utils[_0x2d0a('0x6d')][_0x2d0a('0x1fb')];if(_[_0x2d0a('0xe6')](_0x3dbfa5[0x0])||_['isNil'](_0x3dbfa5[0x0][_0x2d0a('0x170')])||_[_0x2d0a('0xe6')](_0x3dbfa5[0x0]['phone'])){_0x3807de[_0x2d0a('0x1fc')]('[actionOriginate]\x20',_0x47e564,_0x3dbfa5[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x2d0a('0xeb')](_0x3dbfa5[0x0],['VoiceQueueId',_0x2d0a('0x159')]))['then'](_0x3807de[_0x2d0a('0x1e1')](_0x47e564,_0x3dbfa5[0x0]))['catch'](_0x3807de[_0x2d0a('0x14b')](_0x2d0a('0x20b'),_0x47e564));}}})[_0x2d0a('0x94')](loggerGetContactDialer('[getContactDialerPredictive]',_0x47e564,0x1));};Dialer[_0x2d0a('0x7b')][_0x2d0a('0x20c')]=function(_0x3afc10,_0x24b69e,_0x3d13d8,_0x3a9521,_0x4500c1,_0x377cfb){loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x20d'));loggerPredictive['info'](_0x2d0a('0x20e'),_0x3afc10);loggerPredictive['info'](_0x2d0a('0x20f'),_0x24b69e);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x210'),_0x3d13d8);loggerPredictive[_0x2d0a('0x44')]('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',_0x3a9521);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x211'),_0x4500c1);loggerPredictive[_0x2d0a('0x44')]('---------------------------');return new Promise(function(_0x4beb97,_0x5362f8){if(_0x3afc10<=0x0||isNaN(_0x3afc10)){return _0x5362f8(msgResponse(_0x2d0a('0x212'),_0x2d0a('0x7a'),_0x2d0a('0x213')+_0x3afc10));}if(_0x3d13d8<=0x0||isNaN(_0x3d13d8)){return _0x5362f8(msgResponse('[abandonmentRate]',_0x2d0a('0x7a'),_0x2d0a('0x214')+_0x3d13d8));}if(_0x3a9521<=0x0||isNaN(_0x3a9521)){return _0x5362f8(msgResponse(_0x2d0a('0x212'),_0x2d0a('0x7a'),_0x2d0a('0x215')+_0x3a9521));}if(_0x24b69e<=0x0||isNaN(_0x24b69e)){return _0x5362f8(msgResponse('[abandonmentRate]',_0x2d0a('0x7a'),'interval\x20=\x20'+_0x24b69e));}if(_0x4500c1<=0x0||isNaN(_0x4500c1)){return _0x5362f8(msgResponse(_0x2d0a('0x212'),_0x2d0a('0x7a'),_0x2d0a('0x216')+_0x4500c1));}_0x377cfb=_0x377cfb||0x0;var _0x1fafd6=0x1/_0x3d13d8;var _0x368ad2=0x0;var _0x392af0=0x0;var _0x385722=0x0;var _0x5abf84=0x0;for(var _0x4c0957=0x0;_0x385722<_0x4500c1;_0x4c0957+=0x1){_0x392af0=_0x4c0957/_0x24b69e;_0x368ad2=(_0x3a9521*_0x392af0+_0x377cfb)/_0x1fafd6;_0x385722=utils['erlangb'](_0x368ad2,_0x3afc10);_0x5abf84=_0x368ad2/_0x3afc10*(0x1-utils['erlangb'](_0x368ad2,_0x3afc10));}return _0x4beb97({'erlangCalls':_0x4c0957,'erlangCallToSecond':_0x24b69e/_0x4c0957,'erlangAbandonmentRate':_0x385722,'erlangBusyFactor':_0x5abf84});});};Dialer['prototype'][_0x2d0a('0x1d4')]=function(_0x175b5b,_0x2224a3,_0x325465,_0x24ad26,_0x10b4b7,_0x2a0216){loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x217'));loggerPredictive['info']('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',_0x175b5b);loggerPredictive[_0x2d0a('0x44')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2224a3);loggerPredictive[_0x2d0a('0x44')]('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',_0x325465);loggerPredictive['info']('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',_0x24ad26);loggerPredictive[_0x2d0a('0x44')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10b4b7);loggerPredictive[_0x2d0a('0x44')](_0x2d0a('0x4e'));return new Promise(function(_0x34000c,_0x493aae){if(_0x175b5b<=0x0||isNaN(_0x175b5b)){return _0x493aae(msgResponse(_0x2d0a('0x218'),_0x2d0a('0x7a'),'m\x20=\x20'+_0x175b5b));}if(_0x325465<=0x0||isNaN(_0x325465)){return _0x493aae(msgResponse('[busyFactor]',_0x2d0a('0x7a'),_0x2d0a('0x214')+_0x325465));}if(_0x24ad26<=0x0||isNaN(_0x24ad26)){return _0x493aae(msgResponse(_0x2d0a('0x218'),'Error','p\x20=\x20'+_0x24ad26));}if(_0x2224a3<=0x0||isNaN(_0x2224a3)){return _0x493aae(msgResponse(_0x2d0a('0x218'),'Error',_0x2d0a('0x219')+_0x2224a3));}if(_0x10b4b7<=0x0||isNaN(_0x10b4b7)){return _0x493aae(msgResponse(_0x2d0a('0x218'),_0x2d0a('0x7a'),'Umin\x20=\x20'+_0x10b4b7));}_0x2a0216=_0x2a0216||0x0;var _0x1678ca=0x1/_0x325465;var _0x2d4988=0x0;var _0xf7bc96=0x0;var _0x1d9406=0x0;var _0x4943f0=0x0;for(var _0x43de84=0x0;_0x4943f0<_0x10b4b7;_0x43de84+=0x1){_0xf7bc96=_0x43de84/_0x2224a3;_0x2d4988=(_0x24ad26*_0xf7bc96+_0x2a0216)/_0x1678ca;_0x1d9406=utils['erlangb'](_0x2d4988,_0x175b5b);_0x4943f0=_0x2d4988/_0x175b5b*(0x1-utils[_0x2d0a('0x21a')](_0x2d4988,_0x175b5b));}return _0x34000c({'erlangCalls':_0x43de84,'erlangCallToSecond':_0x2224a3/_0x43de84,'erlangAbandonmentRate':_0x1d9406,'erlangBusyFactor':_0x4943f0});});};module[_0x2d0a('0x21b')]=Dialer; \ No newline at end of file +var _0x7ff1=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','buildObj','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','outboundRejectCallsDay','AgentReject','reason\x2020\x20agentreject','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','agentBusyFactor','loggedIn','[CatchErlangB]','check\x20failure','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','reachable','getContactDialer','countReScheduled','[countReScheduled]\x20','tryOriginatePredictive','[actionOriginatePredictive]\x20','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/setting','./models/action','./models/history','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','then','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','---------------------------','getSeconds','startProgressive','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','message','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','Interval','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Failure','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','content','catch','indexOf','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTimeIntervals','dialTimezone','launchHandleIvr','[syncCampaigns]','predictive','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','dialGlobalInterval','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','TIMEOUT','dialQueueProject2','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ListId','VoiceQueueId','[rescheduleContact][Drop]','Drop','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','CampaignId','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','isNil','locked','paused','agents','stateinterface','merge','syncQueueStatusComplete','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','contactAgent-idHopper:\x20','[booked][unlock]','ContactId','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','amdstatus','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countmachineretry','reason\x2019\x20machine....','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-CAMPAIGNID','Contact','tags','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','trim','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialMachineRetryFrequency'];(function(_0x2ac407,_0x4892c6){var _0x3d55be=function(_0x31a0d1){while(--_0x31a0d1){_0x2ac407['push'](_0x2ac407['shift']());}};_0x3d55be(++_0x4892c6);}(_0x7ff1,0x80));var _0x17ff=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x7ff1[_0x5ca353];return _0x4f2fe5;};'use strict';var util=require(_0x17ff('0x0'));var _=require(_0x17ff('0x1'));var uuid=require(_0x17ff('0x2'));var moment=require(_0x17ff('0x3'));var rr=require('rr');var Redis=require(_0x17ff('0x4'));var utils=require(_0x17ff('0x5'));var hopperUtils=require('./utils/hopper');var ut=require('../preview/util/util');var config=require(_0x17ff('0x6'));var logger=require(_0x17ff('0x7'))(_0x17ff('0x8'));var loggerBooked=require(_0x17ff('0x7'))(_0x17ff('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x17ff('0x7'))(_0x17ff('0xa'));var loggerSyncQueueSummary=require(_0x17ff('0x7'))('syncQueueSummary');var ami=require(_0x17ff('0xb'));config[_0x17ff('0xc')]=_[_0x17ff('0xd')](config[_0x17ff('0xc')],{'host':_0x17ff('0xe'),'port':0x18eb});var io=require(_0x17ff('0xf'))(new Redis(config[_0x17ff('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x17ff('0x10'));var Interval=require('../rpc/interval');var Action=require(_0x17ff('0x11'));var History=require(_0x17ff('0x12'));var Final=require('./models/final');var AgentComplete=require(_0x17ff('0x13'));var QueueCallerAbandon=require(_0x17ff('0x14'));var Hangup=require(_0x17ff('0x15'));var ipAgi=process[_0x17ff('0x16')][_0x17ff('0x17')]||_0x17ff('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x17ff('0x19')]['enqueue']=function(_0x4f83f3){this[_0x17ff('0x1a')]=this['tail']?this[_0x17ff('0x1a')][_0x17ff('0x1b')](_0x4f83f3):_0x4f83f3();};function Dialer(_0x29a843,_0x1941ed){this[_0x17ff('0x1c')]=new Sequence();this[_0x17ff('0x1d')]=_0x1941ed;this[_0x17ff('0x1e')]=_0x29a843[_0x17ff('0x1e')];this[_0x17ff('0x1f')]=_0x29a843['campaigns'];this['agents']=_0x29a843['agents'];this[_0x17ff('0x20')]=_0x29a843['trunks'];this[_0x17ff('0x21')]=config[_0x17ff('0x21')]||0x2;this['channels']={};this[_0x17ff('0x22')]={};this[_0x17ff('0x23')]={};this[_0x17ff('0x24')]={};this[_0x17ff('0x25')]={};this[_0x17ff('0x26')]={};this['startProgressive']={};this[_0x17ff('0x27')]={};this[_0x17ff('0x28')]={};this[_0x17ff('0x29')]={};this[_0x17ff('0x2a')]={};ami['on'](_0x17ff('0x2b'),this['syncAgentConnect'][_0x17ff('0x2c')](this));ami['on'](_0x17ff('0x2d'),this[_0x17ff('0x2e')][_0x17ff('0x2c')](this));ami['on']('originateresponse',this[_0x17ff('0x2f')]['bind'](this));ami['on'](_0x17ff('0x30'),this['syncAgentComplete'][_0x17ff('0x2c')](this));ami['on']('custom:queuesummary',this[_0x17ff('0x31')][_0x17ff('0x2c')](this));ami['on'](_0x17ff('0x32'),this[_0x17ff('0x33')]['bind'](this));ami['on'](_0x17ff('0x34'),this[_0x17ff('0x35')][_0x17ff('0x2c')](this));ami['on'](_0x17ff('0x36'),this['syncNewExten'][_0x17ff('0x2c')](this));ami['on']('varset',this[_0x17ff('0x37')][_0x17ff('0x2c')](this));ami['on']('queuemember',this[_0x17ff('0x38')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x17ff('0x2c')](this));this[_0x17ff('0x39')]();this[_0x17ff('0x3a')]();RpcSetting['getSettings']()[_0x17ff('0x3b')](function(_0x4c78cb){previewRecallmeReminderInterval=_0x4c78cb['previewRecallmeReminderInterval'];});}function isNotNull(_0x53aee8){return _0x53aee8!==null&&!_[_0x17ff('0x3c')](_0x53aee8);}function msgResponse(_0x24a39f,_0x14c2c3,_0x3cd575){return{'action':_0x24a39f,'response':_0x14c2c3,'message':_0x3cd575,'stack':_0x3cd575};}function emit(_0x263c8d,_0x5a4ef9,_0x4011c3){io['to'](_0x263c8d)[_0x17ff('0x3d')](_0x5a4ef9,_0x4011c3);}function emitOutboundVoiceQueueSummary(_0x1a393c){if(_0x1a393c[_0x17ff('0x3e')]==='outbound'){logger[_0x17ff('0x3f')](_0x17ff('0x40'),util['inspect'](_0x1a393c,{'showHidden':![],'depth':null}));emit(util[_0x17ff('0x41')](_0x17ff('0x42'),_0x1a393c[_0x17ff('0x43')]),'voice_queue:save',_0x1a393c);}}function checkGetDataPredictive(_0x1025b7){if(isNotNull(_0x1025b7)&&!_[_0x17ff('0x44')](_0x1025b7)){loggerPredictive[_0x17ff('0x45')](_0x17ff('0x46'));loggerPredictive[_0x17ff('0x45')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1025b7[_0x17ff('0x47')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x48'),_0x1025b7[_0x17ff('0x49')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x4a'),_0x1025b7[_0x17ff('0x4b')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x4c'),_0x1025b7[_0x17ff('0x4d')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x4e'),_0x1025b7['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x4f'),_0x1025b7[_0x17ff('0x50')]);loggerPredictive[_0x17ff('0x45')]('---------------------------');if(_0x1025b7[_0x17ff('0x47')]>0x0){if(!_[_0x17ff('0x3c')](_0x1025b7[_0x17ff('0x50')])&&_0x1025b7[_0x17ff('0x50')]>0x0){return!![];}loggerPredictive[_0x17ff('0x45')](_0x17ff('0x51'));if(!_[_0x17ff('0x3c')](_0x1025b7[_0x17ff('0x52')])&&_0x1025b7[_0x17ff('0x52')]>0x0){return!![];}loggerPredictive['info'](_0x17ff('0x53'));}else{loggerPredictive['info'](_0x17ff('0x54'));}}else{loggerPredictive['info'](_0x17ff('0x55'));}return![];}function mergeDataErlangB(_0x14fbee){return function(_0xcd6bb6){loggerPredictive[_0x17ff('0x45')](_0x17ff('0x56'));loggerPredictive['info'](_0x17ff('0x57'),_0xcd6bb6[_0x17ff('0x58')]);loggerPredictive[_0x17ff('0x45')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcd6bb6[_0x17ff('0x59')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x5a'),_0xcd6bb6[_0x17ff('0x5b')]);loggerPredictive[_0x17ff('0x45')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcd6bb6[_0x17ff('0x5c')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x5a'),_0xcd6bb6[_0x17ff('0x5b')]);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x5d'));_['merge'](_0x14fbee,_0xcd6bb6);};}function ifInterval(_0x3f41ae,_0x5622f3){if(_['isUndefined'](_0x5622f3)){return![];}return utils[_0x17ff('0x5e')](undefined,_0x5622f3)<_0x3f41ae*0x3c;}function clearPredictiveAttributes(_0x57c64a){if(_0x57c64a[_0x17ff('0x5f')]){_0x57c64a[_0x17ff('0x5f')]=undefined;loggerPredictive['debug'](_0x57c64a[_0x17ff('0x43')],_0x17ff('0x60'));}if(_0x57c64a[_0x17ff('0x26')]){_0x57c64a[_0x17ff('0x26')]=undefined;loggerPredictive[_0x17ff('0x3f')](_0x57c64a[_0x17ff('0x43')],'startPredictive\x20value\x20cleared');}if(_0x57c64a[_0x17ff('0x61')]){clearInterval(_0x57c64a[_0x17ff('0x61')]);_0x57c64a[_0x17ff('0x61')]=undefined;loggerPredictive[_0x17ff('0x3f')](_0x57c64a[_0x17ff('0x43')],_0x17ff('0x62'));}}function loggerCatchPredictive(_0xd51bf8,_0x5ca41d){return function(_0x466b04){loggerPredictive[_0x17ff('0x63')](_0x5ca41d[_0x17ff('0x43')],_0xd51bf8);loggerPredictive[_0x17ff('0x63')](_0x466b04[_0x17ff('0x64')]);clearPredictiveAttributes(_0x5ca41d);};}function loggerCatch(_0x4250c1){return function(_0x5f1f51){logger[_0x17ff('0x63')](_0x4250c1,util[_0x17ff('0x65')](_0x5f1f51,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x17a7a4,_0x5a7438,_0x1d6599){return function(_0xc267b2){utils[_0x17ff('0x66')](_0x5a7438,_0x1d6599,0x0);logger['error'](_0x17a7a4,util['inspect'](_0xc267b2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x54a315){return function(_0x4c9a54){if(isNotNull(_0x4c9a54)&&isNotNull(_0x4c9a54[0x0])){if(_0x4c9a54[0x0][_0x17ff('0x67')]>0x0){_0x54a315['message']=utils[_0x17ff('0x68')][_0x17ff('0x69')];logger[_0x17ff('0x45')]('[getContactDialer2][ReScheduled]'+_0x54a315[_0x17ff('0x43')],_0x4c9a54[0x0][_0x17ff('0x67')],'contacts');}else{_0x54a315['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x17ff('0x45')]('[getContactDialer2][Empty]'+_0x54a315[_0x17ff('0x43')]);}}};}function createObjHistory(_0x3ec221,_0x303767,_0x350f33,_0x506df2,_0x4dfa73){_0x3ec221[_0x17ff('0x6a')]=_0x350f33;var _0x51a51a=new Action(_0x3ec221,_0x303767);var _0x312865=new History(_0x51a51a);_0x312865[_0x17ff('0x6b')]=_0x506df2;_0x312865[_0x17ff('0x6c')]=_0x4dfa73;_0x312865[_0x17ff('0x6d')]=_0x51a51a[_0x17ff('0x6e')];return _0x312865;}function unlockQueueStatus(_0x5049bb,_0x58d88d){setTimeout(function(){if(_[_0x17ff('0x3c')](_0x5049bb[_0x17ff('0x6f')])){loggerBooked[_0x17ff('0x63')](_0x17ff('0x70'),_0x58d88d);}_0x5049bb[_0x17ff('0x6f')]=!![];loggerBooked[_0x17ff('0x45')](_0x17ff('0x71'),_0x58d88d,JSON[_0x17ff('0x72')](_[_0x17ff('0x73')](_0x5049bb,[_0x17ff('0x43'),_0x17ff('0x6f')])));},0x1f3);}function checkInterval(_0x5801a3){return function(){if(!isNotNull(_0x5801a3['Interval'])){_0x5801a3[_0x17ff('0x6a')]=utils['CAMPAIGN_STATUS'][_0x17ff('0x74')];throw _0x5801a3['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x5801a3[_0x17ff('0x75')]['Intervals'])){_0x5801a3[_0x17ff('0x6a')]=utils[_0x17ff('0x68')]['NULL_INTERVAL'];throw _0x5801a3['name']+_0x17ff('0x76');}if(!isNotNull(_[_0x17ff('0x44')](_0x5801a3['Interval'][_0x17ff('0x77')]))){_0x5801a3['message']=utils[_0x17ff('0x68')]['NULL_INTERVAL'];throw _0x5801a3[_0x17ff('0x43')]+_0x17ff('0x76');}};}function checkIsIVRCampaignActive(_0x1d0f7e){return function(){if(!utils[_0x17ff('0x78')](_0x1d0f7e)){_0x1d0f7e[_0x17ff('0x6a')]=utils[_0x17ff('0x68')][_0x17ff('0x79')];throw _0x1d0f7e[_0x17ff('0x43')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x20627f){if(utils[_0x17ff('0x7a')](_0x20627f)){emit(util[_0x17ff('0x41')](_0x17ff('0x7b'),_0x20627f['name']),'campaign:save',_0x20627f);}}function loggerCatchQueueSummary(_0x373dfe,_0x156443){return function(_0x584a00){clearPredictiveAttributes(_0x156443);emitCampaignSummary(_0x156443);loggerSyncQueueSummary[_0x17ff('0x3f')](_0x373dfe,util[_0x17ff('0x65')](_0x584a00,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4f1ada){if(_0x4f1ada[_0x17ff('0x7c')]){if(_0x4f1ada[_0x17ff('0x7d')]===0x0){_0x4f1ada['sendMessageOneNotActive']=![];_0x4f1ada[_0x17ff('0x6a')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x17ff('0x3f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4f1ada[_0x17ff('0x43')],'is\x20not\x20active');}else{_0x4f1ada[_0x17ff('0x6a')]=utils['CAMPAIGN_STATUS'][_0x17ff('0x7e')];loggerSyncQueueSummary[_0x17ff('0x3f')](_0x17ff('0x7f'),_0x4f1ada[_0x17ff('0x43')],'is\x20disactive');}emitCampaignSummary(_0x4f1ada);}}function myreject(_0x55a60e){return function(_0x4878c6){return _0x55a60e(msgResponse(_0x17ff('0x80'),_0x17ff('0x81'),JSON['stringify'](_0x4878c6)));};}Dialer[_0x17ff('0x19')][_0x17ff('0x82')]=function(_0x25aa5b){return!_[_0x17ff('0x3c')](_0x25aa5b)&&_0x25aa5b&&!_[_0x17ff('0x3c')](_0x25aa5b[_0x17ff('0x43')])&&!_[_0x17ff('0x3c')](_0x25aa5b[_0x17ff('0x83')])&&_0x25aa5b['active']&&(this[_0x17ff('0x20')][util[_0x17ff('0x41')](_0x17ff('0x84'),_0x25aa5b[_0x17ff('0x43')])][_0x17ff('0x85')]==='reachable'||this[_0x17ff('0x20')][util[_0x17ff('0x41')](_0x17ff('0x84'),_0x25aa5b['name'])]['status']==='unmonitored');};Dialer['prototype']['checkIsTrunkReachable']=function(_0x3c523f){var _0x35d07e=this;return function(){if(!_0x35d07e['isTrunkReachable'](_0x3c523f[_0x17ff('0x86')])){if(!_0x35d07e['isTrunkReachable'](_0x3c523f[_0x17ff('0x87')])){_0x3c523f[_0x17ff('0x6a')]=utils[_0x17ff('0x68')][_0x17ff('0x88')];throw _0x3c523f['name']+_0x17ff('0x89');}}};};Dialer['prototype'][_0x17ff('0x8a')]=function(_0x29f93c,_0x496fdc,_0x10ea0f,_0x4e82d5){var _0x262e9e=this;return function(){var _0x24ae74=!![];return _0x262e9e[_0x17ff('0x8b')](_0x29f93c,_0x496fdc,_0x10ea0f,_0x4e82d5,_0x24ae74);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x3197fd,_0x56a203,_0x291da2,_0x11e508){var _0x4356ea=this;return function(){var _0x598bf7=![];return _0x4356ea[_0x17ff('0x8b')](_0x3197fd[_0x17ff('0x77')],_0x56a203,_0x291da2,_0x11e508,_0x598bf7);};};Dialer[_0x17ff('0x19')][_0x17ff('0x8b')]=function(_0x35acf0,_0x1f5e5f,_0x277187,_0x119648,_0x3512b2){var _0x4e07f1=[];return new Promise(function(_0x6d9d29,_0x57e692){if(!isNotNull(_0x35acf0)){_0x119648[_0x17ff('0x6a')]=utils[_0x17ff('0x68')][_0x17ff('0x74')];return _0x57e692(msgResponse('ifTime',_0x17ff('0x8c'),_0x277187+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x17ff('0x44')](_0x35acf0)){_0x119648['message']=utils[_0x17ff('0x68')][_0x17ff('0x8d')];return _0x57e692(msgResponse(_0x17ff('0x8e'),_0x17ff('0x8c'),_0x277187+_0x17ff('0x8f')));}if(_0x1f5e5f&&_[_0x17ff('0x3c')](config[_0x17ff('0x90')][_0x1f5e5f])){_0x119648[_0x17ff('0x6a')]=utils[_0x17ff('0x68')][_0x17ff('0x91')];return _0x57e692(msgResponse(_0x17ff('0x8e'),_0x17ff('0x8c'),_0x277187+_0x17ff('0x92')+_0x1f5e5f));}if(_[_0x17ff('0x93')](_0x35acf0)){for(var _0x289ebd=0x0;_0x289ebd<_0x35acf0[_0x17ff('0x94')];_0x289ebd+=0x1){_0x4e07f1[_0x17ff('0x95')](ami[_0x17ff('0x96')]({'action':_0x17ff('0x97'),'command':util[_0x17ff('0x41')](_0x17ff('0x98'),_0x35acf0[_0x289ebd]['interval'],!_[_0x17ff('0x3c')](config[_0x17ff('0x90')][_0x1f5e5f])?_0x1f5e5f:'')})[_0x17ff('0x3b')](function(_0x169742){return _0x169742[_0x17ff('0x99')]['indexOf']('true')>=0x0;})[_0x17ff('0x9a')](myreject(_0x57e692)));}}else{_0x4e07f1[_0x17ff('0x95')](ami['Action']({'action':_0x17ff('0x97'),'command':util['format'](_0x17ff('0x98'),_0x35acf0,!_[_0x17ff('0x3c')](config[_0x17ff('0x90')][_0x1f5e5f])?_0x1f5e5f:'')})[_0x17ff('0x3b')](function(_0x37a837){return _0x37a837['content'][_0x17ff('0x9b')]('true')>=0x0;})[_0x17ff('0x9a')](myreject(_0x57e692)));}Promise[_0x17ff('0x9c')](_0x4e07f1)[_0x17ff('0x3b')](function(_0x3fbaf9){var _0x52f2f5=_[_0x17ff('0x9d')](_0x3fbaf9);if(_0x52f2f5){return _0x6d9d29(_0x52f2f5);}else{_0x119648[_0x17ff('0x6a')]=_0x3512b2?utils[_0x17ff('0x68')][_0x17ff('0x9e')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x57e692(msgResponse(_0x17ff('0x9f'),_0x17ff('0x8c'),_0x17ff('0xa0')+_0x3512b2+'\x20'+_0x277187+'\x20Interval\x20is\x20overtime:\x20'+util[_0x17ff('0x65')](_0x35acf0,{'showHidden':![],'depth':null})+_0x17ff('0xa1')+_0x1f5e5f));}})['catch'](function(_0x583518){return _0x57e692(msgResponse(_0x17ff('0x8e'),_0x17ff('0x8c'),JSON[_0x17ff('0x72')](_0x583518)));});});};Dialer['prototype'][_0x17ff('0x39')]=function(){var _0x5060ab=this;return cmHopper[_0x17ff('0xa2')]({'active':![]},{'where':{'active':!![]}})[_0x17ff('0x3b')](function(){setInterval(function(){_0x5060ab[_0x17ff('0xa3')]();},0x3e8);});};Dialer[_0x17ff('0x19')][_0x17ff('0xa3')]=function(){var _0x2a4f59=this;var _0x216caa;for(var _0xd13f3b in this[_0x17ff('0x1f')]){if(typeof this[_0x17ff('0x1f')][_0xd13f3b]!==_0x17ff('0xa4')){_0x216caa=this[_0x17ff('0x1f')][_0xd13f3b];if(utils[_0x17ff('0x7a')](_0x216caa)&&utils['isIVRCampaignActive'](_0x216caa)){_0x216caa[_0x17ff('0x7c')]=!![];Promise[_0x17ff('0xa5')]()[_0x17ff('0x3b')](checkIsIVRCampaignActive(_0x216caa))[_0x17ff('0x3b')](checkInterval(_0x216caa))[_0x17ff('0x3b')](_0x2a4f59[_0x17ff('0xa6')](_0x216caa))[_0x17ff('0x3b')](_0x2a4f59[_0x17ff('0x8a')](_0x216caa['dialGlobalInterval'],_0x216caa['dialTimezone'],_0x216caa[_0x17ff('0x43')],_0x216caa))[_0x17ff('0x3b')](_0x2a4f59[_0x17ff('0xa7')](_0x216caa[_0x17ff('0x75')],_0x216caa[_0x17ff('0xa8')],_0x216caa[_0x17ff('0x43')],_0x216caa))['then'](_0x2a4f59[_0x17ff('0xa9')](_0x216caa))['catch'](loggerCatchQueueSummary(_0x17ff('0xaa'),_0x216caa));}else{notSendMessagesCampaign(_0x216caa);}}}};Dialer[_0x17ff('0x19')]['checkDialMethod']=function(_0x10b22e){if(_0x10b22e['dialMethod']!==_0x17ff('0xab')){clearPredictiveAttributes(_0x10b22e);}switch(_0x10b22e[_0x17ff('0xac')]){case _0x17ff('0xad'):this['handlePower'](_0x10b22e,0x1);break;case _0x17ff('0xae'):this[_0x17ff('0xaf')](_0x10b22e,_0x10b22e[_0x17ff('0xb0')]);break;case _0x17ff('0xab'):this[_0x17ff('0xab')](_0x10b22e);break;case _0x17ff('0x9'):this[_0x17ff('0xaf')](_0x10b22e,0x1);break;default:logger[_0x17ff('0x63')](_0x17ff('0xb1'),_0x10b22e[_0x17ff('0x43')],'method\x20not\x20recognized');}};Dialer[_0x17ff('0x19')][_0x17ff('0x8e')]=function(_0xc9a92b,_0x671c07){var _0x4a9d26=_0xc9a92b[_0x17ff('0xa8')];var _0x3e404c=_0x671c07?_0xc9a92b[_0x17ff('0xb2')]:_0xc9a92b[_0x17ff('0x75')][_0x17ff('0x77')];logger['silly'](_0x17ff('0xb3'),_0x3e404c,_0x4a9d26,_0xc9a92b[_0x17ff('0x43')],util[_0x17ff('0x41')](_0x17ff('0xb4'),_0xc9a92b['name'],_0xc9a92b['id']));var _0x11af91=null;return Interval[_0x17ff('0xb5')](_0x3e404c,_0x4a9d26)[_0x17ff('0x3b')](function(_0x525a60){if(_0x525a60===!![]){return _0x525a60;}else{_0xc9a92b[_0x17ff('0x6a')]=_0x671c07?utils['CAMPAIGN_STATUS'][_0x17ff('0x9e')]:utils[_0x17ff('0x68')][_0x17ff('0xb6')];_0x11af91=msgResponse('[ifTime][promiseAll]',_0x17ff('0x8c'),_0x17ff('0xa0')+_0x671c07+'\x20'+_0xc9a92b[_0x17ff('0x43')]+_0x17ff('0xb7')+util['inspect'](_0x3e404c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4a9d26);}if(_0x11af91!==null){logger['silly'](_0x17ff('0xb8'),_0x11af91);_0x11af91[_0x17ff('0xb9')]=_0x671c07;throw _0x11af91;}})['catch'](function(_0x5590e5){logger[_0x17ff('0x63')](_0x17ff('0xba'),_0x5590e5);throw msgResponse(_0x17ff('0x80'),_0x17ff('0x81'),util[_0x17ff('0x65')](_0x5590e5,{'showHidden':![],'depth':null}));});};Dialer[_0x17ff('0x19')]['syncAgentConnect']=function(_0xd32024){if(this[_0x17ff('0x1e')][_0xd32024[_0x17ff('0xbb')]]){if(this[_0x17ff('0x24')][_0xd32024[_0x17ff('0xbc')]]&&this[_0x17ff('0x24')][_0xd32024['uniqueid']][_0x17ff('0x3e')]!==_0x17ff('0xbd')){this['updateOriginated'](this[_0x17ff('0x1e')][_0xd32024['queue']]);this[_0x17ff('0x24')][_0xd32024[_0x17ff('0xbc')]][_0x17ff('0xbe')]=moment()['format'](_0x17ff('0xbf'));}}};Dialer[_0x17ff('0x19')][_0x17ff('0xc0')]=function(_0x2acf1d){var _0x24cf92=this[_0x17ff('0x24')][_0x2acf1d[_0x17ff('0xbc')]];if(this[_0x17ff('0x1e')][_0x2acf1d['queue']]){if(_0x24cf92&&_0x24cf92['type']!==_0x17ff('0xbd')){delete this[_0x17ff('0x24')][_0x2acf1d[_0x17ff('0xbc')]];this[_0x17ff('0x1e')][_0x2acf1d[_0x17ff('0xbb')]][_0x17ff('0xc1')]+=0x1;var _0x515c40=new AgentComplete(_0x24cf92,_0x2acf1d);if(_0x2acf1d[_0x17ff('0xc2')]===_0x17ff('0xc3')){_0x515c40[_0x17ff('0xc4')]=this[_0x17ff('0x1e')][_0x2acf1d[_0x17ff('0xbb')]]['dialQueueProject2']&&this['voiceQueues'][_0x2acf1d['queue']][_0x17ff('0xc5')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x17ff('0xc6')](_0x515c40)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0xc7')));hopperUtils[_0x17ff('0xc8')](_0x515c40)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0xc9')));}}};Dialer['prototype'][_0x17ff('0x2e')]=function(_0x13d99e){var _0x377276=this['uniqueId'][_0x13d99e[_0x17ff('0xbc')]];var _0x4c2206=this;var _0x83db54=![];var _0xdaa14e;var _0x5aef53;if(this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]]){if(_0x377276&&_0x377276[_0x17ff('0x3e')]!==_0x17ff('0xbd')){delete this[_0x17ff('0x24')][_0x13d99e['uniqueid']];this[_0x17ff('0xca')](this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]]);_0x377276[_0x17ff('0xcb')]=moment()[_0x17ff('0x41')](_0x17ff('0xbf'));var _0x426765=new QueueCallerAbandon(_0x377276,_0x13d99e);if(utils[_0x17ff('0x5e')](_0x377276[_0x17ff('0xcb')],_0x377276[_0x17ff('0xcc')])>=_0x377276['dialQueueTimeout']){this['voiceQueues'][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0x4b')]+=0x1;this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x17ff('0x1e')][_0x13d99e['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x426765[_0x17ff('0x6b')]=0xa;_0x426765[_0x17ff('0x6c')]='Drop';_0x426765['dropreason']=_0x17ff('0xcd');_0x426765[_0x17ff('0xc4')]=this[_0x17ff('0x1e')][_0x13d99e['queue']][_0x17ff('0xce')]?moment()[_0x17ff('0x41')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x426765[_0x17ff('0xcf')]+=0x1;_0x426765[_0x17ff('0xd0')]+=0x1;_0xdaa14e=this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0xd1')];_0x5aef53=this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x17ff('0xd2')](_0x426765,_0x426765['state'],_0x377276['voiceQueue'])[_0x17ff('0x3b')](function(_0x176b81){_0x83db54=_0x176b81[_0x17ff('0xd3')]==0x1;if(_0x426765[_0x17ff('0xcf')]>=_0x4c2206[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0xd4')]){_0x4c2206[_0x17ff('0xd5')](_0x426765,_0x176b81[_0x17ff('0xd3')]);}else{hopperUtils[_0x17ff('0xd6')]({'active':![],'countdropretry':_0x426765[_0x17ff('0xcf')],'scheduledat':moment()[_0x17ff('0xd7')](_0x4c2206[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0xd1')],_0x17ff('0xd8'))[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x377276['ContactId'],'ListId':_0x377276[_0x17ff('0xd9')],'VoiceQueueId':_0x377276[_0x17ff('0xda')]||undefined,'CampaignId':_0x377276['CampaignId']||undefined})[_0x17ff('0x9a')](loggerCatch(_0x17ff('0xdb')));var _0x347060=new History(_0x426765);_0x347060['state']=0xa;_0x347060[_0x17ff('0x6c')]=_0x17ff('0xdc');_0x347060[_0x17ff('0x6e')]=moment()[_0x17ff('0x41')](_0x17ff('0xbf'));_0x347060[_0x17ff('0x6d')]=_0x347060[_0x17ff('0x6e')];_0x347060['calleridname']=_0x426765['calleridname'];_0x347060[_0x17ff('0xdd')]=_0x426765[_0x17ff('0xdd')];hopperUtils['createHistory'](_0x347060)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0xde')));}})['then'](function(){if(_0x83db54)hopperUtils[_0x17ff('0xdf')](_0x426765,_0xdaa14e,_0x5aef53)[_0x17ff('0x3b')](function(){return 0x1;});});}else{this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]]['outboundDropCallsDayCallersExit']+=0x1;_0x426765[_0x17ff('0x6b')]=0xb;_0x426765['statedesc']=_0x17ff('0xe0');_0x426765[_0x17ff('0xe1')]=_0x17ff('0xe2');_0x426765[_0x17ff('0xe3')]+=0x1;_0x426765[_0x17ff('0xd0')]+=0x1;_0xdaa14e=this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0xe4')];_0x5aef53=this[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0xe5')];hopperUtils[_0x17ff('0xd2')](_0x426765,_0x426765[_0x17ff('0x6b')],_0x377276['voiceQueue'])['then'](function(_0x2d2a1c){if(_0x426765['countabandonedretry']>=_0x4c2206['voiceQueues'][_0x13d99e[_0x17ff('0xbb')]]['dialAbandonedMaxRetry']){_0x4c2206[_0x17ff('0xd5')](_0x426765,_0x2d2a1c['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x426765[_0x17ff('0xe3')],'scheduledat':moment()[_0x17ff('0xd7')](_0x4c2206[_0x17ff('0x1e')][_0x13d99e[_0x17ff('0xbb')]][_0x17ff('0xe4')],_0x17ff('0xd8'))['format'](_0x17ff('0xbf')),'ContactId':_0x377276['ContactId'],'ListId':_0x377276[_0x17ff('0xd9')],'VoiceQueueId':_0x377276[_0x17ff('0xda')]||undefined,'CampaignId':_0x377276[_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3e5afa=new History(_0x426765);_0x3e5afa['state']=0xb;_0x3e5afa[_0x17ff('0x6c')]=_0x17ff('0xe0');_0x3e5afa['starttime']=moment()[_0x17ff('0x41')](_0x17ff('0xbf'));_0x3e5afa[_0x17ff('0x6d')]=_0x3e5afa['starttime'];_0x3e5afa[_0x17ff('0xe7')]=_0x426765[_0x17ff('0xe7')];_0x3e5afa['calleridnum']=_0x426765['calleridnum'];hopperUtils['createHistory'](_0x3e5afa)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0xe8')));}})[_0x17ff('0x3b')](function(){if(_0x83db54)hopperUtils[_0x17ff('0xdf')](_0x426765,_0xdaa14e,_0x5aef53)[_0x17ff('0x3b')](function(){return 0x1;});});}}}};Dialer[_0x17ff('0x19')]['syncNewExten']=function(_0x252973){if(this['actions'][_0x252973[_0x17ff('0xbc')]]){this[_0x17ff('0x22')][_0x252973[_0x17ff('0xbc')]]['channel']=_0x252973[_0x17ff('0xe9')];}if(this['uniqueId'][_0x252973[_0x17ff('0xbc')]]){this[_0x17ff('0x24')][_0x252973[_0x17ff('0xbc')]][_0x17ff('0xe9')]=_0x252973[_0x17ff('0xe9')];}};Dialer['prototype'][_0x17ff('0x38')]=function(_0x1abf8a){if(!this['actions'][_0x1abf8a[_0x17ff('0xea')]]){return;}var _0xca9bc0=this[_0x17ff('0x1e')][this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]]['queue']][_0x17ff('0xeb')]||_0x17ff('0xec');if(_0xca9bc0==='roundrobin'){if(this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]]&&_[_0x17ff('0xed')](this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]][_0x17ff('0xee')])&&_0x1abf8a[_0x17ff('0x85')]==='1'&&_0x1abf8a[_0x17ff('0xef')]==='0'){if(this[_0x17ff('0xf0')][_0x1abf8a[_0x17ff('0xf1')]]){if(!this[_0x17ff('0xf0')][_0x1abf8a[_0x17ff('0xf1')]]['locked']){this[_0x17ff('0xf0')][_0x1abf8a[_0x17ff('0xf1')]][_0x17ff('0xee')]=!![];this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]][_0x17ff('0xee')]=!![];this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]][_0x17ff('0xf1')]=_0x1abf8a['stateinterface'];}}}}else if(_0xca9bc0===_0x17ff('0xec')){if(this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]]){if(this['agents'][_0x1abf8a[_0x17ff('0xf1')]]){this[_0x17ff('0x22')][_0x1abf8a['actionid']][_0x17ff('0xf1')]=_0x1abf8a['stateinterface'];if(_[_0x17ff('0xed')](this['queueBooked'][this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]][_0x17ff('0xbb')]])){this[_0x17ff('0x28')][this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]][_0x17ff('0xbb')]]=[];}this[_0x17ff('0x28')][this[_0x17ff('0x22')][_0x1abf8a[_0x17ff('0xea')]][_0x17ff('0xbb')]][_0x17ff('0x95')](_[_0x17ff('0xf2')](_[_0x17ff('0x73')](this[_0x17ff('0x22')][_0x1abf8a['actionid']],['idHopper',_0x17ff('0xf1')]),{'status':_0x1abf8a[_0x17ff('0x85')],'paused':_0x1abf8a[_0x17ff('0xef')]}));}}}};Dialer['prototype'][_0x17ff('0xf3')]=function(_0x2afc07){if(!this['actions'][_0x2afc07[_0x17ff('0xea')]]){return;}var _0x639e82=this;var _0x3b56ac=this[_0x17ff('0x1e')][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]];var _0x1a5fcd=_0x3b56ac[_0x17ff('0xeb')]||_0x17ff('0xec');if(_0x1a5fcd==='roundrobin'){if(this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]]&&this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xf1')]){this[_0x17ff('0x1d')]['run'](this[_0x17ff('0x22')][_0x2afc07['actionid']][_0x17ff('0xf4')],this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]]['stateinterface'])[_0x17ff('0x9a')](function(_0x4317de){logger[_0x17ff('0x63')](_0x17ff('0xf5'),util['inspect'](_0x4317de,{'showHidden':![],'depth':null}));})[_0x17ff('0x1b')](function(){_0x639e82[_0x17ff('0xca')](_0x639e82[_0x17ff('0x1e')][_0x639e82[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]]);_0x639e82[_0x17ff('0xf0')][_0x639e82[_0x17ff('0x22')][_0x2afc07['actionid']][_0x17ff('0xf1')]]['locked']=![];delete _0x639e82[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]];unlockQueueStatus(_0x3b56ac);});}else{this['updateOriginated'](this[_0x17ff('0x1e')][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]]);hopperUtils[_0x17ff('0xd6')]({'active':![],'ContactId':this[_0x17ff('0x22')][_0x2afc07['actionid']]['ContactId'],'ListId':this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xd9')],'VoiceQueueId':this[_0x17ff('0x22')][_0x2afc07['actionid']][_0x17ff('0xda')]||undefined,'CampaignId':this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xe6')]||undefined})['catch'](loggerCatch(_0x17ff('0xf6')));delete this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]];unlockQueueStatus(_0x3b56ac);}}else if(_0x1a5fcd===_0x17ff('0xec')){var _0x82f8c0;if(this['actions'][_0x2afc07['actionid']]&&!_['isEmpty'](this['queueBooked'][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]])){if(this[_0x17ff('0x29')][_0x639e82[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]]){this[_0x17ff('0x29')][_0x639e82['actions'][_0x2afc07['actionid']]['queue']]=this[_0x17ff('0x29')][this['actions'][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]]?this[_0x17ff('0x29')][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]]:this[_0x17ff('0x28')][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]]?this[_0x17ff('0x28')][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]][_0x17ff('0xf7')]||0x0:0x0;}this['queueBooked'][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]]['queue']][_0x17ff('0xf7')]=this[_0x17ff('0x29')][this[_0x17ff('0x22')][_0x2afc07[_0x17ff('0xea')]][_0x17ff('0xbb')]];for(var _0xebd3c7=0x0;_0xebd3c7=_0x1a3ce2[_0x17ff('0x119')]){_0x15b3f1[_0x17ff('0x11a')](_0x381585,_0x53a9e2,_0x4b7a3f,_0x17ff('0x11b'));}else{if(_0x381585['countmachineretry']>=_0x1a3ce2[_0x17ff('0x11c')]){_0x15b3f1[_0x17ff('0x11d')](_0x381585,_0x53a9e2,_0x4b7a3f,'reason\x2019\x20machine....');}else{hopperUtils[_0x17ff('0xd6')]({'active':![],'countmachineretry':_0x381585['countmachineretry'],'scheduledat':moment()[_0x17ff('0xd7')](_0x1a3ce2['dialMachineRetryFrequency'],_0x17ff('0xd8'))[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x381585['ContactId'],'ListId':_0x381585[_0x17ff('0xd9')],'VoiceQueueId':_0x381585[_0x17ff('0xda')]||undefined,'CampaignId':_0x381585[_0x17ff('0xe6')]||undefined})['catch'](loggerCatch(_0x17ff('0x11e')));_0x53a9e2({'reschedule':0x1});}}});}if(_0x4fb77c[_0x17ff('0x3e')]==='ivr'&&this['campaigns'][_0x4fb77c[_0x17ff('0xbb')]][_0x17ff('0x107')]&&_0x52bf6f[_0x17ff('0x108')]==='HANGUP'){delete this[_0x17ff('0x24')][_0x52bf6f[_0x17ff('0xbc')]];this[_0x17ff('0xca')](this[_0x17ff('0x1f')][_0x4fb77c[_0x17ff('0xbb')]]);_0x2480ad=new Hangup(_0x4fb77c,_0x52bf6f);_0x2480ad['state']=0x12;_0x2480ad[_0x17ff('0x6c')]=_0x17ff('0x10a');_0x2480ad[_0x17ff('0x10b')]=_0x17ff('0x10c');ami[_0x17ff('0x3d')](_0x17ff('0x10d'),ut['buildObj'](_0x2480ad,_0x17ff('0x10e')));this[_0x17ff('0x10f')](_0x2480ad,'[syncHangupInAMDIvr][createHistory]',_0x17ff('0x11f'));}if(_0x4fb77c[_0x17ff('0x3e')]===_0x17ff('0xbd')&&this['campaigns'][_0x4fb77c[_0x17ff('0xbb')]][_0x17ff('0x107')]&&_0x52bf6f['value']==='MACHINE'){return new Promise(function(_0x632c61,_0x39211c){delete _0x15b3f1['uniqueId'][_0x52bf6f[_0x17ff('0xbc')]];_0x15b3f1[_0x17ff('0xca')](_0x15b3f1[_0x17ff('0x1f')][_0x4fb77c[_0x17ff('0xbb')]]);_0x15b3f1['campaigns'][_0x4fb77c[_0x17ff('0xbb')]][_0x17ff('0xc1')]+=0x1;_0x15b3f1[_0x17ff('0x1f')][_0x4fb77c[_0x17ff('0xbb')]][_0x17ff('0x109')]+=0x1;var _0x1ecf9b=_0x15b3f1['campaigns'][_0x4fb77c[_0x17ff('0xbb')]];var _0x57a6a9=new Hangup(_0x4fb77c,_0x52bf6f);_0x57a6a9['state']=0x13;_0x57a6a9[_0x17ff('0x6c')]=_0x17ff('0x112');_0x57a6a9[_0x17ff('0x10b')]=_0x17ff('0x10c');_0x57a6a9['countmachineretry']+=0x1;_0x57a6a9['countglobal']+=0x1;_0x57a6a9[_0x17ff('0x10e')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0x57a6a9,_0x17ff('0x10e')));hopperUtils[_0x17ff('0xc6')](_0x57a6a9)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x113')));if(_0x57a6a9[_0x17ff('0x114')]+_0x57a6a9[_0x17ff('0x115')]+_0x57a6a9[_0x17ff('0x116')]+_0x57a6a9[_0x17ff('0x117')]+_0x57a6a9[_0x17ff('0xcf')]+_0x57a6a9[_0x17ff('0xe3')]+_0x57a6a9[_0x17ff('0x120')]+_0x57a6a9[_0x17ff('0x118')]>=_0x1ecf9b['dialGlobalMaxRetry']){_0x15b3f1[_0x17ff('0x11a')](_0x57a6a9,_0x632c61,_0x39211c,_0x17ff('0x11b'));}else{if(_0x57a6a9[_0x17ff('0x120')]>=_0x1ecf9b[_0x17ff('0x11c')]){_0x15b3f1['createStateFinal'](_0x57a6a9,_0x632c61,_0x39211c,_0x17ff('0x121'));}else{hopperUtils[_0x17ff('0xd6')]({'active':![],'countmachineretry':_0x57a6a9[_0x17ff('0x120')],'scheduledat':moment()['add'](_0x1ecf9b['dialMachineRetryFrequency'],_0x17ff('0xd8'))[_0x17ff('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x57a6a9['ContactId'],'ListId':_0x57a6a9[_0x17ff('0xd9')],'VoiceQueueId':_0x57a6a9[_0x17ff('0xda')]||undefined,'CampaignId':_0x57a6a9[_0x17ff('0xe6')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x632c61({'reschedule':0x1});}}});}}};Dialer[_0x17ff('0x19')][_0x17ff('0x35')]=function(_0x3022ac){var _0x2a5e47=this[_0x17ff('0x24')][_0x3022ac[_0x17ff('0xbc')]];var _0x207fac;if(_0x2a5e47&&_0x2a5e47['type']===_0x17ff('0xbd')){delete this[_0x17ff('0x24')][_0x3022ac[_0x17ff('0xbc')]];this[_0x17ff('0xca')](this[_0x17ff('0x1f')][_0x2a5e47[_0x17ff('0xbb')]]);this['campaigns'][_0x2a5e47[_0x17ff('0xbb')]]['ivrAnswerCallsDay']+=0x1;_0x207fac=new Hangup(_0x2a5e47,_0x3022ac);hopperUtils[_0x17ff('0xc6')](_0x207fac)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x122')));hopperUtils[_0x17ff('0xc8')](_0x207fac)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x123')));}if(_0x2a5e47&&_0x2a5e47[_0x17ff('0x3e')]!==_0x17ff('0xbd')&&isNotNull(this['voiceQueues'][_0x2a5e47[_0x17ff('0xbb')]]['dialQueueProject'])){delete this['uniqueId'][_0x3022ac[_0x17ff('0xbc')]];this[_0x17ff('0xca')](this[_0x17ff('0x1e')][_0x2a5e47['queue']]);this[_0x17ff('0x1e')][_0x2a5e47[_0x17ff('0xbb')]][_0x17ff('0xc1')]+=0x1;this[_0x17ff('0x1e')][_0x2a5e47[_0x17ff('0xbb')]][_0x17ff('0x109')]+=0x1;_0x207fac=new Hangup(_0x2a5e47,_0x3022ac);_0x207fac[_0x17ff('0x6b')]=0x10;_0x207fac[_0x17ff('0x6c')]=_0x17ff('0x124');_0x207fac[_0x17ff('0x10b')]='AGI';hopperUtils[_0x17ff('0xc6')](_0x207fac)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x122')));hopperUtils['moveContactManagedDialer'](_0x207fac)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x123')));}if(_0x2a5e47&&_0x2a5e47[_0x17ff('0x3e')]!==_0x17ff('0xbd')&&!isNotNull(this[_0x17ff('0x1e')][_0x2a5e47['queue']][_0x17ff('0x125')])){delete this[_0x17ff('0x24')][_0x3022ac['uniqueid']];this[_0x17ff('0xca')](this[_0x17ff('0x1e')][_0x2a5e47[_0x17ff('0xbb')]]);this[_0x17ff('0x1e')][_0x2a5e47[_0x17ff('0xbb')]][_0x17ff('0x126')]+=0x1;_0x207fac=new Hangup(_0x2a5e47,_0x3022ac);_0x207fac[_0x17ff('0x6b')]=0xc;_0x207fac[_0x17ff('0x6c')]=_0x3022ac[_0x17ff('0x127')];_0x207fac[_0x17ff('0x10b')]=_0x17ff('0x128');hopperUtils[_0x17ff('0xc6')](_0x207fac)[_0x17ff('0x9a')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x17ff('0xc8')](_0x207fac)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x123')));}};Dialer[_0x17ff('0x19')]['syncQueueSummary']=function(_0x59ee29){var _0x3f47e8=this;if(!_0x3f47e8[_0x17ff('0x2a')][_0x59ee29[_0x17ff('0x43')]]){_0x3f47e8[_0x17ff('0x2a')][_0x59ee29[_0x17ff('0x43')]]={'running':![]};}else if(_0x3f47e8['queuesSummary'][_0x59ee29[_0x17ff('0x43')]][_0x17ff('0x129')]===!![]){return;}else if(_0x3f47e8[_0x17ff('0x2a')][_0x59ee29['name']][_0x17ff('0x129')]===![]){_0x3f47e8[_0x17ff('0x2a')][_0x59ee29[_0x17ff('0x43')]][_0x17ff('0x129')]=!![];}var _0x3fcbcc=_0x3f47e8[_0x17ff('0x1e')][_0x59ee29['name']];var _0x51e629=_0x3fcbcc[_0x17ff('0x6a')]!==utils['CAMPAIGN_STATUS'][_0x17ff('0x79')];var _0x33860c=utils[_0x17ff('0x12a')](_0x3fcbcc);_0x3fcbcc[_0x17ff('0x12b')]=utils[_0x17ff('0x12c')](_0x3fcbcc,_0x3f47e8[_0x17ff('0x20')]);Promise['resolve']()['then'](function(){if(_0x3fcbcc[_0x17ff('0x12b')]===utils[_0x17ff('0x68')][_0x17ff('0x79')]){if(_0x51e629){clearPredictiveAttributes(_0x3fcbcc);_0x59ee29[_0x17ff('0x26')]=undefined;_0x59ee29[_0x17ff('0x5f')]=undefined;}if(_0x3fcbcc['statusMessage']===utils[_0x17ff('0x68')][_0x17ff('0x79')]){_0x59ee29[_0x17ff('0x12d')]=0x0;_0x59ee29[_0x17ff('0xef')]=0x0;_0x59ee29[_0x17ff('0x12e')]=0x0;_0x59ee29[_0x17ff('0x12f')]=0x0;_0x59ee29['pTalking']=0x0;}}else if(_0x3fcbcc[_0x17ff('0x12b')]===utils[_0x17ff('0x68')][_0x17ff('0x130')]&&!_0x33860c){return _0x3f47e8[_0x17ff('0x8e')](_0x3fcbcc,!![])[_0x17ff('0x3b')](function(){return _0x3f47e8[_0x17ff('0x8e')](_0x3fcbcc,![]);})[_0x17ff('0x3b')](function(){return _0x3f47e8[_0x17ff('0x131')](_0x3fcbcc);})[_0x17ff('0x9a')](function(_0x5abbed){loggerSyncQueueSummary[_0x17ff('0x3f')](_0x17ff('0x132'),util[_0x17ff('0x65')](_0x5abbed,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3fcbcc);});}else{clearPredictiveAttributes(_0x3fcbcc);}})[_0x17ff('0x3b')](function(){var _0xd31ea7=_0x59ee29[_0x17ff('0x133')](_0x3fcbcc);if(_0xd31ea7||_0x3fcbcc['queueSummaryCountersUpdated']){_0x3fcbcc[_0x17ff('0x134')]=![];_0x59ee29[_0x17ff('0x135')](_0x3fcbcc);Object[_0x17ff('0x136')](_0x3fcbcc,_0x59ee29);emitOutboundVoiceQueueSummary(_0x59ee29);}_0x3f47e8[_0x17ff('0x2a')][_0x3fcbcc[_0x17ff('0x43')]]['running']=![];})['catch'](function(_0x10f2d2){logger[_0x17ff('0x63')](_0x17ff('0x132'),util[_0x17ff('0x65')](_0x10f2d2,{'showHidden':![],'depth':null}));_0x3f47e8[_0x17ff('0x2a')][_0x3fcbcc[_0x17ff('0x43')]][_0x17ff('0x129')]=![];});};Dialer[_0x17ff('0x19')][_0x17ff('0x33')]=_['throttle'](function(){var _0x1dc2cb=_[_0x17ff('0x137')](this[_0x17ff('0x1e')],function(_0x59c739){return _0x59c739[_0x17ff('0x138')];});var _0x13312c=_['filter'](this['agents'],function(_0x561834){return _0x561834['online']&&_0x561834['status']==='reachable';});if(_0x1dc2cb[_0x17ff('0x94')]>0x0&&_0x13312c['length']>0x0){return Promise[_0x17ff('0xa5')]()[_0x17ff('0x3b')](cmHopper[_0x17ff('0x139')](_[_0x17ff('0x13a')](_0x1dc2cb,'id'),previewRecallmeReminderInterval,_['map'](_0x13312c,'id')))[_0x17ff('0x3b')](function(_0x59e51f){for(var _0x27e971=0x0;_0x27e971<_0x59e51f[_0x17ff('0x94')];_0x27e971++){var _0x210688=_0x59e51f[_0x27e971][_0x17ff('0x13b')][_0x17ff('0x43')];if(_0x210688)io['to'](util[_0x17ff('0x41')]('user:%s',_0x210688))['emit'](_0x17ff('0x13c'),{'hopper':_0x59e51f[_0x27e971]});}})['catch'](function(_0x5aeab4){logger[_0x17ff('0x63')]('checkPreviewRecallReminder',_0x5aeab4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x17ff('0x19')]['loopClearZombieChannels']=function(){var _0x49765=this;setInterval(function(){_0x49765[_0x17ff('0x13d')](_0x49765[_0x17ff('0x24')],_0x17ff('0x13e'));_0x49765[_0x17ff('0x13d')](_0x49765[_0x17ff('0x22')],_0x17ff('0x13f'));},0x32c8);};Dialer[_0x17ff('0x19')][_0x17ff('0x13d')]=function(_0x526ea3,_0x2f9b19){var _0x54e2c3=this;for(var _0x29e25b in _0x526ea3){if(typeof _0x526ea3[_0x29e25b]!==_0x17ff('0xa4')){this[_0x17ff('0x1c')][_0x17ff('0x140')](function(){if(!_['isNil'](_0x526ea3[_0x29e25b])){return ami[_0x17ff('0x96')]({'action':_0x17ff('0x85'),'channel':_0x526ea3[_0x29e25b][_0x17ff('0xe9')]})[_0x17ff('0x9a')](function(_0x29498a){if(_0x29498a[_0x17ff('0x6a')]===_0x17ff('0x141')){setTimeout(function(){if(_0x526ea3[_0x29e25b]&&_0x526ea3[_0x29e25b][_0x17ff('0x3e')]!==_0x17ff('0xbd')){_0x54e2c3['updateOriginated'](_0x54e2c3[_0x17ff('0x1e')][_0x526ea3[_0x29e25b][_0x17ff('0xbb')]]);logger[_0x17ff('0x63')](_0x17ff('0x142'),_0x2f9b19,_0x29e25b,_0x526ea3[_0x29e25b][_0x17ff('0xbb')]);delete _0x526ea3[_0x29e25b];}if(_0x526ea3[_0x29e25b]&&_0x526ea3[_0x29e25b][_0x17ff('0x3e')]==='ivr'){_0x54e2c3[_0x17ff('0xca')](_0x54e2c3['campaigns'][_0x526ea3[_0x29e25b][_0x17ff('0xbb')]]);logger[_0x17ff('0x63')](_0x17ff('0x143'),_0x2f9b19,_0x29e25b,_0x526ea3[_0x29e25b]['queue']);delete _0x526ea3[_0x29e25b];}},0x2328);}});}});}}};Dialer[_0x17ff('0x19')]['getVoiceQueueRtPauses']=function(_0x9f5ef9){return Promise['resolve']()['then'](voiceQueueRt[_0x17ff('0x144')](_0x9f5ef9))[_0x17ff('0x9a')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x17ff('0x19')][_0x17ff('0xca')]=function(_0x1df038){if(!_['isUndefined'](_0x1df038)&&_0x1df038!==null){if(typeof _0x1df038[_0x17ff('0x7d')]!==_0x17ff('0xa4')){if(_0x1df038[_0x17ff('0x7d')]>0x0){_0x1df038[_0x17ff('0x7d')]-=0x1;}else{logger['error'](_0x17ff('0x145'));}}}else{logger[_0x17ff('0x63')](_0x17ff('0x146'));}};Dialer[_0x17ff('0x19')]['loggerHandler']=function(_0x37252e,_0x321a2a){var _0x16241a=this;return function(_0x2fd7aa){_0x16241a[_0x17ff('0xca')](_0x321a2a);logger[_0x17ff('0x63')](_0x37252e,util['inspect'](_0x2fd7aa,{'showHidden':![],'depth':null}));};};Dialer[_0x17ff('0x19')][_0x17ff('0x147')]=function(_0x8c0fcb,_0x3937da,_0xd91d36){var _0x16940d={'state':0x19,'statedesc':'notFound'};this[_0x17ff('0xca')](_0x3937da);this[_0x17ff('0x10f')](_[_0x17ff('0xf2')](_0x16940d,_[_0x17ff('0x73')](_0xd91d36,['ContactId','ListId',_0x17ff('0x148'),_0x17ff('0xda'),_0x17ff('0xe6')])),'[emptyContact][createHistory]',_0x17ff('0x149'));logger['error'](_0x8c0fcb);};Dialer[_0x17ff('0x19')][_0x17ff('0x10f')]=function(_0x2cad18,_0xdd2af8,_0x3b7123){hopperUtils['createHistory'](_0x2cad18)[_0x17ff('0x9a')](loggerCatch(_0xdd2af8));hopperUtils[_0x17ff('0xc8')](_0x2cad18)[_0x17ff('0x9a')](loggerCatch(_0x3b7123));};Dialer['prototype'][_0x17ff('0xd5')]=function(_0x51a8b6,_0x2e85d5){hopperUtils['createHistory'](_0x51a8b6)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0xc7')));if(_0x2e85d5==0x0){hopperUtils[_0x17ff('0xc8')](_0x51a8b6)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x14a')));}};Dialer[_0x17ff('0x19')][_0x17ff('0x14b')]=function(_0x59fd2d){return Promise[_0x17ff('0xa5')]()['then'](cmHopper[_0x17ff('0x139')](_0x59fd2d['id'],previewRecallmeReminderInterval))['then'](function(_0x391abe){for(var _0x4c0127=0x0;_0x4c0127<_0x391abe[_0x17ff('0x94')];_0x4c0127++){var _0x450e16=_0x391abe[_0x4c0127][_0x17ff('0x13b')][_0x17ff('0x43')];if(_0x450e16)io['to'](util[_0x17ff('0x41')](_0x17ff('0x14c'),_0x450e16))[_0x17ff('0x3d')](_0x17ff('0x13c'),{'hopper':_0x391abe[_0x4c0127]});}})['catch'](function(){});};Dialer[_0x17ff('0x19')][_0x17ff('0xa9')]=function(_0x107eb6){var _0x384767=this;return function(){_0x384767[_0x17ff('0x14d')](_0x107eb6);};};Dialer[_0x17ff('0x19')][_0x17ff('0x14e')]=function(_0x5402f5,_0x1e83ce){var _0x5e5bd3=this;var _0x3d9bc2=uuid['v4']();this['actions'][_0x3d9bc2]=new Action(_0x5402f5,_0x1e83ce,_0x3d9bc2);return new Promise(function(_0x8cd3ef,_0xc9f77b){if(_[_0x17ff('0x3c')](_0x5402f5)&&typeof _0x5402f5!==_0x17ff('0x14f')){return _0xc9f77b(msgResponse(_0x17ff('0x150'),'Failure',_0x17ff('0x151')));}if(_[_0x17ff('0x3c')](_0x1e83ce[_0x17ff('0x152')])||_0x1e83ce[_0x17ff('0x152')]===null){return _0xc9f77b(msgResponse('originate',_0x17ff('0x8c'),_0x17ff('0x153')));}var _0x55eee5={'XMD-CALLERID':_0x5e5bd3[_0x17ff('0x22')][_0x3d9bc2][_0x17ff('0x154')](),'XMD-AGI':_0x5402f5[_0x17ff('0x125')]?util[_0x17ff('0x41')](_0x17ff('0x155'),ipAgi,_0x5402f5['dialQueueProject']):_0x17ff('0x156'),'XMD-AGIAFTER':_0x5402f5['dialQueueProject2']?util['format'](_0x17ff('0x155'),ipAgi,_0x5402f5[_0x17ff('0xce')]):_0x17ff('0x156'),'XMD-QUEUE':utils['isOutboundQueue'](_0x5402f5)?util['format']('\x22%s,%s%s,,,%s\x22',_0x5402f5[_0x17ff('0x43')],_0x5402f5[_0x17ff('0x157')]||'',_0x5402f5[_0x17ff('0xc5')]?'c':'',_0x5402f5[_0x17ff('0x158')]||0x3):_0x17ff('0x156'),'XMD-CONTACTID':_0x1e83ce[_0x17ff('0xfe')],'XMD-CDRTYPE':_0x17ff('0x8'),'CALLERID(all)':_0x5e5bd3['actions'][_0x3d9bc2][_0x17ff('0x154')](),'XMD-AMD':_0x5402f5[_0x17ff('0x107')]?_0x17ff('0x130'):_0x17ff('0x156'),'XMD-DESTINATION':_0x17ff('0x106')};if(_0x5402f5[_0x17ff('0x107')]){_0x55eee5['XMD-AMDINITIALSILENCE']=_0x5402f5['dialAMDInitialSilence']||0x9c4;_0x55eee5['XMD-AMDGREETING']=_0x5402f5[_0x17ff('0x159')]||0x5dc;_0x55eee5[_0x17ff('0x15a')]=_0x5402f5[_0x17ff('0x15b')]||0x320;_0x55eee5['XMD-AMDTOTALANALYSISTIME']=_0x5402f5[_0x17ff('0x15c')]||0x1388;_0x55eee5[_0x17ff('0x15d')]=_0x5402f5[_0x17ff('0x15e')]||0x64;_0x55eee5[_0x17ff('0x15f')]=_0x5402f5[_0x17ff('0x160')]||0x32;_0x55eee5[_0x17ff('0x161')]=_0x5402f5['dialAMDMaximumNumberOfWords']||0x3;_0x55eee5['XMD-AMDSILENCETHRESHOLD']=_0x5402f5[_0x17ff('0x162')]||0x100;_0x55eee5[_0x17ff('0x163')]=_0x5402f5[_0x17ff('0x164')]||0x1388;}if(utils[_0x17ff('0x165')](_0x5402f5)){_0x55eee5['XMD-VOICEQUEUEID']=_0x1e83ce['VoiceQueueId'];}else{_0x55eee5[_0x17ff('0x166')]=_0x1e83ce[_0x17ff('0xe6')];}for(var _0x11a93e in _0x1e83ce[_0x17ff('0x167')]){if(typeof _0x1e83ce[_0x17ff('0x167')][_0x11a93e]!==_0x17ff('0xa4')){if(isNotNull(_0x1e83ce[_0x17ff('0x167')][_0x11a93e])&&_0x11a93e!=='id'&&_0x11a93e!==_0x17ff('0x168')&&_0x11a93e!=='createdAt'&&_0x11a93e!=='updatedAt'){_0x55eee5[util[_0x17ff('0x41')](_0x17ff('0x169'),_0x17ff('0x16a'),_[_0x17ff('0x16b')](_0x11a93e))]=_0x1e83ce['Contact'][_0x11a93e];}}}var _0x304434=_0x5e5bd3[_0x17ff('0x82')](_0x5402f5[_0x17ff('0x86')])?utils['getCallerId'](_0x5402f5[_0x17ff('0x86')][_0x17ff('0x16c')],_0x5402f5[_0x17ff('0x16d')],_0x5402f5[_0x17ff('0x16e')]>0x0?utils[_0x17ff('0x16f')](_0x5402f5[_0x17ff('0x170')],_0x5402f5['dialRandomLastDigitCallerIdNumber']):_0x5402f5[_0x17ff('0x170')]):utils['getCallerId'](_[_0x17ff('0xed')](_0x5402f5[_0x17ff('0x87')])?_0x5402f5[_0x17ff('0x86')]['callerid']:_0x5402f5[_0x17ff('0x87')][_0x17ff('0x16c')],_0x5402f5[_0x17ff('0x16d')],_0x5402f5[_0x17ff('0x16e')]>0x0?utils[_0x17ff('0x16f')](_0x5402f5['dialOriginateCallerIdNumber'],_0x5402f5[_0x17ff('0x16e')]):_0x5402f5['dialOriginateCallerIdNumber']);if(_0x304434){_0x55eee5[_0x17ff('0x171')]=_0x5e5bd3['actions'][_0x3d9bc2]['originatecalleridname']=utils['extractCalleridName'](_0x304434);_0x55eee5[_0x17ff('0x172')]=_0x1e83ce['phone'];}_0x5402f5['variables']=_0x55eee5;return ami[_0x17ff('0x96')]({'actionid':_0x3d9bc2,'action':'originate','channel':_0x5e5bd3[_0x17ff('0x82')](_0x5402f5[_0x17ff('0x86')])?util[_0x17ff('0x41')](_0x17ff('0x173'),_0x5402f5[_0x17ff('0x86')][_0x17ff('0x43')],isNotNull(_0x5402f5[_0x17ff('0x174')])?_0x5402f5[_0x17ff('0x174')]['trim']()||'':'',_0x5402f5[_0x17ff('0x175')]>0x0?_0x1e83ce['phone']['substring'](_0x5402f5[_0x17ff('0x175')]):_0x1e83ce['phone']):util[_0x17ff('0x41')](_0x17ff('0x173'),_['isNil'](_0x5402f5[_0x17ff('0x87')])?_0x5402f5[_0x17ff('0x86')]['name']:_0x5402f5[_0x17ff('0x87')]['name'],isNotNull(_0x5402f5[_0x17ff('0x174')])?_0x5402f5[_0x17ff('0x174')][_0x17ff('0x176')]()||'':'',_0x5402f5['dialCutDigit']>0x0?_0x1e83ce[_0x17ff('0x152')]['substring'](_0x5402f5[_0x17ff('0x175')]):_0x1e83ce[_0x17ff('0x152')]),'callerid':_0x304434,'Exten':'xcally-motion-dialer','Context':_0x17ff('0x177'),'Priority':'1','variable':_0x55eee5,'timeout':(_0x5402f5[_0x17ff('0x178')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3d9bc2})['then'](function(_0x574a15){return _0x8cd3ef(_0x574a15);})['catch'](function(_0x16e7b2){_0x5402f5['outboundOriginateFailureCallsDay']+=0x1;var _0x3006bd=new History(_0x5e5bd3['actions'][_0x3d9bc2]);logger[_0x17ff('0x63')](util['format'](_0x17ff('0x179'),JSON['stringify'](_0x16e7b2)));_0x3006bd[_0x17ff('0x6b')]=0xe;_0x3006bd[_0x17ff('0x6c')]='OriginateError';_0x3006bd[_0x17ff('0x6e')]=moment()['format'](_0x17ff('0xbf'));_0x3006bd[_0x17ff('0x6d')]=_0x3006bd[_0x17ff('0x6e')];hopperUtils['createHistory'](_0x3006bd)['catch'](loggerCatch(_0x17ff('0x17a')));_0x5e5bd3['moveContactManagedDialer'](_0x3006bd)['catch'](loggerCatch(_0x17ff('0x17a')))['finally'](function(){delete _0x5e5bd3[_0x17ff('0x22')][_0x3d9bc2];return _0xc9f77b(msgResponse(_0x17ff('0x150'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x17ff('0x19')]['checkRetriveMax']=function(_0xdb764d,_0x1274bb,_0x2d3f63){var _0x22df19=new History(_0x1274bb);if(_0x22df19[_0x17ff('0x114')]+_0x22df19[_0x17ff('0x115')]+_0x22df19[_0x17ff('0x116')]+_0x22df19[_0x17ff('0x117')]+_0x22df19[_0x17ff('0xcf')]+_0x22df19[_0x17ff('0xe3')]+_0x22df19[_0x17ff('0x120')]+_0x22df19[_0x17ff('0x118')]>=_0x2d3f63[_0x17ff('0x119')]-0x1){return!![];}switch(_0xdb764d){case 0x3:if(_0x22df19[_0x17ff('0x116')]>=_0x2d3f63['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x17ff('0xd6')]({'active':![],'countnoanswerretry':_0x22df19['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x2d3f63[_0x17ff('0x17b')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22df19[_0x17ff('0xfe')],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19[_0x17ff('0xda')]||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x17c')));break;case 0x5:if(_0x22df19['countbusyretry']>=_0x2d3f63['dialBusyMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x22df19[_0x17ff('0x114')]+=0x1,'scheduledat':moment()[_0x17ff('0xd7')](_0x2d3f63['dialBusyRetryFrequency'],_0x17ff('0xd8'))[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x22df19[_0x17ff('0xfe')],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19[_0x17ff('0xda')]||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x17d')));break;case 0x8:if(_0x22df19['countcongestionretry']>=_0x2d3f63[_0x17ff('0x17e')]-0x1){return!![];}hopperUtils[_0x17ff('0xd6')]({'active':![],'countcongestionretry':_0x22df19[_0x17ff('0x115')]+=0x1,'scheduledat':moment()['add'](_0x2d3f63[_0x17ff('0x17f')],'minutes')[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x22df19[_0x17ff('0xfe')],'ListId':_0x22df19['ListId'],'VoiceQueueId':_0x22df19[_0x17ff('0xda')]||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})['catch'](loggerCatch(_0x17ff('0x180')));break;case 0x0:if(_0x22df19[_0x17ff('0x117')]>=_0x2d3f63[_0x17ff('0x181')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x22df19[_0x17ff('0x117')]+=0x1,'scheduledat':moment()[_0x17ff('0xd7')](_0x2d3f63['dialNoSuchNumberRetryFrequency'],'minutes')[_0x17ff('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22df19['ContactId'],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19['VoiceQueueId']||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x182')));}break;case 0xa:if(_0x22df19[_0x17ff('0xcf')]>=_0x2d3f63[_0x17ff('0xd4')]-0x1){return!![];}hopperUtils[_0x17ff('0xd6')]({'active':![],'countdropretry':_0x22df19[_0x17ff('0xcf')]+=0x1,'scheduledat':moment()[_0x17ff('0xd7')](_0x2d3f63[_0x17ff('0xd1')],'minutes')[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x22df19['ContactId'],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19['VoiceQueueId']||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})['catch'](loggerCatch(_0x17ff('0xdb')));break;case 0xb:if(_0x22df19[_0x17ff('0xe3')]>=_0x2d3f63[_0x17ff('0x183')]-0x1){return!![];}hopperUtils[_0x17ff('0xd6')]({'active':![],'countabandonedretry':_0x22df19['countabandonedretry']+=0x1,'scheduledat':moment()[_0x17ff('0xd7')](_0x2d3f63[_0x17ff('0xe4')],_0x17ff('0xd8'))[_0x17ff('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22df19['ContactId'],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19['VoiceQueueId']||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})['catch'](loggerCatch(_0x17ff('0x184')));break;case 0x13:if(_0x22df19['countmachineretry']>=_0x2d3f63[_0x17ff('0x11c')]-0x1){return!![];}hopperUtils[_0x17ff('0xd6')]({'active':![],'countmachineretry':_0x22df19[_0x17ff('0x120')]+=0x1,'scheduledat':moment()[_0x17ff('0xd7')](_0x2d3f63[_0x17ff('0x185')],_0x17ff('0xd8'))[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x22df19[_0x17ff('0xfe')],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19[_0x17ff('0xda')]||undefined,'CampaignId':_0x22df19['CampaignId']||undefined})[_0x17ff('0x9a')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x22df19[_0x17ff('0x118')]>=_0x2d3f63[_0x17ff('0x186')]-0x1){return!![];}hopperUtils[_0x17ff('0xd6')]({'active':![],'countagentrejectretry':_0x22df19[_0x17ff('0x118')]+=0x1,'scheduledat':moment()[_0x17ff('0xd7')](_0x2d3f63[_0x17ff('0x187')],_0x17ff('0xd8'))[_0x17ff('0x41')](_0x17ff('0xbf')),'ContactId':_0x22df19['ContactId'],'ListId':_0x22df19[_0x17ff('0xd9')],'VoiceQueueId':_0x22df19[_0x17ff('0xda')]||undefined,'CampaignId':_0x22df19[_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x17ff('0x19')][_0x17ff('0x104')]=function(_0x39747c,_0xd27ed4,_0x3c2e82){var _0x86c992=this;var _0x1d3215=new History(_0x39747c);var _0x1073b9=![];var _0x4331a2;var _0x2ce755;return new Promise(function(_0x387c50,_0x180810){if(_['isUndefined'](_0xd27ed4)&&typeof _0xd27ed4!==_0x17ff('0x14f')){return _0x180810(msgResponse(_0x17ff('0x188'),'Failure','entity\x20is\x20undefine'));}if(_[_0x17ff('0x3c')](_0x3c2e82)&&typeof _0x3c2e82!==_0x17ff('0x14f')){return _0x180810(msgResponse(_0x17ff('0x188'),'Failure',_0x17ff('0x189')));}hopperUtils[_0x17ff('0xd2')](_0x1d3215,_0x3c2e82[_0x17ff('0xc2')],_0xd27ed4)[_0x17ff('0x3b')](function(_0x555579){if(_0x555579[_0x17ff('0xd3')]==0x1)_0x1073b9=!![];switch(_0x3c2e82[_0x17ff('0xc2')]){case'0':_0xd27ed4[_0x17ff('0x18a')]+=0x1;_0x1d3215[_0x17ff('0x6b')]=0x0;_0x1d3215[_0x17ff('0x6c')]=_0x17ff('0x18b');_0x1d3215[_0x17ff('0x117')]+=0x1;_0x1d3215[_0x17ff('0xd0')]+=0x1;ami[_0x17ff('0x3d')](_0x17ff('0x18c'),ut[_0x17ff('0x18d')](_0x39747c,'nosuchnumber'));_0x4331a2=_0xd27ed4[_0x17ff('0x18e')];_0x2ce755=_0xd27ed4[_0x17ff('0xe5')];hopperUtils[_0x17ff('0xc6')](_0x1d3215)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x113')));if(_0x86c992[_0x17ff('0x18f')](0x0,_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215['countnosuchnumberretry']>=_0xd27ed4[_0x17ff('0x181')]){_0x86c992['createStateFinal'](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x190'));}else{_0x86c992[_0x17ff('0x11a')](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x190'));}}break;case'3':_0xd27ed4[_0x17ff('0x191')]+=0x1;_0x1d3215[_0x17ff('0x6b')]=0x3;_0x1d3215[_0x17ff('0x6c')]='NoAnswer';_0x1d3215[_0x17ff('0x116')]+=0x1;_0x1d3215['countglobal']+=0x1;var _0x28fa97=ut['buildNoAnswerEventPayload'](_0x39747c,_0xd27ed4);ami[_0x17ff('0x3d')](_0x17ff('0x192'),_0x28fa97);_0x4331a2=_0xd27ed4[_0x17ff('0x17b')];_0x2ce755=_0xd27ed4[_0x17ff('0xe5')];hopperUtils[_0x17ff('0xc6')](_0x1d3215)[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x193')));if(_0x86c992[_0x17ff('0x18f')](0x3,_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215[_0x17ff('0x116')]>=_0xd27ed4['dialNoAnswerMaxRetry']){_0x86c992['createStateFinal'](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x194'));}else{_0x86c992['stateGlobal'](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x194'));}}break;case'5':_0xd27ed4[_0x17ff('0x195')]+=0x1;_0x1d3215[_0x17ff('0x6b')]=0x5;_0x1d3215[_0x17ff('0x6c')]=_0x17ff('0x196');_0x1d3215[_0x17ff('0x114')]+=0x1;_0x1d3215[_0x17ff('0xd0')]+=0x1;ami[_0x17ff('0x3d')](_0x17ff('0x197'),ut[_0x17ff('0x18d')](_0x39747c,'busy'));_0x4331a2=_0xd27ed4['dialBusyRetryFrequency'];_0x2ce755=_0xd27ed4['callAdditionalPhoneAfterMin'];hopperUtils[_0x17ff('0xc6')](_0x1d3215)[_0x17ff('0x9a')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x86c992[_0x17ff('0x18f')](0x5,_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215[_0x17ff('0x114')]>=_0xd27ed4[_0x17ff('0x198')]){_0x86c992[_0x17ff('0x11d')](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x199'));}else{_0x86c992[_0x17ff('0x11a')](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x199'));}}break;case'8':_0xd27ed4[_0x17ff('0x19a')]+=0x1;_0x1d3215[_0x17ff('0x6b')]=0x8;_0x1d3215[_0x17ff('0x6c')]=_0x17ff('0x19b');_0x1d3215['countcongestionretry']+=0x1;_0x1d3215[_0x17ff('0xd0')]+=0x1;_0x4331a2=_0xd27ed4[_0x17ff('0x17f')];_0x2ce755=_0xd27ed4[_0x17ff('0xe5')];ami[_0x17ff('0x3d')]('custom:agentcongestion',ut[_0x17ff('0x18d')](_0x39747c,_0x17ff('0x19c')));hopperUtils[_0x17ff('0xc6')](_0x1d3215)['catch'](loggerCatch(_0x17ff('0x19d')));if(_0x86c992[_0x17ff('0x18f')](0x8,_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215[_0x17ff('0x115')]>=_0xd27ed4['dialCongestionMaxRetry']){_0x86c992['createStateFinal'](_0x1d3215,_0x387c50,_0x180810,'reason\x208\x20congestion');}else{_0x86c992[_0x17ff('0x11a')](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x19e'));}}break;case'11':_0xd27ed4[_0x17ff('0x19f')]+=0x1;_0x1d3215['state']=0xb;_0x1d3215[_0x17ff('0x6c')]=_0x17ff('0xe0');_0x1d3215[_0x17ff('0xe3')]+=0x1;_0x1d3215[_0x17ff('0xd0')]+=0x1;_0x4331a2=_0xd27ed4[_0x17ff('0xe4')];_0x2ce755=_0xd27ed4[_0x17ff('0xe5')];hopperUtils[_0x17ff('0xc6')](_0x1d3215)['catch'](loggerCatch(_0x17ff('0xe8')));if(_0x86c992[_0x17ff('0x18f')](0xb,_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215[_0x17ff('0xe3')]>=_0xd27ed4[_0x17ff('0x183')]){_0x86c992[_0x17ff('0x11d')](_0x1d3215,_0x387c50,_0x180810,'reason\x2011\x20abandoned');}else{_0x86c992[_0x17ff('0x11a')](_0x1d3215,_0x387c50,_0x180810,'reason\x2011\x20abandoned');}}break;case'20':_0xd27ed4[_0x17ff('0x1a0')]+=0x1;_0x1d3215['state']=0x14;_0x1d3215['statedesc']=_0x17ff('0x1a1');_0x1d3215[_0x17ff('0x118')]+=0x1;_0x1d3215[_0x17ff('0xd0')]+=0x1;_0x4331a2=_0xd27ed4['dialAgentRejectRetryFrequency'];_0x2ce755=_0xd27ed4[_0x17ff('0xe5')];ami['emit']('custom:agentreject',ut[_0x17ff('0x18d')](_0x39747c,'agentreject'));hopperUtils[_0x17ff('0xc6')](_0x1d3215)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x86c992[_0x17ff('0x18f')](0x14,_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215[_0x17ff('0x118')]>=_0xd27ed4[_0x17ff('0x186')]){_0x86c992[_0x17ff('0x11d')](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x1a2'));}else{_0x86c992[_0x17ff('0x11a')](_0x1d3215,_0x387c50,_0x180810,_0x17ff('0x1a2'));}}break;default:_0xd27ed4['outboundUnknownCallsDay']+=0x1;_0x1d3215[_0x17ff('0x6b')]=0xc;_0x1d3215[_0x17ff('0x6c')]=_0x3c2e82['reason'];_0x4331a2=_0xd27ed4[_0x17ff('0x187')];_0x2ce755=_0xd27ed4[_0x17ff('0xe5')];hopperUtils[_0x17ff('0xc6')](_0x1d3215)[_0x17ff('0x9a')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x86c992['checkRetriveMax'](_0x3c2e82[_0x17ff('0xc2')],_0x39747c,_0xd27ed4)&&!_0x1073b9){if(_0x1d3215[_0x17ff('0x114')]+_0x1d3215[_0x17ff('0x115')]+_0x1d3215[_0x17ff('0x116')]+_0x1d3215[_0x17ff('0x117')]+_0x1d3215[_0x17ff('0xcf')]+_0x1d3215[_0x17ff('0xe3')]+_0x1d3215[_0x17ff('0x120')]+_0x1d3215[_0x17ff('0x118')]>=_0xd27ed4[_0x17ff('0x119')]){_0x86c992[_0x17ff('0x11a')](_0x1d3215,_0x387c50,_0x180810,_0x3c2e82['reason']);}else{_0x86c992[_0x17ff('0x11d')](_0x1d3215,_0x387c50,_0x180810,_0x3c2e82[_0x17ff('0xc2')]);}}}})[_0x17ff('0x3b')](function(){if(_0x1073b9){hopperUtils[_0x17ff('0xdf')](_0x1d3215,_0x4331a2,_0x2ce755)[_0x17ff('0x3b')](function(){return _0x387c50(0x1);});}});});};Dialer[_0x17ff('0x19')][_0x17ff('0x11a')]=function(_0x361851,_0x2ef43b,_0x52881a,_0x1f0f4e){var _0x25052c=new Final(_0x361851);_0x25052c[_0x17ff('0x6b')]=0xf;_0x25052c[_0x17ff('0x6c')]='Global';this[_0x17ff('0x11d')](_0x25052c,_0x2ef43b,_0x52881a,_0x1f0f4e);};Dialer[_0x17ff('0x19')][_0x17ff('0x11d')]=function(_0x152e3b,_0xda24f7,_0x2834d7,_0x194a81){hopperUtils[_0x17ff('0xc8')](_0x152e3b)['then'](function(){return _0xda24f7(msgResponse(_0x17ff('0x188'),_0x17ff('0x1a3'),_0x194a81));})['catch'](function(){return _0x2834d7(msgResponse('[moveContactManagedDialer][0]','Failure',_0x17ff('0x1a4')));});};Dialer[_0x17ff('0x19')][_0x17ff('0xab')]=function(_0x23415b){var _0xad5f02=_0x23415b[_0x17ff('0x1a5')]/0x64;var _0x4b9ff8=_0x23415b[_0x17ff('0x1a6')]/(_0x23415b[_0x17ff('0x1a6')]+_0x23415b[_0x17ff('0xc1')]);var _0x17ef9c=Math[_0x17ff('0x1a7')](_0x23415b['predictiveIntervalAvailable']*(_0x23415b[_0x17ff('0x1a8')]/0x64));var _0x1d2869=Math[_0x17ff('0x1a7')](_0x23415b['predictiveIntervalAvailable']*(_0x23415b['predictiveIntervalMinThreshold']/0x64));var _0x1effb5=_0x23415b[_0x17ff('0x12d')]+_0x23415b[_0x17ff('0x12f')];var _0x5e4c4f=Math[_0x17ff('0x1a9')](_0x23415b[_0x17ff('0x58')]*_0x23415b[_0x17ff('0x5b')]*_0x23415b[_0x17ff('0x1aa')]*_0x23415b[_0x17ff('0x1ab')]);if(_[_0x17ff('0x3c')](_0x23415b[_0x17ff('0x5f')])){if(!_[_0x17ff('0x3c')](_0x23415b[_0x17ff('0x26')])){_0x23415b[_0x17ff('0x26')]=undefined;loggerPredictive['error'](_0x17ff('0x1ac'),_0x17ff('0x1ad'));}if(!_[_0x17ff('0x3c')](_0x23415b[_0x17ff('0x61')])){loggerPredictive[_0x17ff('0x63')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x23415b[_0x17ff('0x61')]);_0x23415b[_0x17ff('0x61')]=undefined;}_0x23415b[_0x17ff('0x5f')]=moment()[_0x17ff('0x41')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x17ff('0x45')](_0x23415b[_0x17ff('0x43')],_0x17ff('0x1ae'),_0x23415b[_0x17ff('0x5f')]);this[_0x17ff('0xaf')](_0x23415b,0x1);}else if(ifInterval(_0x23415b[_0x17ff('0x1af')],_0x23415b[_0x17ff('0x5f')])){this['handlePower'](_0x23415b,0x1);loggerPredictiveCalls[_0x17ff('0x45')]('[startMethodPredictive][StartProgressive][Loop]',_0x23415b[_0x17ff('0x5f')],_0x23415b[_0x17ff('0x43')]);_0x23415b[_0x17ff('0x58')]=0x0;_0x23415b[_0x17ff('0x1b0')]=0x0;}else if(_0xad5f02<_0x4b9ff8&&_0x23415b[_0x17ff('0x1b1')]==='dropRate'){clearPredictiveAttributes(_0x23415b);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x17ff('0x1b2'),_0x4b9ff8,_0x17ff('0x5f'),_0x23415b[_0x17ff('0x43')]);}else if(_0x5e4c4f<_0x23415b[_0x17ff('0x1b0')]&&_0x23415b[_0x17ff('0x1b1')]===_0x17ff('0x1b3')){clearPredictiveAttributes(_0x23415b);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1b4'),_0x17ff('0x1b5'),_0x5e4c4f,_0x17ff('0x1b6'),_0x23415b[_0x17ff('0x1b0')],_0x17ff('0x5f'),_0x23415b[_0x17ff('0x43')]);}else if(!ifInterval(_0x23415b['dialPredictiveInterval'],_0x23415b[_0x17ff('0x5f')])&&_[_0x17ff('0x3c')](_0x23415b[_0x17ff('0x26')])&&!_[_0x17ff('0x3c')](_0x23415b[_0x17ff('0x5f')])){_0x23415b['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x17ff('0x45')](_0x23415b[_0x17ff('0x43')],'started\x20in\x20predictive\x20at',_0x23415b[_0x17ff('0x26')]);hopperUtils['avgHandleTime'](_0x23415b[_0x17ff('0x1af')])[_0x17ff('0x3b')](this[_0x17ff('0x1b7')](_0x23415b))[_0x17ff('0x3b')](mergeDataErlangB(_0x23415b))[_0x17ff('0x3b')](this[_0x17ff('0x1b8')](_0x23415b))[_0x17ff('0x9a')](loggerCatchPredictive(_0x17ff('0x1b9'),_0x23415b));}else if(!ifInterval(_0x23415b[_0x17ff('0x1af')],_0x23415b[_0x17ff('0x26')])){_0x23415b[_0x17ff('0x1b0')]=0x0;_0x23415b['startPredictive']=moment()[_0x17ff('0x41')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x23415b['name'],_0x17ff('0x1ba'),_0x23415b['startPredictive']);clearInterval(_0x23415b[_0x17ff('0x61')]);_0x23415b[_0x17ff('0x61')]=undefined;hopperUtils['avgHandleTime'](_0x23415b[_0x17ff('0x1af')])['then'](this[_0x17ff('0x1b7')](_0x23415b))[_0x17ff('0x3b')](mergeDataErlangB(_0x23415b))[_0x17ff('0x3b')](this[_0x17ff('0x1b8')](_0x23415b))[_0x17ff('0x9a')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x23415b));}else if(_0x23415b[_0x17ff('0x1bb')]&&_0x1effb5<_0x23415b['predictiveIntervalAvailable']-_0x1d2869){clearPredictiveAttributes(_0x23415b);loggerPredictive[_0x17ff('0x45')](_0x23415b[_0x17ff('0x43')],_0x17ff('0x1bc'),_0x1effb5,_0x17ff('0x1bd'),_0x23415b['predictiveIntervalAvailable'],'-',_0x1d2869,'=',_0x23415b[_0x17ff('0x1bb')]-_0x1d2869,')');}else if(_0x23415b[_0x17ff('0x1bb')]&&_0x1effb5>_0x23415b['predictiveIntervalAvailable']+_0x17ef9c){clearPredictiveAttributes(_0x23415b);loggerPredictive['info'](_0x23415b['name'],_0x17ff('0x1bc'),_0x1effb5,_0x17ff('0x1be'),_0x23415b[_0x17ff('0x1bb')],'+',_0x17ef9c,'=',_0x23415b[_0x17ff('0x1bb')]+_0x17ef9c,')');}};Dialer[_0x17ff('0x19')][_0x17ff('0x1b7')]=function(_0xac0226){var _0x2915e2=this;return function(_0x397bcf){return new Promise(function(_0x4533af,_0x19dffb){_[_0x17ff('0xf2')](_0xac0226,_0x397bcf[0x0]);if(checkGetDataPredictive(_0x397bcf[0x0])){var _0x146f8d=_0xac0226[_0x17ff('0x1bb')]=_0xac0226[_0x17ff('0x12f')]+_0xac0226[_0x17ff('0x12d')];var _0x12974e=_0xac0226[_0x17ff('0x1af')]*0x3c;var _0x2b3efd=_0x397bcf[0x0][_0x17ff('0x50')]+_0x397bcf[0x0][_0x17ff('0x52')];var _0x7c9c2a=(_0x397bcf[0x0]['predictiveIntervalAnsweredCalls']+_0x397bcf[0x0][_0x17ff('0x4b')]+_0x397bcf[0x0][_0x17ff('0x4d')])/_0x397bcf[0x0][_0x17ff('0x47')];_0xac0226[_0x17ff('0x1aa')]=_0x7c9c2a>0x0?_0x7c9c2a:0x1;switch(_0xac0226[_0x17ff('0x1b1')]){case _0x17ff('0x1b3'):var _0x2be4f3=_0xac0226[_0x17ff('0x1a5')]/0x64;return _0x2915e2['abandonmentRate'](_0x146f8d,_0x12974e,_0x2b3efd,_0x7c9c2a,_0x2be4f3)[_0x17ff('0x3b')](function(_0xfef73d){return _0x4533af(_0xfef73d);});case'agentBusyFactor':var _0x1d083f=_0xac0226['dialPredictiveOptimizationPercentage']/0x64;return _0x2915e2[_0x17ff('0x1bf')](_0x146f8d,_0x12974e,_0x2b3efd,_0x7c9c2a,_0x1d083f)[_0x17ff('0x3b')](function(_0x108a3b){return _0x4533af(_0x108a3b);});default:return _0x19dffb(msgResponse(_0x17ff('0x1c0'),'Failure',_0x17ff('0x1c1')));}}else{return _0x19dffb(msgResponse(_0x17ff('0x1c0'),_0x17ff('0x8c'),'check\x20failure'));}});};};Dialer[_0x17ff('0x19')][_0x17ff('0x1c2')]=function(_0x5ae18e){var _0x5c7a7c=this;return function(_0x38f119){return new Promise(function(_0x53dc8f,_0x2ce6f6){_[_0x17ff('0xf2')](_0x5ae18e,_0x38f119[0x0]);if(checkGetDataPredictive(_0x38f119[0x0])){loggerPredictive[_0x17ff('0x45')](JSON[_0x17ff('0x72')](_0x38f119[0x0]));if(_0x5ae18e[_0x17ff('0x1b1')]==='dropRate'){return _0x5c7a7c[_0x17ff('0x144')](_0x5ae18e['id'])[_0x17ff('0x3b')](function(_0x47b588){var _0x25ded3=_0x5ae18e['loggedIn']-_0x47b588[0x0][_0x17ff('0x1c3')];var _0x29b583=_0x5ae18e[_0x17ff('0x1af')]*0x3c;var _0xc41ce1=_0x38f119[0x0]['predictiveIntervalAvgTalktime']+_0x38f119[0x0][_0x17ff('0x52')];var _0x44c74f=(_0x38f119[0x0][_0x17ff('0x49')]+_0x38f119[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x38f119[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x38f119[0x0][_0x17ff('0x47')];var _0x4d0f35=_0x5ae18e['dialPredictiveOptimizationPercentage']/0x64;_0x5ae18e['predictiveIntervalPauses']=_0x47b588[0x0][_0x17ff('0x1c3')]||0x0;_0x5ae18e[_0x17ff('0x1aa')]=_0x44c74f>0x0?_0x44c74f:0x1;return _0x5c7a7c['abandonmentRate'](_0x25ded3,_0x29b583,_0xc41ce1,_0x44c74f,_0x4d0f35);})[_0x17ff('0x3b')](function(_0xe24d99){return _0x53dc8f(_0xe24d99);})[_0x17ff('0x9a')](function(_0xa29714){return _0x2ce6f6(msgResponse('[CatchErlangB]','Failure',JSON[_0x17ff('0x72')](_0xa29714)));});}if(_0x5ae18e[_0x17ff('0x1b1')]===_0x17ff('0x1c4')){return _0x5c7a7c['getVoiceQueueRtPauses'](_0x5ae18e['id'])[_0x17ff('0x3b')](function(_0x47a7ab){var _0x42b7c3=_0x5ae18e[_0x17ff('0x1c5')]-_0x47a7ab[0x0][_0x17ff('0x1c3')];var _0x209496=_0x5ae18e[_0x17ff('0x1af')]*0x3c;var _0xb2f2b=_0x38f119[0x0]['predictiveIntervalAvgTalktime']+_0x38f119[0x0][_0x17ff('0x52')];var _0x1eb10b=(_0x38f119[0x0][_0x17ff('0x49')]+_0x38f119[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x38f119[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x38f119[0x0][_0x17ff('0x47')];var _0x3da206=_0x5ae18e[_0x17ff('0x1a5')]/0x64;_0x5ae18e['predictiveIntervalPauses']=_0x47a7ab[0x0]['outboundQueuePauses']||0x0;_0x5ae18e['predictiveIntervalHitRate']=_0x1eb10b>0x0?_0x1eb10b:0x1;return _0x5c7a7c[_0x17ff('0x1bf')](_0x42b7c3,_0x209496,_0xb2f2b,_0x1eb10b,_0x3da206);})[_0x17ff('0x3b')](function(_0x298346){return _0x53dc8f(_0x298346);})['catch'](function(_0x5c1590){return _0x2ce6f6(msgResponse(_0x17ff('0x1c6'),_0x17ff('0x8c'),JSON[_0x17ff('0x72')](_0x5c1590)));});}}else{return _0x2ce6f6(msgResponse(_0x17ff('0x1c0'),_0x17ff('0x8c'),_0x17ff('0x1c7')));}});};};Dialer[_0x17ff('0x19')][_0x17ff('0x1b8')]=function(_0x4d7c1e){var _0x12efea=this;return function(){var _0x390b04=0x0;var _0x18ee7e=Math[_0x17ff('0x1a9')](_0x4d7c1e[_0x17ff('0x59')]*0x3e8);if(_0x18ee7e>0x0){_0x18ee7e=_0x18ee7e<0x64?0x64:_0x18ee7e;loggerPredictive[_0x17ff('0x45')](_0x4d7c1e[_0x17ff('0x43')],_0x17ff('0x1c8'),_0x18ee7e,'milliseconds');_0x4d7c1e[_0x17ff('0x61')]=setInterval(function(){_0x12efea[_0x17ff('0x61')](_0x4d7c1e);loggerPredictiveCalls[_0x17ff('0x45')]('[handlePredictive]',_0x390b04+=0x1);},_0x18ee7e);}else{loggerPredictive['info'](_0x4d7c1e[_0x17ff('0x43')],_0x17ff('0x1c9'));}};};Dialer[_0x17ff('0x19')][_0x17ff('0x1ca')]=function(_0x3c4b1f,_0x1cdb78){var _0x23dfc3=this;return function(_0x5e7f1c){if(_['isEmpty'](_0x5e7f1c)){if(_[_0x17ff('0xed')](_0x1cdb78[_0x17ff('0x148')])||!_0x1cdb78['recallme']){if(_0x3c4b1f[_0x17ff('0xac')]==='booked'){_0x3c4b1f[_0x17ff('0x6f')]=_[_0x17ff('0x3c')](_0x3c4b1f[_0x17ff('0x6f')])?!![]:_0x3c4b1f['queueStatusComplete'];var _0x2e5682=uuid['v4']();_0x23dfc3['actions'][_0x2e5682]=new Action(_0x3c4b1f,_0x1cdb78,_0x2e5682);loggerBooked['info'](_0x17ff('0x1cb'),_0x2e5682,_0x17ff('0x1cc'),JSON[_0x17ff('0x72')](_0x3c4b1f[_0x17ff('0x6f')]),_0x17ff('0x1cd'),_0x3c4b1f[_0x17ff('0x43')]);if(_0x3c4b1f[_0x17ff('0x6f')]){_0x3c4b1f[_0x17ff('0x6f')]=![];_0x23dfc3['queueBooked'][_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xbb')]]=[];ami[_0x17ff('0x96')]({'actionid':_0x2e5682,'action':'queuestatus','queue':_0x3c4b1f['name']})['catch'](function(){_0x23dfc3['updateOriginated'](_0x3c4b1f);hopperUtils[_0x17ff('0xd6')]({'active':![],'ContactId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xfe')],'ListId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682]['ListId'],'VoiceQueueId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xda')]||undefined,'CampaignId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x1ce')));delete _0x23dfc3[_0x17ff('0x22')][_0x2e5682];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x17ff('0x72')](_0x3c4b1f[_0x17ff('0x6f')]),'Queue:\x20',_0x3c4b1f['name']);_0x23dfc3[_0x17ff('0xca')](_0x3c4b1f);hopperUtils[_0x17ff('0xd6')]({'active':![],'ContactId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xfe')],'ListId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xd9')],'VoiceQueueId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682]['VoiceQueueId']||undefined,'CampaignId':_0x23dfc3[_0x17ff('0x22')][_0x2e5682][_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x23dfc3[_0x17ff('0x22')][_0x2e5682];}}else{return _0x23dfc3[_0x17ff('0x14e')](_0x3c4b1f,_0x1cdb78);}}else{if(utils[_0x17ff('0x5e')](undefined,_0x1cdb78[_0x17ff('0x1cf')])<_0x3c4b1f[_0x17ff('0x1d0')]*0x3c){if(_0x1cdb78[_0x17ff('0x13b')]&&!_0x1cdb78[_0x17ff('0x13b')][_0x17ff('0x1d1')]){_0x23dfc3['preview']['run'](_0x1cdb78['id'])['finally'](function(){_0x23dfc3[_0x17ff('0xca')](_0x3c4b1f);});}else{hopperUtils[_0x17ff('0x1d2')]({'active':![]},_0x1cdb78['id'],0x1)[_0x17ff('0x1b')](function(){_0x23dfc3[_0x17ff('0xca')](_0x3c4b1f);});}}else{_0x3c4b1f['outboundReCallsDay']+=0x1;_0x23dfc3[_0x17ff('0xca')](_0x3c4b1f);if(_0x3c4b1f['dialRecallInQueue']){hopperUtils[_0x17ff('0xd6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1cdb78[_0x17ff('0xfe')],'ListId':_0x1cdb78[_0x17ff('0xd9')],'VoiceQueueId':_0x1cdb78[_0x17ff('0xda')]||undefined,'CampaignId':_0x1cdb78[_0x17ff('0xe6')]||undefined})[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x1d3')));hopperUtils['createHistory'](createObjHistory(_0x3c4b1f,_0x1cdb78,utils[_0x17ff('0x68')][_0x17ff('0x1d4')],0x17,_0x17ff('0x1d5')))[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x1d6')));}else{_0x23dfc3[_0x17ff('0x10f')](createObjHistory(_0x3c4b1f,_0x1cdb78,utils[_0x17ff('0x68')][_0x17ff('0x1d7')],0x16,_0x17ff('0x1d8')),'[Originate][HistoryRecallClose][historyCatch]',_0x17ff('0x1d9'));}}}}else{_0x3c4b1f[_0x17ff('0x1da')]+=0x1;_0x23dfc3[_0x17ff('0x10f')](createObjHistory(_0x3c4b1f,_0x1cdb78,utils[_0x17ff('0x68')][_0x17ff('0x1db')],0xd,_0x17ff('0x1dc')),_0x17ff('0x1dd'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x17ff('0x19')]['handleIvr']=function(_0x2aeb18){var _0x4c12b2=this;var _0x4371d2=_0x2aeb18['limitCalls']-_0x2aeb18['originated']-_0x2aeb18[_0x17ff('0x1de')];emitCampaignSummary(_0x2aeb18);if(_0x4371d2>0x0){if(_0x4371d2>this['maxNumberOriginate']){_0x4371d2=this[_0x17ff('0x21')];}_0x2aeb18[_0x17ff('0x1de')]+=_0x4371d2;hopperUtils[_0x17ff('0x1df')](_0x2aeb18['id'],_0x4371d2,_0x2aeb18[_0x17ff('0x1e0')],_0x2aeb18)['then'](function(_0x5e9929){_0x2aeb18['temp']-=_0x4371d2;_0x2aeb18['temp']=_0x2aeb18['temp']>0x0?_0x2aeb18[_0x17ff('0x1de')]:0x0;if(!utils[_0x17ff('0x1e1')](_0x5e9929)){_0x2aeb18[_0x17ff('0x6a')]=utils['CAMPAIGN_STATUS'][_0x17ff('0x1e2')];logger[_0x17ff('0x45')](_0x17ff('0x1e3')+_0x2aeb18[_0x17ff('0x43')]);}else{_0x2aeb18['originated']+=_0x5e9929[_0x17ff('0x94')];_0x2aeb18[_0x17ff('0x6a')]=utils[_0x17ff('0x68')][_0x17ff('0x1e4')];for(var _0x5dbd67=0x0;_0x5dbd67<_0x5e9929[_0x17ff('0x94')];_0x5dbd67+=0x1){_0x2aeb18[_0x17ff('0x1e5')]+=0x1;if(_['isNil'](_0x5e9929[_0x5dbd67])||_['isNil'](_0x5e9929[_0x5dbd67][_0x17ff('0x167')])||_['isNil'](_0x5e9929[_0x5dbd67][_0x17ff('0x152')])){_0x4c12b2['emptyContact'](_0x17ff('0x1e6'),_0x2aeb18,_0x5e9929[_0x5dbd67]);}else{hopperUtils[_0x17ff('0x1e7')](_[_0x17ff('0x73')](_0x5e9929[_0x5dbd67],[_0x17ff('0xe6'),_0x17ff('0x152')]))['then'](_0x4c12b2[_0x17ff('0x1ca')](_0x2aeb18,_0x5e9929[_0x5dbd67]))['catch'](_0x4c12b2[_0x17ff('0x1e8')](_0x17ff('0x1e9'),_0x2aeb18));}}}})[_0x17ff('0x9a')](loggerGetContactDialer(_0x17ff('0x1ea'),_0x2aeb18,_0x4371d2));}};Dialer[_0x17ff('0x19')][_0x17ff('0xaf')]=function(_0xe88b78,_0x1e589f){var _0x307ac7=this;var _0xb648af=[];if(_0x1e589f<0x1||_0xe88b78[_0x17ff('0xac')]===_0x17ff('0x9')){_0x1e589f=0x1;}var _0x6a68e5=Math[_0x17ff('0x1a9')](_0xe88b78['available']*_0x1e589f)-_0xe88b78['originated']-_0xe88b78[_0x17ff('0x1de')];if(_0xe88b78[_0x17ff('0x1eb')]>0x0){var _0x29d2cc=_0xe88b78[_0x17ff('0x1eb')]-_0xe88b78[_0x17ff('0x7d')]-_0xe88b78[_0x17ff('0x12f')]-_0xe88b78[_0x17ff('0x1de')]-_0xe88b78[_0x17ff('0x1ec')];if(_0x6a68e5>_0x29d2cc){_0x6a68e5=_0x29d2cc;}}if(_0x6a68e5>0x0){if(_0xe88b78['dialMethod']===_0x17ff('0x9')){_0x6a68e5=0x1;}if(_0x6a68e5>this[_0x17ff('0x21')]){_0x6a68e5=this['maxNumberOriginate'];}_0xe88b78[_0x17ff('0x1de')]+=_0x6a68e5;for(var _0x235b52 in this[_0x17ff('0xf0')]){if(typeof this['agents'][_0x235b52]!=='undefined'){if(this[_0x17ff('0xf0')][_0x235b52][_0x17ff('0x6b')]===_0x17ff('0x1ed')&&this[_0x17ff('0xf0')][_0x235b52][_0x17ff('0x85')]===_0x17ff('0x1ee')){_0xb648af[_0x17ff('0x95')](this[_0x17ff('0xf0')][_0x235b52]['id']);}}}hopperUtils[_0x17ff('0x1ef')](_0xe88b78,_0xb648af,_0x6a68e5)[_0x17ff('0x3b')](function(_0x1379b3){_0xe88b78['temp']-=_0x6a68e5;_0xe88b78[_0x17ff('0x1de')]=_0xe88b78[_0x17ff('0x1de')]>0x0?_0xe88b78[_0x17ff('0x1de')]:0x0;if(!utils[_0x17ff('0x1e1')](_0x1379b3)){hopperUtils[_0x17ff('0x1f0')](_0xe88b78)[_0x17ff('0x3b')](sendMessageReschedule(_0xe88b78))[_0x17ff('0x9a')](loggerCatch(_0x17ff('0x1f1')));}else{_0xe88b78[_0x17ff('0x7d')]+=_0x1379b3[_0x17ff('0x94')];_0xe88b78[_0x17ff('0x6a')]=_0xe88b78[_0x17ff('0xac')]===_0x17ff('0x9')?utils[_0x17ff('0x68')][_0x17ff('0x130')]:utils[_0x17ff('0x68')][_0x17ff('0x1e4')];for(var _0x2500c7=0x0;_0x2500c7<_0x1379b3[_0x17ff('0x94')];_0x2500c7+=0x1){if(_[_0x17ff('0xed')](_0x1379b3[_0x2500c7])||_[_0x17ff('0xed')](_0x1379b3[_0x2500c7]['Contact'])||_['isNil'](_0x1379b3[_0x2500c7][_0x17ff('0x152')])){_0x307ac7[_0x17ff('0x147')](_0x17ff('0x1e6'),_0xe88b78,_0x1379b3[_0x2500c7]);}else{hopperUtils['checkIsBlackList'](_[_0x17ff('0x73')](_0x1379b3[_0x2500c7],['VoiceQueueId',_0x17ff('0x152')]))[_0x17ff('0x3b')](_0x307ac7[_0x17ff('0x1ca')](_0xe88b78,_0x1379b3[_0x2500c7]))[_0x17ff('0x9a')](_0x307ac7['loggerHandler'](_0x17ff('0x1e6'),_0xe88b78));}}}})[_0x17ff('0x9a')](loggerGetContactDialer('[getContactDialer2]',_0xe88b78,_0x6a68e5));}};Dialer[_0x17ff('0x19')][_0x17ff('0x61')]=function(_0x3f7b88){if(_0x3f7b88[_0x17ff('0x1eb')]>0x0){var _0x170c45=_0x3f7b88['dialLimitQueue']-_0x3f7b88[_0x17ff('0x7d')]-_0x3f7b88[_0x17ff('0x12f')];if(_0x170c45>0x0){this[_0x17ff('0x1f2')](_0x3f7b88);}else{loggerPredictiveCalls[_0x17ff('0x45')]('[handlePredictive][limitChannel]');}}else{this[_0x17ff('0x1f2')](_0x3f7b88);}};Dialer[_0x17ff('0x19')][_0x17ff('0x1f2')]=function(_0x482339){var _0xa0c00f=this;var _0x2f5ecd=[];_0x482339[_0x17ff('0x7d')]+=0x1;for(var _0x5c6aa0 in this[_0x17ff('0xf0')]){if(typeof this[_0x17ff('0xf0')][_0x5c6aa0]!==_0x17ff('0xa4')){if(this['agents'][_0x5c6aa0][_0x17ff('0x6b')]==='not_inuse'&&this[_0x17ff('0xf0')][_0x5c6aa0][_0x17ff('0x85')]==='reachable'){_0x2f5ecd[_0x17ff('0x95')](this[_0x17ff('0xf0')][_0x5c6aa0]['id']);}}}return this[_0x17ff('0x1ef')](_0x482339['id'],_0x2f5ecd,0x1,_0x482339['dialOrderByScheduledAt'],_0x482339)[_0x17ff('0x3b')](function(_0x1ee684){if(!utils[_0x17ff('0x1e1')](_0x1ee684)){utils[_0x17ff('0x66')](_0x482339,0x1,0x0);return hopperUtils[_0x17ff('0x1f0')](_0x482339)[_0x17ff('0x3b')](sendMessageReschedule(_0x482339))['catch'](loggerCatch(_0x17ff('0x1f1')));}else{_0x482339[_0x17ff('0x6a')]=utils[_0x17ff('0x68')][_0x17ff('0x1e4')];if(_['isNil'](_0x1ee684[0x0])||_['isNil'](_0x1ee684[0x0]['Contact'])||_[_0x17ff('0xed')](_0x1ee684[0x0][_0x17ff('0x152')])){_0xa0c00f[_0x17ff('0x147')]('[actionOriginate]\x20',_0x482339,_0x1ee684[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x17ff('0x73')](_0x1ee684[0x0],[_0x17ff('0xda'),'phone']))[_0x17ff('0x3b')](_0xa0c00f[_0x17ff('0x1ca')](_0x482339,_0x1ee684[0x0]))[_0x17ff('0x9a')](_0xa0c00f['loggerHandler'](_0x17ff('0x1f3'),_0x482339));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x482339,0x1));};Dialer[_0x17ff('0x19')][_0x17ff('0x1f4')]=function(_0x4bcfb1,_0x5416f9,_0x29abe7,_0x2fc90e,_0x57fd1c,_0x3974d4){loggerPredictive['info'](_0x17ff('0x1f5'));loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f6'),_0x4bcfb1);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f7'),_0x5416f9);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f8'),_0x29abe7);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f9'),_0x2fc90e);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1fa'),_0x57fd1c);loggerPredictive['info'](_0x17ff('0x5d'));return new Promise(function(_0x5175b4,_0x4a3594){if(_0x4bcfb1<=0x0||isNaN(_0x4bcfb1)){return _0x4a3594(msgResponse(_0x17ff('0x1fb'),'Error',_0x17ff('0x1fc')+_0x4bcfb1));}if(_0x29abe7<=0x0||isNaN(_0x29abe7)){return _0x4a3594(msgResponse('[abandonmentRate]',_0x17ff('0x81'),_0x17ff('0x1fd')+_0x29abe7));}if(_0x2fc90e<=0x0||isNaN(_0x2fc90e)){return _0x4a3594(msgResponse(_0x17ff('0x1fb'),'Error',_0x17ff('0x1fe')+_0x2fc90e));}if(_0x5416f9<=0x0||isNaN(_0x5416f9)){return _0x4a3594(msgResponse(_0x17ff('0x1fb'),_0x17ff('0x81'),_0x17ff('0x1ff')+_0x5416f9));}if(_0x57fd1c<=0x0||isNaN(_0x57fd1c)){return _0x4a3594(msgResponse(_0x17ff('0x1fb'),_0x17ff('0x81'),_0x17ff('0x200')+_0x57fd1c));}_0x3974d4=_0x3974d4||0x0;var _0x55853d=0x1/_0x29abe7;var _0x3fdfea=0x0;var _0x108a27=0x0;var _0x2208f9=0x0;var _0x325e34=0x0;for(var _0x27f827=0x0;_0x2208f9<_0x57fd1c;_0x27f827+=0x1){_0x108a27=_0x27f827/_0x5416f9;_0x3fdfea=(_0x2fc90e*_0x108a27+_0x3974d4)/_0x55853d;_0x2208f9=utils[_0x17ff('0x201')](_0x3fdfea,_0x4bcfb1);_0x325e34=_0x3fdfea/_0x4bcfb1*(0x1-utils[_0x17ff('0x201')](_0x3fdfea,_0x4bcfb1));}return _0x5175b4({'erlangCalls':_0x27f827,'erlangCallToSecond':_0x5416f9/_0x27f827,'erlangAbandonmentRate':_0x2208f9,'erlangBusyFactor':_0x325e34});});};Dialer[_0x17ff('0x19')][_0x17ff('0x1bf')]=function(_0x20bf2c,_0x56819d,_0x39e388,_0x3d06ec,_0x51a8ca,_0xfefbc9){loggerPredictive[_0x17ff('0x45')](_0x17ff('0x202'));loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f6'),_0x20bf2c);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f7'),_0x56819d);loggerPredictive[_0x17ff('0x45')]('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',_0x39e388);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x1f9'),_0x3d06ec);loggerPredictive[_0x17ff('0x45')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x51a8ca);loggerPredictive[_0x17ff('0x45')](_0x17ff('0x5d'));return new Promise(function(_0x361990,_0x496587){if(_0x20bf2c<=0x0||isNaN(_0x20bf2c)){return _0x496587(msgResponse(_0x17ff('0x203'),_0x17ff('0x81'),_0x17ff('0x1fc')+_0x20bf2c));}if(_0x39e388<=0x0||isNaN(_0x39e388)){return _0x496587(msgResponse(_0x17ff('0x203'),_0x17ff('0x81'),'Ts\x20=\x20'+_0x39e388));}if(_0x3d06ec<=0x0||isNaN(_0x3d06ec)){return _0x496587(msgResponse(_0x17ff('0x203'),_0x17ff('0x81'),_0x17ff('0x1fe')+_0x3d06ec));}if(_0x56819d<=0x0||isNaN(_0x56819d)){return _0x496587(msgResponse(_0x17ff('0x203'),'Error',_0x17ff('0x1ff')+_0x56819d));}if(_0x51a8ca<=0x0||isNaN(_0x51a8ca)){return _0x496587(msgResponse(_0x17ff('0x203'),'Error',_0x17ff('0x204')+_0x51a8ca));}_0xfefbc9=_0xfefbc9||0x0;var _0x1c09af=0x1/_0x39e388;var _0x398672=0x0;var _0x41e1bb=0x0;var _0x30a622=0x0;var _0x99b296=0x0;for(var _0x164f9d=0x0;_0x99b296<_0x51a8ca;_0x164f9d+=0x1){_0x41e1bb=_0x164f9d/_0x56819d;_0x398672=(_0x3d06ec*_0x41e1bb+_0xfefbc9)/_0x1c09af;_0x30a622=utils[_0x17ff('0x201')](_0x398672,_0x20bf2c);_0x99b296=_0x398672/_0x20bf2c*(0x1-utils[_0x17ff('0x201')](_0x398672,_0x20bf2c));}return _0x361990({'erlangCalls':_0x164f9d,'erlangCallToSecond':_0x56819d/_0x164f9d,'erlangAbandonmentRate':_0x30a622,'erlangBusyFactor':_0x99b296});});};module[_0x17ff('0x205')]=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 46e6103..f5c602e 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 _0x5679=['countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x4a8a1d,_0x5649bf){var _0x412204=function(_0x3782ca){while(--_0x3782ca){_0x4a8a1d['push'](_0x4a8a1d['shift']());}};_0x412204(++_0x5649bf);}(_0x5679,0x1ac));var _0x9567=function(_0x40eaf4,_0x3893ba){_0x40eaf4=_0x40eaf4-0x0;var _0xad2dec=_0x5679[_0x40eaf4];return _0xad2dec;};'use strict';var util=require(_0x9567('0x0'));var _=require(_0x9567('0x1'));var moment=require(_0x9567('0x2'));function checkNameSurname(_0x2a657a,_0x501d46,_0x36eaae){var _0x3c6a2f='';if(!_[_0x9567('0x3')](_0x501d46)&&_0x9567('0x4')===typeof _0x501d46){_0x3c6a2f+=_0x501d46;}if(!_['isNil'](_0x36eaae)&&_0x9567('0x4')===typeof _0x36eaae){_0x3c6a2f+='\x20'+_0x36eaae;}if(_0x3c6a2f!==''){return _0x3c6a2f;}return _0x2a657a;}function Action(_0xb068c5,_0xfc64f,_0xd3b41c){this[_0x9567('0x5')]=_0xb068c5;this['uniqueid']=_0xd3b41c||undefined;this[_0x9567('0x6')]=checkNameSurname(_0xfc64f[_0x9567('0x7')][_0x9567('0x8')],_0xfc64f['Contact']['firstName'],_0xfc64f['Contact'][_0x9567('0x9')]);this[_0x9567('0xa')]=_0xfc64f['phone'];this[_0x9567('0xb')]=_0xb068c5[_0x9567('0x6')];this[_0x9567('0xc')]=_0xfc64f[_0x9567('0xc')]||![];this[_0x9567('0xd')]=_0xb068c5[_0x9567('0xd')];this[_0x9567('0xe')]=_0xb068c5[_0x9567('0xe')]||0x3;this[_0x9567('0xf')]=_0xfc64f[_0x9567('0xf')];this[_0x9567('0x10')]=_0xfc64f['countbusyretry'];this[_0x9567('0x11')]=_0xfc64f[_0x9567('0x11')];this[_0x9567('0x12')]=_0xfc64f['countnoanswerretry'];this[_0x9567('0x13')]=_0xfc64f[_0x9567('0x13')];this[_0x9567('0x14')]=_0xfc64f[_0x9567('0x14')];this[_0x9567('0x15')]=_0xfc64f['countabandonedretry'];this[_0x9567('0x16')]=_0xfc64f[_0x9567('0x16')];this[_0x9567('0x17')]=_0xfc64f[_0x9567('0x17')];this['ContactId']=_0xfc64f['ContactId'];this[_0x9567('0x18')]=_0xfc64f['ListId'];this[_0x9567('0x19')]=_0xfc64f[_0x9567('0x19')];this[_0x9567('0x1a')]=_0xfc64f[_0x9567('0x1a')];this[_0x9567('0x1b')]=_0xfc64f['CampaignId'];this[_0x9567('0x1c')]=_0xfc64f['id'];this[_0x9567('0x1d')]=_0xfc64f[_0x9567('0x7')][_0x9567('0x1e')]||'';this['starttime']=moment()[_0x9567('0x1f')](_0x9567('0x20'));this[_0x9567('0x21')]=_0xfc64f['callback'];this[_0x9567('0x22')]=_0xfc64f[_0x9567('0x22')];this[_0x9567('0x23')]=_0xfc64f[_0x9567('0x23')];this[_0x9567('0x24')]=_0xfc64f[_0x9567('0x24')];this[_0x9567('0x25')]='';this[_0x9567('0x26')]='';}Action[_0x9567('0x27')][_0x9567('0x28')]=function(){return util[_0x9567('0x1f')](_0x9567('0x29'),this[_0x9567('0x6')],this[_0x9567('0x5')][_0x9567('0x2a')]>0x0?this[_0x9567('0xa')]['substring'](this[_0x9567('0x5')][_0x9567('0x2a')]):this['number']);};Action[_0x9567('0x27')][_0x9567('0x2b')]=function(){return this[_0x9567('0xb')];};module[_0x9567('0x2c')]=Action; \ No newline at end of file +var _0xecb8=['number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','dialCutDigit','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName'];(function(_0x4545aa,_0x4d736a){var _0x157a0a=function(_0x2cb60b){while(--_0x2cb60b){_0x4545aa['push'](_0x4545aa['shift']());}};_0x157a0a(++_0x4d736a);}(_0xecb8,0x14e));var _0x8ecb=function(_0x4414c6,_0x17302d){_0x4414c6=_0x4414c6-0x0;var _0x3eff5d=_0xecb8[_0x4414c6];return _0x3eff5d;};'use strict';var util=require('util');var _=require(_0x8ecb('0x0'));var moment=require(_0x8ecb('0x1'));function checkNameSurname(_0x77b7a1,_0x46bbe4,_0x41e9f6){var _0x206150='';if(!_[_0x8ecb('0x2')](_0x46bbe4)&&_0x8ecb('0x3')===typeof _0x46bbe4){_0x206150+=_0x46bbe4;}if(!_[_0x8ecb('0x2')](_0x41e9f6)&&_0x8ecb('0x3')===typeof _0x41e9f6){_0x206150+='\x20'+_0x41e9f6;}if(_0x206150!==''){return _0x206150;}return _0x77b7a1;}function Action(_0x49f803,_0x35ee12,_0x1430b){this[_0x8ecb('0x4')]=_0x49f803;this[_0x8ecb('0x5')]=_0x1430b||undefined;this['name']=checkNameSurname(_0x35ee12[_0x8ecb('0x6')][_0x8ecb('0x7')],_0x35ee12['Contact'][_0x8ecb('0x8')],_0x35ee12[_0x8ecb('0x6')][_0x8ecb('0x9')]);this[_0x8ecb('0xa')]=_0x35ee12['phone'];this[_0x8ecb('0xb')]=_0x49f803[_0x8ecb('0xc')];this[_0x8ecb('0xd')]=_0x35ee12[_0x8ecb('0xd')]||![];this[_0x8ecb('0xe')]=_0x49f803['type'];this[_0x8ecb('0xf')]=_0x49f803[_0x8ecb('0xf')]||0x3;this[_0x8ecb('0x10')]=_0x35ee12[_0x8ecb('0x10')];this[_0x8ecb('0x11')]=_0x35ee12[_0x8ecb('0x11')];this[_0x8ecb('0x12')]=_0x35ee12[_0x8ecb('0x12')];this[_0x8ecb('0x13')]=_0x35ee12[_0x8ecb('0x13')];this[_0x8ecb('0x14')]=_0x35ee12['countnosuchnumberretry'];this[_0x8ecb('0x15')]=_0x35ee12[_0x8ecb('0x15')];this[_0x8ecb('0x16')]=_0x35ee12[_0x8ecb('0x16')];this['countmachineretry']=_0x35ee12[_0x8ecb('0x17')];this['countagentrejectretry']=_0x35ee12[_0x8ecb('0x18')];this[_0x8ecb('0x19')]=_0x35ee12['ContactId'];this[_0x8ecb('0x1a')]=_0x35ee12[_0x8ecb('0x1a')];this[_0x8ecb('0x1b')]=_0x35ee12[_0x8ecb('0x1b')];this[_0x8ecb('0x1c')]=_0x35ee12['VoiceQueueId'];this[_0x8ecb('0x1d')]=_0x35ee12[_0x8ecb('0x1d')];this[_0x8ecb('0x1e')]=_0x35ee12['id'];this[_0x8ecb('0x1f')]=_0x35ee12['Contact'][_0x8ecb('0x8')]||'';this[_0x8ecb('0x20')]=moment()[_0x8ecb('0x21')](_0x8ecb('0x22'));this[_0x8ecb('0x23')]=_0x35ee12['callback'];this['callbackuniqueid']=_0x35ee12[_0x8ecb('0x24')];this[_0x8ecb('0x25')]=_0x35ee12[_0x8ecb('0x25')];this[_0x8ecb('0x26')]=_0x35ee12[_0x8ecb('0x26')];this[_0x8ecb('0x27')]='';this['originatecalleridname']='';}Action[_0x8ecb('0x28')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x8ecb('0x29')]>0x0?this[_0x8ecb('0xa')]['substring'](this[_0x8ecb('0x4')][_0x8ecb('0x29')]):this[_0x8ecb('0xa')]);};Action[_0x8ecb('0x28')]['getQueue']=function(){return this[_0x8ecb('0xb')];};module[_0x8ecb('0x2a')]=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 9523a5f..16395f9 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 _0x3a3b=['ringtime','holdtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3a3b,0x1bf));var _0xb3a3=function(_0x5063f3,_0xae0553){_0x5063f3=_0x5063f3-0x0;var _0xcd9e2e=_0x3a3b[_0x5063f3];return _0xcd9e2e;};'use strict';var moment=require(_0xb3a3('0x0'));var utils=require('../utils');function AgentComplete(_0x3f1de2,_0x578570){this[_0xb3a3('0x1')]=0x4;this[_0xb3a3('0x2')]='Answer';this[_0xb3a3('0x3')]=_0x3f1de2[_0xb3a3('0x3')];this['type']=_0x3f1de2[_0xb3a3('0x4')];this[_0xb3a3('0x5')]=_0x3f1de2[_0xb3a3('0x4')]===_0xb3a3('0x6')?_0xb3a3('0x7'):_0x3f1de2[_0xb3a3('0x4')];this['countbusyretry']=_0x3f1de2[_0xb3a3('0x8')];this[_0xb3a3('0x9')]=_0x3f1de2[_0xb3a3('0x9')];this['countnoanswerretry']=_0x3f1de2[_0xb3a3('0xa')];this[_0xb3a3('0xb')]=_0x3f1de2[_0xb3a3('0x8')]+_0x3f1de2[_0xb3a3('0x9')]+_0x3f1de2['countnoanswerretry']+_0x3f1de2['countnosuchnumberretry']+_0x3f1de2[_0xb3a3('0xc')]+_0x3f1de2[_0xb3a3('0xd')]+_0x3f1de2[_0xb3a3('0xe')]+_0x3f1de2['countagentrejectretry'];this[_0xb3a3('0xf')]=_0x3f1de2[_0xb3a3('0xf')];this[_0xb3a3('0xc')]=_0x3f1de2[_0xb3a3('0xc')];this[_0xb3a3('0xd')]=_0x3f1de2[_0xb3a3('0xd')];this[_0xb3a3('0xe')]=_0x3f1de2[_0xb3a3('0xe')];this[_0xb3a3('0x10')]=_0x3f1de2[_0xb3a3('0x10')];this[_0xb3a3('0x11')]=_0x578570['uniqueid'];this[_0xb3a3('0x12')]=_0x3f1de2[_0xb3a3('0x13')];this['calleridnum']=_0x3f1de2[_0xb3a3('0x14')];this[_0xb3a3('0x15')]=_0x3f1de2['starttime'];this[_0xb3a3('0x16')]=_0x3f1de2[_0xb3a3('0x16')];this[_0xb3a3('0x17')]=_0x3f1de2[_0xb3a3('0x17')];this[_0xb3a3('0x18')]=moment()['format'](_0xb3a3('0x19'));this[_0xb3a3('0x1a')]=utils['getSeconds'](_0x3f1de2['responsetime'],_0x3f1de2[_0xb3a3('0x15')]);this[_0xb3a3('0x1b')]=utils[_0xb3a3('0x1c')](_0x3f1de2[_0xb3a3('0x17')],_0x3f1de2[_0xb3a3('0x16')]);this[_0xb3a3('0x1d')]=utils[_0xb3a3('0x1c')](this[_0xb3a3('0x18')],_0x3f1de2[_0xb3a3('0x17')]);this[_0xb3a3('0x7')]=_0x578570['queue'];this[_0xb3a3('0x1e')]=_0x578570[_0xb3a3('0x1e')];this[_0xb3a3('0x1f')]=_0x578570[_0xb3a3('0x1f')];this['callback']=_0x3f1de2[_0xb3a3('0x20')];this[_0xb3a3('0x21')]=_0x3f1de2[_0xb3a3('0x21')];this[_0xb3a3('0x22')]=_0x3f1de2['callbackat'];this[_0xb3a3('0x23')]=_0x3f1de2['recallme'];this['ContactId']=_0x3f1de2[_0xb3a3('0x24')];this['ListId']=_0x3f1de2[_0xb3a3('0x25')];this[_0xb3a3('0x26')]=_0x3f1de2[_0xb3a3('0x26')];this[_0xb3a3('0x27')]=_0x3f1de2[_0xb3a3('0x27')];this[_0xb3a3('0x28')]=_0x3f1de2[_0xb3a3('0x28')];this['originatecalleridnum']=_0x3f1de2[_0xb3a3('0x29')]||'';this[_0xb3a3('0x2a')]=_0x3f1de2[_0xb3a3('0x2a')]||'';this['agiafterat']=_0x3f1de2['agiafterat'];}module['exports']=AgentComplete; \ No newline at end of file +var _0x9e24=['starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','answertime','membername','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number'];(function(_0x39afcc,_0x33331d){var _0x4021ee=function(_0x112c57){while(--_0x112c57){_0x39afcc['push'](_0x39afcc['shift']());}};_0x4021ee(++_0x33331d);}(_0x9e24,0x118));var _0x49e2=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0x9e24[_0x46cf00];return _0x3974dc;};'use strict';var moment=require('moment');var utils=require(_0x49e2('0x0'));function AgentComplete(_0x1359a9,_0x2e451f){this[_0x49e2('0x1')]=0x4;this[_0x49e2('0x2')]=_0x49e2('0x3');this['scheduledat']=_0x1359a9[_0x49e2('0x4')];this[_0x49e2('0x5')]=_0x1359a9[_0x49e2('0x5')];this[_0x49e2('0x6')]=_0x1359a9['type']==='outbound'?_0x49e2('0x7'):_0x1359a9['type'];this[_0x49e2('0x8')]=_0x1359a9[_0x49e2('0x8')];this[_0x49e2('0x9')]=_0x1359a9[_0x49e2('0x9')];this[_0x49e2('0xa')]=_0x1359a9[_0x49e2('0xa')];this[_0x49e2('0xb')]=_0x1359a9[_0x49e2('0x8')]+_0x1359a9[_0x49e2('0x9')]+_0x1359a9['countnoanswerretry']+_0x1359a9['countnosuchnumberretry']+_0x1359a9[_0x49e2('0xc')]+_0x1359a9[_0x49e2('0xd')]+_0x1359a9[_0x49e2('0xe')]+_0x1359a9[_0x49e2('0xf')];this[_0x49e2('0x10')]=_0x1359a9['countnosuchnumberretry'];this[_0x49e2('0xc')]=_0x1359a9[_0x49e2('0xc')];this['countabandonedretry']=_0x1359a9['countabandonedretry'];this[_0x49e2('0xe')]=_0x1359a9[_0x49e2('0xe')];this[_0x49e2('0xf')]=_0x1359a9['countagentrejectretry'];this['uniqueid']=_0x2e451f['uniqueid'];this[_0x49e2('0x11')]=_0x1359a9[_0x49e2('0x12')];this[_0x49e2('0x13')]=_0x1359a9[_0x49e2('0x14')];this['starttime']=_0x1359a9[_0x49e2('0x15')];this[_0x49e2('0x16')]=_0x1359a9['responsetime'];this['answertime']=_0x1359a9['answertime'];this[_0x49e2('0x17')]=moment()[_0x49e2('0x18')](_0x49e2('0x19'));this['ringtime']=utils[_0x49e2('0x1a')](_0x1359a9[_0x49e2('0x16')],_0x1359a9[_0x49e2('0x15')]);this[_0x49e2('0x1b')]=utils[_0x49e2('0x1a')](_0x1359a9['answertime'],_0x1359a9['responsetime']);this[_0x49e2('0x1c')]=utils['getSeconds'](this['endtime'],_0x1359a9[_0x49e2('0x1d')]);this[_0x49e2('0x7')]=_0x2e451f[_0x49e2('0x7')];this[_0x49e2('0x1e')]=_0x2e451f['membername'];this['reason']=_0x2e451f['reason'];this[_0x49e2('0x1f')]=_0x1359a9[_0x49e2('0x1f')];this[_0x49e2('0x20')]=_0x1359a9[_0x49e2('0x20')];this['callbackat']=_0x1359a9['callbackat'];this[_0x49e2('0x21')]=_0x1359a9[_0x49e2('0x21')];this[_0x49e2('0x22')]=_0x1359a9[_0x49e2('0x22')];this[_0x49e2('0x23')]=_0x1359a9[_0x49e2('0x23')];this[_0x49e2('0x24')]=_0x1359a9[_0x49e2('0x24')];this['VoiceQueueId']=_0x1359a9[_0x49e2('0x25')];this[_0x49e2('0x26')]=_0x1359a9[_0x49e2('0x26')];this[_0x49e2('0x27')]=_0x1359a9[_0x49e2('0x27')]||'';this[_0x49e2('0x28')]=_0x1359a9[_0x49e2('0x28')]||'';this['agiafterat']=_0x1359a9[_0x49e2('0x29')];}module[_0x49e2('0x2a')]=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 9107379..39e3399 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 _0x96a0=['countagentrejectretry','countmachineretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x536eca,_0x18b615){var _0x28f35f=function(_0x34bbbe){while(--_0x34bbbe){_0x536eca['push'](_0x536eca['shift']());}};_0x28f35f(++_0x18b615);}(_0x96a0,0x1ba));var _0x096a=function(_0xf2b140,_0x2335c3){_0xf2b140=_0xf2b140-0x0;var _0x496d40=_0x96a0[_0xf2b140];return _0x496d40;};'use strict';function Final(_0x341900){this[_0x096a('0x0')]=_0x341900[_0x096a('0x0')];this[_0x096a('0x1')]=_0x341900[_0x096a('0x1')];this[_0x096a('0x2')]=_0x341900[_0x096a('0x2')];this[_0x096a('0x3')]=_0x341900[_0x096a('0x2')]===_0x096a('0x4')?_0x096a('0x5'):_0x341900[_0x096a('0x2')];this['countbusyretry']=_0x341900[_0x096a('0x6')];this[_0x096a('0x7')]=_0x341900['countcongestionretry'];this[_0x096a('0x8')]=_0x341900[_0x096a('0x8')];this[_0x096a('0x9')]=_0x341900[_0x096a('0x6')]+_0x341900['countcongestionretry']+_0x341900['countnoanswerretry']+_0x341900[_0x096a('0xa')]+_0x341900[_0x096a('0xb')]+_0x341900[_0x096a('0xc')]+_0x341900['countmachineretry']+_0x341900[_0x096a('0xd')];this[_0x096a('0xa')]=_0x341900[_0x096a('0xa')];this[_0x096a('0xb')]=_0x341900['countdropretry'];this['countabandonedretry']=_0x341900[_0x096a('0xc')];this[_0x096a('0xe')]=_0x341900[_0x096a('0xe')];this['countagentrejectretry']=_0x341900[_0x096a('0xd')];this[_0x096a('0x5')]=_0x341900[_0x096a('0x5')];this[_0x096a('0xf')]=_0x341900[_0x096a('0xf')];this['calleridnum']=_0x341900['calleridnum'];this[_0x096a('0x10')]=_0x341900['starttime'];this['responsetime']=_0x341900[_0x096a('0x11')];this[_0x096a('0x12')]=_0x341900[_0x096a('0x11')];this[_0x096a('0x13')]=_0x341900[_0x096a('0x13')]||0x0;this[_0x096a('0x14')]=_0x341900[_0x096a('0x14')]||0x0;this[_0x096a('0x15')]=_0x341900[_0x096a('0x15')]||0x0;this[_0x096a('0x16')]=_0x341900[_0x096a('0x16')];this[_0x096a('0x17')]=_0x341900['callbackuniqueid'];this[_0x096a('0x18')]=_0x341900[_0x096a('0x18')];this[_0x096a('0x19')]=_0x341900[_0x096a('0x19')];this[_0x096a('0x1a')]=_0x341900['ContactId'];this[_0x096a('0x1b')]=_0x341900[_0x096a('0x1b')];this[_0x096a('0x1c')]=_0x341900[_0x096a('0x1c')];this[_0x096a('0x1d')]=_0x341900[_0x096a('0x1d')];this[_0x096a('0x1e')]=_0x341900['CampaignId'];this['originatecalleridnum']=_0x341900[_0x096a('0x1f')]||'';this['originatecalleridname']=_0x341900['originatecalleridname']||'';this[_0x096a('0x20')]=_0x341900['state'];this[_0x096a('0x21')]=_0x341900[_0x096a('0x21')];}module[_0x096a('0x22')]=Final; \ No newline at end of file +var _0xe3b9=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2682a4,_0x871085){var _0x9002f8=function(_0x3ef482){while(--_0x3ef482){_0x2682a4['push'](_0x2682a4['shift']());}};_0x9002f8(++_0x871085);}(_0xe3b9,0x83));var _0x9e3b=function(_0x527b43,_0x3190fa){_0x527b43=_0x527b43-0x0;var _0x108b37=_0xe3b9[_0x527b43];return _0x108b37;};'use strict';function Final(_0x59b9e0){this[_0x9e3b('0x0')]=_0x59b9e0[_0x9e3b('0x0')];this[_0x9e3b('0x1')]=_0x59b9e0[_0x9e3b('0x1')];this[_0x9e3b('0x2')]=_0x59b9e0[_0x9e3b('0x2')];this[_0x9e3b('0x3')]=_0x59b9e0[_0x9e3b('0x2')]===_0x9e3b('0x4')?_0x9e3b('0x5'):_0x59b9e0[_0x9e3b('0x2')];this[_0x9e3b('0x6')]=_0x59b9e0[_0x9e3b('0x6')];this['countcongestionretry']=_0x59b9e0[_0x9e3b('0x7')];this[_0x9e3b('0x8')]=_0x59b9e0[_0x9e3b('0x8')];this[_0x9e3b('0x9')]=_0x59b9e0[_0x9e3b('0x6')]+_0x59b9e0[_0x9e3b('0x7')]+_0x59b9e0['countnoanswerretry']+_0x59b9e0[_0x9e3b('0xa')]+_0x59b9e0[_0x9e3b('0xb')]+_0x59b9e0['countabandonedretry']+_0x59b9e0[_0x9e3b('0xc')]+_0x59b9e0['countagentrejectretry'];this['countnosuchnumberretry']=_0x59b9e0['countnosuchnumberretry'];this[_0x9e3b('0xb')]=_0x59b9e0[_0x9e3b('0xb')];this['countabandonedretry']=_0x59b9e0[_0x9e3b('0xd')];this[_0x9e3b('0xc')]=_0x59b9e0['countmachineretry'];this[_0x9e3b('0xe')]=_0x59b9e0[_0x9e3b('0xe')];this[_0x9e3b('0x5')]=_0x59b9e0[_0x9e3b('0x5')];this[_0x9e3b('0xf')]=_0x59b9e0['calleridname'];this[_0x9e3b('0x10')]=_0x59b9e0[_0x9e3b('0x10')];this[_0x9e3b('0x11')]=_0x59b9e0[_0x9e3b('0x11')];this[_0x9e3b('0x12')]=_0x59b9e0[_0x9e3b('0x12')];this[_0x9e3b('0x13')]=_0x59b9e0[_0x9e3b('0x12')];this[_0x9e3b('0x14')]=_0x59b9e0[_0x9e3b('0x14')]||0x0;this[_0x9e3b('0x15')]=_0x59b9e0[_0x9e3b('0x15')]||0x0;this[_0x9e3b('0x16')]=_0x59b9e0[_0x9e3b('0x16')]||0x0;this['callback']=_0x59b9e0[_0x9e3b('0x17')];this[_0x9e3b('0x18')]=_0x59b9e0[_0x9e3b('0x18')];this[_0x9e3b('0x19')]=_0x59b9e0[_0x9e3b('0x19')];this[_0x9e3b('0x1a')]=_0x59b9e0[_0x9e3b('0x1a')];this[_0x9e3b('0x1b')]=_0x59b9e0[_0x9e3b('0x1b')];this['ListId']=_0x59b9e0['ListId'];this['UserId']=_0x59b9e0[_0x9e3b('0x1c')];this[_0x9e3b('0x1d')]=_0x59b9e0[_0x9e3b('0x1d')];this['CampaignId']=_0x59b9e0['CampaignId'];this['originatecalleridnum']=_0x59b9e0[_0x9e3b('0x1e')]||'';this['originatecalleridname']=_0x59b9e0[_0x9e3b('0x1f')]||'';this['state']=_0x59b9e0[_0x9e3b('0x20')];this[_0x9e3b('0x21')]=_0x59b9e0[_0x9e3b('0x21')];}module[_0x9e3b('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 6709ac0..7a872c6 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 _0x643d=['outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','number','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','endtime','membername','IVR','reason','callback','callbackuniqueid','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','type','campaigntype'];(function(_0x378d56,_0xa479a6){var _0x2ee771=function(_0x2763c0){while(--_0x2763c0){_0x378d56['push'](_0x378d56['shift']());}};_0x2ee771(++_0xa479a6);}(_0x643d,0x71));var _0xd643=function(_0x59e85e,_0x4e399b){_0x59e85e=_0x59e85e-0x0;var _0x34e955=_0x643d[_0x59e85e];return _0x34e955;};'use strict';var moment=require(_0xd643('0x0'));var utils=require(_0xd643('0x1'));function Hangup(_0x3707d5,_0x5e602f){this[_0xd643('0x2')]=0x4;this[_0xd643('0x3')]=_0xd643('0x4');this['scheduledat']=_0x3707d5['scheduledat'];this['type']=_0x3707d5[_0xd643('0x5')];this[_0xd643('0x6')]=_0x3707d5[_0xd643('0x5')]===_0xd643('0x7')?_0xd643('0x8'):_0x3707d5[_0xd643('0x5')];this[_0xd643('0x9')]=_0x3707d5[_0xd643('0x9')]||![];this[_0xd643('0xa')]=_0x3707d5[_0xd643('0xa')];this[_0xd643('0xb')]=_0x3707d5[_0xd643('0xb')];this[_0xd643('0xc')]=_0x3707d5[_0xd643('0xc')];this[_0xd643('0xd')]=_0x3707d5[_0xd643('0xa')]+_0x3707d5[_0xd643('0xb')]+_0x3707d5['countnoanswerretry']+_0x3707d5['countnosuchnumberretry']+_0x3707d5[_0xd643('0xe')]+_0x3707d5['countabandonedretry']+_0x3707d5['countmachineretry']+_0x3707d5[_0xd643('0xf')];this[_0xd643('0x10')]=_0x3707d5['countnosuchnumberretry'];this[_0xd643('0xe')]=_0x3707d5[_0xd643('0xe')];this[_0xd643('0x11')]=_0x3707d5[_0xd643('0x11')];this[_0xd643('0x12')]=_0x3707d5[_0xd643('0x12')];this['countagentrejectretry']=_0x3707d5[_0xd643('0xf')];this[_0xd643('0x13')]=_0x5e602f['uniqueid'];this[_0xd643('0x14')]=_0x3707d5[_0xd643('0x15')];this['calleridnum']=_0x3707d5[_0xd643('0x16')];this['starttime']=_0x3707d5['starttime'];this[_0xd643('0x17')]=_0x3707d5[_0xd643('0x17')];this['endtime']=moment()[_0xd643('0x18')](_0xd643('0x19'));this['ringtime']=utils[_0xd643('0x1a')](_0x3707d5['responsetime'],_0x3707d5['starttime']);this[_0xd643('0x1b')]=0x0;this['talktime']=utils[_0xd643('0x1a')](this[_0xd643('0x1c')],_0x3707d5['responsetime']);this[_0xd643('0x8')]=_0x3707d5[_0xd643('0x8')];this[_0xd643('0x1d')]=_0xd643('0x1e');this[_0xd643('0x1f')]=_0x5e602f['cause-txt'];this[_0xd643('0x20')]=_0x3707d5[_0xd643('0x20')];this[_0xd643('0x21')]=_0x3707d5[_0xd643('0x21')];this['callbackat']=_0x3707d5['callbackat'];this[_0xd643('0x22')]=_0x3707d5['recallme'];this['ContactId']=_0x3707d5['ContactId'];this[_0xd643('0x23')]=_0x3707d5['ListId'];this['UserId']=_0x3707d5[_0xd643('0x24')];this['VoiceQueueId']=_0x3707d5[_0xd643('0x25')];this[_0xd643('0x26')]=_0x3707d5[_0xd643('0x26')];}module[_0xd643('0x27')]=Hangup; \ No newline at end of file +var _0x616f=['getSeconds','holdtime','talktime','queue','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x356e20,_0x7a51eb){var _0x1a43dd=function(_0x2228d3){while(--_0x2228d3){_0x356e20['push'](_0x356e20['shift']());}};_0x1a43dd(++_0x7a51eb);}(_0x616f,0x1e9));var _0xf616=function(_0x335d2d,_0x26e065){_0x335d2d=_0x335d2d-0x0;var _0x379073=_0x616f[_0x335d2d];return _0x379073;};'use strict';var moment=require(_0xf616('0x0'));var utils=require(_0xf616('0x1'));function Hangup(_0x2debfa,_0x28dd0e){this['state']=0x4;this[_0xf616('0x2')]=_0xf616('0x3');this[_0xf616('0x4')]=_0x2debfa['scheduledat'];this[_0xf616('0x5')]=_0x2debfa[_0xf616('0x5')];this[_0xf616('0x6')]=_0x2debfa[_0xf616('0x5')]==='outbound'?'queue':_0x2debfa[_0xf616('0x5')];this[_0xf616('0x7')]=_0x2debfa[_0xf616('0x7')]||![];this['countbusyretry']=_0x2debfa[_0xf616('0x8')];this[_0xf616('0x9')]=_0x2debfa['countcongestionretry'];this['countnoanswerretry']=_0x2debfa['countnoanswerretry'];this['countglobal']=_0x2debfa['countbusyretry']+_0x2debfa[_0xf616('0x9')]+_0x2debfa[_0xf616('0xa')]+_0x2debfa[_0xf616('0xb')]+_0x2debfa[_0xf616('0xc')]+_0x2debfa['countabandonedretry']+_0x2debfa['countmachineretry']+_0x2debfa[_0xf616('0xd')];this[_0xf616('0xb')]=_0x2debfa[_0xf616('0xb')];this[_0xf616('0xc')]=_0x2debfa[_0xf616('0xc')];this[_0xf616('0xe')]=_0x2debfa[_0xf616('0xe')];this[_0xf616('0xf')]=_0x2debfa['countmachineretry'];this[_0xf616('0xd')]=_0x2debfa[_0xf616('0xd')];this[_0xf616('0x10')]=_0x28dd0e[_0xf616('0x10')];this[_0xf616('0x11')]=_0x2debfa[_0xf616('0x12')];this[_0xf616('0x13')]=_0x2debfa[_0xf616('0x14')];this[_0xf616('0x15')]=_0x2debfa[_0xf616('0x15')];this['responsetime']=_0x2debfa[_0xf616('0x16')];this[_0xf616('0x17')]=moment()[_0xf616('0x18')](_0xf616('0x19'));this[_0xf616('0x1a')]=utils[_0xf616('0x1b')](_0x2debfa[_0xf616('0x16')],_0x2debfa[_0xf616('0x15')]);this[_0xf616('0x1c')]=0x0;this[_0xf616('0x1d')]=utils[_0xf616('0x1b')](this[_0xf616('0x17')],_0x2debfa['responsetime']);this[_0xf616('0x1e')]=_0x2debfa[_0xf616('0x1e')];this['membername']=_0xf616('0x1f');this[_0xf616('0x20')]=_0x28dd0e[_0xf616('0x21')];this[_0xf616('0x22')]=_0x2debfa['callback'];this['callbackuniqueid']=_0x2debfa[_0xf616('0x23')];this[_0xf616('0x24')]=_0x2debfa[_0xf616('0x24')];this['recallme']=_0x2debfa[_0xf616('0x25')];this['ContactId']=_0x2debfa[_0xf616('0x26')];this[_0xf616('0x27')]=_0x2debfa[_0xf616('0x27')];this['UserId']=_0x2debfa['UserId'];this[_0xf616('0x28')]=_0x2debfa['VoiceQueueId'];this['CampaignId']=_0x2debfa[_0xf616('0x29')];}module[_0xf616('0x2a')]=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 68e14f2..5cdf485 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 _0x9137=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback'];(function(_0x3e27ba,_0x46b120){var _0x10b3f2=function(_0x330316){while(--_0x330316){_0x3e27ba['push'](_0x3e27ba['shift']());}};_0x10b3f2(++_0x46b120);}(_0x9137,0x7e));var _0x7913=function(_0x3bea96,_0x3c740f){_0x3bea96=_0x3bea96-0x0;var _0x40f13f=_0x9137[_0x3bea96];return _0x40f13f;};'use strict';var utils=require('../utils');function History(_0x5ae752){this[_0x7913('0x0')]=_0x5ae752[_0x7913('0x0')];this[_0x7913('0x1')]=_0x5ae752[_0x7913('0x1')]||undefined;this[_0x7913('0x2')]=_0x5ae752[_0x7913('0x2')];this[_0x7913('0x3')]=_0x5ae752[_0x7913('0x2')]===_0x7913('0x4')?'queue':_0x5ae752['type'];this['countbusyretry']=_0x5ae752[_0x7913('0x5')];this['countcongestionretry']=_0x5ae752[_0x7913('0x6')];this[_0x7913('0x7')]=_0x5ae752['countnoanswerretry'];this[_0x7913('0x8')]=_0x5ae752['countbusyretry']+_0x5ae752[_0x7913('0x6')]+_0x5ae752[_0x7913('0x7')]+_0x5ae752[_0x7913('0x9')]+_0x5ae752[_0x7913('0xa')]+_0x5ae752[_0x7913('0xb')]+_0x5ae752[_0x7913('0xc')]+_0x5ae752['countagentrejectretry'];this[_0x7913('0x9')]=_0x5ae752[_0x7913('0x9')];this[_0x7913('0xa')]=_0x5ae752[_0x7913('0xa')];this[_0x7913('0xb')]=_0x5ae752[_0x7913('0xb')];this['countmachineretry']=_0x5ae752[_0x7913('0xc')];this[_0x7913('0xd')]=_0x5ae752[_0x7913('0xd')];this['queue']=_0x5ae752[_0x7913('0xe')];this[_0x7913('0xf')]=_0x5ae752[_0x7913('0x10')];this['calleridnum']=_0x5ae752[_0x7913('0x11')];this['starttime']=_0x5ae752[_0x7913('0x12')];this[_0x7913('0x13')]=_0x5ae752[_0x7913('0x13')];this[_0x7913('0x14')]=_0x5ae752[_0x7913('0x13')];this[_0x7913('0x15')]=utils[_0x7913('0x16')](_0x5ae752[_0x7913('0x13')],_0x5ae752[_0x7913('0x12')]);this[_0x7913('0x17')]=0x0;this[_0x7913('0x18')]=0x0;this[_0x7913('0x19')]=_0x5ae752['callback'];this[_0x7913('0x1a')]=_0x5ae752[_0x7913('0x1a')];this[_0x7913('0x1b')]=_0x5ae752['callbackat'];this[_0x7913('0x1c')]=_0x5ae752[_0x7913('0x1c')];this[_0x7913('0x1d')]=_0x5ae752['ContactId'];this[_0x7913('0x1e')]=_0x5ae752['ListId'];this[_0x7913('0x1f')]=_0x5ae752[_0x7913('0x1f')];this['VoiceQueueId']=_0x5ae752[_0x7913('0x20')];this['CampaignId']=_0x5ae752['CampaignId'];this[_0x7913('0x21')]=_0x5ae752[_0x7913('0x21')]||'';this['originatecalleridname']=_0x5ae752[_0x7913('0x22')]||'';this[_0x7913('0x23')]=_0x5ae752[_0x7913('0x23')];this[_0x7913('0x24')]=_0x5ae752[_0x7913('0x24')];}module[_0x7913('0x25')]=History; \ No newline at end of file +var _0x4887=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x157642,_0x1835f4){var _0x55bbb5=function(_0x282d5d){while(--_0x282d5d){_0x157642['push'](_0x157642['shift']());}};_0x55bbb5(++_0x1835f4);}(_0x4887,0x64));var _0x7488=function(_0x151cf6,_0x39b26e){_0x151cf6=_0x151cf6-0x0;var _0x3d461d=_0x4887[_0x151cf6];return _0x3d461d;};'use strict';var utils=require('../utils');function History(_0x2edb32){this[_0x7488('0x0')]=_0x2edb32['uniqueid'];this['scheduledat']=_0x2edb32['scheduledat']||undefined;this[_0x7488('0x1')]=_0x2edb32[_0x7488('0x1')];this[_0x7488('0x2')]=_0x2edb32[_0x7488('0x1')]===_0x7488('0x3')?_0x7488('0x4'):_0x2edb32[_0x7488('0x1')];this[_0x7488('0x5')]=_0x2edb32[_0x7488('0x5')];this[_0x7488('0x6')]=_0x2edb32['countcongestionretry'];this[_0x7488('0x7')]=_0x2edb32['countnoanswerretry'];this[_0x7488('0x8')]=_0x2edb32[_0x7488('0x5')]+_0x2edb32[_0x7488('0x6')]+_0x2edb32['countnoanswerretry']+_0x2edb32[_0x7488('0x9')]+_0x2edb32[_0x7488('0xa')]+_0x2edb32[_0x7488('0xb')]+_0x2edb32[_0x7488('0xc')]+_0x2edb32[_0x7488('0xd')];this[_0x7488('0x9')]=_0x2edb32[_0x7488('0x9')];this[_0x7488('0xa')]=_0x2edb32[_0x7488('0xa')];this[_0x7488('0xb')]=_0x2edb32['countabandonedretry'];this[_0x7488('0xc')]=_0x2edb32[_0x7488('0xc')];this['countagentrejectretry']=_0x2edb32['countagentrejectretry'];this['queue']=_0x2edb32[_0x7488('0x4')];this[_0x7488('0xe')]=_0x2edb32[_0x7488('0xf')];this[_0x7488('0x10')]=_0x2edb32['number'];this[_0x7488('0x11')]=_0x2edb32['starttime'];this[_0x7488('0x12')]=_0x2edb32['responsetime'];this[_0x7488('0x13')]=_0x2edb32[_0x7488('0x12')];this[_0x7488('0x14')]=utils[_0x7488('0x15')](_0x2edb32['responsetime'],_0x2edb32['starttime']);this[_0x7488('0x16')]=0x0;this[_0x7488('0x17')]=0x0;this[_0x7488('0x18')]=_0x2edb32[_0x7488('0x18')];this['callbackuniqueid']=_0x2edb32[_0x7488('0x19')];this[_0x7488('0x1a')]=_0x2edb32[_0x7488('0x1a')];this[_0x7488('0x1b')]=_0x2edb32['recallme'];this[_0x7488('0x1c')]=_0x2edb32[_0x7488('0x1c')];this[_0x7488('0x1d')]=_0x2edb32[_0x7488('0x1d')];this[_0x7488('0x1e')]=_0x2edb32[_0x7488('0x1e')];this[_0x7488('0x1f')]=_0x2edb32['VoiceQueueId'];this[_0x7488('0x20')]=_0x2edb32[_0x7488('0x20')];this[_0x7488('0x21')]=_0x2edb32[_0x7488('0x21')]||'';this[_0x7488('0x22')]=_0x2edb32['originatecalleridname']||'';this['state']=_0x2edb32[_0x7488('0x23')];this[_0x7488('0x24')]=_0x2edb32[_0x7488('0x24')];}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 5fabb28..a29b5f8 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 _0x009a=['type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','responsetime','droptime','dropreason','endtime','getSeconds','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat'];(function(_0xf7974d,_0xbab05e){var _0xb831ea=function(_0x5857cb){while(--_0x5857cb){_0xf7974d['push'](_0xf7974d['shift']());}};_0xb831ea(++_0xbab05e);}(_0x009a,0x170));var _0xa009=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x009a[_0x68c979];return _0x4f0001;};'use strict';var utils=require(_0xa009('0x0'));function QueueCallerAbandon(_0x141f1c,_0x29b15e){this[_0xa009('0x1')]=_0x141f1c[_0xa009('0x1')];this[_0xa009('0x2')]=_0x141f1c[_0xa009('0x2')];this[_0xa009('0x3')]=_0x141f1c['type']==='outbound'?_0xa009('0x4'):_0x141f1c[_0xa009('0x2')];this[_0xa009('0x5')]=_0x141f1c[_0xa009('0x5')];this[_0xa009('0x6')]=_0x141f1c[_0xa009('0x6')];this[_0xa009('0x7')]=_0x141f1c['countnoanswerretry'];this['countglobal']=_0x141f1c['countbusyretry']+_0x141f1c[_0xa009('0x6')]+_0x141f1c[_0xa009('0x7')]+_0x141f1c[_0xa009('0x8')]+_0x141f1c[_0xa009('0x9')]+_0x141f1c[_0xa009('0xa')]+_0x141f1c['countmachineretry']+_0x141f1c['countagentrejectretry'];this[_0xa009('0x8')]=_0x141f1c[_0xa009('0x8')];this[_0xa009('0x9')]=_0x141f1c[_0xa009('0x9')];this[_0xa009('0xa')]=_0x141f1c[_0xa009('0xa')];this['countmachineretry']=_0x141f1c[_0xa009('0xb')];this[_0xa009('0xc')]=_0x141f1c[_0xa009('0xc')];this[_0xa009('0xd')]=_0x29b15e[_0xa009('0xd')];this[_0xa009('0xe')]=_0x141f1c[_0xa009('0xf')];this['calleridnum']=_0x141f1c['number'];this['starttime']=_0x141f1c['starttime'];this[_0xa009('0x10')]=_0x141f1c['responsetime'];this[_0xa009('0x11')]=_0x141f1c[_0xa009('0x11')];this['dropreason']=_0x141f1c[_0xa009('0x12')];this[_0xa009('0x13')]=this[_0xa009('0x11')];this['ringtime']=utils[_0xa009('0x14')](_0x141f1c[_0xa009('0x10')],_0x141f1c['starttime']);this['holdtime']=utils[_0xa009('0x14')](this[_0xa009('0x11')],_0x141f1c[_0xa009('0x10')]);this[_0xa009('0x15')]=0x0;this[_0xa009('0x4')]=_0x29b15e[_0xa009('0x4')];this['membername']=_0x29b15e[_0xa009('0x16')];this[_0xa009('0x17')]=_0x29b15e[_0xa009('0x17')];this[_0xa009('0x18')]=_0x141f1c['callback'];this[_0xa009('0x19')]=_0x141f1c[_0xa009('0x19')];this[_0xa009('0x1a')]=_0x141f1c[_0xa009('0x1a')];this['recallme']=_0x141f1c['recallme'];this['ContactId']=_0x141f1c[_0xa009('0x1b')];this[_0xa009('0x1c')]=_0x141f1c['ListId'];this[_0xa009('0x1d')]=_0x141f1c[_0xa009('0x1d')];this['VoiceQueueId']=_0x141f1c['VoiceQueueId'];this[_0xa009('0x1e')]=_0x141f1c[_0xa009('0x1e')];this[_0xa009('0x1f')]=_0x141f1c['originatecalleridnum']||'';this['originatecalleridname']=_0x141f1c[_0xa009('0x20')]||'';this[_0xa009('0x21')]=_0x141f1c[_0xa009('0x21')];this[_0xa009('0x22')]=_0x141f1c['state'];this[_0xa009('0x23')]=_0x141f1c['statedesc'];}module[_0xa009('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0x458c=['droptime','dropreason','endtime','ringtime','getSeconds','responsetime','holdtime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','name','calleridnum','starttime'];(function(_0x295081,_0x2828d4){var _0x3c0f4d=function(_0x39def4){while(--_0x39def4){_0x295081['push'](_0x295081['shift']());}};_0x3c0f4d(++_0x2828d4);}(_0x458c,0x13e));var _0xc458=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x458c[_0x616290];return _0x453879;};'use strict';var utils=require(_0xc458('0x0'));function QueueCallerAbandon(_0x291d62,_0x15916e){this[_0xc458('0x1')]=_0x291d62['scheduledat'];this['type']=_0x291d62[_0xc458('0x2')];this[_0xc458('0x3')]=_0x291d62[_0xc458('0x2')]===_0xc458('0x4')?'queue':_0x291d62[_0xc458('0x2')];this[_0xc458('0x5')]=_0x291d62['countbusyretry'];this[_0xc458('0x6')]=_0x291d62[_0xc458('0x6')];this[_0xc458('0x7')]=_0x291d62[_0xc458('0x7')];this[_0xc458('0x8')]=_0x291d62[_0xc458('0x5')]+_0x291d62[_0xc458('0x6')]+_0x291d62[_0xc458('0x7')]+_0x291d62[_0xc458('0x9')]+_0x291d62['countdropretry']+_0x291d62[_0xc458('0xa')]+_0x291d62['countmachineretry']+_0x291d62[_0xc458('0xb')];this['countnosuchnumberretry']=_0x291d62[_0xc458('0x9')];this[_0xc458('0xc')]=_0x291d62['countdropretry'];this['countabandonedretry']=_0x291d62[_0xc458('0xa')];this[_0xc458('0xd')]=_0x291d62[_0xc458('0xd')];this[_0xc458('0xb')]=_0x291d62[_0xc458('0xb')];this[_0xc458('0xe')]=_0x15916e[_0xc458('0xe')];this['calleridname']=_0x291d62[_0xc458('0xf')];this[_0xc458('0x10')]=_0x291d62['number'];this[_0xc458('0x11')]=_0x291d62[_0xc458('0x11')];this['responsetime']=_0x291d62['responsetime'];this[_0xc458('0x12')]=_0x291d62['droptime'];this['dropreason']=_0x291d62[_0xc458('0x13')];this[_0xc458('0x14')]=this[_0xc458('0x12')];this[_0xc458('0x15')]=utils[_0xc458('0x16')](_0x291d62[_0xc458('0x17')],_0x291d62[_0xc458('0x11')]);this[_0xc458('0x18')]=utils[_0xc458('0x16')](this[_0xc458('0x12')],_0x291d62[_0xc458('0x17')]);this['talktime']=0x0;this[_0xc458('0x19')]=_0x15916e['queue'];this['membername']=_0x15916e[_0xc458('0x1a')];this[_0xc458('0x1b')]=_0x15916e['reason'];this[_0xc458('0x1c')]=_0x291d62[_0xc458('0x1c')];this[_0xc458('0x1d')]=_0x291d62[_0xc458('0x1d')];this[_0xc458('0x1e')]=_0x291d62['callbackat'];this[_0xc458('0x1f')]=_0x291d62[_0xc458('0x1f')];this[_0xc458('0x20')]=_0x291d62[_0xc458('0x20')];this[_0xc458('0x21')]=_0x291d62[_0xc458('0x21')];this[_0xc458('0x22')]=_0x291d62[_0xc458('0x22')];this[_0xc458('0x23')]=_0x291d62['VoiceQueueId'];this[_0xc458('0x24')]=_0x291d62[_0xc458('0x24')];this['originatecalleridnum']=_0x291d62['originatecalleridnum']||'';this['originatecalleridname']=_0x291d62[_0xc458('0x25')]||'';this['agiafterat']=_0x291d62[_0xc458('0x26')];this[_0xc458('0x27')]=_0x291d62['state'];this[_0xc458('0x28')]=_0x291d62[_0xc458('0x28')];}module[_0xc458('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 5b9115d..04235f7 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 _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x3d78f0,_0x18c2e6){var _0x35ec19=function(_0x21a104){while(--_0x21a104){_0x3d78f0['push'](_0x3d78f0['shift']());}};_0x35ec19(++_0x18c2e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=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(_0x30f64d,_0x40f95e){var _0x191c46=function(_0x1091d5){while(--_0x1091d5){_0x30f64d['push'](_0x30f64d['shift']());}};_0x191c46(++_0x40f95e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 9f09531..02b087c 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 _0x7c7b=['diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','active','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','name','includes','status','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','replace','random','toString','error','erlangb','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isIVRCampaignActive','milliseconds'];(function(_0x20c8d4,_0x506720){var _0x37d29d=function(_0x26506f){while(--_0x26506f){_0x20c8d4['push'](_0x20c8d4['shift']());}};_0x37d29d(++_0x506720);}(_0x7c7b,0x1db));var _0xb7c7=function(_0x3bb866,_0xba7019){_0x3bb866=_0x3bb866-0x0;var _0x2e7e75=_0x7c7b[_0x3bb866];return _0x2e7e75;};'use strict';var _=require(_0xb7c7('0x0'));var moment=require(_0xb7c7('0x1'));var util=require(_0xb7c7('0x2'));var logger=require(_0xb7c7('0x3'))(_0xb7c7('0x4'));var timezones=require(_0xb7c7('0x5'))[_0xb7c7('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0xb7c7('0x7'),'BLACKLIST':_0xb7c7('0x8'),'CONTACTS_RESCHEDULED':_0xb7c7('0x9'),'DEACTIVATED':_0xb7c7('0xa'),'DISACTIVED':_0xb7c7('0xb'),'EMPTY_INTERVAL':_0xb7c7('0xc'),'INACTIVE':_0xb7c7('0xd'),'NO_AGENTS_LOGGED':_0xb7c7('0xe'),'NO_AVAILABLE_CONTACTS':_0xb7c7('0xf'),'NULL_INTERVAL':_0xb7c7('0x10'),'OVERTIME_INTERVAL':_0xb7c7('0x11'),'OVERTIME_GLOBAL_INTERVAL':_0xb7c7('0x12'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xb7c7('0x13'),'RUNNING':_0xb7c7('0x14'),'UNKNOWN_TIMEZONE':_0xb7c7('0x15'),'UNREACHABLE_TRUNK':_0xb7c7('0x16')};exports[_0xb7c7('0x17')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5eef19){return _0x5eef19[_0xb7c7('0x18')]===_0xb7c7('0x19');}exports[_0xb7c7('0x1a')]=isPreviewCampaign;function isIVRCampaign(_0x161f01){return _0x161f01[_0xb7c7('0x1b')]===_0xb7c7('0x1c');}exports[_0xb7c7('0x1d')]=isIVRCampaign;function isOutboundQueue(_0x210006){return _0x210006[_0xb7c7('0x1b')]===_0xb7c7('0x1e');}exports[_0xb7c7('0x1f')]=isOutboundQueue;function isQueueCampaignActive(_0x16db36){return _0x16db36[_0xb7c7('0x20')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x435f81){return _0x435f81['active'];}exports[_0xb7c7('0x21')]=isIVRCampaignActive;function getSeconds(_0x1d2452,_0x43dc10){var _0x277567=moment(_0x1d2452)[_0xb7c7('0x22')](0x0);var _0x232b21=moment(_0x43dc10)['milliseconds'](0x0);return _0x277567[_0xb7c7('0x23')](_0x232b21,'seconds');}exports[_0xb7c7('0x24')]=getSeconds;function hasQueueCampaignDataChanged(_0xf19d2b,_0x115ed0){var _0x146f74=![];var _0x41ad81=_0xf19d2b[_0xb7c7('0x18')]!==_0x115ed0[_0xb7c7('0x18')]||_0xf19d2b[_0xb7c7('0x20')]!==_0x115ed0[_0xb7c7('0x20')]||_0xf19d2b[_0xb7c7('0x25')]!==_0x115ed0[_0xb7c7('0x25')];var _0x2758ee=_0xf19d2b[_0xb7c7('0x26')]!==_0x115ed0[_0xb7c7('0x26')]||_0xf19d2b['loggedIn']!==_0x115ed0[_0xb7c7('0x27')]||_0xf19d2b[_0xb7c7('0x28')]!==_0x115ed0[_0xb7c7('0x28')]||_0xf19d2b[_0xb7c7('0x29')]!==_0x115ed0[_0xb7c7('0x29')]||_0xf19d2b['talking']!==_0x115ed0[_0xb7c7('0x2a')]||_0xf19d2b[_0xb7c7('0x2b')]!==_0x115ed0['pTalking']||_0xf19d2b[_0xb7c7('0x2c')]!==_0x115ed0[_0xb7c7('0x2c')]||_0xf19d2b[_0xb7c7('0x2d')]!==_0x115ed0[_0xb7c7('0x2d')]||_0xf19d2b[_0xb7c7('0x2e')]!==_0x115ed0[_0xb7c7('0x2e')];if(_0xf19d2b['Trunk']&&_0x115ed0[_0xb7c7('0x2f')]){_0x146f74=_0xf19d2b[_0xb7c7('0x2f')]['name']!==_0x115ed0[_0xb7c7('0x2f')]['name']||_0xf19d2b[_0xb7c7('0x2f')][_0xb7c7('0x30')]!==_0x115ed0['Trunk']['active'];}return _0x41ad81||_0x2758ee||_0x146f74;}exports[_0xb7c7('0x31')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x386817){var _0x3f7041=null;var _0x4d87bb=_0x386817[_0xb7c7('0x32')];if(_['isNil'](_0x386817[_0xb7c7('0x33')])||_[_0xb7c7('0x34')](_0x386817[_0xb7c7('0x35')])||_['isNil'](_0x386817[_0xb7c7('0x35')][_0xb7c7('0x36')])){_0x3f7041=CAMPAIGN_STATUS[_0xb7c7('0x37')];}else if(_[_0xb7c7('0x38')](_0x386817[_0xb7c7('0x33')])||_['isEmpty'](_0x386817['Interval'][_0xb7c7('0x36')])){_0x3f7041=CAMPAIGN_STATUS[_0xb7c7('0x39')];}else if(_0x4d87bb&&!timezones[_0x4d87bb]){_0x3f7041=CAMPAIGN_STATUS[_0xb7c7('0x3a')];}return _0x3f7041;}function checkAnyValidTrunk(_0x180aba,_0x3e8e0a){var _0x9106f0=null;var _0x5819ae=_0xb7c7('0x3b');var _0x42b741=[_0xb7c7('0x3c'),_0xb7c7('0x3d')];var _0x4ce52a=!![];if(_0x180aba[_0xb7c7('0x2f')]&&_0x180aba['Trunk'][_0xb7c7('0x30')]){_0x5819ae+=_0x180aba[_0xb7c7('0x2f')]['name'];_0x9106f0=_0x3e8e0a[_0x5819ae];_0x4ce52a=_0x42b741['includes'](_0x9106f0['status']);}else if(_0x180aba[_0xb7c7('0x3e')]&&_0x180aba[_0xb7c7('0x3e')][_0xb7c7('0x30')]){_0x5819ae+=_0x180aba[_0xb7c7('0x3e')][_0xb7c7('0x3f')];_0x9106f0=_0x3e8e0a[_0x5819ae];_0x4ce52a=_0x42b741[_0xb7c7('0x40')](_0x9106f0[_0xb7c7('0x41')]);}return _0x4ce52a;}function getQueueCampaignStatusMessage(_0xbc6bc,_0x5a7828){var _0x581071=CAMPAIGN_STATUS[_0xb7c7('0x7')];var _0x2642fa=isPreviewCampaign(_0xbc6bc);if(!isQueueCampaignActive(_0xbc6bc)){if(_0x2642fa){_0x581071=CAMPAIGN_STATUS[_0xb7c7('0x42')];}else{if(_0xbc6bc[_0xb7c7('0x2e')]===0x0&&_0xbc6bc[_0xb7c7('0x2a')]===0x0&&_0xbc6bc[_0xb7c7('0x2c')]===0x0&&(_0xbc6bc[_0xb7c7('0x2b')]||0x0)===0x0){_0x581071=CAMPAIGN_STATUS[_0xb7c7('0x42')];}else{_0x581071=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0xbc6bc[_0xb7c7('0x27')]===0x0){_0x581071=CAMPAIGN_STATUS[_0xb7c7('0x43')];}else if(!checkAnyValidTrunk(_0xbc6bc,_0x5a7828)){_0x581071=CAMPAIGN_STATUS[_0xb7c7('0x44')];}else if(!isPreviewCampaign(_0xbc6bc)){var _0x152fe8=checkAnyValidQueueCampaignInterval(_0xbc6bc);if(_0x152fe8){_0x581071=_0x152fe8;}}return _0x581071;}exports[_0xb7c7('0x45')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3a953b){var _0x55d896=CAMPAIGN_STATUS[_0xb7c7('0x46')];if(_0x3a953b[_0xb7c7('0x2e')]===0x0&&_0x3a953b[_0xb7c7('0x2a')]===0x0&&_0x3a953b[_0xb7c7('0x2c')]===0x0&&(_0x3a953b['pTalking']||0x0)===0x0){_0x55d896=CAMPAIGN_STATUS[_0xb7c7('0x42')];}return _0x55d896;}exports[_0xb7c7('0x47')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1b85e8){var _0x269d44=_0x1b85e8['match'](/"(.*?)"/);return _0x269d44?_0x269d44[0x1]:_0x1b85e8;}exports[_0xb7c7('0x48')]=extractCalleridName;function getCallerId(_0x2df78b,_0xf7d591,_0x43bba0){if(!_[_0xb7c7('0x49')](_0x43bba0)&&typeof _0x43bba0==='string'&&!_[_0xb7c7('0x38')](_0x43bba0)){if(!_[_0xb7c7('0x49')](_0xf7d591)&&typeof _0xf7d591===_0xb7c7('0x4a')&&!_[_0xb7c7('0x38')](_0xf7d591)){return util['format'](_0xb7c7('0x4b'),_0xf7d591,_0x43bba0);}return util[_0xb7c7('0x4c')](_0xb7c7('0x4b'),_0x43bba0,_0x43bba0);}if(!_[_0xb7c7('0x49')](_0x2df78b)&&typeof _0x2df78b==='string'&&!_[_0xb7c7('0x38')](_0x2df78b)){return _0x2df78b;}return _0xb7c7('0x4d');}exports[_0xb7c7('0x4e')]=getCallerId;function getCallerIdRandom(_0x49e789,_0xdffc09){var _0xc54df4;var _0x180fa5;var _0x3b20b3;if(_0xdffc09<=0x0){_0xdffc09=0x1;}_0xc54df4=new RegExp(_0xb7c7('0x4f')+_0xdffc09+'}$');_0x180fa5=Math['pow'](0xa,_0xdffc09-0x1);_0x3b20b3=Math['pow'](0xa,_0xdffc09)-0x1;return util[_0xb7c7('0x4c')]('%s',_[_0xb7c7('0x50')](_0x49e789,_0xc54df4,_[_0xb7c7('0x51')](_0x180fa5,_0x3b20b3)[_0xb7c7('0x52')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x1eeb3e){if(_0x1eeb3e[_0xb7c7('0x2e')]&&_0x1eeb3e['originated']>0x0){_0x1eeb3e['originated']-=0x1;}else{logger[_0xb7c7('0x53')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x35ec03){return _0x35ec03&&_0x35ec03['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x2d29e9,_0x43bfab){if(_0x43bfab===0x0){return 0x0;}var _0x7f686a=0x1;for(var _0xd677f4=0x1;_0xd677f4<=_0x43bfab;_0xd677f4+=0x1){_0x7f686a=0x1+_0x7f686a*_0xd677f4/_0x2d29e9;}return 0x1/_0x7f686a;}exports[_0xb7c7('0x54')]=erlangb;function checkContactLowerLimitOriginate(_0x349b44,_0x34047f,_0x5e5bfc){if(_0x34047f>_0x5e5bfc){for(var _0x2b0501=0x0;_0x2b0501<_0x34047f-_0x5e5bfc;_0x2b0501+=0x1){decrementOriginate(_0x349b44);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xbee6=['active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','TrunkBackup','status','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','CAMPAIGN_STATUS','preview','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive'];(function(_0x1e5169,_0x3b177a){var _0x259d2a=function(_0xc95827){while(--_0xc95827){_0x1e5169['push'](_0x1e5169['shift']());}};_0x259d2a(++_0x3b177a);}(_0xbee6,0x134));var _0x6bee=function(_0x1bba3f,_0x2a314b){_0x1bba3f=_0x1bba3f-0x0;var _0x278bf8=_0xbee6[_0x1bba3f];return _0x278bf8;};'use strict';var _=require(_0x6bee('0x0'));var moment=require(_0x6bee('0x1'));var util=require('util');var logger=require(_0x6bee('0x2'))(_0x6bee('0x3'));var timezones=require(_0x6bee('0x4'))[_0x6bee('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x6bee('0x6'),'CONTACTS_RESCHEDULED':_0x6bee('0x7'),'DEACTIVATED':_0x6bee('0x8'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x6bee('0x9'),'INACTIVE':_0x6bee('0xa'),'NO_AGENTS_LOGGED':_0x6bee('0xb'),'NO_AVAILABLE_CONTACTS':_0x6bee('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x6bee('0xd'),'QUEUE_RECALL':_0x6bee('0xe'),'RECALL_TIMEOUT':_0x6bee('0xf'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x6bee('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3251eb){return _0x3251eb['dialMethod']===_0x6bee('0x11');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x1eadf8){return _0x1eadf8[_0x6bee('0x12')]===_0x6bee('0x13');}exports[_0x6bee('0x14')]=isIVRCampaign;function isOutboundQueue(_0x53b823){return _0x53b823['type']==='outbound';}exports[_0x6bee('0x15')]=isOutboundQueue;function isQueueCampaignActive(_0xb2e944){return _0xb2e944[_0x6bee('0x16')];}exports[_0x6bee('0x17')]=isQueueCampaignActive;function isIVRCampaignActive(_0x26cd5d){return _0x26cd5d[_0x6bee('0x18')];}exports[_0x6bee('0x19')]=isIVRCampaignActive;function getSeconds(_0x22ca1c,_0x34a79b){var _0x1a844a=moment(_0x22ca1c)[_0x6bee('0x1a')](0x0);var _0x63210=moment(_0x34a79b)[_0x6bee('0x1a')](0x0);return _0x1a844a[_0x6bee('0x1b')](_0x63210,_0x6bee('0x1c'));}exports[_0x6bee('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x1b198f,_0x541aa8){var _0x2d8e52=![];var _0x2fd8b2=_0x1b198f[_0x6bee('0x1e')]!==_0x541aa8[_0x6bee('0x1e')]||_0x1b198f[_0x6bee('0x16')]!==_0x541aa8[_0x6bee('0x16')]||_0x1b198f[_0x6bee('0x1f')]!==_0x541aa8[_0x6bee('0x1f')];var _0x40a5d5=_0x1b198f['available']!==_0x541aa8[_0x6bee('0x20')]||_0x1b198f[_0x6bee('0x21')]!==_0x541aa8[_0x6bee('0x21')]||_0x1b198f['loggedInDb']!==_0x541aa8[_0x6bee('0x22')]||_0x1b198f['paused']!==_0x541aa8[_0x6bee('0x23')]||_0x1b198f[_0x6bee('0x24')]!==_0x541aa8['talking']||_0x1b198f['pTalking']!==_0x541aa8[_0x6bee('0x25')]||_0x1b198f[_0x6bee('0x26')]!==_0x541aa8[_0x6bee('0x26')]||_0x1b198f[_0x6bee('0x27')]!==_0x541aa8[_0x6bee('0x27')]||_0x1b198f[_0x6bee('0x28')]!==_0x541aa8[_0x6bee('0x28')];if(_0x1b198f[_0x6bee('0x29')]&&_0x541aa8[_0x6bee('0x29')]){_0x2d8e52=_0x1b198f[_0x6bee('0x29')][_0x6bee('0x2a')]!==_0x541aa8['Trunk'][_0x6bee('0x2a')]||_0x1b198f[_0x6bee('0x29')][_0x6bee('0x18')]!==_0x541aa8['Trunk']['active'];}return _0x2fd8b2||_0x40a5d5||_0x2d8e52;}exports[_0x6bee('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x99f288){var _0x4c5eb9=null;var _0x254a22=_0x99f288[_0x6bee('0x2c')];if(_[_0x6bee('0x2d')](_0x99f288[_0x6bee('0x2e')])||_[_0x6bee('0x2d')](_0x99f288[_0x6bee('0x2f')])||_['isNil'](_0x99f288[_0x6bee('0x2f')][_0x6bee('0x30')])){_0x4c5eb9=CAMPAIGN_STATUS[_0x6bee('0x31')];}else if(_[_0x6bee('0x32')](_0x99f288[_0x6bee('0x2e')])||_[_0x6bee('0x32')](_0x99f288[_0x6bee('0x2f')][_0x6bee('0x30')])){_0x4c5eb9=CAMPAIGN_STATUS[_0x6bee('0x33')];}else if(_0x254a22&&!timezones[_0x254a22]){_0x4c5eb9=CAMPAIGN_STATUS[_0x6bee('0x34')];}return _0x4c5eb9;}function checkAnyValidTrunk(_0x3e6542,_0x5da329){var _0x6e2d16=null;var _0x3b7475='SIP/';var _0x42118b=[_0x6bee('0x35'),_0x6bee('0x36')];var _0x5e33fe=!![];if(_0x3e6542[_0x6bee('0x29')]&&_0x3e6542[_0x6bee('0x29')][_0x6bee('0x18')]){_0x3b7475+=_0x3e6542['Trunk'][_0x6bee('0x2a')];_0x6e2d16=_0x5da329[_0x3b7475];_0x5e33fe=_0x42118b[_0x6bee('0x37')](_0x6e2d16['status']);}else if(_0x3e6542[_0x6bee('0x38')]&&_0x3e6542[_0x6bee('0x38')][_0x6bee('0x18')]){_0x3b7475+=_0x3e6542[_0x6bee('0x38')][_0x6bee('0x2a')];_0x6e2d16=_0x5da329[_0x3b7475];_0x5e33fe=_0x42118b[_0x6bee('0x37')](_0x6e2d16[_0x6bee('0x39')]);}return _0x5e33fe;}function getQueueCampaignStatusMessage(_0x4e22d9,_0x2abb3b){var _0x5af5a7=CAMPAIGN_STATUS[_0x6bee('0x3a')];var _0xc30bce=isPreviewCampaign(_0x4e22d9);if(!isQueueCampaignActive(_0x4e22d9)){if(_0xc30bce){_0x5af5a7=CAMPAIGN_STATUS[_0x6bee('0x3b')];}else{if(_0x4e22d9[_0x6bee('0x28')]===0x0&&_0x4e22d9['talking']===0x0&&_0x4e22d9[_0x6bee('0x26')]===0x0&&(_0x4e22d9[_0x6bee('0x25')]||0x0)===0x0){_0x5af5a7=CAMPAIGN_STATUS['INACTIVE'];}else{_0x5af5a7=CAMPAIGN_STATUS[_0x6bee('0x3c')];}}}else if(_0x4e22d9[_0x6bee('0x21')]===0x0){_0x5af5a7=CAMPAIGN_STATUS[_0x6bee('0x3d')];}else if(!checkAnyValidTrunk(_0x4e22d9,_0x2abb3b)){_0x5af5a7=CAMPAIGN_STATUS[_0x6bee('0x3e')];}else if(!isPreviewCampaign(_0x4e22d9)){var _0x21e506=checkAnyValidQueueCampaignInterval(_0x4e22d9);if(_0x21e506){_0x5af5a7=_0x21e506;}}return _0x5af5a7;}exports[_0x6bee('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x55e928){var _0x297b75=CAMPAIGN_STATUS[_0x6bee('0x3c')];if(_0x55e928[_0x6bee('0x28')]===0x0&&_0x55e928[_0x6bee('0x24')]===0x0&&_0x55e928['waiting']===0x0&&(_0x55e928['pTalking']||0x0)===0x0){_0x297b75=CAMPAIGN_STATUS[_0x6bee('0x3b')];}return _0x297b75;}exports[_0x6bee('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3f338b){var _0x185f58=_0x3f338b[_0x6bee('0x41')](/"(.*?)"/);return _0x185f58?_0x185f58[0x1]:_0x3f338b;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x5b642d,_0x6953e3,_0x2267cc){if(!_[_0x6bee('0x42')](_0x2267cc)&&typeof _0x2267cc==='string'&&!_[_0x6bee('0x32')](_0x2267cc)){if(!_[_0x6bee('0x42')](_0x6953e3)&&typeof _0x6953e3==='string'&&!_[_0x6bee('0x32')](_0x6953e3)){return util['format']('\x22%s\x22\x20<%s>',_0x6953e3,_0x2267cc);}return util['format'](_0x6bee('0x43'),_0x2267cc,_0x2267cc);}if(!_['isUndefined'](_0x5b642d)&&typeof _0x5b642d===_0x6bee('0x44')&&!_[_0x6bee('0x32')](_0x5b642d)){return _0x5b642d;}return _0x6bee('0x45');}exports[_0x6bee('0x46')]=getCallerId;function getCallerIdRandom(_0x56bfff,_0x5ba6e8){var _0x36e7b6;var _0x4d9d37;var _0x33a7aa;if(_0x5ba6e8<=0x0){_0x5ba6e8=0x1;}_0x36e7b6=new RegExp(_0x6bee('0x47')+_0x5ba6e8+'}$');_0x4d9d37=Math[_0x6bee('0x48')](0xa,_0x5ba6e8-0x1);_0x33a7aa=Math[_0x6bee('0x48')](0xa,_0x5ba6e8)-0x1;return util['format']('%s',_[_0x6bee('0x49')](_0x56bfff,_0x36e7b6,_[_0x6bee('0x4a')](_0x4d9d37,_0x33a7aa)[_0x6bee('0x4b')]()));}exports[_0x6bee('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x40c2b5){if(_0x40c2b5[_0x6bee('0x28')]&&_0x40c2b5['originated']>0x0){_0x40c2b5[_0x6bee('0x28')]-=0x1;}else{logger[_0x6bee('0x4d')](_0x6bee('0x4e'));}}exports[_0x6bee('0x4f')]=decrementOriginate;function checkContactEmpty(_0x239177){return _0x239177&&_0x239177['length']>0x0;}exports[_0x6bee('0x50')]=checkContactEmpty;function erlangb(_0x154f2a,_0x5de4cf){if(_0x5de4cf===0x0){return 0x0;}var _0x18d709=0x1;for(var _0x1efc42=0x1;_0x1efc42<=_0x5de4cf;_0x1efc42+=0x1){_0x18d709=0x1+_0x18d709*_0x1efc42/_0x154f2a;}return 0x1/_0x18d709;}exports[_0x6bee('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x30e5f2,_0x57f2ad,_0x3c355b){if(_0x57f2ad>_0x3c355b){for(var _0x473e0d=0x0;_0x473e0d<_0x57f2ad-_0x3c355b;_0x473e0d+=0x1){decrementOriginate(_0x30e5f2);}}}exports[_0x6bee('0x52')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index b0cce4c..f2bf9ae 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(_0xec4fbb,_0x4b2101){var _0x4d11fb=function(_0x226eaa){while(--_0x226eaa){_0xec4fbb['push'](_0xec4fbb['shift']());}};_0x4d11fb(++_0x4b2101);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x365c8e,_0x1fbc99){var _0x241576=function(_0xb1d763){while(--_0xb1d763){_0x365c8e['push'](_0x365c8e['shift']());}};_0x241576(++_0x1fbc99);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 caee9bd..065a77b 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 _0x15ad=['./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','channel','uniqueid','name','info','\x20syncNewchannel\x20','prototype','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb'];(function(_0x513e24,_0x22d1c9){var _0x25f3ac=function(_0x38914a){while(--_0x38914a){_0x513e24['push'](_0x513e24['shift']());}};_0x25f3ac(++_0x22d1c9);}(_0x15ad,0x1c7));var _0xd15a=function(_0x5abb44,_0x1da1cc){_0x5abb44=_0x5abb44-0x0;var _0x4a1f07=_0x15ad[_0x5abb44];return _0x4a1f07;};'use strict';var util=require(_0xd15a('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xd15a('0x1'));var moment=require(_0xd15a('0x2'));var path=require('path');var tiff2pdf=require(_0xd15a('0x3'));var gs=require(_0xd15a('0x4'));var logger=require(_0xd15a('0x5'))(_0xd15a('0x6'));var ami=require(_0xd15a('0x7'));var rpcDb=require(_0xd15a('0x8'));var Channel=require('./channel');var ut=require(_0xd15a('0x9'));var Action=require(_0xd15a('0xa'));var faxAccount=require(_0xd15a('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xd15a('0xc'));function Fax(_0x39a02f){this[_0xd15a('0xd')]={};this['faxAccounts']=_0x39a02f[_0xd15a('0xe')];this[_0xd15a('0xf')]=_0x39a02f[_0xd15a('0xf')];this[_0xd15a('0x10')]={};ami['on'](_0xd15a('0x11'),this['syncNewchannel'][_0xd15a('0x12')](this));ami['on'](_0xd15a('0x13'),this[_0xd15a('0x14')]['bind'](this));ami['on'](_0xd15a('0x15'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0xd15a('0x16')]['bind'](this));ami['on'](_0xd15a('0x17'),this[_0xd15a('0x18')][_0xd15a('0x12')](this));ami['on'](_0xd15a('0x19'),this[_0xd15a('0x1a')]['bind'](this));ami['on'](_0xd15a('0x1b'),this[_0xd15a('0x1c')]['bind'](this));ami['on']('originateresponse',this[_0xd15a('0x1d')][_0xd15a('0x12')](this));}Fax['prototype']['syncNewchannel']=function(_0x571489){if(_0x571489['context']===_0xd15a('0x1e')){for(var _0x44f942 in this[_0xd15a('0xe')]){if(this[_0xd15a('0xe')][_0xd15a('0x1f')](_0x44f942)){if(_0x571489[_0xd15a('0x20')]===this[_0xd15a('0xe')][_0x44f942]['localstationid']){this[_0xd15a('0xd')][_0x571489['uniqueid']]={};this[_0xd15a('0xd')][_0x571489['uniqueid']][_0xd15a('0x21')]=_0x571489[_0xd15a('0x21')];this[_0xd15a('0xd')][_0x571489[_0xd15a('0x22')]]['id']=this['faxAccounts'][_0x44f942]['id'];this[_0xd15a('0xd')][_0x571489[_0xd15a('0x22')]]['name']=this['faxAccounts'][_0x44f942][_0xd15a('0x23')];logger[_0xd15a('0x24')](_0x571489[_0xd15a('0x22')],_0xd15a('0x25'));}}}}if(this[_0xd15a('0x10')][_0x571489['uniqueid']]){this[_0xd15a('0xd')][_0x571489['uniqueid']]={};this[_0xd15a('0xd')][_0x571489[_0xd15a('0x22')]][_0xd15a('0x21')]=_0x571489[_0xd15a('0x21')];logger['info'](_0x571489[_0xd15a('0x22')],_0xd15a('0x25'));}};Fax[_0xd15a('0x26')][_0xd15a('0x14')]=function(_0x5dcb2a){if(this[_0xd15a('0xd')][_0x5dcb2a[_0xd15a('0x22')]]){for(var _0x16146d in _0x5dcb2a[_0xd15a('0x27')]){if(_0x5dcb2a[_0xd15a('0x27')]['hasOwnProperty'](_0x16146d)){this['channels'][_0x5dcb2a['uniqueid']][_0x16146d]=_0x5dcb2a[_0xd15a('0x28')];}}}};Fax[_0xd15a('0x26')][_0xd15a('0x29')]=function(_0x12ec87){if(this['channels'][_0x12ec87[_0xd15a('0x22')]]){this[_0xd15a('0xd')][_0x12ec87['uniqueid']][_0xd15a('0x2a')]=_0x12ec87[_0xd15a('0x2a')];this[_0xd15a('0xd')][_0x12ec87[_0xd15a('0x22')]][_0xd15a('0x2b')]=_0x12ec87['channelstatedesc'];}};Fax[_0xd15a('0x26')][_0xd15a('0x16')]=function(_0x214e18){if(this['channels'][_0x214e18[_0xd15a('0x22')]]){for(var _0x311268 in _0x214e18[_0xd15a('0x27')]){if(_0x214e18[_0xd15a('0x27')][_0xd15a('0x1f')](_0x311268)){this[_0xd15a('0xd')][_0x214e18['uniqueid']][_0x311268]=_0x214e18['value'];}}}};Fax['prototype'][_0xd15a('0x18')]=function(_0x204c51){if(this[_0xd15a('0xd')][_0x204c51['uniqueid']]){this[_0xd15a('0xd')][_0x204c51['uniqueid']][_0xd15a('0x2c')]=_0x204c51['operation'];this[_0xd15a('0xd')][_0x204c51[_0xd15a('0x22')]]['status']=_0x204c51[_0xd15a('0x2d')];this[_0xd15a('0xd')][_0x204c51[_0xd15a('0x22')]][_0xd15a('0x2e')]=_0x204c51[_0xd15a('0x2e')];this['channels'][_0x204c51[_0xd15a('0x22')]][_0xd15a('0x2f')]=_0x204c51[_0xd15a('0x2f')];logger[_0xd15a('0x24')](_0x204c51[_0xd15a('0x22')],_0xd15a('0x30'));}};Fax[_0xd15a('0x26')][_0xd15a('0x1a')]=function(_0x5034b2){var _0x36d93d=this;if(this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]]){var _0x3ef2ff=this['channels'][_0x5034b2[_0xd15a('0x22')]]['id'];this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]][_0xd15a('0x31')]=_0x5034b2[_0xd15a('0x31')];this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]]['pagestransferred']=_0x5034b2[_0xd15a('0x32')];this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]][_0xd15a('0x2e')]=_0x5034b2[_0xd15a('0x2e')];this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]][_0xd15a('0x33')]=_0x5034b2['resolution'];this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]][_0xd15a('0x34')]=_0x5034b2[_0xd15a('0x34')];this[_0xd15a('0xd')][_0x5034b2[_0xd15a('0x22')]][_0xd15a('0x2f')]=_0x5034b2[_0xd15a('0x2f')];this[_0xd15a('0xd')][_0x5034b2['uniqueid']]['calleridnum']=_0x5034b2[_0xd15a('0x35')];if(this[_0xd15a('0xd')][_0x5034b2['uniqueid']][_0xd15a('0x32')]>0x0){tiff2pdf(_0x5034b2[_0xd15a('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x49d967){logger[_0xd15a('0x24')](_0x5034b2[_0xd15a('0x22')],_0xd15a('0x36'),_0x49d967[_0xd15a('0x37')]);attachment[_0xd15a('0x38')]({'name':path[_0xd15a('0x39')](_0x5034b2[_0xd15a('0x2f')])[_0xd15a('0x23')],'basename':path[_0xd15a('0x39')](_0x5034b2[_0xd15a('0x2f')])[_0xd15a('0x23')]+_0xd15a('0x3a'),'type':_0xd15a('0x3b')})[_0xd15a('0x3c')](function(_0x403869){faxAccount[_0xd15a('0x3d')](_0x3ef2ff,{'from':_0x5034b2[_0xd15a('0x35')],'mapKey':'fax','body':path[_0xd15a('0x39')](_0x5034b2[_0xd15a('0x2f')])['name']+_0xd15a('0x3a'),'AttachmentId':_0x403869['id']})['catch'](function(_0x5baf87){logger[_0xd15a('0x3e')](_0x5034b2[_0xd15a('0x22')],_0xd15a('0x3f'),JSON[_0xd15a('0x40')](_0x5baf87));});})['catch'](function(_0x4301f8){logger[_0xd15a('0x3e')](_0x5034b2['uniqueid'],_0xd15a('0x41'),JSON[_0xd15a('0x40')](_0x4301f8));});});}logger[_0xd15a('0x24')](_0x5034b2[_0xd15a('0x22')],_0xd15a('0x41'));}};Fax[_0xd15a('0x26')][_0xd15a('0x1d')]=function(_0x476253){if(this[_0xd15a('0x10')][_0x476253[_0xd15a('0x22')]]){_[_0xd15a('0x42')](this[_0xd15a('0xd')][_0x476253[_0xd15a('0x22')]],_[_0xd15a('0x43')](_0x476253,['response',_0xd15a('0x44')]));}};function updateStatus(_0x2f2d54){if(_0x2f2d54[_0xd15a('0x45')]){faxMessage[_0xd15a('0x46')](_0x2f2d54[_0xd15a('0x45')],{'failMessage':_0xd15a('0x47')})[_0xd15a('0x3c')](function(_0x465076){ut[_0xd15a('0x48')](_0xd15a('0x49'),_0x465076);})[_0xd15a('0x4a')](function(_0xbbe102){ut[_0xd15a('0x48')]('[Fax][Message][Error][NoUpdate1]',_0xbbe102);});}else{ut[_0xd15a('0x48')](_0xd15a('0x4b'));}}Fax[_0xd15a('0x26')][_0xd15a('0x4c')]=function(_0x4686a2,_0x367237,_0x5e256e){var _0x373b7f=this;var _0x1ced71={};if(_0x367237){_0x1ced71={'read':_0x367237};}else{_0x1ced71={'failMessage':_0x5e256e};}if(this[_0xd15a('0x10')][_0x4686a2]['AttachmentId']){faxMessage[_0xd15a('0x46')](this[_0xd15a('0x10')][_0x4686a2][_0xd15a('0x45')],_0x1ced71)[_0xd15a('0x3c')](function(_0x5c6cfc){ut[_0xd15a('0x48')](_0xd15a('0x4d'),_0x5c6cfc);})[_0xd15a('0x4a')](function(_0x1418cf){ut[_0xd15a('0x48')](_0xd15a('0x4e'),_0x1418cf);})[_0xd15a('0x4f')](function(){delete _0x373b7f[_0xd15a('0xd')][_0x4686a2];delete _0x373b7f[_0xd15a('0x10')][_0x4686a2];});}else{ut[_0xd15a('0x48')](_0xd15a('0x50'));delete this['channels'][_0x4686a2];delete this['actions'][_0x4686a2];}};Fax['prototype']['syncHangup']=function(_0x3ca609){var _0xe522da=this;if(this[_0xd15a('0xd')][_0x3ca609[_0xd15a('0x22')]]){if(this['actions'][_0x3ca609[_0xd15a('0x22')]]){this[_0xd15a('0xd')][_0x3ca609[_0xd15a('0x22')]]['id']=this[_0xd15a('0x10')][_0x3ca609[_0xd15a('0x22')]]['id'];this[_0xd15a('0xd')][_0x3ca609['uniqueid']][_0xd15a('0x23')]=this[_0xd15a('0x10')][_0x3ca609[_0xd15a('0x22')]][_0xd15a('0x23')];}logger[_0xd15a('0x24')](_0x3ca609[_0xd15a('0x22')],this[_0xd15a('0x10')][_0x3ca609[_0xd15a('0x22')]]?_0xd15a('0x51'):_0xd15a('0x52'),JSON['stringify'](this[_0xd15a('0xd')][_0x3ca609[_0xd15a('0x22')]]));if(this['actions'][_0x3ca609[_0xd15a('0x22')]]){if(this[_0xd15a('0xd')][_0x3ca609[_0xd15a('0x22')]][_0xd15a('0x53')]>0x0&&this[_0xd15a('0xd')][_0x3ca609['uniqueid']][_0xd15a('0x17')]==='SUCCESS'){this[_0xd15a('0x4c')](_0x3ca609[_0xd15a('0x22')],!![]);}else{this['updateStatus'](_0x3ca609[_0xd15a('0x22')],![],this['channels'][_0x3ca609[_0xd15a('0x22')]][_0xd15a('0x54')]?_0xd15a('0x55')+this['channels'][_0x3ca609[_0xd15a('0x22')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0xd15a('0x26')][_0xd15a('0x56')]=function(_0x1cc0d7){var _0x31552f=this;return new BPromise(function(_0x32c53e,_0x48c116){_0x31552f['execOriginate'](_0x1cc0d7,_0x31552f[_0xd15a('0xe')][_0x1cc0d7['FaxAccountId']])[_0xd15a('0x3c')](function(_0x24e453){ut[_0xd15a('0x48')](_0xd15a('0x57'),_0x24e453);_0x32c53e(ut['message']('Fax\x20received'));})[_0xd15a('0x4a')](function(_0x3ae763){ut[_0xd15a('0x48')]('[Fax][execOriginate][failure]',_0x3ae763);updateStatus(_0x1cc0d7);_0x48c116(ut[_0xd15a('0x37')](_0xd15a('0x58')));});});};Fax[_0xd15a('0x26')][_0xd15a('0x59')]=function(_0x472cd7){var _0x270a02=this;return new BPromise(function(_0x3b04e9,_0x15e00d){var _0x35f3cf=_0x270a02[_0xd15a('0x5a')](_0x270a02[_0xd15a('0xe')][_0x472cd7[_0xd15a('0x5b')]][_0xd15a('0x5c')],_0x472cd7);if(_0x35f3cf[_0xd15a('0x5d')]){_0x3b04e9(ut[_0xd15a('0x37')](_0xd15a('0x5e')));}else{_0x15e00d(ut['message'](_0x35f3cf[_0xd15a('0x37')]));}});};function originate(_0x8b9234,_0x263c62,_0x31425f){return new BPromise(function(_0x424bf7,_0x56e1b2){if(_0x31425f){var _0x11d266=util[_0xd15a('0x5f')]('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[_0xd15a('0x39')](_0x8b9234[_0xd15a('0x60')])[_0xd15a('0x23')],_0x8b9234[_0xd15a('0x60')]);gs[_0xd15a('0x61')](_0x11d266)['then'](function(){_0x8b9234[_0xd15a('0x60')]=util[_0xd15a('0x5f')](_0xd15a('0x62'),path[_0xd15a('0x39')](_0x8b9234[_0xd15a('0x60')])['dir'],path[_0xd15a('0x39')](_0x8b9234[_0xd15a('0x60')])['name']);_0x263c62[_0xd15a('0x63')]=_0x8b9234[_0xd15a('0x60')];ut[_0xd15a('0x48')](_0xd15a('0x64'),'');ami['Action'](ut[_0xd15a('0x65')](_0x8b9234,_0x263c62))['then'](function(_0x48baf7){_0x424bf7(_0x48baf7);})[_0xd15a('0x4a')](function(_0x3143bb){_0x56e1b2(_0x3143bb);});})[_0xd15a('0x4a')](function(_0x47b607){_0x56e1b2(_0x47b607);});}else{ami[_0xd15a('0x66')](ut[_0xd15a('0x65')](_0x8b9234,_0x263c62))[_0xd15a('0x3c')](function(_0x13db42){_0x424bf7(_0x13db42);})['catch'](function(_0x451e9b){_0x56e1b2(_0x451e9b);});}});}Fax[_0xd15a('0x26')][_0xd15a('0x67')]=function(_0x15e9a3,_0x3ce04d){var _0x5cde84=this;return new BPromise(function(_0x509179,_0x491fd3){var _0x52da10=uuid['v4']();var _0x2c225d=ut['addVariables'](_0x15e9a3,_0x3ce04d);_0x5cde84[_0xd15a('0x10')][_0x52da10]=new Action(_0x52da10,_0x3ce04d,_0x15e9a3);var _0x225fe7=_0x5cde84['actions'][_0x52da10];if(path['parse'](_0x15e9a3[_0xd15a('0x60')])['ext']==='.pdf'){originate(_0x225fe7,_0x2c225d,!![])[_0xd15a('0x3c')](function(_0x4e21a0){_0x509179(_0x4e21a0);})['catch'](function(_0x571f7b){_0x491fd3(_0x571f7b);});}else{originate(_0x225fe7,_0x2c225d,![])[_0xd15a('0x3c')](function(_0xb86ed){_0x509179(_0xb86ed);})[_0xd15a('0x4a')](function(_0xd8146e){_0x491fd3(_0xd8146e);});}});};Fax[_0xd15a('0x26')][_0xd15a('0x68')]=function(_0x6506fe){return!_[_0xd15a('0x69')](_0x6506fe)&&!_['isNil'](_0x6506fe[_0xd15a('0x23')])&&!_[_0xd15a('0x69')](_0x6506fe[_0xd15a('0x6a')])&&_0x6506fe[_0xd15a('0x6a')]&&!_[_0xd15a('0x69')](this[_0xd15a('0xf')][util[_0xd15a('0x5f')](_0xd15a('0x6b'),_0x6506fe['name'])])&&!_[_0xd15a('0x69')](this[_0xd15a('0xf')][util['format']('SIP/%s',_0x6506fe['name'])][_0xd15a('0x2d')])&&(this[_0xd15a('0xf')][util[_0xd15a('0x5f')](_0xd15a('0x6b'),_0x6506fe[_0xd15a('0x23')])][_0xd15a('0x2d')]===_0xd15a('0x6c')||this['trunks'][util[_0xd15a('0x5f')](_0xd15a('0x6b'),_0x6506fe[_0xd15a('0x23')])][_0xd15a('0x2d')]==='unmonitored');};Fax[_0xd15a('0x26')][_0xd15a('0x5a')]=function(_0x4ca431,_0x5a8083){if(!this[_0xd15a('0x68')](_0x4ca431)){ut[_0xd15a('0x48')](_0xd15a('0x6d'),_[_0xd15a('0x69')](_0x4ca431)?'':_0x4ca431[_0xd15a('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xd15a('0x6e')};}if(_[_0xd15a('0x69')](_0x5a8083[_0xd15a('0x6')])){ut[_0xd15a('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xd15a('0x40')](_0x5a8083));return{'isValid':![],'message':_0xd15a('0x6f')};}if(_[_0xd15a('0x69')](_0x5a8083[_0xd15a('0x60')])){ut[_0xd15a('0x48')](_0xd15a('0x70'),JSON[_0xd15a('0x40')](_0x5a8083));return{'isValid':![],'message':_0xd15a('0x71')};}return{'isValid':!![],'message':_0xd15a('0x72')};};module[_0xd15a('0x73')]=Fax; \ No newline at end of file +var _0x8234=['then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','actions','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','name','parse','.pdf','application/pdf'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x8234,0xc3));var _0x4823=function(_0x4b287d,_0x2ea048){_0x4b287d=_0x4b287d-0x0;var _0x563b27=_0x8234[_0x4b287d];return _0x563b27;};'use strict';var util=require(_0x4823('0x0'));var _=require(_0x4823('0x1'));var BPromise=require(_0x4823('0x2'));var uuid=require(_0x4823('0x3'));var moment=require(_0x4823('0x4'));var path=require(_0x4823('0x5'));var tiff2pdf=require(_0x4823('0x6'));var gs=require('./util/gs');var logger=require(_0x4823('0x7'))(_0x4823('0x8'));var ami=require(_0x4823('0x9'));var rpcDb=require(_0x4823('0xa'));var Channel=require('./channel');var ut=require(_0x4823('0xb'));var Action=require(_0x4823('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4823('0xd'));var faxMessage=require(_0x4823('0xe'));function Fax(_0x4f543d){this[_0x4823('0xf')]={};this[_0x4823('0x10')]=_0x4f543d[_0x4823('0x10')];this[_0x4823('0x11')]=_0x4f543d['trunks'];this['actions']={};ami['on'](_0x4823('0x12'),this[_0x4823('0x13')]['bind'](this));ami['on']('varset',this[_0x4823('0x14')][_0x4823('0x15')](this));ami['on'](_0x4823('0x16'),this[_0x4823('0x17')][_0x4823('0x15')](this));ami['on'](_0x4823('0x18'),this[_0x4823('0x19')]['bind'](this));ami['on']('faxstatus',this[_0x4823('0x1a')][_0x4823('0x15')](this));ami['on'](_0x4823('0x1b'),this[_0x4823('0x1c')][_0x4823('0x15')](this));ami['on'](_0x4823('0x1d'),this[_0x4823('0x1e')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x4823('0x15')](this));}Fax[_0x4823('0x1f')][_0x4823('0x13')]=function(_0x41e70a){if(_0x41e70a[_0x4823('0x20')]===_0x4823('0x21')){for(var _0x431ac9 in this['faxAccounts']){if(this[_0x4823('0x10')][_0x4823('0x22')](_0x431ac9)){if(_0x41e70a[_0x4823('0x23')]===this[_0x4823('0x10')][_0x431ac9][_0x4823('0x24')]){this['channels'][_0x41e70a[_0x4823('0x25')]]={};this[_0x4823('0xf')][_0x41e70a[_0x4823('0x25')]][_0x4823('0x26')]=_0x41e70a[_0x4823('0x26')];this[_0x4823('0xf')][_0x41e70a[_0x4823('0x25')]]['id']=this[_0x4823('0x10')][_0x431ac9]['id'];this['channels'][_0x41e70a[_0x4823('0x25')]]['name']=this['faxAccounts'][_0x431ac9]['name'];logger[_0x4823('0x27')](_0x41e70a[_0x4823('0x25')],_0x4823('0x28'));}}}}if(this['actions'][_0x41e70a[_0x4823('0x25')]]){this['channels'][_0x41e70a['uniqueid']]={};this[_0x4823('0xf')][_0x41e70a[_0x4823('0x25')]][_0x4823('0x26')]=_0x41e70a[_0x4823('0x26')];logger[_0x4823('0x27')](_0x41e70a['uniqueid'],_0x4823('0x28'));}};Fax[_0x4823('0x1f')][_0x4823('0x14')]=function(_0x573610){if(this['channels'][_0x573610['uniqueid']]){for(var _0x59770c in _0x573610[_0x4823('0x29')]){if(_0x573610['variable'][_0x4823('0x22')](_0x59770c)){this[_0x4823('0xf')][_0x573610[_0x4823('0x25')]][_0x59770c]=_0x573610[_0x4823('0x2a')];}}}};Fax['prototype']['syncNewState']=function(_0x5df55c){if(this[_0x4823('0xf')][_0x5df55c[_0x4823('0x25')]]){this['channels'][_0x5df55c[_0x4823('0x25')]][_0x4823('0x2b')]=_0x5df55c[_0x4823('0x2b')];this[_0x4823('0xf')][_0x5df55c[_0x4823('0x25')]][_0x4823('0x2c')]=_0x5df55c[_0x4823('0x2c')];}};Fax[_0x4823('0x1f')][_0x4823('0x19')]=function(_0x2a7fa4){if(this['channels'][_0x2a7fa4[_0x4823('0x25')]]){for(var _0x12af2a in _0x2a7fa4[_0x4823('0x29')]){if(_0x2a7fa4[_0x4823('0x29')]['hasOwnProperty'](_0x12af2a)){this[_0x4823('0xf')][_0x2a7fa4[_0x4823('0x25')]][_0x12af2a]=_0x2a7fa4[_0x4823('0x2a')];}}}};Fax[_0x4823('0x1f')]['syncFaxStatus']=function(_0x3d83e9){if(this['channels'][_0x3d83e9[_0x4823('0x25')]]){this[_0x4823('0xf')][_0x3d83e9[_0x4823('0x25')]]['operation']=_0x3d83e9[_0x4823('0x2d')];this['channels'][_0x3d83e9['uniqueid']]['status']=_0x3d83e9[_0x4823('0x2e')];this[_0x4823('0xf')][_0x3d83e9[_0x4823('0x25')]][_0x4823('0x24')]=_0x3d83e9['localstationid'];this[_0x4823('0xf')][_0x3d83e9[_0x4823('0x25')]][_0x4823('0x2f')]=_0x3d83e9[_0x4823('0x2f')];logger['info'](_0x3d83e9[_0x4823('0x25')],_0x4823('0x30'));}};Fax['prototype'][_0x4823('0x1c')]=function(_0x1a5418){var _0x394a15=this;if(this[_0x4823('0xf')][_0x1a5418[_0x4823('0x25')]]){var _0x4c3b86=this['channels'][_0x1a5418[_0x4823('0x25')]]['id'];this['channels'][_0x1a5418[_0x4823('0x25')]][_0x4823('0x31')]=_0x1a5418[_0x4823('0x31')];this[_0x4823('0xf')][_0x1a5418[_0x4823('0x25')]][_0x4823('0x32')]=_0x1a5418[_0x4823('0x32')];this[_0x4823('0xf')][_0x1a5418[_0x4823('0x25')]][_0x4823('0x24')]=_0x1a5418[_0x4823('0x24')];this[_0x4823('0xf')][_0x1a5418[_0x4823('0x25')]][_0x4823('0x33')]=_0x1a5418[_0x4823('0x33')];this['channels'][_0x1a5418[_0x4823('0x25')]]['transferrate']=_0x1a5418[_0x4823('0x34')];this[_0x4823('0xf')][_0x1a5418[_0x4823('0x25')]][_0x4823('0x2f')]=_0x1a5418[_0x4823('0x2f')];this['channels'][_0x1a5418[_0x4823('0x25')]][_0x4823('0x35')]=_0x1a5418['calleridnum'];if(this[_0x4823('0xf')][_0x1a5418['uniqueid']][_0x4823('0x32')]>0x0){tiff2pdf(_0x1a5418[_0x4823('0x2f')],_0x4823('0x36'),function(_0x4242fe){logger[_0x4823('0x27')](_0x1a5418[_0x4823('0x25')],_0x4823('0x37'),_0x4242fe['message']);attachment[_0x4823('0x38')]({'name':path['parse'](_0x1a5418[_0x4823('0x2f')])[_0x4823('0x39')],'basename':path[_0x4823('0x3a')](_0x1a5418[_0x4823('0x2f')])[_0x4823('0x39')]+_0x4823('0x3b'),'type':_0x4823('0x3c')})[_0x4823('0x3d')](function(_0xd8ec74){faxAccount[_0x4823('0x3e')](_0x4c3b86,{'from':_0x1a5418[_0x4823('0x35')],'mapKey':'fax','body':path[_0x4823('0x3a')](_0x1a5418[_0x4823('0x2f')])[_0x4823('0x39')]+_0x4823('0x3b'),'AttachmentId':_0xd8ec74['id']})[_0x4823('0x3f')](function(_0x46e284){logger[_0x4823('0x40')](_0x1a5418[_0x4823('0x25')],_0x4823('0x41'),JSON[_0x4823('0x42')](_0x46e284));});})['catch'](function(_0xdfa61e){logger[_0x4823('0x40')](_0x1a5418[_0x4823('0x25')],_0x4823('0x43'),JSON[_0x4823('0x42')](_0xdfa61e));});});}logger['info'](_0x1a5418[_0x4823('0x25')],'\x20receiveFax\x20');}};Fax[_0x4823('0x1f')][_0x4823('0x44')]=function(_0x12ece6){if(this[_0x4823('0x45')][_0x12ece6['uniqueid']]){_[_0x4823('0x46')](this['channels'][_0x12ece6[_0x4823('0x25')]],_[_0x4823('0x47')](_0x12ece6,[_0x4823('0x48'),_0x4823('0x49')]));}};function updateStatus(_0x52d634){if(_0x52d634[_0x4823('0x4a')]){faxMessage[_0x4823('0x4b')](_0x52d634['AttachmentId'],{'failMessage':_0x4823('0x4c')})['then'](function(_0x3fc1a3){ut['logger'](_0x4823('0x4d'),_0x3fc1a3);})[_0x4823('0x3f')](function(_0x1b0fcb){ut[_0x4823('0x4e')]('[Fax][Message][Error][NoUpdate1]',_0x1b0fcb);});}else{ut[_0x4823('0x4e')](_0x4823('0x4f'));}}Fax[_0x4823('0x1f')]['updateStatus']=function(_0x83b880,_0x3e5eb9,_0x23ec80){var _0x46294b=this;var _0x4e535e={};if(_0x3e5eb9){_0x4e535e={'read':_0x3e5eb9};}else{_0x4e535e={'failMessage':_0x23ec80};}if(this['actions'][_0x83b880]['AttachmentId']){faxMessage[_0x4823('0x4b')](this[_0x4823('0x45')][_0x83b880]['AttachmentId'],_0x4e535e)[_0x4823('0x3d')](function(_0x188b6c){ut[_0x4823('0x4e')](_0x4823('0x50'),_0x188b6c);})['catch'](function(_0x5bca82){ut[_0x4823('0x4e')](_0x4823('0x51'),_0x5bca82);})[_0x4823('0x52')](function(){delete _0x46294b[_0x4823('0xf')][_0x83b880];delete _0x46294b['actions'][_0x83b880];});}else{ut[_0x4823('0x4e')](_0x4823('0x53'));delete this[_0x4823('0xf')][_0x83b880];delete this[_0x4823('0x45')][_0x83b880];}};Fax['prototype'][_0x4823('0x1e')]=function(_0x52efca){var _0x136e09=this;if(this[_0x4823('0xf')][_0x52efca['uniqueid']]){if(this[_0x4823('0x45')][_0x52efca[_0x4823('0x25')]]){this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]]['id']=this[_0x4823('0x45')][_0x52efca['uniqueid']]['id'];this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]][_0x4823('0x39')]=this[_0x4823('0x45')][_0x52efca['uniqueid']]['name'];}logger['info'](_0x52efca[_0x4823('0x25')],this[_0x4823('0x45')][_0x52efca[_0x4823('0x25')]]?_0x4823('0x54'):_0x4823('0x55'),JSON[_0x4823('0x42')](this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]]));if(this['actions'][_0x52efca[_0x4823('0x25')]]){if(this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]][_0x4823('0x56')]>0x0&&this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]][_0x4823('0x57')]===_0x4823('0x58')){this[_0x4823('0x59')](_0x52efca[_0x4823('0x25')],!![]);}else{this['updateStatus'](_0x52efca[_0x4823('0x25')],![],this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]][_0x4823('0x5a')]?_0x4823('0x5b')+this[_0x4823('0xf')][_0x52efca[_0x4823('0x25')]][_0x4823('0x5a')]:_0x4823('0x5c'));}}}};Fax['prototype']['send']=function(_0x5ba080){var _0x30191f=this;return new BPromise(function(_0x3a7c92,_0x459a22){_0x30191f[_0x4823('0x5d')](_0x5ba080,_0x30191f['faxAccounts'][_0x5ba080[_0x4823('0x5e')]])[_0x4823('0x3d')](function(_0x362397){ut[_0x4823('0x4e')](_0x4823('0x5f'),_0x362397);_0x3a7c92(ut[_0x4823('0x60')](_0x4823('0x61')));})[_0x4823('0x3f')](function(_0x2d1c76){ut['logger'](_0x4823('0x62'),_0x2d1c76);updateStatus(_0x5ba080);_0x459a22(ut[_0x4823('0x60')](_0x4823('0x63')));});});};Fax[_0x4823('0x1f')][_0x4823('0x64')]=function(_0x4bc06a){var _0x57a376=this;return new BPromise(function(_0x1ab986,_0x59e665){var _0x474dc3=_0x57a376[_0x4823('0x65')](_0x57a376[_0x4823('0x10')][_0x4bc06a[_0x4823('0x5e')]]['Trunk'],_0x4bc06a);if(_0x474dc3[_0x4823('0x66')]){_0x1ab986(ut['message'](_0x4823('0x67')));}else{_0x59e665(ut['message'](_0x474dc3['message']));}});};function originate(_0x388671,_0x14dc26,_0x10bf58){return new BPromise(function(_0x28458a,_0x128569){if(_0x10bf58){var _0x12159c=util[_0x4823('0x68')](_0x4823('0x69'),path[_0x4823('0x3a')](_0x388671[_0x4823('0x5')])['name'],_0x388671[_0x4823('0x5')]);gs[_0x4823('0x6a')](_0x12159c)[_0x4823('0x3d')](function(){_0x388671[_0x4823('0x5')]=util[_0x4823('0x68')](_0x4823('0x6b'),path['parse'](_0x388671[_0x4823('0x5')])[_0x4823('0x6c')],path['parse'](_0x388671[_0x4823('0x5')])[_0x4823('0x39')]);_0x14dc26[_0x4823('0x6d')]=_0x388671[_0x4823('0x5')];ut[_0x4823('0x4e')](_0x4823('0x6e'),'');ami[_0x4823('0x6f')](ut['variablesAction'](_0x388671,_0x14dc26))[_0x4823('0x3d')](function(_0x114ba7){_0x28458a(_0x114ba7);})[_0x4823('0x3f')](function(_0xb81251){_0x128569(_0xb81251);});})[_0x4823('0x3f')](function(_0x2d8e15){_0x128569(_0x2d8e15);});}else{ami[_0x4823('0x6f')](ut[_0x4823('0x70')](_0x388671,_0x14dc26))[_0x4823('0x3d')](function(_0x1e5056){_0x28458a(_0x1e5056);})[_0x4823('0x3f')](function(_0x14aa1d){_0x128569(_0x14aa1d);});}});}Fax[_0x4823('0x1f')][_0x4823('0x5d')]=function(_0x3599c4,_0x1234fd){var _0x5107e5=this;return new BPromise(function(_0x932a67,_0x392488){var _0x2642be=uuid['v4']();var _0x4ab6f8=ut[_0x4823('0x71')](_0x3599c4,_0x1234fd);_0x5107e5[_0x4823('0x45')][_0x2642be]=new Action(_0x2642be,_0x1234fd,_0x3599c4);var _0x48cf3f=_0x5107e5[_0x4823('0x45')][_0x2642be];if(path[_0x4823('0x3a')](_0x3599c4['path'])[_0x4823('0x72')]==='.pdf'){originate(_0x48cf3f,_0x4ab6f8,!![])[_0x4823('0x3d')](function(_0x32677d){_0x932a67(_0x32677d);})['catch'](function(_0x5f39ae){_0x392488(_0x5f39ae);});}else{originate(_0x48cf3f,_0x4ab6f8,![])[_0x4823('0x3d')](function(_0x3c7b5c){_0x932a67(_0x3c7b5c);})[_0x4823('0x3f')](function(_0x40d419){_0x392488(_0x40d419);});}});};Fax[_0x4823('0x1f')][_0x4823('0x73')]=function(_0x58c197){return!_['isNil'](_0x58c197)&&!_[_0x4823('0x74')](_0x58c197['name'])&&!_[_0x4823('0x74')](_0x58c197[_0x4823('0x75')])&&_0x58c197[_0x4823('0x75')]&&!_[_0x4823('0x74')](this[_0x4823('0x11')][util[_0x4823('0x68')](_0x4823('0x76'),_0x58c197[_0x4823('0x39')])])&&!_['isNil'](this[_0x4823('0x11')][util[_0x4823('0x68')](_0x4823('0x76'),_0x58c197[_0x4823('0x39')])][_0x4823('0x2e')])&&(this[_0x4823('0x11')][util['format'](_0x4823('0x76'),_0x58c197[_0x4823('0x39')])]['status']===_0x4823('0x77')||this[_0x4823('0x11')][util['format'](_0x4823('0x76'),_0x58c197[_0x4823('0x39')])][_0x4823('0x2e')]==='unmonitored');};Fax[_0x4823('0x1f')]['checkTrunk']=function(_0x1ec49f,_0x1de47b){if(!this[_0x4823('0x73')](_0x1ec49f)){ut[_0x4823('0x4e')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x4823('0x74')](_0x1ec49f)?'':_0x1ec49f[_0x4823('0x39')]+_0x4823('0x78'));return{'isValid':![],'message':_0x4823('0x79')};}if(_[_0x4823('0x74')](_0x1de47b[_0x4823('0x8')])){ut[_0x4823('0x4e')](_0x4823('0x7a'),JSON[_0x4823('0x42')](_0x1de47b));return{'isValid':![],'message':_0x4823('0x7b')};}if(_[_0x4823('0x74')](_0x1de47b[_0x4823('0x5')])){ut['logger'](_0x4823('0x7c'),JSON[_0x4823('0x42')](_0x1de47b));return{'isValid':![],'message':_0x4823('0x7d')};}return{'isValid':!![],'message':_0x4823('0x7e')};};module[_0x4823('0x7f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b444cf7..85eaeb2 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 _0x1b6f=['notify','resolve','catch','[Notify]\x20','util','../../../config/logger','preview','inspect'];(function(_0x3b180e,_0x5cf84f){var _0x1fa7ab=function(_0x1a0929){while(--_0x1a0929){_0x3b180e['push'](_0x3b180e['shift']());}};_0x1fa7ab(++_0x5cf84f);}(_0x1b6f,0x1a4));var _0xf1b6=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x1b6f[_0x51a6d6];return _0x5ef1a8;};'use strict';var util=require(_0xf1b6('0x0'));var BPromise=require('bluebird');var logger=require(_0xf1b6('0x1'))(_0xf1b6('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2009b1){return function(_0x12efa4){logger['error'](_0x2009b1,util[_0xf1b6('0x3')](_0x12efa4,{'showHidden':![],'depth':null}));};}exports[_0xf1b6('0x4')]=function(_0x591d33,_0x45fe5f){return BPromise[_0xf1b6('0x5')]()['then'](faxAccount[_0xf1b6('0x4')](_0x591d33,_0x45fe5f))[_0xf1b6('0x6')](loggerCatch(_0xf1b6('0x7')));}; \ No newline at end of file +var _0x159d=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','notify','resolve','then','catch'];(function(_0x2e9c5e,_0x2ca9bf){var _0x1b9616=function(_0x34f70f){while(--_0x34f70f){_0x2e9c5e['push'](_0x2e9c5e['shift']());}};_0x1b9616(++_0x2ca9bf);}(_0x159d,0x19a));var _0xd159=function(_0x2629f2,_0x2ac3de){_0x2629f2=_0x2629f2-0x0;var _0x5a59e4=_0x159d[_0x2629f2];return _0x5a59e4;};'use strict';var util=require(_0xd159('0x0'));var BPromise=require(_0xd159('0x1'));var logger=require(_0xd159('0x2'))(_0xd159('0x3'));var _=require(_0xd159('0x4'));var faxAccount=require(_0xd159('0x5'));function loggerCatch(_0x3c9d60){return function(_0x408e8e){logger['error'](_0x3c9d60,util['inspect'](_0x408e8e,{'showHidden':![],'depth':null}));};}exports[_0xd159('0x6')]=function(_0x501705,_0x1fef16){return BPromise[_0xd159('0x7')]()[_0xd159('0x8')](faxAccount['notify'](_0x501705,_0x1fef16))[_0xd159('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index cf59fd2..3e55c61 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 _0xd54a=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','child_process'];(function(_0xec4f32,_0x422bef){var _0x374070=function(_0x2c7175){while(--_0x2c7175){_0xec4f32['push'](_0xec4f32['shift']());}};_0x374070(++_0x422bef);}(_0xd54a,0x11d));var _0xad54=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xd54a[_0x3d42d8];return _0x27fc41;};'use strict';var util=require('util');var logger=require(_0xad54('0x0'))('fax');var BPromise=require('bluebird');var exec=require(_0xad54('0x1'))[_0xad54('0x2')];exports['execute']=function(_0x3ca321){return new BPromise(function(_0x4aaf0c,_0xac47c){exec(_0x3ca321,function(_0x3e5b1c,_0x36c2ec,_0x3c4741){logger[_0xad54('0x3')](_0xad54('0x4'),_0x36c2ec);if(_0x3e5b1c){logger['info']('Exec\x20gs',_0xad54('0x5'),util[_0xad54('0x6')](_0x3e5b1c,{'showHidden':![],'depth':null}),_0x36c2ec,_0x3c4741);_0xac47c(_0x3e5b1c);}_0x4aaf0c(_0x36c2ec);});});}; \ No newline at end of file +var _0x3f99=['execute','info','util','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x2e6200,_0x579b30){var _0x4520d1=function(_0x404bbe){while(--_0x404bbe){_0x2e6200['push'](_0x2e6200['shift']());}};_0x4520d1(++_0x579b30);}(_0x3f99,0xa2));var _0x93f9=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x3f99[_0x1a0600];return _0x734670;};'use strict';var util=require(_0x93f9('0x0'));var logger=require(_0x93f9('0x1'))(_0x93f9('0x2'));var BPromise=require(_0x93f9('0x3'));var exec=require(_0x93f9('0x4'))[_0x93f9('0x5')];exports[_0x93f9('0x6')]=function(_0x95993a){return new BPromise(function(_0x3f3dde,_0x154cbf){exec(_0x95993a,function(_0x5a5f5f,_0x20a0e4,_0x4e088a){logger['info']('Exec\x20gs',_0x20a0e4);if(_0x5a5f5f){logger[_0x93f9('0x7')]('Exec\x20gs','\x20Error\x20:',util['inspect'](_0x5a5f5f,{'showHidden':![],'depth':null}),_0x20a0e4,_0x4e088a);_0x154cbf(_0x5a5f5f);}_0x3f3dde(_0x20a0e4);});});}; \ 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 02a8f31..5b8baf4 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 _0x5baa=['ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','util','moment','../../../../config/logger','fax','logger','addVariables'];(function(_0x2c3bb9,_0x45f8d2){var _0x5c688a=function(_0xf8a37d){while(--_0xf8a37d){_0x2c3bb9['push'](_0x2c3bb9['shift']());}};_0x5c688a(++_0x45f8d2);}(_0x5baa,0x1b2));var _0xa5ba=function(_0x3f147e,_0x22f451){_0x3f147e=_0x3f147e-0x0;var _0x4e5f3c=_0x5baa[_0x3f147e];return _0x4e5f3c;};'use strict';var util=require(_0xa5ba('0x0'));var _=require('lodash');var moment=require(_0xa5ba('0x1'));var logger=require(_0xa5ba('0x2'))(_0xa5ba('0x3'));exports['message']=function(_0x31fec2){return{'message':_0x31fec2};};exports[_0xa5ba('0x4')]=function(_0x2e0c23,_0x3a1447){logger['info'](_0x2e0c23,util['inspect'](_0x3a1447,{'showHidden':![],'depth':null}));};exports[_0xa5ba('0x5')]=function(_0xb93eb1,_0x401482){var _0x51e72f={'XMF-ECM':_0x401482[_0xa5ba('0x6')],'XMF-HEADERINFO':_0x401482[_0xa5ba('0x7')],'XMF-MINRATE':_0x401482[_0xa5ba('0x8')],'XMF-MAXRATE':_0x401482[_0xa5ba('0x9')],'XMF-MODEM':util[_0xa5ba('0xa')](_0xa5ba('0xb'),_0x401482['modem']),'XMF-GATEWAY':_0x401482[_0xa5ba('0xc')],'XMF-FAXDETECT':_0x401482[_0xa5ba('0xd')],'XMF-T38TIMEOUT':_0x401482[_0xa5ba('0xe')],'XMF-LOCALSTATIONID':_0x401482[_0xa5ba('0xf')],'XMF-PATH':_0xb93eb1[_0xa5ba('0x10')]};return _0x51e72f;};exports['variablesAction']=function(_0x54e8ac,_0x506b64){return{'actionid':_0x54e8ac[_0xa5ba('0x11')],'action':_0xa5ba('0x12'),'channel':_0x54e8ac[_0xa5ba('0x13')],'Exten':_0xa5ba('0x14'),'Context':_0xa5ba('0x15'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x54e8ac[_0xa5ba('0x7')]?_0x54e8ac[_0xa5ba('0x7')]:'',_0x54e8ac[_0xa5ba('0xf')]),'variable':_0x506b64,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x54e8ac[_0xa5ba('0x11')]};}; \ No newline at end of file +var _0x7115=['\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip'];(function(_0x40a4a1,_0x4d3316){var _0x2be62d=function(_0x1c58d6){while(--_0x1c58d6){_0x40a4a1['push'](_0x40a4a1['shift']());}};_0x2be62d(++_0x4d3316);}(_0x7115,0x17b));var _0x5711=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0x7115[_0x3de7e0];return _0x11d0b3;};'use strict';var util=require(_0x5711('0x0'));var _=require(_0x5711('0x1'));var moment=require(_0x5711('0x2'));var logger=require(_0x5711('0x3'))(_0x5711('0x4'));exports[_0x5711('0x5')]=function(_0x1280cf){return{'message':_0x1280cf};};exports[_0x5711('0x6')]=function(_0x4bfe9c,_0x48fda4){logger[_0x5711('0x7')](_0x4bfe9c,util[_0x5711('0x8')](_0x48fda4,{'showHidden':![],'depth':null}));};exports[_0x5711('0x9')]=function(_0x5d3689,_0x3d01ec){var _0x329c1f={'XMF-ECM':_0x3d01ec[_0x5711('0xa')],'XMF-HEADERINFO':_0x3d01ec[_0x5711('0xb')],'XMF-MINRATE':_0x3d01ec[_0x5711('0xc')],'XMF-MAXRATE':_0x3d01ec[_0x5711('0xd')],'XMF-MODEM':util[_0x5711('0xe')](_0x5711('0xf'),_0x3d01ec['modem']),'XMF-GATEWAY':_0x3d01ec[_0x5711('0x10')],'XMF-FAXDETECT':_0x3d01ec[_0x5711('0x11')],'XMF-T38TIMEOUT':_0x3d01ec[_0x5711('0x12')],'XMF-LOCALSTATIONID':_0x3d01ec[_0x5711('0x13')],'XMF-PATH':_0x5d3689[_0x5711('0x14')]};return _0x329c1f;};exports[_0x5711('0x15')]=function(_0x564a0c,_0x5bd729){return{'actionid':_0x564a0c[_0x5711('0x16')],'action':'originate','channel':_0x564a0c[_0x5711('0x17')],'Exten':_0x5711('0x18'),'Context':_0x5711('0x19'),'Priority':'1','callerid':util[_0x5711('0xe')](_0x5711('0x1a'),_0x564a0c[_0x5711('0xb')]?_0x564a0c[_0x5711('0xb')]:'',_0x564a0c[_0x5711('0x13')]),'variable':_0x5bd729,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x564a0c[_0x5711('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4d61a46..11936ce 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 _0xb8b0=['getTelephones','initTelephones','getTrunks','initTrunks','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initDeskAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','sync','catch','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/freshsales','../../config/logger','hour','get','then','getAgents','initAgents'];(function(_0x19cbbc,_0x4807d4){var _0x51449a=function(_0x188132){while(--_0x188132){_0x19cbbc['push'](_0x19cbbc['shift']());}};_0x51449a(++_0x4807d4);}(_0xb8b0,0x191));var _0x0b8b=function(_0x47a332,_0x38a628){_0x47a332=_0x47a332-0x0;var _0x12d025=_0xb8b0[_0x47a332];return _0x12d025;};'use strict';var util=require(_0x0b8b('0x0'));var moment=require(_0x0b8b('0x1'));var server=require(_0x0b8b('0x2'));var Realtime=require('./realtime');var Report=require(_0x0b8b('0x3'));var Acw=require(_0x0b8b('0x4'));var Trigger=require(_0x0b8b('0x5'));var Dialer=require(_0x0b8b('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x0b8b('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x0b8b('0x8'));var voiceCallReport=require(_0x0b8b('0x9'));var trunk=require(_0x0b8b('0xa'));var trigger=require(_0x0b8b('0xb'));var template=require(_0x0b8b('0xc'));var cmHopperHistory=require(_0x0b8b('0xd'));var campaign=require(_0x0b8b('0xe'));var voiceExtension=require(_0x0b8b('0xf'));var faxAccount=require(_0x0b8b('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x0b8b('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x0b8b('0x12'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x0b8b('0x13'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x0b8b('0x14'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x0b8b('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0b8b('0x16')](_0x0b8b('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x0b8b('0x17')](user[_0x0b8b('0x18')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x19')]())[_0x0b8b('0x17')](user[_0x0b8b('0x1a')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x1b')]())[_0x0b8b('0x17')](trunk[_0x0b8b('0x1c')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x1d')]())['then'](voiceQueue['getVoiceQueues']())[_0x0b8b('0x17')](realtime['initVoiceQueues']())['then'](trigger[_0x0b8b('0x1e')]())[_0x0b8b('0x17')](realtime['initTriggers']())['then'](template[_0x0b8b('0x1f')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x20')]())[_0x0b8b('0x17')](zendesk[_0x0b8b('0x21')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x22')]())['then'](salesforce[_0x0b8b('0x23')]())['then'](realtime[_0x0b8b('0x24')]())[_0x0b8b('0x17')](sugarcrm['getSugarcrmAccounts']())[_0x0b8b('0x17')](realtime[_0x0b8b('0x25')]())['then'](freshdesk['getFreshdeskAccounts']())[_0x0b8b('0x17')](realtime['initFreshdeskAccounts']())[_0x0b8b('0x17')](desk['getDeskAccounts']())[_0x0b8b('0x17')](realtime[_0x0b8b('0x26')]())[_0x0b8b('0x17')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x0b8b('0x17')](vtiger['getVtigerAccounts']())[_0x0b8b('0x17')](realtime[_0x0b8b('0x27')]())[_0x0b8b('0x17')](freshsales['getFreshsalesAccounts']())[_0x0b8b('0x17')](realtime[_0x0b8b('0x28')]())[_0x0b8b('0x17')](servicenow[_0x0b8b('0x29')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x2a')]())[_0x0b8b('0x17')](dynamics365[_0x0b8b('0x2b')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x2c')]())[_0x0b8b('0x17')](campaign['getCampaigns']())[_0x0b8b('0x17')](realtime[_0x0b8b('0x2d')]())[_0x0b8b('0x17')](voiceExtension[_0x0b8b('0x2e')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x2f')]())[_0x0b8b('0x17')](faxAccount[_0x0b8b('0x30')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x31')]())[_0x0b8b('0x17')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x0b8b('0x17')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0x0b8b('0x17')](cmHopperHistory[_0x0b8b('0x32')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x33')]())[_0x0b8b('0x17')](cmHopperHistory['getCampaignHopperHistory']())[_0x0b8b('0x17')](realtime[_0x0b8b('0x34')]())[_0x0b8b('0x17')](voiceCallReport[_0x0b8b('0x35')]())[_0x0b8b('0x17')](realtime[_0x0b8b('0x36')]())['catch'](function(_0x579430){logger[_0x0b8b('0x37')](_0x0b8b('0x38'),util[_0x0b8b('0x39')](_0x579430,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x0b8b('0x17')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x0b8b('0x17')](function(){report[_0x0b8b('0x3a')]();setInterval(initRealtime,0x1388);})[_0x0b8b('0x3b')](function(_0xe5cd7c){logger[_0x0b8b('0x37')](_0x0b8b('0x3c'),util[_0x0b8b('0x39')](_0xe5cd7c,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xdb16=['listen','error','[index.js][main]','util','moment','./report','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect'];(function(_0x3e8861,_0x35e7c5){var _0x3e6958=function(_0x22de31){while(--_0x22de31){_0x3e8861['push'](_0x3e8861['shift']());}};_0x3e6958(++_0x35e7c5);}(_0xdb16,0x1b3));var _0x6db1=function(_0x560232,_0x3d3008){_0x560232=_0x560232-0x0;var _0x478ab6=_0xdb16[_0x560232];return _0x478ab6;};'use strict';var util=require(_0x6db1('0x0'));var moment=require(_0x6db1('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x6db1('0x2'));var Acw=require(_0x6db1('0x3'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x6db1('0x4'));var Fax=require(_0x6db1('0x5'));var user=require(_0x6db1('0x6'));var voiceQueue=require(_0x6db1('0x7'));var voiceQueueReport=require(_0x6db1('0x8'));var voiceCallReport=require(_0x6db1('0x9'));var trunk=require(_0x6db1('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x6db1('0xb'));var cmHopperHistory=require(_0x6db1('0xc'));var campaign=require(_0x6db1('0xd'));var voiceExtension=require(_0x6db1('0xe'));var faxAccount=require(_0x6db1('0xf'));var zendesk=require(_0x6db1('0x10'));var salesforce=require(_0x6db1('0x11'));var sugarcrm=require(_0x6db1('0x12'));var freshdesk=require(_0x6db1('0x13'));var desk=require(_0x6db1('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x6db1('0x15'));var freshsales=require(_0x6db1('0x16'));var servicenow=require(_0x6db1('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6db1('0x18'))(_0x6db1('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6db1('0x1a')](_0x6db1('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x6db1('0x1c')]()[_0x6db1('0x1d')](user[_0x6db1('0x1e')]())['then'](realtime[_0x6db1('0x1f')]())[_0x6db1('0x1d')](user['getTelephones']())[_0x6db1('0x1d')](realtime[_0x6db1('0x20')]())[_0x6db1('0x1d')](trunk['getTrunks']())[_0x6db1('0x1d')](realtime[_0x6db1('0x21')]())[_0x6db1('0x1d')](voiceQueue[_0x6db1('0x22')]())['then'](realtime['initVoiceQueues']())[_0x6db1('0x1d')](trigger[_0x6db1('0x23')]())['then'](realtime['initTriggers']())[_0x6db1('0x1d')](template[_0x6db1('0x24')]())['then'](realtime[_0x6db1('0x25')]())[_0x6db1('0x1d')](zendesk[_0x6db1('0x26')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x27')]())[_0x6db1('0x1d')](salesforce[_0x6db1('0x28')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x6db1('0x29')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x2a')]())[_0x6db1('0x1d')](freshdesk[_0x6db1('0x2b')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x2c')]())['then'](desk[_0x6db1('0x2d')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x2e')]())[_0x6db1('0x1d')](zoho[_0x6db1('0x2f')]())['then'](realtime[_0x6db1('0x30')]())[_0x6db1('0x1d')](vtiger[_0x6db1('0x31')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x32')]())[_0x6db1('0x1d')](freshsales['getFreshsalesAccounts']())[_0x6db1('0x1d')](realtime[_0x6db1('0x33')]())[_0x6db1('0x1d')](servicenow[_0x6db1('0x34')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x35')]())['then'](dynamics365[_0x6db1('0x36')]())[_0x6db1('0x1d')](realtime['initDynamics365Accounts']())[_0x6db1('0x1d')](campaign[_0x6db1('0x37')]())['then'](realtime['initCampaigns']())[_0x6db1('0x1d')](voiceExtension[_0x6db1('0x38')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x39')]())[_0x6db1('0x1d')](faxAccount[_0x6db1('0x3a')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x3b')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x6db1('0x1c')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x6db1('0x3c')]())[_0x6db1('0x1d')](cmHopperHistory[_0x6db1('0x3d')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x3e')]())[_0x6db1('0x1d')](cmHopperHistory[_0x6db1('0x3f')]())[_0x6db1('0x1d')](realtime[_0x6db1('0x40')]())[_0x6db1('0x1d')](voiceCallReport[_0x6db1('0x41')]())[_0x6db1('0x1d')](realtime['initVoiceCallReports']())[_0x6db1('0x42')](function(_0x13f0f2){logger['error'](_0x6db1('0x43'),util[_0x6db1('0x44')](_0x13f0f2,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6db1('0x45')](realtime,preview,fax)[_0x6db1('0x1d')](function(){return initRealtime();})[_0x6db1('0x1d')](function(){return initParams();})[_0x6db1('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3e583e){logger[_0x6db1('0x46')](_0x6db1('0x47'),util[_0x6db1('0x44')](_0x3e583e,{'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 81b25c0..e173a32 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 _0xd3c1=['voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','onhold','stringify','user:%s','emit','exports','util','moment','md5','redis','defaults','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','interface','online','voiceStatus','voiceStatusTime'];(function(_0x3c67d1,_0x910fa7){var _0x201981=function(_0x4bb333){while(--_0x4bb333){_0x3c67d1['push'](_0x3c67d1['shift']());}};_0x201981(++_0x910fa7);}(_0xd3c1,0x1e5));var _0x1d3c=function(_0x43945d,_0x43d61c){_0x43945d=_0x43945d-0x0;var _0xfda9cb=_0xd3c1[_0x43945d];return _0xfda9cb;};'use strict';var _=require('lodash');var util=require(_0x1d3c('0x0'));var moment=require(_0x1d3c('0x1'));var md5=require(_0x1d3c('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1d3c('0x3')]=_[_0x1d3c('0x4')](config[_0x1d3c('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x5ca4dc){this['id']=_0x5ca4dc['id']||0x0;this[_0x1d3c('0x5')]=_0x5ca4dc['name']||'';this[_0x1d3c('0x6')]=_0x5ca4dc['email']||'';this[_0x1d3c('0x7')]=_0x5ca4dc[_0x1d3c('0x7')]||'';this[_0x1d3c('0x8')]=_0x5ca4dc[_0x1d3c('0x8')]||'';this[_0x1d3c('0x9')]=_0x1d3c('0xa');this[_0x1d3c('0xb')]=0x0;this[_0x1d3c('0xc')]=_0x1d3c('0xa');this[_0x1d3c('0xd')]='';this[_0x1d3c('0xe')]='';this['mobile']='';this[_0x1d3c('0xf')]='';this[_0x1d3c('0x10')]=_0x5ca4dc[_0x1d3c('0x10')]||![];this[_0x1d3c('0x11')]=_0x1d3c('0xa');this[_0x1d3c('0x12')]=0x0;this[_0x1d3c('0x13')]='';this[_0x1d3c('0x14')]='';this['onhold']=![];this[_0x1d3c('0x15')]=![];this[_0x1d3c('0x2')]='';}Agent[_0x1d3c('0x16')][_0x1d3c('0x17')]=function(_0x500e10){var _0x1baa2c;if(_0x500e10&&_0x500e10['state']){_0x1baa2c=_0x500e10[_0x1d3c('0x9')][_0x1d3c('0x18')]();switch(_0x1baa2c){case _0x1d3c('0x19'):_0x1baa2c=_0x1d3c('0x1a');break;case'inuse':_0x1baa2c=_0x1d3c('0x1b');break;}}if(_0x1baa2c&&this[_0x1d3c('0x11')]!==_0x1baa2c||_0x500e10[_0x1d3c('0x1c')]){this[_0x1d3c('0x12')]=_[_0x1d3c('0x1d')](moment()[_0x1d3c('0x1e')]('x'));}if(_0x1baa2c){this['voiceStatus']=_0x1baa2c;}var _0x5e0b30={'id':this['id'],'name':this[_0x1d3c('0x5')],'email':this['email'],'accountcode':this[_0x1d3c('0x7')],'fullname':this[_0x1d3c('0x8')],'state':this['state'],'stateTime':this[_0x1d3c('0xb')],'status':this['status'],'address':this[_0x1d3c('0xd')],'online':this[_0x1d3c('0x10')],'voiceStatus':this[_0x1d3c('0x11')],'voiceStatusTime':this[_0x1d3c('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x1d3c('0x14')],'interface':this[_0x1d3c('0xf')],'onhold':this[_0x1d3c('0x1f')]};var _0x52a8f9=md5(JSON[_0x1d3c('0x20')](_0x5e0b30));if(this[_0x1d3c('0x2')]!==_0x52a8f9){this[_0x1d3c('0x2')]=_0x52a8f9;io['to'](util[_0x1d3c('0x1e')](_0x1d3c('0x21'),_0x5e0b30['name']))[_0x1d3c('0x22')]('user:save',_0x5e0b30);io[_0x1d3c('0x22')]('user:presence',_0x5e0b30);}};module[_0x1d3c('0x23')]=Agent; \ No newline at end of file +var _0x9dff=['fullname','state','unknown','stateTime','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','inuse','talking','statePause','toNumber','format','address','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','redis','defaults','socket.io-emitter','name','email','accountcode'];(function(_0x22708b,_0x2bee57){var _0x3e0055=function(_0x2215a2){while(--_0x2215a2){_0x22708b['push'](_0x22708b['shift']());}};_0x3e0055(++_0x2bee57);}(_0x9dff,0x117));var _0xf9df=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x9dff[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf9df('0x0'));var md5=require(_0xf9df('0x1'));var Redis=require(_0xf9df('0x2'));var config=require('../../../config/environment');config[_0xf9df('0x3')]=_[_0xf9df('0x4')](config[_0xf9df('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xf9df('0x5'))(new Redis(config[_0xf9df('0x3')]));function Agent(_0xf8f095){this['id']=_0xf8f095['id']||0x0;this['name']=_0xf8f095[_0xf9df('0x6')]||'';this[_0xf9df('0x7')]=_0xf8f095['email']||'';this[_0xf9df('0x8')]=_0xf8f095['accountcode']||'';this[_0xf9df('0x9')]=_0xf8f095[_0xf9df('0x9')]||'';this[_0xf9df('0xa')]=_0xf9df('0xb');this[_0xf9df('0xc')]=0x0;this['status']=_0xf9df('0xb');this['address']='';this[_0xf9df('0xd')]='';this[_0xf9df('0xe')]='';this[_0xf9df('0xf')]='';this[_0xf9df('0x10')]=_0xf8f095[_0xf9df('0x10')]||![];this[_0xf9df('0x11')]=_0xf9df('0xb');this[_0xf9df('0x12')]=0x0;this[_0xf9df('0x13')]='';this[_0xf9df('0x14')]='';this[_0xf9df('0x15')]=![];this['local']=![];this['md5']='';}Agent[_0xf9df('0x16')][_0xf9df('0x17')]=function(_0x3424ff){var _0x385a55;if(_0x3424ff&&_0x3424ff[_0xf9df('0xa')]){_0x385a55=_0x3424ff[_0xf9df('0xa')][_0xf9df('0x18')]();switch(_0x385a55){case'not_inuse':_0x385a55='idle';break;case _0xf9df('0x19'):_0x385a55=_0xf9df('0x1a');break;}}if(_0x385a55&&this['voiceStatus']!==_0x385a55||_0x3424ff[_0xf9df('0x1b')]){this['voiceStatusTime']=_[_0xf9df('0x1c')](moment()[_0xf9df('0x1d')]('x'));}if(_0x385a55){this['voiceStatus']=_0x385a55;}var _0x1c9b1f={'id':this['id'],'name':this[_0xf9df('0x6')],'email':this[_0xf9df('0x7')],'accountcode':this[_0xf9df('0x8')],'fullname':this[_0xf9df('0x9')],'state':this[_0xf9df('0xa')],'stateTime':this[_0xf9df('0xc')],'status':this['status'],'address':this[_0xf9df('0x1e')],'online':this[_0xf9df('0x10')],'voiceStatus':this[_0xf9df('0x11')],'voiceStatusTime':this[_0xf9df('0x12')],'voiceStatusCallerIdNumber':this[_0xf9df('0x13')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xf9df('0xf')],'onhold':this[_0xf9df('0x15')]};var _0xdf0000=md5(JSON['stringify'](_0x1c9b1f));if(this[_0xf9df('0x1')]!==_0xdf0000){this[_0xf9df('0x1')]=_0xdf0000;io['to'](util[_0xf9df('0x1d')](_0xf9df('0x1f'),_0x1c9b1f[_0xf9df('0x6')]))[_0xf9df('0x20')](_0xf9df('0x21'),_0x1c9b1f);io[_0xf9df('0x20')](_0xf9df('0x22'),_0x1c9b1f);}};module[_0xf9df('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 3424f94..0d21552 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 _0x327d=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x834746,_0x369c54){var _0x516edc=function(_0x2b3285){while(--_0x2b3285){_0x834746['push'](_0x834746['shift']());}};_0x516edc(++_0x369c54);}(_0x327d,0x103));var _0xd327=function(_0x43e357,_0x4ac7f4){_0x43e357=_0x43e357-0x0;var _0x573288=_0x327d[_0x43e357];return _0x573288;};'use strict';function Campaign(_0xa58c85){this['id']=_0xa58c85['id']||0x0;this['name']=_0xa58c85[_0xd327('0x0')]||'';this[_0xd327('0x1')]=_0xa58c85[_0xd327('0x1')]||'campaign';this[_0xd327('0x2')]=0x0;this[_0xd327('0x3')]=0x0;this[_0xd327('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xd327('0x5')]='';this[_0xd327('0x6')]=!![];this[_0xd327('0x7')]=_0xa58c85[_0xd327('0x7')];this[_0xd327('0x8')]=_0xa58c85[_0xd327('0x8')];this[_0xd327('0x9')]=_0xa58c85[_0xd327('0x9')]||null;this['dialGlobalInterval']=_0xa58c85[_0xd327('0xa')]?_0xa58c85['dialGlobalInterval']:null;this[_0xd327('0xb')]=_0xa58c85[_0xd327('0xb')];this[_0xd327('0xc')]=_0xa58c85['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0xa58c85[_0xd327('0xd')]||0x1e;this[_0xd327('0xe')]=_0xa58c85['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0xa58c85[_0xd327('0xf')];this[_0xd327('0x10')]=_0xa58c85['dialBusyMaxRetry'];this[_0xd327('0x11')]=_0xa58c85[_0xd327('0x11')];this[_0xd327('0x12')]=_0xa58c85[_0xd327('0x12')];this[_0xd327('0x13')]=_0xa58c85[_0xd327('0x13')];this[_0xd327('0x14')]=_0xa58c85[_0xd327('0x14')];this[_0xd327('0x15')]=_0xa58c85[_0xd327('0x15')]||0x3;this[_0xd327('0x16')]=_0xa58c85['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd327('0x17')]=_0xa58c85[_0xd327('0x17')]||0x3;this['dialDropRetryFrequency']=_0xa58c85[_0xd327('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0xa58c85['dialAbandonedMaxRetry']||0x3;this[_0xd327('0x19')]=_0xa58c85[_0xd327('0x19')]||0x96;this[_0xd327('0x1a')]=_0xa58c85[_0xd327('0x1a')]||0x3;this[_0xd327('0x1b')]=_0xa58c85['dialMachineRetryFrequency']||0x96;this[_0xd327('0x1c')]=_0xa58c85[_0xd327('0x1c')]||0x3;this[_0xd327('0x1d')]=_0xa58c85[_0xd327('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0xa58c85[_0xd327('0x1e')]||_0xd327('0x1f');this[_0xd327('0x20')]=_0xa58c85[_0xd327('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xa58c85['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xd327('0x21')]=_0xa58c85['dialCutDigit']||undefined;this[_0xd327('0x22')]=_0xa58c85[_0xd327('0x22')]?_0xa58c85[_0xd327('0x22')]:undefined;this['Trunk']=_0xa58c85[_0xd327('0x23')]?_0xa58c85[_0xd327('0x23')]:undefined;this[_0xd327('0x24')]=_0xa58c85[_0xd327('0x24')]?_0xa58c85[_0xd327('0x24')]:undefined;this['SquareProject']=_0xa58c85[_0xd327('0x25')]?_0xa58c85[_0xd327('0x25')]:undefined;this[_0xd327('0x26')]=_0xa58c85[_0xd327('0x25')]?_0xa58c85[_0xd327('0x25')][_0xd327('0x0')]:undefined;this['dialAMDActive']=_0xa58c85[_0xd327('0x27')]||![];this[_0xd327('0x28')]=_0xa58c85[_0xd327('0x28')];this['dialAMDGreeting']=_0xa58c85[_0xd327('0x29')];this[_0xd327('0x2a')]=_0xa58c85[_0xd327('0x2a')];this[_0xd327('0x2b')]=_0xa58c85[_0xd327('0x2b')];this['dialAMDMinWordLength']=_0xa58c85[_0xd327('0x2c')];this['dialAMDBetweenWordsSilence']=_0xa58c85[_0xd327('0x2d')];this[_0xd327('0x2e')]=_0xa58c85[_0xd327('0x2e')];this[_0xd327('0x2f')]=_0xa58c85[_0xd327('0x2f')];this[_0xd327('0x30')]=_0xa58c85[_0xd327('0x30')];}module[_0xd327('0x31')]=Campaign; \ No newline at end of file +var _0x51b5=['campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type'];(function(_0x431ae1,_0x385f06){var _0x27fcbd=function(_0x16e71f){while(--_0x16e71f){_0x431ae1['push'](_0x431ae1['shift']());}};_0x27fcbd(++_0x385f06);}(_0x51b5,0x66));var _0x551b=function(_0x40c88f,_0x160997){_0x40c88f=_0x40c88f-0x0;var _0x343443=_0x51b5[_0x40c88f];return _0x343443;};'use strict';function Campaign(_0x51bc4a){this['id']=_0x51bc4a['id']||0x0;this['name']=_0x51bc4a[_0x551b('0x0')]||'';this[_0x551b('0x1')]=_0x51bc4a[_0x551b('0x1')]||_0x551b('0x2');this[_0x551b('0x3')]=0x0;this[_0x551b('0x4')]=0x0;this[_0x551b('0x5')]=0x0;this[_0x551b('0x6')]=0x0;this[_0x551b('0x7')]='';this[_0x551b('0x8')]=!![];this[_0x551b('0x9')]=_0x51bc4a[_0x551b('0x9')];this[_0x551b('0xa')]=_0x51bc4a[_0x551b('0xa')];this[_0x551b('0xb')]=_0x51bc4a[_0x551b('0xb')]||null;this[_0x551b('0xc')]=_0x51bc4a['dialGlobalInterval']?_0x51bc4a[_0x551b('0xc')]:null;this[_0x551b('0xd')]=_0x51bc4a[_0x551b('0xd')];this[_0x551b('0xe')]=_0x51bc4a[_0x551b('0xe')];this['dialOriginateTimeout']=_0x51bc4a[_0x551b('0xf')]||0x1e;this[_0x551b('0x10')]=_0x51bc4a['dialCongestionMaxRetry'];this[_0x551b('0x11')]=_0x51bc4a['dialCongestionRetryFrequency'];this[_0x551b('0x12')]=_0x51bc4a['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x51bc4a[_0x551b('0x13')];this[_0x551b('0x14')]=_0x51bc4a['dialNoAnswerMaxRetry'];this[_0x551b('0x15')]=_0x51bc4a[_0x551b('0x15')];this['dialGlobalMaxRetry']=_0x51bc4a['dialGlobalMaxRetry'];this[_0x551b('0x16')]=_0x51bc4a[_0x551b('0x16')]||0x3;this[_0x551b('0x17')]=_0x51bc4a['dialNoSuchNumberRetryFrequency']||0x96;this[_0x551b('0x18')]=_0x51bc4a[_0x551b('0x18')]||0x3;this['dialDropRetryFrequency']=_0x51bc4a[_0x551b('0x19')]||0x96;this[_0x551b('0x1a')]=_0x51bc4a[_0x551b('0x1a')]||0x3;this['dialAbandonedRetryFrequency']=_0x51bc4a[_0x551b('0x1b')]||0x96;this[_0x551b('0x1c')]=_0x51bc4a['dialMachineMaxRetry']||0x3;this[_0x551b('0x1d')]=_0x51bc4a['dialMachineRetryFrequency']||0x96;this[_0x551b('0x1e')]=_0x51bc4a['dialAgentRejectMaxRetry']||0x3;this[_0x551b('0x1f')]=_0x51bc4a['dialAgentRejectRetryFrequency']||0x96;this[_0x551b('0x20')]=_0x51bc4a['dialOrderByScheduledAt']||_0x551b('0x21');this[_0x551b('0x22')]=_0x51bc4a[_0x551b('0x22')]||undefined;this[_0x551b('0x23')]=_0x51bc4a[_0x551b('0x23')]||undefined;this[_0x551b('0x24')]=_0x51bc4a[_0x551b('0x24')]||undefined;this[_0x551b('0x25')]=_0x51bc4a[_0x551b('0x25')]?_0x51bc4a[_0x551b('0x25')]:undefined;this[_0x551b('0x26')]=_0x51bc4a[_0x551b('0x26')]?_0x51bc4a['Trunk']:undefined;this[_0x551b('0x27')]=_0x51bc4a[_0x551b('0x27')]?_0x51bc4a['Interval']:undefined;this[_0x551b('0x28')]=_0x51bc4a[_0x551b('0x28')]?_0x51bc4a[_0x551b('0x28')]:undefined;this['dialQueueProject']=_0x51bc4a['SquareProject']?_0x51bc4a[_0x551b('0x28')][_0x551b('0x0')]:undefined;this[_0x551b('0x29')]=_0x51bc4a[_0x551b('0x29')]||![];this['dialAMDInitialSilence']=_0x51bc4a[_0x551b('0x2a')];this['dialAMDGreeting']=_0x51bc4a[_0x551b('0x2b')];this[_0x551b('0x2c')]=_0x51bc4a[_0x551b('0x2c')];this[_0x551b('0x2d')]=_0x51bc4a[_0x551b('0x2d')];this[_0x551b('0x2e')]=_0x51bc4a[_0x551b('0x2e')];this[_0x551b('0x2f')]=_0x51bc4a[_0x551b('0x2f')];this[_0x551b('0x30')]=_0x51bc4a[_0x551b('0x30')];this['dialAMDSilenceThreshold']=_0x51bc4a[_0x551b('0x31')];this['dialAMDMaximumWordLength']=_0x51bc4a[_0x551b('0x32')];}module[_0x551b('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index ffa0b64..7844813 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 _0x215d=['exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','answertime','unmanaged','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferType','mohtime'];(function(_0xbe05c8,_0x26be13){var _0xbd60ca=function(_0x202473){while(--_0x202473){_0xbe05c8['push'](_0xbe05c8['shift']());}};_0xbd60ca(++_0x26be13);}(_0x215d,0x187));var _0xd215=function(_0x1a8db2,_0xc3aae2){_0x1a8db2=_0x1a8db2-0x0;var _0x169675=_0x215d[_0x1a8db2];return _0x169675;};'use strict';function Channel(){this[_0xd215('0x0')]=null;this['channel']='';this[_0xd215('0x1')]='';this[_0xd215('0x2')]=0x0;this[_0xd215('0x3')]='';this[_0xd215('0x4')]=undefined;this[_0xd215('0x5')]=undefined;this[_0xd215('0x6')]=0x0;this['context']='';this[_0xd215('0x7')]=0x0;this['linkedid']=0x0;this[_0xd215('0x8')]=0x0;this[_0xd215('0x9')]=![];this[_0xd215('0xa')]=null;this['endtime']=null;this[_0xd215('0xb')]=![];this['abandoned']=![];this[_0xd215('0xc')]='';this[_0xd215('0xd')]='';this[_0xd215('0xe')]=0x0;this['billableseconds']=0x0;this[_0xd215('0xf')]=0x0;this[_0xd215('0x10')]=null;this[_0xd215('0x11')]=null;this[_0xd215('0x12')]=null;this[_0xd215('0x13')]=![];this['monitorFilename']=null;this[_0xd215('0x14')]=null;this[_0xd215('0x15')]=[];this[_0xd215('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xd215('0x17')]=undefined;this[_0xd215('0x18')]=0x0;}module[_0xd215('0x19')]=Channel; \ No newline at end of file +var _0x4329=['disposition','monitorFilename','queue','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','lastapplication','lastdata','billableseconds','holdtime','type','tag'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4329,0x13b));var _0x9432=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x4329[_0x297fd3];return _0x2af381;};'use strict';function Channel(){this[_0x9432('0x0')]=null;this[_0x9432('0x1')]='';this[_0x9432('0x2')]='';this[_0x9432('0x3')]=0x0;this[_0x9432('0x4')]='';this[_0x9432('0x5')]=undefined;this[_0x9432('0x6')]=undefined;this[_0x9432('0x7')]=0x0;this[_0x9432('0x8')]='';this[_0x9432('0x9')]=0x0;this[_0x9432('0xa')]=0x0;this[_0x9432('0xb')]=0x0;this[_0x9432('0xc')]=![];this[_0x9432('0xd')]=null;this['endtime']=null;this[_0x9432('0xe')]=![];this['abandoned']=![];this[_0x9432('0xf')]='';this[_0x9432('0x10')]='';this['duration']=0x0;this[_0x9432('0x11')]=0x0;this[_0x9432('0x12')]=0x0;this[_0x9432('0x13')]=null;this[_0x9432('0x14')]=null;this[_0x9432('0x15')]=null;this['monitor']=![];this[_0x9432('0x16')]=null;this[_0x9432('0x17')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x9432('0x18')]=undefined;this[_0x9432('0x19')]=undefined;this[_0x9432('0x1a')]=0x0;}module[_0x9432('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 9ad0228..3a77103 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 _0xe488=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x56b82c,_0x4ac68a){var _0x186b89=function(_0x34d6da){while(--_0x34d6da){_0x56b82c['push'](_0x56b82c['shift']());}};_0x186b89(++_0x4ac68a);}(_0xe488,0x1d6));var _0x8e48=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xe488[_0xa30766];return _0x24e780;};'use strict';function DeskAccount(_0x579e44){this['id']=_0x579e44['id']||0x0;this[_0x8e48('0x0')]=_0x579e44[_0x8e48('0x0')]||'';this[_0x8e48('0x1')]=_0x579e44['username']||'';this[_0x8e48('0x2')]=_0x579e44['remoteUri']||'';this[_0x8e48('0x3')]=_0x579e44[_0x8e48('0x3')]||'';this[_0x8e48('0x4')]=_0x579e44[_0x8e48('0x4')]||'';this[_0x8e48('0x5')]=_0x579e44[_0x8e48('0x5')]||'';this['consumerSecret']=_0x579e44[_0x8e48('0x6')]||'';this[_0x8e48('0x7')]=_0x579e44[_0x8e48('0x7')]||'';this[_0x8e48('0x8')]=_0x579e44[_0x8e48('0x8')]||'';this[_0x8e48('0x9')]=_0x579e44[_0x8e48('0x9')]||'';this[_0x8e48('0xa')]=_0x579e44[_0x8e48('0xa')]||'';this[_0x8e48('0xb')]=_0x579e44[_0x8e48('0xb')]||{};}module[_0x8e48('0xc')]=DeskAccount; \ No newline at end of file +var _0x5ac5=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x371eae,_0x35ad44){var _0x1e0533=function(_0x3bd427){while(--_0x3bd427){_0x371eae['push'](_0x371eae['shift']());}};_0x1e0533(++_0x35ad44);}(_0x5ac5,0x196));var _0x55ac=function(_0x383cad,_0x133407){_0x383cad=_0x383cad-0x0;var _0x1e8934=_0x5ac5[_0x383cad];return _0x1e8934;};'use strict';function DeskAccount(_0x248cef){this['id']=_0x248cef['id']||0x0;this[_0x55ac('0x0')]=_0x248cef[_0x55ac('0x0')]||'';this[_0x55ac('0x1')]=_0x248cef[_0x55ac('0x1')]||'';this[_0x55ac('0x2')]=_0x248cef[_0x55ac('0x2')]||'';this[_0x55ac('0x3')]=_0x248cef[_0x55ac('0x3')]||'';this[_0x55ac('0x4')]=_0x248cef[_0x55ac('0x4')]||'';this[_0x55ac('0x5')]=_0x248cef[_0x55ac('0x5')]||'';this[_0x55ac('0x6')]=_0x248cef[_0x55ac('0x6')]||'';this[_0x55ac('0x7')]=_0x248cef[_0x55ac('0x7')]||'';this['tokenSecret']=_0x248cef[_0x55ac('0x8')]||'';this[_0x55ac('0x9')]=_0x248cef['type']||'';this['serverUrl']=_0x248cef[_0x55ac('0xa')]||'';this[_0x55ac('0xb')]=_0x248cef[_0x55ac('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 3afc405..0e229c2 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 _0x5d32=['Configurations','CloudProvider','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x5d32,0x1c5));var _0x25d3=function(_0x101094,_0x5d3900){_0x101094=_0x101094-0x0;var _0x3d6d75=_0x5d32[_0x101094];return _0x3d6d75;};'use strict';function Dynamics365Account(_0x24e4c4){this['id']=_0x24e4c4['id']||0x0;this[_0x25d3('0x0')]=_0x24e4c4[_0x25d3('0x0')]||'';this[_0x25d3('0x1')]=_0x24e4c4[_0x25d3('0x1')]||'';this[_0x25d3('0x2')]=_0x24e4c4[_0x25d3('0x2')]||'';this['remoteUri']=_0x24e4c4[_0x25d3('0x3')]||'';this[_0x25d3('0x4')]=_0x24e4c4[_0x25d3('0x4')]||'';this[_0x25d3('0x5')]=_0x24e4c4[_0x25d3('0x5')]||'';this[_0x25d3('0x6')]=_0x24e4c4[_0x25d3('0x6')]||{};this[_0x25d3('0x7')]=_0x24e4c4[_0x25d3('0x7')]||'';this[_0x25d3('0x8')]=_0x24e4c4[_0x25d3('0x8')]||![];this[_0x25d3('0x9')]=_0x24e4c4[_0x25d3('0x9')]||{};this[_0x25d3('0xa')]=_0x24e4c4[_0x25d3('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xe4dd=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','name','username','password'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xe4dd,0x9d));var _0xde4d=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0xe4dd[_0x17406e];return _0x2bfc5a;};'use strict';function Dynamics365Account(_0x25e5e8){this['id']=_0x25e5e8['id']||0x0;this[_0xde4d('0x0')]=_0x25e5e8[_0xde4d('0x0')]||'';this['username']=_0x25e5e8[_0xde4d('0x1')]||'';this[_0xde4d('0x2')]=_0x25e5e8[_0xde4d('0x2')]||'';this[_0xde4d('0x3')]=_0x25e5e8[_0xde4d('0x3')]||'';this[_0xde4d('0x4')]=_0x25e5e8[_0xde4d('0x4')]||'';this['clientId']=_0x25e5e8[_0xde4d('0x5')]||'';this[_0xde4d('0x6')]=_0x25e5e8[_0xde4d('0x6')]||{};this[_0xde4d('0x7')]=_0x25e5e8[_0xde4d('0x7')]||'';this[_0xde4d('0x8')]=_0x25e5e8[_0xde4d('0x8')]||![];this[_0xde4d('0x9')]=_0x25e5e8[_0xde4d('0x9')]||{};this['CloudProvider']=_0x25e5e8['CloudProvider']||{};}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 2b5b29a..d376282 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 _0x2ee3=['ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x4f7c88,_0x2e8619){var _0x3ac9bc=function(_0x5bc01e){while(--_0x5bc01e){_0x4f7c88['push'](_0x4f7c88['shift']());}};_0x3ac9bc(++_0x2e8619);}(_0x2ee3,0x97));var _0x32ee=function(_0x27e811,_0x1fad22){_0x27e811=_0x27e811-0x0;var _0x1bfe61=_0x2ee3[_0x27e811];return _0x1bfe61;};'use strict';function FaxAccount(_0x1b9fef){this['id']=_0x1b9fef['id']||0x0;this[_0x32ee('0x0')]=_0x1b9fef[_0x32ee('0x0')]||'';this[_0x32ee('0x1')]=_0x1b9fef[_0x32ee('0x1')];this['ecm']=_0x1b9fef[_0x32ee('0x2')];this['headerinfo']=_0x1b9fef[_0x32ee('0x3')];this[_0x32ee('0x4')]=_0x1b9fef[_0x32ee('0x4')];this[_0x32ee('0x5')]=_0x1b9fef[_0x32ee('0x5')]||0x960;this[_0x32ee('0x6')]=_0x1b9fef[_0x32ee('0x6')]||0x3840;this['modem']=_0x1b9fef['modem']||_0x32ee('0x7');this[_0x32ee('0x8')]=_0x1b9fef[_0x32ee('0x8')]||'no';this['faxdetect']=_0x1b9fef[_0x32ee('0x9')]||'no';this[_0x32ee('0xa')]=_0x1b9fef[_0x32ee('0xa')]||0x1388;this['tech']=_0x1b9fef[_0x32ee('0xb')]||_0x32ee('0xc');this[_0x32ee('0xd')]=_0x1b9fef[_0x32ee('0xd')]?_0x1b9fef[_0x32ee('0xd')]:undefined;this['ListId']=_0x1b9fef[_0x32ee('0xe')];this[_0x32ee('0xf')]=_0x1b9fef[_0x32ee('0xf')];}module[_0x32ee('0x10')]=FaxAccount; \ No newline at end of file +var _0x954c=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x141352,_0x5aa338){var _0x3d8110=function(_0x4f0508){while(--_0x4f0508){_0x141352['push'](_0x141352['shift']());}};_0x3d8110(++_0x5aa338);}(_0x954c,0x155));var _0xc954=function(_0x590bfd,_0x1a7794){_0x590bfd=_0x590bfd-0x0;var _0x23d75f=_0x954c[_0x590bfd];return _0x23d75f;};'use strict';function FaxAccount(_0x5d1dc2){this['id']=_0x5d1dc2['id']||0x0;this[_0xc954('0x0')]=_0x5d1dc2[_0xc954('0x0')]||'';this[_0xc954('0x1')]=_0x5d1dc2[_0xc954('0x1')];this['ecm']=_0x5d1dc2[_0xc954('0x2')];this[_0xc954('0x3')]=_0x5d1dc2['headerinfo'];this[_0xc954('0x4')]=_0x5d1dc2[_0xc954('0x4')];this['minrate']=_0x5d1dc2[_0xc954('0x5')]||0x960;this[_0xc954('0x6')]=_0x5d1dc2['maxrate']||0x3840;this[_0xc954('0x7')]=_0x5d1dc2[_0xc954('0x7')]||'v17,v27,v29';this['gateway']=_0x5d1dc2[_0xc954('0x8')]||'no';this[_0xc954('0x9')]=_0x5d1dc2[_0xc954('0x9')]||'no';this[_0xc954('0xa')]=_0x5d1dc2[_0xc954('0xa')]||0x1388;this[_0xc954('0xb')]=_0x5d1dc2['tech']||_0xc954('0xc');this['Trunk']=_0x5d1dc2[_0xc954('0xd')]?_0x5d1dc2[_0xc954('0xd')]:undefined;this[_0xc954('0xe')]=_0x5d1dc2[_0xc954('0xe')];this[_0xc954('0xf')]=_0x5d1dc2[_0xc954('0xf')];}module[_0xc954('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 04a65a9..9056a44 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 _0xed29=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x59c556,_0x3e3be8){var _0x53079b=function(_0x1e1fd3){while(--_0x1e1fd3){_0x59c556['push'](_0x59c556['shift']());}};_0x53079b(++_0x3e3be8);}(_0xed29,0xf1));var _0x9ed2=function(_0x594b52,_0x232e60){_0x594b52=_0x594b52-0x0;var _0x36b369=_0xed29[_0x594b52];return _0x36b369;};'use strict';function FreshdeskAccount(_0x40b9e7){this['id']=_0x40b9e7['id']||0x0;this[_0x9ed2('0x0')]=_0x40b9e7[_0x9ed2('0x0')]||'';this[_0x9ed2('0x1')]=_0x40b9e7[_0x9ed2('0x1')]||'';this[_0x9ed2('0x2')]=_0x40b9e7[_0x9ed2('0x3')]||'';this['remoteUri']=_0x40b9e7[_0x9ed2('0x4')]||'';this[_0x9ed2('0x5')]=_0x40b9e7[_0x9ed2('0x5')]||'';this['Configurations']=_0x40b9e7[_0x9ed2('0x6')]||{};}module[_0x9ed2('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x92aa=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xac8c5a,_0x1063a8){var _0x5a56d9=function(_0x5bd26e){while(--_0x5bd26e){_0xac8c5a['push'](_0xac8c5a['shift']());}};_0x5a56d9(++_0x1063a8);}(_0x92aa,0x1b1));var _0xa92a=function(_0x12da58,_0x3b4d58){_0x12da58=_0x12da58-0x0;var _0x103843=_0x92aa[_0x12da58];return _0x103843;};'use strict';function FreshdeskAccount(_0x44a214){this['id']=_0x44a214['id']||0x0;this[_0xa92a('0x0')]=_0x44a214[_0xa92a('0x0')]||'';this[_0xa92a('0x1')]=_0x44a214[_0xa92a('0x1')]||'';this['apiKey']=_0x44a214[_0xa92a('0x2')]||'';this[_0xa92a('0x3')]=_0x44a214[_0xa92a('0x3')]||'';this[_0xa92a('0x4')]=_0x44a214[_0xa92a('0x4')]||'';this[_0xa92a('0x5')]=_0x44a214[_0xa92a('0x5')]||{};}module[_0xa92a('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 7e3443c..f80ed9e 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 _0x908e=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x908e,0x182));var _0xe908=function(_0x256910,_0x3f61c3){_0x256910=_0x256910-0x0;var _0x540331=_0x908e[_0x256910];return _0x540331;};'use strict';function FreshsalesAccount(_0x146b9b){this['id']=_0x146b9b['id']||0x0;this[_0xe908('0x0')]=_0x146b9b['name']||'';this['username']=_0x146b9b[_0xe908('0x1')]||'';this[_0xe908('0x2')]=_0x146b9b[_0xe908('0x3')]||'';this[_0xe908('0x4')]=_0x146b9b['remoteUri']||'';this[_0xe908('0x5')]=_0x146b9b['serverUrl']||'';this['Configurations']=_0x146b9b[_0xe908('0x6')]||{};}module[_0xe908('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x0f9f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x0f9f,0xae));var _0xf0f9=function(_0x2b92d2,_0x4e8ded){_0x2b92d2=_0x2b92d2-0x0;var _0x133446=_0x0f9f[_0x2b92d2];return _0x133446;};'use strict';function FreshsalesAccount(_0xbbc735){this['id']=_0xbbc735['id']||0x0;this[_0xf0f9('0x0')]=_0xbbc735[_0xf0f9('0x0')]||'';this[_0xf0f9('0x1')]=_0xbbc735[_0xf0f9('0x1')]||'';this[_0xf0f9('0x2')]=_0xbbc735[_0xf0f9('0x3')]||'';this[_0xf0f9('0x4')]=_0xbbc735[_0xf0f9('0x4')]||'';this[_0xf0f9('0x5')]=_0xbbc735[_0xf0f9('0x5')]||'';this['Configurations']=_0xbbc735[_0xf0f9('0x6')]||{};}module[_0xf0f9('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 00901ac..5cdc02a 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 _0xc334=['queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','routealias','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0xc334,0x14a));var _0x4c33=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc334[_0x1969a7];return _0x3d665f;};'use strict';function QueueReport(){this[_0x4c33('0x0')]=_0x4c33('0x1');this[_0x4c33('0x2')]='';this[_0x4c33('0x3')]='';this[_0x4c33('0x4')]='';this[_0x4c33('0x5')]='';this[_0x4c33('0x6')]=null;this['queuecallerleaveAt']=null;this[_0x4c33('0x7')]=0x1;this['count']=0x1;this[_0x4c33('0x8')]=![];this[_0x4c33('0x9')]=null;this['queuecallercomplete']=![];this[_0x4c33('0xa')]=null;this[_0x4c33('0xb')]=![];this[_0x4c33('0xc')]=null;this[_0x4c33('0xd')]=0x1;this[_0x4c33('0xe')]='';this[_0x4c33('0xf')]='';this['connectedlinename']='';this[_0x4c33('0x10')]='';this[_0x4c33('0x11')]='';this[_0x4c33('0x12')]='';this[_0x4c33('0x13')]='';this['holdtime']=0x0;this[_0x4c33('0x14')]=![];this[_0x4c33('0x15')]='';this[_0x4c33('0x16')]='voice';this[_0x4c33('0x17')]=null;this[_0x4c33('0x18')]=0x0;this['variables']={};}module[_0x4c33('0x19')]=QueueReport; \ No newline at end of file +var _0x1cec=['position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x4230ac,_0x570039){var _0x1abfdb=function(_0x3d69ad){while(--_0x3d69ad){_0x4230ac['push'](_0x4230ac['shift']());}};_0x1abfdb(++_0x570039);}(_0x1cec,0x85));var _0xc1ce=function(_0x48f8c4,_0x4e3dba){_0x48f8c4=_0x48f8c4-0x0;var _0x118849=_0x1cec[_0x48f8c4];return _0x118849;};'use strict';function QueueReport(){this[_0xc1ce('0x0')]='inbound';this[_0xc1ce('0x1')]='';this[_0xc1ce('0x2')]='';this[_0xc1ce('0x3')]='';this[_0xc1ce('0x4')]='';this[_0xc1ce('0x5')]=null;this[_0xc1ce('0x6')]=null;this[_0xc1ce('0x7')]=0x1;this[_0xc1ce('0x8')]=0x1;this[_0xc1ce('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xc1ce('0xa')]=![];this[_0xc1ce('0xb')]=null;this[_0xc1ce('0xc')]=![];this[_0xc1ce('0xd')]=null;this[_0xc1ce('0xe')]=0x1;this[_0xc1ce('0xf')]='';this[_0xc1ce('0x10')]='';this[_0xc1ce('0x11')]='';this[_0xc1ce('0x12')]='';this['context']='';this[_0xc1ce('0x13')]='';this[_0xc1ce('0x14')]='';this[_0xc1ce('0x15')]=0x0;this[_0xc1ce('0x16')]=![];this[_0xc1ce('0x17')]='';this[_0xc1ce('0x18')]=_0xc1ce('0x19');this[_0xc1ce('0x1a')]=null;this['mohtime']=0x0;this['variables']={};}module[_0xc1ce('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 478d9ed..e7baf8b 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 _0xa923=['type','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x5dc3c0,_0x38b6c6){var _0x3e0b1b=function(_0x4f126f){while(--_0x4f126f){_0x5dc3c0['push'](_0x5dc3c0['shift']());}};_0x3e0b1b(++_0x38b6c6);}(_0xa923,0xcb));var _0x3a92=function(_0x4fd371,_0x529f21){_0x4fd371=_0x4fd371-0x0;var _0x3e6aec=_0xa923[_0x4fd371];return _0x3e6aec;};'use strict';function SalesforceAccount(_0x1ba118){this['id']=_0x1ba118['id']||0x0;this[_0x3a92('0x0')]=_0x1ba118['name']||'';this[_0x3a92('0x1')]=_0x1ba118[_0x3a92('0x1')]||'';this['remoteUri']=_0x1ba118[_0x3a92('0x2')]||'';this['password']=_0x1ba118[_0x3a92('0x3')]||'';this[_0x3a92('0x4')]=_0x1ba118['clientId']||'';this[_0x3a92('0x5')]=_0x1ba118[_0x3a92('0x5')]||'';this[_0x3a92('0x6')]=_0x1ba118[_0x3a92('0x6')]||'';this['type']=_0x1ba118[_0x3a92('0x7')]||'integrationTab';this[_0x3a92('0x8')]=_0x1ba118[_0x3a92('0x8')]||'';this[_0x3a92('0x9')]=_0x1ba118[_0x3a92('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x2de3=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x58ed81,_0x10fd16){var _0x10f036=function(_0x3a55a4){while(--_0x3a55a4){_0x58ed81['push'](_0x58ed81['shift']());}};_0x10f036(++_0x10fd16);}(_0x2de3,0x150));var _0x32de=function(_0x359cbf,_0x566ce3){_0x359cbf=_0x359cbf-0x0;var _0x3e4c50=_0x2de3[_0x359cbf];return _0x3e4c50;};'use strict';function SalesforceAccount(_0x4f82a7){this['id']=_0x4f82a7['id']||0x0;this[_0x32de('0x0')]=_0x4f82a7[_0x32de('0x0')]||'';this[_0x32de('0x1')]=_0x4f82a7[_0x32de('0x1')]||'';this[_0x32de('0x2')]=_0x4f82a7[_0x32de('0x2')]||'';this[_0x32de('0x3')]=_0x4f82a7['password']||'';this[_0x32de('0x4')]=_0x4f82a7[_0x32de('0x4')]||'';this[_0x32de('0x5')]=_0x4f82a7['clientSecret']||'';this['securityToken']=_0x4f82a7[_0x32de('0x6')]||'';this[_0x32de('0x7')]=_0x4f82a7['type']||'integrationTab';this[_0x32de('0x8')]=_0x4f82a7['serverUrl']||'';this[_0x32de('0x9')]=_0x4f82a7['Configurations']||{};}module[_0x32de('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 20624a2..3d020ba 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 _0x41ae=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x4b448a,_0x11ae19){var _0x3d66f4=function(_0x564acb){while(--_0x564acb){_0x4b448a['push'](_0x4b448a['shift']());}};_0x3d66f4(++_0x11ae19);}(_0x41ae,0x134));var _0xe41a=function(_0x2a042e,_0x1263ec){_0x2a042e=_0x2a042e-0x0;var _0x4e2d33=_0x41ae[_0x2a042e];return _0x4e2d33;};'use strict';function ServicenowAccount(_0x49852c){this['id']=_0x49852c['id']||0x0;this[_0xe41a('0x0')]=_0x49852c[_0xe41a('0x0')]||'';this[_0xe41a('0x1')]=_0x49852c[_0xe41a('0x1')]||'';this[_0xe41a('0x2')]=_0x49852c[_0xe41a('0x2')]||'';this[_0xe41a('0x3')]=_0x49852c[_0xe41a('0x3')]||'';this['serverUrl']=_0x49852c[_0xe41a('0x4')]||'';this[_0xe41a('0x5')]=_0x49852c[_0xe41a('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xa928=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x168506,_0x2a2915){var _0x1562e7=function(_0x53368d){while(--_0x53368d){_0x168506['push'](_0x168506['shift']());}};_0x1562e7(++_0x2a2915);}(_0xa928,0x154));var _0x8a92=function(_0x508cbd,_0x55834d){_0x508cbd=_0x508cbd-0x0;var _0x3e4ac7=_0xa928[_0x508cbd];return _0x3e4ac7;};'use strict';function ServicenowAccount(_0x3ad0a9){this['id']=_0x3ad0a9['id']||0x0;this[_0x8a92('0x0')]=_0x3ad0a9[_0x8a92('0x0')]||'';this[_0x8a92('0x1')]=_0x3ad0a9[_0x8a92('0x1')]||'';this[_0x8a92('0x2')]=_0x3ad0a9[_0x8a92('0x2')]||'';this[_0x8a92('0x3')]=_0x3ad0a9[_0x8a92('0x3')]||'';this[_0x8a92('0x4')]=_0x3ad0a9[_0x8a92('0x4')]||'';this[_0x8a92('0x5')]=_0x3ad0a9['Configurations']||{};}module[_0x8a92('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index a34963c..e9643e5 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 _0x8e09=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x14abd3,_0x545f22){var _0x369f55=function(_0x2492db){while(--_0x2492db){_0x14abd3['push'](_0x14abd3['shift']());}};_0x369f55(++_0x545f22);}(_0x8e09,0x1e6));var _0x98e0=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0x8e09[_0x7cb10c];return _0x11df59;};'use strict';function SugarcrmAccount(_0x1de7e7){this['id']=_0x1de7e7['id']||0x0;this[_0x98e0('0x0')]=_0x1de7e7['name']||'';this[_0x98e0('0x1')]=_0x1de7e7[_0x98e0('0x1')]||'';this['password']=_0x1de7e7['password']||'';this[_0x98e0('0x2')]=_0x1de7e7[_0x98e0('0x2')]||'';this[_0x98e0('0x3')]=_0x1de7e7[_0x98e0('0x3')]||'';this[_0x98e0('0x4')]=_0x1de7e7[_0x98e0('0x4')]||{};}module[_0x98e0('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x7d17=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4a85a6,_0x2bda1c){var _0x5b7080=function(_0xc4b84e){while(--_0xc4b84e){_0x4a85a6['push'](_0x4a85a6['shift']());}};_0x5b7080(++_0x2bda1c);}(_0x7d17,0x129));var _0x77d1=function(_0x38d3fc,_0x24613f){_0x38d3fc=_0x38d3fc-0x0;var _0x4defca=_0x7d17[_0x38d3fc];return _0x4defca;};'use strict';function SugarcrmAccount(_0x47cf2b){this['id']=_0x47cf2b['id']||0x0;this[_0x77d1('0x0')]=_0x47cf2b[_0x77d1('0x0')]||'';this[_0x77d1('0x1')]=_0x47cf2b['username']||'';this['password']=_0x47cf2b[_0x77d1('0x2')]||'';this['remoteUri']=_0x47cf2b[_0x77d1('0x3')]||'';this[_0x77d1('0x4')]=_0x47cf2b[_0x77d1('0x4')]||'';this[_0x77d1('0x5')]=_0x47cf2b[_0x77d1('0x5')]||{};}module[_0x77d1('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 d98a957..9e0604d 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 _0x6eeb=['accountcode','unknown','status','address','exports','name'];(function(_0x5be095,_0x5caf43){var _0xfd62ec=function(_0x501039){while(--_0x501039){_0x5be095['push'](_0x5be095['shift']());}};_0xfd62ec(++_0x5caf43);}(_0x6eeb,0x1f1));var _0xb6ee=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x6eeb[_0x311909];return _0x8d3163;};'use strict';function Telephone(_0x18ad70){this['id']=_0x18ad70['id']||0x0;this[_0xb6ee('0x0')]=_0x18ad70[_0xb6ee('0x0')]||'';this[_0xb6ee('0x1')]=_0x18ad70[_0xb6ee('0x1')]||'';this['state']=_0xb6ee('0x2');this['stateTime']=0x0;this[_0xb6ee('0x3')]='unknown';this[_0xb6ee('0x4')]='';}module[_0xb6ee('0x5')]=Telephone; \ No newline at end of file +var _0x2aa2=['status','unknown','name','accountcode','stateTime'];(function(_0x5d40f6,_0x841268){var _0x1cc25a=function(_0x149ac6){while(--_0x149ac6){_0x5d40f6['push'](_0x5d40f6['shift']());}};_0x1cc25a(++_0x841268);}(_0x2aa2,0x75));var _0x22aa=function(_0x36b539,_0x50c9fd){_0x36b539=_0x36b539-0x0;var _0x4fc67d=_0x2aa2[_0x36b539];return _0x4fc67d;};'use strict';function Telephone(_0x59ba7b){this['id']=_0x59ba7b['id']||0x0;this[_0x22aa('0x0')]=_0x59ba7b[_0x22aa('0x0')]||'';this[_0x22aa('0x1')]=_0x59ba7b[_0x22aa('0x1')]||'';this['state']='unknown';this[_0x22aa('0x2')]=0x0;this[_0x22aa('0x3')]=_0x22aa('0x4');this['address']='';}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 a3d1d0f..0286b58 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(_0x25d270,_0x3e1227){var _0x160ac3=function(_0x362b16){while(--_0x362b16){_0x25d270['push'](_0x25d270['shift']());}};_0x160ac3(++_0x3e1227);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0xbabd92,_0x392abf){var _0x1d5b0f=function(_0x5b4058){while(--_0x5b4058){_0xbabd92['push'](_0xbabd92['shift']());}};_0x1d5b0f(++_0x392abf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 bc92713..7ecf184 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 _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x536256,_0x237fb5){_0x536256=_0x536256-0x0;var _0x1675f7=_0x0b0e[_0x536256];return _0x1675f7;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3dcdea,_0x5abbea){var _0x50a73c=function(_0x215a76){while(--_0x215a76){_0x3dcdea['push'](_0x3dcdea['shift']());}};_0x50a73c(++_0x5abbea);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1885d1,_0x31ae31){_0x1885d1=_0x1885d1-0x0;var _0x3c0204=_0x9ffd[_0x1885d1];return _0x3c0204;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index a808abd..b9e81bb 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 _0xaa61=['indexOf','split','host','port','domain','domainport','refresh','address','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xaa61,0x1b9));var _0x1aa6=function(_0x28fdee,_0x3e8c43){_0x28fdee=_0x28fdee-0x0;var _0x36b9b1=_0xaa61[_0x28fdee];return _0x36b9b1;};'use strict';function Trunk(_0x475efa){this['id']=_0x475efa['id']||0x0;this[_0x1aa6('0x0')]=_0x475efa[_0x1aa6('0x0')]||![];this['name']=_0x475efa[_0x1aa6('0x1')]||'';this[_0x1aa6('0x2')]=_0x1aa6('0x3');this[_0x1aa6('0x4')]=0x0;this[_0x1aa6('0x5')]=_0x1aa6('0x3');this[_0x1aa6('0x6')]=_0x475efa[_0x1aa6('0x6')]&&_0x475efa[_0x1aa6('0x6')][_0x1aa6('0x7')](':')?_0x475efa[_0x1aa6('0x6')][_0x1aa6('0x8')](':')[0x0]:'';this[_0x1aa6('0x9')]='';this[_0x1aa6('0xa')]='';this[_0x1aa6('0xb')]='';this[_0x1aa6('0xc')]='';this[_0x1aa6('0xd')]='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0x1aa6('0xe')]='';this['defaultuser']=_0x475efa['defaultuser']||'';}module[_0x1aa6('0xf')]=Trunk; \ No newline at end of file +var _0x318f=['exports','active','name','state','unknown','registry','indexOf','split','port','domain','domainport','registrationtime','address','defaultuser'];(function(_0x32d0f8,_0x3742cd){var _0x5f1d4a=function(_0x5b30b8){while(--_0x5b30b8){_0x32d0f8['push'](_0x32d0f8['shift']());}};_0x5f1d4a(++_0x3742cd);}(_0x318f,0x16d));var _0xf318=function(_0x13bf20,_0x3d2df9){_0x13bf20=_0x13bf20-0x0;var _0x44b644=_0x318f[_0x13bf20];return _0x44b644;};'use strict';function Trunk(_0x6e9d58){this['id']=_0x6e9d58['id']||0x0;this[_0xf318('0x0')]=_0x6e9d58['active']||![];this['name']=_0x6e9d58[_0xf318('0x1')]||'';this[_0xf318('0x2')]=_0xf318('0x3');this['stateTime']=0x0;this['status']='unknown';this[_0xf318('0x4')]=_0x6e9d58[_0xf318('0x4')]&&_0x6e9d58[_0xf318('0x4')][_0xf318('0x5')](':')?_0x6e9d58['registry'][_0xf318('0x6')](':')[0x0]:'';this['host']='';this[_0xf318('0x7')]='';this[_0xf318('0x8')]='';this[_0xf318('0x9')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0xf318('0xa')]='';this[_0xf318('0xb')]='';this[_0xf318('0xc')]=_0x6e9d58[_0xf318('0xc')]||'';}module[_0xf318('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 08286fd..fa93d6d 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 _0x8dd6=['mandatoryDisposition','exports','recordingFormat'];(function(_0x35172f,_0xce1de0){var _0x4557ec=function(_0x1984aa){while(--_0x1984aa){_0x35172f['push'](_0x35172f['shift']());}};_0x4557ec(++_0xce1de0);}(_0x8dd6,0x1b2));var _0x68dd=function(_0x38a74d,_0x31b420){_0x38a74d=_0x38a74d-0x0;var _0x32ff3b=_0x8dd6[_0x38a74d];return _0x32ff3b;};'use strict';function voiceExtension(_0x3b8a57){this['id']=_0x3b8a57['id']||0x0;this['exten']=_0x3b8a57['exten']||'';this[_0x68dd('0x0')]=_0x3b8a57[_0x68dd('0x0')]||'none';this[_0x68dd('0x1')]=_0x3b8a57[_0x68dd('0x1')]||![];}module[_0x68dd('0x2')]=voiceExtension; \ No newline at end of file +var _0x11d6=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x40676d,_0x531472){var _0x4623eb=function(_0x5b98a0){while(--_0x5b98a0){_0x40676d['push'](_0x40676d['shift']());}};_0x4623eb(++_0x531472);}(_0x11d6,0x1c4));var _0x611d=function(_0x21c052,_0x2454f4){_0x21c052=_0x21c052-0x0;var _0x314dc6=_0x11d6[_0x21c052];return _0x314dc6;};'use strict';function voiceExtension(_0x340ca7){this['id']=_0x340ca7['id']||0x0;this[_0x611d('0x0')]=_0x340ca7[_0x611d('0x0')]||'';this[_0x611d('0x1')]=_0x340ca7[_0x611d('0x1')]||_0x611d('0x2');this[_0x611d('0x3')]=_0x340ca7[_0x611d('0x3')]||![];}module[_0x611d('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 7fa0447..cade952 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 _0x9fb1=['tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','fewestcalls','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','total','answered','sumDuration','sumHoldTime','sumBillable','available','inUse','invalid','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x352be9,_0x4da7a3){var _0x28d007=function(_0x5a1d73){while(--_0x5a1d73){_0x352be9['push'](_0x352be9['shift']());}};_0x28d007(++_0x4da7a3);}(_0x9fb1,0x1be));var _0x19fb=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x9fb1[_0x45b034];return _0x509cb0;};'use strict';var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0x19fb('0x0'),'leastrecent':'leastrecent','linear':_0x19fb('0x1'),'random':_0x19fb('0x2'),'ringall':_0x19fb('0x3'),'rr':_0x19fb('0x4'),'rrmemory':_0x19fb('0x5'),'rrordered':_0x19fb('0x6'),'wrandom':_0x19fb('0x7')};function VoiceQueue(_0x584ae2){this['id']=_0x584ae2['id']||0x0;this[_0x19fb('0x8')]=_0x584ae2['name']||'';this[_0x19fb('0x9')]=_0x584ae2[_0x19fb('0x9')]||'';this['type']=_0x584ae2[_0x19fb('0xa')]||_0x19fb('0xb');this['waiting']=0x0;this[_0x19fb('0xc')]=0x0;this[_0x19fb('0xd')]=0x0;this[_0x19fb('0xe')]=0x0;this[_0x19fb('0xf')]=0x0;this[_0x19fb('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x19fb('0x11')]=0x0;this['busy']=0x0;this[_0x19fb('0x12')]=0x0;this[_0x19fb('0x13')]=0x0;this['loggedIn']=0x0;this[_0x19fb('0x14')]=0x0;this[_0x19fb('0x15')]=0x0;this[_0x19fb('0x16')]=0x0;this[_0x19fb('0x17')]=0x0;this[_0x19fb('0x18')]=0x0;this[_0x19fb('0x19')]=0x0;this[_0x19fb('0x1a')]=0x0;this[_0x19fb('0x1b')]=0x0;this[_0x19fb('0x1c')]=_0x584ae2[_0x19fb('0x1c')]||![];this[_0x19fb('0x1d')]=_0x584ae2['acwTimeout']||0xa;this[_0x19fb('0x1e')]=_0x584ae2[_0x19fb('0x1e')]||'no';this[_0x19fb('0x1f')]=!![];this[_0x19fb('0x20')]='';this['statusMessage']='';this[_0x19fb('0x21')]=0x0;this[_0x19fb('0x22')]=0x0;this[_0x19fb('0x23')]=_0x584ae2[_0x19fb('0x23')]||null;this[_0x19fb('0x24')]=_0x584ae2['dialGlobalInterval']?_0x584ae2[_0x19fb('0x24')]:null;this[_0x19fb('0x25')]=_0x584ae2[_0x19fb('0x25')];this['dialMethod']=_0x584ae2['dialMethod']||_0x19fb('0x26');this[_0x19fb('0x27')]=_0x584ae2[_0x19fb('0x27')]||0x0;this[_0x19fb('0x28')]=_0x584ae2['dialLimitQueue']||0x0;this[_0x19fb('0x29')]=_0x584ae2[_0x19fb('0x29')]||0x1;this['dialPredictiveOptimization']=_0x584ae2[_0x19fb('0x2a')]||_0x19fb('0x2b');this[_0x19fb('0x2c')]=_0x584ae2['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x584ae2[_0x19fb('0x2d')]||0x258;this[_0x19fb('0x2e')]=_0x584ae2[_0x19fb('0x2e')]||_0x19fb('0x2f');this[_0x19fb('0x30')]=_0x584ae2[_0x19fb('0x30')]||'anonymous';this[_0x19fb('0x31')]=_0x584ae2[_0x19fb('0x31')]||0x1e;this['dialQueueOptions']=_0x584ae2['dialQueueOptions']||_0x19fb('0x32');this[_0x19fb('0x33')]=_0x584ae2['dialQueueTimeout']||0x3;this[_0x19fb('0x34')]=_0x584ae2[_0x19fb('0x34')]||undefined;this[_0x19fb('0x35')]=_0x584ae2[_0x19fb('0x35')]||0x3;this[_0x19fb('0x36')]=_0x584ae2[_0x19fb('0x36')]||0x96;this[_0x19fb('0x37')]=_0x584ae2['dialBusyMaxRetry']||0x3;this[_0x19fb('0x38')]=_0x584ae2[_0x19fb('0x38')]||0x96;this[_0x19fb('0x39')]=_0x584ae2[_0x19fb('0x39')]||0x3;this[_0x19fb('0x3a')]=_0x584ae2[_0x19fb('0x3a')]||0x96;this[_0x19fb('0x3b')]=_0x584ae2['dialNoSuchNumberMaxRetry']||0x3;this[_0x19fb('0x3c')]=_0x584ae2[_0x19fb('0x3c')]||0x96;this['dialDropMaxRetry']=_0x584ae2[_0x19fb('0x3d')]||0x3;this[_0x19fb('0x3e')]=_0x584ae2[_0x19fb('0x3e')]||0x96;this[_0x19fb('0x3f')]=_0x584ae2[_0x19fb('0x3f')]||0x3;this[_0x19fb('0x40')]=_0x584ae2[_0x19fb('0x40')]||0x96;this[_0x19fb('0x41')]=_0x584ae2[_0x19fb('0x41')]||0x3;this[_0x19fb('0x42')]=_0x584ae2[_0x19fb('0x42')]||0x96;this['dialAgentRejectMaxRetry']=_0x584ae2[_0x19fb('0x43')]||0x3;this['dialAgentRejectRetryFrequency']=_0x584ae2['dialAgentRejectRetryFrequency']||0x96;this[_0x19fb('0x44')]=_0x584ae2[_0x19fb('0x44')]||0x3;this[_0x19fb('0x45')]=_0x584ae2[_0x19fb('0x45')]||0x4;this[_0x19fb('0x46')]=_0x584ae2[_0x19fb('0x46')]?_0x584ae2['Trunk']:undefined;this[_0x19fb('0x47')]=_0x584ae2[_0x19fb('0x47')]?_0x584ae2[_0x19fb('0x47')]:undefined;this[_0x19fb('0x48')]=_0x584ae2[_0x19fb('0x48')]||undefined;this[_0x19fb('0x49')]=_0x584ae2[_0x19fb('0x49')]?_0x584ae2[_0x19fb('0x49')]:undefined;this['dialOrderByScheduledAt']=_0x584ae2[_0x19fb('0x4a')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x584ae2[_0x19fb('0x4b')]||undefined;this[_0x19fb('0x4c')]=_0x584ae2[_0x19fb('0x4c')]||undefined;this[_0x19fb('0x4d')]=strategy[_0x584ae2['strategy']];this['queueStatusComplete']=!![];this[_0x19fb('0x4e')]=_0x584ae2[_0x19fb('0x4e')]||![];this[_0x19fb('0x4f')]=_0x584ae2[_0x19fb('0x4f')];this['dialAMDGreeting']=_0x584ae2[_0x19fb('0x50')];this[_0x19fb('0x51')]=_0x584ae2[_0x19fb('0x51')];this[_0x19fb('0x52')]=_0x584ae2[_0x19fb('0x52')];this[_0x19fb('0x53')]=_0x584ae2[_0x19fb('0x53')];this[_0x19fb('0x54')]=_0x584ae2['dialAMDBetweenWordsSilence'];this[_0x19fb('0x55')]=_0x584ae2[_0x19fb('0x55')];this['dialAMDSilenceThreshold']=_0x584ae2[_0x19fb('0x56')];this[_0x19fb('0x57')]=_0x584ae2['dialAMDMaximumWordLength'];this[_0x19fb('0x58')]=0x0;this[_0x19fb('0x59')]=0x0;this['timeout']=_0x584ae2[_0x19fb('0x5a')];this[_0x19fb('0x5b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x19fb('0x5c')]=0x0;this[_0x19fb('0x5d')]=0x0;this[_0x19fb('0x5e')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x19fb('0x5f')]=0x0;this[_0x19fb('0x60')]=0x0;this['outboundReCallsDay']=0x0;this[_0x19fb('0x61')]=0x0;this['startProgressive']=undefined;this[_0x19fb('0x62')]=undefined;this[_0x19fb('0x63')]=undefined;this[_0x19fb('0x64')]=1.05;this[_0x19fb('0x65')]=0x0;this[_0x19fb('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x19fb('0x67')]=0x0;this[_0x19fb('0x68')]=0x0;this[_0x19fb('0x69')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x19fb('0x6a')]=_0x584ae2[_0x19fb('0x6b')]||0x14;this[_0x19fb('0x6c')]=_0x584ae2['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x19fb('0x6d')]=0x1;this['erlangCalls']=0x0;this[_0x19fb('0x6e')]=0x0;this[_0x19fb('0x6f')]=0x0;this[_0x19fb('0x70')]=0x0;this[_0x19fb('0x71')]=_0x584ae2['dialRecallMeTimeout']||0x1e;this[_0x19fb('0x72')]=_0x584ae2[_0x19fb('0x72')]||![];this[_0x19fb('0x73')]=!!_0x584ae2[_0x19fb('0x73')]||![];this[_0x19fb('0x74')]=!!_0x584ae2['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x584ae2[_0x19fb('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x584ae2[_0x19fb('0x76')]||![];this['dialAgiAfterHangupAgent']=_0x584ae2[_0x19fb('0x77')]||![];this[_0x19fb('0x9')]=monitorFormat[_0x584ae2[_0x19fb('0x9')]]?monitorFormat[_0x584ae2['monitor_format']]:undefined;this[_0x19fb('0x78')]=_0x584ae2[_0x19fb('0x78')]||![];this['mandatoryDispositionPause']=_0x584ae2[_0x19fb('0x79')]?_0x584ae2['mandatoryDispositionPause']:undefined;this[_0x19fb('0x7a')]=![];}module[_0x19fb('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x3c0d=['predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','leastrecent','random','ringall','roundrobin','rrmemory','wrandom','name','monitor_format','type','inbound','waiting','total','sumDuration','sumBillable','available','inUse','invalid','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive'];(function(_0x5f48bc,_0x320199){var _0xea6625=function(_0x13f6bf){while(--_0x13f6bf){_0x5f48bc['push'](_0x5f48bc['shift']());}};_0xea6625(++_0x320199);}(_0x3c0d,0x98));var _0xd3c0=function(_0x52f3fa,_0x432d38){_0x52f3fa=_0x52f3fa-0x0;var _0x240e29=_0x3c0d[_0x52f3fa];return _0x240e29;};'use strict';var monitorFormat={'wav':_0xd3c0('0x0'),'wav49':'wav49','gsm':_0xd3c0('0x1')};var strategy={'fewestcalls':_0xd3c0('0x2'),'leastrecent':_0xd3c0('0x3'),'linear':'linear','random':_0xd3c0('0x4'),'ringall':_0xd3c0('0x5'),'rr':_0xd3c0('0x6'),'rrmemory':_0xd3c0('0x7'),'rrordered':'rrordered','wrandom':_0xd3c0('0x8')};function VoiceQueue(_0x3abae0){this['id']=_0x3abae0['id']||0x0;this[_0xd3c0('0x9')]=_0x3abae0['name']||'';this[_0xd3c0('0xa')]=_0x3abae0[_0xd3c0('0xa')]||'';this[_0xd3c0('0xb')]=_0x3abae0[_0xd3c0('0xb')]||_0xd3c0('0xc');this[_0xd3c0('0xd')]=0x0;this[_0xd3c0('0xe')]=0x0;this['answered']=0x0;this[_0xd3c0('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0xd3c0('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xd3c0('0x11')]=0x0;this['busy']=0x0;this[_0xd3c0('0x12')]=0x0;this[_0xd3c0('0x13')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0xd3c0('0x14')]=0x0;this[_0xd3c0('0x15')]=0x0;this[_0xd3c0('0x16')]=0x0;this[_0xd3c0('0x17')]=0x0;this[_0xd3c0('0x18')]=0x0;this[_0xd3c0('0x19')]=0x0;this[_0xd3c0('0x1a')]=0x0;this[_0xd3c0('0x1b')]=_0x3abae0[_0xd3c0('0x1b')]||![];this['acwTimeout']=_0x3abae0[_0xd3c0('0x1c')]||0xa;this[_0xd3c0('0x1d')]=_0x3abae0[_0xd3c0('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xd3c0('0x1e')]='';this['originated']=0x0;this[_0xd3c0('0x1f')]=0x0;this[_0xd3c0('0x20')]=_0x3abae0[_0xd3c0('0x20')]||null;this[_0xd3c0('0x21')]=_0x3abae0[_0xd3c0('0x21')]?_0x3abae0['dialGlobalInterval']:null;this[_0xd3c0('0x22')]=_0x3abae0[_0xd3c0('0x22')];this['dialMethod']=_0x3abae0['dialMethod']||'progressive';this[_0xd3c0('0x23')]=_0x3abae0[_0xd3c0('0x23')]||0x0;this[_0xd3c0('0x24')]=_0x3abae0[_0xd3c0('0x24')]||0x0;this[_0xd3c0('0x25')]=_0x3abae0[_0xd3c0('0x25')]||0x1;this['dialPredictiveOptimization']=_0x3abae0[_0xd3c0('0x26')]||_0xd3c0('0x27');this['dialPredictiveOptimizationPercentage']=_0x3abae0['dialPredictiveOptimizationPercentage']||0.03;this[_0xd3c0('0x28')]=_0x3abae0[_0xd3c0('0x28')]||0x258;this[_0xd3c0('0x29')]=_0x3abae0[_0xd3c0('0x29')]||_0xd3c0('0x2a');this['dialOriginateCallerIdNumber']=_0x3abae0['dialOriginateCallerIdNumber']||_0xd3c0('0x2a');this[_0xd3c0('0x2b')]=_0x3abae0['dialOriginateTimeout']||0x1e;this[_0xd3c0('0x2c')]=_0x3abae0[_0xd3c0('0x2c')]||_0xd3c0('0x2d');this[_0xd3c0('0x2e')]=_0x3abae0[_0xd3c0('0x2e')]||0x3;this['dialQueueProject']=_0x3abae0[_0xd3c0('0x2f')]||undefined;this[_0xd3c0('0x30')]=_0x3abae0['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x3abae0[_0xd3c0('0x31')]||0x96;this['dialBusyMaxRetry']=_0x3abae0[_0xd3c0('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x3abae0['dialBusyRetryFrequency']||0x96;this[_0xd3c0('0x33')]=_0x3abae0[_0xd3c0('0x33')]||0x3;this[_0xd3c0('0x34')]=_0x3abae0['dialNoAnswerRetryFrequency']||0x96;this[_0xd3c0('0x35')]=_0x3abae0[_0xd3c0('0x35')]||0x3;this[_0xd3c0('0x36')]=_0x3abae0['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd3c0('0x37')]=_0x3abae0[_0xd3c0('0x37')]||0x3;this['dialDropRetryFrequency']=_0x3abae0[_0xd3c0('0x38')]||0x96;this[_0xd3c0('0x39')]=_0x3abae0[_0xd3c0('0x39')]||0x3;this[_0xd3c0('0x3a')]=_0x3abae0[_0xd3c0('0x3a')]||0x96;this[_0xd3c0('0x3b')]=_0x3abae0[_0xd3c0('0x3b')]||0x3;this[_0xd3c0('0x3c')]=_0x3abae0[_0xd3c0('0x3c')]||0x96;this[_0xd3c0('0x3d')]=_0x3abae0[_0xd3c0('0x3d')]||0x3;this[_0xd3c0('0x3e')]=_0x3abae0[_0xd3c0('0x3e')]||0x96;this[_0xd3c0('0x3f')]=_0x3abae0['callAdditionalPhoneAfterMin']||0x3;this[_0xd3c0('0x40')]=_0x3abae0[_0xd3c0('0x40')]||0x4;this[_0xd3c0('0x41')]=_0x3abae0[_0xd3c0('0x41')]?_0x3abae0[_0xd3c0('0x41')]:undefined;this[_0xd3c0('0x42')]=_0x3abae0[_0xd3c0('0x42')]?_0x3abae0[_0xd3c0('0x42')]:undefined;this['dialPrefix']=_0x3abae0['dialPrefix']||undefined;this[_0xd3c0('0x43')]=_0x3abae0[_0xd3c0('0x43')]?_0x3abae0[_0xd3c0('0x43')]:undefined;this[_0xd3c0('0x44')]=_0x3abae0[_0xd3c0('0x44')]||_0xd3c0('0x45');this[_0xd3c0('0x46')]=_0x3abae0[_0xd3c0('0x46')]||undefined;this[_0xd3c0('0x47')]=_0x3abae0['dialCutDigit']||undefined;this['strategy']=strategy[_0x3abae0[_0xd3c0('0x48')]];this['queueStatusComplete']=!![];this[_0xd3c0('0x49')]=_0x3abae0['dialAMDActive']||![];this[_0xd3c0('0x4a')]=_0x3abae0['dialAMDInitialSilence'];this[_0xd3c0('0x4b')]=_0x3abae0['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3abae0[_0xd3c0('0x4c')];this[_0xd3c0('0x4d')]=_0x3abae0['dialAMDTotalAnalysisTime'];this[_0xd3c0('0x4e')]=_0x3abae0[_0xd3c0('0x4e')];this[_0xd3c0('0x4f')]=_0x3abae0[_0xd3c0('0x4f')];this[_0xd3c0('0x50')]=_0x3abae0[_0xd3c0('0x50')];this[_0xd3c0('0x51')]=_0x3abae0['dialAMDSilenceThreshold'];this[_0xd3c0('0x52')]=_0x3abae0[_0xd3c0('0x52')];this[_0xd3c0('0x53')]=0x0;this[_0xd3c0('0x54')]=0x0;this[_0xd3c0('0x55')]=_0x3abae0[_0xd3c0('0x55')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xd3c0('0x56')]=0x0;this[_0xd3c0('0x57')]=0x0;this[_0xd3c0('0x58')]=0x0;this[_0xd3c0('0x59')]=0x0;this[_0xd3c0('0x5a')]=0x0;this[_0xd3c0('0x5b')]=0x0;this[_0xd3c0('0x5c')]=0x0;this[_0xd3c0('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xd3c0('0x5e')]=0x0;this[_0xd3c0('0x5f')]=0x0;this[_0xd3c0('0x60')]=undefined;this['startPredictive']=undefined;this[_0xd3c0('0x61')]=undefined;this[_0xd3c0('0x62')]=1.05;this[_0xd3c0('0x63')]=0x0;this[_0xd3c0('0x64')]=0x0;this[_0xd3c0('0x65')]=0x0;this[_0xd3c0('0x66')]=0x0;this[_0xd3c0('0x67')]=0x0;this[_0xd3c0('0x68')]=0x0;this[_0xd3c0('0x69')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xd3c0('0x6a')]=_0x3abae0[_0xd3c0('0x6b')]||0x14;this[_0xd3c0('0x6c')]=_0x3abae0[_0xd3c0('0x6b')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd3c0('0x6d')]=0x0;this[_0xd3c0('0x6e')]=0x1;this[_0xd3c0('0x6f')]=0x0;this[_0xd3c0('0x70')]=0x0;this[_0xd3c0('0x71')]=0x0;this[_0xd3c0('0x72')]=0x0;this[_0xd3c0('0x73')]=_0x3abae0[_0xd3c0('0x73')]||0x1e;this['dialRecallInQueue']=_0x3abae0[_0xd3c0('0x74')]||![];this['dialPreviewAutoRecallMe']=!!_0x3abae0['dialPreviewAutoRecallMe']||![];this[_0xd3c0('0x75')]=!!_0x3abae0[_0xd3c0('0x75')]||![];this[_0xd3c0('0x76')]=_0x3abae0[_0xd3c0('0x76')]||undefined;this[_0xd3c0('0x77')]=_0x3abae0[_0xd3c0('0x77')]||![];this[_0xd3c0('0x78')]=_0x3abae0[_0xd3c0('0x78')]||![];this[_0xd3c0('0xa')]=monitorFormat[_0x3abae0[_0xd3c0('0xa')]]?monitorFormat[_0x3abae0[_0xd3c0('0xa')]]:undefined;this[_0xd3c0('0x79')]=_0x3abae0[_0xd3c0('0x79')]||![];this['mandatoryDispositionPause']=_0x3abae0[_0xd3c0('0x7a')]?_0x3abae0[_0xd3c0('0x7a')]:undefined;this[_0xd3c0('0x7b')]=![];}module[_0xd3c0('0x7c')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 7840ac6..7868dcc 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 _0xf2cf=['outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','length','online','incall','status','keys','queue','dialer','exten','some','updateReportFromOutboundQueue','preview','loggedIn','loggedInDb','paused','talking','waiting','available','answered','inUse','originated','outboundAbandonedCallsDay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf2cf,0xf5));var _0xff2c=function(_0x230e8e,_0x263430){_0x230e8e=_0x230e8e-0x0;var _0x225986=_0xf2cf[_0x230e8e];return _0x225986;};'use strict';var INBOUND_COUNTERS=['available',_0xff2c('0x0'),_0xff2c('0x1'),_0xff2c('0x2'),'ringing',_0xff2c('0x3'),_0xff2c('0x4')];var OUTBOUND_COUNTERS=[_0xff2c('0x5'),_0xff2c('0x6'),_0xff2c('0x7'),_0xff2c('0x0'),'loggedInDb',_0xff2c('0x8'),_0xff2c('0x9'),'outboundAnswerCallsDay',_0xff2c('0xa'),_0xff2c('0xb'),_0xff2c('0xc'),_0xff2c('0xd'),_0xff2c('0xe'),_0xff2c('0xf'),_0xff2c('0x10'),'outboundUnknownCallsDay',_0xff2c('0x2'),_0xff2c('0x11'),_0xff2c('0x3'),'sumBillable',_0xff2c('0x12'),_0xff2c('0x13'),_0xff2c('0x4')];function VoiceQueueSummary(_0x4ceff2){this['id']=_0x4ceff2['id'];this['name']=_0x4ceff2[_0xff2c('0x14')];this[_0xff2c('0x15')]=_0x4ceff2['strategy'];this[_0xff2c('0x16')]=_0x4ceff2['abandoned']||0x0;this['answered']=_0x4ceff2[_0xff2c('0x6')]||0x0;this[_0xff2c('0x5')]=_0x4ceff2[_0xff2c('0x5')]||0x0;this[_0xff2c('0x17')]=_0x4ceff2['busy']||0x0;this[_0xff2c('0x7')]=_0x4ceff2['inUse']||0x0;this[_0xff2c('0x18')]=_0x4ceff2[_0xff2c('0x18')]||0x0;this['loggedIn']=_0x4ceff2['loggedIn']||0x0;this['loggedInDb']=_0x4ceff2[_0xff2c('0x1')]||0x0;this[_0xff2c('0x19')]=_0x4ceff2[_0xff2c('0x19')]||0x0;this[_0xff2c('0x1a')]=_0x4ceff2[_0xff2c('0x1a')]||0x0;this[_0xff2c('0x2')]=_0x4ceff2[_0xff2c('0x2')]||0x0;this[_0xff2c('0x1b')]=_0x4ceff2[_0xff2c('0x1b')]||0x0;this[_0xff2c('0x1c')]=_0x4ceff2[_0xff2c('0x1c')];this[_0xff2c('0x1d')]=_0x4ceff2[_0xff2c('0x1d')];this[_0xff2c('0x12')]=_0x4ceff2[_0xff2c('0x12')];this[_0xff2c('0x1e')]=_0x4ceff2[_0xff2c('0x1e')]||0x0;this[_0xff2c('0x3')]=_0x4ceff2[_0xff2c('0x3')]||0x0;this[_0xff2c('0x13')]=_0x4ceff2[_0xff2c('0x13')]||0x0;this[_0xff2c('0x1f')]=_0x4ceff2[_0xff2c('0x1f')];this[_0xff2c('0x20')]=_0x4ceff2['unavailable']||0x0;this[_0xff2c('0x21')]=_0x4ceff2[_0xff2c('0x21')]||0x0;this[_0xff2c('0x22')]=_0x4ceff2[_0xff2c('0x22')]||0x0;this[_0xff2c('0x4')]=_0x4ceff2[_0xff2c('0x4')]||0x0;if(_0x4ceff2[_0xff2c('0x1f')]==='outbound'){this[_0xff2c('0x11')]=_0x4ceff2[_0xff2c('0x11')]||0x0;this[_0xff2c('0x23')]=_0x4ceff2[_0xff2c('0x23')];this['dialMethod']=_0x4ceff2[_0xff2c('0x24')];this[_0xff2c('0x25')]=_0x4ceff2[_0xff2c('0x25')];this[_0xff2c('0x26')]=_0x4ceff2[_0xff2c('0x26')];this[_0xff2c('0x27')]=_0x4ceff2['dialOriginateTimeout'];this[_0xff2c('0x28')]=_0x4ceff2[_0xff2c('0x28')];this[_0xff2c('0x29')]=_0x4ceff2['temp'];this['outboundAnswerAgiCallsDay']=_0x4ceff2[_0xff2c('0x2a')];this[_0xff2c('0x2b')]=_0x4ceff2['outboundAnswerCallsDay'];this[_0xff2c('0xa')]=_0x4ceff2['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x4ceff2[_0xff2c('0xb')];this[_0xff2c('0xc')]=_0x4ceff2[_0xff2c('0xc')];this[_0xff2c('0x2c')]=_0x4ceff2[_0xff2c('0x2c')];this[_0xff2c('0x2d')]=_0x4ceff2['outboundDropCallsDayCallersExit'];this[_0xff2c('0x2e')]=_0x4ceff2[_0xff2c('0x2e')];this[_0xff2c('0xd')]=_0x4ceff2['outboundNoAnswerCallsDay'];this[_0xff2c('0xe')]=_0x4ceff2['outboundNoSuchCallsDay'];this[_0xff2c('0x2f')]=_0x4ceff2[_0xff2c('0x2f')];this[_0xff2c('0xf')]=_0x4ceff2['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x4ceff2['outboundRejectCallsDay'];this[_0xff2c('0x30')]=_0x4ceff2[_0xff2c('0x30')];this[_0xff2c('0x31')]=_0x4ceff2[_0xff2c('0x31')];this[_0xff2c('0x32')]=_0x4ceff2[_0xff2c('0x32')];this[_0xff2c('0x33')]=_0x4ceff2[_0xff2c('0x33')];this['predictiveIntervalDroppedCallsCallersExit']=_0x4ceff2[_0xff2c('0x34')];this[_0xff2c('0x35')]=_0x4ceff2[_0xff2c('0x35')];this['predictiveIntervalErlangCalls']=_0x4ceff2[_0xff2c('0x36')];this[_0xff2c('0x37')]=_0x4ceff2[_0xff2c('0x37')];this[_0xff2c('0x38')]=_0x4ceff2[_0xff2c('0x38')];this[_0xff2c('0x39')]=_0x4ceff2[_0xff2c('0x39')];this[_0xff2c('0x3a')]=_0x4ceff2[_0xff2c('0x3a')];this['predictiveIntervalAvailable']=_0x4ceff2['predictiveIntervalAvailable'];this[_0xff2c('0x3b')]=_0x4ceff2['predictiveIntervalTotalCalls'];this[_0xff2c('0x8')]=_0x4ceff2[_0xff2c('0x8')];this[_0xff2c('0x3c')]=_0x4ceff2['erlangCalls'];this[_0xff2c('0x3d')]=_0x4ceff2['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x4ceff2[_0xff2c('0x3e')];this['erlangBusyFactor']=_0x4ceff2[_0xff2c('0x3f')];this[_0xff2c('0x40')]=_0x4ceff2['startPredictive'];this[_0xff2c('0x41')]=_0x4ceff2[_0xff2c('0x41')];this[_0xff2c('0x42')]=_0x4ceff2[_0xff2c('0x42')];this[_0xff2c('0x43')]=_0x4ceff2[_0xff2c('0x43')];}if(_0x4ceff2[_0xff2c('0x44')]){this[_0xff2c('0x44')]={'id':_0x4ceff2[_0xff2c('0x44')]['id'],'name':_0x4ceff2[_0xff2c('0x44')][_0xff2c('0x14')],'active':_0x4ceff2[_0xff2c('0x44')][_0xff2c('0x45')],'callerid':_0x4ceff2[_0xff2c('0x44')][_0xff2c('0x46')]};}}VoiceQueueSummary[_0xff2c('0x47')][_0xff2c('0x48')]=function(_0x213c5a,_0x57d535,_0x5ea859,_0x26eb07){this[_0xff2c('0x1')]=0x0;this[_0xff2c('0x3')]=0x0;this['paused']=0x0;this[_0xff2c('0x21')]=0x0;this[_0xff2c('0x1a')]=0x0;this['inUse']=0x0;this[_0xff2c('0x17')]=0x0;this[_0xff2c('0x18')]=0x0;this['unavailable']=0x0;this[_0xff2c('0x1b')]=0x0;this[_0xff2c('0x1c')]=0x0;this[_0xff2c('0x19')]=0x0;if(_0x5ea859){if(_0x5ea859[_0xff2c('0x5')]){this[_0xff2c('0x5')]=Number(_0x5ea859['available']);}if(_0x5ea859[_0xff2c('0x49')]){this[_0xff2c('0x0')]=Number(_0x5ea859['loggedin']);}if(_0x5ea859['callers']){this[_0xff2c('0x4')]=Number(_0x5ea859['callers']);}}for(var _0x29a728=0x0;_0x29a728<_0x213c5a[_0xff2c('0x4a')];_0x29a728++){var _0x1a4452=_0x57d535['SIP/'+_0x213c5a[_0x29a728]['name']];if(_0x1a4452&&_0x1a4452[_0xff2c('0x4b')]){this[_0xff2c('0x1')]+=0x1;}if(_0x213c5a[_0x29a728][_0xff2c('0x4c')]==='1'){this['talking']+=0x1;}if(_0x213c5a[_0x29a728][_0xff2c('0x2')]==='1'&&!['2','7','8']['includes'](_0x213c5a[_0x29a728][_0xff2c('0x4d')])){this['paused']+=0x1;}switch(_0x213c5a[_0x29a728][_0xff2c('0x4d')]){case'0':this[_0xff2c('0x21')]+=0x1;break;case'1':this[_0xff2c('0x1a')]+=0x1;break;case'2':this[_0xff2c('0x7')]+=0x1;break;case'3':this[_0xff2c('0x17')]+=0x1;break;case'4':this[_0xff2c('0x18')]+=0x1;break;case'5':this[_0xff2c('0x20')]+=0x1;break;case'6':this[_0xff2c('0x1b')]+=0x1;break;case'7':this[_0xff2c('0x1c')]+=0x1;break;case'8':this[_0xff2c('0x19')]+=0x1;break;}}if(this[_0xff2c('0x24')]==='booked'){var _0x5d5dca=Object[_0xff2c('0x4e')](_0x26eb07);for(var _0x1e1c17=0x0;_0x1e1c17<_0x5d5dca[_0xff2c('0x4a')];_0x1e1c17++){var _0xf8f0f1=_0x5d5dca[_0x1e1c17];var _0x5a2621=_0x26eb07[_0xf8f0f1];if(_0x5a2621[_0xff2c('0x4f')]===this[_0xff2c('0x14')]&&_0x5a2621['type']===_0xff2c('0x50')&&_0x5a2621[_0xff2c('0x51')]==='xcally-motion-preview'){this[_0xff2c('0x3')]+=0x1;}}if(this[_0xff2c('0x3')]>this['inUse']){this['talking']=this['inUse'];}this[_0xff2c('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xff2c('0x47')]['compareToInboundQueue']=function(_0x1ea5b4){var _0x466786=![];if(_0x1ea5b4){_0x466786=INBOUND_COUNTERS[_0xff2c('0x52')](function(_0x100a61){return this[_0x100a61]!==_0x1ea5b4[_0x100a61];},this);}return _0x466786;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x7e78c1){var _0x424457=![];var _0x498857=![];var _0x33feb0=![];if(_0x7e78c1){_0x424457=this[_0xff2c('0x24')]!==_0x7e78c1[_0xff2c('0x24')]||this[_0xff2c('0x23')]!==_0x7e78c1[_0xff2c('0x23')]||this[_0xff2c('0x42')]!==_0x7e78c1['message']||this[_0xff2c('0x43')]!==_0x7e78c1[_0xff2c('0x43')];_0x498857=OUTBOUND_COUNTERS[_0xff2c('0x52')](function(_0x4d2481){return this[_0x4d2481]!==_0x7e78c1[_0x4d2481];},this);if(this['Trunk']&&_0x7e78c1[_0xff2c('0x44')]){_0x33feb0=this['Trunk'][_0xff2c('0x14')]!==_0x7e78c1[_0xff2c('0x44')][_0xff2c('0x14')]||this['Trunk'][_0xff2c('0x45')]!==_0x7e78c1[_0xff2c('0x44')][_0xff2c('0x45')];}}return _0x424457||_0x498857||_0x33feb0;};VoiceQueueSummary[_0xff2c('0x47')][_0xff2c('0x53')]=function(_0x444cd1){this[_0xff2c('0x6')]=_0x444cd1['answered'];this['message']=_0x444cd1['message'];this['statusMessage']=_0x444cd1[_0xff2c('0x43')];this[_0xff2c('0x8')]=_0x444cd1[_0xff2c('0x8')];this[_0xff2c('0x9')]=_0x444cd1[_0xff2c('0x9')];this[_0xff2c('0x2b')]=_0x444cd1[_0xff2c('0x2b')];this['outboundBlacklistCallsDay']=_0x444cd1[_0xff2c('0xa')];this[_0xff2c('0xb')]=_0x444cd1[_0xff2c('0xb')];this['outboundCongestionCallsDay']=_0x444cd1[_0xff2c('0xc')];this[_0xff2c('0xd')]=_0x444cd1[_0xff2c('0xd')];this[_0xff2c('0xe')]=_0x444cd1[_0xff2c('0xe')];this[_0xff2c('0xf')]=_0x444cd1[_0xff2c('0xf')];this[_0xff2c('0x10')]=_0x444cd1[_0xff2c('0x10')];this[_0xff2c('0x30')]=_0x444cd1[_0xff2c('0x30')];this[_0xff2c('0x1d')]=_0x444cd1['sumBillable'];this[_0xff2c('0x12')]=_0x444cd1[_0xff2c('0x12')];this['total']=_0x444cd1[_0xff2c('0x13')];if(this[_0xff2c('0x24')]===_0xff2c('0x54')){this[_0xff2c('0x11')]=_0x444cd1[_0xff2c('0x11')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0xe599=['outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','unknown','loggedin','callers','SIP/','online','includes','status','onHold','booked','keys','length','queue','dialer','exten','xcally-motion-preview','pTalking','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid','notInUse','ringInUse','sumBillable','sumHoldTime','type','unavailable','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xe599,0x1e5));var _0x9e59=function(_0x4f1bbe,_0x28a443){_0x4f1bbe=_0x4f1bbe-0x0;var _0x5d1330=_0xe599[_0x4f1bbe];return _0x5d1330;};'use strict';var INBOUND_COUNTERS=[_0x9e59('0x0'),_0x9e59('0x1'),_0x9e59('0x2'),_0x9e59('0x3'),_0x9e59('0x4'),_0x9e59('0x5'),_0x9e59('0x6')];var OUTBOUND_COUNTERS=[_0x9e59('0x0'),_0x9e59('0x7'),'inUse',_0x9e59('0x1'),_0x9e59('0x2'),'originated',_0x9e59('0x8'),'outboundAnswerCallsDay',_0x9e59('0x9'),_0x9e59('0xa'),'outboundCongestionCallsDay',_0x9e59('0xb'),_0x9e59('0xc'),_0x9e59('0xd'),_0x9e59('0xe'),_0x9e59('0xf'),_0x9e59('0x3'),'pTalking',_0x9e59('0x5'),'sumBillable',_0x9e59('0x10'),_0x9e59('0x11'),_0x9e59('0x6')];function VoiceQueueSummary(_0x77f87e){this['id']=_0x77f87e['id'];this['name']=_0x77f87e[_0x9e59('0x12')];this[_0x9e59('0x13')]=_0x77f87e['strategy'];this[_0x9e59('0x14')]=_0x77f87e[_0x9e59('0x14')]||0x0;this[_0x9e59('0x7')]=_0x77f87e[_0x9e59('0x7')]||0x0;this['available']=_0x77f87e[_0x9e59('0x0')]||0x0;this[_0x9e59('0x15')]=_0x77f87e[_0x9e59('0x15')]||0x0;this[_0x9e59('0x16')]=_0x77f87e[_0x9e59('0x16')]||0x0;this[_0x9e59('0x17')]=_0x77f87e[_0x9e59('0x17')]||0x0;this[_0x9e59('0x1')]=_0x77f87e['loggedIn']||0x0;this[_0x9e59('0x2')]=_0x77f87e['loggedInDb']||0x0;this['onHold']=_0x77f87e['onHold']||0x0;this[_0x9e59('0x18')]=_0x77f87e[_0x9e59('0x18')]||0x0;this['paused']=_0x77f87e[_0x9e59('0x3')]||0x0;this[_0x9e59('0x4')]=_0x77f87e[_0x9e59('0x4')]||0x0;this[_0x9e59('0x19')]=_0x77f87e[_0x9e59('0x19')];this[_0x9e59('0x1a')]=_0x77f87e[_0x9e59('0x1a')];this['sumDuration']=_0x77f87e[_0x9e59('0x10')];this[_0x9e59('0x1b')]=_0x77f87e['sumHoldTime']||0x0;this['talking']=_0x77f87e[_0x9e59('0x5')]||0x0;this[_0x9e59('0x11')]=_0x77f87e[_0x9e59('0x11')]||0x0;this['type']=_0x77f87e[_0x9e59('0x1c')];this[_0x9e59('0x1d')]=_0x77f87e['unavailable']||0x0;this['unknown']=_0x77f87e['unknown']||0x0;this[_0x9e59('0x1e')]=_0x77f87e[_0x9e59('0x1e')]||0x0;this[_0x9e59('0x6')]=_0x77f87e[_0x9e59('0x6')]||0x0;if(_0x77f87e[_0x9e59('0x1c')]==='outbound'){this['pTalking']=_0x77f87e['pTalking']||0x0;this[_0x9e59('0x1f')]=_0x77f87e[_0x9e59('0x1f')];this[_0x9e59('0x20')]=_0x77f87e[_0x9e59('0x20')];this[_0x9e59('0x21')]=_0x77f87e[_0x9e59('0x21')];this['dialOriginateCallerIdNumber']=_0x77f87e['dialOriginateCallerIdNumber'];this[_0x9e59('0x22')]=_0x77f87e[_0x9e59('0x22')];this[_0x9e59('0x23')]=_0x77f87e[_0x9e59('0x23')];this[_0x9e59('0x24')]=_0x77f87e[_0x9e59('0x24')];this[_0x9e59('0x25')]=_0x77f87e[_0x9e59('0x25')];this[_0x9e59('0x26')]=_0x77f87e[_0x9e59('0x26')];this[_0x9e59('0x9')]=_0x77f87e[_0x9e59('0x9')];this[_0x9e59('0xa')]=_0x77f87e['outboundBusyCallsDay'];this[_0x9e59('0x27')]=_0x77f87e[_0x9e59('0x27')];this[_0x9e59('0x28')]=_0x77f87e[_0x9e59('0x28')];this[_0x9e59('0x29')]=_0x77f87e[_0x9e59('0x29')];this[_0x9e59('0x2a')]=_0x77f87e[_0x9e59('0x2a')];this[_0x9e59('0xb')]=_0x77f87e['outboundNoAnswerCallsDay'];this[_0x9e59('0xc')]=_0x77f87e['outboundNoSuchCallsDay'];this[_0x9e59('0x2b')]=_0x77f87e[_0x9e59('0x2b')];this[_0x9e59('0xd')]=_0x77f87e[_0x9e59('0xd')];this[_0x9e59('0xe')]=_0x77f87e[_0x9e59('0xe')];this[_0x9e59('0xf')]=_0x77f87e[_0x9e59('0xf')];this[_0x9e59('0x2c')]=_0x77f87e[_0x9e59('0x2c')];this[_0x9e59('0x2d')]=_0x77f87e[_0x9e59('0x2d')];this[_0x9e59('0x2e')]=_0x77f87e[_0x9e59('0x2e')];this['predictiveIntervalDroppedCallsCallersExit']=_0x77f87e[_0x9e59('0x2f')];this['predictiveIntervalDroppedCallsTimeout']=_0x77f87e[_0x9e59('0x30')];this[_0x9e59('0x31')]=_0x77f87e[_0x9e59('0x31')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x77f87e['predictiveIntervalErlangCallsDroppedCalls'];this[_0x9e59('0x32')]=_0x77f87e['predictiveIntervalHitRate'];this[_0x9e59('0x33')]=_0x77f87e['predictiveIntervalMultiplicativeFactor'];this[_0x9e59('0x34')]=_0x77f87e[_0x9e59('0x34')];this['predictiveIntervalAvailable']=_0x77f87e['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x77f87e[_0x9e59('0x35')];this['originated']=_0x77f87e[_0x9e59('0x36')];this[_0x9e59('0x37')]=_0x77f87e[_0x9e59('0x37')];this[_0x9e59('0x38')]=_0x77f87e['erlangCallToSecond'];this[_0x9e59('0x39')]=_0x77f87e[_0x9e59('0x39')];this[_0x9e59('0x3a')]=_0x77f87e[_0x9e59('0x3a')];this[_0x9e59('0x3b')]=_0x77f87e[_0x9e59('0x3b')];this[_0x9e59('0x3c')]=_0x77f87e[_0x9e59('0x3c')];this[_0x9e59('0x3d')]=_0x77f87e[_0x9e59('0x3d')];this[_0x9e59('0x3e')]=_0x77f87e[_0x9e59('0x3e')];}if(_0x77f87e[_0x9e59('0x3f')]){this['Trunk']={'id':_0x77f87e['Trunk']['id'],'name':_0x77f87e[_0x9e59('0x3f')]['name'],'active':_0x77f87e[_0x9e59('0x3f')]['active'],'callerid':_0x77f87e[_0x9e59('0x3f')][_0x9e59('0x40')]};}}VoiceQueueSummary[_0x9e59('0x41')][_0x9e59('0x42')]=function(_0x107e6c,_0x13e0d2,_0x35ce84,_0x5853fd){this[_0x9e59('0x2')]=0x0;this[_0x9e59('0x5')]=0x0;this['paused']=0x0;this[_0x9e59('0x43')]=0x0;this[_0x9e59('0x18')]=0x0;this[_0x9e59('0x16')]=0x0;this['busy']=0x0;this[_0x9e59('0x17')]=0x0;this[_0x9e59('0x1d')]=0x0;this[_0x9e59('0x4')]=0x0;this[_0x9e59('0x19')]=0x0;this['onHold']=0x0;if(_0x35ce84){if(_0x35ce84[_0x9e59('0x0')]){this[_0x9e59('0x0')]=Number(_0x35ce84['available']);}if(_0x35ce84[_0x9e59('0x44')]){this['loggedIn']=Number(_0x35ce84[_0x9e59('0x44')]);}if(_0x35ce84[_0x9e59('0x45')]){this[_0x9e59('0x6')]=Number(_0x35ce84[_0x9e59('0x45')]);}}for(var _0x349cdb=0x0;_0x349cdb<_0x107e6c['length'];_0x349cdb++){var _0x5053ab=_0x13e0d2[_0x9e59('0x46')+_0x107e6c[_0x349cdb][_0x9e59('0x12')]];if(_0x5053ab&&_0x5053ab[_0x9e59('0x47')]){this['loggedInDb']+=0x1;}if(_0x107e6c[_0x349cdb]['incall']==='1'){this[_0x9e59('0x5')]+=0x1;}if(_0x107e6c[_0x349cdb][_0x9e59('0x3')]==='1'&&!['2','7','8'][_0x9e59('0x48')](_0x107e6c[_0x349cdb][_0x9e59('0x49')])){this[_0x9e59('0x3')]+=0x1;}switch(_0x107e6c[_0x349cdb]['status']){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x9e59('0x15')]+=0x1;break;case'4':this[_0x9e59('0x17')]+=0x1;break;case'5':this[_0x9e59('0x1d')]+=0x1;break;case'6':this[_0x9e59('0x4')]+=0x1;break;case'7':this[_0x9e59('0x19')]+=0x1;break;case'8':this[_0x9e59('0x4a')]+=0x1;break;}}if(this[_0x9e59('0x20')]===_0x9e59('0x4b')){var _0x3b54fb=Object[_0x9e59('0x4c')](_0x5853fd);for(var _0x3a26c3=0x0;_0x3a26c3<_0x3b54fb[_0x9e59('0x4d')];_0x3a26c3++){var _0x5bea4e=_0x3b54fb[_0x3a26c3];var _0x313ac2=_0x5853fd[_0x5bea4e];if(_0x313ac2[_0x9e59('0x4e')]===this['name']&&_0x313ac2['type']===_0x9e59('0x4f')&&_0x313ac2[_0x9e59('0x50')]===_0x9e59('0x51')){this[_0x9e59('0x5')]+=0x1;}}if(this[_0x9e59('0x5')]>this[_0x9e59('0x16')]){this[_0x9e59('0x5')]=this[_0x9e59('0x16')];}this[_0x9e59('0x52')]=0x0;}return this;};VoiceQueueSummary[_0x9e59('0x41')]['compareToInboundQueue']=function(_0x16b42c){var _0x14c967=![];if(_0x16b42c){_0x14c967=INBOUND_COUNTERS[_0x9e59('0x53')](function(_0xf699f4){return this[_0xf699f4]!==_0x16b42c[_0xf699f4];},this);}return _0x14c967;};VoiceQueueSummary[_0x9e59('0x41')][_0x9e59('0x54')]=function(_0x5ef8fb){var _0x33f776=![];var _0x44a92d=![];var _0x1204d0=![];if(_0x5ef8fb){_0x33f776=this[_0x9e59('0x20')]!==_0x5ef8fb[_0x9e59('0x20')]||this['dialActive']!==_0x5ef8fb[_0x9e59('0x1f')]||this['message']!==_0x5ef8fb[_0x9e59('0x3d')]||this[_0x9e59('0x3e')]!==_0x5ef8fb[_0x9e59('0x3e')];_0x44a92d=OUTBOUND_COUNTERS['some'](function(_0x526b74){return this[_0x526b74]!==_0x5ef8fb[_0x526b74];},this);if(this['Trunk']&&_0x5ef8fb['Trunk']){_0x1204d0=this[_0x9e59('0x3f')][_0x9e59('0x12')]!==_0x5ef8fb[_0x9e59('0x3f')][_0x9e59('0x12')]||this[_0x9e59('0x3f')][_0x9e59('0x55')]!==_0x5ef8fb[_0x9e59('0x3f')]['active'];}}return _0x33f776||_0x44a92d||_0x1204d0;};VoiceQueueSummary[_0x9e59('0x41')][_0x9e59('0x56')]=function(_0x522224){this['answered']=_0x522224[_0x9e59('0x7')];this[_0x9e59('0x3d')]=_0x522224[_0x9e59('0x3d')];this['statusMessage']=_0x522224[_0x9e59('0x3e')];this[_0x9e59('0x36')]=_0x522224[_0x9e59('0x36')];this['outboundAbandonedCallsDay']=_0x522224[_0x9e59('0x8')];this[_0x9e59('0x26')]=_0x522224['outboundAnswerCallsDay'];this[_0x9e59('0x9')]=_0x522224[_0x9e59('0x9')];this[_0x9e59('0xa')]=_0x522224[_0x9e59('0xa')];this[_0x9e59('0x27')]=_0x522224[_0x9e59('0x27')];this[_0x9e59('0xb')]=_0x522224[_0x9e59('0xb')];this[_0x9e59('0xc')]=_0x522224[_0x9e59('0xc')];this[_0x9e59('0xd')]=_0x522224[_0x9e59('0xd')];this[_0x9e59('0xe')]=_0x522224[_0x9e59('0xe')];this[_0x9e59('0xf')]=_0x522224[_0x9e59('0xf')];this[_0x9e59('0x1a')]=_0x522224['sumBillable'];this['sumDuration']=_0x522224[_0x9e59('0x10')];this[_0x9e59('0x11')]=_0x522224['total'];if(this['dialMethod']==='preview'){this['pTalking']=_0x522224[_0x9e59('0x52')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 8cf1897..f15c676 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 _0x5344=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5344,0x1b0));var _0x4534=function(_0x565390,_0xda577e){_0x565390=_0x565390-0x0;var _0x3778b1=_0x5344[_0x565390];return _0x3778b1;};'use strict';function VtigerAccount(_0x370253){this['id']=_0x370253['id']||0x0;this[_0x4534('0x0')]=_0x370253[_0x4534('0x0')]||'';this[_0x4534('0x1')]=_0x370253[_0x4534('0x1')]||'';this[_0x4534('0x2')]=_0x370253[_0x4534('0x2')]||'';this[_0x4534('0x3')]=_0x370253[_0x4534('0x3')]||'';this['serverUrl']=_0x370253[_0x4534('0x4')]||'';this['Configurations']=_0x370253[_0x4534('0x5')]||{};}module[_0x4534('0x6')]=VtigerAccount; \ No newline at end of file +var _0x0d01=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4c42ff,_0x3d3d75){var _0x27387f=function(_0x2b0971){while(--_0x2b0971){_0x4c42ff['push'](_0x4c42ff['shift']());}};_0x27387f(++_0x3d3d75);}(_0x0d01,0x76));var _0x10d0=function(_0x5912f5,_0x5cbcb9){_0x5912f5=_0x5912f5-0x0;var _0x174e22=_0x0d01[_0x5912f5];return _0x174e22;};'use strict';function VtigerAccount(_0x157ec0){this['id']=_0x157ec0['id']||0x0;this['name']=_0x157ec0[_0x10d0('0x0')]||'';this[_0x10d0('0x1')]=_0x157ec0[_0x10d0('0x1')]||'';this[_0x10d0('0x2')]=_0x157ec0[_0x10d0('0x2')]||'';this[_0x10d0('0x3')]=_0x157ec0[_0x10d0('0x3')]||'';this['serverUrl']=_0x157ec0[_0x10d0('0x4')]||'';this['Configurations']=_0x157ec0[_0x10d0('0x5')]||{};}module[_0x10d0('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5080468..cbe0333 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 _0x4258=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x57aef7,_0x191e6b){var _0xf4caaf=function(_0x1a7f44){while(--_0x1a7f44){_0x57aef7['push'](_0x57aef7['shift']());}};_0xf4caaf(++_0x191e6b);}(_0x4258,0x125));var _0x8425=function(_0x1c214b,_0x2219e3){_0x1c214b=_0x1c214b-0x0;var _0x3d91b0=_0x4258[_0x1c214b];return _0x3d91b0;};'use strict';function ZendeskAccount(_0x563ce3){this['id']=_0x563ce3['id']||0x0;this[_0x8425('0x0')]=_0x563ce3[_0x8425('0x0')]||'';this['username']=_0x563ce3[_0x8425('0x1')]||'';this[_0x8425('0x2')]=_0x563ce3[_0x8425('0x2')]||'';this[_0x8425('0x3')]=_0x563ce3[_0x8425('0x3')]||'';this[_0x8425('0x4')]=_0x563ce3[_0x8425('0x4')]||'';this[_0x8425('0x5')]=_0x563ce3['authType']||'';this['type']=_0x563ce3[_0x8425('0x6')]||_0x8425('0x7');this[_0x8425('0x8')]=_0x563ce3[_0x8425('0x8')]||'';this[_0x8425('0x9')]=_0x563ce3[_0x8425('0x9')]||{};}module[_0x8425('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xf923=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x3aa13a,_0x4a9168){var _0xbb0bf7=function(_0x10d1f0){while(--_0x10d1f0){_0x3aa13a['push'](_0x3aa13a['shift']());}};_0xbb0bf7(++_0x4a9168);}(_0xf923,0x79));var _0x3f92=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xf923[_0x2132a3];return _0x21890c;};'use strict';function ZendeskAccount(_0x295d85){this['id']=_0x295d85['id']||0x0;this[_0x3f92('0x0')]=_0x295d85[_0x3f92('0x0')]||'';this[_0x3f92('0x1')]=_0x295d85[_0x3f92('0x1')]||'';this['password']=_0x295d85[_0x3f92('0x2')]||'';this[_0x3f92('0x3')]=_0x295d85[_0x3f92('0x3')]||'';this['remoteUri']=_0x295d85[_0x3f92('0x4')]||'';this[_0x3f92('0x5')]=_0x295d85[_0x3f92('0x5')]||'';this[_0x3f92('0x6')]=_0x295d85[_0x3f92('0x6')]||_0x3f92('0x7');this[_0x3f92('0x8')]=_0x295d85[_0x3f92('0x8')]||'';this[_0x3f92('0x9')]=_0x295d85[_0x3f92('0x9')]||{};}module[_0x3f92('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 8ccac56..51ef3cc 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 _0xc112=['zone','clientId','clientSecret','serverUrl','code','Configurations','exports','name','description','host'];(function(_0x166ff6,_0x121d72){var _0x260452=function(_0x19076a){while(--_0x19076a){_0x166ff6['push'](_0x166ff6['shift']());}};_0x260452(++_0x121d72);}(_0xc112,0xf7));var _0x2c11=function(_0x46d39f,_0x4dc00f){_0x46d39f=_0x46d39f-0x0;var _0x1627f8=_0xc112[_0x46d39f];return _0x1627f8;};'use strict';function ZohoAccount(_0x5160bd){this['id']=_0x5160bd['id']||0x0;this[_0x2c11('0x0')]=_0x5160bd['name']||'';this[_0x2c11('0x1')]=_0x5160bd[_0x2c11('0x1')]||'';this[_0x2c11('0x2')]=_0x5160bd[_0x2c11('0x2')]||'';this[_0x2c11('0x3')]=_0x5160bd['zone']||'';this['clientId']=_0x5160bd[_0x2c11('0x4')]||'';this[_0x2c11('0x5')]=_0x5160bd[_0x2c11('0x5')]||'';this[_0x2c11('0x6')]=_0x5160bd[_0x2c11('0x6')]||'';this['code']=_0x5160bd[_0x2c11('0x7')]||'';this['refreshToken']=_0x5160bd['refreshToken']||'';this[_0x2c11('0x8')]=_0x5160bd[_0x2c11('0x8')]||{};}module[_0x2c11('0x9')]=ZohoAccount; \ No newline at end of file +var _0x97da=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0x97da,0x12e));var _0xa97d=function(_0x96ef0,_0x374394){_0x96ef0=_0x96ef0-0x0;var _0x40ff53=_0x97da[_0x96ef0];return _0x40ff53;};'use strict';function ZohoAccount(_0x4641a8){this['id']=_0x4641a8['id']||0x0;this[_0xa97d('0x0')]=_0x4641a8[_0xa97d('0x0')]||'';this[_0xa97d('0x1')]=_0x4641a8[_0xa97d('0x1')]||'';this[_0xa97d('0x2')]=_0x4641a8[_0xa97d('0x2')]||'';this[_0xa97d('0x3')]=_0x4641a8['zone']||'';this[_0xa97d('0x4')]=_0x4641a8['clientId']||'';this['clientSecret']=_0x4641a8[_0xa97d('0x5')]||'';this[_0xa97d('0x6')]=_0x4641a8['serverUrl']||'';this[_0xa97d('0x7')]=_0x4641a8['code']||'';this[_0xa97d('0x8')]=_0x4641a8[_0xa97d('0x8')]||'';this['Configurations']=_0x4641a8[_0xa97d('0x9')]||{};}module[_0xa97d('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 e182df0..66df1df 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 _0x0598=['Contact','phone','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','SIP/%s','calleridname'];(function(_0x488688,_0x2985ee){var _0x4412a0=function(_0x2be9e8){while(--_0x2be9e8){_0x488688['push'](_0x488688['shift']());}};_0x4412a0(++_0x2985ee);}(_0x0598,0x92));var _0x8059=function(_0x43df93,_0x6b4f9c){_0x43df93=_0x43df93-0x0;var _0x52638e=_0x0598[_0x43df93];return _0x52638e;};'use strict';var util=require(_0x8059('0x0'));var _=require(_0x8059('0x1'));var moment=require('moment');function checkNameSurname(_0x3386f0,_0x52c9bf,_0x4dad54){var _0x14109c='';if(!_[_0x8059('0x2')](_0x52c9bf)&&'string'===typeof _0x52c9bf){_0x14109c+=_0x52c9bf;}if(!_['isNil'](_0x4dad54)&&'string'===typeof _0x4dad54){_0x14109c+='\x20'+_0x4dad54;}if(_0x14109c!==''){return _0x14109c;}return _0x3386f0;}function Action(_0x467206,_0xa7d7c1,_0x512c0f,_0x5996d7,_0x248273){this[_0x8059('0x3')]=_0x512c0f||undefined;this[_0x8059('0x4')]=_0x467206['id'];this[_0x8059('0x5')]=_0xa7d7c1['name'];this['type']=_0xa7d7c1[_0x8059('0x6')];this[_0x8059('0x7')]=_0x8059('0x5');this[_0x8059('0x8')]=![];this[_0x8059('0x9')]=_['isNil'](_0x467206['Agent'])?undefined:_0x467206[_0x8059('0xa')][_0x8059('0xb')];this['channelAgent']=this['membername']?util['format'](_0x8059('0xc'),this[_0x8059('0x9')]):_0x5996d7||undefined;this[_0x8059('0xd')]=checkNameSurname(_0x467206[_0x8059('0xe')][_0x8059('0xf')],_0x467206['Contact'][_0x8059('0x10')],_0x467206['Contact'][_0x8059('0x11')]);this['active']=_0x467206[_0x8059('0x12')]||![];this[_0x8059('0x13')]=_0x467206[_0x8059('0xf')];this['scheduledat']=_0x467206['scheduledat'];this['countbusyretry']=_0x467206[_0x8059('0x14')]||0x0;this[_0x8059('0x15')]=_0x467206[_0x8059('0x15')]||0x0;this[_0x8059('0x16')]=_0x467206[_0x8059('0x16')]||0x0;this['countglobal']=(_0x467206[_0x8059('0x14')]||0x0)+(_0x467206[_0x8059('0x15')]||0x0)+(_0x467206[_0x8059('0x16')]||0x0)+(_0x467206[_0x8059('0x17')]||0x0)+(_0x467206['countdropretry']||0x0)+(_0x467206[_0x8059('0x18')]||0x0)+(_0x467206['countmachineretry']||0x0)+(_0x467206[_0x8059('0x19')]||0x0);this['countnosuchnumberretry']=_0x467206[_0x8059('0x17')]||0x0;this['countdropretry']=_0x467206[_0x8059('0x1a')]||0x0;this[_0x8059('0x18')]=_0x467206[_0x8059('0x18')]||0x0;this['countmachineretry']=_0x467206['countmachineretry']||0x0;this[_0x8059('0x19')]=_0x467206[_0x8059('0x19')]||0x0;this[_0x8059('0x1b')]=_0x467206[_0x8059('0x1b')];this['callbackuniqueid']=_0x467206[_0x8059('0x1c')];this[_0x8059('0x1d')]=_0x467206[_0x8059('0x1d')];this['recallme']=_0x467206[_0x8059('0x1e')];this[_0x8059('0x1f')]=_0x467206[_0x8059('0x1f')];this[_0x8059('0x20')]=_0x467206['ListId'];this[_0x8059('0x21')]=_[_0x8059('0x2')](_0x467206[_0x8059('0xa')])?_0x467206[_0x8059('0x21')]:_0x467206[_0x8059('0xa')]['id'];this['VoiceQueueId']=_0x467206[_0x8059('0x22')];this[_0x8059('0x23')]='';this[_0x8059('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x8059('0x25'),this[_0x8059('0xd')],this[_0x8059('0x26')]);};module[_0x8059('0x27')]=Action; \ No newline at end of file +var _0xef0f=['dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','name','type','campaigntype','queue'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xef0f,0x168));var _0xfef0=function(_0x436989,_0x307d89){_0x436989=_0x436989-0x0;var _0x2e9ce5=_0xef0f[_0x436989];return _0x2e9ce5;};'use strict';var util=require(_0xfef0('0x0'));var _=require('lodash');var moment=require(_0xfef0('0x1'));function checkNameSurname(_0x22a6a3,_0x19f865,_0x4d29e5){var _0x3fc3a1='';if(!_[_0xfef0('0x2')](_0x19f865)&&_0xfef0('0x3')===typeof _0x19f865){_0x3fc3a1+=_0x19f865;}if(!_['isNil'](_0x4d29e5)&&_0xfef0('0x3')===typeof _0x4d29e5){_0x3fc3a1+='\x20'+_0x4d29e5;}if(_0x3fc3a1!==''){return _0x3fc3a1;}return _0x22a6a3;}function Action(_0x9b8b9e,_0x2697df,_0x315a8c,_0xad43e,_0x11dfd7){this['uniqueid']=_0x315a8c||undefined;this[_0xfef0('0x4')]=_0x9b8b9e['id'];this['queue']=_0x2697df[_0xfef0('0x5')];this[_0xfef0('0x6')]=_0x2697df[_0xfef0('0x6')];this[_0xfef0('0x7')]=_0xfef0('0x8');this[_0xfef0('0x9')]=![];this[_0xfef0('0xa')]=_[_0xfef0('0x2')](_0x9b8b9e[_0xfef0('0xb')])?undefined:_0x9b8b9e[_0xfef0('0xb')][_0xfef0('0x5')];this[_0xfef0('0xc')]=this[_0xfef0('0xa')]?util[_0xfef0('0xd')]('SIP/%s',this[_0xfef0('0xa')]):_0xad43e||undefined;this[_0xfef0('0xe')]=checkNameSurname(_0x9b8b9e[_0xfef0('0xf')][_0xfef0('0x10')],_0x9b8b9e[_0xfef0('0xf')][_0xfef0('0x11')],_0x9b8b9e[_0xfef0('0xf')]['lastName']);this[_0xfef0('0x12')]=_0x9b8b9e['active']||![];this['calleridnum']=_0x9b8b9e['phone'];this[_0xfef0('0x13')]=_0x9b8b9e[_0xfef0('0x13')];this[_0xfef0('0x14')]=_0x9b8b9e[_0xfef0('0x14')]||0x0;this[_0xfef0('0x15')]=_0x9b8b9e[_0xfef0('0x15')]||0x0;this[_0xfef0('0x16')]=_0x9b8b9e[_0xfef0('0x16')]||0x0;this['countglobal']=(_0x9b8b9e[_0xfef0('0x14')]||0x0)+(_0x9b8b9e[_0xfef0('0x15')]||0x0)+(_0x9b8b9e[_0xfef0('0x16')]||0x0)+(_0x9b8b9e[_0xfef0('0x17')]||0x0)+(_0x9b8b9e[_0xfef0('0x18')]||0x0)+(_0x9b8b9e['countabandonedretry']||0x0)+(_0x9b8b9e[_0xfef0('0x19')]||0x0)+(_0x9b8b9e['countagentrejectretry']||0x0);this[_0xfef0('0x17')]=_0x9b8b9e[_0xfef0('0x17')]||0x0;this[_0xfef0('0x18')]=_0x9b8b9e['countdropretry']||0x0;this[_0xfef0('0x1a')]=_0x9b8b9e['countabandonedretry']||0x0;this[_0xfef0('0x19')]=_0x9b8b9e[_0xfef0('0x19')]||0x0;this['countagentrejectretry']=_0x9b8b9e['countagentrejectretry']||0x0;this['callback']=_0x9b8b9e[_0xfef0('0x1b')];this['callbackuniqueid']=_0x9b8b9e[_0xfef0('0x1c')];this[_0xfef0('0x1d')]=_0x9b8b9e[_0xfef0('0x1d')];this[_0xfef0('0x1e')]=_0x9b8b9e[_0xfef0('0x1e')];this[_0xfef0('0x1f')]=_0x9b8b9e['ContactId'];this['ListId']=_0x9b8b9e[_0xfef0('0x20')];this[_0xfef0('0x21')]=_[_0xfef0('0x2')](_0x9b8b9e[_0xfef0('0xb')])?_0x9b8b9e[_0xfef0('0x21')]:_0x9b8b9e[_0xfef0('0xb')]['id'];this[_0xfef0('0x22')]=_0x9b8b9e[_0xfef0('0x22')];this[_0xfef0('0x23')]='';this['originatecalleridname']='';}Action[_0xfef0('0x24')][_0xfef0('0x25')]=function(){return util[_0xfef0('0xd')](_0xfef0('0x26'),this[_0xfef0('0xe')],this[_0xfef0('0x27')]);};module[_0xfef0('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 0c1eebf..f6f5cde 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 _0x00bb=['swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','active','SIP/%s','status','reachable','unmonitored','run','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','syncVarSet','filterKey','keys','variable','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./util/util','../dialer/utils','redis','defaults','localhost','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','syncHangupRequest','syncDialEnd','bind','newexten','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','paused','INACTIVE','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','Queue','queue','originated:\x20','stringify','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','catch','loggedIn','NO_AGENTS_LOGGED','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','custom:agentconnect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','\x20Queue','pTalking:\x20','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var uuid=require(_0xb00b('0x2'));var moment=require('moment');var Redis=require(_0xb00b('0x3'));var config=require('../../../config/environment');var logger=require(_0xb00b('0x4'))(_0xb00b('0x5'));var loggerAction=require('../../../config/logger')(_0xb00b('0x6'));var ami=require(_0xb00b('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require(_0xb00b('0x8'));var utils=require(_0xb00b('0x9'));config[_0xb00b('0xa')]=_[_0xb00b('0xb')](config[_0xb00b('0xa')],{'host':_0xb00b('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb00b('0xd')][_0xb00b('0xe')]=function(_0x5851d4){this[_0xb00b('0xf')]=this[_0xb00b('0xf')]?this['tail'][_0xb00b('0x10')](_0x5851d4):_0x5851d4();};function Preview(_0x5a63ed){this['sequence']=new Sequence();this['campaignsPreview']=_0x5a63ed[_0xb00b('0x11')];this[_0xb00b('0x12')]=_0x5a63ed[_0xb00b('0x12')];this[_0xb00b('0x13')]={};this[_0xb00b('0x14')]=_0x5a63ed[_0xb00b('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0xb00b('0x15'),this[_0xb00b('0x16')]['bind'](this));ami['on'](_0xb00b('0x17'),this[_0xb00b('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xb00b('0x19')]['bind'](this));ami['on']('dialend',this[_0xb00b('0x1a')][_0xb00b('0x1b')](this));ami['on'](_0xb00b('0x1c'),this[_0xb00b('0x1d')]['bind'](this));ami['on'](_0xb00b('0x1e'),this['syncVarSet'][_0xb00b('0x1b')](this));ami['on']('attendedtransfer',this[_0xb00b('0x1f')]['bind'](this));ami['on'](_0xb00b('0x20'),this[_0xb00b('0x21')]['bind'](this));this['loopCampaigns'](this[_0xb00b('0x22')]);}function emit(_0x4a334b,_0x1344c4,_0x43da66){io['to'](_0x4a334b)[_0xb00b('0x23')](_0x1344c4,_0x43da66);}function emitVoiceQueueChannelRemove(_0x3501af){logger['info'](_0xb00b('0x24'),JSON['stringify'](_0x3501af));emit(util[_0xb00b('0x25')](_0xb00b('0x26'),_0x3501af['name']),_0xb00b('0x27'),_0x3501af);io[_0xb00b('0x23')]('voice_queue_presence:remove',_0x3501af);}function notSendMessagesQueue(_0x3ab3cc){if(_0x3ab3cc[_0xb00b('0x28')]){if(_0x3ab3cc['originated']===0x0&&_0x3ab3cc[_0xb00b('0x29')]===0x0){_0x3ab3cc[_0xb00b('0x28')]=![];_0x3ab3cc[_0xb00b('0x2a')]=0x0;_0x3ab3cc[_0xb00b('0x2b')]=0x0;_0x3ab3cc['message']=utils['CAMPAIGN_STATUS'][_0xb00b('0x2c')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3ab3cc['name']+_0xb00b('0x2d'));}else{_0x3ab3cc[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x30')];ut[_0xb00b('0x31')](_0xb00b('0x32'),_0x3ab3cc[_0xb00b('0x33')]+'\x20is\x20deactivated');}}}Preview[_0xb00b('0xd')]['loopCampaigns']=function(){var _0x450129=this;setInterval(function(){_0x450129[_0xb00b('0x34')]();},0x7cf);};Preview[_0xb00b('0xd')]['syncCampaigns']=function(){var _0x2fc11a=this[_0xb00b('0x22')];this[_0xb00b('0x35')]+=0x1;for(var _0x183233 in _0x2fc11a){if(_0x2fc11a[_0xb00b('0x36')](_0x183233)&&(_0x2fc11a[_0x183233][_0xb00b('0x37')]===_0xb00b('0x5')||_0x2fc11a[_0x183233][_0xb00b('0x37')]===_0xb00b('0x38'))&&_0x2fc11a[_0x183233]['type']===_0xb00b('0x39')){if(this[_0xb00b('0x35')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xb00b('0x3a')]();}}if(_0x2fc11a[_0xb00b('0x36')](_0x183233)&&_0x2fc11a[_0x183233]['dialMethod']===_0xb00b('0x5')&&_0x2fc11a[_0x183233]['type']===_0xb00b('0x39')){if(_0x2fc11a[_0x183233][_0xb00b('0x3b')]){this[_0xb00b('0x3c')](_0x2fc11a[_0x183233]);if(_0x2fc11a[_0x183233][_0xb00b('0x3d')])this[_0xb00b('0x3e')](_0x2fc11a[_0x183233]);}else{notSendMessagesQueue(_0x2fc11a[_0x183233]);}}}};Preview[_0xb00b('0xd')][_0xb00b('0x3f')]=function(_0x594840){var _0x57e8f9=this;this['sequence'][_0xb00b('0xe')](function(){if(!_[_0xb00b('0x40')](_0x57e8f9[_0xb00b('0x13')][_0x594840])){loggerAction[_0xb00b('0x41')]('[clearZombieChannels][talking]',_0x594840,_0xb00b('0x42'),_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')],_0xb00b('0x44'),JSON[_0xb00b('0x45')](_0x57e8f9[_0xb00b('0x22')][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]]['originated']),'pTalking:\x20',JSON[_0xb00b('0x45')](_0x57e8f9['campaignsPreview'][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]][_0xb00b('0x29')]),JSON[_0xb00b('0x45')](_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x46')]),JSON[_0xb00b('0x45')](_['pick'](_0x57e8f9[_0xb00b('0x13')][_0x594840],[_0xb00b('0x47'),_0xb00b('0x48'),_0xb00b('0x49'),_0xb00b('0x4a')])));return ami[_0xb00b('0x4b')]({'action':'status','channel':_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x4c')]})['catch'](function(_0x17ff34){if(_0x17ff34[_0xb00b('0x2e')]===_0xb00b('0x4d')){setTimeout(function(){if(_0x57e8f9[_0xb00b('0x13')][_0x594840]){ut[_0xb00b('0x4e')](_0x57e8f9['campaignsPreview'][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]],_0xb00b('0x4f'));if(_0x57e8f9[_0xb00b('0x13')][_0x594840]['dialAnswer']===!![]){ut['decrementTalkink'](_0x57e8f9[_0xb00b('0x22')][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]],_0xb00b('0x4f'));ut[_0xb00b('0x50')](_0xb00b('0x51')+_0x594840,_0x57e8f9[_0xb00b('0x13')][_0x594840]['queue']);}ut[_0xb00b('0x50')](_0xb00b('0x52')+_0x594840,_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]);delete _0x57e8f9[_0xb00b('0x13')][_0x594840];}},0x2328);}});}});};Preview[_0xb00b('0xd')][_0xb00b('0x3a')]=function(){var _0x974a29=this;loggerAction[_0xb00b('0x41')](_0xb00b('0x53'),_[_0xb00b('0x54')](this[_0xb00b('0x13')]));for(var _0x577bad in this[_0xb00b('0x13')]){if(_0x974a29[_0xb00b('0x13')][_0xb00b('0x36')](_0x577bad)){_0x974a29[_0xb00b('0x3f')](_0x577bad);}}};Preview[_0xb00b('0xd')][_0xb00b('0x3e')]=function(_0xd97f49){var _0x1b4f09=this;rpcDb[_0xb00b('0x55')](_0xd97f49['id'],ut[_0xb00b('0x56')](this[_0xb00b('0x14')]))[_0xb00b('0x57')](function(_0x5dbe00){if(!_['isNil'](_0x5dbe00)){for(var _0x47c6c0=0x0;_0x47c6c0<_0x5dbe00[_0xb00b('0x58')];_0x47c6c0+=0x1){if(ut[_0xb00b('0x59')](_0x5dbe00[_0x47c6c0]['scheduledat'])<_0xd97f49[_0xb00b('0x5a')]*0x3c){if(_0x5dbe00[_0x47c6c0][_0xb00b('0x5b')]&&!_0x5dbe00[_0x47c6c0][_0xb00b('0x5b')][_0xb00b('0x5c')]){_0x1b4f09['run'](_0x5dbe00[_0x47c6c0]['id'])['then'](ut[_0xb00b('0x5d')](_0xb00b('0x5e')))['catch'](ut['logger2'](_0xb00b('0x5e')));}else{rpcDb[_0xb00b('0x5f')](_0x5dbe00[_0x47c6c0]['id']);}}else{var _0x4e0be4=new Action(_0x5dbe00[_0x47c6c0],_0xd97f49);_0x4e0be4[_0xb00b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd97f49['outboundReCallsDay']+=0x1;ut[_0xb00b('0x61')](_0x4e0be4,0x17,'RecallInQueue');if(_0xd97f49[_0xb00b('0x62')]){rpcDb[_0xb00b('0x63')](ut[_0xb00b('0x64')](_0x5dbe00[_0x47c6c0]));rpcDb[_0xb00b('0x65')](_0x4e0be4,_0xb00b('0x66'));}else{ut[_0xb00b('0x61')](_0x4e0be4,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x4e0be4,_0xb00b('0x67'));rpcDb[_0xb00b('0x68')](_0x4e0be4,'[HistoryRecallClose]');}}}}})[_0xb00b('0x69')](ut[_0xb00b('0x5d')]('[getContactRecallMe]'));};Preview[_0xb00b('0xd')][_0xb00b('0x3c')]=function(_0x3b5d82){_0x3b5d82['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x3b5d82[_0xb00b('0x6a')])){_0x3b5d82[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x6b')];}else if(!ut['isActive'](_0x3b5d82[_0xb00b('0x3b')])){_0x3b5d82[_0xb00b('0x2e')]=utils['CAMPAIGN_STATUS']['INACTIVE'];}else if(!this[_0xb00b('0x6c')](_0x3b5d82['Trunk'])){if(!this[_0xb00b('0x6c')](_0x3b5d82[_0xb00b('0x6d')])){_0x3b5d82[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x6e')];}else{_0x3b5d82[_0xb00b('0x2e')]=utils['CAMPAIGN_STATUS'][_0xb00b('0x6f')];}}else{_0x3b5d82['message']=utils[_0xb00b('0x2f')][_0xb00b('0x6f')];}};Preview[_0xb00b('0xd')]['callProgressDetectingCustomer']=function(_0x248335,_0x25f1f6,_0x4ba53a){var _0x598a55=this;var _0x24e826=this[_0xb00b('0x13')][_0x25f1f6];var _0x219b74=this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]];var _0x279467;var _0x347949=![];var _0x3a0b90=0x2;var _0x4c3067=0x3;if(_0x219b74){switch(_0x4ba53a){case'1':_0x219b74[_0xb00b('0x70')]+=0x1;_0x24e826[_0xb00b('0x71')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x0,_0xb00b('0x73'));ami[_0xb00b('0x23')](_0xb00b('0x74'),ut[_0xb00b('0x75')](_0x24e826,'nosuchnumber'));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0x76'));_0x598a55[_0xb00b('0x77')](_0x24e826,'0',_0x219b74)[_0xb00b('0x57')](function(_0x4b1e5f){_0x347949=_0x4b1e5f[_0xb00b('0x78')]==0x1;_0x3a0b90=_0x219b74[_0xb00b('0x79')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb['createCustomerFinal'](_0x279467,_0xb00b('0x7f'));}else{if(_0x24e826['countnosuchnumberretry']>=_0x219b74[_0xb00b('0x80')]){rpcDb['createCustomerFinal'](_0x24e826,_0xb00b('0x7f'));}else{rpcDb['rescheduleContact'](ut[_0xb00b('0x81')](_0x24e826,'countnosuchnumberretry',_0x219b74[_0xb00b('0x79')]),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}delete this['actions'][_0x248335['linkedid']];}else{_0x24e826['countnosuchnumberretry']++;logger[_0xb00b('0x41')](_0xb00b('0x84'),_0x24e826[_0xb00b('0x71')]);logger['info']('id',_0x24e826[_0xb00b('0x85')]);_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnosuchnumberretry':_0x24e826[_0xb00b('0x71')]}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0x87'):var _0x5622a4=moment()[_0xb00b('0x25')](_0xb00b('0x88'));_0x24e826[_0xb00b('0x89')]=_0x5622a4;_0x24e826['answertime']=_0x5622a4;_0x24e826['dialAnswer']=!![];_0x219b74[_0xb00b('0x29')]+=0x1;logger[_0xb00b('0x41')](_0xb00b('0x8a'),_0x24e826['uniqueid'],'\x20Queue',_0x219b74['name'],'pTalking:\x20',_0x219b74[_0xb00b('0x29')]);ami['emit'](_0xb00b('0x8b'),ut[_0xb00b('0x75')](_0x24e826,'connect',this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]]));if(_0x219b74[_0xb00b('0x8c')]){ami[_0xb00b('0x23')](_0xb00b('0x8d'),ut['buildAcw'](_0x24e826));}break;case'16':ami[_0xb00b('0x23')](_0xb00b('0x8e'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0x8f'),this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]]));emitVoiceQueueChannelRemove(ut[_0xb00b('0x75')](_0x24e826,'complete'));_0x219b74[_0xb00b('0x90')]+=0x1;_0x219b74[_0xb00b('0x91')]+=0x1;_0x219b74[_0xb00b('0x92')]+=0x1;ut[_0xb00b('0x93')](_0x219b74,_0xb00b('0x94'));_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x4,'Answer');rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0x95'));rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0x96'));rpcDb[_0xb00b('0x97')](_0x24e826);_0x219b74[_0xb00b('0x98')]+=_0x24e826[_0xb00b('0x99')];_0x219b74[_0xb00b('0x9a')]+=_0x24e826['talktime'];logger[_0xb00b('0x41')](_0xb00b('0x9b'),_0x24e826[_0xb00b('0x9c')],_0xb00b('0x9d'),_0x219b74[_0xb00b('0x33')],_0xb00b('0x9e'),_0x219b74[_0xb00b('0x29')]);delete this['actions'][_0x248335[_0xb00b('0x9f')]];break;case _0xb00b('0xa0'):_0x219b74[_0xb00b('0xa1')]+=0x1;_0x24e826[_0xb00b('0xa2')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut['logCustomer'](_0x24e826,0x5,_0xb00b('0xa3'));_0x3a0b90=_0x219b74['dialBusyRetryFrequency'];_0x4c3067=_0x219b74[_0xb00b('0x7a')];ami['emit'](_0xb00b('0xa4'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xa5')));rpcDb['createCustomerHistory'](_0x24e826,'[callProgressDetectingCustomer][logBusy]');_0x598a55[_0xb00b('0x77')](_0x24e826,'5',_0x219b74)[_0xb00b('0x57')](function(_0x33a483){_0x347949=_0x33a483[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xa6'));}else{if(_0x24e826[_0xb00b('0xa2')]>=_0x219b74[_0xb00b('0xa7')]){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xa8'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x24e826,_0xb00b('0xa2'),_0x219b74[_0xb00b('0xa9')]),_0x24e826['unlockAgent'],_0x24e826['activeContact']);}}}else{_0x24e826[_0xb00b('0xa2')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countbusyretry':_0x24e826['countbusyretry']}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xab'):_0x219b74[_0xb00b('0xac')]+=0x1;_0x24e826[_0xb00b('0xad')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x3,'NoAnswer');_0x3a0b90=_0x219b74[_0xb00b('0xae')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];var _0x545dfd=ut[_0xb00b('0xaf')](_0x24e826,_0x219b74);ami[_0xb00b('0x23')](_0xb00b('0xb0'),_0x545dfd);rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xb1'));_0x598a55[_0xb00b('0x77')](_0x24e826,'3',_0x219b74)[_0xb00b('0x57')](function(_0x2423b2){_0x347949=_0x2423b2[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,'Global');rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xb2'));}else{if(_0x24e826[_0xb00b('0xad')]>=_0x219b74[_0xb00b('0xb3')]){rpcDb['createCustomerFinal'](_0x24e826,_0xb00b('0xb1'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xad'),_0x219b74[_0xb00b('0xae')]),_0x24e826['unlockAgent'],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826['countnoanswerretry']}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xb5'):_0x219b74[_0xb00b('0xb6')]+=0x1;_0x24e826[_0xb00b('0xb7')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x8,_0xb00b('0xb8'));_0x3a0b90=_0x219b74[_0xb00b('0xb9')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];ami[_0xb00b('0x23')]('custom:agentcongestion',ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xba')));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xbb'));_0x598a55['verifyAdditionalPhones'](_0x24e826,'8',_0x219b74)[_0xb00b('0x57')](function(_0xb27b8b){_0x347949=_0xb27b8b['additional']==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74['dialGlobalMaxRetry']){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x24e826[_0xb00b('0xb7')]>=_0x219b74[_0xb00b('0xbc')]){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xbb'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xb7'),_0x219b74[_0xb00b('0xa9')]),_0x24e826[_0xb00b('0x82')],_0x24e826['activeContact']);}}}else{_0x24e826['countcongestionretry']++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countcongestionretry':_0x24e826[_0xb00b('0xb7')]}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xbd'):_0x219b74['outboundRejectCallsDay']+=0x1;_0x24e826[_0xb00b('0xbe')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut['logCustomer'](_0x24e826,0x14,_0xb00b('0xbf'));_0x3a0b90=_0x219b74[_0xb00b('0xc0')];_0x4c3067=_0x219b74['callAdditionalPhoneAfterMin'];ami[_0xb00b('0x23')](_0xb00b('0xc1'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xc2')));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xc3'));_0x598a55[_0xb00b('0x77')](_0x24e826,'20',_0x219b74)[_0xb00b('0x57')](function(_0x55ea09){_0x347949=_0x55ea09[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0x14,'AgentReject');rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x24e826[_0xb00b('0xbe')]>=_0x219b74['dialAgentRejectMaxRetry']){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xc4'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xbe'),_0x219b74['dialAgentRejectRetryFrequency']),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826['countnoanswerretry']++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826['idContact'],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case'ABANDONED':_0x219b74[_0xb00b('0xc5')]+=0x1;_0x24e826[_0xb00b('0xc6')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x24e826,_0xb00b('0xc7'));_0x598a55[_0xb00b('0x77')](_0x24e826,'11',_0x219b74)[_0xb00b('0x57')](function(_0x2d5652){_0x347949=_0x2d5652[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut['totalGlobal'](_0x24e826)>=_0x219b74['dialGlobalMaxRetry']){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xc7'));}else{if(_0x24e826[_0xb00b('0xc8')]>=_0x219b74[_0xb00b('0xc9')]){rpcDb[_0xb00b('0x68')](_0x24e826,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb00b('0xb4')](ut['scheduledAt'](_0x24e826,_0xb00b('0xc6'),_0x219b74['dialAbandonedRetryFrequency']),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case'18':_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0xcb')]+=0x1;_0x24e826['countglobal']=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x12,_0x248335[_0xb00b('0xcc')]||_0x248335[_0xb00b('0xcd')]);ami['emit'](_0xb00b('0xce'),ut[_0xb00b('0x75')](_0x24e826,'amd'));rpcDb[_0xb00b('0x65')](_0x24e826,'[callProgressDetectingCustomer][hangupInAMD]');_0x598a55[_0xb00b('0x77')](_0x24e826,'18',_0x219b74)[_0xb00b('0x57')](function(_0x49fe3f){_0x347949=_0x49fe3f[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0x12,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xb00b('0x68')](_0x24e826,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})['then'](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});delete this[_0xb00b('0x13')][_0x248335['linkedid']];break;case'19':_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x13,_0x248335['cause-txt']||_0x248335[_0xb00b('0xcd')]);ami[_0xb00b('0x23')](_0xb00b('0xce'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xcf')));rpcDb[_0xb00b('0x65')](_0x24e826,'[callProgressDetectingCustomer][machine]');_0x598a55['verifyAdditionalPhones'](_0x24e826,'18',_0x219b74)[_0xb00b('0x57')](function(_0x23d306){_0x347949=_0x23d306[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut['cloneAction'](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xd0'));}else{rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xd0'));}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55['incrementPreviewCounters']({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0x9f')]];break;default:if(_0x24e826[_0xb00b('0x46')]){ut[_0xb00b('0x93')](_0x219b74,_0xb00b('0xd1'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x219b74[_0xb00b('0x33')],_0x248335);}_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut['logCustomer'](_0x24e826,0xc,_0x248335['cause-txt']||_0x248335[_0xb00b('0xcd')]);_0x3a0b90=_0x219b74[_0xb00b('0xc0')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];rpcDb['createCustomerHistory'](_0x24e826,_0xb00b('0xd2'));_0x598a55[_0xb00b('0x77')](_0x24e826,'20',_0x219b74)[_0xb00b('0x57')](function(_0x142674){_0x347949=_0x142674['additional']==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xd3'));}else{rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xd3'));}delete this['actions'][_0x248335[_0xb00b('0x9f')]];}else{_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});}});}if(!(_0x24e826[_0xb00b('0x46')]&&_0x4ba53a==='16')){ut[_0xb00b('0x4e')](_0x219b74,_0xb00b('0xd4'));logger[_0xb00b('0x41')](_0xb00b('0xd5'),_0x24e826['uniqueid'],_0xb00b('0x9d'),_0x219b74[_0xb00b('0x33')],_0xb00b('0x44'),_0x219b74[_0xb00b('0xd6')]);}if(_0x4ba53a!=='ANSWER'){delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0x9f')]];delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0xd7')]];}_0x219b74[_0xb00b('0xd8')]=!![];}};Preview[_0xb00b('0xd')][_0xb00b('0xd9')]=function(_0x3184de,_0x48ac4b,_0x5f0fab){if(_[_0xb00b('0xda')](_0x48ac4b)&&_0xb00b('0xdb')!==typeof _0x48ac4b){return;}if(_[_0xb00b('0xda')](_0x5f0fab)&&'object'!==typeof _0x5f0fab){return;}switch(_0x5f0fab[_0xb00b('0xdc')]){case'0':ut[_0xb00b('0xdd')](_0x3184de,0x0,_0xb00b('0x73'));rpcDb['createAgentHistory'](_0x3184de,_0xb00b('0xde'));break;case'3':ut[_0xb00b('0xdd')](_0x3184de,0x3,_0xb00b('0xdf'));rpcDb['createAgentHistory'](_0x3184de,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb00b('0xdd')](_0x3184de,0x5,'Busy');rpcDb[_0xb00b('0xe0')](_0x3184de,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x3184de,0x8,_0xb00b('0xb8'));rpcDb[_0xb00b('0xe0')](_0x3184de,_0xb00b('0xe1'));break;case'22':ut[_0xb00b('0xdd')](_0x3184de,0x16,_0xb00b('0xe2'));rpcDb['createAgentHistory'](_0x3184de,_0xb00b('0xe3'));break;default:ut['logAgent'](_0x3184de,0xc,_0x5f0fab['reason']);rpcDb[_0xb00b('0xe0')](_0x3184de,_0xb00b('0xe1'));}ut[_0xb00b('0x4e')](_0x48ac4b,_0xb00b('0xe4'));logger[_0xb00b('0x41')](_0xb00b('0xe5'),_0x3184de['uniqueid'],_0xb00b('0x9d'),_0x48ac4b['name'],_0xb00b('0x44'),_0x48ac4b[_0xb00b('0xd6')]);delete this[_0xb00b('0x13')][_0x3184de['uniqueid']];};Preview[_0xb00b('0xd')][_0xb00b('0x77')]=function(_0x20790f,_0x3dc8d2,_0x5d224c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x20790f,_0x3dc8d2,_0x5d224c)[_0xb00b('0x69')](logger['info']('[verifyAdditionalPhone]\x20'));};Preview[_0xb00b('0xd')]['swapAdditionalPhones']=function(_0x505ae2,_0x2fecca,_0x330bc7){return cmHopperAdditionalPhone[_0xb00b('0xaa')](_0x505ae2,_0x2fecca,_0x330bc7)[_0xb00b('0x69')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0xb00b('0xd')][_0xb00b('0x86')]=function(_0x9facaf){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xb00b('0x86')](_0x9facaf))['catch'](logger['info'](_0xb00b('0xe6')));};Preview['prototype'][_0xb00b('0xe7')]=function(_0x481671,_0x1b751e,_0x5712fd,_0x3de808,_0x3289aa){var _0x1ec560=this;return new Promise(function(_0x54498c,_0x442b28){if(_['isNil'](_0x1b751e)||_[_0xb00b('0x40')](_0x1b751e[_0xb00b('0xe8')])||_['isNil'](_0x1b751e['phone'])||_['isNil'](_0x1b751e['VoiceQueueId'])){_0x442b28(ut[_0xb00b('0x2e')]('Contact\x20is\x20undefined',_0x3de808,_0x3289aa));return;}var _0x134d17=uuid['v4']();var _0x5ad4d4=_0x1ec560[_0xb00b('0x22')][_0x1b751e[_0xb00b('0x42')][_0xb00b('0x33')]];var _0x44b2f1=_0x5712fd?_0x1ec560[_0xb00b('0x14')][_0x5712fd]['id']:undefined;_0x1ec560['actions'][_0x134d17]=new Action(_0x1b751e,_0x5ad4d4,_0x134d17,_0x5712fd,_0x44b2f1);var _0x8292fe=_0x1ec560[_0xb00b('0x13')][_0x134d17];_0x8292fe[_0xb00b('0x82')]=_0x3de808;_0x8292fe[_0xb00b('0x83')]=_0x3289aa;_0x8292fe['lookAgent']=_0x5712fd;if(_['isEmpty'](_0x481671)){_0x1ec560[_0xb00b('0xe9')](_0x8292fe,_0x5ad4d4,_0x1b751e,_0x5712fd)[_0xb00b('0x57')](function(_0x181393){logger[_0xb00b('0x41')](_0xb00b('0xea'),_0xb00b('0xeb')+_0x8292fe[_0xb00b('0x43')]+_0xb00b('0xec')+_0x8292fe[_0xb00b('0x85')],JSON['stringify'](_0x181393));ami[_0xb00b('0x23')](_0xb00b('0xed'),ut['buildObj'](_0x8292fe,_0xb00b('0xee'),_0x1ec560['campaignsPreview'][_0x8292fe[_0xb00b('0x43')]]));_0x54498c(ut[_0xb00b('0x2e')]('Calling'));})['catch'](function(_0x32264a){ut[_0xb00b('0x31')](_0xb00b('0xef'),_0x32264a);_0x442b28(ut['message'](_0xb00b('0xf0'),_0x3de808,_0x3289aa));});}else{_0x5ad4d4[_0xb00b('0xf1')]+=0x1;ut[_0xb00b('0xf2')](_0x8292fe);rpcDb['createHistory'](_0x8292fe,_0xb00b('0xf3'));delete _0x1ec560['actions'][_0x134d17];_0x442b28(ut['message']('Contact\x20in\x20black\x20List',_0x3de808,_0x3289aa));}});};Preview[_0xb00b('0xd')]['isTrunkReachable']=function(_0x1b8d45){return!_[_0xb00b('0x40')](_0x1b8d45)&&!_['isNil'](_0x1b8d45['name'])&&!_[_0xb00b('0x40')](_0x1b8d45[_0xb00b('0xf4')])&&_0x1b8d45['active']&&!_[_0xb00b('0x40')](this[_0xb00b('0x12')][util[_0xb00b('0x25')](_0xb00b('0xf5'),_0x1b8d45[_0xb00b('0x33')])])&&!_[_0xb00b('0x40')](this['trunks'][util[_0xb00b('0x25')](_0xb00b('0xf5'),_0x1b8d45['name'])][_0xb00b('0xf6')])&&(this['trunks'][util['format'](_0xb00b('0xf5'),_0x1b8d45['name'])][_0xb00b('0xf6')]===_0xb00b('0xf7')||this[_0xb00b('0x12')][util['format']('SIP/%s',_0x1b8d45['name'])][_0xb00b('0xf6')]===_0xb00b('0xf8'));};Preview['prototype'][_0xb00b('0xf9')]=function(_0x18e86f,_0x3aa8c0){return this[_0xb00b('0xfa')](_0x18e86f,_0x3aa8c0)[_0xb00b('0x57')](function(_0x166ff5){return _[_0xb00b('0xfb')](_0x166ff5,[_0xb00b('0x2e')]);})['catch'](function(_0x1b097a){if(_0x1b097a[_0xb00b('0xfc')]){rpcDb[_0xb00b('0xfd')](_0x18e86f);}if(_0x1b097a['active']){rpcDb['disableContact'](_0x18e86f);}throw _['pick'](_0x1b097a,[_0xb00b('0x2e')]);});};Preview[_0xb00b('0xd')][_0xb00b('0xfa')]=function(_0x4bc6df,_0x399902){var _0x34985d=this;var _0x2057d1,_0xdee547;return rpcDb[_0xb00b('0xfe')](_0x4bc6df)['then'](function(_0x1674ab){if(!_['isNil'](_0x1674ab[0x0])){_0xdee547=_0x1674ab[0x0][_0xb00b('0xff')]?![]:!![];_0x2057d1=_0x1674ab[0x0][_0xb00b('0xff')]?!![]:![];_0x2057d1=_0x399902?!![]:_0x2057d1;}var _0xde6b5=_0x34985d[_0xb00b('0x100')](_0x1674ab);if(_0xde6b5[_0xb00b('0x101')]){rpcDb[_0xb00b('0x102')](_['pick'](_0x1674ab[0x0],[_0xb00b('0x49'),_0xb00b('0x103')]))[_0xb00b('0x57')](function(_0x278d9e){_0x34985d[_0xb00b('0xe7')](_0x278d9e,_0x1674ab[0x0],_0x399902,_0xdee547,_0x2057d1)[_0xb00b('0x57')](function(_0x26cd15){return _0x26cd15;})[_0xb00b('0x69')](function(_0xd2f1ba){throw _0xd2f1ba;});})[_0xb00b('0x69')](function(_0x5f1258){ut[_0xb00b('0x31')](_0xb00b('0x104'),_0x5f1258);throw ut['message'](_0xb00b('0x105'),_0xdee547,_0x2057d1);});}else{throw ut['message'](_0xde6b5['message'],_0xdee547,_0x2057d1);}})['catch'](function(_0x384a16){ut['logger'](_0xb00b('0x106'),_0x384a16);throw ut[_0xb00b('0x2e')](_0xb00b('0x105'),![],!![]);});};Preview[_0xb00b('0xd')][_0xb00b('0x100')]=function(_0x116ced){if(_[_0xb00b('0x40')](_0x116ced)||_[_0xb00b('0x107')](_0x116ced)||!_[_0xb00b('0x40')](_0x116ced[0x0][_0xb00b('0x5b')])&&_[_0xb00b('0x40')](_0x116ced[0x0][_0xb00b('0x5b')][_0xb00b('0x33')])){ut[_0xb00b('0x31')]('[Preview][validateContact][Empty\x20Contact]',_0x116ced);return{'isValid':![],'message':_0xb00b('0x108')};}var _0x15f9cd=this[_0xb00b('0x22')][_0x116ced[0x0][_0xb00b('0x42')][_0xb00b('0x33')]];_0x15f9cd['message']=utils[_0xb00b('0x2f')][_0xb00b('0x6f')];if(_['isNil'](_0x15f9cd)){ut['logger'](_0xb00b('0x109'),_0x15f9cd);return{'isValid':![],'message':_0xb00b('0x10a')};}if(!this[_0xb00b('0x6c')](_0x15f9cd[_0xb00b('0x10b')])){ut[_0xb00b('0x31')](_0xb00b('0x10c'),_0xb00b('0x10d')+_0x15f9cd[_0xb00b('0x33')]+_0xb00b('0x10e'));if(!this[_0xb00b('0x6c')](_0x15f9cd[_0xb00b('0x6d')])){ut['logger'](_0xb00b('0x10c'),_0x15f9cd['name']+_0xb00b('0x10f'));return{'isValid':![],'message':_0xb00b('0x110')};}}if(!ut[_0xb00b('0x111')](_0x15f9cd[_0xb00b('0x3b')])){ut[_0xb00b('0x31')](_0xb00b('0x112'),_0x15f9cd['name']+_0xb00b('0x113'));return{'isValid':![],'message':_0xb00b('0x10d')+_0x15f9cd[_0xb00b('0x33')]+_0xb00b('0x113')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xb00b('0xd')][_0xb00b('0xe9')]=function(_0x58dbf6,_0x199ba1,_0x16cca9,_0x3c57b2){var _0xca4a87=this;return new Promise(function(_0x456515,_0x26145a){var _0x31fa5b=_0x58dbf6[_0xb00b('0x9c')];var _0x1ba141=_0xca4a87['isTrunkReachable'](_0x199ba1[_0xb00b('0x10b')])?util[_0xb00b('0x25')]('SIP/%s/%s%s',_0x199ba1[_0xb00b('0x10b')][_0xb00b('0x33')],_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x114')])?'':_0x199ba1[_0xb00b('0x114')][_0xb00b('0x115')]()||'',_0x199ba1[_0xb00b('0x116')]>0x0?_0x16cca9[_0xb00b('0x103')][_0xb00b('0x117')](_0x199ba1[_0xb00b('0x116')]):_0x16cca9[_0xb00b('0x103')]):util['format'](_0xb00b('0x118'),_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x6d')])?_0x199ba1['Trunk'][_0xb00b('0x33')]:_0x199ba1[_0xb00b('0x6d')][_0xb00b('0x33')],_[_0xb00b('0x40')](_0x199ba1['dialPrefix'])?'':_0x199ba1[_0xb00b('0x114')][_0xb00b('0x115')]()||'',_0x199ba1['dialCutDigit']>0x0?_0x16cca9['phone'][_0xb00b('0x117')](_0x199ba1[_0xb00b('0x116')]):_0x16cca9['phone']);var _0x1256a8=_0xca4a87['isTrunkReachable'](_0x199ba1['Trunk'])?ut[_0xb00b('0x119')](_0x199ba1['Trunk']['callerid'],_0x199ba1[_0xb00b('0x11a')],_0x199ba1[_0xb00b('0x11b')]>0x0?ut[_0xb00b('0x11c')](_0x199ba1[_0xb00b('0x11d')],_0x199ba1[_0xb00b('0x11b')]):_0x199ba1[_0xb00b('0x11d')]):ut[_0xb00b('0x119')](_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x6d')])?_0x199ba1[_0xb00b('0x10b')][_0xb00b('0x11e')]:_0x199ba1[_0xb00b('0x6d')][_0xb00b('0x11e')],_0x199ba1[_0xb00b('0x11a')],_0x199ba1['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb00b('0x11c')](_0x199ba1[_0xb00b('0x11d')],_0x199ba1['dialRandomLastDigitCallerIdNumber']):_0x199ba1[_0xb00b('0x11d')]);if(_0x1256a8){_0x58dbf6['originatecalleridname']=ut[_0xb00b('0x11f')](_0x1256a8);_0x58dbf6[_0xb00b('0x120')]=ut[_0xb00b('0x121')](_0x1256a8);}var _0x5657ee=ut[_0xb00b('0x122')](_0x199ba1,_0x16cca9,_0x1ba141,_0x1256a8,_0x31fa5b,_0x58dbf6);_[_0xb00b('0x123')](_0x58dbf6,ut['toLowerVariables'](_0x5657ee));_0x58dbf6[_0xb00b('0x60')]=moment()[_0xb00b('0x25')](_0xb00b('0x88'));_0x199ba1[_0xb00b('0x124')]=_0x5657ee;var _0x57bfab=ut[_0xb00b('0x125')](_0x58dbf6,_0x199ba1,_0x5657ee,_0x58dbf6[_0xb00b('0x83')],_0x3c57b2);return ami[_0xb00b('0x4b')](_0x57bfab)['then'](function(_0x571811){_0x199ba1['originated']+=0x1;logger[_0xb00b('0x41')](_0xb00b('0x126'),_0x31fa5b,_0xb00b('0x9d'),_0x199ba1[_0xb00b('0x33')],_0xb00b('0x44'),_0x199ba1[_0xb00b('0xd6')]);_0x456515(_0x571811);})[_0xb00b('0x69')](function(_0x39b4c6){ut[_0xb00b('0xdd')](_0x58dbf6,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x58dbf6,_0xb00b('0x127'));_0x26145a(_0x39b4c6);});});};Preview[_0xb00b('0xd')]['syncNewExten']=function(_0x42fdce){if(this['actions'][_0x42fdce[_0xb00b('0x9f')]]){this['actions'][_0x42fdce[_0xb00b('0x9f')]][_0xb00b('0x4c')]=_0x42fdce['channel'];}};Preview[_0xb00b('0xd')][_0xb00b('0x16')]=function(_0x5573c9){var _0x44767a=this;var _0x4d4dbe=this[_0xb00b('0x13')][_0x5573c9[_0xb00b('0x128')]];if(_0x4d4dbe){if(_0x4d4dbe[_0xb00b('0x129')]&&this[_0xb00b('0x14')][_0x4d4dbe[_0xb00b('0x129')]]){ut[_0xb00b('0x12a')](_0x4d4dbe,this[_0xb00b('0x14')][_0x4d4dbe[_0xb00b('0x129')]][_0xb00b('0x33')],this[_0xb00b('0x14')][_0x4d4dbe['lookAgent']]['id']);}var _0x4cff99=_[_0xb00b('0x12b')](_0x4d4dbe);_0x4cff99['responsetime']=moment()[_0xb00b('0x25')]('YYYY-MM-DD\x20HH:mm:ss');var _0x198536=_0x44767a[_0xb00b('0x22')][_0x4d4dbe['queue']];if(ut[_0xb00b('0x12c')](_0x5573c9['response'])){if(_0x4d4dbe[_0xb00b('0x82')]){rpcDb[_0xb00b('0xfd')](_0x4d4dbe['idContact']);}if(_0x4d4dbe[_0xb00b('0x83')]){rpcDb[_0xb00b('0x5f')](_0x4d4dbe[_0xb00b('0x85')]);}ami[_0xb00b('0x23')](_0xb00b('0x12d'),ut['buildObj'](_0x4d4dbe,_0xb00b('0x12e'),this[_0xb00b('0x22')][_0x4d4dbe['queue']]));this['callProgressDetectingAgent'](_0x4cff99,_0x198536,_0x5573c9);}else{_0x4d4dbe[_0xb00b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x4cff99,0x4,_0xb00b('0x12f'));rpcDb[_0xb00b('0xe0')](_0x4cff99,_0xb00b('0x130'));}}};Preview[_0xb00b('0xd')]['syncHangup']=function(_0xcaefbd){var _0x482fc4=this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]];var _0x22f2f6;if(_0x482fc4){_0x22f2f6=this[_0xb00b('0x22')][_0x482fc4['queue']];logger[_0xb00b('0x41')](_0xb00b('0x131'),_0xcaefbd['linkedid'],_0xb00b('0x9d'),_0x22f2f6[_0xb00b('0x33')],_0xb00b('0x9e'),_0x22f2f6['pTalking']);}if(this['actions'][_0xcaefbd[_0xb00b('0x9f')]]&&_0xcaefbd[_0xb00b('0x9f')]!==_0xcaefbd[_0xb00b('0x9c')]){if(_0xcaefbd[_0xb00b('0x132')]==='16'&&this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]][_0xb00b('0x46')]){this['callProgressDetectingCustomer'](_0xcaefbd,_0xcaefbd['linkedid'],_0xcaefbd[_0xb00b('0x132')]);}else if(this['actions'][_0xcaefbd['linkedid']][_0xb00b('0x46')]){logger[_0xb00b('0x41')]('[syncHangup][talking][cause]',_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')],_0xb00b('0x9d'),_0x22f2f6['name'],_0xb00b('0x9e'),_0x22f2f6[_0xb00b('0x29')]);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')]);}}else if(_0x482fc4&&_[_0xb00b('0x40')](_0x482fc4[_0xb00b('0x134')])&&_0x22f2f6['dialQueueProject']&&_0xcaefbd[_0xb00b('0x9f')]===_0xcaefbd[_0xb00b('0x9c')]&&_['isNil'](_0xcaefbd['reason'])&&_0xcaefbd['cause']==='16'&&_0xcaefbd[_0xb00b('0x135')]==='6'&&_[_0xb00b('0xda')](_0x482fc4[_0xb00b('0x136')])){if(_0x482fc4[_0xb00b('0x82')]){rpcDb[_0xb00b('0xfd')](_0x482fc4[_0xb00b('0x85')]);}if(_0x482fc4[_0xb00b('0x83')]){rpcDb['disableContact'](_0x482fc4['idContact']);}_0xcaefbd[_0xb00b('0xdc')]='22';this[_0xb00b('0xd9')](_0x482fc4,_0x22f2f6,_0xcaefbd);}else if(_0x482fc4&&_0x482fc4['transfer']){if(_0xcaefbd[_0xb00b('0x132')]==='16'&&this[_0xb00b('0x13')][_0xcaefbd['linkedid']][_0xb00b('0x46')]){logger['info'](_0xb00b('0x137'),_0xcaefbd['linkedid'],_0xcaefbd['cause'],'\x20Queue',_0x22f2f6[_0xb00b('0x33')],_0xb00b('0x9e'),_0x22f2f6[_0xb00b('0x29')]);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd['linkedid'],_0xcaefbd[_0xb00b('0x132')]);}else if(this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]][_0xb00b('0x46')]){logger[_0xb00b('0x41')](_0xb00b('0x138'),_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')],_0xb00b('0x9d'),_0x22f2f6[_0xb00b('0x33')],'pTalking:\x20',_0x22f2f6['pTalking']);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')]);}}};Preview[_0xb00b('0xd')][_0xb00b('0x1a')]=function(_0x1e0206){if(this[_0xb00b('0x13')][_0x1e0206[_0xb00b('0xd7')]]&&_0x1e0206[_0xb00b('0xd7')]!==_0x1e0206['destuniqueid']){this[_0xb00b('0x133')](_0x1e0206,_0x1e0206[_0xb00b('0xd7')],_0x1e0206[_0xb00b('0xcd')]);}};Preview[_0xb00b('0xd')]['syncHangupRequest']=function(_0x45ad1f){if(this[_0xb00b('0x13')][_0x45ad1f[_0xb00b('0x9f')]]&&_0x45ad1f[_0xb00b('0x9f')]!==_0x45ad1f[_0xb00b('0x9c')]&&!this[_0xb00b('0x13')][_0x45ad1f[_0xb00b('0x9f')]][_0xb00b('0x46')]){if(_0x45ad1f[_0xb00b('0x132')]==='1'){this['callProgressDetectingCustomer'](_0x45ad1f,_0x45ad1f['linkedid'],_0x45ad1f[_0xb00b('0x132')]);}}};Preview[_0xb00b('0xd')][_0xb00b('0x139')]=function(_0x121451,_0x2e9604,_0x19fce8){if(this[_0xb00b('0x13')][_0x121451]){if(_['isNil'](this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')])){this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')]={};}this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')][_0x2e9604]=_0x19fce8;}};Preview['prototype'][_0xb00b('0x13a')]=function(_0x1ec1c7){try{if(!_['isNil'](_0x1ec1c7)){if(ut[_0xb00b('0x13b')](_[_0xb00b('0x13c')](_0x1ec1c7[_0xb00b('0x13d')])[0x0])){this[_0xb00b('0x139')](_0x1ec1c7[_0xb00b('0x9c')],_[_0xb00b('0x13c')](_0x1ec1c7['variable'])[0x0],_0x1ec1c7['value']);}}}catch(_0x465238){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x465238,{'showHidden':![],'depth':null}));}};Preview[_0xb00b('0xd')][_0xb00b('0x1f')]=function(_0x5a400c){if(_0x5a400c){if(this['actions'][_0x5a400c[_0xb00b('0x13e')]]){this[_0xb00b('0x13')][_0x5a400c[_0xb00b('0x13e')]][_0xb00b('0x136')]=!![];}}};Preview[_0xb00b('0xd')][_0xb00b('0x21')]=function(_0x3fd141){if(_0x3fd141){if(this[_0xb00b('0x13')][_0x3fd141[_0xb00b('0x13f')]]){this[_0xb00b('0x13')][_0x3fd141[_0xb00b('0x13f')]]['transfer']=!![];}}};module[_0xb00b('0x140')]=Preview; \ No newline at end of file +var _0x54ef=['DEACTIVATED','\x20is\x20deactivated','syncCampaigns','campaignsPreview','hasOwnProperty','dialMethod','booked','type','clearZombieChannels','outbound','recallMe','clearZombieChannel','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','dialActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','buildObj','custom:agentConnectPreview','custom:agentcomplete','complete','total','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','incrementPreviewCounters','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','additional','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','cause-txt','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','isNil','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','variablesAction','[originateFailure][logOriginateFailure]','logLookAgent','clone','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','keys','variable','error','transfertargetlinkedid','transfer','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','../dialer/utils','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20'];(function(_0x4e2aed,_0x29773b){var _0x591983=function(_0x4a8fd4){while(--_0x4a8fd4){_0x4e2aed['push'](_0x4e2aed['shift']());}};_0x591983(++_0x29773b);}(_0x54ef,0x112));var _0xf54e=function(_0x13a660,_0x41a343){_0x13a660=_0x13a660-0x0;var _0x323095=_0x54ef[_0x13a660];return _0x323095;};'use strict';var util=require(_0xf54e('0x0'));var _=require(_0xf54e('0x1'));var uuid=require(_0xf54e('0x2'));var moment=require('moment');var Redis=require(_0xf54e('0x3'));var config=require(_0xf54e('0x4'));var logger=require(_0xf54e('0x5'))(_0xf54e('0x6'));var loggerAction=require(_0xf54e('0x5'))(_0xf54e('0x7'));var ami=require(_0xf54e('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xf54e('0x9'));var ut=require(_0xf54e('0xa'));var utils=require(_0xf54e('0xb'));config['redis']=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var io=require(_0xf54e('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf54e('0xf')][_0xf54e('0x10')]=function(_0x6b9e61){this[_0xf54e('0x11')]=this['tail']?this[_0xf54e('0x11')][_0xf54e('0x12')](_0x6b9e61):_0x6b9e61();};function Preview(_0x143d66){this[_0xf54e('0x13')]=new Sequence();this['campaignsPreview']=_0x143d66[_0xf54e('0x14')];this['trunks']=_0x143d66['trunks'];this[_0xf54e('0x15')]={};this[_0xf54e('0x16')]=_0x143d66[_0xf54e('0x16')];this[_0xf54e('0x17')]=0x0;ami['on']('originateresponse',this[_0xf54e('0x18')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x1a'),this[_0xf54e('0x1b')]['bind'](this));ami['on'](_0xf54e('0x1c'),this[_0xf54e('0x1d')][_0xf54e('0x19')](this));ami['on']('dialend',this['syncDialEnd'][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x1e'),this[_0xf54e('0x1f')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x20'),this[_0xf54e('0x21')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x22'),this[_0xf54e('0x23')][_0xf54e('0x19')](this));ami['on'](_0xf54e('0x24'),this['syncBlindTransfer']['bind'](this));this[_0xf54e('0x25')](this['campaignsPreview']);}function emit(_0x3e1556,_0x1bfe99,_0x106362){io['to'](_0x3e1556)[_0xf54e('0x26')](_0x1bfe99,_0x106362);}function emitVoiceQueueChannelRemove(_0xf64f12){logger[_0xf54e('0x27')](_0xf54e('0x28'),JSON[_0xf54e('0x29')](_0xf64f12));emit(util[_0xf54e('0x2a')](_0xf54e('0x2b'),_0xf64f12[_0xf54e('0x2c')]),'voice_queue_channel:remove',_0xf64f12);io[_0xf54e('0x26')]('voice_queue_presence:remove',_0xf64f12);}function notSendMessagesQueue(_0x264a8f){if(_0x264a8f[_0xf54e('0x2d')]){if(_0x264a8f[_0xf54e('0x2e')]===0x0&&_0x264a8f[_0xf54e('0x2f')]===0x0){_0x264a8f[_0xf54e('0x2d')]=![];_0x264a8f[_0xf54e('0x30')]=0x0;_0x264a8f[_0xf54e('0x31')]=0x0;_0x264a8f[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x34')];ut[_0xf54e('0x35')](_0xf54e('0x36'),_0x264a8f[_0xf54e('0x2c')]+'\x20is\x20not\x20active');}else{_0x264a8f[_0xf54e('0x32')]=utils['CAMPAIGN_STATUS'][_0xf54e('0x37')];ut['logger'](_0xf54e('0x36'),_0x264a8f[_0xf54e('0x2c')]+_0xf54e('0x38'));}}}Preview[_0xf54e('0xf')][_0xf54e('0x25')]=function(){var _0x3993e4=this;setInterval(function(){_0x3993e4[_0xf54e('0x39')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x2f96b1=this[_0xf54e('0x3a')];this[_0xf54e('0x17')]+=0x1;for(var _0x16d00f in _0x2f96b1){if(_0x2f96b1[_0xf54e('0x3b')](_0x16d00f)&&(_0x2f96b1[_0x16d00f][_0xf54e('0x3c')]===_0xf54e('0x6')||_0x2f96b1[_0x16d00f][_0xf54e('0x3c')]===_0xf54e('0x3d'))&&_0x2f96b1[_0x16d00f][_0xf54e('0x3e')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0xf54e('0x17')]=0x0;this[_0xf54e('0x3f')]();}}if(_0x2f96b1['hasOwnProperty'](_0x16d00f)&&_0x2f96b1[_0x16d00f][_0xf54e('0x3c')]===_0xf54e('0x6')&&_0x2f96b1[_0x16d00f][_0xf54e('0x3e')]===_0xf54e('0x40')){if(_0x2f96b1[_0x16d00f]['dialActive']){this['setMessage'](_0x2f96b1[_0x16d00f]);if(_0x2f96b1[_0x16d00f]['dialPreviewAutoRecallMe'])this[_0xf54e('0x41')](_0x2f96b1[_0x16d00f]);}else{notSendMessagesQueue(_0x2f96b1[_0x16d00f]);}}}};Preview[_0xf54e('0xf')][_0xf54e('0x42')]=function(_0x399e68){var _0x29dc39=this;this[_0xf54e('0x13')]['enqueue'](function(){if(!_['isNil'](_0x29dc39['actions'][_0x399e68])){loggerAction[_0xf54e('0x27')](_0xf54e('0x43'),_0x399e68,'Queue',_0x29dc39['actions'][_0x399e68][_0xf54e('0x44')],_0xf54e('0x45'),JSON[_0xf54e('0x29')](_0x29dc39['campaignsPreview'][_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]]['originated']),_0xf54e('0x46'),JSON[_0xf54e('0x29')](_0x29dc39[_0xf54e('0x3a')][_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]][_0xf54e('0x2f')]),JSON['stringify'](_0x29dc39['actions'][_0x399e68][_0xf54e('0x47')]),JSON[_0xf54e('0x29')](_[_0xf54e('0x48')](_0x29dc39['actions'][_0x399e68],[_0xf54e('0x49'),_0xf54e('0x4a'),_0xf54e('0x4b'),_0xf54e('0x4c')])));return ami[_0xf54e('0x4d')]({'action':_0xf54e('0x4e'),'channel':_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x4f')]})[_0xf54e('0x50')](function(_0x2087b3){if(_0x2087b3[_0xf54e('0x32')]===_0xf54e('0x51')){setTimeout(function(){if(_0x29dc39[_0xf54e('0x15')][_0x399e68]){ut[_0xf54e('0x52')](_0x29dc39[_0xf54e('0x3a')][_0x29dc39['actions'][_0x399e68]['queue']],'[clearZombieChannel]');if(_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x47')]===!![]){ut['decrementTalkink'](_0x29dc39[_0xf54e('0x3a')][_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]],'[clearZombieChannel]');ut[_0xf54e('0x53')](_0xf54e('0x54')+_0x399e68,_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]);}ut[_0xf54e('0x53')](_0xf54e('0x55')+_0x399e68,_0x29dc39[_0xf54e('0x15')][_0x399e68][_0xf54e('0x44')]);delete _0x29dc39[_0xf54e('0x15')][_0x399e68];}},0x2328);}});}});};Preview['prototype'][_0xf54e('0x3f')]=function(){var _0x3447fd=this;loggerAction[_0xf54e('0x27')](_0xf54e('0x56'),_[_0xf54e('0x57')](this[_0xf54e('0x15')]));for(var _0x52c47d in this[_0xf54e('0x15')]){if(_0x3447fd['actions'][_0xf54e('0x3b')](_0x52c47d)){_0x3447fd['clearZombieChannel'](_0x52c47d);}}};Preview[_0xf54e('0xf')][_0xf54e('0x41')]=function(_0x2e08b4){var _0x57371d=this;rpcDb[_0xf54e('0x58')](_0x2e08b4['id'],ut[_0xf54e('0x59')](this[_0xf54e('0x16')]))[_0xf54e('0x5a')](function(_0x3a5a87){if(!_['isNil'](_0x3a5a87)){for(var _0x427799=0x0;_0x427799<_0x3a5a87[_0xf54e('0x5b')];_0x427799+=0x1){if(ut[_0xf54e('0x5c')](_0x3a5a87[_0x427799][_0xf54e('0x5d')])<_0x2e08b4['dialRecallMeTimeout']*0x3c){if(_0x3a5a87[_0x427799][_0xf54e('0x5e')]&&!_0x3a5a87[_0x427799][_0xf54e('0x5e')]['voicePause']){_0x57371d[_0xf54e('0x5f')](_0x3a5a87[_0x427799]['id'])[_0xf54e('0x5a')](ut[_0xf54e('0x60')](_0xf54e('0x61')))['catch'](ut[_0xf54e('0x60')](_0xf54e('0x61')));}else{rpcDb[_0xf54e('0x62')](_0x3a5a87[_0x427799]['id']);}}else{var _0xb4654f=new Action(_0x3a5a87[_0x427799],_0x2e08b4);_0xb4654f[_0xf54e('0x63')]=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));_0x2e08b4[_0xf54e('0x65')]+=0x1;ut[_0xf54e('0x66')](_0xb4654f,0x17,_0xf54e('0x67'));if(_0x2e08b4[_0xf54e('0x68')]){rpcDb[_0xf54e('0x69')](ut[_0xf54e('0x6a')](_0x3a5a87[_0x427799]));rpcDb[_0xf54e('0x6b')](_0xb4654f,_0xf54e('0x6c'));}else{ut[_0xf54e('0x66')](_0xb4654f,0x16,_0xf54e('0x6d'));rpcDb[_0xf54e('0x6b')](_0xb4654f,_0xf54e('0x6e'));rpcDb[_0xf54e('0x6f')](_0xb4654f,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xf54e('0x60')](_0xf54e('0x70')));};Preview[_0xf54e('0xf')][_0xf54e('0x71')]=function(_0xba297c){_0xba297c[_0xf54e('0x2d')]=!![];if(ut[_0xf54e('0x72')](_0xba297c[_0xf54e('0x73')])){_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x74')];}else if(!ut['isActive'](_0xba297c[_0xf54e('0x75')])){_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x34')];}else if(!this[_0xf54e('0x76')](_0xba297c[_0xf54e('0x77')])){if(!this[_0xf54e('0x76')](_0xba297c['TrunkBackup'])){_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x78')];}else{_0xba297c['message']=utils[_0xf54e('0x33')]['ACTIVE'];}}else{_0xba297c[_0xf54e('0x32')]=utils[_0xf54e('0x33')][_0xf54e('0x79')];}};Preview['prototype'][_0xf54e('0x7a')]=function(_0x30d10d,_0x2096e5,_0x4e5059){var _0x3744a4=this;var _0x2ec72a=this[_0xf54e('0x15')][_0x2096e5];var _0x55d57f=this['campaignsPreview'][_0x2ec72a[_0xf54e('0x44')]];var _0x9ab4c4;var _0x4f17dd=![];var _0x29743e=0x2;var _0x49fd97=0x3;if(_0x55d57f){switch(_0x4e5059){case'1':_0x55d57f[_0xf54e('0x7b')]+=0x1;_0x2ec72a['countnosuchnumberretry']+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x0,_0xf54e('0x7e'));ami[_0xf54e('0x26')](_0xf54e('0x7f'),ut['buildObj'](_0x2ec72a,'nosuchnumber'));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0x80'));_0x3744a4['verifyAdditionalPhones'](_0x2ec72a,'0',_0x55d57f)['then'](function(_0x2a5e54){_0x4f17dd=_0x2a5e54['additional']==0x1;_0x29743e=_0x55d57f[_0xf54e('0x81')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0x86'));}else{if(_0x2ec72a[_0xf54e('0x87')]>=_0x55d57f[_0xf54e('0x88')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0x86'));}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,'countnosuchnumberretry',_0x55d57f[_0xf54e('0x81')]),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a[_0xf54e('0x8c')]);}}delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];}else{_0x2ec72a['countnosuchnumberretry']++;logger[_0xf54e('0x27')](_0xf54e('0x8e'),_0x2ec72a['countnosuchnumberretry']);logger['info']('id',_0x2ec72a[_0xf54e('0x8f')]);_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnosuchnumberretry':_0x2ec72a[_0xf54e('0x87')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)['then'](function(){});});}});break;case _0xf54e('0x91'):var _0x5cdb8c=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));_0x2ec72a[_0xf54e('0x92')]=_0x5cdb8c;_0x2ec72a['answertime']=_0x5cdb8c;_0x2ec72a[_0xf54e('0x47')]=!![];_0x55d57f['pTalking']+=0x1;logger[_0xf54e('0x27')](_0xf54e('0x93'),_0x2ec72a['uniqueid'],_0xf54e('0x94'),_0x55d57f['name'],_0xf54e('0x46'),_0x55d57f[_0xf54e('0x2f')]);ami[_0xf54e('0x26')](_0xf54e('0x95'),ut[_0xf54e('0x96')](_0x2ec72a,'connect',this[_0xf54e('0x3a')][_0x2ec72a[_0xf54e('0x44')]]));if(_0x55d57f['acw']){ami[_0xf54e('0x26')](_0xf54e('0x97'),ut['buildAcw'](_0x2ec72a));}break;case'16':ami[_0xf54e('0x26')](_0xf54e('0x98'),ut[_0xf54e('0x96')](_0x2ec72a,'complete',this[_0xf54e('0x3a')][_0x2ec72a['queue']]));emitVoiceQueueChannelRemove(ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0x99')));_0x55d57f['outboundAnswerCallsDay']+=0x1;_0x55d57f[_0xf54e('0x9a')]+=0x1;_0x55d57f[_0xf54e('0x9b')]+=0x1;ut[_0xf54e('0x9c')](_0x55d57f,_0xf54e('0x9d'));_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x4,_0xf54e('0x9e'));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0x9f'));rpcDb[_0xf54e('0x6f')](_0x2ec72a,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf54e('0xa0')](_0x2ec72a);_0x55d57f[_0xf54e('0xa1')]+=_0x2ec72a[_0xf54e('0xa2')];_0x55d57f['sumBillable']+=_0x2ec72a[_0xf54e('0xa2')];logger[_0xf54e('0x27')](_0xf54e('0xa3'),_0x2ec72a[_0xf54e('0xa4')],_0xf54e('0x94'),_0x55d57f[_0xf54e('0x2c')],_0xf54e('0x46'),_0x55d57f['pTalking']);delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];break;case _0xf54e('0xa5'):_0x55d57f['outboundBusyCallsDay']+=0x1;_0x2ec72a[_0xf54e('0xa6')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x5,'Busy');_0x29743e=_0x55d57f['dialBusyRetryFrequency'];_0x49fd97=_0x55d57f[_0xf54e('0x82')];ami[_0xf54e('0x26')](_0xf54e('0xa7'),ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xa8')));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0xa9'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'5',_0x55d57f)[_0xf54e('0x5a')](function(_0x205b47){_0x4f17dd=_0x205b47['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb['createCustomerFinal'](_0x9ab4c4,_0xf54e('0xab'));}else{if(_0x2ec72a[_0xf54e('0xa6')]>=_0x55d57f[_0xf54e('0xac')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xa6'),_0x55d57f['dialBusyRetryFrequency']),_0x2ec72a['unlockAgent'],_0x2ec72a[_0xf54e('0x8c')]);}}}else{_0x2ec72a[_0xf54e('0xa6')]++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countbusyretry':_0x2ec72a[_0xf54e('0xa6')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case _0xf54e('0xae'):_0x55d57f['outboundNoAnswerCallsDay']+=0x1;_0x2ec72a[_0xf54e('0xaf')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x3,_0xf54e('0xb0'));_0x29743e=_0x55d57f[_0xf54e('0xb1')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];var _0x9a8f4f=ut[_0xf54e('0xb2')](_0x2ec72a,_0x55d57f);ami[_0xf54e('0x26')](_0xf54e('0xb3'),_0x9a8f4f);rpcDb[_0xf54e('0x6b')](_0x2ec72a,'[callProgressDetectingCustomer][logNoAnswer]');_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'3',_0x55d57f)[_0xf54e('0x5a')](function(_0x59acbc){_0x4f17dd=_0x59acbc['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xb4'));}else{if(_0x2ec72a[_0xf54e('0xaf')]>=_0x55d57f[_0xf54e('0xb5')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xaf'),_0x55d57f['dialNoAnswerRetryFrequency']),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a['activeContact']);}}}else{_0x2ec72a[_0xf54e('0xaf')]++;_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})['then'](function(){_0x3744a4['swapAdditionalPhones'](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case _0xf54e('0xb6'):_0x55d57f[_0xf54e('0xb7')]+=0x1;_0x2ec72a[_0xf54e('0xb8')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut['totalGlobal'](_0x2ec72a);ut['logCustomer'](_0x2ec72a,0x8,_0xf54e('0xb9'));_0x29743e=_0x55d57f[_0xf54e('0xba')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];ami[_0xf54e('0x26')](_0xf54e('0xbb'),ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xbc')));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0xbd'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'8',_0x55d57f)['then'](function(_0x31e699){_0x4f17dd=_0x31e699[_0xf54e('0xbe')]==0x1;if(!_0x4f17dd){if(ut['totalGlobal'](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xbf'));}else{if(_0x2ec72a[_0xf54e('0xb8')]>=_0x55d57f['dialCongestionMaxRetry']){rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0xbd'));}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,'countcongestionretry',_0x55d57f[_0xf54e('0xc0')]),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a[_0xf54e('0x8c')]);}}}else{_0x2ec72a[_0xf54e('0xb8')]++;_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countcongestionretry':_0x2ec72a[_0xf54e('0xb8')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case'CANCEL':_0x55d57f[_0xf54e('0xc1')]+=0x1;_0x2ec72a['countagentrejectretry']+=0x1;_0x2ec72a['countglobal']=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x14,_0xf54e('0xc2'));_0x29743e=_0x55d57f[_0xf54e('0xc3')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];ami[_0xf54e('0x26')](_0xf54e('0xc4'),ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xc5')));rpcDb['createCustomerHistory'](_0x2ec72a,_0xf54e('0xc6'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'20',_0x55d57f)[_0xf54e('0x5a')](function(_0x971a3e){_0x4f17dd=_0x971a3e[_0xf54e('0xbe')]==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0x14,_0xf54e('0xc2'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xc7'));}else{if(_0x2ec72a[_0xf54e('0xc8')]>=_0x55d57f[_0xf54e('0xc9')]){rpcDb['createCustomerFinal'](_0x2ec72a,_0xf54e('0xc7'));}else{rpcDb[_0xf54e('0x89')](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xc8'),_0x55d57f['dialAgentRejectRetryFrequency']),_0x2ec72a['unlockAgent'],_0x2ec72a[_0xf54e('0x8c')]);}}}else{_0x2ec72a[_0xf54e('0xaf')]++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4['swapAdditionalPhones'](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case _0xf54e('0xca'):_0x55d57f[_0xf54e('0xcb')]+=0x1;_0x2ec72a[_0xf54e('0xcc')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut['logCustomer'](_0x2ec72a,0xb,_0xf54e('0xcd'));rpcDb['createCustomerHistory'](_0x2ec72a,_0xf54e('0xce'));_0x3744a4['verifyAdditionalPhones'](_0x2ec72a,'11',_0x55d57f)[_0xf54e('0x5a')](function(_0x27c584){_0x4f17dd=_0x27c584[_0xf54e('0xbe')]==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut['cloneAction'](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2ec72a[_0xf54e('0xcf')]>=_0x55d57f[_0xf54e('0xd0')]){rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0xce'));}else{rpcDb['rescheduleContact'](ut[_0xf54e('0x8a')](_0x2ec72a,_0xf54e('0xcc'),_0x55d57f['dialAbandonedRetryFrequency']),_0x2ec72a[_0xf54e('0x8b')],_0x2ec72a['activeContact']);}}}else{_0x2ec72a['countnoanswerretry']++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a['idContact'],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});break;case'18':_0x55d57f[_0xf54e('0xd1')]+=0x1;_0x2ec72a['countmachineretry']+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0x12,_0x30d10d[_0xf54e('0xd2')]||_0x30d10d['dialstatus']);ami[_0xf54e('0x26')]('custom:amd',ut[_0xf54e('0x96')](_0x2ec72a,_0xf54e('0xd3')));rpcDb['createCustomerHistory'](_0x2ec72a,_0xf54e('0xd4'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'18',_0x55d57f)[_0xf54e('0x5a')](function(_0x23a151){_0x4f17dd=_0x23a151['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f[_0xf54e('0x83')]){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0x12,'Global');rpcDb['createCustomerFinal'](_0x9ab4c4,_0xf54e('0xd4'));}else{rpcDb['createCustomerFinal'](_0x2ec72a,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x2ec72a['countnoanswerretry']++;_0x3744a4[_0xf54e('0xad')]({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];break;case'19':_0x55d57f[_0xf54e('0xd1')]+=0x1;_0x2ec72a['countglobal']=ut[_0xf54e('0x7d')](_0x2ec72a);ut['logCustomer'](_0x2ec72a,0x13,_0x30d10d[_0xf54e('0xd2')]||_0x30d10d[_0xf54e('0xd5')]);ami['emit'](_0xf54e('0xd6'),ut['buildObj'](_0x2ec72a,_0xf54e('0xd3')));rpcDb[_0xf54e('0x6b')](_0x2ec72a,_0xf54e('0xd7'));_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'18',_0x55d57f)[_0xf54e('0x5a')](function(_0x3c499e){_0x4f17dd=_0x3c499e['additional']==0x1;if(!_0x4f17dd){if(ut['totalGlobal'](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,'Global');rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xd7'));}else{rpcDb[_0xf54e('0x6f')](_0x2ec72a,_0xf54e('0xd7'));}}else{_0x2ec72a[_0xf54e('0xaf')]++;_0x3744a4['incrementPreviewCounters']({'id':_0x2ec72a[_0xf54e('0x8f')],'field':{'countnoanswerretry':_0x2ec72a[_0xf54e('0xaf')]}})[_0xf54e('0x5a')](function(){_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});});}});delete this[_0xf54e('0x15')][_0x30d10d['linkedid']];break;default:if(_0x2ec72a[_0xf54e('0x47')]){ut[_0xf54e('0x9c')](_0x55d57f,_0xf54e('0xd8'));ut[_0xf54e('0x53')](_0xf54e('0xd9')+_0x55d57f['name'],_0x30d10d);}_0x55d57f[_0xf54e('0xd1')]+=0x1;_0x2ec72a[_0xf54e('0x7c')]=ut[_0xf54e('0x7d')](_0x2ec72a);ut[_0xf54e('0x66')](_0x2ec72a,0xc,_0x30d10d[_0xf54e('0xd2')]||_0x30d10d[_0xf54e('0xd5')]);_0x29743e=_0x55d57f[_0xf54e('0xc3')];_0x49fd97=_0x55d57f[_0xf54e('0x82')];rpcDb[_0xf54e('0x6b')](_0x2ec72a,'[callProgressDetectingCustomer][logUnknown]');_0x3744a4[_0xf54e('0xaa')](_0x2ec72a,'20',_0x55d57f)[_0xf54e('0x5a')](function(_0x47d309){_0x4f17dd=_0x47d309['additional']==0x1;if(!_0x4f17dd){if(ut[_0xf54e('0x7d')](_0x2ec72a)>=_0x55d57f['dialGlobalMaxRetry']){_0x9ab4c4=ut[_0xf54e('0x84')](_0x2ec72a,0xf,_0xf54e('0x85'));rpcDb[_0xf54e('0x6f')](_0x9ab4c4,_0xf54e('0xda'));}else{rpcDb['createCustomerFinal'](_0x2ec72a,_0xf54e('0xda'));}delete this[_0xf54e('0x15')][_0x30d10d['linkedid']];}else{_0x3744a4[_0xf54e('0x90')](_0x2ec72a,_0x29743e,_0x49fd97)[_0xf54e('0x5a')](function(){});}});}if(!(_0x2ec72a[_0xf54e('0x47')]&&_0x4e5059==='16')){ut[_0xf54e('0x52')](_0x55d57f,_0xf54e('0xdb'));logger[_0xf54e('0x27')](_0xf54e('0xdc'),_0x2ec72a[_0xf54e('0xa4')],_0xf54e('0x94'),_0x55d57f[_0xf54e('0x2c')],_0xf54e('0x45'),_0x55d57f['originated']);}if(_0x4e5059!=='ANSWER'){delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0x8d')]];delete this[_0xf54e('0x15')][_0x30d10d[_0xf54e('0xdd')]];}_0x55d57f[_0xf54e('0xde')]=!![];}};Preview['prototype'][_0xf54e('0xdf')]=function(_0x24b324,_0x3a9def,_0x213dc5){if(_['isUndefined'](_0x3a9def)&&_0xf54e('0xe0')!==typeof _0x3a9def){return;}if(_[_0xf54e('0xe1')](_0x213dc5)&&_0xf54e('0xe0')!==typeof _0x213dc5){return;}switch(_0x213dc5[_0xf54e('0xe2')]){case'0':ut[_0xf54e('0xe3')](_0x24b324,0x0,_0xf54e('0x7e'));rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe5'));break;case'3':ut[_0xf54e('0xe3')](_0x24b324,0x3,_0xf54e('0xb0'));rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe6'));break;case'5':ut[_0xf54e('0xe3')](_0x24b324,0x5,_0xf54e('0xe7'));rpcDb['createAgentHistory'](_0x24b324,_0xf54e('0xe8'));break;case'8':ut['logAgent'](_0x24b324,0x8,'Congestion');rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe9'));break;case'22':ut[_0xf54e('0xe3')](_0x24b324,0x16,_0xf54e('0xea'));rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xeb'));break;default:ut[_0xf54e('0xe3')](_0x24b324,0xc,_0x213dc5[_0xf54e('0xe2')]);rpcDb[_0xf54e('0xe4')](_0x24b324,_0xf54e('0xe9'));}ut[_0xf54e('0x52')](_0x3a9def,_0xf54e('0xec'));logger[_0xf54e('0x27')]('[originated][decrement][callProgressDetectingAgent]',_0x24b324[_0xf54e('0xa4')],_0xf54e('0x94'),_0x3a9def[_0xf54e('0x2c')],_0xf54e('0x45'),_0x3a9def[_0xf54e('0x2e')]);delete this['actions'][_0x24b324['uniqueid']];};Preview[_0xf54e('0xf')][_0xf54e('0xaa')]=function(_0x4b6f61,_0x5f0853,_0x3250d0){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x4b6f61,_0x5f0853,_0x3250d0)[_0xf54e('0x50')](logger[_0xf54e('0x27')](_0xf54e('0xed')));};Preview[_0xf54e('0xf')][_0xf54e('0x90')]=function(_0x1f9d18,_0x50bff9,_0x39fc7d){return cmHopperAdditionalPhone[_0xf54e('0x90')](_0x1f9d18,_0x50bff9,_0x39fc7d)['catch'](logger[_0xf54e('0x27')](_0xf54e('0xee')));};Preview['prototype'][_0xf54e('0xad')]=function(_0x44b7bd){return Promise[_0xf54e('0xef')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x44b7bd))[_0xf54e('0x50')](logger[_0xf54e('0x27')]('[incrementPreviewCounters]\x20'));};Preview['prototype']['checkInBlack']=function(_0x39027b,_0x32b55f,_0x11fb0c,_0x5072aa,_0x187b1c){var _0x459172=this;return new Promise(function(_0x28d019,_0x3da354){if(_[_0xf54e('0xf0')](_0x32b55f)||_['isNil'](_0x32b55f['Contact'])||_['isNil'](_0x32b55f['phone'])||_['isNil'](_0x32b55f[_0xf54e('0x4b')])){_0x3da354(ut['message'](_0xf54e('0xf1'),_0x5072aa,_0x187b1c));return;}var _0x3e0b67=uuid['v4']();var _0x484691=_0x459172[_0xf54e('0x3a')][_0x32b55f['Queue'][_0xf54e('0x2c')]];var _0x400dc6=_0x11fb0c?_0x459172[_0xf54e('0x16')][_0x11fb0c]['id']:undefined;_0x459172[_0xf54e('0x15')][_0x3e0b67]=new Action(_0x32b55f,_0x484691,_0x3e0b67,_0x11fb0c,_0x400dc6);var _0x3c0755=_0x459172[_0xf54e('0x15')][_0x3e0b67];_0x3c0755[_0xf54e('0x8b')]=_0x5072aa;_0x3c0755['activeContact']=_0x187b1c;_0x3c0755[_0xf54e('0xf2')]=_0x11fb0c;if(_[_0xf54e('0xf3')](_0x39027b)){_0x459172[_0xf54e('0xf4')](_0x3c0755,_0x484691,_0x32b55f,_0x11fb0c)[_0xf54e('0x5a')](function(_0x3733f5){logger['info'](_0xf54e('0xf5'),_0xf54e('0xf6')+_0x3c0755[_0xf54e('0x44')]+_0xf54e('0xf7')+_0x3c0755[_0xf54e('0x8f')],JSON[_0xf54e('0x29')](_0x3733f5));ami['emit']('custom:agentcalled',ut['buildObj'](_0x3c0755,_0xf54e('0xf8'),_0x459172[_0xf54e('0x3a')][_0x3c0755[_0xf54e('0x44')]]));_0x28d019(ut[_0xf54e('0x32')](_0xf54e('0xf9')));})['catch'](function(_0x31b2d6){ut[_0xf54e('0x35')]('[Preview][execCall][failure]',_0x31b2d6);_0x3da354(ut[_0xf54e('0x32')](_0xf54e('0xfa'),_0x5072aa,_0x187b1c));});}else{_0x484691[_0xf54e('0xfb')]+=0x1;ut['logBlacklist'](_0x3c0755);rpcDb[_0xf54e('0xfc')](_0x3c0755,_0xf54e('0xfd'));delete _0x459172[_0xf54e('0x15')][_0x3e0b67];_0x3da354(ut[_0xf54e('0x32')](_0xf54e('0xfe'),_0x5072aa,_0x187b1c));}});};Preview[_0xf54e('0xf')][_0xf54e('0x76')]=function(_0x370e59){return!_['isNil'](_0x370e59)&&!_[_0xf54e('0xf0')](_0x370e59['name'])&&!_[_0xf54e('0xf0')](_0x370e59[_0xf54e('0xff')])&&_0x370e59[_0xf54e('0xff')]&&!_[_0xf54e('0xf0')](this[_0xf54e('0x100')][util[_0xf54e('0x2a')](_0xf54e('0x101'),_0x370e59['name'])])&&!_['isNil'](this['trunks'][util[_0xf54e('0x2a')]('SIP/%s',_0x370e59[_0xf54e('0x2c')])]['status'])&&(this[_0xf54e('0x100')][util[_0xf54e('0x2a')]('SIP/%s',_0x370e59[_0xf54e('0x2c')])][_0xf54e('0x4e')]===_0xf54e('0x102')||this[_0xf54e('0x100')][util[_0xf54e('0x2a')](_0xf54e('0x101'),_0x370e59[_0xf54e('0x2c')])][_0xf54e('0x4e')]===_0xf54e('0x103'));};Preview[_0xf54e('0xf')][_0xf54e('0x5f')]=function(_0x5bc7ed,_0x26e18f){return this[_0xf54e('0x104')](_0x5bc7ed,_0x26e18f)[_0xf54e('0x5a')](function(_0x52226a){return _[_0xf54e('0x48')](_0x52226a,['message']);})[_0xf54e('0x50')](function(_0xc0d72a){if(_0xc0d72a[_0xf54e('0x105')]){rpcDb[_0xf54e('0x106')](_0x5bc7ed);}if(_0xc0d72a[_0xf54e('0xff')]){rpcDb[_0xf54e('0x62')](_0x5bc7ed);}throw _[_0xf54e('0x48')](_0xc0d72a,[_0xf54e('0x32')]);});};Preview[_0xf54e('0xf')][_0xf54e('0x104')]=function(_0x215277,_0x4a2222){var _0x50c424=this;var _0x47e3ae,_0x2bee3e;return rpcDb[_0xf54e('0x107')](_0x215277)[_0xf54e('0x5a')](function(_0x4c249a){if(!_[_0xf54e('0xf0')](_0x4c249a[0x0])){_0x2bee3e=_0x4c249a[0x0][_0xf54e('0x108')]?![]:!![];_0x47e3ae=_0x4c249a[0x0]['recallme']?!![]:![];_0x47e3ae=_0x4a2222?!![]:_0x47e3ae;}var _0x405254=_0x50c424[_0xf54e('0x109')](_0x4c249a);if(_0x405254[_0xf54e('0x10a')]){rpcDb[_0xf54e('0x10b')](_[_0xf54e('0x48')](_0x4c249a[0x0],[_0xf54e('0x4b'),_0xf54e('0x10c')]))['then'](function(_0x5369cd){_0x50c424[_0xf54e('0x10d')](_0x5369cd,_0x4c249a[0x0],_0x4a2222,_0x2bee3e,_0x47e3ae)[_0xf54e('0x5a')](function(_0x2ac04e){return _0x2ac04e;})[_0xf54e('0x50')](function(_0x53ae5c){throw _0x53ae5c;});})[_0xf54e('0x50')](function(_0x37c370){ut['logger'](_0xf54e('0x10e'),_0x37c370);throw ut['message'](_0xf54e('0x10f'),_0x2bee3e,_0x47e3ae);});}else{throw ut[_0xf54e('0x32')](_0x405254[_0xf54e('0x32')],_0x2bee3e,_0x47e3ae);}})[_0xf54e('0x50')](function(_0x4fb1ab){ut[_0xf54e('0x35')]('[Preview][getContactPreview]',_0x4fb1ab);throw ut[_0xf54e('0x32')](_0xf54e('0x10f'),![],!![]);});};Preview[_0xf54e('0xf')][_0xf54e('0x109')]=function(_0x5221d0){if(_['isNil'](_0x5221d0)||_[_0xf54e('0xf3')](_0x5221d0)||!_[_0xf54e('0xf0')](_0x5221d0[0x0][_0xf54e('0x5e')])&&_['isNil'](_0x5221d0[0x0][_0xf54e('0x5e')][_0xf54e('0x2c')])){ut['logger'](_0xf54e('0x110'),_0x5221d0);return{'isValid':![],'message':_0xf54e('0x111')};}var _0x3ea69c=this[_0xf54e('0x3a')][_0x5221d0[0x0][_0xf54e('0x112')][_0xf54e('0x2c')]];_0x3ea69c['message']=utils[_0xf54e('0x33')][_0xf54e('0x79')];if(_[_0xf54e('0xf0')](_0x3ea69c)){ut[_0xf54e('0x35')](_0xf54e('0x113'),_0x3ea69c);return{'isValid':![],'message':_0xf54e('0x114')};}if(!this[_0xf54e('0x76')](_0x3ea69c[_0xf54e('0x77')])){ut[_0xf54e('0x35')](_0xf54e('0x115'),_0xf54e('0x116')+_0x3ea69c[_0xf54e('0x2c')]+_0xf54e('0x117'));if(!this[_0xf54e('0x76')](_0x3ea69c[_0xf54e('0x118')])){ut[_0xf54e('0x35')](_0xf54e('0x115'),_0x3ea69c['name']+_0xf54e('0x119'));return{'isValid':![],'message':_0xf54e('0x11a')};}}if(!ut[_0xf54e('0x11b')](_0x3ea69c['dialActive'])){ut[_0xf54e('0x35')](_0xf54e('0x11c'),_0x3ea69c[_0xf54e('0x2c')]+_0xf54e('0x11d'));return{'isValid':![],'message':_0xf54e('0x116')+_0x3ea69c['name']+_0xf54e('0x11d')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xf54e('0xf')][_0xf54e('0xf4')]=function(_0x505c0f,_0xcdc5ec,_0x171516,_0x2df876){var _0x4026ea=this;return new Promise(function(_0x1a0fc0,_0x459bbb){var _0x3770f3=_0x505c0f[_0xf54e('0xa4')];var _0x1ad56e=_0x4026ea['isTrunkReachable'](_0xcdc5ec[_0xf54e('0x77')])?util['format'](_0xf54e('0x11e'),_0xcdc5ec[_0xf54e('0x77')]['name'],_[_0xf54e('0xf0')](_0xcdc5ec['dialPrefix'])?'':_0xcdc5ec[_0xf54e('0x11f')][_0xf54e('0x120')]()||'',_0xcdc5ec['dialCutDigit']>0x0?_0x171516[_0xf54e('0x10c')][_0xf54e('0x121')](_0xcdc5ec['dialCutDigit']):_0x171516['phone']):util['format'](_0xf54e('0x11e'),_[_0xf54e('0xf0')](_0xcdc5ec[_0xf54e('0x118')])?_0xcdc5ec[_0xf54e('0x77')][_0xf54e('0x2c')]:_0xcdc5ec[_0xf54e('0x118')][_0xf54e('0x2c')],_[_0xf54e('0xf0')](_0xcdc5ec['dialPrefix'])?'':_0xcdc5ec['dialPrefix'][_0xf54e('0x120')]()||'',_0xcdc5ec[_0xf54e('0x122')]>0x0?_0x171516[_0xf54e('0x10c')][_0xf54e('0x121')](_0xcdc5ec[_0xf54e('0x122')]):_0x171516['phone']);var _0x3aa45f=_0x4026ea['isTrunkReachable'](_0xcdc5ec['Trunk'])?ut[_0xf54e('0x123')](_0xcdc5ec[_0xf54e('0x77')][_0xf54e('0x124')],_0xcdc5ec[_0xf54e('0x125')],_0xcdc5ec[_0xf54e('0x126')]>0x0?ut[_0xf54e('0x127')](_0xcdc5ec[_0xf54e('0x128')],_0xcdc5ec['dialRandomLastDigitCallerIdNumber']):_0xcdc5ec[_0xf54e('0x128')]):ut[_0xf54e('0x123')](_[_0xf54e('0xf0')](_0xcdc5ec[_0xf54e('0x118')])?_0xcdc5ec[_0xf54e('0x77')]['callerid']:_0xcdc5ec[_0xf54e('0x118')][_0xf54e('0x124')],_0xcdc5ec[_0xf54e('0x125')],_0xcdc5ec[_0xf54e('0x126')]>0x0?ut[_0xf54e('0x127')](_0xcdc5ec['dialOriginateCallerIdNumber'],_0xcdc5ec['dialRandomLastDigitCallerIdNumber']):_0xcdc5ec[_0xf54e('0x128')]);if(_0x3aa45f){_0x505c0f[_0xf54e('0x129')]=ut[_0xf54e('0x12a')](_0x3aa45f);_0x505c0f['originatecalleridnum']=ut[_0xf54e('0x12b')](_0x3aa45f);}var _0x2c2833=ut[_0xf54e('0x12c')](_0xcdc5ec,_0x171516,_0x1ad56e,_0x3aa45f,_0x3770f3,_0x505c0f);_[_0xf54e('0x12d')](_0x505c0f,ut['toLowerVariables'](_0x2c2833));_0x505c0f[_0xf54e('0x63')]=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));_0xcdc5ec['variables']=_0x2c2833;var _0x34db40=ut[_0xf54e('0x12e')](_0x505c0f,_0xcdc5ec,_0x2c2833,_0x505c0f[_0xf54e('0x8c')],_0x2df876);return ami[_0xf54e('0x4d')](_0x34db40)[_0xf54e('0x5a')](function(_0x123f93){_0xcdc5ec[_0xf54e('0x2e')]+=0x1;logger[_0xf54e('0x27')]('[originated][increment]',_0x3770f3,_0xf54e('0x94'),_0xcdc5ec[_0xf54e('0x2c')],_0xf54e('0x45'),_0xcdc5ec[_0xf54e('0x2e')]);_0x1a0fc0(_0x123f93);})['catch'](function(_0x47b07a){ut['logAgent'](_0x505c0f,0xe,'OriginateError');rpcDb[_0xf54e('0xe4')](_0x505c0f,_0xf54e('0x12f'));_0x459bbb(_0x47b07a);});});};Preview[_0xf54e('0xf')]['syncNewExten']=function(_0x5a84b8){if(this[_0xf54e('0x15')][_0x5a84b8['linkedid']]){this[_0xf54e('0x15')][_0x5a84b8['linkedid']][_0xf54e('0x4f')]=_0x5a84b8[_0xf54e('0x4f')];}};Preview[_0xf54e('0xf')]['syncOriginateResponse']=function(_0x14ead8){var _0x260b7a=this;var _0x1487be=this[_0xf54e('0x15')][_0x14ead8['actionid']];if(_0x1487be){if(_0x1487be[_0xf54e('0xf2')]&&this[_0xf54e('0x16')][_0x1487be[_0xf54e('0xf2')]]){ut[_0xf54e('0x130')](_0x1487be,this[_0xf54e('0x16')][_0x1487be[_0xf54e('0xf2')]]['name'],this[_0xf54e('0x16')][_0x1487be['lookAgent']]['id']);}var _0x4d406a=_[_0xf54e('0x131')](_0x1487be);_0x4d406a['responsetime']=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));var _0x56411c=_0x260b7a['campaignsPreview'][_0x1487be[_0xf54e('0x44')]];if(ut['isFailure'](_0x14ead8[_0xf54e('0x132')])){if(_0x1487be[_0xf54e('0x8b')]){rpcDb['unlockContact'](_0x1487be[_0xf54e('0x8f')]);}if(_0x1487be['activeContact']){rpcDb[_0xf54e('0x62')](_0x1487be[_0xf54e('0x8f')]);}ami['emit'](_0xf54e('0x133'),ut[_0xf54e('0x96')](_0x1487be,_0xf54e('0x134'),this[_0xf54e('0x3a')][_0x1487be[_0xf54e('0x44')]]));this[_0xf54e('0xdf')](_0x4d406a,_0x56411c,_0x14ead8);}else{_0x1487be[_0xf54e('0x63')]=moment()[_0xf54e('0x2a')](_0xf54e('0x64'));ut['logAgent'](_0x4d406a,0x4,'Answer');rpcDb[_0xf54e('0xe4')](_0x4d406a,_0xf54e('0x135'));}}};Preview[_0xf54e('0xf')][_0xf54e('0x1b')]=function(_0x53d6cb){var _0x143b50=this[_0xf54e('0x15')][_0x53d6cb['linkedid']];var _0x3b25f4;if(_0x143b50){_0x3b25f4=this[_0xf54e('0x3a')][_0x143b50[_0xf54e('0x44')]];logger[_0xf54e('0x27')](_0xf54e('0x136'),_0x53d6cb[_0xf54e('0x8d')],_0xf54e('0x94'),_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);}if(this[_0xf54e('0x15')][_0x53d6cb['linkedid']]&&_0x53d6cb['linkedid']!==_0x53d6cb[_0xf54e('0xa4')]){if(_0x53d6cb[_0xf54e('0x137')]==='16'&&this[_0xf54e('0x15')][_0x53d6cb[_0xf54e('0x8d')]][_0xf54e('0x47')]){this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb['linkedid'],_0x53d6cb[_0xf54e('0x137')]);}else if(this[_0xf54e('0x15')][_0x53d6cb['linkedid']][_0xf54e('0x47')]){logger[_0xf54e('0x27')](_0xf54e('0x138'),_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb['cause'],'\x20Queue',_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb['linkedid'],_0x53d6cb['cause']);}}else if(_0x143b50&&_[_0xf54e('0xf0')](_0x143b50[_0xf54e('0x139')])&&_0x3b25f4[_0xf54e('0x13a')]&&_0x53d6cb['linkedid']===_0x53d6cb[_0xf54e('0xa4')]&&_[_0xf54e('0xf0')](_0x53d6cb[_0xf54e('0xe2')])&&_0x53d6cb[_0xf54e('0x137')]==='16'&&_0x53d6cb['channelstate']==='6'&&_[_0xf54e('0xe1')](_0x143b50['transfer'])){if(_0x143b50[_0xf54e('0x8b')]){rpcDb[_0xf54e('0x106')](_0x143b50[_0xf54e('0x8f')]);}if(_0x143b50[_0xf54e('0x8c')]){rpcDb['disableContact'](_0x143b50[_0xf54e('0x8f')]);}_0x53d6cb[_0xf54e('0xe2')]='22';this[_0xf54e('0xdf')](_0x143b50,_0x3b25f4,_0x53d6cb);}else if(_0x143b50&&_0x143b50['transfer']){if(_0x53d6cb[_0xf54e('0x137')]==='16'&&this[_0xf54e('0x15')][_0x53d6cb[_0xf54e('0x8d')]]['dialAnswer']){logger[_0xf54e('0x27')](_0xf54e('0x13b'),_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')],_0xf54e('0x94'),_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')]);}else if(this[_0xf54e('0x15')][_0x53d6cb[_0xf54e('0x8d')]][_0xf54e('0x47')]){logger[_0xf54e('0x27')](_0xf54e('0x138'),_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')],'\x20Queue',_0x3b25f4[_0xf54e('0x2c')],_0xf54e('0x46'),_0x3b25f4[_0xf54e('0x2f')]);this[_0xf54e('0x7a')](_0x53d6cb,_0x53d6cb[_0xf54e('0x8d')],_0x53d6cb[_0xf54e('0x137')]);}}};Preview[_0xf54e('0xf')][_0xf54e('0x13c')]=function(_0x429793){if(this[_0xf54e('0x15')][_0x429793[_0xf54e('0xdd')]]&&_0x429793[_0xf54e('0xdd')]!==_0x429793[_0xf54e('0x13d')]){this[_0xf54e('0x7a')](_0x429793,_0x429793[_0xf54e('0xdd')],_0x429793[_0xf54e('0xd5')]);}};Preview['prototype'][_0xf54e('0x1d')]=function(_0x28a3f8){if(this[_0xf54e('0x15')][_0x28a3f8[_0xf54e('0x8d')]]&&_0x28a3f8['linkedid']!==_0x28a3f8[_0xf54e('0xa4')]&&!this[_0xf54e('0x15')][_0x28a3f8['linkedid']][_0xf54e('0x47')]){if(_0x28a3f8[_0xf54e('0x137')]==='1'){this[_0xf54e('0x7a')](_0x28a3f8,_0x28a3f8[_0xf54e('0x8d')],_0x28a3f8[_0xf54e('0x137')]);}}};Preview[_0xf54e('0xf')][_0xf54e('0x13e')]=function(_0x22f8ad,_0x269670,_0x17801c){if(this['actions'][_0x22f8ad]){if(_[_0xf54e('0xf0')](this[_0xf54e('0x15')][_0x22f8ad][_0xf54e('0x13f')])){this[_0xf54e('0x15')][_0x22f8ad][_0xf54e('0x13f')]={};}this[_0xf54e('0x15')][_0x22f8ad][_0xf54e('0x13f')][_0x269670]=_0x17801c;}};Preview['prototype'][_0xf54e('0x21')]=function(_0x397e6c){try{if(!_[_0xf54e('0xf0')](_0x397e6c)){if(ut[_0xf54e('0x140')](_[_0xf54e('0x141')](_0x397e6c[_0xf54e('0x142')])[0x0])){this[_0xf54e('0x13e')](_0x397e6c[_0xf54e('0xa4')],_[_0xf54e('0x141')](_0x397e6c[_0xf54e('0x142')])[0x0],_0x397e6c['value']);}}}catch(_0xb1e536){logger[_0xf54e('0x143')]('[syncVarSet][Preview]',util['inspect'](_0xb1e536,{'showHidden':![],'depth':null}));}};Preview[_0xf54e('0xf')][_0xf54e('0x23')]=function(_0x232195){if(_0x232195){if(this[_0xf54e('0x15')][_0x232195[_0xf54e('0x144')]]){this[_0xf54e('0x15')][_0x232195[_0xf54e('0x144')]][_0xf54e('0x145')]=!![];}}};Preview[_0xf54e('0xf')][_0xf54e('0x146')]=function(_0x56b18a){if(_0x56b18a){if(this[_0xf54e('0x15')][_0x56b18a[_0xf54e('0x147')]]){this['actions'][_0x56b18a['transfererlinkedid']][_0xf54e('0x145')]=!![];}}};module[_0xf54e('0x148')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9d23378..ae25bdb 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 _0x1ed3=['countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x1ed3,0x1bb));var _0x31ed=function(_0x548eae,_0xad69de){_0x548eae=_0x548eae-0x0;var _0x5b1a01=_0x1ed3[_0x548eae];return _0x5b1a01;};'use strict';var util=require(_0x31ed('0x0'));var BPromise=require(_0x31ed('0x1'));var logger=require(_0x31ed('0x2'))(_0x31ed('0x3'));var cmHopper=require(_0x31ed('0x4'));var cmHopperHistory=require(_0x31ed('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x31ed('0x6'));function loggerCatch(_0x1702d0){return function(_0x275a3d){logger[_0x31ed('0x7')](_0x1702d0,util[_0x31ed('0x8')](_0x275a3d,{'showHidden':![],'depth':null}));};}function create(_0x43bbbe){return cmHopperHistory[_0x31ed('0x9')](_0x43bbbe)[_0x31ed('0xa')](loggerCatch(_0x31ed('0xb')));}function createAgent(_0x428218){return BPromise[_0x31ed('0xc')]()[_0x31ed('0xd')](agentReportPreview[_0x31ed('0x9')](_0x428218))[_0x31ed('0xa')](loggerCatch(_0x31ed('0xb')));}function moveContact(_0x480dfd){return cmHopper[_0x31ed('0xe')](_0x480dfd,!![])['catch'](loggerCatch(_0x31ed('0xf')));}exports['checkIsBlackList']=function(_0x46db8a){return cmHopperBlack[_0x31ed('0x10')](_0x46db8a)[_0x31ed('0xa')](loggerCatch(_0x31ed('0x11')));};exports[_0x31ed('0x12')]=function(_0x4c8ec3){return BPromise[_0x31ed('0xc')]()[_0x31ed('0xd')](cmHopper['getContactPreview'](_0x4c8ec3))[_0x31ed('0xa')](loggerCatch('[getContactPreview]\x20'));};exports[_0x31ed('0x9')]=function(_0x267841,_0x50339b){create(_0x267841)['catch'](loggerCatch(_0x50339b));moveContact(_0x267841)[_0x31ed('0xa')](loggerCatch(_0x50339b));};exports[_0x31ed('0x13')]=function(_0x245132,_0x3474ac){createAgent(_0x245132)[_0x31ed('0xa')](loggerCatch(_0x3474ac));};exports[_0x31ed('0x14')]=function(_0xc6428e,_0x4eb3df){create(_0xc6428e)[_0x31ed('0xa')](loggerCatch(_0x4eb3df));};exports[_0x31ed('0x15')]=function(_0x2f44c0,_0x2bb981){moveContact(_0x2f44c0)[_0x31ed('0xa')](loggerCatch(_0x2bb981));};exports['rescheduleContact']=function(_0x4d9c82,_0x519dfc,_0x42384a){if(_0x519dfc){_0x4d9c82['UserId']=null;}if(_0x42384a){_0x4d9c82[_0x31ed('0x16')]=![];}return cmHopper[_0x31ed('0x17')](_0x4d9c82)[_0x31ed('0xa')](loggerCatch(_0x31ed('0x18')));};exports[_0x31ed('0x19')]=function(_0x469f54){return cmHopper[_0x31ed('0x19')](_0x469f54)[_0x31ed('0xa')](loggerCatch(_0x31ed('0x1a')));};exports['unlockContact']=function(_0x4094f8){return cmHopper[_0x31ed('0x1b')]({'UserId':null},_0x4094f8,0x1)[_0x31ed('0xa')](loggerCatch(_0x31ed('0x1c')));};exports['disableContact']=function(_0x186c5c){return cmHopper[_0x31ed('0x1b')]({'active':![]},_0x186c5c,0x1)[_0x31ed('0xa')](loggerCatch('[activeContact]\x20'));};exports[_0x31ed('0x1d')]=function(_0x47ba48){var _0x1efa90={};_0x1efa90[_0x31ed('0x1e')]=_0x47ba48[_0x31ed('0x1e')];_0x1efa90['uniqueid']=_0x47ba48[_0x31ed('0x1f')];_0x1efa90[_0x31ed('0x20')]=_0x47ba48[_0x31ed('0x20')];_0x1efa90[_0x31ed('0x21')]=_0x47ba48[_0x31ed('0x21')];_0x1efa90[_0x31ed('0x22')]=_0x47ba48['queue'];_0x1efa90[_0x31ed('0x23')]=_0x47ba48[_0x31ed('0x24')];_0x1efa90['queuecallerleaveAt']=_0x47ba48[_0x31ed('0x24')];_0x1efa90[_0x31ed('0x25')]=0x1;_0x1efa90[_0x31ed('0x26')]=_0x47ba48['endtime'];_0x1efa90[_0x31ed('0x27')]=_0x47ba48[_0x31ed('0x28')];_0x1efa90[_0x31ed('0x29')]=_0x31ed('0x2a');_0x1efa90[_0x31ed('0x2b')]=_0x31ed('0x2c');_0x1efa90[_0x31ed('0x2d')]=0x0;_0x1efa90['assigned']=0x1;_0x1efa90['lastAssignedTo']=_0x47ba48[_0x31ed('0x28')];_0x1efa90['queuecallerexitreason']=_0x31ed('0x2e');return BPromise[_0x31ed('0xc')]()['then'](voiceQueueReport[_0x31ed('0x2f')](_0x1efa90))[_0x31ed('0xa')](loggerCatch(_0x31ed('0x30')));};exports['getContactRecallMe']=function(_0x37e0d7,_0x24a960){return BPromise['resolve']()[_0x31ed('0xd')](cmHopper[_0x31ed('0x31')](_0x37e0d7,_0x24a960))[_0x31ed('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x31ed('0x32')]=function(_0x396385){return cmHopper[_0x31ed('0x17')](_0x396385,!![],!![])['catch'](loggerCatch(_0x31ed('0x33')));}; \ No newline at end of file +var _0x4823=['disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','preview','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20'];(function(_0x5b4b91,_0x2e5311){var _0x695013=function(_0x17111e){while(--_0x17111e){_0x5b4b91['push'](_0x5b4b91['shift']());}};_0x695013(++_0x2e5311);}(_0x4823,0x1cc));var _0x3482=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x4823[_0x13c70c];return _0x50f0f2;};'use strict';var util=require(_0x3482('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x3482('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x3482('0x2'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x3482('0x3'));function loggerCatch(_0x41eed4){return function(_0x585f81){logger[_0x3482('0x4')](_0x41eed4,util[_0x3482('0x5')](_0x585f81,{'showHidden':![],'depth':null}));};}function create(_0x48b887){return cmHopperHistory['createHistory'](_0x48b887)[_0x3482('0x6')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3e3fd7){return BPromise[_0x3482('0x7')]()[_0x3482('0x8')](agentReportPreview[_0x3482('0x9')](_0x3e3fd7))[_0x3482('0x6')](loggerCatch(_0x3482('0xa')));}function moveContact(_0x17d63e){return cmHopper[_0x3482('0xb')](_0x17d63e,!![])[_0x3482('0x6')](loggerCatch(_0x3482('0xc')));}exports[_0x3482('0xd')]=function(_0x2b3a77){return cmHopperBlack[_0x3482('0xd')](_0x2b3a77)['catch'](loggerCatch(_0x3482('0xe')));};exports['getContactPreview']=function(_0x251679){return BPromise[_0x3482('0x7')]()[_0x3482('0x8')](cmHopper[_0x3482('0xf')](_0x251679))['catch'](loggerCatch(_0x3482('0x10')));};exports[_0x3482('0x9')]=function(_0x1c25a5,_0x4c5a8a){create(_0x1c25a5)[_0x3482('0x6')](loggerCatch(_0x4c5a8a));moveContact(_0x1c25a5)[_0x3482('0x6')](loggerCatch(_0x4c5a8a));};exports[_0x3482('0x11')]=function(_0x53cf1b,_0x31dd4c){createAgent(_0x53cf1b)[_0x3482('0x6')](loggerCatch(_0x31dd4c));};exports['createCustomerHistory']=function(_0x4cdfef,_0x3f328a){create(_0x4cdfef)[_0x3482('0x6')](loggerCatch(_0x3f328a));};exports[_0x3482('0x12')]=function(_0x1f1569,_0x5b6658){moveContact(_0x1f1569)['catch'](loggerCatch(_0x5b6658));};exports[_0x3482('0x13')]=function(_0x1c660e,_0x2bd82a,_0x189e7b){if(_0x2bd82a){_0x1c660e['UserId']=null;}if(_0x189e7b){_0x1c660e[_0x3482('0x14')]=![];}return cmHopper[_0x3482('0x13')](_0x1c660e)[_0x3482('0x6')](loggerCatch(_0x3482('0x15')));};exports[_0x3482('0x16')]=function(_0x5c4c8a){return cmHopper[_0x3482('0x16')](_0x5c4c8a)[_0x3482('0x6')](loggerCatch(_0x3482('0x17')));};exports[_0x3482('0x18')]=function(_0x429ae8){return cmHopper['unlockContact']({'UserId':null},_0x429ae8,0x1)[_0x3482('0x6')](loggerCatch(_0x3482('0x19')));};exports[_0x3482('0x1a')]=function(_0x26f989){return cmHopper['unlockContact']({'active':![]},_0x26f989,0x1)[_0x3482('0x6')](loggerCatch(_0x3482('0x1b')));};exports[_0x3482('0x1c')]=function(_0x4ba8f9){var _0x3e7b3e={};_0x3e7b3e[_0x3482('0x1d')]=_0x4ba8f9['type'];_0x3e7b3e[_0x3482('0x1e')]=_0x4ba8f9[_0x3482('0x1e')];_0x3e7b3e['calleridnum']=_0x4ba8f9[_0x3482('0x1f')];_0x3e7b3e[_0x3482('0x20')]=_0x4ba8f9['calleridname'];_0x3e7b3e[_0x3482('0x21')]=_0x4ba8f9[_0x3482('0x21')];_0x3e7b3e[_0x3482('0x22')]=_0x4ba8f9[_0x3482('0x23')];_0x3e7b3e['queuecallerleaveAt']=_0x4ba8f9['answertime'];_0x3e7b3e['queuecallercomplete']=0x1;_0x3e7b3e[_0x3482('0x24')]=_0x4ba8f9[_0x3482('0x25')];_0x3e7b3e[_0x3482('0x26')]=_0x4ba8f9[_0x3482('0x27')];_0x3e7b3e[_0x3482('0x28')]=_0x3482('0x29');_0x3e7b3e[_0x3482('0x2a')]=_0x3482('0x2b');_0x3e7b3e[_0x3482('0x2c')]=0x0;_0x3e7b3e[_0x3482('0x2d')]=0x1;_0x3e7b3e[_0x3482('0x2e')]=_0x4ba8f9[_0x3482('0x27')];_0x3e7b3e[_0x3482('0x2f')]=_0x3482('0x30');return BPromise[_0x3482('0x7')]()[_0x3482('0x8')](voiceQueueReport[_0x3482('0x31')](_0x3e7b3e))['catch'](loggerCatch(_0x3482('0x32')));};exports[_0x3482('0x33')]=function(_0x48fe52,_0x49a156){return BPromise[_0x3482('0x7')]()[_0x3482('0x8')](cmHopper[_0x3482('0x33')](_0x48fe52,_0x49a156))[_0x3482('0x6')](loggerCatch(_0x3482('0x34')));};exports['rescheduleContactInQueue']=function(_0x13b0ae){return cmHopper[_0x3482('0x13')](_0x13b0ae,!![],!![])[_0x3482('0x6')](loggerCatch(_0x3482('0x35')));}; \ 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 774a1f9..ec00197 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 _0xf4a3=['Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','logCustomer','talktime','answertime','getSeconds','isFailure','variablesAction','RECALL','originate','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','scheduledat','minutes','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','interface','channelAgent','agentReadyId','not_inuse','push','milliseconds','seconds','filterKey','idContact','type','campaigntype','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','match','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','logger','info','inspect','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc'];(function(_0xb77252,_0x4e5e80){var _0x3f1a76=function(_0x4361d9){while(--_0x4361d9){_0xb77252['push'](_0xb77252['shift']());}};_0x3f1a76(++_0x4e5e80);}(_0xf4a3,0x187));var _0x3f4a=function(_0x115c5d,_0x3e490a){_0x115c5d=_0x115c5d-0x0;var _0x3c14b2=_0xf4a3[_0x115c5d];return _0x3c14b2;};'use strict';var util=require('util');var _=require(_0x3f4a('0x0'));var moment=require(_0x3f4a('0x1'));var logger=require('../../../../config/logger')(_0x3f4a('0x2'));var ipAgi=process[_0x3f4a('0x3')][_0x3f4a('0x4')]||_0x3f4a('0x5');var utils=require('../../dialer/utils');exports[_0x3f4a('0x6')]=function(_0x39d6ad){return function(_0x5f2e03){logger[_0x3f4a('0x7')](_0x39d6ad,util['inspect'](_0x5f2e03,{'showHidden':![],'depth':null}));};};exports[_0x3f4a('0x8')]=function(_0x223332,_0x1298c6){logger[_0x3f4a('0x9')](_0x223332,util[_0x3f4a('0xa')](_0x1298c6,{'showHidden':![],'depth':null}));};exports[_0x3f4a('0xb')]=function(_0x3b746c,_0x13b729){logger['error'](_0x3b746c,util[_0x3f4a('0xa')](_0x13b729,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x17afa8){return function(_0x201741){logger[_0x3f4a('0x9')](_0x17afa8,util[_0x3f4a('0xa')](_0x201741,{'showHidden':![],'depth':null}));};};exports[_0x3f4a('0xc')]=function(_0x22998b,_0x591157,_0x5791f9){return{'message':_0x22998b,'unlock':_0x591157,'active':_0x5791f9};};exports[_0x3f4a('0xd')]=function(_0x3dcd4c,_0x300528,_0x230071){if(!_[_0x3f4a('0xe')](_0x230071)&&_0x3f4a('0xf')===typeof _0x230071&&!_[_0x3f4a('0x10')](_0x230071)){if(!_['isUndefined'](_0x300528)&&_0x3f4a('0xf')===typeof _0x300528&&!_['isEmpty'](_0x300528)){return util[_0x3f4a('0x11')](_0x3f4a('0x12'),_0x300528,_0x230071);}return util['format'](_0x3f4a('0x12'),_0x230071,_0x230071);}if(!_[_0x3f4a('0xe')](_0x3dcd4c)&&_0x3f4a('0xf')===typeof _0x3dcd4c&&!_[_0x3f4a('0x10')](_0x3dcd4c)){return _0x3dcd4c;}return _0x3f4a('0x13');};exports['isActive']=function(_0x8bf0c3){if(_[_0x3f4a('0x14')](_0x8bf0c3)){return![];}return _0x8bf0c3;};exports[_0x3f4a('0x15')]=function(_0x287220,_0x47fa25,_0x43a109,_0x1a2dfb,_0x2fb768,_0x3e9f1d){var _0x5d3e24={'XMD-QUEUE':_0x47fa25[_0x3f4a('0x16')]?_0x47fa25['Queue'][_0x3f4a('0x17')]:'','XMD-CALLERID':_0x1a2dfb,'XMD-CALLERID-PREVIEW':_0x3e9f1d?util['format']('\x22%s\x22\x20<%s>',_0x3e9f1d[_0x3f4a('0x18')],_0x3e9f1d[_0x3f4a('0x19')]):_0x1a2dfb,'XMD-DIALID':_0x2fb768,'XMD-CONTACTID':_0x47fa25['ContactId'],'XMD-CDRTYPE':_0x3f4a('0x1a'),'CALLERID(all)':_0x1a2dfb,'XMD-VOICEQUEUEID':_0x47fa25[_0x3f4a('0x1b')],'XMD-DIALCHANNEL':_0x43a109,'XMD-DIALTIMEOUT':_0x287220[_0x3f4a('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x3f4a('0x11')](_0x3f4a('0x1d'),_0x287220[_0x3f4a('0x1e')]?'g':'',_['isEmpty'](_0x287220[_0x3f4a('0x1f')])?'':_0x3f4a('0x20')),'XMD-DIALURL':_0x287220[_0x3f4a('0x21')]||'','XMD-AGI':_0x287220[_0x3f4a('0x22')]?util[_0x3f4a('0x11')](_0x3f4a('0x23'),ipAgi,_0x287220[_0x3f4a('0x22')]):_0x3f4a('0x24'),'XMD-AGIAFTER':_0x287220[_0x3f4a('0x1e')]?util[_0x3f4a('0x11')](_0x3f4a('0x23'),ipAgi,_0x287220['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3e9f1d?_0x3e9f1d[_0x3f4a('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e9f1d?_0x3e9f1d[_0x3f4a('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x3f4a('0x27')};if(!_['isEmpty'](_0x287220[_0x3f4a('0x1f')])){_0x5d3e24[util[_0x3f4a('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x287220[_0x3f4a('0x1f')];_0x5d3e24[util[_0x3f4a('0x11')]('%s',_0x3f4a('0x28'))]=_0x2fb768;}if(_0x47fa25&&_0x47fa25['Contact']){for(var _0x364a4b in _0x47fa25[_0x3f4a('0x29')]){if(_0x47fa25[_0x3f4a('0x29')][_0x3f4a('0x2a')](_0x364a4b)){if(!_[_0x3f4a('0x14')](_0x47fa25[_0x3f4a('0x29')][_0x364a4b])&&_0x364a4b!=='id'&&_0x364a4b!==_0x3f4a('0x2b')&&_0x364a4b!==_0x3f4a('0x2c')&&_0x364a4b!==_0x3f4a('0x2d')){_0x5d3e24[util[_0x3f4a('0x11')](_0x3f4a('0x2e'),_0x3f4a('0x2f'),_[_0x3f4a('0x30')](_0x364a4b))]=_0x47fa25[_0x3f4a('0x29')][_0x364a4b];}}}}return _0x5d3e24;};exports[_0x3f4a('0x31')]=function(_0x480f32){var _0x1862a4={};for(var _0x3e18f4 in _0x480f32){if(_0x480f32['hasOwnProperty'](_0x3e18f4)){_0x1862a4[util[_0x3f4a('0x11')]('%s',_[_0x3f4a('0x32')](_0x3e18f4))]=_0x480f32[_0x3e18f4];}}return{'variables':_0x1862a4};};exports['updateOriginated']=function(_0x1a937a,_0x23166f){if(!_[_0x3f4a('0x14')](_0x1a937a)){if(_0x1a937a[_0x3f4a('0x2a')](_0x3f4a('0x33'))){if(_0x1a937a['originated']>0x0){_0x1a937a[_0x3f4a('0x33')]-=0x1;}else{logger[_0x3f4a('0x7')](_0x3f4a('0x34'),_0x23166f);}}}else{logger[_0x3f4a('0x7')](_0x3f4a('0x35'),_0x23166f);}};exports['logBlacklist']=function(_0x565ec9){var _0x4f1d62=moment()[_0x3f4a('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x565ec9[_0x3f4a('0x36')]=0xd;_0x565ec9[_0x3f4a('0x37')]=_0x3f4a('0x38');_0x565ec9[_0x3f4a('0x39')]=_0x4f1d62;_0x565ec9[_0x3f4a('0x3a')]=_0x4f1d62;_0x565ec9[_0x3f4a('0x3b')]=_0x4f1d62;};exports[_0x3f4a('0x3c')]=function(_0x3c54c2,_0x1f84e7,_0x5ba759){var _0x54148a=moment()[_0x3f4a('0x11')](_0x3f4a('0x3d'));_0x3c54c2[_0x3f4a('0x36')]=_0x1f84e7;_0x3c54c2['statedesc']=_0x5ba759;_0x3c54c2[_0x3f4a('0x3a')]=_0x54148a;_0x3c54c2[_0x3f4a('0x3e')]=utils['getSeconds'](_0x3c54c2[_0x3f4a('0x3a')],_0x3c54c2['starttime']);};exports['logLookAgent']=function(_0x5ae0e8,_0x288faf,_0x566986){_0x5ae0e8[_0x3f4a('0x3f')]=_0x288faf;_0x5ae0e8['UserId']=_0x566986;};exports[_0x3f4a('0x40')]=function(_0x18fff8,_0x2ea1ff,_0x1d8631){var _0x4dabe0=moment()['format'](_0x3f4a('0x3d'));_0x18fff8[_0x3f4a('0x36')]=_0x2ea1ff;_0x18fff8[_0x3f4a('0x37')]=_0x1d8631;_0x18fff8[_0x3f4a('0x3a')]=_0x18fff8[_0x3f4a('0x3a')]?_0x18fff8[_0x3f4a('0x3a')]:_0x4dabe0;_0x18fff8[_0x3f4a('0x3b')]=_0x18fff8['endtime']?_0x18fff8[_0x3f4a('0x3b')]:_0x4dabe0;_0x18fff8[_0x3f4a('0x3e')]=utils['getSeconds'](_0x18fff8[_0x3f4a('0x3a')]||0x0,_0x18fff8[_0x3f4a('0x39')]||0x0);_0x18fff8[_0x3f4a('0x41')]=_0x18fff8[_0x3f4a('0x42')]?utils[_0x3f4a('0x43')](_0x18fff8[_0x3f4a('0x3b')],_0x18fff8[_0x3f4a('0x42')]):0x0;};exports[_0x3f4a('0x44')]=function(_0x568b31){return _0x568b31==='Failure';};exports[_0x3f4a('0x45')]=function(_0x52bc07,_0x2fef7a,_0x5c3eed,_0x57dd0d,_0x10500c){var _0x422f17=_0x57dd0d?_0x3f4a('0x46'):_0x52bc07['calleridname'];_0x422f17=_0x10500c?'BOOKED':_0x422f17;return{'actionid':_0x52bc07['uniqueid'],'action':_0x3f4a('0x47'),'channel':_0x52bc07['channelAgent'],'callerid':util[_0x3f4a('0x11')]('\x22%s\x22\x20<%s>',_0x422f17,_0x52bc07[_0x3f4a('0x19')]),'Exten':'xcally-motion-preview','Context':_0x3f4a('0x48'),'Priority':'1','variable':_0x5c3eed,'timeout':(_0x2fef7a[_0x3f4a('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52bc07[_0x3f4a('0x4a')]};};exports[_0x3f4a('0x4b')]=function(_0x5443c5){return _0x5443c5['countbusyretry']+_0x5443c5[_0x3f4a('0x4c')]+_0x5443c5[_0x3f4a('0x4d')]+_0x5443c5[_0x3f4a('0x4e')]+_0x5443c5[_0x3f4a('0x4f')];};exports[_0x3f4a('0x50')]=function(_0x52aa56){var _0x389505=_[_0x3f4a('0x51')](_0x52aa56);_0x389505['state']=0xf;_0x389505['statedesc']=_0x3f4a('0x52');return _0x389505;};exports['scheduledAt']=function(_0x10a913,_0x3801ea,_0x361aa9){var _0x3e182f={};_0x3e182f[_0x3801ea]=_0x10a913[_0x3801ea];_0x3e182f[_0x3f4a('0x53')]=![];_0x3e182f[_0x3f4a('0x54')]=moment()['add'](_0x361aa9,_0x3f4a('0x55'))['format'](_0x3f4a('0x3d'));_0x3e182f['ContactId']=_0x10a913[_0x3f4a('0x56')];_0x3e182f['ListId']=_0x10a913[_0x3f4a('0x57')];_0x3e182f[_0x3f4a('0x1b')]=_0x10a913['VoiceQueueId']||undefined;return _0x3e182f;};exports[_0x3f4a('0x58')]=function(_0x571199,_0x1966e9){if(!_[_0x3f4a('0x14')](_0x571199)){if(_0x571199['pTalking']>0x0){_0x571199['pTalking']-=0x1;}else{logger[_0x3f4a('0x7')](_0x1966e9,_0x3f4a('0x59'));}}else{logger[_0x3f4a('0x7')](_0x1966e9,_0x3f4a('0x5a'));}};exports[_0x3f4a('0x5b')]=function(_0x537613){if(_0x537613<=0x0){return!![];}return![];};function buildObj(_0x4b24a6,_0x39a361,_0x2bf240){_0x4b24a6[_0x3f4a('0x5c')]=_0x39a361;_0x4b24a6[_0x3f4a('0x17')]=_0x4b24a6[_0x3f4a('0x5d')];_0x4b24a6['interface']=_0x4b24a6['channelAgent'];_0x4b24a6[_0x3f4a('0x5e')]=_0x3f4a('0x5f');if(_0x2bf240){_0x4b24a6[_0x3f4a('0x60')]=_0x2bf240[_0x3f4a('0x60')];}return _0x4b24a6;}exports[_0x3f4a('0x61')]=buildObj;exports[_0x3f4a('0x62')]=function(_0x168acc){var _0x45e71d={};_0x45e71d['queue']=_0x168acc['queue'];_0x45e71d[_0x3f4a('0x63')]=_0x168acc[_0x3f4a('0x64')];_0x45e71d['uniqueid']=_0x168acc[_0x3f4a('0x4a')];return _0x45e71d;};exports[_0x3f4a('0x65')]=function(_0x971db){var _0x1a447c=[];for(var _0x1e8237 in _0x971db){if(_0x971db[_0x3f4a('0x2a')](_0x1e8237)){if(!_[_0x3f4a('0x14')](_0x971db[_0x1e8237])&&_0x971db[_0x1e8237][_0x3f4a('0x36')]===_0x3f4a('0x66')&&_0x971db[_0x1e8237]['status']==='reachable'){_0x1a447c[_0x3f4a('0x67')](_0x971db[_0x1e8237]['id']);}}}return _0x1a447c;};exports['getDiff']=function(_0x435e72){var _0x33d084=moment()[_0x3f4a('0x68')](0x0);var _0x7832b1=moment(_0x435e72)[_0x3f4a('0x68')](0x0);return _0x33d084['diff'](_0x7832b1,_0x3f4a('0x69'));};exports['createBody']=function(_0x158f75){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x158f75[_0x3f4a('0x56')],'ListId':_0x158f75[_0x3f4a('0x57')],'VoiceQueueId':_0x158f75[_0x3f4a('0x1b')]||undefined,'CampaignId':_0x158f75['CampaignId']||undefined};};exports[_0x3f4a('0x6a')]=function(_0x51c63c){if(_0x51c63c===_0x3f4a('0x4a')||_0x51c63c===_0x3f4a('0x6b')||_0x51c63c==='queue'||_0x51c63c===_0x3f4a('0x6c')||_0x51c63c===_0x3f4a('0x6d')||_0x51c63c==='dialAnswer'||_0x51c63c==='membername'||_0x51c63c===_0x3f4a('0x64')||_0x51c63c===_0x3f4a('0x18')||_0x51c63c===_0x3f4a('0x53')||_0x51c63c==='calleridnum'||_0x51c63c===_0x3f4a('0x54')||_0x51c63c===_0x3f4a('0x6e')||_0x51c63c===_0x3f4a('0x4c')||_0x51c63c===_0x3f4a('0x4d')||_0x51c63c===_0x3f4a('0x6f')||_0x51c63c===_0x3f4a('0x70')||_0x51c63c===_0x3f4a('0x71')||_0x51c63c===_0x3f4a('0x72')||_0x51c63c===_0x3f4a('0x73')||_0x51c63c===_0x3f4a('0x56')||_0x51c63c===_0x3f4a('0x57')||_0x51c63c==='UserId'||_0x51c63c===_0x3f4a('0x1b')||_0x51c63c==='sipcallid'||_0x51c63c===_0x3f4a('0x74')||_0x51c63c===_0x3f4a('0x75')||_0x51c63c===_0x3f4a('0x76')||_0x51c63c===_0x3f4a('0x77')||_0x51c63c===_0x3f4a('0x78')||_0x51c63c===_0x3f4a('0x79')||_0x51c63c===_0x3f4a('0x7a')||_0x51c63c==='xmd-dialid'||_0x51c63c===_0x3f4a('0x7b')||_0x51c63c===_0x3f4a('0x7c')||_0x51c63c===_0x3f4a('0x7d')||_0x51c63c===_0x3f4a('0x7e')||_0x51c63c===_0x3f4a('0x7f')||_0x51c63c===_0x3f4a('0x80')||_0x51c63c===_0x3f4a('0x81')||_0x51c63c==='rtpaudioqosbridged'||_0x51c63c===_0x3f4a('0x82')||_0x51c63c==='rtpaudioqosjitterbridged'||_0x51c63c===_0x3f4a('0x83')||_0x51c63c===_0x3f4a('0x84')||_0x51c63c===_0x3f4a('0x85')||_0x51c63c===_0x3f4a('0x86')||_0x51c63c==='rtpaudioqos'||_0x51c63c===_0x3f4a('0x87')||_0x51c63c===_0x3f4a('0x82')||_0x51c63c==='rtpaudioqosjitterbridged'||_0x51c63c===_0x3f4a('0x83')||_0x51c63c===_0x3f4a('0x84')||_0x51c63c===_0x3f4a('0x85')||_0x51c63c===_0x3f4a('0x86')||_0x51c63c===_0x3f4a('0x88')||_0x51c63c===_0x3f4a('0x89')||_0x51c63c===_0x3f4a('0x36')||_0x51c63c===_0x3f4a('0x37')){return![];}return!![];};exports[_0x3f4a('0x8a')]=function(_0x5e18c7,_0x3d1b75){var _0x5b7e4d,_0x50f650,_0xace088;if(_0x3d1b75<=0x0){_0x3d1b75=0x1;}_0x5b7e4d=new RegExp(_0x3f4a('0x8b')+_0x3d1b75+'}$');_0x50f650=Math[_0x3f4a('0x8c')](0xa,_0x3d1b75-0x1);_0xace088=Math['pow'](0xa,_0x3d1b75)-0x1;return util[_0x3f4a('0x11')]('%s',_['replace'](_0x5e18c7,_0x5b7e4d,_[_0x3f4a('0x8d')](_0x50f650,_0xace088)));};exports['extractCalleridName']=function(_0x14a2e3){var _0xfdab8d=_0x14a2e3[_0x3f4a('0x8e')](/"(.*?)"/);return _0xfdab8d?_0xfdab8d[0x1]:_0x14a2e3;};exports['extractCalleridNumber']=function(_0x474090){var _0xa3007=_0x474090[_0x3f4a('0x8e')](/<(.*?)>/);return _0xa3007?_0xa3007[0x1]:_0x474090;};function buildNoAnswerEventPayload(_0x311ef2,_0x3dac9b){var _0x1cf0bc=buildObj(_0x311ef2,_0x3f4a('0x8f'));if(!_[_0x3f4a('0x10')](_0x3dac9b[_0x3f4a('0x90')])){Object[_0x3f4a('0x91')](_0x3dac9b[_0x3f4a('0x90')])[_0x3f4a('0x92')](function(_0x14e660){_0x1cf0bc[_0x14e660[_0x3f4a('0x93')]()]=_0x3dac9b['variables'][_0x14e660];});}return _0x1cf0bc;}exports[_0x3f4a('0x94')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xa72b=['agentReadyId','not_inuse','status','reachable','push','milliseconds','diff','seconds','createBody','VoiceQueueId','CampaignId','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','keys','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','inspect','logger','info','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','logAgent','responsetime','getSeconds','starttime','membername','UserId','logCustomer','statedesc','endtime','ringtime','talktime','answertime','isFailure','variablesAction','BOOKED','channelAgent','from-sip','uniqueid','totalGlobal','countbusyretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','add','minutes','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','interface','mandatoryDisposition','buildObj','buildAcw','queue'];(function(_0x372129,_0x539547){var _0x2385b4=function(_0x17969f){while(--_0x17969f){_0x372129['push'](_0x372129['shift']());}};_0x2385b4(++_0x539547);}(_0xa72b,0x14c));var _0xba72=function(_0xf3e375,_0x5dc1c9){_0xf3e375=_0xf3e375-0x0;var _0x27027b=_0xa72b[_0xf3e375];return _0x27027b;};'use strict';var util=require(_0xba72('0x0'));var _=require(_0xba72('0x1'));var moment=require(_0xba72('0x2'));var logger=require(_0xba72('0x3'))(_0xba72('0x4'));var ipAgi=process[_0xba72('0x5')][_0xba72('0x6')]||_0xba72('0x7');var utils=require('../../dialer/utils');exports[_0xba72('0x8')]=function(_0xa42506){return function(_0x20781b){logger[_0xba72('0x9')](_0xa42506,util[_0xba72('0xa')](_0x20781b,{'showHidden':![],'depth':null}));};};exports[_0xba72('0xb')]=function(_0x20a53b,_0x2c3bfd){logger['info'](_0x20a53b,util['inspect'](_0x2c3bfd,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x26c97f,_0x57212a){logger[_0xba72('0x9')](_0x26c97f,util[_0xba72('0xa')](_0x57212a,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3268bf){return function(_0x12090c){logger[_0xba72('0xc')](_0x3268bf,util['inspect'](_0x12090c,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x38937e,_0x4ea988,_0x5677a3){return{'message':_0x38937e,'unlock':_0x4ea988,'active':_0x5677a3};};exports[_0xba72('0xd')]=function(_0x85d09f,_0x3d0b64,_0x2ff90f){if(!_[_0xba72('0xe')](_0x2ff90f)&&'string'===typeof _0x2ff90f&&!_['isEmpty'](_0x2ff90f)){if(!_[_0xba72('0xe')](_0x3d0b64)&&'string'===typeof _0x3d0b64&&!_[_0xba72('0xf')](_0x3d0b64)){return util[_0xba72('0x10')](_0xba72('0x11'),_0x3d0b64,_0x2ff90f);}return util['format'](_0xba72('0x11'),_0x2ff90f,_0x2ff90f);}if(!_[_0xba72('0xe')](_0x85d09f)&&_0xba72('0x12')===typeof _0x85d09f&&!_['isEmpty'](_0x85d09f)){return _0x85d09f;}return _0xba72('0x13');};exports[_0xba72('0x14')]=function(_0x1536db){if(_['isNil'](_0x1536db)){return![];}return _0x1536db;};exports[_0xba72('0x15')]=function(_0x470cfa,_0x5550e1,_0x3d0222,_0xf10a56,_0x2da2af,_0x28c433){var _0x8688ab={'XMD-QUEUE':_0x5550e1['Queue']?_0x5550e1[_0xba72('0x16')][_0xba72('0x17')]:'','XMD-CALLERID':_0xf10a56,'XMD-CALLERID-PREVIEW':_0x28c433?util[_0xba72('0x10')](_0xba72('0x11'),_0x28c433[_0xba72('0x18')],_0x28c433['calleridnum']):_0xf10a56,'XMD-DIALID':_0x2da2af,'XMD-CONTACTID':_0x5550e1[_0xba72('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xf10a56,'XMD-VOICEQUEUEID':_0x5550e1['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3d0222,'XMD-DIALTIMEOUT':_0x470cfa[_0xba72('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xba72('0x10')](_0xba72('0x1b'),_0x470cfa['dialQueueProject2']?'g':'',_['isEmpty'](_0x470cfa[_0xba72('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x470cfa['dialPreviewUrl']||'','XMD-AGI':_0x470cfa[_0xba72('0x1d')]?util['format'](_0xba72('0x1e'),ipAgi,_0x470cfa[_0xba72('0x1d')]):_0xba72('0x1f'),'XMD-AGIAFTER':_0x470cfa['dialQueueProject2']?util[_0xba72('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x470cfa[_0xba72('0x20')]):_0xba72('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x28c433?_0x28c433[_0xba72('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x28c433?_0x28c433[_0xba72('0x22')]:'','XMD-DESTINATION':_0xba72('0x23'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x470cfa['monitor_format'])){_0x8688ab[util[_0xba72('0x10')]('%s',_0xba72('0x24'))]=_0x470cfa['monitor_format'];_0x8688ab[util['format']('%s',_0xba72('0x25'))]=_0x2da2af;}if(_0x5550e1&&_0x5550e1['Contact']){for(var _0x580a5a in _0x5550e1['Contact']){if(_0x5550e1[_0xba72('0x26')]['hasOwnProperty'](_0x580a5a)){if(!_[_0xba72('0x27')](_0x5550e1[_0xba72('0x26')][_0x580a5a])&&_0x580a5a!=='id'&&_0x580a5a!==_0xba72('0x28')&&_0x580a5a!==_0xba72('0x29')&&_0x580a5a!==_0xba72('0x2a')){_0x8688ab[util['format'](_0xba72('0x2b'),_0xba72('0x2c'),_[_0xba72('0x2d')](_0x580a5a))]=_0x5550e1[_0xba72('0x26')][_0x580a5a];}}}}return _0x8688ab;};exports[_0xba72('0x2e')]=function(_0x59edc0){var _0x222d19={};for(var _0xc561bd in _0x59edc0){if(_0x59edc0[_0xba72('0x2f')](_0xc561bd)){_0x222d19[util[_0xba72('0x10')]('%s',_['toLower'](_0xc561bd))]=_0x59edc0[_0xc561bd];}}return{'variables':_0x222d19};};exports[_0xba72('0x30')]=function(_0x287aec,_0xdf5bb6){if(!_[_0xba72('0x27')](_0x287aec)){if(_0x287aec[_0xba72('0x2f')](_0xba72('0x31'))){if(_0x287aec[_0xba72('0x31')]>0x0){_0x287aec[_0xba72('0x31')]-=0x1;}else{logger[_0xba72('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0xdf5bb6);}}}else{logger['error'](_0xba72('0x32'),_0xdf5bb6);}};exports[_0xba72('0x33')]=function(_0x5b5cc1){var _0x995e31=moment()['format'](_0xba72('0x34'));_0x5b5cc1[_0xba72('0x35')]=0xd;_0x5b5cc1['statedesc']=_0xba72('0x36');_0x5b5cc1['starttime']=_0x995e31;_0x5b5cc1['responsetime']=_0x995e31;_0x5b5cc1['endtime']=_0x995e31;};exports[_0xba72('0x37')]=function(_0x141670,_0x343784,_0x28ed32){var _0x1ead95=moment()['format'](_0xba72('0x34'));_0x141670[_0xba72('0x35')]=_0x343784;_0x141670['statedesc']=_0x28ed32;_0x141670[_0xba72('0x38')]=_0x1ead95;_0x141670['ringtime']=utils[_0xba72('0x39')](_0x141670[_0xba72('0x38')],_0x141670[_0xba72('0x3a')]);};exports['logLookAgent']=function(_0x370524,_0x1da85b,_0x3f7851){_0x370524[_0xba72('0x3b')]=_0x1da85b;_0x370524[_0xba72('0x3c')]=_0x3f7851;};exports[_0xba72('0x3d')]=function(_0x139835,_0x568fa3,_0x570eb0){var _0x525878=moment()[_0xba72('0x10')](_0xba72('0x34'));_0x139835[_0xba72('0x35')]=_0x568fa3;_0x139835[_0xba72('0x3e')]=_0x570eb0;_0x139835['responsetime']=_0x139835[_0xba72('0x38')]?_0x139835[_0xba72('0x38')]:_0x525878;_0x139835[_0xba72('0x3f')]=_0x139835['endtime']?_0x139835[_0xba72('0x3f')]:_0x525878;_0x139835[_0xba72('0x40')]=utils[_0xba72('0x39')](_0x139835[_0xba72('0x38')]||0x0,_0x139835[_0xba72('0x3a')]||0x0);_0x139835[_0xba72('0x41')]=_0x139835[_0xba72('0x42')]?utils[_0xba72('0x39')](_0x139835['endtime'],_0x139835[_0xba72('0x42')]):0x0;};exports[_0xba72('0x43')]=function(_0x23cdbb){return _0x23cdbb==='Failure';};exports[_0xba72('0x44')]=function(_0x13f120,_0x448902,_0x40fd70,_0x406c49,_0x2192fa){var _0x476dab=_0x406c49?'RECALL':_0x13f120[_0xba72('0x18')];_0x476dab=_0x2192fa?_0xba72('0x45'):_0x476dab;return{'actionid':_0x13f120['uniqueid'],'action':'originate','channel':_0x13f120[_0xba72('0x46')],'callerid':util[_0xba72('0x10')]('\x22%s\x22\x20<%s>',_0x476dab,_0x13f120['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xba72('0x47'),'Priority':'1','variable':_0x40fd70,'timeout':(_0x448902['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x13f120[_0xba72('0x48')]};};exports[_0xba72('0x49')]=function(_0x3f2295){return _0x3f2295[_0xba72('0x4a')]+_0x3f2295['countcongestionretry']+_0x3f2295['countnoanswerretry']+_0x3f2295[_0xba72('0x4b')]+_0x3f2295[_0xba72('0x4c')];};exports[_0xba72('0x4d')]=function(_0x6f4506){var _0xde3936=_[_0xba72('0x4e')](_0x6f4506);_0xde3936['state']=0xf;_0xde3936[_0xba72('0x3e')]='Global';return _0xde3936;};exports[_0xba72('0x4f')]=function(_0x208b12,_0xf7eb05,_0x5e0ef8){var _0x5b764a={};_0x5b764a[_0xf7eb05]=_0x208b12[_0xf7eb05];_0x5b764a['active']=![];_0x5b764a['scheduledat']=moment()[_0xba72('0x50')](_0x5e0ef8,_0xba72('0x51'))[_0xba72('0x10')](_0xba72('0x34'));_0x5b764a[_0xba72('0x19')]=_0x208b12['ContactId'];_0x5b764a[_0xba72('0x52')]=_0x208b12[_0xba72('0x52')];_0x5b764a['VoiceQueueId']=_0x208b12['VoiceQueueId']||undefined;return _0x5b764a;};exports['decrementTalkink']=function(_0x48500f,_0x1da73c){if(!_[_0xba72('0x27')](_0x48500f)){if(_0x48500f[_0xba72('0x53')]>0x0){_0x48500f[_0xba72('0x53')]-=0x1;}else{logger[_0xba72('0x9')](_0x1da73c,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xba72('0x9')](_0x1da73c,_0xba72('0x54'));}};exports['IsNotLoggedIn']=function(_0x2577f3){if(_0x2577f3<=0x0){return!![];}return![];};function buildObj(_0x59e6dc,_0x9af84c,_0x3be77){_0x59e6dc[_0xba72('0x55')]=_0x9af84c;_0x59e6dc[_0xba72('0x17')]=_0x59e6dc['queue'];_0x59e6dc[_0xba72('0x56')]=_0x59e6dc['channelAgent'];_0x59e6dc['motionChannel']='voice';if(_0x3be77){_0x59e6dc['mandatoryDisposition']=_0x3be77[_0xba72('0x57')];}return _0x59e6dc;}exports[_0xba72('0x58')]=buildObj;exports[_0xba72('0x59')]=function(_0x1d67ba){var _0x2c7eee={};_0x2c7eee[_0xba72('0x5a')]=_0x1d67ba['queue'];_0x2c7eee[_0xba72('0x56')]=_0x1d67ba[_0xba72('0x46')];_0x2c7eee['uniqueid']=_0x1d67ba['uniqueid'];return _0x2c7eee;};exports[_0xba72('0x5b')]=function(_0x46b521){var _0x1a341f=[];for(var _0x1348b0 in _0x46b521){if(_0x46b521['hasOwnProperty'](_0x1348b0)){if(!_[_0xba72('0x27')](_0x46b521[_0x1348b0])&&_0x46b521[_0x1348b0][_0xba72('0x35')]===_0xba72('0x5c')&&_0x46b521[_0x1348b0][_0xba72('0x5d')]===_0xba72('0x5e')){_0x1a341f[_0xba72('0x5f')](_0x46b521[_0x1348b0]['id']);}}}return _0x1a341f;};exports['getDiff']=function(_0x8c4206){var _0x185ca1=moment()['milliseconds'](0x0);var _0x111789=moment(_0x8c4206)[_0xba72('0x60')](0x0);return _0x185ca1[_0xba72('0x61')](_0x111789,_0xba72('0x62'));};exports[_0xba72('0x63')]=function(_0x4ae512){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4ae512['ContactId'],'ListId':_0x4ae512[_0xba72('0x52')],'VoiceQueueId':_0x4ae512[_0xba72('0x64')]||undefined,'CampaignId':_0x4ae512[_0xba72('0x65')]||undefined};};exports[_0xba72('0x66')]=function(_0x45b19a){if(_0x45b19a===_0xba72('0x48')||_0x45b19a===_0xba72('0x67')||_0x45b19a===_0xba72('0x5a')||_0x45b19a==='type'||_0x45b19a===_0xba72('0x68')||_0x45b19a===_0xba72('0x69')||_0x45b19a===_0xba72('0x3b')||_0x45b19a===_0xba72('0x46')||_0x45b19a===_0xba72('0x18')||_0x45b19a==='active'||_0x45b19a==='calleridnum'||_0x45b19a===_0xba72('0x6a')||_0x45b19a===_0xba72('0x4a')||_0x45b19a===_0xba72('0x6b')||_0x45b19a==='countnoanswerretry'||_0x45b19a===_0xba72('0x6c')||_0x45b19a===_0xba72('0x6d')||_0x45b19a===_0xba72('0x6e')||_0x45b19a===_0xba72('0x6f')||_0x45b19a===_0xba72('0x70')||_0x45b19a===_0xba72('0x19')||_0x45b19a===_0xba72('0x52')||_0x45b19a===_0xba72('0x3c')||_0x45b19a===_0xba72('0x64')||_0x45b19a==='sipcallid'||_0x45b19a===_0xba72('0x71')||_0x45b19a===_0xba72('0x72')||_0x45b19a===_0xba72('0x73')||_0x45b19a===_0xba72('0x74')||_0x45b19a==='xmd-dialurl'||_0x45b19a==='xmd-dialtimeout'||_0x45b19a===_0xba72('0x75')||_0x45b19a===_0xba72('0x76')||_0x45b19a===_0xba72('0x77')||_0x45b19a===_0xba72('0x78')||_0x45b19a==='xmd-cdrtype'||_0x45b19a===_0xba72('0x79')||_0x45b19a===_0xba72('0x7a')||_0x45b19a==='xmd-agi'||_0x45b19a===_0xba72('0x7b')||_0x45b19a===_0xba72('0x7c')||_0x45b19a==='rtpaudioqosjitter'||_0x45b19a===_0xba72('0x7d')||_0x45b19a===_0xba72('0x7e')||_0x45b19a==='rtpaudioqoslossbridged'||_0x45b19a==='rtpaudioqosrtt'||_0x45b19a==='rtpaudioqosrttbridged'||_0x45b19a===_0xba72('0x7b')||_0x45b19a===_0xba72('0x7c')||_0x45b19a==='rtpaudioqosjitter'||_0x45b19a===_0xba72('0x7d')||_0x45b19a===_0xba72('0x7e')||_0x45b19a===_0xba72('0x7f')||_0x45b19a==='rtpaudioqosrtt'||_0x45b19a===_0xba72('0x80')||_0x45b19a==='bridgepeer'||_0x45b19a===_0xba72('0x81')||_0x45b19a==='state'||_0x45b19a===_0xba72('0x3e')){return![];}return!![];};exports[_0xba72('0x82')]=function(_0xb97e19,_0x238593){var _0x207245,_0xbdcfa0,_0x12ed4b;if(_0x238593<=0x0){_0x238593=0x1;}_0x207245=new RegExp(_0xba72('0x83')+_0x238593+'}$');_0xbdcfa0=Math[_0xba72('0x84')](0xa,_0x238593-0x1);_0x12ed4b=Math[_0xba72('0x84')](0xa,_0x238593)-0x1;return util['format']('%s',_[_0xba72('0x85')](_0xb97e19,_0x207245,_[_0xba72('0x86')](_0xbdcfa0,_0x12ed4b)));};exports[_0xba72('0x87')]=function(_0x3dbcde){var _0x3ce403=_0x3dbcde[_0xba72('0x88')](/"(.*?)"/);return _0x3ce403?_0x3ce403[0x1]:_0x3dbcde;};exports['extractCalleridNumber']=function(_0x26ab12){var _0x3c0749=_0x26ab12['match'](/<(.*?)>/);return _0x3c0749?_0x3c0749[0x1]:_0x26ab12;};function buildNoAnswerEventPayload(_0x5e6ede,_0x451791){var _0x247805=buildObj(_0x5e6ede,_0xba72('0x89'));if(!_[_0xba72('0xf')](_0x451791[_0xba72('0x8a')])){Object[_0xba72('0x8b')](_0x451791[_0xba72('0x8a')])['forEach'](function(_0x140890){_0x247805[_0x140890['toLowerCase']()]=_0x451791['variables'][_0x140890];});}return _0x247805;}exports[_0xba72('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a7b5d4f..9184a13 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 _0xe134=['boolean','queueremove','reload','voicechannel','voicequeuechannelhangup','string','number'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0xe134,0x1da));var _0x4e13=function(_0x1c78d0,_0x4029d0){_0x1c78d0=_0x1c78d0-0x0;var _0x46608c=_0xe134[_0x1c78d0];return _0x46608c;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x4e13('0x0'),'required':!![]},'membername':{'type':_0x4e13('0x0'),'required':!![]},'penalty':{'type':_0x4e13('0x1'),'required':![]},'paused':{'type':_0x4e13('0x2'),'required':![]}};exports[_0x4e13('0x3')]={'queue':{'type':_0x4e13('0x0'),'required':!![]},'interface':{'type':_0x4e13('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x4e13('0x0'),'required':!![]},'paused':{'type':_0x4e13('0x2')},'reason':{'type':_0x4e13('0x0'),'required':![]}};exports[_0x4e13('0x4')]={'module':{'type':_0x4e13('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x4e13('0x0'),'required':!![]}};exports[_0x4e13('0x5')]={'uniqueid':{'type':_0x4e13('0x0'),'required':!![]},'filename':{'type':_0x4e13('0x0')},'format':{'type':_0x4e13('0x0')},'mixmonitorid':{'type':_0x4e13('0x0')}};exports[_0x4e13('0x6')]={'uniqueid':{'type':_0x4e13('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x4e13('0x0'),'required':!![]},'exten':{'type':_0x4e13('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xbc2f=['boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbc2f,0x1d3));var _0xfbc2=function(_0x4be16c,_0x400092){_0x4be16c=_0x4be16c-0x0;var _0x2c780a=_0xbc2f[_0x4be16c];return _0x2c780a;};'use strict';exports[_0xfbc2('0x0')]={'queue':{'type':_0xfbc2('0x1'),'required':!![]},'interface':{'type':_0xfbc2('0x1'),'required':!![]},'membername':{'type':_0xfbc2('0x1'),'required':!![]},'penalty':{'type':_0xfbc2('0x2'),'required':![]},'paused':{'type':_0xfbc2('0x3'),'required':![]}};exports[_0xfbc2('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xfbc2('0x1'),'required':!![]}};exports[_0xfbc2('0x5')]={'interface':{'type':_0xfbc2('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0xfbc2('0x6')]={'module':{'type':_0xfbc2('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xfbc2('0x1'),'required':!![]}};exports[_0xfbc2('0x7')]={'uniqueid':{'type':_0xfbc2('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xfbc2('0x1')},'mixmonitorid':{'type':_0xfbc2('0x1')}};exports[_0xfbc2('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xfbc2('0x9')]={'uniqueid':{'type':_0xfbc2('0x1'),'required':!![]},'exten':{'type':_0xfbc2('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 72a4fcf..2b64893 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0x0b0e[_0x143565];return _0x4dc1d9;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2032,0xd9));var _0x2203=function(_0x2c56ae,_0x4a1101){_0x2c56ae=_0x2c56ae-0x0;var _0xc3e332=_0x2032[_0x2c56ae];return _0xc3e332;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 6f1291d..997975e 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 _0x9cae=['hasOwnProperty'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9cae,0x188));var _0xe9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9cae[_0x20a584];return _0x4b41a8;};'use strict';function mergeDBDataToRealtime(_0x522ce5,_0x5aa52f){var _0x6cdd6d=Object['assign']({},_0x522ce5);for(var _0x3f78ec in _0x5aa52f){if(_0x6cdd6d[_0xe9ca('0x0')](_0x3f78ec)){_0x6cdd6d[_0x3f78ec]=_0x5aa52f[_0x3f78ec];}}return _0x6cdd6d;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x037e=['hasOwnProperty'];(function(_0x2f50b6,_0xd09fe3){var _0x54b027=function(_0x680941){while(--_0x680941){_0x2f50b6['push'](_0x2f50b6['shift']());}};_0x54b027(++_0xd09fe3);}(_0x037e,0xe7));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';function mergeDBDataToRealtime(_0x41d888,_0x1b0051){var _0x553d02=Object['assign']({},_0x41d888);for(var _0x96ff34 in _0x1b0051){if(_0x553d02[_0xe037('0x0')](_0x96ff34)){_0x553d02[_0x96ff34]=_0x1b0051[_0x96ff34];}}return _0x553d02;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 4772e05..8dc4b80 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 _0x107c=['voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','isNil','find','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','getCallType','channel','split','outbound','internal','destination','exten','type','dialer','lastapplication','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','uniqueid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','voiceAgentReport','isArray','forEach','create','startsWith','Local','substring','indexOf','mobile','phone','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0x107c,0x1c5));var _0xc107=function(_0x1cd577,_0x180f2a){_0x1cd577=_0x1cd577-0x0;var _0x790837=_0x107c[_0x1cd577];return _0x790837;};'use strict';var _=require(_0xc107('0x0'));var moment=require('moment');var util=require(_0xc107('0x1'));var config=require(_0xc107('0x2'));var ami=require(_0xc107('0x3'));var RpcVoiceAgentReport=require(_0xc107('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xc107('0x5'));var RpcMemberReport=require(_0xc107('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xc107('0x7'));var RpcVoiceTransferReport=require(_0xc107('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xc107('0x9'));var VoiceAgentReport=require(_0xc107('0xa'));var VoiceDialReport=require(_0xc107('0xb'));var UserReport=require(_0xc107('0xc'));function Report(_0x39e262){this[_0xc107('0xd')]=_0x39e262;this[_0xc107('0xe')]=_0x39e262[_0xc107('0xe')];this[_0xc107('0xf')]=_0x39e262[_0xc107('0xf')];}Report[_0xc107('0x10')][_0xc107('0x11')]=function(_0xc75cdc){var _0x12320d=new VoiceQueueReport(this[_0xc107('0xd')]);var _0x4a40b9=new VoiceAgentReport(this[_0xc107('0xd')]);var _0x2f8591=new VoiceDialReport(this[_0xc107('0xd')]);var _0xed3876=new VoiceCallReport(this['realtime']);var _0x38b551=new UserReport(this['realtime']);if(config['xdr']&&config[_0xc107('0x12')][_0xc107('0x13')]){ami['on'](_0xc107('0x14'),this[_0xc107('0x15')][_0xc107('0x16')](this));ami['on'](_0xc107('0x17'),this[_0xc107('0x18')][_0xc107('0x16')](this));ami['on'](_0xc107('0x19'),this['voiceAgentReport'][_0xc107('0x16')](this));ami['on'](_0xc107('0x1a'),this[_0xc107('0x1b')][_0xc107('0x16')](this));ami['on'](_0xc107('0x1c'),this['blindTransfer']['bind'](this));ami['on'](_0xc107('0x1d'),this[_0xc107('0x1e')]['bind'](this));}};Report[_0xc107('0x10')][_0xc107('0x1f')]=function(_0x4532f9){var _0x409ccf;_0x409ccf=_['find'](this[_0xc107('0xe')],function(_0x43c7e5){return _0x43c7e5[_0xc107('0x20')]==_0x4532f9||_0x43c7e5['name']==_0x4532f9;});if(_[_0xc107('0x21')](_0x409ccf)){var _0xa5f032=_[_0xc107('0x22')](this['telephones'],function(_0x5114a2){return _0x5114a2[_0xc107('0x20')]==_0x4532f9||_0x5114a2[_0xc107('0x23')]==_0x4532f9;});if(_0xa5f032){_0x409ccf=_[_0xc107('0x22')](this[_0xc107('0xe')],function(_0x5410b6){return _0x5410b6[_0xc107('0x24')]==util[_0xc107('0x25')](_0xc107('0x26'),_0xa5f032['name']);});}}return _0x409ccf;};Report[_0xc107('0x10')]['voiceQueueReport']=function(_0x571dd5){for(var _0x4a5cf6=0x0;_0x4a5cf6<_0x571dd5[_0xc107('0x27')];_0x4a5cf6+=0x1){var _0x4d8982=this[_0xc107('0x1f')](_0x571dd5[_0x4a5cf6][_0xc107('0x28')]);if(_0x4d8982){_0x571dd5[_0x4a5cf6][_0xc107('0x20')]=_0x4d8982[_0xc107('0x20')];_0x571dd5[_0x4a5cf6][_0xc107('0x29')]=!![];_0x571dd5[_0x4a5cf6][_0xc107('0x2a')]=_0x4d8982[_0xc107('0x23')];_0x571dd5[_0x4a5cf6][_0xc107('0x24')]=_[_0xc107('0x21')](_0x4d8982[_0xc107('0x24')])?util['format']('SIP/%s',_0x4d8982['name']):_0x4d8982[_0xc107('0x24')];if(_0x571dd5[_0x4a5cf6]['queuecallercomplete']){_0x571dd5[_0x4a5cf6][_0xc107('0x2b')]=moment()[_0xc107('0x25')](_0xc107('0x2c'));}if(_0x571dd5[_0x4a5cf6][_0xc107('0x2d')]){_0x571dd5[_0x4a5cf6][_0xc107('0x2e')]=moment()[_0xc107('0x25')](_0xc107('0x2c'));}RpcMemberReport[_0xc107('0x15')](_0x571dd5[_0x4a5cf6]);}RpcVoiceQueueReport['create'](_0x571dd5[_0x4a5cf6]);}};function extractCalleridNumber(_0x4ca622){var _0x29bf7e=_0x4ca622[_0xc107('0x2f')](/<(.*?)>/);return _0x29bf7e?_0x29bf7e[0x1]:_0x4ca622;}Report['prototype'][_0xc107('0x30')]=function(_0x8f667){for(var _0x23442a=0x0;_0x23442a','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','forEach','voiceDialReport','startsWith','substring','indexOf','phone','lastIndexOf','findAgent','transfererlinkedid','lodash','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled'];(function(_0x5d8792,_0x4f5438){var _0x986d0e=function(_0x1d4b83){while(--_0x1d4b83){_0x5d8792['push'](_0x5d8792['shift']());}};_0x986d0e(++_0x4f5438);}(_0xd3da,0x151));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xad3d('0x0'));var moment=require('moment');var util=require('util');var config=require(_0xad3d('0x1'));var ami=require(_0xad3d('0x2'));var RpcVoiceAgentReport=require(_0xad3d('0x3'));var RpcVoiceCallReport=require(_0xad3d('0x4'));var RpcVoiceDialReport=require(_0xad3d('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xad3d('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xad3d('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xad3d('0x8'));var VoiceAgentReport=require(_0xad3d('0x9'));var VoiceDialReport=require(_0xad3d('0xa'));var UserReport=require(_0xad3d('0xb'));function Report(_0x1164eb){this[_0xad3d('0xc')]=_0x1164eb;this[_0xad3d('0xd')]=_0x1164eb[_0xad3d('0xd')];this[_0xad3d('0xe')]=_0x1164eb[_0xad3d('0xe')];}Report[_0xad3d('0xf')][_0xad3d('0x10')]=function(_0x3805eb){var _0x42f811=new VoiceQueueReport(this['realtime']);var _0x1ce196=new VoiceAgentReport(this[_0xad3d('0xc')]);var _0x2e01da=new VoiceDialReport(this['realtime']);var _0x5a8e45=new VoiceCallReport(this[_0xad3d('0xc')]);var _0x3776cb=new UserReport(this[_0xad3d('0xc')]);if(config[_0xad3d('0x11')]&&config['xdr'][_0xad3d('0x12')]){ami['on'](_0xad3d('0x13'),this[_0xad3d('0x14')][_0xad3d('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xad3d('0x15')](this));ami['on'](_0xad3d('0x16'),this[_0xad3d('0x17')][_0xad3d('0x15')](this));ami['on'](_0xad3d('0x18'),this['voiceDialReport'][_0xad3d('0x15')](this));ami['on'](_0xad3d('0x19'),this['blindTransfer'][_0xad3d('0x15')](this));ami['on']('attendedtransfer',this[_0xad3d('0x1a')]['bind'](this));}};Report['prototype']['findAgent']=function(_0x1ed1b1){var _0x2818ca;_0x2818ca=_[_0xad3d('0x1b')](this[_0xad3d('0xd')],function(_0xf107a1){return _0xf107a1[_0xad3d('0x1c')]==_0x1ed1b1||_0xf107a1[_0xad3d('0x1d')]==_0x1ed1b1;});if(_[_0xad3d('0x1e')](_0x2818ca)){var _0x58d9f6=_['find'](this[_0xad3d('0xe')],function(_0x4fb962){return _0x4fb962[_0xad3d('0x1c')]==_0x1ed1b1||_0x4fb962[_0xad3d('0x1d')]==_0x1ed1b1;});if(_0x58d9f6){_0x2818ca=_[_0xad3d('0x1b')](this[_0xad3d('0xd')],function(_0x3a5889){return _0x3a5889[_0xad3d('0x1f')]==util['format'](_0xad3d('0x20'),_0x58d9f6['name']);});}}return _0x2818ca;};Report[_0xad3d('0xf')][_0xad3d('0x14')]=function(_0x1f0a80){for(var _0x121761=0x0;_0x121761<_0x1f0a80[_0xad3d('0x21')];_0x121761+=0x1){var _0x415d81=this['findAgent'](_0x1f0a80[_0x121761]['connectedlinenum']);if(_0x415d81){_0x1f0a80[_0x121761]['accountcode']=_0x415d81[_0xad3d('0x1c')];_0x1f0a80[_0x121761][_0xad3d('0x22')]=!![];_0x1f0a80[_0x121761][_0xad3d('0x23')]=_0x415d81[_0xad3d('0x1d')];_0x1f0a80[_0x121761][_0xad3d('0x1f')]=_[_0xad3d('0x1e')](_0x415d81[_0xad3d('0x1f')])?util[_0xad3d('0x24')](_0xad3d('0x20'),_0x415d81[_0xad3d('0x1d')]):_0x415d81['interface'];if(_0x1f0a80[_0x121761]['queuecallercomplete']){_0x1f0a80[_0x121761][_0xad3d('0x25')]=moment()['format'](_0xad3d('0x26'));}if(_0x1f0a80[_0x121761]['queuecallerexit']){_0x1f0a80[_0x121761][_0xad3d('0x27')]=moment()['format'](_0xad3d('0x26'));}RpcMemberReport[_0xad3d('0x14')](_0x1f0a80[_0x121761]);}RpcVoiceQueueReport[_0xad3d('0x28')](_0x1f0a80[_0x121761]);}};function extractCalleridNumber(_0x3b971b){var _0x5890d4=_0x3b971b[_0xad3d('0x29')](/<(.*?)>/);return _0x5890d4?_0x5890d4[0x1]:_0x3b971b;}Report[_0xad3d('0xf')][_0xad3d('0x2a')]=function(_0x11812e){for(var _0x565192=0x0;_0x5651920x0?!![]:![];if(!_0x5df506){return this[_0x1448('0x19')](this[_0x1448('0x47')][_0x1448('0x6c')]);}};VoiceQueueReport['prototype'][_0x1448('0x1b')]=function(_0x3cffde){var _0x25403c=this['summary']['id'];if(this[_0x1448('0x47')]['queuestatus'][_0x25403c]&&this[_0x1448('0x47')][_0x1448('0x66')][_0x25403c][_0x3cffde[_0x1448('0x67')]]){this[_0x1448('0x47')][_0x1448('0x66')][_0x25403c][_0x3cffde[_0x1448('0x67')]][_0x1448('0x10')]['push'](_0x3cffde);}};VoiceQueueReport[_0x1448('0x38')][_0x1448('0x6d')]=function(_0xb90c48){var _0x27dd4b=this;try{if(this['isNotNull'](_0xb90c48)&&this['isNotNull'](_0xb90c48[_0x1448('0x51')])){logger[_0x1448('0x4b')](_0x1448('0x6e'),util[_0x1448('0x42')](_0xb90c48,{'showHidden':![],'depth':null}));var _0x2ebffc=this[_0x1448('0x13')][_0xb90c48[_0x1448('0x51')]];if(_0x2ebffc){logger[_0x1448('0x6f')](_0x1448('0x70'),_0x2ebffc[_0x1448('0x59')]);this[_0x1448('0x47')][_0x1448('0x5e')][_0x2ebffc[_0x1448('0x59')]]={'summaryEvent':_0xb90c48};this[_0x1448('0x47')]['statusRequests']+=0x1;return ami[_0x1448('0x5d')]({'action':_0x1448('0x66'),'queue':_0x2ebffc['name']})['then'](function(_0x41141a){if(!_0x27dd4b[_0x1448('0x47')][_0x1448('0x66')][_0xb90c48[_0x1448('0x67')]]){_0x27dd4b[_0x1448('0x47')][_0x1448('0x66')][_0xb90c48[_0x1448('0x67')]]={};}_0x27dd4b[_0x1448('0x47')][_0x1448('0x66')][_0xb90c48[_0x1448('0x67')]][_0x41141a['actionid']]={'queue':_0x2ebffc['name'],'agents':[]};})[_0x1448('0x3f')](function(_0x12801a){throw _0x12801a;});}}}catch(_0x1a1a4f){logger[_0x1448('0x41')](_0x1448('0x61'),util[_0x1448('0x42')](_0x1a1a4f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1448('0x38')]['syncQueueSummaryComplete']=function(_0x4e1cb2){if(this['summary'][_0x1448('0x6b')]>0x0){this['summary'][_0x1448('0x6c')]=_0x4e1cb2;return;}logger[_0x1448('0x4b')](_0x1448('0x71'),util[_0x1448('0x42')](_0x4e1cb2,{'showHidden':![],'depth':null}));this[_0x1448('0x47')]=initializeSummary();ami[_0x1448('0x49')](_0x1448('0x72'),{});};VoiceQueueReport[_0x1448('0x38')][_0x1448('0x1f')]=function(_0x3520d2){try{if(this['isNotNull'](_0x3520d2)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x3520d2[_0x1448('0x4e')],util[_0x1448('0x42')](_0x3520d2,{'showHidden':![],'depth':null}));if(_[_0x1448('0x5b')](this['queueReports'][_0x3520d2[_0x1448('0x4e')]])){this[_0x1448('0xe')][_0x3520d2['uniqueid']]=[];}if(_[_0x1448('0x5b')](this['channels'][_0x3520d2['uniqueid']])){this[_0x1448('0x11')][_0x3520d2[_0x1448('0x4e')]]={};}var _0x132257=new QueueReport();_0x132257[_0x1448('0x51')]=_0x3520d2[_0x1448('0x51')];_0x132257[_0x1448('0x68')]=this[_0x1448('0x13')][_0x132257[_0x1448('0x51')]]&&this[_0x1448('0x13')][_0x132257[_0x1448('0x51')]][_0x1448('0x68')]?this[_0x1448('0x13')][_0x132257[_0x1448('0x51')]][_0x1448('0x68')]||_0x1448('0x57'):_0x1448('0x57');_0x132257[_0x1448('0x73')]=moment()['format'](_0x1448('0x74'));_0x132257[_0x1448('0x75')]=_0x3520d2[_0x1448('0x75')];_0x132257['count']=_0x3520d2[_0x1448('0x76')];_0x132257[_0x1448('0x4e')]=_0x3520d2[_0x1448('0x4e')];_0x132257['routealias']=this[_0x1448('0x11')][_0x3520d2[_0x1448('0x4e')]][_0x1448('0x77')];logger[_0x1448('0x6f')](_0x1448('0x78'),_0x132257[_0x1448('0x51')],_0x132257[_0x1448('0x68')]);_['merge'](_0x132257,_[_0x1448('0x79')](_0x3520d2,_['keys'](_0x132257)));this[_0x1448('0xe')][_0x3520d2[_0x1448('0x4e')]][_0x1448('0x7a')](_0x132257);this[_0x1448('0x11')][_0x3520d2[_0x1448('0x4e')]]=_0x132257;this[_0x1448('0x4a')](_0x132257,_0x1448('0x1e'));}}catch(_0x58f405){logger['error'](_0x1448('0x7b'),_0x3520d2['uniqueid'],util[_0x1448('0x42')](_0x58f405,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1448('0x38')]['syncQueueCallerAbandon']=function(_0x3476b3){try{if(this[_0x1448('0x5a')](_0x3476b3)){logger['debug'](_0x1448('0x7c'),_0x3476b3[_0x1448('0x4e')],util[_0x1448('0x42')](_0x3476b3,{'showHidden':![],'depth':null}));if(this[_0x1448('0xe')][_0x3476b3[_0x1448('0x4e')]]){var _0x5b9bc4=_[_0x1448('0x7d')](this[_0x1448('0xe')][_0x3476b3[_0x1448('0x4e')]]);_0x5b9bc4[_0x1448('0x7e')]=![];_0x5b9bc4[_0x1448('0x7f')]=null;_0x5b9bc4[_0x1448('0x80')]=_0x3476b3[_0x1448('0x80')];_0x5b9bc4['originalposition']=_0x3476b3[_0x1448('0x81')];_0x5b9bc4['queuecallerabandon']=!![];_0x5b9bc4[_0x1448('0x82')]=moment()[_0x1448('0x4f')](_0x1448('0x74'));_0x5b9bc4[_0x1448('0x83')]=_0x1448('0x84');_0x5b9bc4['lastAssignedTo']=null;logger[_0x1448('0x6f')](_0x1448('0x85'),_0x5b9bc4['queue'],_0x5b9bc4[_0x1448('0x68')]);this[_0x1448('0x11')][_0x3476b3['uniqueid']]=_0x5b9bc4;this[_0x1448('0x48')](_0x5b9bc4,'queuecallerabandon');}}}catch(_0x4d1251){logger['error'](_0x1448('0x7c'),_0x3476b3[_0x1448('0x4e')],util[_0x1448('0x42')](_0x4d1251,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1448('0x38')]['syncQueueCallerLeave']=function(_0x4f6fc2){try{if(this[_0x1448('0x5a')](_0x4f6fc2)){logger[_0x1448('0x4b')](_0x1448('0x86'),_0x4f6fc2[_0x1448('0x4e')],util['inspect'](_0x4f6fc2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4f6fc2[_0x1448('0x4e')]]){var _0x170a4b=_[_0x1448('0x7d')](this[_0x1448('0xe')][_0x4f6fc2['uniqueid']]);_0x170a4b[_0x1448('0x87')]=moment()[_0x1448('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x170a4b[_0x1448('0x88')]=_0x4f6fc2[_0x1448('0x88')];_0x170a4b[_0x1448('0x89')]=_0x4f6fc2['connectedlinename'];logger['info'](_0x1448('0x8a'),_0x170a4b[_0x1448('0x51')],_0x170a4b[_0x1448('0x68')],_0x4f6fc2['connectedlinenum'],_0x4f6fc2['connectedlinename']);this[_0x1448('0x11')][_0x4f6fc2[_0x1448('0x4e')]]=_0x170a4b;this[_0x1448('0x4a')](_0x170a4b,_0x1448('0x8b'));}}}catch(_0x3f1706){logger[_0x1448('0x41')](_0x1448('0x86'),_0x4f6fc2[_0x1448('0x4e')],util[_0x1448('0x42')](_0x3f1706,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1448('0x38')][_0x1448('0x25')]=function(_0x1a344a){try{if(this['isNotNull'](_0x1a344a)){logger[_0x1448('0x4b')](_0x1448('0x8c'),_0x1a344a[_0x1448('0x4e')],util[_0x1448('0x42')](_0x1a344a,{'showHidden':![],'depth':null}));if(this[_0x1448('0xe')][_0x1a344a['uniqueid']]){var _0x5f4993=_['last'](this['queueReports'][_0x1a344a[_0x1448('0x4e')]]);_0x5f4993[_0x1448('0x7e')]=!![];_0x5f4993[_0x1448('0x83')]=_0x1448('0x8d');logger[_0x1448('0x6f')](_0x1448('0x8e'),_0x5f4993[_0x1448('0x51')],_0x5f4993[_0x1448('0x68')]);}}}catch(_0x437a1d){logger[_0x1448('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x1a344a[_0x1448('0x4e')],util['inspect'](_0x437a1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x436095){try{if(this[_0x1448('0x5a')](_0x436095)){logger['debug'](_0x1448('0x8f'),_0x436095['uniqueid'],util[_0x1448('0x42')](_0x436095,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x436095[_0x1448('0x4e')]]){var _0x18c0d4=_['last'](this['queueReports'][_0x436095[_0x1448('0x4e')]]);_0x18c0d4[_0x1448('0x20')]=![];_0x18c0d4[_0x1448('0x82')]=null;_0x18c0d4[_0x1448('0x90')]=!![];_0x18c0d4['lastAssignedTo']=_0x436095['membername'];_0x18c0d4[_0x1448('0x80')]=_0x436095[_0x1448('0x80')];_0x18c0d4[_0x1448('0x7e')]=!![];_0x18c0d4[_0x1448('0x91')]=![];_0x18c0d4[_0x1448('0x92')]=null;if(!_0x18c0d4[_0x1448('0x93')]){if(_0x436095[_0x1448('0x94')]=='transfer'){_0x18c0d4[_0x1448('0x83')]=_0x1448('0x95');logger[_0x1448('0x6f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x18c0d4[_0x1448('0x51')],_0x18c0d4[_0x1448('0x68')]);}else{if(_[_0x1448('0x96')](_0x436095[_0x1448('0x3e')]['toLowerCase'](),_0x1448('0x97'))){if(this['queueReports'][_0x436095[_0x1448('0x98')]]){var _0x3e684a=_[_0x1448('0x7d')](this['queueReports'][_0x436095[_0x1448('0x98')]]);_0x3e684a['queuecallercomplete']=![];_0x3e684a[_0x1448('0x91')]=!![];_0x3e684a[_0x1448('0x92')]=moment(_0x18c0d4['queuecallerjoinAt'])[_0x1448('0x99')](_0x436095[_0x1448('0x80')],_0x1448('0x9a'))[_0x1448('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e684a[_0x1448('0x83')]=_0x1448('0x9b');_0x3e684a[_0x1448('0x93')]=!![];_0x3e684a[_0x1448('0x9c')]=_0x1448('0x9d');_0x3e684a[_0x1448('0x9e')]=_0x436095[_0x1448('0x9f')];_0x3e684a[_0x1448('0xa0')]=_0x436095['uniqueid'];logger[_0x1448('0x6f')](_0x1448('0xa1'),_0x3e684a[_0x1448('0x51')],_0x3e684a[_0x1448('0x68')]);var _0x584c6f=this[_0x1448('0xe')][_0x436095[_0x1448('0x98')]];this[_0x1448('0xe')][_0x436095[_0x1448('0x98')]]=this['queueReports'][_0x436095[_0x1448('0x4e')]];this[_0x1448('0xe')][_0x436095[_0x1448('0x4e')]]=_0x584c6f;}}else{_0x18c0d4['queuecallerexitreason']='COMPLETEDBY'+_0x436095[_0x1448('0x94')][_0x1448('0xa2')]();logger[_0x1448('0x6f')](_0x1448('0xa3'),_0x18c0d4['queue'],_0x18c0d4[_0x1448('0x68')],_0x18c0d4['queuecallerexitreason']);}}}this[_0x1448('0x11')][_0x436095[_0x1448('0x4e')]]=_0x18c0d4;}}}catch(_0xd4005e){logger[_0x1448('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x436095[_0x1448('0x4e')],util[_0x1448('0x42')](_0xd4005e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1448('0x38')][_0x1448('0x27')]=function(_0x8c146){try{if(this[_0x1448('0x5a')](_0x8c146)){logger[_0x1448('0x4b')]('[%s][voiceQueueReport][varset]',_0x8c146[_0x1448('0x4e')],util[_0x1448('0x42')](_0x8c146,{'showHidden':![],'depth':null}));this['addVariable'](_0x8c146[_0x1448('0x4e')],_[_0x1448('0xa4')](_0x8c146['variable'])[0x0],_0x8c146[_0x1448('0xa5')]);if(this[_0x1448('0xe')][_0x8c146['uniqueid']]){var _0x1eb047=_[_0x1448('0x7d')](this['queueReports'][_0x8c146[_0x1448('0x4e')]]);if(_0x1eb047){if(this[_0x1448('0x5a')](_0x8c146[_0x1448('0xa6')])&&this[_0x1448('0x5a')](_0x8c146[_0x1448('0xa6')]['queuestatus'])){switch(_0x8c146['value']){case'CONTINUE':_0x1eb047[_0x1448('0x91')]=![];_0x1eb047['queuecallerexitAt']=null;break;case _0x1448('0xa7'):_0x1eb047[_0x1448('0xa8')]='timeout';_0x1eb047[_0x1448('0x91')]=!![];_0x1eb047[_0x1448('0x92')]=moment()[_0x1448('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1eb047['queuecallerleaveAt']=moment()[_0x1448('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x1448('0x4b')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x8c146[_0x1448('0x4e')],util['inspect'](_0x1eb047,{'showHidden':![],'depth':null}));ami[_0x1448('0x49')](_0x1448('0xa9'),_0x1eb047);break;default:_0x1eb047[_0x1448('0x91')]=!![];_0x1eb047['queuecallerexitAt']=moment()[_0x1448('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1eb047[_0x1448('0x87')]=moment()[_0x1448('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1eb047['queuecallerabandon']=![];_0x1eb047[_0x1448('0x82')]=null;_0x1eb047['queuecallerexitreason']=_0x8c146['value'];this[_0x1448('0x11')][_0x8c146[_0x1448('0x4e')]]=_0x1eb047;this[_0x1448('0x48')](_0x1eb047,_0x1448('0x26'));}else if(this[_0x1448('0x5a')](_0x8c146[_0x1448('0xa6')])&&this[_0x1448('0x5a')](_0x8c146[_0x1448('0xa6')]['queueposition'])){if(!_0x1eb047[_0x1448('0x20')]){_0x1eb047[_0x1448('0x91')]=!![];_0x1eb047[_0x1448('0x92')]=moment()[_0x1448('0x4f')](_0x1448('0x74'));_0x1eb047[_0x1448('0x83')]='EXITWITHKEY';_0x1eb047[_0x1448('0x87')]=moment()['format'](_0x1448('0x74'));this['channels'][_0x8c146[_0x1448('0x4e')]]=_0x1eb047;}}logger[_0x1448('0x6f')](_0x1448('0xaa'),_0x8c146[_0x1448('0x4e')],_0x1eb047['queue'],_0x1eb047[_0x1448('0x68')],_[_0x1448('0xa4')](_0x8c146['variable'])[0x0],_0x8c146['value']);_0x1eb047[_0x1448('0x15')]=this[_0x1448('0x15')][_0x8c146[_0x1448('0x4e')]];}}}}catch(_0x373484){logger[_0x1448('0x41')](_0x1448('0xab'),_0x8c146['uniqueid'],util[_0x1448('0x42')](_0x373484,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1448('0x38')][_0x1448('0xac')]=function(_0x26cca5,_0x5a737f,_0x491260){var _0x573715=[_0x1448('0xad'),'rtpaudioqosbridged',_0x1448('0xae'),_0x1448('0xaf'),_0x1448('0xb0'),_0x1448('0xb1'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x1448('0xb2'),_0x1448('0xb3'),_0x1448('0xb4'),_0x1448('0xb5'),_0x1448('0xb6'),_0x1448('0xb7'),_0x1448('0xb8'),'memberlastcall','membername',_0x1448('0xb9'),_0x1448('0xba')];if(!_[_0x1448('0x3c')](_0x5a737f)&&!_['includes'](_0x573715,_0x5a737f)){if(_[_0x1448('0x5b')](this[_0x1448('0x15')][_0x26cca5])){this[_0x1448('0x15')][_0x26cca5]={};}this[_0x1448('0x15')][_0x26cca5][_0x5a737f]=_0x491260;}};VoiceQueueReport[_0x1448('0x38')][_0x1448('0xbb')]=function(_0x50422b,_0x12d664,_0x1493c6){var _0x43504b={};for(var _0x1b845c=0x0;_0x1b845c0x0?!![]:![];if(!_0x3f1f58){return this['syncQueueSummaryComplete'](this['summary'][_0x1166('0x6d')]);}};VoiceQueueReport['prototype'][_0x1166('0x6e')]=function(_0x5d71db){var _0x4e56d9=this[_0x1166('0x14')]['id'];if(this[_0x1166('0x14')]['queuestatus'][_0x4e56d9]&&this[_0x1166('0x14')][_0x1166('0x62')][_0x4e56d9][_0x5d71db[_0x1166('0x61')]]){this['summary']['queuestatus'][_0x4e56d9][_0x5d71db['actionid']][_0x1166('0x10')]['push'](_0x5d71db);}};VoiceQueueReport[_0x1166('0x36')][_0x1166('0x16')]=function(_0x172a5a){var _0x4a2935=this;try{if(this['isNotNull'](_0x172a5a)&&this['isNotNull'](_0x172a5a['queue'])){logger['debug'](_0x1166('0x6f'),util['inspect'](_0x172a5a,{'showHidden':![],'depth':null}));var _0xc435b2=this[_0x1166('0x12')][_0x172a5a['queue']];if(_0xc435b2){logger[_0x1166('0x70')]('[voiceQueueReport][queuesummary]\x20name:%s',_0xc435b2[_0x1166('0x5a')]);this[_0x1166('0x14')][_0x1166('0x5d')][_0xc435b2[_0x1166('0x5a')]]={'summaryEvent':_0x172a5a};this[_0x1166('0x14')]['statusRequests']+=0x1;return ami[_0x1166('0x3a')]({'action':_0x1166('0x62'),'queue':_0xc435b2[_0x1166('0x5a')]})[_0x1166('0x60')](function(_0xaab1a8){if(!_0x4a2935[_0x1166('0x14')][_0x1166('0x62')][_0x172a5a[_0x1166('0x61')]]){_0x4a2935[_0x1166('0x14')]['queuestatus'][_0x172a5a[_0x1166('0x61')]]={};}_0x4a2935[_0x1166('0x14')][_0x1166('0x62')][_0x172a5a[_0x1166('0x61')]][_0xaab1a8[_0x1166('0x61')]]={'queue':_0xc435b2[_0x1166('0x5a')],'agents':[]};})['catch'](function(_0x3c0701){throw _0x3c0701;});}}}catch(_0x3a5314){logger['error'](_0x1166('0x63'),util[_0x1166('0x42')](_0x3a5314,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1166('0x18')]=function(_0x18758b){if(this['summary'][_0x1166('0x6c')]>0x0){this[_0x1166('0x14')][_0x1166('0x6d')]=_0x18758b;return;}logger[_0x1166('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x1166('0x42')](_0x18758b,{'showHidden':![],'depth':null}));this[_0x1166('0x14')]=initializeSummary();ami[_0x1166('0x49')](_0x1166('0x71'),{});};VoiceQueueReport[_0x1166('0x36')][_0x1166('0x1b')]=function(_0xcf4604){try{if(this['isNotNull'](_0xcf4604)){logger[_0x1166('0x4b')](_0x1166('0x72'),_0xcf4604['uniqueid'],util[_0x1166('0x42')](_0xcf4604,{'showHidden':![],'depth':null}));if(_[_0x1166('0x73')](this['queueReports'][_0xcf4604[_0x1166('0x4e')]])){this[_0x1166('0x45')][_0xcf4604[_0x1166('0x4e')]]=[];}if(_[_0x1166('0x73')](this['channels'][_0xcf4604[_0x1166('0x4e')]])){this['channels'][_0xcf4604[_0x1166('0x4e')]]={};}var _0x5187cf=new QueueReport();_0x5187cf[_0x1166('0x55')]=_0xcf4604[_0x1166('0x55')];_0x5187cf['type']=this[_0x1166('0x12')][_0x5187cf[_0x1166('0x55')]]&&this[_0x1166('0x12')][_0x5187cf[_0x1166('0x55')]][_0x1166('0x58')]?this[_0x1166('0x12')][_0x5187cf[_0x1166('0x55')]]['type']||_0x1166('0x74'):_0x1166('0x74');_0x5187cf[_0x1166('0x75')]=moment()[_0x1166('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5187cf['position']=_0xcf4604[_0x1166('0x76')];_0x5187cf[_0x1166('0x77')]=_0xcf4604['count'];_0x5187cf[_0x1166('0x4e')]=_0xcf4604[_0x1166('0x4e')];_0x5187cf[_0x1166('0x78')]=this[_0x1166('0x11')][_0xcf4604[_0x1166('0x4e')]][_0x1166('0x78')];logger[_0x1166('0x70')](_0x1166('0x79'),_0x5187cf[_0x1166('0x55')],_0x5187cf['type']);_[_0x1166('0x7a')](_0x5187cf,_[_0x1166('0x7b')](_0xcf4604,_['keys'](_0x5187cf)));this['queueReports'][_0xcf4604['uniqueid']][_0x1166('0x7c')](_0x5187cf);this['channels'][_0xcf4604[_0x1166('0x4e')]]=_0x5187cf;this[_0x1166('0x4a')](_0x5187cf,_0x1166('0x7d'));}}catch(_0x52064d){logger[_0x1166('0x40')](_0x1166('0x72'),_0xcf4604['uniqueid'],util['inspect'](_0x52064d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1166('0x36')][_0x1166('0x1d')]=function(_0x4c2b21){try{if(this['isNotNull'](_0x4c2b21)){logger[_0x1166('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4c2b21[_0x1166('0x4e')],util[_0x1166('0x42')](_0x4c2b21,{'showHidden':![],'depth':null}));if(this[_0x1166('0x45')][_0x4c2b21[_0x1166('0x4e')]]){var _0x192976=_['last'](this['queueReports'][_0x4c2b21['uniqueid']]);_0x192976[_0x1166('0x7e')]=![];_0x192976['queuecallercompleteAt']=null;_0x192976[_0x1166('0x7f')]=_0x4c2b21[_0x1166('0x7f')];_0x192976[_0x1166('0x80')]=_0x4c2b21[_0x1166('0x80')];_0x192976[_0x1166('0x1c')]=!![];_0x192976[_0x1166('0x81')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));_0x192976[_0x1166('0x53')]='ABANDONED';_0x192976[_0x1166('0x83')]=null;logger['info'](_0x1166('0x84'),_0x192976[_0x1166('0x55')],_0x192976['type']);this['channels'][_0x4c2b21[_0x1166('0x4e')]]=_0x192976;this[_0x1166('0x47')](_0x192976,_0x1166('0x1c'));}}}catch(_0xc8391d){logger[_0x1166('0x40')](_0x1166('0x85'),_0x4c2b21['uniqueid'],util[_0x1166('0x42')](_0xc8391d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x1dd3e6){try{if(this['isNotNull'](_0x1dd3e6)){logger['debug'](_0x1166('0x86'),_0x1dd3e6[_0x1166('0x4e')],util[_0x1166('0x42')](_0x1dd3e6,{'showHidden':![],'depth':null}));if(this[_0x1166('0x45')][_0x1dd3e6['uniqueid']]){var _0x545ffd=_['last'](this[_0x1166('0x45')][_0x1dd3e6[_0x1166('0x4e')]]);_0x545ffd[_0x1166('0x87')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));_0x545ffd[_0x1166('0x88')]=_0x1dd3e6[_0x1166('0x88')];_0x545ffd[_0x1166('0x89')]=_0x1dd3e6[_0x1166('0x89')];logger['info'](_0x1166('0x8a'),_0x545ffd[_0x1166('0x55')],_0x545ffd['type'],_0x1dd3e6['connectedlinenum'],_0x1dd3e6['connectedlinename']);this[_0x1166('0x11')][_0x1dd3e6[_0x1166('0x4e')]]=_0x545ffd;this[_0x1166('0x4a')](_0x545ffd,_0x1166('0x8b'));}}}catch(_0x43a253){logger[_0x1166('0x40')](_0x1166('0x86'),_0x1dd3e6['uniqueid'],util[_0x1166('0x42')](_0x43a253,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1166('0x36')][_0x1166('0x21')]=function(_0x12c853){try{if(this[_0x1166('0x5c')](_0x12c853)){logger[_0x1166('0x4b')](_0x1166('0x8c'),_0x12c853[_0x1166('0x4e')],util[_0x1166('0x42')](_0x12c853,{'showHidden':![],'depth':null}));if(this[_0x1166('0x45')][_0x12c853['uniqueid']]){var _0x5137c5=_[_0x1166('0x8d')](this[_0x1166('0x45')][_0x12c853[_0x1166('0x4e')]]);_0x5137c5['queuecallercomplete']=!![];_0x5137c5['queuecallerexitreason']=_0x1166('0x8e');logger[_0x1166('0x70')](_0x1166('0x8f'),_0x5137c5[_0x1166('0x55')],_0x5137c5['type']);}}}catch(_0x34ffaf){logger['error'](_0x1166('0x8c'),_0x12c853[_0x1166('0x4e')],util[_0x1166('0x42')](_0x34ffaf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1166('0x36')][_0x1166('0x1f')]=function(_0x23f86b){try{if(this[_0x1166('0x5c')](_0x23f86b)){logger[_0x1166('0x4b')]('[%s][voiceQueueReport][agentcomplete]',_0x23f86b[_0x1166('0x4e')],util[_0x1166('0x42')](_0x23f86b,{'showHidden':![],'depth':null}));if(this[_0x1166('0x45')][_0x23f86b[_0x1166('0x4e')]]){var _0x456c67=_[_0x1166('0x8d')](this['queueReports'][_0x23f86b[_0x1166('0x4e')]]);_0x456c67['queuecallerabandon']=![];_0x456c67['queuecallerabandonAt']=null;_0x456c67['assigned']=!![];_0x456c67[_0x1166('0x83')]=_0x23f86b['membername'];_0x456c67[_0x1166('0x7f')]=_0x23f86b[_0x1166('0x7f')];_0x456c67[_0x1166('0x7e')]=!![];_0x456c67[_0x1166('0x90')]=![];_0x456c67['queuecallerexitAt']=null;if(!_0x456c67[_0x1166('0x91')]){if(_0x23f86b[_0x1166('0x92')]==_0x1166('0x91')){_0x456c67[_0x1166('0x53')]=_0x1166('0x93');logger[_0x1166('0x70')](_0x1166('0x94'),_0x456c67[_0x1166('0x55')],_0x456c67[_0x1166('0x58')]);}else{if(_[_0x1166('0x95')](_0x23f86b[_0x1166('0x3c')][_0x1166('0x96')](),'local/')){if(this[_0x1166('0x45')][_0x23f86b[_0x1166('0x97')]]){var _0x1c6372=_[_0x1166('0x8d')](this[_0x1166('0x45')][_0x23f86b[_0x1166('0x97')]]);_0x1c6372[_0x1166('0x7e')]=![];_0x1c6372[_0x1166('0x90')]=!![];_0x1c6372['queuecallerexitAt']=moment(_0x456c67[_0x1166('0x75')])[_0x1166('0x98')](_0x23f86b[_0x1166('0x7f')],_0x1166('0x99'))[_0x1166('0x4f')](_0x1166('0x82'));_0x1c6372[_0x1166('0x53')]=_0x1166('0x9a');_0x1c6372[_0x1166('0x91')]=!![];_0x1c6372['transfertype']='FORWARD';_0x1c6372[_0x1166('0x9b')]=_0x23f86b[_0x1166('0x9c')];_0x1c6372[_0x1166('0x9d')]=_0x23f86b[_0x1166('0x4e')];logger[_0x1166('0x70')](_0x1166('0x9e'),_0x1c6372[_0x1166('0x55')],_0x1c6372['type']);var _0x4dfa30=this[_0x1166('0x45')][_0x23f86b[_0x1166('0x97')]];this[_0x1166('0x45')][_0x23f86b[_0x1166('0x97')]]=this[_0x1166('0x45')][_0x23f86b['uniqueid']];this['queueReports'][_0x23f86b['uniqueid']]=_0x4dfa30;}}else{_0x456c67[_0x1166('0x53')]=_0x1166('0x9f')+_0x23f86b[_0x1166('0x92')][_0x1166('0xa0')]();logger[_0x1166('0x70')](_0x1166('0xa1'),_0x456c67[_0x1166('0x55')],_0x456c67[_0x1166('0x58')],_0x456c67[_0x1166('0x53')]);}}}this['channels'][_0x23f86b['uniqueid']]=_0x456c67;}}}catch(_0x1fc5ed){logger[_0x1166('0x40')](_0x1166('0xa2'),_0x23f86b[_0x1166('0x4e')],util[_0x1166('0x42')](_0x1fc5ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1166('0x36')]['syncVarSet']=function(_0x27ff77){try{if(this[_0x1166('0x5c')](_0x27ff77)){logger[_0x1166('0x4b')](_0x1166('0xa3'),_0x27ff77['uniqueid'],util['inspect'](_0x27ff77,{'showHidden':![],'depth':null}));this[_0x1166('0xa4')](_0x27ff77[_0x1166('0x4e')],_['keys'](_0x27ff77[_0x1166('0xa5')])[0x0],_0x27ff77[_0x1166('0xa6')]);if(this[_0x1166('0x45')][_0x27ff77[_0x1166('0x4e')]]){var _0x12409d=_[_0x1166('0x8d')](this[_0x1166('0x45')][_0x27ff77[_0x1166('0x4e')]]);if(_0x12409d){if(this[_0x1166('0x5c')](_0x27ff77[_0x1166('0xa5')])&&this['isNotNull'](_0x27ff77[_0x1166('0xa5')][_0x1166('0x62')])){switch(_0x27ff77[_0x1166('0xa6')]){case _0x1166('0xa7'):_0x12409d[_0x1166('0x90')]=![];_0x12409d[_0x1166('0xa8')]=null;break;case _0x1166('0xa9'):_0x12409d[_0x1166('0xaa')]=_0x1166('0xab');_0x12409d[_0x1166('0x90')]=!![];_0x12409d[_0x1166('0xa8')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));_0x12409d[_0x1166('0x87')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));logger[_0x1166('0x4b')](_0x1166('0xac'),_0x27ff77[_0x1166('0x4e')],util[_0x1166('0x42')](_0x12409d,{'showHidden':![],'depth':null}));ami[_0x1166('0x49')]('custom:timeout',_0x12409d);break;default:_0x12409d['queuecallerexit']=!![];_0x12409d['queuecallerexitAt']=moment()[_0x1166('0x4f')](_0x1166('0x82'));_0x12409d[_0x1166('0x87')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));}_0x12409d[_0x1166('0x1c')]=![];_0x12409d[_0x1166('0x81')]=null;_0x12409d[_0x1166('0x53')]=_0x27ff77[_0x1166('0xa6')];this[_0x1166('0x11')][_0x27ff77[_0x1166('0x4e')]]=_0x12409d;this[_0x1166('0x47')](_0x12409d,_0x1166('0x22'));}else if(this['isNotNull'](_0x27ff77[_0x1166('0xa5')])&&this[_0x1166('0x5c')](_0x27ff77[_0x1166('0xa5')][_0x1166('0xad')])){if(!_0x12409d['queuecallerabandon']){_0x12409d[_0x1166('0x90')]=!![];_0x12409d[_0x1166('0xa8')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));_0x12409d[_0x1166('0x53')]=_0x1166('0xae');_0x12409d[_0x1166('0x87')]=moment()[_0x1166('0x4f')](_0x1166('0x82'));this[_0x1166('0x11')][_0x27ff77[_0x1166('0x4e')]]=_0x12409d;}}logger[_0x1166('0x70')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x27ff77['uniqueid'],_0x12409d[_0x1166('0x55')],_0x12409d[_0x1166('0x58')],_[_0x1166('0xaf')](_0x27ff77[_0x1166('0xa5')])[0x0],_0x27ff77[_0x1166('0xa6')]);_0x12409d[_0x1166('0x43')]=this['variables'][_0x27ff77[_0x1166('0x4e')]];}}}}catch(_0x44b96f){logger[_0x1166('0x40')](_0x1166('0xa3'),_0x27ff77[_0x1166('0x4e')],util[_0x1166('0x42')](_0x44b96f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1166('0x36')][_0x1166('0xa4')]=function(_0x1975fd,_0x6f7f62,_0x12f9f6){var _0x4a3324=['rtpaudioqos','rtpaudioqosbridged',_0x1166('0xb0'),'rtpaudioqosjitterbridged',_0x1166('0xb1'),'rtpaudioqoslossbridged',_0x1166('0xb2'),_0x1166('0xb3'),'sipcallid',_0x1166('0xb4'),_0x1166('0xb5'),_0x1166('0xb6'),_0x1166('0xb7'),_0x1166('0xb8'),_0x1166('0xb9'),'memberlastcall',_0x1166('0xba'),_0x1166('0xbb'),_0x1166('0xbc')];if(!_['isNil'](_0x6f7f62)&&!_[_0x1166('0xbd')](_0x4a3324,_0x6f7f62)){if(_[_0x1166('0x73')](this[_0x1166('0x43')][_0x1975fd])){this[_0x1166('0x43')][_0x1975fd]={};}this['variables'][_0x1975fd][_0x6f7f62]=_0x12f9f6;}};VoiceQueueReport['prototype'][_0x1166('0xbe')]=function(_0x163936,_0x6e6cab,_0x2ccd05){var _0x3e15d2={};for(var _0x3083ec=0x0;_0x3083ec=0x0?moment(_0x4e4bdf[_0xaf79('0x15')])[_0xaf79('0xf')](_0x4e4bdf['starttime'],_0xaf79('0x10')):null,'data1':'outbound','data2':_0x4e4bdf[_0xaf79('0x17')],'data3':_0x4e4bdf[_0xaf79('0x12')],'data4':_0x4e4bdf[_0xaf79('0x18')]||null,'role':_0xaf79('0x13'),'internal':_0x4e4bdf[_0xaf79('0x17')]?_[_0xaf79('0x19')](_0x4e4bdf['accountcode']):undefined,'uniqueid':_0x4e4bdf[_0xaf79('0x14')]},'log':_0xaf79('0x8')});}; \ No newline at end of file +var _0x639a=['CreateMemberReport','voiceDialReport','voice','membername','interface','starttime','endtime','outbound','dialstring','agent','moment','lodash','util','queuecallercompleteAt','Request','lastAssignedTo','isNil','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','accountcode','toNumber','uniqueid'];(function(_0x722103,_0x5732f3){var _0x3e2435=function(_0x44c44a){while(--_0x44c44a){_0x722103['push'](_0x722103['shift']());}};_0x3e2435(++_0x5732f3);}(_0x639a,0x169));var _0xa639=function(_0x35513b,_0xadea0b){_0x35513b=_0x35513b-0x0;var _0x5d34cb=_0x639a[_0x35513b];return _0x5d34cb;};'use strict';var moment=require(_0xa639('0x0'));var _=require(_0xa639('0x1'));var util=require(_0xa639('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x532b63){var _0x2abc15=_0x532b63[_0xa639('0x3')]||_0x532b63['queuecallerexitAt'];return client[_0xa639('0x4')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x532b63[_0xa639('0x5')],'interface':_[_0xa639('0x6')](_0x532b63['interface'])?util['format']('SIP/%s',_0x532b63['lastAssignedTo']):_0x532b63['interface'],'type':_0xa639('0x7'),'enterAt':_0x532b63[_0xa639('0x8')],'exitAt':_0x2abc15,'duration':moment(_0x2abc15)[_0xa639('0x9')](_0x532b63['queuecallerleaveAt'],_0xa639('0xa')),'data1':_0xa639('0xb'),'data2':_0x532b63[_0xa639('0xc')],'data3':_0x532b63[_0xa639('0xd')],'data4':null,'data5':_0x532b63['queue'],'role':'agent','internal':_0x532b63[_0xa639('0xe')]?_[_0xa639('0xf')](_0x532b63['accountcode']):undefined,'uniqueid':_0x532b63[_0xa639('0x10')]},'log':_0xa639('0x11')});};exports[_0xa639('0x12')]=function(_0x207361){return client[_0xa639('0x4')](_0xa639('0x11'),{'body':{'channel':_0xa639('0x13'),'membername':_0x207361[_0xa639('0x14')],'interface':_0x207361[_0xa639('0x15')],'type':'TALKING','enterAt':_0x207361[_0xa639('0x16')],'exitAt':_0x207361[_0xa639('0x17')],'duration':moment(_0x207361[_0xa639('0x17')])[_0xa639('0x9')](_0x207361[_0xa639('0x16')],_0xa639('0xa'))>=0x0?moment(_0x207361[_0xa639('0x17')])[_0xa639('0x9')](_0x207361[_0xa639('0x16')],'seconds'):null,'data1':_0xa639('0x18'),'data2':_0x207361['accountcode'],'data3':_0x207361[_0xa639('0xd')],'data4':_0x207361[_0xa639('0x19')]||null,'role':_0xa639('0x1a'),'internal':_0x207361['accountcode']?_[_0xa639('0xf')](_0x207361['accountcode']):undefined,'uniqueid':_0x207361['uniqueid']},'log':_0xa639('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 46977b7..ef49a03 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 _0x902b=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','Request'];(function(_0x5ec11a,_0x349b42){var _0x2b14a7=function(_0x4be334){while(--_0x4be334){_0x5ec11a['push'](_0x5ec11a['shift']());}};_0x2b14a7(++_0x349b42);}(_0x902b,0x6a));var _0xb902=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x902b[_0x2dadb9];return _0x2f0097;};'use strict';var client=require(_0xb902('0x0'));exports['getSettings']=function(){return client[_0xb902('0x1')](_0xb902('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb902('0x3'),_0xb902('0x4')]},'log':_0xb902('0x5')});}; \ No newline at end of file +var _0xc3b7=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x3c471d,_0x39fc0d){var _0x58b92=function(_0x35ef52){while(--_0x35ef52){_0x3c471d['push'](_0x3c471d['shift']());}};_0x58b92(++_0x39fc0d);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x2c99c6,_0x141321){_0x2c99c6=_0x2c99c6-0x0;var _0x33610f=_0xc3b7[_0x2c99c6];return _0x33610f;};'use strict';var client=require('../client');exports[_0x7c3b('0x0')]=function(){return client[_0x7c3b('0x1')](_0x7c3b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7c3b('0x3'),_0x7c3b('0x4')]},'log':_0x7c3b('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index de48bfd..cf28010 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 _0x46aa=['getTemplates','GetTemplate','name','html','../client'];(function(_0x3355,_0x9b2e0f){var _0x3fcab2=function(_0x2523bf){while(--_0x2523bf){_0x3355['push'](_0x3355['shift']());}};_0x3fcab2(++_0x9b2e0f);}(_0x46aa,0x90));var _0xa46a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x46aa[_0x616290];return _0x453879;};'use strict';var client=require(_0xa46a('0x0'));exports[_0xa46a('0x1')]=function(_0x32678d){return function(_0x5ec776){return client['Request'](_0xa46a('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa46a('0x3'),_0xa46a('0x4')]},'log':_0xa46a('0x2')});};}; \ No newline at end of file +var _0x0273=['Request','GetTemplate','html','getTemplates'];(function(_0x37f906,_0x3ae89f){var _0x529bbe=function(_0x317c56){while(--_0x317c56){_0x37f906['push'](_0x37f906['shift']());}};_0x529bbe(++_0x3ae89f);}(_0x0273,0x1af));var _0x3027=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0273[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x3027('0x0')]=function(_0x2f76a3){return function(_0x5cf9af){return client[_0x3027('0x1')](_0x3027('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x3027('0x3')]},'log':_0x3027('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a4cd276..c8eeca6 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 _0xd73b=['channel','status','AllConditions','field','value','Condition','Action','Actions','action','data1','data2','data3','data6','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x157f8d,_0x1c905a){var _0x1660af=function(_0x4f56ef){while(--_0x4f56ef){_0x157f8d['push'](_0x157f8d['shift']());}};_0x1660af(++_0x1c905a);}(_0xd73b,0xd4));var _0xbd73=function(_0x30b2c8,_0x377aa5){_0x30b2c8=_0x30b2c8-0x0;var _0x5be23a=_0xd73b[_0x30b2c8];return _0x5be23a;};'use strict';var client=require(_0xbd73('0x0'));exports[_0xbd73('0x1')]=function(_0x1fa76d){return function(_0x1c1ccc){return client[_0xbd73('0x2')](_0xbd73('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xbd73('0x4'),_0xbd73('0x5')],'include':[{'model':'Condition','as':_0xbd73('0x6'),'attributes':['id',_0xbd73('0x7'),'operator',_0xbd73('0x8')]},{'model':_0xbd73('0x9'),'as':'AnyConditions','attributes':['id','field','operator','value']},{'model':_0xbd73('0xa'),'as':_0xbd73('0xb'),'attributes':['id',_0xbd73('0xc'),_0xbd73('0xd'),_0xbd73('0xe'),_0xbd73('0xf'),'data4','data5',_0xbd73('0x10'),_0xbd73('0x11')]}]},'log':_0xbd73('0x3')});};}; \ No newline at end of file +var _0x0cdf=['data3','data4','data5','data7','getTriggers','Request','GetTrigger','channel','Condition','AllConditions','field','value','Actions','action','data1','data2'];(function(_0xe45c3a,_0x183904){var _0x1bc5e8=function(_0x1c084b){while(--_0x1c084b){_0xe45c3a['push'](_0xe45c3a['shift']());}};_0x1bc5e8(++_0x183904);}(_0x0cdf,0x124));var _0xf0cd=function(_0x39fe3f,_0x38b8eb){_0x39fe3f=_0x39fe3f-0x0;var _0x50d483=_0x0cdf[_0x39fe3f];return _0x50d483;};'use strict';var client=require('../client');exports[_0xf0cd('0x0')]=function(_0x278068){return function(_0x11e007){return client[_0xf0cd('0x1')](_0xf0cd('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf0cd('0x3'),'status'],'include':[{'model':_0xf0cd('0x4'),'as':_0xf0cd('0x5'),'attributes':['id',_0xf0cd('0x6'),'operator','value']},{'model':_0xf0cd('0x4'),'as':'AnyConditions','attributes':['id',_0xf0cd('0x6'),'operator',_0xf0cd('0x7')]},{'model':'Action','as':_0xf0cd('0x8'),'attributes':['id',_0xf0cd('0x9'),_0xf0cd('0xa'),_0xf0cd('0xb'),_0xf0cd('0xc'),_0xf0cd('0xd'),_0xf0cd('0xe'),'data6',_0xf0cd('0xf')]}]},'log':_0xf0cd('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 698f06f..a44b4cf 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 _0x25b0=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x1fadeb,_0x60766a){var _0x4d53fc=function(_0x4b94e4){while(--_0x4b94e4){_0x1fadeb['push'](_0x1fadeb['shift']());}};_0x4d53fc(++_0x60766a);}(_0x25b0,0x140));var _0x025b=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x25b0[_0x38fb0d];return _0x30a5d6;};'use strict';var client=require(_0x025b('0x0'));exports[_0x025b('0x1')]=function(_0x41b40c){return function(_0xf310aa){return client[_0x025b('0x2')](_0x025b('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x025b('0x4'),_0x025b('0x5'),_0x025b('0x6')]},'log':_0x025b('0x3')});};}; \ No newline at end of file +var _0x2227=['Request','name','registry','defaultuser','getTrunks'];(function(_0x32d316,_0x4dc4d0){var _0x4ac3c8=function(_0x55ed1a){while(--_0x55ed1a){_0x32d316['push'](_0x32d316['shift']());}};_0x4ac3c8(++_0x4dc4d0);}(_0x2227,0x103));var _0x7222=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x2227[_0x58eec7];return _0x25c5d3;};'use strict';var client=require('../client');exports[_0x7222('0x0')]=function(_0x446f63){return function(_0x195491){return client[_0x7222('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7222('0x2'),_0x7222('0x3'),_0x7222('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9bc604a..11aaad5 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x44daf5,_0x508bd5){var _0x517d12=function(_0x1501e4){while(--_0x1501e4){_0x44daf5['push'](_0x44daf5['shift']());}};_0x517d12(++_0x508bd5);}(_0x34e8,0x12c));var _0x834e=function(_0x206144,_0x15021c){_0x206144=_0x206144-0x0;var _0x106750=_0x34e8[_0x206144];return _0x106750;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x1c3e6a,_0x50907c){var _0x22b96b=function(_0xe89f7a){while(--_0xe89f7a){_0x1c3e6a['push'](_0x1c3e6a['shift']());}};_0x22b96b(++_0x50907c);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 02200b7..d67c16d 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 _0x86bd=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x578d76,_0x24fd1b){var _0x3abbcc=function(_0x328d81){while(--_0x328d81){_0x578d76['push'](_0x578d76['shift']());}};_0x3abbcc(++_0x24fd1b);}(_0x86bd,0xa9));var _0xd86b=function(_0x23b1b3,_0xd94847){_0x23b1b3=_0x23b1b3-0x0;var _0x1ce3e5=_0x86bd[_0x23b1b3];return _0x1ce3e5;};'use strict';var client=require(_0xd86b('0x0'));exports[_0xd86b('0x1')]=function(_0x366319){return client[_0xd86b('0x2')](_0xd86b('0x3'),{'body':_0x366319,'log':_0xd86b('0x3')});};exports[_0xd86b('0x4')]=function(_0x1b44ab,_0x40d34d,_0x341823){return client[_0xd86b('0x2')](_0xd86b('0x5'),{'body':_0x1b44ab,'options':{'where':{'uniqueid':_0x40d34d,'interface':_0x341823,'agentcomplete':!![]}},'log':_0xd86b('0x5')});}; \ No newline at end of file +var _0xbc76=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x290507,_0x1b343){var _0x15d699=function(_0x4447b4){while(--_0x4447b4){_0x290507['push'](_0x290507['shift']());}};_0x15d699(++_0x1b343);}(_0xbc76,0x1cc));var _0x6bc7=function(_0x35fe51,_0x2bd43a){_0x35fe51=_0x35fe51-0x0;var _0x282dd5=_0xbc76[_0x35fe51];return _0x282dd5;};'use strict';var client=require('../client');exports[_0x6bc7('0x0')]=function(_0x3c9836){return client[_0x6bc7('0x1')]('CreateVoiceAgentReport',{'body':_0x3c9836,'log':_0x6bc7('0x2')});};exports[_0x6bc7('0x3')]=function(_0x3662be,_0x51e5fe,_0x112694){return client['Request'](_0x6bc7('0x4'),{'body':_0x3662be,'options':{'where':{'uniqueid':_0x51e5fe,'interface':_0x112694,'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 9f1f5ee..7707a2e 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 _0xf673=['startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','GetVoiceCallReports','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x133ccf,_0x3aa8bd){var _0x237c63=function(_0x49e045){while(--_0x49e045){_0x133ccf['push'](_0x133ccf['shift']());}};_0x237c63(++_0x3aa8bd);}(_0xf673,0x1c3));var _0x3f67=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xf673[_0x220f3f];return _0x1f170e;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x3f67('0x0'));var client=require(_0x3f67('0x1'));exports[_0x3f67('0x2')]=function(_0x4aec8f){return client[_0x3f67('0x3')](_0x3f67('0x4'),{'body':_[_0x3f67('0x5')](_0x4aec8f,{'source':_0x4aec8f[_0x3f67('0x6')],'destinationcontext':_0x4aec8f['context'],'callerid':_0x4aec8f[_0x3f67('0x7')],'amaflags':_0x3f67('0x8')}),'log':_0x3f67('0x4')});};exports[_0x3f67('0x9')]=function(){return function(){return client[_0x3f67('0x3')](_0x3f67('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3f67('0xb')](_0x3f67('0xc'))['format'](_0x3f67('0xd')),moment()[_0x3f67('0xe')](_0x3f67('0xc'))[_0x3f67('0xf')](_0x3f67('0xd'))]}},'attributes':[_0x3f67('0x10'),_0x3f67('0x11'),_0x3f67('0x12'),_0x3f67('0x13')]},'log':_0x3f67('0x14')});};}; \ No newline at end of file +var _0xf1eb=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','billableseconds','GetVoiceCallReports','moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','GetVoiceCallReport'];(function(_0x37daef,_0x4e5352){var _0x57cfb6=function(_0x22f357){while(--_0x22f357){_0x37daef['push'](_0x37daef['shift']());}};_0x57cfb6(++_0x4e5352);}(_0xf1eb,0xce));var _0xbf1e=function(_0x483cab,_0x578035){_0x483cab=_0x483cab-0x0;var _0xe1859=_0xf1eb[_0x483cab];return _0xe1859;};'use strict';var moment=require(_0xbf1e('0x0'));var util=require(_0xbf1e('0x1'));var _=require('lodash');var client=require('../client');exports[_0xbf1e('0x2')]=function(_0x315421){return client[_0xbf1e('0x3')](_0xbf1e('0x4'),{'body':_[_0xbf1e('0x5')](_0x315421,{'source':_0x315421[_0xbf1e('0x6')],'destinationcontext':_0x315421['context'],'callerid':_0x315421[_0xbf1e('0x7')],'amaflags':_0xbf1e('0x8')}),'log':_0xbf1e('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xbf1e('0x3')](_0xbf1e('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xbf1e('0xa')](_0xbf1e('0xb'))[_0xbf1e('0xc')](_0xbf1e('0xd')),moment()[_0xbf1e('0xe')](_0xbf1e('0xb'))['format'](_0xbf1e('0xd'))]}},'attributes':[_0xbf1e('0xf'),'disposition','duration',_0xbf1e('0x10')]},'log':_0xbf1e('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b00ec06..147f664 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 _0x68b6=['../client','create','CreateVoiceDialReport'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x68b6,0x117));var _0x668b=function(_0x28ea18,_0x31332c){_0x28ea18=_0x28ea18-0x0;var _0x304b92=_0x68b6[_0x28ea18];return _0x304b92;};'use strict';var client=require(_0x668b('0x0'));exports[_0x668b('0x1')]=function(_0x131304){return client['Request'](_0x668b('0x2'),{'body':_0x131304,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xfd4b=['CreateVoiceDialReport','create','Request'];(function(_0x576190,_0x2b5637){var _0x120902=function(_0x327018){while(--_0x327018){_0x576190['push'](_0x576190['shift']());}};_0x120902(++_0x2b5637);}(_0xfd4b,0x10c));var _0xbfd4=function(_0x221459,_0x498c42){_0x221459=_0x221459-0x0;var _0x4ee988=_0xfd4b[_0x221459];return _0x4ee988;};'use strict';var client=require('../client');exports[_0xbfd4('0x0')]=function(_0x19878e){return client[_0xbfd4('0x1')](_0xbfd4('0x2'),{'body':_0x19878e,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e11e0e4..97548e6 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 _0x78f0=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x4f0da3,_0x133007){var _0x1f92f1=function(_0x5f52db){while(--_0x5f52db){_0x4f0da3['push'](_0x4f0da3['shift']());}};_0x1f92f1(++_0x133007);}(_0x78f0,0x15d));var _0x078f=function(_0x5d68e1,_0x29d62c){_0x5d68e1=_0x5d68e1-0x0;var _0x53211d=_0x78f0[_0x5d68e1];return _0x53211d;};'use strict';var client=require(_0x078f('0x0'));exports[_0x078f('0x1')]=function(){return function(){return client[_0x078f('0x2')](_0x078f('0x3'),{'options':{'raw':!![],'attributes':['id',_0x078f('0x4'),_0x078f('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x078f('0x1')});};}; \ No newline at end of file +var _0xb58b=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3dadde,_0x128400){var _0x2454fb=function(_0x45f6de){while(--_0x45f6de){_0x3dadde['push'](_0x3dadde['shift']());}};_0x2454fb(++_0x128400);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1503f0,_0x59c1dc){_0x1503f0=_0x1503f0-0x0;var _0x1424a1=_0xb58b[_0x1503f0];return _0x1424a1;};'use strict';var client=require('../client');exports[_0xbb58('0x0')]=function(){return function(){return client[_0xbb58('0x1')](_0xbb58('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xbb58('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xbb58('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 928f8b0..b39cada 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 _0xa75e=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x18b931,_0x2cad1d){var _0x114958=function(_0x445b4f){while(--_0x445b4f){_0x18b931['push'](_0x18b931['shift']());}};_0x114958(++_0x2cad1d);}(_0xa75e,0x1c2));var _0xea75=function(_0x2bae48,_0x3bccac){_0x2bae48=_0x2bae48-0x0;var _0x1d3c9b=_0xa75e[_0x2bae48];return _0x1d3c9b;};'use strict';var client=require(_0xea75('0x0'));exports[_0xea75('0x1')]=function(){return function(){return client[_0xea75('0x2')](_0xea75('0x3'),{'options':{'raw':![],'attributes':['id',_0xea75('0x4'),_0xea75('0x5'),_0xea75('0x6'),_0xea75('0x7'),'monitor_format',_0xea75('0x8'),'dialActive',_0xea75('0x9'),_0xea75('0xa'),_0xea75('0xb'),_0xea75('0xc'),_0xea75('0xd'),_0xea75('0xe'),_0xea75('0xf'),_0xea75('0x10'),'dialOriginateCallerIdNumber',_0xea75('0x11'),_0xea75('0x12'),_0xea75('0x13'),_0xea75('0x14'),_0xea75('0x15'),'dialCongestionRetryFrequency',_0xea75('0x16'),'dialBusyRetryFrequency',_0xea75('0x17'),_0xea75('0x18'),'dialGlobalMaxRetry',_0xea75('0x19'),_0xea75('0x1a'),_0xea75('0x1b'),_0xea75('0x1c'),_0xea75('0x1d'),'dialAMDInitialSilence','dialAMDGreeting',_0xea75('0x1e'),_0xea75('0x1f'),'dialAMDMinWordLength',_0xea75('0x20'),_0xea75('0x21'),_0xea75('0x22'),_0xea75('0x23'),'timeout',_0xea75('0x24'),_0xea75('0x25'),'dialOrderByScheduledAt',_0xea75('0x26'),_0xea75('0x27'),_0xea75('0x28'),_0xea75('0x29'),'strategy','dialRandomLastDigitCallerIdNumber',_0xea75('0x2a'),_0xea75('0x2b'),_0xea75('0x2c'),_0xea75('0x2d'),_0xea75('0x2e'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0xea75('0x2f'),'dialMachineRetryFrequency',_0xea75('0x30'),_0xea75('0x31'),'mandatoryDisposition',_0xea75('0x32'),_0xea75('0x33'),_0xea75('0x34'),_0xea75('0x35')],'include':[{'model':'Trunk','as':_0xea75('0x36'),'attributes':['id',_0xea75('0x4'),_0xea75('0x37'),'active']},{'model':_0xea75('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0xea75('0x4')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0xea75('0x4'),_0xea75('0x37'),_0xea75('0x39')]},{'model':_0xea75('0x3a'),'as':_0xea75('0x3a'),'attributes':['id','name'],'include':[{'model':_0xea75('0x3a'),'as':_0xea75('0x3b'),'attributes':['id',_0xea75('0x4'),_0xea75('0x3c')]}]}]},'log':_0xea75('0x1')});};}; \ No newline at end of file +var _0x09b2=['dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type'];(function(_0x575ff2,_0x53b37c){var _0x3cf813=function(_0x468db1){while(--_0x468db1){_0x575ff2['push'](_0x575ff2['shift']());}};_0x3cf813(++_0x53b37c);}(_0x09b2,0x150));var _0x209b=function(_0x59e881,_0xdd09a0){_0x59e881=_0x59e881-0x0;var _0x4ca66f=_0x09b2[_0x59e881];return _0x4ca66f;};'use strict';var client=require(_0x209b('0x0'));exports[_0x209b('0x1')]=function(){return function(){return client[_0x209b('0x2')](_0x209b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x209b('0x4'),_0x209b('0x5'),_0x209b('0x6'),_0x209b('0x7'),_0x209b('0x8'),_0x209b('0x9'),_0x209b('0xa'),_0x209b('0xb'),'dialLimitQueue',_0x209b('0xc'),_0x209b('0xd'),_0x209b('0xe'),'dialPredictiveInterval',_0x209b('0xf'),_0x209b('0x10'),_0x209b('0x11'),_0x209b('0x12'),_0x209b('0x13'),_0x209b('0x14'),_0x209b('0x15'),_0x209b('0x16'),_0x209b('0x17'),_0x209b('0x18'),_0x209b('0x19'),_0x209b('0x1a'),_0x209b('0x1b'),_0x209b('0x1c'),_0x209b('0x1d'),_0x209b('0x1e'),_0x209b('0x1f'),_0x209b('0x20'),_0x209b('0x21'),_0x209b('0x22'),_0x209b('0x23'),_0x209b('0x24'),_0x209b('0x25'),'dialAMDBetweenWordsSilence',_0x209b('0x26'),_0x209b('0x27'),_0x209b('0x28'),'timeout',_0x209b('0x29'),_0x209b('0x2a'),_0x209b('0x2b'),'dialAgiAfterHangupAgent',_0x209b('0x2c'),_0x209b('0x2d'),_0x209b('0x7'),'strategy',_0x209b('0x2e'),_0x209b('0x2f'),_0x209b('0x30'),_0x209b('0x31'),_0x209b('0x32'),'dialDropRetryFrequency',_0x209b('0x33'),_0x209b('0x34'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x209b('0x35'),_0x209b('0x36'),_0x209b('0x37'),_0x209b('0x38'),_0x209b('0x39'),_0x209b('0x3a'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x209b('0x3b'),'as':_0x209b('0x3b'),'attributes':['id',_0x209b('0x3c'),_0x209b('0x3d'),_0x209b('0x3e')]},{'model':_0x209b('0x3f'),'as':_0x209b('0x40'),'attributes':['id',_0x209b('0x3c')]},{'model':_0x209b('0x3b'),'as':_0x209b('0x41'),'attributes':['id',_0x209b('0x3c'),_0x209b('0x3d'),_0x209b('0x3e')]},{'model':_0x209b('0x42'),'as':_0x209b('0x42'),'attributes':['id',_0x209b('0x3c')],'include':[{'model':_0x209b('0x42'),'as':_0x209b('0x43'),'attributes':['id',_0x209b('0x3c'),_0x209b('0x44')]}]}]},'log':_0x209b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5824190..3ecc728 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(_0x25ce6c,_0x46eb4e){var _0x485858=function(_0x4c4f48){while(--_0x4c4f48){_0x25ce6c['push'](_0x25ce6c['shift']());}};_0x485858(++_0x46eb4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2e55eb,_0x3c90b1){var _0x4d033d=function(_0x58d5cc){while(--_0x58d5cc){_0x2e55eb['push'](_0x2e55eb['shift']());}};_0x4d033d(++_0x3c90b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 e615b5e..de7409d 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 _0x0709=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x4684af,_0x34880f){var _0x3bb413=function(_0x600b5a){while(--_0x600b5a){_0x4684af['push'](_0x4684af['shift']());}};_0x3bb413(++_0x34880f);}(_0x0709,0x6d));var _0x9070=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0x0709[_0x36b400];return _0x4d47bf;};'use strict';var client=require(_0x9070('0x0'));exports[_0x9070('0x1')]=function(_0x54b8d4){return function(){return client[_0x9070('0x2')](_0x9070('0x3'),{'options':{'where':{'VoiceQueueId':_0x54b8d4,'paused':!![]},'raw':!![]},'log':_0x9070('0x1')});};}; \ No newline at end of file +var _0x6c0e=['getVoiceQueueRtPauses','Request','../client'];(function(_0x54f92b,_0x40bfa1){var _0x50f4fa=function(_0x4cdc53){while(--_0x4cdc53){_0x54f92b['push'](_0x54f92b['shift']());}};_0x50f4fa(++_0x40bfa1);}(_0x6c0e,0x101));var _0xe6c0=function(_0x549422,_0x32e69a){_0x549422=_0x549422-0x0;var _0x8d20e2=_0x6c0e[_0x549422];return _0x8d20e2;};'use strict';var client=require(_0xe6c0('0x0'));exports[_0xe6c0('0x1')]=function(_0xd7b2b5){return function(){return client[_0xe6c0('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xd7b2b5,'paused':!![]},'raw':!![]},'log':_0xe6c0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 30ab094..24da97b 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(_0x4d13a5,_0x5ffdea){var _0x4db3b6=function(_0x13d9f1){while(--_0x13d9f1){_0x4d13a5['push'](_0x4d13a5['shift']());}};_0x4db3b6(++_0x5ffdea);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(_0x508804,_0x30eb17){var _0x24b96b=function(_0xe08252){while(--_0xe08252){_0x508804['push'](_0x508804['shift']());}};_0x24b96b(++_0x30eb17);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 d82ec74..872f636 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 _0xa941=['transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','Request','result','transfererchannel'];(function(_0x411069,_0x16ae05){var _0x68c645=function(_0x55d1c8){while(--_0x55d1c8){_0x411069['push'](_0x411069['shift']());}};_0x68c645(++_0x16ae05);}(_0xa941,0xeb));var _0x1a94=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa941[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x1a94('0x0'));exports[_0x1a94('0x1')]={};exports['blindTransfer']=function(_0x3507a){return client[_0x1a94('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x3507a[_0x1a94('0x3')],'transfererchannel':_0x3507a[_0x1a94('0x4')],'transferercalleridnum':_0x3507a[_0x1a94('0x5')],'transferercalleridname':_0x3507a[_0x1a94('0x6')],'transfererconnectedlinenum':_0x3507a['transfererconnectedlinenum'],'transfererconnectedlinename':_0x3507a[_0x1a94('0x7')],'transfereraccountcode':_0x3507a[_0x1a94('0x8')],'transferercontext':_0x3507a[_0x1a94('0x9')],'transfererexten':_0x3507a[_0x1a94('0xa')],'transfererlinkedid':_0x3507a['transfererlinkedid'],'transfereechannel':_0x3507a[_0x1a94('0xb')],'transfereecalleridnum':_0x3507a[_0x1a94('0xc')],'transfereecalleridname':_0x3507a[_0x1a94('0xd')],'transfereeconnectedlinenum':_0x3507a[_0x1a94('0xe')],'transfereeconnectedlinename':_0x3507a['transfereeconnectedlinename'],'transfereeaccountcode':_0x3507a[_0x1a94('0xf')],'transfereecontext':_0x3507a[_0x1a94('0x10')],'transfereeexten':_0x3507a[_0x1a94('0x11')],'transfereelinkedid':_0x3507a[_0x1a94('0x12')],'isexternal':_0x3507a[_0x1a94('0x13')],'context':_0x3507a['context'],'extension':_0x3507a[_0x1a94('0x14')],'type':_0x1a94('0x15')},'log':_0x1a94('0x16')});};exports[_0x1a94('0x17')]=function(_0xb082bc){return client[_0x1a94('0x2')](_0x1a94('0x16'),{'body':{'result':_0xb082bc[_0x1a94('0x3')],'transfererchannel':_0xb082bc[_0x1a94('0x18')],'transferercalleridnum':_0xb082bc[_0x1a94('0x19')],'transferercalleridname':_0xb082bc[_0x1a94('0x1a')],'transfererconnectedlinenum':_0xb082bc[_0x1a94('0x1b')],'transfererconnectedlinename':_0xb082bc['secondtransfererconnectedlinename'],'transfereraccountcode':_0xb082bc[_0x1a94('0x1c')],'transferercontext':_0xb082bc[_0x1a94('0x1d')],'transfererexten':_0xb082bc['secondtransfererexten'],'transfererlinkedid':_0xb082bc['origtransfererlinkedid'],'transfereechannel':_0xb082bc[_0x1a94('0x1e')],'transfereecalleridnum':_0xb082bc[_0x1a94('0x1f')],'transfereecalleridname':_0xb082bc[_0x1a94('0x20')],'transfereeconnectedlinenum':_0xb082bc['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xb082bc[_0x1a94('0x21')],'transfereeaccountcode':_0xb082bc[_0x1a94('0x22')],'transfereecontext':_0xb082bc[_0x1a94('0x23')],'transfereeexten':_0xb082bc[_0x1a94('0x24')],'transfereelinkedid':_0xb082bc[_0x1a94('0x25')],'isexternal':_0xb082bc[_0x1a94('0x13')],'context':_0xb082bc['origtransferercontext'],'extension':_0xb082bc[_0x1a94('0x26')],'type':_0x1a94('0x27')},'log':_0x1a94('0x16')});}; \ No newline at end of file +var _0x3358=['Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer'];(function(_0x5273eb,_0x56b67a){var _0x155970=function(_0x1b66fe){while(--_0x1b66fe){_0x5273eb['push'](_0x5273eb['shift']());}};_0x155970(++_0x56b67a);}(_0x3358,0x72));var _0x8335=function(_0x3568a2,_0x420aa7){_0x3568a2=_0x3568a2-0x0;var _0x44baaf=_0x3358[_0x3568a2];return _0x44baaf;};'use strict';var client=require(_0x8335('0x0'));exports[_0x8335('0x1')]={};exports[_0x8335('0x2')]=function(_0x10897e){return client[_0x8335('0x3')](_0x8335('0x4'),{'body':{'result':_0x10897e[_0x8335('0x5')],'transfererchannel':_0x10897e[_0x8335('0x6')],'transferercalleridnum':_0x10897e[_0x8335('0x7')],'transferercalleridname':_0x10897e[_0x8335('0x8')],'transfererconnectedlinenum':_0x10897e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x10897e[_0x8335('0x9')],'transfereraccountcode':_0x10897e[_0x8335('0xa')],'transferercontext':_0x10897e['transferercontext'],'transfererexten':_0x10897e[_0x8335('0xb')],'transfererlinkedid':_0x10897e[_0x8335('0xc')],'transfereechannel':_0x10897e[_0x8335('0xd')],'transfereecalleridnum':_0x10897e[_0x8335('0xe')],'transfereecalleridname':_0x10897e['transfereecalleridname'],'transfereeconnectedlinenum':_0x10897e[_0x8335('0xf')],'transfereeconnectedlinename':_0x10897e[_0x8335('0x10')],'transfereeaccountcode':_0x10897e[_0x8335('0x11')],'transfereecontext':_0x10897e['transfereecontext'],'transfereeexten':_0x10897e[_0x8335('0x12')],'transfereelinkedid':_0x10897e[_0x8335('0x13')],'isexternal':_0x10897e['isexternal'],'context':_0x10897e['context'],'extension':_0x10897e[_0x8335('0x14')],'type':_0x8335('0x15')},'log':_0x8335('0x4')});};exports[_0x8335('0x16')]=function(_0x92b6af){return client[_0x8335('0x3')](_0x8335('0x4'),{'body':{'result':_0x92b6af['result'],'transfererchannel':_0x92b6af[_0x8335('0x17')],'transferercalleridnum':_0x92b6af[_0x8335('0x18')],'transferercalleridname':_0x92b6af['origtransferercalleridname'],'transfererconnectedlinenum':_0x92b6af['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x92b6af[_0x8335('0x19')],'transfereraccountcode':_0x92b6af[_0x8335('0x1a')],'transferercontext':_0x92b6af['secondtransferercontext'],'transfererexten':_0x92b6af[_0x8335('0x1b')],'transfererlinkedid':_0x92b6af[_0x8335('0x1c')],'transfereechannel':_0x92b6af[_0x8335('0x1d')],'transfereecalleridnum':_0x92b6af[_0x8335('0x1e')],'transfereecalleridname':_0x92b6af['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x92b6af['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x92b6af[_0x8335('0x1f')],'transfereeaccountcode':_0x92b6af[_0x8335('0x20')],'transfereecontext':_0x92b6af[_0x8335('0x21')],'transfereeexten':_0x92b6af[_0x8335('0x22')],'transfereelinkedid':_0x92b6af[_0x8335('0x23')],'isexternal':_0x92b6af['isexternal'],'context':_0x92b6af[_0x8335('0x24')],'extension':_0x92b6af[_0x8335('0x25')],'type':_0x8335('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f0a1cb2..1aef70f 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 _0x6c7b=['%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','keys','module','action','Reload','Action','then','message','catch','join','command','content','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','ami\x20disconnected','uniqueid','channel','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','StopMixMonitor','destinationchannel','%s.%s','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','validate','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','moment','../properties','../ami','../model/voiceQueueSummary','format'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x3f120d,_0x45ec79){_0x3f120d=_0x3f120d-0x0;var _0x1b0bb2=_0x6c7b[_0x3f120d];return _0x1b0bb2;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0xb6c7('0x1'));var config=require('../../../config/environment');var properties=require(_0xb6c7('0x2'));var ami=require(_0xb6c7('0x3'));var VoiceQueueSummary=require(_0xb6c7('0x4'));exports['listen']=function(_0x294dc9,_0x290c39,_0xfe3eb9){return new Promise(function(_0x219abc,_0xb889c3){var _0x5dd47a={'QueuePause':function(_0x12e97e){return new Promise(function(_0x41a5a5){var _0xe2ce08=util[_0xb6c7('0x5')](_0xb6c7('0x6'),_0xb6c7('0x7'),_0x12e97e[_0xb6c7('0x8')]);if(_0x294dc9[_0xb6c7('0x9')]&&_0x294dc9['timers'][_0xe2ce08]&&_0x294dc9['timers'][_0xe2ce08][_0xb6c7('0xa')]){_0x294dc9[_0xb6c7('0x9')][_0xe2ce08][_0xb6c7('0xb')]();}if(_0x294dc9[_0xb6c7('0xc')][_0xe2ce08]){_0x294dc9[_0xb6c7('0xc')][_0xe2ce08][_0xb6c7('0xd')]({'statePause':_0x12e97e[_0xb6c7('0xe')]?!![]:![]});}_0x41a5a5({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x9b32b7){var _0xa858c5=this;return new Promise(function(_0x6b946,_0xd6fb50){if(ami[_0xb6c7('0xf')]()==![]){return _0xd6fb50(_0xa858c5[_0xb6c7('0x10')](0x1f4,[config[_0xb6c7('0x11')]['ip'],config['asterisk'][_0xb6c7('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x9b32b7=_['pick'](_0x9b32b7,_[_0xb6c7('0x13')](properties['reload'][_0xb6c7('0x14')]));_0x9b32b7[_0xb6c7('0x15')]=_0xb6c7('0x16');return ami[_0xb6c7('0x17')](_0x9b32b7)[_0xb6c7('0x18')](function(_0x200833){_0x6b946({'code':0xc8,'message':_0x200833[_0xb6c7('0x19')]});})[_0xb6c7('0x1a')](function(_0x1a591f){_0xd6fb50(_0xa858c5[_0xb6c7('0x10')](0x1f5,_0x1a591f[_0xb6c7('0x19')]));});});},'Command':function(_0x3f133f){var _0x3beafa=this;return new Promise(function(_0x5b5022,_0x274f76){if(ami[_0xb6c7('0xf')]()==![]){return _0x274f76(_0x3beafa['error'](0x1f4,[config[_0xb6c7('0x11')]['ip'],config['asterisk'][_0xb6c7('0x12')],'ami\x20disconnected'][_0xb6c7('0x1b')]('\x20')));}_0x3f133f=_['pick'](_0x3f133f,_0xb6c7('0x1c'));_0x3f133f[_0xb6c7('0x15')]='Command';return ami[_0xb6c7('0x17')](_0x3f133f)[_0xb6c7('0x18')](function(_0x2081a6){_0x5b5022({'code':0xc8,'message':_0x2081a6[_0xb6c7('0x1d')]});})[_0xb6c7('0x1a')](function(_0x1ee45d){_0x274f76(_0x3beafa['error'](0x1f5,_0x1ee45d[_0xb6c7('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x1f4e06){var _0x209a21=[];for(var _0x418920 in _0x294dc9['voiceQueues']){if(_0x294dc9[_0xb6c7('0x1e')][_0xb6c7('0x1f')](_0x418920)){var _0x49909e=_0x294dc9[_0xb6c7('0x1e')][_0x418920];var _0x164801=new VoiceQueueSummary(_0x49909e);_0x209a21[_0xb6c7('0x20')](_0x164801);}}_0x1f4e06({'count':_0x209a21[_0xb6c7('0x21')],'rows':_0x209a21});});},'UpdateVoiceQueue':function(_0x4fb79f){return new Promise(function(_0x30eeb4,_0x54373f){var _0x31e014=_[_0xb6c7('0x22')](_0x294dc9[_0xb6c7('0x1e')],{'id':parseInt(_0x4fb79f['id'])});var _0x5f3be2=_['omit'](_0x4fb79f,['id']);if(_0x31e014){for(var _0x4f19da in _0x5f3be2){if(typeof _0x5f3be2[_0x4f19da]!==_0xb6c7('0x23')&&typeof _0x31e014[_0x4f19da]!==_0xb6c7('0x23')){_0x31e014[_0x4f19da]=_0x5f3be2[_0x4f19da];}}_0x30eeb4(_0x31e014);}else{_0x54373f();}});},'VoiceChannels':function(){return new Promise(function(_0x210c2a){var _0x457df0=_[_0xb6c7('0x24')](_0x294dc9[_0xb6c7('0x25')]);_0x210c2a({'count':_0x457df0[_0xb6c7('0x21')],'rows':_0x457df0});});},'VoiceChannelMixMonitor':function(_0x476d16){var _0x1f82bd=this;return new Promise(function(_0x357507,_0x5dabdd){if(ami[_0xb6c7('0xf')]()==![]){return _0x5dabdd(_0x1f82bd['error'](0x1f4,[config[_0xb6c7('0x11')]['ip'],config[_0xb6c7('0x11')][_0xb6c7('0x12')],_0xb6c7('0x26')][_0xb6c7('0x1b')]('\x20')));}var _0x5534ca=schema(properties['voicechannel'])['validate'](_0x476d16);if(_0x5534ca[_0xb6c7('0x21')]>0x0){return _0x5dabdd(_0x1f82bd[_0xb6c7('0x10')](0x1f4,_['map'](_0x5534ca,_0xb6c7('0x19'))[_0xb6c7('0x1b')](',\x20')));}var _0x583fb3=_[_0xb6c7('0x22')](_0x294dc9[_0xb6c7('0x25')],{'uniqueid':_0x476d16[_0xb6c7('0x27')]});if(_0x583fb3&&_0x583fb3[_0xb6c7('0x28')]){var _0x317a58=util[_0xb6c7('0x5')]('%s.%s',_0x476d16[_0xb6c7('0x29')]||_0x476d16[_0xb6c7('0x27')],_0x476d16[_0xb6c7('0x5')]||_0xb6c7('0x2a'));return ami[_0xb6c7('0x17')]({'action':_0xb6c7('0x2b'),'channel':_0x583fb3[_0xb6c7('0x28')],'file':_0x317a58,'options':'ai(mixmonitorid)'})['then'](function(_0x3bae95){var _0x2c59e1=_[_0xb6c7('0x22')](_0x583fb3[_0xb6c7('0x2c')],{'filename':_0xb6c7('0x2d')+_0x317a58[_0xb6c7('0x2e')]()});if(_[_0xb6c7('0x2f')](_0x2c59e1)){_0x583fb3[_0xb6c7('0x2c')][_0xb6c7('0x20')]({'filename':_0xb6c7('0x2d')+_0x317a58['toLowerCase'](),'createdAt':moment()[_0xb6c7('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3bae95['mixmonitorid'],'status':_0xb6c7('0x30')});}else{_0x2c59e1['mixmonitorid']=_0x3bae95[_0xb6c7('0x31')];_0x2c59e1[_0xb6c7('0x32')]='rec';}_0x357507({'code':0xc8,'message':[_0x476d16[_0xb6c7('0x27')],_0xb6c7('0x33'),_0x3bae95[_0xb6c7('0x31')]][_0xb6c7('0x1b')]('\x20'),'mixmonitorid':_0x3bae95[_0xb6c7('0x31')]});})['catch'](function(_0x4bff9f){_0x5dabdd(_0x1f82bd[_0xb6c7('0x10')](0x1f5,[_0x476d16[_0xb6c7('0x27')],_0x4bff9f[_0xb6c7('0x19')][_0xb6c7('0x2e')]()]['join']('\x20')));});}else{return _0x5dabdd(_0x1f82bd['error'](0x1f5,_0xb6c7('0x34')));}});},'VoiceChannelStopMixMonitor':function(_0x4019c){var _0x205301=this;return new Promise(function(_0x214d04,_0x793060){if(ami['isConnected']()==![]){return _0x793060(_0x205301['error'](0x1f4,[config['asterisk']['ip'],config[_0xb6c7('0x11')][_0xb6c7('0x12')],_0xb6c7('0x26')]['join']('\x20')));}var _0x1c2983=schema(properties[_0xb6c7('0x35')])['validate'](_0x4019c);if(_0x1c2983[_0xb6c7('0x21')]>0x0){return _0x793060(_0x205301[_0xb6c7('0x10')](0x1f4,_[_0xb6c7('0x36')](_0x1c2983,_0xb6c7('0x19'))[_0xb6c7('0x1b')](',\x20')));}var _0x4ee526=_[_0xb6c7('0x22')](_0x294dc9[_0xb6c7('0x25')],{'uniqueid':_0x4019c[_0xb6c7('0x27')]});if(_0x4ee526){return Promise['resolve']()['then'](function(){if(_0x4ee526[_0xb6c7('0x28')]){return ami[_0xb6c7('0x17')]({'action':_0xb6c7('0x37'),'channel':_0x4ee526['channel'],'mixmonitorid':_0x4019c['mixmonitorid']})['catch'](function(){});}})[_0xb6c7('0x18')](function(){if(_0x4ee526[_0xb6c7('0x38')]){return ami[_0xb6c7('0x17')]({'action':_0xb6c7('0x37'),'channel':_0x4ee526[_0xb6c7('0x38')],'mixmonitorid':_0x4019c[_0xb6c7('0x31')]})[_0xb6c7('0x1a')](function(){});}})['then'](function(){var _0x22b21b=_[_0xb6c7('0x22')](_0x4ee526[_0xb6c7('0x2c')],{'mixmonitorid':_0x4019c[_0xb6c7('0x31')]});if(_0x22b21b){_0x22b21b[_0xb6c7('0x32')]='stop';}})[_0xb6c7('0x18')](function(){var _0x40bbff=util[_0xb6c7('0x5')](_0xb6c7('0x39'),_0x4019c[_0xb6c7('0x29')]||_0x4019c[_0xb6c7('0x27')],_0x4019c['format']||_0xb6c7('0x2a'));var _0x141cd5=_[_0xb6c7('0x22')](_0x4ee526[_0xb6c7('0x2c')],{'filename':_0xb6c7('0x2d')+_0x40bbff[_0xb6c7('0x2e')]()});if(_0x141cd5){_0x141cd5[_0xb6c7('0x32')]='stop';}})['then'](function(){_0x214d04({'code':0xc8,'message':[_0x4019c['uniqueid'],_0xb6c7('0x3a')][_0xb6c7('0x1b')]('\x20')});})[_0xb6c7('0x1a')](function(_0x394c01){_0x793060(_0x205301[_0xb6c7('0x10')](0x1f5,[_0x4019c[_0xb6c7('0x27')],_0x394c01['message']['toLowerCase']()][_0xb6c7('0x1b')]('\x20')));});}else{return _0x793060(_0x205301['error'](0x1f5,_0xb6c7('0x34')));}});},'VoiceQueuesChannels':function(_0x8c5b9c){var _0x398c59=this;return new Promise(function(_0x210d50){var _0x317a4b=_['values'](_0x294dc9[_0xb6c7('0x3b')]);var _0x5700dc={'count':_0x317a4b[_0xb6c7('0x21')],'rows':_0x317a4b};if(_0x8c5b9c&&_0x8c5b9c[_0xb6c7('0x3c')]){if(![_0xb6c7('0x3d'),_0xb6c7('0x3e')][_0xb6c7('0x3f')](_0x8c5b9c['type'])){return _0xb889c3(_0x398c59[_0xb6c7('0x10')](0x190,_0xb6c7('0x40')));}var _0x236af3=_[_0xb6c7('0x41')](_0x317a4b,function(_0x416083){return _0x416083[_0xb6c7('0x3c')]===_0x8c5b9c[_0xb6c7('0x3c')];});_0x5700dc[_0xb6c7('0x42')]=_0x236af3['length'];_0x5700dc[_0xb6c7('0x43')]=_0x236af3;}_0x210d50(_0x5700dc);});},'VoiceQueuesChannel':function(_0xcd56e2){var _0x3b8326=this;return new Promise(function(_0x34006a,_0x449d79){var _0x360bb3=schema(properties['voicequeuechannel'])[_0xb6c7('0x44')](_0xcd56e2);if(_0x360bb3[_0xb6c7('0x21')]>0x0){return _0x449d79(_0x3b8326[_0xb6c7('0x10')](0x1f4,_[_0xb6c7('0x36')](_0x360bb3,'message')[_0xb6c7('0x1b')](',\x20')));}var _0x27e889=_[_0xb6c7('0x22')](_0x294dc9[_0xb6c7('0x3b')],{'uniqueid':_0xcd56e2[_0xb6c7('0x27')]});if(_0x27e889){_0x34006a(_0x27e889);}else{return _0x449d79(_0x3b8326[_0xb6c7('0x10')](0x1f5,_0xb6c7('0x34')));}});},'VoiceQueuesChannelHangup':function(_0x5cb286){var _0x2d2242=this;return new Promise(function(_0xaaa36b,_0x11120b){if(ami['isConnected']()==![]){return _0x11120b(_0x2d2242[_0xb6c7('0x10')](0x1f4,[config[_0xb6c7('0x11')]['ip'],config[_0xb6c7('0x11')][_0xb6c7('0x12')],_0xb6c7('0x26')]['join']('\x20')));}var _0xe65b7=schema(properties[_0xb6c7('0x45')])[_0xb6c7('0x44')](_0x5cb286);if(_0xe65b7[_0xb6c7('0x21')]>0x0){return _0x11120b(_0x2d2242[_0xb6c7('0x10')](0x1f4,_[_0xb6c7('0x36')](_0xe65b7,'message')[_0xb6c7('0x1b')](',\x20')));}var _0x27ddfa=_['find'](_0x294dc9[_0xb6c7('0x3b')],{'uniqueid':_0x5cb286[_0xb6c7('0x27')]});if(_0x27ddfa&&_0x27ddfa['channel']){return ami[_0xb6c7('0x17')]({'action':_0xb6c7('0x46'),'channel':_0x27ddfa[_0xb6c7('0x28')]})[_0xb6c7('0x18')](function(_0x2ba8b2){_0xaaa36b({'code':0xc8,'message':[_0x5cb286[_0xb6c7('0x27')],_0x2ba8b2[_0xb6c7('0x19')]['toLowerCase']()]['join']('\x20')});})[_0xb6c7('0x1a')](function(_0x4e365e){_0x11120b(_0x2d2242[_0xb6c7('0x10')](0x1f5,[_0x5cb286['uniqueid'],_0x4e365e['message']['toLowerCase']()][_0xb6c7('0x1b')]('\x20')));});}else{return _0x11120b(_0x2d2242['error'](0x1f5,_0xb6c7('0x34')));}});},'VoiceQueuesChannelRedirect':function(_0x4fadd7){var _0x35bbf5=this;return new Promise(function(_0x5d5444,_0x46495d){if(ami[_0xb6c7('0xf')]()==![]){return _0x46495d(_0x35bbf5['error'](0x1f4,[config['asterisk']['ip'],config[_0xb6c7('0x11')][_0xb6c7('0x12')],_0xb6c7('0x26')][_0xb6c7('0x1b')]('\x20')));}var _0x2cc079=schema(properties[_0xb6c7('0x47')])[_0xb6c7('0x44')](_0x4fadd7);if(_0x2cc079[_0xb6c7('0x21')]>0x0){return _0x46495d(_0x35bbf5[_0xb6c7('0x10')](0x1f4,_['map'](_0x2cc079,_0xb6c7('0x19'))[_0xb6c7('0x1b')](',\x20')));}var _0x4b43be=_[_0xb6c7('0x22')](_0x294dc9['queueChannels'],{'uniqueid':_0x4fadd7['uniqueid']});if(_0x4b43be&&_0x4b43be[_0xb6c7('0x28')]){return ami[_0xb6c7('0x17')]({'action':'Redirect','channel':_0x4b43be[_0xb6c7('0x28')],'exten':_0x4fadd7[_0xb6c7('0x48')],'context':_0x4fadd7['context']||_0x4b43be[_0xb6c7('0x49')],'priority':0x1})[_0xb6c7('0x18')](function(_0x55a63e){_0x5d5444({'code':0xc8,'message':[_0x4fadd7[_0xb6c7('0x27')],_0x55a63e[_0xb6c7('0x19')]['toLowerCase']()][_0xb6c7('0x1b')]('\x20')});})['catch'](function(_0x267e41){_0x46495d(_0x35bbf5[_0xb6c7('0x10')](0x1f5,[_0x4fadd7[_0xb6c7('0x27')],_0x267e41[_0xb6c7('0x19')][_0xb6c7('0x2e')]()][_0xb6c7('0x1b')]('\x20')));});}else{return _0x46495d(_0x35bbf5[_0xb6c7('0x10')](0x1f5,_0xb6c7('0x34')));}});},'Agents':function(_0x3fbe59){return new Promise(function(_0x18bf30){var _0x3c45fd=_[_0xb6c7('0x24')](_0x294dc9[_0xb6c7('0xc')]);if(_0x3fbe59&&_0x3fbe59['id']){var _0x34bd58=_[_0xb6c7('0x22')](_0x3c45fd,function(_0x1f4830){return _0x1f4830['id']===_0x3fbe59['id'];});_0x18bf30(_0x34bd58);}else{_0x18bf30({'count':_0x3c45fd[_0xb6c7('0x21')],'rows':_0x3c45fd});}});},'Telephones':function(){return new Promise(function(_0x1787af){var _0x5e9079=_['values'](_0x294dc9[_0xb6c7('0x4a')]);_0x1787af({'count':_0x5e9079['length'],'rows':_0x5e9079});});},'Trunks':function(){return new Promise(function(_0x118cac){var _0x3b2b1b=_[_0xb6c7('0x24')](_0x294dc9[_0xb6c7('0x4b')]);_0x118cac({'count':_0x3b2b1b[_0xb6c7('0x21')],'rows':_0x3b2b1b});});},'OutboundChannels':function(){return new Promise(function(_0x5b2259){var _0x39c813=_[_0xb6c7('0x24')](_0x294dc9[_0xb6c7('0x4c')]);_0x5b2259({'count':_0x39c813[_0xb6c7('0x21')],'rows':_0x39c813});});},'Outbound':function(){return new Promise(function(_0x3e9f8b){_0x3e9f8b(_0x294dc9[_0xb6c7('0x3e')]);});},'Campaigns':function(){return new Promise(function(_0x5cb06f){var _0x36b411=_['values'](_0x294dc9[_0xb6c7('0x4d')]);_0x5cb06f({'count':_0x36b411[_0xb6c7('0x21')],'rows':_0x36b411});});},'VoiceQueuesPreview':function(_0x23ce66){var _0xf3ac9b=this;return new Promise(function(_0xe705e5,_0x456da7){_0x290c39[_0xb6c7('0x4e')](_0x23ce66['id'])[_0xb6c7('0x18')](function(_0x107ebd){_0xe705e5({'code':0xc8,'message':_0x107ebd[_0xb6c7('0x19')]});})[_0xb6c7('0x1a')](function(_0x394c91){_0x456da7(_0xf3ac9b[_0xb6c7('0x10')](0x1f4,_0x394c91[_0xb6c7('0x19')]));});});},'EventManager':function(_0x2e2d5f){var _0x28d7bd=this;return new Promise(function(_0x28962e,_0x1fc5b7){if(!_0x2e2d5f[_0xb6c7('0x4f')]){return _0x1fc5b7(_0x28d7bd[_0xb6c7('0x10')](0x1f4,_0xb6c7('0x50')));}ami[_0xb6c7('0x51')](_0xb6c7('0x52')+_0x2e2d5f[_0xb6c7('0x4f')],_0x2e2d5f[_0xb6c7('0x19')]);_0x28962e({'code':0xc8,'message':_0x2e2d5f});});},'FaxAccounts':function(){return new Promise(function(_0x15ab46){var _0x3071e9=_[_0xb6c7('0x24')](_0x294dc9[_0xb6c7('0x53')]);_0x15ab46({'count':_0x3071e9[_0xb6c7('0x21')],'rows':_0x3071e9});});},'SendFax':function(_0x22e97b){var _0x700b1e=this;return new Promise(function(_0x2ba3ee,_0x126f4d){_0xfe3eb9[_0xb6c7('0x54')](_0x22e97b)[_0xb6c7('0x18')](function(_0x4755af){_0x2ba3ee({'code':0xc8,'message':_0x4755af[_0xb6c7('0x19')]});})['catch'](function(_0x43a11c){_0x126f4d(_0x700b1e['error'](0x1f4,_0x43a11c[_0xb6c7('0x19')]));});});},'CheckAfterSend':function(_0x388dff){var _0x4948d7=this;return new Promise(function(_0x18aa78,_0x21a97d){_0xfe3eb9[_0xb6c7('0x55')](_0x388dff)[_0xb6c7('0x18')](function(_0x5dc818){_0x18aa78({'code':0xc8,'message':_0x5dc818[_0xb6c7('0x19')]});})[_0xb6c7('0x1a')](function(_0xeaf8f1){_0x21a97d(_0x4948d7[_0xb6c7('0x10')](0x1f4,_0xeaf8f1[_0xb6c7('0x19')]));});});}};var _0x37b1c5=jayson['server'](_0x5dd47a)[_0xb6c7('0x56')]();_0x37b1c5['on']('error',function(_0x486cc2){return _0xb889c3(_0x486cc2);});_0x37b1c5['listen'](0x232a,_0xb6c7('0x57'),function(){console[_0xb6c7('0x58')](_0xb6c7('0x59'),0x232a);return _0x219abc(_0xb6c7('0x5a')+0x232a);});});}; \ No newline at end of file +var _0xb4c7=['emit','custom:','event','faxAccounts','send','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','reload','module','action','Action','then','message','command','Command','content','catch','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','agents','telephones','campaigns','run','Event\x20name\x20mandatory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x525d20,_0x215fa8){_0x525d20=_0x525d20-0x0;var _0x3c0981=_0xb4c7[_0x525d20];return _0x3c0981;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var jayson=require(_0x7b4c('0x2'));var schema=require(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var config=require('../../../config/environment');var properties=require(_0x7b4c('0x5'));var ami=require(_0x7b4c('0x6'));var VoiceQueueSummary=require(_0x7b4c('0x7'));exports[_0x7b4c('0x8')]=function(_0x2d9945,_0x5adec9,_0x1b0f57){return new Promise(function(_0x10e197,_0x2dd5c7){var _0x4bf85d={'QueuePause':function(_0x2d7b7e){return new Promise(function(_0x21687f){var _0x570daa=util[_0x7b4c('0x9')](_0x7b4c('0xa'),_0x7b4c('0xb'),_0x2d7b7e[_0x7b4c('0xc')]);if(_0x2d9945[_0x7b4c('0xd')]&&_0x2d9945[_0x7b4c('0xd')][_0x570daa]&&_0x2d9945[_0x7b4c('0xd')][_0x570daa][_0x7b4c('0xe')]){_0x2d9945[_0x7b4c('0xd')][_0x570daa][_0x7b4c('0xf')]();}if(_0x2d9945['agents'][_0x570daa]){_0x2d9945['agents'][_0x570daa][_0x7b4c('0x10')]({'statePause':_0x2d7b7e[_0x7b4c('0x11')]?!![]:![]});}_0x21687f({'code':0xc8,'message':_0x7b4c('0x12')});});},'Reload':function(_0x1722ad){var _0x3e1558=this;return new Promise(function(_0x341d36,_0x3ea0da){if(ami[_0x7b4c('0x13')]()==![]){return _0x3ea0da(_0x3e1558[_0x7b4c('0x14')](0x1f4,[config[_0x7b4c('0x15')]['ip'],config['asterisk'][_0x7b4c('0x16')],_0x7b4c('0x17')][_0x7b4c('0x18')]('\x20')));}_0x1722ad=_[_0x7b4c('0x19')](_0x1722ad,_[_0x7b4c('0x1a')](properties[_0x7b4c('0x1b')][_0x7b4c('0x1c')]));_0x1722ad[_0x7b4c('0x1d')]='Reload';return ami[_0x7b4c('0x1e')](_0x1722ad)[_0x7b4c('0x1f')](function(_0x15a5a9){_0x341d36({'code':0xc8,'message':_0x15a5a9[_0x7b4c('0x20')]});})['catch'](function(_0x3ce10c){_0x3ea0da(_0x3e1558[_0x7b4c('0x14')](0x1f5,_0x3ce10c[_0x7b4c('0x20')]));});});},'Command':function(_0x380b79){var _0x2d4c72=this;return new Promise(function(_0x1363b4,_0x237110){if(ami[_0x7b4c('0x13')]()==![]){return _0x237110(_0x2d4c72[_0x7b4c('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x7b4c('0x15')][_0x7b4c('0x16')],_0x7b4c('0x17')][_0x7b4c('0x18')]('\x20')));}_0x380b79=_[_0x7b4c('0x19')](_0x380b79,_0x7b4c('0x21'));_0x380b79[_0x7b4c('0x1d')]=_0x7b4c('0x22');return ami[_0x7b4c('0x1e')](_0x380b79)[_0x7b4c('0x1f')](function(_0x5eec1e){_0x1363b4({'code':0xc8,'message':_0x5eec1e[_0x7b4c('0x23')]});})[_0x7b4c('0x24')](function(_0x276271){_0x237110(_0x2d4c72[_0x7b4c('0x14')](0x1f5,_0x276271[_0x7b4c('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x2bdc4d){var _0x37c059=[];for(var _0x459eb4 in _0x2d9945[_0x7b4c('0x25')]){if(_0x2d9945[_0x7b4c('0x25')][_0x7b4c('0x26')](_0x459eb4)){var _0x257da2=_0x2d9945[_0x7b4c('0x25')][_0x459eb4];var _0x501f75=new VoiceQueueSummary(_0x257da2);_0x37c059[_0x7b4c('0x27')](_0x501f75);}}_0x2bdc4d({'count':_0x37c059[_0x7b4c('0x28')],'rows':_0x37c059});});},'UpdateVoiceQueue':function(_0x1fe0f5){return new Promise(function(_0x3671c4,_0x207c2f){var _0x4ce02c=_[_0x7b4c('0x29')](_0x2d9945[_0x7b4c('0x25')],{'id':parseInt(_0x1fe0f5['id'])});var _0x3e4a46=_[_0x7b4c('0x2a')](_0x1fe0f5,['id']);if(_0x4ce02c){for(var _0x3585cd in _0x3e4a46){if(typeof _0x3e4a46[_0x3585cd]!==_0x7b4c('0x2b')&&typeof _0x4ce02c[_0x3585cd]!==_0x7b4c('0x2b')){_0x4ce02c[_0x3585cd]=_0x3e4a46[_0x3585cd];}}_0x3671c4(_0x4ce02c);}else{_0x207c2f();}});},'VoiceChannels':function(){return new Promise(function(_0x3c7eb3){var _0x435543=_[_0x7b4c('0x2c')](_0x2d9945[_0x7b4c('0x2d')]);_0x3c7eb3({'count':_0x435543[_0x7b4c('0x28')],'rows':_0x435543});});},'VoiceChannelMixMonitor':function(_0x9d3d31){var _0x4f0d33=this;return new Promise(function(_0x59874f,_0x511f21){if(ami[_0x7b4c('0x13')]()==![]){return _0x511f21(_0x4f0d33[_0x7b4c('0x14')](0x1f4,[config[_0x7b4c('0x15')]['ip'],config[_0x7b4c('0x15')]['username'],_0x7b4c('0x17')][_0x7b4c('0x18')]('\x20')));}var _0x5d728b=schema(properties[_0x7b4c('0x2e')])['validate'](_0x9d3d31);if(_0x5d728b[_0x7b4c('0x28')]>0x0){return _0x511f21(_0x4f0d33[_0x7b4c('0x14')](0x1f4,_[_0x7b4c('0x2f')](_0x5d728b,'message')[_0x7b4c('0x18')](',\x20')));}var _0x1b9e6c=_['find'](_0x2d9945[_0x7b4c('0x2d')],{'uniqueid':_0x9d3d31[_0x7b4c('0x30')]});if(_0x1b9e6c&&_0x1b9e6c[_0x7b4c('0x31')]){var _0x2e0835=util['format']('%s.%s',_0x9d3d31[_0x7b4c('0x32')]||_0x9d3d31[_0x7b4c('0x30')],_0x9d3d31['format']||_0x7b4c('0x33'));return ami['Action']({'action':'MixMonitor','channel':_0x1b9e6c[_0x7b4c('0x31')],'file':_0x2e0835,'options':_0x7b4c('0x34')})[_0x7b4c('0x1f')](function(_0x250901){var _0x5ba56a=_[_0x7b4c('0x29')](_0x1b9e6c[_0x7b4c('0x35')],{'filename':_0x7b4c('0x36')+_0x2e0835[_0x7b4c('0x37')]()});if(_[_0x7b4c('0x38')](_0x5ba56a)){_0x1b9e6c[_0x7b4c('0x35')][_0x7b4c('0x27')]({'filename':'/var/spool/asterisk/monitor/'+_0x2e0835['toLowerCase'](),'createdAt':moment()[_0x7b4c('0x9')](_0x7b4c('0x39')),'mixmonitorid':_0x250901[_0x7b4c('0x3a')],'status':_0x7b4c('0x3b')});}else{_0x5ba56a[_0x7b4c('0x3a')]=_0x250901['mixmonitorid'];_0x5ba56a[_0x7b4c('0x3c')]=_0x7b4c('0x3b');}_0x59874f({'code':0xc8,'message':[_0x9d3d31[_0x7b4c('0x30')],_0x7b4c('0x3d'),_0x250901[_0x7b4c('0x3a')]][_0x7b4c('0x18')]('\x20'),'mixmonitorid':_0x250901[_0x7b4c('0x3a')]});})[_0x7b4c('0x24')](function(_0x3d8126){_0x511f21(_0x4f0d33['error'](0x1f5,[_0x9d3d31[_0x7b4c('0x30')],_0x3d8126['message'][_0x7b4c('0x37')]()]['join']('\x20')));});}else{return _0x511f21(_0x4f0d33[_0x7b4c('0x14')](0x1f5,_0x7b4c('0x3e')));}});},'VoiceChannelStopMixMonitor':function(_0x5bb6d0){var _0x50f2ed=this;return new Promise(function(_0x354578,_0x4314b6){if(ami[_0x7b4c('0x13')]()==![]){return _0x4314b6(_0x50f2ed[_0x7b4c('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x7b4c('0x15')][_0x7b4c('0x16')],_0x7b4c('0x17')]['join']('\x20')));}var _0x45ad59=schema(properties['voicechannel'])['validate'](_0x5bb6d0);if(_0x45ad59[_0x7b4c('0x28')]>0x0){return _0x4314b6(_0x50f2ed['error'](0x1f4,_[_0x7b4c('0x2f')](_0x45ad59,_0x7b4c('0x20'))[_0x7b4c('0x18')](',\x20')));}var _0x301935=_[_0x7b4c('0x29')](_0x2d9945[_0x7b4c('0x2d')],{'uniqueid':_0x5bb6d0[_0x7b4c('0x30')]});if(_0x301935){return Promise[_0x7b4c('0x3f')]()[_0x7b4c('0x1f')](function(){if(_0x301935['channel']){return ami[_0x7b4c('0x1e')]({'action':'StopMixMonitor','channel':_0x301935['channel'],'mixmonitorid':_0x5bb6d0[_0x7b4c('0x3a')]})[_0x7b4c('0x24')](function(){});}})['then'](function(){if(_0x301935['destinationchannel']){return ami[_0x7b4c('0x1e')]({'action':_0x7b4c('0x40'),'channel':_0x301935[_0x7b4c('0x41')],'mixmonitorid':_0x5bb6d0[_0x7b4c('0x3a')]})[_0x7b4c('0x24')](function(){});}})[_0x7b4c('0x1f')](function(){var _0x336796=_[_0x7b4c('0x29')](_0x301935['monitors'],{'mixmonitorid':_0x5bb6d0[_0x7b4c('0x3a')]});if(_0x336796){_0x336796[_0x7b4c('0x3c')]=_0x7b4c('0x42');}})[_0x7b4c('0x1f')](function(){var _0xc76435=util[_0x7b4c('0x9')](_0x7b4c('0x43'),_0x5bb6d0[_0x7b4c('0x32')]||_0x5bb6d0[_0x7b4c('0x30')],_0x5bb6d0['format']||'wav');var _0x1884a4=_[_0x7b4c('0x29')](_0x301935[_0x7b4c('0x35')],{'filename':'/var/spool/asterisk/monitor/'+_0xc76435[_0x7b4c('0x37')]()});if(_0x1884a4){_0x1884a4[_0x7b4c('0x3c')]='stop';}})[_0x7b4c('0x1f')](function(){_0x354578({'code':0xc8,'message':[_0x5bb6d0['uniqueid'],_0x7b4c('0x44')]['join']('\x20')});})[_0x7b4c('0x24')](function(_0x53a7c0){_0x4314b6(_0x50f2ed[_0x7b4c('0x14')](0x1f5,[_0x5bb6d0[_0x7b4c('0x30')],_0x53a7c0['message']['toLowerCase']()][_0x7b4c('0x18')]('\x20')));});}else{return _0x4314b6(_0x50f2ed[_0x7b4c('0x14')](0x1f5,_0x7b4c('0x3e')));}});},'VoiceQueuesChannels':function(_0x4fd536){var _0x56233b=this;return new Promise(function(_0x2fc5b5){var _0x1c118a=_['values'](_0x2d9945['queueChannels']);var _0x14bf3f={'count':_0x1c118a[_0x7b4c('0x28')],'rows':_0x1c118a};if(_0x4fd536&&_0x4fd536[_0x7b4c('0x45')]){if(!['inbound',_0x7b4c('0x46')][_0x7b4c('0x47')](_0x4fd536['type'])){return _0x2dd5c7(_0x56233b['error'](0x190,_0x7b4c('0x48')));}var _0x4d8491=_['filter'](_0x1c118a,function(_0xeefd36){return _0xeefd36['type']===_0x4fd536['type'];});_0x14bf3f[_0x7b4c('0x49')]=_0x4d8491[_0x7b4c('0x28')];_0x14bf3f[_0x7b4c('0x4a')]=_0x4d8491;}_0x2fc5b5(_0x14bf3f);});},'VoiceQueuesChannel':function(_0x17af17){var _0x4895dd=this;return new Promise(function(_0x4946bb,_0xc9a255){var _0x6c226d=schema(properties[_0x7b4c('0x4b')])['validate'](_0x17af17);if(_0x6c226d[_0x7b4c('0x28')]>0x0){return _0xc9a255(_0x4895dd[_0x7b4c('0x14')](0x1f4,_[_0x7b4c('0x2f')](_0x6c226d,'message')[_0x7b4c('0x18')](',\x20')));}var _0x366102=_['find'](_0x2d9945[_0x7b4c('0x4c')],{'uniqueid':_0x17af17[_0x7b4c('0x30')]});if(_0x366102){_0x4946bb(_0x366102);}else{return _0xc9a255(_0x4895dd[_0x7b4c('0x14')](0x1f5,_0x7b4c('0x3e')));}});},'VoiceQueuesChannelHangup':function(_0x381232){var _0x254aeb=this;return new Promise(function(_0x1a1718,_0x58b77c){if(ami[_0x7b4c('0x13')]()==![]){return _0x58b77c(_0x254aeb[_0x7b4c('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x7b4c('0x15')][_0x7b4c('0x16')],_0x7b4c('0x17')][_0x7b4c('0x18')]('\x20')));}var _0x596efc=schema(properties[_0x7b4c('0x4d')])['validate'](_0x381232);if(_0x596efc['length']>0x0){return _0x58b77c(_0x254aeb[_0x7b4c('0x14')](0x1f4,_[_0x7b4c('0x2f')](_0x596efc,_0x7b4c('0x20'))[_0x7b4c('0x18')](',\x20')));}var _0x6956f7=_['find'](_0x2d9945['queueChannels'],{'uniqueid':_0x381232[_0x7b4c('0x30')]});if(_0x6956f7&&_0x6956f7[_0x7b4c('0x31')]){return ami[_0x7b4c('0x1e')]({'action':'Hangup','channel':_0x6956f7[_0x7b4c('0x31')]})[_0x7b4c('0x1f')](function(_0x36fc5d){_0x1a1718({'code':0xc8,'message':[_0x381232['uniqueid'],_0x36fc5d[_0x7b4c('0x20')][_0x7b4c('0x37')]()][_0x7b4c('0x18')]('\x20')});})['catch'](function(_0x257e56){_0x58b77c(_0x254aeb[_0x7b4c('0x14')](0x1f5,[_0x381232['uniqueid'],_0x257e56[_0x7b4c('0x20')]['toLowerCase']()][_0x7b4c('0x18')]('\x20')));});}else{return _0x58b77c(_0x254aeb[_0x7b4c('0x14')](0x1f5,_0x7b4c('0x3e')));}});},'VoiceQueuesChannelRedirect':function(_0x5d123a){var _0x5af2af=this;return new Promise(function(_0x237921,_0x401c4b){if(ami[_0x7b4c('0x13')]()==![]){return _0x401c4b(_0x5af2af['error'](0x1f4,[config[_0x7b4c('0x15')]['ip'],config['asterisk'][_0x7b4c('0x16')],_0x7b4c('0x17')][_0x7b4c('0x18')]('\x20')));}var _0x5f3ed5=schema(properties[_0x7b4c('0x4e')])['validate'](_0x5d123a);if(_0x5f3ed5[_0x7b4c('0x28')]>0x0){return _0x401c4b(_0x5af2af[_0x7b4c('0x14')](0x1f4,_['map'](_0x5f3ed5,_0x7b4c('0x20'))[_0x7b4c('0x18')](',\x20')));}var _0x41a321=_[_0x7b4c('0x29')](_0x2d9945[_0x7b4c('0x4c')],{'uniqueid':_0x5d123a[_0x7b4c('0x30')]});if(_0x41a321&&_0x41a321[_0x7b4c('0x31')]){return ami[_0x7b4c('0x1e')]({'action':'Redirect','channel':_0x41a321[_0x7b4c('0x31')],'exten':_0x5d123a[_0x7b4c('0x4f')],'context':_0x5d123a[_0x7b4c('0x50')]||_0x41a321[_0x7b4c('0x50')],'priority':0x1})[_0x7b4c('0x1f')](function(_0x3cbf32){_0x237921({'code':0xc8,'message':[_0x5d123a[_0x7b4c('0x30')],_0x3cbf32[_0x7b4c('0x20')][_0x7b4c('0x37')]()][_0x7b4c('0x18')]('\x20')});})[_0x7b4c('0x24')](function(_0x2be22d){_0x401c4b(_0x5af2af[_0x7b4c('0x14')](0x1f5,[_0x5d123a[_0x7b4c('0x30')],_0x2be22d[_0x7b4c('0x20')][_0x7b4c('0x37')]()][_0x7b4c('0x18')]('\x20')));});}else{return _0x401c4b(_0x5af2af[_0x7b4c('0x14')](0x1f5,_0x7b4c('0x3e')));}});},'Agents':function(_0x3b4fda){return new Promise(function(_0x520df0){var _0x58a4b7=_[_0x7b4c('0x2c')](_0x2d9945[_0x7b4c('0x51')]);if(_0x3b4fda&&_0x3b4fda['id']){var _0x50069b=_[_0x7b4c('0x29')](_0x58a4b7,function(_0x25bbde){return _0x25bbde['id']===_0x3b4fda['id'];});_0x520df0(_0x50069b);}else{_0x520df0({'count':_0x58a4b7[_0x7b4c('0x28')],'rows':_0x58a4b7});}});},'Telephones':function(){return new Promise(function(_0xc214ce){var _0x20b72e=_[_0x7b4c('0x2c')](_0x2d9945[_0x7b4c('0x52')]);_0xc214ce({'count':_0x20b72e[_0x7b4c('0x28')],'rows':_0x20b72e});});},'Trunks':function(){return new Promise(function(_0x40edf1){var _0x4ff33f=_[_0x7b4c('0x2c')](_0x2d9945['trunks']);_0x40edf1({'count':_0x4ff33f[_0x7b4c('0x28')],'rows':_0x4ff33f});});},'OutboundChannels':function(){return new Promise(function(_0x5477e3){var _0x5f3070=_[_0x7b4c('0x2c')](_0x2d9945['outboundChannels']);_0x5477e3({'count':_0x5f3070['length'],'rows':_0x5f3070});});},'Outbound':function(){return new Promise(function(_0xe46a1e){_0xe46a1e(_0x2d9945[_0x7b4c('0x46')]);});},'Campaigns':function(){return new Promise(function(_0x328948){var _0x530979=_[_0x7b4c('0x2c')](_0x2d9945[_0x7b4c('0x53')]);_0x328948({'count':_0x530979[_0x7b4c('0x28')],'rows':_0x530979});});},'VoiceQueuesPreview':function(_0x29987e){var _0x1b4883=this;return new Promise(function(_0x2837aa,_0x2f58bf){_0x5adec9[_0x7b4c('0x54')](_0x29987e['id'])[_0x7b4c('0x1f')](function(_0x4777b5){_0x2837aa({'code':0xc8,'message':_0x4777b5[_0x7b4c('0x20')]});})[_0x7b4c('0x24')](function(_0x190548){_0x2f58bf(_0x1b4883[_0x7b4c('0x14')](0x1f4,_0x190548['message']));});});},'EventManager':function(_0x1df6f1){var _0x2732a2=this;return new Promise(function(_0x35e94a,_0x1cc380){if(!_0x1df6f1['event']){return _0x1cc380(_0x2732a2[_0x7b4c('0x14')](0x1f4,_0x7b4c('0x55')));}ami[_0x7b4c('0x56')](_0x7b4c('0x57')+_0x1df6f1[_0x7b4c('0x58')],_0x1df6f1[_0x7b4c('0x20')]);_0x35e94a({'code':0xc8,'message':_0x1df6f1});});},'FaxAccounts':function(){return new Promise(function(_0x766818){var _0x53bd8f=_[_0x7b4c('0x2c')](_0x2d9945[_0x7b4c('0x59')]);_0x766818({'count':_0x53bd8f['length'],'rows':_0x53bd8f});});},'SendFax':function(_0x4a9cf6){var _0x5ce786=this;return new Promise(function(_0x36ff91,_0x3e44af){_0x1b0f57[_0x7b4c('0x5a')](_0x4a9cf6)[_0x7b4c('0x1f')](function(_0xccdf59){_0x36ff91({'code':0xc8,'message':_0xccdf59[_0x7b4c('0x20')]});})[_0x7b4c('0x24')](function(_0x200c98){_0x3e44af(_0x5ce786[_0x7b4c('0x14')](0x1f4,_0x200c98[_0x7b4c('0x20')]));});});},'CheckAfterSend':function(_0x83e8bb){var _0x257fae=this;return new Promise(function(_0x2cd8a4,_0x4ccf5d){_0x1b0f57[_0x7b4c('0x5b')](_0x83e8bb)[_0x7b4c('0x1f')](function(_0x2afaa0){_0x2cd8a4({'code':0xc8,'message':_0x2afaa0['message']});})[_0x7b4c('0x24')](function(_0x392656){_0x4ccf5d(_0x257fae[_0x7b4c('0x14')](0x1f4,_0x392656[_0x7b4c('0x20')]));});});}};var _0x2b789e=jayson['server'](_0x4bf85d)[_0x7b4c('0x5c')]();_0x2b789e['on'](_0x7b4c('0x14'),function(_0x34abb1){return _0x2dd5c7(_0x34abb1);});_0x2b789e[_0x7b4c('0x8')](0x232a,'127.0.0.1',function(){console[_0x7b4c('0x5d')](_0x7b4c('0x5e'),0x232a);return _0x10e197(_0x7b4c('0x5f')+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 16cdf05..bc7fc2f 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 _0x01c2=['[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','resolve','then','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid'];(function(_0x40197b,_0x4e763f){var _0x3b9c2f=function(_0x41c34f){while(--_0x41c34f){_0x40197b['push'](_0x40197b['shift']());}};_0x3b9c2f(++_0x4e763f);}(_0x01c2,0x17b));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x201c('0x0'));var BPromise=require(_0x201c('0x1'));var Redis=require(_0x201c('0x2'));var util=require(_0x201c('0x3'));var config=require(_0x201c('0x4'));var logger=require(_0x201c('0x5'))(_0x201c('0x6'));var cmContactRpc=require(_0x201c('0x7'));config['redis']=_[_0x201c('0x8')](config[_0x201c('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x201c('0x9')]));function emit(_0x1b92f6,_0x18e0c8,_0x375753,_0x4f2dc1,_0x125a10){logger[_0x201c('0xa')](_0x201c('0xb'),_0x1b92f6,_0x18e0c8['id'],_0x375753,_0x4f2dc1,JSON[_0x201c('0xc')](_0x125a10));io['to'](_0x375753)[_0x201c('0xd')](_0x4f2dc1,_0x125a10);}exports[_0x201c('0xe')]=function(_0x5cf96b,_0x19a076,_0x3640d3,_0x73cddb){var _0x541202,_0x190177;var _0x39c775={};var _0x37f843;var _0x5c94b2=Number(_0x3640d3['data1']);var _0x37a337=_0x3640d3[_0x201c('0xf')]?Boolean(Number(_0x3640d3[_0x201c('0xf')])):![];var _0x49162b;var _0x363bbf=![];if(!_[_0x201c('0x10')](_0x3640d3[_0x201c('0x11')])){if(_0x3640d3[_0x201c('0x11')]=='1')_0x363bbf=!![];}if(!_0x363bbf){if(_0x73cddb[_0x201c('0x12')]){_0x39c775['id']=_0x73cddb[_0x201c('0x12')];}}if(!_0x39c775['id']){_0x39c775[_0x201c('0x13')]=_0x5c94b2;_0x49162b=_0x3640d3[_0x201c('0x14')]&&_0x3640d3['data3']!=='0'?_0x3640d3['data3'][_0x201c('0x15')](','):[_0x201c('0x16')];_0x39c775[_0x201c('0x17')]=_[_0x201c('0x18')](_0x49162b,function(_0x14b6cb){var _0x587584={};_0x587584[_0x14b6cb]=_0x73cddb[_0x201c('0x19')]?_0x73cddb[_0x201c('0x1a')]:_0x73cddb[_0x201c('0x1b')];return _0x587584;});_0x37f843=_0x73cddb[_0x201c('0x19')]?_0x73cddb[_0x201c('0x1a')]:_0x73cddb[_0x201c('0x1b')];}var _0x5609b4=['id',_0x201c('0x1c'),_0x201c('0x1d'),'phone',_0x201c('0x1e'),_0x201c('0x1f'),_0x201c('0x13'),_0x201c('0x20'),_0x201c('0x21'),_0x201c('0x22')];var _0xe64cb9=_[_0x201c('0x23')](_0x5609b4,_0x49162b);BPromise['resolve']()['then'](cmContactRpc[_0x201c('0x24')]({'attributes':_0xe64cb9,'where':_0x39c775,'phone':_0x37f843}))['then'](function(_0x3ab81f){_0x190177=_0x3ab81f;if(!_[_0x201c('0x25')](_0x190177)){if(_0x190177[_0x201c('0x26')]===0x1){_0x541202=_0x190177[0x0];logger[_0x201c('0xa')](_0x201c('0x27'),_0x73cddb[_0x201c('0x28')],_0x19a076['id'],_0x541202['id']);}else{logger[_0x201c('0xa')](_0x201c('0x29'),_0x73cddb[_0x201c('0x28')],_0x19a076['id'],_[_0x201c('0x18')](_0x190177,'id')['join'](','));}return;}else{logger['info'](_0x201c('0x2a'),_0x73cddb[_0x201c('0x28')],_0x19a076['id']);var _0x3b17b1={'ListId':_0x5c94b2};var _0x958297=_0x3640d3[_0x201c('0x2b')]&&_0x3640d3[_0x201c('0x2b')]!=='0'?_0x3640d3[_0x201c('0x2b')]:'phone';if(_0x37a337){logger['info'](_0x201c('0x2c'),_0x73cddb[_0x201c('0x28')],_0x19a076['id']);_0x3b17b1[_0x958297]=_[_0x201c('0x10')](_0x73cddb['routeId'])?_0x73cddb['calleridnum']:_0x73cddb[_0x201c('0x1a')];if(_[_0x201c('0x10')](_0x73cddb['routeId'])){_0x3b17b1['firstName']=_0x73cddb['calleridname']&&_0x73cddb['calleridname']!==''?_0x73cddb[_0x201c('0x2d')]:_0x201c('0x2e');}else{_0x3b17b1[_0x201c('0x1c')]=_0x73cddb[_0x201c('0x2f')]&&_0x73cddb[_0x201c('0x2f')]!==_0x201c('0x30')?_0x73cddb[_0x201c('0x2f')]:'Unknown';}return BPromise[_0x201c('0x31')]()[_0x201c('0x32')](cmContactRpc['createContact'](_0x3b17b1))[_0x201c('0x32')](function(_0x14d1cf){_0x541202=_0x14d1cf;_0x190177[_0x201c('0x33')](_0x14d1cf);if(_0x541202){logger[_0x201c('0xa')](_0x201c('0x34'),_0x73cddb[_0x201c('0x28')],_0x19a076['id'],_0x541202['id']);}return;});}else{logger['info'](_0x201c('0x35'),_0x73cddb['uniqueid'],_0x19a076['id']);_0x3b17b1[_0x958297]=_[_0x201c('0x10')](_0x73cddb[_0x201c('0x19')])?_0x73cddb[_0x201c('0x1b')]:_0x73cddb[_0x201c('0x1a')];if(_[_0x201c('0x10')](_0x73cddb['routeId'])){_0x3b17b1[_0x201c('0x1c')]=_0x73cddb['calleridname']&&_0x73cddb[_0x201c('0x2d')]!==''?_0x73cddb[_0x201c('0x2d')]:_0x201c('0x2e');}else{_0x3b17b1['firstName']=_0x73cddb['destcalleridname']&&_0x73cddb[_0x201c('0x2f')]!==_0x201c('0x30')?_0x73cddb[_0x201c('0x2f')]:_0x201c('0x2e');}_0x541202=_0x3b17b1;_0x190177['push'](_0x3b17b1);return;}}})[_0x201c('0x32')](function(){if(_0x5cf96b){emit(_0x73cddb['uniqueid'],_0x19a076,util[_0x201c('0x36')](_0x201c('0x37'),_0x5cf96b[_0x201c('0x38')]),util[_0x201c('0x36')](_0x201c('0x39'),_0x3640d3['action'][_0x201c('0x3a')]()),{'evt':_[_0x201c('0x3b')](_0x73cddb,{'autoCreate':_0x37a337}),'contact':_0x541202===undefined?{}:_0x541202,'contacts':_0x190177[_0x201c('0x26')]===0x0?undefined:_0x190177});}});}; \ No newline at end of file +var _0x8646=['[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','mobile','fax','union','resolve','then','isEmpty','length','info'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x8646,0x1c4));var _0x6864=function(_0x3339a0,_0x55503e){_0x3339a0=_0x3339a0-0x0;var _0x163186=_0x8646[_0x3339a0];return _0x163186;};'use strict';var _=require(_0x6864('0x0'));var BPromise=require(_0x6864('0x1'));var Redis=require(_0x6864('0x2'));var util=require(_0x6864('0x3'));var config=require(_0x6864('0x4'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x6864('0x5'));config[_0x6864('0x6')]=_['defaults'](config[_0x6864('0x6')],{'host':_0x6864('0x7'),'port':0x18eb});var io=require(_0x6864('0x8'))(new Redis(config[_0x6864('0x6')]));function emit(_0x3aaa67,_0x4daff9,_0x24c362,_0x433853,_0x46da3f){logger['info'](_0x6864('0x9'),_0x3aaa67,_0x4daff9['id'],_0x24c362,_0x433853,JSON[_0x6864('0xa')](_0x46da3f));io['to'](_0x24c362)[_0x6864('0xb')](_0x433853,_0x46da3f);}exports[_0x6864('0xc')]=function(_0x16ec3d,_0xc1d259,_0x13c6bf,_0x367bf0){var _0x2836fb,_0x394c7e;var _0x27e653={};var _0x95d610;var _0x1f0a24=Number(_0x13c6bf[_0x6864('0xd')]);var _0x3f5b6c=_0x13c6bf[_0x6864('0xe')]?Boolean(Number(_0x13c6bf['data2'])):![];var _0x23bf4f;var _0x1fab09=![];if(!_[_0x6864('0xf')](_0x13c6bf[_0x6864('0x10')])){if(_0x13c6bf[_0x6864('0x10')]=='1')_0x1fab09=!![];}if(!_0x1fab09){if(_0x367bf0[_0x6864('0x11')]){_0x27e653['id']=_0x367bf0['xmd-contactid'];}}if(!_0x27e653['id']){_0x27e653[_0x6864('0x12')]=_0x1f0a24;_0x23bf4f=_0x13c6bf[_0x6864('0x13')]&&_0x13c6bf[_0x6864('0x13')]!=='0'?_0x13c6bf[_0x6864('0x13')][_0x6864('0x14')](','):[_0x6864('0x15')];_0x27e653['$or']=_[_0x6864('0x16')](_0x23bf4f,function(_0x25d79d){var _0x4cb97a={};_0x4cb97a[_0x25d79d]=_0x367bf0[_0x6864('0x17')]?_0x367bf0[_0x6864('0x18')]:_0x367bf0[_0x6864('0x19')];return _0x4cb97a;});_0x95d610=_0x367bf0[_0x6864('0x17')]?_0x367bf0[_0x6864('0x18')]:_0x367bf0[_0x6864('0x19')];}var _0x374d55=['id','firstName','lastName','phone',_0x6864('0x1a'),_0x6864('0x1b'),_0x6864('0x12'),'createdAt','scheduledAt','updatedAt'];var _0x42d200=_[_0x6864('0x1c')](_0x374d55,_0x23bf4f);BPromise[_0x6864('0x1d')]()[_0x6864('0x1e')](cmContactRpc['getContacts']({'attributes':_0x42d200,'where':_0x27e653,'phone':_0x95d610}))[_0x6864('0x1e')](function(_0x477a17){_0x394c7e=_0x477a17;if(!_[_0x6864('0x1f')](_0x394c7e)){if(_0x394c7e[_0x6864('0x20')]===0x1){_0x2836fb=_0x394c7e[0x0];logger[_0x6864('0x21')](_0x6864('0x22'),_0x367bf0[_0x6864('0x23')],_0xc1d259['id'],_0x2836fb['id']);}else{logger[_0x6864('0x21')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x367bf0['uniqueid'],_0xc1d259['id'],_[_0x6864('0x16')](_0x394c7e,'id')[_0x6864('0x24')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x367bf0[_0x6864('0x23')],_0xc1d259['id']);var _0x28ef11={'ListId':_0x1f0a24};var _0x358fc3=_0x13c6bf[_0x6864('0x25')]&&_0x13c6bf['data4']!=='0'?_0x13c6bf['data4']:'phone';if(_0x3f5b6c){logger[_0x6864('0x21')](_0x6864('0x26'),_0x367bf0[_0x6864('0x23')],_0xc1d259['id']);_0x28ef11[_0x358fc3]=_[_0x6864('0xf')](_0x367bf0[_0x6864('0x17')])?_0x367bf0[_0x6864('0x19')]:_0x367bf0[_0x6864('0x18')];if(_['isNil'](_0x367bf0[_0x6864('0x17')])){_0x28ef11[_0x6864('0x27')]=_0x367bf0['calleridname']&&_0x367bf0[_0x6864('0x28')]!==_0x6864('0x29')?_0x367bf0[_0x6864('0x28')]:'Unknown';}else{_0x28ef11[_0x6864('0x27')]=_0x367bf0[_0x6864('0x2a')]&&_0x367bf0[_0x6864('0x2a')]!==_0x6864('0x29')?_0x367bf0[_0x6864('0x2a')]:_0x6864('0x2b');}return BPromise['resolve']()[_0x6864('0x1e')](cmContactRpc[_0x6864('0x2c')](_0x28ef11))[_0x6864('0x1e')](function(_0x553e7f){_0x2836fb=_0x553e7f;_0x394c7e['push'](_0x553e7f);if(_0x2836fb){logger[_0x6864('0x21')](_0x6864('0x2d'),_0x367bf0['uniqueid'],_0xc1d259['id'],_0x2836fb['id']);}return;});}else{logger[_0x6864('0x21')](_0x6864('0x2e'),_0x367bf0[_0x6864('0x23')],_0xc1d259['id']);_0x28ef11[_0x358fc3]=_[_0x6864('0xf')](_0x367bf0[_0x6864('0x17')])?_0x367bf0[_0x6864('0x19')]:_0x367bf0[_0x6864('0x18')];if(_['isNil'](_0x367bf0[_0x6864('0x17')])){_0x28ef11[_0x6864('0x27')]=_0x367bf0[_0x6864('0x28')]&&_0x367bf0[_0x6864('0x28')]!==_0x6864('0x29')?_0x367bf0[_0x6864('0x28')]:_0x6864('0x2b');}else{_0x28ef11[_0x6864('0x27')]=_0x367bf0[_0x6864('0x2a')]&&_0x367bf0[_0x6864('0x2a')]!==_0x6864('0x29')?_0x367bf0['destcalleridname']:_0x6864('0x2b');}_0x2836fb=_0x28ef11;_0x394c7e[_0x6864('0x2f')](_0x28ef11);return;}}})[_0x6864('0x1e')](function(){if(_0x16ec3d){emit(_0x367bf0[_0x6864('0x23')],_0xc1d259,util[_0x6864('0x30')](_0x6864('0x31'),_0x16ec3d['name']),util[_0x6864('0x30')](_0x6864('0x32'),_0x13c6bf[_0x6864('0x33')][_0x6864('0x34')]()),{'evt':_[_0x6864('0x35')](_0x367bf0,{'autoCreate':_0x3f5b6c}),'contact':_0x2836fb===undefined?{}:_0x2836fb,'contacts':_0x394c7e[_0x6864('0x20')]===0x0?undefined:_0x394c7e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 782e3d1..ca22a54 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 _0x21cd=['voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','data3','isNil','uriLocation','data4','windowWidth','data5','800','data6','600','winApplication','winArguments','format','name','trigger:%s:%s','data1','jscripty','user:%s','trigger:%s','exec','integration','queue','urlforward','script','parse','query','channel','every','AllConditions','checkConditions','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','agent','membername','lastevent','routeId','null','substatus','created','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates'];(function(_0x407ce1,_0x20376f){var _0x4a3083=function(_0x5aeeea){while(--_0x5aeeea){_0x407ce1['push'](_0x407ce1['shift']());}};_0x4a3083(++_0x20376f);}(_0x21cd,0x6a));var _0xd21c=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x21cd[_0x3070dc];return _0x431489;};'use strict';var util=require(_0xd21c('0x0'));var _=require(_0xd21c('0x1'));var url=require(_0xd21c('0x2'));var Mustache=require(_0xd21c('0x3'));var Redis=require(_0xd21c('0x4'));var urlforward=require(_0xd21c('0x5'));var integration=require(_0xd21c('0x6'));var cmContact=require(_0xd21c('0x7'));var script=require(_0xd21c('0x8'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xd21c('0x9'));var ami=require(_0xd21c('0xa'));config[_0xd21c('0xb')]=_[_0xd21c('0xc')](config[_0xd21c('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xd21c('0xd'))(new Redis(config[_0xd21c('0xb')]));var operators={'equals':function(_0x240926,_0x3d7132){return _0x240926==_0x3d7132;},'not_equals':function(_0x1d8a25,_0x5298c4){return _0x1d8a25!=_0x5298c4;}};var barAndWebActions=[_0xd21c('0xe'),'url',_0xd21c('0xf')];function Trigger(_0x2e36b0){this[_0xd21c('0x10')]=_0x2e36b0[_0xd21c('0x10')];this[_0xd21c('0x11')]=_0x2e36b0[_0xd21c('0x11')];this[_0xd21c('0x12')]=_0x2e36b0['voiceQueues'];this[_0xd21c('0x13')]=_0x2e36b0[_0xd21c('0x13')];this[_0xd21c('0x14')]=_0x2e36b0[_0xd21c('0x14')];this[_0xd21c('0x15')]=_0x2e36b0[_0xd21c('0x15')];this[_0xd21c('0x16')]=_0x2e36b0[_0xd21c('0x16')];this[_0xd21c('0x17')]=_0x2e36b0[_0xd21c('0x17')];this[_0xd21c('0x18')]=_0x2e36b0[_0xd21c('0x18')];this['zohoAccounts']=_0x2e36b0[_0xd21c('0x19')];this[_0xd21c('0x1a')]=_0x2e36b0[_0xd21c('0x1a')];this[_0xd21c('0x1b')]=_0x2e36b0[_0xd21c('0x1b')];this['servicenowAccounts']=_0x2e36b0[_0xd21c('0x1c')];this[_0xd21c('0x1d')]=_0x2e36b0[_0xd21c('0x1d')];this['freshsalesAccounts']=_0x2e36b0[_0xd21c('0x1e')];this[_0xd21c('0x1f')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xd21c('0x17')],'freshdesk':this[_0xd21c('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xd21c('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0xd21c('0x1b')],'dynamics365':this[_0xd21c('0x1d')],'freshsales':this[_0xd21c('0x1e')],'servicenow':this[_0xd21c('0x1c')]};ami['on']('custom:agentcalled',this[_0xd21c('0x20')]['bind'](this));ami['on']('custom:agentconnect',this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x22'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x23'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x24'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x25'),this['syncCustomEvent'][_0xd21c('0x21')](this));ami['on']('custom:agentbusy',this[_0xd21c('0x20')]['bind'](this));ami['on'](_0xd21c('0x26'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x27'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x28'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x29'),this['syncCustomEvent'][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x2a'),this['syncCustomEvent'][_0xd21c('0x21')](this));ami['on']('custom:dialbegin',this['syncAgentDial']['bind'](this));ami['on'](_0xd21c('0x2b'),this[_0xd21c('0x2c')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x2d'),this[_0xd21c('0x2c')][_0xd21c('0x21')](this));ami['on']('custom:newinteraction',this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x2e'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on']('custom:substatus',this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xd21c('0x21')](this));ami['on']('custom:outgoingmessage',this[_0xd21c('0x20')][_0xd21c('0x21')](this));ami['on']('custom:acceptmessage',this[_0xd21c('0x20')]['bind'](this));ami['on'](_0xd21c('0x2f'),this['syncCustomEvent'][_0xd21c('0x21')](this));ami['on'](_0xd21c('0x30'),this[_0xd21c('0x20')][_0xd21c('0x21')](this));}Trigger[_0xd21c('0x31')][_0xd21c('0x32')]=function(_0x2b13f9,_0xfac1de,_0x155671){logger[_0xd21c('0x33')](_0x2b13f9,_0xfac1de,JSON[_0xd21c('0x34')](_0x155671));io['to'](_0x2b13f9)['emit'](_0xfac1de,_0x155671);};Trigger[_0xd21c('0x31')][_0xd21c('0x20')]=function(_0x1fc2f2){var _0x34a1a3=_[_0xd21c('0x35')](_0x1fc2f2);if(typeof _0x34a1a3[_0xd21c('0x36')]===_0xd21c('0x37')){_0x34a1a3[_0xd21c('0x36')]=_0xd21c('0x38');}this[_0xd21c('0x39')](_0x34a1a3);};Trigger['prototype'][_0xd21c('0x2c')]=function(_0x3fbe41){if(this[_0xd21c('0x11')][_0x3fbe41[_0xd21c('0x3a')]]){this[_0xd21c('0x20')](_0x3fbe41);}};Trigger['prototype'][_0xd21c('0x39')]=function(_0x41bd6b){var _0x57dd3d;for(var _0x1eb1fd in this[_0xd21c('0x10')]){if(this['triggers'][_0xd21c('0x3b')](_0x1eb1fd)){if(this[_0xd21c('0x10')][_0x1eb1fd][_0xd21c('0x3c')]){_0x57dd3d=this[_0xd21c('0x3d')](this[_0xd21c('0x10')][_0x1eb1fd],_0x41bd6b);if(_0x57dd3d){_[_0xd21c('0x3e')](_0x41bd6b,_0x41bd6b[_0xd21c('0x3f')]);for(var _0x4ab603=0x0,_0x560aab,_0x516e93,_0xbd2650;_0x4ab6030x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x14ea31,_0x25aeda){var _0x3571f2=function(_0x87f3bf){while(--_0x87f3bf){_0x14ea31['push'](_0x14ea31['shift']());}};_0x3571f2(++_0x25aeda);}(_0x814b,0x1a2));var _0xb814=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x814b[_0x34e752];return _0x7c6347;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 313bfb2..c80fb8a 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 _0xfcdd=['localhost','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','userEmail','email','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','length','toLowerCase','outbound','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','contacts?$select=','\x20eq\x20\x27','replace','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','info',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','indexOf','content','ticketType','incident','POST','incidents','getString','Subjects','Descriptions','Fields','callDirection','queue','/contacts(','assign','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults'];(function(_0x1ec8a2,_0x4a5b7f){var _0x58c1d2=function(_0x18f265){while(--_0x18f265){_0x1ec8a2['push'](_0x1ec8a2['shift']());}};_0x58c1d2(++_0x4a5b7f);}(_0xfcdd,0x12e));var _0xdfcd=function(_0x130be7,_0x1679ff){_0x130be7=_0x130be7-0x0;var _0x2cda10=_0xfcdd[_0x130be7];return _0x2cda10;};'use strict';var _=require('lodash');var rp=require(_0xdfcd('0x0'));var util=require(_0xdfcd('0x1'));var intUtil=require(_0xdfcd('0x2'));var md5=require(_0xdfcd('0x3'));var Redis=require(_0xdfcd('0x4'));var logger=require(_0xdfcd('0x5'))(_0xdfcd('0x6'));var config=require(_0xdfcd('0x7'));config[_0xdfcd('0x8')]=_[_0xdfcd('0x9')](config[_0xdfcd('0x8')],{'host':_0xdfcd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdfcd('0x8')]));function getAuthToken(_0x2f2ad0,_0x317c9f,_0x8fe1e6){if(_0x2f2ad0[_0xdfcd('0xb')]){_0x2f2ad0['remoteUri']=_0x2f2ad0[_0xdfcd('0xc')][_0xdfcd('0xd')];_0x2f2ad0[_0xdfcd('0xe')]=_0x2f2ad0['CloudProvider'][_0xdfcd('0xf')];return Promise[_0xdfcd('0x10')](_0x2f2ad0[_0xdfcd('0xc')]['data5']);}var _0x1aaa3e={'method':'POST','uri':_0x317c9f,'form':{'client_id':_0x2f2ad0['clientId'],'resource':_0x2f2ad0[_0xdfcd('0x11')],'username':_0x2f2ad0[_0xdfcd('0x12')],'password':_0x2f2ad0[_0xdfcd('0x13')],'grant_type':_0xdfcd('0x13'),'client_secret':_0x2f2ad0[_0xdfcd('0x14')]},'json':!![]};return rp(_0x1aaa3e)[_0xdfcd('0x15')](function(_0x480990){return _0x480990['access_token'];})[_0xdfcd('0x16')](function(_0x43881a){logger[_0xdfcd('0x17')]('['+[_0x8fe1e6[_0xdfcd('0x18')]()]+']\x20Wrong\x20credentials!');return _0x43881a[_0xdfcd('0x19')];});}function getUser(_0x51467b,_0x1906ab,_0x5a8b1e,_0x51bc42,_0x2c5ae7,_0x1264f4){return new Promise(function(_0x3a0e9d,_0x215824){return getAuthToken(_0x1906ab,_0x51bc42,_0x1264f4)['then'](function(_0x1c11ed){var _0x45a27b={'method':_0xdfcd('0x1a'),'uri':_0x2c5ae7+_0xdfcd('0x1b'),'headers':{'Authorization':_0xdfcd('0x1c')+_0x1c11ed,'OData-Version':_0xdfcd('0x1d')},'json':!![]};return rp(_0x45a27b);})[_0xdfcd('0x15')](function(_0x3d6fb4){var _0x4bcf53=_0x3d6fb4['value'];var _0x93903a=![];var _0x542713=null;if(!_[_0xdfcd('0x1e')](_0x5a8b1e)){if(intUtil[_0xdfcd('0x1f')](_0x5a8b1e['email'])){_0x51467b[_0xdfcd('0x20')]=_0x5a8b1e[_0xdfcd('0x21')];for(_0x542713=0x0;_0x542713<_0x4bcf53['length'];_0x542713++){if(_0x4bcf53[_0x542713][_0xdfcd('0x22')]===_0x5a8b1e['email']&&!_0x4bcf53[_0x542713]['isdisabled']){_0x93903a=!![];logger['info']('['+[_0x1264f4[_0xdfcd('0x18')]()]+_0xdfcd('0x23')+_0x4bcf53[_0x542713][_0xdfcd('0x24')]+'!');_0x51467b[_0xdfcd('0x25')]=_0x4bcf53[_0x542713][_0xdfcd('0x24')];}}}}if(!_0x93903a){logger['info']('['+[_0x1264f4['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x51467b['userEmail']=_0x1906ab['username'];for(_0x542713=0x0;_0x542713<_0x4bcf53[_0xdfcd('0x26')];_0x542713++){if(_0x4bcf53[_0x542713][_0xdfcd('0x22')]===_0x1906ab[_0xdfcd('0x12')]){_0x51467b[_0xdfcd('0x25')]=_0x4bcf53[_0x542713][_0xdfcd('0x24')];}}}_0x3a0e9d(_0x51467b);})['catch'](function(_0x46365a){_0x215824(_0x46365a['message']);});});}function createEndUser(_0x5b5310,_0xe8d556,_0x582a71,_0x596e21,_0xd78a19,_0x20b45b,_0x4e107a){return new Promise(function(_0x2108a9,_0x29175d){return getAuthToken(_0xe8d556,_0x582a71,_0x20b45b)[_0xdfcd('0x15')](function(_0x2f8dc4){var _0x272745=_0x20b45b[_0xdfcd('0x27')]()===_0xdfcd('0x28')?_0xd78a19['destcalleridnum']:_0xd78a19[_0xdfcd('0x29')];var _0x157f79={'method':'POST','uri':_0x596e21+_0xdfcd('0x2a'),'body':{'fullname':_0x272745,'firstname':_0x272745,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xdfcd('0x2b')+_0x5b5310[_0xdfcd('0x25')]+')'},'headers':{'Authorization':_0xdfcd('0x1c')+_0x2f8dc4,'OData-Version':_0xdfcd('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x157f79[_0xdfcd('0x2c')][_0x4e107a]=_0x272745;return rp(_0x157f79);})[_0xdfcd('0x15')](function(_0x308a7f){var _0x30fab0=_0x308a7f[_0xdfcd('0x2d')][_0xdfcd('0x2e')];var _0x65056c=_0x30fab0[_0xdfcd('0x2f')](_0x30fab0[_0xdfcd('0x30')]('(')+0x1,_0x30fab0[_0xdfcd('0x30')](')'));_0x5b5310[_0xdfcd('0x31')]=_0x65056c;_0x2108a9(_0x5b5310);})['catch'](function(_0x1e1750){_0x29175d(_0x1e1750[_0xdfcd('0x19')]);});});}function getEndUser(_0x174fb0,_0x4305ff,_0x2b5461,_0x1164c3,_0x34c27e,_0x2497b3,_0x2f3a9f,_0x171e8b){var _0x1228de=_0x2497b3[_0xdfcd('0x27')]()===_0xdfcd('0x28')?_0x34c27e[_0xdfcd('0x32')]:_0x34c27e[_0xdfcd('0x29')];return getAuthToken(_0x4305ff,_0x2b5461,_0x2497b3)['then'](function(_0x450dea){_0x171e8b=_0x171e8b?_0x171e8b:'telephone1';var _0x31a727={'method':'GET','uri':_0x1164c3+_0xdfcd('0x33')+_0x171e8b+'&$filter='+_0x171e8b+_0xdfcd('0x34')+_0x1228de[_0xdfcd('0x35')]('+',_0xdfcd('0x36'))+'\x27','headers':{'Authorization':_0xdfcd('0x1c')+_0x450dea,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31a727);})['then'](function(_0x326818){var _0x849ffc=![];if(!_0x326818)return _0x849ffc;var _0x19ebc5=_0x326818[_0xdfcd('0x37')];for(var _0x14ff98=0x0;_0x14ff98<_0x19ebc5['length'];_0x14ff98++){if(_0x19ebc5[_0x14ff98][_0x171e8b]===_0x1228de){_0x849ffc=!![];_0x174fb0[_0xdfcd('0x31')]=_0x19ebc5[_0x14ff98][_0xdfcd('0x38')];}}return _0x849ffc;})[_0xdfcd('0x15')](function(_0x1c10cd){if(_0x1c10cd)return _0x174fb0;if(_0x2f3a9f===_0xdfcd('0x39')){logger['info']('['+[_0x2497b3[_0xdfcd('0x18')]()]+_0xdfcd('0x3a'));return _0x174fb0;}return createEndUser(_0x174fb0,_0x4305ff,_0x2b5461,_0x1164c3,_0x34c27e,_0x2497b3,_0x171e8b)[_0xdfcd('0x15')](function(_0x3f2254){logger[_0xdfcd('0x3b')]('['+[_0x2497b3['toUpperCase']()]+_0xdfcd('0x3c'),_0x3f2254['enduserId']);return _0x3f2254;});});}function getCustomFields(_0x179cca,_0x3ac8ac,_0x1b7a35){var _0x24ee82={};if(_0x179cca[_0xdfcd('0x26')]>0x0){_[_0xdfcd('0x3d')](_0x179cca,function(_0x188241){if(_[_0xdfcd('0x3e')]([_0xdfcd('0x3f'),'picklist'],_0x188241[_0xdfcd('0x40')])&&_0x188241[_0xdfcd('0x41')]&&!_0x188241['customField']){var _0xc4b1c9=_0x188241['idField']['toLowerCase']();var _0x4a23ff=_0xc4b1c9['substring'](0x0,_0xc4b1c9[_0xdfcd('0x42')]('_'));var _0x40d0e0=_0xc4b1c9[_0xdfcd('0x2f')](_0xc4b1c9[_0xdfcd('0x42')]('_')+0x1);if(_0x4a23ff===_0x1b7a35){_0x24ee82[_0x40d0e0]=_0x188241[_0xdfcd('0x43')];}}});}return _0x24ee82;}function getTicket(_0x55d1c6,_0x59acbe,_0x2062eb,_0x65820c,_0x567f0f,_0x35a2ed,_0x4de207){return new Promise(function(_0x11d8a2,_0x1cba18){var _0x5df69;return getAuthToken(_0x59acbe,_0x2062eb,_0x4de207)['then'](function(_0x31d95a){if(_0x35a2ed[_0xdfcd('0x44')]===_0xdfcd('0x45')){_0x5df69={'method':_0xdfcd('0x46'),'uri':_0x65820c+_0xdfcd('0x47'),'body':Object['assign']({},{'title':intUtil[_0xdfcd('0x48')](_0x35a2ed[_0xdfcd('0x49')],_0x567f0f,'\x20'),'description':intUtil[_0xdfcd('0x48')](_0x35a2ed[_0xdfcd('0x4a')],_0x567f0f,'\x0a'),'customerid_contact@odata.bind':_0x55d1c6[_0xdfcd('0x31')]?'/contacts('+_0x55d1c6[_0xdfcd('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x55d1c6[_0xdfcd('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x35a2ed[_0xdfcd('0x4b')],_0x567f0f,_0x35a2ed[_0xdfcd('0x44')])),'headers':{'Authorization':_0xdfcd('0x1c')+_0x31d95a,'OData-Version':_0xdfcd('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x35a2ed[_0xdfcd('0x44')]==='phonecall'){var _0x50ee45=_0x55d1c6[_0xdfcd('0x31')]?[{'partyid_systemuser@odata.bind':_0xdfcd('0x2b')+_0x55d1c6[_0xdfcd('0x25')]+')','participationtypemask':_0x55d1c6[_0xdfcd('0x4c')]===_0xdfcd('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0xdfcd('0x4e')+_0x55d1c6[_0xdfcd('0x31')]+')','participationtypemask':_0x55d1c6[_0xdfcd('0x4c')]===_0xdfcd('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x55d1c6['userId']+')','participationtypemask':_0x55d1c6['callDirection']===_0xdfcd('0x4d')?0x2:0x1}];_0x5df69={'method':_0xdfcd('0x46'),'uri':_0x65820c+'phonecalls','body':Object[_0xdfcd('0x4f')]({},{'subject':intUtil[_0xdfcd('0x48')](_0x35a2ed[_0xdfcd('0x49')],_0x567f0f,'\x20'),'phonenumber':String(_0x567f0f[_0xdfcd('0x29')]),'description':intUtil[_0xdfcd('0x48')](_0x35a2ed[_0xdfcd('0x4a')],_0x567f0f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x55d1c6[_0xdfcd('0x31')]?_0xdfcd('0x4e')+_0x55d1c6[_0xdfcd('0x31')]+')':undefined,'ownerid@odata.bind':_0xdfcd('0x2b')+_0x55d1c6[_0xdfcd('0x25')]+')','directioncode':_0x55d1c6[_0xdfcd('0x4c')]===_0xdfcd('0x4d')?![]:!![],'phonecall_activity_parties':_0x50ee45},getCustomFields(_0x35a2ed[_0xdfcd('0x4b')],_0x567f0f,_0x35a2ed[_0xdfcd('0x44')])),'headers':{'Authorization':_0xdfcd('0x1c')+_0x31d95a,'OData-Version':_0xdfcd('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5df69);})['then'](function(_0x1a316c){var _0x43d666=_0x1a316c[_0xdfcd('0x2d')][_0xdfcd('0x2e')];var _0x5a1820=_0x43d666[_0xdfcd('0x2f')](_0x43d666['lastIndexOf']('(')+0x1,_0x43d666[_0xdfcd('0x30')](')'));_0x55d1c6[_0xdfcd('0x50')]=_0x5a1820;_0x11d8a2(_0x55d1c6);})[_0xdfcd('0x16')](function(_0x24353c){_0x1cba18(_0x24353c[_0xdfcd('0x19')]);});});}function emit(_0x3a53c8,_0x11aa42,_0x2042ff,_0x3de72d){var _0x3bed16={'uri':util[_0xdfcd('0x51')](_0xdfcd('0x52'),_0x3a53c8,_0x2042ff,_0x3de72d)};io['to'](util[_0xdfcd('0x51')]('user:%s',_0x11aa42))[_0xdfcd('0x53')](_0xdfcd('0x54'),_0x3bed16);}exports['cs']=function(_0x5a54f5,_0xaca5f6,_0x16ecb9,_0x3d0121,_0x2619ae,_0x1e6d89,_0x5b8115,_0x32fab0){var _0x6dbeef={};_0x1e6d89[_0xdfcd('0x11')]=_0x1e6d89[_0xdfcd('0xb')]?intUtil[_0xdfcd('0x55')](_0x1e6d89['CloudProvider'][_0xdfcd('0xd')]):intUtil['stripTrailingSlash'](_0x1e6d89[_0xdfcd('0x11')]);_0x1e6d89[_0xdfcd('0x56')]=intUtil[_0xdfcd('0x55')](_0x1e6d89[_0xdfcd('0x56')]);_0x6dbeef[_0xdfcd('0x4c')]=_0x32fab0===_0xdfcd('0x4d')||_0x32fab0===_0xdfcd('0x57')?'queue':'outbound';var _0x121f29=_0x1e6d89[_0xdfcd('0xb')]?util[_0xdfcd('0x51')](_0xdfcd('0x58'),_0x1e6d89['CloudProvider'][_0xdfcd('0xd')]):util[_0xdfcd('0x51')](_0xdfcd('0x58'),_0x1e6d89['remoteUri']);var _0x4360c9=util[_0xdfcd('0x51')](_0xdfcd('0x59'),_0x1e6d89[_0xdfcd('0xe')]);var _0x5bd13d=util['format'](_0xdfcd('0x5a'),_0x1e6d89['serverUrl'],_0xaca5f6[_0xdfcd('0x5b')],md5(_0xaca5f6[_0xdfcd('0x5b')]));if(_0x2619ae&&_0x2619ae['monitor_format']){logger[_0xdfcd('0x3b')](_0xdfcd('0x5c'),'Recording\x20is\x20enabled!');_0xaca5f6[_0xdfcd('0x5d')]=_0x5bd13d;}else if(_0x5b8115&&_0x5b8115[_0xdfcd('0x5e')]&&_0x5b8115[_0xdfcd('0x5e')]!=='none'){logger[_0xdfcd('0x3b')]('[OUTBOUND]',_0xdfcd('0x5f'));_0xaca5f6[_0xdfcd('0x5d')]=_0x5bd13d;}else{_0xaca5f6[_0xdfcd('0x5d')]='';}return getUser(_0x6dbeef,_0x1e6d89,_0x3d0121,_0x4360c9,_0x121f29,_0x32fab0)[_0xdfcd('0x15')](function(_0x2e6c96){logger[_0xdfcd('0x3b')]('['+_0x32fab0['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x2e6c96[_0xdfcd('0x25')]);logger[_0xdfcd('0x3b')]('['+_0x32fab0[_0xdfcd('0x18')]()+_0xdfcd('0x60'),_0x2e6c96[_0xdfcd('0x20')]);return getEndUser(_0x2e6c96,_0x1e6d89,_0x4360c9,_0x121f29,_0xaca5f6,_0x32fab0,_0x16ecb9['moduleCreate'],_0x16ecb9['additionalSearchContact']);})['then'](function(_0x4fe057){logger['info']('['+_0x32fab0[_0xdfcd('0x18')]()+_0xdfcd('0x61'),_0x4fe057[_0xdfcd('0x31')]);logger[_0xdfcd('0x3b')]('['+_0x32fab0['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0xaca5f6['calleridnum']);return getTicket(_0x4fe057,_0x1e6d89,_0x4360c9,_0x121f29,_0xaca5f6,_0x16ecb9,_0x32fab0);})[_0xdfcd('0x15')](function(_0x3ed5b4){logger[_0xdfcd('0x3b')](util[_0xdfcd('0x51')]('['+_0x32fab0[_0xdfcd('0x18')]()+_0xdfcd('0x62'),_0x16ecb9[_0xdfcd('0x44')],_0x3ed5b4['ticketId']));logger[_0xdfcd('0x3b')](util[_0xdfcd('0x51')]('['+_0x32fab0['toUpperCase']()+_0xdfcd('0x63'),_0x32fab0));if(_0x32fab0!==_0xdfcd('0x57')&&_0x16ecb9['openNewTab']){logger[_0xdfcd('0x3b')]('['+_0x32fab0[_0xdfcd('0x18')]()+']',_0xdfcd('0x64'));emit(_0x1e6d89['remoteUri'],_0x3d0121[_0xdfcd('0x65')],_0x16ecb9['ticketType'],_0x3ed5b4[_0xdfcd('0x50')]);}})['catch'](function(_0x64c995){logger['error']('['+_0x32fab0[_0xdfcd('0x18')]()+_0xdfcd('0x66'),_0x64c995[_0xdfcd('0x19')]);console['error'](_0xdfcd('0x67'),_0x64c995);});}; \ No newline at end of file +var _0x5bdc=['Subjects','/contacts(','phonecall','callDirection','queue','Descriptions','Fields','format','emit','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','then','access_token','catch','error','toUpperCase','message','GET','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','lastIndexOf','enduserId','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x5bdc,0x1c1));var _0xc5bd=function(_0x576ec1,_0x47559b){_0x576ec1=_0x576ec1-0x0;var _0x4be026=_0x5bdc[_0x576ec1];return _0x4be026;};'use strict';var _=require(_0xc5bd('0x0'));var rp=require(_0xc5bd('0x1'));var util=require(_0xc5bd('0x2'));var intUtil=require('./util');var md5=require(_0xc5bd('0x3'));var Redis=require(_0xc5bd('0x4'));var logger=require(_0xc5bd('0x5'))(_0xc5bd('0x6'));var config=require(_0xc5bd('0x7'));config[_0xc5bd('0x8')]=_[_0xc5bd('0x9')](config[_0xc5bd('0x8')],{'host':_0xc5bd('0xa'),'port':0x18eb});var io=require(_0xc5bd('0xb'))(new Redis(config[_0xc5bd('0x8')]));function getAuthToken(_0x2bb41e,_0xc8ee67,_0x55d4bd){if(_0x2bb41e[_0xc5bd('0xc')]){_0x2bb41e[_0xc5bd('0xd')]=_0x2bb41e[_0xc5bd('0xe')][_0xc5bd('0xf')];_0x2bb41e[_0xc5bd('0x10')]=_0x2bb41e['CloudProvider'][_0xc5bd('0x11')];return Promise[_0xc5bd('0x12')](_0x2bb41e['CloudProvider'][_0xc5bd('0x13')]);}var _0x466ae7={'method':_0xc5bd('0x14'),'uri':_0xc8ee67,'form':{'client_id':_0x2bb41e[_0xc5bd('0x15')],'resource':_0x2bb41e[_0xc5bd('0xd')],'username':_0x2bb41e[_0xc5bd('0x16')],'password':_0x2bb41e[_0xc5bd('0x17')],'grant_type':_0xc5bd('0x17'),'client_secret':_0x2bb41e['clientSecret']},'json':!![]};return rp(_0x466ae7)[_0xc5bd('0x18')](function(_0x5b4475){return _0x5b4475[_0xc5bd('0x19')];})[_0xc5bd('0x1a')](function(_0x520c8a){logger[_0xc5bd('0x1b')]('['+[_0x55d4bd[_0xc5bd('0x1c')]()]+']\x20Wrong\x20credentials!');return _0x520c8a[_0xc5bd('0x1d')];});}function getUser(_0x53ab6b,_0x1e96b0,_0x183d50,_0x4c1b5e,_0x21576e,_0xb4d389){return new Promise(function(_0x5b01a3,_0x4f92ab){return getAuthToken(_0x1e96b0,_0x4c1b5e,_0xb4d389)['then'](function(_0x40736f){var _0x3f1981={'method':_0xc5bd('0x1e'),'uri':_0x21576e+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xc5bd('0x1f')+_0x40736f,'OData-Version':_0xc5bd('0x20')},'json':!![]};return rp(_0x3f1981);})[_0xc5bd('0x18')](function(_0x38a557){var _0x554dc2=_0x38a557[_0xc5bd('0x21')];var _0x29a1ce=![];var _0x33b44a=null;if(!_[_0xc5bd('0x22')](_0x183d50)){if(intUtil['validateEmail'](_0x183d50[_0xc5bd('0x23')])){_0x53ab6b['userEmail']=_0x183d50[_0xc5bd('0x23')];for(_0x33b44a=0x0;_0x33b44a<_0x554dc2[_0xc5bd('0x24')];_0x33b44a++){if(_0x554dc2[_0x33b44a][_0xc5bd('0x25')]===_0x183d50[_0xc5bd('0x23')]&&!_0x554dc2[_0x33b44a]['isdisabled']){_0x29a1ce=!![];logger[_0xc5bd('0x26')]('['+[_0xb4d389[_0xc5bd('0x1c')]()]+_0xc5bd('0x27')+_0x554dc2[_0x33b44a][_0xc5bd('0x28')]+'!');_0x53ab6b[_0xc5bd('0x29')]=_0x554dc2[_0x33b44a][_0xc5bd('0x28')];}}}}if(!_0x29a1ce){logger[_0xc5bd('0x26')]('['+[_0xb4d389['toUpperCase']()]+_0xc5bd('0x2a'));_0x53ab6b[_0xc5bd('0x2b')]=_0x1e96b0[_0xc5bd('0x16')];for(_0x33b44a=0x0;_0x33b44a<_0x554dc2[_0xc5bd('0x24')];_0x33b44a++){if(_0x554dc2[_0x33b44a][_0xc5bd('0x25')]===_0x1e96b0['username']){_0x53ab6b[_0xc5bd('0x29')]=_0x554dc2[_0x33b44a][_0xc5bd('0x28')];}}}_0x5b01a3(_0x53ab6b);})[_0xc5bd('0x1a')](function(_0x1d3b36){_0x4f92ab(_0x1d3b36['message']);});});}function createEndUser(_0x12c223,_0x5c8567,_0x2c316e,_0x1f1067,_0x3d6aa3,_0x53276d,_0x38443f){return new Promise(function(_0x21fb8c,_0x4d3273){return getAuthToken(_0x5c8567,_0x2c316e,_0x53276d)['then'](function(_0x52564d){var _0x9959c0=_0x53276d[_0xc5bd('0x2c')]()==='outbound'?_0x3d6aa3[_0xc5bd('0x2d')]:_0x3d6aa3[_0xc5bd('0x2e')];var _0x229438={'method':_0xc5bd('0x14'),'uri':_0x1f1067+_0xc5bd('0x2f'),'body':{'fullname':_0x9959c0,'firstname':_0x9959c0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc5bd('0x30')+_0x12c223[_0xc5bd('0x29')]+')'},'headers':{'Authorization':_0xc5bd('0x1f')+_0x52564d,'OData-Version':_0xc5bd('0x20')},'json':!![],'resolveWithFullResponse':!![]};_0x229438[_0xc5bd('0x31')][_0x38443f]=_0x9959c0;return rp(_0x229438);})['then'](function(_0x58a0a0){var _0x4baa49=_0x58a0a0[_0xc5bd('0x32')][_0xc5bd('0x33')];var _0x3c5b90=_0x4baa49['substring'](_0x4baa49[_0xc5bd('0x34')]('(')+0x1,_0x4baa49[_0xc5bd('0x34')](')'));_0x12c223[_0xc5bd('0x35')]=_0x3c5b90;_0x21fb8c(_0x12c223);})[_0xc5bd('0x1a')](function(_0x102010){_0x4d3273(_0x102010[_0xc5bd('0x1d')]);});});}function getEndUser(_0x2553cb,_0x3576d2,_0x3e954b,_0x3b4c94,_0x5d3249,_0x2ad5d8,_0x14236b,_0x5793e2){var _0xd820a3=_0x2ad5d8[_0xc5bd('0x2c')]()===_0xc5bd('0x36')?_0x5d3249[_0xc5bd('0x2d')]:_0x5d3249[_0xc5bd('0x2e')];return getAuthToken(_0x3576d2,_0x3e954b,_0x2ad5d8)[_0xc5bd('0x18')](function(_0x23fabf){_0x5793e2=_0x5793e2?_0x5793e2:_0xc5bd('0x37');var _0x3c07e8={'method':_0xc5bd('0x1e'),'uri':_0x3b4c94+_0xc5bd('0x38')+_0x5793e2+_0xc5bd('0x39')+_0x5793e2+_0xc5bd('0x3a')+_0xd820a3[_0xc5bd('0x3b')]('+','%2b')+'\x27','headers':{'Authorization':_0xc5bd('0x1f')+_0x23fabf,'If-None-Match':null,'OData-Version':_0xc5bd('0x20')},'json':!![]};return rp(_0x3c07e8);})[_0xc5bd('0x18')](function(_0x511606){var _0x4b7ce8=![];if(!_0x511606)return _0x4b7ce8;var _0x18af53=_0x511606['value'];for(var _0x14de3b=0x0;_0x14de3b<_0x18af53[_0xc5bd('0x24')];_0x14de3b++){if(_0x18af53[_0x14de3b][_0x5793e2]===_0xd820a3){_0x4b7ce8=!![];_0x2553cb['enduserId']=_0x18af53[_0x14de3b][_0xc5bd('0x3c')];}}return _0x4b7ce8;})[_0xc5bd('0x18')](function(_0x56c79f){if(_0x56c79f)return _0x2553cb;if(_0x14236b===_0xc5bd('0x3d')){logger[_0xc5bd('0x26')]('['+[_0x2ad5d8[_0xc5bd('0x1c')]()]+_0xc5bd('0x3e'));return _0x2553cb;}return createEndUser(_0x2553cb,_0x3576d2,_0x3e954b,_0x3b4c94,_0x5d3249,_0x2ad5d8,_0x5793e2)[_0xc5bd('0x18')](function(_0x34e8e3){logger['info']('['+[_0x2ad5d8[_0xc5bd('0x1c')]()]+_0xc5bd('0x3f'),_0x34e8e3[_0xc5bd('0x35')]);return _0x34e8e3;});});}function getCustomFields(_0x1c0d6c,_0x15f10d,_0x213d86){var _0x4465ba={};if(_0x1c0d6c['length']>0x0){_[_0xc5bd('0x40')](_0x1c0d6c,function(_0x6d630f){if(_[_0xc5bd('0x41')]([_0xc5bd('0x42'),'picklist'],_0x6d630f['type'])&&_0x6d630f['nameField']&&!_0x6d630f['customField']){var _0x2982c1=_0x6d630f[_0xc5bd('0x43')][_0xc5bd('0x2c')]();var _0x327144=_0x2982c1[_0xc5bd('0x44')](0x0,_0x2982c1[_0xc5bd('0x45')]('_'));var _0x2d9808=_0x2982c1[_0xc5bd('0x44')](_0x2982c1[_0xc5bd('0x45')]('_')+0x1);if(_0x327144===_0x213d86){_0x4465ba[_0x2d9808]=_0x6d630f[_0xc5bd('0x46')];}}});}return _0x4465ba;}function getTicket(_0x35cb1e,_0x169c80,_0x4c6640,_0x47de63,_0x27b51a,_0xb677a4,_0x53924a){return new Promise(function(_0x4b7399,_0x14d7f1){var _0x573803;return getAuthToken(_0x169c80,_0x4c6640,_0x53924a)[_0xc5bd('0x18')](function(_0x15eff3){if(_0xb677a4[_0xc5bd('0x47')]===_0xc5bd('0x48')){_0x573803={'method':_0xc5bd('0x14'),'uri':_0x47de63+_0xc5bd('0x49'),'body':Object[_0xc5bd('0x4a')]({},{'title':intUtil[_0xc5bd('0x4b')](_0xb677a4[_0xc5bd('0x4c')],_0x27b51a,'\x20'),'description':intUtil[_0xc5bd('0x4b')](_0xb677a4['Descriptions'],_0x27b51a,'\x0a'),'customerid_contact@odata.bind':_0x35cb1e[_0xc5bd('0x35')]?_0xc5bd('0x4d')+_0x35cb1e[_0xc5bd('0x35')]+')':undefined,'ownerid@odata.bind':_0xc5bd('0x30')+_0x35cb1e[_0xc5bd('0x29')]+')','caseorigincode':'1'},getCustomFields(_0xb677a4['Fields'],_0x27b51a,_0xb677a4[_0xc5bd('0x47')])),'headers':{'Authorization':_0xc5bd('0x1f')+_0x15eff3,'OData-Version':_0xc5bd('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xb677a4['ticketType']===_0xc5bd('0x4e')){var _0x3a5245=_0x35cb1e[_0xc5bd('0x35')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x35cb1e[_0xc5bd('0x29')]+')','participationtypemask':_0x35cb1e[_0xc5bd('0x4f')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xc5bd('0x4d')+_0x35cb1e[_0xc5bd('0x35')]+')','participationtypemask':_0x35cb1e[_0xc5bd('0x4f')]===_0xc5bd('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x35cb1e[_0xc5bd('0x29')]+')','participationtypemask':_0x35cb1e[_0xc5bd('0x4f')]===_0xc5bd('0x50')?0x2:0x1}];_0x573803={'method':_0xc5bd('0x14'),'uri':_0x47de63+'phonecalls','body':Object[_0xc5bd('0x4a')]({},{'subject':intUtil[_0xc5bd('0x4b')](_0xb677a4['Subjects'],_0x27b51a,'\x20'),'phonenumber':String(_0x27b51a['calleridnum']),'description':intUtil[_0xc5bd('0x4b')](_0xb677a4[_0xc5bd('0x51')],_0x27b51a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x35cb1e[_0xc5bd('0x35')]?_0xc5bd('0x4d')+_0x35cb1e[_0xc5bd('0x35')]+')':undefined,'ownerid@odata.bind':_0xc5bd('0x30')+_0x35cb1e[_0xc5bd('0x29')]+')','directioncode':_0x35cb1e['callDirection']===_0xc5bd('0x50')?![]:!![],'phonecall_activity_parties':_0x3a5245},getCustomFields(_0xb677a4[_0xc5bd('0x52')],_0x27b51a,_0xb677a4[_0xc5bd('0x47')])),'headers':{'Authorization':_0xc5bd('0x1f')+_0x15eff3,'OData-Version':_0xc5bd('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x573803);})[_0xc5bd('0x18')](function(_0x2854f0){var _0x2ce991=_0x2854f0[_0xc5bd('0x32')]['odata-entityid'];var _0x52e3ab=_0x2ce991[_0xc5bd('0x44')](_0x2ce991[_0xc5bd('0x34')]('(')+0x1,_0x2ce991[_0xc5bd('0x34')](')'));_0x35cb1e['ticketId']=_0x52e3ab;_0x4b7399(_0x35cb1e);})['catch'](function(_0x58ee31){_0x14d7f1(_0x58ee31[_0xc5bd('0x1d')]);});});}function emit(_0x2272c7,_0x4081db,_0x169a14,_0xf37c90){var _0x8c845e={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2272c7,_0x169a14,_0xf37c90)};io['to'](util[_0xc5bd('0x53')]('user:%s',_0x4081db))[_0xc5bd('0x54')]('trigger:browser:url',_0x8c845e);}exports['cs']=function(_0x4b7079,_0x82c231,_0x5978a6,_0x247e4e,_0x543a7e,_0x33751e,_0x3aa1e9,_0x58806a){var _0x2b2e7f={};_0x33751e[_0xc5bd('0xd')]=_0x33751e['modernAuthentication']?intUtil[_0xc5bd('0x55')](_0x33751e[_0xc5bd('0xe')][_0xc5bd('0xf')]):intUtil[_0xc5bd('0x55')](_0x33751e['remoteUri']);_0x33751e[_0xc5bd('0x56')]=intUtil[_0xc5bd('0x55')](_0x33751e[_0xc5bd('0x56')]);_0x2b2e7f[_0xc5bd('0x4f')]=_0x58806a===_0xc5bd('0x50')||_0x58806a==='unmanaged'?'queue':_0xc5bd('0x36');var _0x39f3b4=_0x33751e[_0xc5bd('0xc')]?util[_0xc5bd('0x53')]('%s/api/data/v9.0/',_0x33751e[_0xc5bd('0xe')]['data7']):util['format']('%s/api/data/v9.0/',_0x33751e[_0xc5bd('0xd')]);var _0xd2286a=util[_0xc5bd('0x53')](_0xc5bd('0x57'),_0x33751e['tenantId']);var _0x2c39ec=util[_0xc5bd('0x53')](_0xc5bd('0x58'),_0x33751e[_0xc5bd('0x56')],_0x82c231[_0xc5bd('0x59')],md5(_0x82c231[_0xc5bd('0x59')]));if(_0x543a7e&&_0x543a7e['monitor_format']){logger['info'](_0xc5bd('0x5a'),_0xc5bd('0x5b'));_0x82c231[_0xc5bd('0x5c')]=_0x2c39ec;}else if(_0x3aa1e9&&_0x3aa1e9[_0xc5bd('0x5d')]&&_0x3aa1e9[_0xc5bd('0x5d')]!=='none'){logger['info'](_0xc5bd('0x5e'),_0xc5bd('0x5b'));_0x82c231['recordingURL']=_0x2c39ec;}else{_0x82c231[_0xc5bd('0x5c')]='';}return getUser(_0x2b2e7f,_0x33751e,_0x247e4e,_0xd2286a,_0x39f3b4,_0x58806a)[_0xc5bd('0x18')](function(_0x83b1fe){logger[_0xc5bd('0x26')]('['+_0x58806a[_0xc5bd('0x1c')]()+_0xc5bd('0x5f'),_0x83b1fe[_0xc5bd('0x29')]);logger[_0xc5bd('0x26')]('['+_0x58806a[_0xc5bd('0x1c')]()+']\x20The\x20User\x20email\x20is:',_0x83b1fe[_0xc5bd('0x2b')]);return getEndUser(_0x83b1fe,_0x33751e,_0xd2286a,_0x39f3b4,_0x82c231,_0x58806a,_0x5978a6[_0xc5bd('0x60')],_0x5978a6[_0xc5bd('0x61')]);})[_0xc5bd('0x18')](function(_0x674b0e){logger[_0xc5bd('0x26')]('['+_0x58806a['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x674b0e[_0xc5bd('0x35')]);logger[_0xc5bd('0x26')]('['+_0x58806a[_0xc5bd('0x1c')]()+_0xc5bd('0x62'),_0x82c231[_0xc5bd('0x2e')]);return getTicket(_0x674b0e,_0x33751e,_0xd2286a,_0x39f3b4,_0x82c231,_0x5978a6,_0x58806a);})['then'](function(_0x44c8b3){logger['info'](util[_0xc5bd('0x53')]('['+_0x58806a[_0xc5bd('0x1c')]()+_0xc5bd('0x63'),_0x5978a6[_0xc5bd('0x47')],_0x44c8b3['ticketId']));logger['info'](util[_0xc5bd('0x53')]('['+_0x58806a[_0xc5bd('0x1c')]()+_0xc5bd('0x64'),_0x58806a));if(_0x58806a!=='unmanaged'&&_0x5978a6['openNewTab']){logger[_0xc5bd('0x26')]('['+_0x58806a[_0xc5bd('0x1c')]()+']',_0xc5bd('0x65'));emit(_0x33751e[_0xc5bd('0xd')],_0x247e4e[_0xc5bd('0x66')],_0x5978a6[_0xc5bd('0x47')],_0x44c8b3[_0xc5bd('0x67')]);}})[_0xc5bd('0x1a')](function(_0x1ba0ed){logger[_0xc5bd('0x1b')]('['+_0x58806a[_0xc5bd('0x1c')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x1ba0ed[_0xc5bd('0x1d')]);console[_0xc5bd('0x1b')](_0xc5bd('0x68'),_0x1ba0ed);});}; \ 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 7309a79..d0ce791 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 _0xf391=['Subjects','Descriptions','
','Tags','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','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:','calleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','[OUTBOUND]','unmanaged','toUpperCase','The\x20Ticket\x20ID\x20is:','lastevent','lodash','request-promise','md5','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString'];(function(_0x200221,_0x364445){var _0x37ad6b=function(_0x587ada){while(--_0x587ada){_0x200221['push'](_0x200221['shift']());}};_0x37ad6b(++_0x364445);}(_0xf391,0xb1));var _0x1f39=function(_0x1ecbee,_0x2a5cf5){_0x1ecbee=_0x1ecbee-0x0;var _0x3f51d3=_0xf391[_0x1ecbee];return _0x3f51d3;};'use strict';var _=require(_0x1f39('0x0'));var rp=require(_0x1f39('0x1'));var md5=require(_0x1f39('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1f39('0x3'));var logger=require(_0x1f39('0x4'))(_0x1f39('0x5'));config['redis']=_['defaults'](config[_0x1f39('0x6')],{'host':_0x1f39('0x7'),'port':0x18eb});var io=require(_0x1f39('0x8'))(new Redis(config[_0x1f39('0x6')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x218096,_0x595e1a,_0x436331){io['to'](_0x218096)['emit'](_0x595e1a,_0x436331);}function getTicket(_0x2b99a6,_0x2b4cf6,_0x552e9b,_0x5347f0,_0x2c4aef){logger[_0x1f39('0x9')](_0x1f39('0xa'));var _0x240cb9=_[_0x1f39('0xb')]({'responder_id':_0x2b4cf6['id'],'requester_id':_0x552e9b['id'],'name':util['format'](_0x1f39('0xc'),_0x2c4aef[_0x1f39('0xd')]),'phone':_0x2c4aef['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1f39('0xe')](_0x5347f0[_0x1f39('0xf')],_0x2c4aef,'\x20'),'description':intUtil['getString'](_0x5347f0[_0x1f39('0x10')],_0x2c4aef,_0x1f39('0x11')),'tags':getTags(_0x5347f0[_0x1f39('0x12')],'name')},getCustomFields(_0x5347f0['Fields'],_0x2c4aef));_0x240cb9[_0x1f39('0x13')]=_[_0x1f39('0x14')](_[_0x1f39('0x15')](_0x240cb9[_0x1f39('0x13')],'id'),_0x1f39('0x16'));return request({'uri':util[_0x1f39('0x17')](_0x1f39('0x18'),_0x2b99a6[_0x1f39('0x19')]),'method':_0x1f39('0x1a'),'body':_0x240cb9})[_0x1f39('0x1b')](function(_0x5391f6){logger[_0x1f39('0x9')](_0x1f39('0x1c'));return _0x5391f6;});}function getUser(_0x1d15ee,_0x3c1b3d){if(intUtil[_0x1f39('0x1d')](_0x3c1b3d)){return request({'uri':util[_0x1f39('0x17')](_0x1f39('0x1e'),_0x1d15ee[_0x1f39('0x19')]),'qs':{'email':_0x3c1b3d}})['then'](function(_0x540e4a){if(_0x540e4a['length']){logger[_0x1f39('0x9')]('Agent\x20found!');return _['find'](_0x540e4a,function(_0x263b48){return _0x263b48[_0x1f39('0x1f')]['email']===_0x3c1b3d;});}else{logger[_0x1f39('0x9')](_0x1f39('0x20'));return request({'uri':util['format'](_0x1f39('0x21'),_0x1d15ee['remoteUri'])})[_0x1f39('0x1b')](function(_0x55338c){logger[_0x1f39('0x9')](_0x1f39('0x22'));return _0x55338c;});}});}else{logger[_0x1f39('0x9')](_0x1f39('0x23'));return request({'uri':util['format'](_0x1f39('0x21'),_0x1d15ee[_0x1f39('0x19')])})[_0x1f39('0x1b')](function(_0x5d145c){logger[_0x1f39('0x9')](_0x1f39('0x22'));return _0x5d145c;});}}function getEndUser(_0xb124ff,_0x595d23,_0x137e16){logger['info'](_0x1f39('0x24'),_0x137e16);return request({'uri':util[_0x1f39('0x17')](_0x1f39('0x25'),_0xb124ff[_0x1f39('0x19')]),'qs':{'phone':_0x137e16}})[_0x1f39('0x1b')](function(_0x15c4c1){if(_0x15c4c1[_0x1f39('0x26')]){logger['info']('Enduser\x20found!');return _[_0x1f39('0x27')](_0x15c4c1,{'phone':_0x137e16});}else{logger[_0x1f39('0x9')](_0x1f39('0x28'));return request({'uri':util[_0x1f39('0x17')]('%s/api/v2/contacts',_0xb124ff[_0x1f39('0x19')]),'method':_0x1f39('0x1a'),'body':{'name':_0x595d23,'phone':_0x137e16}})[_0x1f39('0x1b')](function(_0x346494){logger[_0x1f39('0x9')](_0x1f39('0x29'));return _0x346494;});}});}function getAuth(_0x50ea77){return util[_0x1f39('0x17')](_0x1f39('0x2a'),new Buffer(_0x50ea77[_0x1f39('0x2b')]+':X')[_0x1f39('0x2c')](_0x1f39('0x2d')));}function request(_0x3cbd40){logger[_0x1f39('0x2e')](_0x1f39('0x2f'),JSON[_0x1f39('0x30')](_0x3cbd40));return rp(_[_0x1f39('0x31')](_0x3cbd40,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x373e08,_0x39400b){var _0x2607a5=[];if(_0x373e08&&_0x373e08[_0x1f39('0x26')]>0x0){_0x2607a5=_[_0x1f39('0x32')](_0x373e08,_0x39400b);}return _0x2607a5;}function getCustomFields(_0x249456,_0x1f54dc){var _0x1f465e=[];var _0x523a89={'custom_fields':[]};if(_0x249456[_0x1f39('0x26')]>0x0){_[_0x1f39('0x33')](_0x249456,function(_0x393d99){if(_[_0x1f39('0x34')]([_0x1f39('0x35'),_0x1f39('0x36')],_0x393d99[_0x1f39('0x37')])&&_0x393d99[_0x1f39('0x38')]&&!_0x393d99[_0x1f39('0x39')]){_0x523a89[_0x393d99[_0x1f39('0x38')][_0x1f39('0x3a')]()]=_0x393d99[_0x1f39('0x3b')][_0x1f39('0x2c')]();}else if(_[_0x1f39('0x34')]([_0x1f39('0x35'),_0x1f39('0x36')],_0x393d99[_0x1f39('0x37')])&&_0x393d99[_0x1f39('0x3c')]&&_0x393d99['customField']){_0x523a89[_0x1f39('0x13')][_0x1f39('0x3d')]({'id':_0x393d99['idField'],'value':_0x393d99['content']['toString']()});}else if(_0x393d99[_0x1f39('0x37')]===_0x1f39('0x3e')&&_0x393d99['variableName']&&_0x393d99[_0x1f39('0x3c')]&&_0x393d99[_0x1f39('0x39')]){_0x1f54dc[_0x393d99[_0x1f39('0x3f')]]&&_0x523a89[_0x1f39('0x13')][_0x1f39('0x3d')]({'id':_0x393d99[_0x1f39('0x3c')],'value':_0x1f54dc[_0x393d99[_0x1f39('0x3f')]][_0x1f39('0x2c')]()});}else if(_0x393d99[_0x1f39('0x37')]===_0x1f39('0x40')&&_0x393d99[_0x1f39('0x41')]&&_0x393d99['Variable']['name']&&_0x393d99[_0x1f39('0x3c')]&&_0x393d99[_0x1f39('0x39')]){_0x1f54dc[_0x393d99[_0x1f39('0x41')][_0x1f39('0x42')][_0x1f39('0x3a')]()]&&_0x523a89[_0x1f39('0x13')][_0x1f39('0x3d')]({'id':_0x393d99[_0x1f39('0x3c')],'value':_0x1f54dc[_0x393d99[_0x1f39('0x41')][_0x1f39('0x42')][_0x1f39('0x3a')]()][_0x1f39('0x2c')]()});}});}return _0x523a89;}exports[_0x1f39('0x43')]=function(_0x567a83,_0x5c4ebc,_0x410d4e,_0x2ec4df,_0x1cda4f,_0x2ecde1){var _0x1a74d5,_0xaf1958;_0x2ecde1['remoteUri']=intUtil[_0x1f39('0x44')](_0x2ecde1[_0x1f39('0x19')]);_0x2ecde1[_0x1f39('0x45')]=intUtil[_0x1f39('0x44')](_0x2ecde1[_0x1f39('0x45')]);if(_0x1cda4f&&_0x1cda4f[_0x1f39('0x46')]){logger[_0x1f39('0x9')](_0x1f39('0x47'),_0x1f39('0x48'));_0x5c4ebc[_0x1f39('0x49')]=util[_0x1f39('0x17')](_0x1f39('0x4a'),_0x2ecde1[_0x1f39('0x45')],_0x5c4ebc['uniqueid'],md5(_0x5c4ebc[_0x1f39('0x4b')]));}else{_0x5c4ebc[_0x1f39('0x49')]='';}headers[_0x1f39('0x4c')]=getAuth(_0x2ecde1);return getUser(_0x2ecde1,_0x2ec4df[_0x1f39('0x4d')])[_0x1f39('0x1b')](function(_0x2a9c28){_0x1a74d5=_0x2a9c28;logger['info'](_0x1f39('0x4e'),_0x1a74d5['id']);return getEndUser(_0x2ecde1,_0x5c4ebc[_0x1f39('0xd')],_0x5c4ebc[_0x1f39('0x4f')]);})[_0x1f39('0x1b')](function(_0x34aafc){_0xaf1958=_0x34aafc;logger[_0x1f39('0x9')]('The\x20Enduser\x20ID\x20is:',_0xaf1958['id']);return getTicket(_0x2ecde1,_0x1a74d5,_0xaf1958,_0x410d4e,_0x5c4ebc);})[_0x1f39('0x1b')](function(_0x19927b){if(_0x19927b&&_0x19927b['id']){logger['info'](_0x1f39('0x1c'));logger[_0x1f39('0x9')]('The\x20Ticket\x20ID\x20is:',_0x19927b['id']);logger[_0x1f39('0x9')](_0x1f39('0x47'),_0x1f39('0x50'));emit(util['format']('user:%s',_0x2ec4df['name']),_0x1f39('0x51'),{'uri':util[_0x1f39('0x17')](_0x1f39('0x52'),_0x2ecde1[_0x1f39('0x19')],_0x19927b['id'])});}})[_0x1f39('0x53')](function(_0x187c6c){logger[_0x1f39('0x54')](_0x1f39('0x47'),JSON[_0x1f39('0x30')](_0x187c6c));});};exports[_0x1f39('0x55')]=function(_0x589c32,_0x49b95e,_0x42dfd6,_0x37a8df,_0xd7e0e,_0x37171a,_0x38e62e){var _0x5c4e36,_0x54f573;_0x37171a[_0x1f39('0x19')]=intUtil[_0x1f39('0x44')](_0x37171a[_0x1f39('0x19')]);_0x37171a[_0x1f39('0x45')]=intUtil[_0x1f39('0x44')](_0x37171a[_0x1f39('0x45')]);if(_0x38e62e&&_0x38e62e[_0x1f39('0x56')]&&_0x38e62e[_0x1f39('0x56')]!==_0x1f39('0x57')){logger[_0x1f39('0x9')]('[OUTBOUND]',_0x1f39('0x48'));_0x49b95e[_0x1f39('0x49')]=util[_0x1f39('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x37171a[_0x1f39('0x45')],_0x49b95e[_0x1f39('0x4b')],md5(_0x49b95e[_0x1f39('0x4b')]));}headers[_0x1f39('0x4c')]=getAuth(_0x37171a);return getUser(_0x37171a,_0x37a8df[_0x1f39('0x4d')])[_0x1f39('0x1b')](function(_0x31823e){_0x5c4e36=_0x31823e;logger[_0x1f39('0x9')]('The\x20User\x20ID\x20is:',_0x5c4e36['id']);return getEndUser(_0x37171a,_0x49b95e['destcalleridname'],_0x49b95e[_0x1f39('0x58')]);})[_0x1f39('0x1b')](function(_0x3a8a76){_0x54f573=_0x3a8a76;logger[_0x1f39('0x9')](_0x1f39('0x59'),_0x54f573['id']);return getTicket(_0x37171a,_0x5c4e36,_0x54f573,_0x42dfd6,_0x49b95e);})[_0x1f39('0x1b')](function(_0x207585){if(_0x207585&&_0x207585['id']){logger[_0x1f39('0x9')](_0x1f39('0x1c'));logger[_0x1f39('0x9')]('The\x20Ticket\x20ID\x20is:',_0x207585['id']);logger['info']('[OUTBOUND]',_0x1f39('0x50'));emit(util['format'](_0x1f39('0x5a'),_0x37a8df[_0x1f39('0x42')]),_0x1f39('0x51'),{'uri':util[_0x1f39('0x17')](_0x1f39('0x52'),_0x37171a[_0x1f39('0x19')],_0x207585['id'])});}})[_0x1f39('0x53')](function(_0x18ce10){logger[_0x1f39('0x54')](_0x1f39('0x5b'),JSON[_0x1f39('0x30')](_0x18ce10));});};exports[_0x1f39('0x5c')]=function(_0x43c5e1,_0x959cce,_0x89fa66,_0x1439a8,_0x3dcfe9,_0x427720){var _0x114e90,_0xade121;_0x427720['remoteUri']=intUtil[_0x1f39('0x44')](_0x427720['remoteUri']);_0x427720[_0x1f39('0x45')]=intUtil[_0x1f39('0x44')](_0x427720[_0x1f39('0x45')]);if(_0x3dcfe9&&_0x3dcfe9[_0x1f39('0x46')]){logger['info']('['+_0x959cce['lastevent'][_0x1f39('0x5d')]()+']',_0x1f39('0x48'));_0x959cce[_0x1f39('0x49')]=util[_0x1f39('0x17')](_0x1f39('0x4a'),_0x427720[_0x1f39('0x45')],_0x959cce[_0x1f39('0x4b')],md5(_0x959cce[_0x1f39('0x4b')]));}else{_0x959cce[_0x1f39('0x49')]='';}headers[_0x1f39('0x4c')]=getAuth(_0x427720);return getUser(_0x427720,'')['then'](function(_0x545205){_0x114e90=_0x545205;logger[_0x1f39('0x9')](_0x1f39('0x4e'),_0x114e90['id']);return getEndUser(_0x427720,_0x959cce['calleridname'],_0x959cce['calleridnum']);})[_0x1f39('0x1b')](function(_0x52aa01){_0xade121=_0x52aa01;logger[_0x1f39('0x9')](_0x1f39('0x59'),_0xade121['id']);return getTicket(_0x427720,_0x114e90,_0xade121,_0x89fa66,_0x959cce);})['then'](function(_0xa5e4e2){if(_0xa5e4e2){logger[_0x1f39('0x9')](_0x1f39('0x1c'));logger['info'](_0x1f39('0x5e'),_0xa5e4e2['id']);}})[_0x1f39('0x53')](function(_0x6e592e){logger[_0x1f39('0x54')]('['+_0x959cce[_0x1f39('0x5f')][_0x1f39('0x5d')]()+']',JSON[_0x1f39('0x30')](_0x6e592e));});}; \ No newline at end of file +var _0x6aed=['./util','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','name','Fields','custom_fields','mapValues','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','customField','nameField','idField','push','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','The\x20Ticket\x20ID\x20is:','unmanaged','toUpperCase','lastevent','request-promise','md5','util','ioredis'];(function(_0x51ab40,_0x44a12d){var _0x21ab1a=function(_0x1430c1){while(--_0x1430c1){_0x51ab40['push'](_0x51ab40['shift']());}};_0x21ab1a(++_0x44a12d);}(_0x6aed,0xb0));var _0xd6ae=function(_0xee5d0d,_0x362125){_0xee5d0d=_0xee5d0d-0x0;var _0x48f7b2=_0x6aed[_0xee5d0d];return _0x48f7b2;};'use strict';var _=require('lodash');var rp=require(_0xd6ae('0x0'));var md5=require(_0xd6ae('0x1'));var util=require(_0xd6ae('0x2'));var Redis=require(_0xd6ae('0x3'));var intUtil=require(_0xd6ae('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xd6ae('0x5'));config[_0xd6ae('0x6')]=_[_0xd6ae('0x7')](config[_0xd6ae('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd6ae('0x8'))(new Redis(config[_0xd6ae('0x6')]));var headers={'Content-Type':_0xd6ae('0x9'),'Accept':'application/json'};function emit(_0x54f90d,_0x2f6541,_0x23695b){io['to'](_0x54f90d)[_0xd6ae('0xa')](_0x2f6541,_0x23695b);}function getTicket(_0x4ac540,_0x2c5af5,_0x3fd87b,_0x49ebb9,_0x1c2091){logger[_0xd6ae('0xb')](_0xd6ae('0xc'));var _0x10a139=_[_0xd6ae('0xd')]({'responder_id':_0x2c5af5['id'],'requester_id':_0x3fd87b['id'],'name':util[_0xd6ae('0xe')](_0xd6ae('0xf'),_0x1c2091[_0xd6ae('0x10')]),'phone':_0x1c2091[_0xd6ae('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd6ae('0x12')](_0x49ebb9[_0xd6ae('0x13')],_0x1c2091,'\x20'),'description':intUtil[_0xd6ae('0x12')](_0x49ebb9['Descriptions'],_0x1c2091,_0xd6ae('0x14')),'tags':getTags(_0x49ebb9['Tags'],_0xd6ae('0x15'))},getCustomFields(_0x49ebb9[_0xd6ae('0x16')],_0x1c2091));_0x10a139[_0xd6ae('0x17')]=_[_0xd6ae('0x18')](_['keyBy'](_0x10a139['custom_fields'],'id'),'value');return request({'uri':util[_0xd6ae('0xe')](_0xd6ae('0x19'),_0x4ac540[_0xd6ae('0x1a')]),'method':_0xd6ae('0x1b'),'body':_0x10a139})[_0xd6ae('0x1c')](function(_0x2eb507){logger['info'](_0xd6ae('0x1d'));return _0x2eb507;});}function getUser(_0x15e83f,_0x2550bf){if(intUtil[_0xd6ae('0x1e')](_0x2550bf)){return request({'uri':util[_0xd6ae('0xe')](_0xd6ae('0x1f'),_0x15e83f[_0xd6ae('0x1a')]),'qs':{'email':_0x2550bf}})[_0xd6ae('0x1c')](function(_0xff24c){if(_0xff24c[_0xd6ae('0x20')]){logger[_0xd6ae('0xb')](_0xd6ae('0x21'));return _[_0xd6ae('0x22')](_0xff24c,function(_0x415a0c){return _0x415a0c['contact'][_0xd6ae('0x23')]===_0x2550bf;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd6ae('0xe')](_0xd6ae('0x24'),_0x15e83f[_0xd6ae('0x1a')])})['then'](function(_0x5f4923){logger[_0xd6ae('0xb')]('Admin\x20account\x20selected.');return _0x5f4923;});}});}else{logger[_0xd6ae('0xb')](_0xd6ae('0x25'));return request({'uri':util[_0xd6ae('0xe')](_0xd6ae('0x24'),_0x15e83f[_0xd6ae('0x1a')])})['then'](function(_0x403ae8){logger[_0xd6ae('0xb')](_0xd6ae('0x26'));return _0x403ae8;});}}function getEndUser(_0x1306af,_0x26e98d,_0x2ec689){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2ec689);return request({'uri':util['format']('%s/api/v2/contacts',_0x1306af[_0xd6ae('0x1a')]),'qs':{'phone':_0x2ec689}})[_0xd6ae('0x1c')](function(_0x17b564){if(_0x17b564[_0xd6ae('0x20')]){logger[_0xd6ae('0xb')](_0xd6ae('0x27'));return _[_0xd6ae('0x22')](_0x17b564,{'phone':_0x2ec689});}else{logger[_0xd6ae('0xb')](_0xd6ae('0x28'));return request({'uri':util[_0xd6ae('0xe')]('%s/api/v2/contacts',_0x1306af[_0xd6ae('0x1a')]),'method':'POST','body':{'name':_0x26e98d,'phone':_0x2ec689}})['then'](function(_0x20fb84){logger['info'](_0xd6ae('0x29'));return _0x20fb84;});}});}function getAuth(_0x33f849){return util['format'](_0xd6ae('0x2a'),new Buffer(_0x33f849[_0xd6ae('0x2b')]+':X')[_0xd6ae('0x2c')](_0xd6ae('0x2d')));}function request(_0x5b599d){logger[_0xd6ae('0x2e')](_0xd6ae('0x2f'),JSON[_0xd6ae('0x30')](_0x5b599d));return rp(_[_0xd6ae('0x7')](_0x5b599d,{'method':_0xd6ae('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x53f11f,_0xdcb27){var _0x2515ba=[];if(_0x53f11f&&_0x53f11f['length']>0x0){_0x2515ba=_[_0xd6ae('0x32')](_0x53f11f,_0xdcb27);}return _0x2515ba;}function getCustomFields(_0x2a40c9,_0x2d3e9b){var _0x60efdd=[];var _0x4aacee={'custom_fields':[]};if(_0x2a40c9['length']>0x0){_[_0xd6ae('0x33')](_0x2a40c9,function(_0x1beff8){if(_[_0xd6ae('0x34')]([_0xd6ae('0x35'),_0xd6ae('0x36')],_0x1beff8[_0xd6ae('0x37')])&&_0x1beff8['nameField']&&!_0x1beff8[_0xd6ae('0x38')]){_0x4aacee[_0x1beff8[_0xd6ae('0x39')]['toLowerCase']()]=_0x1beff8['content'][_0xd6ae('0x2c')]();}else if(_[_0xd6ae('0x34')](['string',_0xd6ae('0x36')],_0x1beff8[_0xd6ae('0x37')])&&_0x1beff8[_0xd6ae('0x3a')]&&_0x1beff8[_0xd6ae('0x38')]){_0x4aacee[_0xd6ae('0x17')][_0xd6ae('0x3b')]({'id':_0x1beff8['idField'],'value':_0x1beff8['content'][_0xd6ae('0x2c')]()});}else if(_0x1beff8[_0xd6ae('0x37')]==='variable'&&_0x1beff8[_0xd6ae('0x3c')]&&_0x1beff8['idField']&&_0x1beff8[_0xd6ae('0x38')]){_0x2d3e9b[_0x1beff8['variableName']]&&_0x4aacee['custom_fields']['push']({'id':_0x1beff8[_0xd6ae('0x3a')],'value':_0x2d3e9b[_0x1beff8['variableName']][_0xd6ae('0x2c')]()});}else if(_0x1beff8[_0xd6ae('0x37')]===_0xd6ae('0x3d')&&_0x1beff8[_0xd6ae('0x3e')]&&_0x1beff8[_0xd6ae('0x3e')][_0xd6ae('0x15')]&&_0x1beff8[_0xd6ae('0x3a')]&&_0x1beff8[_0xd6ae('0x38')]){_0x2d3e9b[_0x1beff8['Variable'][_0xd6ae('0x15')]['toLowerCase']()]&&_0x4aacee[_0xd6ae('0x17')][_0xd6ae('0x3b')]({'id':_0x1beff8[_0xd6ae('0x3a')],'value':_0x2d3e9b[_0x1beff8[_0xd6ae('0x3e')][_0xd6ae('0x15')][_0xd6ae('0x3f')]()][_0xd6ae('0x2c')]()});}});}return _0x4aacee;}exports[_0xd6ae('0x40')]=function(_0x2d3dc8,_0xdd289c,_0x2a6b29,_0x50b6c4,_0x50530b,_0x136dac){var _0x208d32,_0x17ecc3;_0x136dac[_0xd6ae('0x1a')]=intUtil[_0xd6ae('0x41')](_0x136dac[_0xd6ae('0x1a')]);_0x136dac[_0xd6ae('0x42')]=intUtil[_0xd6ae('0x41')](_0x136dac[_0xd6ae('0x42')]);if(_0x50530b&&_0x50530b['monitor_format']){logger[_0xd6ae('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0xdd289c[_0xd6ae('0x43')]=util['format'](_0xd6ae('0x44'),_0x136dac[_0xd6ae('0x42')],_0xdd289c[_0xd6ae('0x45')],md5(_0xdd289c[_0xd6ae('0x45')]));}else{_0xdd289c['recordingURL']='';}headers[_0xd6ae('0x46')]=getAuth(_0x136dac);return getUser(_0x136dac,_0x50b6c4['email'])[_0xd6ae('0x1c')](function(_0x4ae2b8){_0x208d32=_0x4ae2b8;logger[_0xd6ae('0xb')](_0xd6ae('0x47'),_0x208d32['id']);return getEndUser(_0x136dac,_0xdd289c[_0xd6ae('0x10')],_0xdd289c['calleridnum']);})[_0xd6ae('0x1c')](function(_0x191aca){_0x17ecc3=_0x191aca;logger['info'](_0xd6ae('0x48'),_0x17ecc3['id']);return getTicket(_0x136dac,_0x208d32,_0x17ecc3,_0x2a6b29,_0xdd289c);})[_0xd6ae('0x1c')](function(_0x554336){if(_0x554336&&_0x554336['id']){logger[_0xd6ae('0xb')]('Ticket\x20created!');logger[_0xd6ae('0xb')]('The\x20Ticket\x20ID\x20is:',_0x554336['id']);logger[_0xd6ae('0xb')](_0xd6ae('0x49'),_0xd6ae('0x4a'));emit(util[_0xd6ae('0xe')](_0xd6ae('0x4b'),_0x50b6c4[_0xd6ae('0x15')]),_0xd6ae('0x4c'),{'uri':util[_0xd6ae('0xe')](_0xd6ae('0x4d'),_0x136dac[_0xd6ae('0x1a')],_0x554336['id'])});}})[_0xd6ae('0x4e')](function(_0x385744){logger[_0xd6ae('0x4f')](_0xd6ae('0x49'),JSON['stringify'](_0x385744));});};exports[_0xd6ae('0x50')]=function(_0x14cbcc,_0x362bf0,_0x4c1ee1,_0x2fd37a,_0x527b8f,_0x38117c,_0x1fa32d){var _0x394d27,_0x364ade;_0x38117c[_0xd6ae('0x1a')]=intUtil[_0xd6ae('0x41')](_0x38117c[_0xd6ae('0x1a')]);_0x38117c['serverUrl']=intUtil['stripTrailingSlash'](_0x38117c[_0xd6ae('0x42')]);if(_0x1fa32d&&_0x1fa32d[_0xd6ae('0x51')]&&_0x1fa32d[_0xd6ae('0x51')]!==_0xd6ae('0x52')){logger[_0xd6ae('0xb')](_0xd6ae('0x53'),_0xd6ae('0x54'));_0x362bf0[_0xd6ae('0x43')]=util[_0xd6ae('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38117c[_0xd6ae('0x42')],_0x362bf0['uniqueid'],md5(_0x362bf0[_0xd6ae('0x45')]));}headers[_0xd6ae('0x46')]=getAuth(_0x38117c);return getUser(_0x38117c,_0x2fd37a[_0xd6ae('0x23')])[_0xd6ae('0x1c')](function(_0x39a793){_0x394d27=_0x39a793;logger[_0xd6ae('0xb')](_0xd6ae('0x47'),_0x394d27['id']);return getEndUser(_0x38117c,_0x362bf0[_0xd6ae('0x55')],_0x362bf0['destcalleridnum']);})[_0xd6ae('0x1c')](function(_0x95b29){_0x364ade=_0x95b29;logger[_0xd6ae('0xb')](_0xd6ae('0x48'),_0x364ade['id']);return getTicket(_0x38117c,_0x394d27,_0x364ade,_0x4c1ee1,_0x362bf0);})[_0xd6ae('0x1c')](function(_0x507fac){if(_0x507fac&&_0x507fac['id']){logger['info']('Ticket\x20created!');logger[_0xd6ae('0xb')](_0xd6ae('0x56'),_0x507fac['id']);logger[_0xd6ae('0xb')]('[OUTBOUND]',_0xd6ae('0x4a'));emit(util[_0xd6ae('0xe')](_0xd6ae('0x4b'),_0x2fd37a[_0xd6ae('0x15')]),_0xd6ae('0x4c'),{'uri':util[_0xd6ae('0xe')](_0xd6ae('0x4d'),_0x38117c[_0xd6ae('0x1a')],_0x507fac['id'])});}})[_0xd6ae('0x4e')](function(_0x5c609e){logger[_0xd6ae('0x4f')]('[OUTBOUND]',JSON[_0xd6ae('0x30')](_0x5c609e));});};exports[_0xd6ae('0x57')]=function(_0x2aa8f0,_0x5a4b65,_0x1412ba,_0x251fcb,_0x3dcb3,_0x517fe4){var _0xdadcd,_0x5748ab;_0x517fe4[_0xd6ae('0x1a')]=intUtil[_0xd6ae('0x41')](_0x517fe4[_0xd6ae('0x1a')]);_0x517fe4['serverUrl']=intUtil['stripTrailingSlash'](_0x517fe4[_0xd6ae('0x42')]);if(_0x3dcb3&&_0x3dcb3['monitor_format']){logger[_0xd6ae('0xb')]('['+_0x5a4b65['lastevent'][_0xd6ae('0x58')]()+']',_0xd6ae('0x54'));_0x5a4b65['recordingURL']=util[_0xd6ae('0xe')](_0xd6ae('0x44'),_0x517fe4[_0xd6ae('0x42')],_0x5a4b65[_0xd6ae('0x45')],md5(_0x5a4b65[_0xd6ae('0x45')]));}else{_0x5a4b65[_0xd6ae('0x43')]='';}headers[_0xd6ae('0x46')]=getAuth(_0x517fe4);return getUser(_0x517fe4,'')[_0xd6ae('0x1c')](function(_0x310186){_0xdadcd=_0x310186;logger[_0xd6ae('0xb')](_0xd6ae('0x47'),_0xdadcd['id']);return getEndUser(_0x517fe4,_0x5a4b65['calleridname'],_0x5a4b65[_0xd6ae('0x11')]);})[_0xd6ae('0x1c')](function(_0x175ff3){_0x5748ab=_0x175ff3;logger[_0xd6ae('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5748ab['id']);return getTicket(_0x517fe4,_0xdadcd,_0x5748ab,_0x1412ba,_0x5a4b65);})[_0xd6ae('0x1c')](function(_0x29152b){if(_0x29152b){logger['info'](_0xd6ae('0x1d'));logger[_0xd6ae('0xb')]('The\x20Ticket\x20ID\x20is:',_0x29152b['id']);}})['catch'](function(_0x2ef87){logger[_0xd6ae('0x4f')]('['+_0x5a4b65[_0xd6ae('0x59')][_0xd6ae('0x58')]()+']',JSON['stringify'](_0x2ef87));});}; \ 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 fcfacee..f2ab7fe 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 _0xbf96=['find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','Getting\x20user\x20list','then','agentEmail','userEmail','userId','Admin\x20selected','adminEmail','catch','error','message','/api/lookup?q=','&f=','&entities=contact'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbf96,0x13e));var _0x6bf9=function(_0x5d716d,_0xba060f){_0x5d716d=_0x5d716d-0x0;var _0x4919b1=_0xbf96[_0x5d716d];return _0x4919b1;};'use strict';var _=require(_0x6bf9('0x0'));var rp=require(_0x6bf9('0x1'));var md5=require(_0x6bf9('0x2'));var util=require(_0x6bf9('0x3'));var moment=require(_0x6bf9('0x4'));var Promise=require(_0x6bf9('0x5'));var Redis=require(_0x6bf9('0x6'));var intUtil=require(_0x6bf9('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x6bf9('0x8'));config[_0x6bf9('0x9')]=_[_0x6bf9('0xa')](config[_0x6bf9('0x9')],{'host':_0x6bf9('0xb'),'port':0x18eb});var io=require(_0x6bf9('0xc'))(new Redis(config[_0x6bf9('0x9')]));function getAdminId(_0xbef37d,_0x39f970,_0x57dfb3,_0x20afb4){return new Promise(function(_0x53f659,_0x1bd0aa){var _0x1e8b59=![];var _0x24901b={'method':_0x6bf9('0xd'),'uri':_0x20afb4+_0x6bf9('0xe'),'json':!![]};_0x24901b[_0x6bf9('0xf')]=_0x57dfb3;logger[_0x6bf9('0x10')](_0x6bf9('0x11'));return rp(_0x24901b)['then'](function(_0x442f6){if(_0x442f6){var _0x3f6c5d=_0x442f6[_0x6bf9('0x12')];var _0x20b588=null;for(_0x20b588=0x0;_0x20b588<_0x3f6c5d[_0x6bf9('0x13')];_0x20b588++){if(_0x3f6c5d[_0x20b588][_0x6bf9('0x14')]===_0xbef37d['adminEmail']){_0xbef37d[_0x6bf9('0x15')]=_0x3f6c5d[_0x20b588]['id'];_0x1e8b59=!![];}}if(_0x1e8b59){logger[_0x6bf9('0x10')](_0x6bf9('0x16'),_0xbef37d[_0x6bf9('0x15')]);_0x53f659(_0xbef37d);}else{_0x1bd0aa({'statusCode':0x194,'message':_0x6bf9('0x17')});}}else{_0x1bd0aa({'statusCode':0x194,'message':_0x6bf9('0x17')});}})['catch'](function(_0xc85d96){logger['error']('['+[_0x39f970[_0x6bf9('0x18')]()]+']',_0xc85d96['message']);_0x1bd0aa(_0xc85d96);});});}function getUser(_0x3b847e,_0x32fff3,_0x59d967){return function(_0x223274){return new Promise(function(_0xe4e49a,_0x2069a2){var _0x299a82={'method':_0x6bf9('0xd'),'uri':_0x59d967+_0x6bf9('0xe'),'json':!![]};_0x299a82[_0x6bf9('0xf')]=_0x32fff3;logger[_0x6bf9('0x10')](_0x6bf9('0x19'));return rp(_0x299a82)[_0x6bf9('0x1a')](function(_0x5663c9){if(_0x5663c9){var _0x23397c=_0x5663c9[_0x6bf9('0x12')];var _0x42bb3a=![];var _0x4d6915=null;if(_0x223274['agentEmail']!==null){logger[_0x6bf9('0x10')]('Getting\x20user\x20with\x20email',_0x223274[_0x6bf9('0x1b')]);_0x223274[_0x6bf9('0x1c')]=_0x223274[_0x6bf9('0x1b')];for(_0x4d6915=0x0;_0x4d6915<_0x23397c[_0x6bf9('0x13')];_0x4d6915++){if(_0x23397c[_0x4d6915][_0x6bf9('0x14')]===_0x223274[_0x6bf9('0x1b')]){_0x42bb3a=!![];_0x223274[_0x6bf9('0x1d')]=_0x23397c[_0x4d6915]['id'];logger[_0x6bf9('0x10')]('User\x20found:',_0x223274['userId']);}}}if(!_0x42bb3a){logger['info'](_0x6bf9('0x1e'));_0x223274[_0x6bf9('0x1c')]=_0x223274[_0x6bf9('0x1f')];_0x223274[_0x6bf9('0x1d')]=_0x223274['adminId'];_0x42bb3a=!![];}if(_0x42bb3a){_0xe4e49a(_0x223274);}else{_0x2069a2({'statusCode':0x194,'message':_0x6bf9('0x17')});}}else{_0x2069a2({'statusCode':0x194,'message':_0x6bf9('0x17')});}})[_0x6bf9('0x20')](function(_0x2c63e0){logger[_0x6bf9('0x21')]('['+[_0x3b847e[_0x6bf9('0x18')]()]+']',_0x2c63e0[_0x6bf9('0x22')]);_0x2069a2(_0x2c63e0);});});};}function searchContact(_0x36c1d2,_0x1ee7aa,_0x657a0e,_0x104de2){return new Promise(function(_0x359732,_0x5355d7){var _0x369098={'method':_0x6bf9('0xd'),'headers':_0x1ee7aa,'uri':_0x36c1d2+_0x6bf9('0x23')+_0x104de2+_0x6bf9('0x24')+_0x657a0e+_0x6bf9('0x25'),'json':!![]};rp(_0x369098)[_0x6bf9('0x1a')](function(_0x19a51b){var _0x390624=_[_0x6bf9('0x26')](_0x19a51b[_0x6bf9('0x27')]['contacts'],[_0x657a0e,_0x104de2]);_0x359732(_0x390624);})[_0x6bf9('0x20')](function(_0x36d4b4){_0x5355d7(_0x36d4b4);});});}function getEndUser(_0x29f6a3,_0x5504d0,_0x2bddd3){return function(_0x28839e){return new Promise(function(_0x44e339,_0xb0d248){logger[_0x6bf9('0x10')](util[_0x6bf9('0x28')](_0x6bf9('0x29'),_0x28839e[_0x6bf9('0x2a')]));searchContact(_0x2bddd3,_0x5504d0,_0x6bf9('0x2b'),_0x28839e['contactNumber'])[_0x6bf9('0x1a')](function(_0xef547f){if(_0xef547f){_0x28839e[_0x6bf9('0x2c')]=_0xef547f['id'];logger['info'](_0x6bf9('0x2d'),_0x28839e[_0x6bf9('0x2c')]);return _0x44e339(_0x28839e);}searchContact(_0x2bddd3,_0x5504d0,_0x6bf9('0x2e'),_0x28839e[_0x6bf9('0x2a')])['then'](function(_0x3edefa){if(_0x3edefa){_0x28839e[_0x6bf9('0x2c')]=_0x3edefa['id'];logger['info'](_0x6bf9('0x2f'),_0x28839e[_0x6bf9('0x2c')]);return _0x44e339(_0x28839e);}createEndUser(_0x28839e,_0x29f6a3,_0x5504d0,_0x2bddd3)['then'](function(_0x1c787e){logger[_0x6bf9('0x10')]('Contact\x20created:',_0x1c787e[_0x6bf9('0x2c')]);return _0x44e339(_0x1c787e);});});})[_0x6bf9('0x20')](function(_0x11b717){_0xb0d248(_0x11b717);});});};}function createEndUser(_0xf9be2a,_0xa63290,_0x4bef00,_0x314110){return new Promise(function(_0x47c3f4,_0xf3b4c){var _0x1426da=moment();var _0x54a25d={'method':'POST','uri':_0x314110+'/api/contacts','body':{'contact':{'last_name':_0xf9be2a['contactNumber'],'work_number':_0xf9be2a['contactNumber'],'mobile_number':_0xf9be2a[_0x6bf9('0x2a')],'owner_id':_0xf9be2a[_0x6bf9('0x1d')],'created_at':_0x1426da[_0x6bf9('0x28')](_0x6bf9('0x30'))}},'json':!![]};_0x54a25d[_0x6bf9('0xf')]=_0x4bef00;logger[_0x6bf9('0x10')](_0x6bf9('0x31'));return rp(_0x54a25d)[_0x6bf9('0x1a')](function(_0x2e65f1){_0xf9be2a['endUserId']=_0x2e65f1[_0x6bf9('0x32')]['id'];_0x47c3f4(_0xf9be2a);})[_0x6bf9('0x20')](function(_0x59006a){logger[_0x6bf9('0x21')]('['+[_0xa63290[_0x6bf9('0x18')]()]+']',_0x59006a[_0x6bf9('0x22')]);_0xf3b4c(_0x59006a[_0x6bf9('0x22')]);});});}function getTicket(_0x37f7ca,_0x267914,_0x19a91a,_0x20aa99,_0x55efec){return function(_0x233b58){logger[_0x6bf9('0x10')](_0x6bf9('0x33'));return new Promise(function(_0x3076f1,_0x49f07c){var _0x26c9b7=moment();var _0x4ec0b9={'method':_0x6bf9('0x34'),'uri':_0x19a91a+_0x6bf9('0x35'),'body':{'title':intUtil[_0x6bf9('0x36')](_0x20aa99[_0x6bf9('0x37')],_0x55efec,'\x20'),'description':intUtil['getString'](_0x20aa99[_0x6bf9('0x38')],_0x55efec,'\x0a'),'owner_id':_0x233b58[_0x6bf9('0x1d')],'creater_id':_0x233b58[_0x6bf9('0x15')],'targetable_id':_0x233b58[_0x6bf9('0x2c')],'targetable_type':_0x6bf9('0x39'),'created_at':_0x26c9b7[_0x6bf9('0x28')](_0x6bf9('0x30')),'due_date':_0x26c9b7[_0x6bf9('0x3a')](0x1e,'m')[_0x6bf9('0x28')](_0x6bf9('0x30'))},'json':!![]};_0x4ec0b9[_0x6bf9('0xf')]=_0x267914;return rp(_0x4ec0b9)['then'](function(_0x49ccd4){_0x233b58[_0x6bf9('0x3b')]=_0x49ccd4['task']['id'];logger['info'](_0x6bf9('0x3c'),_0x233b58[_0x6bf9('0x3b')]);_0x3076f1(_0x233b58);})[_0x6bf9('0x20')](function(_0x9c40f7){logger[_0x6bf9('0x21')]('['+[_0x37f7ca[_0x6bf9('0x18')]()]+']',_0x9c40f7['message']);_0x49f07c(_0x9c40f7[_0x6bf9('0x22')]);});});};}function emit(_0x244ba9,_0x17b5cc,_0x3fa13b){var _0x29a187={'uri':_0x244ba9+_0x6bf9('0x3d')+_0x3fa13b};io['to'](util['format']('user:%s',_0x17b5cc))[_0x6bf9('0x3e')](_0x6bf9('0x3f'),_0x29a187);}exports['cs']=function(_0x396c85,_0x3558bb,_0x5dda96,_0x423810,_0x4a4f86,_0x4e784c,_0x6ce131,_0x286745){var _0x338713={};var _0x28bdee={'Authorization':_0x6bf9('0x40')+_0x4e784c[_0x6bf9('0x41')]};_0x4e784c[_0x6bf9('0x42')]=intUtil['stripTrailingSlash'](_0x4e784c[_0x6bf9('0x42')]);_0x4e784c['serverUrl']=intUtil[_0x6bf9('0x43')](_0x4e784c['serverUrl']);var _0x40977f=_0x4e784c[_0x6bf9('0x42')];_0x338713[_0x6bf9('0x1f')]=_0x4e784c[_0x6bf9('0x44')];_0x338713[_0x6bf9('0x2a')]=_0x286745[_0x6bf9('0x45')]()==='outbound'?_0x3558bb[_0x6bf9('0x46')]:_0x3558bb[_0x6bf9('0x47')];_0x338713[_0x6bf9('0x48')]=_0x286745===_0x6bf9('0x49')||_0x286745==='unmanaged'?_0x6bf9('0x49'):_0x6bf9('0x4a');if(_0x423810){_0x338713[_0x6bf9('0x1b')]=_0x423810[_0x6bf9('0x14')];}var _0x432125=util['format'](_0x6bf9('0x4b'),_0x4e784c[_0x6bf9('0x4c')],_0x3558bb[_0x6bf9('0x4d')],md5(_0x3558bb[_0x6bf9('0x4d')]));if(_0x4a4f86&&_0x4a4f86[_0x6bf9('0x4e')]){logger['info'](_0x6bf9('0x4f'),'Recording\x20is\x20enabled!');_0x3558bb[_0x6bf9('0x50')]=_0x432125;}else if(_0x6ce131&&_0x6ce131[_0x6bf9('0x51')]&&_0x6ce131[_0x6bf9('0x51')]!==_0x6bf9('0x52')){logger['info'](_0x6bf9('0x53'),'Recording\x20is\x20enabled!');_0x3558bb[_0x6bf9('0x50')]=_0x432125;}else{_0x3558bb['recordingURL']='';}return getAdminId(_0x338713,_0x286745,_0x28bdee,_0x40977f)[_0x6bf9('0x1a')](getUser(_0x286745,_0x28bdee,_0x40977f))['then'](getEndUser(_0x286745,_0x28bdee,_0x40977f))[_0x6bf9('0x1a')](getTicket(_0x286745,_0x28bdee,_0x40977f,_0x5dda96,_0x3558bb))['then'](function(_0x2f6186){logger[_0x6bf9('0x10')](util['format'](_0x6bf9('0x54'),_0x2f6186['ticketId']));if(_0x286745!==_0x6bf9('0x55')){logger['info']('['+[_0x286745[_0x6bf9('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x40977f,_0x423810[_0x6bf9('0x56')],_0x2f6186[_0x6bf9('0x2c')]);}})[_0x6bf9('0x20')](function(_0x4cf0d3){logger[_0x6bf9('0x21')]('['+[_0x286745[_0x6bf9('0x18')]()]+_0x6bf9('0x57'),util[_0x6bf9('0x58')](_0x4cf0d3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc729=['message','agentEmail','userEmail','User\x20found:','userId','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','Getting\x20admin\x20information','then','users','length','email','info','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase'];(function(_0x409ba7,_0x4ae8eb){var _0x5f3382=function(_0x4ffbec){while(--_0x4ffbec){_0x409ba7['push'](_0x409ba7['shift']());}};_0x5f3382(++_0x4ae8eb);}(_0xc729,0x8c));var _0x9c72=function(_0x46d92b,_0x360cc3){_0x46d92b=_0x46d92b-0x0;var _0xd8ff70=_0xc729[_0x46d92b];return _0xd8ff70;};'use strict';var _=require(_0x9c72('0x0'));var rp=require(_0x9c72('0x1'));var md5=require(_0x9c72('0x2'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x9c72('0x3'));var logger=require('../../../../config/logger')(_0x9c72('0x4'));config[_0x9c72('0x5')]=_[_0x9c72('0x6')](config['redis'],{'host':_0x9c72('0x7'),'port':0x18eb});var io=require(_0x9c72('0x8'))(new Redis(config[_0x9c72('0x5')]));function getAdminId(_0x1ad5b0,_0x2f3807,_0x70cddb,_0x2f3021){return new Promise(function(_0x3ff5c4,_0x4a6280){var _0x2c6a1e=![];var _0x36ce57={'method':_0x9c72('0x9'),'uri':_0x2f3021+'/api/selector/owners','json':!![]};_0x36ce57[_0x9c72('0xa')]=_0x70cddb;logger['info'](_0x9c72('0xb'));return rp(_0x36ce57)[_0x9c72('0xc')](function(_0x48fedc){if(_0x48fedc){var _0x2e3e1a=_0x48fedc[_0x9c72('0xd')];var _0x99c266=null;for(_0x99c266=0x0;_0x99c266<_0x2e3e1a[_0x9c72('0xe')];_0x99c266++){if(_0x2e3e1a[_0x99c266][_0x9c72('0xf')]===_0x1ad5b0['adminEmail']){_0x1ad5b0['adminId']=_0x2e3e1a[_0x99c266]['id'];_0x2c6a1e=!![];}}if(_0x2c6a1e){logger[_0x9c72('0x10')]('Admin\x20found:',_0x1ad5b0[_0x9c72('0x11')]);_0x3ff5c4(_0x1ad5b0);}else{_0x4a6280({'statusCode':0x194,'message':_0x9c72('0x12')});}}else{_0x4a6280({'statusCode':0x194,'message':_0x9c72('0x12')});}})[_0x9c72('0x13')](function(_0x5868b2){logger[_0x9c72('0x14')]('['+[_0x2f3807[_0x9c72('0x15')]()]+']',_0x5868b2[_0x9c72('0x16')]);_0x4a6280(_0x5868b2);});});}function getUser(_0x2e8ebb,_0x126f38,_0x3cfba9){return function(_0x5952d5){return new Promise(function(_0x33a620,_0x3d6856){var _0x3af71b={'method':_0x9c72('0x9'),'uri':_0x3cfba9+'/api/selector/owners','json':!![]};_0x3af71b[_0x9c72('0xa')]=_0x126f38;logger['info']('Getting\x20user\x20list');return rp(_0x3af71b)[_0x9c72('0xc')](function(_0x45c999){if(_0x45c999){var _0x152de4=_0x45c999['users'];var _0x46b7c4=![];var _0x378e5f=null;if(_0x5952d5[_0x9c72('0x17')]!==null){logger[_0x9c72('0x10')]('Getting\x20user\x20with\x20email',_0x5952d5[_0x9c72('0x17')]);_0x5952d5[_0x9c72('0x18')]=_0x5952d5['agentEmail'];for(_0x378e5f=0x0;_0x378e5f<_0x152de4[_0x9c72('0xe')];_0x378e5f++){if(_0x152de4[_0x378e5f][_0x9c72('0xf')]===_0x5952d5[_0x9c72('0x17')]){_0x46b7c4=!![];_0x5952d5['userId']=_0x152de4[_0x378e5f]['id'];logger[_0x9c72('0x10')](_0x9c72('0x19'),_0x5952d5[_0x9c72('0x1a')]);}}}if(!_0x46b7c4){logger[_0x9c72('0x10')]('Admin\x20selected');_0x5952d5[_0x9c72('0x18')]=_0x5952d5['adminEmail'];_0x5952d5[_0x9c72('0x1a')]=_0x5952d5[_0x9c72('0x11')];_0x46b7c4=!![];}if(_0x46b7c4){_0x33a620(_0x5952d5);}else{_0x3d6856({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3d6856({'statusCode':0x194,'message':_0x9c72('0x12')});}})[_0x9c72('0x13')](function(_0x5a0478){logger['error']('['+[_0x2e8ebb[_0x9c72('0x15')]()]+']',_0x5a0478[_0x9c72('0x16')]);_0x3d6856(_0x5a0478);});});};}function searchContact(_0x2ac8d9,_0x15dfac,_0x11f284,_0xa78e6d){return new Promise(function(_0x4c43dc,_0x246ae9){var _0x5c63e5={'method':_0x9c72('0x9'),'headers':_0x15dfac,'uri':_0x2ac8d9+_0x9c72('0x1b')+_0xa78e6d+_0x9c72('0x1c')+_0x11f284+_0x9c72('0x1d'),'json':!![]};rp(_0x5c63e5)[_0x9c72('0xc')](function(_0x477980){var _0x5a1f7e=_[_0x9c72('0x1e')](_0x477980['contacts'][_0x9c72('0x1f')],[_0x11f284,_0xa78e6d]);_0x4c43dc(_0x5a1f7e);})['catch'](function(_0xeffa8c){_0x246ae9(_0xeffa8c);});});}function getEndUser(_0x480181,_0x7f0ed,_0x2a631e){return function(_0x2621e4){return new Promise(function(_0x5b727e,_0x113f71){logger[_0x9c72('0x10')](util[_0x9c72('0x20')](_0x9c72('0x21'),_0x2621e4[_0x9c72('0x22')]));searchContact(_0x2a631e,_0x7f0ed,_0x9c72('0x23'),_0x2621e4[_0x9c72('0x22')])[_0x9c72('0xc')](function(_0x5542c7){if(_0x5542c7){_0x2621e4['endUserId']=_0x5542c7['id'];logger[_0x9c72('0x10')](_0x9c72('0x24'),_0x2621e4[_0x9c72('0x25')]);return _0x5b727e(_0x2621e4);}searchContact(_0x2a631e,_0x7f0ed,_0x9c72('0x26'),_0x2621e4[_0x9c72('0x22')])[_0x9c72('0xc')](function(_0x410116){if(_0x410116){_0x2621e4['endUserId']=_0x410116['id'];logger[_0x9c72('0x10')](_0x9c72('0x27'),_0x2621e4[_0x9c72('0x25')]);return _0x5b727e(_0x2621e4);}createEndUser(_0x2621e4,_0x480181,_0x7f0ed,_0x2a631e)[_0x9c72('0xc')](function(_0x1c4a58){logger['info']('Contact\x20created:',_0x1c4a58[_0x9c72('0x25')]);return _0x5b727e(_0x1c4a58);});});})[_0x9c72('0x13')](function(_0x4b7f92){_0x113f71(_0x4b7f92);});});};}function createEndUser(_0x3686a4,_0x8c47d5,_0x3db694,_0x539dd8){return new Promise(function(_0x3e3917,_0x14484f){var _0x141c1d=moment();var _0x31f45a={'method':_0x9c72('0x28'),'uri':_0x539dd8+_0x9c72('0x29'),'body':{'contact':{'last_name':_0x3686a4[_0x9c72('0x22')],'work_number':_0x3686a4[_0x9c72('0x22')],'mobile_number':_0x3686a4[_0x9c72('0x22')],'owner_id':_0x3686a4[_0x9c72('0x1a')],'created_at':_0x141c1d['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x31f45a[_0x9c72('0xa')]=_0x3db694;logger[_0x9c72('0x10')](_0x9c72('0x2a'));return rp(_0x31f45a)[_0x9c72('0xc')](function(_0x12f773){_0x3686a4[_0x9c72('0x25')]=_0x12f773['contact']['id'];_0x3e3917(_0x3686a4);})[_0x9c72('0x13')](function(_0x18e97b){logger[_0x9c72('0x14')]('['+[_0x8c47d5['toUpperCase']()]+']',_0x18e97b[_0x9c72('0x16')]);_0x14484f(_0x18e97b[_0x9c72('0x16')]);});});}function getTicket(_0xeb1442,_0x3fad28,_0x40ddcc,_0x1397c4,_0x2e1517){return function(_0x207f4d){logger[_0x9c72('0x10')](_0x9c72('0x2b'));return new Promise(function(_0x54bf8b,_0x35a194){var _0x1e6a64=moment();var _0x3336de={'method':_0x9c72('0x28'),'uri':_0x40ddcc+_0x9c72('0x2c'),'body':{'title':intUtil[_0x9c72('0x2d')](_0x1397c4['Subjects'],_0x2e1517,'\x20'),'description':intUtil['getString'](_0x1397c4[_0x9c72('0x2e')],_0x2e1517,'\x0a'),'owner_id':_0x207f4d[_0x9c72('0x1a')],'creater_id':_0x207f4d[_0x9c72('0x11')],'targetable_id':_0x207f4d[_0x9c72('0x25')],'targetable_type':_0x9c72('0x2f'),'created_at':_0x1e6a64[_0x9c72('0x20')](_0x9c72('0x30')),'due_date':_0x1e6a64[_0x9c72('0x31')](0x1e,'m')[_0x9c72('0x20')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3336de[_0x9c72('0xa')]=_0x3fad28;return rp(_0x3336de)[_0x9c72('0xc')](function(_0x46edc1){_0x207f4d['ticketId']=_0x46edc1[_0x9c72('0x32')]['id'];logger[_0x9c72('0x10')](_0x9c72('0x33'),_0x207f4d[_0x9c72('0x34')]);_0x54bf8b(_0x207f4d);})[_0x9c72('0x13')](function(_0x571d6b){logger['error']('['+[_0xeb1442['toUpperCase']()]+']',_0x571d6b[_0x9c72('0x16')]);_0x35a194(_0x571d6b['message']);});});};}function emit(_0x433a52,_0x8a2363,_0x5971bc){var _0x4fbd05={'uri':_0x433a52+'/contacts/'+_0x5971bc};io['to'](util[_0x9c72('0x20')](_0x9c72('0x35'),_0x8a2363))[_0x9c72('0x36')]('trigger:browser:url',_0x4fbd05);}exports['cs']=function(_0x53635a,_0x22a602,_0xbef83b,_0xd827d0,_0x5ec0aa,_0x196a96,_0x980801,_0x1d32f6){var _0x32b3f3={};var _0x36a61b={'Authorization':_0x9c72('0x37')+_0x196a96[_0x9c72('0x38')]};_0x196a96[_0x9c72('0x39')]=intUtil[_0x9c72('0x3a')](_0x196a96[_0x9c72('0x39')]);_0x196a96['serverUrl']=intUtil['stripTrailingSlash'](_0x196a96[_0x9c72('0x3b')]);var _0x2a587b=_0x196a96['remoteUri'];_0x32b3f3[_0x9c72('0x3c')]=_0x196a96[_0x9c72('0x3d')];_0x32b3f3[_0x9c72('0x22')]=_0x1d32f6[_0x9c72('0x3e')]()===_0x9c72('0x3f')?_0x22a602[_0x9c72('0x40')]:_0x22a602[_0x9c72('0x41')];_0x32b3f3[_0x9c72('0x42')]=_0x1d32f6==='queue'||_0x1d32f6===_0x9c72('0x43')?'queue':_0x9c72('0x3f');if(_0xd827d0){_0x32b3f3[_0x9c72('0x17')]=_0xd827d0[_0x9c72('0xf')];}var _0x551322=util['format'](_0x9c72('0x44'),_0x196a96[_0x9c72('0x3b')],_0x22a602[_0x9c72('0x45')],md5(_0x22a602['uniqueid']));if(_0x5ec0aa&&_0x5ec0aa[_0x9c72('0x46')]){logger['info'](_0x9c72('0x47'),_0x9c72('0x48'));_0x22a602[_0x9c72('0x49')]=_0x551322;}else if(_0x980801&&_0x980801['recordingFormat']&&_0x980801[_0x9c72('0x4a')]!==_0x9c72('0x4b')){logger[_0x9c72('0x10')](_0x9c72('0x4c'),_0x9c72('0x48'));_0x22a602[_0x9c72('0x49')]=_0x551322;}else{_0x22a602[_0x9c72('0x49')]='';}return getAdminId(_0x32b3f3,_0x1d32f6,_0x36a61b,_0x2a587b)[_0x9c72('0xc')](getUser(_0x1d32f6,_0x36a61b,_0x2a587b))[_0x9c72('0xc')](getEndUser(_0x1d32f6,_0x36a61b,_0x2a587b))['then'](getTicket(_0x1d32f6,_0x36a61b,_0x2a587b,_0xbef83b,_0x22a602))[_0x9c72('0xc')](function(_0x2d8332){logger[_0x9c72('0x10')](util[_0x9c72('0x20')](_0x9c72('0x4d'),_0x2d8332['ticketId']));if(_0x1d32f6!==_0x9c72('0x43')){logger[_0x9c72('0x10')]('['+[_0x1d32f6[_0x9c72('0x15')]()]+']',_0x9c72('0x4e'));emit(_0x2a587b,_0xd827d0[_0x9c72('0x4f')],_0x2d8332[_0x9c72('0x25')]);}})[_0x9c72('0x13')](function(_0x1c56a8){logger['error']('['+[_0x1d32f6[_0x9c72('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x9c72('0x50')](_0x1c56a8,{'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 e4add75..c2edea7 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 _0x444f=['dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','salesforce','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./servicenow','./dynamics365','sugarcrm','freshdesk','zoho','desk','vtiger'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x444f,0x11c));var _0xf444=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0x444f[_0x37ef22];return _0x49eeb3;};'use strict';var _=require('lodash');var util=require(_0xf444('0x0'));var zendesk=require(_0xf444('0x1'));var salesforce=require(_0xf444('0x2'));var sugarcrm=require(_0xf444('0x3'));var freshdesk=require(_0xf444('0x4'));var zoho=require('./zoho');var desk=require(_0xf444('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xf444('0x6'));var dynamics365=require(_0xf444('0x7'));var freshsales=require('./freshsales');var integrations=['zendesk','salesforce',_0xf444('0x8'),_0xf444('0x9'),_0xf444('0xa'),_0xf444('0xb'),_0xf444('0xc'),_0xf444('0xd'),_0xf444('0xe'),'servicenow'];exports[_0xf444('0xf')]=function(_0x5beee8,_0x29b883,_0x2d36d9,_0x1d4738,_0x2ddf55,_0x3fcb1e){if(_0x2d36d9){if(_[_0xf444('0x10')](integrations,_0x5beee8[_0xf444('0x11')][_0xf444('0x12')]())){try{var _0x29f194=null;var _0xb71cdb='';var _0x3cac03=_0x2d36d9[_0x5beee8['data1'][_0xf444('0x12')]()];if(_0x3cac03){var _0x353c2a=_0x3cac03[_0x5beee8[_0xf444('0x13')]];if(_0x353c2a){var _0x120ca6=_[_0xf444('0x14')](_0x353c2a['Configurations'],{'id':parseInt(_0x5beee8[_0xf444('0x15')],0xa)});if(_0x120ca6){if(_0x1d4738){if(_0x2ddf55&&_0x29b883[_0xf444('0x16')]){_0xb71cdb='queue';}else if(_0x29b883[_0xf444('0x17')]){_0xb71cdb=_0xf444('0x18');}else{console['log'](_0xf444('0x19'),_0x29b883);}}else{_0xb71cdb='unmanaged';}switch(_0x5beee8[_0xf444('0x11')][_0xf444('0x12')]()){case'zendesk':zendesk[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case _0xf444('0x1a'):salesforce[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case _0xf444('0x8'):sugarcrm[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case _0xf444('0x9'):freshdesk[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case _0xf444('0xa'):zoho[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case _0xf444('0xb'):desk[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case'vtiger':vtiger[_0xb71cdb](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e);break;case'freshsales':freshsales['cs'](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e,_0xb71cdb);break;case'servicenow':servicenow['cs'](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e,_0xb71cdb);break;case'dynamics365':dynamics365['cs'](_0x5beee8,_0x29b883,_0x120ca6,_0x1d4738,_0x2ddf55,_0x353c2a,_0x3fcb1e,_0xb71cdb);break;default:console[_0xf444('0x1b')](_0xf444('0x1c'));}}else{_0x29f194=require(_0xf444('0x1d'))(_0x5beee8['data1']['toLowerCase']());_0x29f194[_0xf444('0x1e')](_0xf444('0x1f'),util['format'](_0xf444('0x20'),_0x5beee8[_0xf444('0x11')][_0xf444('0x12')](),_0x5beee8[_0xf444('0x15')]));}}else{_0x29f194=require(_0xf444('0x1d'))(_0x5beee8[_0xf444('0x11')][_0xf444('0x12')]());_0x29f194[_0xf444('0x1e')](_0xf444('0x1f'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x5beee8[_0xf444('0x11')][_0xf444('0x12')](),_0x5beee8[_0xf444('0x13')]));}}else{}}catch(_0x51661b){console['error'](_0x51661b);}}}}; \ No newline at end of file +var _0xb509=['EVENT\x20UNKNOWN','desk','unknown\x20integration','../../../../config/logger','format','data3','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','queue','routeId','outbound','log'];(function(_0x28d1d2,_0x3d3738){var _0x64847e=function(_0x31c5b2){while(--_0x31c5b2){_0x28d1d2['push'](_0x28d1d2['shift']());}};_0x64847e(++_0x3d3738);}(_0xb509,0x1c5));var _0x9b50=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb509[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x9b50('0x0'));var util=require(_0x9b50('0x1'));var zendesk=require(_0x9b50('0x2'));var salesforce=require(_0x9b50('0x3'));var sugarcrm=require(_0x9b50('0x4'));var freshdesk=require(_0x9b50('0x5'));var zoho=require(_0x9b50('0x6'));var desk=require('./desk');var vtiger=require(_0x9b50('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x9b50('0x8'));var freshsales=require(_0x9b50('0x9'));var integrations=[_0x9b50('0xa'),_0x9b50('0xb'),_0x9b50('0xc'),_0x9b50('0xd'),_0x9b50('0xe'),'desk','vtiger',_0x9b50('0xf'),_0x9b50('0x10'),_0x9b50('0x11')];exports[_0x9b50('0x12')]=function(_0x157833,_0x4157d4,_0x16fa77,_0x121c33,_0x4946b7,_0x551bbf){if(_0x16fa77){if(_[_0x9b50('0x13')](integrations,_0x157833[_0x9b50('0x14')][_0x9b50('0x15')]())){try{var _0x27c7ca=null;var _0x2ef79c='';var _0x45e789=_0x16fa77[_0x157833[_0x9b50('0x14')][_0x9b50('0x15')]()];if(_0x45e789){var _0x26bab6=_0x45e789[_0x157833[_0x9b50('0x16')]];if(_0x26bab6){var _0x55c76d=_['find'](_0x26bab6[_0x9b50('0x17')],{'id':parseInt(_0x157833['data3'],0xa)});if(_0x55c76d){if(_0x121c33){if(_0x4946b7&&_0x4157d4[_0x9b50('0x18')]){_0x2ef79c='queue';}else if(_0x4157d4[_0x9b50('0x19')]){_0x2ef79c=_0x9b50('0x1a');}else{console[_0x9b50('0x1b')](_0x9b50('0x1c'),_0x4157d4);}}else{_0x2ef79c='unmanaged';}switch(_0x157833[_0x9b50('0x14')][_0x9b50('0x15')]()){case _0x9b50('0xa'):zendesk[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case'salesforce':salesforce[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case'sugarcrm':sugarcrm[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case'freshdesk':freshdesk[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case _0x9b50('0xe'):zoho[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case _0x9b50('0x1d'):desk[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case'vtiger':vtiger[_0x2ef79c](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf);break;case'freshsales':freshsales['cs'](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf,_0x2ef79c);break;case'servicenow':servicenow['cs'](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf,_0x2ef79c);break;case _0x9b50('0xf'):dynamics365['cs'](_0x157833,_0x4157d4,_0x55c76d,_0x121c33,_0x4946b7,_0x26bab6,_0x551bbf,_0x2ef79c);break;default:console[_0x9b50('0x1b')](_0x9b50('0x1e'));}}else{_0x27c7ca=require(_0x9b50('0x1f'))(_0x157833[_0x9b50('0x14')][_0x9b50('0x15')]());_0x27c7ca['error']('[EXEC]',util[_0x9b50('0x20')]('%s\x20configuration\x20#%s\x20not\x20found',_0x157833[_0x9b50('0x14')][_0x9b50('0x15')](),_0x157833[_0x9b50('0x21')]));}}else{_0x27c7ca=require(_0x9b50('0x1f'))(_0x157833[_0x9b50('0x14')]['toLowerCase']());_0x27c7ca[_0x9b50('0x22')](_0x9b50('0x23'),util['format'](_0x9b50('0x24'),_0x157833['data1'][_0x9b50('0x15')](),_0x157833['data2']));}}else{}}catch(_0xbc9ca6){console[_0x9b50('0x22')](_0xbc9ca6);}}}}; \ 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 30489b6..890931a 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 _0x5d2e=['forEach','string','picklist','idField','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','lead','WhoId','account','WhatId','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','$or','additionalSearchLead','account_contact_lead','additionalSearchAccount','additionalSearchContact','Contact','Lead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','No\x20Company','upperFirst'];(function(_0x5b70c2,_0x21165f){var _0x36e5a5=function(_0x48f110){while(--_0x48f110){_0x5b70c2['push'](_0x5b70c2['shift']());}};_0x36e5a5(++_0x21165f);}(_0x5d2e,0x1bb));var _0xe5d2=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x5d2e[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xe5d2('0x0'));var rp=require(_0xe5d2('0x1'));var moment=require(_0xe5d2('0x2'));var BPromise=require('bluebird');var md5=require(_0xe5d2('0x3'));var jsforce=require(_0xe5d2('0x4'));var util=require(_0xe5d2('0x5'));var Redis=require(_0xe5d2('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe5d2('0x7'))(_0xe5d2('0x8'));config[_0xe5d2('0x9')]=_[_0xe5d2('0xa')](config['redis'],{'host':_0xe5d2('0xb'),'port':0x18eb});var io=require(_0xe5d2('0xc'))(new Redis(config['redis']));function emit(_0x2e5095,_0x564a4e,_0x462cb0){io['to'](_0x2e5095)[_0xe5d2('0xd')](_0x564a4e,_0x462cb0);}function getTicket(_0x158384,_0x42832d,_0x41e6b7,_0x125959,_0x438c78,_0x5ae0bb,_0x5e8cc6,_0x4ef1ed){var _0x4072c2=Object['assign']({},{'OwnerId':_0x42832d['id'],'Subject':intUtil[_0xe5d2('0xe')](_0x125959[_0xe5d2('0xf')],_0x438c78,'\x20'),'Description':intUtil[_0xe5d2('0xe')](_0x125959['Descriptions'],_0x438c78,'\x0a')},getCustomFields(_0x5ae0bb,_0x438c78));if(_0x41e6b7){if(_0x125959[_0xe5d2('0x10')]===_0xe5d2('0x11')){_0x4072c2[_0xe5d2('0x12')]=moment[_0xe5d2('0x13')]();_0x4072c2['IsReminderSet']=![];_0x4072c2[_0xe5d2('0x14')]=![];if(_0x41e6b7[_0xe5d2('0x15')]==='contact'||_0x41e6b7[_0xe5d2('0x15')]===_0xe5d2('0x16')){_0x4072c2[_0xe5d2('0x17')]=_0x41e6b7['id'];}else if(_0x41e6b7[_0xe5d2('0x15')]===_0xe5d2('0x18')){_0x4072c2[_0xe5d2('0x19')]=_0x41e6b7['id'];}}else if(_0x125959[_0xe5d2('0x10')]==='Case'){if(_0x41e6b7[_0xe5d2('0x15')]===_0xe5d2('0x1a')){_0x4072c2[_0xe5d2('0x1b')]=_0x41e6b7['id'];}else if(_0x41e6b7[_0xe5d2('0x15')]==='account'){_0x4072c2[_0xe5d2('0x1c')]=_0x41e6b7['id'];}else if(_0x41e6b7[_0xe5d2('0x15')]===_0xe5d2('0x16')&&_0x125959['leadId']){_0x4072c2[_0x125959[_0xe5d2('0x1d')]]=_0x41e6b7['id'];}else{logger[_0xe5d2('0x1e')](_0xe5d2('0x1f'));}}}return _0x5e8cc6['sobject'](_0x125959[_0xe5d2('0x10')])['create'](_0x4072c2);}function getUser(_0x4ad51d,_0x15d502,_0x31174a){if(!_[_0xe5d2('0x20')](_0x15d502)&&intUtil[_0xe5d2('0x21')](_0x15d502)){var _0x58410b={'Email':_0x15d502};var _0x582181={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x31174a[_0xe5d2('0x22')](_0xe5d2('0x23'))[_0xe5d2('0x24')](_0x58410b,_0x582181)[_0xe5d2('0x25')]()[_0xe5d2('0x26')](function(_0x4ad695){if(_0x4ad695[_0xe5d2('0x27')]){var _0x381130=_[_0xe5d2('0x24')](_0x4ad695,function(_0xf072e5){return _0xf072e5[_0xe5d2('0x28')]===_0x15d502;});if(_0x381130){logger['info']('Agent\x20%s\x20found.',_0x15d502);return BPromise[_0xe5d2('0x29')]({'id':_0x381130['Id'],'name':_0x381130[_0xe5d2('0x2a')]});}}else{logger[_0xe5d2('0x1e')](_0xe5d2('0x2b'),_0x15d502);return _0x31174a[_0xe5d2('0x2c')]()[_0xe5d2('0x26')](function(_0x11db78){return BPromise['resolve']({'id':_0x11db78[_0xe5d2('0x2d')],'name':_0x11db78[_0xe5d2('0x2e')]});});}});}else{logger[_0xe5d2('0x1e')](_0xe5d2('0x2b'),_0x15d502);return _0x31174a[_0xe5d2('0x2c')]()[_0xe5d2('0x26')](function(_0x43b868){return BPromise[_0xe5d2('0x29')]({'id':_0x43b868['user_id'],'name':_0x43b868[_0xe5d2('0x2e')]});});}}function getEndUser(_0x2175f3,_0x4c936b,_0x4e0d21,_0x398dcf,_0x396bc4){var _0x6d9fa1={'$or':{'Phone':_0x398dcf}};var _0x56f2df={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe5d2('0x29')]()['then'](function(){logger[_0xe5d2('0x1e')](_0xe5d2('0x2f'),_0x398dcf,_0x4c936b[_0xe5d2('0x30')]);switch(_0x4c936b[_0xe5d2('0x30')]){case _0xe5d2('0x31'):var _0x43ead5=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b['additionalSearchContact']){var _0x1e401d={};_0x1e401d[_0x4c936b['additionalSearchContact']]=_0x398dcf;_[_0xe5d2('0x33')](_0x43ead5[_0xe5d2('0x34')],_0x1e401d);}return _0x396bc4[_0xe5d2('0x22')]('Contact')[_0xe5d2('0x24')](_0x43ead5,_0x56f2df)[_0xe5d2('0x25')]()[_0xe5d2('0x26')](function(_0x279bb3){if(_0x279bb3&&_0x279bb3['length']){return _0x279bb3;}else{var _0x3a3497=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b[_0xe5d2('0x35')]){var _0x534363={};_0x534363[_0x4c936b[_0xe5d2('0x35')]]=_0x398dcf;_[_0xe5d2('0x33')](_0x3a3497[_0xe5d2('0x34')],_0x534363);}return _0x396bc4[_0xe5d2('0x22')]('Lead')[_0xe5d2('0x24')](_0x3a3497,_0x56f2df);}});case _0xe5d2('0x36'):var _0x104261=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b['additionalSearchAccount']){var _0x1e401d={};_0x1e401d[_0x4c936b[_0xe5d2('0x37')]]=_0x398dcf;_[_0xe5d2('0x33')](_0x104261[_0xe5d2('0x34')],_0x1e401d);}return _0x396bc4['sobject']('Account')[_0xe5d2('0x24')](_0x104261,_0x56f2df)[_0xe5d2('0x25')]()['then'](function(_0x4bca5b){if(_0x4bca5b&&_0x4bca5b[_0xe5d2('0x27')]){return _0x4bca5b;}else{var _0x47b219=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b[_0xe5d2('0x38')]){var _0x223a50={};_0x223a50[_0x4c936b['additionalSearchContact']]=_0x398dcf;_[_0xe5d2('0x33')](_0x47b219['$or'],_0x223a50);}return _0x396bc4[_0xe5d2('0x22')](_0xe5d2('0x39'))[_0xe5d2('0x24')](_0x47b219,_0x56f2df)[_0xe5d2('0x26')](function(_0x3fb1c5){if(_0x3fb1c5&&_0x3fb1c5['length']){return _0x3fb1c5;}else{var _0x534b7d=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b[_0xe5d2('0x35')]){var _0x434b49={};_0x434b49[_0x4c936b['additionalSearchLead']]=_0x398dcf;_[_0xe5d2('0x33')](_0x534b7d[_0xe5d2('0x34')],_0x434b49);}return _0x396bc4['sobject'](_0xe5d2('0x3a'))[_0xe5d2('0x24')](_0x534b7d,_0x56f2df);}});}});case _0xe5d2('0x1a'):var _0x43ead5=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b[_0xe5d2('0x38')]){var _0x1e401d={};_0x1e401d[_0x4c936b[_0xe5d2('0x38')]]=_0x398dcf;_['merge'](_0x43ead5[_0xe5d2('0x34')],_0x1e401d);}return _0x396bc4['sobject'](_0xe5d2('0x39'))[_0xe5d2('0x24')](_0x43ead5,_0x56f2df)['execute']();case _0xe5d2('0x16'):var _0x23fe53=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b[_0xe5d2('0x35')]){var _0x1e401d={};_0x1e401d[_0x4c936b['additionalSearchLead']]=_0x398dcf;_[_0xe5d2('0x33')](_0x23fe53[_0xe5d2('0x34')],_0x1e401d);}return _0x396bc4['sobject']('Lead')[_0xe5d2('0x24')](_0x23fe53,_0x56f2df);case _0xe5d2('0x18'):var _0x104261=_[_0xe5d2('0x32')](_0x6d9fa1);if(_0x4c936b['additionalSearchAccount']){var _0x1e401d={};_0x1e401d[_0x4c936b[_0xe5d2('0x37')]]=_0x398dcf;_[_0xe5d2('0x33')](_0x104261[_0xe5d2('0x34')],_0x1e401d);}return _0x396bc4[_0xe5d2('0x22')]('Account')[_0xe5d2('0x24')](_0x104261,_0x56f2df);default:return null;}})[_0xe5d2('0x26')](function(_0x5f56b3){if(_0x5f56b3&&_0x5f56b3[_0xe5d2('0x27')]){var _0x31b074=_[_0xe5d2('0x3b')](_0x5f56b3);if(_0x31b074){return BPromise['resolve']({'id':_0x31b074['Id'],'name':_0x31b074[_0xe5d2('0x2a')],'phone':_0x31b074[_0xe5d2('0x3c')],'endUserType':_0x31b074['attributes'][_0xe5d2('0x3d')][_0xe5d2('0x3e')]()});}}})[_0xe5d2('0x26')](function(_0x4c7eaa){if(_0x4c7eaa){logger[_0xe5d2('0x1e')](_0xe5d2('0x3f'),_0x4c7eaa[_0xe5d2('0x15')],_0x398dcf);return BPromise[_0xe5d2('0x29')](_0x4c7eaa);}else{logger[_0xe5d2('0x1e')](_0xe5d2('0x40'),_0x398dcf);var _0x343565={'Phone':_0x398dcf};if(_0x4c936b[_0xe5d2('0x41')]){if(_0x4c936b[_0xe5d2('0x41')]===_0xe5d2('0x1a')){logger[_0xe5d2('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x398dcf,_0x4c936b[_0xe5d2('0x41')]);_0x343565[_0xe5d2('0x42')]=_0x4e0d21!==''?_0x4e0d21:util[_0xe5d2('0x43')](_0xe5d2('0x44'),_0x398dcf);}else if(_0x4c936b[_0xe5d2('0x41')]===_0xe5d2('0x16')){logger['info'](_0xe5d2('0x45'),_0x398dcf,_0x4c936b['moduleCreate']);_0x343565[_0xe5d2('0x42')]=_0x4e0d21!==_0xe5d2('0x46')?_0x4e0d21:util['format'](_0xe5d2('0x44'),_0x398dcf);_0x343565['Company']=_0xe5d2('0x47');}else if(_0x4c936b['moduleCreate']==='account'){logger['info'](_0xe5d2('0x45'),_0x398dcf,_0x4c936b[_0xe5d2('0x41')]);_0x343565[_0xe5d2('0x2a')]=_0x4e0d21!==_0xe5d2('0x46')?_0x4e0d21:util[_0xe5d2('0x43')]('Caller\x20-\x20%s',_0x398dcf);}else{return null;}}return _0x396bc4[_0xe5d2('0x22')](_[_0xe5d2('0x48')](_0x4c936b[_0xe5d2('0x41')]))['create'](_0x343565)['then'](function(_0x205b9a){return BPromise[_0xe5d2('0x29')]({'id':_0x205b9a['id'],'endUserType':_0x4c936b['moduleCreate']});});}});}function getCustomFields(_0x12fbc5,_0x2c523c){var _0x200733={};if(_0x12fbc5[_0xe5d2('0x27')]>0x0){_[_0xe5d2('0x49')](_0x12fbc5,function(_0x1c705e){if(_['includes']([_0xe5d2('0x4a'),_0xe5d2('0x4b')],_0x1c705e[_0xe5d2('0x3d')])&&_0x1c705e[_0xe5d2('0x4c')]){_0x200733[_0x1c705e[_0xe5d2('0x4c')]]=_0x1c705e['content'][_0xe5d2('0x4d')]();}else if(_0x1c705e[_0xe5d2('0x3d')]==='variable'&&_0x1c705e['variableName']&&_0x1c705e[_0xe5d2('0x4c')]){_0x2c523c[_0x1c705e[_0xe5d2('0x4e')]]&&(_0x200733[_0x1c705e['idField']]=_0x2c523c[_0x1c705e[_0xe5d2('0x4e')]][_0xe5d2('0x4d')]());}else if(_0x1c705e[_0xe5d2('0x3d')]===_0xe5d2('0x4f')&&_0x1c705e[_0xe5d2('0x50')]&&_0x1c705e['Variable'][_0xe5d2('0x51')]&&_0x1c705e[_0xe5d2('0x4c')]){_0x2c523c[_0x1c705e['Variable'][_0xe5d2('0x51')]['toLowerCase']()]&&(_0x200733[_0x1c705e['idField']]=_0x2c523c[_0x1c705e[_0xe5d2('0x50')][_0xe5d2('0x51')][_0xe5d2('0x3e')]()][_0xe5d2('0x4d')]());}});}return _0x200733;}function getConnection(_0x513d32){var _0x48cbe3=_0x513d32[_0xe5d2('0x52')][_0xe5d2('0x53')](_0x513d32[_0xe5d2('0x54')]);var _0x4d8c65=new jsforce[(_0xe5d2('0x55'))]({'oauth2':{'loginUrl':_0x513d32[_0xe5d2('0x56')]||_0xe5d2('0x57'),'clientId':_0x513d32['clientId'],'clientSecret':_0x513d32[_0xe5d2('0x58')]}});return _0x4d8c65[_0xe5d2('0x59')](_0x513d32[_0xe5d2('0x5a')],_0x48cbe3)[_0xe5d2('0x26')](function(){logger[_0xe5d2('0x1e')](_0xe5d2('0x5b'));return _0x4d8c65;});}exports['queue']=function(_0x550139,_0x4760af,_0x56016a,_0x4f394b,_0x108f76,_0x59c649){var _0x18f540,_0x2163f2,_0x6259f8,_0x1d9a74;_0x59c649[_0xe5d2('0x5c')]=intUtil[_0xe5d2('0x5d')](_0x59c649[_0xe5d2('0x5c')]);_0x59c649[_0xe5d2('0x56')]=intUtil[_0xe5d2('0x5d')](_0x59c649[_0xe5d2('0x56')]);if(_0x108f76&&_0x108f76[_0xe5d2('0x5e')]){logger[_0xe5d2('0x1e')](_0xe5d2('0x5f'),_0xe5d2('0x60'));_0x4760af[_0xe5d2('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x59c649[_0xe5d2('0x5c')],_0x4760af[_0xe5d2('0x62')],md5(_0x4760af[_0xe5d2('0x62')]));}else{_0x4760af[_0xe5d2('0x61')]='';}return getConnection(_0x59c649)[_0xe5d2('0x26')](function(_0xed64f5){_0x1d9a74=_0xed64f5;return getUser(_0x59c649,_0x4f394b[_0xe5d2('0x63')],_0x1d9a74);})['then'](function(_0xb99074){_0x18f540=_0xb99074;return getEndUser(_0x59c649,_0x56016a,_0x4760af[_0xe5d2('0x64')],_0x4760af['calleridnum'],_0x1d9a74);})[_0xe5d2('0x26')](function(_0x27d2d1){_0x2163f2=_0x27d2d1;return getTicket(_0x59c649,_0x18f540,_0x2163f2,_0x56016a,_0x4760af,_0x56016a[_0xe5d2('0x65')],_0x1d9a74,_0xe5d2('0x66'));})[_0xe5d2('0x26')](function(_0x445b4a){_0x6259f8=_0x445b4a;logger['info'](_0xe5d2('0x67'),_0x6259f8['id']);logger[_0xe5d2('0x1e')](_0xe5d2('0x68'),_0x6259f8['id'],_0x4f394b[_0xe5d2('0x51')],_0x59c649['type']);switch(_0x59c649['type']){case _0xe5d2('0x69'):emit(util[_0xe5d2('0x43')](_0xe5d2('0x6a'),_0x4f394b[_0xe5d2('0x51')]),_0xe5d2('0x6b'),{'recordId':_0x6259f8['id']});break;case'newTab':emit(util['format']('user:%s',_0x4f394b['name']),_0xe5d2('0x6c'),{'uri':util[_0xe5d2('0x43')](_0xe5d2('0x6d'),_0x1d9a74[_0xe5d2('0x6e')],_0x6259f8['id'])});break;default:logger[_0xe5d2('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xe5d2('0x70')](function(_0x786a64){logger['error']('[QUEUE]',_0x786a64);});};exports[_0xe5d2('0x71')]=function(_0x5e1892,_0x18123f,_0x23eb1c,_0x270d03,_0x177b30,_0x21ed57,_0x41d127){var _0xc17449,_0x41bfb5,_0x4071d8,_0x1a1a4e;_0x21ed57[_0xe5d2('0x5c')]=intUtil[_0xe5d2('0x5d')](_0x21ed57[_0xe5d2('0x5c')]);_0x21ed57[_0xe5d2('0x56')]=intUtil['stripTrailingSlash'](_0x21ed57[_0xe5d2('0x56')]);if(_0x41d127&&_0x41d127['recordingFormat']&&_0x41d127[_0xe5d2('0x72')]!==_0xe5d2('0x73')){logger[_0xe5d2('0x1e')](_0xe5d2('0x74'),_0xe5d2('0x60'));_0x18123f['recordingURL']=util[_0xe5d2('0x43')](_0xe5d2('0x75'),_0x21ed57[_0xe5d2('0x5c')],_0x18123f[_0xe5d2('0x62')],md5(_0x18123f['uniqueid']));}return getConnection(_0x21ed57)[_0xe5d2('0x26')](function(_0x22d13d){_0x1a1a4e=_0x22d13d;return getUser(_0x21ed57,_0x270d03[_0xe5d2('0x63')],_0x1a1a4e);})[_0xe5d2('0x26')](function(_0x52a7b4){_0xc17449=_0x52a7b4;return getEndUser(_0x21ed57,_0x23eb1c,_0x18123f[_0xe5d2('0x76')],_0x18123f[_0xe5d2('0x77')],_0x1a1a4e);})[_0xe5d2('0x26')](function(_0x54beab){_0x41bfb5=_0x54beab;return getTicket(_0x21ed57,_0xc17449,_0x41bfb5,_0x23eb1c,_0x18123f,_0x23eb1c['Fields'],_0x1a1a4e,'outbound');})[_0xe5d2('0x26')](function(_0x2c0876){_0x4071d8=_0x2c0876;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x4071d8['id']);logger[_0xe5d2('0x1e')](_0xe5d2('0x78'),_0x4071d8['id'],_0x270d03['name'],_0x21ed57[_0xe5d2('0x3d')]);switch(_0x21ed57[_0xe5d2('0x3d')]){case _0xe5d2('0x69'):emit(util[_0xe5d2('0x43')](_0xe5d2('0x6a'),_0x270d03[_0xe5d2('0x51')]),_0xe5d2('0x6b'),{'recordId':_0x4071d8['id']});break;case _0xe5d2('0x79'):emit(util[_0xe5d2('0x43')](_0xe5d2('0x6a'),_0x270d03[_0xe5d2('0x51')]),'trigger:browser:url',{'uri':util['format'](_0xe5d2('0x6d'),_0x1a1a4e['instanceUrl'],_0x4071d8['id'])});break;default:logger[_0xe5d2('0x6f')](_0xe5d2('0x74'),_0xe5d2('0x7a'));}})[_0xe5d2('0x70')](function(_0x314611){logger[_0xe5d2('0x6f')](_0xe5d2('0x74'),_0x314611);});};exports[_0xe5d2('0x7b')]=function(_0xc2d719,_0x594909,_0xedb5c,_0x1ac77c,_0x4fa7fe,_0x4c9f0d){var _0x258782,_0x46d5af,_0x47cb89,_0x1e280e;_0x4c9f0d[_0xe5d2('0x5c')]=intUtil[_0xe5d2('0x5d')](_0x4c9f0d[_0xe5d2('0x5c')]);_0x4c9f0d[_0xe5d2('0x56')]=intUtil['stripTrailingSlash'](_0x4c9f0d['remoteUri']);if(_0x4fa7fe&&_0x4fa7fe['monitor_format']){logger['info']('['+_0x594909[_0xe5d2('0x7c')][_0xe5d2('0x7d')]()+']',_0xe5d2('0x60'));_0x594909[_0xe5d2('0x61')]=util[_0xe5d2('0x43')](_0xe5d2('0x75'),_0x4c9f0d[_0xe5d2('0x5c')],_0x594909[_0xe5d2('0x62')],md5(_0x594909[_0xe5d2('0x62')]));}else{_0x594909[_0xe5d2('0x61')]='';}return getConnection(_0x4c9f0d)[_0xe5d2('0x26')](function(_0x2d749d){_0x1e280e=_0x2d749d;if(!_[_0xe5d2('0x20')](_0x1ac77c)){return getUser(_0x4c9f0d,_0x1ac77c[_0xe5d2('0x51')],_0x1e280e);}else{return getUser(_0x4c9f0d,null,_0x1e280e);}})['then'](function(_0x2518cf){_0x258782=_0x2518cf;return getEndUser(_0x4c9f0d,_0xedb5c,_0x594909[_0xe5d2('0x64')],_0x594909[_0xe5d2('0x7e')],_0x1e280e);})[_0xe5d2('0x26')](function(_0x51f5f6){_0x46d5af=_0x51f5f6;return getTicket(_0x4c9f0d,_0x258782,_0x46d5af,_0xedb5c,_0x594909,_0xedb5c[_0xe5d2('0x65')],_0x1e280e);})[_0xe5d2('0x26')](function(_0x3b8b36){_0x47cb89=_0x3b8b36;logger[_0xe5d2('0x1e')]('['+_0x594909[_0xe5d2('0x7c')]['toUpperCase']()+_0xe5d2('0x7f'),_0x47cb89['id']);logger['info']('['+_0x594909['lastevent'][_0xe5d2('0x7d')]()+_0xe5d2('0x80'),_0x4c9f0d['type']);})[_0xe5d2('0x70')](function(_0x416988){logger[_0xe5d2('0x6f')]('['+_0x594909[_0xe5d2('0x7c')]['toUpperCase']()+']',_0x416988);});}; \ No newline at end of file +var _0xa812=['socket.io-emitter','assign','getString','Subjects','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','ticketType','AccountId','leadId','info','sobject','create','isNil','validateEmail','User','find','length','Email','Agent\x20%s\x20found.','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','execute','additionalSearchLead','additionalSearchAccount','merge','$or','Account','Contact','Lead','Name','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','forEach','includes','picklist','idField','content','toString','variable','variableName','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','email','destcalleridnum','outbound','newTab','%s/%s/e','error','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','redis','localhost'];(function(_0x2e1293,_0xd9db95){var _0x183870=function(_0x23d60b){while(--_0x23d60b){_0x2e1293['push'](_0x2e1293['shift']());}};_0x183870(++_0xd9db95);}(_0xa812,0x15e));var _0x2a81=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa812[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x2a81('0x0'));var rp=require(_0x2a81('0x1'));var moment=require('moment');var BPromise=require(_0x2a81('0x2'));var md5=require(_0x2a81('0x3'));var jsforce=require(_0x2a81('0x4'));var util=require('util');var Redis=require(_0x2a81('0x5'));var intUtil=require(_0x2a81('0x6'));var config=require('../../../../config/environment');var logger=require(_0x2a81('0x7'))('salesforce');config[_0x2a81('0x8')]=_['defaults'](config[_0x2a81('0x8')],{'host':_0x2a81('0x9'),'port':0x18eb});var io=require(_0x2a81('0xa'))(new Redis(config[_0x2a81('0x8')]));function emit(_0x4b320a,_0x201fc3,_0x2190a7){io['to'](_0x4b320a)['emit'](_0x201fc3,_0x2190a7);}function getTicket(_0x4c63f5,_0x36a7ba,_0xa5d8a4,_0x296b18,_0x138665,_0x55a400,_0x5e5bd7,_0x41bbc7){var _0x16d776=Object[_0x2a81('0xb')]({},{'OwnerId':_0x36a7ba['id'],'Subject':intUtil[_0x2a81('0xc')](_0x296b18[_0x2a81('0xd')],_0x138665,'\x20'),'Description':intUtil['getString'](_0x296b18['Descriptions'],_0x138665,'\x0a')},getCustomFields(_0x55a400,_0x138665));if(_0xa5d8a4){if(_0x296b18['ticketType']===_0x2a81('0xe')){_0x16d776[_0x2a81('0xf')]=moment[_0x2a81('0x10')]();_0x16d776[_0x2a81('0x11')]=![];_0x16d776['IsRecurrence']=![];if(_0xa5d8a4[_0x2a81('0x12')]===_0x2a81('0x13')||_0xa5d8a4[_0x2a81('0x12')]===_0x2a81('0x14')){_0x16d776[_0x2a81('0x15')]=_0xa5d8a4['id'];}else if(_0xa5d8a4[_0x2a81('0x12')]===_0x2a81('0x16')){_0x16d776[_0x2a81('0x17')]=_0xa5d8a4['id'];}}else if(_0x296b18[_0x2a81('0x18')]==='Case'){if(_0xa5d8a4['endUserType']===_0x2a81('0x13')){_0x16d776['ContactId']=_0xa5d8a4['id'];}else if(_0xa5d8a4[_0x2a81('0x12')]==='account'){_0x16d776[_0x2a81('0x19')]=_0xa5d8a4['id'];}else if(_0xa5d8a4[_0x2a81('0x12')]===_0x2a81('0x14')&&_0x296b18[_0x2a81('0x1a')]){_0x16d776[_0x296b18[_0x2a81('0x1a')]]=_0xa5d8a4['id'];}else{logger[_0x2a81('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x5e5bd7[_0x2a81('0x1c')](_0x296b18[_0x2a81('0x18')])[_0x2a81('0x1d')](_0x16d776);}function getUser(_0x118197,_0x225843,_0x518cf9){if(!_[_0x2a81('0x1e')](_0x225843)&&intUtil[_0x2a81('0x1f')](_0x225843)){var _0x1207a1={'Email':_0x225843};var _0x1ba8bd={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x518cf9['sobject'](_0x2a81('0x20'))[_0x2a81('0x21')](_0x1207a1,_0x1ba8bd)['execute']()['then'](function(_0x52945c){if(_0x52945c[_0x2a81('0x22')]){var _0x3e37e4=_[_0x2a81('0x21')](_0x52945c,function(_0x3f9bc2){return _0x3f9bc2[_0x2a81('0x23')]===_0x225843;});if(_0x3e37e4){logger[_0x2a81('0x1b')](_0x2a81('0x24'),_0x225843);return BPromise[_0x2a81('0x25')]({'id':_0x3e37e4['Id'],'name':_0x3e37e4['Name']});}}else{logger[_0x2a81('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x225843);return _0x518cf9['identity']()['then'](function(_0x237eba){return BPromise[_0x2a81('0x25')]({'id':_0x237eba[_0x2a81('0x26')],'name':_0x237eba[_0x2a81('0x27')]});});}});}else{logger[_0x2a81('0x1b')](_0x2a81('0x28'),_0x225843);return _0x518cf9['identity']()[_0x2a81('0x29')](function(_0x377f94){return BPromise[_0x2a81('0x25')]({'id':_0x377f94['user_id'],'name':_0x377f94['display_name']});});}}function getEndUser(_0x28f3d5,_0x177459,_0x12ee5d,_0x4711ca,_0x368969){var _0x31f961={'$or':{'Phone':_0x4711ca}};var _0x10a9fa={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2a81('0x25')]()['then'](function(){logger['info'](_0x2a81('0x2a'),_0x4711ca,_0x177459[_0x2a81('0x2b')]);switch(_0x177459[_0x2a81('0x2b')]){case _0x2a81('0x2c'):var _0x179a6b=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459[_0x2a81('0x2e')]){var _0x42de24={};_0x42de24[_0x177459[_0x2a81('0x2e')]]=_0x4711ca;_['merge'](_0x179a6b['$or'],_0x42de24);}return _0x368969[_0x2a81('0x1c')]('Contact')['find'](_0x179a6b,_0x10a9fa)[_0x2a81('0x2f')]()['then'](function(_0x4e19cd){if(_0x4e19cd&&_0x4e19cd[_0x2a81('0x22')]){return _0x4e19cd;}else{var _0x1549a3=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459[_0x2a81('0x30')]){var _0x34910c={};_0x34910c[_0x177459[_0x2a81('0x30')]]=_0x4711ca;_['merge'](_0x1549a3['$or'],_0x34910c);}return _0x368969[_0x2a81('0x1c')]('Lead')[_0x2a81('0x21')](_0x1549a3,_0x10a9fa);}});case'account_contact_lead':var _0x5dc4ea=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459[_0x2a81('0x31')]){var _0x42de24={};_0x42de24[_0x177459[_0x2a81('0x31')]]=_0x4711ca;_[_0x2a81('0x32')](_0x5dc4ea[_0x2a81('0x33')],_0x42de24);}return _0x368969[_0x2a81('0x1c')](_0x2a81('0x34'))[_0x2a81('0x21')](_0x5dc4ea,_0x10a9fa)['execute']()[_0x2a81('0x29')](function(_0x134fae){if(_0x134fae&&_0x134fae[_0x2a81('0x22')]){return _0x134fae;}else{var _0x3f9ebd=_['cloneDeep'](_0x31f961);if(_0x177459[_0x2a81('0x2e')]){var _0x3bf542={};_0x3bf542[_0x177459[_0x2a81('0x2e')]]=_0x4711ca;_[_0x2a81('0x32')](_0x3f9ebd[_0x2a81('0x33')],_0x3bf542);}return _0x368969[_0x2a81('0x1c')](_0x2a81('0x35'))[_0x2a81('0x21')](_0x3f9ebd,_0x10a9fa)[_0x2a81('0x29')](function(_0x52242b){if(_0x52242b&&_0x52242b['length']){return _0x52242b;}else{var _0x3df545=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459[_0x2a81('0x30')]){var _0x1c11d5={};_0x1c11d5[_0x177459[_0x2a81('0x30')]]=_0x4711ca;_[_0x2a81('0x32')](_0x3df545['$or'],_0x1c11d5);}return _0x368969[_0x2a81('0x1c')](_0x2a81('0x36'))[_0x2a81('0x21')](_0x3df545,_0x10a9fa);}});}});case _0x2a81('0x13'):var _0x179a6b=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459[_0x2a81('0x2e')]){var _0x42de24={};_0x42de24[_0x177459[_0x2a81('0x2e')]]=_0x4711ca;_[_0x2a81('0x32')](_0x179a6b[_0x2a81('0x33')],_0x42de24);}return _0x368969[_0x2a81('0x1c')](_0x2a81('0x35'))[_0x2a81('0x21')](_0x179a6b,_0x10a9fa)[_0x2a81('0x2f')]();case _0x2a81('0x14'):var _0x234147=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459['additionalSearchLead']){var _0x42de24={};_0x42de24[_0x177459['additionalSearchLead']]=_0x4711ca;_['merge'](_0x234147[_0x2a81('0x33')],_0x42de24);}return _0x368969[_0x2a81('0x1c')](_0x2a81('0x36'))[_0x2a81('0x21')](_0x234147,_0x10a9fa);case'account':var _0x5dc4ea=_[_0x2a81('0x2d')](_0x31f961);if(_0x177459['additionalSearchAccount']){var _0x42de24={};_0x42de24[_0x177459[_0x2a81('0x31')]]=_0x4711ca;_[_0x2a81('0x32')](_0x5dc4ea['$or'],_0x42de24);}return _0x368969[_0x2a81('0x1c')](_0x2a81('0x34'))[_0x2a81('0x21')](_0x5dc4ea,_0x10a9fa);default:return null;}})[_0x2a81('0x29')](function(_0x5ed0c6){if(_0x5ed0c6&&_0x5ed0c6[_0x2a81('0x22')]){var _0x4033f5=_['first'](_0x5ed0c6);if(_0x4033f5){return BPromise['resolve']({'id':_0x4033f5['Id'],'name':_0x4033f5[_0x2a81('0x37')],'phone':_0x4033f5['Phone'],'endUserType':_0x4033f5[_0x2a81('0x38')][_0x2a81('0x39')][_0x2a81('0x3a')]()});}}})['then'](function(_0x437580){if(_0x437580){logger['info'](_0x2a81('0x3b'),_0x437580[_0x2a81('0x12')],_0x4711ca);return BPromise[_0x2a81('0x25')](_0x437580);}else{logger[_0x2a81('0x1b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4711ca);var _0xd3003d={'Phone':_0x4711ca};if(_0x177459[_0x2a81('0x3c')]){if(_0x177459['moduleCreate']===_0x2a81('0x13')){logger[_0x2a81('0x1b')](_0x2a81('0x3d'),_0x4711ca,_0x177459[_0x2a81('0x3c')]);_0xd3003d[_0x2a81('0x3e')]=_0x12ee5d!==_0x2a81('0x3f')?_0x12ee5d:util[_0x2a81('0x40')](_0x2a81('0x41'),_0x4711ca);}else if(_0x177459[_0x2a81('0x3c')]==='lead'){logger[_0x2a81('0x1b')](_0x2a81('0x3d'),_0x4711ca,_0x177459['moduleCreate']);_0xd3003d['LastName']=_0x12ee5d!==_0x2a81('0x3f')?_0x12ee5d:util['format'](_0x2a81('0x41'),_0x4711ca);_0xd3003d[_0x2a81('0x42')]='No\x20Company';}else if(_0x177459[_0x2a81('0x3c')]===_0x2a81('0x16')){logger['info'](_0x2a81('0x3d'),_0x4711ca,_0x177459[_0x2a81('0x3c')]);_0xd3003d['Name']=_0x12ee5d!==_0x2a81('0x3f')?_0x12ee5d:util['format'](_0x2a81('0x41'),_0x4711ca);}else{return null;}}return _0x368969['sobject'](_[_0x2a81('0x43')](_0x177459[_0x2a81('0x3c')]))[_0x2a81('0x1d')](_0xd3003d)['then'](function(_0x4357e9){return BPromise['resolve']({'id':_0x4357e9['id'],'endUserType':_0x177459[_0x2a81('0x3c')]});});}});}function getCustomFields(_0x1c1eb2,_0x444ebd){var _0x490f82={};if(_0x1c1eb2['length']>0x0){_[_0x2a81('0x44')](_0x1c1eb2,function(_0x2ee0c5){if(_[_0x2a81('0x45')](['string',_0x2a81('0x46')],_0x2ee0c5[_0x2a81('0x39')])&&_0x2ee0c5[_0x2a81('0x47')]){_0x490f82[_0x2ee0c5['idField']]=_0x2ee0c5[_0x2a81('0x48')][_0x2a81('0x49')]();}else if(_0x2ee0c5[_0x2a81('0x39')]===_0x2a81('0x4a')&&_0x2ee0c5[_0x2a81('0x4b')]&&_0x2ee0c5[_0x2a81('0x47')]){_0x444ebd[_0x2ee0c5[_0x2a81('0x4b')]]&&(_0x490f82[_0x2ee0c5[_0x2a81('0x47')]]=_0x444ebd[_0x2ee0c5[_0x2a81('0x4b')]][_0x2a81('0x49')]());}else if(_0x2ee0c5[_0x2a81('0x39')]==='customVariable'&&_0x2ee0c5[_0x2a81('0x4c')]&&_0x2ee0c5[_0x2a81('0x4c')][_0x2a81('0x4d')]&&_0x2ee0c5[_0x2a81('0x47')]){_0x444ebd[_0x2ee0c5[_0x2a81('0x4c')][_0x2a81('0x4d')]['toLowerCase']()]&&(_0x490f82[_0x2ee0c5['idField']]=_0x444ebd[_0x2ee0c5['Variable'][_0x2a81('0x4d')]['toLowerCase']()][_0x2a81('0x49')]());}});}return _0x490f82;}function getConnection(_0x33e82c){var _0x389889=_0x33e82c['password']['concat'](_0x33e82c[_0x2a81('0x4e')]);var _0x2baf11=new jsforce[(_0x2a81('0x4f'))]({'oauth2':{'loginUrl':_0x33e82c[_0x2a81('0x50')]||_0x2a81('0x51'),'clientId':_0x33e82c[_0x2a81('0x52')],'clientSecret':_0x33e82c[_0x2a81('0x53')]}});return _0x2baf11[_0x2a81('0x54')](_0x33e82c[_0x2a81('0x55')],_0x389889)[_0x2a81('0x29')](function(){logger[_0x2a81('0x1b')](_0x2a81('0x56'));return _0x2baf11;});}exports[_0x2a81('0x57')]=function(_0x433b90,_0x1e12be,_0x3aa3f7,_0x5aa937,_0x55a577,_0x198b0b){var _0x260f43,_0x11f47f,_0x4e2149,_0x449c75;_0x198b0b['serverUrl']=intUtil[_0x2a81('0x58')](_0x198b0b[_0x2a81('0x59')]);_0x198b0b[_0x2a81('0x50')]=intUtil[_0x2a81('0x58')](_0x198b0b[_0x2a81('0x50')]);if(_0x55a577&&_0x55a577['monitor_format']){logger[_0x2a81('0x1b')](_0x2a81('0x5a'),_0x2a81('0x5b'));_0x1e12be[_0x2a81('0x5c')]=util[_0x2a81('0x40')](_0x2a81('0x5d'),_0x198b0b[_0x2a81('0x59')],_0x1e12be[_0x2a81('0x5e')],md5(_0x1e12be[_0x2a81('0x5e')]));}else{_0x1e12be[_0x2a81('0x5c')]='';}return getConnection(_0x198b0b)[_0x2a81('0x29')](function(_0x32efa6){_0x449c75=_0x32efa6;return getUser(_0x198b0b,_0x5aa937['email'],_0x449c75);})[_0x2a81('0x29')](function(_0x54fac9){_0x260f43=_0x54fac9;return getEndUser(_0x198b0b,_0x3aa3f7,_0x1e12be[_0x2a81('0x5f')],_0x1e12be[_0x2a81('0x60')],_0x449c75);})[_0x2a81('0x29')](function(_0x3213c0){_0x11f47f=_0x3213c0;return getTicket(_0x198b0b,_0x260f43,_0x11f47f,_0x3aa3f7,_0x1e12be,_0x3aa3f7[_0x2a81('0x61')],_0x449c75,_0x2a81('0x57'));})['then'](function(_0x4867e1){_0x4e2149=_0x4867e1;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x4e2149['id']);logger[_0x2a81('0x1b')](_0x2a81('0x62'),_0x4e2149['id'],_0x5aa937[_0x2a81('0x4d')],_0x198b0b[_0x2a81('0x39')]);switch(_0x198b0b[_0x2a81('0x39')]){case _0x2a81('0x63'):emit(util[_0x2a81('0x40')]('user:%s',_0x5aa937[_0x2a81('0x4d')]),_0x2a81('0x64'),{'recordId':_0x4e2149['id']});break;case'newTab':emit(util[_0x2a81('0x40')](_0x2a81('0x65'),_0x5aa937[_0x2a81('0x4d')]),_0x2a81('0x66'),{'uri':util['format']('%s/%s/e',_0x449c75[_0x2a81('0x67')],_0x4e2149['id'])});break;default:logger['error'](_0x2a81('0x68'));}})[_0x2a81('0x69')](function(_0x4ac918){logger['error'](_0x2a81('0x5a'),_0x4ac918);});};exports['outbound']=function(_0x23184c,_0x200e61,_0xd6744c,_0x135ecc,_0x4bfd4d,_0x4469f5,_0x5c9b4f){var _0x5b7cb8,_0x2c6970,_0x5b170c,_0x20cf8a;_0x4469f5[_0x2a81('0x59')]=intUtil['stripTrailingSlash'](_0x4469f5[_0x2a81('0x59')]);_0x4469f5[_0x2a81('0x50')]=intUtil[_0x2a81('0x58')](_0x4469f5[_0x2a81('0x50')]);if(_0x5c9b4f&&_0x5c9b4f[_0x2a81('0x6a')]&&_0x5c9b4f[_0x2a81('0x6a')]!=='none'){logger[_0x2a81('0x1b')]('[OUTBOUND]',_0x2a81('0x5b'));_0x200e61['recordingURL']=util[_0x2a81('0x40')](_0x2a81('0x5d'),_0x4469f5[_0x2a81('0x59')],_0x200e61[_0x2a81('0x5e')],md5(_0x200e61[_0x2a81('0x5e')]));}return getConnection(_0x4469f5)[_0x2a81('0x29')](function(_0x12352c){_0x20cf8a=_0x12352c;return getUser(_0x4469f5,_0x135ecc[_0x2a81('0x6b')],_0x20cf8a);})['then'](function(_0xd24013){_0x5b7cb8=_0xd24013;return getEndUser(_0x4469f5,_0xd6744c,_0x200e61['destcalleridname'],_0x200e61[_0x2a81('0x6c')],_0x20cf8a);})['then'](function(_0x4bf130){_0x2c6970=_0x4bf130;return getTicket(_0x4469f5,_0x5b7cb8,_0x2c6970,_0xd6744c,_0x200e61,_0xd6744c['Fields'],_0x20cf8a,_0x2a81('0x6d'));})[_0x2a81('0x29')](function(_0x6d6bc3){_0x5b170c=_0x6d6bc3;logger[_0x2a81('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5b170c['id']);logger[_0x2a81('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5b170c['id'],_0x135ecc[_0x2a81('0x4d')],_0x4469f5[_0x2a81('0x39')]);switch(_0x4469f5[_0x2a81('0x39')]){case'integrationTab':emit(util[_0x2a81('0x40')](_0x2a81('0x65'),_0x135ecc[_0x2a81('0x4d')]),'trigger:salesforce:display',{'recordId':_0x5b170c['id']});break;case _0x2a81('0x6e'):emit(util['format'](_0x2a81('0x65'),_0x135ecc[_0x2a81('0x4d')]),_0x2a81('0x66'),{'uri':util[_0x2a81('0x40')](_0x2a81('0x6f'),_0x20cf8a[_0x2a81('0x67')],_0x5b170c['id'])});break;default:logger[_0x2a81('0x70')](_0x2a81('0x71'),_0x2a81('0x72'));}})['catch'](function(_0x4a2fb8){logger[_0x2a81('0x70')](_0x2a81('0x71'),_0x4a2fb8);});};exports[_0x2a81('0x73')]=function(_0xd69830,_0x34f335,_0x1fa8dd,_0x18fca9,_0xdd4dc6,_0x4f339d){var _0x27848a,_0x5adf22,_0x52c217,_0x262c0b;_0x4f339d[_0x2a81('0x59')]=intUtil[_0x2a81('0x58')](_0x4f339d[_0x2a81('0x59')]);_0x4f339d[_0x2a81('0x50')]=intUtil['stripTrailingSlash'](_0x4f339d['remoteUri']);if(_0xdd4dc6&&_0xdd4dc6[_0x2a81('0x74')]){logger[_0x2a81('0x1b')]('['+_0x34f335[_0x2a81('0x75')][_0x2a81('0x76')]()+']',_0x2a81('0x5b'));_0x34f335[_0x2a81('0x5c')]=util['format'](_0x2a81('0x5d'),_0x4f339d[_0x2a81('0x59')],_0x34f335['uniqueid'],md5(_0x34f335[_0x2a81('0x5e')]));}else{_0x34f335[_0x2a81('0x5c')]='';}return getConnection(_0x4f339d)[_0x2a81('0x29')](function(_0x33e90a){_0x262c0b=_0x33e90a;if(!_[_0x2a81('0x1e')](_0x18fca9)){return getUser(_0x4f339d,_0x18fca9['name'],_0x262c0b);}else{return getUser(_0x4f339d,null,_0x262c0b);}})[_0x2a81('0x29')](function(_0x3f75f8){_0x27848a=_0x3f75f8;return getEndUser(_0x4f339d,_0x1fa8dd,_0x34f335['calleridname'],_0x34f335[_0x2a81('0x60')],_0x262c0b);})[_0x2a81('0x29')](function(_0x176ba0){_0x5adf22=_0x176ba0;return getTicket(_0x4f339d,_0x27848a,_0x5adf22,_0x1fa8dd,_0x34f335,_0x1fa8dd[_0x2a81('0x61')],_0x262c0b);})['then'](function(_0xe99cca){_0x52c217=_0xe99cca;logger[_0x2a81('0x1b')]('['+_0x34f335[_0x2a81('0x75')]['toUpperCase']()+_0x2a81('0x77'),_0x52c217['id']);logger[_0x2a81('0x1b')]('['+_0x34f335[_0x2a81('0x75')][_0x2a81('0x76')]()+']\x20Integration\x20account\x20type\x20%s.',_0x4f339d[_0x2a81('0x39')]);})['catch'](function(_0x5e48dd){logger['error']('['+_0x34f335[_0x2a81('0x75')]['toUpperCase']()+']',_0x5e48dd);});}; \ 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 6168d4c..1459642 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 _0x394f=['recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','],\x20getUser\x20crm','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x392d9c,_0x2a679a){var _0x445c1e=function(_0x1a71fb){while(--_0x1a71fb){_0x392d9c['push'](_0x392d9c['shift']());}};_0x445c1e(++_0x2a679a);}(_0x394f,0xeb));var _0xf394=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x394f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf394('0x0'));var Promise=require(_0xf394('0x1'));var rp=require(_0xf394('0x2'));var util=require(_0xf394('0x3'));var md5=require(_0xf394('0x4'));var Redis=require(_0xf394('0x5'));var intUtil=require(_0xf394('0x6'));var config=require(_0xf394('0x7'));var logger=require(_0xf394('0x8'))('servicenow');config[_0xf394('0x9')]=_[_0xf394('0xa')](config['redis'],{'host':_0xf394('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf394('0x9')]));function getAdminUser(_0x4db03e,_0x4f97d9,_0x8cd07a,_0x17ce96,_0x2a87f6,_0x3559b3){return new Promise(function(_0x3d9fa3,_0x246734){var _0x330ded={'method':'GET','uri':_0x17ce96+_0xf394('0xc')+'&'+_0x2a87f6+'&'+_0x3559b3,'auth':_0x4f97d9,'json':!![]};return rp(_0x330ded)[_0xf394('0xd')](function(_0x19d9e5){if(_0x19d9e5[_0xf394('0xe')][_0xf394('0xf')]>0x0){_0x8cd07a[_0xf394('0x10')]=_0x19d9e5[_0xf394('0xe')][0x0][_0xf394('0x11')];}logger[_0xf394('0x12')]('['+[_0x4db03e[_0xf394('0x13')]()]+_0xf394('0x14'),_0x8cd07a);_0x3d9fa3(_0x8cd07a);})[_0xf394('0x15')](function(_0xf728ee){logger[_0xf394('0x16')]('['+[_0x4db03e['toUpperCase']()]+']',_0xf728ee[_0xf394('0x17')]);_0x246734(_0xf728ee[_0xf394('0x17')]);});});}function getUser(_0x1c961c,_0x325072,_0x93e70a,_0x3336cc,_0x15c8aa){return function(_0x580ac6){logger[_0xf394('0x12')]('['+[_0x1c961c[_0xf394('0x13')]()]+_0xf394('0x18'),_0x580ac6);return new Promise(function(_0x18a0b0,_0x5ac6f3){if(intUtil[_0xf394('0x19')](_0x580ac6[_0xf394('0x1a')])){var _0x4ab0f9={'method':_0xf394('0x1b'),'uri':_0x93e70a+_0xf394('0x1c')+_0x580ac6[_0xf394('0x1a')]+'&'+_0x3336cc+'&'+_0x15c8aa,'auth':_0x325072,'json':!![]};logger['info']('['+[_0x1c961c[_0xf394('0x13')]()]+_0xf394('0x1d'),_0x4ab0f9);return rp(_0x4ab0f9)['then'](function(_0x485ef5){logger[_0xf394('0x12')]('['+[_0x1c961c[_0xf394('0x13')]()]+_0xf394('0x1e'),_0x485ef5);if(_0x485ef5[_0xf394('0xe')][_0xf394('0xf')]>0x0&&String(_0x485ef5[_0xf394('0xe')][0x0][_0xf394('0x1f')])==='true'){_0x580ac6[_0xf394('0x20')]=_0x485ef5[_0xf394('0xe')][0x0]['sys_id'];}else{_0x580ac6['userId']=_0x580ac6[_0xf394('0x10')];_0x580ac6[_0xf394('0x1a')]=_0x580ac6['adminEmail'];}logger[_0xf394('0x12')]('['+[_0x1c961c['toUpperCase']()]+_0xf394('0x21'),_0x580ac6);_0x18a0b0(_0x580ac6);})['catch'](function(_0x101b62){logger[_0xf394('0x16')]('['+[_0x1c961c[_0xf394('0x13')]()]+']',_0x101b62['message']);_0x5ac6f3(_0x101b62[_0xf394('0x17')]);});}else{logger[_0xf394('0x12')]('['+[_0x1c961c[_0xf394('0x13')]()]+']\x20using\x20admin\x20profile');_0x580ac6[_0xf394('0x20')]=_0x580ac6['adminId'];_0x580ac6[_0xf394('0x1a')]=_0x580ac6[_0xf394('0x22')];_0x18a0b0(_0x580ac6);}});};}function createEndUser(_0x315137,_0x4facb1,_0x3a9b47,_0x3d7751,_0x5c12b0){logger[_0xf394('0x12')]('['+[_0x315137['toUpperCase']()]+_0xf394('0x23'),_0x3a9b47);return new Promise(function(_0x29e21a,_0x176432){var _0x140d45={'method':_0xf394('0x24'),'uri':_0x3d7751+'sys_user?'+_0x5c12b0,'body':{'user_name':_0x3a9b47[_0xf394('0x25')],'roles':_0xf394('0x26'),'first_name':_0x3a9b47[_0xf394('0x25')],'active':_0xf394('0x27'),'date_format':_0xf394('0x28'),'phone':_0x3a9b47['endUserNumber']},'auth':_0x4facb1,'json':!![]};return rp(_0x140d45)[_0xf394('0xd')](function(_0x4f6539){logger[_0xf394('0x12')]('['+[_0x315137[_0xf394('0x13')]()]+_0xf394('0x29'),_0x4f6539[_0xf394('0xe')]);_0x3a9b47[_0xf394('0x2a')]=_0x4f6539[_0xf394('0xe')][_0xf394('0x11')];_0x29e21a(_0x3a9b47);})[_0xf394('0x15')](function(_0x167905){logger[_0xf394('0x16')]('['+[_0x315137[_0xf394('0x13')]()]+']',_0x167905['message']);_0x176432(_0x167905['message']);});});}function getEndUser(_0x5bb9de,_0x4d33f0,_0xf4edbc,_0x4e5bb2,_0x1160df){return function(_0x1103fd){logger['info']('['+[_0x5bb9de[_0xf394('0x13')]()]+_0xf394('0x2b'),_0x1103fd);return new Promise(function(_0x558137,_0x5098ed){var _0x41d064={'method':_0xf394('0x1b'),'uri':_0xf4edbc+_0xf394('0x2c')+_0x1103fd[_0xf394('0x25')]+'&'+_0x4e5bb2+'&'+_0x1160df,'auth':_0x4d33f0,'json':!![]};return rp(_0x41d064)['then'](function(_0x5a9eac){if(_0x5a9eac['result'][_0xf394('0xf')]>0x0){_0x1103fd[_0xf394('0x2a')]=_0x5a9eac['result'][0x0][_0xf394('0x11')];logger['info']('['+[_0x5bb9de[_0xf394('0x13')]()]+_0xf394('0x2d'),_0x1103fd);_0x558137(_0x1103fd);}else{return createEndUser(_0x5bb9de,_0x4d33f0,_0x1103fd,_0xf4edbc,_0x4e5bb2)[_0xf394('0xd')](function(_0x4025f0){logger[_0xf394('0x12')]('['+[_0x5bb9de['toUpperCase']()]+_0xf394('0x2e'),_0x4025f0);_0x558137(_0x4025f0);});}})['catch'](function(_0x1d3ff8){logger[_0xf394('0x16')]('['+[_0x5bb9de[_0xf394('0x13')]()]+']',_0x1d3ff8['message']);_0x5098ed(_0x1d3ff8[_0xf394('0x17')]);});});};}function getCustomFields(_0x144829,_0x421dd4){var _0x4b2948={};if(_0x144829['length']>0x0){_[_0xf394('0x2f')](_0x144829,function(_0x292ac1){if(_['includes']([_0xf394('0x30'),_0xf394('0x31')],_0x292ac1[_0xf394('0x32')])&&_0x292ac1[_0xf394('0x33')]&&!_0x292ac1[_0xf394('0x34')]){_0x4b2948[_0x292ac1[_0xf394('0x33')][_0xf394('0x35')]()]=_0x292ac1[_0xf394('0x36')]['toString']();}else if(_[_0xf394('0x37')]([_0xf394('0x30'),'picklist'],_0x292ac1[_0xf394('0x32')])&&_0x292ac1['idField']&&_0x292ac1[_0xf394('0x34')]){_0x4b2948[_0x292ac1[_0xf394('0x38')]['toLowerCase']()]=_0x292ac1['content'][_0xf394('0x39')]();}else if(_0x292ac1['type']===_0xf394('0x3a')&&_0x292ac1['variableName']&&_0x292ac1[_0xf394('0x38')]&&_0x292ac1['customField']){_0x4b2948[_0x292ac1['idField'][_0xf394('0x35')]()]=_0x421dd4[_0x292ac1[_0xf394('0x3b')]]['toString']();}else if(_0x292ac1[_0xf394('0x32')]==='customVariable'&&_0x292ac1[_0xf394('0x3c')]&&_0x292ac1[_0xf394('0x3c')][_0xf394('0x3d')]&&_0x292ac1[_0xf394('0x38')]&&_0x292ac1[_0xf394('0x34')]){_0x4b2948[_0x292ac1[_0xf394('0x38')][_0xf394('0x35')]()]=_0x421dd4[_0x292ac1[_0xf394('0x3c')][_0xf394('0x3d')]['toLowerCase']()]['toString']();}});}return _0x4b2948;}function getTicket(_0x559f14,_0x34eacc,_0x265117,_0x1384e0,_0x32914c,_0x9d1081){return function(_0x2ed57b){logger['info']('['+[_0x559f14[_0xf394('0x13')]()]+_0xf394('0x3e'),_0x2ed57b);return new Promise(function(_0x334d67,_0x53916c){var _0xa5f303=_0x559f14[_0xf394('0x35')]()===_0xf394('0x3f')?_0x2ed57b[_0xf394('0x20')]:_0x2ed57b[_0xf394('0x2a')];var _0x8b7187={'method':_0xf394('0x24'),'uri':_0x265117+_0xf394('0x40')+'?'+_0x9d1081,'body':Object[_0xf394('0x41')]({},{'active':_0xf394('0x27'),'caller_id':_0xa5f303,'assigned_to':_0x2ed57b['userId'],'short_description':intUtil[_0xf394('0x42')](_0x1384e0[_0xf394('0x43')],_0x32914c,'\x20'),'description':intUtil[_0xf394('0x42')](_0x1384e0['Descriptions'],_0x32914c,'\x0a')},getCustomFields(_0x1384e0[_0xf394('0x44')],_0x32914c)),'auth':_0x34eacc,'json':!![]};return rp(_0x8b7187)[_0xf394('0xd')](function(_0x177db7){logger[_0xf394('0x12')]('['+[_0x559f14[_0xf394('0x13')]()]+_0xf394('0x45'),_0x177db7[_0xf394('0xe')]);_0x2ed57b[_0xf394('0x46')]=_0x177db7[_0xf394('0xe')][_0xf394('0x11')];_0x2ed57b['ticketNumber']=_0x177db7[_0xf394('0xe')][_0xf394('0x47')];logger['info']('['+[_0x559f14[_0xf394('0x13')]()]+_0xf394('0x48'),_0x2ed57b);_0x334d67(_0x2ed57b);})[_0xf394('0x15')](function(_0x1c4cee){logger[_0xf394('0x16')]('['+[_0x559f14[_0xf394('0x13')]()]+']',_0x1c4cee[_0xf394('0x17')]);_0x53916c(_0x1c4cee[_0xf394('0x17')]);});});};}function createRemoteTag(_0x4db8f5,_0x181449,_0x4f2652,_0x3b5b38){return new Promise(function(_0x387413,_0x1eef4f){var _0x4f6812={'method':_0xf394('0x24'),'uri':_0x4f2652+_0xf394('0x49')+'?'+_0x3b5b38,'body':{'short_description':_0x4db8f5,'global':!![],'active':!![],'name':_0x4db8f5},'auth':_0x181449,'json':!![]};return rp(_0x4f6812)['then'](function(_0x1a4180){var _0x3cd91e=_0x1a4180[_0xf394('0xe')][_0xf394('0x11')];_0x387413(_0x3cd91e);});});}function getRemoteTag(_0x2f1e29,_0x4ccc40,_0x32b84f,_0x50732d,_0x40f111){return new Promise(function(_0x147079,_0x3188e2){var _0x2704aa={'method':'GET','uri':_0x32b84f+_0xf394('0x49')+'?sysparm_query=name%3D'+_0x2f1e29+'&'+_0x50732d,'auth':_0x4ccc40,'json':!![]};return rp(_0x2704aa)[_0xf394('0xd')](function(_0x32c7b9){if(_0x32c7b9[_0xf394('0xe')]['length']>0x0){var _0x222309=_0x32c7b9[_0xf394('0xe')][0x0][_0xf394('0x11')];_0x147079(_0x222309);}else{return createRemoteTag(_0x2f1e29,_0x4ccc40,_0x32b84f,_0x50732d)[_0xf394('0xd')](function(_0x961857){_0x147079(_0x961857);});}});});}function assignTagToIncident(_0x376b96,_0x5304e1,_0x36c6d8,_0x290052,_0x2d6b6e){return new Promise(function(_0x70ae7e,_0x1ed6a0){var _0x4cfc73={'method':_0xf394('0x24'),'uri':_0x36c6d8+'label_entry'+'?'+_0x2d6b6e,'body':{'label':_0x376b96,'table':'incident','id_type':_0xf394('0x4a'),'table_key':_0x290052[_0xf394('0x46')],'title':_0xf394('0x4b')+_0x290052[_0xf394('0x4c')],'id_display':_0x290052[_0xf394('0x4c')]},'auth':_0x5304e1,'json':!![]};return rp(_0x4cfc73)['then'](function(_0x4786b7){_0x70ae7e();})[_0xf394('0x15')](function(){_0x70ae7e();});});}function manageTags(_0x5bdff1,_0x4fa734,_0x3a72f5,_0xe00ab5,_0x2dc509,_0x2fc75b,_0x747896){return new Promise(function(_0x281f0a,_0x40a012){var _0x779a33=[];_0x4fa734['forEach'](function(_0x271357){_0x779a33[_0xf394('0x4d')](getRemoteTag(_0x271357,_0x3a72f5,_0xe00ab5,_0x2fc75b,_0x747896));});return Promise[_0xf394('0x4e')](_0x779a33)[_0xf394('0xd')](function(_0x25f8f6){if(_0x25f8f6[_0xf394('0xf')]){logger[_0xf394('0x12')]('['+[_0x5bdff1[_0xf394('0x13')]()]+_0xf394('0x4f'),_0x25f8f6);var _0x5889ed=[];_0x25f8f6[_0xf394('0x2f')](function(_0x3a2f5d){_0x5889ed['push'](assignTagToIncident(_0x3a2f5d,_0x3a72f5,_0xe00ab5,_0x2dc509,_0x2fc75b));});return Promise['all'](_0x5889ed)[_0xf394('0xd')](function(){_0x281f0a();})[_0xf394('0x15')](function(){_0x281f0a();});}else{_0x281f0a();}});});}function getTags(_0xdb9e67,_0x336290,_0x3b7c9b,_0x4b262d,_0x45a3fa,_0x47a9ee){return function(_0x4cc604){return new Promise(function(_0x2d7ae4,_0x568129){var _0x35cb6b=[];var _0x503024=_0x4b262d[_0xf394('0x50')];if(_0x503024&&_0x503024[_0xf394('0xf')]>0x0){_0x35cb6b=_[_0xf394('0x51')](_0x503024,_0xf394('0x3d'));}if(_0x35cb6b[_0xf394('0xf')]>0x0){return manageTags(_0xdb9e67,_0x35cb6b,_0x336290,_0x3b7c9b,_0x4cc604,_0x45a3fa,_0x47a9ee)['then'](function(){_0x2d7ae4(_0x4cc604);});}else{_0x2d7ae4(_0x4cc604);}});};}function emit(_0x3b1a87,_0x2ec6c8,_0x3d772b){var _0xb682c1='%26sysparm_record_target%3Dincident'+_0xf394('0x52')+_0xf394('0x53')+_0xf394('0x54');var _0x4ddd72={'uri':_0x3b1a87+_0xf394('0x55')+_0x3d772b+_0xb682c1};io['to'](util[_0xf394('0x56')](_0xf394('0x57'),_0x2ec6c8))[_0xf394('0x58')](_0xf394('0x59'),_0x4ddd72);}exports['cs']=function(_0x4ce066,_0x31bc66,_0x1aa17a,_0x391e89,_0x425578,_0x2ddf43,_0xb9fc11,_0x61b8e4){var _0x3bf12e={};var _0x20099a={'user':_0x2ddf43[_0xf394('0x5a')],'pass':_0x2ddf43[_0xf394('0x5b')]};var _0x2b9f13=_0xf394('0x5c');var _0xe947ad=_0xf394('0x5d');_0x2ddf43[_0xf394('0x5e')]=intUtil[_0xf394('0x5f')](_0x2ddf43['remoteUri']);_0x2ddf43[_0xf394('0x60')]=intUtil[_0xf394('0x5f')](_0x2ddf43[_0xf394('0x60')]);var _0x1c325c=util[_0xf394('0x56')](_0xf394('0x61'),_0x2ddf43[_0xf394('0x5e')]);_0x3bf12e['userEmail']=!_[_0xf394('0x62')](_0x391e89)?_0x391e89[_0xf394('0x63')]:null;_0x3bf12e['adminEmail']=_0x2ddf43[_0xf394('0x63')];_0x3bf12e[_0xf394('0x25')]=_0x61b8e4[_0xf394('0x35')]()===_0xf394('0x3f')?_0x31bc66[_0xf394('0x64')]:_0x31bc66[_0xf394('0x65')];_0x3bf12e[_0xf394('0x66')]=_0x61b8e4===_0xf394('0x67')||_0x61b8e4===_0xf394('0x68')?_0xf394('0x67'):'outbound';var _0x43b8e6=util[_0xf394('0x56')](_0xf394('0x69'),_0x2ddf43[_0xf394('0x60')],_0x31bc66[_0xf394('0x6a')],md5(_0x31bc66[_0xf394('0x6a')]));if(_0x425578&&_0x425578[_0xf394('0x6b')]){logger[_0xf394('0x12')](_0xf394('0x6c'),_0xf394('0x6d'));_0x31bc66[_0xf394('0x6e')]=_0x43b8e6;}else if(_0xb9fc11&&_0xb9fc11[_0xf394('0x6f')]&&_0xb9fc11['recordingFormat']!==_0xf394('0x70')){logger[_0xf394('0x12')]('[OUTBOUND]',_0xf394('0x6d'));_0x31bc66[_0xf394('0x6e')]=_0x43b8e6;}else{_0x31bc66[_0xf394('0x6e')]='';}return getAdminUser(_0x61b8e4,_0x20099a,_0x3bf12e,_0x1c325c,_0xe947ad,_0x2b9f13)[_0xf394('0xd')](getUser(_0x61b8e4,_0x20099a,_0x1c325c,_0xe947ad,_0x2b9f13))[_0xf394('0xd')](getEndUser(_0x61b8e4,_0x20099a,_0x1c325c,_0xe947ad,_0x2b9f13))[_0xf394('0xd')](getTicket(_0x61b8e4,_0x20099a,_0x1c325c,_0x1aa17a,_0x31bc66,_0xe947ad))[_0xf394('0xd')](function(_0x1d301e){logger['info'](util[_0xf394('0x56')](_0xf394('0x71'),_0x1d301e[_0xf394('0x46')]));logger[_0xf394('0x12')](util[_0xf394('0x56')](_0xf394('0x72'),_0x61b8e4));if(_0x61b8e4!=='unmanaged'){logger[_0xf394('0x12')]('['+[_0x61b8e4['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2ddf43['remoteUri'],_0x391e89[_0xf394('0x3d')],_0x1d301e[_0xf394('0x46')]);}})[_0xf394('0x15')](function(_0x5e3744){logger[_0xf394('0x16')]('['+[_0x61b8e4[_0xf394('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x5e3744,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe69b=['content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','sys_id','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase'];(function(_0x27f8b8,_0x3f669c){var _0x387713=function(_0x5225fd){while(--_0x5225fd){_0x27f8b8['push'](_0x27f8b8['shift']());}};_0x387713(++_0x3f669c);}(_0xe69b,0x18f));var _0xbe69=function(_0x1c940f,_0x2e8e86){_0x1c940f=_0x1c940f-0x0;var _0x1517fd=_0xe69b[_0x1c940f];return _0x1517fd;};'use strict';var _=require(_0xbe69('0x0'));var Promise=require(_0xbe69('0x1'));var rp=require(_0xbe69('0x2'));var util=require(_0xbe69('0x3'));var md5=require(_0xbe69('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xbe69('0x5'));var logger=require(_0xbe69('0x6'))(_0xbe69('0x7'));config[_0xbe69('0x8')]=_[_0xbe69('0x9')](config[_0xbe69('0x8')],{'host':_0xbe69('0xa'),'port':0x18eb});var io=require(_0xbe69('0xb'))(new Redis(config['redis']));function getAdminUser(_0x11d7c4,_0x5cd9cf,_0x4fbc13,_0x1fbbb1,_0x4a9dce,_0x5ba6e6){return new Promise(function(_0x490ed4,_0x57783f){var _0x857829={'method':_0xbe69('0xc'),'uri':_0x1fbbb1+_0xbe69('0xd')+'&'+_0x4a9dce+'&'+_0x5ba6e6,'auth':_0x5cd9cf,'json':!![]};return rp(_0x857829)[_0xbe69('0xe')](function(_0x4e2369){if(_0x4e2369[_0xbe69('0xf')][_0xbe69('0x10')]>0x0){_0x4fbc13[_0xbe69('0x11')]=_0x4e2369[_0xbe69('0xf')][0x0]['sys_id'];}logger['info']('['+[_0x11d7c4[_0xbe69('0x12')]()]+_0xbe69('0x13'),_0x4fbc13);_0x490ed4(_0x4fbc13);})[_0xbe69('0x14')](function(_0x4d3e47){logger[_0xbe69('0x15')]('['+[_0x11d7c4[_0xbe69('0x12')]()]+']',_0x4d3e47[_0xbe69('0x16')]);_0x57783f(_0x4d3e47[_0xbe69('0x16')]);});});}function getUser(_0x4b3700,_0xb7dbb3,_0x490c0d,_0x487520,_0x2afb87){return function(_0x3f78f0){logger[_0xbe69('0x17')]('['+[_0x4b3700[_0xbe69('0x12')]()]+_0xbe69('0x18'),_0x3f78f0);return new Promise(function(_0x578c6d,_0x242c46){if(intUtil[_0xbe69('0x19')](_0x3f78f0[_0xbe69('0x1a')])){var _0x583728={'method':_0xbe69('0xc'),'uri':_0x490c0d+'sys_user?sysparm_query=email%3D'+_0x3f78f0[_0xbe69('0x1a')]+'&'+_0x487520+'&'+_0x2afb87,'auth':_0xb7dbb3,'json':!![]};logger[_0xbe69('0x17')]('['+[_0x4b3700[_0xbe69('0x12')]()]+_0xbe69('0x1b'),_0x583728);return rp(_0x583728)['then'](function(_0x553c73){logger[_0xbe69('0x17')]('['+[_0x4b3700[_0xbe69('0x12')]()]+_0xbe69('0x1c'),_0x553c73);if(_0x553c73[_0xbe69('0xf')]['length']>0x0&&String(_0x553c73[_0xbe69('0xf')][0x0]['active'])===_0xbe69('0x1d')){_0x3f78f0['userId']=_0x553c73[_0xbe69('0xf')][0x0][_0xbe69('0x1e')];}else{_0x3f78f0[_0xbe69('0x1f')]=_0x3f78f0['adminId'];_0x3f78f0[_0xbe69('0x1a')]=_0x3f78f0[_0xbe69('0x20')];}logger[_0xbe69('0x17')]('['+[_0x4b3700[_0xbe69('0x12')]()]+_0xbe69('0x21'),_0x3f78f0);_0x578c6d(_0x3f78f0);})[_0xbe69('0x14')](function(_0x1f6450){logger[_0xbe69('0x15')]('['+[_0x4b3700[_0xbe69('0x12')]()]+']',_0x1f6450[_0xbe69('0x16')]);_0x242c46(_0x1f6450[_0xbe69('0x16')]);});}else{logger[_0xbe69('0x17')]('['+[_0x4b3700['toUpperCase']()]+_0xbe69('0x22'));_0x3f78f0[_0xbe69('0x1f')]=_0x3f78f0[_0xbe69('0x11')];_0x3f78f0[_0xbe69('0x1a')]=_0x3f78f0[_0xbe69('0x20')];_0x578c6d(_0x3f78f0);}});};}function createEndUser(_0x523663,_0x21afb9,_0x3c3c0f,_0x18fbf2,_0x5aa9dc){logger[_0xbe69('0x17')]('['+[_0x523663[_0xbe69('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x3c3c0f);return new Promise(function(_0x44517f,_0x31875a){var _0x25221d={'method':_0xbe69('0x23'),'uri':_0x18fbf2+_0xbe69('0x24')+_0x5aa9dc,'body':{'user_name':_0x3c3c0f[_0xbe69('0x25')],'roles':_0xbe69('0x26'),'first_name':_0x3c3c0f[_0xbe69('0x25')],'active':_0xbe69('0x1d'),'date_format':_0xbe69('0x27'),'phone':_0x3c3c0f[_0xbe69('0x25')]},'auth':_0x21afb9,'json':!![]};return rp(_0x25221d)[_0xbe69('0xe')](function(_0x60eea7){logger[_0xbe69('0x17')]('['+[_0x523663[_0xbe69('0x12')]()]+_0xbe69('0x28'),_0x60eea7[_0xbe69('0xf')]);_0x3c3c0f[_0xbe69('0x29')]=_0x60eea7[_0xbe69('0xf')][_0xbe69('0x1e')];_0x44517f(_0x3c3c0f);})[_0xbe69('0x14')](function(_0x4976a8){logger[_0xbe69('0x15')]('['+[_0x523663[_0xbe69('0x12')]()]+']',_0x4976a8[_0xbe69('0x16')]);_0x31875a(_0x4976a8[_0xbe69('0x16')]);});});}function getEndUser(_0xa480c4,_0x2316b4,_0xd574ee,_0x2532e6,_0x4bd8bf){return function(_0x2e005b){logger[_0xbe69('0x17')]('['+[_0xa480c4[_0xbe69('0x12')]()]+_0xbe69('0x2a'),_0x2e005b);return new Promise(function(_0x5eca9d,_0x50ebb0){var _0x5c1512={'method':'GET','uri':_0xd574ee+_0xbe69('0x2b')+_0x2e005b[_0xbe69('0x25')]+'&'+_0x2532e6+'&'+_0x4bd8bf,'auth':_0x2316b4,'json':!![]};return rp(_0x5c1512)[_0xbe69('0xe')](function(_0xc70ecd){if(_0xc70ecd[_0xbe69('0xf')][_0xbe69('0x10')]>0x0){_0x2e005b['endUserId']=_0xc70ecd[_0xbe69('0xf')][0x0][_0xbe69('0x1e')];logger[_0xbe69('0x17')]('['+[_0xa480c4[_0xbe69('0x12')]()]+_0xbe69('0x2c'),_0x2e005b);_0x5eca9d(_0x2e005b);}else{return createEndUser(_0xa480c4,_0x2316b4,_0x2e005b,_0xd574ee,_0x2532e6)['then'](function(_0x4686f4){logger[_0xbe69('0x17')]('['+[_0xa480c4[_0xbe69('0x12')]()]+_0xbe69('0x2d'),_0x4686f4);_0x5eca9d(_0x4686f4);});}})[_0xbe69('0x14')](function(_0x5c3bbe){logger['error']('['+[_0xa480c4[_0xbe69('0x12')]()]+']',_0x5c3bbe['message']);_0x50ebb0(_0x5c3bbe[_0xbe69('0x16')]);});});};}function getCustomFields(_0x34ee78,_0x3468ef){var _0x375461={};if(_0x34ee78[_0xbe69('0x10')]>0x0){_['forEach'](_0x34ee78,function(_0x1b62db){if(_[_0xbe69('0x2e')]([_0xbe69('0x2f'),_0xbe69('0x30')],_0x1b62db[_0xbe69('0x31')])&&_0x1b62db[_0xbe69('0x32')]&&!_0x1b62db[_0xbe69('0x33')]){_0x375461[_0x1b62db['nameField'][_0xbe69('0x34')]()]=_0x1b62db[_0xbe69('0x35')][_0xbe69('0x36')]();}else if(_['includes']([_0xbe69('0x2f'),'picklist'],_0x1b62db[_0xbe69('0x31')])&&_0x1b62db[_0xbe69('0x37')]&&_0x1b62db['customField']){_0x375461[_0x1b62db[_0xbe69('0x37')][_0xbe69('0x34')]()]=_0x1b62db['content']['toString']();}else if(_0x1b62db[_0xbe69('0x31')]===_0xbe69('0x38')&&_0x1b62db[_0xbe69('0x39')]&&_0x1b62db['idField']&&_0x1b62db['customField']){_0x375461[_0x1b62db[_0xbe69('0x37')][_0xbe69('0x34')]()]=_0x3468ef[_0x1b62db[_0xbe69('0x39')]][_0xbe69('0x36')]();}else if(_0x1b62db[_0xbe69('0x31')]===_0xbe69('0x3a')&&_0x1b62db[_0xbe69('0x3b')]&&_0x1b62db['Variable'][_0xbe69('0x3c')]&&_0x1b62db[_0xbe69('0x37')]&&_0x1b62db['customField']){_0x375461[_0x1b62db[_0xbe69('0x37')][_0xbe69('0x34')]()]=_0x3468ef[_0x1b62db['Variable'][_0xbe69('0x3c')]['toLowerCase']()]['toString']();}});}return _0x375461;}function getTicket(_0x2897d7,_0x158b4c,_0x45e367,_0x2ea784,_0x4f2867,_0x451fba){return function(_0x2114e6){logger[_0xbe69('0x17')]('['+[_0x2897d7[_0xbe69('0x12')]()]+_0xbe69('0x3d'),_0x2114e6);return new Promise(function(_0x35148e,_0x5152ae){var _0x1344d2=_0x2897d7[_0xbe69('0x34')]()===_0xbe69('0x3e')?_0x2114e6[_0xbe69('0x1f')]:_0x2114e6[_0xbe69('0x29')];var _0xb482e8={'method':_0xbe69('0x23'),'uri':_0x45e367+_0xbe69('0x3f')+'?'+_0x451fba,'body':Object[_0xbe69('0x40')]({},{'active':_0xbe69('0x1d'),'caller_id':_0x1344d2,'assigned_to':_0x2114e6[_0xbe69('0x1f')],'short_description':intUtil[_0xbe69('0x41')](_0x2ea784[_0xbe69('0x42')],_0x4f2867,'\x20'),'description':intUtil[_0xbe69('0x41')](_0x2ea784[_0xbe69('0x43')],_0x4f2867,'\x0a')},getCustomFields(_0x2ea784[_0xbe69('0x44')],_0x4f2867)),'auth':_0x158b4c,'json':!![]};return rp(_0xb482e8)[_0xbe69('0xe')](function(_0x2de1e8){logger[_0xbe69('0x17')]('['+[_0x2897d7[_0xbe69('0x12')]()]+_0xbe69('0x45'),_0x2de1e8[_0xbe69('0xf')]);_0x2114e6[_0xbe69('0x46')]=_0x2de1e8[_0xbe69('0xf')]['sys_id'];_0x2114e6[_0xbe69('0x47')]=_0x2de1e8[_0xbe69('0xf')][_0xbe69('0x48')];logger[_0xbe69('0x17')]('['+[_0x2897d7['toUpperCase']()]+_0xbe69('0x49'),_0x2114e6);_0x35148e(_0x2114e6);})[_0xbe69('0x14')](function(_0x357da6){logger[_0xbe69('0x15')]('['+[_0x2897d7['toUpperCase']()]+']',_0x357da6[_0xbe69('0x16')]);_0x5152ae(_0x357da6['message']);});});};}function createRemoteTag(_0x50a6e8,_0x7a7e79,_0x4fafc2,_0x434857){return new Promise(function(_0x151b46,_0x1754b3){var _0x8e187d={'method':_0xbe69('0x23'),'uri':_0x4fafc2+_0xbe69('0x4a')+'?'+_0x434857,'body':{'short_description':_0x50a6e8,'global':!![],'active':!![],'name':_0x50a6e8},'auth':_0x7a7e79,'json':!![]};return rp(_0x8e187d)[_0xbe69('0xe')](function(_0x44f1d7){var _0x36f7fc=_0x44f1d7[_0xbe69('0xf')][_0xbe69('0x1e')];_0x151b46(_0x36f7fc);});});}function getRemoteTag(_0x298274,_0x168518,_0x25a12a,_0x20ce8c,_0x2575f9){return new Promise(function(_0x551071,_0x51f576){var _0xf63e09={'method':_0xbe69('0xc'),'uri':_0x25a12a+'label'+_0xbe69('0x4b')+_0x298274+'&'+_0x20ce8c,'auth':_0x168518,'json':!![]};return rp(_0xf63e09)[_0xbe69('0xe')](function(_0xcca426){if(_0xcca426[_0xbe69('0xf')][_0xbe69('0x10')]>0x0){var _0x34b319=_0xcca426['result'][0x0]['sys_id'];_0x551071(_0x34b319);}else{return createRemoteTag(_0x298274,_0x168518,_0x25a12a,_0x20ce8c)[_0xbe69('0xe')](function(_0x247ad0){_0x551071(_0x247ad0);});}});});}function assignTagToIncident(_0x3f6c7a,_0x2e5397,_0x2b430d,_0x11cc86,_0xd2798e){return new Promise(function(_0x17dc6b,_0x1ce189){var _0x10e249={'method':_0xbe69('0x23'),'uri':_0x2b430d+_0xbe69('0x4c')+'?'+_0xd2798e,'body':{'label':_0x3f6c7a,'table':_0xbe69('0x3f'),'id_type':'Incident','table_key':_0x11cc86['ticketId'],'title':_0xbe69('0x4d')+_0x11cc86[_0xbe69('0x47')],'id_display':_0x11cc86[_0xbe69('0x47')]},'auth':_0x2e5397,'json':!![]};return rp(_0x10e249)[_0xbe69('0xe')](function(_0x2c2146){_0x17dc6b();})['catch'](function(){_0x17dc6b();});});}function manageTags(_0x477c28,_0x27fbfd,_0x1136eb,_0x122e8c,_0x234220,_0x171846,_0x5286cf){return new Promise(function(_0x1c6f29,_0x1b79d2){var _0x20944b=[];_0x27fbfd[_0xbe69('0x4e')](function(_0x5d8cf5){_0x20944b[_0xbe69('0x4f')](getRemoteTag(_0x5d8cf5,_0x1136eb,_0x122e8c,_0x171846,_0x5286cf));});return Promise['all'](_0x20944b)[_0xbe69('0xe')](function(_0xa5f703){if(_0xa5f703[_0xbe69('0x10')]){logger[_0xbe69('0x17')]('['+[_0x477c28['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xa5f703);var _0x3b3384=[];_0xa5f703[_0xbe69('0x4e')](function(_0x2d40e5){_0x3b3384[_0xbe69('0x4f')](assignTagToIncident(_0x2d40e5,_0x1136eb,_0x122e8c,_0x234220,_0x171846));});return Promise[_0xbe69('0x50')](_0x3b3384)[_0xbe69('0xe')](function(){_0x1c6f29();})[_0xbe69('0x14')](function(){_0x1c6f29();});}else{_0x1c6f29();}});});}function getTags(_0x11d45c,_0xf124bc,_0x4e2e01,_0x59f699,_0xb85ab,_0x1a93cc){return function(_0x1761ab){return new Promise(function(_0x2d806c,_0x333d50){var _0x42d675=[];var _0x1093c3=_0x59f699[_0xbe69('0x51')];if(_0x1093c3&&_0x1093c3[_0xbe69('0x10')]>0x0){_0x42d675=_[_0xbe69('0x52')](_0x1093c3,'name');}if(_0x42d675[_0xbe69('0x10')]>0x0){return manageTags(_0x11d45c,_0x42d675,_0xf124bc,_0x4e2e01,_0x1761ab,_0xb85ab,_0x1a93cc)[_0xbe69('0xe')](function(){_0x2d806c(_0x1761ab);});}else{_0x2d806c(_0x1761ab);}});};}function emit(_0x4a7613,_0x416bba,_0x3099a8){var _0x4d66f7=_0xbe69('0x53')+_0xbe69('0x54')+_0xbe69('0x55')+'%255EORDERBYDESCnumber';var _0x1e2466={'uri':_0x4a7613+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3099a8+_0x4d66f7};io['to'](util['format']('user:%s',_0x416bba))[_0xbe69('0x56')](_0xbe69('0x57'),_0x1e2466);}exports['cs']=function(_0x3d6806,_0x4c9884,_0x1dac6b,_0xae8f7e,_0x5c42b9,_0x45ed2b,_0x224776,_0xae71d5){var _0x46fb5a={};var _0x42e640={'user':_0x45ed2b[_0xbe69('0x58')],'pass':_0x45ed2b[_0xbe69('0x59')]};var _0x16e0d1='sysparm_limit=1';var _0x2c4454=_0xbe69('0x5a');_0x45ed2b[_0xbe69('0x5b')]=intUtil['stripTrailingSlash'](_0x45ed2b[_0xbe69('0x5b')]);_0x45ed2b[_0xbe69('0x5c')]=intUtil[_0xbe69('0x5d')](_0x45ed2b[_0xbe69('0x5c')]);var _0x153a80=util[_0xbe69('0x5e')](_0xbe69('0x5f'),_0x45ed2b[_0xbe69('0x5b')]);_0x46fb5a[_0xbe69('0x1a')]=!_[_0xbe69('0x60')](_0xae8f7e)?_0xae8f7e[_0xbe69('0x61')]:null;_0x46fb5a[_0xbe69('0x20')]=_0x45ed2b[_0xbe69('0x61')];_0x46fb5a[_0xbe69('0x25')]=_0xae71d5['toLowerCase']()===_0xbe69('0x3e')?_0x4c9884[_0xbe69('0x62')]:_0x4c9884['calleridnum'];_0x46fb5a[_0xbe69('0x63')]=_0xae71d5===_0xbe69('0x64')||_0xae71d5===_0xbe69('0x65')?'queue':_0xbe69('0x3e');var _0x10295e=util[_0xbe69('0x5e')](_0xbe69('0x66'),_0x45ed2b[_0xbe69('0x5c')],_0x4c9884[_0xbe69('0x67')],md5(_0x4c9884[_0xbe69('0x67')]));if(_0x5c42b9&&_0x5c42b9[_0xbe69('0x68')]){logger[_0xbe69('0x17')](_0xbe69('0x69'),_0xbe69('0x6a'));_0x4c9884[_0xbe69('0x6b')]=_0x10295e;}else if(_0x224776&&_0x224776[_0xbe69('0x6c')]&&_0x224776['recordingFormat']!=='none'){logger[_0xbe69('0x17')]('[OUTBOUND]',_0xbe69('0x6a'));_0x4c9884[_0xbe69('0x6b')]=_0x10295e;}else{_0x4c9884[_0xbe69('0x6b')]='';}return getAdminUser(_0xae71d5,_0x42e640,_0x46fb5a,_0x153a80,_0x2c4454,_0x16e0d1)[_0xbe69('0xe')](getUser(_0xae71d5,_0x42e640,_0x153a80,_0x2c4454,_0x16e0d1))[_0xbe69('0xe')](getEndUser(_0xae71d5,_0x42e640,_0x153a80,_0x2c4454,_0x16e0d1))[_0xbe69('0xe')](getTicket(_0xae71d5,_0x42e640,_0x153a80,_0x1dac6b,_0x4c9884,_0x2c4454))[_0xbe69('0xe')](function(_0x5e827c){logger['info'](util[_0xbe69('0x5e')](_0xbe69('0x6d'),_0x5e827c['ticketId']));logger['info'](util[_0xbe69('0x5e')](_0xbe69('0x6e'),_0xae71d5));if(_0xae71d5!==_0xbe69('0x65')){logger[_0xbe69('0x17')]('['+[_0xae71d5['toUpperCase']()]+']',_0xbe69('0x6f'));emit(_0x45ed2b[_0xbe69('0x5b')],_0xae8f7e[_0xbe69('0x3c')],_0x5e827c['ticketId']);}})[_0xbe69('0x14')](function(_0x34d84a){logger['error']('['+[_0xae71d5[_0xbe69('0x12')]()]+_0xbe69('0x70'),util['inspect'](_0x34d84a,{'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 e2b1990..a45a1af 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 _0x9b19=['get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','phone_home','[HTTP]','merge','map','string','nameField','customField','toLowerCase','type','variable','custom_fields','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','contacts','charAt','user:%s','catch','error','none','[OUTBOUND]','destcalleridname','destcalleridnum','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','monitor_format','toUpperCase','Inbound','lastevent','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','length','variableName','push','idField','JSON','stringify','Calls','format','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name'];(function(_0x3b90bb,_0x24cb38){var _0x45ef92=function(_0x4472bb){while(--_0x4472bb){_0x3b90bb['push'](_0x3b90bb['shift']());}};_0x45ef92(++_0x24cb38);}(_0x9b19,0x137));var _0x99b1=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9b19[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x99b1('0x0'));var rp=require(_0x99b1('0x1'));var BPromise=require(_0x99b1('0x2'));var md5=require('md5');var util=require(_0x99b1('0x3'));var Redis=require(_0x99b1('0x4'));var intUtil=require(_0x99b1('0x5'));var config=require(_0x99b1('0x6'));var logger=require('../../../../config/logger')(_0x99b1('0x7'));config[_0x99b1('0x8')]=_[_0x99b1('0x9')](config[_0x99b1('0x8')],{'host':_0x99b1('0xa'),'port':0x18eb});var io=require(_0x99b1('0xb'))(new Redis(config[_0x99b1('0x8')]));var def={'method':_0x99b1('0xc'),'json':!![]};function emit(_0x91cfde,_0x1e02b5,_0x320732){io['to'](_0x91cfde)['emit'](_0x1e02b5,_0x320732);}function getTicket(_0x4d8387,_0x4ae84f,_0x2343ee,_0x168baf,_0x32e17c,_0x5acd1a,_0x1d2ee2,_0x5c3d36){logger[_0x99b1('0xd')](_0x99b1('0xe'));var _0x1e9e6a=new Date();var _0x30f569=[{'name':_0x99b1('0xf'),'value':intUtil['getString'](_0x168baf[_0x99b1('0x10')],_0x32e17c,'\x20')},{'name':_0x99b1('0x11'),'value':_0x4ae84f['id']},{'name':_0x99b1('0x12'),'value':_0x4ae84f['id']},{'name':_0x99b1('0x13'),'value':intUtil['getString'](_0x168baf[_0x99b1('0x14')],_0x32e17c,'\x0a')},{'name':'date_start','value':_0x1e9e6a[_0x99b1('0x15')]()['slice'](0x0,0x13)[_0x99b1('0x16')]('T','\x20')},{'name':_0x99b1('0x17'),'value':'0'},{'name':_0x99b1('0x18'),'value':'15'},{'name':_0x99b1('0x19'),'value':_0x2343ee['id']},{'name':'parent_type','value':_0x99b1('0x1a')},{'name':_0x99b1('0x1b'),'value':_0x2343ee[_0x99b1('0xf')]},{'name':'direction','value':_0x5c3d36}];if(_0x5acd1a[_0x99b1('0x1c')]){_['forEach'](_0x5acd1a,function(_0x375240){if(_0x32e17c[_0x375240[_0x99b1('0x1d')]]){_0x30f569[_0x99b1('0x1e')]({'name':_0x375240[_0x99b1('0x1f')],'value':_0x32e17c[_0x375240[_0x99b1('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x99b1('0x20'),'response_type':_0x99b1('0x20'),'rest_data':JSON[_0x99b1('0x21')]({'session':_0x1d2ee2['id'],'module_name':_0x99b1('0x22'),'name_value_list':_0x30f569})}});}function getAuth(_0x1bfd45){return util[_0x99b1('0x23')]('Basic\x20%s',new Buffer(_0x1bfd45[_0x99b1('0x24')]+':X')[_0x99b1('0x25')]('base64'));}function getServerInfo(_0xfd8262){return request({'form':{'method':_0x99b1('0x26'),'input_type':_0x99b1('0x20'),'response_type':_0x99b1('0x20'),'rest_data':JSON[_0x99b1('0x21')]({'session':_0xfd8262['id']})}});}function getUser(_0x393b83,_0x411a09,_0x182ddd){if(!_['isNil'](_0x411a09)){logger[_0x99b1('0xd')](_0x99b1('0x27'),_0x411a09);return request({'form':{'method':_0x99b1('0x28'),'input_type':_0x99b1('0x20'),'response_type':_0x99b1('0x20'),'rest_data':JSON['stringify']({'session':_0x182ddd['id'],'module_name':'Employees','query':util[_0x99b1('0x23')](_0x99b1('0x29'),_0x411a09),'order_by':'','offset':'0','select_fields':['id',_0x99b1('0xf'),_0x99b1('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x99b1('0x2b')](function(_0x4fb0bf){if(_0x4fb0bf[_0x99b1('0x2c')][_0x99b1('0x1c')]){var _0x343996=_[_0x99b1('0x2d')](_0x4fb0bf[_0x99b1('0x2c')],function(_0x3c3bf1){return _0x3c3bf1[_0x99b1('0x2e')][_0x99b1('0x2a')]['value']===_0x411a09;});if(_0x343996){logger[_0x99b1('0xd')](_0x99b1('0x2f'));return BPromise[_0x99b1('0x30')]({'id':_0x343996['name_value_list']['id']['value'],'name':_0x343996['name_value_list'][_0x99b1('0xf')][_0x99b1('0x31')]});}}logger[_0x99b1('0xd')](_0x99b1('0x32'));return BPromise[_0x99b1('0x30')]({'id':_0x182ddd[_0x99b1('0x2e')][_0x99b1('0x33')]['value'],'name':_0x182ddd['name_value_list'][_0x99b1('0x2a')][_0x99b1('0x31')]});});}else{logger['info'](_0x99b1('0x34'));return BPromise[_0x99b1('0x30')]({'id':_0x182ddd[_0x99b1('0x2e')][_0x99b1('0x33')]['value'],'name':_0x182ddd[_0x99b1('0x2e')][_0x99b1('0x2a')][_0x99b1('0x31')]});}}function getEndUser(_0x3a51d9,_0x519efa,_0x2ea14d,_0x27803b){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2ea14d);return request({'form':{'method':_0x99b1('0x28'),'input_type':_0x99b1('0x20'),'response_type':_0x99b1('0x20'),'rest_data':JSON['stringify']({'session':_0x27803b['id'],'module_name':_0x99b1('0x1a'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x2ea14d),'order_by':'','offset':'0','select_fields':['id',_0x99b1('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x99b1('0x2b')](function(_0x36bf37){if(_0x36bf37[_0x99b1('0x2c')][_0x99b1('0x1c')]){var _0x499b27=_[_0x99b1('0x2d')](_0x36bf37[_0x99b1('0x2c')],function(_0x25c6c4){return _0x25c6c4[_0x99b1('0x2e')]['phone_home'][_0x99b1('0x31')]===_0x2ea14d;});if(_0x499b27){logger['info'](_0x99b1('0x35'));return BPromise[_0x99b1('0x30')]({'id':_0x499b27[_0x99b1('0x2e')]['id'][_0x99b1('0x31')],'name':_0x499b27[_0x99b1('0x2e')][_0x99b1('0xf')]['value'],'phone':_0x499b27[_0x99b1('0x2e')]['phone_home'][_0x99b1('0x31')]});}}else{logger[_0x99b1('0xd')](_0x99b1('0x36'));return request({'form':{'method':_0x99b1('0x37'),'input_type':'JSON','response_type':_0x99b1('0x20'),'rest_data':JSON[_0x99b1('0x21')]({'session':_0x27803b['id'],'module_name':'Contacts','name_value_list':[{'name':_0x99b1('0x38'),'value':_0x519efa!==_0x99b1('0x39')?_0x519efa:util[_0x99b1('0x23')](_0x99b1('0x3a'),_0x2ea14d)},{'name':'phone_home','value':_0x2ea14d}]})}})['then'](function(_0xa7db9){logger[_0x99b1('0xd')](_0x99b1('0x3b'));return BPromise[_0x99b1('0x30')]({'id':_0xa7db9['id'],'name':_0xa7db9[_0x99b1('0x2c')][_0x99b1('0x38')][_0x99b1('0x31')],'phone':_0xa7db9[_0x99b1('0x2c')][_0x99b1('0x3c')][_0x99b1('0x31')]});});}});}function request(_0x226ed2){logger['debug'](_0x99b1('0x3d'),JSON['stringify'](_0x226ed2));return rp(_[_0x99b1('0x3e')](def,_0x226ed2));}function getTags(_0x3f39d7,_0xc69118){var _0x2f3149=[];if(_0x3f39d7&&_0x3f39d7[_0x99b1('0x1c')]>0x0){_0x2f3149=_[_0x99b1('0x3f')](_0x3f39d7,_0xc69118);}return _0x2f3149;}function getCustomFields(_0x91db4d,_0x2c4e4a){var _0x40ba11=[];var _0x412fa9={'custom_fields':[]};if(_0x91db4d['length']>0x0){_['forEach'](_0x91db4d,function(_0x48b96f){if(_0x48b96f['type']===_0x99b1('0x40')&&_0x48b96f[_0x99b1('0x41')]&&!_0x48b96f[_0x99b1('0x42')]){_0x412fa9[_0x48b96f[_0x99b1('0x41')][_0x99b1('0x43')]()]=_0x48b96f['content']['toString']();}else if(_0x48b96f['type']==='string'&&_0x48b96f[_0x99b1('0x1f')]&&_0x48b96f[_0x99b1('0x42')]){_0x412fa9['custom_fields'][_0x99b1('0x1e')]({'id':_0x48b96f[_0x99b1('0x1f')],'value':_0x48b96f['content']['toString']()});}else if(_0x48b96f[_0x99b1('0x44')]===_0x99b1('0x45')&&_0x48b96f[_0x99b1('0x1d')]&&_0x48b96f['idField']&&_0x48b96f['customField']){_0x2c4e4a[_0x48b96f[_0x99b1('0x1d')]]&&_0x412fa9[_0x99b1('0x46')][_0x99b1('0x1e')]({'id':_0x48b96f[_0x99b1('0x1f')],'value':_0x2c4e4a[_0x48b96f['variableName']][_0x99b1('0x25')]()});}else if(_0x48b96f[_0x99b1('0x44')]===_0x99b1('0x47')&&_0x48b96f[_0x99b1('0x48')]&&_0x48b96f['Variable'][_0x99b1('0xf')]&&_0x48b96f['idField']&&_0x48b96f['customField']){_0x2c4e4a[_0x48b96f[_0x99b1('0x48')][_0x99b1('0xf')]['toLowerCase']()]&&_0x412fa9[_0x99b1('0x46')]['push']({'id':_0x48b96f[_0x99b1('0x1f')],'value':_0x2c4e4a[_0x48b96f[_0x99b1('0x48')]['name'][_0x99b1('0x43')]()]['toString']()});}});}return _0x412fa9;}function getConnection(_0x1876e8){return request({'method':_0x99b1('0xc'),'form':{'method':_0x99b1('0x49'),'input_type':_0x99b1('0x20'),'response_type':_0x99b1('0x20'),'rest_data':JSON[_0x99b1('0x21')]({'user_auth':{'user_name':_0x1876e8[_0x99b1('0x4a')],'password':_0x1876e8['password'],'encryption':_0x99b1('0x4b')},'application':_0x99b1('0x4c')})}})[_0x99b1('0x2b')](function(_0x324b46){var _0x6e1f65=_0x324b46;if(_0x6e1f65['id']){def[_0x99b1('0x4d')]=_0x6e1f65['id'];return BPromise[_0x99b1('0x30')](_0x6e1f65);}else{throw new Error(util[_0x99b1('0x23')](_0x99b1('0x4e'),_0x1876e8['id']));}});}function setRelationship(_0x17d334,_0x596f8a,_0x1184f5,_0x4dfc55){return request({'form':{'method':_0x99b1('0x4f'),'input_type':_0x99b1('0x20'),'response_type':_0x99b1('0x20'),'rest_data':JSON['stringify']({'session':_0x17d334['id'],'module_name':'Calls','module_id':_0x1184f5['id'],'link_field_name':_0x4dfc55,'related_ids':[_0x596f8a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x99b1('0x50')]=function(_0x4c21b5,_0x540c8f,_0x24d2dc,_0x315300,_0x19cb5b,_0x15e9d3){var _0xfd8daf,_0x12187c,_0x303ac1,_0x360f6a;_0x15e9d3[_0x99b1('0x51')]=intUtil[_0x99b1('0x52')](_0x15e9d3[_0x99b1('0x51')]);_0x15e9d3[_0x99b1('0x53')]=intUtil[_0x99b1('0x52')](_0x15e9d3['serverUrl']);def[_0x99b1('0x54')]=util[_0x99b1('0x23')](_0x99b1('0x55'),_0x15e9d3[_0x99b1('0x51')]);if(_0x19cb5b&&_0x19cb5b['monitor_format']){logger[_0x99b1('0xd')](_0x99b1('0x56'),_0x99b1('0x57'));_0x540c8f[_0x99b1('0x58')]=util[_0x99b1('0x23')](_0x99b1('0x59'),_0x15e9d3[_0x99b1('0x53')],_0x540c8f[_0x99b1('0x5a')],md5(_0x540c8f[_0x99b1('0x5a')]));}else{_0x540c8f['recordingURL']='';}return getConnection(_0x15e9d3)['then'](function(_0x2a1cf2){_0x360f6a=_0x2a1cf2;return getUser(_0x15e9d3,_0x315300[_0x99b1('0xf')],_0x360f6a);})['then'](function(_0x19e618){_0xfd8daf=_0x19e618;logger[_0x99b1('0xd')](_0x99b1('0x5b'),_0xfd8daf['id']);return getEndUser(_0x15e9d3,_0x540c8f[_0x99b1('0x5c')],_0x540c8f[_0x99b1('0x5d')],_0x360f6a);})[_0x99b1('0x2b')](function(_0xf489a6){_0x12187c=_0xf489a6;logger[_0x99b1('0xd')](_0x99b1('0x5e'),_0x12187c['id']);return getTicket(_0x15e9d3,_0xfd8daf,_0x12187c,_0x24d2dc,_0x540c8f,_0x24d2dc[_0x99b1('0x5f')],_0x360f6a,'Inbound');})['then'](function(_0x1a72ab){_0x303ac1=_0x1a72ab;logger[_0x99b1('0xd')]('Ticket\x20created!');logger[_0x99b1('0xd')](_0x99b1('0x60'),_0x303ac1['id']);return setRelationship(_0x360f6a,_0xfd8daf,_0x303ac1,'users');})[_0x99b1('0x2b')](function(){return setRelationship(_0x360f6a,_0x12187c,_0x303ac1,_0x99b1('0x61'));})[_0x99b1('0x2b')](function(){return getServerInfo(_0x360f6a);})[_0x99b1('0x2b')](function(_0x55724d){var _0x38bc53=parseInt(_0x55724d['version'][_0x99b1('0x62')](0x0));var _0x4254d3=util[_0x99b1('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x15e9d3['remoteUri'],_0x303ac1['id']);if(_0x38bc53>0x6){_0x4254d3=util[_0x99b1('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x15e9d3[_0x99b1('0x51')],_0x303ac1['id']);}logger[_0x99b1('0xd')](_0x99b1('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x99b1('0x23')](_0x99b1('0x63'),_0x315300[_0x99b1('0xf')]),'trigger:browser:url',{'uri':_0x4254d3});})[_0x99b1('0x64')](function(_0x5c96de){logger[_0x99b1('0x65')](_0x99b1('0x56'),JSON[_0x99b1('0x21')](_0x5c96de));});};exports['outbound']=function(_0x510128,_0xd95be2,_0x1e7d4f,_0x5ed211,_0x4215cb,_0x327ef4,_0x28b73d){var _0x52bb49,_0x789c72,_0x933a64,_0x32702d;_0x327ef4[_0x99b1('0x51')]=intUtil['stripTrailingSlash'](_0x327ef4['remoteUri']);_0x327ef4[_0x99b1('0x53')]=intUtil['stripTrailingSlash'](_0x327ef4[_0x99b1('0x53')]);def[_0x99b1('0x54')]=util[_0x99b1('0x23')](_0x99b1('0x55'),_0x327ef4[_0x99b1('0x51')]);if(_0x28b73d&&_0x28b73d['recordingFormat']&&_0x28b73d['recordingFormat']!==_0x99b1('0x66')){logger[_0x99b1('0xd')](_0x99b1('0x67'),_0x99b1('0x57'));_0xd95be2[_0x99b1('0x58')]=util['format'](_0x99b1('0x59'),_0x327ef4['serverUrl'],_0xd95be2['uniqueid'],md5(_0xd95be2['uniqueid']));}return getConnection(_0x327ef4)[_0x99b1('0x2b')](function(_0x168661){_0x32702d=_0x168661;return getUser(_0x327ef4,_0x5ed211[_0x99b1('0xf')],_0x32702d);})[_0x99b1('0x2b')](function(_0x337a47){_0x52bb49=_0x337a47;logger[_0x99b1('0xd')](_0x99b1('0x5b'),_0x52bb49['id']);return getEndUser(_0x327ef4,_0xd95be2[_0x99b1('0x68')],_0xd95be2[_0x99b1('0x69')],_0x32702d);})['then'](function(_0x21c2a0){_0x789c72=_0x21c2a0;logger[_0x99b1('0xd')](_0x99b1('0x5e'),_0x789c72['id']);return getTicket(_0x327ef4,_0x52bb49,_0x789c72,_0x1e7d4f,_0xd95be2,_0x1e7d4f[_0x99b1('0x5f')],_0x32702d,'Outbound');})[_0x99b1('0x2b')](function(_0x214c13){_0x933a64=_0x214c13;logger[_0x99b1('0xd')]('Ticket\x20created!');logger[_0x99b1('0xd')](_0x99b1('0x60'),_0x933a64['id']);return setRelationship(_0x32702d,_0x52bb49,_0x933a64,_0x99b1('0x6a'));})[_0x99b1('0x2b')](function(){return setRelationship(_0x32702d,_0x789c72,_0x933a64,_0x99b1('0x61'));})[_0x99b1('0x2b')](function(){return getServerInfo(_0x32702d);})[_0x99b1('0x2b')](function(_0x3cb042){var _0x9e31fe=parseInt(_0x3cb042[_0x99b1('0x6b')][_0x99b1('0x62')](0x0));var _0x145229=util[_0x99b1('0x23')](_0x99b1('0x6c'),_0x327ef4[_0x99b1('0x51')],_0x933a64['id']);if(_0x9e31fe>0x6){_0x145229=util['format'](_0x99b1('0x6d'),_0x327ef4['remoteUri'],_0x933a64['id']);}logger[_0x99b1('0xd')](_0x99b1('0x67'),_0x99b1('0x6e'));emit(util[_0x99b1('0x23')](_0x99b1('0x63'),_0x5ed211[_0x99b1('0xf')]),_0x99b1('0x6f'),{'uri':_0x145229});})[_0x99b1('0x64')](function(_0x45f235){logger['error'](_0x99b1('0x67'),JSON[_0x99b1('0x21')](_0x45f235));});};exports[_0x99b1('0x70')]=function(_0x49c528,_0x496a6c,_0x4f3de7,_0x446653,_0x20a7a5,_0x393d12){var _0x3e690d,_0x40750b,_0xb2f9a3,_0xbd1d0e;_0x393d12[_0x99b1('0x51')]=intUtil['stripTrailingSlash'](_0x393d12[_0x99b1('0x51')]);_0x393d12[_0x99b1('0x53')]=intUtil[_0x99b1('0x52')](_0x393d12[_0x99b1('0x53')]);def[_0x99b1('0x54')]=util[_0x99b1('0x23')](_0x99b1('0x55'),_0x393d12[_0x99b1('0x51')]);if(_0x20a7a5&&_0x20a7a5[_0x99b1('0x71')]){logger[_0x99b1('0xd')]('['+_0x496a6c['lastevent'][_0x99b1('0x72')]()+']',_0x99b1('0x57'));_0x496a6c[_0x99b1('0x58')]=util[_0x99b1('0x23')](_0x99b1('0x59'),_0x393d12[_0x99b1('0x53')],_0x496a6c[_0x99b1('0x5a')],md5(_0x496a6c[_0x99b1('0x5a')]));}else{_0x496a6c['recordingURL']='';}return getConnection(_0x393d12)[_0x99b1('0x2b')](function(_0x310649){_0xbd1d0e=_0x310649;if(!_['isNil'](_0x446653)){return getUser(_0x393d12,_0x446653[_0x99b1('0xf')],_0xbd1d0e);}else{return getUser(_0x393d12,null,_0xbd1d0e);}})[_0x99b1('0x2b')](function(_0x47013a){_0x3e690d=_0x47013a;logger[_0x99b1('0xd')]('The\x20User\x20ID\x20is:',_0x3e690d['id']);return getEndUser(_0x393d12,_0x496a6c[_0x99b1('0x5c')],_0x496a6c[_0x99b1('0x5d')],_0xbd1d0e);})[_0x99b1('0x2b')](function(_0xf97db1){_0x40750b=_0xf97db1;logger[_0x99b1('0xd')](_0x99b1('0x5e'),_0x40750b['id']);return getTicket(_0x393d12,_0x3e690d,_0x40750b,_0x4f3de7,_0x496a6c,_0x4f3de7[_0x99b1('0x5f')],_0xbd1d0e,_0x99b1('0x73'));})[_0x99b1('0x2b')](function(_0x3d0915){_0xb2f9a3=_0x3d0915;logger['info']('Ticket\x20created!');logger[_0x99b1('0xd')](_0x99b1('0x60'),_0xb2f9a3['id']);return setRelationship(_0xbd1d0e,_0x3e690d,_0xb2f9a3,_0x99b1('0x6a'));})['then'](function(){return setRelationship(_0xbd1d0e,_0x40750b,_0xb2f9a3,_0x99b1('0x61'));})['then'](function(){return getServerInfo(_0xbd1d0e);})['catch'](function(_0x2bcb0b){logger[_0x99b1('0x65')]('['+_0x496a6c[_0x99b1('0x74')][_0x99b1('0x72')]()+']',JSON['stringify'](_0x2bcb0b));});}; \ No newline at end of file +var _0x405c=['sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','direction','length','variableName','push','set_entry','JSON','stringify','Calls','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','user_name','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','format','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','debug','[HTTP]','map','forEach','type','string','customField','nameField','idField','custom_fields','content','variable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','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','trigger:browser:url','catch','error','outbound','recordingFormat','none','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger'];(function(_0x4da7a7,_0x2bb063){var _0x16799b=function(_0x55a4d5){while(--_0x55a4d5){_0x4da7a7['push'](_0x4da7a7['shift']());}};_0x16799b(++_0x2bb063);}(_0x405c,0x70));var _0xc405=function(_0x1c7478,_0x371ca5){_0x1c7478=_0x1c7478-0x0;var _0x599ba7=_0x405c[_0x1c7478];return _0x599ba7;};'use strict';var _=require('lodash');var rp=require(_0xc405('0x0'));var BPromise=require(_0xc405('0x1'));var md5=require(_0xc405('0x2'));var util=require(_0xc405('0x3'));var Redis=require(_0xc405('0x4'));var intUtil=require(_0xc405('0x5'));var config=require(_0xc405('0x6'));var logger=require(_0xc405('0x7'))(_0xc405('0x8'));config[_0xc405('0x9')]=_[_0xc405('0xa')](config['redis'],{'host':_0xc405('0xb'),'port':0x18eb});var io=require(_0xc405('0xc'))(new Redis(config['redis']));var def={'method':_0xc405('0xd'),'json':!![]};function emit(_0x1f6225,_0x37aa71,_0xdca799){io['to'](_0x1f6225)[_0xc405('0xe')](_0x37aa71,_0xdca799);}function getTicket(_0x3a1e77,_0x17c2d4,_0x46c976,_0x2f8bd5,_0x5aad41,_0x438a63,_0x5888f7,_0x207849){logger[_0xc405('0xf')](_0xc405('0x10'));var _0x167f19=new Date();var _0x5670e1=[{'name':_0xc405('0x11'),'value':intUtil[_0xc405('0x12')](_0x2f8bd5[_0xc405('0x13')],_0x5aad41,'\x20')},{'name':_0xc405('0x14'),'value':_0x17c2d4['id']},{'name':_0xc405('0x15'),'value':_0x17c2d4['id']},{'name':'description','value':intUtil[_0xc405('0x12')](_0x2f8bd5[_0xc405('0x16')],_0x5aad41,'\x0a')},{'name':'date_start','value':_0x167f19[_0xc405('0x17')]()[_0xc405('0x18')](0x0,0x13)[_0xc405('0x19')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xc405('0x1a'),'value':'15'},{'name':_0xc405('0x1b'),'value':_0x46c976['id']},{'name':_0xc405('0x1c'),'value':_0xc405('0x1d')},{'name':'parent_name','value':_0x46c976[_0xc405('0x11')]},{'name':_0xc405('0x1e'),'value':_0x207849}];if(_0x438a63[_0xc405('0x1f')]){_['forEach'](_0x438a63,function(_0x21ffaa){if(_0x5aad41[_0x21ffaa[_0xc405('0x20')]]){_0x5670e1[_0xc405('0x21')]({'name':_0x21ffaa['idField'],'value':_0x5aad41[_0x21ffaa[_0xc405('0x20')]]});}});}return request({'form':{'method':_0xc405('0x22'),'input_type':_0xc405('0x23'),'response_type':_0xc405('0x23'),'rest_data':JSON[_0xc405('0x24')]({'session':_0x5888f7['id'],'module_name':_0xc405('0x25'),'name_value_list':_0x5670e1})}});}function getAuth(_0x2b7acb){return util['format']('Basic\x20%s',new Buffer(_0x2b7acb[_0xc405('0x26')]+':X')[_0xc405('0x27')](_0xc405('0x28')));}function getServerInfo(_0x31e53e){return request({'form':{'method':_0xc405('0x29'),'input_type':'JSON','response_type':_0xc405('0x23'),'rest_data':JSON['stringify']({'session':_0x31e53e['id']})}});}function getUser(_0xd5cade,_0x21c255,_0xc31d1d){if(!_['isNil'](_0x21c255)){logger[_0xc405('0xf')](_0xc405('0x2a'),_0x21c255);return request({'form':{'method':_0xc405('0x2b'),'input_type':_0xc405('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xc31d1d['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x21c255),'order_by':'','offset':'0','select_fields':['id','name',_0xc405('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x42108f){if(_0x42108f[_0xc405('0x2d')][_0xc405('0x1f')]){var _0xa508e=_['find'](_0x42108f[_0xc405('0x2d')],function(_0x539c0e){return _0x539c0e['name_value_list'][_0xc405('0x2c')][_0xc405('0x2e')]===_0x21c255;});if(_0xa508e){logger[_0xc405('0xf')](_0xc405('0x2f'));return BPromise[_0xc405('0x30')]({'id':_0xa508e[_0xc405('0x31')]['id'][_0xc405('0x2e')],'name':_0xa508e[_0xc405('0x31')][_0xc405('0x11')]['value']});}}logger[_0xc405('0xf')](_0xc405('0x32'));return BPromise[_0xc405('0x30')]({'id':_0xc31d1d['name_value_list']['user_id']['value'],'name':_0xc31d1d[_0xc405('0x31')][_0xc405('0x2c')][_0xc405('0x2e')]});});}else{logger[_0xc405('0xf')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc405('0x30')]({'id':_0xc31d1d[_0xc405('0x31')][_0xc405('0x33')][_0xc405('0x2e')],'name':_0xc31d1d[_0xc405('0x31')][_0xc405('0x2c')]['value']});}}function getEndUser(_0x424f28,_0xe32e7e,_0x38f201,_0x2b3ca8){logger[_0xc405('0xf')](_0xc405('0x34'),_0x38f201);return request({'form':{'method':_0xc405('0x2b'),'input_type':_0xc405('0x23'),'response_type':_0xc405('0x23'),'rest_data':JSON[_0xc405('0x24')]({'session':_0x2b3ca8['id'],'module_name':_0xc405('0x1d'),'query':util[_0xc405('0x35')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x38f201),'order_by':'','offset':'0','select_fields':['id',_0xc405('0x11'),_0xc405('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc405('0x37')](function(_0x406050){if(_0x406050[_0xc405('0x2d')][_0xc405('0x1f')]){var _0x4d686a=_[_0xc405('0x38')](_0x406050['entry_list'],function(_0x1da61e){return _0x1da61e['name_value_list'][_0xc405('0x36')][_0xc405('0x2e')]===_0x38f201;});if(_0x4d686a){logger['info'](_0xc405('0x39'));return BPromise[_0xc405('0x30')]({'id':_0x4d686a[_0xc405('0x31')]['id'][_0xc405('0x2e')],'name':_0x4d686a['name_value_list'][_0xc405('0x11')][_0xc405('0x2e')],'phone':_0x4d686a[_0xc405('0x31')]['phone_home'][_0xc405('0x2e')]});}}else{logger[_0xc405('0xf')](_0xc405('0x3a'));return request({'form':{'method':_0xc405('0x22'),'input_type':_0xc405('0x23'),'response_type':_0xc405('0x23'),'rest_data':JSON[_0xc405('0x24')]({'session':_0x2b3ca8['id'],'module_name':_0xc405('0x1d'),'name_value_list':[{'name':'first_name','value':_0xe32e7e!==_0xc405('0x3b')?_0xe32e7e:util[_0xc405('0x35')](_0xc405('0x3c'),_0x38f201)},{'name':_0xc405('0x36'),'value':_0x38f201}]})}})[_0xc405('0x37')](function(_0x413ae2){logger[_0xc405('0xf')]('Enduser\x20created.');return BPromise[_0xc405('0x30')]({'id':_0x413ae2['id'],'name':_0x413ae2[_0xc405('0x2d')][_0xc405('0x3d')][_0xc405('0x2e')],'phone':_0x413ae2[_0xc405('0x2d')][_0xc405('0x36')][_0xc405('0x2e')]});});}});}function request(_0x1f5823){logger[_0xc405('0x3e')](_0xc405('0x3f'),JSON[_0xc405('0x24')](_0x1f5823));return rp(_['merge'](def,_0x1f5823));}function getTags(_0x25fc40,_0x3bc9ad){var _0x3e5d48=[];if(_0x25fc40&&_0x25fc40[_0xc405('0x1f')]>0x0){_0x3e5d48=_[_0xc405('0x40')](_0x25fc40,_0x3bc9ad);}return _0x3e5d48;}function getCustomFields(_0x5497df,_0x1e32f6){var _0xedd0ff=[];var _0x29d8a0={'custom_fields':[]};if(_0x5497df['length']>0x0){_[_0xc405('0x41')](_0x5497df,function(_0xb817d0){if(_0xb817d0[_0xc405('0x42')]===_0xc405('0x43')&&_0xb817d0['nameField']&&!_0xb817d0[_0xc405('0x44')]){_0x29d8a0[_0xb817d0[_0xc405('0x45')]['toLowerCase']()]=_0xb817d0['content'][_0xc405('0x27')]();}else if(_0xb817d0['type']===_0xc405('0x43')&&_0xb817d0[_0xc405('0x46')]&&_0xb817d0[_0xc405('0x44')]){_0x29d8a0[_0xc405('0x47')]['push']({'id':_0xb817d0[_0xc405('0x46')],'value':_0xb817d0[_0xc405('0x48')][_0xc405('0x27')]()});}else if(_0xb817d0['type']===_0xc405('0x49')&&_0xb817d0[_0xc405('0x20')]&&_0xb817d0[_0xc405('0x46')]&&_0xb817d0[_0xc405('0x44')]){_0x1e32f6[_0xb817d0[_0xc405('0x20')]]&&_0x29d8a0[_0xc405('0x47')][_0xc405('0x21')]({'id':_0xb817d0[_0xc405('0x46')],'value':_0x1e32f6[_0xb817d0[_0xc405('0x20')]][_0xc405('0x27')]()});}else if(_0xb817d0[_0xc405('0x42')]==='customVariable'&&_0xb817d0[_0xc405('0x4a')]&&_0xb817d0[_0xc405('0x4a')][_0xc405('0x11')]&&_0xb817d0['idField']&&_0xb817d0['customField']){_0x1e32f6[_0xb817d0[_0xc405('0x4a')][_0xc405('0x11')][_0xc405('0x4b')]()]&&_0x29d8a0[_0xc405('0x47')][_0xc405('0x21')]({'id':_0xb817d0[_0xc405('0x46')],'value':_0x1e32f6[_0xb817d0[_0xc405('0x4a')][_0xc405('0x11')][_0xc405('0x4b')]()]['toString']()});}});}return _0x29d8a0;}function getConnection(_0x4d7a1f){return request({'method':_0xc405('0xd'),'form':{'method':_0xc405('0x4c'),'input_type':_0xc405('0x23'),'response_type':_0xc405('0x23'),'rest_data':JSON[_0xc405('0x24')]({'user_auth':{'user_name':_0x4d7a1f[_0xc405('0x4d')],'password':_0x4d7a1f[_0xc405('0x4e')],'encryption':_0xc405('0x4f')},'application':_0xc405('0x50')})}})[_0xc405('0x37')](function(_0x5f1205){var _0x169697=_0x5f1205;if(_0x169697['id']){def[_0xc405('0x51')]=_0x169697['id'];return BPromise[_0xc405('0x30')](_0x169697);}else{throw new Error(util[_0xc405('0x35')](_0xc405('0x52'),_0x4d7a1f['id']));}});}function setRelationship(_0x3afe22,_0x11c878,_0x107fb4,_0x55877e){return request({'form':{'method':_0xc405('0x53'),'input_type':'JSON','response_type':_0xc405('0x23'),'rest_data':JSON['stringify']({'session':_0x3afe22['id'],'module_name':_0xc405('0x25'),'module_id':_0x107fb4['id'],'link_field_name':_0x55877e,'related_ids':[_0x11c878['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0xe43db2,_0x48f664,_0x462111,_0x35311f,_0x2ac4c0,_0x4efb09){var _0x1ececf,_0x352b61,_0xba9c1d,_0x5084f7;_0x4efb09[_0xc405('0x54')]=intUtil[_0xc405('0x55')](_0x4efb09[_0xc405('0x54')]);_0x4efb09[_0xc405('0x56')]=intUtil[_0xc405('0x55')](_0x4efb09[_0xc405('0x56')]);def[_0xc405('0x57')]=util[_0xc405('0x35')](_0xc405('0x58'),_0x4efb09[_0xc405('0x54')]);if(_0x2ac4c0&&_0x2ac4c0[_0xc405('0x59')]){logger[_0xc405('0xf')](_0xc405('0x5a'),_0xc405('0x5b'));_0x48f664[_0xc405('0x5c')]=util[_0xc405('0x35')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4efb09[_0xc405('0x56')],_0x48f664['uniqueid'],md5(_0x48f664['uniqueid']));}else{_0x48f664[_0xc405('0x5c')]='';}return getConnection(_0x4efb09)[_0xc405('0x37')](function(_0x2cf5ba){_0x5084f7=_0x2cf5ba;return getUser(_0x4efb09,_0x35311f['name'],_0x5084f7);})[_0xc405('0x37')](function(_0x3ea271){_0x1ececf=_0x3ea271;logger['info']('The\x20User\x20ID\x20is:',_0x1ececf['id']);return getEndUser(_0x4efb09,_0x48f664[_0xc405('0x5d')],_0x48f664[_0xc405('0x5e')],_0x5084f7);})[_0xc405('0x37')](function(_0x351e1f){_0x352b61=_0x351e1f;logger[_0xc405('0xf')](_0xc405('0x5f'),_0x352b61['id']);return getTicket(_0x4efb09,_0x1ececf,_0x352b61,_0x462111,_0x48f664,_0x462111[_0xc405('0x60')],_0x5084f7,'Inbound');})[_0xc405('0x37')](function(_0x2a00ec){_0xba9c1d=_0x2a00ec;logger[_0xc405('0xf')](_0xc405('0x61'));logger[_0xc405('0xf')](_0xc405('0x62'),_0xba9c1d['id']);return setRelationship(_0x5084f7,_0x1ececf,_0xba9c1d,_0xc405('0x63'));})[_0xc405('0x37')](function(){return setRelationship(_0x5084f7,_0x352b61,_0xba9c1d,_0xc405('0x64'));})[_0xc405('0x37')](function(){return getServerInfo(_0x5084f7);})[_0xc405('0x37')](function(_0x22dd35){var _0x16bf09=parseInt(_0x22dd35['version'][_0xc405('0x65')](0x0));var _0x4810d8=util[_0xc405('0x35')](_0xc405('0x66'),_0x4efb09['remoteUri'],_0xba9c1d['id']);if(_0x16bf09>0x6){_0x4810d8=util[_0xc405('0x35')](_0xc405('0x67'),_0x4efb09[_0xc405('0x54')],_0xba9c1d['id']);}logger[_0xc405('0xf')](_0xc405('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x35311f['name']),_0xc405('0x68'),{'uri':_0x4810d8});})[_0xc405('0x69')](function(_0x1aa68a){logger[_0xc405('0x6a')](_0xc405('0x5a'),JSON[_0xc405('0x24')](_0x1aa68a));});};exports[_0xc405('0x6b')]=function(_0x2fb6e6,_0x4705be,_0x46721e,_0x1b366c,_0x42f031,_0x4a8034,_0x2a8a89){var _0x5bfbdc,_0xa74f43,_0x4a7fbd,_0x4c7d91;_0x4a8034[_0xc405('0x54')]=intUtil[_0xc405('0x55')](_0x4a8034['remoteUri']);_0x4a8034[_0xc405('0x56')]=intUtil[_0xc405('0x55')](_0x4a8034[_0xc405('0x56')]);def[_0xc405('0x57')]=util[_0xc405('0x35')](_0xc405('0x58'),_0x4a8034[_0xc405('0x54')]);if(_0x2a8a89&&_0x2a8a89['recordingFormat']&&_0x2a8a89[_0xc405('0x6c')]!==_0xc405('0x6d')){logger[_0xc405('0xf')]('[OUTBOUND]',_0xc405('0x5b'));_0x4705be[_0xc405('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a8034[_0xc405('0x56')],_0x4705be[_0xc405('0x6e')],md5(_0x4705be[_0xc405('0x6e')]));}return getConnection(_0x4a8034)[_0xc405('0x37')](function(_0x3c7819){_0x4c7d91=_0x3c7819;return getUser(_0x4a8034,_0x1b366c[_0xc405('0x11')],_0x4c7d91);})['then'](function(_0x54f52f){_0x5bfbdc=_0x54f52f;logger['info'](_0xc405('0x6f'),_0x5bfbdc['id']);return getEndUser(_0x4a8034,_0x4705be[_0xc405('0x70')],_0x4705be[_0xc405('0x71')],_0x4c7d91);})['then'](function(_0x3ede97){_0xa74f43=_0x3ede97;logger[_0xc405('0xf')]('The\x20Enduser\x20ID\x20is:',_0xa74f43['id']);return getTicket(_0x4a8034,_0x5bfbdc,_0xa74f43,_0x46721e,_0x4705be,_0x46721e[_0xc405('0x60')],_0x4c7d91,'Outbound');})[_0xc405('0x37')](function(_0x4effd2){_0x4a7fbd=_0x4effd2;logger['info'](_0xc405('0x61'));logger[_0xc405('0xf')](_0xc405('0x62'),_0x4a7fbd['id']);return setRelationship(_0x4c7d91,_0x5bfbdc,_0x4a7fbd,'users');})[_0xc405('0x37')](function(){return setRelationship(_0x4c7d91,_0xa74f43,_0x4a7fbd,_0xc405('0x64'));})[_0xc405('0x37')](function(){return getServerInfo(_0x4c7d91);})['then'](function(_0x463044){var _0x1bc586=parseInt(_0x463044['version'][_0xc405('0x65')](0x0));var _0x4cd36a=util['format'](_0xc405('0x66'),_0x4a8034[_0xc405('0x54')],_0x4a7fbd['id']);if(_0x1bc586>0x6){_0x4cd36a=util['format'](_0xc405('0x67'),_0x4a8034[_0xc405('0x54')],_0x4a7fbd['id']);}logger['info'](_0xc405('0x72'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc405('0x35')](_0xc405('0x73'),_0x1b366c['name']),_0xc405('0x68'),{'uri':_0x4cd36a});})['catch'](function(_0xf30764){logger[_0xc405('0x6a')](_0xc405('0x72'),JSON[_0xc405('0x24')](_0xf30764));});};exports[_0xc405('0x74')]=function(_0x12b9ad,_0x49641d,_0x285817,_0xb01d1e,_0x67353c,_0xda9679){var _0x7ae14c,_0x133ba0,_0x2249aa,_0x57574d;_0xda9679['remoteUri']=intUtil[_0xc405('0x55')](_0xda9679[_0xc405('0x54')]);_0xda9679[_0xc405('0x56')]=intUtil['stripTrailingSlash'](_0xda9679[_0xc405('0x56')]);def[_0xc405('0x57')]=util[_0xc405('0x35')](_0xc405('0x58'),_0xda9679[_0xc405('0x54')]);if(_0x67353c&&_0x67353c[_0xc405('0x59')]){logger[_0xc405('0xf')]('['+_0x49641d[_0xc405('0x75')][_0xc405('0x76')]()+']',_0xc405('0x5b'));_0x49641d[_0xc405('0x5c')]=util[_0xc405('0x35')](_0xc405('0x77'),_0xda9679[_0xc405('0x56')],_0x49641d[_0xc405('0x6e')],md5(_0x49641d[_0xc405('0x6e')]));}else{_0x49641d[_0xc405('0x5c')]='';}return getConnection(_0xda9679)[_0xc405('0x37')](function(_0x24e3e0){_0x57574d=_0x24e3e0;if(!_['isNil'](_0xb01d1e)){return getUser(_0xda9679,_0xb01d1e[_0xc405('0x11')],_0x57574d);}else{return getUser(_0xda9679,null,_0x57574d);}})[_0xc405('0x37')](function(_0x19bdcc){_0x7ae14c=_0x19bdcc;logger['info'](_0xc405('0x6f'),_0x7ae14c['id']);return getEndUser(_0xda9679,_0x49641d[_0xc405('0x5d')],_0x49641d[_0xc405('0x5e')],_0x57574d);})[_0xc405('0x37')](function(_0x1eda27){_0x133ba0=_0x1eda27;logger[_0xc405('0xf')](_0xc405('0x5f'),_0x133ba0['id']);return getTicket(_0xda9679,_0x7ae14c,_0x133ba0,_0x285817,_0x49641d,_0x285817[_0xc405('0x60')],_0x57574d,'Inbound');})['then'](function(_0x27884a){_0x2249aa=_0x27884a;logger['info'](_0xc405('0x61'));logger[_0xc405('0xf')](_0xc405('0x62'),_0x2249aa['id']);return setRelationship(_0x57574d,_0x7ae14c,_0x2249aa,_0xc405('0x63'));})[_0xc405('0x37')](function(){return setRelationship(_0x57574d,_0x133ba0,_0x2249aa,'contacts');})[_0xc405('0x37')](function(){return getServerInfo(_0x57574d);})[_0xc405('0x69')](function(_0x1cec94){logger[_0xc405('0x6a')]('['+_0x49641d[_0xc405('0x75')][_0xc405('0x76')]()+']',JSON[_0xc405('0x24')](_0x1cec94));});}; \ 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 88da701..8ff58a3 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 _0x8840=['variableName','push','customVariable','Variable','toLowerCase','name','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','stripTrailingSlash','lastIndexOf','test','util','length','type','string','content'];(function(_0x136f09,_0x17b295){var _0x4778f1=function(_0x1db644){while(--_0x1db644){_0x136f09['push'](_0x136f09['shift']());}};_0x4778f1(++_0x17b295);}(_0x8840,0xe2));var _0x0884=function(_0x3a1bcd,_0x244041){_0x3a1bcd=_0x3a1bcd-0x0;var _0x57422c=_0x8840[_0x3a1bcd];return _0x57422c;};'use strict';var _=require('lodash');var util=require(_0x0884('0x0'));exports['getString']=function(_0x1019ff,_0x24aba0,_0x4168ae){var _0x3e1c2e=[];if(_0x1019ff[_0x0884('0x1')]>0x0){var _0x1eecce=_['sortBy'](_0x1019ff,['id']);for(var _0x381078=0x0;_0x381078<_0x1eecce[_0x0884('0x1')];_0x381078++){var _0x5c38af=_0x1eecce[_0x381078];if(_0x5c38af[_0x0884('0x2')]===_0x0884('0x3')){_0x3e1c2e['push'](_0x5c38af[_0x0884('0x4')]);}else if(_0x5c38af[_0x0884('0x2')]==='variable'&&_0x5c38af['variableName']){_0x24aba0[_0x5c38af[_0x0884('0x5')]]&&_0x3e1c2e[_0x0884('0x6')](_0x24aba0[_0x5c38af[_0x0884('0x5')]]['toString']());}else if(_0x5c38af[_0x0884('0x2')]===_0x0884('0x7')&&_0x5c38af[_0x0884('0x8')]&&_0x5c38af[_0x0884('0x8')]['name']){_0x24aba0[_0x5c38af[_0x0884('0x8')]['name'][_0x0884('0x9')]()]&&_0x3e1c2e[_0x0884('0x6')](_0x24aba0[_0x5c38af['Variable'][_0x0884('0xa')]['toLowerCase']()]['toString']());}else if(_0x5c38af[_0x0884('0x2')]===_0x0884('0xb')){if(_0x5c38af[_0x0884('0xc')]===_0x0884('0x3')&&_0x5c38af[_0x0884('0xd')]){_0x3e1c2e['push'](util[_0x0884('0xe')](_0x0884('0xf'),_0x5c38af[_0x0884('0xd')],_0x5c38af[_0x0884('0x10')]));}else if(_0x5c38af[_0x0884('0xc')]===_0x0884('0x11')&&_0x5c38af[_0x0884('0x5')]&&_0x5c38af[_0x0884('0xd')]){_0x24aba0[_0x5c38af['variableName']]&&_0x3e1c2e[_0x0884('0x6')](util[_0x0884('0xe')](_0x0884('0xf'),_0x5c38af[_0x0884('0xd')],_0x24aba0[_0x5c38af[_0x0884('0x5')]]));}else if(_0x5c38af[_0x0884('0xc')]==='customVariable'&&_0x5c38af['Variable']&&_0x5c38af[_0x0884('0x8')]['name']&&_0x5c38af['key']){_0x24aba0[_0x5c38af['Variable'][_0x0884('0xa')][_0x0884('0x9')]()]&&_0x3e1c2e[_0x0884('0x6')](util[_0x0884('0xe')](_0x0884('0xf'),_0x5c38af[_0x0884('0xd')],_0x24aba0[_0x5c38af['Variable'][_0x0884('0xa')][_0x0884('0x9')]()]));}}}}return _0x3e1c2e['join'](_0x4168ae);};exports[_0x0884('0x12')]=function(_0x37c38a){var _0x4f66f0=_0x37c38a['slice'](-0x1);if(_0x4f66f0==='/'){_0x37c38a=_0x37c38a['substring'](0x0,_0x37c38a[_0x0884('0x13')](_0x4f66f0));}return _0x37c38a;};exports['validateEmail']=function(_0x30074f){if(!_['isNil'](_0x30074f)&&_0x30074f!==''){var _0x2f56bd=/^(([^<>()\[\]\\.,;:\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 _0x2f56bd[_0x0884('0x14')](String(_0x30074f)[_0x0884('0x9')]());}else{return![];}}; \ No newline at end of file +var _0xf461=['toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','keyContent','keyType','%s:\x20%s','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','content','type','variable','variableName','push'];(function(_0x34fabf,_0xc40e2f){var _0x40b3ad=function(_0x2700fd){while(--_0x2700fd){_0x34fabf['push'](_0x34fabf['shift']());}};_0x40b3ad(++_0xc40e2f);}(_0xf461,0x18a));var _0x1f46=function(_0x3973d5,_0x12ed21){_0x3973d5=_0x3973d5-0x0;var _0x3dcd50=_0xf461[_0x3973d5];return _0x3dcd50;};'use strict';var _=require(_0x1f46('0x0'));var util=require(_0x1f46('0x1'));exports[_0x1f46('0x2')]=function(_0x44600a,_0x4a0374,_0x539b5a){var _0x1fd155=[];if(_0x44600a[_0x1f46('0x3')]>0x0){var _0x521973=_[_0x1f46('0x4')](_0x44600a,['id']);for(var _0x374b29=0x0;_0x374b29<_0x521973['length'];_0x374b29++){var _0x169635=_0x521973[_0x374b29];if(_0x169635['type']===_0x1f46('0x5')){_0x1fd155['push'](_0x169635[_0x1f46('0x6')]);}else if(_0x169635[_0x1f46('0x7')]===_0x1f46('0x8')&&_0x169635[_0x1f46('0x9')]){_0x4a0374[_0x169635[_0x1f46('0x9')]]&&_0x1fd155[_0x1f46('0xa')](_0x4a0374[_0x169635[_0x1f46('0x9')]][_0x1f46('0xb')]());}else if(_0x169635[_0x1f46('0x7')]===_0x1f46('0xc')&&_0x169635[_0x1f46('0xd')]&&_0x169635[_0x1f46('0xd')][_0x1f46('0xe')]){_0x4a0374[_0x169635[_0x1f46('0xd')]['name'][_0x1f46('0xf')]()]&&_0x1fd155[_0x1f46('0xa')](_0x4a0374[_0x169635[_0x1f46('0xd')][_0x1f46('0xe')][_0x1f46('0xf')]()]['toString']());}else if(_0x169635[_0x1f46('0x7')]===_0x1f46('0x10')){if(_0x169635['keyType']===_0x1f46('0x5')&&_0x169635[_0x1f46('0x11')]){_0x1fd155[_0x1f46('0xa')](util[_0x1f46('0x12')]('%s:\x20%s',_0x169635[_0x1f46('0x11')],_0x169635[_0x1f46('0x13')]));}else if(_0x169635[_0x1f46('0x14')]===_0x1f46('0x8')&&_0x169635[_0x1f46('0x9')]&&_0x169635[_0x1f46('0x11')]){_0x4a0374[_0x169635[_0x1f46('0x9')]]&&_0x1fd155['push'](util[_0x1f46('0x12')](_0x1f46('0x15'),_0x169635['key'],_0x4a0374[_0x169635[_0x1f46('0x9')]]));}else if(_0x169635['keyType']===_0x1f46('0xc')&&_0x169635['Variable']&&_0x169635[_0x1f46('0xd')][_0x1f46('0xe')]&&_0x169635[_0x1f46('0x11')]){_0x4a0374[_0x169635[_0x1f46('0xd')][_0x1f46('0xe')][_0x1f46('0xf')]()]&&_0x1fd155[_0x1f46('0xa')](util[_0x1f46('0x12')](_0x1f46('0x15'),_0x169635[_0x1f46('0x11')],_0x4a0374[_0x169635[_0x1f46('0xd')][_0x1f46('0xe')][_0x1f46('0xf')]()]));}}}}return _0x1fd155['join'](_0x539b5a);};exports['stripTrailingSlash']=function(_0x1ab4b1){var _0x2bb067=_0x1ab4b1[_0x1f46('0x16')](-0x1);if(_0x2bb067==='/'){_0x1ab4b1=_0x1ab4b1['substring'](0x0,_0x1ab4b1[_0x1f46('0x17')](_0x2bb067));}return _0x1ab4b1;};exports[_0x1f46('0x18')]=function(_0x1b4818){if(!_[_0x1f46('0x19')](_0x1b4818)&&_0x1b4818!==''){var _0x2ea620=/^(([^<>()\[\]\\.,;:\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 _0x2ea620[_0x1f46('0x1a')](String(_0x1b4818)[_0x1f46('0xf')]());}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 efb9057..69383d9 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x5d7545,_0x4bc224){var _0x16a694=function(_0x5cda97){while(--_0x5cda97){_0x5d7545['push'](_0x5d7545['shift']());}};_0x16a694(++_0x4bc224);}(_0x34e8,0x12c));var _0x834e=function(_0x5c0815,_0x5e81bc){_0x5c0815=_0x5c0815-0x0;var _0x4bf351=_0x34e8[_0x5c0815];return _0x4bf351;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +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(_0x1d2b4b,_0x1b8974){var _0x54d25f=function(_0x1008e2){while(--_0x1008e2){_0x1d2b4b['push'](_0x1d2b4b['shift']());}};_0x54d25f(++_0x1b8974);}(_0xe706,0xa3));var _0x6e70=function(_0x13651c,_0x1b81c5){_0x13651c=_0x13651c-0x0;var _0xc6ea66=_0xe706[_0x13651c];return _0xc6ea66;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 6fe0c9f..477c025 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 _0xa673=['[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','Fields','then','ticket','validateEmail','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','%s/search.json','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','password','token','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','string','picklist','nameField','content','includes','type','idField','customField','custom_fields','variable','variableName','customVariable','Variable','push','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x23fcc3,_0x2bae95){var _0x47ebaf=function(_0x5a4bf5){while(--_0x5a4bf5){_0x23fcc3['push'](_0x23fcc3['shift']());}};_0x47ebaf(++_0x2bae95);}(_0xa673,0x8a));var _0x3a67=function(_0x31b6fe,_0x12daa1){_0x31b6fe=_0x31b6fe-0x0;var _0x120a67=_0xa673[_0x31b6fe];return _0x120a67;};'use strict';var _=require(_0x3a67('0x0'));var rp=require('request-promise');var md5=require(_0x3a67('0x1'));var util=require('util');var Redis=require(_0x3a67('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3a67('0x3'))(_0x3a67('0x4'));config[_0x3a67('0x5')]=_[_0x3a67('0x6')](config['redis'],{'host':_0x3a67('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3a67('0x5')]));function emit(_0x534c1f,_0x2f4f6b,_0x45a33b){io['to'](_0x534c1f)['emit'](_0x2f4f6b,_0x45a33b);}var headers={'Content-Type':'application/json','Accept':_0x3a67('0x8')};function getTicket(_0x3a5d7f,_0x532ac7,_0x4b90a9,_0xc713f6,_0x21107a){logger[_0x3a67('0x9')](_0x3a67('0xa'));return request({'uri':util[_0x3a67('0xb')](_0x3a67('0xc'),_0x3a5d7f[_0x3a67('0xd')]),'method':_0x3a67('0xe'),'body':{'ticket':_[_0x3a67('0xf')]({'requester_id':_0x4b90a9['id'],'submitter_id':_0x532ac7?_0x532ac7['id']:undefined,'assignee_id':_0x532ac7?_0x532ac7['id']:undefined,'tags':getTags(_0xc713f6[_0x3a67('0x10')],_0x3a67('0x11')),'subject':intUtil['getString'](_0xc713f6[_0x3a67('0x12')],_0x21107a,'\x20'),'description':intUtil['getString'](_0xc713f6['Descriptions'],_0x21107a,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xc713f6[_0x3a67('0x13')],_0x21107a,'\x0a')}},getCustomFields(_0xc713f6[_0x3a67('0x14')],_0x21107a))}})[_0x3a67('0x15')](function(_0x8cd555){logger[_0x3a67('0x9')]('Ticket\x20created!');return _0x8cd555[_0x3a67('0x16')];});}function getUser(_0x497904,_0x4dbcc6){if(intUtil[_0x3a67('0x17')](_0x4dbcc6)){logger[_0x3a67('0x9')]('Getting\x20agent\x20with\x20email',_0x4dbcc6);return request({'uri':util[_0x3a67('0xb')]('%s/search.json',_0x497904[_0x3a67('0xd')]),'qs':{'query':util[_0x3a67('0xb')]('type:user\x20role:agent\x20email:%s',_0x4dbcc6)}})[_0x3a67('0x15')](function(_0x44f020){if(_0x44f020[_0x3a67('0x18')]){logger['info'](_0x3a67('0x19'));return _[_0x3a67('0x1a')](_0x44f020[_0x3a67('0x1b')],{'email':_0x4dbcc6,'role':_0x3a67('0x1c')});}else{logger[_0x3a67('0x9')](_0x3a67('0x1d'));return request({'uri':util[_0x3a67('0xb')](_0x3a67('0x1e'),_0x497904['remoteUri'])})['then'](function(_0x250e99){logger[_0x3a67('0x9')](_0x3a67('0x1f'));return _0x250e99[_0x3a67('0x20')];});}});}else{logger[_0x3a67('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x3a67('0xb')](_0x3a67('0x1e'),_0x497904[_0x3a67('0xd')])})[_0x3a67('0x15')](function(_0xc6cfde){logger[_0x3a67('0x9')](_0x3a67('0x1f'));return _0xc6cfde[_0x3a67('0x20')];});}}function getEndUser(_0x236d07,_0x595e37,_0xdb3e25){logger[_0x3a67('0x9')]('Searching\x20enduser\x20with\x20phone',_0xdb3e25);return request({'uri':util[_0x3a67('0xb')](_0x3a67('0x21'),_0x236d07[_0x3a67('0xd')]),'qs':{'query':util[_0x3a67('0xb')]('type:user\x20role:end-user\x20phone:%s',_0xdb3e25)}})['then'](function(_0x1cb410){var _0xb03d79;if(_0x1cb410[_0x3a67('0x1b')][_0x3a67('0x22')]){_0x1cb410['results']=_[_0x3a67('0x23')](_0x1cb410[_0x3a67('0x1b')],{'suspended':![],'role':'end-user'});if(_0x1cb410[_0x3a67('0x1b')]['length']){_0xb03d79=_[_0x3a67('0x24')](_0x1cb410['results']);}}if(_0xb03d79){logger[_0x3a67('0x9')]('Enduser\x20found!');return _0xb03d79;}else{logger[_0x3a67('0x9')](_0x3a67('0x25'));return request({'uri':util[_0x3a67('0xb')]('%s/users.json',_0x236d07[_0x3a67('0xd')]),'method':_0x3a67('0xe'),'body':{'user':{'role':'end-user','name':util[_0x3a67('0xb')]('Caller\x20-\x20%s',_0x595e37||_0xdb3e25),'phone':_0xdb3e25}}})[_0x3a67('0x15')](function(_0x58777a){logger['info'](_0x3a67('0x26'));return _0x58777a[_0x3a67('0x20')];});}});}function getAuth(_0x134cb2){var _0x44e820;if(_0x134cb2[_0x3a67('0x27')]==='password'){_0x44e820=util[_0x3a67('0xb')]('%s:%s',_0x134cb2['username'],_0x134cb2[_0x3a67('0x28')]);}else if(_0x134cb2[_0x3a67('0x27')]===_0x3a67('0x29')){_0x44e820=util[_0x3a67('0xb')]('%s/token:%s',_0x134cb2[_0x3a67('0x2a')],_0x134cb2['token']);}return util['format'](_0x3a67('0x2b'),new Buffer(_0x44e820)[_0x3a67('0x2c')](_0x3a67('0x2d')));}function request(_0x35fbda){logger[_0x3a67('0x2e')](_0x3a67('0x2f'),JSON[_0x3a67('0x30')](_0x35fbda));return rp(_[_0x3a67('0x6')](_0x35fbda,{'method':_0x3a67('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x18233d,_0x367f53){var _0xee31f6=[];if(_0x18233d&&_0x18233d[_0x3a67('0x22')]>0x0){_0xee31f6=_[_0x3a67('0x32')](_0x18233d,_0x367f53);}return _0xee31f6;}function getCustomFields(_0x2e3140,_0x203b43){var _0x2a1cb5=[];var _0x487cdd={'custom_fields':[]};if(_0x2e3140[_0x3a67('0x22')]>0x0){_['forEach'](_0x2e3140,function(_0x1067bb){if(_['includes']([_0x3a67('0x33'),_0x3a67('0x34')],_0x1067bb['type'])&&_0x1067bb[_0x3a67('0x35')]&&!_0x1067bb['customField']){_0x487cdd[_0x1067bb['nameField']['toLowerCase']()]=_0x1067bb[_0x3a67('0x36')][_0x3a67('0x2c')]();}else if(_[_0x3a67('0x37')]([_0x3a67('0x33'),_0x3a67('0x34')],_0x1067bb[_0x3a67('0x38')])&&_0x1067bb[_0x3a67('0x39')]&&_0x1067bb[_0x3a67('0x3a')]){_0x487cdd[_0x3a67('0x3b')]['push']({'id':_0x1067bb[_0x3a67('0x39')],'value':_0x1067bb[_0x3a67('0x36')][_0x3a67('0x2c')]()});}else if(_0x1067bb[_0x3a67('0x38')]===_0x3a67('0x3c')&&_0x1067bb[_0x3a67('0x3d')]&&_0x1067bb[_0x3a67('0x39')]&&_0x1067bb['customField']){_0x203b43[_0x1067bb[_0x3a67('0x3d')]]&&_0x487cdd[_0x3a67('0x3b')]['push']({'id':_0x1067bb[_0x3a67('0x39')],'value':_0x203b43[_0x1067bb['variableName']][_0x3a67('0x2c')]()});}else if(_0x1067bb[_0x3a67('0x38')]===_0x3a67('0x3e')&&_0x1067bb[_0x3a67('0x3f')]&&_0x1067bb[_0x3a67('0x3f')]['name']&&_0x1067bb['idField']&&_0x1067bb['customField']){_0x203b43[_0x1067bb[_0x3a67('0x3f')][_0x3a67('0x11')]['toLowerCase']()]&&_0x487cdd[_0x3a67('0x3b')][_0x3a67('0x40')]({'id':_0x1067bb[_0x3a67('0x39')],'value':_0x203b43[_0x1067bb[_0x3a67('0x3f')][_0x3a67('0x11')][_0x3a67('0x41')]()][_0x3a67('0x2c')]()});}});}return _0x487cdd;}exports[_0x3a67('0x42')]=function(_0x3329ad,_0x45686f,_0x397fa3,_0x29d797,_0x39a801,_0x566555){var _0x4855ab,_0x4a51cb;_0x566555[_0x3a67('0xd')]=intUtil[_0x3a67('0x43')](_0x566555[_0x3a67('0xd')]);_0x566555[_0x3a67('0x44')]=intUtil[_0x3a67('0x43')](_0x566555['serverUrl']);if(_0x39a801&&_0x39a801[_0x3a67('0x45')]){logger['info'](_0x3a67('0x46'),_0x3a67('0x47'));_0x45686f['recordingURL']=util['format'](_0x3a67('0x48'),_0x566555['serverUrl'],_0x45686f[_0x3a67('0x49')],md5(_0x45686f[_0x3a67('0x49')]));}else{_0x45686f['recordingURL']='';}headers[_0x3a67('0x4a')]=getAuth(_0x566555);return getUser(_0x566555,_0x29d797[_0x3a67('0x4b')])[_0x3a67('0x15')](function(_0x3a052f){_0x4855ab=_0x3a052f;logger[_0x3a67('0x9')]('The\x20User\x20ID\x20is:',_0x4855ab['id']);return getEndUser(_0x566555,_0x45686f[_0x3a67('0x4c')],_0x45686f[_0x3a67('0x4d')]);})[_0x3a67('0x15')](function(_0x30e69d){_0x4a51cb=_0x30e69d;logger[_0x3a67('0x9')](_0x3a67('0x4e'),_0x4a51cb['id']);return getTicket(_0x566555,_0x4855ab,_0x4a51cb,_0x397fa3,_0x45686f);})[_0x3a67('0x15')](function(_0xedfaa1){if(_0xedfaa1){logger[_0x3a67('0x9')](_0x3a67('0x4f'),_0xedfaa1['id']);switch(_0x566555[_0x3a67('0x38')]){case _0x3a67('0x50'):logger[_0x3a67('0x9')](_0x3a67('0x46'),_0x3a67('0x51'));return request({'uri':util[_0x3a67('0xb')](_0x3a67('0x52'),_0x566555[_0x3a67('0xd')],_0x4855ab['id'],_0xedfaa1['id']),'method':'POST'});case'newTab':logger[_0x3a67('0x9')](_0x3a67('0x46'),_0x3a67('0x53'));emit(util[_0x3a67('0xb')](_0x3a67('0x54'),_0x29d797['name']),_0x3a67('0x55'),{'uri':util[_0x3a67('0xb')]('%s/agent/tickets/%s',_0x566555[_0x3a67('0xd')][_0x3a67('0x56')](_0x3a67('0x57'),''),_0xedfaa1['id'])});break;default:logger[_0x3a67('0x58')](_0x3a67('0x46'),_0x3a67('0x59'));}}})[_0x3a67('0x5a')](function(_0x288086){logger[_0x3a67('0x58')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x3a67('0x5b')](_0x288086,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x212eb0,_0x161174,_0x353c5b,_0x11daf9,_0x5ec95e,_0x910108,_0x209c8e){var _0x44514a,_0x68cb8d;_0x910108[_0x3a67('0xd')]=intUtil[_0x3a67('0x43')](_0x910108[_0x3a67('0xd')]);_0x910108[_0x3a67('0x44')]=intUtil[_0x3a67('0x43')](_0x910108[_0x3a67('0x44')]);if(_0x209c8e&&_0x209c8e[_0x3a67('0x5c')]&&_0x209c8e['recordingFormat']!==_0x3a67('0x5d')){logger[_0x3a67('0x9')](_0x3a67('0x5e'),_0x3a67('0x47'));_0x161174[_0x3a67('0x5f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x910108[_0x3a67('0x44')],_0x161174[_0x3a67('0x49')],md5(_0x161174[_0x3a67('0x49')]));}headers[_0x3a67('0x4a')]=getAuth(_0x910108);return getUser(_0x910108,_0x11daf9['email'])[_0x3a67('0x15')](function(_0x11f016){_0x44514a=_0x11f016;logger['info'](_0x3a67('0x60'),_0x44514a['id']);return getEndUser(_0x910108,_0x161174[_0x3a67('0x61')],_0x161174[_0x3a67('0x62')]);})['then'](function(_0x32b0dc){_0x68cb8d=_0x32b0dc;logger[_0x3a67('0x9')](_0x3a67('0x4e'),_0x68cb8d['id']);return getTicket(_0x910108,_0x44514a,_0x68cb8d,_0x353c5b,_0x161174);})[_0x3a67('0x15')](function(_0x53f617){if(_0x53f617){logger['info']('The\x20Ticket\x20ID\x20is:',_0x53f617['id']);switch(_0x910108['type']){case _0x3a67('0x50'):logger[_0x3a67('0x9')](_0x3a67('0x5e'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3a67('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x910108[_0x3a67('0xd')],_0x44514a['id'],_0x53f617['id']),'method':_0x3a67('0xe')});case'newTab':logger[_0x3a67('0x9')](_0x3a67('0x5e'),_0x3a67('0x53'));emit(util[_0x3a67('0xb')]('user:%s',_0x11daf9[_0x3a67('0x11')]),_0x3a67('0x55'),{'uri':util[_0x3a67('0xb')](_0x3a67('0x63'),_0x910108[_0x3a67('0xd')]['replace']('/api/v2',''),_0x53f617['id'])});break;default:logger[_0x3a67('0x58')]('[OUTBOUND]',_0x3a67('0x59'));}}})[_0x3a67('0x5a')](function(_0xfea8b){logger[_0x3a67('0x58')](_0x3a67('0x64'),util[_0x3a67('0x5b')](_0xfea8b,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x23bb34,_0x187cb5,_0xa5bea9,_0x43e131,_0x58d7af,_0x25b5b3){var _0x24b278,_0x5dbcc1;_0x25b5b3[_0x3a67('0xd')]=intUtil[_0x3a67('0x43')](_0x25b5b3['remoteUri']);_0x25b5b3['serverUrl']=intUtil[_0x3a67('0x43')](_0x25b5b3['serverUrl']);if(_0x58d7af&&_0x58d7af[_0x3a67('0x45')]){logger[_0x3a67('0x9')]('['+_0x187cb5[_0x3a67('0x65')]['toUpperCase']()+']',_0x3a67('0x47'));_0x187cb5[_0x3a67('0x5f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25b5b3['serverUrl'],_0x187cb5[_0x3a67('0x49')],md5(_0x187cb5[_0x3a67('0x49')]));}else{_0x187cb5[_0x3a67('0x5f')]='';}headers[_0x3a67('0x4a')]=getAuth(_0x25b5b3);return getUser(_0x25b5b3)['then'](function(_0x4fce3e){_0x24b278=_0x4fce3e;logger[_0x3a67('0x9')](_0x3a67('0x60'),_0x24b278['id']);return getEndUser(_0x25b5b3,_0x187cb5[_0x3a67('0x4c')],_0x187cb5['calleridnum']);})[_0x3a67('0x15')](function(_0x35a8a5){_0x5dbcc1=_0x35a8a5;logger[_0x3a67('0x9')](_0x3a67('0x4e'),_0x5dbcc1['id']);return getTicket(_0x25b5b3,_0x24b278,_0x5dbcc1,_0xa5bea9,_0x187cb5);})[_0x3a67('0x15')](function(_0x33ad02){if(_0x33ad02){logger[_0x3a67('0x9')](_0x3a67('0x4f'),_0x33ad02['id']);}})['catch'](function(_0x3464c2){logger[_0x3a67('0x58')]('['+_0x187cb5[_0x3a67('0x65')][_0x3a67('0x66')]()+']'+_0x3a67('0x67'),util[_0x3a67('0x5b')](_0x3464c2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x53e7=['push','toString','variable','variableName','customVariable','Variable','custom_fields','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','../../../../config/logger','zendesk','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','base64','debug','stringify','defaults','GET','includes','string','picklist','type','nameField','content','idField','customField'];(function(_0x27f7d9,_0x5cccfe){var _0x160d76=function(_0x2501ac){while(--_0x2501ac){_0x27f7d9['push'](_0x27f7d9['shift']());}};_0x160d76(++_0x5cccfe);}(_0x53e7,0x1da));var _0x753e=function(_0x4e7490,_0x4b26ae){_0x4e7490=_0x4e7490-0x0;var _0x3622d0=_0x53e7[_0x4e7490];return _0x3622d0;};'use strict';var _=require(_0x753e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x753e('0x1'));var Redis=require(_0x753e('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x753e('0x3'))(_0x753e('0x4'));config[_0x753e('0x5')]=_['defaults'](config[_0x753e('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x753e('0x6'))(new Redis(config[_0x753e('0x5')]));function emit(_0x2752a1,_0x1b3efd,_0x42978b){io['to'](_0x2752a1)[_0x753e('0x7')](_0x1b3efd,_0x42978b);}var headers={'Content-Type':_0x753e('0x8'),'Accept':_0x753e('0x8')};function getTicket(_0x42bf42,_0x4e9d85,_0x2ab5d9,_0x12eda9,_0x10427b){logger[_0x753e('0x9')](_0x753e('0xa'));return request({'uri':util[_0x753e('0xb')](_0x753e('0xc'),_0x42bf42[_0x753e('0xd')]),'method':_0x753e('0xe'),'body':{'ticket':_[_0x753e('0xf')]({'requester_id':_0x2ab5d9['id'],'submitter_id':_0x4e9d85?_0x4e9d85['id']:undefined,'assignee_id':_0x4e9d85?_0x4e9d85['id']:undefined,'tags':getTags(_0x12eda9['Tags'],_0x753e('0x10')),'subject':intUtil[_0x753e('0x11')](_0x12eda9[_0x753e('0x12')],_0x10427b,'\x20'),'description':intUtil['getString'](_0x12eda9[_0x753e('0x13')],_0x10427b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x753e('0x11')](_0x12eda9['Descriptions'],_0x10427b,'\x0a')}},getCustomFields(_0x12eda9[_0x753e('0x14')],_0x10427b))}})[_0x753e('0x15')](function(_0x2c7eb8){logger[_0x753e('0x9')](_0x753e('0x16'));return _0x2c7eb8[_0x753e('0x17')];});}function getUser(_0x30537b,_0x2da3f4){if(intUtil[_0x753e('0x18')](_0x2da3f4)){logger['info']('Getting\x20agent\x20with\x20email',_0x2da3f4);return request({'uri':util[_0x753e('0xb')]('%s/search.json',_0x30537b[_0x753e('0xd')]),'qs':{'query':util[_0x753e('0xb')](_0x753e('0x19'),_0x2da3f4)}})[_0x753e('0x15')](function(_0x1fe668){if(_0x1fe668['count']){logger[_0x753e('0x9')](_0x753e('0x1a'));return _[_0x753e('0x1b')](_0x1fe668[_0x753e('0x1c')],{'email':_0x2da3f4,'role':_0x753e('0x1d')});}else{logger['info'](_0x753e('0x1e'));return request({'uri':util[_0x753e('0xb')]('%s/users/me.json',_0x30537b[_0x753e('0xd')])})[_0x753e('0x15')](function(_0x3e2b2e){logger[_0x753e('0x9')](_0x753e('0x1f'));return _0x3e2b2e['user'];});}});}else{logger[_0x753e('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x753e('0x20'),_0x30537b[_0x753e('0xd')])})[_0x753e('0x15')](function(_0x13b2c2){logger[_0x753e('0x9')](_0x753e('0x1f'));return _0x13b2c2['user'];});}}function getEndUser(_0x573266,_0x3f4b0f,_0x294d7c){logger[_0x753e('0x9')]('Searching\x20enduser\x20with\x20phone',_0x294d7c);return request({'uri':util[_0x753e('0xb')]('%s/search.json',_0x573266[_0x753e('0xd')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x294d7c)}})['then'](function(_0x5151a4){var _0x4bda0b;if(_0x5151a4['results'][_0x753e('0x21')]){_0x5151a4[_0x753e('0x1c')]=_[_0x753e('0x22')](_0x5151a4['results'],{'suspended':![],'role':_0x753e('0x23')});if(_0x5151a4[_0x753e('0x1c')][_0x753e('0x21')]){_0x4bda0b=_[_0x753e('0x24')](_0x5151a4['results']);}}if(_0x4bda0b){logger[_0x753e('0x9')](_0x753e('0x25'));return _0x4bda0b;}else{logger[_0x753e('0x9')](_0x753e('0x26'));return request({'uri':util[_0x753e('0xb')](_0x753e('0x27'),_0x573266[_0x753e('0xd')]),'method':'POST','body':{'user':{'role':_0x753e('0x23'),'name':util['format']('Caller\x20-\x20%s',_0x3f4b0f||_0x294d7c),'phone':_0x294d7c}}})[_0x753e('0x15')](function(_0x331628){logger[_0x753e('0x9')](_0x753e('0x28'));return _0x331628['user'];});}});}function getAuth(_0x21c6db){var _0x10bf73;if(_0x21c6db[_0x753e('0x29')]===_0x753e('0x2a')){_0x10bf73=util[_0x753e('0xb')](_0x753e('0x2b'),_0x21c6db[_0x753e('0x2c')],_0x21c6db['password']);}else if(_0x21c6db['authType']===_0x753e('0x2d')){_0x10bf73=util['format'](_0x753e('0x2e'),_0x21c6db[_0x753e('0x2c')],_0x21c6db[_0x753e('0x2d')]);}return util[_0x753e('0xb')](_0x753e('0x2f'),new Buffer(_0x10bf73)['toString'](_0x753e('0x30')));}function request(_0x1e9b15){logger[_0x753e('0x31')]('[HTTP]',JSON[_0x753e('0x32')](_0x1e9b15));return rp(_[_0x753e('0x33')](_0x1e9b15,{'method':_0x753e('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x37c06b,_0x1862f6){var _0x1b9b15=[];if(_0x37c06b&&_0x37c06b[_0x753e('0x21')]>0x0){_0x1b9b15=_['map'](_0x37c06b,_0x1862f6);}return _0x1b9b15;}function getCustomFields(_0x4e758b,_0x2b1829){var _0x247c64=[];var _0x3a87ff={'custom_fields':[]};if(_0x4e758b[_0x753e('0x21')]>0x0){_['forEach'](_0x4e758b,function(_0x47840e){if(_[_0x753e('0x35')]([_0x753e('0x36'),_0x753e('0x37')],_0x47840e[_0x753e('0x38')])&&_0x47840e[_0x753e('0x39')]&&!_0x47840e['customField']){_0x3a87ff[_0x47840e[_0x753e('0x39')]['toLowerCase']()]=_0x47840e[_0x753e('0x3a')]['toString']();}else if(_['includes']([_0x753e('0x36'),_0x753e('0x37')],_0x47840e[_0x753e('0x38')])&&_0x47840e[_0x753e('0x3b')]&&_0x47840e[_0x753e('0x3c')]){_0x3a87ff['custom_fields'][_0x753e('0x3d')]({'id':_0x47840e['idField'],'value':_0x47840e[_0x753e('0x3a')][_0x753e('0x3e')]()});}else if(_0x47840e['type']===_0x753e('0x3f')&&_0x47840e['variableName']&&_0x47840e['idField']&&_0x47840e['customField']){_0x2b1829[_0x47840e[_0x753e('0x40')]]&&_0x3a87ff['custom_fields'][_0x753e('0x3d')]({'id':_0x47840e[_0x753e('0x3b')],'value':_0x2b1829[_0x47840e[_0x753e('0x40')]][_0x753e('0x3e')]()});}else if(_0x47840e[_0x753e('0x38')]===_0x753e('0x41')&&_0x47840e[_0x753e('0x42')]&&_0x47840e['Variable'][_0x753e('0x10')]&&_0x47840e[_0x753e('0x3b')]&&_0x47840e['customField']){_0x2b1829[_0x47840e[_0x753e('0x42')][_0x753e('0x10')]['toLowerCase']()]&&_0x3a87ff[_0x753e('0x43')][_0x753e('0x3d')]({'id':_0x47840e[_0x753e('0x3b')],'value':_0x2b1829[_0x47840e[_0x753e('0x42')][_0x753e('0x10')]['toLowerCase']()][_0x753e('0x3e')]()});}});}return _0x3a87ff;}exports['queue']=function(_0x437167,_0x17d166,_0xfb971e,_0xdaab09,_0x4898ec,_0x38b72a){var _0x3ef972,_0x170330;_0x38b72a[_0x753e('0xd')]=intUtil['stripTrailingSlash'](_0x38b72a[_0x753e('0xd')]);_0x38b72a[_0x753e('0x44')]=intUtil[_0x753e('0x45')](_0x38b72a[_0x753e('0x44')]);if(_0x4898ec&&_0x4898ec['monitor_format']){logger['info'](_0x753e('0x46'),'Recording\x20is\x20enabled!');_0x17d166[_0x753e('0x47')]=util[_0x753e('0xb')](_0x753e('0x48'),_0x38b72a[_0x753e('0x44')],_0x17d166[_0x753e('0x49')],md5(_0x17d166['uniqueid']));}else{_0x17d166[_0x753e('0x47')]='';}headers[_0x753e('0x4a')]=getAuth(_0x38b72a);return getUser(_0x38b72a,_0xdaab09[_0x753e('0x4b')])[_0x753e('0x15')](function(_0x1ea720){_0x3ef972=_0x1ea720;logger[_0x753e('0x9')](_0x753e('0x4c'),_0x3ef972['id']);return getEndUser(_0x38b72a,_0x17d166[_0x753e('0x4d')],_0x17d166[_0x753e('0x4e')]);})[_0x753e('0x15')](function(_0x106d5e){_0x170330=_0x106d5e;logger[_0x753e('0x9')](_0x753e('0x4f'),_0x170330['id']);return getTicket(_0x38b72a,_0x3ef972,_0x170330,_0xfb971e,_0x17d166);})['then'](function(_0x3ea226){if(_0x3ea226){logger[_0x753e('0x9')]('The\x20Ticket\x20ID\x20is:',_0x3ea226['id']);switch(_0x38b72a[_0x753e('0x38')]){case'integrationTab':logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x753e('0xb')](_0x753e('0x50'),_0x38b72a[_0x753e('0xd')],_0x3ef972['id'],_0x3ea226['id']),'method':'POST'});case _0x753e('0x51'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x753e('0x52'),_0xdaab09['name']),_0x753e('0x53'),{'uri':util[_0x753e('0xb')](_0x753e('0x54'),_0x38b72a['remoteUri'][_0x753e('0x55')](_0x753e('0x56'),''),_0x3ea226['id'])});break;default:logger[_0x753e('0x57')](_0x753e('0x46'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x753e('0x58')](function(_0x4e24c6){logger[_0x753e('0x57')](_0x753e('0x59'),util['inspect'](_0x4e24c6,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x768fd7,_0x4444c4,_0x46f136,_0x447422,_0x5185e5,_0x297c68,_0x2363d8){var _0x1566a7,_0xea78c6;_0x297c68[_0x753e('0xd')]=intUtil[_0x753e('0x45')](_0x297c68['remoteUri']);_0x297c68[_0x753e('0x44')]=intUtil[_0x753e('0x45')](_0x297c68[_0x753e('0x44')]);if(_0x2363d8&&_0x2363d8[_0x753e('0x5a')]&&_0x2363d8[_0x753e('0x5a')]!==_0x753e('0x5b')){logger[_0x753e('0x9')](_0x753e('0x5c'),_0x753e('0x5d'));_0x4444c4['recordingURL']=util[_0x753e('0xb')](_0x753e('0x48'),_0x297c68[_0x753e('0x44')],_0x4444c4[_0x753e('0x49')],md5(_0x4444c4[_0x753e('0x49')]));}headers[_0x753e('0x4a')]=getAuth(_0x297c68);return getUser(_0x297c68,_0x447422[_0x753e('0x4b')])[_0x753e('0x15')](function(_0x3371df){_0x1566a7=_0x3371df;logger[_0x753e('0x9')]('The\x20User\x20ID\x20is:',_0x1566a7['id']);return getEndUser(_0x297c68,_0x4444c4[_0x753e('0x5e')],_0x4444c4[_0x753e('0x5f')]);})[_0x753e('0x15')](function(_0x4c4246){_0xea78c6=_0x4c4246;logger[_0x753e('0x9')](_0x753e('0x4f'),_0xea78c6['id']);return getTicket(_0x297c68,_0x1566a7,_0xea78c6,_0x46f136,_0x4444c4);})[_0x753e('0x15')](function(_0x5a4d1f){if(_0x5a4d1f){logger[_0x753e('0x9')](_0x753e('0x60'),_0x5a4d1f['id']);switch(_0x297c68[_0x753e('0x38')]){case _0x753e('0x61'):logger[_0x753e('0x9')](_0x753e('0x5c'),_0x753e('0x62'));return request({'uri':util[_0x753e('0xb')](_0x753e('0x50'),_0x297c68[_0x753e('0xd')],_0x1566a7['id'],_0x5a4d1f['id']),'method':_0x753e('0xe')});case _0x753e('0x51'):logger[_0x753e('0x9')]('[OUTBOUND]',_0x753e('0x63'));emit(util['format'](_0x753e('0x52'),_0x447422['name']),_0x753e('0x53'),{'uri':util[_0x753e('0xb')](_0x753e('0x54'),_0x297c68['remoteUri'][_0x753e('0x55')](_0x753e('0x56'),''),_0x5a4d1f['id'])});break;default:logger[_0x753e('0x57')](_0x753e('0x5c'),_0x753e('0x64'));}}})[_0x753e('0x58')](function(_0x49eec1){logger[_0x753e('0x57')](_0x753e('0x65'),util[_0x753e('0x66')](_0x49eec1,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2d3dfd,_0x50b87a,_0x3aff02,_0xdaf675,_0x35c58d,_0x2fa73e){var _0x3a5c2e,_0x2e292e;_0x2fa73e['remoteUri']=intUtil[_0x753e('0x45')](_0x2fa73e[_0x753e('0xd')]);_0x2fa73e[_0x753e('0x44')]=intUtil[_0x753e('0x45')](_0x2fa73e[_0x753e('0x44')]);if(_0x35c58d&&_0x35c58d[_0x753e('0x67')]){logger[_0x753e('0x9')]('['+_0x50b87a[_0x753e('0x68')][_0x753e('0x69')]()+']',_0x753e('0x5d'));_0x50b87a['recordingURL']=util[_0x753e('0xb')](_0x753e('0x48'),_0x2fa73e[_0x753e('0x44')],_0x50b87a[_0x753e('0x49')],md5(_0x50b87a[_0x753e('0x49')]));}else{_0x50b87a[_0x753e('0x47')]='';}headers['Authorization']=getAuth(_0x2fa73e);return getUser(_0x2fa73e)[_0x753e('0x15')](function(_0x133b3e){_0x3a5c2e=_0x133b3e;logger['info'](_0x753e('0x4c'),_0x3a5c2e['id']);return getEndUser(_0x2fa73e,_0x50b87a[_0x753e('0x4d')],_0x50b87a[_0x753e('0x4e')]);})[_0x753e('0x15')](function(_0x407d3a){_0x2e292e=_0x407d3a;logger['info'](_0x753e('0x4f'),_0x2e292e['id']);return getTicket(_0x2fa73e,_0x3a5c2e,_0x2e292e,_0x3aff02,_0x50b87a);})['then'](function(_0x30baf8){if(_0x30baf8){logger[_0x753e('0x9')]('The\x20Ticket\x20ID\x20is:',_0x30baf8['id']);}})['catch'](function(_0x28ffa2){logger['error']('['+_0x50b87a['lastevent'][_0x753e('0x69')]()+']'+_0x753e('0x6a'),util[_0x753e('0x66')](_0x28ffa2,{'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 59ad56e..77129f6 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 _0x2236=['toUpperCase','calleridname','lodash','md5','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','debug','[HTTP]','length','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.eu','clientId','clientSecret','refresh_token','then','expires_in','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','catch','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','POST','/crm/v2/Calls','Zoho-oauthtoken\x20','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','com','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','user:%s','unmanaged'];(function(_0xee20aa,_0x1259f2){var _0x3dc439=function(_0x38b233){while(--_0x38b233){_0xee20aa['push'](_0xee20aa['shift']());}};_0x3dc439(++_0x1259f2);}(_0x2236,0x12e));var _0x6223=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0x2236[_0x5c846d];return _0xd064e4;};'use strict';var _=require(_0x6223('0x0'));var rp=require('request-promise');var md5=require(_0x6223('0x1'));var util=require('util');var intUtil=require(_0x6223('0x2'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x6223('0x3'));var logger=require(_0x6223('0x4'))('zoho');config[_0x6223('0x5')]=_[_0x6223('0x6')](config[_0x6223('0x5')],{'host':_0x6223('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x54392b,_0xc4f543,_0x346b3b){io['to'](_0x54392b)['emit'](_0xc4f543,_0x346b3b);}function request(_0x470cde){logger[_0x6223('0x8')](_0x6223('0x9'),JSON['stringify'](_0x470cde));return rp(_0x470cde);}function getCustomFields(_0x511a1b,_0x29257e){var _0x4e1388={};if(_0x511a1b[_0x6223('0xa')]>0x0){_['forEach'](_0x511a1b,function(_0x2ee4d7){if(_[_0x6223('0xb')](['string',_0x6223('0xc')],_0x2ee4d7[_0x6223('0xd')])&&_0x2ee4d7[_0x6223('0xe')]){_0x4e1388[_0x2ee4d7[_0x6223('0xe')]]=_0x2ee4d7[_0x6223('0xf')][_0x6223('0x10')]();}else if(_0x2ee4d7[_0x6223('0xd')]===_0x6223('0x11')&&_0x2ee4d7[_0x6223('0x12')]&&_0x2ee4d7[_0x6223('0xe')]&&_0x29257e[_0x2ee4d7[_0x6223('0x12')]]){_0x4e1388[_0x2ee4d7['idField']]=_0x29257e[_0x2ee4d7[_0x6223('0x12')]][_0x6223('0x10')]();}else if(_0x2ee4d7[_0x6223('0xd')]===_0x6223('0x13')&&_0x2ee4d7[_0x6223('0x14')]&&_0x2ee4d7[_0x6223('0x14')]['name']&&_0x2ee4d7[_0x6223('0xe')]&&_0x29257e[_0x2ee4d7[_0x6223('0x14')][_0x6223('0x15')][_0x6223('0x16')]()]){_0x4e1388[_0x2ee4d7[_0x6223('0xe')]]=_0x29257e[_0x2ee4d7[_0x6223('0x14')]['name'][_0x6223('0x16')]()][_0x6223('0x10')]();}});}return _0x4e1388;}function getName(_0x37c6bd){if(_0x37c6bd['indexOf']('\x20')>0x0){var _0x556e1c=_0x37c6bd['split'](/ (.+)/);if(_0x556e1c[0x1]){return _0x556e1c;}}return[_0x37c6bd,_0x37c6bd];}var accountsTokens={};function getAccessToken(_0x4d009c){return new Promise(function(_0x4a6ffa,_0x4b4282){if(!_[_0x6223('0x17')](accountsTokens[_0x4d009c['id']])&&!_['isNil'](accountsTokens[_0x4d009c['id']][_0x6223('0x18')])){if(moment()[_0x6223('0x19')](accountsTokens[_0x4d009c['id']]['expires_in'])){_0x4a6ffa(accountsTokens[_0x4d009c['id']][_0x6223('0x18')]);}}var _0x250505;switch(_0x4d009c[_0x6223('0x1a')]){case'US':_0x250505=_0x6223('0x1b');break;case'AU':_0x250505='https://accounts.zoho.com.au';break;case'EU':_0x250505=_0x6223('0x1c');break;case'IN':_0x250505='https://accounts.zoho.in';break;case'CN':_0x250505='https://accounts.zoho.com.cn';break;default:_0x250505='https://accounts.zoho.eu';break;}var _0x3258ee={'method':'POST','uri':_0x250505+'/oauth/v2/token','qs':{'refresh_token':_0x4d009c['refreshToken'],'client_id':_0x4d009c[_0x6223('0x1d')],'client_secret':_0x4d009c[_0x6223('0x1e')],'grant_type':_0x6223('0x1f')},'json':!![]};return rp(_0x3258ee)[_0x6223('0x20')](function(_0x3c2c9e){accountsTokens[_0x4d009c['id']]={'access_token':_0x3c2c9e[_0x6223('0x18')],'expires_in':moment()['add'](_0x3c2c9e[_0x6223('0x21')],'seconds')};_0x4a6ffa(_0x3c2c9e[_0x6223('0x18')]);})['catch'](function(_0xfbf128){logger[_0x6223('0x22')](_0x6223('0x23'),_0xfbf128[_0x6223('0x24')]);_0x4b4282(_0xfbf128);});});}function getUser(_0x386493,_0xe6e74c,_0x540079,_0xedc7e){logger[_0x6223('0x25')](_0x6223('0x26'));return request({'method':_0x6223('0x27'),'uri':util[_0x6223('0x28')](_0x6223('0x29'),_0xe6e74c),'qs':{'type':_0x6223('0x2a')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x386493},'json':!![]})['then'](function(_0x15e366){if(_0x15e366[_0x6223('0x2b')]){var _0xa15683=-0x1;if(_[_0x6223('0x2c')](_0x15e366[_0x6223('0x2b')])){if(!_[_0x6223('0x17')](_0xedc7e)){_0xa15683=_['findIndex'](_0x15e366[_0x6223('0x2b')],function(_0x3a0a80){return _0x3a0a80[_0x6223('0x2d')]===_0xedc7e;});}if(_0xa15683>=0x0){logger[_0x6223('0x25')]('Agent\x20found!');}else{logger[_0x6223('0x25')](_0x6223('0x2e'));_0xa15683=_[_0x6223('0x2f')](_0x15e366[_0x6223('0x2b')],function(_0x13835a){return _0x13835a[_0x6223('0x30')][_0x6223('0x15')]===_0x6223('0x31');});}return _0x15e366[_0x6223('0x2b')][_0xa15683];}else{if(_0x15e366[_0x6223('0x32')][_0x6223('0x30')][_0x6223('0x15')]==='Administrator'){logger[_0x6223('0x25')](_0x6223('0x2e'));user=_0x15e366[_0x6223('0x32')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x6223('0x33')](_0x15e366));throw new Error(_0x6223('0x34')+JSON[_0x6223('0x33')](_0x15e366));}}}else{logger[_0x6223('0x22')](_0x6223('0x35'),JSON[_0x6223('0x33')](_0x15e366));throw new Error(_0x6223('0x34')+JSON['stringify'](_0x15e366));}})[_0x6223('0x36')](function(_0x8961){console[_0x6223('0x22')](_0x8961);});}function getZohoUser(_0x3c32d1,_0x2147f2){return new BPromise(function(_0x5c8aa2,_0x14c065){request(_0x3c32d1)[_0x6223('0x20')](function(_0x24cbab){var _0x3fc25c=null;if(_0x24cbab){_0x3fc25c=_0x24cbab[_0x6223('0x37')][0x0];_0x3fc25c['enduserType']=_0x2147f2;}_0x5c8aa2(_0x3fc25c);})['catch'](function(_0x588d4f){_0x14c065(_0x588d4f);});});}function createEndUser(_0x52e943,_0x59112a,_0x54c160,_0x175ac0,_0x578b38,_0x518cfa){var _0x54c160=getName(_0x54c160);return request({'method':'POST','uri':_0x6223('0x38')+_0x59112a+_0x6223('0x39')+_[_0x6223('0x3a')](_0x518cfa[_0x6223('0x3b')])+'s','body':{'data':[{'Last_Name':_0x54c160[0x1],'First_Name':_0x54c160[0x0],'Phone':_0x175ac0,'Owner':{'name':!_[_0x6223('0x17')](_0x578b38['role'][_0x6223('0x15')])?_0x578b38[_0x6223('0x3c')][_0x6223('0x15')]:!_[_0x6223('0x17')](_0x578b38[_0x6223('0x3d')])?_0x578b38[_0x6223('0x3d')]+'\x20'+_0x578b38['last_name']:_0x578b38[_0x6223('0x3e')],'id':_0x578b38['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52e943},'json':!![]})[_0x6223('0x20')](function(_0x356993){if(_0x356993&&_0x356993[_0x6223('0x37')][0x0][_0x6223('0x3f')]===_0x6223('0x40')){var _0x53706f=_0x356993['data'][0x0][_0x6223('0x41')];_0x53706f[_0x6223('0x42')]=_[_0x6223('0x3a')](_0x518cfa[_0x6223('0x3b')])+'s';return _0x53706f;}logger[_0x6223('0x22')]('The\x20failing\x20result\x20is',JSON[_0x6223('0x33')](data));throw new Error(_0x6223('0x43')+JSON[_0x6223('0x33')](data));})[_0x6223('0x36')](function(_0x8c3778){console[_0x6223('0x44')](_0x6223('0x45'),_0x8c3778);});}function getEndUser(_0x178726,_0x95fedb,_0x5ea384,_0x1ce3ae,_0x5c63e0,_0x1f115d,_0x251624){var _0x446366={'method':_0x6223('0x27'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x178726},'json':!![]};switch(_0x251624[_0x6223('0x46')]){case _0x6223('0x47'):_0x446366[_0x6223('0x48')]=_0x6223('0x38')+_0x95fedb+_0x6223('0x49')+_0x5c63e0+'))';return getZohoUser(_0x446366,'Contacts')[_0x6223('0x20')](function(_0x13fced){if(_0x13fced)return _0x13fced;_0x446366['uri']=_0x6223('0x38')+_0x95fedb+_0x6223('0x4a')+_0x5c63e0+'))';return getZohoUser(_0x446366,'Leads')[_0x6223('0x20')](function(_0xf42287){if(_0xf42287)return _0xf42287;if(_0x251624['moduleCreate']!=_0x6223('0x4b')){return createEndUser(_0x178726,_0x95fedb,_0x1ce3ae,_0x5c63e0,_0x1f115d,_0x251624);}else{return{};}});});break;case _0x6223('0x4c'):_0x446366[_0x6223('0x48')]=_0x6223('0x38')+_0x95fedb+_0x6223('0x49')+_0x5c63e0+'))';return getZohoUser(_0x446366,'Contacts')[_0x6223('0x20')](function(_0x3f2bd5){if(_0x3f2bd5)return _0x3f2bd5;if(_0x251624[_0x6223('0x3b')]!=_0x6223('0x4b')){return createEndUser(_0x178726,_0x95fedb,_0x1ce3ae,_0x5c63e0,_0x1f115d,_0x251624);}else{return{};}});break;case _0x6223('0x4d'):_0x446366[_0x6223('0x48')]='https://www.zohoapis.'+_0x95fedb+_0x6223('0x4a')+_0x5c63e0+'))';return getZohoUser(_0x446366,_0x6223('0x4e'))[_0x6223('0x20')](function(_0x186825){if(_0x186825)return _0x186825;if(_0x251624[_0x6223('0x3b')]!=_0x6223('0x4b')){return createEndUser(_0x178726,_0x95fedb,_0x1ce3ae,_0x5c63e0,_0x1f115d,_0x251624);}else{return{};}});break;}}function getCall(_0x9c2e3c,_0x1af0e2,_0x5f0b94,_0x4af746,_0x209c4f,_0x242ec3,_0x5caff5,_0x280909){logger['info']('Creating\x20new\x20call...');var _0x1741f5={};_0x1741f5[_0x6223('0x4f')]={'name':!_['isNil'](_0x4af746['role'][_0x6223('0x15')])&&!_[_0x6223('0x17')](_0x4af746[_0x6223('0x30')]['name'])&&_0x4af746[_0x6223('0x30')]['name']===_0x6223('0x50')?_0x4af746[_0x6223('0x3c')]['name']:!_['isNil'](_0x4af746[_0x6223('0x3d')])?_0x4af746['first_name']+'\x20'+_0x4af746[_0x6223('0x3e')]:_0x4af746['last_name'],'id':_0x4af746['id']};_0x1741f5[_0x6223('0x51')]=intUtil[_0x6223('0x52')](_0x242ec3[_0x6223('0x53')],_0x5caff5,'\x20');_0x1741f5[_0x6223('0x54')]=intUtil[_0x6223('0x52')](_0x242ec3[_0x6223('0x55')],_0x5caff5,'\x0a');if(_0x209c4f['enduserType']===_0x6223('0x56')){_0x1741f5[_0x6223('0x57')]={'name':!_[_0x6223('0x17')](_0x209c4f[_0x6223('0x58')])?_0x209c4f[_0x6223('0x58')]:!_[_0x6223('0x17')](_0x209c4f[_0x6223('0x59')])?_0x209c4f['First_Name']+'\x20'+_0x209c4f['Last_Name']:_0x209c4f[_0x6223('0x5a')],'id':_0x209c4f['id']};}if(_0x209c4f[_0x6223('0x42')]==='Leads'){_0x1741f5['What_Id']={'name':!_[_0x6223('0x17')](_0x209c4f[_0x6223('0x58')])?_0x209c4f[_0x6223('0x58')]:!_[_0x6223('0x17')](_0x209c4f[_0x6223('0x59')])?_0x209c4f[_0x6223('0x59')]+'\x20'+_0x209c4f[_0x6223('0x5a')]:_0x209c4f['Last_Name'],'id':_0x209c4f['id']};_0x1741f5['$se_module']=_[_0x6223('0x3a')](_0x209c4f['enduserType']);}if(_0x5caff5[_0x6223('0x5b')]){_0x1741f5[_0x6223('0x5c')]=moment[_0x6223('0x5d')](parseInt(_0x5caff5[_0x6223('0x5b')])*0x3e8)[_0x6223('0x28')]('mm:ss');}else if(_0x5caff5[_0x6223('0x5e')]&&_0x5caff5[_0x6223('0x5f')]){_0x1741f5[_0x6223('0x5c')]=moment['utc'](moment(_0x5caff5[_0x6223('0x5f')],_0x6223('0x60'))[_0x6223('0x61')](moment(_0x5caff5['starttime'],_0x6223('0x60'))))[_0x6223('0x28')](_0x6223('0x62'));}switch(_0x5caff5['lastevent']){case _0x6223('0x63'):_0x1741f5[_0x6223('0x64')]=_0x6223('0x65');break;case _0x6223('0x66'):case _0x6223('0x67'):_0x1741f5[_0x6223('0x64')]=_0x6223('0x68');break;case _0x6223('0x69'):_0x1741f5[_0x6223('0x64')]=_0x6223('0x6a');break;case _0x6223('0x6b'):_0x1741f5[_0x6223('0x64')]='Abandoned';break;case _0x6223('0x6c'):_0x1741f5['Call_Result']=_0x6223('0x6d');default:}_0x1741f5[_0x6223('0x6e')]=(_0x280909===_0x6223('0x6f')?moment(_0x5caff5[_0x6223('0x70')])[_0x6223('0x28')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5caff5[_0x6223('0x71')])['format'](_0x6223('0x60')))||moment()[_0x6223('0x28')]('YYYY-MM-DDTHH:mm:ss');_0x1741f5[_0x6223('0x72')]=_0x280909||_0x6223('0x73');_0x1741f5=_[_0x6223('0x74')](_0x1741f5,getCustomFields(_0x242ec3['Fields'],_0x5caff5));return request({'method':_0x6223('0x75'),'uri':_0x6223('0x38')+_0x1af0e2+_0x6223('0x76'),'headers':{'Authorization':_0x6223('0x77')+_0x9c2e3c},'body':{'data':[_0x1741f5]},'json':!![]})[_0x6223('0x20')](function(_0x40effa){if(_0x40effa&&_0x40effa[_0x6223('0x37')][0x0][_0x6223('0x3f')]===_0x6223('0x40')){logger[_0x6223('0x25')](_0x6223('0x78'));return{'id':_0x40effa['data'][0x0][_0x6223('0x41')]['id']};}})[_0x6223('0x36')](function(_0x5d9b3c){logger[_0x6223('0x25')](_0x6223('0x79'),_0x5d9b3c[_0x6223('0x24')]);console[_0x6223('0x44')](_0x6223('0x79'),_0x5d9b3c);});}exports[_0x6223('0x7a')]=function(_0x2c10b6,_0x333044,_0x2b64a0,_0x138508,_0x5c07ad,_0x4b6ba9){var _0x560fe8,_0x230ceb,_0x2b0929;_0x4b6ba9[_0x6223('0x7b')]=intUtil[_0x6223('0x7c')](_0x4b6ba9[_0x6223('0x7b')]);_0x4b6ba9[_0x6223('0x7d')]=intUtil[_0x6223('0x7c')](_0x4b6ba9[_0x6223('0x7d')]);if(_0x5c07ad&&_0x5c07ad[_0x6223('0x7e')]){logger[_0x6223('0x25')](_0x6223('0x7f'),'Recording\x20is\x20enabled!');_0x333044[_0x6223('0x80')]=_0x4b6ba9[_0x6223('0x7d')]+_0x6223('0x81')+_0x333044[_0x6223('0x82')]+_0x6223('0x83')+md5(_0x333044[_0x6223('0x82')]);}else{_0x333044['recordingURL']='';}var _0x6b924a=_0x4b6ba9[_0x6223('0x7b')]===_0x6223('0x84')?'eu':'com';return getAccessToken(_0x4b6ba9)[_0x6223('0x20')](function(_0x2c0abd){_0x2b0929=_0x2c0abd;return getUser(_0x2b0929,_0x6b924a,_0x4b6ba9,_0x138508[_0x6223('0x2d')]);})['then'](function(_0x1f4d16){_0x560fe8=_0x1f4d16;logger['info'](_0x6223('0x85'),_0x560fe8['id']);return getEndUser(_0x2b0929,_0x6b924a,_0x4b6ba9,_0x333044['calleridname'],_0x333044[_0x6223('0x86')],_0x560fe8,_0x2b64a0);})['then'](function(_0x52e4f1){_0x230ceb=_0x52e4f1;return getCall(_0x2b0929,_0x6b924a,_0x4b6ba9,_0x560fe8,_0x230ceb,_0x2b64a0,_0x333044,'Inbound');})[_0x6223('0x20')](function(_0x530bc2){if(_0x530bc2){logger['info']('The\x20Call\x20ID\x20is:',_0x530bc2['id']);logger[_0x6223('0x25')](_0x6223('0x7f'),_0x6223('0x87'));emit(util['format']('user:%s',_0x138508[_0x6223('0x15')]),_0x6223('0x88'),{'uri':_0x6223('0x89')+_0x4b6ba9[_0x6223('0x7b')]+_0x6223('0x8a')+_0x530bc2['id']});}})[_0x6223('0x36')](function(_0x5f390e){logger[_0x6223('0x22')]('[QUEUE]',JSON['stringify'](_0x5f390e));});};exports['outbound']=function(_0x41c997,_0x11354d,_0x2d401f,_0x41640b,_0xa01a06,_0x209231,_0x283050){var _0x213970,_0x187bb5,_0x292b9e;_0x209231['host']=intUtil[_0x6223('0x7c')](_0x209231[_0x6223('0x7b')]);_0x209231['serverUrl']=intUtil[_0x6223('0x7c')](_0x209231['serverUrl']);if(_0x283050&&_0x283050[_0x6223('0x8b')]&&_0x283050[_0x6223('0x8b')]!=='none'){logger[_0x6223('0x25')](_0x6223('0x8c'),_0x6223('0x8d'));_0x11354d[_0x6223('0x80')]=_0x209231[_0x6223('0x7d')]+_0x6223('0x81')+_0x11354d[_0x6223('0x82')]+_0x6223('0x83')+md5(_0x11354d[_0x6223('0x82')]);}var _0x59640a=_0x209231['host']===_0x6223('0x84')?'eu':_0x6223('0x8e');return getAccessToken(_0x209231)[_0x6223('0x20')](function(_0x4d2915){_0x292b9e=_0x4d2915;return getUser(_0x292b9e,_0x59640a,_0x209231,_0x41640b[_0x6223('0x2d')]);})['then'](function(_0x54e702){_0x213970=_0x54e702;logger['info'](_0x6223('0x85'),_0x213970['id']);return getEndUser(_0x292b9e,_0x59640a,_0x209231,_0x11354d[_0x6223('0x8f')],_0x11354d[_0x6223('0x90')],_0x213970,_0x2d401f);})[_0x6223('0x20')](function(_0x1c6fe1){_0x187bb5=_0x1c6fe1;return getCall(_0x292b9e,_0x59640a,_0x209231,_0x213970,_0x187bb5,_0x2d401f,_0x11354d,'Outbound');})[_0x6223('0x20')](function(_0x451706){if(_0x451706){logger['info'](_0x6223('0x91'),_0x451706['id']);logger[_0x6223('0x25')](_0x6223('0x8c'),_0x6223('0x87'));emit(util['format'](_0x6223('0x92'),_0x41640b[_0x6223('0x15')]),_0x6223('0x88'),{'uri':_0x6223('0x89')+_0x209231[_0x6223('0x7b')]+_0x6223('0x8a')+_0x451706['id']});}})[_0x6223('0x36')](function(_0x5ed395){logger['error'](_0x6223('0x8c'),JSON[_0x6223('0x33')](_0x5ed395));});};exports[_0x6223('0x93')]=function(_0x2d39cc,_0x341b98,_0x41d465,_0x4c5638,_0x3566c3,_0x2a585d){var _0x2742f4,_0x39b074,_0x8efed0;_0x2a585d[_0x6223('0x7b')]=intUtil['stripTrailingSlash'](_0x2a585d['host']);_0x2a585d[_0x6223('0x7d')]=intUtil[_0x6223('0x7c')](_0x2a585d[_0x6223('0x7d')]);if(_0x3566c3&&_0x3566c3[_0x6223('0x7e')]){logger[_0x6223('0x25')]('['+_0x341b98['lastevent'][_0x6223('0x94')]()+']',_0x6223('0x8d'));_0x341b98[_0x6223('0x80')]=_0x2a585d[_0x6223('0x7d')]+_0x6223('0x81')+_0x341b98[_0x6223('0x82')]+_0x6223('0x83')+md5(_0x341b98['uniqueid']);}else{_0x341b98['recordingURL']='';}var _0x239cdb=_0x2a585d[_0x6223('0x7b')]==='zoho.eu'?'eu':_0x6223('0x8e');return getAccessToken(_0x2a585d)['then'](function(_0x3d4b2e){_0x8efed0=_0x3d4b2e;return getUser(_0x8efed0,_0x239cdb,_0x2a585d);})['then'](function(_0x35b160){_0x2742f4=_0x35b160;logger[_0x6223('0x25')](_0x6223('0x85'),_0x2742f4['id']);return getEndUser(_0x8efed0,_0x239cdb,_0x2a585d,_0x341b98[_0x6223('0x95')],_0x341b98[_0x6223('0x86')],_0x2742f4,_0x41d465);})[_0x6223('0x20')](function(_0x5d29cd){_0x39b074=_0x5d29cd;return getCall(_0x8efed0,_0x239cdb,_0x2a585d,_0x2742f4,_0x39b074,_0x41d465,_0x341b98,'Inbound');})[_0x6223('0x20')](function(_0x2cabba){if(_0x2cabba){logger[_0x6223('0x25')](_0x6223('0x91'),_0x2cabba['id']);}})[_0x6223('0x36')](function(_0x37fae2){logger[_0x6223('0x22')]('['+_0x341b98['lastevent'][_0x6223('0x94')]()+']',JSON[_0x6223('0x33')](_0x37fae2));});}; \ No newline at end of file +var _0x2227=['unmanaged','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','socket.io-emitter','redis','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','data','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','uri','https://www.zohoapis.','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','connect','Call_Result','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','com','destcalleridname','destcalleridnum','https://crm.'];(function(_0x31ce32,_0x3870a8){var _0x40958b=function(_0x533129){while(--_0x533129){_0x31ce32['push'](_0x31ce32['shift']());}};_0x40958b(++_0x3870a8);}(_0x2227,0x147));var _0x7222=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x2227[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0x7222('0x0'));var rp=require(_0x7222('0x1'));var md5=require(_0x7222('0x2'));var util=require('util');var intUtil=require(_0x7222('0x3'));var moment=require(_0x7222('0x4'));var Redis=require(_0x7222('0x5'));var BPromise=require(_0x7222('0x6'));var config=require(_0x7222('0x7'));var logger=require(_0x7222('0x8'))(_0x7222('0x9'));config['redis']=_[_0x7222('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7222('0xb'))(new Redis(config[_0x7222('0xc')]));function emit(_0x1d25ac,_0x23761e,_0x51bbe2){io['to'](_0x1d25ac)[_0x7222('0xd')](_0x23761e,_0x51bbe2);}function request(_0x107d00){logger[_0x7222('0xe')](_0x7222('0xf'),JSON[_0x7222('0x10')](_0x107d00));return rp(_0x107d00);}function getCustomFields(_0x2a240a,_0x1dc31b){var _0x3a1e52={};if(_0x2a240a[_0x7222('0x11')]>0x0){_[_0x7222('0x12')](_0x2a240a,function(_0x238aed){if(_['includes']([_0x7222('0x13'),_0x7222('0x14')],_0x238aed[_0x7222('0x15')])&&_0x238aed[_0x7222('0x16')]){_0x3a1e52[_0x238aed[_0x7222('0x16')]]=_0x238aed[_0x7222('0x17')]['toString']();}else if(_0x238aed[_0x7222('0x15')]==='variable'&&_0x238aed[_0x7222('0x18')]&&_0x238aed[_0x7222('0x16')]&&_0x1dc31b[_0x238aed[_0x7222('0x18')]]){_0x3a1e52[_0x238aed[_0x7222('0x16')]]=_0x1dc31b[_0x238aed[_0x7222('0x18')]][_0x7222('0x19')]();}else if(_0x238aed[_0x7222('0x15')]===_0x7222('0x1a')&&_0x238aed[_0x7222('0x1b')]&&_0x238aed[_0x7222('0x1b')][_0x7222('0x1c')]&&_0x238aed[_0x7222('0x16')]&&_0x1dc31b[_0x238aed[_0x7222('0x1b')]['name'][_0x7222('0x1d')]()]){_0x3a1e52[_0x238aed[_0x7222('0x16')]]=_0x1dc31b[_0x238aed['Variable']['name']['toLowerCase']()]['toString']();}});}return _0x3a1e52;}function getName(_0x151ad3){if(_0x151ad3[_0x7222('0x1e')]('\x20')>0x0){var _0x5b3bae=_0x151ad3[_0x7222('0x1f')](/ (.+)/);if(_0x5b3bae[0x1]){return _0x5b3bae;}}return[_0x151ad3,_0x151ad3];}var accountsTokens={};function getAccessToken(_0x41a30b){return new Promise(function(_0xb0c88c,_0x8a902a){if(!_[_0x7222('0x20')](accountsTokens[_0x41a30b['id']])&&!_[_0x7222('0x20')](accountsTokens[_0x41a30b['id']][_0x7222('0x21')])){if(moment()[_0x7222('0x22')](accountsTokens[_0x41a30b['id']][_0x7222('0x23')])){_0xb0c88c(accountsTokens[_0x41a30b['id']][_0x7222('0x21')]);}}var _0x2c681b;switch(_0x41a30b[_0x7222('0x24')]){case'US':_0x2c681b=_0x7222('0x25');break;case'AU':_0x2c681b=_0x7222('0x26');break;case'EU':_0x2c681b=_0x7222('0x27');break;case'IN':_0x2c681b=_0x7222('0x28');break;case'CN':_0x2c681b=_0x7222('0x29');break;default:_0x2c681b=_0x7222('0x27');break;}var _0x14e8ac={'method':_0x7222('0x2a'),'uri':_0x2c681b+_0x7222('0x2b'),'qs':{'refresh_token':_0x41a30b[_0x7222('0x2c')],'client_id':_0x41a30b[_0x7222('0x2d')],'client_secret':_0x41a30b[_0x7222('0x2e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x14e8ac)[_0x7222('0x2f')](function(_0x58727c){accountsTokens[_0x41a30b['id']]={'access_token':_0x58727c[_0x7222('0x21')],'expires_in':moment()[_0x7222('0x30')](_0x58727c[_0x7222('0x23')],_0x7222('0x31'))};_0xb0c88c(_0x58727c['access_token']);})[_0x7222('0x32')](function(_0x282170){logger[_0x7222('0x33')](_0x7222('0x34'),_0x282170[_0x7222('0x35')]);_0x8a902a(_0x282170);});});}function getUser(_0x59f145,_0x4f425e,_0x4b0871,_0x5901a5){logger[_0x7222('0x36')]('Search\x20user');return request({'method':_0x7222('0x37'),'uri':util['format'](_0x7222('0x38'),_0x4f425e),'qs':{'type':_0x7222('0x39')},'headers':{'Authorization':_0x7222('0x3a')+_0x59f145},'json':!![]})[_0x7222('0x2f')](function(_0x5c44b7){if(_0x5c44b7[_0x7222('0x3b')]){var _0x3e183d=-0x1;if(_[_0x7222('0x3c')](_0x5c44b7['users'])){if(!_['isNil'](_0x5901a5)){_0x3e183d=_[_0x7222('0x3d')](_0x5c44b7[_0x7222('0x3b')],function(_0x384d54){return _0x384d54[_0x7222('0x3e')]===_0x5901a5;});}if(_0x3e183d>=0x0){logger[_0x7222('0x36')](_0x7222('0x3f'));}else{logger[_0x7222('0x36')](_0x7222('0x40'));_0x3e183d=_['findIndex'](_0x5c44b7[_0x7222('0x3b')],function(_0x55e66c){return _0x55e66c['profile'][_0x7222('0x1c')]===_0x7222('0x41');});}return _0x5c44b7[_0x7222('0x3b')][_0x3e183d];}else{if(_0x5c44b7[_0x7222('0x42')]['profile'][_0x7222('0x1c')]===_0x7222('0x41')){logger[_0x7222('0x36')]('Using\x20the\x20admin\x20account!');user=_0x5c44b7[_0x7222('0x42')];return user;}else{logger[_0x7222('0x33')]('The\x20failing\x20result\x20is',JSON[_0x7222('0x10')](_0x5c44b7));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5c44b7));}}}else{logger[_0x7222('0x33')](_0x7222('0x43'),JSON[_0x7222('0x10')](_0x5c44b7));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5c44b7));}})[_0x7222('0x32')](function(_0x496440){console[_0x7222('0x33')](_0x496440);});}function getZohoUser(_0x290282,_0x27d275){return new BPromise(function(_0x1a4e7a,_0x308b5c){request(_0x290282)['then'](function(_0x5c8a14){var _0x121c3d=null;if(_0x5c8a14){_0x121c3d=_0x5c8a14['data'][0x0];_0x121c3d[_0x7222('0x44')]=_0x27d275;}_0x1a4e7a(_0x121c3d);})[_0x7222('0x32')](function(_0x5082e2){_0x308b5c(_0x5082e2);});});}function createEndUser(_0x38e255,_0x3f4b02,_0x493436,_0x48f510,_0x21ead7,_0x4ce9c2){var _0x493436=getName(_0x493436);return request({'method':_0x7222('0x2a'),'uri':'https://www.zohoapis.'+_0x3f4b02+_0x7222('0x45')+_[_0x7222('0x46')](_0x4ce9c2[_0x7222('0x47')])+'s','body':{'data':[{'Last_Name':_0x493436[0x1],'First_Name':_0x493436[0x0],'Phone':_0x48f510,'Owner':{'name':!_[_0x7222('0x20')](_0x21ead7[_0x7222('0x48')][_0x7222('0x1c')])?_0x21ead7[_0x7222('0x48')][_0x7222('0x1c')]:!_[_0x7222('0x20')](_0x21ead7[_0x7222('0x49')])?_0x21ead7[_0x7222('0x49')]+'\x20'+_0x21ead7[_0x7222('0x4a')]:_0x21ead7[_0x7222('0x4a')],'id':_0x21ead7['id']}}]},'headers':{'Authorization':_0x7222('0x3a')+_0x38e255},'json':!![]})['then'](function(_0x4bc385){if(_0x4bc385&&_0x4bc385['data'][0x0][_0x7222('0x4b')]===_0x7222('0x4c')){var _0x5c9b45=_0x4bc385[_0x7222('0x4d')][0x0]['details'];_0x5c9b45[_0x7222('0x44')]=_[_0x7222('0x46')](_0x4ce9c2['moduleCreate'])+'s';return _0x5c9b45;}logger['error'](_0x7222('0x43'),JSON[_0x7222('0x10')](data));throw new Error(_0x7222('0x4e')+JSON[_0x7222('0x10')](data));})[_0x7222('0x32')](function(_0x7175c0){console[_0x7222('0x4f')](_0x7222('0x50'),_0x7175c0);});}function getEndUser(_0x1fb424,_0x533500,_0x49ad5d,_0x36a287,_0x1ea3ec,_0x10f605,_0x2b0815){var _0x52d93c={'method':_0x7222('0x37'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1fb424},'json':!![]};switch(_0x2b0815[_0x7222('0x51')]){case _0x7222('0x52'):_0x52d93c['uri']='https://www.zohoapis.'+_0x533500+_0x7222('0x53')+_0x1ea3ec+'))';return getZohoUser(_0x52d93c,_0x7222('0x54'))[_0x7222('0x2f')](function(_0x341a57){if(_0x341a57)return _0x341a57;_0x52d93c['uri']='https://www.zohoapis.'+_0x533500+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1ea3ec+'))';return getZohoUser(_0x52d93c,_0x7222('0x55'))['then'](function(_0xc9512e){if(_0xc9512e)return _0xc9512e;if(_0x2b0815[_0x7222('0x47')]!=_0x7222('0x56')){return createEndUser(_0x1fb424,_0x533500,_0x36a287,_0x1ea3ec,_0x10f605,_0x2b0815);}else{return{};}});});break;case _0x7222('0x57'):_0x52d93c[_0x7222('0x58')]=_0x7222('0x59')+_0x533500+_0x7222('0x53')+_0x1ea3ec+'))';return getZohoUser(_0x52d93c,'Contacts')[_0x7222('0x2f')](function(_0x4f6af8){if(_0x4f6af8)return _0x4f6af8;if(_0x2b0815[_0x7222('0x47')]!='nothing'){return createEndUser(_0x1fb424,_0x533500,_0x36a287,_0x1ea3ec,_0x10f605,_0x2b0815);}else{return{};}});break;case _0x7222('0x5a'):_0x52d93c[_0x7222('0x58')]=_0x7222('0x59')+_0x533500+_0x7222('0x5b')+_0x1ea3ec+'))';return getZohoUser(_0x52d93c,_0x7222('0x55'))[_0x7222('0x2f')](function(_0x29d27f){if(_0x29d27f)return _0x29d27f;if(_0x2b0815['moduleCreate']!=_0x7222('0x56')){return createEndUser(_0x1fb424,_0x533500,_0x36a287,_0x1ea3ec,_0x10f605,_0x2b0815);}else{return{};}});break;}}function getCall(_0x9e334b,_0x3f736a,_0x476089,_0x2b9969,_0x237292,_0x517b47,_0x4ed6a3,_0x4a8248){logger[_0x7222('0x36')](_0x7222('0x5c'));var _0x46006b={};_0x46006b[_0x7222('0x5d')]={'name':!_[_0x7222('0x20')](_0x2b9969['role'][_0x7222('0x1c')])&&!_[_0x7222('0x20')](_0x2b9969[_0x7222('0x5e')]['name'])&&_0x2b9969[_0x7222('0x5e')][_0x7222('0x1c')]===_0x7222('0x5f')?_0x2b9969[_0x7222('0x48')][_0x7222('0x1c')]:!_[_0x7222('0x20')](_0x2b9969[_0x7222('0x49')])?_0x2b9969[_0x7222('0x49')]+'\x20'+_0x2b9969[_0x7222('0x4a')]:_0x2b9969[_0x7222('0x4a')],'id':_0x2b9969['id']};_0x46006b[_0x7222('0x60')]=intUtil[_0x7222('0x61')](_0x517b47[_0x7222('0x62')],_0x4ed6a3,'\x20');_0x46006b[_0x7222('0x63')]=intUtil[_0x7222('0x61')](_0x517b47[_0x7222('0x64')],_0x4ed6a3,'\x0a');if(_0x237292['enduserType']===_0x7222('0x54')){_0x46006b[_0x7222('0x65')]={'name':!_[_0x7222('0x20')](_0x237292[_0x7222('0x66')])?_0x237292[_0x7222('0x66')]:!_[_0x7222('0x20')](_0x237292[_0x7222('0x67')])?_0x237292[_0x7222('0x67')]+'\x20'+_0x237292[_0x7222('0x68')]:_0x237292[_0x7222('0x68')],'id':_0x237292['id']};}if(_0x237292['enduserType']===_0x7222('0x55')){_0x46006b[_0x7222('0x69')]={'name':!_[_0x7222('0x20')](_0x237292[_0x7222('0x66')])?_0x237292[_0x7222('0x66')]:!_[_0x7222('0x20')](_0x237292[_0x7222('0x67')])?_0x237292['First_Name']+'\x20'+_0x237292[_0x7222('0x68')]:_0x237292['Last_Name'],'id':_0x237292['id']};_0x46006b['$se_module']=_[_0x7222('0x46')](_0x237292['enduserType']);}if(_0x4ed6a3[_0x7222('0x6a')]){_0x46006b[_0x7222('0x6b')]=moment[_0x7222('0x6c')](parseInt(_0x4ed6a3[_0x7222('0x6a')])*0x3e8)[_0x7222('0x6d')](_0x7222('0x6e'));}else if(_0x4ed6a3[_0x7222('0x6f')]&&_0x4ed6a3['endtime']){_0x46006b['Call_Duration']=moment[_0x7222('0x6c')](moment(_0x4ed6a3[_0x7222('0x70')],_0x7222('0x71'))[_0x7222('0x72')](moment(_0x4ed6a3[_0x7222('0x73')],_0x7222('0x71'))))[_0x7222('0x6d')](_0x7222('0x6e'));}switch(_0x4ed6a3[_0x7222('0x74')]){case'called':_0x46006b['Call_Result']='Called';break;case'complete':case _0x7222('0x75'):_0x46006b['Call_Result']='Answered';break;case'rejected':_0x46006b[_0x7222('0x76')]=_0x7222('0x77');break;case'abandoned':_0x46006b[_0x7222('0x76')]=_0x7222('0x78');break;case _0x7222('0x79'):_0x46006b['Call_Result']=_0x7222('0x7a');default:}_0x46006b[_0x7222('0x7b')]=(_0x4a8248===_0x7222('0x7c')?moment(_0x4ed6a3[_0x7222('0x73')])['format'](_0x7222('0x71')):moment(_0x4ed6a3[_0x7222('0x7d')])[_0x7222('0x6d')](_0x7222('0x71')))||moment()[_0x7222('0x6d')](_0x7222('0x71'));_0x46006b[_0x7222('0x7e')]=_0x4a8248||'Inbound';_0x46006b=_[_0x7222('0x7f')](_0x46006b,getCustomFields(_0x517b47[_0x7222('0x80')],_0x4ed6a3));return request({'method':'POST','uri':_0x7222('0x59')+_0x3f736a+_0x7222('0x81'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x9e334b},'body':{'data':[_0x46006b]},'json':!![]})['then'](function(_0x30a848){if(_0x30a848&&_0x30a848[_0x7222('0x4d')][0x0]['code']===_0x7222('0x4c')){logger[_0x7222('0x36')](_0x7222('0x82'));return{'id':_0x30a848[_0x7222('0x4d')][0x0]['details']['id']};}})[_0x7222('0x32')](function(_0x5dc62e){logger[_0x7222('0x36')](_0x7222('0x83'),_0x5dc62e[_0x7222('0x35')]);console['log'](_0x7222('0x83'),_0x5dc62e);});}exports[_0x7222('0x84')]=function(_0x44e5ff,_0x2693cd,_0x73d14d,_0x4844b5,_0x46e60,_0x5d3d32){var _0x47b3f3,_0x154867,_0x52a442;_0x5d3d32[_0x7222('0x85')]=intUtil[_0x7222('0x86')](_0x5d3d32['host']);_0x5d3d32[_0x7222('0x87')]=intUtil['stripTrailingSlash'](_0x5d3d32[_0x7222('0x87')]);if(_0x46e60&&_0x46e60[_0x7222('0x88')]){logger[_0x7222('0x36')](_0x7222('0x89'),_0x7222('0x8a'));_0x2693cd[_0x7222('0x8b')]=_0x5d3d32[_0x7222('0x87')]+'/api/voice/recordings/'+_0x2693cd[_0x7222('0x8c')]+_0x7222('0x8d')+md5(_0x2693cd[_0x7222('0x8c')]);}else{_0x2693cd[_0x7222('0x8b')]='';}var _0x3dce5d=_0x5d3d32[_0x7222('0x85')]===_0x7222('0x8e')?'eu':'com';return getAccessToken(_0x5d3d32)['then'](function(_0x148e4f){_0x52a442=_0x148e4f;return getUser(_0x52a442,_0x3dce5d,_0x5d3d32,_0x4844b5[_0x7222('0x3e')]);})['then'](function(_0x30d806){_0x47b3f3=_0x30d806;logger[_0x7222('0x36')]('The\x20User\x20ID\x20is:',_0x47b3f3['id']);return getEndUser(_0x52a442,_0x3dce5d,_0x5d3d32,_0x2693cd[_0x7222('0x8f')],_0x2693cd[_0x7222('0x90')],_0x47b3f3,_0x73d14d);})[_0x7222('0x2f')](function(_0x3d306c){_0x154867=_0x3d306c;return getCall(_0x52a442,_0x3dce5d,_0x5d3d32,_0x47b3f3,_0x154867,_0x73d14d,_0x2693cd,_0x7222('0x91'));})[_0x7222('0x2f')](function(_0x32c1e5){if(_0x32c1e5){logger['info'](_0x7222('0x92'),_0x32c1e5['id']);logger[_0x7222('0x36')](_0x7222('0x89'),_0x7222('0x93'));emit(util[_0x7222('0x6d')](_0x7222('0x94'),_0x4844b5[_0x7222('0x1c')]),_0x7222('0x95'),{'uri':'https://crm.'+_0x5d3d32[_0x7222('0x85')]+_0x7222('0x96')+_0x32c1e5['id']});}})[_0x7222('0x32')](function(_0xe470e5){logger[_0x7222('0x33')](_0x7222('0x89'),JSON[_0x7222('0x10')](_0xe470e5));});};exports[_0x7222('0x7c')]=function(_0x11d37c,_0x134f6e,_0x357691,_0x3b07a5,_0x3917ee,_0x26a9ac,_0x536d00){var _0x2054e8,_0x950c2,_0x470b19;_0x26a9ac['host']=intUtil['stripTrailingSlash'](_0x26a9ac[_0x7222('0x85')]);_0x26a9ac['serverUrl']=intUtil[_0x7222('0x86')](_0x26a9ac[_0x7222('0x87')]);if(_0x536d00&&_0x536d00[_0x7222('0x97')]&&_0x536d00[_0x7222('0x97')]!==_0x7222('0x98')){logger[_0x7222('0x36')](_0x7222('0x99'),_0x7222('0x8a'));_0x134f6e[_0x7222('0x8b')]=_0x26a9ac[_0x7222('0x87')]+_0x7222('0x9a')+_0x134f6e['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x134f6e[_0x7222('0x8c')]);}var _0x555ef9=_0x26a9ac[_0x7222('0x85')]===_0x7222('0x8e')?'eu':_0x7222('0x9b');return getAccessToken(_0x26a9ac)['then'](function(_0x241ae9){_0x470b19=_0x241ae9;return getUser(_0x470b19,_0x555ef9,_0x26a9ac,_0x3b07a5[_0x7222('0x3e')]);})[_0x7222('0x2f')](function(_0x4b5499){_0x2054e8=_0x4b5499;logger['info']('The\x20User\x20ID\x20is:',_0x2054e8['id']);return getEndUser(_0x470b19,_0x555ef9,_0x26a9ac,_0x134f6e[_0x7222('0x9c')],_0x134f6e[_0x7222('0x9d')],_0x2054e8,_0x357691);})['then'](function(_0x18b98d){_0x950c2=_0x18b98d;return getCall(_0x470b19,_0x555ef9,_0x26a9ac,_0x2054e8,_0x950c2,_0x357691,_0x134f6e,'Outbound');})[_0x7222('0x2f')](function(_0x1cd192){if(_0x1cd192){logger['info'](_0x7222('0x92'),_0x1cd192['id']);logger[_0x7222('0x36')]('[OUTBOUND]',_0x7222('0x93'));emit(util[_0x7222('0x6d')](_0x7222('0x94'),_0x3b07a5[_0x7222('0x1c')]),_0x7222('0x95'),{'uri':_0x7222('0x9e')+_0x26a9ac[_0x7222('0x85')]+_0x7222('0x96')+_0x1cd192['id']});}})[_0x7222('0x32')](function(_0x54e88d){logger[_0x7222('0x33')](_0x7222('0x99'),JSON[_0x7222('0x10')](_0x54e88d));});};exports[_0x7222('0x9f')]=function(_0x28a94e,_0x51b3ce,_0x773760,_0x2ee711,_0x203f84,_0x24b486){var _0xf6d6d6,_0x2e734d,_0x239182;_0x24b486['host']=intUtil[_0x7222('0x86')](_0x24b486[_0x7222('0x85')]);_0x24b486['serverUrl']=intUtil['stripTrailingSlash'](_0x24b486[_0x7222('0x87')]);if(_0x203f84&&_0x203f84['monitor_format']){logger['info']('['+_0x51b3ce[_0x7222('0x74')][_0x7222('0xa0')]()+']','Recording\x20is\x20enabled!');_0x51b3ce['recordingURL']=_0x24b486[_0x7222('0x87')]+_0x7222('0x9a')+_0x51b3ce['uniqueid']+_0x7222('0x8d')+md5(_0x51b3ce['uniqueid']);}else{_0x51b3ce[_0x7222('0x8b')]='';}var _0x305b35=_0x24b486[_0x7222('0x85')]===_0x7222('0x8e')?'eu':_0x7222('0x9b');return getAccessToken(_0x24b486)[_0x7222('0x2f')](function(_0x419b6e){_0x239182=_0x419b6e;return getUser(_0x239182,_0x305b35,_0x24b486);})[_0x7222('0x2f')](function(_0x159df7){_0xf6d6d6=_0x159df7;logger[_0x7222('0x36')](_0x7222('0xa1'),_0xf6d6d6['id']);return getEndUser(_0x239182,_0x305b35,_0x24b486,_0x51b3ce['calleridname'],_0x51b3ce['calleridnum'],_0xf6d6d6,_0x773760);})[_0x7222('0x2f')](function(_0x29e39b){_0x2e734d=_0x29e39b;return getCall(_0x239182,_0x305b35,_0x24b486,_0xf6d6d6,_0x2e734d,_0x773760,_0x51b3ce,_0x7222('0x91'));})[_0x7222('0x2f')](function(_0x14c1ed){if(_0x14c1ed){logger['info']('The\x20Call\x20ID\x20is:',_0x14c1ed['id']);}})[_0x7222('0x32')](function(_0x168192){logger['error']('['+_0x51b3ce[_0x7222('0x74')][_0x7222('0xa0')]()+']',JSON[_0x7222('0x10')](_0x168192));});}; \ 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 591a575..194f91f 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 _0x18a4=['util','shelljs','mustache','trigger','exec','data2','Script','data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0xcce3bb,_0x2ecc78){var _0x34cb36=function(_0x3dccc1){while(--_0x3dccc1){_0xcce3bb['push'](_0xcce3bb['shift']());}};_0x34cb36(++_0x2ecc78);}(_0x18a4,0x68));var _0x418a=function(_0x21f480,_0xb3c0f){_0x21f480=_0x21f480-0x0;var _0x225423=_0x18a4[_0x21f480];return _0x225423;};'use strict';var util=require(_0x418a('0x0'));var sh=require(_0x418a('0x1'));var Mustache=require(_0x418a('0x2'));var logger=require('../../../../config/logger')(_0x418a('0x3'));exports[_0x418a('0x4')]=function(_0x2ff8b4,_0x26e4aa){var _0x2e577e=_0x2ff8b4[_0x418a('0x5')]?_0x2ff8b4[_0x418a('0x5')]:_0x418a('0x6');var _0x3e8131=_0x2ff8b4[_0x418a('0x7')]?Mustache[_0x418a('0x8')](_0x2ff8b4[_0x418a('0x7')],_0x26e4aa):_0x26e4aa;sh[_0x418a('0x4')](_0x3e8131,function(_0x58e99a,_0xec87ff,_0x35a0be){if(_0x58e99a!==0x0){logger[_0x418a('0x9')](util[_0x418a('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x2e577e,_0x3e8131,_0x58e99a,_0x35a0be));}else{logger[_0x418a('0xb')](util[_0x418a('0xa')](_0x418a('0xc'),_0x2e577e,_0x3e8131,_0xec87ff));}});}; \ No newline at end of file +var _0x37c9=['exec','data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','trigger'];(function(_0x5a58bf,_0x352834){var _0x125bb1=function(_0x1f0053){while(--_0x1f0053){_0x5a58bf['push'](_0x5a58bf['shift']());}};_0x125bb1(++_0x352834);}(_0x37c9,0xfa));var _0x937c=function(_0x258c8d,_0x22914e){_0x258c8d=_0x258c8d-0x0;var _0x56a690=_0x37c9[_0x258c8d];return _0x56a690;};'use strict';var util=require('util');var sh=require(_0x937c('0x0'));var Mustache=require('mustache');var logger=require(_0x937c('0x1'))(_0x937c('0x2'));exports[_0x937c('0x3')]=function(_0x353d0b,_0x12ac4e){var _0xe339f5=_0x353d0b[_0x937c('0x4')]?_0x353d0b[_0x937c('0x4')]:_0x937c('0x5');var _0x1a9010=_0x353d0b[_0x937c('0x6')]?Mustache[_0x937c('0x7')](_0x353d0b[_0x937c('0x6')],_0x12ac4e):_0x12ac4e;sh[_0x937c('0x3')](_0x1a9010,function(_0x2469f5,_0x5be9c0,_0x5a8106){if(_0x2469f5!==0x0){logger['error'](util[_0x937c('0x8')](_0x937c('0x9'),_0xe339f5,_0x1a9010,_0x2469f5,_0x5a8106));}else{logger['info'](util['format'](_0x937c('0xa'),_0xe339f5,_0x1a9010,_0x5be9c0));}});}; \ 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 d57c625..29742b3 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 _0x4030=['info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','trigger','exec','data1','toUpperCase','render','data2','data5','number','data6','parse','error','stack','GET','DELETE','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0xf10692,_0x393b17){var _0x5a0753=function(_0x3cdcaf){while(--_0x3cdcaf){_0xf10692['push'](_0xf10692['shift']());}};_0x5a0753(++_0x393b17);}(_0x4030,0x96));var _0x0403=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0x4030[_0x27eda0];return _0x2b63a5;};'use strict';var rp=require(_0x0403('0x0'));var util=require('util');var _=require(_0x0403('0x1'));var Mustache=require(_0x0403('0x2'));var logger=require('../../../../config/logger')(_0x0403('0x3'));exports[_0x0403('0x4')]=function(_0x4a2e0a,_0x5bb36a){var _0x37ad0b,_0x38b632;var _0x525074={'method':_0x4a2e0a[_0x0403('0x5')][_0x0403('0x6')](),'uri':Mustache[_0x0403('0x7')](_0x4a2e0a[_0x0403('0x8')],_0x5bb36a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4a2e0a[_0x0403('0x9')])===_0x0403('0xa')&&parseInt(_0x4a2e0a[_0x0403('0x9')])>=0x1&&parseInt(_0x4a2e0a['data5'])<=0xa?parseInt(_0x4a2e0a[_0x0403('0x9')])*0x3e8:0x5*0x3e8};try{_0x525074['headers']=_0x4a2e0a[_0x0403('0xb')]?JSON[_0x0403('0xc')](Mustache[_0x0403('0x7')](_0x4a2e0a[_0x0403('0xb')],_0x5bb36a)):{};}catch(_0x21e2ba){logger[_0x0403('0xd')](_0x21e2ba[_0x0403('0xe')]);}switch(_0x4a2e0a[_0x0403('0x5')][_0x0403('0x6')]()){case _0x0403('0xf'):case _0x0403('0x10'):_0x37ad0b=null;_0x525074['qs']=_0x5bb36a;break;case'POST':case'PUT':if(_0x4a2e0a[_0x0403('0x11')]){try{_0x37ad0b=JSON['parse'](Mustache[_0x0403('0x7')](_0x4a2e0a[_0x0403('0x11')],_0x5bb36a));_0x525074[_0x0403('0x12')]=_0x37ad0b;}catch(_0x821b52){logger['error'](_0x821b52['stack']);logger[_0x0403('0xd')](_0x0403('0x13'));}}else{_0x37ad0b=_0x5bb36a;_0x525074[_0x0403('0x12')]=_0x37ad0b;}break;}logger[_0x0403('0x14')](util[_0x0403('0x15')](_0x0403('0x16'),_0x4a2e0a[_0x0403('0x5')],_0x4a2e0a[_0x0403('0x8')],JSON[_0x0403('0x17')](_0x525074)));rp(_0x525074)[_0x0403('0x18')](function(_0x5ccf47){_0x37ad0b=!_[_0x0403('0x19')](_0x37ad0b)?_0x0403('0x1a')+_0x37ad0b:'';_0x38b632=typeof _0x5ccf47['body']===_0x0403('0x1b')?JSON[_0x0403('0x17')](_0x5ccf47['body']):_0x5ccf47[_0x0403('0x12')];logger[_0x0403('0x14')](util[_0x0403('0x15')](_0x0403('0x1c'),_0x4a2e0a[_0x0403('0x5')],_0x4a2e0a['data2'],_0x5ccf47[_0x0403('0x1d')],_0x38b632));})[_0x0403('0x1e')](function(_0x15c04b){logger[_0x0403('0xd')](util[_0x0403('0x15')](_0x0403('0x1f'),_0x4a2e0a[_0x0403('0x5')],_0x4a2e0a[_0x0403('0x8')],_0x15c04b[_0x0403('0x1d')],_0x15c04b[_0x0403('0x20')],_0x15c04b[_0x0403('0x21')]));});}; \ No newline at end of file +var _0x8e25=['data1','stringify','then','isNil',',\x20request\x20body:\x20','body','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','toUpperCase','data2','data5','number','headers','data6','parse','render','error','GET','DELETE','POST','PUT','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x8e25,0x17e));var _0x58e2=function(_0x222474,_0x15e5d2){_0x222474=_0x222474-0x0;var _0x15eec7=_0x8e25[_0x222474];return _0x15eec7;};'use strict';var rp=require(_0x58e2('0x0'));var util=require(_0x58e2('0x1'));var _=require(_0x58e2('0x2'));var Mustache=require(_0x58e2('0x3'));var logger=require(_0x58e2('0x4'))(_0x58e2('0x5'));exports['exec']=function(_0x2bb27a,_0x5dde17){var _0x428c33,_0x49dadb;var _0x1c82e7={'method':_0x2bb27a['data1'][_0x58e2('0x6')](),'uri':Mustache['render'](_0x2bb27a[_0x58e2('0x7')],_0x5dde17),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2bb27a[_0x58e2('0x8')])===_0x58e2('0x9')&&parseInt(_0x2bb27a[_0x58e2('0x8')])>=0x1&&parseInt(_0x2bb27a[_0x58e2('0x8')])<=0xa?parseInt(_0x2bb27a['data5'])*0x3e8:0x5*0x3e8};try{_0x1c82e7[_0x58e2('0xa')]=_0x2bb27a[_0x58e2('0xb')]?JSON[_0x58e2('0xc')](Mustache[_0x58e2('0xd')](_0x2bb27a['data6'],_0x5dde17)):{};}catch(_0x67c915){logger[_0x58e2('0xe')](_0x67c915['stack']);}switch(_0x2bb27a['data1'][_0x58e2('0x6')]()){case _0x58e2('0xf'):case _0x58e2('0x10'):_0x428c33=null;_0x1c82e7['qs']=_0x5dde17;break;case _0x58e2('0x11'):case _0x58e2('0x12'):if(_0x2bb27a['data7']){try{_0x428c33=JSON[_0x58e2('0xc')](Mustache[_0x58e2('0xd')](_0x2bb27a[_0x58e2('0x13')],_0x5dde17));_0x1c82e7['body']=_0x428c33;}catch(_0x836257){logger[_0x58e2('0xe')](_0x836257[_0x58e2('0x14')]);logger[_0x58e2('0xe')](_0x58e2('0x15'));}}else{_0x428c33=_0x5dde17;_0x1c82e7['body']=_0x428c33;}break;}logger[_0x58e2('0x16')](util[_0x58e2('0x17')](_0x58e2('0x18'),_0x2bb27a[_0x58e2('0x19')],_0x2bb27a[_0x58e2('0x7')],JSON[_0x58e2('0x1a')](_0x1c82e7)));rp(_0x1c82e7)[_0x58e2('0x1b')](function(_0x510c53){_0x428c33=!_[_0x58e2('0x1c')](_0x428c33)?_0x58e2('0x1d')+_0x428c33:'';_0x49dadb=typeof _0x510c53['body']==='object'?JSON[_0x58e2('0x1a')](_0x510c53[_0x58e2('0x1e')]):_0x510c53['body'];logger[_0x58e2('0x16')](util['format'](_0x58e2('0x1f'),_0x2bb27a[_0x58e2('0x19')],_0x2bb27a[_0x58e2('0x7')],_0x510c53[_0x58e2('0x20')],_0x49dadb));})[_0x58e2('0x21')](function(_0x83015f){logger['error'](util['format'](_0x58e2('0x22'),_0x2bb27a[_0x58e2('0x19')],_0x2bb27a['data2'],_0x83015f['statusCode'],_0x83015f[_0x58e2('0x23')],_0x83015f[_0x58e2('0x24')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index a7719bd..c91e204 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 _0x8d87=['routing','client','http','request','then','rpc','error','message','result','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x46451c,_0x1ed426){var _0x573515=function(_0x11eb72){while(--_0x11eb72){_0x46451c['push'](_0x46451c['shift']());}};_0x573515(++_0x1ed426);}(_0x8d87,0x65));var _0x78d8=function(_0x2a0755,_0xdf6bac){_0x2a0755=_0x2a0755-0x0;var _0x3eaf4f=_0x8d87[_0x2a0755];return _0x3eaf4f;};'use strict';var jayson=require(_0x78d8('0x0'));var BPromise=require(_0x78d8('0x1'));var logger=require(_0x78d8('0x2'))(_0x78d8('0x3'));var client=jayson[_0x78d8('0x4')][_0x78d8('0x5')]({'port':0x2329});client['Request']=function(_0x41ec99,_0x5568bd){return new BPromise(function(_0x41d17d,_0x2a2c76){return client[_0x78d8('0x6')](_0x41ec99,_0x5568bd)[_0x78d8('0x7')](function(_0x5cf04e){logger['debug'](_0x78d8('0x8'),'routing',_0x41ec99,_0x5568bd,_0x5cf04e);if(_0x5cf04e[_0x78d8('0x9')]){logger[_0x78d8('0x9')](_0x78d8('0x8'),_0x78d8('0x3'),_0x41ec99,_0x5cf04e[_0x78d8('0x9')][_0x78d8('0xa')],_0x5568bd);return _0x2a2c76(_0x5cf04e[_0x78d8('0x9')][_0x78d8('0xa')]);}else{return _0x41d17d(_0x5cf04e[_0x78d8('0xb')]);}})['catch'](function(_0x493cfa){logger[_0x78d8('0x9')](_0x78d8('0x8'),_0x78d8('0x3'),_0x41ec99,_0x493cfa,_0x5568bd);return _0x2a2c76(_0x493cfa);});});};module[_0x78d8('0xc')]=client; \ No newline at end of file +var _0xec17=['bluebird','../../config/logger','http','Request','request','debug','rpc','routing','error','message','result','catch','exports','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec17,0x187));var _0x7ec1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xec17[_0x40a045];return _0x1a687c;};'use strict';var jayson=require(_0x7ec1('0x0'));var BPromise=require(_0x7ec1('0x1'));var logger=require(_0x7ec1('0x2'))('routing');var client=jayson['client'][_0x7ec1('0x3')]({'port':0x2329});client[_0x7ec1('0x4')]=function(_0x4a3aef,_0x33db95){return new BPromise(function(_0x3e4fa3,_0xcad530){return client[_0x7ec1('0x5')](_0x4a3aef,_0x33db95)['then'](function(_0xc5b2f3){logger[_0x7ec1('0x6')](_0x7ec1('0x7'),_0x7ec1('0x8'),_0x4a3aef,_0x33db95,_0xc5b2f3);if(_0xc5b2f3[_0x7ec1('0x9')]){logger[_0x7ec1('0x9')](_0x7ec1('0x7'),'routing',_0x4a3aef,_0xc5b2f3[_0x7ec1('0x9')][_0x7ec1('0xa')],_0x33db95);return _0xcad530(_0xc5b2f3[_0x7ec1('0x9')][_0x7ec1('0xa')]);}else{return _0x3e4fa3(_0xc5b2f3[_0x7ec1('0xb')]);}})[_0x7ec1('0xc')](function(_0x3a989c){logger['error'](_0x7ec1('0x7'),_0x7ec1('0x8'),_0x4a3aef,_0x3a989c,_0x33db95);return _0xcad530(_0x3a989c);});});};module[_0x7ec1('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7e42299..13f001a 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 _0xbd30=['catch','error','Email\x20service\x20initialization','./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x1daa97,_0xbaa3fc){var _0x551a31=function(_0x5a9191){while(--_0x5a9191){_0x1daa97['push'](_0x1daa97['shift']());}};_0x551a31(++_0xbaa3fc);}(_0xbd30,0x124));var _0x0bd3=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xbd30[_0x5a776b];return _0xbbef59;};'use strict';var server=require(_0x0bd3('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x0bd3('0x1'));var mailAccount=require(_0x0bd3('0x2'));var setting=require(_0x0bd3('0x3'));var logger=require(_0x0bd3('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0bd3('0x5')]()[_0x0bd3('0x6')](mailAccount[_0x0bd3('0x7')]())['then'](realtime[_0x0bd3('0x8')]())[_0x0bd3('0x6')](function(){email[_0x0bd3('0x9')](realtime[_0x0bd3('0xa')]);return realtime;});}function main(){return server[_0x0bd3('0xb')](realtime,email)[_0x0bd3('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0x0bd3('0xc')]();})[_0x0bd3('0x6')](function(_0x4e4c30){return setInterval(initRealtime,_0x4e4c30[_0x0bd3('0xd')]*0x3e8);})[_0x0bd3('0xe')](function(_0x365852){logger[_0x0bd3('0xf')](_0x0bd3('0x10'),_0x365852);});}main(); \ No newline at end of file +var _0x8ef8=['catch','Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','email','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x8ef8,0x12e));var _0x88ef=function(_0x3eb4f7,_0x135ecc){_0x3eb4f7=_0x3eb4f7-0x0;var _0x157316=_0x8ef8[_0x3eb4f7];return _0x157316;};'use strict';var server=require(_0x88ef('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x88ef('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x88ef('0x2'));var logger=require('../../config/logger')(_0x88ef('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x88ef('0x4')]()['then'](mailAccount[_0x88ef('0x5')]())[_0x88ef('0x6')](realtime[_0x88ef('0x7')]())[_0x88ef('0x6')](function(){email[_0x88ef('0x8')](realtime[_0x88ef('0x9')]);return realtime;});}function main(){return server[_0x88ef('0xa')](realtime,email)[_0x88ef('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0x88ef('0xb')]();})['then'](function(_0x2296ff){return setInterval(initRealtime,_0x2296ff[_0x88ef('0xc')]*0x3e8);})[_0x88ef('0xd')](function(_0x27218b){logger['error'](_0x88ef('0xe'),_0x27218b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f95785b..40094a4 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 _0x1394=['lodash','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','box','handleImapBox','bind','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','emit','smtp','send','verifySmtp','Smtp','verify','verified','exports'];(function(_0x535184,_0x57a0f1){var _0x55c64d=function(_0x17f61a){while(--_0x17f61a){_0x535184['push'](_0x535184['shift']());}};_0x55c64d(++_0x57a0f1);}(_0x1394,0xab));var _0x4139=function(_0x4e5117,_0x1c90cd){_0x4e5117=_0x4e5117-0x0;var _0x1b0eea=_0x1394[_0x4e5117];return _0x1b0eea;};'use strict';var _=require(_0x4139('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x4139('0x1'));var Redis=require('ioredis');var config=require(_0x4139('0x2'));var logger=require(_0x4139('0x3'))(_0x4139('0x4'));config['redis']=_['defaults'](config[_0x4139('0x5')],{'host':_0x4139('0x6'),'port':0x18eb});var io=require(_0x4139('0x7'))(new Redis(config[_0x4139('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x4139('0x8'));var mailAccount=require(_0x4139('0x9'));var md5Accounts={};function EmailChannel(_0x2f2165){logger[_0x4139('0xa')](_0x4139('0xb'));this[_0x4139('0xc')]=_0x2f2165[_0x4139('0xc')];this[_0x4139('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x4139('0xe')]['emit']=function(_0x363507){var _0x519807=this[_0x4139('0xc')][_0x363507];var _0x4b8e76={'id':_0x519807['id'],'name':_0x519807[_0x4139('0xf')],'key':_0x519807[_0x4139('0x10')],'active':_0x519807[_0x4139('0x11')],'Imap':{'status':_0x519807[_0x4139('0x12')][_0x4139('0x13')],'messageStatus':_0x519807[_0x4139('0x12')][_0x4139('0x14')],'total':_0x519807[_0x4139('0x12')][_0x4139('0x15')]}};if(_[_0x4139('0x16')](md5Accounts[_0x363507])){md5Accounts[_0x363507]={};}var _0x51ae7b=md5(JSON[_0x4139('0x17')](_0x4b8e76));if(md5Accounts[_0x363507][_0x4139('0x1')]!==_0x51ae7b){md5Accounts[_0x363507][_0x4139('0x1')]=_0x51ae7b;io['emit'](_0x4139('0x18'),_0x4b8e76);}};EmailChannel[_0x4139('0xe')][_0x4139('0x19')]=function(_0x54a901){for(var _0x1a5d5b in _0x54a901){if(_0x54a901[_0x4139('0x1a')](_0x1a5d5b)){if(_0x54a901[_0x1a5d5b]['Imap']&&_0x54a901[_0x1a5d5b][_0x4139('0x11')]){var _0x2d9afa=_0x54a901[_0x1a5d5b][_0x4139('0x12')];if(!_0x2d9afa[_0x4139('0x1b')]&&_0x54a901[_0x1a5d5b]['provider']!==_0x4139('0x1c'))_0x2d9afa[_0x4139('0x1b')]=_0x54a901[_0x1a5d5b][_0x4139('0x1d')];if(!this[_0x4139('0xd')][_0x4139('0x1a')](_0x2d9afa['id'])){this[_0x4139('0xd')][_0x2d9afa['id']]=new EmailImap(_0x2d9afa,_0x54a901[_0x1a5d5b][_0x4139('0x4')]);this[_0x4139('0xd')][_0x2d9afa['id']]['on'](_0x4139('0x1e'),this[_0x4139('0x1f')]['bind'](this,_0x1a5d5b));this[_0x4139('0xd')][_0x2d9afa['id']]['on'](_0x4139('0x4'),this['handleImapEmail'][_0x4139('0x20')](this,_0x1a5d5b));this[_0x4139('0xd')][_0x2d9afa['id']]['on']('end',this['handleImapEnd'][_0x4139('0x20')](this,_0x1a5d5b));this[_0x4139('0xd')][_0x2d9afa['id']]['on'](_0x4139('0x21'),this[_0x4139('0x22')]['bind'](this,_0x1a5d5b));}}else{if(_[_0x4139('0x16')](this['mailAccounts'][_0x1a5d5b][_0x4139('0x12')])){this['mailAccounts'][_0x1a5d5b]['Imap']={};}this[_0x4139('0xc')][_0x1a5d5b][_0x4139('0x12')]['status']=_0x4139('0x23');this['mailAccounts'][_0x1a5d5b][_0x4139('0x12')][_0x4139('0x14')]='';this['emit'](_0x1a5d5b);}}}};EmailChannel[_0x4139('0xe')][_0x4139('0x1f')]=function(_0x1b5034,_0xc7600c){if(this['mailAccounts'][_0x1b5034]){this[_0x4139('0xc')][_0x1b5034][_0x4139('0x12')]['status']=_0x4139('0x24');this[_0x4139('0xc')][_0x1b5034][_0x4139('0x12')][_0x4139('0x14')]=_0xc7600c[_0x4139('0xf')];if(_0xc7600c['messages']){this[_0x4139('0xc')][_0x1b5034]['Imap']['total']=_0xc7600c[_0x4139('0x25')]['total'];}return this['emit'](_0x1b5034);}};EmailChannel[_0x4139('0xe')]['handleImapEmail']=function(_0x977cfc,_0x30eb95){logger[_0x4139('0xa')](_0x4139('0x26'),_0x30eb95[_0x4139('0x27')],_0x30eb95[_0x4139('0x28')],_0x30eb95[_0x4139('0x29')],_0x977cfc);if(this[_0x4139('0xc')][_0x977cfc]){return mailAccount[_0x4139('0x2a')](_0x977cfc,_0x30eb95)[_0x4139('0x2b')](function(_0x42981b){if(_0x42981b){logger[_0x4139('0xa')](_0x4139('0x2c'));}})[_0x4139('0x2d')](function(_0x475fa0){logger['error'](_0x4139('0x2e'),JSON[_0x4139('0x17')](_0x475fa0));});}};EmailChannel[_0x4139('0xe')][_0x4139('0x2f')]=function(_0x31fdf8){if(this[_0x4139('0xc')][_0x31fdf8]&&this['mailAccounts'][_0x31fdf8]['Imap']){if(this[_0x4139('0xd')][this[_0x4139('0xc')][_0x31fdf8][_0x4139('0x12')]['id']]){delete this[_0x4139('0xd')][this[_0x4139('0xc')][_0x31fdf8][_0x4139('0x12')]['id']];}this[_0x4139('0xc')][_0x31fdf8][_0x4139('0x12')][_0x4139('0x30')]=moment();this['emit'](_0x31fdf8);}};EmailChannel[_0x4139('0xe')][_0x4139('0x22')]=function(_0x238df0,_0x5eb98a){if(this['mailAccounts'][_0x238df0]){this[_0x4139('0xc')][_0x238df0][_0x4139('0x12')][_0x4139('0x13')]=_0x4139('0x21');this[_0x4139('0xc')][_0x238df0][_0x4139('0x12')][_0x4139('0x14')]=_0x5eb98a;return this[_0x4139('0x31')](_0x238df0);}};EmailChannel['prototype']['sendMail']=function(_0x1f3bc4,_0x1d130f){return this[_0x4139('0x32')][_0x4139('0x33')](_0x1f3bc4,_0x1d130f);};EmailChannel[_0x4139('0xe')][_0x4139('0x34')]=function(_0x435bbc){var _0x360c5a=this;if(this['mailAccounts'][_0x435bbc['id']]){if(_[_0x4139('0x16')](this['mailAccounts'][_0x435bbc['id']][_0x4139('0x35')])){this['mailAccounts'][_0x435bbc['id']]['Smtp']={};}this[_0x4139('0xc')][_0x435bbc['id']][_0x4139('0x35')][_0x4139('0x30')]=moment();return new BPromise(function(_0x49edb1,_0x56bb24){return _0x360c5a[_0x4139('0x32')][_0x4139('0x36')](_0x435bbc)[_0x4139('0x2b')](function(_0x1b0bde){_0x360c5a[_0x4139('0xc')][_0x435bbc['id']][_0x4139('0x35')]['status']=_0x4139('0x37');_0x360c5a[_0x4139('0xc')][_0x435bbc['id']][_0x4139('0x35')][_0x4139('0x14')]='';_0x360c5a[_0x4139('0x31')](_0x435bbc['id']);_0x49edb1(_0x1b0bde);})[_0x4139('0x2d')](function(_0x300fac){_0x360c5a[_0x4139('0xc')][_0x435bbc['id']]['Smtp'][_0x4139('0x13')]=_0x4139('0x21');_0x360c5a[_0x4139('0xc')][_0x435bbc['id']][_0x4139('0x35')][_0x4139('0x14')]=_0x300fac;_0x360c5a[_0x4139('0x31')](_0x435bbc['id']);_0x56bb24(_0x300fac);});});}return this[_0x4139('0x32')][_0x4139('0x36')](_0x435bbc);};module[_0x4139('0x38')]=EmailChannel; \ No newline at end of file +var _0xa2ca=['from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapError','sendMail','smtp','verifySmtp','Smtp','lastSync','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit','name','active','status','messageStatus','Imap','total','isNil','stringify','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','disabled','connected','messages','lastName'];(function(_0x56cb7c,_0x30e352){var _0x4d83e7=function(_0x3a8963){while(--_0x3a8963){_0x56cb7c['push'](_0x56cb7c['shift']());}};_0x4d83e7(++_0x30e352);}(_0xa2ca,0x19c));var _0xaa2c=function(_0x35b65e,_0x39b602){_0x35b65e=_0x35b65e-0x0;var _0xdaeb76=_0xa2ca[_0x35b65e];return _0xdaeb76;};'use strict';var _=require(_0xaa2c('0x0'));var moment=require(_0xaa2c('0x1'));var BPromise=require(_0xaa2c('0x2'));var md5=require(_0xaa2c('0x3'));var Redis=require(_0xaa2c('0x4'));var config=require('../../../config/environment');var logger=require(_0xaa2c('0x5'))(_0xaa2c('0x6'));config['redis']=_[_0xaa2c('0x7')](config[_0xaa2c('0x8')],{'host':_0xaa2c('0x9'),'port':0x18eb});var io=require(_0xaa2c('0xa'))(new Redis(config[_0xaa2c('0x8')]));var EmailImap=require(_0xaa2c('0xb'));var EmailSmtp=require(_0xaa2c('0xc'));var mailAccount=require(_0xaa2c('0xd'));var md5Accounts={};function EmailChannel(_0x56dbcf){logger[_0xaa2c('0xe')]('start\x20email\x20channel');this[_0xaa2c('0xf')]=_0x56dbcf['mailAccounts'];this[_0xaa2c('0x10')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x12')]=function(_0x59fc92){var _0x1ed1ac=this['mailAccounts'][_0x59fc92];var _0x157941={'id':_0x1ed1ac['id'],'name':_0x1ed1ac[_0xaa2c('0x13')],'key':_0x1ed1ac['key'],'active':_0x1ed1ac[_0xaa2c('0x14')],'Imap':{'status':_0x1ed1ac['Imap'][_0xaa2c('0x15')],'messageStatus':_0x1ed1ac['Imap'][_0xaa2c('0x16')],'total':_0x1ed1ac[_0xaa2c('0x17')][_0xaa2c('0x18')]}};if(_[_0xaa2c('0x19')](md5Accounts[_0x59fc92])){md5Accounts[_0x59fc92]={};}var _0x766654=md5(JSON[_0xaa2c('0x1a')](_0x157941));if(md5Accounts[_0x59fc92][_0xaa2c('0x3')]!==_0x766654){md5Accounts[_0x59fc92][_0xaa2c('0x3')]=_0x766654;io['emit'](_0xaa2c('0x1b'),_0x157941);}};EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x1c')]=function(_0x2cf4d5){for(var _0xf246e6 in _0x2cf4d5){if(_0x2cf4d5['hasOwnProperty'](_0xf246e6)){if(_0x2cf4d5[_0xf246e6]['Imap']&&_0x2cf4d5[_0xf246e6][_0xaa2c('0x14')]){var _0x24a156=_0x2cf4d5[_0xf246e6][_0xaa2c('0x17')];if(!_0x24a156[_0xaa2c('0x1d')]&&_0x2cf4d5[_0xf246e6][_0xaa2c('0x1e')]!==_0xaa2c('0x1f'))_0x24a156[_0xaa2c('0x1d')]=_0x2cf4d5[_0xf246e6][_0xaa2c('0x1e')];if(!this[_0xaa2c('0x10')][_0xaa2c('0x20')](_0x24a156['id'])){this[_0xaa2c('0x10')][_0x24a156['id']]=new EmailImap(_0x24a156,_0x2cf4d5[_0xf246e6][_0xaa2c('0x6')]);this['imapAccounts'][_0x24a156['id']]['on'](_0xaa2c('0x21'),this[_0xaa2c('0x22')]['bind'](this,_0xf246e6));this[_0xaa2c('0x10')][_0x24a156['id']]['on'](_0xaa2c('0x6'),this[_0xaa2c('0x23')][_0xaa2c('0x24')](this,_0xf246e6));this[_0xaa2c('0x10')][_0x24a156['id']]['on'](_0xaa2c('0x25'),this[_0xaa2c('0x26')][_0xaa2c('0x24')](this,_0xf246e6));this[_0xaa2c('0x10')][_0x24a156['id']]['on'](_0xaa2c('0x27'),this['handleImapError']['bind'](this,_0xf246e6));}}else{if(_[_0xaa2c('0x19')](this[_0xaa2c('0xf')][_0xf246e6][_0xaa2c('0x17')])){this[_0xaa2c('0xf')][_0xf246e6][_0xaa2c('0x17')]={};}this['mailAccounts'][_0xf246e6][_0xaa2c('0x17')][_0xaa2c('0x15')]=_0xaa2c('0x28');this[_0xaa2c('0xf')][_0xf246e6][_0xaa2c('0x17')][_0xaa2c('0x16')]='';this['emit'](_0xf246e6);}}}};EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x22')]=function(_0x45d584,_0x3aed80){if(this[_0xaa2c('0xf')][_0x45d584]){this[_0xaa2c('0xf')][_0x45d584][_0xaa2c('0x17')][_0xaa2c('0x15')]=_0xaa2c('0x29');this[_0xaa2c('0xf')][_0x45d584]['Imap'][_0xaa2c('0x16')]=_0x3aed80[_0xaa2c('0x13')];if(_0x3aed80[_0xaa2c('0x2a')]){this[_0xaa2c('0xf')][_0x45d584][_0xaa2c('0x17')][_0xaa2c('0x18')]=_0x3aed80[_0xaa2c('0x2a')]['total'];}return this[_0xaa2c('0x12')](_0x45d584);}};EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x23')]=function(_0x24c969,_0x4da86d){logger[_0xaa2c('0xe')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x4da86d['firstName'],_0x4da86d[_0xaa2c('0x2b')],_0x4da86d[_0xaa2c('0x2c')],_0x24c969);if(this['mailAccounts'][_0x24c969]){return mailAccount['notify'](_0x24c969,_0x4da86d)[_0xaa2c('0x2d')](function(_0x3d3ff0){if(_0x3d3ff0){logger[_0xaa2c('0xe')](_0xaa2c('0x2e'));}})[_0xaa2c('0x2f')](function(_0xee973){logger[_0xaa2c('0x27')](_0xaa2c('0x30'),JSON[_0xaa2c('0x1a')](_0xee973));});}};EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x26')]=function(_0x327aff){if(this['mailAccounts'][_0x327aff]&&this[_0xaa2c('0xf')][_0x327aff]['Imap']){if(this[_0xaa2c('0x10')][this[_0xaa2c('0xf')][_0x327aff][_0xaa2c('0x17')]['id']]){delete this[_0xaa2c('0x10')][this[_0xaa2c('0xf')][_0x327aff]['Imap']['id']];}this[_0xaa2c('0xf')][_0x327aff][_0xaa2c('0x17')]['lastSync']=moment();this[_0xaa2c('0x12')](_0x327aff);}};EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x31')]=function(_0x5dd1fc,_0x4eb695){if(this[_0xaa2c('0xf')][_0x5dd1fc]){this[_0xaa2c('0xf')][_0x5dd1fc]['Imap'][_0xaa2c('0x15')]='error';this[_0xaa2c('0xf')][_0x5dd1fc][_0xaa2c('0x17')]['messageStatus']=_0x4eb695;return this[_0xaa2c('0x12')](_0x5dd1fc);}};EmailChannel['prototype'][_0xaa2c('0x32')]=function(_0x80b642,_0x1d339d){return this[_0xaa2c('0x33')]['send'](_0x80b642,_0x1d339d);};EmailChannel[_0xaa2c('0x11')][_0xaa2c('0x34')]=function(_0x346a06){var _0x3f3d42=this;if(this[_0xaa2c('0xf')][_0x346a06['id']]){if(_[_0xaa2c('0x19')](this[_0xaa2c('0xf')][_0x346a06['id']][_0xaa2c('0x35')])){this[_0xaa2c('0xf')][_0x346a06['id']][_0xaa2c('0x35')]={};}this[_0xaa2c('0xf')][_0x346a06['id']]['Smtp'][_0xaa2c('0x36')]=moment();return new BPromise(function(_0x1d7747,_0x10f996){return _0x3f3d42[_0xaa2c('0x33')][_0xaa2c('0x37')](_0x346a06)[_0xaa2c('0x2d')](function(_0x22dd29){_0x3f3d42[_0xaa2c('0xf')][_0x346a06['id']][_0xaa2c('0x35')]['status']='verified';_0x3f3d42[_0xaa2c('0xf')][_0x346a06['id']][_0xaa2c('0x35')]['messageStatus']='';_0x3f3d42['emit'](_0x346a06['id']);_0x1d7747(_0x22dd29);})[_0xaa2c('0x2f')](function(_0x372d68){_0x3f3d42['mailAccounts'][_0x346a06['id']][_0xaa2c('0x35')][_0xaa2c('0x15')]=_0xaa2c('0x27');_0x3f3d42[_0xaa2c('0xf')][_0x346a06['id']][_0xaa2c('0x35')][_0xaa2c('0x16')]=_0x372d68;_0x3f3d42[_0xaa2c('0x12')](_0x346a06['id']);_0x10f996(_0x372d68);});});}return this[_0xaa2c('0x33')][_0xaa2c('0x37')](_0x346a06);};module[_0xaa2c('0x38')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 72f5dd7..a0ff552 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 _0xa2d1=['message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','emit','textCode','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','account','getAccount','once','ready','handleReady','end','handleEnd','bind','handleError','connect','inherits','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','email','host','port','tls','autotls','required','openBox','handleOpenBox','readUnseen','handleCloseBox','prototype','search','handleReadUnseen','fetch'];(function(_0x485475,_0x50eb64){var _0x133f4d=function(_0x5265d5){while(--_0x5265d5){_0x485475['push'](_0x485475['shift']());}};_0x133f4d(++_0x50eb64);}(_0xa2d1,0x184));var _0x1a2d=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0xa2d1[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require('lodash');var util=require(_0x1a2d('0x0'));var Imap=require(_0x1a2d('0x1'));var simpleParser=require(_0x1a2d('0x2'))[_0x1a2d('0x3')];var Iconv=require(_0x1a2d('0x4'))[_0x1a2d('0x5')];var EventEmitter=require(_0x1a2d('0x6'))[_0x1a2d('0x7')];var utils=require(_0x1a2d('0x8'));var logger=require(_0x1a2d('0x9'))('email');function EmailImap(_0x1a98d3,_0x2c20ae){this[_0x1a2d('0xa')]=_0x1a98d3[_0x1a2d('0xa')];this[_0x1a2d('0xb')]=this[_0x1a2d('0xc')](_0x1a98d3,_0x2c20ae);this['imap']=new Imap(this[_0x1a2d('0xb')]);this[_0x1a2d('0x1')][_0x1a2d('0xd')](_0x1a2d('0xe'),this[_0x1a2d('0xf')]['bind'](this));this[_0x1a2d('0x1')][_0x1a2d('0xd')](_0x1a2d('0x10'),this[_0x1a2d('0x11')][_0x1a2d('0x12')](this));this[_0x1a2d('0x1')]['on']('error',this[_0x1a2d('0x13')][_0x1a2d('0x12')](this));this[_0x1a2d('0x1')][_0x1a2d('0x14')]();}util[_0x1a2d('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x1a2d('0xc')]=function(_0x55df3b,_0x3838e5){var _0x1f6a16={'connTimeout':_0x55df3b['connTimeout']?_0x55df3b[_0x1a2d('0x16')]*0x3e8:0x2710,'authTimeout':_0x55df3b[_0x1a2d('0x17')]?_0x55df3b['authTimeout']*0x3e8:0x1388};if(_0x55df3b[_0x1a2d('0x18')]){_0x1f6a16[_0x1a2d('0x19')]=_0x55df3b[_0x1a2d('0x19')];if(_0x55df3b[_0x1a2d('0x1a')]){_0x1f6a16[_0x1a2d('0x1b')]=utils[_0x1a2d('0x1c')](_0x55df3b[_0x1a2d('0x1d')][_0x1a2d('0x1e')],_0x55df3b[_0x1a2d('0x19')]);}else{_0x1f6a16[_0x1a2d('0x1f')]=_0x55df3b['password'];}}else{if(_0x55df3b['authentication']){_0x1f6a16['user']=_0x55df3b[_0x1a2d('0x19')];_0x1f6a16[_0x1a2d('0x1f')]=_0x55df3b[_0x1a2d('0x1f')];}}_0x1f6a16[_0x1a2d('0x20')]=_0x3838e5||_0x55df3b[_0x1a2d('0x19')]||'anonymous@xcally.com';_0x1f6a16[_0x1a2d('0x21')]=_0x55df3b[_0x1a2d('0x21')];_0x1f6a16[_0x1a2d('0x22')]=_0x55df3b['port']||0x3e1;if(_0x55df3b[_0x1a2d('0x23')]){_0x1f6a16['tls']=!![];}else{_0x1f6a16[_0x1a2d('0x23')]=![];_0x1f6a16[_0x1a2d('0x24')]=_0x1a2d('0x25');}return _0x1f6a16;};EmailImap['prototype'][_0x1a2d('0xf')]=function(){this[_0x1a2d('0x1')][_0x1a2d('0x26')](this[_0x1a2d('0xa')],![],this[_0x1a2d('0x27')]['bind'](this));};EmailImap['prototype'][_0x1a2d('0x27')]=function(_0x2a185b,_0x365b20){if(_0x2a185b){this['handleError'](_0x2a185b,!![]);}else{this['emit']('box',_0x365b20);this[_0x1a2d('0x28')]();}};EmailImap['prototype'][_0x1a2d('0x29')]=function(_0x284d0c){if(_0x284d0c){this[_0x1a2d('0x13')](_0x284d0c,!![]);}else{this['imap']['end']();}};EmailImap[_0x1a2d('0x2a')]['readUnseen']=function(){this[_0x1a2d('0x1')][_0x1a2d('0x2b')](['UNSEEN'],this[_0x1a2d('0x2c')]['bind'](this));};EmailImap[_0x1a2d('0x2a')][_0x1a2d('0x2c')]=function(_0x4d347b,_0x59b41c){if(_0x4d347b){this[_0x1a2d('0x13')](_0x4d347b,!![]);}else{if(_0x59b41c['length']){try{var _0x43389e=this[_0x1a2d('0x1')][_0x1a2d('0x2d')](_0x59b41c,{'bodies':'','markSeen':!![]});_0x43389e['on'](_0x1a2d('0x2e'),this[_0x1a2d('0x2f')][_0x1a2d('0x12')](this));_0x43389e['once'](_0x1a2d('0x30'),this[_0x1a2d('0x31')]['bind'](this));_0x43389e[_0x1a2d('0xd')](_0x1a2d('0x10'),this[_0x1a2d('0x32')][_0x1a2d('0x12')](this));}catch(_0xafe188){logger[_0x1a2d('0x30')](_0xafe188);}}else{this[_0x1a2d('0x1')][_0x1a2d('0x33')](!![],this[_0x1a2d('0x29')]['bind'](this));}}};EmailImap['prototype'][_0x1a2d('0x2f')]=function(_0x3d76e0){_0x3d76e0['on'](_0x1a2d('0x34'),this[_0x1a2d('0x35')][_0x1a2d('0x12')](this));_0x3d76e0[_0x1a2d('0xd')](_0x1a2d('0x36'),this[_0x1a2d('0x37')][_0x1a2d('0x12')](this));_0x3d76e0[_0x1a2d('0xd')](_0x1a2d('0x10'),this[_0x1a2d('0x38')]['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0x576de9){simpleParser(_0x576de9,{'Iconv':Iconv},this['handleSimpleParser'][_0x1a2d('0x12')](this));};EmailImap[_0x1a2d('0x2a')]['handleMessageAttributes']=function(){};EmailImap[_0x1a2d('0x2a')][_0x1a2d('0x38')]=function(){};EmailImap[_0x1a2d('0x2a')]['handleSimpleParser']=function(_0x298a6c,_0xefab37){if(_0x298a6c){logger[_0x1a2d('0x30')](_0x298a6c);}else{var _0x5fd966=this;utils[_0x1a2d('0x39')](this[_0x1a2d('0xb')],_0xefab37,function(_0x46132b){_0x5fd966[_0x1a2d('0x3a')](_0x1a2d('0x20'),_0x46132b);});}};EmailImap[_0x1a2d('0x2a')][_0x1a2d('0x32')]=function(){this[_0x1a2d('0x1')][_0x1a2d('0x33')](!![],this[_0x1a2d('0x29')][_0x1a2d('0x12')](this));};EmailImap[_0x1a2d('0x2a')][_0x1a2d('0x31')]=function(_0x433df5){this[_0x1a2d('0x13')](_0x433df5);this[_0x1a2d('0x1')]['closeBox'](!![],this[_0x1a2d('0x29')][_0x1a2d('0x12')](this));};EmailImap[_0x1a2d('0x2a')]['handleEnd']=function(){this['emit']('end');};EmailImap['prototype'][_0x1a2d('0x13')]=function(_0x55d83f,_0x4937e2){logger[_0x1a2d('0x30')](_0x1a2d('0x13'),this[_0x1a2d('0xb')]['email'],JSON['stringify'](_0x55d83f));var _0x5638db='';if(_0x55d83f){if(_0x55d83f[_0x1a2d('0x3b')]){_0x5638db=_0x55d83f[_0x1a2d('0x3b')];}else{for(var _0x16059f in _0x55d83f){if(_0x55d83f['hasOwnProperty'](_0x16059f)){_0x5638db+=_[_0x1a2d('0x3c')](_0x16059f)+':\x20'+_0x55d83f[_0x16059f]+'\x0a';}}}}if(_0x4937e2){this[_0x1a2d('0x1')][_0x1a2d('0x10')]();}else{this[_0x1a2d('0x3a')](_0x1a2d('0x30'),_0x5638db);this[_0x1a2d('0x3a')](_0x1a2d('0x10'));}};module[_0x1a2d('0x3d')]=EmailImap; \ No newline at end of file +var _0x9a42=['account','getAccount','once','ready','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','prototype','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','anonymous@xcally.com','host','port','tls','openBox','handleOpenBox','emit','box','readUnseen','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleMessageAttributes','handleMessageBody','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','handleCloseBox','stringify','hasOwnProperty','upperFirst','lodash','imap','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox'];(function(_0x43a602,_0x4fe4ef){var _0x5b085c=function(_0xf6f6c4){while(--_0xf6f6c4){_0x43a602['push'](_0x43a602['shift']());}};_0x5b085c(++_0x4fe4ef);}(_0x9a42,0x69));var _0x29a4=function(_0x53f875,_0x5587b0){_0x53f875=_0x53f875-0x0;var _0x586381=_0x9a42[_0x53f875];return _0x586381;};'use strict';var _=require(_0x29a4('0x0'));var util=require('util');var Imap=require(_0x29a4('0x1'));var simpleParser=require(_0x29a4('0x2'))[_0x29a4('0x3')];var Iconv=require(_0x29a4('0x4'))[_0x29a4('0x5')];var EventEmitter=require(_0x29a4('0x6'))['EventEmitter'];var utils=require(_0x29a4('0x7'));var logger=require(_0x29a4('0x8'))(_0x29a4('0x9'));function EmailImap(_0x28ac73,_0x2aa85e){this[_0x29a4('0xa')]=_0x28ac73[_0x29a4('0xa')];this[_0x29a4('0xb')]=this[_0x29a4('0xc')](_0x28ac73,_0x2aa85e);this[_0x29a4('0x1')]=new Imap(this[_0x29a4('0xb')]);this[_0x29a4('0x1')][_0x29a4('0xd')](_0x29a4('0xe'),this[_0x29a4('0xf')]['bind'](this));this['imap']['once'](_0x29a4('0x10'),this[_0x29a4('0x11')][_0x29a4('0x12')](this));this[_0x29a4('0x1')]['on'](_0x29a4('0x13'),this[_0x29a4('0x14')][_0x29a4('0x12')](this));this[_0x29a4('0x1')][_0x29a4('0x15')]();}util[_0x29a4('0x16')](EmailImap,EventEmitter);EmailImap[_0x29a4('0x17')]['getAccount']=function(_0x388575,_0x2a2b4d){var _0x37eed5={'connTimeout':_0x388575['connTimeout']?_0x388575['connTimeout']*0x3e8:0x2710,'authTimeout':_0x388575[_0x29a4('0x18')]?_0x388575[_0x29a4('0x18')]*0x3e8:0x1388};if(_0x388575[_0x29a4('0x19')]){_0x37eed5['user']=_0x388575[_0x29a4('0x1a')];if(_0x388575[_0x29a4('0x1b')]){_0x37eed5[_0x29a4('0x1c')]=utils[_0x29a4('0x1d')](_0x388575[_0x29a4('0x1e')][_0x29a4('0x1f')],_0x388575[_0x29a4('0x1a')]);}else{_0x37eed5[_0x29a4('0x20')]=_0x388575[_0x29a4('0x20')];}}else{if(_0x388575['authentication']){_0x37eed5[_0x29a4('0x1a')]=_0x388575[_0x29a4('0x1a')];_0x37eed5[_0x29a4('0x20')]=_0x388575[_0x29a4('0x20')];}}_0x37eed5[_0x29a4('0x9')]=_0x2a2b4d||_0x388575[_0x29a4('0x1a')]||_0x29a4('0x21');_0x37eed5[_0x29a4('0x22')]=_0x388575['host'];_0x37eed5[_0x29a4('0x23')]=_0x388575[_0x29a4('0x23')]||0x3e1;if(_0x388575[_0x29a4('0x24')]){_0x37eed5[_0x29a4('0x24')]=!![];}else{_0x37eed5[_0x29a4('0x24')]=![];_0x37eed5['autotls']='required';}return _0x37eed5;};EmailImap[_0x29a4('0x17')][_0x29a4('0xf')]=function(){this['imap'][_0x29a4('0x25')](this['mailbox'],![],this[_0x29a4('0x26')][_0x29a4('0x12')](this));};EmailImap[_0x29a4('0x17')][_0x29a4('0x26')]=function(_0x4603a0,_0x2f3346){if(_0x4603a0){this[_0x29a4('0x14')](_0x4603a0,!![]);}else{this[_0x29a4('0x27')](_0x29a4('0x28'),_0x2f3346);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x40ed32){if(_0x40ed32){this['handleError'](_0x40ed32,!![]);}else{this['imap'][_0x29a4('0x10')]();}};EmailImap[_0x29a4('0x17')][_0x29a4('0x29')]=function(){this[_0x29a4('0x1')]['search'](['UNSEEN'],this[_0x29a4('0x2a')]['bind'](this));};EmailImap['prototype'][_0x29a4('0x2a')]=function(_0x16ff24,_0x14c62b){if(_0x16ff24){this[_0x29a4('0x14')](_0x16ff24,!![]);}else{if(_0x14c62b[_0x29a4('0x2b')]){try{var _0xfaece0=this[_0x29a4('0x1')]['fetch'](_0x14c62b,{'bodies':'','markSeen':!![]});_0xfaece0['on'](_0x29a4('0x2c'),this[_0x29a4('0x2d')][_0x29a4('0x12')](this));_0xfaece0[_0x29a4('0xd')]('error',this[_0x29a4('0x2e')][_0x29a4('0x12')](this));_0xfaece0[_0x29a4('0xd')](_0x29a4('0x10'),this['handleFetchEnd'][_0x29a4('0x12')](this));}catch(_0x3c2d53){logger[_0x29a4('0x13')](_0x3c2d53);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0x29a4('0x12')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x37dbe2){_0x37dbe2['on']('body',this['handleMessageBody'][_0x29a4('0x12')](this));_0x37dbe2[_0x29a4('0xd')]('attributes',this[_0x29a4('0x2f')][_0x29a4('0x12')](this));_0x37dbe2[_0x29a4('0xd')](_0x29a4('0x10'),this['handleMessageEnd'][_0x29a4('0x12')](this));};EmailImap[_0x29a4('0x17')][_0x29a4('0x30')]=function(_0x5350dd){simpleParser(_0x5350dd,{'Iconv':Iconv},this['handleSimpleParser'][_0x29a4('0x12')](this));};EmailImap['prototype'][_0x29a4('0x2f')]=function(){};EmailImap[_0x29a4('0x17')][_0x29a4('0x31')]=function(){};EmailImap['prototype'][_0x29a4('0x32')]=function(_0x5ebc92,_0x577322){if(_0x5ebc92){logger['error'](_0x5ebc92);}else{var _0x51690c=this;utils[_0x29a4('0x33')](this[_0x29a4('0xb')],_0x577322,function(_0x35403c){_0x51690c[_0x29a4('0x27')](_0x29a4('0x9'),_0x35403c);});}};EmailImap['prototype'][_0x29a4('0x34')]=function(){this[_0x29a4('0x1')][_0x29a4('0x35')](!![],this[_0x29a4('0x36')][_0x29a4('0x12')](this));};EmailImap['prototype'][_0x29a4('0x2e')]=function(_0x4dd48f){this[_0x29a4('0x14')](_0x4dd48f);this['imap']['closeBox'](!![],this[_0x29a4('0x36')][_0x29a4('0x12')](this));};EmailImap[_0x29a4('0x17')][_0x29a4('0x11')]=function(){this[_0x29a4('0x27')](_0x29a4('0x10'));};EmailImap['prototype'][_0x29a4('0x14')]=function(_0x38d79c,_0x5ad18f){logger[_0x29a4('0x13')]('handleError',this['account'][_0x29a4('0x9')],JSON[_0x29a4('0x37')](_0x38d79c));var _0x41b6b9='';if(_0x38d79c){if(_0x38d79c['textCode']){_0x41b6b9=_0x38d79c['textCode'];}else{for(var _0x52537a in _0x38d79c){if(_0x38d79c[_0x29a4('0x38')](_0x52537a)){_0x41b6b9+=_[_0x29a4('0x39')](_0x52537a)+':\x20'+_0x38d79c[_0x52537a]+'\x0a';}}}}if(_0x5ad18f){this[_0x29a4('0x1')][_0x29a4('0x10')]();}else{this[_0x29a4('0x27')](_0x29a4('0x13'),_0x41b6b9);this[_0x29a4('0x27')](_0x29a4('0x10'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e7cdaa3..1ac2d4b 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 _0xc50b=['toString','prototype','verify','createTransport','Not\x20verifired','exports','nodemailer-plugin-inline-base64','use','compile','sendMail'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc50b,0x7e));var _0xbc50=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xc50b[_0x1b828b];return _0x98da1a;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xbc50('0x0'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x48e95f,_0x475502){return new Promise(function(_0x432b76,_0xc36593){var _0x2bcadd=nodemailer['createTransport'](_0x48e95f);_0x2bcadd[_0xbc50('0x1')](_0xbc50('0x2'),inlineBase64());_0x2bcadd[_0xbc50('0x3')](_0x475502,function(_0x1d7125,_0x1d25da){if(_0x1d7125){_0xc36593(_0x1d7125[_0xbc50('0x4')]());}else{_0x432b76(_0x1d25da);}});});};EmailSmtp[_0xbc50('0x5')][_0xbc50('0x6')]=function(_0x2c5ac9){return new Promise(function(_0x1024cc,_0x5f4832){var _0x11cee7=nodemailer[_0xbc50('0x7')](_0x2c5ac9);_0x11cee7['verify'](function(_0x32f14a,_0x15d6bc){if(_0x32f14a){_0x5f4832(_0x32f14a[_0xbc50('0x4')]());}else{if(_0x15d6bc){_0x1024cc(_0x15d6bc);}else{_0x5f4832(_0xbc50('0x8'));}}});});};module[_0xbc50('0x9')]=EmailSmtp; \ No newline at end of file +var _0x4b68=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x4b68,0x68));var _0x84b6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4b68[_0xfae23b];return _0x200640;};'use strict';var nodemailer=require(_0x84b6('0x0'));var inlineBase64=require(_0x84b6('0x1'));function EmailSmtp(){}EmailSmtp[_0x84b6('0x2')]['send']=function(_0xca77f9,_0x2a5ebe){return new Promise(function(_0x102d95,_0x2db563){var _0xaed103=nodemailer[_0x84b6('0x3')](_0xca77f9);_0xaed103[_0x84b6('0x4')](_0x84b6('0x5'),inlineBase64());_0xaed103[_0x84b6('0x6')](_0x2a5ebe,function(_0x68faec,_0x3b36f6){if(_0x68faec){_0x2db563(_0x68faec[_0x84b6('0x7')]());}else{_0x102d95(_0x3b36f6);}});});};EmailSmtp[_0x84b6('0x2')]['verify']=function(_0x5e0f06){return new Promise(function(_0x5363e6,_0x2a0e9c){var _0x3bdee5=nodemailer[_0x84b6('0x3')](_0x5e0f06);_0x3bdee5[_0x84b6('0x8')](function(_0x2ba1a1,_0x32c628){if(_0x2ba1a1){_0x2a0e9c(_0x2ba1a1[_0x84b6('0x7')]());}else{if(_0x32c628){_0x5363e6(_0x32c628);}else{_0x2a0e9c(_0x84b6('0x9'));}}});});};module[_0x84b6('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 1c4f6f2..e40eb5b 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 _0xfc86=['%s-%s','now','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','indexOf','line','isAutoreply','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','Attachments','Title','

Empty\x20message

','user=','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','generate','name','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','@xcally.com','html','includes','','body','textAsHtml','0x1?_0xaea274[_0x6fc8('0xe')](0x0,-0x1)[_0x6fc8('0xf')]('\x20'):_0x3c21a1['name'];}return _0x6fc8('0x10');}function getLastName(_0x5bcd82){var _0x49d908=_[_0x6fc8('0x7')](_0x5bcd82[_0x6fc8('0x8')]);if(_0x49d908&&_0x49d908['name']){var _0x56d8b2=_0x49d908[_0x6fc8('0xb')]['split'](/\s+/);return _0x56d8b2[_0x6fc8('0xd')]>0x1?_0x56d8b2[_0x6fc8('0x11')]():'';}return'';}function getMails(_0x4a9d9d,_0x222c3a){var _0x56dc8='';for(var _0x460540=0x0;_0x460540<_0x222c3a[_0x6fc8('0x8')]['length'];_0x460540+=0x1){if(_0x222c3a[_0x6fc8('0x8')][_0x460540][_0x6fc8('0x9')]!==_0x4a9d9d){if(!_[_0x6fc8('0x12')](_0x56dc8)){_0x56dc8+=',';}_0x56dc8+=_0x222c3a['value'][_0x460540][_0x6fc8('0xb')]||_0x222c3a[_0x6fc8('0x8')][_0x460540]['address']||'';_0x56dc8+='\x20<';_0x56dc8+=_0x222c3a[_0x6fc8('0x8')][_0x460540]['address']?_0x222c3a['value'][_0x460540][_0x6fc8('0x9')]:_0x6fc8('0x13')+random['generate'](0x6)+_0x6fc8('0x14');_0x56dc8+='>';}}return _0x56dc8;}function parseEmail(_0x53437e,_0x5efb90,_0x4048ff){if(_0x5efb90['html']){var _0x31d2ca=/)<[^<]*)*<\/script>/gi;while(_0x31d2ca['test'](_0x5efb90['html'])){_0x5efb90[_0x6fc8('0x15')]=_0x5efb90['html']['replace'](_0x31d2ca,'');}if(_0x5efb90[_0x6fc8('0x15')][_0x6fc8('0x16')](_0x6fc8('0x17'))){var _0x4c5242=[];_0x5efb90[_0x6fc8('0x18')][_0x6fc8('0x19')](_0x3b100e=>{_0x4c5242['push'](_0x3b100e[_0x6fc8('0x1a')]);});var _0xef44b1=/]+>/g;var _0x43c1c6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xd299ad=_0x5efb90[_0x6fc8('0x15')][_0x6fc8('0x1b')](_0x43c1c6,_0x6fc8('0x1c'));var _0x4e5971=_0xd299ad[_0x6fc8('0x1b')](_0xef44b1,_0x6fc8('0x1d'));for(let _0x536240=0x0;_0x536240<_0x4c5242[_0x6fc8('0xd')];_0x536240++){var _0x68143d=_0x4e5971[_0x6fc8('0x1b')](_0x6fc8('0x1d'),'\x20[Attachment:\x20'+_0x4c5242[_0x536240]+_0x6fc8('0x1e'));_0x4e5971=_0x68143d;}_0x5efb90[_0x6fc8('0x15')]=_0x4e5971;}_0x4048ff[_0x6fc8('0x1f')]=_0x5efb90[_0x6fc8('0x15')];}else{_0x4048ff[_0x6fc8('0x1f')]=_0x5efb90[_0x6fc8('0x20')];}if(_0x4048ff['body']){_0x4048ff['body']=_0x4048ff[_0x6fc8('0x1f')][_0x6fc8('0x1b')](/0x0){var _0x115eb6=[_0x6fc8('0x2f'),_0x6fc8('0x30'),'Precedence:\x20auto_reply'];for(var _0x52124a=0x0;_0x52124a<_0x5efb90[_0x6fc8('0x2e')][_0x6fc8('0xd')];_0x52124a++){var _0x3fa93c=_[_0x6fc8('0x31')](_0x115eb6,_0x5efb90[_0x6fc8('0x2e')][_0x52124a][_0x6fc8('0x32')]);if(_0x3fa93c>=0x0){_0x4048ff[_0x6fc8('0x33')]=!![];}}}return _0x4048ff;}exports['parser']=function(_0x7b935e,_0x5829f1,_0x4bbf45){var _0x6750a7={'from':getAddress(_0x5829f1[_0x6fc8('0x34')]),'firstName':getFirstName(_0x5829f1[_0x6fc8('0x34')]),'lastName':getLastName(_0x5829f1[_0x6fc8('0x34')]),'mapKey':_0x6fc8('0x6'),'message':{'from':getMails(_0x7b935e[_0x6fc8('0x6')],_0x5829f1[_0x6fc8('0x34')]),'to':_0x7b935e[_0x6fc8('0x6')],'cc':'','subject':_0x5829f1['subject']||'','messageId':_0x5829f1['messageId'],'inReplyTo':_0x5829f1[_0x6fc8('0x35')],'sentAt':moment(_0x5829f1[_0x6fc8('0x36')])['format'](_0x6fc8('0x37')),'attach':![],'attachments':[]}};if(!_0x5829f1['html']&&!_0x5829f1[_0x6fc8('0x20')]){var _0x2a51b1=_[_0x6fc8('0x38')](_0x5829f1[_0x6fc8('0x18')],{'contentType':_0x6fc8('0x39')});if(_0x2a51b1[_0x6fc8('0xd')]){logger['info'](util[_0x6fc8('0x26')](_0x6fc8('0x3a'),_0x5829f1[_0x6fc8('0x3b')]));tnef[_0x6fc8('0x3c')](_[_0x6fc8('0x3d')](_0x2a51b1)['content'],function(_0x599729,_0xacc0e8){if(_0xacc0e8){_0x5829f1[_0x6fc8('0x15')]=_0xacc0e8['BodyHTML']||'

Empty\x20message

';if(_0xacc0e8[_0x6fc8('0x3e')]){for(var _0x10d411=0x0;_0x10d411<_0xacc0e8[_0x6fc8('0x3e')][_0x6fc8('0xd')];_0x10d411++){var _0x5a8b4f=_0xacc0e8['Attachments'][_0x10d411];_0x6750a7['message'][_0x6fc8('0x18')][_0x6fc8('0x2c')]({'filename':_0x5a8b4f[_0x6fc8('0x3f')],'content':Buffer['from'](_0x5a8b4f['Data'])});}}}_0x4bbf45(parseEmail(_0x7b935e,_0x5829f1,_0x6750a7));});}else{_0x5829f1[_0x6fc8('0x15')]=_0x6fc8('0x40');_0x4bbf45(parseEmail(_0x7b935e,_0x5829f1,_0x6750a7));}}else{_0x4bbf45(parseEmail(_0x7b935e,_0x5829f1,_0x6750a7));}};exports['generateXOAuth2Token']=function(_0x1694f,_0x23a7c3){var _0x5aef8c=[_0x6fc8('0x41')+(_0x23a7c3||''),'auth=Bearer\x20'+_0x1694f,'',''];return Buffer[_0x6fc8('0x34')](_0x5aef8c['join'](''),'utf-8')[_0x6fc8('0x42')](_0x6fc8('0x43'));}; \ No newline at end of file +var _0x36a0=['Precedence:\x20auto_reply','line','isAutoreply','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','@xcally.com','value','name','substring','indexOf','split','slice','pop','length','isEmpty','anonymous','generate','html','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','includes','originCc','attachment','filename','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x36a0,0x194));var _0x036a=function(_0x495bbb,_0x3735af){_0x495bbb=_0x495bbb-0x0;var _0x5acf04=_0x36a0[_0x495bbb];return _0x5acf04;};'use strict';var _=require('lodash');var moment=require(_0x036a('0x0'));var random=require(_0x036a('0x1'));var fs=require('fs');var path=require(_0x036a('0x2'));var util=require(_0x036a('0x3'));var tnef=require(_0x036a('0x4'));var logger=require(_0x036a('0x5'))(_0x036a('0x6'));var config=require(_0x036a('0x7'));function getAddress(_0x594808){var _0xf3eade=_[_0x036a('0x8')](_0x594808['value']);return _0xf3eade&&_0xf3eade[_0x036a('0x9')]?_0xf3eade[_0x036a('0x9')]:'anonymous'+random['generate'](0x6)+_0x036a('0xa');}function getFirstName(_0xad7d37){var _0x3e3b7e=_[_0x036a('0x8')](_0xad7d37[_0x036a('0xb')]);if(_0x3e3b7e&&_0x3e3b7e[_0x036a('0xc')]){if(_0x3e3b7e[_0x036a('0xc')]==_0x3e3b7e['address']){return _0x3e3b7e[_0x036a('0xc')][_0x036a('0xd')](0x0,_0x3e3b7e[_0x036a('0xc')][_0x036a('0xe')]('@'));}var _0x37512a=_0x3e3b7e['name'][_0x036a('0xf')](/\s+/);return _0x37512a['length']>0x1?_0x37512a[_0x036a('0x10')](0x0,-0x1)['join']('\x20'):_0x3e3b7e[_0x036a('0xc')];}return'Anonymous';}function getLastName(_0x234a27){var _0x3a9e42=_[_0x036a('0x8')](_0x234a27[_0x036a('0xb')]);if(_0x3a9e42&&_0x3a9e42[_0x036a('0xc')]){var _0x14d585=_0x3a9e42[_0x036a('0xc')][_0x036a('0xf')](/\s+/);return _0x14d585['length']>0x1?_0x14d585[_0x036a('0x11')]():'';}return'';}function getMails(_0x3e689b,_0x3e7fef){var _0x5b7be0='';for(var _0x5b584b=0x0;_0x5b584b<_0x3e7fef['value'][_0x036a('0x12')];_0x5b584b+=0x1){if(_0x3e7fef[_0x036a('0xb')][_0x5b584b]['address']!==_0x3e689b){if(!_[_0x036a('0x13')](_0x5b7be0)){_0x5b7be0+=',';}_0x5b7be0+=_0x3e7fef[_0x036a('0xb')][_0x5b584b][_0x036a('0xc')]||_0x3e7fef[_0x036a('0xb')][_0x5b584b]['address']||'';_0x5b7be0+='\x20<';_0x5b7be0+=_0x3e7fef['value'][_0x5b584b][_0x036a('0x9')]?_0x3e7fef[_0x036a('0xb')][_0x5b584b][_0x036a('0x9')]:_0x036a('0x14')+random[_0x036a('0x15')](0x6)+'@xcally.com';_0x5b7be0+='>';}}return _0x5b7be0;}function parseEmail(_0x331ebb,_0x286572,_0x5cf0f5){if(_0x286572[_0x036a('0x16')]){var _0x773941=/)<[^<]*)*<\/script>/gi;while(_0x773941['test'](_0x286572[_0x036a('0x16')])){_0x286572['html']=_0x286572[_0x036a('0x16')][_0x036a('0x17')](_0x773941,'');}if(_0x286572[_0x036a('0x16')]['includes'](_0x036a('0x18'))){var _0x5518ab=[];_0x286572[_0x036a('0x19')][_0x036a('0x1a')](_0x1c6f4f=>{_0x5518ab[_0x036a('0x1b')](_0x1c6f4f['filename']);});var _0x16f0a7=/]+>/g;var _0x356365=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x496152=_0x286572[_0x036a('0x16')][_0x036a('0x17')](_0x356365,_0x036a('0x1c'));var _0x18724e=_0x496152[_0x036a('0x17')](_0x16f0a7,_0x036a('0x1d'));for(let _0x269cff=0x0;_0x269cff<_0x5518ab[_0x036a('0x12')];_0x269cff++){var _0x4d2eae=_0x18724e[_0x036a('0x17')](_0x036a('0x1d'),_0x036a('0x1e')+_0x5518ab[_0x269cff]+_0x036a('0x1f'));_0x18724e=_0x4d2eae;}_0x286572[_0x036a('0x16')]=_0x18724e;}_0x5cf0f5['body']=_0x286572['html'];}else{_0x5cf0f5[_0x036a('0x20')]=_0x286572[_0x036a('0x21')];}if(_0x5cf0f5[_0x036a('0x20')]){_0x5cf0f5[_0x036a('0x20')]=_0x5cf0f5[_0x036a('0x20')]['replace'](/0x0){var _0x57ca26=[_0x036a('0x32'),_0x036a('0x33'),_0x036a('0x34')];for(var _0x2ff7b3=0x0;_0x2ff7b3<_0x286572[_0x036a('0x31')][_0x036a('0x12')];_0x2ff7b3++){var _0x4ea3fd=_[_0x036a('0xe')](_0x57ca26,_0x286572[_0x036a('0x31')][_0x2ff7b3][_0x036a('0x35')]);if(_0x4ea3fd>=0x0){_0x5cf0f5[_0x036a('0x36')]=!![];}}}return _0x5cf0f5;}exports['parser']=function(_0x41b8d6,_0x3af69f,_0x559bd8){var _0x58d1a0={'from':getAddress(_0x3af69f[_0x036a('0x37')]),'firstName':getFirstName(_0x3af69f[_0x036a('0x37')]),'lastName':getLastName(_0x3af69f[_0x036a('0x37')]),'mapKey':_0x036a('0x6'),'message':{'from':getMails(_0x41b8d6[_0x036a('0x6')],_0x3af69f[_0x036a('0x37')]),'to':_0x41b8d6[_0x036a('0x6')],'cc':'','subject':_0x3af69f['subject']||'','messageId':_0x3af69f[_0x036a('0x38')],'inReplyTo':_0x3af69f[_0x036a('0x39')],'sentAt':moment(_0x3af69f[_0x036a('0x3a')])[_0x036a('0x29')](_0x036a('0x3b')),'attach':![],'attachments':[]}};if(!_0x3af69f[_0x036a('0x16')]&&!_0x3af69f[_0x036a('0x21')]){var _0x32d716=_[_0x036a('0x3c')](_0x3af69f[_0x036a('0x19')],{'contentType':_0x036a('0x3d')});if(_0x32d716[_0x036a('0x12')]){logger[_0x036a('0x3e')](util[_0x036a('0x29')](_0x036a('0x3f'),_0x3af69f['messageId']));tnef[_0x036a('0x40')](_[_0x036a('0x41')](_0x32d716)['content'],function(_0x23d12d,_0x379e3f){if(_0x379e3f){_0x3af69f[_0x036a('0x16')]=_0x379e3f[_0x036a('0x42')]||_0x036a('0x43');if(_0x379e3f['Attachments']){for(var _0x2fb23a=0x0;_0x2fb23a<_0x379e3f[_0x036a('0x44')][_0x036a('0x12')];_0x2fb23a++){var _0x514f2d=_0x379e3f[_0x036a('0x44')][_0x2fb23a];_0x58d1a0['message']['attachments'][_0x036a('0x1b')]({'filename':_0x514f2d[_0x036a('0x45')],'content':Buffer[_0x036a('0x37')](_0x514f2d['Data'])});}}}_0x559bd8(parseEmail(_0x41b8d6,_0x3af69f,_0x58d1a0));});}else{_0x3af69f[_0x036a('0x16')]=_0x036a('0x43');_0x559bd8(parseEmail(_0x41b8d6,_0x3af69f,_0x58d1a0));}}else{_0x559bd8(parseEmail(_0x41b8d6,_0x3af69f,_0x58d1a0));}};exports[_0x036a('0x46')]=function(_0x57edad,_0xc83dc9){var _0x150da2=[_0x036a('0x47')+(_0xc83dc9||''),_0x036a('0x48')+_0x57edad,'',''];return Buffer[_0x036a('0x37')](_0x150da2[_0x036a('0x2c')](''),_0x036a('0x49'))[_0x036a('0x4a')](_0x036a('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d7463ea..21335a7 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 _0xba16=['Smtp','lodash','name','Service','key','SERV','active','Imap'];(function(_0x283ed5,_0xeafd48){var _0x4693b1=function(_0x2b0533){while(--_0x2b0533){_0x283ed5['push'](_0x283ed5['shift']());}};_0x4693b1(++_0xeafd48);}(_0xba16,0xe1));var _0x6ba1=function(_0x3d4a2b,_0xca71a8){_0x3d4a2b=_0x3d4a2b-0x0;var _0x5c55c6=_0xba16[_0x3d4a2b];return _0x5c55c6;};'use strict';var _=require(_0x6ba1('0x0'));function MailAccount(_0x2aeffe){this['id']=_0x2aeffe['id']||0x0;this[_0x6ba1('0x1')]=_0x2aeffe[_0x6ba1('0x1')]||_0x6ba1('0x2');this[_0x6ba1('0x3')]=_0x2aeffe[_0x6ba1('0x3')]||_0x6ba1('0x4');this['active']=_0x2aeffe[_0x6ba1('0x5')]||![];this[_0x6ba1('0x6')]=_0x2aeffe[_0x6ba1('0x6')]||[];this['Smtp']=_0x2aeffe[_0x6ba1('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x19e4=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0xf330eb,_0x44f1ca){var _0x11c17c=function(_0x9fd221){while(--_0x9fd221){_0xf330eb['push'](_0xf330eb['shift']());}};_0x11c17c(++_0x44f1ca);}(_0x19e4,0x115));var _0x419e=function(_0x71fdbc,_0xc528f2){_0x71fdbc=_0x71fdbc-0x0;var _0x5ec9f8=_0x19e4[_0x71fdbc];return _0x5ec9f8;};'use strict';var _=require(_0x419e('0x0'));function MailAccount(_0x1ea416){this['id']=_0x1ea416['id']||0x0;this[_0x419e('0x1')]=_0x1ea416[_0x419e('0x1')]||_0x419e('0x2');this[_0x419e('0x3')]=_0x1ea416['key']||_0x419e('0x4');this['active']=_0x1ea416[_0x419e('0x5')]||![];this[_0x419e('0x6')]=_0x1ea416[_0x419e('0x6')]||[];this['Smtp']=_0x1ea416[_0x419e('0x7')]||[];}module[_0x419e('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 97e0099..772dbf2 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 _0xbb10=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','length','isUndefined','merge','exports','lodash'];(function(_0x273d0a,_0x513ac3){var _0x374c6d=function(_0x2da410){while(--_0x2da410){_0x273d0a['push'](_0x273d0a['shift']());}};_0x374c6d(++_0x513ac3);}(_0xbb10,0x9f));var _0x0bb1=function(_0x1a0177,_0xb61cb7){_0x1a0177=_0x1a0177-0x0;var _0x29009d=_0xbb10[_0x1a0177];return _0x29009d;};'use strict';var _=require(_0x0bb1('0x0'));var MailAccount=require(_0x0bb1('0x1'));var Realtime=function(){this[_0x0bb1('0x2')]={};};function freeIsNotKey(_0x31cf8a,_0x2f5b60,_0xfa191c){var _0x225afc=_[_0x0bb1('0x3')](_0x31cf8a,function(_0x1d378b,_0x5cebc2){return _0x1d378b[_0xfa191c];});for(var _0x5b7925 in _0x2f5b60){if(_0x2f5b60[_0x0bb1('0x4')](_0x5b7925)){if(!_0x225afc[_0x5b7925]){delete _0x2f5b60[_0x5b7925];}}}}Realtime[_0x0bb1('0x5')]['mergeFromDatabase']=function(_0x1af4a7,_0x40d162){for(var _0x306e69 in _0x40d162){if(_0x1af4a7[_0x0bb1('0x4')](_0x306e69)){_0x1af4a7[_0x306e69]=_0x40d162[_0x306e69];}}};Realtime[_0x0bb1('0x5')]['initMailAccounts']=function(){var _0x32f410=this;return function(_0x328174){if(_0x328174){freeIsNotKey(_0x328174,_0x32f410[_0x0bb1('0x2')],'id');for(var _0x16cad2=0x0,_0x384103={},_0x201b08={};_0x16cad2<_0x328174[_0x0bb1('0x6')];_0x16cad2+=0x1){_0x384103=_0x328174[_0x16cad2];if(_[_0x0bb1('0x7')](_0x32f410['mailAccounts'][_0x384103['id']])){_0x32f410[_0x0bb1('0x2')][_0x384103['id']]=new MailAccount(_0x384103);}else{_[_0x0bb1('0x8')](_0x32f410['mailAccounts'][_0x384103['id']],_0x384103);}}}return _0x32f410[_0x0bb1('0x2')];};};module[_0x0bb1('0x9')]=Realtime; \ No newline at end of file +var _0xa783=['merge','exports','lodash','../model/mailAccount','mapKeys','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','isUndefined'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa783,0xca));var _0x3a78=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xa783[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x3a78('0x0'));var MailAccount=require(_0x3a78('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x59d333,_0x1d2533,_0x524fcc){var _0x58b138=_[_0x3a78('0x2')](_0x59d333,function(_0x544f1f,_0x72ea56){return _0x544f1f[_0x524fcc];});for(var _0x52b3d3 in _0x1d2533){if(_0x1d2533['hasOwnProperty'](_0x52b3d3)){if(!_0x58b138[_0x52b3d3]){delete _0x1d2533[_0x52b3d3];}}}}Realtime[_0x3a78('0x3')][_0x3a78('0x4')]=function(_0x2c639a,_0x114070){for(var _0x48be68 in _0x114070){if(_0x2c639a['hasOwnProperty'](_0x48be68)){_0x2c639a[_0x48be68]=_0x114070[_0x48be68];}}};Realtime['prototype'][_0x3a78('0x5')]=function(){var _0x30061f=this;return function(_0x5a358c){if(_0x5a358c){freeIsNotKey(_0x5a358c,_0x30061f[_0x3a78('0x6')],'id');for(var _0x5d6f30=0x0,_0x28bca4={},_0x3f3fa3={};_0x5d6f30<_0x5a358c['length'];_0x5d6f30+=0x1){_0x28bca4=_0x5a358c[_0x5d6f30];if(_[_0x3a78('0x7')](_0x30061f[_0x3a78('0x6')][_0x28bca4['id']])){_0x30061f[_0x3a78('0x6')][_0x28bca4['id']]=new MailAccount(_0x28bca4);}else{_[_0x3a78('0x8')](_0x30061f[_0x3a78('0x6')][_0x28bca4['id']],_0x28bca4);}}}return _0x30061f[_0x3a78('0x6')];};};module[_0x3a78('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a88ab4b..b7ad0df 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 _0xd4ad=['MailServerIn','CloudProvider','name','type','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','key','ListId'];(function(_0x440cf5,_0x21de0e){var _0x209546=function(_0x4ecb40){while(--_0x4ecb40){_0x440cf5['push'](_0x440cf5['shift']());}};_0x209546(++_0x21de0e);}(_0xd4ad,0x158));var _0xdd4a=function(_0x489742,_0x2a6e15){_0x489742=_0x489742-0x0;var _0x49ec1b=_0xd4ad[_0x489742];return _0x49ec1b;};'use strict';var client=require(_0xdd4a('0x0'));exports[_0xdd4a('0x1')]=function(){return function(){return client[_0xdd4a('0x2')](_0xdd4a('0x3'),{'options':{'attributes':['id','name',_0xdd4a('0x4'),_0xdd4a('0x5'),'email','active',_0xdd4a('0x6'),_0xdd4a('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xdd4a('0x8'),'as':'Imap','include':[{'model':_0xdd4a('0x9'),'attributes':['id',_0xdd4a('0xa'),'service',_0xdd4a('0xb'),'data5'],'as':_0xdd4a('0x9')}]},{'model':_0xdd4a('0xc'),'as':_0xdd4a('0xd'),'include':[{'model':_0xdd4a('0x9'),'attributes':['id',_0xdd4a('0xa'),_0xdd4a('0x5'),'type','data5'],'as':_0xdd4a('0x9')}]}]},'log':'getMailAccount'});};};exports[_0xdd4a('0xe')]=function(_0x3c86ed,_0x53d816){return client[_0xdd4a('0x2')](_0xdd4a('0xf'),{'account':{'id':_0x3c86ed},'body':_0x53d816,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x326f=['NotifyMailAccount','../client','GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','CloudProvider','type','Smtp','notify'];(function(_0x5d2a31,_0x4920fb){var _0x577a7e=function(_0x164c39){while(--_0x164c39){_0x5d2a31['push'](_0x5d2a31['shift']());}};_0x577a7e(++_0x4920fb);}(_0x326f,0xd1));var _0xf326=function(_0x3f4b07,_0x50f4fb){_0x3f4b07=_0x3f4b07-0x0;var _0x3b2a54=_0x326f[_0x3f4b07];return _0x3b2a54;};'use strict';var client=require(_0xf326('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9')],'raw':![],'include':[{'model':_0xf326('0xa'),'as':'Imap','include':[{'model':_0xf326('0xb'),'attributes':['id',_0xf326('0x2'),_0xf326('0x4'),_0xf326('0xc'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0xf326('0xd'),'include':[{'model':_0xf326('0xb'),'attributes':['id',_0xf326('0x2'),_0xf326('0x4'),_0xf326('0xc'),'data5'],'as':_0xf326('0xb')}]}]},'log':'getMailAccount'});};};exports[_0xf326('0xe')]=function(_0x4aaf3a,_0x2e4b71){return client['Request'](_0xf326('0xf'),{'account':{'id':_0x4aaf3a},'body':_0x2e4b71,'log':_0xf326('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index b028918..a8be8e7 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 _0x5a55=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x227b01,_0x15057c){var _0x19d27d=function(_0x4a4831){while(--_0x4a4831){_0x227b01['push'](_0x227b01['shift']());}};_0x19d27d(++_0x15057c);}(_0x5a55,0x178));var _0x55a5=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x5a55[_0x5959c9];return _0x4ffcbc;};'use strict';var client=require(_0x55a5('0x0'));exports[_0x55a5('0x1')]=function(){return client[_0x55a5('0x2')](_0x55a5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x55a5('0x4')});}; \ No newline at end of file +var _0xc3e3=['getSettings','Request','loginMailFrequency','GetSettings','../client'];(function(_0xc673c0,_0x11e738){var _0x256ce5=function(_0x535c84){while(--_0x535c84){_0xc673c0['push'](_0xc673c0['shift']());}};_0x256ce5(++_0x11e738);}(_0xc3e3,0xfe));var _0x3c3e=function(_0x1268f4,_0x147117){_0x1268f4=_0x1268f4-0x0;var _0x2f1b05=_0xc3e3[_0x1268f4];return _0x2f1b05;};'use strict';var client=require(_0x3c3e('0x0'));exports[_0x3c3e('0x1')]=function(){return client[_0x3c3e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3c3e('0x3')]},'log':_0x3c3e('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 4c1fcf8..9a28190 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 741a67c..92c757d 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 _0xed82=['../../config/triggers','default','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','polling','redis','defaults','localhost','adapter'];(function(_0x512309,_0x15ada1){var _0x1a2490=function(_0x3a57d3){while(--_0x3a57d3){_0x512309['push'](_0x512309['shift']());}};_0x1a2490(++_0x15ada1);}(_0xed82,0xc3));var _0x2ed8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xed82[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2ed8('0x0'));var http=require(_0x2ed8('0x1'));var express=require(_0x2ed8('0x2'));var sticky=require(_0x2ed8('0x3'));var Redis=require(_0x2ed8('0x4'));var config=require(_0x2ed8('0x5'));var app=express();var server=http[_0x2ed8('0x6')](app);server[_0x2ed8('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0x2ed8('0x8')])){var socketio=require(_0x2ed8('0x9'))(server,{'transports':['websocket',_0x2ed8('0xa')]});config[_0x2ed8('0xb')]=_[_0x2ed8('0xc')](config['redis'],{'host':_0x2ed8('0xd'),'port':0x18eb});socketio[_0x2ed8('0xe')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x2ed8('0xf'))[_0x2ed8('0x10')]();require('../../config/socketio')[_0x2ed8('0x10')](socketio);require('../../config/express')[_0x2ed8('0x10')](app);require(_0x2ed8('0x11'))['default'](app);}else{server[_0x2ed8('0x12')]('listening',function(){console['log'](_0x2ed8('0x13'),config[_0x2ed8('0x8')]);});}exports=module[_0x2ed8('0x14')]=app; \ No newline at end of file +var _0xb5cb=['ioredis','../../config/environment','createServer','timeout','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0x4edb51,_0x5c79ce){var _0x22fcf5=function(_0x4aefb6){while(--_0x4aefb6){_0x4edb51['push'](_0x4edb51['shift']());}};_0x22fcf5(++_0x5c79ce);}(_0xb5cb,0x173));var _0xbb5c=function(_0x243f64,_0x510ea8){_0x243f64=_0x243f64-0x0;var _0x44d876=_0xb5cb[_0x243f64];return _0x44d876;};'use strict';var _=require(_0xbb5c('0x0'));var http=require(_0xbb5c('0x1'));var express=require(_0xbb5c('0x2'));var sticky=require('sticky-session');var Redis=require(_0xbb5c('0x3'));var config=require(_0xbb5c('0x4'));var app=express();var server=http[_0xbb5c('0x5')](app);server[_0xbb5c('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xbb5c('0x7'))(server,{'transports':[_0xbb5c('0x8'),'polling']});config[_0xbb5c('0x9')]=_[_0xbb5c('0xa')](config['redis'],{'host':_0xbb5c('0xb'),'port':0x18eb});socketio[_0xbb5c('0xc')](require(_0xbb5c('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xbb5c('0xe'))['default']();require('../../config/socketio')[_0xbb5c('0xf')](socketio);require(_0xbb5c('0x10'))['default'](app);require(_0xbb5c('0x11'))[_0xbb5c('0xf')](app);}else{server['once'](_0xbb5c('0x12'),function(){console[_0xbb5c('0x13')](_0xbb5c('0x14'),config['port']);});}exports=module[_0xbb5c('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index ee9f759..6c4fda9 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 _0x5a2f=['message','result','catch','jayson/promise','bluebird','../../config/logger','client','Request','request','debug','rpc','routing','error'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x5a2f,0x189));var _0xf5a2=function(_0x298c37,_0xe12081){_0x298c37=_0x298c37-0x0;var _0x58689f=_0x5a2f[_0x298c37];return _0x58689f;};'use strict';var jayson=require(_0xf5a2('0x0'));var BPromise=require(_0xf5a2('0x1'));var logger=require(_0xf5a2('0x2'))('routing');var client=jayson[_0xf5a2('0x3')]['http']({'port':0x2329});client[_0xf5a2('0x4')]=function(_0x5ed9bf,_0x24b3df){return new BPromise(function(_0x27365c,_0x4406d2){return client[_0xf5a2('0x5')](_0x5ed9bf,_0x24b3df)['then'](function(_0x2b71f5){logger[_0xf5a2('0x6')](_0xf5a2('0x7'),_0xf5a2('0x8'),_0x5ed9bf,_0x24b3df,_0x2b71f5);if(_0x2b71f5[_0xf5a2('0x9')]){logger[_0xf5a2('0x9')](_0xf5a2('0x7'),_0xf5a2('0x8'),_0x5ed9bf,_0x2b71f5['error']['message'],_0x24b3df);return _0x4406d2(_0x2b71f5[_0xf5a2('0x9')][_0xf5a2('0xa')]);}else{return _0x27365c(_0x2b71f5[_0xf5a2('0xb')]);}})[_0xf5a2('0xc')](function(_0x5dd724){logger['error'](_0xf5a2('0x7'),_0xf5a2('0x8'),_0x5ed9bf,_0x5dd724,_0x24b3df);return _0x4406d2(_0x5dd724);});});};module['exports']=client; \ No newline at end of file +var _0x450e=['error','message','catch','exports','jayson/promise','routing','debug','rpc'];(function(_0x5470ba,_0x21ea89){var _0x1ed61e=function(_0x187c11){while(--_0x187c11){_0x5470ba['push'](_0x5470ba['shift']());}};_0x1ed61e(++_0x21ea89);}(_0x450e,0xd4));var _0xe450=function(_0x38f0c3,_0xd4eaf7){_0x38f0c3=_0x38f0c3-0x0;var _0x4187a4=_0x450e[_0x38f0c3];return _0x4187a4;};'use strict';var jayson=require(_0xe450('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xe450('0x1'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x34599f,_0x12ee79){return new BPromise(function(_0x139418,_0x46225){return client['request'](_0x34599f,_0x12ee79)['then'](function(_0x3a1866){logger[_0xe450('0x2')](_0xe450('0x3'),_0xe450('0x1'),_0x34599f,_0x12ee79,_0x3a1866);if(_0x3a1866[_0xe450('0x4')]){logger[_0xe450('0x4')](_0xe450('0x3'),_0xe450('0x1'),_0x34599f,_0x3a1866['error'][_0xe450('0x5')],_0x12ee79);return _0x46225(_0x3a1866[_0xe450('0x4')][_0xe450('0x5')]);}else{return _0x139418(_0x3a1866['result']);}})[_0xe450('0x6')](function(_0x1c04ae){logger[_0xe450('0x4')](_0xe450('0x3'),_0xe450('0x1'),_0x34599f,_0x1c04ae,_0x12ee79);return _0x46225(_0x1c04ae);});});};module[_0xe450('0x7')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a70fc4f..f7e45d3 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 _0x40ab=['./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user'];(function(_0x5350de,_0x4d1bcf){var _0x43ac15=function(_0x31b1cc){while(--_0x31b1cc){_0x5350de['push'](_0x5350de['shift']());}};_0x43ac15(++_0x4d1bcf);}(_0x40ab,0x1df));var _0xb40a=function(_0x25f912,_0x2f9878){_0x25f912=_0x25f912-0x0;var _0x4dd540=_0x40ab[_0x25f912];return _0x4dd540;};'use strict';var BPromise=require(_0xb40a('0x0'));var server=require(_0xb40a('0x1'));var Realtime=require(_0xb40a('0x2'));var user=require(_0xb40a('0x3'));var interval=require(_0xb40a('0x4'));var openchannelQueue=require(_0xb40a('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xb40a('0x6'));var mailQueue=require(_0xb40a('0x7'));var faxQueue=require(_0xb40a('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xb40a('0x9')](user[_0xb40a('0xa')]())[_0xb40a('0x9')](realtime[_0xb40a('0xb')]())[_0xb40a('0x9')](interval[_0xb40a('0xc')]())[_0xb40a('0x9')](realtime[_0xb40a('0xd')]())[_0xb40a('0x9')](openchannelQueue[_0xb40a('0xe')]())[_0xb40a('0x9')](realtime[_0xb40a('0xf')]())['then'](chatQueue[_0xb40a('0x10')]())[_0xb40a('0x9')](realtime[_0xb40a('0x11')]())[_0xb40a('0x9')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())['then'](mailQueue[_0xb40a('0x12')]())[_0xb40a('0x9')](realtime[_0xb40a('0x13')]())[_0xb40a('0x9')](faxQueue['getFaxQueues']())['then'](realtime['initFaxQueues']())[_0xb40a('0x9')](whatsappQueue['getWhatsappQueues']())[_0xb40a('0x9')](realtime[_0xb40a('0x14')]())[_0xb40a('0x9')](function(){return realtime;});}function main(){return server[_0xb40a('0x15')](realtime)[_0xb40a('0x9')](function(_0x3cea18){return initRealtime();})[_0xb40a('0x9')](function(_0x192136){return setInterval(initRealtime,0x1388);})['catch'](function(_0x569a10){console[_0xb40a('0x16')](_0x569a10);});}main(); \ No newline at end of file +var _0x0767=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x19374f,_0x14862f){var _0xdcfeb=function(_0x3a995b){while(--_0x3a995b){_0x19374f['push'](_0x19374f['shift']());}};_0xdcfeb(++_0x14862f);}(_0x0767,0x78));var _0x7076=function(_0x42ce62,_0x41f020){_0x42ce62=_0x42ce62-0x0;var _0x417b6a=_0x0767[_0x42ce62];return _0x417b6a;};'use strict';var BPromise=require(_0x7076('0x0'));var server=require('./server');var Realtime=require(_0x7076('0x1'));var user=require(_0x7076('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x7076('0x3'));var chatQueue=require(_0x7076('0x4'));var smsQueue=require(_0x7076('0x5'));var mailQueue=require(_0x7076('0x6'));var faxQueue=require(_0x7076('0x7'));var whatsappQueue=require(_0x7076('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7076('0x9')]()[_0x7076('0xa')](user[_0x7076('0xb')]())[_0x7076('0xa')](realtime['initAgents']())[_0x7076('0xa')](interval[_0x7076('0xc')]())[_0x7076('0xa')](realtime['initIntervals']())[_0x7076('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x7076('0xa')](realtime[_0x7076('0xd')]())['then'](chatQueue[_0x7076('0xe')]())['then'](realtime[_0x7076('0xf')]())[_0x7076('0xa')](smsQueue[_0x7076('0x10')]())[_0x7076('0xa')](realtime['initSmsQueues']())[_0x7076('0xa')](mailQueue[_0x7076('0x11')]())['then'](realtime[_0x7076('0x12')]())['then'](faxQueue[_0x7076('0x13')]())['then'](realtime[_0x7076('0x14')]())[_0x7076('0xa')](whatsappQueue[_0x7076('0x15')]())[_0x7076('0xa')](realtime['initWhatsappQueues']())[_0x7076('0xa')](function(){return realtime;});}function main(){return server[_0x7076('0x16')](realtime)['then'](function(_0x43bc93){return initRealtime();})[_0x7076('0xa')](function(_0x106dce){return setInterval(initRealtime,0x1388);})[_0x7076('0x17')](function(_0x31842e){console[_0x7076('0x18')](_0x31842e);});}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 ce434b3..31ede43 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0x326f,0xd1));var _0xf326=function(_0x8a27c8,_0x558caf){_0x8a27c8=_0x8a27c8-0x0;var _0xf087b7=_0x326f[_0x8a27c8];return _0xf087b7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0xc65834,_0x5df6fb){var _0x5da298=function(_0x30fbc2){while(--_0x30fbc2){_0xc65834['push'](_0xc65834['shift']());}};_0x5da298(++_0x5df6fb);}(_0x326f,0xd1));var _0xf326=function(_0x29f514,_0x4da99c){_0x29f514=_0x29f514-0x0;var _0x49b78b=_0x326f[_0x29f514];return _0x49b78b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index e77b60a..69a0105 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 _0x20c9=['bluebird','jayson/promise','client','http','request','then','error','catch','sendMailMessage','SendMail'];(function(_0x5b0ecb,_0x39c672){var _0x2a8e48=function(_0x7eab40){while(--_0x7eab40){_0x5b0ecb['push'](_0x5b0ecb['shift']());}};_0x2a8e48(++_0x39c672);}(_0x20c9,0x6e));var _0x920c=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x20c9[_0x19159a];return _0xa677f4;};'use strict';var BPromise=require(_0x920c('0x0'));var jayson=require(_0x920c('0x1'));var client=jayson[_0x920c('0x2')][_0x920c('0x3')]({'port':0x232b});function request(_0xbb7c82,_0x4f30a4){return new BPromise(function(_0x4b596f,_0x38c24a){return client[_0x920c('0x4')](_0xbb7c82,_0x4f30a4)[_0x920c('0x5')](function(_0x40aaad){if(_0x40aaad[_0x920c('0x6')]){return _0x38c24a(_0x40aaad['error']['message']);}else{return _0x4b596f(_0x40aaad['result']);}})[_0x920c('0x7')](function(_0x43bea6){return _0x38c24a(_0x43bea6);});});}exports[_0x920c('0x8')]=function(_0x18bbc2,_0x45cce0){return request(_0x920c('0x9'),{'account':_0x18bbc2,'message':_0x45cce0});}; \ No newline at end of file +var _0x9a51=['bluebird','jayson/promise','client','http','request','then','error','message','result','catch','SendMail'];(function(_0x2d1c86,_0xb2e508){var _0x3767e4=function(_0x187135){while(--_0x187135){_0x2d1c86['push'](_0x2d1c86['shift']());}};_0x3767e4(++_0xb2e508);}(_0x9a51,0xc6));var _0x19a5=function(_0x54bc96,_0x20cb68){_0x54bc96=_0x54bc96-0x0;var _0x4685b9=_0x9a51[_0x54bc96];return _0x4685b9;};'use strict';var BPromise=require(_0x19a5('0x0'));var jayson=require(_0x19a5('0x1'));var client=jayson[_0x19a5('0x2')][_0x19a5('0x3')]({'port':0x232b});function request(_0x1ce3bb,_0x18508f){return new BPromise(function(_0x174e69,_0x2a6a5f){return client[_0x19a5('0x4')](_0x1ce3bb,_0x18508f)[_0x19a5('0x5')](function(_0x5632da){if(_0x5632da['error']){return _0x2a6a5f(_0x5632da[_0x19a5('0x6')][_0x19a5('0x7')]);}else{return _0x174e69(_0x5632da[_0x19a5('0x8')]);}})[_0x19a5('0x9')](function(_0x523bce){return _0x2a6a5f(_0x523bce);});});}exports['sendMailMessage']=function(_0x2628dd,_0x4788a4){return request(_0x19a5('0xa'),{'account':_0x2628dd,'message':_0x4788a4});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index e337ebd..30b6d58 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 _0xb871=['faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailStatusTime','faxCurrentCapacity','whatsappStatus','openchannelStatus','openchannelCapacity','mailWaitingInteractions','smsWaitingInteractions','stringify','emit','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause'];(function(_0x61657f,_0x187f7b){var _0x76a93=function(_0x875e91){while(--_0x875e91){_0x61657f['push'](_0x61657f['shift']());}};_0x76a93(++_0x187f7b);}(_0xb871,0xfe));var _0x1b87=function(_0x3c9def,_0x5384ea){_0x3c9def=_0x3c9def-0x0;var _0x591e39=_0xb871[_0x3c9def];return _0x591e39;};'use strict';var _=require(_0x1b87('0x0'));var moment=require(_0x1b87('0x1'));var md5=require(_0x1b87('0x2'));var Redis=require(_0x1b87('0x3'));var config=require(_0x1b87('0x4'));config['redis']=_[_0x1b87('0x5')](config[_0x1b87('0x6')],{'host':_0x1b87('0x7'),'port':0x18eb});var io=require(_0x1b87('0x8'))(new Redis(config[_0x1b87('0x6')]));function Agent(_0x5e1a73){this['id']=_0x5e1a73['id']||0x0;this[_0x1b87('0x9')]=_0x5e1a73[_0x1b87('0x9')]||'';this[_0x1b87('0xa')]=_0x5e1a73[_0x1b87('0xa')]||!![];this[_0x1b87('0xb')]=_0x5e1a73[_0x1b87('0xb')]||![];this['chatPause']=_0x5e1a73[_0x1b87('0xc')]||![];this[_0x1b87('0xd')]=_0x5e1a73['mailPause']||![];this[_0x1b87('0xe')]=_0x5e1a73['faxPause']||![];this['smsPause']=_0x5e1a73[_0x1b87('0xf')]||![];this[_0x1b87('0x10')]=_0x5e1a73[_0x1b87('0x10')]||![];this[_0x1b87('0x11')]='unknown';this[_0x1b87('0x12')]=0x0;this[_0x1b87('0x13')]=_0x5e1a73['chatCapacity']||0x0;this[_0x1b87('0x14')]=0x0;this[_0x1b87('0x15')]=_0x1b87('0x16');this['mailStatusTime']=0x0;this[_0x1b87('0x17')]=_0x5e1a73['mailCapacity']||0x0;this[_0x1b87('0x18')]=0x0;this[_0x1b87('0x19')]=_0x1b87('0x16');this[_0x1b87('0x1a')]=0x0;this['faxCapacity']=_0x5e1a73[_0x1b87('0x1b')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x1b87('0x1c')]='unknown';this[_0x1b87('0x1d')]=0x0;this['smsCapacity']=_0x5e1a73[_0x1b87('0x1e')]||0x0;this[_0x1b87('0x1f')]=0x0;this['whatsappStatus']=_0x1b87('0x16');this[_0x1b87('0x20')]=0x0;this[_0x1b87('0x21')]=_0x5e1a73['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x1b87('0x16');this[_0x1b87('0x22')]=0x0;this['openchannelCapacity']=_0x5e1a73['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x1b87('0x23')]=![];this[_0x1b87('0x24')]=undefined;this[_0x1b87('0x2')]='';this[_0x1b87('0x25')]={};this[_0x1b87('0x26')]={};this['mailWaitingInteractions']={};this[_0x1b87('0x27')]={};this['smsWaitingInteractions']={};this[_0x1b87('0x28')]={};this[_0x1b87('0x29')]();}Agent['prototype']['getChannelStatus']=function(_0x14a4c7){if(this[_0x14a4c7+_0x1b87('0x2a')]>0x0){if(this[_0x14a4c7+_0x1b87('0x2b')]>0x0&&this[_0x14a4c7+_0x1b87('0x2a')]>=this[_0x14a4c7+'Capacity']){return _0x1b87('0x2c');}else{return _0x1b87('0x2d');}}else{return _0x1b87('0x2e');}};Agent[_0x1b87('0x2f')][_0x1b87('0x29')]=function(){var _0x3c353c=[_0x1b87('0x30'),_0x1b87('0x31'),'openchannel',_0x1b87('0x32'),_0x1b87('0x33'),_0x1b87('0x34')];for(var _0x12cff5=0x0;_0x12cff5<_0x3c353c[_0x1b87('0x35')];_0x12cff5+=0x1){var _0x22bc50=this['getChannelStatus'](_0x3c353c[_0x12cff5]);if(this[_0x3c353c[_0x12cff5]+_0x1b87('0x36')]!==_0x22bc50){this[_0x3c353c[_0x12cff5]+_0x1b87('0x37')]=_[_0x1b87('0x38')](moment()[_0x1b87('0x39')]('x'));}this[_0x3c353c[_0x12cff5]+'Status']=_0x22bc50;}var _0xa7ea79={'id':this['id'],'name':this[_0x1b87('0x9')],'online':this[_0x1b87('0xa')],'voicePause':this[_0x1b87('0xb')],'chatPause':this[_0x1b87('0xc')],'mailPause':this[_0x1b87('0xd')],'smsPause':this[_0x1b87('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0x1b87('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x1b87('0x13')],'chatCurrentCapacity':this[_0x1b87('0x14')],'mailStatus':this[_0x1b87('0x15')],'mailStatusTime':this[_0x1b87('0x3a')],'mailCapacity':this[_0x1b87('0x17')],'mailCurrentCapacity':this[_0x1b87('0x18')],'faxStatus':this[_0x1b87('0x19')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1b87('0x3b')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x1b87('0x1d')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x1b87('0x1f')],'whatsappStatus':this[_0x1b87('0x3c')],'whatsappStatusTime':this[_0x1b87('0x20')],'whatsappCapacity':this[_0x1b87('0x21')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x1b87('0x3d')],'openchannelStatusTime':this[_0x1b87('0x22')],'openchannelCapacity':this[_0x1b87('0x3e')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x1b87('0x23')],'busyQueue':this[_0x1b87('0x24')],'chatWaitingInteractions':this[_0x1b87('0x25')],'faxWaitingInteractions':this[_0x1b87('0x26')],'mailWaitingInteractions':this[_0x1b87('0x3f')],'openchannelWaitingInteractions':this[_0x1b87('0x27')],'smsWaitingInteractions':this[_0x1b87('0x40')],'whatsappWaitingInteractions':this[_0x1b87('0x28')]};var _0xf1bcc6=md5(JSON[_0x1b87('0x41')](_0xa7ea79));if(this['md5']!==_0xf1bcc6){this['md5']=_0xf1bcc6;io[_0x1b87('0x42')]('user:save',_0xa7ea79);}};module['exports']=Agent; \ No newline at end of file +var _0x4c86=['openchannelStatusTime','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatPause','mailStatus','faxCurrentCapacity','smsStatus','smsCurrentCapacity','openchannelCapacity','busy','chatWaitingInteractions','openchannelWaitingInteractions','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus'];(function(_0x4b6e15,_0x6028d7){var _0x160e6c=function(_0x1c7337){while(--_0x1c7337){_0x4b6e15['push'](_0x4b6e15['shift']());}};_0x160e6c(++_0x6028d7);}(_0x4c86,0x68));var _0x64c8=function(_0x18a119,_0x18857e){_0x18a119=_0x18a119-0x0;var _0x46fd77=_0x4c86[_0x18a119];return _0x46fd77;};'use strict';var _=require(_0x64c8('0x0'));var moment=require(_0x64c8('0x1'));var md5=require(_0x64c8('0x2'));var Redis=require(_0x64c8('0x3'));var config=require(_0x64c8('0x4'));config['redis']=_[_0x64c8('0x5')](config[_0x64c8('0x6')],{'host':_0x64c8('0x7'),'port':0x18eb});var io=require(_0x64c8('0x8'))(new Redis(config[_0x64c8('0x6')]));function Agent(_0x127d08){this['id']=_0x127d08['id']||0x0;this[_0x64c8('0x9')]=_0x127d08[_0x64c8('0x9')]||'';this[_0x64c8('0xa')]=_0x127d08[_0x64c8('0xa')]||!![];this['voicePause']=_0x127d08['voicePause']||![];this['chatPause']=_0x127d08['chatPause']||![];this['mailPause']=_0x127d08[_0x64c8('0xb')]||![];this[_0x64c8('0xc')]=_0x127d08[_0x64c8('0xc')]||![];this[_0x64c8('0xd')]=_0x127d08[_0x64c8('0xd')]||![];this[_0x64c8('0xe')]=_0x127d08[_0x64c8('0xe')]||![];this[_0x64c8('0xf')]=_0x64c8('0x10');this[_0x64c8('0x11')]=0x0;this[_0x64c8('0x12')]=_0x127d08[_0x64c8('0x12')]||0x0;this[_0x64c8('0x13')]=0x0;this['mailStatus']=_0x64c8('0x10');this[_0x64c8('0x14')]=0x0;this[_0x64c8('0x15')]=_0x127d08['mailCapacity']||0x0;this[_0x64c8('0x16')]=0x0;this[_0x64c8('0x17')]=_0x64c8('0x10');this[_0x64c8('0x18')]=0x0;this['faxCapacity']=_0x127d08[_0x64c8('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']='unknown';this[_0x64c8('0x1a')]=0x0;this[_0x64c8('0x1b')]=_0x127d08['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x64c8('0x10');this[_0x64c8('0x1c')]=0x0;this[_0x64c8('0x1d')]=_0x127d08[_0x64c8('0x1d')]||0x0;this[_0x64c8('0x1e')]=0x0;this[_0x64c8('0x1f')]=_0x64c8('0x10');this[_0x64c8('0x20')]=0x0;this['openchannelCapacity']=_0x127d08['openchannelCapacity']||0x0;this[_0x64c8('0x21')]=0x0;this['busy']=![];this[_0x64c8('0x22')]=undefined;this[_0x64c8('0x2')]='';this['chatWaitingInteractions']={};this[_0x64c8('0x23')]={};this[_0x64c8('0x24')]={};this['openchannelWaitingInteractions']={};this[_0x64c8('0x25')]={};this['whatsappWaitingInteractions']={};this[_0x64c8('0x26')]();}Agent[_0x64c8('0x27')][_0x64c8('0x28')]=function(_0x2f64b3){if(this[_0x2f64b3+_0x64c8('0x29')]>0x0){if(this[_0x2f64b3+_0x64c8('0x2a')]>0x0&&this[_0x2f64b3+_0x64c8('0x29')]>=this[_0x2f64b3+_0x64c8('0x2a')]){return _0x64c8('0x2b');}else{return _0x64c8('0x2c');}}else{return _0x64c8('0x2d');}};Agent['prototype'][_0x64c8('0x26')]=function(){var _0x1134b5=[_0x64c8('0x2e'),_0x64c8('0x2f'),'openchannel',_0x64c8('0x30'),_0x64c8('0x31'),_0x64c8('0x32')];for(var _0x539620=0x0;_0x539620<_0x1134b5[_0x64c8('0x33')];_0x539620+=0x1){var _0x3b1f25=this[_0x64c8('0x28')](_0x1134b5[_0x539620]);if(this[_0x1134b5[_0x539620]+_0x64c8('0x34')]!==_0x3b1f25){this[_0x1134b5[_0x539620]+_0x64c8('0x35')]=_[_0x64c8('0x36')](moment()[_0x64c8('0x37')]('x'));}this[_0x1134b5[_0x539620]+_0x64c8('0x34')]=_0x3b1f25;}var _0x23774b={'id':this['id'],'name':this[_0x64c8('0x9')],'online':this[_0x64c8('0xa')],'voicePause':this['voicePause'],'chatPause':this[_0x64c8('0x38')],'mailPause':this[_0x64c8('0xb')],'smsPause':this[_0x64c8('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0x64c8('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x64c8('0x12')],'chatCurrentCapacity':this[_0x64c8('0x13')],'mailStatus':this[_0x64c8('0x39')],'mailStatusTime':this[_0x64c8('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x64c8('0x16')],'faxStatus':this[_0x64c8('0x17')],'faxStatusTime':this[_0x64c8('0x18')],'faxCapacity':this[_0x64c8('0x19')],'faxCurrentCapacity':this[_0x64c8('0x3a')],'smsStatus':this[_0x64c8('0x3b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x64c8('0x1b')],'smsCurrentCapacity':this[_0x64c8('0x3c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x64c8('0x1c')],'whatsappCapacity':this[_0x64c8('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x64c8('0x1f')],'openchannelStatusTime':this[_0x64c8('0x20')],'openchannelCapacity':this[_0x64c8('0x3d')],'openchannelCurrentCapacity':this[_0x64c8('0x21')],'busy':this[_0x64c8('0x3e')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x64c8('0x3f')],'faxWaitingInteractions':this[_0x64c8('0x23')],'mailWaitingInteractions':this[_0x64c8('0x24')],'openchannelWaitingInteractions':this[_0x64c8('0x40')],'smsWaitingInteractions':this[_0x64c8('0x25')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x2adca5=md5(JSON[_0x64c8('0x41')](_0x23774b));if(this['md5']!==_0x2adca5){this[_0x64c8('0x2')]=_0x2adca5;io[_0x64c8('0x42')]('user:save',_0x23774b);}};module[_0x64c8('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 b12b136..df5b0ce 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 _0xe6bc=['loggedIn','paused','length','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime'];(function(_0x2a1338,_0x29f7aa){var _0xc02469=function(_0x475e5f){while(--_0x475e5f){_0x2a1338['push'](_0x2a1338['shift']());}};_0xc02469(++_0x29f7aa);}(_0xe6bc,0x19f));var _0xce6b=function(_0x36d107,_0x39785b){_0x36d107=_0x36d107-0x0;var _0x57b99e=_0xe6bc[_0x36d107];return _0x57b99e;};'use strict';var _=require(_0xce6b('0x0'));var md5=require(_0xce6b('0x1'));var util=require(_0xce6b('0x2'));var Redis=require(_0xce6b('0x3'));var config=require(_0xce6b('0x4'));config[_0xce6b('0x5')]=_['defaults'](config[_0xce6b('0x5')],{'host':_0xce6b('0x6'),'port':0x18eb});var io=require(_0xce6b('0x7'))(new Redis(config['redis']));function ChatQueue(_0x470b93){this['id']=_0x470b93['id']||0x0;this[_0xce6b('0x8')]=_0x470b93[_0xce6b('0x8')]||'';this[_0xce6b('0x9')]=_0x470b93[_0xce6b('0x9')]||0xa;this['strategy']=_0x470b93[_0xce6b('0xa')]||_0xce6b('0xb');this['Agents']=_0x470b93[_0xce6b('0xc')];this[_0xce6b('0xd')]={};this[_0xce6b('0xe')]=0x0;this[_0xce6b('0x1')]='';this[_0xce6b('0xf')]();this['updateRealtime']();}ChatQueue[_0xce6b('0x10')][_0xce6b('0xf')]=function(){var _0x2a39ac=this['mapAgentsId'][_0xce6b('0x11')];this[_0xce6b('0xd')]=_[_0xce6b('0x12')](this[_0xce6b('0xc')],'id');this[_0xce6b('0xd')]['_rr']=_0x2a39ac;};ChatQueue['prototype'][_0xce6b('0x13')]=function(){this[_0xce6b('0x14')]=0x0;this[_0xce6b('0x15')]=0x0;for(var _0x4ea0b1=0x0;_0x4ea0b1=0x0?this[_0xce6b('0x18')]:0x0;var _0x4fd595={'id':this['id'],'available':this[_0xce6b('0x18')],'loggedIn':this[_0xce6b('0x14')],'name':this[_0xce6b('0x8')],'paused':this[_0xce6b('0x15')],'waiting':this[_0xce6b('0xe')]};var _0x528032=md5(JSON[_0xce6b('0x19')](_0x4fd595));if(this['md5']!==_0x528032){this[_0xce6b('0x1')]=_0x528032;io['to'](util['format'](_0xce6b('0x1a'),_0x4fd595[_0xce6b('0x8')]))[_0xce6b('0x1b')](_0xce6b('0x1c'),_0x4fd595);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x64f1=['emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','chatPause','available','stringify','chat:queue:%s'];(function(_0x3015c5,_0x1e96e9){var _0x3d00eb=function(_0x1b5e9c){while(--_0x1b5e9c){_0x3015c5['push'](_0x3015c5['shift']());}};_0x3d00eb(++_0x1e96e9);}(_0x64f1,0x1a7));var _0x164f=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x64f1[_0xb8cfbe];return _0x227d51;};'use strict';var _=require('lodash');var md5=require(_0x164f('0x0'));var util=require(_0x164f('0x1'));var Redis=require(_0x164f('0x2'));var config=require(_0x164f('0x3'));config['redis']=_[_0x164f('0x4')](config[_0x164f('0x5')],{'host':_0x164f('0x6'),'port':0x18eb});var io=require(_0x164f('0x7'))(new Redis(config[_0x164f('0x5')]));function ChatQueue(_0x179b82){this['id']=_0x179b82['id']||0x0;this[_0x164f('0x8')]=_0x179b82[_0x164f('0x8')]||'';this[_0x164f('0x9')]=_0x179b82[_0x164f('0x9')]||0xa;this[_0x164f('0xa')]=_0x179b82[_0x164f('0xa')]||_0x164f('0xb');this[_0x164f('0xc')]=_0x179b82[_0x164f('0xc')];this['mapAgentsId']={};this[_0x164f('0xd')]=0x0;this[_0x164f('0x0')]='';this[_0x164f('0xe')]();this['updateRealtime']();}ChatQueue['prototype'][_0x164f('0xe')]=function(){var _0x254731=this[_0x164f('0xf')]['_rr'];this[_0x164f('0xf')]=_['map'](this['Agents'],'id');this[_0x164f('0xf')][_0x164f('0x10')]=_0x254731;};ChatQueue['prototype'][_0x164f('0x11')]=function(){this[_0x164f('0x12')]=0x0;this[_0x164f('0x13')]=0x0;for(var _0x402675=0x0;_0x402675=0x0?this[_0x164f('0x16')]:0x0;var _0x1d6f23={'id':this['id'],'available':this[_0x164f('0x16')],'loggedIn':this[_0x164f('0x12')],'name':this['name'],'paused':this[_0x164f('0x13')],'waiting':this['waiting']};var _0x314a3f=md5(JSON[_0x164f('0x17')](_0x1d6f23));if(this[_0x164f('0x0')]!==_0x314a3f){this['md5']=_0x314a3f;io['to'](util['format'](_0x164f('0x18'),_0x1d6f23[_0x164f('0x8')]))[_0x164f('0x19')](_0x164f('0x1a'),_0x1d6f23);}};module[_0x164f('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index ac83462..0276046 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 _0x06e7=['waiting','updateRouting','prototype','_rr','map','loggedIn','paused','online','faxPause','available','stringify','format','emit','fax_queue:save','exports','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x4bbdca,_0x1101f6){var _0x177395=function(_0x59358d){while(--_0x59358d){_0x4bbdca['push'](_0x4bbdca['shift']());}};_0x177395(++_0x1101f6);}(_0x06e7,0xc5));var _0x706e=function(_0x128a16,_0x1abebf){_0x128a16=_0x128a16-0x0;var _0x54fa47=_0x06e7[_0x128a16];return _0x54fa47;};'use strict';var _=require('lodash');var md5=require(_0x706e('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x706e('0x1')]=_[_0x706e('0x2')](config[_0x706e('0x1')],{'host':_0x706e('0x3'),'port':0x18eb});var io=require(_0x706e('0x4'))(new Redis(config['redis']));function FaxQueue(_0x2831ac){this['id']=_0x2831ac['id']||0x0;this[_0x706e('0x5')]=_0x2831ac[_0x706e('0x5')]||'';this[_0x706e('0x6')]=_0x2831ac[_0x706e('0x6')]||0xa;this[_0x706e('0x7')]=_0x2831ac[_0x706e('0x7')]||_0x706e('0x8');this['Agents']=_0x2831ac[_0x706e('0x9')];this[_0x706e('0xa')]={};this[_0x706e('0xb')]=0x0;this['md5']='';this[_0x706e('0xc')]();this['updateRealtime']();}FaxQueue[_0x706e('0xd')][_0x706e('0xc')]=function(){var _0x108648=this[_0x706e('0xa')][_0x706e('0xe')];this['mapAgentsId']=_[_0x706e('0xf')](this[_0x706e('0x9')],'id');this[_0x706e('0xa')][_0x706e('0xe')]=_0x108648;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x706e('0x10')]=0x0;this[_0x706e('0x11')]=0x0;for(var _0x2e2d66=0x0;_0x2e2d66=0x0?this[_0x706e('0x14')]:0x0;var _0x129add={'id':this['id'],'available':this[_0x706e('0x14')],'loggedIn':this[_0x706e('0x10')],'name':this[_0x706e('0x5')],'paused':this['paused'],'waiting':this[_0x706e('0xb')]};var _0x128363=md5(JSON[_0x706e('0x15')](_0x129add));if(this[_0x706e('0x0')]!==_0x128363){this['md5']=_0x128363;io['to'](util[_0x706e('0x16')]('fax:queue:%s',_0x129add[_0x706e('0x5')]))[_0x706e('0x17')](_0x706e('0x18'),_0x129add);}};module[_0x706e('0x19')]=FaxQueue; \ No newline at end of file +var _0xc241=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','redis'];(function(_0x587f2a,_0xf47df8){var _0x1c89f2=function(_0x37a261){while(--_0x37a261){_0x587f2a['push'](_0x587f2a['shift']());}};_0x1c89f2(++_0xf47df8);}(_0xc241,0x75));var _0x1c24=function(_0x215c32,_0xf641a4){_0x215c32=_0x215c32-0x0;var _0x59660b=_0xc241[_0x215c32];return _0x59660b;};'use strict';var _=require('lodash');var md5=require(_0x1c24('0x0'));var util=require(_0x1c24('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1c24('0x2')]=_[_0x1c24('0x3')](config[_0x1c24('0x2')],{'host':_0x1c24('0x4'),'port':0x18eb});var io=require(_0x1c24('0x5'))(new Redis(config[_0x1c24('0x2')]));function FaxQueue(_0x28f6ca){this['id']=_0x28f6ca['id']||0x0;this[_0x1c24('0x6')]=_0x28f6ca['name']||'';this[_0x1c24('0x7')]=_0x28f6ca[_0x1c24('0x7')]||0xa;this[_0x1c24('0x8')]=_0x28f6ca['strategy']||_0x1c24('0x9');this['Agents']=_0x28f6ca[_0x1c24('0xa')];this[_0x1c24('0xb')]={};this[_0x1c24('0xc')]=0x0;this[_0x1c24('0x0')]='';this[_0x1c24('0xd')]();this['updateRealtime']();}FaxQueue[_0x1c24('0xe')][_0x1c24('0xd')]=function(){var _0x21d235=this['mapAgentsId'][_0x1c24('0xf')];this[_0x1c24('0xb')]=_[_0x1c24('0x10')](this['Agents'],'id');this[_0x1c24('0xb')][_0x1c24('0xf')]=_0x21d235;};FaxQueue[_0x1c24('0xe')][_0x1c24('0x11')]=function(){this[_0x1c24('0x12')]=0x0;this[_0x1c24('0x13')]=0x0;for(var _0x3f4407=0x0;_0x3f4407=0x0?this['available']:0x0;var _0x6925fb={'id':this['id'],'available':this[_0x1c24('0x17')],'loggedIn':this[_0x1c24('0x12')],'name':this[_0x1c24('0x6')],'paused':this[_0x1c24('0x13')],'waiting':this[_0x1c24('0xc')]};var _0x149811=md5(JSON[_0x1c24('0x18')](_0x6925fb));if(this[_0x1c24('0x0')]!==_0x149811){this[_0x1c24('0x0')]=_0x149811;io['to'](util[_0x1c24('0x19')](_0x1c24('0x1a'),_0x6925fb[_0x1c24('0x6')]))[_0x1c24('0x1b')](_0x1c24('0x1c'),_0x6925fb);}};module[_0x1c24('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index f4a0e0a..d0a160c 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 _0x0bd3=['Intervals','exports','name'];(function(_0x40b66c,_0x578758){var _0x2fd22b=function(_0x3b721b){while(--_0x3b721b){_0x40b66c['push'](_0x40b66c['shift']());}};_0x2fd22b(++_0x578758);}(_0x0bd3,0xc2));var _0x30bd=function(_0x48d7aa,_0x52349c){_0x48d7aa=_0x48d7aa-0x0;var _0x138fc6=_0x0bd3[_0x48d7aa];return _0x138fc6;};'use strict';function Interval(_0x409a7c){this['id']=_0x409a7c['id']||0x0;this[_0x30bd('0x0')]=_0x409a7c['name']||'';this[_0x30bd('0x1')]=_0x409a7c[_0x30bd('0x1')]||{};}module[_0x30bd('0x2')]=Interval; \ No newline at end of file +var _0x467d=['exports','name','Intervals'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x467d,0x6a));var _0xd467=function(_0x58138c,_0xf5834a){_0x58138c=_0x58138c-0x0;var _0x30a2b7=_0x467d[_0x58138c];return _0x30a2b7;};'use strict';function Interval(_0x54d21d){this['id']=_0x54d21d['id']||0x0;this[_0xd467('0x0')]=_0x54d21d['name']||'';this['Intervals']=_0x54d21d[_0xd467('0x1')]||{};}module[_0xd467('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index dd4b10e..dc9e78d 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 _0x5f0e=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults'];(function(_0x142381,_0x36a7fb){var _0x1e81ef=function(_0xe36535){while(--_0xe36535){_0x142381['push'](_0x142381['shift']());}};_0x1e81ef(++_0x36a7fb);}(_0x5f0e,0x166));var _0xe5f0=function(_0x3edd74,_0x2961dc){_0x3edd74=_0x3edd74-0x0;var _0x51ef03=_0x5f0e[_0x3edd74];return _0x51ef03;};'use strict';var _=require(_0xe5f0('0x0'));var md5=require(_0xe5f0('0x1'));var util=require(_0xe5f0('0x2'));var Redis=require(_0xe5f0('0x3'));var config=require('../../../config/environment');config[_0xe5f0('0x4')]=_[_0xe5f0('0x5')](config[_0xe5f0('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe5f0('0x6'))(new Redis(config[_0xe5f0('0x4')]));function MailQueue(_0x460f67){this['id']=_0x460f67['id']||0x0;this[_0xe5f0('0x7')]=_0x460f67[_0xe5f0('0x7')]||'';this[_0xe5f0('0x8')]=_0x460f67[_0xe5f0('0x8')]||0xa;this['strategy']=_0x460f67[_0xe5f0('0x9')]||'beepall';this[_0xe5f0('0xa')]=_0x460f67['Agents'];this[_0xe5f0('0xb')]={};this[_0xe5f0('0xc')]=0x0;this[_0xe5f0('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0xe5f0('0xd')]['updateRouting']=function(){var _0x4a1465=this[_0xe5f0('0xb')][_0xe5f0('0xe')];this[_0xe5f0('0xb')]=_[_0xe5f0('0xf')](this[_0xe5f0('0xa')],'id');this['mapAgentsId'][_0xe5f0('0xe')]=_0x4a1465;};MailQueue['prototype'][_0xe5f0('0x10')]=function(){this[_0xe5f0('0x11')]=0x0;this[_0xe5f0('0x12')]=0x0;for(var _0x3b4f17=0x0;_0x3b4f17=0x0?this[_0xe5f0('0x16')]:0x0;var _0x19474f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe5f0('0x11')],'name':this[_0xe5f0('0x7')],'paused':this['paused'],'waiting':this[_0xe5f0('0xc')]};var _0x174a50=md5(JSON[_0xe5f0('0x17')](_0x19474f));if(this[_0xe5f0('0x1')]!==_0x174a50){this[_0xe5f0('0x1')]=_0x174a50;io['to'](util['format'](_0xe5f0('0x18'),_0x19474f[_0xe5f0('0x7')]))[_0xe5f0('0x19')](_0xe5f0('0x1a'),_0x19474f);}};module[_0xe5f0('0x1b')]=MailQueue; \ No newline at end of file +var _0x3be1=['util','../../../config/environment','redis','socket.io-emitter','name','timeout','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','length','paused','available','stringify','format','emit','mail_queue:save','exports','lodash','md5'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x3be1,0x19e));var _0x13be=function(_0x41c795,_0x485a2b){_0x41c795=_0x41c795-0x0;var _0x343aa4=_0x3be1[_0x41c795];return _0x343aa4;};'use strict';var _=require(_0x13be('0x0'));var md5=require(_0x13be('0x1'));var util=require(_0x13be('0x2'));var Redis=require('ioredis');var config=require(_0x13be('0x3'));config[_0x13be('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x13be('0x5'))(new Redis(config['redis']));function MailQueue(_0x2de8b3){this['id']=_0x2de8b3['id']||0x0;this[_0x13be('0x6')]=_0x2de8b3[_0x13be('0x6')]||'';this[_0x13be('0x7')]=_0x2de8b3[_0x13be('0x7')]||0xa;this['strategy']=_0x2de8b3['strategy']||_0x13be('0x8');this[_0x13be('0x9')]=_0x2de8b3['Agents'];this['mapAgentsId']={};this[_0x13be('0xa')]=0x0;this[_0x13be('0x1')]='';this[_0x13be('0xb')]();this[_0x13be('0xc')]();}MailQueue[_0x13be('0xd')]['updateRouting']=function(){var _0x1b0056=this['mapAgentsId'][_0x13be('0xe')];this[_0x13be('0xf')]=_[_0x13be('0x10')](this[_0x13be('0x9')],'id');this[_0x13be('0xf')]['_rr']=_0x1b0056;};MailQueue[_0x13be('0xd')][_0x13be('0xc')]=function(){this[_0x13be('0x11')]=0x0;this['paused']=0x0;for(var _0x57e62d=0x0;_0x57e62d=0x0?this[_0x13be('0x14')]:0x0;var _0x239a87={'id':this['id'],'available':this[_0x13be('0x14')],'loggedIn':this[_0x13be('0x11')],'name':this[_0x13be('0x6')],'paused':this[_0x13be('0x13')],'waiting':this['waiting']};var _0x43d776=md5(JSON[_0x13be('0x15')](_0x239a87));if(this[_0x13be('0x1')]!==_0x43d776){this[_0x13be('0x1')]=_0x43d776;io['to'](util[_0x13be('0x16')]('mail:queue:%s',_0x239a87[_0x13be('0x6')]))[_0x13be('0x17')](_0x13be('0x18'),_0x239a87);}};module[_0x13be('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 0b4298d..03392e5 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x1da5b6,_0x34ac20){_0x1da5b6=_0x1da5b6-0x0;var _0xea4733=_0x7a54[_0x1da5b6];return _0xea4733;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f4add79..51725c9 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 _0xee24=['updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','paused','available','waiting','stringify','format','emit','sms_queue:save','exports','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting'];(function(_0x9fdd53,_0xd7b5c0){var _0x4ed380=function(_0x365143){while(--_0x365143){_0x9fdd53['push'](_0x9fdd53['shift']());}};_0x4ed380(++_0xd7b5c0);}(_0xee24,0x1a6));var _0x4ee2=function(_0x2b6485,_0xbb4dc5){_0x2b6485=_0x2b6485-0x0;var _0x5e96bd=_0xee24[_0x2b6485];return _0x5e96bd;};'use strict';var _=require('lodash');var md5=require(_0x4ee2('0x0'));var util=require(_0x4ee2('0x1'));var Redis=require('ioredis');var config=require(_0x4ee2('0x2'));config[_0x4ee2('0x3')]=_[_0x4ee2('0x4')](config[_0x4ee2('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x4ee2('0x5'))(new Redis(config[_0x4ee2('0x3')]));function SmsQueue(_0x477664){this['id']=_0x477664['id']||0x0;this[_0x4ee2('0x6')]=_0x477664['name']||'';this[_0x4ee2('0x7')]=_0x477664[_0x4ee2('0x7')]||0xa;this[_0x4ee2('0x8')]=_0x477664[_0x4ee2('0x8')]||_0x4ee2('0x9');this[_0x4ee2('0xa')]=_0x477664[_0x4ee2('0xa')];this[_0x4ee2('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x4ee2('0xc')]();this[_0x4ee2('0xd')]();}SmsQueue[_0x4ee2('0xe')][_0x4ee2('0xc')]=function(){var _0x2363b0=this['mapAgentsId'][_0x4ee2('0xf')];this[_0x4ee2('0xb')]=_[_0x4ee2('0x10')](this[_0x4ee2('0xa')],'id');this['mapAgentsId'][_0x4ee2('0xf')]=_0x2363b0;};SmsQueue[_0x4ee2('0xe')][_0x4ee2('0xd')]=function(){this[_0x4ee2('0x11')]=0x0;this['paused']=0x0;for(var _0x481181=0x0;_0x481181=0x0?this['available']:0x0;var _0x23df00={'id':this['id'],'available':this[_0x4ee2('0x16')],'loggedIn':this[_0x4ee2('0x11')],'name':this[_0x4ee2('0x6')],'paused':this[_0x4ee2('0x15')],'waiting':this[_0x4ee2('0x17')]};var _0x2d2284=md5(JSON[_0x4ee2('0x18')](_0x23df00));if(this['md5']!==_0x2d2284){this['md5']=_0x2d2284;io['to'](util[_0x4ee2('0x19')]('sms:queue:%s',_0x23df00[_0x4ee2('0x6')]))[_0x4ee2('0x1a')](_0x4ee2('0x1b'),_0x23df00);}};module[_0x4ee2('0x1c')]=SmsQueue; \ No newline at end of file +var _0x0487=['ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','format','sms:queue:%s','sms_queue:save','lodash','md5','util'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x0487,0x14f));var _0x7048=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x0487[_0xadde88];return _0x3b8eb6;};'use strict';var _=require(_0x7048('0x0'));var md5=require(_0x7048('0x1'));var util=require(_0x7048('0x2'));var Redis=require(_0x7048('0x3'));var config=require(_0x7048('0x4'));config[_0x7048('0x5')]=_['defaults'](config[_0x7048('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7048('0x6'))(new Redis(config[_0x7048('0x5')]));function SmsQueue(_0x1f00bf){this['id']=_0x1f00bf['id']||0x0;this[_0x7048('0x7')]=_0x1f00bf['name']||'';this[_0x7048('0x8')]=_0x1f00bf[_0x7048('0x8')]||0xa;this[_0x7048('0x9')]=_0x1f00bf['strategy']||_0x7048('0xa');this['Agents']=_0x1f00bf[_0x7048('0xb')];this[_0x7048('0xc')]={};this[_0x7048('0xd')]=0x0;this[_0x7048('0x1')]='';this[_0x7048('0xe')]();this[_0x7048('0xf')]();}SmsQueue[_0x7048('0x10')]['updateRouting']=function(){var _0x2eba6e=this[_0x7048('0xc')][_0x7048('0x11')];this['mapAgentsId']=_[_0x7048('0x12')](this[_0x7048('0xb')],'id');this['mapAgentsId'][_0x7048('0x11')]=_0x2eba6e;};SmsQueue[_0x7048('0x10')][_0x7048('0xf')]=function(){this[_0x7048('0x13')]=0x0;this[_0x7048('0x14')]=0x0;for(var _0x546c51=0x0;_0x546c51=0x0?this[_0x7048('0x16')]:0x0;var _0xbef931={'id':this['id'],'available':this[_0x7048('0x16')],'loggedIn':this[_0x7048('0x13')],'name':this['name'],'paused':this[_0x7048('0x14')],'waiting':this['waiting']};var _0x521a61=md5(JSON['stringify'](_0xbef931));if(this[_0x7048('0x1')]!==_0x521a61){this[_0x7048('0x1')]=_0x521a61;io['to'](util[_0x7048('0x17')](_0x7048('0x18'),_0xbef931[_0x7048('0x7')]))['emit'](_0x7048('0x19'),_0xbef931);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 9b1e93c..accbb6d 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 _0xcadd=['paused','available','stringify','emit','exports','util','ioredis','../../../config/environment','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','length','online','whatsappPause'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcadd,0xa7));var _0xdcad=function(_0x32ebb2,_0x5760fd){_0x32ebb2=_0x32ebb2-0x0;var _0x3ec997=_0xcadd[_0x32ebb2];return _0x3ec997;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xdcad('0x0'));var Redis=require(_0xdcad('0x1'));var config=require(_0xdcad('0x2'));config['redis']=_['defaults'](config['redis'],{'host':_0xdcad('0x3'),'port':0x18eb});var io=require(_0xdcad('0x4'))(new Redis(config['redis']));function WhatsappQueue(_0x26f8de){this['id']=_0x26f8de['id']||0x0;this[_0xdcad('0x5')]=_0x26f8de[_0xdcad('0x5')]||'';this['timeout']=_0x26f8de[_0xdcad('0x6')]||0xa;this[_0xdcad('0x7')]=_0x26f8de['strategy']||_0xdcad('0x8');this[_0xdcad('0x9')]=_0x26f8de[_0xdcad('0x9')];this[_0xdcad('0xa')]={};this[_0xdcad('0xb')]=0x0;this[_0xdcad('0xc')]='';this[_0xdcad('0xd')]();this[_0xdcad('0xe')]();}WhatsappQueue['prototype'][_0xdcad('0xd')]=function(){var _0x1fbb86=this[_0xdcad('0xa')]['_rr'];this[_0xdcad('0xa')]=_[_0xdcad('0xf')](this[_0xdcad('0x9')],'id');this['mapAgentsId'][_0xdcad('0x10')]=_0x1fbb86;};WhatsappQueue[_0xdcad('0x11')]['updateRealtime']=function(){this[_0xdcad('0x12')]=0x0;this['paused']=0x0;for(var _0xed7b4b=0x0;_0xed7b4b=0x0?this[_0xdcad('0x17')]:0x0;var _0x275e66={'id':this['id'],'available':this[_0xdcad('0x17')],'loggedIn':this[_0xdcad('0x12')],'name':this['name'],'paused':this[_0xdcad('0x16')],'waiting':this[_0xdcad('0xb')]};var _0x365136=md5(JSON[_0xdcad('0x18')](_0x275e66));if(this[_0xdcad('0xc')]!==_0x365136){this[_0xdcad('0xc')]=_0x365136;io['to'](util['format']('whatsapp:queue:%s',_0x275e66[_0xdcad('0x5')]))[_0xdcad('0x19')]('whatsapp_queue:save',_0x275e66);}};module[_0xdcad('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x907b=['md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash'];(function(_0xe87a2c,_0x1d9ddc){var _0x560ecc=function(_0x54f20d){while(--_0x54f20d){_0xe87a2c['push'](_0xe87a2c['shift']());}};_0x560ecc(++_0x1d9ddc);}(_0x907b,0x17f));var _0xb907=function(_0x234318,_0xf22f31){_0x234318=_0x234318-0x0;var _0x1ab719=_0x907b[_0x234318];return _0x1ab719;};'use strict';var _=require(_0xb907('0x0'));var md5=require(_0xb907('0x1'));var util=require('util');var Redis=require(_0xb907('0x2'));var config=require(_0xb907('0x3'));config[_0xb907('0x4')]=_[_0xb907('0x5')](config['redis'],{'host':_0xb907('0x6'),'port':0x18eb});var io=require(_0xb907('0x7'))(new Redis(config[_0xb907('0x4')]));function WhatsappQueue(_0x426fb0){this['id']=_0x426fb0['id']||0x0;this[_0xb907('0x8')]=_0x426fb0[_0xb907('0x8')]||'';this[_0xb907('0x9')]=_0x426fb0[_0xb907('0x9')]||0xa;this[_0xb907('0xa')]=_0x426fb0[_0xb907('0xa')]||_0xb907('0xb');this[_0xb907('0xc')]=_0x426fb0[_0xb907('0xc')];this[_0xb907('0xd')]={};this[_0xb907('0xe')]=0x0;this[_0xb907('0x1')]='';this[_0xb907('0xf')]();this[_0xb907('0x10')]();}WhatsappQueue[_0xb907('0x11')][_0xb907('0xf')]=function(){var _0x2458aa=this[_0xb907('0xd')][_0xb907('0x12')];this[_0xb907('0xd')]=_[_0xb907('0x13')](this['Agents'],'id');this['mapAgentsId'][_0xb907('0x12')]=_0x2458aa;};WhatsappQueue[_0xb907('0x11')][_0xb907('0x10')]=function(){this['loggedIn']=0x0;this[_0xb907('0x14')]=0x0;for(var _0x28da64=0x0;_0x28da64=0x0?this[_0xb907('0x19')]:0x0;var _0x470f7c={'id':this['id'],'available':this[_0xb907('0x19')],'loggedIn':this[_0xb907('0x17')],'name':this[_0xb907('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x3964b2=md5(JSON[_0xb907('0x1a')](_0x470f7c));if(this[_0xb907('0x1')]!==_0x3964b2){this[_0xb907('0x1')]=_0x3964b2;io['to'](util[_0xb907('0x1b')](_0xb907('0x1c'),_0x470f7c[_0xb907('0x8')]))[_0xb907('0x1d')](_0xb907('0x1e'),_0x470f7c);}};module[_0xb907('0x1f')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1877113..2f4d747 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3b3ba8,_0x53ec77){var _0x2076d3=function(_0x37775e){while(--_0x37775e){_0x3b3ba8['push'](_0x3b3ba8['shift']());}};_0x2076d3(++_0x53ec77);}(_0xb10b,0x12a));var _0xbb10=function(_0x468481,_0x3d8b88){_0x468481=_0x468481-0x0;var _0x363252=_0xb10b[_0x468481];return _0x363252;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 8d5dd1a..c6fcfc9 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 _0xb039=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x453818,_0x4bc8d4){var _0x2b8714=function(_0x2e736e){while(--_0x2e736e){_0x453818['push'](_0x453818['shift']());}};_0x2b8714(++_0x4bc8d4);}(_0xb039,0x9a));var _0x9b03=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0xb039[_0x3df223];return _0x562d11;};'use strict';var client=require(_0x9b03('0x0'));exports['update']=function(_0x3ddb87,_0x72be71){return client[_0x9b03('0x1')](_0x9b03('0x2'),{'body':_0x72be71,'options':{'where':{'id':_0x3ddb87}},'log':_0x9b03('0x3')});};exports['addTags']=function(_0x3f9c31,_0x30274a){return client[_0x9b03('0x1')](_0x9b03('0x4'),{'body':_0x30274a,'options':{'where':{'id':_0x3f9c31}},'log':_0x9b03('0x5')});}; \ No newline at end of file +var _0x53d1=['AddTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','addTags','Request'];(function(_0x591963,_0x4b650c){var _0x1b42bc=function(_0x25359a){while(--_0x25359a){_0x591963['push'](_0x591963['shift']());}};_0x1b42bc(++_0x4b650c);}(_0x53d1,0x1c8));var _0x153d=function(_0x5b4967,_0x3d5dfb){_0x5b4967=_0x5b4967-0x0;var _0x2dce35=_0x53d1[_0x5b4967];return _0x2dce35;};'use strict';var client=require(_0x153d('0x0'));exports[_0x153d('0x1')]=function(_0x4ef398,_0x20a04b){return client['Request'](_0x153d('0x2'),{'body':_0x20a04b,'options':{'where':{'id':_0x4ef398}},'log':_0x153d('0x3')});};exports[_0x153d('0x4')]=function(_0x5091a6,_0x4ab70e){return client[_0x153d('0x5')](_0x153d('0x6'),{'body':_0x4ab70e,'options':{'where':{'id':_0x5091a6}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index eabec58..c497df0 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 _0xdeed=['../client','create','Request','CreateChatMessage'];(function(_0x5abf7a,_0x4d16bb){var _0x17350f=function(_0x142f20){while(--_0x142f20){_0x5abf7a['push'](_0x5abf7a['shift']());}};_0x17350f(++_0x4d16bb);}(_0xdeed,0x134));var _0xddee=function(_0x19bf04,_0x2e0403){_0x19bf04=_0x19bf04-0x0;var _0x1ef207=_0xdeed[_0x19bf04];return _0x1ef207;};'use strict';var client=require(_0xddee('0x0'));exports[_0xddee('0x1')]=function(_0x20afaa){return client[_0xddee('0x2')](_0xddee('0x3'),{'body':_0x20afaa,'log':'createChatMessage'});}; \ No newline at end of file +var _0xdd12=['createChatMessage','../client','create','Request'];(function(_0x5ecf38,_0x450035){var _0x1092a7=function(_0x280c58){while(--_0x280c58){_0x5ecf38['push'](_0x5ecf38['shift']());}};_0x1092a7(++_0x450035);}(_0xdd12,0x17d));var _0x2dd1=function(_0xfa8b8f,_0x5d14ec){_0xfa8b8f=_0xfa8b8f-0x0;var _0xf0bf17=_0xdd12[_0xfa8b8f];return _0xf0bf17;};'use strict';var client=require(_0x2dd1('0x0'));exports[_0x2dd1('0x1')]=function(_0x16aaea){return client[_0x2dd1('0x2')]('CreateChatMessage',{'body':_0x16aaea,'log':_0x2dd1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f04b694..4e00c17 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 _0xea31=['name','timeout','strategy','User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue'];(function(_0x24d22f,_0xfa6241){var _0x33b153=function(_0x28caa6){while(--_0x28caa6){_0x24d22f['push'](_0x24d22f['shift']());}};_0x33b153(++_0xfa6241);}(_0xea31,0x6b));var _0x1ea3=function(_0x583447,_0x7c1f1){_0x583447=_0x583447-0x0;var _0x200485=_0xea31[_0x583447];return _0x200485;};'use strict';var client=require(_0x1ea3('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x1ea3('0x1')](_0x1ea3('0x2'),{'options':{'raw':![],'attributes':['id',_0x1ea3('0x3'),_0x1ea3('0x4'),_0x1ea3('0x5')],'include':[{'model':_0x1ea3('0x6'),'as':_0x1ea3('0x7'),'attributes':['id','name',_0x1ea3('0x8'),_0x1ea3('0x9')]}]},'log':_0x1ea3('0xa')});};}; \ No newline at end of file +var _0x06bf=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','online'];(function(_0x1d2195,_0x4b8096){var _0x4962cd=function(_0x301f5a){while(--_0x301f5a){_0x1d2195['push'](_0x1d2195['shift']());}};_0x4962cd(++_0x4b8096);}(_0x06bf,0x105));var _0xf06b=function(_0x582501,_0x14d823){_0x582501=_0x582501-0x0;var _0x5b9392=_0x06bf[_0x582501];return _0x5b9392;};'use strict';var client=require(_0xf06b('0x0'));exports[_0xf06b('0x1')]=function(){return function(){return client[_0xf06b('0x2')](_0xf06b('0x3'),{'options':{'raw':![],'attributes':['id',_0xf06b('0x4'),_0xf06b('0x5'),_0xf06b('0x6')],'include':[{'model':_0xf06b('0x7'),'as':'Agents','attributes':['id',_0xf06b('0x4'),_0xf06b('0x8'),_0xf06b('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 0e33162..e0ec987 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 _0x50c1=['DESC','../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0xa5f44e,_0x3b847a){var _0x541df4=function(_0x90f173){while(--_0x90f173){_0xa5f44e['push'](_0xa5f44e['shift']());}};_0x541df4(++_0x3b847a);}(_0x50c1,0x1a5));var _0x150c=function(_0x214629,_0x2409fe){_0x214629=_0x214629-0x0;var _0x1649f1=_0x50c1[_0x214629];return _0x1649f1;};'use strict';var client=require(_0x150c('0x0'));exports['create']=function(_0x47d48d){return client[_0x150c('0x1')](_0x150c('0x2'),{'body':_0x47d48d,'log':_0x150c('0x2')});};exports[_0x150c('0x3')]=function(_0x24cd1b,_0x18c0bd){return client[_0x150c('0x1')](_0x150c('0x4'),{'body':_0x18c0bd,'options':{'where':{'uniqueid':_0x24cd1b},'order':[['id',_0x150c('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x851e=['CreateChatQueueReport','update','Request','DESC','UpdateChatQueueReport','../client','create'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x851e,0x1e8));var _0xe851=function(_0x1a1131,_0x404e25){_0x1a1131=_0x1a1131-0x0;var _0x2a73ee=_0x851e[_0x1a1131];return _0x2a73ee;};'use strict';var client=require(_0xe851('0x0'));exports[_0xe851('0x1')]=function(_0x2bc74b){return client['Request']('CreateChatQueueReport',{'body':_0x2bc74b,'log':_0xe851('0x2')});};exports[_0xe851('0x3')]=function(_0x16b38a,_0x326b34){return client[_0xe851('0x4')]('UpdateChatQueueReport',{'body':_0x326b34,'options':{'where':{'uniqueid':_0x16b38a},'order':[['id',_0xe851('0x5')]],'limit':0x1},'log':_0xe851('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index df53bed..6695ece 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(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x7a54,0x106));var _0x47a5=function(_0x20164f,_0xcfc815){_0x20164f=_0x20164f-0x0;var _0x1bcb8e=_0x7a54[_0x20164f];return _0x1bcb8e;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0x7a54,0x106));var _0x47a5=function(_0x4b6e32,_0x56055d){_0x4b6e32=_0x4b6e32-0x0;var _0xb55baa=_0x7a54[_0x4b6e32];return _0xb55baa;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 1f7bf3b..f8553d6 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 _0x4967=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x128b62,_0x2c8dbb){var _0x16454d=function(_0x3c2fe1){while(--_0x3c2fe1){_0x128b62['push'](_0x128b62['shift']());}};_0x16454d(++_0x2c8dbb);}(_0x4967,0x138));var _0x7496=function(_0x39eb48,_0x5da47c){_0x39eb48=_0x39eb48-0x0;var _0x10f0b9=_0x4967[_0x39eb48];return _0x10f0b9;};'use strict';var client=require(_0x7496('0x0'));exports['create']=function(_0x3edb64){return client[_0x7496('0x1')](_0x7496('0x2'),{'body':_0x3edb64,'log':_0x7496('0x3')});}; \ No newline at end of file +var _0x873e=['createFaxMessage','../client','create','Request'];(function(_0x47d39d,_0x5b7fd2){var _0x57e78b=function(_0x313e46){while(--_0x313e46){_0x47d39d['push'](_0x47d39d['shift']());}};_0x57e78b(++_0x5b7fd2);}(_0x873e,0x155));var _0xe873=function(_0x1e6b95,_0x15beb6){_0x1e6b95=_0x1e6b95-0x0;var _0x92f195=_0x873e[_0x1e6b95];return _0x92f195;};'use strict';var client=require(_0xe873('0x0'));exports[_0xe873('0x1')]=function(_0x97774e){return client[_0xe873('0x2')]('CreateFaxMessage',{'body':_0x97774e,'log':_0xe873('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9a72994..17015b2 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 _0xca99=['getFaxQueues','Request','GetFaxQueue','name','timeout','User','online','faxPause'];(function(_0x394b71,_0xd2c135){var _0x59c8cc=function(_0x25239f){while(--_0x25239f){_0x394b71['push'](_0x394b71['shift']());}};_0x59c8cc(++_0xd2c135);}(_0xca99,0x90));var _0x9ca9=function(_0x2e2d22,_0x58246a){_0x2e2d22=_0x2e2d22-0x0;var _0x452e3a=_0xca99[_0x2e2d22];return _0x452e3a;};'use strict';var client=require('../client');exports[_0x9ca9('0x0')]=function(){return function(){return client[_0x9ca9('0x1')](_0x9ca9('0x2'),{'options':{'raw':![],'attributes':['id',_0x9ca9('0x3'),_0x9ca9('0x4'),'strategy'],'include':[{'model':_0x9ca9('0x5'),'as':'Agents','attributes':['id',_0x9ca9('0x3'),_0x9ca9('0x6'),_0x9ca9('0x7')]}]},'log':_0x9ca9('0x0')});};}; \ No newline at end of file +var _0x4f06=['strategy','Agents','name','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x3c4f9a,_0x5ec43b){var _0x8665f8=function(_0x2f77ca){while(--_0x2f77ca){_0x3c4f9a['push'](_0x3c4f9a['shift']());}};_0x8665f8(++_0x5ec43b);}(_0x4f06,0x113));var _0x64f0=function(_0x3c47d0,_0x331ad9){_0x3c47d0=_0x3c47d0-0x0;var _0x31391d=_0x4f06[_0x3c47d0];return _0x31391d;};'use strict';var client=require(_0x64f0('0x0'));exports[_0x64f0('0x1')]=function(){return function(){return client[_0x64f0('0x2')](_0x64f0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x64f0('0x4'),_0x64f0('0x5')],'include':[{'model':'User','as':_0x64f0('0x6'),'attributes':['id',_0x64f0('0x7'),_0x64f0('0x8'),_0x64f0('0x9')]}]},'log':_0x64f0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 80583e5..e233b57 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 _0x753e=['Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x53ed05,_0x5d0885){var _0x2e853e=function(_0x407020){while(--_0x407020){_0x53ed05['push'](_0x53ed05['shift']());}};_0x2e853e(++_0x5d0885);}(_0x753e,0xe2));var _0xe753=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x753e[_0x243b2f];return _0xcb3c2d;};'use strict';var client=require(_0xe753('0x0'));exports[_0xe753('0x1')]=function(_0x7db5f1){return client[_0xe753('0x2')](_0xe753('0x3'),{'body':_0x7db5f1,'log':_0xe753('0x3')});};exports['update']=function(_0x2022c8,_0xb38b72){return client[_0xe753('0x2')](_0xe753('0x4'),{'body':_0xb38b72,'options':{'where':{'uniqueid':_0x2022c8},'order':[['id',_0xe753('0x5')]],'limit':0x1},'log':_0xe753('0x4')});}; \ No newline at end of file +var _0x8385=['CreateFaxQueueReport','update','DESC','create','Request'];(function(_0x5ef51f,_0x5d971e){var _0x55985b=function(_0x5dcb65){while(--_0x5dcb65){_0x5ef51f['push'](_0x5ef51f['shift']());}};_0x55985b(++_0x5d971e);}(_0x8385,0x12a));var _0x5838=function(_0x356f5f,_0x2921f6){_0x356f5f=_0x356f5f-0x0;var _0x2d1e12=_0x8385[_0x356f5f];return _0x2d1e12;};'use strict';var client=require('../client');exports[_0x5838('0x0')]=function(_0x369080){return client[_0x5838('0x1')](_0x5838('0x2'),{'body':_0x369080,'log':'CreateFaxQueueReport'});};exports[_0x5838('0x3')]=function(_0x290599,_0x471e15){return client[_0x5838('0x1')]('UpdateFaxQueueReport',{'body':_0x471e15,'options':{'where':{'uniqueid':_0x290599},'order':[['id',_0x5838('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 470fcbb..fce0df0 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 _0xd492=['GetInterval','Interval','Intervals','name','interval','../client','getIntervals','Request'];(function(_0x3c79d1,_0x1e55d4){var _0x1646e8=function(_0x278dfe){while(--_0x278dfe){_0x3c79d1['push'](_0x3c79d1['shift']());}};_0x1646e8(++_0x1e55d4);}(_0xd492,0x1bd));var _0x2d49=function(_0x2c41d4,_0x58ab58){_0x2c41d4=_0x2c41d4-0x0;var _0x5140d9=_0xd492[_0x2c41d4];return _0x5140d9;};'use strict';var client=require(_0x2d49('0x0'));exports[_0x2d49('0x1')]=function(){return function(){return client[_0x2d49('0x2')](_0x2d49('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x2d49('0x4'),'as':_0x2d49('0x5'),'attributes':['id',_0x2d49('0x6'),_0x2d49('0x7')]}]},'log':_0x2d49('0x1')});};}; \ No newline at end of file +var _0xb715=['getIntervals','Request','GetInterval','Interval','Intervals','name','../client'];(function(_0x5d2d59,_0x323458){var _0x25e7ab=function(_0x47d37b){while(--_0x47d37b){_0x5d2d59['push'](_0x5d2d59['shift']());}};_0x25e7ab(++_0x323458);}(_0xb715,0x12c));var _0x5b71=function(_0x2ae9e0,_0x45151d){_0x2ae9e0=_0x2ae9e0-0x0;var _0xb2f720=_0xb715[_0x2ae9e0];return _0xb2f720;};'use strict';var client=require(_0x5b71('0x0'));exports[_0x5b71('0x1')]=function(){return function(){return client[_0x5b71('0x2')](_0x5b71('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x5b71('0x4'),'as':_0x5b71('0x5'),'attributes':['id',_0x5b71('0x6'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 9408476..1bd412a 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 _0x1893=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x339bd9,_0x1dfef1){var _0x41189d=function(_0xef0ccb){while(--_0xef0ccb){_0x339bd9['push'](_0x339bd9['shift']());}};_0x41189d(++_0x1dfef1);}(_0x1893,0xa2));var _0x3189=function(_0x32c57d,_0x4b455a){_0x32c57d=_0x32c57d-0x0;var _0x353d7f=_0x1893[_0x32c57d];return _0x353d7f;};'use strict';var client=require('../client');exports['update']=function(_0x1bfe8b,_0x3aec2b){return client[_0x3189('0x0')](_0x3189('0x1'),{'body':_0x3aec2b,'options':{'where':{'id':_0x1bfe8b}},'log':_0x3189('0x2')});};exports[_0x3189('0x3')]=function(_0x3953a2,_0x5371db){return client[_0x3189('0x0')](_0x3189('0x4'),{'body':_0x5371db,'options':{'where':{'id':_0x3953a2}},'log':_0x3189('0x5')});}; \ No newline at end of file +var _0x6d38=['updateMailInteraction','Request','addTagsToChatInteraction','update'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x6d38,0x1ef));var _0x86d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6d38[_0x31e29a];return _0x32d892;};'use strict';var client=require('../client');exports[_0x86d3('0x0')]=function(_0x4c9c06,_0x3db243){return client['Request']('UpdateMailInteraction',{'body':_0x3db243,'options':{'where':{'id':_0x4c9c06}},'log':_0x86d3('0x1')});};exports['addTags']=function(_0xe9198a,_0x455b9d){return client[_0x86d3('0x2')]('AddTagsToMailInteraction',{'body':_0x455b9d,'options':{'where':{'id':_0xe9198a}},'log':_0x86d3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6788fda..9008c7e 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 _0x1d18=['Request','createMailMessage','../client','create'];(function(_0x4107a1,_0x5d3779){var _0x566b65=function(_0x1bc900){while(--_0x1bc900){_0x4107a1['push'](_0x4107a1['shift']());}};_0x566b65(++_0x5d3779);}(_0x1d18,0x1ee));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x81d1('0x0'));exports[_0x81d1('0x1')]=function(_0x380eaf){return client[_0x81d1('0x2')]('CreateMailMessage',{'body':_0x380eaf,'log':_0x81d1('0x3')});}; \ No newline at end of file +var _0x04d0=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x5c0210,_0x1b9a94){var _0x42f36b=function(_0x235e38){while(--_0x235e38){_0x5c0210['push'](_0x5c0210['shift']());}};_0x42f36b(++_0x1b9a94);}(_0x04d0,0x16e));var _0x004d=function(_0x4e558a,_0x4b60df){_0x4e558a=_0x4e558a-0x0;var _0x3b4ee8=_0x04d0[_0x4e558a];return _0x3b4ee8;};'use strict';var client=require(_0x004d('0x0'));exports[_0x004d('0x1')]=function(_0x1c806b){return client[_0x004d('0x2')](_0x004d('0x3'),{'body':_0x1c806b,'log':_0x004d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 7cfa7e9..924615b 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 _0x2305=['timeout','strategy','User','Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x4474c2,_0x59cf02){var _0x435fbb=function(_0x3c86eb){while(--_0x3c86eb){_0x4474c2['push'](_0x4474c2['shift']());}};_0x435fbb(++_0x59cf02);}(_0x2305,0x181));var _0x5230=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x2305[_0x38b2d9];return _0x23a3e1;};'use strict';var client=require(_0x5230('0x0'));exports[_0x5230('0x1')]=function(){return function(){return client[_0x5230('0x2')](_0x5230('0x3'),{'options':{'raw':![],'attributes':['id',_0x5230('0x4'),_0x5230('0x5'),_0x5230('0x6')],'include':[{'model':_0x5230('0x7'),'as':_0x5230('0x8'),'attributes':['id',_0x5230('0x4'),'online',_0x5230('0x9')]}]},'log':_0x5230('0x1')});};}; \ No newline at end of file +var _0x6af6=['timeout','strategy','User','Agents','mailPause','getMailQueues','Request','GetMailQueue','name'];(function(_0x5046ea,_0x460958){var _0x3260f1=function(_0x3cb578){while(--_0x3cb578){_0x5046ea['push'](_0x5046ea['shift']());}};_0x3260f1(++_0x460958);}(_0x6af6,0x83));var _0x66af=function(_0x31522d,_0x5951e7){_0x31522d=_0x31522d-0x0;var _0x207c78=_0x6af6[_0x31522d];return _0x207c78;};'use strict';var client=require('../client');exports[_0x66af('0x0')]=function(){return function(){return client[_0x66af('0x1')](_0x66af('0x2'),{'options':{'raw':![],'attributes':['id',_0x66af('0x3'),_0x66af('0x4'),_0x66af('0x5')],'include':[{'model':_0x66af('0x6'),'as':_0x66af('0x7'),'attributes':['id',_0x66af('0x3'),'online',_0x66af('0x8')]}]},'log':_0x66af('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d9b8e9e..3dae9c9 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 _0xf855=['DESC','CreateMailQueueReport','Request','UpdateMailQueueReport'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xf855,0x149));var _0x5f85=function(_0x3c9c00,_0x38904f){_0x3c9c00=_0x3c9c00-0x0;var _0xd9b3d=_0xf855[_0x3c9c00];return _0xd9b3d;};'use strict';var client=require('../client');exports['create']=function(_0x1bd35e){return client['Request'](_0x5f85('0x0'),{'body':_0x1bd35e,'log':_0x5f85('0x0')});};exports['update']=function(_0x582418,_0x48d8fb){return client[_0x5f85('0x1')](_0x5f85('0x2'),{'body':_0x48d8fb,'options':{'where':{'uniqueid':_0x582418},'order':[['id',_0x5f85('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x71bc=['../client','Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x71bc,0x96));var _0xc71b=function(_0x3244a8,_0x30ddd9){_0x3244a8=_0x3244a8-0x0;var _0x4216f0=_0x71bc[_0x3244a8];return _0x4216f0;};'use strict';var client=require(_0xc71b('0x0'));exports['create']=function(_0x52305a){return client[_0xc71b('0x1')](_0xc71b('0x2'),{'body':_0x52305a,'log':_0xc71b('0x2')});};exports[_0xc71b('0x3')]=function(_0x390713,_0x1d5d25){return client[_0xc71b('0x1')]('UpdateMailQueueReport',{'body':_0x1d5d25,'options':{'where':{'uniqueid':_0x390713},'order':[['id',_0xc71b('0x4')]],'limit':0x1},'log':_0xc71b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8f0e5fb..59f3f4b 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 _0x5ecb=['../client','update','Request','UpdateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x588c33,_0xe686f7){var _0x5c639c=function(_0x128ccf){while(--_0x128ccf){_0x588c33['push'](_0x588c33['shift']());}};_0x5c639c(++_0xe686f7);}(_0x5ecb,0x174));var _0xb5ec=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x5ecb[_0x4e4f0e];return _0x1a7219;};'use strict';var client=require(_0xb5ec('0x0'));exports[_0xb5ec('0x1')]=function(_0x7f8fba,_0x416c6e){return client[_0xb5ec('0x2')](_0xb5ec('0x3'),{'body':_0x416c6e,'options':{'where':{'id':_0x7f8fba}},'log':'updateOpenchannelInteraction'});};exports[_0xb5ec('0x4')]=function(_0xf2e99a,_0x5c0349){return client[_0xb5ec('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x5c0349,'options':{'where':{'id':_0xf2e99a}},'log':_0xb5ec('0x5')});}; \ No newline at end of file +var _0xcbdd=['../client','update','UpdateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x112267,_0x35a472){var _0x2657be=function(_0x14102b){while(--_0x14102b){_0x112267['push'](_0x112267['shift']());}};_0x2657be(++_0x35a472);}(_0xcbdd,0xb6));var _0xdcbd=function(_0xffd01,_0x1ff1df){_0xffd01=_0xffd01-0x0;var _0x464732=_0xcbdd[_0xffd01];return _0x464732;};'use strict';var client=require(_0xdcbd('0x0'));exports[_0xdcbd('0x1')]=function(_0x521c4a,_0x1b8f70){return client['Request'](_0xdcbd('0x2'),{'body':_0x1b8f70,'options':{'where':{'id':_0x521c4a}},'log':'updateOpenchannelInteraction'});};exports[_0xdcbd('0x3')]=function(_0x441bd3,_0x4887cd){return client[_0xdcbd('0x4')](_0xdcbd('0x5'),{'body':_0x4887cd,'options':{'where':{'id':_0x441bd3}},'log':_0xdcbd('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7661b48..bc68916 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 _0x2b5e=['CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x1ebd1b,_0x563c39){var _0xc0a4c6=function(_0x99541d){while(--_0x99541d){_0x1ebd1b['push'](_0x1ebd1b['shift']());}};_0xc0a4c6(++_0x563c39);}(_0x2b5e,0xa1));var _0xe2b5=function(_0x40ecd0,_0x27de55){_0x40ecd0=_0x40ecd0-0x0;var _0x5a9953=_0x2b5e[_0x40ecd0];return _0x5a9953;};'use strict';var client=require('../client');exports[_0xe2b5('0x0')]=function(_0x20e2a7){return client['Request'](_0xe2b5('0x1'),{'body':_0x20e2a7,'log':_0xe2b5('0x2')});}; \ No newline at end of file +var _0x67d7=['createOpenchannelMessage','../client','Request'];(function(_0x275621,_0x524302){var _0x2ad056=function(_0x1e962f){while(--_0x1e962f){_0x275621['push'](_0x275621['shift']());}};_0x2ad056(++_0x524302);}(_0x67d7,0x1de));var _0x767d=function(_0x2d8667,_0x3a4ac6){_0x2d8667=_0x2d8667-0x0;var _0x2b6069=_0x67d7[_0x2d8667];return _0x2b6069;};'use strict';var client=require(_0x767d('0x0'));exports['create']=function(_0x32c3d3){return client[_0x767d('0x1')]('CreateOpenchannelMessage',{'body':_0x32c3d3,'log':_0x767d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index c8684fc..a1c7a49 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 _0x61e0=['timeout','strategy','Agents','name','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xf8b4cb,_0x41fe7f){var _0x2f9d17=function(_0x389fcd){while(--_0x389fcd){_0xf8b4cb['push'](_0xf8b4cb['shift']());}};_0x2f9d17(++_0x41fe7f);}(_0x61e0,0xc2));var _0x061e=function(_0x5f115b,_0x104f57){_0x5f115b=_0x5f115b-0x0;var _0x258cb5=_0x61e0[_0x5f115b];return _0x258cb5;};'use strict';var client=require(_0x061e('0x0'));exports[_0x061e('0x1')]=function(){return function(){return client[_0x061e('0x2')](_0x061e('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x061e('0x4'),_0x061e('0x5')],'include':[{'model':'User','as':_0x061e('0x6'),'attributes':['id',_0x061e('0x7'),_0x061e('0x8'),'openchannelPause']}]},'log':_0x061e('0x1')});};}; \ No newline at end of file +var _0xa32a=['openchannelPause','../client','Request','GetOpenchannelQueue','Agents','online'];(function(_0x409746,_0x1d3b05){var _0x52d368=function(_0x37ff83){while(--_0x37ff83){_0x409746['push'](_0x409746['shift']());}};_0x52d368(++_0x1d3b05);}(_0xa32a,0x1a5));var _0xaa32=function(_0x1c9108,_0x26f835){_0x1c9108=_0x1c9108-0x0;var _0x1ee828=_0xa32a[_0x1c9108];return _0x1ee828;};'use strict';var client=require(_0xaa32('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xaa32('0x1')](_0xaa32('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0xaa32('0x3'),'attributes':['id','name',_0xaa32('0x4'),_0xaa32('0x5')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a12487b..8fb80e4 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 _0xb5d6=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x4178dc,_0x23ac58){var _0x37a815=function(_0x46c6e9){while(--_0x46c6e9){_0x4178dc['push'](_0x4178dc['shift']());}};_0x37a815(++_0x23ac58);}(_0xb5d6,0x176));var _0x6b5d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb5d6[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0x6b5d('0x0'));exports['create']=function(_0x4653db){return client[_0x6b5d('0x1')](_0x6b5d('0x2'),{'body':_0x4653db,'log':_0x6b5d('0x2')});};exports['update']=function(_0x416222,_0x16c56e){return client[_0x6b5d('0x1')](_0x6b5d('0x3'),{'body':_0x16c56e,'options':{'where':{'uniqueid':_0x416222},'order':[['id',_0x6b5d('0x4')]],'limit':0x1},'log':_0x6b5d('0x3')});}; \ No newline at end of file +var _0x5eb8=['DESC','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4afdce,_0x2d1a6a){var _0x5a163f=function(_0x392115){while(--_0x392115){_0x4afdce['push'](_0x4afdce['shift']());}};_0x5a163f(++_0x2d1a6a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0x5eb8[_0x4599b6];return _0x2e014c;};'use strict';var client=require('../client');exports['create']=function(_0x16de3e){return client[_0x85eb('0x0')](_0x85eb('0x1'),{'body':_0x16de3e,'log':_0x85eb('0x1')});};exports[_0x85eb('0x2')]=function(_0x13d8a9,_0x13b1df){return client[_0x85eb('0x0')](_0x85eb('0x3'),{'body':_0x13b1df,'options':{'where':{'uniqueid':_0x13d8a9},'order':[['id',_0x85eb('0x4')]],'limit':0x1},'log':_0x85eb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 642244c..139a49e 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 _0x3edc=['Request','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x1c835b,_0x511f7b){var _0x2670d8=function(_0x2f9de3){while(--_0x2f9de3){_0x1c835b['push'](_0x1c835b['shift']());}};_0x2670d8(++_0x511f7b);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0x3edc[_0x58a4fe];return _0x697de2;};'use strict';var client=require(_0xc3ed('0x0'));exports[_0xc3ed('0x1')]=function(_0xdb92a8,_0x1b88a1){return client[_0xc3ed('0x2')]('UpdateSmsInteraction',{'body':_0x1b88a1,'options':{'where':{'id':_0xdb92a8}},'log':_0xc3ed('0x3')});};exports['addTags']=function(_0x3519ab,_0x19d8dc){return client[_0xc3ed('0x2')](_0xc3ed('0x4'),{'body':_0x19d8dc,'options':{'where':{'id':_0x3519ab}},'log':_0xc3ed('0x5')});}; \ No newline at end of file +var _0x769c=['../client','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x2a07b0,_0x3732a5){var _0x1684ef=function(_0x598946){while(--_0x598946){_0x2a07b0['push'](_0x2a07b0['shift']());}};_0x1684ef(++_0x3732a5);}(_0x769c,0x96));var _0xc769=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x769c[_0x27af45];return _0x18df21;};'use strict';var client=require(_0xc769('0x0'));exports['update']=function(_0x2bcf3f,_0x463db3){return client['Request']('UpdateSmsInteraction',{'body':_0x463db3,'options':{'where':{'id':_0x2bcf3f}},'log':_0xc769('0x1')});};exports[_0xc769('0x2')]=function(_0x21f114,_0x3409d2){return client['Request'](_0xc769('0x3'),{'body':_0x3409d2,'options':{'where':{'id':_0x21f114}},'log':_0xc769('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3efa7fb..73aa3ae 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 _0xe995=['CreateSmsMessage','createSmsMessage','../client','Request'];(function(_0x4c1ad8,_0x55e28d){var _0x2c617b=function(_0x5f80df){while(--_0x5f80df){_0x4c1ad8['push'](_0x4c1ad8['shift']());}};_0x2c617b(++_0x55e28d);}(_0xe995,0x1ce));var _0x5e99=function(_0x6f89bc,_0x2d7051){_0x6f89bc=_0x6f89bc-0x0;var _0x25e85d=_0xe995[_0x6f89bc];return _0x25e85d;};'use strict';var client=require(_0x5e99('0x0'));exports['create']=function(_0x3831a7){return client[_0x5e99('0x1')](_0x5e99('0x2'),{'body':_0x3831a7,'log':_0x5e99('0x3')});}; \ No newline at end of file +var _0xa370=['createSmsMessage','../client','create','CreateSmsMessage'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0xa370,0x65));var _0x0a37=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xa370[_0xe39824];return _0x4bc31e;};'use strict';var client=require(_0x0a37('0x0'));exports[_0x0a37('0x1')]=function(_0x4eb9a8){return client['Request'](_0x0a37('0x2'),{'body':_0x4eb9a8,'log':_0x0a37('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index dd870ab..0d18c02 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x48cb6f,_0x19cc66){var _0x345001=function(_0x4d0647){while(--_0x4d0647){_0x48cb6f['push'](_0x48cb6f['shift']());}};_0x345001(++_0x19cc66);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xcb91[_0x29bf80];return _0x932096;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x230575,_0x399b7f){var _0x4c0131=function(_0x2979f7){while(--_0x2979f7){_0x230575['push'](_0x230575['shift']());}};_0x4c0131(++_0x399b7f);}(_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')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index bf0f350..ea4f5b0 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4e9988,_0x3d271b){var _0x50d1c7=function(_0x225926){while(--_0x225926){_0x4e9988['push'](_0x4e9988['shift']());}};_0x50d1c7(++_0x3d271b);}(_0x70e0,0x17b));var _0x070e=function(_0x4a5261,_0x4aa41c){_0x4a5261=_0x4a5261-0x0;var _0x13b4fb=_0x70e0[_0x4a5261];return _0x13b4fb;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x390c73,_0x44cc5b){var _0x3a144e=function(_0x559df4){while(--_0x559df4){_0x390c73['push'](_0x390c73['shift']());}};_0x3a144e(++_0x44cc5b);}(_0x3e74,0x175));var _0x43e7=function(_0x2abb7b,_0x1e7144){_0x2abb7b=_0x2abb7b-0x0;var _0xcb485d=_0x3e74[_0x2abb7b];return _0xcb485d;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 06b943d..0867d0f 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(_0xbf512f,_0x4e3c60){var _0x5d2ca4=function(_0x12c1fe){while(--_0x12c1fe){_0xbf512f['push'](_0xbf512f['shift']());}};_0x5d2ca4(++_0x4e3c60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x8d2bb2,_0x12f770){var _0x33473a=function(_0x4446b1){while(--_0x4446b1){_0x8d2bb2['push'](_0x8d2bb2['shift']());}};_0x33473a(++_0x12f770);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 8cefa6e..a88844c 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 _0xb96d=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5ed239,_0x313678){var _0x5e496c=function(_0xd4d831){while(--_0xd4d831){_0x5ed239['push'](_0x5ed239['shift']());}};_0x5e496c(++_0x313678);}(_0xb96d,0x9e));var _0xdb96=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xb96d[_0x55e08b];return _0xd1a7ff;};'use strict';var client=require('../client');exports[_0xdb96('0x0')]=function(_0x1f7a32,_0x36f0ce){return client['Request'](_0xdb96('0x1'),{'body':_0x36f0ce,'options':{'where':{'id':_0x1f7a32}},'log':_0xdb96('0x2')});};exports[_0xdb96('0x3')]=function(_0x488b02,_0x4af3cf){return client[_0xdb96('0x4')](_0xdb96('0x5'),{'body':_0x4af3cf,'options':{'where':{'id':_0x488b02}},'log':_0xdb96('0x6')});}; \ No newline at end of file +var _0x1a38=['addTagsToWhatsappInteraction','../client','update','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction'];(function(_0x58f647,_0x2d72e5){var _0x96606c=function(_0x33b72e){while(--_0x33b72e){_0x58f647['push'](_0x58f647['shift']());}};_0x96606c(++_0x2d72e5);}(_0x1a38,0xb0));var _0x81a3=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x1a38[_0x54b283];return _0x2462b3;};'use strict';var client=require(_0x81a3('0x0'));exports[_0x81a3('0x1')]=function(_0xfb6477,_0x5eb8e9){return client['Request']('UpdateWhatsappInteraction',{'body':_0x5eb8e9,'options':{'where':{'id':_0xfb6477}},'log':_0x81a3('0x2')});};exports[_0x81a3('0x3')]=function(_0x2faf46,_0x28fd86){return client[_0x81a3('0x4')](_0x81a3('0x5'),{'body':_0x28fd86,'options':{'where':{'id':_0x2faf46}},'log':_0x81a3('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index beb26cb..dc4ed12 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 _0xa397=['Request','CreateWhatsappMessage'];(function(_0x553b97,_0x23cb77){var _0x43d13b=function(_0x48644f){while(--_0x48644f){_0x553b97['push'](_0x553b97['shift']());}};_0x43d13b(++_0x23cb77);}(_0xa397,0x82));var _0x7a39=function(_0x2543a1,_0x35d120){_0x2543a1=_0x2543a1-0x0;var _0x37331b=_0xa397[_0x2543a1];return _0x37331b;};'use strict';var client=require('../client');exports['create']=function(_0x3ea651){return client[_0x7a39('0x0')](_0x7a39('0x1'),{'body':_0x3ea651,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x6106=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6106,0xf4));var _0x6610=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x6106[_0x411017];return _0x2adeea;};'use strict';var client=require(_0x6610('0x0'));exports[_0x6610('0x1')]=function(_0x133291){return client[_0x6610('0x2')](_0x6610('0x3'),{'body':_0x133291,'log':_0x6610('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b350706..25c3965 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 _0x285f=['timeout','strategy','User','Agents','online','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x285f,0xb9));var _0xf285=function(_0x2846a8,_0x172c3a){_0x2846a8=_0x2846a8-0x0;var _0xa7e99a=_0x285f[_0x2846a8];return _0xa7e99a;};'use strict';var client=require(_0xf285('0x0'));exports[_0xf285('0x1')]=function(){return function(){return client[_0xf285('0x2')](_0xf285('0x3'),{'options':{'raw':![],'attributes':['id',_0xf285('0x4'),_0xf285('0x5'),_0xf285('0x6')],'include':[{'model':_0xf285('0x7'),'as':_0xf285('0x8'),'attributes':['id','name',_0xf285('0x9'),'whatsappPause']}]},'log':_0xf285('0x1')});};}; \ No newline at end of file +var _0x0d71=['User','getWhatsappQueues','../client','GetWhatsappQueue','name','strategy'];(function(_0x46de88,_0x4b3dd9){var _0x511746=function(_0xa4e267){while(--_0xa4e267){_0x46de88['push'](_0x46de88['shift']());}};_0x511746(++_0x4b3dd9);}(_0x0d71,0x1f4));var _0x10d7=function(_0x3c8cae,_0x3931de){_0x3c8cae=_0x3c8cae-0x0;var _0x37ab4e=_0x0d71[_0x3c8cae];return _0x37ab4e;};'use strict';var client=require(_0x10d7('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x10d7('0x1'),{'options':{'raw':![],'attributes':['id',_0x10d7('0x2'),'timeout',_0x10d7('0x3')],'include':[{'model':_0x10d7('0x4'),'as':'Agents','attributes':['id',_0x10d7('0x2'),'online','whatsappPause']}]},'log':_0x10d7('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index d7d252b..3fc2f55 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 _0x613d=['UpdateWhatsappQueueReport','../client','create','Request','update','DESC'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x613d,0x1a5));var _0xd613=function(_0x5d27c3,_0x5ac158){_0x5d27c3=_0x5d27c3-0x0;var _0xed73f8=_0x613d[_0x5d27c3];return _0xed73f8;};'use strict';var client=require(_0xd613('0x0'));exports[_0xd613('0x1')]=function(_0x4cc95f){return client[_0xd613('0x2')]('CreateWhatsappQueueReport',{'body':_0x4cc95f,'log':'CreateWhatsappQueueReport'});};exports[_0xd613('0x3')]=function(_0x3ca15c,_0x686358){return client[_0xd613('0x2')]('UpdateWhatsappQueueReport',{'body':_0x686358,'options':{'where':{'uniqueid':_0x3ca15c},'order':[['id',_0xd613('0x4')]],'limit':0x1},'log':_0xd613('0x5')});}; \ No newline at end of file +var _0x8451=['UpdateWhatsappQueueReport','DESC','../client','CreateWhatsappQueueReport','update','Request'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x8451,0x176));var _0x1845=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x8451[_0x36ed48];return _0x51c63a;};'use strict';var client=require(_0x1845('0x0'));exports['create']=function(_0x86c1b8){return client['Request'](_0x1845('0x1'),{'body':_0x86c1b8,'log':_0x1845('0x1')});};exports[_0x1845('0x2')]=function(_0x22d3db,_0x502d4d){return client[_0x1845('0x3')](_0x1845('0x4'),{'body':_0x502d4d,'options':{'where':{'uniqueid':_0x22d3db},'order':[['id',_0x1845('0x5')]],'limit':0x1},'log':_0x1845('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 5899807..b8c5a1a 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 _0x8522=['../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','message','find','agents','timeout','createQueue','atimeout','channel','end','close','rules','stop','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','util','seq-queue'];(function(_0x237202,_0x51ea1e){var _0x539765=function(_0x2c47d5){while(--_0x2c47d5){_0x237202['push'](_0x237202['shift']());}};_0x539765(++_0x51ea1e);}(_0x8522,0x9d));var _0x2852=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x8522[_0x316904];return _0xfa9a21;};'use strict';var schema=require(_0x2852('0x0'));var _=require('lodash');var util=require(_0x2852('0x1'));var seqqueue=require(_0x2852('0x2'));var logger=require(_0x2852('0x3'))('routing');var strategy=require(_0x2852('0x4'));var queue=schema({'name':{'type':_0x2852('0x5'),'required':!![],'message':_0x2852('0x6')},'timeout':{'type':_0x2852('0x7'),'message':_0x2852('0x8')}});function writeLog(_0x164a8d,_0x4f3714,_0x2d47fd){return logger[_0x2852('0x9')](util[_0x2852('0xa')](_0x2852('0xb'),_0x164a8d,_0x4f3714['name'],_0x2d47fd));}function handleFindAgent(_0x48a683){return function(_0x2c1797){return _0x2c1797[_0x2852('0xc')][_0x2852('0xd')]()===_0x48a683['toLowerCase']();};}exports['consequence']=function(_0x54511b,_0x1fee05,_0x392067,_0x50c86d){return function(_0x31dbb3){try{var _0x1e0d1c={'name':_0x1fee05[0x0],'timeout':_0x1fee05[0x1]};var _0x17516f=queue[_0x2852('0x0')](_0x1e0d1c,{'typecast':!![]});if(_0x17516f[_0x2852('0xe')]){logger[_0x2852('0xf')]('[%s][AGENT]\x20%s',_0x54511b,_['map'](_0x17516f,_0x2852('0x10'))['join'](',\x20'));_0x31dbb3['stop']();}else{var _0xb09f98=_[_0x2852('0x11')](_0x392067[_0x2852('0x12')],handleFindAgent(_0x1e0d1c[_0x2852('0xc')]));if(_0xb09f98){var _0x1a5d4a=(_0x1e0d1c[_0x2852('0x13')]||0xa)*0x3e8;var _0x19716a,_0x2430a5;var _0x2a36bf=seqqueue[_0x2852('0x14')](_0x1a5d4a);_0x2a36bf['id']=_0x54511b;_0x2a36bf[_0x2852('0x15')]=_0x1a5d4a;_0x2a36bf[_0x2852('0x16')]=_0x50c86d[_0x2852('0x16')];writeLog(_0x54511b,_0xb09f98,util[_0x2852('0xa')]('START:%s',_0x1a5d4a));_0x392067['rules'][_0x54511b]['on'](_0x2852('0x17'),function(){logger[_0x2852('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x54511b);clearTimeout(_0x2430a5);_0x2430a5=undefined;_0x2a36bf[_0x2852('0x18')]();if(_0x392067[_0x2852('0x19')][_0x54511b]){delete _0x392067[_0x2852('0x19')][_0x54511b];}_0x31dbb3[_0x2852('0x1a')]();});_0x392067[_0x2852('0x19')][_0x54511b]['on']('complete',function(){if(_0x392067[_0x2852('0x19')][_0x54511b]){delete _0x392067[_0x2852('0x19')][_0x54511b];}});_0x2430a5=setTimeout(function(){logger[_0x2852('0x9')](_0x2852('0x1b'),_0x54511b);clearTimeout(_0x2430a5);_0x2a36bf[_0x2852('0x18')]();_0x31dbb3['next']();},_0x1a5d4a);strategy[_0x2852('0x1c')](_0x2a36bf,_0xb09f98,_0x392067,_0x50c86d);}else{logger[_0x2852('0xf')](_0x2852('0x1d'),_0x54511b,_0x1e0d1c[_0x2852('0xc')]);_0x31dbb3['stop']();}}}catch(_0xb47caf){console[_0x2852('0x1e')](_0xb47caf);logger['error']('[%s][QUEUE]\x20%s',_0x54511b,_0xb47caf[_0x2852('0x1f')]);_0x31dbb3['stop']();}};}; \ No newline at end of file +var _0xbb55=['error','[%s][AGENT]\x20%s','map','message','join','stop','timeout','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence'];(function(_0x34dee,_0x308a9e){var _0x2dbda2=function(_0x15b6bc){while(--_0x15b6bc){_0x34dee['push'](_0x34dee['shift']());}};_0x2dbda2(++_0x308a9e);}(_0xbb55,0xc5));var _0x5bb5=function(_0x1c9bc2,_0x2f1aa6){_0x1c9bc2=_0x1c9bc2-0x0;var _0x26665a=_0xbb55[_0x1c9bc2];return _0x26665a;};'use strict';var schema=require(_0x5bb5('0x0'));var _=require(_0x5bb5('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x5bb5('0x2'))(_0x5bb5('0x3'));var strategy=require(_0x5bb5('0x4'));var queue=schema({'name':{'type':_0x5bb5('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x5bb5('0x6'),'message':_0x5bb5('0x7')}});function writeLog(_0x5bdd65,_0x144177,_0x56ab27){return logger[_0x5bb5('0x8')](util[_0x5bb5('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5bdd65,_0x144177[_0x5bb5('0xa')],_0x56ab27));}function handleFindAgent(_0x5595b4){return function(_0x5e3174){return _0x5e3174[_0x5bb5('0xa')][_0x5bb5('0xb')]()===_0x5595b4['toLowerCase']();};}exports[_0x5bb5('0xc')]=function(_0x4942dd,_0x2c7faa,_0x205022,_0x37a1b6){return function(_0x1b74ee){try{var _0x26bf30={'name':_0x2c7faa[0x0],'timeout':_0x2c7faa[0x1]};var _0x27f743=queue[_0x5bb5('0x0')](_0x26bf30,{'typecast':!![]});if(_0x27f743['length']){logger[_0x5bb5('0xd')](_0x5bb5('0xe'),_0x4942dd,_[_0x5bb5('0xf')](_0x27f743,_0x5bb5('0x10'))[_0x5bb5('0x11')](',\x20'));_0x1b74ee[_0x5bb5('0x12')]();}else{var _0x17a1f3=_['find'](_0x205022['agents'],handleFindAgent(_0x26bf30['name']));if(_0x17a1f3){var _0x388bb5=(_0x26bf30[_0x5bb5('0x13')]||0xa)*0x3e8;var _0x1b55b0,_0x189539;var _0x531f49=seqqueue[_0x5bb5('0x14')](_0x388bb5);_0x531f49['id']=_0x4942dd;_0x531f49[_0x5bb5('0x15')]=_0x388bb5;_0x531f49[_0x5bb5('0x16')]=_0x37a1b6[_0x5bb5('0x16')];writeLog(_0x4942dd,_0x17a1f3,util[_0x5bb5('0x9')](_0x5bb5('0x17'),_0x388bb5));_0x205022['rules'][_0x4942dd]['on'](_0x5bb5('0x18'),function(){logger[_0x5bb5('0x8')](_0x5bb5('0x19'),_0x4942dd);clearTimeout(_0x189539);_0x189539=undefined;_0x531f49['close']();if(_0x205022['rules'][_0x4942dd]){delete _0x205022[_0x5bb5('0x1a')][_0x4942dd];}_0x1b74ee['stop']();});_0x205022[_0x5bb5('0x1a')][_0x4942dd]['on'](_0x5bb5('0x1b'),function(){if(_0x205022[_0x5bb5('0x1a')][_0x4942dd]){delete _0x205022['rules'][_0x4942dd];}});_0x189539=setTimeout(function(){logger['info'](_0x5bb5('0x1c'),_0x4942dd);clearTimeout(_0x189539);_0x531f49['close']();_0x1b74ee[_0x5bb5('0x1d')]();},_0x388bb5);strategy[_0x5bb5('0x1e')](_0x531f49,_0x17a1f3,_0x205022,_0x37a1b6);}else{logger[_0x5bb5('0xd')](_0x5bb5('0x1f'),_0x4942dd,_0x26bf30[_0x5bb5('0xa')]);_0x1b74ee[_0x5bb5('0x12')]();}}}catch(_0x18f7ef){console[_0x5bb5('0x20')](_0x18f7ef);logger['error'](_0x5bb5('0x21'),_0x4942dd,_0x18f7ef[_0x5bb5('0x22')]);_0x1b74ee[_0x5bb5('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 762db10..4bb96b4 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 _0x07fd=['next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','interaction','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','create','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','body','postText','amazonlex','Message','then','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x4dfe63,_0xa98c61){var _0x289e00=function(_0x40d28d){while(--_0x40d28d){_0x4dfe63['push'](_0x4dfe63['shift']());}};_0x289e00(++_0xa98c61);}(_0x07fd,0x1b5));var _0xd07f=function(_0x27f206,_0x12a6c0){_0x27f206=_0x27f206-0x0;var _0x2c70c5=_0x07fd[_0x27f206];return _0x2c70c5;};'use strict';var _=require(_0xd07f('0x0'));var moment=require(_0xd07f('0x1'));var AWS=require(_0xd07f('0x2'));var utils=require('./utils');var logger=require(_0xd07f('0x3'))('routing');var rpc={'chatMessage':require(_0xd07f('0x4')),'openchannelMessage':require(_0xd07f('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd07f('0x6'))};exports[_0xd07f('0x7')]=function(_0x225aee,_0x4f9c63){return function(_0x4f9254){try{if(!_[_0xd07f('0x8')](this['interaction'][_0xd07f('0x9')])){logger[_0xd07f('0xa')](_0xd07f('0xb'),_0x225aee,_0xd07f('0xc'));return _0x4f9254[_0xd07f('0xd')]();}var _0x433eeb={'ContactId':this[_0xd07f('0xe')]['id'],'sentAt':moment()[_0xd07f('0xf')](_0xd07f('0x10')),'direction':'out'};if(this[_0xd07f('0x11')]==='sms'||this['channel']==='whatsapp'){_0x433eeb['phone']=this[_0xd07f('0x12')][_0xd07f('0x13')];}var _0x798a08=this[_0xd07f('0x11')];if(_0x798a08===_0xd07f('0x14')){_0x433eeb[_0xd07f('0x15')]=this[_0xd07f('0x16')]['id'];}else{_0x433eeb[_['upperFirst'](_0x798a08)+_0xd07f('0x17')]=this[_0xd07f('0x16')]['id'];}_0x433eeb[_[_0xd07f('0x18')](_0x798a08)+_0xd07f('0x19')]=this[_0xd07f('0x12')]['id'];if(this[_0xd07f('0x12')][_0xd07f('0x1a')]){var _0x51b33f=_0x4f9c63[0x4];if(!_[_0xd07f('0x1b')](_0x51b33f)){_0x433eeb['body']=utils[_0xd07f('0x1c')](_0x51b33f,this);return rpc[_0x798a08+'Message'][_0xd07f('0x1d')](_0x433eeb)['then'](function(_0x49be04){logger[_0xd07f('0xa')](_0xd07f('0xb'),_0x225aee,_0x433eeb['body']);})['catch'](function(_0x128a9a){logger[_0xd07f('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x225aee,JSON[_0xd07f('0x1f')](_0x128a9a));})[_0xd07f('0x20')](function(){logger[_0xd07f('0xa')](_0xd07f('0x21'),_0x225aee);_0x4f9254[_0xd07f('0x22')]();});}else{logger[_0xd07f('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x225aee);_0x4f9254[_0xd07f('0x22')]();}}else{var _0x2da255=this;var _0x3aeafe=new AWS[(_0xd07f('0x23'))]({'accessKeyId':_0x4f9c63[0x0],'secretAccessKey':_0x4f9c63[0x1],'region':_0x4f9c63[0x2]});var _0x28646e={'botAlias':_0xd07f('0x24'),'botName':_0x4f9c63[0x3],'inputText':this[_0xd07f('0x25')][_0xd07f('0x26')],'userId':this['channel']+':'+this[_0xd07f('0x12')]['id']['toString']()};_0x3aeafe[_0xd07f('0x27')](_0x28646e,function(_0x5d5bfa,_0x464f1a){if(_0x5d5bfa){logger[_0xd07f('0x1e')](_0xd07f('0xb'),_0x225aee,_0x5d5bfa[_0xd07f('0x25')]);_0x4f9254[_0xd07f('0xd')]();}else if(_0x464f1a&&_0x464f1a[_0xd07f('0x25')]){_0x2da255[_0xd07f('0x26')]['amazonlex']=_0x464f1a;_0x433eeb[_0xd07f('0x26')]=_0x464f1a[_0xd07f('0x25')];_0x433eeb['providerName']=_0xd07f('0x28');_0x433eeb['providerResponse']=JSON['stringify'](_0x464f1a);return rpc[_0x798a08+_0xd07f('0x29')][_0xd07f('0x1d')](_0x433eeb)[_0xd07f('0x2a')](function(_0x4e61a0){logger['info'](_0xd07f('0xb'),_0x225aee,_0x433eeb[_0xd07f('0x26')]);if(_0x464f1a[_0xd07f('0x2b')]==_0xd07f('0x2c')){_0x4f9254[_0xd07f('0xd')]();}else{_0x4f9254[_0xd07f('0x22')]();}})['catch'](function(_0x3fcf84){logger[_0xd07f('0x1e')](_0xd07f('0xb'),_0x225aee,JSON[_0xd07f('0x1f')](_0x3fcf84));_0x4f9254['next']();});}else{_0x4f9254['next']();}});}}catch(_0x4535b7){logger['error'](_0xd07f('0xb'),_0x225aee,JSON['stringify'](_0x4535b7));_0x4f9254[_0xd07f('0x22')]();}};}; \ No newline at end of file +var _0x78b3=['format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','message','postText','amazonlex','providerResponse','dialogState','Failed','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x13d36c,_0x5e31df){var _0x82cd1a=function(_0x3f70e7){while(--_0x3f70e7){_0x13d36c['push'](_0x13d36c['shift']());}};_0x82cd1a(++_0x5e31df);}(_0x78b3,0xaa));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x378b('0x0'));var moment=require(_0x378b('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x378b('0x2'))(_0x378b('0x3'));var rpc={'chatMessage':require(_0x378b('0x4')),'openchannelMessage':require(_0x378b('0x5')),'mailMessage':require(_0x378b('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x378b('0x7'))};exports[_0x378b('0x8')]=function(_0x4c21d6,_0x36c320){return function(_0x52fa16){try{if(!_[_0x378b('0x9')](this[_0x378b('0xa')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x4c21d6,_0x378b('0xb'));return _0x52fa16[_0x378b('0xc')]();}var _0x346a09={'ContactId':this[_0x378b('0xd')]['id'],'sentAt':moment()[_0x378b('0xe')](_0x378b('0xf')),'direction':'out'};if(this[_0x378b('0x10')]==='sms'||this[_0x378b('0x10')]===_0x378b('0x11')){_0x346a09[_0x378b('0x12')]=this[_0x378b('0xa')][_0x378b('0x12')];}var _0x3a24a0=this[_0x378b('0x10')];if(_0x3a24a0===_0x378b('0x13')){_0x346a09[_0x378b('0x14')]=this['account']['id'];}else{_0x346a09[_[_0x378b('0x15')](_0x3a24a0)+'AccountId']=this[_0x378b('0x16')]['id'];}_0x346a09[_[_0x378b('0x15')](_0x3a24a0)+_0x378b('0x17')]=this[_0x378b('0xa')]['id'];if(this[_0x378b('0xa')][_0x378b('0x18')]){var _0x17c6a8=_0x36c320[0x4];if(!_['isEmpty'](_0x17c6a8)){_0x346a09[_0x378b('0x19')]=utils[_0x378b('0x1a')](_0x17c6a8,this);return rpc[_0x3a24a0+_0x378b('0x1b')][_0x378b('0x1c')](_0x346a09)[_0x378b('0x1d')](function(_0x498d82){logger['info'](_0x378b('0x1e'),_0x4c21d6,_0x346a09[_0x378b('0x19')]);})[_0x378b('0x1f')](function(_0x1da5d4){logger[_0x378b('0x20')](_0x378b('0x1e'),_0x4c21d6,JSON[_0x378b('0x21')](_0x1da5d4));})[_0x378b('0x22')](function(){logger[_0x378b('0x23')](_0x378b('0x24'),_0x4c21d6);_0x52fa16['stop']();});}else{logger[_0x378b('0x23')](_0x378b('0x25'),_0x4c21d6);_0x52fa16[_0x378b('0x26')]();}}else{var _0x5b1dd3=this;var _0x52f4a5=new AWS['LexRuntime']({'accessKeyId':_0x36c320[0x0],'secretAccessKey':_0x36c320[0x1],'region':_0x36c320[0x2]});var _0x27f4ae={'botAlias':_0x378b('0x27'),'botName':_0x36c320[0x3],'inputText':this[_0x378b('0x28')][_0x378b('0x19')],'userId':this[_0x378b('0x10')]+':'+this['interaction']['id']['toString']()};_0x52f4a5[_0x378b('0x29')](_0x27f4ae,function(_0x34ab2d,_0x3cd94b){if(_0x34ab2d){logger[_0x378b('0x20')](_0x378b('0x1e'),_0x4c21d6,_0x34ab2d[_0x378b('0x28')]);_0x52fa16[_0x378b('0xc')]();}else if(_0x3cd94b&&_0x3cd94b[_0x378b('0x28')]){_0x5b1dd3[_0x378b('0x19')][_0x378b('0x2a')]=_0x3cd94b;_0x346a09[_0x378b('0x19')]=_0x3cd94b[_0x378b('0x28')];_0x346a09['providerName']=_0x378b('0x2a');_0x346a09[_0x378b('0x2b')]=JSON[_0x378b('0x21')](_0x3cd94b);return rpc[_0x3a24a0+_0x378b('0x1b')]['create'](_0x346a09)[_0x378b('0x1d')](function(_0x2c6403){logger[_0x378b('0x23')](_0x378b('0x1e'),_0x4c21d6,_0x346a09[_0x378b('0x19')]);if(_0x3cd94b[_0x378b('0x2c')]==_0x378b('0x2d')){_0x52fa16['next']();}else{_0x52fa16[_0x378b('0x26')]();}})[_0x378b('0x1f')](function(_0x2b5d8d){logger[_0x378b('0x20')]('[%s][AMAZONLEX]\x20%s',_0x4c21d6,JSON['stringify'](_0x2b5d8d));_0x52fa16['next']();});}else{_0x52fa16['next']();}});}}catch(_0x1998c0){logger[_0x378b('0x20')](_0x378b('0x1e'),_0x4c21d6,JSON['stringify'](_0x1998c0));_0x52fa16['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index bce3b63..c720fce 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 _0xdc3a=['isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','replace','';_0x477f5f[_0xadc3('0x35')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xadc3('0x36'),'Precedence':_0xadc3('0x37')};return mailRpc[_0xadc3('0x38')](this[_0xadc3('0x2a')]['smtpOptions'],_0x477f5f)[_0xadc3('0x39')](function(_0x11db15){logger[_0xadc3('0x12')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f505f);_0x477f5f[_0xadc3('0x3a')]=_0x11db15[_0xadc3('0x22')][_0xadc3('0x3a')];return rpc[_0x1db12f+'Message'][_0xadc3('0x3b')](_0x477f5f);})['then'](function(_0x504623){logger[_0xadc3('0x12')](_0xadc3('0x13'),_0x3f505f,JSON[_0xadc3('0x3c')](_0x504623));})['catch'](function(_0x17dec1){logger[_0xadc3('0x3d')](_0xadc3('0x3e'),_0x3f505f,JSON[_0xadc3('0x3c')](_0x17dec1));})[_0xadc3('0x3f')](function(){Promise[_0xadc3('0x40')]()[_0xadc3('0x39')](function(){if(_0x27b5ae[0x0]!=='2'||_0x294a31[_0xadc3('0x19')])return;return rpc[_0x1db12f+_0xadc3('0x41')][_0xadc3('0x42')](_0x294a31['id'],{'autoreplyExecuted':!![]})[_0xadc3('0x39')](function(_0xc57cf0){logger[_0xadc3('0x12')](_0xadc3('0x1a'),_0x3f505f,JSON[_0xadc3('0x3c')](_0xc57cf0));})[_0xadc3('0x43')](function(_0x48ab16){logger[_0xadc3('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3f505f,JSON[_0xadc3('0x3c')](_0x48ab16));});})['then'](function(){_0x36b196[_0xadc3('0x1b')]();});});}else{return rpc[this[_0xadc3('0x20')]+_0xadc3('0x2e')][_0xadc3('0x3b')](_0x477f5f)[_0xadc3('0x39')](function(){logger[_0xadc3('0x12')]('[%s][AUTOREPLY]\x20%s',_0x3f505f,_0x477f5f[_0xadc3('0x10')]);})[_0xadc3('0x43')](function(_0xb1ff37){logger[_0xadc3('0x3d')](_0xadc3('0x13'),_0x3f505f,JSON['stringify'](_0xb1ff37));})[_0xadc3('0x3f')](function(){Promise[_0xadc3('0x40')]()[_0xadc3('0x39')](function(){if(_0x27b5ae[0x0]!=='2'||_0x294a31[_0xadc3('0x19')])return;return rpc[_0x1db12f+_0xadc3('0x41')][_0xadc3('0x42')](_0x294a31['id'],{'autoreplyExecuted':!![]})[_0xadc3('0x39')](function(_0x4056c1){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3f505f,JSON[_0xadc3('0x3c')](_0x4056c1));})[_0xadc3('0x43')](function(_0x235487){logger[_0xadc3('0x3d')](_0xadc3('0x44'),_0x3f505f,JSON[_0xadc3('0x3c')](_0x235487));});})['then'](function(){_0x36b196[_0xadc3('0x1b')]();});});}}}catch(_0x2a79bd){logger[_0xadc3('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x3f505f,JSON[_0xadc3('0x3c')](_0x2a79bd));_0x36b196[_0xadc3('0x45')]();}};}; \ No newline at end of file +var _0x1b8f=['message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','channel','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender'];(function(_0x19f00f,_0x181deb){var _0x332a97=function(_0x21d60e){while(--_0x21d60e){_0x19f00f['push'](_0x19f00f['shift']());}};_0x332a97(++_0x181deb);}(_0x1b8f,0x6a));var _0xf1b8=function(_0x58669b,_0x4ffab0){_0x58669b=_0x58669b-0x0;var _0x19cc41=_0x1b8f[_0x58669b];return _0x19cc41;};'use strict';var _=require(_0xf1b8('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0xf1b8('0x1'))(_0xf1b8('0x2'));var rpc={'chatMessage':require(_0xf1b8('0x3')),'openchannelMessage':require(_0xf1b8('0x4')),'mailMessage':require(_0xf1b8('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf1b8('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf1b8('0x7')),'mailInteraction':require(_0xf1b8('0x8')),'smsInteraction':require(_0xf1b8('0x9')),'faxInteraction':require(_0xf1b8('0xa')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xf1b8('0xb'));exports['consequence']=function(_0x39e583,_0x1ea7f5,_0x1bc2da,_0x503191){return function(_0x3007ff){try{var _0x148727=this[_0xf1b8('0xc')];if(_0x148727===_0xf1b8('0xd')&&_0x503191[_0xf1b8('0xe')]['isAutoreply']){logger[_0xf1b8('0xf')](_0xf1b8('0x10'),_0x39e583,_0xf1b8('0x11'));return _0x3007ff[_0xf1b8('0x12')]();}if(_0x1ea7f5[0x0]==='1'&&(_['isNil'](this[_0xf1b8('0x13')]['created'])||!this[_0xf1b8('0x13')][_0xf1b8('0x14')])){logger[_0xf1b8('0xf')](_0xf1b8('0x10'),_0x39e583,_0xf1b8('0x15'));return _0x3007ff[_0xf1b8('0x12')]();}if(_0x1ea7f5[0x0]==='2'&&this['interaction'][_0xf1b8('0x16')]){logger['info'](_0xf1b8('0x17'),_0x39e583,'One\x20Time\x20already\x20sent');return _0x3007ff[_0xf1b8('0x12')]();}var _0x1334ca={'ContactId':this[_0xf1b8('0x18')]['id'],'sentAt':moment()['format'](_0xf1b8('0x19')),'direction':_0xf1b8('0x1a')};if(this['channel']==='mail'){_0x1334ca[_0xf1b8('0xe')]=utils[_0xf1b8('0x1b')](_0x1ea7f5[0x2],this);}else{_0x1334ca[_0xf1b8('0xe')]=utils['getMustacheRender'](_0x1ea7f5[0x1],this);}if(this[_0xf1b8('0x1c')]){_0x1334ca['to']=this['message'][_0xf1b8('0x1d')]||'';if(this[_0xf1b8('0xc')]===_0xf1b8('0xd')&&_0x1ea7f5[0x1]==='1'){_0x1334ca['cc']=this[_0xf1b8('0x1c')]['cc']||'';}_0x1334ca[_0xf1b8('0x1d')]=this[_0xf1b8('0x1c')]['to']||'';_0x1334ca[_0xf1b8('0x1e')]=this[_0xf1b8('0x1c')][_0xf1b8('0x1e')]||'';_0x1334ca[_0xf1b8('0x1f')]=!![];if(this[_0xf1b8('0x1c')]['subject']){_0x1334ca['subject']='';_0x1334ca[_0xf1b8('0x20')]+=_[_0xf1b8('0x21')](this[_0xf1b8('0x1c')][_0xf1b8('0x20')],_0xf1b8('0x22'))?'':_0xf1b8('0x23');_0x1334ca[_0xf1b8('0x20')]+=this['message'][_0xf1b8('0x20')];}}if(this[_0xf1b8('0xc')]===_0xf1b8('0x24')){_0x1334ca['ChatWebsiteId']=this['account']['id'];}else{_0x1334ca[_[_0xf1b8('0x25')](this['channel'])+_0xf1b8('0x26')]=this['account']['id'];}_0x1334ca[_[_0xf1b8('0x25')](this['channel'])+_0xf1b8('0x27')]=this[_0xf1b8('0x13')]['id'];var _0x57495d=this['interaction'];if(rpc[this['channel']+_0xf1b8('0x28')]){if(this['channel']===_0xf1b8('0xd')){_0x1334ca[_0xf1b8('0x29')]=this[_0xf1b8('0x1c')][_0xf1b8('0x2a')];_0x1334ca[_0xf1b8('0x2b')]=_0xf1b8('0x2c')+_[_0xf1b8('0x2d')](_0x1334ca[_0xf1b8('0xe')],']+(>|$)/g,''),'priorityTrue':_0x404c69[0x1],'priorityFalse':_0x404c69[0x2]};var _0x2713a3=gotoif[_0x7def('0x0')](_0x13ab5d,{'typecast':!![]});if(_0x2713a3['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x19241e,_[_0x7def('0xb')](_0x2713a3,_0x7def('0xc'))[_0x7def('0xd')](',\x20'));_0x12fee8['stop']();}else{try{var _0x2b1c7f=eval('('+_0x13ab5d[_0x7def('0xe')]+')');var _0x318d72=_0x2b1c7f?_0x13ab5d[_0x7def('0xf')]:_0x13ab5d[_0x7def('0x10')];logger['info'](_0x7def('0x11'),_0x19241e,_0x13ab5d[_0x7def('0xe')],_0x2b1c7f,_0x318d72||_0x7def('0x12'));if(_0x318d72){var _0x5a7e3a=_[_0x7def('0x13')](_0x12fee8[_0x7def('0x14')](),{'p':_0x318d72});if(_0x5a7e3a>=0x0){logger[_0x7def('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x19241e,_0x318d72||'next',_0x5a7e3a);_0x12fee8[_0x7def('0x12')](_0x5a7e3a);}else{logger['info'](_0x7def('0x16'),_0x19241e,_0x318d72||'next');_0x12fee8['stop']();}}else{_0x12fee8[_0x7def('0x12')]();}}catch(_0x345f9d){logger[_0x7def('0x17')](_0x7def('0x18'),_0x19241e,_0x345f9d[_0x7def('0xc')]);_0x12fee8[_0x7def('0x19')]();}}}catch(_0xc232db){logger[_0x7def('0x17')]('[%s][GOTOIF]\x20%s',_0x19241e,JSON['stringify'](_0xc232db));_0x12fee8['stop']();}};}; \ No newline at end of file +var _0xf26b=['condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','message','join','stop'];(function(_0x254f44,_0x1b76d1){var _0x384563=function(_0x7dee25){while(--_0x7dee25){_0x254f44['push'](_0x254f44['shift']());}};_0x384563(++_0x1b76d1);}(_0xf26b,0x167));var _0xbf26=function(_0x4ca3f1,_0x4af7c1){_0x4ca3f1=_0x4ca3f1-0x0;var _0x1350b7=_0xf26b[_0x4ca3f1];return _0x1350b7;};'use strict';var schema=require(_0xbf26('0x0'));var _=require(_0xbf26('0x1'));var htmlToText=require(_0xbf26('0x2'));var utils=require(_0xbf26('0x3'));var logger=require(_0xbf26('0x4'))(_0xbf26('0x5'));var gotoif=schema({'condition':{'type':_0xbf26('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xbf26('0x7'),'message':_0xbf26('0x8')},'priorityFalse':{'type':_0xbf26('0x7'),'message':_0xbf26('0x9')}});exports[_0xbf26('0xa')]=function(_0x394a39,_0x143b2e){return function(_0x23e0b0){try{var _0x7e156d={'condition':htmlToText[_0xbf26('0xb')](utils[_0xbf26('0xc')](_0x143b2e[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x143b2e[0x1],'priorityFalse':_0x143b2e[0x2]};var _0x164eda=gotoif['validate'](_0x7e156d,{'typecast':!![]});if(_0x164eda[_0xbf26('0xd')]){logger[_0xbf26('0xe')](_0xbf26('0xf'),_0x394a39,_['map'](_0x164eda,_0xbf26('0x10'))[_0xbf26('0x11')](',\x20'));_0x23e0b0[_0xbf26('0x12')]();}else{try{var _0x196d43=eval('('+_0x7e156d[_0xbf26('0x13')]+')');var _0x39489b=_0x196d43?_0x7e156d['priorityTrue']:_0x7e156d[_0xbf26('0x14')];logger[_0xbf26('0x15')](_0xbf26('0x16'),_0x394a39,_0x7e156d[_0xbf26('0x13')],_0x196d43,_0x39489b||'next');if(_0x39489b){var _0x4595f9=_[_0xbf26('0x17')](_0x23e0b0['rules'](),{'p':_0x39489b});if(_0x4595f9>=0x0){logger[_0xbf26('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x394a39,_0x39489b||_0xbf26('0x18'),_0x4595f9);_0x23e0b0[_0xbf26('0x18')](_0x4595f9);}else{logger[_0xbf26('0x15')](_0xbf26('0x19'),_0x394a39,_0x39489b||_0xbf26('0x18'));_0x23e0b0[_0xbf26('0x12')]();}}else{_0x23e0b0[_0xbf26('0x18')]();}}catch(_0x4a8184){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x394a39,_0x4a8184['message']);_0x23e0b0[_0xbf26('0x12')]();}}}catch(_0x381fe7){logger['error'](_0xbf26('0xf'),_0x394a39,JSON[_0xbf26('0x1a')](_0x381fe7));_0x23e0b0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 2c3e07d..1f9e405 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 _0x4fcf=['routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','../../../../config/logger'];(function(_0x58fc7d,_0x5a0d41){var _0xcda3f4=function(_0x28b73e){while(--_0x28b73e){_0x58fc7d['push'](_0x58fc7d['shift']());}};_0xcda3f4(++_0x5a0d41);}(_0x4fcf,0x1c0));var _0xf4fc=function(_0x5bdd3b,_0x3380c1){_0x5bdd3b=_0x5bdd3b-0x0;var _0x8b32a8=_0x4fcf[_0x5bdd3b];return _0x8b32a8;};'use strict';var schema=require(_0xf4fc('0x0'));var _=require('lodash');var logger=require(_0xf4fc('0x1'))(_0xf4fc('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xf4fc('0x3')}});exports['consequence']=function(_0x5a1f9d,_0x17d70b){return function(_0xb1cd7c){try{var _0x19aab4={'priority':_0x17d70b[0x0]};var _0xd4952c=gotop[_0xf4fc('0x0')](_0x19aab4,{'typecast':!![]});if(_0xd4952c[_0xf4fc('0x4')]){logger[_0xf4fc('0x5')](_0xf4fc('0x6'),_0x5a1f9d,_[_0xf4fc('0x7')](_0xd4952c,_0xf4fc('0x8'))[_0xf4fc('0x9')](',\x20'));_0xb1cd7c[_0xf4fc('0xa')]();}else{logger[_0xf4fc('0xb')](_0xf4fc('0xc'),_0x5a1f9d,_0x19aab4[_0xf4fc('0xd')]);if(_0x19aab4[_0xf4fc('0xd')]){var _0x210938=_['findIndex'](_0xb1cd7c[_0xf4fc('0xe')](),{'p':_0x19aab4['priority']});if(_0x210938>=0x0){logger[_0xf4fc('0xb')](_0xf4fc('0xf'),_0x5a1f9d,_0x19aab4[_0xf4fc('0xd')]||_0xf4fc('0x10'),_0x210938);_0xb1cd7c[_0xf4fc('0x10')](_0x210938);}else{logger[_0xf4fc('0xb')](_0xf4fc('0x11'),_0x5a1f9d,_0x19aab4[_0xf4fc('0xd')]||_0xf4fc('0x10'));_0xb1cd7c[_0xf4fc('0xa')]();}}else{_0xb1cd7c[_0xf4fc('0x10')]();}}}catch(_0x55c478){logger[_0xf4fc('0x5')]('[%s][GOTOP]\x20%s',_0x5a1f9d,JSON['stringify'](_0x55c478));_0xb1cd7c['stop']();}};}; \ No newline at end of file +var _0x1f2d=['validate','lodash','../../../../config/logger','routing','number','consequence','length','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify'];(function(_0x5b3aca,_0x3d0d08){var _0x3c93b1=function(_0x11a2f5){while(--_0x11a2f5){_0x5b3aca['push'](_0x5b3aca['shift']());}};_0x3c93b1(++_0x3d0d08);}(_0x1f2d,0x1b8));var _0xd1f2=function(_0x40453a,_0x1ff061){_0x40453a=_0x40453a-0x0;var _0x2da74d=_0x1f2d[_0x40453a];return _0x2da74d;};'use strict';var schema=require(_0xd1f2('0x0'));var _=require(_0xd1f2('0x1'));var logger=require(_0xd1f2('0x2'))(_0xd1f2('0x3'));var gotop=schema({'priority':{'type':_0xd1f2('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xd1f2('0x5')]=function(_0x5cba58,_0x57e6d3){return function(_0x3f89f5){try{var _0x4db196={'priority':_0x57e6d3[0x0]};var _0xf99669=gotop[_0xd1f2('0x0')](_0x4db196,{'typecast':!![]});if(_0xf99669[_0xd1f2('0x6')]){logger[_0xd1f2('0x7')]('[%s][GOTOP]\x20%s',_0x5cba58,_[_0xd1f2('0x8')](_0xf99669,_0xd1f2('0x9'))[_0xd1f2('0xa')](',\x20'));_0x3f89f5[_0xd1f2('0xb')]();}else{logger[_0xd1f2('0xc')](_0xd1f2('0xd'),_0x5cba58,_0x4db196['priority']);if(_0x4db196[_0xd1f2('0xe')]){var _0x3c9804=_['findIndex'](_0x3f89f5[_0xd1f2('0xf')](),{'p':_0x4db196[_0xd1f2('0xe')]});if(_0x3c9804>=0x0){logger[_0xd1f2('0xc')](_0xd1f2('0x10'),_0x5cba58,_0x4db196[_0xd1f2('0xe')]||_0xd1f2('0x11'),_0x3c9804);_0x3f89f5[_0xd1f2('0x11')](_0x3c9804);}else{logger[_0xd1f2('0xc')](_0xd1f2('0x12'),_0x5cba58,_0x4db196[_0xd1f2('0xe')]||_0xd1f2('0x11'));_0x3f89f5['stop']();}}else{_0x3f89f5[_0xd1f2('0x11')]();}}}catch(_0x3df746){logger['error']('[%s][GOTOP]\x20%s',_0x5cba58,JSON[_0xd1f2('0x13')](_0x3df746));_0x3f89f5[_0xd1f2('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 e503c20..3ba34b4 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 _0x31ff=['stringify','stop','[%s][MESSAGE]\x20%s','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','body','next'];(function(_0x11ed1b,_0x354ad9){var _0xa75d3=function(_0x361210){while(--_0x361210){_0x11ed1b['push'](_0x11ed1b['shift']());}};_0xa75d3(++_0x354ad9);}(_0x31ff,0xd3));var _0xf31f=function(_0x3c880f,_0x10ad41){_0x3c880f=_0x3c880f-0x0;var _0x4e7245=_0x31ff[_0x3c880f];return _0x4e7245;};'use strict';var _=require(_0xf31f('0x0'));var utils=require(_0xf31f('0x1'));var logger=require(_0xf31f('0x2'))(_0xf31f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf31f('0x4')),'smsMessage':require(_0xf31f('0x5')),'faxMessage':require(_0xf31f('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf31f('0x7')]=function(_0x45c341,_0x35b9a5){return function(_0x432c1b){try{var _0xca0680={'body':utils[_0xf31f('0x8')](_0x35b9a5[0x0],this),'ContactId':this[_0xf31f('0x9')]['id']};if(this[_0xf31f('0xa')]===_0xf31f('0xb')){_0xca0680[_0xf31f('0xc')]=this[_0xf31f('0xd')]['id'];}else{_0xca0680[_[_0xf31f('0xe')](this[_0xf31f('0xa')])+_0xf31f('0xf')]=this[_0xf31f('0xd')]['id'];}_0xca0680[_['upperFirst'](this['channel'])+_0xf31f('0x10')]=this[_0xf31f('0x11')]['id'];if(rpc[this[_0xf31f('0xa')]+_0xf31f('0x12')]){return rpc[this[_0xf31f('0xa')]+_0xf31f('0x12')]['create'](_0xca0680)[_0xf31f('0x13')](function(_0x289807){logger[_0xf31f('0x14')]('[%s][MESSAGE]\x20%s',_0x45c341,_0xca0680[_0xf31f('0x15')]);_0x432c1b[_0xf31f('0x16')]();})['catch'](function(_0x560096){logger['error']('[%s][MESSAGE]\x20%s',_0x45c341,JSON[_0xf31f('0x17')](_0x560096));_0x432c1b[_0xf31f('0x18')]();});}}catch(_0x5dd71c){logger['error'](_0xf31f('0x19'),_0x45c341,JSON['stringify'](_0x5dd71c));_0x432c1b[_0xf31f('0x18')]();}};}; \ No newline at end of file +var _0x579a=['then','info','[%s][MESSAGE]\x20%s','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create'];(function(_0x1e3e6a,_0xfef7b5){var _0x2d0f07=function(_0x10192b){while(--_0x10192b){_0x1e3e6a['push'](_0x1e3e6a['shift']());}};_0x2d0f07(++_0xfef7b5);}(_0x579a,0x9d));var _0xa579=function(_0x5c570d,_0x3fbc57){_0x5c570d=_0x5c570d-0x0;var _0x190ca1=_0x579a[_0x5c570d];return _0x190ca1;};'use strict';var _=require(_0xa579('0x0'));var utils=require(_0xa579('0x1'));var logger=require(_0xa579('0x2'))(_0xa579('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa579('0x4')),'smsMessage':require(_0xa579('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4aac9,_0x4f522b){return function(_0x354f3b){try{var _0x14a544={'body':utils[_0xa579('0x6')](_0x4f522b[0x0],this),'ContactId':this[_0xa579('0x7')]['id']};if(this[_0xa579('0x8')]===_0xa579('0x9')){_0x14a544[_0xa579('0xa')]=this[_0xa579('0xb')]['id'];}else{_0x14a544[_['upperFirst'](this[_0xa579('0x8')])+_0xa579('0xc')]=this[_0xa579('0xb')]['id'];}_0x14a544[_[_0xa579('0xd')](this['channel'])+_0xa579('0xe')]=this[_0xa579('0xf')]['id'];if(rpc[this[_0xa579('0x8')]+_0xa579('0x10')]){return rpc[this['channel']+_0xa579('0x10')][_0xa579('0x11')](_0x14a544)[_0xa579('0x12')](function(_0x414bd5){logger[_0xa579('0x13')](_0xa579('0x14'),_0x4aac9,_0x14a544['body']);_0x354f3b[_0xa579('0x15')]();})['catch'](function(_0x45bf75){logger[_0xa579('0x16')](_0xa579('0x14'),_0x4aac9,JSON[_0xa579('0x17')](_0x45bf75));_0x354f3b[_0xa579('0x18')]();});}}catch(_0x1319b2){logger[_0xa579('0x16')](_0xa579('0x14'),_0x4aac9,JSON['stringify'](_0x1319b2));_0x354f3b[_0xa579('0x18')]();}};}; \ 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 3b24177..7fd1946 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 _0x688d=['stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x688d,0xe2));var _0xd688=function(_0x55ee16,_0x1aae49){_0x55ee16=_0x55ee16-0x0;var _0x4c71c8=_0x688d[_0x55ee16];return _0x4c71c8;};'use strict';var utils=require('./utils');var logger=require(_0xd688('0x0'))(_0xd688('0x1'));exports[_0xd688('0x2')]=function(_0x1682c7,_0x158e74){return function(_0x18ef6a){try{logger[_0xd688('0x3')](_0xd688('0x4'),_0x1682c7,utils[_0xd688('0x5')](_0x158e74[0x0],this));_0x18ef6a['next']();}catch(_0x1b6733){logger[_0xd688('0x6')](_0xd688('0x4'),_0x1682c7,JSON[_0xd688('0x7')](_0x1b6733));_0x18ef6a[_0xd688('0x8')]();}};}; \ No newline at end of file +var _0x2e46=['stop','routing','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x4e78bd,_0x3e094e){var _0x2a3e81=function(_0x323ad8){while(--_0x323ad8){_0x4e78bd['push'](_0x4e78bd['shift']());}};_0x2a3e81(++_0x3e094e);}(_0x2e46,0xf7));var _0x62e4=function(_0x1e79f4,_0x2e4769){_0x1e79f4=_0x1e79f4-0x0;var _0x279302=_0x2e46[_0x1e79f4];return _0x279302;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x62e4('0x0'));exports['consequence']=function(_0x4bd432,_0x31d97e){return function(_0x2b2a6d){try{logger['info'](_0x62e4('0x1'),_0x4bd432,utils[_0x62e4('0x2')](_0x31d97e[0x0],this));_0x2b2a6d[_0x62e4('0x3')]();}catch(_0x157c6a){logger[_0x62e4('0x4')](_0x62e4('0x1'),_0x4bd432,JSON['stringify'](_0x157c6a));_0x2b2a6d[_0x62e4('0x5')]();}};}; \ 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 7e53728..6e1763d 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 _0x4e03=['rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','interaction','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','YYYY-MM-DD\x20HH:mm:ss','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','validate','length','map','join','stop','Queues','timeout','createQueue','atimeout','qtimeout'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x4e03,0x1ac));var _0x34e0=function(_0x27c98a,_0x1e8446){_0x27c98a=_0x27c98a-0x0;var _0x503570=_0x4e03[_0x27c98a];return _0x503570;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x34e0('0x0'));var seqqueue=require(_0x34e0('0x1'));var moment=require(_0x34e0('0x2'));var Redis=require(_0x34e0('0x3'));var config=require(_0x34e0('0x4'));var logger=require(_0x34e0('0x5'))(_0x34e0('0x6'));var strategy=require(_0x34e0('0x7'));config[_0x34e0('0x8')]=_[_0x34e0('0x9')](config[_0x34e0('0x8')],{'host':_0x34e0('0xa'),'port':0x18eb});var io=require(_0x34e0('0xb'))(new Redis(config[_0x34e0('0x8')]));var attributes=['id',_0x34e0('0xc'),_0x34e0('0xd'),_0x34e0('0xe'),_0x34e0('0xf'),_0x34e0('0x10')];function emit(_0xf00615,_0x1a0a9a,_0x12e168){io['to'](_0xf00615)[_0x34e0('0x11')](_0x1a0a9a,_0x12e168);}function emitChannelQueueInteraction(_0x455db1,_0x495a06,_0x457a26,_0x3a7a1a,_0xb11944,_0x7d32f8,_0x479e6b,_0x4e9350){var _0x14f121=_[_0x34e0('0x12')](_0x457a26);_0x14f121[_0x34e0('0xc')]=_0x4e9350;_0x14f121[_0x34e0('0xe')]=_0x495a06;_0x14f121[_0x34e0('0xd')]=_0x3a7a1a;_0x14f121['id']=_0xb11944;if(_0x7d32f8){attributes[_0x34e0('0x13')](_[_0x34e0('0x14')](_0x455db1)+_0x34e0('0x15'));_0x479e6b[util['format']('%sQueuesWaitingInteractions',_0x455db1)][_0xb11944]=_[_0x34e0('0x16')](_0x14f121,attributes);}else{delete _0x479e6b[util[_0x34e0('0x17')]('%sQueuesWaitingInteractions',_0x455db1)][_0xb11944];}emit(util[_0x34e0('0x17')](_0x34e0('0x18'),_0x455db1,_0x495a06),util['format'](_0x34e0('0x19'),_0x455db1,_0x7d32f8?'save':_0x34e0('0x1a')),_['pick'](_0x14f121,attributes));}var rpc={'openchannelQueueReport':require(_0x34e0('0x1b')),'mailQueueReport':require(_0x34e0('0x1c')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x34e0('0x1d')),'whatsappQueueReport':require(_0x34e0('0x1e'))};var queue=schema({'name':{'type':_0x34e0('0x1f'),'required':!![],'message':_0x34e0('0x20')},'timeout':{'type':_0x34e0('0x21'),'message':_0x34e0('0x22')}});function startRouting(_0x2f6378,_0xa2e15c,_0x5acf38,_0x41c3b8){if(_0x2f6378&&_0xa2e15c&&_0x5acf38){_0xa2e15c[_0x34e0('0x23')]+=0x1;var _0x55f4fb={'uniqueid':_0x2f6378,'from':_0x5acf38[_0x34e0('0x24')]?_0x5acf38['body'][_0x34e0('0xf')]:'','joinAt':moment()[_0x34e0('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5acf38[_0x34e0('0x25')]?_0x5acf38[_0x34e0('0x25')]['id']:null,'ListId':_0x5acf38[_0x34e0('0x26')]?_0x5acf38[_0x34e0('0x26')]['id']:null};_0x55f4fb[_[_0x34e0('0x27')](_0x5acf38['channel'])+_0x34e0('0x28')]=_0xa2e15c['id']||null;_0x55f4fb[_[_0x34e0('0x27')](_0x5acf38[_0x34e0('0x29')])+_0x34e0('0x15')]=_0x5acf38[_0x34e0('0x2a')]?_0x5acf38[_0x34e0('0x2a')]['id']:null;_0x55f4fb[_['upperFirst'](_0x5acf38['channel'])+'MessageId']=_0x5acf38[_0x34e0('0x2b')]?_0x5acf38[_0x34e0('0x2b')]['id']:null;_0x55f4fb[_[_0x34e0('0x27')](_0x5acf38[_0x34e0('0x29')])+(_0x5acf38['channel']!==_0x34e0('0x2c')?_0x34e0('0x2d'):'WebsiteId')]=_0x5acf38[_0x34e0('0xd')]?_0x5acf38['account']['id']:null;logger[_0x34e0('0x2e')](util['format'](_0x34e0('0x2f'),_0x2f6378,_0xa2e15c[_0x34e0('0x30')]));emitChannelQueueInteraction(_0x5acf38[_0x34e0('0x29')],_0xa2e15c[_0x34e0('0x30')],_0x55f4fb,_0x5acf38['account'][_0x34e0('0x30')],_0x5acf38[_0x34e0('0x2b')]['id'],!![],_0x41c3b8,_0xa2e15c['id']);if(rpc[_0x5acf38[_0x34e0('0x29')]+_0x34e0('0x31')]){return rpc[_0x5acf38[_0x34e0('0x29')]+_0x34e0('0x31')][_0x34e0('0x32')](_0x55f4fb)[_0x34e0('0x33')](function(_0x1f1bb0){logger[_0x34e0('0x34')](_0x34e0('0x35'));});}}}function stopRouting(_0x4b3a31,_0x4ba7d7,_0x577df2,_0x492177){if(_0x4b3a31&&_0x4ba7d7){_0x4ba7d7[_0x34e0('0x23')]-=0x1;var _0x3430b6={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x34e0('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x34e0('0x36')};logger[_0x34e0('0x2e')](util['format'](_0x34e0('0x37'),_0x4b3a31,_0x4ba7d7['name']));emitChannelQueueInteraction(_0x577df2['channel'],_0x4ba7d7[_0x34e0('0x30')],_0x577df2['body'],_0x577df2[_0x34e0('0xd')][_0x34e0('0x30')],_0x577df2[_0x34e0('0x2b')]['id'],![],_0x492177,_0x4ba7d7['id']);if(rpc[_0x577df2[_0x34e0('0x29')]+_0x34e0('0x31')]){return rpc[_0x577df2['channel']+_0x34e0('0x31')][_0x34e0('0x38')](_0x4b3a31,_0x3430b6)[_0x34e0('0x33')](function(_0x246c3c){logger[_0x34e0('0x34')]('update\x20queue\x20report');});}}}function endRouting(_0x166ba9,_0x258fe5,_0x441eca,_0x3e991d){if(_0x166ba9&&_0x258fe5){_0x258fe5[_0x34e0('0x23')]-=0x1;var _0x321116={'leaveAt':moment()['format'](_0x34e0('0x39')),'exitAt':moment()['format'](_0x34e0('0x39')),'reason':'timeout'};logger[_0x34e0('0x2e')](util[_0x34e0('0x17')](_0x34e0('0x3a'),_0x166ba9,_0x258fe5[_0x34e0('0x30')]));emitChannelQueueInteraction(_0x441eca[_0x34e0('0x29')],_0x258fe5[_0x34e0('0x30')],_0x441eca['body'],_0x441eca['account'][_0x34e0('0x30')],_0x441eca[_0x34e0('0x2b')]['id'],![],_0x3e991d);if(rpc[_0x441eca['channel']+_0x34e0('0x31')]){return rpc[_0x441eca[_0x34e0('0x29')]+_0x34e0('0x31')]['update'](_0x166ba9,_0x321116)[_0x34e0('0x33')](function(_0x3dd4e8){logger['error'](_0x34e0('0x3b'));});}}}function handleFindQueue(_0x18c412){return function(_0x436f8e){return _0x436f8e['name']['toLowerCase']()===_0x18c412['toLowerCase']();};}exports['consequence']=function(_0x4e7bc6,_0x48a05c,_0x19cb13,_0x1e5688){return function(_0x35cb5a){try{var _0x494965={'name':_0x48a05c[0x0],'timeout':_0x48a05c[0x1]};var _0x50ed70=queue[_0x34e0('0x3c')](_0x494965,{'typecast':!![]});if(_0x50ed70[_0x34e0('0x3d')]){logger[_0x34e0('0x34')]('[%s][QUEUE]\x20%s',_0x4e7bc6,_[_0x34e0('0x3e')](_0x50ed70,'message')[_0x34e0('0x3f')](',\x20'));_0x35cb5a[_0x34e0('0x40')]();}else{var _0x3193b8=_['find'](_0x19cb13[_0x1e5688['channel']+_0x34e0('0x41')],handleFindQueue(_0x494965[_0x34e0('0x30')]));if(_0x3193b8){startRouting(_0x4e7bc6,_0x3193b8,_0x1e5688,_0x19cb13);var _0x4b36cd=(_0x3193b8[_0x34e0('0x42')]||0xa)*0x3e8;var _0x431eed=(_0x494965[_0x34e0('0x42')]||0x14)*0x3e8;var _0x1dc21f;if(_0x4b36cd>_0x431eed){_0x431eed=_0x4b36cd;}var _0x195729=seqqueue[_0x34e0('0x43')](_0x4b36cd);_0x195729['id']=_0x4e7bc6;_0x195729[_0x34e0('0x44')]=_0x4b36cd;_0x195729[_0x34e0('0x45')]=_0x431eed;_0x195729[_0x34e0('0x29')]=_0x1e5688[_0x34e0('0x29')];_0x19cb13[_0x34e0('0x46')][_0x4e7bc6]['on'](_0x34e0('0x47'),function(){logger[_0x34e0('0x2e')](_0x34e0('0x48'),_0x4e7bc6);stopRouting(_0x4e7bc6,_0x3193b8,_0x1e5688,_0x19cb13);clearTimeout(_0x1dc21f);_0x1dc21f=undefined;_0x195729['close'](!![]);if(_0x19cb13['rules'][_0x4e7bc6]){delete _0x19cb13['rules'][_0x4e7bc6];}_0x35cb5a[_0x34e0('0x40')]();});_0x19cb13[_0x34e0('0x46')][_0x4e7bc6]['on'](_0x34e0('0x49'),function(){if(_0x19cb13['rules'][_0x4e7bc6]){delete _0x19cb13[_0x34e0('0x46')][_0x4e7bc6];}});_0x1dc21f=setTimeout(function(){logger[_0x34e0('0x2e')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4e7bc6);endRouting(_0x4e7bc6,_0x3193b8,_0x1e5688,_0x19cb13);clearTimeout(_0x1dc21f);_0x195729[_0x34e0('0x4a')](!![]);_0x35cb5a[_0x34e0('0x4b')]();},_0x431eed);switch(_0x3193b8[_0x34e0('0x4c')]){case _0x34e0('0x4d'):strategy[_0x34e0('0x4d')](_0x195729,_0x3193b8,_0x19cb13,_0x1e5688);break;default:strategy[_0x34e0('0x4e')](_0x195729,_0x3193b8,_0x19cb13,_0x1e5688);}}else{logger[_0x34e0('0x34')](_0x34e0('0x4f'),_0x4e7bc6,_0x494965[_0x34e0('0x30')]);_0x35cb5a[_0x34e0('0x40')]();}}}catch(_0x472599){console[_0x34e0('0x50')](_0x472599);logger[_0x34e0('0x34')](_0x34e0('0x51'),_0x4e7bc6,_0x472599[_0x34e0('0x52')]);_0x35cb5a[_0x34e0('0x40')]();}};}; \ No newline at end of file +var _0xa0da=['moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','joinAt','emit','clone','queue','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','message','chat','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','info','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','map','join','Queues','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','stop','log','stack','validate','util','seq-queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0da,0x183));var _0xaa0d=function(_0x215cf3,_0x48545b){_0x215cf3=_0x215cf3-0x0;var _0x1e2e7c=_0xa0da[_0x215cf3];return _0x1e2e7c;};'use strict';var schema=require(_0xaa0d('0x0'));var _=require('lodash');var util=require(_0xaa0d('0x1'));var seqqueue=require(_0xaa0d('0x2'));var moment=require(_0xaa0d('0x3'));var Redis=require(_0xaa0d('0x4'));var config=require('../../../../config/environment');var logger=require(_0xaa0d('0x5'))(_0xaa0d('0x6'));var strategy=require('./strategy');config[_0xaa0d('0x7')]=_[_0xaa0d('0x8')](config['redis'],{'host':_0xaa0d('0x9'),'port':0x18eb});var io=require(_0xaa0d('0xa'))(new Redis(config['redis']));var attributes=['id',_0xaa0d('0xb'),_0xaa0d('0xc'),'queue','from',_0xaa0d('0xd')];function emit(_0x2f19e2,_0x47d69e,_0x463639){io['to'](_0x2f19e2)[_0xaa0d('0xe')](_0x47d69e,_0x463639);}function emitChannelQueueInteraction(_0x3807a8,_0x2c8118,_0xc32057,_0x531e5e,_0x5aef75,_0x4b61c1,_0xabd6d,_0xcf06cb){var _0x2f3267=_[_0xaa0d('0xf')](_0xc32057);_0x2f3267[_0xaa0d('0xb')]=_0xcf06cb;_0x2f3267[_0xaa0d('0x10')]=_0x2c8118;_0x2f3267[_0xaa0d('0xc')]=_0x531e5e;_0x2f3267['id']=_0x5aef75;if(_0x4b61c1){attributes[_0xaa0d('0x11')](_[_0xaa0d('0x12')](_0x3807a8)+_0xaa0d('0x13'));_0xabd6d[util[_0xaa0d('0x14')](_0xaa0d('0x15'),_0x3807a8)][_0x5aef75]=_[_0xaa0d('0x16')](_0x2f3267,attributes);}else{delete _0xabd6d[util[_0xaa0d('0x14')](_0xaa0d('0x15'),_0x3807a8)][_0x5aef75];}emit(util[_0xaa0d('0x14')](_0xaa0d('0x17'),_0x3807a8,_0x2c8118),util[_0xaa0d('0x14')](_0xaa0d('0x18'),_0x3807a8,_0x4b61c1?'save':_0xaa0d('0x19')),_[_0xaa0d('0x16')](_0x2f3267,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xaa0d('0x1a')),'chatQueueReport':require(_0xaa0d('0x1b')),'smsQueueReport':require(_0xaa0d('0x1c')),'faxQueueReport':require(_0xaa0d('0x1d')),'whatsappQueueReport':require(_0xaa0d('0x1e'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xaa0d('0x1f'),'message':_0xaa0d('0x20')}});function startRouting(_0x19c094,_0x635c95,_0x202bdd,_0x23eea1){if(_0x19c094&&_0x635c95&&_0x202bdd){_0x635c95[_0xaa0d('0x21')]+=0x1;var _0x5ee93b={'uniqueid':_0x19c094,'from':_0x202bdd[_0xaa0d('0x22')]?_0x202bdd['body'][_0xaa0d('0x23')]:'','joinAt':moment()[_0xaa0d('0x14')](_0xaa0d('0x24')),'ContactId':_0x202bdd[_0xaa0d('0x25')]?_0x202bdd['contact']['id']:null,'ListId':_0x202bdd['list']?_0x202bdd[_0xaa0d('0x26')]['id']:null};_0x5ee93b[_['upperFirst'](_0x202bdd[_0xaa0d('0x27')])+_0xaa0d('0x28')]=_0x635c95['id']||null;_0x5ee93b[_[_0xaa0d('0x29')](_0x202bdd['channel'])+_0xaa0d('0x13')]=_0x202bdd[_0xaa0d('0x2a')]?_0x202bdd[_0xaa0d('0x2a')]['id']:null;_0x5ee93b[_['upperFirst'](_0x202bdd[_0xaa0d('0x27')])+'MessageId']=_0x202bdd['message']?_0x202bdd[_0xaa0d('0x2b')]['id']:null;_0x5ee93b[_[_0xaa0d('0x29')](_0x202bdd[_0xaa0d('0x27')])+(_0x202bdd[_0xaa0d('0x27')]!==_0xaa0d('0x2c')?'AccountId':_0xaa0d('0x2d'))]=_0x202bdd[_0xaa0d('0xc')]?_0x202bdd[_0xaa0d('0xc')]['id']:null;logger['info'](util[_0xaa0d('0x14')](_0xaa0d('0x2e'),_0x19c094,_0x635c95['name']));emitChannelQueueInteraction(_0x202bdd[_0xaa0d('0x27')],_0x635c95[_0xaa0d('0x2f')],_0x5ee93b,_0x202bdd[_0xaa0d('0xc')][_0xaa0d('0x2f')],_0x202bdd[_0xaa0d('0x2b')]['id'],!![],_0x23eea1,_0x635c95['id']);if(rpc[_0x202bdd[_0xaa0d('0x27')]+_0xaa0d('0x30')]){return rpc[_0x202bdd[_0xaa0d('0x27')]+_0xaa0d('0x30')][_0xaa0d('0x31')](_0x5ee93b)[_0xaa0d('0x32')](function(_0x2cb31f){logger[_0xaa0d('0x33')](_0xaa0d('0x34'));});}}}function stopRouting(_0x407bf7,_0x58780b,_0x4f6df9,_0x36c719){if(_0x407bf7&&_0x58780b){_0x58780b[_0xaa0d('0x21')]-=0x1;var _0x366b99={'leaveAt':moment()[_0xaa0d('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xaa0d('0x24')),'reason':'accepted'};logger[_0xaa0d('0x35')](util[_0xaa0d('0x14')](_0xaa0d('0x36'),_0x407bf7,_0x58780b[_0xaa0d('0x2f')]));emitChannelQueueInteraction(_0x4f6df9[_0xaa0d('0x27')],_0x58780b['name'],_0x4f6df9['body'],_0x4f6df9[_0xaa0d('0xc')]['name'],_0x4f6df9[_0xaa0d('0x2b')]['id'],![],_0x36c719,_0x58780b['id']);if(rpc[_0x4f6df9[_0xaa0d('0x27')]+_0xaa0d('0x30')]){return rpc[_0x4f6df9[_0xaa0d('0x27')]+'QueueReport'][_0xaa0d('0x37')](_0x407bf7,_0x366b99)[_0xaa0d('0x32')](function(_0x5177e0){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x1de41c,_0x42ab00,_0x2a5802,_0x1af09e){if(_0x1de41c&&_0x42ab00){_0x42ab00[_0xaa0d('0x21')]-=0x1;var _0x350eff={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xaa0d('0x14')](_0xaa0d('0x24')),'reason':_0xaa0d('0x38')};logger[_0xaa0d('0x35')](util['format'](_0xaa0d('0x39'),_0x1de41c,_0x42ab00['name']));emitChannelQueueInteraction(_0x2a5802['channel'],_0x42ab00['name'],_0x2a5802[_0xaa0d('0x22')],_0x2a5802[_0xaa0d('0xc')][_0xaa0d('0x2f')],_0x2a5802['message']['id'],![],_0x1af09e);if(rpc[_0x2a5802['channel']+_0xaa0d('0x30')]){return rpc[_0x2a5802[_0xaa0d('0x27')]+_0xaa0d('0x30')][_0xaa0d('0x37')](_0x1de41c,_0x350eff)[_0xaa0d('0x32')](function(_0x5cfd28){logger[_0xaa0d('0x33')](_0xaa0d('0x3a'));});}}}function handleFindQueue(_0x5669bb){return function(_0x64c913){return _0x64c913[_0xaa0d('0x2f')][_0xaa0d('0x3b')]()===_0x5669bb[_0xaa0d('0x3b')]();};}exports[_0xaa0d('0x3c')]=function(_0x18fdf7,_0x24e041,_0x5d2a2a,_0xdd786){return function(_0x432036){try{var _0x2218c8={'name':_0x24e041[0x0],'timeout':_0x24e041[0x1]};var _0x211e67=queue[_0xaa0d('0x0')](_0x2218c8,{'typecast':!![]});if(_0x211e67[_0xaa0d('0x3d')]){logger['error']('[%s][QUEUE]\x20%s',_0x18fdf7,_[_0xaa0d('0x3e')](_0x211e67,_0xaa0d('0x2b'))[_0xaa0d('0x3f')](',\x20'));_0x432036['stop']();}else{var _0x2859c2=_['find'](_0x5d2a2a[_0xdd786[_0xaa0d('0x27')]+_0xaa0d('0x40')],handleFindQueue(_0x2218c8[_0xaa0d('0x2f')]));if(_0x2859c2){startRouting(_0x18fdf7,_0x2859c2,_0xdd786,_0x5d2a2a);var _0x948531=(_0x2859c2[_0xaa0d('0x38')]||0xa)*0x3e8;var _0x564a3b=(_0x2218c8['timeout']||0x14)*0x3e8;var _0x586a1;if(_0x948531>_0x564a3b){_0x564a3b=_0x948531;}var _0x497f4a=seqqueue['createQueue'](_0x948531);_0x497f4a['id']=_0x18fdf7;_0x497f4a[_0xaa0d('0x41')]=_0x948531;_0x497f4a['qtimeout']=_0x564a3b;_0x497f4a[_0xaa0d('0x27')]=_0xdd786[_0xaa0d('0x27')];_0x5d2a2a[_0xaa0d('0x42')][_0x18fdf7]['on'](_0xaa0d('0x43'),function(){logger[_0xaa0d('0x35')](_0xaa0d('0x44'),_0x18fdf7);stopRouting(_0x18fdf7,_0x2859c2,_0xdd786,_0x5d2a2a);clearTimeout(_0x586a1);_0x586a1=undefined;_0x497f4a[_0xaa0d('0x45')](!![]);if(_0x5d2a2a['rules'][_0x18fdf7]){delete _0x5d2a2a[_0xaa0d('0x42')][_0x18fdf7];}_0x432036['stop']();});_0x5d2a2a[_0xaa0d('0x42')][_0x18fdf7]['on'](_0xaa0d('0x46'),function(){if(_0x5d2a2a[_0xaa0d('0x42')][_0x18fdf7]){delete _0x5d2a2a[_0xaa0d('0x42')][_0x18fdf7];}});_0x586a1=setTimeout(function(){logger[_0xaa0d('0x35')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x18fdf7);endRouting(_0x18fdf7,_0x2859c2,_0xdd786,_0x5d2a2a);clearTimeout(_0x586a1);_0x497f4a[_0xaa0d('0x45')](!![]);_0x432036[_0xaa0d('0x47')]();},_0x564a3b);switch(_0x2859c2[_0xaa0d('0x48')]){case _0xaa0d('0x49'):strategy['rrmemory'](_0x497f4a,_0x2859c2,_0x5d2a2a,_0xdd786);break;default:strategy[_0xaa0d('0x4a')](_0x497f4a,_0x2859c2,_0x5d2a2a,_0xdd786);}}else{logger[_0xaa0d('0x33')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x18fdf7,_0x2218c8['name']);_0x432036[_0xaa0d('0x4b')]();}}}catch(_0x3527cc){console[_0xaa0d('0x4c')](_0x3527cc);logger[_0xaa0d('0x33')]('[%s][QUEUE]\x20%s',_0x18fdf7,_0x3527cc[_0xaa0d('0x4d')]);_0x432036['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index da3532f..e3a5deb 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 _0x8ef6=['handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','debug','channel','busy','busyQueue','showNotification','RINGING','forcedOwnership',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','handleTimeout','bind','timeout','drained'];(function(_0x591979,_0x662ad){var _0x3bce64=function(_0x4cb583){while(--_0x4cb583){_0x591979['push'](_0x591979['shift']());}};_0x3bce64(++_0x662ad);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2de3f5,_0x8b236d){_0x2de3f5=_0x2de3f5-0x0;var _0x119b98=_0x8ef6[_0x2de3f5];return _0x119b98;};'use strict';var _=require(_0x68ef('0x0'));var uuid=require(_0x68ef('0x1'));var util=require(_0x68ef('0x2'));var logger=require(_0x68ef('0x3'))(_0x68ef('0x4'));var Agent=function(_0x44e0d3,_0x3411a2,_0x4a72b8,_0x27d0af){this[_0x68ef('0x5')]=uuid['v4']();this[_0x68ef('0x6')]=_0x44e0d3;this[_0x68ef('0x7')]=_0x3411a2;this['realtime']=_0x4a72b8;this['routing']=_0x27d0af;this[_0x68ef('0x6')][_0x68ef('0x8')](this[_0x68ef('0x9')]['bind'](this),this[_0x68ef('0xa')][_0x68ef('0xb')](this));this[_0x68ef('0x6')]['on'](_0x68ef('0xc'),this[_0x68ef('0xa')][_0x68ef('0xb')](this));this[_0x68ef('0x6')]['on'](_0x68ef('0xd'),this[_0x68ef('0xe')][_0x68ef('0xb')](this));};Agent[_0x68ef('0xf')][_0x68ef('0x8')]=function(){this['squeue'][_0x68ef('0x8')](this[_0x68ef('0x9')][_0x68ef('0xb')](this),this[_0x68ef('0xa')][_0x68ef('0xb')](this));};Agent[_0x68ef('0xf')]['handleDrained']=function(){this[_0x68ef('0xa')](!![]);};Agent[_0x68ef('0xf')][_0x68ef('0x9')]=function(){logger['debug'](_0x68ef('0x10'),this[_0x68ef('0x6')]['id'],this[_0x68ef('0x7')]['id']);if(_['isNil'](this[_0x68ef('0x11')][_0x68ef('0x12')][this[_0x68ef('0x7')]['id']])){logger[_0x68ef('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x68ef('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0x68ef('0xb')](this),0x3e8);}else{if(this[_0x68ef('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x68ef('0x6')]['id'],this[_0x68ef('0x11')][_0x68ef('0x12')][this['agent']['id']],this[_0x68ef('0x6')][_0x68ef('0x14')],![])){this[_0x68ef('0x11')]['agents'][this[_0x68ef('0x7')]['id']][_0x68ef('0x15')]=!![];this['realtime'][_0x68ef('0x12')][this[_0x68ef('0x7')]['id']][_0x68ef('0x16')]=undefined;util['saveWaitingNotification'](this['realtime'],this['routing'],this[_0x68ef('0x7')],this[_0x68ef('0x6')][_0x68ef('0x14')]);util[_0x68ef('0x17')](this[_0x68ef('0x5')],this[_0x68ef('0x6')]['id'],this[_0x68ef('0x11')][_0x68ef('0x12')][this[_0x68ef('0x7')]['id']],null,this[_0x68ef('0x4')]);util['writeLog'](this[_0x68ef('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],_0x68ef('0x18')+(this[_0x68ef('0x4')][_0x68ef('0x19')]?_0x68ef('0x1a'):''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x68ef('0x6')]['id'],this[_0x68ef('0x7')]['id']);setTimeout(this[_0x68ef('0x8')][_0x68ef('0xb')](this),0x3e8);}}};Agent[_0x68ef('0xf')][_0x68ef('0xa')]=function(_0x26288a){if(_[_0x68ef('0x1b')](this['realtime'][_0x68ef('0x12')][this[_0x68ef('0x7')]['id']])){return logger[_0x68ef('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x68ef('0x6')]['id'],this['agent']['id']);}else{logger[_0x68ef('0x13')](_0x68ef('0x1c'),this['squeue']['id'],this['agent']['id']);util[_0x68ef('0x1d')](this[_0x68ef('0x5')],this['squeue']['id'],this[_0x68ef('0x11')][_0x68ef('0x12')][this[_0x68ef('0x7')]['id']],null,this[_0x68ef('0x4')]);this['realtime'][_0x68ef('0x12')][this[_0x68ef('0x7')]['id']]['busy']=![];this[_0x68ef('0x11')]['agents'][this[_0x68ef('0x7')]['id']][_0x68ef('0x16')]=undefined;util['removeWaitingNotification'](this[_0x68ef('0x11')],this['routing'],this[_0x68ef('0x7')],this['squeue'][_0x68ef('0x14')]);util[_0x68ef('0x1e')](this[_0x68ef('0x6')]['id'],this['realtime'][_0x68ef('0x12')][this['agent']['id']],_0x26288a?_0x68ef('0x1f'):'TIMEOUT');}if(!_0x26288a){setTimeout(this[_0x68ef('0x8')][_0x68ef('0xb')](this),0x3e8);}};function agent(_0x102df9,_0x136f6b,_0x2181d9,_0xefd1d){return new Agent(_0x102df9,_0x136f6b,_0x2181d9,_0xefd1d);}module['exports']=agent; \ No newline at end of file +var _0x0c02=['squeue','agent','realtime','handleTimeout','bind','timeout','push','handleRun','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','TIMEOUT','exports','uuid','./util','routing','notificationId'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var uuid=require(_0x20c0('0x0'));var util=require(_0x20c0('0x1'));var logger=require('../../../../../config/logger')(_0x20c0('0x2'));var Agent=function(_0x5c8750,_0x454922,_0x6d03d0,_0x38022e){this[_0x20c0('0x3')]=uuid['v4']();this[_0x20c0('0x4')]=_0x5c8750;this[_0x20c0('0x5')]=_0x454922;this[_0x20c0('0x6')]=_0x6d03d0;this[_0x20c0('0x2')]=_0x38022e;this['squeue']['push'](this['handleRun']['bind'](this),this[_0x20c0('0x7')][_0x20c0('0x8')](this));this[_0x20c0('0x4')]['on'](_0x20c0('0x9'),this[_0x20c0('0x7')][_0x20c0('0x8')](this));this['squeue']['on']('drained',this['handleDrained']['bind'](this));};Agent['prototype'][_0x20c0('0xa')]=function(){this[_0x20c0('0x4')][_0x20c0('0xa')](this[_0x20c0('0xb')]['bind'](this),this[_0x20c0('0x7')]['bind'](this));};Agent['prototype'][_0x20c0('0xc')]=function(){this[_0x20c0('0x7')](!![]);};Agent[_0x20c0('0xd')][_0x20c0('0xb')]=function(){logger[_0x20c0('0xe')](_0x20c0('0xf'),this[_0x20c0('0x4')]['id'],this[_0x20c0('0x5')]['id']);if(_[_0x20c0('0x10')](this['realtime'][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']])){logger[_0x20c0('0xe')](_0x20c0('0x12'),this[_0x20c0('0x4')]['id'],this[_0x20c0('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0x20c0('0x13')]||util[_0x20c0('0x14')](this[_0x20c0('0x4')]['id'],this[_0x20c0('0x6')]['agents'][this[_0x20c0('0x5')]['id']],this[_0x20c0('0x4')][_0x20c0('0x15')],![])){this['realtime']['agents'][this[_0x20c0('0x5')]['id']][_0x20c0('0x16')]=!![];this[_0x20c0('0x6')][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']]['busyQueue']=undefined;util[_0x20c0('0x17')](this[_0x20c0('0x6')],this[_0x20c0('0x2')],this[_0x20c0('0x5')],this['squeue'][_0x20c0('0x15')]);util[_0x20c0('0x18')](this[_0x20c0('0x3')],this[_0x20c0('0x4')]['id'],this[_0x20c0('0x6')][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']],null,this['routing']);util[_0x20c0('0x19')](this[_0x20c0('0x4')]['id'],this[_0x20c0('0x6')][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']],_0x20c0('0x1a')+(this['routing']['forcedOwnership']?_0x20c0('0x1b'):''));}else{logger[_0x20c0('0xe')](_0x20c0('0x1c'),this['squeue']['id'],this[_0x20c0('0x5')]['id']);setTimeout(this[_0x20c0('0xa')][_0x20c0('0x8')](this),0x3e8);}}};Agent[_0x20c0('0xd')]['handleTimeout']=function(_0x49b738){if(_[_0x20c0('0x10')](this[_0x20c0('0x6')][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']])){return logger[_0x20c0('0xe')](_0x20c0('0x12'),this[_0x20c0('0x4')]['id'],this[_0x20c0('0x5')]['id']);}else{logger[_0x20c0('0xe')](_0x20c0('0x1d'),this[_0x20c0('0x4')]['id'],this[_0x20c0('0x5')]['id']);util[_0x20c0('0x1e')](this[_0x20c0('0x3')],this['squeue']['id'],this[_0x20c0('0x6')][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']],null,this[_0x20c0('0x2')]);this['realtime'][_0x20c0('0x11')][this[_0x20c0('0x5')]['id']][_0x20c0('0x16')]=![];this[_0x20c0('0x6')][_0x20c0('0x11')][this['agent']['id']][_0x20c0('0x1f')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x20c0('0x2')],this[_0x20c0('0x5')],this[_0x20c0('0x4')][_0x20c0('0x15')]);util[_0x20c0('0x19')](this[_0x20c0('0x4')]['id'],this[_0x20c0('0x6')]['agents'][this['agent']['id']],_0x49b738?'STOP':_0x20c0('0x20'));}if(!_0x49b738){setTimeout(this[_0x20c0('0xa')]['bind'](this),0x3e8);}};function agent(_0x346a04,_0x20d6f3,_0x550d2c,_0x5a7641){return new Agent(_0x346a04,_0x20d6f3,_0x550d2c,_0x5a7641);}module[_0x20c0('0x21')]=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 444fa7e..3fb9efe 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 _0x8f9b=['drained','handleDrained','handleTimeout','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','timeout'];(function(_0x4cd793,_0x27d4f1){var _0xdcdab7=function(_0x5bdfc2){while(--_0x5bdfc2){_0x4cd793['push'](_0x4cd793['shift']());}};_0xdcdab7(++_0x27d4f1);}(_0x8f9b,0x175));var _0xb8f9=function(_0x30d296,_0x32830d){_0x30d296=_0x30d296-0x0;var _0x15a7b8=_0x8f9b[_0x30d296];return _0x15a7b8;};'use strict';var _=require(_0xb8f9('0x0'));var uuid=require('uuid');var util=require(_0xb8f9('0x1'));var logger=require(_0xb8f9('0x2'))(_0xb8f9('0x3'));var Beepall=function(_0x4d0076,_0x5bd4f7,_0x572871,_0xc0eb52){this[_0xb8f9('0x4')]=uuid['v4']();this[_0xb8f9('0x5')]=_0x4d0076;this[_0xb8f9('0x6')]=_0x5bd4f7;this[_0xb8f9('0x7')]=_0x572871;this[_0xb8f9('0x3')]=_0xc0eb52;this[_0xb8f9('0x5')][_0xb8f9('0x8')](this[_0xb8f9('0x9')]['bind'](this),this['handleTimeout'][_0xb8f9('0xa')](this));this[_0xb8f9('0x5')]['on'](_0xb8f9('0xb'),this['handleTimeout'][_0xb8f9('0xa')](this));this[_0xb8f9('0x5')]['on'](_0xb8f9('0xc'),this[_0xb8f9('0xd')]['bind'](this));};Beepall['prototype'][_0xb8f9('0x8')]=function(){this[_0xb8f9('0x5')]['push'](this[_0xb8f9('0x9')][_0xb8f9('0xa')](this),this[_0xb8f9('0xe')][_0xb8f9('0xa')](this));};Beepall[_0xb8f9('0xf')]['handleDrained']=function(){this[_0xb8f9('0xe')](!![]);};Beepall[_0xb8f9('0xf')][_0xb8f9('0x9')]=function(){var _0x7e9b66=!![];if(!_[_0xb8f9('0x10')](this[_0xb8f9('0x6')])&&!_[_0xb8f9('0x10')](this[_0xb8f9('0x6')][_0xb8f9('0x11')])&&this[_0xb8f9('0x6')][_0xb8f9('0x11')][_0xb8f9('0x12')]>0x0){for(var _0x1b039f=0x0,_0x2e4d72;_0x1b039f0x0){for(var _0x216168=0x0,_0x253adf;_0x2161680x0&&_0x15c9cc[_0x6a845a+_0xf5da('0x20')]>=_0x15c9cc[_0x6a845a+'Capacity']){writeLog(_0xc073dc,_0x15c9cc,_0x6a845a['toUpperCase']()+_0xf5da('0x21'));return![];}}return!![];};exports[_0xf5da('0x22')]=function(_0x535471,_0x8ea04a,_0x84dd72,_0x7d11c0,_0x43e007){return sendNotification(!![],_0x535471,_0x8ea04a,_0x84dd72,_0x7d11c0,_0x43e007);};exports[_0xf5da('0x23')]=function(_0x59051e,_0x5ebf97,_0x597df2,_0x3e3734,_0x5efaac){return sendNotification(![],_0x59051e,_0x5ebf97,_0x597df2,_0x3e3734,_0x5efaac);};exports[_0xf5da('0x24')]=function(_0x5a7c59,_0x3828f0,_0x6397d8){var _0x38f935=_0x3828f0[_0xf5da('0x25')][_0xf5da('0x26')];if(!_0x38f935&&_0x6397d8){_0x38f935=_0x6397d8['id'];}var _0x55e664=_[_0xf5da('0x27')](_0x5a7c59[_0x3828f0['channel']+'QueuesWaitingInteractions'],function(_0x236d56){var _0xf2b80a=_[_0xf5da('0x28')](_0x3828f0[_0xf5da('0x29')])+'InteractionId';return _0x236d56[_0xf2b80a]===_0x3828f0['interaction']['id'];});if(!_0x55e664&&_0x38f935){_0x55e664=_[_0xf5da('0x27')](_0x5a7c59[_0xf5da('0x2a')][_0x38f935][_0x3828f0[_0xf5da('0x29')]+_0xf5da('0x2b')],function(_0x25ee10){return _0x25ee10['id']===_0x3828f0[_0xf5da('0x25')]['id'];});}return _0x55e664;};exports[_0xf5da('0x2c')]=function(_0x1817f2,_0x1f8822,_0x277445,_0xdff055){_0x1817f2[_0xf5da('0x2a')][_0x277445['id']][_0xdff055+_0xf5da('0x2b')][_0x1f8822[_0xf5da('0x2d')]['id']]={'id':_0x1f8822[_0xf5da('0x25')]['id']};};exports[_0xf5da('0x2e')]=function(_0x4042e4,_0x12ed4b,_0x3e850a,_0x5b22d0){delete _0x4042e4[_0xf5da('0x2a')][_0x3e850a['id']][_0x5b22d0+_0xf5da('0x2b')][_0x12ed4b[_0xf5da('0x2d')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0x8600=['save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','showNotification','hideNotification','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','interaction','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','format','user:%s','name','emit','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s'];(function(_0x835f85,_0xa30228){var _0xfdc1b=function(_0x4e9c22){while(--_0x4e9c22){_0x835f85['push'](_0x835f85['shift']());}};_0xfdc1b(++_0xa30228);}(_0x8600,0x186));var _0x0860=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8600[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x0860('0x0'));var util=require('util');var utils=require(_0x0860('0x1'));var Redis=require(_0x0860('0x2'));var config=require(_0x0860('0x3'));var logger=require(_0x0860('0x4'))(_0x0860('0x5'));config[_0x0860('0x6')]=_[_0x0860('0x7')](config[_0x0860('0x6')],{'host':_0x0860('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0860('0x6')]));function sendNotification(_0x2d708f,_0x3c192d,_0x5a46e7,_0x3a4831,_0x243b34,_0x73772f){io['to'](util[_0x0860('0x9')](_0x0860('0xa'),_0x3a4831[_0x0860('0xb')]))[_0x0860('0xc')](_0x0860('0xd'),_0x3a4831);var _0x3c4ace=_0x73772f||{};var _0x194fd1=_0x5a46e7[_0x0860('0xe')]('.');var _0x4e5d40={'uniqueid':_0x3c192d,'channel':_0x194fd1[0x0],'id':_0x194fd1[0x1],'title':_0x194fd1[0x0]+_0x0860('0xf'),'interactionId':_0x194fd1[0x2],'queue':_0x243b34?_0x243b34[_0x0860('0xb')]:null,'sound':_0x3c4ace['account'][_0x0860('0x10')],'shake':_0x3c4ace[_0x0860('0x11')][_0x0860('0x12')]};try{if(!_0x3c4ace[_0x0860('0x13')]){_0x3c4ace[_0x0860('0x13')]={};}if(_0x243b34){_0x3c4ace[_0x0860('0x13')]['queue']=_0x243b34;}else if(_0x3c4ace['body']['queue']){delete _0x3c4ace[_0x0860('0x13')][_0x0860('0x14')];}_0x4e5d40[_0x0860('0x15')]=utils['getMustacheRender'](_0x3c4ace['account']['notificationTemplate'],_0x3c4ace);}catch(_0x5b36b3){_0x4e5d40[_0x0860('0x15')]=_0x0860('0x16');logger['error'](util[_0x0860('0x9')](_0x0860('0x17'),_0x3c192d,_0x5b36b3[_0x0860('0x18')]));}io['to'](util[_0x0860('0x9')](_0x0860('0xa'),_0x3a4831[_0x0860('0xb')]))[_0x0860('0xc')](util['format'](_0x0860('0x19'),_0x2d708f?_0x0860('0x1a'):_0x0860('0x1b')),_0x4e5d40);}function writeLog(_0x16d47b,_0x80db85,_0xd43920){return logger[_0x0860('0x1c')](util[_0x0860('0x9')](_0x0860('0x1d'),_0x16d47b,_0x80db85['name'],_0xd43920));}exports[_0x0860('0x1e')]=function(_0x40444f,_0x1f0688,_0x4c9dad,_0x4d248e){if(_0x1f0688['busy']){writeLog(_0x40444f,_0x1f0688,'BUSY');return![];}if(!_0x1f0688[_0x0860('0x1f')]){writeLog(_0x40444f,_0x1f0688,_0x0860('0x20'));return![];}if(_0x1f0688[_0x4c9dad+_0x0860('0x21')]){writeLog(_0x40444f,_0x1f0688,_0x0860('0x22'));return![];}if(_0x4d248e&&_0x1f0688[_0x0860('0x23')](_0x4c9dad+_0x0860('0x24'))&&_0x1f0688['hasOwnProperty'](_0x4c9dad+'CurrentCapacity')){if(_0x1f0688[_0x4c9dad+_0x0860('0x24')]>0x0&&_0x1f0688[_0x4c9dad+_0x0860('0x25')]>=_0x1f0688[_0x4c9dad+_0x0860('0x24')]){writeLog(_0x40444f,_0x1f0688,_0x4c9dad['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x0860('0x26')]=function(_0x35d49f,_0x259972,_0x3923fe,_0x5b01f6,_0x2dc380){return sendNotification(!![],_0x35d49f,_0x259972,_0x3923fe,_0x5b01f6,_0x2dc380);};exports[_0x0860('0x27')]=function(_0x54808d,_0x3b4557,_0x7222bc,_0x285acb,_0x59d840){return sendNotification(![],_0x54808d,_0x3b4557,_0x7222bc,_0x285acb,_0x59d840);};exports['checkWaitingNotifications']=function(_0x3dbd9d,_0x2f2c17,_0x5bd349){var _0x27e86d=_0x2f2c17['interaction'][_0x0860('0x28')];if(!_0x27e86d&&_0x5bd349){_0x27e86d=_0x5bd349['id'];}var _0x3ee8e1=_[_0x0860('0x29')](_0x3dbd9d[_0x2f2c17[_0x0860('0x2a')]+_0x0860('0x2b')],function(_0x3104c1){var _0x595135=_[_0x0860('0x2c')](_0x2f2c17['channel'])+_0x0860('0x2d');return _0x3104c1[_0x595135]===_0x2f2c17[_0x0860('0x2e')]['id'];});if(!_0x3ee8e1&&_0x27e86d){_0x3ee8e1=_[_0x0860('0x29')](_0x3dbd9d[_0x0860('0x2f')][_0x27e86d][_0x2f2c17[_0x0860('0x2a')]+_0x0860('0x30')],function(_0x3d55f2){return _0x3d55f2['id']===_0x2f2c17['interaction']['id'];});}return _0x3ee8e1;};exports[_0x0860('0x31')]=function(_0x40c867,_0x227f45,_0xd359db,_0x535410){_0x40c867[_0x0860('0x2f')][_0xd359db['id']][_0x535410+_0x0860('0x30')][_0x227f45[_0x0860('0x18')]['id']]={'id':_0x227f45['interaction']['id']};};exports[_0x0860('0x32')]=function(_0x10b5fc,_0x50009f,_0x3fa770,_0x3cc4f5){delete _0x10b5fc['agents'][_0x3fa770['id']][_0x3cc4f5+_0x0860('0x30')][_0x50009f[_0x0860('0x18')]['id']];};exports[_0x0860('0x33')]=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 334a292..131e0a6 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 _0xedc1=['replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x53746e,_0x4f432d){var _0x4f3414=function(_0x3100f2){while(--_0x3100f2){_0x53746e['push'](_0x53746e['shift']());}};_0x4f3414(++_0x4f432d);}(_0xedc1,0x158));var _0x1edc=function(_0x37affd,_0x53e54d){_0x37affd=_0x37affd-0x0;var _0x5c385a=_0xedc1[_0x37affd];return _0x5c385a;};'use strict';var schema=require(_0x1edc('0x0'));var sh=require(_0x1edc('0x1'));var _=require(_0x1edc('0x2'));var utils=require(_0x1edc('0x3'));var logger=require(_0x1edc('0x4'))(_0x1edc('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x1edc('0x6')}});exports[_0x1edc('0x7')]=function(_0x4c1ffe,_0x116515){return function(_0x31e6ba){try{var _0x22169f={'command':_0x116515[0x0]};var _0x2f8023=system[_0x1edc('0x0')](_0x22169f,{'typecast':!![]});if(_0x2f8023[_0x1edc('0x8')]){logger[_0x1edc('0x9')](_0x1edc('0xa'),_0x4c1ffe,_[_0x1edc('0xb')](_0x2f8023,_0x1edc('0xc'))[_0x1edc('0xd')](',\x20'));logger[_0x1edc('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4c1ffe);_0x31e6ba[_0x1edc('0xf')]();}else{var _0x2283f1=this;var _0x3c38aa=utils[_0x1edc('0x10')](_0x116515[0x0],this);logger['info'](_0x1edc('0x11'),_0x4c1ffe,_0x3c38aa);sh['exec'](_[_0x1edc('0x12')](_0x3c38aa),function(_0x3aac93,_0x40e982){logger[_0x1edc('0xe')](_0x1edc('0x13'),_0x4c1ffe,_0x3aac93);if(_0x3aac93==0x0){var _0x4a599e=_0x40e982[_0x1edc('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x116515[0x1])||_[_0x1edc('0x15')](_0x116515[0x1])){logger[_0x1edc('0xe')](_0x1edc('0x16'),_0x4c1ffe);_0x2283f1['body'][_0x116515[0x1]]=_0x4a599e;}else{logger[_0x1edc('0xe')](_0x1edc('0x17'),_0x4c1ffe,_0x116515[0x1],_0x4a599e);_0x2283f1[_0x1edc('0x18')][_0x116515[0x1]]=_0x4a599e;}}_0x31e6ba['next']();});}}catch(_0x236345){logger[_0x1edc('0x9')](_0x1edc('0xa'),_0x4c1ffe,_[_0x1edc('0x19')](_0x236345)?JSON[_0x1edc('0x1a')](_0x236345):_0x236345);logger[_0x1edc('0xe')](_0x1edc('0x1b'),_0x4c1ffe);_0x31e6ba['next']();}};}; \ No newline at end of file +var _0x01a3=['message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][SYSTEM]\x20%s','map'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x01a3,0x13a));var _0x301a=function(_0x36f822,_0x49b4ca){_0x36f822=_0x36f822-0x0;var _0x5d0788=_0x01a3[_0x36f822];return _0x5d0788;};'use strict';var schema=require(_0x301a('0x0'));var sh=require(_0x301a('0x1'));var _=require(_0x301a('0x2'));var utils=require(_0x301a('0x3'));var logger=require(_0x301a('0x4'))(_0x301a('0x5'));var system=schema({'command':{'type':_0x301a('0x6'),'required':!![],'message':_0x301a('0x7')}});exports['consequence']=function(_0x50a660,_0x1e8199){return function(_0x12b2d9){try{var _0x33c685={'command':_0x1e8199[0x0]};var _0x506808=system[_0x301a('0x0')](_0x33c685,{'typecast':!![]});if(_0x506808['length']){logger[_0x301a('0x8')](_0x301a('0x9'),_0x50a660,_[_0x301a('0xa')](_0x506808,_0x301a('0xb'))[_0x301a('0xc')](',\x20'));logger['info'](_0x301a('0xd'),_0x50a660);_0x12b2d9[_0x301a('0xe')]();}else{var _0x19f4d1=this;var _0x2a6267=utils[_0x301a('0xf')](_0x1e8199[0x0],this);logger[_0x301a('0x10')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x50a660,_0x2a6267);sh[_0x301a('0x11')](_['trim'](_0x2a6267),function(_0x58d3c1,_0xccc885){logger['info'](_0x301a('0x12'),_0x50a660,_0x58d3c1);if(_0x58d3c1==0x0){var _0x121af9=_0xccc885[_0x301a('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x301a('0x14')](_0x1e8199[0x1])||_[_0x301a('0x15')](_0x1e8199[0x1])){logger[_0x301a('0x10')](_0x301a('0x16'),_0x50a660);_0x19f4d1[_0x301a('0x17')][_0x1e8199[0x1]]=_0x121af9;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x50a660,_0x1e8199[0x1],_0x121af9);_0x19f4d1['body'][_0x1e8199[0x1]]=_0x121af9;}}_0x12b2d9[_0x301a('0xe')]();});}}catch(_0x1a50ac){logger['error'](_0x301a('0x9'),_0x50a660,_[_0x301a('0x18')](_0x1a50ac)?JSON['stringify'](_0x1a50ac):_0x1a50ac);logger[_0x301a('0x10')](_0x301a('0xd'),_0x50a660);_0x12b2d9[_0x301a('0xe')]();}};}; \ 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 755b12a..9e8be40 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 _0x9e83=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','message','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x24c389,_0x37a6c0){var _0x346fcd=function(_0x35d949){while(--_0x35d949){_0x24c389['push'](_0x24c389['shift']());}};_0x346fcd(++_0x37a6c0);}(_0x9e83,0xc5));var _0x39e8=function(_0x567a40,_0x5c43c2){_0x567a40=_0x567a40-0x0;var _0x12eb34=_0x9e83[_0x567a40];return _0x12eb34;};'use strict';var schema=require(_0x39e8('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x39e8('0x1')),'openchannelInteraction':require(_0x39e8('0x2')),'smsInteraction':require(_0x39e8('0x3')),'mailInteraction':require(_0x39e8('0x4')),'faxInteraction':require(_0x39e8('0x5')),'whatsappInteraction':require(_0x39e8('0x6'))};var logger=require(_0x39e8('0x7'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0x39e8('0x8')}});exports[_0x39e8('0x9')]=function(_0x467742,_0x5301e3,_0x39d5b0,_0xee8859){return function(_0x5dc0d0){try{var _0x5aec65={'tag':_0x5301e3[0x0]};var _0x4c0bf0=tag[_0x39e8('0x0')](_0x5aec65,{'typecast':!![]});if(_0x4c0bf0[_0x39e8('0xa')]){logger[_0x39e8('0xb')](_0x39e8('0xc'),_0x467742,_['map'](_0x4c0bf0,_0x39e8('0xd'))[_0x39e8('0xe')](',\x20'));logger[_0x39e8('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x467742);_0x5dc0d0[_0x39e8('0x10')]();}else{var _0x58c3db={'ids':[_0x5301e3[0x0]]};if(rpc[_0xee8859[_0x39e8('0x11')]+_0x39e8('0x12')]){rpc[_0xee8859[_0x39e8('0x11')]+_0x39e8('0x12')]['addTags'](_0xee8859[_0x39e8('0x13')]['id'],_0x58c3db)[_0x39e8('0x14')](function(_0x36c721){logger['info'](_0x39e8('0x15'),_0x467742,_0x5301e3[0x1],_0xee8859[_0x39e8('0x11')],_0xee8859[_0x39e8('0x13')]['id']);})[_0x39e8('0x16')](function(_0x5b11be){logger['error']('[%s][TAG]\x20%s',_0x467742,JSON[_0x39e8('0x17')](_0x5b11be));logger[_0x39e8('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x467742);})[_0x39e8('0x18')](function(){_0x5dc0d0[_0x39e8('0x10')]();});}}}catch(_0x4d797d){logger[_0x39e8('0xb')]('[%s][TAG]\x20%s',_0x467742,_['isObject'](_0x4d797d)?JSON[_0x39e8('0x17')](_0x4d797d):_0x4d797d);logger[_0x39e8('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x467742);_0x5dc0d0['next']();}};}; \ No newline at end of file +var _0xc8a3=['Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel'];(function(_0x364db1,_0x17ff9f){var _0x3fb823=function(_0x3f51de){while(--_0x3f51de){_0x364db1['push'](_0x364db1['shift']());}};_0x3fb823(++_0x17ff9f);}(_0xc8a3,0x70));var _0x3c8a=function(_0x562ce0,_0x1ebe08){_0x562ce0=_0x562ce0-0x0;var _0x14c632=_0xc8a3[_0x562ce0];return _0x14c632;};'use strict';var schema=require(_0x3c8a('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x3c8a('0x1')),'openchannelInteraction':require(_0x3c8a('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x3c8a('0x3')),'whatsappInteraction':require(_0x3c8a('0x4'))};var logger=require(_0x3c8a('0x5'))(_0x3c8a('0x6'));var tag=schema({'tag':{'type':_0x3c8a('0x7'),'required':!![],'message':_0x3c8a('0x8')}});exports['consequence']=function(_0x42fa92,_0x5bbd40,_0xcdd97b,_0x5daae0){return function(_0xb07148){try{var _0x3d9c09={'tag':_0x5bbd40[0x0]};var _0x485305=tag[_0x3c8a('0x0')](_0x3d9c09,{'typecast':!![]});if(_0x485305[_0x3c8a('0x9')]){logger[_0x3c8a('0xa')](_0x3c8a('0xb'),_0x42fa92,_[_0x3c8a('0xc')](_0x485305,_0x3c8a('0xd'))[_0x3c8a('0xe')](',\x20'));logger[_0x3c8a('0xf')](_0x3c8a('0x10'),_0x42fa92);_0xb07148['next']();}else{var _0x1d5ac0={'ids':[_0x5bbd40[0x0]]};if(rpc[_0x5daae0[_0x3c8a('0x11')]+'Interaction']){rpc[_0x5daae0[_0x3c8a('0x11')]+_0x3c8a('0x12')][_0x3c8a('0x13')](_0x5daae0[_0x3c8a('0x14')]['id'],_0x1d5ac0)[_0x3c8a('0x15')](function(_0x4006b9){logger['info'](_0x3c8a('0x16'),_0x42fa92,_0x5bbd40[0x1],_0x5daae0[_0x3c8a('0x11')],_0x5daae0[_0x3c8a('0x14')]['id']);})['catch'](function(_0x242f24){logger[_0x3c8a('0xa')](_0x3c8a('0xb'),_0x42fa92,JSON[_0x3c8a('0x17')](_0x242f24));logger[_0x3c8a('0xf')](_0x3c8a('0x10'),_0x42fa92);})[_0x3c8a('0x18')](function(){_0xb07148[_0x3c8a('0x19')]();});}}}catch(_0x123a9b){logger[_0x3c8a('0xa')](_0x3c8a('0xb'),_0x42fa92,_['isObject'](_0x123a9b)?JSON[_0x3c8a('0x17')](_0x123a9b):_0x123a9b);logger[_0x3c8a('0xf')](_0x3c8a('0x10'),_0x42fa92);_0xb07148[_0x3c8a('0x19')]();}};}; \ 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 1ee4c1e..f7831ad 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 _0x30ec=['urlOnAnswer','urlOnRing','jsonrpc','method','login','params','stringify','utf8','POST','then','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','consequence','\x20-\x20','replace','push'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0x30ec,0x11c));var _0xc30e=function(_0x5484cf,_0x153f52){_0x5484cf=_0x5484cf-0x0;var _0x5b7de7=_0x30ec[_0x5484cf];return _0x5b7de7;};'use strict';var rp=require(_0xc30e('0x0'));var logger=require(_0xc30e('0x1'))('routing');var _=require('lodash');var arr=[];exports[_0xc30e('0x2')]=function(_0x29912d,_0x2754e2){return function(_0x363e5c){var _0x34803f=_0x2754e2[0xa];var _0xb3cda2=_0x2754e2[0xb];var _0x5308b9=_0x2754e2[0xc];var _0x82fc6b=_0x2754e2[0xd];var _0x49d907=_0x2754e2[0xe];var _0x196f15=_0x2754e2[0xf]['replace'](/\n/g,_0xc30e('0x3'));var _0x2af6f1=_0x2754e2[0x10][_0xc30e('0x4')](/\n/g,'\x20');if(!arr['includes'](_0xb3cda2)){arr[_0xc30e('0x5')](_0xb3cda2);var _0x3611d7=_0x2754e2[0x3];var _0xb676e1=_0x2754e2[0x4];var _0x1b62a5=_0x2754e2[0x1];var _0xc73e8d=_0x2754e2[0x0];var _0x48374b={};_0x48374b[_0xc30e('0x6')]=_0x2754e2[0x8]+'?params='+_0x5308b9+'|'+_0x34803f+'|'+_0x82fc6b+'|'+_0xb3cda2+'|'+_0x49d907;_0x48374b[_0xc30e('0x7')]=_0x2754e2[0x7]+'?params='+_0x5308b9+'|'+_0x34803f+'|'+_0x82fc6b+'|'+_0xb3cda2+'|'+_0x49d907+'|'+_0x196f15+'|'+_0x2af6f1;_0x48374b['title']=_0x2754e2[0x9];var _0x1a9b38={};_0x1a9b38[_0xc30e('0x8')]='2.0';_0x1a9b38[_0xc30e('0x9')]=_0xc30e('0xa');var _0x113695=[];_0x113695[_0xc30e('0x5')](_0x2754e2[0x2]);_0x113695[_0xc30e('0x5')](_0x2754e2[0x5]);_0x113695['push'](_0x2754e2[0x6]);_0x1a9b38[_0xc30e('0xb')]=_0x113695;_0x1a9b38['id']=0x1;var _0x3ebce3=JSON[_0xc30e('0xc')](_0x1a9b38);var _0x2f80b2={'encoding':_0xc30e('0xd'),'method':_0xc30e('0xe'),'timeout':0x2710,'url':_0x3611d7,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3ebce3};return rp(_0x2f80b2)[_0xc30e('0xf')](function(_0x44ac0b){const _0x2f8f0d=JSON['parse'](_0x44ac0b);if(!_0x2f8f0d['result'][_0xc30e('0x10')]){throw new Error(_0xc30e('0x11'));}var _0x293f98=_0xb3cda2;var _0x4d3f59=_0xc30e('0x12')+_0x1b62a5+_0xc30e('0x13')+_0xc73e8d+_0xc30e('0x14')+_0x293f98+'&data='+JSON[_0xc30e('0xc')](_0x48374b);var _0x306211=_0xb676e1+'?'+_0x4d3f59;return rp(_0x306211);})['then'](function(_0x54bf83){logger[_0xc30e('0x15')](_0xc30e('0x16'),_0x29912d,_0x54bf83);_0x363e5c[_0xc30e('0x17')]();})[_0xc30e('0x18')](function(_0x5c2d73){logger['error'](_0xc30e('0x19'),_0x29912d,_[_0xc30e('0x1a')](_0x5c2d73)?JSON[_0xc30e('0xc')](_0x5c2d73):_0x5c2d73);_0x363e5c['stop']();});}else{logger['info'](_0xc30e('0x1b'),_0x29912d);_0x363e5c[_0xc30e('0x1c')]();}};}; \ No newline at end of file +var _0x411c=['next','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','title','2.0','method','push','params','stringify','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x411c,0x156));var _0xc411=function(_0x56abec,_0x19ff2c){_0x56abec=_0x56abec-0x0;var _0x210fd1=_0x411c[_0x56abec];return _0x210fd1;};'use strict';var rp=require('request-promise');var logger=require(_0xc411('0x0'))('routing');var _=require(_0xc411('0x1'));var arr=[];exports[_0xc411('0x2')]=function(_0x2e72c7,_0xbd175f){return function(_0x3b4ff4){var _0x4154e6=_0xbd175f[0xa];var _0x1d82d1=_0xbd175f[0xb];var _0x158b59=_0xbd175f[0xc];var _0x3e37d5=_0xbd175f[0xd];var _0x545105=_0xbd175f[0xe];var _0x5aebd6=_0xbd175f[0xf][_0xc411('0x3')](/\n/g,_0xc411('0x4'));var _0x36e20a=_0xbd175f[0x10][_0xc411('0x3')](/\n/g,'\x20');if(!arr[_0xc411('0x5')](_0x1d82d1)){arr['push'](_0x1d82d1);var _0x312797=_0xbd175f[0x3];var _0x1eedde=_0xbd175f[0x4];var _0x1ac6ab=_0xbd175f[0x1];var _0x208521=_0xbd175f[0x0];var _0x379083={};_0x379083[_0xc411('0x6')]=_0xbd175f[0x8]+'?params='+_0x158b59+'|'+_0x4154e6+'|'+_0x3e37d5+'|'+_0x1d82d1+'|'+_0x545105;_0x379083['urlOnRing']=_0xbd175f[0x7]+_0xc411('0x7')+_0x158b59+'|'+_0x4154e6+'|'+_0x3e37d5+'|'+_0x1d82d1+'|'+_0x545105+'|'+_0x5aebd6+'|'+_0x36e20a;_0x379083[_0xc411('0x8')]=_0xbd175f[0x9];var _0x1a7edc={};_0x1a7edc['jsonrpc']=_0xc411('0x9');_0x1a7edc[_0xc411('0xa')]='login';var _0x4cc374=[];_0x4cc374[_0xc411('0xb')](_0xbd175f[0x2]);_0x4cc374[_0xc411('0xb')](_0xbd175f[0x5]);_0x4cc374[_0xc411('0xb')](_0xbd175f[0x6]);_0x1a7edc[_0xc411('0xc')]=_0x4cc374;_0x1a7edc['id']=0x1;var _0x4fa004=JSON[_0xc411('0xd')](_0x1a7edc);var _0x5cab50={'encoding':'utf8','method':_0xc411('0xe'),'timeout':0x2710,'url':_0x312797,'headers':{'Content-Type':_0xc411('0xf')},'body':_0x4fa004};return rp(_0x5cab50)[_0xc411('0x10')](function(_0x160bb8){const _0x20ecb2=JSON[_0xc411('0x11')](_0x160bb8);if(!_0x20ecb2['result'][_0xc411('0x12')]){throw new Error(_0xc411('0x13'));}var _0x18b677=_0x1d82d1;var _0x2a3672=_0xc411('0x14')+_0x1ac6ab+_0xc411('0x15')+_0x208521+_0xc411('0x16')+_0x18b677+'&data='+JSON[_0xc411('0xd')](_0x379083);var _0x534ba6=_0x1eedde+'?'+_0x2a3672;return rp(_0x534ba6);})[_0xc411('0x10')](function(_0x275054){logger[_0xc411('0x17')](_0xc411('0x18'),_0x2e72c7,_0x275054);_0x3b4ff4['stop']();})[_0xc411('0x19')](function(_0x4e1e68){logger['error'](_0xc411('0x1a'),_0x2e72c7,_[_0xc411('0x1b')](_0x4e1e68)?JSON[_0xc411('0xd')](_0x4e1e68):_0x4e1e68);_0x3b4ff4[_0xc411('0x1c')]();});}else{logger['info'](_0xc411('0x1d'),_0x2e72c7);_0x3b4ff4[_0xc411('0x1e')]();}};}; \ 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 b19cacb..2ef9001 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x6dccae,_0x4737ef){var _0x497e46=function(_0x5c824d){while(--_0x5c824d){_0x6dccae['push'](_0x6dccae['shift']());}};_0x497e46(++_0x4737ef);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x4db75f,_0x4aae97){var _0x2979bf=function(_0x431dc7){while(--_0x431dc7){_0x4db75f['push'](_0x4db75f['shift']());}};_0x2979bf(++_0x4aae97);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 77b7c6e..0eb9a8c 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 _0xa653=['../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','app','.js','autoreply','split','push','slice','join','dialogflow','appdata','dialogflowv2','TagId','getMustacheRender','account','ChatWebsiteId','ContactId','body','format','%s:%s:%s','condition','intervals','priority','Push\x20new\x20rule','on\x20interval','error','execute','info','Applications\x20executed','stringify','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xa653,0x112));var _0x3a65=function(_0x1732ff,_0x21afca){_0x1732ff=_0x1732ff-0x0;var _0x34d943=_0xa653[_0x1732ff];return _0x34d943;};'use strict';var _=require(_0x3a65('0x0'));var util=require(_0x3a65('0x1'));var path=require(_0x3a65('0x2'));var fs=require('fs');var jayson=require(_0x3a65('0x3'));var BPromise=require(_0x3a65('0x4'));var utils=require(_0x3a65('0x5'));var sUtils=require(_0x3a65('0x6'));var logger=require(_0x3a65('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x3a65('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x3a65('0x9')),'smsQueueReport':require(_0x3a65('0xa')),'faxQueueReport':require(_0x3a65('0xb')),'whatsappQueueReport':require(_0x3a65('0xc'))};var RuleEngine=require(_0x3a65('0xd'));function getId(_0x5a1849,_0x45f860,_0xfd4379){return util['format'](_0x3a65('0xe'),_0x5a1849,_0x45f860||0x0,_0xfd4379||0x0);}function getIntervals(_0x58f59f,_0x56d30a){var _0x3d0a56=[];if(!_[_0x3a65('0xf')](_0x56d30a[_0x3a65('0x10')])&&!_[_0x3a65('0xf')](_0x58f59f[_0x56d30a[_0x3a65('0x10')]])&&!_[_0x3a65('0xf')](_0x58f59f[_0x56d30a[_0x3a65('0x10')]][_0x3a65('0x11')])){_0x3d0a56=_['map'](_0x58f59f[_0x56d30a[_0x3a65('0x10')]][_0x3a65('0x11')],_0x3a65('0x12'));}else if(!_[_0x3a65('0xf')](_0x56d30a[_0x3a65('0x12')])){_0x3d0a56=[_0x56d30a[_0x3a65('0x12')]];}return _0x3d0a56;}exports['listen']=function(_0x2ab2c9){_0x2ab2c9[_0x3a65('0x13')]={};return new BPromise(function(_0x1d07d9,_0x3bcfd4){var _0x36d2cb={'Start':function(_0x10c07e){var _0x273b8f=this;return new Promise(function(_0x2b9031,_0x2c9662){if(_0x10c07e){try{var _0x294b3c=[];var _0x296057=getId(_0x10c07e[_0x3a65('0x14')],_0x10c07e[_0x3a65('0x15')]?_0x10c07e['message']['id']:0x0,_0x10c07e[_0x3a65('0x16')]?_0x10c07e[_0x3a65('0x16')]['id']:0x0);var _0x331dee=sUtils[_0x3a65('0x17')](_0x2ab2c9,_0x10c07e);if(!_0x331dee&&_0x10c07e['applications']&&_[_0x3a65('0x18')](_0x10c07e[_0x3a65('0x19')])&&_0x10c07e[_0x3a65('0x19')]['length']){for(var _0xfd6863=0x0;_0xfd6863<_0x10c07e['applications'][_0x3a65('0x1a')];_0xfd6863+=0x1){var _0x238af2=_0x10c07e['applications'][_0xfd6863];if(fs[_0x3a65('0x1b')](path['join'](__dirname,_0x3a65('0x19'),_0x238af2[_0x3a65('0x1c')]+_0x3a65('0x1d')))){var _0x155f03=[];switch(_0x238af2[_0x3a65('0x1c')]['toLowerCase']()){case _0x3a65('0x1e'):var _0x58d328=_0x238af2['appdata'][_0x3a65('0x1f')](',');if(_0x10c07e[_0x3a65('0x14')]==='mail'){_0x155f03[_0x3a65('0x20')](_0x58d328[0x0]);_0x155f03['push'](_0x58d328[0x1]);_0x155f03[_0x3a65('0x20')](_0x58d328[_0x3a65('0x21')](0x2,_0x58d328[_0x3a65('0x1a')])[_0x3a65('0x22')](','));}else{_0x155f03['push'](_0x58d328[0x0]);_0x155f03[_0x3a65('0x20')](_0x58d328[_0x3a65('0x21')](0x1,_0x58d328[_0x3a65('0x1a')])['join'](','));}break;case _0x3a65('0x23'):var _0x4529ca=_0x238af2[_0x3a65('0x24')]['split'](',');_0x155f03[_0x3a65('0x20')](_0x4529ca[0x0]);_0x155f03[_0x3a65('0x20')](_0x4529ca[0x1]);_0x155f03[_0x3a65('0x20')](_0x4529ca['slice'](0x2,_0x4529ca[_0x3a65('0x1a')])[_0x3a65('0x22')](','));break;case _0x3a65('0x25'):var _0x44ec7d=_0x238af2[_0x3a65('0x24')][_0x3a65('0x1f')](',');_0x155f03[_0x3a65('0x20')](_0x44ec7d[0x0]);_0x155f03[_0x3a65('0x20')](_0x44ec7d[0x1]);_0x155f03['push'](_0x44ec7d[0x2]);_0x155f03[_0x3a65('0x20')](_0x44ec7d[0x3]);_0x155f03['push'](_0x44ec7d[_0x3a65('0x21')](0x4,_0x44ec7d[_0x3a65('0x1a')])[_0x3a65('0x22')](','));break;case'amazonlex':var _0x242f61=_0x238af2['appdata']['split'](',');_0x155f03['push'](_0x242f61[0x0]);_0x155f03[_0x3a65('0x20')](_0x242f61[0x1]);_0x155f03[_0x3a65('0x20')](_0x242f61[0x2]);_0x155f03[_0x3a65('0x20')](_0x242f61[0x3]);_0x155f03[_0x3a65('0x20')](_0x242f61['slice'](0x4,_0x242f61[_0x3a65('0x1a')])[_0x3a65('0x22')](','));break;case _0x3a65('0x15'):_0x155f03[_0x3a65('0x20')](_0x238af2[_0x3a65('0x24')]);break;case'tag':_0x155f03['push'](_0x238af2[_0x3a65('0x26')]);_0x155f03[_0x3a65('0x20')](_0x238af2['appdata']);break;case'tvox':var _0x284157=utils[_0x3a65('0x27')](_0x10c07e[_0x3a65('0x28')]['notificationTemplate'],_0x10c07e);var _0x54bf0e=_0x238af2[_0x3a65('0x24')][_0x3a65('0x1f')](',');_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x0]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x1]);_0x155f03['push'](_0x54bf0e[0x2]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x3]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x4]);_0x155f03['push'](_0x54bf0e[0x5]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x6]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x7]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x8]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0x9]);_0x155f03[_0x3a65('0x20')](_0x54bf0e[0xa]);_0x155f03[_0x3a65('0x20')](_0x10c07e[_0x3a65('0x16')]['id']);_0x155f03[_0x3a65('0x20')](_0x10c07e[_0x3a65('0x15')]['id']);_0x155f03['push'](_0x238af2[_0x3a65('0x29')]);_0x155f03['push'](_0x10c07e[_0x3a65('0x16')][_0x3a65('0x2a')]);_0x155f03[_0x3a65('0x20')](_0x10c07e[_0x3a65('0x2b')][_0x3a65('0x2b')]);_0x155f03[_0x3a65('0x20')](_0x284157);break;default:_0x155f03=_[_0x3a65('0xf')](_0x238af2[_0x3a65('0x24')])?[]:_0x238af2['appdata']['split'](',');}var _0x5ea50e={'id':util[_0x3a65('0x2c')](_0x3a65('0x2d'),_0x296057,_0x238af2['id'],_0x238af2[_0x3a65('0x1c')]),'condition':require('./interval')[_0x3a65('0x2e')](_0x296057,getIntervals(_0x2ab2c9[_0x3a65('0x2f')],_0x238af2),_0x2ab2c9),'consequence':require('./applications/'+_0x238af2[_0x3a65('0x1c')])['consequence'](_0x296057,_0x155f03,_0x2ab2c9,_0x10c07e),'p':_0x238af2[_0x3a65('0x30')]||0x0};logger['info'](_0x3a65('0x31'),_0x5ea50e['id'],_0x3a65('0x32'),getIntervals(_0x2ab2c9[_0x3a65('0x2f')],_0x238af2)[_0x3a65('0x22')]('\x20|\x20'));_0x294b3c[_0x3a65('0x20')](_0x5ea50e);}else{logger[_0x3a65('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x3a65('0x19'),_0x238af2[_0x3a65('0x1c')]+'.js'));}}_0x2ab2c9[_0x3a65('0x13')][_0x296057]=new RuleEngine(_0x294b3c);_0x2ab2c9[_0x3a65('0x13')][_0x296057][_0x3a65('0x34')](_0x10c07e,function(_0x8289f2){logger[_0x3a65('0x35')](_0x3a65('0x36'),JSON[_0x3a65('0x37')](_0x8289f2['matchPath']));if(_0x2ab2c9[_0x3a65('0x13')][_0x296057]){_0x2ab2c9[_0x3a65('0x13')][_0x296057]['emit']('complete');}});return _0x2b9031({'code':0xc8,'message':_0x10c07e});}else{if(_0x331dee){logger[_0x3a65('0x35')](util['format'](_0x3a65('0x38'),_0x296057));}else{logger[_0x3a65('0x35')](_0x3a65('0x39'));}return _0x2b9031({'code':0xc8,'message':_0x10c07e});}}catch(_0x3c0926){logger[_0x3a65('0x33')](_0x3c0926[_0x3a65('0x3a')]);return _0x2c9662(_0x273b8f[_0x3a65('0x33')](0x1f4,_0x3c0926));}}return _0x2c9662('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5f1e3f){var _0x3df574=this;return new Promise(function(_0x179b47,_0x211144){if(_0x5f1e3f[_0x3a65('0x3b')]&&_0x5f1e3f[_0x3a65('0x3b')]['id']){if(_0x2ab2c9[_0x3a65('0x3c')][_0x5f1e3f[_0x3a65('0x3b')]['id']]){_0x2ab2c9[_0x3a65('0x3c')][_0x5f1e3f[_0x3a65('0x3b')]['id']][_0x3a65('0x3d')]=![];_0x2ab2c9[_0x3a65('0x3c')][_0x5f1e3f[_0x3a65('0x3b')]['id']][_0x3a65('0x3e')]=undefined;}}if(_0x5f1e3f[_0x3a65('0x15')]&&_0x5f1e3f[_0x3a65('0x15')]['id']){try{var _0x109cd7=getId(_0x5f1e3f[_0x3a65('0x14')],_0x5f1e3f[_0x3a65('0x15')]?_0x5f1e3f[_0x3a65('0x15')]['id']:0x0,_0x5f1e3f[_0x3a65('0x16')]?_0x5f1e3f[_0x3a65('0x16')]['id']:0x0);if(_0x2ab2c9[_0x3a65('0x13')][_0x109cd7]){_0x2ab2c9['rules'][_0x109cd7]['emit'](_0x3a65('0x3f'));if(rpc[_0x5f1e3f[_0x3a65('0x14')]+'QueueReport']){rpc[_0x5f1e3f['channel']+'QueueReport'][_0x3a65('0x40')](_0x109cd7,{'UserId':_0x5f1e3f[_0x3a65('0x15')][_0x3a65('0x41')]})['catch'](function(){logger[_0x3a65('0x33')](_0x3a65('0x42'));});}}return _0x179b47({'code':0xc8,'message':_0x5f1e3f});}catch(_0x4d3ceb){logger[_0x3a65('0x33')](_0x4d3ceb[_0x3a65('0x3a')]);return _0x211144(_0x3df574['error'](0x1f4,_0x4d3ceb));}}logger[_0x3a65('0x33')](_0x3a65('0x43'));return _0x211144(_0x3df574['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x14f3b1){var _0xbdf406=this;return new Promise(function(_0x20ee38,_0x31d3e9){if(_0x14f3b1['agent']&&_0x14f3b1[_0x3a65('0x3b')]['id']){try{if(_0x2ab2c9[_0x3a65('0x3c')][_0x14f3b1[_0x3a65('0x3b')]['id']]){_0x2ab2c9[_0x3a65('0x3c')][_0x14f3b1[_0x3a65('0x3b')]['id']][_0x3a65('0x3d')]=![];_0x2ab2c9[_0x3a65('0x3c')][_0x14f3b1[_0x3a65('0x3b')]['id']][_0x3a65('0x3e')]=undefined;}return _0x20ee38({'code':0xc8,'message':_0x14f3b1});}catch(_0x198a77){logger['error'](_0x198a77[_0x3a65('0x3a')]);return _0x31d3e9(_0xbdf406['error'](0x1f4,_0x198a77));}}logger[_0x3a65('0x33')](_0x3a65('0x43'));return _0x31d3e9(_0xbdf406[_0x3a65('0x33')](0x1f4,_0x3a65('0x43')));});},'AbandonInteraction':function(_0x14ca98){var _0x43be31=this;return new Promise(function(_0x11093d,_0x15634c){if(_0x14ca98[_0x3a65('0x14')]&&_0x14ca98['interaction']&&_0x14ca98[_0x3a65('0x16')]['id']){try{var _0x1d4848=getId(_0x14ca98[_0x3a65('0x14')],_0x14ca98[_0x3a65('0x15')]?_0x14ca98[_0x3a65('0x15')]['id']:0x0,_0x14ca98[_0x3a65('0x16')]?_0x14ca98[_0x3a65('0x16')]['id']:0x0);if(_0x2ab2c9['rules'][_0x1d4848]){_0x2ab2c9[_0x3a65('0x13')][_0x1d4848][_0x3a65('0x44')](_0x3a65('0x3f'));}return _0x11093d({'code':0xc8,'message':_0x14ca98});}catch(_0x56fbd8){logger[_0x3a65('0x33')](_0x56fbd8['stack']);return _0x15634c(_0x43be31[_0x3a65('0x33')](0x1f4,_0x56fbd8));}}logger['error'](_0x3a65('0x43'));return _0x15634c(_0x43be31[_0x3a65('0x33')](0x1f4,_0x3a65('0x43')));});},'AgentCapacity':function(_0x174ffa){var _0x1f0558=this;return new Promise(function(_0x2a95d0,_0xedba4a){if(_0x2ab2c9['agents'][_0x3a65('0x45')](_0x174ffa['id'])){for(var _0x334628 in _0x174ffa['capacity']){if(_0x174ffa[_0x3a65('0x46')][_0x3a65('0x45')](_0x334628)){if(_0x2ab2c9[_0x3a65('0x3c')][_0x174ffa['id']][_0x3a65('0x45')](_0x334628+_0x3a65('0x47'))){_0x2ab2c9[_0x3a65('0x3c')][_0x174ffa['id']][_0x334628+'CurrentCapacity']=parseInt(_0x174ffa['capacity'][_0x334628],0xa);}}}_0x2ab2c9['agents'][_0x174ffa['id']]['updateRealtime']();return _0x2a95d0({'code':0xc8,'message':_0x2ab2c9[_0x3a65('0x3c')][_0x174ffa['id']]});}else{return _0xedba4a(_0x1f0558['error'](0x1f4,_0x3a65('0x48')));}});},'Agents':function(_0x5282ce){return new Promise(function(_0xb7fb7e){var _0x1997b9=_[_0x3a65('0x49')](_0x2ab2c9[_0x3a65('0x3c')]);if(_0x5282ce&&_0x5282ce['id']){var _0x5daa73=_[_0x3a65('0x4a')](_0x1997b9,function(_0x13c269){return _0x13c269['id']===_0x5282ce['id'];});_0xb7fb7e(_0x5daa73);}else{_0xb7fb7e({'count':_0x1997b9[_0x3a65('0x1a')],'rows':_0x1997b9});}});},'ChatQueues':function(){return new Promise(function(_0x2b2ba8){var _0xe7866=[];for(var _0x4e38a7 in _0x2ab2c9[_0x3a65('0x4b')]){if(_0x2ab2c9[_0x3a65('0x4b')][_0x3a65('0x45')](_0x4e38a7)){var _0x55e272=_0x2ab2c9[_0x3a65('0x4b')][_0x4e38a7];var _0xcbf24d={'id':_0x55e272['id'],'available':_0x55e272[_0x3a65('0x4c')],'loggedIn':_0x55e272['loggedIn'],'name':_0x55e272[_0x3a65('0x4d')],'paused':_0x55e272[_0x3a65('0x4e')],'waiting':_0x55e272[_0x3a65('0x4f')]};_0xe7866['push'](_0xcbf24d);}}_0x2b2ba8({'count':_0xe7866[_0x3a65('0x1a')],'rows':_0xe7866});});},'MailQueues':function(){return new Promise(function(_0x4c7d07){var _0x519ec3=[];for(var _0x598fb7 in _0x2ab2c9[_0x3a65('0x50')]){if(_0x2ab2c9[_0x3a65('0x50')][_0x3a65('0x45')](_0x598fb7)){var _0x1b7a83=_0x2ab2c9[_0x3a65('0x50')][_0x598fb7];var _0x287d25={'id':_0x1b7a83['id'],'available':_0x1b7a83[_0x3a65('0x4c')],'loggedIn':_0x1b7a83['loggedIn'],'name':_0x1b7a83[_0x3a65('0x4d')],'paused':_0x1b7a83['paused'],'waiting':_0x1b7a83[_0x3a65('0x4f')]};_0x519ec3['push'](_0x287d25);}}_0x4c7d07({'count':_0x519ec3[_0x3a65('0x1a')],'rows':_0x519ec3});});},'OpenchannelQueues':function(){return new Promise(function(_0x832eba){var _0x568655=[];for(var _0x4f09ae in _0x2ab2c9[_0x3a65('0x51')]){if(_0x2ab2c9[_0x3a65('0x51')]['hasOwnProperty'](_0x4f09ae)){var _0x5a96eb=_0x2ab2c9[_0x3a65('0x51')][_0x4f09ae];var _0x1788c0={'id':_0x5a96eb['id'],'available':_0x5a96eb[_0x3a65('0x4c')],'loggedIn':_0x5a96eb[_0x3a65('0x52')],'name':_0x5a96eb[_0x3a65('0x4d')],'paused':_0x5a96eb[_0x3a65('0x4e')],'waiting':_0x5a96eb[_0x3a65('0x4f')]};_0x568655[_0x3a65('0x20')](_0x1788c0);}}_0x832eba({'count':_0x568655[_0x3a65('0x1a')],'rows':_0x568655});});},'SmsQueues':function(){return new Promise(function(_0x36b6f9){var _0x43bbe8=[];for(var _0x3693a3 in _0x2ab2c9['smsQueues']){if(_0x2ab2c9[_0x3a65('0x53')]['hasOwnProperty'](_0x3693a3)){var _0x4c5007=_0x2ab2c9[_0x3a65('0x53')][_0x3693a3];var _0x4a9fb6={'id':_0x4c5007['id'],'available':_0x4c5007[_0x3a65('0x4c')],'loggedIn':_0x4c5007[_0x3a65('0x52')],'name':_0x4c5007[_0x3a65('0x4d')],'paused':_0x4c5007[_0x3a65('0x4e')],'waiting':_0x4c5007[_0x3a65('0x4f')]};_0x43bbe8[_0x3a65('0x20')](_0x4a9fb6);}}_0x36b6f9({'count':_0x43bbe8[_0x3a65('0x1a')],'rows':_0x43bbe8});});},'FaxQueues':function(){return new Promise(function(_0x51c283){var _0x4e755d=[];for(var _0x49256d in _0x2ab2c9[_0x3a65('0x54')]){if(_0x2ab2c9[_0x3a65('0x54')][_0x3a65('0x45')](_0x49256d)){var _0x584dc8=_0x2ab2c9[_0x3a65('0x54')][_0x49256d];var _0x36023d={'id':_0x584dc8['id'],'available':_0x584dc8[_0x3a65('0x4c')],'loggedIn':_0x584dc8[_0x3a65('0x52')],'name':_0x584dc8[_0x3a65('0x4d')],'paused':_0x584dc8['paused'],'waiting':_0x584dc8[_0x3a65('0x4f')]};_0x4e755d['push'](_0x36023d);}}_0x51c283({'count':_0x4e755d[_0x3a65('0x1a')],'rows':_0x4e755d});});},'WhatsappQueues':function(){return new Promise(function(_0x3334c1){var _0xef5660=[];for(var _0x30ea4e in _0x2ab2c9[_0x3a65('0x55')]){if(_0x2ab2c9[_0x3a65('0x55')][_0x3a65('0x45')](_0x30ea4e)){var _0x2fad06=_0x2ab2c9[_0x3a65('0x55')][_0x30ea4e];var _0xba07e4={'id':_0x2fad06['id'],'available':_0x2fad06[_0x3a65('0x4c')],'loggedIn':_0x2fad06[_0x3a65('0x52')],'name':_0x2fad06[_0x3a65('0x4d')],'paused':_0x2fad06['paused'],'waiting':_0x2fad06[_0x3a65('0x4f')]};_0xef5660[_0x3a65('0x20')](_0xba07e4);}}_0x3334c1({'count':_0xef5660['length'],'rows':_0xef5660});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4ab970){var _0x516acb=_['values'](_0x2ab2c9[_0x3a65('0x56')]);_0x4ab970({'count':_0x516acb[_0x3a65('0x1a')],'rows':_0x516acb});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1af9f2){var _0xc379a5=_[_0x3a65('0x49')](_0x2ab2c9['mailQueuesWaitingInteractions']);_0x1af9f2({'count':_0xc379a5[_0x3a65('0x1a')],'rows':_0xc379a5});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x313dc3){var _0x4a8b57=_[_0x3a65('0x49')](_0x2ab2c9['openchannelQueuesWaitingInteractions']);_0x313dc3({'count':_0x4a8b57[_0x3a65('0x1a')],'rows':_0x4a8b57});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5448d3){var _0x3ada48=_['values'](_0x2ab2c9[_0x3a65('0x57')]);_0x5448d3({'count':_0x3ada48['length'],'rows':_0x3ada48});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4a7258){var _0xab498c=_[_0x3a65('0x49')](_0x2ab2c9[_0x3a65('0x58')]);_0x4a7258({'count':_0xab498c[_0x3a65('0x1a')],'rows':_0xab498c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x330b15){var _0x49ebe7=_[_0x3a65('0x49')](_0x2ab2c9['whatsappQueuesWaitingInteractions']);_0x330b15({'count':_0x49ebe7[_0x3a65('0x1a')],'rows':_0x49ebe7});});}};var _0x12214a=jayson[_0x3a65('0x59')](_0x36d2cb)[_0x3a65('0x5a')]();_0x12214a['on'](_0x3a65('0x33'),function(_0x5009ac){logger[_0x3a65('0x33')](JSON['stringify'](_0x5009ac));return _0x3bcfd4(_0x5009ac);});_0x12214a[_0x3a65('0x5b')](0x232c,_0x3a65('0x5c'),function(){console[_0x3a65('0x5d')](_0x3a65('0x5e'),0x232c);return _0x1d07d9('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x466c=['chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues'];(function(_0x14be3a,_0x301ddc){var _0xd4e7c9=function(_0x382699){while(--_0x382699){_0x14be3a['push'](_0x14be3a['shift']());}};_0xd4e7c9(++_0x301ddc);}(_0x466c,0x1ac));var _0xc466=function(_0x330304,_0x4e9347){_0x330304=_0x330304-0x0;var _0x288a85=_0x466c[_0x330304];return _0x288a85;};'use strict';var _=require(_0xc466('0x0'));var util=require(_0xc466('0x1'));var path=require(_0xc466('0x2'));var fs=require('fs');var jayson=require(_0xc466('0x3'));var BPromise=require(_0xc466('0x4'));var utils=require(_0xc466('0x5'));var sUtils=require(_0xc466('0x6'));var logger=require(_0xc466('0x7'))(_0xc466('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc466('0x9')),'chatQueueReport':require(_0xc466('0xa')),'smsQueueReport':require(_0xc466('0xb')),'faxQueueReport':require(_0xc466('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xc466('0xd'));function getId(_0x580869,_0x2ac866,_0x180ed1){return util[_0xc466('0xe')](_0xc466('0xf'),_0x580869,_0x2ac866||0x0,_0x180ed1||0x0);}function getIntervals(_0x2d3db6,_0x44f163){var _0x8544d=[];if(!_[_0xc466('0x10')](_0x44f163[_0xc466('0x11')])&&!_[_0xc466('0x10')](_0x2d3db6[_0x44f163[_0xc466('0x11')]])&&!_[_0xc466('0x10')](_0x2d3db6[_0x44f163['IntervalId']][_0xc466('0x12')])){_0x8544d=_[_0xc466('0x13')](_0x2d3db6[_0x44f163['IntervalId']]['Intervals'],_0xc466('0x14'));}else if(!_['isNil'](_0x44f163[_0xc466('0x14')])){_0x8544d=[_0x44f163[_0xc466('0x14')]];}return _0x8544d;}exports[_0xc466('0x15')]=function(_0x203971){_0x203971[_0xc466('0x16')]={};return new BPromise(function(_0x49c7ff,_0x4462b6){var _0x447184={'Start':function(_0x32b22b){var _0x5be7f8=this;return new Promise(function(_0x4a5201,_0x22fec3){if(_0x32b22b){try{var _0x251b55=[];var _0x509368=getId(_0x32b22b[_0xc466('0x17')],_0x32b22b[_0xc466('0x18')]?_0x32b22b['message']['id']:0x0,_0x32b22b[_0xc466('0x19')]?_0x32b22b[_0xc466('0x19')]['id']:0x0);var _0x29db36=sUtils[_0xc466('0x1a')](_0x203971,_0x32b22b);if(!_0x29db36&&_0x32b22b[_0xc466('0x1b')]&&_[_0xc466('0x1c')](_0x32b22b[_0xc466('0x1b')])&&_0x32b22b[_0xc466('0x1b')][_0xc466('0x1d')]){for(var _0x11a119=0x0;_0x11a119<_0x32b22b[_0xc466('0x1b')][_0xc466('0x1d')];_0x11a119+=0x1){var _0x5cedee=_0x32b22b[_0xc466('0x1b')][_0x11a119];if(fs[_0xc466('0x1e')](path['join'](__dirname,_0xc466('0x1b'),_0x5cedee[_0xc466('0x1f')]+_0xc466('0x20')))){var _0x50fd1d=[];switch(_0x5cedee[_0xc466('0x1f')][_0xc466('0x21')]()){case _0xc466('0x22'):var _0x48b9ae=_0x5cedee[_0xc466('0x23')][_0xc466('0x24')](',');if(_0x32b22b[_0xc466('0x17')]===_0xc466('0x25')){_0x50fd1d[_0xc466('0x26')](_0x48b9ae[0x0]);_0x50fd1d[_0xc466('0x26')](_0x48b9ae[0x1]);_0x50fd1d['push'](_0x48b9ae[_0xc466('0x27')](0x2,_0x48b9ae['length'])[_0xc466('0x28')](','));}else{_0x50fd1d[_0xc466('0x26')](_0x48b9ae[0x0]);_0x50fd1d[_0xc466('0x26')](_0x48b9ae[_0xc466('0x27')](0x1,_0x48b9ae[_0xc466('0x1d')])[_0xc466('0x28')](','));}break;case _0xc466('0x29'):var _0x1199da=_0x5cedee[_0xc466('0x23')]['split'](',');_0x50fd1d[_0xc466('0x26')](_0x1199da[0x0]);_0x50fd1d['push'](_0x1199da[0x1]);_0x50fd1d[_0xc466('0x26')](_0x1199da['slice'](0x2,_0x1199da[_0xc466('0x1d')])[_0xc466('0x28')](','));break;case _0xc466('0x2a'):var _0x8cfb85=_0x5cedee['appdata'][_0xc466('0x24')](',');_0x50fd1d[_0xc466('0x26')](_0x8cfb85[0x0]);_0x50fd1d[_0xc466('0x26')](_0x8cfb85[0x1]);_0x50fd1d[_0xc466('0x26')](_0x8cfb85[0x2]);_0x50fd1d[_0xc466('0x26')](_0x8cfb85[0x3]);_0x50fd1d[_0xc466('0x26')](_0x8cfb85[_0xc466('0x27')](0x4,_0x8cfb85[_0xc466('0x1d')])[_0xc466('0x28')](','));break;case _0xc466('0x2b'):var _0x5ac5bb=_0x5cedee['appdata']['split'](',');_0x50fd1d[_0xc466('0x26')](_0x5ac5bb[0x0]);_0x50fd1d[_0xc466('0x26')](_0x5ac5bb[0x1]);_0x50fd1d[_0xc466('0x26')](_0x5ac5bb[0x2]);_0x50fd1d[_0xc466('0x26')](_0x5ac5bb[0x3]);_0x50fd1d[_0xc466('0x26')](_0x5ac5bb[_0xc466('0x27')](0x4,_0x5ac5bb['length'])['join'](','));break;case _0xc466('0x18'):_0x50fd1d['push'](_0x5cedee['appdata']);break;case'tag':_0x50fd1d['push'](_0x5cedee[_0xc466('0x2c')]);_0x50fd1d[_0xc466('0x26')](_0x5cedee[_0xc466('0x23')]);break;case _0xc466('0x2d'):var _0x1d6940=utils[_0xc466('0x2e')](_0x32b22b['account'][_0xc466('0x2f')],_0x32b22b);var _0x116b3b=_0x5cedee[_0xc466('0x23')]['split'](',');_0x50fd1d[_0xc466('0x26')](_0x116b3b[0x0]);_0x50fd1d[_0xc466('0x26')](_0x116b3b[0x1]);_0x50fd1d[_0xc466('0x26')](_0x116b3b[0x2]);_0x50fd1d['push'](_0x116b3b[0x3]);_0x50fd1d['push'](_0x116b3b[0x4]);_0x50fd1d[_0xc466('0x26')](_0x116b3b[0x5]);_0x50fd1d[_0xc466('0x26')](_0x116b3b[0x6]);_0x50fd1d['push'](_0x116b3b[0x7]);_0x50fd1d[_0xc466('0x26')](_0x116b3b[0x8]);_0x50fd1d['push'](_0x116b3b[0x9]);_0x50fd1d['push'](_0x116b3b[0xa]);_0x50fd1d[_0xc466('0x26')](_0x32b22b[_0xc466('0x19')]['id']);_0x50fd1d[_0xc466('0x26')](_0x32b22b[_0xc466('0x18')]['id']);_0x50fd1d[_0xc466('0x26')](_0x5cedee['ChatWebsiteId']);_0x50fd1d[_0xc466('0x26')](_0x32b22b[_0xc466('0x19')][_0xc466('0x30')]);_0x50fd1d[_0xc466('0x26')](_0x32b22b['body'][_0xc466('0x31')]);_0x50fd1d[_0xc466('0x26')](_0x1d6940);break;default:_0x50fd1d=_['isNil'](_0x5cedee[_0xc466('0x23')])?[]:_0x5cedee[_0xc466('0x23')][_0xc466('0x24')](',');}var _0x4303f4={'id':util[_0xc466('0xe')](_0xc466('0x32'),_0x509368,_0x5cedee['id'],_0x5cedee['app']),'condition':require(_0xc466('0x33'))[_0xc466('0x34')](_0x509368,getIntervals(_0x203971[_0xc466('0x35')],_0x5cedee),_0x203971),'consequence':require(_0xc466('0x36')+_0x5cedee[_0xc466('0x1f')])[_0xc466('0x37')](_0x509368,_0x50fd1d,_0x203971,_0x32b22b),'p':_0x5cedee['priority']||0x0};logger[_0xc466('0x38')]('Push\x20new\x20rule',_0x4303f4['id'],_0xc466('0x39'),getIntervals(_0x203971[_0xc466('0x35')],_0x5cedee)[_0xc466('0x28')](_0xc466('0x3a')));_0x251b55['push'](_0x4303f4);}else{logger['error'](_0xc466('0x3b'),path[_0xc466('0x28')](__dirname,_0xc466('0x1b'),_0x5cedee[_0xc466('0x1f')]+_0xc466('0x20')));}}_0x203971[_0xc466('0x16')][_0x509368]=new RuleEngine(_0x251b55);_0x203971[_0xc466('0x16')][_0x509368]['execute'](_0x32b22b,function(_0x3663d8){logger['info'](_0xc466('0x3c'),JSON['stringify'](_0x3663d8[_0xc466('0x3d')]));if(_0x203971[_0xc466('0x16')][_0x509368]){_0x203971[_0xc466('0x16')][_0x509368][_0xc466('0x3e')](_0xc466('0x3f'));}});return _0x4a5201({'code':0xc8,'message':_0x32b22b});}else{if(_0x29db36){logger[_0xc466('0x38')](util[_0xc466('0xe')](_0xc466('0x40'),_0x509368));}else{logger[_0xc466('0x38')](_0xc466('0x41'));}return _0x4a5201({'code':0xc8,'message':_0x32b22b});}}catch(_0x282999){logger[_0xc466('0x42')](_0x282999[_0xc466('0x43')]);return _0x22fec3(_0x5be7f8[_0xc466('0x42')](0x1f4,_0x282999));}}return _0x22fec3(_0xc466('0x44'));});},'AcceptMessage':function(_0x1958fe){var _0x1e93c6=this;return new Promise(function(_0x3e7b1f,_0x482b85){if(_0x1958fe[_0xc466('0x45')]&&_0x1958fe[_0xc466('0x45')]['id']){if(_0x203971[_0xc466('0x46')][_0x1958fe['agent']['id']]){_0x203971[_0xc466('0x46')][_0x1958fe[_0xc466('0x45')]['id']][_0xc466('0x47')]=![];_0x203971[_0xc466('0x46')][_0x1958fe[_0xc466('0x45')]['id']][_0xc466('0x48')]=undefined;}}if(_0x1958fe[_0xc466('0x18')]&&_0x1958fe[_0xc466('0x18')]['id']){try{var _0x176772=getId(_0x1958fe['channel'],_0x1958fe[_0xc466('0x18')]?_0x1958fe[_0xc466('0x18')]['id']:0x0,_0x1958fe[_0xc466('0x19')]?_0x1958fe[_0xc466('0x19')]['id']:0x0);if(_0x203971[_0xc466('0x16')][_0x176772]){_0x203971[_0xc466('0x16')][_0x176772][_0xc466('0x3e')]('end');if(rpc[_0x1958fe[_0xc466('0x17')]+_0xc466('0x49')]){rpc[_0x1958fe[_0xc466('0x17')]+_0xc466('0x49')][_0xc466('0x4a')](_0x176772,{'UserId':_0x1958fe['message'][_0xc466('0x4b')]})[_0xc466('0x4c')](function(){logger['error'](_0xc466('0x4d'));});}}return _0x3e7b1f({'code':0xc8,'message':_0x1958fe});}catch(_0xb63ee0){logger[_0xc466('0x42')](_0xb63ee0[_0xc466('0x43')]);return _0x482b85(_0x1e93c6[_0xc466('0x42')](0x1f4,_0xb63ee0));}}logger[_0xc466('0x42')](_0xc466('0x4e'));return _0x482b85(_0x1e93c6[_0xc466('0x42')](0x1f4,_0xc466('0x4e')));});},'RejectMessage':function(_0x18ca66){var _0x46fc14=this;return new Promise(function(_0x5b27b1,_0x3717aa){if(_0x18ca66[_0xc466('0x45')]&&_0x18ca66[_0xc466('0x45')]['id']){try{if(_0x203971['agents'][_0x18ca66[_0xc466('0x45')]['id']]){_0x203971[_0xc466('0x46')][_0x18ca66[_0xc466('0x45')]['id']][_0xc466('0x47')]=![];_0x203971[_0xc466('0x46')][_0x18ca66['agent']['id']][_0xc466('0x48')]=undefined;}return _0x5b27b1({'code':0xc8,'message':_0x18ca66});}catch(_0x469fd4){logger[_0xc466('0x42')](_0x469fd4[_0xc466('0x43')]);return _0x3717aa(_0x46fc14[_0xc466('0x42')](0x1f4,_0x469fd4));}}logger['error']('message\x20is\x20empty');return _0x3717aa(_0x46fc14[_0xc466('0x42')](0x1f4,_0xc466('0x4e')));});},'AbandonInteraction':function(_0x1d3f3a){var _0x568622=this;return new Promise(function(_0x4f149b,_0x237b21){if(_0x1d3f3a[_0xc466('0x17')]&&_0x1d3f3a[_0xc466('0x19')]&&_0x1d3f3a[_0xc466('0x19')]['id']){try{var _0x171127=getId(_0x1d3f3a[_0xc466('0x17')],_0x1d3f3a['message']?_0x1d3f3a[_0xc466('0x18')]['id']:0x0,_0x1d3f3a[_0xc466('0x19')]?_0x1d3f3a[_0xc466('0x19')]['id']:0x0);if(_0x203971[_0xc466('0x16')][_0x171127]){_0x203971[_0xc466('0x16')][_0x171127][_0xc466('0x3e')]('end');}return _0x4f149b({'code':0xc8,'message':_0x1d3f3a});}catch(_0x5a13a4){logger['error'](_0x5a13a4['stack']);return _0x237b21(_0x568622[_0xc466('0x42')](0x1f4,_0x5a13a4));}}logger[_0xc466('0x42')](_0xc466('0x4e'));return _0x237b21(_0x568622[_0xc466('0x42')](0x1f4,_0xc466('0x4e')));});},'AgentCapacity':function(_0x4a8468){var _0x386562=this;return new Promise(function(_0x585c68,_0xcde98e){if(_0x203971['agents'][_0xc466('0x4f')](_0x4a8468['id'])){for(var _0x561396 in _0x4a8468[_0xc466('0x50')]){if(_0x4a8468['capacity'][_0xc466('0x4f')](_0x561396)){if(_0x203971[_0xc466('0x46')][_0x4a8468['id']][_0xc466('0x4f')](_0x561396+_0xc466('0x51'))){_0x203971[_0xc466('0x46')][_0x4a8468['id']][_0x561396+_0xc466('0x51')]=parseInt(_0x4a8468['capacity'][_0x561396],0xa);}}}_0x203971[_0xc466('0x46')][_0x4a8468['id']][_0xc466('0x52')]();return _0x585c68({'code':0xc8,'message':_0x203971[_0xc466('0x46')][_0x4a8468['id']]});}else{return _0xcde98e(_0x386562[_0xc466('0x42')](0x1f4,_0xc466('0x53')));}});},'Agents':function(_0x425155){return new Promise(function(_0x339a92){var _0x379e2c=_[_0xc466('0x54')](_0x203971[_0xc466('0x46')]);if(_0x425155&&_0x425155['id']){var _0x2e6c20=_[_0xc466('0x55')](_0x379e2c,function(_0x3dd018){return _0x3dd018['id']===_0x425155['id'];});_0x339a92(_0x2e6c20);}else{_0x339a92({'count':_0x379e2c[_0xc466('0x1d')],'rows':_0x379e2c});}});},'ChatQueues':function(){return new Promise(function(_0xc328d7){var _0x5b6f44=[];for(var _0x41e943 in _0x203971[_0xc466('0x56')]){if(_0x203971['chatQueues'][_0xc466('0x4f')](_0x41e943)){var _0x3d8c9f=_0x203971[_0xc466('0x56')][_0x41e943];var _0x2e3e9a={'id':_0x3d8c9f['id'],'available':_0x3d8c9f[_0xc466('0x57')],'loggedIn':_0x3d8c9f[_0xc466('0x58')],'name':_0x3d8c9f[_0xc466('0x59')],'paused':_0x3d8c9f[_0xc466('0x5a')],'waiting':_0x3d8c9f[_0xc466('0x5b')]};_0x5b6f44[_0xc466('0x26')](_0x2e3e9a);}}_0xc328d7({'count':_0x5b6f44['length'],'rows':_0x5b6f44});});},'MailQueues':function(){return new Promise(function(_0x3a55e4){var _0x1e62ce=[];for(var _0x1e09cf in _0x203971[_0xc466('0x5c')]){if(_0x203971[_0xc466('0x5c')][_0xc466('0x4f')](_0x1e09cf)){var _0x4960ff=_0x203971[_0xc466('0x5c')][_0x1e09cf];var _0x109af8={'id':_0x4960ff['id'],'available':_0x4960ff[_0xc466('0x57')],'loggedIn':_0x4960ff[_0xc466('0x58')],'name':_0x4960ff['name'],'paused':_0x4960ff[_0xc466('0x5a')],'waiting':_0x4960ff['waiting']};_0x1e62ce[_0xc466('0x26')](_0x109af8);}}_0x3a55e4({'count':_0x1e62ce['length'],'rows':_0x1e62ce});});},'OpenchannelQueues':function(){return new Promise(function(_0x13023e){var _0x20d6d5=[];for(var _0x43949f in _0x203971['openchannelQueues']){if(_0x203971[_0xc466('0x5d')]['hasOwnProperty'](_0x43949f)){var _0x541071=_0x203971[_0xc466('0x5d')][_0x43949f];var _0x4585ed={'id':_0x541071['id'],'available':_0x541071[_0xc466('0x57')],'loggedIn':_0x541071[_0xc466('0x58')],'name':_0x541071[_0xc466('0x59')],'paused':_0x541071[_0xc466('0x5a')],'waiting':_0x541071[_0xc466('0x5b')]};_0x20d6d5[_0xc466('0x26')](_0x4585ed);}}_0x13023e({'count':_0x20d6d5[_0xc466('0x1d')],'rows':_0x20d6d5});});},'SmsQueues':function(){return new Promise(function(_0x3e2695){var _0x1c6432=[];for(var _0x1768c5 in _0x203971[_0xc466('0x5e')]){if(_0x203971[_0xc466('0x5e')]['hasOwnProperty'](_0x1768c5)){var _0x3bcf51=_0x203971['smsQueues'][_0x1768c5];var _0x316cea={'id':_0x3bcf51['id'],'available':_0x3bcf51['available'],'loggedIn':_0x3bcf51[_0xc466('0x58')],'name':_0x3bcf51['name'],'paused':_0x3bcf51[_0xc466('0x5a')],'waiting':_0x3bcf51[_0xc466('0x5b')]};_0x1c6432[_0xc466('0x26')](_0x316cea);}}_0x3e2695({'count':_0x1c6432[_0xc466('0x1d')],'rows':_0x1c6432});});},'FaxQueues':function(){return new Promise(function(_0x3205d9){var _0x2e5ea0=[];for(var _0x145b21 in _0x203971[_0xc466('0x5f')]){if(_0x203971[_0xc466('0x5f')][_0xc466('0x4f')](_0x145b21)){var _0x2c7269=_0x203971[_0xc466('0x5f')][_0x145b21];var _0x4546ca={'id':_0x2c7269['id'],'available':_0x2c7269[_0xc466('0x57')],'loggedIn':_0x2c7269[_0xc466('0x58')],'name':_0x2c7269['name'],'paused':_0x2c7269[_0xc466('0x5a')],'waiting':_0x2c7269['waiting']};_0x2e5ea0[_0xc466('0x26')](_0x4546ca);}}_0x3205d9({'count':_0x2e5ea0[_0xc466('0x1d')],'rows':_0x2e5ea0});});},'WhatsappQueues':function(){return new Promise(function(_0x1a152b){var _0x5dfb8b=[];for(var _0x19bdf2 in _0x203971['whatsappQueues']){if(_0x203971[_0xc466('0x60')][_0xc466('0x4f')](_0x19bdf2)){var _0x56c044=_0x203971['whatsappQueues'][_0x19bdf2];var _0x2c5356={'id':_0x56c044['id'],'available':_0x56c044[_0xc466('0x57')],'loggedIn':_0x56c044[_0xc466('0x58')],'name':_0x56c044[_0xc466('0x59')],'paused':_0x56c044['paused'],'waiting':_0x56c044[_0xc466('0x5b')]};_0x5dfb8b[_0xc466('0x26')](_0x2c5356);}}_0x1a152b({'count':_0x5dfb8b[_0xc466('0x1d')],'rows':_0x5dfb8b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x36970e){var _0x9b8a57=_[_0xc466('0x54')](_0x203971[_0xc466('0x61')]);_0x36970e({'count':_0x9b8a57[_0xc466('0x1d')],'rows':_0x9b8a57});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x20e703){var _0x4b5643=_[_0xc466('0x54')](_0x203971['mailQueuesWaitingInteractions']);_0x20e703({'count':_0x4b5643['length'],'rows':_0x4b5643});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xbd0c25){var _0x44056c=_[_0xc466('0x54')](_0x203971['openchannelQueuesWaitingInteractions']);_0xbd0c25({'count':_0x44056c[_0xc466('0x1d')],'rows':_0x44056c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x172c7f){var _0x272bb1=_[_0xc466('0x54')](_0x203971[_0xc466('0x62')]);_0x172c7f({'count':_0x272bb1[_0xc466('0x1d')],'rows':_0x272bb1});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3dcf97){var _0x1d464e=_[_0xc466('0x54')](_0x203971['faxQueuesWaitingInteractions']);_0x3dcf97({'count':_0x1d464e[_0xc466('0x1d')],'rows':_0x1d464e});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4bef5a){var _0x50ab80=_[_0xc466('0x54')](_0x203971[_0xc466('0x63')]);_0x4bef5a({'count':_0x50ab80[_0xc466('0x1d')],'rows':_0x50ab80});});}};var _0x3e1d05=jayson[_0xc466('0x64')](_0x447184)['http']();_0x3e1d05['on'](_0xc466('0x42'),function(_0x52c2cb){logger[_0xc466('0x42')](JSON[_0xc466('0x65')](_0x52c2cb));return _0x4462b6(_0x52c2cb);});_0x3e1d05[_0xc466('0x15')](0x232c,_0xc466('0x66'),function(){console['log'](_0xc466('0x67'),0x232c);return _0x49c7ff(_0xc466('0x68')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7bc2f8a..cd3183d 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 _0xa5e7=['request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','lodash','../../../config/logger','http'];(function(_0x3a48d7,_0x18c411){var _0x4c935c=function(_0x248094){while(--_0x248094){_0x3a48d7['push'](_0x3a48d7['shift']());}};_0x4c935c(++_0x18c411);}(_0xa5e7,0xb5));var _0x7a5e=function(_0x22b0ed,_0x5c8cfd){_0x22b0ed=_0x22b0ed-0x0;var _0x335a9c=_0xa5e7[_0x22b0ed];return _0x335a9c;};'use strict';var util=require(_0x7a5e('0x0'));var BPromise=require(_0x7a5e('0x1'));var jayson=require('jayson/promise');var _=require(_0x7a5e('0x2'));var logger=require(_0x7a5e('0x3'))('routing');var client=jayson['client'][_0x7a5e('0x4')]({'port':0x232a});function request(_0x16df3f,_0x49d43b){return new BPromise(function(_0x1b81a1,_0xad2cad){return client[_0x7a5e('0x5')](_0x16df3f,_0x49d43b)[_0x7a5e('0x6')](function(_0x5493c9){if(_0x5493c9[_0x7a5e('0x7')]){return _0xad2cad(_0x5493c9[_0x7a5e('0x7')][_0x7a5e('0x8')]);}else{return _0x1b81a1(_0x5493c9[_0x7a5e('0x9')]);}})[_0x7a5e('0xa')](function(_0x3170e0){return _0xad2cad(_0x3170e0);});});}exports[_0x7a5e('0xb')]=function(_0x37fe28,_0x17f60e,_0x563465){return function(_0x3f8001){if(_0x563465['rules']&&!_0x563465[_0x7a5e('0xc')][_0x37fe28]){logger[_0x7a5e('0xd')](_0x7a5e('0xe'),_0x37fe28);return _0x3f8001[_0x7a5e('0xf')]();}var _0x315a04=[];for(var _0x404874=0x0;_0x404874<_0x17f60e[_0x7a5e('0x10')];_0x404874+=0x1){_0x315a04[_0x7a5e('0x11')](request(_0x7a5e('0x12'),{'command':util[_0x7a5e('0x13')](_0x7a5e('0x14'),_0x17f60e[_0x404874])})[_0x7a5e('0x6')](function(_0x2c6e8b){return _0x2c6e8b&&_0x2c6e8b[_0x7a5e('0x8')]&&_0x2c6e8b[_0x7a5e('0x8')][_0x7a5e('0x15')](_0x7a5e('0x16'))>=0x0?!![]:![];})[_0x7a5e('0xa')](function(_0x2ce003){logger[_0x7a5e('0x7')](_0x7a5e('0x17'),_0x37fe28,_0x17f60e[_0x404874]);}));}BPromise[_0x7a5e('0x18')](_0x315a04)[_0x7a5e('0x6')](function(_0x188c16){var _0x2bbfe4=_[_0x7a5e('0x19')](_0x188c16);logger[_0x7a5e('0xd')](_0x7a5e('0x1a'),_0x37fe28,_0x17f60e[_0x7a5e('0x1b')](_0x7a5e('0x1c')),_0x2bbfe4);_0x3f8001[_0x7a5e('0x1d')](_0x2bbfe4);})[_0x7a5e('0xa')](function(_0x227d7e){console['log'](_0x227d7e);logger[_0x7a5e('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x37fe28,_0x17f60e[_0x7a5e('0x1b')]('\x20|\x20'),_0x227d7e[_0x7a5e('0x1e')]);_0x3f8001[_0x7a5e('0xf')]();});};}; \ No newline at end of file +var _0xe390=['length','push','Command','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','stop','util','bluebird','lodash','../../../config/logger','client','request','error','message','result','catch','condition','rules','info'];(function(_0x49e67c,_0x269b2c){var _0x180cf2=function(_0x268f3c){while(--_0x268f3c){_0x49e67c['push'](_0x49e67c['shift']());}};_0x180cf2(++_0x269b2c);}(_0xe390,0x9b));var _0x0e39=function(_0x387845,_0x27712b){_0x387845=_0x387845-0x0;var _0x43c09e=_0xe390[_0x387845];return _0x43c09e;};'use strict';var util=require(_0x0e39('0x0'));var BPromise=require(_0x0e39('0x1'));var jayson=require('jayson/promise');var _=require(_0x0e39('0x2'));var logger=require(_0x0e39('0x3'))('routing');var client=jayson[_0x0e39('0x4')]['http']({'port':0x232a});function request(_0x26fbc2,_0x31d306){return new BPromise(function(_0x33bb13,_0x2efcf6){return client[_0x0e39('0x5')](_0x26fbc2,_0x31d306)['then'](function(_0x5b583d){if(_0x5b583d[_0x0e39('0x6')]){return _0x2efcf6(_0x5b583d['error'][_0x0e39('0x7')]);}else{return _0x33bb13(_0x5b583d[_0x0e39('0x8')]);}})[_0x0e39('0x9')](function(_0x2c7c98){return _0x2efcf6(_0x2c7c98);});});}exports[_0x0e39('0xa')]=function(_0x132107,_0x2a3569,_0xceae97){return function(_0x4d30fc){if(_0xceae97['rules']&&!_0xceae97[_0x0e39('0xb')][_0x132107]){logger[_0x0e39('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x132107);return _0x4d30fc['stop']();}var _0x40f8b9=[];for(var _0x1f32c5=0x0;_0x1f32c5<_0x2a3569[_0x0e39('0xd')];_0x1f32c5+=0x1){_0x40f8b9[_0x0e39('0xe')](request(_0x0e39('0xf'),{'command':util['format']('iftime\x20%s',_0x2a3569[_0x1f32c5])})[_0x0e39('0x10')](function(_0x4f628f){return _0x4f628f&&_0x4f628f[_0x0e39('0x7')]&&_0x4f628f[_0x0e39('0x7')][_0x0e39('0x11')](_0x0e39('0x12'))>=0x0?!![]:![];})[_0x0e39('0x9')](function(_0x49dce7){logger[_0x0e39('0x6')](_0x0e39('0x13'),_0x132107,_0x2a3569[_0x1f32c5]);}));}BPromise[_0x0e39('0x14')](_0x40f8b9)['then'](function(_0x26c2d4){var _0x4771a3=_[_0x0e39('0x15')](_0x26c2d4);logger['info'](_0x0e39('0x16'),_0x132107,_0x2a3569[_0x0e39('0x17')](_0x0e39('0x18')),_0x4771a3);_0x4d30fc[_0x0e39('0x19')](_0x4771a3);})['catch'](function(_0x4f9fb3){console['log'](_0x4f9fb3);logger[_0x0e39('0x6')](_0x0e39('0x16'),_0x132107,_0x2a3569[_0x0e39('0x17')](_0x0e39('0x18')),_0x4f9fb3[_0x0e39('0x1a')]);_0x4d30fc[_0x0e39('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index afe155e..cfd3a51 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 _0x76dc=['origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','agent','complete','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','membername','interface','calleridnum','queue','getVoiceQueueByName','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','lastevent','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheremembername','isNil','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid'];(function(_0x2c976f,_0x4bd2c4){var _0x1a1227=function(_0x24597e){while(--_0x24597e){_0x2c976f['push'](_0x2c976f['shift']());}};_0x1a1227(++_0x4bd2c4);}(_0x76dc,0x1f2));var _0xc76d=function(_0x3a759e,_0x4e56b7){_0x3a759e=_0x3a759e-0x0;var _0x5020bc=_0x76dc[_0x3a759e];return _0x5020bc;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var utils=require(_0xc76d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26e85e,_0x49c651){utils[_0xc76d('0x3')](util[_0xc76d('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x26e85e[_0xc76d('0x5')],_0x26e85e['channel'],_0x26e85e['queue'],_0x26e85e[_0xc76d('0x6')],_0x26e85e[_0xc76d('0x7')],_0x26e85e[_0xc76d('0x8')],_0x26e85e['connectedlinenum'],_0x26e85e['lastevent']));if(_0x26e85e[_0xc76d('0x9')]){utils[_0xc76d('0xa')](_0x26e85e[_0xc76d('0x9')])['then'](function(_0x570197){if(_0x570197){_0x26e85e[_0xc76d('0xb')]=_0x570197[_0xc76d('0xb')];_0x26e85e['agentacw']=_0x26e85e[_0xc76d('0xc')]?_0x570197['acw']:![];_0x26e85e[_0xc76d('0xd')]=_0x26e85e[_0xc76d('0xe')]?_0x570197[_0xc76d('0xf')]:0x0;}utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);});}else{utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);}if(_0x49c651){delete transfers[_0x26e85e[_0xc76d('0x5')]];}else{delete agents[_0x26e85e[_0xc76d('0x12')]];}}exports[_0xc76d('0x13')]=function(_0x1a7b47){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x1a7b47);agents[_0x1a7b47[_0xc76d('0x12')]]=_0x1a7b47;agents[_0x1a7b47[_0xc76d('0x12')]]['agentcalledAt']=utils[_0xc76d('0x16')]();agents[_0x1a7b47[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x18');agents[_0x1a7b47['destuniqueid']][_0xc76d('0x19')]=null;agents[_0x1a7b47['destuniqueid']]['connectedlinename']=null;utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1a'),_0x1a7b47[_0xc76d('0x5')],agents[_0x1a7b47[_0xc76d('0x12')]]['membername'],_0x1a7b47[_0xc76d('0x12')]));}catch(_0x361f42){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x361f42);}};exports[_0xc76d('0x1c')]=function(_0x324db7){try{if(!_['isNil'](agents[_0x324db7[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x1d'),_0x324db7[_0xc76d('0x5')]),_0x324db7);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1e'),_0x324db7[_0xc76d('0x5')],agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x6')],_0x324db7['destuniqueid']));agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x1c')]=!![];agents[_0x324db7['destuniqueid']][_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();agents[_0x324db7['destuniqueid']][_0xc76d('0x17')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x21')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x22')]=_0x324db7['ringtime']?parseInt(_0x324db7['ringtime'])/0x3e8:0x0;agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x23')]=0x0;unanswered['push'](_0x324db7[_0xc76d('0x12')]);}}catch(_0x52a79a){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x1d'),_0x324db7['uniqueid']),_0x52a79a);}};exports[_0xc76d('0x24')]=function(_0x18a7fa){try{_['forIn'](agents,function(_0x3d4076,_0x1c68f3){if(_0x3d4076[_0xc76d('0x5')]==_0x18a7fa[_0xc76d('0x5')]&&!_['includes'](unanswered,_0x3d4076[_0xc76d('0x12')])){utils['debug'](util[_0xc76d('0x4')]('[%s][agents][queuecallerabandon]',_0x18a7fa[_0xc76d('0x5')]),_0x18a7fa);utils[_0xc76d('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x18a7fa['uniqueid'],_0x3d4076['membername'],_0x3d4076[_0xc76d('0x12')]));_0x3d4076[_0xc76d('0x1c')]=!![];_0x3d4076[_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();_0x3d4076[_0xc76d('0x17')]='abandoned';_0x3d4076[_0xc76d('0x21')]='abandoned';_0x3d4076[_0xc76d('0x22')]=_0x18a7fa['holdtime'];_0x3d4076[_0xc76d('0x23')]=0x0;writeDB(_0x3d4076);}});}catch(_0x2332f5){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x25'),_0x18a7fa['uniqueid']),_0x2332f5);}};exports[_0xc76d('0x26')]=function(_0x371306){try{if(agents[_0x371306[_0xc76d('0x12')]]){utils['debug'](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x371306);utils['info'](util[_0xc76d('0x4')](_0xc76d('0x28'),_0x371306[_0xc76d('0x5')],agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x6')],_0x371306[_0xc76d('0x12')]));agents[_0x371306['destuniqueid']]['agentconnectAt']=utils[_0xc76d('0x16')]();agents[_0x371306['destuniqueid']][_0xc76d('0x19')]=_0x371306[_0xc76d('0x19')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x29')]=_0x371306['connectedlinename'];agents[_0x371306['destuniqueid']][_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x2b');_['forIn'](agents,function(_0x42404c,_0xb264b0){if(_0x42404c[_0xc76d('0x12')]!=_0x371306[_0xc76d('0x12')]&&_0x42404c[_0xc76d('0x5')]==_0x371306[_0xc76d('0x5')]){_0x42404c[_0xc76d('0x23')]=0x0;_0x42404c[_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];_0x42404c[_0xc76d('0x1c')]=!![];_0x42404c['agentringnoanswerAt']=utils['now']();_0x42404c[_0xc76d('0x17')]=_0xc76d('0x2c');_0x42404c[_0xc76d('0x21')]=_0xc76d('0x2c');_0x42404c['answeredelsewheredestinationuniqueid']=_0x371306['destuniqueid'];_0x42404c[_0xc76d('0x2d')]=_0x371306[_0xc76d('0x6')];writeDB(_0x42404c);}});}}catch(_0x3e471e){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x3e471e);}};exports[_0xc76d('0xc')]=function(_0x50e922){try{if(!_[_0xc76d('0x2e')](agents[_0x50e922[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][agentcomplete]',_0x50e922['uniqueid']),_0x50e922);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x50e922['uniqueid'],agents[_0x50e922['destuniqueid']][_0xc76d('0x6')],_0x50e922[_0xc76d('0x12')]));agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0xc')]=!![];agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0x50e922[_0xc76d('0x12')]]['talktime']=utils[_0xc76d('0x30')](agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')],agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x31')]);agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x21')]=_0x50e922[_0xc76d('0x21')];agents[_0x50e922[_0xc76d('0x12')]]['lastevent']='complete';writeDB(agents[_0x50e922[_0xc76d('0x12')]]);}}catch(_0x170f47){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x32'),_0x50e922['uniqueid']),_0x170f47);}};exports[_0xc76d('0x33')]=function(_0x1ede13){try{if(!_['isNil'](agents[_0x1ede13['transfereruniqueid']])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][blindtransfer]',_0x1ede13[_0xc76d('0x5')]),_0x1ede13);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x34'),_0x1ede13[_0xc76d('0x5')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x6')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x5')]));agents[_0x1ede13[_0xc76d('0x35')]]['transfer']=!![];agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x36')]=_0xc76d('0x37');agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x38')]=_0x1ede13[_0xc76d('0x39')];agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x3a')]=agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x5')];}}catch(_0x12c972){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x3b'),_0x1ede13['uniqueid']),_0x12c972);}};exports['attendedtransfer']=function(_0x5bec6c){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x3c'),_0x5bec6c[_0xc76d('0x3d')]),_0x5bec6c);if(_0x5bec6c[_0xc76d('0x3d')]==_0x5bec6c[_0xc76d('0x3e')]){if(!_['isNil'](agents[_0x5bec6c[_0xc76d('0x3f')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x6')]));agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x41')]=!![];agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x36')]=_0xc76d('0x42');agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x38')]=_0x5bec6c[_0xc76d('0x43')];agents[_0x5bec6c['secondtransfereruniqueid']]['transferuniqueid']=_0x5bec6c[_0xc76d('0x3d')];}if(_0x5bec6c['transfereeuniqueid']&&agents[_0x5bec6c[_0xc76d('0x44')]]){agents[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x45')]=0x1;transfers[_0x5bec6c[_0xc76d('0x44')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x44')]]);transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x8')];transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x47')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x47')];transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x31')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x44')]]['agententerreason']=0x2;}}else if(_0x5bec6c['secondtransfereruniqueid']==_0x5bec6c['secondtransfererlinkedid']){if(!_[_0xc76d('0x2e')](agents[_0x5bec6c[_0xc76d('0x3d')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x6')]));agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x41')]=!![];agents[_0x5bec6c['origtransfereruniqueid']]['transfertype']=_0xc76d('0x42');agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x38')]=_0x5bec6c['secondtransfererexten'];agents[_0x5bec6c[_0xc76d('0x3d')]]['transferuniqueid']=_0x5bec6c['secondtransfereruniqueid'];}if(_0x5bec6c['transfertargetuniqueid']&&agents[_0x5bec6c[_0xc76d('0x49')]]){agents[_0x5bec6c[_0xc76d('0x49')]]['agententerreason']=0x1;transfers[_0x5bec6c[_0xc76d('0x49')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x49')]]);transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x8')];transfers[_0x5bec6c['transfertargetuniqueid']]['calleridname']=agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x47')];transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]]['agentconnectAt']=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x45')]=0x2;}}}catch(_0x2af760){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')]('[%s][agents][attendedtransfer]',_0x5bec6c[_0xc76d('0x3d')]),_0x2af760);}};exports['hangup']=function(_0xa9f2e8){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x4a'),_0xa9f2e8['uniqueid']),_0xa9f2e8);if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8['uniqueid']]['reason']===_0xc76d('0x20')){if(_0xa9f2e8[_0xc76d('0x4b')]==='21'){agents[_0xa9f2e8['uniqueid']][_0xc76d('0x21')]=_0xc76d('0x4c');agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]=_0xc76d('0x4c');}utils['info'](util[_0xc76d('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]]['membername'],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]));writeDB(agents[_0xa9f2e8[_0xc76d('0x5')]]);var _0x277382=unanswered['indexOf'](_0xa9f2e8[_0xc76d('0x5')]);if(_0x277382>-0x1){unanswered['splice'](_0x277382,0x1);}}if(transfers[_0xa9f2e8['uniqueid']]){transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];transfers[_0xa9f2e8['uniqueid']][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=_0xc76d('0x4d');transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]=_0xc76d('0x4e');utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],transfers[_0xa9f2e8[_0xc76d('0x5')]]['membername'],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]));writeDB(transfers[_0xa9f2e8[_0xc76d('0x5')]],!![]);}if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]){agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x41')]?'transfer':_0xc76d('0x4d');agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']=_0xc76d('0x4e');utils[_0xc76d('0x3')](util['format'](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x6')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']));writeDB(agents[_0xa9f2e8['uniqueid']]);}}catch(_0xe6a1dc){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x4a'),_0xa9f2e8[_0xc76d('0x5')]),_0xe6a1dc);}}; \ No newline at end of file +var _0xbf6e=['[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','destuniqueid','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','[%s][agents][hangup]','./utils','info','format'];(function(_0x26810f,_0x5c13c8){var _0x30b725=function(_0x5144a7){while(--_0x5144a7){_0x26810f['push'](_0x26810f['shift']());}};_0x30b725(++_0x5c13c8);}(_0xbf6e,0x149));var _0xebf6=function(_0x39a7bb,_0x3616b6){_0x39a7bb=_0x39a7bb-0x0;var _0x2e1027=_0xbf6e[_0x39a7bb];return _0x2e1027;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xebf6('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2b658d,_0x14bf01){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x3'),_0x2b658d[_0xebf6('0x4')],_0x2b658d['channel'],_0x2b658d[_0xebf6('0x5')],_0x2b658d[_0xebf6('0x6')],_0x2b658d[_0xebf6('0x7')],_0x2b658d[_0xebf6('0x8')],_0x2b658d[_0xebf6('0x9')],_0x2b658d[_0xebf6('0xa')]));if(_0x2b658d[_0xebf6('0x5')]){utils['getVoiceQueueByName'](_0x2b658d[_0xebf6('0x5')])[_0xebf6('0xb')](function(_0x12ed12){if(_0x12ed12){_0x2b658d['type']=_0x12ed12[_0xebf6('0xc')];_0x2b658d[_0xebf6('0xd')]=_0x2b658d['agentcomplete']?_0x12ed12[_0xebf6('0xe')]:![];_0x2b658d[_0xebf6('0xf')]=_0x2b658d[_0xebf6('0xd')]?_0x12ed12[_0xebf6('0x10')]:0x0;}utils[_0xebf6('0x11')](_0xebf6('0x12'),_0x2b658d);});}else{utils['request'](_0xebf6('0x12'),_0x2b658d);}if(_0x14bf01){delete transfers[_0x2b658d[_0xebf6('0x4')]];}else{delete agents[_0x2b658d['destuniqueid']];}}exports[_0xebf6('0x13')]=function(_0x101a6c){try{utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x15'),_0x101a6c['uniqueid']),_0x101a6c);agents[_0x101a6c['destuniqueid']]=_0x101a6c;agents[_0x101a6c['destuniqueid']][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();agents[_0x101a6c['destuniqueid']][_0xebf6('0xa')]=_0xebf6('0x18');agents[_0x101a6c[_0xebf6('0x19')]][_0xebf6('0x9')]=null;agents[_0x101a6c[_0xebf6('0x19')]][_0xebf6('0x1a')]=null;utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x1b'),_0x101a6c[_0xebf6('0x4')],agents[_0x101a6c['destuniqueid']]['membername'],_0x101a6c[_0xebf6('0x19')]));}catch(_0x38c9e3){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x15'),_0x101a6c[_0xebf6('0x4')]),_0x38c9e3);}};exports[_0xebf6('0x1d')]=function(_0x80f523){try{if(!_['isNil'](agents[_0x80f523[_0xebf6('0x19')]])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x1e'),_0x80f523[_0xebf6('0x4')]),_0x80f523);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x1f'),_0x80f523[_0xebf6('0x4')],agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x6')],_0x80f523[_0xebf6('0x19')]));agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x1d')]=!![];agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x20')]=utils[_0xebf6('0x17')]();agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0xa')]='timeout';agents[_0x80f523['destuniqueid']][_0xebf6('0x21')]='timeout';agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x22')]=_0x80f523['ringtime']?parseInt(_0x80f523['ringtime'])/0x3e8:0x0;agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x23')]=0x0;unanswered[_0xebf6('0x24')](_0x80f523[_0xebf6('0x19')]);}}catch(_0xedaaeb){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x1e'),_0x80f523['uniqueid']),_0xedaaeb);}};exports[_0xebf6('0x25')]=function(_0x78cdf0){try{_['forIn'](agents,function(_0x2fe3ee,_0x28bbea){if(_0x2fe3ee['uniqueid']==_0x78cdf0[_0xebf6('0x4')]&&!_[_0xebf6('0x26')](unanswered,_0x2fe3ee[_0xebf6('0x19')])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x27'),_0x78cdf0['uniqueid']),_0x78cdf0);utils[_0xebf6('0x1')](util[_0xebf6('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x78cdf0['uniqueid'],_0x2fe3ee[_0xebf6('0x6')],_0x2fe3ee[_0xebf6('0x19')]));_0x2fe3ee['agentringnoanswer']=!![];_0x2fe3ee[_0xebf6('0x20')]=utils[_0xebf6('0x17')]();_0x2fe3ee['lastevent']=_0xebf6('0x28');_0x2fe3ee[_0xebf6('0x21')]=_0xebf6('0x28');_0x2fe3ee['holdtime']=_0x78cdf0[_0xebf6('0x22')];_0x2fe3ee[_0xebf6('0x23')]=0x0;writeDB(_0x2fe3ee);}});}catch(_0xed3a5b){utils[_0xebf6('0x1c')](util['format']('[%s][agents][queuecallerabandon]',_0x78cdf0[_0xebf6('0x4')]),_0xed3a5b);}};exports[_0xebf6('0x29')]=function(_0x562f76){try{if(agents[_0x562f76[_0xebf6('0x19')]]){utils[_0xebf6('0x14')](util['format'](_0xebf6('0x2a'),_0x562f76[_0xebf6('0x4')]),_0x562f76);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x2b'),_0x562f76['uniqueid'],agents[_0x562f76[_0xebf6('0x19')]]['membername'],_0x562f76[_0xebf6('0x19')]));agents[_0x562f76['destuniqueid']][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0x9')]=_0x562f76[_0xebf6('0x9')];agents[_0x562f76[_0xebf6('0x19')]]['connectedlinename']=_0x562f76[_0xebf6('0x1a')];agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0x22')]=_0x562f76[_0xebf6('0x2d')];agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0xa')]='connect';_[_0xebf6('0x2e')](agents,function(_0x2782a5,_0x3f8502){if(_0x2782a5[_0xebf6('0x19')]!=_0x562f76[_0xebf6('0x19')]&&_0x2782a5[_0xebf6('0x4')]==_0x562f76['uniqueid']){_0x2782a5['talktime']=0x0;_0x2782a5['holdtime']=_0x562f76[_0xebf6('0x2d')];_0x2782a5[_0xebf6('0x1d')]=!![];_0x2782a5[_0xebf6('0x20')]=utils['now']();_0x2782a5[_0xebf6('0xa')]=_0xebf6('0x2f');_0x2782a5[_0xebf6('0x21')]='answered_elsewhere';_0x2782a5[_0xebf6('0x30')]=_0x562f76[_0xebf6('0x19')];_0x2782a5['answeredelsewheremembername']=_0x562f76[_0xebf6('0x6')];writeDB(_0x2782a5);}});}}catch(_0x1de50e){utils[_0xebf6('0x1c')](util['format'](_0xebf6('0x2a'),_0x562f76['uniqueid']),_0x1de50e);}};exports['agentcomplete']=function(_0x256552){try{if(!_[_0xebf6('0x31')](agents[_0x256552[_0xebf6('0x19')]])){utils[_0xebf6('0x14')](util['format'](_0xebf6('0x32'),_0x256552['uniqueid']),_0x256552);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x33'),_0x256552[_0xebf6('0x4')],agents[_0x256552[_0xebf6('0x19')]]['membername'],_0x256552['destuniqueid']));agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x34')]=!![];agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x35')]=utils['now']();agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x35')],agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x2c')]);agents[_0x256552['destuniqueid']][_0xebf6('0x21')]=_0x256552[_0xebf6('0x21')];agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0xa')]=_0xebf6('0x37');writeDB(agents[_0x256552[_0xebf6('0x19')]]);}}catch(_0x250cf4){utils['error'](util[_0xebf6('0x2')]('[%s][agents][agentcomplete]',_0x256552[_0xebf6('0x4')]),_0x250cf4);}};exports[_0xebf6('0x38')]=function(_0x5d84ac){try{if(!_[_0xebf6('0x31')](agents[_0x5d84ac['transfereruniqueid']])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x39'),_0x5d84ac[_0xebf6('0x4')]),_0x5d84ac);utils[_0xebf6('0x1')](util['format'](_0xebf6('0x3a'),_0x5d84ac[_0xebf6('0x4')],agents[_0x5d84ac['transfereruniqueid']][_0xebf6('0x6')],agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x4')]));agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x3c')]=!![];agents[_0x5d84ac['transfereruniqueid']][_0xebf6('0x3d')]=_0xebf6('0x3e');agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x3f')]=_0x5d84ac['extension'];agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x40')]=agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x4')];}}catch(_0x16abac){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x39'),_0x5d84ac[_0xebf6('0x4')]),_0x16abac);}};exports['attendedtransfer']=function(_0x22c3ad){try{utils[_0xebf6('0x14')](util[_0xebf6('0x2')]('[%s][agents][attendedtransfer]',_0x22c3ad[_0xebf6('0x41')]),_0x22c3ad);if(_0x22c3ad['origtransfereruniqueid']==_0x22c3ad['origtransfererlinkedid']){if(!_[_0xebf6('0x31')](agents[_0x22c3ad[_0xebf6('0x42')]])){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x43'),_0x22c3ad['origtransfereruniqueid'],agents[_0x22c3ad[_0xebf6('0x42')]]['membername']));agents[_0x22c3ad['secondtransfereruniqueid']]['transfer']=!![];agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x3d')]='ATTENDED';agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x3f')]=_0x22c3ad[_0xebf6('0x44')];agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x40')]=_0x22c3ad[_0xebf6('0x41')];}if(_0x22c3ad[_0xebf6('0x45')]&&agents[_0x22c3ad['transfereeuniqueid']]){agents[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x46')]=0x1;transfers[_0x22c3ad[_0xebf6('0x45')]]=_[_0xebf6('0x47')](agents[_0x22c3ad[_0xebf6('0x45')]]);transfers[_0x22c3ad[_0xebf6('0x45')]]['calleridnum']=agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x8')];transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x48')]=agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x48')];transfers[_0x22c3ad['transfereeuniqueid']][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad['transfereeuniqueid']][_0xebf6('0x22')]=0x0;transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x46')]=0x2;}}else if(_0x22c3ad[_0xebf6('0x42')]==_0x22c3ad[_0xebf6('0x49')]){if(!_[_0xebf6('0x31')](agents[_0x22c3ad[_0xebf6('0x41')]])){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x43'),_0x22c3ad[_0xebf6('0x41')],agents[_0x22c3ad['origtransfereruniqueid']][_0xebf6('0x6')]));agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x3c')]=!![];agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x3d')]=_0xebf6('0x4a');agents[_0x22c3ad['origtransfereruniqueid']][_0xebf6('0x3f')]=_0x22c3ad['secondtransfererexten'];agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x40')]=_0x22c3ad[_0xebf6('0x42')];}if(_0x22c3ad[_0xebf6('0x4b')]&&agents[_0x22c3ad[_0xebf6('0x4b')]]){agents[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x46')]=0x1;transfers[_0x22c3ad['transfertargetuniqueid']]=_['clone'](agents[_0x22c3ad[_0xebf6('0x4b')]]);transfers[_0x22c3ad[_0xebf6('0x4b')]]['calleridnum']=agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x8')];transfers[_0x22c3ad['transfertargetuniqueid']][_0xebf6('0x48')]=agents[_0x22c3ad[_0xebf6('0x41')]]['calleridname'];transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x4b')]]['holdtime']=0x0;transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x46')]=0x2;}}}catch(_0x26d338){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x4c'),_0x22c3ad[_0xebf6('0x41')]),_0x26d338);}};exports[_0xebf6('0x4d')]=function(_0x3bc43){try{utils[_0xebf6('0x14')](util['format']('[%s][agents][hangup]',_0x3bc43[_0xebf6('0x4')]),_0x3bc43);if(agents[_0x3bc43[_0xebf6('0x4')]]&&agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')]==='timeout'){if(_0x3bc43[_0xebf6('0x4e')]==='21'){agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')]=_0xebf6('0x4f');agents[_0x3bc43['uniqueid']]['lastevent']='rejected';}utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x50'),_0x3bc43[_0xebf6('0x4')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],agents[_0x3bc43['uniqueid']][_0xebf6('0xa')]));writeDB(agents[_0x3bc43[_0xebf6('0x4')]]);var _0x50169c=unanswered['indexOf'](_0x3bc43[_0xebf6('0x4')]);if(_0x50169c>-0x1){unanswered['splice'](_0x50169c,0x1);}}if(transfers[_0x3bc43[_0xebf6('0x4')]]){transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x34')]=!![];transfers[_0x3bc43['uniqueid']][_0xebf6('0x35')]=utils[_0xebf6('0x17')]();transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](transfers[_0x3bc43[_0xebf6('0x4')]]['agentcompleteAt'],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]);transfers[_0x3bc43['uniqueid']][_0xebf6('0x21')]=_0xebf6('0x51');transfers[_0x3bc43[_0xebf6('0x4')]]['lastevent']=_0xebf6('0x37');utils[_0xebf6('0x1')](util['format'](_0xebf6('0x50'),_0x3bc43[_0xebf6('0x4')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0xa')]));writeDB(transfers[_0x3bc43[_0xebf6('0x4')]],!![]);}if(agents[_0x3bc43[_0xebf6('0x4')]]&&agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]){agents[_0x3bc43[_0xebf6('0x4')]]['agentcomplete']=!![];agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x35')]=utils[_0xebf6('0x17')]();agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x35')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]);agents[_0x3bc43['uniqueid']]['reason']=agents[_0x3bc43[_0xebf6('0x4')]]['transfer']?_0xebf6('0x3c'):_0xebf6('0x51');agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0xa')]=_0xebf6('0x37');utils['info'](util[_0xebf6('0x2')](_0xebf6('0x50'),_0x3bc43['uniqueid'],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],agents[_0x3bc43[_0xebf6('0x4')]]['lastevent']));writeDB(agents[_0x3bc43['uniqueid']]);}}catch(_0x1b245d){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x52'),_0x3bc43[_0xebf6('0x4')]),_0x1b245d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 792fa7f..834d129 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 _0x5fa9=['application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','noop','execif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','error','[%s][calls][newstate]','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastdata','queue','[%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','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s'];(function(_0x3ad27c,_0xb062f3){var _0x5a4da2=function(_0x5839f4){while(--_0x5839f4){_0x3ad27c['push'](_0x3ad27c['shift']());}};_0x5a4da2(++_0xb062f3);}(_0x5fa9,0x150));var _0x95fa=function(_0x1c5860,_0x49638a){_0x1c5860=_0x1c5860-0x0;var _0x33970c=_0x5fa9[_0x1c5860];return _0x33970c;};'use strict';var _=require(_0x95fa('0x0'));var util=require(_0x95fa('0x1'));var utils=require(_0x95fa('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x95fa('0x3'),_0x95fa('0x4'),'FAILED','NO\x20ANSWER',_0x95fa('0x3'),'NO\x20ANSWER',_0x95fa('0x5'),'BUSY','FAILED',_0x95fa('0x4'),'FAILED'];var channels={};function writeDB(_0x3afc2b){var _0x2937cd;if(transfers[_0x95fa('0x6')][_0x3afc2b['uniqueid']]){_0x2937cd=_0x3afc2b[_0x95fa('0x7')];_0x3afc2b[_0x95fa('0x7')]=transfers['blinds'][_0x3afc2b['uniqueid']]['transfereeuniqueid'];}utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0xa'),_0x3afc2b[_0x95fa('0x7')],_0x3afc2b[_0x95fa('0xb')],_0x3afc2b['queue'],_0x3afc2b[_0x95fa('0xc')],_0x3afc2b['interface'],_0x3afc2b[_0x95fa('0xd')],_0x3afc2b[_0x95fa('0xe')],_0x3afc2b[_0x95fa('0xf')]));if(_0x3afc2b[_0x95fa('0x10')]){utils[_0x95fa('0x11')](_0x3afc2b[_0x95fa('0x10')])[_0x95fa('0x12')](function(_0x30e4b7){if(_0x30e4b7){_0x3afc2b[_0x95fa('0x13')]=_0x30e4b7['id'];}utils['request'](_0x95fa('0x14'),_0x3afc2b);});}else{utils[_0x95fa('0x15')](_0x95fa('0x14'),_0x3afc2b);}if(channels[_0x3afc2b[_0x95fa('0x7')]]){delete channels[_0x3afc2b['uniqueid']];}else if(_0x2937cd&&channels[_0x2937cd]){if(!transfers['blinds'][_0x2937cd]['recording'])delete transfers[_0x95fa('0x6')][_0x2937cd];delete channels[_0x2937cd];}}exports['newchannel']=function(_0x1ae342){try{utils['debug'](util[_0x95fa('0x9')](_0x95fa('0x16'),_0x1ae342[_0x95fa('0x7')]),_0x1ae342);if(_0x1ae342[_0x95fa('0x7')]==_0x1ae342[_0x95fa('0x17')]&&_0x1ae342[_0x95fa('0xb')]!='OutgoingSpoolFailed'){utils['info'](util[_0x95fa('0x9')](_0x95fa('0x18'),_0x1ae342[_0x95fa('0x7')],_0x1ae342[_0x95fa('0x19')],_0x1ae342[_0x95fa('0x1a')]));channels[_0x1ae342[_0x95fa('0x7')]]={'uniqueid':_0x1ae342[_0x95fa('0x7')],'accountcode':_0x1ae342[_0x95fa('0x10')],'source':_0x1ae342['calleridnum'],'destination':_0x1ae342[_0x95fa('0x1a')],'destinationcontext':_0x1ae342['context'],'channel':_0x1ae342[_0x95fa('0xb')],'starttime':utils[_0x95fa('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x95fa('0x3'),'amaflags':_0x95fa('0x1c')};}}catch(_0x4071ff){utils['error'](util['format'](_0x95fa('0x16'),_0x1ae342[_0x95fa('0x7')]),_0x4071ff);}};exports[_0x95fa('0x1d')]=function(_0x384ad6){try{utils[_0x95fa('0x1e')](util[_0x95fa('0x9')]('[%s][calls][newstate]',_0x384ad6[_0x95fa('0x7')]),_0x384ad6);if(!_['isNil'](channels[_0x384ad6[_0x95fa('0x7')]])&&_0x384ad6[_0x95fa('0x1f')]==0x6){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x20'),_0x384ad6[_0x95fa('0x7')],_0x384ad6[_0x95fa('0x19')],_0x384ad6['channel']));if(_[_0x95fa('0x21')](channels[_0x384ad6[_0x95fa('0x7')]]['systemanswertime'])){channels[_0x384ad6[_0x95fa('0x7')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x384ad6[_0x95fa('0x17')]])&&_0x384ad6[_0x95fa('0x1f')]==0x6&&_0x384ad6[_0x95fa('0x19')]!='transfer'){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x22'),_0x384ad6[_0x95fa('0x7')],_0x384ad6[_0x95fa('0x17')],_0x384ad6[_0x95fa('0x19')],_0x384ad6[_0x95fa('0xb')]));channels[_0x384ad6[_0x95fa('0x17')]][_0x95fa('0x10')]=_0x384ad6[_0x95fa('0x10')];channels[_0x384ad6['linkedid']][_0x95fa('0x23')]=_0x384ad6[_0x95fa('0xb')];if(_['isNil'](channels[_0x384ad6[_0x95fa('0x17')]][_0x95fa('0x24')])){channels[_0x384ad6[_0x95fa('0x17')]][_0x95fa('0x24')]=utils[_0x95fa('0x1b')]();}channels[_0x384ad6[_0x95fa('0x17')]]['disposition']=dispositions[_[_0x95fa('0x25')](_0x384ad6[_0x95fa('0x1f')])]||_0x95fa('0x5');}}catch(_0xa06af3){utils[_0x95fa('0x26')](util[_0x95fa('0x9')](_0x95fa('0x27'),_0x384ad6[_0x95fa('0x7')]),_0xa06af3);}};exports[_0x95fa('0x28')]=function(_0x4267cb){try{if(!_['isNil'](channels[_0x4267cb[_0x95fa('0x7')]])){utils['debug'](util[_0x95fa('0x9')]('[%s][calls][hangup]',_0x4267cb[_0x95fa('0x7')]),_0x4267cb);if(_['isNil'](channels[_0x4267cb[_0x95fa('0x7')]]['callerid'])){channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x29')]=_0x4267cb['calleridname']+'\x20<'+_0x4267cb['calleridnum']+'>';}utils[_0x95fa('0x8')](util['format'](_0x95fa('0x2a'),_0x4267cb[_0x95fa('0x7')],channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x29')],_0x4267cb['cause-txt']));channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2b')]=utils[_0x95fa('0x1b')]();channels[_0x4267cb['uniqueid']][_0x95fa('0x2c')]=utils[_0x95fa('0x2d')](channels[_0x4267cb[_0x95fa('0x7')]]['endtime'],channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2e')]);channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2f')]=channels[_0x4267cb[_0x95fa('0x7')]]['answertime']?utils[_0x95fa('0x2d')](channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2b')],channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x24')]):0x0;writeDB(channels[_0x4267cb[_0x95fa('0x7')]]);}}catch(_0x2afc33){utils[_0x95fa('0x26')](util[_0x95fa('0x9')]('[%s][calls][hangup]',_0x4267cb[_0x95fa('0x7')]),_0x2afc33);}};exports[_0x95fa('0x30')]=function(_0x4c90a2){try{if(!_['isNil'](channels[_0x4c90a2[_0x95fa('0x31')]])){utils[_0x95fa('0x1e')](util[_0x95fa('0x9')]('[%s][calls][attendedtransfer]',_0x4c90a2[_0x95fa('0x32')]),_0x4c90a2);if(channels[_0x4c90a2['localtwolinkedid']][_0x95fa('0xb')]==_0x4c90a2[_0x95fa('0x33')]){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x34'),_0x4c90a2[_0x95fa('0x32')],_0x4c90a2[_0x95fa('0x31')],_0x4c90a2[_0x95fa('0x35')]));channels[_0x4c90a2[_0x95fa('0x31')]][_0x95fa('0x23')]=_0x4c90a2[_0x95fa('0x35')];channels[_0x4c90a2['localtwolinkedid']][_0x95fa('0x36')]=_0x95fa('0x37');}else if(channels[_0x4c90a2[_0x95fa('0x31')]]['channel']=_0x4c90a2[_0x95fa('0x38')]){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x34'),_0x4c90a2[_0x95fa('0x32')],_0x4c90a2['localtwolinkedid'],_0x4c90a2['origtransfererchannel']));channels[_0x4c90a2['localtwolinkedid']][_0x95fa('0x23')]=_0x4c90a2[_0x95fa('0x39')];channels[_0x4c90a2[_0x95fa('0x31')]]['userfield']=_0x95fa('0x37');}}}catch(_0x4875cb){utils[_0x95fa('0x26')](util[_0x95fa('0x9')]('[%s][calls][attendedtransfer]',_0x4c90a2[_0x95fa('0x32')]),_0x4875cb);}};exports[_0x95fa('0x3a')]=function(_0x3c0db5){try{if(!_[_0x95fa('0x21')](channels[_0x3c0db5['uniqueid']])){utils[_0x95fa('0x1e')](util[_0x95fa('0x9')](_0x95fa('0x3b'),_0x3c0db5[_0x95fa('0x7')]),_0x3c0db5);channels[_0x3c0db5[_0x95fa('0x7')]][_0x95fa('0x3c')]=utils[_0x95fa('0x1b')]();utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x3d'),_0x3c0db5[_0x95fa('0x7')],channels[_0x3c0db5[_0x95fa('0x7')]][_0x95fa('0x3c')]));}}catch(_0x39d742){utils[_0x95fa('0x26')](util['format']('[%s][calls][musiconholdstart]',_0x3c0db5['uniqueid']),_0x39d742);}};exports[_0x95fa('0x3e')]=function(_0x11d555){try{if(!_[_0x95fa('0x21')](channels[_0x11d555[_0x95fa('0x7')]])){utils[_0x95fa('0x1e')](util['format'](_0x95fa('0x3f'),_0x11d555[_0x95fa('0x7')]),_0x11d555);if(!_[_0x95fa('0x21')](channels[_0x11d555['uniqueid']][_0x95fa('0x3c')])){channels[_0x11d555[_0x95fa('0x7')]][_0x95fa('0x40')]+=utils[_0x95fa('0x2d')](utils[_0x95fa('0x1b')](),channels[_0x11d555[_0x95fa('0x7')]]['musiconholdstartAt']);utils['info'](util[_0x95fa('0x9')](_0x95fa('0x41'),_0x11d555[_0x95fa('0x7')],channels[_0x11d555[_0x95fa('0x7')]][_0x95fa('0x40')]));delete channels[_0x11d555[_0x95fa('0x7')]][_0x95fa('0x3c')];}}}catch(_0x16527a){utils[_0x95fa('0x26')](util[_0x95fa('0x9')](_0x95fa('0x3f'),_0x11d555[_0x95fa('0x7')]),_0x16527a);}};exports[_0x95fa('0x42')]=function(_0x5ee544){try{if(!_['isNil'](channels[_0x5ee544[_0x95fa('0x7')]])){utils['debug'](util[_0x95fa('0x9')](_0x95fa('0x43'),_0x5ee544[_0x95fa('0x7')]),_0x5ee544);if(!_['isNil'](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x45')])){utils[_0x95fa('0x8')](util['format'](_0x95fa('0x46'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x48')]=_0x5ee544['value'];}if(!_[_0x95fa('0x21')](_0x5ee544['variable'][_0x95fa('0x49')])){utils[_0x95fa('0x8')](util['format'](_0x95fa('0x4a'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x4b')]=_0x5ee544['value'];channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x29')]='\x22'+_0x5ee544[_0x95fa('0x47')]+_0x95fa('0x4c')+_0x5ee544[_0x95fa('0x47')]+'>';}if(!_['isNil'](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x4d')])||!_[_0x95fa('0x21')](_0x5ee544['variable'][_0x95fa('0x4e')])){utils['info'](util['format'](_0x95fa('0x4f'),_0x5ee544[_0x95fa('0x7')],!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x4d')])?_0x95fa('0x4d'):_0x95fa('0x4e'),_0x5ee544['value']));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x29')]=_0x5ee544['value'];}if(!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x50')])||!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x51')])){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x4f'),_0x5ee544['uniqueid'],!_['isNil'](_0x5ee544['variable']['xmd-queue'])?_0x95fa('0x50'):'xmcs-queue',_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]]['lastapplication']='Queue';channels[_0x5ee544['uniqueid']][_0x95fa('0x52')]=_0x5ee544['value'];channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x53')]=!![];}if(!_[_0x95fa('0x21')](_0x5ee544['variable']['xmd-contactid'])){utils[_0x95fa('0x8')](util['format'](_0x95fa('0x54'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544['uniqueid']][_0x95fa('0x55')]=_0x5ee544[_0x95fa('0x47')];}if(!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x56')])){utils['info'](util[_0x95fa('0x9')](_0x95fa('0x57'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x58')]=_0x5ee544[_0x95fa('0x47')];}if(!_[_0x95fa('0x21')](_0x5ee544['variable'][_0x95fa('0x59')])){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x5a'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544['uniqueid']][_0x95fa('0x5b')]=_0x5ee544[_0x95fa('0x47')];}if(!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x5c')])){utils['info'](util[_0x95fa('0x9')](_0x95fa('0x5d'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544['uniqueid']]['sipcallid']=_0x5ee544['value'];}}}catch(_0x33e806){utils[_0x95fa('0x26')](util[_0x95fa('0x9')](_0x95fa('0x43'),_0x5ee544['uniqueid']),_0x33e806);}};exports['newexten']=function(_0x545de2){try{if(!_[_0x95fa('0x21')](channels[_0x545de2[_0x95fa('0x7')]])){utils['debug'](util['format'](_0x95fa('0x5e'),_0x545de2[_0x95fa('0x7')]),_0x545de2);utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x5f'),_0x545de2[_0x95fa('0x7')],_0x545de2[_0x95fa('0x60')],_0x545de2[_0x95fa('0x61')]));if(_0x545de2['application'][_0x95fa('0x62')]()==_0x95fa('0x63')&&_['startsWith'](_0x545de2['appdata'][_0x95fa('0x62')](),_0x95fa('0x64'))){var _0x6f03b3=_0x545de2['appdata'][_0x95fa('0x65')]('=');var _0x44b0c2=_0x6f03b3[0x0][_0x95fa('0x66')](_0x6f03b3[0x0][_0x95fa('0x67')]('(')+0x1,_0x6f03b3[0x0][_0x95fa('0x67')](')'));var _0x4d65c1=_0x6f03b3[0x1];channels[_0x545de2['uniqueid']][_0x44b0c2]=_0x4d65c1;}if(!_[_0x95fa('0x68')]([_0x95fa('0x28'),_0x95fa('0x69'),_0x95fa('0x6a'),_0x95fa('0x63'),'gotoif'],_0x545de2[_0x95fa('0x60')]['toLowerCase']())){channels[_0x545de2[_0x95fa('0x7')]][_0x95fa('0x6b')]=_0x545de2[_0x95fa('0x60')];channels[_0x545de2[_0x95fa('0x7')]]['lastdata']=_0x545de2['appdata'];}}}catch(_0x323ab8){utils[_0x95fa('0x26')](util[_0x95fa('0x9')]('[%s][calls][newexten]',_0x545de2['uniqueid']),_0x323ab8);}}; \ No newline at end of file +var _0x2842=['./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newstate]','isNil','channelstate','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','noop','execif','util','./utils'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x2842,0x1ba));var _0x2284=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2842[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x2284('0x0'));var utils=require(_0x2284('0x1'));var transfers=require(_0x2284('0x2'));var dispositions=[_0x2284('0x3'),_0x2284('0x4'),'FAILED',_0x2284('0x3'),_0x2284('0x3'),'NO\x20ANSWER',_0x2284('0x5'),_0x2284('0x6'),_0x2284('0x4'),_0x2284('0x4'),_0x2284('0x4')];var channels={};function writeDB(_0x2f43bf){var _0x4f9375;if(transfers[_0x2284('0x7')][_0x2f43bf['uniqueid']]){_0x4f9375=_0x2f43bf[_0x2284('0x8')];_0x2f43bf[_0x2284('0x8')]=transfers[_0x2284('0x7')][_0x2f43bf['uniqueid']][_0x2284('0x9')];}utils['info'](util[_0x2284('0xa')](_0x2284('0xb'),_0x2f43bf[_0x2284('0x8')],_0x2f43bf[_0x2284('0xc')],_0x2f43bf[_0x2284('0xd')],_0x2f43bf[_0x2284('0xe')],_0x2f43bf[_0x2284('0xf')],_0x2f43bf['calleridnum'],_0x2f43bf[_0x2284('0x10')],_0x2f43bf['lastevent']));if(_0x2f43bf[_0x2284('0x11')]){utils[_0x2284('0x12')](_0x2f43bf[_0x2284('0x11')])[_0x2284('0x13')](function(_0x56b45b){if(_0x56b45b){_0x2f43bf[_0x2284('0x14')]=_0x56b45b['id'];}utils[_0x2284('0x15')]('CreateVoiceCallReport',_0x2f43bf);});}else{utils[_0x2284('0x15')]('CreateVoiceCallReport',_0x2f43bf);}if(channels[_0x2f43bf['uniqueid']]){delete channels[_0x2f43bf[_0x2284('0x8')]];}else if(_0x4f9375&&channels[_0x4f9375]){if(!transfers[_0x2284('0x7')][_0x4f9375][_0x2284('0x16')])delete transfers[_0x2284('0x7')][_0x4f9375];delete channels[_0x4f9375];}}exports[_0x2284('0x17')]=function(_0x578eff){try{utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x19'),_0x578eff['uniqueid']),_0x578eff);if(_0x578eff[_0x2284('0x8')]==_0x578eff[_0x2284('0x1a')]&&_0x578eff[_0x2284('0xc')]!=_0x2284('0x1b')){utils['info'](util[_0x2284('0xa')](_0x2284('0x1c'),_0x578eff['uniqueid'],_0x578eff[_0x2284('0x1d')],_0x578eff['exten']));channels[_0x578eff[_0x2284('0x8')]]={'uniqueid':_0x578eff['uniqueid'],'accountcode':_0x578eff[_0x2284('0x11')],'source':_0x578eff['calleridnum'],'destination':_0x578eff[_0x2284('0x1e')],'destinationcontext':_0x578eff[_0x2284('0x1d')],'channel':_0x578eff[_0x2284('0xc')],'starttime':utils[_0x2284('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2284('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x3e8f59){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x19'),_0x578eff[_0x2284('0x8')]),_0x3e8f59);}};exports['newstate']=function(_0x23e6f8){try{utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x21'),_0x23e6f8[_0x2284('0x8')]),_0x23e6f8);if(!_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x8')]])&&_0x23e6f8[_0x2284('0x23')]==0x6){utils[_0x2284('0x24')](util['format'](_0x2284('0x25'),_0x23e6f8[_0x2284('0x8')],_0x23e6f8[_0x2284('0x1d')],_0x23e6f8[_0x2284('0xc')]));if(_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x8')]]['systemanswertime'])){channels[_0x23e6f8[_0x2284('0x8')]][_0x2284('0x26')]=utils['now']();}}else if(!_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x1a')]])&&_0x23e6f8[_0x2284('0x23')]==0x6&&_0x23e6f8[_0x2284('0x1d')]!='transfer'){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x27'),_0x23e6f8[_0x2284('0x8')],_0x23e6f8[_0x2284('0x1a')],_0x23e6f8['context'],_0x23e6f8[_0x2284('0xc')]));channels[_0x23e6f8[_0x2284('0x1a')]][_0x2284('0x11')]=_0x23e6f8[_0x2284('0x11')];channels[_0x23e6f8[_0x2284('0x1a')]][_0x2284('0x28')]=_0x23e6f8[_0x2284('0xc')];if(_[_0x2284('0x22')](channels[_0x23e6f8[_0x2284('0x1a')]][_0x2284('0x29')])){channels[_0x23e6f8['linkedid']][_0x2284('0x29')]=utils['now']();}channels[_0x23e6f8[_0x2284('0x1a')]]['disposition']=dispositions[_[_0x2284('0x2a')](_0x23e6f8[_0x2284('0x23')])]||_0x2284('0x5');}}catch(_0x1d5b75){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x21'),_0x23e6f8[_0x2284('0x8')]),_0x1d5b75);}};exports[_0x2284('0x2b')]=function(_0x39e489){try{if(!_[_0x2284('0x22')](channels[_0x39e489[_0x2284('0x8')]])){utils[_0x2284('0x18')](util[_0x2284('0xa')]('[%s][calls][hangup]',_0x39e489[_0x2284('0x8')]),_0x39e489);if(_[_0x2284('0x22')](channels[_0x39e489['uniqueid']][_0x2284('0x2c')])){channels[_0x39e489[_0x2284('0x8')]]['callerid']=_0x39e489[_0x2284('0x2d')]+'\x20<'+_0x39e489[_0x2284('0x2e')]+'>';}utils[_0x2284('0x24')](util['format'](_0x2284('0x2f'),_0x39e489[_0x2284('0x8')],channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x2c')],_0x39e489[_0x2284('0x30')]));channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x31')]=utils[_0x2284('0x1f')]();channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x32')]=utils[_0x2284('0x33')](channels[_0x39e489['uniqueid']][_0x2284('0x31')],channels[_0x39e489['uniqueid']][_0x2284('0x34')]);channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x35')]=channels[_0x39e489['uniqueid']][_0x2284('0x29')]?utils['diffTime'](channels[_0x39e489[_0x2284('0x8')]][_0x2284('0x31')],channels[_0x39e489['uniqueid']][_0x2284('0x29')]):0x0;writeDB(channels[_0x39e489['uniqueid']]);}}catch(_0x5621d5){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x36'),_0x39e489[_0x2284('0x8')]),_0x5621d5);}};exports[_0x2284('0x37')]=function(_0x5912ef){try{if(!_['isNil'](channels[_0x5912ef[_0x2284('0x38')]])){utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x39'),_0x5912ef[_0x2284('0x3a')]),_0x5912ef);if(channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0xc')]==_0x5912ef[_0x2284('0x3b')]){utils['info'](util[_0x2284('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5912ef[_0x2284('0x3a')],_0x5912ef[_0x2284('0x38')],_0x5912ef[_0x2284('0x3c')]));channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0x28')]=_0x5912ef[_0x2284('0x3c')];channels[_0x5912ef['localtwolinkedid']][_0x2284('0x3d')]='_attended';}else if(channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0xc')]=_0x5912ef[_0x2284('0x3e')]){utils[_0x2284('0x24')](util['format'](_0x2284('0x3f'),_0x5912ef[_0x2284('0x3a')],_0x5912ef[_0x2284('0x38')],_0x5912ef['origtransfererchannel']));channels[_0x5912ef[_0x2284('0x38')]][_0x2284('0x28')]=_0x5912ef['origtransfererchannel'];channels[_0x5912ef[_0x2284('0x38')]]['userfield']=_0x2284('0x40');}}}catch(_0x5d9ef0){utils[_0x2284('0x20')](util['format'](_0x2284('0x39'),_0x5912ef[_0x2284('0x3a')]),_0x5d9ef0);}};exports['musiconholdstart']=function(_0x414a87){try{if(!_['isNil'](channels[_0x414a87['uniqueid']])){utils[_0x2284('0x18')](util['format'](_0x2284('0x41'),_0x414a87[_0x2284('0x8')]),_0x414a87);channels[_0x414a87[_0x2284('0x8')]][_0x2284('0x42')]=utils[_0x2284('0x1f')]();utils[_0x2284('0x24')](util['format'](_0x2284('0x43'),_0x414a87[_0x2284('0x8')],channels[_0x414a87[_0x2284('0x8')]][_0x2284('0x42')]));}}catch(_0x4e33c1){utils[_0x2284('0x20')](util['format'](_0x2284('0x41'),_0x414a87['uniqueid']),_0x4e33c1);}};exports['musiconholdstop']=function(_0xeecfae){try{if(!_['isNil'](channels[_0xeecfae['uniqueid']])){utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x44'),_0xeecfae[_0x2284('0x8')]),_0xeecfae);if(!_[_0x2284('0x22')](channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x42')])){channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x45')]+=utils['diffTime'](utils[_0x2284('0x1f')](),channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x42')]);utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x46'),_0xeecfae[_0x2284('0x8')],channels[_0xeecfae[_0x2284('0x8')]][_0x2284('0x45')]));delete channels[_0xeecfae['uniqueid']]['musiconholdstartAt'];}}}catch(_0x489bb1){utils[_0x2284('0x20')](util['format'](_0x2284('0x44'),_0xeecfae[_0x2284('0x8')]),_0x489bb1);}};exports[_0x2284('0x47')]=function(_0x5758ad){try{if(!_[_0x2284('0x22')](channels[_0x5758ad['uniqueid']])){utils[_0x2284('0x18')](util[_0x2284('0xa')]('[%s][calls][varset]',_0x5758ad['uniqueid']),_0x5758ad);if(!_[_0x2284('0x22')](_0x5758ad['variable'][_0x2284('0x48')])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x49'),_0x5758ad['uniqueid'],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]]['source']=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x4c')])){utils['info'](util[_0x2284('0xa')](_0x2284('0x4d'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x4e')]=_0x5758ad[_0x2284('0x4a')];channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x2c')]='\x22'+_0x5758ad[_0x2284('0x4a')]+_0x2284('0x4f')+_0x5758ad[_0x2284('0x4a')]+'>';}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x50')])||!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x51')])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x52'),_0x5758ad[_0x2284('0x8')],!_['isNil'](_0x5758ad[_0x2284('0x4b')]['xmd-callerid-preview'])?_0x2284('0x50'):'xmd-callerid',_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x2c')]=_0x5758ad[_0x2284('0x4a')];}if(!_['isNil'](_0x5758ad[_0x2284('0x4b')][_0x2284('0x53')])||!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')]['xmcs-queue'])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x52'),_0x5758ad['uniqueid'],!_['isNil'](_0x5758ad[_0x2284('0x4b')][_0x2284('0x53')])?'xmd-queue':_0x2284('0x54'),_0x5758ad['value']));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x55')]='Queue';channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x56')]=_0x5758ad[_0x2284('0x4a')];channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0xd')]=!![];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x57')])){utils['info'](util[_0x2284('0xa')](_0x2284('0x58'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x59')]=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x5a')])){utils[_0x2284('0x24')](util[_0x2284('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5758ad['uniqueid'],_0x5758ad['value']));channels[_0x5758ad[_0x2284('0x8')]][_0x2284('0x5b')]=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')][_0x2284('0x5c')])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x5d'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad[_0x2284('0x8')]]['routeid']=_0x5758ad[_0x2284('0x4a')];}if(!_[_0x2284('0x22')](_0x5758ad[_0x2284('0x4b')]['sipcallid'])){utils[_0x2284('0x24')](util[_0x2284('0xa')](_0x2284('0x5e'),_0x5758ad[_0x2284('0x8')],_0x5758ad[_0x2284('0x4a')]));channels[_0x5758ad['uniqueid']][_0x2284('0x5f')]=_0x5758ad[_0x2284('0x4a')];}}}catch(_0x5c7e93){utils[_0x2284('0x20')](util['format'](_0x2284('0x60'),_0x5758ad[_0x2284('0x8')]),_0x5c7e93);}};exports[_0x2284('0x61')]=function(_0x5cfd46){try{if(!_[_0x2284('0x22')](channels[_0x5cfd46[_0x2284('0x8')]])){utils[_0x2284('0x18')](util[_0x2284('0xa')](_0x2284('0x62'),_0x5cfd46['uniqueid']),_0x5cfd46);utils[_0x2284('0x24')](util['format'](_0x2284('0x63'),_0x5cfd46['uniqueid'],_0x5cfd46[_0x2284('0x64')],_0x5cfd46[_0x2284('0x65')]));if(_0x5cfd46[_0x2284('0x64')][_0x2284('0x66')]()==_0x2284('0x67')&&_[_0x2284('0x68')](_0x5cfd46['appdata'][_0x2284('0x66')](),_0x2284('0x69'))){var _0x10f52a=_0x5cfd46[_0x2284('0x65')][_0x2284('0x6a')]('=');var _0x44af90=_0x10f52a[0x0][_0x2284('0x6b')](_0x10f52a[0x0][_0x2284('0x6c')]('(')+0x1,_0x10f52a[0x0]['lastIndexOf'](')'));var _0x41e9de=_0x10f52a[0x1];channels[_0x5cfd46['uniqueid']][_0x44af90]=_0x41e9de;}if(!_['includes']([_0x2284('0x2b'),_0x2284('0x6d'),_0x2284('0x6e'),'set','gotoif'],_0x5cfd46[_0x2284('0x64')][_0x2284('0x66')]())){channels[_0x5cfd46[_0x2284('0x8')]][_0x2284('0x55')]=_0x5cfd46[_0x2284('0x64')];channels[_0x5cfd46['uniqueid']]['lastdata']=_0x5cfd46[_0x2284('0x65')];}}}catch(_0x24419d){utils[_0x2284('0x20')](util[_0x2284('0xa')](_0x2284('0x62'),_0x5cfd46['uniqueid']),_0x24419d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 62e00e0..2b2705d 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 _0x8ec4=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0xfad7d1,_0x70dc21){var _0x5ae04d=function(_0x170170){while(--_0x170170){_0xfad7d1['push'](_0xfad7d1['shift']());}};_0x5ae04d(++_0x70dc21);}(_0x8ec4,0x18b));var _0x48ec=function(_0x310ca7,_0x19e430){_0x310ca7=_0x310ca7-0x0;var _0x24f4bf=_0x8ec4[_0x310ca7];return _0x24f4bf;};'use strict';var utils=require(_0x48ec('0x0'));exports[_0x48ec('0x1')]=function(){utils[_0x48ec('0x2')](_0x48ec('0x3'));};exports[_0x48ec('0x4')]=function(){utils[_0x48ec('0x2')](_0x48ec('0x5'));};exports[_0x48ec('0x6')]=function(){utils[_0x48ec('0x2')]('[core]\x20fullybooted');};exports[_0x48ec('0x7')]=function(_0x4f4ebb){utils[_0x48ec('0x7')](_0x48ec('0x8'),_0x4f4ebb);};exports[_0x48ec('0x9')]=function(){utils[_0x48ec('0x2')](_0x48ec('0xa'));};exports[_0x48ec('0xb')]=function(_0x3fe2e1){}; \ No newline at end of file +var _0xaf2f=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0xaf2f,0xc5));var _0xfaf2=function(_0x363b17,_0x4ebce){_0x363b17=_0x363b17-0x0;var _0x1103a0=_0xaf2f[_0x363b17];return _0x1103a0;};'use strict';var utils=require(_0xfaf2('0x0'));exports[_0xfaf2('0x1')]=function(){utils[_0xfaf2('0x2')](_0xfaf2('0x3'));};exports[_0xfaf2('0x4')]=function(){utils[_0xfaf2('0x2')](_0xfaf2('0x5'));};exports['fullybooted']=function(){utils[_0xfaf2('0x2')](_0xfaf2('0x6'));};exports[_0xfaf2('0x7')]=function(_0x577c9b){utils[_0xfaf2('0x7')](_0xfaf2('0x8'),_0x577c9b);};exports[_0xfaf2('0x9')]=function(){utils[_0xfaf2('0x2')](_0xfaf2('0xa'));};exports['managerevent']=function(_0x3e3b2d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index e4437f9..89ad769 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 _0x0a58=['./utils','format','uniqueid','connectedlinenum','request','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','dialstatus','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash'];(function(_0x29f730,_0x23d7ed){var _0x189806=function(_0x2838a7){while(--_0x2838a7){_0x29f730['push'](_0x29f730['shift']());}};_0x189806(++_0x23d7ed);}(_0x0a58,0x1d5));var _0x80a5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a58[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80a5('0x0'));var util=require('util');var utils=require(_0x80a5('0x1'));var dials={};function writeDB(_0x30c20a){utils['info'](util[_0x80a5('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x30c20a[_0x80a5('0x3')],_0x30c20a['channel'],_0x30c20a['dialstring'],_0x30c20a['calleridnum'],_0x30c20a[_0x80a5('0x4')],_0x30c20a['dialstatus']));utils[_0x80a5('0x5')]('CreateVoiceDialReport',_0x30c20a);delete dials[_0x30c20a[_0x80a5('0x3')]];}exports[_0x80a5('0x6')]=function(_0x5f5b1e){try{utils[_0x80a5('0x7')](util[_0x80a5('0x2')](_0x80a5('0x8'),_0x5f5b1e['uniqueid']),_0x5f5b1e);utils[_0x80a5('0x9')](util[_0x80a5('0x2')](_0x80a5('0xa'),_0x5f5b1e['uniqueid'],_0x5f5b1e[_0x80a5('0xb')],_0x5f5b1e[_0x80a5('0xc')]));if(_0x5f5b1e[_0x80a5('0xb')]['toLowerCase']()=='set'&&_[_0x80a5('0xd')](_0x5f5b1e['appdata'][_0x80a5('0xe')](),_0x80a5('0xf'))){var _0x2b6ef3=_0x5f5b1e['appdata'][_0x80a5('0x10')]('=');dials[_0x5f5b1e['uniqueid']]={'routeId':_0x2b6ef3[0x1]};}}catch(_0x4f2ded){utils[_0x80a5('0x11')](util['format'](_0x80a5('0x8'),_0x5f5b1e[_0x80a5('0x3')]),_0x4f2ded);}};exports[_0x80a5('0x12')]=function(_0x1871f2){try{utils['debug'](util[_0x80a5('0x2')](_0x80a5('0x13'),_0x1871f2[_0x80a5('0x3')]),_0x1871f2);if(!_['isNil'](_0x1871f2[_0x80a5('0x14')][_0x80a5('0x15')])){utils[_0x80a5('0x9')](util[_0x80a5('0x2')](_0x80a5('0x16'),_0x1871f2[_0x80a5('0x3')],_0x1871f2[_0x80a5('0x17')]));dials[_0x1871f2[_0x80a5('0x3')]]={'routeId':_0x1871f2['value']};}}catch(_0x51da22){utils[_0x80a5('0x11')](util['format'](_0x80a5('0x13'),_0x1871f2[_0x80a5('0x3')]),_0x51da22);}};exports[_0x80a5('0x18')]=function(_0x12247d){try{if(!_[_0x80a5('0x19')](dials[_0x12247d[_0x80a5('0x3')]])){utils['debug'](util[_0x80a5('0x2')](_0x80a5('0x1a'),_0x12247d[_0x80a5('0x3')]),_0x12247d);dials[_0x12247d['uniqueid']]=_[_0x80a5('0x1b')](dials[_0x12247d[_0x80a5('0x3')]],_0x12247d);dials[_0x12247d[_0x80a5('0x3')]][_0x80a5('0x1c')]=utils[_0x80a5('0x1d')]();dials[_0x12247d['uniqueid']][_0x80a5('0x1e')]=_0x80a5('0x1f');utils['info'](util[_0x80a5('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x12247d[_0x80a5('0x3')],dials[_0x12247d[_0x80a5('0x3')]][_0x80a5('0x1c')]));}}catch(_0x12f9b7){utils['error'](util[_0x80a5('0x2')](_0x80a5('0x1a'),_0x12247d[_0x80a5('0x3')]),_0x12f9b7);}};exports[_0x80a5('0x20')]=function(_0x561ebf){try{if(!_[_0x80a5('0x19')](dials[_0x561ebf[_0x80a5('0x3')]])){utils[_0x80a5('0x7')](util[_0x80a5('0x2')]('[%s][dials][dialend]',_0x561ebf[_0x80a5('0x3')]),_0x561ebf);dials[_0x561ebf[_0x80a5('0x3')]][_0x80a5('0x21')]=_0x561ebf[_0x80a5('0x21')];if(_0x561ebf['dialstatus']==_0x80a5('0x22')){dials[_0x561ebf['uniqueid']]=_[_0x80a5('0x1b')](dials[_0x561ebf[_0x80a5('0x3')]],_0x561ebf);dials[_0x561ebf['uniqueid']]['answertime']=utils[_0x80a5('0x1d')]();dials[_0x561ebf[_0x80a5('0x3')]][_0x80a5('0x1e')]=_0x80a5('0x23');utils['info'](util[_0x80a5('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x561ebf[_0x80a5('0x3')],_0x561ebf['dialstatus'],dials[_0x561ebf[_0x80a5('0x3')]][_0x80a5('0x24')]));}else{utils['info'](util['format'](_0x80a5('0x25'),_0x561ebf['uniqueid'],_0x561ebf['dialstatus']));}}}catch(_0x3aa037){utils['error'](util[_0x80a5('0x2')]('[%s][dials][dialend]',_0x561ebf[_0x80a5('0x3')]),_0x3aa037);}};exports['hangup']=function(_0x78db1e){try{if(!_[_0x80a5('0x19')](dials[_0x78db1e[_0x80a5('0x3')]])){utils[_0x80a5('0x7')](util[_0x80a5('0x2')](_0x80a5('0x26'),_0x78db1e[_0x80a5('0x3')]),_0x78db1e);utils[_0x80a5('0x9')](util['format'](_0x80a5('0x27'),_0x78db1e[_0x80a5('0x3')],_0x78db1e['calleridnum'],_0x78db1e[_0x80a5('0x28')],_0x78db1e['cause-txt']));dials[_0x78db1e['uniqueid']]=_[_0x80a5('0x1b')](dials[_0x78db1e[_0x80a5('0x3')]],{'endtime':utils[_0x80a5('0x1d')](),'lastevent':_0x80a5('0x29')});dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x2a')]=utils[_0x80a5('0x2b')](dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x2c')],dials[_0x78db1e[_0x80a5('0x3')]]['starttime']);dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x2d')]=utils[_0x80a5('0x2b')](dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x24')]||dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x2c')],dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x1c')]);dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x2e')]=dials[_0x78db1e['uniqueid']][_0x80a5('0x24')]?utils[_0x80a5('0x2b')](dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x2c')],dials[_0x78db1e[_0x80a5('0x3')]][_0x80a5('0x24')]):0x0;writeDB(dials[_0x78db1e[_0x80a5('0x3')]]);}}catch(_0x1ceddd){utils[_0x80a5('0x11')](util[_0x80a5('0x2')](_0x80a5('0x26'),_0x78db1e['uniqueid']),_0x1ceddd);}}; \ No newline at end of file +var _0x2558=['[%s][dials][newexten]','application','toLowerCase','set','appdata','cdr(routeid)','split','varset','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','error','[%s][dials][dialend]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','debug'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0x2558,0x155));var _0x8255=function(_0x3ca0aa,_0x54136d){_0x3ca0aa=_0x3ca0aa-0x0;var _0xeb19d7=_0x2558[_0x3ca0aa];return _0xeb19d7;};'use strict';var _=require('lodash');var util=require(_0x8255('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x3ea403){utils[_0x8255('0x1')](util[_0x8255('0x2')](_0x8255('0x3'),_0x3ea403[_0x8255('0x4')],_0x3ea403[_0x8255('0x5')],_0x3ea403['dialstring'],_0x3ea403[_0x8255('0x6')],_0x3ea403[_0x8255('0x7')],_0x3ea403[_0x8255('0x8')]));utils[_0x8255('0x9')]('CreateVoiceDialReport',_0x3ea403);delete dials[_0x3ea403['uniqueid']];}exports['newexten']=function(_0x242cb6){try{utils[_0x8255('0xa')](util['format'](_0x8255('0xb'),_0x242cb6[_0x8255('0x4')]),_0x242cb6);utils[_0x8255('0x1')](util[_0x8255('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x242cb6[_0x8255('0x4')],_0x242cb6['application'],_0x242cb6['appdata']));if(_0x242cb6[_0x8255('0xc')][_0x8255('0xd')]()==_0x8255('0xe')&&_['startsWith'](_0x242cb6[_0x8255('0xf')][_0x8255('0xd')](),_0x8255('0x10'))){var _0x56e0c1=_0x242cb6[_0x8255('0xf')][_0x8255('0x11')]('=');dials[_0x242cb6['uniqueid']]={'routeId':_0x56e0c1[0x1]};}}catch(_0x11f067){utils['error'](util[_0x8255('0x2')]('[%s][dials][newexten]',_0x242cb6['uniqueid']),_0x11f067);}};exports[_0x8255('0x12')]=function(_0x288554){try{utils[_0x8255('0xa')](util[_0x8255('0x2')]('[%s][dials][varset]',_0x288554[_0x8255('0x4')]),_0x288554);if(!_[_0x8255('0x13')](_0x288554[_0x8255('0x14')]['outboundrouteid'])){utils[_0x8255('0x1')](util['format'](_0x8255('0x15'),_0x288554['uniqueid'],_0x288554[_0x8255('0x16')]));dials[_0x288554[_0x8255('0x4')]]={'routeId':_0x288554[_0x8255('0x16')]};}}catch(_0x152e70){utils['error'](util['format'](_0x8255('0x17'),_0x288554[_0x8255('0x4')]),_0x152e70);}};exports['dialbegin']=function(_0x423953){try{if(!_[_0x8255('0x13')](dials[_0x423953[_0x8255('0x4')]])){utils[_0x8255('0xa')](util[_0x8255('0x2')](_0x8255('0x18'),_0x423953[_0x8255('0x4')]),_0x423953);dials[_0x423953[_0x8255('0x4')]]=_[_0x8255('0x19')](dials[_0x423953['uniqueid']],_0x423953);dials[_0x423953[_0x8255('0x4')]][_0x8255('0x1a')]=utils['now']();dials[_0x423953[_0x8255('0x4')]][_0x8255('0x1b')]=_0x8255('0x1c');utils[_0x8255('0x1')](util[_0x8255('0x2')](_0x8255('0x1d'),_0x423953[_0x8255('0x4')],dials[_0x423953[_0x8255('0x4')]]['starttime']));}}catch(_0x527c2e){utils['error'](util[_0x8255('0x2')](_0x8255('0x18'),_0x423953[_0x8255('0x4')]),_0x527c2e);}};exports['dialend']=function(_0x43ae7c){try{if(!_['isNil'](dials[_0x43ae7c[_0x8255('0x4')]])){utils[_0x8255('0xa')](util[_0x8255('0x2')]('[%s][dials][dialend]',_0x43ae7c['uniqueid']),_0x43ae7c);dials[_0x43ae7c[_0x8255('0x4')]][_0x8255('0x8')]=_0x43ae7c[_0x8255('0x8')];if(_0x43ae7c['dialstatus']=='ANSWER'){dials[_0x43ae7c['uniqueid']]=_[_0x8255('0x19')](dials[_0x43ae7c[_0x8255('0x4')]],_0x43ae7c);dials[_0x43ae7c['uniqueid']][_0x8255('0x1e')]=utils[_0x8255('0x1f')]();dials[_0x43ae7c[_0x8255('0x4')]][_0x8255('0x1b')]=_0x8255('0x20');utils[_0x8255('0x1')](util[_0x8255('0x2')](_0x8255('0x21'),_0x43ae7c[_0x8255('0x4')],_0x43ae7c[_0x8255('0x8')],dials[_0x43ae7c[_0x8255('0x4')]]['answertime']));}else{utils[_0x8255('0x1')](util[_0x8255('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x43ae7c['uniqueid'],_0x43ae7c[_0x8255('0x8')]));}}}catch(_0x523ec3){utils[_0x8255('0x22')](util[_0x8255('0x2')](_0x8255('0x23'),_0x43ae7c[_0x8255('0x4')]),_0x523ec3);}};exports['hangup']=function(_0x4bdb7c){try{if(!_[_0x8255('0x13')](dials[_0x4bdb7c[_0x8255('0x4')]])){utils[_0x8255('0xa')](util[_0x8255('0x2')]('[%s][dials][hangup]',_0x4bdb7c[_0x8255('0x4')]),_0x4bdb7c);utils[_0x8255('0x1')](util[_0x8255('0x2')](_0x8255('0x24'),_0x4bdb7c[_0x8255('0x4')],_0x4bdb7c[_0x8255('0x6')],_0x4bdb7c[_0x8255('0x25')],_0x4bdb7c[_0x8255('0x26')]));dials[_0x4bdb7c[_0x8255('0x4')]]=_[_0x8255('0x19')](dials[_0x4bdb7c[_0x8255('0x4')]],{'endtime':utils[_0x8255('0x1f')](),'lastevent':_0x8255('0x27')});dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x28')]=utils[_0x8255('0x29')](dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x2a')],dials[_0x4bdb7c['uniqueid']][_0x8255('0x1a')]);dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x2b')]=utils[_0x8255('0x29')](dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x1e')]||dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x2a')],dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x1a')]);dials[_0x4bdb7c['uniqueid']]['billableseconds']=dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x1e')]?utils[_0x8255('0x29')](dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x2a')],dials[_0x4bdb7c[_0x8255('0x4')]][_0x8255('0x1e')]):0x0;writeDB(dials[_0x4bdb7c[_0x8255('0x4')]]);}}catch(_0x239e4d){utils[_0x8255('0x22')](util['format']('[%s][dials][hangup]',_0x4bdb7c[_0x8255('0x4')]),_0x239e4d);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 5c5aed8..110716e 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 _0x3df9=['cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','xdr','disabled','local','port','asterisk','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','debug','format','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]'];(function(_0x30eab9,_0x43e1e5){var _0x4e25eb=function(_0x486389){while(--_0x486389){_0x30eab9['push'](_0x30eab9['shift']());}};_0x4e25eb(++_0x43e1e5);}(_0x3df9,0x11c));var _0x93df=function(_0xec306d,_0x2c44af){_0xec306d=_0xec306d-0x0;var _0x4fd78a=_0x3df9[_0xec306d];return _0x4fd78a;};var AsteriskManager=require(_0x93df('0x0'));var config=require(_0x93df('0x1'));var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0x93df('0x2')]&&config['xdr'][_0x93df('0x3')]?!config[_0x93df('0x2')]['disabled']:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x93df('0x2')]&&config[_0x93df('0x2')][_0x93df('0x4')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x93df('0x5')],config[_0x93df('0x6')]['ip'],config['asterisk'][_0x93df('0x7')],config[_0x93df('0x6')][_0x93df('0x8')],!![]);ami[_0x93df('0x9')]();if(!isXDREnabled){utils[_0x93df('0xa')](_0x93df('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x93df('0xa')](_0x93df('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x93df('0xd'));var queues=require(_0x93df('0xe'));var recordings=require(_0x93df('0xf'));var members=require('./members.controller');var dials=require(_0x93df('0x10'));var transfers=require(_0x93df('0x11'));var core=require(_0x93df('0x12'));ami['on'](_0x93df('0x13'),core[_0x93df('0x13')]);ami['on'](_0x93df('0x14'),core['shutdown']);ami['on']('fullybooted',core[_0x93df('0x15')]);ami['on']('error',core[_0x93df('0x16')]);ami['on']('close',core['close']);ami['on'](_0x93df('0x17'),core[_0x93df('0x17')]);ami['on'](_0x93df('0x18'),function(_0x4ea11b){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')]('[%s][index][devicestatechange]',_0x4ea11b[_0x93df('0x1b')]),_0x4ea11b);members[_0x93df('0x18')](_0x4ea11b);}catch(_0x4bd84d){utils[_0x93df('0x16')](util['format']('[%s][index][devicestatechange]',_0x4ea11b[_0x93df('0x1b')]),_0x4bd84d);}});ami['on']('agentcalled',function(_0x83af1b){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')](_0x93df('0x1c'),_0x83af1b[_0x93df('0x1d')]),_0x83af1b);agents[_0x93df('0x1e')](_0x83af1b);}catch(_0x5784c3){utils['error'](util[_0x93df('0x1a')](_0x93df('0x1c'),_0x83af1b['uniqueid']),_0x5784c3);}});ami['on'](_0x93df('0x1f'),function(_0x225568){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')](_0x93df('0x20'),_0x225568['uniqueid']),_0x225568);agents[_0x93df('0x1f')](_0x225568);}catch(_0x44d165){utils[_0x93df('0x16')](util[_0x93df('0x1a')](_0x93df('0x20'),_0x225568[_0x93df('0x1d')]),_0x44d165);}});ami['on']('agentconnect',function(_0x489d78){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')](_0x93df('0x21'),_0x489d78['uniqueid']),_0x489d78);agents[_0x93df('0x22')](_0x489d78);queues['agentconnect'](_0x489d78);}catch(_0x3a9bf8){utils[_0x93df('0x16')](util['format'](_0x93df('0x21'),_0x489d78[_0x93df('0x1d')]),_0x3a9bf8);}});ami['on']('agentcomplete',function(_0x1ca903){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')](_0x93df('0x23'),_0x1ca903[_0x93df('0x1d')]),_0x1ca903);agents[_0x93df('0x24')](_0x1ca903);queues['agentcomplete'](_0x1ca903);members[_0x93df('0x24')](_0x1ca903);}catch(_0xdbfda3){utils['error'](util[_0x93df('0x1a')](_0x93df('0x23'),_0x1ca903[_0x93df('0x1d')]),_0xdbfda3);}});ami['on'](_0x93df('0x25'),function(_0xcd098e){try{utils['debug'](util[_0x93df('0x1a')](_0x93df('0x26'),_0xcd098e['uniqueid']),_0xcd098e);agents['queuecallerabandon'](_0xcd098e);queues['queuecallerabandon'](_0xcd098e);}catch(_0x566364){utils[_0x93df('0x16')](util[_0x93df('0x1a')]('[%s][index][queuecallerabandon]',_0xcd098e[_0x93df('0x1d')]),_0x566364);}});ami['on'](_0x93df('0x27'),function(_0x15dc93){try{utils[_0x93df('0x19')](util['format'](_0x93df('0x28'),_0x15dc93[_0x93df('0x1d')]),_0x15dc93);queues['queuecallerjoin'](_0x15dc93);recordings[_0x93df('0x27')](_0x15dc93);}catch(_0x14ff86){utils['error'](util[_0x93df('0x1a')](_0x93df('0x28'),_0x15dc93[_0x93df('0x1d')]),_0x14ff86);}});ami['on'](_0x93df('0x29'),function(_0x274aa1){try{utils['debug'](util[_0x93df('0x1a')](_0x93df('0x2a'),_0x274aa1[_0x93df('0x1d')]),_0x274aa1);queues[_0x93df('0x29')](_0x274aa1);}catch(_0x5abc4f){utils['error'](util[_0x93df('0x1a')](_0x93df('0x2a'),_0x274aa1[_0x93df('0x1d')]),_0x5abc4f);}});ami['on']('musiconholdstart',function(_0x427f4b){try{utils[_0x93df('0x19')](util['format'](_0x93df('0x2b'),_0x427f4b[_0x93df('0x1d')]),_0x427f4b);queues['musiconholdstart'](_0x427f4b);calls[_0x93df('0x2c')](_0x427f4b);}catch(_0x2143e1){utils[_0x93df('0x16')](util[_0x93df('0x1a')](_0x93df('0x2b'),_0x427f4b['uniqueid']),_0x2143e1);}});ami['on'](_0x93df('0x2d'),function(_0x5648c8){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')](_0x93df('0x2e'),_0x5648c8['uniqueid']),_0x5648c8);queues[_0x93df('0x2d')](_0x5648c8);calls[_0x93df('0x2d')](_0x5648c8);}catch(_0x452265){utils['error'](util[_0x93df('0x1a')](_0x93df('0x2e'),_0x5648c8[_0x93df('0x1d')]),_0x452265);}});ami['on'](_0x93df('0x2f'),function(_0x1f17d5){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')](_0x93df('0x30'),_0x1f17d5[_0x93df('0x1d')]),_0x1f17d5);calls[_0x93df('0x2f')](_0x1f17d5);recordings[_0x93df('0x2f')](_0x1f17d5);}catch(_0x363a06){utils[_0x93df('0x16')](util[_0x93df('0x1a')](_0x93df('0x30'),_0x1f17d5['uniqueid']),_0x363a06);}});ami['on'](_0x93df('0x31'),function(_0x167688){try{utils['debug'](util[_0x93df('0x1a')](_0x93df('0x32'),_0x167688[_0x93df('0x1d')]),_0x167688);calls['hangup'](_0x167688);recordings[_0x93df('0x31')](_0x167688);dials[_0x93df('0x31')](_0x167688);agents[_0x93df('0x31')](_0x167688);queues[_0x93df('0x31')](_0x167688);}catch(_0x372fb5){utils[_0x93df('0x16')](util['format'](_0x93df('0x32'),_0x167688[_0x93df('0x1d')]),_0x372fb5);}});ami['on'](_0x93df('0x33'),function(_0x2b31d8){try{utils[_0x93df('0x19')](util['format'](_0x93df('0x34'),_0x2b31d8['uniqueid']),_0x2b31d8);members['cdr'](_0x2b31d8);}catch(_0x1f2ddd){utils[_0x93df('0x16')](util['format'](_0x93df('0x34'),_0x2b31d8[_0x93df('0x1d')]),_0x1f2ddd);}});ami['on'](_0x93df('0x35'),function(_0x4cbea0){try{utils['debug'](util[_0x93df('0x1a')](_0x93df('0x36'),_0x4cbea0[_0x93df('0x1d')]),_0x4cbea0);queues[_0x93df('0x35')](_0x4cbea0);agents[_0x93df('0x35')](_0x4cbea0);transfers['blindtransfer'](_0x4cbea0);recordings[_0x93df('0x35')](_0x4cbea0);}catch(_0x5b4ef9){utils['error'](util[_0x93df('0x1a')](_0x93df('0x36'),_0x4cbea0['uniqueid']),_0x5b4ef9);}});ami['on']('attendedtransfer',function(_0x534c61){try{utils['debug'](util[_0x93df('0x1a')](_0x93df('0x37'),_0x534c61[_0x93df('0x38')]),_0x534c61);queues[_0x93df('0x39')](_0x534c61);transfers[_0x93df('0x39')](_0x534c61);agents[_0x93df('0x39')](_0x534c61);calls[_0x93df('0x39')](_0x534c61);}catch(_0xf0d86f){utils[_0x93df('0x16')](util[_0x93df('0x1a')]('[%s][index][attendedtransfer]',_0x534c61[_0x93df('0x38')]),_0xf0d86f);}});ami['on'](_0x93df('0x3a'),function(_0x2ac00e){try{utils[_0x93df('0x19')](util['format'](_0x93df('0x3b'),_0x2ac00e['uniqueid']),_0x2ac00e);queues[_0x93df('0x3a')](_0x2ac00e);recordings[_0x93df('0x3a')](_0x2ac00e);calls[_0x93df('0x3a')](_0x2ac00e);dials[_0x93df('0x3a')](_0x2ac00e);}catch(_0x4617d0){utils[_0x93df('0x16')](util[_0x93df('0x1a')](_0x93df('0x3b'),_0x2ac00e[_0x93df('0x1d')]),_0x4617d0);}});ami['on'](_0x93df('0x3c'),function(_0x248fe1){try{utils['debug'](util[_0x93df('0x1a')]('[%s][index][newexten]',_0x248fe1[_0x93df('0x1d')]),_0x248fe1);calls[_0x93df('0x3c')](_0x248fe1);recordings[_0x93df('0x3c')](_0x248fe1);dials[_0x93df('0x3c')](_0x248fe1);}catch(_0x5ca5e5){utils[_0x93df('0x16')](util[_0x93df('0x1a')]('[%s][index][newexten]',_0x248fe1['uniqueid']),_0x5ca5e5);}});ami['on'](_0x93df('0x3d'),function(_0x53bdcb){try{utils[_0x93df('0x19')](util['format'](_0x93df('0x3e'),_0x53bdcb['uniqueid']),_0x53bdcb);calls[_0x93df('0x3d')](_0x53bdcb);recordings[_0x93df('0x3d')](_0x53bdcb);}catch(_0x81261b){utils['error'](util['format'](_0x93df('0x3e'),_0x53bdcb[_0x93df('0x1d')]),_0x81261b);}});ami['on']('dialbegin',function(_0x2b0411){try{utils[_0x93df('0x19')](util[_0x93df('0x1a')]('[%s][index][dialbegin]',_0x2b0411[_0x93df('0x1d')]),_0x2b0411);dials[_0x93df('0x3f')](_0x2b0411);}catch(_0x14ba46){utils[_0x93df('0x16')](util['format'](_0x93df('0x40'),_0x2b0411[_0x93df('0x1d')]),_0x14ba46);}});ami['on'](_0x93df('0x41'),function(_0x36d7d7){try{utils['debug'](util['format']('[%s][index][dialend]',_0x36d7d7[_0x93df('0x1d')]),_0x36d7d7);dials[_0x93df('0x41')](_0x36d7d7);}catch(_0x567a02){utils[_0x93df('0x16')](util['format'](_0x93df('0x42'),_0x36d7d7[_0x93df('0x1d')]),_0x567a02);}});} \ No newline at end of file +var _0xaa72=['info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected'];(function(_0x3c558b,_0x30549e){var _0x319b53=function(_0x38ec6d){while(--_0x38ec6d){_0x3c558b['push'](_0x3c558b['shift']());}};_0x319b53(++_0x30549e);}(_0xaa72,0x1ea));var _0x2aa7=function(_0x3f87a4,_0x33293d){_0x3f87a4=_0x3f87a4-0x0;var _0x53b24a=_0xaa72[_0x3f87a4];return _0x53b24a;};var AsteriskManager=require(_0x2aa7('0x0'));var config=require(_0x2aa7('0x1'));var utils=require(_0x2aa7('0x2'));var util=require(_0x2aa7('0x3'));var isXDREnabled=config[_0x2aa7('0x4')]&&config['xdr'][_0x2aa7('0x5')]?!config['xdr'][_0x2aa7('0x5')]:!![];var isProduction=config[_0x2aa7('0x6')]===_0x2aa7('0x7')||![];var isLocalAsterisk=config[_0x2aa7('0x4')]&&config[_0x2aa7('0x4')][_0x2aa7('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x2aa7('0x9')][_0x2aa7('0xa')],config[_0x2aa7('0x9')]['ip'],config['asterisk'][_0x2aa7('0xb')],config[_0x2aa7('0x9')][_0x2aa7('0xc')],!![]);ami[_0x2aa7('0xd')]();if(!isXDREnabled){utils[_0x2aa7('0xe')](_0x2aa7('0xf'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x2aa7('0xe')](_0x2aa7('0x10'));}else{var agents=require(_0x2aa7('0x11'));var calls=require(_0x2aa7('0x12'));var queues=require(_0x2aa7('0x13'));var recordings=require(_0x2aa7('0x14'));var members=require(_0x2aa7('0x15'));var dials=require('./dials.controller');var transfers=require(_0x2aa7('0x16'));var core=require(_0x2aa7('0x17'));ami['on'](_0x2aa7('0x18'),core[_0x2aa7('0x18')]);ami['on'](_0x2aa7('0x19'),core[_0x2aa7('0x19')]);ami['on'](_0x2aa7('0x1a'),core[_0x2aa7('0x1a')]);ami['on'](_0x2aa7('0x1b'),core[_0x2aa7('0x1b')]);ami['on'](_0x2aa7('0x1c'),core[_0x2aa7('0x1c')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x2aa7('0x1d'),function(_0x3db820){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x20'),_0x3db820[_0x2aa7('0x21')]),_0x3db820);members['devicestatechange'](_0x3db820);}catch(_0x2dea41){utils[_0x2aa7('0x1b')](util['format'](_0x2aa7('0x20'),_0x3db820[_0x2aa7('0x21')]),_0x2dea41);}});ami['on'](_0x2aa7('0x22'),function(_0x186cf1){try{utils[_0x2aa7('0x1e')](util['format']('[%s][index][agentcalled]',_0x186cf1[_0x2aa7('0x23')]),_0x186cf1);agents['agentcalled'](_0x186cf1);}catch(_0x39296d){utils['error'](util[_0x2aa7('0x1f')]('[%s][index][agentcalled]',_0x186cf1[_0x2aa7('0x23')]),_0x39296d);}});ami['on'](_0x2aa7('0x24'),function(_0x293eec){try{utils[_0x2aa7('0x1e')](util['format'](_0x2aa7('0x25'),_0x293eec[_0x2aa7('0x23')]),_0x293eec);agents[_0x2aa7('0x24')](_0x293eec);}catch(_0x979653){utils[_0x2aa7('0x1b')](util['format'](_0x2aa7('0x25'),_0x293eec[_0x2aa7('0x23')]),_0x979653);}});ami['on'](_0x2aa7('0x26'),function(_0x4c92c8){try{utils['debug'](util[_0x2aa7('0x1f')](_0x2aa7('0x27'),_0x4c92c8[_0x2aa7('0x23')]),_0x4c92c8);agents[_0x2aa7('0x26')](_0x4c92c8);queues[_0x2aa7('0x26')](_0x4c92c8);}catch(_0x4bc26b){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x27'),_0x4c92c8[_0x2aa7('0x23')]),_0x4bc26b);}});ami['on'](_0x2aa7('0x28'),function(_0x26328f){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x29'),_0x26328f[_0x2aa7('0x23')]),_0x26328f);agents[_0x2aa7('0x28')](_0x26328f);queues[_0x2aa7('0x28')](_0x26328f);members['agentcomplete'](_0x26328f);}catch(_0x1f9834){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x29'),_0x26328f[_0x2aa7('0x23')]),_0x1f9834);}});ami['on']('queuecallerabandon',function(_0x556fd5){try{utils['debug'](util['format'](_0x2aa7('0x2a'),_0x556fd5[_0x2aa7('0x23')]),_0x556fd5);agents[_0x2aa7('0x2b')](_0x556fd5);queues[_0x2aa7('0x2b')](_0x556fd5);}catch(_0x75357e){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')]('[%s][index][queuecallerabandon]',_0x556fd5['uniqueid']),_0x75357e);}});ami['on'](_0x2aa7('0x2c'),function(_0xfd79af){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x2d'),_0xfd79af[_0x2aa7('0x23')]),_0xfd79af);queues[_0x2aa7('0x2c')](_0xfd79af);recordings[_0x2aa7('0x2c')](_0xfd79af);}catch(_0x2392e9){utils['error'](util[_0x2aa7('0x1f')]('[%s][index][queuecallerjoin]',_0xfd79af['uniqueid']),_0x2392e9);}});ami['on'](_0x2aa7('0x2e'),function(_0x93cd9c){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')]('[%s][index][queuecallerleave]',_0x93cd9c[_0x2aa7('0x23')]),_0x93cd9c);queues[_0x2aa7('0x2e')](_0x93cd9c);}catch(_0x2f54fb){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x2f'),_0x93cd9c[_0x2aa7('0x23')]),_0x2f54fb);}});ami['on'](_0x2aa7('0x30'),function(_0x5626ce){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x31'),_0x5626ce['uniqueid']),_0x5626ce);queues[_0x2aa7('0x30')](_0x5626ce);calls[_0x2aa7('0x30')](_0x5626ce);}catch(_0x54009c){utils['error'](util[_0x2aa7('0x1f')]('[%s][index][musiconholdstart]',_0x5626ce['uniqueid']),_0x54009c);}});ami['on'](_0x2aa7('0x32'),function(_0x39a399){try{utils['debug'](util['format'](_0x2aa7('0x33'),_0x39a399[_0x2aa7('0x23')]),_0x39a399);queues['musiconholdstop'](_0x39a399);calls[_0x2aa7('0x32')](_0x39a399);}catch(_0x375fed){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x33'),_0x39a399[_0x2aa7('0x23')]),_0x375fed);}});ami['on'](_0x2aa7('0x34'),function(_0x1ac4dd){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x35'),_0x1ac4dd[_0x2aa7('0x23')]),_0x1ac4dd);calls[_0x2aa7('0x34')](_0x1ac4dd);recordings[_0x2aa7('0x34')](_0x1ac4dd);}catch(_0x4ca527){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x35'),_0x1ac4dd['uniqueid']),_0x4ca527);}});ami['on'](_0x2aa7('0x36'),function(_0x17c755){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x37'),_0x17c755[_0x2aa7('0x23')]),_0x17c755);calls['hangup'](_0x17c755);recordings[_0x2aa7('0x36')](_0x17c755);dials[_0x2aa7('0x36')](_0x17c755);agents[_0x2aa7('0x36')](_0x17c755);queues[_0x2aa7('0x36')](_0x17c755);}catch(_0x4db55c){utils['error'](util[_0x2aa7('0x1f')](_0x2aa7('0x37'),_0x17c755[_0x2aa7('0x23')]),_0x4db55c);}});ami['on']('cdr',function(_0xb59dd8){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x38'),_0xb59dd8[_0x2aa7('0x23')]),_0xb59dd8);members[_0x2aa7('0x39')](_0xb59dd8);}catch(_0x3f1a61){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x38'),_0xb59dd8['uniqueid']),_0x3f1a61);}});ami['on']('blindtransfer',function(_0x396897){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')](_0x2aa7('0x3a'),_0x396897['uniqueid']),_0x396897);queues['blindtransfer'](_0x396897);agents[_0x2aa7('0x3b')](_0x396897);transfers[_0x2aa7('0x3b')](_0x396897);recordings['blindtransfer'](_0x396897);}catch(_0x2985d7){utils[_0x2aa7('0x1b')](util['format'](_0x2aa7('0x3a'),_0x396897['uniqueid']),_0x2985d7);}});ami['on']('attendedtransfer',function(_0x1d5e00){try{utils['debug'](util[_0x2aa7('0x1f')](_0x2aa7('0x3c'),_0x1d5e00[_0x2aa7('0x3d')]),_0x1d5e00);queues['attendedtransfer'](_0x1d5e00);transfers[_0x2aa7('0x3e')](_0x1d5e00);agents[_0x2aa7('0x3e')](_0x1d5e00);calls[_0x2aa7('0x3e')](_0x1d5e00);}catch(_0x1aea55){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')]('[%s][index][attendedtransfer]',_0x1d5e00[_0x2aa7('0x3d')]),_0x1aea55);}});ami['on']('varset',function(_0x544fa9){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')]('[%s][index][varset]',_0x544fa9[_0x2aa7('0x23')]),_0x544fa9);queues['varset'](_0x544fa9);recordings['varset'](_0x544fa9);calls[_0x2aa7('0x3f')](_0x544fa9);dials[_0x2aa7('0x3f')](_0x544fa9);}catch(_0x8e84f8){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x40'),_0x544fa9['uniqueid']),_0x8e84f8);}});ami['on'](_0x2aa7('0x41'),function(_0x479812){try{utils[_0x2aa7('0x1e')](util[_0x2aa7('0x1f')]('[%s][index][newexten]',_0x479812['uniqueid']),_0x479812);calls['newexten'](_0x479812);recordings[_0x2aa7('0x41')](_0x479812);dials[_0x2aa7('0x41')](_0x479812);}catch(_0x9e8185){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')]('[%s][index][newexten]',_0x479812[_0x2aa7('0x23')]),_0x9e8185);}});ami['on'](_0x2aa7('0x42'),function(_0x2e7a71){try{utils['debug'](util[_0x2aa7('0x1f')](_0x2aa7('0x43'),_0x2e7a71[_0x2aa7('0x23')]),_0x2e7a71);calls[_0x2aa7('0x42')](_0x2e7a71);recordings['newchannel'](_0x2e7a71);}catch(_0x337b8f){utils['error'](util[_0x2aa7('0x1f')](_0x2aa7('0x43'),_0x2e7a71[_0x2aa7('0x23')]),_0x337b8f);}});ami['on'](_0x2aa7('0x44'),function(_0x3f950f){try{utils['debug'](util[_0x2aa7('0x1f')]('[%s][index][dialbegin]',_0x3f950f[_0x2aa7('0x23')]),_0x3f950f);dials[_0x2aa7('0x44')](_0x3f950f);}catch(_0x4fd0a5){utils[_0x2aa7('0x1b')](util[_0x2aa7('0x1f')](_0x2aa7('0x45'),_0x3f950f[_0x2aa7('0x23')]),_0x4fd0a5);}});ami['on'](_0x2aa7('0x46'),function(_0x1b96f3){try{utils['debug'](util[_0x2aa7('0x1f')]('[%s][index][dialend]',_0x1b96f3['uniqueid']),_0x1b96f3);dials['dialend'](_0x1b96f3);}catch(_0x51898f){utils['error'](util['format'](_0x2aa7('0x47'),_0x1b96f3[_0x2aa7('0x23')]),_0x51898f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1d54d00..f56597b 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 _0x18ab=['[%s][members][cdr]','channel','split','assign','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','type','membername','name','internal','request','getUserByName','then','CreateMemberReport','[%s][members][writeDB]','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','now','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','info','queue','error','cdr'];(function(_0x294f35,_0x5e4ac6){var _0x31e18a=function(_0x5b445c){while(--_0x5b445c){_0x294f35['push'](_0x294f35['shift']());}};_0x31e18a(++_0x5e4ac6);}(_0x18ab,0xd2));var _0xb18a=function(_0x65b813,_0x222912){_0x65b813=_0x65b813-0x0;var _0x2d0494=_0x18ab[_0x65b813];return _0x2d0494;};'use strict';var _=require(_0xb18a('0x0'));var util=require(_0xb18a('0x1'));var utils=require(_0xb18a('0x2'));var members={};var exclude=[_0xb18a('0x3'),_0xb18a('0x4')];function writeDB(_0x131b9d){utils['info'](util[_0xb18a('0x5')](_0xb18a('0x6'),_0x131b9d[_0xb18a('0x7')],_0x131b9d[_0xb18a('0x8')],_0x131b9d['channel'],_0x131b9d[_0xb18a('0x9')],_0x131b9d['membername'],_0x131b9d[_0xb18a('0xa')]));if(_0x131b9d[_0xb18a('0x8')]){utils['getUserByInterface'](_0x131b9d[_0xb18a('0x8')])['then'](function(_0x1c02aa){if(_0x1c02aa){_0x131b9d[_0xb18a('0xb')]=_0x1c02aa[_0xb18a('0xc')];_0x131b9d['internal']=_0x1c02aa[_0xb18a('0xd')];utils[_0xb18a('0xe')]('CreateMemberReport',_0x131b9d);}else{utils[_0xb18a('0xf')](_0x131b9d[_0xb18a('0x8')]['split']('/')[0x1])[_0xb18a('0x10')](function(_0x38b003){if(_0x38b003){_0x131b9d[_0xb18a('0xb')]=_0x38b003[_0xb18a('0xc')];_0x131b9d[_0xb18a('0xd')]=_0x38b003[_0xb18a('0xd')];utils['request'](_0xb18a('0x11'),_0x131b9d);}});}})['catch'](function(_0x17d2b7){utils['error'](util[_0xb18a('0x5')](_0xb18a('0x12'),_0x131b9d[_0xb18a('0x7')]),_0x17d2b7);});}delete members[_0x131b9d['interface']];}function startsWith(_0x253028,_0x18a881){return _[_0xb18a('0x13')](_0x253028,function(_0x13cec1){return _[_0xb18a('0x14')](_0x18a881,_0x13cec1);});}exports[_0xb18a('0x15')]=function(_0x53b441){try{utils['debug'](util[_0xb18a('0x5')](_0xb18a('0x16'),members[_0x53b441['device']]?members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x7')]:_0x53b441[_0xb18a('0x17')]),_0x53b441);utils['info'](util[_0xb18a('0x5')](_0xb18a('0x18'),members[_0x53b441[_0xb18a('0x17')]]?members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x7')]:_0x53b441[_0xb18a('0x17')],_0x53b441[_0xb18a('0x19')],_0x53b441[_0xb18a('0x17')]));switch(_0x53b441[_0xb18a('0x19')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x53b441[_0xb18a('0x17')])){members[_0x53b441[_0xb18a('0x17')]]={'channel':_0xb18a('0x1a'),'interface':_0x53b441[_0xb18a('0x17')],'type':'TALKING','enterAt':utils[_0xb18a('0x1b')](),'role':'agent'};}break;case _0xb18a('0x1c'):if(!_[_0xb18a('0x1d')](members[_0x53b441[_0xb18a('0x17')]])){members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x1e')]=utils[_0xb18a('0x1b')]();members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x1f')]=utils['diffTime'](members[_0x53b441[_0xb18a('0x17')]]['exitAt'],members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x20')]);if(members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x7')]){writeDB(members[_0x53b441[_0xb18a('0x17')]]);}}break;default:break;}}catch(_0x2bc27a){utils['error'](util['format'](_0xb18a('0x16'),members[_0x53b441[_0xb18a('0x17')]]?members[_0x53b441[_0xb18a('0x17')]][_0xb18a('0x7')]:_0x53b441['device']),_0x2bc27a);}};exports[_0xb18a('0x21')]=function(_0x280517){try{if(!_['isNil'](members[_0x280517['interface']])){utils[_0xb18a('0x22')](util[_0xb18a('0x5')](_0xb18a('0x23'),_0x280517[_0xb18a('0x7')]),_0x280517);utils[_0xb18a('0x24')](util[_0xb18a('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x280517['uniqueid'],_0x280517[_0xb18a('0x8')],_0x280517[_0xb18a('0x25')]));members[_0x280517[_0xb18a('0x8')]]=_['assign'](members[_0x280517['interface']],{'data4':_0x280517[_0xb18a('0x25')],'uniqueid':_0x280517[_0xb18a('0x7')]});}}catch(_0x3a0794){utils[_0xb18a('0x26')](util[_0xb18a('0x5')](_0xb18a('0x23'),_0x280517[_0xb18a('0x7')]),_0x3a0794);}};exports[_0xb18a('0x27')]=function(_0x435878){try{utils[_0xb18a('0x22')](util[_0xb18a('0x5')](_0xb18a('0x28'),_0x435878[_0xb18a('0x7')]),_0x435878);if(_0x435878[_0xb18a('0x29')]){var _0x1651ce=_0x435878['channel'][_0xb18a('0x2a')]('-')[0x0];if(!_[_0xb18a('0x1d')](members[_0x1651ce])){members[_0x1651ce]=_[_0xb18a('0x2b')](members[_0x1651ce],{'data1':members[_0x1651ce][_0xb18a('0x2c')]||_0x435878[_0xb18a('0xa')],'data2':members[_0x1651ce][_0xb18a('0x9')]||_0x435878[_0xb18a('0x2d')],'data3':members[_0x1651ce]['data3']||_0x435878[_0xb18a('0x2e')],'uniqueid':members[_0x1651ce][_0xb18a('0x7')]||_0x435878[_0xb18a('0x7')]});utils[_0xb18a('0x24')](util[_0xb18a('0x5')](_0xb18a('0x2f'),_0x435878[_0xb18a('0x7')],members[_0x1651ce][_0xb18a('0x2c')],members[_0x1651ce][_0xb18a('0x9')],members[_0x1651ce][_0xb18a('0x30')]));if(members[_0x1651ce][_0xb18a('0x1e')]){writeDB(members[_0x1651ce]);}}}if(_0x435878[_0xb18a('0x31')]){var _0x5f4371=_0x435878[_0xb18a('0x31')][_0xb18a('0x2a')]('-')[0x0];if(!_[_0xb18a('0x1d')](members[_0x5f4371])){members[_0x5f4371]=_['assign'](members[_0x5f4371],{'data1':members[_0x5f4371][_0xb18a('0x2c')]||_0x435878['type'],'data2':members[_0x5f4371][_0xb18a('0x9')]||_0x435878[_0xb18a('0x2d')],'data3':members[_0x5f4371][_0xb18a('0x30')]||_0x435878['destination'],'uniqueid':members[_0x5f4371][_0xb18a('0x7')]||_0x435878[_0xb18a('0x7')]});utils[_0xb18a('0x24')](util[_0xb18a('0x5')](_0xb18a('0x2f'),_0x435878[_0xb18a('0x7')],members[_0x5f4371]['data1'],members[_0x5f4371][_0xb18a('0x9')],members[_0x5f4371][_0xb18a('0x30')]));if(members[_0x5f4371][_0xb18a('0x1e')]){writeDB(members[_0x5f4371]);}}}}catch(_0x486931){utils['error'](util['format']('[%s][members][cdr]',_0x435878[_0xb18a('0x7')]),_0x486931);}}; \ No newline at end of file +var _0xb583=['BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','assign','data2','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','destinationchannel','util','Local/_attended@transfer','Queue:','format','uniqueid','interface','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE'];(function(_0x4ef32f,_0x53ceef){var _0xfe32bc=function(_0x577116){while(--_0x577116){_0x4ef32f['push'](_0x4ef32f['shift']());}};_0xfe32bc(++_0x53ceef);}(_0xb583,0x7b));var _0x3b58=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb583[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x3b58('0x0'));var utils=require('./utils');var members={};var exclude=[_0x3b58('0x1'),_0x3b58('0x2')];function writeDB(_0xdb9418){utils['info'](util[_0x3b58('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xdb9418[_0x3b58('0x4')],_0xdb9418[_0x3b58('0x5')],_0xdb9418['channel'],_0xdb9418['data2'],_0xdb9418['membername'],_0xdb9418[_0x3b58('0x6')]));if(_0xdb9418[_0x3b58('0x5')]){utils[_0x3b58('0x7')](_0xdb9418[_0x3b58('0x5')])[_0x3b58('0x8')](function(_0x4895ea){if(_0x4895ea){_0xdb9418[_0x3b58('0x9')]=_0x4895ea[_0x3b58('0xa')];_0xdb9418[_0x3b58('0xb')]=_0x4895ea[_0x3b58('0xb')];utils[_0x3b58('0xc')](_0x3b58('0xd'),_0xdb9418);}else{utils[_0x3b58('0xe')](_0xdb9418[_0x3b58('0x5')][_0x3b58('0xf')]('/')[0x1])['then'](function(_0x16cd3e){if(_0x16cd3e){_0xdb9418['membername']=_0x16cd3e[_0x3b58('0xa')];_0xdb9418[_0x3b58('0xb')]=_0x16cd3e[_0x3b58('0xb')];utils['request'](_0x3b58('0xd'),_0xdb9418);}});}})[_0x3b58('0x10')](function(_0xd92267){utils[_0x3b58('0x11')](util['format']('[%s][members][writeDB]',_0xdb9418[_0x3b58('0x4')]),_0xd92267);});}delete members[_0xdb9418[_0x3b58('0x5')]];}function startsWith(_0x3b4302,_0x2b5994){return _[_0x3b58('0x12')](_0x3b4302,function(_0x161244){return _['startsWith'](_0x2b5994,_0x161244);});}exports[_0x3b58('0x13')]=function(_0x319e77){try{utils[_0x3b58('0x14')](util[_0x3b58('0x3')](_0x3b58('0x15'),members[_0x319e77[_0x3b58('0x16')]]?members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x4')]:_0x319e77['device']),_0x319e77);utils[_0x3b58('0x17')](util[_0x3b58('0x3')](_0x3b58('0x18'),members[_0x319e77[_0x3b58('0x16')]]?members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x4')]:_0x319e77[_0x3b58('0x16')],_0x319e77[_0x3b58('0x19')],_0x319e77['device']));switch(_0x319e77[_0x3b58('0x19')]){case _0x3b58('0x1a'):case _0x3b58('0x1b'):if(!startsWith(exclude,_0x319e77[_0x3b58('0x16')])){members[_0x319e77[_0x3b58('0x16')]]={'channel':_0x3b58('0x1c'),'interface':_0x319e77['device'],'type':_0x3b58('0x1d'),'enterAt':utils[_0x3b58('0x1e')](),'role':'agent'};}break;case _0x3b58('0x1f'):if(!_[_0x3b58('0x20')](members[_0x319e77[_0x3b58('0x16')]])){members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x21')]=utils['now']();members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x22')]=utils[_0x3b58('0x23')](members[_0x319e77['device']][_0x3b58('0x21')],members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x24')]);if(members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x4')]){writeDB(members[_0x319e77[_0x3b58('0x16')]]);}}break;default:break;}}catch(_0x372caf){utils[_0x3b58('0x11')](util[_0x3b58('0x3')](_0x3b58('0x15'),members[_0x319e77[_0x3b58('0x16')]]?members[_0x319e77[_0x3b58('0x16')]][_0x3b58('0x4')]:_0x319e77[_0x3b58('0x16')]),_0x372caf);}};exports['agentcomplete']=function(_0x3aa498){try{if(!_[_0x3b58('0x20')](members[_0x3aa498[_0x3b58('0x5')]])){utils[_0x3b58('0x14')](util['format']('[%s][members][agentcomplete]',_0x3aa498[_0x3b58('0x4')]),_0x3aa498);utils[_0x3b58('0x17')](util['format'](_0x3b58('0x25'),_0x3aa498[_0x3b58('0x4')],_0x3aa498['interface'],_0x3aa498['queue']));members[_0x3aa498[_0x3b58('0x5')]]=_['assign'](members[_0x3aa498[_0x3b58('0x5')]],{'data4':_0x3aa498['queue'],'uniqueid':_0x3aa498[_0x3b58('0x4')]});}}catch(_0x2d2bf5){utils['error'](util[_0x3b58('0x3')](_0x3b58('0x26'),_0x3aa498[_0x3b58('0x4')]),_0x2d2bf5);}};exports[_0x3b58('0x27')]=function(_0x4ddf06){try{utils[_0x3b58('0x14')](util[_0x3b58('0x3')](_0x3b58('0x28'),_0x4ddf06[_0x3b58('0x4')]),_0x4ddf06);if(_0x4ddf06[_0x3b58('0x29')]){var _0x2be41d=_0x4ddf06[_0x3b58('0x29')][_0x3b58('0xf')]('-')[0x0];if(!_['isNil'](members[_0x2be41d])){members[_0x2be41d]=_[_0x3b58('0x2a')](members[_0x2be41d],{'data1':members[_0x2be41d]['data1']||_0x4ddf06['type'],'data2':members[_0x2be41d][_0x3b58('0x2b')]||_0x4ddf06[_0x3b58('0x2c')],'data3':members[_0x2be41d]['data3']||_0x4ddf06[_0x3b58('0x2d')],'uniqueid':members[_0x2be41d][_0x3b58('0x4')]||_0x4ddf06[_0x3b58('0x4')]});utils[_0x3b58('0x17')](util[_0x3b58('0x3')](_0x3b58('0x2e'),_0x4ddf06[_0x3b58('0x4')],members[_0x2be41d][_0x3b58('0x2f')],members[_0x2be41d][_0x3b58('0x2b')],members[_0x2be41d][_0x3b58('0x30')]));if(members[_0x2be41d]['exitAt']){writeDB(members[_0x2be41d]);}}}if(_0x4ddf06[_0x3b58('0x31')]){var _0x3e34e8=_0x4ddf06[_0x3b58('0x31')][_0x3b58('0xf')]('-')[0x0];if(!_[_0x3b58('0x20')](members[_0x3e34e8])){members[_0x3e34e8]=_[_0x3b58('0x2a')](members[_0x3e34e8],{'data1':members[_0x3e34e8][_0x3b58('0x2f')]||_0x4ddf06['type'],'data2':members[_0x3e34e8]['data2']||_0x4ddf06[_0x3b58('0x2c')],'data3':members[_0x3e34e8]['data3']||_0x4ddf06[_0x3b58('0x2d')],'uniqueid':members[_0x3e34e8][_0x3b58('0x4')]||_0x4ddf06[_0x3b58('0x4')]});utils['info'](util[_0x3b58('0x3')](_0x3b58('0x2e'),_0x4ddf06[_0x3b58('0x4')],members[_0x3e34e8]['data1'],members[_0x3e34e8][_0x3b58('0x2b')],members[_0x3e34e8][_0x3b58('0x30')]));if(members[_0x3e34e8][_0x3b58('0x21')]){writeDB(members[_0x3e34e8]);}}}}catch(_0x4eec0b){utils[_0x3b58('0x11')](util[_0x3b58('0x3')](_0x3b58('0x28'),_0x4ddf06['uniqueid']),_0x4eec0b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4432b2b..44bf93d 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 _0x14f1=['transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension'];(function(_0x4069f7,_0x51f838){var _0x1bf9e2=function(_0x5453f6){while(--_0x5453f6){_0x4069f7['push'](_0x4069f7['shift']());}};_0x1bf9e2(++_0x51f838);}(_0x14f1,0x89));var _0x114f=function(_0x36c857,_0x172126){_0x36c857=_0x36c857-0x0;var _0x185d99=_0x14f1[_0x36c857];return _0x185d99;};'use strict';var _=require(_0x114f('0x0'));var util=require(_0x114f('0x1'));var utils=require(_0x114f('0x2'));var queues={};function writeDB(_0xf74395){utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x5'),_0xf74395[_0x114f('0x6')],_0xf74395[_0x114f('0x7')],_0xf74395[_0x114f('0x8')],_0xf74395[_0x114f('0x9')],_0xf74395[_0x114f('0xa')],_0xf74395[_0x114f('0xb')],_0xf74395[_0x114f('0xc')]));if(_0xf74395['queue']){utils[_0x114f('0xd')](_0xf74395[_0x114f('0x8')])['then'](function(_0x592cb1){if(_0x592cb1){_0xf74395[_0x114f('0xe')]=_0x592cb1[_0x114f('0xe')];}utils[_0x114f('0xf')](_0x114f('0x10'),_0xf74395);});}else{utils[_0x114f('0xf')]('CreateVoiceQueueReport',_0xf74395);}if(_0xf74395[_0x114f('0x11')]){delete queues[_0xf74395['transfereduniqueid']];}else{delete queues[_0xf74395[_0x114f('0x6')]];}}exports[_0x114f('0x12')]=function(_0x5d8d3f){try{utils[_0x114f('0x13')](util[_0x114f('0x4')](_0x114f('0x14'),_0x5d8d3f[_0x114f('0x6')]),_0x5d8d3f);utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x15'),_0x5d8d3f['uniqueid'],_0x5d8d3f[_0x114f('0x8')],_0x5d8d3f[_0x114f('0x16')]));queues[_0x5d8d3f[_0x114f('0x6')]]=_['assign'](_0x5d8d3f,{'originalposition':_0x5d8d3f[_0x114f('0x16')],'queuecallerjoinAt':utils[_0x114f('0x17')](),'mohtime':0x0});}catch(_0x3d02fa){utils[_0x114f('0x18')](util[_0x114f('0x4')](_0x114f('0x14'),_0x5d8d3f[_0x114f('0x6')]),_0x3d02fa);}};exports['hangup']=function(_0x587cfc){try{if(!_[_0x114f('0x19')](queues[_0x587cfc[_0x114f('0x6')]])){utils[_0x114f('0x13')](util[_0x114f('0x4')](_0x114f('0x1a'),_0x587cfc[_0x114f('0x6')]),_0x587cfc);if(queues[_0x587cfc[_0x114f('0x6')]]['queuecallerleaveAt']){if(!queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x1b')]&&!queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x1c')]){queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x1d')]=!![];queues[_0x587cfc[_0x114f('0x6')]]['queuecallercompleteAt']=utils['now']();queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0xc')]='COMPLETEDBYAGENT';}utils['info'](util[_0x114f('0x4')](_0x114f('0x1e'),_0x587cfc[_0x114f('0x6')],queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x1f')],queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0xc')]));writeDB(queues[_0x587cfc['uniqueid']]);}else if(queues[_0x587cfc['uniqueid']][_0x114f('0x11')]){utils[_0x114f('0x3')](util[_0x114f('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x587cfc[_0x114f('0x6')],queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x1f')],queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x11')]));queues[queues[_0x587cfc[_0x114f('0x6')]]['transfereduniqueid']]=queues[_0x587cfc[_0x114f('0x6')]];queues[queues[_0x587cfc[_0x114f('0x6')]][_0x114f('0x11')]][_0x114f('0x20')]=0x2;delete queues[_0x587cfc[_0x114f('0x6')]];}}}catch(_0x3b9e9c){utils[_0x114f('0x18')](util[_0x114f('0x4')](_0x114f('0x1a'),_0x587cfc[_0x114f('0x6')]),_0x3b9e9c);}};exports[_0x114f('0x21')]=function(_0x5bc1e6){try{utils['debug'](util['format'](_0x114f('0x22'),_0x5bc1e6['uniqueid']),_0x5bc1e6);if(!_[_0x114f('0x19')](_0x5bc1e6[_0x114f('0x23')]['queuestatus'])&&_0x5bc1e6[_0x114f('0x24')][_0x114f('0x25')]()!==_0x114f('0x26')){if(!_['isNil'](queues[_0x5bc1e6[_0x114f('0x6')]])){queues[_0x5bc1e6['uniqueid']]['queuecallerabandon']=![];queues[_0x5bc1e6['uniqueid']][_0x114f('0x27')]=null;queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0x1c')]=!![];queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0x28')]=utils[_0x114f('0x17')]();queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0xc')]=_0x5bc1e6[_0x114f('0x24')][_0x114f('0x25')]();utils[_0x114f('0x3')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x5bc1e6[_0x114f('0x6')],queues[_0x5bc1e6['uniqueid']]['name'],_0x5bc1e6[_0x114f('0x24')],queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0xc')]));writeDB(queues[_0x5bc1e6[_0x114f('0x6')]]);}}else if(!_['isNil'](_0x5bc1e6['variable'][_0x114f('0x29')])){if(!_[_0x114f('0x19')](queues[_0x5bc1e6[_0x114f('0x6')]])&&!queues[_0x5bc1e6[_0x114f('0x6')]]['queuecallerabandon']){queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0x1b')]=![];queues[_0x5bc1e6[_0x114f('0x6')]]['queuecallerabandonAt']=null;queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0x1c')]=!![];queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0x28')]=utils[_0x114f('0x17')]();queues[_0x5bc1e6['uniqueid']][_0x114f('0xc')]=_0x114f('0x2a');utils['info'](util[_0x114f('0x4')](_0x114f('0x2b'),_0x5bc1e6['uniqueid'],queues[_0x5bc1e6['uniqueid']][_0x114f('0x1f')],_0x5bc1e6[_0x114f('0x24')],queues[_0x5bc1e6[_0x114f('0x6')]][_0x114f('0xc')]));}}}catch(_0x5985d7){utils['error'](util[_0x114f('0x4')](_0x114f('0x22'),_0x5bc1e6[_0x114f('0x6')]),_0x5985d7);}};exports[_0x114f('0x1b')]=function(_0x5a1178){try{if(!_['isNil'](queues[_0x5a1178[_0x114f('0x6')]])){utils[_0x114f('0x13')](util[_0x114f('0x4')](_0x114f('0x2c'),_0x5a1178[_0x114f('0x6')]),_0x5a1178);queues[_0x5a1178['uniqueid']][_0x114f('0x1c')]=![];queues[_0x5a1178['uniqueid']][_0x114f('0x28')]=null;queues[_0x5a1178[_0x114f('0x6')]]['queuecallerabandon']=!![];queues[_0x5a1178[_0x114f('0x6')]]['queuecallerabandonAt']=utils[_0x114f('0x17')]();queues[_0x5a1178[_0x114f('0x6')]][_0x114f('0xc')]=_0x114f('0x2d');utils['info'](util[_0x114f('0x4')](_0x114f('0x2e'),_0x5a1178['uniqueid'],queues[_0x5a1178[_0x114f('0x6')]]['name'],queues[_0x5a1178[_0x114f('0x6')]][_0x114f('0xc')]));}}catch(_0xb28364){utils[_0x114f('0x18')](util['format'](_0x114f('0x2c'),_0x5a1178[_0x114f('0x6')]),_0xb28364);}};exports['queuecallerleave']=function(_0x13bec3){try{if(!_[_0x114f('0x19')](queues[_0x13bec3['uniqueid']])){utils[_0x114f('0x13')](util['format'](_0x114f('0x2f'),_0x13bec3[_0x114f('0x6')]),_0x13bec3);utils[_0x114f('0x3')](util['format'](_0x114f('0x30'),_0x13bec3['uniqueid'],queues[_0x13bec3[_0x114f('0x6')]][_0x114f('0x1f')],_0x13bec3['connectedlinenum'],_0x13bec3[_0x114f('0x31')]));queues[_0x13bec3[_0x114f('0x6')]][_0x114f('0x32')]=!![];queues[_0x13bec3[_0x114f('0x6')]]['queuecallerleaveAt']=utils['now']();queues[_0x13bec3['uniqueid']][_0x114f('0x33')]=utils[_0x114f('0x34')](queues[_0x13bec3[_0x114f('0x6')]][_0x114f('0x35')],queues[_0x13bec3['uniqueid']][_0x114f('0x36')]);queues[_0x13bec3['uniqueid']][_0x114f('0x16')]=_0x13bec3['position'];queues[_0x13bec3[_0x114f('0x6')]]['count']=_0x13bec3[_0x114f('0x37')];queues[_0x13bec3['uniqueid']][_0x114f('0x38')]=_0x13bec3[_0x114f('0x38')];queues[_0x13bec3[_0x114f('0x6')]][_0x114f('0x31')]=_0x13bec3['connectedlinename'];}}catch(_0x541c51){utils[_0x114f('0x18')](util['format'](_0x114f('0x2f'),_0x13bec3[_0x114f('0x6')]),_0x541c51);}};exports[_0x114f('0x39')]=function(_0x9cef26){try{if(!_['isNil'](queues[_0x9cef26[_0x114f('0x6')]])){utils[_0x114f('0x13')](util['format']('[%s][queues][agentconnect]',_0x9cef26[_0x114f('0x6')]),_0x9cef26);utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x3a'),_0x9cef26['uniqueid'],queues[_0x9cef26[_0x114f('0x6')]][_0x114f('0x1f')],_0x9cef26[_0x114f('0x3b')],_0x9cef26[_0x114f('0x3c')]));queues[_0x9cef26['uniqueid']]['queuecallerabandon']=![];queues[_0x9cef26['uniqueid']][_0x114f('0x1b')]=![];queues[_0x9cef26[_0x114f('0x6')]]['queuecallerabandonAt']=null;queues[_0x9cef26[_0x114f('0x6')]]['queuecallerexit']=![];queues[_0x9cef26[_0x114f('0x6')]]['queuecallerexitreason']=null;queues[_0x9cef26[_0x114f('0x6')]]['queuecallerexitAt']=null;queues[_0x9cef26['uniqueid']][_0x114f('0x3d')]=!![];queues[_0x9cef26[_0x114f('0x6')]][_0x114f('0xb')]=_0x9cef26[_0x114f('0x3c')];queues[_0x9cef26[_0x114f('0x6')]]['lastAssignedTo']=_0x9cef26[_0x114f('0x3b')];}}catch(_0x474c0c){utils[_0x114f('0x18')](util[_0x114f('0x4')](_0x114f('0x3e'),_0x9cef26[_0x114f('0x6')]),_0x474c0c);}};exports[_0x114f('0x3f')]=function(_0x530fc5){try{if(!_[_0x114f('0x19')](queues[_0x530fc5[_0x114f('0x6')]])){if(queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0x35')]){utils['debug'](util[_0x114f('0x4')](_0x114f('0x40'),_0x530fc5[_0x114f('0x6')]),_0x530fc5);queues[_0x530fc5[_0x114f('0x6')]]['queuecallerabandon']=![];queues[_0x530fc5[_0x114f('0x6')]]['queuecallerabandon']=![];queues[_0x530fc5[_0x114f('0x6')]]['queuecallerabandonAt']=null;queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0x1c')]=![];queues[_0x530fc5['uniqueid']]['queuecallerexitAt']=null;queues[_0x530fc5['uniqueid']][_0x114f('0x3d')]=!![];queues[_0x530fc5['uniqueid']]['lastAssignedTo']=_0x530fc5[_0x114f('0x3b')];queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0x1d')]=!![];queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0x41')]=utils[_0x114f('0x17')]();if(_0x530fc5[_0x114f('0x42')]=='transfer'){if(!queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0x43')]){queues[_0x530fc5[_0x114f('0x6')]]['queuecallerexitreason']=_0x114f('0x44');}}else{queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0xc')]='COMPLETEDBY'+_0x530fc5['reason'][_0x114f('0x25')]();}utils['info'](util[_0x114f('0x4')](_0x114f('0x45'),_0x530fc5[_0x114f('0x6')],queues[_0x530fc5['uniqueid']][_0x114f('0x1f')],_0x530fc5[_0x114f('0x3b')],queues[_0x530fc5[_0x114f('0x6')]][_0x114f('0xc')]));writeDB(queues[_0x530fc5[_0x114f('0x6')]]);}}}catch(_0x6d8a96){utils[_0x114f('0x18')](util[_0x114f('0x4')]('[%s][queues][agentcomplete]',_0x530fc5[_0x114f('0x6')]),_0x6d8a96);}};exports[_0x114f('0x46')]=function(_0x46fdd9){try{if(!_[_0x114f('0x19')](queues[_0x46fdd9['transfereeuniqueid']])){utils[_0x114f('0x13')](util[_0x114f('0x4')](_0x114f('0x47'),_0x46fdd9[_0x114f('0x6')]),_0x46fdd9);queues[_0x46fdd9[_0x114f('0x48')]]['transfer']=!![];queues[_0x46fdd9[_0x114f('0x48')]][_0x114f('0x49')]=_0x114f('0x4a');queues[_0x46fdd9['transfereeuniqueid']][_0x114f('0x4b')]=_0x46fdd9[_0x114f('0x4c')];queues[_0x46fdd9[_0x114f('0x48')]][_0x114f('0x4d')]=_0x46fdd9[_0x114f('0x48')];queues[_0x46fdd9[_0x114f('0x48')]][_0x114f('0xc')]=_0x114f('0x4e');utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x4f'),_0x46fdd9['uniqueid'],queues[_0x46fdd9[_0x114f('0x48')]]['name'],_0x46fdd9[_0x114f('0x48')],_0x46fdd9[_0x114f('0x4c')]));}}catch(_0x23e098){utils[_0x114f('0x18')](util[_0x114f('0x4')]('[%s][queues][blindtransfer]',_0x46fdd9[_0x114f('0x6')]),_0x23e098);}};exports[_0x114f('0x50')]=function(_0x527b5){try{utils['debug'](util[_0x114f('0x4')]('[%s][queues][attendedtransfer]',_0x527b5['origtransfereruniqueid']),_0x527b5);if(_0x527b5[_0x114f('0x51')]==_0x527b5['origtransfererlinkedid']){if(!_[_0x114f('0x19')](queues[_0x527b5['secondtransfererlinkedid']])){utils[_0x114f('0x3')](util['format'](_0x114f('0x52'),_0x527b5[_0x114f('0x51')],queues[_0x527b5[_0x114f('0x53')]][_0x114f('0x1f')],_0x527b5[_0x114f('0x54')]));queues[_0x527b5[_0x114f('0x53')]][_0x114f('0x43')]=!![];queues[_0x527b5['secondtransfererlinkedid']][_0x114f('0x49')]=_0x114f('0x55');queues[_0x527b5[_0x114f('0x53')]][_0x114f('0x4b')]=_0x527b5['origtransfererexten'];queues[_0x527b5[_0x114f('0x53')]]['transferuniqueid']=_0x527b5[_0x114f('0x51')];queues[_0x527b5[_0x114f('0x53')]]['queuecallerexitreason']=_0x114f('0x56');}if(!_[_0x114f('0x19')](queues[_0x527b5[_0x114f('0x57')]])){if(_0x527b5[_0x114f('0x58')]&&queues[_0x527b5['transfereelinkedid']]){queues[_0x527b5['transfereelinkedid']][_0x114f('0x20')]=0x1;queues[_0x527b5['transfereeuniqueid']]=_['clone'](queues[_0x527b5[_0x114f('0x58')]]);queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x11')]=_0x527b5['transfertargetuniqueid'];queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x20')]=0x2;queues[_0x527b5['transfereeuniqueid']][_0x114f('0xa')]=queues[_0x527b5[_0x114f('0x53')]][_0x114f('0xa')];queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x59')]=queues[_0x527b5[_0x114f('0x53')]]['calleridname'];queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x36')]=utils['now']();queues[_0x527b5['transfereeuniqueid']][_0x114f('0x35')]=utils['now']();queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x33')]=0x0;queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x5a')]=0x0;utils[_0x114f('0x3')](util['format'](_0x114f('0x5b'),_0x527b5['origtransfereruniqueid'],queues[_0x527b5[_0x114f('0x48')]][_0x114f('0x1f')],queues[_0x527b5[_0x114f('0x48')]][_0x114f('0xa')],queues[_0x527b5['transfereeuniqueid']][_0x114f('0x59')]));}else{utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x5c'),_0x527b5[_0x114f('0x51')],queues[_0x527b5['origtransfererlinkedid']]['name'],_0x527b5[_0x114f('0x53')]));queues[_0x527b5['origtransfererlinkedid']][_0x114f('0x11')]=_0x527b5[_0x114f('0x53')];}}}else if(_0x527b5[_0x114f('0x5d')]==_0x527b5[_0x114f('0x53')]){if(!_[_0x114f('0x19')](queues[_0x527b5['origtransfererlinkedid']])){utils[_0x114f('0x3')](util['format'](_0x114f('0x5e'),_0x527b5['origtransfereruniqueid'],queues[_0x527b5[_0x114f('0x57')]][_0x114f('0x1f')],_0x527b5[_0x114f('0x5d')],_0x527b5[_0x114f('0x5f')]));queues[_0x527b5['origtransfererlinkedid']][_0x114f('0x43')]=!![];queues[_0x527b5[_0x114f('0x57')]][_0x114f('0x49')]=_0x114f('0x55');queues[_0x527b5[_0x114f('0x57')]][_0x114f('0x4b')]=_0x527b5['secondtransfererexten'];queues[_0x527b5[_0x114f('0x57')]][_0x114f('0x4d')]=_0x527b5[_0x114f('0x5d')];queues[_0x527b5[_0x114f('0x57')]][_0x114f('0xc')]='ATTENDEDTRANSFER';}if(!_[_0x114f('0x19')](queues[_0x527b5['secondtransfererlinkedid']])){if(_0x527b5['transfertargetlinkedid']&&queues[_0x527b5[_0x114f('0x60')]]){queues[_0x527b5[_0x114f('0x60')]][_0x114f('0x20')]=0x1;queues[_0x527b5['transfertargetuniqueid']]=_[_0x114f('0x61')](queues[_0x527b5[_0x114f('0x60')]]);queues[_0x527b5['transfertargetuniqueid']]['transfereduniqueid']=_0x527b5[_0x114f('0x62')];queues[_0x527b5['transfertargetuniqueid']][_0x114f('0x20')]=0x2;queues[_0x527b5[_0x114f('0x62')]]['calleridnum']=queues[_0x527b5['origtransfererlinkedid']]['calleridnum'];queues[_0x527b5[_0x114f('0x62')]][_0x114f('0x59')]=queues[_0x527b5[_0x114f('0x57')]]['calleridname'];queues[_0x527b5[_0x114f('0x62')]][_0x114f('0x36')]=utils[_0x114f('0x17')]();queues[_0x527b5[_0x114f('0x62')]][_0x114f('0x35')]=utils[_0x114f('0x17')]();queues[_0x527b5['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x527b5['transfertargetuniqueid']][_0x114f('0x5a')]=0x0;utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x63'),_0x527b5[_0x114f('0x51')],queues[_0x527b5[_0x114f('0x62')]]['name'],queues[_0x527b5[_0x114f('0x62')]][_0x114f('0x11')],queues[_0x527b5[_0x114f('0x62')]][_0x114f('0xa')],queues[_0x527b5['transfertargetuniqueid']][_0x114f('0x59')]));}else{utils[_0x114f('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x527b5['origtransfereruniqueid'],queues[_0x527b5[_0x114f('0x53')]][_0x114f('0x1f')],_0x527b5[_0x114f('0x57')]));queues[_0x527b5['secondtransfererlinkedid']][_0x114f('0x11')]=_0x527b5[_0x114f('0x57')];}}}}catch(_0x4b1419){utils['error'](util[_0x114f('0x4')]('[%s][queues][attendedtransfer]',_0x527b5['origtransfereruniqueid']),_0x4b1419);}};exports[_0x114f('0x64')]=function(_0x3f5c73){try{if(!_['isNil'](queues[_0x3f5c73['uniqueid']])){utils[_0x114f('0x13')](util[_0x114f('0x4')](_0x114f('0x65'),_0x3f5c73[_0x114f('0x6')]),_0x3f5c73);queues[_0x3f5c73[_0x114f('0x6')]][_0x114f('0x66')]=utils[_0x114f('0x17')]();utils[_0x114f('0x3')](util['format'](_0x114f('0x67'),_0x3f5c73[_0x114f('0x6')],queues[_0x3f5c73['uniqueid']][_0x114f('0x1f')],queues[_0x3f5c73['uniqueid']][_0x114f('0x66')]));}}catch(_0x49bbba){utils[_0x114f('0x18')](util['format']('[%s][queues][musiconholdstart]',_0x3f5c73[_0x114f('0x6')]),_0x49bbba);}};exports[_0x114f('0x68')]=function(_0x435ec8){try{if(!_[_0x114f('0x19')](queues[_0x435ec8[_0x114f('0x6')]])){if(!_['isNil'](queues[_0x435ec8[_0x114f('0x6')]][_0x114f('0x66')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x435ec8[_0x114f('0x6')]),_0x435ec8);queues[_0x435ec8[_0x114f('0x6')]][_0x114f('0x5a')]+=utils[_0x114f('0x34')](utils['now'](),queues[_0x435ec8[_0x114f('0x6')]][_0x114f('0x66')]);utils[_0x114f('0x3')](util[_0x114f('0x4')](_0x114f('0x69'),_0x435ec8[_0x114f('0x6')],queues[_0x435ec8['uniqueid']][_0x114f('0x1f')],queues[_0x435ec8[_0x114f('0x6')]][_0x114f('0x5a')]));delete queues[_0x435ec8[_0x114f('0x6')]][_0x114f('0x66')];}}}catch(_0x310629){utils['error'](util[_0x114f('0x4')](_0x114f('0x6a'),_0x435ec8[_0x114f('0x6')]),_0x310629);}}; \ No newline at end of file +var _0x7e7d=['queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','value','[%s][queues][varset]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerleaveAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','info','uniqueid','channel','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s'];(function(_0x1e3fc7,_0xa66c17){var _0x2aef56=function(_0x356278){while(--_0x356278){_0x1e3fc7['push'](_0x1e3fc7['shift']());}};_0x2aef56(++_0xa66c17);}(_0x7e7d,0xa2));var _0xd7e7=function(_0x26d54c,_0xa63fa7){_0x26d54c=_0x26d54c-0x0;var _0x3848ef=_0x7e7d[_0x26d54c];return _0x3848ef;};'use strict';var _=require(_0xd7e7('0x0'));var util=require(_0xd7e7('0x1'));var utils=require(_0xd7e7('0x2'));var queues={};function writeDB(_0x3021c1){utils[_0xd7e7('0x3')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3021c1[_0xd7e7('0x4')],_0x3021c1[_0xd7e7('0x5')],_0x3021c1['queue'],_0x3021c1['lastAssignedTo'],_0x3021c1[_0xd7e7('0x6')],_0x3021c1['accountcode'],_0x3021c1[_0xd7e7('0x7')]));if(_0x3021c1[_0xd7e7('0x8')]){utils[_0xd7e7('0x9')](_0x3021c1[_0xd7e7('0x8')])['then'](function(_0x144788){if(_0x144788){_0x3021c1[_0xd7e7('0xa')]=_0x144788[_0xd7e7('0xa')];}utils[_0xd7e7('0xb')](_0xd7e7('0xc'),_0x3021c1);});}else{utils['request']('CreateVoiceQueueReport',_0x3021c1);}if(_0x3021c1[_0xd7e7('0xd')]){delete queues[_0x3021c1[_0xd7e7('0xd')]];}else{delete queues[_0x3021c1['uniqueid']];}}exports[_0xd7e7('0xe')]=function(_0x3c7ebd){try{utils[_0xd7e7('0xf')](util['format']('[%s][queues][queuecallerjoin]',_0x3c7ebd[_0xd7e7('0x4')]),_0x3c7ebd);utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x11'),_0x3c7ebd[_0xd7e7('0x4')],_0x3c7ebd[_0xd7e7('0x8')],_0x3c7ebd[_0xd7e7('0x12')]));queues[_0x3c7ebd[_0xd7e7('0x4')]]=_[_0xd7e7('0x13')](_0x3c7ebd,{'originalposition':_0x3c7ebd[_0xd7e7('0x12')],'queuecallerjoinAt':utils[_0xd7e7('0x14')](),'mohtime':0x0});}catch(_0x1fc746){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')](_0xd7e7('0x16'),_0x3c7ebd[_0xd7e7('0x4')]),_0x1fc746);}};exports[_0xd7e7('0x17')]=function(_0x30bd00){try{if(!_[_0xd7e7('0x18')](queues[_0x30bd00[_0xd7e7('0x4')]])){utils[_0xd7e7('0xf')](util[_0xd7e7('0x10')](_0xd7e7('0x19'),_0x30bd00[_0xd7e7('0x4')]),_0x30bd00);if(queues[_0x30bd00[_0xd7e7('0x4')]]['queuecallerleaveAt']){if(!queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x1a')]&&!queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x1b')]){queues[_0x30bd00['uniqueid']][_0xd7e7('0x1c')]=!![];queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x1d')]=utils[_0xd7e7('0x14')]();queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x7')]=_0xd7e7('0x1e');}utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x30bd00['uniqueid'],queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x1f')],queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x7')]));writeDB(queues[_0x30bd00['uniqueid']]);}else if(queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0xd')]){utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x20'),_0x30bd00[_0xd7e7('0x4')],queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0x1f')],queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0xd')]));queues[queues[_0x30bd00[_0xd7e7('0x4')]][_0xd7e7('0xd')]]=queues[_0x30bd00[_0xd7e7('0x4')]];queues[queues[_0x30bd00['uniqueid']][_0xd7e7('0xd')]][_0xd7e7('0x21')]=0x2;delete queues[_0x30bd00[_0xd7e7('0x4')]];}}}catch(_0x529de7){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')](_0xd7e7('0x19'),_0x30bd00[_0xd7e7('0x4')]),_0x529de7);}};exports[_0xd7e7('0x22')]=function(_0x40fc8b){try{utils[_0xd7e7('0xf')](util['format']('[%s][queues][varset]',_0x40fc8b['uniqueid']),_0x40fc8b);if(!_[_0xd7e7('0x18')](_0x40fc8b[_0xd7e7('0x23')][_0xd7e7('0x24')])&&_0x40fc8b['value']['toUpperCase']()!==_0xd7e7('0x25')){if(!_['isNil'](queues[_0x40fc8b['uniqueid']])){queues[_0x40fc8b[_0xd7e7('0x4')]]['queuecallerabandon']=![];queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x26')]=null;queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x1b')]=!![];queues[_0x40fc8b['uniqueid']][_0xd7e7('0x27')]=utils[_0xd7e7('0x14')]();queues[_0x40fc8b['uniqueid']][_0xd7e7('0x7')]=_0x40fc8b['value'][_0xd7e7('0x28')]();utils['info'](util['format'](_0xd7e7('0x29'),_0x40fc8b[_0xd7e7('0x4')],queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x1f')],_0x40fc8b['value'],queues[_0x40fc8b[_0xd7e7('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x40fc8b[_0xd7e7('0x4')]]);}}else if(!_[_0xd7e7('0x18')](_0x40fc8b[_0xd7e7('0x23')][_0xd7e7('0x2a')])){if(!_['isNil'](queues[_0x40fc8b[_0xd7e7('0x4')]])&&!queues[_0x40fc8b[_0xd7e7('0x4')]]['queuecallerabandon']){queues[_0x40fc8b['uniqueid']][_0xd7e7('0x1a')]=![];queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x26')]=null;queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x1b')]=!![];queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x27')]=utils[_0xd7e7('0x14')]();queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x7')]=_0xd7e7('0x2b');utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x2c'),_0x40fc8b[_0xd7e7('0x4')],queues[_0x40fc8b[_0xd7e7('0x4')]][_0xd7e7('0x1f')],_0x40fc8b[_0xd7e7('0x2d')],queues[_0x40fc8b[_0xd7e7('0x4')]]['queuecallerexitreason']));}}}catch(_0x1effc3){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')](_0xd7e7('0x2e'),_0x40fc8b[_0xd7e7('0x4')]),_0x1effc3);}};exports[_0xd7e7('0x1a')]=function(_0x264f33){try{if(!_[_0xd7e7('0x18')](queues[_0x264f33[_0xd7e7('0x4')]])){utils['debug'](util[_0xd7e7('0x10')]('[%s][queues][queuecallerabandon]',_0x264f33['uniqueid']),_0x264f33);queues[_0x264f33['uniqueid']][_0xd7e7('0x1b')]=![];queues[_0x264f33[_0xd7e7('0x4')]]['queuecallerexitAt']=null;queues[_0x264f33['uniqueid']]['queuecallerabandon']=!![];queues[_0x264f33[_0xd7e7('0x4')]][_0xd7e7('0x26')]=utils['now']();queues[_0x264f33[_0xd7e7('0x4')]][_0xd7e7('0x7')]='ABANDONED';utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x2f'),_0x264f33[_0xd7e7('0x4')],queues[_0x264f33[_0xd7e7('0x4')]][_0xd7e7('0x1f')],queues[_0x264f33[_0xd7e7('0x4')]]['queuecallerexitreason']));}}catch(_0x560047){utils['error'](util[_0xd7e7('0x10')](_0xd7e7('0x30'),_0x264f33[_0xd7e7('0x4')]),_0x560047);}};exports[_0xd7e7('0x31')]=function(_0x435f2c){try{if(!_['isNil'](queues[_0x435f2c[_0xd7e7('0x4')]])){utils[_0xd7e7('0xf')](util[_0xd7e7('0x10')](_0xd7e7('0x32'),_0x435f2c[_0xd7e7('0x4')]),_0x435f2c);utils[_0xd7e7('0x3')](util['format'](_0xd7e7('0x33'),_0x435f2c[_0xd7e7('0x4')],queues[_0x435f2c[_0xd7e7('0x4')]][_0xd7e7('0x1f')],_0x435f2c[_0xd7e7('0x34')],_0x435f2c[_0xd7e7('0x35')]));queues[_0x435f2c[_0xd7e7('0x4')]][_0xd7e7('0x31')]=!![];queues[_0x435f2c[_0xd7e7('0x4')]]['queuecallerleaveAt']=utils[_0xd7e7('0x14')]();queues[_0x435f2c[_0xd7e7('0x4')]][_0xd7e7('0x36')]=utils[_0xd7e7('0x37')](queues[_0x435f2c[_0xd7e7('0x4')]]['queuecallerleaveAt'],queues[_0x435f2c[_0xd7e7('0x4')]][_0xd7e7('0x38')]);queues[_0x435f2c['uniqueid']]['position']=_0x435f2c['position'];queues[_0x435f2c[_0xd7e7('0x4')]]['count']=_0x435f2c['count'];queues[_0x435f2c[_0xd7e7('0x4')]][_0xd7e7('0x34')]=_0x435f2c[_0xd7e7('0x34')];queues[_0x435f2c['uniqueid']][_0xd7e7('0x35')]=_0x435f2c[_0xd7e7('0x35')];}}catch(_0x21cf14){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')](_0xd7e7('0x32'),_0x435f2c['uniqueid']),_0x21cf14);}};exports[_0xd7e7('0x39')]=function(_0xcf0350){try{if(!_[_0xd7e7('0x18')](queues[_0xcf0350[_0xd7e7('0x4')]])){utils[_0xd7e7('0xf')](util[_0xd7e7('0x10')](_0xd7e7('0x3a'),_0xcf0350[_0xd7e7('0x4')]),_0xcf0350);utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x3b'),_0xcf0350[_0xd7e7('0x4')],queues[_0xcf0350[_0xd7e7('0x4')]][_0xd7e7('0x1f')],_0xcf0350[_0xd7e7('0x3c')],_0xcf0350[_0xd7e7('0x3d')]));queues[_0xcf0350['uniqueid']][_0xd7e7('0x1a')]=![];queues[_0xcf0350[_0xd7e7('0x4')]]['queuecallerabandon']=![];queues[_0xcf0350['uniqueid']]['queuecallerabandonAt']=null;queues[_0xcf0350[_0xd7e7('0x4')]][_0xd7e7('0x1b')]=![];queues[_0xcf0350['uniqueid']]['queuecallerexitreason']=null;queues[_0xcf0350[_0xd7e7('0x4')]][_0xd7e7('0x27')]=null;queues[_0xcf0350['uniqueid']][_0xd7e7('0x3e')]=!![];queues[_0xcf0350[_0xd7e7('0x4')]]['accountcode']=_0xcf0350[_0xd7e7('0x3d')];queues[_0xcf0350[_0xd7e7('0x4')]][_0xd7e7('0x3f')]=_0xcf0350[_0xd7e7('0x3c')];}}catch(_0x1825be){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')]('[%s][queues][agentconnect]',_0xcf0350[_0xd7e7('0x4')]),_0x1825be);}};exports[_0xd7e7('0x40')]=function(_0x3494be){try{if(!_[_0xd7e7('0x18')](queues[_0x3494be[_0xd7e7('0x4')]])){if(queues[_0x3494be[_0xd7e7('0x4')]]['queuecallerleaveAt']){utils[_0xd7e7('0xf')](util[_0xd7e7('0x10')](_0xd7e7('0x41'),_0x3494be[_0xd7e7('0x4')]),_0x3494be);queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x1a')]=![];queues[_0x3494be[_0xd7e7('0x4')]]['queuecallerabandon']=![];queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x26')]=null;queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x1b')]=![];queues[_0x3494be['uniqueid']][_0xd7e7('0x27')]=null;queues[_0x3494be[_0xd7e7('0x4')]]['assigned']=!![];queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x3f')]=_0x3494be[_0xd7e7('0x3c')];queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x1c')]=!![];queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x1d')]=utils['now']();if(_0x3494be[_0xd7e7('0x42')]==_0xd7e7('0x43')){if(!queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x43')]){queues[_0x3494be[_0xd7e7('0x4')]][_0xd7e7('0x7')]=_0xd7e7('0x44');}}else{queues[_0x3494be['uniqueid']][_0xd7e7('0x7')]='COMPLETEDBY'+_0x3494be['reason'][_0xd7e7('0x28')]();}utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x45'),_0x3494be[_0xd7e7('0x4')],queues[_0x3494be['uniqueid']][_0xd7e7('0x1f')],_0x3494be['membername'],queues[_0x3494be['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x3494be[_0xd7e7('0x4')]]);}}}catch(_0x1291d3){utils['error'](util[_0xd7e7('0x10')]('[%s][queues][agentcomplete]',_0x3494be[_0xd7e7('0x4')]),_0x1291d3);}};exports[_0xd7e7('0x46')]=function(_0xe32a7c){try{if(!_['isNil'](queues[_0xe32a7c['transfereeuniqueid']])){utils[_0xd7e7('0xf')](util[_0xd7e7('0x10')](_0xd7e7('0x47'),_0xe32a7c[_0xd7e7('0x4')]),_0xe32a7c);queues[_0xe32a7c[_0xd7e7('0x48')]][_0xd7e7('0x43')]=!![];queues[_0xe32a7c[_0xd7e7('0x48')]][_0xd7e7('0x49')]=_0xd7e7('0x4a');queues[_0xe32a7c[_0xd7e7('0x48')]][_0xd7e7('0x4b')]=_0xe32a7c[_0xd7e7('0x4c')];queues[_0xe32a7c['transfereeuniqueid']][_0xd7e7('0x4d')]=_0xe32a7c[_0xd7e7('0x48')];queues[_0xe32a7c[_0xd7e7('0x48')]][_0xd7e7('0x7')]='BLINDTRANSFER';utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0xe32a7c[_0xd7e7('0x4')],queues[_0xe32a7c['transfereeuniqueid']]['name'],_0xe32a7c[_0xd7e7('0x48')],_0xe32a7c[_0xd7e7('0x4c')]));}}catch(_0x47526c){utils['error'](util[_0xd7e7('0x10')]('[%s][queues][blindtransfer]',_0xe32a7c[_0xd7e7('0x4')]),_0x47526c);}};exports['attendedtransfer']=function(_0x59a4ed){try{utils[_0xd7e7('0xf')](util['format']('[%s][queues][attendedtransfer]',_0x59a4ed[_0xd7e7('0x4e')]),_0x59a4ed);if(_0x59a4ed[_0xd7e7('0x4e')]==_0x59a4ed[_0xd7e7('0x4f')]){if(!_[_0xd7e7('0x18')](queues[_0x59a4ed[_0xd7e7('0x50')]])){utils[_0xd7e7('0x3')](util['format'](_0xd7e7('0x51'),_0x59a4ed['origtransfereruniqueid'],queues[_0x59a4ed[_0xd7e7('0x50')]][_0xd7e7('0x1f')],_0x59a4ed[_0xd7e7('0x52')]));queues[_0x59a4ed[_0xd7e7('0x50')]]['transfer']=!![];queues[_0x59a4ed[_0xd7e7('0x50')]]['transfertype']=_0xd7e7('0x53');queues[_0x59a4ed[_0xd7e7('0x50')]][_0xd7e7('0x4b')]=_0x59a4ed[_0xd7e7('0x52')];queues[_0x59a4ed[_0xd7e7('0x50')]][_0xd7e7('0x4d')]=_0x59a4ed['origtransfereruniqueid'];queues[_0x59a4ed['secondtransfererlinkedid']][_0xd7e7('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xd7e7('0x18')](queues[_0x59a4ed[_0xd7e7('0x4f')]])){if(_0x59a4ed[_0xd7e7('0x54')]&&queues[_0x59a4ed[_0xd7e7('0x54')]]){queues[_0x59a4ed['transfereelinkedid']][_0xd7e7('0x21')]=0x1;queues[_0x59a4ed['transfereeuniqueid']]=_['clone'](queues[_0x59a4ed[_0xd7e7('0x54')]]);queues[_0x59a4ed['transfereeuniqueid']][_0xd7e7('0xd')]=_0x59a4ed[_0xd7e7('0x55')];queues[_0x59a4ed[_0xd7e7('0x48')]][_0xd7e7('0x21')]=0x2;queues[_0x59a4ed['transfereeuniqueid']][_0xd7e7('0x6')]=queues[_0x59a4ed[_0xd7e7('0x50')]][_0xd7e7('0x6')];queues[_0x59a4ed[_0xd7e7('0x48')]][_0xd7e7('0x56')]=queues[_0x59a4ed[_0xd7e7('0x50')]][_0xd7e7('0x56')];queues[_0x59a4ed['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xd7e7('0x14')]();queues[_0x59a4ed['transfereeuniqueid']][_0xd7e7('0x57')]=utils[_0xd7e7('0x14')]();queues[_0x59a4ed[_0xd7e7('0x48')]][_0xd7e7('0x36')]=0x0;queues[_0x59a4ed[_0xd7e7('0x48')]][_0xd7e7('0x58')]=0x0;utils['info'](util[_0xd7e7('0x10')](_0xd7e7('0x59'),_0x59a4ed[_0xd7e7('0x4e')],queues[_0x59a4ed['transfereeuniqueid']]['name'],queues[_0x59a4ed[_0xd7e7('0x48')]][_0xd7e7('0x6')],queues[_0x59a4ed[_0xd7e7('0x48')]][_0xd7e7('0x56')]));}else{utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x5a'),_0x59a4ed['origtransfereruniqueid'],queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x1f')],_0x59a4ed[_0xd7e7('0x50')]));queues[_0x59a4ed[_0xd7e7('0x4f')]]['transfereduniqueid']=_0x59a4ed[_0xd7e7('0x50')];}}}else if(_0x59a4ed['secondtransfereruniqueid']==_0x59a4ed[_0xd7e7('0x50')]){if(!_[_0xd7e7('0x18')](queues[_0x59a4ed['origtransfererlinkedid']])){utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x5b'),_0x59a4ed[_0xd7e7('0x4e')],queues[_0x59a4ed[_0xd7e7('0x4f')]]['name'],_0x59a4ed['secondtransfereruniqueid'],_0x59a4ed[_0xd7e7('0x5c')]));queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x43')]=!![];queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x49')]=_0xd7e7('0x53');queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x4b')]=_0x59a4ed[_0xd7e7('0x5c')];queues[_0x59a4ed[_0xd7e7('0x4f')]]['transferuniqueid']=_0x59a4ed['secondtransfereruniqueid'];queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x7')]=_0xd7e7('0x5d');}if(!_['isNil'](queues[_0x59a4ed[_0xd7e7('0x50')]])){if(_0x59a4ed[_0xd7e7('0x5e')]&&queues[_0x59a4ed['transfertargetlinkedid']]){queues[_0x59a4ed[_0xd7e7('0x5e')]][_0xd7e7('0x21')]=0x1;queues[_0x59a4ed[_0xd7e7('0x55')]]=_['clone'](queues[_0x59a4ed[_0xd7e7('0x5e')]]);queues[_0x59a4ed[_0xd7e7('0x55')]][_0xd7e7('0xd')]=_0x59a4ed[_0xd7e7('0x55')];queues[_0x59a4ed['transfertargetuniqueid']][_0xd7e7('0x21')]=0x2;queues[_0x59a4ed[_0xd7e7('0x55')]][_0xd7e7('0x6')]=queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x6')];queues[_0x59a4ed[_0xd7e7('0x55')]][_0xd7e7('0x56')]=queues[_0x59a4ed[_0xd7e7('0x4f')]][_0xd7e7('0x56')];queues[_0x59a4ed[_0xd7e7('0x55')]]['queuecallerjoinAt']=utils[_0xd7e7('0x14')]();queues[_0x59a4ed['transfertargetuniqueid']][_0xd7e7('0x57')]=utils[_0xd7e7('0x14')]();queues[_0x59a4ed[_0xd7e7('0x55')]][_0xd7e7('0x36')]=0x0;queues[_0x59a4ed[_0xd7e7('0x55')]][_0xd7e7('0x58')]=0x0;utils['info'](util[_0xd7e7('0x10')](_0xd7e7('0x5f'),_0x59a4ed['origtransfereruniqueid'],queues[_0x59a4ed[_0xd7e7('0x55')]]['name'],queues[_0x59a4ed[_0xd7e7('0x55')]]['transfereduniqueid'],queues[_0x59a4ed[_0xd7e7('0x55')]]['calleridnum'],queues[_0x59a4ed[_0xd7e7('0x55')]]['calleridname']));}else{utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x5a'),_0x59a4ed[_0xd7e7('0x4e')],queues[_0x59a4ed[_0xd7e7('0x50')]][_0xd7e7('0x1f')],_0x59a4ed[_0xd7e7('0x4f')]));queues[_0x59a4ed[_0xd7e7('0x50')]]['transfereduniqueid']=_0x59a4ed[_0xd7e7('0x4f')];}}}}catch(_0x48e7c1){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')](_0xd7e7('0x60'),_0x59a4ed[_0xd7e7('0x4e')]),_0x48e7c1);}};exports['musiconholdstart']=function(_0x44124c){try{if(!_['isNil'](queues[_0x44124c['uniqueid']])){utils['debug'](util[_0xd7e7('0x10')](_0xd7e7('0x61'),_0x44124c[_0xd7e7('0x4')]),_0x44124c);queues[_0x44124c[_0xd7e7('0x4')]]['musiconholdstartAt']=utils['now']();utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')](_0xd7e7('0x62'),_0x44124c['uniqueid'],queues[_0x44124c[_0xd7e7('0x4')]][_0xd7e7('0x1f')],queues[_0x44124c[_0xd7e7('0x4')]][_0xd7e7('0x63')]));}}catch(_0x551d38){utils[_0xd7e7('0x15')](util['format']('[%s][queues][musiconholdstart]',_0x44124c[_0xd7e7('0x4')]),_0x551d38);}};exports[_0xd7e7('0x64')]=function(_0x385016){try{if(!_['isNil'](queues[_0x385016[_0xd7e7('0x4')]])){if(!_[_0xd7e7('0x18')](queues[_0x385016['uniqueid']][_0xd7e7('0x63')])){utils[_0xd7e7('0xf')](util[_0xd7e7('0x10')]('[%s][queues][musiconholdstop]',_0x385016[_0xd7e7('0x4')]),_0x385016);queues[_0x385016[_0xd7e7('0x4')]]['mohtime']+=utils[_0xd7e7('0x37')](utils[_0xd7e7('0x14')](),queues[_0x385016[_0xd7e7('0x4')]][_0xd7e7('0x63')]);utils[_0xd7e7('0x3')](util[_0xd7e7('0x10')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x385016[_0xd7e7('0x4')],queues[_0x385016['uniqueid']][_0xd7e7('0x1f')],queues[_0x385016[_0xd7e7('0x4')]][_0xd7e7('0x58')]));delete queues[_0x385016[_0xd7e7('0x4')]][_0xd7e7('0x63')];}}}catch(_0x57c30d){utils[_0xd7e7('0x15')](util[_0xd7e7('0x10')](_0xd7e7('0x65'),_0x385016[_0xd7e7('0x4')]),_0x57c30d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 95aefbd..ebb6846 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 _0x2b8a=['[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','info','format','uniqueid','blinds','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','outbound','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','application','toLowerCase','set','appdata','cdr','substring','lastIndexOf','queuecallerjoin'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x2b8a,0x126));var _0xa2b8=function(_0x398739,_0x19858f){_0x398739=_0x398739-0x0;var _0x37f8d9=_0x2b8a[_0x398739];return _0x37f8d9;};'use strict';var _=require(_0xa2b8('0x0'));var util=require(_0xa2b8('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x221e51){var _0x260056;utils[_0xa2b8('0x2')](util[_0xa2b8('0x3')]('[%s][recordings][writeDB]',_0x221e51[_0xa2b8('0x4')]));if(transfers[_0xa2b8('0x5')][_0x221e51[_0xa2b8('0x4')]]){_0x260056=_0x221e51['uniqueid'];_0x221e51[_0xa2b8('0x4')]=transfers[_0xa2b8('0x5')][_0x221e51['uniqueid']]['transfereeuniqueid'];}if(_0x221e51['accountcode']){utils[_0xa2b8('0x6')](_0x221e51[_0xa2b8('0x7')])[_0xa2b8('0x8')](function(_0x1a96cf){if(_0x1a96cf){_0x221e51[_0xa2b8('0x9')]=_0x1a96cf[_0xa2b8('0xa')];_0x221e51[_0xa2b8('0xb')]=_0x1a96cf['id'];}utils[_0xa2b8('0xc')](_0xa2b8('0xd'),_0x221e51);});}else{utils[_0xa2b8('0xc')](_0xa2b8('0xd'),_0x221e51);}if(_0x260056)delete transfers[_0xa2b8('0x5')][_0x260056];}exports[_0xa2b8('0xe')]=function(_0x54b097){try{utils[_0xa2b8('0xf')](util[_0xa2b8('0x3')]('[%s][recordings][newchannel]',_0x54b097[_0xa2b8('0x4')]),_0x54b097);if(_0x54b097['uniqueid']==_0x54b097[_0xa2b8('0x10')]){utils[_0xa2b8('0x2')](util[_0xa2b8('0x3')](_0xa2b8('0x11'),_0x54b097[_0xa2b8('0x4')],_0x54b097[_0xa2b8('0x12')],_0x54b097['exten']));recordings[_0x54b097[_0xa2b8('0x4')]]={'uniqueid':_0x54b097[_0xa2b8('0x4')],'accountcode':_0x54b097[_0xa2b8('0x7')],'exten':_0x54b097[_0xa2b8('0x13')],'context':_0x54b097[_0xa2b8('0x12')],'channel':_0x54b097[_0xa2b8('0x14')],'monitors':[]};}}catch(_0x4820c3){utils[_0xa2b8('0x15')](util['format'](_0xa2b8('0x16'),_0x54b097[_0xa2b8('0x4')]),_0x4820c3);}};exports[_0xa2b8('0x17')]=function(_0x304c86){try{utils[_0xa2b8('0xf')](util[_0xa2b8('0x3')]('[%s][recordings][newstate]',_0x304c86['uniqueid']),_0x304c86);if(!_[_0xa2b8('0x18')](recordings[_0x304c86['uniqueid']])&&_0x304c86[_0xa2b8('0x19')]==0x6){utils['info'](util[_0xa2b8('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x304c86[_0xa2b8('0x4')],_0x304c86['context'],_0x304c86[_0xa2b8('0x14')]));}else if(!_[_0xa2b8('0x18')](recordings[_0x304c86[_0xa2b8('0x10')]])&&_0x304c86['channelstate']==0x6&&_0x304c86[_0xa2b8('0x12')]!=_0xa2b8('0x1a')){utils[_0xa2b8('0x2')](util[_0xa2b8('0x3')](_0xa2b8('0x1b'),_0x304c86[_0xa2b8('0x4')],_0x304c86['linkedid'],_0x304c86['context'],_0x304c86[_0xa2b8('0x14')]));recordings[_0x304c86[_0xa2b8('0x10')]][_0xa2b8('0x7')]=_0x304c86[_0xa2b8('0x7')];}}catch(_0x503df4){utils[_0xa2b8('0x15')](util[_0xa2b8('0x3')](_0xa2b8('0x1c'),_0x304c86[_0xa2b8('0x4')]),_0x503df4);}};exports[_0xa2b8('0x1d')]=function(_0x578842){try{if(!_[_0xa2b8('0x18')](_0x578842[_0xa2b8('0x1e')])&&!_[_0xa2b8('0x18')](_0x578842[_0xa2b8('0x1e')][_0xa2b8('0x1f')])){utils[_0xa2b8('0xf')](util['format'](_0xa2b8('0x20'),_0x578842['uniqueid']),_0x578842);utils['info'](util[_0xa2b8('0x3')](_0xa2b8('0x21'),_0x578842[_0xa2b8('0x4')],_0x578842[_0xa2b8('0x1e')],_0x578842['value']));if(_[_0xa2b8('0x22')](_0x578842[_0xa2b8('0x23')],_0xa2b8('0x24'))){_0x578842[_0xa2b8('0x23')]=_0x578842[_0xa2b8('0x23')]['replace'](_0xa2b8('0x24'),_0xa2b8('0x25'));}if(recordings[_0x578842[_0xa2b8('0x10')]]){var _0x591f10=_['find'](recordings[_0x578842[_0xa2b8('0x10')]][_0xa2b8('0x26')],{'value':_0x578842[_0xa2b8('0x23')]});if(_['isNil'](_0x591f10)){recordings[_0x578842[_0xa2b8('0x10')]][_0xa2b8('0x26')][_0xa2b8('0x27')]({'value':_0x578842[_0xa2b8('0x23')]});}}}}catch(_0x22dc58){utils[_0xa2b8('0x15')](util[_0xa2b8('0x3')](_0xa2b8('0x20'),_0x578842[_0xa2b8('0x4')]),_0x22dc58);}};exports[_0xa2b8('0x28')]=function(_0x151e50){try{if(!_['isNil'](recordings[_0x151e50[_0xa2b8('0x4')]])){utils[_0xa2b8('0xf')](util[_0xa2b8('0x3')](_0xa2b8('0x29'),_0x151e50[_0xa2b8('0x4')]),_0x151e50);utils['info'](util['format'](_0xa2b8('0x2a'),_0x151e50[_0xa2b8('0x4')],_0x151e50[_0xa2b8('0x2b')],_0x151e50[_0xa2b8('0x2c')],_0x151e50['cause-txt']));recordings[_0x151e50[_0xa2b8('0x4')]][_0xa2b8('0x2b')]=_0x151e50[_0xa2b8('0x2b')];recordings[_0x151e50[_0xa2b8('0x4')]][_0xa2b8('0x2c')]=_0x151e50[_0xa2b8('0x2c')];recordings[_0x151e50['uniqueid']]['connectedlinenum']=_0x151e50['connectedlinenum'];recordings[_0x151e50[_0xa2b8('0x4')]][_0xa2b8('0x2d')]=_0x151e50[_0xa2b8('0x2d')];if(recordings[_0x151e50[_0xa2b8('0x4')]][_0xa2b8('0x2e')]==_0xa2b8('0x2f')&&recordings[_0x151e50['uniqueid']][_0xa2b8('0x7')]){recordings[_0x151e50[_0xa2b8('0x4')]][_0xa2b8('0x30')]=recordings[_0x151e50[_0xa2b8('0x4')]]['accountcode'];recordings[_0x151e50['uniqueid']][_0xa2b8('0x2d')]='';}recordings[_0x151e50[_0xa2b8('0x4')]][_0xa2b8('0x26')][_0xa2b8('0x31')](function(_0x1446fd){var _0x38b900=_[_0xa2b8('0x32')](recordings[_0x151e50[_0xa2b8('0x4')]]);_0x38b900[_0xa2b8('0x23')]=_0x1446fd[_0xa2b8('0x23')];writeDB(_0x38b900);});delete recordings[_0x151e50[_0xa2b8('0x4')]];}}catch(_0x287b1e){utils[_0xa2b8('0x15')](util['format'](_0xa2b8('0x29'),_0x151e50['uniqueid']),_0x287b1e);}};exports[_0xa2b8('0x33')]=function(_0x12c53b){try{if(!_[_0xa2b8('0x18')](recordings[_0x12c53b[_0xa2b8('0x4')]])){utils[_0xa2b8('0xf')](util[_0xa2b8('0x3')](_0xa2b8('0x34'),_0x12c53b[_0xa2b8('0x4')]),_0x12c53b);utils[_0xa2b8('0x2')](util[_0xa2b8('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x12c53b['uniqueid'],_0x12c53b[_0xa2b8('0x35')],_0x12c53b['appdata']));if(_0x12c53b[_0xa2b8('0x35')][_0xa2b8('0x36')]()==_0xa2b8('0x37')&&_['startsWith'](_0x12c53b[_0xa2b8('0x38')][_0xa2b8('0x36')](),_0xa2b8('0x39'))){var _0x26a9df=_0x12c53b[_0xa2b8('0x38')]['split']('=');var _0xbbf39d=_0x26a9df[0x0][_0xa2b8('0x3a')](_0x26a9df[0x0][_0xa2b8('0x3b')]('(')+0x1,_0x26a9df[0x0][_0xa2b8('0x3b')](')'));var _0xa68669=_0x26a9df[0x1];recordings[_0x12c53b[_0xa2b8('0x4')]][_0xbbf39d]=_0xa68669;}}}catch(_0x54d61e){utils['error'](util[_0xa2b8('0x3')](_0xa2b8('0x34'),_0x12c53b[_0xa2b8('0x4')]),_0x54d61e);}};exports[_0xa2b8('0x3c')]=function(_0x5d148d){try{if(!_[_0xa2b8('0x18')](recordings[_0x5d148d[_0xa2b8('0x4')]])){utils[_0xa2b8('0xf')](util[_0xa2b8('0x3')](_0xa2b8('0x3d'),_0x5d148d[_0xa2b8('0x4')]),_0x5d148d);utils['info'](util[_0xa2b8('0x3')](_0xa2b8('0x3e'),_0x5d148d[_0xa2b8('0x4')],_0x5d148d['queue']));recordings[_0x5d148d[_0xa2b8('0x4')]][_0xa2b8('0x3f')]=_0x5d148d[_0xa2b8('0x3f')];}}catch(_0x574c9d){utils['error'](util[_0xa2b8('0x3')](_0xa2b8('0x3d'),_0x5d148d[_0xa2b8('0x4')]),_0x574c9d);}};exports[_0xa2b8('0x40')]=function(_0x41ad9c){try{utils[_0xa2b8('0xf')](util['format'](_0xa2b8('0x41'),_0x41ad9c['uniqueid']),_0x41ad9c);utils[_0xa2b8('0x2')](util[_0xa2b8('0x3')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x41ad9c[_0xa2b8('0x4')],_0x41ad9c['transferercalleridnum'],_0x41ad9c[_0xa2b8('0x42')],_0x41ad9c[_0xa2b8('0x43')],_0x41ad9c[_0xa2b8('0x44')]));if(recordings[_0x41ad9c[_0xa2b8('0x45')]]&&transfers[_0xa2b8('0x5')][_0x41ad9c[_0xa2b8('0x45')]]){transfers['blinds'][_0x41ad9c[_0xa2b8('0x45')]][_0xa2b8('0x46')]=!![];}}catch(_0x32da36){utils[_0xa2b8('0x15')](util['format'](_0xa2b8('0x41'),_0x41ad9c['uniqueid']),_0x32da36);}}; \ No newline at end of file +var _0xb36b=['calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','then','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s'];(function(_0x31c5a3,_0x30e453){var _0x3439ba=function(_0x136b92){while(--_0x136b92){_0x31c5a3['push'](_0x31c5a3['shift']());}};_0x3439ba(++_0x30e453);}(_0xb36b,0x148));var _0xbb36=function(_0x50e898,_0xff1435){_0x50e898=_0x50e898-0x0;var _0x3263a3=_0xb36b[_0x50e898];return _0x3263a3;};'use strict';var _=require(_0xbb36('0x0'));var util=require(_0xbb36('0x1'));var utils=require(_0xbb36('0x2'));var transfers=require(_0xbb36('0x3'));var recordings={};function writeDB(_0x35451b){var _0x39c9cf;utils[_0xbb36('0x4')](util[_0xbb36('0x5')](_0xbb36('0x6'),_0x35451b[_0xbb36('0x7')]));if(transfers['blinds'][_0x35451b['uniqueid']]){_0x39c9cf=_0x35451b[_0xbb36('0x7')];_0x35451b[_0xbb36('0x7')]=transfers[_0xbb36('0x8')][_0x35451b['uniqueid']][_0xbb36('0x9')];}if(_0x35451b[_0xbb36('0xa')]){utils['getUserByInternal'](_0x35451b[_0xbb36('0xa')])[_0xbb36('0xb')](function(_0x2d9529){if(_0x2d9529){_0x35451b['membername']=_0x2d9529['name'];_0x35451b[_0xbb36('0xc')]=_0x2d9529['id'];}utils[_0xbb36('0xd')](_0xbb36('0xe'),_0x35451b);});}else{utils[_0xbb36('0xd')](_0xbb36('0xe'),_0x35451b);}if(_0x39c9cf)delete transfers[_0xbb36('0x8')][_0x39c9cf];}exports[_0xbb36('0xf')]=function(_0x90fa0b){try{utils[_0xbb36('0x10')](util[_0xbb36('0x5')]('[%s][recordings][newchannel]',_0x90fa0b['uniqueid']),_0x90fa0b);if(_0x90fa0b[_0xbb36('0x7')]==_0x90fa0b[_0xbb36('0x11')]){utils[_0xbb36('0x4')](util[_0xbb36('0x5')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x90fa0b[_0xbb36('0x7')],_0x90fa0b[_0xbb36('0x12')],_0x90fa0b['exten']));recordings[_0x90fa0b[_0xbb36('0x7')]]={'uniqueid':_0x90fa0b[_0xbb36('0x7')],'accountcode':_0x90fa0b[_0xbb36('0xa')],'exten':_0x90fa0b[_0xbb36('0x13')],'context':_0x90fa0b[_0xbb36('0x12')],'channel':_0x90fa0b[_0xbb36('0x14')],'monitors':[]};}}catch(_0x161d80){utils[_0xbb36('0x15')](util[_0xbb36('0x5')]('[%s][recordings][newchannel]',_0x90fa0b['uniqueid']),_0x161d80);}};exports[_0xbb36('0x16')]=function(_0x3bccfb){try{utils[_0xbb36('0x10')](util[_0xbb36('0x5')](_0xbb36('0x17'),_0x3bccfb['uniqueid']),_0x3bccfb);if(!_[_0xbb36('0x18')](recordings[_0x3bccfb[_0xbb36('0x7')]])&&_0x3bccfb['channelstate']==0x6){utils[_0xbb36('0x4')](util[_0xbb36('0x5')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3bccfb[_0xbb36('0x7')],_0x3bccfb['context'],_0x3bccfb[_0xbb36('0x14')]));}else if(!_[_0xbb36('0x18')](recordings[_0x3bccfb[_0xbb36('0x11')]])&&_0x3bccfb[_0xbb36('0x19')]==0x6&&_0x3bccfb[_0xbb36('0x12')]!=_0xbb36('0x1a')){utils[_0xbb36('0x4')](util[_0xbb36('0x5')](_0xbb36('0x1b'),_0x3bccfb[_0xbb36('0x7')],_0x3bccfb['linkedid'],_0x3bccfb[_0xbb36('0x12')],_0x3bccfb[_0xbb36('0x14')]));recordings[_0x3bccfb[_0xbb36('0x11')]][_0xbb36('0xa')]=_0x3bccfb[_0xbb36('0xa')];}}catch(_0x441ba){utils[_0xbb36('0x15')](util[_0xbb36('0x5')](_0xbb36('0x17'),_0x3bccfb[_0xbb36('0x7')]),_0x441ba);}};exports['varset']=function(_0x4fd148){try{if(!_[_0xbb36('0x18')](_0x4fd148[_0xbb36('0x1c')])&&!_[_0xbb36('0x18')](_0x4fd148[_0xbb36('0x1c')][_0xbb36('0x1d')])){utils['debug'](util['format'](_0xbb36('0x1e'),_0x4fd148[_0xbb36('0x7')]),_0x4fd148);utils[_0xbb36('0x4')](util[_0xbb36('0x5')](_0xbb36('0x1f'),_0x4fd148[_0xbb36('0x7')],_0x4fd148[_0xbb36('0x1c')],_0x4fd148[_0xbb36('0x20')]));if(_[_0xbb36('0x21')](_0x4fd148[_0xbb36('0x20')],'.wav49')){_0x4fd148[_0xbb36('0x20')]=_0x4fd148[_0xbb36('0x20')][_0xbb36('0x22')](_0xbb36('0x23'),_0xbb36('0x24'));}if(recordings[_0x4fd148[_0xbb36('0x11')]]){var _0x5d9639=_[_0xbb36('0x25')](recordings[_0x4fd148[_0xbb36('0x11')]]['monitors'],{'value':_0x4fd148[_0xbb36('0x20')]});if(_[_0xbb36('0x18')](_0x5d9639)){recordings[_0x4fd148[_0xbb36('0x11')]][_0xbb36('0x26')][_0xbb36('0x27')]({'value':_0x4fd148[_0xbb36('0x20')]});}}}}catch(_0x2ea5e1){utils[_0xbb36('0x15')](util[_0xbb36('0x5')](_0xbb36('0x1e'),_0x4fd148[_0xbb36('0x7')]),_0x2ea5e1);}};exports[_0xbb36('0x28')]=function(_0x1182cc){try{if(!_[_0xbb36('0x18')](recordings[_0x1182cc[_0xbb36('0x7')]])){utils[_0xbb36('0x10')](util[_0xbb36('0x5')]('[%s][recordings][hangup]',_0x1182cc[_0xbb36('0x7')]),_0x1182cc);utils[_0xbb36('0x4')](util[_0xbb36('0x5')](_0xbb36('0x29'),_0x1182cc[_0xbb36('0x7')],_0x1182cc['calleridnum'],_0x1182cc[_0xbb36('0x2a')],_0x1182cc[_0xbb36('0x2b')]));recordings[_0x1182cc[_0xbb36('0x7')]][_0xbb36('0x2c')]=_0x1182cc[_0xbb36('0x2c')];recordings[_0x1182cc[_0xbb36('0x7')]][_0xbb36('0x2a')]=_0x1182cc['calleridname'];recordings[_0x1182cc[_0xbb36('0x7')]][_0xbb36('0x2d')]=_0x1182cc['connectedlinenum'];recordings[_0x1182cc[_0xbb36('0x7')]][_0xbb36('0x2e')]=_0x1182cc['connectedlinename'];if(recordings[_0x1182cc[_0xbb36('0x7')]][_0xbb36('0x2f')]=='outbound'&&recordings[_0x1182cc[_0xbb36('0x7')]][_0xbb36('0xa')]){recordings[_0x1182cc[_0xbb36('0x7')]]['connectedlinenum']=recordings[_0x1182cc['uniqueid']][_0xbb36('0xa')];recordings[_0x1182cc[_0xbb36('0x7')]]['connectedlinename']='';}recordings[_0x1182cc[_0xbb36('0x7')]]['monitors']['forEach'](function(_0x12607d){var _0x4ed8bb=_[_0xbb36('0x30')](recordings[_0x1182cc['uniqueid']]);_0x4ed8bb[_0xbb36('0x20')]=_0x12607d[_0xbb36('0x20')];writeDB(_0x4ed8bb);});delete recordings[_0x1182cc[_0xbb36('0x7')]];}}catch(_0xaa373b){utils[_0xbb36('0x15')](util['format'](_0xbb36('0x31'),_0x1182cc[_0xbb36('0x7')]),_0xaa373b);}};exports[_0xbb36('0x32')]=function(_0x4fea0b){try{if(!_[_0xbb36('0x18')](recordings[_0x4fea0b[_0xbb36('0x7')]])){utils[_0xbb36('0x10')](util['format'](_0xbb36('0x33'),_0x4fea0b[_0xbb36('0x7')]),_0x4fea0b);utils[_0xbb36('0x4')](util[_0xbb36('0x5')](_0xbb36('0x34'),_0x4fea0b[_0xbb36('0x7')],_0x4fea0b['application'],_0x4fea0b[_0xbb36('0x35')]));if(_0x4fea0b[_0xbb36('0x36')][_0xbb36('0x37')]()==_0xbb36('0x38')&&_['startsWith'](_0x4fea0b['appdata'][_0xbb36('0x37')](),_0xbb36('0x39'))){var _0x2c3d97=_0x4fea0b[_0xbb36('0x35')][_0xbb36('0x3a')]('=');var _0x3be366=_0x2c3d97[0x0][_0xbb36('0x3b')](_0x2c3d97[0x0][_0xbb36('0x3c')]('(')+0x1,_0x2c3d97[0x0][_0xbb36('0x3c')](')'));var _0x59160f=_0x2c3d97[0x1];recordings[_0x4fea0b['uniqueid']][_0x3be366]=_0x59160f;}}}catch(_0x4fa2f1){utils[_0xbb36('0x15')](util[_0xbb36('0x5')](_0xbb36('0x33'),_0x4fea0b[_0xbb36('0x7')]),_0x4fa2f1);}};exports[_0xbb36('0x3d')]=function(_0x182fb3){try{if(!_['isNil'](recordings[_0x182fb3['uniqueid']])){utils[_0xbb36('0x10')](util[_0xbb36('0x5')](_0xbb36('0x3e'),_0x182fb3[_0xbb36('0x7')]),_0x182fb3);utils[_0xbb36('0x4')](util[_0xbb36('0x5')](_0xbb36('0x3f'),_0x182fb3[_0xbb36('0x7')],_0x182fb3[_0xbb36('0x40')]));recordings[_0x182fb3[_0xbb36('0x7')]]['queue']=_0x182fb3[_0xbb36('0x40')];}}catch(_0xb451bf){utils[_0xbb36('0x15')](util[_0xbb36('0x5')](_0xbb36('0x3e'),_0x182fb3[_0xbb36('0x7')]),_0xb451bf);}};exports[_0xbb36('0x41')]=function(_0x4312e5){try{utils[_0xbb36('0x10')](util[_0xbb36('0x5')](_0xbb36('0x42'),_0x4312e5[_0xbb36('0x7')]),_0x4312e5);utils[_0xbb36('0x4')](util['format'](_0xbb36('0x43'),_0x4312e5['uniqueid'],_0x4312e5[_0xbb36('0x44')],_0x4312e5[_0xbb36('0x45')],_0x4312e5[_0xbb36('0x46')],_0x4312e5[_0xbb36('0x47')]));if(recordings[_0x4312e5[_0xbb36('0x48')]]&&transfers[_0xbb36('0x8')][_0x4312e5[_0xbb36('0x48')]]){transfers[_0xbb36('0x8')][_0x4312e5['transfereruniqueid']][_0xbb36('0x49')]=!![];}}catch(_0x67ce2e){utils[_0xbb36('0x15')](util['format'](_0xbb36('0x42'),_0x4312e5[_0xbb36('0x7')]),_0x67ce2e);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index d82627a..243197b 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 _0xf986=['util','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','type','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash'];(function(_0x18d691,_0x13b463){var _0x4e6ebf=function(_0x401876){while(--_0x401876){_0x18d691['push'](_0x18d691['shift']());}};_0x4e6ebf(++_0x13b463);}(_0xf986,0xd1));var _0x6f98=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf986[_0x432682];return _0x463d05;};'use strict';var _=require(_0x6f98('0x0'));var util=require(_0x6f98('0x1'));var utils=require('./utils');function writeDB(_0xfe3f57){utils['info'](util[_0x6f98('0x2')](_0x6f98('0x3'),_0xfe3f57['type']==='attended'?_0xfe3f57[_0x6f98('0x4')]:_0xfe3f57['uniqueid'],_0xfe3f57[_0x6f98('0x5')]));utils[_0x6f98('0x6')]('CreateVoiceTransferReport',_0xfe3f57);}exports[_0x6f98('0x7')]={};exports[_0x6f98('0x8')]=function(_0x1a2e23){try{utils[_0x6f98('0x9')](util[_0x6f98('0x2')](_0x6f98('0xa'),_0x1a2e23['uniqueid']),_0x1a2e23);utils[_0x6f98('0xb')](util[_0x6f98('0x2')](_0x6f98('0xc'),_0x1a2e23[_0x6f98('0xd')],_0x1a2e23[_0x6f98('0xe')],_0x1a2e23[_0x6f98('0xf')],_0x1a2e23['transfereecalleridnum'],_0x1a2e23[_0x6f98('0x10')]));_0x1a2e23[_0x6f98('0x5')]=_0x6f98('0x11');exports[_0x6f98('0x7')][_0x1a2e23[_0x6f98('0x12')]]=_0x1a2e23;writeDB(_0x1a2e23);}catch(_0x3372f4){utils[_0x6f98('0x13')](util[_0x6f98('0x2')](_0x6f98('0xa'),_0x1a2e23['uniqueid']),_0x3372f4);}};exports[_0x6f98('0x14')]=function(_0xe8b7f0){try{utils[_0x6f98('0x9')](util[_0x6f98('0x2')](_0x6f98('0x15'),_0xe8b7f0[_0x6f98('0x4')]),_0xe8b7f0);utils[_0x6f98('0xb')](util[_0x6f98('0x2')](_0x6f98('0x16'),_0xe8b7f0[_0x6f98('0x4')],_0xe8b7f0[_0x6f98('0x17')],_0xe8b7f0[_0x6f98('0x18')],_0xe8b7f0['transfertargetcalleridnum'],_0xe8b7f0[_0x6f98('0x19')]));_0xe8b7f0=_[_0x6f98('0x1a')](_0xe8b7f0,{'transfererchannel':_0xe8b7f0['origtransfererchannel'],'transferercalleridnum':_0xe8b7f0[_0x6f98('0x17')],'transferercalleridname':_0xe8b7f0['origtransferercalleridname'],'transfererconnectedlinenum':_0xe8b7f0[_0x6f98('0x1b')],'transfererconnectedlinename':_0xe8b7f0['secondtransfererconnectedlinename'],'transfereraccountcode':_0xe8b7f0[_0x6f98('0x1c')],'transferercontext':_0xe8b7f0[_0x6f98('0x1d')],'transfererexten':_0xe8b7f0[_0x6f98('0x1e')],'transfererlinkedid':_0xe8b7f0['origtransfererlinkedid'],'context':_0xe8b7f0[_0x6f98('0x1f')],'extension':_0xe8b7f0[_0x6f98('0x20')],'type':_0x6f98('0x21')});if(_['isNil'](_0xe8b7f0[_0x6f98('0x22')])){_0xe8b7f0=_[_0x6f98('0x1a')](_0xe8b7f0,{'transfereechannel':_0xe8b7f0[_0x6f98('0x23')],'transfereecalleridnum':_0xe8b7f0[_0x6f98('0x24')],'transfereecalleridname':_0xe8b7f0[_0x6f98('0x19')],'transfereeconnectedlinenum':_0xe8b7f0['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xe8b7f0[_0x6f98('0x25')],'transfereeaccountcode':_0xe8b7f0[_0x6f98('0x26')],'transfereecontext':_0xe8b7f0[_0x6f98('0x27')],'transfereeexten':_0xe8b7f0[_0x6f98('0x28')],'transfereelinkedid':_0xe8b7f0[_0x6f98('0x29')]});}writeDB(_0xe8b7f0);}catch(_0x3c49b2){utils[_0x6f98('0x13')](util[_0x6f98('0x2')]('[%s][transfers][attendedtransfer]',_0xe8b7f0[_0x6f98('0x4')]),_0x3c49b2);}}; \ No newline at end of file +var _0x32af=['type','attended','origtransfereruniqueid','request','blinds','blindtransfer','format','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfereraccountcode','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s'];(function(_0x19fec1,_0x1cc62f){var _0x29cd35=function(_0x712a4f){while(--_0x712a4f){_0x19fec1['push'](_0x19fec1['shift']());}};_0x29cd35(++_0x1cc62f);}(_0x32af,0x97));var _0xf32a=function(_0x1e1721,_0x337162){_0x1e1721=_0x1e1721-0x0;var _0x4791c3=_0x32af[_0x1e1721];return _0x4791c3;};'use strict';var _=require(_0xf32a('0x0'));var util=require(_0xf32a('0x1'));var utils=require(_0xf32a('0x2'));function writeDB(_0x15a611){utils[_0xf32a('0x3')](util['format'](_0xf32a('0x4'),_0x15a611[_0xf32a('0x5')]===_0xf32a('0x6')?_0x15a611[_0xf32a('0x7')]:_0x15a611['uniqueid'],_0x15a611[_0xf32a('0x5')]));utils[_0xf32a('0x8')]('CreateVoiceTransferReport',_0x15a611);}exports[_0xf32a('0x9')]={};exports[_0xf32a('0xa')]=function(_0x384084){try{utils['debug'](util[_0xf32a('0xb')](_0xf32a('0xc'),_0x384084[_0xf32a('0xd')]),_0x384084);utils[_0xf32a('0x3')](util[_0xf32a('0xb')](_0xf32a('0xe'),_0x384084[_0xf32a('0xd')],_0x384084[_0xf32a('0xf')],_0x384084[_0xf32a('0x10')],_0x384084['transfereecalleridnum'],_0x384084['transfereecalleridname']));_0x384084['type']=_0xf32a('0x11');exports[_0xf32a('0x9')][_0x384084[_0xf32a('0x12')]]=_0x384084;writeDB(_0x384084);}catch(_0x28a130){utils[_0xf32a('0x13')](util['format'](_0xf32a('0xc'),_0x384084['uniqueid']),_0x28a130);}};exports[_0xf32a('0x14')]=function(_0x1946f6){try{utils[_0xf32a('0x15')](util[_0xf32a('0xb')](_0xf32a('0x16'),_0x1946f6[_0xf32a('0x7')]),_0x1946f6);utils[_0xf32a('0x3')](util[_0xf32a('0xb')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1946f6[_0xf32a('0x7')],_0x1946f6[_0xf32a('0x17')],_0x1946f6[_0xf32a('0x18')],_0x1946f6[_0xf32a('0x19')],_0x1946f6[_0xf32a('0x1a')]));_0x1946f6=_['assign'](_0x1946f6,{'transfererchannel':_0x1946f6['origtransfererchannel'],'transferercalleridnum':_0x1946f6[_0xf32a('0x17')],'transferercalleridname':_0x1946f6[_0xf32a('0x18')],'transfererconnectedlinenum':_0x1946f6['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1946f6['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1946f6[_0xf32a('0x1b')],'transferercontext':_0x1946f6['secondtransferercontext'],'transfererexten':_0x1946f6[_0xf32a('0x1c')],'transfererlinkedid':_0x1946f6['origtransfererlinkedid'],'context':_0x1946f6[_0xf32a('0x1d')],'extension':_0x1946f6[_0xf32a('0x1e')],'type':_0xf32a('0x6')});if(_[_0xf32a('0x1f')](_0x1946f6[_0xf32a('0x20')])){_0x1946f6=_[_0xf32a('0x21')](_0x1946f6,{'transfereechannel':_0x1946f6[_0xf32a('0x22')],'transfereecalleridnum':_0x1946f6[_0xf32a('0x19')],'transfereecalleridname':_0x1946f6[_0xf32a('0x1a')],'transfereeconnectedlinenum':_0x1946f6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1946f6['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1946f6[_0xf32a('0x23')],'transfereecontext':_0x1946f6[_0xf32a('0x24')],'transfereeexten':_0x1946f6[_0xf32a('0x25')],'transfereelinkedid':_0x1946f6[_0xf32a('0x26')]});}writeDB(_0x1946f6);}catch(_0x191174){utils[_0xf32a('0x13')](util[_0xf32a('0xb')]('[%s][transfers][attendedtransfer]',_0x1946f6[_0xf32a('0x7')]),_0x191174);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 4dd2912..90d34a1 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 _0x5442=['acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','internal','name','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type'];(function(_0x2d1f6f,_0x239dec){var _0x2b8c80=function(_0x2bb5ce){while(--_0x2bb5ce){_0x2d1f6f['push'](_0x2d1f6f['shift']());}};_0x2b8c80(++_0x239dec);}(_0x5442,0xca));var _0x2544=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x5442[_0x41ee16];return _0x1f60de;};'use strict';var BPromise=require(_0x2544('0x0'));var jayson=require(_0x2544('0x1'));var moment=require(_0x2544('0x2'));var util=require('util');var client=jayson[_0x2544('0x3')][_0x2544('0x4')]({'port':0x2329});var logger=require(_0x2544('0x5'))(_0x2544('0x6'));exports[_0x2544('0x7')]=function(_0xe64307,_0xd0f2ce){logger['info'](_0xe64307,_0xd0f2ce?util[_0x2544('0x8')](_0xd0f2ce,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3beb76,_0x2b0b21){logger[_0x2544('0x9')](_0x3beb76,_0x2b0b21?util[_0x2544('0x8')](_0x2b0b21,{'showHidden':![],'depth':null}):'');};exports[_0x2544('0xa')]=function(_0x43bac7,_0x37ae1a){logger[_0x2544('0xa')](_0x43bac7,_0x37ae1a?util['inspect'](_0x37ae1a,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0xc8cc5e,_0x454bdf){return client[_0x2544('0xb')](_0xc8cc5e,{'body':_0x454bdf})['then'](function(_0xb08bd0){logger['debug'](_0x2544('0xc'),_0xc8cc5e,_0xb08bd0?util[_0x2544('0x8')](_0xb08bd0,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2a9e6e){logger[_0x2544('0xa')](_0x2544('0xc'),_0xc8cc5e,_0x2a9e6e?util['inspect'](_0x2a9e6e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5ed827){return client[_0x2544('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x2544('0xd'),_0x2544('0xe'),'interface'],'where':_0x5ed827,'limit':0x1}})[_0x2544('0xf')](function(_0x476bbf){logger['debug'](_0x2544('0x10'),JSON[_0x2544('0x11')](_0x5ed827),_0x476bbf?util['inspect'](_0x476bbf,{'showHidden':![],'depth':null}):'');return _0x476bbf[_0x2544('0x12')][_0x2544('0x13')]?_0x476bbf['result'][0x0]:null;});}exports[_0x2544('0x14')]=function(_0x356c0c){return new BPromise(function(_0x2ee1d0,_0x51e6f0){if(_0x356c0c){return getUser({'internal':_0x356c0c})[_0x2544('0xf')](function(_0x5707d1){logger[_0x2544('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x356c0c,_0x5707d1?_0x2544('0x15'):_0x2544('0x16'));return _0x2ee1d0(_0x5707d1);})[_0x2544('0x17')](function(_0x2dca62){logger['error'](_0x2544('0x18'),_0x2dca62?util['inspect'](_0x2dca62,{'showHidden':![],'depth':null}):'');return _0x2ee1d0(null);});}return _0x2ee1d0(null);});};exports[_0x2544('0x19')]=function(_0x177332){return new BPromise(function(_0x44de60,_0x4ed9e4){if(_0x177332){return getUser({'interface':_0x177332})['then'](function(_0x5f261b){logger['info'](_0x2544('0x1a'),_0x177332,_0x5f261b?'found':_0x2544('0x16'));return _0x44de60(_0x5f261b);})['catch'](function(_0x2d45a4){logger[_0x2544('0xa')]('[utils][getUserByInterface]',_0x2d45a4?util[_0x2544('0x8')](_0x2d45a4,{'showHidden':![],'depth':null}):'');return _0x44de60(null);});}return _0x44de60(null);});};exports[_0x2544('0x1b')]=function(_0x464874){return new BPromise(function(_0x15d6bb,_0x58e17a){if(_0x464874){return getUser({'name':_0x464874})[_0x2544('0xf')](function(_0x27fbd6){logger['info'](_0x2544('0x1c'),_0x464874,_0x27fbd6?_0x2544('0x15'):'notfound');return _0x15d6bb(_0x27fbd6);})['catch'](function(_0xbe20a1){logger['error'](_0x2544('0x1d'),_0xbe20a1?util['inspect'](_0xbe20a1,{'showHidden':![],'depth':null}):'');return _0x15d6bb(null);});}return _0x15d6bb(null);});};exports[_0x2544('0x1e')]=function(_0x205983){return new BPromise(function(_0x6c571d,_0x4062ca){if(_0x205983){return client[_0x2544('0xb')](_0x2544('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x2544('0xe'),_0x2544('0x20'),_0x2544('0x21'),'acwTimeout'],'where':{'name':_0x205983},'limit':0x1}})[_0x2544('0xf')](function(_0x5b4a48){logger['debug'](_0x2544('0x22'),_0x205983,_0x5b4a48?util[_0x2544('0x8')](_0x5b4a48,{'showHidden':![],'depth':null}):'');logger[_0x2544('0x7')](_0x2544('0x23'),_0x205983,_0x5b4a48?_0x2544('0x15'):'notfound');return _0x6c571d(_0x5b4a48[_0x2544('0x12')][_0x2544('0x13')]?_0x5b4a48[_0x2544('0x12')][0x0]:null);})['catch'](function(_0x582b24){logger[_0x2544('0xa')](_0x2544('0x24'),_0x582b24?util[_0x2544('0x8')](_0x582b24,{'showHidden':![],'depth':null}):'');return _0x6c571d(null);});}return _0x6c571d(null);});};exports['addTime']=function(_0x2fcf3c,_0x3fe5d8){return moment(_0x2fcf3c)['add'](_0x3fe5d8,'seconds')['format'](_0x2544('0x25'));};exports[_0x2544('0x26')]=function(_0x32624c,_0x4ddf2b){return moment(_0x32624c)[_0x2544('0x27')](_0x4ddf2b,_0x2544('0x28'))[_0x2544('0x29')](_0x2544('0x25'));};exports[_0x2544('0x2a')]=function(_0x43281d,_0x42fcb2){return moment(_0x43281d)[_0x2544('0x2b')](moment(_0x42fcb2),_0x2544('0x28'));};exports[_0x2544('0x2c')]=function(_0x11f6ab,_0x5c08f6){return parseInt(_0x11f6ab,0xa)+parseInt(_0x5c08f6,0xa);};exports['now']=function(){return moment()[_0x2544('0x29')](_0x2544('0x25'));};exports['isAfter']=function(_0x50f0a6,_0x45c5c0){if(_0x45c5c0){return moment(_0x50f0a6)[_0x2544('0x2d')](_0x45c5c0);}return!![];};exports[_0x2544('0x2e')]=function(_0x5cc3f9,_0x7209c8){if(_0x7209c8){return moment(_0x5cc3f9)[_0x2544('0x2e')](_0x7209c8);}else if(_0x5cc3f9){return!![];}return![];}; \ No newline at end of file +var _0xe4e5=['request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInternal]','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','found','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','util','client','xdr','info','inspect','debug','error'];(function(_0x601843,_0x805560){var _0x435aa5=function(_0x33aecd){while(--_0x33aecd){_0x601843['push'](_0x601843['shift']());}};_0x435aa5(++_0x805560);}(_0xe4e5,0xfb));var _0x5e4e=function(_0x5b2a34,_0x96398f){_0x5b2a34=_0x5b2a34-0x0;var _0x538925=_0xe4e5[_0x5b2a34];return _0x538925;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x5e4e('0x0'));var client=jayson[_0x5e4e('0x1')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x5e4e('0x2'));exports[_0x5e4e('0x3')]=function(_0x23b072,_0x37cbea){logger[_0x5e4e('0x3')](_0x23b072,_0x37cbea?util[_0x5e4e('0x4')](_0x37cbea,{'showHidden':![],'depth':null}):'');};exports[_0x5e4e('0x5')]=function(_0x3b9ef0,_0x46587d){logger[_0x5e4e('0x5')](_0x3b9ef0,_0x46587d?util[_0x5e4e('0x4')](_0x46587d,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0xc1be,_0x236e43){logger[_0x5e4e('0x6')](_0xc1be,_0x236e43?util['inspect'](_0x236e43,{'showHidden':![],'depth':null}):'');};exports[_0x5e4e('0x7')]=function(_0x23decf,_0x5a595e){return client[_0x5e4e('0x7')](_0x23decf,{'body':_0x5a595e})[_0x5e4e('0x8')](function(_0xc53627){logger['debug'](_0x5e4e('0x9'),_0x23decf,_0xc53627?util[_0x5e4e('0x4')](_0xc53627,{'showHidden':![],'depth':null}):'');})[_0x5e4e('0xa')](function(_0x47e38f){logger['error'](_0x5e4e('0x9'),_0x23decf,_0x47e38f?util[_0x5e4e('0x4')](_0x47e38f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x258b95){return client[_0x5e4e('0x7')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5e4e('0xb'),_0x5e4e('0xc'),_0x5e4e('0xd')],'where':_0x258b95,'limit':0x1}})[_0x5e4e('0x8')](function(_0x480889){logger[_0x5e4e('0x5')](_0x5e4e('0xe'),JSON[_0x5e4e('0xf')](_0x258b95),_0x480889?util[_0x5e4e('0x4')](_0x480889,{'showHidden':![],'depth':null}):'');return _0x480889['result'][_0x5e4e('0x10')]?_0x480889[_0x5e4e('0x11')][0x0]:null;});}exports[_0x5e4e('0x12')]=function(_0x7ee52b){return new BPromise(function(_0x537652,_0x10151c){if(_0x7ee52b){return getUser({'internal':_0x7ee52b})[_0x5e4e('0x8')](function(_0xa2abf1){logger[_0x5e4e('0x3')](_0x5e4e('0x13'),_0x7ee52b,_0xa2abf1?'found':'notfound');return _0x537652(_0xa2abf1);})['catch'](function(_0x34cd31){logger['error'](_0x5e4e('0x14'),_0x34cd31?util[_0x5e4e('0x4')](_0x34cd31,{'showHidden':![],'depth':null}):'');return _0x537652(null);});}return _0x537652(null);});};exports['getUserByInterface']=function(_0x209fb9){return new BPromise(function(_0x4b0060,_0x2ec5d7){if(_0x209fb9){return getUser({'interface':_0x209fb9})['then'](function(_0x5a1096){logger[_0x5e4e('0x3')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x209fb9,_0x5a1096?'found':_0x5e4e('0x15'));return _0x4b0060(_0x5a1096);})[_0x5e4e('0xa')](function(_0x2c9d9a){logger[_0x5e4e('0x6')]('[utils][getUserByInterface]',_0x2c9d9a?util['inspect'](_0x2c9d9a,{'showHidden':![],'depth':null}):'');return _0x4b0060(null);});}return _0x4b0060(null);});};exports[_0x5e4e('0x16')]=function(_0x34f414){return new BPromise(function(_0x24239a,_0x16696e){if(_0x34f414){return getUser({'name':_0x34f414})['then'](function(_0x28e614){logger[_0x5e4e('0x3')](_0x5e4e('0x17'),_0x34f414,_0x28e614?'found':'notfound');return _0x24239a(_0x28e614);})[_0x5e4e('0xa')](function(_0x34d770){logger[_0x5e4e('0x6')](_0x5e4e('0x18'),_0x34d770?util[_0x5e4e('0x4')](_0x34d770,{'showHidden':![],'depth':null}):'');return _0x24239a(null);});}return _0x24239a(null);});};exports['getVoiceQueueByName']=function(_0x481340){return new BPromise(function(_0x94dbb3,_0x550085){if(_0x481340){return client[_0x5e4e('0x7')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5e4e('0xc'),_0x5e4e('0x19'),_0x5e4e('0x1a'),_0x5e4e('0x1b')],'where':{'name':_0x481340},'limit':0x1}})[_0x5e4e('0x8')](function(_0x2c3dbf){logger[_0x5e4e('0x5')](_0x5e4e('0x1c'),_0x481340,_0x2c3dbf?util[_0x5e4e('0x4')](_0x2c3dbf,{'showHidden':![],'depth':null}):'');logger[_0x5e4e('0x3')](_0x5e4e('0x1d'),_0x481340,_0x2c3dbf?_0x5e4e('0x1e'):'notfound');return _0x94dbb3(_0x2c3dbf[_0x5e4e('0x11')][_0x5e4e('0x10')]?_0x2c3dbf[_0x5e4e('0x11')][0x0]:null);})['catch'](function(_0x3ae2fa){logger['error'](_0x5e4e('0x1f'),_0x3ae2fa?util[_0x5e4e('0x4')](_0x3ae2fa,{'showHidden':![],'depth':null}):'');return _0x94dbb3(null);});}return _0x94dbb3(null);});};exports[_0x5e4e('0x20')]=function(_0x279a60,_0x4dcbd1){return moment(_0x279a60)[_0x5e4e('0x21')](_0x4dcbd1,_0x5e4e('0x22'))[_0x5e4e('0x23')](_0x5e4e('0x24'));};exports[_0x5e4e('0x25')]=function(_0xade3f7,_0x344d31){return moment(_0xade3f7)[_0x5e4e('0x26')](_0x344d31,_0x5e4e('0x22'))[_0x5e4e('0x23')](_0x5e4e('0x24'));};exports[_0x5e4e('0x27')]=function(_0x1b9393,_0x43d05d){return moment(_0x1b9393)[_0x5e4e('0x28')](moment(_0x43d05d),'seconds');};exports[_0x5e4e('0x29')]=function(_0x3bfe47,_0x281b59){return parseInt(_0x3bfe47,0xa)+parseInt(_0x281b59,0xa);};exports['now']=function(){return moment()[_0x5e4e('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5e4e('0x2a')]=function(_0x5a3378,_0x4b3e5e){if(_0x4b3e5e){return moment(_0x5a3378)[_0x5e4e('0x2a')](_0x4b3e5e);}return!![];};exports['isBefore']=function(_0x18c6b4,_0xbea3fa){if(_0xbea3fa){return moment(_0x18c6b4)['isBefore'](_0xbea3fa);}else if(_0x18c6b4){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 0710979..8ff7aed 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 _0x987a=['client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','statusCode','inspect','use','device','agent_id','url','responseTime','agent_name','test','setupLoggers','fs-extra','lodash','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','role','name','ensureDir','client','catch','log','then','user','no-user','error','api','auth','set'];(function(_0x44e535,_0x2e4be6){var _0x3b46eb=function(_0x41a089){while(--_0x41a089){_0x44e535['push'](_0x44e535['shift']());}};_0x3b46eb(++_0x2e4be6);}(_0x987a,0x13a));var _0xa987=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x987a[_0x334841];return _0x5beb4b;};var fs=require(_0xa987('0x0'));var _=require(_0xa987('0x1'));var ewinston=require('express-winston');var path=require(_0xa987('0x2'));var util=require('util');var fileLogger=require(_0xa987('0x3'))[_0xa987('0x4')];var safeTemplate=require(_0xa987('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xa987('0x6'))[_0xa987('0x7')];function ClientSideLogger(){function _0x2a347a(_0x5b922e){var _0x197a77=path[_0xa987('0x8')]('/var','log','xcally');var _0x56cb4d=path[_0xa987('0x8')]('client',_0x5b922e[_0xa987('0x9')]+'-'+_0x5b922e[_0xa987('0xa')]);return fs[_0xa987('0xb')](path[_0xa987('0x8')](_0x197a77,_0x56cb4d))['then'](function(){var _0x5cb14e=fileLogger(_0xa987('0xc'),path[_0xa987('0x8')](_0x197a77,_0x56cb4d));return _0x5cb14e;})[_0xa987('0xd')](function(_0x2a65a3){throw _0x2a65a3;});}this[_0xa987('0xe')]=function(_0x4136d7,_0x44e788,_0x1517d7,_0x44de2c){return _0x2a347a(_0x4136d7['user'])[_0xa987('0xf')](function(_0xeaf129){var _0x5889e4=_0xeaf129[_0x44e788];return _0x5889e4;})[_0xa987('0xf')](function(_0x3c87b2){var _0x28387a=_0x4136d7[_0xa987('0x10')]?_0x4136d7[_0xa987('0x10')]['id']:_0xa987('0x11');var _0x53a9f1=_0x44de2c['data'];var _0x3abd37=_0x44de2c['timestamp'];var _0x55797f=new Date(Number(_0x3abd37));return _0x3c87b2(_0x28387a,_0x55797f,_0x1517d7,_0x53a9f1);})[_0xa987('0xd')](function(_0x23a035){fileLogger(_0xa987('0xc'))[_0xa987('0x12')](_0x23a035);});};}function setupLoggers(_0x4d7946){return new Promise(function(_0x596dd5){var _0x5cdedc=new ClientSideLogger();var _0x35d2bb=fileLogger(_0xa987('0x13'));var _0x503492=fileLogger(_0xa987('0x14'));_0x4d7946[_0xa987('0x15')](_0xa987('0x16'),_0x5cdedc);_0x4d7946['use'](ewinston[_0xa987('0x17')]({'winstonInstance':_0x35d2bb,'meta':![],'statusLevels':!![],'msg':function(_0x159153,_0x596c0a){var _0x36f842=_0xa987('0x18');if(!_['isEmpty'](_0x159153['body'])){_0x36f842+=_0xa987('0x19');var _0x56cb40=_0x159153[_0xa987('0x1a')];maskSensitiveData(_0x56cb40);}return safeTemplate(util[_0xa987('0x1b')](_0x36f842,_0x159153[_0xa987('0x1c')],_0x159153[_0xa987('0x1d')][_0xa987('0x1e')]?_0x159153[_0xa987('0x1d')][_0xa987('0x1e')]:_0x159153[_0xa987('0x1f')]['remoteAddress']||_0x159153['ip'],_0x159153['url'],_0x596c0a[_0xa987('0x20')],_0x596c0a['responseTime'],_0x159153[_0xa987('0x10')]?_0x159153[_0xa987('0x10')]['id']:null,_0x159153[_0xa987('0x10')]?_0x159153[_0xa987('0x10')][_0xa987('0xa')]:null,_0x159153[_0xa987('0x10')]?_0x159153[_0xa987('0x10')][_0xa987('0x9')]:null,_0x56cb40?util[_0xa987('0x21')](_0x56cb40,![],null):''));}}));_0x4d7946[_0xa987('0x22')](ewinston[_0xa987('0x17')]({'winstonInstance':_0x503492,'meta':![],'statusLevels':!![],'msg':function(_0x154ff0,_0x19b5e5){var _0x34d041='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x154ff0[_0xa987('0x1a')]&&_0x154ff0[_0xa987('0x1a')][_0xa987('0x23')]&&_0x154ff0[_0xa987('0x1a')][_0xa987('0x24')]){_0x34d041='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xa987('0x1b')](_0x34d041,_0x154ff0[_0xa987('0x1c')],_0x154ff0[_0xa987('0x1d')][_0xa987('0x1e')]?_0x154ff0[_0xa987('0x1d')][_0xa987('0x1e')]:_0x154ff0['connection']['remoteAddress']||_0x154ff0['ip'],_0x154ff0[_0xa987('0x25')],_0x19b5e5[_0xa987('0x20')],_0x19b5e5[_0xa987('0x26')],_0x154ff0[_0xa987('0x10')]?_0x154ff0[_0xa987('0x10')]['id']:null,_0x154ff0[_0xa987('0x10')]?_0x154ff0[_0xa987('0x10')][_0xa987('0xa')]:null,_0x154ff0['user']?_0x154ff0[_0xa987('0x10')][_0xa987('0x9')]:null,_0x154ff0[_0xa987('0x1a')]&&_0x154ff0[_0xa987('0x1a')][_0xa987('0x23')]?_0x154ff0[_0xa987('0x1a')][_0xa987('0x23')]:'other',_0x154ff0[_0xa987('0x1a')]&&_0x154ff0[_0xa987('0x1a')][_0xa987('0x24')]?_0x154ff0[_0xa987('0x1a')][_0xa987('0x24')]:'',_0x154ff0[_0xa987('0x1a')]&&_0x154ff0['body'][_0xa987('0x27')]?_0x154ff0[_0xa987('0x1a')][_0xa987('0x27')]:'');},'ignoreRoute':function(_0x1a5909){var _0x2e3d73=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2e3d73[_0xa987('0x28')](_0x1a5909[_0xa987('0x25')]);}}));return _0x596dd5();});}exports[_0xa987('0x29')]=setupLoggers; \ No newline at end of file +var _0x19e9=['inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','remoteAddress','statusCode','other','agent_name','test','fs-extra','lodash','express-winston','path','util','./loggers','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','then','user','timestamp','catch','error','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','method','headers','x-forwarded-for','connection','url','responseTime','name'];(function(_0x16fee7,_0x37cdbd){var _0x266774=function(_0x1cb0f8){while(--_0x1cb0f8){_0x16fee7['push'](_0x16fee7['shift']());}};_0x266774(++_0x37cdbd);}(_0x19e9,0x1a8));var _0x919e=function(_0x4b6b7d,_0x5ba63b){_0x4b6b7d=_0x4b6b7d-0x0;var _0x3ded45=_0x19e9[_0x4b6b7d];return _0x3ded45;};var fs=require(_0x919e('0x0'));var _=require(_0x919e('0x1'));var ewinston=require(_0x919e('0x2'));var path=require(_0x919e('0x3'));var util=require(_0x919e('0x4'));var fileLogger=require(_0x919e('0x5'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x919e('0x6')];var maskSensitiveData=require(_0x919e('0x7'))[_0x919e('0x8')];function ClientSideLogger(){function _0x392cf2(_0x5f3106){var _0x85309c=path[_0x919e('0x9')](_0x919e('0xa'),_0x919e('0xb'),_0x919e('0xc'));var _0x340c96=path[_0x919e('0x9')](_0x919e('0xd'),_0x5f3106[_0x919e('0xe')]+'-'+_0x5f3106['name']);return fs['ensureDir'](path[_0x919e('0x9')](_0x85309c,_0x340c96))['then'](function(){var _0x743a62=fileLogger('client',path[_0x919e('0x9')](_0x85309c,_0x340c96));return _0x743a62;})['catch'](function(_0x4f7c3c){throw _0x4f7c3c;});}this['log']=function(_0x5eb948,_0x5637ca,_0x174933,_0x7593f6){return _0x392cf2(_0x5eb948['user'])[_0x919e('0xf')](function(_0x563ba5){var _0x5704e7=_0x563ba5[_0x5637ca];return _0x5704e7;})[_0x919e('0xf')](function(_0x391d44){var _0x2b9066=_0x5eb948[_0x919e('0x10')]?_0x5eb948[_0x919e('0x10')]['id']:'no-user';var _0xf4d13f=_0x7593f6['data'];var _0x36411f=_0x7593f6[_0x919e('0x11')];var _0x3e4180=new Date(Number(_0x36411f));return _0x391d44(_0x2b9066,_0x3e4180,_0x174933,_0xf4d13f);})[_0x919e('0x12')](function(_0x26ed77){fileLogger(_0x919e('0xd'))[_0x919e('0x13')](_0x26ed77);});};}function setupLoggers(_0xf6ed3){return new Promise(function(_0x10c826){var _0x30ebf0=new ClientSideLogger();var _0x2b6c85=fileLogger(_0x919e('0x14'));var _0x32f515=fileLogger('auth');_0xf6ed3[_0x919e('0x15')](_0x919e('0x16'),_0x30ebf0);_0xf6ed3[_0x919e('0x17')](ewinston[_0x919e('0x18')]({'winstonInstance':_0x2b6c85,'meta':![],'statusLevels':!![],'msg':function(_0x2f5a5f,_0x2de601){var _0x4840be=_0x919e('0x19');if(!_[_0x919e('0x1a')](_0x2f5a5f['body'])){_0x4840be+=_0x919e('0x1b');var _0x76b7ba=_0x2f5a5f[_0x919e('0x1c')];maskSensitiveData(_0x76b7ba);}return safeTemplate(util['format'](_0x4840be,_0x2f5a5f[_0x919e('0x1d')],_0x2f5a5f[_0x919e('0x1e')][_0x919e('0x1f')]?_0x2f5a5f[_0x919e('0x1e')][_0x919e('0x1f')]:_0x2f5a5f[_0x919e('0x20')]['remoteAddress']||_0x2f5a5f['ip'],_0x2f5a5f[_0x919e('0x21')],_0x2de601['statusCode'],_0x2de601[_0x919e('0x22')],_0x2f5a5f[_0x919e('0x10')]?_0x2f5a5f[_0x919e('0x10')]['id']:null,_0x2f5a5f[_0x919e('0x10')]?_0x2f5a5f[_0x919e('0x10')][_0x919e('0x23')]:null,_0x2f5a5f['user']?_0x2f5a5f['user'][_0x919e('0xe')]:null,_0x76b7ba?util[_0x919e('0x24')](_0x76b7ba,![],null):''));}}));_0xf6ed3[_0x919e('0x17')](ewinston[_0x919e('0x18')]({'winstonInstance':_0x32f515,'meta':![],'statusLevels':!![],'msg':function(_0xd5bb3e,_0x73a404){var _0x451baf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xd5bb3e[_0x919e('0x1c')]&&_0xd5bb3e['body'][_0x919e('0x25')]&&_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x26')]){_0x451baf=_0x919e('0x27');}return util[_0x919e('0x28')](_0x451baf,_0xd5bb3e[_0x919e('0x1d')],_0xd5bb3e[_0x919e('0x1e')][_0x919e('0x1f')]?_0xd5bb3e[_0x919e('0x1e')][_0x919e('0x1f')]:_0xd5bb3e[_0x919e('0x20')][_0x919e('0x29')]||_0xd5bb3e['ip'],_0xd5bb3e[_0x919e('0x21')],_0x73a404[_0x919e('0x2a')],_0x73a404['responseTime'],_0xd5bb3e[_0x919e('0x10')]?_0xd5bb3e['user']['id']:null,_0xd5bb3e[_0x919e('0x10')]?_0xd5bb3e[_0x919e('0x10')]['name']:null,_0xd5bb3e[_0x919e('0x10')]?_0xd5bb3e[_0x919e('0x10')]['role']:null,_0xd5bb3e['body']&&_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x25')]?_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x25')]:_0x919e('0x2b'),_0xd5bb3e['body']&&_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x26')]?_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x26')]:'',_0xd5bb3e[_0x919e('0x1c')]&&_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x2c')]?_0xd5bb3e[_0x919e('0x1c')][_0x919e('0x2c')]:'');},'ignoreRoute':function(_0x557864){var _0xc83d06=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xc83d06[_0x919e('0x2d')](_0x557864[_0x919e('0x21')]);}}));return _0x10c826();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 0c713e8..4f68fd3 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdad9=['isMoment','split','length','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','isValid','locale','toLowerCase','indexOf','slice','concat','monthsShort','exports','circularMonthInterval','clone','hours','minutes','isBefore','day','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','max','min','domCompare','MMM','monthCompare'];(function(_0x263e6d,_0x585ebb){var _0xc8d72=function(_0x54afe4){while(--_0x54afe4){_0x263e6d['push'](_0x263e6d['shift']());}};_0xc8d72(++_0x585ebb);}(_0xdad9,0x1bd));var _0x9dad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdad9[_0x20a584];return _0x4b41a8;};var _=require(_0x9dad('0x0'));var moment=require(_0x9dad('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][_0x9dad('0x2')](function(_0x4c65f5){return _0x4c65f5['source'];})[_0x9dad('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x9dad('0x4');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x51506a){if(!_0x51506a[_0x9dad('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4cfb84){var _0x305e9f=_0x4cfb84['split'](':')[_0x9dad('0x2')](function(_0x5c3f1b){return parseInt(_0x5c3f1b,0xa);});var _0x5a5daf=_0x305e9f[0x0];var _0x375166=_0x305e9f[0x1];if(_0x5a5daf<0x0||_0x5a5daf>0x17||_0x375166<0x0||_0x375166>0x3b){throw new Error(EINVALID_DATE);}return[_0x5a5daf,_0x375166];}function circularDoWInterval(_0x2ce9c3,_0x2e2a00){if(_0x2ce9c3===_0x2e2a00){return[_0x2ce9c3];}else{var _0x34b23a=moment[_0x9dad('0x6')]();moment['locale']('en');var _0x54b377=moment['weekdaysShort']()[_0x9dad('0x2')](function(_0x280575){return _0x280575[_0x9dad('0x7')]();});moment['locale'](_0x34b23a);var _0x174048=_0x54b377['indexOf'](_0x2ce9c3);var _0x512daa=_0x54b377[_0x9dad('0x8')](_0x2e2a00);if(_0x512daa>_0x174048){return _0x54b377[_0x9dad('0x9')](_0x174048,_0x512daa+0x1);}else{var _0x378169=_0x54b377[_0x9dad('0x9')](0x0,_0x512daa+0x1);var _0x2f47b5=_0x54b377['slice'](_0x174048);return _0x2f47b5[_0x9dad('0xa')](_0x378169);}}}module['exports']['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x35cb19,_0x43dffa){if(_0x35cb19===_0x43dffa){return[_0x35cb19];}else{var _0x8607e0=moment['locale']();moment[_0x9dad('0x6')]('en');var _0x265dd2=moment[_0x9dad('0xb')]()[_0x9dad('0x2')](function(_0x37140c){return _0x37140c[_0x9dad('0x7')]();});moment['locale'](_0x8607e0);var _0x1dc038=_0x265dd2[_0x9dad('0x8')](_0x35cb19);var _0x55f0f2=_0x265dd2['indexOf'](_0x43dffa);if(_0x55f0f2>_0x1dc038){return _0x265dd2[_0x9dad('0x9')](_0x1dc038,_0x55f0f2+0x1);}else{var _0x5b5a12=_0x265dd2[_0x9dad('0x9')](0x0,_0x55f0f2+0x1);var _0x52f242=_0x265dd2[_0x9dad('0x9')](_0x1dc038);return _0x52f242[_0x9dad('0xa')](_0x5b5a12);}}}module[_0x9dad('0xc')][_0x9dad('0xd')]=circularMonthInterval;function parseDom(_0x368198){var _0x3f8881=parseInt(_0x368198,0xa);if(_0x3f8881<0x1||_0x3f8881>0x1f){throw new Error(EINVALID_DATE);}return _0x3f8881;}function timeCompare(_0x50e464,_0xb585bc,_0x187466){var _0x1b0f16=_0x50e464[_0x9dad('0xe')]();var _0xc4d91e=extractTime(_0xb585bc);var _0x5124bd=_0xc4d91e[0x0];var _0x52399d=_0xc4d91e[0x1];var _0x387e29=_0x50e464[_0x9dad('0xe')]()[_0x9dad('0xf')](_0x5124bd)[_0x9dad('0x10')](_0x52399d);throwIfDateNotValid(_0x387e29);var _0x5d46fd=extractTime(_0x187466);var _0x5f3505=_0x5d46fd[0x0];var _0x3228d3=_0x5d46fd[0x1];var _0x2e40b3=_0x50e464[_0x9dad('0xe')]()[_0x9dad('0xf')](_0x5f3505)[_0x9dad('0x10')](_0x3228d3);throwIfDateNotValid(_0x2e40b3);if(_0x2e40b3[_0x9dad('0x11')](_0x387e29)){var _0x4c66a6=_0x1b0f16[_0x9dad('0xe')]()['startOf'](_0x9dad('0x12'));var _0x4ecb69=_0x1b0f16[_0x9dad('0xe')]()['endOf'](_0x9dad('0x12'));return _0x1b0f16[_0x9dad('0x13')](_0x387e29,_0x4ecb69,undefined,'[]')||_0x1b0f16['isBetween'](_0x4c66a6,_0x2e40b3,undefined,'[]');}else{return _0x1b0f16[_0x9dad('0x13')](_0x387e29,_0x2e40b3,undefined,'[]');}}module[_0x9dad('0xc')][_0x9dad('0x14')]=timeCompare;function dowCompare(_0x270371,_0x350e13,_0x353516){var _0x289381=_0x270371[_0x9dad('0x6')]('en')[_0x9dad('0x15')](_0x9dad('0x16'))['toLowerCase']();return circularDoWInterval(_0x350e13,_0x353516)[_0x9dad('0x17')](_0x289381);}module[_0x9dad('0xc')]['dowCompare']=dowCompare;function domCompare(_0x24cec6,_0x57e5a1,_0x26b20f){var _0xfcfdf5=_0x24cec6[_0x9dad('0x18')]();if(_0x57e5a1===_0x26b20f){return _0xfcfdf5===_0x57e5a1;}else{var _0x3f1345=_0x24cec6[_0x9dad('0x19')]();var _0x47d907=_0x57e5a1<_0x26b20f;let _0x28133a=![];var _0x5bfb7d=0x0;var _0x520fb1=0x0;if(_0x47d907){_0x5bfb7d=Math[_0x9dad('0x1a')](0x1,_0x57e5a1);_0x520fb1=Math[_0x9dad('0x1b')](_0x26b20f,_0x3f1345);_0x28133a=_0xfcfdf5>=_0x5bfb7d&&_0xfcfdf5<=_0x520fb1;}else{_0x5bfb7d=Math[_0x9dad('0x1b')](_0x57e5a1,_0x3f1345);_0x520fb1=Math['max'](0x1,_0x26b20f);_0x28133a=_0xfcfdf5>=_0x5bfb7d||_0xfcfdf5<=_0x520fb1;}return _0x28133a;}}module[_0x9dad('0xc')][_0x9dad('0x1c')]=domCompare;function monthCompare(_0x11daee,_0x17b65c,_0x45b4a3){var _0x552e35=_0x11daee[_0x9dad('0x6')]('en')[_0x9dad('0x15')](_0x9dad('0x1d'))[_0x9dad('0x7')]();return circularMonthInterval(_0x17b65c,_0x45b4a3)['includes'](_0x552e35);}module[_0x9dad('0xc')][_0x9dad('0x1e')]=monthCompare;function iftime(_0x5e4c0d,_0x54e0af=moment['tz']['guess'](),_0x1dfb1e=moment()){if(!validateRx['test'](_0x5e4c0d)){throw new Error(EINVALID_STRING);}else{var _0x39af21=(moment[_0x9dad('0x1f')](_0x1dfb1e)?_0x1dfb1e['clone']():moment(_0x1dfb1e))['tz'](_0x54e0af)[_0x9dad('0x6')]('en');throwIfDateNotValid(_0x39af21);var _0x386b95=_0x5e4c0d[_0x9dad('0x20')](',');var _0x578e28=_0x386b95[0x0];var _0xcab1c3=_0x386b95[0x1];var _0x5af735=_0x386b95[0x2];var _0x4b8dc8=_0x386b95[0x3];let _0x51bcb6=!![];if(_0x578e28!=='*'){var _0x5a952c=_0x578e28[_0x9dad('0x20')]('-');var _0x1c8474=_['padStart'](_0x5a952c[0x0],0x5,'0');var _0x1b7caa=_0x5a952c[_0x9dad('0x21')]===0x2?_['padStart'](_0x5a952c[0x1],0x5,'0'):_0x1c8474;_0x51bcb6=timeCompare(_0x39af21,_0x1c8474,_0x1b7caa);}let _0x3a626d=!![];if(_0xcab1c3!=='*'){var _0x311688=_0xcab1c3[_0x9dad('0x20')]('-');var _0x190759=_0x311688[0x0];var _0x97e3cd=_0x311688[_0x9dad('0x21')]===0x2?_0x311688[0x1]:_0x190759;_0x3a626d=dowCompare(_0x39af21,_0x190759,_0x97e3cd);}let _0x4b9cc6=!![];if(_0x5af735!=='*'){var _0x4707f3=_0x5af735[_0x9dad('0x20')]('-');var _0x278241=parseDom(_0x4707f3[0x0]);var _0x43c6fc=_0x4707f3[_0x9dad('0x21')]===0x2?parseDom(_0x4707f3[0x1]):_0x278241;_0x4b9cc6=domCompare(_0x39af21,_0x278241,_0x43c6fc);}let _0x32ca5e=!![];if(_0x4b8dc8!=='*'){var _0x377ba6=_0x4b8dc8[_0x9dad('0x20')]('-');var _0x339114=_0x377ba6[0x0];var _0x5cc831=_0x377ba6[_0x9dad('0x21')]===0x2?_0x377ba6[0x1]:_0x377ba6[0x0];_0x32ca5e=monthCompare(_0x39af21,_0x339114,_0x5cc831);}return _0x51bcb6&&_0x3a626d&&_0x4b9cc6&&_0x32ca5e;}}module[_0x9dad('0xc')]['iftime']=iftime; \ No newline at end of file +var _0x7fa4=['slice','concat','circularDoWInterval','monthsShort','exports','clone','hours','minutes','startOf','day','isBetween','timeCompare','ddd','includes','dowCompare','date','daysInMonth','min','domCompare','format','monthCompare','guess','test','isMoment','padStart','length','lodash','moment-timezone','map','source','join','split','locale','toLowerCase','indexOf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fa4,0xa6));var _0x47fa=function(_0x3d2f04,_0x2af699){_0x3d2f04=_0x3d2f04-0x0;var _0x453593=_0x7fa4[_0x3d2f04];return _0x453593;};var _=require(_0x47fa('0x0'));var moment=require(_0x47fa('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][_0x47fa('0x2')](function(_0x2d96d2){return _0x2d96d2[_0x47fa('0x3')];})[_0x47fa('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x5826a9){if(!_0x5826a9['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4ce26d){var _0x469ee1=_0x4ce26d[_0x47fa('0x5')](':')[_0x47fa('0x2')](function(_0x4c2b43){return parseInt(_0x4c2b43,0xa);});var _0x5db200=_0x469ee1[0x0];var _0x18ff1a=_0x469ee1[0x1];if(_0x5db200<0x0||_0x5db200>0x17||_0x18ff1a<0x0||_0x18ff1a>0x3b){throw new Error(EINVALID_DATE);}return[_0x5db200,_0x18ff1a];}function circularDoWInterval(_0x4ce5d6,_0x474dd9){if(_0x4ce5d6===_0x474dd9){return[_0x4ce5d6];}else{var _0x3f7cf3=moment[_0x47fa('0x6')]();moment[_0x47fa('0x6')]('en');var _0x14a4f2=moment['weekdaysShort']()['map'](function(_0x1cf984){return _0x1cf984[_0x47fa('0x7')]();});moment[_0x47fa('0x6')](_0x3f7cf3);var _0x51953f=_0x14a4f2[_0x47fa('0x8')](_0x4ce5d6);var _0x377aef=_0x14a4f2[_0x47fa('0x8')](_0x474dd9);if(_0x377aef>_0x51953f){return _0x14a4f2[_0x47fa('0x9')](_0x51953f,_0x377aef+0x1);}else{var _0x5d6fe4=_0x14a4f2[_0x47fa('0x9')](0x0,_0x377aef+0x1);var _0x380828=_0x14a4f2[_0x47fa('0x9')](_0x51953f);return _0x380828[_0x47fa('0xa')](_0x5d6fe4);}}}module['exports'][_0x47fa('0xb')]=circularDoWInterval;function circularMonthInterval(_0x30b074,_0x4a2758){if(_0x30b074===_0x4a2758){return[_0x30b074];}else{var _0xb0ea3=moment['locale']();moment[_0x47fa('0x6')]('en');var _0x3d8689=moment[_0x47fa('0xc')]()['map'](function(_0x22ed9e){return _0x22ed9e[_0x47fa('0x7')]();});moment[_0x47fa('0x6')](_0xb0ea3);var _0x531920=_0x3d8689['indexOf'](_0x30b074);var _0x49bbcd=_0x3d8689[_0x47fa('0x8')](_0x4a2758);if(_0x49bbcd>_0x531920){return _0x3d8689['slice'](_0x531920,_0x49bbcd+0x1);}else{var _0x3272fb=_0x3d8689[_0x47fa('0x9')](0x0,_0x49bbcd+0x1);var _0xfa64a=_0x3d8689[_0x47fa('0x9')](_0x531920);return _0xfa64a[_0x47fa('0xa')](_0x3272fb);}}}module[_0x47fa('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x3e7526){var _0x1db03d=parseInt(_0x3e7526,0xa);if(_0x1db03d<0x1||_0x1db03d>0x1f){throw new Error(EINVALID_DATE);}return _0x1db03d;}function timeCompare(_0x34e5b6,_0x559f7a,_0x50362e){var _0x11720c=_0x34e5b6[_0x47fa('0xe')]();var _0x327fde=extractTime(_0x559f7a);var _0x2c806d=_0x327fde[0x0];var _0x5dd782=_0x327fde[0x1];var _0x13129a=_0x34e5b6['clone']()[_0x47fa('0xf')](_0x2c806d)[_0x47fa('0x10')](_0x5dd782);throwIfDateNotValid(_0x13129a);var _0x577e90=extractTime(_0x50362e);var _0x29071c=_0x577e90[0x0];var _0x480d19=_0x577e90[0x1];var _0x328523=_0x34e5b6[_0x47fa('0xe')]()[_0x47fa('0xf')](_0x29071c)['minutes'](_0x480d19);throwIfDateNotValid(_0x328523);if(_0x328523['isBefore'](_0x13129a)){var _0x1ad871=_0x11720c['clone']()[_0x47fa('0x11')]('day');var _0x2d2bd6=_0x11720c[_0x47fa('0xe')]()['endOf'](_0x47fa('0x12'));return _0x11720c[_0x47fa('0x13')](_0x13129a,_0x2d2bd6,undefined,'[]')||_0x11720c[_0x47fa('0x13')](_0x1ad871,_0x328523,undefined,'[]');}else{return _0x11720c[_0x47fa('0x13')](_0x13129a,_0x328523,undefined,'[]');}}module[_0x47fa('0xd')][_0x47fa('0x14')]=timeCompare;function dowCompare(_0x361cad,_0x4587c6,_0x3d12c8){var _0x16cf85=_0x361cad[_0x47fa('0x6')]('en')['format'](_0x47fa('0x15'))[_0x47fa('0x7')]();return circularDoWInterval(_0x4587c6,_0x3d12c8)[_0x47fa('0x16')](_0x16cf85);}module[_0x47fa('0xd')][_0x47fa('0x17')]=dowCompare;function domCompare(_0x208e84,_0x2ccb50,_0x59f64f){var _0xdc7199=_0x208e84[_0x47fa('0x18')]();if(_0x2ccb50===_0x59f64f){return _0xdc7199===_0x2ccb50;}else{var _0x359a76=_0x208e84[_0x47fa('0x19')]();var _0x35141b=_0x2ccb50<_0x59f64f;let _0x3ae809=![];var _0x11b87e=0x0;var _0x402b14=0x0;if(_0x35141b){_0x11b87e=Math['max'](0x1,_0x2ccb50);_0x402b14=Math[_0x47fa('0x1a')](_0x59f64f,_0x359a76);_0x3ae809=_0xdc7199>=_0x11b87e&&_0xdc7199<=_0x402b14;}else{_0x11b87e=Math['min'](_0x2ccb50,_0x359a76);_0x402b14=Math['max'](0x1,_0x59f64f);_0x3ae809=_0xdc7199>=_0x11b87e||_0xdc7199<=_0x402b14;}return _0x3ae809;}}module[_0x47fa('0xd')][_0x47fa('0x1b')]=domCompare;function monthCompare(_0x28ced9,_0x46bf3e,_0x5029fc){var _0xf2f386=_0x28ced9[_0x47fa('0x6')]('en')[_0x47fa('0x1c')]('MMM')['toLowerCase']();return circularMonthInterval(_0x46bf3e,_0x5029fc)[_0x47fa('0x16')](_0xf2f386);}module['exports'][_0x47fa('0x1d')]=monthCompare;function iftime(_0x3bddc7,_0x6905f0=moment['tz'][_0x47fa('0x1e')](),_0x19c7f9=moment()){if(!validateRx[_0x47fa('0x1f')](_0x3bddc7)){throw new Error(EINVALID_STRING);}else{var _0x2d8c0a=(moment[_0x47fa('0x20')](_0x19c7f9)?_0x19c7f9[_0x47fa('0xe')]():moment(_0x19c7f9))['tz'](_0x6905f0)[_0x47fa('0x6')]('en');throwIfDateNotValid(_0x2d8c0a);var _0x15f3f3=_0x3bddc7[_0x47fa('0x5')](',');var _0x2fbece=_0x15f3f3[0x0];var _0x4b2702=_0x15f3f3[0x1];var _0x5c270e=_0x15f3f3[0x2];var _0xb2540a=_0x15f3f3[0x3];let _0x519288=!![];if(_0x2fbece!=='*'){var _0xa85dd0=_0x2fbece['split']('-');var _0x2a2249=_[_0x47fa('0x21')](_0xa85dd0[0x0],0x5,'0');var _0x1cb368=_0xa85dd0[_0x47fa('0x22')]===0x2?_[_0x47fa('0x21')](_0xa85dd0[0x1],0x5,'0'):_0x2a2249;_0x519288=timeCompare(_0x2d8c0a,_0x2a2249,_0x1cb368);}let _0x3b480c=!![];if(_0x4b2702!=='*'){var _0x1e0a68=_0x4b2702[_0x47fa('0x5')]('-');var _0x170dcf=_0x1e0a68[0x0];var _0x5572a9=_0x1e0a68[_0x47fa('0x22')]===0x2?_0x1e0a68[0x1]:_0x170dcf;_0x3b480c=dowCompare(_0x2d8c0a,_0x170dcf,_0x5572a9);}let _0x43188e=!![];if(_0x5c270e!=='*'){var _0x2bca91=_0x5c270e[_0x47fa('0x5')]('-');var _0x1b69f1=parseDom(_0x2bca91[0x0]);var _0x35ff47=_0x2bca91[_0x47fa('0x22')]===0x2?parseDom(_0x2bca91[0x1]):_0x1b69f1;_0x43188e=domCompare(_0x2d8c0a,_0x1b69f1,_0x35ff47);}let _0x1b21a8=!![];if(_0xb2540a!=='*'){var _0x377e49=_0xb2540a[_0x47fa('0x5')]('-');var _0x5e76bb=_0x377e49[0x0];var _0x37ccef=_0x377e49[_0x47fa('0x22')]===0x2?_0x377e49[0x1]:_0x377e49[0x0];_0x1b21a8=monthCompare(_0x2d8c0a,_0x5e76bb,_0x37ccef);}return _0x519288&&_0x3b480c&&_0x43188e&&_0x1b21a8;}}module[_0x47fa('0xd')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index fa15386..13c04c2 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f03=['bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','path','../config/environment','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x2f03,0x106));var _0x32f0=function(_0xcef38c,_0x2356b1){_0xcef38c=_0xcef38c-0x0;var _0x3144ca=_0x2f03[_0xcef38c];return _0x3144ca;};'use strict';var path=require(_0x32f0('0x0'));var util=require('util');var moment=require('moment');var winston=require('winston');var config=require(_0x32f0('0x1'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x32f0('0x2')]():_0x32f0('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':_0x32f0('0x4'),'error':_0x32f0('0x5'),'warn':_0x32f0('0x6'),'info':_0x32f0('0x7'),'print':_0x32f0('0x8'),'success':_0x32f0('0x9'),'http':_0x32f0('0xa'),'verbose':'bold\x20magenta','debug':_0x32f0('0xb'),'silly':_0x32f0('0xc')};winston[_0x32f0('0xd')](XC_LOG_COLORS);function getLogFileName(_0x1dfdf4,_0x346d96,_0x5260cb){var _0x1cc307=_0x1dfdf4||_0x32f0('0xe');return path[_0x32f0('0xf')](_0x1cc307,util[_0x32f0('0x10')](_0x32f0('0x11'),_0x346d96,_0x5260cb));}function formatter(_0x41f736,_0x29d8f){_0x29d8f[_0x32f0('0x12')]=_0x29d8f['message']['replace'](/@@{/g,_0x32f0('0x13'))[_0x32f0('0x14')](/}@@/g,'}}}')[_0x32f0('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x32f0('0x10')](_0x32f0('0x15'),moment()[_0x32f0('0x10')](_0x32f0('0x16')),_0x29d8f[_0x32f0('0x17')][_0x32f0('0x18')](),_0x41f736,_0x29d8f[_0x32f0('0x12')]);}function fileFormat(_0x2a88e7,_0x5e7988){_0x5e7988[_0x32f0('0x12')]=_0x5e7988['message'][_0x32f0('0x14')](/@@{/g,'{{{')[_0x32f0('0x14')](/}@@/g,_0x32f0('0x19'))[_0x32f0('0x14')](/@{/g,'{{')[_0x32f0('0x14')](/}@/g,'}}');var _0x281fab=_0x5e7988[_0x32f0('0x1a')]&&Object[_0x32f0('0x1b')](_0x5e7988[_0x32f0('0x1a')])[_0x32f0('0x1c')]?'\x0a\x09'+JSON[_0x32f0('0x1d')](_0x5e7988[_0x32f0('0x1a')]):'';return util[_0x32f0('0x10')](_0x32f0('0x1e'),moment()['format'](_0x32f0('0x16')),_0x5e7988['level']['toUpperCase'](),_0x2a88e7,_0x5e7988[_0x32f0('0x12')],_0x281fab);}function consoleLogger(){var _0x22bdf3=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x32f0('0x1f'))][(_0x32f0('0x20'))]({'level':_0x32f0('0x21'),'json':![],'formatter':function(_0x2b0dee){return formatter('',_0x2b0dee);}})]});return _0x22bdf3;}function fileLogger(_0x919dca,_0x32f084){var _0x361acb=new winston[(_0x32f0('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x32f0('0x1f'))][(_0x32f0('0x23'))]({'name':util['format'](_0x32f0('0x24'),_0x919dca,_0x32f0('0x25')),'filename':getLogFileName(_0x32f084,_0x919dca,_0x32f0('0x25')),'level':_0x32f0('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1fe744){return fileFormat(_0x919dca,_0x1fe744);}}),new winston[(_0x32f0('0x1f'))][(_0x32f0('0x23'))]({'name':util[_0x32f0('0x10')](_0x32f0('0x24'),_0x919dca,debugLevel),'filename':getLogFileName(_0x32f084,_0x919dca,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3b4630){return fileFormat(_0x919dca,_0x3b4630);}}),new winston['transports'][(_0x32f0('0x20'))]({'level':_0x32f0('0x21'),'json':![],'formatter':function(_0x3db3e8){return fileFormat(_0x919dca,_0x3db3e8);}})]});return _0x361acb;}exports[_0x32f0('0x26')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x7058=['bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','{{{','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','File','error','Console','warn','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20green','gray'];(function(_0x41bd33,_0x8dd533){var _0x1ef83a=function(_0x5821aa){while(--_0x5821aa){_0x41bd33['push'](_0x41bd33['shift']());}};_0x1ef83a(++_0x8dd533);}(_0x7058,0x10b));var _0x8705=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x7058[_0x166d93];return _0xba708;};'use strict';var path=require(_0x8705('0x0'));var util=require(_0x8705('0x1'));var moment=require(_0x8705('0x2'));var winston=require(_0x8705('0x3'));var config=require(_0x8705('0x4'));var debugLevel=config[_0x8705('0x5')]?config[_0x8705('0x5')][_0x8705('0x6')]():_0x8705('0x7');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':_0x8705('0x8'),'error':_0x8705('0x9'),'warn':_0x8705('0xa'),'info':'white','print':'bold\x20white','success':_0x8705('0xb'),'http':_0x8705('0xc'),'verbose':_0x8705('0xd'),'debug':'bold\x20blue','silly':_0x8705('0xe')};winston[_0x8705('0xf')](XC_LOG_COLORS);function getLogFileName(_0x441d82,_0x35dc48,_0x3bfdf4){var _0x4b9474=_0x441d82||_0x8705('0x10');return path[_0x8705('0x11')](_0x4b9474,util[_0x8705('0x12')](_0x8705('0x13'),_0x35dc48,_0x3bfdf4));}function formatter(_0x294958,_0x175b44){_0x175b44[_0x8705('0x14')]=_0x175b44['message'][_0x8705('0x15')](/@@{/g,'{{{')[_0x8705('0x15')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x8705('0x15')](/}@/g,'}}');return util[_0x8705('0x12')](_0x8705('0x16'),moment()['format'](_0x8705('0x17')),_0x175b44['level'][_0x8705('0x18')](),_0x294958,_0x175b44[_0x8705('0x14')]);}function fileFormat(_0x3968e9,_0x357b5a){_0x357b5a[_0x8705('0x14')]=_0x357b5a[_0x8705('0x14')][_0x8705('0x15')](/@@{/g,_0x8705('0x19'))['replace'](/}@@/g,'}}}')[_0x8705('0x15')](/@{/g,'{{')[_0x8705('0x15')](/}@/g,'}}');var _0x9993c7=_0x357b5a[_0x8705('0x1a')]&&Object[_0x8705('0x1b')](_0x357b5a[_0x8705('0x1a')])[_0x8705('0x1c')]?'\x0a\x09'+JSON[_0x8705('0x1d')](_0x357b5a[_0x8705('0x1a')]):'';return util[_0x8705('0x12')](_0x8705('0x1e'),moment()[_0x8705('0x12')](_0x8705('0x17')),_0x357b5a[_0x8705('0x1f')][_0x8705('0x18')](),_0x3968e9,_0x357b5a['message'],_0x9993c7);}function consoleLogger(){var _0x177168=new winston[(_0x8705('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8705('0x21'))]['Console']({'level':'warn','json':![],'formatter':function(_0x371397){return formatter('',_0x371397);}})]});return _0x177168;}function fileLogger(_0x51d0e7,_0x2f9cfe){var _0x1e07e0=new winston[(_0x8705('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8705('0x21'))][(_0x8705('0x22'))]({'name':util[_0x8705('0x12')]('%s-%s',_0x51d0e7,_0x8705('0x23')),'filename':getLogFileName(_0x2f9cfe,_0x51d0e7,_0x8705('0x23')),'level':_0x8705('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fecb1){return fileFormat(_0x51d0e7,_0x4fecb1);}}),new winston[(_0x8705('0x21'))][(_0x8705('0x22'))]({'name':util[_0x8705('0x12')]('%s-%s',_0x51d0e7,debugLevel),'filename':getLogFileName(_0x2f9cfe,_0x51d0e7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x136460){return fileFormat(_0x51d0e7,_0x136460);}}),new winston['transports'][(_0x8705('0x24'))]({'level':_0x8705('0x25'),'json':![],'formatter':function(_0x2b00c6){return fileFormat(_0x51d0e7,_0x2b00c6);}})]});return _0x1e07e0;}exports[_0x8705('0x26')]=consoleLogger;exports[_0x8705('0x27')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 4b47f19..480a68d 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 _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x27f71b,_0x3fbf1c){_0x27f71b=_0x27f71b-0x0;var _0x3d9ce=_0x7a54[_0x27f71b];return _0x3d9ce;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=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(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x1a85,0x178));var _0x51a8=function(_0x235186,_0xf3fdc2){_0x235186=_0x235186-0x0;var _0x103007=_0x1a85[_0x235186];return _0x103007;};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 643299c..db543f8 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 _0x8e3f=['reduce','exports','safeTemplate','lodash','{\x20{\x20','string','isArray','map','isPlainObject','keys'];(function(_0x509344,_0x25e748){var _0x21fa88=function(_0x49c6c8){while(--_0x49c6c8){_0x509344['push'](_0x509344['shift']());}};_0x21fa88(++_0x25e748);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e3f[_0x122ef9];return _0x42fba0;};var _=require(_0xf8e3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42db69){return _0x42db69==='{{'?_0xf8e3('0x1'):'\x20}\x20}';}function safeTemplate(_0x3f3440){var _0x292de5=_0x3f3440;if(typeof _0x3f3440===_0xf8e3('0x2')){_0x292de5=_0x3f3440['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf8e3('0x3')](_0x3f3440)){_0x292de5=_0x3f3440[_0xf8e3('0x4')](function(_0x4dab56){return safeTemplate(_0x4dab56);});}else if(_[_0xf8e3('0x5')](_0x3f3440)){_0x292de5=Object[_0xf8e3('0x6')](_0x3f3440)[_0xf8e3('0x7')](function(_0x1ee9f3,_0x4e9e57){_0x1ee9f3[_0x4e9e57]=safeTemplate(_0x3f3440[_0x4e9e57]);return _0x1ee9f3;},{});}return _0x292de5;}module[_0xf8e3('0x8')][_0xf8e3('0x9')]=safeTemplate; \ No newline at end of file +var _0x2032=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2032,0xd9));var _0x2203=function(_0x153ebc,_0x49bf65){_0x153ebc=_0x153ebc-0x0;var _0x1781a5=_0x2032[_0x153ebc];return _0x1781a5;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2c2259){return _0x2c2259==='{{'?_0x2203('0x0'):_0x2203('0x1');}function safeTemplate(_0x4c28da){var _0x486390=_0x4c28da;if(typeof _0x4c28da===_0x2203('0x2')){_0x486390=_0x4c28da['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2203('0x3')](_0x4c28da)){_0x486390=_0x4c28da[_0x2203('0x4')](function(_0x44ccfd){return safeTemplate(_0x44ccfd);});}else if(_[_0x2203('0x5')](_0x4c28da)){_0x486390=Object[_0x2203('0x6')](_0x4c28da)[_0x2203('0x7')](function(_0x2e0f63,_0x2676aa){_0x2e0f63[_0x2676aa]=safeTemplate(_0x4c28da[_0x2676aa]);return _0x2e0f63;},{});}return _0x486390;}module[_0x2203('0x8')][_0x2203('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 187657a..fba1f44 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 _0x0965=['string','pathExists','then','Updating\x20app.json','writeJSON','fs-extra','../config/environment','resolve','server/app.json','legacy-libs','isArray','findIndex','name','motion2','apps','env','NODE_PATH'];(function(_0x107ba0,_0x5d2268){var _0x1edc9c=function(_0x1055ca){while(--_0x1055ca){_0x107ba0['push'](_0x107ba0['shift']());}};_0x1edc9c(++_0x5d2268);}(_0x0965,0x159));var _0x5096=function(_0x3d5cc9,_0x3d0c2e){_0x3d5cc9=_0x3d5cc9-0x0;var _0x3f39a1=_0x0965[_0x3d5cc9];return _0x3f39a1;};var fs=require(_0x5096('0x0'));var path=require('path');var config=require(_0x5096('0x1'));var root=config['root'];var APP_JSON_PATH=path[_0x5096('0x2')](root,_0x5096('0x3'));var NODEPATH=path[_0x5096('0x2')](root,_0x5096('0x4'));function setLegacyLibsNodeEnvPath(_0x15aca1){let _0x57a03d=![];if(Array[_0x5096('0x5')](_0x15aca1['apps'])){var _0x3c3afa=_0x15aca1['apps'][_0x5096('0x6')](function(_0x2946b2){return _0x2946b2[_0x5096('0x7')]===_0x5096('0x8');});if(_0x3c3afa>-0x1){var _0x22d705=_0x15aca1[_0x5096('0x9')][_0x3c3afa];if(typeof _0x22d705[_0x5096('0xa')][_0x5096('0xb')]!==_0x5096('0xc')){_0x22d705['env']['NODE_PATH']=NODEPATH;_0x57a03d=!![];}}return{'appConfig':_0x15aca1,'updated':_0x57a03d};}}function updateAppConfig(_0x5ac9a5){return fs[_0x5096('0xd')](APP_JSON_PATH)[_0x5096('0xe')](function(_0x26cd8e){if(_0x26cd8e){return fs['readJSON'](APP_JSON_PATH)[_0x5096('0xe')](function(_0x4264d9){var _0x412d8c=setLegacyLibsNodeEnvPath(_0x4264d9);if(_0x412d8c['updated']){_0x5ac9a5['info'](_0x5096('0xf'));return fs[_0x5096('0x10')](APP_JSON_PATH,_0x4264d9,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x5096('0x2')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0xf32b=['root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','env','NODE_PATH','string','pathExists','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf32b,0x1d9));var _0xbf32=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xf32b[_0x2b10c6];return _0x3789d2;};var fs=require(_0xbf32('0x0'));var path=require(_0xbf32('0x1'));var config=require(_0xbf32('0x2'));var root=config[_0xbf32('0x3')];var APP_JSON_PATH=path[_0xbf32('0x4')](root,_0xbf32('0x5'));var NODEPATH=path[_0xbf32('0x4')](root,_0xbf32('0x6'));function setLegacyLibsNodeEnvPath(_0x80750f){let _0x467214=![];if(Array[_0xbf32('0x7')](_0x80750f[_0xbf32('0x8')])){var _0x1e2018=_0x80750f['apps'][_0xbf32('0x9')](function(_0x3763d2){return _0x3763d2['name']==='motion2';});if(_0x1e2018>-0x1){var _0x2420d4=_0x80750f[_0xbf32('0x8')][_0x1e2018];if(typeof _0x2420d4[_0xbf32('0xa')][_0xbf32('0xb')]!==_0xbf32('0xc')){_0x2420d4[_0xbf32('0xa')][_0xbf32('0xb')]=NODEPATH;_0x467214=!![];}}return{'appConfig':_0x80750f,'updated':_0x467214};}}function updateAppConfig(_0x5f4625){return fs[_0xbf32('0xd')](APP_JSON_PATH)['then'](function(_0x4625ff){if(_0x4625ff){return fs['readJSON'](APP_JSON_PATH)['then'](function(_0x1c81c8){var _0x3c08d5=setLegacyLibsNodeEnvPath(_0x1c81c8);if(_0x3c08d5['updated']){_0x5f4625['info'](_0xbf32('0xe'));return fs[_0xbf32('0xf')](APP_JSON_PATH,_0x1c81c8,{'spaces':0x2});}else{return Promise[_0xbf32('0x4')]();}});}else{return Promise['resolve']();}});}module[_0xbf32('0x10')]=updateAppConfig; \ No newline at end of file